xorg-server-1.17.1/0000775000175100017510000000000012466505446011105 500000000000000xorg-server-1.17.1/Makefile.am0000664000175100017510000000316712323563340013055 00000000000000AUTOMAKE_OPTIONS=nostdinc # Required for automake < 1.14 ACLOCAL_AMFLAGS = -I m4 if COMPOSITE COMPOSITE_DIR=composite endif if GLX GLX_DIR=glx endif if DBE DBE_DIR=dbe endif if RECORD RECORD_DIR=record endif if DRI3 DRI3_DIR=dri3 endif if PRESENT PRESENT_DIR=present endif if PSEUDORAMIX PSEUDORAMIX_DIR=pseudoramiX endif if GLAMOR GLAMOR_DIR=glamor endif SUBDIRS = \ doc \ man \ include \ dix \ fb \ mi \ Xext \ miext \ os \ randr \ render \ Xi \ xkb \ $(PSEUDORAMIX_DIR) \ $(DBE_DIR) \ $(RECORD_DIR) \ xfixes \ damageext \ $(COMPOSITE_DIR) \ $(GLX_DIR) \ $(PRESENT_DIR) \ $(DRI3_DIR) \ exa \ $(GLAMOR_DIR) \ config \ hw \ test if XORG aclocaldir = $(datadir)/aclocal aclocal_DATA = xorg-server.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xorg-server.pc endif EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh DISTCHECK_CONFIGURE_FLAGS=\ --with-xkb-path=$(XKB_BASE_DIRECTORY) \ --with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \ --with-xkb-output='$${datadir}/X11/xkb/compiled' .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL DIST_SUBDIRS = \ doc \ man \ include \ dix \ fb \ mi \ Xext \ miext \ os \ pseudoramiX \ randr \ render \ Xi \ xkb \ dbe \ record \ xfixes \ damageext \ composite \ glx \ exa \ glamor \ config \ dri3 \ present \ hw \ test # gross hack relink: all $(AM_V_at)$(MAKE) -C hw relink install-headers: Makefile +find . -name Makefile | while read m; do \ if grep -q install-sdkHEADERS $$m; then \ (cd `dirname "$$m"` && make install-sdkHEADERS) \ fi \ done xorg-server-1.17.1/README0000664000175100017510000000224312160102336011664 00000000000000 X Server The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program can draw into. Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders. For a comprehensive overview of X Server and X Window System, consult the following article: http://en.wikipedia.org/wiki/X_server All questions regarding this software should be directed at the Xorg mailing list: http://lists.freedesktop.org/mailman/listinfo/xorg Please submit bug reports to the Xorg bugzilla: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg The master development code repository can be found at: git://anongit.freedesktop.org/git/xorg/xserver http://cgit.freedesktop.org/xorg/xserver For patch submission instructions, see: http://www.x.org/wiki/Development/Documentation/SubmittingPatches For more information on the git code manager, see: http://wiki.x.org/wiki/GitPage xorg-server-1.17.1/devbook.am0000664000175100017510000000343312456571574013004 00000000000000# # Generate output formats for a single DocBook/XML with/without chapters # # Variables set by the calling Makefile: # noinst_DATA: developers docs are not installed # docbook: the main DocBook/XML file, no chapters, appendix or image files # chapters: all files pulled in by an XInclude statement and images. # # # This makefile is intended for Developers Documentation and is not installed. # Do not use for Users docs or Specs which need to be installed and require olink support # Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 # for an explanation on documents classification. # # Developers documnetation is not installed noinst_DATA = # DocBook/XML file with chapters, appendix and images it includes dist_noinst_DATA = $(docbook) $(chapters) FILTER_XMLTO=$(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) if HAVE_STYLESHEETS XMLTO_HTML_FLAGS = \ --searchpath "$(XORG_SGML_PATH)/X11" \ --searchpath "$(abs_top_builddir)" \ -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl noinst_DATA += $(docbook:.xml=.html) %.html: %.xml $(chapters) $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< if HAVE_XMLTO_TEXT noinst_DATA += $(docbook:.xml=.txt) %.txt: %.xml $(chapters) $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< endif HAVE_XMLTO_TEXT if HAVE_FOP XMLTO_FO_FLAGS = \ --searchpath "$(XORG_SGML_PATH)/X11" \ --searchpath "$(abs_top_builddir)" \ --stringparam img.src.path=$(abs_builddir)/ \ -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl noinst_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps) %.pdf: %.xml $(chapters) $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< %.ps: %.xml $(chapters) $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< endif HAVE_FOP endif HAVE_STYLESHEETS CLEANFILES = $(noinst_DATA) xorg-server-1.17.1/xorg-server.m40000664000175100017510000000360412366220413013540 00000000000000dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl # XORG_DRIVER_CHECK_EXT(MACRO, PROTO) # -------------------------- # 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]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "xorg-server.h" #if !defined $1 #error $1 not defined #endif ]])], [_EXT_CHECK=yes], [_EXT_CHECK=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_CHECKING([if $1 is defined]) AC_MSG_RESULT([$_EXT_CHECK]) if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES $2" fi ]) xorg-server-1.17.1/ChangeLog0000664000175100017510002614023312466505443012607 00000000000000commit 3b0d1ba2266d2780bfc111bab74885b90458eca4 Author: Keith Packard Date: Tue Feb 10 14:43:34 2015 -0800 Release 1.17.1 Signed-off-by: Keith Packard commit f160e722672dbb2b5215870b47bcc51461d96ff1 Author: Olivier Fourdan Date: Fri Jan 16 08:44:45 2015 +0100 xkb: Check strings length against request size Ensure that the given strings length in an XkbSetGeometry request remain within the limits of the size of the request. Signed-off-by: Olivier Fourdan Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer (cherry picked from commit 20079c36cf7d377938ca5478447d8b9045cb7d43) commit 29be310c303914090298ddda93a5bd5d00a94945 Author: Olivier Fourdan Date: Fri Jan 16 20:08:59 2015 +0100 xkb: Don't swap XkbSetGeometry data in the input buffer The XkbSetGeometry request embeds data which needs to be swapped when the server and the client have different endianess. _XkbSetGeometry() invokes functions that swap these data directly in the input buffer. However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once (if there is more than one keyboard), thus causing on swapped clients the same data to be swapped twice in memory, further causing a server crash because the strings lengths on the second time are way off bounds. To allow _XkbSetGeometry() to run reliably more than once with swapped clients, do not swap the data in the buffer, use variables instead. Signed-off-by: Olivier Fourdan Signed-off-by: Peter Hutterer (cherry picked from commit 81c90dc8f0aae3b65730409b1b615b5fa7280ebd) commit 28f6427aec1f5a1982e1c01eff45af0d401bf659 Author: Keith Packard Date: Mon Feb 2 07:41:06 2015 +0100 Update to version 1.17.0 Signed-off-by: Keith Packard commit 697b696e5e24d0679f133183a3bb0852025377c2 Author: Dave Airlie Date: Fri Jan 30 09:59:49 2015 +1000 config/udev: Respect seat assignments when assigned devices Jonathan Dieter posted a few patches to do this inside the Xorg server but it makes no sense to do it there, just have the code we use to probe the device list at startup check seat assignments using the same code we check at hotplug time. Bugilla: https://bugzilla.redhat.com/show_bug.cgi?id=1183654 Reviewed-by: Peter Hutterer Acked-by: Hans de Goede Tested-by: Jonathan Dieter Signed-off-by: Dave Airlie Signed-off-by: Keith Packard commit df1b401f57ad4b4925bad66684445b476562f26f Author: Dave Airlie Date: Wed Jan 7 09:19:27 2015 +1000 randr: attempt to fix primary on slave output (v2) If the user wants to set one of the slave devices as the primary output, we shouldn't fail to do so, we were returning BadMatch which was tripping up gnome-settings-daemon and bad things ensues. Fix all the places we use primaryOutput to work out primaryCrtc and take it into a/c when slave gpus are in use. v2: review from Aaron, fix indent, unhide has_primary from macro. I left the int vs Bool alone to be consistent with code below, a future patch could fix both. Signed-off-by: Dave Airlie Reviewed-by: Aaron Plattner Signed-off-by: Keith Packard commit 62fcd364ac8c71a2db1db84b17b17cade6832492 Author: Adel Gadllah Date: Sat Jan 3 21:12:25 2015 +0100 dri2: Set vdpau driver name if ddx does not provide any driver name Currently when the ddx does not set any driver name we set DRI2 driver but not the VDPAU driver name. The result is that VDPAU drivers will not get found by libvdpau when the modesetting driver is being used. Just assume that the VDPAU driver matches the DRI2 driver name, this is true for nouveau, r300, r600 and radeonsi i.e all VDPAU drivers currently supported by mesa. Signed-off-by: Adel Gadllah Reviewed-by: Alex Deucher Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit fe4c774c572e3f55a7417f0ca336ae1479a966ad Author: Nikhil Mahale Date: Sat Jan 24 17:06:59 2015 -0800 os: Fix timer race conditions Fixing following kind of race-conditions - WaitForSomething() | ----> // timers -> timer-1 -> timer-2 -> null while (timers && (int) (timers->expires - now) <= 0) // prototype - DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev) DoTimer(timers, now, &timers) | | ----> OsBlockSignals(); .... OS Signal comes just before blocking it, .... timer-1 handler gets called. // timer-1 gets served and scheduled again; // timers -> timer-2 -> timer-1 -> null .... *prev = timer->next; timer->next = NULL; // timers -> null // timers list gets corrupted here and timer-2 gets removed from list. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86288 Signed-off-by: Nikhil Mahale Reviewed-by: Julien Cristau v2: Apply warning fixes from Keith Packard Reviewed-by: Aaron Plattner Signed-off-by: Aaron Plattner Signed-off-by: Keith Packard commit 58f28b0427f0a0c0c445f314bd42721ca8e1e844 Author: Keith Packard Date: Fri Jan 23 10:59:39 2015 -0800 Update to version 1.16.99.902 Signed-off-by: Keith Packard commit fef2f6357b40b238ae01c4c80b0d29b17b839686 Author: Jason Ekstrand Date: Tue Jan 13 15:08:38 2015 -0800 modesetting: Return the crtc for a drawable even if it's rotated All of our checks for what crtc we are on take rotation into account so we select the correct crtc. The only problem is that we weren't returning it we were rotated. This caused X to think DRI3 apps were not on any crtc and limit them to 1 FPS. Signed-off-by: Jason Ekstrand Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 3dcd591fa9b71a3dce58d612ca5970209d8386eb Author: Jason Ekstrand Date: Tue Jan 13 15:08:37 2015 -0800 modesetting: Add support for using RandR shadow buffers This replaces the stubs for shadow buffer creation/allocation with actual functions and adds a shadow_destroy function. With this, we actually get shadow buffers and RandR now works properly. Most of this is copied from the xf86-video-intel driver and modified for modesetting. v2 Jason Ekstrand : - Fix build with --disable-glamor - Set the pixel data pointer in the pixmap header for dumb shadow bo's - Call drmmode_create_bo with the right bpp v2 Jason Ekstrand : - Make shadow buffers per-crtc and leave shadow_enable alone Signed-off-by: Jason Ekstrand Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 7c656bfcae1d68aeffd5e202b3c1569885f5d13d Author: Jason Ekstrand Date: Tue Jan 13 15:08:36 2015 -0800 modesetting: Add drmmode_bo_has_bo and drmmode_bo_map helper function Signed-off-by: Jason Ekstrand Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit b4703a5a6e529b78810db8d8782317f0b4e2f265 Author: Jason Ekstrand Date: Tue Jan 13 15:08:35 2015 -0800 modesetting: Refactor drmmode_glamor_new_screen_pixmap The original drmmode_glamor_new_screen_pixmap function was specific to the primary screen pixmap. This commit pulls the guts out into a new, more general, drmmode_set_pixmap_bo function for setting a buffer on a pixmap. The new function also properly tears down the glamor bits if the buffer being set is NULL. The drmmode_glamor_new_screen_pixmap function is now just a 3-line wrapper around drmmode_set_pixmap_bo. v2 Jason Ekstrand : - Re-arranged code in drmmode_set_pixmap_bo and drmmode_glamor_handle_new_screen_pixmap so that glamor_set_screen_pixmap only gets called for the screen pixmap - Guard the call to glamor_set_screen_pixmapa with a drmmode->glamor check Signed-off-by: Jason Ekstrand Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit bb23fbf5bb278113c9c481875423b4d128180972 Author: Adam Jackson Date: Mon Jan 5 16:48:11 2015 -0500 dix: make RegionInit legal C++ The CVE fix in: commit 97015a07b9e15d8ec5608b95d95ec0eb51202acb Author: Alan Coopersmith Date: Wed Jan 22 22:37:15 2014 -0800 dix: integer overflow in RegionSizeof() [CVE-2014-8092 3/4] offended the C++ demons: ../../include/regionstr.h:147:45: error: invalid conversion from 'void*' to 'pixman_region16_data_t* {aka pixman_region16_data*}' [-fpermissive] Normally this isn't a problem, because around here we have the sense and common decency to not use C++, but this does make tigervnc fail to build, which is a little rude of us. Signed-off-by: Adam Jackson Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 082931014811e587a9734cbf4d88fd948979b641 Author: Chris Wilson Date: Sat Jan 17 10:09:54 2015 +0000 dri2: SourceOffloads may be for DRI3 only As a DDX may declare offload support without supporting DRI2 (because it is using an alternative acceleration mechanism like DRI3), when iterating the list of offload_source Screens to find a matching DRI2 provider we need to check before assuming it is DRI2 capable. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88514 Signed-off-by: Chris Wilson Reviewed-by: Dave Airlie Signed-off-by: Keith Packard commit f27d743c1899f307ec8063febbb3198c8945d372 Author: Carlos Olmedo Escobar Date: Wed Jan 21 01:44:54 2015 +0100 Avoid possible null pointer dereference. Signed-off-by: Carlos Olmedo Escobar Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 437d2ec5f250f8ab4b44cbae56f938719802e1cc Author: Carlos Sánchez de La Lama Date: Wed Jan 21 10:22:05 2015 +0100 randr: swap num-preferred field on RRGetOutputInfo reply Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88614 Signed-off-by: Carlos Sánchez de La Lama Reviewed-by: Dave Airlie Signed-off-by: Keith Packard commit 3d12941b408de7a3bdc579e34e119f8aa81ea926 Author: Keith Packard Date: Thu Jan 22 22:28:34 2015 -0800 drivers/modesetting: Save current BlockHandler on return in msBlockHandler If the BlockHandler chain is modified while it is active, we need to re-fetch the current value and store it in our private for use the next time through. Signed-off-by: Dave Airlie Signed-off-by: Keith Packard commit b3e496c6d21058147de9a11b78860e73c74db3cb Author: Dave Airlie Date: Fri Jan 23 16:28:28 2015 +1000 glamor: use screen blockhandler rather than dix one (v3) This adds glamor into the block handler call chain in the correct place. This should fix interactions between glamor and drivers requiring damage from glamor. v2: okay don't consolidate, just leave things wierd for now remove blcokhandler in screen close. v3: block handler wrapping the right way. Signed-off-by: Dave Airlie Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 5af2f5b7d2f955586d0cb40eb30812f1893db22e Author: Markus Wick Date: Thu Jan 15 22:03:18 2015 +0100 xwayland: Set glamor filter to nearest glEGLImageTargetTexture2DOES only set the first level. Mesa handles this new texture as incomplete and renders a black screen. We also want to prevent linear filtering. https://bugs.freedesktop.org/show_bug.cgi?id=81800 Signed-off-by: Markus Wick Reviewed-and-Tested-by: Michel Dänzer Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 5f2e8ac51ccbf7c02f25c8cb7617df0238418cd1 Merge: 4e12d7b 4301479 Author: Keith Packard Date: Sat Jan 10 14:51:57 2015 +1300 Merge remote-tracking branch 'whot/for-keith' commit 4e12d7b6f4489fa06475465993a3e1e1d896390b Author: Jasper St. Pierre Date: Sun Jan 4 23:27:32 2015 -0800 modesetting: Update the cursor without hiding it In the new KMS APIs, the legacy drmModeSetCursor ioctl actually waits for a vblank after changing the cursor image before returning, meaning that the X server, in attempting to hide the cursor before updating its image, actually makes that hide *visible* for a full vblank. It's unknown why the X server does this by default, but turn it off. If we're with a legacy driver that doesn't support the modern drmModeSetCursor by waiting for a vblank before returning, we're going to get a tiny bit of tearing on the cursor plane. But between tearing with a new cursor image and tearing with a blank cursor image, I'd rather the former. The only proper solution to this is an atomic ioctl that page flips all planes, including the cursor plane, at vblank time and at the same time. Signed-off-by: Keith Packard Reviewed-by: Keith Packard commit 43014795087a0a8774dd9687f5967329b15f06a2 Author: Olivier Fourdan Date: Mon Jan 5 16:44:22 2015 +0100 Synchronize capslock in Xnest and Xephyr In Xnest or Xephyr, pressing CapsLock when focus is on another window does not update the state in the nested X server. This is because when synchronizing the lock modifier, sending a keypress or a key release only is not sufficient to toggle the state, unlike regular modifiers, one has to emulate a full press/release to lock or unlock the modifier. Signed-off-by: Olivier Fourdan Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 24b943132f90bc72ce8b5dc954fe9ee8484edfc2 Author: Olivier Fourdan Date: Fri Jan 2 18:50:17 2015 +0100 Fix subwindow in Xi emulated events Bug: 70790 Signed-off-by: Olivier Fourdan commit b058dec281568d6a9c5b5e230c20eed096cbdc6d Author: Peter Hutterer Date: Mon Jan 5 11:19:46 2015 +1000 mi: fix accidental x/y coordinate swap Reported-by: Adam Greenblatt Signed-off-by: Peter Hutterer Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 23a11fd85e12e94d29ee6d33715ac49684867b16 Author: Keith Packard Date: Sun Jan 4 19:13:35 2015 -0800 doc: Create a script to filter xmlto output This reduces the build log spam while still preserving the xmlto status to catch build failures correctly. Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer commit 1c01633877caa4239f901f02fbe113926318d030 Merge: 3573855 e774663 Author: Keith Packard Date: Sun Jan 4 17:02:25 2015 -0800 Merge remote-tracking branch 'ajax/xserver-next' commit 3573855514557a518de40a93b3c578f28c7d9c2b Author: Olivier Fourdan Date: Wed Dec 3 13:49:37 2014 +0100 Remove explicit dependency on $(WAYLAND_LIBS) Xwayland Makefile explicitely set its dependencies on WAYLAND_LIBS. If the ibrairies are installed in a non-standard path, WAYLAND_LIBS contains '-L/path/to/the/lib' which will fail at build time with: "No rule to make target '-L/path/to/the/lib', needed by 'Xwayland'. Stop" Remove that explicit dependency to avoid the problem (LDADD ought to be enough to get the right libraries linked). Signed-off-by: Olivier Fourdan Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit de89c6b8c6e81bad131c7f432e355cb42d233e87 Author: Peter Hutterer Date: Tue Dec 16 13:59:45 2014 +1000 xfree86: rename Xorg.bin to Xorg If the suid wrapper is enabled, /usr/bin/Xorg is just a shell script that execs either /usr/libexec/Xorg.bin directly or the Xorg.wrap binary which then execve's /usr/libexec/Xorg.bin. Either way, we end up with Xorg.bin, which is problematic for two reasons: * ps shows the command as Xorg.bin * _COMM and _EXE in systemd's journal will both show Xorg.bin as well There's not much we can do about the path, but having the actual command stay as Xorg means better compatibility to existing scripts. And, the reason for this path: the command journalctl _COMM=Xorg works universally, regardless of whether the wrapper is used or not. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard Acked-by: Hans de Goede commit ee21be1324de1d6ef14e529fed7b75992e971beb Author: Peter Hutterer Date: Thu Dec 11 10:32:45 2014 +1000 dix: offset touch root coordinates by ScreenRec origins (#86655) For two ScreenRecs abs pointer positioning was working fine, but touch events stuck to the lower/right edge on any screen but the one with a 0/0 origin. Cause is a missing offset by the screen coordinates, causing the root coordinates in the event to desktop-wide, not screen-wide. Offset properly, just like we do for pointer events. X.Org Bug 86655 Signed-off-by: Peter Hutterer commit dc777c346d5d452a53b13b917c45f6a1bad2f20b Author: Keith Packard Date: Sat Jan 3 08:46:45 2015 -0800 dix: Allow zero-height PutImage requests The length checking code validates PutImage height and byte width by making sure that byte-width >= INT32_MAX / height. If height is zero, this generates a divide by zero exception. Allow zero height requests explicitly, bypassing the INT32_MAX check. Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith commit 924996c41c419dda0f02a96aafdf52f7670ff4ea Author: Michele Baldessari Date: Wed Dec 3 11:53:10 2014 -0500 ephyr: Implement per-screen colormaps Xephyr's pseudocolor emulation added in: commit 81a3b6fe27567b4f91033ece69996aa6bf8d01a3 Author: Matthew Allum Date: Mon Nov 8 22:39:47 2004 +0000 Add support to Xephyr for lower depths than hosts only tracks one global colormap for the whole (Xephyr) display. Move this to per-screen state so each screen's colormap can be correct. [ajax: rebased to 1.17, cleaned up commit message] Reviewed-by: Adam Jackson Signed-off-by: Michele Baldessari Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 7b076fdfc0e7a98430b6cb1c43079c137d7d3a6c Author: Carl Worth Date: Thu Dec 11 19:09:48 2014 -0800 os/xsha1.c: Add license and copyright attribution. I'm interested in copying this code to the mesa project, but before doing that it seems prudent to have the license and copyright attributions in place before copying that. To get this list of names I went through: git log -- os/xsha1.c and: git log -- render/glyph.c Signed-off-by: Keith Packard commit 66726064204b869a24e5a8dc6e24daa5acb92bab Author: Kenneth Graunke Date: Tue Dec 30 11:51:43 2014 -0800 modesetting: Fix build with --disable-glamor. present.c: In function 'ms_present_flush': present.c:204:9: error: implicit declaration of function 'glamor_block_handler' Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87858 Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt Reviewed-by: Jasper St. Pierre Reviewed-by: Rob Clark Signed-off-by: Keith Packard commit d723928870eea9fc2554abe137d6e57f7ad29e98 Author: Keith Packard Date: Sat Dec 27 09:11:33 2014 -0800 glamor: Fix nlines in glamor_xv_put_image when src_y is odd The number of lines of video to update in the texture needs to be computed from the height of the updated source, not the full height of the source. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 09230a2d435aa7f893ad5022220e3eb39ffb6db5 Author: Kenneth Graunke Date: Thu Dec 11 13:37:14 2014 -0800 modesetting: Add vblank synchronization support when using Present. modesetting hooked up vblank support for DRI2, but was missing support for vblanks in Present. This is mostly copy and pasted from Keith's code in the intel driver. v2: Use ms_crtc_msc_to_kernel_msc in ms_present_queue_vblank to hook up the vblank_offset workaround for bogus MSC values (which the DRI2 code already did). Also simplify the ms_present_get_crtc function. vblank.c already implements the functionality; we just need to convert types. v3: Fix ms_flush_drm_events return code. I'd copied code where 0 meant success into a function that returned a boolean, so the return code was always backwards. Also add DebugPresent calls in ms_present_vblank_{handler,abort}. Signed-off-by: Kenneth Graunke Reviewed-by: Keith Packard Tested-by: Jason Ekstrand Signed-off-by: Keith Packard commit 3b5be33fc55b3090d996014fa56603edb9c1d411 Author: Kenneth Graunke Date: Thu Dec 11 13:48:04 2014 -0800 modesetting: Include glamor.h from driver.h. We basically want it throughout the driver. Signed-off-by: Kenneth Graunke Reviewed-by: Keith Packard Tested-by: Jason Ekstrand Signed-off-by: Keith Packard commit 7d1fc04d27857c999bd732d54a0b36f5079449b8 Author: Kenneth Graunke Date: Thu Dec 18 17:58:18 2014 -0800 modesetting: Check DPMS mode in ms_covering_crtc(). crtc->enabled is insufficient; we should also make sure DPMS is on. Signed-off-by: Kenneth Graunke Reviewed-by: Keith Packard Tested-by: Jason Ekstrand Signed-off-by: Keith Packard commit 8affaade2c127ea08989c86e7d71cc9da3db1824 Author: Kenneth Graunke Date: Thu Dec 18 17:55:29 2014 -0800 modesetting: Track the CRTC's DPMS mode. We don't want to try to vblank synchronize to monitors which are off. In order to handle that properly, we need to know the CRTC's DPMS mode. Signed-off-by: Kenneth Graunke Reviewed-by: Keith Packard Tested-by: Jason Ekstrand Signed-off-by: Keith Packard commit b51f804b1ca826699296aff9de27d19257d78dae Author: Kenneth Graunke Date: Thu Dec 18 17:22:00 2014 -0800 present: If present_queue_vblank() fails, do present_execute(). Previously, if present_queue_vblank() failed, we simply dropped the present request on the floor, and returned an error. This was rather mean to clients - after presenting, they wait for a PresentComplete event to come back. But since the present never happens, they end up waiting forever, and lock up in poll(). This patch falls back to present_execute if present_queue_vblank fails. We still print a debugging message to warn when queueing fails, which allows us to continue debugging problems, but makes Present robust enough to not lock up people's compositing manager when vblank bugs happen. v2: Don't do present_queue_vblank() /and/ present_execute() (a bug that snuck in during last minute tidying). Signed-off-by: Kenneth Graunke Reviewed-by: Keith Packard Tested-by: Jason Ekstrand Signed-off-by: Keith Packard commit f9e22cefcb9684bf495ada3ec4b0231ab2dc6cff Author: Dima Ryazanov Date: Mon Dec 22 11:35:29 2014 -0800 Fix "Back", "Forward", and other special mouse buttons in XWayland. Currently, the indexes are off by 4 because of the scroll buttons. Signed-off-by: Dima Ryazanov Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 70a6f65f9e2b26ef7539dcacfcfea927bc1f13fd Author: Michel Dänzer Date: Thu Dec 25 11:42:03 2014 +0900 glamor: Make sure Xvideo source image data is properly aligned _glamor_upload_bits_to_pixmap_texture currently ignores the stride parameter, but __glamor_upload_pixmap_to_texture uses 4-byte alignment via glPixelStorei(GL_UNPACK_ALIGNMENT, 4). Also fix up the stride argument passed in though, in case it starts being used properly in the future. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87455 Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 11b85ab2fc944c0645df43180a6c7e2d6a06483a Author: Michel Dänzer Date: Wed Dec 24 11:46:46 2014 +0900 glamor: Make glamor_purge_fbo static Only called from glamor_fbo.c now. Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 8323d2e90150bb86a12d00a16269c69a24efc896 Author: Michel Dänzer Date: Wed Dec 24 11:46:18 2014 +0900 glamor: Call glamor_pixmap_destroy_fbo from glamor_set_pixmap_private Calling glamor_purge_fbo directly was incorrect for large pixmaps. Fixes use-after free with large pixmaps: ==2029== Invalid write of size 8 ~ ==2029== at 0x85F93AD: __xorg_list_del (list.h:184) ==2029== by 0x85F93AD: xorg_list_del (list.h:204) ==2029== by 0x85F93AD: glamor_fbo_expire (glamor_fbo.c:280) ==2029== by 0x85F95CA: glamor_pixmap_fbo_cache_put (glamor_fbo.c:159) ==2029== by 0x85D7AB5: glamor_destroy_textured_pixmap (glamor.c:228) ==2029== by 0xC1BDDC4: radeon_glamor_destroy_pixmap (radeon_glamor.c:272) ==2029== by 0x519D00: damageDestroyPixmap (damage.c:1473) ==2029== by 0x4DD307: XvDestroyPixmap (xvmain.c:370) ==2029== by 0x4DB975: ShmDestroyPixmap (shm.c:258) ==2029== by 0x5098F6: FreePicture (picture.c:1425) ==2029== by 0x85E678E: glamor_composite_clipped_region (glamor_render.c:1558) ==2029== by 0x85F763A: glamor_composite_largepixmap_region (glamor_largepixmap.c:1347) ==2029== by 0x85E7964: _glamor_composite (glamor_render.c:1679) ==2029== by 0x85E7A38: glamor_composite (glamor_render.c:1758) ==2029== Address 0x1141d3c0 is 0 bytes inside a block of size 64 free'd ==2029== at 0x4C29E90: free (vg_replace_malloc.c:473) ==2029== by 0x85D7167: glamor_set_pixmap_private (glamor.c:570) ==2029== by 0xC1BDDC4: radeon_glamor_destroy_pixmap (radeon_glamor.c:272) ==2029== by 0x519D00: damageDestroyPixmap (damage.c:1473) ==2029== by 0x4DD307: XvDestroyPixmap (xvmain.c:370) ==2029== by 0x4DB975: ShmDestroyPixmap (shm.c:258) ==2029== by 0x45B246: doFreeResource (resource.c:875) ==2029== by 0x45BD5E: FreeResource (resource.c:905) ==2029== by 0x43444B: ProcFreePixmap (dispatch.c:1422) ==2029== by 0x43856E: Dispatch (dispatch.c:432) ==2029== by 0x43C96F: dix_main (main.c:298) ==2029== by 0x6CFAB44: (below main) (libc-start.c:287) Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 0d37c7e4b5d63308a60ca59c9de981b380af8689 Author: Keith Packard Date: Fri Dec 19 18:40:19 2014 -0800 modesetting: Detect whether damage tracking is needed Call drmModeDirtyFB and check the return value to detect whether the driver support for damage tracking is present, only initialize it in that case. Signed-off-by: Keith Packard Reviewed-by: Jason Ekstrand commit 7804305673ca63720e8736c0c88afa711ebe208a Author: Keith Packard Date: Fri Dec 19 19:34:34 2014 -0800 modesetting: Fix damage tracking auto-disable code dispatch_dirty_region was only returning -EINVAL error codes, otherwise it would return 0. The kernel returns -ENOSYS when the driver doesn't support damage tracking, so dispatch_dirty would never see the error and never disable damage tracking. Pass all errors back from dispatch_dirty_region and let dispatch_dirty deal with them. Signed-off-by: Keith Packard Reviewed-by: Jason Ekstrand commit 826e7c2b36f192fbbe7ddff37eb559f4d6301146 Author: Alan Coopersmith Date: Wed Dec 17 20:50:02 2014 -0800 Solaris: Move shared declarations to xf86_OSlib.h Gets rid of gcc 4.8 warnings: xf86AutoConfig.c:211:9: warning: nested extern declaration of 'xf86SolarisFbDev' [-Wnested-externs] sun_VTsw.c:44:1: warning: no previous prototype for 'xf86VTRelease' [-Wmissing-prototypes] sun_VTsw.c:59:1: warning: no previous prototype for 'xf86VTAcquire' [-Wmissing-prototypes] and ensures caller & definition stay in sync. Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit bebcac0cf790b220e849e8905139d0744a606928 Author: Alan Coopersmith Date: Wed Dec 17 20:50:01 2014 -0800 Move RTLD_DI_SETSIGNAL code into a separate block to quiet warning Gets rid of gcc 4.8 warning: osinit.c:211:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 2c7111235ca5c3bd23cd824589dfbc0ebd477585 Author: Keith Packard Date: Sat Dec 13 22:22:30 2014 -0800 modesetting: Enable Xv when using glamor This just calls the existing function to create the relevant Xv adaptor and hook it up. Signed-off-by: Keith Packard Reviewed-by: Alex Deucher commit 5a541bd5e7adc9fdcc1883558be9218f82a284e0 Author: Keith Packard Date: Tue Dec 16 23:14:34 2014 -0800 modesetting: [v2] Don't re-enable the cursor when loading the image Hidden cursors also have their image updated; re-enabling the cursor each time the image is set will cause it to re-appear. * Unifies the code that was in drmmode_load_cursor_argb and drm_mode_show_cursor and moves it to a new drmmode_set_cursor * Add a new boolean, 'cursor_up', to the per-crtc private data to track whether the cursor should be displayed. * Call drmmode_set_cursor from drm_mode_show_cursor and, if the cursor should be displayed, from drm_mode_load_cursor_argb. v2: Call drmModeSetCursor2 when loading a new cursor image if the cursor should be displayed. Signed-off-by: Keith Packard Reviewed-by: Michel Dänzer commit 0f5fdaf600bfeada966aea942cb3e347d4efee30 Author: Michel Dänzer Date: Thu Dec 11 16:50:40 2014 +0900 glamor: Make sure glamor_egl_close_screen wraps glamor_close_screen The other way around fails to destroy the screen pixmap EGL image: ==1782== 80 (32 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 981 of 2,171 ==1782== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==1782== by 0xF9D4BD2: dri2_create_image_from_dri (egl_dri2.c:1264) ==1782== by 0xF9D4BD2: dri2_create_image_dma_buf (egl_dri2.c:1764) ==1782== by 0xF9D4BD2: dri2_create_image_khr (egl_dri2.c:1798) ==1782== by 0xF9C7937: eglCreateImageKHR (eglapi.c:1494) ==1782== by 0x85D5655: _glamor_egl_create_image (glamor_egl.c:134) ==1782== by 0x85D5655: glamor_egl_create_textured_pixmap (glamor_egl.c:302) ==1782== by 0x85D579B: glamor_egl_create_textured_screen (glamor_egl.c:225) ==1782== by 0xC1BE05D: radeon_glamor_create_screen_resources (radeon_glamor.c:67) ==1782== by 0xC1B6153: RADEONCreateScreenResources_KMS (radeon_kms.c:258) ==1782== by 0x4B2105: xf86CrtcCreateScreenResources (xf86Crtc.c:709) ==1782== by 0x43C823: dix_main (main.c:223) ==1782== by 0x6CFAB44: (below main) (libc-start.c:287) Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit c8d4c0a25dba49d1486761438b96374672b29645 Author: Michel Dänzer Date: Thu Dec 11 16:50:39 2014 +0900 glamor: Make glamor_destroy_textured_pixmap idempotent For robustness against drivers which may call both glamor_(egl_)destroy_textured_pixmap and glamor_destroy_pixmap. Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 0355e280a39dee68981b2cbebfa2573cfde2f5bd Author: Michel Dänzer Date: Thu Dec 11 16:50:38 2014 +0900 glamor: Make glamor_set_pixmap_private not crash if the pixmap has no fbo Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 45b333525e4626523f2b3b7bb360404b6366750d Author: Michel Dänzer Date: Thu Dec 11 16:50:37 2014 +0900 glamor: Fix use-after-free in glamor_destroy_textured_pixmap ==25551== Invalid read of size 8 ==25551== at 0x85D5F2C: glamor_egl_destroy_pixmap_image (glamor_egl.c:527) ==25551== by 0x85D7750: glamor_destroy_pixmap (glamor.c:235) ==25551== by 0xC1BDD9B: radeon_glamor_destroy_pixmap (radeon_glamor.c:278) ==25551== by 0x5098F6: FreePicture (picture.c:1425) ==25551== by 0x85DD7A9: glamor_unrealize_glyph_caches (glamor_glyphs.c:257) ==25551== by 0x85D7B50: glamor_close_screen (glamor.c:586) ==25551== by 0x4B1A82: xf86CrtcCloseScreen (xf86Crtc.c:734) ==25551== by 0x4CFFC7: CursorCloseScreen (cursor.c:187) ==25551== by 0x513A44: AnimCurCloseScreen (animcur.c:106) ==25551== by 0x51529B: present_close_screen (present_screen.c:64) ==25551== by 0x43CA83: dix_main (main.c:351) ==25551== by 0x6CFAB44: (below main) (libc-start.c:287) ==25551== Address 0x83dafa0 is 96 bytes inside a block of size 152 free'd ==25551== at 0x4C29E90: free (vg_replace_malloc.c:473) ==25551== by 0x85D76B4: glamor_destroy_textured_pixmap (glamor.c:225) ==25551== by 0x85D7750: glamor_destroy_pixmap (glamor.c:235) ==25551== by 0xC1BDD9B: radeon_glamor_destroy_pixmap (radeon_glamor.c:278) ==25551== by 0x5098F6: FreePicture (picture.c:1425) ==25551== by 0x85DD7A9: glamor_unrealize_glyph_caches (glamor_glyphs.c:257) ==25551== by 0x85D7B50: glamor_close_screen (glamor.c:586) ==25551== by 0x4B1A82: xf86CrtcCloseScreen (xf86Crtc.c:734) ==25551== by 0x4CFFC7: CursorCloseScreen (cursor.c:187) ==25551== by 0x513A44: AnimCurCloseScreen (animcur.c:106) ==25551== by 0x51529B: present_close_screen (present_screen.c:64) ==25551== by 0x43CA83: dix_main (main.c:351) Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 913416b718e73e7416c2128a82d2e5e5cd962d28 Author: Alan Coopersmith Date: Tue Dec 9 10:15:08 2014 -0800 Solaris: delete undocumented, unuseful -protect0 flag Solaris already makes the page at address 0 inaccessible by default to catch NULL pointer bugs, we don't need a double secret undocumented flag to try to make our own hacky attempt at it. As a bonus, deleting this code removes gcc warning of: sun_init.c: In function 'xf86OpenConsole': sun_init.c:103:17: warning: declaration of 'fd' shadows a previous local [-Wshadow] int fd = -1; ^ sun_init.c:89:9: warning: shadowed declaration is here [-Wshadow] int fd; ^ Signed-off-by: Alan Coopersmith Reviewed-by: Mark Kettenis Signed-off-by: Keith Packard commit 7b784df51bd6be38238d7101b1f5e320eb4aa5b8 Author: Kenneth Graunke Date: Tue Dec 9 12:43:57 2014 -0800 modesetting: Use GBM for buffer allocations if Glamor supports it. For performance, Glamor wants to render to tiled buffers, not linear ones. Using GBM allows us to pick the 3D driver's preferred tiling modes. v2: Declare drmmode->gbm as void * if !GLAMOR_HAS_GBM. v3: Just use a forward declaration of struct gbm_device. Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit cfef64b0cabe7677c7584a72d7432c20343d9361 Author: Dave Airlie Date: Tue Dec 9 12:28:38 2014 -0800 glamor: Add an accessor for the GBM device. (Originally written by Dave Airlie; split into a separate patch by Kenneth Graunke.) Signed-off-by: Dave Airlie Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit 980535757d38db5c812c8afa32726d8cc36abfa4 Author: Kenneth Graunke Date: Tue Dec 9 15:20:44 2014 -0800 modesetting: Create a drmmode_bo wrapper; use it for front_bo. This code is going to be extended to support GBM BOs soon. This small abstraction removes a lot of direct dumb_bo access, so we can add that support in one place, rather than putting conditionals at every pitch/handle/etc access. Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit c6388964b079b3828c0b64951ff03008dda8f44a Author: Kenneth Graunke Date: Tue Dec 9 11:26:39 2014 -0800 modesetting: Drop dumb_bo::map_count field and dead unmap code. The drm kernel API for dumb BOs apparently doesn't include an unmap ioctl, so we can't do much here. It looks like this code was copied from libkms, which was also unfinished. We may as well delete the dead variable that simply gets incremented and never read. Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit 87cc0c0d317c5eac4fcf9bf4a7ad36454c05f6b8 Author: Kenneth Graunke Date: Tue Dec 9 11:17:30 2014 -0800 modesetting: Move dumb_bo into its own source files. Eventually, drmmode_display will be able to use GBM for handling buffers, and won't need dumb_bo. Keeping the display related logic and buffer object abstraction in separate files seems a bit tidier. Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit af4f94b08eb8e5961799a8a74a06449fd3fe8ad9 Author: Kenneth Graunke Date: Tue Dec 9 15:18:39 2014 -0800 modesetting: Create helper for glamor_egl_create_textured_screen call. This will need to change when we add GBM support; by pulling it into a helper function, we should only have to edit one place. Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit b4324c6a2382dc96295bdb061316f699e4ffabb9 Author: Kenneth Graunke Date: Tue Dec 9 14:38:39 2014 -0800 modesetting: Move ModifyPixmapHeader calls out of if/else branches. Both branches called ModifyPixmapHeader with essentially the same parameters. By using new_pixels in the shadowfb case, we can make them completely the same, and move them out a level, for simplicity. Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit 35e9924484ec7bafb749c88ed7f78e6a71f8dfb3 Author: Kenneth Graunke Date: Tue Dec 9 13:01:09 2014 -0800 modesetting: Stop using glamor_egl_create_textured_screen_ext(). The _ext variant takes an additional pointer argument, which it now ignores, thanks to Keith's recent patches. Signed-off-by: Kenneth Graunke Tested-by: Jason Ekstrand Reviewed-by: Keith Packard commit 91651e7c15892aa846fc406fbb13b37f094dd3f0 Author: Michel Dänzer Date: Wed Dec 10 16:21:44 2014 +0900 glamor: Reinstate glamor_(egl_)destroy_textured_pixmap They are part of the ABI. Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit e774663fa5209ff469d920821934bb1f5964a72f Author: Michele Baldessari Date: Wed Dec 3 11:30:29 2014 -0500 ephyr: Implement per-screen colormaps Xephyr's pseudocolor emulation added in: commit 81a3b6fe27567b4f91033ece69996aa6bf8d01a3 Author: Matthew Allum Date: Mon Nov 8 22:39:47 2004 +0000 Add support to Xephyr for lower depths than hosts only tracks one global colormap for the whole (Xephyr) display. Move this to per-screen state so each screen's colormap can be correct. [ajax: rebased to 1.17, cleaned up commit message] Reviewed-by: Adam Jackson Reviewed-by: Eric Anholt Signed-off-by: Michele Baldessari commit cadd70c809232c9a6601fb8baab665a7ab10045d Author: Adam Jackson Date: Tue Dec 2 14:52:35 2014 -0500 glx: Add hack for GLX-1.2-style naked windows to GetDrawableAttributes Some people like to call this on bare Window XIDs and expect reasonable results. I sure wish they wouldn't, but since they do, if we're given a window without any glx decoration just fill in as much as we can. This means you won't actually get an answer for GLX_FBCONFIG_ID and friends, but there's not much to be done about that, and it matches what NVIDIA's driver seems to do. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54080 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit f452b4a47b3bebf883e84df804e8d54830ccfe83 Author: Adam Jackson Date: Tue Dec 2 14:47:45 2014 -0500 glx: Dynamically compute attribute slot in GetDrawableAttributes No functional change. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit c1455f76c6b1aa4ecaacb2221a687244285aa44b Author: Neil Roberts Date: Mon Dec 1 16:06:17 2014 -0500 glx: Add implementation of __GLXContext->loseCurrent for direct ctxts This adds a dummy implementation for the loseCurrent function in __GLXContext for direct contexts which just returns GL_TRUE. Without this then the X server can crash if receives a MakeCurrent message for a direct context because it will attempt to call loseCurrent when cleaning up the client in the callback for ClientStateGone. [ajax: added assumed s-o-b line] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86531 Reviewed-by: Adam Jackson Signed-off-by: Neil Roberts Signed-off-by: Keith Packard commit 6704bb0ed7a10dabe8ef3bb3adf8b8a7f29a78f0 Merge: 8aa23f2 1559a94 Author: Keith Packard Date: Tue Dec 9 11:47:11 2014 -0800 Merge remote-tracking branch 'alanc/master' commit 1559a94395258fd73e369f1a2c98a44bfe21a486 Author: Keith Packard Date: Tue Dec 9 09:31:00 2014 -0800 dix: GetHosts bounds check using wrong pointer value [CVE-2014-8092 pt. 6] GetHosts saves the pointer to allocated memory in *data, and then wants to bounds-check writes to that region, but was mistakenly using a bare 'data' instead of '*data'. Also, data is declared as void **, so we need a cast to turn it into a byte pointer so we can actually do pointer comparisons. Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit 9802a0162f738de03585ca3f3b8a8266494f7d45 Author: Keith Packard Date: Tue Dec 9 09:30:59 2014 -0800 Missing parens in REQUEST_FIXED_SIZE macro [CVE-2014-8092 pt. 5] The 'n' parameter must be surrounded by parens in both places to prevent precedence from mis-computing things. Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit 61b17c0f10307e25e51e30e6fb1d3e3127f82d86 Author: Keith Packard Date: Tue Dec 9 09:30:58 2014 -0800 glx: Can't mix declarations and code in X.org sources [CVE-2014-8098 pt. 9] We're using compiler compatibility settings which generate warnings when a variable is declared after the first statement. Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit b20912c3d45cbbde3c443e6c3d9e189092fe65e1 Author: Keith Packard Date: Tue Dec 9 09:30:57 2014 -0800 dbe: Call to DDX SwapBuffers requires address of int, not unsigned int [CVE-2014-8097 pt. 2] When the local types used to walk the DBE request were changed, this changed the type of the parameter passed to the DDX SwapBuffers API, but there wasn't a matching change in the API definition. At this point, with the API frozen, I just stuck a new variable in with the correct type. Because we've already bounds-checked nStuff to be smaller than UINT32_MAX / sizeof(DbeSwapInfoRec), we know it will fit in a signed int without overflow. Signed-off-by: Keith Packard Signed-off-by: Alan Coopersmith commit 8aa23f27c7e29c62d23867440b0bb00fc288b5ba Author: Keith Packard Date: Mon Dec 8 12:59:31 2014 -0800 glamor: Free existing EGL image when assigning new one When reallocating the framebuffer on screen resize, the old EGL image was getting leaked. Check for an existing EGL image and free it in this case. Signed-off-by: Keith Packard Revewied-by: Zhigang Gong commit c22433d55ea16e4879b092ee28d284fc895c9956 Author: Keith Packard Date: Fri Dec 5 11:02:11 2014 -0800 glamor: Remove redundant reference to screen pixmap EGL image There's no reason to store this in the egl screen private as the screen pixmap will always hold a reference to it anyways. Signed-off-by: Keith Packard Revewied-by: Zhigang Gong commit 5064ffab631dcbc4265079fb32a02d3e2f1c4cd8 Author: Keith Packard Date: Fri Dec 5 10:58:28 2014 -0800 glamor: Always destroy EGL image associated with destroyed pixmap There were three paths that called eglDestroyImageKHR: * The front buffer * The intel driver's flip buffer * pixmaps under DRI3 This patch unifies the second two by having glamor_destroy_pixmap always destroy any associaged EGL image. This allows us to stop storing the back_pixmap pointer in glamor as that was only used to make sure that buffer was freed at server reset time. v2: check for valid pixmap_priv before using it in glamor_egl_destroy_pixmap_image Signed-off-by: Keith Packard Reviewed-by: Zhigang Gong commit 7e7630bbb775573eea2a2335adb9d190c3e1e971 Author: Robert Morell Date: Wed Nov 12 18:51:43 2014 -0800 glx: Fix mask truncation in __glXGetAnswerBuffer [CVE-2014-8093 6/6] On a system where sizeof(unsigned) != sizeof(intptr_t), the unary bitwise not operation will result in a mask that clears all high bits from temp_buf in the expression: temp_buf = (temp_buf + mask) & ~mask; Signed-off-by: Robert Morell Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit e883c170c15493ab3637c0a01890f5a7ca4e16a5 Author: Adam Jackson Date: Mon Nov 10 12:13:48 2014 -0500 glx: Pass remaining request length into ->varsize (v2) [CVE-2014-8098 8/8] v2: Handle more multiplies in indirect_reqsize.c (Julien Cristau) Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit 984583a497c813df5827ae22483133e704fee79c Author: Adam Jackson Date: Mon Nov 10 12:13:47 2014 -0500 glx: Length checking for non-generated single requests (v2) [CVE-2014-8098 7/8] v2: Fix single versus vendor-private length checking for ARB_imaging subset extensions. (Julien Cristau) v3: Fix single versus vendor-private length checking for ARB_imaging subset extensions. (Julien Cristau) Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Julien Cristau Signed-off-by: Alan Coopersmith commit 44ba149f28ece93c2fbfc9cc980588de5322dd4b Author: Adam Jackson Date: Mon Nov 10 12:13:46 2014 -0500 glx: Length-checking for non-generated vendor private requests [CVE-2014-8098 6/8] Reviewed-by: Keith Packard Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit afe177020d1fb776c6163f21eddc82cb185b95ca Author: Adam Jackson Date: Mon Nov 10 12:13:45 2014 -0500 glx: Request length checks for SetClientInfoARB [CVE-2014-8098 5/8] Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit c91e4abc3b892f42802efa20fef7ada442c2d3f5 Author: Adam Jackson Date: Mon Nov 10 12:13:44 2014 -0500 glx: Top-level length checking for swapped VendorPrivate requests [CVE-2014-8098 4/8] Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit a33a939e6abb255b14d8dbc85fcbd2c55b958bae Author: Adam Jackson Date: Mon Nov 10 12:13:43 2014 -0500 glx: Length checking for RenderLarge requests (v2) [CVE-2014-8098 3/8] This is a half-measure until we start passing request length into the varsize function, but it's better than the nothing we had before. v2: Verify that there's at least a large render header's worth of dataBytes (Julien Cristau) Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit 698888e6671d54c7ae41e9d456f7f5483a3459d2 Author: Adam Jackson Date: Mon Nov 10 12:13:42 2014 -0500 glx: Integer overflow protection for non-generated render requests (v3) [CVE-2014-8093 5/6] v2: Fix constants in __glXMap2fReqSize (Michal Srb) Validate w/h/d for proxy targets too (Keith Packard) v3: Fix Map[12]Size to correctly reject order == 0 (Julien Cristau) Reviewed-by: Keith Packard Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit be09e0c988ffdb0371293af49fb4ea8f49ed324a Author: Julien Cristau Date: Mon Nov 10 12:13:41 2014 -0500 glx: Length checking for GLXRender requests (v2) [CVE-2014-8098 2/8] v2: Remove can't-happen comparison for cmdlen < 0 (Michal Srb) Reviewed-by: Adam Jackson Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Julien Cristau Signed-off-by: Alan Coopersmith commit 2a5cbc17fc72185bf0fa06fef26d1f782de72595 Author: Adam Jackson Date: Mon Nov 10 12:13:40 2014 -0500 glx: Add safe_{add,mul,pad} (v3) [CVE-2014-8093 4/6] These are paranoid about integer overflow, and will return -1 if their operation would overflow a (signed) integer or if either argument is negative. Note that RenderLarge requests are sized with a uint32_t so in principle this could be sketchy there, but dix limits bigreqs to 128M so you shouldn't ever notice, and honestly if you're sending more than 2G of rendering commands you're already doing something very wrong. v2: Use INT_MAX for consistency with the rest of the server (jcristau) v3: Reject negative arguments (anholt) Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit 13d36923e0ddb077f4854e354c3d5c80590b5d9d Author: Adam Jackson Date: Mon Nov 10 12:13:39 2014 -0500 glx: Fix image size computation for EXT_texture_integer [CVE-2014-8098 1/8] Without this we'd reject the request with BadLength. Note that some old versions of Mesa had a bug in the same place, and would _send_ zero bytes of image data; these will now be rejected, correctly. Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit 717a1b37767b41e14859e5022ae9e679152821a9 Author: Adam Jackson Date: Mon Nov 10 12:13:38 2014 -0500 glx: Additional paranoia in __glXGetAnswerBuffer / __GLX_GET_ANSWER_BUFFER (v2) [CVE-2014-8093 3/6] If the computed reply size is negative, something went wrong, treat it as an error. v2: Be more careful about size_t being unsigned (Matthieu Herrb) v3: SIZE_MAX not SIZE_T_MAX (Alan Coopersmith) Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit ab2ba9338aa5e85b4487bc7fbe69985c76483e01 Author: Adam Jackson Date: Mon Nov 10 12:13:37 2014 -0500 glx: Be more strict about rejecting invalid image sizes [CVE-2014-8093 2/6] Before this we'd just clamp the image size to 0, which was just hideously stupid; if the parameters were such that they'd overflow an integer, you'd allocate a small buffer, then pass huge values into (say) ReadPixels, and now you're scribbling over arbitrary server memory. Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit 23fe7718bb171e71db2d1a30505c2ca2988799d9 Author: Adam Jackson Date: Mon Nov 10 12:13:36 2014 -0500 glx: Be more paranoid about variable-length requests [CVE-2014-8093 1/6] If the size computation routine returns -1 we should just reject the request outright. Clamping it to zero could give an attacker the opportunity to also mangle cmdlen in such a way that the subsequent length check passes, and the request would get executed, thus passing data we wanted to reject to the renderer. Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith commit f4afd53f2aeaddf509bf9f71d1716dd273fd6e14 Author: Alan Coopersmith Date: Sun Feb 9 22:42:47 2014 -0800 Add REQUEST_FIXED_SIZE testcases to test/misc.c Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 2df83bb122debc3c20cfc3d3b0edc85cd0270f79 Author: Alan Coopersmith Date: Sun Feb 9 21:28:05 2014 -0800 Add request length checking test cases for some Xinput 2.x requests Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit d153a85f7478a7a67ccb02fbca6390b0ab1732ee Author: Alan Coopersmith Date: Sun Feb 9 21:27:27 2014 -0800 Add request length checking test cases for some Xinput 1.x requests Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit a0ece23a8bd300c8be10812d368dc8058c97c63e Author: Alan Coopersmith Date: Sun Jan 26 20:02:20 2014 -0800 xfixes: unvalidated length in SProcXFixesSelectSelectionInput [CVE-2014-8102] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 5d3a788aeb2fbd3ca2812747dc18c94a8b981c63 Author: Alan Coopersmith Date: Sun Jan 26 19:51:29 2014 -0800 render: unvalidated lengths in Render extn. swapped procs [CVE-2014-8100 2/2] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit b5f9ef03df6a650571b29d3d1c1d2b67c6e84336 Author: Julien Cristau Date: Tue Oct 28 10:30:04 2014 +0100 render: check request size before reading it [CVE-2014-8100 1/2] Otherwise we may be reading outside of the client request. Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit 3df2fcf12499ebdb26b9b67419ea485a42041f33 Author: Alan Coopersmith Date: Sun Jan 26 19:38:09 2014 -0800 randr: unvalidated lengths in RandR extension swapped procs [CVE-2014-8101] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit d155b7a8e38e74aee96bf52c20c8b6a330d7d462 Author: Alan Coopersmith Date: Sun Jan 26 19:33:34 2014 -0800 present: unvalidated lengths in Present extension procs [CVE-2014-8103 2/2] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Julien Cristau commit 0a6085aaf3581cca558d960ea176ddf3a41a2213 Author: Alan Coopersmith Date: Sun Jan 26 19:28:05 2014 -0800 dri3: unvalidated lengths in DRI3 extension swapped procs [CVE-2014-8103 1/2] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 32a95fb7c7dbe22c9441c62762dfa4a8ec54d6c3 Author: Alan Coopersmith Date: Sun Jan 26 19:23:17 2014 -0800 Xv: unvalidated lengths in XVideo extension swapped procs [CVE-2014-8099] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 7553082b9b883b5f130044f3d53bce2f0b660e52 Author: Alan Coopersmith Date: Sun Jan 26 17:18:54 2014 -0800 xcmisc: unvalidated length in SProcXCMiscGetXIDList() [CVE-2014-8096] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 73c63afb93c0af1bfd1969bf6e71c9edca586c77 Author: Alan Coopersmith Date: Sun Jan 26 10:54:41 2014 -0800 Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] Multiple functions in the Xinput extension handling of requests from clients failed to check that the length of the request sent by the client was large enough to perform all the required operations and thus could read or write to memory outside the bounds of the request buffer. This commit includes the creation of a new REQUEST_AT_LEAST_EXTRA_SIZE macro in include/dix.h for the common case of needing to ensure a request is large enough to include both the request itself and a minimum amount of extra data following the request header. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 2ef42519c41e793579c9cea699c866fee3d9321f Author: Alan Coopersmith Date: Wed Jan 22 23:12:04 2014 -0800 dbe: unvalidated lengths in DbeSwapBuffers calls [CVE-2014-8097] ProcDbeSwapBuffers() has a 32bit (n) length value that it uses to read from a buffer. The length is never validated, which can lead to out of bound reads, and possibly returning the data read from out of bounds to the misbehaving client via an X Error packet. SProcDbeSwapBuffers() swaps data (for correct endianness) before handing it off to the real proc. While doing the swapping, the length field is not validated, which can cause memory corruption. v2: reorder checks to avoid compilers optimizing out checks for overflow that happen after we'd already have done the overflowing multiplications. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 6692670fde081bbfe9313f17d84037ae9116702a Author: Alan Coopersmith Date: Wed Jan 22 23:40:18 2014 -0800 dri2: integer overflow in ProcDRI2GetBuffers() [CVE-2014-8094] ProcDRI2GetBuffers() tries to validate a length field (count). There is an integer overflow in the validation. This can cause out of bound reads and memory corruption later on. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Julien Cristau commit e0e11644622a589129a01e11e5d105dc74a098de Author: Alan Coopersmith Date: Wed Jan 22 23:44:46 2014 -0800 dix: integer overflow in REQUEST_FIXED_SIZE() [CVE-2014-8092 4/4] Force use of 64-bit integers when evaluating data provided by clients in 32-bit fields which can overflow when added or multiplied during checks. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 97015a07b9e15d8ec5608b95d95ec0eb51202acb Author: Alan Coopersmith Date: Wed Jan 22 22:37:15 2014 -0800 dix: integer overflow in RegionSizeof() [CVE-2014-8092 3/4] RegionSizeof contains several integer overflows if a large length value is passed in. Once we fix it to return 0 on overflow, we also have to fix the callers to handle this error condition v2: Fixed limit calculation in RegionSizeof as pointed out by jcristau. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Julien Cristau commit bc8e20430b6f6378daf6ce4329029248a88af08b Author: Alan Coopersmith Date: Mon Jan 6 23:30:14 2014 -0800 dix: integer overflow in GetHosts() [CVE-2014-8092 2/4] GetHosts() iterates over all the hosts it has in memory, and copies them to a buffer. The buffer length is calculated by iterating over all the hosts and adding up all of their combined length. There is a potential integer overflow, if there are lots and lots of hosts (with a combined length of > ~4 gig). This should be possible by repeatedly calling ProcChangeHosts() on 64bit machines with enough memory. This patch caps the list at 1mb, because multi-megabyte hostname lists for X access control are insane. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit eeae42d60bf3d5663ea088581f6c28a82cd17829 Author: Alan Coopersmith Date: Wed Jan 22 21:11:16 2014 -0800 dix: integer overflow in ProcPutImage() [CVE-2014-8092 1/4] ProcPutImage() calculates a length field from a width, left pad and depth specified by the client (if the specified format is XYPixmap). The calculations for the total amount of memory the server needs for the pixmap can overflow a 32-bit number, causing out-of-bounds memory writes on 32-bit systems (since the length is stored in a long int variable). Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 90cc925c5991fcb203f72d00b04419cd754a9b2c Author: Alan Coopersmith Date: Fri Jan 17 18:54:03 2014 -0800 unchecked malloc may allow unauthed client to crash Xserver [CVE-2014-8091] authdes_ezdecode() calls malloc() using a length provided by the connection handshake sent by a newly connected client in order to authenticate to the server, so should be treated as untrusted. It didn't check if malloc() failed before writing to the newly allocated buffer, so could lead to a server crash if the server fails to allocate memory (up to UINT16_MAX bytes, since the len field is a CARD16 in the X protocol). Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 3e7218a6c23354d66f508b18164cac98a346b3ee Merge: 6f4c398 bc71081 Author: Keith Packard Date: Mon Dec 8 18:07:55 2014 -0800 Merge remote-tracking branch 'jturney/indirect-glx-fixes' commit 6f4c398a0e632b0c92e3cb8ee03ca7f5b5cc018e Merge: aae6460 5920433 Author: Keith Packard Date: Mon Dec 8 18:04:08 2014 -0800 Merge remote-tracking branch 'jturney/master' commit aae6460694ac3667abb8c34fdf3a7dae524827a4 Author: Mario Kleiner Date: Sat Dec 6 05:40:08 2014 +0100 present: Fix use of vsynced pageflips and honor PresentOptionAsync. (v4) Pageflips for Pixmap presents were not synchronized to vblank on drivers with support for PresentCapabilityAsync, due to some missing init for vblank->sync_flips. The PresentOptionAsync flag was completely ignored for pageflipped presents. Vsynced flips only worked by accident on the intel-ddx, as that driver doesn't have PresentCapabilityAsync support. On nouveau-ddx, which supports PresentCapabilityAsync, this always caused non-vsynced pageflips with pretty ugly tearing. This patch fixes the problem, as tested on top of XOrg 1.16.2 on nouveau and intel. v4: Add additional PresentCapabilityAsync caps check, as suggested by Eric Anholt. Please also apply to XOrg 1.17 and XOrg 1.16.2 stable. Applying on top of XOrg 1.16.2 requires cherry-picking commit 2051514652481a83bd7cf22e57cb0fcd40333f33 which trivially fixes lack of support for protocol option PresentOptionCopy - get two bug fixes for the price of one! Signed-off-by: Mario Kleiner Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 32d3100bd78efe41d468f7d66861296aee468b6f Author: Mario Kleiner Date: Sat Dec 6 05:40:07 2014 +0100 present: Avoid crashes in DebugPresent(), a bit more info. DebugPresent() crashed the server when a dri3 drawable was closed while a pageflipped present was still pending, due to vblank->window-> Null-Ptr deref, so debug builds caused new problems to debug. E.g., glXSwapBuffers(...); glXDestroyWindow(...); -> Pageflip for non-existent window completes -> boom. Also often happens when switching desktop compositor on/off due to Present unflips, or when logging out of session. Also add info if a Present is queued for copyswap or pageflip, if the present is vsynced, and the serial no of the Present request, to aid debugging of pageflip and vsync issues. The serial number is useful as Mesa's dri3/present backend encodes its sendSBC in the serial number, so one can easily correlate server debug output with Mesa and with the SBC values returned to actual OpenGL client applications via OML_sync_control and INTEL_swap_events extension, makes debugging quite a bit more easy. Please also cherry-pick this for a 1.16.x stable update. Signed-off-by: Mario Kleiner Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 32ca85c9e075e40b8a4712a79a51702facba0332 Author: Daniel Martin Date: Fri Nov 28 11:20:50 2014 +0100 modesetting: Remove unused params from drmmode_output_init() drmmode_output_init() doesn't touch (the int*) num_dvi and num_hdmi. Remove both parameters. Signed-off-by: Daniel Martin Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit c0ea476b9bb91f03061b891ffb897c438fa03879 Author: Daniel Martin Date: Fri Nov 28 11:20:49 2014 +0100 modesetting: Fix ifdefs s/HAVE_UDEV/CONFIG_UDEV_KMS/ We don't define HAVE_UDEV, that's a remnant from xf86-video-modesetting. But, we have CONFIG_UDEV_KMS. Signed-off-by: Daniel Martin Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 8a16620dcd7a22fd9b38876ffc711629c4fbda0a Author: Daniel Martin Date: Fri Nov 28 11:20:48 2014 +0100 modesetting: Create new EGL screen in drmmode_xf86crtc_resize If we don't glamor_egl_create_textured_screen_ext() in drmmode_xf86crtc_resize() we end up with a black screen and no client window(s) visible. Signed-off-by: Daniel Martin Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 0d63fa5850fe9d8b045b8f1a83e72b75f9065a7a Author: Daniel Martin Date: Fri Nov 28 11:20:47 2014 +0100 modesetting: Move Bool glamor into drmmode struct Move the boolean glamor from struct modesetting into struct drmmode for later re-use in drmmode_display. Signed-off-by: Daniel Martin Reviewed-by: Eric Anholt Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 62a4eeaa25099872682d6c2f9f13a0e73fc5ce1e Author: Daniel Martin Date: Fri Nov 28 11:20:46 2014 +0100 config/udev: Prefix and shift "removing GPU" message The message "removing GPU device ..." appeared even if the removal was skipped (when path == NULL). Move it below the path check and make it a LogMessage with config/udev prefix. Signed-off-by: Daniel Martin Reviewed-by: Eric Anholt Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit bc71081f0e3d8ce3aecf2cb168431dbc9fe6a87b Author: Jon TURNEY Date: Fri Apr 18 12:17:06 2014 +0100 glx: Fix crash when a client exits without deleting GL contexts With the previous patches applied, we now have crash due to use-after-free when a client exits without deleting all it's GL contexts On client exit, CloseDownClient first calls glxClientCallback() with ClientStateGone, which calls __glXFreeContext() directly. Subsequently CloseDownClient() frees all the clients resources, which leads to ContextGone() being called for a context resource where the context has already been freed. Fix this by modifiying glxClientCallback() to free the context resource. Also make __glXFreeContext() static, as calling it directly leads to this problem, instead the context resource should be released. With the previous patches applied, this can be demonstrated with e.g. glxinfo, which doesn't delete it's context before exit. Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit 5c606c0a89e74fa223a99864be11cc3be60a159b Author: Jon TURNEY Date: Fri Apr 18 12:17:05 2014 +0100 glx: Flush context which is being made non-current due to drawable going away Some sequences of glean tests fail with GLXBadCurrentWindow when using indirect rendering, e.g. glean -t 'fpexceptions getString'. Flush a context which is being made non-current due to the drawable on which is it is current going away. Waiting until another context is made current is too late, as the drawable no longer exists. v2: Rewrite for direct GL dispatch v3: Inline FlushContext(), doesn't need to be a separate function e.g. LIBGL_ALWAYS_INDIRECT=1 ./glean -r results -o --quick -t "fpexceptions getString" fails with a BadContextTag error. Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit 437b27494f127854d75e59b4e2aac264e9f913e9 Author: Jon TURNEY Date: Fri Apr 18 12:17:04 2014 +0100 Revert "glx: Simplify glXDestroyContext" This reverts commit 7f5adf73a0f9a951a6df201532b4031d38054369. This seems to miss the whole point of the idExists flag, as it makes the lifetime of that being true the same as the lifetime of the Context resource. The previously current context tag is always given in a MakeContextCurrent request, even if that context tag is no longer valid (for example, the context has been deleted), so this leads to BadContextTag errors. See fd.o bug #30089 for the makecurrenttest.c testcase, and some discussion of previous manifestations of this bug. Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit 4b0d0df34f10a88c10cb23dd50087b59f5c4fece Author: Peter Harris Date: Mon Nov 17 14:31:24 2014 -0500 Fix overflow of ConnectionOutput->size and ->count When (long) is larger than (int), and when realloc succeeds with sizes larger than INT_MAX, ConnectionOutput->size and ConnectionOutput->count overflow and become negative. When ConnectionOutput->count is negative, InsertIOV does not actually insert an IOV, and FlushClient goes into an infinite loop of writev(fd, iov, 0) [an empty list]. Avoid this situation by killing the client when it has more than INT_MAX unread bytes of data. Signed-off-by: Peter Harris Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 802932d112a3f6a09420be9e4a13fa78ac43840b Author: Adam Jackson Date: Mon Nov 17 15:28:58 2014 -0500 render: fix ChangePicture when Xinerama is active (v2) (#49170) ChangePicture takes wire XIDs, but didn't do any Xinerama translation, which meant setting a clip pixmap or a separate alpha picture would result in those elements pointing at the instance of the pixmap on screen 0. Which is, you know, bad. v2: This one actually builds. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49170 Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit c2994001680a7dcf9c167886d49b7326c97cd5d1 Author: Aaron Plattner Date: Fri Nov 21 08:39:02 2014 -0800 os: "Server terminated successfully" is not an error ErrorFSigSafe calls LogVMessageVerbSigSafe with the message type set to X_ERROR. That generates this in the log: (EE) Server terminated successfully (0). Closing log file. People periodically report this as an error, sometimes quoting this "error" rather than an earlier error that actually caused a problem. v2: Use X_INFO instead of X_NOTICE Signed-off-by: Aaron Plattner Reviewed-by: Keith Packard Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit b09d59342804db7dbb8056dca43dd39f54e290aa Author: Alan Coopersmith Date: Wed Nov 26 13:01:29 2014 -0800 Add -iglx & +iglx to Xserver.man Covers the current state after commits 99f0365b1fbdfd9238b9f, d0da0e9c3bb8fe0cd4879, & e3aa13b8d63ea2fba6eb4 were all applied. Signed-off-by: Alan Coopersmith Reviewed-by: James Jones Reviewed-by: Robert Morell Signed-off-by: Keith Packard commit c52a2b1ebad56820af932dfbc871701a8b04fd9c Author: Adam Jackson Date: Tue Nov 11 12:30:07 2014 -0500 mi: Fix regression in arc drawing xts' XDrawArcs/15 regressed (turning into a server-side infinite loop) after: commit 7679afd4da8b86aed27e5916ba723116a3c8bb4a Author: Adam Jackson Date: Fri Sep 26 12:01:37 2014 -0400 mi: Fold mifpolycon.c into miarc.c The reason is miarc.c provided its own definitions (sigh) of min/max, that both accept int arguments and return an int. Since miFillSppPoly uses a double (sigh) and some min-involving math for its loop index variable, things do not go well. Since the integer versions of min/max are redundant, nuke 'em. Signed-off-by: Adam Jackson Reviewed-by: Aaron Plattner Tested-by: Keith Packard Signed-off-by: Keith Packard commit ec0ac8970b508adcbc3d104b14a127118e4979d0 Merge: 65cc098 0f88d4e Author: Keith Packard Date: Mon Nov 24 15:39:51 2014 -0800 Merge remote-tracking branch 'whot/for-keith' commit 65cc0982afb1d47d17e655efaef40d4a82e7574a Author: Keith Packard Date: Mon Oct 13 10:31:52 2014 -0700 glamor: Don't insert fbos from external objects into fbo cache Mark fbos created from external buffers so that when the associated pixmap is destroyed, they aren't put into the fbo cache for later re-use and are instead freed immediately. Signed-off-by: Keith Packard Reviewed-by: Alex Deucher commit 0f88d4e7937116dbc438f98ddf1f3d94cfc5bead Author: Peter Hutterer Date: Wed Nov 12 10:29:36 2014 +1000 mi: fix documentation for miPointerSetPosition Changed when we added barriers, documentation didn't get updated. Reported-by: Dave Airlie Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie commit 6a117af7e7ef6eac796ff0680a915c866fce4019 Author: John Hunter Date: Mon Nov 3 15:45:38 2014 +0800 fix an annotation mistake Signed-off-by: John Hunter Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 732fd7e571b81d63aa44d6e4cf55883479e88f2f Author: Peter Hutterer Date: Fri Oct 31 09:45:12 2014 +1000 Drop trailing whitespaces sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer commit 96143d6dc35c98cb6b4e409dd89687e4ced3c1f0 Author: Peter Hutterer Date: Fri Oct 31 09:32:35 2014 +1000 dix: silence compiler warning comparing CARD32 to -1 window.c:3246:36: warning: comparison of constant -1 with expression of type 'CARD32' (aka 'unsigned int') is always true [-Wtautological-constant-out-of-range-compare] if (optional->backingBitPlanes != ~0L) ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~ Signed-off-by: Peter Hutterer Reviewed-by: Michel Dänzer commit 04ca16997994c7561ed8948b89fc1c922233da13 Author: Peter Hutterer Date: Fri Oct 31 09:29:33 2014 +1000 dix: silence compiler warning inpututils.c:243:26: warning: comparison of constant 256 with expression of type 'KeyCode' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare] if (modkeymap[i] >= MAP_LENGTH) ~~~~~~~~~~~~ ^ ~~~~~~~~~~ MAP_LENGTH depends on MAX_BUTTONS which is somewhat arbitrarily chosen. We don't expect this to ever change, but just in case leave the condition there so the code is correct if we drop the number down. Signed-off-by: Peter Hutterer commit 79b9d33545034f2952ebc7e444c201693b45f44b Author: Peter Hutterer Date: Fri Oct 31 09:26:28 2014 +1000 xwayland: declare fatal log handler as noreturn xwayland.c:661:1: warning: function 'xwl_log_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn] Signed-off-by: Peter Hutterer commit adee4f239b5074d318dfc48beb0ec4e91973b449 Author: Peter Hutterer Date: Fri Oct 31 09:24:50 2014 +1000 xfree86: drop double-typedef of DBusConnection Just include dbus.h, it's been typedef'd there since 2003. Signed-off-by: Peter Hutterer commit 25315ee555dfeb96d9ed83064b1022ed852b612e Author: Peter Hutterer Date: Fri Oct 31 09:16:28 2014 +1000 Xext: fix clang compiler warning shm.c:1150:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((shmdesc->addr == ((char *) -1))) { Signed-off-by: Peter Hutterer commit 995ecfb51d4ab8197e4591d5c0957e08a0bd6a59 Author: Peter Hutterer Date: Thu Oct 30 09:00:21 2014 +1000 include: change RegionSize() to take a size_t /usr/include/xorg/regionstr.h:130:36: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); ^ ~ Really only just pushes the problem to the caller, but maybe that motivates someone to fix it. Signed-off-by: Peter Hutterer commit 3ccec1b5ba6a26a30f82ba3aa9c5218dfa336869 Author: Peter Hutterer Date: Thu Oct 30 08:56:55 2014 +1000 include: fix documentation for list.h Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit 5920433c3a30f5f1c0ba1ab39a0c2ff388df6b23 Author: Colin Harrison Date: Sat Sep 27 11:50:11 2014 +0100 hw/xwin: Don't allocate one wchar_t too much for unicode text placed on the Windows clipboard The count of wchar_t returned by MultiByteToWideChar() includes the terminating null character, so don't add one to it. Also, reduce the scope of various length variables Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit d172cd630dae9c991b84b4c367a4caf8199266ac Author: Jon TURNEY Date: Mon Apr 28 12:48:15 2014 +0100 hw/xwin: Fix hang on shutdown when we own the clipboard. If we are the clipboard owner when we are shutdown, we recieve a WM_RENDERALLFORMATS, to render the clipboard, so it's contents will remain available to other applications. Unfortunately, this is far too late to do anything useful with, as the server is waiting for the clipboard thread to exit, and so can't process requests to convert clipboard contents. Change so we just do nothing on WM_RENDERALLFORMATS. (I'm not convinced that WM_RENDERALLFORMATS has ever worked usefully, in any case). (To make this work, I guess we would need to rearrange the way shutdown works completely: first synchronously stop the clipboard, then stop the X server) We also then receive a WM_DRAWCLIPBOARD, perhaps telling us that the available clipboard formats have changed (as ones which haven't been rendered are now removed), but the clipboard owner is now the system, not us, which we have to arrange to ignore. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 94d433c8cb64c9167050d02473176f888decf1d8 Author: Jon TURNEY Date: Fri Feb 21 23:20:00 2014 +0000 hw/xwin: Fix clipboard thread restart It seems that the clipboard thread restart mechanism has been broken for a while, which can be demonstrated using XDMCP with KDM (e.g. to a Kubutunu 12.04 host) KDM kills all attached clients, including the clipboard integration client, which restarts, but then exits on WM_QUIT. Using PostQuitMessage() in WM_DESTROY is unhelpful, as we may not actually be quitting the thread, if we just destroyed the window because the clipboard thread is about to retry, because he WM_QUIT message sticks around, and is noticed the next time we look at the window message queue and confuses us into thinking we need to quit. Sending a WM_DESTROY is apparently never correct anyhow, see [1] So: 1/ Use DestroyWindow() to destroy the clipboard messaging window when cleaning up for retry or exit in winClipboardProc (the clipboard thread main proc) 2/ Send a special WM_WM_QUIT message in winClipboardWindowDestroy() from the X server thread when the X server is resetting. 3/ When processing that WM_WM_QUIT message in the clipboard thread, cause the clipboard window to PostQuitMessage(), which causes the clipboard thread to exit. [1] http://blogs.msdn.com/b/oldnewthing/archive/2011/09/26/10216420.aspx Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b4a08e642b977b4bbc892ff1d96ecc0cf6e2ca54 Author: Jon TURNEY Date: Thu Nov 21 15:18:48 2013 +0000 hw/xwin: Improve reliability of clipboard X->Windows pastes Sometimes, particularly with large clipboard pastes to Windows, we could end up waiting for the timeout to expire, rather than pasting the data. Various changes to improve reliability: 1. Use XFlush() not XSync() in winProcessXEventsTimeout(). It makes no sense to ensure we have received replies to outstanding requests if we are going to wait for them using select() 2. Add XFlush() to winClipboardProc() Make sure we have sent any requests before we wait using select() 3. Don't use FD_ISSET() to check which fd is ready This looks like a Cygwin select() bug in that it sometimes returns 0 with an empty fd set before the timeout expires, but a fd appears to be ready. Add select() return value to debug output when we are warning that this has happened. 4. Drain event queues before entering select() Unconditionally drain event queues before entering select(). This seems to be the recommended way of writing select() and X event processing loops. winClipboardFlushXEvents() checks using XPending(), and winClipboardFlushWindowsMessageQueue() checks using PeekMessage() so this is safe against blocking, but means that may not need to enter select() at all sometimes. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit c03f9e23c2b75af410b2fc76ca3f1aa9e979dcc4 Author: Jon TURNEY Date: Tue Sep 24 15:09:22 2013 +0100 hw/xwin: Add controls for enabling/disabling monitoring of PRIMARY selection xwinclip: Add -noprimary option Xwin: Add -primary and -noprimary options and tray-menu control v2: Use Bool type for fPrimarySelection Add -noprimary to usage message Fix indentation in hw/xwin/winwndproc.c Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 851b50419907276fdc781b6be2d42b38849bbd77 Author: Jon TURNEY Date: Tue Sep 24 16:02:37 2013 +0100 hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attempts See http://cygwin.com/ml/cygwin-xfree/2013-07/msg00016.html It looks like the change in a9aca218f557c723e637287272819a7c17174e1e had some unforseen consequences. If the X11 selection contents are not convertable to COMPOUND_TEXT, UTF8_STRING or STRING format (for example, if it is an image), after those conversion attempts have failed, we sit in winProcessXEventsTimeout() until the timeout expires. It also seems that maybe gnuplot doesn't respond correctly to this sequence of conversion requests and doesn't reply to some of them, which also causes us to sit in winProcessXEventsTimeout() until the timeout expires. The Windows application which has requested the clipboard contents via GetClipboardContents() is blocked until we return from WM_RENDERFORMAT, so sitting waiting for this timeout to expire should be avoided. So instead, explicitly request conversion to the TARGETS target, choose the most preferred format, and request conversion to that. Also: if there is no owned selection, there is nothing to paste, so don't bother trying to convert it. v2: Fix compilation with -Werror=declaration-after-statement Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 4db1241037e3fe8f0a46888377b8fef40bae9065 Author: Jon TURNEY Date: Tue Sep 24 13:30:32 2013 +0100 hw/xwin: In SelectionNotify, don't pointlessly retrieve just the size of the property Don't pointlessly retrieve just the size of the property, if we are then going to assume we can retrieve the whole property in one request anyhow... Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit c5ad92077e7eb32590fafa92d697cc4173f7e57b Author: Jon TURNEY Date: Tue Sep 24 12:23:42 2013 +0100 hw/xwin: In SelectionNotify, delete the property containing returned data after we have retrieved it Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit ff018d88b9f0fe23ba96c81b53d58532baf4df42 Author: Jon TURNEY Date: Thu Oct 2 14:10:50 2014 +0100 hw/xwin: Remove some redundant clipboard externs, now defined in winglobals.h Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 63bb5c5ef16edf652179770294dcca4fc07dc992 Author: Thierry Reding Date: Wed Oct 29 16:59:27 2014 +0100 xv: Add missing gcstruct.h include Commit ea3f3b0786d5 (xv: Move xf86 XV color key helper to core.) added code that uses internals of struct _GC. This structure is defined in the include/gcstruct.h header which wasn't included by the source file, only gc.h was. That caused the following build failure: CC xvmain.lo Xext/xvmain.c: In function 'XvFillColorKey': Xext/xvmain.c:1114:13: error: dereferencing pointer to incomplete type (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); ^ Fix this by including the correct header file. Signed-off-by: Thierry Reding Tested-by: Keith Packard Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 882f2d10d99a04a96afc0ce0c8937e16bec3afb5 Author: Axel Davy Date: Wed Oct 29 13:31:42 2014 +0100 Fix present_notify to return right away when querying current or past msc. When the target msc is past or is the current one, we want to get immediate feedback. This patch fixes this behaviour. Signed-off-by: Axel Davy Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 72a0754f4605493fd60471557422f88a97eb356a Author: Aaron Plattner Date: Wed Oct 29 19:19:18 2014 -0700 xfree86: Bump ABI versions (video: 19, extension: 9) Among other things, commit b851ca968b7cce6d1a6438c05d3d5c8832249704 added a NameWindowPixmap function pointer to ScreenRec, shifting some of the fields around. Signed-off-by: Aaron Plattner Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit b227d974569b4c315a72b85fe839c5f455396678 Author: Peter Hutterer Date: Thu Oct 30 08:54:11 2014 +1000 include: fix compiler warning about casting int to uint16_t /usr/include/xorg/misc.h:141:30: warning: implicit conversion loses integer precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wconversion] return ((x & 0xff) << 8) | ((x >> 8) & 0xff); ~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ Function sig is a uint16_t, so just force the cast. Signed-off-by: Peter Hutterer commit e9db7682028bb0464c211c1f7bb6983fcfb6f37b Author: Keith Packard Date: Tue Oct 28 21:32:24 2014 -0700 Update to version 1.16.99.901 1.17 RC1 Signed-off-by: Keith Packard commit 5ff74d68b0cce85e041251efdc76595eac3c89e4 Author: Keith Packard Date: Tue Oct 28 21:31:40 2014 -0700 xfree86: Include 'drivers' directory with distribution Even if we don't build it locally, make sure it gets included with the release. Signed-off-by: Keith Packard commit f36f16f0551aa091c1ff154875aebe3d29cf51e7 Author: Keith Packard Date: Tue Oct 28 21:30:23 2014 -0700 dri2: Distribute new pci_ids headers Create hw/xfree86/dri2/pci_ids/Makefile.am which includes all of the new pci id files in the tarballs. Build that from configure.ac, and run it from dri2/Makefile.am Signed-off-by: Keith Packard commit 65dd1ba7b3e00243a76ec691e566ef7c8dd94855 Author: Keith Packard Date: Wed Oct 22 14:48:10 2014 -0700 dix: Untwist transformAbsolute logic, eliminate uninitialized value warnings tranformAbsolute has a pretty simple job, that of running the X/Y values from a device through the transformation matrix. The tricky bit comes when the current device state doesn't include one of the values. In that case, the last delivered value is back-converted to device space and used instead. The logic was twisted though, confusing GCC's uninitialized value detection logic and emitting warnings. This has been fixed by changing the code to: 1) Detect whether the ValuatorMask includes X/Y values 2) If either are missing, back-convert the current values into ox/oy 3) When X/Y are present, set ox/oy to the current value 4) Transform 5) Store X/Y values if changed or if they were set before. Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer commit 0fbbdb37c87b5824729f65c7fbac05223024fd27 Author: Adam Jackson Date: Wed Oct 22 13:19:18 2014 -0400 composite: Wrap GetSpans GetSpans should flush composition from children to parent, just like GetImage and SourceValidate. Fortunately no one is likely to have noticed, since to hit this you're already deep into failure town. Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit da70c7d556bbf21ad495c26e982e2e0f2d7de6c1 Author: Keith Packard Date: Wed Oct 22 14:27:26 2014 -0700 xkb: Initialize 'bad' Atom in _XkbSetNamesCheck When _XkbCheckAtoms returns NULL for an error, it always sets the error return code, but GCC can't figure that out, so just initialize the local variable, 'bad', in _XkbSetNamesCheck to eliminate the warning. Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer commit 2566835b4374edb3e5a8353d4f7c9e7ec4851c57 Author: Keith Packard Date: Wed Oct 22 14:24:55 2014 -0700 os: Eliminate uninitialized value warnings from access.c The ConvertAddr function doesn't reliably set the 'addr' return value, and so callers are getting flagged for using potentially uninitialized values. Initialize the value in the callers to NULL and then go ahead and check for NULL values before using them. Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer commit 1b94fd77792310c80b0a2bcf4bf6d4e4c4c23bca Author: Alex Orange Date: Fri Oct 3 15:41:38 2014 -0600 fb: Fix Bresenham algorithms for commonly used small segments. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168 Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said patch does indeed remove the problematic writes to bad memory, however it also introduces errors in the algoritm. This patch has the effect of reverting said patch and adding an if in the proper location to catch the out of bounds memory write without causing problems to the overall algorithm. Signed-off-by: Alex Orange Reviewed-by: Peter Harris Tested-by: Peter Harris Signed-off-by: Keith Packard commit ea5b2b0a2e2143ad1414fcbdc081b5d584588346 Author: Jon TURNEY Date: Tue Oct 21 15:03:55 2014 +0100 os: -displayfd should check ports up to 65535 -displayfd should check ports up to 65535 Noticed during https://cygwin.com/ml/cygwin-xfree/2014-07/msg00024.html Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 3a123fbdda56b24dc01a2308137144dc960e0d61 Merge: 9b29fa9 7ea4a21 Author: Keith Packard Date: Mon Oct 27 15:39:26 2014 -0700 Merge remote-tracking branch 'jturney/master' Conflicts: hw/xwin/winpixmap.c Adam removed a pile of windows code, including this file. commit 9b29fa957a397664463c7c78fbcc2f34d1993271 Author: Chris Wilson Date: Thu Oct 16 14:09:08 2014 +0100 Xext/shm: Detach SHM segment after Pixmap is released The GPU may still have a reference to the SHM segment which would only be finally released when the Pixmap is destroy. So we can only detach the SHM segment (and thereby making the memory unaccessible) after the backend has had a chance to flush any remaining references. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85058 Signed-off-by: Chris Wilson Reported-and-tested-by: gedgon@gmail.com Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 5adc20179e9818d51e1cd79bfc8a8271786c3949 Author: Keith Packard Date: Mon Oct 27 15:28:14 2014 -0700 modesetting: Skip kernel work-around on error in crtc to kernel msc ms_crtc_msc_to_kernel_msc attempts to work around kernel inconsistencies in reporting msc values by comparing the expected value with the reported value. If the kernel fails to actually provide its current values, then just skip the work around steps as there's really nothing better we can do. Signed-off-by: Keith Packard commit 59b12c454d9c4b5a26c6ad87c53abc671b15ce37 Merge: 5574a0a cac4b06 Author: Keith Packard Date: Mon Oct 27 14:48:55 2014 -0700 Merge remote-tracking branch 'anholt/modesetting-dri2-no-pageflip' commit 5574a0a07e83ff989c074c44d3ea9db0a819f472 Author: Keith Packard Date: Mon Oct 27 13:38:21 2014 -0700 composite: Skip SetWindowPixmap when pixmap isn't changing Check the current window pixmap to see if it matches the new pixmap and avoid calling SetWindowPixmap in that case. x11perf -ucreate highlights an instance where compCreateWindow reassigns the same Pixmap to the Window. Currently this triggers an expensive invalidation of the entire window hierachy, making sure that DRI2 clients are kept informed of the handle changes. However, as the backing Pixmap for the Window is actually unchanged, there is no need to do anything in this case. Signed-off-by: Keith Packard Reviewed-by: Chris Wilson Tested-by: Chris Wilson commit df6a3a07f60c40bab2b59b9b3ba0c20c8fb7e95d Author: Yogish Kulkarni Date: Wed Oct 22 12:55:28 2014 +0530 Skip SetCursor when vtSema is FALSE. Consider below sequence - 1) Cursor is removed : isUp will be FALSE if HW cursor is set. 2) VT switched away from X : vtSema becomes FALSE. 3) xf86CursorSetCursor is called with non-null CursorPtr : Saves the passed in CursorPtr, fallbacks to SW cursor and invokes spriteFuncs->SetCursor which saves the area under cursor and restores the cursor. This sets isUp to TRUE and as vtSema is FALSE saved data is garbage. 4) VT switched to X : vtSema becomes TRUE. xf86Cursor enable fb access is called which will remove the SW cursor, i.e copies saved data in #3 to screen. This results to momentary garbage data on screen. Hence when !vtSema skip spriteFuncs->SetCursor. X.Org Bug 85313 Signed-off-by: Yogish Kulkarni Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit cac4b064f9f66435430f61568c6a516c54bf3c40 Author: Eric Anholt Date: Mon Dec 30 17:23:38 2013 -0800 modesetting: Add support for DRI2 with glamor. This is derived from the intel driver DRI2 code, with swapchain and pageflipping dropped, functions renamed, and vblank event management shared code moved to a vblank.c for reuse by Present. This allows AIGLX to load, which means that you get appropriate visuals exposed in GL, along with many extensions under direct-rendering that require presence in GLX (which aren't supported in glxdriswrast.c). v2: Drop unused header includes in pageflip.c, wrap in #ifdef GLAMOR. Drop triple-buffering, which was totally broken in practice (I'll try to fix this later). Fix up some style nits. Document the general flow of pageflipping and why, rename the DRI2 frame event type enums to reflect what they're for, and handle them in a single switch statement so you can understand the state machine more easily. v3: Drop pageflipping entirely -- it's unstable on my Intel laptop (not that the normal 2D driver is stable with pageflipping for me), and I won't get it fixed before the merge window. It now passes all of the OML_sync_control tests from Jamey and Theo (except for occasional warns in timing -fullscreen -divisor 2). v4: Fix doxygen at the top of vblank.c Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 7064b00d478646cb428e427df2d3f91d7022c582 Author: Eric Anholt Date: Mon Dec 30 00:25:37 2013 -0800 modesetting: Export two functions I want to reuse from DRI2/Present. This renames dumb_get_bo_from_handle(), since it wasn't using a handle (GEM terminology) but a dmabuf fd. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Reviewed-by: Alex Deucher commit 34a98c8103a6f725283d0d1ee4084bf387b93019 Author: Eric Anholt Date: Wed Oct 8 04:12:49 2014 -0700 dri2: Automatically fill in the driver name if the DDX doesn't provide it. This will be used by the modesetting driver to support DRI2 across all hardware that can support glamor, and could potentially be used by other drivers that have to support DRI2 on sets of hardware with multiple Mesa drivers. This logic is the same as what's present in the Mesa driver loader, except for the lack of nouveau_vieux support (which requires a predicate on the device). v2: Fix duplicated assignment of info->driverName. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 470d97e1d176981dbd8087c621e54caab0d6c73c Author: Eric Anholt Date: Tue Dec 31 13:52:49 2013 -0800 dri2: Import a copy of Mesa's PCI ID -> driver name mappings. This comes from Mesa commit acdcef6788beaa2a1532e13ff84c3e246b8025ed Previously, each driver had to tell DRI2 what GL driver object should be loaded. Originally for a 2D driver that was a matter of giving the constant string for the vendor name, same as the driver's name. For a driver that's trying to handle multiple generations of hardware with different Mesa driver filenames, the driver had to bake in a mapping from PCI ID to the appropriate driver name in Mesa, which seems like a pretty awful layering violation (and one that was fixed with DRI3) As of January, Mesa now handles the mapping from a DRI fd to the driver name on its own, but the AIGLX loader still relies on DRI2 for choosing the filename. Instead of propagating the PCI ID list from each 2D driver to the modesetting driver, import a central copy of the PCI ID list so that drivers can stop handling this themselves. (Some day, when AIGLX transitions to EGL, we can drop the DRI2 filename setup entirely). Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 839f05329ddb6f9b5b988edf3a2c3a1f856727f7 Author: Adam Jackson Date: Fri Feb 28 16:35:10 2014 -0500 dix: Retype and repack GC LP64: 160 bytes before, 128 after. Signed-off-by: Adam Jackson Reviewed-by: Keith Packard commit 73e2383b7350723256894c5076d0c731aec5cd1f Author: Adam Jackson Date: Fri Jun 20 13:31:20 2014 -0400 dix: Always store GC client clip as a region (v2) Again, this changes FixesCreateRegionFromGC to throw BadMatch when fed a GC with no client clip. v2: Fix Xnest and some variable names (Keith) Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit e7b9295551d55b42b416ba70cce11dae79ece5e7 Author: Adam Jackson Date: Fri Sep 26 13:41:59 2014 -0400 fb: Hide fbPush{Pattern,Fill} Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit e31d16a82d83738740f67743b759c006d9845e79 Author: Adam Jackson Date: Fri Sep 26 13:32:37 2014 -0400 fb: Hide fbDots Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 5db0f067ed4ff24c48cdb7998e4a52ad80037cb7 Author: Adam Jackson Date: Fri Sep 26 13:30:06 2014 -0400 fb: Hide Bresenham line details Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit b184a863c111834e28564d963c0733a30833f128 Author: Adam Jackson Date: Tue Jul 8 12:23:48 2014 -0400 fb: Hide some zero-width line details Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 266cd552bd54fd3e7a83ae7178a303285857631e Author: Adam Jackson Date: Tue Jul 8 12:13:13 2014 -0400 fb: Hide glyph implementation details Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit e572bcc7f4236b7e0f23ab762f225b3bce37db59 Author: Adam Jackson Date: Mon Jun 23 15:24:35 2014 -0400 fb: Remove even/odd tile slow-pathing Again, clearly meant to be a fast path, but this turns out not to be the case. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 836bb27726441e048bb300664343a136bc596a5b Author: Adam Jackson Date: Tue Jun 17 12:25:42 2014 -0400 fb: Remove unused fbReduceRasterOp Appears to have been cargo-culted in from cfb and then never used. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 167ccd33e0d2c4bd68aebcdba5a512d24c5eb49a Author: Adam Jackson Date: Tue Jun 17 12:21:19 2014 -0400 fb: Move fbStipple*Bits near their only consumer And remove fbStippleTable since gcc can't figure that out itself. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 7430fdb689678b98ac63f5a8dad13719bac777e0 Author: Adam Jackson Date: Tue Dec 17 14:46:38 2013 -0500 fb: Remove even/odd stipple slow-pathing This is clearly meant to be a fast path, but it appears to be a net loss at this point. If you really wanted to ricer-tune here, note that the inner loop of fbBltOne is a bit too complicated for gcc (at least 4.8.2), it doesn't specialize the loop for the handful of legal values of bitsPerDst, which means computing at runtime what could have been const-propped. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit a1983736853814d34450c0a0de1c4f6ee308423d Author: Adam Jackson Date: Tue Jun 17 11:24:06 2014 -0400 fb: FB_SHIFT is 5 (and FB_UNIT is 32) The other paths don't build or work, PCI and other buses are almost always 32 bit data paths, and X doesn't really support pixels bigger than that anyway. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 3d35bd6b79957a3441abd87a377f0beb058997ed Author: Adam Jackson Date: Mon Mar 24 12:01:54 2014 -0400 fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane gcc doesn't appear to be smart enough to fold away the indirection here, even if you make fbLaneTable const. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 86ce6262975a7d53d9331723beb49cbe7bd02b48 Author: Adam Jackson Date: Fri Sep 26 12:39:38 2014 -0400 mi: Fold micursor.c into mipointer.c Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 3b63900e90f44cf85a4d3391d23407b3bb6db52b Author: Adam Jackson Date: Fri Sep 26 12:34:15 2014 -0400 mi: Fold mipolyutil.c into mipoly.c Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 21b041ef48c49ff6fc06f6e4482ffe54cb763493 Author: Adam Jackson Date: Fri Sep 26 12:27:22 2014 -0400 mi: Fold mipoly{con,gen}.c into mipoly.c Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 7679afd4da8b86aed27e5916ba723116a3c8bb4a Author: Adam Jackson Date: Fri Sep 26 12:01:37 2014 -0400 mi: Fold mifpolycon.c into miarc.c Also put mifpoly.h on a diet, and stop including it from places that don't need it. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit f307ef10f4c33da4b5ae59800931741b0a431d75 Author: Adam Jackson Date: Mon Jul 21 17:22:07 2014 -0400 mi: Fold mispans.c into miwideline.c Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 707965407a3c907058b89610e73e02989fd0b552 Author: Adam Jackson Date: Fri May 23 12:10:29 2014 -0400 mi: Unexport arc fill implementation details Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit ce8fff5cd681523088c14b97ce4fb6e4fb658321 Author: Adam Jackson Date: Fri May 23 12:06:03 2014 -0400 mi: Unexport subpixel polygon implementation details Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit a085ba82bde375b5c884a40b410b563815c58a9e Author: Adam Jackson Date: Fri May 23 11:55:05 2014 -0400 mi: Unexport span group implementation details Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit c15c886ee70f9144bc4603b918310f229312aadc Author: Adam Jackson Date: Fri May 23 11:50:07 2014 -0400 mi: Unexport polygon edge table implementation details Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 9bdc9b0113915de3d536b2b3f025915379c2126f Author: Adam Jackson Date: Fri May 23 11:21:28 2014 -0400 mi: Unexport wide line details XAA wanted these, once upon a time, but that's gone now. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit d181e52ceb9ae44e1faa8d5af8805f43328da6c2 Author: Keith Packard Date: Fri Oct 24 11:56:23 2014 -0700 glamor: Free converted bits in _glamor_upload_bits_to_pixmap_texture fast path When uploading bits to a texture which need reformatting to match a supported GL format, a temporary buffer is allocated to hold the reformatted bits. This gets freed in the general path, but is not freed in the fast path because that includes an early return before the call to free. This patch removes the early return and places the general case under an 'else' block, so that both paths reach the call to free. Signed-off-by: Keith Packard Reviewed-by: Alex Deucher commit 55b27ed70cf9dfa9b9dffe46e9a3191bfda38f7c Author: Andreas Hartmetz Date: Sat Oct 4 18:13:04 2014 +0200 glamor: Don't free memory we are going to use. glamor_color_convert_to_bits() returns its second argument on success, NULL on error, and need_free_bits already makes sure that "bits" aliasing converted_bits is freed in the success case. Looks like the memory leak that was supposed to be fixed in 6e50bfa706cd3ab884c933bf1f17c221a6208aa4 only occurred in the error case. Reviewed-by: Michel Dänzer Signed-off-by: Keith Packard commit 16a32c53f6e9ad1f3284d4596edfa33e9efb740e Author: Alan Coopersmith Date: Thu Oct 9 05:42:09 2014 -0700 If fork fails in System(), don't fallthrough to exec() In the unlikely event of a failure in creating processes, signal masks will fall from the panels above you. Secure your mask before telling your child what to do, since it won't exist, and you will instead cause the server itself to be replaced by a shell running the target program. Found by Coverity #53397: Missing break in switch Execution falls through to the next case statement or default; this might indicate a common typo. In System: Missing break statement between cases in switch statement (CWE-484) Signed-off-by: Alan Coopersmith Reviewed-by: Matthieu Herrb Signed-off-by: Keith Packard commit 7e5bc49d1ed2c78c321da79bdbc99b90c5f95b38 Author: Alan Coopersmith Date: Thu Oct 9 05:42:08 2014 -0700 Allocate enough room for both reset & flags attributes ctx_attribs had room for 3 pairs of attributes, but if both flags & reset attributes were being returned it was storing 4 pairs in the array. Found by Coverity #53442: Out-of-bounds write This could cause an immediate crash or incorrect computations. In create_driver_context: Out-of-bounds write to a buffer (CWE-119) Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit cffd4e4a4ee615d8583eae78b35017e0d1bfa4f0 Author: Adam Jackson Date: Thu Oct 9 09:58:06 2014 +0200 mi: Mark the span blit routines as _X_COLD On gcc, __attribute__((cold)) means: - consider calls to the function to be unlikely for branch prediction - optimize the function for size - emit the function in a dedicated cold text section It's not worth deleting these routines even though there are no longer in-tree consumers, but we can at least keep them out of i$ at runtime. Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit de55aafa8f6a9e0dec364bec920d6f91ef2b39f0 Merge: 462bf87 c79f824 Author: Keith Packard Date: Thu Oct 23 17:28:24 2014 -0700 Merge remote-tracking branch 'ajax/xwin' commit 462bf87c4d1c2211dd49a5ce62d01ff84ff33970 Author: Adam Jackson Date: Wed Oct 8 17:20:33 2014 +0200 render: Always store client clip as a region This does have one semantic change. FixesCreateRegionFromPicture used to throw BadImplementation if you tried to create a region from a picture with no client clip. I changed that to BadMatch here since that more honestly describes what's going on. Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 3f4edd2e3ff84c38df563b09c2e8c32404db38f7 Author: Adam Jackson Date: Wed Oct 8 17:18:32 2014 +0200 xinerama: Fix access mode in GetImage's drawable lookup Signed-off-by: Adam Jackson Reviewed-by: Julien Cristau Signed-off-by: Keith Packard commit 942e18e17e334d7a25f8c1dcc6f5c3711eeb6a7d Author: William ML Leslie Date: Wed May 21 10:28:52 2014 +1000 Xephyr: option to disable grabbing the host This patch makes it possible to use C-S key combinations within Xephyr without losing access to the host window manager's commands. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 7ea4a21feed5ac5e71cc6d8141c97d6362402c5d Author: Jon TURNEY Date: Fri Sep 19 13:37:50 2014 +0100 configure.ac: Force --disable-libdrm on Cygwin This is now needed to avoid trying to build the modesetting driver by default when building the Xorg DDX on Cygwin. http://tinderbox.x.org/builds/2014-09-18-0011/logs/xserver/#build Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit 883927d2e8733f4070b2a8bcc5ec8cc2d7a661b3 Author: Jon TURNEY Date: Tue Sep 30 13:55:59 2014 +0100 configure.ac: Avoid "Your OS is unknown" warning when configuring for Cygwin Don't emit "Your OS is unknown" warning when configuring with --enable-xorg to build the XOrg DDX for Cygwin. The list of supported OSes is getting a bit unwieldy, so just remove it. Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit 549b3175afc46cee6e1b61841f854a5272eaf1f7 Author: Jon TURNEY Date: Thu Oct 2 15:37:50 2014 +0100 hw/xwin: Fix unused variable warning in winCreateMsgWindow() winmsgwindow.c:99:11: warning: variable ‘winClass’ set but not used [-Wunused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 5adfb566fe05bcf5f40b4adc1457862936d6d038 Author: Jon TURNEY Date: Fri Oct 3 14:22:30 2014 +0100 hw/xwin: Fix redundant declaration warning in winprefslex.l winprefslex.l:40:12: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] winprefsyacc.h:130:5: note: previous declaration of ‘yyparse’ was here Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 8f062f73805765f5769dfd7b738c8dd10062fba6 Author: Jon TURNEY Date: Fri Oct 3 14:12:57 2014 +0100 hw/xwin: Fix warning in yyerror() winprefsyacc.y:257:3: warning: nested extern declaration of ‘yylineno’ [-Wnested-externs] Promote yylineno declaration to file scope Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit f0f0c92a08f0ccf5a7ac447d117eb0341fe136d6 Author: Jon TURNEY Date: Fri Oct 3 14:00:06 2014 +0100 hw/xwin: Fix const warning in winPrefsLoadPreferences() winprefs.c:643:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 593c6b19349538ec3b89bc48eb3f0bb4c0cebb23 Author: Jon TURNEY Date: Thu Oct 2 15:35:54 2014 +0100 hw/xwin: Fix const warnings in winprefsyacc.y winprefsyacc.y:174:5: warning: passing argument 1 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:174:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:175:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:178:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.c:1737:9: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:82:12: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.c:1854:3: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 394ad259596801860d32d531408a07b63e469427 Author: Jon TURNEY Date: Thu Oct 2 14:31:35 2014 +0100 hw/xwin: Fix const warning in winCheckDisplayNumber() InitOutput.c:1032:19: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 701492e5d9487545afeb5ebfcebccc0408ca7bc4 Author: Jon TURNEY Date: Thu Oct 2 14:30:56 2014 +0100 hw/xwin: Fix warning in winXIconToHICON() winmultiwindowicons.c:403:29: warning: passing argument 8 of ‘XGetWindowProperty’ from incompatible pointer type [enabled by default] /usr/include/X11/Xlib.h:2688:12: note: expected ‘Atom *’ but argument is of type ‘long unsigned int *’ Looks like this has been wrong since I added it in 527cf131 :-( Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit a14f1d94d5bb87055f7e4812e9ef75771ea65bc5 Author: Jon TURNEY Date: Thu Oct 2 14:09:40 2014 +0100 hw/xwin: Fix format warnings with debug printing of pointers on 64-bit Fix various pieces of debug output, mainly under --enable-debug, which use a "%08x" printf format for a pointer type. Use "%p" format for 64-bit portability. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 03d462ddd2cacce92dc9e6bad00710d899509387 Author: Jon TURNEY Date: Thu Oct 2 12:04:20 2014 +0100 hw/xwin: Fix warnings in glx/glshim.c glext.h currently requires GL_GLEXT_PROTOTYPES in order to prototype glCompressedTexImmage* functions generated_gl_shim.c:2859:6: warning: no previous prototype for 'glCompressedTexImage3DARB' [-Wmissing-prototypes] generated_gl_shim.c:2866:6: warning: no previous prototype for 'glCompressedTexImage2DARB' [-Wmissing-prototypes] generated_gl_shim.c:2873:6: warning: no previous prototype for 'glCompressedTexImage1DARB' [-Wmissing-prototypes] generated_gl_shim.c:2880:6: warning: no previous prototype for 'glCompressedTexSubImage3DARB' [-Wmissing-prototypes] generated_gl_shim.c:2887:6: warning: no previous prototype for 'glCompressedTexSubImage2DARB' [-Wmissing-prototypes] generated_gl_shim.c:2894:6: warning: no previous prototype for 'glCompressedTexSubImage1DARB' [-Wmissing-prototypes] generated_gl_shim.c:2901:6: warning: no previous prototype for 'glGetCompressedTexImageARB' [-Wmissing-prototypes] Also, explicitly prototype glXGetProcAddressARB(), as glx/glxdri*.c does, as it's not practical to include glx.h here... Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 329e8125aa3b4c83121f8290a5436c2cb4c1cf96 Author: Jon TURNEY Date: Wed Oct 1 12:14:43 2014 +0100 hw/xwin: Fix compilation with -Werror=declaration-after-statement xevents.c: In function 'winClipboardInitMonitoredSelections': xevents.c:129:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < CLIP_NUM_SELECTIONS; ++i) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 97c3298caab7c5a5396fcbde02d862e5380d7d2e Author: Jon TURNEY Date: Wed Oct 1 12:02:04 2014 +0100 hw/xwin: Fix compilation with -Werror=return-type winshadddnl.c: In function ‘winRedrawScreenShadowDDNL’: winshadddnl.c:991:9: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] Just wrong in 1c34e774 Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 61a292adf45405641de1c522a04c148e0a152acd Author: Keith Packard Date: Thu Oct 9 15:17:17 2014 +0200 glx: check return from __glXGetAnswerBuffer This function can return NULL; make sure every caller tests for that. Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit d634ecdf82f244ff8ce75d351fc175792d254e5c Merge: 6622f0c 7ebf480 Author: Keith Packard Date: Thu Oct 9 15:08:31 2014 +0200 Merge remote-tracking branch 'ajax/dead-code' commit 6622f0cb1761501f3287ffa8d3cbca3fd30f9f0c Merge: f12e7f4 5ecd786 Author: Keith Packard Date: Thu Oct 9 15:05:26 2014 +0200 Merge remote-tracking branch 'ajax/mi-cleanup' commit f12e7f4980416b74988052a04d0f2487b2c4a7e9 Merge: da88772 aaf5e2d Author: Keith Packard Date: Thu Oct 9 14:21:19 2014 +0200 Merge remote-tracking branch 'anholt/modesetting-glamor' commit da887726eeaece0396962dd3912578d3372881b1 Author: Alan Coopersmith Date: Sun Sep 21 09:49:06 2014 -0700 Use unique display name for each xi2 test program [v3] make -j 8 check was sporadically failing in different xi2 tests. After adding the asserts in the previous commit to catch xkb failure it became easier to catch the failures and see that multiple tests were running at once trying to write to /tmp/server-(null).xkm and then delete it, and interfering with each other. Putting a unique string into the display variable let them each write to their own file and not interfere with others. v2: Fix Linux bits: Add #include to get a declaration of program_invocation_name on Linux. Use only the last portion of the pathname so that the resulting display name doesn't contain any slashes. v3: use program_invocation_short_name on Linux This is the same as program_invocation_name, except is has stripped off any path prefix. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 5ecd7866f7587d620f000e802a262c7cd4b9df33 Author: Adam Jackson Date: Thu Sep 11 10:11:39 2014 -0400 misc: Fold together some redundant conditionals Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 5b07f1db6de9f08f757206454da03ee0ae872bfc Author: Adam Jackson Date: Thu Sep 18 16:05:40 2014 -0400 fb: fb{Map,Unmap}Window -> fb{Realize,Unrealize}Window Make the function names match the screen slot name. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 9ed83a694b6492c9db226b115ed282cb127e798e Author: Adam Jackson Date: Thu Sep 18 15:36:57 2014 -0400 mi: miSlideAndSizeWindow -> miResizeWindow Make the function name match the screen slot name. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 939ca767c7603923a91fd37901175a42e802d40e Author: Adam Jackson Date: Thu Sep 18 14:50:28 2014 -0400 dix: Remove an obfuscatory macro Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit d138d9ccc62a9472925574089f346bf9aa3dab1f Author: Adam Jackson Date: Mon Sep 15 13:05:24 2014 -0400 dix: Remove some pointless casting of NULL Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 277330075bfbd4343c4efdd136e0be716e1a491f Author: Adam Jackson Date: Mon Sep 15 12:30:44 2014 -0400 dix: Remove an empty if Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 81d76a835b2f647e3051b1d93606e59db7998d76 Author: Adam Jackson Date: Mon Sep 15 12:10:55 2014 -0400 dix: Lower backStorage to a bit instead of a pointer Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 322ba42c23a3a107f7a62fb1c449792b616e5eba Author: Adam Jackson Date: Mon Sep 15 12:05:26 2014 -0400 dix: Remove DIXsaveUnder bit from the Window Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 1e56b2dfc6377234ffdcdf206528d476b04d13af Author: Adam Jackson Date: Fri Sep 12 12:51:13 2014 -0400 mi: Move pScreen->SendGraphicsExpose up to dix No DDX is overriding this and it's fairly absurd to expose it as a screen operation anyway. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 5d3bd8a3dc6456ea1ccf7b5f71b972379d7565ec Author: Adam Jackson Date: Fri Sep 12 11:56:28 2014 -0400 mi: Drop plane argument from miHandleExposures This existed to be passed to the bs recovery routine; since we back all planes, we don't care. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 7eddc80bc4a6c1902746a9fbe79ab553f9fd5821 Author: Adam Jackson Date: Tue Aug 5 14:07:17 2014 -0400 mi: Simplify composite border clip redirection interface There's not really a good reason for mi to not just call the composite code directly. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 7b35dc9b1533d4b99a3f84f460ac66354a6fe347 Author: Adam Jackson Date: Tue Sep 23 10:35:37 2014 -0400 mi: Deobfuscate miOverlayWindowExposures Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit fb34f273481b90a90a988f0f5c5a2d642a5661b8 Author: Adam Jackson Date: Tue Sep 23 10:30:56 2014 -0400 mi: Deobfuscate miWindowExposures Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 0d30d44a8cdacfbc99d8193f76c133b803464622 Author: Adam Jackson Date: Thu Sep 11 12:44:54 2014 -0400 dix: Drop the third argument from WindowExposuresProcPtr A careful read shows that it was always NULL. It hasn't always been; as the DDX spec indicates, it was the "occluded region that has backing store", but since that backing store code is long gone, we can nuke it. mi{,Overlay}WindowExposures get slightly simpler here, and will get even simpler in just a moment. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit aaf5e2d643af590366b2d02ad1c2db05d1fc4131 Author: Eric Anholt Date: Sat Dec 28 11:32:10 2013 -0800 modesetting: Add support for rendering using glamor. By default modesetting now tries to enable X acceleration using glamor, but falls back to normal shadowfb if GL fails to initialize. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 6d41bdb23ca92803e3a51dc317d2b80cdb92f43a Author: Eric Anholt Date: Tue Aug 26 16:59:37 2014 -0700 modesetting: Deduplicate some scrn setup. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 20a3b482191711bc15be0410ccc3651924271349 Author: Eric Anholt Date: Wed Oct 8 00:41:13 2014 -0700 modesetting: Fix some weird formatting after x-indent-all.sh. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 3119acdab9eecff90b8fd9a265e2a456e7bc8779 Author: Eric Anholt Date: Wed Oct 8 00:39:15 2014 -0700 modesetting: Run x-indent-all.sh. As I was editing code, the top-level .dir-locals.el was making my new stuff conflict with the existing style. Make it consistently use the xorg style, instead. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit c79f824bf6617816aaf10393beec8dddfa591f7b Author: Adam Jackson Date: Thu Sep 25 15:49:26 2014 -0400 xwin: Remove primary DirectDraw engine Again, as the documentation says, "unsupported, obsolete". Reviewed-by: Jon TURNEY Signed-off-by: Adam Jackson commit 8465ee788fd541fa37681aa0a44103c7f944d437 Author: Adam Jackson Date: Thu Sep 25 15:37:33 2014 -0400 xwin: Remove native GDI engine (v2) As the man page says, "unsupported, experimental, and barely functional". The last even minor updates to any of this were back in 2004, presumably it's not getting better any time soon. This is also the only GC ops implementation in the tree that actually falls all the way down to the spans routines for everything, so that's pretty nice to be rid of. v2: Fix stray break statement (Jon) Reviewed-by: Jon TURNEY Signed-off-by: Adam Jackson commit e2a3e91a56cb598f2c8257614d92ccd46b7fc094 Author: Adam Jackson Date: Fri Jul 25 11:01:22 2014 -0400 rootless: remove redundant RootlessShapedWindowIn miShapedWindowIn is identical. Which you would expect, since neither one takes an actual WindowPtr argument, so they couldn't possibly make reference to rootlessness. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 7e8ac6dcd24d56e384ad09c7c23259cb3f4f8dc6 Author: Adam Jackson Date: Thu Sep 11 12:30:15 2014 -0400 xquartz: Remove useless DRIWindowExposures Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit a8c6fc46c088bedb36c6441b78c98ca4cb9761b4 Author: Adam Jackson Date: Thu Sep 11 10:24:27 2014 -0400 kdrive: Remove vestigial reference to fbInitValidateTree Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 7ebf480f5eb75e06271ec924769e51bdcbbdc69c Author: Adam Jackson Date: Fri Feb 28 12:34:49 2014 -0500 xfree86: Remove some can't-happen printf from xf86CreateRootWindow Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 3689be96ac125c9bfca9d37de4878f05f4e2f584 Author: Adam Jackson Date: Tue Jun 10 12:54:41 2014 -0400 vfb: Don't reimplement micmap so much We know we're atop fb which is atop micmap, the only thing we need to hook is InstallColormap to handle the xwd colormap change. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 692676debbc2227054d67078c6442f1ab1811192 Author: Adam Jackson Date: Mon Jun 16 12:35:28 2014 -0400 loader: Remove some baklava code Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit c695a1430b80bac0b95e4d7f559e1bd223ecb1ef Author: Adam Jackson Date: Tue Jul 8 14:38:34 2014 -0400 input: Remove unused SetKeySymsMap Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson commit 645063cd9384a26353775e92a79ed8710c6ca66c Author: Adam Jackson Date: Tue Mar 4 12:51:49 2014 -0500 exa, kdrive: Remove redundant BitsPerPixel macros We already get this from servermd.h Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit cccba52d152a7d233c0b762a54844ecef831483e Author: Alan Coopersmith Date: Sun Sep 21 09:49:05 2014 -0700 Abort xi2 tests if ActivateDevice() fails I was getting segfaults in xi2 tests from trying to copy XKB keyboard state to NULL pointers with a stack of: key=key@entry=0) at xkbActions.c:1189 sendevent=sendevent@entry=0 '\000') at devices.c:420 at protocol-xiquerydevice.c:338 which turned out to be due to xkbcomp failure, which was logged in the test logs as: XKB: Failed to compile keymap Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config. but which was overlooked because the ActivateDevice() return code wasn't checked and the tests went forward assuming the structures were all correctly initialized. This catches the failure closer to the point of failure, to save debugging time. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 95a5b92e37f73f497d547fd91c543c16d2cc73de Author: Keith Packard Date: Thu Oct 2 10:26:53 2014 -0700 xfree86: Remove remaining return FALSE from configServerFlags Remove the error return path from the FLAG_PIXMAP path and leave the default value in place. There's no point skipping the rest of this function. Signed-off-by: Keith Packard commit e9651e3dbc32650fcaf90888b4cbef81da77cfcd Merge: 9bc01df 4433bc6 Author: Keith Packard Date: Thu Oct 2 10:24:33 2014 -0700 Merge remote-tracking branch 'ajax/dead-code' commit 9bc01dfc7070a40f5948588895b3a11dd1636d0e Author: Axel Davy Date: Sat Sep 27 23:17:13 2014 +0200 Fix present_pixmap when using present_notify_msc Calling present_notify_msc could cancel a pending pixmap presentation. Signed-off-by: Axel Davy Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit b3e9791fd375eb71b6150a77b8009b046b213004 Author: Daniel Martin Date: Sat Sep 20 09:07:41 2014 +0200 xfree86: Delete file modinit.h All references to modinit.h have been remove with: a1d41e3 Move extension initialisation prototypes into extinit.h Signed-off-by: Daniel Martin Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 2aeb9d8f8b22ceb1de883c231a0a75d4c75d3f4a Author: Daniel Martin Date: Sat Sep 20 09:07:40 2014 +0200 security: Remove XpExtension from SecurityTrustedExtensions There's no XPrint extension (anymore). Signed-off-by: Daniel Martin Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 12c19bbff4b7b2d0b350a7b93b38ebbf69748534 Author: Daniel Martin Date: Sat Sep 20 09:07:39 2014 +0200 dix: Remove XpExtension leftovers from protocol.txt There's no XPrint extension (anymore). Signed-off-by: Daniel Martin Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit d3d845ca9e92f0a2ccde93f4242d7769cfe14164 Author: Michel Dänzer Date: Thu Sep 25 15:27:22 2014 +0900 glamor: Use GL_STREAM_READ also for read/write access to a PBO Otherwise the CPU may end up reading from non-cacheable memory, which is very slow. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84178 Signed-off-by: Michel Dänzer Reviewed-by: Markus Wick Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 78c27d12e1f4857bfcfc92afbb69d5dd989232b9 Merge: 6e50bfa 1d6334d Author: Keith Packard Date: Mon Sep 29 13:04:49 2014 -0700 Merge remote-tracking branch 'jturney/xwin-clipboard-refactoring' commit 6e50bfa706cd3ab884c933bf1f17c221a6208aa4 Author: Michel Dänzer Date: Wed Sep 24 16:48:10 2014 +0900 glamor: Fix leak of converted_bits in _glamor_upload_bits_to_pixmap_texture ==9530== 808,575,600 bytes in 5,904 blocks are definitely lost in loss record 4,602 of 4,602 ==9530== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==9530== by 0xAD29C98: _glamor_upload_bits_to_pixmap_texture (glamor_pixmap.c:771) ==9530== by 0xAD2AE95: glamor_upload_sub_pixmap_to_texture (glamor_pixmap.c:1031) ==9530== by 0xAD2BD55: glamor_upload_pixmap_to_texture (glamor_pixmap.c:1057) ==9530== by 0xAD1C2E6: glamor_composite_choose_shader (glamor_render.c:1025) ==9530== by 0xAD1C629: glamor_composite_with_shader (glamor_render.c:1174) ==9530== by 0xAD1DA77: glamor_composite_clipped_region (glamor_render.c:1542) ==9530== by 0xAD1E849: _glamor_composite (glamor_render.c:1689) ==9530== by 0xAD1ED90: glamor_composite (glamor_render.c:1758) ==9530== by 0x519FD6: damageComposite (damage.c:502) ==9530== by 0xAD27AA3: glamor_trapezoids (glamor_trapezoid.c:147) ==9530== by 0xAD27B51: glamor_trapezoids (glamor_trapezoid.c:101) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84176 Signed-off-by: Michel Dänzer Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 4433bc6d53e651b3dc4112099a153c2574f30797 Author: Adam Jackson Date: Thu May 1 12:48:15 2014 -0400 x86emu: Undefine _NO_INLINE Never defined by the server. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 1c3cb68d0cd15d29fd3aaa9eedbfa772ec8e3a47 Author: Adam Jackson Date: Tue Jul 29 14:15:24 2014 -0400 xfree86: Remove pointless xf86PrintMarkers Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 30fa6da6f140d713041942a81f5d6da6736e4f7f Author: Adam Jackson Date: Tue Jul 29 14:07:39 2014 -0400 xfree86: configServerFlags never fails, make it return void Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 2bf9db1930528255a37f9787aeb82e2851f814c2 Author: Adam Jackson Date: Tue Jul 29 14:02:01 2014 -0400 xfree86: Remove unused xf86Info.useDefaultFontPathFrom Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit fffea07b4cb0992fed2cca33be08440ea94090d9 Author: Adam Jackson Date: Tue Jul 29 13:48:10 2014 -0400 xfree86: Remove xf86Info.log (v2) SUBCLASS ALL THE THINGS v2: Remove the enum too (anholt) Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 2f5cfbee5409b088156d4cd84a3376499e291631 Author: Adam Jackson Date: Tue Jul 8 14:50:22 2014 -0400 xfree86: Remove DisplayID support Not actually wired up so it's fairly useless. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit b56fcce761534d3e28b7ea19e2a13213c3157a1f Author: Adam Jackson Date: Tue Jun 17 10:36:44 2014 -0400 xfree86: Remove useless back-pointer to pScrn from colormap code Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit ef22655311efa0d5a5395ba2f19aa20d71a05a4f Author: Adam Jackson Date: Fri May 2 13:36:13 2014 -0400 xfree86: Remove spurious xf86ConfigError READABLE. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 35f0257360fa6e11b9ecc08e467163718e012bb1 Author: Adam Jackson Date: Tue Mar 4 11:12:16 2014 -0500 xfree86: Remove Option "TextClockFreq" No modern driver pays attention to this. Presumably there existed hardware once where you couldn't just read the right values out of the CRTC. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 6755aa2c1244fee11846c1e0b274bd34900e3299 Author: Adam Jackson Date: Fri Jul 25 12:31:54 2014 -0400 xfree86: Remove xv clip notify driver hook Nothing's using it. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit e89ccacea9a1e4bc3693bb78e717343addd517e5 Author: Adam Jackson Date: Thu Jan 23 10:27:58 2014 -0500 mi: Remove Windows 8-bpp colormap compatibility Nice, but not something our Windows servers build, and not something that belongs in mi anyway. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 7cd192edc195c089c6df32e9f22e57da7467b6fd Author: Adam Jackson Date: Mon Jun 16 11:55:30 2014 -0400 loader: Deobfuscate RTLD_* macro stuff POSIX requires that these be named correctly, no need to be clever. Reviewed-by: Mark Kettenis Signed-off-by: Adam Jackson commit cc59be38b7eff52a1d003b390f2994c73ee0b3e9 Author: Keith Packard Date: Fri Sep 12 11:33:48 2014 -0700 os: Don't listen to 'tcp' by default. Add '-listen' option. [v2] This disables the tcp listen socket by default. Then, it uses a new xtrans interface, TRANS(Listen), to provide a command line option to re-enable those if desired. v2: Leave unix socket enabled by default. Add configure options. Signed-off-by: Keith Packard Reviewed-by: Hans de Goede commit 8ada3fb32cd7dd8948eb55620de18ba03df6131d Author: Keith Packard Date: Sat Sep 20 10:04:11 2014 -0700 Require xtrans 1.3.5 or newer This version of xtrans offers the TRANS(Listen) function. Signed-off-by: Keith Packard commit 18935b41e13b34571ffda84bde5257b8e84e6d1f Author: Keith Packard Date: Sat Sep 20 04:04:43 2014 -0700 XSERVER_DTRACE needs request names from registry too The dtrace code in the server wants to log the name of each executed request, which it gets from the registry. Use that as an additional indication of when that portion of the registry should be included in the server build. See: http://tinderbox.x.org/builds/2014-09-19-0003/logs/xserver/#build Signed-off-by: Keith Packard Reviewed-by: Dave Airlie commit 28337cb14e4347e1dd7936c5393a22e042866687 Author: Jon TURNEY Date: Fri Sep 19 14:22:13 2014 +1000 xserver: Move 'pragma GCC diagnostic' outside functions $ gcc --version gcc (Gentoo 4.4.3-r2 p1.2) 4.4.3 /jhbuild/checkout/xorg/xserver/os/log.c: In function ‘LogInit’: /jhbuild/checkout/xorg/xserver/os/log.c:199: error: #pragma GCC diagnostic not allowed inside functions /jhbuild/checkout/xorg/xserver/os/log.c:201: warning: format not a string literal, argument types not checked /jhbuild/checkout/xorg/xserver/os/log.c:212: error: #pragma GCC diagnostic not allowed inside functions /jhbuild/checkout/xorg/xserver/os/log.c:214: warning: format not a string literal, argument types not checked etc. Reviewed-by: Dave Airlie Signed-off-by: Jon TURNEY Signed-off-by: Dave Airlie Signed-off-by: Keith Packard commit 7e6bd546846964fd9b8c2a06dea4782a552b62d7 Author: Keith Packard Date: Wed Aug 6 12:58:38 2014 -0700 glamor: Remove shader-based trapezoid implementation. Fixes Bug 76213. I can't find any performance benefit to using the GL path and the code renders this trapezoid incorrectly: top: FIXED 29.50 bottom: FIXED 30.00 left top: POINT 0.00, 29.50 left bottom: POINT 0.00, 30.50 right top: POINT -127.50, 29.50 right bottom: POINT 52.50, 30.00 This should render a solid line from 0,30 to 52,30 but draws nothing. The code also uses an area computation for trapezoid coverage which does not conform to the Render specification which requires a specific point sampling technique. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit b2452311bd1d67b4d78612570d4a25c685c78a0c Author: Keith Packard Date: Tue Aug 19 12:52:05 2014 -0700 glamor: Check large pixmap users in glamor_largepixmap.c This enables the assertion that all users of the large pixmap member are restricted to pixmaps which are actually large. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 5fc3e99f537b10dd9c2adfd37cf2c4ba5ed4bd44 Author: Keith Packard Date: Tue Aug 19 12:44:41 2014 -0700 glamor: Handle compositing from large to small pixmaps glamor_composite_largepixmap_region is given the job of dealing with compositing between a mixture of large and small pixmaps. However, it was assuming that the destination pixmap was large and fetching members of the large structure even for small pixmaps. This manifested with assertion failures when compositing from a large pixmap to a small pixmap. Fixed by using the pixmap size for the destination block size for small pixmaps. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 6e78d7f5e6edf56180e2ecfd25300bb2523876ab Author: Keith Packard Date: Tue Aug 19 12:41:45 2014 -0700 glamor: Don't abuse large_pixmap members for regular pixmaps glamor_compute_clipped_regions_ext wants to treat small and large pixmaps uniformly and did that by writing into the large pixmap union member in small pixmaps to construct something that looks like a one texture large pixmap. Instead of doing that, simply allocate the necessary elements locally on the stack and use them from there. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit bab319763c9734da3cff7b91a582f54989dc4cbe Author: Keith Packard Date: Tue Aug 19 12:39:07 2014 -0700 glamor: Add macro __glamor_large in glamor_largepixmap.c For now, this simply fetches the large member of the pixmap private. It will be changed to assert that the pixmap is large once bugs related to that have been fixed. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 16e429f1f96f984b1ff575875a7a4d7d29b482e2 Author: Keith Packard Date: Tue Aug 19 12:34:41 2014 -0700 glamor: Change SET_PIXMAP_FBO_CURRENT from macro to static inline This is the last function-like macro in glamor_priv.h; change to static inline like all of the other functions there. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit ea7357de90792cbceca6d8d9fdc144e7df8a0fba Author: Keith Packard Date: Wed Sep 10 14:01:59 2014 -0700 present: Clear pending flip pixmaps at CloseScreen If a flip is active at server reset time, the associated window will get destroyed which will queue an unflip operation. If that isn't synchronous, then it won't have finished by the time CloseScreen is called. Calling present_flip_idle will signal the fence and remove the reference to the fence and pixmap, freeing these in the X server and allowing a DRM client to clean up as well. This also rewords other comments in present_flip_destroy, removing scary words about needing synchronous operation (everything in this function is synchronous now) and describing what effect we actually need from present_set_abort_flip. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 2051514652481a83bd7cf22e57cb0fcd40333f33 Author: Keith Packard Date: Wed Sep 10 14:02:13 2014 -0700 present: Support PresentOptionCopy We added this option to the present protocol before 1.0 but somehow never implemented it in the server. It's pretty simple; just don't ever do flips if the application specifies Copy. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 69d8572ae4cd1bce17223ea8aff87916a974c861 Author: Keith Packard Date: Wed Sep 10 15:21:32 2014 -0700 Build required portions of registry.c automatically [v2] Instead of making the inclusion of the registry code a global conditional, split the registry into two pieces; the bits required by the X-Resource extension (the resource names) and the bits required by the XCSECURITY extension (the protocol names). Build each set of code if the related extension is being built. v2: Check for both XCSECURITY and XSELINUX. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit a11fc2493e85e4a532f4954805a7c6d1c601b08f Author: Keith Packard Date: Wed Sep 10 15:04:00 2014 -0700 dix: Close protocol.txt after we're done loading extension names Don't leave this file open during the whole server execution process; close it once all of the extensions are initialized. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 9e07f3a3d28b01402beecb3280c94fc525bd8075 Author: Keith Packard Date: Wed Sep 10 15:41:08 2014 -0700 test: Only build hashtable tests if building X-Resource extension The hash table functions are only included in the server when the X-Resource extension is built, so don't try to build and test them unless the X-Resource extension is being built. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 670ee0757febfb965d718fce2d5688717def667d Author: Adam Jackson Date: Tue Sep 16 11:10:58 2014 -0400 ephyr: Properly implement hardware cursors (v3) When dix hands us a new cursor we proxy it through to the host server; since we keep the host XID on the cursor bits private we can switch among them with just ChangeWindowAttributes. v2: Use xcb-renderutil for argb format lookup (Uli, Keith) Fall back to core cursors for host RENDER < 0.5 (Keith) Drop useless ephyrEnableCursor Consistently create/destroy the cursor image GC on both paths Treat null cursor from dix as invisible v3: Initialize the invisible cursor's image (Keith) Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit f839caadd4e567bf89f893aa7e5ba1327b712b4b Author: Adam Jackson Date: Wed Sep 17 11:07:22 2014 -0400 loader: Remove compatibility with ancient XFree86 version numbering Pretty sure I'm guilty of adding this. I think I was thinking of trying to be compatible with some really old binary-only driver that I had vague aspirations of reverse-engineering, but since I haven't gotten around to it in the intervening decade... Signed-off-by: Adam Jackson Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit af40913797e6595fb5466c2ff3110e9526a37b9f Author: Julien Cristau Date: Wed Sep 17 07:41:27 2014 +0200 xwayland: always include drm.xml in tarballs Move drm.xml out of the automake conditional so make dist includes it even if glamor-egl is disabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83960 Signed-off-by: Julien Cristau Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit eaee6572beefca240c42791f9a3a6e547bedd410 Merge: e3aa13b b84d25f Author: Keith Packard Date: Wed Sep 17 15:49:24 2014 -0700 Merge remote-tracking branch 'anholt/modesetting-import' commit e3aa13b8d63ea2fba6eb47ddd0a7dde5a6d2b661 Author: Jon TURNEY Date: Wed Sep 17 15:38:39 2014 -0700 Update help text since -iglx is now the default This should have been part of d0da0e9c3bb8fe0cd4879ecb24d21715bfaa209b Signed-off-by: Jon TURNEY Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit b84d25fd53e97105b99495af84abaacc4c901967 Author: Eric Anholt Date: Tue Aug 26 11:22:02 2014 -0700 modesetting: Drop remaining old-xserver compatibility. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 7b0965a826612988dd721ddbd67cfbec392b67b5 Author: Eric Anholt Date: Tue Aug 26 11:37:46 2014 -0700 modesetting: Drop use of compat-api.h Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 2feda3b6b58f46cef91ea41312aac9021a703777 Author: Eric Anholt Date: Tue Aug 26 11:06:23 2014 -0700 modesetting: Connect the driver to the build. v2: Fix libdrm version check, and use XORG_VERSION_* instead of a static 1.0.0 version for the driver module. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 30dcc10f6c9c4bacbc0e3652917c298ca9fb3898 Author: Adam Jackson Date: Mon May 5 11:18:33 2014 -0400 xfree86: Clean up some more alpha awareness Since the sparse stuff is gone none of these variables get used for anything, they're just dead side-effect-less execution. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 2e21c081d34d52ee49ac00a294d2e74caf529818 Author: Adam Jackson Date: Fri May 2 13:00:21 2014 -0400 xfree86: Remove the memory of MTRR awareness pciaccess does this for us, and none of our internal hooks really remain. This does remove a cleanup pass from the BSD code, but the case it's covering (a previous server leaving MTRRs around) can't happen anymore. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit c42712ab4d8eec56704ad5422d8f54befeb1e886 Author: Adam Jackson Date: Fri May 2 12:58:23 2014 -0400 xfree86: Remove xf86CheckMTRR Die die die die die. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 8686463de7e1ef9814824d46526d8177a7a492a0 Author: Adam Jackson Date: Fri May 2 12:55:37 2014 -0400 xfree86: Remove xf86ReadBIOS Not being used externally or internally anymore. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 21b216ad6ce2e9c89359b95e4196e42d91bf9420 Author: Adam Jackson Date: Fri May 2 12:46:45 2014 -0400 int10: Port off xf86ReadBIOS If the linux vm86 backend changes look somewhat horrifying to you, that's because you have taste. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 96c0da812a563d8229dc1396ac801329b3bcba91 Author: Adam Jackson Date: Fri May 2 12:39:01 2014 -0400 xfree86: Remove xf86LinearVidMem The only driver even pretending to check the result is mach64 anyway. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit ec0e29ed5bc71516de7feb226b548ce45cb9ffdf Author: Adam Jackson Date: Fri May 2 12:32:02 2014 -0400 xfree86: Remove {set,undo}WC from VidMemInfo Now that mapMem is gone this can never actually get called. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 9db2af6f757ef9680c70eb731698b7c9f9aca203 Author: Adam Jackson Date: Fri May 2 12:14:10 2014 -0400 xfree86: Remove xf86{Map,Unmap}VidMem This API sucks. Fortunately it's mostly unused at this point. geode, sis, and xgi need minor patches to use the corresponding pciaccess code, neomagic will (more explicitly) lose its non-PCI support, and newport will need to be ported to /dev/mem or the platform bus or something. This should also make it pretty clear that alpha's sparse memory support was basically not a thing anymore, very few tears shed. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 6d6aa8ab6b6d62d65f1354b4cd9af0bf4f2e81d7 Author: Eric Anholt Date: Tue Aug 26 11:43:54 2014 -0700 modesetting: Update for the platform device API change. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 9c080f44960d2338c7a59eee132a02d45186bfb0 Author: Eric Anholt Date: Tue Aug 26 11:41:46 2014 -0700 modesetting: Drop use of "pointer" for "void *" The xserver doesn't have that typedef. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit a10ea01475c6d0795b1a00cfd8be9912f4b54235 Author: Eric Anholt Date: Tue Aug 26 11:24:31 2014 -0700 modesetting: xserver already checks XEXTPROTO >= 7.2.99.901. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit c7e8d4a6ee9542f56cd241cf7a960fb8223a6b22 Author: Eric Anholt Date: Tue Aug 26 11:21:24 2014 -0700 modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT The server will always have it. v2: Clean up some weird formatting from the unifdeffing. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 0c07bfb38e61a8a6ad511dc8827e2dd20d68665d Author: Eric Anholt Date: Mon Aug 25 15:42:45 2014 -0700 modesetting: Merge modesetting's COPYING into the xserver's. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 1d6334dd0ca99923b6b55c5c047ef6b5c325f66c Author: Jon TURNEY Date: Wed Jun 19 13:09:35 2013 +0100 hw/xwin: Undefine _XSERVER64 in hw/xwin/winclipboard Including any server header might define the macro _XSERVER64 on 64 bit machines. That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. So let's undef that macro if necessary. Remove server directories from include path to ensure no server includes are included Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 7ca93301940647219dbed2d14fcd3f37e49fb477 Author: Jon TURNEY Date: Tue Jun 18 19:53:52 2013 +0100 hw/xwin: Only add to XSetIOErrorHandler() handler chain once Only use XSetIOErrorHandler() to add to the global XSetIOErrorHandler() chain once. If we do it every restart, then we make a loop in the handler chain, and we end up with a thread spinning in that loop when the server shuts down... Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 5819a02d461349dbfc86317c742406d2217f7f0c Author: Jon TURNEY Date: Tue Jun 18 19:35:20 2013 +0100 hw/xwin: Add a basic manpage for xwinclip Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 492c924c8531b013d50637e29213da287b9a7fa2 Author: Jon TURNEY Date: Tue Jun 18 19:28:53 2013 +0100 hw/xwin: In clipboard function prototypes, use Window type, not int type Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 4a38c3bda2b0a868d7611f9423d8a0f304b435aa Author: Jon TURNEY Date: Tue Jun 18 19:18:08 2013 +0100 hw/xwin: Remove XOpenDisplay() retry code Remove XOpenDisplay() retry code. This isn't a sensible thing for the application to be doing, and XWin server needs to retry much more than just XOpenDisplay(). Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 4fc62aef8079266f8878cb355e6eb894000d8b8b Author: Jon TURNEY Date: Wed Jun 19 14:00:28 2013 +0100 hw/xwin: Improve comment about why we can't XCloseDisplay() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 89eb7bdcad092821b61a48832e1db82975a2252b Author: Jon TURNEY Date: Wed Jun 19 13:59:40 2013 +0100 hw/xwin: Remove setjmp()/longjmp() error constants Check specially that setjmp() returned a value which we don't pass to longjmp() seems a bit over-complex. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit d0353bbe57aab910a6ef7da8778023a9d39c37df Author: Jon TURNEY Date: Thu Jun 20 00:04:16 2013 +0100 hw/xwin: Move WIN_MSG_QUEUE_FNAME to where it's used Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit fa0da5a020c2ea9366568375b7f35d3f2ddad680 Author: Jon TURNEY Date: Thu Jun 20 13:04:35 2013 +0100 hw/xwin: Use header for prototypes in textconv.c Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit cbe133752d1e817246b532a274fda3f7d74ebca1 Author: Jon TURNEY Date: Thu Jun 20 12:50:18 2013 +0100 hw/xwin: Remove unused X includes from internal.h and add them where needed Also removing server headers we might clash with and no longer need. Make a few adjustments to allow for this change: - provide a prototype of ErrorF() - use the MAX() macro provided by sys/param.h, not the max() macro provided by misc.h - use the X 'Bool' type rather than the unwrapped Windows 'BOOL' type Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 52f3cf3c612b2f33e39fd6f985b840a0d7192a50 Author: Jon TURNEY Date: Wed Jun 19 18:09:07 2013 +0100 hw/xwin: Remove standard includes from internal.h and add them where needed Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 5992550c4cf8818d1c47c1e474c3d8c3383983fa Author: Jon TURNEY Date: Mon Jun 17 19:01:19 2013 +0100 hw/xwin: Add xwinclip test client Add xwinclip test client, which includes stubs for winDebug(), ErrorF() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 5ae674ae6d6c0b02fd86c5e7b23b8c38b19f180a Author: Jon TURNEY Date: Mon Jun 17 20:03:04 2013 +0100 hw/xwin: Changes in error logging to make libwinclipboard more useful as a library Consistently use ErrorF() rather than winErrorFVerb() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit e1cf2b47bea9ff3e64c0ef1e4d0744d9df4bc1b7 Author: Jon TURNEY Date: Mon Jun 17 19:58:20 2013 +0100 hw/xwin: Look up atoms in winClipboardProc() Look up all atoms of interest in clipboard code in winClipboardProc() and pass them down. This avoids the need to check serverGeneration to notice when we need to invalidate cached atom values. Also consistently use cached atom values everywhere, rather than sometimes just doing XInternAtom() again. Remove WIN_LOCAL_PROPERTY as unused now, as we only refer to CYGX_CUT_BUFFER once and do that directly. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit be61a1fc7e25a380f8d506e13b22017492a71913 Author: Jon TURNEY Date: Mon Jun 17 19:07:05 2013 +0100 hw/xwin: Add fUseUnicode as parameter to winClipboardProc() Add fUseUnicode as parameter to winClipboardProc() Access g_fUseUnicode global when calling it Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 126c1cfaa5b5978026d44a1f8b044d367056965b Author: Jon TURNEY Date: Mon Jun 17 18:27:56 2013 +0100 hw/xwin: Separate libwinclipboard interface and internal header files Rename the libwinclipboard internal header from winclipboard.h to internal.h Put libwinclipboard's public interface into winclipboard.h This lets winclipboardinit.c partake of that public interface, and all X server headers without clashes winInitClipboard() prototype belongs in a server header v2: Remove duplicate declaration of winClipboardWindowDestroy() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 30c535219ef2c251d90a1a1d3d07c8a7ec936da9 Author: Jon TURNEY Date: Tue Jun 18 00:32:53 2013 +0100 hw/xwin: Return a shutdown flag from winClipboardProc() if we should stop trying Return a shutdown flag from winClipboardProc(), and use it in winClipboardThreadProc() to determine if we should stop. Currently this is set if the clipboard messaging window received a WM_QUIT. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 88d44597046086953032fec7e035fc036596e255 Author: Jon TURNEY Date: Mon Jun 17 00:38:47 2013 +0100 hw/xwin: Move clipboard integration code down to a subdirectory Move clipboard integration code down to a subdirectory and build as a convenience library Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit e965001a732a6b573c374f6a3503e172df01e8ec Author: Jon TURNEY Date: Mon Jun 17 13:18:16 2013 +0100 hw/xwin: Make g_hwndClipboard static Move winFixClipboardChain() into winclipboardthread.c Add winCLipboardWindowDestroy() function to access it for WM_DESTROY Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 03a59e7f787a160c6cc07c7a37df64a793242ef2 Author: Jon TURNEY Date: Mon Jun 17 02:01:39 2013 +0100 hw/xwin: Add remaining clipboard globals to winglobals.h Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 8f9fba5bc1499804a6c4a3287d99fe7dab8d6b8f Author: Jon TURNEY Date: Mon Jun 17 02:01:27 2013 +0100 hw/xwin: Hoist use of winSetAuthorization() and winGetDisplayName() up one level Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit a3c1e405cb78df9ef18a1158dcaed3c27b3cbffe Author: Jon TURNEY Date: Sun Jun 16 22:35:22 2013 +0100 hw/xwin: Eliminate g_pClipboardDisplay and g_iClipboardWindow globals Eliminate the g_pClipboardDisplay and g_iClipboardWindow globals used to make those values available to the clipboard wndproc, by passing them in via the WM_CREATE message instead. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 229a0a83a44c94ce76eb937d58dc1773a38baa3e Author: Jon TURNEY Date: Sun Jun 16 22:13:26 2013 +0100 hw/xwin: Move winClipboardCreateMessagingWindow() to winclipboardthread.c Move winClipboardCreateMessagingWindow() from winclipboardinit.c to winclipboardthread.c, the only place that uses it, and make it static. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit a70c2384a2689cc0346868bb27366c008c01758d Author: Jon TURNEY Date: Mon Feb 13 19:58:37 2012 +0000 hw/xwin: Remove SetSelectionOwner wrapper, use XFixesSetSelectionOwnerNotify event instead Use the XFixesSetSelectionNotify event instead of a SetSelectionOwner wrapper, the completely equivalent client-side mechanism. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit ab55746c1b179172a82b7a89ec6429b268a1f166 Author: Jon TURNEY Date: Mon Jun 17 01:55:46 2013 +0100 hw/xwin: Remove g_fClipboardLaunched, it's value is identical to g_fClipboardStarted Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 42d13810822f6b48771d77b09c0ef7cc2356ede5 Author: Jon TURNEY Date: Mon Jun 17 01:30:09 2013 +0100 hw/xwin: Hoist setting of g_fClipboardStarted flag up one level Hoist the setting of g_fClipboardStarted flag up one level. Also move up the clearing of the g_fClipboardLaunched at the end of clipboard function. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 290dbff0753ddf60f04da92d5a408c567a2ee3e0 Author: Jon TURNEY Date: Mon Jun 17 01:55:03 2013 +0100 hw/xwin: winProcEstablishConnection doesn't need to check if clipboard started winProcEstablishConnection doesn't need to check if clipboard has already been started. It should be clear that we start the thread only once when the wrapper tells us to, as the wrapper unhooks itself thereafter. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 91e55691ef07735bb866c0f4d3c1a6e2ca167992 Author: Jon TURNEY Date: Sun Jun 16 23:57:17 2013 +0100 hw/xwin: Hoist clipboard thread restart up one level Hoist clipboard thread restart up one level. Note that currently g_fClipboardLaunched is set the first time in the winProcEstablishConnection wrapper, and subsequent times when the clipboard thread restarts itself. Try to clarify this and just set g_fClipboardLaunched before starting the thread. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 0bb6eae4e34634abb2679004ace94504a4d65964 Author: Jon TURNEY Date: Mon Jun 17 00:07:01 2013 +0100 hw/xwin: Push winClipboardShutdown() into winclipboardinit.c Push winClipboardShutdown() into winclipboardinit.c This lets us make g_ptClipboardProc static Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 6343b531d786dd4a9bb52050c9ef267a04374b57 Author: Jon TURNEY Date: Wed Jan 1 17:54:48 2014 +0000 hw/xwin: Remove left-over pthread_exit() in clipboard code Commit c1bf3baa44fbd8af33a2b3ce045324485b85a7a7 removed all but one of the pthread_exit() calls which used to call winClipboardThreadExit() Fix the final remaining one to exit via done label on IOError instead. Also fix a comment and report pre-flush failure to log, but do not exit Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit d3427717f2c6a473dc3d20631dff653e4e37228e Author: Adam Jackson Date: Wed Jul 2 12:09:52 2014 -0400 xwayland: Snap damage reports to the bounding box Instead of sending every little rect. Lets x11perf run to completion, makes 'while true; do gtkperf -a; done' take longer to crash. This is effectively a resend of the same logic against the old xfree86+xwayland branch: http://lists.x.org/archives/xorg-devel/2013-October/038453.html Reviewed-by: Daniel Stone Reviewed-by: Kristian Høgsberg Signed-off-by: Adam Jackson commit 5ecc0315a2b9bea44ace886f5706a7a3f5cbc4f6 Author: Jasper St. Pierre Date: Mon Jun 30 13:53:50 2014 -0400 xwayland: Implement throttling for surfaces based on the frame event This implements simple throttling that keeps us to one attach per frame. There isn't really an active performance benefit, since the buffers will be redrawn only once per frame anyway, but it does cut down on the chatty network traffic. Since the Wayland sockets might fill up as well, the cut down on the volume of data we send out also provides us with a big stability benefit. Namely, mutter is a lot more stable running gtkperf, a fairly intensive X11 application, after this change. Reviewed-by: Daniel Stone Signed-off-by: Jasper St. Pierre commit 6c442fc4f7d84508665dfdee8a75ec91f50395dc Author: Jasper St. Pierre Date: Mon Jun 30 15:28:16 2014 -0400 xwayland-input: Fix a crasher for a race with the Wayland compositor If something quickly maps and unmaps a window, then we'll immediately create and destroy the Wayland surface that cooresponds to that window. If our mouse pointer is over the window when the surface is created, we'll receive a enter on the window. Since resource creation and destruction is not synchronous, that means that the compositor will queue up an event for a resource that's eventually destroyed. On the client-side, when we receive this message, we note that the resource isn't allocated, and get a NULL surface in our enter handler. We immediately try to dereference this, and then crash. This was caused by running gtkperf while moving the window a lot. Reviewed-by: Daniel Stone Signed-off-by: Jasper St. Pierre commit 1d32004ed5a3a20b2d5879867e213122dced69d0 Author: Michel Dänzer Date: Wed Sep 10 16:20:48 2014 +0900 glamor: Make glyph mask cache per-screen It references a pixmap, which is a per-screen resource. Fixes broken text rendering in xfwm4-tweak-settings in Zaphod mode. Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher Signed-off-by: Keith Packard commit 710d314ad16cf1eaca3b97b1736ff0ca43e598c4 Author: Michel Dänzer Date: Wed Sep 10 16:20:47 2014 +0900 glamor: Track glyph caching information per screen This is necessary because the glyph caches are per screen. Fixes broken menu text in gnome-terminal in Zaphod mode. Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher Signed-off-by: Keith Packard commit a4e8e6dff9a0c26944a325e4017faa68d93ae5b8 Author: Michel Dänzer Date: Wed Sep 10 16:20:46 2014 +0900 glamor: Move 'glyph caches realized' check to glamor_realize_glyph_caches And rename the boolean to reflect what it's about. Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher Signed-off-by: Keith Packard commit 0acff6e4374340dc391014f396f190daf73d579c Author: Michel Dänzer Date: Wed Sep 10 16:20:45 2014 +0900 glamor: Call glamor_glyphs_init from glamor_create_screen_resources The comment above glamor_glyphs_init was already saying so. Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher Signed-off-by: Keith Packard commit 54a1d4db825be90fb7be138e3267a15922d62f03 Merge: 8f8dcfe f92df22 Author: Keith Packard Date: Thu Sep 11 18:27:41 2014 -0700 Merge remote-tracking branch 'jturney/master' commit 8f8dcfee2085ba82107a8bf3872a0bb241493409 Author: Alan Coopersmith Date: Thu Sep 4 23:18:03 2014 -0700 Make list tests actually test lists Coverity scan detected that asserts were setting values, not checking them: CID 53252: Side effect in assertion (ASSERT_SIDE_EFFECT) assignment_where_comparison_intended: Assignment item->b = i * 2 has a side effect. This code will work differently in a non-debug build. Did you intend to use a comparison ("==") instead? CID 53259: Side effect in assertion (ASSERT_SIDE_EFFECT) assignment_where_comparison_intended: Assignment item->a = i has a side effect. This code will work differently in a non-debug build. Did you intend to use a comparison ("==") instead? CID 53260: Side effect in assertion (ASSERT_SIDE_EFFECT) assignment_where_comparison_intended: Assignment item->a = i has a side effect. This code will work differently in a non-debug build. Did you intend to use a comparison ("==") instead? CID 53261: Side effect in assertion (ASSERT_SIDE_EFFECT) assignment_where_comparison_intended: Assignment item->b = i * 2 has a side effect. This code will work differently in a non-debug build. Did you intend to use a comparison ("==") instead? Fixing those to be == caused test_nt_list_insert to start failing as part assumed append order, part assumed insert order, so it had to be fixed to use consistent ordering. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit d0da0e9c3bb8fe0cd4879ecb24d21715bfaa209b Author: Eric Anholt Date: Thu Sep 4 10:59:40 2014 -0700 glx: Disable indirect GLX contexts by default. Almost every situation of someone running indirect GLX is a mistake that results in X Server crashes. Indirect GLX is the cause of regular security vulnerabilities, and rarely provides any capability to the user. Just disable it unless someone wants to enable it for their special use case (using +iglx on the command line). Signed-off-by: Eric Anholt Acked-by: Keith Packard Signed-off-by: Keith Packard commit bf338efc678258d2d366dff2ed873752f98f0bfc Author: Keith Packard Date: Thu Sep 4 08:36:07 2014 -0700 glx/present: Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap Present didn't provide the 'kind' argument to the present_complete_notify hook that GLX uses to construct GLX_BufferSwapComplete events, so GLX was reporting events for PresentCompleteKindMSC notifications, which resulted in duplicate GLX_BufferSwapComplete events and crashes in clutter. See the gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=733282 Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 7a0c79c8c478bf22ee71c1ea35886a6f555ef2bb Author: Thomas Petazzoni Date: Tue Sep 2 22:03:14 2014 +0200 os/log: adjust gcc version conditions for #pragma In commit e67f2d7e0f9189beb2907fa06cff5ecc7f35f922 ("gcc 4.2.1 doesn't support #pragma GCC diagnostic ignored"), some compile time conditionals were added around the #pragma usage. Those conditionals ensure that the #pragma are not used on gcc <= 4.2. However, the usage of #pragma diagnostic inside functions was only added in gcc 4.6, and a build failure is therefore experienced with gcc 4.5: log.c: In function 'LogInit': log.c:199:9: error: #pragma GCC diagnostic not allowed inside functions log.c:201:9: warning: format not a string literal, argument types not checked log.c:212:9: error: #pragma GCC diagnostic not allowed inside functions log.c:214:17: warning: format not a string literal, argument types not checked $ ./host/usr/bin/powerpc-linux-gnu-gcc -v [...] gcc version 4.5.2 (Sourcery G++ Lite 2011.03-38) This patch therefore adjusts the compile time conditionals to make sure the #pragma is not used on gcc <= 4.5, and only used on gcc >= 4.6. Signed-off-by: Thomas Petazzoni Acked-by: Keith Packard Signed-off-by: Keith Packard commit da4bad620a6f1a58978f5279fda74da3c1c1d443 Author: Dave Airlie Date: Tue Jul 30 13:50:48 2013 +1000 pixmap: fix reverse optimus support with multiple heads For doing reverese optimus to multiple outputs on a secondary GPU the GPU can store the blits into a large screen pixmap, unfortunately this means we need a destination offset into the dirty code, so add a new API that just adds this interface. Signed-off-by: Dave Airlie Reviewed-by: Chris Wilson Signed-off-by: Keith Packard commit e1cc0d3df1fdb6c4393ac455ca038e1e0680bb22 Author: Maks Naumov Date: Thu Aug 21 12:58:16 2014 -0700 glx: Fix 'y ' value in swrastGetDrawableInfo() Signed-off-by: Maks Naumov Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit f92df22a037cb8b672dab2e7aef18a22275f5660 Author: Jon TURNEY Date: Fri Jul 18 15:08:17 2014 +0100 hw/xwin/glx: Remove an incorrect assertion in glxWinDrawableSwapBuffers The piglit test glx_make_current triggers this assertion, by making the context current on a different drawable before issuing a glXSwapBuffers() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b21321e515fc778f87077b7ce47922c43a4ba103 Author: Jon TURNEY Date: Mon Jul 14 19:41:25 2014 +0100 hw/xwin/glx: Downgrade "forcing window to exist" message to debug It happens whenever a GLX client uses GL on a window before it's been mapped, so don't log it like an error. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 31d089633683ea2a2716651c3c48e1456cc595bf Author: Jon TURNEY Date: Wed Jul 16 13:44:33 2014 +0100 hw/xwin/glx: Fix a couple of typo bugs in indirect.c fbConfigToPixelFormatIndex()'s drawableTypeOverride parameter is a drawable type bitmask, not a drawable type enum value WGL_SWAP_COPY_ARB is a value of the WGL_SWAP_METHOD_ARB attribute for wglChoosePixelFormatARB(), not an attribute itself also remove duplicate error reporting for wglChoosePixelFormat() and fix a comment Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b1ea714cdce8444c6ad7778dae04e35c6bcc1750 Author: Jon TURNEY Date: Sun Apr 27 22:10:31 2014 +0100 hw/xwin/glx: Update .gitignore Update to align with rewrite of wrapper generation script in commit 583a1146233f16d861706926706e5feec3baffba Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit d1d3bd359670a8f55c9350fd905af32ba6e67d33 Author: Jon TURNEY Date: Sun Mar 30 20:51:36 2014 +0100 hw/xwin/glx: Don't override the server supported GL extensions string. Don't override the server supported GL extensions string. The string reported to the client is the intersection of client, server and GL implementation extensions. Overriding the server supported GL extensions string like this causes extensions which are supported by the client and implementation, but not by the server, to be erroneously reported, so don't change it. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit c99cd058a89bbfc9ceab3c91b93451f70351ddce Author: Jon TURNEY Date: Tue Mar 4 22:37:13 2014 +0000 hw/xwin: Add an idempotency guard to glwindows.h Add an idempotency guard to glwindows.h Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 1c34e774eff6c5a22501833444a10440cf3f915a Author: Jon TURNEY Date: Mon Nov 11 15:09:18 2013 +0000 hw/xwin: Fix a potential crash in winRedrawScreenShadowDDNL() Seen during shutdown when using '-fullscreen' and '-depth 8' Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 16d9da08861fe504de4be8c31708592e30687156 Author: Jon TURNEY Date: Thu Feb 18 23:36:27 2010 -0600 hw/xwin: Improve choice of display name used by internal clients Choose the display name used to connect to internal clients and exported into environment of processes started from the traymenu so that it uses a transport we know is working This should mean the server can start correctly with -multiwindow and/or -clipboard and any two of -nolisten inet6, -nolisten inet and -nolisten unix (the server will correctly refuse to start if all 3 are used, as it must be listening on at least one socket) v2: Place prototype for winGetDisplayName() in windisplay.h, and include it where needed. v3: Include xwin-config.h, so that _XSERVER64 is defined, just in case anything relies on that. v4: Replace grovelling around in the server's list of listeners with new Xtrans TransIsListening() interface, added in Xtrans 1.3.3 See also [1] [1] https://sourceware.org/bugzilla/show_bug.cgi?id=10725 Signed-off-by: Jon TURNEY Reviewed-by: Yaakov Selkowitz Reviewed-by: Colin Harrison commit 95357539c1178a97d8a167461806a280d2803ec4 Author: Jon TURNEY Date: Wed Jan 1 20:34:36 2014 +0000 hw/xwin: Makefile.am cleanup - Rename XWIN_GLX_LINK_FLAGS -> XWIN_GLX_SYS_LIBS for consistency - Rename MULTIWINDOW_LIBS -> MULTIWINDOW_SYS_LIBS for consistency - Don't link with XWin with $(MAIN_LIB), it provides it's own main() - Put one library per line for more intelligible diffs when one is added Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit aa40d0c07173209a2c13b332f1168e0df499a19e Author: Jon TURNEY Date: Fri Jun 13 16:16:51 2014 +0100 hw/xwin/glx: When generating shims, limit the considered features to GL version <=1.2 This fixes a problem when using Khronos registry data since the change of 2013-08-16 removed glBlend(Color|Equation) from GL1.2 and added them to GL_ARB_imaging. If shim generation considers all features, no shims are generated for glBlend(Color|Equation) as they are first emitted for GL 1.4 (which we ignore as shims are only generated for GL version <=1.2), then emission for GL_ARB_imaging is skipped as they have already been emitted. Also improve feature name matching so it is exact, not on an initial substring, so 'GL_ARB_texture_compression_bptc' and 'GL_ARB_texture_compression_rgtc' aren't matched by 'GL_ARB_texture_compression'. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 35dc7c75150733dbcef8a18b6796f49a7c48ebee Merge: 3a51418 5f3485b Author: Eric Anholt Date: Mon Aug 25 15:52:58 2014 -0700 Merge branch 'modesetting-import' into master This reintroduces a "hardware" driver to the xfree86 directory. Unlike the drivers that xorg used to include in the source tree, that needed independent release schedules to get hardware support out the door, the modesetting driver shouldn't change much as new hardware gets released. A lot of what this driver needs to do is just keep up with server ABI changes. This import was done by taking xf86-video-modesetting-0.9.0, and running this script with 'git-filter-branch -f --tree-filter ~/bin/modesetting-filter': mkdir -p hw/xfree86/drivers/modesetting rm -f README autogen.sh configure.ac Makefile.am .gitignore rm -f man/Makefile.am mv man/modesetting.man hw/xfree86/drivers/modesetting/ mv COPYING hw/xfree86/drivers/modesetting/ mv src/* hw/xfree86/drivers/modesetting/ commit 3a51418b2db353519a1779cf3cebbcc9afba2520 Author: Laércio de Sousa Date: Mon Aug 18 08:45:43 2014 -0300 ephyr: set screen size & origin from host X server output's CRTC geometry If a given output is passed via new -output option, Xephyr will query host X server for its info. If the following conditions are met: a. RandR extension is enabled in host X server; b. supported RandR version in host X server is 1.2 or newer; c. the given output name is valid; d. the given output is connected; then Xephyr will get output's CRTC geometry and use it to set its own screen size and origin. It's just like starting Xephyr in fullscreen mode, but restricted to the given output's CRTC geometry (fake "Zaphod mode"). This is the main feature needed for Xephyr-based single-card multiseat setups where we don't have separate screens to start Xephyr in fullscreen mode safely. Signed-off-by: Laércio de Sousa Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 84b02469ef97e6f85d074d220a517d752180045f Author: Laércio de Sousa Date: Mon Aug 18 08:45:42 2014 -0300 ephyr: enable screen window placement following kdrive -screen option extended syntax With this patch, one can launch Xephyr with option "-screen WxH+X+Y" to place its window origin at (X,Y). This patch relies on a previous one that extends kdrive -screen option syntax to parse +X+Y substring as expected. If +X+Y is not passed in -screen argument string, let the WM place the window for us, as before. Signed-off-by: Laércio de Sousa Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 376f4de8ae927748417046390c24afbda24b0583 Author: Laércio de Sousa Date: Mon Aug 18 08:45:41 2014 -0300 kdrive: add support to +X+Y syntax in -screen option parsing This patch enhances current -screen option parsing for kdrive-based applications. It can parse strings like x++, storing X and Y offsets in KdScreenInfo instances. For negative values, this patch supports +-X+-Y (not -X-Y) syntax. It will allow e.g. proper Xephyr window placement for multiseat purposes. Signed-off-by: Laércio de Sousa Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit fe5018e0564118a7a8198fa286186fdb9ed818c7 Author: Takashi Iwai Date: Tue Aug 19 15:57:22 2014 -0500 fb: Fix invalid bpp for 24bit depth window We have a hack in fb layer for a 24bpp screen to use 32bpp images, and fbCreateWindow() replaces its drawable.bitsPerPixel field appropriately. But, the problem is that it always replaces when 32bpp is passed. If the depth is 32, this results in bpp < depth, which is actually invalid. Meanwhile, fbCreatePixmap() has a more check and it creates with 24bpp only when the passed depth <= 24 for avoiding such a problem. This oneliner patch just adds the similar check in fbCreateWindow(). This (hopefully) fixes the long-standing broken graphics mess of cirrus KMS with 24bpp. Signed-off-by: Takashi Iwai Reviewed-by: Keith Packard commit 5d133276de9c50146e80ffc69edd429c2afe98e6 Author: Thierry Reding Date: Thu Feb 13 13:36:12 2014 +0100 xfree86: Allow non-PCI devices as primary On platforms that don't support PCI or have no GPU attached to the PCI bus, there can still be a primary device on a non-PCI bus. Signed-off-by: Thierry Reding Reviewed-by: Rob Clark Tested-by: Rob Clark Signed-off-by: Keith Packard commit 2f0183222b4279266e6ef60b923738ff55f0afba Author: Thierry Reding Date: Thu Feb 13 13:31:31 2014 +0100 xfree86: Fallback to first platform device as primary When neither of the various bus implementations was able to find a primary bus and device, fallback to using the platform bus as primary bus and the first platform device as primary device. Signed-off-by: Thierry Reding Reviewed-by: Rob Clark Tested-by: Rob Clark Signed-off-by: Keith Packard commit 33aeec8a11bc75a06d32956bbdd9efb216790a02 Author: Keith Packard Date: Thu Jan 30 16:24:35 2014 -0800 dri3: Don't enable the DRI3 extension unless some screen supports it There's no reason to advertise this extension unless one of the hardware drivers actually supports it. Not listing it means it's slightly easier for users to tell what's going on. On the other hand, not listing it means we may have applications that only check for the extension and not for appropriate per-screen support. I don't think that's a real risk as DRI3 is only useful for systems with deep knowledge of the hardware. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 0d7306ffe2e069f0091c4f174f138127100abb43 Author: Michel Dänzer Date: Wed Aug 13 17:10:21 2014 +0900 glamor: Don't call glamor_copy_fbo_cpu() for GLAMOR_DRM_ONLY pixmaps It results in a crash. Signed-off-by: Michel Dänzer Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit c2548d71f7a754251d89696ae49aab2fe07446df Author: Joerg Sonnenberger Date: Mon Aug 11 10:36:01 2014 +0200 Fix format string. Reviewed-by: Keith Packard Signed-off-by: Thomas Klausner Signed-off-by: Keith Packard commit d4111239e698f0126123830429d74da7d24910ed Author: Keith Packard Date: Wed Aug 13 11:30:11 2014 -0700 glamor: Free Xv put image data immediately after use The Xv StopVideo callback is not invoked on textured video ports, so the temporary pixmaps allocated for the video planes are never freed. Freeing the storage immediately after use is a simple solution to this problem which doesn't appear to have any visible performance impact. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit c47ee880e742e15fdbd5f5ac3eba64db6228c09f Author: Eric Anholt Date: Mon Aug 11 15:23:02 2014 -0700 glamor: Don't try to set up core fonts textures when we won't use them. This happens to avoid GL errors on hardware without EXT_texture_integer (which implies < GLSL 130, and thus glamor_text.c programs not compiling anyway). Signed-off-by: Eric Anholt Reviewed-by: Alex Deucher Signed-off-by: Keith Packard commit d09c9ddb866dea31e2adf82be329d5d3489718f5 Merge: 606b701 ab32ee3 Author: Keith Packard Date: Tue Aug 12 16:34:24 2014 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 606b701c563c10f01dec147e061fa00cda784a9d Author: Michel Dänzer Date: Wed Aug 6 10:30:25 2014 +0900 glamor: Add glamor_copy_fbo_cpu() for CopyArea to non-GPU destination This provides a speedup e.g. when the destination is an SHM pixmap. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76285 Signed-off-by: Michel Dänzer Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 1e30fc1b99bda040038e4fd56d1b27c686b44c75 Author: Peter Hutterer Date: Mon Aug 4 10:47:03 2014 +1000 xkb: ignore floating slave devices when updating from master (#81885) Introduced in 45fb3a934dc0db51584aba37c2f9d73deff9191d. When a device is enabled, the master's locked state is pushed to the slave. If the device is floating, no master exists and we triggered a NULL-pointer dereference in XkbPushLockedStateToSlaves. X.Org Bug 81885 Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 4599a4492ca6a1c87cd9c537c54fbda11f13c15c Author: Daphne Pfister Date: Wed Jul 23 21:51:57 2014 -0400 os: Regenerate os/oscolor.c from app/rgb #52289 Regenerate os/oscolor.c from rgb.txt. This adds the following colors: aqua, lime, fuchsia, crimson, indigo, olive, rebecca purple, silver and teal. It also adds versions of gray, grey, green, maroon and purple prefixed with web and x11 for the colors that are different between X11 and HTML/CSS web colors. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52289 Related: https://bugs.freedesktop.org/show_bug.cgi?id=80371 Signed-off-by: nobody Tested-by: Keith Packard Signed-off-by: Keith Packard commit ee9f766abf6fbe0cc36234bfe727aba924e9b5fd Author: Keith Packard Date: Mon Jul 28 12:09:51 2014 -0700 xfree86: [v2] Remove duplicate InputInfoPtr typedef from xf86Xinput.h GCC 4.2 doesn't accept 2 typedef declarations of the same type, so remove the extra one from xf86Xinput.h and have xf86Xinput.h #include xf86.h to make sure everyone using just that file gets the typedef. Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer Reviewed-by: Matthieu Herrb commit ab32ee35890be51137b56525826ffe219b63eb88 Author: Jeremy Huddleston Sequoia Date: Mon Aug 11 13:15:24 2014 -0700 XQuartz: Better support turning off "Displays have separate Spaces" on OS X Mavericks http://xquartz.macosforge.org/trac/ticket/1876 Follow-up to: 1c10b37380d228b35db8a8616a6312ac54f5e59b Signed-off-by: Jeremy Huddleston Sequoia commit dfbc6a1a78ff3192baae6f7f2af98b6e51422f75 Author: Jeremy Huddleston Sequoia Date: Wed Jul 23 11:53:33 2014 -0700 ListenOnOpenFD: Remove Resets since this is intended to be for hotplugging connections pharris says that the resets should not be done in the hotplugging case. This may fix a crash reported against XQuartz: http://xquartz.macosforge.org/trac/ticket/869 Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Peter Harris commit 3714f5401690b288045090c4bcd9cb01c6e4860e Author: Eric Anholt Date: Sun Apr 6 07:57:44 2014 +0100 kdrive: Remove a dead struct. It's never been used in the history of the tree. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit ef258fa4fd0c215b1327fb3d94b37e75af9fae6b Author: Eric Anholt Date: Wed Jul 30 21:11:51 2014 -0700 xv: Drop the ClientPtr from the interface to the DDX. Nobody was using it. v2: Merge the hunk that was accidentally in the previous commit into this one. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 850b268e2b9e49445a22e041a356d8ff26ae2147 Author: Eric Anholt Date: Sat Apr 5 10:55:45 2014 +0100 xv: Remove the no-op AllocatePort/FreePort interfaces. v2: Fix accidentally squashed-in change for dropping client from the arguments, which should have been in the next commit. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard (v2) commit 41d4a626c6ceb15d5b008dca00c6f5032ddd9556 Author: Eric Anholt Date: Sat Apr 5 10:35:52 2014 +0100 kdrive: Don't bother explicitly clearing new window privates to NULL. Privates are initially cleared to zero by dixInitPrivates(). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit e311318b35ef4f82996c6e277137569005893b44 Author: Eric Anholt Date: Sat Apr 5 09:11:03 2014 +0100 kdrive: Remove dead KXVPaintRegion(). It's been unused since mach64 was deleted, and now there's a helper in core XV. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 7eac142fb6e8abb011ce59feda3c2d7b04f2b225 Author: Eric Anholt Date: Sat Apr 5 09:09:17 2014 +0100 xv: Fix malloc-failure cases in the fill color key helper. Signed-off-by: Eric Anholt Reviewed-by: Alex Deucher commit ea3f3b0786d58b2ba6a9bbf0a32e734670f54b73 Author: Eric Anholt Date: Sat Apr 5 09:07:18 2014 +0100 xv: Move xf86 XV color key helper to core. Color key overlay implementations want to reuse this code, and XF86's had bugs (to be fixed in the next commit). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit b01cfe5f23766b9c13ed6bd889263d5d7a8a351d Author: Eric Anholt Date: Fri Apr 4 22:58:37 2014 +0100 xv: Move CloseScreen setup from a DIX hook to normal wrapping. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 6a71ee79aabe6b611cae443a49786824a0322313 Author: Eric Anholt Date: Fri Apr 4 18:02:14 2014 +0100 xv: Drop unused XvdiVideoStopped(). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 4a095902a37cb98d7954d0873dcf1376cbab54b8 Author: Eric Anholt Date: Fri Apr 4 18:01:07 2014 +0100 xv: Drop unused XvdiPreemptVideo(). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit e7dde86f2343832c52ef74f5c4fe44a72054c79b Author: Eric Anholt Date: Fri Apr 4 17:54:58 2014 +0100 xv: Move the DDX XV screen private allocation into the DDXes. XV was going against convention by having the core infrastructure allocate the private on behalf of the DDX. I was interested in this because I was trying to make multiple pieces of DDX be able to allocate adaptors, and that wasn't going to work if DDX-specific code was hung off of a single global screen private. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit a146c6d4212ed199002e40419b4aa22da8f49e3a Author: Eric Anholt Date: Fri Apr 4 13:12:34 2014 +0100 xv: Drop the ddQueryAdaptors() interface. The core was passing pointers to pxvs's nAdaptors and pAdaptors, and the two hardware implementations were copying pxvs's nAdaptors and pAdaptors into those pointers. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit cb42805c6675bbb9f0b37609fe2ffecc07f46290 Author: Eric Anholt Date: Fri Dec 27 21:54:26 2013 -0800 xv: Move common code for adaptor cleanup to xvmain.c Since any DDX XV screen cleanup would need this same code for freeing the tree of pointers for xv adaptors, move it to the dix. v2: Unconditionalize the pPorts freeing, to match the block above it. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard (v1) commit 8cb0da29404d3fed13c1cbedb5c6164e4733ea82 Author: Eric Anholt Date: Fri Dec 27 20:59:12 2013 -0800 xv: Remove dead VIDEO_NO_CLIPPING from the xorg and kdrive DDXes. As far as I can see, nothing has ever used this flag except possibly the i.mx6 xorg ddx debug during bringup. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit a6ec7d5278405d69e60cca2964006fb7ce32c556 Author: Eric Anholt Date: Fri Dec 27 20:53:00 2013 -0800 xv: Remove dead VIDEO_INVERT_CLIPLIST from the xorg and kdrive DDXes. As far as I can see (looking at trees on my disk, plus googling for the term), nothing has ever used this flag Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit e6c8c7e46c79b2837a7d0b12079a47734eff1eb7 Author: Egbert Eich Date: Mon Aug 4 19:16:30 2014 +0200 BellProc: Send bell event on core protocol bell when requested XKB allows to override the BellProc() ringing the 'keyboard bell': instead an event is sent to an X client which can perform an appropriate action. In most cases this effectively prevents the core protocol bell from ringing: if no BellProc() is set for the device, no attempt is made to ring a bell. This patch ensures that an XKB bell event is sent also when the core protocol bell is rung end thus an appropriate action can be taken by a client. Signed-off-by: Egbert Eich Acked-by: Peter Hutterer Signed-off-by: Keith Packard commit e8373e4b6a793b48487b1a82d798d97b5c9a10a3 Author: Keith Packard Date: Thu Jul 31 19:57:53 2014 -0700 Add X_BYTE_ORDER to xorg-server.h Drivers don't get to use dix-config.h, they use xorg-server.h instead. Add X_BYTE_ORDER to that file so drivers can see the value. Signed-off-by: Keith Packard Reviewed-by: Michel Dänzer commit e31564e1a21e73f4d20d6471da4fc7a9b63e4062 Author: Michel Dänzer Date: Thu Jul 31 08:35:13 2014 -0700 Check for dix-config.h or xorg-server.h before using X_BYTE_ORDER Now that servermd.h depends on X_BYTE_ORDER being defined in dix-config.h or xorg-server.h, check to make sure one of those has been included before using the value. Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 61afe950e6a1a640ad9c5368549914ea32b90d48 Author: Keith Packard Date: Mon Jul 21 19:27:20 2014 -0700 xfree86/modes: rotation damage is automatically destroyed on close Don't try to destroy rotation_damage in the xf86RotateCloseScreen; it will have been destroyed when the screen pixmap was destroyed. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 40dc81154ad38514793f2181447d597b57d39e80 Author: Keith Packard Date: Sun Jul 20 18:57:42 2014 -0700 present: Avoid crash at server shutdown When a present flip operation is still in process during server reset, the call to present_set_abort_flip may not happen until the screen is being closed, at which point there is no root window to set pixmaps for. Check to make sure there's a window before resetting window pixmaps. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 627bce80894647c681b146a709aad4c390b4374e Author: Keith Packard Date: Sun Jul 20 18:53:52 2014 -0700 present: Make window MSC offset 0 initially The MSC offset used by a window is adjusted as the window moves between screens, and between shown/unshown. The value shouldn't matter, but it's helpful for debugging to have window MSC values be the same as the CRTC MSC at first. This patch introduces a unique CRTC value so that Present can detect the first time a window is a PresentPixmap destination and set the MSC offset to zero, rather than using the fake MSC value as the previous window MSC. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit bd4198b01f2baf2284e61ea7ebf4600f554800e9 Author: Keith Packard Date: Fri Jul 18 11:19:01 2014 -0700 xfree86: Avoid compiler warning for unused vars without systemd When systemd isn't being used, systemd_logind_release_fd is defined as an empty macro, leaving the arguments unused. Fix the compiler warnings by simply removing the local variables and referencing the structure within the macro call. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit b063a185ab9d2c54669fb6e036fdbae3707c9e4b Author: David Ung Date: Tue Jul 29 15:01:39 2014 -0700 randr: Fix logic in RRPointerToNearestCrtc RRPointerToNearestCrtc is suppose to snap to the nearest Crtc, but best_x and best_y is always positive, hence when calling SetCursorPosition it will make the cursor even further away. Correct delta x/y to allow negative values and also use "width/height -1" in the calculation. Also choose the closest Crtc by setting the "best" value. Signed-off-by: David Ung Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 90803042bcbb9dc6261b5d112acf5613829d9f70 Author: Keith Packard Date: Wed Jul 30 10:13:53 2014 -0700 Fix files including xorg-server.h by mistake A few files in the server are including xorg-server.h, which is only for use by Xorg server drivers. This fixes those errors and then adds a check to make sure it doesn't happen again. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit a08e7a098aa37351294a25fe62b7ff6e95622e64 Author: Adam Jackson Date: Tue Jun 24 14:21:57 2014 -0400 dri1: Remove unused DRI{,Post}ValidateTree i810, mga, savage, and tdfx do reference these slots, but only to set them to NULL, so while this does have API impact it's not actually used. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 5486c834fa3eebd79a4811143e513d6a92b7e504 Author: Adam Jackson Date: Tue Jun 24 14:16:55 2014 -0400 xquartz: Remove unused DRI{,Post}ValidateTree Cargo-culted from DRI1, not actually used for anything. Reviewed-by: Jeremy Huddleston Sequoia Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit a5e7701058c676231d2bc3f9a0c7c0fa9da7ad45 Author: Adam Jackson Date: Wed May 28 14:48:14 2014 -0400 xkb: Remove some fascinating paranoia from event emission XkbInterestPtrs are created by clients that already exist, meaning, clients that have already had ProcVector installed as something other than InitialProcVector. Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson commit ac3af4bd21394291ef6dd9cfcdd8ce6fceefec40 Author: Adam Jackson Date: Tue Jun 17 12:58:41 2014 -0400 xfree86: Remove unused HardEdges Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson commit 4100687ea667970733c3aa69f704be0e3747f9fd Author: Adam Jackson Date: Mon Jun 23 15:42:23 2014 -0400 xfree86: Remove useless #include "fb.h" Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson commit 2d451c5cdc7f81ea0c94c3542fab45027f829736 Author: Adam Jackson Date: Thu May 22 14:04:16 2014 -0400 xfree86: Remove pointless xf86RandRCreateScreenResources Given the #if 0 this was wrapping for no effect. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit a8cca7bd5ad7ea36a9585f4927ed53cfa6db1daf Author: Adam Jackson Date: Fri May 2 11:43:14 2014 -0400 xfree86: Remove protectMem from VidMemInfo Never filled in. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit e4cf1e58f5745dd39a9dd5eb29acd1cb28710094 Author: Adam Jackson Date: Fri May 2 11:11:14 2014 -0400 xfree86: Remove unused xf86{Map,Unmap}LegacyIO I ported these to pciaccess in: commit 858fbbb40d7c69540cd1fb5315cebf811c6e7b3f Author: Adam Jackson Date: Fri Sep 16 13:33:04 2011 -0400 pci: Port xf86MapLegacyIO to pciaccess As of yet there are still no drivers using them, and there's not a lot of value in having the wrappers when they just trivially call pciaccess anyway. Nuke 'em. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 96206cf47752af3fc8ca14dc1e03c59ed482167f Author: Adam Jackson Date: Tue Jul 8 13:19:08 2014 -0400 xfree86: Remove deprecated PCI types Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 46fd5a28ef7191b5ad0244f849c756dd2c5f43b6 Author: Adam Jackson Date: Fri May 2 11:09:53 2014 -0400 xfree86: Remove some unused pre-pciaccess types Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 3bb9f9862b5bea3720ba7922714af729cab38776 Author: Adam Jackson Date: Fri Feb 28 13:31:08 2014 -0500 xfree86: Remove xf86ConfigActivePciEntity The giant OBSOLETE DO NOT USE comment has been there since 2000, probably it's safe to nuke by now. Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson commit 51531a67179e342f6ad798de21accf014748a04f Author: Adam Jackson Date: Tue Jun 10 13:10:28 2014 -0400 vgahw: Nuke unused vgaCmap.c Never been built since m12n, can't be needed. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 2db71b232c4756773562182cadb7ccdf5194a62d Author: Adam Jackson Date: Tue Jun 10 13:00:11 2014 -0400 saver: Don't open-code IsMapInstalled Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit dd0e8491f75afbd72bea17172a042aa45ff7e30b Author: Adam Jackson Date: Fri Jun 20 12:36:10 2014 -0400 render: Remove unused CopyPicture Arguably this would be useful API, but it's never called, and a careful reading of the CPClipMask path reveals that callers would be fairly disappointed. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 578026fcd58d12dd0be4c0976ee5ecf95a9d61f0 Author: Adam Jackson Date: Tue May 20 12:43:59 2014 -0400 os: Remove LocalClientCred The comment lies, shm hasn't used this code since: commit fdef7be5c8d5989e0aa453d0a5b86d0a6952e960 Author: Alan Coopersmith Date: Tue Oct 9 18:44:04 2007 -0700 Sun bug 6589829: include zoneid of shm segment in access [...] Reviewed-by: Alan Coopersmith Signed-off-by: Adam Jackson commit cad9b053d52f62432dfd70e42e0240de77027cae Author: Adam Jackson Date: Tue Jul 8 13:24:25 2014 -0400 os: Remove deprecated malloc/free wrappers Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson commit d5b279977236c4f80a8ba81db1f81a314484facf Author: Adam Jackson Date: Thu May 22 13:58:45 2014 -0400 miext/shadow: Remove shadowInit This code is nonsensical. You end up creating a screen-sized pixmap that's totally detached from everything else, which you then listen for damage on, which means you'll never hear any damage, which means your shadow update hooks will never get called. Any driver using this would be sorely disappointed. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit cf4793d99ecee4dfd6094e02b1ccb89eb744d313 Author: Adam Jackson Date: Fri Feb 28 15:36:31 2014 -0500 miext/shadow: Remove ancient backwards-compatibility hack Here's a trip down memory lane. Back when we merged kdrive we adopted kdrive's version of shadow, which used damage directly instead of hand-rolling it. However a couple of Xorg drivers referred to the accumulated damage region in the shadow private directly, so I added a hack to copy the damage region around. That was 9148d8700b7c5afc2644e5820c57c509378f93ce, back in early 2006. Eight years is unusually patient for me. The neomagic and trident drivers were still relying on this, but they've been modified to ask the damage code for the region instead. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 35eabf2e5272e17e6765027d4baea43b34c66933 Author: Adam Jackson Date: Tue Jul 8 14:11:22 2014 -0400 mi: Remove apparently unused miSegregateChildren This came in between XFree86 4.3 and 4.4, I'm not entirely sure what it was meant to do. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 150acef3af9bb43cb60cbcc558ef3ad4a710e624 Author: Adam Jackson Date: Mon May 19 13:46:12 2014 -0400 kdrive: Remove some dead bits of the man page Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 71ef49062ee33ac49033fbcd67bab88120882668 Author: Adam Jackson Date: Fri Feb 28 14:05:25 2014 -0500 dix: Make some LBX-era code more obvious isItTimeToYield in the conditional effectively didn't do anything here. Take it out, and remove the comment since LBX proxies aren't a thing for us anymore. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit a317e0a974c1597d55fe05a38b4a495c4e4e8d71 Author: Adam Jackson Date: Fri May 2 11:50:17 2014 -0400 bsd: Remove some reference arm code behind #if 0 git history is reference enough, thanks. Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson commit 8a60d1c3f4a62675cad005107f56413f946ecd77 Author: Keith Packard Date: Mon Jul 28 11:10:15 2014 -0700 glamor: Eliminate diagonal tearing in xv This uses a single large triangle and a scissor to draw the video instead of two triangles. Signed-off-by: Keith Packard Reviewed-by: Alex Deucher commit 29eaa61cb210e0c67004bc567af0c15d48aad626 Author: Adam Jackson Date: Tue Jul 22 11:05:32 2014 -0400 mi: Remove semi-arbitrary arch awareness in packed coordinate macros The majority of arches end up on the right-shift path here. I can't think of any arch where that'd be slower than a divide, and semantically it makes more sense to think of this as a shift operation anyway. Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 6ddd164508f81e9582b66061b385bd34ac1ccb7e Author: Adam Jackson Date: Tue Jul 22 10:59:13 2014 -0400 xfree86: Unify the ppc/sparc mmio-swap-or-not conditionals Map SPARC_MMIO_IS_BE and PPC_MMIO_IS_BE to MMIO_IS_BE and use the same macros for both since they're identical. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 8ffd1c066ab1e993d8964aef12a7c585329c677c Author: Adam Jackson Date: Tue Jul 22 10:59:12 2014 -0400 xfree86: Clean up some silly __sparc macro usage The top of this file already defines __sparc__ if __sparc is defined. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 1c1711b57f2c278c0df03bf9e7e9a1776a546968 Author: Adam Jackson Date: Tue Jul 22 10:59:11 2014 -0400 xfree86: Pull generic barrier() definition up to top level And remove the redundant redecl from the nds32 section. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit c73929bbfc14ba80397c53ca98d3b503c807ae78 Author: Adam Jackson Date: Tue Jul 22 10:59:10 2014 -0400 xfree86: Remove MMIO_ONB* and friends Non-barrier-emitting MMIO writes. They appear to be utterly unused, burn it all down. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 9b33e31d4160dc484ee569740f883f4d34e10653 Author: Adam Jackson Date: Tue Jul 22 10:59:09 2014 -0400 xfree86: Clean up powerpc barrier decls I think the externs are there for the non-gcc case? And maybe there was some assembly code to implement that once? Whatever, at this point on ppc the compiler is either gcc or willing to pretend. The macros below the decls take care of the actual eieio so the externs can just go. Also remove a comment that maybe made sense once upon a time. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit b5141a1fab4d45c1af62db8dc712deb9776668a9 Author: Adam Jackson Date: Tue Jul 22 10:59:08 2014 -0400 xfree86: Simplify a bunch of OS and arch conditionals All of this is inside #ifdef __GNUC__, between that and configure.ac we can assume there's a unixy thing under us. Given that there's no real reason to limit the arch paths to particular OSes, so let's not. The final #elif here, combined with the ones before it, effectively said "if not (alpha amd64 sparc* mips* ppc* arm* nds32 m68k sh hppa s390 m32r)", and as the comment above it hints, it's meant to cover i386 (and happens to also cover itanic). Flip the conditional around to be sensible. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 6d3ba80f197b04b6e0814190cf5c678c786c14d6 Author: Adam Jackson Date: Tue Jul 22 10:59:07 2014 -0400 xfree86: Remove pre-2.6 Linux ppc support 2.6.0 was December 2003, you've had plenty of time to get your head in the game. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit e242e82eba17414603c8806fffc9ecd235eebabb Author: Adam Jackson Date: Tue Jul 22 10:59:06 2014 -0400 xfree86: Remove a useless !__SUNPRO_C guard You can't tell from context here, but this is all inside #ifdef __GNUC__, so this conditional can't do squat. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 93745a6c1afc830759219f8632ec565d83c7bc12 Author: Adam Jackson Date: Tue Jul 22 10:59:05 2014 -0400 xfree86: Undef GCCUSESGAS Can't be needed, we've never defined it in modular xserver. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit b1d9bc8d1d828b0dedda46da98628b47915e6a04 Author: Adam Jackson Date: Tue Jul 22 10:59:04 2014 -0400 xfree86: Remove an unlikely bit of #pragma __USLC__ appears to mean the SCO OpenServer compiler, which configure.ac doesn't think is an OS the xfree86 ddx supports. The conditionals surrounding these pragmas effectively mean "if not gcc and not Sun C", and probably arbitrary pragmas aren't supported by arbitrary compilers. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit f7f9ccef1dc251a1b95ca698ac39bd0a47f0c8fa Author: Adam Jackson Date: Tue Jul 22 10:59:03 2014 -0400 xfree86: Undef __HIGHC__ MetaWare High C++ compiler? xfree86 cvs history shows this being added in a commit whose text is, classically, "updates". metaware.com redirects to a 404 on synopsys.com, which to me indicates it's not super important to them, and their order form won't even tell you how much the thing costs. At any rate if this is worth worrying about it's worth letting autoconf worry about for us. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 80446086b9cfcc5e23a400d7fa38ec773fae68fc Author: Adam Jackson Date: Tue Jul 22 10:59:02 2014 -0400 xfree86: Undef FAKEIT I guess this is meant to stub out all I/O port calls? Whatever, it's not been defined by the buildsystem at least as far back as monolith 6.8.2. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 8002b1a8cb18ecc6526e8ebfd769767f8991ebd6 Author: Adam Jackson Date: Tue Jul 22 10:59:01 2014 -0400 xfree86: Remove a few random ppc decls Whatever these are, they're not something grep can find, they must not be used. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 5f5af5d6692b625f6231c8bca3ac801f2ac75717 Author: Adam Jackson Date: Tue Jul 22 10:59:00 2014 -0400 xfree86: Remove remaining unused unaligned accessors Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit d28b788e11182d134bce5a414359841b37b62ac0 Author: Adam Jackson Date: Tue Jul 22 10:58:59 2014 -0400 xfree86: Move generic unaligned helpers into int10 code This is the only place they're actually used (well, aside from some XAA code in the s3 driver, but one s3 and 2 XAA). Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 956a8d5c92a66ddd8d00e63a95b17cfd376fe424 Author: Adam Jackson Date: Tue Jul 22 10:58:58 2014 -0400 xfree86: Remove unused unaligned int64 helpers Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit da2b2671863655776d60102ddc7af61470d14022 Author: Adam Jackson Date: Tue Jul 22 10:58:57 2014 -0400 xfree86: Unspecialize gcc variants of unaligned memory access Yes yes, very clever, memmove works fine on gcc too, let's just do the portable thing since none of this is performance code. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit e03c902e03dea7a6a98ad5fb00580b9404b67c4d Author: Adam Jackson Date: Tue Jul 22 10:58:56 2014 -0400 xfree86: Undefine NO_INLINE Nothing in the server defines this, nor do any drivers. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit f63b8e44ab278dd65be93146790bf150717fc1c8 Author: Adam Jackson Date: Tue Jul 22 10:58:55 2014 -0400 xfree86: Remove MMIO_MOVE32 Only used by mach64's XAA code, which isn't built if XAA isn't available, and it isn't. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 1100935650cc0032709d095d6d5a5f136bec99b9 Author: Adam Jackson Date: Tue Jul 22 10:58:54 2014 -0400 xfree86: Remove nds32_flush_icache I guess this might have been needed for elfloader, except we didn't support nds32 back then, so I assume this was cargo-culted from ppc_flush_icache, which is also dead now. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit eb76228080da6fb28c34c903a9854aebe157d2c7 Author: Adam Jackson Date: Tue Jul 22 10:58:53 2014 -0400 xfree86: Remove #include "compiler.h" from places that don't need it Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 4afedf545b673282f2e214c0e2c759c9be9b9a2a Author: Ross Burton Date: Wed Jul 9 11:33:23 2014 +0100 configure.ac: add option for xshmfence xshmfence is usable outside of DRI3, and is currently autodetected which isn't good for distributions where deterministic builds are desired. Signed-off-by: Ross Burton Reviewed-by: Matt Turner Signed-off-by: Keith Packard commit 2172714c67d8701aa54c202e89f246f1dddac80a Author: Carlos Garnacho Date: Tue Jul 22 17:55:25 2014 +0200 xwayland: Only disable/enable devices on capabilities change Anytime a capability is first reported, the device is created, but after that, it is only disabled/enabled. This is a closer behavior to what Xorg does on VT switch, at the expense of maybe leaving a dangling "physical" device if a capability goes for good. Otherwise, any DeviceIntPtr (re)created after server initialization will be left floating, and bad things happen when the wayland enter event handler tries to update cursor position based on a floating device. Signed-off-by: Carlos Garnacho Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 556cdf8fe870bc23e0393c0eed15c86f49a0b9f8 Merge: 83701c4 1faa766 Author: Keith Packard Date: Thu Jul 24 16:51:00 2014 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 83701c4ee8f79f69f4286ef262cd3ae3922629b9 Author: Adam Jackson Date: Mon Jul 21 10:21:07 2014 -0400 xfree86: Remove i2c multimedia modules These came in with the GATOS merge I think. The only driver using them was radeon, and then only in UMS mode. The radeon driver dropped UMS support from the main branch about two years ago, the UMS branch hasn't been touched in about fifteen months, and does not build against 1.16 in any case, so this is all dead code. Signed-off-by: Adam Jackson Reviewed-by: Alex Deucher Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 4302484ef2e67b2e05756c7ee0834dce938f1b44 Author: Adam Jackson Date: Mon Jul 21 10:06:53 2014 -0400 dix: Remove arch awareness from servermd.h (v2) At this point we have no architectures where image byte order is different from bitmap bit order, or where either of those two are not also the native word endianness. Hooray, one more place where we don't have to worry about enabling new CPU architectures. v2: Rebase to master to handle the addition of ppc64le, arc, and xtensa, and use autoconf's endianness detection instead of gcc predefines. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 860cd209679a2e56460977882b3b3826ddcb8710 Author: Adam Jackson Date: Mon Jul 21 10:06:52 2014 -0400 dix: Remove a weird case of little-endian s390 I really don't think this was ever correct, but I'm also not sure what non-Linux Unix this was meant to enable. The only one I know of was OS/390 / z/OS / OpenEdition, but I think that was big-endian too. At any rate this is all about to go away, so this is just removing an edge case. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit f593d76de76a645e29af5dd457ad1fd5a30736cc Author: Adam Jackson Date: Mon Jul 21 10:06:51 2014 -0400 dix: Remove wacky sparc special casing (v2) This appears to be defining sparc if ever __sparc or __sparc__ were defined, which is almost reasonable, but these days we want to be using the __arch__ style. Why any of this would ever be triggered on m68k is truly a mystery for the ages. v2: Fix commit message, as noted by nix Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 17c3347f14822b9f7da4253c71f6ed51be2b38d1 Author: Adam Jackson Date: Mon Jul 21 10:06:50 2014 -0400 dix: Default GLYPHPADBYTES to 4 This effectively no longer varied across architectures anyway. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 094b76735cb99b9f26e21f32170614454c644653 Author: Adam Jackson Date: Mon Jul 21 10:06:49 2014 -0400 dix: Remove some cfb leftovers These macros meant something in cfb, but not in fb. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit fee9a1536651ace9324b956df809ef22a63938f8 Author: Adam Jackson Date: Mon Jul 21 10:06:48 2014 -0400 dix: Remove some dead macros Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 634aa310c5130ef4d38f339bb26b01b5a7bad4e9 Author: Adam Jackson Date: Mon Jul 21 10:06:47 2014 -0400 dix: (Don't) change BITMAP_SCANLINE_UNIT on Linux s390{, x} Every other architecture sets this to 32, and I can't think of any benefit s390 would derive from changing it. It is, at any rate, something the client already copes with, and the only internal code impact seems to be some complicated math in miGetPlane, which you never hit if you're using fb. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit f6469f1910c72add358b7263d69bd116b4450ece Author: Adam Jackson Date: Mon Jul 21 10:06:46 2014 -0400 dix: Remove some XFree86 3.x leftovers Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 5aaacb501ff26bad391664cc7367bfe5164f72c7 Author: Adam Jackson Date: Mon Jul 21 10:06:45 2014 -0400 dix: Remove an ancient IBM configuration Whatever unix this was meant to be is either no longer in circulation, or is AIX, which we don't claim to support anyway. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 06268a0c55b7ce2737bdaa39f11cce07efa8bfa3 Author: Aaron Plattner Date: Sat Jul 19 09:59:07 2014 -0700 xfree86: Remove stale /usr/share/X11/xorg.conf.d hard-code from the xorg.conf man page I forgot that the old behavior of searching in /usr/share/X11/xorg.conf.d was documented in the man page. Signed-off-by: Aaron Plattner Fixes: acc0b5edd1dc ("xfree86: Only support one sysconfigdir") Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 1faa76670572e3478965fd2cd9ab60ab2d865e3a Author: Jeremy Huddleston Sequoia Date: Sat Jul 19 17:08:09 2014 -0700 mieq: Fix a crash regression in mieqProcessDeviceEvent (lldb) bt * thread #6: tid = 0x92d4eb, 0x00000001001dee94 X11.bin`mieqProcessDeviceEvent(dev=0x0000000000000000, event=0x0000000100298bb0, screen=0x0000000000000000) + 36 at mieq.c:519, stop reason = EXC_BAD_ACCESS (code=1, address=0x44) * frame #0: 0x00000001001dee94 X11.bin`mieqProcessDeviceEvent(dev=0x0000000000000000, event=0x0000000100298bb0, screen=0x0000000000000000) + 36 at mieq.c:519 frame #1: 0x00000001001df3eb X11.bin`mieqProcessInputEvents + 555 at mieq.c:631 frame #2: 0x0000000100017674 X11.bin`ProcessInputEvents + 20 at darwinEvents.c:422 frame #3: 0x0000000100175eaa X11.bin`Dispatch + 154 at dispatch.c:357 frame #4: 0x0000000100181b4a X11.bin`dix_main(argc=4, argv=0x00007fff5fbff750, envp=0x00007fff5fbff650) + 1594 at main.c:296 frame #5: 0x000000010001ba80 X11.bin`server_thread(arg=0x0000000101208220) + 64 at quartzStartup.c:66 frame #6: 0x00007fff89bb9899 libsystem_pthread.dylib`_pthread_body + 138 frame #7: 0x00007fff89bb972a libsystem_pthread.dylib`_pthread_start + 137 frame #8: 0x00007fff89bbdfc9 libsystem_pthread.dylib`thread_start + 13 Regression from: 9fb08310b51b46736f3ca8dbc04efdf502420403 Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Peter Hutterer commit cff12936275db2f71f6d24f9ea0985a0d14af454 Author: Keith Packard Date: Fri Jul 18 21:46:23 2014 -0700 glamor: sync_fence_set_triggered should use glFlush, not glFinish I intended to use glFlush all along, but somehow managed to type glFinish instead. glFlush is sufficient (for a single-queue GPU) to ensure serialization between queued rendering in the X server and future rendering from the client. Signed-off-by: Keith Packard Reviewed-by: Jasper St. Pierre commit cfa302d6224d10860e60491333950544c4fb9b04 Author: Keith Packard Date: Fri Jul 18 11:16:27 2014 -0700 glamor: Add support for SHM sync fences This hooks up SHM sync fences to complete the requirements for DRI3 running on Glamor. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit ac3acab1311c47cc73e2681e575f0407284c3c66 Author: Colin Walters Date: Fri Jul 18 09:13:54 2014 -0400 xf86platformBus: Add assertion to avoid (fatal) compiler warning Compilation of -video-intel started failing in gnome-continuous, it's because xserver has -Werror=return-type on, and gcc can't prove this function always returns a value: /usr/include/xorg/xf86platformBus.h:119:1: error: control reaches end of non-void function [-Werror=return-type] Let's add assertions to the accessor functions to fix this. Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 5c2e9fa3d6c4bdf626fededce866056ba8eca502 Merge: e678b49 6d49548 Author: Keith Packard Date: Thu Jul 17 20:06:21 2014 -0700 Merge remote-tracking branch 'anholt/glamor-next' commit 6d4954884908ea9894fcfe9836db1ba7bb45be61 Merge: 9ddcb20 55f5bfb Author: Eric Anholt Date: Thu Jul 17 18:00:44 2014 -0700 Merge remote-tracking branch 'origin/master' into glamor-next I've done this merge manually to resolve the minor conflict in glamor.c. Signed-off-by: Eric Anholt commit 9ddcb20f47b5e199989c8990512b0bca1354af86 Author: Eric Anholt Date: Mon Jun 16 07:24:09 2014 +0100 glamor: Drop the "are we doing a series of blits or draws" logic. It's unused since keithp's copy acceleration code completely replaced glamor_copyarea.c and removed the blit path. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit b03a581d8cbe3f29140935063b865285e2a00333 Author: Eric Anholt Date: Mon Jun 16 07:15:58 2014 +0100 glamor: Remove a dead prototype. The corresponding code was deleted in 2ff41008494e6c5909c058f1f80b4f66617dada1 (2012) Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit b5f94df319469ad44b0e88374a0d389414803f7a Author: Eric Anholt Date: Mon Jun 16 07:06:30 2014 +0100 glamor: Drop dead glamor_restore_pixmap_to_texture(). Unused since the glamor_prepare.c replacement of glamor_finish_access(). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 98155bd9d9b2a15a4dbcf80b2b57a7636efb14da Author: Eric Anholt Date: Mon Jun 16 07:01:28 2014 +0100 glamor: Drop dead glamor_download_pixmap_to_cpu() Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit b6181007de357da58125e022992f165b10eda65d Author: Eric Anholt Date: Mon Jun 16 07:04:01 2014 +0100 glamor: Drop dead get/pub sub pixmap functions. These were replaced by the new glamor_prepare.c code. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit e310387f443b6333edf02c8980daa303505382b4 Author: Eric Anholt Date: Sun Jan 12 10:19:10 2014 -0800 glamor: Remove always-true yInverted flag. All users of glamor had the same value set, and it complicated things for no reason. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit d71ecbb458c15fda608654b78d99683ebeab3c60 Author: Eric Anholt Date: Sun Apr 6 07:22:26 2014 -0700 glamor: Drop constant arguments to glamor_solid(). After keithp's change to drop the old glamor_fill() code, nothing ever changed these values. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit db9bff5c389f96991df8d6c62df1174e62e937d3 Author: Eric Anholt Date: Wed Apr 2 12:09:47 2014 -0700 glamor: Drop unnecessary glTexParameteri() in upload of texture data. We're not drawing, and we're not initially setting up the texture for later drawing. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 1140a89d7762540965ff865d154cb0528049066f Author: Eric Anholt Date: Wed Apr 2 12:12:06 2014 -0700 glamor: Use MIN/MAX macros to clean up glamor_transfer.c Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 2ab0fba9df695f19f0b43321d01395736f865c69 Author: Eric Anholt Date: Wed Apr 2 13:41:09 2014 -0700 glamor: Drop unnecessary glTexParameteri() in SetSpans(). If this path needed the filters set, so would all the other glDrawArrays() callers. But they don't. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit e678b4971b666e65a99c141e0a5f33969aa701b7 Author: Keith Packard Date: Tue Jul 15 17:31:59 2014 -0700 xfree86: Provide backward-compatibilty API for OdevAttributes This allows drivers to compile using the old OdevAttributes API against a new server. It generates compiler errors if the caller uses the wrong or undefined attribute types, or if the caller provides an incorrect default value for an integer attribute. Signed-off-by: Keith Packard Reviewed-by: Hans de Goede commit 60c05ce1ab5d9dc7c034b6b3723f43a42ea637d8 Author: Keith Packard Date: Tue Jul 15 17:31:58 2014 -0700 config: Replace OdevAttributes linked list with struct OdevAttributes are a fixed set of values with known types; instead of storing them in a linked list and requiring accessor/settor functions, replace the list header, struct OdevAttributes, with a struct that directly contains the values. This provides for compile-time typechecking of the values, eliminates a significant amount of code and generally simplifies using this datatype. Signed-off-by: Keith Packard Reviewed-by: Hans de Goede commit 55f5bfb578e934319d1308cbb56c900c5ac7cfa7 Author: Keith Packard Date: Wed Jul 16 16:03:23 2014 -0700 glamor: Fix temp picture coordinates in glamor_composite_clipped_region To understand this patch, let's start at the protocol interface where the relationship between the coordinate spaces is documented: static Bool _glamor_composite(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, INT16 x_source, INT16 y_source, INT16 x_mask, INT16 y_mask, INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height, Bool fallback) The coordinates are passed to this function directly off the wire and are all relative to their respective drawables. For Windows, this means that they are relative to the upper left corner of the window, in whatever pixmap that window is getting drawn to. _glamor_composite calls miComputeCompositeRegion to construct a clipped region to actually render to. In reality, miComputeCompositeRegion clips only to the destination these days; source clip region based clipping would have to respect the transform, which isn't really possible. The returned region is relative to the screen in which dest lives; offset by dest->drawable.x and dest->drawable.y. What is important to realize here is that, because of clipping, the composite region may not have the same position within the destination drawable as x_dest, y_dest. The protocol coordinates now exist solely to 'pin' the three objects together. extents->x1,y1 Screen origin of clipped operation width,height Extents of the clipped operation x_dest,y_dest Unclipped destination-relative operation coordinate x_source,y_source Unclipped source-relative operation coordinate x_mask,y_mask Unclipped mask-relative operation coordinate One thing we want to know is what the offset is from the original operation origin to the clipped origin Destination drawable relative coordinates of the clipped operation: x_dest_clipped = extents->x1 - dest->drawable.x y_dest_clipped = extents->y1 - dest->drawable.y Offset from the original operation origin: x_off_clipped = x_dest_clipped - x_dest y_off_clipped = y_dest_clipped - y_dest Source drawable relative coordinates of the clipped operation: x_source_clipped = x_source + x_off_clipped; y_source_clipped = y_source + y_off_clipped; Mask drawable relative coordinates of the clipped operation: x_mask_clipped = x_source + x_off_clipped; y_mask_clipped = y_source + y_off_clipped; This is where the original code fails -- it doesn't subtract the destination drawable location when computing the distance that the operation has been moved by clipping. Here's what it does when constructing a temporary source picture: temp_src = glamor_convert_gradient_picture(screen, source, extent->x1 + x_source - x_dest, extent->y1 + y_source - y_dest, width, height); ... x_temp_src = -extent->x1 + x_dest; y_temp_src = -extent->y1 + y_dest; glamor_convert_gradient_picture needs source drawable relative coordinates, but that is not what it's getting; it's getting screen-relative coordinates for the destination, adjusted by the distance between the provided source and destination operation coordinates. We want x_source_clipped and y_source_clipped: x_source_clipped = x_source + x_off_clipped = x_source + x_dest_clipped - x_dest = x_source + extents->x1 - dest->drawable.x - x_dest x_temp_src/y_temp_src are supposed to be the coordinates of the original operation translated to the temporary picture: x_temp_src = x_source - x_source_clipped; y_temp_src = y_source - y_source_clipped; Note that x_source_clipped/y_source_clipped will never be less than x_source/y_source because all we're doing is clipping. This means that x_temp_src/y_temp_src will always be non-positive; the original source coordinate can never be strictly *inside* the temporary image or we could have made the temporary image smaller. x_temp_src = x_source - x_source_clipped = x_source - (x_source + x_off_clipped) = -x_off_clipped = x_dest - x_dest_clipped = x_dest - (extents->x1 - dest->drawable.x) Again, this is off by the destination origin within the screen coordinate space. The code should look like: temp_src = glamor_convert_gradient_picture(screen, source, extent->x1 + x_source - x_dest - dest->pDrawable->x, extent->y1 + y_source - y_dest - dest->pDrawable->y, width, height); x_temp_src = -extent->x1 + x_dest + dest->pDrawable->x; y_temp_src = -extent->y1 + y_dest + dest->pDrawable->y; Signed-off-by: Keith Packard Reviewed-by: Markus Wick commit 16fbad3c7a22d2fb33549bcd422de985a60982b8 Author: Keith Packard Date: Thu Jul 17 16:17:53 2014 -0700 Post 1.16 version bump to 1.16.99.1 And we're off towards 1.17; this version bump serves to keep development versions distinct from stable versions. Signed-off-by: Keith Packard commit bfa5c73a36230f77fb211f185152212541c9d56d Author: Keith Packard Date: Wed Jun 4 22:00:45 2014 -0700 ephyr: Free damage structure at server reset time The usual mechanism for freeing a damage structure when the pixmap is destroyed does not work for the screen pixmap as it isn't freed in the normal way. The existing driver cleanup function, scrfini, is called after the wrapped CloseScreen functions, including damageCloseScreen, are called and thus ephyr can't free the damage structure at that point. Deal with this by providing an early CloseScreen hook in KdCloseScreen which ephyr can use to free the damage structure before damage itself shuts down. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 3319e7041ff89bb01b16a1dbbac85e28b1976ae3 Author: Keith Packard Date: Fri Apr 18 14:24:29 2014 -0700 hw/xfree86: Let xf86Rotate leave the BlockHandler unwrapped when possible When no shadow frame buffer is needed, the rotate block handler doesn't need to be called any more. Remove it from the chain. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 79a2733005202af43821d8fd8e4c9fb77bf8f69e Author: Keith Packard Date: Fri Apr 18 14:11:17 2014 -0700 hw/xfree86: Fix VGA arbiter screen proc wrapping Change the screen proc epilog code to re-fetch the current screen function in case a nested proc changes how things work. This isn't a problem with the current code as all of the wrapping layers that are set up at server init time (like the VGA arbiter) leave themselves in the screen proc chain forever. But, this makes the code conform with the expected norms. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit a1189fe322724ab1b524aaad5b700287777252bd Author: Keith Packard Date: Fri Apr 18 13:57:55 2014 -0700 mi: Fix block handler wrapping in miSprite miSpriteBlockHandler was leaving the BlockHandler wrapped until just before calling any nested block handler. If any code executed before that added or removed block handlers, the wrapping chain would have been broken. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 08fc33042c858568e7244eb9ad25a8d0270754f0 Author: Keith Packard Date: Fri Apr 18 13:55:50 2014 -0700 hw/xfree86: Fix block handler wrapping in xf86Rotate xf86Rotate, it was delaying unwrapping the BlockHandler until after calling xf86RotateRedisplay. If there was a software cursor on the screen, the redisplay operation would cause cursor to be removed from the frame buffer and the misprite block handler to be inserted into the block handler chain with the misprite screen private saved block handler now set to xf86RotateBlockHandler. When xf86RotateRedisplay returned, xf86RotateBlockHandler would then set screen->BlockHandler to its saved value, call down and then reset screen->BlockHandler to xf86RotateBlockHandler. miSpriteBlockHandler would never be called after that, which meant that the software cursor will now disappear from the screen whenever rendering overlapped and would only reappear when the cursor was moved. To correct this, all that is needed is to move the restoration of screen->BlockHandler to the top of xf86RotateBlockHandler, before the call to xf86RotateRedisplay. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit c75fee79ace394f6f51aa6fdda1c0436eb8a2026 Author: Keith Packard Date: Fri Apr 18 13:54:11 2014 -0700 Document how to correctly wrap screen procedures This adds a large comment to include/scrnintstr.h which should serve to document the correct way to wrap any screen procedure, with a particular focus on how to dynamically add/remove wrapping layers while the server is running. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 5eb77697ea35e7dc8cb8af2c3b5d8ffdba0fb632 Author: Peter Harris Date: Mon Mar 10 18:31:33 2014 -0400 Avoid starting a comment with */* Even though -Wcomment doesn't mind it (in gcc or clang), the appearance of */* confuses the syntax highlighter of some editors (eg. vim), and causes warnings in MSVC. Signed-off-by: Peter Harris Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 8b36e1ec8dd9f53e9f4e10422c2100844e9e549c Author: Keith Packard Date: Thu Jul 17 00:03:33 2014 -0700 Update to version 1.16.0 Signed-off-by: Keith Packard commit 4dbb641bb2d4037f107b58b31e80963dc8b72c0e Author: Hans de Goede Date: Mon Jul 14 14:01:47 2014 +0200 config_odev_add_attribute*: Check for right attribute type Don't allow setting string attributes to integers and vice versa. Signed-off-by: Hans de Goede Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 25eca7ce35973577c8d85704c270f7fb53e6732e Author: Hans de Goede Date: Mon Jul 14 14:01:46 2014 +0200 Fix ODEV_ATTRIB_DRIVER overlapping with ODEV_ATTRIB_FD Looks like the value of ODEV_ATTRIB_DRIVER was not updated when the patch adding it got rebased on top of a newer server version. This fixes the xserver crashing when systemd-logind integration is used. https://bugzilla.redhat.com/show_bug.cgi?id=1118540 Signed-off-by: Hans de Goede Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 9a19bf06b5b409fa0d5b5932e29cd4c5545052c5 Author: Peter Hutterer Date: Mon Jul 14 15:05:58 2014 +1000 Revert "dix: fix up coordinate scaling when external monitors are present" This reverts commit d90b5f83010248be65b2039b0b2d0b9e6a4e93cf. Reverting for two reasons: * the scaling does not work on devices that don't advertise resolution, and the default resolution used (100 units/mm) is higher than most devices, resulting in a significant slowdown of the touchpads. * the scaling is still affected by resolution changing. The patch worked before acceleration but since it maps into resolution-dependent dx/dy coordinates the acceleration may distort the movement after the fact. So the same input data generates different movements depending on the resolution. This can't easily be fixed for all affected devices as synaptics has its own velocity calculation method whereas wacom doesn't. So anything in the server won't work for both at the same time. Revert this for now, until a more integrated solution can be implemented. commit acc0b5edd1dc560b5c39dc44872b46581ec23903 Author: Aaron Plattner Date: Fri Jul 11 15:56:35 2014 -0700 xfree86: Only support one sysconfigdir When the X server is compiled with --prefix set to something other than /usr, then it ends up with a nonstandard sysconfigdir in its .pc file. This causes various other components to install their xorg.conf.d snippets there. However, the X server first looks for /usr/share/X11/xorg.conf.d before looking in sysconfigdir. That means that if the system administrator installed anything that created that path, the user's custom sysconfigdir is not searched. Rather than doing that, just look in the configured sysconfdir and nowhere else. Signed-off-by: Aaron Plattner Reviewed-by: Julien Cristau Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 578b9283bcc129d0a35fabe2637c7622085ef1e8 Author: Peter Hutterer Date: Thu Jul 10 10:39:50 2014 +1000 xfree86: don't force the screensaver off on DPMS unblank, merely suggest it Commit 41d4beb2616ceb3f1a1b8694733e85bae70de59a added symmetry to the screensaver/DPMS invocations so that one (en|dis)ables the other. Having dependencies between DPMS and the screensaver is subject to further arguments, but in this particular case using SCREENSAVER_FORCER is detrimental. SCREENSAVER_FORCER(ScreenSaverReset) resets the idle time for all devices on DPMS unblank. It prevents at least one use-case that GNOME tries to implement: GNOME displays a notification before suspending. If the display is currently blanked, GNOME lights it up to display the message. With the original patch in place DPMS unblank also resets the device idle times, thus restarting the timeout ad infinitum. Switch this to a more suggestive SCREENSAVER_OFF(ScreenSaverReset). This keeps the symmetry in blanking mode (DPMS and screensaver turn each other on/off as expected) but does not reset the idle time on the devices. https://bugzilla.gnome.org/show_bug.cgi?id=731241 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-By: Egbert Eich commit daa1a9d22db8e83d1933d8403acf72626199ee2a Author: Peter Hutterer Date: Mon Jul 7 08:27:44 2014 +1000 os: prevent negative array index access (#80890) If an empty string is provided to LogMessageVerbSigSafe, the length of the printed string is 0. Read-only access only and the only effect it had was adding a linebreak or not. X.Org Bug 80890 Signed-off-by: Peter Hutterer commit 9de3cc8daa4c6e877d30a0e8ccfe0cc159f1dbe3 Merge: 9308eaf a549987 Author: Keith Packard Date: Mon Jul 7 16:53:07 2014 -0700 Merge remote-tracking branch 'jturney/master' commit 9308eafb7d303739b81634ed2ee0da88554fd429 Author: Keith Packard Date: Mon Jul 7 16:28:26 2014 -0700 Update to version 1.15.99.904 One more RC to get the non-PCI patches tested before release Signed-off-by: Keith Packard commit b6cc489838dca0bcec7e9dbb4663b871e8cb7bc8 Author: Thierry Reding Date: Thu Feb 13 21:09:49 2014 +0100 xfree86: Make error message more readable While at it also replace a tab by four spaces for consistency. Reviewed-by: Aaron Plattner Tested-By: Aaron Plattner Signed-off-by: Thierry Reding Reviewed-by: Rob Clark Tested-by: Rob Clark Signed-off-by: Keith Packard commit eeefecd9df88920d4dca4100a84a135f7f53dd82 Author: Thierry Reding Date: Thu Feb 13 13:54:23 2014 +0100 xfree86: Support driver loading via OutputClass Use the OutputClass configuration to determine what drivers to autoload for a given device. Reviewed-by: Aaron Plattner Tested-By: Aaron Plattner Signed-off-by: Thierry Reding Tested-by: Rob Clark Signed-off-by: Keith Packard commit a270bb18baa6e3b45fa4a105a8d2be51ac5270bc Author: Thierry Reding Date: Thu Feb 13 13:42:05 2014 +0100 xfree86: Introduce OutputClass configuration The OutputClass section provides a way to match output devices to a set of given attributes and configure them. For now, only matching by kernel driver name is supported. This can be used to determine what DDX module to load for non-PCI output devices. DDX modules can ship an xorg.conf.d snippet (e.g. in /usr/share/X11/xorg.conf.d) that looks like this: Section "OutputClass" Identifer "NVIDIA Tegra open-source driver" MatchDriver "tegra" Driver "opentegra" EndSection This will cause any device that's driven by the kernel driver named "tegra" to use the "opentegra" DDX module. See the OUTPUTCLASS section in xorg.conf(5) for more details. Reviewed-by: Aaron Plattner Tested-By: Aaron Plattner Signed-off-by: Thierry Reding Tested-by: Rob Clark Signed-off-by: Keith Packard commit 856bb80cea695106a8f6767d00918b38795b51c6 Author: Thierry Reding Date: Wed Feb 12 16:43:29 2014 +0100 xfree86: Store kernel driver name in platform device attribute When opening a DRM device, query the version and store the driver name as a new attribute for future reference. Reviewed-by: Aaron Plattner Tested-By: Aaron Plattner Signed-off-by: Thierry Reding Reviewed-by: Rob Clark Tested-by: Rob Clark Signed-off-by: Keith Packard commit 5a4e15c3f6fb8d674879e54458328e9f595d9451 Author: Thierry Reding Date: Fri Feb 14 15:45:33 2014 +0100 xfree86: Make driver matching consistent Most of the driver enumeration functions take an array and a maximum number of entries that they are allowed to fill in. Upon success, they return the number of entries filled in. This allows them to be easily used to consecutively. One exception is the xf86MatchDriverFromFiles() function, which doesn't return a value, so callers have to manually search the array for the first empty entry. This commit modifies the xf86MatchDriverFromFiles() to behave the same way as others, which makes it easier to deal with. Reviewed-by: Aaron Plattner Tested-By: Aaron Plattner Tested-by: Rob Clark (on arm / platform device) Signed-off-by: Thierry Reding Signed-off-by: Keith Packard commit a61ca6f006d70343c88fe45206fae0669d1e8971 Author: Tomasz Borowik Date: Thu Jul 3 13:04:44 2014 -0700 glamor: Fix stack corruption in glamor_init glGet on GL_MAX_VIEWPORT_DIMS returns two values Reviewed-by: Markus Wick Signed-off-by: Keith Packard commit 10d2805dbc6b96a159b8c5acedcd53f34df362bf Author: Keith Packard Date: Thu Jun 26 14:12:24 2014 -0700 fb: Don't free NULL pixmap in fbCloseScreen. Bug #80313 We fixed fbCloseScreen to use the FreePixmap function so that the private counts would be updated correctly during CloseScreen. Xvfb calls FreePixmap and sets devPrivate to NULL before fbCloseScreen is called; not checking devPrivate before calling would result in a NULL pointer dereference. Signed-off-by: Keith Packard Reviewed-by: Julien Cristau commit a5499870e2f88822f52b1b54cad0db69856597c0 Author: Yaakov Selkowitz Date: Sun Apr 6 04:47:15 2014 -0500 hw/xwin: link dynamically and export symbols With my patch to fix shared libXfont to work correctly on Cygwin/Win32, there is no need for -static anymore. But, XWin.exe must export its symbols in order for them to override libXfont's stubs. Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY commit 5f3485b06e180674af640e7e9d7d56f67b61735b Author: Maarten Lankhorst Date: Thu Jun 26 10:37:19 2014 +0200 bump to 0.9.0 commit a3b44ad8db1fa2f3b81c1ff9498f31c5323edd37 Author: Thierry Reding Date: Wed Jun 25 16:03:29 2014 +0200 exa: Fix a warning when enabling DEBUG_TRACE_FALL The format string wants a picture and a character, but the argument list contains only a character, causing GCC to complain. Add the missing argument. Signed-off-by: Thierry Reding Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 2f113d68f6c1572576bc57ecca12e44cc9e438eb Author: Kristian Høgsberg Date: Mon Jun 16 11:34:55 2014 -0700 xwayland: Add glamor and DRI3 support Reviewed-by: Axel Davy Signed-off-by: Kristian Høgsberg Signed-off-by: Keith Packard commit fd16555c2fc606fc43236050deba558c20e184e8 Author: Michel Dänzer Date: Tue Jun 24 16:09:19 2014 +0900 Revert "glamor: Fix coordinates handling for composite source/mask pictures" This reverts commit 4e9aabb6fc15d8052934f20c6a07801c197ec36a. It broke kwin decorations with XRender compositing. Signed-off-by: Michel Dänzer Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 18744907d0766b1b57be12df5adafd0f93221006 Author: Chris Wilson Date: Tue Jun 10 07:45:05 2014 +0100 dri2: Invalidate DRI2Buffers upon SetWindowPixmap updates When transitioning to a redirected or unredirected Window, the Composite layer modifies the Window's Pixmap. However, the DRI2Buffer for the Drawable is still pointing to the backing bo of the old Pixmap with the result that rendering goes astray. This now also effects DRI2 Drawables that are touched by PresentPixmap. v2: Fixup the function name after rebasing Signed-off-by: Chris Wilson Cc: Reinis Danne Reviewed-by: Dave Airlie Cc: Keith Packard Signed-off-by: Keith Packard commit 4d92fab39c4225e89f2d157a1f559cb0618a6eaa Author: Chris Wilson Date: Wed Jun 18 11:14:43 2014 +0100 dri2: Use the PrimeScreen when creating/reusing buffers This fixes a segfault when we attempt to call ds->ReuseBufferNotify() passing a Prime DRI2BufferPtr to the master backend. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80001 Signed-off-by: Chris Wilson Reviewed-by: Dave Airlie Signed-off-by: Keith Packard commit 0d9ad781807022d78239327ed508758a3f88b090 Author: Eric Anholt Date: Mon Jun 16 08:06:53 2014 +0100 glamor: Fix GLES2 non-VBO temporary memory allocation. We'd get a request for like 16 bytes, claim to have allocated GLAMOR_VBO_SIZE, and then not reallocate when something a request bigger than 16 came along. The intent was to always allocate at least GLAMOR_VBO_SIZE. Fixes segfaults with Xephyr -glamor_gles2 and running gnome-terminal. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 736bed2aaf4bb672b6c7b33146fe84700baf22bd Merge: ce581ac d90b5f8 Author: Keith Packard Date: Mon Jun 23 14:18:03 2014 -0700 Merge remote-tracking branch 'whot/for-keith' commit ce581ac3fa80c4c52d87bd54fa92bc566b7d6adc Author: Axel Davy Date: Wed Jun 18 22:22:09 2014 -0400 present: fix bad logic in cancelling scheduled operations. If we present several pixmaps in advance for different msc, the later one shouldn't cancel the previous ones. This reverts a change made by commit e6f5d9d7b7efdacea0f22f1808efca849bcede4c Without this fix, vblank_mode=0 glxgears doesn't update with the present fallback. Signed-off-by: Axel Davy Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit adb7bc3386559dfee34b359dadcbb6796bc416e7 Author: Dinar Valeev Date: Mon Feb 24 11:36:54 2014 +0100 arch: Fix image and bitmap byte order for ppc64le So far PPC was big endian for sure. For ppc64le this is no longer true. Signed-off-by: Egbert Eich Reviewed-by: Mark Kettenis Signed-off-by: Keith Packard commit ea47341792cf06eda5bbdf0aca48aacc024a5be0 Merge: 334faab a11bbd8 Author: Keith Packard Date: Mon Jun 23 13:50:54 2014 -0700 Merge remote-tracking branch 'anholt/glamor-fixes' commit 334faabe682a422075ba214501c7554dd5ee5563 Author: Frank Binns Date: Tue Jun 10 13:43:31 2014 +0100 present: restore screen pixmap when aborting a flip If a 2D application is started on top of a fullscreen 3D application, which is flipping, then we need to stop flipping and restore the root window, and possibly the flip window, to using the screen pixmap. Normally this would be done as part of an unflip. However, in the case that there is a pending flip there is no mechanism to abort so the unflip is deferred until the pending flip completes. This provides a window of opportunity for the 2D application to draw to the wrong pixmap. Restore the screen pixmap at the point a pending flip is marked as aborted, thus avoiding this issue. Reviewed-by: Keith Packard Signed-off-by: Frank Binns Signed-off-by: Keith Packard commit d90b5f83010248be65b2039b0b2d0b9e6a4e93cf Author: Peter Hutterer Date: Fri May 30 09:56:37 2014 +1000 dix: fix up coordinate scaling when external monitors are present The goal of all this is to get an x/y motion reflecting the motion on the device, i.e. a circle on the device is a circle on the screen. This is currently done by scaling the y coordinate depending on the screen ratio vs device ratio. Depending on that ratio the movement on the y axis may be accelerated (ratio < 1) or slowed (ratio > 1). This leads to the weird effect that changing the screen ratio by plugging a new monitor changes the speed of the touchpad. Use a different algorithm: calculate the physical movement on the device, map that to the same-ish distance on the screen, then convert that back into a device-specific vector. This way we get the same mapping regardless of the current screen dimensions. Since the pointer accel code doesn't take device resolution into account, make sure we apply our crazy mapping before we accelerate. This way we accelerate resolution-independent. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 382ff4a306b97b0ddcdac03ce8611b026ca5323b Author: Keith Packard Date: Tue Jun 17 15:50:48 2014 -0700 present: Remove executing vblank from window list. Bug# 79709. Once the vblank is actually getting executed, it's lifetime is no longer tied to the window, and so it shouldn't be controlled by window destruction. In particular, if the vblank is queued for flip, it will get stored in the flip_pending field, and will be correctly destroyed when the flip completes. Signed-off-by: Keith Packard commit 199d9a6a942af9b443616f6ef6d26052ef3f48b9 Author: Eric Anholt Date: Fri Dec 27 11:12:27 2013 -0800 xephyr: Allow initializing glamor with gles2 (on GLX). This should be useful for glamor development, so you can test both paths (which are significantly different, and apparently glamor_gradient.c was broken on GLES2 as of the import). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 98b6158bc1e32aaca375829452266e013a520e14 Author: Eric Anholt Date: Sun Apr 6 07:44:20 2014 +0100 glamor: Share code for put_image handling. The difference between the two is that XF86 has the clip helper that lets you upload less data when rendering video that's clipped. I don't think that's really worth the trouble, especially in a world of compositors, so I've dropped it to get to shared code. It turns out the clipping code was broken on xf86-video-intel anyway. To reproduce, run without a compositor, and use another window to clip the top half of your XV output on the glamor XV adaptor: the rendering got confused about which half of the window was being drawn to. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 34884e16bf7c97434e7883d025c6814e083b0def Author: Eric Anholt Date: Sat Apr 5 12:30:28 2014 +0100 ephyr: Add support for XV using glamor. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 23d303bf905e76a70bda942037bdfbdcd06e55d2 Author: Eric Anholt Date: Sat Apr 5 12:57:16 2014 +0100 kdrive: Mark XV names const to avoid warnings. No code modifies it at runtime, and it's common to store string literals to it. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 65efc14b6ae1ee73bf6db379d7826b6bc9fd6d33 Author: Eric Anholt Date: Sat Apr 5 11:50:51 2014 +0100 glamor: Split the XV code into XF86-dependent parts and generic. I want to expose this from Xephyr as well, both to be able to test XV changes rapidly, and beause the XV passthrough to the host's overlay really doesn't work out well when we glXSwapBuffers() over the colorkey. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit a5662193f1c3dd63f615d96d1a300f70086ccbc6 Author: Eric Anholt Date: Sat Apr 5 12:26:33 2014 +0100 kdrive: Simplify the adaptor setup interface. Now that we don't have to worry about the generic adaptors code, there's no need to have a list of pointers to different sets of adaptors. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 55aad7399d4470bc46c064aafe07d12a6c293982 Author: Eric Anholt Date: Fri Apr 4 12:09:01 2014 +0100 kdrive: Remove dead generic XV adaptors code. I couldn't find any callers in the history of the tree. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 0edc0a78fbfac4578b0f809aef17332c1eb461e3 Author: Eric Anholt Date: Sun Apr 6 08:12:35 2014 +0100 kdrive: Do a little more cleanup from the XV struct deduplication. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 1d90e8811a7d4db328c0c944bec0aa3ed6afb70d Author: Eric Anholt Date: Fri Dec 27 21:34:44 2013 -0800 xorg: Remove duplicated definitions of some XV-related structs. These were field-for-field identical, so we can just typedef them to be the same, and memcpy their contents. v2: Fix missed strdup(). Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit a6aaa51752f301de24abce264976ba3c3a50863c Author: Keith Packard Date: Fri Mar 21 14:55:47 2014 -0700 glamor: Remove stubbed-out glamor_stipple function This function isn't used anymore. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit ef2bf0e645ed8242a0b637ed6a9d5b8c03b6b481 Author: Keith Packard Date: Fri Mar 21 14:30:33 2014 -0700 glamor: Remove 'tiling' shader code The core rendering paths all use the glamor_program fill functions now Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 18c09e60bf16b28060ade5d24110f2aa6bc19b57 Author: Keith Packard Date: Sun Mar 16 20:49:28 2014 -0700 glamor: Replace glamor_solid_boxes and glamor_solid with GC using code This provides glamor_solid_boxes and glamor_solid using regular GC operations instead of calling directly to underlying rendering functions. This will allow the old rendering code to be removed. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit bd3b2c48f69a5169aefb261c041462271c69a07a Author: Keith Packard Date: Thu Apr 3 14:22:52 2014 -0700 glamor: Add accelerated stipple support This copies the stipple to a 8bpp pixmap and uses that to paint the texture from. v2: Create deep stipple pixmap without GLAMOR_CREATE_FBO_NO_FBO v3: Fix stipple origin sign (matches tiles now). Track changes to original stipple with damage. This isn't required by the X spec, but java appears to depend on it, so we'll just do it. When Glamor switches to 8bpp bitmaps, we'll be able to render directly from them and not need this anymore. v4: Review comments from Eric: * Remove stray whitespace change * Avoid "large" pixmap for stipple by using GLAMOR_CREATE_NO_LARGE * Wrap to 80 columns v5: Don't crash when stipple damage tracker is destroyed The stipple damage tracker is automatically destroyed when the associated stipple pixmap is destroyed. When this happens, just clear the pointer from the GC rather than calling glamor_invalidate_stipple; that function would call DamageUnregister on the now invalid stipple damage pointer and crash. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit d18f5801c9a632dd4d9f8b7912491b6623e943d5 Author: Keith Packard Date: Wed Apr 2 14:07:20 2014 -0700 glamor: Add glamor_program based 0-width dashed lines This makes sure the pixelization for dashed lines matches non-dashed lines, while also speeding them up. v2: Switch to glamor_make_current v3: Create dash pattern pixmap without GLAMOR_CREATE_FBO_NO_FBO v4: Adopt suggestions from Eric's review: - Drops power-of-two alignment of our line vertex data, simplifying the code. - Stops reading from the VBO. While on keithp's and my machines the VBO is mapped cached, on many implementations it will be mapped WC, making those reads extremely expensive. - Style fixes (line wrapping, spaces around operators). v5: Adopt suggestions from Markus' review: - Use max when computing zero-width dashed line length. Don't open code max here. - Embed CoordModePrevious into VBO writing for dashed lines Instead of pre-computing the coord mode previous results, just embed this in the loop which fills the vertex buffer. Saves re-writing the request buffer, and shortens the code a bit v6: Export glamor_destroy_gc for UXA UXA needs to call glamor_destroy_gc from its GCFuncs, so export it. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit dc9fa9080a1cb994b4e54a341d2245f442dac576 Author: Keith Packard Date: Sun Mar 23 20:59:02 2014 -0700 glamor: Use glamor_program and GL_LINES for 0-width lines GL lines are nearly X compliant; you just need to fill in the last pixel when the client hasn't requested CapNotLast. v2: switch to glamor_make_current v3: use miPolylines instead of custom glamor fallback path. Wrap code to 80 columns. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 51075ebd37dca8d17c42425fb756ad3090e157c4 Author: Keith Packard Date: Fri Mar 21 18:03:07 2014 -0700 glamor: Use glamor_program for glamor_push_pixels This uses the same shaders as glamor_poly_glyph_blt. v2: Wrap some long lines (changes by anholt). Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 45ebc4e3fac7f1a85167d05e2833949b89f02d64 Author: Keith Packard Date: Sat Mar 15 13:31:18 2014 -0700 glamor: Add glamor_program based copy acceleration Paints with textures, using a temporary buffer for overlapping copies Performs CPU to GPU transfers for pixmaps in memory. Accelerates copy plane when both objects are in the GPU. Includes copy_window acceleration too. v2: Use NV_texture_barrier for non-overlapping copies within the same drawable v3: Switch to glamor_make_current v4: Do overlap check on the bounding box of the region rather than on individual boxes v5: Use Eric Anholt's re-written comments which provide a more accurate description of the code v6: Use floating point uniform for copy plane bit multiplier. This avoids an int to float conversion in the copy plane fragment shader. Use round() instead of adding 0.5 in copy plane. round() and +0.5 end up generating equivalent code, and performance measurements confirm that they are the same speed. Round() is a bit clearer though, so we'll use it. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Reviewed-by: Markus Wick commit 0e08a79599c773f77c0667d557376a5ccee3f89c Author: Keith Packard Date: Wed Apr 2 14:05:35 2014 -0700 glamor: Directly reference the private key records There's no reason to use a pointer here, it just wastes time. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 15e4d14dfae054c026b7e965ac33985e5cf6a168 Author: Keith Packard Date: Sat Mar 15 13:27:14 2014 -0700 glamor: Replace fallback preparation code These offer a simpler and more efficient means for temporarily transitioning to CPU-accessible memory for fallback implementations. v2: Do not attempt fallbacks with GLAMOR_DRM_ONLY pixmaps glamor cannot transfer pixels for GLAMOR_DRM_ONLY pixmaps using glReadPixels and glTexSubImage2D, and so there's no way to perform fallback operations with these pixmaps. v3: Clear ->pbo field when deleting the PBO. Otherwise, we'd reuse the old name next time we fall back on the pixmap, which would potentially conflict with some other pixmap that genned a new name, or just do a lazy allocation of the name (compat GL context, like we currently use) or error out (core GL context, like we hope to use some day). Also, style fixes. Changes by anholt, acked by keithp. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 3ac481c9dac591ffc33812ab047fc793d8a43d4f Author: Keith Packard Date: Wed May 7 10:31:16 2014 -0700 mi: Draw multiple lines in one FillSpans call in miZeroLine miZeroLine allocates enough space to draw a line spanning the entire width/height of the target drawable. When drawing multiple shorter lines, this leaves most of the space in that buffer unfilled. Let multiple lines be drawn into the buffer if there is plenty of space. Speeds up glamor fallback zero-width lines: Before 6000000 trep @ 0.0020 msec (508000.0/sec): 1-pixel line 6000000 trep @ 0.0020 msec (492000.0/sec): 10-pixel line 6000000 trep @ 0.0023 msec (427000.0/sec): 100-pixel line 4000000 trep @ 0.0035 msec (282000.0/sec): 500-pixel line After: 600000000 trep @ 0.0000 msec (43400000.0/sec): 1-pixel line 140000000 trep @ 0.0001 msec (13000000.0/sec): 10-pixel line 16000000 trep @ 0.0008 msec (1300000.0/sec): 100-pixel line 4000000 trep @ 0.0038 msec (261000.0/sec): 500-pixel line (500 pixel lines do not change in performance because the buffer can only one one of them.) Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit ea678a73c5688f73071d5581b6406808b7a0230f Author: Keith Packard Date: Fri Apr 25 22:43:51 2014 -0700 mi: Fill spans for multiple arcs in miPolyFillArc This allocates span data for multiple arcs and draws the whole set in one call, rather than doing them one at a time. For modern hardware, this is a significant performance improvement. v2: Limit the number of spans per buffer to 4M to avoid integer overflow in computing the malloc size. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit a7fce36affb8211990e5b4956adea4d75f0e73c9 Author: Keith Packard Date: Wed May 7 09:58:26 2014 -0700 mi: Make miPolyArc draw fast zero-width when possible Instead of forcing drivers to figure out when to call miZeroPolyArc, have miPolyArc call that when possible. This involved renaming the existing miPolyArc call to miWideArc and creating a new miPolyArc wrapper function as miZeroPolyArc falls back to miWideArc when the arc is too large to be drawn with the zero-width code (ellipses larger than 800x800). Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit bf1429b2034a577c994ff16b60d809d05ca99241 Author: Keith Packard Date: Wed May 7 09:56:39 2014 -0700 mi: Create miPolylines as a general-purpose line drawing function Instead of requiring all drivers to figure out which mi function to call for each of the four cases, create a single wrapper in mi that handles them correctly. Now drivers can simply use miPolylines in all cases. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 14d82a2bc3179160803c62c20746630d14e1b7d7 Author: Keith Packard Date: Thu Mar 13 23:29:54 2014 -0700 ephyr: Deal with non-root visual for window glx will sometimes select a non-root visual, deal with that by creating a suitable colormap and using that instead of attempting to use the default colormap. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit a11bbd875f3f90a3d02d727778cb1d3524cf59fd Author: Eric Anholt Date: Fri May 30 10:39:30 2014 -0700 glamor: Don't leak a prepare_access_gc() in putimage fallbacks. It turns out putimage doesn't use the GC tile or stipple anyway, so there's no need to do this. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 8da1e4e2bf28c3610cdbe1770a57be89578d37f5 Author: Markus Wick Date: Wed May 14 23:08:18 2014 +0200 glamor: Choose max fbo size by texture + viewport size The max size of renderbuffers and texture often match by accident, but as we always use textures, we should check for the right flag. Also check for viewport size as this may be lower and we want to render to almost every pixmap. Signed-off-by: Markus Wick Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 3778fab34bc00334edec4f845d0c6d43440f265a Author: Markus Wick Date: Wed May 14 23:08:17 2014 +0200 glamor: Fix no-mipmap allocations With GL_TEXTURE_MIN_FILTER, we configure not to use mipmaps, but there's no real way until GL_ARB_texture_storage to dictate whether memory should be allocated for mipmap levels or not. GL_TEXTURE_MAX_LEVEL is a stronger hint to the driver than the filtering that we really don't want mipmap allocations. Stops VARM wasting warnings from the nvidia driver. Signed-off-by: Markus Wick Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt Reviewed-by: Keith Packard commit 1095c262502332bc570a9b288b01da51c1fa10ec Author: Alan Coopersmith Date: Fri Jun 6 17:54:22 2014 -0700 config: show default path in help for --with-xkb-bin-directory Now shows: --with-xkb-bin-directory=DIR Directory containing xkbcomp program (default: ${bindir}) Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit e27a839bf0488d5b1cc2e2a887f2ea0e3d790790 Author: Jeremy Huddleston Sequoia Date: Thu Jun 5 20:38:44 2014 -0700 mi: Build fix: mieqProcessDeviceEvent returns void mieq.c:520:9: error: void function 'mieqProcessDeviceEvent' should not return a value [-Wreturn-type,Semantic Issue] return 0; ^ ~ 1 error generated. Regression-from: 9fb08310b51b46736f3ca8dbc04efdf502420403 Found-by: Tinderbox Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Peter Hutterer commit 08820f03768e904f1746ef93ca01660330dc5406 Author: Keith Packard Date: Wed Jun 4 22:28:57 2014 -0700 Update to version 1.15.99.903 Signed-off-by: Keith Packard commit 9fb08310b51b46736f3ca8dbc04efdf502420403 Author: Peter Hutterer Date: Wed May 21 10:07:31 2014 +1000 mi: don't process events from disabled devices (#77884) Once a device is disabled, it doesn't have a sprite pointer anymore. If an event is still in the queue and processed after DisableDevice finished, a dereference causes a crash. Example backtrace (crash forced by injecting an event at the right time): (EE) 0: /opt/xorg/bin/Xorg (OsSigHandler+0x3c) [0x48d334] (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x37fcc0f74f] (EE) 2: /opt/xorg/bin/Xorg (mieqMoveToNewScreen+0x38) [0x609240] (EE) 3: /opt/xorg/bin/Xorg (mieqProcessDeviceEvent+0xd4) [0x609389] (EE) 4: /opt/xorg/bin/Xorg (mieqProcessInputEvents+0x206) [0x609720] (EE) 5: /opt/xorg/bin/Xorg (ProcessInputEvents+0xd) [0x4aeb58] (EE) 6: /opt/xorg/bin/Xorg (xf86VTSwitch+0x1a6) [0x4af457] (EE) 7: /opt/xorg/bin/Xorg (xf86Wakeup+0x2bf) [0x4af0a7] (EE) 8: /opt/xorg/bin/Xorg (WakeupHandler+0x83) [0x4445cb] (EE) 9: /opt/xorg/bin/Xorg (WaitForSomething+0x3fe) [0x491bf6] (EE) 10: /opt/xorg/bin/Xorg (Dispatch+0x97) [0x435748] (EE) 11: /opt/xorg/bin/Xorg (dix_main+0x61d) [0x4438a9] (EE) 12: /opt/xorg/bin/Xorg (main+0x28) [0x49ba28] (EE) 13: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x37fc821d65] (EE) 14: /opt/xorg/bin/Xorg (_start+0x29) [0x425e69] (EE) 15: ? (?+0x29) [0x29] xf86VTSwitch() calls ProcessInputEvents() before disabling a device, and DisableDevice() calls mieqProcessInputEvents() again when flushing touches and button events. Between that and disabling the device (which causes new events to be refused) there is a window where events may be triggered and enqueued. On the next call to PIE that event is processed on a now defunct device, causing the crash. The simplest fix to this is to discard events from disabled devices. We flush the queue often enough before disabling that when we get here, we really don't care about the events from this device. X.Org Bug 77884 Signed-off-by: Peter Hutterer Reported-by: Maarten Lankhorst Tested-by: Maarten Lankhorst Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit e6f5d9d7b7efdacea0f22f1808efca849bcede4c Author: Keith Packard Date: Mon Jan 27 11:23:58 2014 -0800 present: Queue flips for later execution When a flip (or unflip) is pending and a flip request comes in, leave it queued until the pending flip completes and then execute it. This fixes a bug where an application submitting back-to-back present_pixmap requests for sequential frames would alternate between flipping and copying as the pending flip would cause the new present_pixmap request to not use a flip. Signed-off-by: Keith Packard Reviewed-by: Chris Wilson Tested-by: Frank Binns commit 2f5cf9ff9a0f713b7e038636484c77f113a5f10a Author: Frank Binns Date: Thu Apr 24 11:37:48 2014 +0100 xfixes: disable cursor on X server reset The initial state of the cursor is set to disabled but this was never be re-disabled during X server reset. This meant any application run after an X server reset would have the cursor displayed even if it hadn't requested this to be the case. Signed-off-by: Frank Binns Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit b92d86a982504af2605042c19ef796d135074ee1 Author: Brendan King Date: Thu Apr 24 11:37:47 2014 +0100 dix: fix pixmap leak on server reset The server is leaking a pixmap (created by CreateDefaultStipple()) on reset. The leak is caused by some X Server graphics contexts not being freed on reset by the machine independent cursor code in the server, which in turn is caused by the cursor cleanup code (miSpriteDeviceCursorCleanup()) not being called. Ensures the DeviceCursorCleanup() function is called when the associated input device is closed on server reset. Signed-off-by: Frank Binns Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit a99c061aafd4aaa5728c776dca7d0a1789ac739a Author: Brendan King Date: Thu Apr 24 11:37:46 2014 +0100 dix: reference the cursor just once in InitializeSprite() The new current cursor was being referenced twice, resulting in a memory leak when the current server generation ended. Signed-off-by: Frank Binns Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 444a1f7a8802999e27ecf5f6eb598df2206f7277 Author: Brendan King Date: Thu Apr 24 11:37:45 2014 +0100 fb: fix screen pixmap leak on server reset Call FreePixmap() instead of free() to destroy the screen pixmap in fbCloseScreen(). Signed-off-by: Frank Binns Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 7ca458493aa2f0aa091c989ea0768611e0730bf5 Author: Chris Wilson Date: Wed May 28 08:14:00 2014 +0100 xfree86: Report Present as a built-in module This is so that drivers can do a runtime check that Present is available, similar to existing runtime checks performed by the drivers for DRI. Signed-off-by: Chris Wilson Signed-off-by: Keith Packard commit 746be5a03ebbda4ab411ca3efb2ed95f99e9ea46 Author: Chris Wilson Date: Wed May 28 08:13:59 2014 +0100 xfree86: Report DRI3 as a built-in module This is so that drivers can do a runtime check that DRI3 is available, similar to existing runtime checks performed by the drivers for DRI and DRI2. v2: Only add DRI3 to the list if the module was actually built into the server (Mark Kettenis). Signed-off-by: Chris Wilson Cc: Mark Kettenis Signed-off-by: Keith Packard commit b5526141f78df15bc5df2497bc4b4a17f1a6368d Merge: dc8d068 a205ec3 Author: Keith Packard Date: Mon Jun 2 13:08:23 2014 -0700 Merge remote-tracking branch 'jturney/master' commit dc8d0688471695ec5a8db5fef93fbcfc064891d5 Author: Max Filippov Date: Mon Jun 2 01:17:31 2014 +0400 xtensa: add support for xtensa architecture Signed-off-by: Max Filippov Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit a6ffdc69c4ac45bc39924159c7fab5f02f720f1f Merge: 63c48de 1c10b37 Author: Keith Packard Date: Mon Jun 2 11:30:24 2014 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 63c48de63becdee680e90cb2363984c2f8f77fd1 Author: Søren Sandmann Date: Fri May 30 16:50:35 2014 -0400 xfree86: Add "modesetting" to list of fallback drivers To make X -configure work properly, the output of fixup_video_driver_list() should be in order of preference. Otherwise, the config file may use the incorrect driver for some devices. In particular, the drivers that work for all (or many) devices need to be last in the list. Since the modesetting driver works for many devices, it needs to be considered a fallback driver. Signed-off-by: Søren Sandmann Acked-by: Daniel Stone Signed-off-by: Keith Packard commit ab47ec9636b21a7f542d2e8612834915e7c8cc64 Merge: 0df871c cfaf2ab Author: Keith Packard Date: Mon Jun 2 11:22:48 2014 -0700 Merge remote-tracking branch 'whot/for-keith' commit 0df871cf34ee5f1a85586206027de9b02fb364ec Author: Robert Ancell Date: Thu May 22 10:43:52 2014 +1200 Fix overflow checking extension versions The easiest way to check for the version of an extension is to send the maximum possible version numbers in the QueryVersion request. The X server overflows on these as it assumes you will send a reasonable version number. Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 4cbd3fabaa41e89579530bceb01b9239fa2afdb7 Author: Adam Jackson Date: Wed May 21 09:22:49 2014 -0400 configure: Require sufficiently new wayland-client for xwayland ddx The explicit release requests were added in 1.3.0, don't try to build against older. Signed-off-by: Adam Jackson Reviewed-by: Jasper St. Pierre Signed-off-by: Keith Packard commit a205ec3ab77c6765d44f77c526a832345fef77b0 Author: Jon TURNEY Date: Sat Apr 5 15:15:46 2014 +0100 configure: Restore DEFAULT_LOGDIR to xwin-config.h, it is used Commit f37a46913489397d8628ffe578c8d4ed50b6ca72 removed this from xwin-config.h.in for some reason, but it is used. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit aaaa41345674a1c76a70836394cb5e57f82e9a26 Author: Jon TURNEY Date: Sun Apr 27 20:55:51 2014 +0100 hw/xwin: Update for __glXLastContext -> lastGLContext Update for __glXLastContext -> lastGLContext. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 1c10b37380d228b35db8a8616a6312ac54f5e59b Author: Jeremy Huddleston Sequoia Date: Sat May 31 17:45:02 2014 -0700 XQuartz: Update logic to account for title bar on every display in Mavericks http://xquartz.macosforge.org/trac/ticket/832 Signed-off-by: Jeremy Huddleston Sequoia commit ad0ff649c68b18c4b95b078c2d1d1e7de71a7c6f Author: Jeremy Huddleston Sequoia Date: Sat May 31 17:22:51 2014 -0700 XQuartz: Dead code removal (ENABLE_DEBUG_LOG) Signed-off-by: Jeremy Huddleston Sequoia commit e281288d5afedb154f52c31f70a350a013ecfb06 Author: Jeremy Huddleston Sequoia Date: Sat May 31 13:04:43 2014 -0700 XQuartz: Bump to 2.7.7 Signed-off-by: Jeremy Huddleston Sequoia commit cfaf2abbac3f01e57d00845d8908bf01559263f9 Author: Peter Hutterer Date: Sat May 24 20:05:53 2014 +1000 man: drop specific mention of DontZap in -retro (#71113) DontZap off is the default anyway, don't mention it specifically to avoid confusion X.Org Bug 71113 Signed-off-by: Peter Hutterer commit e48a132b6d187f355abd7021be47edde972e7091 Author: Peter Hutterer Date: Sat May 24 20:02:56 2014 +1000 xfree86: fix wrong DontZap documentation (#71113) X.Org Bug 71113 Signed-off-by: Peter Hutterer commit 548fc937b22d4dfe7f96e0bd77522261603a2c2f Author: Robert Ancell Date: Thu May 22 10:43:52 2014 +1200 Fix overflow checking extension versions The easiest way to check for the version of an extension is to send the maximum possible version numbers in the QueryVersion request. The X server overflows on these as it assumes you will send a reasonable version number. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit db2e708f31a162c6c66643d3559dd5f3e21ee06b Author: Adam Jackson Date: Thu Sep 27 17:44:42 2012 -0400 glx: Require at least one True/DirectColor visual Mesa no longer supports rendering to anything less. GLX 1.2 requires that the server advertise at least one GLX visual. GLX 1.3 and 1.4 are more subtle: they require at least one fbconfig capable of window rendering, and _also_ require that window-capable fbconfigs have a non-zero value for the GLX_VISUAL_ID. In either case we should refuse to init GLX if there's not at least one GL-capable visual on at least one screen. Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit d7a2df0a7499864cb005b098b79c1bdf884f6600 Author: Steven McDonald Date: Sun May 18 13:42:08 2014 +0200 Xi: block SIGIOs while copying device classes around I've been seeing sporadic (anywhere from once every few days to 3-4 times a day) crashes and freezes in X. The problematic behaviour isn't always the same, but I chose a particular incident to debug, and found that X was segfaulting in updateMotionHistory, on line 575 of dix/getevents.c. After some further investigation, I found that the bug was being triggered when a SIGIO was received in DeepCopyPointerClasses, between the AllocValuatorClass call (line 540) and updating the to->valuator pointer (line 545). AllocValuatorClass calls realloc() on to->valuator, so between these lines, it's not guaranteed to point to allocated memory. It seems the SIGIO handler is calling updateMotionHistory, which is reading the memory pointed to by to->valuator and getting a wrong value for last_motion, which updates buff to point to wildly the wrong place and thus generates a segfault when a memcpy() is done into buff. I am attaching a patch which I've been running on that machine for the past three days, and haven't yet observed any more crashing or freezing behaviour. The patch simply calls OsBlockSIGIO while DeepCopyDeviceClasses is in progress, as the state of the X server's device data structures is not guaranteed to be in a consistent state during that time. Debian bug#744303 Signed-off-by: Julien Cristau Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit d3a3ee7a0e5cbd3fcaba77d2d5664e1524eda11c Author: Peter Hutterer Date: Thu May 8 09:39:36 2014 +1000 os: automatically switch to sigsafe logging when needed If we're smart enough to warn, we should be smart enough to just pass it through to the right function. Worst case we lose some formatting specifiers which pnprintf will complain about anyway. And in most cases it won't matter. This requires renaming pnprintf to vpnprintf and changing the size_t to int to be compatible with Xvscnprintf. pnprintf is internal only, the others are exported API so we can't change them as easily. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 6d684f916b4c33327d32ef1f48803bf90357287f Author: Adam Jackson Date: Wed May 21 09:23:19 2014 -0400 shadowfb: Fix initialization This has to run at initial CreateWindow time, at CreateScreenResources the root window doesn't actually exist yet. Tested-by: Michael Thayer Signed-off-by: Adam Jackson Reviewed-by: Michael Thayer Signed-off-by: Keith Packard commit d9e99edd4dcf109492abdaa73ccf8f29d5bfd159 Author: Adam Jackson Date: Wed Apr 30 13:49:06 2014 -0400 glxproxy: Fix memory leak on error path in CreateGLXPixmap (#50281) (v2) v2: Fix another path spotted by keithp Signed-off-by: Adam Jackson Reviewed-by: Jasper St. Pierre Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit dff1f5e1a9608eda2992fc9e3304edee7b5bee9b Author: Adam Jackson Date: Wed Apr 30 13:49:05 2014 -0400 dmx: Fix memory leak in dmxBELoadFont (#50281) Signed-off-by: Adam Jackson Reviewed-by: Jasper St. Pierre Signed-off-by: Keith Packard commit 3dba171f5e82101aa8ea2e47d2253c3410907f6a Author: Michal Srb Date: Tue Apr 15 18:54:35 2014 +0300 dri2: Fix detection of wrong prime_id in GetScreenPrime. Checking the iterating variable ("slave") against null can not detect if the xorg_list_for_each_entry finished without break being invoked - slave variable will be always non-null. This caused segfault whenever someone tried to use DRI_PRIME with incorrect id while having at least one render offloading slave configured. Restructurize the GetScreenPrime to work as expected. Reviewed-by: Dave Airlie Signed-off-by: Keith Packard commit c08d2b8ccb0158dbf1f529f80cc3236e66236cce Author: Alexey Brodkin Date: Thu May 1 15:39:29 2014 +0300 ARC: Add support for ARC architecture Xorg server could be built for and run on Synopsys DesignWare ARC cores. These changes are required for successful building and execution of the server. Both little-endian and big-endian flavors of ARC cores are supported. Signed-off-by: Alexey Brodkin Acked-by: Adam Jackson Reviewed-by: Egbert Eich Signed-off-by: Keith Packard commit 042bae0b49f6192ec3cb8bb51423c90c44638134 Author: Adam Jackson Date: Wed May 21 10:16:39 2014 -0400 Use own thunk function instead of shadowUpdatePackedWeak I plan to remove the Weak functions from a future server. Signed-off-by: Adam Jackson commit d5587cf3acb7ad6f81e1c095f1b88f8fb25ee953 Author: Peter Hutterer Date: Wed May 14 10:32:30 2014 +1000 config: revert quirk for the Evoluent Vertical Mouse This quick makes the mouse behaviour more obvious (LMR buttons generate LMR events) but goes against the manufacturer's intended defaults: Top button - left click. Wheel button - .middle click (e.g., for pan and rotate in CAD programs). Middle button - right click. Bottom button - back. Thumb button - forward. from http://www.evoluent.com/vm3.html Signed-off-by: Peter Hutterer commit 01e18af17f8dc91451fbd0902049045afd1cea7e Author: Dave Airlie Date: Mon May 12 14:55:04 2014 -0700 rrcrtc: brackets are hard, lets go shopping. Slaving two outputs on a secondary GPU to a primary GPU testing picked this up, in that we'd try to resize to the totally the wrong thing, then as usual segfault in the rotation code. Signed-off-by: Dave Airlie Reviewed-by: Aaron Plattner commit 6dd86f3cba7cca67f3a9102db2e90722d32a34cb Author: Eric Anholt Date: Mon May 5 17:01:14 2014 -0700 glamor: Don't forget to check whether we can fall back in polysegment. Part of the _nf contract is that glamor will only return FALSE if glamor has checked that UXA can actually map the pixmaps (UXA only allocates the BO itself in the screen pixmap and DRI2 cases, and can't map it otherwise). Fixes server segfaults zooming in and out of libreoffice spreadsheets. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit fb24ac0a2c317099bdf7d1d8e4b7c443e3ee644f Author: Laércio de Sousa Date: Fri May 9 09:09:16 2014 -0300 xfree86: fix warnings after MatchSeat patch This patch fixes some compile warnings that arise after commit 7070ebeebaca1b51f8a2801989120784a1c374ae (xfree86: add new key MatchSeat to xorg.conf sections "Device", "Screen", and "ServerLayout") available at git repository git://people.freedesktop.org/~whot/xserver for-keith Signed-off-by: Keith Packard commit bbfed454b2a0fd5e2723524d145cb7c6e5aa9193 Author: Eric Anholt Date: Thu May 8 08:45:22 2014 -0700 glamor: Stop disabling asserts by default. Disabling asserts is something the user gets to manage. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Signed-off-by: Keith Packard commit 8e2fefe3ef247f8b5d74e32e8d37c619b06fc60c Author: Peter Hutterer Date: Tue Apr 29 16:52:01 2014 +1000 Xi: don't copy a DeviceEvent into an InternalEvent ==26141== Invalid read of size 8 ==26141== at 0x58FAEA: DeliverEmulatedMotionEvent (exevents.c:1484) An InternalEvent is bigger than a DeviceEvent, thus copying one to the other reads past the allocated boundary. Shouldn't have any real effect since we shouldn't access anything past the DeviceEvent boundary if the event type is correct. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit d7ac9aff061f2961e6b76557dda97b57988ce362 Author: Peter Hutterer Date: Wed Apr 30 10:55:26 2014 +1000 mi: start calculating the sprite trace from the first child of root Introduced in 73698d41e41ce76bef2d9a90b46ac0c24ae148dd "Make XYToWindow a screen function" Moving the code into miwindow.c changed the start of the loop from RootWindow()->firstChild to DeepestSpriteWindow(). This function is only supposed to be called from miXYToWindow which resets spriteTraceGood to 1, thus DeepestSpriteWindow() is always the root window anyway. What got dropped was the firstChild as the first window to handle, so we may end up with the root window twice in the sprite trace. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit d60724b752613ce2ad11c6ae102bf4513f9768ff Merge: a5b9757 15460ea Author: Keith Packard Date: Thu May 8 12:58:41 2014 -0700 Merge commit 'who/for-keith' Skipping two unreviewed patches; will mark them reviewed and cherry pick commit a5b9757142a2ab471ca26651dce9cc5f5e351f3d Author: Keith Packard Date: Fri Apr 25 15:07:03 2014 -0700 glamor: Publish change_window_attributes and copy_window Because uxa doesn't just use glamor directly, it keeps these two functions from being wrapped so that they get called automatically. Publishing these will allow uxa to call them directly. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 4711182033ec579caff8c930d420f90ecdbe54cf Author: Keith Packard Date: Fri Apr 25 20:25:56 2014 -0700 glamor: Work around libXfont when it fails to use defaultChar GetGlyphs is supposed to always return the full list of characters when there is a default character available. However, if an application opens a 16-bit two dimensional font and then draws with 8-bit requests, the bitmapGetGlyphs function in libXfont versions up through 1.4.7 will return zero glyphs if there is no 0th row. While this is a bug in libXfont and should be fixed there, it's easy to protect glamor from it by simply falling through to the case that handles GetGlyphs failures for fonts without a default character. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 91767a32874790f8a8c7340be0e81a0b719ca4f6 Author: Keith Packard Date: Fri Apr 25 23:38:35 2014 -0700 glamor: Fix uxa-entry point for ImageText16 Was interpreting the incoming chars as 8-bits instead of 16-bits, resulting in the wrong characters being drawn. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 15460eaed28b5353a94a17091d7795cfaeda9146 Author: Peter Hutterer Date: Fri May 2 14:14:58 2014 +1000 systemd-logind: let the logind code decided whether to close an fd We can only request one fd per device from systemd-logind. If a fd is re-used by the same device, releasing the fd from one device doesn't mean we can close it. The systemd code knows when it's really released, so let it close the fd. Test case: xorg.conf section for an input device with hotplugging enabled. evdev detects the duplicate and closes the hotplugged device, which closes the fd. The other instance of evdev thinks the fd is still valid so now you're playing a double lottery. First, which client(s) will get the evdev fd? Second, which requests will be picked up by evdev and which ones will be picked up by the client? You'll never know, but the fun is in finding out. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 219ce9e6c34bfc946005fb8e81ab4fb74ae1d25a Author: Dave Airlie Date: Fri May 2 13:16:05 2014 +1000 modesetting: fix build regression against older servers. Signed-off-by: Dave Airlie commit 795af9ff017113788b4bb6d9dbeb5370c5b8165c Author: Dave Airlie Date: Fri May 2 13:14:30 2014 +1000 modesetting: fix use after free. Signed-off-by: Dave Airlie commit 42a4873cc7fe0c7a729e48f806e877c4dac5c07f Author: Keith Packard Date: Wed Apr 30 09:32:29 2014 -0700 hw/xfree86: Video Driver ABI version 18.0 With the change in the cursor interface in 4c3932620c29c91dfbbc8eb09c84efcaa7ec873e, we need to bump the video driver ABI number to ensure that drivers are rebuilt to match the new interface. Signed-off-by: Keith Packard Reviewed-by: Aaron Plattner commit a6f5ffd5879e7fb052d343592951cc476b699bb4 Author: Laércio de Sousa Date: Thu Apr 3 11:19:15 2014 -0300 xfree86: add short description about MatchSeat key in xorg.conf man page Signed-off-by: Laércio de Sousa Reviewed-by: Dave Airlie Signed-off-by: Peter Hutterer commit 7070ebeebaca1b51f8a2801989120784a1c374ae Author: Oleg Samarin Date: Thu Apr 3 11:19:14 2014 -0300 xfree86: add new key MatchSeat to xorg.conf sections "Device", "Screen", and "ServerLayout" This patch introduces a new key MatchSeat in xorg.conf (also applies to any .conf file in xorg.conf.d). It will allow targeting a given "Device", "Screen", and/or "ServerLayout" section to a particular seat only (specified by option "-seat" in X server command line), so that other seats won't be affected. Without this patch, one needs to write a separate xorg.conf.custom file and pass it to X server via "-config" option, if one wants that these settings only apply for the right seat. However, in some cases, this solution is undesirable or even impossible (e.g. when using GDM, which doesn't allow X server command line customization). Example file (/etc/X11/xorg.conf.d/seat1.conf), which would be ignored by X server unless it was started with "-seat seat1" option: Section "Device" Identifier "card0" Driver "nvidia" Option "NoLogo" "True" MatchSeat "seat1" EndSection Signed-off-by: Oleg Samarin Signed-off-by: Laércio de Sousa Reviewed-by: Dave Airlie Signed-off-by: Peter Hutterer commit 29b1484bb9555e45067669cbfe68a3c40596f4ff Author: Laércio de Sousa Date: Thu Apr 3 11:19:13 2014 -0300 xfree86: allow fallback to PCI bus probe for graphics devices on non-seat0 X servers (#66851) Currently non-seat0 X servers only probe platform bus for graphics devices, which is OK for most KMS-compliant drivers. However, for non-KMS drivers (like NVIDIA proprietary ones), graphics devices can't be reached by platform bus probe, resulting in a "No devices detected" error. This patch allows a fallback to PCI bus probe for non-seat0 X servers in case no platform bus graphics device is found. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66851 Signed-off-by: Laércio de Sousa Reviewed-by: Hans de Goede Reviewed-by: Dave Airlie Signed-off-by: Peter Hutterer commit 2535b76c0d32bc1dd0ddaca06a419a68a4757df1 Author: Robert Ancell Date: Wed Apr 23 08:19:35 2014 +1200 os: Add -displayfd into -help text Add -displayfd into -help text. It was mentioned in the man page but seem to have been missed from the -help text. Signed-off-by: Keith Packard commit a26578dbb93dbaab1910b52f9fa1c87f8c9e6d1e Author: Ray Strode Date: Thu Apr 24 13:38:29 2014 -0400 selinux: don't checkout for AVCs on select() EINTR wakeup handlers are called even when select() returns EINTR, and when they're called the passed fd set is undefined. This commit fixes the selinux wakeup handler to avoid checking for AVCs over the netlink socket spuriously. Reviewed-by: Adam Jackson Signed-off-by: Ray Strode Signed-off-by: Keith Packard commit bcb17b99873f020f2639b860ce99d260def0cd97 Author: Ray Strode Date: Thu Apr 24 13:38:28 2014 -0400 dbus: don't dispatch dbus events on select() EINTR wakeup handlers are called even when select() returns EINTR, and when they're called the passed fd set is undefined. This commit fixes the dbus wakeup handler to avoid dispatching into dbus spuriously. Reviewed-by: Adam Jackson Signed-off-by: Ray Strode Signed-off-by: Keith Packard commit 6bd7ad914470322ddd02b50078e159234ebec643 Merge: b92a928 e06fbe4 Author: Keith Packard Date: Tue Apr 29 09:37:37 2014 -0700 Merge remote-tracking branch 'whot/for-keith' commit e06fbe4dc81110e01d36f958849c4ab5f2a9df0e Author: Peter Hutterer Date: Mon Apr 28 07:57:00 2014 +1000 dix: remove a now-superfluous comment Obsolete since 93945b0a74aa8156a88f52b8ba77f1210042f396 Signed-off-by: Peter Hutterer commit 6a848122def0f2a439e21c50f22814db11760132 Author: Michal Srb Date: Wed Apr 2 17:14:05 2014 +0300 input: Remove invalid bug checks. Commit 2f1aedcaed8fd99b823d451bf1fb02330c078f67 added several bug checks. Some of them are not correct. Checks in Init(Ptr|String|Bell|Led|Integer)FeedbackClassDeviceStruct verify that no feedback struct was set yet, but that is not required. If any feedback structs are already present, the function will chain them behind the new one. Signed-off-by: Michal Srb Signed-off-by: Peter Hutterer commit f073b5e58262d5fcc0102d773091d11d175227ce Author: Hans de Goede Date: Tue Mar 18 15:48:22 2014 +0100 Add support for server managed fds Signed-off-by: Hans de Goede commit b92a9289fef4831e9af69e5f6f64b5454f550559 Author: Thierry Reding Date: Wed Feb 12 17:11:40 2014 +0100 xfree86: int10: Fix build on ARM Commit 7353ec7cb6fc235b03e59e35425201429c83ee72 "xfree86: Switch int10 code to stdint types" uses designated initializers to setup the fields of the X86EMU_pioFuncs. This breaks compilation on ARM, since out{b,w,l}() are redefined using the preprocessor and therefore cause the compiler to complain about non-existent fields being assigned to. It seems like the compiler.h header that contains these redefinitions isn't actually needed in xf86x86emu.c, so the easiest "fix" is to not include it. Signed-off-by: Thierry Reding Reviewed-by: Rob Clark commit 774fea38c48671ed44e54278f0280bae04822491 Author: Rob Clark Date: Thu Apr 3 15:35:53 2014 -0400 int10: fix build error Fixes: stub.c:66:1: error: conflicting types for 'xf86int10Addr' In file included from stub.c:14:0: xf86int10.h:72:53: note: previous declaration of 'xf86int10Addr' was here Signed-off-by: Rob Clark commit b241934238feedcb86c113fe3beb69a7470de02d Author: Rob Clark Date: Thu Apr 3 14:54:02 2014 -0400 default to stub int10 implementation on arm There should be no reason to need a real int10 implementation on arm, and switching to stub is an easy way to fix: xf86x86emu.c: In function 'xf86Int10ExecSetup': xf86x86emu.c:56:9: error: unknown field 'xf_outb' specified in initializer xf86x86emu.c:57:9: error: unknown field 'xf_outw' specified in initializer xf86x86emu.c:58:9: error: unknown field 'xf_outl' specified in initializer which is caused by the following in compiler.h: #define outb xf_outb #define outw xf_outw #define outl xf_outl Signed-off-by: Rob Clark Acked-by: Daniel Stone commit 4c3932620c29c91dfbbc8eb09c84efcaa7ec873e Author: Keith Packard Date: Fri Apr 25 08:22:15 2014 -0700 hw/xfree86: Restore API compatibility for cursor loading functions Create load_cursor_image_check, load_cursor_argb_check, LoadCursorImageCheck and LoadCursorARGBCheck that can return failure and use them in preference to the old unchecked variants. Signed-off-by: Keith Packard Reviewed-by: Hans de Goede Reviewed-by: Michael Thayer commit 99f0365b1fbdfd9238b9f5cc28491e4e6c7324f1 Author: Eric Anholt Date: Wed Apr 23 09:52:17 2014 -0700 Add a command line argument for disabling indirect GLX. The attack surface for indirect GLX is huge, and it's of no use to most people (if you get an indirect GL context, you're better served by a immediate X error than actually trying to use an indirect GL context and finding out that it doesn't support doing anything you want, slowly). This flag gives you a chance to disable indirect GLX in environments where you just don't need it. I put in both the '+' and '-' arguments right now, so that it's easy to patch the value to change the default policy. Signed-off-by: Eric Anholt Acked-by: Julien Cristau Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit a4d96afdbddb7a636df8e336059d3a5624f2e6ae Author: Zhigang Gong Date: Wed Apr 23 18:54:43 2014 +0900 glamor: Fallback to system memory when fail to allocate one big fbo. Even when create a pixmap which smaller than the max_fbo_size, it may fail due to some low level driver limitation. If that is the case, we don't need to crash the xserver. We just need to fallback to system memory. See the related bug at: https://bugs.freedesktop.org/show_bug.cgi?id=71190 Signed-off-by: Zhigang Gong Reviewed-by: Michel Dänzer Tested-by: Kai Wasserbach Tested-by: Erich Seifert Signed-off-by: Michel Dänzer Signed-off-by: Eric Anholt commit 21e0e373858bd7f3458172ebd465397e33b90162 Author: Michel Dänzer Date: Wed Apr 23 18:54:42 2014 +0900 glamor: Fix memory leak in _glamor_copy_n_to_n() It would leak the memory allocated for the region rects in some cases. Found with valgrind. Reviewed-by: Alex Deucher Reviewed-by: Zhigang Gong Signed-off-by: Michel Dänzer Signed-off-by: Eric Anholt commit 4e9aabb6fc15d8052934f20c6a07801c197ec36a Author: Anthony Waters Date: Wed Apr 23 18:54:41 2014 +0900 glamor: Fix coordinates handling for composite source/mask pictures There were actually two issues with the original code I believe, the first is that the call to glamor_convert_gradient_picture wasn't properly referencing the coordinates of the source/mask pictures. The second, was that the updated references (x_temp/y_temp) were also improperly set, they should always be 0 because the temp pictures are new ones that start at (0, 0). The reason it worked in certain cases and it didn't in others (notably the tray icons) was due to the numbers working out based on the call to glamor_composite. In the cases that it did work extent->x1 would equal x_dest and extent->y1 would equal y_dest, making it so what was actually passed into glamor_convert_gradient_picture and the settings for x_temp/y_temp were correct. However, for the case when extent->x1 wouldn't equal x_dest and extent->y1 wouldn't equal y_dest (for example with the tray icons) then the wrong parameters get passed into glamor_convert_gradient_picture and x_temp/y_temp are set improperly. Fixes issues with tray icons not appearing properly in certain cases. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64738 Signed-Off-by: Anthony Waters Reviewed-by: Alex Deucher Reviewed-by: Zhigang Gong Signed-off-by: Michel Dänzer Signed-off-by: Eric Anholt commit 5062b4fadd977d044e54b53b7f3e02e466eac9a9 Author: Keith Packard Date: Sun Mar 16 20:44:48 2014 -0700 glamor: Add glamor_transfer based glamor_get_image and glamor_put_image These use the upload_boxes and download_boxes helpers to provide reasonably efficient image transfer. Fixes segfaults in Xephyr with x11perf -reps 1. Performance improvements: Improves -putimage10 by 548.218% +/- 88.601% (n=10). Improves -putimage500 by 3.71014% +/- 1.5049% (n=10). Improves -getimage10 by 8.37004% +/- 4.58274% (n=10). No statistically significant difference on -getimage500 (n=10). v2: Fix rebase failures, don't forget to check/prepare the gc in putimage fallbacks (changes by anholt). Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 747160016ba2d0cd42ad6b174cbf927d67c01875 Author: Keith Packard Date: Tue Apr 22 16:33:45 2014 -0700 glamor: Wire alpha to 1 for pictures without alpha bits When sourcing a picture that has no alpha values, make sure any texture fetches wire the alpha value to one. This ensures that bits beyond the depth of the pixmap, or bits other than the RGB values aren't used. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit a69907288d59792fd783f2f1756cde03d4a06f97 Author: Michel Dänzer Date: Mon Apr 21 17:47:15 2014 +0900 glx: If DRI2GetBuffers changes the GL context, call it again By changing the context, it may also invalidate the DRI2 buffer information, so we need to get that again. Fixes crashes due to use-after-free with LIBGL_ALWAYS_INDIRECT=1 glxgears and piglit. Signed-off-by: Michel Dänzer Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt Reviewed-by: Adam Jackson commit f6abfece3e59fa8c2e14a61430133816837855f8 Author: Eric Anholt Date: Thu Apr 17 18:50:13 2014 -0700 glamor: Move a make_current before the first GL call entrypoint. Fixes a usage of the wrong context with swrast GLX's GetImage entrypoint. Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit 707726b155a2a086d12e0a6abef7f1e59def5370 Author: Eric Anholt Date: Fri Apr 4 07:03:46 2014 +0100 glamor: Do the same MakeCurrent(None) for GLX as we do for EGL. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit 482b06a95a0a2c9a58bc196eb3dd928d796853df Author: Eric Anholt Date: Fri Apr 4 07:03:31 2014 +0100 glamor: Explain the weird EGL_NO_CONTEXT code. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit fab0a4a4c9dad2275bb398d09632f4274b5e16f2 Author: Eric Anholt Date: Fri Mar 14 17:31:18 2014 -0700 glamor: Replace glamor_get/put_context() with just glamor_make_current(). Now that we have the DIX global state for the current context, we don't need to track nesting to try to reduce MakeCurrent overhead. v2: Fix a mistaken replacement of a put_context with make_current in glamor_fill_spans_gl() (caught by keithp). Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer (v1) Reviewed-by: Adam Jackson (v1) commit 11ff12d4e74c0b514cb62cc47df9770c91e5002a Author: Eric Anholt Date: Fri Mar 14 17:29:31 2014 -0700 glamor: Stop unsetting the EGL context in put_context(). This matches the Xephyr behavior. Now that we know when to reset the context in the presence of GLX, we don't need to try to keep our stuff from being smashed by GLX. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit b5e394b3f5d80749af0148611df2eb009e7bf823 Author: Eric Anholt Date: Fri Mar 14 17:20:12 2014 -0700 glamor: Use lastGLContext to coordinate the context with GLX. This gets us some more context changes that are needed to make sure the two sides render to the right drawables and manipulate the right objects. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit ab6e958a2e611b03e475c16d10beb9961d8dffc8 Author: Eric Anholt Date: Wed Apr 9 10:23:01 2014 -0700 glx: Make sure that DRI2/swrast calls haven't changed the GL context. These functions are called from the GL driver, in some series of GL calls by GLX. If some server component (like glamor CreatePixmap for GetBuffers()) changes the GL context on us, we need to set it back or the later GL calls will land in the glamor context instead of the GLX context. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit f3f2fb6baac3d2b248eb4b0da13fe95e9dc3de7d Author: Eric Anholt Date: Wed Apr 9 11:25:32 2014 -0700 glx: Refactor DRI2CopyRegion calls. I needed to add some code to each one, so it's a good time to make a helper func. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit 008f1ab31e8ac6be8f3fb11f19cdf8674be318dd Author: Eric Anholt Date: Thu Apr 17 18:28:54 2014 -0700 glx: Unconditionally clear lastGLContext on loseCurrent(). This hook calls unbindContext in the DRI driver interface, which unsets the dispatch table, regardless of whether the context argument was the current one or not. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit 789509ef5324ce9141222fa92dea51b5cc777209 Author: Eric Anholt Date: Thu Apr 17 18:23:51 2014 -0700 glx: Move GLX MakeCurrent lastGLContext updates next to makeCurrent(). We want to make sure that lastGLContext is set correctly during makeCurrent, because we may have recursive GL context changes in the DRI2 interfaces due to glamor. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit abf12027063dbe22bec1d055ad8db365cf07395a Author: Eric Anholt Date: Thu Apr 17 18:18:49 2014 -0700 glx: Move the GLX variable caching what GL context is current to dix. GLX is trying to track whether the context it wants is current, to avoid the glFlush() (and the rest of the overhead) that occurs on all MakeCurrent calls. However, its cache can be incorrect now that glamor exists. This is a step toward getting glamor to coordinate with GLX. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit f12221cbd8ff33070fa2ca086bccf7ed32115f0e Author: Eric Anholt Date: Wed Apr 16 16:16:21 2014 -0700 glamor: Fix a missing set of the GL context. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Michel Dänzer Reviewed-by: Adam Jackson commit e924034269532979f1e88947ee9c33d30461edae Author: Eric Anholt Date: Mon Apr 21 10:56:38 2014 -0700 glamor: Fix accelerated rendering of GTK's ARGB vs xBGR composites. There is some complicated code to support tweaking the format as we upload from a SHM pixmap (aka the GTK icon cache), but if we weren't sourcing from a SHM pixmap we just forgot to check that the formats matched at all. We could potentially be a little more discerning here (xRGB source and ARGB mask would be fine, for example), but this will all change with texture views anyway, so just get the rendering working for 1.16 release. Fixes the new rendercheck gtk_argb_xbgr test. v2: Squash in keithp's fix for checking that we have a non-NULL pixmap, and reword the comment even more. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 4bbee6761d49478fa40ec5daa2797f13ae96ce5c Author: Jamey Sharp Date: Fri Apr 18 09:31:09 2014 -0700 Make glamor build with --enable-debug. Bad anholt, no biscuit. Broken in commit 4c9a20072552c52b3763bd73e7a7e9b9cb8b4993. Signed-off-by: Jamey Sharp Cc: Eric Anholt Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit ba2432a020a9f9bd0892f643117795336ba0fc16 Author: Adam Jackson Date: Thu Apr 10 11:34:28 2014 -0400 xfixes: Forbid manipulating clip for source-only pictures (#28968) Just throw BadPicture instead of crashing. It's not currently a meaningful thing to do anyway, RenderSetPictureRectangles would error if you tried (which this patch changes to BadPicture as well for consistency). The problem with trying to do it is if the clip is specified as a pixmap then we try to convert it to a region, and ->BitmapToRegion requires a ScreenPtr, and source-only pictures don't have one. I can imagine a use for client clip on source-only pictures, so if we really wanted to allow this, probably the way forward is to always store the clip as a region internally, and when setting the clip _from_ a pixmap, look up BitmapToRegion relative to the pixmap not the picture. But since clearly nobody can be relying on it working... Signed-off-by: Adam Jackson Reviewed-by: Hans de Goede Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 70e564104b69bc53d29633f392f2c1ab94caddc9 Author: Dominik Behr Date: Tue Apr 1 20:36:13 2014 -0700 xf86RandR12: use correct gamma size when allocating gamma table When setting crtc->gamma_size to randr_crtc->gammaSize we should use randr_crtc->gammaSize to allocate new gamma table in crtc. Currently, if randr_crtc->gammaSize > crtc->gammaSize the subsequent memcpy will overwrite memory beyond the end of gamma table. Signed-off-by: Dominik Behr Reviewed-by: Stéphane Marchesin Signed-off-by: Keith Packard commit 35d275c7519570ceaf82cd5e7a663a8a5be4d441 Author: Eric Anholt Date: Fri Apr 4 08:38:33 2014 +0100 os: Initialize the set of signals to be suppressed during our handler. Fixes a valgrind complaint: ==8805== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s) ==8805== at 0x5EB8315: __libc_sigaction (sigaction.c:66) ==8805== by 0x5B13DA: busfault_init (busfault.c:145) ==8805== by 0x5A60A2: OsInit (osinit.c:191) ==8805== by 0x46EBA2: dix_main (main.c:163) Signed-off-by: Eric Anholt Reviewed-by: Alan Coopersmith Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 19e5a13970ad9d440c0789395e94931429ef4fbb Author: YunQiang Su Date: Sat Oct 12 13:22:35 2013 +0800 Fix hw/xfree86/common/compiler.h for mips64 Mark mips64 as 64bit Use long as PORT_SIZE Signed-off-by: YunQiang Su Reviewed-by: Matt Turner Signed-off-by: Keith Packard commit f466fb2432292d74123d701764c432d3aa75ef1d Author: Adam Jackson Date: Thu Apr 10 11:45:37 2014 -0400 xres: Fix size estimation for <8bpp pixmaps (#69057) Just use floats, it's not like this is a performance path. Signed-off-by: Adam Jackson Reviewed-by: Julien Cristau Signed-off-by: Keith Packard commit 5df66822c9f6bac1ed3952971958068600ccd095 Author: Keith Packard Date: Mon Apr 21 21:38:28 2014 -0700 shadowfb: Fix compilation errors Ok, that's embarassing -- I didn't even make sure Adam's patch compiled. These are minimal fixes to make it build. Signed-off-by: Keith Packard commit 2dcb1672620ef5f16111517e9e7a98cf97deb678 Author: Adam Jackson Date: Thu Apr 10 13:42:42 2014 -0400 shadowfb: Port to miext/damage (#31303, #65547) Somewhat shocking how much simpler this is, isn't it? We no longer need to wrap the screen or GC or Picture, because damage does it for us, which is doubly great since the old shadowfb code didn't wrap _enough_ things (border updates and Render glyphs, at least). The only real difference now between this and shadow is a) shadow will let you track arbitrary pixmaps, and b) shadow's update hook runs off the BlockHandler whereas shadowfb is immediate. Tested on nouveau. Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 8edeac202ecbace859b7889dd811424471dcca73 Author: Peter Harris Date: Wed Apr 16 20:24:34 2014 -0400 composite: Fix memory leak in compCopyWindow Signed-off-by: Peter Harris Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 935ea0d7b5e18ad8f22ee074a08cbdc7390d0f5d Author: Alan Coopersmith Date: Mon Apr 21 15:18:45 2014 -0700 dmxConfigCanvasUpdate: Delay dereference until after checking for NULL Flagged by cppcheck 1.64: [hw/dmx/config/xdmxconfig.c:306] -> [hw/dmx/config/xdmxconfig.c:323]: (warning) Possible null pointer dereference: fs - otherwise it is redundant to check it against null. Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 983e30361f49a67252d0b5d82630e70724d69dbf Author: Peter Harris Date: Fri Apr 11 17:44:59 2014 -0400 fb: Fix origin of source picture in fbGlyphs If a source picture doesn't repeat and a mask format is specified, the incorrect calulation of the origin of the glyphs caused the glyphs to not be drawn at all. Noticed when running gtk-demo from RHEL 6.5 and selecting "Rotated Text". Signed-off-by: Peter Harris Reviewed-by: Keith Packard Signed-off-by: Keith Packard /* Test for this bug cc -std=c99 -o glyph glyph.c `pkg-config --cflags --libs xcb-render` */ // 16 x 16 pictfmt_a8 "glyph" static const char glyph[] = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, }; static struct { uint8_t len; uint8_t pad[3]; uint16_t deltax, deltay; uint8_t glyph; uint8_t pad2[3]; } elt = { len:1, glyph:1, deltax:WIN_SIZE/2 - GLYPH_SIZE/2, deltay:WIN_SIZE/2 - GLYPH_SIZE/2 }; int main(int argc, char *argv[]) { int screen; xcb_connection_t *c = xcb_connect(NULL, &screen); if (!c || xcb_connection_has_error(c)) { fprintf(stderr, "Cannot open default display \"%s\"\n", getenv("DISPLAY")); return EXIT_FAILURE; } // Find root window and depth const xcb_setup_t *setup = xcb_get_setup(c); if (screen >= setup->roots_len) screen = 0; xcb_screen_iterator_t si = xcb_setup_roots_iterator(setup); for (int i=0; i < screen; i++) xcb_screen_next(&si); xcb_window_t root = si.data->root; uint8_t depth = si.data->root_depth; xcb_visualid_t visual = si.data->root_visual; // Find picture formats xcb_render_query_pict_formats_reply_t *qpf; qpf = xcb_render_query_pict_formats_reply(c, xcb_render_query_pict_formats(c), NULL); if (!qpf) { fprintf(stderr, "Cannot query RENDER picture formats\n"); return EXIT_FAILURE; } xcb_render_pictformat_t fmt_a8 = 0; xcb_render_pictforminfo_iterator_t pfi = xcb_render_query_pict_formats_formats_iterator(qpf); for (int i = 0; i < xcb_render_query_pict_formats_formats_length(qpf); i++) { if (pfi.data->depth == 8 && pfi.data->type == XCB_RENDER_PICT_TYPE_DIRECT && pfi.data->direct.alpha_mask == 0xFF) { fmt_a8 = pfi.data->id; break; } xcb_render_pictforminfo_next(&pfi); } if (!fmt_a8) { fprintf(stderr, "Cannot find a8 RENDER picture format\n"); return EXIT_FAILURE; } xcb_render_pictformat_t fmt_visual = 0; xcb_render_pictscreen_iterator_t psi = xcb_render_query_pict_formats_screens_iterator(qpf); for (int i = 0; i < xcb_render_query_pict_formats_screens_length(qpf); i++) { xcb_render_pictdepth_iterator_t pdi = xcb_render_pictscreen_depths_iterator(psi.data); for (int j = 0; i < xcb_render_pictscreen_depths_length(psi.data); i++) { xcb_render_pictvisual_iterator_t pvi = xcb_render_pictdepth_visuals_iterator(pdi.data); for (int k = 0; k < xcb_render_pictdepth_visuals_length(pdi.data); i++) { if (pvi.data->visual == visual) { fmt_visual = pvi.data->format; goto found_visual; } xcb_render_pictvisual_next(&pvi); } xcb_render_pictdepth_next(&pdi); } xcb_render_pictscreen_next(&psi); } found_visual: if (!fmt_visual) { fprintf(stderr, "Cannot find visual RENDER picture format\n"); return EXIT_FAILURE; } xcb_render_glyphset_t glyphset = xcb_generate_id(c); xcb_render_create_glyph_set(c, glyphset, fmt_a8); uint32_t glyph_ids[] = {1}; xcb_render_add_glyphs(c, glyphset, 1, glyph_ids, &(xcb_render_glyphinfo_t){width:GLYPH_SIZE, height:GLYPH_SIZE}, sizeof(glyph), glyph); // Create window, pixmap, and gc xcb_window_t window = xcb_generate_id(c); uint32_t list[] = { si.data->black_pixel, XCB_EVENT_MASK_EXPOSURE }; xcb_create_window(c, XCB_COPY_FROM_PARENT, window, root, 0, 0, WIN_SIZE, WIN_SIZE, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, list); xcb_map_window(c, window); xcb_render_picture_t winpic = xcb_generate_id(c); xcb_render_create_picture(c, winpic, window, fmt_visual, 0, NULL); xcb_pixmap_t pixmap = xcb_generate_id(c); xcb_create_pixmap(c, depth, pixmap, window, GLYPH_SIZE, GLYPH_SIZE); xcb_render_picture_t pixpic = xcb_generate_id(c); xcb_render_create_picture(c, pixpic, pixmap, fmt_visual, 0, NULL); xcb_render_fill_rectangles(c, XCB_RENDER_PICT_OP_SRC, pixpic, (xcb_render_color_t){green:0xFFFF, alpha:0xFFFF}, 1, &(xcb_rectangle_t){width:GLYPH_SIZE, height:GLYPH_SIZE} ); xcb_flush(c); for (xcb_generic_event_t *ev = xcb_wait_for_event(c); ev; ev = xcb_wait_for_event(c)) { int type = ev->response_type; free(ev); if (type == XCB_EXPOSE) { xcb_clear_area(c, 0, window, 0, 0, 0, 0); xcb_render_composite_glyphs_8(c, XCB_RENDER_PICT_OP_SRC, pixpic, winpic, fmt_a8, glyphset, 0, 0, sizeof(elt), (uint8_t *)&elt); xcb_flush(c); } } return EXIT_SUCCESS; } commit 80a0b29c3b61ba9024bd0278ea8cc51686afe3f4 Author: Michel Dänzer Date: Fri Apr 11 11:01:51 2014 +0900 glamor: Add remaining header files to SOURCES It wasn't possible to build glamor from tarballs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64297#c9 Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit ea15f8b4c90ebef21d4031bf7f412ef9241d5438 Author: Jasper St. Pierre Date: Mon Apr 21 16:30:49 2014 -0400 dixfonts: Turn a missing directory ErrorF into a DebugF On systems without these directories, we don't need to be complaining loudly. Reviewed-by: Kristian Hoegsberg Signed-off-by: Keith Packard commit ba5c2b6c876a15fe18bc1ff1ab4e773c46bc9009 Merge: 9c86d5f 66b6024 Author: Keith Packard Date: Mon Apr 21 14:59:51 2014 -0700 Merge remote-tracking branch 'krh/xwayland-for-keithp' commit 9c86d5f4f6f5d6d135a9f2f8eae904c6441e84e5 Author: Kristian Høgsberg Date: Tue Mar 25 14:57:12 2014 -0700 .gitignore: Add new autotools file 'test-driver' Automake 1.12 introduces a new parallel test framework that uses a shell script helper and generates *.log and *.trs files. Add to .gitignore. Signed-off-by: Kristian Høgsberg Reviewed-by: Gaetan Nadon Signed-off-by: Keith Packard commit 28fa5dd5cad3a5fb51018250dfa2b605a8aea85c Author: Julien Cristau Date: Mon Apr 14 15:27:19 2014 +0200 configure: require xproto 7.0.26 for pointer typedef removal Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit d2274f2f46db300ac75ca0fdcba7f5655865b8b6 Author: Julien Cristau Date: Mon Apr 14 15:27:18 2014 +0200 configure: require fontsproto 2.1.3 for pointer typedef removal Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 6d892ad112fc887e184f50c5dc2ba593668e9e11 Author: Robert Morell Date: Fri Apr 18 18:29:44 2014 -0700 randr: Implement RandR 1.4 request swapping The protocol handlers all have support for swapping variable data and replies, but the top-level dispatch plumbing was missing. Signed-off-by: Robert Morell Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit ed4ee7c34a7fbb58a449647fb8d968618c499a61 Author: Robert Morell Date: Fri Apr 18 18:29:43 2014 -0700 randr: Fix size checks for SetProvider* reqs Both xRRSetProviderOutputSourceReq and xRRSetProviderOffloadSinkReq are fixed-size requests, so the length on the wire should match exactly. Signed-off-by: Robert Morell Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 668321e7e5acb41c0c7b299f57165e86dc74d7ed Author: Robert Morell Date: Fri Apr 18 18:29:42 2014 -0700 randr: Fix crash for NULL swap dispatch procs The previous code was checking the wrong table for function pointers. Signed-off-by: Robert Morell Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 66b602474047c499b8a888267a489790fc9f9d85 Author: Kristian Høgsberg Date: Mon Apr 21 11:14:51 2014 -0700 xwayland: Remove left-over ErrorF logging Reviewed-by: Jasper St. Pierre Signed-off-by: Kristian Høgsberg commit 138bf5ac9703b410a6066c303feea067680edf5a Author: Jamey Sharp Date: Fri Apr 18 12:22:19 2014 -0700 DRI2SwapBuffers: Fix uninitialized target SBC. Fixes Piglit test "swapbuffersmsc-return swap_interval 0". Ensure that *swap_target gets initialized on any 'return Success' path, even if the swap request can't be completed by the driver and the server falls back to a simple blit. That path can also be triggered by setting swap_interval to 0, which disables sync to vertical retrace. We originally found this bug because for some reason SDL2 automatically sets swap_interval to 0, when we were trying to test OML_sync_control in an SDL2 test application. We then discovered that the above-mentioned Piglit test has been failing for the same reason since it was introduced. Signed-off-by: Jamey Sharp Signed-off-by: Theo Hill Reviewed-by: Keith Packard Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 4927af4475bc7d020190d9f468c90366525c1109 Author: Jamey Sharp Date: Fri Apr 18 12:22:18 2014 -0700 DRI2SwapBuffers: Don't reuse swap_target variable. swap_target is an out-parameter that needs to be set to the value that SBC will take on after this SwapBuffers request completes. However, it was also being used as a temporary variable to hold the MSC at which the SwapBuffers request got scheduled to occur. This confusion makes it harder to reason about whether swap_target is being set correctly for its out-parameter usage. (Hint: It isn't.) For the latter use, it makes more sense to use the existing target_msc variable, which already has the right value unless target_msc, divisor, and remainder are all 0, in which case we can set it using swap_interval as usual. Signed-off-by: Jamey Sharp Signed-off-by: Theo Hill Reviewed-by: Keith Packard Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit d2c6e801b548674b8636e6a64b42c9038d46263c Author: Kristian Høgsberg Date: Tue Apr 8 09:23:42 2014 -0700 configure.ac: Remove check for WAYLAND_SCANNER_RULES This makes configure fail if the wayland autoconf macros aren't found. We don't need the scanner for shm-only xwayland so just drop this line for now. Reviewed-by: Daniel Stone Reviewed-by: Gaetan Nadon Reviewed-by: Jeremy Huddleston Sequoia Signed-off-by: Kristian Høgsberg commit f618455c802abb77de8d64eb442422cfe5e26ea8 Author: Kristian Høgsberg Date: Tue Apr 8 09:19:13 2014 -0700 xwayland: Build without xshmfence Reviewed-by: Daniel Stone Signed-off-by: Kristian Høgsberg commit 552d40b26a082df6f1816bb461793b8fa8b553c6 Author: Kristian Høgsberg Date: Tue Apr 8 09:17:51 2014 -0700 xwayland: Build without GLX extension Reviewed-by: Daniel Stone Signed-off-by: Kristian Høgsberg commit c7011249d2abe6cc7af82ee4b79d8f6873444707 Author: Keith Packard Date: Fri Apr 18 15:12:14 2014 -0700 xkb: Verify reads of compiled keymap header and TOC Check the return values from fread to make sure the elements are actually getting read from the file. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 0af8788579c2f52cc1172952c9004483bf863932 Author: Keith Packard Date: Fri Apr 18 15:09:50 2014 -0700 os: Ignore log file write failures There's no place to log the message if writing to the log file fails, and we surely don't want to crash in that case, so just ignore errors and keep going. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 7abd28685066369ded807f59493c1159cfb286bf Author: Keith Packard Date: Fri Apr 18 15:05:00 2014 -0700 os: Make sure that writing our pid to the lock file actually worked There's no sense verifying that we can create the lock file and then ignoring the return value from write. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit d72f691c0c9cace857975a6608a4cb431c8b6846 Author: Keith Packard Date: Fri Apr 18 15:00:30 2014 -0700 os: FatalError if -displayfd writes fail When the server is started with the -displayfd option, check to make sure that the writes succeed and give up running if they don't. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 4957e986841225e9984daca76f1a0ee08df125bb Author: Keith Packard Date: Fri Apr 18 15:00:35 2014 -0700 os: Clear the -displayfd option after closing the file Failing to clear this means that we'll attempt to write the display number to a random file descriptor on subsequent X server generations. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 0c0feddbcda238efa82a47f456ef3008ffa53195 Author: Keith Packard Date: Fri Apr 18 14:54:02 2014 -0700 kdrive: Ignore failure to chown console tty to current user I'm not sure what we'd do in this case anyways, other than fatal error. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 696e08f8e820449bb4b0ce7a60bf5b5bc5097935 Author: Keith Packard Date: Fri Apr 18 14:50:14 2014 -0700 kdrive: Explicitly ignore errors from the -switchCmd script Make it clear that we intentionally ignore the -switchCmd return value. This keeps GCC from emitting a warning when the server is compiled with -D_FORTIFY_SOURCE=2. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 570b1c79942b237022be3594ae3a25e7b833cb73 Author: Keith Packard Date: Fri Apr 18 14:47:00 2014 -0700 test: [v2] Validate server log reading more carefully in signal-logging test Check return value from fgets and strchr instead of assuming they worked. [v2] Don't do any necessary work inside the assert call. Also make sure the return value was long enough. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 3119aae80782b7ff5613c719fbcc8a01feab1134 Author: Gaetan Nadon Date: Fri Apr 4 14:59:21 2014 -0400 test: create a link to the generated hw/xfree86/sdksyms.c at build time Automake 1.14 gives us warning about source code specified in _SOURCES that comes from directories other than the current one. It suggests to enable the subdir-objects feature which only supports code in sub directories. The test directory needs source from hw/xfree86 which is neither under test nor under a sub directory of test. In 1.14 we get a warning, in 2.0 it will break as it will overwrite the object code in xfree86. The solution in this case is to create a link to hw/xfree86/sdksyms.c at build time. It's just like any other built source file. There are no links created in git. Signed-off-by: Gaetan Nadon Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 58ef01648b18f85ad79620da110ece2339f638c3 Author: Adam Jackson Date: Thu Apr 17 10:49:46 2014 -0400 dri1: Don't bother asking the loader about drmGetLibVersion This was added for DRM_IOCTL_SET_VERSION support, which has been around for over ten years now. Since we require ≥2.3.0 in configure.ac this would really only protect you if you managed to build against a modern libdrm but run against one that's more than 7½ years old, which, doctor it hurts when I do this. Archaeology: http://cgit.freedesktop.org/~ajax/dri/commit/xc/programs/Xserver/GL/dri/dri.c?id=77d62efca033dced96ab7998b7c62a4e2df907d5 Signed-off-by: Adam Jackson Reviewed-by: Eric Anholt Signed-off-by: Keith Packard commit 461ed561b9f75cee43c0dfd39228716f977956e7 Author: Hans de Goede Date: Fri Apr 18 11:30:16 2014 +0200 Xorg.wrap manpages: use __appmansuffix__ instead of hardcoding 1 Cc: Gaetan Nadon Signed-off-by: Hans de Goede Reviewed-by: Gaetan Nadon commit 584961c86427b400a5ba65b0f145d00748d2da1e Author: Hans de Goede Date: Fri Apr 18 11:26:00 2014 +0200 man/Makefile.am: Fix Xorg.wrap.man Xwrapper.config.man missing from make dist Fix suggested by: Gaetan Nadon Cc: Gaetan Nadon Signed-off-by: Hans de Goede Reviewed-by: Gaetan Nadon commit ec01d51a9973a9cf5f32f14f00058f1fdc9ed25e Author: Guillem Jover Date: Mon Apr 14 18:13:25 2014 +0200 Xorg.wrap: Make the console check portable Handle the unported case by issuing a build-time and run-time warning. And add support for FreeBSD kernel based systems, by using the VT_GETINDEX ioctl to check if the file descriptor is on a virtual console. Signed-off-by: Guillem Jover Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3a469917b585914ba2421e305f3b6a837b232e93 Author: Guillem Jover Date: Mon Apr 14 18:13:24 2014 +0200 Xorg.wrap: Clarify error messages Not printing the program name produces very confusing messages that might be difficult to attribute while trying to diagnose problems, let's be explicit about who we are. Also add a missing "/" between SUID_WRAPPER_DIR and "Xorg.bin". Signed-off-by: Guillem Jover Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 50b6e1b0d786d95ee8eab030b0d1fd7420e2fbeb Author: Guillem Jover Date: Mon Apr 14 18:13:23 2014 +0200 Xorg.wrap: Use instead of hardcoding libdrm include path The libdrm.pc file gives us the correct include path, do not try to hardcode it on the source, as it might vary on the installed system, for example on Debian-based systems it's under /user/include/libdrm/. Signed-off-by: Guillem Jover Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 7bffceb9f939c0bf5529b00500cbb14ae01bb61a Author: Guillem Jover Date: Mon Apr 14 18:13:22 2014 +0200 Xorg: Add Xorg.wrap to hw/xfree86/.gitignore Signed-off-by: Guillem Jover Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 208157a76c6f340e0161e18ac77149d7110af2f5 Author: Julien Cristau Date: Sun Apr 13 19:14:34 2014 +0200 configure: fix help text for dmx As of 93fa64e17d7bd600ebf18ecab85f5b2d17fe30ce it's disabled by default, so stop saying it's automatically enabled in configure --help. Signed-off-by: Julien Cristau Reviewed-by: Kenneth Graunke Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c917fa411502d402b9c69de30f6a88e102bb8610 Author: Keith Packard Date: Tue Apr 8 01:01:28 2014 -0700 glamor: Always allocate precisely the requested pixmap size Using a pixmap as a tile or stipple means that we must have the underlying FBO match the pixmap geometry exactly. We may want to add some complexity here to migrate pixmaps into exact sized objects as necessary, but for now, make the server work correctly by skipping this optimization. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 3028ae6c9aa37168e249e0d847b29f8e3efb05b2 Merge: bd3de10 ec6007e Author: Keith Packard Date: Wed Apr 9 21:59:17 2014 -0700 Merge remote-tracking branch 'jeremyhu/master' commit bd3de10f86a511886b0748d55fa19860314a0150 Author: Keith Packard Date: Tue Apr 8 14:25:18 2014 -0700 Bump to version 1.15.99.902. Closing the 1.16 merge window. Signed-off-by: Keith Packard commit 6ec04a75deb1695820e337abbefe1929d5928f15 Author: Keith Packard Date: Fri Apr 4 16:28:43 2014 -0700 dri3: Fix dri3_open API change by adding new dri3_open_client Xwayland will eventually need the current client in dri3_open. Simply changing that API is not an option though as other drivers that implement DRI3 will not have a matching function signature and will crash when called. Add a new dri3_open_client function pointer and bump DRI3_SCREEN_INFO_VERSION so that drivers can be aware of the new function which will be used in preference to the old function when available. Signed-off-by: Keith Packard Reviewed-by: Eric Anhole commit ec6007e6f7772a90713c9c51c64359229961ce27 Author: Jeremy Huddleston Sequoia Date: Sun Apr 6 05:32:00 2014 -0700 XQuartz: Ensure we wait for the server thread to terminate AKA: XQuartz 2.7.5 doesn't delete its /tmp/.X$d-lock http://xquartz.macosforge.org/trac/ticket/823 Signed-off-by: Jeremy Huddleston Sequoia commit 901fbfbbbd71c0d82080957f8ba09eebbc786f2b Author: Michael Thayer Date: Mon Mar 31 11:21:42 2014 +0200 Add a return value to load_cursor_argb() to allow it to report failure load_cursor_argb() may need to be able to fail and have the server fall back to a software cursor in at least the following circumstances. 1) The hardware can only support some ARGB cursors and this does not just depend on cursor size. 2) Virtual hardware may not wish to pass through a cursor to the host at a particular time but may wish to accept the same cursor at another time. This patch adds a return value to the API and makes the server do the software fall-back on failure. Signed-off-by: Michael Thayer Reviewed-by: Dave Airlie Signed-off-by: Keith Packard commit 62ab4102260fd3342a0e5ae3a4f77b430af64f4e Author: Michael Thayer Date: Mon Mar 31 11:19:16 2014 +0200 Set a flag property on the root window to say if the X server VT is active An X11 client may need to know whether the X server virtual terminal is currently the active one. This change adds a root window property which provides that information. Intended interface user: the VirtualBox Guest Additions. Signed-off-by: Michael Thayer Reviewed-by: Dave Airlie Signed-off-by: Keith Packard commit b851ca968b7cce6d1a6438c05d3d5c8832249704 Author: Daniel Stone Date: Thu Apr 3 18:22:50 2014 +0100 Add pScreen->NameWindowPixmap hook This hook allows drivers to be notified when a pixmap gains a new ID. (ABI break.) Signed-off-by: Daniel Stone Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit b4d0bec22c15930abf13a7fb9d684208ccd56b1d Merge: 3c34dd3 6e539d8 Author: Keith Packard Date: Thu Apr 3 15:35:01 2014 -0700 Merge remote-tracking branch 'krh/xwayland-for-keithp' commit 6e539d8817f738289dc2dea13d0720116287ab9d Author: Kristian Høgsberg Date: Tue Mar 11 16:11:39 2014 -0700 Xwayland DDX Started out as an Xorg module to be used from Xorg drivers to let Xorg run under a wayland server. The idea was to be able to reuse the 2D acceleration from the Xorg driver. Now with glamor being credible, a better plan is to just make Xwayland its own DDX, similar to Xwin and Xquartz. This is a much better fit, as much of the code in the original approach had to hack around Xorg doing Xorg things like take over the VT, probe input devices and read config files. Another big win is that Xwayland dosn't need to be setuid root. The Xwayland support for DRI3, Glamor and render nodes was done by Axel Davy , who also did a lot of work on the rebase to the Xwayland DDX. Contributions from: Christopher James Halse Rogers Corentin Chary Daniel Stone Kristian Høgsberg Robert Bragg Scott Moreau Tiago Vignatti Giovanni Campagna Jonas Ådahl Ray Strode Trevor McCort Rui Matos Axel Davy Jasper St. Pierre Signed-off-by: Kristian Høgsberg Reviewed-by: Axel Davy commit 3c34dd3603989c0365654ca1b6809395c7f3b169 Author: Keith Packard Date: Tue Apr 1 21:15:48 2014 -0700 glamor: Add glamor_program based poly_text and image_text Accelerates text painting with GPU-based geometry computation and stippling v2: Simplify get_glyphs, expand single character variable names to more descriptive ones. (Markus Wick) v3: Rebase against the glamor_prepare_* un-renaming (changes by anholt). Improves x11perf -f8text by 417.908% +/- 11.0144% (n=10) Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 5f700c3ac31db52f02f6ef11ea7823a8ce4f6f6f Author: Keith Packard Date: Tue Apr 1 21:15:47 2014 -0700 glamor: Use glamor_program for glamor_glyphblt This constructs suitable shaders using the glamor_program infrastructure for poly glyph blt, and then gets rid of the no-op wrapper of miImageGlyphBlt. Improves x11perf -f8text by 11.6221% +/- 1.04585% (n=10) Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 3411e8c538476443cafbb70082ef7457932e4a38 Author: Keith Packard Date: Tue Apr 1 21:15:46 2014 -0700 glamor: Add glamor_program based poly_fill_rect This accelerates poly_fill_rect using GPU-based geometry computation Improves x11perf -rect100 by 41.5127% +/- 7.63888% (n=10) Improves x11perf -rect10 by 3745.72% +/- 94.7503% (n=6) v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL 1.20 and GLES2 cases (changes by anholt). Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 0a6d31161811c422799d6f065ea2842d42707530 Author: Keith Packard Date: Tue Apr 1 21:15:45 2014 -0700 glamor: Add glamor_program based fill/set/get spans This accelerates spans operations using GPU-based geometry computation -wellipse500 goes from about 4k/sec before the patch, to ~8k/sec in the GLES2 fallback loop, to ~100k/sec in desktop mode. v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL 1.20 and GLES2 cases (changes by anholt). Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit d78c257f523908760c1b872cc4bef3d42eb31f50 Author: Keith Packard Date: Tue Apr 1 21:15:43 2014 -0700 glamor: Add simple upload/download functions in glamor_transfer These use glTexSubimage2D for upload and glReadPixels for download. There are a variety of interfaces to the basic function as needed by the callers. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt commit 693e6bea897e4c9473a9f22dd8b90df3437e04a1 Author: Keith Packard Date: Tue Apr 1 21:15:42 2014 -0700 glamor: Use plain GLSL 1.20 features for fill code. This prevents performance regressions from losing acceleration support on older hardware as we transition to using glamor_program.c for acceleration. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 5b76b3978d792c92b23a691204b473209782476e Author: Keith Packard Date: Tue Apr 1 21:15:42 2014 -0700 glamor: Compute supported GLSL version and save in screen private This currently computes the GLSL version in a fairly naïve fashion, and leaves that in the screen private for other users. This will let us update the version computation in one place later on. v2: Drop an accidental rebase-squashed hunk (change by anholt). Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 3c2c59eed3c68c0e5a93c38cf01eedad015e3157 Author: Keith Packard Date: Tue Apr 1 21:15:41 2014 -0700 fb: Publish fbGlyphs and fbUnrealizeGlyph This lets other code jump directly into the fb code for fallbacks Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 9dffcda804b2609f0b319d35dd47fd401d4fafce Author: Keith Packard Date: Tue Apr 1 20:54:22 2014 -0700 glamor: Bail from composite when pixmap cannot be uploaded I think the sense of the return value was just flipped here; if you return TRUE, then the calling code assumes that the pixmap *has* been uploaded and that an FBO is available. When it tries to use it, it crashes though. Returning false makes the caller bail back to software. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 15fec3bc3a2d29c903f35b5a30ac09e196eb36b1 Author: Keith Packard Date: Tue Apr 1 20:54:21 2014 -0700 glamor: Remove warning message when pixmap cannot be stored in a texture This happens when you have 4bpp pixmaps; it's not an error, so stop flooding the log file when it happens. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 5f177f3582323b6c1791e9e2c107548b607369de Author: Keith Packard Date: Tue Apr 1 20:54:20 2014 -0700 glamor: Public polyLines function is glamor_poly_lines_nf There was a spurious declaratoin in glamor.h for glamor_poly_line_nf Signed-off-by: Keith Packard Signed-off-by: Eric Anholt commit 6aac97198f60de9d4e415fb4fa2fc11cac6c6790 Author: Keith Packard Date: Tue Apr 1 20:54:19 2014 -0700 glamor: Initialize XV shaders from glamor_xv_init instead of glamor_init The glamor_init calls to glamor_init_xv_shader were never getting run because GLAMOR_XV was never defined. Instead of trying to make that work, fix glamor_xv_init to make the call instead. Further, just get rid of the glamor_fini_xv_shader function entirely as the shader program will be destroyed when the context is destroyed at server reset time. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 1707faf36d49a63efc462dfef133a555fe093832 Author: Keith Packard Date: Tue Apr 1 20:54:18 2014 -0700 glamor: SetWindowPixmap is not related to RENDER Move the configuration of screen->SetWindowPixmap out from under it. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 8d88b90953471ead3b480b6ae9d7280b8bd6b216 Author: Keith Packard Date: Tue Apr 1 20:54:15 2014 -0700 glamor: glamor_poly_point_nf cannot fail for non-DDX pixmaps All of the glamor _nf functions must check to see if the DDX can access the pixmap directly before returning failure back to the driver; this restructures the point code to split out the _nf checking from the _gl code. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit d5dd1d6371021c2aad94e33c5837ccd4bf9bf0f4 Author: Eric Anholt Date: Fri Mar 21 13:13:27 2014 -0700 Revert "glx: Make sure we get an FBConfig the root window's visual." This reverts commit b5a61239e2fef167c229154d7919ff862503e3f3. Not only did I screw up and introduce a warning, it turns out glXChooseFBConfig() explicitly ignores this attribute. Thanks, GLX. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 84f977467b514af88019ab2791bf7a74530b54df Merge: 9d20d18 9892471 Author: Keith Packard Date: Thu Apr 3 10:44:28 2014 -0700 Merge remote-tracking branch 'whot/for-keith' commit 98924719d524bf87cdf301063cd744d1271c33ff Author: Peter Hutterer Date: Wed Apr 2 13:55:10 2014 +1000 Revert "xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP" This was the wrong fix to the problem, and it triggered a change in XKB behavior: previously a button event would unlock a latched modifier, now it doesn't anymore. https://bugs.freedesktop.org/show_bug.cgi?id=73155 Note that the new behavior is is strictly spec compliant but we've had the other behavior for a long time so we shouldn't break it. The bug this patch originally fixed was a null-pointer dereference when releasing button events on server shutdown. This was addressed by the commit below, so the need for this patch has gone away anyway. 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 This reverts commit 2decff6393a44b56d80d53570718f95354fde454. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 9d65c515d83d2158b5949e249777ca2a02b31901 Author: Hans de Goede Date: Tue Apr 1 11:24:17 2014 +0200 xf86LogInit: log to XDG_DATA_HOME when not running as root When no logfile was specified (xf86LogFileFrom == X_DEFAULT) and we're not running as root log to $XDG_DATA_HOME/xorg/Xorg.#.log as Xorg won't be able to log to the default /var/log/... when it is not running as root. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit e738276e96590b2230dd9d9f5a3f9485f592e1e6 Author: Kristian Høgsberg Date: Mon Mar 31 18:04:07 2014 -0700 glamor: Expose glamor_destroy_pixmap() When we create a glamor pixmap by calling glamor_create_pixmap() directly, we need to call glamor_destroy_pixmap() to destroy it. Signed-off-by: Kristian Høgsberg Reviewed-by: Keith Packard commit d14803437582668f5ffea14071ea962b6b8e450d Author: Kristian Høgsberg Date: Mon Mar 31 18:00:54 2014 -0700 glamor: Add new GLAMOR_CREATE_PIXMAP_NO_TEXTURE pixmap create flag This flag lets a DDX allocate a glamor pixmap without allocating the texture that backs it. The DDX can then allocate the texture itself and then set it later. Signed-off-by: Kristian Høgsberg Reviewed-by: Keith Packard commit fe204185bc801bb17785dc8d1cde09d48b5e257f Author: Kristian Høgsberg Date: Mon Mar 31 17:59:18 2014 -0700 glamor: Move glamor_egl_screen_init() prototype to glamor.h A DDX that implements the glamor EGL functions need to pull in this prototype but shouldn't need to pull in glamor_priv.h Signed-off-by: Kristian Høgsberg Reviewed-by: Keith Packard commit 9ba2084321b1ac8d271feefee4f5b968d34226d6 Author: Kristian Høgsberg Date: Thu Mar 27 23:47:59 2014 -0700 dri3: Allow asynchronous implementation for dri3_open By passing the client pointer to the dri3_open implementation, we allow the clients to implement the open callback asynchronously. If the client ignore count is positive after returning from dri3_open, we assume that authentication is in progress and doesn't send the reply. The code to send the reply is moved into a helper function, which the implementation can call upon receiving its authenticaion reply. Signed-off-by: Kristian Høgsberg Reviewed-by: Keith Packard commit 4ba7b594464887ae68623e150348d90812eec36c Author: Kristian Høgsberg Date: Thu Mar 27 22:15:28 2014 -0700 composite: Add exception mechanism for implicit redirection policy Normally composite will decide to add implicit redirection when a window with an alternate visual is a parent of a window with a regular visual or vice versa. This uses extra pixmap memory and incurs an extra copy. This exception mechanism provides a way for a DDX to override this if the DDX knows that its acceleration architecture will render correctly. The relevant case is that of an RGB window reparented into a ARGB parent frame window. If the DDX knows that the acceleration architecture in use will pad the alpha channel to opaque when rendering to the RGB window, the implicit redirection can be avoided. This patch adds a new composite function: CompositeRegisterImplicitRedirectionException() which lets a DDX register a pair of parent and child window visuals, that will not be implicitly redirected even if the normal policy would have made that choice. Signed-off-by: Kristian Høgsberg Reviewed-by: Keith Packard commit 73698d41e41ce76bef2d9a90b46ac0c24ae148dd Author: Keith Packard Date: Mon Mar 31 23:55:25 2014 -0700 Make XYToWindow a screen function This allows DDXen to override the window picking to account for native windows not seen by the X server. The bulk of the picking logic is exposed as a new helper function, miSpriteTrace(). This function completes the sprite trace filled out by the caller, and can be set up to start the search from a given toplevel window. v2: Leave existing XYToWindow API in place for API compatibility Signed-off-by: Keith Packard Reviewed-by: Kristian Høgsberg commit f37a46913489397d8628ffe578c8d4ed50b6ca72 Author: Hans de Goede Date: Wed Mar 26 12:24:49 2014 +0100 configure: Change DEFAULT_LOGPREFIX to really be a filename prefix Rather then a full path prefix, this is a preparation patch for adding support for logging to another location when not running as root. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 9d20d18fb9dcc74bfa5392a2da40fd41b3e640d3 Merge: 8468e24 bc348bd Author: Keith Packard Date: Mon Mar 31 23:24:56 2014 -0700 Merge remote-tracking branch 'jturney/master' commit 8468e24430988058b150dc1daef3aad6ba9fa698 Author: Adam Jackson Date: Thu Mar 27 11:48:39 2014 -0400 mi: Hush extension initialization (#75870) Printing these as ErrorF is fairly obnoxious, since it means the non-hardware servers now spew stuff to the console for entirely routine events. And actually, printing these at all is fairly obnoxious, since a) we're printing a line for every extension, whether it's enabled or not, and b) we're not actually initializing the extension at this point. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit a2880699e8f1f576e1a48ebf25e8982463323f84 Author: Keith Packard Date: Tue Mar 25 08:21:16 2014 -0700 fb: fix fast-path blt detection The width parameter is used to disable the blit fast-path (memcpy) when source and destination rows overlap in memory. This check was added in [0]. Unfortunately, the calculation to determine if source and destination lines overlapped was incorrect: (1) it converts width from pixels to bytes, but width is actually in bits, not pixels. (2) it adds this byte offset to dst/srcLine, which implicitly converts the offset from bytes to sizeof(FbBits). Fix both of these by converting addresses to byte pointers and width to bytes and doing comparisons on the resulting byte address. For example: A 32-bpp 1366 pixel-wide row will have width = 1366 * 32 = 43712 bits bpp = 32 (bpp >> 3) = 4 width * (bpp >> 3) = 174848 FbBits (FbBits *)width => 699392 bytes So, "careful" was true if the destination line was within 699392 bytes, instead of just within its 1366 * 4 = 5464 byte row. This bug causes us to take the slow path for large non-overlapping rows that are "close" in memory. As a data point, XGetImage(1366x768) on my ARM chromebook was taking ~140 ms, but with this fixed, it now takes about 60 ms. XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt() [0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce Author: Adam Jackson Date: Thu Apr 21 16:37:11 2011 -0400 fb: Fix memcpy abuse The memcpy fast path implicitly assumes that the copy walks left-to-right. That's not something memcpy guarantees, and newer glibc on some processors will indeed break that assumption. Since we walk a line at a time, check the source and destination against the width of the blit to determine whether we can be sloppy enough to allow memcpy. (Having done this, we can remove the check for !reverse as well.) v3: Convert to byte units This first checks to make sure the blt is byte aligned, converts all of the data to byte units and then compares for byte address range overlap between source and dest. Signed-off-by: Keith Packard Reviewed-by: Daniel Kurtz commit bc348bd2c42f3f18786085ccef2f010eff5bf3d2 Author: Jon TURNEY Date: Mon Mar 11 14:34:32 2013 +0000 Handle -displayfd and an explicit display number sensibly Handle -displayfd and an explicit display number sensibly, e.g. use the explicitly specified display number, and write it to the displayfd v2: displayfd might be 0, so use -1 as invalid value v3: Rebase for addition of NoListenAll flag Signed-off-by: Jon TURNEY Reviewed-by: Kristian Høgsberg commit a3730271d52542757ec0f41acc29e7730501f666 Author: Jon TURNEY Date: Mon Mar 24 17:32:10 2014 +0000 Fix build when configured --enable-debug Include os.h for ErrorF() to fix implicit-function-declaration warnings when configured with --enable-debug. hw/xfree86/parser/DRI.c: In function 'xf86parseDRISection': hw/xfree86/parser/DRI.c:87:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration] hw/xfree86/parser/Extensions.c: In function 'xf86parseExtensionsSection': hw/xfree86/parser/Extensions.c:77:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration] Signed-off-by: Jon TURNEY Reviewed-by: Julien Cristau commit 5870bd398d6073938d821c060eccf24adc07a2f1 Author: Jon TURNEY Date: Mon Mar 24 17:32:09 2014 +0000 Fix ephyr build with --disable-glamor See http://tinderbox.x.org/builds/2014-03-23-0010/logs/xserver/#build Signed-off-by: Jon TURNEY Tested-by: Julien Cristau Reviewed-by: Julien Cristau commit 432fc37e2ca833f1ec3cb614cbdc3a7ae13f22b7 Author: Jon TURNEY Date: Mon Feb 24 20:45:51 2014 +0000 Build fbcmap_mi.c once, rather than once for each DDX Build fbcmap_mi.c once, rather than once for each DDX, and make it part of libfb or libwfb convenience library. Since 84e8de1271bb11b5b4b9747ae4647f47333a8ab7 we don't have fbcmap.c This is a sort of revert of 17d85387d1e6851d35474b65929e268ca64ef65b v2: Remove libkdrivestubs.la from configure.ac Signed-off-by: Jon TURNEY Reviewed-by: Gaetan Nadon commit f23dd02b969089b66685f70887f19041049f7a24 Author: Jon TURNEY Date: Fri Feb 21 18:11:33 2014 +0000 Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it Signed-off-by: Jon TURNEY Reviewed-by: Gaetan Nadon commit 45b223e1c2bdc447263a9de7af62c93f4058c33c Author: Jon TURNEY Date: Wed Sep 7 12:50:20 2011 +0100 Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it Signed-off-by: Jon TURNEY Reviewed-by: Gaetan Nadon commit 7b2a517ba99f6756e98c4aef47d9b9399b997157 Author: Julien Cristau Date: Wed Mar 26 23:24:20 2014 +0100 Xephyr: restore initial window resize lost in xcb conversion The XResizeWindow call wasn't replaced by the xcb equivalent, so we were no longer setting the initial window size, only wm size hints. Regression from commit a2b73da "Xephyr: start converting hostx.c over to xcb" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74849 Signed-off-by: Julien Cristau Reported-by: Laércio de Sousa Tested-by: Jon TURNEY Reviewed-by: Jon TURNEY Signed-off-by: Keith Packard commit 1b5d7e78460ed686ba2da398dab341d4867fd4a0 Author: Keith Packard Date: Wed Mar 12 14:35:27 2014 -0700 glamor: Add glamor_program PolyPoint implementation This accelerates poly point when possible by off-loading all geometry computation to the GPU. Improves x11perf -dot performance by 28109.5% +/- 1022.01% (n=3) Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 72a4beff6d3aed767df9a30bca0c1d860715928f Author: Keith Packard Date: Sat Mar 22 15:20:49 2014 -0700 glamor: Move glamor_poly_segment to separate glamor_segment.c file There's no reason to mix PolyPoint and PolySegment in the same file. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-off-by: Eric Anholt commit 029b64c30a8bdf87edfdb1c988f4e8dcee1bb4ef Author: Keith Packard Date: Wed Mar 12 14:27:59 2014 -0700 glamor: Add infrastructure for generating shaders on the fly This just adds a bunch of support code to construct shaders from 'facets', which bundle attributes needed for each layer of the rendering system. At this point, that includes only the primitive and the fill stuff. v2: Correct comment in glamor transform about 1/2 pixel correction needed for GL_POINT. (Eric Anholt) v3: Rebase on Markus's cleanups (change by anholt) Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 0ca7223742e9ec0594203b3a99b11441730cca1a Author: Keith Packard Date: Thu Mar 13 23:12:27 2014 -0700 glamor: Add helper functions to walk pixmap tiling This adds a few helper functions to make pixmap fbo access symmetrical between the single fbo and tiled cases. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Signed-off-by: Eric Anholt commit 209d004469391420130262059af43a813b2c07d7 Author: Keith Packard Date: Thu Mar 13 23:11:40 2014 -0700 glamor: Add bounding box to one-fbo pixmaps This lets code treat the one-fbo pixmaps more symmetrically with the tiled pixmaps. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Signed-off-by: Eric Anholt commit 82f91433e277e3711678c1b16be85e89b6c7d530 Author: Keith Packard Date: Tue Mar 18 21:23:24 2014 -0700 glamor: Get testing code using small FBOs working again Glamor has a mode where pixmaps will be constructed from numerous small FBOs. This allows testing of the tiled pixmap code without needing to create huge pixmaps. However, the render glyph code assumed that it could create a pixmap large enough for the glyph atlas. Instead of attempting to fix that (which would be disruptive and not helpful), I've added a new pixmap creation usage, GLAMOR_CREATE_NO_LARGE which forces allocation of a single large FBO. Now that we have pixmaps with varying FBO sizes, I then went around and fixed the few places using the global FBO max size and replaced that with the per-pixmap FBO tiling sizes, which were already present in each large pixmap. Xephyr has been changed to pass GLAMOR_CREATE_NO_LARGE when it creates the screen pixmap as it doesn't want to deal with tiling either. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 11e2f0de71fa341f8b0b1da0a1b9ccbfa6550a50 Author: Keith Packard Date: Tue Mar 18 21:35:41 2014 -0700 mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines The X server still has 'unsigned long' in a few places to hold 32 bit values. One of those is in miPutImage where it's holding the temporary planemask for XYPixmap format images. It computed the highest plane in the source image with 1 << (depth - 1). On 64-bit machines, taking that value and storing it in an unsigned long promotes it to a signed 64-bit value (0xffffffff80000000). Then, it loops over that value, shifting one bit right each time, waiting for it to go to zero.. That takes 64 iterations, and ends up with some mystic planemask values *and* walking off the end of the source image data and out into space. A simple cast is all that is required to compute the correct initial plane mask (0x0000000080000000), at which point the loop operates correctly once again. Checking the fbPutImage code, I note that this same bug was fixed in 2006 by Aaron Plattner in commit f39fd4242902eaa862321d39337f429dd14ebacf Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-by: Aaron Plattner commit ae87b536155207e6e28b68963593a7ab09792e08 Author: Keith Packard Date: Sat Mar 15 23:53:53 2014 -0700 dix: Allow NULL stipple in ChangeGC miOpqStipDrawable resets the stipple after painting. When that stipple was NULL, ChangeGC needs to handle that and not crash. Signed-off-by: Keith Packard Signed-off-by: Eric Anholt Reviewed-off-by: Eric Anholt commit 2e040f41de18f4d46e649561b6efb043195fdfbe Author: Markus Wick Date: Tue Mar 18 09:42:55 2014 +0100 glamor: Drop feature dependent optimization on startup. We don't care that much about startup time to write different code paths... Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 2e75d974bcfdd879d7417cc02892b78eaea5e888 Author: Markus Wick Date: Tue Mar 18 09:42:54 2014 +0100 glamor: Remove unneeded unbindings. They are already cleared in glamor_put_vbo_space. Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 7c4e1472966d9d3d6432621c3114f491a5378604 Author: Markus Wick Date: Tue Mar 18 09:42:53 2014 +0100 glamor: Always keep GL_ELEMENT_ARRAY_BUFFER bound to the same IB. We never used glDrawElements() with a different index buffer. Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 82168b1e6ede48898be8a64b1c93b7d82ef65702 Author: Markus Wick Date: Tue Mar 18 09:42:52 2014 +0100 glamor: Select VBO path by ARB_mbr extension. The mbr path was hard coded enabled for desktop gl and disabled for gles. But there are both desktop without mbr and GLES with mbr. v2: Don't forget to update the fini path, too (change by anholt) Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 53df6e8c3bd7025883b9614a549fbf268c110b74 Author: Markus Wick Date: Tue Mar 18 09:42:51 2014 +0100 glamor: Update GL requirements to 2.1. We will never ever run on OpenGL 1.2 as we use shaders everywhere. 2.0 may be enough, but we also often use PBOs and our big shaders won't fit into the first GLSL limits. Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 15d36444acc7a2890ade8e320dc16d627a9d2035 Author: Markus Wick Date: Tue Mar 18 09:42:50 2014 +0100 glamor: Use epoxy_gl_version() instead of rolling our own. Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 9d87f66e862a521553d48aa73e5ee97431d36ad3 Author: Markus Wick Date: Tue Mar 18 09:42:49 2014 +0100 glamor: Use epoxy_has_gl_extension() instead of rolling our own. Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 708fe0625f31ad39ba54f27f04d17ed2aa621cad Author: Markus Wick Date: Tue Mar 18 09:42:48 2014 +0100 glamor: Use glsl "fract/mod" instead of "while" in gradient shaders. This fixes gtkperf. It seemed to hang forever. Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 84ff8960722fa9baf6ad70756b9c335bf2a5e515 Author: Eric Anholt Date: Tue Mar 18 09:42:47 2014 +0100 kdrive: Remove duplicated definitions of some XV-related structs. v2: Fix crash because of removed strdup. (by Markus Wick) Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt (v2) commit 370c8c75ca6aebb5d93d2ab87c9c8ffac21fc57d Author: Gaetan Nadon Date: Wed Mar 19 11:28:57 2014 -0400 xfree86: glamor_egl subdir must be distributed - breaks distcheck Signed-off-by: Gaetan Nadon Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 870bbf85e63a59f252f3ea9d63e28f083359d990 Author: Gaetan Nadon Date: Wed Mar 19 14:17:15 2014 -0400 ephyr: typo where "()" should be "$()" in the Makefile - breaks make dist make[3]: Entering directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr' make[3]: *** No rule to make target `()', needed by `distdir'. Stop. make[3]: Leaving directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr' make[2]: *** [distdir] Error 1 Signed-off-by: Gaetan Nadon Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit dc48bd653c7e1013e2d69e3f59ae3cbc0c893473 Author: Hans de Goede Date: Mon Mar 24 16:32:01 2014 +0100 systemd-logind: Monitor systemd-logind going away When we're using server managed-fds through systemd-logind, systemd-logind *must* keep running while we are using it, as it does things like drmSetMaster and drmDropMaster for us on vt-switch. On a systemd-logind restart, we cannot simply re-connect since we will then get a different fd for the /dev/dri/card# node, and we've tied a lot of state to the old fd. I've discussed this with the systemd people, and in the future there may be a restart mechanism were systemd-logind passed fds from the old logind to the new logind. But for now there answer is simply: "Don't restart systemd-logind", and there never really is a good reason to restart it. So to ensure unpleasentness if people do decide to restart systemd-logind anyways (or when it crashes), monitor logind going away and make this a fatal error. This avoids getting a hard-hung machine on the next vt-switch and will hopefully quickly educate users to not restart systemd-logind while they have an X session using it active. Signed-off-by: Hans de Goede Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit c0d3a13e7ee42be26d6d1923c9f3ae0355497869 Author: Hans de Goede Date: Mon Mar 24 16:31:59 2014 +0100 Buildsys: Create SUID_WRAPPER_DIR before using it Signed-off-by: Hans de Goede Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 6289f71494453d34614b7ff1238840681c2472af Author: Gaetan Nadon Date: Tue Mar 25 14:00:13 2014 -0400 suid: adding Xorg.sh.in to EXTRA_DIST is redundant All files specified in AC_CONFIG_FILES get distributed automatically. Signed-off-by: Gaetan Nadon Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit b82ef51509bf24e8eafeb615a3e2f4fcd559554e Author: Gaetan Nadon Date: Tue Mar 25 13:49:02 2014 -0400 suid: add generated Xorg.sh to hw/xfree86/.gitignore Signed-off-by: Gaetan Nadon Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit ca8f26f63694c27fa488a3b58ea6f00b7dd50f81 Author: Gaetan Nadon Date: Tue Mar 25 13:48:52 2014 -0400 suid: replace deprecated AC_HELP_STRING with AS_HELP_STRING Fixes automake warning. Signed-off-by: Gaetan Nadon Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit bda6fdc71c25b0c3f3747f445103a1995a5713f4 Merge: e46820f 78167a9 Author: Keith Packard Date: Tue Mar 25 16:06:03 2014 -0700 Merge remote-tracking branch 'whot/for-keith' commit e46820fb897600800b5f3297a59039556774e9c5 Author: Emil Velikov Date: Thu Sep 26 20:28:37 2013 +0100 miinitext: introduce LoadExtensionList() to replace over LoadExtension() Looping around LoadExtension() meant that ExtensionModuleList was reallocated on every extension. Using LoadExtensionList() we pass an array thus the function can do the reallocation in one go, and then loop and setup the ExtensionModuleList. Signed-off-by: Emil Velikov Reviewed-by: Keith Packard v2: Update ephyr [Keith Packard] v3: Eliminate const warnings in LoadExtensionList [Keith Packard] Signed-off-by: Keith Packard commit 78167a98a8631ee3fad145ddc051ceb8487b9683 Author: Adam Jackson Date: Fri Nov 8 09:44:24 2013 -0500 xkb: Restore XkbCopyDeviceKeymap Removed in d35a02a767017f13db4bd4742eef49293d5a30ea, tigervnc 1.2.80 and xf86-video-nested need it for now. Signed-off-by: Adam Jackson Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 215f3d2e0f2a4ef6fc2f2c08fb991e1f00b747c8 Author: Kristian Høgsberg Date: Wed Mar 19 20:46:41 2014 -0700 os: Add AddClientOnOpenFD() to create a new client for an file descriptor When the Xwayland server is socket-activated, we need to connect and initialize the window manager before the activating client gets to proceed with connecting. We do this by passing a socket file descriptor for the window manager connection to the Xwayland server, which then uses this new function to set it up as an X client. Signed-off-by: Kristian Høgsberg Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit d415b9d69fdaab4ce3fc05d3d26b2d8413403aa4 Author: Emil Velikov Date: Thu Sep 26 20:16:31 2013 +0100 miinitext: avoid allocating a sentinel ExtensionModule With all the logic now in place there is no need to allocate a separate ExtensionModule to be used as a sentinel. Signed-off-by: Emil Velikov Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit b421ac8e026f464fdba2082aaedc00c19fb8b6c7 Author: Emil Velikov Date: Thu Sep 26 20:11:40 2013 +0100 miinitext: constify staticExtensions The array is readonly and should not be tampered with. Signed-off-by: Emil Velikov Reviewed-by: Keith Packard commit 5ff34b5a0b3b333bf0f0334717cc8630cc785510 Author: Emil Velikov Date: Thu Sep 26 20:08:56 2013 +0100 miinitext: drop sentinel detection during LoadExtension All the sentinels from the extension lists were removed, thus the only case were this would trigger is when the code is broken badly. Signed-off-by: Emil Velikov Reviewed-by: Keith Packard commit 6fea450d41a03d32c10c7da162dfaadd8ead4ece Author: Emil Velikov Date: Thu Sep 26 20:08:16 2013 +0100 miinitext: move AddStaticExtensions() to LoadExtension() Separate the function from NewExtensionModule() as the former does only memory reallocation. No functional change. Signed-off-by: Emil Velikov Reviewed-by: Keith Packard commit bf087659f0fb747c471e26c5b287c35877818040 Author: Alan Coopersmith Date: Sat Mar 22 14:30:04 2014 -0700 Add necessary headers for major()/minor() on Solaris to xf86Xinput.c Without these, after commit fdb4ec86c29d85c, it fails to build on Solaris, with errors of: xf86Xinput.c: In function 'xf86stat': xf86Xinput.c:816:5: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration] xf86Xinput.c:817:5: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit d9fdae5f4a648a10653e18dbc602646f3e22e522 Merge: 99bee6c 0e5d299 Author: Keith Packard Date: Sat Mar 22 14:09:00 2014 -0700 Merge remote-tracking branch 'jturney/master' commit 99bee6c0549b36ef15f625bab3997cbd70c7b879 Author: Gaetan Nadon Date: Fri Jan 17 09:54:01 2014 -0500 Default font path: remove the check for ${sysconfdir}/X11/fontpath.d The location ${sysconfdir}/X11/fontpath.d is unknown at configuration time (only at make time) as evidenced by the configuration output: checking for ${prefix}/etc/X11/fontpath.d... no Unlike font-util for the X fonts, there is no mechanism to query where fontpath.d is. Fedora have chosen /etc/X11 and others have followed, but this is not a standard. It might also be installed at another location, it may or may not be under the xserver installation prefix. We just don't know. Debian does not use this at all. Distros are using --with-default-path when they support fontpath.d, so they never relied on the server default as it never worked. The patch essentially is a noop, which leaves the door open for anyone who could potentially provide a reliable implementation of choosing fontpath.d when applicable. Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 1782316744866a181ed92486bb4dca6ac46d40bd Merge: 4fb31e4 2b77b20 Author: Keith Packard Date: Sat Mar 22 13:46:15 2014 -0700 Merge remote-tracking branch 'jwrdecoede/for-keith' commit 0e5d2996ac872aca5995897fc518bdf9116bd246 Author: Jon TURNEY Date: Wed Sep 11 13:36:18 2013 +0100 hw/xwin: Fix WM_ENDSESSION crash on x86_64 We need to include xwin-config.h into winmsgwindow.c, so that _XSERVER64 is defined, so that the layout of ScreenRec type is correct, so that it's privates can be accessed correctly, so that the WM_GIVEUP message can be sent to the screen window. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 896b53ffa72d91d7d604967028291525562b60dd Author: Jon TURNEY Date: Sun Jun 16 13:55:51 2013 +0100 hw/xwin: Improve NET_WM_ICON validation Check that we don't overrun the end of the property data while converting icons See http://cygwin.com/ml/cygwin-xfree/2013-06/msg00040.html for testcase. Also, some warning fixes in winXIconToHICON() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit ab61d070024a4776f011e71d762d4c6c0cf58b12 Author: Jon TURNEY Date: Sun Mar 31 18:29:07 2013 +0100 hw/xwin: Remove obsolete control handling for About dialog Remove the unused, cygwin-specific handling for ChangeLog, UG and CG buttons in the About... Dialog. The buttons themselves were removed in commmit 34269a90ea2087f883f5dc8805894fc4998e4b81. Also remove those window control IDs which are now obsolete. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 3b4d472b72601922bac264283eb6b611d8d524fc Author: Oliver Schmidt Date: Wed Sep 7 14:00:56 2011 +0100 hw/xwin: Minimize redraw events after resizing/moving windows in multiwindow mode In multiwindow mode the modal moving/resizing of windows causes a lot of redraw events to be sent to the X clients after the user releases the mouse button. During the moving/resizing client windows are not redrawn as long as the mouse button is pressed, but all redraw/resizing events are queued and executed step after step after the moving/resizing ends. Some clients collect and combine multiple redraw or resizing events, other clients (e.g. xterm) simply execute each redraw or sizing event. The enclosed patch minimizes the events for clients to only one event after the user releases the mouse button to end the moving/resizing. This improves the user experience and reduces strange screen flickerings, especially on slow platforms. The enclosed patch modifies winmultiwindowwndproc.c such that the windows events WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE that are sent by Windows when the modal window resizing/moving begins or ends are considered. Only after WM_EXITSIZEMOVE is the redraw/resizing executed. Signed-off-by: Oliver Schmidt Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 03e1cc6f250a3f5cf17b34639adbbc9850c681cd Author: Jon TURNEY Date: Mon Nov 7 20:54:10 2011 +0000 hw/xwin: Add '@' to window name when it's useful to do so Enhance GetWindowName() so it appends the result of XGetWMClientMachine() when it is available and useful to do so Add -hostintitle option to control this behaviour. Add documentation for this option to man page and -help text. Also, fix warning in UpdateName() v2: Provide a HOST_NAME_MAX definition for MinGW v3: Use '@host' rather than ' (on host)'. Don't add host if it's already in the title. Signed-off-by: Jon TURNEY Reviewed-by: Yaakov Selkowitz Reviewed-by: Colin Harrison commit 6804acfe4fabc8ff8491bbc7edb6260440d3d4d3 Author: Colin Harrison Date: Fri Mar 14 15:44:54 2014 +0000 hw/xwin: Remove prototype for non-existent winMWExtWMUpdateIcon() winMWExtWMUpdateIcon() was removed in commit 527cf13135cfd279733060e0028bbfbe02be5167 Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 7fb5d765ba1e28eb775b847cef3d6079eba3bac1 Author: Colin Harrison Date: Fri Mar 14 15:40:43 2014 +0000 hw/xwin: Use AllocDevicePair() Use AllocDevicePair() rather than allocating Windows keyboard and pointer devices individually. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 061e5eba00a9a0dc27ff76946dc5f77004fc6a56 Author: Colin Harrison Date: Fri Mar 14 15:36:59 2014 +0000 hw/xwin: Consistently use 'L' for long int constants Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 46df614784cbbffcf6368859285e949010f1ceb8 Author: Colin Harrison Date: Fri Mar 14 15:36:24 2014 +0000 hw/xwin: Remove an unneeded include Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit d48749492dc492fd7430ffdfd29842153618f778 Author: Colin Harrison Date: Fri Mar 14 15:34:04 2014 +0000 hw/xwin: Use boolean AND rather than bitwise AND in WIN_POLLING_MOUSE_TIMER_ID For clarity, use boolean AND rather than bitwise AND in WIN_POLLING_MOUSE_TIMER_ID processing. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 80ac4a85d56130d09bbc72ed071759a361ded689 Author: Colin Harrison Date: Fri Mar 14 15:23:16 2014 +0000 hw/xwin: Fix declaration after statement warning in ddxGiveUp() Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit cf59f4888e202c6a68176bd3de1f837ca8480370 Author: Colin Harrison Date: Fri Mar 14 15:09:24 2014 +0000 hw/xwin: Fix typo in comment Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 561bca469d3ade1ff14faddaf70bf12dcdc6aa74 Author: Jon TURNEY Date: Thu Mar 13 22:38:43 2014 +0000 hw/xwin: Fix const discarded warning in winGenerateAuthorization() Fix const discarded warning in winGenerateAuthorization() in !XCSECURITY case In function ‘winGenerateAuthorization’: hw/xwin/winauth.c:123:38: warning: passing argument 2 of ‘GenerateAuthorization’ discards ‘const’ qualifier from pointer target type [enabled by default] hw/xwin/winauth.c:99:1: note: expected ‘char *’ but argument is of type ‘const char *’ Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 44fe1b8ea284df6bbaef67e246016d104665b2fe Author: Kristian Høgsberg Date: Wed Mar 19 14:03:13 2014 -0700 os: Add a mechanism to prevent creating any listen sockets A socket-activated server will receive its listening sockets from the parent process and should not create its own sockets. This patch introduces a NoListen flag that can be set by a DDX to prevent the server from creating the sockets. When NoListen is enabled, we also disable the server lock checking, since the parent process is responsible for checking the lock before picking the display name and creating the sockets. Signed-off-by: Kristian Høgsberg Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 62d584d63190c6c8cef5fd49d87b1cb29358a434 Author: Kristian Høgsberg Date: Tue Mar 18 22:05:58 2014 -0700 os: Always compile ListenOnOpenFD() and export it This function was written to allow the X server to inherit the listen socket from launchd on OS X. The code is not specific to OS X though and will be useful for on-demand launched Xwayland servers. Signed-off-by: Kristian Høgsberg Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 797781c7bfd7a0df354fb85aa73df4560828b90b Author: Kristian Høgsberg Date: Wed Mar 19 10:27:39 2014 -0700 test: Don't add TEST_LDADD to list test The list test case is always enabled, even if Xorg is disabled. TEST_LDADD pulls in Xorg files which breaks linking when Xorg is disabled. The list test doesn't need any libraries, so just remove list_LDADD. Signed-off-by: Kristian Høgsberg Cc: Peter Hutterer Signed-off-by: Peter Hutterer commit 4fb31e4824d46edc80bb49b4065152899faa5ac6 Merge: d18d3f6 0e531fb Author: Keith Packard Date: Wed Mar 19 06:43:14 2014 -0700 Merge remote-tracking branch 'whot/for-keith' commit 0e531fbb97868b9a869044fc5a4f6cb58de6751e Author: Kristian Høgsberg Date: Wed Mar 12 16:31:25 2014 +1000 xkb: add XkbLoadKeymapFromString Signed-off-by: Peter Hutterer Reviewed-by: Kristian Høgsberg commit d18d3f6d18aa7827748f7ba14efd405b525883d0 Merge: 81a4952 6649d00 Author: Keith Packard Date: Mon Mar 17 17:29:56 2014 -0700 Merge remote-tracking branch 'anholt/glamor-megaseries' commit 6649d0059e1bc136b84a9e457ae81c07521fadc0 Author: Michel Dänzer Date: Mon Mar 17 13:16:48 2014 +0900 glamor: Move up glamor_priv->flags assignment in glamor_init() It wasn't assigned yet when it was tested for GLAMOR_NO_DRI3. Signed-off-by: Michel Dänzer Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit b5a61239e2fef167c229154d7919ff862503e3f3 Author: Eric Anholt Date: Fri Mar 14 13:10:04 2014 -0700 glx: Make sure we get an FBConfig the root window's visual. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 9999a660135fafe5f1fdf9452e5ca74ffb069dc2 Author: Markus Wick Date: Thu Mar 13 11:17:39 2014 +0100 glamor: don't reset the GLSL program We don't use fixed function rendering, so there is no need to reset the program at all. This lets the driver avoid checking for state changes between draw calls when we rebind the same program. Improves xephyr x11perf -f8text performance by 6.03062% +/- 1.64928% (n=20) Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit aa2635b804e7d28322f62d802190bdf0bb799634 Author: Markus Wick Date: Thu Mar 13 00:24:04 2014 +0100 glamor: remove disabled code This block was disabled since 2011, so there is likely no need to keep it any more. Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 6227f07b69b8ab3cd39cf9d257daf2a7202b4ef5 Author: Alan Coopersmith Date: Tue Mar 11 17:28:10 2014 -0700 Remove duplicate assignment of repeat_type_uniform_location Flagged by cppcheck 1.64: [glamor/glamor_gradient.c:987] -> [glamor/glamor_gradient.c:991]: (performance) Variable 'repeat_type_uniform_location' is reassigned a value before the old one has been used. Signed-off-by: Alan Coopersmith Reviewed-by: Eric Anholt Signed-off-by: Eric Anholt commit 1a4b24993974200e26345ea6c501d4aa093169db Author: Eric Anholt Date: Thu Feb 20 15:50:03 2014 -0800 glamor: Apply debug labels to our shaders. This will help tools like fips, apitrace, or INTEL_DEBUG=shader_time provide useful information about the shaders in use. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit d07d2c3c5f95fd644ef563004dfa7f3c53904168 Author: Eric Anholt Date: Sat Jan 11 21:26:01 2014 -0800 glamor: Don't forget to unmap our PBOs before using them to upload. From the GL_ARB_vertex_buffer_object spec: After the client has specified the contents of a mapped data store, and before the data in that store are dereferenced by any GL commands, the mapping must be relinquished by calling boolean UnmapBufferARB(enum target); Our mappings were only getting reaped at PBO destroy time, after the upload. If the GL implementation wasn't coherent, it would have used stale data to do the texture upload. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 64146e4560fdf3c3a40d023ac8e22259915b05ad Author: Eric Anholt Date: Sat Jan 11 21:11:18 2014 -0800 glamor: Add an assert about an invariant the upload code relies on. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 7eb2bafe22dcc90c2fb94d2d9cae370b683dba7c Author: Eric Anholt Date: Fri Jan 10 15:54:25 2014 +0800 glamor: Fix ignoring the ALU during SetSpans(). Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 923c8db7ed1adfe4689f0a36496262faca44b79d Author: Eric Anholt Date: Thu Jan 9 11:36:30 2014 +0800 glamor: Improve the performance of line fallbacks. If the lines aren't solid-filled vert/horiz solid-filled rectangles, we fall back. libreoffice has some diagonal lines, and the performance of the fallback path was atrocious. Just fall back to mi's spans instead, so that we don't do an upload/download. Improves x11perf -seg100 by 863.652% +/- 9.8968% (n=5) Signed-off-by: Eric Anholt commit b6953045566dae15437d4220e68986db7a6b4ca7 Author: Eric Anholt Date: Thu Jan 9 10:53:04 2014 +0800 glamor: Improve the performance of PolyGlyphBlt. Using the same idea as the previous PushPixels code, just make points for each point in the glyph. This is an advantage over the pushpixels fallback because we can batch the BO mappings and draw calls across glyphs. Improves performance of x11perf -f8text by 773.389% +/- 3.50754% (n=10). Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit b885a639144cdadcb0dae8249a168db158770604 Author: Eric Anholt Date: Sun Jan 5 21:54:48 2014 +0800 glamor: Improve the performance of PushPixels by, well, pushing pixels. Otherwise, mi will fall back to GetSpans()ing the bitmap, walking the bitmap, computing spans to be filled, and calling FillSpans(). Improves x11perf -f8text by 759.373% +/- 3.33096% (n=166) Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit ab68982dcc53d29d5e3c5ea092bd91dab09e54c9 Author: Eric Anholt Date: Sat Jan 11 00:06:21 2014 +0800 glamor: Add missing prepares on the GC during fb fallbacks. We had regressions in CopyPlane reported by xts5, because we were (successfully!) dereferencing the null pixmap->devPrivate.ptr for a tile or stipple without having done a prepare. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 93f1824a0b19346f0e1759bedfa9cf10772067af Author: Eric Anholt Date: Sat Jan 11 00:00:00 2014 +0800 glamor: Rely on nested mappings to handle src==dst and !prepare bugs. Now that the core deals with that for us, we can avoid all this extra carefulness. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 4c9a20072552c52b3763bd73e7a7e9b9cb8b4993 Author: Eric Anholt Date: Fri Jan 10 23:43:09 2014 +0800 glamor: Allow nested mapping of pixmaps. The common pattern is to do nested if statements making calls to prepare_access() and then pop those mappings back off in each set of braces. Some cases checked for src == dst to avoid leaking mappings, but others didn't. Others didn't even do the nested mappings, so a failure in the outer map would result in trying to umap the inner and failing. By allowing nested mappings, we can fix both problems by not requiring the care from the caller, plus we can allow a simpler nesting of all the prepares in one if statement. v2: Add a comment about nested unmap behavior, and just reuse the glamor_access_t enum. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit d86eacedab443f172baccf544d17e09090f71f3c Author: Eric Anholt Date: Fri Jan 10 23:39:02 2014 +0800 glamor: Drop unused GLAMOR_ACCESS_WO. Nothing was using it, and it was going to complicate the glamor_prepare_access bugfixing I'm going to do next. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit c36b903f240664f7222cfefc480e60fca936de6a Author: Eric Anholt Date: Thu Mar 13 10:09:08 2014 -0700 glamor: Drop stale comment. The old Xephyr codebase was using the GL window system framebuffer for the screen pixmap, but that meant you couldn't texture from it to do operations sourcing from the screen, so in the version that landed I instead had the screen just be a plain texture. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit f7cd1189d068471373f51d932c558f8151182d58 Author: Eric Anholt Date: Fri Jan 10 22:42:02 2014 +0800 glamor: Replace some goofy enum-likes with a real enum. This unpacks the bitfield into an int size, but my experience has been that packing bitfields doesn't matter for performance. v2: Convert more comparisons against numbers or implicit bool comparisons to comparisons against the enum names, and fix up some comments. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 575e3e1bf08c418430da86228d2774e8fda4b8c0 Author: Eric Anholt Date: Mon Jan 6 07:22:47 2014 +0800 glamor: Fix up doxygen for glamor_fill.c. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 53996e252e51c8053537f485616a078cb7b0f738 Author: Eric Anholt Date: Mon Jan 6 07:05:02 2014 +0800 glamor: Rename more solid fill variables to clean up the code. Now the error path of allocation is more obvious: We leave things in the a-few-boxes-at-a-time stack memory state. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit ec3ab2f67baa00326a4964ed2047e8a137915578 Author: Eric Anholt Date: Mon Jan 6 07:01:17 2014 +0800 glamor: Rename a variable to be more descriptive. The "valid_" prefix was used above to describe our allocation that gets reused multiple times, which is totally unrelated. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 01e30d2043f5df104947908f14a377dc77896a98 Author: Eric Anholt Date: Mon Jan 6 06:55:15 2014 +0800 glamor: Fix some integer overflow errors. Imagine a nbox that was (UINT_MAX + small number) / (4 * 2 * sizeof(float)). We'd malloc a few bytes after the integer overflow, but glamor_set_normalize_vcoords would write over gigabytes of heap. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 20bcda977755559294c3a951f80af2ec861595fc Author: Eric Anholt Date: Mon Jan 6 06:53:46 2014 +0800 glamor: Drop bogus _X_UNLIKELY. nbox > 4 is actually quite common for spans handling. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit ad3dd80720676dcdc11ab5db63ccbed7c9509d7e Author: Eric Anholt Date: Mon Jan 6 06:52:32 2014 +0800 glamor: Fix stack overflow in glamor_solid vertex handling. ARRAY_SIZE(vertices) is 32 (floating point values), so we need to divide by the number of floats in a box like we do in the overflow case below. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit d036d22a95b8516a817dd4fa4dd35be363709636 Author: Eric Anholt Date: Sat Jan 4 13:28:52 2014 -0800 glamor: Drop duplicated lines for getting pixmap state in GetImage. No change in generated code size -- apparently the compiler figured it out. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit e23dd41195dfaf1f3e303197845a071d01523618 Author: Eric Anholt Date: Mon Dec 30 18:41:57 2013 -0800 glamor: Return the stride/size for glamor_dri3_name_from_pixmap(), too. Just like for a caller of glamor_dri3_fd_from_pixmap(), otherwise the consumer of that named buffer has no idea what GL chose for the stride. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 4e21b7ee49bc8f33c6211411d80aa70b16998adc Author: Eric Anholt Date: Mon Dec 30 18:33:09 2013 -0800 glamor: Drop the body of the function for enabling DRI3 extensions. The flag is already being set at glamor_egl_screen_init() time, so no need for the driver to separately call this. That said, leave the function around to keep the ABI compatibility. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 92e2125c5219c7b270785f063fe2560583b2baff Author: Eric Anholt Date: Mon Dec 30 18:29:50 2013 -0800 sync: Add a header include necessary to use misyncstr.h Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 12b2adaaeb091ad48825f439fa0359e5641c86d1 Author: Eric Anholt Date: Sat Dec 28 13:46:17 2013 -0800 glamor: Do glyph private init at screeninit time, and other stuff at CSR. This hasn't actually been a problem, since the server hasn't allocated any glyphs before our glyph private initialization during CreateScreenResources. But it's generally not X Server style to do things this way. Now that glamor itself drives both parts of glyphs setup, DDX drivers no longer need to tell glamor to initialize glyphs. We do retain the old public symbol so they can keep running with no changes. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit df1ef90fa0f98c779c3f312130183dbf32f1e447 Author: Eric Anholt Date: Fri Dec 27 18:45:44 2013 -0800 glamor: Move the EGL image to the normal pixmap private. There's no reason to hide EGL from the rest of glamor, now that we have epoxy. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 732faea542c5ecab353536f93bab5dc6c6068d0a Author: Eric Anholt Date: Fri Dec 27 18:27:56 2013 -0800 glamor: Use epoxy_has_egl_extension() instead of rolling our own. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit a895f6a16588024e03218d8d0e77dd8bd8494329 Author: Eric Anholt Date: Sun Jan 5 02:45:05 2014 -0800 glamor: Drop the set of the context to NULL at the end of glamor ops. The theory here was that it (which I copied from EGL) existed to fix up context switching with indirect GLX. But indirect GLX won't even try to set the context again unless its lastContext field is cleared, so we need to solve this a different way. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit f31911ff8f3f3707101b7771d5dc994ed1ca5c70 Author: Eric Anholt Date: Thu Feb 27 17:55:50 2014 -0800 xephyr: Don't forget to glViewport() before drawing the screen. Fixes misrendering with cairogears. I had noticed the failure while trying to figure out what was going on with traps. Cairogears was apparently putting its results on the screen through putimage, which is a texture upload, so the last GL drawing was done to the size of the cairogears window, not the size of the xephyr screen. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 8b6c79e19cfabd9f343884ddd91a738720c94583 Author: Kristian Høgsberg Date: Wed Mar 12 17:20:17 2014 +1000 xkb: add KeymapOrDefault Helper function to return a default map if the keymap compilation failed. Signed-off-by: Peter Hutterer Reviewed-by: Kristian Høgsberg commit cb9a1d01468732196fd25c6422991e784639ffce Author: Kristian Høgsberg Date: Wed Mar 12 17:18:22 2014 +1000 xkb: factor out xkb loading to LoadXkm Signed-off-by: Peter Hutterer Reviewed-by: Kristian Høgsberg commit 4391cf27f40ec53d41ac7e437cde49848eb32bde Author: Peter Hutterer Date: Wed Mar 12 16:08:15 2014 +1000 xkb: add a callback to xkbcomp This provides a callback to write to xkbcomp's buffer once everything is prepared. Signed-off-by: Peter Hutterer Reviewed-by: Kristian Høgsberg commit 6ebd838d80074075827dedb75ed4169ea1946be3 Author: Peter Hutterer Date: Wed Mar 12 17:17:25 2014 +1000 xkb: constify XkbDDXOpenConfigFile Signed-off-by: Peter Hutterer Reviewed-by: Kristian Høgsberg commit 2b77b208daf9402472ba7fb709156a14eb487299 Author: Hans de Goede Date: Wed Mar 12 16:00:23 2014 +0100 xf86Xinput: release server managed fd before removing the device from the list So that the fd in use test in systemd_logind_release_fd works properly. Note we cannot change the test inside systemd_logind_release_fd as it must work for devices which were never added to the xf86InputDevs too. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 0e972b6037d3709c13d46adef9d14b702f477abc Author: Hans de Goede Date: Wed Mar 12 14:57:24 2014 +0100 systemd-logind: Correctly deal with InputDevs sharing a device-node InputDevices may share a single device-node, this happens ie with Wacom tablets. This patch makes take_fd and release_fd properly deal with this, together with the earlier patch for updating the fd in all matching xf86InputDevs on pause / resume this completes support for such shared device-nodes. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 8d3f63dbe9bfd816beb6475fd0e00df4dbba269f Author: Hans de Goede Date: Wed Mar 12 12:58:22 2014 +0100 systemd-logind: Add a systemd_logind_set_input_fd_for_all_devs helper And use it where appropriate. Setting the fd for all matching InputDevices is necessary when we've multiple InputDevices sharing a single device-node, such as happens with Wacom tablets. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 4e3d9690e1868d286dcb766b429f9c99313f2401 Author: Hans de Goede Date: Wed Mar 12 13:19:32 2014 +0100 systemd_logind_find_info_ptr_by_devnum: Move to higher inside the file This is a preparation patch for adding support for server managed fds for InputDevices where multiple input devices share the same device node (and thus also their major and minor). Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit ddc3888bbaaddc47706a9cb96459738683d72cb3 Author: Hans de Goede Date: Wed Mar 12 12:45:40 2014 +0100 systemd_logind_find_info_ptr_by_devnum: Add a start argument Modify systemd_logind_find_info_ptr_by_devnum to take a start argument, so that it can be used to find all occurences of a devnum in an InputInfo list, rather then just the first. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 40e3c79a591909ab64822cc86fd07513317bf19b Author: Hans de Goede Date: Tue Mar 11 11:38:09 2014 +0100 Remove config_odev_add_*attribute checks in various places Note that there are more callers but those were already not doing any error checking. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 92ff79f1a804d63d2f2bb59dfbf3a2869627609a Author: Hans de Goede Date: Tue Mar 11 11:28:15 2014 +0100 config_odev*: Use XNF alloc functions config_odev* functions are called in code-paths were we already use XNF* functions in other places, so which are not oom safe already. Besides that oom is something which should simply never happen, so aborting when it does is as good a response as any other. While switching to XNF functions also fixup an unchecked strdup case. Note the function prototypes are kept unchanged, as they are part of the server ABI. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit e7b84ca46944895971a8f048c7e34869b7de01c0 Author: Hans de Goede Date: Wed Mar 5 16:41:14 2014 +0100 Xorg: Add a suid root wrapper With the recent systemd-logind changes it is possible to install the Xorg binary without suid root rights and still have everything working as it should *if* the user only has cards which are supported by kms. This commit adds a little suid root wrapper, which is a bit weird, first we strip the suid-root bit of the Xorg binary, and then we add a wrapper ? The function of this wrapper is to see if a system still needs root-rights, if it does not (it supports kms and the kms drivers are properly loaded), then it will immediately drop all elevated rights before executing the real Xorg binary. If it finds (some) cards which don't support kms, or no cards at all, then it will execute the Xorg server with elevated rights so that ie the nvidia binary driver and the vesa driver can keep working normally. To make it possible for security concious users who don't need the root rights to completely remove the wrapper, Xorg is started in a 3 step process when the wrapper is enabled during build time: 1) A simple shell script which checks if the wrapper is there, if it is it executes the wrapper, if not it directly executes the real Xorg binary 2) The wrapper gets executed, does its checks, normally drops all elevated rights and then executes the real Xorg binary 3) The real Xorg binary does its thing This allows distributions to put the wrapper binary in a separate package, and will allow users to remove this package. IE the plan with Fedora is to make "legacy" drivers depend on the wrapper pkg, and since our default install contains some legacy drivers it will be part of the default install, but users can later yum remove it (which will also automatically remove the legacy driver packages as those won't work without it anyways). The wrapper is loosely modelled after the existing Debian Xwrapper, it uses the same config-file + config-file format, and also allows restricting Xserver execution (through the wrapper) to console users only. There also is a new needs_root_rights config file directive, which can be used to override the auto-detection the wrapper does. Hopefully this will allow Debian to replace their own wrapper with this upstream one. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit d35a02a767017f13db4bd4742eef49293d5a30ea Author: Rui Matos Date: Fri Mar 7 14:32:27 2014 -0800 xkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device This will also make it useful for cases when we have a new keymap to apply to a device but don't have a source device. Reviewed-by: Kristian Høgsberg Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 361f405d3c866bc4d22ef84975fe771691156336 Author: Rui Matos Date: Fri Mar 7 14:32:28 2014 -0800 xkb: Factor out a function to copy a keymap's controls onto another Reviewed-by: Kristian Høgsberg Signed-off-by: Peter Hutterer commit 81a4952d3dcab9ca3a1ee399c773f5ac352036c4 Merge: 96a28e9 7950664 Author: Keith Packard Date: Tue Mar 11 22:04:36 2014 -0700 Merge remote-tracking branch 'whot/for-keith' commit 795066477ee81b5b82e490eac8bed6b656d01f17 Author: Peter Hutterer Date: Wed Feb 26 07:54:56 2014 +1000 config: search for PnPID on all parents (#75513) The PnPID for a device may not be on the immediate parent, so search up the device tree until we find one. X.Org Bug 75513 Signed-off-by: Peter Hutterer Tested-by: Benjamin Tissoires commit 45fb3a934dc0db51584aba37c2f9d73deff9191d Author: Peter Hutterer Date: Wed Feb 26 16:20:08 2014 +1000 xkb: push locked modifier state down to attached slave devices Whenever the master changes, push the locked modifier state to the attached slave devices, then update the indicators. This way, when NumLock or CapsLock are hit on any device, the LED will light up on all devices. Likewise, a new keyboard attached to a master device will light up with the correct indicators. The indicators are handled per-keyboard, depending on the layout, i.e. if one keyboard has grp_led:num set, the NumLock LED won't light up on that keyboard. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 656841798c99bcd79da47c03ec666a48b855541f Author: Peter Hutterer Date: Wed Feb 26 16:16:10 2014 +1000 xkb: factor out state update into a function No functional changes Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit dda2468e579762dbd1fed2c75b5587d98f841e9c Author: Peter Hutterer Date: Wed Feb 26 16:03:19 2014 +1000 xkb: factor out the StateNotify flag check Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit fdb4ec86c29d85c1f68418a26e64bcc05b9c14ae Author: Peter Hutterer Date: Tue Mar 11 14:21:27 2014 +1000 xfree86: handle xorg.conf devices with logind Only devices from the config backend have their attributes set, devices from the xorg.conf only have Option "Device". That option is also set by the config backend, so use it. And since the config backend sets our major/minor but xorg.conf devices don't have that set, make sure we try to stat it first where needed. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 4754af9ddbd55c5637b56bd9f37d0d3414c839a8 Author: Peter Hutterer Date: Tue Mar 11 14:20:51 2014 +1000 config: only free odev->attrib_name for string types Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 96a28e9c914d7ae9b269f73a27b99cbd3c465ac8 Author: Eric Anholt Date: Thu Mar 6 18:50:07 2014 -0800 glx: Clear new FBConfig attributes to 0 by default. The visualSelectGroup wasn't getting set (since our DRI drivers don't use it), and and since it's the top priority in the sort order, you got random sorting of your visuals unless malloc really returned you new memory. This manifested as Xephyr -glamor rendering to a multisampled window on my system, which as you might guess was slightly lower performance than expected. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer commit 2843a2f9b58a4aae2949111722c5c1bf3878674b Author: Eric Anholt Date: Tue Feb 25 16:56:54 2014 -0800 glamor: Use buffer_storage v2: - Make the default buffer size a #define. (by Markus Wick) - Fix the return offset for mapping with buffer_storage. (oops!) v3: - Avoid GL error at first rendering from unmapping no buffer. - Rebase on the glBindBuffer(GL_ARRAY_BUFFER, 0) change. v4: Rebase on Markus's vbo init changes. v5: Fix missing put_context() in the buffer_storage fallback path. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 9b86f7a1ab7904fbbe04283b6461a31470c77972 Author: Eric Anholt Date: Sun Jan 12 07:54:51 2014 -0800 glamor: Fix requested composite VBO size. The argument to setup_composte_vbo is the number of verts. v2: Drop the now-unused vert_stride value. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit d310d566b18e55bce27301e9ac78a7894d5194dd Author: Eric Anholt Date: Mon Jan 6 09:29:57 2014 +0800 glamor: Extract the streamed vertex data code used by Render. We should be uploading any vertex data using this kind of upload style, since it saves a bunch of extra copies of our vertex data. v2: - Add a simple comment about what the function does. - Use get_vbo_space()'s return in trapezoids, instead of dereffing glamor_priv->vb (by Markus Wick). - Fix the double-unmapping by moving put_vbo_space() outside of flush_composite_rects(). - Remove the rest of the composite_vbo_offset usage, and just always use get_vbo_space()'s return value. v3: - Fix failure to put_vbo_space in traps when no prims were generated. - Unbind the VBO from put_vbo_space(). Keeps callers from forgetting to do so. v4: - Split out some changes into the previous 3 commits while trying to track down a regression. - Fix regression due to rebase fail where glamor_priv->vbo_offset wasn't incremented. v5: - Fix GLES2 VBO sizing. - Add a comment about resize behavior. - Move glamor_vbo.c init code to glamor_vbo.c from glamor_render.c. (Derived from Markus's changes, but the GLES2 fix dropped almost all of the code in the functions). v6: - Drop the initial BufferData on GLES2 (it happens at put() time). - Don't forget to set vbo_offset to the size on GLES2. - Use char * instead of void * in the cast to return the vbo_offset. - Resize the default FBO to 512kb, to be similar to previous behavior. +1.66124% +/- 0.284223% (n=679) on aa10text. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit ffc8423077d8b5af36ab59f59e4e18109586aec9 Author: Eric Anholt Date: Thu Mar 6 17:05:31 2014 -0800 glamor: Track the next vertex offset as we go for AA traps. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit ca307fd18d4dfded04979903737ec5dd03487625 Author: Eric Anholt Date: Thu Mar 6 17:03:14 2014 -0800 glamor: Track the next vertex offset as we go for non-AA traps. v2: Use sizeof(float) instead of 4. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 03a33048a74d986e27668a4d01861ead0f8be76b Author: Eric Anholt Date: Thu Mar 6 16:57:46 2014 -0800 glamor: Track the next vertex offset as we go in render accel. I want to extract the VBO mapping code, and as part of that I need to get the global vbo_offset munging to stop. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 438d8aceec2d4af48917a7dfecacf11cd4f4b5ce Author: Eric Anholt Date: Thu Mar 6 13:29:08 2014 -0800 glamor: Move glamor_emit_composite_vert() to traps, where it's used. It's only used in the nonantialiased, triangle-based trapezoids path. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit bce5ec4f411134114c6ee2715f293a2250ee8800 Author: Eric Anholt Date: Tue Dec 24 12:14:04 2013 -0800 glamor: Don't forget to set GL_INVALIDATE_RANGE_BIT on GL_ARB_mbr. We don't need any current contents of the buffer, and this allows an implementation to make a temporary BO for a streamed upload if it wants to. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 25be6b384298a7769fedb6d9b5bdc370398c9c95 Author: Eric Anholt Date: Sun Jan 12 07:18:50 2014 +0800 glamor: Fix a mismatched glamor_get/put_context(). We don't call GL in this function any more, so we can just drop the get. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit bd09292debbb810db06b187d4e61c9416b5e565e Author: Eric Anholt Date: Fri Dec 27 14:03:26 2013 -0800 glamor: Add a note about the state of GL_ARB_map_buffer_range. GLES2 Xephyr is failing due to lack of glMapBuffer() with the read bits set, and I decided to see if we can just switch everything to glMapBufferRange(). I'm undecided, and it largely depends on whether we find people are interested in using glamor for the windows X server. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit ca507d215f54e878055de8da13877bc0225bece1 Author: Eric Anholt Date: Tue Dec 24 16:07:12 2013 -0800 glamor: Fix a spelling mistake in GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 4e86f4236b32b61796d820714dc12457dbc92e28 Author: Eric Anholt Date: Mon Dec 23 18:16:01 2013 -0800 glamor: remove dead global variable. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick commit 7f15e5aed79803fa6057fbfda7dfbacacc2e019d Author: Hans de Goede Date: Mon Mar 3 16:58:54 2014 +0100 Require video drivers to report that they support server managed fds This makes how we handle video drivers identical to what we do for input drivers, and this should make live easier for old non kms drivers. Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie commit 76af81bdf8ade158d7cef718ff6cf31cbf641a9a Author: Hans de Goede Date: Mon Mar 3 16:07:16 2014 +0100 xf86platformBus: Make doPlatformProbe accept a NULL gdev argument And use it from xf86platformAddDevice too, instead of directly calling drvp->platformProbe. Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie commit 749d25f6f0faed00a4cd906171ea6f96d76591e7 Author: Hans de Goede Date: Fri Mar 7 04:59:47 2014 -0500 systemd-logind: Fix vt-enter not working when using a legacy video driver If there is only a single non kms video device (tested with the vesa driver), then we will never get a resume signal for a drm node, so also call vtenter when we get a resume for an input device. Notes: 1) vtenter checks if it is ok to do the vtenter, so if there are kms video devices the calls for input device resumes are a nop 2) This assumes that there will always be at least one server event fd supporting input device. Since all non legacy input-drivers will be patched to supported server fds this seems a safe assumption. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit c6dea929a4951c3c048554a1ef54cf8143d9577a Author: Hans de Goede Date: Mon Mar 3 17:00:57 2014 +0100 config_odev_add*_attribute: Don't add the attribute to the list twice Don't do the xorg_list_append a 2nd time when updating existing attributes, while at it add a helper function for this to avoid code duplication. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 2f2967173ba0b0a4f7ab013edeaaf11e7c181beb Author: Hans de Goede Date: Mon Mar 3 09:51:36 2014 +0100 hashtabletest: Fix warning: format ‘%ld’ expects argument of type ... This fixes the following compiler warning: hashtabletest.c: In function ‘print_xid’: hashtabletest.c:15:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘XID’ [-Wformat=] printf("%ld", *x); ^ Signed-off-by: Hans de Goede Reviewed-by: Eric Anholt commit b972851ce47b5e3b681a212a43dd71aab94e7a1b Author: Dave Airlie Date: Mon Mar 10 08:58:37 2014 +1000 xserver: fix build since system-logind.h on tinderbox and irc Reviewed-by: Hans de Goede Reviewed-by: Matthieu Herrb Reviewed-by: Alan Coopersmith Signed-off-by: Dave Airlie Signed-off-by: Keith Packard commit 1c61d38528a573caadee2468ee59ea558c822e09 Merge: 5350ae1 bf35437 Author: Keith Packard Date: Fri Mar 7 22:07:19 2014 -0800 Merge remote-tracking branch 'jwrdecoede/for-keith' commit 5350ae1d38f3c69a26421e0866ede0d2ccc3aea4 Author: Jon TURNEY Date: Fri Mar 7 15:59:10 2014 +0000 Fix xephyr build in --disable-glamor case It broke after commit 9fe052d90cca90fdf750d3a45b151be2ac7f0ebd "xephyr: Build support for rendering with glamor using a -glamor option." See http://tinderbox.x.org/builds/2014-03-07-0004/logs/xserver/#build Signed-off-by: Jon TURNEY Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt commit 78e508c9379b3976ac8e76b7aaa90ba86ad4e443 Author: Andrew Eikum Date: Mon Dec 30 09:15:41 2013 -0600 dix: Clear any existing selections before initializing privates If there is a selection left over from a previous execution of the main loop, and that selection has privates allocated for it, the X server will crash. This is because dixResetPrivates() resets the privates refcounts to zero without accounting for the reference held by the selection object. When the selection is then deleted in InitSelections() after the call to dixResetPrivates(), the refcount for its privates type goes negative and bad things happen. To fix this, we should delete any existing selections before calling dixResetPrivates(). This will properly release the selection's privates and avoid the crash. A more thorough description of the problem and a test case to reproduce the crash is available at a previous mail: "Negative Selection devPrivates refcount?" By Andrew Eikum to xorg-devel on 10 Dec 2013 http://lists.freedesktop.org/archives/xorg-devel/2013-December/039492.html Signed-off-by: Andrew Eikum Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit da08316605b26830b4d8f8fb2d9e69471cdc80ab Author: Eric Anholt Date: Tue Dec 31 00:07:42 2013 -0800 glamor: Add support for DRI3. The render-nodes case is untested. v2: Add a flag for wayland to suppress the native DRI3 support. Wayland isn't running as a master itself, so it can't do the auth on its own and has to ask the compositor to do it for us. Dropped XXX about randr provider -- the conclusion from discussion with keithp was that if the driver's dri3_open for a provider on a different screen, that's a core dri3 bug. v3: Don't put quite so much under GLAMOR_NO_DRI3, and add a comment explaining what this is about. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit fb4a1e6ef6f80a7670e92cab2bc490d4afd80a9b Author: Eric Anholt Date: Mon Dec 30 18:49:46 2013 -0800 glamor: Rename the DRI-related pixmap functions. There was confusion over whether they should have egl in the name, and they had DRI3 in the name even though they're useful to have without DRI3. v2: Just rename glamor_name_from_pixmap for now -- I'd accidentally conflict-resolved in adding new parameters from a later commit. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 2d20f75b60276508424997d9fa8c5b97d8f1d92b Author: Eric Anholt Date: Fri Dec 27 22:19:07 2013 -0800 xorg: Connect up the glamor XV code, xorg DDX-only for now. Porting this code to be non-xorg-dependent is going to take significant hacking, so just dump it in the glamoregl module for the moment, so I can hack on it while regression testing. v2: Fix compiler warnings by adding #include dix-config.h at the top, don't try to auto-init (I'll try to fix the xv ABI later). v3: Fix last minute breakage of having reintroduced xf86ScrnToScreen (one of the compat macros). Just use the drawable's pScreen instead. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit 8d1cca30638f8a12c09efee27e9dedd90322b40e Author: Eric Anholt Date: Fri Dec 27 16:44:15 2013 -0800 xorg: Build a glamor_egl module. This is not exposing the API we want long term, but it should get existing DDX drivers up and running while we massage the API into shape. v2: Use LIBADD instead of LDFLAGS to fix deps on libglamor.la, and use version 0.5.1 (the point it was forked from the external repo). Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson commit fa2e78788327c41bfd45b3de3c71bf9c26dcc85e Author: Eric Anholt Date: Fri Dec 20 10:41:43 2013 -0800 xephyr: Pass incoming XCB events to the Xlib event filter. This is the same thing that Qt ended up doing to get DRI2's event mangling to happen despite using an XCB event loop. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 9fe052d90cca90fdf750d3a45b151be2ac7f0ebd Author: Eric Anholt Date: Wed Dec 18 13:24:14 2013 -0800 xephyr: Build support for rendering with glamor using a -glamor option. v2: Avoid making the Ximage for the screen that we'll never use, and drive the screen pixmap creation for glamor ourselves. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard (v1) Reviewed-by: Adam Jackson commit b634e909895f6001e7d9543e1350b20c82c8c01c Author: Jon TURNEY Date: Thu Jun 27 23:56:23 2013 +0100 hw/xwin: More closely follow ICCCM for setting input focus In multiwindow mode, more closely follow ICCCM section 4.1.7 when setting X input focus to a window when the native Windows window acquires input focus: - If InputHint is FALSE, don't use XSetInputFocus() - If the window supports the WM_TAKE_FOCUS protocol, send a WM_TAKE_FOCUS message This helps JDK 1.7 clients acquire the focus correctly. Also, factor out checking client support for a given WM_PROTOCOLS protocol as a separate function. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 0fc84a2bb6970f6b05a19cd8b32a7f3f7fd148b3 Author: Colin Harrison Date: Fri Feb 28 15:02:14 2014 +0000 hw/xwin: Remove unnecessary casts from malloc/realloc/calloc calls Remove unnecessary casts from malloc/realloc/calloc calls. This is the style used for the majority of X server code. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 94f709cfce62e716f8d3adea388625850de71e78 Author: Colin Harrison Date: Fri Feb 28 14:23:00 2014 +0000 hw/xwin: Add missing FORCEEXIT token to XWin configuration file lexer Somehow this was left out of commmit f3fad371cce0f3836514ad5b29e59fa1ca0627a7 Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 6432d44020443bbda90bd46ffcb572b51be803a1 Author: Colin Harrison Date: Fri Feb 28 14:21:46 2014 +0000 hw/xwin: Silence bell when volume is zero Allow the bell to be turned off with X server option '-f 0', or by 'xset b off'. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 7e37c4f727609d2d992ca46ffce56311c8d8225c Author: Colin Harrison Date: Fri Feb 28 14:21:06 2014 +0000 hw/xwin: Fix typo in comment 'i' before 'e' except after 'c' Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit d75195b62677f5b0f17bbe089b3aea5b295d5f2c Author: Colin Harrison Date: Fri Feb 28 14:20:48 2014 +0000 hw/xwin: Align parameter names in prototypes with definition A follow up to commits 2d9123fd, 451c5d91 and efe96a17, which changed the parameter name in the definition from index to i, to fix shadowing index() but didn't adjust the prototype declaration. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit e53568e2c5004a434a16e3971fb2cd0823e6487b Author: Jon TURNEY Date: Wed Jan 1 16:43:38 2014 +0000 hw/xwin: Just generate the WGL wrappers we need Just generate the WGL wrappers we need, rather than for everything in wgl.xml This avoids generating a lot of unused wrappers, and also avoids compilation requiring a wglext.h at least as new as wgl.xml Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit dec5e9899bfee2a83f8a64f975790ecd2390256d Author: Yaakov Selkowitz Date: Wed Apr 10 18:04:17 2013 +0100 hw/xwin: Fix implicit-function-declaration warning in XwinExtensionInit() when compiled with XWIN_GLX_WINDOWS defined InitOutput.c: In function ‘XwinExtensionInit’: InitOutput.c:170:9: error: implicit declaration of function ‘glxWinPushNativeProvider’ [-Werror=implicit-function-declaration] glxWinPushNativeProvider(); ^ InitOutput.c:170:9: warning: nested extern declaration of ‘glxWinPushNativeProvider’ [-Wnested-externs] Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit bf3543739db18c6cd52908f7c693cb64f43e3f23 Author: Hans de Goede Date: Sat Feb 1 13:21:15 2014 +0100 xf86OpenSerial: Add support server managed fds Try to get a server managed fd from the Options before trying to open the device node ourselves. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit d9a4059d400bf288aadd17c04885cb9b0fb93989 Author: Hans de Goede Date: Tue Jan 14 15:47:48 2014 +0100 config-udev: Don't try to add drm devices twice Before this commit we were trying to add most drm devices twice, once from xf86platformProbe() and once from config_udev_init(). This results in somewhat confusing messages in Xorg.log, ie: (II) xfree86: Adding drm device (/dev/dri/card0) Later followed by: (II) config/udev: Adding drm device (/dev/dri/card0) By filtering out duplicate drm devices we avoid these confusing messages. Signed-off-by: Hans de Goede Acked-by: Peter Hutterer commit 687afa3f6475060e6c460aa9496ba1a6a7982102 Author: Hans de Goede Date: Fri Jan 31 15:21:38 2014 +0100 systemd-logind: Add delayed input device probing With systemd-logind we cannot probe input devices while switched away, so if we're switched away, put the pInfo on a list, and probe everything on that list on VT-Enter. This is using an array grown by re-alloc, rather than a xorg_list since creating a new data-type to store a pInfo + list-entry just for this seems overkill. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit cac39219898f5e5a59ff8d8d6524f5fe0d111469 Author: Hans de Goede Date: Tue Jan 14 15:37:33 2014 +0100 systemd-logind: Hookup systemd-logind integration This commits makes the changes necessary outside of the systemd-logind core to make the server use systemd-logind managed fds for input devices and drm nodes. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 82863656ec449644cd34a86388ba40f36cea11e9 Author: Hans de Goede Date: Tue Jan 7 12:15:12 2014 +0100 systemd-logind: Add systemd-logind "core" This commits add the bulk of the systemd-logind integration code, but does not hook it up yet other then calling its init and fini functions, which don't do that much. Note the configure bits check for udev since systemd-logind use will only be supported in combination with udev. Besides that it only checks for dbus since all communication with systemd-logind is happening over dbus, so no further libs are needed. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 5fb641a29bfb4a33da964e1e9af523f3472015c6 Author: Hans de Goede Date: Mon Jan 13 12:03:46 2014 +0100 hotplug: Extend OdevAttributes for server-managed fd support With systemd-logind support, the xserver, rather than the drivers will be responsible for opening/closing the fd for drm nodes. This commit adds a fd member to OdevAttributes to store the fd to pass it along to the driver. systemd-logind tracks devices by their chardev major + minor numbers, so also add OdevAttributes to store the major and minor. Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie commit a8d802cb019da0549da57576ba0cc2cef1c8a98c Author: Hans de Goede Date: Sun Feb 2 13:54:33 2014 +0100 OdevAttribute: Remove unowned flag from OdevAttributes head The OdevAttributes struct should just be a head of the attributes list, and not contain various unrelated flags. Instead add a flags field to struct xf86_platform_device and use that. Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie commit bc9d17fb566d57eabe4a3372773654fcf6ae5b44 Author: Hans de Goede Date: Sun Feb 2 15:28:31 2014 +0100 OdevAttribute: Add support for integer attributes Add a couple of new functions for dealing with storing integer values into OdevAttributes. Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie Reviewed-by: Peter Hutterer commit 350559dcdcd8b0de57801302e385e25debcb91f1 Author: Hans de Goede Date: Mon Feb 3 15:47:35 2014 +0100 OdevAttribute: config_odev_add_attribute: replace existing values If an attribute already exists replace its value rather than adding a duplicate attribute with the new value to the list. Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie Reviewed-by: Peter Hutterer commit 10c64e80569bbd35e97916a067f553cab27454b5 Author: Hans de Goede Date: Sun Feb 2 11:25:34 2014 +0100 OdevAttribute: Add config_odev_get_attribute helper Add a config_odev_get_attribute helper, and replace the diy looping over all the attributes done in various places with calls to this helper. Signed-off-by: Hans de Goede Reviewed-by: Dave Airlie Reviewed-by: Peter Hutterer commit 3346166a6596115421702c1f7e2732215674ab8e Author: Hans de Goede Date: Mon Jan 13 11:57:38 2014 +0100 xf86Xinput: Modify API for server-managed fd support With systemd-logind support, the xserver, rather than the drivers will be responsible for opening/closing the fd for input devices. This commit adds a new capabilities field to the InputDriverRec and a XI86_DRV_CAP_SERVER_FD flag for drivers to indicate that they support server managed fds. This commit adds a new XI86_SERVER_FD flag to indicate to drivers when the server is managing the fd and they should not open/close it. Note that even if drivers declare they support server managed fds there is no guarantee they will actually get them. Since this changes the input driver ABI, this commit bumps it. systemd-logind tracks devices by their chardev major + minor numbers, since we are breaking ABI anyways also add major and minor fields for easy storage / retrieval of these. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 6b79f28f5cb259f2168ecc3034fe2161e969bf7d Author: Hans de Goede Date: Wed Jan 22 11:32:56 2014 +0100 linux: xf86OpenConsole: Don't detach from controlling tty when it is our vt Detaching from our controlling tty makes little sense when it is the same as the vt we're asked to run on. So automatically assume -keeptty in this case. This is useful to do because when not running as root the server can only make various VT related ioctls when it does not detach from the tty. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 701b7ab34984b0f9f0c357b0ff8b53c5132c6324 Author: Hans de Goede Date: Thu Jan 16 10:37:28 2014 +0100 linux: xf86OpenConsole remove root-rights check for keeptty option There is no reason why keeptty cannot be used without root-rights. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 98f59a33dfc2d47a57c68420f226dc0c17992164 Author: Dave Airlie Date: Fri Feb 28 12:04:30 2014 +1000 modesetting: fix cursor rendering with hotspots. older kernels report EINVAL not ENOSYS, doh. Signed-off-by: Dave Airlie commit 2029c028fcffbe1aa175ab75636ae954a211c82a Author: Adam Jackson Date: Tue Feb 25 09:06:55 2014 -0500 modesetting: Don't (brokenly) double-track software cursor Signed-off-by: Adam Jackson commit caf1dec2a76fbbd21259fe4cc809e24a55ff79b4 Author: David Sodman Date: Mon Feb 10 09:07:33 2014 -0800 V2: Add check for link from output to crtc before optimizing out a CrtcSet call The function RRCrtcSet call checks to see if the config being set is already configured, but, doesn't check that the selected outputs are connected to the crtc before skipping. This means that the following sequence will omit the final CrtcSet call to the driver: CRTC c1 connect to output o CRTC c2 connect to output o CRTC c1 connect to output o This change adds the check to ensure that each of the calls are made to the driver. Signed-off-by: David Sodman Reviewed-by: Stéphane Marchesin Signed-off-by: Keith Packard commit 249565a07d1d243e27440e2a5ecf4c95490903c6 Author: Alan Coopersmith Date: Sun Feb 9 23:13:51 2014 -0800 Fix test/os to work on Solaris Due to bad decisions made decades ago at AT&T, on SVR4 OS'es the signal() function resets the signal handler before calling the signal handler (equivalent to sigaction flag SA_RESETHAND). This is why the X server has a OsSignal() helper function in os/utils.c that uses the portable POSIX sigaction function to provide BSD/Linux semantics in a signal() style API, so we switch to use that in this test case, allowing it to pass on Solaris. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 0031f6b073c7a4cca553c1d3e185a63436a75cbe Author: Alan Coopersmith Date: Sun Feb 9 23:13:50 2014 -0800 Fix test/signal-logging to work on Solaris For some reason, Solaris libc sprintf() doesn't add "0x" to the %p output as glibc does, causing the test to fail for not matching the exact output. Since the 0x is desirable, we add it ourselves to the test string. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit e67f2d7e0f9189beb2907fa06cff5ecc7f35f922 Author: Matthieu Herrb Date: Sun Feb 9 11:20:59 2014 +0100 gcc 4.2.1 doesn't support #pragma GCC diagnostic ignored Signed-off-by: Matthieu Herrb Signed-off-by: Keith Packard commit 1940508a4af33d44a7a8ef24bbdcd1e31e228dab Merge: c85ea92 ddeca92 Author: Keith Packard Date: Mon Feb 24 16:27:52 2014 -0800 Merge remote-tracking branch 'herrb/master' commit c85ea92af145c98a4a3fc6cf7b9eac796a48cc2e Author: Keith Packard Date: Mon Feb 24 09:51:39 2014 -0800 Bump to 1.15.99.901 Signed-off-by: Keith Packard commit 0840a303c47b9b10ba8e24e62956da0f1675e963 Merge: 0f10cfd 3d71df4 Author: Keith Packard Date: Mon Feb 24 09:40:23 2014 -0800 Merge remote-tracking branch 'anholt/glamor-pull-request' commit fac2bcf1da09fba8bc8b22631e31f3c5b2737efd Author: Dave Airlie Date: Mon Jan 20 11:06:42 2014 +1000 modesetting: try and use hotspot cursor support Signed-off-by: Dave Airlie commit 4aab7aa7c1a15af7211996fa30e17a645f120ff9 Author: Dave Airlie Date: Fri Feb 21 12:48:42 2014 +1000 modesetting: move closing fd to after we check outputs On something like cirrus, start X, then attempt to start a second X while the first is running, if fbdev is installed it'll fail hard. Signed-off-by: Dave Airlie commit 0f10cfd4b903d4db293ec47c8a9a0d8b33965803 Author: Peter Hutterer Date: Thu Feb 20 13:18:05 2014 +1000 Xi: check for invalid modifiers for XI2 passive grabs The other values are checked correctly, but if a modifier was outside the allowed range, it would go unnoticed and cause a out-of-bounds read error for any mask equal or larger than 256. The DetailRec where we store the grab masks is only sized to 8 * sizeof(Mask). Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit ec6a44612565e0716bd5b2e2b80a8d381691feb6 Author: Gaetan Nadon Date: Wed Feb 19 13:48:06 2014 -0500 test: remove source file from hashtabletest LDADD LDADD is for libraries and not for source code. Introduced in commit: ccb3e78124fb05defd0c9b438746b79d84dfc3ae Signed-off-by: Gaetan Nadon Signed-off-by: Peter Hutterer commit 31b0be69e5eea3d1c82d6610bd37bbdb4dca779c Author: Thierry Reding Date: Wed Feb 19 17:16:48 2014 +0100 test/input: Fix alignment assertion for doubles The code previously tried to compute the offset of a field in the valuator by subtracting the address of the valuator from the _value_ of the field (rather than the field's address). The correct way to do it would have been (note the &'s): assert(((void *) &v->axisVal - (void *) v) % sizeof(double) == 0); assert(((void *) &v->axes - (void *) v) % sizeof(double) == 0); That's essentially what the offsetof() macro does. Using offsetof() has the added benefit of not using void pointer arithmetic and therefore silencing a warning on some compilers. Signed-off-by: Thierry Reding Signed-off-by: Peter Hutterer commit 9368bdec1d37127e97411b684f0b1fce5ee97907 Author: Laércio de Sousa Date: Mon Feb 17 08:43:49 2014 +1000 Get rid of config/non-seat0.conf.multi-seat This file is deprecated by commits c73c36b53 and 46cf2a6093. Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 3d71df48e70884deccb293cf1fcffbdba8efd94b Author: Eric Anholt Date: Fri Dec 27 14:21:05 2013 -0800 glamor: Move the EGL DRI3 code to GLAMOR_HAS_GBM. There's nothing dependent on the presence of DRI3 code in the server for this, but it does rely on GBM. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 80cdbb20f9dcdfdf3e77ecf5cdd7dfb1a87d1a83 Author: Eric Anholt Date: Fri Dec 27 13:21:21 2013 -0800 glamor: Fix linking of the gradient shaders on GLES2. GLES2 sensibly doesn't allow you to attach multiple shaders for the same stage to a single program. This means we have to attach the whole thing in one glShaderSource call. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 76bd0f994959f30a37d41eaf06f43f23c3b23faf Author: Eric Anholt Date: Fri Dec 27 13:09:25 2013 -0800 glamor: Don't bother keeping references to shader stages for gradients. They never get reattached to any other program, so saving them to unreference later is a waste of code. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 6e62cdf66d2f0baa4a26eff6f4917f73baf3b008 Author: Eric Anholt Date: Fri Dec 27 11:29:27 2013 -0800 glamor: Fix typo in setting v_position's attrib location. Assuming it was the first attribute assigned by the GL, it would have ended up with location 0 anyway. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit f8d384fa8f0fa2a3ac04c4ad21fb04400490e8e6 Author: Eric Anholt Date: Fri Dec 27 02:13:27 2013 -0800 glamor: Move shader precision stuff from build time to shader compile time. This is the last desktop-versus-ES2 build ifdef in core glamor. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 1adac62a7d9da099c779e65527ece611cf4d2f2c Author: Eric Anholt Date: Fri Dec 27 02:10:53 2013 -0800 glamor: Unifdef the picture-format-to-format-and-type functions. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 3747c260816a36352bb91ce06befcbffbbd747c7 Author: Eric Anholt Date: Fri Dec 27 16:12:15 2013 -0800 glamor: Move glamor_get_tex_format_type_from_pictformat to a .c file. A pair of 150 lines of inlined switch statements in a header file is crazy. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 0e4f3414189b1820443b35248e4c9e03f0c2e34e Author: Eric Anholt Date: Fri Dec 27 02:04:11 2013 -0800 glamor: Unifdef the cache format indices. We only ask for GL_RGB on desktop GL as far as I can see, but now if GLES2 did happen to ask for GL_RGB it would return a cache index instead of -1. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit d63283860a7c04a12838dead0dfd6d04fb73a093 Author: Eric Anholt Date: Fri Dec 27 01:23:15 2013 -0800 glamor: Pass pixmaps around to unifdef glamor_iformat_for_depth(). v2: Just pass in the PicturePtr to glamor_pict_format_is_compatible() (suggestion by keithp) Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit f3f4fc7a65589a200a086ea7b1527f91941bc19b Author: Eric Anholt Date: Fri Dec 27 01:17:10 2013 -0800 glamor: Add a screen argument to drop an ifdef from glamor_set_alu(). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 9553020b7184ed7a7ef3f02d60556d519ea3e769 Author: Eric Anholt Date: Wed Dec 25 11:39:13 2013 -0800 glamor: Drop a bunch of GLES2 ifdefs. Now that we're using epoxy, we can write code using both desktop and ES symbols and decide what to use at runtime. v2: Fix a spelling mistake (latter), since the lines were moved anyway (noticed by Rémi Cardona). Fix condition invert in glamor_set_composite_texture (caught by Michel Dänzer). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard (v1) Reviewed-by: Adam Jackson (v1) commit c3c8a5f36034b6a2ce48d1d42e3de5af36406c38 Author: Eric Anholt Date: Wed Dec 25 11:36:35 2013 -0800 glamor: yInverted is a boolean value, so use the Bool type. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 12cbfeed81d3ae73e10ee8a2b6619fb4f403b8f6 Author: Eric Anholt Date: Mon Dec 23 18:00:46 2013 -0800 glamor: Drop fixed function transformation matrix setup. gl_ModelViewProjection and friends aren't used in our shaders, so this setup didn't do anything. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 62965d278c347ff323f2262d767978794e32f841 Author: Eric Anholt Date: Mon Dec 23 17:50:46 2013 -0800 glamor: Drop useless glEnable/glDisable(GL_TEXTURE_2D) calls. Those calls are only for enabling texture handling in the fixed function pipeline, while everything we do is with shaders. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson commit 4afe15d8bfd575c010ed1868697a7922a37ab378 Author: Eric Anholt Date: Wed Dec 18 15:27:52 2013 -0800 glamor: Put in a pluggable context switcher for GLX versus EGL. The GLX side just gets the context from the current state. That's also something I want to do for EGL, so that the making a context is separate from initializing glamor, but I think I need the modesetting driver in the server before I think about hacking on that more. The previous code was rather incestuous, along with pulling in xf86 dependencies to our dix code. The new code just initializes itself from the current state. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 781c692cf970642865f0e537f4905c43192f9935 Author: Eric Anholt Date: Wed Dec 18 13:10:24 2013 -0800 glamor: Rename glamor_get/put_dispatch to glamor_get/put_context. It used to be the thing that returned your dispatch table and happeend to set up the context, but now it just sets up the context. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit 0373b3f4f7c7aec633468b37f9236a2734dbcc74 Author: Eric Anholt Date: Wed Dec 18 12:18:20 2013 -0800 glamor: Convert to using libepoxy. Libepoxy hides all the GL versus GLES2 dispatch handling for us, with higher performance. v2: Squash in the later patch to drop the later of two repeated glamor_get_dispatch()es instead (caught by keithp) Signed-off-by: Eric Anholt Reviewed-by: Keith Packard commit f34dc7fa96457ea6a0703493d74e63cca357712e Author: Jeremy Huddleston Sequoia Date: Fri Feb 14 00:31:38 2014 -0800 XQuartz: pointer -> void * Fix build regression from 60014a4a98ff924ae7f6840781f768c1cc93bbab Signed-off-by: Jeremy Huddleston Sequoia commit 72237e0908527e9261b91c7db99f32d895947d8d Author: Keith Packard Date: Thu Feb 13 15:25:56 2014 -0800 DIST_SUBDIRS needs to include glamor, even if it isn't built Otherwise, glamor won't get cleaned for 'make distclean' Signed-off-by: Keith Packard commit 783991b1beeb71d91068601789d179d10eb8b544 Author: Gaetan Nadon Date: Thu Feb 13 17:36:34 2014 -0500 config: fails to create tarball as xorg-server.conf file removed Just need to update EXTRA_DIST Reviewed-by: Peter Hutterer Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 02fbae85e7aa17b213e1411fe558256998d367c4 Author: Alex Deucher Date: Wed Feb 12 13:06:51 2014 -0500 modesetting: query cursor size from the kernel Use new drm caps. This allows hw cursors to work correctly on gpus with non-64x64 cursors. Signed-off-by: Alex Deucher commit 30c3852bda7f60b0ffb1bb2f6ed8ba8800001b32 Author: Alan Coopersmith Date: Sun Feb 9 16:56:40 2014 -0800 Delete stray ; in struct _DeviceChangedEvent Caused Solaris Studio cc to complain in every file which included it: "../include/eventstr.h", line 179: warning: syntax error: empty member declaration Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 5300212ce8e9364ba26497605f3edc089af20130 Merge: ae796d4 0b193b3 Author: Keith Packard Date: Sun Feb 9 16:05:42 2014 -0800 Merge remote-tracking branch 'whot/for-keith' commit 0b193b3ac94e078d9291d1b1dfd4814e5f2d9e34 Author: Peter Hutterer Date: Thu Feb 6 07:59:07 2014 +1000 xfree86: use xnfstrdup in the Xorg -configure code Just for consistency, I'm pretty sure the code is generally not happy for malloc failures anyway. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Keith Packard commit 7b1b7fb3be47672454837a3f7be2d1440433ec27 Author: Peter Hutterer Date: Wed Feb 5 15:12:22 2014 +1000 mi: fix printf warning about size_t format specifier mieq.c:290:26: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' [-Wformat=] pnprintf supports size_t since 5ea21560dd071ea4ab87430000d087fd5fe1f092 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Keith Packard commit ddeca927498c9df3b5e62c7bf05e31e2a3aeaa52 Author: Mark Kettenis Date: Sun Dec 15 14:31:10 2013 +0100 sync: Avoid ridiculously long timeouts On OpenBSD, passing a timeout longer than 100000000 seconds to select(2) will make it fail with EINVAL. As this is original 4.4BSD behaviour it is not inconceivable that other systems suffer from the same problem. And Linux, though not suffering from any 4.4BSD heritage, briefly did something similar: So avoid calling AdjustWaitForDelay() instead of setting the timeout to (effectively) ULONG_MAX milliseconds. Signed-off-by: Mark Kettenis Reviewed-by: Matthieu Herrb commit ae796d43c934ba378c9a618adc81c6729a14b2f8 Author: Keith Packard Date: Thu Feb 6 19:17:50 2014 -0800 ephyr: Repaint entire screen when colormap is updated Any time the colormap is changed, the entire screen needs to be repainted to match. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson Reviewed-by: Eric Anholt commit 9eecc9ac73aa06dca1420e0a89fb0cbd432a9bd7 Author: David Heidelberger Date: Fri Feb 7 02:06:04 2014 +0100 configure.ac: add missing "test" Signed-off-by: Keith Packard Reviewed-by: Hans de Goede commit 08c7df9b0870fadf7b4655825459ff2e5a5c47da Author: Alan Coopersmith Date: Mon Feb 3 17:38:24 2014 -0800 __glGetProcAddress: explictly cast function pointers to void * Fixes Solaris Studio compiler warning & error: "glxext.c", line 557: warning: assignment type mismatch: pointer to void "=" pointer to function(void) returning void "glxext.c", line 559: error: operands have incompatible types: pointer to void ":" pointer to function(void) returning void Signed-off-by: Alan Coopersmith Signed-off-by: Keith Packard commit 76eedb039fc8d515a76c1df944fd5a85ac674019 Author: Eric Anholt Date: Mon Jan 27 11:36:08 2014 -0800 xfree86: Fix a compiler warning on 64-bit. asm/mtrr.h makes this an unsigned long on 32, but a u64 on 64. Cast it to a long to win. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 9f8f6657cdd3a5b166771695addb6fe76d93c378 Author: Eric Anholt Date: Mon Jan 27 11:36:07 2014 -0800 glx: Delete dead NV program string functions. These have been throwing a compiler warning about missing prototypes, since the generated code to define the prototypes stopped being generated (possibly because the code was dead). Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 0c774d53c5c1e8845e7da9b01814d7b98f621f51 Author: Eric Anholt Date: Mon Jan 27 11:36:06 2014 -0800 glx: Reduce compiler warnings by not requesting GL extension prototypes. They're not officially in the ABI, so you shouldn't use them anyway. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 87c4551c9cc9e382e6cfb59df1759d27c776abc8 Author: Eric Anholt Date: Mon Jan 27 11:36:05 2014 -0800 glx: Stop relying on libGL ABI bugs for glGetCompressedTexImage(). In theory, the linux libGL ABI exposes just GL 1.2 plus GLX 1.3. But, thanks to libglapi, we're letting glGetCompressedTexImageARB() be exposed too. The GLX code was inappropriately relying on it by using GL_GLEXT_PROTOTYPES. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit bf4f02337c97ffc3f7fbba9dba8ab72fa6c4a5fd Author: Jon TURNEY Date: Mon Jan 6 14:13:24 2014 +0000 glx: Remove left-over glthread.c Commit be668096 "glx: convert to direct GL dispatch (v2)" removes glthread.c from Makefile.am along with the rest of the dispatch table code, but doesn't remove glthread.c itself. Signed-off-by: Jon TURNEY Reviewed-by: Eric Anholt Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 7305153643622269e14f3564f7a8a66ecaf49f78 Author: Adam Jackson Date: Wed Feb 5 11:10:47 2014 -0500 configure: Don't add GLX_SYS_LIBS to XORG_SYS_LIBS libglx.so is linked against libGL.so, but Xorg itself should not be. Signed-off-by: Adam Jackson Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit c64130c13bd6914a998a8e8b808a6cedd18f9384 Author: Peter Hutterer Date: Wed Feb 5 15:10:27 2014 +1000 dix: fix a -Wshadow warning dispatch.c: In function 'SetVendorString': dispatch.c:481:29: warning: declaration of 'string' shadows a global declaration [-Wshadow] SetVendorString(const char *string) ^ dispatch.c:135:21: warning: shadowed declaration is here [-Wshadow] typedef const char *string; Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Keith Packard commit 72967d6c153b0d1109df23967e1a05c3c397a1e0 Author: Peter Hutterer Date: Wed Feb 5 14:32:23 2014 +1000 xfree86: unconstify driver in the XF86ConfInputClassRec No const value is ever assigned to it, let's not pretend it's const. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Keith Packard commit f14d6647c0883d4e7e4de7645d7a18e4d301845e Author: Peter Hutterer Date: Wed Feb 5 14:30:50 2014 +1000 xfree86: unconstify another string Only Xorg -configure uses a hardcoded value here, so let's not change the rest of the server for that. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Keith Packard commit 46ae9d67e4118fa79bef0f9119d20559dfd6b6c0 Author: Peter Hutterer Date: Wed Feb 5 14:24:54 2014 +1000 xfree86: un-constify inp_driver/inp_identifier The only place this isn't allocated is during Xorg -configure where we just statically assing "mouse"/"kbd" and the identifiers for it. Everywhere else it's strdup'd and then free'd already. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Keith Packard commit 93bf9544712a39f10557533993d8826b2b67fc9a Author: Peter Hutterer Date: Wed Feb 5 14:16:01 2014 +1000 xfree86: device name and driver are not const char Allocated in one place, freed in another. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Keith Packard commit 25d10464f440b8b34594b7c988a99a830ea39a29 Author: Peter Hutterer Date: Fri Jan 24 18:16:54 2014 +1000 dix: fix button state check before changing a button mapping dev->button->down is a bitmask, not a normal array. Use the helper function to check, we technically allow the mapping to change after the physical button has been pressed (but not yet processed yet), so only check BUTTON_PROCESSED. From XSetPointerMapping(3): "If any of the buttons to be altered are logically in the down state, XSetPointerMapping returns MappingBusy, and the mapping is not changed." Reported-by: Ilja Van Sprundel Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 73926622b91fde01148727f26d6aad5e6827c1d2 Author: Peter Hutterer Date: Fri Jan 24 18:33:54 2014 +1000 include: make the various button array lengths more obvious No functional changes, just making a better case for why MAP_LENGTH is 256. "But can't we remove MAP_LENGTH then?" I hear you say? "Why, yes. Go for it!" Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 87ca80a7196949597113225405f3e4ee03bbee13 Author: Peter Hutterer Date: Fri Jan 24 18:32:54 2014 +1000 dix: prevent a driver from initializing or submitting buttons > MAX_BUTTONS The server internally relies on arrays with a MAX_BUTTONS maximum size (which is the max the core protocol can transport). Make sure a driver adheres to that. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 14fb6cf92c009d726f0a6b6e8b89cc48f2dd50eb Author: Peter Hutterer Date: Thu Jan 30 09:16:23 2014 +1000 Revert "xfree86/common: handle string constants in xf86Xinput configuration" This reverts commit 22592855e90d23013ba7f9e945d567725cb44bf3. What warning was this supposed to fix? Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit a553444b5841522836f7437ebb96e40be270fd8b Author: Peter Hutterer Date: Thu Jan 30 09:12:41 2014 +1000 Revert "xfree86/parser: make strings in xf86MatchGroup const" This reverts commit f71de60355cc76810657f40c7b5461af86b34bf7. What warnings? Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 45f1d527f39a296104f2fa79a774446e7e1560e0 Author: Peter Hutterer Date: Thu Jan 30 09:01:09 2014 +1000 input: un-constify dev->name Fallout from fecc7eb1cf66db64728ee2d68cd9443df7e70879, and reverts most of the rest of that patch. The device name is allocated and may even change during PreInit. The const warnings came from the test codes, the correct fix here is to fix the test code. touch.c: In function ‘touch_init’: touch.c:254:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] dev.name = "test device"; Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 675f215af291135ee3ece5414e4a5a2e89bf4ed3 Author: Peter Hutterer Date: Thu Jan 30 08:52:32 2014 +1000 Revert "os: xstrtokenize takes and returns const char * now" This reverts commit d0339a5c66846c9f14e3b584e34688520a0916ab. seriously, what the fuck? Are we making xstrdup() return a const char now too? Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit ce3df579e3f24a169189b288230959527e059080 Author: Peter Hutterer Date: Thu Jan 30 08:50:06 2014 +1000 input: un-constify InputAttributes Introduced in fecc7eb1cf66db64728ee2d68cd9443df7e70879 and reverts most of that but it's helpfully mixed with other stuff. InputAttributes are not const, they're strdup'd everywhere but the test code and freed properly. Revert the const char changes and fix the test up instead. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 2fc38d1e299587d25ca8225051e0ea9403164b15 Author: Peter Hutterer Date: Wed Jan 29 11:16:51 2014 +1000 xkb: add a call to init an XkbRMLVOSet from const chars Just forcing everything to const char* is not helpful, compiler warnings are supposed to warn about broken code. Forcing everything to const when it clearly isn't less than ideal. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 6307d60dd592f4b438f880d02bde9fd8d50ae264 Author: Peter Hutterer Date: Wed Jan 29 10:47:49 2014 +1000 Xi: remove superfluous cast. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede commit 83e38eb73fd8c852513aac2da2975b4c01070ec2 Author: Arun Raghavan Date: Mon Jan 6 20:29:50 2014 +0530 edid: Add quirk for Sony Vaio Pro 13 The detailed timings are for a 15.6" display when max image size correctly reports 13.3". Signed-off-by: Arun Raghavan Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit bf83843b92ce21d11f6ff1a407ff3d014e017c9b Author: Hans de Goede Date: Thu Dec 19 14:10:18 2013 +0100 xf86Events: add Enable/DisableInputDeviceForVTSwitch functions Factor this code out into functions so that it can be re-used for the systemd-logind device pause/resume paths. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 48b489769e78fa20911630173ab708feecb0fb0e Author: Hans de Goede Date: Thu Dec 19 11:28:40 2013 +0100 xf86Events: refactor xf86VTLeave error handling Use kernel goto style error handling for xf86VTSwitchAway() failure. This makes it much easier to read the straight path. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 78f0667d6df9cc43a397d9f1490e540936a435d6 Author: Hans de Goede Date: Thu Dec 19 11:26:36 2013 +0100 xf86Events: split xf86VTSwitch into xf86VTLeave and xf86VTEnter functions Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer commit 33cec8af55d829cd77b297ae356ed7a00ce8523c Author: Hans de Goede Date: Tue Dec 17 09:29:07 2013 +0100 dbus-core: Attempt to connect to dbus ASAP For systemd-logind integration we need the dbus connection to be available before enumerating input and gfx devices. Signed-off-by: Hans de Goede Reviewed-by: Daniel Stone commit 480590b90c3966536451d2a2fecc42a66082ed77 Author: Hans de Goede Date: Wed Dec 4 11:10:06 2013 +0100 dbus-core: Make dbus-core no longer mutually exclusive with udev With systemd-logind the dbus-core will be used for more then just config, so it should be possible to build it even when using a non dbus dependent config backend. This patch also removes the config_ prefix from the dbus-core symbols. Signed-off-by: Hans de Goede Reviewed-by: Daniel Stone commit c29454ae9d2e8e647732077fdfd97b351095f122 Author: Peter Hutterer Date: Thu Dec 12 12:48:57 2013 +1000 config: drop the dbus API This API has been disabled by default since 1.4, the first release it came in. There a no known users of it and even its direct replacement (HAL) has been superseeded by udev on supported platforms since 1.8. This code is untested, probably hasn't been compiled in years and should not be shipped. Signed-off-by: Peter Hutterer Signed-off-by: Hans de Goede Reviewed-by: Hans de Goede Reviewed-by: Daniel Stone commit 46cf2a60934076bf568062eb83121ce90b6ff596 Author: Laércio de Sousa Date: Thu Dec 12 14:22:48 2013 -0200 xfree86: Keep a non-seat0 X server from touching VTs (#71258) Updated patch following Hans de Goede's advice. If -seat option is passed with a value different from seat0, X server won't call xf86OpenConsole(). This is needed to avoid any race condition between seat0 and non-seat0 X servers. If a non-seat0 X server opens a given VT before a seat0 one which expects to open the same VT, one can get an inactive systemd-logind graphical session for seat0. This patch was first tested in a multiseat setup with multiple video cards and works quite well. I suppose it can also make things like DontVTSwitch and -sharevts meaningless for non-seat0 seats, so it may fix bug #69477, too. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71258 https://bugs.freedesktop.org/show_bug.cgi?id=69477 (maybe) See also: http://lists.x.org/archives/xorg-devel/2013-October/038391.html https://bugzilla.redhat.com/show_bug.cgi?id=1018196 Signed-off-by: Hans de Goede Reviewed-by: Hans de Goede commit b3d3ffd19937827bcbdb833a628f9b1814a6e189 Author: Łukasz Stelmach Date: Mon Nov 25 11:54:07 2013 +0100 configure.ac: enable systemd socket activation in libxtrans Signed-off-by: Łukasz Stelmach Signed-off-by: Hans de Goede Acked-by: Peter Hutterer commit 435098a0dce6bca8870ec9725bf0af0969cd84fa Author: Alan Coopersmith Date: Tue Jan 28 20:27:52 2014 -0800 Add RANDR 1.4 requests & events to dix/protocol.txt Checked against randrproto.txt & randr.h Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit c1ac89c793614797e08d3d8e7fc9ba55be899130 Author: Alan Coopersmith Date: Tue Jan 28 20:27:51 2014 -0800 xf86DeleteScreen: move check for NULL pScrn before first dereference Flagged by cppcheck 1.62: [hw/xfree86/common/xf86Helper.c:220] -> [hw/xfree86/common/xf86Helper.c:231]: (warning) Possible null pointer dereference: pScrn - otherwise it is redundant to check it against null. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit e6733ae91b7be52930f22a87de15fa05819ef948 Author: Alan Coopersmith Date: Tue Jan 28 20:27:50 2014 -0800 On realloc failure, free font_path_string instead of leaking it Flagged by cppcheck 1.62: [dix/dixfonts.c:1792]: (error) Common realloc mistake: 'font_path_string' nulled but not freed upon failure Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 910b5b245425f0a866a703303b78768b0de5cb2b Author: Alan Coopersmith Date: Tue Jan 28 20:27:49 2014 -0800 Link libvgahw with $(PCIACCESS_LIBS) as well Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit da1660deeb9032ecca61f4bcdc9fc2eec2ada445 Merge: 0fbb3d7 9fc1916 Author: Keith Packard Date: Mon Jan 27 19:02:15 2014 -0800 Merge remote-tracking branch 'whot/for-keith' commit 0fbb3d711efec5222a57b45a70d28fc98380f3a1 Merge: 7ddef4f b98e493 Author: Keith Packard Date: Mon Jan 27 14:11:09 2014 -0800 Merge remote-tracking branch 'anholt/glamor-reformat' Conflicts: Makefile.am Conflict caused by adding PSEUDORAMIX and GLAMOR directory defines in separate branches commit 7ddef4f7033c10b6e92866182d4475a4d49c5083 Author: Keith Packard Date: Wed Jan 22 14:30:28 2014 -0800 Add _XITYPEDEF_POINTER to dix-config.h Just like the pointer type from Xdefs.h, the Pointer type from XIproto.h collides with local declarations of variables using the same name. XIproto.h can use _XITYPEDEF_POINTER to avoid declaring the unnecessary pointer type. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 0b5a87f37d5dcd2ebff977a3b9a50a75ace93c83 Author: Keith Packard Date: Wed Jan 22 19:17:24 2014 -0800 pseudoramiX: Only compile on XQUARTZ and XWIN PseudoramiXExtensionInit() is not defined in extinit.h if it won't be used and we get a compiler warning when compiling the pseudoramiX code. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 61cb6c9aa95aa369573c4e02c023bbc33c7678c9 Author: Keith Packard Date: Wed Jan 22 19:16:36 2014 -0800 pseudoramiX: Add _X_ATTRIBUTE_PRINTF attributes to debug functions. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 9e45a1a030a5e70318441f33a132269a19a43df5 Author: Keith Packard Date: Fri Nov 15 18:00:53 2013 +0900 Warning fixes in glx Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit b98e49379c8d7cecce991207048489f51b10028c Author: Eric Anholt Date: Wed Dec 18 15:00:19 2013 -0800 glamor: Remove more out-of-tree compat code. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 40a8186f0f78b7c36ef7e3d902c53bdc9bb7c650 Author: Eric Anholt Date: Fri Dec 27 12:22:08 2013 -0800 glamor: Remove an extra copy of RegionNil(). Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit d26f5335151a9e962afa4bbf29ca5b94660a33ca Author: Eric Anholt Date: Wed Dec 18 11:35:53 2013 -0800 glamor: Hook the module back up to the build. For now we're just building an uninstalled library. The extra EGL stubs are required so that we can get the DIX building and usable without pulling in the xf86 DDX code in glamor_egl.c. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 54e78ec31e030d488765341a0c143c5a060c3768 Author: Eric Anholt Date: Wed Jan 22 15:03:26 2014 -0800 glamor: Convert use of the old "pointer" typedef to "void *". Reviewed-by: Keith Packard commit 3c3a4eeaa1f24b7534b332739158a2a36987ea6b Author: Eric Anholt Date: Wed Dec 18 11:45:33 2013 -0800 glamor: Silence warnings for non-debug builds. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 9af66851e2770bcd8408a0e5ddf8bb8ea816feaa Author: Eric Anholt Date: Fri Jan 24 10:58:04 2014 -0800 glamor: Disable definitions of GL extension prototypes to avoid warnings. We're not using the extension prototypes, since you have to dlsym them anyway. Disabling their definitions prevents them from being defined twice (once by gl.h, once by glext.h). Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong commit a7b8ce8b4207a93c0455a0b796cfc47917c04a9c Author: Eric Anholt Date: Wed Dec 18 11:41:33 2013 -0800 glamor: Drop xfree86 dependencies from this dix module. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 7759e4d090f56cdcad1c8a2acb2c1be20021de5d Author: Eric Anholt Date: Wed Dec 18 11:43:48 2013 -0800 glamor: Disable the XV code for now. We're going to want to make this DIX code instead of XF86 if at all possible, but for now just disable it so we can work on the rest of the build. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit b3acb47e98023da898ffc4b6a5bac38a78bd7727 Author: Adam Jackson Date: Wed Oct 30 11:30:23 2013 -0400 glamor: Use dix-config.h not project config.h v2: Also edit the one in glamor_egl.c (by anholt) v3: Also edit the one in glamor_eglmodule.c (by anholt) Signed-off-by: Adam Jackson Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 6cc0b7b01599b94af07e9fc8b16134f751ede077 Author: Adam Jackson Date: Wed Oct 30 11:05:40 2013 -0400 glamor/egl: Remove glapi awareness We only needed this because glx was directly bashing glapi tables. Since that's not the case anymore, we should just MakeCurrent like a real GL app. v2: Hand-resolve against rebase onto newer server (by anholt) Signed-off-by: Adam Jackson Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 0c5a7c208601110a0b36d24cdacb4d844af03f75 Author: Eric Anholt Date: Tue Dec 17 16:32:17 2013 -0800 glamor: Remove compat code for building out of tree. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 82efb90efba685678638f94804d773b59ca1643f Author: Adam Jackson Date: Wed Oct 30 09:56:46 2013 -0400 glamor: Remove copy of sna's compiler.h Xfuncproto.h has equivalents for these already. v2: Adjust a couple more likelies after the rebase (anholt) Signed-off-by: Adam Jackson Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 714926b090344a17a2f7aee9f4bc6aea4e45f48c Author: Eric Anholt Date: Thu Jan 9 18:23:39 2014 +0800 glamor: Fix up some indentation damage on header prototypes. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 7f6e865359c2d055db4eb7d82b4779b3d7c5d264 Author: Eric Anholt Date: Fri Dec 27 11:46:30 2013 -0800 glamor: Fix some indent damage of putting a ' ' after the '*' for pointers. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 5f57d436c391c51f3f90958b033f6ee3eb7a1136 Author: Eric Anholt Date: Tue Dec 24 15:59:14 2013 -0800 glamor: Fix some mangling of shader strings by indent. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit d84d71029ae9e462559d64eff7259e2cc7732fac Author: Eric Anholt Date: Wed Dec 18 11:59:07 2013 -0800 glamor: Apply x-indent.sh. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit e8e9a54c47deedbc13b8969ed29e16463b0314a0 Author: Eric Anholt Date: Wed Dec 18 11:56:15 2013 -0800 glamor: Touch up some code so indent doesn't get confused. Signed-off-by: Eric Anholt Reviewed-by: Zhigang Gong Reviewed-by: Keith Packard commit 9fc19168e7ca6308275bf8769d1ccb982f88465b Author: Alan Coopersmith Date: Fri Jan 24 23:42:49 2014 -0800 Check for calloc() failure in add_master() Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 76b3be75b62657e346731444736f7e4d200beb5b Author: Peter Hutterer Date: Fri Jan 24 16:51:02 2014 +1000 Xi: fix modifier offset in XIPassiveGrab swapping function The request is followed by mask_len 4-byte units, then followed by the actual modifiers. Also fix up the swapping test, which had the same issue. Reported-by: Alan Coopersmith Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit c1ce807d9f18f215332d7eeb844e8c640f71c53c Author: Keith Packard Date: Wed Jan 22 11:01:59 2014 -0800 dix: Praise clients which haven't run for a while, rather than idle clients A client which is ready, but hasn't run for a while, should receive the same benefit as one which has simply been idle for a while. Use the smart_stop_tick to see how long it has been since a client has run instead of smart_check_tick, which got reset each time a client was ready, even if it didn't get to run. Reported-by: Chris Wilson Signed-off-by: Keith Packard Tested-by: Chris Wilson commit 76b275d7acbfd6b28cb9e74fa4862faa6d08217d Author: Keith Packard Date: Sun Jan 12 10:53:31 2014 -0800 test/signal-formatting: Ignore compiler warnings The signal formatting tests intentionally include code which generates warnings with the current X server warning flags. Turn the compiler warnings off Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 12ea81792868c10a89a06ce9a9e8f707be283569 Author: Keith Packard Date: Sun Jan 12 10:44:22 2014 -0800 test/hashtabletest: Clean up -Wshadow errors Declare 'XID id' local to each scope it is used in, rather than having the first use be a function-wide declaration. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 7104f0f338fa96824a463331d6099a76ee3c21ac Author: Keith Packard Date: Sun Jan 12 10:42:37 2014 -0800 test/xi2: Clean up -Wshadow warnings protocol-common declares a bunch of pretty generic names; fix shadows of these names. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 92a9495800cf59b917c30d5fbaf4b7eca10d19cf Author: Keith Packard Date: Sun Jan 12 10:42:01 2014 -0800 kdrive/ephyr: Remove extra 'i' variable in ProcXF86DRIGetDrawableInfo Just re-use the top-level one Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 988877065486d0f25cc85be5be05f4523cc883c7 Author: Keith Packard Date: Sun Dec 15 01:57:09 2013 -0800 randr: Eliminate -Wshadow warnings Don't use rrScrPriv for nested screen private fetching. Eliminate a duplicate fetch of the randr screen private in rrCheckPixmapBounding. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit f46c487625e1ffbc78df5153128c68bd6bc41104 Author: Keith Packard Date: Sun Dec 15 01:56:36 2013 -0800 hw/xnest: Eliminate shadowed names Just rename stuff; nothing fancy here. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 1f3676a81ef2c52699bdfcf1fb9da7e4e79b00b7 Author: Keith Packard Date: Sun Dec 15 01:55:43 2013 -0800 hw/vfb: Rename screenInfo parameter to screen_info Avoid shadowing the global screenInfo value. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 89c0fa3d6c8ae67084a30395085db6d872d9d6de Author: Keith Packard Date: Sun Dec 15 01:55:06 2013 -0800 kdrive: Fix -Wshadow errors Just rename stuff to avoid conflicts. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 9c108b3ccdb4086002b83d9ad66f5619e9ec95bb Author: Keith Packard Date: Sun Dec 15 01:53:50 2013 -0800 exa: Fix -Wshadow warnings In exa_accel, there was a duplicate fetch of a pixmap private field. exa_render just had a regular shadowed value. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 04e320a4e4e1f46bf95e36078d93b4d18a0ef855 Author: Keith Packard Date: Sun Dec 15 01:52:58 2013 -0800 composite: Remove duplicate window pixmap fetch There's nothing between the previous fetch and this one that could cause the window pixmap to have changed. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 07b03e721e4dbec1a640c9b3bb8a2d5902587e63 Author: Keith Packard Date: Sun Dec 15 01:41:19 2013 -0800 xfree86: Fix -Wshadow warnings Just rename variables to eliminate -Wshadow warnings. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 3c94b89f149c2d63424faed0d44a6911393c3569 Author: Keith Packard Date: Sun Dec 15 01:40:04 2013 -0800 Xi: Use 'void *' instead of 'Pointer' (which is going away) There's no reason for XI to declare 'typedef char *Pointer' in a shared header file; assume it will eventually go away and stop using it here. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 08d0481e299c28b64a0db9bb0782ba2b551028fd Author: Keith Packard Date: Sun Dec 15 01:12:22 2013 -0800 os: Fix -Wshadow errors Rename variables to avoid shadowing globals Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 1487145b41390e689f8b03c1e8a2df70e00cf519 Author: Keith Packard Date: Fri Dec 13 11:25:45 2013 -0800 Add 'FONT_PATH_NAME_ELEMENT_CONST' to dix-config.h and xorg-server.h This signals to the fontsproto code that the X server has been fixed to allow the name member in a FontPathElement struct to be declared const to eliminate piles of warnings when assigning string constants to them. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 1ad8d12e7fcd7d55a37099d7426e3290297ba6d3 Author: Keith Packard Date: Fri Dec 13 11:24:00 2013 -0800 Ignore a couple of format-nonliteral warnings These are generated in code which uses sprintf as a convenient way to construct strings from various pieces. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 9ef53e2267ea3dd60651961f66c65e8b00b7d823 Author: Keith Packard Date: Wed Dec 11 11:55:37 2013 -0800 include: GetClientResolutions is declared in font.h No need to have a duplicate definition here. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 25ebb9dbc9df659dec2bf6c27654a5bad2d11f94 Merge: 409e8e2 71baa46 Author: Keith Packard Date: Wed Jan 22 11:33:53 2014 -0800 Merge remote-tracking branch 'whot/for-keith' commit 409e8e29fbe16122ba5a4249256fc56e2e68ea93 Merge: 457bc83 d6c8d75 Author: Keith Packard Date: Wed Jan 22 11:32:35 2014 -0800 Merge remote-tracking branch 'dlespiau/20131216-4k' commit 457bc83549e58bb87de96bed02988db3275a7611 Author: Alan Coopersmith Date: Sat Jan 4 00:09:45 2014 -0800 If EAGAIN == EWOULDBLOCK, only need to check errno for one of them Solaris has: #define EWOULDBLOCK EAGAIN so checking (errno == EAGAIN || errno == EWOULDBLOCK) is overkill. This leads cppcheck 1.62 to complain: [xserver/os/io.c:365] -> [xserver/os/io.c:365]: (style) Same expression on both sides of '||'. [xserver/os/io.c:941] -> [xserver/os/io.c:941]: (style) Same expression on both sides of '||'. This quiets it, and reduces the number of calls Solaris Studio cc generates to the __errno() function to get the thread-specific errno value. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 044a6ef2ff5f2c83a80b11e747f62f48830b526b Merge: 0b932cf 77df653 Author: Keith Packard Date: Wed Jan 22 11:28:54 2014 -0800 Merge remote-tracking branch 'jeremyhu/master' commit 0b932cf47a4df8ea0f7488e285d218fe7c10dd77 Merge: 1d76b02 295d41f Author: Keith Packard Date: Wed Jan 22 11:27:36 2014 -0800 Merge remote-tracking branch 'anholt/xserver-unifdef' commit 1d76b02fac79c0360ae201e4d1a8ba0e9a00e810 Merge: 771f390 4dd62d7 Author: Keith Packard Date: Wed Jan 22 11:22:35 2014 -0800 Merge remote-tracking branch 'anholt/glamor-external-rebase' commit 771f390efdf48cb7c44fe20857f06f8ffff3b2ce Author: Gaetan Nadon Date: Sat Dec 21 19:58:32 2013 -0500 autoconf: fix warning by replacing AC_WARN with AC_MSG_WARN A warning about the macro generating the warnings to the user... Signed-off-by: Gaetan Nadon Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit c3819da87ff2e8c6292066f965c098704edc442c Author: Gaetan Nadon Date: Sat Dec 21 19:58:31 2013 -0500 xorg-tls: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE The code produced in the configure script is identical. Signed-off-by: Gaetan Nadon Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 02d866a088a2fc60c6aaebe23c48b372f6b6aa9b Author: Gaetan Nadon Date: Sat Dec 21 19:58:30 2013 -0500 autoconf: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE The code produced in the configure script is identical. Signed-off-by: Gaetan Nadon Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit e38c98fe74394a138ebadb29b1cfe1d4ea7f7071 Author: Gaetan Nadon Date: Sat Dec 21 19:58:29 2013 -0500 autoconf: fix warning, replace AC_TRY_LINK with AC_LINK_IFELSE The code produced in the configure script is identical. Signed-off-by: Gaetan Nadon Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 4993590c90b1289171a2ca0e74d9c4310f5318c7 Author: Gaetan Nadon Date: Sat Dec 21 19:58:28 2013 -0500 autoconf: fix warning by replacing deprecated AC_HELP_STRING We can also make do without the workaround introduced in 2005. The 2.60 autoconf minimum version covers that now. Signed-off-by: Gaetan Nadon Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 1d4dbc2f2b4d2acca2691c3c7464a45aac59d73f Author: Gaetan Nadon Date: Wed Dec 4 13:28:04 2013 -0500 libtool: bump minimum required version to 2.2 LT_PREREQ([2.2]) LT_INIT AC_CONFIG_MACRO_DIR([m4]) is recommended to locate local macros, which is fully used starting automake 1.14. ACLOCAL_AMFLAGS in Makefile.am is deprecated since automake 1.14. The comment is to prevent developers from removing the statement as suggested in 1.14 which would break earlier versions. Automake 1.14 is already in use by many. This patch works on versions prior and post 1.14 References: Building the X Window System from Source: http://www.x.org/wiki/Building_the_X_Window_System/#index2h3 Discussion on xorg minimum autotools requirements: http://lists.x.org/archives/xorg-devel/2013-October/038325.html Tested with autoconf 2.60, automake 1.10.3 and libtool 2.2 The same upgrade will be applied to libraries and drivers. Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 71baa466b1f6b02fe503f9a3089b7b9d61aa0f80 Author: Peter Hutterer Date: Mon Jan 13 17:00:23 2014 +1000 os: restrict display names to digits We call atoi() on the server's display to get the socket but otherwise use the unmodified display for log file name, xkb paths, etc. This results in Xorg :banana being the equivalent of Xorg :0, except for the log files being in /var/log/Xorg.banana.log. I'm not sure there's a good use-case for this behaviour. Check the display for something that looks reasonable, i.e. digits only, but do allow for :0.0 (i.e. digits, followed by a period, followed by one or two digits). Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 77df653ae3d8448be21221711851acde12c6bc1a Author: Jeremy Huddleston Sequoia Date: Wed Jan 1 11:10:41 2014 -0800 XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in AppleWMSetWindowMenu Signed-off-by: Jeremy Huddleston Sequoia commit 3bc608a361a01043b226fb9aaebf88f6fd852925 Author: Jeremy Huddleston Sequoia Date: Wed Jan 1 11:04:07 2014 -0800 XQuartz: Check for allocated memory before using it in AppleWMSetWindowMenu Signed-off-by: Jeremy Huddleston Sequoia commit 64327226ddfba8f0653615cd678d2d4336fb993d Author: Jeremy Huddleston Sequoia Date: Wed Jan 1 11:00:40 2014 -0800 XQuartz: Silence a clang static analysis warning about a memory leak It seems the alanyzer can't comprehend dixSetPrivate(). quartz.c:119:12: warning: Potential leak of memory pointed to by 'displayInfo' return quartzProcs->AddScreen(index, pScreen); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jeremy Huddleston Sequoia commit b2f6b3497c33a4897afae80a2cf69c596b9f81e8 Author: Jeremy Huddleston Sequoia Date: Wed Jan 1 10:55:10 2014 -0800 XQuartz: Silence a clang static analysis warning about a possible memory leak on exit stub.c:356:9: warning: Potential leak of memory pointed to by 'newargv' asl_log(aslc, NULL, ASL_LEVEL_ERR, ^~~~~~~ stub.c:356:9: warning: Potential leak of memory pointed to by 'newenvp' asl_log(aslc, NULL, ASL_LEVEL_ERR, ^~~~~~~ 2 warnings generated. Signed-off-by: Jeremy Huddleston Sequoia commit a03f096a85537d9e881cedaa6cb71aca43a97086 Author: Jeremy Huddleston Sequoia Date: Wed Jan 1 10:47:52 2014 -0800 XQuartz: Validate length in appledri before swapping Avoids potential memory corruption from bad requests Signed-off-by: Jeremy Huddleston Sequoia commit b3572c0d1ab7888ac26d6b2b8be6d1d19ed9af3f Author: Jeremy Huddleston Sequoia Date: Wed Jan 1 10:39:56 2014 -0800 XQuartz: Validate screen in AppleDRIQueryDirectRenderingCapable requests Return an error to the caller rather than crashing the server on invalid screens. Signed-off-by: Jeremy Huddleston Sequoia commit 959e8f23af7850fcaf40d6c67f5228241a36a9ab Author: Jeremy Huddleston Sequoia Date: Sun Dec 29 12:45:23 2013 -0800 XQuartz: Simplify hook_run to quiet static analyzer x-hook.c:96:9: warning: Called function pointer is an uninitalized pointer value (*fun[i])(arg, data[i]); ^~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Signed-off-by: Jeremy Huddleston Sequoia commit f79af1941776fd6f1ec26c50603fcc35ca7d514b Author: Jeremy Huddleston Sequoia Date: Sun Dec 29 12:41:18 2013 -0800 XQuartz: Mark applicationWillTerminate: noreturn X11Controller.m:938:1: warning: method 'applicationWillTerminate:' could be declared with attribute 'noreturn' [-Wmissing-noreturn,Semantic Issue] { ^ Signed-off-by: Jeremy Huddleston Sequoia commit ea80279e292e59a9fe9651489f03e9f2f39810d9 Author: Jeremy Huddleston Sequoia Date: Sun Dec 29 12:36:51 2013 -0800 XQuartz: Fix get_proc_address signature indirect.c:675:28: warning: incompatible pointer types passing 'glx_gpa_proc (*)(const char *)' to parameter of type 'glx_gpa_proc' (aka 'glx_func_ptr (*)(const char *)') [-Wincompatible-pointer-types,Semantic Issue] __glXsetGetProcAddress(&get_proc_address); ^~~~~~~~~~~~~~~~~ ../../../glx/glxserver.h:122:42: note: passing argument to parameter 'get_proc_address' here [Semantic Issue] void __glXsetGetProcAddress(glx_gpa_proc get_proc_address); ^ Signed-off-by: Jeremy Huddleston Sequoia commit 2e3ebec9520719a8e5c3c92390e83bcb5216f978 Author: Jeremy Huddleston Sequoia Date: Sun Dec 29 12:31:23 2013 -0800 XQuartz: Fix darwinfb.h header guard ./darwinfb.h:28:9: warning: '_DARWIN_FB_H' is used as a header guard here, followed by #define of a different macro [-Wheader-guard,Lexical or Preprocessor Issue] ^~~~~~~~~~~~ ./darwinfb.h:29:9: note: '_DARWIN_DB_H' is defined here; did you mean '_DARWIN_FB_H'? [Lexical or Preprocessor Issue] ^~~~~~~~~~~~ _DARWIN_FB_H Signed-off-by: Jeremy Huddleston Sequoia commit 9da6c0918f40359f28fe8889d5b7cae7efcc8377 Author: Jeremy Huddleston Sequoia Date: Sun Dec 29 12:22:55 2013 -0800 XQuartz: Silence some static analyzer warnings by annotating referencing counts Signed-off-by: Jeremy Huddleston Sequoia commit 2d2d49dab5c5718989de97d7227aac793479745e Author: Keith Packard Date: Sun Dec 29 15:18:28 2013 -0800 Clean up a few function prototypes to not place formals in /**/ This just removes the comment markers from around the formals in several function prototypes near where pointer -> void * changes were made. There are plenty more of these to fix. Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith commit 60014a4a98ff924ae7f6840781f768c1cc93bbab Author: Keith Packard Date: Sun Dec 15 01:05:51 2013 -0800 Replace 'pointer' type with 'void *' This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt commit 93fa64e17d7bd600ebf18ecab85f5b2d17fe30ce Author: Keith Packard Date: Wed Dec 11 12:18:49 2013 -0800 Don't build dmx by default It's clearly un-loved, having piles and piles of warnings. If someone wants to fix it up to compile without warnings, we can re-enable it. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 319dff750f99a28a1544bcb81d52172c641ad1ca Author: Keith Packard Date: Wed Dec 11 12:18:16 2013 -0800 hw/xfree86: nobus.c shouldn't define a static function Having this function be static generates a compiler warning. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 7915791bac3ff609e94f355fbb637d7c570a5b32 Author: Keith Packard Date: Wed Dec 11 12:17:45 2013 -0800 kdrive/ephyr; Don't redeclare monitorResolution It's already declared in globals.h Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit aa47a4409660634d80c3423ad49b70ca929a8756 Author: Keith Packard Date: Wed Dec 11 12:16:51 2013 -0800 kdrive/ephyr: ddxUseMsg is supposed to return I'm not sure why ephyr thinks that ddxUseMsg shouldn't return, but it's not declared to exit. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 86d68825c2b75ea9e10954fec00b44b33b38d8b2 Author: Keith Packard Date: Wed Dec 11 11:55:01 2013 -0800 vfb: Remove unused pXWDCmap variable Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 7353ec7cb6fc235b03e59e35425201429c83ee72 Author: Keith Packard Date: Wed Dec 11 11:32:19 2013 -0800 xfree86: Switch int10 code to stdint types CARD32 is not type compatible with uint32_t and ends up generating a pile of warnings. Fix this by replacing all of the CARD* types with stdint types. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 93b15b1a47eb414338e8b229f25f11bdca099471 Author: Keith Packard Date: Wed Dec 11 11:31:46 2013 -0800 xfree86: Don't complain when the SDK dependency file doesn't exist yet It won't exist until the build is complete, so don't complain about it Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit eda935627116dd106b99dbcc95d90a723a2de330 Author: Keith Packard Date: Sat Nov 16 23:35:21 2013 -0800 xkb: Make XkbWriteCountedString take a const char * input parameter Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit d0339a5c66846c9f14e3b584e34688520a0916ab Author: Keith Packard Date: Sat Nov 16 23:34:59 2013 -0800 os: xstrtokenize takes and returns const char * now Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit c608560dbbac18837cb00ef0d774a66ea7706534 Author: Keith Packard Date: Sat Nov 16 23:33:59 2013 -0800 xfree86/vbe: Make VBEValidateModes take const char ** mode names are now const Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 3835e8b0a1cc7b1e971bcc3f9453422fec014b10 Author: Keith Packard Date: Sat Nov 16 23:33:18 2013 -0800 xfree86/shadowfb: GCFuncs and GCOps are now const Change GC private to match and fix resulting warnings Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit f71de60355cc76810657f40c7b5461af86b34bf7 Author: Keith Packard Date: Sat Nov 16 23:32:40 2013 -0800 xfree86/parser: make strings in xf86MatchGroup const and fix resulting warnings Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 2a93e75ff81b095bc9cdb80906e23ec705d52df5 Author: Keith Packard Date: Sat Nov 16 23:31:55 2013 -0800 xfree86/int10: mark printk as _X_ATTRIBUTE_PRINTF Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 7fe436a7b786ff02ed55cf9ed65edfd2fe07ac22 Author: Keith Packard Date: Sat Nov 16 23:31:06 2013 -0800 xfree86/fbdevhw: Fix warnings Unused fPtr variable. Deal with string constants. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 6990de00eb23478d9343660ad3981fb1d33f8be4 Author: Keith Packard Date: Sat Nov 16 23:30:29 2013 -0800 xfree86/exa: xf86GetOptValString returns const char * now fix exaDDXDriverInit to match. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 017307f0b41476c3c73a9414a7ce9eb42373c3f4 Author: Keith Packard Date: Sat Nov 16 23:29:30 2013 -0800 xfree86/dri: Mark DRIDrvMsg and dri_drm_debug_print _X_ATTRIBUTE_PRINTF And fix resulting warnings. v2: (Adam Jackson) Cast handles through uintptr_t to avoid size change warnings Signed-off-by: Keith Packard Reviewed-by: Ian Romanick Reviewed-by: Adam Jackson commit 22592855e90d23013ba7f9e945d567725cb44bf3 Author: Keith Packard Date: Sat Nov 16 23:28:48 2013 -0800 xfree86/common: handle string constants in xf86Xinput configuration Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 3a163d2af48a7cf8fd5c2db6ac68166a5fdbeb8d Author: Keith Packard Date: Sat Nov 16 23:28:16 2013 -0800 xfree86/common: Const GC funcs and ops in xf86VAarbiter Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 8a9aa44a45377d8953d11a0b035c86eb139283ba Author: Keith Packard Date: Sat Nov 16 23:26:19 2013 -0800 xfree86/config: Kludge around const strings defaultFontPath is now a const char * so that it can be initialized from a string constant. This patch kludges around that by inserting suitable casts to eliminate warnings. Fixing this 'correctly' would involve inserting some new variables and conditionals to use them. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 86647e7279163b13492d39ecb9c44414b752a61e Author: Keith Packard Date: Sat Nov 16 23:25:50 2013 -0800 config/udev: handle const strings Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit b7633c6ff2c273621df6c0fac9c269f8ab217a46 Author: Keith Packard Date: Sat Nov 16 23:24:03 2013 -0800 composite: Remove unused pScreen variables Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 5bc5684d4cb4905cd82fe1c036cc8a48c3c4868f Author: Keith Packard Date: Fri Nov 15 06:02:05 2013 -0800 test: Warning cleanup const char in test/xfree86.c. Cast values to (intmax_t) for %ju format in test/signal-logging.c. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit fecc7eb1cf66db64728ee2d68cd9443df7e70879 Author: Keith Packard Date: Fri Nov 15 06:00:44 2013 -0800 xi: More warning cleanup for input Lots more const char stuff. Remove duplicate defs of CoreKeyboardProc and CorePointerProc from test/xi2/protocol-common.c Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit af04cf6968b16cc9efd17905471047e7de62058a Author: Keith Packard Date: Fri Nov 15 05:55:38 2013 -0800 Xext: Clean up warnings in hashtable code Make keys const void * Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 00438c9f943b219ba33055969ae7f9ba07214b2a Author: Keith Packard Date: Fri Nov 15 05:41:54 2013 -0800 exa: Clean up warnings Declare GC ops/funcs as const. Use 'typeof' in the 'swap' macro to capture the right type. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 6e51645b4796fc3a02206fefd416b84beb2fcdf7 Author: Keith Packard Date: Fri Nov 15 05:28:47 2013 -0800 xkb: Clean up warnings Add const to lots of strings. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit abce3206cbc82f632abae5344e0ce46622e00f24 Author: Keith Packard Date: Fri Nov 15 05:19:24 2013 -0800 os: Clean up warnings Just const char stuff. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit a1cb69dc28fdbfbdfaf954e0bec221f759462399 Author: Keith Packard Date: Fri Nov 15 22:05:44 2013 +0900 Xext: Clean up warnings GC funcs and ops are const. Remove unused variables. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 2f6e8eb70d527541178433933d6230466421bd15 Author: Keith Packard Date: Fri Nov 15 22:02:58 2013 +0900 damage: Clean up warnings GC funcs and ops are const now, so all wrappers need to declare them as such. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit c706fb0db86d6946482700d65ad6803c4daaa6f9 Author: Keith Packard Date: Fri Nov 15 22:00:29 2013 +0900 Clean up warnings in mi. A coupel of unused variables, and some debug code with mis-matching printf format and variable types. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit d89b42bda46d36fc0879611cc3b3566957ce36d0 Author: Keith Packard Date: Fri Nov 15 21:57:05 2013 +0900 Clean up warnings in DIX As usual, mostly const char changes. However, filter_device_events had a potentially uninitialized value, 'raw', which I added a bunch of checks for. I suspect most of those are 'can't happen', but it's hard to see that inside the function. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit d6da9f23cca562fc0c6ae398665ab7fa770a4fa8 Author: Keith Packard Date: Fri Nov 15 18:07:54 2013 +0900 hw/xfree86: More const declarations for strings Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 644725ac5e28a00d8c24372f55ae7e7e2fe0cb2e Author: Keith Packard Date: Fri Nov 15 18:06:37 2013 +0900 Just remove dpms functsion from xf86.h Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit c85e26d59901fbf8c7a437cf934b51fa64160073 Author: Keith Packard Date: Fri Nov 15 17:55:15 2013 +0900 Bunch of DMX warning fixes Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 493d992501b586d95823e045d1dc994bd6c00d27 Author: Keith Packard Date: Fri Nov 15 17:43:46 2013 +0900 More warning fixes in hw/xfree86 Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit c78be3a4b714deb7ad75cacd54042ca1b51d6261 Author: Keith Packard Date: Fri Nov 15 17:36:26 2013 +0900 xfree86 warning reduction This gets the easy warnings, mostly constant string problems. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 1ce15ed5bae60a184c6bd9440e3c017488a5f415 Author: Keith Packard Date: Sat Nov 16 23:44:51 2013 -0800 Xext: _X_EXPORT DPMSSet and DPMSSupported These are needed by drivers, and it's better to export them from here rather than redefining them in hw/xfree86 and exporting them from there. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 1f407763be28745f18d224077d6b07b9431ee16b Author: Keith Packard Date: Sat Nov 16 23:43:49 2013 -0800 include: Make xkbrules structures all const char * This lets them be initialized with string constants Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit e1e01d2e33c632e395d7e396f73fba8ae606b15a Author: Keith Packard Date: Fri Nov 15 16:56:15 2013 +0900 xfree86/common: Warning fixes. Mostly const string handling. Also removes DPMS functiosn from Xext/dpmsproc.h Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 27b44949a3d2e34ac10e801bd8a8fc2c28791e7e Author: Keith Packard Date: Fri Nov 15 16:24:15 2013 +0900 hw/xfree86: Lots of constant string support Make lots of string pointers 'const char' so that we can use constant strings with them without eliciting warnings. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 6f77e2645ea36e324ccc664aae1d36464418bdea Author: Keith Packard Date: Fri Nov 15 13:40:30 2013 +0900 hw/xfree86: Make strings in DriverRec and ScrnInfoRec const This avoids compiler warnings when initializing with string constants. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Reviewed-by: Adam Jackson commit e81902872176fa9848211fcd7a5eafa4f861a1b7 Author: Peter Hutterer Date: Thu Jan 9 15:29:23 2014 +1000 ephyr: don't allow a shift+ctrl keygrab if mod1 was enabled Xephyr wants ctrl+shift to grab the window, but that conflicts with ctrl+alt+shift key combos. Remember the modifier state on key presses and releases, if mod1 is pressed, we need ctrl, shift and mod1 released before we allow a shift-ctrl grab activation. Signed-off-by: Peter Hutterer commit b2d5ee2e3684951b611fd2068d57cc65fd8305a3 Author: Carlos Garnacho Date: Thu Jan 2 21:33:30 2014 +0100 Xi: Ensure DeviceChanged is emitted after grabs are deactivated When a grab on a slave device is deactivated, the master device must be checked, just in case there were events from other devices while the slave device was stolen away by the passive grab. This may introduce misbehaviors on mismatching valuators and device features later on UpdateDeviceState(). Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 863d2ad5c02cccde9a4d1a392a7cae78d001c8a9 Author: Alan Coopersmith Date: Mon Jan 6 17:10:40 2014 -0800 CheckPassiveGrabsOnWindow() needs to handle NULL return value from AllocGrab() CheckPassiveGrabsOnWindow() calls AllocGrab() which can fail and return NULL. This return value is not checked, and can cause NULL pointer dereferences. Signed-off-by: Alan Coopersmith Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 5493a67ec256d22a8a41597a345d8e1c54d6e335 Author: Alan Coopersmith Date: Mon Jan 6 17:10:39 2014 -0800 GrabDevice() needs to handle NULL return value from AllocGrab() GrabDevice() calls AllocGrab() which can fail and return NULL. This return value is not checked, and can cause NULL pointer dereferences. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 3a113815a0cc86d64789494e905da9778174f738 Author: Alan Coopersmith Date: Mon Jan 6 17:10:38 2014 -0800 If AllocGrab() fails to set up grab, don't copy to a NULL grab If either the initial calloc or the xi2mask_new fails, grab is NULL, but if a src grab is passed in, it was always being written to by CopyGrab (and if that failed, dereferenced again in teardown). Signed-off-by: Alan Coopersmith Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit a92c6406e7f6c0b74fb1cb9361ad904facc0f722 Author: Keith Packard Date: Thu Jan 9 11:10:11 2014 +0800 Bump release to 1.15.99.900 The merge window for 1.16 is open Signed-off-by: Keith Packard commit d6c8d7509727060b8e2358b9ed1c0e17b2ec3401 Author: Damien Lespiau Date: Wed Jul 31 19:16:45 2013 +0100 xfree86: Use the TMDS maximum frequency to prune modes Instead of only relying on the Range section, we can do better on HDMI to find out what is the max dot clock the monitor supports. The HDMI CEA vendor block adds a TMDS max freq we can use. This makes X not prune 4k resolutions on HDMI. v2: Replace X_INFO by X_PROBED in the message that prints the max TMDS frequency (Chris Wilson) Reviewed-by: Chris Wilson Signed-off-by: Damien Lespiau commit 95c2287465138ac251bf792f354cee3626e76b44 Author: Damien Lespiau Date: Wed Aug 7 15:16:21 2013 +0100 xfree86: Refactor xf86MonitorIsHDMI() using xf86MonitorFindHDMIBlock() Reviewed-by: Chris Wilson Signed-off-by: Damien Lespiau commit a279fb3ff3f3cfc41530aff1d9ff5620279348f6 Author: Damien Lespiau Date: Wed Jul 31 19:11:45 2013 +0100 xfree86: Add a xf86MonitorFindHDMIBlock() The HDMI CEA vendor specific block has some interesting information, such as the maximum TMDS dot clock. v2: Don't parse CEA blocks with invalid offsets, remove spurious brackets (Chris Wilson) v3: Fix the looping through the CEA data blocks, it had a typo using the wrong variable coming from the code it was ported from. Replace x << 16 + y << 8 + z by x << 16 | y << 8 | z (Chris Wilson) v4: Remove the stray ';' at the end of "if (*end == 0)". (Dominik Behr on IRC) Reviewed-by: Chris Wilson Signed-off-by: Damien Lespiau commit 295d41fa2aa97b74c1b9ffd7ef4ccf52f3e97dde Author: Eric Anholt Date: Mon Dec 16 10:52:19 2013 -0800 glx: unifdef swrast dri_interface.h values from Mesa 7.1. We can't remove all the ifdefs (__DRI_TEX_BUFFER_VERSION) because configure.ac is only checking for that version of Mesa in the absence of dri2. Reviewed-by: Ian Romanick commit 4ab1a2797ba366179f8a2e621334dd45df2a5a65 Author: Eric Anholt Date: Tue Nov 5 11:41:06 2013 -0800 glx: unifdef for DRI2 dri_interface.h things in mesa 9.2. Thanks to configure.ac's check, we know that we have a new enough dri_interface.h that we don't need to conditionalize all this code. Reviewed-by: Ian Romanick commit 2ea973e12f5d954211e1d10085a4c74581b43aca Author: Keith Packard Date: Fri Dec 27 09:50:55 2013 -0800 Bump version to 1.15.0 Signed-off-by: Keith Packard commit 2eb9915eea358f941702d3dad7434197991885c5 Author: Keith Packard Date: Thu Dec 12 15:48:08 2013 -0800 present: Set complete notify mode to Skip as needed Skipped present pixmap calls were not setting the mode to PresentCompleteModeSkip for skipped operations. Signed-off-by: Keith Packard commit e487babd525ef1bd016ec7b283fa08cf9e6c6f4f Author: Keith Packard Date: Thu Dec 12 14:52:35 2013 -0800 present: Don't abandon presents which are already queued for flip Presents which are not marked 'queued' and are in the window present list are waiting for the flip event; discarding those won't work very well (it'll end up trashing displayed content for the next frame), so skip over those when looking for duplicate frame presents Signed-off-by: Keith Packard commit ca3a5b2a8f9f627bbaa9883e16512a21c2a0b81d Author: Keith Packard Date: Thu Dec 12 14:17:40 2013 -0800 present: Handle PresentOptionAsync for copy mode Check for Async flag and execute immediately if set, otherwise wait for the next appropriate vblank before copying. Signed-off-by: Keith Packard commit a68df147421da21528b5be2d34678383922fa352 Author: Keith Packard Date: Thu Dec 19 14:31:07 2013 -0800 Bump version to 1.14.99.905 (1.15 RC5) Another week, another RC. This should be the last before 1.15 final Signed-off-by: Keith Packard commit 4b1ead9d3400acc3402c2480d7cc0527750c32f0 Merge: 4d62646 929795d Author: Keith Packard Date: Thu Dec 19 14:14:59 2013 -0800 Merge remote-tracking branch 'whot/for-keith' commit 4dd62d7807b47efbc9065ae8f17f73e1ec6e9d26 Author: Gaetan Nadon Date: Tue Dec 10 11:13:32 2013 -0500 libglamoregl: remove -I$(top_srcdir)/src Automake always provide -I. It is at the beginning of the list of compiler options. Not needed either to find glamor_egl.c source. Signed-off-by: Gaetan Nadon Reviewed-by: Zhigang Gong commit 08c23ff8aefe80f2940ecb90adda27156084f57c Author: Gaetan Nadon Date: Tue Dec 10 11:13:31 2013 -0500 Make: remove cruft copied over from the X server makefiles In toplevel makefile: nostdinc: only xserver, no other X modules aclocaldir: no local macros to install xkb_path: xserver only "Gross hack": xserver only In src/makefile: SOLARIS_ASM_CFLAGS; server only XORG_INCS: undefined variable DIX_CFLAGS: undefined variable Signed-off-by: Gaetan Nadon Reviewed-by: Zhigang Gong commit b8055bd1f6c9dea0fe8f7a786d2a1522f5f32129 Author: Dave Airlie Date: Fri Dec 13 11:33:46 2013 +1000 glamor: fix leak in xv code. This loop needed to go one higher, not sure if this fixes the leak MrCooper was seeing on irc, but it fixes a leak. Signed-off-by: Dave Airlie Reviewed-by: Michel Dänzer Reviewed-by: Zhigang Gong commit 752a79562eb13f59fa54b4181d65367c8488c0a5 Author: Gaetan Nadon Date: Sun Dec 8 16:43:08 2013 -0500 Fix glamor_egl->egl_create_image_khr makes pointer from integer This is a warning, but a real problem can occur on some system. Reported-by: Fabio Pedretti Reviewed-by: Axel Davy Signed-off-by: Gaetan Nadon Reviewed-by: Zhigang Gong commit 7cfd9cc23270c0246d584e167fe14bf5af4571df Author: Axel Davy Date: Thu Dec 5 08:49:15 2013 +0100 Add DRI3 support to glamor This implements some DRI3 helpers to help the DDXs using glamor to support DRI3. Signed-off-by: Axel Davy Reviewed-by: Zhigang Gong commit 06ba3fdfd6162a64c149ea6fda85f9f56d7f3c31 Author: Zhigang Gong Date: Tue Nov 19 15:16:57 2013 +0800 Fixed some compilation warning/error or error checking. There is one compilation error ,cast int to pointer, when built without libgbm, reported by Gaetan Nadon. And some error checking after memory allocation, reported by Seth Arnold. There are still some similar issues in the largepixmap implementation. They are relatively more complicate due to the heavy usage of RegionXXX APIs which may allocate implicitly. Will fix them in the future. Signed-off-by: Zhigang Gong Tested-by: Gaetan Nadon commit a5321ea431376feca2dcd55cf04925dc492270fc Author: Axel Davy Date: Mon Nov 18 22:52:22 2013 +0100 Allow to create textured pixmaps from gbm_bo without using gem names This implements glamor_egl_create_textured_pixmap_from_gbm_bo, which is similar to glamor_egl_create_textured_pixmap, except it takes a gbm_bo as argument. Signed-off-by: Axel Davy Reviewed-by: Zhigang Gong commit 403004fe799f293bf299fe78da821635b19d9a1a Author: Fabio Pedretti Date: Mon Nov 4 12:08:42 2013 +0100 glamor: remove unused variable Reviewed-by: Zhigang Gong commit 842cd7eb4353492bc9c29439f975c3bd33445cbd Author: Maarten Lankhorst Date: Wed Nov 6 10:25:27 2013 +0100 fixup picture in SetWindowPixmap When creating a window with recordmydesktop running, the following may happen: create picture 0x1cd457e0, with drawable 0x1327d1f0 (SetWindowPixmap is called) destroy picture 0x1cd457e0, with drawable 0x1cd65820 Obtaining format for pixmap 0x1327d1f0 and picture 0x1cd457e0 ==7989== Invalid read of size 4 ==7989== at 0x8CAA0CA: glamor_get_tex_format_type_from_pixmap (glamor_utils.h:1252) ==7989== by 0x8CAD1B7: glamor_download_sub_pixmap_to_cpu (glamor_pixmap.c:1074) ==7989== by 0x8CA8BB7: _glamor_get_image (glamor_getimage.c:66) ==7989== by 0x8CA8D2F: glamor_get_image (glamor_getimage.c:92) ==7989== by 0x29AEF2: miSpriteGetImage (misprite.c:413) ==7989== by 0x1E7674: compGetImage (compinit.c:148) ==7989== by 0x1F5E5B: ProcShmGetImage (shm.c:684) ==7989== by 0x1F686F: ProcShmDispatch (shm.c:1121) ==7989== by 0x15D00D: Dispatch (dispatch.c:432) ==7989== by 0x14C569: main (main.c:298) ==7989== Address 0x1cd457f0 is 16 bytes inside a block of size 120 free'd ==7989== at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==7989== by 0x228897: FreePicture (picture.c:1477) ==7989== by 0x228B23: PictureDestroyWindow (picture.c:73) ==7989== by 0x234C19: damageDestroyWindow (damage.c:1646) ==7989== by 0x1E92C0: compDestroyWindow (compwindow.c:590) ==7989== by 0x20FF85: DbeDestroyWindow (dbe.c:1389) ==7989== by 0x185D46: FreeWindowResources (window.c:907) ==7989== by 0x1889A7: DeleteWindow (window.c:975) ==7989== by 0x17EBF1: doFreeResource (resource.c:873) ==7989== by 0x17FC1B: FreeClientResources (resource.c:1139) ==7989== by 0x15C4DE: CloseDownClient (dispatch.c:3402) ==7989== by 0x2AB843: CheckConnections (connection.c:1008) ==7989== (II) fail to get matched format for dfdfdfdf The fix is to update the picture pointer when the window pixmap is changed, so it moves the picture around with the window rather than the pixmap. This makes FreePicture work correctly. Signed-off-by: Maarten Lankhorst Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71088 Reviewed-by: Zhigang Gong commit 2925db6616944c8d1e911caee0637a00e5586576 Author: Zhigang Gong Date: Sat Nov 2 00:08:11 2013 +0800 Fixed an incorrect printf format. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69573 Signed-off-by: Zhigang Gong commit 644e05562e401f192c93964be06c33fe92099089 Author: Brian Paul Date: Sat Oct 19 16:10:54 2013 -0600 Remove useless return statement Reviewed-by: Zhigang Gong commit 8c51eb8239247c98057eb9daf06c905a1dc0588c Author: Brian Paul Date: Sat Oct 19 16:10:53 2013 -0600 Remove redundant dispatch->glEnable(GL_TEXTURE_2D) The same call was already made a few lines earlier. Reviewed-by: Zhigang Gong commit 3bf1eb577e2d2b4d55d38b5a0043b0efb9abb385 Author: Brian Paul Date: Sat Oct 19 16:10:52 2013 -0600 Fix _glamor_set_spans() bug (re-used 'n' variable) n was used as a function parameter. But inside the for (i=1..n) loop, n got reassigned as REGION_NUM_RECTS() and then decremented to zero by the while loop. This caused the for loop to only iterate once instead of 'n' times. This patch renames the n parameter to numPoints. Found by code inspection. Untested. Reviewed-by: Zhigang Gong commit 2f62bd46cc002af57f8fe3246b9aea9e0c0bbcc9 Author: Grigori Goronzy Date: Wed Oct 2 00:37:57 2013 +0200 glamor_render: fix PictFilters Add Fast/Good/Best and appropriately map to Nearest and Bilinear. Additionally, add a fallback path for unsupported filters. Notably, this fixes window shadow rendering with Compiz, which uses PictFilterConvolution for some odd reason. Reviewed-by: Alex Deucher Reviewed-by: Zhigang Gong commit 5695708ecd2a26fcb9c05985c6758e719071995a Author: Grigori Goronzy Date: Wed Oct 2 00:37:56 2013 +0200 Use GL_STATIC_DRAW for element index buffer The buffer never changes anyway. Reviewed-by: Alex Deucher Reviewed-by: Zhigang Gong commit 8afa008ec4b393666bb3c506a711b4d50cc4e756 Author: Grigori Goronzy Date: Wed Oct 2 00:37:55 2013 +0200 Use glDrawRangeElements instead of glDrawElements This lets us explicitly specify the range of vertices that are used, which the OpenGL driver can use for optimization. Particularly, it results in lower CPU overhead with Mesa-based drivers. Reviewed-by: Alex Deucher Reviewed-by: Zhigang Gong commit 229601e080aefad21927c1449cd520733317858b Author: Zhigang Gong Date: Fri Sep 27 05:25:54 2013 +0800 Shoud return null subpixmap if we fail to get a valid map address. The patch is prepared by Raul Fernandes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86693 Signed-off-by: Zhigang Gong commit e3d1d4e3caaab8076eba89b58d037d24e203e506 Author: Dave Airlie Date: Mon Sep 23 06:42:24 2013 +0100 glamor: add initial Xv support This does YV12 and I420 for now, not sure if we can do packed without a GL extension. Signed-off-by: Dave Airlie Reviewed-by: Alex Deucher commit 39e95cd0f50cf471d8220d5428788d5be6a59d3f Author: Michel Dänzer Date: Fri Sep 20 10:41:10 2013 +0200 Reset traps_count and ptrap when necessary for the next trapezoid cliprect Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64912 Signed-off-by: Michel Dänzer Reviewed-by: He Junyan Reviewed-by: Zhigang Gong commit 61fca4342a65be2dbc7f890f2e67da56a50db978 Author: Michel Dänzer Date: Tue Sep 17 13:25:02 2013 +0200 Fix RegionContainsRect test for PutImage The return value of RegionContainsRect() is not a boolean but an enum indicating that the region contains the rectangle completely, partially or not at all. We can only take the PutImage fastpath when the region contatins the rectangle completely. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65964 Signed-off-by: Michel Dänzer Reviewed-by: Zhigang Gong commit 2ea618f2cf906fec9807b321f9e8ef3a4706c708 Author: Christian König Date: Mon Aug 26 14:57:47 2013 +0800 Use GBM_LIBS and GBM_CFLAGS Signed-off-by: Christian König Reviewed-by: Michel Dänzer commit 7e818f7d39cfef2701fe9cf95c7854ee8c9f3be6 Author: Armin K Date: Wed Mar 13 18:49:32 2013 +0100 First attempt to make libglamor.so shared versioned library As recommended by Michel in this thread reply: http://lists.freedesktop.org/archives/glamor/2013-March/000305.html v2: Correct shared library location in glamor.pc.in Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62259 Reviewed-by: Michel Dänzer commit b0318b6de7a2f8c5d9e75b55211dcc0b12f811fc Author: Armin K Date: Wed Mar 13 18:28:58 2013 +0100 Properly dist necesary headers Reviewed-by: Michel Dänzer commit fc179bb863778c03288bebaa258358ccbdb6aa0c Author: Armin K Date: Wed Mar 13 18:28:57 2013 +0100 Silence Automake 1.13 warnings warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') Reviewed-by: Michel Dänzer commit 97416e3f144606728a963aa2a337b1283e156ad2 Author: Michel Dänzer Date: Wed Mar 13 17:15:33 2013 +0100 glamoregl: Use xf86ScreenToScrn() Fixes crashes when glamor is used for a GPU screen with xserver 1.13 or newer. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57200#c17 Signed-off-by: Michel Dänzer Reviewed-by: Chris Wilson commit 4c5bfd529f6f182a3f0ac1b9bb5c3170a297f460 Author: Dave Airlie Date: Sat Dec 29 06:42:30 2012 +0000 glamor_utils: fix unlikely define use using a define across a split line expression is failure, compiling with warnings shows this up. Signed-off-by: Dave Airlie commit 6b954880c25af353dd4679cfdad6664b107d4df6 Author: Dave Airlie Date: Sat Dec 29 06:42:10 2012 +0000 glamor: add compiler.h This is also required for distchecking. Signed-off-by: Dave Airlie commit efbdc9e90f36494b07508aeaba40c9eb01eab398 Author: Dave Airlie Date: Sat Dec 29 06:28:17 2012 +0000 glamor: fix make distcheck part 1 This just adds the headers, then it falls over on the sdk_HEADERS as it overrides proper install paths by the looks of it. Signed-off-by: Dave Airlie commit 80f5e21daeed79654d6e1976f2766eb528f01d47 Author: Zhigang Gong Date: Tue Nov 13 10:08:02 2012 +0800 glamor_compositerects: Need to initialize region before fallback. As we need to call DamageRegionAppend even for fallback path, we must initialize the region before do that. Pointed by Igor Vagulin. https://bugs.freedesktop.org/show_bug.cgi?id=56940 Signed-off-by: Zhigang Gong commit 14e02f5132d7b4f50c8d9f8e5c6a0f285a3f3c14 Author: Michel Dänzer Date: Wed Oct 31 16:56:00 2012 +0100 Don't use glBlitFramebufferEXT for overlapping copies. According to the GL_EXT_framebuffer_blit spec, the result of doing so is undefined. But we need well-defined results. :) Signed-off-by: Michel Dänzer commit e846f48f489e33e270db682b1b6c8e6f03fdf313 Author: Zhigang Gong Date: Wed Aug 8 20:43:38 2012 +0800 Increase vbo size to 64K verts. This commit will benefit vertex stressing cases such as aa10text/rgb10text, and can get about 15% performance gain. Signed-off-by: Zhigang Gong Acked-by: Junyan commit b8f0a2188295f6cc2c997b6639b6928323eae617 Author: Zhigang Gong Date: Wed Aug 8 20:11:43 2012 +0800 Silence compilation warnings. After increase to gcc4.7, it reports more warnings, now fix them. Signed-off-by: Zhigang Gong Tested-by: Junyan He commit 50614451adafc816ae5ffbe9c2a97a58f493b927 Author: Zhigang Gong Date: Wed Aug 8 20:08:12 2012 +0800 glamor_largepixmap: Fixed a bug in repeat clipping. If the repeat direction only has one block, then we need to set the dx/dy to cover all the extent. This commit also silence some compilation warnings. Signed-off-by: Zhigang Gong commit 7eb434918bd7d58162c53fac9316aceda136cb6f Author: Michel Dänzer Date: Tue Aug 7 18:16:58 2012 +0200 Prefer KHR_surfaceless_context EGL extension over KHR_surfaceless_opengl/gles2. Current Mesa Git only advertises the former instead of the latter. Signed-off-by: Michel Dänzer Signed-off-by: Zhigang Gong commit 59653fa08a67a0694b3408407f5f92af99470739 Author: Michel Dänzer Date: Tue Aug 7 18:13:32 2012 +0200 Print space between name of missing EGL extension and 'required'. Signed-off-by: Michel Dänzer Signed-off-by: Zhigang Gong commit c3096c5a568c9c7b5f8a68ca882d866b8fb8e3ad Author: Junyan He Date: Tue Aug 7 05:01:59 2012 +0800 Fallback to pixman when trapezoid mask is big. The trapezoid generating speed of the shader is relatively slower when the trapezoid area is big. We fallback when the trapezoid's width and height is bigger enough. The big traps number will also slow down the render because of the VBO size. We fallback if ntrap > 256 Signed-off-by: Junyan He Reviewed-By: Zhigang Gong commit f62f4d53ef91ba05cc9456b1468cd1b24252454f Author: Zhigang Gong Date: Thu Aug 2 18:07:07 2012 +0800 glamor_glyphs: When dst arg point to a NULL buffer, dont't flush. This is a corner case, when we render glyphs via mask cache, and when we need to upload new glyphs cache, we need to flush both the mask and dest buffer. But we the dest arg may point to a NULL buffer at that time, we need to check it firstly. If the dest buffer is NULL. Then we don't need to flush both the dest and mask buffer. This commit fix a potential crash. Signed-off-by: Zhigang Gong commit e7af7cb76dade31b9e40cede7ac21d32bc95831c Author: Zhigang Gong Date: Wed Aug 1 18:27:29 2012 +0800 glamor_trapezoid: workaround a glsl like problem. It seems that the following statement cann't run as expected on SNB. bool trap_left_vertical = (abs(trap_left_vertical_f - 1.0) <= 0.0001); Have to rewrite it to another style to let the vertical edge trapezoid to be rendered correctly. Reviewed-by: Junyan He Signed-off-by: Zhigang Gong commit 5512c14e346a988f6eb8cdf9385a868ef705450c Author: Junyan He Date: Fri Jul 20 05:52:57 2012 +0800 Fix the problem of VBO leak. In some cases we allocate the VBO but have no vertex to emit, which cause the VBO fail to be released. Fix it. Signed-off-by: Junyan He commit 9f78e22fa62d8f1a08d6a0688e2eafba35206a3b Author: Junyan He Date: Fri Jul 20 05:52:50 2012 +0800 Just use the shader to generate trapezoid if PolyMode == Imprecise The precise mode of trapezoid rendering need to sample the trapezoid on the centre points of an (2*n+1)x(2*n-1) subpixel grid. It is computationally expensive in shader, and we use inside area ratio to replace it. The result has some difference, and we just use it if the polymode == Imprecise. Signed-off-by: Junyan He commit fe024a78220a6d61c6b1df89166da953b19b633a Author: Junyan He Date: Fri Jul 20 05:52:43 2012 +0800 Change the trapezoid render to use VBO. Because some uniform variables need to be set for every trapezoid rendering, we can not use vbo to render multi trapezoids one time, which have performance big loss. We now add attributes which contain the same value to bypass the uniform variable problem. The uniform value for one trapezoid will be set to the same value to all the vertex of that trapezoid as an attribute, then in FS, it is still a constant. Signed-off-by: Junyan He commit 9dff3378e5c39b346985924f9ab6291069cc7b6e Author: Zhigang Gong Date: Mon Jul 16 17:27:22 2012 +0800 Added the missed header file for xorg 1.13 compat. Signed-off-by: Zhigang Gong commit bc1b412b3b0bb716702ec89ae512f2b5ec62c17a Author: Zhigang Gong Date: Mon Jul 16 11:25:09 2012 +0800 Synch with xorg 1.13 change. As xorg 1.13 change the scrn interaces and remove those global arrays. Some API change cause we can't build. Now fix it. Signed-off-by: Zhigang Gong commit 4c27ca4700e4ba4ae19d77377a7776eb32f74647 Author: Zhigang Gong Date: Fri Jul 13 09:20:02 2012 +0800 gles2: Fixed the compilation problem and some bugs. Previous patch doesn't set the offset to zero for GLESv2 path. Now fix it. This patch also fix a minor problem in pixmap uploading preparation. If the revert is not REVERT_NORMAL, then we don't need to prepare a fbo for it. As current mesa i965 gles2 driver doesn't support to set a A8 texture as a fbo target, we must fix this problem. As some A1/A8 picture need to be uploaded, this is the only place a A8 texture may be attached to a fbo. This patch also enable the shader gradient for GLESv2. The reason we disable it before is that some glsl linker doesn't support link different objects which have cross reference. Now we don't have that problem. Signed-off-by: Zhigang Gong commit 006fe0e66df4b214ca5c50241b3cca22d31161df Author: Michel Dänzer Date: Thu Jul 12 18:57:06 2012 +0800 Stream vertex data to VBOs. Reviewed-by: Chris Wilson Signed-off-by: Zhigang Gong commit 551ca11c77d0524ceb37eb26caf0c25e4d7d806f Author: Michel D=C3=A4nzer Date: Wed Jul 11 15:01:15 2012 +0800 Fix translation of clip region for composite fallback. Fixes incorrectly clipped rendering. E.g. the cursor in Evolution composer windows became invisible. Signed-off-by: Michel Daenzer Signed-off-by: Zhigang Gong commit 88c317fb1e6a9056acab4a76c0ee0bf283e001ce Author: Zhigang Gong Date: Wed Jul 4 17:59:25 2012 +0800 glamor_glyphs: Don't merge extents for different lists. If we merge all lists's extent together, than we may have some fail overlap checking. Here is a simple: A E B F C D The first list has vertical "ABCD". And the second list has two char "EF". When detecting E, it can successfully find it doesn't overlap with previous glyphs. But after that, the original code will merge the previous extent with E's extent, then the extent will cover "F", so when detecting F, it will be treated as overlapped. We can simply solve this issue by not merge extent from different list. We can union different list's extent to a global region. And then do the intersect checkint between that region and current glyph extent, then we can avoid that fail checking. Signed-off-by: Zhigang Gong commit 32a7438bf79573100862ad91c5722d12623a8bf9 Author: Zhigang Gong Date: Tue Jul 3 18:24:07 2012 +0800 glamor_copyarea: Use blitcopy if current state is not render. Practically, for pure 2D blit, the blit copy is much faster than textured copy. For the x11perf copywinwin100, it's about 3x faster. But if we have heavy rendering/compositing, then use textured copy will get much better (>30%)performance for most of the cases. So we simply add a data element to track current state. For rendering state we use textured copy, otherwise, we use blit copy. Signed-off-by: Zhigang Gong commit 0706423bcfd7a589bab3b41fe9f13d0b636ecdef Author: Zhigang Gong Date: Tue Jul 3 18:11:12 2012 +0800 glamor_glyphs: Use cache picture to store mask picture if possible. By default, mask picture is newly created, and each time we need to clear the whole mask picture, and then composite glyphs to the mask picture and then composite the mask picture to destination. Testing results shows that the filling of the mask picture takes a big portion of the rendering time. As we don't really need to clear the whole region, we just need to clear the real overlapped region. This commit is to solve this issue. We split a large glyphs list to serval lists and each list is non-overlapped or overlapped. we can reduce the length of overlapped glyphs to do the glyphs_via_mask to 2 or 3 glyphs one time for most cases. Thus it give us a case to allocate a small portion of the corresponding cache directly as the mask picture. Then we can rendering the glyphs to this mask picture, and latter we can accumulate the second steps, composite the mask to the dest with the other non-overlapped glyphs's rendering process. It also make us implement a batch mask cache blocks clearing algorithm to avoid too frequently small region clearing. If there is no any overlapping, this method will not get performance gain. If there is some overlapping, then this algorithm can get about 15% performance gain. Signed-off-by: Zhigang Gong commit 4d1a2173f2e5a200d1535a4a459fffd75cd5f779 Author: Zhigang Gong Date: Wed Jun 27 12:53:40 2012 +0800 glamor_compositerects: Implement optimized version. Don't call miCompositeRects. Use glamor_composite_clipped_region to render those boxes at once. Also add a new function glamor_solid_boxes to fill boxes at once. Signed-off-by: Zhigang Gong commit dd7924339803b51332e3fe94d36eb48549e9d24d Author: Zhigang Gong Date: Tue Jun 26 20:00:21 2012 +0800 optimize: Use likely and unlikely. Signed-off-by: Zhigang Gong commit d5f03ba0109bc50e159c82d3d67cffa8fc174134 Author: Zhigang Gong Date: Tue Jun 26 19:56:27 2012 +0800 create_pixmap: use texture for large glyphs. As we only cache glyphs smaller than 64x64, we need to use texutre for the large glyphs. Signed-off-by: Zhigang Gong commit 90dd6ddbab864aa6c3add55c46a85d7db2c125f6 Author: Zhigang Gong Date: Tue Jun 26 17:19:16 2012 +0800 glamor_copyarea: Fixed a bug introduced by 996194... Default return value should be FALSE. Signed-off-by: Zhigang Gong commit b8dd2a597de455ae985302d1b93d865ef9f37c7b Author: Zhigang Gong Date: Tue Jun 26 16:24:32 2012 +0800 glamor_glyphs: Slightly performance tuning. As glamor_glyphs never fallback, we don't need to keep the underlying glyphs routines, just override the ps->glys Signed-off-by: Zhigang Gong commit 3873d412f018b975feaa000cb7ef337feaeee37d Author: Zhigang Gong Date: Tue Jun 26 15:39:24 2012 +0800 glamor_render: Don't allocate buffer for vbo each time. We can reuse the last one if the last one is big enough to contain current vertext data. In the meantime, Use MapBufferRange instead of MapBuffer. Testing shows, this patch brings some benefit for aa10text/rgb10text. Not too much, but indeed faster. Signed-off-by: Zhigang Gong commit 682f5d2989306856c0c193b0b4abd8c104a9ba92 Author: Zhigang Gong Date: Tue Jun 26 13:09:05 2012 +0800 glamor_largepixmap: Walkaround for large texture's upload. I met a problem with large texture (larger than 7000x7000)'s uploading on SNB platform. The map_gtt get back a mapped VA without error, but write to that virtual address triggers BUS error. This work around is to avoid that direct uploading. Signed-off-by: Zhigang Gong commit 37d4022f01483eefe06b5f12e13ca2ed4003c8f0 Author: Zhigang Gong Date: Mon Jun 25 23:24:37 2012 +0800 glamor_render: Optimize the two pass ca rendering. For the componentAlpha with PictOpOver, we use two pass rendering to implement it. Previous implementation call two times the glamor_composite_... independently which is very inefficient. Now we change the control flow, and do the two pass internally and avoid duplicate works. For the x11perf -rgb10text, this optimization can get about 30% improvement. Signed-off-by: Zhigang Gong commit 21916cf84f0cd9ada8701650d39b5cf67646eaf7 Author: Zhigang Gong Date: Mon Jun 25 16:37:22 2012 +0800 glamor_composite_glyph: Optimize glyphs with non-solid pattern. Signed-off-by: Zhigang Gong commit c1bd50d58d2c7b39e2b5c529bd86fde1ab14d8e6 Author: Zhigang Gong Date: Thu Jun 21 19:30:51 2012 +0800 glamor_glyphs: Detect fake or real glyphs overlap. To split a glyph's extent region to three sub-boxes as below. left box 2 x h center box (w-4) x h right box 2 x h Take a simple glyph A as an example: * __* *__ ***** * * ~~ ~~ The left box and right boxes are both 2 x 2. The center box is 2 x 4. The left box has two bitmaps 0001'b and 0010'b to indicate the real inked area. The right box also has two bitmaps 0010'b and 0001'b. And then we can check the inked area in left and right boxes with previous glyph. If the direction is from left to right, then we need to check the previous right bitmap with current left bitmap. And if we found the center box has overlapped or we overlap with not only the previous glyph, we will treat it as real overlapped and will render the glyphs via mask. If we only intersect with previous glyph on the left/right edge. Then we further compute the real overlapped bits. We set a loose check criteria here, if it has less than two pixel overlapping, we treat it as non-overlapping. With this patch, The aa10text boost fom 1660000 to 320000. Almost double the performance! And the cairo test result is the same as without this patch. Signed-off-by: Zhigang Gong commit ea4c22716ca1544e924c7462db6a2797afebff59 Author: Zhigang Gong Date: Thu Jun 21 19:29:06 2012 +0800 glamor_render: Don't fallback when rendering glyphs with OpOver. Signed-off-by: Zhigang Gong commit 7acbe895618837305cf4050731ccd1cd3bc11589 Author: Zhigang Gong Date: Thu Jun 21 19:27:07 2012 +0800 glamor_create_pixmap: Allocate glyphs pixmap in memory. As we have glyphs atlas cache, we don't need to hold each glyphs on GPU. And for the subsequent optimization, we need to store the original glyphs pixmap on system memory. Signed-off-by: Zhigang Gong commit 1e4fc85a71cc6498a7e11872026062fceb5bbdf1 Author: Zhigang Gong Date: Thu Jun 21 19:26:28 2012 +0800 glamor_fbo: fix a memory leak for large pixmap. Signed-off-by: Zhigang Gong commit 2122e60bf9027b63ddc59c0aa2a441af3687cb3a Author: Junyan He Date: Fri Jun 15 09:00:15 2012 +0800 Fix a bug for trapezoid clip We find in some cases the trapezoid will be render as a triangle and the left edge and right edge will cross with each other just bellow the top or over the bottom. The distance between the cross poind and the top or bottom is less than pixman_fixed_1_minus_e, so after the fixed converted to int, the cross point has the same value with the top or botton and the triangle should not be affected. But in our clip logic, the cross point will be clipped out. So add a logic to fix this problem. Signed-off-by: Junyan He commit 6ed418d17b5143f32b3b415103f3157a1b05e3db Author: Zhigang Gong Date: Fri Jun 15 13:31:30 2012 +0800 gles2_largepixmap: force clip for a non-large pixmap. One case we need force clip when download/upload a drm_texture pixmap. Actually, this is only meaningful for testing purpose. As we may set the max_fbo_size to a very small value, but the drm texture may exceed this value but the drm texture pixmap is not largepixmap. This is not a problem with OpenGL. But for GLES2, we may need to call glamor_es2_pixmap_read_prepare to create a temporary fbo to do the color conversion. Then we have to force clip the drm pixmap here to avoid large pixmap handling at glamor_es2_pixmap_read_prepare. Signed-off-by: Zhigang Gong commit c41d5c79e7d8772be38b77122817fb872f2d721d Author: Zhigang Gong Date: Fri Jun 15 09:03:42 2012 +0800 glamor_emit_composite_vert: Optimize to don't do two times vert coping. We change some macros to put the vert to the vertex buffer directly when we cacluating it. This way, we can get about 4% performance gain. This commit also fixed one RepeatPad bug, when we RepeatPad a not eaxct size fbo. We need to calculate the edge. The edge should be 1.0 - half point, not 1.0. Signed-off-by: Zhigang Gong commit 8656ddbbe7a38e5cd15e6d006bba19778e34e9e9 Author: Zhigang Gong Date: Fri Jun 15 08:46:24 2012 +0800 glamor_glyphs: Before get upload to cache flush is needed. When we can't get a cache hit and have to evict one cache entry to upload new picture, we need to flush the previous buffer. Otherwise, we may get corrupt glyphs rendering result. This is the reason why user-font-proxy may fail sometimes. Signed-off-by: Zhigang Gong commit 016995334e6acfad41574a9270b716db98ec697f Author: Zhigang Gong Date: Fri Jun 15 08:43:37 2012 +0800 copyarea: Cleanup the error handling logic. Should use ok rather than mixed ok or ret. Signed-off-by: Zhigang Gong commit b4a499b7db068117801770b7ab80416014822101 Author: Zhigang Gong Date: Tue Jun 12 18:21:10 2012 +0800 trapezoid: Fallback to sw-rasterize for largepixmap. Signed-off-by: Zhigang Gong commit 8f31aed48ca9412f8f5df9c3d47d938c7c90bccb Author: Junyan He Date: Tue Jun 5 03:21:03 2012 +0800 Use the direct render path for A1 Because when mask depth is 1, there is no Anti-Alias at all, in this case, the directly render can work well and it is faseter. Signed-off-by: Junyan He commit fa74a213ad175cb0920905a8011c62efdd348d45 Author: Junyan He Date: Mon Jun 4 07:52:05 2012 +0800 Add the trapezoid direct render logic We firstly get the render area by clipping the trapezoid with the clip rect, then split the clipped area into small triangles and use the composite logic to generate the result directly. This manner is fast but have the problem that some implementation of GL do not implement the Anti-Alias of triangles fill, so the edge sometimes has sawtooth. It is not acceptable when use trapezoid to approximate circles and wide lines. Signed-off-by: Junyan He commit 5f1560c84aa386bb12dc6ec3daeb93e0f63c09c2 Author: Junyan He Date: Mon Jun 4 07:22:27 2012 +0800 Modilfy the composite logic to two phases We seperate the composite to two phases, firstly to select the shader according to source type and logic op, setting the right parameters. Then we emit the vertex array to generate the dest result. The reason why we do this is that the shader may be used to composite no only rect, trapezoid and triangle render function can also use it to render triangles and polygens. The old function glamor_composite_with_shader do the whole two phases work and can not match the new request. Signed-off-by: Junyan He commit 0b0391765f3ca0192b00f4970c9453934d529397 Author: Junyan He Date: Mon Jun 4 03:18:40 2012 +0800 Add macro of vertex setting for triangle stripe Add macro of vertex setting for triangle stripe draw, and make the code clear. Signed-off-by: Junyan He commit bd180be619c2ef469ca40cf95023340c59960540 Author: RobinHe Date: Sat Jun 2 22:00:09 2012 +0800 Use shader to generate the temp trapezoid mask The old manner of trapezoid render uses pixman to generate a mask pixmap and upload it to the GPU. This effect the performance. We now use shader to generate the temp trapezoid mask to avoid the uploading of this pixmap. We implement a anti-alias manner in the shader according to pixman, which will caculate the area inside the trapezoid dividing total area for every pixel and assign it to the alpha value of that pixel. The pixman use a int-to-fix manner to approximate but the shader use float, so the result may have some difference. Because the array in the shader has optimization problem, we need to emit the vertex of every trapezoid every time, which will effect the performance a lot. Need to improve it. Signed-off-by: Junyan He commit 6dd81c5939197eb51bc31ffbc3e6f359f2aad191 Author: RobinHe Date: Sat Jun 2 21:52:25 2012 +0800 Create the file glamor_triangles.c Create the file glamor_trapezoid.c, extract the logic relating to trapezoid from glamor_render.c to this file. Signed-off-by: Junyan He commit bf38ee407ba1038a25efa58b8475bcf084a21042 Author: Zhigang Gong Date: Mon Jun 11 14:02:59 2012 +0800 Enable large pixmap by default. Signed-off-by: Zhigang Gong commit 8ca16754f7e95e47423183bbd5f72966b937f6c8 Author: Zhigang Gong Date: Mon Jun 11 13:05:48 2012 +0800 largepixmap: Fix the selfcopy issue. If the source and destination are the same pixmap/fbo, and we need to split the copy to small pieces. Then we do need to consider the sequence of the small pieces when the copy area has overlaps. This commit take the reverse/upsidedown into the clipping function, thus it can generate correct sequence and avoid corruption self copying. Signed-off-by: Zhigang Gong commit 5325c800f706f46085735d608f57d513da63cddf Author: Zhigang Gong Date: Mon Jun 11 11:42:46 2012 +0800 largepixmap: Support self composite for large pixmap. The simplest way to support large pixmap's self compositing is to just clone a pixmap private data structure, and change the fbo and box to point to the correct postions. Don't need to copy a new box. Signed-off-by: Zhigang Gong commit 1d2d858b8daacdd349084433a8af60d559fb6a9d Author: Zhigang Gong Date: Mon Jun 11 09:36:56 2012 +0800 largepixmap: Add transform/repeat/reflect/pad support. This commit implement almost all the needed functions for the large pixmap support. It's almost complete. Signed-off-by: Zhigang Gong commit 48916a23a92366128f5a1eeb08949d8d32383c32 Author: Zhigang Gong Date: Mon Jun 11 02:27:00 2012 +0800 glamor_getimage: should call miGetimage if failed to get sub-image. Signed-off-by: Zhigang Gong commit 56d6e7a85fbe8e50c38efda0f59f09aac52b769a Author: Zhigang Gong Date: Mon Jun 11 02:24:41 2012 +0800 glamor_putimage: Correct the wrong stride value. We should not use the destination pixmap's devkind as the input image data's stride. Signed-off-by: Zhigang Gong commit eb6f981ba4d3a4aff1b3651bdad3cd7a52233b41 Author: Zhigang Gong Date: Mon Jun 11 02:15:53 2012 +0800 largepixmap: Enable glamor_composite. Now we start to enable glamor_composite on large pixmap. We need to do a three layer clipping to split the dest/source/mask to small pieces. This commit only support non-transformation and repeat normal case. Signed-off-by: Zhigang Gong commit e96ea02010874a3a46f212f42134083bd29fefe3 Author: Zhigang Gong Date: Mon Jun 11 01:52:14 2012 +0800 largepixmap: Implement infrastructure for large pixmap. Added infrastructure for largepixmap, this commit implemented: 1. Create/Destroy large pixmap. 2. Upload/Download large pixmap. 3. Implement basic repeat normal support. 3. tile/fill/copyarea large pixmap get supported. The most complicated part glamor_composite still not implemented. Signed-off-by: Zhigang Gong commit ace35e408cd7a79c5215bbd0f14b624d8d949e34 Author: Zhigang Gong Date: Mon Jun 11 01:02:30 2012 +0800 glamor_largepixmap: first commit for large pixmap. This is the first commit to add support for large pixmap. The large here means a pixmap is larger than the texutre's size limitation thus can't fit into one single texutre. The previous implementation will simply fallback to use a in memory pixmap to contain the large pixmap which is very slow in practice. The basic idea here is to use an array of texture to hold the large pixmap. And when we need to get a specific area of the pixmap, we just need to compute/clip the correct region and find the corresponding fbo. We need to implement some auxiliary routines to clip every rendering operations into small pieces which can fit into one texture. The complex part is the transformation/repeat/repeatReflect and repeat pad and their comination. We will support all of them step by step. This commit just add some necessary data structure to represent the large pixmap, and doesn't change any rendering process. This commit doesn't add real large pixmap support. Signed-off-by: Zhigang Gong commit 4c174f4c9ce1514ef226e9de97e5c87a46a75524 Author: Junyan He Date: Tue May 15 10:08:03 2012 +0800 Fix the problem of x_source and y_source causing radial error The x_source and y_source cause some problem in gradient. The old way to handle it by recaulate P1 P2 to minus the x_source and y_source, but this causes problem in radial shader. Now we modify the manner to set the texture coordinates: (x_source, y_source) --> (x_source + width, y_source + height) to handle all the cases. Reviewed-by: Zhigang Gong Signed-off-by: Junyan He Signed-off-by: Zhigang Gong commit 553910d08b93ef80cc25fcbfd7876726778bc655 Author: Junyan He Date: Tue May 15 10:07:55 2012 +0800 Fix the problem of vertical and horizontal case error in linear gradient. 1. The vertical and horizontal judgement in linear gradient have problem when p1 point and p2 point distance is very small but the gradient pict have a transform matrix which will convert the X Y coordinates to small values. So the judgement is not suitable. Because this judgement's purpose is to assure the divisor not to be zero, so we simply it to enter horizontal judgement when p1 and p2's Y is same. Vertical case is deleted. 2. Delete the unused p1 p2 uniform variable. Reviewed-by: Zhigang Gong Signed-off-by: Junyan He Signed-off-by: Zhigang Gong commit 41aa93c393c8760aae357725db63fa4a8f798557 Author: Junyan He Date: Tue May 15 10:07:46 2012 +0800 Fix the problem of set the same stop several times. Some gradient set the stops at the same position, for example: firstly 0.5 to red color and then set 0.5 to blue. This kind of setting will cause the shader work not correctly because the percentage caculating need to use the stop[i] - stop[i-1] as dividend. The previous patch we just kill some stop if the distance between them is 0. But this cause the problem that the color for next stop is wrong. We now modify to handle it in the shader to avoid the 0 as dividend. Reviewed-by: Zhigang Gong Signed-off-by: Junyan He Signed-off-by: Zhigang Gong commit 09de37ec1c0543c8073f934274c84b3b7d5f31ae Author: Junyan He Date: Tue May 15 10:07:35 2012 +0800 Fix a bugy macro definition. The macro like "#define LINEAR_SMALL_STOPS 6 + 2" causes the problem. When use it to define like "GLfloat stop_colors_st[LINEAR_SMALL_STOPS*4];" The array is small than what we supposed it to be. Cause memory corruption problem and cause the bug of render wrong result. Fix it. Signed-off-by: Junyan He Signed-off-by: Zhigang Gong commit d900f553c2bb8d6e01529524fb7125918291c406 Author: Junyan He Date: Tue May 15 10:07:24 2012 +0800 Extract the gradient related code out. 1. Extract the logic of gradient from the glamor_render.c to the file glamor_gradient.c. 2. Modify the logic of gradient pixmap gl draw. Use the logic like composite before, but the gradient always just have one rect to render, so no need to set the VB and EB, replace it with just call glDrawArrays. 3.Kill all the warning in glamor_render.c Reviewed-by: Zhigang Gong Signed-off-by: Junyan He Signed-off-by: Zhigang Gong commit 81692804645394b43832c8ec586e8e67f3e4f606 Author: Zhigang Gong Date: Tue May 15 15:25:41 2012 +0800 glamor_set_destination_pixmap_priv_nc: set drawable's width x height. Previous implementation set the whole fbo's width and height as the viewpoint. This may increase the numerical error as we may only has a partial region as the valid pixmap. So add a new marco pixmap_priv_get_dest_scale to get proper scale factor for the destination pixmap. For the source/mask pixmap, we still need to consider the whole fbo's size. Signed-off-by: Zhigang Gong commit 7f55e48499ea7bed73cb1adeac00c480263583f8 Author: Zhigang Gong Date: Tue May 15 10:52:37 2012 +0800 Remove the texture cache code. Caching texture objects is not necessary based on previous testing. To keep the code simple, we remove it. Signed-off-by: Zhigang Gong commit c5b3c2cedc8b2e486b1e3727f288c42869310387 Author: Zhigang Gong Date: Tue May 15 10:42:41 2012 +0800 Added strict warning flags to CFLAGS. We miss the strict warning flags for a long time, now add it back. This commit also fixed most of the warnings after enable the strict flags. Signed-off-by: Zhigang Gong commit 6839996b0b0fe5f4e6ef28d1dfe527092d60d28a Author: Zhigang Gong Date: Sat Apr 28 18:23:09 2012 +0800 We should not call gradient finalization code if we disable it. Signed-off-by: Zhigang Gong commit 1035fc72b9017eb2466760133ca7bbc9155c8c46 Author: Zhigang Gong Date: Sat Apr 28 14:55:34 2012 +0800 Fixed all unused variables warnings. Signed-off-by: Zhigang Gong commit 33e11cd6149294060269ed693de67b135868e094 Author: Zhigang Gong Date: Sat Apr 28 14:54:38 2012 +0800 Fixed an uninitialized problem at gradient shader functions. Signed-off-by: Zhigang Gong commit c0f75c657f36642faea4ff8c51f7e4f6971c3d19 Author: Zhigang Gong Date: Sat Apr 28 14:51:27 2012 +0800 Fixed one typo bug when fixup a mask picture. Signed-off-by: Zhigang Gong commit 5c1f15fac26b86b6cb73776db1a644d6af570da7 Author: Zhigang Gong Date: Sat Apr 28 14:13:47 2012 +0800 Added some copyright and author information. Signed-off-by: Zhigang Gong commit 0d846d95699fadcddcc77b8d6e432e969467dab2 Author: Zhigang Gong Date: Sat Apr 28 13:43:39 2012 +0800 Added --enable-debug configuration option. For release version, we disable asserts. Signed-off-by: Zhigang Gong commit 503f8ec1a670e73f41314a5e94cdde8782d7cbab Author: Zhigang Gong Date: Sat Apr 28 13:42:48 2012 +0800 Remove unecessary header file. Signed-off-by: Zhigang Gong commit 9dfd10dc75efdf4c26b7ff46b55e4a2d2453803b Author: Zhigang Gong Date: Fri Apr 27 15:34:15 2012 +0800 glamor_render: Fix the repeat none for GLES2. As GLES2 doesn't support clamp to the border, we have to handle it seprately from the normal case. Signed-off-by: Zhigang Gong commit 9fcd123aed80430b220fc4141eaa3723d7cb611e Author: Zhigang Gong Date: Thu Apr 26 20:35:09 2012 +0800 glamor_blockhandler: Don't do glFinish every time. To do glfinish every time bring some performance overhead. Signed-off-by: Zhigang Gong commit 1f83411c9a69a44944fd8afe0c167cece60c1ecb Author: Zhigang Gong Date: Thu Apr 26 19:59:58 2012 +0800 glamor_copyarea: Return earlier if have zero nbox. Almost all callers will check whether the regions is empty before call to this internal API, but it seems the glamor_composite_with_copy may call into here with a zero nbox. A little weird, as the miComputeCompositeRegion return a Non-NULL, but the region is empty. Also remove a unecessary glflush. So let's check it here. Signed-off-by: Zhigang Gong commit 20cbaa61cdca41e61526a57f13475cb31e17e5dd Author: Zhigang Gong Date: Thu Apr 26 19:57:21 2012 +0800 glamor_render: Have to use eaxct size pixmap for transformation. Use partial texture as the pixmap for the transformation source/mask may introduce extra errors. have to use eaxct size. Signed-off-by: Zhigang Gong commit 6e50ee9c108e6d7ce4ebfcd08cfc97896e8e194e Author: Zhigang Gong Date: Thu Apr 26 18:31:07 2012 +0800 glamor_fbo: Added a threshold value for the fbo cache pool. Currently set it to 256MB. If cache pool watermark increases to this value, then don't push any fbo to this pool, will purge the fbo directly. Signed-off-by: Zhigang Gong commit 540846204cce9239233c5608a29bfe0607d77e44 Author: Zhigang Gong Date: Thu Apr 26 18:28:17 2012 +0800 Fixed a1 bug. It seems that mesa has bugs when uploading bitmap to texture. We switch to convert bitmap to a8 format and then upload the a8 texture. Also added a helper routine to dump 1bpp pixmap. Signed-off-by: Zhigang Gong commit 9f53cc1c3369fc61630b238f1b347a92fabf5a5a Author: Zhigang Gong Date: Wed Apr 25 22:35:12 2012 +0800 glamor_render.c: Fixed repeatPad and repeatRelect. We should use difference calculation for these two repeat mode when we are a sub region within one texture. Signed-off-by: Zhigang Gong commit 67cf3838e4acd788b0ce413dcbe9896e2ca20e56 Author: Zhigang Gong Date: Wed Apr 25 19:50:57 2012 +0800 gradient: Don't need fixup flag when creating pixmap. Gradient can use a larger texture/fbo directly, don't need an eaxct size texture. Signed-off-by: Zhigang Gong commit 8a85071edbd90780b286fa4b19205540fb276815 Author: Zhigang Gong Date: Wed Apr 25 18:58:16 2012 +0800 glamor_copyarea: Don't access a DRM only pixmap. As EGL image/gbm only support ARGB8888 image, we don't support other format. We may change the way to use gbm directly latter. But now, we have to face this limitation, and thus if a client create a 16bpp drawable, and call get texture from pixmap then a copy to here may occur and thus we have to force retur a TRUE without do nothing. Signed-off-by: Zhigang Gong commit 0b6867dddbed186c46048c610299ac0dde6a9ef0 Author: Zhigang Gong Date: Wed Apr 25 13:54:40 2012 +0800 Disable A8 texture format for GLES2. As PVR's GLES2 implementation doesn't support A8 texture as rendering target, we disable it for now. Signed-off-by: Zhigang Gong commit 6b664dda69afa6c47ca083739093fa15fc674380 Author: Zhigang Gong Date: Wed Apr 25 13:51:58 2012 +0800 gradient: Disable gradient for gles2. As PVR glsl compiler seems doesn't support external fragment function, and fails at compile gradient shader. Disable it for now. We may need to modify gradient shader to don't use external function. Signed-off-by: Zhigang Gong commit 686a322c76fa20ed45d5bbfc9742024300e83e7d Author: Junyan He Date: Wed Apr 18 08:04:26 2012 +0800 Fix the bug caused by gradient picture set the stops at the same percentage. Fix the bug caused by gradient picture set the stops at the same percentage. The (stops[i] - stops[i-1]) will be used as divisor in the shader, which will cause problem. We just keep the later one if stops[i] == stops[i-1]. Signed-off-by: Junyan He Signed-off-by: Zhigang Gong commit 3d96929596fd3a6da41aab5cb9d7fb1cf28b2a03 Author: Junyan He Date: Wed Apr 25 14:25:39 2012 +0800 Fix the problem of memory leak in gradient pixmap generating. Fix the problem of memory leak in gradient pixmap generating. The problem caused by we do not call glDeleteShader when destroy a shader program. This patch will split the gradient pixmap generating to three category. If nstops < 6, we will use the no array version of the shader, which has the best performance. Else if nstops < 16, we use array version of the shader, which is compiled and linked at screen init stage. Else if nstops > 16, we dynamically create a new shader program, and this program will be cached until bigger nstops. Signed-off-by: Zhigang Gong commit 05da99106b81465488c9879cfd709fd4f0c7b9e5 Author: Zhigang Gong Date: Wed Apr 25 11:59:47 2012 +0800 glamor_putimage: Optimize for direct uploading and fallback path. This commit optimize two cases: 1. When the clip contains the whole area, we can directly upload the texel data to the pixmap, and don't need to do one extra clipped copy. 2. At fallback path, we don't read back the whole pixmap, just need a sub region. Signed-off-by: Zhigang Gong commit ea70ebe0ac9fe5b3d0ad553f9aeb4d2829bf9a62 Author: Zhigang Gong Date: Wed Apr 25 11:56:43 2012 +0800 Fixed one potential texture size mismatch problem. There are two cases which we may use a wrong texture size. 1. A pixmap is modified by the client side after it created it. Then the pixmap's width may mismatch the original fbo/tex's size. Thus we need to check this condition when preparing upload the pixmap. 2. We provide two API to download/upload sub region of a textured pixmap. The caller may pass in a larger width then the original pixmap's size, this may happen at putimage and setspans. We need to validate the width and height when do the downloading/uploading. Signed-off-by: Zhigang Gong commit 08e8c00fe6a21741ff9f38652c2b9fd2310f1ce5 Author: Zhigang Gong Date: Wed Apr 25 09:27:06 2012 +0800 glamor_getimage: Don't fallback to miGetImage. As miGetImage is very inefficient, we don't fallback to it. If the format is not ZPixmap, we download the required sub- region, and then call fbGetImage to do the conversion. This way is much faster than previous. Signed-off-by: Zhigang Gong commit 9bcddff93b79fd8978426d9832a5edd60ac410c0 Author: Zhigang Gong Date: Fri Apr 13 18:15:49 2012 +0800 pending_op: Remove the pending operations handling. We have disabled this feature for a long time, and previous testing shows that this(pending fill) will not bring observed performance gain. Now remove it. Signed-off-by: Zhigang Gong commit 1761768f49a356f50645da53305e6b4bdef5c5f4 Author: Zhigang Gong Date: Sun Apr 15 23:50:09 2012 +0800 glamor_upload_pixmap: Use glTexImage2D for a fully update. Currently, intel's mesa dri driver will not check pbo for a TexSubImage2D. So we use glTexImage2D if we are a fully updating. Signed-off-by: Zhigang Gong commit 2806f1eaced851e4c88055c53d706f7beef8b555 Author: Zhigang Gong Date: Sun Apr 15 23:49:38 2012 +0800 glamor_setspans: Reuse glamor_upload_sub_pixmap. Signed-off-by: Zhigang Gong commit e15bc1207480d7d198862861d40af58903b4d0f0 Author: Zhigang Gong Date: Sun Apr 15 23:18:47 2012 +0800 code clean up. Remove unused variables. Signed-off-by: Zhigang Gong commit 65c5605c9693c8d30e597ac029be936495f23927 Author: Zhigang Gong Date: Sun Apr 15 23:16:51 2012 +0800 glamor_getspans: Reuse glamor_download_sub_pixmap. Signed-off-by: Zhigang Gong commit 68a5cc6f371e1f07ce176e154331dafaf5d9ef0e Author: Zhigang Gong Date: Sun Apr 15 19:46:09 2012 +0800 glamor_render: Don't download whole picture when fallback. Signed-off-by: Zhigang Gong commit e38eb675321dce1bbc39cbd177a6398de567dd79 Author: Zhigang Gong Date: Sun Apr 15 19:43:44 2012 +0800 glamor_put_sub_pixmap: Change to use glamor_upload_sub_pixmap. As the pixmap may be attached to a picture, we need to use glamor_upload_sub_pixmap to process it. glamor_copy_n_to_n will not consider the picture case. Signed-off-by: Zhigang Gong commit ff3d2c796363ea603ab92995091a967a3f8636d7 Author: Zhigang Gong Date: Sun Apr 15 17:09:06 2012 +0800 Fixed a stride problem for textured_drm pixmap. As a textured_drm pixmap has a drm bo attached to it, and it's the DDX layer to set it stride value. In some case, the stride value is not equal to PixmapBytePad(w, depth) which is used within glamor. Then if it is the case, we have two choice, one is to set the GL_PACK_ROW_LENGTH/GL_UNPACK_ROW_LENGTH when we need to download or upload the pixmap. The other option is to change the pixmap's devKind to match the one glamor is using when downloading the pixmap, and restore it to the drm stride after uploading the pixmap. We choose the 2nd option, as GLES doesn't support the first method. Signed-off-by: Zhigang Gong commit 70b71718e737872dfdbf4f6c7285d4260a099d17 Author: Zhigang Gong Date: Sun Apr 15 14:36:09 2012 +0800 glamor_putimage: Reuse copy area to do the clipped copy. If no clip set, we load the bits to the pixmap directly. Otherwise, load the bits to a temporary pixmap and call glamor_copy_area to do the clipped copy. Signed-off-by: Zhigang Gong commit e1be714312df8d596f6be268cb8a4e390e634c36 Author: Zhigang Gong Date: Sun Apr 15 10:30:02 2012 +0800 Fixed a unbalanced glamor_put_dispatch. Signed-off-by: Zhigang Gong commit bd53e24dc32206dc978d3dc2408e1832f5a803e7 Author: Zhigang Gong Date: Sun Apr 15 22:47:48 2012 +0800 glamor_pixmap_priv: Always return a valid private pixmap. If a pixmap doesn't have a private, then set its type to GLAMOR_MEMORY, and thus it will get a valid private. Signed-off-by: Zhigang Gong commit 420af44a3aaefd4848aa24a28c330cab36049078 Author: Zhigang Gong Date: Sat Apr 14 22:40:48 2012 +0800 Don't need to set GL_PACK_ROW_LENGTH/GL_UNPACK_ROW_LENGTH. We already adjust the stride of the pixmap, and keep the alignment as 4 should be ok to let the GL/GLES match the stride. Previous version has a unbalanced PACK ROW length seting, and is buggy, now fixed it. Signed-off-by: Zhigang Gong commit 18d69fb0142088f7df230ec876c7ce2b55a41ad9 Author: Zhigang Gong Date: Fri Apr 13 13:47:05 2012 +0800 glamor_gl: Use GL_ALPHA for depth 8 pixmap. Use GL_RGBA to represent a8 pixmap is not efficient. Signed-off-by: Zhigang Gong commit 428f2a3f58a91300835aaa083ac0b291ce394dd0 Author: Zhigang Gong Date: Fri Apr 13 13:45:42 2012 +0800 glamor_pixmap_ensure_fbo: Should allocate tex if we don't have one. Signed-off-by: Zhigang Gong commit cf0e206a0ff6538eb286c06098023b9e29b00c74 Author: Zhigang Gong Date: Wed Apr 11 18:59:27 2012 +0800 glamor_polylines: Don't fallback for non-solid fill. As glamor_fill/fbFill will handle non-solid fill correctly. We don't fallback it here. Signed-off-by: Zhigang Gong commit b5bd9a2d902d44834fc43199167d7dee71c9b709 Author: Zhigang Gong Date: Wed Apr 11 18:57:33 2012 +0800 glamor_upload/download: fix 1bpp bug. For A1 to A8's conversion, the stride is different for the source and destination. Previous implementation use the same stride, and may allocate less memory than required. Thus may crash the server when uploading a A1 pixmap. Now fix it. Tested-by: Peng Li Signed-off-by: Zhigang Gong commit b0e91f0f5a3a4f74800b89ed4003d300ae138151 Author: Zhigang Gong Date: Tue Apr 10 20:50:14 2012 +0800 glamor_pixmap_upload_texture: Support to upload a sub region of data. Just as the downloading side, we can upload an sub region data to a pixmap's specified region. The data could be in memory or in a pbo buffer. Signed-off-by: Zhigang Gong commit 3061f348ca2f05d88ca2391e1ad81ce8216d69f2 Author: Zhigang Gong Date: Tue Apr 10 10:40:17 2012 +0800 glamor_getimage: Use glamor_download_sub_pixmap_to_cpu to get image. Reduce the duplicate logic. Signed-off-by: Zhigang Gong commit 3a91f169122ea0556f628f11fb473b0feed7e44b Author: Zhigang Gong Date: Tue Apr 10 10:19:30 2012 +0800 glamor_polyfillrect: Fixed a potential bug if fallback at glamor_fill. We should advance the prect after we successfully excuted the glamor_fill. And if failed, we need to add the failed 1 box back to nbox. Although, this bug will never happen currently, as glamor_fill will never fallback. Signed-off-by: Zhigang Gong commit 1f657f72cacaa1170e7e55f4b5149c69492db6a5 Author: Zhigang Gong Date: Mon Apr 9 20:20:45 2012 +0800 glamor_polyfillrect: Optimize fallback path. Download/upload required region only. Signed-off-by: Zhigang Gong commit cea0fe3e1f49fc8d86f0cc653c8089f1ea2c9f1f Author: Zhigang Gong Date: Mon Apr 9 20:16:07 2012 +0800 fallback_optimize: Prepare for downloading/uploading subregion. Introduced two function glamor_get_sub_pixmap/glamor_put_sub_pixmap, can easily used to get and put sub region of a big textured pixmap. And it can use pbo if possible. To support download a big textured pixmap's sub region to another pixmap's pbo, we introduce a new type of pixmap GLAMOR_MEMORY_MAP. This type of pixmap has a valid devPrivate.ptr pointer, and that pointer points to a pbo mapped address. Now, we are ready to refine those glamor_prepare_access/glamor_finish_access pairs. Signed-off-by: Zhigang Gong commit d9dfc3d795b7e567d53cfeed61126164be36e233 Author: Zhigang Gong Date: Mon Apr 9 16:39:42 2012 +0800 glamor_download_sub_pixmap_to_cpu: New function to download subregion. Prepare to optimize the fallback path. We choose the important rendering pathes to optimzie it by using shader. For other pathes, we have to fallback. We may continue to optimize more pathes in the future, but now we have to face those fallbacks. The original fallback is very slow and will download/upload the whole pixmap. From this commit, I will refine it to just download/upload needed part. Signed-off-by: Zhigang Gong commit d96226ac6f34aa61fc00ad15ef58c1ed1253160e Author: Zhigang Gong Date: Mon Apr 9 15:57:05 2012 +0800 glamor_es2_pixmap_read_prepare: Just prepare the required region. Don't need to prepare the whole source pixmap. Signed-off-by: Zhigang Gong commit 3dbdd40c6ce4203619f2a3492029a444bb9217af Author: Zhigang Gong Date: Mon Apr 9 10:00:57 2012 +0800 glamor_color_convert: Let the caller to provide destination buffer. As we don't need to allocate new buffer when downloading pixmap to CPU, we change the prototype of the color converting function and let the caller to provide the buffer to hold the result. All the color conversion function supports store the result just at the same place of the source. Signed-off-by: Zhigang Gong commit 4dc6d4e84b4904540d7701cfc88a9c945464f833 Author: Zhigang Gong Date: Fri Apr 6 21:20:15 2012 +0800 glyphblt/polyops: Use miFunctions by default. Calling to miFunctions give some opportunities to jump to accelerated path, so we switch to call miFunctions rather than fallback to fbFunctions directly. commit 49e3b44aa813c98c05fcb10c19882e10d751580a Author: Zhigang Gong Date: Fri Apr 6 21:17:46 2012 +0800 glamor_set_alu: Added GXclear support at glamor_solid. We don't need to issue the glamor_fallback at the glamor_set_alu routine, as the caller may support GXclear or other most frequent Ops. Leave it to the caller to determine fallback or not. Signed-off-by: Zhigang Gong commit 3b8b2c77fc4449c7b63fd2597f73562b33dc1722 Author: Zhigang Gong Date: Fri Apr 6 21:15:12 2012 +0800 getimage: Enable getimage by default. Fixed one bug when calculate the coords, should consider the drawable's x and y. Now enable it by default. Most of the time, it should be more efficient than miGetImage. Signed-off-by: Zhigang Gong commit c6ce44d88134115b42edc76e1ee961b57bae86ff Author: Zhigang Gong Date: Fri Apr 6 17:01:57 2012 +0800 render: Enable more componentAlpha support. Actually only PictOpAtop,PictOpAtopReverse and PictOpXor can't be implemented by using single source blending. All the other can be easily support. Slightly change the code to support them. Consider those three Ops are not frequenly used in real application. We simply fallback them currently. PictOpAtop: s*mask*dst.a + (1 - s.a*mask)*dst PictOpAtopReverse: s*mask*(1 - dst.a) + dst *s.a*mask PictOpXor: s*mask*(1 - dst.a) + dst * (1 - s.a*mask) The two oprands in the above three ops are all reated to dst and the blend factors are not constant (0 or 1), it's hardly to convert it to single source blend. Now, the rendercheck is runing more smoothly. Signed-off-by: Zhigang Gong commit 3e9c35bdcbdb96a67c9f2a1ea76c382aaacca7e9 Author: Zhigang Gong Date: Fri Apr 6 11:02:36 2012 +0800 glamor_set_alu: Fallback for non GXcopy ops with GLES2. As GLES2 doesn't support LogiOps, we have to fallback here. GLES2 programing guide's statement is as below: "In addition, LogicOp is removed as it is very infrequently used by applications and the OpenGL ES working group did not get requests from independent software vendors (ISVs) to support this feature in OpenGL ES 2.0." So, I think, fallback here may not a big deal ;). Signed-off-by: Zhigang Gong commit 1a238e89f39fd5aeaf6975399971123cd3e15f24 Author: Zhigang Gong Date: Thu Apr 5 22:39:41 2012 +0800 glamor_putimage: Reuse the function in pixmap.c to do the uploading. We reuse glamor_upload_bits_to_pixmap_texture to do the data uploading to texture in putimage. Besides to avoid duplicate code, this also fixed the potential problem when the data format need extra reversion which is not supported by the finish shader, as glamor_upload_bits_to_pixmap_texture will handle all conditions. Tested-by: Junyan He Signed-off-by: Zhigang Gong commit 0650c7d4be6d4c21510c953543599aea32780f24 Author: Zhigang Gong Date: Thu Apr 5 22:31:44 2012 +0800 gles2: Added 1555/2101010 formats support. Added color conversion code to support 1555/2101010 formats,now gles2 can pass the render check with all formats. We use 5551 to represent 1555, and do the revertion if downloading/uploading is needed. For 2101010, as gles2 doesn't support reading the identical formats. We have to use 8888 to represent, thus we may introduce some accurate problem. But anyway, we can pass the error checking in render check, so that may not be a big problem. Signed-off-by: Zhigang Gong commit 3add3750658107bd18592a8672caa8bed0c8931c Author: Zhigang Gong Date: Thu Apr 5 21:53:44 2012 +0800 gles2: Fixed color conversion for the formats except 1555 and 2101010. This patch fixed two major problems when we do the color convesion with GLES2. 1. lack of necessary formats in FBO pool. GLES2 has three different possible texture formats, GL_RGBA, GL_BGRA and GL_ALPHA. Previous implementation only has one bucket for all the three formats which may reuse a incorrect texture format when do the cache lookup. After this fix, we can enable fbo safely when running with GLES2. 2. Refine the format matching method in glamor_get_tex_format_type_from_pictformat. If both revertion and swap_rb are needed, for example use GL_RGBA to represent PICT_b8g8r8a8. Then the downloading and uploading should be handled differently. The picture's format is PICT_b8g8r8a8, Then the expecting color layout is as below (little endian): 0 1 2 3 : address a r g b Now the in GLES2 the supported color format is GL_RGBA, type is GL_UNSIGNED_TYPE, then we need to shuffle the fragment color as : frag_color = sample(texture).argb; before we use glReadPixel to get it back. For the uploading process, the shuffle is a revert shuffle. We still use GL_RGBA, GL_UNSIGNED_BYTE to upload the color to a texture, then let's see 0 1 2 3 : address a r g b : correct colors R G B A : GL_RGBA with GL_UNSIGNED_BYTE Now we need to shuffle again, the mapping rule is r = G, g = B, b = A, a = R. Then the uploading shuffle is as below: frag_color = sample(texture).gbar; After this commit, gles2 version can pass render check with all the formats except those 1555/2101010. Signed-off-by: Zhigang Gong commit 55fdc7b196904a4e537f429d06d36081a0c9a60d Author: Zhigang Gong Date: Thu Apr 5 20:27:35 2012 +0800 glamor_utils: Added debug function to dump depth 15/16 pixmap. Signed-off-by: Zhigang Gong commit 57e29ebdc13d0ef145e4c70c1406af3229a92ad8 Author: Zhigang Gong Date: Fri Apr 6 11:14:21 2012 +0800 glamor_render: Disable gradient shader conversion due to bug. I found when enable the gradient shader, the firefox's tab's background has incorrect rendering result. Need furthr investigation, for now, just disable it. Signed-off-by: Zhigang Gong commit 7036cfdd0d29f4e13d432893a4f386cd3d632de7 Author: Zhigang Gong Date: Fri Mar 16 16:42:46 2012 +0800 glamor_fbo: Added one macro to disable fbo cache. Signed-off-by: Zhigang Gong commit 94186db527b33b2623eb26a7f1ae0c4c0fca66a4 Author: Zhigang Gong Date: Mon Mar 26 19:03:20 2012 +0800 glamor_fill: Should restore alu to GXcopy. Signed-off-by: Zhigang Gong commit 1f4486c10bb2201830af251eede8cc4dbb857953 Author: Junyan He Date: Fri Mar 23 04:06:06 2012 +0800 Add the feature for radial gradient using shader. Add the feature for radial gradient using shader. The transform matrix and the 4 type of repeat mode are supported. Less than 2/255 difference for every color component comparing to pixman's result. Extract the common logic of linear and radial's to another shader. Reviewed-by: Chris Wilson Reviewed-by: Zhigang Gong Signed-off-by: Zhigang Gong commit 1026327cdc90bc0c801a493b7b76b3efc5f33fe2 Author: Junyan He Date: Fri Mar 23 04:05:56 2012 +0800 Add the feature of generating linear gradient picture by using shader. Add the feature of generating linear gradient picture by using shader. This logic will replace the original linear gradient picture generating manner in glamor which firstly use pixman and then upload it to GPU. Compare it to the result generated by pixman, the difference of each color component of each pixel is normally 0, sometimes 1/255, and 2/255 at most. The pixman use fixed-point but shader use float-point, so may have difference. The feature of transform matrix and 4 types of repeat modes have been supported. The array usage in shader seems slow, so use 8 uniform variables to avoid using array when stops number is not very big. This make code look verbose but the performance improved a lot. We still have slightly performance regression compare to original pixman version. There are one further optimization opportunity which is to merge the gradient pixmap generation and the latter compositing into one shader, then we don't need to generate the extra texture, we can use the gradient value directly at the compositing shader. Hope that can beat pixman version. Will do that latter. Reviewed-by: Chris Wilson Reviewed-by: Zhigang Gong Signed-off-by: Zhigang Gong commit ccf5d7f52bae664f90d2c33c9fcff099a820575f Author: Junyan He Date: Fri Mar 23 04:05:48 2012 +0800 Prepare for modification of gradient using shader. Prepare for modification of gradient using shader. The gradient pixmaps now is generated by pixman and we will replace them with shader. Add structure fields and dispatch functions which will be needed. Some auxiliary macro for vertex convert. Reviewed-by: Chris Wilson Reviewed-by: Zhigang Gong Signed-off-by: Zhigang Gong commit a57bf66d492a0eec7b1f2a08b2f424835694e3fb Author: Junyan He Date: Mon Mar 26 13:51:13 2012 +0800 glamor_utils: Add some assistant functions to compare pixmaps/pictures. Reviewed-by: Chris Wilson Reviewed-by: Zhigang Gong Signed-off-by: Zhigang Gong commit cd75e85ff36827b8438d965750faab0615d01e86 Author: Junyan He Date: Mon Mar 5 08:24:20 2012 +0800 Fixup For list.h change in xorg Because the file list.h in xorg/include has changed the functions and struct names, adding xorg_ prefix before the original name. So Modify glamor_screen_private struct and the code which use list's functions in glamor_fbo.c. We hack at glamor_priv.h avoid the compile error when using old version xserver header file. Signed-off-by: Junyan He commit 213285f2b8c6578e01783a77d954ccc3ec313663 Author: Zhigang Gong Date: Fri Feb 17 16:56:05 2012 +0800 For DRI swap buffers. This commit added two APIs to support the DRI swap buffer. one is glamor_egl_exchange_buffers() which can swap two pixmaps' underlying KHRimages/fbos/texs. The DDX layer should exchange the DRM bos to make them consistent to each other. Another API is glamor_egl_create_textured_screen_ext(), which extent one more parameters to track the DDX layer's back pixmap pointer. This is for the triple buffer support. When using triple buffer, the DDX layer will keep a back pixmap rather then the front pixmap and the pixmap used by the DRI2 client. And during the closing screen stage, we have to dereference all the back pixmap's glamor resources. Thus we have to extent this API to register it when create new screen. Signed-off-by: Zhigang Gong commit 8012b030c3144b02af036107179c5b4c94567292 Author: Zhigang Gong Date: Fri Feb 17 16:26:59 2012 +0800 glamor_copyarea: Don't use GL_CLAMP_TO_BORDER when GLES2 enabled. We may need to modify all the shader to handle GL_CLAMP_TO_BORDER when using GLES2. XXX, for now, we just ignore them. Signed-off-by: Zhigang Gong commit 5ccf721d386a62f411d77bbc9a142e0c395162b3 Author: Zhigang Gong Date: Tue Feb 14 17:39:11 2012 +0800 glamor_fbo: Fix a bug when create No gl FBO pixmap. Need to get format before goto create a new fbo. Signed-off-by: Zhigang Gong commit ce634e84d4bb559f01203653c5ffd6397f4b0366 Author: Zhigang Gong Date: Sun Feb 12 09:18:51 2012 +0800 glamor_render: Only recalculate texture for repeat case. Slightly optimize the fragment shader, as if we are not repeat case and not exceed the valid texture range, then we don't need to recalculate the coords. Signed-off-by: Zhigang Gong commit 53387728ddc0c871821b68d728bb5f96a53ba227 Author: Zhigang Gong Date: Fri Feb 10 17:40:37 2012 +0800 glamor_tile/composite: Modify fs to re-calculate texture coords. Then we don't need to fixup the larger pixmap to the exact size, just need to let the shader to re-calculate the correct texture coords. Signed-off-by: Zhigang Gong commit 556adfa6b90f4c1ef12635cf78fa0bba046cf123 Author: Chris Wilson Date: Fri Feb 10 12:54:44 2012 +0000 Fixup glx support Renaming glamor_priv->dispatch and wrapping the access to the dispatch table with a function that also ensured the context was bound. dispatch = glamor_get_dispatch(glamor_priv); ... glamor_put_dispatch(glamor_priv); So that we catch all places where we attempt to call into GL withouta context. As an optimisation we can then do glamor_get_context(); glamor_put_context() around the rendering entry points to reduce the frequency of having to restore the old context. (Along with allowing the context to be recursively acquired and making the old context part of the glamor_egl state.) Reviewed-by: Zhigang Gong Signed-off-by: Zhigang Gong commit 430bc16ca03b3ea00255a4045c8e9fd11aea95ad Author: Zhigang Gong Date: Fri Feb 10 16:04:07 2012 +0800 GLX: Enable glx support. If we are using MESA as our GL library, then both xserver's GLX and glamor are link to the same library. As xserver's GLX has its own _glapi_get/set_context/dispatch etc, and it is a simplified version derived from mesa thus is not sufficient for mesa/egl's dri loader which is used by glamor. Then if glx module is loaded before glamoregl module, the initialization of mesa/egl/opengl will not be correct, and will fail at a very early stage, most likely fail to map the element buffer. Two methodis to fix this problem, first is to modify the xserver's glx's glapi.c to fit mesa's requirement. The second is to put a glamor.conf as below, to the system's xorg.conf path. Section "Module" Load "glamoregl" EndSection Then glamor will be loaded firstly, and the mesa's libglapi.so will be used. As current xserver's dispatch table is the same as mesa's, then the glx's dri loader can work without problem. We took the second method as it don't need any change to xorg.:) Although this is not a graceful implementation as it depends on the xserver's dispatch table and the mesa's dispatch table is the same and the context set and get is using the same method. Anyway it works. As by default, xserver will enable GLX_USE_TLS. But mesa will not enable it, you may need to enable that when build mesa. Three pre-requirements to make this glamor version work: 0. Make sure xserver has commit 66e603, if not please pull the latest master branch. 1. Rebuild mesa by enable GLX_USE_TLS. 2. Put the glamor.conf to your system's xorg.conf path and make sure it loaded prior to glx module. Preliminary testing shows indirect glxgears works fine. If user want to use GLES2 for glamor by using MESA, GLX will not work correctly. If you are not using normal MESA, for example PVR's private GLES implementation, then it should be ok to use GLES2 glamor and the GLX should work as expected. In this commit, I use gbm to check whether we are using MESA or non-mesa. Maybe not the best way. Signed-off-by: Zhigang Gong commit 0a8fb8563f3cecf2019d3a35d5a61ec2b3a069cd Author: Zhigang Gong Date: Fri Feb 10 15:34:43 2012 +0800 glamor_pixmap: Should bind unpack buffer to 0 after the uploading. Signed-off-by: Zhigang Gong commit e03ad27dfb885e58298e1fd2accac0b6ad409fce Author: Zhigang Gong Date: Sat Feb 11 07:37:17 2012 +0800 glamor_picture: Fix the wrong order of header file. Signed-off-by: Zhigang Gong commit bf24c2c06870dc38b21795f4f6fc51b053134181 Author: Zhigang Gong Date: Fri Feb 3 11:46:01 2012 +0800 glamor_dump_pixmap: Add helper routine to dump pixmap. For debug purpose only to dump the pixmap's content. As this function will call glamor_prepare_access/glamor_finish_access internally. Please use it carefully. Signed-off-by: Zhigang Gong commit 91891b3711b1fe1402bb7742c20e976fab63c6fe Author: Zhigang Gong Date: Fri Feb 3 11:44:51 2012 +0800 glamor_fill/tile: Fixed a tileX/tileY calculation bug. The previous's calculation is incorrect, now fix it and then we don't need to fallback at glamor_tile. Signed-off-by: Zhigang Gong Tested-by: Peng Li commit 39d9e6c693a4c3ad12c6569f1fd56e0a87b164d2 Author: Zhigang Gong Date: Fri Feb 3 11:21:37 2012 +0800 prepare_access: Don't use fbo after it was downloaded. We add a new gl_fbo status GLAMOR_FBO_DOWNLOADED to indicate the fbo was already downloaded to CPU. Then latter the access to this pixmap will be treated as pure CPU access. In glamor, if we fallback to DDX/fbXXX, then we fallback everything currently. We don't support to jump into glamor acceleration layer between a prepare_access/finish_access. Actually, fbCopyPlane is such a function which may call to acceleration function within it. Then we must mark the downloaded pixmap to another state rather than a normal fbo textured pixmap, and then stick to use it as a in-memory pixmap. Signed-off-by: Zhigang Gong Tested-by: Peng Li commit 1817b6c0cf20aa6fc1e1aa5b68e47473f341b85a Author: Zhigang Gong Date: Thu Feb 2 11:21:05 2012 +0800 glamor_eglmodule: Change module name according to normalize naming rule. As Xorg module loader will normalize module name which will remove '_' when we put "glamor_egl" to the configure file, then it will fail to find us. Signed-off-by: Zhigang Gong commit 1ab40028740efad1ba2ee16d425b0fbdd822c6ab Author: Zhigang Gong Date: Thu Feb 2 09:34:42 2012 +0800 Don't call dixSetPrivate directly. We may change the way to set/get those private data latter. consolidate to glamor_set_pixmap/screen_private is better than call those dixSetPrivate directly. Signed-off-by: Zhigang Gong commit bf7d79dc0ac2e97ed97e22c1d2c95e77bf959327 Author: Zhigang Gong Date: Tue Jan 31 18:16:58 2012 +0800 Refine CloseScreen and FreeScreen processes. This commit move the calling to glamor_close_screen from glamor_egl_free_screen to glamor_egl_close_screen, as this is the right place to do this. We should detach screen fbo and destroy the corresponding KHR image at glamor_egl_close_screen stage. As latter DDX driver will call DestroyPixmap to destroy screen pixmap, if the fbo and image are still there but glamor screen private data pointer has been freed, then it causes segfault. This commit also introduces a new flag GLAMOR_USE_EGL_SCREEN. if DDX driver is using EGL layer then should set this bit when call to glamor_init and then both glamor_close_screen and glamor_egl_close_screen will be registered correctly, DDX layer will not need to call these two functions manually. This way is also the preferred method within Xorg domain. As interfaces changed, bump the version to 0.3.0. Signed-off-by: Zhigang Gong Tested-by: Peng Li commit 97efbd25fed0f86338853d81b974b7f4deb9f1b4 Author: Chris Wilson Date: Fri Jan 27 13:22:13 2012 +0000 Use CLAMP_TO_BORDER in copy_n_to_n so we can sample outside of the source In order to reduce a composite operation to a source, we need to provide Render semantics for the pixel values of samples outside of the source pixmap, i.e. they need to be rgba(0, 0, 0, 0). This is provided by using the CLAMP_TO_BORDER repeat mode, but only if the texture has an alpha channel. Signed-off-by: Chris Wilson Reviewed-by: Zhigang Gong commit 864153bb9eeadb539ed5e9488b829c9f3f8b9482 Author: Chris Wilson Date: Fri Jan 27 13:22:12 2012 +0000 Do not reduce a composite to a copy if we need to sample outside of the source In order to maintain Render semantics, samples outside of the source should return CLEAR. The copy routines instead are based on the core protocol and expects the source rectangle to be wholly contained within the drawable and so does no fixup. Fixes the rendering of GTK icons. Signed-off-by: Chris Wilson Reviewed-by: Zhigang Gong commit 566cca59e14b223b8dcd045ccc2bbcf08d05b297 Author: Zhigang Gong Date: Sun Jan 29 14:14:36 2012 +0800 glamor-gles2: Fixup the pixmap before read back if it is not readable. Signed-off-by: Zhigang Gong commit 36ac9b7191a4bbbe4fb25ced9ee27d1e91308a15 Author: Zhigang Gong Date: Sat Jan 21 14:41:44 2012 +0800 glamor-fbo: Tweek the cache bucket calculation. And also reduce the expire count to 100 which should be good enough on x11perf and cairo-trace testing. Signed-off-by: Zhigang Gong commit a1de528c56ff1cfd05a04c4ad127456ec00707fd Author: Zhigang Gong Date: Sat Jan 21 13:22:14 2012 +0800 glamor_create_fbo: Concentrate the fbo size/depth checking. Concentrate checking the size/depth when creating fbo. Simply the pixmap creation and the uploading fbo/texture preparing. Also slightly change the uploading fbo's preparation. If don't need fbo, then a fbo only has valid texture should be enough to return. Signed-off-by: Zhigang Gong commit 1bfe5957117ba5916236caa021124734228e5aa9 Author: Zhigang Gong Date: Fri Jan 20 20:38:29 2012 +0800 glamor-pixmap-upload: Create a uploading fbo with a texture only. Just an initial implementation and disabled by default. When uploading a pixmap to a texture, we don't really want to attach the texture to any fbo. So add one fbo type which doesn't has a gl FBO attached to it. This commit can increase the cairo-trace's performance by 10-20%. Now the firefox-planet-gnome is 8.3s. SNA is still the best, only take 3.5s. Thanks for Chris to point out the A1 pixmap uploading bug. Signed-off-by: Zhigang Gong commit 6fb92e67b3f3dee38d8d440c8ab9f8cc5dcef9bc Author: Li Peng Date: Fri Jan 20 16:23:17 2012 +0800 glamor: check driver support GEM or not glamor calls DRM_IOCTL_GEM_FLINK to get a name for a buffer object. It only works for driver that support GEM, such as intel i915 driver. But for pvr driver who doesn't has GEM, we can't do it this way. According to Chris's comments, we check the has_gem as the following method: Here we just try to flink handle 0. If that fails with ENODEV or ENOTTY instead of ENOENT (or EINVAL on older kernels), set has_gem=0. Signed-off-by: Li Peng Reviewed-by: Zhigang Gong commit 68789b23e791d81c6987c755a56851961cbb262f Author: Zhigang Gong Date: Fri Jan 20 15:56:25 2012 +0800 glamor_gles2: Consolidate gles2 pixmap format readable check to one function. Signed-off-by: Zhigang Gong commit 3373d2c696028a9f2f637430c48b9de1a3776800 Author: Zhigang Gong Date: Fri Jan 20 12:10:06 2012 +0800 glamor_egl: Add support for the platform doesn't have gbm. Maybe we should use eglGetDisplayDRM to get display, but current PVR's driver is using eglGetDisplay. Signed-off-by: Peng Li Signed-off-by: Zhigang Gong commit 92671e3ac8cc955379085c143ee8cf8b37e760ec Author: Zhigang Gong Date: Fri Jan 20 11:58:34 2012 +0800 glamor_egl: Don't call eglDestroyImageKHR directly. Some implementation doesn't have it. Signed-off-by: Peng Li Signed-off-by: Zhigang Gong commit 125f317d90b69fa4d6f98da9badc1946f0a099ec Author: Peng Li Date: Fri Jan 20 11:52:18 2012 +0800 glamor_gl_dispatch: fix the dispatch initialization on GLES2. Some gles2 implementation doesn's support get_proc_address. And we also need to avoid get those missing functions pointers when we are GLES2. Signed-off-by: Peng Li Signed-off-by: Zhigang Gong commit 64fef665c9297ddd110b8472943f96b55db120ba Author: Zhigang Gong Date: Fri Jan 20 10:56:17 2012 +0800 glamor_render: Add non-Map/Unmap vertex array for GLES. As some GLES implementations' glMapOES /glUnmapOES is not so efficient, we implement the in memory vertex array for them. Signed-off-by: Zhigang Gong commit c244969b331e08679be9a9618d75fe5ee9cc9d86 Author: Zhigang Gong Date: Fri Jan 20 10:55:16 2012 +0800 glamor_init: Should set gl_flavor before sub-module intialization. Signed-off-by: Zhigang Gong commit 62e536535168827be76dafb1f5b5e0807c1d5ec9 Author: Zhigang Gong Date: Fri Jan 20 10:04:21 2012 +0800 glamor_composite: Fix one bug when we have too more vertices. Signed-off-by: Zhigang Gong commit 9c6fd931a63fb8a5300014265e4f1cacc746857a Author: Zhigang Gong Date: Fri Jan 20 09:59:44 2012 +0800 glamor-fbo-pool: Enable to reuse different size fbo/texture. Fixup three special cases, one is in tile and the other is in composite. Both cases are due to repeat texture issue. Maybe we can refine the shader to recalculate texture coords to support partial texture's repeating. The third is when upload a memory pixmap to texture, as now the texture may not have the exact size as the pixmap, we should not use the full rect coords. Signed-off-by: Zhigang Gong commit c7e79d6acff5abd7a327d5f4d6698ae5d7583834 Author: Zhigang Gong Date: Thu Jan 19 20:47:55 2012 +0800 glamor-fbo-pool: Implement fbo cache mechanism. We classify the cache according to the texture's format/width/height. As openGL doesn't allow us to change a texture's format/width/height after the internal texture object is already allocated, we can't just calculate the size and then according ths size to put the fbo to an bucket which is just like SNA does. We can only put the fbo to the corresponding format/width/height bucket. This commit only support the exact size match. The following patch will remove this restriction, just need to handle the repeat/tile case when the size is not exactly match. Should use fls instead of ffs when decide the width/height bucket, thanks for Chris to point this out. Signed-off-by: Zhigang Gong commit 2ff41008494e6c5909c058f1f80b4f66617dada1 Author: Zhigang Gong Date: Wed Jan 18 19:21:36 2012 +0800 glamor_fbo: Introduce glamor fbo to manage all the fb/tex. This is the first patch to implement a fbo/tex pool mechanism which is like the sna's BO cache list. We firstly need to decopule the fbo/tex from each pixmap. The new glamor_pixmap_fbo data structure is for that purpose. It's somehow independent to each pixmap and can be reused latter by other pixmaps once it's detached from the current pixmap. And this commit also slightly change the way to create a memory pixmap. We will not create a pixmap private data structure by default, instead we will crete that structure when a memory pixmap is attaching a fbo to it. Signed-off-by: Zhigang Gong commit ca2ddd33a114fe83584b5fa9f73b7534abdb96fa Author: Zhigang Gong Date: Wed Jan 18 17:12:32 2012 +0800 glamor_set_pixmap_texture/screen_pixmap: Remove useless parameters. As after we got a texture, no matter the texture is created on the glamor_create_pixmap or on the egl layer, we all already know the texture's width and height there. We don't need to pass them in. This commit also simply the glamor_egl_create_textured_screen to reuse the egl_create_textured_pixmap. And also remove the useless root image from the egl private structure. As now the root image is bound to the screen image, we don't take care it separately here. It will be freed at the screen closing. Signed-off-by: Zhigang Gong commit 15166bba973206dcb98121eb3932660529cfc997 Author: Zhigang Gong Date: Wed Jan 18 17:10:26 2012 +0800 Add debug message for all the uploading path. The previous message missed the texture restoring path. Signed-off-by: Zhigang Gong commit 994a9ff7f58161bf5651f83d810eb77b7718ab00 Author: Zhigang Gong Date: Wed Jan 18 17:07:25 2012 +0800 glamor_create_picture: Fix the format matching method. We should not simply set a TEXTURE_DRM pixmap to a separated texture pixmap. If the format is compatible with current fbo then it is just fine to keep it as TEXTURE_DRM type and we can safely fallback to DDX layer on it. Signed-off-by: Zhigang Gong commit 28fcd7cd01edfdf68c370e6c6ad0238d45477b3f Author: Zhigang Gong Date: Fri Jan 13 11:18:28 2012 +0800 Rearrange data structure and remove unused fileds. Signed-off-by: Zhigang Gong commit bdd72da0c525faf2aac38a7a8afa1cd88cd8dc1b Author: Zhigang Gong Date: Tue Jan 10 17:04:48 2012 +0800 Release previous textre/fb when bind a new texture to a pixmap. As we want to support DRI2 drawable which may create a new textured_drm to a pre-existing texture_only pixmap, we have to add this logical. Signed-off-by: Zhigang Gong Tested-by: He Junyan commit d7352d57b9ceb809d47c922ed8c820a44f8a0ee5 Author: Zhigang Gong Date: Tue Jan 10 15:24:36 2012 +0800 Add glFinish after glFlush. Signed-off-by: Zhigang Gong commit 8b943ce2030b02bb8d279ce2c284cb5d2910ced6 Author: Zhigang Gong Date: Mon Jan 9 12:50:39 2012 +0800 Set glamor's initial version to 0.2.0. Signed-off-by: Zhigang Gong commit 7329414bf2ca9873c04150a1d9386cf37f70b663 Author: Zhigang Gong Date: Mon Jan 9 07:16:06 2012 +0800 Silence a compilation warning. Signed-off-by: Zhigang Gong commit 069a6d1746ef4c180f48a75e655e5e06e33327b5 Author: Zhigang Gong Date: Mon Jan 9 07:11:26 2012 +0800 glamor_composite: Allocate VBO on demand. Use a fixed VBO is not efficient. Some times we may only has less than 100 verts, and some times we may have larger than 4K verts. We change it to allocate VBO buffer dynamically, and this can bring about 10% performance gain for both aa10text/rgb10text and some cairo benchmarks. Signed-off-by: Zhigang Gong commit 42a0261cb3065200887f81816b1bc3850593da4c Author: Zhigang Gong Date: Mon Jan 9 05:03:08 2012 +0800 glamor_getimage: Add the optimization path of getImage. This optimization will only call glReadPixels once. It should get some performance gain. But it seems it even get worse performance at SNB, disable it by default. Signed-off-by: Zhigang Gong commit 96085017c8da96e6d882c87b69186f5aba20131d Author: Zhigang Gong Date: Mon Jan 9 05:01:48 2012 +0800 Consolidate the choose of internal texture format to one function. Signed-off-by: Zhigang Gong commit a74596be0e7e02b43fb0db844b71b68f384ab599 Author: Zhigang Gong Date: Sun Jan 8 08:50:41 2012 +0800 Set filter to GL_NEAREST by default. This is the fastest filter and let's use it by default. Signed-off-by: Zhigang Gong commit 4cd07871a417b15b0382c07fecec497e93697a5d Author: Zhigang Gong Date: Sun Jan 8 08:45:08 2012 +0800 glamor-composite: Use glDrawElements to reduce the count of vertices. To split a rectangle (0,1,2,3) to two separated triangles need to feed 6 vertices, (0,1,2) and (0,2,3). use glDrawElements can reuse the shared vertices. Signed-off-by: Zhigang Gong commit 9dafd6fce547a6824c1de98d4309f8f2197ebbd0 Author: Zhigang Gong Date: Sun Jan 8 01:14:12 2012 +0800 glamor-composite: Optimize the computation of composite region. Computing the composite region at the composite_with_shader is very inefficient. As when we call to here from the glamor_glyph's temproary picture, we don't need to compute this region at all. So we move this computing out from this function and do that at the glamor_composite function. This can get about 5% performance gain for aa10text/rgb10text. Signed-off-by: Zhigang Gong commit 2511a00cdd576512f5d7f45707a4a725df2f4618 Author: Zhigang Gong Date: Thu Jan 5 14:26:01 2012 +0800 Fixed a configure bug. Should check the enable-glamor-gles2 before use the variable. And should include the config.h as the GLAMOR_GLES2 macro is defined there. Signed-off-by: Zhigang Gong commit a65e1c736aaa1bb2440a83c42c0410d9d9b58007 Author: Zhigang Gong Date: Wed Jan 4 14:40:24 2012 +0800 Reduce the double check of pixmap's private pointer. As we now add the checking to the Macro, we don't need to check the pointer outside the Macro. Signed-off-by: Zhigang Gong commit e1789893e5fe07fdbd8f21b7fa8a15f6db066592 Author: Zhigang Gong Date: Wed Jan 4 14:37:37 2012 +0800 get_spans: Check whether have a valid fbo before check format. If a pixmap is a pure in-memory pixmap, we do not need to check its format. Format checking has more overhead than checking FBO, so we change to check fbo firtly. Signed-off-by: Zhigang Gong commit 057f52a04d47e6ca5f6dead9c1bc71765d4c7ae8 Author: Zhigang Gong Date: Wed Jan 4 14:34:39 2012 +0800 Track all picture's drawable pict format. Even if a picture's pixmap is a pure in memory pixmap, we still need to track its format. The reason is we may need to upload this drawable to texture thus we need to know its real picture format. As to the MACRO to check whether a pixmap is a picture, we should check whether the priv is non-NULL before we touch its field. Signed-off-by: Zhigang Gong commit 8a4758a358e56b1db481607ff3f7e9375238e5d8 Author: Zhigang Gong Date: Wed Jan 4 13:11:52 2012 +0800 Need to check pixmap priv before touch its field. As now the pixmap may be allocated by DDX and doesn't have a valid pixmap private field. We must check pixmap private pointer before touch its field value. If a pixmap doesn't have a non-NULL private pointer, it doesn't have a valid FBO. Signed-off-by: Zhigang Gong commit 9264335347da641b2626a6b9f56aa05ab313239e Author: Zhigang Gong Date: Sat Dec 31 19:29:17 2011 +0800 Added more drawing functions. As we want to take over all the possible GC ops from the DDX layer, we need to add all the missed functions. This commit also fixed one bug at polylines. We simply drop the bugy optimized code now, as it did not consider of clip info. Signed-off-by: Zhigang Gong commit d42eb04c29d015fb1e4ed4e9ded4c0dd8bc7dc3c Author: Zhigang Gong Date: Sat Dec 31 19:27:33 2011 +0800 Remove useless output messages. Signed-off-by: Zhigang Gong commit fbccc4bbbc84a5459010d3238a00a0dd49111eec Author: Zhigang Gong Date: Sat Dec 31 19:20:10 2011 +0800 Fixed a rendering bug at fillspans. We should not change the points coords when loop for the clip rects. Change to use another variable to store the clipped coords and keep the original coords. This bug cause some XTS failures. Now fix it. Signed-off-by: Zhigang Gong commit 70b6341538cc11f074b02f9dd97d387418245d77 Author: Zhigang Gong Date: Sat Dec 31 19:14:06 2011 +0800 Fixed a bug at putImage. fbPutImage wants the input drawable is the target drawable rather than the backing pixmap. This bug cause some XTS failures, now fix it. Signed-off-by: Zhigang Gong commit 27c4c0457dac307500859ca7a14a1e58465d5e0b Author: Zhigang Gong Date: Tue Dec 27 16:44:17 2011 +0800 Remove the assertion which is not safe sometimes. The original version assumes that each drawable pixmap should have a valid private pixmap pointer. But this is not true after we create this libglamor. As the DDX layer may create a pure software drawable pixmap which doesn't have a private pixmap pointer. Signed-off-by: Zhigang Gong commit c65dc686228262894e0afc9fbe9fe6635d420e2f Author: Zhigang Gong Date: Tue Dec 27 16:42:32 2011 +0800 Export glamor_validate_gc to DDX. This is also a function which may direct access pixmaps which may be a glamor only pixmap and DDX doesn't know how to access it. We have to export this API to DDX driver and let the DDX driver use it to do the validation. Signed-off-by: Zhigang Gong commit f2809745fb641239be5b0281eac569c5b371e55e Author: Zhigang Gong Date: Fri Dec 23 16:21:44 2011 +0800 Flush gl operations when destroy an textured image. Before destroy an image which was attached to a texture. we must call glFlush to make sure the operation on that texture has been done. Signed-off-by: Zhigang Gong commit b36d264ec98440707ed3a94fab430e23d4a1582a Author: Zhigang Gong Date: Fri Dec 23 16:19:39 2011 +0800 Add a new API glamor_create_gc. As at ValidateGC stage, it may need to touch the pixmap directly, for example the tile pixmap. We must export this interface to DDX driver and let the DDX driver to route the processing to us. As this pixmap may be a texture only pixmap, and DDX don't know how to handle it. Signed-off-by: Zhigang Gong commit 3ba546b6998bf1c5d68ff0083017f804ffc48a93 Author: Zhigang Gong Date: Fri Dec 23 16:18:22 2011 +0800 Code cleanup. Remove useless code, and after a fbCreatePixmap, we do not need to modify its header there. Signed-off-by: Zhigang Gong commit 2583620c6cd6a6fedeb7082b526f2751eb6f75b4 Author: Zhigang Gong Date: Fri Dec 23 14:23:56 2011 +0800 Remove useless egl functions. We only need to create image fron external name rather than use drm_image_mesa to create drm image, so remove them. Signed-off-by: Zhigang Gong commit 7285f2e836c56c31a42b8c18a7ebd0e8a7d78fa1 Author: Zhigang Gong Date: Fri Dec 16 20:15:33 2011 +0800 Make sure the devPrivate.ptr of a textured pixmap is NULL. Just in case when wrongly fallback to DDX layer and cause random memory corruption. Pointed out by Chris. Signed-off-by: Zhigang Gong commit 5769d8603ddef6a8023f12bba1d3d3cde83e82d4 Author: Zhigang Gong Date: Fri Dec 16 15:04:33 2011 +0800 Export glamor_create_texture to DDX driver. If DDX failed to create textured pixmap from its BO's handle, it can turn to call this API to create a brand new glamor rather than fallback to pure in memory pixmap. Signed-off-by: Zhigang Gong commit 3f5d53b33978bdb848dd605a19d3fb4ea5f259e0 Author: Zhigang Gong Date: Fri Dec 16 15:02:54 2011 +0800 Correct the logic of glamor_egl_create_textured_pixmap. Discussed with Chris and found the previous logic is not good. Now change it in this commit, this API will just try to create a textured pixmap from the handle provided by DDX driver, if failed simply return FALSE without touch the pixmap. And the DDX driver can choose how to do next step. Signed-off-by: Zhigang Gong commit 8c7fcefb965bfdaaf0576347da20155d0415caa5 Author: Zhigang Gong Date: Tue Dec 13 22:48:34 2011 +0800 glamor-for-ddx: Exports all rendering/drawing functions. This commit exports all the rest rendering/drawing functions to the DDX drivers. And introduce some new pixmap type. For a pixmap which has a separated texture, we never fallback it to the DDX layer. This commit also adds the following new functions: glamor_composite_rects, glamor_get_image_nf which are needed by UXA framework. Just a simple wrapper function of miXXX. Will consider to optimize them next few weeks. This commit also Fixed a glyphs rendering bug pointed by Chris. Signed-off-by: Zhigang Gong commit f7539d9bff0a65b9430dcae8745bf5d4409a9f04 Author: Zhigang Gong Date: Mon Dec 12 09:58:03 2011 +0800 Enable texture dynamic uploading. commit 2d0ea392ec574efb96ac7a04ee72ba580417ba1e Author: Zhigang Gong Date: Mon Dec 12 09:49:06 2011 +0800 Call screen's method to create pixmap. As we may need to fallback to DDX's rendering path during the glyphs, we have to call screen's create pixmap method to create pixmap. Signed-off-by: Zhigang Gong commit 47e86eea563601c4e1e356f7267b935fcdd542f7 Author: Zhigang Gong Date: Mon Dec 12 09:48:04 2011 +0800 Fallback if the pixmap is drm only. Glamor can't do anything with a drm only pixmap. Signed-off-by: Zhigang Gong commit e3d16c9ebdffe8e5793ee253cf9f72b884b42805 Author: Zhigang Gong Date: Mon Dec 12 07:09:03 2011 +0800 Classfy glamor pixmap to different types. During the integration with intel driver, we introduce two new type of pixmap, one is TEXTURE_DRM, the other is DRM_ONLY. TEXTURE_DRM means we create a texture bind to the DRM buffer successfully. And then the texture and the external BO is consistent. DRM_ONLY means that we failed to create a texture from the external DRM BO. We need to handle those different types carefully, so we have to track them in the data structure. Signed-off-by: Zhigang Gong commit 36d424feaeec765d131c015df77d24db1a36fc38 Author: Zhigang Gong Date: Mon Dec 12 06:56:36 2011 +0800 Call glamor_create_pixmap directly in glamor rendering path. When glamor is rendering pixmaps, and needs to create some temporary pixmap, it's better to use glamor version create pixmap directly. As if goes to external DDX's create pixmap, it may create a external DRM buffer which is not necessary. All the case within glamor scope is to create a texture only pixmap or a in memory pixmap. Signed-off-by: Zhigang Gong commit 10ad332dedad2df13212dcd198d947a2f5c76862 Author: Zhigang Gong Date: Sun Dec 11 08:06:13 2011 +0800 Remove garbage file. Signed-off-by: Zhigang Gong commit 92fd83872f5509a2792338b4665dc2b3e1ed68cd Author: Zhigang Gong Date: Sun Dec 11 02:26:15 2011 +0800 Remove the access mode from private pixmap structure. Change the finish_access to pass in the access mode, and remove the access mode from the pixmap structure. This element should not be a pixmap's property. Signed-off-by: Zhigang Gong commit d135e879a6c8698bf21ae44a02315f370b961b14 Author: Zhigang Gong Date: Fri Dec 9 16:01:45 2011 +0800 Can't create KHR image if the depth is uncompatible. Currently, KHR image only support one color format ARGB32. For all other format, we have to fail to create corresponding image and texture here. Signed-off-by: Zhigang Gong commit b5630663cf9438383166f59cdfc7889571f2cd62 Author: Zhigang Gong Date: Fri Dec 9 15:58:19 2011 +0800 exports more rendering functions to DDX driver. Exports all necessary rendering functions to DDx drivers, including CopyArea, Glyphs, Composite, Triangles, .... Signed-off-by: Zhigang Gong commit b5480e64ac4a72bdc31e587ff9e51d67a1a0f11d Author: Zhigang Gong Date: Fri Dec 9 14:57:24 2011 +0800 Override create/destroy picture to track pict format. When create a piccture, we need to attach a pixmap to it. A pixmap only has a depth, which is not sufficant for glamor. As in openGL texture only has a few internal formats which is not sufficant to represent all the possible picture format. So we always transform the picture format to GL_RGBA. And when we need to read back the picture, we must know the original picture format. So we have to override create and destroy picture to track a pixmap's real picture format if it is attached to a picture. Signed-off-by: Zhigang Gong commit 7b2310834d83198fc88b5a5fb062cb1c9ee19ead Author: Zhigang Gong Date: Tue Nov 22 18:28:10 2011 +0800 Added a missed header file. Pointed by Chris, we must add xorg-server.h at the top of each file before we include any other xorg header files. Otherwise, it may cause incorrect XID length. This commit also fixes one compilation warning in X86_64 platform. Signed-off-by: Zhigang Gong commit 90eaac96aeb53b3e45b82dc7dd4e98778c8c9343 Author: Zhigang Gong Date: Tue Nov 15 20:17:18 2011 +0800 If caller is not using glamor screen, we can't register the block handler. Signed-off-by: Zhigang Gong commit 9ff39e53eb20673d42f42c94adb55bf9a9f1c285 Author: Zhigang Gong Date: Tue Nov 15 20:16:16 2011 +0800 Revert "Disable glamor_tile temporary." The previous corruption output is caused by GLAMOR/UXA flushing issue. Now get fixed. This reverts commit 0d2d3e4f051e48c3499e1c972e012803a8623526. commit 13ab4d59afb824f2a4c03280fffe79c6ba9aa26c Author: Zhigang Gong Date: Fri Nov 11 14:55:12 2011 +0800 Disable glamor_tile temporary. Enable glamor tile cause corrupted output. Need more investigation. Signed-off-by: Zhigang Gong commit 9b6a484df0724d72dd27ad620672e7a762a460df Author: Zhigang Gong Date: Fri Nov 11 10:26:00 2011 +0800 Add new version glamor_poly_fill_rect without internal fallback. If need fallback, this new version just returns FALSE without doing anything. It's the caller's responsibility to implement fallback method. Signed-off-by: Zhigang Gong commit ba1b3b53240b5d499791570ba9f598a4e421c719 Author: Zhigang Gong Date: Wed Nov 9 16:09:03 2011 +0800 Add new version glamor_fillspans without internal fallback. For the purpose of incrementally intergration of existing intel driver, for the GC operations we may don't want to use glamor's internal fallback which is in general much slower than the implementation in intel driver. If the parameter "fallback" is false when call the glamor_fillspans, then if glamor found it can't accelerate it then it will just return a FALSE rather than fallback to a slow path. Signed-off-by: Zhigang Gong commit b861aad8e2fcf6fe1fae4f26abb650bb4eb499c6 Author: Zhigang Gong Date: Wed Nov 2 13:44:50 2011 +0800 Initial version. Signed-off-by: Zhigang Gong commit 2dbbe2565052cc024ce0e98918ed34c1239b780a Merge: 4d62646 7982eca Author: Eric Anholt Date: Wed Dec 18 11:21:07 2013 -0800 Merge branch 'glamor-gongzg-merge' commit 7982eca622bbc4b6a4845801a77da8a16138004a Author: Eric Anholt Date: Wed Dec 18 11:16:15 2013 -0800 Revert changes outside of glamor from the glamor branch. We want to merge the external glamor code to the xserver, with the internal history retained. However, we don't want a bunch of non-building changes along the way, so remove all the build system and support code outside of glamor for now. commit 4d62646142718024b0981eb4f1fd0131e829161f Merge: f4bfb14 81ba89d Author: Keith Packard Date: Mon Dec 16 09:27:57 2013 -0800 Merge remote-tracking branch 'jeremyhu/master' commit f4bfb14f53a939574da1f5995f0dad949898b86a Author: Adam Jackson Date: Thu Dec 12 10:57:40 2013 -0500 configure: Fix a typo near dri3/shmfence detection " is not the mate of ]. Reviewed-by: Jasper St. Pierre Signed-off-by: Adam Jackson commit 8248b4af31ef71ac03158871b77f20eb456dbe38 Author: Adam Jackson Date: Fri Dec 13 15:07:48 2013 -0500 glx: Add null pointer protection to __glGetProcAddress This can't happen when GLX is the backing window system, but can elsewhere. We may as well protect against it at a high level. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 128449dd6498a2f74c3770f89a9dae0f70e2b351 Author: Adam Jackson Date: Fri Dec 13 11:39:16 2013 -0500 present: Don't use the major/minor version from the protocol headers We want to advertise the version we implement, not the version the protocol headers happen to describe. Reviewed-by: Jasper St. Pierre < Signed-off-by: Adam Jackson commit ec6087bf070131bc3a26848fb9fb840f09b0e19d Author: Adam Jackson Date: Fri Dec 13 11:36:38 2013 -0500 dri3: Don't use the major/minor version from the protocol headers We want to advertise the version we implement, not the version the protocol headers happen to describe. Reviewed-by: Jasper St. Pierre < Signed-off-by: Adam Jackson commit e6fafd3de70d315130fb6e5732cfd02a5901b788 Author: Adam Jackson Date: Fri Dec 13 11:28:59 2013 -0500 dri3: Guard against buggy clients There's nothing to stop a client from sending these requests to screens without DRI3 support, and if they do, we'll crash. Let's not do that. Reviewed-by: Jasper St. Pierre < Signed-off-by: Adam Jackson commit 81ba89d6703a22178a153aa39478ba2d4bde262b Author: Jeremy Huddleston Sequoia Date: Fri Dec 13 01:39:44 2013 -0800 configure.ac: Add PRESENT_LIB to XQUARTZ_LIBS Undefined symbols for architecture x86_64: "_present_extension_init", referenced from: _staticExtensions in libXquartz.a(miinitext.o) "_present_register_complete_notify", referenced from: ___glXregisterPresentCompleteNotify in libglx.a(glxcmds.o) Signed-off-by: Jeremy Huddleston Sequoia commit d7c9235ee261b0f780320985233e00dec5e2689c Author: Jeremy Huddleston Sequoia Date: Sat Dec 7 01:36:33 2013 -0800 XQuartz: Use asl_log_descriptor to log stdout/stderr of child processes Signed-off-by: Jeremy Huddleston Sequoia commit ad8111d7c971ce448905c733d65ba0cfc72bdca4 Author: Jeremy Huddleston Sequoia Date: Sat Dec 7 01:14:37 2013 -0800 darwin: Don't leave stdin/stdout closed Signed-off-by: Jeremy Huddleston Sequoia commit 929795d50d788358d6269ce423f72c6cc40e334b Author: Peter Hutterer Date: Tue Dec 3 10:14:51 2013 +1000 dix: fix check for grab type Signed-off-by: Peter Hutterer commit 23394c7fea0f5c33333198c87ecfecc9f6c6a791 Author: Peter Hutterer Date: Tue Dec 3 08:36:45 2013 +1000 Xi: ungrab device when releasing a passive grab without ButtonReleaseMask (#71878) If an touch triggers an async button grab and that grab does not have the ButtonReleaseMask set, the TouchEnd is never delivered, deliveries is 0 and the grab is never deactivated. If the grab is pointer async and keyboard sync, the keyboard events are stuck in EnqueueEvent until some other pointer event terminates the grab. Change this to check for the number of listeners. If we're about to deliver a TouchEnd to a passive pointer grab, the number of listeners is already 1 - pointer grabs always accept so other listeners were removed. X.Org Bug 71878 Signed-off-by: Peter Hutterer commit c1d30b5bd7f90e68bc38404fd0cc32578d6d3018 Author: Ben Gamari Date: Thu Nov 21 21:24:20 2013 -0500 Xi: Don't ActivateEarlyAccept POINTER_REGULAR listeners Bug #71878 describes a bug resulting in the server ceasing to respond to keyboard input after a touch event. The problem might be the following: DeliverTouchBeginEvent tries to deliver an event to a listener of type LISTENER_POINTER_REGULAR, taking the following if branch, if (listener->type == LISTENER_POINTER_REGULAR || listener->type == LISTENER_POINTER_GRAB) { rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab, xi2mask); if (rc == Success) { listener->state = LISTENER_IS_OWNER; /* async grabs cannot replay, so automatically accept this touch */ if (dev->deviceGrab.grab && dev->deviceGrab.fromPassiveGrab && dev->deviceGrab.grab->pointerMode == GrabModeAsync) ActivateEarlyAccept(dev, ti); } goto out; } DeliverTouchEmulatedEvent succeeds. The deviceGrab meets all three of the conditions of the inner if, enters ActivateEarlyAccept which then fails due to, BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB && ti->listeners[0].type != LISTENER_POINTER_GRAB); That is, despite listener->type == LISTENER_POINTER_REGULAR. With my non-existent knowledge of XINPUT, it seems like the solution here might be to only ActivateEarlyAccept when listener->type == LISTENER_POINTER_GRAB. Signed-off-by: Ben Gamari Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit fe07ec19e212a68076560d243a2a935c54589068 Author: Keith Packard Date: Tue Dec 10 11:27:47 2013 -0800 present: recursively set window pixmaps on flip Newly created windows inherit the pixmap of their parent, similarly, reparenting a tree inherits the pixmap of the destination tree. Making present preserve the invariant that unredirected windows always have the same pixmap as their parent ensures that the above cases work correctly. v2: name the recursive function to 'set_tree_pixmap' instead of 'set_window_pixmap' Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit b3533d0b212b6747a8f9a01931253d6bdb648ee2 Author: Keith Packard Date: Tue Dec 10 10:29:11 2013 -0800 Bump version to 1.14.99.904 (1.15 RC4) Signed-off-by: Keith Packard commit 9a4d7572fe3be16bb5aded5f48d4217fdf725b1d Author: Jon TURNEY Date: Thu Sep 27 18:59:45 2012 +0100 hw/xwin/glx: Rewrite WGL wrappers after Xserver conversion to direct GL dispatch v1: Rewrite by Marc Haesen of the WGL wrapper function generation script to use Khronos group XML. v2: Remove -dispatchheader option, since dispatch.h doesn't exist anymore, use the private glapi interface to construct the GL dispatch table for the native WGL thunks. v3: Rewrite to generate shims for the OpenGL 1.2.1 (GL 1.2 + GL_ARB_imaging +GL_ARB_multitexture + GL_ARB_texture_compression(?)) functions the server links directly with rather than libGL. These shims dispatch to either the mesa GL DLL, or a thunking DLL containing cdecl-to-stcall wrapper functions for the native GL DLL. Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit cb48877a3c4cfb1ae2248000fcd3443e3092bdaa Author: Jon TURNEY Date: Fri Dec 6 14:00:21 2013 +0000 glx: Consistently use ARB-suffixed names for ARB_multitexture functions At the moment we have a mix of ARB and non-ARB suffixed forms for ARB_multitexture functions e.g. glMultiTexCoord1fvARB and glMultiTexCoord1dv Consistently use the ARB-suffixed form, assuming that is present in all libGL which provide the OpenGL 1.2.1 ABI we expect to be able to directly link with. Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit 1a021f57a1e75ab63e8f87704f0394162402c4d4 Author: Jon TURNEY Date: Sun Dec 1 22:25:46 2013 +0000 ephyr: Fix compilation when ./configure'd with --enable-debug /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessMouseMotion’: /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:946:188: error: ‘ephyrCurScreen’ undeclared (first use in this function) /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonPress’: /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:980:186: error: ‘ephyrCurScreen’ undeclared (first use in this function) /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonRelease’: /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:1007:186: error: ‘ephyrCurScreen’ undeclared (first use in this function) Fix ephyr compilation when ./configure'd with --enable-debug after commit 46cf6bf5692ef751ec9d17ae2292565d4b13f14b, some instances of ephyrCurScreen were not converted to screen->pScreen->myNum. v2: Don't use a trivial local variable which will be unused when ./configure'd with --disable-debug Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit 875dbcef5bfcb6a94ef8456be6151e133408793f Author: Jon TURNEY Date: Fri Nov 29 14:29:20 2013 +0000 configure.ac: Link XWin with present extension if we are building with it enabled Signed-off-by: Jon TURNEY Reviewed-by: Adam Jackson commit e61e19959d9138d5b81b1f25b7aa3e257918170d Author: Adam Jackson Date: Tue Dec 3 13:45:43 2013 -0500 xquartz/glx: Convert to non-glapi dispatch CGL doesn't have anything like glXGetProcAddress, and the old code just called down to dlsym in any case. It's a little mind-warping since dlopening a framework actually loads multiple dylibs, but that's just how OSX rolls. Signed-off-by: Adam Jackson Reviewed-by: Jeremy Huddleston Sequoia commit a668aa0e41bc33ff2db7f9c53b6dc321a96926a9 Author: Adam Jackson Date: Tue Dec 3 15:03:13 2013 -0500 drisw: Wire up GetProcAddress Signed-off-by: Adam Jackson Reviewed-by: Keith Packard commit 4fcdfeb7bc55d00d50d7f89788d9b929946ae3d9 Author: Adam Jackson Date: Tue Dec 3 15:02:57 2013 -0500 dri2: wire up GetProcAddress Signed-off-by: Adam Jackson Reviewed-by: Keith Packard commit 47f00b3920be9d8df8b148263d744934f3a02cd4 Author: Adam Jackson Date: Tue Dec 3 15:01:44 2013 -0500 glx: Untangle the prototypes around the GetProcAddress thunk Signed-off-by: Adam Jackson Reviewed-by: Jeremy Huddleston Sequoia Reviewed-by: Jon TURNEY commit c1fd143f2847ef425ec9891d9e1cba44a1bb007d Author: Adam Jackson Date: Tue Dec 3 13:11:52 2013 -0500 glx: Remove function stubs Now that we're calling non-1.2 ABI things by function pointer this is no longer needed. Signed-off-by: Adam Jackson Reviewed-by: Jeremy Huddleston Sequoia Reviewed-by: Jon TURNEY commit 6b93e1f5ff39c6ac5b0d97d4245aeac9113eed8b Author: Adam Jackson Date: Tue Dec 3 13:11:09 2013 -0500 glx: Convert non-generated function pointer thunking Same concept as the generated code conversion. Signed-off-by: Adam Jackson Reviewed-by: Jon TURNEY commit c4567a376083eb7b142a7f003ddf8372d376ea86 Author: Adam Jackson Date: Tue Dec 3 12:40:24 2013 -0500 glx: Convert generated code function pointer thunking We're meant not to call these by name due to ABI. Rather than try to generate a bunch of little stub functions that do the lookup, just inline it all directly into the calling function. This does not cache results. That's fine, this is not a performance path, and if we're atop WGL then we effectively have to do this every time anyway because wglGetProcAddress results are context-dependent. Signed-off-by: Adam Jackson Jon TURNEY commit f69f4f417c6807405e45289b39a80f1b9a55f9e6 Author: Keith Packard Date: Tue Dec 10 07:09:17 2013 -0800 Depend on latest glproto (1.4.17) Signed-off-by: Keith Packard commit 576f3d36dd324bd0d16c9968f1ded5c5eead3569 Author: Adam Jackson Date: Mon Dec 9 13:16:01 2013 -0500 damageext: Die if we can't create the Xinerama resource type Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit f10f36d91db1b21c2ce5a531b4fa5f96fcbdc2f0 Author: Adam Jackson Date: Mon Sep 16 15:17:26 2013 -0400 damageext: Xineramify (v7) v7: Don't bother making resources for the backing listeners. [keithp] This is now slightly unlike how other resources are xineramified. We create N+1 internal damage listeners, one that's a real resource and reflects the protocol view, and then one per backend screen where the report function piles onto the protocol view. The internal listeners are not stored in the resource database directly, they just hang off the xinerama resource. We don't wrap Subtract at the dispatch level, but we do extend it for the Xinerama case to clip to the root window geometry. As a result of the N+1 design here, the damage reports we generate are not quite minimal. However they are indistinguishable from sequential rendering events happening before the client hears damage, and we don't need to add a post-dispatch callback just for this one extension. Add is probably (still) somewhat broken since it will only hit screen 0, but Add really only exists for DRI1's sake, and DRI1 disables itself with Xinerama enabled anyway. In the absence of a use case, I'm leaving it unwrapped under Xinerama; if someone wants to define how it ought to work, be my guest. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 808303fe5232ba0320ae5a4310b1ed1322e85f1d Author: Adam Jackson Date: Mon Nov 4 17:49:34 2013 -0500 fixes: Fix PanoramiXSetWindowShapeRegion for root windows (v2) Root windows in Xinerama are in the coordinate space of their root window pixmap, not in protocol space. v2: Only translate for root windows, sice the window shape is drawable-relative. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 5c10c7ea2129b70015e745523918d143cc29318d Author: Adam Jackson Date: Mon Nov 4 17:49:33 2013 -0500 fixes: Fix PanoramiXSetPictureClipRegion for root windows (v2) Root windows in Xinerama are in the coordinate space of their root window pixmap, not in protocol space. This fixes 'xcompmgr -n' when Xinerama is active. v2: Only translate for root windows, since the clip origin is drawable-relative. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 1dd839a425adc6e5a1dc377003ed86a374d81f0b Author: Adam Jackson Date: Thu Nov 7 13:59:30 2013 -0500 composite: Fix COW creation for Xinerama (v2) Say you have two 800x600 screens left/right of each other. A window that's 200x200 at +700+0 in protocol coordinate space will appear to be at -100+0 in the coordinate space of the right hand screen. Put another way: windows are in the coordinate space of their root window pixmap. We weren't doing this translation for the COW, so when rendering came in to it you'd see the top-left chunk of the COW on all screens. Cool effect and all, but wrong. v2: Only translate when Xinerama is active [keithp] Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 8dbe456abae1a32fb6c5c74fa456bc7301cccabe Author: Adam Jackson Date: Tue Oct 29 10:44:07 2013 -0400 xinerama: Export the screen region damageext wants this so it can intersect subtract requests against the root window geometry. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit c6d4c2a24140feee4ceae48c4c74fedcae9b68b3 Author: Adam Jackson Date: Fri Nov 15 15:13:31 2013 -0500 xfree86: Prefer fbdev to vesa On UEFI machines you'd prefer fbdev to grab efifb instead of vesa trying to initialize and failing in a way we can't unwind from. On BIOS machines this is harmless: either there is an fbdev driver and it'll probably be more capable, or there's not and vesa will kick in anyway. Reviewed-by: Alex Deucher Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 7b5d4f147fdef9edfeaa9c6565375111079efd11 Author: Adam Jackson Date: Tue Nov 5 10:12:28 2013 -0500 composite: Don't double-redirect if someone asks for backing store twice v2: Belt-and-suspenders the unredirection path [vsyrjala] Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit a2b2c271e0ca87d3188ba2741b6db9bbbdc599f5 Author: Adam Jackson Date: Tue Nov 5 10:08:17 2013 -0500 composite: Automatically enable backing store support on the screen ... unless you explicitly disabled it with -bs on the command line, or with the corresponding thing in xorg.conf. v2: Drop a bogus hunk from compChangeWindowAttributes [vsyrjala] v3: s/TRUE/WhenMapped/ [jcristau] Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit e0cac005608a2e5618c7be59701318d684e0bb93 Author: Adam Jackson Date: Tue Nov 5 09:58:17 2013 -0500 bs: Set the screen's bs support level to WhenMapped Since we're using RedirectAutomatic to do this, we don't actually preserve contents when unmapped. v2: Don't say WhenMapped if Composite didn't initialize [vsyrjala] Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit b61ccd5d9d368f3fbbae27ce14ac02a3db1884c4 Author: Adam Jackson Date: Tue Nov 5 10:20:04 2013 -0500 smartsched: Tweak the default scheduler intervals A default timeslice of 20ms means a pathological client can ruin up to two frames per scheduler tick. And a fifth of a second is just insane. Pick two different numbers out of the hat. A 5ms slice means you can probably keep up with two or three abusive clients, and letting it burst to 15ms should give you about all the timeslice you need for a fullscreen game (that's doing server-side rendering for some reason). If you're running on a system with a 10ms granularity on SIGALRM, then this effectively changes the intervals to 10ms and 30ms. Which is still better, just not as better. I suspect this is about as good as we can do without actually going preemptive, which is an entire other nightmare. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 66310ea2893811614b3c3aade8992624a95a6ee7 Author: Adam Jackson Date: Fri Nov 8 09:22:37 2013 -0500 dri3: Disable when Xinerama is active Pretty sure this can't work. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 793fd5eefb0e417614d77fe1522c6548587fbd4e Author: Adam Jackson Date: Fri Nov 8 09:20:29 2013 -0500 dri2: Disable when Xinerama is active Would only work on ScreenRec 0, which means it's broken. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 2bf92108294805c5c6fef249c2f7de6ecf4975d8 Author: Adam Jackson Date: Fri Nov 8 09:06:59 2013 -0500 present: Disable when Xinerama is active Among much else Present depends on RANDR types, and RANDR isn't properly Xinerama-aware yet anyway. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit ac772cb187ddf7e04b8f4b3a071b90f18f4488d0 Author: Eric Anholt Date: Thu Nov 14 17:40:47 2013 -0800 glx: Fix incorrect use of dri_interface.h version defines in driver probing. If we extend __DRI_CORE or __DRI_SWRAST in dri_interface.h to allow a new version, it shouldn't make old server code retroactively require the new version from swrast drivers. Notably, new Mesa defines __DRI_SWRAST version 4, but we still want to be able to probe version 1 drivers, since we don't use any features beyond version 1 of the struct. Signed-off-by: Keith Packard Reviewed-by: Ian Romanick commit 6e926b18ca1b182253bac435a1d53caaff7ffff6 Author: Eric Anholt Date: Thu Nov 14 17:40:46 2013 -0800 glx: Fix incorrect use of dri_interface.h version defines in extensions. Those defines are so you can compile-time check "do I have a dri_interface.h that defines this new field of the struct?" You don't want the server to claim it implements the new struct just because you installed a new copy of Mesa. Signed-off-by: Keith Packard Reviewed-by: Ian Romanick commit 57a8ce927332e855dd29ff30210a211a907adb25 Author: Jon TURNEY Date: Fri Nov 29 12:26:43 2013 +0000 configure.ac: Fixup for "Require libpciaccess for int10" On 16/11/2013 01:00, Connor Behan wrote: > A --disable-pciaccess build will fail with an int10 module other than > stub. > > Signed-off-by: Connor Behan > --- > configure.ac | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/configure.ac b/configure.ac > index 5e621e0..a843770 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1822,6 +1822,9 @@ if test "x$XORG" = xyes; then > if test "x$CONFIG_UDEV_KMS" = xyes; then > AC_MSG_ERROR([Platform device enumeration requires libpciaccess]) > fi > + if test "x$INT10" != xstub; then > + AC_MSG_ERROR([Cannot build int10 without libpciaccess]) > + fi > fi > AC_MSG_RESULT([$PCI]) > This causes my build to fail where --disable-int10-module --disable-pciaccess is the default (as INT10 still has the default value 'x86emu') Signed-off-by: Jon TURNEY Reviewed-by: Jeremy Huddleston Sequoia Tested-by: Jeremy Huddleston Sequoia Signed-off-by: Keith Packard commit 653d33941b0808ef910aaa5f3aeab05d9c1a100b Author: Keith Packard Date: Tue Nov 26 12:18:12 2013 -0800 present: Report damage when flipping Limit damage to the 'update' region. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 5cf12c9569ac3d83fe1b7a8376c15f8f0b01655e Author: Keith Packard Date: Tue Nov 26 12:10:48 2013 -0800 present: Also set the root window pixmap when flipping This makes sure that things like software cursors continue to work while the screen is flipped. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 4aa77378de69efdc10bced6ba650b0ebff50c112 Author: Keith Packard Date: Tue Nov 26 12:06:57 2013 -0800 present: Clear target_crtc if driver lacks Present support If the driver doesn't have the necessary hooks for Present, then the target_crtc needs to be set to NULL to make sure the extension uses the present_fake code. Signed-off-by: Keith Packard Tested-by: Fredrik Höglund Reviewed-by: Adam Jackson commit 3dd5bfe540b295bb37a2c2fd0ba4a31fb217612b Author: Keith Packard Date: Thu Nov 21 22:48:31 2013 -0800 present: Send GLX_BufferSwapComplete events from present extension This allows GL to support the GLX_INTEL_swap_event extension. v2: Return GLX_BLIT_COMPLETE_INTEL for unknown swap types Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit cde86e68fcb716f34c90f5a16eb868870f5c85e4 Author: Keith Packard Date: Mon Nov 25 23:06:08 2013 -0800 present: Set window pixmap to flipped pixmap This makes other drawing to the window appear on the screen. Note that no child windows can be affected because only full-screen windows are eligible for flipping, and so we only need to set pixmap for the window itself. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 04e138846e128670d409798aa2e797c3c5503a47 Author: Keith Packard Date: Mon Nov 25 23:10:17 2013 -0800 present: Leave vblank on window list until flip complete If the window is destroyed, then we've got cleanup work to do, even if the vblank has already been executed -- we need to clear the window pointer so that we don't try to deliver events to it. Leaving it on the window list meant that when walking that list, we need to know whether the vblank is waiting to be executed or waiting for the flip to complete, so a new 'queued' flag was added to the vblank to distinguish between the two states. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit b121d62accb8c346b4e1b1bce99586e13712f04a Author: Keith Packard Date: Tue Nov 26 03:07:55 2013 -0800 present: Add a debug output line when skipping a pending present When an application provides two pixmaps for the same MSC, the previous one is skipped. This just dumps out some information at that point Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit ae24f5bf6b31c035af50e14727966055ed8767bd Author: Maarten Lankhorst Date: Tue Dec 3 17:01:28 2013 +0100 bump to 0.8.1 commit 59e324abd7cbda5d301b7b67125cd6d96684f000 Author: Thierry Reding Date: Tue Nov 26 17:08:03 2013 +0100 Properly identify DSI outputs Newer Linux kernels support DSI outputs. To be able to identify them properly, add DSI to the list of output names. Reviewed-by: Aaron Plattner Signed-off-by: Thierry Reding commit 190289f6393191bb3c58067ce1df994809475077 Author: Thierry Reding Date: Tue Nov 26 17:08:02 2013 +0100 Staticise and constify output names This array isn't used anywhere outside this file, so it can be made static. While at it, make the array const as well. Signed-off-by: Thierry Reding Reviewed-by: Aaron Plattner commit eafba23b34be31c141ddafb8380520ac9a0622ac Author: Keith Packard Date: Thu Nov 21 22:45:18 2013 -0800 miext/sync: Handle libxshmfence API change libxshmfence had an unfortunate 'int32_t' type for the mapped fence. That changed to exposing a 'struct shmfence' instead, which is nice and opaque and offers fine type checking across the API. This patch requires the newer version of the library and uses the new interface type. Signed-off-by: Keith Packard Reviewed-by: Julien Cristau commit b6d7ed4d787a652e8150532f384bfdf51760f3c2 Author: Keith Packard Date: Thu Nov 21 22:12:34 2013 -0800 miext: Move SyncShm FDs out of the way of clients Applications may end up allocating a bunch of shmfence objects, each of which uses a file descriptor, which must be kept open lest some other client ask for a copy of it later on. Lacking an API that can turn a memory mapping back into a file descriptor, about the best we can do is push the file descriptors out of the way of other X clients so that we don't run out of the ability to accept new connections. This uses fcntl F_GETFD to push the FD up above MAXCLIENTS. Signed-off-by: Keith Packard Reviewed-by: Julien Cristau commit cc63204926c6da83d9221c5f8c0dc8f5e2f2481d Author: Keith Packard Date: Wed Nov 13 14:16:33 2013 +0900 Xext: Use SHMDIR and O_TMPFILE when creating mapping files ShmCreateSegment asks for a file descriptor for a memory mapped file created by the X server. This patch uses O_TMPFILE where available, and also uses the SHMDIR directory to store the files, both for the O_TMPFILE and mkstemp cases. Signed-off-by: Keith Packard Reviewed-by: Julien Cristau commit 5a969f0928b84da5cfe0777dfb542caaacc915ad Author: Keith Packard Date: Wed Nov 13 12:17:10 2013 +0900 Select directory for MIT-SHM temp files at configure time By default, this looks through a list of directories to find one which exists, but can be overridden with --with-shared-memory-dir=PATH This patch doesn't actually do anything with this directory, just makes it available in the configuration Signed-off-by: Keith Packard Reviewed-by: Julien Cristau commit d695cb7fb6bb8fd159a332d902673edbbd2237d7 Author: Alan Coopersmith Date: Mon Nov 25 22:19:34 2013 -0800 Xdmx: Initialize DMX extension even if not built with GLX support dmxAddExtensions takes an argument to determine if it should just initialize the DMX extension, or both DMX & GLX, but if GLX wasn't compiled in, the entire call was #ifdef'ed out, leaving the DMX extension unavailable. Signed-off-by: Alan Coopersmith Reviewed-by: Julien Cristau Signed-off-by: Keith Packard commit bd70def07754357d26b86c287037eb3884631daf Author: Connor Behan Date: Fri Nov 15 17:00:40 2013 -0800 configure.ac: Require libpciaccess for int10 A --disable-pciaccess build will fail with an int10 module other than stub. Signed-off-by: Connor Behan Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit a575c1dc64c10bc88bd0e963ebb8ab137f59a078 Author: Connor Behan Date: Fri Nov 15 17:00:20 2013 -0800 configure.ac: Require libpciaccess for platform bus support There is currently no reason to build with --enable-config-udev-kms and --disable-pciaccess but anyone who tries this should know that the build will fail. Signed-off-by: Connor Behan Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 361dfe74eaa2f1eddb54abdecca1d8b1b3f58704 Author: Connor Behan Date: Fri Nov 15 17:00:00 2013 -0800 configure.ac: Add whitespace near PCI configuration Signed-off-by: Connor Behan Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 80481267662c8687e73081237913fa561e7a6561 Author: Keith Packard Date: Sat Nov 23 22:22:37 2013 -0800 Bump release to 1.14.99.903 (1.15 RC3) Signed-off-by: Keith Packard commit f1604002a32b7f098c2a16b4a8649c694af570c8 Author: Keith Packard Date: Mon Nov 18 22:36:17 2013 -0800 miext: Ensure xshmfence is only called when driver supports it This provides a place for drivers to insert their own FD-based SyncFence implementations, and prevents applications from using DRI3 SyncFence creation functions unless the driver has some support for them. Signed-off-by: Keith Packard Tested-by: Fredrik Höglund commit 037566c57caff93fd7717f385d4b532b81f19c77 Author: Keith Packard Date: Mon Nov 18 22:33:27 2013 -0800 Xext: Recover from miSyncInitFenceFromFD failure without crashing miSyncDestroyFence must not be called unless miSyncInitFence has been invoked, so if miSyncInitFenceFromFD fails, we must free the fence manually. Signed-off-by: Keith Packard Tested-by: Fredrik Höglund commit e7000534a456fdf9cd4eaada3193846c8525f740 Author: Chris Wilson Date: Sat Oct 5 08:47:03 2013 +0100 glx/glxdri2: Unwrap EnterVT/LeaveVT upon CloseScreen In a similar spirit to commit d75e8146c414bfd512ba5dbd4a83acb334bbe19b Author: Keith Packard Date: Mon Jul 12 16:01:34 2010 -0700 Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998 we need to unwrap our pScrn->EnterVT/LeaveVT hooks around server regeneration or else we cause an infinite recursion on the next VT switch afterwards. Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1235516 Signed-off-by: Chris Wilson Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 6d5883bd7e5b765f8f0548501b825d9e56840799 Author: Keith Packard Date: Sat Nov 23 16:19:46 2013 -0800 xnest: Ignore GetImage() error in xnestGetImage() (v3) (I found an amended version of this patch and applied the difference here - keithp) v3: Don't call Xsync before restoring error handler as any errors generated by XGetImage() should be processed when this call returns as suggested by Jamey Sharp Signed-off-by: Egbert Eich Reviewed-by: Jamey Sharp commit 6403cbb143c67872ca9c58e3116ae7942def0ae1 Author: Keith Packard Date: Tue Nov 19 22:13:54 2013 -0800 present: When unflipping, copy to flip window rather than screen unflip happens after the clip lists have been updated, so instead of smashing the whole screen and drawing over other windows, just draw to the original flip window; it'll have the right clip list and so the copy will work just fine. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 8bdd2ccc776ded3f527596b5009ef25129aa3287 Author: Keith Packard Date: Mon Nov 11 18:03:42 2013 -0800 present: Block for wait_fence in present_execute Pend presentation until wait_fence is also triggered by having the SyncFence trigger invoke present_execute once triggered. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit e5a188cb919edee2e3a03054276bce0db02f7b62 Author: Keith Packard Date: Sat Nov 9 12:36:47 2013 -0800 present: Signal destroyed flip window with vblank->window == NULL This eliminates dereferencing freed window pointers when there is a flip for that window in progress. The flip will complete, and then immediately get undone (as we can't stop an in-progress flip). Remove the vblank->window_destroyed field as we can signal this with vblank->window == NULL instead. Change check to vblank->window == NULL in: present_flip_notify Add check for vblank->window == NULL in: present_vblank_notify present_execute present_flip_notify was also using vblank->window->drawable.pScreen, so stop doing that and use vblank->screen instead. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit a5bcc4f7b9499caf8993f0a6ef96088553399ca3 Author: Keith Packard Date: Sat Nov 9 12:33:02 2013 -0800 present: Ignore event_id 0 from driver vblank notify We use event_id 0 to mean 'no such event'; if a driver sends us that event_id, make sure we don't accidentally match it. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 4f3c37a1f17ffcfbbff71d217e1caad3d0148c90 Author: Keith Packard Date: Thu Nov 7 14:17:12 2013 -0800 present: Round fake MSC computations intead of truncating If the timer fired too early, we'd sometimes mis-compute the MSC for fake vblanks. Rounding the computation to the nearest MSC fixes this nicely. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit da9997f89f14ab619f244d5b2e80a423b028c789 Author: Peter Hutterer Date: Tue Nov 19 08:07:09 2013 +1000 configure: allow for --enable-libunwind and --disable-libunwind Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit a307ac27382dd0c377cd1a436cb25cb5aaa54416 Author: Keith Packard Date: Fri Nov 15 13:39:52 2013 +0900 Handle new DamageUnregister API which has only one argument API change in 1.15 Signed-off-by: Keith Packard commit d6ffce4b0e2376e1f8f04ee70b323a6aea3e517e Author: Keith Packard Date: Fri Nov 15 13:26:36 2013 +0900 Clean up compiler warnings. Add const to any immutable string pointers. Rename 'range' to 'prop_range' to avoid redefined warning. Eliminate some unused return values. Signed-off-by: Keith Packard commit 29240e5cbf6e7f875b128fc7bfc4d56b2350835a Merge: 0492deb 8ff7e32 Author: Keith Packard Date: Thu Nov 14 17:02:04 2013 +0900 Merge remote-tracking branch 'whot/for-keith' commit 0492deb8f8238b7782e5a706ec6219d88aa1091d Author: Adam Jackson Date: Tue Oct 29 12:09:27 2013 -0400 mieq: Bump default queue size to 512 Based on some bugzilla scraping I did around November 2012. Of xserver bugs in Red Hat bugzilla with an EQ size message in the log, the distribution looked like: String | Matches ------------------------------------- Increasing EQ size to 512 | 460 Increasing EQ size to 1024 | 52 Increasing EQ size to 2048 | 6 Increasing EQ size to 4096 | 0 Most of the "512" ones appear to be mostly harmless, some relatively expensive path in either rendering or resource destruction simply taking too long due to external pressures like paging or CPU contention. So let's raise the initial queue size, both to reduce the number of spurious abrt reports and to drop fewer events in all but the most pathological cases. Signed-off-by: Adam Jackson Reviewed-by: Jasper St. Pierre Signed-off-by: Keith Packard commit d1440783a7367ff0d0c47d256bbca3b3cf8a5034 Author: Dave Airlie Date: Tue Oct 29 12:09:26 2013 -0400 xfree86: return NULL for compat output if no outputs. With outputless GPUs showing up we crash here if there are not outputs try and recover with a bit of grace. Reviewed-by: Adam Jackson Signed-off-by: Dave Airlie Signed-off-by: Keith Packard commit d7ee27e5e415778240919082c83a65226c6f17e6 Author: Dan Horák Date: Tue Oct 29 12:09:25 2013 -0400 test: build the touch test only when building Xorg Reviewed-by: Adam Jackson Signed-off-by: Dan Horák Signed-off-by: Keith Packard commit 8ff7e32c3ef7b0c13c4ab9664f651e9782d35a85 Author: Peter Hutterer Date: Wed Nov 13 17:14:11 2013 +1000 include: export key_is_down and friends VNC needs key_is_down to check if a key is processed as down before it simulates various key releases. Make it available, because I seriously can't be bothered thinking about how to rewrite VNC to not need that. Signed-off-by: Peter Hutterer Acked-by: Keith Packard commit 0ba7fc8472f1227fd1cd51bd58048f164b8ea1ab Author: Alan Coopersmith Date: Tue Nov 12 14:46:04 2013 -0800 Stop including inline assembly .il file for Solaris Studio builds Since all the inb/outb/etc. use in the X server itself (except for xf86SlowBcopy) has been replaced by calls to libpciaccess, we no longer need to pass inline assembly files to replace the gcc inline assembly from hw/xfree86/common/compiler.h when building Xorg itself. The .il files are still generated and installed in the SDK for the benefit of drivers who may use them. Binary diff of before and after showed that xf86SlowBcopy was the only function changed across the Xorg binary and all modules built in the Xserver build, it just calls the outb() function now instead of having the outb instructions inlined, making it a slightly slower bcopy. Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 550baf38f6096658f0bcf0ad647c4fedf93132f2 Author: Peter Hutterer Date: Fri Oct 4 10:55:52 2013 +1000 kdrive: fix cursor jumps on CursorOffScreen behavior This patch fixes cursor jumps when there is a grab on the Xephyr window and the pointer moves outside the window. So on two side-by-side 640x480 screens, a coordinate of 0/481 triggers KdCursorOffscreen. If the delta between two screens is 0, they share the same offset for that dimension. When searching for the new screen, the loop always rules out the current screen. So we get to the second screen, trigger the conditions where dy <= 0 and decide that this new screen is the correct one. The result is that whenever KdCursorOffScreen is called, the pointer jumps to the other screen. Change to check for dy < 0 etc. so that the cursor stays on the same screen if there is no other screen at the target location. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit a94d945065177d73f3ee8dc0b9147264ba281136 Author: Peter Hutterer Date: Tue Oct 29 14:24:41 2013 +1000 kdrive: modify ephyr events to use POINTER_DESKTOP and scale them to that A multi-head Xephyr instance has the pointer stuck on one screen because of bad coordinate calculation. The coordinates passed to GetPointerEvents are per-screen, so the cursor gets stuck on the left-most screen by default. Adjust and mark the events as POINTER_DESKTOP, so the DIX can adjust them accordingly. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit d66832a3b8a8675f1e5f3656dcb1bbe95598f0ea Author: Keith Packard Date: Thu Nov 14 13:21:54 2013 +1000 kdrive: handle WxH as valid geometry spec If a screen size was specified as WxH, the loop returned early and kdOrigin was never advanced. Thus, screen->origin was always 0 (or whatever was given at the -origin commandline flag). If a screen size was given with a bit depth (WxHxD), kdOrigin would always advance by the current screen, offsetting the next screen. Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit c8c5105c1d5c093675d7f571f158147f22f7572b Author: Peter Hutterer Date: Tue Oct 29 14:33:56 2013 +1000 ephyr: xcb_connect returns an error, not NULL Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 2aa67ccef6ad8f51deb94b66defc668ddb7d226c Author: Keith Packard Date: Thu Nov 14 10:26:20 2013 +0900 Update to version 1.14.99.902 1.15 RC2 Signed-off-by: Keith Packard commit 9309d2a009a6a3b6090fc377fc7a3eded1a34dc0 Author: Keith Packard Date: Wed Nov 13 07:01:45 2013 +0900 xext: Fix shmint.h to not use headers outside of sdk_HEADERS shmint.h is part of sdk_HEADERS, and so can't use anything not included in sdk_HEADERS. busfault.h includes dix-config.h which is not. Leave the use of struct busfault in shmint.h and move the include of busfault.h to shm.c. protocol-versions.h is not part of sdk_HEADERS, so instead of using that, just use XTRANS_SEND_FDS to choose whether to expose the fd passing requests directly. Reported-by: Julien Cristau Signed-off-by: Keith Packard Tested-by: Knut Petersen Reviewed-by: Julien Cristau v2: also avoid using protocol-versions.h commit 4a251f5883b042cd902c192060a0be2b11148f2b Author: Jeremy Huddleston Sequoia Date: Fri Nov 8 14:55:33 2013 -0800 xfree86: Fix build without libpciaccess Regression fix from commit 04ab07ca19236d6c9a947e065fb69b0dd0d16639 Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Connor Behan commit 5b02d5b7aaabf1ba8dcbdfe4525b7995b4e79f92 Author: Alan Coopersmith Date: Thu Nov 7 21:08:56 2013 -0800 Enable XTRANS_SEND_FDS on Solaris too. Requires passing through the __EXTENSIONS__ and _XOPEN_SOURCE defines in order to expose the msg_control members in struct msghdr. Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson commit c4c154d18ef42dc550f2675a9ee88e07b1ca6bed Author: Alan Coopersmith Date: Thu Nov 7 21:05:33 2013 -0800 Avoid conflicts with Solaris defines that clash with our names When building on Solaris with _XOPEN_SOURCE set to a recent XPG release, and other core headers start including , which has a bunch of unfortunately named macros such as "CS", "ES", etc. for x86 & x64 registers which clash with existing variable & struct member names in Xorg - so #undef these so they don't interfere with our use. (Yes, have filed a bug against the system headers for exposing these, but this solves the problem for building on existing releases.) Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson commit d7f9be0f8541368bf1a095ad1fbe7f38be6d3d15 Author: Keith Packard Date: Mon Nov 11 15:48:41 2013 -0800 Proper spelling of MAP_ANONYMOUS is MAP_ANON. The former doesn't exist on BSD and the latter is available everywhere AFAIK (checked Solaris and Linux). You also might want to wrap that line ;). Reported-by: Mark Kettenis Signed-off-by: Keith Packard commit fc84166e65c35ad75f566b135dcfc305ad5a2fde Author: Keith Packard Date: Thu Nov 7 15:18:28 2013 -0800 Get rid of the rest of the FD passing code when XTRANS_SEND_FDS isn't set req_fds and SetReqFds in include/dixstruct.h ReadFdFromClient, WriteFdToClient and the FD flushing in os/io.c Signed-off-by: Keith Packard commit a239e6faf3fce848ac0d10c48f8e817db68a493c Merge: 43e5a43 f70a8bf Author: Keith Packard Date: Mon Nov 11 15:26:12 2013 -0800 Merge remote-tracking branch 'jeremyhu/master' commit 43e5a43fa8994e50cf01dd954118f4ef2c4e7933 Author: Adam Jackson Date: Thu Nov 7 12:01:41 2013 -0500 present: Don't try to initialize when building without present support There's a --disable-present, so it'd be nice if it worked. Signed-off-by: Adam Jackson Reviewed-by: Jasper St. Pierre Reviewed-by: Mark Kettenis Signed-off-by: Keith Packard commit 0822a23e048b12c98c654e8b6af711c5f2c97141 Author: Keith Packard Date: Thu Nov 7 03:19:42 2013 -0800 present: Change debug output a bit to help diagnose missing vblank signals Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 20bb49ae9ba11d3dccfba191483cd682d9c9d96c Author: Keith Packard Date: Wed Nov 6 23:56:26 2013 -0800 Present: Check for window/fence destroyed when idling pixmaps A client destroying objects in the middle of an unflip can end up having the screen flip window or fence set to NULL in the unflip notify path. Check for these and don't try to use those objects. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 41da295eb50fa08eaacd0ecde99f43a716fcb41a Author: Keith Packard Date: Sun Nov 3 13:12:40 2013 -0800 Trap SIGBUS to handle truncated shared memory segments If a client passes a section of memory via file descriptor and then subsequently truncates that file, the underlying pages will be freed and the addresses invalidated. Subsequent accesses to the page will fail with a SIGBUS error. Trap that SIGBUS, figure out which segment was causing the error and then allocate new pages to fill in for that region. Mark the offending shared segment as invalid and free the resource ID so that the client will be able to tell when subsequently attempting to use the segment. Signed-off-by: Keith Packard v2: Use MAP_FIXED to simplify the recovery logic (Mark Kettenis) v3: Also catch errors in ShmCreateSegment Conflicts: include/dix-config.h.in include/xorg-config.h.in commit 719e880d7698d92f9b854b217ef9680aaa446f2e Author: Keith Packard Date: Wed Nov 6 23:22:51 2013 -0800 Require libXtrans version 1.3.2 This has the FD passing support included Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit bee2ec54049377e0033d49abff20d7bd069c62aa Author: Keith Packard Date: Sun Nov 3 10:08:15 2013 -0800 Xext: Enable MIT-SHM FD-passing request definitions only when possible Check to see if xtrans FD passing is available and use that to advertise the appropriate version of the SHM extension Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith commit ea8acfe3e2f74a46c3f1e91809b4b99af18502b7 Author: Keith Packard Date: Wed Nov 6 23:06:28 2013 -0800 Require xextproto version 7.2.99.901 This includes the MIT-SHM FD passing requests Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith commit 914672fefacc15386041e7c2bc3beed4faf45e9d Author: Keith Packard Date: Thu Nov 7 14:20:26 2013 -0800 Remove dix-config.h config variables from xorg-config.h xorg-config.h includes dix-config, so there's no need to duplicate. Signed-off-by: Keith Packard commit 7aad79c5a582ece301d950bd65f0bcb4b9956e86 Author: Keith Packard Date: Wed Nov 6 23:05:46 2013 -0800 Make XTrans FD passing support optional. Define only on Linux Until other operating systems have a libXtrans port for FD passing, disable this on non-Linux systems. Note that this define affects how libXtrans gets built into the X server, which is why it need only define the symbol Signed-off-by: Keith Packard commit f70a8bf3714d89bccaad36841ef9149e91ad3bba Author: Jeremy Huddleston Sequoia Date: Sun Nov 10 11:40:27 2013 -0800 XQuartz: Don't sleep forever on exit if usleep() returns an error Signed-off-by: Jeremy Huddleston Sequoia commit ebcc1c214c466582d7b92826b4860256fd9c582a Author: Jeremy Huddleston Sequoia Date: Sun Nov 10 11:26:49 2013 -0800 XQuartz: Update Info.plist copyright years Signed-off-by: Jeremy Huddleston Sequoia commit 81c123ea2dd833864f7ba217791e59acca0f7c97 Author: Jeremy Huddleston Sequoia Date: Mon Nov 4 12:13:45 2013 -0800 configure.ac: Move GLX section after DRI The GLX section of configura.ac checks the state of DRI2, so it needs to be after DRI2=auto is resolved. Also reset libgl requirement to 7.1.0 in non-dri2 case. Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Adam Jackson commit ab4b1fb38a61feb73d8336cc7a3399eb9d3d25be Author: Andreas Schwab Date: Thu Aug 15 12:03:42 2013 +0200 ARM64: Add support for aarch64 Signed-off-by: Andreas Schwab Reviewed-by: Mark Kettenis Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 8fcf82cbf015609e00b3feb9bc567133c7aee5cf Author: Keith Packard Date: Tue Nov 5 18:39:11 2013 -0800 Use $GL_LIBS instead of -lGL for linking -lGL presumes that the GL library is in the system path, while $GL_LIBS is auto-detected. Signed-off-by: Keith Packard commit f348935e7d2c84a438aba08eee2f2c4e0dc77d20 Author: Keith Packard Date: Tue Nov 5 18:37:12 2013 -0800 Link with xshmfence, reference miSyncShmScreenInit in sdksyms This gets the server to link with xshmfence again, and also ensures that the miSyncShm code is linked into the server with the reference from sdksyms. Signed-off-by: Keith Packard commit 5f1e832694e57986c0185048a941b3af51b2f85f Author: Julien Cristau Date: Tue Nov 5 07:08:21 2013 -0800 os: Actually use the computed clockid in GetTimeInMicros The selection of which clock to use for this function was not actually getting used when fetching the final clock value. Reported-by: Julien Cristau Signed-off-by: Keith Packard commit 903a058370645ea075ea98d380fd565efb6160c9 Author: Keith Packard Date: Mon Nov 4 19:01:26 2013 -0800 hw/xfree86: Link libdri3 only when DRI3 is defined Don't attempt to link non-existant libraries... Signed-off-by: Keith Packard commit aaf0e29619196a283fee7ead2020a91032d84f48 Author: Keith Packard Date: Sun Nov 3 09:56:02 2013 -0800 Disable DRI3 and sync fence FD functions if xshmfence isn't available Make sure the server can build when the xshmfence library isn't present Signed-off-by: Keith Packard commit 33c85beed521c9db140cadd8c5aa9992398ee1fe Author: Keith Packard Date: Fri Nov 1 01:01:58 2013 -0700 Set version to 1.14.99.901 (1.15 RC1) Signed-off-by: Keith Packard commit 9db1d66f6d2c6857de220d8f1c08965962fe1416 Author: Keith Packard Date: Fri Nov 1 01:43:59 2013 -0700 Add dri3 and present directorys to distribution Signed-off-by: Keith Packard commit 977e2644b1d9e13b44debcb9a372bbc832ee32a3 Merge: 66c5ee0 f36f5a6 Author: Keith Packard Date: Fri Nov 1 00:34:18 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 66c5ee0ff4690e630a69656331fd9d545c99c26c Author: Egbert Eich Date: Wed Aug 14 18:18:56 2013 +0200 config/APM: Add option to disable building of APM support on Linux APM support in the Xserver was used to restore the console mode prior to a power management event. This was to ensure the mode upon suspend/resume was one that the system firmware or kernel could deal with. APM support is now largely obsolete, KMS drivers don't require a mode restoration anyhow. Therefore it should be possible to disable this feature. (small modification by keithp - move test for XF86PM flag after check for APM, then move XF86PM flag to xorg-config.h.in) Signed-off-by: Egbert Eich Tested-by: Keith Packard Signed-off-by: Keith Packard commit f36f5a65f639b6524191d888d5bf89e73027156c Author: Peter Hutterer Date: Wed Oct 30 15:40:58 2013 +1000 sync: fix corner-case in triggering idle alarms ProcessInputEvent() resets the device idle times. If idle time was higher than the lower bracket, this should trigger an event in the idle time wakeup handler. If processing is slow, the idle time may advance past the lower bracket between the reset and the time the BlockHandler is called. In that case, we'd never schedule a wakeup to handle the event, causing us to randomly miss events. Ran tests with a neg transition trigger on 5ms with 200 repeats of the test and it succeeded. Anything below that gets a bit tricky to make sure the server sees the same idle time as the client usleeps for. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit f994d99539192a10a8c83047e11991f52e0ca677 Author: Egbert Eich Date: Wed Aug 14 18:18:39 2013 +0200 config/ACPI: Add option to disable building of ACPI support on Linux ACPI support in the Xserver was used to restore the console mode prior to a power management event. This was to ensure the mode upon suspend/resume was one that the system firmware or kernel could deal with. The feature depended on acpid to be running. Most of this functionality is now take over by systemd, KMS drivers don't require a mode restoration anyhow. Therefore it should be possible to disable this feature under some circumstances. Tested-by: Keith Packard Signed-off-by: Keith Packard commit 2aa5092b88174cb9988076ae96298217c97ad75f Author: Egbert Eich Date: Mon Aug 12 18:21:33 2013 +0200 DDX/Randr: Avoid server crash when xrandr SetConfig is called while switched away A call to Xrandr SetScreenConfig (for randr 1.1) causes the Xserver to crash when xf86SetViewport() which does not check if the hardware is accessible. Wrap accesses to xf86SetViewport() with if (vtSema) { ... } to avoid that. Signed-off-by: Egbert Eich Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 508e05777aba823c93a2417cc26d18c9f061ca26 Author: Egbert Eich Date: Mon Aug 12 18:20:36 2013 +0200 DDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch() When enabling/disabling input handlers in xf86VTSwitch() we treat Input- and GeneralHandlers equally. The result is that after a VT switch the masks for EnabledDevices and AllSockets are equal and the distiction between both types is lost. Signed-off-by: Egbert Eich Reviewed-by: Daniel Stone Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 0cb33ce34081d7d123ec565582d7d19bdb3964ad Author: Egbert Eich Date: Sat Oct 5 08:02:28 2013 +0200 DDX/modes: Add a sanity check when using screen sizes from EDID EDID sometimes lies about screen sizes. Since the screen size is used by clients to determine the DPI a wrong ration will lead to terrible looking fonts. Add a sanity check for the h/v ratio cutting off at 2.4. This would still accept the cinemascope aspect ratio as valid. Also add message suggesting to add a quirk table entry. Signed-off-by: Egbert Eich Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 41d4beb2616ceb3f1a1b8694733e85bae70de59a Author: Egbert Eich Date: Wed Aug 14 11:50:26 2013 +0200 DDX/DPMS: Call dixSaveScreens() also when screen is turned on DMPS calls dixSaveScreens() when turned off but not when turned on. In most cases this is irrelevant as DPMS is done when a key is hit in which case dixSaveScreens() will be called to unblank anyhow. This isn't the case if we use xset (or the DPMS extension directly) to unblank. Check screenIsSaved to make sure the state needs to be changed before calling dixSaveScreens(). Signed-off-by: Egbert Eich Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 623c4147650d0404cfbea0f9b7df66dc7d928e00 Author: Søren Sandmann Pedersen Date: Mon Oct 21 17:11:56 2013 -0400 ephyr: Ensure stride of private framebuffer is multiple of 4 The fb layer of X can't deal with strides that are not a multiple of 4, so when Xephyr allocates its own framebuffer it should make sure to align it. This fixes crashes and rendering corruption when Xephyr runs in a depth that is different from the host X server and its screen size is not a multiple of 4 / depth. (This is particularly easy to trigger if you use the -resizeable option). Reviewed-by: Eric Anholt Signed-off-by: Soren Sandmann Reviewed-by: Adam Jackson commit 97cf53cc2ad7ecfdd495133bad31d0ec7d939326 Author: Søren Sandmann Pedersen Date: Mon Oct 21 16:58:54 2013 -0400 ephyr: hostx_screen_init(): Fix bits_per_pixel and bytes_per_line When the depth of the Xephyr server matches that of the host X server, Xephyr simply uses the buffer associated with the XImage as its framebuffer. In this case, it is correct to get the bits_per_pixel and bytes_per_line values returned from hostx_screen_init() from the XImage. However, when the depth doesn't match the host, Xephyr uses a private framebuffer that is periodically copied to the XImage. In this case, the returned values of bits_per_pixel and bytes_per_line should be those of the private framebuffer, not those of the XImage. Reviewed-by: Eric Anholt Signed-off-by: Soren Sandmann Reviewed-by: Adam Jackson commit 55246b67b755d4c1039d54971fe3f77ea60d604e Author: Søren Sandmann Pedersen Date: Tue Oct 8 17:45:40 2013 -0400 xf86AddBusDeviceToConfigure(): Store device in DevToConfig[i].pVideo After fc3ab84d the pVideo field in DevToConfig[i] is no longer initialized, so it's always NULL. This causes the duplicate finding algorithm in the beginning of the function to not work anymore as it is based on this field. The symptom of this bug is that X -configure reports Number of created screens does not match number of detected devices. Configuration failed. Server terminated with error (2). Closing log file. rather than producing a working config file. This patch fixes that bug by initializing the field before calling xf86PciConfigureNewDev(). Cc: tvignatti@gmail.com Signed-off-by: Soren Sandmann Reviewed-by: Adam Jackson commit 95bf478b78e466002c382bcde7d4d62591e9215d Merge: abf5d5a bb745f2 Author: Keith Packard Date: Thu Oct 31 18:18:19 2013 -0700 Merge remote-tracking branch 'jeremyhu/master' commit abf5d5ac12437ebe156b4dd500c2acd69eea3654 Author: Jeremy Huddleston Sequoia Date: Thu Oct 31 08:57:56 2013 -0700 miext/damage: Partial revert of "Only wrap into the GC ops chain if there's a listener (v3)" Fixes regression from: 4dc2a76740d921c824a4d8193f39dd373475f02a http://lists.x.org/archives/xorg-devel/2013-May/036241.html https://trac.macports.org/ticket/38993 Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit e4636072949a76477fe7c9d54662a0b3536b1372 Merge: 17ed7ac 5c5c1b7 Author: Keith Packard Date: Thu Oct 31 17:05:48 2013 -0700 Merge remote-tracking branch 'keithp/dri3' commit 17ed7ac1fe7426d66f688087c09da5ff1dbb41d3 Author: Adam Jackson Date: Thu Oct 31 18:39:22 2013 -0400 glx: Lie about GLX_Y_INVERTED_EXT Well, that was lame. The problem with reporting y inversion honestly is that libGL asks the driver _its_ opinion of Y inversion, which it just fabricates from whole cloth. So then when libGL goes to compare the driver's idea of fbconfigs with that of the server - a fairly dumb idea to begin with - nothing matches, and direct rendering fails, and sadness. So until the DRI drivers are fixed we should just continue to lie about Y inversion. GLX_DONT_CARE is what libGL would make up for that attribute if we hadn't sent it, so just send that instead. Signed-off-by: Adam Jackson Tested-by: Keith Packard Signed-off-by: Keith Packard commit 5c5c1b77982a9af7279a90bc3c2be48adaa9c778 Author: Keith Packard Date: Thu Jul 11 16:11:57 2013 -0700 present: Add Present extension Provides both a software implementation using timers and driver hooks to base everything on vblank intervals. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 563138298868f62501875d3016f03469dcffaad0 Author: Keith Packard Date: Tue Apr 9 19:59:39 2013 -0700 dri3: Add DRI3 extension Adds DRM compatible fences using futexes. Uses FD passing to get pixmaps from DRM applications. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit fdec793cdc2ef9a6ea66b311cb1068a7bd4a3be3 Author: Keith Packard Date: Thu Jan 17 13:46:55 2013 -0800 Add support for MIT-SHM AttachFd request This passes a file descriptor from the client to the server, which is then mmap'd Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 9fd35daa3160fd36f00ed354bfcbefefa1353cce Author: Keith Packard Date: Thu Jan 17 13:43:02 2013 -0800 Add interfaces to get FDs from clients over the socket This adds two interfaces: void SetReqFds(ClientPtr client, int req_fds) Marks the number of file descriptors expected for this request. Call this before any request processing so that any un-retrieved file descriptors will be closed automatically. int ReadFdFromClient(ClientPtr client) Reads the next queued file descriptor from the connection. If this request is not expecting any more file descriptors, or if there are no more file descriptors available from the connection, then this will return -1. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 264fc3abe5f18341d0cf9ddb6766e10e4154e447 Author: Keith Packard Date: Thu Oct 31 13:01:46 2013 -0700 misync: Don't smash custom screen sync functions There was a check to avoid smashing custom functions, but the sense was backwards causing it to always smash them, and also not set them otherwise. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 2d96948ab5c952b68875ac63844cf7d778d4bf63 Author: Keith Packard Date: Thu Jul 11 16:10:34 2013 -0700 os: Add GetTimeInMicros 64-bit higher resolution current time value. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 0c33f47281c36726848daf513fb0483cdea57bff Author: Keith Packard Date: Thu Jul 11 16:09:34 2013 -0700 Add swapll to byte swap 64-bit datatypes Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 26f013ba45b08a02bb028a461af68288a86fadb1 Author: Keith Packard Date: Thu Jul 11 16:08:41 2013 -0700 Add a RegionDuplicate function This allocates a new region structure and copies a source region into it in a single API rather than forcing the caller to do both steps themselves. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit d25c217964eb1fe54c3a54bca4cac7f47b4b9fdf Author: Keith Packard Date: Mon Jan 14 14:24:36 2013 -0800 Clean up a couple of warnings in os/ Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 7710f2b927ec8e3c631f72d66d494b523377b48e Author: Keith Packard Date: Fri Jan 18 21:43:40 2013 -0800 Xext: Move MIT-SHM 'ShmDesc' to shmint.h This data structure is required to use shared memory objects in any extension. That includes the Xv extension, which (before this patch) duplicated the definition of this structure in its own code. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit e8961b718d82f1c081ec110d8d962f64e8406b82 Author: Peter Hutterer Date: Tue Oct 22 14:24:52 2013 +1000 os: use a constant for backtrace array size Signed-off-by: Peter Hutterer Reviewed-by: Jasper St. Pierre commit f12a9ed870017f35cf6d2a82b1405e843aae42ac Author: Peter Hutterer Date: Tue Oct 29 15:24:11 2013 +1000 configure: remove a comment 94ed0ba1b5043ad9fc33b42756af447d5ab15bbd moved backtracing into the DIX, so this comment is outdated. since no-one noticed and it's easier to just grep than update file references, remove the comment. Signed-off-by: Peter Hutterer Reviewed-by: Jasper St. Pierre commit bb745f2b45768d0936f3960951e1a5cee8b03194 Author: Jeremy Huddleston Sequoia Date: Thu Oct 31 08:50:57 2013 -0700 XQuartz: Bump bundle version to 2.7.6 Signed-off-by: Jeremy Huddleston Sequoia commit 2eedf42c229e2251035d716a96b654222155cd51 Author: Adam Jackson Date: Thu Oct 31 09:23:52 2013 -0400 dri: Fix GLX_Y_INVERTED_EXT fbconfig attribute We're Y-inverted from GL's coordinates, so this is correct. gnome-shell doesn't seem to check this - somewhat reasonable since the only server that answered the other way around was Xglx - but kwin does, and upside-down hilarity ensues. Tested-by: maelcum on #xorg-devel Signed-off-by: Adam Jackson Signed-off-by: Keith Packard commit 902ff0b3497d202b86bf9a411e17db7b694d6eaa Author: Adam Jackson Date: Tue Oct 29 12:58:14 2013 -0400 xfree86: Bump video/input/extension ABIs for 1.15 Signed-off-by: Adam Jackson Reviewed-by: Julien Cristau Signed-off-by: Keith Packard commit 899451ae595f5f51a500295c624bf7ad14aca602 Author: Keith Packard Date: Wed Oct 30 08:54:24 2013 -0700 kdrive/ephyr: Don't discard one-time driver structure at server reset KdScreenInfo is constructed at server startup time, and not re-generated at server reset time. Freeing the 'driver' element at reset time means this information is lost, and the server crashes pretty quickly afterwards. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 85ae44f07fa21b4a48d95d736dc8135bd4f751d0 Author: Michal Srb Date: Wed Oct 30 13:33:51 2013 +0200 randr: deliver Output and Crtc events of attached output providers. Consider all attached output providers when looking for changed outputs and crtcs. Reviewed-by: Dave Airlie Signed-off-by: Michal Srb Signed-off-by: Keith Packard commit a9ca93dcf9a711b3d60fbad31cbd44e0c82b6f42 Author: Michal Srb Date: Wed Oct 30 13:33:50 2013 +0200 randr: send RRResourceChangeNotify event Send RRResourceChangeNotify event when provider, output or crtc was created or destroyed. I.e. when the list of resources returned by RRGetScreenResources and RRGetProviders changes. Reviewed-by: Dave Airlie Signed-off-by: Michal Srb Signed-off-by: Keith Packard commit 4b39ea8a918fe6117bf34dc1cba67a4e56d0d1fb Author: Michal Srb Date: Wed Oct 30 13:33:49 2013 +0200 randr: send RRProviderChangeNotify event Send RRProviderChangeNotify event when a provider becomes output source or offload sink. Reviewed-by: Dave Airlie Signed-off-by: Michal Srb Signed-off-by: Keith Packard commit 1470c0a132806fb2ce817515ad4ddfe66eb7c98f Merge: 04ab07c 9f4afe7 Author: Keith Packard Date: Tue Oct 29 21:00:13 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 9f4afe7e835cf9c513387ae01eaf8b7a6ba4aac9 Author: Gaetan Nadon Date: Mon Oct 28 18:32:36 2013 -0400 config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES Fix Automake warning: AC_OUTPUT should be used without arguments. www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Files Signed-off-by: Gaetan Nadon Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit e16dea72d6f45dd6d7788362bb7dbe76263719b1 Author: Peter Hutterer Date: Wed Oct 23 15:16:25 2013 +1000 dmx: queue button events with a flags of 0 Setting POINTER_SCREEN with a unset valuator mask causes a jump to 0/0. Set the flags to 0 so we don't generate any motion on a button event. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 04ab07ca19236d6c9a947e065fb69b0dd0d16639 Author: Connor Behan Date: Thu Oct 17 18:26:28 2013 -0700 xfree86: Find primary entity when bus types are nominally different As of server 1.13, systems with DRM and Udev will have BUS_PLATFORM as their primary bus type. However, drivers not implementing a platformProbe function will still create entities of type BUS_PCI. We need to account for this when checking for the primary entity. Signed-off-by: Connor Behan Acked-by: Tormod Volden Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit b32a4c91ccd479638c2bd2c0143b6ea170c717d1 Merge: be66809 c671e93 Author: Keith Packard Date: Tue Oct 29 09:37:30 2013 -0700 Merge remote-tracking branch 'idr/glx-float-fbconfig' commit be6680967a479eedbcab2fe1718c5f981e1029c7 Author: Adam Jackson Date: Wed Jul 10 10:00:46 2013 -0400 glx: convert to direct GL dispatch (v2) We now expect to be linked against something that provides the GL API, instead of manually grubbing about in the DRI driver's dispatch table. Since the GLX we expose calls GL functions that are meant to be looked up dynamically, also add a way to thunk through to GetProcAddress. This includes a refresh of the generated sources, which requires a correspondingly new Mesa. The GetProcAddress stubs are at the moment merely enough to make this link against Mesa 9.2, but should really be provided for everything not in the OpenGL 1.2 ABI. v2: Explicitly hide the GetProcAddress stubs so we can't conflict with libGL symbols; fix leading tab/space issues [anholt] Reviewed-by: Keith Packard Signed-off-by: Adam Jackson commit 8aacf47e1778d8b72811b025a82452b933d3c1f2 Author: Adam Jackson Date: Fri Oct 4 12:58:19 2013 -0400 glx: Remove DRI1 AIGLX (v2) Mesa doesn't ship DRI1 drivers as of 8.0, which is about 18 months and three releases ago. The main reason to have wanted DRI1 AIGLX was to get a GLX compositor working, but DRI1's (lack of) memory management API meant that the cost of a GLX compositor was breaking direct GLX apps, which isn't a great tradeoff. Of the DRI1 drivers Mesa has dropped, I believe only mga stands to lose some functionality here, since it and only it has support for NV_texture_rectangle. Since that's required for every extant GLX compositor I know of, I conclude that anybody with a savage, say, would probably not notice AIGLX going away, since they wouldn't be running a GLX compositor in the first place. In the future we'd like to use GL in the server in a more natural way, as just another EGL client, including in the GLX implementation itself. Since there's no EGL implemented for DRI1 drivers, this would already doom AIGLX on DRI1 (short of entirely forking the GLX implementation, which I'm not enthusiastic about). v2: Remove DRI1 from AIGLX conditionals in configure.ac [anholt] Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 7f5adf73a0f9a951a6df201532b4031d38054369 Author: Adam Jackson Date: Wed Oct 2 17:38:05 2013 -0400 glx: Simplify glXDestroyContext We can just free the resource unconditionally here. ContextGone (which FreeResourceByType will call) already does: cx->idExists = GL_FALSE; if (!cx->currentClient) { __glXFreeContext(cx); } Reviewed-by: Ian Romanick Signed-off-by: Adam Jackson commit 53653f4889dcaea0cf67f8a4180af71eeb4b2f6b Author: Adam Jackson Date: Mon Aug 5 15:46:11 2013 -0400 glx: Fix a corner case in DrawableGone Losing the drawable does not change our notion of current client. Since the GL under us doesn't understand having a current context without current drawables (sigh), we do still need to loseCurrent so that we re-bind the context on the next request. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65030 Reviewed-by: Ian Romanick Signed-off-by: Adam Jackson commit 276d8057aa7f6e36c9c874257a6383f416c5cedd Author: Adam Jackson Date: Sat Aug 3 09:47:55 2013 -0400 glx: Fix memory leak in context garbage collection (v2) I broke this, back in: commit a48dadc98a28c969741979b70b7a639f24f4cbbd Author: Adam Jackson Date: Mon Mar 21 11:59:29 2011 -0400 glx: Reimplement context tags In that, I changed the glx client state to not explicitly track the list of current contexts for the client (since that was what we were deriving tags from). The bug was that I removed the code for same from glxClientCallback without noticing that it had the side effect of effectively de-currenting those contexts, so that ContextGone could free them. So, if you had a client exit with a context still current, the context's memory would leak. Not a huge deal for direct clients, but viciously bad for indirect, since the swrast context state at the bottom of Mesa is like 15M. Fix this by promoting Bool isCurrent to ClientPtr currentClient, so that we have a back-pointer to chase when walking the list of contexts when ClientStateGone happens. v2: Explicitly call __glXFreeContext on the ClientStateGone path. Our current context might be one we got from EXT_import_context and whose creating client has since died. Without the explicit call, the creating client's FreeClientResources would not free the context because it's still current, and the using client's FreeClientResources would not free the context because it's not an XID it created. This matches the logic from a48dadc. Reviewed-by: Ian Romanick Signed-off-by: Adam Jackson commit 75b362763cca8b6139582ad85e3b58f0b2e30a1c Author: Adam Jackson Date: Tue Oct 8 15:02:44 2013 -0400 glx: Only take a Pixmap reference if creating the GLXPixmap succeeded Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson commit 4292a39c8014f9f4920bed3001802e4a3e523c5e Author: Peter Hutterer Date: Mon Oct 28 12:10:10 2013 +1000 Xi: fix logic error when calculating emulated motion events gcc -Wlogical-op exevents.c: In function 'DeliverEmulatedMotionEvent': exevents.c:1480:13: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op] The relevant snippet of exevents.c: 1479 if (ti->listeners[0].type != LISTENER_POINTER_REGULAR || 1480 ti->listeners[0].type != LISTENER_POINTER_GRAB) 1481 return; This condition was always true, causing dropped motion events. Reported-by: Alan Coopersmith Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit c671e935e7c44d4711ba9588ee96cb9796b879e6 Author: Daniel Czarnowski Date: Mon Oct 21 19:48:38 2013 +0200 glx: Enable GLX_ARB_fbconfig_float for DRI2 drivers v2 (idr): Maintain sort order of extension list. Fixed rebase error (comment header for initializeExtensions was in front of __glXDRIinvalidateBuffers). Re-write commit message. Signed-off-by: Daniel Czarnowski Signed-off-by: Ian Romanick Reviewed-by: Ian Romanick commit ccc8bb1153ec669f7540a174a81a8ec0e0d6dd67 Author: Daniel Czarnowski Date: Wed Oct 23 12:53:59 2013 +0200 glx: Handle float config types in glxConvertConfigs Replaces old use of floatMode attribute with new, extended range of values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the float modes support requires it. Enables support for not only float configs, but packed float configs as well. v2 (idr): Whitespace and formatting fixes. Refactor render type vs. pbuffer checking to a separate function that includes a quote from the spec. Re-write commit message. Fix compiler warnings: glxdricommon.c: In function 'glxConvertConfigs': glxdricommon.c:212:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign] glxdricommon.c:212:35: note: expected 'unsigned int *' but argument is of type 'int *' glxdricommon.c:230:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign] glxdricommon.c:230:35: note: expected 'unsigned int *' but argument is of type 'int *' Signed-off-by: Daniel Czarnowski Signed-off-by: Ian Romanick Reviewed-by: Ian Romanick commit 4e5eb15b4cc170499cf87e6633c1737f0b1c514b Author: Daniel Czarnowski Date: Mon Oct 21 19:57:53 2013 +0200 glx: Correctly set render type enum The type specified is bits, but the context wants an enum. v2 (idr): Fix various whitespace and formatting problems. Rename convFBconfRenderTypeBits2CtxRenderType to renderTypeBitsToRenderTypeEnum. Re-write commit message. Signed-off-by: Daniel Czarnowski Signed-off-by: Ian Romanick Reviewed-by: Ian Romanick commit eabb523aa45f3d8940cadac197ef1225fbfd5c56 Author: Daniel Czarnowski Date: Mon Oct 21 19:45:35 2013 +0200 glx: Allow float renderType in glXCreateContextAttribsARB This enables GLX_RGBA_FLOAT_TYPE_ARB and GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT as valid renderType parameters to glXCreateContextAttribsARB. v2 (idr) : Use C-style comments and fix word wrapping. Re-write commit message. Signed-off-by: Daniel Czarnowski Signed-off-by: Ian Romanick Reviewed-by: Ian Romanick commit 7ecfab47eb221dbb996ea6c033348b8eceaeb893 Author: Eric Anholt Date: Tue Oct 22 14:22:04 2013 -0700 glx: Add support for the new DRI loader entrypoint. This is going to be exposed (and not the old entrypoint) for some DRI drivers once the megadrivers series lands, and the plan is to eventually transition all drivers to that. Hopefully this is unobtrusive enough to merge to stable X servers so that they can be compatible with new Mesa versions. v2: typo fix in the comment Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 83bb366e71ef41165998eed2934208f84714a37e Author: Strake Date: Thu Oct 17 23:20:20 2013 -0500 unbreak KdEnableInput pi = ki = 0 here, so not follow them. Signed-off-by: Strake Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 8db4121a3c7104548fd4a138ac1d1bdea5fd22d9 Author: Keith Packard Date: Fri Oct 18 17:31:01 2013 -0700 Update to version 1.14.99.3 Signed-off-by: Keith Packard commit e3220d7bae4548bf64e5879c981ad070ac1f78f7 Merge: 73b2660 2523a44 Author: Keith Packard Date: Fri Oct 18 17:22:52 2013 -0700 Merge commit '2523a445a09a75a8baf642608d099a5e12d5437f' This is merging the commits along Peter's for-keith branch, without also merging in the spurious merge at the top of that branch. commit f8662a133690773692dfa392ecfa3b8b56af8fa9 Merge: 7cf1b59 2523a44 Author: Peter Hutterer Date: Fri Oct 18 16:50:12 2013 +1000 Merge branch 'xsync-transition-bug-59644' into for-keith commit 2523a445a09a75a8baf642608d099a5e12d5437f Author: Peter Hutterer Date: Thu Oct 17 12:02:27 2013 +1000 sync: split updating and triggering a counter up Now that the brackets are always the nearest change points (regardless of transition) we need to update the counters whenever we check for any updates. Otherwise we end up with a situation where counter->value is out of date and an alarm doesn't trigger because we're still using the value from last time something actually triggered. Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson Reviewed-by: Keith Packard commit e57ec99b03b2ad840c384a97ab2766ce9da0f5cc Author: Peter Hutterer Date: Wed Oct 16 16:31:15 2013 +1000 sync: always set the brackets (#59644) The current code sets bracket_greater to the first trigger after the current value, and bracket_less to the last trigger before the current value. For example, the idle timer with three negative and three positive transitions would set this: nt1 nt2 nt3 |--------|------|--|------- idle --|---|--|-----> t pt1 pt2 pt3 bracket_less == nt2 bracket_greater == pt2 This is an optimization so we can skip code paths in the block/wakeup handlers if the current value doesn't meet any of the trigger requirements. Those handlers largely do a if (bracket_less is less than current value && bracket_greater is greater than current value) return, nothing to do However, unless the bracket values are updated at the correct time, the following may happen: nt |--------------|---------- idle ------|--------> t pt In this case, neither bracket is set, we're past the pos transition and not yet at the neg transition. idle may now go past nt, but the brackets are not updated. If idle is then reset to 0, no alarm is triggered for nt. Likewise, idle may now go past pt and no alarm is triggered. Changing an alarm or triggering an alarm will re-calculate the brackets, so this bug is somewhat random. If any other client triggers an alarm when the brackets are wrongly NULL, the recalculation will set them this bug may not appear. This patch changes the behavior, so that the brackets are always the nearest positive or negative transitions to the current counter value. In the example above, nt will trigger a wakeup and a re-calculation of the brackets, so that going past it in the negative direction will then cause the proper alarm triggers. Or, in Keith's words: Timer currently past a positive trigger No bracket values, because no trigger in range Timer moves backwards before the positive trigger Brackets not reset, even though there is now a trigger in range Timer moves forward past the positive trigger Trigger doesn't fire because brackets not set Setting the LT bracket in this case will cause everything to get re-evaluated when the sync value moves backwards before the trigger value. X.Org Bug 59644 Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson Reviewed-by: Keith Packard commit 06b87aa528d7a739ba20101a1f83b1a428691a01 Author: Peter Hutterer Date: Wed Oct 16 10:08:46 2013 +1000 sync: if the idle time was reset, force alarms to trigger (#70476) The time between the idle reset and the IdleTimeWakeupHandler to be called is indeterminate. Clients with an PositiveTransition or NegativeTransition alarm on a low threshold may miss an alarm. Work around this by keeping a reset flag for each device. When the WakeupHandler triggers and the reset flag is set, we force a re-calculation of everything and pretend the current idle time is zero. Immediately after is the next calculation with the real idle time. Relatively reproducible test case: Set up a XSyncNegativeTransition alarm for a threshold of 1 ms. May trigger, may not. X.Org Bug 70476 Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson Reviewed-by: Keith Packard commit efc1035ca958f2c9d266338a308518a0834b1773 Author: Peter Hutterer Date: Wed Oct 16 09:36:01 2013 +1000 dix: provide accessor methods for the last device event time And now that we have the accessors, localize it. No functional changes, just preparing for a future change. Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson Reviewed-by: Keith Packard commit b7c9bd9cf276e92a73be57ff2ed32b47a80f13fb Author: Peter Hutterer Date: Wed Oct 16 09:21:47 2013 +1000 sync: supply the counter from IdleTimeBlockHandler The main idletime counter has an initialized deviceid, might as well be supplying it properly. Without this, we'd only ever check the XIAllDevices counter, so the wait would never be adjusted for the device-specific triggers. Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson Reviewed-by: Keith Packard commit 2efe49c1029f959fe80879bcf50df42e8b80451d Author: Peter Hutterer Date: Wed Oct 16 13:01:01 2013 +1000 sync: always call BracketValues when recalculating upper/lower brackets Both ServertimeBracketValues and IdleTimeBracketValues copy the value into there SysCounter privates. Call it for a NULL set as well, so we don't end up with stale pointers and we can remove the block/wakeup handlers. Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson Reviewed-by: Keith Packard commit 5c7cfd4c6978834551848e1be62af240102e39b5 Author: Peter Hutterer Date: Tue Oct 15 10:11:20 2013 +1000 sync: compress two if statements No functional changes, just merges a > and == condition into a >= condition. Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson Reviewed-by: Keith Packard commit 73b2660d7273d175d279d22f8ca0c3932a14ff1c Author: Alan Coopersmith Date: Mon Sep 16 21:47:16 2013 -0700 Avoid use-after-free in dix/dixfonts.c: doImageText() [CVE-2013-4396] Save a pointer to the passed in closure structure before copying it and overwriting the *c pointer to point to our copy instead of the original. If we hit an error, once we free(c), reset c to point to the original structure before jumping to the cleanup code that references *c. Since one of the errors being checked for is whether the server was able to malloc(c->nChars * itemSize), the client can potentially pass a number of characters chosen to cause the malloc to fail and the error path to be taken, resulting in the read from freed memory. Since the memory is accessed almost immediately afterwards, and the X server is mostly single threaded, the odds of the free memory having invalid contents are low with most malloc implementations when not using memory debugging features, but some allocators will definitely overwrite the memory there, leading to a likely crash. Reported-by: Pedro Ribeiro Signed-off-by: Alan Coopersmith Reviewed-by: Julien Cristau commit 8afe20d4e34adcfd29bdf43a01d55335ea2c5dba Author: Alan Coopersmith Date: Mon Sep 16 21:45:29 2013 -0700 Update GLX dependencies now that DRI & DRI2 are builtins, not modules Signed-off-by: Alan Coopersmith commit 2704bdb24a2c7bac65b90e05f1a68438b34ecf58 Author: Alan Coopersmith Date: Tue Sep 3 22:53:28 2013 -0700 DMX glxproxy: Don't allocate & copy data just to free it unused Two functions in the DMX glxproxy code loop over all the backend screens, starting at the highest numbered and counting down to the lowest. Previously, for each screen, the code would allocate a buffer large enough to read the reply from the backend, copy that reply into the buffer, and then if it wasn't the final screen, free it. Only the buffer from the final screen is used, to pass on to the client in the reply. This modifies it to just immediately discard the responses from the screens as we loop through it, only doing the allocate & copy work for the one buffer we pass back to the client. Signed-off-by: Alan Coopersmith Reviewed-by: Alex Deucher commit 6c06c268adbab63ebe7490489aa030724cbdc54b Author: Alan Coopersmith Date: Sun Aug 18 18:02:49 2013 -0700 Skip damage calls if DamageCreate fails in exa functions Fixes parfait errors such as: Null pointer dereference (CWE 476): Write to null pointer pDamage at line 1833 of miext/damage/damage.c in function 'DamageRegister'. Function DamageCreate may return constant 'NULL' at line 1775, called at line 232 of exa/exa_migration_mixed.c in function 'exaPrepareAccessReg_mixed'. Constant 'NULL' passed into function DamageRegister, argument pDamage, from call at line 237. Null pointer introduced at line 1775 of miext/damage/damage.c in function 'DamageCreate'. Null pointer dereference (CWE 476): Write to null pointer pDamage at line 1833 of miext/damage/damage.c in function 'DamageRegister'. Function DamageCreate may return constant 'NULL' at line 1775, called at line 104 of exa/exa_mixed.c in function 'exaCreatePixmap_mixed'. Constant 'NULL' passed into function DamageRegister, argument pDamage, from call at line 109. Null pointer introduced at line 1775 of miext/damage/damage.c in function 'DamageCreate'. Checks are similar to handling results of other calls to DamageCreate. [ This bug was found by the Parfait 1.3.0 bug checking tool. http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ] Signed-off-by: Alan Coopersmith commit 7cf1b595c8c8f9776a39559d2878cf90af3f2859 Author: Peter Hutterer Date: Wed Sep 4 15:34:29 2013 +1000 dix: only deliver for the current grab type Use the grabtype to determine which type of event to send - all other events are pointless and may result in erroneous events being delivered. Signed-off-by: Peter Hutterer commit 78944d62ffc7fec6f75b6f514ab7a139ba9bc77b Author: Peter Hutterer Date: Wed Sep 4 15:34:28 2013 +1000 dix: don't attempt to deliver an event for a different grabtype For an active grab, grab->eventMask can be either the core or the XI1 mask. With the overlap of event filters, calling DeliverOneGrabbedEvent(XI1) for a ProximityOut event will trigger if the client has selected for enter events - the filter is the same for both. Thus, we end up delivering a proximity event to a client not expecting one. Signed-off-by: Peter Hutterer commit 6159811a1aaf848016dbfa7bde68df097027870c Author: Peter Hutterer Date: Wed Sep 4 15:34:27 2013 +1000 include: change grabtypes to start at 1 Avoid erroneous detection of an unset grabtype as CORE Signed-off-by: Peter Hutterer commit be6ea80b79b3d6eb97106ea142e01acbdf059995 Author: Peter Hutterer Date: Wed Sep 4 15:34:26 2013 +1000 dix: only allow button and key events to freeze a sync'd pointer If a client calls XAllowEvents(SyncPointer) it expects events as normal until the next button press or release event - that freezes the device. An e.g. proximity event must thus not freeze the pointer. As per the spec, only button and key events may do so, so narrow it to these cases. Signed-off-by: Peter Hutterer commit 93a27b2dd0d7ed51120f42456a91a7c59902ebc2 Author: Michele Baldessari Date: Sun Sep 15 19:30:38 2013 +0100 Xephyr: restore cursor visibility Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69388 Commit c100211034ab69ce453a1644fb61c6808d7e3eda (dix: only show the cursor if a window defines one (#58398)) broke the default cursor behaviour in Xephyr (unless run with -retro). Restore the default cursor visibility so that '-retro' or '-host-cursor' are not needed to have a visible cursor. Signed-off-by: Michele Baldessari Reviewed-by: Peter Hutterer as of ba387cf21f7d95987211f75d8024601e7d64e322 "ephyr: Use host (HW) cursors by default." this only applies if -sw-cursor is given on the cmdline. Signed-off-by: Peter Hutterer commit 70efc799cbeec26f19831b3b14c0d4646198a077 Author: Michele Baldessari Date: Sun Sep 15 19:56:34 2013 +0100 Fix Xephyr compilation when DEBUG is enabled When DEBUG is enabled Xephyr compilation fails: ephyrdriext.c:343:133: error: 'is_ok' undeclared (first use in this function) EPHYR_LOG("leave. is_ok:%d\n", is_ok); Just reemove bogus is_ok variable. Signed-off-by: Michele Baldessari Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 5ac4bfca64bd75474e550b26bc1195a5ca245752 Author: Adam Jackson Date: Tue Sep 10 14:18:18 2013 -0400 input: calloc minimization for xi2mask_new There's no reason to do this as (nmasks + 2) callocs, and it's a surprisingly hot path. Turns out you hit this ~once per passive grab, and you do a few bajillion passive grab changes every time you enter or leave the overview in gnome-shell. According to a callgrind of Xorg with gnome-shell-perf-tool run against it: Ir before: 721437275 Ir after: 454227086 Signed-off-by: Adam Jackson Reviewed-by: Jasper St. Pierre Signed-off-by: Peter Hutterer commit 44d502c6f1d03a9e548f0941cde0228b6fde8394 Author: Jon TURNEY Date: Sun Oct 6 16:45:52 2013 +0100 hw/xwin: Fix for "glx: Remove screen number from __GLXconfig" Fix compilation after commit c3c976f54c3c282d6fa6c8360688e036bc43d210 "glx: Remove screen number from __GLXconfig" Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Adam Jackson commit 6a9bd103cb993e873cb82664b677ceed73c0bd85 Merge: ea3b7db 8aae28e Author: Keith Packard Date: Mon Oct 7 17:29:38 2013 -0700 Merge remote-tracking branch 'jeremyhu/master' commit ea3b7db4b747f883ef7b8b524ee13bf8a63add14 Author: Emil Velikov Date: Mon Oct 7 18:29:25 2013 +0100 configure.ac: Include missing proto declarations in SDK_REQUIRED_MODULES Commits a1d41e311c21e, 7d859bd87834d & 3ed2c6e11298c made extinit.h require the XF86 Big Font, XRes & ScrnSaver proto headers, but failed to add them to the SDK_REQUIRED_MODULES so pkg-config would find them for driver builds. Signed-off-by: Emil Velikov Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 8aae28e3cbdd49bfa8d940a4a517c94a53b94f86 Author: Jeremy Huddleston Sequoia Date: Sun Oct 6 09:20:45 2013 -0700 XQuartz: Dont't set screen on __GLXConfig Fixes regression introduced by c3c976f54c3c282d6fa6c8360688e036bc43d210 Signed-off-by: Jeremy Huddleston Sequoia commit c5f8eb968efa970201712105a1ac880b517e7b6d Author: Jeremy Huddleston Sequoia Date: Sun Oct 6 09:18:15 2013 -0700 rootless: Use miCopyRegion instead of fbCopyRegion Fixes regression introduced by e657635dbe6b92875b0e88370557c2cbab673a49 Signed-off-by: Jeremy Huddleston Sequoia commit ccbe17b1c6da1ad9d085fc8133cdd15dc7004a4a Author: Pino Toscano Date: Wed Aug 28 17:15:03 2013 +0200 os: move for any !win32 system It is needed in IPv6 configurations (for inet_pton) also when SIOCGIFCONF is not defined. Signed-off-by: Pino Toscano Acked-by: Samuel Thibault Signed-off-by: Julien Cristau commit c079b8e675dd2762c9e07fe5d8c07612299dceb7 Author: Pino Toscano Date: Wed Aug 28 17:04:48 2013 +0200 xfree86/hurd: include Needed for using get_privileged_port. Signed-off-by: Pino Toscano Acked-by: Samuel Thibault Signed-off-by: Julien Cristau commit f0659a7f68a5a334879af01a6a63742eab1bf5de Author: Keith Packard Date: Fri Oct 4 16:44:46 2013 -0700 Bump version to 1.14.99.2 Signed-off-by: Keith Packard commit f2d149b6d10edea7233d93c7e19f71decf11dc62 Author: Keith Packard Date: Fri Oct 4 16:43:41 2013 -0700 kdrive/ephyr: Remove duplicate ephyrExtensions and ephyrExtensionInit decls These were duplicated when GLX support was re-added on two different branches. Signed-off-by: Keith Packard commit e0a678f0596f3547b98d74d5f0438b484b059458 Author: Gaetan Nadon Date: Sat Sep 28 15:26:38 2013 -0400 xfree86: add a comment as to why the logdir is created Without the logdir, the xserver will write the content of the log file on the terminal stating that it cannot be written and will stop. Refer to https://bugs.freedesktop.org/show_bug.cgi?id=3889 Reviewed-By: Matt Dew Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 5bdbf2dba3f7da4a593b286020eab0c7857e940c Author: Gaetan Nadon Date: Sat Sep 28 15:26:37 2013 -0400 xfree86: Use $(MKDIR_P) for better code portability Still true that we should not use the lower case $(mkdir_p) version. However, remove the 2005 comment as the MKDIR_P is widely used now. Reviewed-By: Matt Dew Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit b8cfb0dc8426754b477b561bc158b8a24c143ddf Author: Gaetan Nadon Date: Sat Sep 28 15:26:36 2013 -0400 Uninstall X link and CYGWIN libXorg.exe.a in local install targets It is our duty to uninstall any files and/or directories that we installed through install-data-local and install-exec-hook. Currently the X symbolic link to Xorg remains on disk after running make uninstall. Note the exception for logdir which is usually shared by other modules. Reviewed-By: Matt Dew Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 35a528e49269c3df75486cc606e51a8c1c083c06 Author: Gaetan Nadon Date: Sat Sep 28 15:26:35 2013 -0400 Xorg binary: use install-exec-hook rather than install-exec-local The former was explicitly designed to execute additional code after the binary has been installed. The latter can be executed in any order, hence it's current dependency on install-binPROGRAMS as a workaround. The CYGWIN libXorg.exe.a target is an installation target rather than a post-installation one, so it should not be done as a hook. It does not depend on the Xorg executable being installed. Automake: "These hooks are run after all other install rules of the appropriate type, exec or data, have completed. So, for instance, it is possible to perform post-installation modifications using an install hook". "With the -local targets, there is no particular guarantee of execution order; typically, they are run early, but with parallel make, there is no way to be sure of that". Reviewed-by: Eric Anholt Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit a1d87576a30008253eb0cc92b44c9718f6665062 Author: Gaetan Nadon Date: Sat Sep 28 15:26:34 2013 -0400 Use $(LN_S) provided by AC_PROG_LN_S macro to create links For better code portability. Reviewed-By: Matt Dew Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 28c8e1910797970dbf1d40794f1804a8fcc812bc Author: Gaetan Nadon Date: Sat Sep 28 15:26:33 2013 -0400 The Xorg binary is missing the extension $(EXEEXT) in the makefile This is not a problem on UNIX platforms, but on CYGWIN it creates a broken link to Xorg rather than a link to Xorg.exe. From the CYGWIN log on tinderbox, we can see that the executable Xorg.exe is installed correctly. We can see the command used to create the link: (cd /jhbuild/install/[...]/install/bin && rm -f X && ln -s Xorg X) Note that the "relink" makefile target correctly appends $(EXEEXT) to Xorg. Reviewed-By: Matt Dew Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit f3b529bf25db2700addbafc7aa4fc5b126ba9929 Merge: 4399bd3 abc2bfc Author: Keith Packard Date: Fri Oct 4 14:04:48 2013 -0700 Merge remote-tracking branch 'anholt/ephyr-fixes' commit 4399bd38326b81f7b92365346504d7c6354772a9 Author: Gaetan Nadon Date: Mon Sep 30 13:30:46 2013 -0400 miext/shadow: missing c2p_core.h breaks "make distcheck" target. Reviewed-by: Julien Cristau Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 9ccb4a63982942fdce19609d2cadbd8e51708462 Merge: 5d2ec69 da5e201 Author: Keith Packard Date: Fri Oct 4 13:54:55 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 5d2ec6933f6bb5116666ca1bfb07f0f20bf2a0b5 Merge: 7d3d4ae 6ee4d9f Author: Keith Packard Date: Fri Oct 4 13:50:04 2013 -0700 Merge remote-tracking branch 'ajax/xserver-next' commit da5e20127a5b6e11a47eb6e61f3ea87b056cdf5f Author: Gaetan Nadon Date: Thu Sep 19 19:13:35 2013 -0400 test: add new os executable to .gitignore Signed-off-by: Gaetan Nadon Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit c73c36b537f996574628e69681833ea37dec2b6e Author: Laércio de Sousa Date: Wed Sep 18 13:42:17 2013 -0300 xserver: enable InputClass option "GrabDevice" by default for non-seat0 seats (#69478) This patch contributes to fill the remaining gaps which make systemd-multi-seat-x wrapper still necessary in some multiseat setups. This also replaces previous evdev patch that does the same thing for that particular driver. When option "-seat" is passed with an argument different from "seat0", option "GrabDevice" for input devices is enabled by default (no need of enabling it in xorg.conf's "InputClass" section). Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69478 Signed-off-by: Laércio de Sousa Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 160c2db32d0b9ee5316a44179a6af4f4722e3d0a Author: Peter Hutterer Date: Wed Sep 18 16:04:44 2013 +1000 dmx: provide enough space for axis mappings relmap/absmap is used as a evdev-axis-to-x-axis mapping. ABS_X maps to axis 0, ABS_Y to 1, etc. skipping over non-existing axes so that the third bit set in the ABS_* range is axis 2, and so on. This requires us to actually have enough space to have all the ABS_*/REL_* range. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit 7d3d4ae55dd6ee338439e2424ac423b1df80501b Author: Keith Packard Date: Fri Sep 20 14:43:41 2013 -0500 damage: Must translate initial window damage by window offset Damage is reported relative to the drawable origin, but the window borderClip is absolute. Translate the region by the window position before reporting damage to adjust. Reported-by: Adam Jackson Signed-off-by: Keith Packard Reviewed-by: Adam Jackson commit 8010d3a48bd0b224dcb0883e39c2351ad364d846 Author: Jeremy Huddleston Sequoia Date: Sun Sep 15 08:10:33 2013 -0700 XQuartz: pbproxy: Fix build with -DDEBUG Signed-off-by: Jeremy Huddleston Sequoia commit 39c548da0cf0522ad246630605b96751ab6d39c0 Author: Jeremy Huddleston Sequoia Date: Sun Sep 15 08:07:44 2013 -0700 XQuartz: Fix build with moved pseudoramiX Regression from: e716baedc4d8e52a60f43ef21aba771b340d8c8b Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Jon TURNEY commit 6ee4d9f94ae2cc27c39381d7554134d9b4807a65 Author: Adam Jackson Date: Tue Jul 9 11:19:11 2013 -0400 glx: Fill in some missing attributes from DoGetFBConfigs Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit b257fabff00ae925bb7e70364dd1d738634087c9 Author: Adam Jackson Date: Thu Jul 4 10:31:40 2013 -0400 glx: Remove a dead comment Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit abd086502123086ce3d1fba25c159bb022d2750f Author: Adam Jackson Date: Mon Jul 8 17:01:13 2013 -0400 glx: Catch another failure case in drawable creation Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit c3c976f54c3c282d6fa6c8360688e036bc43d210 Author: Adam Jackson Date: Mon Jul 8 12:28:56 2013 -0400 glx: Remove screen number from __GLXconfig Not used. There's no real reason to match against this instead of matching against fbconfig or visual ID anyway. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 1d1484e9bd55d1fa8316b1574754f28d5d31a076 Author: Adam Jackson Date: Mon Jul 8 12:09:13 2013 -0400 glx: Remove pixmapMode from __GLXconfig This has never been filled in with anything meaningful afaict, and you can't get to it from the client in any event. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 34e6e60105796ad015469c10921c5ff09acf7eb0 Author: Adam Jackson Date: Tue Jul 2 12:33:36 2013 -0400 glx: Remove support for NV_vertex_program and NV_fragment_program Mesa doesn't implement these anymore, never really did outside of swrast anyway. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit acf14c1de766c4ea206cd7ce7f25b780a589d33c Author: Adam Jackson Date: Tue Jul 2 10:35:19 2013 -0400 glx: realloc style fix in RenderLarge Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 9ebf739a6864c9ec38bf72f63ef2e3b9cd1951db Author: Adam Jackson Date: Tue Jul 2 10:30:40 2013 -0400 glx: Eliminate a small malloc from QueryContext No reason to have that be a failure path. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit b99f7975407f111b99d772cd28224d7dc1b34fe4 Author: Adam Jackson Date: Fri Nov 9 18:05:27 2012 -0500 glx: Handle failure to create the pixmap backing the pbuffer We happen not to sanitize the width/height we pass to CreatePixmap here, oops. It's not exploitable, but it's certainly a crash, so let's just throw BadAlloc instead. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 22fbfdcb31f335c22053a0e29f0e73c03cd70a76 Author: Adam Jackson Date: Fri Nov 9 17:52:12 2012 -0500 glx: Implement GLX_PRESERVED_CONTENTS drawable attribute We back pixmaps with pbuffers so they're never actually clobbered. Say so when asked. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 2e20b8382cdf37ae5a2802f85b8f06a370f9645d Author: Adam Jackson Date: Fri Nov 9 17:12:49 2012 -0500 glx: Implement GLX_FBCONFIG_ID in GetDrawableAttributes Required by GLX 1.4, section 3.3.6, "Querying Attributes". Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 0d76191baeee005982754ac18ca995742e32d8c1 Author: Adam Jackson Date: Fri Nov 9 17:10:57 2012 -0500 glx: Implement GLX_{WIDTH,HEIGHT} in GetDrawableAttributes Required by GLX 1.4, section 3.3.6, "Querying Attributes". Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit d11f13e383dda1e9cabe32793d261d46edc44418 Author: Adam Jackson Date: Fri Nov 9 17:07:20 2012 -0500 glx: Compute number of attributes in GetDrawableAttributes on the fly This doesn't have any effect yet, but is needed to properly build the reply for pbuffers. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 468b57324f838144d79e3a9d85a0bde853578c4b Author: Adam Jackson Date: Fri Nov 9 16:48:16 2012 -0500 glx: Style fixes Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 2b181ad0952851f47f23dcb1a36471685313c13e Author: Adam Jackson Date: Fri Nov 9 16:33:54 2012 -0500 glx: Pull GLX vendor string out of __GLXscreen Given how we're currently implementing GLX this can't meaningfully vary per-screen. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit b9c489cf13e1ad35b7d9bea9de8d85e929374d17 Author: Adam Jackson Date: Wed Oct 31 10:05:24 2012 -0400 glx: Remove unused bits from the context struct Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit f579cc85c29f52b575c62e6ae1e16eb87c506bd3 Author: Adam Jackson Date: Thu Jul 4 10:08:40 2013 -0400 glxproxy: Don't track GLCLientm{aj,in}orVersion Basically just a port of 62f06b0d to glxproxy. Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit e549ffb5f19cf044bc3e2d368a6f081f8b84bfaa Author: Adam Jackson Date: Tue Oct 30 18:20:43 2012 -0400 dmx/glx: Remove unused __glXNop Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit d962b8ed272d4a8921c0dadf16cd926484e30d10 Author: Adam Jackson Date: Thu Aug 22 16:42:23 2013 -0400 damageext: Style fix Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit c90add0f1ce0c85aea7a60635de765848d778266 Author: Adam Jackson Date: Wed Aug 21 11:57:24 2013 -0400 damage: Remove "post-rendering" hooks This is a revert of 974db58f5b730c3770ee461665a02dd4334d1dea. There are no consumers of this API, we must not need it. Reviewed-by: Chris Wilson Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 0f3f8e4295d4c05f33b93e0ffd2f6f8cd5759bf7 Author: Adam Jackson Date: Wed Aug 21 11:13:11 2013 -0400 damage: Don't rewrite Text ops to GlyphBlt ops There's no particularly good reason to, and it breaks Xnest. Bugzilla: http://bugs.freedesktop.org/2454 Reviewed-by: Chris Wilson Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit d08966227e7d567df8d26eebc80f35f886e59a4a Author: Adam Jackson Date: Mon Aug 26 14:03:51 2013 -0400 damage: Simplify DamageUnregister You can only register one drawable on a given damage, so there's no reason to require the caller to specify the drawable, the damage is enough. The implementation would do something fairly horrible if you _did_ pass mismatched drawable and damage, so let's avoid the problem entirely. v2: Simplify xf86RotateDestroy even more [anholt] Reviewed-by: Chris Wilson Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit 28708a045de7d9043d20fb06b61c44a46eb5526b Author: Adam Jackson Date: Mon Aug 26 13:52:14 2013 -0400 damage: Implicitly unregister on destroy There's no reason not to, and it simplifies quite a few callers. Reviewed-by: Chris Wilson Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson commit e657635dbe6b92875b0e88370557c2cbab673a49 Author: Adam Jackson Date: Thu Oct 18 14:24:23 2012 -0400 fb: Remove unused compatibility wrappers Originally added in early 2009, not being used elsewhere anymore. Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit e4b15125bb06c97f1f34f7074fcdb597e718399c Author: Adam Jackson Date: Thu Oct 18 14:24:22 2012 -0400 mipointer: Remove deprecated miPointerCurrentScreen The only remaining use was in some debugging code in DMX. Reviewed-by: Peter Hutterer Reviewed-by: Mark Kettenis Signed-off-by: Adam Jackson commit b5d66b9513a0f1e13f5c5bc9e0958f4eac9bf6c3 Author: Adam Jackson Date: Thu Oct 18 14:24:21 2012 -0400 xfree86: Remove deprecated unimplemented xf86MapReadSideEffects Reviewed-by: Peter Hutterer Reviewed-by: Mark Kettenis Signed-off-by: Adam Jackson commit abbd85742a390e18497b96902a0c0d976739e3bd Author: Adam Jackson Date: Thu Oct 18 14:24:20 2012 -0400 dix: FIXES is not optional It's already not optional at configure time, this just makes it so at build time too. Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit dff81687f5eac3eac9b49f58d4654cc30add2547 Author: Adam Jackson Date: Thu Oct 18 14:24:19 2012 -0400 vbe: Don't try to load the ddc submodule DDC is built into the server now. Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit bb82191bcfa8042f8d98ec8b1c6616dc31d2c5c8 Author: Adam Jackson Date: Thu Oct 18 14:24:18 2012 -0400 misprite: Delete some dead private storage Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit 3639ab4ce25dc82a3f8592b7322198f1d2aca5f9 Author: Adam Jackson Date: Tue Oct 16 14:56:25 2012 -0400 dri2: Don't bother with xf86LoaderCheckSymbol("DRI2Connect") The DRI2 code is now built-in to the server, even for Xorg. The only thing this could protect against is trying to run a libglx built with DRI2 support against an Xorg built without it, which is firmly in "doctor it hurts when I do this" territory. Reviewed-by: Peter Hutterer Reviewed-by: Ian Romanick Signed-off-by: Adam Jackson commit 13b507409f9e01adebba50e7eb801b52e52692ba Author: Adam Jackson Date: Tue Oct 16 14:56:23 2012 -0400 list: Avoid using X types In particular, Bool. This is not an ABI break: /usr/include/X11/Xdefs.h:typedef int Bool; Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit dbe10ef0e35659ee0e5db73f29670a3894a3e3f5 Author: Adam Jackson Date: Tue Oct 16 14:56:22 2012 -0400 dbe: Fold the window private private into the window private Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit 1489637d567b0034a916f88079b5f360e7fce99c Author: Adam Jackson Date: Tue Oct 16 14:56:21 2012 -0400 dbe: Fold midbe reset into dix Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit 44d770750069486a8452fb2384f9b85745268e61 Author: Adam Jackson Date: Tue Oct 16 14:56:20 2012 -0400 dbe: Drop the unused idiom support Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit 8cce0cf4d378f6fa52bc2cd277737b8986ab683c Author: Adam Jackson Date: Tue Oct 16 14:56:19 2012 -0400 damage: Remove the 'damage window' resource type. Note that the existing code never actually creates a resource of this type, so it can't possibly do anything. This is clearly meant to track window destruction and clean up any associated Damages, but that's already handled by miext/damage's DestroyWindow wrapper. Previous discussion: http://lists.freedesktop.org/archives/xorg-devel/2011-March/020847.html Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit e674815e0a217ac01ec2d6a8517f8466b27fb39f Author: Adam Jackson Date: Tue Oct 16 14:56:18 2012 -0400 dmx: Remove ShadowFB support This has been listed as deprecated ever since DMX was merged. Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit 19d3a7cb5db3188210830efa746987ba50d839e9 Author: Adam Jackson Date: Tue Oct 16 14:56:17 2012 -0400 dix: Remove a dead parameter from DoGetImage Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit 4dca026880da90cff9734cf5787c5b57c02e7310 Author: Adam Jackson Date: Tue Oct 16 14:56:16 2012 -0400 mipointer: Remove EnqueueEvent from miPointerScreenFuncRec No DDX overrode this, and we never actually called through that slot anyway. Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit ad076dc6e82019defa422500710b3b42c6309e39 Author: Adam Jackson Date: Tue Oct 16 14:56:15 2012 -0400 mipointer: Flatten calls to mieqSwitchScreen No DDX was overriding this. Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit e2b14a1d3bb27e86ff1d7aaf59af850d06263ef5 Author: Adam Jackson Date: Tue Oct 16 14:56:14 2012 -0400 os: Factor out some common code in input buffer handling Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson commit 65fca558848acd907483d3c85c7cd4db5560f1b4 Author: Radek Doulik Date: Tue Aug 13 08:45:47 2013 +0200 xnest: Ignore GetImage() error in xnestGetImage() When an Xnest instance is not viewable it will crash when a client in that instance calls GetImage. This is because the Xnest server will itself receives a BadMatch error. This patch ignores the error. The application which has requested the image will receive garbage - this however is fully legal according to the specs as obscured areas will always contain garbage if there isn't some sort of backing store as discussed in https://bugs.freedesktop.org/show_bug.cgi?id=9488 The applied patch is a version from Dadek Doulik. v2: Call XSync() before changing error handlers as suggested by Daniel Stone . Reviewed-by: Daniel Stone Signed-off-by: Egbert Eich commit b902c8abb6d03e68c93e13881a350523b5ac900c Author: Michal Srb Date: Tue Aug 6 16:56:53 2013 +0200 Xnest: Implement xnestModifyPixmapHeader Xnest variant of ModifyPixmapHeader that creates new Pixmap in parent X server if it's size is modified from 0x0 to anything bigger. xnestCreatePixmap doesn't create pixmap in parent X server if it has dimensions 0x0. If it is later resized and accessed, Xnest will be aborted with BadDrawable error from parent X server because it will use XID 0. This happens with ScratchPixmap, for example as used from XaceCensorImage. Applications using XACE crash Xnest. Reviewed-by: Adam Jackson commit 132507eba93e4dfd466d5c30c9b818cdc6f8536e Author: Peter Harris Date: Mon Jul 15 19:44:45 2013 -0400 security: Don't count RetainPermanent clients twice If a RetainPermanent client is subsequently killed by a KillClient request, the reference count is decremented twice. This can cause the server to prematurely kill other clients using the same Authorization. Reviewed-by: Adam Jackson Signed-off-by: Peter Harris commit 20c2a3bcb11b5baf564e2c73a477ba23f5ae2b10 Author: Peter Harris Date: Mon Jul 15 19:44:29 2013 -0400 mi: Avoid stack smash when drawing dashed lines X.org Bug 54013 Reviewed-by: Adam Jackson Signed-off-by: Peter Harris commit 9bf46610a9d20962854016032de4567974e87957 Author: Chris Wilson Date: Fri Jun 21 22:58:31 2013 +0100 os: Immediately queue initial WriteToClient If we immediately put the WriteToClient() buffer into the socket's write queue, not only do we benefit from sending the response back to client earlier, but we also avoid the overhead of copying the data into our own staging buffer and causing extra work in the next select(). The write is effectively free as typically we may only send one reply per client per select() call, so the cost of the FlushClient() is the same. shmget10: 26400 -> 110000 getimage10: 25000 -> 108000 shmget500: 3160 -> 13500 getimage500: 1000 -> 1010 The knock-on effect is that on a mostly idle composited desktop, the CPU overhead is dominated by the memmove in WriteToClient, which is in turn eliminated by this patch. Reviewed-by: Adam Jackson Signed-off-by: Chris Wilson commit ceffb34774d44ada83cc1994d20c8d65b46bd555 Author: Laurent Carlier Date: Sat Jun 8 00:43:56 2013 +0200 ephyr: restore GLX support It was removed since version 1.13 Signed-off-by: Sebastien Bacher Acked-by: Daniel Stone commit f37972f4a67b49ba9649310a6778bd1bf31e0130 Author: Keith Packard Date: Wed Apr 24 14:58:27 2013 -0700 miext/sync: Fix multi-screen support in SyncFence initialization miSyncSetup was checking to see if the screen private key had been registered, and if so, skipping the setup of the provided screen. Instead, it should register the private index only once, but then initialize the screen unless it has already been initialized. This latter step allows drivers to initialize the sync private structures before the Sync extension itself is initialized. Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 1c8beedfe4343377fa3504f8ab71430cc137b22c Author: Adam Jackson Date: Wed Aug 21 14:12:52 2013 -0400 randr: Fix a copypasta bug in CRTC confinement Reviewed-by: Michel Dänzer Signed-off-by: Adam Jackson commit 47ff382d1fce25a8b097d45b79489e891f1f1228 Merge: 6f89ae3 3752a81 Author: Keith Packard Date: Mon Sep 9 15:13:42 2013 -0700 Merge remote-tracking branch 'jturney/master' commit 6f89ae3e64c4dfeea508813e546c10ba1da3ea8e Author: Thomas Klausner Date: Wed Sep 4 20:06:07 2013 +0200 Fix typo in configure warning. Signed-off-by: Thomas Klausner Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 47218a6e09549781fd61dbf5e0d3d5c81da64323 Author: Thomas Klausner Date: Wed Sep 4 20:05:51 2013 +0200 Fix bug in cursor handling. CreateCursor (Xlib call XCreatePixmapCursor) with a non-bitmap source pixmap and a None mask is supposed to error out with BadMatch, but didn't. From der Mouse , changed following comments by Alan Coopersmith . Signed-off-by: Thomas Klausner Reviewed-by: Jasper St. Pierre Signed-off-by: Peter Hutterer commit 1110b71e360195aab040d835b54540ab558638c5 Author: Chris Clayton Date: Wed Sep 4 15:42:04 2013 +1000 kdrive: fix build error on gcc 4.8 for out-of-bounds array access I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot of gcc-4.8: input.c:225:43: error: array subscript is above array bounds [-Werror=array-bounds] This is because kdNumInputFds can become equal to KD_MAX_INPUT_FDS in KdRegisterFd(). This means that in KdUnregisterFd(), kdInputFds[j + 1] can be beyond the end of the array. Signed-off-by: Chris Clayton Reviewed-by: Keith Packard Signed-off-by: Peter Hutterer commit abc2bfca16adcd1e5657d4ce54f4e1335d5ed53f Author: Sebastien Bacher Date: Fri Aug 23 21:21:44 2013 +0200 kdrive: initialize GLX for xephyr Like commit ac1a60e7b6f06fd075cc5bf55d6bc67206a01d29, re-add initialization of GLX after it was accidentally dropped from non-Xorg servers in 5f5bbbe543f65c48ecbb5cce80116a86ca3fbe86. Signed-off-by: Sebastien Bacher Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62346 Reviewed-by: Eric Anholt Reviewed-by: Adam Jackson Reviewed-by: Julien Cristau Signed-off-by: Eric Anholt commit aa5534ec6931ffcc81cca76b98785d57de8e0e52 Author: Eric Anholt Date: Fri Aug 23 11:23:00 2013 -0700 ephyr: Do grab/ungrab for ctrl+shift, not just shift+ctrl. Given that the window title says "ctrl+shift", having pressing those keys in that order not ungrab you is fairly mean. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Reviewed-by: Julien Cristau commit 5cc15e1c427bacd73db7381df3474a23f7616624 Author: Eric Anholt Date: Fri Aug 23 11:19:17 2013 -0700 ephyr: Flush the X connection when updating the window title. Otherwise when you're doing the ctrl-shift mouse grab thing, you don't know what state you're in until the next rendering occurs. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Reviewed-by: Julien Cristau commit ba387cf21f7d95987211f75d8024601e7d64e322 Author: Eric Anholt Date: Fri Aug 23 11:17:14 2013 -0700 ephyr: Use host (HW) cursors by default. Unless you're working on the sw cursor rendering code, you surely want to have real hardware cursors. Signed-off-by: Eric Anholt Reviewed-by: Adam Jackson Reviewed-by: Julien Cristau commit 0f5a2f13dc284dd5f0f28e2c4323b2e08d253a7d Author: Eric Anholt Date: Fri Aug 23 11:04:22 2013 -0700 ephyr: Garbage collect some DOA host window clipping code. Introduced in 79782726617d4b5a4f9b376f21936d035fc870e1 but never used. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 090de17d361dc9828203a2562565d6499998db46 Author: Eric Anholt Date: Fri Aug 23 10:56:22 2013 -0700 ephyr: Garbage collect some dead XV clipping code. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 347d0fa6961c2b3dc4efd4e7cca8ef98cd3ea06e Author: Eric Anholt Date: Fri Aug 23 10:44:23 2013 -0700 ephyr: Remove the helper libs for each of the optional components. Note that EXTRA_DIST was always unnecessary, because automake notices conditional compile of source files and includes them. Copyright header is added because git noted that this was a 61% rewrite. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 74dff87790dbb3dcb23634f1e8cd54018e5ddc9d Author: Eric Anholt Date: Fri Aug 23 10:40:52 2013 -0700 ephyr: Remove the remaining bits of host/server XV split. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 2f994dfe9d1add9ea8cb9c88ddb0d15843854788 Author: Eric Anholt Date: Fri Aug 23 10:14:36 2013 -0700 ephyr: Remove the host/server split of the actual XV video operations. I suspect there's more cleanup possible in ephyrHostXVPutImage() by sticking a bunch of the args in the port priv earlier. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 0b7ce74315213ccd31802847e5a83e67090ded14 Author: Eric Anholt Date: Fri Aug 23 10:01:23 2013 -0700 ephyr: Remove another host/server split for XV image formats. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 1dcc28bcb402d7286d18b41b469062a5c176d7eb Author: Eric Anholt Date: Thu Aug 22 17:00:41 2013 -0700 ephyr: Remove the host/server split for video encodings. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 28a37757e11068b4594f4128a0d64c6bc9a53ee0 Author: Eric Anholt Date: Thu Aug 22 17:26:21 2013 -0700 ephyr: Remove the host/server split for XV formats. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 41134d393a37dd5b971b018a3888fbfea0b9c736 Author: Eric Anholt Date: Thu Aug 22 17:21:37 2013 -0700 ephyr: Remove the host/server split for XV attributes. v2: Fix leaks of xcb replies (caught by Julien) Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 1342a93c49beb6e4924534304119d57fa587ad0f Author: Eric Anholt Date: Thu Aug 22 17:26:08 2013 -0700 ephyr: Remove the host/server split for XV adaptors. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit fad79d2e3e53de4f25b3d1dd7accb558464a4a46 Author: Eric Anholt Date: Sun Aug 18 20:08:32 2013 +0200 ephyr: Refactor XV adaptor feature detection. This obviously wanted a helper function beforehand, but even more so now that we have XCB. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 7a9c311add62026972419ef0b04a55680072bfeb Author: Eric Anholt Date: Sun Aug 18 20:02:53 2013 +0200 ephyr: Remove some pointless indirection in the XV code. Now that we have XCB on the server side, we don't need to split these functions out. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 46cf6bf5692ef751ec9d17ae2292565d4b13f14b Author: Eric Anholt Date: Sun Aug 18 18:38:29 2013 +0200 ephyr: Move event processing into ephyr.c. No more extra event structure to translate between hostx.c and ephyr.c! Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 847c856effde482c13cdefcdca8176cee3bf67c4 Author: Eric Anholt Date: Sun Aug 18 17:28:08 2013 +0200 ephyr: Move the host screen info into the kdrive screen private. We can include xcb bits from the same place as server headers, so there's no need to hide them any more. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 8dadc78e233f341f1ecb8d404de03d98ab210620 Author: Eric Anholt Date: Sun Aug 18 16:45:06 2013 +0200 ephyr: Rename and use the proper type for what was host_screen->info. Now that we can include server headers in talking to host X, we don't need to hide any more. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 18d836f6dde46bcac8b794d34f76032688c28851 Author: Eric Anholt Date: Sun Aug 18 14:12:45 2013 +0200 ephyr: Expose a single function for detecting extensions. v2: Fix trying to include xcb-dri in the non-dri-build case (Noted by Julien) Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 3aacb22d6473480c31fb08f0b2527747dbf5be57 Author: Eric Anholt Date: Sun Aug 18 14:01:53 2013 +0200 ephyr: Drop dead ephyrHostAtomToLocal code. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 4aaad0bfbcef018eb36839b1d034c3f60022694a Author: Julien Cristau Date: Wed Oct 20 20:10:43 2010 +0200 Xephyr: we're not using Xlib anymore, no need to undef _XSERVER64 Drop obsolete comments about interaction between Xlib code and that macro, and stop undefining it. Signed-off-by: Julien Cristau Reviewed-by: Eric Anholt commit 0fc2f9f04a44599f598380d4df992bec60c0e3a1 Author: Julien Cristau Date: Sat Sep 25 16:05:07 2010 +0200 Xephyr: handle errors in event loop Signed-off-by: Julien Cristau Reviewed-by: Eric Anholt Reviewed-by: Mikhail Gusarov commit 3309a73c826f02c4b2e14180a3254546314ec323 Author: Julien Cristau Date: Fri Jun 25 14:20:57 2010 +0100 Xephyr: drop remaining Xlib dependency Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit 7da2174cf93f59b7e0372a6dc9d37a510076e187 Author: Julien Cristau Date: Mon Jun 21 14:39:03 2010 +0100 Xephyr: move glx code to xcb v2: Rebase on master, notably adding XCB for X_GLXvop_MakeCurrentReadSGI (anholt). v3: Fix use-after-free (caught by Julien). Reviewed-by: Mikhail Gusarov (v1) Signed-off-by: Julien Cristau Signed-off-by: Eric Anholt commit 19c2699b954e2978301c4449dfccc7ca40bf6ae6 Author: Julien Cristau Date: Wed Jun 23 18:36:00 2010 +0100 Xephyr: remove unused DRI1 code Reviewed-by: Mikhail Gusarov Signed-off-by: Julien Cristau commit 68b7db19e8d3c1ac55a811327d3058f4c8fb45ec Author: Julien Cristau Date: Sun Jun 20 00:07:08 2010 +0100 Xephyr: move ephyrdri over to xcb Require new xcb-xf86dri to get fixed GetDrawableInfo. Reviewed-by: Mikhail Gusarov Signed-off-by: Julien Cristau commit aea119cd05807ed77336f96a40f8e4607c6ce169 Author: Julien Cristau Date: Sun Jun 20 11:13:26 2010 +0100 Xephyr: use xcb-xv instead of libXv v2: Massive, conflict-filled rebase. I think I resolved everything right, but this host xv code makes my eyes bleed. Touch-tested XV after the rebase (anholt). Reviewed-by: Mikhail Gusarov (v1) Signed-off-by: Julien Cristau Signed-off-by: Eric Anholt commit 3ea75a59d5fec3c4099388724942e216f2344328 Author: Julien Cristau Date: Mon Jun 21 17:20:32 2010 +0100 Xephyr: use xcb for event handling v2: Rebase on indentation changes, squash in a simpler variant of the later event compression patch, fix server hang or segfault on window close by reimplementing the x_io_error_handler in the new XCB event loop (anholt). Reviewed-by: Mikhail Gusarov (v1) Signed-off-by: Julien Cristau Signed-off-by: Eric Anholt commit ff26845252889f7cc3258a0d3aa116189acc6aae Author: Julien Cristau Date: Thu Jun 24 23:45:16 2010 +0100 Xephyr: some more hostx.c xcb-ification Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit 9b55f76a265aab0d9943a40208a38800e5782ba5 Author: Julien Cristau Date: Thu Jun 24 23:35:15 2010 +0100 Xephyr: move HostX.visual to xcb Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit 126312fb4a6e06024a306341e675163108426390 Author: Julien Cristau Date: Thu Jun 24 23:26:48 2010 +0100 Xephyr: replace XKeycodeToKeysym with xcb-keysyms Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit 8543d3fdfd47d2a0423f3ef8e7429c23c5d6b053 Author: Julien Cristau Date: Thu Jun 24 23:17:32 2010 +0100 Xephyr: delete unused hostx_get_extension_info function v2: Also remove the prototype (anholt) Reviewed-by: Mikhail Gusarov (v1) Signed-off-by: Julien Cristau Signed-off-by: Eric Anholt commit d72c11b9df4a98fd80cb6635d34964483e33bc41 Author: Julien Cristau Date: Mon Jun 21 14:25:11 2010 +0100 Xephyr: delete unused proxy code Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit a71ea3f96769da157dde82a591e43264820772ac Author: Julien Cristau Date: Sun Jun 20 23:34:54 2010 +0100 Xephyr: xcb-ify visual list construction Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit ac2b0348c00d692ec1bd8d6c8ab99e9198e755a7 Author: Julien Cristau Date: Sun Jun 20 23:34:39 2010 +0100 Xephyr: xcb-ify pointer/keyboard grab Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit 1f93e6b350d1b9a058009052a666a2e8796708cb Author: Julien Cristau Date: Sun Jun 20 23:34:03 2010 +0100 Xephyr: no need for XDisplayKeycodes Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit 73398e5bf61c30e69a40a19a1057c2263fbb91ef Author: Julien Cristau Date: Thu Jun 24 23:00:38 2010 +0100 Xephyr: use xcb-shape instead of XShape* Reviewed-by: Mikhail Gusarov Reviewed-by: Eric Anholt Signed-off-by: Julien Cristau commit a2b73da78de4e627965213d24a6c33f243a60eb6 Author: Julien Cristau Date: Sun Jun 20 00:05:40 2010 +0100 Xephyr: start converting hostx.c over to xcb v2: Dropped the hostx_load_keymap changes, now that that function is gutted (anholt). Reviewed-by: Mikhail Gusarov (v1) Signed-off-by: Julien Cristau Signed-off-by: Eric Anholt commit 762606b4cdfb57c5202ae128ce4dbb8afe172d4e Author: Julien Cristau Date: Fri Jun 25 17:59:13 2010 +0100 Xephyr: stop loading the host's keymap This isn't used anywhere. v2: Rebase to the top of the patch series (anholt) Reviewed-by: Mikhail Gusarov (v1) Signed-off-by: Julien Cristau Signed-off-by: Eric Anholt commit 3752a815800626ae93f64a856f5889aa6636344e Author: Marc Haesen Date: Sat Aug 10 17:38:38 2013 +0100 hw/xwin: Remove unnecessary and incorrect HWND casts Signed-off-by: Marc Haesen Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 34932cef6cc800fbdf2f375506057ed8cd1e07f6 Author: Jon TURNEY Date: Mon Apr 1 13:43:00 2013 +0100 hw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration /jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c: In function ‘MitGenerateCookie’: /jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c:87:5: error: implicit declaration of function ‘MitAddCookie’ [-Werror=implicit-function-declaration] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit 2a08554a0bf80b862c15676c31ecd463b616518c Author: Jon TURNEY Date: Mon Jun 17 23:54:01 2013 +0100 hw/xwin: Remove unused extern g_fUseUnicode from winclipboardwndproc.c Signed-off-by: Jon TURNEY Reviewed-by: Marc Haesen commit 69401f38a697c941ea58351028f4cd4b810f9188 Author: Jon TURNEY Date: Mon Jun 17 18:37:26 2013 +0100 hw/xwin: Remove unneeded forward declaration of winProcessXEventsTimeout() Remove unneeded forward declaration of winProcessXEventsTimeout(), the actual definition immediately follows. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit 9c45a1ad44f12ac25e1c3b7a18a3bceb85a2cf38 Author: Jon TURNEY Date: Mon Jun 17 16:58:47 2013 +0100 hw/xwin: Remove prototype for non-existent winDeinitClipboard() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit acc46fc217352b94f77a6b5b14808ea89875a2a1 Author: Jon TURNEY Date: Mon Jun 17 00:40:13 2013 +0100 hw/xwin: Remove unused externs from winclipboardwrappers.c Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit fcc7767f8cd6c318861b1060ef6a3936750a0dd2 Author: Jon TURNEY Date: Mon Jun 10 17:31:12 2013 +0100 hw/xwin: Remove unused winProcQueryTreeOrig variable Unused since 47c7b6d3e626497747ae2780f259a15b8e6c846f "Remove no-longer needed tricks used to prevent the clipboard client from being killed" Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit 8fa882a980abea6f05b4b59447a187aea2c793a1 Author: Jon TURNEY Date: Sat Aug 10 12:41:07 2013 +0100 hw/xwin: Fix ARGB cursor conversion on x86_64 Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which leads to ARGB cursors being vertically streched on x86_64 by interleaving blank rows of pixels. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit 4bfb2dce5eea4923eaf86eca33b96087b28235f5 Author: Jon TURNEY Date: Sun Apr 7 23:59:44 2013 +0100 hw/xwin: Fix an issue in winSetSpansNativeGDI() identifed by -Warray-bounds The BITMAPINFO local only has room for a single RBGQUAD in bmiColors, but we access two (black and white for a mono-color DIB). Fix by changing to a dynamic allocation big enough for a BITMAPINFO and a RGBQUAD. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit 784c006adb22c6693ad30dd0b1b05369cfaa7b5e Author: Jon TURNEY Date: Sat Aug 10 11:55:23 2013 +0100 hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR() Rewrite winXCursorToHCURSOR() so access to BITMAPINFO bmiColors member doesn't trigger an -Warray-bounds warning. Note that the underlying storage is allocated as a BITMAPV4HEADER, so has sufficent room for the extra RGBQUADs bmiColors after the BITMAPINFO bmiHeader. wincursor.c: In function 'winSetCursor': wincursor.c:293:24: error: array subscript is above array bounds [-Werror=array-bounds] wincursor.c:294:24: error: array subscript is above array bounds [-Werror=array-bounds] wincursor.c:295:24: error: array subscript is above array bounds [-Werror=array-bounds] wincursor.c:296:24: error: array subscript is above array bounds [-Werror=array-bounds] wincursor.c:297:24: error: array subscript is above array bounds [-Werror=array-bounds] wincursor.c:298:24: error: array subscript is above array bounds [-Werror=array-bounds] wincursor.c:299:24: error: array subscript is above array bounds [-Werror=array-bounds] wincursor.c:300:24: error: array subscript is above array bounds [-Werror=array-bounds] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit 41d03c9ccce665b919b180bbb819b78c750aa325 Author: Marc Haesen Date: Fri Aug 2 18:19:22 2013 +0100 hw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64 Use the correct size of a HWND on x86_64 in XChangeProperty() and XGetWindowProperty() calls for the _WINDOWSWM_NATIVE_HWND property. Signed-off-by: Marc Haesen Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 390cfec10ef7d52391f890c7593ac82a7d77d856 Author: Colin Harrison Date: Fri Aug 9 16:48:12 2013 +0100 hw/xwin: Correct winprefs.c function signatures for x64. Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and HandleCustomWM_COMMAND() function signatures which use unsigned long parameters, where just a specific HWND or HMENU handle type should have been used. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY Reviewed-by: Marc Haesen commit e716baedc4d8e52a60f43ef21aba771b340d8c8b Author: Jon TURNEY Date: Sat Mar 31 14:42:45 2012 +0100 Move pseudoramiX code where it can be shared between Xwin and Xquartz Move pseudoramiX code to a separate top-level directory. Link Xwin and Xquartz with libPseudoramiX I'm not sure moving this to a top-level directory is appropriate, but I'm not sure where else it fits. Future work: pseudoramiX can probably be consolidated with the rrxinerama code (which I think provides fake xinerama data when real XINERAMA is disabled and we only have one screen) v2: fix distcheck Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit ce0217b98261dcf8b20cfb743831965dda1950ec Author: Jon TURNEY Date: Sat Aug 10 12:35:55 2013 +0100 hw/xwin: Fix winglobals.h for MinGW64 build Include pthread.h in winglobals.h to fix build with latest MinGW64 headers In file included from winmultiwindowicons.c:47:0: winglobals.h:92:1: error: unknown type name ‘pthread_mutex_t’ Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit b27756dbe6a1be4633ec47a8fe92a4c217f68f93 Author: Jon TURNEY Date: Sun Aug 11 12:15:11 2013 +0100 hw/xwin: Fix inclusion of shlobj.h in MinGW64 build Fix build with latest MinGW64 headers by wrapping Status type in shlobj.h as well In file included from InitOutput.c:51:0: /usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1231:44: error: expected identifier or ‘(’ before ‘int’ /usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1248:44: error: expected identifier or ‘(’ before ‘int’ Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen commit 94d4e29aedc69431fa9b299ca1b67947173d7a24 Author: Peter Hutterer Date: Mon Aug 26 15:51:46 2013 +1000 Xi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554) XIAllowEvents changed length in XI 2.2 (for the touchid). A bug in libXi causes libXi to always use the new request length if the server supports 2.2, regardless of the client's XIQueryVersion request. The server takes the client's XIQueryVersion request into account though, resulting in a BadLength error if a 2.[0,1] client calls XIAllowEvents on a XI 2.2+ server. Can't fix this in libXi, so work around this in the server. X.Org Bug 68554 Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson commit 82939e02392cbb880313fe92957091ff89ce2f2b Author: Peter Hutterer Date: Fri Aug 16 15:30:59 2013 +1000 dix: check for grab type before checking XI2 mask if the grab type isn't XI2, grab->xi2mask is random. That random data may have the enter/leave mask set, leading to events sent to the client that the client can't handler. Source of these errors: _xgeWireToEvent: Unknown extension 131, this should never happen. Simplest reproducer: Start Xephyr, press button inside window, move out. As the pointer leaves the Xephyr window, the errors appear. Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson commit 16894df1ffb6fe21bf723dd954578e8d934799ca Author: Peter Hutterer Date: Fri Aug 16 10:55:09 2013 +1000 Xi: replace loop with memset Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson commit 8f2292b683f591052da2fe94fb3831a3c9a5aa61 Author: Peter Hutterer Date: Fri Aug 16 11:05:49 2013 +1000 include: wrap EMASKSIZE in parentheses Otherwise things like EMASKSIZE * foo will yield interesting results. Signed-off-by: Peter Hutterer Reviewed-by: Adam Jackson commit d803f296c616ccf55711cf0af9e7d3eae2edda16 Author: Peter Hutterer Date: Fri Aug 23 09:04:01 2013 +1000 test: fix the gcc diagnostics pragma pop without push restores the commandline options. The proper way is to push, then ignore, then pop. And while we're at it, change the pop argument to a comment - pop ignores the argument, but be proper about it. Signed-off-by: Peter Hutterer commit 05ea6307fa4f0bee3d3bf536396059f3906791a0 Author: Egbert Eich Date: Fri Aug 16 19:52:16 2013 +0200 DIX/Xi: Pass correct client to CheckDeviceGrabAndHintWindow() If we have a client which has registered for a DeviceButton grab be sure to pass this to CheckDeviceGrabAndHintWindow(). Since the order of clients is arbitrary there is no guarantee that the last client in the list is the one that belongs to this class. Signed-off-by: Egbert Eich Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit e01a3f65d3e6d92f92ef2992b338cc9625bde082 Author: Eric Anholt Date: Sat Aug 17 14:50:37 2013 +0200 ephyr: Fix warning about XID vs unsigned long * by changing function args There's no reason to pass the data back out to the caller, since the caller was dropping it on the floor. The original data is a CARD32, so no need to mess with weird unsigned longs. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit f1cefe020bd21c07dfcc9f204e79939499abbd35 Author: Eric Anholt Date: Sat Aug 17 14:38:08 2013 +0200 ephyr: Drop is_ok logging. The only cases that lead to !is_ok are already EPHYR_LOG_ERROR, and it fixes set-but-unused compiler warnings. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 77c7a2014e3942b55c0b78308edf02eab33f2e60 Author: Eric Anholt Date: Sat Aug 17 14:36:09 2013 +0200 kdrive: Fix const cast warnings in arguments processing. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 7107937e473a3557c37d719cb100b2e9b09075dd Author: Eric Anholt Date: Sat Aug 17 13:11:17 2013 +0200 kdrive: Fix const cast warnings in driver name handling. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 56c405d46a86853771a0b808da4c8a9ef626960c Author: Eric Anholt Date: Sat Aug 17 13:07:23 2013 +0200 kdrive: Fix a few easy cast warnings. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit a9c48a07eea50468fa47ab178cdd91edb0b5727f Author: Eric Anholt Date: Sat Aug 17 13:06:23 2013 +0200 kdrive: Drop dead code. This is unused as of the introduction of a helper in e7150db5350bc2113ff4126019b489847a4dc217 Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 873ae962bdb7559c952b5955ba262285701982a8 Author: Eric Anholt Date: Sat Aug 17 13:01:57 2013 +0200 ephyr: Fix dead code warning. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 34af2eebe19e2f8afe35a5614d4d44fa4fd89d6b Author: Eric Anholt Date: Sat Aug 17 13:01:32 2013 +0200 ephyr: Fix const-cast warnings for setting window title. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit 7edf5066db48434739ac64e0576fbb4fdf0f37f9 Author: Eric Anholt Date: Sat Aug 17 12:54:33 2013 +0200 ephyr: Fix const cast warnings in ephyrhostvideo. Signed-off-by: Eric Anholt Reviewed-by: Julien Cristau commit fe7463b8ce0de301c2f82b108c93963424f77219 Author: Julien Cristau Date: Sat Jul 27 12:09:07 2013 +0200 dix: add missing include for DeleteWindowFromAnySelections Fixes build error with XACE disabled: window.c:886:5: error: implicit declaration of function 'DeleteWindowFromAnySelections' [-Werror=implicit-function-declaration] DeleteWindowFromAnySelections(pWin); ^ Debian bug#701372 Reported-by: Matthias Klose Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 6a49f8836a649322d38a364d9ae084be40fb2305 Author: Keith Packard Date: Sat Aug 17 12:17:36 2013 +0200 Add .dir-locals.el Enforce X.org style with an emacs configuration file Signed-off-by: Keith Packard commit f67d022523c59a27f3bf8791aa9ca6624318b1fd Merge: 5a36cdd 9680f6a Author: Keith Packard Date: Tue Aug 6 07:12:12 2013 +0200 Merge commit '9680f6a12d642c2e4bfa09bf459d678214059d74' commit 5a36cdd91530d27627e39159a89b53f9fbb75280 Author: Alan Coopersmith Date: Mon Aug 5 20:46:45 2013 -0700 Allow disabling XFree86-DGA, DRI, VidModeExtension extensions Code to recognize these in extension enable/disable options was wrapped in #ifdef XorgLoader, but that's not defined when building miinitext.c since the great module merge of 1.13. Change to an #ifdef that is defined. Signed-off-by: Alan Coopersmith Reviewed-by: Robert Hooker Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit 9680f6a12d642c2e4bfa09bf459d678214059d74 Author: Peter Hutterer Date: Tue Aug 6 13:14:56 2013 +1000 xfree86: de-duplicate some AM_CPPFLAGS Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit bbef8e46f2fed8f823ee4b97e96c3fcee28f3b75 Author: Peter Hutterer Date: Tue Aug 6 13:08:13 2013 +1000 Replace INCLUDES with AM_CPPFLAGS newer automake gets quite noisy about this. hw/xfree86/ddc/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') and many more of these. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit c218ba8423a73a7a643cb17789db8a1dd0901ca6 Author: Julien Cristau Date: Fri Aug 2 20:07:36 2013 +0200 xfree86: improve check for posix saved ids Replace hardcoded SVR4 || linux || CSRG_BASED with an autoconf check and the _POSIX_SAVED_IDS macro. Suggested-by: Mark Kettenis Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Reviewed-by: Mark Kettenis . Signed-off-by: Peter Hutterer commit 930c6ff15d437dfb0f897e8cb4253abba70819cc Author: Julien Cristau Date: Fri Aug 2 23:46:00 2013 +0200 test: include dix-config.h in hashtabletest.c Missing _XSERVER64 define caused inconsistent sizeof(XID) between the test and hashtable code, leading to test failures on 64bit big endian archs like s390x or ppc64. Signed-off-by: Julien Cristau Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit b6e5c4669e0db391966deb397e8c975ec7f0124d Author: Maarten Lankhorst Date: Tue Jul 30 15:31:24 2013 +0200 test/xi2: fix protocol-xiqueryversion test The old code was broken and allowed setting client version >= XIVersion, this was fixed in the previous patch, but updating the value for XIVersion broke the tests, so fix the tests too. Signed-off-by: Maarten Lankhorst Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 500e844a24962c9e70abb3d614f1973013b2de73 Author: Maarten Lankhorst Date: Tue Jul 30 14:45:21 2013 +0200 Xi: Clamp XIClient maximal version to XIVersion Do not allow setting client version to an arbitrary value >= XIVersion. Fixes a test error with test/xi2/protocol-xiqueryversion.c, introduced by commit 4360514d1c "Xi: Allow clients to ask for 2.3 and then 2.2 without failing" Signed-off-by: Maarten Lankhorst Reviewed-by: Keith Packard Signed-off-by: Peter Hutterer commit e1ab8f239bdc6af17ef6cd0e9c6187c4e2e2f5bc Author: Dave Airlie Date: Wed Jul 31 11:35:44 2013 +1000 xfree86/man: document AutoAddGPU This at least mentions AutoAddGPU and hints at when you might want to disable it. Signed-off-by: Dave Airlie Reviewed-by: Alex Deucher Signed-off-by: Peter Hutterer commit 836daf4c7a276108a9f950e524828744aeda0a3c Author: Dave Airlie Date: Wed Jul 31 11:24:48 2013 +1000 modesetting: change output names for secondary GPUs if we are a secondary GPU modify the output name to avoid clashes. Signed-off-by: Dave Airlie commit ff38bbe81ace85bf675bbaa0a9ca5f3b32ede449 Merge: bdd1e22 4360514 Author: Keith Packard Date: Thu Jul 25 22:50:27 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 4360514d1cc8e3132f93f56172d291074e8c770f Author: Keith Packard Date: Wed Jul 10 22:42:55 2013 -0700 Xi: Allow clients to ask for 2.3 and then 2.2 without failing This allows different sub-systems within the same application to request different Xi versions without either getting old behaviour everywhere or simply failing with a BadValue. Signed-off-by: Keith Packard Signed-off-by: Peter Hutterer commit bdd1e22cbde9ea2324e4e1991c9e152f22f88151 Author: Aaron Plattner Date: Tue Apr 30 14:14:23 2013 -0700 xfree86: detach scanout pixmaps when detaching output GPUs Commit 8f4640bdb9d3988148e09a08d2c7e3bab1d538d6 fixed a bit of a chicken-and-egg problem by detaching GPU screens when their providers are destroyed, which happens before CloseScreen is called. However, this created a new problem: the GPU screen tears down its RandR crtc objects during CloseScreen and if one of them is active, it tries to detach the scanout pixmap then. This crashes because RRCrtcDetachScanoutPixmap tries to get the master screen's screen pixmap, but crtc->pScreen->current_master is already NULL at that point. It doesn't make sense for an unbound GPU screen to still be scanning out its former master screen's pixmap, so detach them first when the provider is destroyed. Signed-off-by: Aaron Plattner Reviewed-by: Dave Airlie Signed-off-by: Keith Packard commit 3d8756631070c440cefa31b35fea3d407f187810 Author: Peter Hutterer Date: Mon Jul 22 13:43:07 2013 +1000 dix: set the valuator mask to ensure XI 1.x events have data XI 1.x only allows for first + num valuators, so if a device sends data for valuators 0 and 2+ only (i.e. valuator 1 is missing) we still need to get the data for that from somewhere. XI 1.x uses the hack of an unset valuator mask to get the right coordinates, i.e. we set the value but don't set the mask for it so XI2 events have the right mask. For an absolute device in relative mode, this broke in b28a1af55cf, the value was now always 0. This wasn't visible on the cursor, only in an XI 1.x client. The GIMP e.g. sees jumps to x/0 every few events. Drop the condition introduced in b28a1af55cf, data in valuators is always absolute, regardless of the mode. Signed-off-by: Peter Hutterer commit 4fb686d6a6777950f0e0d55b848cd2af4cbad372 Author: Peter Hutterer Date: Wed Jul 24 11:50:00 2013 +1000 dix: check the xi2mask, not the grab type for touch listeners grab->type is only non-zero for passive grabs. We're checking an active grab here, so we need to check if the touch mask is set on the grab. Test case: grab the device, then start two simultaneous touches. The grabbing client won't see the second touchpoints because grab->type is 0 and the second touch is not an emulating pointer. Signed-off-by: Peter Hutterer commit 43ac0491e36cdbb716b5c9d39c97d0aba3bebd75 Author: Jon TURNEY Date: Mon Apr 8 01:28:36 2013 +0100 hw/xwin: Fix numerous 64-bit format/type cast issues with debug printing of pointers Numerous pieces of debug output cast a pointer to an int and then use a "%08x" printf format. Use "%p" format for 64-bit portability. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit e95bb97073ca77193e4c51bd1504403fbe245533 Author: Colin Harrison Date: Tue Jun 25 21:34:43 2013 +0100 hw/xwin: Fix possible crash in winMultiWindowGetClassHint Fix a possible crash in winMultiWindowGetClassHint() when an application doesn't null terminate the WM_CLASS property class name (which is an ICCCM conformance bug in the application) (Reported for running the contiki cooja simulator in multiwindow mode, although it seems that many Java clients may have this problem, see [1]) Based on a patch by Marc Haesen. v2: Avoid using strnlen() which is missing on MinGW v3: Align with Xming patch [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6961123 Signed-off-by: Colin Harrison Reviewed-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY commit 4bc375aa2f08bd092f60d3e358d345fc9a0d3637 Author: Jon TURNEY Date: Tue Jun 18 19:21:02 2013 +0100 hw/xwin: Remove obsolete WIN_XEVENTS_SHUTDOWN Remove obsolete WIN_XEVENTS_SHUTDOWN. This event is never generated. (I think the idea was to listen for WM_DELETE_WINDOW, but that's not a very useful thing to do for a hidden window.) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 2663203cd6994166e107e796c4724a4ed3b59370 Author: Jon TURNEY Date: Tue Jun 18 18:03:05 2013 +0100 configure.ac: Check for python at configure time when building XWin with AIGLX Check for python at configure time when building XWin with AIGLX, it's used to generate the wrapper code for native GL functions. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 9fe360bf2be5c959fb21835955ef550098ccbbf0 Author: Jon TURNEY Date: Sun Jun 16 00:07:57 2013 +0100 hw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha() Avoid a null dereference of DIB_pixels if CreateDIBSection() fails in NetWMToWinIconAlpha() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 71b5f56302bbd8be62f63f0dd62cbcd33aab3ac5 Author: Jon TURNEY Date: Thu Feb 21 17:12:17 2013 +0000 hw/xwin: Handle WM_MOUSEHWHEEL Handle WM_MOUSEHWHEEL tilt wheel messages, similarly to WM_MOUSEWHEEL scroll wheel messages, to generate X button 6 and 7 presses and releases. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit cf9c777ee094d660e0c95559373fd23ee910362e Author: Jon TURNEY Date: Thu Feb 21 17:10:45 2013 +0000 hw/xwin: Map extra mouse buttons 1 and 2 to X buttons 8 and 9 Map extra mouse buttons 1 and 2 to X buttons 8 and 9, as conventional, leaving X buttons 6 and 7 for tilt wheel. Also add button labels for buttons 6, 7, 8 and 9 and change btn_labels in from a dynamic allocation to a fixed one of the required size for all the labels we use. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit c9d7b9516f4a04cb9012c6c1e9466491a468aa07 Author: Jon TURNEY Date: Tue Feb 19 14:38:40 2013 +0000 hw/xwin: Remove unneeded WM_XBUTTON message defines Remove unneeded WM_XBUTTON message defines, they have been provided by w32api for a long time now. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 5dccfc63f9c7056e7cd30884e1d3ccea86a2f419 Author: Jon TURNEY Date: Mon Dec 17 22:38:00 2012 +0000 hw/xwin: Change winTranslateKey() to return it's result as it's return value Change winTranslateKey() to return it's result as it's return value, and change it's uses as well. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 9b4cec76f1d7792d4bf64fa069ea6b64bc42da0d Author: Oliver Schmidt Date: Mon Nov 5 15:05:32 2012 +0000 hw/xwin: Consider left and right modifier keys independently on gaining focus Handle left and right ctrl and shift keys independently Assume that all modifiers are cleared when all keys are released on focus lost, as internalKeyState doesn't record which modifier key was pressed. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 235149d0b4af9097e47b3af0ba56d4eb0179518c Author: Jon TURNEY Date: Mon Apr 5 14:22:39 2010 +0100 hw/xwin: Remove an extra '\n' from some log messages Remove an extra '\n' from internal client IOError log messages Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit c7aa9f7578e721b0c9e565e7a085b6aeb30bf2ac Author: Jon TURNEY Date: Sat Feb 4 17:04:11 2012 +0000 hw/xwin: _NET_WM_STATE is ATOM[] not ATOM _NET_WM_STATE is ATOM[] not ATOM, a list of window state hints, so check all of the atoms, not just the first one See EWMH specifcation, section "Application Window Properties" v2: Actually use [] on the returned atom data Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 682ccac90b18f293520f77db5b163fcb40328e2b Author: Jon TURNEY Date: Wed Aug 31 21:35:14 2011 +0100 hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread Currently, WM_ENDSESSION just calls GiveUp() to set the DE_TERMINATE flag. But for the X server to exit cleanly, we also need the X server dispatch loop to be unblocked so it can notice that DE_TERMINATE has been set and exit, removing it's lock file and any unix domain socket. It appears that the system will terminate the process when the last UI thread in that process returns from processing WM_ENDSESSION for the last top-level window. Since WM_ENDSESSION appears to sent by the system via SendMessage() (synchronously) and the wndproc is called to process it in the message thread for that window (the X server thread), we can't easily terminate the X server dispatch loop from inside the WM_ENDSESSION message processing. So, create a messaging window, a hidden, top-level window, with a separate thread to catch this message, and process it by calling GiveUp() and then blocking on a mutex until the X server dispatch loop exits. Also, notice when this is a shutdown cancel WM_ENDSESSION message and take no action. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 15febb05d77cc7e7185c942f35459838f75cfdc0 Author: Jon TURNEY Date: Mon Sep 3 15:19:43 2012 +0100 Allow DDX to provide a main() XQuartz already conditionally renames main() as dix_main() so it can provide it's own main(). This isn't the ideal way of doing this, as it prevents libdix built this way from being useful with any other DDX. So instead, always name that function dix_main(), and also provide a stub main() which just calls dix_main(), which can be overriden in the DDX. Add a main() to XWin (XQuartz already has one, of course). It's no longer neccessary to link XWin and XQuartz with libmain. v2: Remove unneeded stub main hw/xwin/InitOutput.c Signed-off-by: Jon TURNEY Reviewed-by: Julien Cristau Reviewed-by: Colin Harrison commit d5ebe20f9ba9569351c4a41449866679fd60ba45 Merge: 21ea7eb 33f7e60 Author: Keith Packard Date: Mon Jul 22 20:34:41 2013 -0700 Merge remote-tracking branch 'alanc/master' commit 21ea7ebb6a1ad56f3060747af0df235ca6ff27fa Author: Peter Hutterer Date: Fri Jul 19 08:56:38 2013 +1000 dix: scale y back instead of x up when pre-scaling coordinates The peculiar way we handle coordinates results in relative coordinates on absolute devices being added to the last value, then that value is mapped to the screen (taking the device dimensions into account). From that mapped value we get the final coordinates, both screen and device coordinates. To avoid uneven scaling on relative coordinates, they are pre-scaled by screen ratio:resolution:device ratio factor before being mapped. This ensures that a circle drawn on the device is a circle on the screen. Previously, we used the ratio to scale x up. Synaptics already does its own scaling based on the resolution and that is done by scaling y down by the ratio. So we can remove the code from the driver and get approximately the same behaviour here. Minor ABI bump, so we can remove this from synaptics. Signed-off-by: Peter Hutterer Tested-by: Emmanuel Benisty commit 33f7e60785f12770ce10558c2ca7ce1323eefc59 Author: Thomas Klausner Date: Fri Jul 12 08:21:19 2013 +0200 Fix typo in header guard. Signed-off-by: Thomas Klausner Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit ddc52b9cbae017f04c7a232af4e8b16c9f96823d Author: Alan Coopersmith Date: Fri Jul 5 22:43:17 2013 -0700 Xephyr: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData Simplifies code and reduces risk of overflow from converting length field in X replies from words to bytes. One call to _XEatData is left in ephyrHostGLXGetStringFromServer where it's already been checked for overflow, and other values have been subtracted from it to reduce the size of data remaining to be eaten. Signed-off-by: Alan Coopersmith commit a3d43edf71847f4b486f971405d2b457f81b73d1 Author: Alan Coopersmith Date: Fri Jul 5 22:35:32 2013 -0700 glxproxy: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData Reduces risk of overflow from converting length field in X replies from words to bytes. (Also seems to be what several calls were already incorrectly passing to _XEatData.) Signed-off-by: Alan Coopersmith commit 87b0cabc145a9b5f6faffdfb544ce1c647b8ab72 Author: Alan Coopersmith Date: Fri Jul 5 22:32:10 2013 -0700 glxproxy: Use _XReadPad instead of _XEatData to clean up the slop Xlib already provides a function to eat padding bytes after the data read, so use it instead of calculating it ourselves. Signed-off-by: Alan Coopersmith commit 1cb182cbdc11fc1c97507c57875f1d2453f27328 Author: Alan Coopersmith Date: Mon Apr 15 08:41:14 2013 -0700 Xephyr: integer overflow in XF86DRIGetClientDriverName() clientDriverNameLength is a CARD32 and needs to be bounds checked before adding one to it to come up with the total size to allocate, to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Julien Cristau commit 20644e53b385c54d73242c86a7d3f981d18a3843 Author: Alan Coopersmith Date: Mon Apr 15 08:39:03 2013 -0700 Xephyr: integer overflow in XF86DRIOpenConnection() busIdStringLength is a CARD32 and needs to be bounds checked before adding one to it to come up with the total size to allocate, to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Julien Cristau commit c37ceda76bf9ec6f5166122e864663e10f106546 Author: Alan Coopersmith Date: Sun Apr 14 10:50:50 2013 -0700 Xephyr: integer overflow in ephyrHostGLXGetStringFromServer() reply.length & reply.size are CARD32s and need to be bounds checked before multiplying or adding to come up with the total size to allocate, to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith commit 5fbd8c45b46ab93522e417240aa770466c30b735 Author: Alan Coopersmith Date: Sun Apr 14 09:45:26 2013 -0700 Xdmx: integer overflow in GetGLXFBConfigs() numFBConfigs & numAttribs are CARD32s and need to be bounds checked before multiplying by structure sizes to come up with the total size to allocate, to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith commit c89bcd12f4fc7233830a8dbe7863c312f657da3c Author: Alan Coopersmith Date: Sun Apr 14 09:33:57 2013 -0700 Xdmx: integer overflow in GetGLXVisualConfigs() numVisuals & numProps are both CARD32 and need to be bounds checked before multiplying by structure sizes to come up with the total size to allocate, to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith commit 74469895e39fa38337f59edd64c4031ab9bb51d8 Author: Peter Hutterer Date: Mon Jul 15 13:06:28 2013 +1000 dix: allow a ConstantDeceleration between 0 and 1 (#66134) A constant deceleration of x simply means (delta * 1/x). We limited that to values >= 1.0f for obvious reasons, but can also allow values from 0-1. That means that ConstantDeceleration is actually a ConstantAcceleration, but hey, if someone needs it... X.Org Bug 66134 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 0e3be0b25fcfeff386bad132526352c2e45f1932 Author: Peter Hutterer Date: Fri Jul 12 14:10:10 2013 +1000 dix: UpdateTouchesForGrab must only free the listener grab if it is non-NULL If a client calls XIGrabDevice in response to a ButtonPress event (regular event selection), the device will have a grab, but listener->grab is NULL. Check for that, to avoid logspam. [ 26293.863] (EE) BUG: triggered 'if (!pGrab)' [ 26293.863] (EE) BUG: grabs.c:256 in FreeGrab() [ 26293.863] (EE) [ 26293.863] (EE) Backtrace: [ 26293.864] (EE) 0: /usr/bin/Xorg (FreeGrab+0x54) [0x45d3fc] [ 26293.864] (EE) 1: /usr/bin/Xorg (UpdateTouchesForGrab+0x135) [0x447d4e] [ 26293.864] (EE) 2: /usr/bin/Xorg (ActivatePointerGrab+0x1ba) [0x447f3d] [ 26293.864] (EE) 3: /usr/bin/Xorg (GrabDevice+0x3e6) [0x4503bc] [ 26293.864] (EE) 4: /usr/bin/Xorg (ProcXIGrabDevice+0x1f9) [0x5981b1] [ 26293.865] (EE) 5: /usr/bin/Xorg (ProcIDispatch+0x78) [0x58aa17] [ 26293.865] (EE) 6: /usr/bin/Xorg (Dispatch+0x30d) [0x43347e] [ 26293.865] (EE) 7: /usr/bin/Xorg (main+0x61d) [0x498175] [ 26293.865] (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x3df5621b75] [ 26293.865] (EE) 9: /usr/bin/Xorg (_start+0x29) [0x423a19] [ 26293.866] (EE) 10: ? (?+0x29) [0x29] [ 26293.866] (EE) Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 24cbb47ca80cd7a47749ece0ff3a98657ddf3ae3 Author: Peter Hutterer Date: Fri Jul 12 12:17:47 2013 +1000 config: provide example configuration for multi-seat setups Seats other than seat0 need custom configuration. Provide that with a default configuration file so we can share it across distros. This file intentionally does not end in .conf so it won't get picked up by the server after a normal installation. gdm, or whatever starts up the servers will have to explicitly specifiy this config file. This file replaces the one currently written by systemd's multi-seat-x binary: http://cgit.freedesktop.org/systemd/systemd/tree/src/login/multi-seat-x.c CC: Lennart Poettering Signed-off-by: Peter Hutterer Reviewed-by: Dan Nicholson commit 791121e00692e12cb4c38c8d018bd72eb5081eb7 Author: François Tigeot Date: Mon Jul 15 21:54:26 2013 +0200 Fix mouse header include on DragonFly and FreeBSD * __FreeBSD_kernel_version doesn't exist anymore * The removed check was for FreeBSD versions from before September 2000 which are no longer supported anyway * Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66045 Signed-off-by: François Tigeot Signed-off-by: Peter Hutterer commit 59a6d3f1eb03010ab831b32b03706a1d6143c732 Author: Jon TURNEY Date: Thu Nov 8 13:41:13 2012 +0000 os: Remove any old logfile before trying to write to it If we are not backing up logfiles, remove the old logfile before trying to write a new logfile, as otherwise the operation may fail if the previous logfile was created by a different user. This change is useful when: - The DDX doesn't use the logfile backup mechanism (i.e. not Xorg) - The DDX is run by a non-root user, and then by a different non-root user - The logfile directory doesn't have the restricted-deletion flag set Signed-off-by: Jon TURNEY Acked-by: Yaakov Selkowitz Reviewed-by: Yaakov Selkowitz Signed-off-by: Peter Hutterer commit 8eeaa74bc241acb41f1d3ed64971e0b01e794776 Author: Peter Hutterer Date: Tue Jul 9 13:27:19 2013 +1000 dix: when ungrabbing an active grab, accept pointer grabs (#66720) Ungrabbing a device during an active touch grab rejects the grab. Ungrabbing a device during an active pointer grab accepts the grab. Rejection is not really an option for a pointer-emulated grab, if a client has a button mask on the window it would get a ButtonPress emulated after UngrabDevice. That is against the core grab behaviour. X.Org Bug 66720 Signed-off-by: Peter Hutterer Reviewed-by: Jasper St. Pierre commit a2d6932ad48f2cbfcc4c5fb8272e47106d08ac78 Author: Julien Cristau Date: Mon Jul 1 19:39:30 2013 +0200 xkb: don't call atoi(NULL) when parsing argv If the -ardelay or -arinterval options have no argument, there's no point trying to read it. See http://www.forallsecure.com/bug-reports/feb3db57fc206d8df22ca53a6907f74973876272/ Reported-by: Alexandre Rebert Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Peter Hutterer commit 77e51d5bbb97eb5c9d9dbff9a7c44d7e53620e68 Author: Eric Anholt Date: Mon Jun 17 15:51:19 2013 -0700 Revert "DRI2: re-allocate DRI2 drawable if pixmap serial changes" This reverts commit 3209b094a3b1466b579e8020e12a4f3fa78a5f3f. After a long debug session by Paul Berry, it appears that this was the commit that has been producing sporadic failures in piglit front buffer rendering tests for the last several years. GetBuffers may return fresh buffers with invalid contents at a couple reasonable times: - When first asked for a non-fake-front buffer. - When the drawable size is changed, an Invalidate has been sent, and obviously the app needs to redraw the whole buffer. - After a glXSwapBuffers(), GL allows the backbuffer to be undefined, and an Invalidate was sent to tell the GL that it should grab these appropriate new buffers to avoid stalling. But with the patch being reverted, GetBuffers would also return fresh invalid buffers when the drawable serial number changed, which is approximately "whenever, for any reason". The app is not expecting invalid buffer contents "whenever", nor is it valid. Because the GL usually only GetBuffers after an Invalidate is sent, and the new buffer allocation only happened during a GetBuffers, most apps saw no problems. But apps that do (fake-)frontbuffer rendering do frequently ask the server for the front buffer (since we drop the fake front allocation when we're not doing front buffer rendering), and if the drawable serial got bumped midway through a draw, the server would pointlessly ditch the front *and* backbuffer full of important drawing, resulting in bad rendering. The patch was originally to fix bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28365 Specifically: To reproduce, start with a large-ish display (i.e. 1680x1050 on my laptop), use the patched glxgears from bug 28252 to add the -override option. Then run glxgears -override -geometry 640x480 to create a 640x480 window in the top left corner, which will work fine. Next, run xrandr -s 640x480 and watch the fireworks. I've tested with an override-redirect glxgears, both with vblank sync enabled and disabled, both with gnome-shell and no window manager at all, before and after this patch. The only problem observed was that before and after the revert, sometimes when alt-tabbing to kill my gears after completing the test gnome-shell would get confused about override-redirectness of the glxgears window (according to a log message) and apparently not bother doing any further compositing. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Chris Wilson Tested-by: Chris Wilson Signed-off-by: Keith Packard commit 227015d6544115258b74c31b700f9bd163540e24 Merge: d9005d5 80054fc Author: Keith Packard Date: Tue Jun 18 10:53:08 2013 -0700 Merge remote-tracking branch 'jturney/master' commit 951d2f83fc65a136717fb8090510d053e3f3a6c0 Author: Maarten Lankhorst Date: Wed Jun 12 14:11:53 2013 +0200 bump to 0.8.0 Signed-off-by: Maarten Lankhorst commit 525ac7fb9a0d639253fc5d6556db3edb7239f932 Author: Maarten Lankhorst Date: Wed Jun 12 14:05:19 2013 +0200 modesetting: probe only succeeds if connectors are detected This will prevent modesetting being used for outputless intel or nvidia cards. Signed-off-by: Maarten Lankhorst commit d4791dd97b85ddac1295761bf6ab4f10c08346d7 Author: Dave Airlie Date: Tue Jun 11 10:29:25 2013 +1000 modesetting: fix adjust frame crash When SDL called this it was totally broken, actually hook up to the underlying drmmode function. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64808 Thanks to Peter Wu for harassing me. Signed-off-by: Dave Airlie commit 80054fcafb095aff76f6df00d348c7fd85e8ddbc Author: Jon TURNEY Date: Sat Mar 30 19:44:14 2013 +0000 hw/xwin: Update manifest to target all architectures, not just x86 Update manifest to target all architectures, not just x86 Also: Write explicit dependencies for Xwin.rc. XWin.exe.manifest and X.ico are included the resource compiler output, so add a dependency on them to cause it to be recompiled if they change. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 689e7ad9b0fccd582cd63796cc90a999f141f589 Author: Jon TURNEY Date: Sun Mar 31 18:36:37 2013 +0100 hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type Win32 Windows properties are of pointer type HANDLE, not an integer type, but we use the Windows property WINDOW_WID_PROP to store the X window XID. Add appropriate casts to show it doesn't matter that an XID is smaller than a pointer on 64-bit build. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit e1a0945e8d4a3858838a14e64022524efd73c905 Author: Jon TURNEY Date: Sun Mar 31 18:35:35 2013 +0100 hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr winMultiWindowGetTransientFor() accesses the WM_TRANSIENT_FOR property, which is an X window XID (which we compare with WINDOW_WID_PROP) and not a WindowPtr. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit be201ac257687355bf0916d7c525d598ed9b1282 Author: Jon TURNEY Date: Sat Mar 30 19:47:16 2013 +0000 hw/xwin: Change winIconIsOverride() to take a HICON parameter Change winIconIsOverride() to take a HICON parameter, so some unneccessary casts, which weren't portable to 64-bit Cygwin, can be removed. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit fc40f9a92cf5981bccc45bbc0b959cc06c5accc2 Author: Jon TURNEY Date: Sat Mar 30 19:41:06 2013 +0000 hw/xwin: Fix uses of CreateDialogParam() for 64-bit builds Fix uses of CreateDialogParam() to be more strictly correct, for 64-bit builds dwInitParam parameter is LPARAM, not int Return type of DLGPROC is INT_PTR, not WINBOOL Also: Reporting the value of g_hDlgDepthChange is completely uninteresting, we are just interested in GetLastError() if it is NULL Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b542976846eb5d4c82910272af32ec8298da4177 Author: Jon TURNEY Date: Sat Mar 30 19:40:31 2013 +0000 hw/xwin: deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit cygwin The deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit cygwin, but both the ID_ABOUT_CHANGELOG control and the referenced file who's path we are converting haven't existed for a while, so just remove this unused, cygwin-specific code. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 5a47c6420cfe298143310938f08cc36a503e8d3d Author: Jon TURNEY Date: Mon Apr 8 01:27:26 2013 +0100 hw/xwin: Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer: Since HINSTANCE is a pointer type, use INT_PTR rather than int. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit d9005d58c0413dcc3a99150c13d05163881cf782 Author: Peter Hutterer Date: Tue Jun 4 14:39:33 2013 +1000 config: add a quirks file for devices needing special configuration This is the fedora quirks file configuring the special handling some devices need. Rather than keeping this distro-specific add it to the tree so we can share these quirks. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp commit 04ce6f6f6c880281e42c9ebf21d6f980ddae79b4 Author: Maarten Lankhorst Date: Thu May 30 11:23:07 2013 +0200 dix: add missing dixFreeRegistry define Fixes a build failure on debian's udeb builds. Signed-off-by: Maarten Lankhorst Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit c21344add2fc589df83b29be5831c36a372201bd Author: Peter Hutterer Date: Mon May 27 13:46:49 2013 +1000 dix: remove logspam in RefCursor() This shouldn't have been in the patch Reported-by: Colin Harrison Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit cb3018d8a15add48efb3335e1f79b66378166008 Merge: c76a1b3 6589f3b Author: Keith Packard Date: Thu May 23 19:58:46 2013 -0600 Merge remote-tracking branch 'whot/unreviewed' commit c76a1b343d6a56aa9529e87f0eda8d61355d562b Merge: 891123c 9a5ad65 Author: Keith Packard Date: Thu May 23 19:58:36 2013 -0600 Merge remote-tracking branch 'whot/touch-grab-race-condition-56578-v3' commit 891123ce9dac5e52685b9a921b33d8279ba52956 Merge: 7e97166 49521ed Author: Keith Packard Date: Thu May 23 10:30:15 2013 -0600 Merge remote-tracking branch 'whot/for-keith' commit 6589f3b55e335eef6c658c8ba1fe15a062f7e31c Author: Peter Hutterer Date: Tue May 14 08:31:19 2013 +1000 dix: devices must have valuators before touch is initialized Signed-off-by: Peter Hutterer commit 756ab88d93542f0589c9bf46f40ccc57df64f0fd Author: Peter Hutterer Date: Fri Apr 26 15:10:08 2013 +1000 dix: fix device scaling to use a [min,max[ range. defmin/defmax are screen coords and thus use a min-inclusive, max-exclusive range. device axes ranges are inclusive, so bump the max up by one to get the scaling right. This fixes off-by-one coordinate errors if the coordinate matrix is used to bind the device to a fraction of the screen. It introduces an off-by-one scaling error in the device coordinate range, but since most devices have a higher resolution than the screen (e.g. a Wacom I4 has 5080 dpi) the effect of this should be limited. This error manifests when we have numScreens > 1, as the scaling from desktop size back to screen size drops one device unit. Signed-off-by: Peter Hutterer commit 5cc2c96f824dbb28b9f8da61efc41596f8bd0561 Author: Peter Hutterer Date: Sat Mar 9 20:43:51 2013 +1000 dix: pre-scale x by the screen:device:resolution ratio commit 61a99aff9d33728a0b67920254d2d4d79f80cf39 dix: pre-scale relative events from abs devices to desktop ratio (#31636) added pre-scaling of relative coordinates coming from absolute devices to undo uneven scaling based on the screen dimensions. Devices have their own device width/height ratio as well (in a specific resolution) and this must be applied for relative devices as well to avoid scaling of the relative events into the device's ratio. e.g. a Wacom Intuos4 6x9 is in 16:10 format with equal horiz/vert resolution (dpi). A movement by 1000/1000 coordinates is a perfect diagonal on the tablet and must be reflected as such on the screen. However, we map the relative device-coordinate events to absolute screen coordinates based on the axis ranges. This results in an effective scaling of 1000/(1000 * 1.6) and thus an uneven x/y axis movement - the y axis is always faster. So we need to pre-scale not only by the desktop dimenstions but also by the device width/height ratio _and_ the resolution ratio. Signed-off-by: Peter Hutterer commit 9a5ad65330693b3273972b63d10f2907d9ab954a Author: Peter Hutterer Date: Wed May 15 19:01:11 2013 +1000 Abstract cursor refcounting Too many callers relied on the refcnt being handled correctly. Use a simple wrapper to handle that case. Signed-off-by: Peter Hutterer commit 35c2e263db01b2b61354298e5e85aa3cae8ac317 Author: Peter Hutterer Date: Tue May 14 14:51:31 2013 +1000 dix: call UpdateDeviceState() for emulated TouchEndEvents ProcessTouchEvents() calls UDS for all touch events, but if the event type was switched to TouchUpdate(pending end) UDS is a noop. Daniel Drake found this can cause stuck buttons if a touch grab is activated, rejected and the touch event is passed to a regular listener. This sequence causes the TouchEnd to be changed to TouchUpdate(pending end). The actual TouchEnd event is later generated by the server once it is passed to the next listener. UDS is never called for this event, thus the button remains logically down. A previous patch suggested for UDS to handle TouchUpdate events [1], however this would release the button when the first TouchEvent is processed, not when the last grab has been released (as is the case for sync pointer grabs). A client may thus have the grab on the device, receive a ButtonPress but see the button logically up in an XQueryPointer request. This patch adds a call to UDS to TouchEmitTouchEnd(). The device state must be updated once a TouchEnd event was sent to the last grabbing listener and the number of grabs on the touchpoint is 0. [1] http://patchwork.freedesktop.org/patch/13464/ Signed-off-by: Peter Hutterer commit 8b9dc2628115dcb3f3601ad19b1ae157df21b9ee Author: Peter Hutterer Date: Tue May 14 07:46:25 2013 +1000 dix: devices must have valuators before touch is initialized Signed-off-by: Peter Hutterer commit fd5ea0237db6d725a48f76b706135df9d3246b82 Author: Peter Hutterer Date: Mon May 13 15:22:12 2013 +1000 Xi: fix warning - remove unused 'rc' Signed-off-by: Peter Hutterer commit 481702101b86fff003430e952dc65fb41eb56400 Author: Peter Hutterer Date: Fri May 3 15:07:58 2013 +1000 dix: fix cursor refcounting The cursor is referenced during CopyGrab(), thus doesn't need to be handled manually anymore. It does need to be refcounted for temp grabs though. The oldGrab handling in ProcGrabPointer is a leftover from the cursor in the grab being refcounted, but the grab itself being a static struct in the DeviceIntRec. Now that all grabs are copied, this lead to a double-free of the cursor (Reproduced in Thunderbird, dragging an email twice (or more often) causes a crash). Signed-off-by: Peter Hutterer commit 49521edaf8930b335afac2185209e26e7000820b Author: Peter Hutterer Date: Wed May 15 08:51:51 2013 +1000 ephyr: add -resizeable to the man page Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit 7a4bbfd9f2ce7aad23148ba01bb3f1071da606a3 Author: Peter Hutterer Date: Wed May 15 08:46:38 2013 +1000 ephyr: fix typo in man page Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit 7e97166c4fc38076b6224e4dbdd632b43444149f Author: Geert Uytterhoeven Date: Tue May 14 13:04:53 2013 +0200 Shadow: Switch the Amiga/Atari bitplane code to the canonical X.Org license Also add my name to the list of authors in COPYING Reviewed-by: Alan Coopersmith Signed-off-by: Geert Uytterhoeven Signed-off-by: Keith Packard commit 3093f78d17e48a506aab170a9089cd10e21af299 Author: Peter Hutterer Date: Fri May 3 15:02:05 2013 +1000 dix: free the old grab when activating a new grab A client may call XIGrabDevice twice, overwriting the existing grab. Thus, make sure we free the old copy after we copied it. Free it last, to make sure our refcounts don't run to 0 and inadvertantly free something on the way. Signed-off-by: Peter Hutterer commit 2566bdd8bc996cccde77b846819808c6239a89d2 Author: Peter Hutterer Date: Wed Apr 24 14:46:06 2013 +1000 Xi: check for HAS_ACCEPTED only for grab listeners If we have one listener left but it's not a grab, it cannot be in LISTENER_HAS_ACCEPTED state. Signed-off-by: Peter Hutterer commit 5b00fc52270e9cfdfe7ac1838a21defe50fc3d31 Author: Peter Hutterer Date: Wed Apr 24 14:40:31 2013 +1000 Move TouchListenerGone call to CloseDownClient TouchListenerGone cleans up if a client disappears. Having this in FreeGrab() triggers cyclic removal of grabs, emitting wrong events. In particular, it would clean up a passive grab record while that grab is active. Move it to CloseDownClient() instead, cleaning up before we go. Signed-off-by: Peter Hutterer commit 34c9b39d9937c2e19c2dffc9748605f90d40f965 Author: Peter Hutterer Date: Wed Apr 24 12:53:52 2013 +1000 dix: remove all listeners when freeing a touch Signed-off-by: Peter Hutterer commit 395124bd2782823de37e5c5b2f15dba49cff05f6 Author: Peter Hutterer Date: Wed Apr 17 20:15:35 2013 +1000 dix: always copy grabs, don't reference them Introduced in xorg-server-1.13.99.901-2-g9ad0fdb. Storing the grab pointer in the listener turns out to be a bad idea. If the grab is not an active grab or an implicit grab, the pointer stored is the one to the grab attached on the window. This grab may be removed if the client calls UngrabButton or similar while the touch is still active, leaving a dangling pointer. To avoid this, copy the grab wherever we need to reference it later. This is also what we do for pointer/keyboard grabs, where we copy the grab as soon as it becomes active. Reported-by: Maarten Lankhorst Signed-off-by: Peter Hutterer commit 925e35122ebad877395bcf13676e9dbeb254bdfa Author: Peter Hutterer Date: Tue Apr 23 15:52:18 2013 +1000 dix: AllocGrab can copy if an argument is passed in Signed-off-by: Peter Hutterer commit 4980bcef9973ba1f90f53028f061669ee5d2661b Author: Peter Hutterer Date: Tue Apr 23 15:46:04 2013 +1000 dix: freeing a null grab is a bug, complain if doing so Signed-off-by: Peter Hutterer commit ccfa0f2d5de557546815a5e4f59552e2af46b578 Author: Peter Hutterer Date: Tue Apr 23 15:39:32 2013 +1000 dix: use a temporary variable for listeners[0] no functional changes Signed-off-by: Peter Hutterer commit 5363433a5cc64e2f83859aa1c32a89e5e1ddf9e4 Author: Peter Hutterer Date: Thu Apr 18 10:32:11 2013 +1000 dix: drop DeviceIntRec's activeGrab struct Obsolete since 4bc2761ad5ec2d0668aec639780ffb136605fbc8. This struct existed so copying a passive grab could be simply done by activeGrab = *grab and thus have a copy of the GrabPtr we'd get from various sources but still be able to check device->grab for NULL. Since 4bc2761 activeGrab is a pointer itself and points to the same memory as grabinfo->grab, leaving us with the potential of dangling pointers if either calls FreeGrab() and doesn't reset the other one. There is no reader of activeGrab anyway, so simply removing it is sufficient. Note: field is merely renamed to keep the ABI. Should be removed in the future. Signed-off-by: Peter Hutterer commit 7dbf61817d3bd4b1fc71710677e56c5d8cfcdb4e Author: Peter Hutterer Date: Wed Apr 17 20:14:56 2013 +1000 dix: use a tmp variable for the to-be-removed touch listener No functional changes. Signed-off-by: Peter Hutterer commit a71a283934406d870bcd8dc376eb1c9ce1c8bbb4 Author: Peter Hutterer Date: Wed Apr 17 20:13:34 2013 +1000 dix: invert a loop condition Change the single if condition in the loop body to a if (!foo) continue; and re-indent the rest. No functional changes. Signed-off-by: Peter Hutterer commit 5174b1f98204beee79eba74c4cda5f2be0a60a8f Author: Peter Hutterer Date: Thu Feb 28 11:02:40 2013 +1000 dix: XAllowEvents() on a touch event means accepting it A sync grab is the owner once it gets events. If it doesn't replay the event it will get all events from this touch, equivalent to accepting it. If the touch has ended before XAllowEvents() is called, we also now need to send the TouchEnd event and clean-up since we won't see anything more from this touch. Signed-off-by: Peter Hutterer commit e7f79c48b0faea910dc881034c00eb807fcd6210 Author: Peter Hutterer Date: Fri Mar 1 12:52:35 2013 +1000 dix: move EmitTouchEnd to touch.c No functional changes, this just enables it to be re-used easier. Signed-off-by: Peter Hutterer commit 0eb9390f6048049136347d5a5834d88bfc67cc09 Author: Peter Hutterer Date: Fri Mar 1 10:41:01 2013 +1000 Xi: Don't emit a TouchEnd event to a frozen device EmitTouchEnd calls DeliverTouchEvents directly instead of through public.processInputProc. If a device is frozen, the TouchEnd is processed while the device is waiting for a XAllowEvents and thus ends the touch point (and the grab) before the client decided what to do with it. In the case of ReplayPointer, this loses the event. This is a hack, but making EmitTouchEnd use processInputProc breaks approximately everything, especially the touch point is cleaned up during ProcessTouchEvents. Working around that is a bigger hack than this. Signed-off-by: Peter Hutterer commit a7d989d335f903ffd8b168cd2beeb82c78d30c21 Author: Peter Hutterer Date: Thu Feb 28 13:07:26 2013 +1000 Xi: use public.processInputProc to replay the touch history If a device is frozen in results to a grab, we need to enqueue the events. This makes things complicated, and hard to follow since touch events are now replayed in the history, pushed into EnqueueEvent, then replayed later during PlayReleasedEvents in response to an XAllowEvents. While the device is frozen, no touch events are processed, so if there is a touch client with ownership mask _below_ the grab this will delay the delivery and potentially screw gesture recognition. However, this is the behaviour we have already anyway if the top-most client is a sync pgrab or there is a sync grab active on the device when the TouchBegin was generated. (also note, such a client would only reliably work in case of ReplayPointer anyway) Signed-off-by: Peter Hutterer commit 214d11d3fcdac51fc7afbf3770516ec14f9e13c1 Author: Peter Hutterer Date: Wed Feb 27 15:05:54 2013 +1000 Xi: when punting to a new owner, always create TouchEnd events If a touch is pending_finish and we just punted it to the next owner, that client must receive a TouchEnd event. If we just punted to the last owner and that owner not a touch grab, we need to end the touch since this is the last event to be sent, and the client cannot accept/reject this. Signed-off-by: Peter Hutterer commit 026627fe19aad007544eccf209f0dea05e67a7a7 Author: Peter Hutterer Date: Fri Mar 1 09:15:37 2013 +1000 Xi: save state for early acceptance Delivering an event changes the state to LISTENER_IS_OWNER and we thus lose the information of early acceptance. Signed-off-by: Peter Hutterer commit d905348134c80f19793eefb761731b00559ddf3a Author: Peter Hutterer Date: Thu Feb 28 15:28:46 2013 +1000 Xi: if a passive async grab is activated from an emulated touch, accept Async grabs cannot replay events, they cannot reject, so we can do an early accept here. Signed-off-by: Peter Hutterer commit 8b0d21044956f3810199d5e2f38ce33069e97be7 Author: Peter Hutterer Date: Thu Feb 28 13:04:36 2013 +1000 Xi: fix lookup in ActivateEarlyAccept ActivateEarlyAccept() can only be called from a grabbing client, so we can ignore the rest. And it's easy enough to get the client from that since 9ad0fdb135a1c336771aee1f6eab75a6ad874aff. Signed-off-by: Peter Hutterer commit d08bae297f9d7651edb1923d6b0d6b14b3d674fc Author: Peter Hutterer Date: Thu Feb 28 13:08:27 2013 +1000 Xi: update the core listener state if we delivered the touch event If a TouchBegin is sent to a core client, that client is now the owner. By the time the TouchEnd is being processed, the client cannot replay anymore, so we can assume that this is the final touch end and we can clean up the touch record. Note: DeliverTouchEmulatedEvent is called for all listeners and immediately bails out if the client is not the owner and thus shouldn't yet get the event. Thus, check the return code. Signed-off-by: Peter Hutterer commit 81554d274f04951c55ea7f2e38d0455e2025e08d Author: Peter Hutterer Date: Mon Feb 25 11:21:07 2013 +1000 Xi: if we delivered a TouchEnd to a passive grab, end it ef64b5ee97099618cf2e2cbbd3e471095695ae24 (which introduced the TOUCH_CLIENT_ID check) has a wrong assumption that generated touch events (TOUCH_CLIENT_ID) should not terminate passive grabs. This is untrue, a TouchEnd may be generated in response to a TouchReject higher up. If we _deliver_ an event to a client, terminate the passive grab. This requires us to count the actually delivered events too (first hunk). Signed-off-by: Peter Hutterer commit 363b6387da6e669099a2da3861c73a29808295a6 Author: Peter Hutterer Date: Wed Feb 13 11:26:11 2013 +1000 dix: don't prepend an activated passive grab to the listeners If the device is currently grabbed as the result of a passive grab activating, do not prepend that grab to the listeners (unlike active grabs). Otherwise, a client with a passive pointer grab will prevent touch grabs from activating higher up in the window stack. Signed-off-by: Peter Hutterer commit 9cc45c18ad1511adf3fb163dd4cefbef106edb23 Author: Peter Hutterer Date: Wed Feb 13 10:49:23 2013 +1000 Xi: not having an ownership mask does not mean automatic acceptance If we only have a single touch-grabbing client, setting the client as owner would clean up the touch once the TouchEnd was processed. If the client then calls XIAllowTouches() it will receive a BadValue for the touch ID (since the internal record is already cleaned up). Signed-off-by: Peter Hutterer commit 2f1aedcaed8fd99b823d451bf1fb02330c078f67 Author: Peter Hutterer Date: Thu May 9 14:30:50 2013 +1000 input: print warnings if drivers don't initialize properly If drivers supply incorrect values don't just quietly return False, spew to the log so we can detect what's going on. All these cases are driver bugs and should be fixed immediately. Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie commit 8a88b0ab52ba375ae84463a90503db88af10e368 Author: Peter Hutterer Date: Thu May 9 14:30:49 2013 +1000 dix: don't overwrite proximity/focus classes InitPointerClassDeviceStruct/InitKeyboardDeviceStruct allocate a proximity/focus class, respectively. If a driver calls InitFocusClassDeviceStruct or InitProximityClassDeviceStruct beforehand, the previously allocated class is overwritten, leaking the memory. Neither takes a parameter other than the device, so we can simply skip initialising it if we already have one. Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie commit 34b0d07ebf4a7874fe7fd336bef5bbdd8debda1c Author: Peter Hutterer Date: Fri May 10 09:44:29 2013 +1000 dix: reset the OsBuffers after killing all clients ==21860== 24 bytes in 1 blocks are still reachable in loss record 85 of 397 ==21860== at 0x4C2B3F8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==21860== by 0x61ED93: AllocateOutputBuffer (io.c:1037) ==21860== by 0x61E15A: WriteToClient (io.c:764) ==21860== by 0x457B30: ProcQueryExtension (extension.c:275) ==21860== by 0x43596B: Dispatch (dispatch.c:432) ==21860== by 0x425DAB: main (main.c:295) Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie commit 67c66606c760c263d7a4c2d1bba43ed6225a4e7c Author: Robert Morell Date: Thu May 9 13:09:02 2013 -0700 os: Reset input buffer's 'ignoreBytes' field If a client sends a request larger than maxBigRequestSize, the server is supposed to ignore it. Before commit cf88363d, the server would simply disconnect the client. After that commit, it attempts to gracefully ignore the request by remembering how long the client specified the request to be, and ignoring that many bytes. However, if a client sends a BigReq header with a large size and disconnects before actually sending the rest of the specified request, the server will reuse the ConnectionInput buffer without resetting the ignoreBytes field. This makes the server ignore new X clients' requests. This fixes that behavior by resetting the ignoreBytes field when putting the ConnectionInput buffer back on the FreeInputs list. Signed-off-by: Robert Morell Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit ddc11397a56c745b5d1fb377e9d9b1fcc73802c8 Author: Peter Hutterer Date: Mon Feb 27 18:36:39 2012 +1000 dix: delete all callbacks before reset DeleteCallbackManager() introduced for better symmetry in the caller, they do the same thing. ==20085== 24 bytes in 1 blocks are still reachable in loss record 11 of 103 ==20085== at 0x4C2A4CD: malloc (vg_replace_malloc.c:236) ==20085== by 0x43A097: CreateCallbackList (dixutils.c:837) ==20085== by 0x43A1D3: AddCallback (dixutils.c:869) ==20085== by 0x4B1736: GEExtensionInit (geext.c:209) ==20085== by 0x41C8A8: InitExtensions (miinitext.c:389) ==20085== by 0x5AC918: main (main.c:208) ==2042== 8 bytes in 1 blocks are still reachable in loss record 2 of 97 ==2042== at 0x4C2A4CD: malloc (vg_replace_malloc.c:236) ==2042== by 0x4C2A657: realloc (vg_replace_malloc.c:525) ==2042== by 0x4802F5: XNFrealloc (utils.c:1095) ==2042== by 0x43A17A: CreateCallbackList (dixutils.c:855) ==2042== by 0x43A1EF: AddCallback (dixutils.c:870) ==2042== by 0x4B1752: GEExtensionInit (geext.c:209) ==2042== by 0x41C8A8: InitExtensions (miinitext.c:389) ==2042== by 0x5AC9E4: main (main.c:208) ==2042== Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 6993f8b459e25b1a7a0a03e209688a28ce6c2c56 Author: Peter Hutterer Date: Wed Apr 24 14:59:11 2013 +1000 Xi: free barrier code at reset time ==29423== 16 bytes in 1 blocks are definitely lost in loss record 73 of 328 ==29423== at 0x4A06B6F: calloc (vg_replace_malloc.c:593) ==29423== by 0x5987C0: XIBarrierInit (xibarriers.c:908) ==29423== by 0x58F370: XInputExtensionInit (extinit.c:1300) ==29423== by 0x4F33C3: InitExtensions (miinitext.c:337) ==29423== by 0x4997DB: main (main.c:208) Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 042c6d861f7bb7038ddcdd6b59766fd9094d0e52 Author: Peter Hutterer Date: Tue Apr 30 15:44:37 2013 +1000 os: Use ErrorFSigSafe from FatalError and it's friends Backtrace logging etc. is already sigsafe, but the actual FatalError message in response is not yet, leading to amusing logs like this: (EE) Segmentation fault at address 0x0 (EE) BUG: triggered 'if (inSignalContext)' (EE) BUG: log.c:499 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: Fatal server error: Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit d9848fb4b182ca21bacf28ed7410d1a502cb000e Author: Peter Hutterer Date: Thu Feb 14 16:24:53 2013 +1000 os: complain about unsupported pnprintf directives Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit d903d17d7f006fa333265b8476063b189c20d082 Author: Peter Hutterer Date: Thu Feb 14 16:19:34 2013 +1000 os: support %c in pnprintf Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 58ef34ee6d0f68aa28f6f1a26e56f49ec85ed9bf Author: Peter Hutterer Date: Thu Feb 14 16:13:22 2013 +1000 os: support %% in pnprintf Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 5ea21560dd071ea4ab87430000d087fd5fe1f092 Author: Peter Hutterer Date: Thu Feb 14 15:34:32 2013 +1000 os: support pnprintf length modifiers for integers Mainly for %ld, smaller than int is propagated anyway, and %lld isn't really used. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit d3d4af5f9e505d444b6c82c6ea238206433fd24b Author: Peter Hutterer Date: Mon Feb 27 18:59:45 2012 +1000 dix: reset the registry before quitting Heaps of these: ==2042== 15,360 bytes in 120 blocks are still reachable in loss record 94 of 97 ==2042== at 0x4C2A4CD: malloc (vg_replace_malloc.c:236) ==2042== by 0x4C2A657: realloc (vg_replace_malloc.c:525) ==2042== by 0x45FB91: double_size (registry.c:65) ==2042== by 0x45FC97: RegisterRequestName (registry.c:85) ==2042== by 0x460095: RegisterExtensionNames (registry.c:179) ==2042== by 0x460729: dixResetRegistry (registry.c:334) ==2042== by 0x5AC992: main (main.c:201) Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 6f44d672aa34d343f63f0ea81ad58154a66b57ec Author: Peter Hutterer Date: Mon Feb 27 17:17:41 2012 +1000 xkb: free XkbRulesUsed and XkbRulesDflt on extension cleanup ==2547== 1 bytes in 1 blocks are still reachable in loss record 1 of 111 ==2547== at 0x4C2A4CD: malloc (vg_replace_malloc.c:236) ==2547== by 0x64D1551: strdup (strdup.c:43) ==2547== by 0x4802FB: Xstrdup (utils.c:1113) ==2547== by 0x585B6C: XkbSetRulesUsed (xkbInit.c:219) ==2547== by 0x58700F: InitKeyboardDeviceStruct (xkbInit.c:595) ==2547== by 0x419FA3: vfbKeybdProc (InitInput.c:74) ==2547== by 0x425A3D: ActivateDevice (devices.c:540) ==2547== by 0x425F65: InitAndStartDevices (devices.c:713) ==2547== by 0x5ACA57: main (main.c:259) and a few more of the above. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 623981ddaeb8836f3b0939e527c0e943f9c4e974 Author: Peter Hutterer Date: Fri Feb 1 09:06:20 2013 +1000 If neither HAL nor udev backends are enabled, warn the user If both are missing, input device hotplugging will not work out of the box. While we still have a DBus-API or the user may want to set AAD off all the time, the most likely source of this is misconfiguration (i.e. lack of the udev/hal devel packages). Message printed last to make it more obvious to the user. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit dce40e2266200421647044ec7e856656d2ef952d Author: Peter Hutterer Date: Tue Feb 26 12:34:21 2013 +1000 Xi: always return BadMatch for XTest devices ChangeDeviceControl requests The only controls that still do something are DEVICE_RESOLUTION and DEVICE_ENABLE. XTest devices have no resolution to change, and they cannot be disabled. So skip the lot, and prevent a crash in the DDX when it's trying to de-reference pInfo->control_proc on device with no pInfo struct. Likewise, don't allow setting device mode or the valuators. XTest pointers are always relative, they don't have a mode. Test cases: xts5/XI/ChangeDeviceControl (1/10) xts5/XI/SetDeviceValuators (1/6) and a few others Reported-by: Knut Petersen Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 23d1bc69f305edd5a6e2cfec3dfc84befda0881c Author: Peter Hutterer Date: Thu Mar 14 11:07:57 2013 +1000 dix: send the current axis value in DeviceChangedEvents (#62321) X.Org Bug 62321 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 27b11f5c19d67e2f6784d86cb7df86bbab3b58bb Author: Peter Hutterer Date: Fri Feb 15 11:19:10 2013 +1000 Xi: fix comment - XI2 grabs aren't keysym grabs Comment dates back to a pre-release version of XI2 that supported keysym grabs. That never made it into a release, it was ditched before. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 2746c681639f9512e6e45fb8d0151b996b6aff7f Merge: 1e6cf8e 9878e09 Author: Keith Packard Date: Mon May 6 10:52:40 2013 -0700 Merge remote-tracking branch 'alanc/master' commit 1e6cf8ec20d07b73a11116564aba71b4e4291dcd Merge: dbfeaf7 5860408a Author: Keith Packard Date: Mon May 6 10:20:21 2013 -0700 Merge remote-tracking branch 'jturney/unused-but-set-variable-warning-fix' commit dbfeaf70623a83e1a3f3255c94d52e0e04702837 Author: Aaron Plattner Date: Tue Apr 30 14:30:18 2013 -0700 xfree86: don't enable anything in xf86InitialConfiguration for GPU screens There's no point in turning on outputs connected to GPU screens during initial configuration. Not only does this cause them to just display black, it also confuses clients when these screens are attached to a master screen and RandR reports that the outputs are already on. Also, don't print the warning about no outputs being found on GPU screens, since that's expected. Signed-off-by: Aaron Plattner Reviewed-by: Dave Airlie commit 5860408a19d956f8cebb7ae39cfdbfcebd5e6360 Author: Jon TURNEY Date: Wed Apr 3 18:43:26 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in ProcWindowsWMFrameGetRect() /jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c: In function ‘ProcWindowsWMFrameGetRect’: /jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c:322:12: error: variable ‘ir’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit bcfd523c150b34e9304d174ba812160c611f270d Author: Jon TURNEY Date: Wed Apr 3 18:34:38 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winMWExtWMUpdateWindowDecoration() /jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c: In function ‘winMWExtWMUpdateWindowDecoration’: /jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c:189:11: error: variable ‘dwStyle’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit fbf819c24dc080f166cff29bf46b0feb604c6b8c Author: Jon TURNEY Date: Wed Apr 3 16:40:35 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winHotKeyAltTabPrimaryDD() /jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c: In function ‘winHotKeyAltTabPrimaryDD’: /jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c:518:20: error: variable ‘rcSrc’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 7dae1e59ce6077f475c04a41fa00096a74114064 Author: Jon TURNEY Date: Wed Apr 3 16:33:39 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winMinimizeWindow() when built !XWIN_MULTIWINDOWEXTWM /jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c: In function ‘winMinimizeWindow’: /jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c:813:20: error: variable ‘pScreenInfo’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b284666f09b77f9c2f048fee22015a353152a57f Author: Jon TURNEY Date: Wed Apr 3 16:27:45 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winClipboardProc() /jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c: In function ‘winClipboardProc’: /jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c:88:25: error: variable ‘atomClipboardManager’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit d414a09bb7f8d4440b36cbc6f0b4ca0eaefe5cbf Author: Jon TURNEY Date: Wed Apr 3 16:25:54 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winWindowProc() /jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c: In function ‘winWindowProc’: /jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c:65:22: error: variable ‘s_hInstance’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 7726102671690eb28138d032c8398ac903b97606 Author: Jon TURNEY Date: Wed Apr 3 16:24:08 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winCopyWindowNativeGDI() /jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c: In function ‘winCopyWindowNativeGDI’: /jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c:131:15: error: variable ‘pwinRoot’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b9a2566a6e2f56a0335cd4a089b2066c06a67455 Author: Jon TURNEY Date: Wed Apr 3 16:50:38 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winFinishScreenInitFB() /jhbuild/checkout/xorg/xserver/hw/xwin/winscrinit.c:264:11: error: variable ‘pbits’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit c97fbd39adbc0a8cb8537f40b12c091aee29221a Author: Jon TURNEY Date: Wed Apr 3 16:18:27 2013 +0100 hw/xwin: Fix unused-but-set-variable warning in winIsFakeCtrl_L() /jhbuild/checkout/xorg/xserver/hw/xwin/winkeybd.c:331:17: error: variable ‘lastMessage’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit cdb74fe17dcb3b5a9c61951f897deaf07f86775f Author: Jon TURNEY Date: Wed Apr 3 16:16:06 2013 +0100 hw/xwin: Fix unused-but-set-variable warnings in windialog.c /jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winChangeDepthDlgProc’: /jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:432:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable] /jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winAboutDlgProc’: /jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:564:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit f2fd8ec3725a61abbc831f0a9ec28fa2b7020c47 Author: Dave Airlie Date: Wed Jan 9 12:52:13 2013 +1000 gpu: call CreateScreenResources for GPU screens I didn't think we needed this before, but after doing some more work with reverse optimus it seems like it should be called. Reviewed-by: Keith Packard Signed-off-by: Dave Airlie commit 8fcb9d91b69abc72ddef31b9f2e8585580c6cad2 Author: Dave Airlie Date: Wed Jan 9 12:52:08 2013 +1000 dix: allow pixmap dirty helper to be used for non-shared pixmaps this allows the pixmap dirty helper to be used for reverse optimus, where the GPU wants to copy from the shared pixmap to its VRAM copy. [airlied: slave_dst is wrong name now but pointless ABI churn at this point] Reviewed-by: Keith Packard Signed-off-by: Dave Airlie commit 16077b81c502e04d77f81f683e0c213b9fe75393 Author: Dave Airlie Date: Wed Jan 9 12:52:03 2013 +1000 xf86crtc: don't use scrn->display for gpu screens scrn->display is a property of the main screen really, and we don't want to have the GPU screens use it for anything when picking modes or a front buffer size. This fixes a bug where when you plugged a display link device, it would try and allocate a screen the same size as the current running one (3360x1050 in this case), which was too big for the device. Avoid doing this and just pick sizes based on whats plugged into this device. Reviewed-by: Keith Packard Signed-off-by: Dave Airlie commit f0d0d75bfe62553dde353f89e46ff13dd863fbe8 Author: Dave Airlie Date: Wed Jan 9 12:51:55 2013 +1000 dix/gpu: remove asserts for output/offload from same slave We should have no problem allowing output/offload from the same slave, I asserted here, but in order to implement reverse optimus this makes perfect sense. (reverse optimus is intel outputting to nvidia). Reviewed-by: Keith Packard Signed-off-by: Dave Airlie commit 9d26e8eaf5a2d7c3e65670ac20254c60f665c463 Author: Dave Airlie Date: Wed Jan 9 14:26:35 2013 +1000 randr: report changes when we disconnect a GPU slave When we disconnect an output/offload slave set the changed bits, so a later TellChanged can do something. Then when we remove a GPU slave device, sent change notification to the protocol screen. This allows hot unplugged USB devices to disappear in clients. Reviewed-by: Peter Hutterer Signed-off-by: Dave Airlie commit b724324252d13ff95f62eebd12d125b194d2ccc2 Author: Dave Airlie Date: Wed Jan 9 14:25:43 2013 +1000 randr: only respected changed on the protocol screen We don't want to know about changes on the non-protocol screen, we will fix up setchanged to make sure non-protocol screens update the protocol screens when they have a change. Reviewed-by: Peter Hutterer Signed-off-by: Dave Airlie commit b3f70f38edebac87afe9351538365292f1aaaff3 Author: Dave Airlie Date: Wed Jan 9 14:29:47 2013 +1000 randr: make SetChanged modify the main protocol screen not the gpu screen When SetChanged is called we now modify the main protocol screen, not the the gpu screen. Since changed stuff should work at the protocol level. Reviewed-by: Peter Hutterer Signed-off-by: Dave Airlie commit f9c8248b8326ad01f33f31531c6b2479baf80f02 Author: Dave Airlie Date: Wed Jan 9 14:23:57 2013 +1000 randr: don't directly set changed bits in randr screen Introduce a wrapper interface so we can fix things up for multi-gpu situations later. This just introduces the API for now. Reviewed-by: Peter Hutterer Signed-off-by: Dave Airlie commit 451ba4bd41b82acd4aec6236ba121e00cfeb311b Author: Chris Wilson Date: Thu Jan 10 03:26:33 2013 +0000 hw/xfree86: Only report SetDesiredModes() failed if at least one modeset fails 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. changed the logic to try to set the mode on all connected outputs rather than abort upon the first failure. The return error code was then tweaked such that it reported success if it set a mode on any crtc. However, this confuses the headless case where we never enable any crtcs and also, importantly, never fail to set a crtc. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59190 Signed-off-by: Chris Wilson Also-written-by: Maarten Lankhorst Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 9878e097a7de2f86eff0dcfd9fe5d83b162197ec Author: Alan Coopersmith Date: Wed Apr 24 15:24:31 2013 -0700 Only call xf86platformVTProbe() when it's defined Fixes build on non-udev systems, since XSERVER_PLATFORM_BUS is only defined in configure.ac if $CONFIG_UDEV_KMS is true. Signed-off-by: Alan Coopersmith Reviewed-by: Dave Airlie commit e779402d531625ba4ed5d628d06c6b1e06b2ec7b Author: Keith Packard Date: Thu Apr 25 09:02:31 2013 -0700 shadow: Define c2p_unsupported Just make this call BUG_WARN(1) to indicate that something unexpected happened Signed-off-by: Keith Packard commit 2b361fbda536f0125e4b87a6d455acc58f4e8690 Author: Alan Coopersmith Date: Sun Feb 10 10:24:59 2013 -0800 sparcPromPathname2Node: free name when returning error, instead of leaking it Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard commit 174ccd84931ece5a92a09c4a1d6a47e0958ebf7e Author: Alan Coopersmith Date: Sun Feb 10 10:24:59 2013 -0800 xf86SbusCmapLoadPalette: Delay malloc until needed, avoiding leak on error Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 V2: check for malloc failure Signed-off-by: Alan Coopersmith commit 6bca0184d167388cd417d113031317990489987d Author: Alan Coopersmith Date: Sun Feb 10 10:18:02 2013 -0800 dmxVDLRead: if we opened a file, close it instead of leaking it Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard commit 8c5ff2e93f73b24adff741b25fc1e31b2f5dd0ac Author: Alan Coopersmith Date: Sun Feb 10 10:24:59 2013 -0800 __glXDRIscreenProbe: free screen when DRI2Connect fails, instead of leaking it Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 V2: goto existing error handler, instead of replicating more of it here Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard commit 9567fa9a7269765bc59ac71b931e16df261d794d Author: Alan Coopersmith Date: Sun Feb 10 10:24:59 2013 -0800 __glXDRIscreenCreateContext: free context on failure, instead of leaking it Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 Signed-off-by: Alan Coopersmith Reviewed-by: Ian Romanick commit 7ab98bafc9a3426fd40f8ae693430491333ba4fc Merge: 53da26a 5ab2603 Author: Keith Packard Date: Wed Apr 24 14:14:45 2013 -0700 Merge remote-tracking branch 'geertu/master' commit 53da26afb76bcce70b91c5df23d25e7e85c010cf Merge: 5ece86e d8d3c78 Author: Keith Packard Date: Wed Apr 24 10:27:19 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 5ece86e921a1df457a9baab6a2357ccda4ad6957 Merge: ef0a726 22cab8a Author: Keith Packard Date: Wed Apr 24 10:23:51 2013 -0700 Merge remote-tracking branch 'airlied/for-keithp-gpu-vt-owner' commit ef0a726bc8d5c415244cb4f86d664938b0127a5d Author: Jeremy White Date: Thu Mar 21 10:58:42 2013 -0500 Eliminate the use of xf86Rename.h Signed-off-by: Jeremy White Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 2b539239e465faa9e8c6d96f1c6f00e593d46c18 Author: Keith Packard Date: Wed Apr 24 10:11:03 2013 -0700 Bump to 1.14.99.1 Snapshot with fix for CVE-2013-1940. Signed-off-by: Keith Packard commit d8d3c78b6ebdf63836951d2dbd2d3d621ff26da2 Author: Andreas Müller Date: Tue Apr 16 14:30:43 2013 +0200 dixstruct.h: fix segfaults - char is unsigned for ARM and PowerPC architectures see ARM related bug reports [1-3] [1] https://github.com/archlinuxarm/PKGBUILDs/issues/446I [2] http://www.raspberrypi.org/phpBB3/viewtopic.php?t=38568&p=321673 [3] http://lists.linuxtogo.org/pipermail/openembedded-core/2013-April/037805.html Signed-off-by: Andreas Müller Reviewed-by: Mark Kettenis Signed-off-by: Peter Hutterer commit 7d722796c678532e8c5897c673c43184da353f44 Author: Peter Hutterer Date: Wed Apr 17 19:47:42 2013 +1000 dix: plug memory leak in freeing TouchClass ==15562== 1,800 bytes in 1 blocks are definitely lost in loss record 298 of 330 ==15562== at 0x4A06B6F: calloc (vg_replace_malloc.c:593) ==15562== by 0x4312C7: InitTouchClassDeviceStruct (devices.c:1644) Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit 5ab260317ad3b2aafff31a97df21620db52eacd1 Author: Geert Uytterhoeven Date: Sun Mar 10 21:04:19 2013 +0100 Xfbdev: Wire up Amiga afb4 and afb8 support Add support for Amiga-style bitplanes, with 4 or 8 bits per pixel. Signed-off-by: Geert Uytterhoeven Acked-by: Keith Packard commit 672bc5bb38918304cf68114a1112cd48651a5e83 Author: Geert Uytterhoeven Date: Sun Mar 10 17:17:26 2013 +0100 Xfbdev: Wire up Atari iplan2p4 and iplan2p8 support Add support for Atari-style interleaved bitplanes, with 2 bytes interleave and 4 or 8 bits per pixel. Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit 95a3c7536c1a4afe97aaf955980034cc69af9c2f Author: Geert Uytterhoeven Date: Sun Mar 10 17:17:26 2013 +0100 Xfbdev: Force shadowfb for frame buffers with non-packed pixels Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit 0e808110df216649e05503baecd06cd5a3e50421 Author: Geert Uytterhoeven Date: Sun Mar 10 17:17:26 2013 +0100 Xfbdev: Reject unsupported frame buffer types Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit cfd10576812c36f5844805eb95ed1f2d093d1691 Author: Geert Uytterhoeven Date: Sun Mar 10 21:03:44 2013 +0100 Shadow: Add support for Amiga afb8 Add support for Amiga-style bitplanes, with 8 bits per pixel. Signed-off-by: Geert Uytterhoeven Acked-by: Keith Packard commit a1b8e7f1e6118b611ba9d332b8763ee2b44f550c Author: Geert Uytterhoeven Date: Wed Mar 27 09:37:02 2013 +0100 Shadow: Add support for Amiga afb4 Add support for Amiga-style bitplanes, with 4 bits per pixel. Signed-off-by: Geert Uytterhoeven Acked-by: Keith Packard commit d7181e567d1629c387b834da7eecdf618d14718e Author: Geert Uytterhoeven Date: Sun Mar 10 17:16:17 2013 +0100 Shadow: Add support for Atari iplan2p8 Add support for Atari-style interleaved bitplanes, with 2 bytes interleave and 8 bits per pixel. Signed-off-by: Geert Uytterhoeven Acked-by: Keith Packard commit 3f7506b0fca72b2462b85bc4f613de809ae95859 Author: Geert Uytterhoeven Date: Sun Mar 10 21:01:02 2013 +0100 Shadow: Add support for Atari iplan2p4 Add support for Atari-style interleaved bitplanes, with 2 bytes interleave and 4 bits per pixel. Signed-off-by: Geert Uytterhoeven Acked-by: Keith Packard commit 87af9ab7d52578b0ea315fc4f8dfd906d19755fb Author: Geert Uytterhoeven Date: Sun Mar 10 17:15:05 2013 +0100 Shadow: Add c2p core Add Chunky-to-Planar core functionality, to be used by the Atari and Amiga (interleaved) bitplanes code. Signed-off-by: Geert Uytterhoeven Acked-by: Keith Packard commit 4ee2566c3e420a717be36f79126a14e15edac30f Author: Geert Uytterhoeven Date: Tue Mar 12 18:10:40 2013 +0100 Xfbdev: Treat 1 bpp pseudocolor as monochrome miCreateDefColormap() only preallocates black and white pixels if depth > 1. Hence override the visual, so fbdevCreateColormap() takes care of it. Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit 6dfb94a891ed445f47832ba1364fcbf1de018f4a Author: Geert Uytterhoeven Date: Tue Mar 12 14:16:10 2013 +0100 Xfbdev: Add support for monochrome visuals Monochrome supports StaticGray, with hardcoded black and white pixels. Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit 1049b32166760bdc00106625e213d31a8fc60bad Author: Geert Uytterhoeven Date: Tue Mar 12 14:19:25 2013 +0100 Xfbdev: Handle unset fix.line_length Older frame buffer devices may not fill in fix.line_length, in which case it must be calculated by the application. Signed-off-by: Geert Uytterhoeven commit 5c509c360d97bea78ef461596ab4b7bde69020ac Author: Geert Uytterhoeven Date: Fri Feb 22 13:21:28 2013 +0100 Xfbdev: Make char *fbdevDevicePath const This fixes: hw/kdrive/fbdev/fbdev.c: In function 'fbdevInitialize': hw/kdrive/fbdev/fbdev.c:41:25: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit b08afbc53c1d583c3913b92e67db44823077b112 Author: Geert Uytterhoeven Date: Tue Mar 12 15:20:00 2013 +0100 KDrive: Bail out if screen initialization failed Else we may get a segmentation fault later. Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit e7045c9dd208a1afe36526ab21ef15f8b01c8bd2 Author: Geert Uytterhoeven Date: Sat Feb 23 20:09:22 2013 +0100 test/input: Fix double-aligned test in dix_valuator_alloc() on m68k On m68k, doubles are not 64-bit aligned, just like on i386 and sh. Signed-off-by: Geert Uytterhoeven commit 8bb0616cc2799c2c34448da6337ea8cb9438cda7 Author: Geert Uytterhoeven Date: Fri Feb 22 21:10:07 2013 +0100 miext/shadow/shpacked.c: Remove unused PickBit() define Signed-off-by: Geert Uytterhoeven Reviewed-by: Keith Packard commit 6ca03b9161d33b1d2b55a3a1a913cf88deb2343f 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 commit ddc149beaf708e84fb5573c4322d4f859c517917 Author: Peter Hutterer Date: Mon Feb 27 18:50:46 2012 +1000 Stop the shouting Meanwhile, here in the future lowercase letters have been invented. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 27356a45b4f6bad4d0bbf356e6d976d0c8dd257b Author: Peter Hutterer Date: Mon Feb 27 17:22:16 2012 +1000 dix: only allocate unused classes for master devices Slave devices don't need these and the matching code in CloseDevice() has a IsMaster() condition on freeing these, causing a leak. ==16111== 384 bytes in 4 blocks are definitely lost in loss record 72 of 105 ==16111== at 0x4C28BB4: calloc (vg_replace_malloc.c:467) ==16111== by 0x42AEE2: AllocDevicePair (devices.c:2707) ==16111== by 0x4BAA27: AllocXTestDevice (xtest.c:617) ==16111== by 0x4BA89A: InitXTestDevices (xtest.c:570) ==16111== by 0x425F5E: InitCoreDevices (devices.c:690) ==16111== by 0x5ACB2D: main (main.c:257) Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 98b94c36d6b1d286bbd4cb414e54b4b95a1484b0 Author: Maarten Lankhorst Date: Mon Apr 15 16:53:48 2013 +0200 dix: copy event in TouchConvertToPointerEvent correctly Fixes reading random memory read beyond the end of original event. sizeof device_event: 424 sizeof internal_event: 2800 Signed-off-by: Maarten Lankhorst Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 4bff442ec5aa4b93a3f5c11782d4b7b9d1ae13ac Author: Knut Petersen Date: Tue Feb 26 07:52:59 2013 +0100 Never try to execute BellProcPtr NULL. This prevents xts XI/XDeviceBell-2 test from segfaulting the server. Signed-off-by: Knut Petersen Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 9003399708936481083424b4ff8f18a16b88b7b3 Author: Rui Matos Date: Sat Apr 13 04:22:54 2013 +0200 Xi: fix swapped grab mode args for keyboard devices in XIGrabDevice The protocol says that the grab_mode argument applies to the device being grabbed and paired_device_mode to the paired master device. GrabDevice() however takes in a pointer mode and a keyboard mode and so we have to swap the values according the type of device being grabbed. Signed-off-by: Rui Matos Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit d16284687ddeffde32a561b8c67b2e2e3d66aeaa Author: Bryce Harrington Date: Wed Apr 10 23:05:40 2013 -0700 xfree86: Revert workaround for drm race condition. Revert 70739e817b2d64bc020ea491f23a3574bdb6155e and mostly revert c31eac647a9ecf0fb20dc98266cadf0ba923ba14. Further investigation shows the encountered race condition is between lightdm and plymouth-splash, as implemented in the Ubuntu distribution within the limitations of upstart's job coordination logic, and can (and should) be fixed within those limiations. Not in xserver itself. This leaves some of the diagnostic improvements from the recent patch series, in case others run into a similar situation. Signed-off-by: Bryce Harrington Signed-off-by: Peter Hutterer commit 131f883f85b9b734e5e5652f16ba1d3b5f4de12f Author: Peter Hutterer Date: Fri Apr 12 09:14:53 2013 +1000 xfree86: change a log message This path is technically executed through config/udev, but having two messages in the form "config/udev: Adding drm device" makes it appear as if the udev filters are wrong and it's trying to add the same device twice. In fact, it's only one device, only added once, but a duplicate log message. Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie commit 22cab8a28a433d03a4e6ba97f9a160271d73cb52 Author: Dave Airlie Date: Wed Apr 10 16:32:15 2013 +1000 xf86: don't hotplug output devices while VT switched. We don't want to hotplug output devices while we are VT switched, as we get races between multiple X servers on the device open, and drm device master status. This just queues device opens until we return from VT switch. Reviewed-by: Chris Wilson Signed-off-by: Dave Airlie commit 5b359cf6135ca173d8f65cb92926332f07f91efe Author: Dave Airlie Date: Wed Apr 10 16:32:11 2013 +1000 xf86: use new xf86VTOwner interface in a few places This replaces some previous uses of direct xf86Screens[0] accesses. Reviewed-by: Chris Wilson Signed-off-by: Dave Airlie commit d61ea1f64db45201c1a2b39c39293c5768d98092 Author: Dave Airlie Date: Wed Apr 10 16:32:02 2013 +1000 xfree86: add VT owner interface This is just a simple interface to avoid accessing x86Screens[0] directly. Reviewed-by: Chris Wilson Signed-off-by: Dave Airlie commit 7347f39f94d8cebbf73ce1a2f94d1abdaf7ff383 Author: Maarten Lankhorst Date: Tue Apr 9 11:19:07 2013 +0200 Xi: Do not handle ET_TouchOwnership in ProcessTouchEvent The event struct is different, causing memory corruption on 1.13 and 1.14, as can be witnessed in https://bugs.freedesktop.org/show_bug.cgi?id=56578 Signed-off-by: Maarten Lankhorst Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit dbba50a1280cbda9ecff6f37884b4c5756c30bab Author: Keith Packard Date: Tue Apr 9 16:23:19 2013 -0700 Xi: Use correct destination when swapping barrier events Write the swapped values to the destination rather than the source. Signed-off-by: Keith Packard Reviewed-by: Jasper St. Pierre Signed-off-by: Peter Hutterer commit b86b3d10bb2fee1a922b8831e8bb415c339f3d99 Author: Peter Hutterer Date: Mon Mar 4 07:58:41 2013 +1000 dix: don't set non-exisiting flags on touch events Unlike pointer/keyboard events, the flags field for ET_Touch* is a set of server-internal defines that we need to convert to XI protocol defines. Currently only two of those defines actually translate to the protocol, so make sure we don't send internal garbage down the wire. No effect to current clients since they shouldn't look at undefined bits anyway. Signed-off-by: Peter Hutterer commit ecf62755086fd65898998d5a509aee5f29a9583d Author: Jeremy White Date: Thu Mar 21 10:58:57 2013 -0500 Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h. This removes a large number of redundant declaration warnings. Signed-off-by: Jeremy White Reviewed-by: Robert Morell Signed-off-by: Keith Packard commit e13f29984251dbbe6076264ed710c2922312eed1 Author: Bryce Harrington Date: Tue Mar 19 12:12:46 2013 -0700 xfree86: Be verbose if waiting on opening the drm device Signed-off-by: Bryce Harrington Reviewed-by: Chris Wilson Signed-off-by: Keith Packard commit 70739e817b2d64bc020ea491f23a3574bdb6155e Author: Bryce Harrington Date: Tue Mar 19 12:12:45 2013 -0700 xfree86: Fix race condition failure opening drm. If other processes have had drm open previously, xserver may attempt to open the device too early and fail, with xserver error exit "Cannot run in framebuffer mode" or Xorg.0.log messages about "setversion 1.4 failed". In this situation, we're receiving back -EACCES from libdrm. To address this we need to re-set ourselves as the drm master, and keep trying to set the interface until it works (or until we give up). See https://bugs.launchpad.net/ubuntu/+source/libdrm/+bug/982889 Signed-off-by: Bryce Harrington Reviewed-by: Chris Wilson Signed-off-by: Keith Packard commit c31eac647a9ecf0fb20dc98266cadf0ba923ba14 Author: Bryce Harrington Date: Tue Mar 19 12:12:44 2013 -0700 xfree86: Keep trying to set interface on drm for 2 seconds. And if we've had to delay booting due to not being able to set the interface, fess up. Signed-off-by: Bryce Harrington Reviewed-by: Chris Wilson Signed-off-by: Keith Packard commit d1cc210de8c13f2db9f6f284ecc652305c28801e Author: Bryce Harrington Date: Tue Mar 19 12:12:43 2013 -0700 xfree86: Provide more details on failure Signed-off-by: Bryce Harrington Reviewed-by: Chris Wilson Signed-off-by: Keith Packard commit f059d0dabc553a5f748d86de9115da00be5997d5 Author: Bryce Harrington Date: Tue Mar 19 12:12:42 2013 -0700 xfree86: Track error code and add label for error handling. Signed-off-by: Bryce Harrington Reviewed-by: Chris Wilson Signed-off-by: Keith Packard commit 4d7052bd7bbf49b573dc4d34ad14e7f058a0d884 Author: Bryce Harrington Date: Tue Mar 19 12:12:41 2013 -0700 xfree86: (Cleanup) Close fd if drm interface 1.4 could not be set. Signed-off-by: Bryce Harrington Reviewed-by: Chris Wilson Signed-off-by: Keith Packard commit c64fa9a2961f82719cc7734a4222f31297a2e593 Author: Maarten Lankhorst Date: Wed Apr 3 12:08:44 2013 +0200 support 32 bpp pixmaps when 24 bpp fb is used. Fixes background corruption in ubuntu. Signed-off-by: Maarten Lankhorst commit 8928f8fa0bb154ce437af703ff702016f0dcf127 Author: Geert Uytterhoeven Date: Mon Mar 18 21:38:10 2013 +0100 kdrive/fbdev: revive randr new screen size logic hw/kdrive/fbdev/fbdev.c: In function 'fbdevRandRSetConfig': hw/kdrive/fbdev/fbdev.c:470:19: warning: variable 'newheight' set but not used [-Wunused-but-set-variable] hw/kdrive/fbdev/fbdev.c:470:9: warning: variable 'newwidth' set but not used [-Wunused-but-set-variable] Signed-off-by: Geert Uytterhoeven Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 808c87bff710263f5a7b3c12a7e7fec54672fecd Author: Peter Hutterer Date: Mon Mar 25 14:51:58 2013 +1000 Revert "kdrive: fix "set but not used" warnings" Partial revert of commit 4149ee8ec0193acbf3812c7ee2627b93b9a89997, better fix coming up. Signed-off-by: Peter Hutterer commit 3a9a6c972e4bc88dc3dde9399df3b0cda759cd70 Author: Maarten Lankhorst Date: Wed Mar 27 10:33:46 2013 +0100 bump version to 0.7.0 commit ac4c2abe985ce6816a3389c41eb23462c6ac2486 Author: vdb@picaros.org Date: Thu Mar 7 16:07:31 2013 +0100 xserver: add monitor Option "ZoomModes" [v2] Section "Monitor" Identifier "a21inch" Option "PreferredMode" "1600x1200" Option "ZoomModes" "1600x1200 1280x1024 1280x1024 640x480" EndSection The option's effect is to search for and mark once each named mode in the output modes list. So the specification order is free and the zoom modes sequence follows the order of the output modes list. All marked modes are available via the Ctrl+Alt+Keypad-{Plus,Minus} key combination. See also http://bugs.freedesktop.org/show_bug.cgi?id=17954. This option has its use for combined monitor and television setups. It allows for easy switching between 60 Hz and 50 Hz modes even when a monitor refuses to display the input signal. (Includes a few minor changes suggested by Aaron for v2) Signed-off-by: Servaas Vandenberghe Reviewed-by: Aaron Plattner Signed-off-by: Keith Packard commit 862bc2836835b93f4b2cfd2de6ca344f65484a00 Author: Maarten Lankhorst Date: Tue Mar 26 15:19:52 2013 +0100 modesetting: return null for get_modes if output could not be retrieved Signed-off-by: Maarten Lankhorst commit 6b79a8791d35bbd1a13ebdec1c582f66c559c039 Author: Maarten Lankhorst Date: Tue Mar 26 15:19:33 2013 +0100 modesetting: clean up leaks Signed-off-by: Maarten Lankhorst commit 2967391c6d35f03121afa8003e0fb94b62495129 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 commit 2fdde2c40d83695438b6f5615f98bd7ae801b43d Author: Peter Hutterer Date: Mon Feb 25 15:21:32 2013 +1000 dix: update coords for touch events in PlayReleasedEvents Note: this is only hit for #ifdef PANORAMIX Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 697071ab2b7f8910e01ed74618138538291cd1e8 Author: Peter Hutterer Date: Thu Feb 28 10:30:15 2013 +1000 Xi: compress two if statements with the same body We do the same thing here, compress them into one body. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 11bead1fa205a1353e6a33c6024c7e8ace80be7c 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 commit fc504a44d12d537d4e07f659f1863f200a0272ad Author: Peter Hutterer Date: Fri Mar 1 08:26:06 2013 +1000 Xi: use a temp variable for the new listener Instead of accessing ti->listener[0] all the time. No functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 9978b57b8d94f061d72a67b99a02b0ba16a11429 Author: Peter Hutterer Date: Fri Mar 1 08:43:58 2013 +1000 Xi: return !Success from DeliverTouchEmulatedEvent if we didn't deliver All callers currently ignore the new value, so this patch has no effect. Inverse call graph: DeliverTouchEmulatedEvent DeliverEmulatedMotionEvent Ignores value DeliverTouchBeginEvent DeliverTouchEvent DeliverTouchEvents Ignores value DeliverTouchEndEvent DeliverTouchEvent DeliverTouchEvents Ignores value Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 1754973206c09a901747e71d4abdf666293da59e Author: Aaron Plattner Date: Wed Feb 20 17:27:16 2013 -0800 modesetting: match PCI class 3, any subclass If a device is not primary, the PCI device match fails because the xf86-video-modesetting driver looks specifically for a PCI class match of 0x30000 with a mask of 0xffffff. This fails to match, for example, a non-primary Intel VGA device, because it is reported as having a class of 0x38000. Fix that by ignoring the low 16 bits of the class in the pci_id_match table. Signed-off-by: Aaron Plattner Reviewed on IRC by Adam Jackson commit cc3d1a5a6120e721a46c67446ba68f5596055633 Author: Piotr Dziwinski Date: Sat Feb 23 13:14:45 2013 +0100 glx: fix uninitialized var in __glXDRIscreenProbe Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59825 Signed-off-by: Piotr Dziwinski Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit c2ede8f92f0d6f15b1b2a04889cb54cd1728780b Merge: 190b032 7050aae Author: Keith Packard Date: Mon Mar 18 11:26:24 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 190b0321510b99d4738915f540cea5c0c51e07e2 Author: Zack Rusin Date: Thu Feb 14 15:06:57 2013 -0800 GLX/DRI2: Do not expose INTEL_swap_event without swap control Swap events depent on the implementation of ScheduleSwap. By unconditionally enabling GLX_INTEL_swap_event we're breaking the system with drivers that don't support it because the apps are forever stuck waiting for an event that will never be delivered. So lets enable the extension only if the hooks it depends on are actually there. Signed-off-by: Zack Rusin Reviewed-by: Ian Romanick Signed-off-by: Keith Packard commit 116f020102fd6c2a603069a639b113dfa31b48b7 Merge: cf89aa5 0f537da Author: Keith Packard Date: Mon Mar 18 11:18:58 2013 -0700 Merge remote-tracking branch 'whot/next' commit cf89aa53748b964f9d9eceaa12a7d6f1a076d1ee Author: Tomasz Lis Date: Mon Mar 11 10:21:28 2013 +0100 Full support of sRGB capable fbconfigs. Changes to correctly initialize the sRGB capability attribute and transfer it between XServer and the client. Modifications include extension string, transferring visual config attribs and fbconfig attribs. Also, attribute is initialized in the modules which do not really use it (xquartz and xwin). This version advertises both ARB and EXT strings, and initializes the capability to default value of FALSE. It has corrected required GLX version and does not influence swrast. The sRGB capable attribute is attached only to those configs which do have this capability. Both ARB and EXT versions share the same GLX extension enabling bit. Signed-off-by: Tomasz Lis Reviewed-by: Ian Romanick Signed-off-by: Keith Packard commit 679ccecd8bc6d797e99f3b707f8041b727ca7a49 Author: Keith Packard Date: Mon Mar 18 10:01:20 2013 -0700 Bump release to 1.14.99.0 Get us off the release number so that we don't conflict with the stable branch. Signed-off-by: Keith Packard commit beb1715e96b649a0903fa61f30dd1eb69411da2f Author: Colin Walters Date: Wed Jan 4 22:37:06 2012 +0000 autogen.sh: Implement GNOME Build API http://people.gnome.org/~walters/docs/build-api.txt Signed-off-by: Adam Jackson commit 7050aae69c2a55dfdbb5c6af7882307e90ba4275 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 commit 31595b528645a7e4903eb81da0fc332d78407f25 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 commit 3ac2e61705432951f9e1b96b42b4214e7f748f94 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 commit 5047810a4c20fab444b8c6eb146c55dcdb0d4219 Author: Aaron Plattner Date: Wed Mar 6 09:40:28 2013 -0800 fb: Rename wfbDestroyGlyphCache Renaming this function was missed in commit 9cbcb5bd6a5360a128d15b77a02d8d3351f74366, so both libfb.so and libwfb.so define functions named fbDestroyGlyphCache. Signed-off-by: Aaron Plattner Reviewed-by: Søren Sandmann Signed-off-by: Keith Packard 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 0f537da72d414ed84e3cd14e3bb7e08565136bd7 Author: Andreas Wettstein Date: Sun Mar 3 20:25:44 2013 +0100 xkb: Fixes to LatchMods/LatchGroup The main problem this patch addresses is that if a latch is put on multi-level key with a Latch/Lock/Set, it is possible that after all keys are released, still base modifiers are set, which typically will make the keyboard unusable. To see how it happens (without the patch), assume that key AltGr sets Mod5 when pressed by itself, and latches Mod3 when pressed together with Shift. Now press Shift, then AltGr and release both keys in reverse order. Mod3 is now latched, and the LatchMods filter remains active as the second filter. Now press AltGr; Mod5 base modifier gets set, and the SetMods filter will become active as the first filter. Release AltGr: First, the SetMods filter will set clearMods to Mod5, then the LatchMods filter will overwrite clearMods with Mod3. Result: the Mod5 base modifier will remain set. This example becomes practically relevant for the revised German standard layout (DIN 2137-1:2012-06). Other changes implement the latch behaviour more accurately according to the specification. For example, releasing a modifier latching key can at the same time clear a locked modifier, promote another modifier that is latched to locked, and latch a third modifier. Overall, what the code does should be straightforward to compare what the XKB protocol specification demands, see the table in section 6.3. Finally, releasing a key no longer cancels a latch that has not become pending yet. In my opinion, the specification is not clear; it speaks of "operating" a key, which the patch effectivly interprets as "press" rather than "press or release". From my experience, using the latter interpretation makes latches on higher levels practically unusable. In the example given above, one would have to release AltGr always before Shift to get the Mod3-Latch. The practical relevance of latches on higher levels is once more given by the revised German standard layout. Signed-off-by: Andreas Wettstein Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit eadda231091aa6feb68207ee22f6bc3a390d4556 Author: Peter Hutterer Date: Fri Feb 15 11:19:09 2013 +1000 xephyr: fix "set but not used warnings" ephyrvideo.c: In function 'ephyrPutVideo': ephyrvideo.c:1009:42: warning: variable 'drw_h' set but not used ephyrvideo.c:1009:31: warning: variable 'drw_w' set but not used ephyrvideo.c:1009:20: warning: variable 'drw_y' set but not used ephyrvideo.c:1009:9: warning: variable 'drw_x' set but not used ephyrvideo.c: In function 'ephyrGetVideo': ephyrvideo.c:1058:42: warning: variable 'drw_h' set but not used ephyrvideo.c:1058:31: warning: variable 'drw_w' set but not used ephyrvideo.c:1058:20: warning: variable 'drw_y' set but not used ephyrvideo.c:1058:9: warning: variable 'drw_x' set but not used ephyrvideo.c: In function 'ephyrPutStill': ephyrvideo.c:1107:42: warning: variable 'drw_h' set but not used ephyrvideo.c:1107:31: warning: variable 'drw_w' set but not used ephyrvideo.c:1107:20: warning: variable 'drw_y' set but not used ephyrvideo.c:1107:9: warning: variable 'drw_x' set but not used ephyrvideo.c: In function 'ephyrGetStill': ephyrvideo.c:1156:42: warning: variable 'drw_h' set but not used ephyrvideo.c:1156:31: warning: variable 'drw_w' set but not used ephyrvideo.c:1156:20: warning: variable 'drw_y' set but not used ephyrvideo.c:1156:9: warning: variable 'drw_x' set but not used Signed-off-by: Peter Hutterer Reviewed-by: Robert Morell commit 4149ee8ec0193acbf3812c7ee2627b93b9a89997 Author: Peter Hutterer Date: Fri Feb 15 11:19:08 2013 +1000 kdrive: fix "set but not used" warnings kinput.c: In function 'KdEnqueueKeyboardEvent': kinput.c:1845:16: warning: variable 'ctrl' set but not used kinput.c:1844:17: warning: variable 'keyc' set but not used kinput.c: In function 'KdEnqueuePointerEvent': kinput.c:1887:12: warning: variable 'ms' set but not used kxv.c: In function 'KdXVDisable': kxv.c:1181:19: warning: variable 'ScreenPriv' set but not used mouse.c: In function 'ps2SkipInit': mouse.c:444:9: warning: variable 'skipping' set but not used mouse.c: In function 'ps2Init': mouse.c:473:10: warning: variable 'waiting' set but not used mouse.c:472:9: warning: variable 'skipping' set but not used fbdev.c: In function 'fbdevRandRSetConfig': fbdev.c:468:19: warning: variable 'newheight' set but not used fbdev.c:468:9: warning: variable 'newwidth' set but not used Signed-off-by: Peter Hutterer Reviewed-by: Robert Morell commit 44fc062f85df7288c17d2d64b73aa4957b91fd6d Author: Peter Hutterer Date: Mon Feb 18 14:57:58 2013 +1000 os: document pnprintf as sigsafe snprintf Signed-off-by: Peter Hutterer commit c100211034ab69ce453a1644fb61c6808d7e3eda Author: Peter Hutterer Date: Tue Dec 18 14:12:40 2012 +1000 dix: only show the cursor if a window defines one (#58398) e02f864fdf "Suppress cursor display until the first XDefineCursor() request" disabled cursor display a priori unless -retro is given. On a plain server, caling XFixesHideCursor() and XFixesShowCursor() would show the default root cursor, despite no client actually defining a cursor. Change the logic, disable CursorVisible by default and only enable it from the window's CWCursor logic. If no window ever defines a cursor, said cursor stays invisible. X.Org Bug 58398 Signed-off-by: Peter Hutterer Tested-by: Bastien Nocera Reviewed-by: Daniel Martin 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 bd58ebe4cf3b0ce60f87fb26a3715f774dabd349 Author: Daniel Martin Date: Thu Dec 20 13:50:17 2012 +0100 ephyr: Fix crash on 24bpp host framebuffer Use bytes_per_line and bits_per_pixel from the created XImage to fix https://bugzilla.redhat.com/show_bug.cgi?id=518960 Signed-off-by: Daniel Martin 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 e21e183059df5975e7086850d1931edb2c1bbd06 Author: Marcin Slusarz Date: Thu Feb 21 09:02:44 2013 +1000 os: use libunwind to generate backtraces Libunwind generates backtraces much more reliably than glibc's "backtrace". Before: 0: /opt/xserver/bin/X (0x400000+0x18ce36) [0x58ce36] 1: /opt/xserver/bin/X (xorg_backtrace+0x9) [0x58d119] 2: /opt/xserver/bin/X (0x400000+0x190d69) [0x590d69] 3: /lib64/libpthread.so.0 (0x7fb904268000+0x10a90) [0x7fb904278a90] 4: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987] 5: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8] 6: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b] 7: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719] 8: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (0x7fb90220e000+0x76f3) [0x7fb9022156f3] 9: /opt/xserver/lib/xorg/modules/libexa.so (0x7fb9019c7000+0xbae0) [0x7fb9019d2ae0] 10: /opt/xserver/bin/X (0x400000+0x17d2b3) [0x57d2b3] 11: /opt/xserver/bin/X (0x400000+0xc9930) [0x4c9930] 12: /opt/xserver/bin/X (0x400000+0x3a81a) [0x43a81a] 13: /opt/xserver/bin/X (0x400000+0x3d6a1) [0x43d6a1] 14: /opt/xserver/bin/X (0x400000+0x2c2ca) [0x42c2ca] 15: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5] 16: /opt/xserver/bin/X (0x400000+0x2c60d) [0x42c60d] 17: ?? [0x0] After: 0: /opt/xserver/bin/X (OsSigHandler+0x39) [0x590d69] 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7fb904278a8f] 2: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987] 3: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8] 4: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b] 5: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719] 6: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (nouveau_exa_download_from_screen+0x1a3) [0x7fb9022156f3] 7: /opt/xserver/lib/xorg/modules/libexa.so (exaGetImage+0x1f0) [0x7fb9019d2ae0] 8: /opt/xserver/bin/X (miSpriteGetImage+0x173) [0x57d2b3] 9: /opt/xserver/bin/X (compGetImage+0xb0) [0x4c9930] 10: /opt/xserver/bin/X (ProcGetImage+0x55a) [0x43a81a] 11: /opt/xserver/bin/X (Dispatch+0x341) [0x43d6a1] 12: /opt/xserver/bin/X (main+0x3ba) [0x42c2ca] 13: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5] 14: /opt/xserver/bin/X (_start+0x29) [0x42c60d] 15: ? (?+0x29) [0x29] Signed-off-by: Marcin Slusarz Reviewed-by: Peter Hutterer Tested-by: Knut Petersen commit 75815dbb373d5a74d57cbec9d469f9f88a8ee3ef Author: Chris Wilson Date: Mon Dec 3 13:25:19 2012 +0000 Add missing GTF modes A fixed-mode output device like a panel will often only inform of its preferred mode through its EDID. However, the driver will adjust user specified modes for display through use of a panel-fitter allowing greater flexibility in upscaling. This is often used by games to set a low resolution for performance and use the panel fitter to fill the screen. v2: Use the presence of the 'scaling mode' connector property as an indication that a panel fitter is attached to that pipe. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55564 commit e27b2e61632b220ddc36d0d0387581a9f4774f21 Author: Peter Harris Date: Tue Feb 19 16:08:52 2013 -0500 xkb: Set nIndicators in XkbGetIndicatorMap Xlib doesn't use this value (it computes it from the reply length instead) which is why nobody has noticed yet. But the spec http://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html says that it should be set. Signed-off-by: Peter Harris Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 3aac7a59dc6ef2d8bbf46ba5d37acdf6013e9450 Author: Daniel Martin Date: Tue Dec 11 17:23:55 2012 +0100 ephyr: Add -resizeable option With this option passed, ephyr windows can be resized like normal windows on the fly, without the need of an explicit parent window. Signed-off-by: Daniel Martin Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit f9198e278becec158b570204cf9fc1de822ac76b Author: Peter Hutterer Date: Mon Feb 27 16:43:10 2012 +1000 dix: FreeAllAtoms() on reset ==5712== 6 bytes in 1 blocks are still reachable in loss record 17 of 585 ==5712== at 0x4A074CD: malloc (vg_replace_malloc.c:236) ==5712== by 0x3D1DE885B1: strndup (strndup.c:46) ==5712== by 0x41CB71: MakeAtom (atom.c:121) ==5712== by 0x55AE3E: XIGetKnownProperty (xiproperty.c:401) ==5712== by 0x4251C9: AddInputDevice (devices.c:312) ==5712== by 0x42AC0C: AllocDevicePair (devices.c:2657) ==5712== by 0x425E6E: InitCoreDevices (devices.c:677) ==5712== by 0x5ACA05: main (main.c:257) Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 88517ced1fa2e621be2d05a319b522b3111da516 Merge: 82425c6 73974dd Author: Peter Hutterer Date: Fri Feb 15 11:58:52 2013 +1000 Merge branch 'master' of git+ssh://people.freedesktop.org/~alanc/xserver into next commit 82425c66e7a8c436b5be7ad44880dd4be6c1f06a Author: Peter Hutterer Date: Thu Feb 14 10:21:47 2013 +1000 xfree86: remove redundant declaration of inputInfo xf86Cursor.c:19:18: warning: redundant redeclaration of 'inputInfo' [-Wredundant-decls] In file included from xf86Cursor.c:18:0: ../../../include/inputstr.h:614:57: note: previous declaration of 'inputInfo' was here Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Mark Kettenis commit 6133c417595a9c8fc158b0d68fd4a7a2c58fdc47 Author: Peter Hutterer Date: Thu Feb 14 10:15:33 2013 +1000 xkb: remove unused variable 'names' xkb.c: In function '_XkbSetNamesCheck': xkb.c:3987:18: warning: variable 'names' set but not used [-Wunused-but-set-variable] Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Mark Kettenis commit 63d00c6b146d7f5fb80f20f19066088059042a5e Author: Peter Hutterer Date: Thu Feb 14 10:13:53 2013 +1000 Xext: rename two shadowing variables panoramiX.c: In function 'PanoramiXCreateConnectionBlock': panoramiX.c:599:10: warning: declaration of 'disableBackingStore' shadows a global declaration [-Wshadow] In file included from ../include/windowstr.h:60:0, from panoramiX.c:47: ../include/opaque.h:56:52: warning: shadowed declaration is here [-Wshadow] panoramiX.c: In function 'PanoramiXConsolidate': panoramiX.c:834:19: warning: declaration of 'pScreen' shadows a previous local [-Wshadow] panoramiX.c:813:15: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Mark Kettenis commit 8bbea9f48f43e54c55c8b60ea36bda3134a86af2 Author: Peter Hutterer Date: Thu Feb 14 10:09:53 2013 +1000 Xext: renaming shadowing variable xvdisp.c: In function 'ProcXvStopVideo': xvdisp.c:712:11: warning: declaration of 'rc' shadows a previous local [-Wshadow] xvdisp.c:705:17: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Mark Kettenis commit 7b79a2e4a11b5c5f0ebaa495828725e235d2b08e Author: Peter Hutterer Date: Thu Feb 14 10:06:55 2013 +1000 fb: drop two unneeded shadowing variables fbpict.c: In function 'fbGlyphs': fbpict.c:188:6: warning: declaration of 'x' shadows a previous local [-Wshadow] fbpict.c:111:9: warning: shadowed declaration is here [-Wshadow] fbpict.c:188:9: warning: declaration of 'y' shadows a previous local [-Wshadow] fbpict.c:111:12: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Soren Sandmann Reviewed-by: Mark Kettenis commit 858d8b19b3a5bb59e5c5f9a9e68adce2495b5e31 Author: Peter Hutterer Date: Thu Feb 14 10:04:06 2013 +1000 xfree86: drop unused prevSIGIO Unused as of 5d309af2ed93e91c7d72f548a11052051efbb40f Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Mark Kettenis commit 592d35aef0a8089a344543cf5a425e0537c0431b Author: Peter Hutterer Date: Thu Feb 14 10:02:02 2013 +1000 randr: fix "set but unused" warnings rrcrtc.c: In function 'RRCrtcDetachScanoutPixmap': rrcrtc.c:366:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable] rrcrtc.c: In function 'rrCheckPixmapBounding': rrcrtc.c:505:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable] rrcrtc.c:445:9: warning: unused variable 'i' [-Wunused-variable] Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Mark Kettenis 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 ac34281b8a487640c61f258ae45a6f17a4fb3cc0 Author: Dave Airlie Date: Thu Feb 7 12:24:20 2013 +1000 modesetting: provide dummy hooks for shadow Since in some wierd cases the server can call these without checking they exist. Signed-off-by: Dave Airlie commit 73974dd7ea9ca4d4cdd5464cb813088a6ee9770b Author: Alan Coopersmith Date: Sun Jan 27 15:42:02 2013 -0800 Avoid memory leak in ddc resort() if find_header() fails Call find_header first, returning on failure before calling malloc. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit b1129a1f1771c9d1653cc15aae94a614f081638a Author: Alan Coopersmith Date: Sun Jan 27 14:00:54 2013 -0800 xf86XvMCScreenInit: Avoid leak if dixRegisterPrivateKey fails Found by parfait 1.1 memory analyser: Memory leak of pointer 'pAdapt' allocated with malloc((88 * num_adaptors)) at line 162 of hw/xfree86/common/xf86xvmc.c in function 'xf86XvMCScreenInit'. 'pAdapt' allocated at line 158 with malloc((88 * num_adaptors)). Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 563db909bcf965b6103c1807bf9f00ede957077d Author: Alan Coopersmith Date: Sun Jan 27 13:55:50 2013 -0800 Avoid memory leak on realloc failure in localRegisterFreeBoxCallback Also avoids leaving invalid pointers in structures if realloc had to move them elsewhere to make them larger. Found by parfait 1.1 code analyzer: Memory leak of pointer 'newCallbacks' allocated with realloc(((char*)offman->FreeBoxesUpdateCallback), (8 * (offman->NumCallbacks + 1))) at line 328 of hw/xfree86/common/xf86fbman.c in function 'localRegisterFreeBoxCallback'. 'newCallbacks' allocated at line 320 with realloc(((char*)offman->FreeBoxesUpdateCallback), (8 * (offman->NumCallbacks + 1))). newCallbacks leaks when newCallbacks != NULL at line 327. Memory leak of pointer 'newPrivates' allocated with realloc(((char*)offman->devPrivates), (8 * (offman->NumCallbacks + 1))) at line 328 of hw/xfree86/common/xf86fbman.c in function 'localRegisterFreeBoxCallback'. 'newPrivates' allocated at line 324 with realloc(((char*)offman->devPrivates), (8 * (offman->NumCallbacks + 1))). newPrivates leaks when newCallbacks == NULL at line 327. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 08f75d3a9661c6c32800e1b4f150626200b889d9 Author: Alan Coopersmith Date: Sun Jan 27 13:50:30 2013 -0800 Avoid NULL pointer dereference in xf86TokenToOptinfo if token not found Reported by parfait 1.1 code analyzer: Error: Null pointer dereference (CWE 476) Read from null pointer 'p' at line 746 of hw/xfree86/common/xf86Option.c in function 'xf86TokenToOptName'. Function 'xf86TokenToOptinfo' may return constant 'NULL' at line 721, called at line 745. Null pointer introduced at line 721 in function 'xf86TokenToOptinfo'. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit c1c01e350834a23161b33bd34b2fa9c01d02a65b Author: Alan Coopersmith Date: Sun Jan 27 13:10:08 2013 -0800 Make xf86ValidateModes actually copy clock range list to screen pointer Our in-house parfait 1.1 code analysis tool complained that every exit path from xf86ValidateModes() in hw/xfree86/common/xf86Mode.c leaks the storeClockRanges allocation made at line 1501 with XNFalloc. Investigating, it seems that this code to copy the clock range list to the clockRanges list in the screen pointer is just plain insane, and according to git, has been since we first imported it from XFree86. We start at line 1495 by walking the linked list from scrp->clockRanges until we find the end. But that was just a diversion, since we've found the end and immediately forgotten it, and thus at 1499 we know that storeClockRanges is NULL, but that's not a problem since we're going to immediately overwrite that value as the first thing in the loop. So we move on through this loop at 1499, which takes us through the linked list from the clockRanges variable, and for every entry in that list allocates a new structure and copies cp to it. If we've not filled in the screen's clockRanges pointer yet, we set it to the first storeClockRanges we copied from cp. Otherwise, as best I can tell, we just drop it into memory and let it leak away, as parfait warned. And then we hit the loop action, which if we haven't hit the end of the cp list, advances cp to the next item in the list, and then just for the fun of it, also sets storeClockRanges to the ->next pointer it has just copied from cp as well, even though it's going to overwrite it as the very first instruction in the loop body. v2: rewritten using nt_list_* macros from Xorg's list.h header Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 89badba082c81d20fe35cb064c16e131ff288ca3 Author: Alan Coopersmith Date: Sun Jan 27 12:08:47 2013 -0800 Free keymap on error in Xephyr's hostx_load_keymap Found by parfait 1.1 code analyser: Memory leak of pointer 'keymap' allocated with XGetKeyboardMapping(HostX.dpy, min_keycode, ((max_keycode - min_keycode) + 1), &host_width) at line 861 of hw/kdrive/ephyr/hostx.c in function 'hostx_load_keymap'. 'keymap' allocated at line 845 with XGetKeyboardMapping(HostX.dpy, min_keycode, ((max_keycode - min_keycode) + 1), &host_width). Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit 48b94651205b175760904e448f94111d1ab85e13 Author: Alan Coopersmith Date: Sun Jan 27 11:20:45 2013 -0800 Stop leaking overlayWin in PanoramiXCompositeGetOverlayWindow error paths Found by parfait 1.1 code analyzer: Error: Memory leak (CWE 401) Memory leak of pointer 'overlayWin' allocated with malloc(72) at line 806 of composite/compext.c in function 'PanoramiXCompositeGetOverlayWindow'. pointer allocated at line 794 with malloc(72). leaks when rc != 0 at line 804. at line 816 of composite/compext.c in function 'PanoramiXCompositeGetOverlayWindow'. pointer allocated at line 794 with malloc(72). leaks when pOc == NULL at line 815. at line 825 of composite/compext.c in function 'PanoramiXCompositeGetOverlayWindow'. pointer allocated at line 794 with malloc(72). leaks when cs->pOverlayWin == NULL at line 822 and compCreateOverlayWindow(pScreen) == 0 at line 823. at line 834 of composite/compext.c in function 'PanoramiXCompositeGetOverlayWindow'. pointer allocated at line 794 with malloc(72). leaks when rc != 0 at line 832. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit f4a9332ad149ed15353a9c482563bdd042d0b403 Author: Alan Coopersmith Date: Sun Jan 27 10:06:42 2013 -0800 Handle failure to create counter in init_system_idle_counter Check for NULL pointer (which can be returned for multiple reasons) before trying to dereference it to add privates. To avoid memory leak in error path, delay malloc of privates until we're ready to add them. In case we do return NULL up through SyncInitDeviceIdleTime, handle the possibility of getting NULL passed back down to SyncRemoveDeviceIdleTime. As reported by parfait 1.1: Error: Null pointer dereference (CWE 476) Read from null pointer 'idle_time_counter' at line 2764 of xserver/Xext/sync.c in function 'init_system_idle_counter'. Function 'SyncCreateSystemCounter' may return constant 'NULL' at line 952, called at line 2756. Null pointer introduced at line 952 in function 'SyncCreateSystemCounter'. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer 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 34a571c5b9781025897ba5e5c5e2a34ae5262266 Author: Dave Airlie Date: Wed Jan 9 13:04:00 2013 +1000 modesetting: bump to 0.6.0 commit 8650ff14a52047173fa32f12f22ec6f4e38ff433 Author: Dave Airlie Date: Wed Jan 9 12:48:30 2013 +1000 modesetting: fix crashes caused by udev race conditions So the kernel removes the device, and the driver processes the first udev event, and gets no output back from the kernel, so it check and don't fall over. This fixes a couple of crashes seen when hotplugging USB devices. Signed-off-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 0b198248ecfbcb7e7c61688145be4005366da23d Author: Thierry Reding Date: Thu Nov 8 14:28:10 2012 +0100 Remove call to miInitializeBackingStore() Recent versions of the X server no longer provide this function, which has been obsolete for over 2 years now. Signed-off-by: Thierry Reding Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie commit 739d6c067a9167226ce248aa82997bfc2cca7259 Author: Thierry Reding Date: Thu Nov 8 14:28:09 2012 +0100 build: Put m4 macros in m4 subdirectory This silences a warning from libtoolize when running the autogen.sh script. Signed-off-by: Thierry Reding Signed-off-by: Dave Airlie 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 e47ad8a0aec7662970e7f81e6ee487330bf094c1 Author: Dave Airlie Date: Mon Sep 17 11:48:14 2012 +1000 modesetting: remove alloca usage again this slipped back in. 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 f8eb8c1cb4f453bdbe6a81815be8ecefba2084aa Author: Alon Levy Date: Tue Aug 28 11:46:47 2012 +1000 modesetting: add virtual connector support [airlied: also make sure we don't crash in future.] Signed-off-by: Alon Levy Signed-off-by: Dave Airlie commit 5eb697d88f0735e98fe9a97770ddda83202b1597 Author: Maarten Lankhorst Date: Thu Sep 13 08:45:14 2012 +0200 bump version to 0.5.0 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 e3d7d5d18e3281677890064679af459e1af108cf Author: Adam Jackson Date: Thu Jul 19 22:15:10 2012 +0000 Implement ->driverFunc Copied from fbdev, makes it so we can run without iopl. Signed-off-by: Adam Jackson 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 02811f1a9cc35c5f82accb0459cb3910165e7e45 Author: Dave Airlie Date: Thu Jul 19 14:12:59 2012 +1000 modesetting: add output slave support. This allows the driver to operate as an output slave. It adds scan out pixmap, and the capability checks to make sure they available. Signed-off-by: Dave Airlie commit fa171c5a81b1c226b5da54f35e6726d9c8e13afb Author: Dave Airlie Date: Tue Jun 5 14:43:21 2012 +0100 modesetting: add platform bus support commit 709dbc68cdea9d282ba318c1cbc76614e98f41c4 Author: Dave Airlie Date: Wed Jul 25 15:38:34 2012 +1000 modesetting: fix warning about close being undefined. Signed-off-by: Dave Airlie commit 71b86ea8dd69f21d090edd4f61698ad11b952d5e Author: Dave Airlie Date: Wed Jul 25 15:33:52 2012 +1000 modesetting: drop useless xf86PciInfo include Signed-off-by: Dave Airlie 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 xfree86: EDID Est III parsing skips some modes This loop needs to count from 7 to 0, not only from 7 to 1. The current code always skips the modes {1152, 864, 75, 0}, {1280, 1024, 85, 0}, {1400, 1050, 75, 0}, {1600, 1200, 70, 0} and {1920, 1200, 60, 0}. Signed-off-by: Torsten Kaiser Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 0b3abacb6430e6593c4358420ba457d8149bd32b Author: Torsten Kaiser Date: Fri Jul 6 12:06:13 2012 -0700 xfree86: EDID Est III parsing can walk off end of array Using -O3 gcc notes that m could reach beyound the end of the EstIIIModes array, if the last bits of the 11s byte where set. Fix this, by extending the array to cover all possible bits from est. https://bugs.freedesktop.org/show_bug.cgi?id=45623 Signed-off-by: Torsten Kaiser Reviewed-by: Adam Jackson Signed-off-by: Keith Packard 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 cf196efa05bbefdeb43f6e6bcc5f6d9080fea715 Author: Dave Airlie Date: Fri Jun 22 15:24:43 2012 +0100 modesetting 0.4.0: bump configure.ac commit 30ab80ef5421fea9d9dd0779aa138892ff62bd6e Author: Dave Airlie Date: Fri Jun 22 15:26:28 2012 +0100 modesetting: pci probing requires interface version 1.4 Set the drm interface version to 1.4 so we get the bus id correctly. Signed-off-by: Dave Airlie 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 xfree86: always enable SIGIO on OsVendorInit (#50957) Drivers call xf86InstallSIGIOHandler() for their fd on DEVICE_ON. That function does not actually enable the signal if it was blocked to begin with. As a result, if one vt-switches away from the server (SIGIO is blocked) and then triggers a server regeneration, the signal remains blocked and input devices are dead. Avoid this by always unblocking SIGIO when we start the server. X.Org Bug 50957 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard 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: Thu Jun 21 11:25:24 2012 +1000 include: document _XkbErrCode2 macros 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. 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 Reviewed-by: Chase Douglas commit e1f86a7c77ed49e001ea42ef76ab83e87dbdf126 Author: Sergei Trofimovich Date: Mon Jun 18 01:13:21 2012 +0300 test/.gitignore: add hashtabletest Signed-off-by: Sergei Trofimovich Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer 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 randr: Don't recurse into mieqProcessInputEvents() from RRTellChanged(). Call UpdateCurrentTimeIf(), not UpdateCurrentTime(), from RRTellChanged(). The latter calls ProcessInputEvents(), which can trigger a recursion into mieqProcessInputEvents(). The former omits the call to ProcessInputEvents(). Signed-off-by: Andy Ritger Reviewed-by: Jeremy Huddleston Signed-off-by: Keith Packard commit 54476b5e4461ff523e935961affabcf0de12c556 Author: Peter Hutterer Date: Thu Jun 7 16:52:20 2012 +1000 dix: if the scroll valuator reaches INT_MAX, reset to 0 Too much scrolling down may eventually trigger an overflow of the valuator. If this happens, reset the valuator to 0 and skip this event for button emulation. Clients will have to figure out a way to deal with this, but a scroll event from (close to) INT_MAX to 0 is a hint of that it needs to be ignored. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas 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 May 9 09:21:28 2012 +1000 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 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 xkb: warn if XKB SlowKeys have been automatically enabled Slow keys are enabled when the XKB AccessX features are generally enabled (ctrls->enabled_ctrls & XkbAccessXKeysMask) and either shift key is held for 8 seconds. For the unsuspecting user this appears as if the keyboard suddenly stops working. Print a warning to the log, so we can later tell them "told you so". Signed-off-by: Peter Hutterer Reviewed-by: Dan Nicholson commit f20a532ba3c7b7d74530f3906c7bacf016bb8faf Author: Alan Coopersmith Date: Sun May 20 00:00:59 2012 -0700 Fix statement not reached warning in _DMXXineramaActive Signed-off-by: Alan Coopersmith Reviewed-by: Mark Kettenis commit 1be317c4e5d99d11a124ad4e7a90a5dcae591e20 Author: Alan Coopersmith Date: Wed May 23 19:27:23 2012 -0700 Provide prototypes for Mmio functions for Solaris Studio on SPARC Actual inline implementations are provided via external *.il files generated from *.S files in hw/xfree86/os-support/solaris 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 ec79187d9a23ba30eafc7ba225049559e6bcb78d Author: Dave Airlie Date: Tue Jun 5 14:41:18 2012 +0100 modesetting: workaround kernel bug reporting 0x0 as valid mins It reports these but then you can't create a 0 sized bo. Signed-off-by: Dave Airlie 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 commit 3476eb38063473a7a5fcd78e2095e284118de839 Merge: 78f0d9c 42ae2e8 Author: Keith Packard Date: Sun Jun 3 20:24:24 2012 -0700 Merge remote-tracking branch 'whot/for-keith' commit 42ae2e8199fe875319978249963de7499607988b Author: Siddhesh Poyarekar Date: Tue May 29 10:17:50 2012 +0530 xkb: Allocate size_syms correctly when width of a type increases The current code seems to skip syms with width less than type->num_levels when calculating the total size for the new size_syms. This leads to less space being allocated than necessary during the next phase, which is to copy over the syms to the new location. This results in an overflow leading to a crash. Signed-off-by: Siddhesh Poyarekar Signed-off-by: Peter Hutterer commit 88c767edb01ed7efb19ffe3a453e16107b27130b Author: Michal Suchanek Date: Wed May 23 11:22:05 2012 +0200 Fix crash for motion events from devices without valuators A WarpPointer request may trigger a motion event on a device without valuators. That request is ignored by GetPointerEvents but during smooth scroll emulation we dereference dev->valuators to get the number of axes. Break out early if the device doesn't have valuators. Signed-off-by: Michal Suchanek Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit e07c945ab992b1b1acdd9f5554e0688f744e4769 Author: Dave Airlie Date: Fri Jun 1 12:34:42 2012 +0100 modesetting: bump to latest X server compat api. Signed-off-by: Dave Airlie commit 78f0d9cdc441a575e15e5f7200ce74750d2f7ad2 Author: Chad Versace Date: Wed May 2 16:18:49 2012 -0700 dri2: Add DRI2GetParam request (v2) 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 Reviewed-by: Christopher James Halse Rogers commit 23612a63fc12be13442a63193a19f883d7a87e5d Author: Ian Romanick Date: Fri Dec 16 14:42:51 2011 -0800 glx: Make several functions available outside the glxcmds.c compilation unit validGlxScreen, validGlxFBConfig, validGlxContext, and __glXdirectContextCreate will soon be used by createcontext.c. Signed-off-by: Ian Romanick Reviewed-by: Dave Airlie Reviewed-by: Christopher James Halse Rogers 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 1c01090f6485cb82c2511fb461e66ff15a097358 Author: Dave Airlie Date: Wed May 23 11:31:39 2012 +0100 modesetting: fix make distcheck add missing compat header file. Signed-off-by: Dave Airlie commit ef47a1b3bfec33d4031af2e01bdd46d634be2f51 Author: Dave Airlie Date: Wed May 23 11:21:55 2012 +0100 modesetting: convert to new scrn conversion APIs. Generated with util/modular/x-driver-screen-scrn-conv.sh Signed-off-by: Dave Airlie commit 3e46d578d8c40c95343278db0a66c931e85247c7 Author: Dave Airlie Date: Wed May 23 11:21:39 2012 +0100 modesetting: add compat header file Signed-off-by: Dave Airlie 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 Undocument Font Module loading Code was deleted in commit affec10635343668839994ea2bac16c1d4524200 Signed-off-by: Alan Coopersmith Reviewed-by: Dave Airlie Reviewed-by: Adam Jackson commit afcb7ba24ebd9968d48a192df438e7f1c0ecb770 Author: Alan Coopersmith Date: Fri Apr 27 13:31:56 2012 -0700 Undocument mandatory loadable modules The code to implement was deleted when BaseModules[] was emptied by the replacement of the "pcidata" module with libpciaccess calls in commit 46f55f5dead5d70cdff30531d80a72f6be042315. Signed-off-by: Alan Coopersmith Reviewed-by: Dave Airlie Reviewed-by: Adam Jackson 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 XQuartz: Avoid a race in initialization of darwinPointer http://xquartz.macosforge.org/trac/ticket/579 Signed-off-by: Jeremy Huddleston 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 XQuartz: Provide fls implementation for Tiger Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16 Signed-off-by: Jeremy Huddleston commit e0097ce9719f9b0aeccf7102630c0299f8acdf93 Author: Jeremy Huddleston Date: Mon May 7 16:31:38 2012 -0700 XQuartz: Tiger build fix http://trac.macports.org/ticket/34364 Regression-from: 662d41acdde1dcb9774fbe4054e251c708acaffe Reported-by: Peter Dyballa Signed-off-by: Jeremy Huddleston 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 commit ae1c48ebc8a3c0b32b3d732e8a340bfe00bb9f79 Author: Peter Hutterer Date: Wed May 16 10:54:48 2012 +1000 Xi: fix "discards ''const' qualifier" warnings 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] property.c: In function 'XIChangeDeviceProperty': xiproperty.c:757:39: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] 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 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 commit 31174565ec0090b4c03c9334c82878be2455f938 Author: Michal Suchanek Date: Wed Apr 25 15:03:31 2012 +0200 dix: Remove redundant declarations. Signed-off-by: Michal Suchanek Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie 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 e8da587845978ad66c3b3e2e085fd99c16b5d3c8 Author: Dave Airlie Date: Wed May 9 09:33:54 2012 +0100 bump version to 0.3.0 commit 62543946490e7decae4f6549d83072f004e850d4 Author: Matt Turner Date: Wed May 9 00:26:29 2012 -0400 configure.ac: remove DRI and RENDER Driver doesn't support either of these. Signed-off-by: Matt Turner Signed-off-by: Dave Airlie commit 7dc22b7911ac3d5c131075903e3fbf52c58eac15 Author: Dave Airlie Date: Wed May 9 09:32:05 2012 +0100 modesetting: make sure the pci device corresponds to the drm device If we get asked to pci open a device with a kms path override, make sure they match, otherwise this driver can steal the primary device binding for a usb adaptor. The driver should fallback to the old probe entry point in this case. Signed-off-by: Dave Airlie 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 os/log: refactor logging It is not safe to ever use an arbitrary (possibly user supplied) string as part of the format for a *sprintf() call. For example: 1. Name a Bluetooth keyboard "%n%n%n%n%n%n%n%n" 2. Pair it with a computer running X and try to use it 3. X is not happy when trying to do the following in xf86-input-evdev: xf86IDrvMsg(pInfo, X_CONFIG, "Device: \"%s\"\n", device); because LogVHdrMessageVerb() has put the %n from the device name into a format string of the form: "evdev: %n%n%n%n%n%n%n%n: Device: \"%s\"\n" Instead, build up a log message in place by appending successive formatted strings by sncprintf'ing to the end of the previous. Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 6ce0eac4f8a05f6d7401445cab95027709d3a479 Author: Daniel Kurtz Date: Wed Apr 18 17:51:52 2012 +0800 os/log: only write timestamp if a message is actually written to logfile The current code will write a timestamps into the logFile whenever the last message ended with a '\n' - even if the verb for that timestamp is at too high a level. This timestamp will sit there with no matching message until the next call to LogVWrite with a valid verb. In other words, in some cases, timestamps in the X.org.log are for some completely unrelated message that was previously ignored due to insufficient verbosity, and not for the message that appears next to it in the log file. We keep the current policy which appears to be to only apply timestamps if a message is actually written to a log file. That is, no timestamps on stderr, or in the mem buffer. Therefore, the timestamp stringification is moved to the conditional where it is used. Since logging uses a fixed length buffer, this patch also forces a '\n' whenever a buffer is terminated due to a too-long write request. This allows the newline detection to work even on overflow, and also cleans up the log a bit in the overflow case. Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 5c2e2a164d615ab06be28a663734e782614b5cc7 Author: Daniel Kurtz Date: Wed Apr 18 09:51:51 2012 +0000 os/xprintf: add Xvscnprintf and Xscnprintf Normal snprintf() usually returns the number of bytes that would have been written into a buffer had the buffer been long enough. The scnprintf() variants return the actual number of bytes written, excluding the trailing '\0'. Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit c30862879d2c766519780bb7f353f35edf0daa9b Author: Daniel Kurtz Date: Wed Apr 18 17:51:50 2012 +0800 os/log: trivial cleanups * space->tab * remove comment that doesn't make any sense Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 97041364a6acb2b66b5cfd06757c90a006ad50e9 Merge: 1908272 ee542b8 Author: Keith Packard Date: Wed May 2 20:47:25 2012 -0700 Merge remote-tracking branch 'whot/for-keith' No conflicts here commit ee542b85590814ee25369babce1ad14feeb137af Author: Chase Douglas Date: Tue May 1 10:21:12 2012 -0700 Report touch emulated buttons in XIQueryPointer for XI 2.1 and earlier 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: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 19082726cb2c69f53e9720904521e3c98f788bff Author: Ryan Pavlik Date: Fri Oct 21 12:47:38 2011 -0500 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 Reviewed-by: Peter Hutterer commit d063f64b5c8c8c27fca41163c93dbca06a774d1c Author: Dave Airlie Date: Tue May 1 17:12:29 2012 +0100 modesetting: attempt to work out if we want 24 or 32bpp the cirrus driver presents certain challenges, and this is a workaround, until we can possibly agree some sane interface for exposing this information. Signed-off-by: Dave Airlie commit 0426e6d65b6598edfbcb2fc66ee65fb08256469e Author: Jon TURNEY Date: Tue Jan 3 00:14:32 2012 +0000 configure.ac: Make default configuration for MinGW disable unsupported extensions and DDXs Same as the default configuration for Cygwin, --disable-xorg and --disable-dmx DDX by default, and force --disable-xv and other unsupported extensions Signed-off-by: Jon TURNEY Reviewed-by: Yaakov Selkowitz commit 610f532e6a3d934c473d2d16dff95f582285b2eb Author: Dave Airlie Date: Tue May 1 16:52:18 2012 +0100 modesetting: move opening kernel device to before setting depth due to interaction between option handling and set depth, we need to what fbdev does to get the device path early. Signed-off-by: Dave Airlie commit f3410b97cf9b48a47bee3d15d232f8a88e75f4ef Author: Peter Hutterer Date: Mon Apr 30 10:01:48 2012 +1000 dix: when disabling a device, release all buttons and keys A suspend-induced device disable may happen before the device gets to see the button release event. On resume, the server's internal state still has some buttons pressed, causing inconsistent behaviour. Force the release and the matching events to be sent to the client. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit af88b43f9e604157b74270d609c08bdfa256a792 Author: Peter Hutterer Date: Fri Apr 27 16:31:17 2012 +1000 dix: don't emulate scroll events for non-existing axes (#47281) Test case: - create a device with REL_HWHEEL and ABS_X and ABS_Y. evdev 2.7.0 will set that up as device with 1 relative axis - move pointer to VGA1 - xrandr --output VGA1 --off Warps the pointer to the new spot and calls GPE with the x/y mask bits set. When running through the loop to check for scroll event, this overruns the axes and may try to emulate scroll events based on random garbage in the memory. If that memory contained non-zero for the scroll type but near-zero for the increment field, the server would hang in an infinite loop. This was the trigger for this suggested, never-merged, patch here: http://patchwork.freedesktop.org/patch/9543/ X.Org Bug 47281 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 08962951de969b9d8c870af8b6e47303dc0decfd Author: Peter Hutterer Date: Fri Apr 27 10:52:39 2012 +1000 os: make timers signal-safe If TimerSet() is called from a signal handler (synaptics tap handling code) may result in list corruption if we're currently inside TimerSet(). See backtrace in https://bugzilla.redhat.com/show_bug.cgi?id=814869 Block signals for all list manipulations in the timers. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas 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 TouchListenerAcceptReject: Warn and return early on bad listener index Signed-off-by: Chase Douglas Reviewed-by: Bryce Harrington Signed-off-by: Peter Hutterer 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 xfree86: workaround crash on close Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41653 Signed-off-by: Michal Suchanek Reviewed-by: Jeremy Huddleston Tested-by: Knut Petersen commit adcb48a29dcb3f32ff570551de4b014775c1e147 Author: Jonas Maebe Date: Sun Apr 22 20:52:47 2012 -0700 glapi: Correct size of allocated _glapi_table struct The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct as an array of _glapi_get_dispatch_table_size() pointers, so we have to allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather than sizeof(struct _glapi_struct) bytes. Signed-off-by: Jonas Maebe Reviewed-by: Jeremy Huddleston commit e34519e525559b01a63d26639f13f0487468de28 Author: Jeremy Huddleston Date: Thu Apr 19 16:38:06 2012 -0700 XQuartz: darwinPointer now sends both absolute and relative motion This should hopefully help out wine clients that were continuing to have issues after the earlier changes. http://xquartz.macosforge.org/trac/ticket/548 Signed-off-by: Jeremy Huddleston commit 662d41acdde1dcb9774fbe4054e251c708acaffe Author: Jeremy Huddleston Date: Thu Apr 19 18:48:22 2012 -0700 XQuartz: Add a hack to better handle clicky wheel scroll mice We loose information from AppKit being in our way. Before adopting smooth scrolling, we always rounded-up the number of scroll button clicks per NSEvent. Now, the scroll value is accumulated in the dix, and clicky scroll wheels with legacy X11 clients are seeing an accumulation of error due to so many translations (button press to smooth scrolling value in AppKit, passed to the dix, and then synthesized into a button press). This attempts to make the situation better. http://xquartz.macosforge.org/trac/ticket/562 Signed-off-by: Jeremy Huddleston 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 commit b99586c9086ac29df144ef75df92f8c0c7554651 Author: Jeremy Huddleston Date: Wed Apr 18 17:50:55 2012 -0700 XQuartz: Separate out tablet and mouse event delivery into separate functions This should have no immediate impact aside from fake mouse buttons no longer working with tablets (where they aren't needed or desired anyways). This prepares us for future changes. Signed-off-by: Jeremy Huddleston commit 30623d6ff7bca223f9e1a825e86bd317eef8bf16 Author: Jeremy Huddleston Date: Thu Apr 19 16:06:45 2012 -0700 XQuartz: Correct calculation of the size of our file descriptor array in console_redirect Reported-by: Joe Rohde Signed-off-by: Jeremy Huddleston commit b4c4c65a35640e7274ccd4228f62110147878b72 Author: Jeremy Huddleston Date: Wed Apr 18 01:01:44 2012 -0700 XQuartz: Fix a deadlock in pre-dispatch code The fact that this has been in place so long makes me really wonder if anybody cares about this running in Tiger or Leopard. Signed-off-by: Jeremy Huddleston 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 Replay original touch begin event instead of generated begin event The generated event does not have axes other than X and Y and has a newer timestamp. In particular, the newer timestamp may be newer than the real touch end event, which may be stuck in the syncEvents queue. If a client uses the timestamps for grabbing bad things may happen. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 312910b4e34215aaa50fc0c6092684d5878dc32f Author: Chase Douglas Date: Wed Apr 18 11:15:40 2012 -0700 Update currentTime in dispatch loop A request, like input device grabs, may check a request timestamp against currentTime. It is possible for currentTime to lag a previously sent event timestamp. If the client makes a request based on such an event timestamp, the request may fail the validity check against currentTime unless we always update the time before processing the request. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit a986f2f30cbe2a00e72ded7315c4951d7703e549 Author: Chase Douglas Date: Tue Apr 17 11:40:15 2012 -0700 Update device state including when touch record does not exist If a touch is physically active, the pointer core state should reflect that the first button is pressed. Currently, this only occurs when there are active listeners of the touch sequence. By moving the device state updating to the beginning of touch processing we ensure it is updated according to the processed physical state no matter what. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit ec9c4295830c3de610e65aca17f4da4a7af3c4c5 Author: Chase Douglas Date: Wed Apr 18 12:04:58 2012 -0700 Check other clients' core masks properly when adding touch listener The current code checks the core event mask as though it were an XI mask. This change fixes the checks so the proper client and event masks are used. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit e175971a6f44d94aa8306dc6b9228ccb2c8a0b4d Author: Chase Douglas Date: Tue Apr 17 11:39:10 2012 -0700 Ensure touch is ended when last listener is rejected Currently, the touch is only logically ended if the touch has physically ended. If the touch hasn't physically ended, the touch record is never ended. If there aren't any more listeners, we don't need to keep the dix touch record around any more. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit d0449851d1233543c3133d77e0ab7233319cdf5f Author: Chase Douglas Date: Tue Apr 17 10:49:14 2012 -0700 Create a new dix touch record for an emulated touch with no listeners As a special case, if a still physically active pointer emulated touch has no listeners and the device is explicitly grabbed for pointer events, create a new dix touch record for the grab only. This allows for clients to "hand off" grabs. For example, when dragging a window under compiz the window decorator sees the button press and then ungrabs the implicit grab. It then tells compiz to grab the device, and compiz then moves the window with the pointer motion. This is racy, but is allowed by the input protocol for pointer events when there are no other clients with a grab on the device. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 3d06bfe93d33cfe6150d8fb0058ee7bc8d80622b Author: Chase Douglas Date: Tue Apr 17 13:56:08 2012 -0700 Rename TouchEnsureSprite to TouchBuildSprite and event type checks The function will be used for building a sprite for pointer emulation after an explicit device grab. This commit refactors the code so that TouchBuildSprite will function with any event type and moves the checks to the caller. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 2efbed23c29020f9994ab7c3155ce7386950dc7a Author: Chase Douglas Date: Tue Apr 17 08:39:38 2012 -0700 When activating an explicit grab, update owning listener Pointer passive grabs may be changed by the grabbing client. This allows for a selecting client to change an implicit grab to an active grab, which is the mechanism used for pop-up windows like application menus. We need to do the same thing with touches. If the grabbing client is the owner of a touch sequence, change the listener record to reflect the new grab. If the grabbing client is not the owner, nothing changes for the touch. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit ef64b5ee97099618cf2e2cbbd3e471095695ae24 Author: Chase Douglas Date: Mon Apr 16 15:53:51 2012 -0700 Don't deactivate implicit pointer grab on fake touch end event Fake touch end events are generated by touch acceptance and rejection. These should not cause implicit pointer grabs to be deactivated. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit fc518cd9f59060cc19bb90361767c0f47f0e25eb Author: Chase Douglas Date: Mon Apr 16 15:31:47 2012 -0700 End a pointer emulated touch event only on a "real" end event Fake end events are generated by touch acceptance or rejection. These should not end the touch point. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 80d7d1ec6a9d61aa96e7d019dc1bee29d90cea34 Author: Chase Douglas Date: Mon Apr 16 14:19:59 2012 -0700 On touch accept, only process end event for owner if it has seen the end We still need to generate the touch ownership event to process the ending of the touch event in the case where the owner has the end already. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 8dfd98245d2c44a1eb4c8b7c275e6cfc10fe40f1 Author: Chase Douglas Date: Wed Apr 11 11:14:51 2012 -0700 Fix copy/paste error from before git history in UpdateCurrentTimeIf() See UpdateCurrentTime() for reference. I don't know what bug this might trigger, but it wouldn't hurt to fix this. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 6ca30cb33e829b4edd01822367e44ffe6f0951b0 Author: Chase Douglas Date: Wed Apr 11 08:17:25 2012 -0700 When deactivating an explicit pointer grab, reject all grabs on touches Explicit pointer grabs are placed at the head of the touch listener array for pointer emulated touches. If the grab is deactivated, we must remove it from all touches for the device. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit cacdb9a74065ccba7d50a82e14abdf04b36c5309 Author: Chase Douglas Date: Wed Apr 11 08:13:17 2012 -0700 Accept touch sequence for pointer listener after second event delivery This is a bit of unimplemented code for touchscreen pointer emulation. A pointer grabbing client currently never accepts the touch sequence. The sequence must be accepted once any touch-derived event is irrevocably delivered to a client. The first pointer event, derived from a touch begin event, may be caught in a sync grab and then replayed. This is essentially a revocable delivery of an event. Thus, we must wait till a non-begin event is delivered. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 447fe7a1a72513aa68145962c47894242c589cc9 Author: Chase Douglas Date: Wed Apr 11 08:12:08 2012 -0700 Split out helper function TouchListenerAcceptReject() This will be used for accepting and rejecting touches in the future. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer commit 93c33403642a3de3c9d141ad7940a7b880846aad Author: Chase Douglas Date: Wed Apr 4 12:59:55 2012 -0700 Only set XI2 mask if pointer emulation is for XI2 client The current code returns a reference to memory that may not actually be an XI2 mask. Instead, only return a value when an XI2 client has selected for events. Signed-off-by: Chase Douglas Reviewed-by: Jeremy Huddleston Acked-by: Peter Hutterer commit 4c1dfd21937efc6a85fb204a73dd7d7151d54daa Author: Chase Douglas Date: Wed Apr 4 12:57:40 2012 -0700 Check core event mask properly for pointer emulated touch events The current code checks the core event mask as though it were an XI2 mask. This change fixes the checks so the proper client and event masks are used. Signed-off-by: Chase Douglas Reviewed-by: Jeremy Huddleston Acked-by: Peter Hutterer 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 00c663a3bc76d567ad7edd6d6ef3f7f725b5df3a Author: Dave Airlie Date: Tue Apr 17 11:50:40 2012 +0100 modesetting: add set/drop master around VT switch commit 001dec898098e11c569abc20a307b3c2af2e2184 Author: Dave Airlie Date: Tue Apr 17 11:48:03 2012 +0100 cursor: hide cursors on LeaveVT 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 Use touch state when querying pointer through core protocol QueryPointer is part of the core protocol. As such, it knows nothing about touch devices. Touches are converted to button 1 press, pointer motion, and button 1 release for core clients, so we should ensure the pointer state mask has button 1 set when XQueryPointer is used. Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer commit 32ece7c09bf0ebc3d99b4078aacebbd44314776a Author: Chase Douglas Date: Tue Apr 10 17:12:42 2012 -0700 Ensure sequential touches are pointer emulated sequentially Issue: * Two sequential touches (i.e. down, up, down, up) * Both are grabbed by a touch grab * Both have a second listener in the form of a pointer grab or selection * The second and first touches are rejected in that order The first touch must be pointer emulated before the second touch, so the second touch must be paused until the first touch is rejected or accepted and all events are delivered to pointer clients. This change ensures all pointer emulated events are emitted sequentially. It necessarily imposes a delay on further touch events when pointer grabs and selections are used, but there is no way around it. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 163b0f375d73c05873fb341652de3ed347337828 Author: Chase Douglas Date: Tue Apr 10 17:12:41 2012 -0700 Update event type when delivering end event to a pointer listener Just like when we deliver to a touch listener, we must convert a touch end event to an update event for further clients. This also ensures that the touch record is not deleted at the end of ProcessTouchEvent(). Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 210cd12c47d063f97915ff23292b61d09abfd73a Author: Chase Douglas Date: Tue Apr 10 17:12:40 2012 -0700 Don't update listener after deactivating implicit pointer grab After the pointer grab is deactivated, the touch listener record is updated at the end of DeliverTouchEmulatedEvent. However, the touch record is ended when the grab is deactivated, so the update to the listener record is in an array of memory that has been freed. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 82a1ae0af3b136371638659c3e909880a99f721c Author: Peter Hutterer Date: Thu Apr 12 15:54:00 2012 +1000 xfree86: after VT switching back, only enable previously enabled devices 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: Chase Douglas Reviewed-by: Daniel Stone commit d5d5b407436dfdbffcd56bbefecf17d11750dddf Author: Dave Airlie Date: Sat Apr 14 19:21:47 2012 +0100 dirty: check malloc return Suggested by keithp. Signed-off-by: Dave Airlie commit 6c1b5cb903f2ff9cb915273835c301d6ac255f45 Author: Dave Airlie Date: Sat Apr 14 15:01:16 2012 +0100 drop use of alloca, just use malloc/free Reported-by: Alan Coopersmith Signed-off-by: Dave Airlie commit c5a45b0f7658c77725adce2b64a0fbd62f208328 Author: Daniel Kurtz Date: Thu Apr 12 10:11:10 2012 +1000 dix: don't BUG_WARN for button events from button-only device 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. 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 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 55f552adb651715d2620db7248cd5b9b8187654a. 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 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 Implement passive touch ungrabbing Whoops. Forgot to implement this. The code currently generates an error due to the unhandled grab type. X.Org Bug 48069 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit e9d3848d7bda7f7de4c0f497aee4482d0b30ad49 Author: Jeremy Huddleston Date: Thu Apr 5 14:03:35 2012 -0700 XQuartz: Automatically start our virtual tablet devices Fixes: https://bugs.launchpad.net/inkscape/+bug/972914 Regression introduced by: 7790dc86384cc451ac44663737fde84dd81ad4e1 Signed-off-by: Jeremy Huddleston commit 6cb83b78c47b80556cb4d573524d60f0cd1a64ac Author: Jeremy Huddleston Date: Fri Mar 30 14:29:48 2012 -0700 XQuartz: Tiger build fix Fixes: https://trac.macports.org/ticket/33818 Signed-off-by: Jeremy Huddleston 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 xfree86: workaround crash on close Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41653 Signed-off-by: Michal Suchanek Reviewed-by: Jeremy Huddleston commit 641a1b9363d59808d2586f9e84847ccc69701482 Author: Peter Hutterer Date: Mon Mar 26 10:34:34 2012 +1000 test: reset the client before checking the swapped version 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 Tested-by: Jeremy Huddleston commit 17f33ca0e5bff45a2d03e4d3b4753a714ce25baf Author: Peter Hutterer Date: Mon Mar 26 10:28:32 2012 +1000 test: init the sync extensions for tests to pass again Introduced in d645edd11e7482f98c8b7e0d6c8693285c484907 Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston commit 8053faa7b81520b0a46459ba6e3b98f2599d5bbf Author: Peter Hutterer Date: Fri Mar 23 08:20:22 2012 +1000 Bump input ABI to 17 for per-device idlecounters Signed-off-by: Peter Hutterer 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 XQuartz: Use scrolling valuators This lets use send more accurate data to Xi clients and uses dix for legacy scroll buttons rather than reinventing the wheel. Signed-off-by: Jeremy Huddleston Acked-by: Peter Hutterer commit 7790dc86384cc451ac44663737fde84dd81ad4e1 Author: Jeremy Huddleston Date: Sun Mar 25 22:30:55 2012 -0700 XQuartz: Use AllocDevicePair to allocate our keyboard and mouse at the same time Also correct isMaster to FALSE while we're here. Signed-off-by: Jeremy Huddleston Acked-by: Peter Hutterer commit 74fb534bf15687610367248071341fe4bfd1d8bf Author: Jeremy Huddleston Date: Sun Mar 25 22:16:22 2012 -0700 XQuartz: Call update_desktop_dimensions() after updating our screen coordinates Fixes: http://xquartz.macosforge.org/trac/ticket/555 Regression from: 8bebb4b4896d8b6ba3309b5b28fce883bb9f8a96 Signed-off-by: Jeremy Huddleston Acked-by: Peter Hutterer commit 41a46546e92b66fed323b5845dd71a6385feb418 Author: Jeremy Huddleston Date: Sun Mar 25 23:05:43 2012 -0700 XQuartz: Formatting cleanup for sendX11NSEvent Signed-off-by: Jeremy Huddleston commit 5324557c7b12dcacddac830bdb65769cb622c6cf Author: Jeremy Huddleston Date: Fri Mar 23 19:58:49 2012 -0700 XQuartz: Source formatting cleanup indent butchered Objective-C formatting. This patch was created by: 1) Reverting the indent changes in hw/xquartz 2) Editing X11Application.m and chaning some #ifdef logic to work with uncrustify 3) Hand edited some (c) notifications 4) Opened all XQuartz sources in XCode and re-indented (^I) 5) Ran uncrustify with this configuration (as close to the indent rules as I could get): tok_split_gte=false utf8_byte=true utf8_force=true indent_cmt_with_tabs=false indent_align_string=false indent_braces=false indent_braces_no_func=false indent_braces_no_class=false indent_braces_no_struct=false indent_brace_parent=false indent_namespace=false indent_extern=false indent_class=false indent_class_colon=false indent_else_if=false indent_var_def_cont=false indent_func_call_param=false indent_func_def_param=false indent_func_proto_param=false indent_func_class_param=false indent_func_ctor_var_param=false indent_template_param=false indent_func_param_double=false indent_relative_single_line_comments=false indent_col1_comment=false indent_access_spec_body=false indent_paren_nl=false indent_comma_paren=false indent_bool_paren=false indent_first_bool_expr=false indent_square_nl=false indent_preserve_sql=false indent_align_assign=true sp_balance_nested_parens=false align_keep_tabs=false align_with_tabs=false align_on_tabstop=false align_number_left=false align_func_params=false align_same_func_call_params=false align_var_def_colon=true align_var_def_attribute=true align_var_def_inline=true align_right_cmt_mix=false align_on_operator=false align_mix_var_proto=false align_single_line_func=false align_single_line_brace=false align_nl_cont=false align_left_shift=true align_oc_decl_colon=true nl_collapse_empty_body=true nl_assign_leave_one_liners=true nl_class_leave_one_liners=true nl_enum_leave_one_liners=true nl_getset_leave_one_liners=true nl_func_leave_one_liners=true nl_if_leave_one_liners=true nl_multi_line_cond=false nl_multi_line_define=false nl_before_case=true nl_after_case=true nl_after_return=false nl_after_semicolon=true nl_after_brace_open=true nl_after_brace_open_cmt=false nl_after_vbrace_open=false nl_after_vbrace_open_empty=false nl_after_brace_close=false nl_after_vbrace_close=false nl_define_macro=false nl_squeeze_ifdef=false nl_ds_struct_enum_cmt=false nl_ds_struct_enum_close_brace=false nl_create_if_one_liner=false nl_create_for_one_liner=false nl_create_while_one_liner=false ls_for_split_full=false ls_func_split_full=false nl_after_multiline_comment=false eat_blanks_after_open_brace=false eat_blanks_before_close_brace=false mod_full_brace_if_chain=false mod_pawn_semicolon=false mod_full_paren_if_bool=false mod_remove_extra_semicolon=false mod_sort_import=false mod_sort_using=false mod_sort_include=false mod_move_case_break=false mod_remove_empty_return=false cmt_indent_multi=true cmt_c_group=false cmt_c_nl_start=false cmt_c_nl_end=false cmt_cpp_group=false cmt_cpp_nl_start=false cmt_cpp_nl_end=false cmt_cpp_to_c=false cmt_star_cont=false cmt_multi_check_last=true cmt_insert_before_preproc=false pp_indent_at_level=false pp_region_indent_code=false pp_if_indent_code=false pp_define_at_level=false indent_columns=4 indent_brace=0 indent_switch_case=0 align_struct_init_span=2 align_pp_define_gap=0 align_pp_define_span=2 align_oc_msg_colon_span=16 nl_end_of_file_min=1 nl_func_var_def_blk=0 code_width=78 nl_max=2 newlines=auto indent_with_tabs=0 sp_arith=force sp_assign=force sp_assign_default=force sp_before_assign=force sp_after_assign=force sp_enum_assign=force sp_enum_before_assign=force sp_enum_after_assign=force sp_pp_stringify=add sp_bool=force sp_compare=force sp_inside_paren=remove sp_paren_paren=remove sp_paren_brace=force sp_before_ptr_star=ignore sp_before_unnamed_ptr_star=force sp_before_byref=force sp_before_unnamed_byref=force sp_after_byref=remove sp_after_type=force sp_before_sparen=force sp_inside_sparen=remove sp_inside_sparen_close=remove sp_after_sparen=force sp_sparen_brace=force sp_special_semi=force sp_before_semi=remove sp_after_semi=force sp_after_semi_for=force sp_after_semi_for_empty=remove sp_before_square=remove sp_inside_square=remove sp_after_comma=force sp_before_comma=remove sp_paren_comma=force sp_before_ellipsis=force sp_after_class_colon=force sp_before_class_colon=force sp_before_case_colon=remove sp_after_cast=remove sp_inside_paren_cast=remove sp_sizeof_paren=remove sp_inside_braces_enum=force sp_inside_braces_struct=force sp_inside_braces=force sp_inside_braces_empty=remove sp_func_proto_paren=remove sp_func_def_paren=remove sp_inside_fparens=remove sp_inside_fparen=remove sp_square_fparen=remove sp_fparen_brace=force sp_func_call_paren=remove sp_func_call_paren_empty=remove sp_return_paren=force sp_attribute_paren=remove sp_defined_paren=remove sp_macro=force sp_macro_func=force sp_else_brace=force sp_brace_else=force sp_brace_typedef=force sp_not=remove sp_inv=remove nl_start_of_file=remove nl_end_of_file=force nl_assign_square=remove nl_after_square_assign=remove nl_fcall_brace=remove nl_enum_brace=remove nl_struct_brace=remove nl_union_brace=remove nl_if_brace=remove nl_brace_else=force nl_elseif_brace=remove nl_else_brace=remove nl_else_if=remove nl_for_brace=remove nl_do_brace=remove nl_brace_while=remove nl_switch_brace=remove nl_case_colon_brace=force nl_func_type_name=force nl_func_type_name_class=force nl_func_proto_type_name=force nl_func_paren=remove nl_func_def_paren=remove nl_func_decl_start=remove nl_func_def_start=remove nl_func_decl_args=remove nl_func_decl_end=remove nl_func_def_end=remove nl_func_decl_end_single=remove nl_func_def_end_single=remove nl_func_decl_empty=remove nl_func_def_empty=remove nl_fdef_brace=force nl_return_expr=remove nl_before_if=ignore nl_after_if=ignore nl_before_for=ignore nl_after_for=ignore nl_before_while=ignore nl_after_while=ignore nl_before_switch=ignore nl_after_switch=ignore nl_before_do=ignore nl_after_do=ignore pp_space=remove Signed-off-by: Jeremy Huddleston commit 3505e1faadddeeec85a0d3f823c877ea33f86e00 Author: Jeremy Huddleston Date: Fri Feb 17 13:15:12 2012 -0800 XQuartz: Detect FatalErrors on startup to prevent tight crash loops 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. 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 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 XQuartz: Add a defaults option to disable the RENDER extension RENDER has some ugly issues on XQuartz, so add an option to disable RENDER. Enables workaround for: https://bugs.freedesktop.org/show_bug.cgi?id=26124 Signed-off-by: Jeremy Huddleston 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 commit cd84c0949a9f397d8b803d3b87c9d02b260d4795 Author: Jeremy Huddleston Date: Sat Mar 17 00:08:19 2012 -0700 XQuartz: Xi: darwinPointer is now Relative There is really no real reason why this should be necessary, but wine developers are stuborn, so doing this to try to work around this wine issue: http://bugs.winehq.org/show_bug.cgi?id=29732 Signed-off-by: Jeremy Huddleston 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 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 0e8ee1cf4f3377a2916c43527ae0dc6cb07a67ec Author: Dave Airlie Date: Fri Mar 23 14:54:05 2012 +0000 modesetting: fix build against older Xext 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 Indentation: Change '& stuff' to '&stuff' If the typedef wasn't perfect, indent would get confused and change: foo = (SomePointlessTypedef *) &stuff[1]; to: foo = (SomePointlessTypedef *) & stuff[1]; Fix this up with a really naïve sed script, plus some hand-editing to change some false positives in XKB back. Signed-off-by: Daniel Stone commit 58b1f739d73b03ff7952ca986ed8746a7307fffe Author: Daniel Stone Date: Thu Mar 15 15:13:51 2012 +0000 Xinerama: Fix up obnoxiously-indented code Comments inside of conditionals confuse indent to death. Which is fair enough really. Signed-off-by: Daniel Stone commit 9838b7032ea9792bec21af424c53c07078636d21 Author: Keith Packard Date: Wed Mar 21 12:55:09 2012 -0700 Introduce a consistent coding style This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard Acked-by: Daniel Stone Acked-by: Alan Coopersmith commit 75199129c603fc8567185ac31866c9518193cb78 Author: Keith Packard Date: Wed Mar 21 12:33:19 2012 -0700 Handle blank betweeen type and name in sdksyms.sh indent sometimes adds a blank line between the type and the name in a function declaration that includes _X_EXPORT, so handle that before the files are re-indented. Signed-off-by: Keith Packard commit a615b90cab7569fae9d123e4da1d3373c871d84b Author: Keith Packard Date: Wed Mar 14 11:32:36 2012 -0700 Bump version number to 1.12.99.0 Now that 1.12 has branched, reset the version on master to a development number. Signed-off-by: Keith Packard commit 53204d5c8bd83c957fbdb7d3dc2891118ed7658b Author: Sascha Hauer Date: Sat Mar 3 14:09:25 2012 +0100 make busID non mandatory Currently the driver only probes a device when it has a busID. The busID is optional so don't depend on it. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie commit bb7e39c1f2112f5fb7e87baddb114ab164fbc749 Author: Sascha Hauer Date: Sat Mar 3 14:09:27 2012 +0100 do not bail out on non pci devices To make the driver work on nin PCI devices we shouldn't bail out in this case. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie commit 2b6848fcb3f85f9ce18a6de1dc6c3ac047101aa8 Author: Sascha Hauer Date: Sat Mar 3 14:09:26 2012 +0100 Fix non PCI device probing When no devicename is found in the option then the driver probes by PciInfo no matter if it's valid or not. Instead of doing this use PciInfo only when it's valid and fall back to the devicename otherwise. With devicename probing use open_hw() to fall back on the KMSDEVICE environment variable or to the default device. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie commit 456a001e3f7a24f443cf0bad8400d5d600e2ad46 Author: Sascha Hauer Date: Sat Mar 3 14:09:24 2012 +0100 introduce open_hw() function probe_hw opens the hardware in the order we want it: first try devname, if this is NULL then try the KMSDEVICE environment variable and as a last fallback use "/dev/dri/card0". Instead of implementing the same code again when really opening the device move the code to a open_hw() function and let probe_hw use it. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie commit aa6ceaaa843525b2243569de162ed0b17faa7510 Author: Sascha Hauer Date: Sat Mar 3 14:09:23 2012 +0100 fix if() brackets in Probe function in Probe() the indention shows what's meant but there are no brackets. Add them. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie commit b1be72c5ca6cb98ba64637990b142be0f1710a19 Author: Keith Packard Date: Sun Mar 4 20:26:18 2012 -0800 Version bumped to 1.12 Signed-off-by: Keith Packard commit e08ed0b757b9b48344a301f612fabb3e39ffec78 Author: Gaetan Nadon Date: Sun Feb 26 17:51:50 2012 -0500 test: add new test cases to .gitignore Reviewed-by: Peter Hutterer Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 2416ee4a015068359807a10f433e8c54192c78a9 Author: Peter Hutterer Date: Wed Feb 22 15:32:56 2012 +1000 dix: avoid NULL-pointer dereference on button-only devices (#38313) And for such devices simply take the last.valuators[] which must be valid at all times anyway. UpdateSlaveDeviceCoords takes care of that. X.Org Bug 38313 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 38000e7d1f958f5944e641de3e716944a5876d41 Author: Jeremy Huddleston Date: Tue Jan 31 11:06:21 2012 -0800 Revert "dix: don't XWarpPointer through the last slave anymore (#38313)" This reverts commit 2bfb802839688ecf328119c4c6979390fc60348d. This commit caused a regression. See: http://xquartz.macosforge.org/trac/ticket/517#comment:10 Acked-by: Peter Hutterer commit cb6a32da27f09261c4d561c19d1877c750d98cc3 Author: Jeremy Huddleston Date: Fri Feb 17 13:44:12 2012 -0800 XQuartz: Short-circuit activateX: This also avoids a deadlock when calling activateX: before the server thread has initialized Signed-off-by: Jeremy Huddleston commit 1562c4a1ca748d2c4a8c69d57ba09ff7ca9cc453 Author: Jeremy Huddleston Date: Fri Feb 17 13:54:57 2012 -0800 XQuartz: Actually install the new locales Signed-off-by: Jeremy Huddleston commit 1349a2b7ab04553c8fddb60534400dea5cbd3cca Author: Dave Airlie Date: Wed Feb 22 10:07:06 2012 +0000 xf86-video-modesetting 0.2.0 commit e5648616d222966a95edd6c35807dcf5b91a0f96 Author: Dave Airlie Date: Wed Feb 22 09:59:12 2012 +0000 modesetting: fix warnings, remove dead code. Signed-off-by: Dave Airlie commit f7724167746d15c0ca32a7f5f95fb594addcddd1 Author: Gaetan Nadon Date: Sun Feb 19 16:13:34 2012 -0500 config: layout and comment the top portion of configure.ac Reorder statements to be consistent with other modules so things are easier to find. Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit a0bb835dc7db1ddd0472058a2a05a600ddea3930 Author: Gaetan Nadon Date: Sun Feb 19 08:36:19 2012 -0500 config: replace deprecated AC_HELP_STRING with AS_HELP_STRING Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit d56293cae78323b8976859c4461f8809a76a0b03 Author: Gaetan Nadon Date: Sun Feb 19 08:36:17 2012 -0500 make: add all warnings according to the platform The current code only adds -Wall and only for gcc. Automake reserves the use of CPPFLAGS for the user to override on the command line. This also breaks the option --enable-strict-compilation The variable CWARNFLAGS contains the complete set of warnings and is platform sensitive. Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit fa201fe8299099f7192a4399c9df245efcee3f8a Author: Gaetan Nadon Date: Sun Feb 19 08:36:16 2012 -0500 make: remove empty variable assignment Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit e159fbd8805005bb7a33bf2076fd2cef00e987c6 Author: Gaetan Nadon Date: Sun Feb 19 08:36:15 2012 -0500 Remove unneeded AM_PROG_CC_C_CO There are no objects in subdirs or compiled multiple times with different flags. Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit 70558492376e66b73063e51b128b5bbad14b84f4 Author: Gaetan Nadon Date: Sun Feb 19 08:34:28 2012 -0500 Remove redundant AC_PROG_CC Already covered by XORG_DEFAULT_OPTIONS Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit d4bb99ce754073de090221d98000f609a3891380 Author: Gaetan Nadon Date: Sun Feb 19 08:34:27 2012 -0500 Replace obsolete AM_CONFIG_HEADER with AC_CONFIG_HEADERS Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit 5c2d152cad66c3f8ed6a4e82c3e6a45269bbb66d Author: Gaetan Nadon Date: Sun Feb 19 08:34:26 2012 -0500 Add missing targets for ChangeLog and INSTALL Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit 8673f545cdb465b6e74f1d2fcabe29bc7fa0243d Author: Gaetan Nadon Date: Sun Feb 19 08:34:25 2012 -0500 Remove redundant EXTRA_DIST for the README file. Autotools know about it, it is always distributed. Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit 71594746c7da32e1c7986341a0da30f241a7a2be Merge: d53235a eaba06a Author: Keith Packard Date: Wed Feb 22 18:07:20 2012 +1300 Merge remote-tracking branch 'whot/for-keith' commit 88b637e59a37af8ec6c4c0783504b8f1a49e5595 Author: Gaetan Nadon Date: Sun Feb 19 08:34:24 2012 -0500 make: remove redundant AUTOMAKE_OPTIONS Already covered by AM_INIT_AUTOMAKE([foreign dist-bzip2]) Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit a7ea959094e9a8d862637a0ea515f687aaf89d29 Author: Gaetan Nadon Date: Sun Feb 19 08:34:23 2012 -0500 Fix typo in .gitignore Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit 861e2b444ffb24921e07fdc25ab2679c9b6d2f4d Author: Gaetan Nadon Date: Sun Feb 19 08:34:22 2012 -0500 man: missing AM_V_GEN and hard-coded sed command name Let's use the common xorg makefile for all drivers. This ensures no new problems are introduced. Improvements are welcome and to be applied to all drivers. Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit 453bbe5b442a9c21d7c22437545e487e2993ceb7 Author: Gaetan Nadon Date: Sun Feb 19 08:34:21 2012 -0500 Add contact information to the README file Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit dd1d7e3519ea2f148be83ef7ab0b228da95ff9c3 Author: Gaetan Nadon Date: Sun Feb 19 08:34:20 2012 -0500 Fill the COPYING file with license text This reflects the copyright license text in the source code Signed-off-by: Gaetan Nadon Signed-off-by: Dave Airlie commit b0e12e250d4b3438fb3306155a7bbff3e2d7f9b7 Author: Dave Airlie Date: Mon Feb 20 11:08:40 2012 +0000 modesetting: disable dirty updates for ENOSYS the kernel can also return ENOSYS for this to say its not used. Signed-off-by: Dave Airlie commit c5529d68c5b01cf0f36d8f2ce3694a7a0f3333da Author: Dave Airlie Date: Mon Feb 20 11:05:59 2012 +0000 modesetting: fix shadow resizing. if we hotplugged and output, the shadow got disabled by accident. Signed-off-by: Dave Airlie commit f3b9e52b29e8b8c4b12bc2ce290ab44e88750ad9 Author: Dave Airlie Date: Mon Feb 20 11:00:56 2012 +0000 modesetting: move shadow stuff to other structure we need this for resize to work properly. Signed-off-by: Dave Airlie commit eb44a004b7230321ce6837ef44610153b1d2017b Author: Dave Airlie Date: Mon Feb 20 10:54:36 2012 +0000 modesetting: fix stride if kernel modifies it. If the kernel aligns things use its values instead. fixes output on nouveau here. Signed-off-by: Dave Airlie commit 2150cbda8c75d348f39926bbc23d3e4ca9b42c88 Author: Dave Airlie Date: Mon Feb 20 10:54:21 2012 +0000 shadowfb: dump shadowfb state at startup commit 86080a5f7a589e55a485c42bab47c6c8ff6428c1 Author: Dave Airlie Date: Thu Feb 16 19:41:40 2012 +0000 use a cap to decide if shadow is preferred or not. commit fc5f39acd49d023a82ab05fffde1b423b697753c Author: Dave Airlie Date: Thu Feb 16 19:41:30 2012 +0000 cleanup dumb cap fetch commit d94b3eaba9a33d0d78ed2d9acbc33394f40fdc2e Author: Dave Airlie Date: Mon Nov 14 11:22:44 2011 +0000 modesetting: add cursor fallback if kernel rejects cursor. If the kernel rejects a cursor, cause a fallback, this isn't 100% as we can lose the initial cursor, but it works fine once wm starts. Signed-off-by: Dave Airlie commit 594b3c4d6f6f748e08baffc4bc1c3ffad9b0d9cf Author: Dave Airlie Date: Thu Feb 16 19:31:33 2012 +0000 fix some whitespace commit 2e297978c928c571cf0a80e8d38423089014f07e Author: Dave Airlie Date: Wed Oct 5 15:12:43 2011 +0100 fixup device open Signed-off-by: Dave Airlie commit eaba06a27c5520a02f08431ac1e4b0e0bdc22cd8 Author: Chase Douglas Date: Mon Feb 13 16:00:48 2012 -0800 Keep virtual core pointer touch class around if new slave doesn't have one The VCP may have active touch grabs. The touch records must be kept so these touch grabs may be accepted/rejected in the future. This means the touch class list will not represent the touch class of the attached slave device if it does not have a touch class, but we already were breaking that assumption by keeping a separate touches array for the VCP. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 8573b3519af138a3a12a2e77098718165f9fd8ff Author: Peter Hutterer Date: Mon Feb 13 16:00:47 2012 -0800 Don't clobber virtual core pointer touches array length The VCP has its own touches array, don't overwrite it when the class is copied from the SD to the master. Reported-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 03d32fe7a718d9016053cdb5d57f51a74ef99b59 Author: Chase Douglas Date: Mon Feb 13 12:09:32 2012 -0800 Don't dereference a touch after it has been ended when punting to next owner In this case, we have ended the touch because the last owner has rejected it. We need to return from the function right now so we don't attempt to dereference another touch client for early acceptance processing. Signed-off-by: Chase Douglas Reviewed-by: Chase Douglas Signed-off-by: Peter Hutterer commit 1ecb7aaf2adedad1996cd26176ef5802113e3ad9 Author: Chase Douglas Date: Sat Feb 11 07:58:38 2012 -0800 Focus event button state must show the logical buttons, not physical buttons Similar to the fix in fcda98c48610fd507ca0b89c6006a5497d9dc1c9. This ensures we show the correct logical state of the buttons in device focus events too. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 6f28388187cffae9e5bc9bfc9425acff4f478b59 Author: Peter Hutterer Date: Sat Feb 11 01:29:26 2012 +1000 dix: reset last.scroll when resetting the valuator (#45611) last.scroll remained on the last-submitted scrolling value but last.valuator was changed whenever the slave device changed. The first scrolling delta after a switch was then calculated as (last.scroll - new abs value), causing erroneous scrolling events. Test case: - synaptics with a scrolling method enabled, other device with 3+ axes (e.g. wacom) - scroll on touchpad - use other device - scroll on touchpad The second scroll caused erroneous button press/release events. X.Org Bug 45611 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit d53235af85d50774c68347720ce132daf9a5bc49 Author: Jeremy Huddleston Date: Mon Feb 13 23:06:07 2012 -0800 XQuartz: Build fix for possible conflict of BOOL type Signed-off-by: Jeremy Huddleston commit 62edd970f6f36058fcb31de4555eb7c1329cce74 Author: Keith Packard Date: Sat Feb 11 16:13:44 2012 +1300 Bump to version 1.11.99.903 (1.12 RC3) Signed-off-by: Keith Packard commit 42b6756463ee0476340656707f1088dc6c2fd220 Merge: 7674d00 ca64912 Author: Keith Packard Date: Sat Feb 11 15:36:43 2012 +1300 Merge remote-tracking branch 'alanc/master' commit 7674d00b04da5cf73cfa5c7ed1d3a9f42b59960e Author: Peter Hutterer Date: Fri Jan 27 12:41:09 2012 +1000 Xi: handle new XIAllowEvents request in inputproto 2.1.99.6 grab_window and touchid were removed from the struct for ABI compatibility reasons, we need to pull in the new, XI 2.2-specific struct. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit ceb026c6a6f1eea8b34e745f06f1ebcd652c0ba1 Author: Peter Hutterer Date: Fri Jan 27 12:41:09 2012 +1000 Xi: handle new XIAllowEvents request in inputproto 2.1.99.6 grab_window and touchid were removed from the struct for ABI compatibility reasons, we need to pull in the new, XI 2.2-specific struct. Signed-off-by: Peter Hutterer commit b96275c4cdb164aa71f7aa9fbf88be18886d1936 Author: Benjamin Otte Date: Tue Feb 7 18:01:25 2012 +1000 dix: fix an out-of-memory crash Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 6241b5e4fdbdb08d30cc8787d858ac27122d2d49 Author: Chase Douglas Date: Fri Feb 3 16:19:11 2012 -0800 Implement touch early accept This doesn't really implement early accept as it should. Ideally, the server should send end events to all subsequent touch clients as soon as an early accept comes in. However, this implementation is still protocol compliant. We can always improve it later. Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit b0c54856df71f9cabf9dad176fdade960ef8c5d9 Author: Chase Douglas Date: Fri Feb 3 16:19:10 2012 -0800 Implement early touch reject Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 656ab879f20892975510723ce8fe78faf64aadb4 Author: Chase Douglas Date: Fri Feb 3 16:19:09 2012 -0800 Check for proper window ID when processing touch allow requests Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 9a260e9af83feb5c53ffd3b2da2dc3adf06240a1 Author: Chase Douglas Date: Fri Feb 3 16:19:08 2012 -0800 Move AllowTouch to dix/touch.c, and rename to TouchAcceptReject Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 192b2c9a2ec04522655675ddfe71de5cf974cc7b Author: Chase Douglas Date: Fri Feb 3 16:19:07 2012 -0800 Export TouchEventRejected as TouchRejected This function is mostly correct for early reject usage. With a small change to pass the client resource explicitly and making the TouchOwnership event optional, it is usable for all rejection scenarios. This change exports it for use outside Xi/exevents.c and modifies the name accordingly. Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 19073425e5df1317f73f74ce0b95ab24e0e0da14 Author: Chase Douglas Date: Fri Feb 3 16:19:06 2012 -0800 Factor out TouchEnd generation and delivery The server often needs to generate and deliver TouchEnd events for circumstances including touch grab acceptance and rejection. This change refactors the code so it can be used more easily. Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit ab60cadc2afb9d8882144e30fde11c3ef0f999cd Author: Chase Douglas Date: Fri Feb 3 16:19:05 2012 -0800 Store window pointer in touch listener record Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit f92ba92adfce0e1975feb54ab0e1165b7c2a7bea Author: Peter Hutterer Date: Sat Feb 4 19:27:21 2012 +1000 Revert "dix: deduplicate callers of DeliverDeviceEvents in DeliverGrabbedEvents" This call was supposed to have no functional changes but in some cases DeliverDeviceEvents() was called with a uninitialised win variable. Revert, safer than trying to sort this out otherwise. This reverts commit 6eff14a789341d366b3013c5aa020e959c954651. Reported-by: Mathieu Taillefumier Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit ca64912c02bdff486fee420a49b11f54f8f5ba08 Author: Alan Coopersmith Date: Thu Jan 26 16:41:25 2012 -0800 Namespace list api to reduce conflicts with similar system headers Rename functions/macros from list_* to xorg_list_* Rename struct from struct list to struct xorg_list. Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard In-sed-I-trust: Peter Hutterer commit 1541e242d1607d0db57b0cc12faca9b1c2850c67 Author: Alan Coopersmith Date: Fri Dec 23 15:17:28 2011 -0800 Stop including from xf86_OSlib.h on Solaris We don't need anything from that header (which defines /proc & kernel structures for process information), and it causes some namespace conflicts. Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard commit 85cecd981191f9c3dab0fb13310d91eff643d423 Author: Jeremy Huddleston Date: Sat Jan 28 16:06:28 2012 -0800 XQuartz: Release all buttons and keys when deactivating http://xquartz.macosforge.org/trac/ticket/486 Signed-off-by: Jeremy Huddleston Reviewed-by: Peter Hutterer commit 47b457541b33f00807fd495f5b0b24d5f143bf84 Author: Jeremy Huddleston Date: Sat Jan 28 23:11:44 2012 -0800 XQuartz: Toggle off fullscreen mode when XQuartz is hidden http://xquartz.macosforge.org/trac/ticket/478 Signed-off-by: Jeremy Huddleston commit c2ba3f339f089c595386c4c579935c7984a2a545 Author: Jeremy Huddleston Date: Sun Jan 29 14:26:47 2012 -0800 XQuartz: Localization Updates Signed-off-by: Jeremy Huddleston commit 052ca3f22eadd0aa60dd24ac7d5d76137273926f Author: Keith Packard Date: Fri Jan 27 22:08:08 2012 -0800 Bump version to 1.11.99.902 (1.12 RC2) Signed-off-by: Keith Packard commit bafedb7e9bcff31e2963eeb54669b2492214fae7 Author: Jeremy Huddleston Date: Wed Jan 18 11:52:04 2012 -0800 XQuartz: Bump bundle version to 2.7.2 Signed-off-by: Jeremy Huddleston commit 8e78bbb2d2dc5b18f127540b63b45ba293bbdd25 Author: Colin Harrison Date: Thu Jan 26 13:28:24 2012 +0000 hw/xwin: Fix spelling of 'Canadian' in winkeybd.h The Mounties always get their typo Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit 80c073352a276bad3722263629de3cd61df758ab Author: Colin Harrison Date: Wed Jan 4 17:16:36 2012 +0000 hw/xwin: Fix winEnqueueMotion() for change in miPointerSetPosition() Commit 3b36fd1b49030ead44358945f62e5abe7f4609ce changed miPointerSetPosition() to take co-ordinates as doubles, not ints, so this code as it stands is now wrong (if it ever was correct in the first place :-)) It's unclear that we can safely promote x,y to doubles, apply miPointerSetPosition() which potentially constrains the cursor, and then convert back to ints. Fortunately, this whole dance seems to be unnecessary, and we can simply remove the call to miPointerSetPosition() entirely, and just QueuePointerEvents() like any other input driver. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit ced9db65950e402d7ddc663225b888e8482b8c57 Author: Colin Harrison Date: Wed Jan 25 01:37:16 2012 +0000 hw/xwin: Ignore WM_DISPLAYCHANGE messages with 0 bpp Ignore WM_DISPLAYCHANGE messages which indicate bpp is changing to 0. That has no defined meaning I can find, but some graphics card drivers appear to generate it on suspend/resume or screensaver activate/deactivate. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY commit bea6fb6c7af551778cfe1c0e8412ef4ccf560808 Author: Jon TURNEY Date: Sun Jan 22 19:31:51 2012 +0000 hw/xwin: Avoid WIN_WINDOW_PROP races during Windows window destruction The WIN_WINDOW_PROP is removed during WM_DESTROY handling, so it is not neccessary to remove it in winDestroyWindowsWindow(), and doing so opens a race condition, as we may attempt to access that property in the wndproc before the WM_DESTROY has completed. A specific example of that race is if a WM_KILLFOCUS occurs in the window between property removal and WM_DESTROY processing, where we will attempt to apply DeleteWindowFromAnyEvents() on an invalid (null) WindowPtr. Also guard against null WindowPtr in the WM_KILLFOCUS handler See http://cygwin.com/ml/cygwin-xfree/2012-01/msg00009.html Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 9a709d5028094fcbeb7a49f47cb85e22cd772f36 Author: Jon TURNEY Date: Thu Sep 29 15:05:27 2011 +0100 hw/xwin: Handle more motif window decoration hinting Handle the MWM_DECOR_MINIMIZE, MWM_DECOR_MAXIMIZE and MWM_DECOR_MENU decoration hints in a _MOTIF_WM_HINTS window property Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b8b0b841a0e7cfcecaf0b6a5aa67e1b4499374d9 Author: Oliver Schmidt Date: Mon Sep 5 13:32:01 2011 +0100 hw/xwin: Fix AltGr key sometimes firing an additional Ctrl-L key I also had problems with the AltGr key. These could reliably be reproduced by holding the AltGr for some seconds (causing Windows generating auto repeat events) I discovered that the mechanism in winkeybd.c function winIsFakeCtrl_L had a problem if PeekMessage cannot obtain the next Alt_R message because it is not there yet. I prepared a patch that remembers the last Ctrl_L event and reacts on a later Alt_R. It was also necessary to alter the order in winWindowProc() in winwndproc.c: the invocation of winIsFakeCtrl_L had to be done before discarding auto-repeated key presses, as winIsFakeCtrl_L() now has an internal state which must be updated by all key events. Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 3d3114d55a2a323f8d49c3549a0dfdf9d4acf89d Author: Jon TURNEY Date: Thu Jun 30 14:19:01 2011 +0100 hw/xwin: Handle the virtual key code generated by the Fn key on IBM Lenovo laptops Apparently, IBM Leonovo laptops can generate a key-press event for the Fn key, with virtual key code 0xFF and scan code extended 0x63 Handle this specially, rather than just passing on key code 0x63 (delete), so you don't delete what you just typed when you adjust the screen brightness, etc. :-) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 74af860f9a59332f6ed1ac9b3e7867fbbb3d7305 Author: Jon TURNEY Date: Wed Mar 24 22:41:22 2010 +0000 hw/xwin: turn on -emulate3buttons if less than 3 mouse buttons are reported Try to be more intelligent with default options, turn on -emulate3buttons by default if less than 3 mouse buttons are reported by Windows Also, add -noemulate3buttons option so this default setting can be reversed if desired Also, correctly report the number of mouse buttons windows is reporting, rather than always at least 3 Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit c0f3709501a0afd3bf77e783f11d2c2e5f489d3b Author: Jon TURNEY Date: Thu Mar 24 20:19:47 2011 +0000 hw/xwin: In multiwindow mode, don't grab native input focus for new windows which hint they don't want it In multiwindow mode, avoid grabbing the input focus for newly created windows which have InputHint FALSE (this is used by e.g. glean to avoid every test window grabbing the focus) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 25caa8565d7d10f4c254bca5bb9efa05a77542ad Author: Jon TURNEY Date: Wed Jan 25 13:33:39 2012 +0000 hw/xwin: Remove some redundant OS version reporting Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit a9aca218f557c723e637287272819a7c17174e1e Author: Roland Cassard Date: Sat Oct 23 18:12:36 2010 +0100 hw/xwin: Don't assume we'll always have converted the clipboard selection after 2 attempts Rather than knowing we have to call winProcessXEventsTimeout() for up to 2 WIN_XEVENTS_CONVERT messages, process all messages in winProcessXEventsTimeout() until either: (i) the time out expired, (ii) an error occurred, or (iii) received a WIN_XEVENTS_NOTIFY messaage indicating the data has been to put on the clipboard. Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 75fe336b6c903133ae386f5cb8d308a0e9e2768e Author: Michel Hummel Date: Fri Aug 6 15:23:52 2010 +0100 hw/xwin: Mitigate a race condition in clipboard thread initialization Remove the variables g_fClipboardLaunched and g_fClipboardStarted from winInitializeGlobals(), as their re-initialization is handled in the file hw/xwin/InitOutput.c. Re-initializing g_fClipboardLaunched and g_fClipboardStarted during the server reset procedure can lead to the clipboard thread being launched two times and sometimes leads to a crash of the X server... Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 95b1391fe3d3192abdfbad4140513b2112cfa02a Author: Jon TURNEY Date: Mon Apr 5 13:57:24 2010 +0100 hw/xwin: Chain IOError handlers to avoid longjmp across threads Avoid crashes on shutdown due to the undefined behaviour of calling longjmp() on the result of setjmp() from a different thread, by chaining IOError handlers and only jumping back up to the frame for this thread Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit 0659437f5ec0e3f646373394f5f9c5461e2170f3 Author: Yaakov Selkowitz Date: Sat Feb 20 23:40:53 2010 -0600 hw/xwin: Improve XWinrc loading and error recovery If $HOME/.XWinrc is present but badly formed, ignore it and try system.XWinrc instead. If neither file is present or both are badly formed, provide a built-in default which gives the user the chance to load their new or fixed configuration without restarting. Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 47c7b6d3e626497747ae2780f259a15b8e6c846f Author: Michel Hummel Date: Sat Oct 23 18:35:57 2010 +0100 hw/xwin: Remove no-longer needed tricks used to prevent the clipboard client from being killed Remove no-longer needed tricks used to hide the clipboard client from XDM to prevent it from being killed - Delete XQuery wrapper used to hide clipboard client - Delete XDMCP mode heuristic which waits until some magic number of connections have been established before starting the clipboard We still need the EstablishConnection wrapper to ensure that the clipboard client isn't the first client (causing a server restart if it disconnects) Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit c1bf3baa44fbd8af33a2b3ce045324485b85a7a7 Author: Michel Hummel Date: Sun Oct 31 14:53:02 2010 +0000 hw/xwin: Automatically restart clipboard thread Automatically restart clipboard thread on unexpected exit Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit ae981341a98f7a1ee5d6f3bc8ebde04e42042dc5 Author: Jon TURNEY Date: Mon Feb 8 22:37:30 2010 +0000 hw/xwin: Give the X window for the clipboard integration client a name This makes it a bit easier to find when staring at the output of 'xwininfo -tree -root' Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit b1093241f3e28223a139e7cb5c3ae85182bdf545 Author: Jon TURNEY Date: Tue Oct 19 20:47:21 2010 +0100 Xext: Warning fix for shm.c shm.c: In function 'CheckForShmSyscall': shm.c:182:5: warning: function declaration isn't a prototype [-Wstrict-prototypes] Signed-off-by: Jon TURNEY Reviewed-by: Alan Coopersmith Reviewed-by: Colin Harrison commit 02775efb8930291cc62fc84086c97da75b912a55 Author: Adam Jackson Date: Tue Jan 24 17:35:04 2012 -0500 int10: Fix unmapping of the BIOS scratch area 342f3eac8460fc48cfad1f1d7be939d671e6e1cd introduced a bug, 'base' is incremented before use. The old code corrected this when unmapping, so the new code should too. Signed-off-by: Adam Jackson Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit e1085a0da0b9299f48b3dc41dee5e33bf022bea5 Author: Chase Douglas Date: Wed Jan 18 19:09:21 2012 -0800 Don't set X and Y valuators for indirect touch events For expediency, it made sense to always have the X and Y axes set for direct touch device event propagation. The last X and Y values are stored internally. However, indirect device touch event propagation does not depend on the touch's X and Y values. Thus, we don't need to set the values for every indirect touch event. On top of this, the previous X and Y values aren't stored for indirect touches, so without this change the axes get erroneously set to 0. Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer commit 5201310559fe8708ba8278bdef77cdc1673fff71 Author: Daniel Stone Date: Thu Jan 19 22:40:32 2012 +1100 UngrabAllDevices: Don't kill clients if not told to The kill_client argument to UngrabAllClients specifies if we want to kill the client holding the grab or just deactivate the grab. Signed-off-by: Daniel Stone Reported-by: Julien Cristau Reviewed-by: Cyril Brulebois Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 9b1e18f42a05a79d9ebec372a37b47442e397ca9 Author: Chase Douglas Date: Wed Jan 18 18:04:14 2012 -0800 Only update pointer motion data for pointer emulated touch events Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit f00e5b02f5d9928cd88961e761da91b5faff1b32 Author: Chase Douglas Date: Wed Jan 18 18:04:13 2012 -0800 Only scale direct device touch coordinates Indirect touch devices provide valuator values in pure device coordinates. They also don't need to be fixed up for screen crossings. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 24dc0389da3970e83e4908039957567e55f9ea05 Author: Peter Hutterer Date: Mon Jan 16 12:53:39 2012 +1000 include: Fix comment typo Signed-off-by: Peter Hutterer commit 954bb994842aa43a0f272858e65036c016b729a4 Author: Jeremy Huddleston Date: Mon Jan 9 00:40:10 2012 -0800 configure.ac: Remove MIEXT_SHADOW_LIB from XORG_LIBS This is provided by dixmods/libshadow.so and is not part of the main binary. This addresses a build failure on darwin due to MIEXT_SHADOW_LIB having unsatisfied dependencies (FB_LIB) in XORG_LIBS. Signed-off-by: Jeremy Huddleston commit ba0f5cc1961bfcfb5e7d66ac5df19d429952631d Author: Jeremy Huddleston Date: Mon Jan 9 00:14:29 2012 -0800 xfree86: Don't link libxorgxkb against libdix.la libdix.a is already provided by XSERVER_LIBS. Including it in libxorgxkb results can result in duplicate symbols landing in the Xorg binary on some configurations (buggy glibtool on darwin). Signed-off-by: Jeremy Huddleston commit 2387fb23858d645f15061bc7bcbe4654386ba116 Author: Jeremy Huddleston Date: Fri Jan 13 12:00:14 2012 -0800 sdksyms.sh: Exit on error rather than building an empty symbol table Signed-off-by: Jeremy Huddleston Reviewed-by: Keith Packard commit cd89482088f71ed517c2e88ed437e4752070c3f4 Author: Jeremy Huddleston Date: Wed Jan 11 12:17:06 2012 -0800 test: Fix linking issues when building unit tests without the Xorg DDX This allows unit tests to build and run successfully on darwin when only the Xvfb or XQuartz DDX is built. Signed-off-by: Jeremy Huddleston Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY commit 78d39b3222a4b0b92d840137f5455d3a20dd6906 Author: Jeremy Huddleston Date: Sun Jan 15 02:26:43 2012 -0800 Revert "glx: don't leak fbconfigs" This reverts commit d26fae246d7c451b4d5ffe24fdb959d4bd00b107. This patch free()s memory in __glXScreenDestroy which was allocated in glxdricommon (which isn't in every DDX). That breaks abstraction and causes a crash when XQuartz quits, because it results in freeing a pointer that was never allocated. The correct fix is to do this cleanup in __glXDRIscreenDestroy. Signed-off-by: Jeremy Huddleston commit f9e6858d5c10be6a8439c0f18bfb2325fa0ee070 Author: Chase Douglas Date: Wed Jan 11 07:38:12 2012 -0800 Use event time instead of CurrentTime for grab times When {XI,X,}AllowEvents is called, the timestamp is compared against the grab time to ensure that the request pertains to the current grab in the server. While many clients may use CurrentTime (client-side), the timestamp of the event causing the grab is also valid. This change ensures that the server's notion of the grab time is the time of the event that activated the grab rather than the time that the grab is actually activated. This bug was exposed through nested touch then pointer grabs. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit a6273cc85c01fc020643a68e49ca4e7a2d2ae898 Author: Peter Hutterer Date: Thu Jan 12 10:17:34 2012 +1000 xfree86: mention udev in the xorg.conf manpage AutoAddDevices section And point out what "hotplugging" means. Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau commit a60d87ffe6d9a15fa830c8da2947c72487863c2b Author: Peter Hutterer Date: Wed Jan 11 09:04:02 2012 +1000 os: prettify backtrace output Changes to output: * "Backtrace:" now appears on a separate line _with_ a timestamp * A blank line is inserted after the last backtrace line Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau commit c495a839ace7fcc1f1fe414d3d3ba04f08885434 Author: Peter Hutterer Date: Wed Jan 11 09:01:05 2012 +1000 include: prettify BUG_WARN output ErrorF output is prefixed with a timestamp, so the previous output would look like this: [ 50.423] BUG: triggered 'if (dev->valuator->numAxes < 2)' BUG: getevents.c:842 in scale_to_desktop() Change this to have the prefix on both lines: [ 50.423] BUG: triggered 'if (dev->valuator->numAxes < 2)' [ 50.423] BUG: getevents.c:842 in scale_to_desktop() Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau commit bbb6b8c834e0e1491ca14403b5d0840dd14380d3 Author: Peter Hutterer Date: Fri Jan 6 13:20:45 2012 +1000 render: don't bother with animated cursors on floating slaves (#39989) X.Org Bug 39989 Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit 35bd77e9d0701daae87d681900d749604fc6471f Author: Peter Hutterer Date: Mon Jan 9 15:04:10 2012 +1000 dix: Update pointer limits for floating devices too (#43635) When the screen is restructured, the pointer limits need to be reset for floating slave devices as well, not just for master pointers. Only skip devices that don't have a cursor (attached slaves and keyboard) Bug reproducer: float an absolute slave device, rotate the screen - the device is now confined to a section of the screen only. X.Org Bug 43635 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 5de0c2582f9c80874b4f4a5b86d250059bfaa85b Author: Keith Packard Date: Thu Jan 12 12:10:07 2012 -0800 Revert "os: Repack ConnectionOutput for LP64" This reverts commit d5f724544afd2949cebfcf4f0b4510ec0c701bec. ABI change pended for 1.13 commit 11331305d4acd117b71502e45c0e86684fa9280b Author: Keith Packard Date: Thu Jan 12 12:10:03 2012 -0800 Revert "dix: Repack ClientRec" This reverts commit f702372822dadb1fef92cfc25086481f640147b3. ABI change pended for 1.13 commit d9eeede52f2d5ba9dd6368d988a5d2abb3b8b4e5 Author: Keith Packard Date: Thu Jan 12 12:09:59 2012 -0800 Revert "dix: Pull client-is-local flag up to the ClientRec" This reverts commit 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96. ABI change pended for 1.13 commit 3be37375eed9eb9cfb9c42821deda4213af4057b Author: Keith Packard Date: Thu Jan 12 12:09:55 2012 -0800 Revert "dix: Extend initial connection handshake for forwarding proxies" This reverts commit 78fa121f4097d29458e5453c13473595df06e26e. ABI change pended for 1.13 commit 5b9f5c8a53aca03c3c73bc10bd362987621a9d72 Author: Keith Packard Date: Thu Jan 12 12:09:44 2012 -0800 Revert "os: Hide the Connection{In,Out}put implementation details" This reverts commit 48e7a2ef574c8b38c4f8f07b45f54c8bfd02552b. ABI change pended for 1.13 commit 5867d453cebebec6b4f10409af86b603755fbf51 Author: Keith Packard Date: Thu Jan 12 12:09:34 2012 -0800 Revert "dix: Fix types in WindowOptRec" This reverts commit a4553019a10b4e01cc06f3081db71a83338697b4. ABI change pended for 1.13 commit e722ad6c3efa57b806ca0f2dc13114bd3619a88c Merge: e476af4 4e44580 Author: Keith Packard Date: Mon Jan 9 13:22:28 2012 -0800 Merge remote-tracking branch 'jturney/rpavlik-xwin-fixes' commit e476af417d83730b11054f4e5b127ab5540bb332 Merge: f4956fa 1460083 Author: Keith Packard Date: Mon Jan 9 13:17:37 2012 -0800 Merge remote-tracking branch 'whot/multitouch' commit f4956faab9ccf9aba6cf9603f4489f5dad19a347 Author: Zhigang Gong Date: Wed Jan 4 07:01:19 2012 +0000 mi/mibitblt: Fix an overflow bug of bit shift. When depth equal to 32 and planeMask equal to 0, the overflow will occur and cause the pixmap can't be cleared. There are some test cases in XTS hit this bug, and this fix can eliminate the corresponding failures. Signed-off-by: Zhigang Gong Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 6d6d4cb6043905d850834946e9bfc526ed5a9ef7 Author: Matthieu Herrb Date: Mon Jan 2 13:23:59 2012 +0000 Add OpenBSD support to DetermineClientCmd() Uses kvm_getargv() from libkvm. Signed-off-by: Matthieu Herrb Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit a55214d11916b707b7c8c65c555cc0cbb59ac503 Author: Adam Jackson Date: Tue Jan 3 06:22:24 2012 +0000 Always install xaa sdk headers Always install XAA SDK headers so drivers still build even with --disable-xaa Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston Signed-off-by: Keith Packard commit dafc327f3c75205cf7e5360e9ccd71c7457f61a5 Author: Matthieu Herrb Date: Mon Jan 2 13:11:41 2012 +0000 UnloadSubModule(): accept pointer value '1' and ignore it. Some driver modules try to unload submodules that are now built-in. Signed-off-by: Matthieu Herrb Reviewed-by: Julien Cristau Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit 8db029064bcbe378061e812bb8136608e3123226 Author: Adam Jackson Date: Wed Jan 4 16:39:33 2012 +0000 vgahw: Fix DACDelay() macro to use the driver's vtable We don't want to unconditionally use I/O routines here, since if the driver is using mmap'd VGA ports then the I/O handle won't be set up. Tested-by: Jeff Chua Signed-off-by: Adam Jackson Reviewed-by: Mark Kettenis Signed-off-by: Keith Packard commit 63a8012947fc44ccb3d661dec88dbda14e7f3c04 Author: Chris Halse Rogers Date: Thu Jan 5 01:22:40 2012 +0000 Revert "dix: don't return BadMatch from GetProperty (#23562)" This reverts commit f04fe06ae244b851b38be824b1a80f2f8a030591. dixLookupWindow no longer returns BadMatch. No other caller was checking for it, so this problem is now fixed in the utility function. Signed-off-by: Christopher James Halse Rogers Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit ef492e9797b6d4f6bbc25e86bedc24477819fde7 Author: Chris Halse Rogers Date: Thu Jan 5 01:22:39 2012 +0000 dix: Return BadWindow rather than BadMatch from dixLookupWindow dixLookupWindow uses dixLookupDrawable internally, which returns BadMatch when the XID matches a non-Window drawable. Users of dixLookupWindow don't care about this, just that it's not a valid Window. This is a generalised version of the fix for X.Org Bug 23562, where GetProperty was incorrectly returning BadMatch. Auditing other window requests, all that I checked would incorrectly return BadMatch in these circumstances. An incomplete list of calls that could incorrectly return BadMatch is: ListProperties, SetSelectionOwner, {Destroy,Map,Unmap}{,Sub}Window. None of the callers of dixLookupWindow, except for GetProperty, check for BadMatch Signed-off-by: Christopher James Halse Rogers Reviewed-by: Daniel Stone Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit ff891bbf68caefc22cabb541b6b56af086ac2280 Author: Arthur Taylor Date: Fri Jan 6 07:21:37 2012 +0000 linux: Use K_OFF VT KB mode over K_RAW if available. Linux kernels since 2.6.38 (March 2011) have an VT KB mode K_OFF in which special keys (like Ctrl+C) are not interpreted and input is not buffered. Use of this mode over K_RAW removes the need for a xf86ConsoleHandler to drain the VT input buffer, removing the grief it causes when it goes wrong or is (de)initialized out-of-order. (This also saves a few needless context switches per key event.) If K_OFF is not defined or not understood by the kernel, K_RAW and the previous method is used as a fall-back. Reviewed-by: Adam Jackson Signed-off-by: Arthur Taylor Signed-off-by: Keith Packard commit 0b113f7cdf5228dccd51a749a339c8669e3f20ff Merge: 0b2c649 777bf90 Author: Keith Packard Date: Mon Jan 9 13:07:25 2012 -0800 Merge commit '777bf90abeac37087a3d0538b847742523d5acf2' commit 0b2c6491c5e5e1c9ba067299f3de61f5acee263b Merge: 1f5587e 6b19436 Author: Keith Packard Date: Mon Jan 9 11:40:23 2012 -0800 Merge remote-tracking branch 'whot/for-keith' commit 1f5587e14406c083687203030db6a11691ac9d9f Merge: a97252d 6269977 Author: Keith Packard Date: Mon Jan 9 11:37:59 2012 -0800 Merge remote-tracking branch 'kibi/master' commit a97252db24669a3e26a935024ea38b8a28d30586 Author: Jeremy Huddleston Date: Tue Dec 20 19:49:47 2011 -0800 XQuartz: GL: Buildfix for recent GLX changes dispatch.h was leftover from an earlier implementation and is no longer needed, so remove it since including it causes a build failure due to conflicts between GL/gl.h and OpenGL/gl.h Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp Reviewed-by: Ian Romanick commit 6b194365364cb7a74c2b19f4a8c5e0e0404339da Author: Andreas Wettstein Date: Wed Nov 30 20:20:21 2011 +0100 xkb: Message actions suppress other key presses #28575 When a key to which a message action is mapped is held down, presses of other keys were not registered. Signed-off-by: Andreas Wettstein Reviewed-by: Daniel Stone Signed-off-by: Peter Hutterer commit 4e44580efd4522ced644c698336d2f6ea54f3917 Author: Ryan Pavlik Date: Fri Nov 4 14:29:01 2011 -0500 hw/xwin: Include manifest file in the dist tarball Commit c02638fd added the manifest file, but didn't add it to EXTRA_DIST. Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit c763fe51b8ff18e204caab9cf97376a1b72324f0 Author: Ryan Pavlik Date: Fri Nov 4 13:17:50 2011 -0500 hw/xwin: Fix duplicate definition of HAS_WINSOCK when building for MinGW hw/xwin: Fix duplicate definition of HAS_WINSOCK when building for MinGW but still provide it if building for Win32 without autotools xserver/hw/xwin/winclipboard.h:42:0: warning: "HAS_WINSOCK" redefined ../../include/xwin-config.h:11:0: note: this is the location of the previous definition Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit 3d80f202b06227f7fc03b674f5fbf809c2d1efb2 Author: Ryan Pavlik Date: Fri Oct 28 09:56:19 2011 -0500 hw/xwin: Fix possible null ptr deref in winMWExtWMDecorateWindow() Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit c824004b4592b3d86b3514be7cab37b36642b13a Author: Ryan Pavlik Date: Fri Oct 28 09:56:11 2011 -0500 hw/xwin: Fix possible null ptr deref in winMWExtWMRestackFrame() Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit 3c501691a0a9fa17da4e2cc84f55010ef2a4790d Author: Ryan Pavlik Date: Fri Oct 28 09:52:34 2011 -0500 hw/xwin: Fix possible null ptr deref in winActivateAppPrimaryDD() Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit a492c02649de4c60ac21a7fcb6b7c730b558dca6 Author: Ryan Pavlik Date: Fri Oct 28 09:49:00 2011 -0500 hw/xwin: Fix possible null ptr deref in winActivateAppNativeGDI() Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit b907079596bc8600d3420c189409053b0b5016f6 Author: Ryan Pavlik Date: Fri Oct 28 09:46:56 2011 -0500 hw/xwin: Clarify an if statement mixed with ifdef in winSetEngine() Use the same pattern as elsewhere so it's a bit clearer what we are checking Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit 5c35dd7be716a3464f012c92866919a3606f9beb Author: Ryan Pavlik Date: Thu Oct 27 15:49:59 2011 -0500 hw/xwin: Fix rrScreenSetSize function pointer mismatch winrandr.c: In function ‘winRandRInit’: winrandr.c:218:31: warning: assignment from incompatible pointer type Fix winRandRScreenSetSize() function signature to match RRScreenSetSizeProcPtr type, to align with commit fd9331f6 'Revert "Separate out screen size and screen pixmap sizes in RRScreenSizeSet"' This is fall-out from the late revert of RANDR 1.4 in the 1.10 release cycle, it will probably need to be reverted if/when that goes back in again. Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit aa07d82908c28f4d083c0c55846a5b34f0e1ef31 Author: Ryan Pavlik Date: Fri Oct 28 09:56:26 2011 -0500 hw/xwin: Remove an empty #if 0/#endif Um... yeah Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit d459f42e64f2bafef5124a456d2ad6fa2cd92a7f Author: Ryan Pavlik Date: Fri Oct 28 09:52:37 2011 -0500 hw/xwin: Fix double-free in error path in winQueryRGBBitsAndMasks() Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit cc7dedd6b51a01996ddab10fe8b84e30700d1570 Author: Ryan Pavlik Date: Fri Oct 28 09:46:45 2011 -0500 hw/xwin: Fix a memory leak in error path in winInitWM() Signed-off-by: Ryan Pavlik Reviewed-by: Colin Harrison Reviewed-by: Jon TURNEY commit 777bf90abeac37087a3d0538b847742523d5acf2 Author: Adam Jackson Date: Mon Jul 18 15:07:07 2011 -0400 xfree86: Remove the pretense of EDID v2 support We don't do anything with EDID v2 blocks besides publish them on the root window. Worse, the check deleted by this patch would attempt to take a checksum of arbitrary memory if the rawData array isn't 256+ bytes long (and, for the monitors mentioned, it probably is only 128). Reviewed-by: Mark Kettenis Signed-off-by: Adam Jackson commit 8f9bdfd293ad8e45755efe8d764b4dcc2a724f51 Author: Adam Jackson Date: Tue Dec 13 21:23:12 2011 -0500 dix: Tune dixLookupDrawable for success The vast vast vast majority of resource lookups are successful. Move some work to the error paths so we don't punish success. Before: 40000000 trep @ 0.0009 msec (1109091.3/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square After: 40000000 trep @ 0.0009 msec (1148346.9/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2091666.1/sec): ShmPutImage 10x10 square Reviewed-by: Alan Coopersmith Signed-off-by: Adam Jackson commit 83a98543b58c661a22574a6f8d8f9d777c0955b8 Author: Adam Jackson Date: Tue Dec 13 20:23:40 2011 -0500 dix: Tune dtrace hooks around Dispatch Don't call LookupMajorName if the hooks aren't active, it's quite expensive. Before: 40000000 trep @ 0.0009 msec (1087458.5/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square After: 40000000 trep @ 0.0009 msec (1109091.3/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square Reviewed-by: Alan Coopersmith Signed-off-by: Adam Jackson commit 11977fab546da35d579ebe285e3c26864007805e Author: Adam Jackson Date: Tue Dec 13 21:00:05 2011 -0500 xace: ricer tuning for XaceHook gcc doesn't want to hoist the check for XaceHooks[hook] != NULL above the varargs code for some reason, so do it ourselves. Before: 40000000 trep @ 0.0010 msec (1050420.2/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (1921147.6/sec): ShmPutImage 10x10 square After: 40000000 trep @ 0.0009 msec (1087458.5/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square Reviewed-by: Alan Coopersmith Signed-off-by: Adam Jackson commit a4553019a10b4e01cc06f3081db71a83338697b4 Author: Adam Jackson Date: Fri Jun 17 14:30:06 2011 -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 c44ef2e1ff7bad168c348da63477b4636b3054fd Author: Adam Jackson Date: Fri Jun 17 14:17:09 2011 -0400 os: Minor header cleanup Move some constants near their only users, and remove some getdtablesize() logic that's second-guessing configure. Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson commit 48e7a2ef574c8b38c4f8f07b45f54c8bfd02552b 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 78fa121f4097d29458e5453c13473595df06e26e 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 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96 Author: Adam Jackson Date: Fri Jun 17 13:22:41 2011 -0400 dix: Pull client-is-local flag up to the ClientRec Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson commit f702372822dadb1fef92cfc25086481f640147b3 Author: Adam Jackson Date: Fri Jun 17 12:58:25 2011 -0400 dix: Repack ClientRec sizeof(ClientRec) ILP32 LP64 before 120 184 after 104 136 Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson commit d5f724544afd2949cebfcf4f0b4510ec0c701bec 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 ed8f3c4bd17bddf1369d050ea8e63b9451d887ce Author: Peter Hutterer Date: Fri Jan 6 10:10:16 2012 +1000 Xi: change XIChangeDeviceProperty from const pointer to const void * According to Daniel Kurtz, a typedef void *pointer is a atomic type. So a 'const pointer' is equivalent to 'void* const' instead of the intended 'const void*'. This technically changes the ABI, but we don't bump it for this. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 146008358e9dd9b178bd5305bcc1680ca16c328d Author: Chase Douglas Date: Thu Jan 5 16:43:40 2012 -0800 Remove last listener on touch reject The current code short-circuits around the block that removes the rejecting listener if it is the only listener left. It also does not delete the touchpoint record if the touch has not physically ended. This change ensures the listener is removed under these circumstances. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit e30c3c5c59abba9713cf3be532a46220aa9aeeca Author: Chase Douglas Date: Wed Jan 4 15:50:40 2012 -0800 Don't end touchpoint if owning client hasn't accepted/rejected A touchpoint is ended when no further processing will take place for it. This includes the situation where there is only one grabbing client, and the client receives a touch end before it has accepted/rejected the touchpoint. This change ensures that a delivered touch end event is converted into a touch update event under the above scenario. If the event is left as a touch end event, the touchpoint will be ended in ProcessTouchEvent(). Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 075a473e538efb771497b762101694b6c0c45c2b Author: Carlos Garnacho Date: Tue Jan 3 02:43:40 2012 +0100 dix: Set XITouchEmulatingPointer on events from the touch sequence emulating pointer events The internal flag is kept around, merely translated to XITouchEmulatingPointer when creating the XI2 events that will be delivered to the client. Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Reviewed-by: Chase Douglas Signed-off-by: Peter Hutterer commit e8db10a033491059ddf2b4777c9fafed14c403e8 Author: Peter Hutterer Date: Fri Jan 6 13:49:04 2012 +1000 Require inputproto 2.1.99.5 Signed-off-by: Peter Hutterer commit 223ba8b46eacbc8e573bc5136a3d6677f3e39099 Author: Peter Hutterer Date: Thu Jan 5 15:55:04 2012 +1000 dix: fix wrong condition checking for attached slave (#44003) We need to update the master if the device is not a master _and_ it is not floating. X.Org Bug 44003 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 3ce102c362cadcd7087bdcf48440d9498eaf77d0 Author: Peter Hutterer Date: Thu Jan 5 07:08:01 2012 -0500 dix: on PointerRootWin send a FocusIn to the sprite window too XTS XSetDeviceFocus-7 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit a125aabda3a5cf27aa98cb61f16e49280b66f451 Author: Peter Hutterer Date: Thu Jan 5 07:02:51 2012 -0500 dix: send focus events to the immediate parent (#44079) For a transition from windows A to B, A->parent did not receive an event. DeviceFocusOutEvents sends to windows ]from, to[, so start with the actual window, not it's parent. X.Org Bug 44079 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Reviewed-by: Keith Packard commit 75953ccb9e9e5f1dbbaa44c714716a0049e22aae Author: Peter Hutterer Date: Tue Jan 3 10:45:45 2012 +1000 xfree86: split warning about missing identifier or input driver Check for identifier first and bail if it's missing (also remove the current identifier check after we've already bailed due to missing identifiers) If a driver is missing, warn but also say that we may have added this device already. I see too many bugreports with incorrectly shortened log files. Signed-off-by: Peter Hutterer Reviewed-by: Cyril Brulebois commit 6269977c91071e0ea16ca5b4b8e15fd6db0b6fcf Author: Julien Cristau Date: Fri Dec 30 20:41:25 2011 +0100 os: don't ignore failure from dladdr If dladdr returns 0, don't go and use the returned Dl_info, it may contain garbage. X.Org bug#44315 Reported-and-tested-by: Cyril Brulebois Reviewed-by: Jeremy Huddleston Reviewed-by: Cyril Brulebois Signed-off-by: Julien Cristau commit 644efb43e0639af648dd46d9729c2cabd9511238 Author: Cyril Brulebois Date: Fri Dec 30 02:34:36 2011 +0000 linux/ia64: Fix regression after domain I/O support code removal. Side effect of aa0bfb0f133481c57762012e8e30c05ffa151423: | CCLD Xorg | sdksyms.o:(.data.rel+0x27d8): undefined reference to `outl' | collect2: ld returned 1 exit status Since the linux/ia64 domain I/O support code got removed in that commit, there's no reason to keep on declaring those functions (inb, inl, inw, outb, outl, outw). Bugzilla: https://bugs.freedesktop.org/43985 Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois commit 98cde254acb9b98337ddecf64c138d38c14ec2bf Author: Keith Packard Date: Tue Dec 27 13:42:21 2011 -0800 Bump version to 1.11.99.901 (1.12 RC1) Signed-off-by: Keith Packard commit 5037c9af78da6652189de7202e70e1b833395af5 Author: Keith Packard Date: Tue Dec 27 14:02:01 2011 -0800 glx/glapioffsets.h is no longer part of the build, remove it Signed-off-by: Keith Packard commit 8dedf9831bd80514d800f0085213296a3726dba7 Merge: cfc4c3d cf96183 Author: Keith Packard Date: Tue Dec 27 13:13:48 2011 -0800 Merge remote-tracking branch 'kibi/master' commit cfc4c3d7fa8bd4da4c08b2ab8e6f85435f75353a Author: Alan Coopersmith Date: Sat Dec 24 10:00:56 2011 -0800 Add Solaris support to DetermineClientCmd Uses /proc/pid/psinfo to read command & partial arguments. Moves cmdsize & argsize variables into non-Solaris #else clause to avoid unused variable warnings. Fixes format mismatch errors when building with DEBUG defined on a 64-bit platform (where Mask is defined as CARD32). Signed-off-by: Alan Coopersmith Reviewed-by: Rami Ylimäki Signed-off-by: Keith Packard commit a28ff2cf92c2b35e02eacca21af929afabbf6b83 Author: Chase Douglas Date: Thu Dec 22 12:00:37 2011 -0800 test/xi2: Really fix infinite loop in test_convert_XITouchOwnershipEvent long i; for (i = 1; ; i <<= 1) if (i == (1 << 31)) break; (1 << 31) is compiled as an int, and thus is equal to -2147483648. We are trying to compare it against a long, which on 64-bit machines is 2147483648. This results in an infinite loop. Signed-off-by: Chase Douglas Signed-off-by: Keith Packard commit e7df42ab68e30588a5e32ed543b0711821daf009 Author: Keith Packard Date: Thu Dec 22 09:35:51 2011 -0800 test/xi2: Fix infinite loop in test_convert_XITouchOwnershipEvent The touchid test was using a loop like: for(i = 1; i < 0xffffffff; i <<= 1) When 'i' is a 32-bit variable, this infinite loops as it goes from 0x80000000 to 0. 'i' is declared as 'long', which is 32-bit in 32-bit mode. Signed-off-by: Keith Packard commit cf96183122a85e3376e560f0360b38b5676e57a9 Author: Cyril Brulebois Date: Wed Nov 2 12:41:20 2011 +0100 xorg.conf.man: Fix bad whatis entry. Debian's QA tool “lintian” reported a bad whatis entry for the xorg.conf(.d) manpages. It comes with the following pointers: For manual pages that document multiple programs, functions, files, or other things, the part before "\-" should list each separated by a comma and a space. […] Refer to the lexgrog(1) manual page, the groff_man(7) manual page, and the groff_mdoc(7) manual page for details. Indeed, the current situation is: $ whatis xorg.conf; whatis xorg.conf.d xorg.conf (5) - (unknown subject) xorg.conf.d (5) - (unknown subject) With this patch: xorg.conf (5) - configuration files for Xorg X server xorg.conf.d (5) - configuration files for Xorg X server Reviewed-by: Alan Coopersmith Signed-off-by: Cyril Brulebois commit f75bdf7fbe757f4603e39139acc3c90538a45e15 Author: Peter Hutterer Date: Thu Dec 22 10:00:15 2011 +1000 test: fix grab mode value tests for new XIGrabModeTouch This test checks that last-valid-mode + 1 returns a BadValue. With the addition of XIGrabModeTouch, that value has changed - sync it up again. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit e395efc25f9fd60377f32c2bf1a9153d70908236 Merge: 2bb282c fcda98c Author: Peter Hutterer Date: Thu Dec 22 09:29:59 2011 +1000 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into multitouch Conflicts: configure.ac dix/inpututils.c Signed-off-by: Peter Hutterer commit 2bb282cd45cb8149b39d72397ef5bbcfebca11d2 Author: Peter Hutterer Date: Wed Dec 21 14:45:27 2011 +1000 Xi: only activate the device grab if we don't already have one If the device is already grabbed, don't activate the passive grab, it screws with our event masks. Just deliver to the grabbing client instead. Reported-by: Carlos Garnacho Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 475ef5cc8339fac3696fe654ef683f92f0b0cc2c Author: Carlos Garnacho Date: Wed Dec 21 01:08:40 2011 +0100 dix: fix xi2 mask/filter when delivering grabbed events Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 4551510f752624592f9201f73db89ac1325a234a Author: Peter Hutterer Date: Mon Dec 19 09:08:05 2011 +1000 test: add a basic test for ownership event values Signed-off-by: Peter Hutterer commit 0c661dc478b4b436a3e61066d31bc510c7a08456 Author: Peter Hutterer Date: Mon Dec 19 08:31:37 2011 +1000 test: drop printfs from protocol-eventconvert.c The test outputs are noisy enough, no need having these here too. Signed-off-by: Peter Hutterer commit 8080d785b2c1e5791312ed0975efd1b8aea58d98 Author: Peter Hutterer Date: Wed Dec 21 11:11:48 2011 +1000 dix: remove requirement for client_id be the first element Leftover code from an earlier version of GetTouchEvents. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 552de314bf0c8e4de5d002bdd1c12388c2f42283 Author: Peter Hutterer Date: Mon Dec 19 14:52:41 2011 +1000 dix: don't retrieve the syncEvents tail on an empty list An empty list points to itself but syncEvents has the list head only and is of a different format than the elements. Thus, casting it to a QdEventPtr gives us garbage. Segfaults with XTS test case Xlib13/XGrabKeyboard Introduced in 7af23259d88f4c28ed21140f82cc03b3724c06bb. Reported-by: Aaron Plattner Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 76c11e0872dedcd360cbe02cf62bb9de3b212957 Author: Peter Hutterer Date: Fri Dec 16 12:41:08 2011 +1000 dix: button state must show the logical buttons, not physical buttons If the device is mapped 3 2 1, a click on physical button 1 sends a button 3 press, but the state was set for button 1. Fix this, the state must be set for that button's logical mapping. https://bugzilla.gnome.org/show_bug.cgi?id=655928 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 8a32c39c00789c16006de61112627722ce548be1 Author: Peter Hutterer Date: Thu Dec 15 07:59:06 2011 +1000 mi: handle screen switching on pointer emulated touch events Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 48547068b115b1f5e5f46a70110454a2175fb9a4 Author: Peter Hutterer Date: Thu Dec 15 07:57:47 2011 +1000 mi: split move to new screen logic to a helper function No functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 3b1e2035cc4740711360c845cfcdff07f7b60558 Author: Daniel Stone Date: Thu Dec 15 07:52:28 2011 +1000 dix: Remove touch grabs if the grab disappears Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit cd3de8324e8908955a2e4be3000c8ffee8684c68 Author: Peter Hutterer Date: Thu Dec 15 07:48:49 2011 +1000 dix: hook up passive grabs and pointer emulated passive grabs Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 5b169cb695bd450d7f64e3800f00c9237ee67f96 Author: Carlos Garnacho Date: Tue Dec 13 15:41:23 2011 +0100 Xi: assign correct grab_mode/other_device_mode in XI2 passive grabs CreateGrab() expects the keyboard mode to be stored in grab_mode, and the pointer mode in other_device_mode, so respect this in passive XI2 grabs, and switch modes if needed. Signed-off-by: Carlos Garnacho Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 4469430b109fa2da7ba3d2fadf66eca78b7156a0 Author: Peter Hutterer Date: Thu Dec 15 07:42:12 2011 +1000 Xi: add the hooks for passive touch grabs Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit bb0af002dc9ad5b464dc6793aedb6d1ff65d001d Author: Peter Hutterer Date: Thu Dec 15 07:21:38 2011 +1000 Xi: handle grab accept/reject requests Consists mostly of generating an ownership event and processing it. Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 209b3d613a7bed126c81daedbad6461e4391e9e6 Author: Peter Hutterer Date: Tue Dec 20 16:34:43 2011 -0800 Xi: hook up touch ownership handling Ownership changes don't get processed directly when they happen, instead the DIX submits an ownership event which goes through ProcessTouchEvents and ProcessTouchOwnershipEvents. Then on the required events are generated and sent to clients. Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Reviewed-by: Chase Douglas commit 1894468c2b9788efa70ef4fb5fc911711402f3a7 Author: Peter Hutterer Date: Tue Dec 20 16:33:33 2011 -0800 Xi: hook up pointer emulation for emulating touches Includes a hack for implicit grab activation, because integrating this requires a larger rewrite and I'm not sleeping enough as it is. Right now, we deliver the event and check before/after if there is an implicit grab on. If one activated, then store the event in the grab and switch the listener type to a grab listener. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Reviewed-by: Chase Douglas commit 753c4dca1e42035e29fb21458a746e484ed93ca3 Author: Peter Hutterer Date: Wed Dec 14 17:04:38 2011 +1000 dix: add touch to pointer event conversion helper Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit c3843f5498a849920ab68cca3557411ad8ab3454 Author: Peter Hutterer Date: Wed Dec 14 17:02:30 2011 +1000 dix: add real_event parameter to ActivatePassiveGrab For touch events with pointer emulation, the event that triggers the grab (the pointer event) is not the same as the actual event (the touch event). For replaying, we need to store the real event then. No effective changes at this point, for the current caller event and real_event are identical. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit e389a19a730055d4550ff708da83c78099a516fd Author: Peter Hutterer Date: Tue Dec 20 16:32:52 2011 -0800 Process and deliver touch events Does not include pointer emulation handling. Does include partial ownership handling but not the actual processing of ownership events. Note: this commit is a retroactive commit extracted from a series of ~50 commits and may thus appear a bit more complicated than what you'd write out from scratch. Pointer processing tree is roughly: - ProcessOtherEvents - ProcessTouchEvents - DeliverTouchEvents - DeliverTouchBeginEvent|DeliverTouchEndEvent|... - DeliverOneTouchEvent Also hooks up the event history playing to the right function now. Co-authored-by: Daniel Stone Co-authored-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Reviewed-by: Chase Douglas commit 634b0da9a83076d0e9e0fc44dc5dc77b0c368bc1 Author: Peter Hutterer Date: Thu Dec 15 07:53:19 2011 +1000 dix: set core and button state based on the touch state If a pointer-emulating touch caused a button to be logically down, set that state in the input events. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit dbfd7b37a0ba21899d8ebb7e0b324301bd466c49 Author: Peter Hutterer Date: Wed Dec 14 16:33:05 2011 +1000 Xi: make UpdateDeviceState aware of touch events Update the logical button state for pointer-emulating events. Button state must be kept separate from the ButtonClassRec to avoid clearing the button state on a touch end if there is a physical button still down. And obviously don't change the button state if we're currently replaying the event history for some client. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 593c3e2eb3da5c5fb957b68c8025dfdbe1139639 Author: Peter Hutterer Date: Wed Dec 14 16:30:05 2011 +1000 dix: add TouchResourceIsOwner helper function The first listener in the sequence is the owner of the touch sequence. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 5d0260cc986e8c1f0907870b851d47fd73bb1b7d Author: Peter Hutterer Date: Wed Dec 14 16:24:17 2011 +1000 dix: add helper functions for adding/removing touch listeners The DIX will call TouchSetupListeners once for a new touch. After that the listener list remains static, with listeners only dropping out when they either reject the grab or disappear. Exception: if grabs activate they are prefixed to the listeners. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 6a68f97ce6704dd2ff2a50f91acd2da72c9995bd Author: Chase Douglas Date: Wed Dec 14 16:26:04 2011 +1000 dix: add TouchGetPointerEventType helper function Returns the respective pointer event type for a given touch event type. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 8e58ce73c8b79cb86e890369d0216cdd850c52a5 Author: Daniel Stone Date: Wed Dec 14 16:53:04 2011 +1000 dix: when a window disappears, remove it from the touch sprite trace Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit c18a173cf5f53778356c5e8f25ab132956f8c27d Author: Daniel Stone Date: Wed Dec 14 16:03:01 2011 +1000 dix: add helper functions to build up/verify the sprite trace Touch events' sprite trace stays the same for the duration of the touch sequence. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Reviewed-by: Chase Douglas commit 40475261eacabb79a824db1138407a9d0f9fe37f Author: Peter Hutterer Date: Wed Dec 14 15:56:05 2011 +1000 dix: add touch event history helper functions If touch client has not registered for ownership events and a grab above that client is rejected, the client needs to receive the complete event history. The history currently doesn't really do fancy overflow handling. We assume that the first TOUCH_HISTORY_SIZE events are the important ones and anything after that is dropped. If that is a problem, fix the client that takes > 100 event to decide whether to accept or reject. Events marked with TOUCH_CLIENT_ID or TOUCH_REPLAYING must not be stored in the history, they are events created by the DIX to comply with the protocol. Any such event should already be in the history anyway. A fixme in this patch: we don't have a function to actually deliver the event yet. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit b274c472a5ad700aea5fe651d677e8cb34ffc976 Author: Peter Hutterer Date: Wed Oct 26 09:08:17 2011 +1000 Support XI 2.2 officially Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit d2af968cb65873780a6e61342d5d3c23b9654e2a Author: Daniel Stone Date: Wed Dec 14 15:45:19 2011 +1000 Xi: allow selecting for touch events Selecting for any of XI_TouchBegin/Update/End/Ownership requires the three bits for begin/update/end to be set. Only one client at a time may select for XI_TouchBegin event Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit f3df3ad668fcd417ffb5afa3bea79a73a348bc1a Author: Peter Hutterer Date: Wed Dec 14 16:45:04 2011 +1000 dix: handle DIX-submitted touch events The DIX needs to submit touch events for e.g. TouchEnd after an acceptance/rejection. These have the TOUCH_CLIENT_ID flag set. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit fcda98c48610fd507ca0b89c6006a5497d9dc1c9 Author: Peter Hutterer Date: Fri Dec 16 12:41:08 2011 +1000 dix: button state must show the logical buttons, not physical buttons If the device is mapped 3 2 1, a click on physical button 1 sends a button 3 press, but the state was set for button 1. Fix this, the state must be set for that button's logical mapping. https://bugzilla.gnome.org/show_bug.cgi?id=655928 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 47da6b6b2c2e9245422655f94770146fb8cd430b Author: Peter Hutterer Date: Mon Dec 19 14:52:41 2011 +1000 dix: don't retrieve the syncEvents tail on an empty list An empty list points to itself but syncEvents has the list head only and is of a different format than the elements. Thus, casting it to a QdEventPtr gives us garbage. Segfaults with XTS test case Xlib13/XGrabKeyboard Introduced in 7af23259d88f4c28ed21140f82cc03b3724c06bb. Reported-by: Aaron Plattner Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 2d34b34ed7547b829979756ccfb2cff79368d0a4 Merge: e4b4d83 1deede3 Author: Keith Packard Date: Tue Dec 20 00:23:33 2011 -0800 Merge remote-tracking branch 'jeremyhu/master' commit e4b4d83fad37bb737e25f7226dbcd15b892f9528 Merge: 4df65d2 d26cb70 Author: Keith Packard Date: Mon Dec 19 22:36:31 2011 -0800 Merge remote-tracking branch 'idr/glx-fixes' commit 4df65d247b56c6b1b06e17a61236d6637312cdbb Author: Ville Syrjälä Date: Sun Dec 18 18:29:41 2011 +0200 dri2: Invalidate window pixmaps While a redirected window is flipped, its pixmap may still be used as and EGL image and should also get invalidated. When sending invalidate events for a window, also send the events for its pixmap. Signed-off-by: Ville Syrjälä Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit e8fd23fad046877ca0ee08c1e147557756debc8e Author: Keith Packard Date: Sun Dec 18 18:29:40 2011 +0200 dri2: Invalidate DRI2 buffers for all windows with the same pixmap on swap Without this, when a compositing manager unredirects a fullscreen window which uses DRI2 and page flipping, the DRI2 buffer information for the compositing manager's output window (typically the Composite Overlay Window or root window) may become stale, resulting in all kinds of hilarity. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35452 . [Original patch by Michel Dänzer ] [Tree walk optimized version by Keith Packard ] Signed-off-by: Ville Syrjälä Signed-off-by: Keith Packard commit 6f916ffec7767eeab62132eb6575043969104c81 Author: Michel Dänzer Date: Sun Dec 18 18:29:39 2011 +0200 dri2: Always re-generate front buffer information when asked for it. Otherwise we might keep stale cached information, e.g. after the driver performed page flipping. This is part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=35452 . Signed-off-by: Michel Dänzer Reviewed-by: Ville Syrjälä Reviewed-by: Mario Kleiner Signed-off-by: Keith Packard commit 603fcb3abf155e91fd3250f4a7aa16f289506e8e Author: Rami Ylimäki Date: Sun Dec 18 18:29:38 2011 +0200 dri2: Initialize needInvalidate member of DRI2Drawable. If the client is not behaving correctly and swaps buffers before getting them, Valgrind will complain about uninitialized memory being used in DRI2InvalidateDrawable. Signed-off-by: Rami Ylimäki Reviewed-by: Ville Syrjälä Signed-off-by: Keith Packard commit 3aca8199405cff5097ee5813605ec78b5ae44a43 Author: Peter Hutterer Date: Fri Dec 16 09:15:25 2011 -0500 dmx: force -fno-strict-aliasing for xinput example Compiler warning: xinput.c:272: warning: dereferencing pointer 'e' does break strict-aliasing rules The code itself is the usual XInput client-side code: XEvent event; XDeviceMotionEvent *e = (XDeviceMotionEvent *)&event; XNextEvent(display, &event); printf("%d\n", e->type); Since XDeviceMotionEvent is not guaranteed the same size as XEvent, clients must use pointer aliasing as above when using the XNextEvent API. Disable strict aliasing for this example. Reviewed-by: Peter Hutterer Reviewed-by: Gaetan Nadon Signed-off-by: Peter Hutterer Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 1deede3c48d5ac91f50774c79f02afc6e036614e Author: Jeremy Huddleston Date: Sat Dec 17 12:56:59 2011 -0800 kdrive/linux: Fix compilation with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast Reported-by: Arkadiusz Miśkiewicz Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit d0170d54c71fc761b8f1ae7a0e555dc2ca23cf9c Author: Jeremy Huddleston Date: Sat Dec 17 12:25:26 2011 -0800 configure.ac: Make Xephyr dependency error message more informative Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit 511beddffab3c4fd43c75556132159117b6ba884 Author: Jeremy Huddleston Date: Fri Nov 25 09:45:25 2011 -0800 XQuartz: Provide in-tree implementation of strndup(3) if needed This function was added to Mac OS X 10.7, so we need to provide it for earlier releases. Signed-off-by: Jeremy Huddleston commit 9ce8463a3334f76f128bb35b541aa6e67b4e4374 Author: Daniel Stone Date: Wed Dec 14 15:41:07 2011 +1000 dix: generate touchpoints from driver-submitted data The touchpoints are generated, enqueued but not processed since we don't handle them in the event processing yet. Co-authored-by: Peter Hutterer Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit bec51f5ec6575a1971ae5371a4b6d8563933032c Author: Daniel Stone Date: Wed Dec 14 15:29:48 2011 +1000 dix: add GetTouchOwnership event API No callers yet. This API is not to be used by drivers, it's an API for the DIX which will create ownership events mainly on touch acceptance/rejection. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 5c63dc6dbcbebbb19d79575a9f1ec9878e6537f1 Author: Peter Hutterer Date: Wed Dec 14 14:57:46 2011 +1000 dix: add DIX API to create touchpoints The DIX touchpoints are the ones used for event processing. Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 7f8127d203394cae45c3ded0d063030d7c5fdb70 Author: Peter Hutterer Date: Wed Dec 14 14:53:52 2011 +1000 dix: if we run out of space for new touch events, resize the queue The SIGIO handler forces us to drop the current touch and schedule the actual resize for later. Should not happen if the device sets up the TouchClassRec with the correct number of touchpoints. Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit d26cb70272a1245a7b1db639cebeddafd8ed4c40 Author: Ian Romanick Date: Thu Dec 8 12:07:38 2011 -0800 glx: use dispatch.h instead of glapioffsets.h Signed-off-by: Ian Romanick Reviewed-by: Adam Jackson commit 66e6037c334c2bcfe6e60d24cac83a8d6087fdd5 Author: Ian Romanick Date: Mon Dec 5 15:27:08 2011 -0800 glx: Regenerate GL API files from Mesa Adam reviewed the underlying changes in the Mesa generated scripts. Signed-off-by: Ian Romanick Reviewed-by: Adam Jackson commit e8485768c1f1d9d9fb7ca9e52ff61175b7bb80e1 Author: Ian Romanick Date: Tue Dec 6 12:30:17 2011 -0800 glx: Add stub implementations of next GLX extension functions Generated code from Mesa contains dispatch for GLX_ARB_create_context and GLX_ARB_create_context_profile. Provide stub implementations of these functions so that the GLX extension will link. Signed-off-by: Ian Romanick Reviewed-by: Adam Jackson commit 2df539c0bc3300ea858f8bc7d52e95e67ff379b8 Author: Ian Romanick Date: Mon Dec 5 14:42:35 2011 -0800 glx: Only declare GlxExtensionInit in one header file This silences the GCC warning: In file included from singlepixswap.c:36:0: glxext.h:47:13: warning: redundant redeclaration of 'GlxExtensionInit' [-Wredundant-decls] glxserver.h:80:6: note: previous declaration of 'GlxExtensionInit' was here Signed-off-by: Ian Romanick Reviewed-by: Adam Jackson commit 758bc57ba5a89f765d83f0b169aa09e79a89bf89 Author: Peter Hutterer Date: Wed Dec 14 14:48:56 2011 +1000 dix: add helper functions to create DDX touch recs DDX touch points are the ones that keep records of the driver-submitted touchpoints. They're unaffected by the grab state and terminate on a TouchEnd submitted by the driver. The client ID assigned is server-global. Since drivers usually submit in the SIGIO handler, we cannot allocate in the these functions. Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 1a133eb8b1ddbe0da7c2fbf7f6a686ec4512373e Author: Peter Hutterer Date: Thu Dec 15 08:30:02 2011 +1000 xfree86: bump the input ABI for the touch changes New additions to the API: - InitTouchClassDeviceStruct - xf86PostTouchEvent Changes to the ABI: - DeviceIntRec now contains a TouchClassPtr Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 3fb258ca28850c998097b55884774cb95f476f69 Author: Daniel Stone Date: Wed Dec 14 12:46:40 2011 +1000 input: add a TouchClassRec to the devices These structs will be used to store touch-related data, events and information. Drivers must call InitTouchClassDeviceStruct to set up a multi-touch capable device. Touchpoints for the DDX and the DIX are handled separately - touchpoints submitted by the driver/DDX will be stored in the DDXTouchPointInfoRec. Once the touchpoints are processed by the DIX, new TouchPointInfoRecs are created and stored. This process is already used for pointer events with the last.valuators field. Note that this patch does not actually add the generation of touch events, only the required structs. TouchListeners are (future) recipients of touch or emulated pointer events. Each listener is in a state, depending which event they have already received. The type of listener defines how the listener got to be one. Co-authored-by: Peter Hutterer Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 098b837440e40bbc485368ec9658e12efd6ef581 Author: Daniel Stone Date: Wed Dec 14 14:41:48 2011 +1000 Add the touch input API stubs xf86PostTouchEvent is the driver API to submit touch events to the server. This API doesn't do anything yet though but now we can at least bump the API. For valuators, drivers should use the existing xf86InitValuatorAxisStruct function. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 93c2a1628a9f6e7480d834bf55c080997fd18911 Author: Peter Hutterer Date: Wed Dec 14 13:51:12 2011 +1000 Hook up the ownership events This patch applies most of the protocol conversions and the internal event type for ownership events. Note that ownership events are generated by the DIX only, they do not pass through the event queue. Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit c065f7b16329e30cb976359e0a807c2adaf50123 Author: Keith Packard Date: Sat Dec 17 17:22:45 2011 -0800 Version 1.11.99.2 (1.12 snapshot 2) Signed-off-by: Keith Packard commit ead968a4300c0adeff89b9886e888b6d284c75cc Author: Antoine Martin Date: Sat Dec 17 01:36:51 2011 +0700 xserver: check for elevated privileges not uid=0 This allows us to run the server as a normal user whilst still being able to use the -modulepath, -logfile and -config switches We define a xf86PrivsElevated which will do the checks and cache the result in case it is called more than once. Also renamed the paths #defines to match their new meaning. Original discussion which led to this patch can be found here: http://lists.freedesktop.org/archives/xorg-devel/2011-September/025853.html Signed-off-by: Antoine Martin Tested-by: Michal Suchanek Reviewed-by: Jamey Sharp Reviewed-by: Adam Jackson commit 3390d3fc0347947796aa245d70fefecf59b7bfe4 Author: Peter Hutterer Date: Wed Dec 14 13:21:59 2011 +1000 Xi: process raw touch events No-one can generated them yet, but if they could, we'd be processing them like there was no tomorrow. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 84db813b9db34975b5fe288a8a551bb98f0cc1c1 Author: Peter Hutterer Date: Wed Dec 14 12:45:28 2011 +1000 Hook up TouchBegin/Update/End events The are the same as device events internally but require the touch ID separately from the detail.button field (the protocol uses the detail field for the touch id). For simpler integration of pointer emulation we need to set the detail.button field while keeping the touchid around. Add the three new touch event types to the various places in the server where they need to be handled. The actual handling of the events is somewhat more complicated in most places. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 92a5862d0c120b009a688237ec7142b7c21ae272 Author: Peter Hutterer Date: Wed Dec 14 15:00:33 2011 +1000 include: add a bunch of flags for GetTouchEvent processing TOUCH_CLIENT_ID is set if the touch was generated from a client ID instead of a DDX/driver touch ID. i.e. submitted by the dix. TOUCH_END is a special flag that's required to force the touch to end. Since the protocol with grab replaying and pointer emulation is rather complex, it's quite hard to know otherwise when a touch sequence should really die. The others do what it says on the imaginary box. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 956a97487beada8cf5f354550ff779635cc64361 Author: Peter Hutterer Date: Wed Dec 14 12:19:27 2011 +1000 include: RawTouchEnd is the last event now Plus, use the actual definition from the protocol instead of the numeric values. Turns out not everyone knows the protocol event IDs by heart. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 92c6c0c1d2d6a8882ed97b0e7f2952978ee5ce82 Author: Peter Hutterer Date: Wed Dec 14 12:15:29 2011 +1000 tests: update for touch support Touch event mask must be set for all three event types. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Chase Douglas commit 731b1db2fcc82c0a8afd28d7f28363c1db0a20ce Author: Peter Hutterer Date: Wed Dec 14 10:41:17 2011 +1000 Require inputproto 2.1.99.3 Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Chase Douglas commit 4c825eae89063fdc2241f92ab4101ba682b5b4b7 Author: Peter Hutterer Date: Wed Nov 2 10:38:26 2011 +1000 Xi: add a FIXME All the DeepCopy stuff really needs to be shared between the init calls the drivers use and this code here. Too many bugs by not keeping the two in sync. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Chase Douglas commit 0b9d2e426defabbf6df7e872e158b080a6a5e0be Author: Peter Hutterer Date: Wed Dec 14 13:21:03 2011 +1000 Xi: split ProcessOtherEvent into ProcessDeviceEvent No functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Chase Douglas commit 190a6f45ee7412870b3d95c5db6c1079a285bc59 Author: Peter Hutterer Date: Fri Dec 16 09:52:43 2011 +1000 dix: split positionSprite into scale_to_desktop and positionSprite For future touch points, we need positionSprite to calculate the coordinates but we don't want to actually change the cursor position for non-emulating touches. No functional changes at this point. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Chase Douglas commit 2c1d0a539c0fb1860ac89a00d1fb609f1959e1b6 Author: Gaetan Nadon Date: Fri Dec 9 07:45:02 2011 -0500 dmx: fix distcheck failure, missing compsize.h in Makefile.am which was added in commit: dmx: Build fix for -Werror=implicit-function-declaration Reviewed-by: Peter Hutterer Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit ff6d9c79c1aa502f1aef81d8063425e5fc002534 Author: Peter Hutterer Date: Thu Dec 15 10:19:26 2011 +1000 include: fix BUG_WARN_MSG for constant messages only Previous declaration required the use of a message + printf varargs. We obviously want to allow the use of just a message. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit f7ea7a324520844beaac8be7503ac50e20da5ab1 Author: Peter Hutterer Date: Wed Dec 14 10:34:19 2011 +1000 configure: split the required modules up We do the same thing for libraries and optional modules already, and it's much easier to read when one of them changes Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Gaetan Nadon Signed-off-by: Keith Packard commit 7da7aa96a0acb895e1fe57a9d3f2d093479cf2a2 Merge: b79de3f 7528a6b Author: Keith Packard Date: Wed Dec 14 11:40:10 2011 -0800 Merge remote-tracking branch 'whot/for-keith' commit 4c80dc1394344dc10cffe4f757c980944312dc3d Author: Peter Hutterer Date: Wed Dec 14 10:31:23 2011 +1000 configure: split the required modules up We do the same thing for libraries and optional modules already, and it's much easier to read when one of them changes Signed-off-by: Peter Hutterer commit 7528a6b88eb32098af4369a8bd9d70a808fa6f1c Merge: f0de5e3 898d976 Author: Peter Hutterer Date: Tue Dec 13 14:19:54 2011 +1000 Merge branch 'for-whot' of git://people.freedesktop.org/~alanc/xserver into for-keith commit f0de5e3990b70df9899b7dd17d7ee6ff7c768183 Author: Peter Hutterer Date: Sun Dec 11 07:31:43 2011 +1000 dix: add a MAXEVENTS define for the number of core + extension events Not including GenericEvents Signed-off-by: Peter Hutterer Reviewed-by: Walter Harms Reviewed-by: Chase Douglas commit adf8a0d62c0643f4c44a3b6d2e3c6c9b02532915 Author: Peter Hutterer Date: Fri Dec 9 18:38:53 2011 +1000 dix: move event filter retrieval helpers to inpututils.c No functional changes Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Chase Douglas commit a03fe819506fbcbfcb299d4919d16061603fd4ec Author: Peter Hutterer Date: Fri Dec 9 18:02:49 2011 +1000 dix: switch EventIsDeliverable to take the event type only Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Chase Douglas commit 10a8c428fac0d4ff8f8a3e3487c13dd349d27ed7 Author: Peter Hutterer Date: Fri Dec 9 15:49:04 2011 +1000 dix: move storing last.valuators into a helper function Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit a15abf82ddb5a209dbc30c4d12e1dc23c4adf3e4 Author: Peter Hutterer Date: Thu Dec 8 15:38:44 2011 +1000 dix: always allocate and set the grab's sync.event Allocate the memory at device creation time and always store the event, even if we're not frozen. This way we know which event triggered the grab. Since the event was never freed anyway except on device shutdown, this doesn't really change things much. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 218752bdc5d9323d1e6202e762573a925cf8a4eb Author: Peter Hutterer Date: Thu Dec 8 14:27:01 2011 +1000 input: replace GRABTYPE_* with the InputLevel enums They achieve the same thing, re-use the more generic InputLevel so we can convert to/fro easier. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit cd56bd7b3ee34a4b10eb3a57a6e94cac7512167a Author: Peter Hutterer Date: Thu Dec 8 14:59:06 2011 +1000 Add GrabIsPointerGrab and GrabIsKeyboardGrab helpers No functional changes Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 47734b2ba2e1f9246fd1a3b7059ca60b0e15acb2 Author: Peter Hutterer Date: Thu Dec 8 12:00:34 2011 +1000 dix: move delivery stop condition out of event mask Previously, this was only called if there was a mask match, so even if we had a no-propagate flag set or a stopAt window specified, if no mask triggered on the window we would recurse up to the root window and eventually deliver. Move this, so that the stopAt and do-not-propagate mask is honoured. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 1d01e861b69d7ca8fe2335270b8286bc115fb6e9 Author: Peter Hutterer Date: Thu Dec 8 10:22:26 2011 +1000 dix: split out core state and event state setting into helper functions no functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit fb010c543696b781a83b945f72865b7d7b75bf95 Author: Peter Hutterer Date: Wed Dec 7 14:41:18 2011 +1000 dix: move grab matching code into a helper function No functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit d253a262c2c690357a4db7e235c48ab5dd0b77f8 Author: Peter Hutterer Date: Wed Dec 7 13:57:25 2011 +1000 dix: split core grab interference check into helper function No functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 97d79dd740ed1ac4eb02b0d4135850f953716278 Author: Peter Hutterer Date: Wed Dec 7 13:54:28 2011 +1000 dix: compare the grab type, not the tempGrab type No functional change. To get here, GrabMatchesSecond() needs to be TRUE and for that the two grab types must be identical. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit b9d6ae42b686287d7d23c2eefe2b12da98fe6ff8 Author: Peter Hutterer Date: Wed Dec 7 15:43:31 2011 +1000 dix: remove event type check Can't remember why this is there but we'll need to pass in XI2 events soon, so this check is obsolete. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 80816366aa77f1730a1b6ddabfa55a946d76d494 Author: Chase Douglas Date: Fri Nov 25 13:57:03 2011 -0800 dix: Split ActivatePassiveGrab() from CheckPassiveGrab() The changed logic means we don't require the explicit grab = NULL setting and early exit anymore. Not 100% of it, but if we see that message pop up in a log we know it's broken. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 9ee62cd8ce3c3effc3663f3d56b322385ce12fdb Author: Chase Douglas Date: Thu Nov 17 17:40:24 2011 -0800 dix: Move grab check and activation logic to CheckPassiveGrab() This is needed for future pointer emulation work. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit c53651dabc66aeb9882819a404a799a364f00a29 Author: Peter Hutterer Date: Tue Dec 6 12:57:38 2011 +1000 dix: move EventDeliveryState into a header file, we'll need it elsewhere Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 86c3137c81e924bacd919e9d65809e07afeabbff Author: Peter Hutterer Date: Tue Dec 6 12:04:11 2011 +1000 Xi: split updating button count and state into helper functions Functional change: for a button mapped to 0, the motionHintWindow is not updated to the NullWindow anymore. Before it got updated unconditionally to the button mapping. I have no idea what the practical effect of this is, but I guess it's closer to the correct behaviour: pressing a button that's logically disabled now does not disrupt the motion hint delivery. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit e0f37250ffff5dcb3bc0e8cad63439995ce01a20 Author: Peter Hutterer Date: Tue Dec 6 11:40:33 2011 +1000 Xi: deduplicate button motion mask setting No functional changes Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 6eff14a789341d366b3013c5aa020e959c954651 Author: Peter Hutterer Date: Mon Dec 5 18:54:30 2011 +1000 dix: deduplicate callers of DeliverDeviceEvents in DeliverGrabbedEvents No functional change. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 93945b0a74aa8156a88f52b8ba77f1210042f396 Author: Peter Hutterer Date: Mon Dec 5 18:42:05 2011 +1000 dix: split grab event conversion and delivery into a helper function Effective functional change: XI2 events are checked with XACE now. DeliverOneGrabbedEvent is exported for future use by touch events. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit c81cdb0862e2184f033b3933e6bacbe0809ef2c0 Author: Peter Hutterer Date: Mon Dec 5 18:29:27 2011 +1000 dix: replace conversion errors with BUG_WARN_MSG Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 6368c2aa4613a7c7eb0e8afca8d41f1a9bc4fc4d Author: Peter Hutterer Date: Mon Dec 5 16:46:18 2011 +1000 dix: deduplicate event delivery code Move all the event delivery code into DeliverOneEvent, based on the InputLevel we're sending to. Functional change: we now check XI2 events with XACE too. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 7e2207548b3173afc9accb5ccd532c181a7b94ed Author: Chase Douglas Date: Wed Dec 7 20:32:28 2011 +1000 include: Add an InputLevel enum Currently unused, but will be in the future. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 898d97672907a8074031d0d1038cd44bb5caf40d Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 verify_internal_event: preserve constness of data pointer All we're using it for is ErrorF calls, so make it a const char * to stop gcc from warning: inpututils.c: In function 'verify_internal_event': inpututils.c:629:9: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 79d09647d878e66721a778979a9eb1f4bba5f8d6 Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 Use const cast in BitIsOn macro to avoid angering gcc Fixes gcc warnings such as: inpututils.c: In function 'valuator_mask_isset': inpututils.c:498:5: warning: cast discards qualifiers from pointer target type inpututils.c: In function 'CountBits': inpututils.c:613:9: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 99dfe9b1de09cb481e95bd4c45dcf7493480798b Author: Alan Coopersmith Date: Mon Dec 12 16:49:32 2011 -0800 Fix deconstifying cast warning in xi2_get_type Since we're just comparing values in the struct, cast it to a const xGenericEvent * to clear gcc warning of: events.c: In function 'xi2_get_type': events.c:193:5: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit dd80156bf05c9eb4000d0981e00d0d9fb69a94f6 Author: Alan Coopersmith Date: Wed Dec 7 22:58:45 2011 -0800 Include client name if available in PrintDeviceGrabInfo Also adds missing newline to first line of output. Before patch: [3581472.414] (II) Printing all currently active device grabs: [3581472.414] Active grab 0x1800000 (core) on device 'Virtual core pointer' (2): client pid 26174 uid 0 gid 10 [3581472.415] at 3581469139 (from active grab) (device thawed, state 1) [3581472.415] core event mask 0x0 [3581472.415] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581472.415] Active grab 0x1800000 (core) on device 'Virtual core keyboard' (3) : client pid 26174 uid 0 gid 10 [3581472.415] at 3581469139 (from active grab) (device thawed, state 1) [3581472.415] core event mask 0x3 [3581472.415] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581472.415] (II) End list of active device grabs After patch: [3581736.601] (II) Printing all currently active device grabs: [3581736.601] Active grab 0x1600000 (core) on device 'Virtual core pointer' (2): [3581736.601] client pid 26741 /usr/bin/xscreensaver -nosplash [3581736.601] at 3581735000 (from active grab) (device thawed, state 1) [3581736.601] core event mask 0x0 [3581736.601] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581736.601] Active grab 0x1600000 (core) on device 'Virtual core keyboard' (3) : [3581736.601] client pid 26741 /usr/bin/xscreensaver -nosplash [3581736.601] at 3581735000 (from active grab) (device thawed, state 1) [3581736.601] core event mask 0x3 [3581736.601] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581736.601] (II) End list of active device grabs Signed-off-by: Alan Coopersmith Reviewed-by: Rami Ylimäki commit b79de3f42ff8412dcabf2f2a805cbcbd1c6907c3 Author: Alan Coopersmith Date: Mon Dec 12 16:49:35 2011 -0800 xf86 parser: convert Error to a varargs macro to clear gcc format warnings Previously it always passed a format string with exactly one argument, using NULL when the format string needed none. Now pass the right number of arguments to clear gcc warnings of 'too many arguments for format'. Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 7801b3dcd6501e3de93a6d2cee93b2593806e922 Author: Alan Coopersmith Date: Mon Dec 12 16:49:35 2011 -0800 Add some printf format attributes suggested by gcc Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit f68df9dfd2c7ca03c24aaa0a895b7191ecb81e85 Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 xf86Priv.h: Add some noreturn attributes suggested by gcc Both functions call exit() at the end and have no other return path. Also correct comment/heading to reflect commit 6450f6ca7ee0 moving DoShowOptions into xf86Configure.c. Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 3823eedf3c124d3a20360480ba349bea72de3069 Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 Remove duplicate declarations of KdAdd*Driver in kdrive.h Clears gcc warnings in every file that includes kdrive.h: kdrive.h:507:1: warning: redundant redeclaration of 'KdAddPointerDriver' kdrive.h:225:6: note: previous declaration of 'KdAddPointerDriver' was here kdrive.h:510:1: warning: redundant redeclaration of 'KdAddKeyboardDriver' kdrive.h:284:6: note: previous declaration of 'KdAddKeyboardDriver' was here Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 471e5373b6f87336dac3b9de9b3852f63a2b10dc Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 Remove duplicate declaration of xf86ValidateModesFlags in xf86Modes.h Clears gcc warning in every file that includes xf86Modes.h: xf86Modes.h:102:1: warning: redundant redeclaration of 'xf86ValidateModesFlags' xf86Modes.h:72:1: note: previous declaration of 'xf86ValidateModesFlags' was here Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 41dd7cf673e47ab74c5065b8dbf268b2e5facb64 Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 _XkbFilterDeviceBtn: move variable declarations to match usage scope The main body of this function is an if { } else if { } pair of blocks. Previously there was int button at the top level scope which is used only in the first block, and a redeclaration of int button inside the second block. Since there's no overlap in the code paths for the two uses of button, move the one from the outer block into the first block to help the programmer more quickly determine they are unrelated usages, and to silence the gcc warning of: xkbActions.c: In function '_XkbFilterDeviceBtn': xkbActions.c:999:6: warning: declaration of 'button' shadows a previous local xkbActions.c:955:6: warning: shadowed declaration is here For consistency, move DeviceIntPtr dev declarations as well that are used in the same way. Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit d8eb9b5faa2d2c9350bdaffef8749a9cac3c87b8 Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 XkbFindSrvLedInfo: remove extraneous name-clashing sli variable Variable is already defined outside the outer if statement, and there's no need to redefine inside the if statement. No point in setting sli before if (dev->kbdfeed->xkb_sli==NULL) check - if check is true, we immediately set it, if check is false, we immediately return without further reference or use of it. The one thing we do with it inside the inner if statement is store an allocation in it for a brief moment before writing to the final destination, which is immediately returned to the caller. In short, there's no benefit to the variable at all in this block, it just gives the optimizer more code to figure out how to omit. Fixes gcc warning: xkbLEDs.c: In function 'XkbFindSrvLedInfo': xkbLEDs.c:683:19: warning: declaration of 'sli' shadows a previous local xkbLEDs.c:679:18: warning: shadowed declaration is here Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 9edfa47bd58cd318d57d0f114714fd146be35a79 Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 KdParseFindNext: Constify delim argument It's only used as input to strchr to find the delimiters, never written to. Clears a bunch of gcc warnings of the form: kdrive.c:323:2: warning: passing argument 2 of 'KdParseFindNext' discards qualifiers from pointer target type kdrive.c:261:1: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit ff64ad6c74a3e14ca34bacb8866bdbd2262bddff Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 Convert KdDoSwitchCmd to use asprintf instead of malloc/strcat/etc. Also fix the reason argument to be const char * to clear several gcc warnings of: kdrive.c:151:2: warning: passing argument 1 of 'KdDoSwitchCmd' discards qualifiers from pointer target type kdrive.c:116:1: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 5bc590bde23ce1c57015b1d9e1cc63189c37448e Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 DoShowOptions: preserve constness of options list as we walk it Since all we do with the option list is walk down the list printing the names, there's no need to cast away its constness. Clears gcc warning: xf86Configure.c: In function 'DoShowOptions': xf86Configure.c:781:4: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 71efd868282d47a6db405a16de18ac322926962b Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 x86emu: constify debug strings Strings are all pointers to literal constants, just used as input to printf calls when debugging is enabled. Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit d5a5eece670dee963765eab1431c21525c16d9ee Author: Alan Coopersmith Date: Mon Dec 12 16:49:34 2011 -0800 CompareISOLatin1Lowered: constify arguments Allows callers to avoid deconstifying arguments when calling, fixing gcc warning: filter.c: In function 'PictureGetFilterId': filter.c:59:2: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 83ac9502ea9f1dedf3a8002745668af16bb1f2af Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 xdmcp.c: fix three small const warnings xdmcp.c:63:36: warning: initialization discards qualifiers from pointer target type xdmcp.c: In function 'XdmcpRegisterConnection': xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c: In function 'get_mcast_options': xdmcp.c:1596:21: warning: initialization discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 3839d1480877818f3ccc04e25237d853bab210c3 Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 LockServer: store path to LOCKDIR literal string in a const char * And instead of initializing to NULL, then resetting to LOCKDIR almost immediately (before ever using the NULL value), skip directly to setting it to LOCKDIR. tmppath variable is only used as input for generating the path name via calls to strlen, sprintf, etc. Fixes gcc warning of: utils.c: In function 'LockServer': utils.c:259:11: warning: assignment discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit af4113bfeb1d155f5f037c3492e50513336fa4a7 Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 WriteToClient: preserve constness of buf while extracting length value Fixes gcc warning: io.c: In function 'WriteToClient': io.c:826:6: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 2c9800f91559fbb12dd276cf0536631104092f67 Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 OsInit: store "/dev/null" in a const char * It's only passed as the input side of a strcpy and as the filename to fopen, so doesn't need to be non-const. Fixes gcc warning: osinit.c: In function 'OsInit': osinit.c:154:28: warning: initialization discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 50b1097643934c8caec9530e5eda6ed6534aaf61 Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 Constify the reason string throughout the authorization check framework Almost all of the places the string is assigned point to a literal string constant, so use const char * for those, and const char ** for function calls that return it via an argument. Fortunately the top level function, ClientAuthorized, which returns the string as its return value is called from only one place, ProcEstablishConnection. ProcEstablishConnection stores either that return value or a string literal in char *reason. It only uses reason as an argument to SendConnSetup. SendConnSetup passes the reason argument to strlen & WriteToClient, both of which already have const qualifiers on their args. Thus added const to the reason variable in ProcEstablishConnection and the reason argument to SendConnSetup. Fixes gcc warnings: dispatch.c: In function 'ProcEstablishConnection': dispatch.c:3711:9: warning: assignment discards qualifiers from pointer target type auth.c: In function 'CheckAuthorization': auth.c:218:14: warning: assignment discards qualifiers from pointer target type auth.c:220:20: warning: assignment discards qualifiers from pointer target type connection.c: In function 'ClientAuthorized': connection.c:683:3: warning: return discards qualifiers from pointer target type mitauth.c: In function 'MitCheckCookie': mitauth.c:88:13: warning: assignment discards qualifiers from pointer target type xdmauth.c:259:14: warning: assignment discards qualifiers from pointer target type xdmauth.c:270:14: warning: assignment discards qualifiers from pointer target type xdmauth.c:277:11: warning: assignment discards qualifiers from pointer target type xdmauth.c:293:15: warning: assignment discards qualifiers from pointer target type xdmauth.c:313:14: warning: assignment discards qualifiers from pointer target type xdmauth.c:322:11: warning: assignment discards qualifiers from pointer target type rpcauth.c: In function 'SecureRPCCheck': rpcauth.c:136:10: warning: assignment discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 99998196017ef38ec88459b50605aa20f628788b Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 Constify string for authorization protocol names gcc was warning from storing string constants in a char *name field: auth.c:64:1: warning: initialization discards qualifiers from pointer target type auth.c:72:1: warning: initialization discards qualifiers from pointer target type auth.c:81:1: warning: initialization discards qualifiers from pointer target type Making the field const requires changing AuthorizationFromID to take a const char ** pointer for the name argument which it sets to point to the matching name entry. Changing that argument requires changing its sole caller in the security extension to pass the address of a const char * variable to it, which it can do, since the only thing it does with the returned name is to pass it back to the RemoveAuthorization function that already expects a const char *name. Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 01834e99e461e2a8354f3b4aef7f14c5e83fa255 Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 os/access.c: replace acmp & acopy macros with memcmp & memcpy calls No need to cast to char * now that all supported platforms use C89-standard void * argument types, so just drop the casts from acmp & acopy macros, which clears the gcc warnings for places const pointers were cast non-const: access.c: In function 'DefineSelf': access.c:786:3: warning: cast discards qualifiers from pointer target type access.c:795:6: warning: cast discards qualifiers from pointer target type access.c: In function 'NewHost': access.c:1293:9: warning: cast discards qualifiers from pointer target type access.c:1298:6: warning: cast discards qualifiers from pointer target type access.c:1309:5: warning: cast discards qualifiers from pointer target type Without the casts, acmp & acopy are just a funny way to write memcmp & memmove, so drop the macros and inline the calls, taking care to swap the first two arguments to memmove since it had swapped them. Since all the calls to memmove end up being to non-overlapping memory (mostly copying from an existing pointer to a newly allocated one), replace those with memcpy. And finally, don't actually call memcpy to copy 0 bytes from one place to another, since that's just a waste of a perfectly good function call. Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 020d83d361b0ab54ac962e97b12935be785f9a67 Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 xres.c: Preserve constness of string returned by LookupResourceName MakeAtom now accepts a const char * so we don't need to cast down to char * anymore. Fixes gcc warning of: xres.c: In function 'ProcXResQueryClientResources': xres.c:155:6: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 2ddae8f0bd2a9ce0cd15bf3848393af29e615acf Author: Alan Coopersmith Date: Mon Dec 12 16:49:33 2011 -0800 constify strings in resource name registry LookupResourceName already returned a const char *, so just needed to change the variable we're storing the list in to be a const char ** and then add const to the name argument to RegisterResourceName (which just stores name in the array) and CreateNewResourceType (which just passes name to RegisterResourceName). Clears a bunch of gcc warnings of the form: registry.c:319:5: warning: passing argument 2 of 'RegisterResourceName' discards qualifiers from pointer target type registry.c:200:1: note: expected 'char *' but argument is of type 'const char *' and from all the extensions: damageext.c: In function 'DamageExtensionInit': damageext.c:490:5: warning: passing argument 2 of 'CreateNewResourceType' discards qualifiers from pointer target type ../include/resource.h:159:26: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit 424dbde891486ad6a6c00c61a334031ff18f5556 Author: Alan Coopersmith Date: Fri Dec 9 10:08:55 2011 -0800 CheckForEmptyMask does not need to declare int n twice Just use the existing n variable again in the ARGB_CURSOR loop instead of creating another one. Fixes gcc -Wshadow warning: cursor.c: In function 'CheckForEmptyMask': cursor.c:155:6: warning: declaration of 'n' shadows a previous local cursor.c:146:9: warning: shadowed declaration is here Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer commit b2bc38e4a553c29f49a0284333b34b4d6c8a8c12 Author: Alan Coopersmith Date: Sat Dec 10 10:01:18 2011 -0800 Even more correctly free config file names If we didn't go into the if (!autoconfig) { } block, the filename, dirname, and sysdirname pointers were never initialized, but we freed them outside the block, leading to potential memory corruption. Move the frees inside the block where they're initialized to avoid this. To avoid similar problems, move the declarations of the variables that are only used in this block inside the block. Regression introduced by commit 3d635fe84d6de53e2f74203b10e89f7851fe3fc1 Found by gcc warning: xf86Config.c: In function 'xf86HandleConfigFile': xf86Config.c:2303:11: warning: 'filename' may be used uninitialized in this function xf86Config.c:2303:22: warning: 'dirname' may be used uninitialized in this function xf86Config.c:2303:32: warning: 'sysdirname' may be used uninitialized in this function Signed-off-by: Alan Coopersmith Reviewed-by: Paulo Zanoni commit 33d6e6743d86324c2078f156991b16ac4f2593fc Author: Alan Coopersmith Date: Wed Dec 7 19:06:05 2011 -0800 xf86RegisterRootWindowProperty is confused about xnfcalloc It will never return NULL, so don't try to handle a NULL condition, since that just confuses programmers and static analyzers. It uses calloc, so all the allocated memory is cleared, so there's no point looping over the memory to manually initialize it NULL. And just because it's annoying, it doesn't need to be the only place in this file to do if (NULL==...) instead of if (... == NULL). Signed-off-by: Alan Coopersmith Reviewed-by: Paulo Zanoni commit e5aa00989cda9ebd18063c5e955235123ad37b88 Author: Peter Hutterer Date: Wed Dec 7 14:14:10 2011 +1000 Change GetXI2/XI/CoreType to just take a type argument Avoids the dummy-event dance if we have an event type and need to get the matching XI2 type. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 6cc0e6a0afa6a87802767d484aa4e68fa935d3eb Author: Peter Hutterer Date: Fri Oct 28 12:55:55 2011 +1000 include: add GetXI2MaskByte and GetXI2EventFilterMask to headers This is needed for touch event processing. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 372a6f10dc2d74d2d179e8b92449e9b8636a99ef Author: Alan Coopersmith Date: Thu Dec 8 21:52:07 2011 -0800 Change disable_clientpointer return type to void It doesn't return anything, nor does it's caller expect it to. Fixes Solaris Studio compiler error: "xichangehierarchy.c", line 214: Function has no return statement : disable_clientpointer Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard commit 522f8bcc0360d6a117e929a004bc956ab92037e9 Merge: 6369b59 2abe83d Author: Keith Packard Date: Thu Dec 8 20:57:26 2011 -0800 Merge remote-tracking branch 'whot/for-keith' commit 2abe83df686ed64c4f4df711ac3c1fd12131c2e4 Author: Peter Hutterer Date: Mon Dec 5 14:02:51 2011 +1000 include: add BUG_WARN_MSG for custom error message on bug condition __BUG_WARN_MSG is a simple helper to enable call with and without varargs. I couldn't find a way to otherwise do this without getting gcc warnings. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 4fc797f3756611a97767f407e1af0b6a7cf2f1d9 Author: Peter Hutterer Date: Fri Nov 11 16:25:30 2011 +1000 xfree86: include xorg-config.h from xaalocal.h Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit 8c9589c71d47f287588314d77ddbfcc22cd04c8a Author: Peter Hutterer Date: Mon Dec 5 11:55:58 2011 +1000 Xi: rename "state" to "corestate" in ProcessDeviceEvents 'state' is shadowed by the XKB 'state' as well (which feeds into the event too), so rename this one to clarify that this is the core event state only. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 631516a4aa9858874ee197444cd93d91b97a1089 Author: Peter Hutterer Date: Fri Dec 2 15:47:58 2011 +1000 Xi: check button mapping value _before_ assigning it Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit a1304d6cb69301899c3c8450d6bf3e68573599df Author: Peter Hutterer Date: Mon Dec 5 11:26:30 2011 +1000 Xi: skip superfluous cast Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 1ab50be938524dcd4a9e56d27e3b96a27c2db2c0 Author: Peter Hutterer Date: Wed Nov 30 09:06:06 2011 +1000 xfixes: don't dereference a NULL cursor If the new cursor is the NULL cursor, don't dereference it and use zeros instead. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit d2ebbcdaf6b13d70eee704b1764ff349e1be22a0 Author: Peter Hutterer Date: Tue Nov 29 16:15:37 2011 +1000 Xi: when removing a device, reset ClientPointers where needed if a client had the to-be-removed device as ClientPointer, reset to NULL. Fixes #43165 Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit 27425f07b29e0ddaa782345c1899273ca742891e Author: Peter Hutterer Date: Wed Nov 9 14:45:02 2011 +1000 dix: use BUG_WARN for input mask size issues Yes, we're likely corrupting memory here but really this is unlikely to be triggered other than a real bug in the server. In which case a stacktrace is going to be more useful than any silent error handling. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 9b570ecbda954227c89938ee6f94b9efd192d3c6 Author: Peter Hutterer Date: Fri Dec 9 10:48:05 2011 +1000 xfree86: bump the input ABI The last few patches broke the ABI, bump it for convenience. Signed-off-by: Peter Hutterer commit 86bb3781b336c09e4279136ed81974de5acdba7f Author: Peter Hutterer Date: Fri Nov 4 11:29:01 2011 +1000 input: swap the server over to use the XI2mask struct Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit b8b90cd1610331ff12fa3f70bf372670af7795ec Author: Peter Hutterer Date: Thu Nov 3 13:39:59 2011 +1000 Add a new XI2Mask struct and a few helper functions. The current XI2 mask handling is handy for copying (fixed size arrays) but a pain to deal with otherwise. Add a struct for XI2 masks and the required accessors. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 4bc2761ad5ec2d0668aec639780ffb136605fbc8 Author: Peter Hutterer Date: Fri Nov 4 14:16:37 2011 +1000 dix: switch the dev->deviceGrab.activeGrab from GrabRec to GrabPtr This breaks the input ABI. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit b601ea769f1b8a4d7f19e9d4a13541c78e865fe5 Author: Peter Hutterer Date: Fri Nov 4 10:47:27 2011 +1000 dix: allocate temporary grabs on the heap Once grabs start having nested memory locations, we can't just use the GrabRec on the stack anymore, we need to alloc/copy/free the grabs. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit b0e9e2e32616d09c30a02b9d0ae9db0b13e150d1 Author: Peter Hutterer Date: Fri Nov 4 10:44:31 2011 +1000 dix: add CopyGrab() function Not really needed at this point, but will be once touch support is added. Since grabs are now expected to be allocated/freed with AllocGrab and FreeGrab, CopyGrab must increase the refcount and duplicate the modifier masks. Until the callers are switched to use FreeGrab, this introduces memleaks. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 347f377f3b3f8c9d230d6309ec8ae92aa86d78b7 Author: Peter Hutterer Date: Thu Nov 3 16:12:09 2011 +1000 dix: add AllocGrab helper function Not needed since the GrabRec is a self-contained struct but will be needed for the xi2 input mask rework. FreeGrab already exists, make it available to other callers. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 7af23259d88f4c28ed21140f82cc03b3724c06bb Author: Peter Hutterer Date: Mon Nov 21 11:41:12 2011 -0800 dix: switch the syncEvent queue to a struct list No effective functionality change, just cleanup to make this code slightly more sane. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 6369b59668613e51131857fbaeaa393a65a73048 Author: Gaetan Nadon Date: Thu Dec 1 16:24:32 2011 -0500 test: update .gitignore with xfree86 and sort alphabetically Reviewed-by: Alan Coopersmith Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 3ab8ee32470f7cf1223e04238bb8c5f74ed52fc3 Merge: 22a666f 98c4a88 Author: Keith Packard Date: Wed Dec 7 12:42:17 2011 -0800 Merge remote-tracking branch 'airlied/reviewed-fixes' commit 22a666f9952feb7248e9bb2faf777edaaac8175f Merge: 3824f55 e89b032 Author: Keith Packard Date: Wed Dec 7 12:27:23 2011 -0800 Merge remote-tracking branch 'alanc/master' commit 3824f558cc2ee051da8314c7bf08b8647b44e84a Author: Keith Packard Date: Wed Dec 7 12:13:37 2011 -0800 hw/xfree86: fix segfault in config parser when config dir is missing Treat a scandir error from a missing (or unusable) directory return as if it simply returned no files at all, which is what we want. cc: Paulo Zanoni Signed-off-by: Keith Packard commit 98c4a888a4428789386c7c47cecc81933b5999ba Author: Dave Airlie Date: Mon Nov 28 16:37:59 2011 +0000 kdrive: drop screen crossing code. The only kdrive server we probably care about anymore is Xephyr, and this screen enable/disable code totally breaks it in multi-screen mode. When you are in one screen the other stops updating. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=757457 Signed-off-by: Dave Airlie Reviewed-by: Peter Hutterer commit 8d3731a811e33e263920dd7c8ec63d02968cb56e Author: Dave Airlie Date: Thu Oct 20 10:48:26 2011 +0100 hal: free tmp_val in one missing case Pointed out by coverity scan. Signed-off-by: Dave Airlie Reviewed-by: Daniel Stone commit 41229392b790f30a0f0ef1f4ed95647c5bca4001 Author: Dave Airlie Date: Thu Oct 20 11:00:43 2011 +0100 xv: test correct number of requests. (v2) Pointed out by coverity. v2: fix swapped as well, as pointed out by Alan Signed-off-by: Dave Airlie Reviewed-by: Alan Coopersmith commit 1049139499d9132a20cd6d4d156fe9da9cddb6c2 Author: Dave Airlie Date: Wed Oct 19 16:57:13 2011 +0100 xaa: avoid possible freed pointer reuse in epilogue If the pGCPriv->flags == 2, then we try to assign the freed pGCPriv->XAAOps avoid this by clearing the flags in to be destroyed pGCPriv. Reported by coverity. Signed-off-by: Dave Airlie Reviewed-by: Jeremy Huddleston commit 682c09a2cedd234b005334cc01247d859dd7f26a Author: Dave Airlie Date: Wed Oct 19 16:22:31 2011 +0100 Xi: avoid overrun of callback array. This code had an off-by-one and would allow writing one past the end of the callbacks array. Pointed out by coverity. Signed-off-by: Dave Airlie Reviewed-by: Jeremy Huddleston commit b62dc4fcbcffd10de16650bee284702c8608bb60 Author: Dave Airlie Date: Wed Oct 19 16:21:26 2011 +0100 xext: don't free uninitialised pointer when malloc fails. (v2) Initialise the pAttr->values to values so if the values allocation fails it just ends up as free(NULL). Pointed out by coverity. v2: use Alan's suggestion. Signed-off-by: Dave Airlie Reviewed-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 22605effd188436629a0dbc688666549473741e4 Author: Adam Jackson Date: Thu Apr 28 13:34:28 2011 +1000 fbdevhw: iterate over all modes that match a mode. (v3) So on RHEL5 anaconda sets an xorg.conf with a fixed 800x600 mode in it, we run radeonfb and fbdev since ati won't work in userspace due to domain issues in the older codebase. On certain pseries blades the built-in KVM can't accept an 800x600-43 mode, it requires the 800x600-60 mode, so we have to have the kernel radeonfb driver reject the 800x600-43 mode when it sees it. However then fbdev doesn't try any of the other 800x600 modes in the modelist, and we end up getting a default 640x480 mode we don't want. This patch changes the mode validation loop to continue on with the other modes that match to find one that works. v2: move code around to avoid extra loop, after comment from Jamey. v3: move loop setup back into loop as per Jeremy's review. Signed-off-by: Dave Airlie Reviewed-by: Jamey Sharp Reviewed-by: Jeremy Huddleston commit fac464e310b82fadcedf790798d1016c4805640b Author: Peter Hutterer Date: Fri Dec 2 08:52:53 2011 +1000 include: rename "foos" to "list_of_foos" in the struct list documentation Makes things a little easier to read. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 7dfe8c32a96d3f96c8aaeb2802f5b122e381a1e4 Author: Peter Hutterer Date: Fri Dec 2 08:51:24 2011 +1000 include: update struct list documentation to use one set of structs only The example at the top of the file used a struct bar and a list of struct foos. Use those two throughout instead of a different struct foo for the examples and for the API documentation. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 18539c89eca8f6e272ead2b631365da530065ae7 Author: Peter Hutterer Date: Fri Dec 2 08:51:04 2011 +1000 include: a new list element does not need initialization, state so Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 58dc73314b6508121ca094bbcf00612fe19ed69f Author: Peter Hutterer Date: Fri Dec 2 08:43:45 2011 +1000 include: point to the tests in list.c as examples Even with the documentation, the list.c tests are the best examples. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit c8e451a8e719ba432bcfa8976774c07307087809 Author: Peter Hutterer Date: Thu Dec 1 14:12:11 2011 +1000 include: add list_last_entry to get the tail of a list Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 6acebf9e1298939593b942ec91ae9ec9e74faa19 Author: Peter Hutterer Date: Thu Dec 1 13:35:50 2011 +1000 include: add list_append() The existing list_add() prepends to the list, but in some cases we need the list ordered in the way we append the elements. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit e89b0324da89ba5c0ba64af1ef46a12b7f55f879 Author: Gaetan Nadon Date: Sat Dec 3 21:23:51 2011 -0500 autoconf: the minimum required level for autoconf is 2.60 The toolchain requirements are documented here: http://www.x.org/wiki/ModularDevelopersGuide#Required_Tools Note that autoconf features only found in versions later than 2.60 must not be used. Signed-off-by: Gaetan Nadon Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit 427cb53fddf0c517d1fd1025a87b1104735edd2a Author: Gaetan Nadon Date: Sat Dec 3 21:23:21 2011 -0500 autoconf: remove redundant AC_PROG_MAKE_SET Already included during Automake initialization. After the patch, no change: configure:3893: checking whether make sets $(MAKE) configure:3915: result: yes Signed-off-by: Gaetan Nadon Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit c19c55a93ab1bc6db56075ca34d6e1c3f522f622 Author: Alan Coopersmith Date: Fri Dec 2 00:09:07 2011 -0800 Fix builds of Xnest & Xephyr with Solaris Studio compilers Required in order to build with Studio cc now that xorg-macros is setting -errwarn=E_FUNC_HAS_NO_RETURN_STMT since a bug in the Solaris system headers causes the noreturn attribute to not be correctly applied to the exit() prototype in when building with Studio instead of gcc. Otherwise compiler exits with errors: "Display.c", line 65: Function has no return statement : x_io_error_handler "hostx.c", line 341: Function has no return statement : x_io_error_handler Uses Studio-specific pragma instead of adding another exit() prototype with a noreturn attribute to avoid causing gcc to warn about having a redundant prototype for the exit() function. Signed-off-by: Alan Coopersmith Reviewed-by: Mikhail Gusarov commit e4dcf580f007d6adcf5b0c639865d7aaab1a319d Author: Alan Coopersmith Date: Thu Dec 1 23:45:42 2011 -0800 LoaderOpen returns either a valid pointer or NULL, so don't check for < 0 Fixes Sun cc warning that was recently elevated to error by the stricter default CFLAGS changes to xorg-macros: "loadmod.c", line 914: improper pointer/integer combination: op "<" Should have been changed when commit ab7f057ce9df4e905b12 changed the LoaderOpen return type from int to void *. Changes log message when file is found but dlopen() fails from: (EE) LoadModule: Module dbe does not have a dbeModuleData data object. (EE) Failed to load module "dbe" (invalid module, 0) to: (EE) Failed to load module "dbe" (loader failed, 7) Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson commit 8b6a75009746db4b8e2e180210ac097e35136bcd Author: Alan Coopersmith Date: Wed Nov 30 23:01:34 2011 -0800 Fix gcc warnings about redundant declarations of fallback functions Ensure ffs, strndup, strlcat, etc. aren't defined by our headers if they're already defined in the system headers. This does export the HAVE_FFS, HAVE_STRNDUP, etc. definitions to drivers, but if you built the Xserver with a libc that had those, and then build the drivers with a less capable libc, you're going to have problems anyway, and this should solve some reported problems with conflicts between our strndup definition and gcc magic for it. Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson commit d829a7c5cb42c979b58f3547136df5b05d906423 Author: Alan Coopersmith Date: Wed Nov 30 22:20:09 2011 -0800 Move to autoconf standard function name checks & defines Replace multiple methods of checking for functions with AC_CHECK_FUNCS Replace multiple methods of selecting fallback funcs with AC_REPLACE_FUNCS Replace HAS_* and NEED_* #defines with autogenerated HAVE_* Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson Reviewed-by: Mikhail Gusarov Reviewed-by: Gaetan Nadon commit 4be68b03128e958d2a6dc1b7feb3587329b9561b Author: Alan Coopersmith Date: Wed Nov 30 19:39:51 2011 -0800 Remove unused function checks from configure.ac & include/*.h.in The code that used getisax to check for MMX support was moved to pixman and removed from the X server by commit eb2d7fe02f9cbc. The code that used HAVE_MKSTEMP was deleted by the Xprint removal in commit 1c8bd318fbaf. All alloca calls were removed by the patch series end in commit 5e363500c8, and used custom X checks instead of the autoconf HAVE_ALLOCA anyway. I can find no record of HAVE_GETUID, HAVE_GETEUID, HAVE_LINK, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_STRCHR, HAVE_STRRCHR, HAVE_GETOPT, HAVE_GETOPT_LONG, HAVE_DOPRNT, or HAVE_VPRINTF ever being used, and the calls to those functions are not wrapped in #ifdefs. (Most of those are in our baseline requirements of C89 & Unix98 anyway.) Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson Reviewed-by: Mikhail Gusarov Reviewed-by: Gaetan Nadon commit 84207def93e4489df8dca8e044ce544be8a3f845 Author: Alan Coopersmith Date: Mon Nov 28 20:38:58 2011 -0800 Disable building of tests requiring DDX functions when Xorg is not built Some test cases require linking with some sort of DDX - ideally we'd have a stub ddx for testing, but for now, since we link with the Xorg ddx, disable those tests when configured with --disable-xorg Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43320 Signed-off-by: Alan Coopersmith Reviewed-by: Dan Nicholson Reviewed-by: Jeremy Huddleston commit fd976e4051e15ab2d01ec0bf89ff26926d4ed04e Author: Gaetan Nadon Date: Thu Dec 1 16:24:12 2011 -0500 config: conftest needs an include directive to locate X11/Xfuncproto.h The compiler option -fvisibility=hidden is erroneously missing due to a faulty configuration test. The gcc command is unable to locate X11/Xfuncproto.h unless the build occurs on a system where X11 development headers are installed. configure:21294: checking for symbol visibility support configure:21323: gcc -std=gnu99 -c -g -O2 -fvisibility=hidden conftest.c >&5 conftest.c:144:28: fatal error: X11/Xfuncproto.h: No such file or directory The solution is to add an include directive to obtain the location of X11/Xfuncproto.h which may or may not be the system installed headers. Reviewed-by: Alan Coopersmith Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit feebf6746374aa04b12e9e3e51313a3a82c03530 Author: Alan Coopersmith Date: Wed Nov 23 00:30:02 2011 -0800 Limit the number of screens Xvfb will attempt to allocate memory for Commit f9e3a2955d2ca7 removing the MAXSCREEN limit left the screen number too unlimited, and allowed any positive int for a screen number: Xvfb :1 -screen 2147483647 1024x1024x8 Fatal server error: Not enough memory for screen 2147483647 Found by Parfait 0.3.7: Error: Integer overflow (CWE 190) Integer parameter of memory allocation function realloc() may overflow due to multiplication with constant value 1112 at line 293 of hw/vfb/InitOutput.c in function 'ddxProcessArgument'. Since the X11 connection setup only has a CARD8 for number of SCREENS, limit to 255 screens, which is also low enough to avoid overflow on the sizeof(*vfbScreens) * (screenNum + 1) calculation for realloc. Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp commit fb22a408c69a84f81905147de9e82cf66ffb6eb2 Author: Keith Packard Date: Tue Nov 8 10:13:15 2011 -0800 Save major/minor opcodes in ClientRec for RecordAReply The record extension needs the major and minor opcodes in the reply hook, but the request buffer may have been freed by the time the hook is invoked. Saving the request major and minor codes as the request is executed avoids fetching from the defunct request buffer. This patch also eliminates the public MinorOpcodeOfRequest function, inlining it into Dispatch. Usages of that function have been replaced with direct access to the new ClientRec field. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp commit 05f09354a30a4f5edd421220e1aa97be754c71bb Merge: 3197b77 08ec4da Author: Keith Packard Date: Thu Dec 1 14:44:52 2011 +0000 Merge remote-tracking branch 'jcristau/for-keith' commit 3197b773c81e58cd4aa412eccaee49526012ed6f Merge: 2dc5ba4 dfcec1d Author: Keith Packard Date: Thu Dec 1 14:36:58 2011 +0000 Merge remote-tracking branch 'whot/for-keith' commit 2dc5ba4a1b127e3ed286718ab0a6c20438361192 Author: Matt Turner Date: Tue Nov 29 23:52:19 2011 -0500 Remove another if (E != NULL) check around free(E) I wonder if there are any other patterns we haven't seen yet? Reviewed-by: Jamey Sharp Signed-off-by: Matt Turner Signed-off-by: Keith Packard commit dfcec1d3f9d7bac5cde9eb034341428ee0ad3728 Author: Peter Hutterer Date: Fri Nov 11 08:55:14 2011 +1000 test: remove unneeded printf statements from misc.c Leftover from debugging, is not really needeed in a test. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit 9c38422fc4cf853c3104fada2a3851c79df2a66f Author: Peter Hutterer Date: Wed Nov 9 14:37:26 2011 +1000 include: add BUG_WARN macro for internal bug cases. There are plenty of cases that can only be triggered by a real bug in the server and doing the ErrorF dance manually everywhere is a tad painful and the error message is usually used only to find the spot in the file anyway. Plus, reading BUG_WARN somewhere is a good indicator to the casual reader that this isn't intended behaviour. Note that this is intentionally different to the BUG_ON behaviour on the kernel, we do not FatalError the server. It's just a warning + stacktrace. If the bug is really fatal, call FatalError. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Reviewed-by: Alan Coopersmith commit 61ef4daf6450da573b9de72ba7b200566821b916 Author: Peter Hutterer Date: Fri Nov 4 15:49:23 2011 +1000 Xi: add FreeInputMask function Does what it says on the box, complements MakeInputMask. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit ee9346bb31efce4036df1b8dd8f1a5dc43ae955a Author: Peter Hutterer Date: Thu Nov 3 15:45:34 2011 +1000 Xi: add helper functions to alloc/free InputClientPtrs Currently not needed since the InputClientRec is a self-contained struct. As part of the touch rework that won't be the case in the future and a function to allocate/free memory appropriately is required. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 4acf999c294868a44e559d212c6d88a4978256b2 Author: Peter Hutterer Date: Fri Nov 4 15:37:32 2011 +1000 dix: use a single return statement in CheckPassiveGrabsOnWindow No functional change. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit b371795f01c1d7fc338cfe18b8a567ed9f402846 Author: Peter Hutterer Date: Thu Nov 3 14:54:06 2011 +1000 dix: rename GetWindowXI2Mask to WindowXI2MaskIsset And let it return a boolean value, that's all the callers need anyway. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit bedb8fd90de8e2db33d5e3b1d859f24bf34efc9a Author: Peter Hutterer Date: Thu Nov 3 14:25:51 2011 +1000 Xi: use single return code from XIPassiveGrabDevice Some failures returned status but the actual return code was "ret". Use "ret" consistently and move status to the local block is used in. [the goto isn't necessary yet, but for a future patch] Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas commit 2aad1a2b42b7def7812abfa2462b6bcc6382e03a Author: Peter Hutterer Date: Wed Nov 2 14:07:19 2011 +1000 include: fix mask size calculation Same bug as inputproto-2.0.1-9-gb1149ab, if the XI2LASTEVENT was a multiple of 8, the mask was one bit too short. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone Reviewed-by: Chase Douglas commit b2015a2c01711646bb7ae23d684abee0cd55d4d0 Author: Jeremy Huddleston Date: Thu Nov 24 13:54:08 2011 -0800 dmx: Build fix for -Werror=implicit-function-declaration on linux Fixes regression introduced by: 6e6d732bac3c21cb85f8e998908f9b393630e5f8 Found-by: Tinderbox Signed-off-by: Jeremy Huddleston CC: Alan Coopersmith Signed-off-by: Keith Packard commit 873a1ace3646994adf95961f48719e95dcade7a2 Author: Paulo Zanoni Date: Tue Nov 1 10:57:56 2011 -0200 parser: free val.str after xstrtokenize After we tokenize val.str, we discard it. This is just one example: 6 bytes in 1 blocks are definitely lost in loss record 24 of 652 at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x4D744D: xf86getToken (scan.c:400) by 0x4D75F1: xf86getSubToken (scan.c:462) by 0x4DB060: xf86parseInputClassSection (InputClass.c:145) by 0x4D664C: xf86readConfigFile (read.c:184) by 0x490556: xf86HandleConfigFile (xf86Config.c:2360) by 0x49AA77: InitOutput (xf86Init.c:365) by 0x425A7A: main (main.c:204) Signed-off-by: Paulo Zanoni Reviewed-by: Peter Hutterer Reviewed-by: Dan Nicholson commit d41987d77c903e00cca7bcf3e04ed07151e3bb4d Author: Paulo Zanoni Date: Tue Nov 1 10:42:36 2011 -0200 parser: free val.str after xf86getBoolValue After we convert the value to a boolean, we discard the string. This is just one example: 3 bytes in 1 blocks are definitely lost in loss record 5 of 657 at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so) by 0x4D744D: xf86getToken (scan.c:400) by 0x4D75F1: xf86getSubToken (scan.c:462) by 0x4DB3E0: xf86parseInputClassSection (InputClass.c:189) by 0x4D664C: xf86readConfigFile (read.c:184) by 0x490556: xf86HandleConfigFile (xf86Config.c:2360) by 0x49AA77: InitOutput (xf86Init.c:365) by 0x425A7A: main (main.c:204) Signed-off-by: Paulo Zanoni Reviewed-by: Peter Hutterer Reviewed-by: Dan Nicholson commit d5c7338b3eaea55177ade6fcba71a47ccd5547f5 Author: Paulo Zanoni Date: Mon Oct 31 17:54:03 2011 -0200 parser: free scandir's list v2: move the free()s to the function that calls scandir 80 bytes in 1 blocks are definitely lost in loss record 411 of 631 at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so) by 0x4C27927: realloc (vgpreload_memcheck-amd64-linux.so) by 0x696A80D: scandir (scandir.c:108) by 0x4D8828: OpenConfigDir (scan.c:854) by 0x4D8A43: xf86openConfigDirFiles (scan.c:952) by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327) by 0x49A9E3: InitOutput (xf86Init.c:365) by 0x425A7A: main (main.c:204) Signed-off-by: Paulo Zanoni Reviewed-by: Peter Hutterer commit 3d635fe84d6de53e2f74203b10e89f7851fe3fc1 Author: Paulo Zanoni Date: Sun Oct 30 18:04:59 2011 -0200 Correctly free config file names We call xf86penConfigDirFiles twice, so we overwrite the configDirPath variable, losing the pointer. If we move the pointer management to the upper layer (the function callers), they will be able to call these functions as many times as they want, but they'll have to free those returned values. v2: don't leak inside XWin 4,097 bytes in 1 blocks are definitely lost in loss record 625 of 632 at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x4D7899: DoSubstitution (scan.c:615) by 0x4D87B0: OpenConfigDir (scan.c:845) by 0x4D8A2D: xf86openConfigDirFiles (scan.c:955) by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327) by 0x49A9BF: InitOutput (xf86Init.c:365) by 0x425A7A: main (main.c:204) Signed-off-by: Paulo Zanoni Reviewed-by: Dan Nicholson commit 0ae087e13192d9b498db782be5ba49ca91a81547 Author: Paulo Zanoni Date: Sat Oct 29 18:33:24 2011 -0200 glx: don't leak driConfigs For dri, dri2 and driswrast. 12,968 (584 direct, 12,384 indirect) bytes in 1 blocks are definitely lost in loss record 569 of 570 at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x7821E3B: driConcatConfigs (utils.c:560) by 0x7827CF2: dri_fill_in_modes (dri_screen.c:224) by 0x782831E: dri_init_screen_helper (dri_screen.c:405) by 0x7826C03: drisw_init_screen (drisw.c:266) by 0x782225F: driCreateNewScreen (drisw_util.c:69) by 0x4826E2: __glXDRIscreenProbe (glxdriswrast.c:451) by 0x4812FA: GlxExtensionInit (glxext.c:327) by 0x41FB14: InitExtensions (miinitext.c:471) by 0x568622: main (main.c:208) Signed-off-by: Paulo Zanoni Reviewed-by: Jeremy Huddleston commit d26fae246d7c451b4d5ffe24fdb959d4bd00b107 Author: Paulo Zanoni Date: Tue Oct 25 14:56:35 2011 -0200 glx: don't leak fbconfigs 29,952 (208 direct, 29,744 indirect) bytes in 1 blocks are definitely lost in loss record 573 of 573 at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4829BC: createModeFromConfig (glxdricommon.c:131) by 0x482C09: glxConvertConfigs (glxdricommon.c:185) by 0x482788: __glXDRIscreenProbe (glxdriswrast.c:468) by 0x4812FA: GlxExtensionInit (glxext.c:327) by 0x41FB14: InitExtensions (miinitext.c:471) by 0x568636: main (main.c:208) Signed-off-by: Paulo Zanoni Reviewed-by: Jeremy Huddleston commit 305a8bcb2fc6f87f8d891fcb774198b6fd118ee1 Author: Paulo Zanoni Date: Thu Oct 20 17:39:29 2011 -0200 glx: fix memory leak when destroying screen 1,152 bytes in 1 blocks are definitely lost in loss record 536 of 575 at 0x4C25E84: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x483820: __glXScreenInit (glxscreens.c:357) by 0x48271C: __glXDRIscreenProbe (glxdriswrast.c:469) by 0x4812BE: GlxExtensionInit (glxext.c:327) by 0x41FB14: InitExtensions (miinitext.c:471) by 0x5685AE: main (main.c:208) Signed-off-by: Paulo Zanoni Reviewed-by: Jeremy Huddleston commit f405dfffe7d5db81d398615a80acbeba7e014ada Author: Jeremy Huddleston Date: Mon Nov 7 22:14:30 2011 +0000 dmx: Build fix for -Werror=implicit-function-declaration Signed-off-by: Jeremy Huddleston Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith commit 632d205b309d0515b4ae0f9902059aa4b093a313 Author: Alan Coopersmith Date: Mon Nov 7 20:24:08 2011 -0800 Fix gcc -Wwrite-strings warnings in xf86Modes code Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 09e4b78f7944234865f4648940453303af0c2663 Author: Alan Coopersmith Date: Mon Nov 7 19:19:47 2011 -0800 Fix gcc -Wwrite-strings warnings in xf86 ddx Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 8e4556f560487f3d07812834d4785441d0a8323c Author: Alan Coopersmith Date: Mon Nov 7 20:09:47 2011 -0800 FindModule: stop copying const char *dirname to char *dirpath Not needed since 6cf844ab69926b split out the allocation/manipulation into the helper function, leaving FindModule just copying the pointer around, and causing gcc warnings and an unreachable call to free. Also no longer need to store the combined strlen results in dirlen. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 05f589d464a961aea8d25632a390fb66a06cd186 Author: Alan Coopersmith Date: Fri Nov 4 23:21:34 2011 -0700 Fix gcc -Wwrite-strings warnings in various extensions Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 232f1ddf3d060f3ce9d2ebd35f33b1294cac380e Author: Alan Coopersmith Date: Thu Nov 3 21:21:19 2011 -0700 Fix gcc -Wwrite-strings warnings in XkbGetRulesDflts Stop temporarily storing a pointer to a constant literal string in a char *, just to strdup it a few lines later. Fixes gcc -Wwrite-strings warnings: xkbInit.c: In function 'XkbGetRulesDflts': xkbInit.c:121:38: warning: assignment discards qualifiers from pointer target type xkbInit.c:123:23: warning: assignment discards qualifiers from pointer target type xkbInit.c:125:24: warning: assignment discards qualifiers from pointer target type xkbInit.c:127:25: warning: assignment discards qualifiers from pointer target type xkbInit.c:129:25: warning: assignment discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 0bc41d5f8d1a6192f57d9bf646cc46ed839b06b9 Author: Alan Coopersmith Date: Mon Nov 7 18:08:21 2011 -0800 Remove redundant redeclarations of functions in the same header file Exposed by recent addition of -Wredundant-decls to default CWARNFLAGS Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 285133a35eede03e37f41aeea6cbfd15a0800d98 Author: Alan Coopersmith Date: Mon Nov 7 15:44:26 2011 -0800 sun_agp: cast key to uintptr_t before casting to (int *) Matches what linux_agp already does and prevents gcc from throwing up: sun_agp.c: In function 'xf86DeallocateGARTMemory': sun_agp.c:236:40: error: cast to pointer from integer of different size Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit f8dd5efb673439e7e9f7d82e6f9cfb97afacc85a Author: Alan Coopersmith Date: Thu Nov 3 21:18:56 2011 -0700 Mark XKB char * as const to clean up gcc -Wwrite-strings warnings Cleans up around 120 warnings from this set Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit cccafabd56d0f8e5784ea0ad9fdc03224f952bfe Author: Alan Coopersmith Date: Thu Nov 3 21:10:51 2011 -0700 Mark arguments to fopen/popen/system wrappers as const char * Silencing more gcc -Wwrite-strings warnings Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 3d0ece5e8467d823afb227b7a7f8b12b906b6ba9 Author: Alan Coopersmith Date: Thu Nov 3 20:44:43 2011 -0700 Reduce unnecessary string copying in xkbtext routines Instead of using sprintf to copy a static string to a local buffer, just to pass it to TryCopyStr, pass the static string to TryCopyStr directly, as is already done in other parts of this code. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 05d8a7f7a785eff3292f0f0537bb3902930f1b5c Author: Alan Coopersmith Date: Sat Oct 29 11:08:17 2011 -0700 Convert a bunch of sprintf to snprintf calls This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit b967bf2af264726042e2f6ffb9ca7d234f34b56b Author: Alan Coopersmith Date: Mon Oct 31 23:01:35 2011 -0700 Remove xf86FormatPciBusNumber from API, inline the one place its used Found no calls from current driver modules Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 6450f6ca7ee070da3b6d70c2d3a6977f018ac421 Author: Alan Coopersmith Date: Thu Nov 3 22:13:05 2011 -0700 Move DoShowOptions to xf86Configure.c, delete xf86ShowOpts.c Gets rid of duplicate static copy of optionTypeToString by putting both callers of that helper function in the same source file. Signed-off-by: Alan Coopersmith Reviewed-by: Daniel Stone Reviewed-by: Jeremy Huddleston commit 43fa1274263f76faaca995f6e498bc3179a857b8 Author: Alan Coopersmith Date: Mon Oct 31 22:17:35 2011 -0700 Remove bad code from DoShowOptions (Xorg -showopts handler) When we want to print a string, it's okay to just print it. We don't need to first allocate a buffer 2 bytes bigger than the string, copy the entire string unmodified to the buffer, print the buffer, and then leak the buffer (though we AbortDDX 8 lines later, and then just in case we survived that, call exit as well, so the leak is short lived, just oh so pointless). Signed-off-by: Alan Coopersmith Reviewed-by: Daniel Stone Reviewed-by: Jeremy Huddleston commit 71a89d97332cc181becc5a5f73166e642f96c076 Author: Alan Coopersmith Date: Mon Oct 31 21:36:47 2011 -0700 Convert glx/single2.c:DoGetString() to use asprintf() Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit f3cb512dc4daaeed389bb4740e21b6e2330e01e1 Author: Alan Coopersmith Date: Sat Oct 29 11:19:44 2011 -0700 LogVMessageVerb: Fix const mismatch warning "log.c", line 382: warning: assignment type mismatch: pointer to char "=" pointer to const char Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 3d2d88029b29d6e1c53220ad275ba8ba2dedd89e Author: Alan Coopersmith Date: Sat Oct 29 11:13:32 2011 -0700 AuthAudit: clean up string handling calls The extra "out" pointer to redirect writes to the array isn't needed since the removal of LBX (commit a9ed5a87902a), and eliminating it allows more logical use of sizeof(addr) in length-checked strlcpy & snprintf calls to write to it. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 615f93a3d03d40924365061c6ae242240dd0ab7e Author: Alan Coopersmith Date: Tue Nov 1 14:57:41 2011 -0700 Remove unnecessary variable rtrn in XkbKeysymText Also removes even more unnecessary use of variable assignment inside function arguments. Signed-off-by: Alan Coopersmith Reviewed-by: Daniel Stone commit 5f285a30a1d6ffba82ebe5e08a0b68352bb51556 Author: Alan Coopersmith Date: Tue Nov 1 16:56:18 2011 -0700 Make XIGetKnownProperty take a const char * argument Now that MakeAtom takes const char *, so can XIGetKnownProperty. Clears 71 warnings from gcc -Wwrite-strings of the form: devices.c:145:5: warning: passing argument 1 of 'XIGetKnownProperty' discards qualifiers from pointer target type ../include/exevents.h:128:23: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer commit e0f3633632de609e60950aef07c82df534db7888 Author: Alan Coopersmith Date: Fri Oct 28 21:31:46 2011 -0700 Convert ProcRenderQueryFilters to use memcpy instead of strncpy We just got the string length with strlen, might as well use it to copy the whole string quickly instead of checking each character a second time to see if it's 0 or not. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 780133f9ae7fada462714b47e79d26075bbd9abe Author: Alan Coopersmith Date: Fri Oct 28 21:29:50 2011 -0700 Convert DetermineClientCmd to use strdup instead of malloc+strncpy *cmdname is initialized to NULL earlier in the function, so it's okay to overwrite it with NULL if strdup fails, don't need that extra check. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 03ddca6f71339fad089c56484bf35c63642ae1be Author: Alan Coopersmith Date: Fri Oct 28 21:25:20 2011 -0700 Convert dmxSetDefaultFontPath to use strdup instead of malloc+strncpy Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit d9243777c77d9b2992fbaf7f459430283837e323 Author: Alan Coopersmith Date: Sat Oct 29 10:32:52 2011 -0700 matchDriverFromFiles: use one snprintf instead of strncpy/cat series Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 6e6d732bac3c21cb85f8e998908f9b393630e5f8 Author: Alan Coopersmith Date: Fri Oct 28 21:18:46 2011 -0700 Convert strncpy/strncat to strlcpy/strlcat As long as we're carrying around a compatibility copy in os/strl*.c, might as well use them. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit e189dbb3e57d30eb96034d4ce9544ce7a93a371e Author: Alan Coopersmith Date: Fri Oct 28 20:19:44 2011 -0700 Convert AllocXTestDevice to use asprintf Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 08093c25a91c07ab8af7cece9bba738b827cfd1b Author: Alan Coopersmith Date: Mon Oct 24 23:16:30 2011 -0700 Convert some malloc + strncpy pairs into strndup calls Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit acde97a39d35bfb03af2614c68176ad9afb71f53 Author: Alan Coopersmith Date: Mon Oct 24 20:28:32 2011 -0700 Add fallback implementation of strndup() Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston Linux test code fixed by: Keith Packard commit ed38c2648cf7cc04c1d03f8d14375815f6cf536e Author: Alan Coopersmith Date: Fri Oct 28 14:32:56 2011 -0700 Fix Sun compiler check that got turned around Since the check is for !(compilers that support __builtin_constant_p) it needs to be !(gcc or new enough Sun cc), but was written as !(gcc or too old Sun cc). Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 7ee7fd1f4c72b2ab6dba0413e63dd2e8b95b2112 Author: Alan Coopersmith Date: Mon Oct 24 20:39:24 2011 -0700 Remove a couple Error() instances left behind by 09dbfcb0ad7b6c8 Two instances found in the SIOCGIFCONF code for listing network interfaces. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston Reviewed-by: Peter Hutterer commit e47aa9475027ed6a255daefec85561c6b15789bd Author: Alan Coopersmith Date: Mon Oct 24 23:40:45 2011 -0700 Enable memory checking during unit testing If configure is generated with xorg-macros 1.16.0 or newer, and an appropriate memory checking library is found for the platform, use it when running unit tests. If not, then no harm is done. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 36670065bd74b870d0da7c6a69a9c0d222b21706 Author: Alan Coopersmith Date: Tue Oct 25 00:12:48 2011 -0700 Don't require ld -wrap for tests that don't need it If configure is generated with xorg-macros 1.16 or later, this allows builders to --enable-unit-test and run the tests other than the xi2 tests which require ld -wrap (and are still wrapped in if HAVE_LD_WRAP in tests/xi2/Makefile). If an older xorg-macros is used, the existing behaviour is preserved of requiring ld -wrap for all unit tests, but no side effects occur, so the minimum xorg-macros version is not raised. If unit testing is enabled without ld -wrap, then we create a bogus "xi2-tests" script just to report that we're skipping them. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston commit 0e6b88db7f2e94ccc8153a0e002d176440914e01 Author: Alan Coopersmith Date: Mon Aug 1 14:09:33 2011 -0700 Don't fallback to wsfb or fbdev on Solaris We don't ship either one, so don't waste time and make confusing log entries trying to load them. Signed-off-by: Alan Coopersmith Reviewed-by: Daniel Stone commit 7b0f53f0a5824fcd81ef505beb3e19ac7c77961f Author: Alan Coopersmith Date: Wed Nov 23 10:50:13 2011 -0800 Fix Xdmx build on Linux to work with strlcpy changes Include strlcpy.c in the libdmxconfig.a library with the other functions shared among the xdmx configuration programs. Also add a #include "os.h" to the scanner.l file that now calls strlcpy to include the prototype from $(top_srcdir)/include/os.h. (To be squashed into http://cgit.freedesktop.org/~alanc/xserver/commit/?id=c19f0ff5223d428f8ad2ab3c563c974c96a521ba before next PULL request to avoid breaking bisection.) Signed-off-by: Alan Coopersmith Signed-off-by: Keith Packard commit 922c1d817091c7eedfb701f4d9eb4324e22ccca4 Author: Gaetan Nadon Date: Fri Nov 11 20:44:19 2011 -0500 docs: spell "X Server Version" consistently in titles. Add where missing. Reviewed-by: Alan Coopersmith Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 5952efa903d57ac69070f1477ce46223a2a7893c Author: Keith Packard Date: Sun Nov 20 13:07:33 2011 -0800 Bump version to 1.11.99.1 (1.12 development release 1) Signed-off-by: Keith Packard commit 795fbe3e6e440f023e52c452106f4c266c13d36c Author: Keith Packard Date: Sun Nov 20 13:33:12 2011 -0800 Add 'optionstr.h' to include/Makefile.am This makes sure it gets distributed Signed-off-by: Keith Packard commit 08ec4da6a7617637914bee1636858474213cf39d Author: Julien Cristau Date: Sat Nov 5 13:00:07 2011 +0100 Fix ShmPutImage for XYBitmap We can't call CopyArea in that case because the image has depth 1, which might not match the target drawable, so we might overrun the shm segment. Commit 11817a881cb93a89788105d1e575a468f2a8d27c apparently fixed a similar bug for XYPixmap, but missed the bitmap case. Fixes: http://bugs.debian.org/629611 Thanks to Alan Curry for diagnosing this and providing a test case. Reported-and-tested-by: Alan Curry Reviewed-by: Peter Harris Signed-off-by: Julien Cristau commit 328074890eeb111950e984c6f618311983600b20 Author: dtakahashi42 Date: Fri Nov 18 11:30:22 2011 -0800 rootless: Fix a server crash when choosing a color with the gimp color wheel https://trac.macports.org/ticket/30927 Signed-off-by: Jeremy Huddleston Reviewed-by: Jeremy Huddleston commit 58864146fbdf1820d04825838691e84784ef91bc Author: Ross Burton Date: Wed Sep 28 11:46:02 2011 +0100 edid: Add quirk for Acer Aspire One 110 At least one revision of the AAO reports a 190x110mm maximum size but a 451x113mm mode. X.Org Bug 41141 Signed-off-by: Ross Burton Reviewed-by: Daniel Stone Reviewed-by: Jeremy Huddleston commit 34b0e4eee911f8b09a3682a7f1b4c8598ef48b8d Author: Chris Wilson Date: Thu Aug 25 16:04:04 2011 +0100 dri2: Register the DRI2DrawableType after server regeneration The Resource database is reset upon regeneration and so the dri2 module needs to re-register its RESTYPE for the drawable or else it will clobber the next unsuspecting user of the database. Fortunately, DRI2 is loaded late in the initialisation sequence and was last up until xf86-video-intel started using the Resource database to track outstanding swaps... Signed-off-by: Chris Wilson Reviewed-by: Jeremy Huddleston Tested-by: Paulo Zanoni commit bfa1a0dd190ed88020d60eba3bb04681c8e83a68 Author: Chris Wilson Date: Mon Jan 24 11:17:03 2011 +0000 DRI2: Avoid a NULL pointer dereference Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41211 Signed-off-by: Chris Wilson Reviewed-by: Jeremy Huddleston commit eeb21a133b982f71de739baf62e53c8a68f5d495 Author: Chris Wilson Date: Mon Jan 24 11:17:03 2011 +0000 VidMode: prevent crash with no modes Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=17431 Signed-off-by: Chris Wilson Reviewed-by: Jeremy Huddleston commit c1bb8f43b9290c2b18a9f0ac59773ff8f1eb974f Author: Rami Ylimäki Date: Tue Oct 4 12:25:26 2011 +0300 record: Prevent out of bounds access when recording a reply. Any pad bytes in replies are written to the client from a zeroed array. However, record extension tries to incorrectly access the pad bytes from the end of reply data. Signed-off-by: Rami Ylimäki Reviewed-by: Erkki Seppälä commit 1f5baa924a5907978f564372265d9830ac72a077 Author: Jeremy Huddleston Date: Sun Oct 30 20:26:42 2011 -0700 xfree86: Deprecate the use of xf86PciInfo.h Signed-off-by: Jeremy Huddleston Reviewed-by: Tormod Volden commit eb3377ffb8a7baa26c9831e56ed782d48b28fa71 Author: Jeremy Huddleston Date: Tue Nov 1 14:59:15 2011 -0700 xfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast memType is a uint64_t on powerpc. Using memType only really makes sense for *physical* addresses, which can be 64-bit for 32-bit systems running on 64-bit hardware. However, unmapVidMem() only deals with *virtual* addresses, which are guaranteed to fit into an uintptr_t. Signed-off-by: Jeremy Huddleston Reviewed-by: Mark Kettenis commit a551f126cc4af7a476d9c8fd0cb309d5aa600d54 Author: Pierre-Loup A. Griffais Date: Fri Nov 4 23:26:25 2011 -0700 xfree86: Fix RandR rotation across server generations 245cb8e94fd1599 fixed xf86RotateDestroy() to actually run its teardown code, causing the Damage object to properly be re-allocated after a server regeneration. However the block that does that still thinks the Rotate layer BlockHandler is wrapped from the last generation, meaning the shadow pixmap is never re-allocated and the Damage object is never re-registered, causing a blank screen, and potentially a driver crash on the next teardown after the server asks it to free a 0x0 Pixmap. Signed-off-by: Pierre-Loup A. Griffais Reviewed-by: Aaron Plattner Signed-off-by: Keith Packard commit bfa2a1857a1efda7f171f10e855d200ca0dbcc1a Merge: f0d50cc e7cb8f8 Author: Keith Packard Date: Mon Nov 14 09:07:06 2011 -0800 Merge remote-tracking branch 'whot/for-keith' commit e7cb8f802adf6fc22e7a930c0dfc5c1076781c96 Author: Peter Hutterer Date: Wed Nov 9 15:31:57 2011 +1000 Xext: remove unused variable 'n' xselinux_ext.c: In function 'SELinuxSendItemsToClient': xselinux_ext.c:340:16: warning: unused variable 'n' [-Wunused-variable] Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau commit bb4aa1f263ad38c175bfda3b7e6c325260ce3f28 Author: Peter Hutterer Date: Wed Nov 9 15:31:10 2011 +1000 Xext: don't swap CARD8 in SProcSELinuxQueryVersion xselinux_ext.c: In function 'SELinuxSendItemsToClient': xselinux_ext.c:340:16: warning: unused variable 'n' [-Wunused-variable] xselinux_ext.c: In function 'SProcSELinuxQueryVersion': xselinux_ext.c:532:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap xselinux_ext.c:533:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau commit 35ec24cf245e5ef676e98a0bf7c77296a3f1ff63 Author: Peter Hutterer Date: Mon Aug 1 14:14:02 2011 +1000 input: replace remaining GetPairedDevice() with GetMaster() Wherever it's obvious which device we need (keyboard or pointer), use GetMaster() instead of GetPairedDevice(). It is more reliable in actually getting the device type we want. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit fc16917ad6f0d2722bfb5c5eeca955dd3bc4125a Author: Peter Hutterer Date: Fri Apr 15 13:32:10 2011 +1000 include: export GetProximityEvents and QueueProximityEvents This is mainly needed for consistency with GetPointerEvents and friend. No-one seems to actually need this function from outside the usual DDXs. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit 11840595a1be9f2df7390bcc708cc176e60d3ef2 Author: Peter Hutterer Date: Thu Nov 3 08:58:58 2011 +1000 dix: Don't let a driver without a ProximityClassRec post events Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit 22715e465b415b3351b83b8279a4f44157f63199 Author: Peter Hutterer Date: Thu Oct 27 11:03:39 2011 +1000 Xi: allow passive keygrabs on the XIAll(Master)Devices fake devices They don't have a KeyClassRec, but we must still allow passive grabs on them. Signed-off-by: Peter Hutterer Tested-by: Bastien Nocera Reviewed-by: Daniel Stone commit f0d50cc6651dce3a8a3cd3fb84210aa92b139763 Author: Derek Buitenhuis Date: Sun Nov 6 12:20:51 2011 -0500 Fix vesa's VBE PanelID interpretation xserver's VESA driver's VBE (Vesa BIOS Extensions) code includes a PanelID probe, which can get a monitor's native resolution. From this, using CVT formulas, it derives horizontal sync rate and a vertical refresh rate ranges. It however, only derives the upper bounds of the ranges, and the lower bounds cannot de derived. By default, they are set to hardcoded constants which represent the lowest supported resolution: 640x480. The constants in vbe.c however, were not actually derived from forulas, but carried over from other code from the bad old days, and are not relevant to flat panel displays. This caused, for example, EEEPC701's panel, with a native resolution of 800x480, to end up with a upper bound of the horizontal sync rate that was lower than the hardcoded lower bound, which of course broke things. These numbers have been rederived using both my own CVT tool based on xf86CVTMode(), and using the provided 'cvt' tool that comes with xserver. Signed-off-by: Derek Buitenhuis Reviewed-by: Adam Jackson Signed-off-by: Keith Packard commit c643c2b7bf480f5c27ff8606bda087f8bff3b154 Author: Peter Hutterer Date: Tue Nov 1 12:17:50 2011 +1000 xfree86: duplicate name and driver from pInfo for NewInputDeviceRequest xorg.conf devices had the name and driver set in the DDX's InputInfoPtr list but not in the option list for those devices. That information was lost when passing the options into NewInputDeviceRequest. NIDR then refused to start the devices. Introduced in xorg-server-1.11.0-250-ge4cd24e Signed-off-by: Peter Hutterer Tested-by: James Cloos commit 9cc44b955b27de33348d6a20bebc9704930ee18e Author: Rui Matos Date: Tue Nov 1 21:32:36 2011 +0000 randr: Make the RRConstrainCursorHarder logic the same as miPointerSetPosition The constraining logic in RRConstrainCursorHarder allows the cursor to reach crtc positions of x = width and y = height while the constraining code in miPointerSetPosition only allows it to reach x = width - 1 and y = height - 1 for the analogous screen case. This patch makes the former's logic equivalent to the latter's which allows applications to benefit from Fitts's law. E.g. a maximized application adjacent to a crtc border wouldn't get pointer events if the user moved the pointer all the way until it's contained. Signed-off-by: Rui Matos Reviewed-by: Daniel Stone Signed-off-by: Keith Packard commit f47f6b6a53d414f28374391964c2930427d28f46 Author: James Simmons Date: Thu Nov 3 13:20:18 2011 +0000 don't map cursors in sw cursor mode commit d4eebe5217a89de196c1933e1fe4d37e22d59c6b Author: Dave Airlie Date: Thu Nov 3 13:18:46 2011 +0000 configure: don't require xvmc. Not needed in here commit 548c6fe044068ffba9b5306dc6b11f2ba22782a4 Merge: 3881b0b ffe8ec8 Author: Keith Packard Date: Wed Nov 2 21:35:31 2011 -0700 Merge remote-tracking branch 'jturney/master' commit 3881b0bf1ce11a62473650bdf6ee01a1762f6f91 Author: Gaetan Nadon Date: Tue Nov 1 07:17:07 2011 -0400 mi: remove deprecated miPointerAbsoluteCursor from design doc Function was removed from the code by commit f5409aa026 Reviewed-by: Jeremy Huddleston Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit d91aa0e6601bdf3e2cfa57b3412ab14ac486edc4 Merge: 8df3a9c 401150d Author: Keith Packard Date: Wed Nov 2 21:20:07 2011 -0700 Merge remote-tracking branch 'whot/two-screen-coordinates' commit 8df3a9ca5abbd56eb2013fa65250d21a8f18865b Merge: 8329afa ef89548 Author: Keith Packard Date: Wed Nov 2 21:18:16 2011 -0700 Merge remote-tracking branch 'koba/reviewed' commit ffe8ec86db2655b2c83e5ae61521898140c855ac Author: Colin Harrison Date: Sat Oct 8 15:05:22 2011 +0100 hw/xwin: Fix a typo in ddraw.h Fix a (fortunately benign) typo in ddraw.h Signed-off-by: Jon TURNEY commit 48fda3c52b41157313b7fd56d9f3fa3ad4166ed7 Author: Yaakov Selkowitz Date: Thu Feb 18 20:37:00 2010 -0600 hw/xwin: Revert "Fix bug #5735, Serious flaw in CygwinX clipboard" This commit wreaks havoc with other programs which manage the clipboard, such as MS Office Clipboard or Win32 VNC viewers: http://sourceware.org/bugzilla/show_bug.cgi?id=9910 This reverts commit 70ddd0f39d5118db72a1a4e473cbfb502f1ed9ec. Signed-off-by: Yaakov Selkowitz Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY Reviewed-by: Colin Harrison commit 3ead1d810b0e157078db39712e02ea6dc85216d8 Author: Jon TURNEY Date: Sun Jul 3 19:10:52 2011 +0100 hw/xwin: Stop pretending we work on NT4 We already link directly to some functions not available in NT4, so stop pretending we will work on NT4 and link directly to EnumDisplayMonitors() and SHGetFolderPath() Also remove mentions of NT4 & Win95 from error messages Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit f6529a05a2f087cb57a7fe84f226fef3780728d0 Author: Colin Harrison Date: Sat Oct 8 14:39:07 2011 +0100 Xming: Always remove temporary file used when invoking xkbcomp on Win32 When built for native Win32, pipe() & fork() aren't available, so we use a tempoary file and system() to invoke xkbcomp Ensure the temporary file is always removed. It was only being removed on most errors, not on success :S Also fix a couple of warnings which occur when built with WIN32 defined Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY commit ee1985386700288af1a8b1789dcad0d7d9c97393 Author: Jon TURNEY Date: Sat Apr 16 23:28:45 2011 +0100 hw/xwin: Link directly to TrackMouseEvent() TrackMouseEvent has existed in user32 since at least NT4, so don't bother with jumping through all the ancient compatibility hoops of finding if _TrackMouseEvent() exists in comctl32 so it can check if TrackMouseEvent() exists in user32 to see if it needs to emulate it... Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison commit e2e6fab1efa6895256ac0ed4d5b054a88ad18077 Author: Jon TURNEY Date: Tue Mar 23 04:45:37 2010 -0500 Cygwin/X: Make default DPI match native DPI Make the default DPI match the current Windows DPI setting. If that setting can't be retrieved, change the fallback DPI value from 75 dpi to 96 dpi. Mark the application as dpiAware in the manifest, which prevents dpi virtualization for high (>96) dpi values on Vista and later. Signed-off-by: Jon TURNEY Signed-off-by: Yaakov Selkowitz Reviewed-by: Colin Harrison commit 8329afa59dd5ea3adf7adebdb2111a9bccbb126b Author: Aaron Plattner Date: Mon Oct 31 15:01:12 2011 -0700 dix: Reinstate GetImage window size check Commit 587c3a2d1961834558193e8e14e8e381a077a253 fixed DoGetImage to check windows against their backing drawables, rather than against the screen dimensions, to prevent reading outside the bounds of redirected windows' backing pixmaps (see bug #22804). Unfortunately, while making that change I also removed the check that the rectangle is contained within the bounds of the source window, which is a violation of the specification: If the drawable is a window, the window must be viewable, and it must be the case that, if there were no inferiors or overlapping windows, the specified rectangle of the window would be fully visible on the screen *and wholly contained within the outside edges of the window* (or a Match error results). Note that the borders of the window can be included and read with this request. (emphasis mine) Reinstate the window dimension check, to return BadMatch if the GetImage request falls outside the bounds of the window. Fixes X Test Suite test XGetImage-15: 400|0 15 1 11:05:41|IC Start 200|0 15 11:05:41|TP Start 520|0 15 00005146 1 1|VSW5TESTSUITE PURPOSE 15 520|0 15 00005146 1 2|Assertion XGetImage-15.(A) 520|0 15 00005146 1 3|When the drawable is a window and the window is viewable 520|0 15 00005146 1 4|and it is not the case that given there were no inferiors or 520|0 15 00005146 1 5|overlapping windows the specified rectangle of the window 520|0 15 00005146 1 6|would be fully visible on the screen and wholly contained 520|0 15 00005146 1 7|within the outside edges of the window, then a BadMatch 520|0 15 00005146 1 8|error occurs. 520|0 15 00005146 1 9|METH: Create window which is not fully visible on the screen. 520|0 15 00005146 1 10|METH: Call XMapWindow to make sure the window is viewable. 520|0 15 00005146 1 11|METH: Call XGetImage with rectangle extending beyond edge of screen. 520|0 15 00005146 1 12|METH: Verify XGetImage return value is null. 520|0 15 00005146 1 13|METH: Verify that BadMatch error occurred. 520|0 15 00005146 1 14|METH: Create window which is fully visible on the screen. 520|0 15 00005146 1 15|METH: Call XMapWindow to make sure the window is viewable. 520|0 15 00005146 1 16|METH: Call XGetImage with rectangle extending beyond edge of window. 520|0 15 00005146 1 17|METH: Verify XGetImage return value is null. 520|0 15 00005146 1 18|METH: Verify that BadMatch error occurred. 520|0 15 00005146 1 19|REPORT: Got Success, Expecting BadMatch 520|0 15 00005146 1 20|REPORT: Null image not returned. 220|0 15 1 11:05:41|FAIL Signed-off-by: Aaron Plattner Reviewed-by: Jeremy Huddleston Signed-off-by: Keith Packard commit 132545ff576cc69ed63f5a08127151fe550de4c3 Merge: d0c6732 d7c44a7 Author: Keith Packard Date: Sun Oct 30 16:57:58 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit d7c44a7c9760449bef263413ad3b20f19b1dc95a Author: Peter Hutterer Date: Mon Oct 24 12:00:32 2011 +1000 dix: block signals when closing all devices When closing down all devices, we manually unset master for all attached devices, but the device's sprite info still points to the master's sprite info. This leaves us a window where the master is freed already but the device isn't yet. A signal during that window causes dereference of the already freed spriteInfo in mieqEnqueue's EnqueueScreen macro. Simply block signals when removing all devices. It's not like we're really worrying about high-responsive input at this stage. https://bugzilla.redhat.com/show_bug.cgi?id=737031 Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau commit 820d9040f50a8440741b3aefbc069a3ad81e824e Author: Servaas Vandenberghe Date: Wed Aug 31 07:06:49 2011 +0200 xfree86: fix potential buffer overflow The patch below fixes a potential buffer overflow in xf86addComment(). This occurs if curlen > 0 && eol_seen == 0 && iscomment == 0 , as follows from the code: char *xf86addComment(char *cur, char *add) <...> len = strlen(add); endnewline = add[len - 1] == '\n'; len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen; if ((str = realloc(cur, len + curlen)) == NULL) return cur; cur = str; if (eol_seen || (curlen && !hasnewline)) cur[curlen++] = '\n'; if (!iscomment) cur[curlen++] = '#'; strcpy(cur + curlen, add); if (!endnewline) strcat(cur, "\n"); Signed-off-by: Servaas Vandenberghe Reviewed-by: Peter Hutterer [whot: added buffer overflow test case] Signed-off-by: Peter Hutterer commit 63e87b8639eb8e0b4e32e5d3a09099d31a03bbcd Author: Peter Hutterer Date: Tue Oct 25 11:49:26 2011 +1000 xfree86: reduce calls to input_option_get_key/value No functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Dan Nicholson commit d0c6732a99c9a7e40752b9ba7898a01c325103fa Author: Anssi Hannula Date: Wed Apr 20 14:34:52 2011 +0300 xfree86: add nouveau as the first automatic driver for NVIDIA hardware Add nouveau as the first driver on linux for NVIDIA hardware when driver autoconfiguration is done, as it is more capable than nv. nv is also kept in the list as it is more widely supported and because some old cards are not supported by nouveau. Signed-off-by: Anssi Hannula Reviewed-by: Daniel Stone Reviewed-by: Cyril Brulebois Reviewed-by: Jeremy Huddleston Signed-off-by: Keith Packard commit ef895484c8a43d447d9d3ea7d4226936cc5f92cc Author: Alexandr Shadchin Date: Tue Oct 4 10:46:00 2011 +0600 bsd: alpha_video: Remove unused variables Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith commit fea7c7a8c070ec17ec03e4cb193834b6ca72fb72 Author: Alexandr Shadchin Date: Mon Oct 3 23:03:31 2011 +0600 bsd: alpha_video: Simplify #include Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith commit 93a3a28f2c1e95ea7fae6cf1c2fb50b30eae9c33 Author: Alexandr Shadchin Date: Tue Oct 4 00:45:09 2011 +0600 bsd: alpha_video: Function sethae() need only for FreeBSD Return value sethae() is becoming void because no caller used it. Also old msb_set static checked by each caller is replaced by the p.hae static checked in sethae() when it's called. Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith commit 05b41e2dc60a0aefc685a33260e5d8e09580908b Author: Alexandr Shadchin Date: Tue Oct 4 17:20:13 2011 +0600 Move check definition MAP_FAILED in xf86_OSlib.h Also remove odd definition MAP_FAILED. Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith commit af56e502f5ddf1d2d495b633734cadcb023b7c36 Author: Alexandr Shadchin Date: Tue Oct 4 16:49:22 2011 +0600 Remove odd definition DEV_MEM DEV_MEM defined in xf86_OSlib.h Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith commit 0481e9d3d1e0dbc05099184128de5cd6f13445f7 Author: Alexandr Shadchin Date: Tue Oct 4 15:09:45 2011 +0600 Remove BSDi support Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith commit 8838a86fd325cb7f262a582d22ccdaa8a8f1a534 Author: Alexandr Shadchin Date: Tue Oct 4 14:57:20 2011 +0600 Remove unused VT_SYSREQ_DEFAULT Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith commit 91131037a2d2e07079de5d222d8a8c95300750cc Author: Alexandr Shadchin Date: Sat Oct 29 00:14:32 2011 +0600 Fix position _X_EXPORT Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 219bcec73d3554c57b87f28812ab06a66b739b19 Author: Alexandr Shadchin Date: Sat Oct 29 00:14:31 2011 +0600 bsd: Remove odd message about -sharevts This is missing in commit 'xfree86: move -novtswitch & -sharevts argument handling up to common layer' Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard commit 005ab41986b0bb6a4e626aee7a7a542247f422e7 Author: Dave Airlie Date: Thu Oct 27 08:38:45 2011 +1000 test: fix two more failing FP3232 tests And put a comment in to explain why we're testing for a frac between .3 and .6. We can't directly compare the frac since the floating/fixed point conversion loses precision. Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer commit 286fa9bf9b4ffb0f9dbd3f1cae46ddcb27ee9318 Author: Jeremy Huddleston Date: Tue Oct 25 23:53:43 2011 -0700 XWin: windowswm: Correct byte swapping in event notifications Signed-off-by: Jeremy Huddleston Reviewed-by: Jon TURNEY commit dc054fefc586c5b404fe0f949dbd456e5267c647 Author: Jeremy Huddleston Date: Tue Oct 25 23:49:33 2011 -0700 XQuartz: appledri: Correct byte swapping in event notifications Signed-off-by: Jeremy Huddleston commit d5fee2b638fabeb8bec31a24e57d5c2a232d0893 Author: Jeremy Huddleston Date: Tue Oct 25 23:48:16 2011 -0700 XQuartz: applewm: Correct byte swapping in event notifications Signed-off-by: Jeremy Huddleston commit 5701ab4a441eb113abd0851b0d71b82d12112854 Merge: 7d50211 a41214b Author: Keith Packard Date: Mon Oct 24 22:09:00 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit a41214bc9a0f326c6dc129e4a6382efb8b826862 Author: Peter Hutterer Date: Tue Oct 25 12:57:07 2011 +1000 kdrive: check for null memory, fix OOB If key/value allocation failed, don't bother adding another InputOption. And make sure the memory allocated is large enough for the trailing \0 Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit ffe20acedb3cdc4811eb52f8fc540ba6af7339fa Author: Peter Hutterer Date: Thu Oct 20 16:42:20 2011 +1000 Use new FP1616/FP3232 conversion functions Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit 7500d841f4c709ae0edc6420332096d3b9ef9fcc Author: Peter Hutterer Date: Thu Oct 20 16:49:28 2011 +1000 test: fix test with new double -> fp3232 conversion functions Signed-off-by: Peter Hutterer Tested-by: Dave Airlie Reviewed-by: Dave Airlie commit 4bb5d8fae4f9a70f12591315f0b267a2ea826a0c Author: Peter Hutterer Date: Wed Oct 19 13:17:51 2011 +1000 Xi: send DeviceChangedEvents when the scroll valuators change value Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 1f4af6c12fb5d4c19f4eac3df768517c9132cc88 Author: Peter Hutterer Date: Wed Oct 19 12:28:37 2011 +1000 dix: accept a NULL master for CreateClassesChangedEvent If a floating device changes, the master is NULL but we must still create a DCE for it. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit d77dec6971e4a0b306c8dbd5adf627908d7972cb Author: Peter Hutterer Date: Wed Oct 19 12:11:16 2011 +1000 Xi: ensure the deviceid for DeviceChangedEvents is always the right one If we're sending the event for a given device, make sure the deviceid is that of the device. This allows callers to use the same DCE for slave and master without having to fiddle the DCE's internal fields. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit e9dee21fa3213bfe87b2b728a38eb41d3ba0e664 Author: Peter Hutterer Date: Tue Oct 18 17:47:59 2011 +1000 dix: pass the flags into the CreateClassesChangedEvent No effective functional changes, prep work for future patches. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit fcdd2587a17437b643b4592aa7f65d11c05a4cd8 Author: Peter Hutterer Date: Tue Oct 18 17:41:29 2011 +1000 dix: drop unused argument from XISendDeviceChangedEvent Instead of device and master (and just using master), drop the master argument and let the callers pass in the device the event is to be sent for. No effective functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 8473e441b0f832775153281bc3df5e2d4feb2b36 Author: Peter Hutterer Date: Tue Oct 18 17:11:27 2011 +1000 dix: add ScrollInfo to DeviceChangedEvents 3304bbff9b4ed63f1a47410a5320a136420ba2c6 added smooth scrolling support for pointer events and for XIQueryDevice but didn't add the matching parts to XIDeviceChangedEvents. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit e3f6a76dd480717eae4b17ad8e2ff707de2ffe4c Author: Andreas Wettstein Date: Thu Aug 11 16:33:33 2011 +1000 xkb: Support noLock and noUnlock flags for LockMods These flags are required by the XKB spec section 6.3. Signed-off-by: Andreas Wettstein Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 6f33593dc087d367d899d1cb6e6e30b282d922e2 Author: Peter Hutterer Date: Fri Oct 21 09:09:55 2011 +1000 xfree86 doc: replace driver "keyboard" with "kbd" We've deprecated keyboard a long time ago Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith commit e4cd24e717ef1059804b3f6bb483810b708cd56a Author: Peter Hutterer Date: Fri Aug 5 14:48:02 2011 +1000 xfree86: use NewInputDeviceRequest for xorg.conf devices too Only use one init path for input devices - through NIDR. This requires that inp_driver and inp_identifier from the XF86ConfInputRec are copied over into the options for NIDR to see them. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 1ecc427a39d41e723912492b846512fd0ad9af2d Author: Peter Hutterer Date: Wed Aug 10 14:37:41 2011 +1000 dix: move #if statement to stop compiler warning ptrveloc.c: In function 'QueryTrackers': ptrveloc.c:598:34: warning: variable 'used_offset' set but not used [-Wunused-but-set-variable] used_offset is used, but only in the debugging code. Move the #if statement to ignore that warning. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Daniel Stone commit f9067c1dd8ce9058eb48a20dfae52bc8cf3a1e55 Author: Peter Hutterer Date: Fri Aug 5 14:05:58 2011 +1000 xfree86: Fix a comment, the old function doesn't exist anymore Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Daniel Stone commit aeab26e9e1751e1e3514798fa53e9bd604b0d254 Author: Peter Hutterer Date: Wed Aug 10 15:58:34 2011 +1000 xfree86: use xf86AddNewOption instead of xf86addNewOption The former strdups for us. If the strdup fails we miss out on the CorePointer option (default on anyway) and we're likely to fall over soon anyway, so let's pretend this is the same behaviour. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Daniel Stone commit c39c8d34282b82d73c3c69a16cf0c2816256d85b Author: Peter Hutterer Date: Wed Aug 10 14:38:58 2011 +1000 input: switch InputOption to use XF86OptionRec storage. Use the same struct for both InputOption and XF86OptionRec so we don't need to convert to and fro the two in the config backends. Signed-off-by: Peter Hutterer Reviewed-by: Dan Nicholson Reviewed-by: Daniel Stone commit 16ac78a53c1edeae183db8672104587b306cfe13 Author: Peter Hutterer Date: Tue Oct 25 11:40:58 2011 +1000 kdrive: switch to new InputOption API. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard commit 7d50211ab57a35910d79fc3f67ae89aff91fa995 Author: Christopher Yeleighton Date: Mon Oct 24 18:47:06 2011 -0700 Bug 38420: Xvfb crashes in miInitVisuals() when started with depth=2 https://bugs.freedesktop.org/show_bug.cgi?id=38420 Exit with fatal error message, not segfault. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston Signed-off-by: Keith Packard commit d9d3a01ffca5e2de650d098231e16205781804c5 Merge: 17416e8 fb55f8f Author: Keith Packard Date: Mon Oct 24 18:12:23 2011 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 17416e88dcfcc584fe5f87580d5d2b719b3521c3 Author: Dave Airlie Date: Thu Oct 20 14:43:01 2011 +0100 xf86Crtc: handle no outputs with no modes harder. If you started an X server with no connected outputs, we pick a default 1024x768 mode, however if you then ran an xvidmode using app against that server it would segfault the server due to not finding any valid modes. This was due to the no output mode set code, only adding the modes to the scrn->modes once, when something called randr 1.2 xf86SetScrnInfoModes would get called and remove all the modes and we'd end up with 0. This change fixes xf86SetScrnInfoModes to always report a scrn mode of at least 1024x768, and pushes the initial configuration to just call it instead of setting up the mode itself. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=746926 I've seen other bugs like this on other distros so it might also actually fix them. Signed-off-by: Dave Airlie Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit fb55f8f790f69f30b0ab18648c337bde9d41f5ff Author: Jeremy Huddleston Date: Mon Oct 24 16:45:36 2011 -0700 XQuartz: Fix the filename of our log file Signed-off-by: Jeremy Huddleston commit 1c8bda798b4480bab0f0da6f531e4770c7a1f771 Author: Jeremy Huddleston Date: Fri Oct 21 10:27:16 2011 -0700 XQuartz: appledri: Allow byte swapped requests Even though it's only valid when local, it is possible for a local client and the server to not match endianness, such as when running a ppc application under Rosetta. Signed-off-by: Jeremy Huddleston commit 14205ade0c750191bf43fba8bd55c65dba912cf4 Author: Jeremy Huddleston Date: Thu Oct 20 22:34:44 2011 -0700 XQuartz: appledri: Fix byte swapping in replies Even though it's only valid when local, it is possible for a local client and the server to not match endianness, such as when running a ppc application under Rosetta. Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit 2ba0ac202ad64eb4a555715980ba538de19c9fd7 Author: Jeremy Huddleston Date: Thu Oct 20 22:23:07 2011 -0700 XQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap http://xquartz.macosforge.org/trac/ticket/508 Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit e4f257748b51d041275a64b8be408729ea05fbb5 Author: Jeremy Huddleston Date: Thu Oct 20 11:35:54 2011 -0700 XQuartz: appledri: Change whitespace in appledristr.h to match mesa Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit 83fef4235db86343477b4ec9858c6ba35e1aa7d9 Author: Jeremy Huddleston Date: Sun Oct 16 02:12:38 2011 -0700 Xnest: Match the host's keymap This was a regression. Introduced by: 08363c5830bdea34012dcd954b45ccfdc79a3a7e and 32db27a7f867b503c2840ca7b815e96d10be9210 Masked by: 1e69fd4a60147287b31e53bfc61543fb17bb82c8 Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit 4597ac6fe0580323860080dae2576733acc49757 Author: Jeremy Huddleston Date: Mon Oct 17 23:45:32 2011 -0700 test: Add unit test for mieq Signed-off-by: Jeremy Huddleston Reviewed-by: Peter Hutterer commit ad450d76e468cd62406c4f09e71e131f7ff4555c Author: Jeremy Huddleston Date: Mon Oct 17 21:16:37 2011 -0700 mieq: Reserve some space in EQ for release and other special events The last 64 events in the event queue will be reserved for release events in order to help return the system to a cleaner state when it comes back from a soft wedge. Signed-off-by: Jeremy Huddleston Reviewed-by: Peter Hutterer commit 7d153f25be678acf500236ae422b33d17e6cb7a6 Author: Jeremy Huddleston Date: Sat Oct 15 22:51:30 2011 -0700 mieq: Provide better adaptability and diagnostics during mieq overflow This patch changes from a static length event queue (512) to one that starts at 128 and grows to 4096 as it overflows, logging each time it grows. This change also allows for multiple backtraces to be printed when the server is wedged rather than just one. This increased sampling should help identify the true hog in cases where one backtrace might be insufficient. Signed-off-by: Jeremy Huddleston Reviewed-by: Peter Hutterer commit 09eaa1f6f19f9a85a3cb74a18ac898162db451df Author: Jeremy Huddleston Date: Sat Oct 30 14:55:06 2010 -0700 configure.ac: Add -fno-strict-aliasing to CFLAGS This should force the server to have -fno-strict-aliasing even once it is removed from the warning flags. See: https://bugs.freedesktop.org/show_bug.cgi?id=31238 Signed-off-by: Jeremy Huddleston Reviewed-by: Gaetan Nadon commit a046d649e4c7e4d28f350382dcdd293e92a59aad Author: Jeremy Huddleston Date: Wed Oct 5 15:02:52 2011 -0700 test: Silence some debug lines from the input unit tests Signed-off-by: Jeremy Huddleston Reviewed-by: Peter Hutterer commit 8db554d2d830953de3c6d0cbf58e23d53d89009f Author: Jeremy Huddleston Date: Thu Oct 20 14:28:56 2011 -0700 Xnest: Fix DestroyNotify handler This partially reverts the unwanted changes that crept into c13a48e74ec89eafa9b529a87253a631ef02f2e2 Reported-by: Julien Cristau Signed-off-by: Jeremy Huddleston Reviewed-by: Julien Cristau commit ff61592441916b83aeb778c74352bb5b26247f84 Merge: af3f64f 525d417 Author: Keith Packard Date: Wed Oct 19 19:14:32 2011 -0700 Merge remote-tracking branch 'aplattner/for-master' commit af3f64fb77c13180e513ee99d1fd9a1b624fd8ea Merge: 15bbdc1 df0dd36 Author: Keith Packard Date: Wed Oct 19 17:33:07 2011 -0700 Merge remote-tracking branch 'hramrach/pull' commit 15bbdc103b34b6b374815698946e6c409421a644 Merge: a5266dc 323869f Author: Keith Packard Date: Wed Oct 19 17:26:50 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit a5266dcb3a60587e1877f90c18552baf60b597a0 Author: Ville Syrjala Date: Sun Oct 9 01:11:04 2011 +0300 composite: Update borderClip in compAllocPixmap() Previously the parent constrained borderClip was copied over when compRedirectWindow() is called. That is insufficient eg. in case the window was already redirected, but not yet realized. So copy the borderClip over in compAllocPixmap() instead. Example: Window 1 is below an automatically redirect window 2. Window 2 is unmapped and moved outside the extents of window 1. Window 2 is then mapped again, and MarkOverlappedWindows() uses the up to date borderSize of window 2 to mark windows, which leaves window 1 unmarked. Then exposures are calculated using the stale borderClip of window 2, which causes the window below window 2, to be exposed through an apparent hole in window 1. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22566 Signed-off-by: Ville Syrjala Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit e4787ec20b1b9d30fe00f17b60eb0898190bf77d Author: Gaetan Nadon Date: Mon Oct 17 15:08:14 2011 -0400 XWinrc.man: fix warning: tab character in unquoted macro argument #35054 Spaces or tabs do not affect the text output layout. Reviewed-by: Jeremy Huddleston Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 321873f8045139edd47b526a765f8b1c66f53cd4 Author: Gaetan Nadon Date: Mon Oct 17 15:08:13 2011 -0400 xorg.conf.man: fix 382: warning: missing `)' (got `R') #35054 http://www.gnu.org/software/groff/manual/html_node/Man-usage.html Reviewed-by: Alan Coopersmith Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 3e145d3d67b472cb5d74cb8078b614160c4722b7 Author: Jesse Barnes Date: Thu Oct 13 12:01:10 2011 -0700 crtc: match full preferred modes if possible when choosing an initial config It's fairly common to have multiple, identical monitors plugged in. In that case, it's preferable to run the monitor's preferred mode on each output, rather than just matching the width & height and end up with different timings or refresh rates. Signed-off-by: Jesse Barnes Reviewed-by: Keith Packard Signed-off-by: Keith Packard commit 525d4172b246e13b8122e059e3b22866e00561d9 Author: Chris Wilson Date: Sun Sep 4 09:34:08 2011 -0700 render: export TriStrip and TriFan to the drivers Rather than perform an intermediate copy and expand the strip and the fan into a triangle list (thereby tripling the number of edges that the driver needs to process), allow the backend to hook directly into the appropriate Composite function. In order to extend the PictureScreen, without needlessly bumping the ABI, we move the existing copy implementations to mipict.c and assign those by default. To notify the ddx that the new entry points are available, we introduce PICTURE_SCREEN_VERSION. Signed-off-by: Chris Wilson Reviewed-by: Aaron Plattner commit 9b26e6bc8d2cdf5bac3025796855ccf05972358f Author: Luc Verhaegen Date: Tue Aug 23 15:19:59 2011 -0700 randr: stop clients from deleting immutable output properties Immutable in randr means that clients are not able to alter the property itself, they are only allowed to alter the property value. This logically means that the property then should not be deleted by the client either. Signed-off-by: Luc Verhaegen Reviewed-by: Rami Ylimäki Reviewed-by: Aaron Plattner Signed-off-by: Aaron Plattner commit c8413362049cee8c30e0a9d67f78f9ebefe8e71f Merge: 64d2d1b b67581c Author: Keith Packard Date: Tue Oct 18 07:45:24 2011 -0700 Merge remote-tracking branch 'herrb/master' commit b67581cf825940fdf52bf2e0af4330e695d724a4 Author: Matthieu Herrb Date: Mon Oct 17 22:27:35 2011 +0200 Fix CVE-2011-4029: File permission change vulnerability. Use fchmod() to change permissions of the lock file instead of chmod(), thus avoid the race that can be exploited to set a symbolic link to any file or directory in the system. Signed-off-by: Matthieu Herrb Reviewed-by: Alan Coopersmith commit 6ba44b91e37622ef8c146d8f2ac92d708a18ed34 Author: Matthieu Herrb Date: Mon Oct 17 22:26:12 2011 +0200 Fix CVE-2011-4028: File disclosure vulnerability. use O_NOFOLLOW to open the existing lock file, so symbolic links aren't followed, thus avoid revealing if it point to an existing file. Signed-off-by: Matthieu Herrb Reviewed-by: Alan Coopersmith commit df0dd36deea0c756819825113e825059ddd19243 Author: Michal Suchanek Date: Sat Oct 8 14:26:24 2011 +0200 Do not uselessly reload modules in DuplicateModule The function does not initialize the module so it has no business loading it. If some user of DuplicateModule expects a module actually loaded they should use LoadModule. Signed-off-by: Michal Suchanek Reviewed-by: Peter Hutterer commit 24d435163eb5fbd9b73cd8ba13a9b3cdbbe8a1df Author: Michal Suchanek Date: Sat Oct 8 14:19:34 2011 +0200 Use UnloadModuleOrDriver for UnloadSubModule. Signed-off-by: Michal Suchanek Reviewed-by: Peter Hutterer commit 0d4bb5442ceb8e8e4a8de6cfc4203cae469eee72 Author: Michal Suchanek Date: Sat Oct 8 14:13:33 2011 +0200 Unload submodules. Signed-off-by: Michal Suchanek Reviewed-by: Peter Hutterer commit b04aff76ac2eb461c71b85525a00e25efb8bf267 Author: Michal Suchanek Date: Thu Oct 13 17:14:53 2011 +0200 Document -background none option Document option introduced in commit 8976e97. Signed-off-by: Michal Suchanek Reviewed-by: Jeremy Huddleston Reviewed-by: Alan Coopersmith commit 323869f3298cbbfe864af9404a8aed1bf7995d79 Author: Tomáš Trnka Date: Tue Oct 11 09:11:18 2011 +0200 Fix drain_console unregistration Bug introduced by 9dca441670d261a9a9fb6108960ed48f3d58fb7f xfree86: add a hook to replace the new console handler. console_handler was not being set, making the server eat up CPU spinning in WaitForSomething selecting consoleFd over and over again, every time trying to unregister drain_console without success due to console_handler being NULL. Let's just fix the unregistration in xf86SetConsoleHandler() and use that. But wait, there could be a catch: If some driver replaced the handler using xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister that one. I don't understand Xorg well enough to know whether this poses a problem (could mess up driver deinit somehow or something like that). As it is, xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which handler is currently registered). I had been using it for two days on my machine that previously hit 100% CPU several times a day. That has now gone away without any new problems appearing. Signed-off-by: Tomas Trnka Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit 2cb63180fa9b54f763e7e92e433943e3e73741f3 Author: Peter Hutterer Date: Wed Oct 5 12:08:31 2011 +1000 dix: mark motion events as emulated if we're scrolling from button press The protocol requires that the emulated event is marked as such. So if a driver with smooth scrolling axis sends legacy button events, the motion event must be marked as emulated. Pass the real type to emulate_scroll_button_events and create the events accordingly. For real button press or relase events, only that event must be generated since a release event will follow or a press event has already occured, respectively. (This fixes a bug where we'd get two release events for each legacy button event) Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 82c60232c07f50774ccc0198950f64c9338057a5 Author: Peter Hutterer Date: Fri Sep 30 10:59:47 2011 +1000 dix: add valuator_mask_fetch_double() Using this call simplifies callers that don't know if the mask bit is set. Before: if (valuator_mask_isset(mask, valnum)) value = valuator_mask_get_double(mask, valnum)); else value = someothervalue; Now: if (!valuator_mask_fetch_double(mask, valnum, &value)) value = someothervalue; Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Reviewed-by: Daniel Stone commit 64d2d1bef14c7ec7156bb3aae64eff69f9f7be54 Merge: fb84be4 679c84b Author: Keith Packard Date: Mon Oct 17 14:36:34 2011 -0700 Merge remote-tracking branch 'jeremyhu/master' commit fb84be47db7cdaff406792c08e34670e8e0cbda9 Merge: fae7ed6 32b289e Author: Keith Packard Date: Mon Oct 17 13:50:25 2011 -0700 Merge remote-tracking branch 'whot/next' commit 679c84bce9b03c17aa35fa69058e7e46267dbc7b Author: Jeremy Huddleston Date: Sat Sep 24 00:01:11 2011 -0700 Bump ABI_VIDEODRV_VERSION to 12 The ABI changed in the previous series of changes, so bump the ABI version for the next release. Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit a89cdcee4ebab6bbfa9ace94e1988a94cfb67087 Author: Jeremy Huddleston Date: Sun Oct 9 02:59:12 2011 -0700 xfree86: Deprecate xf86MapVidMem and friends Drivers should transition over to using libpciaccess's instead. Signed-off-by: Jeremy Huddleston commit 41d903918a5721e53ed694880eab44170f9717cc Author: Jeremy Huddleston Date: Wed Sep 14 13:45:18 2011 -0500 xorg-server.pc.in: Remove libpciaccess and pixman-1 from Requires Every module building against xorg-server does not *Require* pixman nor libpciaccess. If such modules need pixman or pciaccess, they should be depending on them directly rather than inheriting a dependency from xorg-server. To do this, they should use PKG_CHECK_MODULES in configure.ac to check for pixman-1 or pciaccess and include the apporpriate _LIBS variable to the appropriate _LDFLAGS variable in Makefile.am This also moves pixman-1 to Requires.private, so CPPFLAGS is set right to to satisfy include dependencies but avoid linking needlessly. Signed-off-by: Jeremy Huddleston Reviewed-by: Gaetan Nadon commit 40d338e9f723c4b3d63516aa62fdcded4d8af75e Author: Jeremy Huddleston Date: Wed Sep 14 10:37:38 2011 -0500 darwin: configure: Force some irrelevant options to off on darwin This removes the need to pass the following to configure on darwin: --disable-pciaccess -disable-int10-module --disable-vbe --disable-vgahw --disable-libdrm Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit 43d730c0e4b1a00b29843c0660dcc7c60da6725d Author: Jeremy Huddleston Date: Wed Sep 14 15:42:19 2011 -0500 xfree86: Link modules with -module This makes a difference on darwin (and apparently nowhere else) https://www.gnu.org/s/libtool/manual/libtool.html#Modules-for-libltdl Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp Reviewed-by: Gaetan Nadon commit f7edc00a2af83764910ff89514a046dc5ce2ff9e Author: Jeremy Huddleston Date: Wed Sep 14 12:14:56 2011 -0500 xfree86: fbdevhw: Remove unused include of pciaccess.h Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit 6817050f3196d460ba03a62da23fb46ffd5a0f97 Author: Tiago Vignatti Date: Tue Jun 1 13:05:47 2010 +0300 configure: wrap PCI code with macro and set it at build time --disable-pciaccess, used together with --disable-module-int10, can be used to disable all pci code inside the server. Note that XSERVER_LIBPCIACCESS was previously used only in the driver side and now it defines also whether the library is used inside the server. Also, XORG_BUS_PCI automake variable is introduced to track PCI code needs. Signed-off-by: Tiago Vignatti Reviewed-by: Mikhail Gusarov Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston commit 5c12399b6c3a8def2df1bdde1d5d4d8d9e31fd84 Author: Tiago Vignatti Date: Mon May 31 19:27:07 2010 +0300 configure: make PCI configuration more sane No semantical changes. Just moved code around, grouping PCI related stuff in a single chunk. Signed-off-by: Tiago Vignatti Reviewed-by: Mikhail Gusarov Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston commit a319e9e697faa0faa241e0e9baf0bc41efdcdf8f Author: Tiago Vignatti Date: Mon May 31 18:50:50 2010 +0300 configure: change PCI function checking by a meaningful version of the library People that don't want VGA arbiter active can go to the library and enable the stubs there. Signed-off-by: Tiago Vignatti Reviewed-by: Mikhail Gusarov Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Reviewed-by: Jamey Sharp commit b3ca84430d98f5338b9b1bc817c3656efb71cff1 Author: Jeremy Huddleston Date: Tue Sep 13 15:32:16 2011 -0500 xfree86: Work around issue where ar may be told to make an archive with no contents Automake: "Be careful when selecting library components conditionally. Because building an empty library is not portable, you should ensure that any library always contains at least one object." Signed-off-by: Jeremy Huddleston Reviewed-by: Gaetan Nadon commit e8bafb9d8c7d7a7077e163ecfac6174356989bbf Author: Jeremy Huddleston Date: Tue Sep 13 15:38:45 2011 -0500 xfree86: Add stubs for os-support to help adding new architecture support Signed-off-by: Jeremy Huddleston Reviewed-by: Jamey Sharp Reviewed-by: Gaetan Nadon commit 342f3eac8460fc48cfad1f1d7be939d671e6e1cd Author: Adam Jackson Date: Tue May 10 19:00:02 2011 -0400 int10: Port internal users off xf86MapVidMem This API is apparently semi-deprecated even by XFree86 standards, and there are only four drivers left using it. Let's start chopping it off. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson commit 7757b8092474c4f4ec04f4ebd1272236416154c3 Author: Adam Jackson Date: Tue May 10 17:34:23 2011 -0400 pci: Remove xf86MapDomainMemory This is slightly draconian, but that API is just awful. In all but one case in the callers it's used to get a map of some legacy VGA memory, and it would be cleaner for the caller to just call pci_device_map_legacy. The sole exception is in the vesa driver, which uses it to avoid having to look up which device the BAR belongs to. That's similarly trivial to fix. Having done that, Linux's PCI layer is now very small indeed. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson commit 6f5041d0b8e11e761d6403f1f8f8bb2ba2a9626d Author: Adam Jackson Date: Tue May 10 18:04:10 2011 -0400 int10: Use pciaccess rom fetch for !PC machines ... instead of rolling our own, badly. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 492ed3e53b0ee6746bd4b597978fd866d4a89ef6 Author: Adam Jackson Date: Tue May 10 16:41:08 2011 -0400 pci: Deprecate the PCITAG type It is kept around to help drivers through the API transition and will be removed at some point in the future. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit a248fa3a33cb015942386d52b7faa8558e592a51 Author: Adam Jackson Date: Fri Jan 7 17:20:15 2011 -0500 xfree86: Remove unused bios_devmem.c Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit aa0bfb0f133481c57762012e8e30c05ffa151423 Author: Adam Jackson Date: Fri Jan 7 16:57:15 2011 -0500 linux: Remove ia64 domain I/O support code pciaccess handles this now. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 95b6935637628ffa511f39004e90c75aa75141c4 Author: Adam Jackson Date: Fri Oct 16 16:09:56 2009 -0400 linux: Remove pre-2.6 PCI interface support If you haven't ported 2.6 to your architecture in the intervening seven years, you can keep running older servers. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 769f583783d17ffa3398bc8529f61e0f08b35530 Author: Adam Jackson Date: Fri Oct 16 14:05:54 2009 -0400 bus: remove some dead struct fields Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit dd72b3c1f1df57215329aa5ba9e9bb9ad0a65086 Author: Adam Jackson Date: Mon Sep 20 11:42:11 2010 -0400 linux: Use pci_device_get_parent_bridge instead of open-coding it Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 858fbbb40d7c69540cd1fb5315cebf811c6e7b3f Author: Adam Jackson Date: Fri Sep 16 13:33:04 2011 -0400 pci: Port xf86MapLegacyIO to pciaccess Per-domain I/O is now something drivers must manually request, and must keep track of within their own state rather than in the ScrnInfoRec. It's not really possible to split that into two steps without an additional intermediate ABI break, so don't even try. Drivers that want source compatibility should ifdef on the presence of xf86UnmapLegacyIO. As a fringe benefit, domain-aware I/O is now OS-independent, relying only on support in pciaccess. Simplify OS PCI setup to reflect this. The IOADDRESS type is kept around to help drivers through the API transition and will be removed at some point in the future. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 6d9efdce0d06df6b85f0681bea306c0b1e851502 Author: Adam Jackson Date: Tue Sep 20 18:12:29 2011 -0400 vgahw: Port to pciaccess IO space routines Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 4bd6579188e718654c35f95623fd4772f9e0ef06 Author: Adam Jackson Date: Thu Sep 22 13:45:57 2011 -0400 vgahw: Don't default to standard (port space) access routines In fact, don't default to anything; drivers must explicitly say which kind they want, and they are strongly encouraged to do MMIO if possible. This is an ABI change in that drivers that don't will crash, but drivers that are explicit will work with both old and new servers. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 30fb334d218f8c1d809f88054b9fe8f5f556bb62 Author: Adam Jackson Date: Thu Sep 22 13:44:53 2011 -0400 vgahw: Remove IO domain setup Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 51a5558beb71bddeff9352ef4f43269a8a22317d Author: Adam Jackson Date: Sat Sep 18 08:24:19 2010 -0400 int10: Port to pciaccess' legacy IO API Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit c0b63ff88a6dc20f86141aa1a1ed5a9384aa63aa Author: Adam Jackson Date: Sat Sep 18 08:05:11 2010 -0400 xfree86: Move xf86GetClocks to vgahw This is really a vga-specific hack anyway. The only modern driver that uses it is trident, but it's already loaded vgahw by the time it would call xf86GetClocks. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Signed-off-by: Adam Jackson Reviewed-by: Jamey Sharp commit 1433103a49b97e356da0f20aa65046cdb2f5ece6 Author: Dave Airlie Date: Wed Oct 12 09:59:38 2011 +0100 test: fix input test The test was memsetting the wrong thing, this fixes make check in my tinderbox. Signed-off-by: Dave Airlie Reviewed-by: Daniel Stone Reviewed-by: Jeremy Huddleston commit f9c6903d4a90b59c328f4fa05d2be9e0ce1c5189 Author: Jeremy Huddleston Date: Wed Oct 5 15:02:52 2011 -0700 dix: add utility functions for double to/fro FP1616/FP3232 conversion Co-authored-by: Jeremy Huddleston Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer Reviewed-by: Jeremy Huddleston Reviewed-by: Mark Kettenis commit 401150d7dcad08be7c1f07e076f810cd61e2105c Author: Peter Hutterer Date: Tue Oct 4 11:41:17 2011 +1000 input: change pointer screen crossing behaviour for multiple ScreenRecs miPointerSetPosition traditionally took coordinates on a per-screen basis, triggering a screen switch when these went out-of-bounds. For absolute devices, this prevented screen crossing in the negative x/y direction. This patch changes the event generation patch to handle screen coordinates in a desktop range (i.e. all screens together). Screen switches are triggered when these coordinates are not on the current screen. This unifies the pointer behaviour of single ScreenRec multihead and multiple ScreenRecs multihead in that the cursor by default moves about the whole screen rather than be confined to one single screen. The transformation matrix may then be used to actually confine the cursor to the screen again. Note: fill_pointer_events has to deal with several different coordinate systems. Make sure you read the comment before trying to understand the code. Signed-off-by: Peter Hutterer commit 6bd0eff40fae1e5d8fed28751851eb5b932d131b Author: Peter Hutterer Date: Wed Oct 12 15:53:57 2011 +1000 dix: extend rescaleValuatorAxis to take a minimum default Allow rescaling to non-zero based axis ranges as default (for when screen offsets are non-zero). Currently unused. Signed-off-by: Peter Hutterer commit 8bebb4b4896d8b6ba3309b5b28fce883bb9f8a96 Author: Peter Hutterer Date: Wed Sep 7 14:04:10 2011 +1000 Store desktop dimensions in screenInfo. For Zaphod mode screen crossing handling we need to know the size of all screens together (i.e. the whole desktop size). Store that in the screenInfo to have it readily available in events. Signed-off-by: Peter Hutterer commit 9cbfa4739a51e4cc6b8094833928bf8678f63876 Author: Peter Hutterer Date: Tue Sep 6 15:55:19 2011 +1000 xfree86: remove xf86XInputSetScreen Keeping track of which screen the pointer within the input driver is obsolete now. To bind to a screen, use the transformation matrix instead. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit 09dbfcb0ad7b6c8bac94502f2801e82f2a2ef435 Author: Jeremy Huddleston Date: Tue Oct 11 17:37:44 2011 -0700 os: Remove Error() Signed-off-by: Jeremy Huddleston Reviewed-by: Peter Hutterer commit db30615bcb3b872475e7d40eeee8cdda5b723078 Author: Jeremy Huddleston Date: Mon Oct 10 12:16:31 2011 -0700 Xephyr: Remove socket and its lock file on exit https://bugs.freedesktop.org/show_bug.cgi?id=11484 Signed-off-by: Jeremy Huddleston Reviewed-by: Mikhail Gusarov commit c13a48e74ec89eafa9b529a87253a631ef02f2e2 Author: Jeremy Huddleston Date: Mon Oct 10 12:09:39 2011 -0700 Xnest: Remove socket and its lock file on exit https://bugs.freedesktop.org/show_bug.cgi?id=11484 Signed-off-by: Jeremy Huddleston Reviewed-by: Mikhail Gusarov commit 32b289e46cc2d5ec32ff0c4ba5bbfbf602afb388 Author: Peter Hutterer Date: Mon Oct 3 13:58:01 2011 +1000 dix: move MD last.valuator update into fill_pointer_events Don't update the MD where it's not expected, positionSprite should really just do that - position the sprite. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 3b36fd1b49030ead44358945f62e5abe7f4609ce Author: Peter Hutterer Date: Mon Oct 3 13:10:53 2011 +1000 mi: switch miPointerSetPosition to take doubles Don't switch between doubles and ints in the caller, instead take doubles in miPointerSetPosition and do the conversion there. For full feature we should change everything down from here for doubles too. Functional change: previously we'd restore the remainder regardless of screen switching/confinement (despite what the comment said). Now, screen changing or cursor constraints will cause the remainder be clipped off. This should happen for cursor constraints but arguably not for screen crossing. This also corrects a currently wrong comment about miPointerSetPosition's input coordinates. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 81cfe44b1ed0de84ad1941fe2ca74bebef3fc58d Author: Peter Hutterer Date: Mon Oct 3 12:49:49 2011 +1000 mi: return the screen from miPointerSetPosition miPointerSetPosition may switch screens. Always return the screen the sprite is on instead of relying on callers to call miPointerGetScreen(). Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit 88dfe5366d9855e0ebf8bbff74967b793ede57d1 Author: Peter Hutterer Date: Mon Oct 3 12:37:28 2011 +1000 dix: drop screen argument from positionSprite We can just get this in the function, no effective functional changes. Also return the screen to the caller. Though we don't use it yet, we will in a follow-up patch. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit 967bc25da221a69c8fc390253465145ce534fcb9 Author: Peter Hutterer Date: Mon Oct 3 11:42:08 2011 +1000 dix: move screen- to device coordinate scaling to separate function No functional changes. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit b059e06e19ac9417ceeb8be58c1c91b159291865 Author: Peter Hutterer Date: Mon Aug 29 12:36:26 2011 +1000 dix: don't allow keyboard devices to submit motion or button events. GPE unconditionally dereferences pDev->valuator if a mask is present. This shouldn't really happen but if it does, don't crash, just ignore the events with an error. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit bccff533184a051b614a26304ce77ad30bede5e0 Author: Peter Hutterer Date: Mon Oct 3 12:19:21 2011 +1000 dix: moveRelative modifies parameter in-place, say so. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit b966362ccf0fe6fdd44f4d778d47e3677f55f11b Author: Peter Hutterer Date: Mon Oct 3 12:18:20 2011 +1000 dix: rename moveAbsolute to clipAbsolute Let's be honest about what it does. moveRelative accumulates delta _and_ clips in some cases, so that one can keep it's name. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit 959d18c3765e447897a8cfd358e9ee645df595d9 Author: Peter Hutterer Date: Fri Sep 30 10:50:51 2011 +1000 dix: fix missing verb in comment Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit 7074ec87bdf81699df172619aea7aae1ad4ec3c6 Author: Peter Hutterer Date: Fri Sep 30 10:47:00 2011 +1000 dix: document transformAbsolute Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone commit f4ca19ce3ab91a9c8ad9de60f7dc95466f21f589 Author: Peter Hutterer Date: Fri Jul 29 10:56:44 2011 +1000 dix: copy the source ID into the RawEvent (#34240) X.Org Bug 34240 Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 8b29addc30163bb7ba74c74351f312aac02f049a Author: Jeremy Huddleston Date: Sun Oct 9 04:00:41 2011 -0700 loader: when creating sdksyms.c only include shmint.h if MITSHM is enabled #29109 https://bugs.freedesktop.org/show_bug.cgi?id=29109 When configured with --disable-mitshm the symbols declared in shmint.h do not exist. By guarding the include with '#ifdef MITSHM' these symbols are skipped when generating sdksyms.c with --disable-mitshm. Signed-off-by: Michael Olbrich Reviewed-by: Jeremy Huddleston commit eabd5532fb589bd0550344ebd23c9765e591aadf Author: Julien Cristau Date: Sun Oct 9 17:06:14 2011 -0700 xfree86: fix build with xv disabled https://bugs.freedesktop.org/show_bug.cgi?id=29111 Signed-off-by: Julien Cristau Tested-by: Cyril Brulebois Reviewed-by: Cyril Brulebois commit c53380be804852045722203c993379813d97f6d7 Author: Ville Skyttä Date: Sun Mar 6 10:18:30 2011 +0200 Man page syntax and spelling fixes. Signed-off-by: Ville Skyttä Reviewed-by: Jeremy Huddleston commit 765ef69295ddc473640c96f1b4f54e0b8bfc670e Author: Max Schwarz Date: Tue Oct 4 22:06:08 2011 +0200 dix: fix inverted handling of legacy scroll button events This bug led to inverted scrolling axes with drivers that support smooth scrolling axes but send legacy button events. Signed-off-by: Max Schwarz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer commit fae7ed62ad476114bd37b566202cf6b6546c0a1f Author: Jeremy Huddleston Date: Tue Oct 4 21:40:03 2011 -0700 XQuartz: pbproxy: Add missing AM_OBJCFLAGS Signed-off-by: Jeremy Huddleston commit e4cddf509e1729e8ff40354275b65455111ad2bd Author: vdb@picaros.org Date: Sat Sep 17 18:55:47 2011 +0200 Fix a rare memory leak Signed-off-by: Servaas Vandenberghe Reviewed-by: Jeremy Huddleston commit 53611213396479abfdce0f7752681572e0d26d78 Author: Kirill Elagin Date: Tue Oct 4 23:02:20 2011 +0400 Fix server crash due to invalid images See https://bugs.freedesktop.org/show_bug.cgi?id=39383 Signed-off-by: Kirill Elagin Reviewed-by: Jeremy Huddleston commit 7a33c5b934382b5554f41ab1502514e91c9bc52e Author: Alan Hourihane Date: Tue Oct 4 19:42:46 2011 -0700 dixfonts: Don't overwrite local c variable until new_closure is safely initialized. Signed-off-by: Alan Hourihane Reviewed-by: Jeremy Huddleston commit 911e7368bf9c00d327e994a6f7a1d8d8f9b83c72 Author: Peter Hutterer Date: Tue Aug 30 16:58:04 2011 -0400 Move pointOnScreen to inpututils.c We need this from other files too. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit d0a7cd759d4741a1ae118d579c90704410cde244 Author: Peter Hutterer Date: Fri Sep 2 09:53:02 2011 +1000 dix: NewCurrentScreen must work on pointers where possible When a screen switch is triggered by PointerKeys, the device for NewCurrentScreen is the keyboard. Submitting pointer events for this keyboard (without valuators) has no effect as GPE ignores the event. Force the dequeuing through the XTest device attached to this device. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 535b3789be3a7b43b5d9026e2b5150521d91e32b Author: Peter Hutterer Date: Wed Aug 31 14:15:02 2011 +1000 dix: warn about keyboard events with valuator masks We don't actually handle the mask correctly. They're clipped and dropped into the event but that's about it. I don't think we did since 1.4, let's warn the user if this happens. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 9537afb13f2750d22350b7441570332ae60e4860 Author: Peter Hutterer Date: Tue Aug 30 13:37:31 2011 +1000 dix: fill out root_x/y for keyboard events Switching screens relies on rootx/y to be set to the correct value. Note: though we technically take a mask for GetKeyboardEvents we don't actually handle it properly to move the pointer as required (and generate motion events if needed). Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone commit 6378d0233d21088b6429755627b4253859892c72 Merge: 6e965d8 98b2306 Author: Keith Packard Date: Mon Oct 3 13:56:06 2011 -0700 Merge remote-tracking branch 'herrb/master' commit 6e965d8a185087a55b2100b817e18f05b3ce5a00 Merge: 466e4b3 ac5881d Author: Keith Packard Date: Mon Oct 3 13:47:49 2011 -0700 Merge remote-tracking branch 'koba/reviewed' commit 466e4b3f174bdd7a69a76eb06e6c3e3344b8adc2 Author: Gaetan Nadon Date: Fri Sep 30 07:21:57 2011 -0400 Xserver-spec: use appropriate copyright markup Use docbook copyright markup for year and holder. Reviewed-by: Peter Hutterer Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard commit 62940bf38f70e3d9fb80521de40d6361548a0ea5 Author: Gaetan Nadon Date: Fri Sep 30 07:21:56 2011 -0400 Xserver-spec: re-order markup to follow outpout order No content change, no layout/ordering change. It is easier to find at the top. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 365bc2f5b132ac76a1f827923a99a75b33b158ac Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Sep 30 07:21:55 2011 -0400 Xserver-spec: add release information It has been added in all docs (X Version 11, Release 7.6) Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit ee3e26079e120bf9914cc27871d50501b35e75df Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Sep 30 07:16:34 2011 -0400 ddxDesign: drop the url in the coporate authors list It was such an eyesore once rendered in html. Now it looks like other authors. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0ed71b48c0c7bd65cd05eda6c06b9c29b4e3f607 Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Sep 30 07:16:33 2011 -0400 ddxDesign: remove server version from the document title Such version information is already written in the appropriate location Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 83ec3bf1aa72848421660c44c4503fec655f5924 Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Sep 30 07:16:32 2011 -0400 ddx-Design: add X Version and Release information Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2f09f6e3f610e585aeb5bd1023323a909d1ba20d Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Sep 29 07:53:16 2011 -0400 Xinput: use appropriate copyright markup for a multi licensed doc Removed a duplicate paragraph. Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 597348e969bf78dc2de4cf9bae7b76c110144266 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Sep 29 07:53:15 2011 -0400 Xinput: replace hard coded X11 version with X server version Which is more useful. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit fad04dd9701aa76249a0bab31676103debb84307 Author: Lennart Poettering <lennart@poettering.net> Date: Tue Sep 27 18:04:06 2011 +0100 udev: make use of udev_enumerate_add_match_tag() only when it is available udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag() are mostly optimizations, hence simply skip these calls if they are not available in the installed version of libudev. This should fix the build on older versions of udev. [airlied: fixes tinderbox failures on RHEL6] Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Tested-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 77743f877d573cdf70fcb5cb5897250f668ebf9b Author: Jamey Sharp <jamey@minilop.net> Date: Mon Sep 26 22:38:44 2011 -0700 kdrive: Fix build for opaque InputOption structure. Commit 05284a03f9002b03a66ae355b34790ec02b726f0 missed fixing up kdrive's use of the old non-opaque structure. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9a55b3661b4172f9a32cd6fefb254e06edb1a88a Merge: cf11ca3 84bb020 Author: Keith Packard <keithp@keithp.com> Date: Mon Oct 3 11:49:23 2011 -0700 Merge remote-tracking branch 'alanc/master' commit cf11ca360c2ded5ca309faa9d039160947387bb8 Merge: 463dd87 6eae9fa Author: Keith Packard <keithp@keithp.com> Date: Mon Oct 3 11:44:59 2011 -0700 Merge remote-tracking branch 'jeremyhu/for-keith' commit 463dd87062edaa974cb8c7163328a53197f237e1 Author: Pauli Nieminen <pauli.nieminen@linux.intel.com> Date: Thu Sep 22 18:38:53 2011 +0300 xf86/modes: Fix shadow rotation crashing when screen pixmap changes Driver may change screen pixmaps after page flipping that would then make damage lose track of the root pixmap. Using root window for shadow damages fixes the problem because SetWindowPixmap is implemented in shadow code. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f5d50b46ddeb039ab6564141f61261e94ee67637 Merge: 57cd32e 524e544 Author: Keith Packard <keithp@keithp.com> Date: Mon Oct 3 11:36:28 2011 -0700 Merge remote-tracking branch 'whot/next' commit 57cd32e93425597317b4b7722859155419836e4c Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Aug 25 15:41:55 2011 -0700 xfree86/modes: Make cursor position transform a helper function When the driver can handle the crtc transform in hardware, it sets crtc->driverIsPerformingTransform, which turns off both the shadow layer and the cursor's position-transforming code. However, some drivers actually do require the cursor position to still be transformed in these cases. Move the cursor position transform into a helper function that can be called by such drivers. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit 245cb8e94fd15990e1b7d6622added460f104dba Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Aug 25 10:19:48 2011 -0700 xfree86/modes: Let the driver handle the transform If a driver can use hardware to handle the crtc transform, then there's no need for the server's shadow layer to do it. Add a crtc flag that lets the driver indicate that it is handling the transform. If it's set, consider the transformed size of the screen but don't actually enable the shadow layer. Also stop adjusting the cursor image and position. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit e089737fb13868bd3a72b7ac4799d502d188f03e Author: Keith Packard <keithp@keithp.com> Date: Mon Oct 3 11:23:16 2011 -0700 Add AC_LANG_SOURCE wrappers around configure.ac code fragments Current autoconf versions are very unhappy when code fragments are not wrapped in AC_LANG_SOURCE macros, generating errors like: configure.ac:723: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from... ../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from... ../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... ../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from... ../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from... configure.ac:723: the top level Signed-off-by: Keith Packard <keithp@keithp.com> commit 6eae9fa28445b6cfa09061b338242df5116aafe8 Author: Matt Turner <mattst88@gmail.com> Date: Wed Sep 28 17:27:45 2011 -0400 Remove incorrect & in swap_uint32 Caused by commit 893e86a4, and hidden by the (char *) cast. Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Tested-by: Aaron Plattner <aplattner@nvidia.com> commit 6f581e3fde7ddc943c04f274e01735beb358b7f9 Author: Dave Airlie <airlied@redhat.com> Date: Mon Oct 3 16:09:12 2011 +0100 fix fb_id for dirty reporting commit 79959b734702486971447a11b2e4181463fda3bf Author: Dave Airlie <airlied@redhat.com> Date: Mon Oct 3 11:35:39 2011 +0100 fix make distcheck commit 524e5445c0b6df5247d4aac5368470bb89ef4080 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Oct 1 08:43:52 2011 -0700 Add #include "inpututils.h" to xkbAccessX.c for init_device_event Fixes Sun compiler warning: "xkbAccessX.c", line 128: warning: implicit function declaration: init_device_event Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 98b230669f591bf5b8b8764db3b287d91857ee9e Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Jul 31 20:43:39 2011 +0200 sdksyms.sh may not be executable. Use $(SHELL) to run it. Someone may want to build out of a source tree in a filesystem with the noexec mount flag set. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit f54852edc35a2831a4cd91906188101ea19904e1 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Sep 18 12:46:52 2011 +0200 Add a 'wscons' autoconf mechanism to configure input devices on BSD. This does not really handle hotplug (it's handled inside the kernel, by the 'mux' devices), but uses the wscons console driver configuration to figure out the keyboard layout and the list of pointing devices found by the kernel. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit f32c827d513c44f07e1d0fbcc0c96cef18c9a4d9 Author: Max Schwarz <Max@x-quadraht.de> Date: Sun Sep 25 20:44:26 2011 +0200 Input: Fix frac calculation on [Raw]DeviceEvent conversion (1UL << 32) evaluates to 0 (at least here), so do the fraction calculation in two steps as in libXi. Fractions on xXIRawEvent were not multiplied at all, which also gave 0 as result. Signed-off-by: Max Schwarz <Max@x-quadraht.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4c6bc0e76599dbe5ede2e1f48c9936a0e996b638 Merge: 057cc92 3304bbf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 30 09:24:56 2011 +1000 Merge branch 'smooth-scrolling' into next commit 3304bbff9b4ed63f1a47410a5320a136420ba2c6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 15 18:49:58 2011 +0000 Input: Add smooth-scrolling support to GetPointerEvents For scroll wheel support, we used to send buttons 4/5 and 6/7 for horizontal/vertical positive/negative scroll events. For touchpads, we really want more fine-grained scroll values. GetPointerEvents now accepts both old-school scroll button presses, and new-style scroll axis events, while emitting both types of events to support both old and new clients. This works with the new XIScrollClass to mark axes as scrolling axes. Drivers mark any valuators that send scroll events with SetScrollValuator. (Currently missing: the XIDeviceChangeEvent being sent when a driver changes a scroll axis at run-time. This can be added later.) Note: the SCROLL_TYPE enums are intentionally different values to the XI2 proto values to avoid copy/overlapping range bugs. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit ac5881d6d0bcf4bcc66a5d6ddde4eca950db1a5b Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Thu Sep 15 23:05:24 2011 +0600 Remove unused vtSysreq Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 0be1640dbbdd072f26d937de2e49f5ed58d54ef9 Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Sat Aug 27 02:02:36 2011 +0600 bsd: ioctl KDENABIO/KDDISABIO do not matter for OpenBSD Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 91042b98afdc6cecc746e101a88f79e56db1c0d0 Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Sat Aug 27 00:47:34 2011 +0600 bsd: OpenBSD and NetBSD not need extra headers in PCVT_SUPPORT Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 86eaa9bbe4ed59f89d6509d5e13211ab7f5a8038 Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Sat Aug 27 01:03:28 2011 +0600 bsd: Some clean up OpenBSD and NetBSD does not support syscons Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit dc864770d47fc1e4ec993e37a59e5aecb5b0a85e Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Fri Aug 26 22:40:19 2011 +0600 bsd: Remove dead code Since OsInit closes stdin before the xfree86 DDX opens the console, fstat on stdin will always fail, so it's safe to delete code that attempts it. Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit cbb842666fa7ff26bbdd1e89a7f41b835a677c5e Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Fri Aug 26 21:42:41 2011 +0600 bsd: Variable devConsoleFd need only if defined PCCONS_SUPPORT Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 38bd1e123d959e0a13514ec415afc8bfb5a170f2 Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Fri Aug 26 18:54:01 2011 +0600 bsd: Replacement screenFd on consoleFd because they are equivalent Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit f015351c73bb24ce4172911c3e95d67922de42ab Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Date: Fri Aug 26 18:27:02 2011 +0600 bsd: Remove unused macros KBD_FD Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit cb65ec6b58daf9a1afc40c8693fa0632f8cf0585 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 16:06:52 2011 +0100 check drm support dumb buffer capability commit 6ccd13a2d7d78db2d5bd3fafb00f78d2ceb11741 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 16:00:50 2011 +0100 add initial man page commit 1f37991dec98073d5dfbf0c30213f838999bd9da Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 15:55:36 2011 +0100 add shadowfb support, default to on. we should probably expose a bit from kernel to say if shadow is preferred or wasteful. commit 0b5e574dff230c7879eb9655bb7252553bbace50 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 15:55:24 2011 +0100 remove unused debug commit d686130c17126d86db55aae6b65b12d8bcf6a098 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 14:13:58 2011 +0100 add -Wall, cleanup warnings commit a4f6e661b5d6662c413c86eeefb4affddd65c562 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 14:05:43 2011 +0100 fix server recycling commit 7847321138be62b929123b25929a69f0a57aca3f Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 12:38:26 2011 +0100 port damage tracking code from st/xorg commit 4d3aadb22fc03f259a9d1717b55ce16d7a32e2be Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 12:34:27 2011 +0100 drop loading dri2 commit 1b1382c9e1995dcfe5dfec1de17155fa627ac6e8 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 12:34:17 2011 +0100 update authors/copyright commit 263597dbb3a75d711b5ad2e1f51554e6b2601d9a Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 12:30:46 2011 +0100 gut some more unneeded code commit a72bdf170c8bc55eef3d2dbb8e316839552288a5 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 12:28:59 2011 +0100 modesetting: rewrite probing based on fbdev. This isn't perfect, it should really do more with bus id matching and finding the write drm device using sysfs if it can. but it removes lots of hardcoding of pci ids. commit a77fae850511c4d73af2af2b88804586f950f28d Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 11:52:51 2011 +0100 cleanup some the drmmode_display header file commit 2a4618905445ce13fd272a4634ef5103dc804231 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 29 11:49:26 2011 +0100 modesetting: restart driver effort from other codebases This starts a randr 1.2 compatible driver with cursors. TODO: libkms dirty handling server recycling. commit 057cc92ebfeebe81b7d01ff2c6aa2c066c8d1a64 Merge: afb1fe6 52c9b59 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 29 14:18:35 2011 +1000 Merge branch 'raw-events' into next Conflicts: configure.ac dix/events.c commit 52c9b59a9fed6abfeca775a7a04133cee18eac0b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 30 09:47:06 2011 +1000 dix: use 'rc' for return code in DeliverRawEvent Reported-by: Walter Harms <wharms@bfs.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit b6b1f1b514bf14ddf6b265b8d4551f892ded0dd2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 11 13:56:08 2011 +1000 input: deliver raw events unconditionally for XI 2.1 clients. Deliver raw events regardless whether there is a grab on or not for clients supporting 2.1 or later. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 16244fba001826190445302f56784f5de9c59c01 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 2 13:50:13 2011 +1000 Support (and require) XI 2.1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 54e05d80a122bac57920fce1704c0f57492b849c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 14:21:39 2011 +1000 dix: rename ProcessRawEvents to dix/events.c:DeliverRawEvent No functional changes, prep work for future changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit c48133f133c64d356a1208f185619bfdf7e9a5f2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 14:19:45 2011 +1000 Xi: use temporary variable for filter. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit ac0850e86f22191091a1eb07237cae9de49ee00d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 12:14:32 2011 +1000 dix: split DeliverEventToWindowMask up a bit more. Move out the actual event delivery, it needs to be used from elsewhere. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 5ea2fb389fce235366e9fce83d20abdc8874f4e2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 11:43:50 2011 +1000 dix: rename DeliverEventsToClients to DeliverEventsToWindowMask To avoid confusion with a future patch and it better describes what this does anyway - delivering events to all clients that have the event mask on the window. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 016413dae947fe4e8e918f728c87354fa4928275 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 11:40:56 2011 +1000 dix: split client list retrieval out of DeliverEventToClients No functional change, but "other" was renamed to "clients". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 537c5f631d1f8d526e63355b7d88cb1fb2793492 Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 03:21:18 2011 +0200 xkb: Fix case checks for Latin 4. That one was missing _XkbKSLower: XK_kra: U+0138 LATIN SMALL LETTER KRA Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 0b56a7f0ad01d3a86cdd7a14d5e567a00a3553f6 Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 03:12:44 2011 +0200 xkb: Fix case checks for Latin 2. Those ones were getting _XkbKSLower for no reasons: XK_ogonek: U+02DB OGONEK XK_doubleacute: U+02DD DOUBLE ACUTE ACCENT Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 512a9750c197437889ff7f26a8d2bd242e030745 Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 03:03:47 2011 +0200 xkb: Fix case checks for Latin 1. That one was missing _XkbKSLower: XK_ssharp: U+00DF LATIN SMALL LETTER SHARP S That one was getting _XkbKSLower for no reasons: XK_division: U+00F7 DIVISION SIGN For reference, XK_multiply was already excluded from the _XkbKSUpper check, it's no big surprise XK_division has to be excluded from the _XkbKSLower check. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 635a1f50bc65512ec491fe71b9dfa8cf9118e2c2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 23 12:04:39 2011 +1000 input: allow for max < min for relative axes on InitValuatorAxisStruct Relative axes are initialized with 0, -1 but so far this never had any effect as all users of this function (for relative axes) just set it to the defaults anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 8d1a414cca51e7f8a93470c5aa2e998f5ca1bc9a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 23 12:03:48 2011 +1000 input: switch InitValuatorAxisStruct to return Bool Return errors instead of silently ignoring them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 5ac1f885f5c106b970835de36e13a9a7ea413df4 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 19:44:53 2011 +0000 Input: Add POINTER_EMULATED flag to GetPointerEvents POINTER_EMULATED merely sets XIPointerEmulated in the generated DeviceEvent. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 78d8d6dd7f31cb903d5c8baf64181795736f33ed Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 14:23:25 2011 +0000 Input: Add vertical and horizontal scroll axes To be used for smooth scrolling with future driver APIs, replacing Rel Vert Wheel and Rel Horiz Wheel axes, which have not been used in any open driver to date. Combined with double-granularity ValuatorMasks, these axes allow for fine-grained scroll data to be sent to clients. Future commits allow drivers to post these scroll axes to QueuePointerEvents/GetPointerEvents, which take care of emulating legacy scroll button events. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit d8e42decbad4abe13265f4c546a0c561905d018f Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 18:54:14 2011 +0000 Input: Split GetPointerEvents body into a helper function For smooth-scrolling support, we want GetPointerEvents to generate multiple events, so split the body of the function out into a helper function in order to call it multiple times. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc8aad2376207b5ca9c74effae67fb8183222d2e Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Mar 3 19:48:15 2011 +0000 Input: Set last valuators in GetPointerEvents only Previously, various pieces of code, including acceleration, used to drop the values into DeviceIntRec::last.valuators. Remove all this and only do it in GetPointerEvents after all transformation, acceleration and clipping, so we're guaranteed to always have the correct values. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 94c19a0a72403fc522e3d05eeb57f35e111a2562 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Mar 3 15:46:45 2011 +0000 Input: Convert DeviceIntRec::last to use doubles Change the last real user of a split integer/fractional co-ordinate system, DeviceIntRec's last->{valuators,remainder} to just have one set of doubles. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2d9beeb2174661d0a0732403ad4e49e9ff56718d Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Mar 3 15:36:55 2011 +0000 Input: Make DeviceEvent use doubles internally Change the DeviceEvent InternalEvent to use doubles for its valuators, instead of data and data_frac. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 626f487b97c99b48bf1d8c8ef4367a686639c3e6 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Mar 3 15:06:45 2011 +0000 Input: Make RawDeviceEvent use doubles internally Change RawDeviceEvent to use doubles for valuators internally, rather than data(_raw) and data(_raw)_frac. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3b7fb0f68dc0d40c968c2cfc9bb74b1d0fb48bc8 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 17:18:48 2011 +0000 Input: Modify mask in-place in positionSprite Instead of taking pointers to x and y values to modify in positionSprite, just modify the mask (as well as dev->last) in place. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 629a575261c08ca67324fea4c975636a1a95dc75 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 17:04:57 2011 +0000 Input: Convert positionSprite and GetPointerEvents to double Use doubles internally in both of these functions, eliminating most of the remaining int co-ordinate usage. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 51437995a5041a8c53c33b508b1607c78a5fa463 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 16:50:55 2011 +0000 Input: Don't call positionSprite for non-pointer devices If the device doesn't have any valuators, or if it has less than two of them, don't bother calling positionSprite. Users with one-dimensional pointing devices may be upset. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4c364a312daf2b743a0a60b9907f671804a1b1b6 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 16:49:53 2011 +0000 Input: Convert rescaleValuatorAxis to double Instead of passing fractional pointers around everywhere, just pass doubles instead. Much easier. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5680fa41ea3373651f7017898a307e97cf29b0d3 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 16:30:30 2011 +0000 Input: Remove x and y from moveAbsolute/moveRelative Both these functions modify the mask and pDev->last.{valuators,remainder} in-place now, so there's no need to pass in pointers to local x and y values. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0882b788da97c75e464eb352dac1d83c938a148e Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 16:27:31 2011 +0000 Input: Convert acceleration code to using ValuatorMask Instead of passing a set of int* to the acceleration code, pass it a mask instead, which avoids an unfortunate loss of precision. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 2b8f1d07bd42c9d3db3dbacfe6a1335e47236a6c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 15:37:53 2011 +0000 Input: Widen pointer acceleration types to double This widens almost all of the float-using code in ptrveloc.[ch] to doubles, other than values coming from properties which are specified to be floats by the property API. Bumps input API to v14 as this changes the AccelScheme signature, as used by xf86-input-synaptics. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 8a4a4e1b8a33899653d68a21bb7ff0557a576338 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 9 15:26:55 2011 +0100 Input: Use trunc instead of lrintf in acceleration code For compatibility with all the rest of the input code. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit e1df51421bc392d57f88c831fe0661871a8aa769 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 13:34:32 2011 +0000 Input: Set fractional member in set_raw_valuators RawDeviceEvents have space for fractional valuator members, so might as well start using them. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit cdf202250ef616f3b261db70da30e421ea59a630 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 14:50:29 2011 +0000 Input: Convert transformAbsolute to work on doubles Change transformAbsolute to use doubles internally. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3463078f9697fad0ee11837d80e88889fc6a28a4 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 13:29:24 2011 +0000 Input: Convert clipAxis, moveAbsolute and moveRelative to double Change all these three to use doubles internally, though the outputs of moveAbsolute and moveRelative are still truncated to int. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 4e52cc0ef48145134cd58d357fb7289e6f8bb709 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 13:20:37 2011 +0000 Input: Prepare moveRelative for conversion to double Shuffle some code around in moveRelative to make the conversion to double easier later. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 80fdf9ca33a8f50f98a4b1a3279e66b040353b80 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 13:19:00 2011 +0000 Input: Prepare moveAbsolute for conversion to double Shuffle some code around to make moving to double easier later. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6a6b4eb05c7822860e2362fa9b8441fc67055e27 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 17:22:59 2011 +0000 Input: Store clipped absolute axes in the mask Change moveAbsolute to be more symmetric with moveRelative by storing a clipped axis value back in the mask, rather than just in dev->last.valuators. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7e919ef5bfa94d51a06eefb150ab947bdbfb6885 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Feb 23 17:28:18 2011 +0000 Input: Add double-precision valuator_mask API Add API for valuator_mask that accepts and returns doubles, rather than ints. No double API is provided for set_range at the moment. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 79d4deb76d5612b75ef26b4549b7ade3a656687d Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Feb 23 14:31:01 2011 +0000 Input: Convert ValuatorMask to double-precision internally Switch the ValuatorMask struct to using doubles instead of ints for the actual values. Preserve the old int API, and (attempt to) round towards zero for values we return. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 60a766a96f9ec97adf6d0273f70ec23f313a11c6 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 9 16:02:47 2011 +0100 Input: Add flags to RawDeviceEvent Add a flags member which will be copied wholesale into the resultant xXIRawEvent. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 5d62c32981dbe9630bed32567b55008b536c81c5 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Dec 27 13:24:35 2010 +0000 Input: Add flags to DeviceEvent Add a flags member which will be copied wholesale into the resultant xXIDeviceEvent. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 38e9e28ba2fbffee52ad9889ef6d4e94c7af3e10 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Sep 20 20:39:06 2011 -0700 XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 206b30ebc608d29a91cc18665d89e887cac4dba3 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Sep 22 18:55:19 2011 -0700 Address regressions from e8ff555b95ba and d206d52f657c to work with other compilers 1) The error attribute appeared in gcc-4.3 2) The return type of __builtin_constant_p is int 3) Sun Studio 12.0 and later builtin support for __builtin_constant_p Found by Tinderbox. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit afb1fe695d197187a301c19863a128a65389b15c Merge: 7fb4bef c7163fd Author: Keith Packard <keithp@keithp.com> Date: Mon Sep 26 20:24:15 2011 -0700 Merge remote-tracking branch 'whot/next' commit c7163fdd302f706a3d67f0fdf93eeb3396bb3332 Author: vdb@picaros.org <vdb@picaros.org> Date: Wed Aug 31 07:23:01 2011 +0200 xfree86: .BI style: monitor section in xorg.conf man page The xorg.conf manual uses the following convention in most of its sections: bold = text to be copied literally to the config file, italic = a symbolic name to be substituted by a true value. Some configuration keywords seem to have been changed into generic options. Prepending Option to the manual entry swapped the bold-italic logic. This patch restores the convention in the monitor section and consists of -.BI "Option " "\*qPreferredMode\*q " \*qstring\*q +.BI "Option \*qPreferredMode\*q \*q" name \*q modifications. Plus a few minor changes (Modes → Mode) and a typo fix. Signed-off-by: Servaas Vandenberghe Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4b4caecb7d2c8e0b7e4fedc95fba2a728bbc25e6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 6 09:33:43 2011 +1000 xfree86: expose Option "TransformationMatrix" Recent changes to the server change the default absolute input device behaviour on zaphods to span the whole desktop too. Since these setups usually use an xorg.conf, allow the transformation matrix to be specified in the config as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit cf51424a34fb2b567a867338ab44f83b5c43251c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 6 09:39:01 2011 +1000 xfree86: use subheader for Pointer Acceleration parts in xorg.conf(5) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9125952b407090b040bffb3d752288293137cf77 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 5 15:43:14 2011 +1000 xfree86: fix comment typo Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39 Author: Sam Spilsbury <sam.spilsbury@canonical.com> Date: Wed Sep 14 09:58:34 2011 +0800 Remove the SendEvent bit (0x80) before doing range checks on event type. Some extension libraries may set this bit before converting the event to wire protocol and as such range checking the event will cause an invalid BadValue error to result. As the documentation suggests the the bit should be "forced on", remove it before doing range checks and continue to force it on in the server. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f52d5cd374563544dafe29587411f345e31bbdf8 Author: Carlos Garnacho <carlosg@gnome.org> Date: Wed Aug 31 00:46:52 2011 +0200 Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices The corresponding DeviceIntPtr wasn't being gotten properly, resulting in BadDevice from dixLookupDevice(). Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 24823f1ab0f16e0815ef44340894537dc4babf6a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 3 16:01:28 2011 +1000 xfree86: switch options from pointer to XF86OptionPtr In all cases, the pointer was simply type-cast anyway. Let's get some compile-time type safety going, how about that. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Squashed in: xfree86: Move definition of xf86OptionPtr into separate header file The pile of spaghettis that is the xfree86 include dependencies make it rather hard to have a single typedef somewhere that's not interfering with everything else or drags in a whole bunch of other includes. Move the xf86OptionRec and GenericListRec declarations into a separate header. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 284328a6beb0bd0ab6653973ce52b5a68b4e791f Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 26 17:04:56 2011 +0800 glamor-ddx: Rename glamor.c to glamor_ddx.c. As glamor's dix module already has a glamor.c, rename this glamor.c to other name to avoid file name conflict which may confuse gdb. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 101b69dddff6cc538cb369c70377bbad825aa765 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 26 16:33:52 2011 +0800 glamor: Check libgbm if enable glamor ddx. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 6a7ad1c92934b35eb2431c3e0f11c0c56a097dc9 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 26 16:13:57 2011 +0800 glamor-ddx: Don't double free the cursor memory. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit fe4c95ce843afffed981ac8bb89ca433bd20f1e2 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 26 16:08:29 2011 +0800 glamor: Refine the screen pixmap initialization for Xephyr. The previous implementation is to override the CreatePixmap firstly and assume the first call to CreatePixmap must be screen pixmap. This is not clean. Now Refine it to normal way. Let the Xephyr to set texture 0 to screen pixmap during creating screen resources. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 1fb58860cc02d28545c66a916956a45918596870 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 26 16:05:52 2011 +0800 ephyr-glamor: Implment gl disptach function for host glx. We should pass back the glXGetProcAddress to the underlying gl dispatch initialization function to get those gl function pointers. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit df070205600cd736750d8a43426976a518b1fbae Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 26 16:01:03 2011 +0800 ephyr-glamor: Set texture 0 to screen pixmap. In Xephyr, screen pixmap is different from other pixmap. It use fbo zero and texture zero. We initialize it during creating screen resources. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 937d3bcecf04305c01159f5c5084833f28014061 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Sep 22 13:39:01 2011 +0800 glamor: Correct the version check for GLES2. If we are using GLES2, then the version number should be no less than 2.0 rather than no less than 1.3 which is for GL API. commit 483717484afb4ccf5b48483b3a21a9fe91213dd4 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Sep 20 17:15:12 2011 +0800 glamor-ddx: Destroy all the pixmap cursors when close current screen. As now we use pixmap to handle cursor, and pixmaps are related to current screen. If we close the screen, then we have to destroy all the related cursors. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit f1c36c611efaa56e49758d8e8b19d07c10a8277e Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Sep 20 17:10:50 2011 +0800 glamor-ddx: Don't need to call preInit in screen_init. The previous implementation call preInit again to reopen the device if the device is closed by eglTerminate. Now we don't need it anymore, as glamor dix doesn't call eglTerminate any more when close screen. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 09c63d320112fbb4995696d813c488e82915c2f5 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Sep 20 15:19:13 2011 +0800 glamor-ddx: Reuse glamor_dix module to handle egl platform. We already have a glamor egl module at glamor directory which could initialize and create egl context and also can attach a gbm buffer to a specified pixmap or to the screen pixmap. This commit remove all the duplicated code here and use the glamor_dix module directly. As we don't want to handle egl stuffs in this layer, we have to change the way to handle hardware cursor. Previous method is to call egl functions to create a egl image and then bind the image to a texutre then call gl functions to load texture image to the cursor bo. Now we can bind the cursor bo to a cursor pixmap and then use putimage to load new image to the cursor bo. Then we can completely avoid to call egl or gl functions directly in this ddx driver. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 1590da001129ea61d6f7f8758d1d2842825be81b Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Sep 20 15:14:49 2011 +0800 glamor-egl: Add gbm device support. Latest mesa EGL implementation move to use gbm to manage/allocate buffers. To keep backward compatibility, we still try to use eglGetDRMDisplayMESA firstly, and if failed, then turn to use eglGetDisplay(gbm). Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 2d4d40a4b5938249f3c73ed14fe5c5b926c2fefd Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 19 09:45:32 2011 +0800 glamor-ddx: Fix the broken switching between VTs. Now we can allocate frame buffer during the screen initialization. And set mode major when enter VT. This is the correct logic. The previous implementation defer the set mode major to create screen resource which will cause the switching between VTs broken. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 4c8ed1756aa5121a559aa604926a730180a1403f Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Mon Sep 19 06:31:57 2011 +0800 glamor-ddx: Use gbm to allocate front buffer and cursor image. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 82a9b0c540dcf1064f5184c36a05d6216fb11034 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Sep 16 13:37:13 2011 +0800 glamor-ddx: Change naming of glamor ddx module. Use glamor_ddx prefix for all standalone glamor ddx functions. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 67dbe0ddf87a6dd602d3d4a6049072f6386d757e Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Sep 8 15:16:01 2011 +0800 glamor-egl: Added new function to create image for a pixmap. This function is used to support dri2. In the underlying driver, it will create a buffer object for a given pixmap. And then call this api to create a egl image from that buffer object, and then bind that image to a texture, and then bind that texture to the pixmap. Normally, this pixmap's content is shared between a dri2 client and the x server. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 2a9dfc963f610abfbf12d5efdf5ba5b3f55a4305 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Sep 8 15:14:43 2011 +0800 glamor: Re-arrange some macros/definitions in header files. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 0dff23d65b8bcec615f4c7a49efa7a5bf220b299 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Sep 8 14:05:46 2011 +0800 glamor: Don't direct call to any gl functions. Create a new structure glamor_gl_dispatch to hold all the gl function's pointer and initialize them at run time , rather than use them directly. To do this is to avoid symbol conflicts. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 7daf9af086624133d6c4857ed92d57ad2a492d86 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Aug 31 17:43:46 2011 +0800 glamor: Let GLAMOR_DDX implicit GLAMOR. If user only enable GLAMOR_DDX, he must also want GLAMOR. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit f08988455cd4f6339187e74df8edb5783b61f8fa Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 30 18:24:53 2011 +0800 glamor: Route UnrealizeGlyph to glamor_glyph_unrealize. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 16659622708db82caaeb12527ba09545ad15b4c3 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 30 17:45:07 2011 +0800 glamor: Improve glyphs cache mechanism. This commit applying the latest uxa's glyphs cache mechanism and give up the old hash based cache algorithm. And the cache picture now is much larger than the previous one also. This new algorithm can avoid the hash insert/remove and also the expensive sha1 checking. It could obtain about 10% performance gain when rendering glyphs. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit bf4cbbd4e9c8ee104293a3c4eb202c880a139b73 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 30 17:37:47 2011 +0800 glamor: Move glamor_glyphs_init to create screen resources stage. As in glamor_glyphs_init, we may need to create pixmap. Thus it must be called after the pixmap resources allocation. Just move it to screen resource creation stage is good enough for mow. Also introduce a macro GLAMOR_FOR_XORG to glamor.h. As glamor may be used by Xephyr which doesn't don't have those xorg header files and also don't need the egl extension. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit ae38bd7c459982d3e05f6f672ee68d187e97421c Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Aug 25 10:05:11 2011 +0800 glamor: Change glamor_egl_init API. Slightly change the API glamor_egl_init, as this initialization is to initialize the display not the screen, we should call it in xxx_preinit rather than xxxScreenInit(). we change the input parameter as below, as in preInit, the screen may not be allocated at all. And in glamor_egl_init, it will not call glamor_init. Driver should call glamor_init at screen_init stage. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit d4f4d1272e1745752840eb7e8ec04eb155ac38d1 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Aug 24 17:17:48 2011 +0800 glamor-egl: Fix direct call for glEGLImageTargetTexture2DOES. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 6cb4abca697c24bdc644502cce8a2ca9bbf131e3 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Aug 24 17:13:35 2011 +0800 glamor: Remove the version check for EGL/gles. As PVR's gles2 has different version number from mesa's, just simply remove the version check here to let both platform could build it. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 60f14d60f6169272951d41d8ca9e0a294c2ca3d0 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Aug 24 16:54:32 2011 +0800 glamor-egl: Move EGL surfaceless related code to dix module. The functions in glamor_egl.c could be shared by any egl back end drivers. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 3854409e9ad25418c6188f491410bb05eaf92fc6 Author: Zhenyu Wang <zhenyuw@linux.intel.com> Date: Mon Aug 22 23:27:24 2011 -0700 glamor: Fix direct call for glEGLImageTargetTexture2DOES Follow extension call rule to call glEGLImageTargetTexture2DOES. commit 54c91079d2bd21d3fd97b6d5fa3ba5c4a86b6337 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 23 14:04:07 2011 +0800 glamor-gles2: Add explicit precision qualifiers for gles2. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit b4f265c7f9bcb7824df19ea915ab32fe84d9ec53 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 23 13:30:54 2011 +0800 glamor: Fallback to software fb when repeat is needed. Need to be fixed latter. We should not need any fallback here. But currently, the implementation for repeating tiling is broken. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit bd0ea43f3999e29ae5953ca5257b1795916dd5e7 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 23 13:27:48 2011 +0800 glamor: Change to use the original drawable in glamor_fill. As glamor_fill may fallback to software rasterization, we'd better to use the original drawable as input paramter. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 65812b538f23bfccc32a7bbc0b2c4e93e1cd8fe8 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 23 10:31:50 2011 +0800 glamor-dix: Make a glamor dix module. And modify the header file to export three APIs to the ddx driver. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit ef3ea0f46bf1b688249cd37d54cfa67ec55041b0 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Aug 19 11:06:56 2011 +0800 glamor: Don't need to check status when set the target. As we already checked the status when create the fbo. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 52cce9333fed2035da9623f338428a5d220b577d Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Aug 19 11:05:21 2011 +0800 glamor: egl version 7.11 should be ok for us. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 3648e35b5d0ffcb2ea5d40c842a7f8dd39b27b50 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Aug 19 10:53:44 2011 +0800 glamor-ddx: Add code to check required egl extensions. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit eaa07998c432f68485423c4d108220ce1d72e7b6 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 16 14:05:25 2011 +0800 glamor: Add device independent glamor to the installation package. Other ddx driver may link libglamor_dix to utilize glamor. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 1658454dea4330144ebc0b02e1b42feed6db4f41 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 16 00:33:35 2011 +0800 glamor: Fix the copy of overlaped region in one pixmap. Originaly, we use fbo blit to handle overlaped region copy. But GLES2 doesn't support that, just simply copy the needed region to another texture can fix this problem. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 1f129c491bfc825465c3bc0e9b745b7f66dea720 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 16 00:32:57 2011 +0800 glamor: Convert pixmap to supported format before getspans. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 67da52ec13a87846201a99d5a31db28668d9fdfd Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 16 00:21:09 2011 +0800 glamor: Add color conversion support by using new shader. There are two places we need to do color conversion. 1. When upload a image data to a texture. 2. When download a texture to a memory buffer. As the color format may not be supported in GLES2. We may need to do the following two operations to convert dat. a. revert argb to bgra / abgr to rgba. b. swap argb to abgr / bgra to rgba. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 0eea084db54fb88b9933fd1326a2b0b059b3f9d7 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 16 00:20:01 2011 +0800 glamor: GLES2 doesn't support glEnable/Disable Texture 2D. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 504e03c0b59f4dc3b8058abdce79706a72cd0dde Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 16 00:17:58 2011 +0800 glamor: GLES2 doesn't support GL_CLAMP_TO_BORDER. Simply comments it out. Need revisit latter. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit f84cc8b84b2944b60eb2a8225e3c44a1cdfb228d Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 16 00:09:38 2011 +0800 glamor-ddx: Hardware cursor's format should be GL_RGBA. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 23c1fba5e5a5fe8dd18c4c8a9b5a958ce4671160 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sat Aug 13 15:41:18 2011 -0400 glamor: Remove glu3 which is unnecessary. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit a228effbeb339ae6f0b73c633022b3ec9981148f Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Thu Aug 11 15:56:02 2011 -0400 glamor: Remove useless glVertexPointer related code. As glVertexPointer is not supported by GLES2, I totally replaced it by VertexAttribArray. This commit remove those old code. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 5cbb2a4ca05f696d2af9a2e50bf106b6f2acd1c6 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Thu Aug 11 15:35:26 2011 -0400 glamor: Only fallbac glamor_setspan when we are using gles2. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 667d65534d64df30146cfa0d32522bced51e0697 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Thu Aug 11 15:27:12 2011 -0400 glamor: Unify the variable name which used to indicate no alpha. The original code use different name and the name is vague. Now change it to no_alpha. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 5e7fdbb498c47b6e89280b8354f0ebaaf61d0646 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Thu Aug 11 15:08:12 2011 -0400 glamor: Disable ALPHA8 fbo. As some platform doesn't support to use ALPHA8 texture as draw target, we have to disable it. It seems there is no easy way to check that. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 172e8cfcd411b1abeaf8ede2e3882d6198cee5b8 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Thu Aug 11 15:05:02 2011 -0400 glamor: Remove GLEW dependency. Glamor doesn't need to use GLEW. We can parse the extension by ourself. This patch also fix the fbo size checking from a hard coded style to a dynamic checking style. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 2146a25bac4392c47ef06ecddbf12db184926b7e Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Thu Aug 11 15:03:48 2011 -0400 glamor-ddx: Silence one warning. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit d66bd9714e1e1af4267fb4eb208143a070e65ee3 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Thu Aug 11 09:54:28 2011 -0400 glamor: Concentrate FBO's creation to one function. And add status checking for it. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit b2bff334ce4f36352497f1c1d4e9f0e5b3336136 Author: Zhenyu Wang <zhenyuw@linux.intel.com> Date: Tue Aug 9 19:37:17 2011 -0700 glamor: Require libdrm CFLAGS for building Need to depend on libdrm CFLAGS for glamor building. commit 41b13fbd264594f88905b1cf8dcb2f14e7ee5b69 Author: Zhenyu Wang <zhenyuw@linux.intel.com> Date: Wed Aug 10 01:42:26 2011 -0700 glamor: Use function pointer to get extenstion calls This is the formal usage for extension functions. commit 7aecfa245facf754ff8e09d6ef1ad0ab802156fc Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 9 10:01:39 2011 -0400 glamor-es2: Add --enable-glamor-gles2 to build system. Now, to build a gles2 version of glamor server, we could use ./autogen.sh --enable-glamor-ddx --enable-glamor-gles2 Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 36a93f62c7830af088a54514eab6bf4d92423df6 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 9 09:59:56 2011 -0400 glamor_gles2: Use gl_flavor to determine which version of GL. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 29e358f6b3838a56b53ec809665f2e7be1731722 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue Aug 9 09:59:08 2011 -0400 glamor: Fix one typo error in README. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit ee33c947aac10b2b1ec2c5b070fbd81cef1773c6 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Aug 3 16:52:19 2011 +0800 glamor-es: Use glVertexAttribPointer to replace glVertexPointer. As GLES2 doesn't support glVertexPointer. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 94d884a198b97ed2e78a38ce5a71955bdbf893f8 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Aug 3 10:49:18 2011 +0800 glamor-es2: Fix some non-es2 functions. ES2.0 doesn't support QUADS and also doesn't support some EXT APIs. Fix some of them in this commit. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 68c3c6eb0cafd5eb2c208dd76a3a65187256700c Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 2 15:54:15 2011 +0800 glamor-es2: Add gles2 option. First commit to enable gles2 support. --enable-glamor-ddx --enable-glamor-gles2 will set thwo MACROs GLAMOR_DDX and GLAMOR_GLES2. Currently, the gles2 support is still incomplete. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 98f8ef5f991e3c9d4b434af9003c466ad1edc23e Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Aug 2 15:51:46 2011 +0800 glamor: Change to use official APIs rather than ARB version function. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 0ef1698be22750fb14418bd418114fc63039db0c Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jul 21 16:18:48 2011 +0800 glamor: Fix one bug for Xephyr. Xephyr doesn't has a bounded valid texture. It seems that we can't load texture 0 directly sometimes. Especially in the copyarea, function if that is the case, we prefer to use fbo blit to read the screen pixmap rather than load the bound texture. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 9b667ffd564910ff7373547ce2f8d4a7c5d71137 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jul 20 14:33:00 2011 +0800 glamor: Use small internal texture format if possible. Reduce some texture memory requirement and also save some bandwidth. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 01489f9da9aa357c59799d4d41c7ca96b4cbd1d8 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jul 20 14:02:15 2011 +0800 glamor: Add simple introduction of how to setup glamor xserver. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 1f3f3baf1469e74767474ddb383e92502384de80 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jul 20 13:35:25 2011 +0800 glamor: Avoid 2D bitblit if possible. It turns out that the use of fbo blit is one of the root cause which lead to slow drawing, especially slow filling rects. We guess there should be a performance bug in the mesa driver or even in the kernel drm driver. Currently, the only thing glamor can do is to avoid calling those functions. We check whether the copy source and destination has overlapped region, if it has, we have to call fbo blit function. If it has not, we can load the source texture directly and draw it to the target texture. We totally don't need the glCopyPixels here, so remove it. By apply this patch, the rendering time of firefox-planet-gnome decrease to 10.4 seconds. At the same platform, uxa driver get 13 seconds. This is the first time we get better performance than uxa driver. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 5c4d53c5126bb9f603d04dac6874280b527319f5 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jul 20 13:06:23 2011 +0800 glamor: Implement delayed solid filling. When we need to solid fill an entire pixmap with a specific color, we do not need to draw it immediately. We can defer it to the following occasions: 1. The pixmap will be used as source, then we can just use a shader to instead of one copyarea. 2. The pixmap will be used as target, then we can do the filling just before drawing new pixel onto it. The filling and drawing will have the same target texture, we can save one time of fbo context switching. Actually, for the 2nd case, we have opportunity to further optimize it. We can just fill the untouched region. By applying this patch, the cairo-trace for the firefox-planet-gnome's rendering time decrease to 14seconds from 16 seconds. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 1caf741a4a41ef46a43980ba0be897770fea13db Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jul 20 13:02:28 2011 +0800 glamor: Fixed a bug when computing the bounds of boxes. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit fe0a6a29300055f8288c9d1f470fd3e24f5bb3bb Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jul 7 16:54:18 2011 +0800 glamor: Should return when done gl drawing. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 7fbdc60fd4eb94c02b0b89d05cfe0243c3562ec1 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jul 7 15:32:39 2011 +0800 glamor: comment out the message when creating a system memory pixmap. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit f961390db6fa0707895effb2e7672edda575f8ec Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jul 7 15:31:35 2011 +0800 glamor: Don't need to pad the tile image if pixmap is ni texture. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 77ecd366933bbe726a4a7e57e35b1510b675df8d Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jul 7 15:30:19 2011 +0800 glamor: We don't need to check format in compositing. We already handle all format checking in pixmap uploading and converting, don't need to do that again. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 477a54bc9ed8f252b3a42af8ac01ef1da7b5ab6b Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jul 7 14:47:51 2011 +0800 glamor: Fixed two unintialized warnings. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit d49d48257917a4a900c84dae111d3f5e761a8d89 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sat Jul 2 14:47:38 2011 +0800 glamor: Fix multiple crtc setup. Now, support dual crtc configuration. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit fc23334e54b0b90d2f00b017a03cf47b70dc71aa Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Fri Jul 1 23:51:42 2011 +0800 glamor: Optimize fallback case for the polylines. When fallback to cpu for the polylines procedure, we can just download required region to CPU rather than to download the whole pixmap. This significant improve the performance if we have to fallback, for example do non-solid filling in the game Mines. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit da66a76f276eccee90855bc0cb28092c3755ed7b Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Fri Jul 1 23:48:21 2011 +0800 Revert "glamor: Don't need to read dest if op is SRC or CLEAR." This reverts commit eb16fe0b7c8ea27b5cf9122d02e48bf585495228. As currently glamor_prepare_access/finish_access will touch the whole pixmap, not just the request region, then write only mode will not work correctly. We may need to revisit all fallback case, and convert the image to the right size before do the prepare/finish processing. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit cb3b34ec53e00c6ca212891b314f473ee2f80a40 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Fri Jul 1 22:54:45 2011 +0800 glamor-ddx: Add missed drmmode_crtc_destroy function. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit c68fb6ed723d7268a3c4950b40c20ddf9b4b9ca5 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Fri Jul 1 22:36:31 2011 +0800 glamor-ddx: Reinit crtc if we need to reopen the card. As the eglTerminate will close the card when close screen, we may need to reopen it at next time create a screen resource. and thus we need to re initialize the drmmode crtc also. Otherwise , the cursor handling will be broken as it has the wrong fd. commit ca614860fa2a56d469064b5e05070d8201597728 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Jul 1 17:02:10 2011 +0800 glamor: convert if too large source or mask . Some strange web page has 20000*1 png picture, and actually only use partial of it. We force to convert it to a actuall size rather than its original size,if it is the case. Then to avoid latter's failure uploading. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 1444fed4a8030ec59f4448b490f2f77db86f0b86 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jun 30 16:53:24 2011 +0800 glamor: silence compilation warnings. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 734b10e9f7e729fc300ed432bd3c81e1ea7483f3 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jun 30 16:50:23 2011 +0800 glamor: Fix one typo bug in glamor_tile. It will return when the destination pixmap has a fbo but will continue when it doesn't have a fbo. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 2eb40a37920132d53e3b48830704f92d4c695f4c Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jun 30 16:49:40 2011 +0800 glamor: Remove one extra area copy in glamor_glyph. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 61e1ad39724e5baaed4f30ff3c86782e701f19fb Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jun 30 16:40:32 2011 +0800 glamor: Reduce source or mask picture size if possible. If we only need a short part of the source or mask's drawable pixmap, we can convert it to a new small picture before call to the low level compositing function. Then it will only upload the smaller picture latter. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 14503fbb819d07fa2b58d9bb741b55f93aff2cf6 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jun 30 16:38:43 2011 +0800 glamor: Fix the coords calculation in glamor_fill. glamor_fill is only called from internal functions glamor_fillspancs and glamor_polyfillrect. And both functions already add the offset to the coords, so the coords are already relative value, we can't add the offset once again. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 1dca5d7b91ed6fced34f389453678407bc223e9c Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jun 30 16:04:59 2011 +0800 glamor: Reduce source pixmap's size. If the dest pixmap is in texture memory, but source pixmap is not. Then we need to upload the source pixmap to texture memory. Previous version will upload the whole source pixmap. This commit preprocess the source pixmap, and reduce it to a smaller tempory pixmap only contains the required region. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 33c6c78ae9c7e72a94cc27536f3b5f50cdcc9241 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu Jun 30 16:01:57 2011 +0800 glamor: Add one option to force create a cpu memory pixmap. Some special case we want to get a cpu memory pixmap. For example to gather a large cpu memory pixmap's block to a small pixmap. Add pixmap's priviate data's deallocation when destroy a pixmap. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 8890b38857128181cf506356046bf4a5bce53ab0 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Jun 28 17:17:23 2011 +0800 glamor: Don't map the vbo to system memory. Access mapped vbo address is too slow. And by use system memory directly, rgb10text/aa10text increases from 980K/1160K to 117K/140K. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit c303949aabacb6a105ca0e0c521ca293dbda7d43 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Jun 28 14:49:38 2011 +0800 glamor: Reduce one extra copy in glamor_trapezoids. This reduce the time when running cairo-performance-trace with the firefox-planet-gnome.trace from 23.5 seconds to 21.5 seconds. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 9e4567afe6019ed7a330182d660880d8ea6c3685 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Jun 28 14:37:29 2011 +0800 glamor: Change to use system memory for write only access. If the pixmap is write-only, then use a pbo mapping will not get too much benefit. And even worse, when the software rendering is access this mapped data range, it's much slower than just using a system memory. From the glamor_prepare_access glamor_finish_access view, we have two options here: option 1: 1.0 create a pbo 1.1 copy texture to the pbo 1.2 map the pbo to va 1.3 access the va directly in software rendering. 1.4 bind the pbo as unpack buffer & draw it back to texture. option 2: 2.0 allocate a block memory in system memory space. 2.1 read the texture memory to the system memory. 2.2 access the system memory and do rendering. 2.3 draw the system memory back to texture. In general, 1.1 plush 1.2 is much faster than 2.1. And 1.3 is slower than 2.2. 1.4 is faster than 2.3. If the access mode is read only or read write, option 1 may be fater, but if the access mode is write only. Then most of the time option 1 is much faster. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 4afa9e4080eebbee0752e5f45b2ff16df75cb9b1 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Jun 28 14:28:19 2011 +0800 glamor: Prepare/finish access once if src equal to dst. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit cbedfe75135e3253c32ac8b89380f47d1b8a37c4 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sun Jun 26 20:00:26 2011 +0800 glamor: Don't need to read dest if op is SRC or CLEAR. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit b8e692d94eb7075409e0d072fdf3066ca1d5d5f3 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sun Jun 26 15:54:24 2011 +0800 glamor: Move the blend set up after the pixmap uploading. This is a bug, as if we do blend set up before do the pixmap dynamic uploading. We will have a incorrect blend env when doing the uploading. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit bf782283371bc13c7b969a373c2a2eaaa3c81ec6 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sun Jun 26 15:51:47 2011 +0800 glamor: Fixed one bug when enable dynamic pixmap uploading. When try to upload a pixmap without yInverted set, we must set up a fbo for it to do the y flip. Previous implementation only consider the ax bit. After fix this problem, we can enable the dynamic uploading feature in copyarea function when the yInverted is not set (from Xephyr). Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit 489e6c4e6f734d961ae8bbec67d78fccbeb9781f Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sun Jun 26 15:49:13 2011 +0800 glamor: Initialize pixmap private's container to correct value. When calling from ephyr, we forgot to initialize it to the correct value. Will cause segfault when run Xephyr. Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com> commit ca36ada041558d1823b12b1a0141e43b9f9ad939 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jun 22 18:15:02 2011 +0800 glamor: Don't always fallback everything when change window attr. Change the glamor_change_window_attributes's handling. We don't need to fallback every thing to cpu at the beginning. Only when there is a real need to change the pixmap's format, we need to do something. Otherwise, we need do nothing here. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit ca1908e11dcb56cb952f6bce55503e932aa9a27c Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jun 22 14:33:38 2011 +0800 glamor: Concentrate and reduce some coords processing code. Concentrate the verties and texture coords processing code to a new file glamor_utils.h. Change most of the code to macro. Will have some performance benefit on slow machine. And reduce most of the duplicate code when calculate the normalized coords. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 355334fcd99e4dce62e2be1e27290c9a74ea944f Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Tue Jun 21 18:31:11 2011 +0800 glamor : Add dynamic texture uploading feature. Major refactoring. 1. Rewrite the pixmap texture uploading and downloading functions. Add some new functions for both the prepare/finish access and the new performance feature dynamic texture uploading, which could download and upload the current image to/from a private texture/fbo. In the uploading or downloading phase, we need to handle two things: The first is the yInverted option, If it set, then we don't need to flip y. If not set, if it is from a dynamic texture uploading then we don't need to flip either if the current drawing process will flip it latter. If it is from finish_access, then we must flip the y axis. The second thing is the alpha channel hanlding, if the pixmap's format is something like x8a8r8g8, x1r5g5b5 which means it doesn't has alpha channel, but it do has those extra bits. Then we need to wire those bits to 1. 2. Add almost all the required picture format support. This is not as trivial as it looks like. The previous implementation only support GL_a8,GL_a8r8g8b8,GL_x8r8g8b8. All the other format, we have to fallback to cpu. The reason why we can't simply add those other color format is because the exists of picture. one drawable pixmap may has one or even more container pictures. The drawable pixmap's depth can't map to a specified color format, for example depth 16 can mapped to r5g6b5, x1r5g5b5, a1r5g5b5, or even b5g6r5. So we can't get get the color format just from the depth value. But the pixmap do not has a pict_format element. We have to make a new one in the pixmap private data structure. Reroute the CreatePicture to glamor_create_picture and then store the picture's format to the pixmap's private structure. This is not an ideal solution, as there may be more than one pictures refer to the same pixmap. Then we will have trouble. There is an example in glamor_composite_with_shader. The source and mask often share the same pixmap, but use different picture format. Our current solution is to combine those two different picture formats to one which will not lose any data. Then change the source's format to this new format and then upload the pixmap to texture once. It works. If we fail to find a matched new format then we fallback. There still is a potential problem, if two pictures refer to the same pixmap, and one of them destroy the picture, but the other still remained to be used latter. We don't handle that situation currently. To be fixed. 3. Dynamic texture uploading. This is a performance feature. Although we don't like the client to hold a pixmap data to shared memory and we can't accelerate it. And even worse, we may need to fallback all the required pixmaps to cpu memory and then process them on CPU. This feature is to mitigate this penalty. When the target pixmap has a valid gl fbo attached to it. But the other pixmaps are not. Then it will be more efficient to upload the other pixmaps to GPU and then do the blitting or rendering on GPU than fallback all the pixmaps to CPU. To enable this feature, I experienced a significant performance improvement in the Game "Mines" :). 4. Debug facility. Modify the debug output mechanism. Now add a new macro: glamor_debug_output(_level_, _format_,...) to conditional output some messages according to the environment variable GLAMOR_DEBUG. We have the following levels currently. exports GLAMOR_DEBUG to 3 will enable all the above messages. 5. Changes in pixmap private data structure. Add some for the full color format supports and relate it to the pictures which already described. Also Add the following new elements: gl_fbo - to indicates whether this pixmap is on gpu only. gl_tex - to indicates whether the tex is valid and is containing the pixmap's image originally. As we bring the dynamic pixmap uploading feature, so a cpu memory pixmap may also has a valid fbo or tex attached to it. So we will have to use the above new element to check it true type. After this commit, we can pass the rendercheck testing for all the picture formats. And is much much fater than fallback to cpu when doing rendercheck testing. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit ba6dd8aa492d9d555d8b175bcf350e5db1821597 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Jun 10 18:32:15 2011 +0800 glamor: Simplify fill acceleration for spans/polyfillrect by only clipping once. This commit was borrowed from uxa driver contributed by Eric. commit number is e0066e77e026b0dd0daa0c3765473c7d63aa6753. commit log paste as below: We were clipping each span against the bounds of the clip, throwing out the span early if it was all clipped, and then walked the clip box clipping against each of the cliprects. We would expect spans to typically be clipped against one box, and not thrown out, so we were not saving any work there. For multiple cliprects, we were adding work. Only for many spans clipped entirely out of a complicated clip region would it have saved work, and it clearly didn't save bugs as evidenced by the many fix attempts here. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit a0a52be73994c93521e94f1f10152ce851485ea3 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Jun 10 16:51:27 2011 +0800 glamor: Fallback to fbPolylines for diagonal poly_line. It's better to give a correct output when we haven't implement all the code path. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit d7f8b888d0961af8d0ec6ad5c920ce758529b620 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Jun 10 16:01:40 2011 +0800 glamor: For non-supported fill style fallback to fbFill. The previous implementation will just skip the rendering which is not good. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit b60e6cb66d3fba43d5403b2b5027537d09ee7c98 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Jun 10 15:46:23 2011 +0800 glamor: Silence compilation warnings. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 229240e565f976de8e7b82dd606c2e862152b2b5 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Jun 10 14:07:54 2011 +0800 glamor: Add render triangles support. By default, fallback to frame buffer currently. This commit makes us pass the rendercheck's triangles testing. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit ac0589c91699433bc9dbc25b7edff456dff742a4 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Jun 10 14:02:19 2011 +0800 glamor: Use software fb for 1bpp pixmap. For 1bpp pixmap, software fb get better performance than GL surface. The main reason is that fbo doesn't support 1bpp texture as internal format, so we have to translate a 1bpp bitmap to a 8bit alpha format each time which is very inefficient. And the previous implementation is not supported by the latest OpenGL 4.0, the GL_BITMAP was deprecated. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 3c44e3e0ce1e286e0540298d5db547c43903629f Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jun 1 19:35:15 2011 +0800 glamor: Optimize composite when soure/mask is xrgb. Added a new shader aswizlle_prog to wired the alpha to 1 when the image color depth is 24 (xrgb). Then we don't need to fallback the xrgb source/mask to software composite in render phase. Also don't wire the alpha bit to 1 in the render phase. This can get about 2x performance gain with the cairo performance trace's firefox-planet case. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 0e2af4d0c942405dd0869f1e6a1effee943de139 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jun 1 18:14:01 2011 +0800 glamor: Don't print those fallback messages by default. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit 925fc9724ff72d9e2a4940d7a1e39c23fb3ec9f0 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jun 1 18:02:03 2011 +0800 glamor: Optimize glamor_finish_access. use pbo if possible when we load texture to a temporary tex. And for the previous direct texture load function, it's not correct and get removed in this commit. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> commit b8ce483f58112f200dec9853fcd7ff455479990f Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Jun 1 17:54:01 2011 +0800 glamor: Don't use glamor_pixmap_type currently. Added comments to glamor_pixmap_create. To be refined in the future. We need to identify whether a pixmap is a CPU memory pixmap or a GPU pixmap. Current implementation is not correct. There are three cases: 1. Too large pixmap, we direct it to CPU memory pixmap. 2. w ==0 || h == 0 pixmap, this case has two possibilities: 2.1 It will become a screen pixmap latter, then it should be GPU type. 2.2 It's a scratch pixmap or created from a share memory, then it should belong to CPU memory. XXX, need to be refined latter. commit 28835be1b8a05e510aa7fcc2f331771e3cf7dfec Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Tue May 24 22:01:49 2011 +0800 glamor: improve glamor_finish_access. When the platform's coordinate system is the same as X11's . We can load the texture to the fbo directly without one extra texture transformation. commit 1edf0cc6ab340c98fde201328631ca61e9d871a1 Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sun May 22 23:45:51 2011 +0800 glamor: Don't write back read only pixmap to fbo. For those pixmap which has valid fbo and opened as GLAMOR_ACCESS_RO mode, we don't need to upload the texture back when calling the glamor_finish_access(). This will get about 10% performance gain. commit 1495ba9e64633476508febb01ec2e9594a7b466b Author: Zhigang Gong <zhigang.gong@gmail.com> Date: Sun May 22 17:51:27 2011 +0800 glamor: Use buffer object as much as possible. Change the row length of 1bit color depth pixmap to the actual stride. The previous implementation use the width as its stride which is not good. As it will waste 8 times of space and also bring some non-unify code path. With this commit, we can merge those 1bit or other color depth to almost one code path. And we will use pixel buffer object as much as possible due to performance issue. By default, some mesa hardware driver will fallback to software rasterization when use glReadPixels on a non-buffer-object frame buffer. This change will get about 4x times performance improvemention when we use y-inverted glamor or the driver support hardware y-flipped blitting. commit 529c38a4601e8f0712773bf29a48cddfa7a5edc4 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 19 18:03:12 2011 +0800 glamor-ddx: Remove debug message when moving cursor. commit cd43b1ea831eac11bc6ad0c3b1e040bb968b9861 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 19 18:02:19 2011 +0800 glamor: Add fallback code path for glamor_fill. commit 8593f22fb8fc5e0d0f406d9c94cca22347505fd6 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 19 17:59:19 2011 +0800 glamor: glamor_set_alu should enable GL_COLOR_LOGIC_OP. GL_COLOR_OP seems not supported in current MESA. commit f871d174a861e7c3d2b8f4d9a3f10c38a5120606 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 19 11:40:38 2011 +0800 glamor: Switch to software fb for too large pixmap. If pixmap's size exceeds the limitation of the MESA library, the rendering will fail. So we switch to software fb if it is the case. Add one new element for pixmap private structure to indicate whehter we are a software fb type or a opengl type. commit 74ca45e7d0ed6654204189793261ef65f213bb2e Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed May 18 16:48:06 2011 +0800 glamor-ddx: Fixed one bug when a client reset the connection. This commit fixed two bugs when one client reset the connection. The first is that we should reopen the graphic device when the previous node was closed during the screen closing. The second one is we should call glamor_close_screen (not the ddx version) prior to call eglTerminate(). As eglTerminate will release the share library. And the glamor_close_screen may still need to call openGL APIs and thus will hit segfault. And renamed the ddx functions to avoid naming conflications with the glamor functions. commit c97d4533f29e77d80c076deff9ad0f218eb2e8f4 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 12 14:49:08 2011 +0800 glamor: Silent compilation warnings due to some deprecated APIs. those xcalloc/xfree/xalloc/XNFprintf/... are deprecated. Replace then with the new one. And fix some other minor problems. commit e3295d4106ac5b62f63e32dcb24a6094194cb1a8 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 12 10:22:07 2011 +0800 glamor-ddx: Move the cursor EGL image to crtc strcture. Cursor is a per crtc resource. And this commit also fix the cursor initialization regard to the latest mesa EGL code. Now hardware cursor works fine. commit 43280372686177603111b175e92e1c88ad4ccdee Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 12 01:42:05 2011 +0800 glamor-ddx: Fix a compiling error. Need revisit. GC is redefined in the X11/Xlib.h and include/gcstruct.h which is a xorg header file. Just use a macro to simply avoid the conflict. Need revisit latter to find a correct way to fix this problem. commit 18a52e23882e4664fdb2de4958c4f9c97e16068c Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 12 01:37:52 2011 +0800 glamor-ddx: Migrate the code to latest mesa library. Use eglCreateDRMImageMESA to create surfaceless image. And then export the drm buffer back which can be used to create the frame buffer. commit eb3487a448ff0efa46079323821d65d7c3e4d872 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Thu May 12 01:08:38 2011 +0800 glamor: Add new feature which is to flip output on y axis. Due to the coordinate system on EGL is different from FBO object. To support EGL surface well, we add this new feature. When calling glamor_init from EGL ddx driver, it should use the new flag GLAMOR_INVERTED_Y_AXIS. commit 6dae8dc7ea6e7add3c6fda30773f264904ef8df5 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed May 11 15:57:05 2011 +0800 glamor: Add glamor-ddx driver to the build tree. Correct the linking parameters and add dependency to the libglamor.a. commit 26ff612171d53baef08078a852875d5ddf1804ed Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed May 11 15:54:50 2011 +0800 glamor: Resolved merge conflictions with Kristian's glamor-ddx patch. commit 49bf0e301e7317a02e8b34ec2e290fcfda520e7e Author: Kristian Høgsberg <krh@bitplanet.net> Date: Fri Mar 5 14:53:35 2010 -0500 glamor ddx driver using EGL on KMS commit 47b6531273e3052b653194099a49ca11d80b12df Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Wed Apr 13 15:50:26 2011 +0800 glamor: Fixed one segfault bug when close screen. move the original glamor_fini to glamor_close_screen. And wrap the CloseScreen with glamor_close_screen, Then we can do some thing before call the underlying CloseScreen(). The root cause is that glamor_fini will be called after the ->CloseScreen(). This may trigger a segmentation fault at glamor_unrealize_glyph_caches() at calling into FreePicture(). commit 0d9e8db8d031d22b02df2c9b226287b1ca489f5a Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Apr 8 15:30:45 2011 +0800 glamor: Fixed one linking error. As current glamor implementation depends on the glx library in the mesa package which is conflict with the version in xorg. We have to --disable-glx when build Xephyr. But this leads to the linking error here. We comment out the calling to ephyrHijackGLXExtension() now. Need revisit latter. commit b3577a1c853d870f4d583a35d27012acb9099ef4 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Apr 8 15:24:55 2011 +0800 glamor: Merged with latest xserver. Merged with latest xserver, the major change is due to the API change of the management of devPrivates. commit 3105fe9f6491f37a1f82a9e6f03f4efaed6c7e92 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Apr 8 15:22:52 2011 +0800 glamor: Call glamor_composite_rects only when enable RENDER. commit f9843c7a35975b178eec9812d21e1f02a2120928 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Apr 8 14:53:15 2011 +0800 glamor: Fixed one conflict data type(XID) bug. We should include the dix-config.h for all the glamor files. Otherwise the XID type maybe inconsisitent in different files in 64bit machine. The root cause is this macro "#define _XSERVER64 1" should be included in all files refer to the data type "XID" which is originally defined in X.h. If _XSERVER64 is defined as 1, then XID is defined as CARD32 which is a 32bit integer. If _XSERVER64 is not defined as 1 then XID is "unsigned long". In a 32bit machine, "unsigned long" should be identical to CARD32. But in a 64bit machine, they are different. commit e194740c9413bbfefee6506a734e0c82c091dfa3 Author: Zhigang Gong <zhigang.gong@linux.intel.com> Date: Fri Apr 8 14:49:57 2011 +0800 glamor: Fixed some compiling and linking errors. Change the inline functions to static type, otherwise when linking it complains multiple definitions of those functions. commit 8cfcc614032320bb6a2eca2c61baeebf388d22ea Author: Eric Anholt <eric@anholt.net> Date: Fri Feb 19 07:14:13 2010 -0800 glamor: Add support for using EXT_framebuffer_blit to do CopyArea. commit d2da9d1c22d25d1f86ecd83c15ca9909fab8610a Author: Eric Anholt <eric@anholt.net> Date: Fri Feb 19 07:36:28 2010 -0800 glamor: Reduce the noise from wide lines "fallback". commit 955ccfbc34f370c80f7189ac5b0240e859e00b5f Author: Eric Anholt <eric@anholt.net> Date: Fri Feb 19 07:52:50 2010 -0800 glamor: Fix the segfault at screen fini. commit 003dee4c82f8af9e7749876c736018410f347440 Author: Eric Anholt <eric@anholt.net> Date: Fri Feb 19 06:10:11 2010 -0800 glamor: Replace the immediate mode in glamor_fill() with glDrawArrays(). commit 60775e21e3532452891e1b52589f7d5d7ef04b40 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 18 18:11:54 2010 -0800 glamor: Use a VBO to accumulate multiple glyph quads at once. This increases us from 23000 to 27000/sec on rgb24text. commit 8ce312e61952e9f2193c28ac6124eff30f3a122c Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 18 14:49:06 2010 -0800 glamor: Use glamor_composite_with_shader once per group of glyphs. This shaves CPU time in GL setup. Performance of rgb24text went from 18400/sec to 23500/sec. commit 6ce05e0b28052e5206694228218322f0dd3a6b00 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 18 14:44:20 2010 -0800 glamor: Convert the shaders path to handling glamor_composite_rect_t. commit 858ce0c1928c199435c9c2627f84c37c7ca7a38a Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 18 14:02:48 2010 -0800 glamor: Add support for component alpha rendering. Brings x11perf -rgb24text from 230/sec to 18400/sec commit d07fc66a056dd4eab2dac82b3784c482071d1915 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 18 09:23:22 2010 -0800 glamor: Rework shader setup to make extending the IN types easier. commit 8cefa287ddb4ed4ad178e751b35bb93b4a44e0ab Author: Eric Anholt <eric@anholt.net> Date: Wed Feb 17 16:00:22 2010 -0800 glamor: Add a little mechanism for only printing fallbacks when they happen. Sometimes we want to try a couple of different methods for accelerating. If one of them says "no" and the other says "yes", don't spam the log about the "no." commit 5f5c35b56d3568f72e2305e74ed8457e0a787a3b Author: Eric Anholt <eric@anholt.net> Date: Wed Feb 17 15:02:17 2010 -0800 glamor: Fix up the fallback message for no texture present on compositing. commit 2fa95725d845e5bf8a41ac776267be0d55d58004 Author: Eric Anholt <eric@anholt.net> Date: Wed Feb 17 13:33:48 2010 -0800 glamor: Add support for a1 composite sources. They're stored just like a8, but the values are set to either 0.0 or 1.0. Because they're a8 with only two legal values, we can't use them as destinations, but nobody's rendering to a1 dests anyway (we hope). commit 9bcbcbf8c28e945fa5c4f4ad1a772b787618455f Author: Eric Anholt <eric@anholt.net> Date: Wed Feb 17 13:30:20 2010 -0800 glamor: Fix and enable ZPixmap PutImage acceleration. commit 2ba634fab9b03995629497efdbf5305394011e4a Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 17:32:27 2010 -0800 glamor: Fix render source transforms. Fixes (except for small bit differences) cairo source-pattern. commit b1f67a5082420bbff141733833905f8ac95fe983 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 17:15:05 2010 -0800 glamor: Fix and enable glamor_get_spans(). This makes running the cairo test suite almost tolerable. commit f88d76cf7e05cf885d80c0b91f37f1b30675e928 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 16:51:13 2010 -0800 glamor: Enable glamor_fill_spans(). x11perf -wline100 performance goes from 8.8/sec to 111/sec. commit a63df0c504be3be0e969f5080a6593a55cb87246 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 15:00:32 2010 -0800 glamor: Fix up the wide/non-solid lines fallback. commit d61a13cf3f0a3028fbcf41310a4f5ecaa8546961 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 14:52:04 2010 -0800 glamor: Fix and enable tile fill acceleration (aka the root weave). commit 86a206525350b7e82ab0e432ad0fb8858960857d Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 13:40:28 2010 -0800 glamor: Fix off-by-one in CopyPixels CopyArea path. Fixes window dragging in uncomposited metacity. commit be82a0624207b5f367b97c25ac7d7dbd8a518597 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 13:21:47 2010 -0800 glamor: Fix screen_x/screen_y handling for compositing. It's not an offset from pixmap coords to composited pixmap coords, it's an offset from screen-relative window drawable coords to composited pixmap coords. commit 5360b1e8bbae571b120999e7eec7cd2826601497 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 09:47:38 2010 -0800 glamor: Implement glCopyPixels based src == dest CopyArea acceleration commit 0565c1d789ed82c533f860713d66b4941c299f9c Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 9 22:35:04 2010 -0800 glamor: Add support for accel of x8r8g8b8 source pictures. There's a limitation still for RepeatNone, but this fixes a bunch of fallbacks for gnome-terminal. commit e6bf50573650f03c8130b7783485b24e98e15c79 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 09:23:09 2010 -0800 glamor: Set active texture on glamor_copy_n_to_n setup. Fixes failure in rendercheck -t blend -o src commit be64167fea3c74447ed3c5116b97473676c25b29 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 11 09:20:50 2010 -0800 glamor: Don't try to CopyArea from a Solid source picture. Fixes failure with rendercheck. commit 126fc09cb5bf8c38b73f1c2cd2a0ef588c3265e8 Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 9 22:35:04 2010 -0800 glamor: Rework the Render shader setup to be easily modified, like cairo-gl. commit f4a3194837e640997c0c3a775f48a49800e213c6 Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 9 23:17:09 2010 -0600 glamor: Add the glyph cache from UXA (de-camelCased). This doesn't yet have an optimized glamor_composite_rects() implementation, but it does triple the speed of x11perf -aa10text. commit 7e6432e7b94f7f99b257da8de53573108d30ae22 Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 9 22:54:40 2010 -0600 glamor: Fix up and enable accelerated composite. commit a0b589e90a885cf20b349b95df31bb0823a1514b Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 9 22:49:27 2010 -0600 glamor: Restore planemask to all-on when finishing a fill. commit d8c2662bf452a82c8fcbdd1c95a40ee34d2c32ca Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 9 22:48:28 2010 -0600 glamor: Set active texture in finishaccess drawing. commit 4f398b29dd42260d2c02e8e795546fd0623397b1 Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 9 21:56:39 2010 -0600 glamor: Align stride of fallback pixmap data to 32 bits. fb/pixman demand this alignment, and all sorts of things go badly otherwise. Fixes piglit x11-8bpp-7x8-draw. commit 15e58b5ffb427c6c6f5172ccd72758047b98024a Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 22:05:51 2010 +0100 glamor: Split the copy path out into its own function. commit ad67299fa2afc8b42432d71d14163a36e013fef7 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 21:52:35 2010 +0100 glamor: Provide more information about the operands to fallback composites. commit 4811e428a9206ef59487fb0d3fab160a19845d46 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 21:46:49 2010 +0100 glamor: Pull in UXA code for dumping some composites down to copy_n_to_n. Window dragging with metacity+gnome-terminal+xcompmgr is almost credible. commit 35847c578e9c35a3c90da792c34c1cb0cc536261 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 21:24:15 2010 +0100 glamor: Add acceleration for copyarea not from the screen. commit 647b9fb49a5bb636c9b0da6b708083328238543a Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 20:12:44 2010 +0100 glamor: Add CopyWindow implementation so it doesn't crash. commit 95d4a5a6ab58625d8205461157263bfb635ccd1a Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 19:38:00 2010 +0100 glamor: Enable fill acceleration and flip opposite for pixmaps too. Here's my theory for the flipping: It doesn't really matter which orientation we store the pixmaps if we don't scan them out. We have to flip coordinates for the window system framebuffer. Doing so for everything else makes things consistent. I'm not sure how this will interact with future GLX integration, though. commit 5332547a0ac6ae6b9f1a6c6428e6fdbdf303108f Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 17:14:34 2010 +0100 glamor: Fix prepare_access on 1bpp data. Apparently I don't have anything hitting this path, so I'm not sure if it's good or not. commit c3c3a6349766b4fdee080ff203fb548725e42e50 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 15:34:45 2010 +0100 glamor: Use the pixmap stride in fallbacks instead of trying to guess it. Mostly fixes gnome-terminal text. commit 45de3d24b44aa3feabdda0e377d637f498e03eb0 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 14:40:06 2010 +0100 glamor: Replace the glDrawPixels in glamor_finish_access with GLSL. Root weave displays. \o/ commit d8d3fa10346302384b8e62967c5a67893ed1c67b Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 14:53:41 2010 +0100 glamor: All the fallbacks in the world. Bringup is really not flying when I can't see anything. So dump back to all software so I can turn on a bit at a time. commit 745502af962a2bb475c0c667c3091c2c080771dc Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 13:27:47 2010 +0100 glamor: Add check for EXT_bgra which we rely on. commit 6ce378f11ff396f350cbaa280086f6f9600da29e Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 13:15:38 2010 +0100 glamor: Add fallback support for glamor_get_spans(). commit ec526eab8f02e0bcce859a1b7ebaf6c5bccc5e87 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 13:05:13 2010 +0100 ephyr: Hook the glamor into damage and draw into the backbuffer. This should avoid a bunch of absurdity with GLX front buffer handling, fix exposes, and improve performance. For now we're copying the whole buffer while glamor is developed. commit b5087ff9b1e5495c742e581f586c055de878dd4b Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 12:47:59 2010 +0100 glamor: Fix the row length of 1bpp prepare_access. commit e93070affdf64c47be02684e7902a61e7ae9fa33 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 12:44:03 2010 +0100 glamor: Fix up the access flags for glamor_prepare_access(). commit 0e56c182c3b06f5b02d357e2b8e930a580bd0274 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 12:16:30 2010 +0100 glamor: Add fallback support to glamor_put_image(). commit 22cad98975091ed724a37ec940946cd2899ebcbf Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 12:13:15 2010 +0100 glamor: Add fallback support to glamor_set_spans(). commit 55dac9b42e18dcc1586770d31ee265178e68b744 Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 12:09:52 2010 +0100 glamor: Add glamor_prepare_access_gc() from UXA. commit 72a757ba00232fe8b42b977f5210fa119495b05e Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 11:58:52 2010 +0100 glamor: Use GL_MESA_pack_invert to avoid complexity in prepare_access. commit e9d4794cd0bc6c8790204405fe09f968edfa409d Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 11:23:14 2010 +0100 glamor: Add fallbacks for Render. commit de675893b7ce2880289cce13be6190d55f4fc29c Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 10:16:21 2010 +0100 glamor: Add fallbacks for glamor_copy_area(). commit ca58607a44c310ef369a097a06be83aa2a9e1c5b Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 8 09:58:55 2010 +0100 glamor: Move glamor_poly_lines to a separate file. commit 800fd4f8494ad6f0984073406b3dec584ba63648 Author: Eric Anholt <eric@anholt.net> Date: Tue Sep 22 15:41:18 2009 -0700 glamor: Fix the type for copyarea. commit c4343dfa0a2b40d46d3feb14f1df9fae0fd4a214 Author: Eric Anholt <eric@anholt.net> Date: Tue Sep 22 12:08:19 2009 -0700 glamor: Add prepare/finishaccess code based on UXA. commit f17473cdd5f93a2bf3a7b6a14bd5acd965e8e9f0 Author: Eric Anholt <eric@anholt.net> Date: Tue Sep 22 10:55:04 2009 -0700 glamor: Fix pixmap private getter in copyarea. commit 5915b4c0cfcfb25a68b77b29a4d7b39b7f6b4822 Author: Eric Anholt <eric@anholt.net> Date: Fri Sep 4 18:43:52 2009 -0700 glamor: Add support for solid source pictures. commit 1159ebb30b7530c2f4612109306cf85a594dd530 Author: Eric Anholt <eric@anholt.net> Date: Fri Sep 4 18:43:02 2009 -0700 glamor: Add untested copyarea implementation commit 936385142c12d074dcb603490517ac095840fa3f Author: Eric Anholt <eric@anholt.net> Date: Tue Aug 25 17:24:30 2009 -0700 glamor: Accelerate PolyFillRect using glamor_fill instead of spans. commit 6dacc9b08c2af51c1826c20ccf12bb2c73856f25 Author: Eric Anholt <eric@anholt.net> Date: Tue Aug 25 17:01:43 2009 -0700 glamor: Add untested PutImage 1bpp XYPixmap support. commit 854e9bd20a2d0f8ed636d4fba0ddfa4c71d54667 Author: Eric Anholt <eric@anholt.net> Date: Tue Aug 25 16:56:50 2009 -0700 glamor: Add untested PutImage XYBitmap support. commit 8a53566acb5870816807425dc805df888fa42792 Author: Eric Anholt <eric@anholt.net> Date: Tue Aug 25 13:06:11 2009 -0700 glamor: make the polylines complaint a little more useful. commit aa133069745fc59bb2f212b0816add9bae40c376 Author: Eric Anholt <eric@anholt.net> Date: Tue Aug 25 12:10:32 2009 -0700 glamor: Start adding render acceleration support. This brings in idr's glu3 code. We'll probably want to move to linking to it as a library, once an ABI-stable release is out. commit 4a51cc0440c8d026fd8c82b40cfb188c6ea4a9f0 Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 09:14:20 2009 -0700 glamor: Add clipping to setspans. commit 5fadea5d9c02670c35ddf3e0f12f9d355b412103 Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 09:10:14 2009 -0700 glamor: Fix some screen_xy offsets to be the right way around. commit 44e4599b83cc330a7c9edd7e18266f222a69418a Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 08:59:52 2009 -0700 glamor: Move planemask to a function in case I decide to fill it in. commit 882411bef1091f97f61ae27a549970d87eef9cab Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 08:29:30 2009 -0700 glamor: add alu support to setspans. commit c70ce72fd74354a0b9731dc8d4451f6aaf951117 Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 08:24:54 2009 -0700 glamor: Give setspans the same format support as getspans. commit d9eef95c74b7b04a3398b4cfc1a81b480838b25e Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 08:17:06 2009 -0700 glamor: Fix bad fallthrough in getspans (accessing invalid memory). commit 0360ba361a67f6cfa5c9c65590ed8440a153c16e Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 08:06:57 2009 -0700 glamor: Fix memory leak in getspans. commit cdb1fe6d9682616b1def52fa38b2dae623e2503f Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 08:03:17 2009 -0700 glamor: Move setspans to a separate file. commit cfb8dea815086b9aafd27bd314e02739e04dfc7d Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 07:22:14 2009 -0700 glamor: Hook up miGetImage to fix some invalid accesses. commit e3c02c09c125bb5def1a70a1264ef34b18182afa Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 24 07:00:32 2009 -0700 glamor: Add ALU support to solid, tile, and putimage. commit 2b657d91d80a0a4d9fa2e390255ff87f51426b7c Author: Eric Anholt <eric@anholt.net> Date: Sat Aug 22 15:54:24 2009 -0700 glamor: Add untested putimage support. commit f66e5c4145d003247447ac1bf93f9737c6eaa27c Author: Eric Anholt <eric@anholt.net> Date: Fri Aug 21 10:05:32 2009 -0700 glamor: Add 8bpp to get/setspans. commit 93ad09144213fe6b9ce8bea7ebfcc2d60887810b Author: Eric Anholt <eric@anholt.net> Date: Fri Aug 21 10:02:02 2009 -0700 glamor: Add trapezoids code. This fixes segfaults on starting gnome-terminal. commit 60ca0260f23cac6577aa85aacb0e5644d5f1b349 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 17:17:43 2009 -0700 glamor: Add more solid_fail_regions for software fallbacks. commit 7500ee2b0215932ecb6688f301fb4e6f080f8a66 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 17:05:00 2009 -0700 glamor: Fill in 1 and 24-bit getspans. commit f6cffbb2ba66948ad5cc1cbe20e12de204de175d Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 16:43:22 2009 -0700 glamor: Add stub Composite support. commit 2fa26c4958168064da95361db78ccc518c8f3ed8 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 16:43:03 2009 -0700 glamor: Free resources when destroying pixmaps. commit 16c3b929dd4cae6b40e847256db6ff32e63e9029 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 16:06:42 2009 -0700 glamor: Add untested support for tile filling. commit 8016135ec7616530e64d0019ce0401e62b25e483 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 15:37:22 2009 -0700 glamor: Fill out glamor_get_color_4f_from_pixel() a bit. commit 519103565c1b182014dea93c58917bf7e5a35fcb Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 15:28:13 2009 -0700 glamor: Create FBOs for pixmaps. commit f92d1478e984d57806731886820f47e1258b5115 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 14:45:47 2009 -0700 glamor: Maybe fix up the format/type for setspans. commit 4f139db92fb283792adae8d39a49a083e4382fb5 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 14:43:43 2009 -0700 glamor: Add getspans implementation. commit f1dbed5456e5a608425530e0dde2dc617a7c6115 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 12:32:53 2009 -0700 glamor: Move to using shader objects. commit fbbdd788cbc822fc8a2d2726435bfa39e69a0e85 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 12:36:33 2009 -0700 glamor: Fix up DrawPixels arguments to bear some relation to reality. commit 74f262bcdb3d8ae769ef8975cf4a4b2ebaeb6b39 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 11:39:05 2009 -0700 glamor: remove gratuitous flush. commit 399e00698976dd2e503b3a092bfe54ab24ea26d9 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 11:37:37 2009 -0700 glamor: Fix up block/wakeup handler. Prototypes are fixed, and we don't need to flush on wakeup. commit 2e35ceca65bbebf07c15ea2cff932a8749955c2b Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 11:19:43 2009 -0700 ephyr: Use GLEW. This will hide all sorts of extension stuff from us. commit 370df817ac0b346f1c7aa0b6e823c77797caaa9f Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 09:35:24 2009 -0700 ephyr: Make sure a glamor-using window is created with a glx visual. commit 08097434ecc6479dc69a408523f398284168697e Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 09:10:12 2009 -0700 add fill files, merge with first real attempt at rendering. commit e32efb02e5dff9124e8680f9a15d9d2b01db84c7 Author: Eric Anholt <eric@anholt.net> Date: Sat Dec 20 14:48:18 2008 -0800 ephyr: merge the host glamor bits into hostx. commit df083fab84cf57fc1a2e3cd98572039bc9fe20de Author: Eric Anholt <eric@anholt.net> Date: Sat Dec 20 13:43:52 2008 -0800 glamor: first real attempt at rendering. commit 1b151f2e6aa581400b09220b87ae2d34a39aeb17 Author: Eric Anholt <eric@anholt.net> Date: Sat Dec 20 13:48:39 2008 -0800 glamor: glFlush from the blockhandler so rendering happens. commit b530cdea4a8e05b1f487765b8dde42cde1a6fc98 Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 16 15:20:49 2008 -0800 glamor: Use a nicer struct initializer for gcops. commit 4d52ae7f2dca78d493e11375d764c978db5567ed Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 16 15:14:31 2008 -0800 glamor: Start trying to hook up the rendering bits commit 41e3e580de95fca3095d015ec8febe1a5f47cca3 Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 20 10:49:41 2009 -0700 glamor: Use -lgl for Xephyr if GLX is unset. I'm experimenting with that because of conflicts with GL dispatch tables. commit 8885b3b1ffb45ae16484151ce533683af526f509 Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 16 15:08:21 2008 -0800 Add exa/glamor to _DEPENDENCIES so the bin gets rebuilt with the libs. commit da6e0ffad2173d65f27feff36291f94e6aa06f88 Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 16 14:00:05 2008 -0800 More ephyr/glamor glue. commit 0ec823ce5b72bcf3be3923f2f23e5386feb0107b Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 16 12:30:14 2008 -0800 Add build infrastructure for glamor. commit 84bb0207f6db433a8d387d933393357da87ca23e Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Sep 23 20:03:03 2011 -0400 dix and os: gitignore dix.O and os.O Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 3d41939d0349569dcfd2aef9b846c739d0ba0060 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Sep 22 17:41:38 2011 -0700 Unconditionally #include <stdint.h> The more recent inclusions of this file haven't been checking for HAVE_STDINT_H, so might as well make the older ones consistent. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 46d5ae5b551cc926331324073f2686b47e8aea07 Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Sep 23 09:38:25 2011 -0400 dtrace: fix typo in title The word provider should be capitalized. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 6cae6224994e3252b3b7c7608f983ce73e0206fc Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Sep 23 09:38:24 2011 -0400 dtrace: use docbook copyright markup for copyright holder No content change to copyright text. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 58d3d46d6cc0d7a81db6bad61d158f3b9af8af71 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Sep 1 16:48:37 2011 -0700 Assign ids to more tags in Xserver-Dtrace.xml Keeps xsltproc from adding random-number id tags to html output so that it's easier to see real changes vs. different random numbers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Dew <marcoz@osource.org> commit 7fb4bef0394a5d09680985d34bce8252b61493cb Merge: 98f4940 c90903b Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 21 14:34:27 2011 -0700 Merge remote-tracking branch 'mattst88/for-keith' commit 98f4940093dc90c3366d3e4d3ddceacbaee299dc Merge: b018b81 c8eacae Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 21 14:30:19 2011 -0700 Merge remote-tracking branch 'alanc/master' commit b018b815333b256b5e06dd6251b2e539f09f89fa Merge: 03d0329 0f380a5 Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 21 14:17:14 2011 -0700 Merge remote-tracking branch 'jamey/reviewed' commit c90903b4f7a826ae6826a8dd0a901c8362500e46 Author: Peter Harris <pharris@opentext.com> Date: Fri Sep 2 18:45:16 2011 -0400 xkb: add missing swaps for xkbGetDeviceInfoReply Caught during review of e095369bf. Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit d206d52f657cb63a0f6ba8b62d788c1812b57c81 Author: Matt Turner <mattst88@gmail.com> Date: Tue Aug 16 19:19:24 2011 -0400 Use __builtin_constant_p to determine if we can use lswapl If the address of the swapped memory location is known at compile time, we can check its alignment at no runtime cost and use lswapl instead. text data bss dec hex filename before: 1872820 52136 78040 2002996 1e9034 hw/xfree86/Xorg after: 1864396 52136 78040 1994572 1e6f4c hw/xfree86/Xorg bswap instructions: 131 -> 308 (used in lswapl) rol instructions: 943 -> 1174 (used in lswaps) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 889b700e7760ced38bcf5f3aff2d31d3d9a058d7 Author: Matt Turner <mattst88@gmail.com> Date: Tue Aug 16 19:12:21 2011 -0400 Use lswap{l,s} in cpswap{l,s} Should be safe since cpswap isn't used on pointers. text data bss dec hex filename before: 1875588 52136 78040 2005764 1e9b04 hw/xfree86/Xorg after: 1872820 52136 78040 2002996 1e9034 hw/xfree86/Xorg bswap instructions: 5 -> 131 (used in lswapl) rol instructions: 811 -> 943 (used in lswaps) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit a2f0ff5f73db204a9d61e65148b28f6acc5121df Author: Matt Turner <mattst88@gmail.com> Date: Tue Aug 16 19:30:20 2011 -0400 Make lswap{l,s} inline functions text data bss dec hex filename before: 1875668 52136 78040 2005844 1e9b54 hw/xfree86/Xorg after: 1875588 52136 78040 2005764 1e9b04 hw/xfree86/Xorg Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit e8ff555b95baab66cc7d060c1e7f9fdd49d3802f Author: Matt Turner <mattst88@gmail.com> Date: Tue Aug 16 19:07:24 2011 -0400 Add type checking to swap macros The original macros are retained (instead of replacing them with inline functions) because of implicit type promotion. That is, an int16 passed to an inline function taking int32 would be implicitly promoted to int32 without a warning. Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 893e86a49e3e381cff48a9e86dc2d9b3d5431d95 Author: Matt Turner <mattst88@gmail.com> Date: Tue Aug 16 19:03:26 2011 -0400 Introduce swap_uint{16,32} functions, used in swap{l,s} Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 54770c980cd2b91a8377f975a58ed69def5cfa42 Author: Matt Turner <mattst88@gmail.com> Date: Tue Aug 16 16:59:07 2011 -0400 Cast char* buffers to swap functions Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 9edcae78c46286baff42e74bfe26f6ae4d00fe01 Author: Matt Turner <mattst88@gmail.com> Date: Wed Sep 21 17:14:16 2011 -0400 Use correct swap{l,s} (or none at all for CARD8) Swapping the wrong size was never caught because swap{l,s} are macros. It's clear in the case of Xext/xres.c, that the author believed client_major/minor to be CARD16 from looking at the code in the first hunk. v2: dmx.c fixes from Keith. Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 03d032991da21bf866ca30dcbb6b7f9f99df441a Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Sep 14 15:25:06 2011 -0700 fb: Rename wfbTriangles and wfbTrapezoids These symbols were not renamed when they were added to libfb: # nm -D libwfb.so | grep ' fb' 0000000000028d00 T fbTrapezoids 0000000000028d60 T fbTriangles This causes corruption and/or crashes on wfb-ful drivers like nvidia: Program received signal SIGABRT, Aborted. 0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. in ../nptl/sysdeps/unix/sysv/linux/raise.c (gdb) bt #0 0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x00007fd67f3a3680 in *__GI_abort () at abort.c:92 #2 0x00007fd67f3995b1 in *__GI___assert_fail (assertion=0x7fd679ecb804 "key->initialized", file=<optimized out>, line=116, function=0x7fd679ecbbc0 "dixGetPrivateAddr") at assert.c:81 #3 0x00007fd679ec55b6 in ?? () from /usr/lib/xorg/modules/libfb.so #4 0x00007fd679eca9ef in ?? () from /usr/lib/xorg/modules/libfb.so #5 0x00007fd679ecae20 in fbTriangles () from /usr/lib/xorg/modules/libfb.so #6 0x00007fd67a58fc55 in ?? () from /usr/lib/xorg/modules/drivers/nvidia_drv.so #7 0x00000000004f38d1 in ?? () #8 0x0000000000437ae9 in ?? () #9 0x0000000000426eaa in ?? () #10 0x00007fd67f38cead in __libc_start_main (main=<optimized out>, argc=<optimized out>, ubp_av=<optimized out>, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff99860d78) at libc-start.c:228 #11 0x000000000042719d in _start () Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 Author: Matt Turner <mattst88@gmail.com> Date: Thu Aug 4 15:35:41 2011 -0400 Use internal temp variable for swap macros Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit c10bad3d3e8ff1b90014770fd470f9c67263e46f Author: Matt Turner <mattst88@gmail.com> Date: Wed Apr 27 19:29:06 2011 -0400 Silence printf format warnings in helper_exec.c Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 9eab5b3443a1926a29385948acc6c5e0843465ea Author: Matt Turner <mattst88@gmail.com> Date: Wed Apr 27 18:25:27 2011 -0400 Replace Fabs() macro with fabs() function gcc generates better code with fabs() anyway. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 40a47bd628f525d2d8bd3ca76554089a6e9d2a1d Author: Matt Turner <mattst88@gmail.com> Date: Wed Apr 27 14:19:41 2011 -0400 Remove unnecessary #undefs of [f]abs and old comments Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 079a7585e44d25a0a9fb6662c6382dfbe8f6cd3c Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Sep 15 20:12:41 2011 -0400 devbook.am: maintenance update from docbook.am The developer docs are generated from a subset of docbook.am which is sometimes updated. The one difference for xserver is the embedded css style in the HEAD element. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 82c55b5a99a1bacf2bc11bbd9d58f6f2c6c07286 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Sep 15 20:12:40 2011 -0400 docbook.am: embed css styles inside the HTML HEAD element Rather than referring to the external xorg.css stylesheet, embed the content of the file in the html output produced. This is accomplished by using version 1.10 of xorg-xhtml.xsl. This makes the whole html docs tree much more relocatable. In addition, it eliminates xorg.css as a runtime file which makes xorg-sgml-doctools a build time only package. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1602444e05cc59afe32c085c0cedb85e3268cd98 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Sep 15 20:12:39 2011 -0400 docbook.am: global maintenance update - entities, images and olinking Adding support in libX11 for html chunking caused a reorg of docbook.am as well as the xorg-sgml-doctools masterdb for olinking. The parameter img.src.path is added for pdf images. A searchpath to the root builddir is added for local entities, if present. This feature was initiated by xserver module and made available to all. The docbook.am makefile hides all the details and is identical for all 22 modules having DocBook documentation. It is included by a thin Makefile.am which requires no docbook knowledge. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 871d65790ec2ac0fd6d5105c2d599f63a86fcaf1 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Nov 1 16:02:11 2010 +0200 DRI2: Allow DDX to validate swap_limit changes DDX can now implement validation for swap_limit changes to prevent configurations that are not support in driver. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> CC: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit b435e2aac1b3fbb97d0275de73a1e36d16f170c0 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Nov 1 16:22:00 2010 +0200 DRI2: Expose API to set drawable swap limit. This allows ddx to set swap_limit if there is more than one back buffer for drawable. Setting swap_limit has to also check if change affects a client that is blocked. This can be used to implement N-buffering in driver with minimal logic in allocation and selecting next back. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Keith Packard <keithp@keithp.com> commit 86f8da0aa7612558e6563f5de0d9f9793854053f Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Nov 1 16:21:59 2010 +0200 DRI2: Add ReuseBufferNotify hook ReuseBufferNotify hook is called whenever old buffer is reused in DRI2 code. Driver can use this hook to rewrite the buffer name if hardware requires shared buffers. Shared buffer might be some hardware limited resources like framebuffer that is preallocated in boot. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2f47433fef2cf63063e069ead9003891d135e87f Author: vdb@picaros.org <vdb@picaros.org> Date: Wed Sep 7 17:47:56 2011 +0200 print DisplayMode type bits Dear, A patch I posted on xorg-devel was reviewed and is ready for inclusion in xserver. Would you be willing to apply the patch so that it finds its way into the master branch ? Thank you, Servaas Vandenberghe. http://lists.x.org/archives/xorg-devel/2011-August/024769.html http://lists.x.org/archives/xorg-devel/2011-August/024777.html This patch adds printing of the DisplayMode type bits to xf86PrintModeline(). It helps to trace the modeline origin and to understand the initial configured modeline. Reviewed-by: Alex Deucher <alexander.deucher at amd.com> Signed-off-by: Servaas Vandenberghe Signed-off-by: Keith Packard <keithp@keithp.com> commit c92c83523ede8bc361526ac93d09d089fbbdae08 Merge: 4ad271d 24b2b43 Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 21 13:32:06 2011 -0700 Merge remote-tracking branch 'kibi/master' commit 4ad271d06c5aa42721c0e2e01e17e34a39825c65 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Aug 29 20:44:18 2011 -0700 xfree86: Bump extension ABI version to 6.0 The video driver ABI was bumped to 11.0 in commit 0de7cec90738a7a5020150309866bb0e23b6f479 because of a change to the size of ATOM in commit 51f353d0a0d116af16d7d9590cadef6c56328746. This also affects extension modules, so the extension ABI version should have been bumped too. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit c8eacae4f833a0bd81907ba2b4cfaa80c08e037f Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Aug 25 21:46:16 2011 -0700 Space & style cleanup of hw/xfree86/i2c/fi1236.c Fortunately, the massive decrease in the cost of whitespace in the past decade has allowed us to be much more generous with it, and much more consistent in its application, even for code like this that clearly no one has ever tried to read. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit c46215c100e964665580211a5d5893558ca9374f Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Wed Aug 10 11:17:46 2011 -0700 Cross-reference cvt(1) & gtf(1) man pages Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 1526f1caf396fefc5f09eaff884d5b92aac44997 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue May 31 19:54:33 2011 -0700 Remove unused ClientStateAuthenticating Appears to be leftover from the Kerberos code deleted in 2007 (commit dfbe32b5b828cc4e3da36a0e2e6ad641164eaa5e). Nothing left ever set clientState to ClientStateAuthenticating Skipped over 1 to preserve existing enum numbering. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 0f380a5005f800572773cd4667ce43c7459cc467 Author: Jamey Sharp <jamey@minilop.net> Date: Tue Sep 14 18:35:21 2010 -0700 Fix pixmap double-frees on error paths. If AddResource fails, it will automatically free the object that was passed to it by calling the appropriate deleteFunc; and of course FreeResource also calls the deleteFunc. In both cases it's wrong to call the destroy hook manually. Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 8f69c935f6d06ad92fd0e8d9fcb3cde86cd258f5 Author: Jamey Sharp <jamey@minilop.net> Date: Fri Sep 17 02:27:59 2010 +0200 Eliminate MAXSCREENS-sized CursorScreenKey array. Use new per-screen privates API instead. Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit c96a43888ceae72bf89c66de911120c0b6b7a71a Author: Jamey Sharp <jamey@minilop.net> Date: Sat Jul 10 09:28:47 2010 -0700 Revert "Bug #6924: Restore the ABI for DrawableRec and ColormapRec to the state" This reverts commit bc0c56c407117d1545e20d21f7d30eb3472d618b since we're breaking ABI anyway. Conflicts: ChangeLog dix/colormap.c dix/pixmap.c dix/window.c include/pixmapstr.h Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 13ac1ba480ee3e89163825cd2777f9a6e9dcbc9f Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue May 31 19:42:48 2011 -0700 Remove unused ClientStateCheckingSecurity & ClientStateCheckedSecurity Appear to be leftovers from the XC-QUERY-SECURITY code deleted in 2007 (commit 375864cb74cced40ae688078b1f7750998972535). Nothing left ever set clientState to ClientStateCheckingSecurity. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 78f946c297081d39d312e05928146c78f59fedcb Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu May 19 23:26:31 2011 -0700 sun_init.c: Implement novtswitch & sharevts for Solaris Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: John Martin <john.m.martin@oracle.com> commit 87cc83474d9890d14d9bc60926a97bd0d5b059af Author: Jamey Sharp <jamey@minilop.net> Date: Sun Sep 18 20:47:04 2011 -0500 Replace XmuSnprintf with snprintf. Alan Coopersmith explains: XmuSnprintf() can be replaced by snprintf() now. (It was a implementation X provided for it's libraries to use in the days before all platforms we cared about had snprintf in libc.) Reported-by: walter harms <wharms@bfs.de> Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit df4eeb1256c7c5e7a3f88f10da2915c7a07a8db8 Author: Jamey Sharp <jamey@minilop.net> Date: Tue Jun 8 13:58:04 2010 -0700 xnest: Delete unused nClipRects GC-private field. This field was never read at any time in the git history. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 53a4744b69ab76ecabdde5dabfb56830570c0f4e Author: Jamey Sharp <jamey@minilop.net> Date: Sat Sep 18 01:23:12 2010 +0200 XineramaInitData ignores its argument. Quit passing one. Also fix up XineramaInitData's caller, XineramaReinitData. Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit b85c10a35d44ad695797d0d19757e5f62eab4b98 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 16:23:31 2010 -0700 dmx: Fix some "no previous prototype" warnings by making functions static. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit d423012e776a81a197cde86be5c6bd471a593c39 Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 21 14:21:52 2010 -0700 dmx: Fix a non-constant printf format string warning. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 7e127f12a24acb8f43055af0a9be1ec585bbed36 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu May 19 23:22:27 2011 -0700 sun_init.c: Move vt switches to a switch_to helper function like lnx_init.c Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit a00dc6af6e84d0bee3f69d8df89d7f68cb535d35 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu May 19 22:43:56 2011 -0700 Xorg.man: Add -novtswitch and -sharevts options Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 93abda6bddf770dbfc3d4d0ada61ea84a7b7b9be Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu May 19 22:39:09 2011 -0700 xfree86: move -novtswitch & -sharevts argument handling up to common layer Stop duplicating in each os-support variant before it gets replicated even further. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> commit d8d99e14b1241fd8c099d69b8d0ed0817585fe8d Author: Jamey Sharp <jamey@minilop.net> Date: Wed Sep 14 09:52:58 2011 -0500 configure.ac: Remove unreachable check for VM86 headers. "configure --with-int10" is not a valid configuration, and the check for sys/vm86.h and sys/io.h is not used. Delete it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> commit 94b2eea86319934316bdb013f6f3940685a88a2f Author: Jamey Sharp <jamey@minilop.net> Date: Wed Sep 14 11:23:03 2011 -0500 int10: Delete #if 0'd implementation that's older than our git history. Throughout the xserver git history, the generic portion of the int10 module has always used other methods for reading the video BIOS. For some time now it's been purely libpciaccess based. This commented-out use of xf86ReadBIOS is entirely superfluous. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 6ad7bb69eebd5e5b4068bd9aa0b9a7168f075006 Author: Jamey Sharp <jamey@minilop.net> Date: Tue Sep 13 17:45:19 2011 -0500 Remove PC98 support. Gaetan Nadon wrote: Alan Coopersmith wrote: "I think we recently dropped PC98 support from the X server, so I'd be okay with dropping the documentation now". Let's make them be right, shall we? Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Gaetan Nadon <memsize@videotron.ca> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 9eb22ebf46b77c15e53017a37c7ef605521dc164 Author: Jamey Sharp <jamey@minilop.net> Date: Tue Sep 13 16:30:06 2011 -0500 configure.ac: XORG_OS is not used, so delete it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> commit 76636f30f7cf2344f4038c59bf292db19be33d53 Author: Jamey Sharp <jamey@minilop.net> Date: Tue Sep 13 13:10:10 2011 -0500 configure.ac: Remove unused XORG_OS_PCI variable. This is the last mention after ccfaf82367c9d057fd8314ce36b47f0a8eb696b6 quit using the variable. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Tiago Vignatti posted an identical patch in June 2010, which I only noticed after getting the above reviews. His patch was: Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 60b4bd181bbdc794c7f3547f67df916132aa111e Author: Jamey Sharp <jamey@minilop.net> Date: Tue Sep 13 14:31:24 2011 -0500 x86emu: There is no NO_INLINE implementation of unaligned access here. Patch produced with: unifdef -UNO_INLINE -B This change isn't relevant to the similar code in hw/xfree86/common/compiler.h, because x86emu is expected to someday move out of xserver entirely and so should not depend on any xserver headers. Also, some platforms apparently do have NO_INLINE versions of compiler.h. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 24b2b43e85c1e3f3d242ccab8793bf4ef83cfac4 Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 14:53:08 2011 +0200 render: Replace __inline with inline. Also remove traces from the past. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 9f01249d7f81514a38c44dff2a4a4612dbf97cae Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 15:10:56 2011 +0200 configure.ac: Fix help string for mitshm. Pasting from ./configure --help's output, one would get: | configure: WARNING: unrecognized options: --disable-shm Fix the help string to include the previously missing “mit” bits. Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 0caeef6146bee5fb1827ab25db191685dde9d4b4 Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 26 16:46:13 2011 -0700 Version bumped to 1.11 Signed-off-by: Keith Packard <keithp@keithp.com> commit 05284a03f9002b03a66ae355b34790ec02b726f0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 4 14:45:46 2011 +1000 input: make InputOption opaque, provide interface functions. InputOptions is not switched to use struct list for a future patch to unify it with the XF86OptionRec. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit fcafe825751bef99f4c0b36250ca6f15f127502f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 8 15:21:46 2011 +1000 Add null-terminated list interface. This is a set of macros to provide a struct list-alike interface for classic linked lists such as the XF86OptionRec or the DeviceIntRec. The typical format for these is to have a "struct foo *next" pointer in each struct foo and walk through those. These macros provide a few basic functions to add to, remove from and iterate through these lists. While struct list is in some ways more flexible, switching legacy code to use struct list is not alway viable. These macros at least reduce the amount of open-coded lists. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 79ca7c0b5786a02a80a1c40ed475e928da7c82b3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 12 15:55:48 2011 +1000 xfree86: comment typo fix in synch → in sync Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2bfb802839688ecf328119c4c6979390fc60348d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 29 16:33:54 2011 +1000 dix: don't XWarpPointer through the last slave anymore (#38313) This line was introduced pre-1.6 to fix Bug 19297. The effect of warping through the VCP then was that if a device had custom valuator ranges, the warp position would be wrong. The better device for this effect is the the XTest device. This fixes a server crash where the lastSlave is a pointer device without valuators (Bug 38313#0). And while we're at it, make sure the Xinerama code-path does the same. X.Org Bug 38313 <http://bugs.freedesktop.org/show_bug.cgi?id=38313> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit b29ce0726d55ec41cfbce0814e21b0217ef64efe Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Date: Tue Aug 9 11:00:34 2011 +0900 Disable check of double-aligned in test/input.c on Renesas SH Renesas SH is not aligned at size of double. When structure has double value, It is aligned in 4byte (long). Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3be379f5076566edaf92c27df5a4d447bcf5d015 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 11 10:59:07 2011 +1000 dix: use helper functions in EventIsDeliverable Proximity events don't have an XI2 type and caused error messages in the log when trying to get the event filter. Use this opportunity to clean up the code, instead of manually setting the fields that GetEventFilter requires use EventTo(XI2|XI|Core) instead. Co-Authored-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 799879797505a5e891ccaec2bea73fd838c94b7a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 11 10:57:05 2011 +1000 dix: abstract XI2 filter mask lookup Don't access the xi2mask bytes directly or calculate the offsets manually, use a few helper functions instead. XI2 masks are a bit weird in the event handling code since they slot onto the legacy code. For core/XI 1.x events, the event mask is a CARD32. That mask is used together with the event filter (also 32 bit) to determine if event delivery should be attempted. XI2 masks are of arbitrary size and their mask is simply the byte of the mask that contains the event mask. Likewise, the filter is a single byte matching that mask. Provide helper functions get these bytes and masks in the right order instead of accessing them manually. EventIsDeliverable should be part of this cleanup patch but it will be gutted with the next patch. Co-Authored-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 8c5a4d6fbecf79f2dc4f2d836d741203b2d5e856 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 1 14:12:41 2011 +1000 dix: don't use the pointer as modifier device in UngrabKey. Modifier device is always the keyboard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 3a077f246e9ac07a37c1b01c3d321e0f5ceb4153 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 3 15:07:23 2011 +1000 input: provide a single function to init DeviceEvents to 0 getevents.c already had that function, but XKB was manually initializing it, causing bugs when the event structure was updated in one place but not the other. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4b376ddeb4f3c9d9d279ffd2946d88edd5af4cfc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 1 14:20:53 2011 +1000 dix: fix compiler warnings ("foo" set but not used) devices.c: In function 'AttachDevice': devices.c:2409:18: warning: variable 'oldmaster' set but not used [-Wunused-but-set-variable] events.c: In function 'ConfineToShape': events.c:683:15: warning: variable 'pSprite' set but not used [-Wunused-but-set-variable] events.c: In function 'ProcGrabPointer': events.c:4759:15: warning: variable 'time' set but not used [-Wunused-but-set-variable] getevents.c: In function 'GetMotionHistory': getevents.c:425:9: warning: variable 'dflt' set but not used [-Wunused-but-set-variable] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 6fd2adc179141310e45a56ee90ef5b5f6115a1f6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 1 14:27:54 2011 +1000 mi: fix compiler warnings ("foo" set but not used) misprite.c: In function 'miSpriteSaveUnderCursor': misprite.c:940:12: warning: variable 'y' set but not used [-Wunused-but-set-variable] misprite.c:940:9: warning: variable 'x' set but not used [-Wunused-but-set-variable] mivaltree.c: In function 'miComputeClips': mivaltree.c:226:10: warning: variable 'resized' set but not used [-Wunused-but-set-variable] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 484cef5b29ef82402a15e155b3b8505b1e4a6830 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 2 09:21:00 2011 +1000 Xi: silence compiler warnings (set but not used) exevents.c: In function 'UpdateDeviceState': exevents.c:719:9: warning: variable 'bit' set but not used [-Wunused-but-set-variable] exevents.c: In function 'ProcessOtherEvent': exevents.c:889:22: warning: variable 'v' set but not used [-Wunused-but-set-variable] exevents.c:888:17: warning: variable 'k' set but not used [-Wunused-but-set-variable] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 98fe735ea1d756711019c3d90ed6abd9c06abebf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 1 13:52:13 2011 +1000 dix: add KEYBOARD_OR_FLOAT and POINTER_OR_FLOAT to GetMaster() GetMaster() currently requires an attached slave device as parameter, resuling in many calls being IsFloating(dev) ? dev : GetMaster(...); Add two new parameters so GetMaster can be called unconditionally to get the right device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit dbbe5735d1451bb32f43bce90f0bcfeff46f9743 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 2 08:54:00 2011 +1000 test: add a test for GetMaster() behaviour Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit b3c76b0c53ac42b70d12849da18465e8467e474c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 1 11:54:17 2011 +1000 mi: fix comment typo, whitespace in miPointerSetPosition Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit c9562bed0d5e26b7e3e55e26cf1ddc5086d61cc6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 1 09:52:38 2011 +1000 dix: rename mieqSwitchScreen argument fromDix → set_dequeue_screen, document fromDIX is neither exactly true nor particularly helpful in understanding what this parameter triggers. Rename to set_dequeue_screen, because that's exactly what happens. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 09496996accfdaf7bc01097a25db400912004d97 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 28 15:56:08 2011 +1000 dix: ignore devices when adding passive core grabs to list (#39545) Passive core grabs are mostly device-independent. In an MPX scenario, they may change to reflect whichever master pair activated the grab last. For adding new grabs to the list, ignore the device for core grabs to return failures when trying to set the same grab combo twice on a window. X.Org Bug 39545 <http://bugs.freedesktop.org/show_bug.cgi?id=39545> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 80c37048539daa1d257d127d66502bde45c97c85 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 28 15:43:10 2011 +1000 dix: avoid using the VCP as modifier device Core grabs may change device when they're activated to reflect the master they apply to. If the device is a keyboard, modifierDevice is erroneously set to the Virtual Core Pointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 20a61845d3c93c337bf3331a6bac30cf66c2a293 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 9 11:21:06 2011 +1000 config: use add_option for '_source' too _source was being allocated manually, with all other options added to that list through add_option. Skip the manual part, allocate the first option _source with add_option too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit d33652dad8838ab0a9175ca4613a3161ebc5676f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 9 11:20:31 2011 +1000 config: return the new InputOption from add_option. Change add_option to return the new InputOption on success, or NULL failure. This way we can at least check for errors in callers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit e684e816acb617b4dc66a68e2b0ba8f80399170a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 20 16:21:28 2011 +1000 config: fix a log message PRODUCT was taken from the parent, hence ppath. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 1357cd725143c1a35e32f15df658de111b151692 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 8 16:13:45 2011 +1000 Revert "Attempt to add the 'mouse' driver in more situations." This reverts commit 43d9edd31e31b33b9da4a50d8ab05004881c8d5a. This commit was introduced in the 1.2 cycle when hotplugging was less than ideal (i.e. it didn't exist). From the commit message: Always add a mouse driver instance configured to send core events, unless a core pointer already exists using either the mouse or void drivers. This handles the laptop case where the config file only specifies, say, synaptics, which causes the touchpad to work but not the pointing stick. We don't double-instantiate the mouse driver to avoid the mouse moving twice as fast, and we skip this logic when the user asked for a void core pointer since that probably means they want to run with no pointer at all. To get this case above, a user would need to disable hotplugging _and_ have a xorg.conf that only references one device. This is possible, but not a use-case we should worry about too much now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 159b03e13760920274b573a2bccdbf6a79f059e7 Author: Lennart Poettering <lennart@poettering.net> Date: Mon Jul 18 21:19:23 2011 +0200 config: add udev/systemd multi-seat support Add support for multi-seat-aware input device hotplugging. This implements the multi-seat scheme explained here: http://www.freedesktop.org/wiki/Software/systemd/multiseat This introduces a new X server switch "-seat" which allows configuration of the seat to enumerate hotplugging devices on. If specified the value of this parameter will also be exported as root window property Xorg_Seat. To properly support input hotplugging devices need to be tagged in udev according to the seat they are on. Untagged devices are assumed to be on the default seat "seat0". If no "-seat" parameter is passed only devices on "seat0" are used. This means that the new scheme is perfectly compatible with existing setups which have no tagged input devices. Note that the -seat switch takes a completely generic identifier, and that it has no effect on non-Linux systems. In fact, on other OSes a completely different identifier scheme for seats could be used but still be exposed with the Xorg_Seat and -seat. I tried to follow the coding style of the surrounding code blocks if there was any one could follow. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 95772598b57f6054fbf88683fa0a492c77605790 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 8 16:10:07 2011 +1000 xfree86: use xf86AllocateInput for implicit devices too Slowly merging the vastly different code-paths. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit fa8f4652819b692faaf2789cf32d7fa99fbb34aa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 15:02:20 2011 +1000 xfree86: factor out adding/removing a device from the input device array No functional changes, just readability improvements. This also gets rid of the count variable. Count was just used for resizing the null-terminated list. Since we're not in a time-critical path here at all we can afford to loop the list multiple times instead of keeping an extra variable around. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 5b5477c05f691205064ca4d8034f8dd47ab975b7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 14:14:11 2011 +1000 xfree86: update comment for InitInput Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 7354f607833c69626d8692bc5176b18ea1cf6263 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 14:26:13 2011 +1000 xfree86: nest loops instead of 0x1 pointers. If we find the core device, move all other device pointers forward right then and there. The break will jump out of the top loop. They had a special on braces today, so I added some for readability (and fixed up tab vs space indentation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 5669aa2d24dff9ab276e5f74a09f97ec77b90e75 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 14:05:30 2011 +1000 xfree86: improve readability of synthesized device. No functional changes. The options we assign are the ones from the Pointer/Keyboard device so we might as well use those readable names instead of dev[count-1]->options. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 5aa826cdd1f2e768bedf23d399703a5d0b6302be Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 13:52:11 2011 +1000 test: add a option duplication test Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 4527e2b776cfcdac2b189b5439b9a3d0b6433077 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 13:46:24 2011 +1000 xfree86: when implicitly choosing a core device, set the option to a value Devices are core pointers/keyboards by default now anyway, but let's set the option to some value instead of just NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 44d53728a6a533fc0a6e0a10269d1cc99e9dad32 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 13:44:44 2011 +1000 xfree86: don't warn about duplicate core devices It doesn't matter. All devices are core pointer devices by default now anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 033f53c223dc12a91f00e10a69f87a4f2a7adb6b Author: Daniel Kurtz <djkurtz@chromium.org> Date: Mon Aug 8 15:09:48 2011 +0800 xf86Helper: use LogHdrMessageVerb in xf86VDrvMsgVerb LogHdrMessageVerb allows passing a parameterized header to insert in a log message between MessageType and the formatted message body string. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cd8ee3e5cb29b9cd6402d2fbc71463c6b04b6077 Author: Daniel Kurtz <djkurtz@chromium.org> Date: Mon Aug 8 15:09:47 2011 +0800 xf86Helper: use LogHdrMessageVerb in xf86VIDrvMsgVerb LogHdrMessageVerb allows passing a parameterized header to insert in a log message between MessageType and the formatted message body string. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b31d104fc09a7241856ff8d226be11ec562beac3 Author: Daniel Kurtz <djkurtz@chromium.org> Date: Mon Aug 8 15:09:46 2011 +0800 os/log: Add LogVHdrMessageVerb and friends LogVHdrMessageVerb allows a custom header to be inserted in a log message, between the Log system's MessageType string, and a formatted variable message body. The custom header can itself be a formatted variable string. These functions can be used, for example, by driver abstraction layers to format specific driver messages in a standard format, but do it in a way that is efficient, obeys the log-layers verbosity settings, and is safe to use in signal handlers (because they don't call malloc), even for types besides X_NONE. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b82f934db661c59d7397ce180d08cf8f8f7118b1 Author: Daniel Kurtz <djkurtz@chromium.org> Date: Mon Aug 8 15:09:45 2011 +0800 os/log: Pull LogMessageTypeVerbString out of LogVMessageVerb Also, optimize how the type and format strings are combined. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce Author: Adam Jackson <ajax@redhat.com> Date: Thu Apr 21 16:37:11 2011 -0400 fb: Fix memcpy abuse The memcpy fast path implicitly assumes that the copy walks left-to-right. That's not something memcpy guarantees, and newer glibc on some processors will indeed break that assumption. Since we walk a line at a time, check the source and destination against the width of the blit to determine whether we can be sloppy enough to allow memcpy. (Having done this, we can remove the check for !reverse as well.) On an Intel Core i7-2630QM with an NVIDIA GeForce GTX 460M running in NoAccel, the broken code and various fixes for -copywinwin{10,100,500} gives (edited to fit in 80 columns): 1: Disable the fastpath entirely 2: Replace memcpy with memmove 3: This fix 4: The code before this fix 1 2 3 4 Operation ------ --------------- --------------- --------------- ------------ 258000 269000 ( 1.04) 544000 ( 2.11) 552000 ( 2.14) Copy 10x10 21300 23000 ( 1.08) 43700 ( 2.05) 47100 ( 2.21) Copy 100x100 960 962 ( 1.00) 1990 ( 2.09) 1990 ( 2.07) Copy 500x500 So it's a modest performance hit, but correctness demands it, and it's probably worth keeping the 2x speedup from having the fast path in the first place. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ac2c307f4716ebd3e955c004ceec9f4c029401a0 Author: Pelle Johansson <pelle@morth.org> Date: Sun Aug 14 17:44:40 2011 -0700 XQuartz: Initialize darwin pointer valuators This fixes a regression introduced by: 633b81e8ba09cc6a1ea8b43f323874fda2cf0bde http://xquartz.macosforge.org/trac/ticket/498 Signed-off-by: Pelle Johansson <pelle@morth.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4020cab88f5cf3164fc83cf912f94f288aa5a45d Author: Michel Dänzer <michel.daenzer@amd.com> Date: Wed Aug 10 11:36:16 2011 +0200 EXA/mixed: Update sys_pitch in MPH even when there's no system memory copy. Otherwise sys_pitch will be stale when a system memory copy is allocated. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38322 and a crash when unlocking the screen with xscreensaver, reported by Janne Huttunen. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Tested-by: Janne Huttunen <jahuttun@gmail.com> Tested-by: Jan Kriho <Erbureth@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a1dec7cd6adabaf8770dc3b21b0df30ce2f0bc8d Author: Julien Cristau <jcristau@debian.org> Date: Thu Jul 7 19:18:03 2011 +0200 Xephyr/dri: register screen and window privates on init Fixes assertion failure when calling dixSetPrivate Debian bug#632549 <http://bugs.debian.org/632549> Reported-and-tested-by: Mohammed Sameer <msameer@foolab.org> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 39bc81b60ddc9e495ff3b9bb3c3a6c39e547b43a Author: Keith Packard <keithp@keithp.com> Date: Wed Aug 3 20:57:03 2011 -0700 Version bumped to 1.10.99.902 (1.11 RC2) At the close of the 1.11 non-critical fixes window. Signed-off-by: Keith Packard <keithp@keithp.com> commit 9504caf1c3243e3ab2eb7126bc2bb876a8f89918 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri May 6 18:19:34 2011 +0300 composite: Inhibit window background paint with manual subwindow redirection The composite extension spec says that window background painting should be inhibited when the subwindow redirection mode is set to manual. This eliminates the ugly flashing effect when compiz unredirects a fullscreen window. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Owen Taylor <otaylor@fishsoup.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f1d75f3b742231c4c09f13d7a22ed920014cb5ef Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Thu Jul 28 15:17:59 2011 -0700 Revert "composite: Don't backfill non-MapWindow allocations" This reverts commit db8840600e8e21356241eb87395031388d9b54d2. It was an optimization for the resize case, but 193ecc8b453b22 made it so that no backfilling takes place on resize if left in. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Conflicts: composite/compalloc.c Signed-off-by: Keith Packard <keithp@keithp.com> commit e87adcc9e024982fdad974de2876b00cf974dab8 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jul 31 21:14:59 2011 +0200 Xquartz: include new localization files in the tarball Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit a1bb5062c72667b2f10b56925c61888acc89e3e4 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Jul 21 10:33:58 2011 -0700 XQuartz: xpr: Don't FatalError if xp_unlock_window fails We added the FatalError in 5d1d9d9ae39fab2ee2ac085f9776f82768828dc8 but it caused a regression http://xquartz.macosforge.org/trac/ticket/482 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c319f7b5b3ee651636cdfd165588f0dc972a22a4 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jul 20 00:16:42 2011 -0700 XQuartz: Use CFSTR to avoid implicit cast warning of NSString * to CFStringRef Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 08dfff92e8d0c2b1726634392c147f6634d1706d Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Jul 29 16:12:06 2011 -0700 randr: Compare all the bytes in RRPostPendingProperties RRPostPendingProperties tries to compare the pending and current property values to decide whether they're actually changing. However, it does this using a memcmp that passes in pending_value->size as the number of bytes. This is actually the number of elements, where each element is (pending_value->format / 8) bytes long. This causes the pending value to not be propagated if the first pending_value->size bytes are the same and only the end of it is changing. Fix this by computing the total number of bytes to compare in the memcmp. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b8f61c11c94708d4f17720a55945dee4621315a4 Merge: 5596f10 f51e42f Author: Keith Packard <keithp@keithp.com> Date: Fri Jul 29 14:58:58 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit f51e42f583073bde0bc8131887cb7220636c8855 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 20 13:09:05 2011 +1000 Terminate the log with one last message. Instead of just closing the log when everything is done, put one more message in stating that we're actually terminating. Users or scripts that look at the Xorg.log will then know that a) the server has terminated properly and b) why the server terminated (to some degree, given that most real-world errors will be caused by AbortServer()). Acked-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 01de08c7d2c00eef238adba6665896ea3cd7d511 Author: Julien Cristau <jcristau@debian.org> Date: Tue Jul 26 20:40:38 2011 +0200 configure: set default xkb rules to evdev on Linux If config/udev was enabled, this would default to base, which means that after regen the devices would get the wrong rules, and hilarity would ensue. It's probably safe to default to evdev unconditionally on Linux by now. Reported-by: Bastian Blank <waldi@debian.org> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3798dd379c1ecf325f9907128fb66d20372f6876 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 20 09:00:18 2011 +1000 Initialize the fd to -1 for xorg.conf input devices. For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf path is different. Since not all drivers reset the fd during PreInit but may still call close(pInfo->fd) in all cases, this can terminate the logging early. Reproducible: add a wacom driver InputDevice section with no Option Device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit f2a6735cfc07789cca81852b24a85578f200d83d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 12:34:32 2011 +1000 xfree86: NULL option values are technically valid, don't strdup them Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit f0d7e9db28c374a3db359bcb63a7ce79fd84b541 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 4 14:14:39 2011 +1000 xfree86: duplicate xorg.conf device information before xf86NewInputDevice xf86ConfigLayout.inputs contains the information from the xorg.conf file. Passing this into xf86NewInputDevice means the device will get cleaned up on exit and the pointers in xf86ConfigLayout.inputs are left dangling. In the second server generation, this results in a server crash. Also, rename pDev to pInfo. pDev is pretty much reserved for DeviceIntPtr types. Reproducible: AutoAddDevices off and xorg.conf input sections, trigger server regeneration. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 8ffddbcf72170e246826ee0f39f18989a29fa218 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 27 16:30:28 2011 +1000 xfree86: Remove devices that failed to enable on startup Devices that succeeded during PreInit and DEVICE_INIT but failed in DEVICE_ON would be deleted through xf86DeleteInput but not removed from the list of input devices (and not turned off). The result was a double free on server shutdown. Fix this by calling RemoveDevice if EnableDevice fails. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 6cea28fe4b7a4a22ad270d8c71403db84a9bfb2c Author: Lennart Poettering <lennart@poettering.net> Date: Mon Jul 18 21:18:27 2011 +0200 config: don't fail if a device vanished by the time we managed to look at it The nature of hotplug is that a device we enumerated might already be gone by the time we look at it, so don't assume otherwise. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f13de9ca1b7c4dd0dd5c08037c6bd53f88ac30f5 Author: Lennart Poettering <lennart@poettering.net> Date: Mon Jul 18 21:17:49 2011 +0200 config: limit the kernel subsystems we look for devices in Don't enumerate/monitor all devices of the system (since that can be quite a few), but limit our search to devices from the "input" subsystem, as well as the "tty" subsystem (to cover Wacom tablets). This should make X start up a bit faster and reduce the number of unnecessary wake-ups of the X server. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 882e3c2680c339ad7aa0d664e0b0f02b8a05b11d Author: Lennart Poettering <lennart@poettering.net> Date: Mon Jul 18 21:17:10 2011 +0200 config: process udev "changed" and "add" events in the same code paths udev gives no guarantee that before each "changed" event for a device there's an "add" event, or that before each "remove" is an "add", or that before each "add" there was no "add" already and so on. Users can trigger these events at any time with "udevadm trigger", and netlink is a lossy transport, hence the events can come in unexpected ordering. With other words: regardless which event is generated, the X server must not choke on it and make the best of it, hence make sure that if we get an "add" event for an existing device we don't add the device a second time. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5596f10cce58295d8af73646352b314ecb3ddfca Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Jul 9 13:21:04 2011 +0100 Remove hw/xwin/xlaunch Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 73864a87aacbce85b520ccaa6e360b82c0e99716 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jul 19 20:03:48 2011 -0700 XQuartz: Localization updates Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit d2463df84d3a160b2dd1e706b02985e1817784e3 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jul 19 20:02:33 2011 -0700 XQuartz: Add english NIB changes for scroll_in_device_direction Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit e36e7ad6314ca5fcd3292b8022f0a618d567d72b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jul 19 20:01:11 2011 -0700 XQuartz: Add GUI controls to toggle scroll_in_device_direction Also cleaned up the wording for fullscreen_menu. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ac43984215faf464fd48bd006cac1c6539603cea Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jul 19 20:00:27 2011 -0700 XQuartz: Add a scroll_in_device_direction preference This preference allows users to override the related option in Mac OS X's Mouse/Trackpad preferences. This effectively lets the user determine which "context" all of X11 fits into for context-based scrolling until such API exists within X11 itself to pass along to X11 clients. This is applicable to Mav OS X 10.7+ Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ec95a9c829b8e37529aa828c05fbaabc45cffe42 Author: George Staplin <gstaplin@apple.com> Date: Wed Mar 4 02:03:52 2009 -0700 XQuartz: Add diagnostic error checking to xp_destroy_surface. This occurred to me in hindsight after the last commit. If the original developer had done this, we would have noticed the problem sooner. (cherry picked from commit aa0a57996f3e7d16238f69976958c2526821388b) commit 4fe7df265324f63025686efe9d32342e3cef40d3 Author: George Staplin <gstaplin@apple.com> Date: Wed Mar 4 01:39:58 2009 -0700 XQuartz: Fix a memory leak with surfaces that a new test found. xp_destroy_surface was called with a surface id of 0, due to some premature cleanup that set it to 0. This means the surfaces weren't being destroyed until the window was. The code that did that was: pDRIDrawablePriv->sid = 0; In long running applications this leak may or may not have been harmful. With the old libGL the surfaces weren't destroyed until the context was destroyed or a new context created. In the new libGL they are reference counted, and released much sooner, so we ran into a resource leak more noticeably with some tests. Make the Apple DRI code dispatch events to the client(s) for destroyed surfaces, when a resource is destroyed. This seems to work in my tests, however this clearly wasn't working for a while, so bugs may result in the future if it enables some new (unexpected) side effects. Also add a few helpful comments to aid in understanding the code in the future. Tested with the test suite, Pymol, and various Mesa demos. (cherry picked from commit bede83eb19a1629396fcd5a46441f8476a8fcd1b) commit 0ebe45a717faa6464d3b1ab73e30570518ee4798 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jul 19 19:42:44 2011 -0700 XQuartz: DRI: Dead code removal Also add some comments that weren't merged in from server-1.4-apple's 99babae1326485c27eb9253db83afdd6aef9e362 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 88ad050f3c2f9f11bafb56a8cf777518795295a9 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Jul 18 22:54:21 2011 -0700 XQuartz: Add some sanity checking and a fallback for the bundle id. This way we'll print an error and still mostly work rather than crashing if someone installs XQuartz.app incorrectly or tries running the server within the build system rather than the installed system. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 89bfa0c633f3096cca6f983bca1507d3f4b902a8 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Jul 15 10:39:39 2011 -0700 XQuartz: DarwinEQFini doesn't return Bool Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 82f5521a6d91ebcd2a4400f6c221ad625edc99a1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 13 12:08:04 2011 +0100 XKB: Work around broken interps from old xkbcomp Bugfix for broken xkbcomp: if we encounter an XFree86Private action with Any+AnyOfOrNone(All), then we skip the interp as broken. Versions of xkbcomp below 1.2.2 had a bug where they would interpret a symbol that couldn't be found in an interpret as Any. So, an XF86LogWindowTree+AnyOfOrNone(All) interp that triggered the PrWins action would make every key without an action trigger PrWins if libX11 didn't yet know about the XF86LogWindowTree keysym. None too useful. We only do this for XFree86 actions, as the current XKB dataset relies on Any+AnyOfOrNone(All) -> SetMods for Ctrl in particular. See xkbcomp commits 2a473b906943ffd807ad81960c47530ee7ae9a60 and 3caab5aa37decb7b5dc1642a0452efc3e1f5100e for more details. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c177a5bcaa170d24a784540460906cc04ac5c752 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 13 12:08:03 2011 +0100 Fix non-Composite builds in PrintWindowTree The previous patch accidentally introduced a hard dependency on Composite. Sorry, OS X. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reported-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 01dbf2514aa0cc8c40a876a24e3cb0737c41da19 Merge: 5a801af af0fbc3 Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 13 11:44:15 2011 -0700 Merge remote-tracking branch 'jturney/master' commit 5a801af689fce9dfe84453bbc2b029cb4782de83 Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Jul 12 19:50:05 2011 -0400 XWinrc: replace hard coded section number with __filemansuffix__ Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit af0fbc37e35ddaabf12a8d7abc79ea11958ec8ac Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Jun 23 07:45:13 2011 -0400 XWinrc: replace hard coded section number with __filemansuffix__ Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 42bc198775a78b328612427c4c8ed4d17e005ae9 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 24 18:29:41 2011 +0000 glx: Remove a few lingering traces of __GLXscreen.GLXVersion The GLXversion member of the __GLXscreen struct is just cruft since commit ad5c0d9efa47476ed5cf75c82265c73919e468b4, when we started returning the minimum GLX version supported by all of the screens on the display, rather than the maximum version supported by the server. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 005e68ba59782b60dd5c44a06c75b1fa5e8d70d8 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Jan 20 16:21:04 2011 +0000 hw/xwin: Add -wgl option to XWin manpage Document the -[no]wgl options in the XWin manpage Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d62726019e4b7bfac8a23d0d733677b141047d66 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Nov 2 11:38:53 2010 +0000 hw/xwin: Add items to WGL AIGLX todo Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 276735ef5d12e79fe051996f100c5730c1e69334 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Oct 11 16:22:49 2010 +0100 hw/xwin: Report Window XIDs in Window debug messages Report Window XIDs in Window create/destroy/reparent debug messages It's actually quite useful if you are trying to corrolate those events with what a client is doing... Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b0b54338e2f8aed6e6a683ebddd2a2acbefabecd Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Oct 11 16:25:03 2010 +0100 hw/xwin: Add a flag to track which windows have been drawn to using WGL. Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 98c6d91a48f460fdbca93700ab637eadf946fb0e Author: Colin Harrison <colin.harrison@virgin.net> Date: Thu Mar 24 20:39:51 2011 +0000 hw/xwin/glx: Fix some warnings in generated wrapper code Add a suitable cast to the generated code for glWinSetupDispatchTable() so it doesn't generate screeds of warnings Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b67e80c84e4af54007aa1bd1e4a97a4d1b3d3765 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 24 18:41:05 2011 +0000 hw/xwin/glx: Handle failure to get any fbconfigs more gracefully. Handle failure to get any useful pixel formats for GLX fbconfigs more gracefully: If we didn't get any useful pixel formats from wglGetPixelFormatAttribivARB(), fall back to using DescribePixelFormat(). If that doesn't give us any useful pixel formats, fallback to software rendering. This works around a problem with Intel 845G drivers, where wglGetPixelFormatAttribivARB() doesn't seem to work as we expect it to... Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 9915b169237e3b2d817bd3d4455f3c01dd7dd2b5 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Nov 1 19:53:42 2010 +0000 hw/xwin/glx: Don't spam log with wglwrap symbol resolution status at startup ... instead just log if an attempt is made to call a wrapper for a function which didn't resolve Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 8216316867f07819b8e8b377f2633fbf8876abf7 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Oct 30 17:23:52 2010 +0100 hw/xwin/glx: Better handling of SetPixelFormat() failure Propagate and report the failure if SetPixelFormat() fails Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit eecc8e06eb4bdfd4354144206d990cd9ccb69721 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Oct 30 17:22:33 2010 +0100 hw/xwin/glx: Improvements to glxWinErrorMessage() reporting in WGL GLX provider Request the message using languageID 0 (best effort), rather than only using language neutral messages Always report the numeric error code. Trim any trailing \r from FormatMessage() output Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 3873be16d050ab12fc78f1e7f0c36c2ac88d0a98 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Oct 11 16:21:40 2010 +0100 hw/xwin/glx: Fix fbconfig dumper formatting for 3 digit index numbers Some graphics hardware supports hundreds of pixel formats, so adjust formatting in fbconfig dumper for 3 digit index numbers Also report the PFD_SUPPORT_DIRECTDRAW, PFD_DIRECT3D_ACCELERATED and PFD_SUPPORT_COMPOSITION flags introduced with aero Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d4096abb591353405417e53816e5c46e904e7b25 Merge: 61f87a7 87d4f90 Author: Keith Packard <keithp@keithp.com> Date: Fri Jul 1 15:45:45 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit 87d4f90bfcb509471ac9e7886e14a92b33223fd7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 27 09:10:42 2011 +1000 input: free the EQ allocated memory on shutdown (#38634) mieqFini() already does the right thing, but it needs to be called by the various DDXs and the XTest Extension. X.Org Bug 38634 <http://bugs.freedesktop.org/show_bug.cgi?id=38634> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Acked-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e084ac30b37c36016bb0dbb1b79e60a7799aee02 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 2 14:52:42 2011 +0000 Input: Reset SD remainder when copying co-ords from MD In updateSlaveDeviceCoords, pDev->last.valuators was being copied from the master, but pDev->last.remainder wasn't. Make sure we copy both, to avoid minor inconsistencies. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 23a783278963919778d017965542e0f983814e37 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 24 11:02:23 2011 +1000 input: add POINTER_NORAW to avoid generation of raw events (#30068) RawEvents are supposed to be events coming from the driver. When warping the pointer, this should not generate a raw event. X.Org Bug 30068 <http://bugs.freedesktop.org/show_bug.cgi?id=30068> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9444e40d77508d545e3c0a8123f61950c22d89fa Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Mar 1 11:11:22 2011 +0000 Test: Input: Only ever set up to MAX_VALUATORS valuators Previously, the input tests were working up to sizeof(mask) * 8, which could be more than the arrays; the latter only being sized as MAX_VALUATORS. Hypothetically, if you were switching the stored valuator values to double instead of uint32_t, and you attempted to set the 39th member of a MAX_VALUATORS-sized (36) array, you'd probably end up smashing ev->key_repeat into oblivion and then tripping the check for invalid flags because you haven't yet put XIPointerEmulated into the valid flags for XI_Motion. Probably. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1e65a01cf73f1fbdfe0d63eaecea412cf8472cb4 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jun 17 16:28:05 2011 +0100 Test: Ensure libxservertest gets relinked when necessary Similar to how we link Xorg, make sure that whenever any of the component libraries changes, we relink libxservertest and the tests. Not much use testing anything other than the actual source in your tree. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0f41d6c851df76d0423d9c37ad809d3440906944 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jun 17 13:20:19 2011 +0100 KDrive: Remove useless miPointerUpdateSprite call miPointerUpdateSprite is already called from mieqProcessInputEvents, so calling it by hand immediately after isn't massively helpful. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 57b767d2927e5c2e561a431be4e604df65423422 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jun 17 13:19:46 2011 +0100 DMX: Remove useless miPointerUpdateSprite call miPointerUpdateSprite is already called from mieqProcessInputEvents, so calling it by hand immediately after isn't massively helpful. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cf398755c0ca1e031514862b670956e7b9ace5ef Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jun 17 15:29:44 2011 +0100 XWin: Remove executable bit from headers Headers don't really need to be mode 0755. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7d2543a3cb3089241982ce4f8984fd723d5312a1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 29 12:03:01 2010 +0000 XKB: Add debug key actions for grabs & window tree Add four new private XKB actions for debugging: * PrGrbs: print active grabs to the log file * Ungrab: ungrab all currently active grabs * ClsGrb: kill clients with active grabs * PrWins: dump the current window tree to the log file To use these, you need to modify your XKB maps, e.g. the following to have Ctrl+Alt+(F9-F12) mapped to the above: - compat/xfree86: interpret XF86LogGrabInfo { action = Private(type=0x86, data="PrGrbs"); }; interpret XF86Ungrab { action = Private(type=0x86, data="Ungrab"); } interpret XF86ClearGrab { action = Private(type=0x86, data="ClsGrb"); } interpret XF86LogWindowTree { action = Private(type=0x86, data="PrWins"); } - symbols/pc: key <FK09> { type="CTRL+ALT", [ Return, XF86LogGrabInfo ] }; key <FK10> { type="CTRL+ALT", [ Return, XF86Ungrab ] }; key <FK11> { type="CTRL+ALT", [ Return, XF86ClearGrab ] }; key <FK12> { type="CTRL+ALT", [ Return, XF86LogWindowTree ] }; At the moment, this only works if the grabbing client continues to call AllowEvents, as the server does no event processing at all when a device is frozen. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ddf735fd4e9658bb5610f5e911f3b4055d5acf89 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Oct 13 19:56:57 2009 +1100 DIX: Make PrintWindowTree actually useful Rewrite PrintWindowTree to make it actually tell you what you want to know. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b27d61e4433a2a0140ed8a6128e4427451e37fec Author: Matěj Cepl <mcepl@redhat.com> Date: Fri Jun 17 15:26:17 2011 +0100 Fix UTF-8 encoding Report to find out all non-UTF-8 files created by cat extensions |xargs -I XXXX find . -name \*.XXXX |while read FILE ; do if ( iconv -f utf8 -t ucs2 $FILE >/dev/null 2>/dev/null ) ; then /bin/true else echo $FILE fi done >>report Signed-off-by: Matěj Cepl <mcepl@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> [Daniel: git am failed for me, so I redid it. The method listed in the commit message also failed, so I just used file/grep/iconv. The results are the same though.] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2ee85d954c8f3a6affbd9b1b745594ff12e8b670 Author: Scott James Remnant <scott@netsplit.com> Date: Tue Jun 14 16:36:07 2011 -0700 dix: avoid calling deleted block and wakeup handlers BlockHandler and WakeupHandlers may be removed within a different BlockHandler or WakeupHandler, especially since config/udev uses these and removes devices. Calling the deleted handlers and passing potentially freed data can result in the X server segfaulting after device removal, or events that result in device removal such as undocking or suspend/ resume. Signed-off-by: Scott James Remnant <scott@netsplit.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b573cdd40ee49fae299fe2e7cbd02159ae8ae617 Author: Marcin Slusarz <marcin.slusarz@gmail.com> Date: Tue Jun 7 21:22:15 2011 +0200 dri2: restore Screen->ConfigNotify on close ConfigNotify is set by DRI2ScreenInit, but not restored to previous state on close. Fix it. (I'm preparing a patch for xf86-video-nouveau which detects GPU lockup after dri2 init and it needs to reinitialize dri2) Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 61f87a75f2bcda939a1778d39be8cfa5c886e6d8 Merge: 0d2153a 72d9143 Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 29 20:14:51 2011 -0700 Merge remote-tracking branch 'jturney/master' commit 0d2153a46cc72d5f2e6a9081a3cf153aa3eb7787 Merge: b631c39 932513e Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 29 20:08:32 2011 -0700 Merge remote-tracking branch 'jbarnes/master' commit b631c39a21c8d74fd00b8932df342d6921cce8f4 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Jun 23 13:37:45 2011 -0400 Remove unused check for PERL program Unable to find any use of the PERL Automake variable. It was used in hw/xfree86/scanpci around 2005. Should it ever be needed, use XORG_WITH_PERL macro. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d5ca33ca2dd08e8436439da926d2dedaabc268fa Merge: 38d55f0 4edf49d Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 29 18:54:33 2011 -0700 Merge remote-tracking branch 'kibi/master' commit 72d914335c9ad0e0f4a34b9f7e2901b830c499bf Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Tue Mar 23 04:34:22 2010 -0500 Cygwin/X: Left-justify website link in About box Left-justify website link in About box. This is a cosmetic fix to make the About box display correctly when Windows is configured with a non-default DPI value Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit e78628406f0428454983db1c51a8c828bf5684e5 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Aug 12 15:00:01 2010 +0100 Cygwin/X: Preserve client area size and position on Windows window style change When the style changes, adjust the window size so the client area remains the same. Otherwise the window size may change when sizing is reflected from Windows to X, and some windows are drawn expecting them to be exactly the requested size (e.g. the gmplayer control window) Use DeferWindowPos to delay the resize to preserve client area on WM_STYLECHANGING until after the style change has actually happened in WM_STYLECHANGED As a consquence of this, we need to be more careful to create windows with exactly the requested placement and client area initially, so the client area matches what the X client requested Also synchronize the X windows idea of the placement of a window which Windows is allowed to place Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 1d7f3a0031b4ae7d8aa984799ffa578788061ce4 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Nov 7 19:34:12 2009 +0000 glx: Move GLX extension string utility functions Move GLX extension string utility functions from the DRI1 convenience library into the GLX extension convenience library, so other DDX which don't have DRI can use them. This is probably also needed if anyone actually tries to build an Xorg DDX with only DRI2 support... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit 932513e23b5fe1793cc38eabe02df82e1cc6e4d9 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu May 5 13:11:46 2011 -0700 DRI2/GLX: use new swap event types Use the new event types so we can pass a valid SBC value to clients. Fix up the completion calls to use CARD32 instead of CARD64 to match the new field size. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit a3cb7d097a281252cebbc3c65c67149e106482ac Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Tue May 3 10:36:44 2011 -0700 GLX/DRI2: pass drawable correctly for indirect swap events Pass the right drawable pointer as data to the swap complete function. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 3e8270b869ebf788778d5d56107f6d47c7c050d0 Author: Adam Jackson <ajax@redhat.com> Date: Tue Apr 12 15:30:25 2011 -0400 glx: Fix fbconfigs with no corresponding visual There are, in general, more fbconfig depths than visual depths. fbconfigs need not support Window rendering, however any that do must have an associated visual ID (which we got right), and any that do not must not claim GLX_WINDOW_BIT in GLX_DRAWABLE_TYPE (which we got wrong). Fixes piglit/glx-fbconfig-sanity, assuming you have a sufficiently recent piglit, as that test formerly wrongly required pixmap-capable fbconfigs to have a visual. v2: Additional check for fbconfigs that didn't have GLX_WINDOW_BIT in the first place, from previous patch by Jon TURNEY; also, also clear ->visualID. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 38d55f06cfbf4b05fee0aef8f97f90e835beaacb Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jun 27 15:06:16 2011 +0100 Guard use of backtrace() with HAVE_BACKTRACE Guard the use of backtrace() with HAVE_BACKTRACE, since we already have the autoconf machinery for setting that. For the moment, assume dladdr() is available when backtrace() is Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit bea57392c724f439987832b422941ae897953e4a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Jun 25 11:29:53 2011 -0700 XQuartz: Fix Makefile dependencies automake generates _DEPENDENCIES from _LIBADD, but it strips out variables. This resulted in not relinking if some components were rebuilt (like libdix, libos, etc). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c8b80a82d97d92d445c1c0af6dba42c9de7c56cd Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jun 21 21:14:46 2011 -0700 XQuartz: Make a call to activateIgnoringOtherApps in our NSApplicationActivatedEventType handler In addition, this change will not call into the X11 activation unless an X11 window was active when we deactivated. We can't rely on the event and current key windows because the key window will be nil until activated, and the event will only reference the window if the window was clicked (whereas it will be nil if we activated via dock or cmd-tab). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 9d568450b1319e9057319ebb37e76003bcba447d Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 28 09:33:25 2011 -0700 Create sdksyms.dep in the right place at configure time sdksyms moved from hw/xfree86/loader to hw/xfree86, so the configure-time create of sdksyms.dep needs to reflect that change. Otherwise, make might be confused by a missing file and (more importantly to me) hw/xfree86/loader/sdksyms.dep will be left around after 'make clean' causing 'make distcheck' to fail. commit f968f4ace9410d827fb6b68c4e38ea9516641309 Merge: 4dbed26 163441f Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 28 09:10:14 2011 -0700 Merge remote-tracking branch 'dbn/no-libxorg' commit 4dbed2625431a92e20bede7b8cef847b5d5d99ba Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 27 14:45:18 2011 +1000 xfree86: Only log the serial bytes if debug is on. Introduced in e3f296d91dfe6b827195e1d387e1a04aa73b85c3, when the ifdef DEBUG around the whole block was removed, but only two of the three ErrorF switched to DebugF. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 163441fe531a77f7fa54bfa59c5ab49c78f44306 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Tue Jun 14 20:03:06 2011 -0700 xfree86: Remove libxorg convenience library to speed up build libxorg.la served to collect all the Xorg convenience libraries into one massive archive to link into Xorg. This made things easy for symbol resolution, but it tremendously slowed down the build since each change caused libxorg.la to be rebuilt. This is an extremely slow process of extracting all the objects from the sub-libraries and recombining them. Instead, the archives are linked directly into Xorg. The order of the libraries had to be tweaked a bit to make symbols resolve correctly with the lower level code moving later in the link command. As a side effect, since the dtrace objects are now being linked directly into Xorg, we don't need the SPECIAL_DTRACE_OBJECTS hack to add them twice. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6259b30111f568ec3d1b32dc6382bce46d8e6ccc Author: Dan Nicholson <dbn.lists@gmail.com> Date: Tue Jun 14 19:47:02 2011 -0700 xfree86: Move sdksyms generation to ddx toplevel The symbols in sdksyms.c cover the entire source tree. In order to make them resolve when libxorg.la goes away, move the objects from libloader to Xorg. Unfortunately, this means sdksyms needs to get built again for the test code. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7d5c8a12cbc295b3e33e1b60bd7330e2bc93a966 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Tue Jun 14 17:21:48 2011 -0700 Don't use empty source files When an empty _SOURCES variable is declared, automake will recognize that only linking is needed. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8ac651552bb70ba36238f430adab2f7a7f24db6e Merge: 945b2ff 47b6ba3 Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 22 11:03:37 2011 -0700 Merge remote-tracking branch 'alanc/master' commit 945b2ff8141c58344fc9558ee3853fad3e86134b Author: Gaetan Nadon <memsize@videotron.ca> Date: Wed Jun 8 15:18:12 2011 -0400 docbook.am: --path is also required for xsltproc The XSLT processor also needs to know about the entities defined in xserver.ent. It removes error messages. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6326b0f0746ded410672ad0270d1c8a0e9cb59f9 Author: Gaetan Nadon <memsize@videotron.ca> Date: Wed Jun 8 15:17:59 2011 -0400 Update .gitignore as new tests have been added Refactor to follow the pattern one Makefile, one .gitignore where needed. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 47b6ba3204d650393a7255ce2af27b8c018bb586 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Jun 20 22:17:03 2011 -0700 Add xkeyboard-config to See Also of man pages referencing xkb Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit cfbe471b586282aea89f7b4802c051f22301bf59 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Jun 20 22:06:00 2011 -0700 Xdmx.man: convert section references to substituted forms Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit c3278f3c1786e66019a39e2612761f74782a48ee Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Jun 11 10:56:08 2011 -0700 Xdmx.man: additional updates to modernize XKB information Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 19e37067131175219eca7d2b11c2ee59af280575 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Jun 11 10:41:48 2011 -0700 Xdmx.man: Show actual configured XKB defaults instead of old hardcoded values Passed through from configure.ac via manpages.am Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit acf2173b321749c42d29d858d3521a4d506c732e Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Jun 16 20:12:03 2011 -0400 Install xml versions of specs even if HAVE_XMLTO is false DocBook/XML input source is also a useful output format that can be viewed with an XML viewer or editor and by some O/S help system. Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 44890b3e266116ae71bfca2590e5fd9cdfbdb69b Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Jun 16 20:11:52 2011 -0400 Install target dbs alongside generated documents This matches a change in xorg-sgml-docs whereby the masterdb will look for the target dbs into the same location as the generated documents. The target dbs are now installed alongside the generated documents. Previously they are installed in $prefix/sgml/X11/dbs alongside masterdb which has the potential of installing outside the package prefix and cause distcheck to fail when user does not have write permission in this package. Requires XORG_CHECK_SGML_DOCTOOLS(1.8) which was released 2011-06-11 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a42ef6c940604172e54de110b7d989cb2208f7ef Author: Rob Clark <robdclark@gmail.com> Date: Tue Jun 14 11:45:38 2011 -0500 EXA: fix typo The incorrect drawable deltas were applied if dst was a redirected window. Resulting in a bogus region passed to prepare_access_reg(). Signed-off-by: Rob Clark <rob@ti.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4edf49d032028aa4b9887d02b926b0c372c4451d Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:18 2011 +0200 dmx/examples: Fix missing key_click_percent assignment. Thanks to gcc's -Wunused-but-set-variable, stop ignoring the percent parameter, and add it to the XKeyboardControl structure before the XChangeKeyboardControl call. This warning goes away accordingly: | CC xbell-xbell.o | xbell.c: In function ‘main’: | xbell.c:74:22: warning: variable ‘percent’ set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 33dad2b74e3489c8a6b5fa574172d6cd2b6de037 Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:17 2011 +0200 hw/dmx: Stop using variables for text widgets. They are unused in the sense they're not getting any callback set up, so there's no point in storing them into variables. Keep the initial alignment of the parameters to try and reduce the diff noise. Those warnings go away accordingly: | CC xdmxconfig-xdmxconfig.o | xdmxconfig.c: In function ‘main’: | xdmxconfig.c:881:29: warning: variable ‘quittext’ set but not used [-Wunused-but-set-variable] | xdmxconfig.c:880:53: warning: variable ‘abouttext’ set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 34a9f2a90d34a2ab7ecf56d329e75e8da569f939 Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:17 2011 +0200 xfixes: Remove unused variable. The last use of pScreen in ProcXFixesSetPictureClipRegion was removed in aa7096ca6f108e399d9916639cf20c57f9776305 so remove it entirely. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit ad0d0833d45ea24d7af1f724b9905133fe3b065f Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:17 2011 +0200 xfixes: Mark some variables as unused. Calling Unwrap() is just a way of performing an assignment while keeping a backup of the original value. In the CursorCloseScreen function, the backup value doesn't seem to be useful, but Unwrap() is used anyway (probably to stay in line with other functions). As a consequence, mark those variables as unused. The following warnings go away accordingly: | CC cursor.lo | cursor.c: In function 'CursorCloseScreen': | cursor.c:186:26: warning: variable 'display_proc' set but not used [-Wunused-but-set-variable] | cursor.c:185:24: warning: variable 'close_proc' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit f41ac25d932ef34ab912201ab5ce65f85f2ff171 Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:17 2011 +0200 miext: Mark some variables as unused. There's no use for the values set through the various macro calls (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused. The following warnings go away accordingly: | CC shpacked.lo | shpacked.c: In function 'shadowUpdatePacked': | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar8.lo | shplanar8.c: In function 'shadowUpdatePlanar4x8': | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar.lo | shplanar.c: In function 'shadowUpdatePlanar4': | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_180.lo | In file included from shrot16pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270.lo | In file included from shrot16pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270YX.lo | In file included from shrot16pack_270YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90.lo | In file included from shrot16pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90YX.lo | In file included from shrot16pack_90YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack.lo | In file included from shrot16pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate16': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_180.lo | In file included from shrot32pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_270.lo | In file included from shrot32pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_90.lo | In file included from shrot32pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack.lo | In file included from shrot32pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate32': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_180.lo | In file included from shrot8pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_270.lo | In file included from shrot8pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_90.lo | In file included from shrot8pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack.lo | In file included from shrot8pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate8': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrotate.lo | shrotate.c: In function 'shadowUpdateRotatePacked': | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shpacked.lo | shpacked.c: In function 'shadowUpdatePacked': | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar8.lo | shplanar8.c: In function 'shadowUpdatePlanar4x8': | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar.lo | shplanar.c: In function 'shadowUpdatePlanar4': | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_180.lo | In file included from shrot16pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270.lo | In file included from shrot16pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270YX.lo | In file included from shrot16pack_270YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90.lo | In file included from shrot16pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90YX.lo | In file included from shrot16pack_90YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack.lo | In file included from shrot16pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate16': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_180.lo | In file included from shrot32pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_270.lo | In file included from shrot32pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_90.lo | In file included from shrot32pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack.lo | In file included from shrot32pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate32': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_180.lo | In file included from shrot8pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_270.lo | In file included from shrot8pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_90.lo | In file included from shrot8pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack.lo | In file included from shrot8pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate8': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrotate.lo | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit fe6f489d21d77aacf0a073883625619018d764b3 Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:17 2011 +0200 fb: Mark some variables as unused. There's no use for the values set through the various macro calls (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused. The following warnings go away accordingly: | CC libfb_la-fb24_32.lo | fb24_32.c: In function 'fb24_32ReformatTile': | fb24_32.c:544:19: warning: variable 'newYoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:544:10: warning: variable 'newXoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:543:19: warning: variable 'oldYoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:543:10: warning: variable 'oldXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbfill.lo | fbfill.c: In function 'fbFill': | fbfill.c:72:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:72:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | fbfill.c:100:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:100:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | fbfill.c:142:20: warning: variable 'tileYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:142:10: warning: variable 'tileXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbgc.lo | fbgc.c: In function 'fbPadPixmap': | fbgc.c:92:19: warning: variable 'yOff' set but not used [-Wunused-but-set-variable] | fbgc.c:92:13: warning: variable 'xOff' set but not used [-Wunused-but-set-variable] | fbgc.c: In function 'fbCanEvenStipple': | fbgc.c:166:23: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbgc.c:166:13: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbpush.lo | fbpush.c: In function 'fbPushPixels': | fbpush.c:238:20: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbpush.c:238:10: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 8da16898d9de5da1f80b789f0b371070968285f8 Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:17 2011 +0200 fb: Simplify logic, get rid of set but unused variable. wrapped is only useful is FB_ACCESS_WRAPPER is set; simplify the logic accordingly, and only set it when that's defined. The following warning goes away accordingly: | CC libfb_la-fbarc.lo | fbarc.c: In function 'fbPolyArc': | fbarc.c:71:11: warning: variable 'wrapped' set but not used [-Wunused-but-set-variable] Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 9a8bfc2c06f0a9206b64ae01a783cf5513f021a6 Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:16 2011 +0200 configure: Bump dependency on xproto. Bumping this dependency means some additional macros can be used, like _X_UNUSED. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 9da5aa09d70e26dd4d2ef878a21317dae7bf24de Author: Cyril Brulebois <kibi@debian.org> Date: Tue May 24 18:33:11 2011 +0200 Xext: Fix buggy checks. XvMCScreenKey is defined as XvMCScreenKeyRec's address, so will never be NULL. Use the check proposed by Alan Coopersmith and Jeremy Huddleston instead. Those warnings go away accordingly: | CC xvmc.lo | xvmc.c: In function 'ProcXvMCListSubpictureTypes': | xvmc.c:490:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] | xvmc.c: In function 'XvMCExtensionInit': | xvmc.c:671:21: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] | xvmc.c: In function 'XvMCFindXvImage': | xvmc.c:749:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 778309fd0ef6b586468c1a3b569e3548503459ee Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jun 14 13:23:00 2011 -0700 XQuartz: GLX: Fix a -Wformat-security compilation warning Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 34e2598f0ad247071bd6a4312d9014d6e3b2305a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jun 14 11:18:50 2011 -0700 XQuartz: GLX: Use _glapi_create_table_from_handle to create out dispatch table Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ecec578e35f91a2cbc5d07bc8d45241af7bb585f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jun 14 12:51:04 2011 -0700 glx: Add _glapi_create_table_from_handle _glapi_create_table_from_handle was recently added to mesa to ease creation of a _glapi_table. This commit brings this API over to xserver for use in XQuartz (next commit). The API was generated with scripts from current mesa followed by various script-foo to remove entries that are not in the server and add those which are still in the server but not in mesa (CullParameterdvEXT and CullParameterfvEXT) Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit c3df4df40761760b281a21f63336ca955670f7bc Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Jun 5 21:59:13 2011 -0400 XQuartz: Add missing include for <pthread.h> BuildFix for Leopard and earlier. https://trac.macports.org/ticket/29717 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 08a7246f43c9f18079219a1c982bed558722f545 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 14:21:39 2011 +1000 dix: rename ProcessRawEvents to dix/events.c:DeliverRawEvent No functional changes, prep work for future changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 0aa45c5c53e2e7ba0723f5a12c1a5f5d4baab933 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 14:19:45 2011 +1000 Xi: use temporary variable for filter. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a1beae635caf81ec31a8998687df0ae92b505fda Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 12:14:32 2011 +1000 dix: split DeliverEventToWindowMask up a bit more. Move out the actual event delivery, it needs to be used from elsewhere. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 58e4831ed68c2fbc219c7250e9837e76a73a6432 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 11:43:50 2011 +1000 dix: rename DeliverEventsToClients to DeliverEventsToWindowMask To avoid confusion with a future patch and it better describes what this does anyway - delivering events to all clients that have the event mask on the window. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 37a53f15b0dfa1b25f7e3e826c7c945453398ac5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 11:40:56 2011 +1000 dix: split client list retrieval out of DeliverEventToClients No functional change, but "other" was renamed to "clients". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 02d11af01211da55e9d93fe0e1851a0c6fe57472 Merge: bf9fd0a ab0df72 Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 7 12:31:15 2011 -0700 Merge remote-tracking branch 'kibi/master' commit bf9fd0a83eef771ee018438f05e2d9f20b43539b Merge: 21eec36 0d14056 Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 7 07:45:22 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit 0d140567ba2b5bf364265dba07de519f691c67a1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 7 10:42:50 2011 +1000 dix: fix crashers with floating device. dc57f89959e549403f8488eb9f23425bd7118b22 accidentally reversed the conditions. in dix/events.c we try to detach floating devices. This leads to a NULL-dereference on GetMaster()->id. in dix/getevents.c we try to get the master device for the floating slave and dereference it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 21eec367d0d9c142458f973062e17add4f693033 Author: Nicolas Kaiser <nikai@nikai.net> Date: Mon Jun 6 16:53:41 2011 +0200 randr: void function cannot return value Providing an argument to return in a function with void return type is not allowed by the C standard, and makes the Sun compilers unhappy. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ab0df72cd33f011cc48736cfbfce9bbe9c359a80 Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 03:21:18 2011 +0200 xkb: Fix case checks for Latin 4. That one was missing _XkbKSLower: XK_kra: U+0138 LATIN SMALL LETTER KRA Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 9eb6e34c2dd09af714400ce6a1063477d7a64776 Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 03:12:44 2011 +0200 xkb: Fix case checks for Latin 2. Those ones were getting _XkbKSLower for no reasons: XK_ogonek: U+02DB OGONEK XK_doubleacute: U+02DD DOUBLE ACUTE ACCENT Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 2b88189863579eb377bca617465bb76b05fbdebd Author: Cyril Brulebois <kibi@debian.org> Date: Sun Jun 5 03:03:47 2011 +0200 xkb: Fix case checks for Latin 1. That one was missing _XkbKSLower: XK_ssharp: U+00DF LATIN SMALL LETTER SHARP S That one was getting _XkbKSLower for no reasons: XK_division: U+00F7 DIVISION SIGN For reference, XK_multiply was already excluded from the _XkbKSUpper check, it's no big surprise XK_division has to be excluded from the _XkbKSLower check. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit feab04397de2684568dedaaaa8f299cac9f44f8b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Jun 3 02:50:40 2011 -0400 XQuartz: AIGLX: Remove unnecessary includes in indirect.c Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 3fa5d27e46ea8af55dcaaad7a99973c38bd11967 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Jun 2 20:04:04 2011 -0700 XQuartz: AIGLX: Setup dispatch table based on runtime capabilities rather than buildtime This will allow XQuartz built on older systems to pickup capabilities on newer systems and prevent runtime failures when building on newer systems and running on older ones. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit dd5d91fc954450e99d53862900ef4fa6320ff382 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Jun 3 02:34:28 2011 -0400 XQuartz: Remove explicit link against libGL This was indented to force a link against OpenGL.framework's libGL, but it actually resulted in linking against mesa's libGL due to the ordering of -L Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 5115c2c7216fc10acb8a26deb904ad15ef18ce8a Author: Cyril Brulebois <kibi@debian.org> Date: Fri Jun 3 18:09:51 2011 +0200 Xephyr: Mention Xserver's options are also accepted. Originally reported in the Debian BTS: http://bugs.debian.org/582650 Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 408ed1576dbcf93f4bd27bd3b66917b1bba2226b Author: Cyril Brulebois <kibi@debian.org> Date: Fri Jun 3 18:09:48 2011 +0200 xkb: Fix case checks for Latin 8. Spotted by -Wlogical-op: | CC xkbfmisc.lo | xkbfmisc.c: In function '_XkbKSCheckCase': | xkbfmisc.c:104:3: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op] | xkbfmisc.c:118:3: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op] A quick look at the keysymdef.h file (from xproto) suggests the implementor chose to use interval checks to determine the case, but since lines weren't sorted by codepoints, checks were quite wrong. Implement _XkbKSUpper/_XkbKSLower checks based on a grep for CAPITAL/SMALL (respectively) on the Latin 8 part of the said file. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit d9bda34d0df576d155e1d682d5e2a382b8e1ffda Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 1 10:24:43 2011 +1000 test: fix memset size for WindowRec (#37801) X.Org Bug 37801 <http://bugs.freedesktop.org/show_bug.cgi?id=37801> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit bfd8422e8877acf02155ca0bd7fbd2416b029720 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 12:24:21 2011 +1000 Xi: use __func__ instead of function name. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> commit c042a267c40d35b4fb947f4bafdfeb541dd9d772 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 27 10:10:48 2011 +1000 dix: use xi2_get_type instead of manual typecast Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit b75cdb5bf76303162e947173e8ee68253a861272 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 31 10:51:19 2011 +1000 dix: drop x/y back into the right valuators after transformation. If the matrix is used for rotation, the coordinates affected may change. e.g. a valuator mask of (x, nil) becomes [x, lasty] and is rotated to [lasty, x]. Since the second value was unset, we would not drop x back into the mask, resulting in a loss of movement. Thus, drop any value that changed after applying the matrix into the valuators. Thus, the example above becomes (x, nil) → [x, lasty] → [lasty, x] → (lasty, x) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit fe4b818700453b76d9f46749dac5d12540b91e63 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 31 10:23:57 2011 +1000 dix: don't pass x/y to transformAbsolute We passed in the mask, but didn't do anything with it. Move the logic to take the axes out of the valuator masks into transformAbsolute. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 62f1bf96e1ea27e1eff137cb9333f3dd3b014dd0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 1 10:22:44 2011 +1000 test: fix memset size for WindowRec (#37801) X.Org Bug 37801 <http://bugs.freedesktop.org/show_bug.cgi?id=37801> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> commit f94898928dfaf8df648bc3eea7d304826b7ac1b8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 31 14:48:33 2011 +1000 dix: fix an error message. event type, not device type. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8ef0974874f322e3ce2f3e6be4ab3c7e73a7b380 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 19 14:50:17 2011 +1000 test: don't test for double alignment on i386. (#36986) i386 is one of the few architectures that doesn't need double alignment. X.Org Bug 36986 <http://bugs.freedesktop.org/show_bug.cgi?id=36986> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 48b4b778f61daaa161483b510ab520f3fcb84925 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jun 1 21:55:06 2011 -0700 XQuartz: xpbproxy: Correct NSUInteger format strings Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 971193b2750b98b28597ba194ed388e79b3489b6 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jun 1 21:18:03 2011 -0700 XQuartz: ASL: Use xpbproxy subsystem for logging xpbproxy messages Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 7dfd65705ccd3c6e2458d6892282520fe5ed8a6b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jun 1 21:06:53 2011 -0700 XQuartz: ASL: Use GLXAqua subsystem for logging GLXAqua messages Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 19020b23efa15d72349bd833aebddcc64780a615 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jun 1 21:06:08 2011 -0700 XQuartz: ASL: Use xpr subsystem for logging xpr messages Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit a66400f8dba9b7c5b65f9d26996fff677c42d866 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jun 1 20:45:58 2011 -0700 XQuartz: ASL: Update logging to support differnet levels and subsystems Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c0077b41b4c8bb08129db97a2a01d0af55d13fa4 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jun 1 20:54:27 2011 -0700 XQuartz: Add a semicolon after DEBUG_LOG Don't rely on the macro to provide it Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit fbc8aae8e9b5c7b175073f02e79d7ff1d1363a31 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun May 29 01:20:44 2011 -0700 XQuartz: Move -lXplugin to LDFLAGS from LDADD Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 38df706c6b8a339c4267cae7be0881c4362f36da Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue May 31 13:01:05 2011 -0700 XQuartz: GLX: Create a new dispatch table rather than modifying the existing one Fixes regression introduced by b0c665ac0fe6840dda581e4d0d0b76c703d62a7b 0 X11.bin 0x0000000100118293 __glXAquaScreenCreateContext + 684 1 X11.bin 0x00000001001315b0 DoCreateContext + 163 2 X11.bin 0x000000010013509f __glXDispatch + 211 3 X11.bin 0x00000001000c7dad Dispatch + 785 4 X11.bin 0x00000001000b97e5 dix_main + 1022 5 X11.bin 0x00000001000122bc server_thread + 50 6 libSystem.B.dylib 0x00007fff836554f6 _pthread_start + 331 7 libSystem.B.dylib 0x00007fff836553a9 thread_start + 13 http://lists.apple.com/archives/X11-users/2011/May/msg00045.html Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit c5b72fd350bbdfd1facd0ddd5085f238c4cf252a Author: Marko Macek <Marko.Macek@gmx.net> Date: Sat May 21 13:30:59 2011 +0100 DIX: Set backgroundState correctly for root window When we change the root window's background to None, and we've run with -wr or -br for a forced solid background, make sure we also change the background state to BackgroundPixel, so we don't try to lookup either pScreen->whitePixel or pScreen->blackPixel as a pixmap. Signed-off-by: Marko Macek <Marko.Macek@gmx.net> Reviewed-by: Walter Harms <wharms@bfs.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit db228d3d07a6d831f53e4c05c878327ad4d045eb Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 1 11:20:10 2011 -0700 Version bumped to 1.10.99.901 (1.11 RC1) Signed-off-by: Keith Packard <keithp@keithp.com> commit 0643c056512d10be8db223d18d6563292d57e916 Merge: a2e6cfc d45f5b2 Author: Keith Packard <keithp@keithp.com> Date: Tue May 31 23:45:07 2011 -0700 Merge remote-tracking branch 'ajax/xserver-next' commit a2e6cfc18aec1c0027b51572b03ec9f2ab074b56 Merge: bc04065 8d84fd2 Author: Keith Packard <keithp@keithp.com> Date: Tue May 31 23:42:52 2011 -0700 Merge remote-tracking branch 'sandmann/for-keithp' commit d45f5b2493bc0a2882bf972849b5c9c50cd533ca Author: Adam Jackson <ajax@redhat.com> Date: Wed May 25 05:54:35 2011 -0400 fixes: Add support for pointer barriers Implements pointer barriers as specified by version 5 of the XFIXES protocol. Barriers are axis-aligned, zero-width lines that block pointer movement for relative input devices. Barriers may block motion in either the positive or negative direction, or both. v3: - Fix off-by-one in version_requests array - Port to non-glib test harness - Fix review notes from Søren Sandmann Pedersen, add tests to match Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc04065b5ce277f3ac3491ff221a60ef3c7605cf Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri May 20 19:24:34 2011 -0700 "privates.h", line 198: warning: void function cannot return value Providing an argument to return in a function with void return type is not allowed by the C standard, and makes the Sun compilers unhappy. (They actually flag it as an error, unless using a new enough version to be able to downgrade it to a warning with "-features=extensions".) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> commit eadf5021794782fde861d471ed408675f4926b89 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon May 2 19:48:42 2011 -0700 Use XORG_STRICT_OPTION from util-macros 1.14 to set -Werror flags Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 9275b1fb6f82a6971c4177ddd3d5a859a8f24119 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon May 2 19:47:44 2011 -0700 Use XORG_COMPILER_BRAND from util-macros 1.14 to check for SUNCC Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4621bb270a36d35d4ab67f1d7fb47674683dfc5b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 18 15:00:54 2011 +1000 Add a property for device/product ID. In some cases, knowing about the device model number and the device's vendor is important to activate product-specific settings. Since this is nonetheless driver-specific, only provide the property but don't do anything with it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit f26a5b9a994a980ab309bc7f3b4295a4992d81c2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 31 14:43:01 2011 +1000 Xi: add device node property to known properties. Since the server has little choice (or even knowledge) of the actual device node used by the driver, this property is merely provided for standardisation. It is up to the driver to set it to the appropriate value, usually a device node in the form of /dev/input/event0 or similar. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> commit 8d84fd2566f8466b6152724df7eefc73780df093 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Wed May 25 12:14:05 2011 -0400 Don't call pixman_disable_out_of_bounds_workaround() anymore Pixman used to have a workaround for a bug in old X servers, and this function was used to disable that workaround in servers known to be fixed. Since 0.22, which the X server depends on, the workaround doesn't exist anymore, so there is no point disabling it. Reviewed-by: Cyril Brulebois <kibi at debian.org> Signed-off-by: Soren Sandmann <sandmann@cs.au.dk> commit b6c7b9b2f39e970cedb6bc1e073f901e28cb0fa3 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue May 24 16:02:42 2011 -0700 randr: check rotated virtual size limits correctly Commit d1107918d4626268803b54033a07405122278e7f introduced checks to the RandR path that cause RRSetScreenConfig requests to fail if the size is too large. Unfortunately, when RandR 1.1 rotation is enabled it compares the rotated screen dimensions to the unrotated limits, which causes 90- and 270-degree rotation to fail unless your screen happens to be square: X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 153 (RANDR) Minor opcode of failed request: 2 (RRSetScreenConfig) Value in failed request: 0x780 Serial number of failed request: 14 Current serial number in output stream: 14 Fix this by moving the check above the code that swaps the dimensions based on the rotation. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Robert Hooker <robert.hooker@canonical.com> Tested-by: Kent Baxley <kent.baxley@canonical.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 4725d6b0dbb6371af4a1b2fbef851dcfe155514a Merge: 1b2d177 b5d8287 Author: Keith Packard <keithp@keithp.com> Date: Wed May 25 09:40:51 2011 -0600 Merge remote-tracking branch 'whot/for-keith' commit 1b2d17748f0154da142e9b421d4f6a46e4e5a18c Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun May 22 13:50:14 2011 -0700 fbbltone.c: Mark bitmasks as unsigned ints Clears many Sun compiler warnings: "fbbltone.c", line 491: warning: integer overflow detected: op "<<" "fbbltone.c", line 491: warning: integer overflow detected: op "<<" "fbbltone.c", line 491: warning: integer overflow detected: op "<<" "fbbltone.c", line 491: warning: initializer will be sign-extended: -16777216 "fbbltone.c", line 491: warning: integer overflow detected: op "<<" "fbbltone.c", line 491: warning: initializer will be sign-extended: -1 "fbbltone.c", line 495: warning: integer overflow detected: op "<<" "fbbltone.c", line 495: warning: integer overflow detected: op "<<" "fbbltone.c", line 495: warning: integer overflow detected: op "<<" "fbbltone.c", line 495: warning: initializer will be sign-extended: -256 "fbbltone.c", line 495: warning: integer overflow detected: op "<<" "fbbltone.c", line 495: warning: initializer will be sign-extended: -1 "fbbltone.c", line 499: warning: integer overflow detected: op "<<" "fbbltone.c", line 499: warning: integer overflow detected: op "<<" "fbbltone.c", line 499: warning: integer overflow detected: op "<<" "fbbltone.c", line 499: warning: initializer will be sign-extended: -65536 "fbbltone.c", line 499: warning: integer overflow detected: op "<<" "fbbltone.c", line 499: warning: initializer will be sign-extended: -1 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit b5d828789c092c994722a896c252212e2b3614ab Author: Simon Thum <simon.thum@gmx.de> Date: Thu Mar 10 21:03:40 2011 +0100 xserver: remove AbsoluteClass, breaking the A(P|B)I This struct was unused and has been effectively removed in commit 633b81e8ba09cc6a1ea8b43f323874fda2cf0bde Refs: xorg-server-1.10.0-133-g633b81e Remove the remainder, with an ABI bump to 13.0. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c05c8640f13708384e77579e7714ca846fa93f5c Author: Oleh Nykyforchyn <oleh.nyk@gmail.com> Date: Thu May 19 09:39:52 2011 +0300 xfree86: Allow "MatchLayout" statements in config files Usage example (tested on a dual-seat PC): Section "InputClass" Identifier "keyboard-all" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" MatchLayout "!GeForce|!Matrox" Driver "evdev" Option "XkbLayout" "us" Option "XkbOptions" "terminate:ctrl_alt_bksp" EndSection It disables auto keyboard configuration for layouts "GeForce" and "Matrox". Note that "" in patterns means "no Layout sections found", e.g. MatchLayout "GeForce|" is "in layout GeForce or without explicit layout at all". Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 83c059f03463f2d7f41e172afe510d1ca9bba8b0 Author: Tomas Frydrych <tomas@sleepfive.com> Date: Wed May 18 20:49:52 2011 +0100 Xephyr: fix pointer coordinate translation when screen is rotated In the Xephyr case the position of the pointer relative toward the Xephyr window is controlled by the host server without taking into account rotation of the Xephyr screen. Consequently the pointer coords must always be translated when the fb is rotated. Signed-off-by: Tomas Frydrych <tomas@sleepfive.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b387069fafbe549f2091f364e2aa92af6cc21261 Author: Tomas Frydrych <tomas@sleepfive.com> Date: Wed May 18 20:47:52 2011 +0100 Xephyr: added dummy ephyrDeviceCursorCleanup() to avoid crashing The DeviceCursorCleanup in miPointerSpriteFuncRec can no longer be NULL it seems. Signed-off-by: Tomas Frydrych <tomas@sleepfive.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 53ccc54ac71c2655276678e13f0b3d879d691489 Author: Colin Harrison <colin.harrison@virgin.net> Date: Mon May 16 19:31:57 2011 +0100 Fix XWin compilation after updates for input API changes Fix XWin compilation after updates for input API changes in commits e7150db5 8670c46b and 20fb07f4 Also remove a no longer needed InternalEvent* variable Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4c4df3ac0d8162c874b85fede12ffbe42f0062c3 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat May 14 16:23:59 2011 -0700 input: Don't implicitly define verify_internal_event Fixes regression introduced by 56901998020b6f443cbaa5eb303100d979e81b22 mieq.c:159:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue] verify_internal_event(e); ^ 1 error generated. Also includes some other warning cleanups in events.c we're there. events.c:2198:24: warning: equality comparison with extraneous parentheses [-Wparentheses,Semantic Issue] else if ((type == MotionNotify)) ~~~~~^~~~~~~~~~~~~~~ events.c:2198:24: note: remove extraneous parentheses around the comparison to silence this warning [Semantic Issue] else if ((type == MotionNotify)) ~ ^ ~ events.c:2198:24: note: use '=' to turn this equality comparison into an assignment [Semantic Issue] else if ((type == MotionNotify)) ^~ = events.c:2487:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue] verify_internal_event(event); ^ events.c:5909:22: warning: declaration shadows a local variable [-Wshadow,Semantic Issue] DeviceIntPtr it = inputInfo.devices; ^ events.c:5893:18: note: previous declaration is here DeviceIntPtr it = inputInfo.devices; ^ 3 warnings and 1 error generated. events.c:2836:27: warning: incompatible pointer types passing 'DeviceEvent *' (aka 'struct _DeviceEvent *') to parameter of type 'const InternalEvent *' (aka 'const union _InternalEvent *') verify_internal_event(ev); ^~ ../include/inpututils.h:40:56: note: passing argument to parameter 'ev' here extern void verify_internal_event(const InternalEvent *ev); ^ 1 warning generated. Found-by: yuffie tinderbox (-Werror=implicit) Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ba7d1020ac0135ebc8acda4cd57ed48b331e0133 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat May 14 16:31:10 2011 -0700 input: Fix format string for verify_internal_event inpututils.c:577:25: warning: conversion specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat,Format String Issue] ErrorF("%02hx ", *data); ~~~~^ ~~~~~ %02hhx 1 warning generated. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0de7cec90738a7a5020150309866bb0e23b6f479 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 19 15:36:29 2011 +1000 xfree86: bump to video ABI 11 We've broken the ABI with some commit and drivers built against ABI 10 happily segfault now. (The relevant patch is 51f353d0a0d116af16d7d9590cadef6c56328746 which changed the ATOM typedef from unsigned long to uint32_t, thanks to Cyril Brulebois <kibi@debian.org> for figuring this out) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1fb501ad1521cfedaa5cf3052d45a924ef1866cf Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun May 22 10:18:36 2011 -0700 XQuartz: Don't crash if CG increases our display resolution miPaintWindow would cause fbFill() to overwrite pScreen's pixmap which was sized for the old resolution. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 60af79e35ee8546a99d15a1358aac3deabfa22be Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun May 22 09:32:57 2011 -0700 XQuartz: RandR: Don't crash if X11 is launched while there are no attached displays If CG reports no displays when launching, we could crash in RandR. Instead, just provide a fake 800x600 display until we are notified about displays being attached. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit f25ca898c54cb88c7886005fc75a53762c42710b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 19 14:39:22 2011 -0700 XQuartz: Mark functions _X_NORETURN Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 7413886d650aef492ecbfdc4298c2d92d9af5f87 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 19 14:35:56 2011 -0700 XQuartz: Silence clang warnings about shadow declarations X11Application.m:1272:26: warning: declaration shadows a local variable [-Wshadow,Semantic Issue] xp_error e; ^ X11Application.m:1098:36: note: previous declaration is here - (void) sendX11NSEvent:(NSEvent *)e { ^ 1 warning generated. bundle-main.c:648:36: warning: declaration shadows a local variable [-Wshadow,Semantic Issue] int max_files, i; ^ bundle-main.c:594:9: note: previous declaration is here int i; ^ 1 warning generated. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 96ac4e61f4618332d95d1fd0e4799dd82844f90f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 19 14:34:39 2011 -0700 XQuartz: Update DEBUG_LOG to report to ASL Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 384eb45b944a4386eae74a5503423c13b5f2a659 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat May 14 18:33:57 2011 -0700 XQuartz: RandR: Avoid over-releasing if we are unable to determine the current display mode. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 25191648b8db87735a99243697f73036255c1eb6 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat May 14 16:11:32 2011 -0700 XQuartz: Don't call mieqEnqueue during server shutdown Found-by: GuardMalloc Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit fd5f630bc41de73be3b1d26bf9ce3e9ef1badc3b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat May 14 14:09:45 2011 -0700 XQuartz: Fix an array-index-out-of-bounds crasher Found-by: GuardMalloc Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 0e7f61d72c4a929319e57c9b5b777e9413c23051 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat May 14 13:30:20 2011 -0400 doc: use devbook.am for developers documentation Relocate the docs under the doc subdir. Remove redundant xml subdir. The xmlrules set of makefiles are no longer used. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 96c65be39b98cfe035be0a3988dce519549249f3 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat May 14 13:30:19 2011 -0400 doc: relocate xserver.ent in the package root directory This is the appropriate location for reusable configuration and/or makefile artifacts as opposed to picking one of the subdirs where it is used. It shields them from future doc reorg as every subdir will refer to the root package which never changes location. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit dbe26634e4f12eba905540666783c9879aa3a49a Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat May 14 13:30:18 2011 -0400 doc: add external doc references support to Xserver-DTrace This makefile is used to build the 60+ docbooks in xorg. Dtrace is a user document and should be located under doc subdir. This user document can now refer to external user/specs docs or can be referred to by such documnets. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 221507e3bf6fcaa4a4c2e1bc264a1f806b4362c0 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Apr 28 21:16:13 2011 -0400 man: relocate manual pages in the man subdir outside doc The convention is to have the manual pages in a man subdir which is not under a doc dir. The doc dir contains users docs. This will move man pages out of the way for upcoming DocBook patches. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9129beb507642e2414ef1f90d650572325d8c2dc Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Apr 28 21:16:12 2011 -0400 dmx: fix warning for doxygen explicit links Explicit links to functions in another file are not supported. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0d8a5766a39320dedd34a215fc6655f9ac19e8bc Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Apr 28 21:16:11 2011 -0400 dmx: modernize doxygen generation. The configuration and stylesheet were very old. The stylesheet is not checked-in, use the generated one. The header is not checked-in, use the generated one. Add datetime and projectname in default footer. Developer documentation is not installed and not included in tarball. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 622ebb88157b0ed99355419767685dd70ce0f16c Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Apr 28 21:16:10 2011 -0400 dmx: split DocBook/XML and Doxygen makefile targets Maintaining either requires full knowledge of both. It's not obvious one has to check the usage of global variables in devbook.am when maintaining doxygen target. Or vice-versa. Being in their respective directory, one less thing to worry about. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 595460c397a543fe512becd3c432de2a0a68d187 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Apr 28 21:16:09 2011 -0400 dmx/doc: use common makefile for developers documentation The user/specs docs now have external references support. Developers doc are not installed so they do not participate. However, using a similar makefile shared amongst developers document reduces maintenance and is forward looking. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 04011b0bc3b5b59efa0d981866349c4ad0868d8f Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Apr 28 21:16:08 2011 -0400 doc: use common makefile for developers documentation The user/specs docs now have external references support. Developers doc are not installed so they do not participate. However, using a similar makefile shared amongst developers document reduces maintenance and is forward looking. Man pages being out of here, reorg developers docs under the same roof. Drop the obsolete sgml subdir. Reviewed-by Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 531869448d07e00ae241120b59f3aaaa5709d59c Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri May 6 18:18:15 2011 +0300 dri2: Don't send so many needless invalidate events Only send invalidate events for drawables if some client has requested some buffers. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit ba5540221f2a46133371b4ff0d527b1a0a1443b1 Merge: 6347a0b 728d0bf Author: Keith Packard <keithp@keithp.com> Date: Fri May 13 13:59:36 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit 6347a0b802812bb185ada1bf0951add306935184 Merge: 4d02c53 f144fb7 Author: Keith Packard <keithp@keithp.com> Date: Fri May 13 13:54:29 2011 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 4d02c5397114ac4d15e794908f0708427e258261 Merge: 043c175 eac37f3 Author: Keith Packard <keithp@keithp.com> Date: Fri May 13 13:52:18 2011 -0700 Merge remote-tracking branch 'vsyrjala/composite_validatetree_2' commit f144fb771f2e0665677aa88d08778899f666a1d5 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri May 13 09:10:42 2011 -0700 XQuartz: Don't circumvent NDEBUG If someone wants to turn off asserts with NDEBUG, let them. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit f46835a09662f71f2cb90540609c34561d8af87f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed May 11 15:23:17 2011 -0700 XQuartz: Redirect stdout/stderr to asl In order to improve logging in XQuartz, stdout and stderr should be redirected to asl (syslog). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 5bc05d96f883add324bab338ffb9b9409cf45b2c Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 12 15:45:29 2011 -0700 XQuartz: Add a LOGGING section to our man page Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c18b7165f971cbf6b634ccf670eb4aa9840eb9e4 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 12 18:29:23 2011 -0700 XQuartz: stub: Log directly to ASL rather than stdout/stderr Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit d694601591d2a86a437c5150015d9889e2fe16fc Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 12 15:15:40 2011 -0700 Fix a typo: laucnd instead of launchd Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 728d0bf20ed8e2612b100fca6526705fa6e1eef4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 11 13:35:39 2011 +1000 dix: replace CORE_EVENT and XI2_EVENT macros with inline functions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit ffd4874798ba54f86acac75779a15b4babeaa5f3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 11 12:20:50 2011 +1000 include: add version_compare helper function Compare two version numbers in the major.minor form. Switch the few users of manual version switching over to the new function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit c4f9c3a07dbb05b81c8e2193a083102f710ebb27 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 11 11:43:16 2011 +1000 dix: use a tmp variable instead of multiple rClient(other). no functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit dc45d5816dd65168645f0017394eebfc5599d698 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 14 15:59:08 2011 +1000 Xi: split DeviceStateNotify delivery into a separate function Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 5bcc22757e6e1f24ee2bfec65f68a5f567300532 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 14 15:43:56 2011 +1000 dix: return deliveries from DeliverGrabbedEvent This isn't currently used by any of the callers but it will likely be in the future. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 2054ca73060a20b5a3025e8d5ef68182149484d3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 14 15:09:39 2011 +1000 dix: move the grab activation condition into a if block. Rather than 3 conditions with if (deliveries && ...), have one block with the three in them. No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 236ed6f50675dc0303a505ac6f0418c515438fe1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 12 14:04:37 2011 +1000 dix: split out client delivery from DeliverEventsToWindow No real functional changes, this is just for improved readability. DeliverEventsToWindow used to return an int to specify the number of deliveries (or rejected deliveries if negative). The number wasn't used by any caller other than for > 0 comparison. This patch also changes the return value to be -1 or 1 even in case of multiple deliveries/rejections. The comment was updated accordingly. A future patch should probably use the enum EventDeliveryState for DeliverEventsToWindow. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 536ca28f1b0b4d8715a41b8acc5f30364c833f9b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 12 13:44:30 2011 +1000 dix: split out window owner event delivery from DeliverEventsToWindow No functional changes, just for readability. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit a311a03135f9734aa4f7dc0f2fa0e4c91768343b Author: Jamey Sharp <jamey@minilop.net> Date: Wed May 11 14:08:28 2011 -0700 dix: split implicit grab activation into a separate function. I'm not sure I like splitting the check for button-press event from the code which makes assumptions about that check. How about replacing patches 3 and 4 with this patch instead? Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a558a66d249cd51d3d675b20cc3a76651fd87930 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed May 11 17:27:52 2011 -0700 configure.ac: XQuartz: Fix support for the deprecated --with-launchd-id-prefix Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c89a6f824eaf647d2b182f79fbd78f5bd1c3a27f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue May 10 23:42:46 2011 -0700 XQuartz: Don't call into CoreFoundation after fork() and before exec() After fork()ing, we should just limit ourselves to setting up the environment, file descriptors, and exec()ing. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c8674a328c68f03de6e4fad7790a595cdfc18736 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 14 16:45:56 2011 +1000 dix: replace unneded goto with break. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 20fb07f436f7d4a0f330b2067a93a5a4829fccf5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Apr 15 10:07:10 2011 +1000 input: remove DDX event list handling The current approach to event posting required the DDX to request the event list (allocated by the DIX) and then pass that list into QueuePointerEvent and friends. Remove this step and use the DIX event list directly. This means that QueuePointerEvent is not reentrant but it wasn't before anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 8670c46bdfdade64e63119d2ebbd5ef63b6fa2c3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 14 22:05:41 2011 +1000 input: replace EventListPtr with InternalEvent array EventListPtr is a relic from pre-1.6, when we had protocol events in the event queue and thus events of varying size. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit e7150db5350bc2113ff4126019b489847a4dc217 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Apr 11 15:48:15 2011 +1000 input: Provide Queue{Button|Keyboard|Proximity}Event helpers Don't require every caller to use GPE + mieqEnqueue, provide matching Queue...Event functions instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 1b8593a6c12315b1071a4fa586151e12f46458f5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 9 15:13:17 2011 +1000 xfree86: print the device ID to the log when adding a device. Sometimes the name isn't enough, it's handy to see the device ID's from the log file. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3231962db826f5efd431596a309c96e907a191d1 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue May 3 03:20:23 2011 +0100 XKB: Fix sense inversion for core MapNotify events Due to an unfortunate sense inversion incident while switching from a if (foo) { ... } to if (!foo) continue; style in f06a9d, we punished any client who attempted to use XKB to restrict the MapNotify events they wanted by sending them exactly the events they _didn't_ want, and nothing else. NewKeyboardNotifies (coming from a client setting the map with an XKB request, when switching between master devices, etc) weren't affected, but this would impact anyone using xmodmap-style core requests. Could explain a fair bit. Clarified the comments while I was at it. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 460a377ef2d645d9ae38a8356fb248ccc47bed4a Author: Daniel Stone <daniel@fooishbar.org> Date: Tue May 3 03:07:50 2011 +0100 XKB: Send XKB events for all devices to all clients We were using XIShouldNotify(client, device) as a test for whether or not to send XKB map/state/etc changed events, which limits it to only sending events for the current ClientPointer/ClientKeyboard for that client. While this makes perfect sense for core events (e.g. MappingNotify), XKB events carry a device ID, so are safe to send to all clients for all devices. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit a79d4544fee806a25447d0147535ebc5a1cae6b9 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue May 3 03:03:06 2011 +0100 XKB: Send NewKeyboardNotify for dev before its master/slaves When we change the keymap on a device, send the NewKeyboardNotify for that device before we copy the keymap to and notify for its attached master/slave devices. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit c7634498d4cd42c8571805122224dc2d0e44a585 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue May 3 02:59:53 2011 +0100 XKB: Remove duplicate keymap-copying loop Previously we had: foreach (device + slaves of device) { XkbCopyDeviceKeymap(i, device); [...] } if (device was last slave of its MD) { XkbCopyDeviceKeymap(master, device); } and now: foreach (device + slaves of device + MD if device was last slave) { XkbCopyDeviceKeymap(i, device); [...] } As an extra bonus, when changing the keymap on a slave device, we now ensure the LED info on the master is kept in sync. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit b8540d18c7d3a0f93f9e2565a410986eddedcecb Author: Daniel Stone <daniel@fooishbar.org> Date: Tue May 3 02:50:48 2011 +0100 XKB: Simplify a loop in ProcXkbGetKbdByName Replace: for (stuff; things; etc) { if (misc || other) { [...] } } with: for (stuff; things; etc) { if (!misc && !other) continue; [...] } Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 72b6639c83df74767094a5e0c2861fdc5ea03ecd Author: Daniel Stone <daniel@fooishbar.org> Date: Tue May 3 02:39:55 2011 +0100 XKB: Don't send unnecessary NewKeyboardNotifies In the XKB GetKeyboardByName handler, we had the following pseudocode: if (device was last slave of its MD) { XkbCopyDeviceKeymap(master, slave); XkbSendNewKeyboardNotify(slave, ¬ify); } Even if the SendNewKeyboardNotify line nominated the correct device, which it didn't, it's unnecessary as XkbCopyDeviceKeymap already sends a NewKeyboardNotify on the destination device. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 70cef8d8baf058bacaff87ef49e3851628269597 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jan 19 20:42:10 2011 +0000 Input: Simplify CheckPassiveGrabsOnWindow loop Instead of a mega never-ending if branch with no else, just continue to the next iteration of the loop if the conditions aren't met - pretty much entirely reindentation. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 00ba884556c675b2b25e116f5ab4eb4590b6dd56 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jan 19 20:38:44 2011 +0000 Input: Make CheckPassiveGrabsOnWindow take InternalEvent Previously, it only took DeviceEvents, but it would be much more useful if it took InternalEvents. Any event that activates a grab must still be a DeviceEvent, so put in a check to enforce this. Change all callers to make the appropriate casts. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 56901998020b6f443cbaa5eb303100d979e81b22 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 5 08:48:19 2011 +1000 input: change CHECKEVENT macro to verify_internal_event function The macro is sufficient if called during a development cycle, but not sufficient information when triggered by a user (e.g. https://bugzilla.redhat.com/show_bug.cgi?id=688693). Expand what this does to print the event content and a backtrace, so at least we know where we're coming from. Only the first 32 bytes are printed since if something goes wrong, the event we have is almost certainly an xEvent or xError, both restricted to 32 bytes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit b47d2e43eb2cb3817c995d1f7e58500fb40efa2b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 5 09:04:41 2011 -0700 XQuartz: Make a copy of args for our crash reporter vsnprintf Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit bf2059b07a97e5e579c13c2c9d49707093427dc2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Apr 15 14:06:20 2011 +1000 input: Only release SD buttons for explicit floating/reattachment (#36146) Grabbing an SD device temporary floats the device but we must not release the buttons. Introduced in commit 9d23459415b84606ee4f38bb2d19054c432c8552 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 25 11:08:19 2011 +1000 dix: release all buttons and keys before reattaching a device (#34182) X.Org Bug 36146 <http://bugs.freedesktop.org/show_bug.cgi?id=36146> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit eac37f32b85b631d94ee3ba11fa65b9d2cb72c38 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Apr 13 21:46:20 2011 +0300 composite: Recompute clipping when changing between manual and automatic redirection Call compMarkWindows() when changing between manual and automatic redirection modes. Otherwise the window clipping won't be recomputed correctly. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> commit f2001b0f6dffa0a8f05def4a86ea37c4c91db724 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Apr 13 21:45:43 2011 +0300 composite: Fix pWin->redirectDraw when changing between manual and automatic redirection compAllowPixmap() is not called when changing between manual and automatic redirection modes. That means pWin->redirectDraw is left with an incorrect value, and miComputeClips() gets confused whether the window is supposed to be treated as transparent or not. Fix the issue by updating pWin->redirectDraw in compCheckRedirect() even when not calling compAllocPixmap(). Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> commit 74663e61528346aeea9c11908b6980b51dcaeb68 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Mon Dec 20 16:37:24 2010 +0200 composite: Copy the window contents back from the pixmap Since extra expose events are no longer generated during window unredirection, the window contents must be preserved by the server. So copy the window contents back from the pixmap. The copy can only be done after the clips have been recomputed, so delay the copy and the pixmap destruction until ValidateTree is done. Window borders are restored by HandleExposures and thus don't need to be copied back. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 193ecc8b453b22b3e60248b9354c768dbd405598 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Dec 17 23:46:34 2010 +0200 composite: Get rid of the internal UnmapWindow+MapWindow cycle Eliminate the internal MapWindow+UnmapWindow cycle around window redirection changes. Instead do the work in a single pass by marking the afected windows and calling ValidateTree and HandleExposures directly. This gets rid of unnecessary expose events, and invalid ClipNotify calls during rediredction changes. Now ClipNotify will only get called with the final clip values, and expose events are only sent to areas that actually got exposed. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a6ae91746212203a19450ac955fbb7abffff1ed3 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Mon Dec 20 16:30:52 2010 +0200 composite: Initialize borderClip with current values ValidateTree needs a valid borderClip so initialize the parent constrained border clip with the window's current borderClip in compRedirectWindow. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit ce9eff9e4c30deb16f059ed84b436d37da45d5d5 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Mon Dec 20 16:33:36 2010 +0200 composite: Call ValidateGC after ChangeGC ChangeGC changes the GC, so ValidateGC should be called after it, not before. Also pass NullClient instead of serverClient to ChangeGC() since we know the changed values to be valid, and setting serverClient->errorValue seems pointless anyway. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 3ac220d6cc386c9ab9995e5b83463c40330e18c2 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue May 3 10:54:09 2011 -0700 XQuartz: prefs_copy_url and prefs_get_copy return retained objects No functional change. This just annotates the return policy. Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit bac8d12555dd44b2139be0696629910cd4d8c782 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue May 3 10:36:19 2011 -0700 XQuartz: Ensure that {CF,NS}_RETURNS{,_NOT}_RETAINED are defined These will be used in subsequent patches to denote proper retain counts in XQuartz Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 043c1758652259fd12b88ae37720fe6e93eda76b Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue Apr 19 19:02:54 2011 -0700 Clean up memory better when GetVisualInfo fails in ProcDbeGetVisualInfo Use calloc to initialize pScrVisInfo array so we don't have to check which ones were already initialized when freeing them all. On failure, set rc if necessary, and jump to code at end that already frees all the necessary allocations and return rc. Fixes parfait reported error: Error: Memory leak (CWE 401) Memory leak of pointer 'pScrVisInfo' allocated with malloc((count * 16)) at line 724 of dbe/dbe.c in function 'ProcDbeGetVisualInfo'. 'pScrVisInfo' allocated at line 693 with malloc((count * 16)). pScrVisInfo leaks when rc != 0 at line 710 and j >= i at line 716. [ This bug was found by the Parfait 0.3.7 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit dadb0791ebfd05cd3bb82d4addf0fbc21aad6fbb Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue Apr 19 18:53:22 2011 -0700 Only free pContext once when AddResource fails in ProcRecordCreateContext Since RecordDeleteContext frees its argument, don't fall through to free it again. Error: Double free (CWE 415) Double free of pointer 'malloc(1072)' defined by malloc at line 1964 of record/record.c in function 'ProcRecordCreateContext'. Previously freed at line 1960 with RecordDeleteContext. 'malloc(1072)' was allocated at line 1926 with malloc. [ This bug was found by the Parfait 0.3.7 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 73de54210446e9eca81b96ea6775ee5ea1a31d75 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Jan 24 08:40:10 2011 +1000 Input: Fix event size confusion in CheckPassiveGrabsOnWindow We were just storing a DeviceEvent, but allocating enough space for an InternalEvent. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Cyril Brulebois <kibi@debian.org> commit 706326491011be8cecb9b56c06f7241b7cbd425f Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jan 18 20:16:36 2011 +0000 Input: Add DeepestSpriteWin function Does what it says on the box: returns the deepest child window in a given sprite's trace. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 65b54548dce80c8e8ff5ff91fc4f0659e9b2d921 Author: Chase Douglas <chase.douglas@canonical.com> Date: Tue Jan 18 20:08:09 2011 +0000 Input: Pass co-ordinates by reference to transformAbsolute With the upcoming XI 2.1 touch work, the co-ordinate values will need to be passed by reference, rather than modified in-place. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a14a0c711397ff7ca0220946010300fc1b2a6e67 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Apr 22 22:19:39 2011 -0700 Move event filter initializer out of the structure itself When kept in the structure, it causes the entire MAXDEVICES * 128 masks to be stored in the data segment and loaded from the file, and also leads to worries about later generations inheriting changes across server reset. text data bss dec hex filename Before: 91837 20528 32 112397 1b70d .libs/events.o After: 92277 48 20512 112837 1b8c5 .libs/events.o Before: 3013384 122696 163156 3299236 3257a4 Xorg After: 3013832 102216 183636 3299684 325964 Xorg File size before: 4337008 Xorg File size after: 4316568 Xorg Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 8d229c4cf9e5bde78373ef3dd32708817ac97152 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Mar 11 15:43:14 2011 -0800 Make xorg.conf.example rule compatible with Solaris make Solaris make won't substitute $< in explicit rules, only implicit ones Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> commit c6029246ddcf5ead3884dbf2ab4f57e0c3586e93 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Wed Feb 2 17:00:25 2011 -0800 Move Xinput server API documentation from libXi to doc/xml Documentation is quite out of date but still fits better here than in the client library. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0fc7ec6dd504aa03e1a1b18c60942c0c8c8b701b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Apr 29 11:06:18 2011 -0700 XQuartz: Fix incorrect typedefs with XPLUGIN_VERSION < 4 Ok, this time for sure... how many brown bags can I fit over my face? Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 29d471663e4414a3cdf154fd032d74381a921ae0 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 18:09:11 2011 -0700 XQuartz: Use a rwlock instead of a mutex to protect window_hash in the pthread case Concurrent reads are acceptable, so using an rwlock should be better. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 5cb31cd0cbf83fff5f17a475e7b0e45246b19bf3 Merge: 0f284f0 4d8735d Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 29 09:59:49 2011 -0700 Merge remote-tracking branch 'jturney/remove-opengl-spec-download' commit 4d8735d388c3c6af27ef3d6a645e38e556f392f4 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Apr 6 16:26:45 2011 +0100 hw/xwin: wglext.h should be provided by w32api, rather than downloaded wglext.h should be provided by the w32api package, rather than downloaded. if it's not, do 'wget -P /usr/include/w32api/GL http://www.opengl.org/registry/api/wglext.h' Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> commit a50878682cda541766c830e49ab406c78b38d903 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Apr 6 16:23:45 2011 +0100 configure: Look for Khronos OpenGL spec files using pkg-config Look for Khronos OpenGL spec files using pkg-config, rather than downloading them Also add a --with-khronos-spec-dir=PATH configure option so XWin can be directed where to find these files without using the khronos-spec-files package XWin with AIGLX requires OpenGL spec files in order to generate wrapper code which: (1) thunks from the glapi dispatch table which uses the default cdecl calling convention to native GL functions using the stdcall calling convention. (2) performs function address lookup for OpenGL 1.2+ functions, which are treated as extensions and so not directly linkable. v2: KHRONOS_SPEC_DIR is only valid when XWIN_GLX_WINDOWS is defined. Avoid 'make dist' seeing invalid dependencies by only including rules using KHRONOS_SPEC_DIR if XWIN_GLX_WINDOWS is defined Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> commit 0f284f0f42f26a242eb3153787f2e98b6b88dff8 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Apr 27 22:12:59 2011 -0700 XQuartz: BuildFix to build correctly with XPLUGIN_VERSION < 4 This fixes a regression introduced by d79cc14a51f3e8d4d2f66aad055092672cab1526 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit f6d4e75ec55ac6812f9dead42ecdffb9614578c7 Merge: ec9ea40 4318e6a Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 27 12:08:51 2011 -0700 Merge remote-tracking branch 'jturney/master' commit ec9ea4017885cefe5519a4e890b0ff1a5518235a Merge: c6cb70b 6f29dbf Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 27 12:01:56 2011 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 4318e6a147e78b2663c5e0ea6ba0d351a1e87f98 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Mar 5 17:34:42 2011 +0000 Cygwin/X: Handle failure during winScreenInit() Handle failure during winScreenInit() a bit more cleanly, rather than crashing This avoids a crash with 'XWin -fullscreen -screen 0 @2 -screen 1 @1' Also document that fullscreen may only be applied to one screen. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit ce6136f8c553bbc6d3e3affa0faa2afbf8054f44 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Mar 23 20:06:33 2010 +0000 Cygwin/X: Make winOverrrideStyle() thread-safe Make winOverrrideStyle() thread-safe winOverrideStyle() is called from the internal WM client thread. Accessing server-internal data structures to get window name and class 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 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 0c603509eb7f9c83baf4e00b4558dce78f897ebf Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Feb 11 13:15:40 2011 +0000 Cygwin/X: Cosmetic fixes to logging of result from X*TextPropertyToTextList() Report XLocaleNotSupported result from X*TextPropertyToTextList() Fix formatting for unknown results reported for X*TextPropertyToTextList() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 71550a8665d861384332d81239ca0c1586a17137 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Jan 28 20:17:22 2011 +0000 Cygwin/X: Decorate function pointers retrieved via GetProcAddress with WINAPI Decorate function pointers retrieved via GetProcAddress which are currently missing it with WINAPI, to ensure stdcall convention is used when calling them. This fixes a crash currently seen when compiled -O2 and the -screen option uses a size and monitor number e.g. -screen 0 1280x1000@2 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 38a1f5c613a48ef9fd6ba043bc3028f487750d3a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Oct 12 17:12:02 2010 +0100 Cygwin/X: Don't make InputOnly windows visible Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit bd288c3458bc1ba2cbb4c8416e5b2dfd849581e6 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Jul 22 18:36:51 2010 +0100 Cygwin/X: Fix a GDI bitmap resource leak of window icons Ensure any icon created specially for a window is destroyed when the window is destroyed Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 19e764eee0c8b74d877fb2b1d6aedc933976660e Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Jul 21 18:11:13 2010 +0100 Cygwin/X: Internal WM workaround for Java AWT bug Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT doesn't explicitly know about (See sun bug #6434227) XDecoratedPeer.handleConfigureNotifyEvent() only processes non-synthetic ConfigureNotify events to update window location if it's identified the WM as a non-reparenting WM it knows about (compiz or lookingglass) Rather than tell all sorts of lies to get XWM to recognize us as one of those, simply send a synthetic ConfigureNotify for every non-synthetic one Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit c5a612fc18a7f5c542fca580494e2c66ecfc2159 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Apr 16 21:55:01 2010 +0100 configure: Let configure --enable/disable-aiglx control building of AIGLX for all DDXs Let configure --enable/disable-aiglx control building of AIGLX for all DDXs. Currently we can't use --enable/disable-aiglx to control if Xwin DDX is built with AIGLX enabled, as at the moment it's forced off if we aren't building the X.Org DDX DRI or DRI2 loader Rearrange things a bit, introducing a new automake conditional, AIGLX_DRI_LOADER to specifically indicate if the X.Org DDX DRI/DRI2 loader convenience library should be built, and replace the previous X.Org DDX-specific uses of the AIGLX conditional with that As before, AIGLX_DRI_LOADER is only enabled if --enable-glx, --enable-aiglx and at least one of --enable-dri or --enable-dri2 are enabled This allows the general conditional AIGLX to control if AIGLX is built for the XWin DDX as well The C #define AIGLX set by AC_DEFINE(AIGLX) seems to be obsolete, I can't find anything which checks it Updated for ajax's "glx: Make --disable-dri not disable AIGLX" patch, which allows DRI2 to be enabled independently of DRI1 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> commit 6f29dbf5e36bef5ecb08f02d367988dee0f9f1cd Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Apr 25 22:00:41 2011 -0700 XQuartz: Use ErrorF rather than fprintf to log errors Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit cb083b05c469352ef80e1005a29ac320f2e4e096 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Apr 25 21:25:10 2011 -0700 XQuartz: stub: Dead code removal Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 72ed7551f494c61283a7ac3d7b570eac39cc9786 Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com> Date: Mon Apr 25 10:38:17 2011 -0700 XQuartz: pbproxy: LP64: Fix itteration through XGetWindowProperty where sizeof(long) != 4 http://xquartz.macosforge.org/trac/ticket/476 Signed-off-by: Emanuele Giaquinta <emanuele.giaquinta@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 0a60192a85ba9f64b522da181c2fe8a5b93b79df Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Apr 24 22:01:48 2011 -0700 XQuartz: Enable logging to a file for better debugging Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit de4023f194c561b74f8fa904bea3dd5298230cd1 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Apr 24 21:35:04 2011 -0700 XQuartz: Rename launchd-id-prefix to bundle-id-prefix It's used many other places than just for launchd. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit e466745109416a2fcdf5d7389c80b814a0363676 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Apr 24 20:35:06 2011 -0700 XQuartz: Dead code removal Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit f1d867c0a1577e2c46d5dd4e262444e0cf6f8e25 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 23:22:27 2011 -0700 XQuartz: Silence clang static analyzer Call to 'malloc' has an allocation size of 0 bytes. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 913223e9ddf2cb927ecad99aeadfa730df8561ac Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 23:15:49 2011 -0700 XQuartz: xpr: Dead code removal Assigned value is always the same as the existing value. Found by clang static analyzer Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit d0caa0e4cd255bea315757be2ff387cf57e8bdf7 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 20:12:38 2011 -0700 XQuartz: Silence warnings about deprecated functionality where it is an intended fallback Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 9244a3a24f63239ec12675f3df091583e06c8314 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 12:55:39 2011 -0700 XQuartz: xpr: Use a serial queue rather than pthread mutexes for window_hash Additionally removes some dead code and fixes double-locking in xprIsX11Window. xprIsX11Window doesn't need to do any locking because those resources are protected by the called functions themselves. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel A. Steffen <dsteffen@apple.com> commit bac34a54f7cb84f346b1b833df9917bd1ac70223 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 12:11:39 2011 -0700 XQuartz: xpr: Initialize window_hash in xprInit Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 1596ea72d66a03d9accb534679172ca6f63f78e1 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 11:55:49 2011 -0700 XQuartz: Use a lighter spinlock instead of a pthread_mutex_t in QuartzScreenSaver Currently, we only end up here through a call to QuartzShowFullscreen, and this is always on the same thread. Future changes (such as further incorporating libdispatch) may allow this to change, but contention will remain minimal since the call is infrequent and it is short held. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel A. Steffen <dsteffen@apple.com> commit 3e253c603bc18f06fa48b611797eb5a7c8a96fe4 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 01:48:25 2011 -0700 XQuartz: Remove the threadSafety dead-ish code It's been a few years now since we've needed this to debug thread boundaries, so punt it out to clean up the namespace polution. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit a52c8078c9cc83c84a8c6eb58810f49bdb90bcc1 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 01:39:16 2011 -0700 XQuartz: Use xorg_backtrace() instead of spewCallStack() xorg_backtrace() has been in os for two years now, we might as well start using it. Ref: 94ed0ba1b5043ad9fc33b42756af447d5ab15bbd Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit d79cc14a51f3e8d4d2f66aad055092672cab1526 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Apr 22 12:05:32 2011 -0700 XQuartz: Fix compilation warnings with XPLUGIN_VERSION >= 4 xprAppleWM.c:143: warning: initialization from incompatible pointer type xprAppleWM.c:144: warning: initialization from incompatible pointer type Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 6128544fd58ced0ed738b7150865294d214fb4eb Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Apr 25 12:38:07 2011 -0700 XQuartz: Bump bundle version to 2.7.0 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4944de24849a109c65f1b353bc12e44e90a1211d Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 23:25:39 2011 -0700 rootless: Fix a typo in RootlessGlyphs which resulted in a garbage value Found by clang static analyzer Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 2098cb03c6b64bfca7694fc2b5213edb77bc12e4 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 23:27:16 2011 -0700 rootless: Dead code removal Found by clang static analyzer Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit bb4d145bd25e2aee988b100ecf1105ea3b6a40b8 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 21:24:27 2011 -0700 glx: Silence warnings when building with clang This replaces AX_TLS (GPL3) with XORG_TLS (MIT) In file included from glapi.c:46: In file included from ./glapi.h:51: ./glthread.h:237:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes] __attribute__((tls_model("initial-exec"))); ^ In file included from glapi.c:46: ./glapi.h:92:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes] __attribute__((tls_model("initial-exec"))); ^ glapi.c:82:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes] __attribute__((tls_model("initial-exec"))) = NULL; ^ glapi.c:85:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes] __attribute__((tls_model("initial-exec"))); ^ 4 errors generated. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jamey Sharp <jamey@minilop.net> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> commit 5c9eafc8e5f8575c06591d244c2cb5ea07691cb4 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 20:55:53 2011 -0700 render: Silence warnings when building with clang picture.c:351:37: error: implicit conversion from 'unsigned int' to 'CARD16' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Werror,-Wconstant-conversion] pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ... fatal error: too many errors emitted, stopping now [-ferror-limit=] Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Suggested-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit c524f8bb768f886d413839bc22184098394c2559 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 20:49:27 2011 -0700 os: Silence warnings when building with clang access.c:1492:20: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses] if ((host->family == FamilyServerInterpreted)) { ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ access.c:1492:20: note: use '=' to turn this equality comparison into an assignment if ((host->family == FamilyServerInterpreted)) { ^~ = access.c:1492:20: note: remove extraneous parentheses around the comparison to silence this warning if ((host->family == FamilyServerInterpreted)) { ~ ^ ~ In file included from xstrans.c:8: In file included from /usr/X11/include/X11/Xtrans/transport.c:62: /usr/X11/include/X11/Xtrans/Xtranssock.c:262:5: error: implicit declaration of function 'ErrorF' is invalid in C99 [-Werror,-Wimplicit-function-declaration] PRMSG (3,"SocketSelectFamily(%s)\n", family, 0, 0); ^ log.c:180:29: error: format string is not a string literal [-Werror,-Wformat-nonliteral] if (asprintf(&logFileName, fname, display) == -1) ^~~~~ log.c:190:26: error: format string is not a string literal [-Werror,-Wformat-nonliteral] if ((asprintf(&suffix, backup, display) == -1) || ^~~~~~ log.c:382:25: error: format string is not a string literal [-Werror,-Wformat-nonliteral] LogVWrite(verb, tmpBuf, args); ^~~~~~ Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit ab81aa91404ca0fa6843ce8021cbd9de42255a8f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 20:39:25 2011 -0700 Xext: Silence warnings when building with clang xvmain.c:1113:22: warning: equality comparison with extraneous parentheses [-Wparentheses] if ((pf->depth == pDraw->depth) ~~~~~~~~~~^~~~~~~~~~~~~~~ xvmain.c:1113:22: note: use '=' to turn this equality comparison into an assignment if ((pf->depth == pDraw->depth) ^~ = xvmain.c:1113:22: note: remove extraneous parentheses around the comparison to silence this warning if ((pf->depth == pDraw->depth) ~ ^ ~ 1 warning generated. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit fd086f87cd1bab53c9e918cb687009e7ac8718d8 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Apr 23 20:36:53 2011 -0700 fb: Silence warnings when building with clang fbpict.c:163:8: warning: implicit conversion from enumeration type 'PictFormatShort' (aka 'enum _PictFormatShort') to different enumeration type 'pixman_format_code_t' [-Wconversion] pict->format, ~~~~~~^~~~~~ fbbltone.c:486:2: warning: shift result (281474959933440) requires 49 bits to represent, but 'int' only has 32 bits [-Wshift-overflow] C2_24( 0, 0), C2_24 ( 1, 0), C2_24 ( 2, 0), C2_24 ( 3, 0), ^~~~~~~~~~~~ fbbltone.c:474:6: note: instantiated from: SelMask24(b,1,r)) ^ fbbltone.c:429:46: note: instantiated from: ^ fbbltone.c:427:18: note: instantiated from: 0xffffff << Mask24Check(x,r)) : 0) ~~~~~~~~ ^ Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit aad7b324aefc906f28ac9d10c64650b3445c2ae0 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Apr 24 19:57:22 2011 -0700 os: Add missing _X_ATTRIBUTE_PRINTF to va_list variants Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 5423da9fb2ec0dfeff866f12cf26fbba04ea673d Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:44:15 2011 +0200 xkb: remove duplicated include Remove duplicated include. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 79b3a7f83d7cbee397eecebef1af31c048d295e8 Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:43:05 2011 +0200 test/xi2: remove duplicated include Remove duplicated include. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit a17c30d43e0db6c65cc73cd2be5193c02f138bf5 Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:42:07 2011 +0200 hw/xwin: remove duplicated includes Remove duplicated includes. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit c270cfc30c547e28017533f490904013f73cf6f0 Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:41:11 2011 +0200 hw/xquartz: remove duplicated includes Remove duplicated includes. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 50ced6cfa0aef472e713ffccfdba003829df68df Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:40:11 2011 +0200 hw/xnest: remove duplicated include Remove duplicated include. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 387f45a7077faadf232edc3f608c4a081a7fd290 Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:39:11 2011 +0200 hw/xfree86/modes: remove duplicated include Remove duplicated include. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 78a9ec125dcb1546ca7e7e18aedf2b323eebb1fc Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:38:08 2011 +0200 hw/xfree86/fbdevhw: remove duplicated include Remove duplicated include. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 0320db25f917980621107b790c4fc5171cb0b6ac Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:36:48 2011 +0200 hw/xfree86/dri: remove duplicated includes Remove duplicated includes. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit b56271b954d6ab8eeb320f314925b77403458b9c Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:35:45 2011 +0200 hw/xfree86/ddc: remove duplicated include Remove duplicated include. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 86c0c8b9c567f57fe7477d5302fa22dc7557ce90 Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:34:46 2011 +0200 dix: remove duplicated includes Remove duplicated includes. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit 9b5046d2130aead79956019faf7103b5c676fd02 Author: Nicolas Kaiser <nikai@nikai.net> Date: Sun Apr 24 12:33:32 2011 +0200 Xi: remove duplicated includes Remove duplicated includes. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> commit c6cb70be1ed7cf73bd3411b8d66ec05a9efcfeb9 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Mar 28 13:30:52 2011 -0400 Fix trapezoid and triangle rendering to windows For fbAdd{Traps,Triangles}() and fbRasterizeTrapezoid() this is just a matter of adding the image offsets to the trap offsets. For fbShapes, the story is more complicated: The recently added pixman API did not allow offsetting trapezoids. Instead, it would use x_dst and y_dst in such a way that the effect was to only offset the source image. In pixman 0.21.8, this API has changed such that all the traps are conceptually rendered to an infinitely big image, and the source and destination coordinates are then aligned with (0, 0) of that image. This means offsetting dst_x and dst_y will now offset the entire drawing, which is similar to how other composite functions work. This patch then changes fbComposite{Triangles,Traps} such that the source image is aligned with the shapes, and the destination coordinates offset according to drawable->{x, y}. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit 1b96a99d8edd9016bc4a35348f9d5ddb45832f14 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Thu Mar 10 08:52:41 2011 -0500 fb: Call miCompositeSourceValidate() on the source in fbShapes() Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit 04635069554859ec67003b89f56965421cba7f52 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Mar 29 00:11:00 2011 -0400 render: Remove unused TriStrip and TriFan typedefs Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit 2b0cabec620f3a2a5e431052441b092ef979bf94 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Mar 29 00:07:44 2011 -0400 render: Remove unused fields in the source picture structs The fields class, stopRange, colorTable and colorTableSize are not used by any current code. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit b0d84f94393edab395d65d2b2cb983fc9fec3d36 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Mar 28 20:59:34 2011 -0400 render: Delete PictureGradientColor() PictureGradientColor(), INTERPOLATE_PIXEL_256() and premultiply() are not used by anything. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit 61a92a78cd49969f74a046fa26c3199e06365814 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Mar 29 13:06:36 2011 -0400 Add RegionInitBoxes(), and fix some buggy callers of RegionInit(). The interface to RegionInit(): RegionInit (RegionPtr pReg, BoxPtr rect, int size); is very confusing because it doesn't take a list of boxes, it takes *one* box, but if that box is NULL, it initializes an empty region with 'size' rectangles preallocated. Most callers of this function were correctly passing either NULL or just one box, but there were three confused cases, where the code seems to expect a region to be created from a list of boxes. This patch adds a new function RegionInitBoxes() and fixes those instances to call that instead. And yes, the pixman function to initialize a region from a list of boxes is called init_rects() because pixman is also awesome. V2: Make RegionInitBoxes() return a Bool indicating whether the call succeeded, and fix the callers to check this return value. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit c7bce22b58530239e583d91ae56312bad1630da4 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Mar 28 11:38:11 2011 -0400 Track damage for fbTrapezoids() and fbTriangles(). These calls no longer go through the CompositePicture() hook, so damage was no longer generated for them. This patch simply damages the entire destination clip region. It would be possible to generate tighter damage for certain operators such as Over and Add, where blank source pixels have no effect on the destination, but given that virtually all trapezoid rendering takes place on pixmaps, it's unlikely that anybody would actually benefit from this optimization, and the miTrapezoidBounds function did sometimes show up on profiles, probably because it does several divisions per trapezoid. V2: Call DamageRegionProcessPending() - pointed out by Michel Dänzer. V3: Call DamageRegionProcessPending() *after* rendering - pointed out by Maarten Maathuis Reviewed-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 918a9c99cf2ebc73acb34b95f597904b93c690d9 Merge: 88c4622 5f496bc Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 22 11:20:16 2011 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 88c4622b594a1725d0cee86bc82ad640d241c520 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Apr 18 08:23:48 2011 -0700 linux: Retry VT ioctls while errno == EINTR When the smart scheduler is enabled, the VT ioctls (particularly VT_WAITACTIVE) can be interrupted by the smart scheduler's SIGALRMs. Previously, this caused the server to immediately continue on to ScreenInit, almost certainly causing a crash or failure because the X server that owned the VT hadn't finished cleaning up. As of commit 7ee965a300c9eddcc1acacf9414cfe3e589222a8, it causes a FatalError instead. Retrying the ioctl as long as it fails with errno == EINTR fixes the problem and allows server regenerations to trigger VT switches that actually succeed. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 302bdc3c9678c028bed71dbe9c5ba04997626b6b Merge: 001b6b8 6f97fe5 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 22 10:48:37 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit 5f496bc91941140ceaa3061472fda95bd812f2d2 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Apr 22 01:23:09 2011 -0700 XQuartz: Do translation and handoff of NSEvent to X11 in a separate serial queue Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 72bd232b117b2867282e0ae1855d779e126f912b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Apr 22 00:39:12 2011 -0700 XQuartz: Send tablet proximity events with tilt and pressure <rdar://problem/6257569> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 034538ea9b4770025e3573bc708039cabbe1e10d Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Apr 21 16:31:58 2011 -0700 XQuartz: Use dispatch_async to handoff the FD Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ca7b9e6c817681b9cec738e43cf020ac19b5e732 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Apr 21 15:51:32 2011 -0700 configure.ac: Add check for libdispatch when building for darwin Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 3960115dbc83ec1eb8d9c8e90466af3fa0b32abd Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Apr 21 15:19:12 2011 -0700 XQuartz: Fix prototypes for thread functions Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 7524dbd06113ec081eaa882aa54e03553ccf96aa Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Apr 21 15:11:52 2011 -0700 XQuartz: Make the DarwinProcessFDAdditionQueue_thread wait 3 seconds to allow xinitrc to catch up Previously, we weren't always waiting the full three seconds. This should be better, but is still sub-optimal. We really want to start processing these once a WM has been started. http://xquartz.macosforge.org/trac/ticket/416 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 6f97fe5df16f947e52875187ff4f9e25fab33ad7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 21 14:55:22 2011 +1000 dix: improve control flow in QueryTrackers If the velocity is 0, skip the remainder. If we're not in range, skip the remainder. No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit a0eda8cd36ffba2ecc79e0d7a1908c89b45e76c4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 21 14:45:09 2011 +1000 dix: rename a bunch of variables to be more self-explanatory i → used_offset iveloc → initial_velocity res → result vdiff → velocity_diff vfac → velocity_factor tmp → tracker_velocity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit e4901905903c5630a1092c69e42f313abd05187b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 15:41:45 2011 +1000 dix: reduce scope of tmp and mult. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 81c6e79f42cc263349e04c0d82b3a85d6b557885 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 15:39:27 2011 +1000 dix: reduce the work done by ApplySoftening We can modify fdx/fdy in-place rather than requiring dx/dy as well. And the decision to soften can be made in the caller (unless decided by the velocity state). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 5870d507cee8547c0993791195fe04d96b271289 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 15:32:33 2011 +1000 dix: split softening and constant deceleration into two functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 8ae90552f95f025ad09a17258d56603a424ca076 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 15:30:19 2011 +1000 dix: use single return statement in ApplySimpleSoftening Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit c45f4cc6bd885855ecb54d9113010906d9ee58e2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 15:28:32 2011 +1000 dix: rename od, d to prev_delta, delta And res to result. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 5ffe06bada85e98d46a071dad578d72f5b96cb51 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 15:26:11 2011 +1000 dix: Don't use short as bool Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 97c1967689d7990be86ee490690ac5a91935c875 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 15:02:46 2011 +1000 dix: rename "res" to "result" for improved readability Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 1c162ebcaba78930f34639145a8ac01b87f8e6fd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 14:56:44 2011 +1000 dix: change ProcessVelocityData2D to BOOL. Don't confuse users with a return type of short, that's even less indicative that it returns 0/non-0 than "int". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 70b76286dbef99daabbafccd23f3ba436fe07b09 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 16:28:21 2011 +1000 dix: add some more documentation to ptraccel code Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 6b3a4cc6af240c12d05e27250b61e954eafe9f29 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 14:44:51 2011 +1000 dix: don't pass the index for a tracker around, pass the tracker Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 9e8645cacf5f1c398d7a6e837a36c66cf6cf0c9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 14:23:29 2011 +1000 dix: CalcTracker only uses the tracker, thus only pass the tracker. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 62f4bef82d1252515689420f8aac198e2f29c4f1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 21 13:58:55 2011 +1000 dix: use single return statement in DoGetDirection Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 5f8edbe47e3915f71a20f063a9e8b49591239600 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 13:12:53 2011 +1000 dix: use single return value in GetDirection Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit afaa17812513232785c8c629294190629197dfd8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 13:12:35 2011 +1000 dix: document GetDirection Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit df90db892d16143742eb3c09e048f5b76457a62e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 11:49:57 2011 +1000 dix: document DoGetDirection's maths This is the best explanation I can come up with, but it seems to hold true for my example values. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 7513190ec7bc08db1629b04d3f88f86ea2b1588e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 11:47:21 2011 +1000 dix: improve comment, directions flagged are 45° each The two directions returned by this calculation are always the two boundary conditions. Since we don't do quadrants but octants, the flagged ones are 45° each. e.g. an angle of 35° flags E and NE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit e804ae85fec290894af69c2e65df55e73b417287 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 11:12:35 2011 +1000 dix: improve readbility of DoGetDirection. Use enums for the direction bits, not hardcoded bitfield values that are added up. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 709b291972f8c65f4427f36b45ee78c3895d1e6e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 10:40:28 2011 +1000 dix: only use a single return where only one is needed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 8c528c667da7c7fba0ba07973a06b2d4613fbf70 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 20 13:14:11 2011 +1000 dix: fix typo in direction calculation Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 47f8cba6f3ae24e5dcdc4e348bdaaaf00d25a91c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Apr 11 14:50:16 2011 +1000 xfree86: removed unused "event" variable in xf86PostMotionEventM Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c6212a3e5dc43bd3b5263b392cb75ec96cdf4e4f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Apr 15 14:13:51 2011 +1000 dix: silence compiler warning resource.c: In function 'AddResource': resource.c:493:3: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'RESTYPE' RESTYPE is uint32_t, not long. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 196d679bed2e9959d2fca89d4ee4bbc551681d0b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Apr 15 14:51:06 2011 +1000 test: remove glib dependency The few features from the glib test suite we used can be replaced with assert and printf. This patch is a simple replacement for these two g_assert → assert g_test_message → printf g_test_init is removed and so is g_test_bug_base. g_test_run replaced with a simple return 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Gaetan Nadon <memsize@videotron.ca> commit 071a6ac4d0c347aa7fc6efe37f4f6992524d7ef1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Apr 11 15:22:52 2011 +1000 input: remove GetKeyboardValuatorEvents, this is now unnecessary. GetKeyboardValuatorEvents handles NULL valuator masks already, so the GetKeyboardEvents wrapper is not needed. Rename GKVE to GKE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 91a735328c59db006f0ed52b49e9c59895796c0c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 9 10:45:55 2011 +1000 test: add some XIPassiveGrab protocol testing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit 60b08e013dd1e971f82e5bc8708d3f120c217497 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 9 10:44:48 2011 +1000 Xi: don't swap the status byte in the XIPassiveGrab replies Reported-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a3f37f3698880aec508b5ecfb88daf39360610aa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 9 10:07:19 2011 +1000 Xi: exit with error value if CheckGrabValues failed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit f4d9ff73b161d84d3fcacc5834fa714c113c7a10 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 9 09:54:12 2011 +1000 Xi: fix reply swapping function check for XIPassiveGrabDevice Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 2a49ffa3c94819e9f28dd939f23ee8a675258172 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 9 09:53:47 2011 +1000 Xi: return the bad device ID if a passive grab fails with BadDevice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 315aa8444b13f827237674535eb2ad55a2066808 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 23 10:32:35 2011 +1000 configure: actually require macros 1.13 Introduced in 6a5bf15fa99cf5b2358b3b3e2f29e5044aa8724a Reported-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit f0f0eec869d932a2d9228ff3e41e9e7cda155e68 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Apr 11 11:24:29 2011 +1000 Xi: silence valgrind warning. (#36120) Conditional jump or move depends on uninitialised value(s) at 0x4357A1: GetEventMask (events.c:454) by 0x43B9E8: DeliverEventsToWindow (events.c:2029) by 0x4E0C59: SendEventToAllWindows (exevents.c:2125) by 0x4E8301: XISendDeviceHierarchyEvent (xichangehierarchy.c:118) by 0x426F99: DisableDevice (devices.c:507) by 0x46BF72: xf86Wakeup (xf86Events.c:457) by 0x432ABA: WakeupHandler (dixutils.c:419) by 0x45B708: WaitForSomething (WaitFor.c:235) by 0x42E8D9: Dispatch (dispatch.c:367) by 0x422DC9: main (main.c:287) Uninitialised value was created by a stack allocation at 0x4E8190: XISendDeviceHierarchyEvent (xichangehierarchy.c:61) Conditional jump or move depends on uninitialised value(s) at 0x43BB78: DeliverEventsToWindow (events.c:2010) by 0x4DDEEA: FindInterestedChildren (exevents.c:2103) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4E0C6F: SendEventToAllWindows (exevents.c:2127) by 0x4E8301: XISendDeviceHierarchyEvent (xichangehierarchy.c:118) by 0x426F99: DisableDevice (devices.c:507) by 0x46BF72: xf86Wakeup (xf86Events.c:457) by 0x432ABA: WakeupHandler (dixutils.c:419) by 0x45B708: WaitForSomething (WaitFor.c:235) Uninitialised value was created by a stack allocation at 0x4E8190: XISendDeviceHierarchyEvent (xichangehierarchy.c:61) Set the type of dummyDev to SLAVE. The jump listed above comes from a check to IsMaster() in GetEventMask() that would then set the XIAllMasterDevices mask. Hierarchy events can only be set for XIAllDevices so the above IsMaster() check had no effect and the device type doesn't really matter anyway beyond shuting up valgrind. Also initialize dummyDev to 0 to ease future debugging. X.Org Bug 36120 <http://bugs.freedesktop.org/show_bug.cgi?id=36120> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 419a27b5219a739f2fbd50cc96a1b54c469e4a88 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 12 10:17:07 2011 +1000 Xi: fix valuator alignment in DeepCopyDeviceClasses (#36119) commit 678f5396c91b3d0c7572ed579b0a4fb62b2b4655 only fixed the initialization, not the copy. After a slave device change, the valuator were out of alignment again. X.Org Bug 36119 <http://bugs.freedesktop.org/show_bug.cgi?id=36119> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 7762de65e153790ee9f63903964d168a6680d815 Author: Alexandr Shadchin <alexandr.shadchin@gmail.com> Date: Sat Apr 9 17:45:10 2011 +0600 Simplify auto-detect mouse for WSCONS_SUPPORT Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Matthieu Herrbb <matthieu.herrb@laas.fr> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 001b6b8b70734db1fa2f68e45c1db8337ba9f662 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 15 13:01:37 2011 -0400 glx: Make --disable-dri not disable AIGLX Either the DRI1 or DRI2 loaders are sufficient. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f8540b9dcc1fba886be5c4ce7ea0d74952cb48c4 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 15 12:57:05 2011 -0400 glx: Use 0 rather than garbage for unknown INTEL_swap_event types Otherwise the garbage you return could well be numerically identical to one of the swap type tokens, and apps which rely on us to tell the truth would be in trouble. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit dc0cf7596782087bdda0e7f9cd2f60907c45b2c4 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 29 10:09:46 2011 -0400 Revert "composite: Don't backfill non-bg-None windows" This reverts commit 6dd775f57d2f94f0ddaee324aeec33b9b66ed5bc. Bugzilla: https://bugs.freedesktop.org/34427 Acked-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 6a433b67ca15fd1ea58334e607f867554f227451 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 28 12:30:09 2011 -0400 glx: Fix lifetime tracking for pixmaps GLX pixmaps take a reference on the underlying pixmap; X and GLX pixmap IDs can be destroyed in either order with no error. Only windows need to be tracked under both XIDs. Fixes piglit/glx-pixmap-life. Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit b3d2164a0361f636bfe77b51456bee9213af4f13 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Tue Apr 12 17:16:50 2011 +0300 dri2: Pass out_count by value to update_dri2_drawable_buffers() update_dri2_drawable_buffers() doesn't modify out_count, so pass it by value. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> commit 93c833ee84a3465ec5d251e622ba26434cb532f8 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Tue Apr 12 17:13:28 2011 +0300 dri2: Handle calloc() failure Don't access invalid memory if calloc() fails to allocate the buffers array. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> commit b2997431fd426ab318bc5dfd2cd43956d733ebec Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Apr 13 11:51:30 2011 -0700 Send events that were missing from RRSelectInput The RANDR spec (randrproto.txt) specifies that RRSelectInput will send out events corresponding to the event mask, if there have been changes to CRTCs or outputs. Only screen events were being generated, however. Fixes http://bugs.freedesktop.org/21760 Signed-off-by: Federico Mena Quintero <federico@novell.com> Reviewd-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit e409fb32b97033718f270a273f29f24c0b562b84 Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Tue Apr 12 12:55:56 2011 +0300 damage: use DamageReportDamage for the initial borderClip damage report Instead of using DamageDamageRegion for reporting the first (virtual) damage in ProcDamageCreate that covers the borderClip of the drawable window, use a function DamageReportDamage directly (previously called damageReportDamage). This avoids sending all other damage listeners a full window update when a new damage object is created. As this patch makes DamageReportDamage a public interface, the function has been moved into the part of the file that contains all the other public functions. The function has not been otherwise modified. Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 274dca8f2c6707121d45df8015fe7eddb129dec9 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Apr 4 22:31:42 2011 +0300 dix: don't free stranger pointers inside AllocARGBCursor This seems a good convention to follow: if pointers are allocate outside a given function, then free there as well when a failure occurs. AllocARGBCursor and its callers were mixing up the freeing of resources and causing a particular double free inside TileScreenSaver (srcbits and mskbits). Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> commit f603061e9482ad5caf1975ba5395b3294852d072 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Apr 4 21:40:06 2011 +0300 os: fix use after free in EstablishNewConnections In the case of failure on AllocNewConnection, new_trans_conn cannot be dereferenced because it's already freed. Swapping the order of this logic fix the changes introduced in 04956b80431169e0ae713a3e6ba4cdc157ce3a66. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> CC: Jeremy Huddleston <jeremyhu@freedesktop.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 82498e3c2cce6f515063ecb4b6ae9303e828da00 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Apr 4 20:25:32 2011 +0300 xfree86: xv: set pointers to NULL in xf86XVFreeAdaptor As a good practice and for eventual double frees. The reason of this patch is due the resilience of xf86XVInitAdaptors, where for any adaptor failure it's able to keep trying registering the following ones. I discussed briefly with Pauli and Ville about a bigger refactoring of such function, doing it in a way to return instantly when a failure happens; after all that's how mostly of the other driver functions work. Instead, we just thought that xf86XVInitAdaptors is wise and cool, and eventually other driver functions should be even following the main idea of resilience. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 81414c1c836ae30628606545edbf7392d9b3d009 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Mar 31 23:44:03 2011 +0300 xfree86: xv: fix double free in xf86XVFreeAdaptor When xf86XVFreeAdaptor is called more than once in xf86XVInitAdaptors (it may, but not often), the conditional being changed in this patch will always take true path and will keep freeing pAdaptor->pAttributes, thus letting the system error-prone. This patch fix such problem checking for a pointer instead the number of attributes. Such pointer will be deallocated when xf86XVFreeAdaptor is called first and will not let the code re-run in the following calls. This is a bit similar how the surroundings code is already doing. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 74476b700f1e499a731ba2ddbba87b12b9b5139b Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Mar 31 17:46:42 2011 +0300 xfree86: loader: use one exit code only for readability No functional changes. Spaghetti code for the win! \o/ Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit 7aad7dbf409eaa16a2c80d76ba2a42dc84501919 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 7 08:43:13 2011 +1000 Xext: use EXT_MASK macro instead of manual & 0x7f Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit b28a1af55cf1ad2a882cc8cd73b77341dec7ff5a Author: Chase Douglas <chase.douglas@canonical.com> Date: Wed Apr 6 14:51:45 2011 -0400 Fix unset valuator handling for XI 1.x valuator events again Set the valuator values for unset masked absolute valuators in the internal device event. This ensures the values will always be correct in getValuatorEvents even if the device has been removed. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3085b178626c957854385c7a88a05ec3c7eb74f3 Merge: c9d89ce 3c45b59 Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 6 08:34:10 2011 -0700 Merge remote-tracking branch 'jturney/master' commit c9d89cec1407550cb2568f4cef146c93607bbae6 Merge: a52049d bc61787 Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 4 11:57:39 2011 -0700 Merge remote-tracking branch 'vignatti/for-keith' commit bc61787a20e7683cbc4dfa45fe855da98a8c0cd0 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 29 18:22:50 2011 +0300 render: fix memory leaks in ProcRenderCompositeGlyphs Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Soren Sandmann <ssp@redhat.com> commit 45b6667b651a0a26b17f64c9e99d70784045e4bf Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 29 17:17:40 2011 +0300 xkb: fix fd leak in XkbDDXListComponent Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit 0b288c8738a97cf6aa3f36aa5c05e7ac2a5cbca8 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 29 16:54:14 2011 +0300 dix: fix memory leak in ProcListExtensions Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit 90e03ab026cd8ffdc6202e6b8bae119717ee8528 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 29 16:48:21 2011 +0300 mi: fix memory leak in miZeroLine Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit daae5e5de194757f7084f9b2b24353c34b961f19 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Mar 28 20:13:11 2011 +0300 xi: fix memory leak in AddExtensionClient Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit c1875ac25b7b730d464c98c4c151c35efd64a562 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Mar 28 20:09:04 2011 +0300 dix: fix memory leak in AllocShared Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit 6e5020f46165862ff09211d5425c8b6a13966303 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Mar 28 20:07:06 2011 +0300 dix: fix memory leak in AllocPseudo Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit a6c71ce5d2d2fe89e07a2ef5041c915acc3dc686 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Mar 28 19:21:28 2011 +0300 os: fix memory and fd leaks in Popen Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit bafec9a25efa902bef2a3730dc44dc50f0e45877 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Mar 28 19:19:57 2011 +0300 os: use DebugF for debugging Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> commit 719b37c33a89d6ad86c79097e5c67b9b3cea5aac Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 29 20:04:24 2011 +0300 xfree86: fix memory leak in xf86LoadModules Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit af054db005b48160b117dfd5bec5f821ee614ea9 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 29 19:51:23 2011 +0300 xfree86: fix bad free configInputDevices introduced in 93ca526892c0d22afa05cce6496198c652043a19. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit ac2fac24d8baa56f369f4e54908bc00c2b73a60a Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 29 19:49:32 2011 +0300 xfree86: fix memory leaks in configLayout Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc123319206930638ef1217922824d586d4ada6d Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 22:21:21 2011 +0200 xfree86: fix memory leak in xf86ConfigFbEntity Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2aa935bc5cc1e2d5365a97b8c5bb3d33eb5fc758 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 22:10:55 2011 +0200 fb: fix memory leak in fbOverlayFinishScreenInit Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4d87606a0d0eb63458098028c300c39c6f1bd2bf Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 22:07:44 2011 +0200 Xi: fix memory leak in ProcXGetSelectedExtensionEvents Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 12e46e83733b47d2704e1509960192365102af46 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 22:07:31 2011 +0200 dix: fix memory leak in SetDefaultFontPath Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7ae46b69ba3f05f46529131e6a864904967cde3a Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 21:33:15 2011 +0200 mi: fix memory leak in miFillUniqueSpanGroup Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 623bb34342641811e2151232f1ab4e2ee3d6b871 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 19:27:17 2011 +0200 xi: fix memory leak in ProcXIQueryDevice Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit dce2f10cf7bef9929cefadb5088d5b66df43a865 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 19:21:03 2011 +0200 mi: fix memory leak in miInitVisuals Free the pointers inside miInitVisuals, so the callers of this function (fboverlay.c and fbscreen.c) don't need to worry with deallocation in the case of failure. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8ab92cd9822510f426d179a636ef34bb0ace3bb3 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 18:56:02 2011 +0200 xfree86: dri2: fix memory leak and free resources properly Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit aa7096ca6f108e399d9916639cf20c57f9776305 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Mar 25 18:24:34 2011 +0200 xorg: remove unused pointer values all over the server Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 49051355d47849b3dd73631e3e2287e319a7f4e5 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Mar 23 18:08:29 2011 +0200 dix: remove unused macro Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit f1a80e1268fa4d235a411a8cdf20b4f13eafcde0 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Mar 23 18:06:51 2011 +0200 dix: remove unused debug code Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit a52049de2f846fe984d4db5ac8d2c1826c7b2d0b Merge: d044d36 266ea63 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Apr 4 09:58:53 2011 +1000 Merge branch 'master' of git://people.freedesktop.org/~herrb/xserver into for-keith commit d044d3675635f037bf0eb30e47f82460f78227d1 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Mar 31 16:26:06 2011 +0300 xfree86: loader: fix memory leaks in LoaderListDirs Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9c4aae2141161e4bf69313a771db91c0acc4cc83 Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Wed Mar 30 16:47:31 2011 +0300 xkb: Prevent leaking of XKB geometry information on copy. Currently shapes, sections and doodads may leak on copy. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 29d63ba175ff1ef1587c390b18ce61c8f1c150f3 Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Wed Mar 30 16:47:30 2011 +0300 xkb: Introduce helper function to handle similar reallocations. This is preparation for a memory leak fix and doesn't contain any functional changes. Note that two variables are generally used for reallocation and clearing of arrays: geom->sz_elems (reallocation) and geom->num_elems (clearing). The interface of XkbGeomRealloc is deliberately kept simple and it only accepts geom->sz_elems as argument, because that is needed to determine whether the array needs to be resized. When the array is cleared, we just assume that either geom->sz_elems and geom->num_elems are synchronized to be equal or that unused elements are cleared whenever geom->num_elems is set to be less than geom->sz_elems without reallocation. Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f40103cee1d591387359f401a5a7c21f4105aeb4 Author: Chase Douglas <chase.douglas@canonical.com> Date: Thu Mar 31 11:29:01 2011 -0400 Don't report old relative values in getValuatorEvents Relative valuator values should not be reported in any future events. If a relative valuator value is not set in an internal event, set the value to 0 for XI 1.x valuator events sent over the wire. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8199eac443d2c22d313cb23e39d5e607a8cc7f99 Author: Chase Douglas <chase.douglas@canonical.com> Date: Mon Mar 28 16:04:48 2011 -0400 Handle non continuous valuator data in getValuatorEvents This allows for masked valuators to be handled properly in XI 1.x events. Any unset valuators in the device event are set to the last known value when transmitted on the wire through XI 1.x valuator events. Fixes https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/736500 Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 266ea63bc3e052b753c5484fa08dcc4fb67c8952 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Fri Apr 1 22:55:57 2011 +0200 Xi: fix querydevice request swapping WriteReplyToClient() swaps rep.length, so it can't be used on return of WriteReplyToClient(). So save it's value for later use. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 552c78592c5e5f52fe16e2429f77c63adf398247 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Fri Apr 1 22:54:54 2011 +0200 Xext: fix test on extension number for the swapped case. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org> commit a074e6b6754d6c2706b2b5de54e22cbffc5b1a17 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Fri Apr 1 22:53:40 2011 +0200 Xi: add XI_Focus{In,Out} to swapped events. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 81257377a2d011ce47fba5822df0f7918dea1d72 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Fri Apr 1 22:51:48 2011 +0200 Xi: take XI2 requests into account also for the swapping case. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org> commit f9834d312e3059073e8ad77d9f9d57cb9d96e1e5 Author: Dave Airlie <airlied@redhat.com> Date: Thu Mar 31 15:33:46 2011 +1000 fb: cleanup fbChangeWindowAttributes This cleans up the duplication in fbChangeWindowAttributes, and fixes a bug if the fb24_32ReformatTile ever failed, since the old code would happily dereference it in the fbEvenTile call a few lines later. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> commit 36c7158133660520034d645b124c2c973d2971bb Author: Dave Airlie <airlied@redhat.com> Date: Thu Mar 31 13:21:44 2011 +1000 fb: drop comments around 24-bit support. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit ac2ae2ed378cc877444bec17b353dda83b620186 Author: Dave Airlie <airlied@redhat.com> Date: Tue Mar 29 14:24:52 2011 +1000 fb: add back fb defines for driver compat. we could drop these really and just fixup the drivers, but since they'll build fine but fail to work this seems safer. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit be9cfb249da18d134c1d65bbb75161aff65f2942 Author: Dave Airlie <airlied@redhat.com> Date: Tue Mar 29 14:27:41 2011 +1000 fb: drop defines that aren't used/necessary anymore. This was generated by: cd fb coan source --replace -DFB_SCREEN_PRIVATE -DFB_24BIT -DFB_24_32BIT -DFB_SCREEN_PRIVATE -UFBNOPIXADDR -UFBNO24BIT -UFBNO24_32 *.[ch] A follow up patch readds the FB_24_32BIT define for Intel UXA. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit e0a2ad51dfb7373aa602335490d9666d6101b5ea Merge: 327e1d8 3d68831 Author: Keith Packard <keithp@keithp.com> Date: Wed Mar 30 10:51:27 2011 -0700 Merge remote-tracking branch 'ajax/xserver-next' commit ac00ab77d5a00cfd198958aa1afaa4c3ccc6d7bc Author: Chase Douglas <chase.douglas@canonical.com> Date: Mon Mar 28 16:04:47 2011 -0400 Clean up getValuatorEvents using array loop logic Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3d688316af0e4ff3c44acfc168bd9c76c892b629 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 15 11:03:26 2011 -0400 xfree86: warning fix xf86RandR12.c: In function 'xf86RandR12EnterVT': xf86RandR12.c:1769:5: warning: ISO C90 forbids mixed declarations and code Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 2762eef8c34b48be803226f48fc71f790286f968 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 15 11:01:50 2011 -0400 xfree86: warning fix Pointer.c: In function 'xf86parsePointerSection': Pointer.c:192:5: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'long unsigned int' Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 5275fbe2e226e1c2a46d26288390c8ef6e1a6a52 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 15 10:58:36 2011 -0400 render: warning fixes picture.c: In function 'CompositeTriStrip': picture.c:1777:25: warning: unused variable 'ps' picture.c: In function 'CompositeTriFan': picture.c:1807:16: warning: unused variable 'pScreen' Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f1c2c01ac9ea7381cb4cd21ac1b2185ff28da3ec Author: Adam Jackson <ajax@redhat.com> Date: Thu Mar 24 16:51:54 2011 -0400 dix: Small refactor to resource deletion Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 3e0b311aba54895d806174526511ef11b31432b1 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 21 12:12:53 2011 -0400 glx: minor cast cleanup Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 501506cf9df3d81556d44d074d8321fe6c171576 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 18 17:48:51 2011 -0400 glx: dead variable removal Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 10317682e2fbb95f1d4caa1bdbbb8116272c0f86 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 18 17:44:11 2011 -0400 glx: Remove some obfuscatory macros Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit c327d07cc68802256c679a65d78f98f17327abda Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 18 17:03:09 2011 -0400 glx: Remove ->forceCurrent from the context vtable All the implementations of makeCurrent and forceCurrent are identical, so just use makeCurrent everywhere. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a48dadc98a28c969741979b70b7a639f24f4cbbd Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 21 11:59:29 2011 -0400 glx: Reimplement context tags This would let you do a constant-time context lookup, but if that's your performance problem you have two problems. Just use the context's XID as the tag value instead. In order to do this, we have to defer destroying a context until it actually goes unreferenced, as you're allowed to mention a context tag after you've (ostensibly) destroyed the context, as long as it's still your current context. Thus, change DestroyContext to merely mark the context as dead if it's a current context, and call down to actual resource destruction (and XID reclamation) in StopUsingContext. Also, stop trying to delete context state from DrawableGone. This was always broken, as GLX does not say that contexts are destroyed when their drawables are destroyed. But with the above change to defer context destruction, this would trigger a server crash on client exit as we'd free the context state twice. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 30d6947cee714385cf62a40ea6fa6d2e68388c78 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 7 14:53:28 2011 -0500 glx: Fix _glapi_add_dispatch We never need to generate stubs, because those conditions can't happen in the server. Yank that code out, but keep the bookkeeping for which extension functions are registered so the DRI driver doesn't get confused. As a pleasant bonus, we're now friendlier for environments like selinux that make runtime code generation difficult, and we're portable to more arches since we don't have to port the assembly stubs. Fixes the following clutter conformance tests (indirect rendering, llvmpipe driver): test-cogl-backface-culling test-cogl-materials test-cogl-readpixels test-cogl-texture-mipmaps test-cogl-texture-get-set-data test-cogl-viewport test-cogl-offscreen Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 0cb44cec7b9fbd75285f7380f162cf6140a5bf3f Author: Adam Jackson <ajax@redhat.com> Date: Thu Mar 3 10:42:41 2011 -0500 glx: Flatten -DXFree86Server Always defined by the makefile, so, just get rid of it. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit ed6c13c01e017f9f40c89247ab6652895fb1ea14 Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 13:37:43 2011 -0500 glx: Update some glapi comments Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 17d9e374721d6c8ee3f7f9cdc882f80127bdb57f Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 13:21:39 2011 -0500 glx: Lobotomize _glapi_get_proc_address This isn't a meaningful thing in the indirect glx loader, so just warn if it ever happens and move on. But also, mark it PUBLIC, so if the driver does ever call it we merely warn instead of aborting because ld.so can't find the symbol. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit b0c665ac0fe6840dda581e4d0d0b76c703d62a7b Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 12:30:22 2011 -0500 glx: Remove noop dispatch table We can never hit this, because the indirect GLX dispatch code always forces a current context and checks that it's non-NULL before calling into the dispatch table. If it's _not_ null, then _glapi_set_context will call into the driver, which is responsible for calling _glapi_set_dispatch to make sure the dispatch table is non-NULL. Also remove _glapi_set_warning_func and friends, since we can no longer call them even from dead code. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 327e1d88012102af6aca6c6840aa0ed3c7041a77 Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Mar 28 17:18:39 2011 +0200 EXA: Use dixGetPrivate(Addr) instead of dixLookupPrivate. The latter calls the former, let's cut the middle man and eliminate a branch in a hot path. According to Git history, ExaSetPixmapPriv was never used anywhere, just drop it. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit a095a6d4e8f5090907e8d3d66018636216300846 Merge: a22486f ef9d04f Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 27 20:06:29 2011 -0700 Merge remote-tracking branch 'airlied/pwin-cleanup' commit a22486f848014000dc13dda470f77d4d8ea9e9f6 Merge: 2ef4ff4 633b81e Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 27 18:27:10 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit 2ef4ff45ef1fcfc4967ebe3d550408769e5f6500 Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Fri Mar 25 10:38:23 2011 +0200 os/client: Prevent rare fd leak in DetermineClientPid DetermineClientPid didn't close file descriptor if read on /proc/pid/cmdline failed. Adjusted the code to disregard the close return value and perform the return after that, if the read failed or returned EOF. Signed-off-by: Mark Kettenis <mark.kettenis@xs4all.nl> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Keith Packard <keithp@keithp.com> commit ef9d04f8ad4239ac30984769c9c8c101bb8e78bf Author: Dave Airlie <airlied@redhat.com> Date: Thu Mar 24 14:07:34 2011 +1000 dri: kill if 0 out code. This refers to pWin->winSize in some #if 0 code remove it. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Cyril Brulebois <kibi@debian.org> commit eb9266c7176eb240a85e72beda9b6033338294f1 Author: Dave Airlie <airlied@redhat.com> Date: Thu Mar 24 14:04:25 2011 +1000 consolidate SetRootClip (v2) each DDX has its own copy, I've taken the darwin one, though I'm not sure why it needs the pOldClip piece that nobody else has and the commit msg is like an "Updates from magic land" type message. This removes the main uses of pWin->winSize from the DDXen. v2: drop old clip like ajax suggests. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 3c45b59e675ba926ec95842ac3d49e2091e41eb8 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Mar 18 15:00:14 2011 +0000 Fix XWin compilation after commit 769531b9 commit 769531b9 "Add mode field to pointer movement hooks" changes the function signature of miPointerSetPosition() to include the movement mode which resulted in the pointer position Update use of miPointerSetPosition() in winEnqueueMotion() appropriately (See http://tinderbox.freedesktop.org/builds/2011-03-16-0008/logs/xserver/#build) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 633b81e8ba09cc6a1ea8b43f323874fda2cf0bde Author: Simon Thum <simon.thum@gmx.de> Date: Wed Mar 9 20:48:22 2011 +0100 xserver: remove AbsoluteClassRec keeping the ABI This removes the struct, but keeps InitAbsoluteClassDeviceStruct as a no-op and preserves related struct layout. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2103d61909c7e6bd345622962df7784a19df72c5 Author: Simon Thum <simon.thum@gmx.de> Date: Sat Mar 5 05:02:54 2011 +0100 simplify ChangeDeviceControl in stubs Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 118ef6f806f629a8e2ad61e4f2a43820b0fa621c Author: Simon Thum <simon.thum@gmx.de> Date: Sat Mar 5 05:01:22 2011 +0100 xf86: don't pretend to support DEVICE_ABS_* in ChangeDeviceControl Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dee83dff4b8fbf1351263beaf2d531d033b6d0c4 Author: Simon Thum <simon.thum@gmx.de> Date: Sat Mar 5 04:59:33 2011 +0100 kdrive: don't pretent to support DEVICE_ABS_* in ChangeDeviceControl Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9eaecb1bfe358a0c5f24645a29d6c377c0c4b37c Author: Simon Thum <simon.thum@gmx.de> Date: Sun Mar 20 16:28:22 2011 +0100 xquartz: simplify ChangeDeviceControl Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 33e257ab43ebf35e838b80c416762e9b743e9385 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 22 11:53:00 2011 +1000 test: when unit tests are enabled, build them during "make" Catch compiler errors that were otherwise only spotted on make check. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 6243332782f2d286d49f1dec8a628b0a403665fd Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Fri Mar 18 16:35:36 2011 +0200 config: handle device change event properly wakeup_handler in udev.c wasn't dealing with udev change events. There are situations when a device can gain its input capabilities after it has been added to the system and therefore the change events must be handled as well. The change is handled as a consecutive device removal and addition. Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Stefan Kost <Stefan.Kost@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fad10cb38ef2433c82f8a43d3b7d64e323728060 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 18 11:06:57 2011 +1000 xfree86: print out which driver is about to be used. Makes reading the log file a lot easier for those that don't magically recognise the log spew by the individual drivers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit cb5d4b416a0fc850a1c119755a9cc3c4f0d7a545 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Mar 23 12:10:15 2011 -0700 XQuartz: applewm: Don't check if requested window level is < 0 because it is unsigned (-Wtautological-compare) Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c116e32dc2799c4abcf38d22bc773b755387c89a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Mar 23 12:07:36 2011 -0700 XQuartz: Put ifdef guards around have_depth label (-Wunused-label) Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 1a583f7940e18a8ef28ca14e74e85e0785d39067 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Mar 23 12:05:05 2011 -0700 XQuartz: Properly comment extra tokens (-Wextra-tokens) after endif Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c55baebf4ebf1887262cc16899eb297b9f284f6e Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Mar 22 19:01:48 2011 -0700 GLX: Support TLS with better portability AX_TLS detects when toolchains support __thread or __declspec(thread), but existing code assumed __thread. This also adds a check to configure.ac to error out if TLS is requested but unsupported. Found-by: Tinderbox http://tinderbox.x.org/builds/2011-03-22-0007 Regression-from: 82b1eaa6cad20f39dbf15573bdb3d62acbcd91f9 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Tom Fogal <tfogal@alumni.unh.edu> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 03f45df93469f6aef391e97007b9614e0770cc4c Merge: efcb727 5fb329a Author: Keith Packard <keithp@keithp.com> Date: Wed Mar 23 13:38:37 2011 +0900 Merge remote-tracking branch 'airlied/xinerama-cleanup' commit efcb7275ce5de651f91ba4ff8bb227dfb68bb154 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Mar 17 19:26:37 2011 -0400 test: git ignore the list test executable Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6a5bf15fa99cf5b2358b3b3e2f29e5044aa8724a Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Mar 17 19:26:36 2011 -0400 Add generalized unit test support using util-macros. A handful of modules have begun adding unit test programs. These macros will help providing a consistent interface which will help package builders and developers to manage the functionality. XORG_ENABLE_UNIT_TESTS will turn on/off unit testing, regardless of how it is implemented. The default (yes/no) can be specified by each module. It can be used by itself if glib or -wrap support is not needed. XORG_WITH_GLIB will probe the system for glib-2.0. A different version can be specified in each module. It will consult XORG_ENABLE_UNIT_TESTS but can be used by itself in contexts other then unit testing. The default (yes/no) can be specified by each module. XORG_LD_WRAP will probe the linker for -wrap support. It will consult XORG_ENABLE_UNIT_TESTS but can be used by itself in contexts other then unit testing. configure options: --enable-unit-tests Enable building unit test cases (default: auto) --with-glib Use GLib library for unit testing (default: auto) Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit ee583cb33423fa79beb22db20b30e10a677f9b5a Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Mar 17 19:26:35 2011 -0400 config: group document related XORG_ macros together No functional changes. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d5b16b037b8fe12ba85c68c8289b6a8cc5e3a09d Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 17 23:48:52 2011 -0700 Revert "dix: Remove usage_hint from pixmaps, store it in ->drawable.class" This reverts commit 1564c82417d201de5b9a5ec5e7aa4ef14c45fbad. The drivers used the top bits of the usage_hint to store driver private flags (intel, radeon, nouveau). With EXA we need to get at this data so if we migrate the pixmap we can create the correct type of pixmap in the driver, however this commit truncates the usage_hint into 8-bit class and loses all the good stuff. Signed-off-by: Dave Airlie <airlied@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit dc9ce695a69ca0787f58f8d160212a7a41acb703 Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Wed Mar 9 15:45:40 2011 +0200 xkb: Initialize pad bytes sent in replies of geometry requests. Valgrind complains about uninitialized data being written to clients. Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ee3a4951a49312a2b68025db00c71472eb84293f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 10 09:30:02 2011 +1000 xkb: Document XkbWriteCountedString. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 5c47f8beac7f87680c6f7331483b9cf94a1dbc86 Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Fri Mar 11 14:30:49 2011 +0200 xkb: Release XKB component names when compiling keymap. Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6f46ae3c69c48f389560af1491ed1729ba45866f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 15 13:20:03 2011 +1000 man: list the drivers that are ignored when hotplugging (#35209) X.Org Bug 35209 <http://bugs.freedesktop.org/show_bug.cgi?id=35209> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 642569591a73806d038f00f2f9a5c8738f764c0b Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat Mar 12 07:29:35 2011 -0500 dmx/doc: remove dead code in the makefile This was leftover from some older ways of building dmx/scale docbook. Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 21f70cad19474a6f3ba419e03c0df12881ed1092 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat Mar 12 07:29:34 2011 -0500 man: relocate manual pages in the man subdir outside doc The convention is to have the manual pages in a man subdir which is not under a doc dir. The doc dir contains users docs. This will move man pages out of the way for upcoming DocBook patches. Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d3adf2d9350bee4125107e2ea1ed0c51bb736562 Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Thu Mar 10 11:40:40 2011 +0200 xfree86/modes: Fixed memory leak in xf86InitialConfiguration There were two memory leaks in the function: one was the lack of free for "enabled", the other was the full lack of releasing anything when configuration was too small. The first issue was fixed by adding the missing free, the other was addressed by replacing the duplicate memory releasing sequences with one that is gotoed into. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Keith Packard <keithp@keithp.com> commit a713832cbe494ff468a627e88b11164074bbd14e Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Mar 13 20:01:30 2011 +0000 When XDMCP -from is specified, only register the requested address When XDMCP -from is specified, only register the requested address, rather than the requested address, and any others we have of different address families to the requested address. e.g. if we have 4 interfaces with both IPv4 and IPv6 addresses (which are not IPv6 mapped IPV4 addresses), using -from with one of those IPv4 addresses currently means only that IPv4 address, and all IPv6 addresses are used in the connection data in XDMCP REQUEST packet. (See http://cygwin.com/ml/cygwin-xfree/2011-02/msg00000.html) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0ac4931753a5d5925fc844c8cbec08585aea57a7 Merge: a8146f6 d7f8011 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 14 13:06:41 2011 -0700 Merge remote-tracking branch 'ajax/xserver-next' commit d7f8011418f9da06631f27c66c29bcb226d0dffe Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Mar 8 10:14:28 2011 -0500 Remove TriStrip and TriFan from the picture screen These functions no longer go through the screen vtable, so remove them and fix up the various wrappers. Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit 0eb5b0fbcf1233a93f285ff1e1609fcbd01e7c79 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Mar 8 10:14:27 2011 -0500 Absorb miTriStrip() into CompositeTriStrip() There is no need to virtualize this function that nobody cares about. Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit c2af0cea02bd85f4d5954c16e34b4a8fb0fe2243 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Mar 8 10:14:26 2011 -0500 Absorb miTriFan() into CompositeTriFan() There is no need to virtualize this function that nobody cares about. Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit a8146f6becc44bf9ad611d33bded17df07e6af21 Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Wed Mar 9 17:29:14 2011 +0200 mi/misprite: use memory management provided by dixRegisterPrivateKey The record allocated by miSpriteDeviceCursorInitialize was not being released. This patch makes misprite use dixRegisterPrivateKey with the record size argument, which handles the memory management issues. miSpriteDeviceCursorInitialize is restructured to initialize pCursorInfo only if miDCDeviceInitialize succeeds. The record itself is zeroed on cleanup to ensure that the assumptions in the code still hold. Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit f985a7319ef80b9b613eeaf24581000827cb220f Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Wed Mar 9 17:29:14 2011 +0200 mi/misprite: use memory management provided by dixRegisterPrivateKey The record allocated by miSpriteDeviceCursorInitialize was not being released. This patch makes misprite use dixRegisterPrivateKey with the record size argument, which handles the memory management issues. miSpriteDeviceCursorInitialize is restructured to initialize pCursorInfo only if miDCDeviceInitialize succeeds. The record itself is zeroed on cleanup to ensure that the assumptions in the code still hold. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> commit 57b35adaed112520c3b3b2fbad13cf5a91cd6652 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Wed Mar 9 13:57:25 2011 -0500 Remove geometry arguments from miSourceValidate() The only user of the geometry coordinates is the software sprite code, which uses them to remove the pointer whenever the window beneath is being used as a source. However, using Window pictures as a source is extremely rare (let alone *partial* windows), so there is no harm done in just validating all of the drawable. Additionally, the miSourceValidate() function was buggy in at least three respects: (a) It added drawable->{x,y} before calling down, which is wrong since the misprite code already adds them in its check. (Alternatively, the misprite code is wrong, but there are actual users who would notice if that code was broken). (b) It didn't account for the width of the interpolation filter, so if the Picture had a bilinear or convolution filter, the edges surrounding the source area would not be validated. (c) It didn't validate alpha maps. Finally, computing the bounding box of the transform on every composite request was a real performance issue in pixman, so presumably it could be one here as well. This patch changes miSourceValidate() to simply validate all of the underlying drawable. Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com> commit 016edc17512ba966d60edede8cf947996bae0b3c Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 17:12:26 2011 -0500 dix: Define RESTYPE as uint32_t long is needlessly long on LP64. Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 1f2bc777f96fd41feb55a4799ece939652130ef4 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 13:11:12 2011 -0500 dix: Shrink PropertyRec on LP64 size needn't be a long. No change on ILP32 but, combined with the previous change, 56 -> 40 bytes on LP64. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 51f353d0a0d116af16d7d9590cadef6c56328746 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 13:10:20 2011 -0500 dix: Fix ATOM typedef unsigned long is needlessly large on LP64. Use uint32_t instead. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 7ca75abbbdd2a1211e52a4f43ac4ed24d3c8ab34 Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Date: Wed Mar 9 11:17:28 2011 +1100 glx: Use PATH_MAX as size of filename buffer Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> commit d17a9fb8414becf6a8998041df68f209f9222b2b Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Date: Wed Mar 9 11:17:27 2011 +1100 Consolidate all the PATH_MAX handling into misc.h Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> commit 021393d1b8bcc9ff2ff5deb2306360e6b0afa1c6 Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Date: Wed Mar 9 11:15:07 2011 +1100 glx: Factor out glxProbeDriver function. DRI, DRI2 and swrast all had near-identical driver probing logic. Pull it into glxdricommon. [ajax: warning fix] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> commit 56c90e29f04727c903bd0f084d23bf44eb1a0a11 Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 15 14:29:14 2010 -0500 randr: Add RRConstrainCursorHarder Confine cursor motion to within the bounds of a single CRTC, iff all the CRTCs within a ScreenRec are reachable from each other. If not you get the same "cursor floats within the bounding rect" behaviour you get now. v3: - Incorporate review feedback from Christopher James Halse Rogers v4: - Add mode field. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 810fbfa44626bff9f443ab17c0ad27ff7ae121d7 Author: Adam Jackson <ajax@redhat.com> Date: Wed Feb 9 17:32:16 2011 -0500 mi: Call pScreen->ConstrainCursorHarder from the position update path v2: Cover more paths, spotted by Daniel Stone. v3: pass down the mode field for movement mode. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 769531b9ccade723a56498b0888af58d085fec9e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 14:19:18 2011 +1000 Add mode field to pointer movement hooks. Preparation work for pointer barriers. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 92788e677be79bd04e5ef140f4ced50ad8b1bf8e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 22 12:32:01 2011 +1000 test: add some tests for basic list manipulation. This has less purpose as a test but more as documentation on how to actually use the differnent list calls. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1ad9f01c31742157934a791e6141d10520d13e8a Author: Adam Jackson <ajax@redhat.com> Date: Thu Mar 10 10:47:40 2011 -0500 glx: Add texbuffer2 support to swrast Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 5fb329a04a18835ce864d0563f6dfeb3d3c78d69 Author: Dave Airlie <airlied@redhat.com> Date: Wed Mar 9 15:05:26 2011 +1000 panoramiX: convert 1->panoramiXNumScreens loops to use macro (v2) This converts all the remaining 1->num loops to the macro, this removes nearly all the panoramiXNumScreens usage in loops, and is a step to replacing it. v2: move some from the other patch. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 0bccfcc97b2300b83aa4693454c27ac87f23f221 Author: Dave Airlie <airlied@redhat.com> Date: Wed Mar 9 15:01:20 2011 +1000 panoramiX: convert 0->panoramiXNumScreens loops to macro (v3) This just uses the FOR_NSCREENS macro instead. v2: remove some of the 1->x loops. v3: drop the 1->0 loop, will rework later. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 5a94934487ea477947e24dcd4720b7cde77d3d2f Author: Dave Airlie <airlied@redhat.com> Date: Wed Mar 9 14:53:26 2011 +1000 panoramiX: consolidate common id assignment code. This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first element and is a common idiom throughout panoramiX code. It then adds a new inline function to hide id assignment to a panoramiX resource and cleans up lots of common repeated code. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit e2f8315daefc6e56ac8395a9f58f87bbf0809039 Author: Dave Airlie <airlied@redhat.com> Date: Thu Mar 10 09:13:50 2011 +1000 drop exa don't provide accel in this framework commit c48c530e541e201ea1afe2512d85967659ceef84 Author: Dave Airlie <airlied@redhat.com> Date: Wed Mar 9 15:11:42 2011 +1000 panoramiX: macro checking if drawable is root (v2) this code appears in quite a few places, consolidate it into a macro in a header. v2: align braces with macro just above it, and with lines removed Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit c3c0e2fdd326214e271ce144e8fc2725cbd738ef Merge: a19771e 7355555 Author: Keith Packard <keithp@keithp.com> Date: Wed Mar 9 14:25:54 2011 -0800 Merge remote branch 'whot/for-keith' commit 73555555a440855f9ae64c3367c5c7dca98c8741 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 8 15:33:13 2011 -0500 record: warning fix record.c:810:9: warning: unused variable 'count' Scope-shadowed by a later variable of the same name, safe to just delete. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4d114cc5467a514faa437ce7f4c5e772e2f6a21d Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 8 15:33:12 2011 -0500 input: warning fixes eventconvert.c:287:9: warning: enumeration value 'ET_Enter' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_Leave' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_FocusIn' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_FocusOut' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_DeviceChanged' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_Hierarchy' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_DGAEvent' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyPress' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyRelease' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonPress' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonRelease' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawMotion' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_XQuartz' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_Internal' not handled in switch From the code it appears these are can't happens, so if they ever do, BadImplementation seems entirely appropriate. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7b5e562ea74039832116ee13db910f290f074782 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 8 15:33:11 2011 -0500 input: warning fix getevents.c:770:5: warning: suggest parentheses around '&&' within '||' Introduced with dc57f89959e549403f8488eb9f23425bd7118b22: - if(dev->u.master && dev->valuator) { + if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) { So I'm assuming the two terms around the || are meant to be a unit. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 33fee13361e745e1db29e250b08622c83046d488 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 8 14:41:21 2011 +1000 Xi: fix XI2 passive grab reply length calculation If modifiers failed, the reply length was 4 bytes too short. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit eb8141b6edd8b477c0ba796be71e985c35520a9b Author: Julien Cristau <jcristau@debian.org> Date: Mon Mar 7 18:55:19 2011 +0100 Xi: fix length checks for swapped clients ChangeDeviceProperty and XIChangeProperty are followed by some data, so use REQUEST_AT_LEAST_SIZE instead of REQUEST_SIZE_MATCH. X.Org bug#35082 <https://bugs.freedesktop.org/show_bug.cgi?id=35082> Reported-by: Markus Fleschutz <markus.fleschutz@x-software.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4114533db6704324fc26f28a444415e325ace8e0 Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Fri Mar 4 17:55:33 2011 +0200 config: Ensure that stolen option list elements are released. NewInputDeviceRequest steals the contents of option list elements but doesn't use the elements themselves for anything. Therefore the list elements need to be released always. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8d30aff4aa708b9b885d492602ced7493a96a4df Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Fri Mar 4 17:55:32 2011 +0200 dix: Release input device config info when the device disconnects. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 40e56d34538f4663426db50893c231a2b5d760dc Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Fri Mar 4 17:55:31 2011 +0200 xkb: Ensure that XKB device private won't leak on device disconnect. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 18413f55089623123537c1499b02aa95ca2014d2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 3 14:15:55 2011 +1000 xfree86: block signals between EnableDevice and first CheckMotion() Devices usually enable SIGIO processing in EnableDevice. CheckMotion initialises the pointer sprite, sends Enter/Leave events, etc. This leaves us with a small window where events may be processed without the sprite or pointer position (as seen from the protocol) is valid. Block signals during this window. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a19771e4337d1c4600550314bbc42a1495a023ff Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Tue Mar 8 13:29:41 2011 -0500 xfree86/common: Remove a configScreen leak when conf_screen is NULL configScreen used a dynamically allocated buffer for XF86ConfScreenRec when conf_screen argument was NULL. This pointer was never stored anywhere, nor was it released, so this patch makes the function use automatically allocated storage in that situation. [ajax: minor grammar fix] Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> commit b73ebe65cd071a063417ac9c38513a6742e32428 Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 12:12:35 2011 -0500 glx: Remove unused _glapi_get_proc_name Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 4377288abdbaac8506d8643b440c300ba03182fe Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 11:52:27 2011 -0500 glx: Simplify _glapi_check_multithread We can guarantee that the X server does not call DRI driver services from multiple threads, so _glapi_check_multithread need never do anything special. As a result, ThreadSafe is always false, so remove it and simplify expressions where it appeared to match. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit d5e8bb2150ce9d8a4132d61f76621a2c7a7f0acf Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 11:26:05 2011 -0500 glx: unifdef BEOS_THREADS We don't support BeOS, so, no. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 3692ff0b35e774a6f6cbedf634d53c4df2e53a24 Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 11:22:45 2011 -0500 glx: unifdef USE_XTHREADS xthreads is an ancient wrapper around a half dozen or so common thread APIs, including pthreads. Just use pthreads directly if you have it; if you don't, get with the times. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 2371b44f9eb9181ec2c081ce66befee51d18bf6e Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 11:17:07 2011 -0500 glx: unifdef SOLARIS_THREADS Solaris 7 and older are not supported; Solaris 8 and later have (and use) pthreads. Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a5fdd1aa06c7c8ecefeafafc4a778fc816ad41a4 Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 2 10:20:02 2011 -0500 glx: Remove unused _glapi_get_proc_offset and friends Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 2cb3dc020cbec1ba64848dac532b3bb2d84d0635 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 17:11:35 2011 -0500 xi: Use RESTYPE consistently No functional change Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 2413702aa0b488f1a4f828a017d5b508c4f219f1 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 16:54:17 2011 -0500 xvmc: Use RESTYPE consistently Also mark these static since they're not used externally. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit cd58924d294de2abddbd2f03c2db021894fe9759 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 16:28:26 2011 -0500 xinerama: Use RESTYPE consistently No functional change Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 9a6a9971b03381b7c44257284edecdfa0135957f Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 16:25:23 2011 -0500 xv: Use RESTYPE where appropriate No functional change. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit fddfd026a0e4a8190dc01fb0f38af4b2c29b63a3 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 13:01:15 2011 -0500 dix: Remove PIXEL typedef Doesn't appear to be used anywhere. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 82a8677d9175732a61df4116a396b76a7704efb4 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 22:49:32 2011 -0500 dix: Remove deprecated.c No more internal users, this can be dropped now. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 1564c82417d201de5b9a5ec5e7aa4ef14c45fbad Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 18:37:45 2011 -0500 dix: Remove usage_hint from pixmaps, store it in ->drawable.class The class field was unused for pixmaps, and we don't have enough classes to justify a whole uint32 anyway. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit d8caa782009abf4dc17b945e325e83fda299a534 Author: Adam Jackson <ajax@redhat.com> Date: Thu Feb 24 16:06:34 2011 -0500 vbe: Fix malloc size bug v2: Slightly more obvious sizing math. ==14882== Invalid write of size 2 ==14882== at 0x6750267: VBEGetVBEInfo (vbe.c:400) ==14882== by 0x6142064: ??? (in /usr/lib64/xorg/modules/drivers/vesa_drv.so) ==14882== by 0x471895: InitOutput (xf86Init.c:519) ==14882== by 0x422778: main (main.c:205) ==14882== Address 0x4f32fa8 is 72 bytes inside a block of size 73 alloc'd ==14882== at 0x4A0640D: malloc (vg_replace_malloc.c:236) ==14882== by 0x675024B: VBEGetVBEInfo (vbe.c:398) ==14882== by 0x6142064: ??? (in /usr/lib64/xorg/modules/drivers/vesa_drv.so) ==14882== by 0x471895: InitOutput (xf86Init.c:519) ==14882== by 0x422778: main (main.c:205) Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 628d16a92a7fa556fbb70bf4a4adf57ec05c190b Author: Keith Packard <keithp@keithp.com> Date: Sat Feb 26 10:31:50 2011 -0800 loader: Don't distribute sdksyms.c and make it depend on the config sdksyms.c is constructed by processing header files with the C preprocessor. Its contents will vary depending on the precise configuration options, and so must depend on the config header files. We have one header file which is always changed when any config option is modified called do-not-use-config.h (which may want a different name at some point), so make sdksyms.c depend on that file. Also, we don't want to ship this file; it always needs to be built. So, include it in the nodist_libloader_la_SOURCES list to prevent it from being added to the tarball. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 705f047876f78bbdfb368c3643925af1d1d17f71 Author: Julien Cristau <jcristau@debian.org> Date: Fri Mar 4 01:12:01 2011 +0100 configure.ac: bump version for 1.11 development Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6c90e839d9872a37d371578c9c423e8213922044 Merge: 0bc95d5 edcceed Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 3 14:41:44 2011 -0800 Merge remote branch 'whot/for-keith' commit 0bc95d5b06dcea65a1aa193ea907b50f7dd168b5 Merge: 3f41f4a 69a9171 Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 3 14:33:08 2011 -0800 Merge remote branch 'jeremyhu/master' commit 3f41f4adea4bbb90d4bda4dab600595b655e3ed8 Merge: 8e4c3ce dae24ab Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 3 14:12:36 2011 -0800 Merge remote branch 'sandmann/for-keithp' commit 8e4c3ce55b0f186bc6ba4039e30629669b6087b7 Merge: f3d19c0 2965615 Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 3 13:42:07 2011 -0800 Merge remote branch 'rjy/clientids' commit 1c008e7e7865b405b8033f625333cd64ece4499e Author: Simon Thum <simon.thum@gmx.de> Date: Wed Feb 23 02:29:35 2011 +0100 dix: change all timestamps in pointer acceleration to CARD32 CARD32 is being returned by GetTimeInMilis(), so use it consistently. Signed-off-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a4b85261859b17dba9ad8f7f1ce650133f0235d4 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Feb 23 02:29:34 2011 +0100 dix: update pointer acceleration code to use ValuatorMask Signed-off-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8128846e16b406c7d459ae7556f7cd09bdc24c91 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Feb 23 02:29:33 2011 +0100 dix: refactor predictable scheme initialization This intends to clean up the predictable accel struct from purely scheme-related things like input properties, as they would be useless in other use cases such as wheel acceleration. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 69a9171dbbafd6a7db702d48770d28fb54717545 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Mar 1 20:02:46 2011 -0800 XQuartz: pbproxy: Protect against possible collision between Cocoa and X11 Cursor types Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit dae24abcd44f3bb1966faa88222f851c784b37dc Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Feb 28 11:10:38 2011 -0500 Delete RegionClipSpans() Nothing uses it. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Søren Sandmann Pedersen <ssp@redhat.com> commit edcceedbd35df576929685767d0b619659e5b020 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 28 12:32:53 2011 -0500 xext: Remove XCALIBRATE extension Nobody can have been using this, it's never called from extension init. XI2 device properties should now be a functional replacement. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c2207d11f243900bc2f641e08d80da63d84e97a8 Merge: 0077993 579ee8f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 28 11:26:09 2011 +1000 Merge branch 'next' into for-keith Conflicts: dix/devices.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0343aed1f082baf4bfbd730c1c3582f1410b8741 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Feb 27 16:18:27 2011 -0800 XQuartz: Don't use deprecated CoreGraphics API on SL and Lion Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit de32d4dcf57c10fc100c1b33630127947a8c8460 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Feb 27 15:49:10 2011 -0800 Revert "rootless: Remove ROOTLESS_WORKAROUND" Christof Wolf has reported a regression that seems to be caused by this change, so reverting the change in the 1.9 branch. We'll investigate a proper fix in master for 1.10. This reverts commit c89f0521044083a11d538ebfeaabee6fc7fb9a03. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 00779932de861bf7ac8c625802f1afed75d01b6f Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Feb 27 20:16:03 2011 +0100 Don't clobber input device options from xorg.conf Since commit b8d9c5ff removed commonOptions, we now need to append the "Core{Keyboard,Pointer}" options to the existing list. Fixes passing options to devices confirured in xorg.conf on systems where autoaddevices is false. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8cf3348e90846f5b04236479042228fb98ac8f70 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Feb 8 11:38:35 2011 -0800 XQuartz: RandR: Add RandR modes for the primary display in multi-monitor configs We now support using RandR to set the resolution of the primary display (and place a shielding window on other displays) in multi-monitor configurations. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 968652983f8e6ae6889b48e15f4098ff6ad4a15a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Feb 8 12:26:35 2011 -0800 XQuartz: RandR: Provide an alert box when entering a RandR mode for the first time. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 13578b852b7631f99cf1fd5e2e5469edc5aae369 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Feb 8 11:37:52 2011 -0800 XQuartz: RandR: Capture the display when switching modes with RandR This will prevent native windows from resizing as we change resolutions. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 7dff79e39564b403c3afbc5e7bacffa0df190a23 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Fri Feb 11 09:00:10 2011 -0500 Implement fbAddTriangles() in terms of pixman_add_triangles() This allows the remaining triangle-to-trap conversion code to be deleted. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 566f1931ee2916269e164e114bffaf2da1d039d1 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Jan 11 10:33:57 2011 -0500 Move miTriangles to fb as fbTriangles() The fb version simply calls the new pixman_composite_triangles(). This allows us to get rid of miCreateAlphaPicture(). Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 788ccb9a8bcf6a4fb4054c507111eec3338fb969 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Tue Jan 11 09:46:46 2011 -0500 Move miTrapezoids() into fb as fbTrapezoids() The main consumer of trapezoids, cairo, is using the Trapezoids request, which is currently implemented in the miTrapezoids() function. That function splits the request into smaller bits and calls lower level functions such as AddTrap. By moving the implementation of the whole request into fb, we can instead call pixman_composite_trapezoids() to do the whole request in one step. There are no callers of miTrapezoids in any of the open source drivers, although exa and uxa have their own copies of the function. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 197df069a4037d6faa2723c31ffba09c95d71166 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Wed Feb 23 10:36:57 2011 -0500 Require pixman 0.21.6 The following patches need pixman_composite_trapezoids() and pixman_add_triangles(). Signed-off-by: Soren Sandmann <ssp@redhat.com> commit f3d19c0cf3327cceb90f7378f5d8fc0c3e327400 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 25 21:22:23 2011 -0800 Version bumped to 1.10 Signed-off-by: Keith Packard <keithp@keithp.com> commit 678f5396c91b3d0c7572ed579b0a4fb62b2b4655 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 25 21:10:21 2011 -0800 input: Ensure Valuator axes are aligned as needed Let the compiler figure out the correct alignment for the axes data for a valuator by using a union to force double alignment of the initial ValuatorClassRec structure in the allocation. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Julien Cristau <jcristau@debian.org> commit dc8f52e77f51b6fa8908d9611c3f7e3cfbbaf2d1 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 25 16:38:27 2011 -0800 hw/dmx/doc: Add explicit dependency for all doxygen output files Instead of listing one of the doxygen output files and depending on sequential execution to ensure that the other files were present before make checked for them, create explicit dependencies so that make will not check for the additional files until after doxygen has been run. This allows parallel make to work correctly in this directory. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Kristian Høgsberg <krh@bitplanet.net> commit fd4d9c75c265add8d6cc74afb341c9c4f2ec1073 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 25 10:54:50 2011 -0800 hw/xwin: Look for gl spec files in $(srcdir) or . Tarballs include the downloaded gl spec files, which will end up in $(srcdir). But, git-based builds will not have them at all and will need to download them from opengl.org. They'll land in in the build directory instead of $(srcdir), and so we need to allow them to be in either place. This change checks for the files in $(srcdir), linking them to . if present. Otherwise, it downloads them from opengl.org. A suggested better solution is to have Mesa install these files somewhere. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Kristian Høgsberg <krh@bitplanet.net> commit 6b951dec69103ca76d6d4a61b1a2f67a52d013b9 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sun Feb 20 09:51:15 2011 -0800 dmx: Construct paths in doxygen.conf to fix VPATH builds The paths in doxygen.conf assumed that srcdir=builddir and broke otherwise. Use autoconf to fill in the paths to the srcdir so that the files can be found when users have a separate build directory (as with distcheck). Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> commit 61ce915bf78570b7c8d53c118700ef7274bbdfb7 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Tue Feb 15 06:03:28 2011 -0800 xfree86: Allow sdksyms.dep to be included portably Non-GNU makes don't deal with the sinclude or -include variants that allow Makefile stubs to be created and then included during the build. Instead, create an empty file at the end of configure so that the regular include statement can be included. This is how automake handles automatic source dependencies. In order to trick automake into not processing the include statement, a variable is used. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 780a77acce1dd369549ece802b3e2c4006058dfe Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 24 20:45:46 2011 -0800 Version bumped to 1.9.99.903 (1.10 RC3) Signed-off-by: Keith Packard <keithp@keithp.com> commit 9d23459415b84606ee4f38bb2d19054c432c8552 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 25 11:08:19 2011 +1000 dix: release all buttons and keys before reattaching a device (#34182) Testcase: xinput float <keyboard name> results in the keyboard's enter key being repeated as the device is detached while the key is still physically down. To avoid this, release all keys and buttons before reattaching the device. X.Org Bug 34182 <http://bugs.freedesktop.org/show_bug.cgi?id=34182> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit 229b055bdbc53370944401649234e8a38183f4fb Merge: 6178959 b17fc99 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 24 19:44:35 2011 -0800 Merge remote branch 'jeremyhu/master' commit 6178959e3dd6482a4317de6eb14eb19ca7329b9c Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 24 19:42:02 2011 -0800 xfree86: Bump video ABI to 10.0 RandR 1.4 revert changed things Signed-off-by: Keith Packard <keithp@keithp.com> commit 31704510f448706524b7b7085cc4ff0ada7bfe7e Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Feb 24 12:17:57 2011 +0100 EXA/mixed: ModifyPixmapHeader pitch fixes. (bug #33929) If there's a GPU copy and a non-zero devKind was passed in, set the GPU copy pitch to that instead of to a possibly bogus value derived from the new width. This is e.g. used by the radeon driver's drmmode_xf86crtc_resize hook, fixes https://bugs.freedesktop.org/show_bug.cgi?id=33929 . On the other hand, the system memory copy doesn't need the pitch to be aligned beyond the PixmapBytePad of the width. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Cyril Brulebois <kibi@debian.org> Tested-by: Cyril Brulebois <kibi@debian.org> Reported-by: Thierry Vignaud <thierry.vignaud@gmail.com> Tested-by: Thierry Vignaud <thierry.vignaud@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b17fc99cb9ca9ff0a3592f783a906cdcc35da748 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Feb 24 19:24:35 2011 -0800 XQuartz: Localization Updates Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 59850630fefe5e4f0430d7e2e106937fdf1e7ffb Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Feb 24 19:18:35 2011 -0800 XQuartz: Add LSApplicationCategoryType key to Info.plist Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 83861595782aaa05907f9cf7b236d50261d404d9 Merge: a1cc0e5 4102a00 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 24 18:59:07 2011 -0800 Merge remote branch 'kibi/master' commit a1cc0e52b0e8ca40bc1218de553424b2bcb760ef Author: Alexandr Shadchin <alexandr.shadchin@gmail.com> Date: Tue Nov 30 21:17:19 2010 +0500 Removing unused code In OpenBSD removed support PCCONS in 2002 year http://marc.info/?l=openbsd-cvs&m=102435816424294&w=2 Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> Signed-off-by: Keith Packard <keithp@keithp.com> commit 365ad68fb9f7029550505b7c276a808050cada9c Merge: 0801afb 720c895 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 24 18:49:40 2011 -0800 Merge remote branch 'ajax/for-keithp' commit 0801afbd7c2c644c672b37f8463f1a0cbadebd2e Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Thu Feb 10 15:35:14 2011 +0200 record: avoid crash when calling RecordFlushReplyBuffer recursively RecordFlushReplyBuffer can call itself recursively through WriteClient->CallCallbacks->_CallCallbacks->RecordFlushAllContexts when the recording client's buffer cannot be completely emptied in one WriteClient. When a such a recursion occurs, it will not be broken out of which results in segmentation fault when the stack is exhausted. This patch adds a counter (a flag, really) that guards against this situation, to break out of the recursion. One alternative to this change would be to change _CallCallbacks to check the corresponding counter before the callback loop, but that might affect existing behavior, which may be relied upon. Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Keith Packard <keithp@keithp.com> commit 816f1f8ffafbfbf0dd31ea86f295987f84151feb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 22 12:48:04 2011 +1000 include: document list interface. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit b833f9b924ddc043244c0a026547c438f1c4d4df Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:18:35 2011 -0800 Revert "Replace huge argument list in xf86CrtcSetModeTransform with struct" This reverts commit 8b35118c03590a7ad3786d3284bafb3f40fcb8cc. commit 7030c82648930cea7ef8a2ea49d8138078920d4d Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:18:16 2011 -0800 Revert "Require RandR protocol version 1.4 or newer" This reverts commit c8bc25fd7629df10f2825b7cc713b031ae78f223. commit a91d33917befd6719bb7f01007bc253a2aefb0bb Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:18:12 2011 -0800 Revert "randr: Add sprite position transforms" This reverts commit 66294afcab7b7a82f7dd897767e46c48a94b8ee8. commit 3d4ee25a1e2e0ed2463ceaabea8f5a284a6ddd60 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:18:08 2011 -0800 Revert "randr: Implement RRSetCrtcConfigs" This reverts commit d94a035ea9eb3167fc4f35b2d9f0d53f8807014c. commit 8b0e651f7d09a7f35c87a4d0a6e2053cae93b516 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:18:05 2011 -0800 Revert "hw/xfree86/modes: Add optional driver API for RRSetCrtcConfigs" This reverts commit 86c489c319c705f710bee3897fe27600ce15008e. commit 9e8c20b0d49783d6b9334d4c11c4e6e3ba273524 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:17:42 2011 -0800 Revert "randr: Add per-crtc pixmaps" This reverts commit 82612045e11f2b882ae132e184a9629f43f1c424. commit 9f47780ecdc7693f756587a758ec0141e75cb1eb Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:17:36 2011 -0800 Revert "randr: Hook up the new RandR 1.4 functionality" This reverts commit afb6ebf1d5829346c40fe1053c9f50afe926e6c6. commit 793a242c89fccdbf1a2557ba33da1da2cb4ff8c4 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:17:33 2011 -0800 Revert "DIX is responsible for ref counting scanout pixmaps." This reverts commit 96b4d4787bf82edd9d06eb9a6e94bc45412c7df2. commit 7b7cd3f121b3904ad851155f853ce87a0e00d002 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:17:29 2011 -0800 Revert "Set sprite transforms from RRSetCrtcConfigs" This reverts commit a88d70fb20a2bc3152b84adff4380857e6cfadf5. commit fd9331f6eb39a28da7de4867b2e3a460f667d514 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:17:24 2011 -0800 Revert "Separate out screen size and screen pixmap sizes in RRScreenSizeSet" This reverts commit 752c368421c1c824752cf467fba9318d75d2ca2c. commit 4d91e7a63161cdde9af53aedb3fe3e53dbe3049e Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:17:20 2011 -0800 Revert "ProcRRSetCrtcConfigs uses 'configs' without being initialized" This reverts commit b0f4bd61f0caf80f3be9a176f1f7a707bc6628d8. commit 00d0b235cfbfb162ddd58c088d2ed03e55a9c5cb Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 23 11:16:48 2011 -0800 Revert "randr: handle RRSetCrtcConfigs request with zero configs" This reverts commit 0d01b66df9081ef48843b3bad81c56bb2cd1ae69. commit 720c895db9327bbdc32215a67236303d2ceafad4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 23 13:36:20 2011 -0500 Add mode field to ConstrainCursorHarder For Pointer Barriers, the movement mode is important and must be passed through. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a16e282200f84233041e5a565c6363a5a78be525 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 8 15:40:22 2010 -0500 xfree86: Fix the sdk headers to be multilib-safe Use _LP64 (verified on gcc and sun compilers) instead of _XSERVER64 in internal header usage, and always define _XSERVER64 for modules if _LP64 is defined. Prevents differing xorg-server.h between 32 and 64 bit packages. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit dc498b433f36af5d2de3065e7c64cdb575385d81 Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 8 15:23:04 2010 -0500 xfree86: If the driver found modes on an output, don't add more Inferring modes from sync ranges is only valid if the monitor says it's valid. If the monitor says it's valid, then we'll have already added those modes during EDID block parse. If it doesn't, then we should believe it. If there's no EDID for an output, but sync ranges from the config, we'll still add default modes as normal. Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 303977fbcf9c641b7e19dfde192cef585f5b455c Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:52:49 2011 -0500 glxproxy: warning fix glxvendor.c: In function ‘__glXVForwardPipe0WithReply’: glxvendor.c:205:10: warning: ‘be_buf’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 405ad0610d6e2f4606768294b655ac52aee9ae58 Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:51:47 2011 -0500 glxproxy: warning fix glxvendor.c: In function ‘__glXVForwardAllWithReply’: glxvendor.c:284:10: warning: ‘be_buf’ may be used uninitialized in this function glxvendor.c:285:10: warning: ‘be_buf_size’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a4cd2e0da6415ec1b3b182579bebbe2a41f29d30 Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:47:05 2011 -0500 glxproxy: warning fix glxsingle.c: In function ‘__glXForwardPipe0WithReply’: glxsingle.c:218:10: warning: ‘be_buf’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f928caca6e60215bc9ab423acae5542dfabc9bec Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:45:31 2011 -0500 glxproxy: warning fix glxsingle.c: In function ‘__glXForwardAllWithReply’: glxsingle.c:300:10: warning: ‘be_buf’ may be used uninitialized in this function glxsingle.c:301:10: warning: ‘be_buf_size’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit dad2712c9328e113db4de768a12a8dafa6c177e9 Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:44:03 2011 -0500 glxproxy: warning fix glxsingle.c: In function ‘__glXDisp_ReadPixels’: glxsingle.c:760:11: warning: ‘buf’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 4270157bac645550e2c0afe89479c0bfe9d53447 Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:38:23 2011 -0500 glxproxy: warning fix render2swap.c:264:13: warning: ‘swapArray’ defined but not used Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 5d0910b4fdf99e3239635a01eb2709c32d0e5bb9 Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:32:54 2011 -0500 glxproxy: warning fix glxcmds.c: In function ‘CreateGLXPixmap’: glxcmds.c:1663:20: warning: comparison between pointer and integer glxcmds.c:1663:38: warning: comparison between pointer and integer Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit e1b5d3e5e7f157ab769c40ad2efdc1281c25a03a Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:18:53 2011 -0500 glxproxy: warning fix glxcmds.c: In function ‘CreateGLXPixmap’: glxcmds.c:1641:22: warning: ‘pGlxScreen’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 3b9de273a94fb68de51238c20c3182396aa41b84 Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:07:20 2011 -0500 glxproxy: warning fix glxcmds.c: In function ‘CreateContext.clone.6’: glxcmds.c:105:19: warning: ‘be_fbconfigId’ may be used uninitialized in this function glxcmds.c:104:14: warning: ‘be_vid’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 767b93e783a981b4fc926299a85a1a18387e693a Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 14:02:37 2011 -0500 glxproxy: warning fix glxcmds.c: In function ‘__glXGetDrawableAttributes’: glxcmds.c:3295:8: warning: ‘screen’ may be used uninitialized in this function glxcmds.c:3298:8: warning: ‘attribs_size’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a391089186cd1063d807bf14a9651e6861b248de Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 8 13:55:23 2011 -0500 glxproxy: warning fix glxcmds.c: In function ‘__glXChangeDrawableAttributes’: glxcmds.c:3464:8: warning: ‘screen’ may be used uninitialized in this function Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 4102a00962f568b1d34cf72ad524e1cc705b0b1c Author: Cyril Brulebois <kibi@debian.org> Date: Wed Feb 23 14:44:23 2011 +0100 xfree86: Fix undefined reference to `XNFsprintf' on sparc. Build failure on sparc: | copying selected object files to avoid basename conflicts... | CCLD Xorg | ./.libs/libxorg.a(xf86sbusBus.o): In function `xf86SbusConfigureNewDev': | […]/hw/xfree86/common/xf86sbusBus.c:712: undefined reference to `XNFsprintf' | collect2: ld returned 1 exit status Fix typo introduced in: 3a9bb93dd178084f4ff1abcea331ca5a62f88ce6 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Apologized-for-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 579ee8f5d84c3a523b7b3e3941eabb226d1d19e2 Merge: b636893 17265cc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 23 08:44:42 2011 +1000 Merge branch 'mi-cleanup' into next commit b636893137da1695e235e3a9354bfd9243fdddc2 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 22 13:43:28 2011 +0000 Input: Don't freeze unrelated devices in DeliverGrabbedEvent When delivering an event to a device grabbed with SyncBoth, DeliverGrabbedEvent walks the device tree looking for associated devices to freeze them. Unfortunately, it froze all devices instead of just the paired device, and the previous fix in 4fbadc8b17237f3c would still break if the same client had a non-SyncBoth grab on another unrelated master device. Fix this by completely ignoring devices that aren't our paired device. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 17265ccb027e3f956bf7409106174f44621d1cb8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 12:28:43 2011 +1000 Move master/lastSlave out of the union into separate fields. The removal of the double-use will cause some suble bugs as some conditions to check for the dev->u.master case were broken and also evaluated as true if lastSlave was set (instead of master). Also breaks the input ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 77113dd3eef03dd65b556b672d976817b3f4542e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 11:45:29 2011 +1000 input: Change a bunch of direct dev->u.master accesses to use GetMaster() Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 2936635698619271a790004480a14285149277cb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 12:06:56 2011 +1000 xkb: Fix a check for MASTER_KEYBOARD And copy into the master keyboard, not just the directly attached device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 0ba526deeb4d54ee1a75400291ee7a3673ed4d96 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 12:04:46 2011 +1000 mi: check for MASTER_POINTER instead of manual checks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 52c13896ce9a1e178d4eeed15f68020947cc20ed Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 11:57:06 2011 +1000 mi: update macro to search for MASTER_POINTER Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit d270f12a3e44f4ea01f176a86783e8cd4c59ddf7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 11:55:51 2011 +1000 xfree86: update GetMaster check for the VCP. Same result, but now also triggers on slave keyboards that send pointer events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit ce7f79efd588899f01c74f95c2f58d6dd6d816cd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 11:53:06 2011 +1000 dix: fix a master device access in change_modmap. We need to check if our master keyboard is the given device since we may be a pointer with keys and thus need to change the modmap too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit e1ac704185dee31b427a46cd41a00ef7a28b4129 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 11:42:09 2011 +1000 dix: fix up a master check in ChangeKeyboardMapping handling. We don't just care about the directly attached master, we care about the master keyboard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit febce8cb814df46018f6ae1e6a9daea019b8ad0a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 11:32:28 2011 +1000 Xi: replace a direct master access with GetMaster() Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit df6559237a2d641b2fc38d14975beab9bae0d971 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 18 11:30:10 2011 +1000 dix: add MASTER_ATTACHED as allowed type for GetMaster(). In some cases, we don't know/care whether we want the master pointer or keyboard for a device. Add a new type MASTER_ATTACHED to return the master this device is attached to. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit dc57f89959e549403f8488eb9f23425bd7118b22 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 12:47:37 2011 +1000 Switch to use IsFloating() This is not a straightforward search/replacement due to a long-standing issue. dev->u.master is the same field as dev->u.lastSlave. Thus, if dev is a master device, a check for dev->u.master may give us false positives and false negatives. The switch to IsFloating() spells out these cases and modifies the conditions accordingly to cover both cases. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit e48bf3b6403dde33586ca0e421db61e402525453 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 11:11:57 2011 +1000 xfree86: replace two inputInfo.pointer uses with device loops. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 703baece7ebd128a6742d0523d5b3ebe65126fa5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 12:19:26 2011 +1000 dix: Add IsFloating(device) wrapper. Simplifies check for floating devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 77af45ebc3eda32dc534968cab8d5adfb01bd9e3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 12:48:30 2011 +1000 dix: Simplify retrieving the master device. GetMaster() returns NULL for floating slaves. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit dc32a23890776edf575bf18b3f3c079da6214340 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 15:21:51 2011 +1000 Fix two incorrect checks for master devices. These two were sideeffects of lastSlave being in the same field as the master. For devices generated by the master device directly, lastSlave was 0 and the device would (with the old checks) be interpreted as floating. Add the required checks to safeguard against master devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit d63c979c7fe0f2b114b27e73ebe0a706be8840ae Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 15:21:31 2011 +1000 dix: replace direct master access with GetMaster and temp. device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit c2a9e0a96983f22f721196513e75a53ea0b86d7e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 11:41:47 2011 +1000 mi: simplify a "check for keyboard" condition Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 3a6160b408447ce620140849f962683a5d139cb9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 11:40:01 2011 +1000 mi: remove if 0 code. Note sure why this is in if 0 but it's been that way since 2007. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit d9987c8c45236bc9cfcaf716f4bfcac2a9d0e7e6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 11:22:45 2011 +1000 mi: Add a few comments explaining various cursor move functions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 15fe86e69fc256342881112cd07565527e32435b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 11:01:19 2011 +1000 mi: remove static GenerateEvent variable. Push into the respective devices. This should have no functional changes since we never warp more than one device at a time. In the glorious future with true multithreading, still the better thing to do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr> commit 93a73993708b1345c86ec3ec06b02ed236595673 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 21 15:40:40 2011 +1000 test: write some event → XI1 conversion tests. Don't test everything, but hey, life is short and I'm trying to have one. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 4cdf1013771bc86fe2f6d9223bc4a46753bc918f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 21 15:32:57 2011 +1000 dix: a valuator number of 0 is valid (#34510) For all but motion and proximity events, having no valuators is ok. Regression from 1.9, keyboard events are not converted to protocol events. X.Org Bug 34510 <http://bugs.freedesktop.org/show_bug.cgi?id=34510> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Timo Aaltonen <timo.aaltonen@canonical.com> commit b4ef34d4664e0eaac7211f7a22a2025958aa1527 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Feb 20 11:59:41 2011 +0100 Revert "exa/mixed: Exclude frontbuffer from deferred pixmap handling." This reverts commit 541b25038a5de74411a094570b407c5ae018c2ba. - It turns out that the high latency was a driver problem. - catting a large amount of text turns out to look prettier when the throughput is lower, but it's not worth the loss for a minor improvement that may not even exist on someone else's computer. Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 443d75446bcbe7d97a23860a1e2d46c0b7e7cb26 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 18 14:46:33 2011 -0800 Version bumped to 1.9.99.902 (1.10 RC2) Signed-off-by: Keith Packard <keithp@keithp.com> commit 2c77aeb39f59f1a94cc603a2e6256a62ce785c36 Merge: 816d67d 402b329 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 18 14:29:32 2011 -0800 Merge remote branch 'jcristau/for-keith' commit 816d67de2ba9bdfe652da32cb6447a3056342b98 Merge: a73c28f 3bbb70a Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 18 12:20:26 2011 -0800 Merge remote branch 'whot/for-keith' commit a73c28f0bdafb1c5cb8129179188a99c0ca052e2 Author: Justin Dou <Justin.Dou@intel.com> Date: Thu Feb 10 16:27:29 2011 -0500 Replace malloc with calloc to initialize the buffers[] as NULL in do_get_buffers function The calling for allocate_or_reuse_buffer may fail due to some reason, e.g. out of memory. If the buffers[] were not initialized to be NULL, the following err_out may try to access an illegal memory, which will cause X crash afterward. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Justin Dou <Justin.Dou@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0bc9b15a622377c57e617411ccd26c4b5bf8cba4 Merge: d1123b6 93cd4b1 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 18 12:04:41 2011 -0800 Merge remote branch 'ajax/for-keithp' commit d1123b66ebbcf96dd816236f54befc568a5f7c68 Merge: 5d020c3 f6e4ace Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 18 11:59:25 2011 -0800 Merge remote branch 'jturney/master' commit 649269d40667cfb387cb5286dd3519dd68f7dd80 Author: Bryce Harrington <bryce@canonical.com> Date: Wed Feb 16 16:55:57 2011 -0800 Check for OOM condition in XISendDeviceHierarchyEvent When system is out of memory, calloc can fail returning a NULL pointer. Check for this before dereferencing it, and bail out if it fails. Ref.: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/720445 Signed-off-by: Bryce Harrington <bryce@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 31ddb7ef4f5bac2c13c199e74a0716e43b8dc38e Author: Simon Thum <simon.thum@gmx.de> Date: Wed Feb 2 00:03:44 2011 +0100 dix: avoid FP promotion during pointer acceleration Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 006157f203f8493bb3d18e333a3fd3d6cb10f8ea Author: Simon Thum <simon.thum@gmx.de> Date: Sat Sep 4 16:31:24 2010 +0200 dix: refactor scheme init This makes it possible to init a scheme in one init call, so we get rid of the tightly coupled two-phase init used before. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 38ffeec0c89e83afc62579dec221c325d667cc1e Author: Simon Thum <simon.thum@gmx.de> Date: Sun Feb 6 19:13:00 2011 +0100 xfree86: allow to check for options without warnings in the log This allows set_percent_option in synaptics to work as described, and should generally enable to check option syntax without log spam. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2fbccc881bfab4bdc5b97f74a7e5bcec7fdeae20 Author: Simon Thum <simon.thum@gmx.de> Date: Sun Feb 6 19:07:19 2011 +0100 fix percent options parsing Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 46b49796015762fd131bec96eff6caaa890bfd5f Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 11:28:02 2011 +0000 Input: Allow EventToCore to return multiple events Some event types (notably Expose and GraphicsExpose) require multiple events, a la XI 1.x. Bring the EventToCore API in line with EventToXI's and allow it to generate multiple events. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ea71495adabca52df44241c0eba39e6bceb58202 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 11:28:01 2011 +0000 Input: Reduce use of filter in DeliverEvents Instead of switching on the event filter to determine delivery, use the event type instead. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8a0241656cecb6ab2fb377f02b14238d18e65fc1 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 11:28:00 2011 +0000 Input: Rename EventIsDeliverable return masks Rename the return mask values for EventIsDeliverable: * CORE_MASK -> EVENT_CORE_MASK * XI_MASK -> EVENT_XI1_MASK * XI2_MASK -> EVENT_XI2_MASK * DONT_PROPAGATE_MASK -> EVENT_DONT_PROPAGATE_MASK And don't undef them in dix/events.c, since they're supposed to be global. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 737562257e8ee30b1c438e5160a61fbb26ca609e Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 11:27:59 2011 +0000 Input: Actually send Xi 1.x DeviceStateNotify events When a client has selected for Xi 1.x DeviceStateNotify events, they should receive them when a DeviceFocusIn event is generated. The code to do this was there, but an incorrect test meant they were never being sent. The "type" passed in is the XI2 type, the XI1 type is in event.type. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit da39d57a20d4281fc4099e356645fef980290030 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 15 11:27:57 2011 +0000 Input: Store passive-activating key in CheckDeviceGrabs CheckDeviceGrabs will activate a passive grab for KeyPress and ButtonPress events. GrabInfoRec::activatingKey contains the keycode which activated the passive grab, so we can deactivate it later in ProcessOtherEvents. Previously, CheckDeviceGrabs relied on its callers to set activatingKey, which not all callers were doing (I'm looking at you, ComputeFreezes). Just set it in CheckDeviceGrabs instead. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3bbb70a1a7b24d3d1375b20a13db7011cf961c86 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 16 07:56:58 2011 +1000 xfree86: fix up an out-of-date comment. InitInput simply initialises all input devices now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 402b329c3aa8ddbebaa1f593306a02d4cd6fed26 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 23 13:35:54 2011 +0100 glx: Work around wrong request lengths sent by mesa mesa used to send too long requests for GLXDestroyPixmap, GLXDestroyWindow, GLXChangeDrawableAttributes, GLXGetDrawableAttributes and GLXGetFBConfigsSGIX. Fixes a regression introduced in ec9c97c6bf70b523bc500bd3adf62176f1bb33a4 X.Org bug#33324 <https://bugs.freedesktop.org/show_bug.cgi?id=33324> Reported-by: xunx.fang@intel.com Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 1137c11be0f82049d28024eaf963c6f76e0d4334 Author: Julien Cristau <jcristau@debian.org> Date: Wed Jan 26 13:06:53 2011 +0100 glx: fix BindTexImageEXT length check The request is followed by a list of attributes. X.Org bug#33449 Reported-and-tested-by: meng <mengmeng.meng@intel.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> commit a883cf1545abd89bb2cadfa659718884b56fd234 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 23 17:05:26 2011 +0100 glx: fix request length check for CreateGLXPbufferSGIX The request is followed by an attribute list. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 0f9c6f2f822ff53b9d12ff4fa0b26cbeb7394ba5 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Feb 13 21:36:05 2011 -0800 xkb: Replace malloc(strlen) + strcpy with strdup Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 682865c460945e1299f943561140f46439e2b4cb Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Feb 13 21:36:04 2011 -0800 XkbAddGeomProperty: Fix checks for malloc failure Check the variable we just tried to malloc, not the string we're copying and already checked for NULL at the beginning of the function. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit aac1b435664819008989ed19f73e9c89920602c5 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Feb 13 21:36:03 2011 -0800 Replace _XkbDupString with Xstrdup The two functions have identical semantics, including safely returning NULL when NULL is passed in (which POSIX strdup does not guarantee). Some callers could probably be adjusted to call libc strdup directly, when we know the input is non-NULL. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a4a2e814d5d0e6152307a301eda1d6fc1c555aaa Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Feb 13 21:36:02 2011 -0800 xkb: Use snprintf to measure string lengths instead of manual strlen math Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit c9f7b303a36ca501c6ecf1196c266ee8e8f49d2d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 13:50:10 2011 +1000 xfixes: calloc, not malloc the cursorScreenRec Debugging NULL pointers is significantly easier than random memory. Plus, if new fields (such as pointer barriers) are added they may just be properly initialised. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit d3499556d8d83396fa2585bd00371a81e086be36 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 10 15:12:14 2011 +1000 xkb: if the keymap failed to compile, load the default keymap instead. We really need symbols, compat, keynames, vmods and types for a sensible keymap. Try this in your xorg.conf.d snippets for all keyboards: Option "XkbLayout" "us" Option "XkbVariant" "nodeadkeys" us(nodeadkeys) doesn't exist so xkbcomp provides everything but the symbols map. We say we want everything but don't _need_ anything, the server happily gives us a keymap with every key mapped to NoSymbol. This in turn isn't what we want after all. So instead, require symbols, compat, keynames, vmods and types from the keymap and if that fails, load the default keymap instead. If that fails too, all bets are off. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 47d1d2fed656c3a3b2600491078da90962c46934 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 10 15:11:34 2011 +1000 xkb: split out keymap compilation. Refactoring for simpler double-use in the next patch. No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 787ba25a8a3af52b38448a1a6f8c9704ea8b7905 Author: Carlos Garnacho <carlosg@gnome.org> Date: Mon Feb 7 18:21:31 2011 +0100 Xi: make XIQueryPointer return the current modifiers/group as documented. The previous XKB info was being returned instead of the current one, producing inconsistent results between the latest events and the modifiers/group returned by this call. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>` Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 85f9017393c9bb19553e9afcf554673a44a09993 Author: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Date: Tue Feb 8 11:10:10 2011 +0200 ProcXkbGetXkbByName: fix use of uninitialised bytes valgrind error. ==9999== Syscall param writev(vector[...]) points to uninitialised byte(s) ==9999== at 0x4AB5154: writev (writev.c:51) ==9999== by 0x7C7C3: _XSERVTransWritev (Xtrans.c:912) ==9999== by 0x61C8B: FlushClient (io.c:924) ==9999== by 0x62423: WriteToClient (io.c:846) ==9999== by 0xCE39B: XkbSendMap (xkb.c:1408) ==9999== by 0xD247B: ProcXkbGetKbdByName (xkb.c:5814) ==9999== by 0x4AB53: Dispatch (dispatch.c:432) ==9999== by 0x205BF: main (main.c:291) ==9999== Address 0x557eb68 is 40 bytes inside a block of size 4,096 alloc'd ==9999== at 0x48334A4: calloc (vg_replace_malloc.c:467) ==9999== by 0x62567: WriteToClient (io.c:1065) ==9999== by 0x452EB: ProcEstablishConnection (dispatch.c:3685) ==9999== by 0x4AB53: Dispatch (dispatch.c:432) ==9999== by 0x205BF: main (main.c:291) ==9999== Uninitialised value was created by a stack allocation ==9999== at 0xD1910: ProcXkbGetKbdByName (xkb.c:5559) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> commit 8a34d7a8532c7ca013e67307f3baf200167abb92 Author: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Date: Tue Feb 8 11:10:11 2011 +0200 XkbSendNames: fix use of uninitialised bytes valgrind error. ==537== Syscall param writev(vector[...]) points to uninitialised byte(s) ==537== at 0x4AB7154: writev (writev.c:51) ==537== by 0x8935B: _XSERVTransWritev (Xtrans.c:912) ==537== by 0x6C55F: FlushClient (io.c:924) ==537== by 0x6CCF3: WriteToClient (io.c:846) ==537== by 0xD51D3: XkbSendNames (xkb.c:3765) ==537== by 0xD8183: ProcXkbGetKbdByName (xkb.c:5825) ==537== by 0x27B7B: Dispatch (dispatch.c:432) ==537== by 0x205B7: main (main.c:291) ==537== Address 0x55899f2 is 154 bytes inside a block of size 1,896 alloc'd ==537== at 0x4834C48: malloc (vg_replace_malloc.c:236) ==537== by 0xD47AF: XkbSendNames (xkb.c:3642) ==537== by 0xD8183: ProcXkbGetKbdByName (xkb.c:5825) ==537== by 0x27B7B: Dispatch (dispatch.c:432) ==537== by 0x205B7: main (main.c:291) ==537== Uninitialised value was created by a heap allocation ==537== at 0x4834C48: malloc (vg_replace_malloc.c:236) ==537== by 0xD47AF: XkbSendNames (xkb.c:3642) ==537== by 0xD8183: ProcXkbGetKbdByName (xkb.c:5825) ==537== by 0x27B7B: Dispatch (dispatch.c:432) ==537== by 0x205B7: main (main.c:291) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> commit 87fbef9157a6f1e1318382e368d27942d7ad72ab Author: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Date: Tue Feb 8 11:10:09 2011 +0200 ProcRRCreateMode: fix use of uninitialised bytes valgrind error. ==543== Syscall param writev(vector[...]) points to uninitialised byte(s) ==543== at 0x4AB7154: writev (writev.c:51) ==543== by 0x8935B: _XSERVTransWritev (Xtrans.c:912) ==543== by 0x6C55F: FlushClient (io.c:924) ==543== by 0x6D013: FlushAllOutput (io.c:668) ==543== by 0x27A83: Dispatch (dispatch.c:453) ==543== by 0x205B7: main (main.c:291) ==543== Address 0x556dc8c is 12 bytes inside a block of size 4,096 alloc'd ==543== at 0x48334A4: calloc (vg_replace_malloc.c:467) ==543== by 0x6CE37: WriteToClient (io.c:1065) ==543== by 0x223A7: ProcEstablishConnection (dispatch.c:3685) ==543== by 0x27B7B: Dispatch (dispatch.c:432) ==543== by 0x205B7: main (main.c:291) ==543== Uninitialised value was created by a stack allocation ==543== at 0xA3350: ProcRRCreateMode (rrmode.c:289) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> commit 0ef5973860e17c5edc996c923610f7ad88b4dfbe Author: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Date: Tue Feb 8 11:10:08 2011 +0200 ProcRRQueryVersion: fix use of uninitialised bytes valgrind error. ==9999== Syscall param writev(vector[...]) points to uninitialised byte(s) ==9999== at 0x4AB5154: writev (writev.c:51) ==9999== by 0x7C7C3: _XSERVTransWritev (Xtrans.c:912) ==9999== by 0x61C8B: FlushClient (io.c:924) ==9999== by 0x62743: FlushAllOutput (io.c:668) ==9999== by 0x4AA5B: Dispatch (dispatch.c:453) ==9999== by 0x205BF: main (main.c:291) ==9999== Address 0x55711b9 is 1 bytes inside a block of size 4,096 alloc'd ==9999== at 0x48334A4: calloc (vg_replace_malloc.c:467) ==9999== by 0x62567: WriteToClient (io.c:1065) ==9999== by 0x452EB: ProcEstablishConnection (dispatch.c:3685) ==9999== by 0x4AB53: Dispatch (dispatch.c:432) ==9999== by 0x205BF: main (main.c:291) ==9999== Uninitialised value was created by a stack allocation ==9999== at 0x160E78: ProcRRQueryVersion (rrdispatch.c:37) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> commit 81daba8ce906bfbbe44cd71d0ff269ad34e2f6b5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 31 13:53:08 2011 +1000 Xi: constify XIChangeDeviceProperty() We don't modify "value", make it official. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> commit 93cd4b1034e3c8bed32c5acd391eadd7605e10f0 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:27:00 2011 -0500 shadow: Remove hw/xfree86/ from includes Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 0c230728f3af2c4250e93a070c0851a597069447 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:25:57 2011 -0500 rootless: Remove hw/xfree86/ from includes Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 505defd270e49cfbcbe6a04d1de817d305edb3c2 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:24:20 2011 -0500 damage: Remove hw/xfree86/ from includes Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 59d8e3cbdba032c7354c28c86cbd155e9da6447a Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:23:07 2011 -0500 fb: Remove hw/xfree86/ from includes Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 994b7b3dc97f9afa713fe636af45a78002a4366f Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:17:52 2011 -0500 xfree86: warning fix Did you know that anonymous enums with function scope will not only override the enum values from global scope, but will be treated as entirely different types? C's type system just rules. xf86Crtc.c: In function 'handle_detailed_monrec': xf86Crtc.c:1555:33: warning: comparison between 'enum det_monrec_source' and 'enum <anonymous>' xf86Crtc.c:1562:33: warning: comparison between 'enum det_monrec_source' and 'enum <anonymous>' Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit ae16c5796fdb22fb6b2f680fe5123bfd2c89a825 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:14:11 2011 -0500 fbdevhw: Remove the non-sysfs hack for mapping from PCI to fbdev It's broken for devices with BARs above 4G, and the sysfs method should work everywhere anyway. As a pleasant side effect, this fixes some warnings: fbdevhw.c: In function 'fbdev_open_pci': fbdevhw.c:333:4: warning: cast from pointer to integer of different size fbdevhw.c:334:4: warning: cast from pointer to integer of different size fbdevhw.c:336:4: warning: cast from pointer to integer of different size fbdevhw.c:337:4: warning: cast from pointer to integer of different size Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f1b7c9cead94b520e6b96774d605d63d3f341b50 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:09:19 2011 -0500 int10: warning fix helper_exec.c: In function 'pciCfg1in': helper_exec.c:507:4: warning: passing argument 2 of 'pci_device_cfg_read_u32' from incompatible pointer type /usr/include/pciaccess.h:153:5: note: expected 'uint32_t *' but argument is of type 'CARD32 *' Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit be186586e504197623c69637b8122fb814f59429 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 00:06:48 2011 -0500 xf86vidmode: warning fix xf86VidMode.c: In function 'VidModeGetMonitorValue': xf86VidMode.c:637:19: warning: 'ret.i' may be used uninitialized in this function Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f6e4ace9eabea1bb2a06dd86b6ffb954917a74ce Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Jul 18 13:24:48 2010 +0100 Cygwin/X: Fix for Canadian Multilingual Standard keyboard layout handling Add a keycode mapping for VK_OEM_8 as RCtrl, which is issued by Canadian Multilingual Standard layout Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit b421f5e5122dbe125a5629969cc657bd966b4261 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Apr 1 23:10:58 2010 +0100 Cygwin/X: Ignore MappingNotify events sent to clipboard integration client Ignore MappingNotify events sent to clipboard integration client, xmodmap changes aren't of interest to it, but there is no mechanism to express that disinterest. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit e930aa7bbc7f04a128df8e6fd441aed5123a2eb6 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Sep 14 16:02:53 2010 +0100 Cygwin/X: Add Turkish keyboard layouts to keyboard layout mapping table 0x0000041f "Turkish Q" => layout tr 0x0001041f "Turkish F" => layout tr variant f Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit ae99a6f895a3a5b6f71e2dd4874cd4bb0235aff0 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Jul 18 13:42:29 2010 +0100 Cygwin/X: Make the keyboard layout detection logging a bit clearer Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 57ca09441ee5ff2a8deb95eaa17a2625a756d912 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Jul 1 14:54:48 2010 +0100 Cygwin/X: Update mapping for Canadian keyboard layouts 0x00000c0c "Canadian French (legacy)" => layout ca variant fr-legacy 0x00001009 "Canadian French" => layout ca variant fr 0x00011009 "Canadian Multilingual Standard" => layout ca variant multix Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit be3e5bb50178406e46368be00860331e1b6c4093 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Apr 14 21:45:29 2010 +0100 Cygwin/X: Better keycode debugging output Replace useless #if 0/ErrorF/#endif with winDebug Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 81892bf6b7e3730ebd19318183734f55dbaa5d4b Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Apr 14 21:34:39 2010 +0100 Cygwin/X: Generate X keycodes for multimedia keys Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 5d020c31351594c104fb46615ce41f256cd8e8b9 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Fri Jan 14 15:03:28 2011 +0200 xf86/xv: Only register PostValidateTree hook when there is work to do If none of Xv ports were affected by window tree modifications we don't want scan the port list. To avoid useless scanning of port list PostValidateTree hook is only registered when ClipNotify was called for any port. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com> commit ddf32df5cc2e73b833f6e414276d938fdc38869e Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jan 13 20:50:16 2011 +0200 xf86/xv: Use PostValidateTree to do reput ValidateTree calls first ClipNotify and later might call WindowExposures. To avoid useless double reput ClipNotify delays reput to WindowExposures or PostValidateTree. PostValidatTree checks all ports if there is clip changes. On clip changes reput is done to move or scale the overlay. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com> commit 5678a41f6bc0ef8965bd50a88c5ef01ba7eb8b24 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Jan 17 16:58:00 2011 +0200 xf86/xv: Fill color key on expose If window gets exposed but clipboxes doesn't change drivers would avoid color key fill. This makes XResizeWindo&co to lose colorkey if background is painted. To help drivers to avoid filling colorkey for each put server can provide helper function if there is exposed areas. Server can subtract exposed areas from filled region. As a side effect we can avoid useless color key fills if window only moves in screen without background fills. v3: * Change tracking to filled area to account for client initiated clip changes * Make overlaid XvPutImage behavior like textured XvPutImage or PutImage * Make region dynamically allocated only when required. v4: * Simplify new driver interface to reduce duplicate code Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com> commit 9b048ca420864e19862f63f4a491a4da0ff9b54f Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Jan 17 15:07:28 2011 +0200 xf86/xv: Remove unused variable from XvPortRecPrivate Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com> commit 4f8f803280894a8c41691e350b7a34bfd719fe05 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jan 13 20:21:09 2011 +0200 xf86/xv: Remove unused GC pointers Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com> commit e012f2312b4bcdf31bb5d622ddd34571f3c12429 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jan 13 20:19:18 2011 +0200 xf86/xv: Remove copy paste code. xf86XVFillKeyHelperDrawable can be used to implement xf86XVFillKeyHelper. V2: * Remove RegionTranslate that clobbered parameter region. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com> commit ea1ffd3e60bdcedbec5a6f28929f8677bf45d450 Merge: 12b0f7d 53602c3 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 2 15:19:55 2011 -0800 Merge remote branch 'whot/for-keith' commit 12b0f7df2caa78d68b453aaa91248bb3577fd724 Author: Evan Broder <ebroder@mokafive.com> Date: Tue Feb 1 16:09:50 2011 -0800 xfree86/modes: Be sure to only use new EDID for physical output dimensions The EDID processing regards physical dimensions of 0mm x 0mm as invalid. Previously the old values for height and width would be preserved if none of the physical dimension specifications in the new EDID were considered valid. This will come up in particular if first a monitor is connected to an output, and then a projector is connected. Since projectors generally report physical dimensions of 0mm x 0mm, this would result in the projector claiming to have the physical dimensions of the monitor. Signed-off-by: Evan Broder <ebroder@mokafive.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0b15033031d78836582bd1b641c3160c3803a708 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Mon Jan 31 23:25:10 2011 +0100 xserver: enable TLS even if AIGLX is not enabled This aligns the xorg server build with the mesa build, which is needed on systems where aiglx with dri support is not enabled. Else the following error is obtained when trying to load the software raster: (EE) AIGLX error: dlopen of /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: undefined symbol: _glapi_tls_Context) (EE) GLX: could not load software renderer (II) GLX: no usable GL providers found for screen 0 because mesa always enables TLS use in GLX, even if dri is not available. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 541b25038a5de74411a094570b407c5ae018c2ba Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Jan 30 14:06:16 2011 +0100 exa/mixed: Exclude frontbuffer from deferred pixmap handling. - Apps like xterm can trigger a lot of fallback rendering. - This can lead to (annoyingly) high latencies, because you have to wait for the block handler. - You need a driver that doesn't directly access the front buffer to trigger this (NV50+ nouveau for example). - Repeatingly doing dmesg on an xterm with a bitmap font will reveal that you never see part of the text. - I have recieved at least one complaint in the past of slow terminal performance, which was related to core font rendering. - This does sacrifice some throughput, roughly 33% slower. Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit af87f6367ef733d1a4f3cfca4eeb92bfd84c2b6f Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Jan 30 14:06:15 2011 +0100 exa: Only call driver FinishAccess hook if PrepareAccess hook succeeded. Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 648d4fe5172cad33c6f09e05dd3d8d7171ef1a7f Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Jan 30 14:06:14 2011 +0100 exa/driver: set pExaPixmap->use_gpu_copy to the right value - Not sure if it was causing problems, but you never know. Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 246d40b685292fa6393ba22127152137494af2af Merge: 70f2d39 8c1f75a Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 2 14:51:33 2011 -0800 Merge remote branch 'jeremyhu/master' commit 70f2d39fbde38d0baa687f1755b6c4c686f23052 Merge: 3a91c2d a9d3c43 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 2 14:43:19 2011 -0800 Merge remote branch 'jturney/master' commit 3a91c2d21c3231e2a011d95c3cfc01785430c1cf Merge: ac0a00a 82b1eaa Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 2 14:37:00 2011 -0800 Merge remote branch 'dbn/build-fixes' commit ac0a00a840a5d8d8374e5db2b849e5959550ca4e Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 23:01:03 2011 -0500 xselinux: Fix GetDrawableContext M_DRAWABLE_PIXMAP is the lookup mask to dixLookupDrawable, and _not_ the type value in the drawable itself. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8c1f75a1d4cb5a34b4d10f3f5068bccc4356f31a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Jan 28 21:13:38 2011 -0800 XQuartz: Localization Updates Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 53602c36217487e0a80880e8328f89ab302d85c8 Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:49 2011 +0200 xfree86/dga: Remove DGAIsDgaEvent() DGAIsDgaEvent() is not used anymore. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2081728b7432e949c274e0dbbabc296fa4db17f9 Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:48 2011 +0200 xfree86/dga: Only send DGA events for master devices Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9f09b62e594321a8e45a33f4f13559827d660ed3 Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:47 2011 +0200 xfree86/dga: Remove useless ifdefs Move some variables to the scope where they are used. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5c941c04ca68cdc2b236c524970bc23f91906af4 Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:46 2011 +0200 xfree86/dga: DGAProcessKeyboardEvent() forgot ET_Internal Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit ce4e0f660beb097e90110c97d039981702f0b0bd Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:45 2011 +0200 xfree86/dga: Remove DGAMouseX and DGAMouseY Previously some sort of absolute coordinates were sent out in the padding of the DGA2 Motion and Button events. DGAMouseX and DGAMouseY were used to keep track of said coordinates. libXxf86dga doesn't use that data for anything, and at least git history didn't show any past usage either. So let's just remove the last remnants of of this mess. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit ee8faeadb60f51a36edce19e568600dab7c8b357 Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:44 2011 +0200 xfree86/dga: DGA2 events are missing the dx/dy information Copy dx/dy from the internal event to the DGA2 Motion/Button events. Do the same for Key events for the sake of keeping the code consistent. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit e3fef815cf85cf59256f3edeaa21c1267898b42c Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:43 2011 +0200 xfree86/dga: Make mieq_install Bool mieq_installed is used as a boolean, so why not make it such. Also it's a static variable, so the the explicit zero initialization can be removed. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit f4cb25c2ed832bf4cfcd4d25198fe5a895430fed Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:42 2011 +0200 xfree86/dga: Remove the ET_DGAEvent handler only if it was installed Remove the handler only if it was installed. Also mark it as uninstalled, otherwise it wouldn't get reinstalled after a server reset. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit e1547a9f1f6d7991219b7711f4cacc2852dbf88c Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:41 2011 +0200 xfree86/dga: Install the DGA event handler when DGA2 is used The ET_DGAEvent handler is only installed when a client requests relative events via DGA1. Do it also when a client requests DGA2 events. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7b16e8633d5a95167aac0c19e43fcfe38bd4a6a4 Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:40 2011 +0200 xfree86/input: Restore DGAStealKeyEvent() DGA key event support was lost in commit 8da0ff2d51086666d10ca7330d428e8610a4a0e3. Bring it back. Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit a2c481821997ae14aa5816895ae36db2ca2e4dec Author: Ville Syrjala <syrjala@sci.fi> Date: Mon Jan 24 01:06:39 2011 +0200 include: Fix a copy/paste error in a comment Signed-off-by: Ville Syrjala <syrjala@sci.fi> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 77af0dc5217fc9c446097d6d487c8ddaf00bdd2a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 24 10:06:34 2011 +1000 xfree86: bump input minor ABI The new valuator_mask_free() call requires a minor bump. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5927e070b45fbe3fea4b394920ffd6f7d036f1ed Author: Erkki Seppälä <erkki.seppala@vincit.fi> Date: Fri Jan 21 15:56:22 2011 +0200 xkb: Cancel a key's repetition when its autorepeat is disabled. When XkbChangeEnabledControls is called to disable key repetition of a certain key (or keys), currently ongoing repetition of that key was not cancelled. It was cancelled if ChangeKeyboardControl was used to disable key repetition globally. Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a9d3c43a57cbaf42d9e96ad49cf12bbf1d275fe5 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Jan 19 15:57:59 2011 +0000 Fix compilation of xf86bigfont.c xf86bigfont.c: In function 'XFree86BigfontExtensionInit': xf86bigfont.c:146: error: 'ProcXF86BigfontDispatch' undeclared (first use in this function) xf86bigfont.c:147: error: 'SProcXF86BigfontDispatch' undeclared (first use in this function) It seems this has been broken since commit cbd4d5dbb70db62ba1cb79c7b904e6fa11f62d7e "delete pervasively use of DISPATCH_PROC" (2010-09-28), which is a bit worrying as that presumably indicates that no tinderbox is configuring with --enable-xf86bigfont. In a similar fashion to that commit, fix by moving XFree86BigfontExtensionInit() below the definitions of the static dispatch functions it references. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Julien Cristau <jcristau@debian.org> commit effaf9459c450f13e35bf263835d3e37d48ff29d Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Jan 23 22:35:34 2011 -0800 XQuartz: Use the default signal handler This allows better interaction with CrashTracer Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 418bb57a3923311338baa8a85c0794a72e15ceeb Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Jan 13 17:12:17 2011 -0800 XQuartz: Call RRScreenSizeNotify after handling externally-generated XP_EVENT_DISPLAY_CHANGED We get an XP_EVENT_DISPLAY_CHANGED event when our display configuration is changed. If this change was caused by hotplugging a monitor or Mac Display Preferences changes by the user, we need to call RRScreenSizeNotify in order to ensure new connections get the correct screen size. http://xquartz.macosforge.org/trac/ticket/460 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 6f52b10b9e8068e3deafb2bbb64b62175a208c49 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Jan 13 16:08:46 2011 -0800 XQuartz: Bump version string to 2.6.1 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 1cfb96dd6151ebe84a9a26a428005db97e5d5577 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Jan 13 16:08:29 2011 -0800 XQuartz: Update copyright dates in bundle's plist Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit be3be7580b6f6fd2f7fa4d4abfe5e1ab19470223 Merge: 57a1d9b a1d885f Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 20 21:21:21 2011 -0800 Merge remote branch 'ajax/for-keithp' commit 57a1d9b85331f6fe19d5111f5163139572ffbf02 Merge: 24ce650 6423769 Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 20 21:16:24 2011 -0800 Merge remote branch 'whot/for-keith' commit 24ce650cf4f0c6fa72faecd38c53d40703e6c959 Merge: bbdf81a 09fd010 Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 20 21:11:53 2011 -0800 Merge remote branch 'jturney/jturney-framebuffer-resize-for-master' commit bbdf81a056be0ea645da17a642dad5eadef3a906 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue Jan 18 19:26:20 2011 -0800 Add xorg.conf.d shadow man page pointing to xorg.conf man page Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Tested-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a1d885fdd67503a442b348626d2eddf6d22419e8 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jun 23 13:28:55 2010 -0400 resource: Fix indentation Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit cb61cf5c99004ba3c76b504220c6728b5f2d2de6 Author: Adam Jackson <ajax@redhat.com> Date: Thu Apr 15 18:36:55 2010 -0400 resource: Remove expectID hack This is clearly meant to short-circuit the (modestly) expensive resource lookup in LegalNewID. The problem is that long-lived clients will eventually run completely through their XID space and start asking XC-MISC for IDs to reuse. Once that happens, the comparison against expectID will always be true, and we'll no longer catch XID collisions at all. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 3282e3c627f97f079e3a9af756a6b13bd9a5f227 Author: Adam Jackson <ajax@redhat.com> Date: Thu Apr 15 08:46:28 2010 -0400 resource: s/NullResource/NULL/g Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f953ae7d8a578d135a6faaf69d9c06eae7c85ede Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 14 14:38:10 2009 -0500 os: Reduce smart scheduler setup calls We can return from WaitForSomething with no clients ready for any number of reasons. There's no reason to set up the scheduler timer when this happens. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit d127075da06239852c1cc745abfe63d0d180d984 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 19:03:33 2011 -0500 xdmxconfig: warning fix xdmxconfig.c: In function ‘dmxConfigCanvasDraw’: xdmxconfig.c:299:23: warning: ‘maxHeight’ may be used uninitialized in this function Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 7a08f9abef7219fabdab8d1d49e8d3afb042e36a Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 18:59:39 2011 -0500 dmx: warning fixes dmxinputinit.c: In function ‘dmxBlockHandler’: dmxinputinit.c:610:44: warning: cast from pointer to integer of different size dmxinputinit.c: In function ‘dmxWakeupHandler’: dmxinputinit.c:637:41: warning: cast from pointer to integer of different size dmxinputinit.c: In function ‘dmxInputInit’: dmxinputinit.c:1041:36: warning: cast to pointer from integer of different size Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit ffd323b7c0212ed9b348e51cd9b36363d7c4d1f2 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 18:55:20 2011 -0500 dmx: warning fix dmxinputinit.c: At top level: dmxinputinit.c:135:29: warning: ‘DMXCommonOth’ defined but not used DMXCommonOth is actually mentioned in a #if 0 block, so delete it and the block that references it. If anyone needs it, git remembers. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit c1fe0b155d0567440228aa5d9e36036f37670e3b Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 18:52:57 2011 -0500 dmx: warning fix dmxgc.c: In function ‘dmxChangeClip’: dmxgc.c:386:5: warning: case label value exceeds maximum value for type dmxgc.c:387:5: warning: case label value exceeds maximum value for type dmxgc.c:388:5: warning: case label value exceeds maximum value for type dmxgc.c:389:5: warning: case label value exceeds maximum value for type Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit b02e006b2733ea457df41791f6054309e4edf7f6 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 20 18:46:00 2011 -0500 dmx: warning fixes Dear gcc: I do not care about machines where sizeof(void *) < sizeof(int), and neither should you. dmxextension.c: In function ‘dmxBECreateResources’: dmxextension.c:858:26: warning: cast from pointer to integer of different size dmxextension.c: In function ‘dmxBERestoreRenderPict’: dmxextension.c:1062:29: warning: cast from pointer to integer of different size dmxextension.c: In function ‘dmxBERestoreRenderGlyph’: dmxextension.c:1084:35: warning: cast from pointer to integer of different size dmxextension.c: In function ‘dmxAttachScreen’: dmxextension.c:1277:8: warning: cast to pointer from integer of different size dmxextension.c:1286:34: warning: cast to pointer from integer of different size dmxextension.c:1292:35: warning: cast to pointer from integer of different size dmxextension.c: In function ‘dmxBEDestroyResources’: dmxextension.c:1456:26: warning: cast from pointer to integer of different size dmxextension.c: In function ‘dmxDetachScreen’: dmxextension.c:1599:8: warning: cast to pointer from integer of different size Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 64237697994871adfcf4905b5784e75cd7281579 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 13 12:20:38 2011 +1000 xkb: after making changes to the xkb ctrls, copy them back into kbdfeed. enabled_ctrls_changes nowhere near the usual event or config paths. So this condition always evaluated to false and the memcpy would thus never been hit. As a result, any modification to the XKB struct during XkbUpdateDescActions was not reflected in the kbdfeed ctrls. The flag that is set by XkbUpdateDescActions() if ctrls were changed are in enabled_ctrls. This mainly affected keyboard repeat control as XKB uses the kbdfeed ctrls, not XKB's per_key_repeats, to determine if a key needs to be repeated. Thus, adding a "repeat= False" to the XKB map of any action did not have any effect. Test case: assign Mode_switch to any key that by default repeats, e.g. the menu key. key <COMP> { [ Mode_switch ] }; Then modify the Mode_switch action to not repeat the key. interpret Mode_switch+AnyOfOrNone(all) { virtualModifier= AltGr; useModMapMods=level1; action= SetGroup(group=+1); // Add this line repeat= False; }; Though the flags are correctly reflected in the description loaded in the server, the change is not handed back to the kbdfeed struct and XKB will trigger softrepeats of this key. This patch also adds two explanatory comments and an extra check, as this path may be hit before the CtrlProc for the kbdfeed struct is set. Red Hat Bug 537708 <https://bugzilla.redhat.com/show_bug.cgi?id=537708> Also fixes broken auto-repeat of the backspace key in the colemak layout (mapped to CapsLock). X.Org Bug 16318 <http://bugs.freedesktop.org/show_bug.cgi?id=16318> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Dirk Wallenstein <halsmit@t-online.de> Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit f1326ed2910bd985fafdb48714b1d6f38116b083 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 13 09:19:28 2011 +1000 xkb: Replace a few manual bitflips with SetBit & friends. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> commit 16eb4f2a7b67ee169785973f9e0a3773e13fdea6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 7 09:53:35 2011 +1000 Xi: reset remainders when warping the device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 09fd010902fad56735b8069b1becb80d85bd6a35 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Sep 29 22:54:22 2010 +0100 Cygwin/X: DirectDraw engines shouldn't try to blit if the surface wasn't allocated Fix winShadowUpdateDD(|NL) so we don't try to blit to primary surface if it didn't get allocated (Intel drivers, in particular, seem to like to issue a WM_DISPLAYCHANGE during a suspend/resume cycle, but not allow surface to be allocated right then) Also: Use winReleasePrimarySurfaceShadowDD(|NL) in winFreeFBShadowDD(|NL) rather than open coding it Don't mess about recreating surface if we're going to resize it anyhow Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 625ab9701fd75b879c1dafc05fa979591eea87c0 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Aug 31 13:45:43 2010 +0100 Cygwin/X: Simplify and consolidate reporting of the bpp value we are going to use Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 3f7339a7c5d3dcd05909b041865125f4cb6fa29e Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Aug 31 10:13:01 2010 +0100 Cygwin/X: Deal with RANDR depth changes correctly in ShadowGDI drawing engine Make ShadowGDI drawing engine only change the size of the screen pixmap/shadow framebuffer on an RANDR change, not the bpp/depth as well. The server requires the screen pixmap's depth to be invariant. Other drawing engines aren't quite as affected by this issue as they won't draw to the display, if it has changed colour depth, but probably still need some attention. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 8b22f83113fbdc09b932b5ad7e44f629fc15e3b5 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Aug 30 17:17:57 2010 +0100 Cygwin/X: Use winUpdateFBPointer() in winshaddd.c rather than duplicating it inline Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 8385c426f86e9955e9e570a46f75bddd3c10ca01 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Aug 10 21:55:15 2010 +0100 Cygwin/X: Remove WIN_DIB_MAXIMUM_SIZE check This is only relevant to pre-NT versions of Windows, which are all EOL. Also, it's in the wrong place now as framebuffer can get resized. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 981ad1f364cf4fe8008c0f3592eb0f73dd14a118 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Aug 10 16:24:57 2010 +0100 Cygwin/X: Fix a typo in command line argument validation code Fortunately, these swapped constants are benign as they have the same value, 0 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 5390b494672393506466d8afdb9b146b0e585cc0 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Aug 10 13:16:13 2010 +0100 Cygwin/X: Don't turn off -multiplemonitors when all monitors don't have the same pixel format when using shadow GDI engine Don't turn off -multiplemonitors when all monitors don't have the same pixel format and when using shadow GDI engine, just warn that performance may be degraded Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 33106e1e807a828208b306512e78c5e3e93960d3 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Mar 30 19:49:41 2010 +0100 Cygwin/X: Generate RANDR change on WM_DISPLAYCHANGE for rootless modes When RANDR resizing is enabled, generate an internal RANDR change when WM_DISPLAYCHANGE occurs in rootless modes for screens which occupy an entire monitor or the virtual desktop. Store the monitor number and use that to handle WM_DISPLAYCHANGE for a screen specified with '-screen @monitor' In rooted mode, WM_DISPLAYCHANGE isn't relevant (except where display depth changes may cause problems). (A maximized screen window will get WM_SIZE to adjust it to the new monitor size) In rooted fullscreen mode, WM_DISPLAYCHANGE shouldn't be seen, as we have the resolution we have selected for the fullscreen session) (Could client randr requests be handled in fullscreen to cause a change of the fullscreen resolution? ) Don't bother do a RANDR resize if the dimensions aren't actually changing when WM_DISPLAYCHANGE is sent (should handle WM_DISPLAYCHANGE to size 0x0 that the intel driver seems to like to send) Various debug output improvements Also, remove the note that XWin can't handle display mode changes from the man page Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit bbc511e80b2a9365f6a1528bc1595772f83be654 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Feb 15 13:42:04 2010 +0000 Cygwin/X: Make WM_SIZE use RandR resizing when -resize=randr To avoid recursion, WM_SIZE requests shouldn't generate XRANDR requests when no change is neeeded. We do the actual resize on WM_EXITSIZEMOVE, as resizing occurs in a modal loop, to avoid a backlog of resize events building up as the X server doesn't get a change to process anything until the resize is completed. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 85c497a8b6c488ef9ea2c6d7b49e6f9b992fb4a2 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Mar 30 20:48:10 2010 +0100 Cygwin/X: Implement framebuffer resizing in RANDR extension Implement framebuffer resizing in RANDR extension: Resize the frame buffer, the screen's root window and the native window containing the root window image. Correctly allow for decorations in new native window size when resizing native window to fit the new framebuffer size with AdjustWindowRectEx() Update physical size info for a screen when it is changed by RANDR Forbid client-requested RANDR changes in fullscreen and rootless modes Only resize window on an external RandR request, to avoid recursing on a WM_SIZE requested resize. Also, add prototypes for winRandRInit() and winDoRandRScreenSetSize() to header file Also, update the author list and copyright for winrandr.c Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 873abef315f5d947b864428891381bff539c5869 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Mar 30 20:07:19 2010 +0100 Cygwin/X: Add -resize command line option Add -resize command line option to configure how native window sizing frame is used. In additions to the existing fixed and scrollbars modes, add a new mode to allow framebuffer to be resized using native window frame Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 46c57788539d8a5f0246528b4f88ad4ed6d867d1 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Feb 23 15:44:36 2010 +0000 Cygwin/X: Move QueryMonitor() out of windprocarg.c Move QueryMonitor() out of windprocarg.c into a new file, winmonitors.c, as we use to use it from other places as well Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 73b02e964787ea9fb2d139dc781c9b2495ccb031 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Feb 12 12:29:30 2010 +0000 Cygwin/X: Remove an attempt at detecting if WM_DISPLAYCHANGE affects the X screen Remove an attempt at the rather difficult optimization of detecting if WM_DISPLAYCHANGE affects any of the monitors which intersect the native window for the X screen. We'll always act as if it does, which it probably usually the case. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit a46146af5f6c2d96728c43f0df369ea00bcae017 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Apr 1 21:00:43 2010 +0100 Cygwin/X: Rather than storing calculated physical display sizes, calculate them when needed (This stored calculation was wrong if -dpi came after -screen on the command line, anyhow) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit df518001271dbc0c49935350b755f0c0562cdb92 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Oct 13 14:47:33 2009 +0100 Cygwin/X: Refactor framebuffer allocation/release in drawing engines Refactor the drawing engines so we can explicitly allocate and release the framebuffer for a screen Move the setting of dwPaddedWidth into the DDNL engine, so it is updated when the framebuffer changes size Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit 708d0b9781c6f3f0c0ae7052f45223b1c2524809 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Oct 13 14:48:17 2009 +0100 Cygwin/X: Enable building of nativegdi and primaryfb engines to avoid further rusting Some trivial build fixes required Also fill out all function pointers for primaryfb engine Also tidy up the man page section describing drawing engines. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit c6aa4755ec355101a62bef86dbb090262fe806f6 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Jan 15 12:13:39 2011 -0800 xkb/ddxLoad.c doesn't need <paths.h> any more Was previously used for _PATH_VARTMP, but that was removed in 534fc5140b039a8c98ab715d0a6740d513b41209 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit abfea17342da774aa4e3a351a73c8f2af6e6fd28 Merge: 3611283 e65c3f8 Author: Keith Packard <keithp@keithp.com> Date: Tue Jan 18 15:19:34 2011 -0800 Merge remote branch 'ajax/for-keithp' commit 361128389e5cb0101cbd091ff8de77cf34608f6c Merge: 65ceaad d9225b9 Author: Keith Packard <keithp@keithp.com> Date: Tue Jan 18 15:18:08 2011 -0800 Merge remote branch 'jcristau/for-keith' commit 65ceaadbf0fb65f1962cb96d5b87fd1175f85a3b Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:28:31 2011 -0500 Xquartz: rename man page directory from doc to man Following the convention makes it easier to locate man pages, user's or developer's documentation and specifications. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7ed0d426f616fe9e44ac7091622a798f2043dfe4 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:28:30 2011 -0500 xfree86: use sed rather than cpp to perform string substitutions Makefile.am: there are only 4 string substitutions to be done in this file. SED is much simpler than the C pre processor which adds its own strings which must be substituted by sed, still. xorgconf.cpp: replaced __xconfigfile__ with xorg.conf as this file name is hard coded in the xserver configuration and cannot change. Replace XCOMM with # permanently. Delete cpprules.in as it isn't used anywhere else. Should one need cpprules for real cpp work, there is one in Xquartz from which the the old man pages code have been stripped. Fix trailing spaces. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 885a3330092c13786baa3aaabd728e71962486c4 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:28:29 2011 -0500 man: refactor common code in the man pages makefiles Create a manpages.am makefile snippet in the root dir. Each man page makefile includes manpages.am. Now all man pages in xserver are generated the same way using the same method as all of other xorg modules. All ".man.pre" files in git are ".man" now. Links are no longer created between different file types. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit c86f7c2b8eedd3126066a3aff44bc8767eb5e277 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:28:28 2011 -0500 Xdmx: build all man pages using XORG_MANPAGE_SECTIONS Use standard directory and makefile. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9bd9d550a0d6fb4fe3daacb604658de92e69d99c Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:28:27 2011 -0500 exa: build man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Fix trailing whitespaces Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d4b1fd3ff66d1a3e44a85aed34d9a01eee0d37fd Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:28:26 2011 -0500 fbdevhw: build man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Fix trailing whitespaces Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit b9276cb86b433bc740fe26c2e624d3d5399732f6 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:53 2011 -0500 XFree86 utils: build utils man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Fix trailing whitespaces Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit ac5ffef60e05eb05275913b133786709881e7e7e Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:52 2011 -0500 Xephyr: build Xephyr man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Fix trailing whitespaces Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9240cffd659b1c13d66162200c6e384ea1cdbc44 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:51 2011 -0500 Xvfb: build Xvfb man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Fix trailing whitespaces Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 3f4c71799b3164440624d09b7b631d3d3c0a29ef Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:50 2011 -0500 XWin: build XWin man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Now can be built easily on any platform in the man directory Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit b8492e18a7e5322c4a492f6cf6cfeb5b0221d994 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:49 2011 -0500 Xnest: build Xnest man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 57ca20d26614a0787cdd0db91a2eb8cdb301f2dc Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:48 2011 -0500 Xquartz: strip the man page code from cpprules.in This is dead code which will not be used in the future. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit c06c46acdc2ead20a6030118fad6092b3da6709f Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:47 2011 -0500 Xquartz: build Xquartz man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) Use standard directory and makefile Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit a9e85013b1045c7e02891a019bfa8042a219b7f1 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:46 2011 -0500 man: build Xorg and xorg.conf man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file extensions (.man) means no need for .gitignore Use standard directory and makefile Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit dcdd8ea82c0e2f657abdc80a22aa0c01ead07e54 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jan 9 20:27:45 2011 -0500 Xorg.man: fix whitespace issues Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d9225b9602c85603ae616a7381c784f5cf5e811c Author: Julien Cristau <jcristau@debian.org> Date: Wed Nov 10 22:39:54 2010 +0100 glx: validate numAttribs field before using it Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 62319e8381ebd645ae36b25e5fc3c0e9b098387b Author: Julien Cristau <jcristau@debian.org> Date: Sun Aug 22 16:20:45 2010 +0100 glx: swap the request arrays entirely, not just half of them Various glx requests include a list of pairs of attributes. We were only swapping the first half. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 6c69235a9dfc52e4b4e47630ff4bab1a820eb543 Author: Julien Cristau <jcristau@debian.org> Date: Sun Aug 22 00:50:05 2010 +0100 glx: check request length before swapping Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org> commit ec9c97c6bf70b523bc500bd3adf62176f1bb33a4 Author: Julien Cristau <jcristau@debian.org> Date: Sat Jul 3 19:47:55 2010 +0100 glx: validate request lengths Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 3f0d3f4d97bce75c1828635c322b6560a45a037f Author: Julien Cristau <jcristau@debian.org> Date: Sat Jul 3 19:42:26 2010 +0100 glx: make sure screen is non-negative in validGlxScreen Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 82b1eaa6cad20f39dbf15573bdb3d62acbcd91f9 Author: Tom Fogal <tfogal@alumni.unh.edu> Date: Wed Dec 22 14:39:48 2010 -0700 Autodetect TLS support instead of defaulting to disabled. Uses the AX_TLS macro to figure out if the current platform supports TLS. If it does, enable TLS automagically. Still respects --enable option, regardless. Signed-off-by: Tom Fogal <tfogal@alumni.unh.edu> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 93393411e39fbb0f72cf6c2f79ebde177aa86932 Author: Tom Fogal <tfogal@alumni.unh.edu> Date: Wed Dec 22 16:03:03 2010 -0700 Add macro for detecting thread local storage support. This adds an AX_TLS macro which attempts to identify if the underlying compiler/platform supports thread local storage (TLS). The macro comes from the autoconf macro archive. Signed-off-by: Tom Fogal <tfogal@alumni.unh.edu> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 60801ff8703ec36995139a6dd7b1fc26ae8854a6 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Tue Nov 23 11:38:50 2010 -0800 xfree86: Convert libxf86config to static libtool library In order to use libxf86config in a shared library, all the code must be compiled with -fPIC. Add proper PIC support for libxf86config by turning it into a libtool library. However, since we don't want to guarantee API or ABI stability, make sure it's only built static. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Gaetan Nadon <memsize@videotron.ca> commit 8456625d64bb0013a496f3b56ea3aa20cf7a6142 Merge: aa30a86 ce74e75 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 7 09:35:07 2011 +1000 Merge branch 'for-peter' of git://people.freedesktop.org/~daniels/xserver into for-keith commit aa30a86583c3fc1a83c46e8c7583182d750edcde Author: Tomas Carnecky <tom@dbservice.com> Date: Sun Aug 1 21:28:18 2010 +0200 NO_PANORAMIX preprocessor symbol is nowhere defined Which makes it useless, so remove it. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fc6cbee772bafabf7ddd7a75043bd55bb78ad09e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 6 12:58:00 2011 +1000 input: add valuator_mask_free() to free a valuator mask. Expecting the caller to free the mask requires us to keep it in a single memory block (which may be an issue lateron), aside from leaving the API asymetrical. Provide valuator_mask_free() to free the memory and reset the mask pointer to NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 4fbadc8b17237f3c7f8c0bf56003d1139c86655e Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jan 6 11:32:26 2011 +1000 Input: Prevent MD grabs from wandering on to other MDs The code to set sync.other in DeliverGrabbedEvents is supposed to reset sync.other for a paired MD to the grab under consideration, but was rather optimistic in resetting sync.other for _all_ devices. This would fall apart given two sets of MDs (A paired with B, Y paired with Z), where both MDs were in FREEZE_BOTH_NEXT_EVENT due to being called with SyncBoth, where no event had yet triggered the grab. An event being processed on MD A would result in B, Y and Z all having sync.other set to A's grab, rather than just B. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e65c3f8bcc86845f21ac575e2bfb4b21b67d5ebf Author: Adam Jackson <ajax@redhat.com> Date: Wed Jan 5 12:04:19 2011 -0500 dix: Add a Screen method for additional cursor confinement This just reserves the slot in the ABI. Confining cursors to CRTCs will come soon. v2: Just reserve the slot. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit ce74e7562dcc800306ff92b6d3c5ee885cd4763d Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 7 11:48:14 2010 +0000 Input: Make CheckPassiveGrabsOnWindow return grab, export Change CheckPassiveGrabsOnWindow to return the GrabPtr it used (or NULL if none) rather than a boolean, and export it. Also add an additional boolean 'activate' parameter; use TRUE for existing behaviour, or FALSE to only find the grab and then return it. This will be used in forthcoming touch patches to find the grabs, rather than open-coding same. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit eb5aaf5eb819f1287ce40da79edbe07bafb2b5c0 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 12:15:28 2010 +0000 Input: Export GetEventMask Make it non-static, add to headers. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 30c8c7a86310139e79c9698caee21b3bd51936bd Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 12:13:29 2010 +0000 Input: Handle grabs with no Xi 1.x equivalent Don't try to search for an Xi 1.x grab in CheckPassiveGrabsOnWindow for events with no Xi 1.x equivalent. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 690476250f58616d5156317e01ba547497f4331a Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 20 15:03:05 2010 +1000 Input: Pass sprite instead of device to XYToWindow, make non-static XYToWindow calculates the position of the cursor and updates the sprite trace, but does nothing else with the device. Pass a SpritePtr instead so we can update an alternate focus instead of hardcoding the device's sprite. Also make this function non-static, so we can use it elsewhere. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 07a892cd8276f8092de95f1909f2ebec6f5fdf08 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 20 15:03:04 2010 +1000 Input: Pass sprite instead of device to FixUpEventFromWindow Since FixUpEventFromWindow only uses the sprite trace to determine the window stack, pass in a sprite instead of hardcoding the device sprite, so we can deliver to windows other than the one currently containing the sprite. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 10d6c3ca103ea155488cd2f29052334b5691e680 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Dec 27 13:06:03 2010 +0000 Input: Make RootWindow() take a sprite instead of device GetCurrentRootWindow already works for the device case, although not as an lvalue. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 23c37ce1fe42e3da0609a566478e947843b05023 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Dec 27 12:48:42 2010 +0000 Input: Export SpriteRec for use in public API Change its definition to be more in line with other structs, so we can use it from input.h. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 06a103ad1d6a0ef6146c97a8c81dc7de1c0a0083 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 16:37:48 2010 +0000 Test: Input: Test up to supported server, not protocol, events When building against a newer inputproto, the server may support fewer than XI_LASTEVENT events. We already have XI2LASTEVENT for the highest event number supported by the server, so use that instead. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit a083efe8715e8b29c9bd7f4e7bb429a94620bfc4 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 16:06:29 2010 +0000 Test: Input: Check flags on DeviceEvent Add initial validation of acceptable flags for XI2 device events, and make sure they're swapped. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 2592effef5f171af3f01a2b5130d9747403140f6 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 13:42:06 2010 +0000 Test: Input: Add helper function for failing EventToCore We have quite a few tests which involve checking that EventToCore fails for specific events, so refactor them into a separate function. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit e1aed88be92c27d76bff1743f35f9915dea9264f Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 17:00:29 2010 +0000 Input: Swap flags in DeviceEvents Swap flags for different-endian clients when delivering XI2 DeviceEvents. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 6358a60065eef167d4e5f4afd981ff26deeba80d Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Jan 6 09:55:41 2011 +0100 EXA: Pad size of system memory copy for 1x1 pixmaps (bug #32803). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=32803 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f3480286aeb3009623d8d4b0202eadda0049552d Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Jan 5 20:41:09 2011 +0200 composite: Support updating an arbitrary subtree Rename compUpdateWindow to compPaintWindowToParent and split the child walk to compPaintChildrenToWindow. Calling compPaintChildrenToWindow allows an arbitrary subtree to be updated, instead of having to update all the windows. This will be used to make sure all the descendants are copied to the parent when the parent window contents need to be accessed in IncludeInferios sub-window mode. WindowRec has a new member 'damagedDescendants' that is used to keep track of which subtrees need updating. When a window is damaged, 'damagedDescendants' will be set for all the ancestors, and when a subtree is updated, the tree walk can be stopped early if no damaged descendants are present. CompScreenRec no longer needs the 'damaged' member since the root window's 'damagedDescendants' provides the same information. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b89e6dbdfbb50e3b5bc7fcb7eccc397c467c92f8 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Jan 5 20:41:08 2011 +0200 composite: Add SourceValidate wrapper When SourceValidate is performed on a window with IncludeInferiors sub-window mode, force an immediate update of all the automatically redirected windows, so that the current window contents will be up to date. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 84154954db54696d4661eb8d0a6014cdbff3c91f Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Jan 5 20:41:07 2011 +0200 composite: Add GetImage wrapper When GetImage is performed on a window, force an immediate update of all the automatically redirected windows, so that the current window contents will be up to date. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit a5dc3531e14589ac473cea482944d2d67517aabd Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Jan 5 20:41:06 2011 +0200 Revert "composite: Convert compWindowUpdate to use TraverseTree" TraverseTree visits the parent before the children. When performing the automatic redirection updates, the children must be visited before the parent. If there are automatically redirected windows on multiple levels of the tree, updating the parents before the children would cause the parent updates to use stale data for areas covered by the children. Also updating the damaged children would re-damage the parent, which would cause additional walks over the tree. In the worst case with an unbroken chain of automatically redirected subwindows, all of which are damaged, only the leaf window would be properly updated on the first round. Then it's parent would be properly updated on the second round, and so on. And on every round all of the ancestor windows would be updated as well, but with stale data. So with N damaged windows you would end up with (N^2+N)/2 updates, instead of the expected N. This reverts commit 648c8871c92727d7b6b16859f27f12266a06a16e. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0998574699502e6ab14fd8899c2e42961d4df7d0 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Jan 5 20:41:05 2011 +0200 Call SourceValidate even if src == dst The extra SourceValidate calls from damageCopyArea and damageCopyPlane can be removed. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit e41e907b3c19908f5316346fa587ced3115478cd Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Wed Jan 5 20:41:04 2011 +0200 Add subWindowMode parameter to SourceValidate Pass the subWindowMode from the GC/source Picture to SourceValidate. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0dede200c9ac7adbe8b8c16efacc3edc1f183cd9 Merge: 7714357 2e78145 Author: Keith Packard <keithp@keithp.com> Date: Wed Jan 5 08:51:46 2011 -0800 Merge remote branch 'vsyrjala/misc_fixes' commit 7714357f506782973d25e270f85140b42507ed35 Merge: 02e18c9 b01dd9d Author: Keith Packard <keithp@keithp.com> Date: Wed Jan 5 08:43:18 2011 -0800 Merge remote branch 'whot/for-keith' commit 02e18c9fb58c33d340af4573551fb9c7c59e0f43 Author: James Jones <jajones@nvidia.com> Date: Mon Dec 20 11:05:57 2010 -0800 X Sync Cleanups Various cleanups identified during review of the X Sync Fence Object patches. -Correctly handle failure of AddResource() -Don't assert when data structures are corrupt. Instead, use a new helper function to check for counter sync objects when they're expected, and warn if the type is wrong. -Use the default switch label rather than reimplementing it. -Re-introduce cast of result of dixAllocateObjectWithPrivate() to kill an incompatible pointer type warning. -Remove comments claiming protocol updates are needed. One wasn't true and the other was addressed with a xextproto change. -Return BadFence, not BadCounter from XSyncAwaitFence() Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 86ca434a1ab766c1519ee7146b48dbfead843524 Author: Zhao Yakui <yakui.zhao@intel.com> Date: Tue Jan 4 14:08:16 2011 -0500 edid: Fix incorrect timings for VIC61 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> commit bb18f277156c08be028a6e12d8987fb1593e9168 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 10 14:24:02 2010 -0500 x86emu: Fix more mis-decoding of the data prefix cc2c73ddcb4370a7c3ad439cda4da825156c26c9's three-cent titanium tax doesn't go too far enough. Fix the rest of the call and jmp instructions to handle the data prefix correctly. Reference: Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2A: Instruction Set Reference, A-M http://www.intel.com/Assets/PDF/manual/253666.pdf Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 261d0d16af797bb52d4c778e220296d7f2b28e14 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Dec 30 16:08:48 2010 -0800 Fix asprintf typo in commit d2c42b10 Reported-by: Jerome Carretero <cJ@zougloub.eu> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit c6afe64bad7a27ff8828de499d56776c113df60f Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 31 03:15:27 2010 +0000 XFree86: Linux: AGP: Fix void-pointer-arithmetic warning Cast it to a char *, mimicking the return immediately below it. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> commit 2d67ada3c4079a11c52024a9c3d4138becca5171 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:43 2010 +0200 os: always check if client is local when connection is accepted LocalClient is used for all DRI2 requests that makes it frequently called function. Querying if connection is local or not takes 10-15us (on ARM) depending on malloc speed. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 617b7d22115ccaaaa7ec69c99885054d33a3bc37 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:42 2010 +0200 os: Fix a memory leak Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 3e1455505addc7e52178fa04399aef2a8522c921 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:41 2010 +0200 udev: Fix removing of the wake up handler RemoveBlockAndWakeupHandlers requires caller to pass same block data parameter as for RegisterBlockAndWakeupHandlers. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 13ac3deedb532b39f41dcd45d70f9eb4a85c1f58 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:40 2010 +0200 mi: Only register sprite block handler when needed miSpriteBlockHandler takes about 10us in arm each time BlockHandlers are called. To eliminate that overhead from xserver side only register the BlockHandler when there actually is any cursor down. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 4f6e3b0f378d7306dbd8c00ef9a7df81e24e5769 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:39 2010 +0200 mi: Register sprite damage handler only when required There is no need to have damage handler registered when there isn't any pointer in the screen. This avoids some overhead from damage handling which takes tens of microseconds on arm. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit bf48082f30818b96bc623834be3022600371d4fc Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:38 2010 +0200 mi: Fix the debug message Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 8fb43b8bf9fcbe015d4e98c7e09889184d136a1e Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:37 2010 +0200 mi: Fix wrapping for sprite screen SCREEN_EPILOGUE should read the current function pointer from screen after calling wrapped function in case the pointer changes. Passing pPriv to macros instead of asking dix each time makes sense when both macros need same pointer. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 4be2a6d1b33fac7ceb50ad1de249a1acd5a46ab0 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:36 2010 +0200 mi: Add GetSpriteScreen macro to hide dixLookupPrivate Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit ed8db09b4bff5c4a8d8056808368650e1876547b Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:35 2010 +0200 composite: Remove unnecessary variable. We know that there is damage if the dynamic block handler is registered. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit c038b8b28e5c436cd31bea7a3bef2c8c9d818b58 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:34 2010 +0200 composite: Only register the block handler when it is required Even calling block handler that doesn't do much is costly in arm. It takes a few microseconds each time which adds up to relative high CPU time because it is done 500+ times per second. Simple optimization is to register the block handler only when it is required. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 6d0e9e5d6e1b847961ab52a11aae96981a1cf1c0 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:33 2010 +0200 render: Enable animated cursor block handler only when needed Calling BlockHandlers takes some time for each iteration in main loop which adds up quickly over multiple request. To reduce the round-trip costs to xserver BlockHandlers should be registered only when required. AnimCurScreenBlockHandler is the first victim for this optimization. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit aa8cea953dc66bcf4cb4d08f2681f9e6cb1bc8c5 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Dec 30 19:19:32 2010 +0200 render: Don't filter 0 return from GetTimeInMillis In animate cursor block handler code assumes GetTimeInMillis returns always nonzero value. This isn't true when time wraps around. To prevent any problems in case GetTimeInMillis would return zero use activeDevice variable to track if we have received time. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 91beeee05f88eed10ab0fd97dc625e96cb7763ba Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Oct 13 16:27:30 2009 +1100 DIX: Reset window properties when freeing them This enables us to reliably inspect properties when destroying windows. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit 36ebdd361616eedbe4919deae2a4e6f6606ae6b4 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 19 11:59:24 2010 -0400 linux: warning fix lnx_agp.c: In function ‘xf86DeallocateGARTMemory’: lnx_agp.c:267: warning: cast to pointer from integer of different size Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 63ccaec2c39f4b5742383472c951ee2cd35c9e14 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 19 11:59:23 2010 -0400 glx: warning fixes render2.c: In function ‘__glXDisp_Map2d’: render2.c:127: warning: ‘u1’ may be used uninitialized in this function render2.c: In function ‘__glXDisp_Map1d’: render2.c:90: warning: ‘u1’ may be used uninitialized in this function Remove unnecessary test, and change memcpy to memmove as all users were doing overlapping copies. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit d057e265c862f90e9b6fddff89f40cb82b2a59b1 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 19 11:59:22 2010 -0400 xcmisc: warning fix xcmisc.c:202: warning: no previous prototype for ‘XCMiscExtensionInit’ Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 67e0bcba4307de5a330e027f4504c9aed4987e5a Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 19 11:59:21 2010 -0400 dri1: warning fix dri.c: In function ‘DRIScreenInit’: dri.c:434: warning: cast from pointer to integer of different size Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a298d044f965e5ba91f178c6b599c1df26a958ba Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 19 11:59:20 2010 -0400 loader: warning fix loadmod.c: In function ‘FreeSubdirs’: loadmod.c:377: warning: passing argument 1 of ‘free’ discards qualifiers from pointer target type /usr/include/stdlib.h:488: note: expected ‘void *’ but argument is of type ‘const char *’ Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit ee0b1b564413327c73bb8cdbabb76667ca4a744c Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 19 11:59:18 2010 -0400 config: warning fixes xf86AutoConfig.c: In function ‘FreeList’: xf86AutoConfig.c:123: warning: passing argument 1 of ‘free’ discards qualifiers from pointer target type /usr/include/stdlib.h:488: note: expected ‘void *’ but argument is of type ‘const char *’ Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 32c85ad4b8fe27fed0c494f69c39e3902ce57b1b Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 12:40:31 2010 +0000 GLX: DRI2: Fix mismatched-types warning All the DRI extension types have a base extension type as their first member to avoid exactly these types of warning. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> commit 22796cfa4805cc9551e1b3fa1d3e2e1bfae5bad1 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 28 12:29:53 2010 +0000 udev: Add strdups to kill const warnings InputAttributes wants non-const members, and while it appears safe to cast it, just leave it be for the moment. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 03f2eb1e156796afb70118d7f7f60ac61beed026 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 17 17:13:34 2010 +0000 Input: Set client error value for invalid mask bits When we send BadValue back to the client for having invalid mask bits, at least tell them what the (first) invalid bit was. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 47818287983b04625661b08ae362e0966cddf3e1 Author: Chase Douglas <chase.douglas@canonical.com> Date: Fri Dec 17 17:13:30 2010 +0000 Make EventIsDeliverable non-static Will be used outside dix/events.c in proceeding XI 2.1 MT changes. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f7d8ade3c5ac44faf7f3ea0d846e35f75b31c9ec Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 17 17:13:26 2010 +0000 Resources: Move rClient to resource.h The definition of rClient was duplicated across three source files, so move it to resource.h. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 05e437c2ce230b588362f012c06ead5c6d89c006 Author: Chase Douglas <chase.douglas@canonical.com> Date: Fri Dec 17 17:13:27 2010 +0000 Export all valuator_mask_* functions Input drivers may use valuator masks for internal state. Having all the valuator_mask_* functions available will help. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Bump ABI_XINPUT_VERSION minor. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2e781457d43ec4bf0d633257ac6852cde3b00541 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Thu Dec 16 18:22:13 2010 +0200 xfree86/modes: Take rotation into account when checking mode size Assume that a mode can be used in either landscape or portrait orientation. I suppose the correct thing to do would be to collect all the supported rotations from the CRTCs that can be used with a specific output, but that information doesn't seem to be readily available when these checks are done. So just assume that either orientation is fine. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 0ce25fd7904c792924c3e0ee6fc21a5f1bec1a68 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Dec 3 17:42:16 2010 +0200 dri2: Don't page flip when the window size doesn't match the pixmap size If the drawable size doesn't match the pixmap size page flipping should not be allowed. If the window is larger than the pixmap, page flipping might need to reposition the CRTC somewhere in the middle of the pixmap. I didn't spot any code that would handle that at least in the intel driver. Also the root pixmap could then move to some negative screen coordinates. Not sure if all bits of code could handle that. Perhaps when composite is enabled screen_x/y would make it work, but without composite there's no way that it would work AFAICS. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit efcb63d0ce43f96d0ac02b6f4a480dfd2374fc84 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Dec 23 13:33:00 2010 +0000 Render: Fix 'comparing between distinct pointer types' warning Add the appropriate casts so that gcc shuts up, even if it doesn't matter. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 469d5bf8b75038631c27edbb0f9cdf7d737fa233 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 17 16:48:45 2010 +0000 mi: Sync: Don't free managed screen private misync allocates space for its screen private with dixRegisterPrivateKey, which means it doesn't have to free it at CloseScreen time; doing so will, in fact, result in a crash. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: James Jones <jajones@nvidia.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 44adb31bfece29260a9bbd9075c9212ebf00d24d Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 27 20:36:37 2010 +1000 GetTimeInMillis: Use CLOCK_MONOTONIC_COARSE where available On some systems, using CLOCK_MONOTONIC forces a readback of HPET or some similarly expensive timer. CLOCK_MONOTONIC_COARSE can alleviate this, at the cost of negligibly-reduced resolution, so prefer that where we can. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 296561506a91742cc150a0fb6fc0df5dbe98c780 Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Wed Dec 22 16:57:17 2010 +0200 Xext: Use general OS functions to determine client command string in SELinux. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 1e933665bef26c74196bb7c59910e6a78bcacf0e Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Wed Dec 22 16:51:09 2010 +0200 os: Add facilities for client ID tracking. An interface is provided for figuring out the PID and process name of a client. Make some existing functionality from SELinux and IA extensions available for general use. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 671b2a1823a1c90d0b6254e2e2af8865151fff8c Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Wed Dec 22 16:38:54 2010 +0200 config: Fix linking order of Xnest libraries. MAIN depends on DIX and not vice versa. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> commit 2b364bf970b2ce6829af656990c33afd0d365f3c Author: Rami Ylimäki <rami.ylimaki@vincit.fi> Date: Tue Jun 15 14:44:38 2010 +0200 Revert "os: Prevent backtrace from being stopped in noreturn functions." This reverts commit 579715f830fbbca9e1ecb17dc18176132f5969e7. The patch is not needed anymore. I haven't encountered backtrace problems with GCC 4.3.3. Even if the problems still persisted, this commit should be removed and instead the definition of _X_NORETURN should be modified to be empty if GCC/ARM is used. However, currently it seems that ARM backtraces are OK even if _X_NORETURN is used and -mapcs-frame is not defined in CFLAGS. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit b01dd9d33651999b0390bf8ed412b84f6929a13e Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 17 17:13:34 2010 +0000 Input: Set client error value for invalid mask bits When we send BadValue back to the client for having invalid mask bits, at least tell them what the (first) invalid bit was. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 495e0142a77152c4cde5c88cdba4103ddc94df2c Author: Chase Douglas <chase.douglas@canonical.com> Date: Fri Dec 17 17:13:30 2010 +0000 Make EventIsDeliverable non-static Will be used outside dix/events.c in proceeding XI 2.1 MT changes. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4fbe67beb56e5600c1df789c08725c45b9bef0d4 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 17 17:13:26 2010 +0000 Resources: Move rClient to resource.h The definition of rClient was duplicated across three source files, so move it to resource.h. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 871c1e17e527857cd86b5e517d9a18e5041f00fd Author: Chase Douglas <chase.douglas@canonical.com> Date: Fri Dec 17 17:13:27 2010 +0000 Export all valuator_mask_* functions Input drivers may use valuator masks for internal state. Having all the valuator_mask_* functions available will help. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Bump ABI_XINPUT_VERSION minor. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e06fa804009798ea95efa8babaabb0228dfdfe65 Author: Michel Dänzer <daenzer@vmware.com> Date: Wed Dec 22 11:45:36 2010 +0100 EXA: Fix crash with fill using 1x1 tile of depth < 8 (bug #24703). Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24703 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 56d9c736f0c450bffd43300107689eb6dd1ea70b Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 16 14:26:10 2010 -0500 xfree86: Convert some xf86BlockSIGIO to OsBlockSignals The DDC1 and int10 code are blocking SIGIO to get some assurance that their usleep() calls take as long as they expect. That's a good start but you really want to be blocking more than just SIGIO, SIGALRM too at minimum. At this point, except for SIGIO handler setup itself, BlockSIGIO really means "block input events". Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit ce13a1dbbfbeee3a3d51d0385817df50944cfdee Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 16 14:03:13 2010 -0500 xfree86: Remove xf86EnterServerState Back when we had RAC this was a vaguely meaningful thing. Since then it's been a glorified (and confusing) wrapper around xf86BlockSIGIO. Note that the APM and VT switch code are unusual relative to other code that cares about SIGIO state. Most callers push a SIGIO disable to create a critical section for the duration of the caller's stack frame, but those two effectively disable SIGIO after their return and re-enable on their next entry. Reviewed-by: Tiago Vignatti <tigo.vignatti@nokia.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a04e74cb480f98bc3dd4def2da6f6752640d9e38 Author: Adam Jackson <ajax@redhat.com> Date: Wed Dec 15 15:16:33 2010 -0500 xfree86: Symmetrize xf86AccessEnter and xf86AccessLeave Enter was changing server operating state, Leave wasn't. Which was wholly redundant, since all callers of Enter would immediately change the operating state to exactly what Enter had just done. Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 7a9062f2f029b4f911ba56f291375fbf5a98ca73 Author: Adam Jackson <ajax@redhat.com> Date: Tue Dec 14 15:44:16 2010 -0500 fonts: Fix typo in async ListFonts logic This was introduced in 3ab6cd31cbdf8095b2948034fce5fb645422d8da. Mea culpa. This logic is still incorrect [1], but at least it's less incorrect. [1] - https://bugzilla.redhat.com/658587 Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f28e48834e40c7901c2efc72f962c9724e74a531 Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 16 13:13:54 2010 -0500 Remove SCO support This has never been buildable in any modular server release. Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 040d54fb88f3970e19d0fbf911d6447f592496bd Author: Adam Jackson <ajax@redhat.com> Date: Wed Dec 15 14:59:13 2010 -0500 xfree86: Remove unused xf86inSuspend What is this, I don't even. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit e7dc253452a1ba64718a08fdc070405b494f53cd Merge: d110791 d5b0d58 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 20 00:48:45 2010 -0800 Merge remote branch 'alanc/master' commit d1107918d4626268803b54033a07405122278e7f Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Dec 17 16:09:35 2010 +0200 randr: check for virtual size limits before set crtc Return a error if the screen is configured to an invalid size. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 4b88c7be8de4149fe3d166bf115775f9e81a1373 Author: Jörn Horstmann <launchpad@planetxml.de> Date: Mon Dec 6 11:24:02 2010 +1100 Add EDID quirk for HP Compaq nc8430. Like some other LPL panels, this one reports the vertical size in cm rather than mm. Patch taken from Launchpad bug #380009 <https://launchpad.net/bugs/380009> X.Org Bug 28414 <https://bugs.freedesktop.org/show_bug.cgi?id=28414> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a2e67a6412386782cb8b644b86a5744591397d45 Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Date: Mon Dec 6 11:24:01 2010 +1100 IDLETIME: Fix edge-case in IdleTimeBlockHandler Ensure that if we're called exactly on the threshold of a NegativeTransition trigger that we reshedule to pick up an idle time over the threshold. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b55bf248581dc66321b24b29f199f6dc8d02db1b Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Date: Mon Dec 6 11:24:00 2010 +1100 Xext: Fix edge case with {Positive, Negative}Transition triggers. The {Positive,Negative}Transition triggers only fire when the counter goes from strictly {below,above} the threshold. If SyncComputeBracketValues gets called exactly at this threshold we may update the bracket values so that the counter is not updated past the threshold. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d5b0d58573ffb90ea70273cd013102168fd2a18a Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Dec 16 22:29:37 2010 -0800 Bug 32436 - hw/xfree86/parser/Makefile.am TOP_SRCDIR should be top_srcdir https://bugs.freedesktop.org/show_bug.cgi?id=32436 Fix typo introduced in 2416255f7e3fd9190a9 that breaks builds when configured --enable-install-libxf86config Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Tested-by: Simon Thum <simon.thum@gmx.de> commit 058b889fde47b4c32534f11ed651bf1749d1dbb2 Author: David Barksdale <david.barksdale@adcedosolutions.com> Date: Mon Dec 13 18:35:20 2010 -0800 Bug 21827: faulty sdksyms.c generated by the awk script in sdksyms.sh https://bugs.freedesktop.org/show_bug.cgi?id=21827 Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: David Barksdale <david.barksdale@adcedosolutions.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 1324b0ca9f8a7fdaf03b374c75eb3c9df407c2f1 Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Dec 10 00:08:24 2010 +0000 Typo in xserver Xvasprintf() I needed this patch in the wrapper around vsnprintf() in os/xprintf.c (MinGW for Windows build) to correct various crashes. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit f1542f1d716723cba7c323849086585635121893 Merge: 9716d31 8a8fdd7 Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 14 15:04:12 2010 -0800 Merge remote branch 'whot/for-keith' commit 9716d3124799c6db0d1c782aa72c72f972d5a158 Merge: 03ea0b7 f641e4b Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 14 15:01:36 2010 -0800 Merge remote branch 'jeremyhu/master' commit 03ea0b7726487b96df73936518da73d023e51334 Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Dec 7 16:31:55 2010 -0500 docs: replace BUILLDOCS with existing ENABLE_DEVEL_DOCS Use the util-macros AM Conditionals to control generation of developers documents. This is used throughout xorg modules. The doxygen generated docs are now also managed by --enable-devel-docs. Remove --enable-builddocs as this was last use for BUILDDOCS *** From the RELEASE NOTES *** New configure options for documentation in modules -------------------------------------------------- As many more modules now contain documentation to be converted from DocBook XML to text, HTML, PostScript, and/or PDF formats, new standard options have been added to the configure macros to control the build of these in the modules. --with-xmlto=yes|no Enables or disables use of the xmlto [https://fedorahosted.org/ xmlto/] command to translate DocBook XML to other formats. All DocBook XML conversions require use of this command. --with-fop=yes|no Enables or disables use of the Apache fop [http:// xmlgraphics.apache.org/fop/] command to translate DocBook XML to PostScript and PDF formats. --enable-docs=yes|no Enables or disables the build and installation of all documentation except traditional man pages or those covered by the --enable-devel-docs and --enable-specs options. --enable-devel-docs=yes|no Enables or disables the build and installation of documentation for developers of the X.Org software modules. --enable-specs=yes|no Enables or disables the build and installation of the formal specification documents for protocols and APIs. Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit c78c71c3a872665e426a0a4b82f17007bd8c12cd Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Dec 7 16:31:54 2010 -0500 hw/dmx/doc: DIST_SUBDIRS not required when using AM_CONDITIONAL The makefile can be simplyfied as Automake handle this automatically. All directories in SUBDIRS are visited for dist purposes. www.gnu.org/software/automake/manual/automake.html#SUBDIRS-vs-DIST_005fSUBDIRS Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8a8fdd762ad89c350854943311ec4aadc50245fa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 13 11:28:30 2010 +1000 xfree86: always report the input options before initialising the device. After collecting the driver's default options, report the list of options set for the device before calling PreInit(). This helps with debugging those cases where options are not merged correctly. xf86OptionListReport reports with verbosity 5, higher than the default verbosity so this won't generate logspam in the default case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Simon Thum <simon.thum@gmx.de> commit 9db9e964f6ca553dcbd3b7b037745d9581eaa065 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 10 13:23:13 2010 +1000 xfree86: swap the order to-be-merged lists in xf86CollectInputOptions. Current order causes the user-configured option list to be overwritten with the default list supplied by the driver. Swap around so we overwrite the driver's default values instead. This only affected options supplied by the driver such as XkbLayout in the case of evdev. Reported-by: Sebastian Glita <glseba@yahoo.com> Reported-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Sebastian Glita <glseba@yahoo.com> commit 0d440a1c6e219cd39dbddd2b7e813c6431aac6ea Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 8 14:52:19 2010 +1000 dix: allow for button-only input devices (#21457) Add a few checks for the existence of a valuator class on the device to avoid null-pointer dereferences for button events from devices without a valuator class. X.Org Bug 21457 <http://bugs.freedesktop.org/show_bug.cgi?id=21457> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit f641e4b34aa91ecda29e546b8b975e72ce037ed0 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Dec 8 22:58:12 2010 -0800 XQuartz GL: Add $(GL_CFLAGS) to CFLAGS This fixes a build failure I found on tinderbox. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 9cf055892dd413932e54b43cc2dfea70bafd525f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 8 14:43:51 2010 +1000 xfree86: don't set movement flags for non-valuator events. If a device doesn't send valuators, don't try to move its position. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit aba8133c9c5a50753c388d76407868ac69f4134b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 8 14:02:17 2010 +1000 dix: clear up an overly convoluted if statement. No functional changes, just improves readability. This statement had things added to/removed from it for a few server releases while the input event queue was revamped. What made sense once is now mainly confusing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 883039e07b0c0ef23c7fc4ba3455b41173c7a7fc Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Dec 8 13:27:41 2010 -0800 XQuartz: Just NSBeep() for XBell() The CoreAudio path uses deprecated API and has reported crashes that aren't worth fixing (4e8bf12b13690afa6d9fee0e339d3819ef16fb3f fixed one and introduced another). NSBeep() does the job just fine. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 2c70b650b342378898064cf27e2f95c4b2e53d24 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Dec 8 18:54:30 2010 +0000 Fix Xwin build after af0f9f91 Fix damage to XWIN_LIBS in commit af0f9f913398d34a885c3fb4e8d40c1a7e2b3ee9 "Move some sync code to miext", which broke the XWin build Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison at virgin.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 519d243f0c8e3c80226701f71d2cfa62e42dbff7 Merge: 9f9c732 446482e Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 7 13:39:58 2010 -0800 Merge remote branch 'alanc/master' commit 446482efaa3d266266e2a143492a3ec0523622bd Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Nov 28 09:41:17 2010 -0800 Convert cvt code to use XNFasprintf() Requires linking xprintf.c into standalone cvt utility Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit d2c42b102707db6c1ca9dccc4de9210a43650cb1 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 23:10:46 2010 -0800 Replace alloc+strcpy+strcat with asprintf() & XNFasprintf() calls Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 3a9bb93dd178084f4ff1abcea331ca5a62f88ce6 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 22:38:27 2010 -0800 Convert alloc+sprintf pairs into asprintf() & XNFasprintf() calls Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 2416255f7e3fd9190a9e01bda57c992932de4bd9 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 22:36:44 2010 -0800 Convert hw/xfree86/parser code to use asprintf() calls Requires linking xprintf.c into libxf86config for those who build it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 03e8bfa1d122f7dea905d48c93cfd54afd991dfd Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 20:09:04 2010 -0800 Convert existing Xprintf style calls to asprintf style Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit c95c1d338fdb62dbe3dba934b97324fa778b7fce Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 18:43:12 2010 -0800 Add asprintf() implementation for platforms without it Provides a portable implementation of this common allocating sprintf() API found in many, but not yet all, of the platforms we support. If the platform provides vasprintf() we simply wrap it, otherwise we implement it - either way callers can use it regardless of platform. Since not all platforms guarantee to NULL out the return pointer on failure, we don't either, and require callers to check the return value for -1. The old Xprintf() API is deprecated, but left for compatibility for now. The new API is added in a new header so that it can be used in parts of the server such as hw/xfree86/parser that don't include all the server headers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 2db6951763115a4a5dfac53d1a8f78ac33f91235 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Dec 3 16:32:01 2010 -0800 Sun's copyrights now belong to Oracle Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit f06e8a61d6ed8f3054878167bffee619f852aad9 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue Nov 30 16:34:38 2010 -0800 Move inclusion of panoramiX headers to top of render.c Fixes compiler error from Sun compilers due to _X_EXPORT declaration being included after the unlabeled version: "../Xext/panoramiXsrv.h", line 29: redeclaration must have the same or more restrictive linker scoping: XRT_PICTURE Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9f9c732311ef0cc198e5ec44d02412eb7e8c3f3a Author: Cyril Brulebois <kibi@debian.org> Date: Fri Nov 12 21:35:25 2010 +0100 dix: Fix logic for displaying deprecation warning only once. As pointed out by Jamey Sharp (again), the logic is faulty: --warn is always going to be false. Replace it with warn-- accordingly, so that there's (at least, but also only) one warning showing up. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit a937803c1f671ef29332e5fe8c190d8b48239912 Author: Cyril Brulebois <kibi@debian.org> Date: Fri Nov 12 21:29:26 2010 +0100 dix: Simplify deprecated *Lookup* wrappers around dixLookup*. As pointed out by Jamey Sharp: “the result pointer is already guaranteed to be NULL if the return value is not Success”, so get rid of the variable used to catch the return value, and used in a ternary operation to decide whether to return the pointer or NULL. Always return the result pointer instead. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 73fbc4a4a7997b3ee1c779d8f394114270bcb20d Author: Cyril Brulebois <kibi@debian.org> Date: Fri Nov 12 12:04:11 2010 +0100 Replace SecurityLookupIDByClass() with dixLookupResourceByClass(). This patch has been prepared with the following Coccinelle semantic patch: @@ expression a, b, c, d; identifier r; type t; @@ -r = (t) SecurityLookupIDByClass(a, b, c, d); +dixLookupResourceByClass((pointer*) &r, b, c, a, d); The only occurrence not matching directly was processed after separating declaration of pXinDraw and call to SecurityLookupIDByClass(). Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 6e8b34b7048bc9e49ef52b81e2de1b518a05890e Author: Cyril Brulebois <kibi@debian.org> Date: Fri Nov 12 11:36:36 2010 +0100 Replace SecurityLookupIDByType() with dixLookupResourceByType(), take 2. These occurrences are a bit harder to catch through a semantic patch, so process them “manually”. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit ac04c1377a42ab6803adf551756653fd8e1a694b Author: Cyril Brulebois <kibi@debian.org> Date: Fri Nov 12 11:36:31 2010 +0100 Replace SecurityLookupIDByType() with dixLookupResourceByType(), take 1. This patch has been prepared with the following Coccinelle semantic patch: @@ expression a, b, c, d; identifier r; @@ -r = SecurityLookupIDByType(a, b, c, d); +dixLookupResourceByType((pointer*) &r, b, c, a, d); Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 28b4c02d7463ffe5c29f803f5656c5ecfc040185 Author: Cyril Brulebois <kibi@debian.org> Date: Thu Nov 11 18:36:45 2010 +0100 Enable silent rules for cat and echo. One gets this: | GEN lf3-xaaBitmap.c | GEN lf3-xaaBitmap.c | GEN lf3-xaaBitmap.c | GEN lf3-xaaBitmap.c | CC lf3-xaaBitmap.lo instead of this: | echo "#define LSBFIRST" > l3-xaaBitmap.c | echo "#define TRIPLE_BITS" >> l3-xaaBitmap.c | echo '#include "../../../../hw/xfree86/xaa/xaaBitmap.c"' >> l3-xaaBitmap.c | CC l3-xaaBitmap.lo Occurrences found using: | git grep -E '(cat|echo)' -- '*Makefile.am' Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 838b9582280030a159878af566126cb0a523ec29 Author: Cyril Brulebois <kibi@debian.org> Date: Thu Nov 11 15:40:13 2010 +0100 Replace LookupIDByType() with dixLookupResourceByType(), take 2. These occurrences are a bit harder to catch through a semantic patch, so process them “manually”. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit ffb93533fd8067c7383aef5e0018a197af59b46c Author: Cyril Brulebois <kibi@debian.org> Date: Thu Nov 11 15:30:15 2010 +0100 Replace LookupIDByType() with dixLookupResourceByType(), take 1. This patch has been prepared with the following Coccinelle semantic patch: @@ expression x, y; type t; identifier r; @@ -r = (t) LookupIDByType(x, y); +dixLookupResourceByType((pointer*)&r, x, y, NullClient, DixUnknownAccess); @@ expression x, y; type t; identifier r; @@ -t r = (t) LookupIDByType(x, y); +t r; +dixLookupResourceByType((pointer*)&r, x, y, NullClient, DixUnknownAccess); Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit d1b45b0fd54efb952f9ff435a516c1bfd85ca186 Author: Cyril Brulebois <kibi@debian.org> Date: Thu Nov 11 11:35:47 2010 +0100 Fix missing <string.h> include. The following happens otherwise (with -Wall -Werror): | In file included from /usr/include/X11/Xfuncs.h:47, | from ../../include/misc.h:112, | from ../../include/screenint.h:52, | from ../../include/scrnintstr.h:52, | from ../../dix/cursor.c:58: | /usr/include/string.h:534: error: conflicting types for ‘xstrcasecmp’ | ../../include/os.h:488: note: previous declaration of ‘xstrcasecmp’ was here | /usr/include/string.h:538: error: conflicting types for ‘xstrncasecmp’ | ../../include/os.h:493: note: previous declaration of ‘xstrncasecmp’ was here Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Cyril Brulebois <kibi@debian.org> commit 780754050bc9cb1489f92a2a890ab5665e3e6358 Author: Cyril Brulebois <kibi@debian.org> Date: Fri Nov 12 12:18:59 2010 +0100 Fix GLX_LIBS vs. DMX_LIBS order. If glxproxy needs symbols which aren't pulled in by dmx itself, glxproxy fails to link because of undefined references. Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 14983286c489ea1ec6ba4fadbeaec5c2d2ee34e1 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 6 20:45:35 2010 -0800 Version bumped to 1.9.99.901 (1.10 RC1) Signed-off-by: Keith Packard <keithp@keithp.com> commit d96d5f5443358e33e47d1a61f9bd2afd8064a8dd Author: James Jones <jajones@nvidia.com> Date: Sun Dec 5 19:42:41 2010 -0800 Bump extension ABI to 5 Commit 606e079cc4d9a9db3197652ca51683c36f74efb8 moved the visual field in WindowOptRec, breaking the extension module ABI. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 435361bd73b9fc733f093d81af6b839953e35176 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 6 20:38:14 2010 -0800 sync: syncObject may be None in SyncInitTrigger And often is, especially when called from ProcSyncCreateAlarm. Crashing in this case seems unwise. Signed-off-by: Keith Packard <keithp@keithp.com> commit 0d01b66df9081ef48843b3bad81c56bb2cd1ae69 Author: Keith Packard <keithp@keithp.com> Date: Sun Dec 5 23:35:28 2010 -0800 randr: handle RRSetCrtcConfigs request with zero configs Need to actually return a reply in this case. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit b0f4bd61f0caf80f3be9a176f1f7a707bc6628d8 Author: Keith Packard <keithp@keithp.com> Date: Sun Dec 5 21:53:25 2010 -0800 ProcRRSetCrtcConfigs uses 'configs' without being initialized If the client sends invalid data for this request, the server will jump to 'sendReply' and call RRFreeCrtcConfigs, passing it the uninitialized 'configs' and 'num_configs' values. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 752c368421c1c824752cf467fba9318d75d2ca2c Author: Keith Packard <keithp@keithp.com> Date: Sun Dec 5 20:57:47 2010 -0800 Separate out screen size and screen pixmap sizes in RRScreenSizeSet This provides for separate sizes for the screen scanout and rendering buffer and the application-visible screen size. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit a88d70fb20a2bc3152b84adff4380857e6cfadf5 Author: Keith Packard <keithp@keithp.com> Date: Sun Dec 5 20:55:46 2010 -0800 Set sprite transforms from RRSetCrtcConfigs These were getting ignored. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 96b4d4787bf82edd9d06eb9a6e94bc45412c7df2 Author: Keith Packard <keithp@keithp.com> Date: Sun Dec 5 20:49:19 2010 -0800 DIX is responsible for ref counting scanout pixmaps. Remove some extra ref counting inside hw/xfree86/modes Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit afb6ebf1d5829346c40fe1053c9f50afe926e6c6 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 3 13:04:37 2010 -0800 randr: Hook up the new RandR 1.4 functionality This bumps the supported RandR protocol version and adds the dispatch hooks needed to call the new functions Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 82612045e11f2b882ae132e184a9629f43f1c424 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 3 13:00:46 2010 -0800 randr: Add per-crtc pixmaps This adds new driver hooks to allocate scanout pixmaps and changes the mode setting APIs to pass the new scanout pixmaps along from DIX. DIX is responsible for reference counting the pixmaps by tracking them through RRCrtcNotify. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 86c489c319c705f710bee3897fe27600ce15008e Author: Keith Packard <keithp@keithp.com> Date: Sat Dec 4 20:12:26 2010 -0800 hw/xfree86/modes: Add optional driver API for RRSetCrtcConfigs This provides a driver hook which can either completely replace, or just validate the parameters for, the RRSetCrtcConfigs request. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit d94a035ea9eb3167fc4f35b2d9f0d53f8807014c Author: Keith Packard <keithp@keithp.com> Date: Sat Dec 4 19:22:11 2010 -0800 randr: Implement RRSetCrtcConfigs This provides a driver-independent implementation of the RRSetCrtcConfigs API by simply using the existing interfaces. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 66294afcab7b7a82f7dd897767e46c48a94b8ee8 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 3 22:08:06 2010 -0800 randr: Add sprite position transforms This implements sprite position transformations. Sprite image transforms are passed all the way to the DDX layer, but the images are not yet manipulated before being passed to the drivers. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit c8bc25fd7629df10f2825b7cc713b031ae78f223 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 6 19:40:30 2010 -0800 Require RandR protocol version 1.4 or newer Signed-off-by: Keith Packard <keithp@keithp.com> commit 8b35118c03590a7ad3786d3284bafb3f40fcb8cc Author: Keith Packard <keithp@keithp.com> Date: Sun Jun 6 15:23:37 2010 -0700 Replace huge argument list in xf86CrtcSetModeTransform with struct xf86CrtcSetModeTransform was starting to get ridiculous with 6 arguments, this change has it take a single structure that contains all of those values along with a set of flags that says which have changed. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit f5b8bd620f91214c0b87e9b04d57015655792352 Merge: 01e9fa7 8127c83 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 6 19:51:06 2010 -0800 Merge remote branch 'jajones/for-keith' commit 01e9fa7da389fc7ab834b4234b8484514144b7f4 Merge: 79870db 68a1b0d Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 6 19:45:11 2010 -0800 Merge remote branch 'whot/for-keith' commit 79870dbf72d463cf9efea1b3e61d1d5759df27b5 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat Dec 4 16:13:29 2010 -0500 config: build Xserver man pages using XORG_MANPAGE_SECTIONS Nothing requires the use of a C preprocessor Using standard file exentions (.man) means no need for .gitignore Use standard directory and makefile Fix man page whitespace issues Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Dew <matt@osource.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit c4a7a5917ab828d4a0bd825a98e4d641bcb378f1 Merge: 5de312a 714b68d Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 6 19:28:07 2010 -0800 Merge remote branch 'jeremyhu/master' commit 5de312a60d8227ed670849ecf888ea878aa81430 Merge: 311cad3 8f42b2b Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 6 19:22:52 2010 -0800 Merge remote branch 'alanc/master' commit 8127c83c81bf64369a8ba2999088226d14e0b128 Author: James Jones <jajones@nvidia.com> Date: Mon Dec 6 12:14:01 2010 -0800 Expose Sync Fence Object protocol Add the new protocol handlers for XSync 3.1 to the dispatch tables and report support for Sync protocol version 3.1. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 9c0c7cc9a7adf230b5eee0b4166f9e17e07a088b Author: James Jones <jajones@nvidia.com> Date: Mon Dec 6 13:10:42 2010 -0800 Add XSyncAwaitFence() handler -Add the actual ProcSyncAwaitFence() dispatch func -Add support for fence sync triggers. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 397dfd9f87e1cdf105d10a789a97230f4f0d204e Author: James Jones <jajones@nvidia.com> Date: Fri Jun 25 17:59:14 2010 -0700 Create/Destroy/Trigger/Reset/Query Fence Sync objs Initial server side implementation of fence sync objects. Allows creation, management, and state queries of binary state objects. Currently they are not very useful as there is no way to wait for them efficiently. The basic trigger operation added here triggers relative to a given X screen's rendering operations. To perform this operation, fence sync objects must be tied to a screen. As Aaron Plattner pointed out, screens are identified but a drawable in X protocol, so a drawable argument is included in XSyncCreateFence(). The screen also could have been specified as part of the trigger operation. However, it is also desireable to associate a screen with fence sync objects at creation time so that the associated screen's driver can allocate any HW- specific resources needed by the fence object up front. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 53ea965d64bd9563e6bfcc81d04f283d2b85f09d Author: James Jones <jajones@nvidia.com> Date: Mon Nov 29 10:09:36 2010 -0800 Require xextproto 7.1.99 Subsequent changes rely on fence sync protocol in the sync extension. This protocol is only complete in xextproto version 7.1.99 and above. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 1c4a0db2c6bf0320cb630b84ab87bcfd3801a53d Author: James Jones <jajones@nvidia.com> Date: Mon Jun 28 16:10:13 2010 -0700 Add fence sync driver interface -Add fence sync objects -Add fence sync devPrivates -Add a X sync module screen private -Add wrappable functions to create and destroy fence sync objects -Give fence sync objects wrappable functions to trigger, test, and reset their 'triggered' value. -Give fence sync objects wrappable functions to notify driver when adding/removing triggers to/ from the sync object. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit af0f9f913398d34a885c3fb4e8d40c1a7e2b3ee9 Author: James Jones <jajones@nvidia.com> Date: Mon Jun 28 15:39:04 2010 -0700 Move some sync code to miext As a precursor to the fence sync object video driver and extension API, move some code from Xext to miext/sync. Most of this is just code to set up the build system to include the new directory. No functional code is added in this change. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 12b65de7db6e3e8bf831914d247da269d01c5fbe Author: James Jones <jajones@nvidia.com> Date: Mon Dec 6 10:11:45 2010 -0800 Factor out generic code from ProcSyncAwait() In preparation for adding more sync object types that will need Await requests of their own, factor out some setup and finalization code from ProcSyncAwait() into SyncAwaitPrologue() and SyncAwaitEpilogue() Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit c66a410d378090f350beb398649e9d9262933785 Author: James Jones <jajones@nvidia.com> Date: Mon Jun 28 14:59:01 2010 -0700 Make Await SyncTrigger functions generic Update all the functions dealing with Await sync triggers handle generic sync objects instead of just counters. This will facilitate code sharing between the counter sync waits and the fence sync waits. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 99daf419a3070c347c0cd29b4a9bae07eca7bd6d Author: James Jones <jajones@nvidia.com> Date: Mon Jun 28 14:51:54 2010 -0700 Create SyncObject base type. SyncObject is now the base type for SyncCounter. Data to be used by all sync types is stored in the base object. SyncCounter can be safely cast to SyncObject, and a SyncObject can be cast to the correct type based on SyncObject::type. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 27593eea7efcbed8de0c6e8233cbd1a1b8a50459 Author: James Jones <jajones@nvidia.com> Date: Mon Dec 6 13:36:14 2010 -0800 Add and use SERVER_SYNC_*_VERSION Most extensions have a version defined in the protocol headers, and also in the server's protocol-versions.h. The latter defines which version the server advertises support for. Sync wasn't included in protocol-versions.h, and was advertising support for whatever was in the protocol headers the server was built against. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 68a1b0de95f71f74835c6c0f002699fcdccbb268 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 6 14:58:37 2010 +1000 xfree86: use xf86AllocateInput() for xorg.conf devices too. Single allocation point for input devices, most notably a single point to reset default values. Without this patch, the file descriptor default was -1 for hotplugged devices and 0 for config devices. Drivers that don't overwrite the default themselves would thus fail if configured in the xorg.conf. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit beea2378f142556471c62290e275935af848e137 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 6 14:33:43 2010 +1000 xfree86: don't overwrite option list (#32115) Options set in the configuration file were unconditionally overwritten by the server. Merge the already existing options and the new options together instead of just overwriting ones. Introduced in commit 2199842ed50b3eb40d54146827fc58cae7e873ec Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 10:52:54 2010 +1000 xfree86: remove extraOptions field from IDevRec. X.Org Bug 32115 <http://bugs.freedesktop.org/show_bug.cgi?id=32115> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: David Ronis <ronis@ronispc.chem.mcgill.ca> commit 8f3fa8fb0b0a75dac714fc213c034b20595898d3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 6 15:44:50 2010 +1000 xfree86: add option "Floating", deprecate SendCoreEvents and friends. Some devices should be initialised as floating from the start (e.g. Joysticks and accelerometers benefit from this). Currently users use the "SendCoreEvents" "off" flag for this, which isn't the most appropriate naming. Add an option "Floating", deprecate the others. Still parsed and handled by the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 36b614dedf4ddc428e43ad1542d4f9314f73f60a Author: Eoghan Sherry <ejsherry@gmail.com> Date: Sun Nov 28 16:15:51 2010 -0500 Xi: Fix master button update when slave buttons are mapped. #24887 It is currently assumed that an event button delieved to a master device corresponds to the slave button states. However, the event button is a logical (mapped) slave button and slave button states correspond to physical (unmapped) slave buttons. This leads to incorrect update of the master button state and incorrect events devlivered to clients. Fix the situation by taking the slave button map into account when querying a slave button state. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24887 Signed-off-by: Eoghan Sherry <ejsherry@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 31ab9f8860848504df18a8be9d19b817b191e0df Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 3 11:54:41 2010 +1000 mi: handle DGA subtypes when determining the master device. The subtype in the DGA event is the core type and all ET_ event types (where applicable) are identical to the core types. Thus the switch statement below will work as required and assign the right master device. Fixes a crasher bug on keyboard devices with valuators. If a device sends a motion event while grabbed and a DGA client is active (but has not selected input through DGA), the valuator event is posted through the VCK and eventually results in a NULL-pointer dereference on dev->valuator. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5d31c3e705dfd9f38f0fffcd07a6d8d06644735c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 26 09:37:37 2010 +1000 dix: don't stop processing valuators when the mode changes. XI 1.x events still contain absolute coordinates anyway. By the time we get to the InternalEvent to XI event conversion, the valuators are already absolute. Stopping because of a different mode on a valuator is not necessary. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 714b68d9e5bf624a6703f168e0f7dc980e88e8c0 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Dec 3 17:27:44 2010 -0800 XQuartz: RandR: Fix mode changing for multi-monitor configurations. This just fixes the regression whereby we couldn't switch between the legacy fullscreen mode and rootless on multi-monitor configurations. This was happening because ref wasn't being set in these cases (since we don't ever actually change CG modes), so we failed a CFEqual. Setting the references fixes this regression and places us one step closer to more mode RandR mode switching in multi-monitor configurations. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 14f00449eb81771c01fffcdaf3dd697cdf4e41de Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Dec 3 16:46:11 2010 -0800 XQuartz: Cleanup some compiler warnings Mark __crashreporter_info__ as __attribute__((__used__)) Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 14aec8b82a316c6df51ac2a81985ebf1990abd2b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Dec 3 16:45:37 2010 -0800 XQuartz: Remove one more backing store leftover See: c4c4676e6874b42c2371eee96faa2c2dbb59a704 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ca431371a23a2b9ad36c1d64e11ea41d5e4e5f04 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Nov 26 15:31:22 2010 -0500 XQuartz: Disable the Mac OS X screensaver when in full screen mode Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 311cad33155c64ed996418808727fc417168592e Author: Nicolas Peninguy <nico@lostgeeks.org> Date: Wed Nov 24 00:11:11 2010 +0100 Fix Xdmx and Xephyr build when DTrace support is enabled This fixes the following build errors when DTrace is enabled (--with-dtrace): CCLD Xdmx /usr/bin/ld: ../../os/os.O: undefined reference to symbol 'dladdr@@GLIBC_2.2.5' /usr/bin/ld: note: 'dladdr@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line CCLD Xephyr ../../../os/os.O: In function `TimerForce': /home/nico/work/xserver/os/WaitFor.c:481: multiple definition of `TimerForce' ../../../os/os.O:/home/nico/work/xserver/os/WaitFor.c:481: first defined here Signed-off-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 3824417335ec00a87b51f8d05e592099b8507680 Merge: dab064f f4f41c8 Author: Keith Packard <keithp@keithp.com> Date: Thu Dec 2 08:39:33 2010 -0800 Merge remote branch 'vsyrjala/xv_reput' commit dab064fa5e0b1f5c67222562ad5367005832cba1 Author: Andrea Canciani <ranma42@gmail.com> Date: Tue Nov 2 20:10:32 2010 +0100 render: Fix byteswapping of gradient stops The function swapStops repeatedly swaps the color components as CARD16, but incorrectly steps over them as if they were CARD32. This causes half of the stops not to be swapped at all and some unrelated data be swapped instead. Signed-off-by: Andrea Canciani <ranma42@gmail.com> Reviewed-by: Soren Sandmann <sandmann@daimi.au.dk> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 279ef1ffd787dba2f0d5056849b9cb15d36aa3eb Author: Cyril Brulebois <kibi@debian.org> Date: Wed Dec 1 14:12:55 2010 +0100 Fix screen number checks. screenInfo.numScreens is not a valid screen number, they go from 0 to numScreens - 1. Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8684543021b9b1aa165b1bc69bc58685cb5942c1 Author: Julien Cristau <jcristau@debian.org> Date: Tue Nov 30 17:23:10 2010 +0100 DGA: fix screen number check screenInfo.numScreens is not a valid screen number, they go from 0 to numScreens - 1. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8f42b2b69387b006bfcd373c3d023ebea9035db2 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 22:34:57 2010 -0800 Simplify Error() - don't allocate temporary copy of error string Doesn't seem to be any reason to just not pass the error string as another argument directly to LogVWrite() Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 685286b17d30335d799a9da11914943e466ea955 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 20:43:28 2010 -0800 FindModuleInSubdir: Stop allocating one more byte than needed 15ac25627e7239629be59 removed the "/" from the sprintf strings, but failed to remove the extra byte allocated for the '/'. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 40d5a019352fa8f12230c863e11cbb1f6258a93e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 19:50:38 2010 -0800 xf86VIDrvMsgVerb: print args, not format string Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 4bbc90cd8b7e749fd8072ce7cd8dd998f4396981 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 19:06:56 2010 -0800 xf86AutoConfig: make copyScreen memory allocation & error handling more sane No point calling the no-fail-alloc if you check for failure and your only caller checks for failure. No point calling calloc to zero fill memory you're about to memcpy over. In the unlikely event of a loss of memory allocation, drop your previous allocations before returning to others. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 2c8e534c8e9334562485aeaaef374871cf14d5fe Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 23:49:55 2010 -0800 xf86ValidateModes: xnfalloc(strlen) + strcpy => xnfstrdup Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 29e467a1f1548a826ee2793244e3ff416aa1a0f2 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Nov 26 16:53:40 2010 -0800 xf86OutputRename: Replace another strlen/malloc/strcpy set with strdup Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> commit d346bc3083c6d4bea59b77f634c7c5ec6c1d8cc9 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Nov 28 13:48:16 2010 -0800 Fix compiler warnings in hw/xfree86/os-support/solaris sun_init.c: In function `xf86OpenConsole': sun_init.c:99: warning: cast does not match function type sun_init.c:74: warning: unused variable `FreeVTslot' sun_init.c: In function `xf86UseMsg': sun_init.c:417: warning: old-style parameter declaration sun_vid.c: In function `solUnMapVidMem': sun_vid.c:162: warning: long unsigned int format, pointer arg (arg 6) sun_vid.c: In function `xf86ReadBIOS': sun_vid.c:217: warning: long unsigned int format, pointer arg (arg 5) sun_vid.c:217: warning: long unsigned int format, int arg (arg 6) sun_agp.c: In function `xf86EnableAGP': sun_agp.c:321: warning: unsigned int format, CARD32 arg (arg 4) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit d75777d54c2107163305f50e8ee4306da202b95e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Nov 28 13:45:40 2010 -0800 Move xchomp inside #ifdef __linux__ static function only called from the matchDriverFromFiles function that's inside #ifdef __linux__ section Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> commit ccbba444b7b8e1ba555532a847377600bea43d03 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Nov 28 10:45:17 2010 -0800 config: Remove AC_PROG_CC, SED & INSTALL that XORG_DEFAULT_OPTIONS provide Most importantly removes AC_PROG_CC call that resets compiler flags back to C89 mode, breaking use of C99 isfinite() on Solaris in dix/devices.c. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> commit 92cde0b84cdec164cd698dc74a7512d0791d7708 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 08:15:52 2010 -0800 Xserver-spec: Update discussion of font library Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit c1e769250078cbc74d7e6e6ddc5323c4f420ab14 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 08:06:40 2010 -0800 Xserver-spec: Update location of log functions Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit deae18f3cad94959110761ef2ecd9665690e3db5 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 00:45:48 2010 -0800 Xserver-spec: Fix assorted typos Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit a410bf53798bdca43f99476a01ef27cabdf73e01 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 00:35:28 2010 -0800 Xserver-spec: Update lists of macros LOOKUP_DRAWABLE & VERIFY_GC are no longer in dix.h, but WriteReplyToClient & WriteSwappedDataToClient are. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit de518c8f378ea31345c946693d58a26a493af603 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 00:30:37 2010 -0800 Xserver-spec: Remove CreateCallbackList The function is defined as a static, so can't be called by anyone but AddCallback. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit f6c880b257a21a574cf1a47095cb39f32252802e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 00:27:46 2010 -0800 Xserver-spec: Replace deprecated resource id lookup functions Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 922806a5aa6eafc432d6787495b475aaa3f1790d Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 00:14:51 2010 -0800 Xserver-spec: Update Memory Management functions Xalloc, Xrealloc, & Xfree are deprecated now ALLOCATE_LOCAL is removed due to stack overflow issues Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 02449ee24b484c9fea501df5274d95a9f87cab23 Merge: afd6eb6 b85f906 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 30 13:30:59 2010 -0800 Merge remote branch 'ajax/for-keithp' commit afd6eb66d5ef6a59be4c03da4588aaa2ee47b9ad Merge: b169649 ffcbfa0 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 30 13:28:13 2010 -0800 Merge remote branch 'aplattner/for/keith' commit b16964910d29c0bd039e8bb48bcf1199d709fe3e Author: Ferry Huberts <ferry.huberts@pelagic.nl> Date: Tue Nov 30 19:06:55 2010 +0100 dix: do not use bit-wise operators on the boolean result of BitIsOn Performing bit-wise operations on a boolean amounts to mixing types, is confusing and basically incorrect; one should only perform logical operations on booleans. Performing such operations relies on the implementation detail that a boolean is in fact an integer and that its value FALSE is implemented as zero. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5f34853d6f936e8a1a317a59972b07e3f191d1ab Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 15 11:25:13 2010 +1000 xfree86: Bump classic driver default to 1024x768 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 903e0f6f0f0ec54151640fc459ff03dcba0522af Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 10:46:44 2010 -0800 Xserver-spec: Delete DBE Idioms section The code has been gone for a while Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f4ba75a494cf9f4f5b0a979e9ceb519f4a6fcacc Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 10:46:43 2010 -0800 Remove unused ReqLen & CastxReq macros According to Xserver-spec, they were part of the now-deleted DBE "Idioms" code. The last callers of them were removed in commits fe616f9230b6 & 3d642905477f. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b85f9063c2370d7710523bccb8bf030a0710425b Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 22 16:42:04 2010 -0500 xfree86: Remove the xf8_16bpp overlay module Only one (marginal) driver was using it, and it's been fixed to just implement it directly. v2: Also fix sdksyms.sh (spotted by Jesse Adkins) v3: Also fix DESIGN.xml (spotted bu Julien Cristau) Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a861fe6a1cf56df76928d21707551602289963c1 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 30 13:50:42 2010 -0500 vbe: Refuse to believe tiny (or negative) panel sizes from PanelID Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 84a14fab8f930ef1855444ae4e9e3e14ee008328 Author: David Reveman <davidr@novell.com> Date: Wed Jan 6 14:55:48 2010 -0500 composite: add panoramix support Taken from: 50d2d8c8969c165582d215c6e85c4be9eac02b6a dbffd0d44a33dcc84898c7a891d7ba212f65cbb8 9b5b102163b4eaa1b70647354fcab4f6e461c94c 75f9b98af31abf537ac6616c99f3797deb7ba017 07fba8b1f77a6bca44ea6568b346a18ce9d1e61d With minor style fixes, ported to dixLookupResourceByType, and ported away from client->noClientException and xalloc/xfree. v2: Fix a memory leak in PanoramiXCompositeNameWindowPixmap, spotted by James Jones. v3: Fix a buglet in PanoramiXCompositeUnredirectSubwindows, spotted by Dave Airlie. v4: Fix a style issue with resource lookup noted by Jamey Sharp. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 6dea617e0f71a6fc7937e3a1e10474fa87488284 Author: David Reveman <davidr@novell.com> Date: Tue Jan 5 15:35:10 2010 -0500 fixes: Add panoramix support Taken from: 583f4dde81d8d5e9101b0289946e1914ea1ee124 With minor style fixes and ported to dixLookupResourceByType. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 1b3c57f075049250c6d059412af3d6954468a5b7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Aug 20 12:25:23 2010 -0400 xfree86: Remove unused xf86PixmapKeyRec Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 63b9d67d7f4f1fa108370c619e1d0d06baedbd4c Author: Adam Jackson <ajax@redhat.com> Date: Thu Aug 19 18:40:24 2010 -0400 mi: Remove unused miAllocateGCPrivateIndex Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 87f5b843a08fd92b4b31c04e3e6d947b8bc0d160 Author: Adam Jackson <ajax@redhat.com> Date: Fri Nov 19 16:25:51 2010 -0500 render: Reshuffle and cull dead field from GlyphSetRec Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 606e079cc4d9a9db3197652ca51683c36f74efb8 Author: Adam Jackson <ajax@redhat.com> Date: Fri Nov 19 16:17:48 2010 -0500 dix: reshuffle WindowOptRec to fill a hole on LP64 Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit fba5c8154dbc8f8c33801a5a43d7361cd6b54ffe Author: Adam Jackson <ajax@redhat.com> Date: Fri Nov 19 15:21:31 2010 -0500 dix: Remove unused ChangeSaveUnder hooks Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit c4c4676e6874b42c2371eee96faa2c2dbb59a704 Author: Adam Jackson <ajax@redhat.com> Date: Fri Nov 19 15:04:09 2010 -0500 dix: Remove the backing store leftovers Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 48bc8d0dd99284f509bc6de01a8fd24a7bfc69d5 Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 6 09:56:56 2010 -0400 render: repack PictureRec Eliminate the unused dither field, move filter and stateChanges into the bitfield, and reorder elements to pack holes on LP64. sizeof(PictureRec) ILP32 LP64 before: 84 152 after: 72 120 Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit ffcbfa0063bdc7c9ad5ac724285c7b6e67044c18 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Nov 15 20:43:18 2010 -0800 xfree86: Fix rotation of 2-color non-interleaved cursor images When RandR 1.2's transformation code is enabled, it rotates the cursor image so that it appears upright on a rotated screen. This code completely mangles 2-color cursors on hardware where the the mask and source images are not interleaved due to two problems: 1. stride is calculated as (width / 4) rather than (width / 8), so the expression (y * stride) skips two lines instead of one for every time y is incremented. 2. cursor_bitpos ignores the 'mask' parameter if the hardware doesn't specify any of the HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_* flags. To fix this, refactor the code to pass the whole xf86CursorInfoPtr through to cursor_bitpos and compute the correct stride there based on the flags. If none of the SOURCE_MASK_INTERLEAVE flags are set, use the total cursor size to move the 'image' variable into the mask part of the image before computing the desired byte pointer. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Tested-by: Cyril Brulebois <kibi@debian.org> commit 7ee965a300c9eddcc1acacf9414cfe3e589222a8 Author: Adam Jackson <ajax@redhat.com> Date: Tue May 11 09:16:19 2010 -0400 linux: Refactor VT switch on {re,}generation and shutdown This makes more things fatal than were fatal before, but that's correct; if you need the VT, then failing to get it on regeneration means things are about to go very very badly. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 0def735c6a9fab19acc4b806def6921a702f617f Author: Adam Jackson <ajax@redhat.com> Date: Tue May 11 08:40:33 2010 -0400 xfree86: Remove dead ifdefs from VT switching Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 96a7a7d197d5f96e7aa51928155d4b8d5a115875 Author: Adam Jackson <ajax@redhat.com> Date: Mon May 10 18:40:09 2010 -0400 linux: Don't muck about with tty permissions This is not X's job. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 6ce1908ba4959aaa0a48171acb62cf6a5d5cbf18 Author: Adam Jackson <ajax@redhat.com> Date: Wed May 12 08:50:54 2010 -0400 xfree86: Remove os-support/sysv Nothing's using it, the SysV derivatives we support have their own custom versions. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 01159ffc4718ba48ab7b16acaffd8008f9803811 Author: Adam Jackson <ajax@redhat.com> Date: Mon May 10 18:14:49 2010 -0400 linux: Remove redundant variable Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a80780a7638f847c3be20e5e0c7fe85e83d9bdd1 Author: Adam Jackson <ajax@redhat.com> Date: Wed Nov 17 09:03:06 2010 -0500 glx: Remove swap barrier and hyperpipe support Never implemented in any open source driver. The implementation assumed explicit DDX driver knowledge of how the client-side driver worked, since at the time the server's GL renderer was not a DRI driver. But now, it is, so any implementation of these should be done with additional DRI driver API, like the swap control extension. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f4f41c812d2ba5edba7e0e0dbaab4bbf0af834b3 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 17:34:56 2010 +0300 xfree86/xv: Provide a ModeSet hook Reput all ports when the display mode or panning has been changed by RandR code. This makes the overlays appear in the correct position on the screen. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 640c8716e0400e35afd7e91efc826fc447ea6745 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Thu Oct 28 18:13:02 2010 +0300 xfree86/modes: Provide a ModeSet hook in ScrnInfo Add a new hook ModeSet that will be called after display mode is changed, or after the display has been panned. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit a942534ca3908418c407115c6393263c2fe05931 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Tue Nov 2 16:05:13 2010 +0200 xfree86/xv: Pass all coordinate arguments to ReputImage Pass all of the src/dst coordinates to ReputImage so that drivers don't necessarily have to do double bookkeeping. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 0fef4e94480f2bf1157ce5f92fcb0c7dd1585371 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Tue Nov 2 16:23:02 2010 +0200 xfree86/xv: Document VIDEO_CLIP_TO_VIEWPORT incompatibility with reput Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 5f8ec1ade8b485f48de8c72011409219afad9dd7 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Tue Nov 2 16:04:36 2010 +0200 xfree86/xv: Add some helpful comments about ReputImage Document the fact that ReputImage is used for stills as well as images. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit b4ebde23d25bef1b891902d75b2db3aad92685b7 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Mon Nov 1 20:27:25 2010 +0200 xfree86/xv: Fix ReputImage clipping PutImage/PutStill respect the GC clip, however ReputImage does not. PutImage/PutStill are supposed to be oneshot operations so ReputImage should never expand the area covered by the clip, instead it should only shrink if the window clip shrinks. So commandeer clientClip into use by ReputImage and initially make it a copy of the original GC composite clip. Whenever ReputImage needs reclipping update clientClip with the newly calculated composite clip. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 7294236bdb29b4fa7a7bc27aff9c786c5a33c544 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Mon Nov 1 20:02:40 2010 +0200 xfree86/xv: Remove clipOrg from XvPortRecPrivate clipOrg never changes except when clientClip changes, so instead of keeping copies of both originals translate clientClip by clipOrg immediately and just keep the translated clientClip. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 47d8bd0a999693f47fd244dc876ef7f8fcd52854 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 17:31:14 2010 +0300 xfree86/xv: Factor out the meat of xf86XVAdjustFrame for later reuse No functional change. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 3d4d0237a3981820a9b7290f69c7172a48659a10 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 17:14:34 2010 +0300 xfree86/xv: Change the behaviour of AdjustFrame to reput everything Also reput PutVideo/GetVideo ports in AdjustFrame. This makes the overlay track the screen panning instead of staying stationary in the wrong place. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit d794be81218934ad4580211c7a0a27cb71eb5d60 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 18:07:32 2010 +0300 xfree86/xv: No need to free composite clip in AdjustFrame Nothing should change in AdjustFrame that would need the composite clip to be recomputed. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 6051c7e940767b7120ad9c7e9188aee6a6f62b94 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 17:05:02 2010 +0300 xfree86/xv: Change the behaviour of ClipNotify to reput instead of stop When ClipNotify gets called for a visible window, reput instead of stopping the port. This eliminates nasty overlay flickering that happens during clip changes. If the window is invisible or if ReputImage isn't supported stop and remove the port from the window as was done before. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 27707ac5bdf6831630944f02f2128951a529faab Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 17:00:24 2010 +0300 xfree86/xv: Allow xf86XVReputOrStopPort() to stop PutVideo/GetVideo ports Modify xf86XVReputOrStopPort() to allow stopping of all types of ports. Will be useful later. No functional change. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 38987aae199982f17eae664f3a28ff5941d3ee73 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 16:51:24 2010 +0300 xfree86/xv: Factor out the meat of xf86XVWindowExposures for later reuse No fucntional change. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 0178173f0579c4b9dd0cf60b9cd3e5d264f86ae4 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 16:39:13 2010 +0300 xfree86/xv: Eliminate two open coded copies of xf86XVRemovePortFromWindow No functional change. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit b02858b5af47d524001ec571737cc92f6a6f06d3 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Fri Oct 29 16:54:42 2010 +0300 xfree86/xv: Remove useless NULL check from ClipNotify WinPriv->PortRec should never be NULL as WinPriv itself would be removed from the list when the port is removed from the window. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de> commit 23e3d1f23318ce69623f91908f888a09f8b74ac2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 26 10:00:49 2010 +1000 dix: remove now unnecessary !! before BitIsOn() The macro has been changed to do this already, no need for double not-not-ing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 42dc91e32a02b6b21ff5c45f465f3349e5822615 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Nov 24 14:20:30 2010 +1000 include: let BitIsOn() return a boolean value. Simply returning the mask bit breaks checks like BitIsOn(mask, 0) != BitIsOn(mask, 1); as used in 048e93593e3f7a99a7d2a219e1ce2bdc9d407807. The naming of this macro suggests that it should return boolean values anyway. This patch also adds a few simple tests for these macros to make sure they don't accidentally break in the future. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Pat Kane <pekane52@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Keith Packard <keithp@keithp.com> commit 4e0f8f666e61390206c42ad2087477a912525bc7 Merge: 400ddf2 639600f Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 24 11:47:33 2010 -0800 Merge remote branch 'whot/for-keith' commit 400ddf2f58ce673c74d4e8ee829729cd3c75f8c9 Merge: 7250f07 e074f74 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 24 11:46:18 2010 -0800 Merge remote branch 'jeremyhu/master' commit 7250f078c12fd20d5ac9150f54495926e5121461 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Nov 21 14:27:58 2010 -0500 doc: refactor Makefile and xmlrules.in code for reusability A different approach which requires less variables setting and internal knowledge of the reused code. Changing from "install" to "not install" is very easy now. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit f33512b70cf0350a62df2ee2287a870d5fc991a8 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Nov 21 14:27:57 2010 -0500 xmlrules.in: use $(top_srcdir) rather than ../../../ [...] Relative paths don't always work in distcheck when srcdir not = builddir include $(top_srcdir)/doc/xml/xmlrules.in Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit c25b407f22456f50eef90d9bc5e026c05415c021 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Nov 21 14:27:56 2010 -0500 xmlrules.in: specify the xserver entities depedencies on the target The generated docs will rebuild when the xserver.ent file changes. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 73841074eb856e6be3b9f9e3fc2d2721443166ab Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Nov 21 14:27:55 2010 -0500 xmlrules.in: use pattern rules to enable dependencies This will allow a dependency to be specified as done in libX11: %.html: %.xml $(dist_spec_DATA) $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 97e307dda201d6ba28a723c21a95e484921d1b08 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Nov 21 14:27:54 2010 -0500 xmlrules.in: no need to setup xmlto flags when configuring --without-xmlto The AM conditional HAVE_XMLTO should wrap more statements. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1a7b14d1183057fc69a5da446e898104b65c8347 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Nov 21 14:27:53 2010 -0500 xmlrules.in: remove unrequired "@rm -f $@" from doc targets Unable to find a purpose for this, not used anywhere else but in the font module. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d3c523bd124dc1a3f4539f7f6cd4868adbfc25e1 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Nov 21 14:27:52 2010 -0500 doc: HTML file generation: use the installed copy of xorg.css Currently the xorg.css file is copied in each location where a DocBook/XML file resides. This produces about 70 copies in the $(docdir) install tree for all of xorg. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 504e3010e976ccc008ff48417850b594beaee2ec Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Nov 19 22:09:05 2010 -0800 Xorg.man: Replace XDarwin reference with Xquartz Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 566d09a5cd6452ee2e05e23d2205e7c3aa31f0da Author: Bill Nottingham <notting@redhat.com> Date: Mon Nov 15 11:25:14 2010 +1000 xfree86: store the screen's gamma information on init. This fixes a gamma issue on vt switch observed with KDM. VT switching away and back would result in a black screen. Avoid this by storing the current gamma information on init. https://bugzilla.redhat.com/show_bug.cgi?id=533217 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c050aa2f5fa6a7ff8ce4f91def14ca44f799f067 Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 15 11:25:12 2010 +1000 xfree86: apply gamma settings on EnterVT. When entering the VT, re-apply the saved gamma settings for each screen. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit e074f745a80b87d1d82fb39489d7f35163d7552a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Nov 23 16:03:48 2010 -0800 XQuartz: Remove unused CloseInputDevice stub Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 639600fa7ebad7a4953d0b632abeff2d339a49c6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 23 13:30:05 2010 +1000 dix: add a fixme about a corner-case that should probably be fixed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 0aca9e8424d8b978053a29c4468f800fc2e7238c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 23 13:04:19 2010 +1000 dix: fix typo, set the second valuator with the y-axis data. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 45131bb67f9eacb3b55de4bcd3730fb9bb028e8a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 23 12:55:50 2010 +1000 dix: GetProximityEvents needs to check up to the last valuator valuator_mask_size() returns the highest valuator set as opposed to the number of set bits (which obviously changes as we unset valuators). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 048e93593e3f7a99a7d2a219e1ce2bdc9d407807 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 23 11:15:52 2010 +1000 dix: when converting to XI 1.x events, use the first_valuator's device mode Don't stop processing events when a valuator's mode doesn't match the 0th valuator's mode. Instead, start with the first_valuator in the event and keep stacking them on until the first valuator with a different mode is hit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4f3e670fd28fceec384ff0d4ca7c1ff8d7a872ad Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 23 10:59:52 2010 +1000 dix: when comparing axis modes, compare the bits, not the bytes. The DeviceEvent's mode field is a set of bits for each valuator, not bytes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 6f12934d4ea52f17ac7b21e92f4f929db165f83d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 23 10:58:32 2010 +1000 dix: replace a manual valuator check with valuator_get_mode(). This check was missing the OutOfProximity mask and resulted in the wrong bits being set in InternalEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit ebe3ddaf284ad388835da9cbaa6ad61fa21ce6dd Author: Simon Thum <simon.thum@gmx.de> Date: Fri Nov 19 11:09:21 2010 +1000 dix: fix up valuators passed to acceleration code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit d435e1ecb86e2fe6292b5945262956644f979bbb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 5 11:08:27 2010 +1000 test: reduce range of byte-padding macro tests. Byte padding and conversion is interesting for the rage of 0-8 bytes, and then interesting towards the end of the valid range (INT_MAX - 7 and INT_MAX - 3). Note: this changes the upper range for pad_to_int32() and bytes_to_int32() from the previous (INT_MAX - 4) to (INT_MAX - 3). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit f49ee9074a66883a3c525b0d6e71589123288465 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 5 10:59:52 2010 +1000 test: compare byte padding macros against the expected bytes. We calculate the expected bytes for each value, let's use it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit b31df0439fe336a43a2355e2f1fb223d86045a05 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Nov 22 15:14:02 2010 +1000 xfree86: add missing linebreak in error message. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Magnus Kessler <Magnus.Kessler@gmx.net> commit 97b9bb1e2cebbb769ef347455d9c7979d19de99f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Nov 22 20:43:14 2010 -0800 XQuartz: Localization Updates Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit f9fbafa1a07f951e89f208bf4928a0bf37b67cfe Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Nov 22 20:41:39 2010 -0800 XQuartz: Remove existing localization files on install to avoid conflicts Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 6eed13ad5998ba80296bba2bb3f89928ee51194a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Nov 22 20:25:33 2010 -0800 XQuartz dri: Don't check CoreGraphics version The version check is hackish, and I highly doubt anyone using this code is on a version of OS X that predates this support (10.2 has support for it). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit a4698754c1da1cf2ca64add5276d0c6012960504 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Nov 21 10:49:24 2010 -0800 XQuartz: Add pointer debugging Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 31737fff08ec19b394837341d5e358ec401f5cd8 Author: Chase Douglas <chase.douglas@ubuntu.com> Date: Mon Nov 15 11:42:12 2010 -0500 Fix transformAbsolute transformAbsolute must use old values if valuator mask doesn't have new ones, and it must only set new values if there was a change. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 463841f45aafd1227bac652965c9ea337dd527fa Author: Chase Douglas <chase.douglas@ubuntu.com> Date: Mon Nov 15 11:42:11 2010 -0500 Fix GPE Y axis scaling Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a6b9e8f1e5d5d0b3b0f121a6f677eeca7aab1950 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 25 11:06:38 2010 -0400 linux: Fix CPU usage bug in console fd flushing If the vt gets a vhangup from under us, then the tty will appear ready in select(), but trying to tcflush() it will return -EIO, so we'll spin around at 100% CPU for no reason. Notice this condition and unregister the handler if it happens. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ecdbe817fd7eb53fd1e7485c0492355f7f002d2a Author: Dan Horák <dan@danny.cz> Date: Tue Jun 22 19:45:26 2010 +0200 XF86CONFIGDIR is undefined when built with --disable-xorg (#28672) The 10-evdev.conf file gets installed as /usr/share/X11/10-evdev.conf on platforms that built the server with --disable-xorg like s390/s390x. The definition/installation should be guarded with "if XORG" because it makes sense only when built with xorg. X.Org Bug 28672 <http://bugs.freedesktop.org/show_bug.cgi?id=28672> Signed-off-by: Dan Horák <dan@danny.cz> Acked-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 38c46ccf796462d068d95acb9022de2acfc3a1f7 Merge: 3051dd5 c8998af Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 15 09:06:33 2010 +0800 Merge remote branch 'whot/for-keith' commit 3051dd5135962283fc6c7de377a7c819d8a04e7f Merge: ed547a9 c597572 Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 15 08:58:02 2010 +0800 Merge remote branch 'jeremyhu/master' commit ed547a9fc8a4f5cd95ef882b656a376c163eda6d Merge: 78f94f1 84e8de1 Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 15 08:51:27 2010 +0800 Merge remote branch 'adkins/master' commit 78f94f19aab66a1e5331df0ce29f36e310b4195d Author: Linus Arver <linusarver@gmail.com> Date: Sun Oct 17 12:26:01 2010 -0700 Xext: panoramiXprocs: fix typo This fixes a typo introduced in commit 80b5d3a3264d2c5167e5ac85a3b04af0f89cece1. The pointer pDst was changed unintentionally to pWin from a copy/paste error. This resulted in all QT-based apps and some tcl/tk ones (like fontforge) to crash X 1.9 on starting up, when Xinerama was enabled. Bug report: https://bbs.archlinux.org/viewtopic.php?id=106125 Signed-off-by: Elie Bleton <drozofil@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Tested-by: Linus Arver <linusarver@gmail.com> commit c8998af3eba49a542625912d512087e4eaaf5ede Author: Cyril Brulebois <kibi@debian.org> Date: Sat Nov 13 02:05:16 2010 +0100 xfree86: Initialize Pointer and Keyboard. That helps us get rid of: | CC xf86Config.lo | xf86Config.c: In function ‘T.174’: | xf86Config.c:1228: warning: ‘Pointer$module’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$module’ was declared here | xf86Config.c:1228: warning: ‘Pointer$drv’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$drv’ was declared here | xf86Config.c:1228: warning: ‘Pointer$type_name’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$type_name’ was declared here | xf86Config.c:1228: warning: ‘Pointer$private’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$private’ was declared here | xf86Config.c:1228: warning: ‘Pointer$dev’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$dev’ was declared here | xf86Config.c:1228: warning: ‘Pointer$fd’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$fd’ was declared here | xf86Config.c:1228: warning: ‘Pointer$set_device_valuators’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$set_device_valuators’ was declared here | xf86Config.c:1228: warning: ‘Pointer$switch_mode’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$switch_mode’ was declared here | xf86Config.c:1228: warning: ‘Pointer$control_proc’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$control_proc’ was declared here | xf86Config.c:1228: warning: ‘Pointer$read_input’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$read_input’ was declared here | xf86Config.c:1228: warning: ‘Pointer$device_control’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$device_control’ was declared here | xf86Config.c:1228: warning: ‘Pointer$flags’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$flags’ was declared here | xf86Config.c:1228: warning: ‘Pointer$next’ may be used uninitialized in this function | xf86Config.c:1097: note: ‘Pointer$next’ was declared here Signed-off-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 98abac809a024ac3ed9dd0514ca96367f668c05d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Nov 11 23:06:13 2010 +0000 Fix compilation after input API change Fix compilation after commit 675f4a8525d29ebad783351e17be785b2f32b2e8 converts winmouse.c to the new ValuatorMask input API, but doesn't include the required header inpututil.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c5975722a95c41b8715a4612fc1c3275f8e9b59e Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Nov 13 16:04:10 2010 -0800 XQuartz: Fix make distcheck Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Cyril Brulebois <kibi@debian.org> commit 7b33ef74738d6a557cb25aeb14693b2a340c0e12 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Nov 13 15:46:16 2010 -0800 dix: Fix make distcheck Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 965e709f2b0b17f1e59e5aeb5e7717fede51ef97 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Nov 11 17:23:33 2010 -0800 XQuartz: Build-fixes for XQuartz for recent input API changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit fa50670c32637faff6bb91f1206a0e3c17a9bada Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 12 11:48:08 2010 +1000 xfree86: rename allowEmptyInput to forceInputDevices. This is a more accurate name for the actual functionality than allowEmptyInput. Historically, allowEmptyInput has allowed the server to start with no input devices. Since 1.4 and the introduction of VCP and VCK, there are always two input devices present. allowEmptyInput was changed in behaviour to essentially "ignore xorg.conf devices or not", auto-adding the built-in devices if disabled. Rename to forceInputDevices, because that's essentially what it does. When disabled (i.e. when hotplugging is enabled), it disables all mouse/kbd/vmmouse devices configured in the xorg.conf file. When enabled, it forces the traditional behaviour for input devices: - use input devices configured in the server layout - if none are configured, use the first pointer and the first keyboard device in the xorg.conf - if none are configured, create the default pointer/keyboard devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit c481dae0dc89d8d50cac23210023d75bfaf6012b Author: Cyril Brulebois <kibi@debian.org> Date: Thu Nov 11 23:55:55 2010 +0100 test: Fix missing xkbsrv.h include. Otherwise, building fails with CFLAGS="-Wall -Werror" this way: | protocol-common.c: In function ‘init_simple’: | protocol-common.c:159: error: implicit declaration of function ‘XkbInitPrivates’ | protocol-common.c:159: error: nested extern declaration of ‘XkbInitPrivates’ Signed-off-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b8114f25b266624c8f73d03c710349f98693d877 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 12 08:32:05 2010 +1000 dix: fix typo in setting valuator modes (#21548) X.Org Bug 31548 <http://bugs.freedesktop.org/show_bug.cgi?id=31548> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Cyril Brulebois <kibi@debian.org> commit 5cd11d2356d153840f1b429bdb8284367f8dc468 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 9 17:10:57 2010 +1000 Xi: move property reset from extension shutdown to init. If any part of the stack calls XIGetKnownProperty during device shutdown the property is re-initialized before the server generation resets, leaving the value invalid again. Move the reset to the extension init which happens before input devices are initialized before the first property is requested. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit da66119593b63ef82ae6fa2e034ccd0856b03a80 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Nov 10 21:48:04 2010 +0200 dix: fix root window background behaviour for protocol calls Instead always paint root tiled (-retro like), protocol calls (XSetWindowBackgroundPixmap and related) should behave accordingly when None and ParentRelative is set as background pixmap. It follow what the protocol states: "changing the background of a root window to None or ParentRelative restores the default background pixmap". Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> commit 8976e9766edfb33f5cf3f6d54f09e46d29bc4ec5 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Nov 10 21:48:03 2010 +0200 dix: adds support for none root window background It lets the driver notify the server whether it can draw a background when '-background none' option is used by the system platform. Use cases for that could be video drivers performing mode-setting in kernel time, before X is up, so a seamless transition would happen until X clients start to show up. If the driver can copy the framebuffer cleanly then it can set the flag (canDoBGNoneRoot), otherwise the server will fallback to the normal behaviour. The system must explicit indicates willingness of doing so through '-background none'. We could do this option as default; in such case, malicious users would be able to steal the framebuffer with a bit of tricks. For instance, I can see the content of my nVidia Quadro FX 580 framebuffer old X session modifying a bit nv driver: xf86DPMSInit(pScreen, xf86DPMSSet, 0); - /* Clear the screen */ - if(pNv->xaa) { - /* Use the acceleration engine */ - pNv->xaa->SetupForSolidFill(pScrn, 0, GXcopy, ~0); - pNv->xaa->SubsequentSolidFillRect(pScrn, - 0, 0, pScrn->displayWidth, pNv->offscreenHeight); - G80DmaKickoff(pNv); - } else { - /* Use a slow software clear path */ - memset(pNv->mem, 0, pitch * pNv->offscreenHeight); - } + pScreen->canDoBGNoneRoot = TRUE; The commit is originally based on discussions happened on xorg-devel: http://lists.freedesktop.org/archives/xorg-devel/2010-June/009755.html Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Acked-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit bfe9cdd11bcb60cf33dc48136ebee028001a737e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Oct 20 17:54:58 2010 -0200 dix: delete logo hack screen saver Protocol doesn't mention about screen saver with logo being required and people are already using more intelligent ways to draw screen saver themes. So consider -logo as deprecated option, deleting its code. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 84e8de1271bb11b5b4b9747ae4647f47333a8ab7 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Nov 10 21:37:24 2010 -0800 fb: Remove fbcmap.c (bug 5436) This is obsolete since a240c039c47c0be22ea5e100692307b26d938747. Updated fb.h to mention that the functions come from fbcmap_mi.c now. Dropped fbcmap.c from the makefile. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 23e329b5641ef044c34ac712c9193171eaf47198 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Nov 10 21:35:58 2010 -0800 xfree86: parser: Remove 'CUSTOM' flag option in Monitor section. Not used in the initial import, and also not documented. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 88cb61e1e55c54982b90e2a77465faaac6a0ba89 Merge: 19f4383 4ed4915 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Nov 11 12:54:46 2010 +1000 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api Conflicts: dix/getevents.c hw/xfree86/common/xf86Xinput.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4ed4915bc0fbe9b4419ca4a0d4e43c2fee032ae9 Merge: 291c39d ec1bfbc Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 10 16:58:21 2010 -0800 Merge remote branch 'whot/for-keith' commit ec1bfbc66926130e1153facc3b92ee175f1cb6b6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 9 15:27:26 2010 +1000 xfree86: remove user-configured AllowEmptyInput An estimated 100% (rounded down to the nearest percent) of the people who have this in their configuration don't actually know what this option does. Protect the users from themselves. IIRC, AEI on was useful for some time between 1.4 and 1.5 and never since. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit cbaa6a66e0f9e3b7e305606924ecda0147b59e96 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 9 15:21:23 2010 +1000 config: remove mention of AllowEmptyInput "You will probably want to add the following option to the ServerFlags of your xorg.conf: Option "AllowEmptyInput" "True"" I can't imagine why you would want to do that. My life is painful enough already. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 291c39dfef84d1b204d7f5e63e925dee2dbdaca7 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Nov 9 13:33:55 2010 -0800 DOC: Only build dtrace documentation with --enable-docs Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f0b4df99486066ad0e638b3b5debc905bc8ef1c4 Author: Adam Jackson <ajax@redhat.com> Date: Sat Sep 11 17:55:57 2010 -0400 shadow: Optimize shadowUpdatePacked(). (#26973) Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Soren Sandmann <sandmann@daimi.au.dk> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c9c0f93f8ed42413a05193ee71c69fa6b41f6a03 Merge: 73f6de1 4132b1c Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 10 16:11:29 2010 -0800 Merge remote branch 'whot/for-keith' commit 73f6de1ad8b5e1641102b54ff48a36ebb99ccacb Merge: 333b6ed 3dc3aef Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 10 16:02:22 2010 -0800 Merge remote branch 'sandmann/fbdelete' commit 333b6ed26e36735ef72f314a3f8c4ec565af223f Author: Kristian Høgsberg <krh@bitplanet.net> Date: Thu Oct 28 20:46:23 2010 -0700 Set DamageSetReportAfterOp to true for the damage extension Change the damage extension reporter to queue up events after we chain to the wrapped functions. Damage events are typically sent out after the rendering happens anyway, since we submit batch buffers from the flush callback chain and then flush client io buffers. Compositing managers relie on this order, and there is no way we could reliably provide damage events to clients before the rendering happens anyway. By queueing up the damage events before the rendering happens, there's a risk that the client io buffer may overflow and send the damage events to the client before the driver has even seen the rendering request. Reporting damage events after the rendering fixes this corner case and better corresponds with how we expect this to work. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 8d7b7a0d71e0b89321b3341b781bc8845386def6) [anholt: re-applied to revert the revert, now that the cause of the revert is fixed] Signed-off-by: Keith Packard <keithp@keithp.com> commit f36153e3ef6b13a87d016caab09cc9be274b0dd5 Author: Eric Anholt <eric@anholt.net> Date: Thu Oct 28 20:46:22 2010 -0700 Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter. In all these cases, any rendering implied by this damage has already occurred, and we want to get the damage out to the client. Some of the DamageRegionAppend calls were explicitly telling damage to flush the reportAfter damage out, but not all. Bug #30260. Fixes the compiz wallpaper plugin with client damage changed to reportAfter. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c80c41767eb101e9dbd8393d8cca7764b4e248a4 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Oct 25 22:01:32 2010 -0700 os: Fix BigReq ignoring when another request is pending Commit cf88363db0ebb42df7cc286b85d30d7898aea840 fixed the handling of BigReq requests that are way too large and handles the case where the read() syscall returns a short read. However, it neglected to handle the case where it returns a long read, which happens when the client has another request in the queue after the bogus large one. Handle the long read case by subtracting the smaller of 'needed' and 'gotnow' from oci->ignoreBytes. If needed < gotnow, simply subtract the two, leaving gotnow equal to the number of extra bytes read. Since the code immediately following the (oci->ignoreBytes > 0) block tries to handle the next request, advance oci->bufptr immediately instead of setting oci->lenLastReq and letting the next call to ReadRequestFromClient do it. Fixes the XTS pChangeKeyboardMapping-3 test. CASES TESTS PASS UNSUP UNTST NOTIU WARN FIP FAIL UNRES UNIN ABORT -Xproto 122 389 367 2 19 0 0 0 1 0 0 0 +Xproto 122 389 368 2 19 0 0 0 0 0 0 0 Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit cc2c73ddcb4370a7c3ad439cda4da825156c26c9 Author: Luc Verhaegen <libv@skynet.be> Date: Sun Oct 24 23:57:06 2010 +0200 x86emu: fix jump_near_IMM to handle DATA: flag correctly. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24348 Before (data flag ignored -> broken): 66 DATA: e944f1 JMP 1ff6 After (fixed): 66 DATA: e944f1ffff JMP 00001ff8 This subtle difference in the length of decoded instruction meant that the VBE call jumped to the routine setting AX=0x14F (VBE Failed) instead of the routine that set AX=0x4F (VBE success). The ability to run the same code in vm86 significantly aided the debugging of this issue. Those X.org developers who would like to drop vm86 better take special care towards _all_ vesa bugs, as those will expose further issues. Patch applies easily to even xserver 1.4.2. Signed-off-by: Luc Verhaegen <libv@skynet.be> Tested-by: Luc Verhaegen <libv@skynet.be> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit be7cf14c365c8ee0d69c4335e01316bcfcba69a4 Author: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com> Date: Tue Oct 26 09:11:53 2010 +0530 mi: Integer overflow for dashed lines longer than 46340. #31093 Lines of length greater than 46340 can be drawn with one of the coordinates being negative. However for dashed lines, miPolyBuildPoly overflows the int type when setting up edges for a section of the dashed line. This results in the dashed segments not being drawn at all. Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a6c64d96456d794b2f3ce40915922a3fba636b95 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sun Oct 24 15:18:28 2010 +0200 Do not trap access to timer and keyboard Disable timer/keyboard trapping on GNU/Hurd for now Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these ports, and the int10 wrapper is not emulating them. It's effectively what happens in the Linux variant too, as iopl() is used there, making the ioperm() meaningless. Signed-off-by: Olaf Buddenhagen <antrik@users.sf.net> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 69e8e1b0b95a325da3e3a2d76d092e7131baa9ad Author: Julien Cristau <jcristau@debian.org> Date: Mon May 17 19:39:54 2010 +0200 os: include dix-config.h, not xorg-config.h os/strlc{at,py}.c were trying to include xorg-config.h, which is not available in dix. Signed-off-by: Julien Cristau <jcristau@debian.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit acba00c0c1129fe4ef7655f018cd21dbb1ee9a1f Merge: 383dfe2 44e8165 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 10 14:41:08 2010 -0800 Merge remote branch 'dottedmag/master' commit 383dfe23f1641435c0713f8a56424814a156af8e Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Oct 25 17:13:57 2010 +0300 DRI2: Avoid call to NULL pointer DDX driver may implement schedule swap without GetMSC. In that case we can't call GetMSC in DRI2SwapBuffers. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> CC: Keith Packard <keithp@keithp.com> CC: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 68e4a628d65312df93cc71f3e76241584c4bbd23 Author: Cyril Brulebois <kibi@debian.org> Date: Wed Nov 10 15:28:29 2010 +0100 Remove more superfluous if(p!=NULL) checks around free(p). This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) { - free(E); - } + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b142b0d27442191d628762604f4eb1f65263d717 Author: Cyril Brulebois <kibi@debian.org> Date: Mon Nov 8 23:35:33 2010 +0100 Remove more superfluous if(p!=NULL) checks around free(p). This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) - free(E); + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0649ac0afdb3f8ed11c2634563d6b9df161cb9ec Author: Cyril Brulebois <kibi@debian.org> Date: Mon Nov 8 23:35:32 2010 +0100 Remove more superfluous if(p) checks around free(p). This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E) - free(E); + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 99275ad2fa99778afaefc54b62c8638afc59e755 Author: Cyril Brulebois <kibi@debian.org> Date: Wed Nov 10 16:06:10 2010 +0100 Remove superfluous if(p!=NULL) checks around free(p); p=NULL; This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) { - free(E); ( - E = NULL; | - E = 0; ) - } + free(E); + E = NULL; Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9e999d18b004b8ead9c6c5d79b4a3d4bbf0e3152 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 5 12:08:11 2010 +1000 Xi: if XTEST device creation fails, fail the master devices. When getting close to the MAXDEVICES limit, the creation of XTEST devices may fail due to device id exhaustion. In that case, fail the creation of master devices too and return an error to the client. Theoretically, we could alloc the MDs without the XTEST devices but that will get interesting when a client starts sending XTEST events through those devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 5a455e0c80d433adc4109ebf313fd92afa194545 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 5 11:49:12 2010 +1000 Xi: rename two variables from ptr to dev. They were named ptr when everything was in one function to save one more variable. Now that the stuff is split out, "dev" makes more sense. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 9b89b91c685426c9944f7fc8890f436c18b7583c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 5 11:47:43 2010 +1000 Xi: split hierarchy manipulation into static functions. No functional changes, just code cleanup to improve readability. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 4132b1c591bd01c29df91b88afbd144647da9ed8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Oct 21 14:04:42 2010 +1000 xfree86: fix compiler warnings - unused variable i ../../../../hw/xfree86/common/xf86Config.c: In function 'configDRI': ../../../../hw/xfree86/common/xf86Config.c:2213:9: warning: unused variable 'i' Introduced in 788bfbf18ac19923604b0d676933fdc0d78526a1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 6b982d73bb8878238ed46665b220a94a591e11a9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Oct 21 13:53:35 2010 +1000 xfree86: fix two compiler warnings - unused variable ati, atimisc ../../../../hw/xfree86/common/xf86Config.c: In function 'fixup_video_driver_list': ../../../../hw/xfree86/common/xf86Config.c:507:19: warning: unused variable 'atimisc' ../../../../hw/xfree86/common/xf86Config.c:507:12: warning: unused variable 'ati' Introduced in 52577ae8eeda64601db8dd425027cf8e4271b873. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 0799f0771cca335d6400a8494ba236a0d10e122b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Nov 4 12:53:18 2010 +1000 xfree86: remove two unused variables from Makefile.am Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit a52efb096e166e325deb3d6b502671f339a4fa15 Merge: fe8d122 f72aadd Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 3 06:50:45 2010 -0700 Merge remote branch 'sthibaul/master-iopl' commit 3dc3aefb88c167d365795dcd44017742c52e4967 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Nov 1 22:23:05 2010 -0400 fb: Delete a bunch more left-overs All of these definitions were unused since compositing moved to pixman. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 565b5e2b0261d1148cc2707ffcbb915414dd3e02 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Nov 1 22:14:29 2010 -0400 wfb: Delete unused renamings These functions haven't existed in a while. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 0dae479e16590e767df35985150c5acf696e5df2 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Nov 1 22:17:08 2010 -0400 fb: Delete fbCompositeGeneral() This function was an unused and trivial wrapper around fbComposite(). Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 74bc2d8c6bafc5373ff9c14eed12e26b5b965953 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Nov 1 22:12:03 2010 -0400 render: Delete renderedge.[ch] The functions in these files have not been used since trap rasterization was moved to pixman. They survived until now to preserve the server abi. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit 6118346d64e3c2fbe1fe2f041ea773dd2a3c0438 Author: Søren Sandmann Pedersen <ssp@redhat.com> Date: Mon Nov 1 22:04:49 2010 -0400 Delete unused fbWalkCompositeRegion() This function has not been used since most of the compositing was moved to pixman. The only reason it has survived until now is that it was part of the server ABI. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com> commit fe8d122b133a43125cc961d2c3c811fa776f29c8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Oct 28 16:13:09 2010 +1000 Xi: reshuffle conditions for labeling a device as IsXExtensionKeyboard (#29046) From the original bug reporter Ezra Reeves: "I did some more digging on this today, and I found that an HP branded wireless USB mouse has the same issue. With this mouse (as well as the logitech wireless mouse), the return from: xdev = XListInputDevices(GDK_WINDOW_XDISPLAY(rootwin), &ndevices_return); lists the USB device twice, but both have xdev[num].use == 3 (IsXExtensionKeyboard as defined in X11/XI.h). [...] Swapping the order of the test in Xi/listdev.c that determines whether a device is a pointer or a keyboard properly detects my devices (OEM USB wireless mouse/kb combo) -- one as a keyboard and one as a pointer." X.Org Bug 29046 <http://bugs.freedesktop.org/show_bug.cgi?id=29046> Reported-by: Erik Kilfoil <ekilfoil@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a210068c5222acbdb04db17cb8cef314735bf977 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Oct 26 20:50:13 2010 +0300 dix: advance parent window pointer when no node is found Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 19f43836d1006d253391926e880b14ed2e7a0cf8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 25 15:10:19 2010 +1000 Re-export xf86CollectInputOptions. Some drivers, most notably the mouse driver need this and reimplementing on the driver side doesn't make sense. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4613ce3f78a32f2a6f422e719150d55b035c758e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 15:17:50 2010 +1000 test: valuator_mode tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 58554f1c6429535e7ab432c920aabca71a77edb8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 15:10:32 2010 +1000 Convert some leftover axes->mode access to valuator_get_mode() Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 44e81654147065b7b907ce0d14fdc2e74a638f79 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Oct 25 01:30:33 2010 +0400 Remove now-misleading comment Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 433dddcf29d257310e95e4215dceef8b0b976e2d Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Oct 25 01:28:38 2010 +0400 Replace "if(buf) realloc(buf, size) else malloc(size)" with realloc() Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 04a04e162886ca9bc3977d3a7509def876487921 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Oct 25 01:27:46 2010 +0400 Remove now-misleading comment Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit f72aadd38b730c46c0a027dacbbb57f03068383d Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sat Oct 23 22:42:33 2010 +0200 hurd: Fix use of deprecated iopl device Fix Xserver on GNU/Hurd into using the "mem" device instead of the deprecated "iopl" device. Reviewed-by: Olaf Buddenhagen <antrik@users.sf.net> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> commit dd11f734a9a73bf34357c149d2809842938d57b5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 16:11:24 2010 +1000 input: remove "mode" field from ValuatorClassRec. We have per-axis mode now. For those bits that still need it (XI 1.x), assume that the first axis holds the device's mode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 5cf3b654fccf09de63a3f983c85096cda78fb693 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 15:49:40 2010 +1000 input: move proximity state into ProximityClassRec. Previously the OutOfProximity bit in the valuator mode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit e909af88bf17dbadcc00d50c13a5bdb6001367be Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 14:22:44 2010 +1000 dmx: clarify a valuator mode condition. Relative is defined as 0, so change the condition to be more obvious. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit b5ef88c911f697530ddc2c7302fce15ba2ead4b2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 14:02:17 2010 +1000 dix: clip absolute axes depending on their mode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit ea567b675f814ac41e75f1ed8ded0ac3e9d552a8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 14:01:11 2010 +1000 dix: populate motion history only if the mode matches the first axis. XI1 doesn't cater for mixed mode devices, so bail out on the first valuator that has a different mode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 4381b70f5aa293400735e9b4e5a792408afa25a2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 13:57:27 2010 +1000 input: add valuator_get_mode() helper. Returns the mode of the specified valuator. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 6f6f460c2485d16d126a1ab5d939083c322dc3dd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 22 13:48:06 2010 +1000 dix: send proximity events if one or more axes are Absolute. We only skip relative events for proximity, not absolute ones. Now with mixed mode, just unset those axes that are relative. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 65c0fc81eb920085e650b8c9e874c9dd26c7ec98 Author: Chase Douglas <chase.douglas@canonical.com> Date: Fri Jul 16 09:21:19 2010 -0400 Add support for per-axis valuator modes (Relative/Absolute) The XI2 protocol supports per-axis modes, but the server so far does not. This change adds support in the server. A complication is the fact that XI1 does not support per-axis modes. The solution provided here is to set a per-device mode that defines the mode of at least the first two valuators (X and Y). Note that initializing the first two axes to a different mode than the device mode will fail. For XI1 events, any axes following the first two that have the same mode will be sent to clients, up to the first axis that has a different mode. Thus, if a device has relative, then absolute, then relative mode axes, only the first block of relative axes will be sent over XI1. Since the XI2 protocol supports per-axis modes, all axes are sent to the client. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> commit 290af0418f8c94355e42ad81aa7779b90e173fc9 Author: Chase Douglas <chase.douglas@ubuntu.com> Date: Thu Oct 21 22:41:09 2010 -0400 test: input - set valuators mask for event to core conversion Commit de8be07cc0a8163b6ef04455706fd5ca2cebe587 adds a requirement to event to core conversion that at least one of the X or Y valuators are set in the valuator mask. This commit fixes the event conversion test to be compliant. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8990b31214bcbc08090604147287455bfde91c11 Author: Paulius Zaleckas <paulius.zaleckas@gmail.com> Date: Mon Oct 18 00:02:01 2010 +0300 KDrive: Fix error handlig in tslib driver If ts_open() fails and return NULL, then next call to ts_fd() segfaults because of NULL dereference. There is no need to check output of ts_fd() as ts_open() did this internally. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9696c782c8cb86b06d12949899582533a2e04cfe Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Oct 19 12:52:57 2010 +1000 test: valuator_mask tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 2362adc2da9745e01c79ed4905aa81926355c4e2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Oct 19 10:59:09 2010 +1000 dix: remove valuator_mask_copy_valuators, not needed anymore. With the switch to masks internally, this isn't needed anymore. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 2b04a3ef739a7ba5708400999e5d81418236a0a4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Oct 19 09:58:58 2010 +1000 xfree86: convert xf86Post{Motion|Key|Button|Proximity}Event to masks Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 0418a39e71e50b88e050b0d8a758265b17c4bf0e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 18 15:55:53 2010 +1000 dix: get rid of the now-superfluous valuator arrays in GPE and friends. The valuators are stored inside the mask, use it from there. are stored inside the mask, use it from there. are stored inside the mask, use it from there. are stored inside the mask, use it from there. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 675f4a8525d29ebad783351e17be785b2f32b2e8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Oct 19 13:37:46 2010 +1000 Abstract valuator masks through a set of APIs. This commit introduces an abstraction API for handling masked valuators. The intent is that drivers just allocate a mask, set the data and pass the mask to the server. The actual storage type of the mask is hidden from the drivers. The new calls for drivers are: valuator_mask_new() /* to allocate a valuator mask */ valuator_mask_zero() /* to reset a mask to zero */ valuator_mask_set() /* to set a valuator value */ The new interface to the server is xf86PostMotionEventM() xf86PostButtonEventM() xf86PostKeyboardEventM() xf86PostProximityEventM() all taking a mask instead of the valuator array. The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to memory allocation restrictions in SIGIO handlers. For easier review, a lot of the code still uses separate valuator arrays. This will be fixed in a later patch. This patch was initially written by Chase Douglas. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 1a0d9324b3d9fd93e685066e0e5cea0611878c0d Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun Oct 17 09:58:50 2010 -0700 Revert "Set DamageSetReportAfterOp to true for the damage extension" (#30260) This commit breaks the Compiz "Wallpaper" plugin. This reverts commit 8d7b7a0d71e0b89321b3341b781bc8845386def6. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d738175eaf1098e29b8afb6de8e99b5098e366a7 Merge: 8806a04 9872e0f Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 19 22:50:15 2010 -0700 Merge remote branch 'whot/for-keith' commit fc48a8f9f5f66e591b3e39211d44ce68267303f8 Author: Chase Douglas <chase.douglas@canonical.com> Date: Tue Oct 19 13:37:38 2010 +1000 Add CountBits() to the server. Function to count the number of bits set in the given array. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit 9872e0f0115cd7d0543e55a1831facddf3aff90c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Oct 13 10:31:51 2010 +1000 xfree86: set mask for valuators 0/1 when emulating core events (#30267) EventToCore as of the commit below won't generate core motion events if the valuator mask for x/y isn't set. For DGA, we work around this check by forcibly setting the mask in the event we pass down. commit de8be07cc0a8163b6ef04455706fd5ca2cebe587 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 17 12:08:52 2010 +1000 dix: don't create core motion events for non-x/y valuators. X.Org Bug 30267 <http://bugs.freedesktop.org/show_bug.cgi?id=30267> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Andrew Randrianasulu <randrik@mail.ru> Tested-by: Andy Furniss Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 649293f6b634e6305b6737a841d6e9d0f0065d6c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 11 16:09:18 2010 +1000 xkb: always fill the symsPerKey array, regardless of client flags (#30527) Even if a client does not modify the symbols, symsPerKey and mapWidths must be filled from the current configuration. Both arrays are then passed into other functions (pending the right flag), thus they must contain valid values regardless of the XkbKeySymsMask flag in req->present. X.Org Bug 30527 <http://bugs.freedesktop.org/show_bug.cgi?id=30527> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit ca21a266224b6eff4fd817c2082d2e144f1ea58c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 11 15:38:38 2010 +1000 xkb: init mapWidth and symsPerKey arrays to 0. Helps debugging greatly, random 8 or 16 bit values can sometimes look like valid values, causing much excitement on the client front. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 8806a04f7f028dd9f6a7ff5c36e460d3895c7deb Author: Michał Górny <mgorny@gentoo.org> Date: Thu Oct 14 15:49:51 2010 +0200 kdrive: Fix linking with tslib, with -Wl, --as-needed. #30600 Change the library order in TSLIB_LIBS variable, placing ${TSLIB_LIBS} after the local static libraries. This fixes linking with -Wl,--as-needed. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30600 Signed-off-by: Michał Górny <mgorny@gentoo.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit c7e436e9987a6fb0876c63e96f59ff4c20b4bef0 Author: Michał Górny <mgorny@gentoo.org> Date: Thu Oct 14 15:49:50 2010 +0200 kdrive: Fix tslib check fallback to set TSLIB_LIBS. #30599 If pkg-config is unable to find tslib but the fallback check does find it, the compilation continues with tslib support enabled though TSLIB_LIBS are unset. Thus, the compilation fails with a linking error on tslib functions. This patch sets TSLIB_LIBS to '-lts' whenever the tslib fallback check succeeds. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30599 Signed-off-by: Michał Górny <mgorny@gentoo.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 25801a2556ca9b42646023e5a95a3cbf7309e852 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Oct 14 22:38:17 2010 +0100 Cygwin/X: Move duplicate extern variable declarations from various .c files to a new header file For the global variables defined in winglobals.c, remove duplicate extern declarations from the beginning of various .c files, and move most of them into a new header file, winglobals.h Leave some clipboard related variables alone for the moment, they need treating more carefully, to avoid mixing client and server type definitions. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 04d11abcf2ea2f36d899428e9c885b69e4f779ad Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Oct 14 22:45:31 2010 +0100 Cygwin/X: Remove g_hwndKeyboardFocus It's set but it's value is never used Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 5e896e425fe14022b0714301531bd54151c763f0 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Oct 14 22:43:51 2010 +0100 Cygwin/X: Make g_hmodCommonControls static Make g_hmodCommonControls static, it's only used in InitOutput.c Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 49b996faadf0fedcee25d4a8f96f4c4007c29f5f Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Oct 15 13:00:46 2010 +0100 Cygwin/X: Make g_hmodDirectDraw static Add winReleaseDDProcAddresses() for releasing the direct draw module handle, so g_hmodDirectDraw can be made static Remove unneeded duplicate extern definitions of g_fpDirectDrawCreate and g_fpDirectDrawCreateClipper, and move the definition from winglobals.c to winengine.c Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 6f12277e37d16a7de9d3f3079688c43b07921b0a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Oct 14 22:44:53 2010 +0100 Cygwin/X: Make g_hhookKeyboardLL static Make g_hhookKeyboardLL static, it's only used in winkeyhook.c Also remove unused externs Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 9952b51f6822aeaa19c27caf85698741eb4c27d8 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Oct 15 13:01:45 2010 +0100 Cygwin/X: Fix typos in comments Fix a few typos in comments Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 1de5db73d31411798ae93619d9e626fa32e0c4bd Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Oct 14 22:46:09 2010 +0100 Cygwin/X: Drop several unneeded includes of winprefs.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 8e723108151136f115e8e6d4b97ed4e2fa685dbf Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Sep 29 14:18:27 2010 +0100 Xming: Remove uses of register keyword I'm pretty sure the compiler has a better idea how to optimize this Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d11761c6a6dd2a9963dfd3bcb313f1b2525387fc Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Feb 26 13:31:18 2010 +0000 Xming: Casts to remove warnings on event pointers winkeybd.c: In function ‘winSendKeyEvent’: winkeybd.c:489: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type winmouse.c: In function ‘winMouseButtonsSendEvent’: winmouse.c:247: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type winmouse.c: In function ‘winEnqueueMotion’: winmouse.c:380: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 10bf8345cf15c6030147a9edb7f6a093c8db8099 Author: Colin Harrison <colin.harrison@virgin.net> Date: Mon Oct 12 13:50:00 2009 +0100 Xming: Warning fix in winDeviceCursorCleanup() return statement with an expression in a function whose return-type is void Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit cab837a60a7aa653ccea77ff714335186ce38a4b Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Jul 18 13:22:46 2010 +0100 Cygwin/X: Reformat the keyboard layout mapping table Also remove the out-of-date listing of keyboard layout IDs and which ones have known mappings XXX: layout zh_TW doesn't exist anymore This patch brought to you by C-u M-x align-regexp Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit ee2867649d9485f6559f88a973eae6393971ff35 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Jul 18 13:20:01 2010 +0100 Cygwin/X: Clarify XKB options in XWin man page Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 1ba1b12d24d8f825babd8cf38710c7fa9a94821e Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Oct 15 13:46:09 2010 +0100 Xming: Warning fix in winApplyHints() winmultiwindowwm.c: In function ‘winApplyHints’: winmultiwindowwm.c:1587: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit fb64414548c437bf52c3dcd0613aab5079faffba Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Oct 15 14:19:57 2010 +0100 Xming: Fix warnings in ProcWindowsWMFrameSetTitle() winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’: winwindowswm.c:516: warning: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness winwindowswm.c:516: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness winwindowswm.c:528: warning: pointer targets in passing argument 2 of ‘SetWindowTextA’ differ in signedness Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit da5955cc023ae980fdc0397f6fd541e788040c29 Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Oct 15 14:18:53 2010 +0100 Xming: Fix warnings in windialogs.c windialogs.c: In function ‘winDisplayExitDialog’: windialogs.c:327: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast windialogs.c: In function ‘winDisplayAboutDialog’: windialogs.c:597: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast windialogs.c: In function ‘winAboutDlgProc’: windialogs.c:697: warning: comparison between pointer and integer windialogs.c:701: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘HINSTANCE’ windialogs.c:716: warning: assignment makes integer from pointer without a cast windialogs.c:736: warning: assignment makes integer from pointer without a cast windialogs.c:756: warning: assignment makes integer from pointer without a cast Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 6d9fb07db210bcfdcdde632fa341c4ee08d44b35 Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Oct 15 14:16:54 2010 +0100 Xming: Fix warnings in winNameCompare(), winNormalizeName() winconfig.c: In function ‘winNameCompare’: winconfig.c:715: warning: array subscript has type ‘char’ winconfig.c:715: warning: array subscript has type ‘char’ winconfig.c:716: warning: array subscript has type ‘char’ winconfig.c:716: warning: array subscript has type ‘char’ winconfig.c:730: warning: array subscript has type ‘char’ winconfig.c:730: warning: array subscript has type ‘char’ winconfig.c:731: warning: array subscript has type ‘char’ winconfig.c:731: warning: array subscript has type ‘char’ winconfig.c: In function ‘winNormalizeName’: winconfig.c:1092: warning: array subscript has type ‘char’ winconfig.c:1093: warning: array subscript has type ‘char’ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 20510e51001d1659000c8d8607c0de16022d1c74 Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Oct 15 14:15:51 2010 +0100 Xming: Fix warnings in winClipboardFlushXEvents() winclipboardxevents.c: In function ‘winClipboardFlushXEvents’: winclipboardxevents.c:225: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’ winclipboardxevents.c:266: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’ winclipboardxevents.c:619: warning: pointer targets in passing argument 1 of ‘strcat’ differ in signedness winclipboardxevents.c:659: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness winclipboardxevents.c:669: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness winclipboardxevents.c:690: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness winclipboardxevents.c:698: warning: pointer targets in passing argument 1 of ‘strdup’ differ in signedness Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 44c8b449d281c4d984d65f66bac96a65806b2efa Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Oct 15 14:13:57 2010 +0100 Xming: Fix warning in winClipboardErrorHandler() winclipboardthread.c: In function ‘winClipboardErrorHandler’: winclipboardthread.c:444: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 1f2a57d9e46424a2e0861f55253b91d930d79083 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Oct 15 14:12:22 2010 +0100 Cygwin/X: Turn off the bad-function-cast warning for XWin code Turn off the bad-function-cast warning for the XWin code, it's near impossible to write code which uses Win32 API calls that doesn't trigger this warning For example, SendMessage(WM_SETICON) returns an LRESULT, but we are supposed to know this is safe to cast this result to a HICON, which gcc considers a non-matching type. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 55e528b6cc6451dbb1e65baec199d4df0441e86d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Mar 25 23:39:37 2010 +0000 Cygwin/X: Remove execute permission from source files Remove execute permission from source files Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit b2b685e2693ff5f089006f5b3882d6b0c0853862 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Mar 25 23:00:48 2010 +0000 Cygwin/X: unifdef XFree86Server Remove XFree86Server define, which was always on anyhow, and the code which was guarded by !XFree86Server This completes the process of removal started in 2006 :-) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 9ed70f15eff6a85222b46db1fe7af25154314464 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Nov 2 17:37:14 2009 +0000 Cygwin/X: Use normal apostrophe in XWin DDX help text Use U+0027 APOSTROPHE in XWin DDX help text, rather than U+2019 RIGHT SINGLE QUOTATION MARK Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 9f8f056a21b9480fd9fd43a22c9d6f45a2c1ef87 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Mar 23 16:34:26 2010 +0000 Cygwin/X: Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 5aff712a8d2eb9f965ecbb93216cc0bcdc327ae6 Merge: 5b98c62 e354cca Author: Keith Packard <keithp@keithp.com> Date: Mon Oct 18 17:16:23 2010 -0700 Merge remote branch 'whot/for-keith' commit 5b98c6267f575ec4ff498ecb651e34dbff030b83 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 18 16:01:40 2010 -0400 randr: Remove mirandr This isn't used anywhere, not least because it's completely nonfunctional. Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 7bb653bedceb6180a0361ead1c612839e776ce98 Author: Olivier Fourdan <ofourdan@redhat.com> Date: Mon Oct 18 15:59:35 2010 -0400 modes: improve aspect ratio match for classic drivers After we infer the aspect ratio for the screen, we pick the largest mode matching that aspect ratio from the best mode pool available. We then clamp virtual size to that mode, and run the resulting mode list through the driver's ValidMode hook. In doing so we might filter away our initial guess. If this happens we shrink the default mode to the next largest mode from _any_ mode pool. This is usually wrong, and we should instead pick the next aspect-matched mode from the best available mode pool (as always, user then driver then default). Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit d6d90a4fccef086e7c7934adea901b2cd9a595bf Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 18 15:53:43 2010 -0400 composite: Move the backfill comment to a more appropriate indent level Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit db8840600e8e21356241eb87395031388d9b54d2 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 18 15:52:52 2010 -0400 composite: Don't backfill non-MapWindow allocations Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 6dd775f57d2f94f0ddaee324aeec33b9b66ed5bc Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 18 15:50:37 2010 -0400 composite: Don't backfill non-bg-None windows If there's a defined background then backfilling is a waste of effort, since exposure processing will paint that in for us. But note that we have to backfill if any children are bg=None to preserve semantics with non-composited servers. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit d2064fbb687839c297a851a5d85f32dfbbe4a0d5 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 18 15:42:54 2010 -0400 ddc: Don't probe for DDC/CI or EEPROM For whatever reason, some (broken) monitors will crash if you do this. We're not actually using this information for anything, so let's just not do it. Originally reported as http://bugzilla.redhat.com/620333 Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 47c91dca8d8eecb429123e8370302831bcd57938 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 18 15:40:28 2010 -0400 xfree86: Drop linux libc5 support from the SIGIO code Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 788bfbf18ac19923604b0d676933fdc0d78526a1 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 14 15:10:43 2010 -0400 dri1: Remove "buffers" from the config logic This was only ever used from the glint driver, which has since lost its DRI support. Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit a77458486a7b9d78dcd284e2bcc96c1fda0e862a Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 14 14:00:53 2010 -0400 xfree86: Remove %M expansion from config parser This was to distinguish XFree86 3.x files from XFree86 4.x files. It never really made sense to be looking for xorg.conf-4. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit f8ec71603c796f3b272a0592cbb934c2a6e8d633 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 14 13:45:31 2010 -0400 xfree86: Remove an open-coded strtoul() Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 52577ae8eeda64601db8dd425027cf8e4271b873 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 14 13:22:00 2010 -0400 config: Remove atimisc workaround Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 8bb1983a5f2dbf72366de9fb793a46e35912ab61 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 2 15:22:18 2010 -0400 config: Don't look for .o drivers anymore This hasn't worked since we switched to dlloader. Reviewed-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit e354ccac36a8ee3a23bdc845833c16a5646cc200 Author: Joe Shaw <joeshaw@litl.com> Date: Thu Oct 14 15:09:20 2010 -0400 fix a sign problem with valuator data. Without this patch, any negative valuator value is wrong when returned from XQueryDeviceState(). This is a regression from at least xserver 1.4. Valuator data is set in dix/getevents.c:set_valuators() by copying signed int values into an unsigned int field DeviceEvent.valuators.data. That data is converted into a double with an implicit cast by assignment to axisVal[i] in Xi/exevents.c:UpdateDeviceState(). That double is converted back to a signed int in queryst.c:ProcXQueryDeviceState(). If the original value in set_valuators() is negative, the double value will be > 2^31 and the conversion back to a signed int is undefined. (Although I consistently see the value -2^31.) Fix this by changing the definition of DeviceEvent.valuators.data from uint32_t to int32_t. Signed-off-by: Joe Shaw <joeshaw@litl.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 424b856e8e19f35c24bfc0a9fced9464d2f17c90 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 15 14:35:22 2010 +1000 dix: update comments for GetPointerEvents and friends All these now generate InternalEvents, point this out. Remove XKB/XI references, that's just confusing. This comment referred to the old-style event generation code from server 1.4 to including 1.6 but is now just confusing to newcomers. Remove comment about SwitchCoreKeyboard() for the same reason. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> commit e2ada55de3e7ec8724b98c4e4adfec741d415499 Author: Adam Jackson <ajax@redhat.com> Date: Mon Sep 27 13:58:40 2010 -0400 os: Clean up various xtrans bits that we've never supported Or at least, not supported since xserver 1.0. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit eaf0b6a4d83d49930d21d5191f335fcac962632e Merge: 693e92d 23229c7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 15 13:46:59 2010 +1000 Merge branch 'master' into input-api Conflicts: config/udev.c hw/xfree86/common/xf86Helper.c hw/xfree86/common/xf86Module.h hw/xfree86/common/xf86Xinput.h hw/xfree86/os-support/linux/lnx_init.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3c28a29e132d6f73c36d4b64818d112b1c6e9a40 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Oct 13 15:53:59 2010 +1000 xfree86: rename parameter names to xf86ScaleAxis. Maybe it's just me but every time I look at it I get confused again and need to work it out from scratch. Rename the parameters to something self-explanatory, to/from and min/max. No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 23229c7ce5970516b97a1cc12e65257ff65ab9a7 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Oct 13 16:28:14 2010 -0700 test: Fix make distcheck when not building unit tests Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit ff82f724e4ed24d73f15fa9c35a1d0c2c7d8cef7 Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Oct 13 10:20:06 2010 -0700 Comparison between pointer and integer in latest dix/dispatch.c Signed-off-by: Keith Packard <keithp@keithp.com> commit da4eebe58ec81e2297cc1773af1fb622fb392bbd Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Oct 13 17:34:31 2010 +0100 event_size is currently never assigned to in mieqProcessInputEvents(). event_size is never assigned to in mieqProcessInputEvents(), so realloc() is always called. This is benign, but I'm guessing not intended. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6274dca9d984ad3c553b4901edc3151e770e6c40 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 11 16:37:16 2010 -0400 dix: optimize CallCallbacks Move the basic sanity checking to an inline wrapper, which avoids the function call overhead if the callback list is empty. On an XACEful server on a 2.4GHz Core 2 Duo: 1 2 Operation -------- ----------------- ----------------- 20000000.0 25100000.0 ( 1.25) X protocol NoOperation Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit e418cd332c1f458d028df3fdf684011109d0c183 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 11 10:49:57 2010 -0400 xwin: Remove some undue paranoia about UNDRAWABLE_WINDOW mi will throw away rendering to input-only windows. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Keith Packard <keithp@keithp.com> commit febf3e7ead8dbb355622c896ff1744b2ca52a49a Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 11 10:49:56 2010 -0400 dix: Remove the memory of the multibuffer extension Drop DRAWABLE_BUFFER and related checks, mbuf was the only thing that used them and it was killed in 0ba82562. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1333e101b4f6ecca72568b7f462884f8b102a5c2 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Oct 7 18:17:02 2010 -0700 Remove leftover fbSaveAreas & fbRestoreAreas defines from wfbrename.h The fb functions they try to rename were deleted in 2007 by commit ae7f71a8b3d6756161e55d998d6eec37d2695c98 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8efa3623f32939ef525926b57fd533f4c01ec4b3 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Aug 4 13:48:33 2010 -0700 Use GetCurrentRootWindow or equivalent instead of spriteTrace[0]. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 32de0c19075b886c2fc03f6ad73d9c15df1b2309 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Aug 4 11:44:05 2010 -0700 Move replay-window check from ComputeFreezes to CheckDeviceGrabs. This just simplifies ComputeFreezes, eliminating some duplicated code and a goto. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1c1811ecafc144151630b3588394e2c345c53aa4 Author: Jamey Sharp <jamey@minilop.net> Date: Tue Aug 3 19:49:59 2010 -0700 CheckDeviceGrabs: Delete redundant pWin->optional test. CheckPassiveGrabsOnWindow returns FALSE if pWin->optional is NULL, because wPassiveGrabs uses wUseDefault, so don't bother checking at the caller. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c360b3eb1deeac51913e7b1286b2767711c541fc Author: Jamey Sharp <jamey@minilop.net> Date: Tue Aug 3 19:40:26 2010 -0700 Let CheckPassiveGrabsOnWindow callers check if device is already grabbed. CheckDeviceGrabs checked all the ancestors of the window containing this device's pointer even if no new grabs could possibly apply due to the device already being grabbed. ActivateFocusInGrab and ActivateEnterGrab already checked whether they should break an existing grab, and then set up an event that was completely ignored if they didn't actually break the grab. In both cases, just do what we would have done eventually anyway--return FALSE from CheckPassiveGrabsOnWindow's caller--but do it sooner. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 853d7ebfa3e2d281d92890a39010ff5787a00ffd Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 5 11:24:28 2010 -0400 vbe: Fix copying the mode info block Just use memcpy, seriously. Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b2f9ce201cc2a14d5d6ad055b46c9317b040ec2e Author: Adam Jackson <ajax@redhat.com> Date: Tue Jul 27 17:34:36 2010 -0400 edid: Fix the HDTV sync pulse adjustment Simple typo, should have been adjusting the horizontal timings consistently since we're not trying to mangle vertical at all. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Patrick E. Kane <pekane52@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9a893fe52f1bfd415e9ffd9d2f5aff5c4da7a756 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sun Oct 3 16:56:03 2010 +0100 xfree86: Do not call dlclose(NULL) [regression after ab7f057] During unwind following an error when attempting to a load a module, we attempt to call dlclose on a potentially NULL handle. This is a side-effect of removing the abstraction layer in ab7f057. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 533faf7f43cb4b5155a74d78d6144b702e227efa Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 1 10:57:48 2010 -0700 Bump version to 1.9.99.1 (1.10 development series) Make the 1.10 development series distinguishable from the 1.9 branch. Signed-off-by: Keith Packard <keithp@keithp.com> commit a769f4c22a9cfb5ba248c924a66c31ec966bd8a0 Author: Adrian Bunk <bunk@stusta.de> Date: Thu Sep 30 13:18:20 2010 +0300 remove dolt With libtool 2.2.10 the difference in build time is so small (< 5% with -j8 builds) that it isn't worth having this hack. Signed-off-by: Adrian Bunk <bunk@stusta.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c7e4222c9a27094ce4fc2831ac92acbb7b21fb1a Author: Tobias Droste <tdroste@gmx.de> Date: Wed Sep 29 22:51:48 2010 +0200 randr: set error numbers of resource types in RRExtenstionInit() (V2) Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30367 Currently the ddx calls xf86RandR12Init() (-> RRScreenInit() -> RRInit() -> RRModeInit() -> RRCrtcInit() -> RROutputInit()) before RRExtensionInit() is called. This causes RRErrorBase being 0 while setting resource type error values (resource types: RROutput, RRMode and RRCrtc). The fix moves the setting of error values to own functions which are called in RRExtensionInit() to get the right RRErrorBase. V2: With header file Signed-off-by: Tobias Droste <tdroste@gmx.de> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 72a9c686d7ecaa68d27687b316dbba92902809b4 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Sep 29 17:05:12 2010 +0100 Cygwin/X: Fix compilation after "delete pervasively use of DISPATCH_PROC" commit cbd4d5dbb70db62ba1cb79c7b904e6fa11f62d7e removes the static declarations of ProcWindowsWMDispatch and SProcWindowsWMDispatch which precede their first use in winWindowsWMExtensionInit() Move winWindowsWMExtensionInit() to after the definition of those two functions to fix compilation. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1a9022d3289ff74043112808cc8aa315fd9c40e8 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Sep 28 13:59:19 2010 -0700 Bump video driver ABI version to 9.0 Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c45bea0c044ad37bedb42209f7e6ea8b587999f0 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Aug 3 12:51:51 2010 -0700 XQuartz: RandR: Refactor legacy mode-switching to be better integrated with RandR Adds three new functions void QuartzRandRSetFakeRootless (void); void QuartzRandRSetFakeFullscreen (void); void QuartzRandRToggleFullscreen (void); The first two are identical to requesting the fake modes from a RandR client The third responds to cmd-alt-a to leave fullscreen or RandR. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 229323a19b06f80d9b03f487e598b933b9b31d87 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Jul 26 23:34:49 2010 -0700 XQuartz: RandR: Don't change the rootless preference when changing RandR mode Also renames a bunch of other variables for better consistency. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 721edc69c3597578d3e7f711769ff0195af6068a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Jul 26 11:45:59 2010 -0700 XQuartz: RandR: Better handle switching betwen RandR modes that share CG modes Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 026a47e21226b64eb9a7624ada3d74c3fe5fa763 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Jul 26 01:17:12 2010 -0700 XQuartz: RandR: Respond better to resolution changes made outside X Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 59cd93f48a3a0a34781d4a94a3cd05a575e2d4ba Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Jul 25 22:25:49 2010 -0700 XQuartz: RandR: Use deprecated CG APIs only on Leopard and earlier Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 629c3f473b7415069a87ef4717ec3d701978dc48 Author: Jan Hauffa <hauffa@in.tum.de> Date: Fri Jul 16 17:56:44 2010 +0200 XQuartz: RandR: Remove FAKE_RANDR code. Signed-off-by: Jan Hauffa <hauffa@in.tum.de> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 97b5f5306437bfd13390485fc7a58a363c261ec9 Author: Jan Hauffa <hauffa@in.tum.de> Date: Fri Jul 16 17:54:55 2010 +0200 XQuartz: RandR: Toggle rootless mode on XRandR mode switch. Report a fake screen mode that corresponds to the screen mode at startup of the server excluding the height of the menu bar. If a client requests this mode, rootless mode is enabled. In all other modes, the root window is shown. Signed-off-by: Jan Hauffa <hauffa@in.tum.de> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 2d411472c2915614bdeb8fdc15d19dae4621444d Author: Jan Hauffa <hauffa@in.tum.de> Date: Fri Jul 16 17:18:03 2010 +0200 XQuartz: RandR: Implement basic RandR functionality. Querying and changing of resolution and refresh rate is supported, rotation is not implemented yet. Signed-off-by: Jan Hauffa <hauffa@in.tum.de> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit f4926709485c0605f0b1171c84c803b68eebfc38 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Sep 28 09:48:41 2010 -0700 XQuartz: Move use of static dispatch procs after declaration This fixes fallout from cbd4d5dbb70db62ba1cb79c7b904e6fa11f62d7e Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c36ca7b1862ecd86df089f4e1933379a113928ea Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat Sep 25 10:05:10 2010 -0400 config: remove --with-dri-driver-path option, use dri.pc #29740 The trusted location of the dri driver directory can be obtained from the mesa dri.pc pkg-config file. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Acked-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5532687a929426c4b1c4667f4591ed362f097c9b Merge: 9df4fb0 682a3ee Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 28 08:15:07 2010 -0700 Merge remote branch 'ajax/less-loader' commit 9df4fb0adf66fb82f0c007897d79af0f54a6dad9 Author: Adam Jackson <ajax@redhat.com> Date: Mon Sep 27 17:06:46 2010 -0400 xfree86: Add 18bpp support Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5c6a2f93ebc16a78093782b442306de23ae94e78 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Sep 27 19:39:23 2010 +0100 xfree86: Kill pixmapPrivate with a vengeance (v2) ScrnInfo->pixmapPrivate only existed in order to catch invalid access to the framebuffer by making the backing data NULL across the VT switch. This was causing more confusion in the higher layers during mode setting without any real benefit, so remove it. v2: Kill ShadowModifyPixmapHeader() as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Julien Cristau <jcristau@debian.org> Cc: Andrew Guertin <lists@dolphinling.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fdabcec57ae0fdc9910060609bb0848552c1db4d Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Sep 27 17:30:13 2010 +0100 modes: Beware the driver switching root pixmaps Program received signal SIGSEGV, Segmentation fault. 0x080d4a2d in xf86RandR12ScreenSetSize (pScreen=0x8dca3a0, width=800, height=600, mmWidth=210, mmHeight=157) at ../../../../hw/xfree86/modes/xf86RandR12.c:731 731 ../../../../hw/xfree86/modes/xf86RandR12.c: No such file or directory. in ../../../../hw/xfree86/modes/xf86RandR12.c (gdb) bt full height=600, mmWidth=210, mmHeight=157) at ../../../../hw/xfree86/modes/xf86RandR12.c:731 randrp = 0x8dcae68 pScrn = 0x8dbeb28 config = <value optimized out> pRoot = 0x8e08e30 pScrnPix = 0xb6d12008 ret = 1 c = <value optimized out> mmWidth=210, mmHeight=157) at ../../randr/rrscreen.c:185 No locals. at ../../randr/rrscreen.c:307 pWin = 0x8e08e30 pScreen = 0x8dca3a0 i = <value optimized out> rc = 0 ../../randr/randr.c:485 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Julien Cristau <jcristau@debian.org> Tested-by: Julien Cristau <jcristau@debian.org> Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2f0abd7d690c3bcce2a80c093a0880f43e56d8cb Author: Kristian Høgsberg <krh@bitplanet.net> Date: Thu Sep 23 09:04:11 2010 -0400 glx: Fix use after free in DrawableGone (note that nearly identical patches were proposed by Kristian and Chris) Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reported-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Keith Packard <keithp@keithp.com> commit e416965bfd08dfae5d2b7932b5118efac20546ad Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun Jul 18 18:56:02 2010 +0300 dix: remove proc tables initialization Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit cbd4d5dbb70db62ba1cb79c7b904e6fa11f62d7e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jul 16 20:19:50 2010 +0300 xserver: delete pervasively use of DISPATCH_PROC Some functions had to be moved around due some missing static definitions. Another minor clean up like inexistent function declarations and etc were made also. Part of this patch was cooked using: sed -i -e '/static DISPATCH_PROC*.*;/d' `git ls-files` Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 58bd317e29f4abf7f950891339d2a6a78ddf7903 Author: Macpaul Lin <macpaul@andestech.com> Date: Tue Sep 21 15:13:34 2010 +0800 xfree86: nds32: add nds32 support for compiler related mmio codes Add nds32 support for compiler related mmio codes. It includes byte-swap or non-swap operations. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 28e6de66b42062a885ba38416387f2dbc15707fd Author: Macpaul Lin <macpaul@andestech.com> Date: Tue Sep 21 15:13:33 2010 +0800 xfree86: nds32: add nds32 support for compiler specific codes Add nds32 definitions and related assembly codes to compiler header files. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2b24b2bd859a4b4b8ccaf3b7d1b529dcda2d3b94 Author: Macpaul Lin <macpaul@andestech.com> Date: Tue Sep 21 15:13:32 2010 +0800 xfree86: nds32: add nds32 definition for vgaHW support. Add __nds32__ definitions for vgaHW support. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 22376aa7aa44464636b12ee1d61b94e52ca02b0f Author: Macpaul Lin <macpaul@andestech.com> Date: Tue Sep 21 15:13:31 2010 +0800 xfree86: nds32: add nds32 definition for support linux video related io. Add __nds32__ definitions for supporing correct io method for lnx_video.c Signed-off-by: Macpaul Lin <macpaul@andestech.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d52799f67f590b0f91b521cd2bdf5a5a8a229c96 Author: Macpaul Lin <macpaul@andestech.com> Date: Tue Sep 21 15:13:30 2010 +0800 xfree86: nds32: add nds32 related definitions into include headers. Add MSB/LSB related definitions into include/servermd.h Signed-off-by: Macpaul Lin <macpaul@andestech.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 98197d931b266674557b52b4a7099c6470114e55 Merge: 01ad372 402942c Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 23 15:30:37 2010 -0700 Merge remote branch 'jamey/for-keith' commit 682a3ee60867da027fe1bcda0c8587dd3db9d58e Author: Adam Jackson <ajax@redhat.com> Date: Sat Sep 18 07:27:13 2010 -0400 xfree86: Remove useless module setup functions where appropriate Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 6130170e7e9b64c611ee942ec3455dd1a185193d Author: Adam Jackson <ajax@redhat.com> Date: Sat Sep 18 06:41:35 2010 -0400 xfree86: Remove unused refcounting from input drivers Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit ab7f057ce9df4e905b12cebc1e587b9a7f200418 Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 17 11:19:17 2010 -0400 loader: Remove a silly layer of reference counting libdl will refcount objects for us just fine, thanks. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 0438002cd238011f33dbf176c555de5e380ba77e Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 17 09:13:04 2010 -0400 loader: include cleanup Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 2f003fe49697f8343c052dff2b3752eace814ea7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 17 09:02:13 2010 -0400 loader: Remove the handle field from LoaderOpen This was always 0 from all the callers. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 09929da50503b559459f5b722c11647c47857fdb Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 17 08:16:51 2010 -0400 loader: Remove unused canonical name field Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 3a26e7f459764d4aee71b2d7e25b113b729b94ac Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 17 07:55:48 2010 -0400 loader: Remove unused module serial number Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 2a24a013bf3f554bb03c0f5af155d23dbb27b599 Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 17 07:32:17 2010 -0400 loader: Merge dlloader directly into the loader This lets us drop some double-tracking of loaded modules too. If your OS is too lame to have libdl, fix that first. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 693e92d4049ee76d074737480f3fc1bb236f4278 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 10 09:54:33 2010 +1000 xfree86: add xf86OptionListDuplicate() Does what it says on the box. Some drivers need to duplicate option lists from the original device to ensure that devices created by the driver (driver-internal hotplugging) have the same list of options as the original device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 402942cdbc518395a2943fd226b9f3071f24d39f Author: Jamey Sharp <jamey@minilop.net> Date: Fri Sep 17 02:11:44 2010 +0200 Introduce per-object per-screen privates. This replaces dixCreatePrivateKey and the only uses, which were in midispcur. Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Keith Packard <keithp@keithp.com> commit e4d4d6ddd52801cf0b0b253d9ba3bdabfa9a9d8d Author: Jamey Sharp <jamey@minilop.net> Date: Fri Sep 17 02:18:10 2010 +0200 Xserver need not be compatible with old versions of xserver. Delete time-traveling multiple personality disorder from the server. Gaetan notes: There were a couple of drivers containing an unknown version of the modes/parser code. This was done in server 1.2 time frame because it was released without mode code. It was barely or not maintained afterwards. There are currently no video drivers with a copy of the modes code. Most of these ifdefs were introduced in commit a8d760f567b19268329c4682495caa591f08a854, where Aaron wrote, This change uses XORG_VERSION_CURRENT < 7.0 to mean "server newer than 1.2" since XORG_VERSION current went backwards at some point. Alan explains that: In Xorg 1.3, when we first released an Xorg server release decoupled from the katamari release schedule. (1.0 through 1.2 were released as part of X11R7.0 through 7.2, while 1.3 came out between X11R7.2 & 7.3.) Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 01ad3725a8d0a8958720b81d19598a08c072ccee Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jun 1 20:37:54 2010 +0300 xfree86: delete useless "Primary device is not PCI" message The primary device being PCI or not has no effect on the server working. This message is superfluous. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 7360235ecca25af29bb2d99a8e46d5b259ad1b1e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon May 31 18:20:57 2010 +0300 xfree86: bus: assign PCI_SOURCES with the actual source files Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 18b2d2e8bd056266410226d779752e7933847b6b Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon May 31 18:09:50 2010 +0300 xfree86: bus: move macros from common PCI header to private file Only int10/helper_exec.c is using them. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 17a23f9ba8fa95f3e15afba7de22a12fe60bacfb Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Sep 10 19:18:42 2010 +0300 xfree86: dri: remove unused PCI macro Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit fc3ab84de7b5692f0db2b282ab0ed8e5a61d1fce Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Sep 10 19:16:30 2010 +0300 xfree86: configure: move buses references to their own location This patch makes xf86Configure.c free of PCI and SBUS code, moving to a more meaningful location. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> commit 49b817501f97d55480063c0b62544b3af75b4b7c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jun 1 16:16:53 2010 +0300 xfree86: bus: remove xfree86 and few other references from OS files Conceptually, os-support should have only a basic set of OS helpers which wouldn't mix with any DDX common structure (e.g. windowing structures, etc) This patch removes some xfree86-only and a few other unused references from os-support/bus. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit d9c682a5e250677883c4d375ca84cf184ee19d77 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 30 21:35:23 2010 +0300 xfree86: bus: remove useless automake variable Leftover that was missed in f7abe05b. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit a7efeda8a56a540542e056a426e89cfc053a4162 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 30 19:12:31 2010 +0300 xfree86: use xf86PciIsolateDevice to get PCI config information Make xf86IsolateDevice private on PCI common file. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit c768cdda92696b636c10bb2df64167d5274b4b99 Merge: 5a72538 2079853 Author: Keith Packard <keithp@keithp.com> Date: Mon Sep 13 16:48:33 2010 -0700 Merge remote branch 'jamey/reviewed' commit 20798536326f94ac9c97b4ec7a51329f7c912991 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Jul 14 13:14:28 2010 -0700 rootless: Delete dead remnants of rootless acceleration. Jeremy deleted rootlessAccelInit's implementation in 2008 in commit 587c010a1cd733fded4d49dc339df0634bda8be6. Delete its prototype and the remaining commented-out call to it. It still makes sense for the rootless GC ops to relax the planemask, but that's independent of the size of the operation, so quit checking the thresholds there. FillBytes and CompositePixels are not called anywhere, so delete everything related to both. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Jeremy Huddleston <jeremyhu@apple.com> Cc: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 58d1ec0fe84412c66f1ea1de15e3901c0b120164 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Jul 14 11:30:17 2010 -0700 rootless: ROOTLESS_GLOBAL_COORDS is always set, so unifdef it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Jeremy Huddleston <jeremyhu@apple.com> Cc: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 35ce892a705f9377a36f19414e5a25dcbe44a354 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Jul 14 11:19:41 2010 -0700 rootless: ROOTLESS_TRACK_DAMAGE is never set, so unifdef it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Jeremy Huddleston <jeremyhu@apple.com> Cc: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit ccdf15689050a0f988721c91fab75861ec4d339c Author: Jamey Sharp <jamey@minilop.net> Date: Mon May 31 16:01:18 2010 -0700 miPolyGlyphBlt: Delete redundant ValidateGC. The caller is required to have validated the GC for the drawable before calling any ops, including PolyGlyphBlt. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 3fd963de27f3c4452c320e617ad33b91b0967737 Author: Jamey Sharp <jamey@minilop.net> Date: Wed May 19 14:16:20 2010 -0700 Un-export CreateScratchGC now that nothing external uses it. The server and drivers sometimes use GetScratchGC, but never CreateScratchGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 0f48e362c5baee2bc281a4b88cfb68de24172d15 Author: Jamey Sharp <jamey@minilop.net> Date: Wed May 19 14:03:19 2010 -0700 glxdriswrast: Use CreateGC, not CreateScratchGC. Since this code was using CreateScratchGC and not GetScratchGC, FreeScratchGC would always call FreeGC, so just call it directly. As long as the drawable provided to CreateGC has the same screen and depth as were passed to CreateScratchGC, these functions are basically identical. There are two differences: - CreateGC gives you a non-null stipple. You probably don't care. - CreateGC passes the gcid and client to XACE. There are several internal GCs allocated in the server, and they all pass 0 and serverClient. I expect XACE will never reject that combination. The callers of createDrawable all verify that pDraw has the same screen that driScreen does. In short, this should have no behavioral change. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit af2a94e12fe4e426dfca461a0d14526193c01cef Author: Jamey Sharp <jamey@minilop.net> Date: Tue Jul 13 13:33:59 2010 -0700 VGA arbiter: No need for arbitration around CreateGC. None of XAA, EXA, or UXA do any hardware access during CreateGC, so they don't need VGA arbitration. I haven't found any open source drivers that hook CreateGC, so they're safe. I'd be surprised if any driver directly hooks CreateGC and does hardware access from it and needs VGA arbitration. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 7a63b2db636f01694cb54726bbb04287718e286a Author: Jamey Sharp <jamey@minilop.net> Date: Sun Jul 11 20:36:34 2010 -0700 Delete Colormap->devPriv. It isn't used any more. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 2e8069dd36c2f5caf868937405fc03328004a85d Author: Jamey Sharp <jamey@minilop.net> Date: Sun Jul 11 20:35:43 2010 -0700 xnest: Replace use of Colormap->devPriv with standard devPrivates. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 34d6492436c0f4a81822769b24d8c7816d0226ad Author: Jamey Sharp <jamey@minilop.net> Date: Sat Jul 10 06:55:58 2010 -0700 xquartz: Delete compile-time-constant DRIGCRec.driOps field. The driOps field of this structure is never set to anything but &driGCOps, and this structure is not visible outside this source file. Just use the constant in the one place the field was used. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 2051e0f371de892b2e598b30c18dae96b58d68de Author: Jamey Sharp <jamey@minilop.net> Date: Thu Jul 8 02:38:13 2010 -0700 dixfonts: Deobfuscate GC ops calls. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit bbbf795e6b1ac048ea17164ba1089055cfe4306d Author: Jamey Sharp <jamey@minilop.net> Date: Sun May 23 17:15:43 2010 -0700 Delete redundant GC initializations. When a GC is allocated, it is zeroed, including all storage requested with dixRegisterPrivateKey. So CreateGC hooks don't need to initialize anything to zero. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 3288232f3d2a0239944bd856101c2d16c713ef40 Author: Jamey Sharp <jamey@minilop.net> Date: Sun Jun 13 18:10:38 2010 -0700 Delete xaaWrapper. This was part of "An experimental pseudocolor emulation layer. Not fully completed, currently only works for 16bpp." Only neomagic tried to use it, and that was neutered by the removal of the fbpseudocolor portion of that emulation layer; the rest is easily removed. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit f856dcdc3a7b635dd94d3dac387ddec952e4880b Author: Jamey Sharp <jamey@minilop.net> Date: Sat Jun 12 08:42:31 2010 -0700 Delete unused lastWinOrg field from GCs. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit b2184024361717358e35a56b084c4a71cbc29234 Author: Jamey Sharp <jamey@minilop.net> Date: Sat Jun 12 16:20:00 2010 -0700 Delete unused devPrivate field from GCFuncs and GCOps. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 139aa6e74227f0fe52cd8dccf1d563664103aaba Author: Jamey Sharp <jamey@minilop.net> Date: Sun Jun 13 18:57:08 2010 -0700 damage: Delete NOTUSED block--it was never not NOTUSED. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 5ff9e58bef668c1279c5e253795711a1e118aaa1 Author: Jamey Sharp <jamey@minilop.net> Date: Sat Jun 12 08:51:04 2010 -0700 fb: Delete unused oneRect private field. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit e99bbfa0a24ec038b88e81881133a676bf63580e Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 13:50:11 2010 -0700 dmx: Delete '#undef Xmalloc' and friends. Nothing in dmx uses these names any more, and it builds cleanly without trying to undef them. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit b5217bfdca67ef2c5323838afcfcd89eba8899d5 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 13:28:32 2010 -0700 dmx: __glXMalloc -> malloc, etc. Kristian made equivalent edits to the reference GLX implementation in 2006, with commit 2d2d38d17cc2558f8a41166a4a1578bc4c663c37. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit a715de7f11afeda7798f0882148a94d4db2291e6 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 13:10:05 2010 -0700 dmx: Delete unused GLX visual matching code. Kristian deleted this API from the rest of the server in 2007, in commit 7d74690536b64f7b8e8036507ab7790807349c50. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit 5a725385fbb93553931ca0217e79271ab2a2c613 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Sep 13 12:33:53 2010 +0300 xfree86: vgaarb: fix decoding stub API This fix a problem introduced in commit 65466652. It closes also: https://bugs.freedesktop.org/show_bug.cgi?id=30160 Reported-by: <xunx.fang@intel.com> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0a3e6b0345a96aae278dd776c00b5a7c7ccf65af Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Sep 11 14:25:21 2010 -0700 XQuartz: Localization updates Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4e09a69c5b1f3c8d6f2f92ec24aaab3a1119940c Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Aug 15 20:07:28 2010 -0700 rootless: Remove ROOTLESS_WORKAROUND This was already removed for XWin (20701522be803fe47e921fcf059dadf64c7f287d) with no reported side effects. XQuartz seems to be behaving ok without it as well. While this possibly brings back bug #1168, we don't have any reproduction steps for that issue, and if it crops up again, we should fix it a real way rather than this hokey workaround which doesn't even work for COMPOSITE. This effectively reverts the following two changes: b2135e589baeb2ea26da50b9167feaea23bcce3c d7fef52254126aa5897a5c58faeda1f61d5b13d8 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 63b7d9448abbded1cb91e82a13319d5e4313ca0c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 30 18:44:06 2010 +0300 xfree86: fbdevhw: remove unnecessary debug code It very likely no one will want to print all functions of this file for debugging purposes. If this is the case, then a mix of ctags + cpp + gdb can do the same job. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 66105d8281f8a6442cf7fee5d10e8b8a34bef952 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 30 18:16:32 2010 +0300 xfree86: fbdevhw: remove unused cmap fields from main structure It was never used since first git revision and probably no one cares for it. ABI break. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 317e491e067e31ea7cf8cb7301e47de0c10f119e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Jul 19 15:44:39 2010 +0300 xext: remove unused header Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 5098801b3a570d0bb3386d7d210f21a1cbf3bf12 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sat Jun 12 16:57:50 2010 +0300 mi: delete unused code pBSReg is always NULL, so the statement after the conditional will never be reached. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 7d8cabd027cfc55e9921307e5b3dd7052de8496f Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Aug 4 16:12:59 2010 +0300 os: simplify smart scheduler init process Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d9c18c3b9badf38d499e3f53291bd23fda3c4340 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Aug 4 15:54:48 2010 +0300 os: remove useless smart scheduler macros Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit a9e6080dc94633a4f497535f619a14fd8b566645 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Sep 10 15:01:29 2010 +0300 os/xfree86: remove macro checking for POSIX symbols We assume already that our X implementation is POSIX compliant anyway. So remove those redundant checking. SA_SIGINFO is left there. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 648c8871c92727d7b6b16859f27f12266a06a16e Author: Adam Jackson <ajax@redhat.com> Date: Wed Sep 8 16:08:24 2010 -0400 composite: Convert compWindowUpdate to use TraverseTree v2: Use != RedirectDrawNone, since we aren't called for manual windows. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit bbffb85461eb63bfb1e01e2cb9674607b9221604 Merge: 9a1a4cc 71972c2 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 10 11:55:34 2010 -0700 Merge remote branch 'whot/for-keith' commit 9a1a4ccbe026f34beca5db3b2243874906961b49 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 30 16:37:05 2010 -0400 Add screens to the PRIVATE_XSELINUX set. The SELinux extension does store a security label in the screen devPrivates. Fixes crash caused by overwriting another private. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reported-by: Justin Mattock <justinmattock@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5b680f2c23fb3d35c721647d0334f63297589371 Author: Vignatti Tiago (Nokia-MS/Helsinki) <tiago.vignatti@nokia.com> Date: Mon Aug 30 21:24:30 2010 +0300 os: add -sigstop option for Upstart (or equivalent) startup This is very similar to the RunFromSmartParent (implicit) option, except we do not send the signal to our parent process, but our own process instead, and that signal is SIGSTOP, not SIGUSR1. Upstart or a similar equivalent program will detect this, realize that we are ready to accept clients now, send us SIGCONT and move our job status from SPAWNED to RUNNING. Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ca0d578d29f37b61e62556fff59732741885625b Merge: cf88363 08adf41 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 10 11:50:27 2010 -0700 Merge remote branch 'mattst88/master' commit cf88363db0ebb42df7cc286b85d30d7898aea840 Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Aug 27 10:20:29 2010 -0700 os: Return BadLength instead of disconnecting BigReq clients (#4565) If a client sends a big request that's too big (i.e. bigger than maxBigRequestSize << 2 bytes), the server just disconnects it. This makes the client receive SIGPIPE the next time it tries to send something. The X Test Suite sends requests that are too big when the test specifies the TOO_LONG test type. When the client receives SIGPIPE, XTS marks it as UNRESOLVED, which counts as a failure. Instead, remember how long the request is supposed to be and then return that size. Dispatch() checks the length and sends BadLength to the client. Then, whenever oci->ignoreBytes is nonzero, ignore the data read instead of trying to process it as a request. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fa22f97af65efc2a147e9be0b7f288848965ff60 Merge: 6edbdb7 6546665 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 10 11:47:41 2010 -0700 Merge remote branch 'vignatti/vgaarb-fixes' commit 6edbdb7f9e02ecb069c6fe6c0600fc389553ec5d Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Aug 23 11:37:46 2010 -0700 Tag sdksyms.c entries with source file and line number Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9ef6241c2382bfc555284a4985f6d1e37d750d6f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 23 16:04:03 2010 -0400 Fix property and selection devPrivate allocation. Selection objects were not being allocated with privates, and both objects had a stray statement that zeroed out the devPrivates field. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reported-by: Justin Mattock <justinmattock@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9dca441670d261a9a9fb6108960ed48f3d58fb7f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 6 11:32:38 2010 +1000 xfree86: add a hook to replace the new console handler. This hook is only necessary for the keyboard driver to remove the race condition between drain_console() and the driver's ReadInput (Bug 29969). The idea is that a driver that needs to handle events from the console calls xf86ReplaceConsoleHandler() with it's own ReadInput (or NULL) and thus removes the drain_console call. It's the driver's responsibility to restore the previous behaviour when the driver is unloaded. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> CC: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit da31ca747f8e3993b2aca5d31b7d09b9907ad1d9 Author: Thomas Hellstrom <thellstrom@vmware.com> Date: Thu Sep 2 10:53:28 2010 +0200 linux: Don't lose console events on non-evdev drivers (#29969) The drain_console() function will race with new keyboard events being added by the hardware causing the server to lose keyboard events if the console fd is used for input. Only use the drain_console() when AllowEmptyInput is off which is the best indicator we have for whether the keyboard driver will be used. This patch will only fix the bug when hotplugging is disabled. What we really need is a way to figure out either whether we're _not_ using the keyboard driver (not predictable) or a way for the keyboard driver to disable drain_console(). X.Org Bug 29969 <http://bugs.freedesktop.org/show_bug.cgi?id=29969> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 71972c2534d490284d3d42b456c2f34b964b2894) commit 52df92a563980a7af0fb61248da3654bd90e8232 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 15:08:01 2010 +1000 xfree86: move XI_VERIFY_VALUATORS to the source file it's used in. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 824e970c5cc94fc7d5fe5f78a24d0d3057d87a84 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 15:03:39 2010 +1000 xfree86: remove TS_Raw and TS_Scaled defines. There are no references to it other than the commit that added them. But since we're re-doing the API anyway, now is a good time to break things. commit 9398d62f27ee1b287e4458fd8b011c10f7b59efd Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 21 00:18:24 2007 +0200 XFree86 input: Add backwards compatibility for motion history Add the old motion history API back, as a shim around the new mi API. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit ac3f88e604212fc3668d623798d50aa218c13995 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 15:01:26 2010 +1000 xfree86: remove {Dont}SendCoreEvents defines The input drivers that use it only do so with ABI 0 and we're long past this one now. Input driver don't have a say in whether they send core events now anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 3f264149ff226d7c0bfcfcfc2c8845fa6326d0bd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 14:52:30 2010 +1000 xfree86: don't export xf86InputDevs. Use xf86FirstLocalDevice() instead (but don't get me started on the naming of that one...) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit 8f0531bddac8e774aa25b51155445309219da0f6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 14:46:59 2010 +1000 xfree86: remove XI_PRIVATE macro, unused. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit c08f7afdbcf16d2ba30b67e27162c5aaa1ed3f61 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 14:45:03 2010 +1000 xfree86: update comment for xf86DeleteInput We have a driver hook - it's UnInit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit b8d9c5ff0003f15720737949e65e3159c4f4576e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 14:30:11 2010 +1000 xfree86: remove IDevRec, replace with InputInfoRec. This struct is superfluous, maintaining the same info as the InputInfoRec (with the exception of the driver name). This is a rather large commit with the majority of changes being a rename from the fields of the IDevRec (idev, commonOptions) to the InputInfoRec (pInfo, options). The actual changes affect the initialization process of the input device: In NewInputDeviceRequest, the InputInfoRec is now always allocated and just added to the internal list in xf86NewInputDevice() if the init process succeeded. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit c5da32a6105b3cf57b5996971149c39103cd64b3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 14:26:20 2010 +1000 xfree86: plug minor memory leak. When no identifier for the device was specified, the allocated IDevRec (and its associated fields) need to be freed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit 34ade08174bfd652cc79bf26d2ad6a10ca73d2c4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 14:04:50 2010 +1000 xfree86: Remove extraOptions parameter from xf86CollectInputOptions. And unexport it, drivers don't need to call this in the new init process. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 2199842ed50b3eb40d54146827fc58cae7e873ec Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 10:52:54 2010 +1000 xfree86: remove extraOptions field from IDevRec. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 5ab8ca0807f9d2f8c8de2f9a1421e59e2a8e976c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 10:41:27 2010 +1000 xfree86: remove some ifdef 0 code. InputInfoRec hasn't had a free function pointer since the git import. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit b0da1bc509446a714eb2b29cbd35d43b1e5187ed Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 10:39:24 2010 +1000 xfree86: move a declaration down to the block it is used in. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit cd7059db4a766bc9d03d7968aebeba8542e6c6c0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 10:36:47 2010 +1000 xfree86: minor comment fix. HAL → config backend Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit f3861522fe7d148fd4b0802f2f9ea5d98ab2db93 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 2 11:47:30 2010 +1000 xfree86: skip a few NULL initialization, calloc does it for us. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit 12170978617c6862fb6aa286b18aaacd0a4e2737 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 1 15:44:44 2010 +1000 xfree86: remove conversion procs and close proc from InputInfoRec. None of them are called by the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> commit 71972c2534d490284d3d42b456c2f34b964b2894 Author: Thomas Hellstrom <thellstrom@vmware.com> Date: Thu Sep 2 10:53:28 2010 +0200 linux: Don't lose console events on non-evdev drivers (#29969) The drain_console() function will race with new keyboard events being added by the hardware causing the server to lose keyboard events if the console fd is used for input. Only use the drain_console() when AllowEmptyInput is off which is the best indicator we have for whether the keyboard driver will be used. This patch will only fix the bug when hotplugging is disabled. What we really need is a way to figure out either whether we're _not_ using the keyboard driver (not predictable) or a way for the keyboard driver to disable drain_console(). X.Org Bug 29969 <http://bugs.freedesktop.org/show_bug.cgi?id=29969> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e00e2e7b68fbc932269d607ac5dc2c441d07ad9d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 23 08:35:01 2010 +1000 xfree86: Check for existence of button class before dereferencing it. The Irxon Super Mini Bluetooth Wireless Keyboard for PC/PDA/Cell Phones keyboards have axes but not buttons. The evdev driver doesn't set up a button class for these keyboards and a motion event handled by DGAProcessPointerEvent dereferences the dev->button NULL pointer, causing a server crash. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 9802cca816884e7f055f054ac1ba9194e0eba10b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 1 15:42:44 2010 +1000 Remove atom field from InputInfoRec. This field was only used in one location where we can use a local variable. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 79ea9ef39971d008d199b18f34d1aef2bab6e33f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 10 15:19:20 2010 +1000 input: constify valuators passed in by input drivers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 86560b5d05f14bdf04d21b3457a66c0d5045db9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 24 13:46:35 2010 +1000 dix: don't set time to CurrentTime in DeviceChangedEvents. CurrentTime is used by clients to skip setting the time, but not by the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit ff055506f0cbb852bed17acb9f9bbf1d715a854e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 23 13:20:09 2010 +1000 dix: fix crash when removing devices on a buttonless MD pointer (#29669) If the master does not have a button class, recalculating the number of buttons required for this master dereferences a NULL pointer. Guard against this, if the master pointer doesn't have a button class, it doesn't need to update it's number of buttons. Reproducible: Two devices on the same master, device NB with axes but no buttons, device A+B with axes and button . If NB was the last one to send an event through the master when A+B is removed from the server, master->button is NULL and leads to the above NULL-pointer dereference. X.Org Bug 29669 <http://bugs.freedesktop.org/show_bug.cgi?id=29669> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit be978c7fc97e98ef1bc7b20c6c0740d8a81b609a Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Tue Aug 3 18:21:28 2010 -0700 xfree86: Purge kbdCustomKeycodes from xf86Info. This was obsolete after 3eeb62e8f587732e6b433c2b9c6879eb26a3f1b4 "bug #890: completely remove deprecated keyboard driver". Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6922b31a136b2b0ac185d61785969a11f84c7943 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 1 14:35:40 2010 +1000 xfree86: remove history_size For a couple of ABIs now the history size was essentially static anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 892e39025b45109ba38c0b5d0b5f4535e092f58c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 1 14:33:52 2010 +1000 xfree86: remove always_core_feedback from InputInfoRec. Unused Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5e2912bd1d2bc8ff1508e5f726e77aa5f8677cbd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 1 14:33:26 2010 +1000 xfree86: remove first/last from InputInfoRec. Unused. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 974bc2322b3667db38d28063786fbc76fb303d00 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 1 14:32:51 2010 +1000 xfree86: remove private_flags from InputInfoRec. Unused field. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 23b361b25b7b48a820a4ef851fb89706f7ec2cd0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 1 14:14:20 2010 +1000 xfree86: Purge old_x/old_y from InputInfoRec. Unused field. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4ac3be29bc1af19f15e84ee0ea609de5c54ca0e0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 30 14:26:06 2010 +1000 input: Purge AddOtherInputDevices DDX hook. This hook wasn't used by any DDX. Device addition and removal is handled by the config backend, so we don't need to do anything special that during the ListInputDevices request processing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit cb672a461cc6cd668ab7e61994b94e9ff46b3ef1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 30 14:21:14 2010 +1000 input: remove OpenInputDevice and CloseInputDevice DDX hooks. In theory, these hooks were to be used for DDX-specific device enablement. None of the DDXs however did anything here. Now we call DEVICE_INIT on all devices when they are added, so the xfree86 DDX as the only one with real code didn't do anything here. kdrive checked for device validity but that's already handled in ProcXOpenDevice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a46d2bb344e822bbd9d69cb59829b85f9d8f0213 Author: Simon Thum <simon.thum@gmx.de> Date: Sun Jul 18 12:31:26 2010 +0200 xfree86: Fix xf86 backend-specific input initialization Instead of shoving it in rather unrelated places, move acceleration init into xf86NewInputDevice. Caveat: It's not clear atm how relevant other callers of ActivateDevice (like OpenDevice) actually are. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit e930710ae5579752785d6b96ace4b44bf0199a6e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 30 13:59:29 2010 +1000 xfree86: purge superfluous includes from xf86Xinput.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 2b7840b63da6bc00aa40e8a427d9fd719ba5e6d0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 30 13:44:20 2010 +1000 xfree86: remove unused DeviceAssocRec struct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit cdb5863c9f68548afa0c69e08c697c83f9a5e671 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 23 14:16:38 2010 +1000 xfree86: remove LocalDeviceRec/Ptr definition. Two names pointing to the same struct for over 7 years now. Remove the define, if drivers don't want to change they can always do the typedef themselves. Rename all "LocalDevicePtr local" to "InputInfoPtr pInfo". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 8764782f6de56a9dc5e9d5a8e9fb616a8ddb2f7c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 7 11:17:10 2010 +1000 xfree86: add xf86IDrvMsg and friends for input driver logging. Input driver messages are only standardised by convention, with the drivers prefixing the device name to most messages. This makes it rather hard to grep on "evdev" for example when looking for the evdev ouput. This patch adds three new logging functions, modeled after xf86DrvMsg(), the logging function for output drivers. New functions are xf86IDrvMsg() - input driver log message in default verbosity. xf86IDrvMsgVerb() - input driver log message in specified verbosity. xf86VIDrvMsgVerb() - same as xf86IDrvMsgVerb() but takes a varargs argument. Default log format is <driver name>: <device name>: <message>. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit b55ac354afa0f16f71bb4f2d3d4277c887082520 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 12:00:07 2010 +1000 xfree86: move xf86AllocateInput and xf86DeleteInput to xf86Xinput.c Make xf86AllocateInput static in the process, this function is only called from one location. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit d2a5f4166417b9d4a02a219b28470e41b6cfe012 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 10:30:56 2010 +1000 xfree86: return the device from xf86ActivateDevice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit fbf35e27f3005cf009f2dd1e112260bb294342c7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 10:28:14 2010 +1000 input: set XKB extension for all new devices, not just xfree86 ones. Right now, Xephyr and others don't get to use XKB on the slave devices. Which works given that no-one cares about SDs just yet but event processing is different if the ProcessInputProc isn't wrapped properly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 11ed32b62c8793ecc1c68e1e4ba91e2eb45eef3e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 10:24:02 2010 +1000 xfree86: purge SendDragEvents support. From the documentation: "This is mainly to allow a touch screen to be used with netscape and other browsers which do strange things if the mouse moves between button down and button up." CLOSED - NOTOURBUG Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 7defd282beb57e8880980416ed579f62d561d1ac Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 10:16:15 2010 +1000 xfree86: remove XI86_CONFIGURED flag. PreInit returns a status code. Let's use that instead of having it report Success in some cases but not set the XI86_CONFIGURED flag and thus signal an init failure. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 97a4acdac23b8ff33da43917c10b65d2fee5c07f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 10:04:53 2010 +1000 xfree86: purge some unused defines. These defines have been write-only for a while now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 0fb7a5c261aa0d87d6596d72b70696bffe0c0aff Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 09:53:35 2010 +1000 input: Purge Register*Device() functions. RegisterPointerDevice() and RegisterKeyboardDevice() were already mapped to RegisterOtherDevice() and obsolete. RegisterOtherDevice() was called for all devices and the two assignments can simply be moved into AddInputDevice(). Purge RegisterOtherDevice() and pretend it never happened. *lalalalala* Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 67ffbcc14cbc61474520d4531599edca24965543 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 09:24:08 2010 +1000 xfree86: remove superflous assignments. ActivateGrab and DeactivateGrab are set in AddInputDevice() already. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 4cd54d9ed9e87074734789a9a7708c2218f87f1e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 09:22:05 2010 +1000 xfree86: make xf86ActivateDevice static. No-one but the joystick driver uses it and that one should be using NIDR instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 31c71425ac13a7f554316356691a79175ea82a67 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 22 09:09:10 2010 +1000 config: expose config_info as an input option. config_info is the only reliable indicator we have in the server for duplicate devices (drivers can test for maj/min on fds as well). Don't set this after the device has been initialized but assume it's important enough to set during NIDR. This makes the option "config_info" available to the drivers as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit de0cc5a72deb7c477e368aa4fe9a713788d7ae4c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 21 16:00:26 2010 +1000 xfree86: rework driver PreInit API - XInput ABI 12 The main change introduced in this patch is the removal of the back-and-forth between DDX and the driver. The DDX now allocates the InputInfoRec and fills it with default values. The DDX processes common options (and module-specific default options, if appropriate) before passing the initialised struct to the driver. The driver may do module-specific initializations and return Success or an error code in the case of a failure. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 7925e8945649d4af237e6c3c5593b895a461bd1e Author: Chase Douglas <chase.douglas@ubuntu.com> Date: Wed Sep 1 14:45:34 2010 +1000 Fix udev population of Bluetooth input device product IDs The udev device_added function takes the vendor and model IDs of added devices and converts them into an attribute that can be matched for by an InputClass configuration using MatchUSBID. Currently, the udev mechanism works for USB devices, but fails to work properly for Bluetooth devices. The product IDs of the event node are actually the IDs of the Bluetooth receiver instead of the device. This patch reads the product ID from the PRODUCT property of the parent of the added device. This tag is set correctly for both USB and Bluetooth input devices. The following devices have been tested by specifying individual InputClass sections in xorg.conf: * Apple Keyboard (Bluetooth) * Apple Magic Trackpad (Bluetooth) * Apple Magic Mouse (Bluetooth) * Microsoft Bluetooth Notebook Mouse 5000 (Bluetooth) * Microsoft IntelliMouse Optical (USB) * N-Trig Touchscreen (USB) * Wacom Bamboo Touch (USB) Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 05e616767e5b7e60b92d31c4042ded5892dce6d4 Author: Adam Tkac <atkac@redhat.com> Date: Wed Aug 25 10:38:40 2010 +0200 Return Success from generate_modkeymap() when max_keys_per_mod is zero max_keys_per_mod equal to zero is a valid situation so generate_modkeymap should not return BadAlloc in this case. Signed-off-by: Adam Tkac <atkac@redhat.com> Reviewed-by: Patrick E. Kane <pekane52 at gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4a12aecac670debd0dafb17c245fccb93eea2d60 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Aug 25 13:48:29 2010 -0700 xfree86: Document terminate not mapped by default (bug 25083) Document that terminate is not mapped to Ctrl+Alt+Backspace by default, to help alleviate some confusion. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a90052ba8697e217b0dc68057d7b9202ae8797db Author: David Ge <davidqge@gmail.com> Date: Thu Aug 19 00:33:57 2010 -0500 xkb: Fix RedirectKey didn't send any event. Xorg.log shows error: Valuators reported for non-valuator device. This is caused by uninitialized valuators.mask in _XkbFilterRedirectKey(), which trigger the error in UpdateDeviceState(). Signed-off-by: David Ge <davidqge@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ff109bf84401a451380eb7f3f94a6e0aa2776e3e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Aug 12 00:09:02 2010 -0700 Use GetMaster instead of direct u.master access in core procs Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3cc5e4422430e9ca44615f3e63feccd2e5729046 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 23 14:48:32 2010 +1000 xfree86: fix compiler warning about implicied decl of DuplicateModule. ../../../../hw/xfree86/common/xf86Xinput.c: In function ‘xf86AllocateInput’: ../../../../hw/xfree86/common/xf86Xinput.c:722: warning: implicit declaration of function ‘DuplicateModule’ ../../../../hw/xfree86/common/xf86Xinput.c:722: warning: nested extern declaration of ‘DuplicateModule’ ../../../../hw/xfree86/common/xf86Xinput.c:722: warning: assignment makes pointer from integer without a cast Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit b5c9953bbf4ffd11f1a70d058c6d3feb2bd1bca8 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Jul 26 15:31:03 2010 +0300 xkb: Check if AddResource failed Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2e6d7174042cc8007e947b7d9fb54acc0ebe29d2 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Jul 26 15:13:34 2010 +0300 xkb: Fix possible NULL pointer dereference sli is null before allocation assigment so deference t osli has to be protected. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit d6642de7ebdda16e0056600a86a7802bd4c393b7 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Mon Jul 26 14:50:30 2010 +0300 xkb: Fix possible NULL pointer dereference If search for device failed sli is NULL. In that case we have to protect dereference to prevent server crash. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit adc0697cfcfba295a15d7a307125093cbccd637f Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jul 22 15:11:27 2010 +0300 xkb: Fix memory leak in error path map is allocated but not freed if reply length and data don't match. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 67cfb66562cd9d39f30fec6fbc38eb1eb5e5b030 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jul 22 15:05:57 2010 +0300 xkb: Remove redurant intialization code calloc already initializes allocated memory to zero. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2475ef60977f6813dec74ef0837a5915b8a48bbc Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jul 22 12:48:55 2010 +0300 xkb: Fix NULL pointer dereference xkb->names is dereferenced in else path too. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 184ef0d35612d6ed0619283d376f04d9a904f47c Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jul 22 11:34:54 2010 +0300 xkb: Don't check for NULL before calling free Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1223340644744c0b38aa85f5956eb5ab7c696517 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jul 22 11:33:33 2010 +0300 xkb: Fix memory leak if opening file fails If fopen fails pointer in buf would be overwriten with a new pointer. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 20cb9c923efa4edc348eba30f956a66413a8208f Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Thu Jul 22 11:13:10 2010 +0300 xkb: Use memcpy for copy that has known length Fixes warning that strncpy is not able to append NULL to the end of destination. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit de8be07cc0a8163b6ef04455706fd5ca2cebe587 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 17 12:08:52 2010 +1000 dix: don't create core motion events for non-x/y valuators. Devices that send motion events with valuators other than x/y get core motion events with unchanged x/y coordinates. This confuses some applications. If the DeviceEvent does not have the x/y valuators set, return BadMatch on core conversion, thus skipping the event altogether. Reported-by: Bartosz Brachaczek <b.brachaczek@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Bartosz Brachaczek <b.brachaczek@gmail.com> commit 08adf41f6315663cbac33d010214d98f3e1c8814 Author: Matt Turner <mattst88@gmail.com> Date: Fri Aug 27 18:34:49 2010 -0400 Replace malloc/strlen/strcpy with strdup. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit ea239112b030588ed3cdd113643ba5f6207a5bd9 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Aug 4 09:21:33 2010 +0000 xfree86: Purge parsePrologueVoid. This was included in the original commit, and then never used. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit b25fb9fe998209e79b6917d12d5765c5f6719a7e Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Aug 4 09:21:32 2010 +0000 xfree86: Removed unused messages from Configint.h AUTOREPEAT_MSG, MOVED_TO_FLAGS_MSG, and XLEDS_MSG made obsolete by 81913a12910e39d7ea6af8657c1c66cc6791cd65 Jul 21 2006 (remove undead files from master) UNDEFINED_DEVICE_MSG made obsolete by 6033d8150be3a115b90226eaa42f237bb0cf3369 Oct 9 2007 (first pass at video driver autoloading) Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 18b62e0479f15e965611880ada6e0195367df025 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Aug 4 09:21:31 2010 +0000 xfree86: Fix leaks in OpenConfigFile and OpenConfigDir [mattst88: fixed whitespace and a missing semicolon] Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 4f04fd595e82226f1d91226a41bb98ed3d940b37 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Aug 4 09:21:30 2010 +0000 xfree86: Simplify xf86Msg{,Verb} Previously, the functions would call xf86VDrvMsgVerb with a screen of -1 despite their comments saying they were for "non-driver messages". They now call LogVMessageVerb, which is what xf86VDrvMsgVerb does anyway when it has a screen == -1. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit f49473abfd6034e68576b2dddd30ba8d8dd0838f Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Aug 4 09:21:29 2010 +0000 xfree86: Remove prototypes for non-existant functions. This was obsolete from 9a0f25de7ca3c68af867b38936103d17daa92ac6 "Static cleanups, dead code deletion." (server 1.3). Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 747bf5fe80f51554205c5a50b8ed9b89065c8a54 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Sun Aug 1 16:01:23 2010 -0700 xfree86: Remove comments about unable to use malloc. These are leftovers from when X still used Xmalloc and friends for allocation. Now that those are gone, these comments are just confusing. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 65466652936bbb2706be455d0a416bcf08e88f66 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed May 12 13:03:14 2010 +0300 xfree86: vgaarb: fix device decoding interface to send resources type properly Right now, when there is more than one vide card on the machine, we're adopting a pessimistic approach and setting all cards to decode VGA legacy address. Some cards may want to skip the arbitration and the only way to do so is through pci_device_vgaarb_decodes. Therefore, send the desired kind of resource instead force the worst case. Note that xf86VGAarbiterDeviceDecodes is not being used so far by any open-source driver. Even so, API break. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> commit 7fbf3e7cf4b261194faad747e0bf59d528df6d91 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon May 10 21:05:14 2010 +0300 xfree86: vgaarb: remove useless macro This was inherited from RAC and was never used there either. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit ad698dd5bcc41fcec1e7ce1117c7ad1052710132 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon May 10 21:03:30 2010 +0300 xfree86: vgaarb: remove superfluous and confusing VGAGet_GC and VGAPut_GC Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit c0aed4c99bf553bd7b8bbc79d0ed8f26d0ab3f94 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon May 10 20:58:30 2010 +0300 xfree86: vgaarb: change macros by inline functions to ease debug Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 79ee78de9de49d0cab03401662baa476a18e53b8 Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 20 17:32:27 2010 -0700 xserver 1.9.0 Signed-off-by: Keith Packard <keithp@keithp.com> commit 3e56efcfb63677cd8574e1e435e61d96f79ea536 Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 20 10:01:48 2010 -0700 fb: make isClipped always reject negative coordinates (bug 11503) A window with either dimension > 32767 can be positioned such that coordinates > 32767 are visible on the screen. Attempts to draw to those pixels will generate coordinates wrapped around to negative values. The optimized clipping macro, 'isClipped', in fbbits.h, computes clipping in window space rather than screen space using int16 values, and so it too has coordinates wrapped around to negative values and hence ends up accepting the wrapped drawing coordinates. Two possible fixes for this problem 1) Detect wrapped region coordinates and clip those to 32767. 2) Detect negative incoming coordinates and reject those This patch takes the second approach as it is much shorter, simply detecting when either X or Y incoming coordinate is negative, which can never be 'within' any drawable. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 951605b4660290044fb238bcf1d6d9e498567e8c Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Aug 20 13:51:04 2010 +0100 edid: Adjust rounding of max_clock A simple hack to accommodate various EDID who have detailed modes that exceed the EDID's max pixel clock. The pixel clock is only defined in units of 10MHz and often appears as the maximum pixel code of the detailed modes, rounded to the nearest 10MHz. Adjusting the max_clock to include an extra 5MHz prevents the parser from rejecting the detailed modes. The kernel uses the same fuzz and by including it in X we can use the same modes in X as for the console. Fixes: Bug 23833 - X uses different refresh rate to that set by kernel module https://bugs.freedesktop.org/show_bug.cgi?id=23833 In the future, we will want to try harder to keep the KMS modes but at the same time we need to apply the restrictions as specified by the user's configuration, and need to fill in modes for fullscreen games on fixed-mode panels. Reported-and-tested-by: Fabio Pedretti <fabio.ped@libero.it> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7e581780603d6b15291d032efdeeca77f969e0ba Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Jun 24 12:24:58 2010 +0100 glx: Prevent NULL context deref in __glXGetDrawable() (bug 29184) During a SwapBuffers request, we may end up querying an unknown drawable outside of an active context, and so need to report this error prior to attempting to dereference the NULL context. Also fixes: [Bug 29184] glXSwapBuffers with no GLX context crashes X. https://bugs.freedesktop.org/show_bug.cgi?id=29184 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5725849a1b427cd4a72b84e57f211edb35838718 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 28 18:08:50 2010 -0400 render: Bounds check for nglyphs in ProcRenderAddGlyphs (#28801) Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit fc091936e2bddbbab9c9a501edc5a5f08388617e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 16 14:18:45 2010 +1000 dix: copy the valuators passed into GPE/GKVE/GProxE. GPE and friends modify the valuators array passed in. Which means any driver using e.g. xf86PostButtonEventP(..., valuators) twice to emulate a button click will provide garbage data on the second run. This is currently affecting the wacom driver, xf86PostButtonEventP() with valuators is required to have input events with device-specific axis values. Passing the same valuators in twice, once with press, once with release, will see the valuators modified in the first call and garbage submitted in the next one. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6e3e559e9fa63069a10eb834a6dab9a4cfc140ee Author: Keith Packard <keithp@keithp.com> Date: Sun Aug 15 20:53:20 2010 -0700 dix: reset pScreen->root to NULL when root window is deleted. From: Dave Airlie <airlied@linux.ie> We were seeing a crash in the FreeAllResources codepath, running valgrind revealed this, ==12536== Invalid read of size 4 ==12536== at 0x810BCAB: DeliverPropertyEvent (rrproperty.c:33) ==12536== by 0x80958A4: TraverseTree (window.c:227) ==12536== by 0x809593E: WalkTree (window.c:255) ==12536== by 0x810BC66: RRDeliverPropertyEvent (rrproperty.c:53) ==12536== by 0x810BD5D: RRDeleteProperty.clone.0 (rrproperty.c:76) ==12536== by 0x810BD98: RRDeleteAllOutputProperties (rrproperty.c:88) ==12536== by 0x810A36E: RROutputDestroyResource (rroutput.c:407) ==12536== by 0x808DF4E: FreeClientResources (resource.c:859) ==12536== by 0x808E005: FreeAllResources (resource.c:876) ==12536== by 0x8062300: main (main.c:305) ==12536== Address 0x46ba8ac is 4 bytes inside a block of size 164 free'd ==12536== at 0x40057F6: free (vg_replace_malloc.c:325) ==12536== by 0x8087F1F: _dixFreeObjectWithPrivates (privates.c:357) ==12536== by 0x809832A: DeleteWindow (window.c:926) ==12536== by 0x808DF4E: FreeClientResources (resource.c:859) ==12536== by 0x808E005: FreeAllResources (resource.c:876) ==12536== by 0x8062300: main (main.c:305) Its a use after free on the root window, since we have already deleted it at this point. This patch checks if the window we are destroying is the root window and resets the pointer to NULL if it is. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Tested-by: Dave Airlie <airlied@redhat.com> commit 5d1d9d9ae39fab2ee2ac085f9776f82768828dc8 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Aug 1 11:41:58 2010 -0700 XQuartz: xpr: Bail on errors during unlock and destroy Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ee7fd8fc58d9fadfbb92302ddea224537f068538 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Aug 1 11:39:14 2010 -0700 XQuartz: UpdateScreen at the end of SetRootless This will ensure that pRoot is unlocked after the miPaintWindow Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4fc4cab98d454afbfd0d2f48548b5b481e8e7c82 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Jul 29 14:49:10 2010 -0700 XQuartz: Make application switching work better for the no-spaces case We still have the issue with not raising the frontmost window for the case when spaces is enabled, and the AppleSpacesSwitchOnActivate preference is disabled. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit e5bc62a03289f956c54c4699edf47f7ff237b5be Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Jul 25 22:29:11 2010 -0700 XQuartz: Ignore kXquartzToggleFullscreen when rootless Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 71af1f71c0492c365707c6b3810f94642ff39352 Author: Keith Packard <keithp@keithp.com> Date: Thu Aug 12 23:01:59 2010 -0700 Bump to version 1.8.99.906 (1.9 RC6) Signed-off-by: Keith Packard <keithp@keithp.com> commit 0af322858e86665ee43f065741318e69c2755510 Author: Keith Packard <keithp@keithp.com> Date: Thu Aug 12 22:56:36 2010 -0700 Silence GCC warning about uninitialized lastSlave variable Not an actual bug, but gcc can't tell that this variable cannot be used without being initialized Signed-off-by: Keith Packard <keithp@keithp.com> commit b5cf9c5090d15a50b105470900823f2d398d4bd2 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Aug 12 00:09:01 2010 -0700 Stop checking or calling PtrCtrlProcs None of them do anything useful now that pointer acceleration is entirely handled in the server. (Does not completely nuke yet, since that would be an API/ABI break.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bce12f2956f23c0ee53f7f6485dba631293a0931 Author: Jesse Adkins <jesserayadkins@gmail.com> Date: Wed Aug 4 23:39:14 2010 -0700 xfree86: parser: Never use constant strings for driver names (fixes #17438) When the parser sees the "keyboard" driver, it automatically (and silently) replaces it with the constant string "kbd". Everybody else uses malloc'd memory for the driver name, so input device closure assumes it can use free. Free val.str, so this crash doesn't turn into a memory leak. Whew. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 619ca32202cd22f2a408586cbc906b8bbaeb9358 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 28 15:08:27 2010 +1000 Xi: reset the unused classes pointer after copying After copying the unused_classes into the device, reset the original pointer. Otherwise we have two pointers pointing to the same field and both get freed on device removal. Some classes already have this behaviour since 51c8fd69. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 1a172f3297369a72865232c382abfc14281102a4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 23 13:24:34 2010 +1000 xkb: if the button isn't down, don't fake an event. If the button we're about to fake isn't down (or up), don't fake a release (or press) event for it. Behaviour is the same as before, this just saves a few cycles. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 651c36e95ec0ac60d3fb98966df4218712ae78c2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 23 11:46:30 2010 +1000 xkb: post-fix PointerKeys button events with a DeviceChangedEvent. commit 14327858391ebe929b806efb53ad79e789361883 xkb: release XTEST pointer buttons on physical releases. (#28808) revealed a bug with the XTEST/PointerKeys interaction. Events resulting from PointerKeys are injected into the event processing stream, not appended to the event queue. The events generated for the fake button press include a DeviceChangedEvent (DCE), a raw button event and the button event itself. The DCE causes the master to switch classes to the attached XTEST pointer device. Once the fake button is processed, normal event processing continues with events in the EQ. The master still contains the XTEST classes, causing some events to be dropped if e.g. the number of valuators of the event in the queue exceeds the XTEST device's number of valuators. Example: the EQ contains the following events, processed one-by-one, left to right. [DCE (dev)][Btn down][Btn up][Motion][Motion][...] ^ XkbFakeDeviceButton injects [DCE (XTEST)][Btn up] Thus the event sequence processed looks like this: [DCE (dev)][Btn down][Btn up][DCE (XTEST)][Btn up][Motion][Motion][...] The first DCE causes the master to switch to the device. The button up event injects a DCE to the XTEST device, causing the following Motion events to be processed with the master still being on XTEST classes. This patch post-fixes the injected event sequence with a DCE to restore the classes of the original slave device, resulting in an event sequence like this: [DCE (dev)][Btn down][Btn up][DCE (XTEST)][Btn up][DCE (dev)][Motion][Motion] Note that this is a simplified description. The event sequence injected by the PointerKeys code is injected for the master device only and the matching slave device that caused the injection has already finished processing on the slave. Furthermore, the injection happens as part of the the XKB layer, before the unwrapping of the processInputProc takes us into the DIX where the DCE is actually handled. Bug reproducible with a device that reports more than 2 valuators. Simply cause button releases on the device and wait for a "too many valuators" warning message. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Keith Packard <keithp@keithp.com> commit 6dae7f3792611aace1df0cca63bf50c50d93de43 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Aug 10 19:30:20 2010 +0100 xace: Invalid reference to out-of-scope data. The callback data passed by reference to the hook was allocated on stack within the scope of the case statement. The compiler is free to reuse any of that stack space whilst making the function call so we may end up passing garbage into the callback. References: Bug 18451 - Xorg server 1.5.2 SEGV during XFixesGetCursorImage() https://bugs.freedesktop.org/show_bug.cgi?id=18451 v2: Drop the unrelated hunk that snuck in when ammending the commit message. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fbd02046797185715e1a120d52e410ec78fc365f Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Aug 5 15:19:20 2010 +0100 Cygwin/X: Fix glxWinCreateDrawable() for API change Commit 9de0e31746d5f0d9d39d11c94ec3cbc04a9935fc changed the signature of __GLXScreen's createDrawable method. Update the glxWinCreateDrawable() function in XWin's GLX provider appropriately. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit ff70848e623920779d20f35d47e9e1f34157de47 Author: Keith Packard <keithp@keithp.com> Date: Fri May 21 09:01:43 2010 -0700 Don't let alpha maps recurse in fb. Bug 23581. Recursive alpha maps (where one picture's alpha map is set to a picture with an external alpha map) would be all fine and dandy, except for the case where the client constructs a loop. Detecting this case when setting the alpha map values would be difficult as any time an alpha map is set, the server would have to check for the looping case. Instead, a far simpler fix is to simply disallow recursive alpha maps in the rendering code, the Render spec is ambiguous in this area and allows us to to ignore the recursive case. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 70a94c5b7a42adc0995bf774c44587a0778be0d0 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Aug 3 19:49:10 2010 +0100 rootless: fix uninitialized private key assert in non-rootless modes in Cygwin/X IsFramedWindow() is called from miPaintWindow() if the server has been built with ROOTLESS defined, irrespective of if RootlessInit() has ever been called, or not. Add a check to IsFramedWindow() to check if rootlessWindowPrivateKey has been registered (as a proxy for checking if the rootless extension has been initialized) so we don't go on to try to use that key, triggering an assert. This bug exposes what appears to be a difference in opinion about the rootless extension between XQuartz and XWin. XQuartz always initializes the rootless extension, whereas XWin offers several modes of operation, and the rootless extension is only used for one of them That probably means that the all code under compile time guard for ROOTLESS should be carefully checked that it doesn't also need to be under a run-time guard (I've reviewed the other ROOTLESS blocks in dix/events.c and dix/window.c and they look ok -- keithp) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 3ab6cd31cbdf8095b2948034fce5fb645422d8da Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 9 15:20:20 2010 -0400 fonts: Fix refcounting for asynchronous font operations (#3040) When doing Xinerama, we'll dispatch font ops across all backend screens. If using a font server (such that some operations can sleep), we'll put the client to sleep once for each screen, but only wake up once, because we're trying to keep track of the sleep count in _each_ screen's closure. Instead, just ask the core whether the client is already asleep. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 35c0dbe4b0a6ab790f4271325b8a0b16894daa8b Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Aug 8 10:03:08 2010 -0400 doc: add missing .gitignore for Xserver-DTrace The dtrace doc was recently added in commit 9c171d4aee695ab66e6db1ab92539557bd368cfa Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> commit 05c4fe83fdc20b838fd59658478278dc31a55eb9 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Jul 30 17:43:24 2010 -0700 Check HAVE_XMLTO_TEXT before trying to use xmlto to make text files Reported-by: Matt Turner <mattst88@gmail.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit a6fb7829ed9bf26c4c2a02c6ed075fb1b17f7b2a Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Jul 26 19:55:27 2010 -0700 Xserver-spec: Update ChangeGC prototype, add ChangeGCXIDs Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit a817271d461e2f95dd7dc62cd1c7d123ce92f555 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Jul 22 23:57:57 2010 -0700 Update Xserver-spec for new devPrivates API Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Patrick E. Kane <pekane52@gmail.com> commit 40d598a4f84091db743ceef4d60752bb910c3e56 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Jul 22 23:57:02 2010 -0700 Correct function name in dixRegisterPrivateKey comments Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Patrick E. Kane <pekane52@gmail.com> commit 8d7b7a0d71e0b89321b3341b781bc8845386def6 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Thu Jul 29 20:36:25 2010 -0400 Set DamageSetReportAfterOp to true for the damage extension Change the damage extension reporter to queue up events after we chain to the wrapped functions. Damage events are typically sent out after the rendering happens anyway, since we submit batch buffers from the flush callback chain and then flush client io buffers. Compositing managers relie on this order, and there is no way we could reliably provide damage events to clients before the rendering happens anyway. By queueing up the damage events before the rendering happens, there's a risk that the client io buffer may overflow and send the damage events to the client before the driver has even seen the rendering request. Reporting damage events after the rendering fixes this corner case and better corresponds with how we expect this to work. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit c65f610e12f9df168d5639534ed3c2bd40afffc8 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Thu Jul 29 18:52:35 2010 -0400 Always call the flush callback chain when we flush client buffers We were missing the callback in a couple of places. Drivers may use the flush callback to submit batched up rendering before events (for example, damage events) are sent out, to ensure that the rendering has been queued when the client receives the event. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 7e0575baf14ec4a89492fd2780f9ab5b9244afbd Author: Matt Turner <mattst88@gmail.com> Date: Tue Jul 27 23:32:36 2010 -0400 ddc: Fix memory leak in GetEDID_DDC1 Mark argument to DDC_checksum as const too. Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 750d4e82a0c1161292d24216bcff200cd6647611 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Jul 29 11:39:40 2010 -0700 XQuartz: xpbproxy: Don't take down the whole server on an IO error Calls pthread_exit to prevent _XIOError from calling exit() This fixes http://xquartz.macosforge.org/trac/ticket/421 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 98f90145d786695ecbc02a667c6ffe7c619dc67e Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jul 28 18:08:02 2010 -0700 XQuartz: GLX: Don't mangle __GLXDrawable's pDraw We were incorrectly NULLing out pDraw in __GLXDrawable instead of ours in __GLXAquaDrawable. (we should refactor to eliminate this redundancy later) This was causing http://xquartz.macosforge.org/trac/ticket/426 This was benign until commit f0006aa58f6cf7552a239e169ff6e7e4fda532f4 The root cause of this change was fed7ccc481ad1caaa518cafe944c2327a5d0b6c65 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 9c171d4aee695ab66e6db1ab92539557bd368cfa Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Jun 25 16:52:42 2010 -0700 Add documentation of the Xserver DTrace probes Mostly pulled together from posts to my blog and the docs posted at http://people.freedesktop.org/~alanc/dtrace/ and converted to DocBook. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Patrick E. Kane <pekane52@gmail.com> commit 6b912b08ce65072b2401167fbf2150b99c0ca6b0 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Jun 19 23:56:20 2010 -0700 Add name argument to CreateNewResourceType documentation Reflects API change made in commit 895f40792a during Xorg 1.8 development Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Patrick E. Kane <pekane52@gmail.com> commit 44c9350d72b3eda982c642feb45d6648afc626cf Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Jun 19 23:40:37 2010 -0700 Use DocBook stylesheets from xorg-sgml-doctools if they're available Bumps minimum xorg-macros requirement from 1.6 to 1.10 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Patrick E. Kane <pekane52@gmail.com> commit 9fbbff3c0456f1969d45cc957d3260723caf62d7 Merge: 95756f4 9ac8e20 Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 21 11:56:39 2010 -0700 Merge remote branch 'whot/for-keith' commit 9ac8e206ffe1016a8bc203261ade6c763a8a4f86 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 15 15:46:15 2010 +1000 xkb: use GetMaster instead of dev->u.master. Devices that are both pointers and keyboards are not affected by keyboard changes as their master device is a master pointer, not a master keyboard. Use GetMaster() instead to ensure devices that are attached to the paired master pointer device will still be update. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit c54f81ba7a58faf37a612bd9a45276bb2922b5d8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 15 13:24:14 2010 +1000 dix: hack around enter/leave event issues for grabbed devices (#27804) The current core enter/leave does not cater for device grabs during enter/leave events. If a window W contains a pointer P1 and a client grabs a pointer P2, this pointer will not generate enter/leave events inside this window. Hack around this by forcing grabbed devices to always send enter/leave events. X.Org Bug 27804 <http://bugs.freedesktop.org/show_bug.cgi?id=27804> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 95756f410c65a6510a797e94a792b959d45cdb9e Author: Jan Hauffa <hauffa@in.tum.de> Date: Sat Jul 17 12:18:39 2010 -0700 rootless: Adjust the frame size of the native root window in RootlessResizeWindow If the native root window isn't resized as well, we will likely crash the next time we draw to the root. On OS X, this can be seen by: 1) Put the display preferences in the menu bar and set X11's preferences so you can access the menu bar in fullscreen mode 2) Set the resolution of your screen lower than normal. 3) Start X11 in fullscreen mode. The root window will cover the screen as expected. 4) Use the menu bar to increase the resolution of the display. The root window will now cover the old area and not the full screen, but 'xwininfo -root' will report the full width. 5) Run 'xsetroot -solid red', and we have the crash you mention above. Leaving/entering fullscreen after #4 will fix the problem. This is because the WINREC is erased when we leave fullscreen mode and it is recreated upon re-entry: RootlessUpdateRooted(FALSE) RootlessDisableRoot(screenInfo.screens[0]) RootlessDestroyFrame (pRoot, winRec); RootlessUpdateRooted(TRUE) RootlessEnableRoot(screenInfo.screens[0]) RootlessEnsureFrame(screenInfo.screens[0]->pRoot) creates a new WINREC... Signed-off-by: Jan Hauffa <hauffa@in.tum.de> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-By: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Jeremy Huddleston <jeremyhu@apple.com> commit a2c13f0d6548310e3cd115cf486d3e43edf23dcc Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 14 12:57:29 2010 -0700 Bump to version 1.8.99.905 (1.9 RC5) Signed-off-by: Keith Packard <keithp@keithp.com> commit 0fc02c0bf92f694889589e3648acc08d4684de37 Merge: 0540c46 9d8ec71 Author: Keith Packard <keithp@keithp.com> Date: Tue Jul 13 15:05:36 2010 -0700 Merge remote branch 'jeremyhu/master' commit 0540c46066f938ad5611c56081cfcd8457a9b718 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jul 13 14:56:53 2010 +0200 EXA: Finish access to pixmap if it's prepared at destruction time. Previously we assumed every pixmap destroyed during a software fallback was also created during a software fallback and had access prepared, but that's not always true. Fixes a server abort Reported-by: 邓逸昕 <bupt.dengyixin@gmail.com> Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d75e8146c414bfd512ba5dbd4a83acb334bbe19b Author: Keith Packard <keithp@keithp.com> Date: Mon Jul 12 16:01:34 2010 -0700 Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998 Because some EnterVT code needs to remove it self from the call chain, we need to fix all of the wrappers to correctly unwrap/rewrap during the call chain. This is a follow-on to the fix for bug 27114 in commit 68a9ee8370e6f9b38218376ac92d5130a5b0ef1e. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Jesse Barnes <jesse.barnes@intel.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 9d8ec712a67ce71ea7408f0626cda7e0fa7c3bac Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jul 13 08:56:36 2010 -0700 XQuartz: Bump bundle version to 2.6.0 for xorg-server-1.9.0 and X11R7.6 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit b2b9c458a46e9a41c3c76ffe83a2b580a41d0e90 Author: Jan Hauffa <hauffa@in.tum.de> Date: Wed Jun 16 09:25:41 2010 -0700 XQuartz: Remove some dead code. Signed-off-by: Jan Hauffa <hauffa@in.tum.de> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 648d189548530fa23d97d1e8737f89d297f1c443 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jul 13 08:25:27 2010 -0700 XQuartz: Avoid a crash when mistakenly free()ing in QuartzSetCursor on some configs Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 3209b094a3b1466b579e8020e12a4f3fa78a5f3f Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Fri Jul 9 10:36:56 2010 -0700 DRI2: re-allocate DRI2 drawable if pixmap serial changes If a pixmap header is modified or the drawable serial changes, some aspects of the drawable are likely to have changed so we should re-allocate the corresponding DRI2 drawable in that case. This is one way of catching when the root window pixmap changes through xrandr. Fixes bug https://bugs.freedesktop.org/show_bug.cgi?id=28365. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 02b11509b25686ff7bd567ecb78a435701edc4c2 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Fri Jul 9 10:36:12 2010 -0700 miModifyPixmapHeader: always update serialNumber We should update the serial number even if we just change a single field. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2307ab5bc9365ebbe04568edb7c7620a23689b70 Merge: c65280c fd4f505 Author: Keith Packard <keithp@keithp.com> Date: Tue Jul 6 23:54:54 2010 -0400 Merge remote branch 'whot/for-keith' commit fd4f5059f08165a726071dc9f1ca877038292f6f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 6 09:19:09 2010 +1000 dix: purge leftover manual key down bit setting. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a1afe172559aff010e886cfc2a7a922d4a06c697 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 6 09:16:42 2010 +1000 dix: add aux. functions for button_is_down, set_button_down, set_button_up. Same as the matching key functions. Buttons, like keys, can have two states for down/up - one posted, one processed. Posted is set during event generation (usually in the signal handler). Processed is set during event processing when the event queue is emptied and events are being delivered to the client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 32473d6bf38c95b2d6d5ddbf583a1e801c6605e4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 6 08:56:12 2010 +1000 dix: use BitIsOn/SetBit/ClearBit macros for set_key_down helpers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit c18442908080c9833dfd6bb2ff367945d1892421 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 5 16:47:57 2010 +1000 Xi: use set_key_up/down instead of manual bit handling. We have the wrappers, use them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 10442ce02b5be7f82b373bee1939e2b523e291d9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 5 16:54:48 2010 +1000 dix: treat flags as flags, not as value in key_is_down. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit b46ffd25d3f211e91c67bc618ecbd58257939388 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 2 15:25:14 2010 +1000 mi: rename miPointerMoved to miPointerMoveNoEvent. Having miPointerMove and miPointerMoved is confusing, especially since both do the same thing bar the event delivery. Also, miPointerMove calls miPointerMoved which indicates some confusion in the temporal alignment of cause and effect. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit dbd621705a5211540b353af81c4af83c297b74dc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 2 14:22:03 2010 +1000 mi: De-duplicate some code in mipointer.c miPointerMoved already has the same code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit c65280ce8df4836bd7424a90482e8aa00ab6f447 Author: Robert Hooker <sarvatt@ubuntu.com> Date: Sat Jun 12 20:23:09 2010 -0400 Increase advertised RENDER protocol minor version to 11 Support for the blend mode operators was added in 0ce42adbf4cff9e7f049d9fc79d588ece5936177 and the requirement was bumped but when things were split off into include/protocol-versions.h it defined it to 10. render uses the lower of the client and server advertised versions so it's not using the new blend mode operators. Signed-off-by: Robert Hooker <sarvatt@ubuntu.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9f0b193acdc29e491b6245390cf9f53b5222e6d3 Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 1 09:13:43 2010 -0400 miDbe window priv priv is pre-allocated, don't use dixSetPrivate (bug 28639) miDbeInit pre-allocates space in each DBE window private private for a MiDbeWindowPrivPrivRec. miDbeAllocBackBufferName used the pre-allocated space correctly (simply fetching it instead of allocating a new piece of memory). However, it then called dixSetPrivate anyways, which isn't necessary, and (in the new dixPrivate world) causes an assert failure. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net> Reviewed-by: Magnus Kessler <Magnus.Kessler@gmx.net> commit a94cb400d15b8c78dc04148cbd8db8e5ec8364b5 Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 1 09:11:36 2010 -0400 Delete unused miDbe screen private private datatype MiDbeScreenPrivPrivRec is not used in the server. Remove it, along with the MI_DBE_SCREEN_PRIV_PRIV macro that tried to use it. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Magnus.Kessler <Magnus.Kessler@gmx.net> commit f0fcffe55f280add5e4db2f5e9198a48c6f1b015 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Jun 3 19:00:54 2010 -0700 Update the sprite immediately when moving it with MouseKeys Fix for OpenSolaris bug 6949755: Mouse Keys are ununusable and possibly https://bugs.freedesktop.org/show_bug.cgi?id=24856 Ensures waitForUpdate is False before calling SetCursorPosition. Normally waitForUpdate is False when SilkenMouse is active, True when it's not. When it's True, the mouse cursor position on screen is not updated immediately. This is more critical on Solaris, since we disabled SigIO, thus in turn disable SilkenMouse, due to the SSE2 vs. signal handler issues described in Sun bugs 6849925, 6859428, and 6879897. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3d9079b898c432a87f9b95c1f39a85f660bf0858 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Jun 3 19:00:53 2010 -0700 Add API to update setting of waitForUpdate screen private in miPointer Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 69b2b5c85ec079ef49f84722daa5f148cedc2e1b Merge: b90faa7 1432785 Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 1 23:46:53 2010 -0400 Merge remote branch 'whot/for-keith' commit b90faa71567c4461b28515756ba5c1e6286dda16 Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 1 23:46:27 2010 -0400 Revert "xkb: merge lockedPtrButtons state from all attached SDs." Preparing to merge Peter's branch. This reverts commit 6052710670953b43b4fff5d101b727163fcb1187. commit 9fb0785449b287ba1998e08613b3c2102ec24842 Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 1 23:45:50 2010 -0400 Revert "Revert "dix: use the event mask of the grab for TryClientEvents."" Preparing to merge Peter's branch. This reverts commit 018c878e9495b21146c8f38617fdd1bf6d8cc73b. commit 48cac27870992f6bde2c48429ff03c0a7606d5c1 Author: James Jones <jajones@nvidia.com> Date: Fri Jun 18 17:28:15 2010 -0700 Cast void* to pointer* to appease some compilers. When this privates.h is included in C++ builds, the compiler complains about implicitly casting void* to void**. This small patch fixes that up. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 14327858391ebe929b806efb53ad79e789361883 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 1 12:44:57 2010 +1000 xkb: release XTEST pointer buttons on physical releases. (#28808) If a button release event is posted for the MD pointer, post a release event through the matching XTEST device. This way, a client who posts a button press through the XTEST extension cannot inadvertedly lock the button. This behaviour is required for historical reasons, until server 1.7 the core pointer would release a button press on physical events, regardless of the XTEST state. Clients seem to rely on this behaviour, causing seemingly stuck grabs. The merged behaviour is kept for multiple keyboard PointerKey events, if two physical keyboards hold the button down as a result of PointerKey actions, the button is not released until the last keyboard releases the button. X.Org Bug 28808 <http://bugs.freedesktop.org/show_bug.cgi?id=28808> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a71dbc03e65cf7b0654a6eca93ce0bf6a1711ffa Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 1 08:27:05 2010 -0400 Bump to version 1.8.99.904 (1.9 RC4) Signed-off-by: Keith Packard <keithp@keithp.com> commit 5ea497fc32202ff19c2b7d8ef4eba08889108a87 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jun 29 16:08:02 2010 +0300 xfree86: configure: remove vendor and card name matching rules Although vendor and board naming are used to create the configure file, the server doesn't actually use it when fetching such file and probing devices. Reported-by: Richard Barnette <jrbarnette@chromium.org> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Tested-by: Richard Barnette <jrbarnette@chromium.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 90fd9e40b59e69333d250a795998f44dc3a5dc0c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jun 29 16:08:01 2010 +0300 xfree86: pci: remove superfluous vendor and card name logging X server suffers in startup time when relying on the pciaccess's linear search to fetch vendor and video device name from PCI ID file (when existent). Such names are only used to write the log, which may be superfluous. This information often is provided by the drivers or likewise users can get the it using external tools like lspci or scanpci. This patch remove the references of those functions from X start up. Reported-by: Richard Barnette <jrbarnette@chromium.org> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: James Cloos <cloos@jhcloos.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 339f62b1bfadb0ee77d67e351f4e30f5d5e9625f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 29 15:24:51 2010 +1000 xkb: emulate PointerKeys events only on the master device. This patch replicates the behaviour for button events. Only generate a PointerKeys motion event on the master device, not on the slave device. Fixes the current issue of PointerKey motion events generating key events as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 69ac909878ef80bb74c4a9ca4150eda66debd754 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 29 12:12:53 2010 +1000 xkb: merge lockedPtrButtons state from all attached SDs. Problem: lockedPtrButtons keeps the state of the buttons locked by a PointerKeys button press. Unconditionally clearing the bits may cause stuck buttons in this sequence of events: 1. type Shift + NumLock to enable PointerKeys 2. type 0/Ins on keypad to emulate Button 1 press → button1 press event to client 3. press and release button 1 on physical mouse → button1 release event to client Button 1 on the MD is now stuck and cannot be released. Cause: XKB PointerKeys button events are posted through the XTEST pointer device. Once a press is generated, the XTEST device's button is down. The DIX merges the button state of all attached SDs, hence the MD will have a button down while the XTEST device has a button down. PointerKey button events are only generated on the master device to avoid duplicate events (see XkbFakeDeviceButton()). If the MD has the lockedPtrButtons bit cleared by a release event on a physical device, no such event is generated when a keyboard device triggers the PointerKey ButtonRelease trigger. Since the event - if generated - is posted through the XTEST pointer device, lack of a generated ButtonRelease event on the XTEST pointer device means the button is never released, resulting in the stuck button observed above. Solution: This patch merges the MD's lockedPtrButtons with the one of all attached slave devices on release events. Thus, as long as one attached keyboard has a lockedPtrButtons bit set, this bit is kept in the MD. Once a PointerKey button is released on all keyboards, the matching release event is emulated from the MD through the XTEST pointer device, thus also releasing the button in the DIX. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 09645864f5a52882eee51c801b3e610d683e7147 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 29 13:49:27 2010 +1000 xkb: Mark switch case fallthrough with comment. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c7330ecb5d28d7a92d24feb289f7f1812ce055a4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 30 13:23:14 2010 +1000 dix: fix up erroneous error message. (WW) Device 'device name' has 36 axes, only using first 36. does seem a bit silly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dbf249ec6638f0a8dfa4c2286099845aafc8ac88 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 29 10:43:51 2010 +1000 xkb: remove now obsolete comment. Looks like nothing broke from removing the hardcoded CoreProcessPointerEvent call. Whoop. Di. Doo. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f028e70ca714f6956e41754f132cb9b8a1e8db63 Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 30 08:33:55 2010 -0700 Initialize dev privates before using any Initializing the dev privates code after allocating the server client dev privates would cause the memory leak check to fire at server startup or reset. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> commit 433d0851cd3e61d841ff374ee0a0f052d5907029 Author: Julien Cristau <jcristau@debian.org> Date: Fri Jun 25 11:34:44 2010 +0100 Xephyr: fix Xv adaptor capability tests Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9626eedebf620559652ffb1fefa82b5d659e57be Author: Julien Cristau <jcristau@debian.org> Date: Thu Jun 24 18:45:11 2010 +0100 configure: bail if Xephyr was requested but its dependencies are missing Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit e6531ae9d5bdd37775e921268366fb76056e22d5 Author: Julien Cristau <jcristau@debian.org> Date: Thu Jun 24 18:45:10 2010 +0100 Xephyr: fix memory leak in XF86DRIOpenConnection The allocated bus id string was not being freed. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 390a8466dd1914f4786b811ff8454f6e0c4b6b04 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Mon Jun 28 23:26:48 2010 +0300 xfree86/modes: Allow the driver to specify initial rotation When the "Rotate" option isn't specified allow the driver to specify the initial rotation mode. This way the driver can choose to retain the same settings that were used by software that was used prior to starting X. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6052710670953b43b4fff5d101b727163fcb1187 Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 30 08:21:04 2010 -0700 xkb: merge lockedPtrButtons state from all attached SDs. Problem: lockedPtrButtons keeps the state of the buttons locked by a PointerKeys button press. Unconditionally clearing the bits may cause stuck buttons in this sequence of events: 1. type Shift + NumLock to enable PointerKeys 2. type 0/Ins on keypad to emulate Button 1 press → button1 press event to client 3. press and release button 1 on physical mouse → button1 release event to client Button 1 on the MD is now stuck and cannot be released. Cause: XKB PointerKeys button events are posted through the XTEST pointer device. Once a press is generated, the XTEST device's button is down. The DIX merges the button state of all attached SDs, hence the MD will have a button down while the XTEST device has a button down. PointerKey button events are only generated on the master device to avoid duplicate events (see XkbFakeDeviceButton()). If the MD has the lockedPtrButtons bit cleared by a release event on a physical device, no such event is generated when a keyboard device triggers the PointerKey ButtonRelease trigger. Since the event - if generated - is posted through the XTEST pointer device, lack of a generated ButtonRelease event on the XTEST pointer device means the button is never released, resulting in the stuck button observed above. Solution: This patch merges the MD's lockedPtrButtons with the one of all attached slave devices on release events. Thus, as long as one attached keyboard has a lockedPtrButtons bit set, this bit is kept in the MD. Once a PointerKey button is released on all keyboards, the matching release event is emulated from the MD through the XTEST pointer device, thus also releasing the button in the DIX. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 28e33ae6f69f716ece5d68e63fc52557236c5f6e Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Wed Jun 30 07:59:04 2010 -0700 OS support: fix writeable client vs IgnoreClient behavior When ResetCurrentRequest is called, or IgnoreClient is called when a client has input pending, IgnoredClientsWithInput will be set. However, a subsequent IgnoreClient request will clear the client fd from that fd set, potentially causing the client to hang. So add an Ignore/Attend count, and only apply the ignore logic on the first ignore and the attend logic on the last attend. This is consistent with the comments for these functions; callers must pair them. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=27035. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 018c878e9495b21146c8f38617fdd1bf6d8cc73b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 25 09:48:10 2010 +1000 Revert "dix: use the event mask of the grab for TryClientEvents." Behaviour of earlier X servers was to deliver the ButtonPress event unconditionally, regardless of the actual event mask being set. Thus, a GrabButton event will always deliver the button press event, a GrabKey always the key press event, etc. Same goes for XI and XI2. Reproducible with a simple client requesting a button grab in the form of: XGrabButton(dpy, AnyButton, AnyModifier, win, True, ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); On servers before MPX/XI2, the client will receive a button press and release event. On current servers, the client receives only the release. Clients that expect the press event to be delivered unconditionally may leave the user with a stuck grab. XTS test results for XGrabButton are identical with and without this patch. This reverts commit 48585bd1e3e98db0f3df1ecc68022510216e00cc. Conflicts: dix/events.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1884db430a5680e37e94726dff46686e2218d525 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 24 12:52:53 2010 +1000 Revert "dix: use the event mask of the grab for TryClientEvents." Behaviour of earlier X servers was to deliver the ButtonPress event unconditionally, regardless of the actual event mask being set. This is documented in the protocol: "This request establishes a passive grab. In the future, the pointer is actively grabbed as described in GrabPointer, the last-pointer-grab time is set to the time at which the button was pressed (as transmitted in the ButtonPress event), and the ButtonPress event is reported if all of the following conditions are true: <list of conditions, event mask is not one of them>" Thus, a GrabButton event will always deliver the button press event, a GrabKey always the key press event, etc. Same goes for XI and XI2. Reproducible with a simple client requesting a button grab in the form of: XGrabButton(dpy, AnyButton, AnyModifier, win, True, ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); On servers before MPX/XI2, the client will receive a button press and release event. On current servers, the client receives only the release. Clients that expect the press event to be delivered unconditionally. XTS Xlib13 XGrabButton 5/39 now passes. This reverts commit 48585bd1e3e98db0f3df1ecc68022510216e00cc. Effectively reverts commit 1c612acca8568fcdf9761d23f112adaf4d496f1b as well, the code introduced with 1c612 is not needed anymore. Conflicts: dix/events.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Keith Packard <keithp@keithp.com> commit 3b3c77b87070ddcdbb2acb114a81628485e7a129 Author: Tiago Vignatti <tiago.vignatti@Nokia.com> Date: Wed Jun 23 15:18:04 2010 +0300 configure: don't check xfont always for each server It's already defined inside REQUIRED_LIBS and all DDX are getting it already. No semantical changes. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 75536ee80595c79bba95a1fb6844126ee08486d4 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Jun 23 15:18:03 2010 +0300 dix: use one single function to register fpe fonts X server doesn't need to understand fpe internals, so use register_fpe_functions from libXfont. It's required to get new version of libXfont, therefore adjust it to be passed to autoconf. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a68a101a730df7f73421555e381a50b074607c5e Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 22 12:13:26 2010 -0700 Bump to 1.8.99.903 -- 1.9 RC3 Signed-off-by: Keith Packard <keithp@keithp.com> commit 2c0159d21788b16607e6ebe4571b57fe78545c2a Author: Kristian Høgsberg <krh@bitplanet.net> Date: Mon Jun 14 09:25:22 2010 -0400 list.h: Fix list_for_each_entry_safe() Can't use next as a macro argument since we're accessing the .next field of struct list. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit e2918b67395a48397bf7db545584cc2d4f4e7ccf Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 22 12:11:20 2010 -0700 Revert "mi: Remove unused overlay support" This reverts commit 9120e58556014e514eef9dfe43cdea4b74dc66ae. Whoops, please revert this patch -- overlay is in use in nvidia drivers, and it's too late in release cycle to remove it. I feel really sorry that I kept this patch in my tree. I will submit another one, removing only XAA overlay hooks which are not used at all. commit 7673451ade46ebacfdfc02a5190149210198fdd8 Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 22 11:49:30 2010 -0700 Bump to 1.8.99.902 -- 1.9 RC2 Signed-off-by: Keith Packard <keithp@keithp.com> commit 8b65f2edb407521e0ac0e207e5d5358986bd46da Author: Rami Ylimäki <ext-rami.ylimaki@nokia.com> Date: Tue Jun 22 14:57:20 2010 +0300 record: Prevent a crash on recording client disconnect. Execute the following steps to reproduce the issue. 1. Run at least two recording clients simultaneously. $ cnee --record --request-range 1-127 & $ cnee --record --request-range 1-127 & 2. Kill the recording clients. $ killall cnee 3. Give X server something to do so that the clients are closed. $ xinput list $ xinput list As a result RecordUninstallHooks accesses NullClient, because RecordAClientStateChange doesn't clean the recording clients up properly. Fix RecordUninstallHooks to fail locally on an assertion instead of much later in privates code, if NullClient is still accessed because of some other bug. Fix RecordAClientStateChange to iterate through all contexts so that modifications of the iterated array during iteration don't cause contexts to be skipped. Signed-off-by: Rami Ylimäki <ext-rami.ylimaki@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 660f6ab5494a728c3ca7ba00c305e9ff06c8ecb2 Author: Simon Farnsworth <simon.farnsworth@onelan.com> Date: Tue Jun 22 10:13:30 2010 +0100 Don't crash when asked if a client that has disconnected was local ProcDRI2Dispatch uses LocalClient to determine if it's safe to respond to a client that has made DRI2 requests which aren't sensible for remote clients (anything but version). When the client has disappeared mid-request stream (e.g. as a result of a kill -9, or a client-side bug), LocalClient causes the X server to follow suit, as ((OsCommPtr)client->osPrivate)->trans_conn is NULL at this point. The simple and obvious fix is to just return "not local" when trans_conn is NULL, which fixes the crash I was seeing; however Keith Packard pointed out that just checking trans_conn isn't enough; quoting Keith: "This looks almost right to me -- I reviewed the os code to see when _XSERVTransClose is called (which is what frees the trans_conn data) and found that every place which called that immediately set trans_conn to NULL, except for the call in CloseDownFileDescriptor which is only called from CloseDownConnection and which is immediately followed by freeing the OsCommRec and setting client->osPrivate to NULL. So, I'd suggest checking client->osPrivate in addition to the above check." Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 82d41ada993d8cbdcdfea878d1a5b031afe4e593 Author: Dave Airlie <airlied@redhat.com> Date: Mon Jun 21 16:33:55 2010 +1000 composite: fix freeing of old pixmap until after move/resize/cbw (bug 28345) The fixes for the composite reallocation failure, were freeing the oldpixmap straight after reallocating the new one, however this led to some wierd effects in e16 compositing, and I think in a few other places. This patch moves the freeing of the pixmap into the post wrapped stage. I'm not sure if we are actually better off breaking ABI and adding another callback from the ConfigureWindow to composite to make sure the old pixmap is always freed, but this should be satisfactory as we should always hit one of the freeing paths or else its a bug in the DIX. bug: https://bugs.freedesktop.org/show_bug.cgi?id=28435 Reported-by: Andrew Randrianasulu <randrik@mail.ru> Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c6bc52cb6663138d1273447cb7661fa6e958f539 Author: Dave Airlie <airlied@redhat.com> Date: Mon Jun 21 14:08:50 2010 +1000 dri2: avoid crash with old dri drivers. I built latest server and copied over a mesa 7.8 dri2 driver to use with it, and it crashed in here starting compiz. Looks like we need to validate the flush extension is registered before calling invalidate. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 80d1a548d6ce73c2ff097536c1bc7044bf74965d Author: Dave Airlie <airlied@redhat.com> Date: Mon Jun 21 10:05:08 2010 +1000 rotation: fix cursor and overlap of one pixel. Commit 77c7a64e8885696665556c9fbcb3cffb552e367a was introduced to fix a cursor off by one on Intel hw, however it also move the whole crtc into an off by one position and you could see gnom-eshell overlapping. This commit reverts that and instead fixes the cursor hotspot translation to work like pixman does. We add 0.5 to the cursor vector before translating, and floor the value afterwards. Thanks to Soeren (ssp) for pointing out where the real problem was after explaning how pixman translates points. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 32c706c4ffd7433dbfc79dba8785b1510d2f053f Author: Gaetan Nadon <memsize@videotron.ca> Date: Sun Jun 20 20:37:26 2010 -0400 config: declare xserver private dependencies in xorg-server.pc Any module (drivers) depending on xserver also depends on some of the server private dependencies. Any driver including xf86.h depends on xext, kbproto, inputproto and randr. These dependencies are in separate packages, so anything can happen, removal, wrong version, etc... and the driver fails during compilation. Having the private dependencies declared will ensure all packages the server depends on are present and at the correct version. Currently each module attempts to check for server dependencies with various degrees of accuracy. With this patch, the driver will only need to check for its own explicit dependencies. Now that xproto is included in Requires.private it is removed from Requires. All the cflags from both Requires and Requires.private are returned to caller to pkg-config. Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 37734ba79ca3a9bad1c1e29d89710c8f9c299210 Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Jun 16 18:07:04 2010 +0100 XWin: Fixes for devPrivates API change Fix some typos in devPrivates API changes in XWin code. Move allocation of private keys as it's no longer valid to do them during OsVendorInit() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit f7dae972aac28c5792566e997c40254e787d246a Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Tue Jun 15 23:25:34 2010 +0300 xv: Don't send port notify when SetPortAttribute fails Currently a port notify event is sent even if SetPortAttribute fails. Furthermore the value field in the event will contain the value that was specified in the failed request. So any client interested in the actual value of the attribute will have to double check the current value with GetPortAttribute after receiving a port notify event. Fix the problem by sending port notifications only when SetPortAttribute succeeds. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c20166739603f86888f28ca2c65f5cf474d0d8c9 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jun 12 01:05:07 2010 +0700 os: Remove unused dev_tty_from_init variable Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 2e15f1903dac8473285ad2937c079a08cf7c5d31 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jun 12 00:53:38 2010 +0700 os: Remove unused pread/pwrite/lockit functions Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 9120e58556014e514eef9dfe43cdea4b74dc66ae Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jun 12 00:30:27 2010 +0700 mi: Remove unused overlay support The only reference to it in server and drivers is in XAA overlay code which would segfault as no miInitOverlay is called ever. No segfaults were observed "in wild", so XAA overlay is probably also unused. XAA code is modified to act as if miOverlayCopyUnderlay always returned false, because XAACopyWindow8_32 could only set doUnderlay to true if it's called from miOverlayMoveWindow or miOverlayResizeWindow, which can only be called if miInitOverlay has hooked those functions, and no driver (on fd.o) or server code calls that. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 91b5aadbdfd9d05ca1ffdeb443e602ecdba1e04d Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 11 20:20:00 2010 +0700 mi: do not use X11/extensions/shape.h header from libXext Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Tested-by: Dan Nicholson <dbn.lists@gmail.com> commit b8615d592700b7be319c04cc0563fdeb5a266534 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Jun 12 08:19:16 2010 -0700 Don't coredump on "X -showopts" (bug 25874) Don't try walking the xf86ConfigLayout.screens table if it's empty https://bugs.freedesktop.org/show_bug.cgi?id=25874 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 32fd57509c3e06f63ac6b0ad607767fd2b688e5a Author: Rami Ylimäki <ext-rami.ylimaki@nokia.com> Date: Fri Jun 18 12:40:58 2010 +0300 record: Register client private to prevent crash. Running the following command causes an assertion to fail: cnee --record --request-range 1-127 3 in dixGetPrivateAddr at ../../include/privates.h:122 4 in dixGetPrivate at ../../include/privates.h:137 5 in dixLookupPrivate at ../../include/privates.h:167 6 in RecordInstallHooks at ../../record/record.c:911 7 in ProcRecordEnableContext at ../../record/record.c:2377 8 in ProcRecordDispatch at ../../record/record.c:2571 9 in Dispatch at ../../dix/dispatch.c:432 10 in main at ../../dix/main.c:289 Signed-off-by: Rami Ylimäki <ext-rami.ylimaki@nokia.com> Reviewed-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 75beadd766fed7b12a76e59e57c244e297c2d2cb Author: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Date: Sun Jun 13 18:05:26 2010 +0200 DRI2/xserver: Don't hang in glXSwapBuffers if drawable moves between crtc's (bug 28383) Detect if a drawable has been moved from an original crtc to a new crtc with a lower current vblank count than the original crtc inbetween glXSwapBuffers() calls. Reinitialize drawable's last_swap_target before scheduling next swap if such a move has taken place. last_swap_target defines the baseline for scheduling the next swap. If a movement between crtc's is not taken into account, the swap may schedule for a vblank count on the new crtc far in the future, resulting in a apparent "hang" of the drawable for a long time. Fixes Bugzilla bug #28383. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 868bf3de478fac0080d525137fc728c551c78ea6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 15 13:22:20 2010 +1000 dix: the default axis mode is Relative, not "0". Yay for readability. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> commit db0d3d4e573c93a8af43499682ed788c7bd0d70d Author: Xiaoyang Yu (Max) <max.a.yu@intel.com> Date: Fri Jun 4 17:17:53 2010 +0800 Re-enabled Xnest fix for focus in + modifier bug. * See https://bugs.freedesktop.org/show_bug.cgi?id=3030 Signed-off-by: Xiaoyang Yu (Max) <max.a.yu@intel.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> This takes the xnest way of working around this (see 5904ef2ccd6056b187ca76f104c21e2d686bfc1d "xnest: restore xnestUpdateModifierState") and copies it to Xephyr. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 505724c5f3e4fc1475fa54f20d08c0c06fb32443 Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 7 16:28:34 2010 -0700 In DRI2Connect, check to see if DRI2 has been initialized (bug 28424) This prevents DRI2GetScreen from being invoked with an uninitialized private key which would cause an assert failure. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: David Ronis <David.Ronis@McGill.CA> commit 68a9ee8370e6f9b38218376ac92d5130a5b0ef1e Author: Keith Packard <keithp@keithp.com> Date: Fri May 7 22:56:04 2010 -0700 Clean up RandR12 bits on screen close (bug 27114) When resetting the server, pScrn->EnterVT must be unwrapped or the next server generation will end up wrapping the wrapper and causing an infinite recursion on EnterVT. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Michael Stapelberg <michael+freedesktop@stapelberg.de> commit d5ab717768524c8552b81607aaeffb447ab268ee Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 10 19:21:18 2010 -0700 Bump to 1.8.99.901 -- 1.9 RC1 Signed-off-by: Keith Packard <keithp@keithp.com> commit a41d6e9bffbe56cfa1c3b84388a3d9f5a982f1a9 Merge: 7e8f100 f4190fe Author: Keith Packard <keithp@keithp.com> Date: Fri Jun 11 10:08:13 2010 -0700 Merge remote branch 'dottedmag/for-keithp' commit 7e8f1001217326cc451974bacf25275420c4bb4e Author: Éric Piel <E.A.B.Piel@tudelft.nl> Date: Fri Jun 11 09:16:32 2010 -0700 exa: fix ExaCheckCopyNtoN for exa_classic when source = dest In case you want to copy a region with source = dest, you have the same pixmap as source and dest. At the end of exaPixmapIsOffscreen_classic() the devPrivate.ptr is reset to NULL (look at the sources). Now this is what happens in ExaCheckCopyNtoN: exaPrepareAccess( pDst ); Calls IsOffscreen() sets devPrivate.ptr to NULL sets up devPrivate.ptr to real pointer Everything OK exaPrepareAccess( pSrc ); Calls IsOffscreen() sets devPrivate.ptr to NULL BAILS OUT CAUSE OF NESTED OPERATION SINCE DST EQUALS SRC We end up with devPrivate.ptr as NULL, and that is clearly wrong. In particular this fixes a segfault when using the psb driver (bug 28077) Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit f4190feb25ecc3d8278decc8bf28a5ef0e568942 Author: Matt Turner <mattst88@gmail.com> Date: Thu Jun 10 04:08:54 2010 +0700 Remove more superfluous if(p) checks around free(p) Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 89bd05106e5823fc5cfca9abf082729f2444363b Author: Matt Turner <mattst88@gmail.com> Date: Fri Jun 4 21:09:35 2010 -0400 record: move free() to after last use of pContext No functional change, since free doesn't change the value of the pointer passed to it, but it makes this code less confusing. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Matt Turner <mattst88@gmail.com> commit a54a766dfb39fb3df671045878ac706215d83cef Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jun 7 03:19:03 2010 +0700 xkb: replace xstrdup with strdup in Win32System The only caller of Win32System is XkbDDXCompileKeymapByNames. Add allocation check there to avoid passing NULL pointers to various functions down the code. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6e7417c342b0624e3f3c5686bb43026786423692 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 17:05:35 2010 +0700 config: Replace xstrdup with strdup in add_option() All callers of add_option pass string literal as "key" argument except one, where non-NULL condition is guarded by if(). Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit e4570f5db5157f4233454c938733a2a0d6a1cb8f Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 17:01:42 2010 +0700 xfree86: Get rid of xstrdup when argument is definitely non-NULL ditto for XFree86 Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 416d228481d71204cf9bfad3ab4773abc4757f79 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 17:01:25 2010 +0700 xquartz: Get rid of xstrdup when argument is definitely non-NULL ditto for XQuartz Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit eea286f2b9e4b1acf2b1c9800f5a4bc7c3fa968d Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 17:01:05 2010 +0700 xwin: Get rid of xstrdup when argument is definitely non-NULL ditto for XWin Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit dd45b7d74696cd4fe9545852640a3c2e66a808fd Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 17:00:46 2010 +0700 kdrive: Get rid of xstrdup when argument is definitely non-NULL ditto for Kdrive Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 16158366954d945db6263f6de505fc02ee03c6cd Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 17:00:15 2010 +0700 dmx: Get rid of xstrdup when argument is definitely non-NULL ditto for DMX Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 6592db6bb526f0c43b4c7b55859c629709e039b4 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 16:58:58 2010 +0700 Get rid of xstrdup when argument is definitely non-NULL Replace xstrdup with strdup when either constant string is being duplicated or argument is guarded by conditionals and obviously can't be NULL Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 620ca54aaa0b363fcf68cec1bd6c37e68c988352 Merge: fd69234 8ff9b50 Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 10 19:18:53 2010 -0700 Merge remote branch 'alanc/master' commit fd69234db004e98c663f5c6c4360d2cecaa8a4df Author: Keith Packard <keithp@keithp.com> Date: Sun Jun 6 15:21:28 2010 -0700 Ignore RandR timestamps harder Checking timestamps in post 1.1 randr requests was never a good idea, let's ignore them and just make the configuration changes. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Chase Douglas <chase.douglas@canonical.com> commit a8ec9eca850f2a7ad4c5cf31c1c011c120688496 Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 7 13:39:11 2010 -0700 Fix a couple more possible errors with input-only windows Using type == DRAWABLE_WINDOW to differentiate between pixmaps and windows isn't sufficient as input-only windows will end up in the pixmap case. This patch changes a few more code paths to use WindowDrawable instead. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 8ff9b502cfce3828f7855ffba7949d6ebee34031 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Jun 4 08:44:02 2010 -0700 Solaris: avoid memory leak if AGPIOC_INFO ioctl fails Move malloc after ioctl, so we don't have to worry about free'ing the memory if the ioctl fails. [ This bug was found by the Parfait bug checking tool. For more information see http://research.sun.com/projects/parfait ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit c5eb5d69e5183860185a05cfcce16af635cab9aa Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Jun 3 19:28:43 2010 -0700 Record some additional library dependencies in xf86 modules Helps with symbol resolution when building with -z defs Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 1c08a37e0eb4746e8974eb7a70ca4b7b84712963 Author: Sam Lau <sam.lau@oracle.com> Date: Thu Jun 3 19:17:14 2010 -0700 SecurityResource should not segfault when client owning resource has exited Fixes OpenSolaris bug 6949754: Xorg crashes when the magnifier is enabled at gdm login greeter window. http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6949754 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 07a093add0b7e40c4d9b9b59273e3ff9e14a88a7 Merge: 84190d2 dc61448 Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 10 18:39:10 2010 -0700 Merge remote branch 'whot/for-keith' commit dc614484f93b67e8b62dbb1bb2fd247fe5a4c850 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 10 12:21:36 2010 +1000 Xi: don't copy the modifier key count when copying device classes (#25480) The modifier key count is maintained by the XKB layer and increased/decreased for all modifiers that set state. Test case, MD/SD modifier key count in comment: 1. keyboard 1: press and hold Shift_L # SD:1 MD:1 2. keyboard 2: press and release Shift_L # SD:1,0 MD:1,0 <class copy happens> # SD:1 MD:1 3. keyboard 1: release Shift_L # SD:0 MD:1 4. keyboard 1: press and release Shift_L # SD:1,0 MD:2,1 The modifier is now logically down on the MD but not on keyboard 1 or keyboard 2. XKB is layered in before the DIX, it increases/decreases the modifier key count accordingly. In the above example, during (2), the MD gets the key release and thus clears the modifier bit. (3) doesn't forward the release to the MD because it is already cleared. The copy of modifierKeysDown when the lastSlave changes however increases the counter for the held key. On (4), the press and release are both forwarded to the MD, causing a offset by 1 and thus do not clear the logical modifier state. X.Org Bug 25480 <http://bugs.freedesktop.org/show_bug.cgi?id=25480> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit 7805e45284264b4cd286eece02e85426896e9f7b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 10 14:31:48 2010 +1000 config: remove redundant DBUS API define, require dbus-1 >= 1.0 It's still being pulled in by the HAL CFLAGS but the requirement to define this was dropped from DBus pre 1.0 (November 2006). This means we require dbus 1.0 now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 66b21b2f455a1dfbc92f7caa571dcff3f3765808 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:58 2010 -0700 xfree86: Match devices based on current driver setting Often we want to apply a driver specific option to a set of devices and don't care how the driver was selected for that device. The MatchDriver entry can be used to match the current driver string: MatchDriver "evdev|mouse" Option "Emulate3Buttons" "yes" The driver string is a case sensitive match. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a71bdff47d4cc80da6ceeb548db1dcc8e8b59702 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:57 2010 -0700 xfree86: Allow multiple InputClass Match* entries for && matching Currently when there multiple InputClass entries of the same type, only the last entry is used and the previous ones are ignored. Instead, multiple entries are used to create multiple matching conditions. For instance, an InputClass with MatchProduct "foo" MatchProduct "bar" will require that the device's product name contain both foo and bar. This provides a complement to the || style matching when an entry is split using the "|" token. The xorg.conf man page has added an example to hopefully clarify the two types of compound matches. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 842625928632ae767b0689fcdb5103c1779a4c91 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:56 2010 -0700 config: Script to convert HAL fdi settings to InputClass sections In the new world of udev and InputClass, x11_* settings from HAL fdi files will not be honored. This script converts those settings into valid InputClass sections that can be dropped into xorg.conf.d. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 87a1507da7e7788232d74285ef377b67b70e0fa4 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Thu Jun 10 06:15:41 2010 -0700 xfree86: Match devices based on USB ID Sometimes the vendor and product names aren't specific enough to target a USB device, so expose the numeric codes in the ID. A MatchUSBID entry has been added that supports shell pattern matching when fnmatch(3) is available. For example: MatchUSBID "046d:*" The IDs are stored in lowercase hex separated by a ':' like "lsusb" or "lspci -n". Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 645679c1523eee7028f3244cee57936b93326a2a Author: Dan Nicholson <dbn.lists@gmail.com> Date: Thu Jun 10 06:11:10 2010 -0700 xfree86: Match devices based on PnP ID Serial input devices lack properties such as product or vendor name. This makes matching InputClass sections difficult. Add a MatchPnPID entry to test against the PnP ID of the device. The entry supports a shell pattern match on platforms that support fnmatch(3). For example: MatchPnPID "WACf*" A match type for non-path pattern matching, match_pattern, has been added. The difference between this and match_path_pattern is the FNM_PATHNAME flag in fnmatch(3). Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 84190d20954ef7888e4d96832c2a4b3225b4dfa2 Merge: 4172aa1 5e1ef1f Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 10 13:36:35 2010 -0700 Merge remote branch 'jeremyhu/master' commit 4172aa137c1b9b6f2a25c320d847af1f5ac56fba Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 10 07:15:49 2010 -0700 dri2: Only deal with output windows and pixmaps. This reverts commit fdb081b430ddffb495aa5b05bcc4cf10882ff4b2 "dri2: Deal with input-only windows by using WindowDrawable()" and replaces it as follows: Reject the creation of a DRI2 drawable for UNDRAWABLE_WINDOW (input-only windows) and DRAWABLE_BUFFER (whatever those are) drawables and only look up privates for the supported drawable types. The rest of the the code can continue pretending there's only output windows and pixmaps, which are the only kinds of drawables relevant for DRI2. Fixes server crash with GLX compositing managers such as compiz or kwin, due to looking up a window private for a pixmap and getting a bogus pointer. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 353e32d3712f3a883a796ba562ec9fb5a8354837 Author: Jamey Sharp <jamey@minilop.net> Date: Sun Jun 6 06:42:11 2010 -0700 glxdriswrast bugfix: configure swapgc, not gc. I got this wrong in e2929db7b737413cf93fbebdf4d15abdfebff05c. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b3548612c7943011f79a910f9a59bb975984d8a6 Author: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Date: Sat Jun 5 13:09:28 2010 +0200 DRI2: Don't return junk reply instead of blocking in glXWaitForSbcOML() DRI2WaitSBC() didn't block if requested targetSBC wasn't yet reached. Instead it returned a xreply with uninitialized junk return values, then blocked the connection until targetSBC was reached. Therefore the client didn't block, but continued with bogus return values from glXWaitForSbcOML. This patch fixes the problem by implementing DRI2WaitSBC similar to the clean and proven DRI2WaitMSC implementation. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7287ef9e6cf953066e4a092cca9d0e4a279172bf Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sun Jun 6 21:18:40 2010 +0700 Remove unnecessary parentheses around return values in functions This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit d1b4beecbc16448282dcc825dd5c354e96e48eca Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:53 2010 -0700 xfree86: Add MatchOS InputClass entry for operating system matching Allow InputClass sections to match against the running operating system to narrow the application of rules. An example where this could be used is to specify that the default input driver on Linux is evdev while it's mouse/kbd everywhere else. The operating system name is the same as `uname -s`, and matching is case-insensitive. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9b30fa9f8fedb7ddb5672f93ed1a154d13578c47 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:52 2010 -0700 xfree86: Refactor InputClass matching code InputClassMatches was starting to get a little hairy with all the loops over the tokenized match strings. This adds code, but makes it easier to read and add new matches. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Jamey Sharp <jamey at minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d09bc8f8e5bb92899f7c90eab6b0907920c7d643 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:51 2010 -0700 xfree86: Constify InputClass functions Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 61c35d8ac4b6423caf2dcecb4ff25baaaaa14b1c Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:50 2010 -0700 config/hal: Missing newline in log message Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 697c5b010d7f6df0ec9cae6352b125c4cbdbaad3 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:49 2010 -0700 config/udev: Add verbose info when fetching udev properties Give the user a chance to see why their input devices are being ignored, even if they have to start the server with -logverbose. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 94547b2d1448232ae316c228d65482cc0b646ac2 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Jun 7 20:39:48 2010 -0700 config/hal: don't leak the input.tags property Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5e1ef1f4dde4615498c1c5e7a4e422c3b3432fe8 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Jun 8 13:01:10 2010 -0700 XQuartz: Add more sanity checking around string manipulation for xmodmap Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 0be81f9a163f2838448caee41b2dda274d73391a Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Jun 6 16:31:19 2010 -0700 XQuartz: Fix build regression from faeebead7bfcc78535757ca7acc1faf7554c03b7 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit b3a7b229e1e1f212bdd185af5443311091824005 Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 7 21:49:43 2010 -0700 Make DRI_SCREEN_PRIV just return NULL when DRI isn't initialized The code relied upon the previous devPrivate implementation which offered this convenience. Signed-off-by: Keith Packard <keithp@keithp.com> commit f7af00e9f0e0e1d854b0e882378c032518ab71ca Author: Ben Skeggs <bskeggs@redhat.com> Date: Mon Jun 7 10:21:18 2010 +1000 randr: prevent an unnecessary screen resize with multiple displays crtc->{x,y} is always 0 when xf86DefaultScreenLimits() is called, so we calculate too small an area for the initial framebuffer and force a resize to happen. This commit fixes the code to use desired{X,Y} instead, which contains the initial output positions. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8e97e5f9425639ad0a084150d0b232cad417595d Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 7 14:23:47 2010 -0700 If XTest is always required, then eliminate the XTest devPrivate The internals of XTest are used by Xi and Xkb, and both Xi and Xkb are always required, so it makes little sense to have XTest place data in a devPrivate, especially a devPrivate which is only available when the XTest extension is enabled. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit fdb081b430ddffb495aa5b05bcc4cf10882ff4b2 Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 7 00:54:18 2010 -0700 dri2: Deal with input-only windows by using WindowDrawable() Input only windows aren't DRAWABLE_WINDOW, but casting them to a PixmapPtr is a bit harsh, and unlikely to get the appropriate privates structure. use WindowDrawable instead which checks for both input-output and input-only windows. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Eric Anholt <eric@anholt.net> commit bc26665661565918af484ccd17caad951010df60 Author: Keith Packard <keithp@keithp.com> Date: Sun Jun 6 20:45:53 2010 -0700 Initialize private keys in test suite Make sure all of the private keys used by the test code are initialized before being used. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Robert Hooker <sarvatt@ubuntu.com> commit f03be727d647183a2176355ad0ac9a6735067be9 Author: Keith Packard <keithp@keithp.com> Date: Sun Jun 6 16:04:42 2010 -0700 Place glyph privates at correct location within the allocate storage A glyph allocation consists of : GlyphRec numScreens * PicturePtr glyph privates Tell the dix private bits to start past the picture pointers. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> commit 67b824a81bb8254827023de351a4a094031f0e94 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sun Jun 6 20:37:07 2010 +0700 randr: Make deletion of output properties more robust Previously there was two branches of code with small discrepancies between them (especially prop->valid_values field was not free(3)ed). Extract the common routine and fix double-free prop->valid_values in RRDestroyOutputProperty by the way. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 0a4d8cbdcd7b25313fb29ccdb498044af95f7de6 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sun Jun 6 15:28:30 2010 +0700 Remove more superfluous if(p) checks around free(p) This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 5a0fc0ad21d562612676ef88ef2d533b2391810a Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 15:35:31 2010 +0700 Replace deprecated bzero with memset Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> commit f9810ba914877b379cb36f1b9755f7923ceca14c Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 14:26:31 2010 +0700 xkb: Remove superfluous if(x) x = realloc(x, sz); else x = malloc(sz); logic Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 77ea20895ca1d163e14c6b767d8c287c94ba3114 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Fri Jun 4 14:22:06 2010 +0700 xkb: Remove superfluous if(p) checks around free(p) Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 5d4e2c594059ffb536c8e506c2623320d3c6a787 Merge: eacc421 793dd39 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 5 22:20:28 2010 -0700 Merge remote branch 'jamey/for-keith' commit 793dd399468ff3ba22ffa9c62fa54fc87261fbe7 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 15:08:38 2010 -0700 dmx: Split glx scalar swap variables from array swap variables. This makes hw/dmx/glxProxy/unpack.h more closely resemble glx/unpack.h, and fixes the "unused variable 'swapEnd'" and "unused variable 'swapPC'" warnings. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit eacc42132ed0f1e8f4a4d65a4b6637ab06f7e2aa Author: Kim Woelders <kim@woelders.dk> Date: Fri Jun 4 20:20:47 2010 +0200 dix: Remove test for obsolete NO_XINERAMA_PORT macro. Signed-off-by: Kim Woelders <kim@woelders.dk> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit a0fe6987b55b5326157b50e169b8d6b9ae26a1ae Author: Jamey Sharp <jamey@minilop.net> Date: Sat Jun 5 20:55:29 2010 -0700 Clean up after removal of screen parameters from region macros. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 424b593c7872a703d3d0c942b7e8acc0770eb023 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 5 21:34:51 2010 -0700 Damage pixmap private key was being mis-registered as a picture key This would cause all kinds of fun, in particular Xnest would crash at startup. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9c121ae45ae1d2ebd892c45e1631716ef5e7d649 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 5 21:34:27 2010 -0700 Register Xnest colormap screen private key This key is used to store the currently installed colormap and must be registered before we can use it. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit df534d05208436e9ca8c9b42acff3fbe240e3ec4 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 5 21:24:54 2010 -0700 Make GetPictureScreenIfSet check if Render is running This macro originally checked to see if the Render screen private index had been allocated. When the privates were changed the first time, there wasn't any need to check as dixLookupPrivate would simply return NULL in that case. Now that we care, check to see if the key has been initialized before asking for the value. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit e7fc8b32e41e10c057d2787fcc377296be67f2e9 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 5 21:08:01 2010 -0700 Move the shadow screen private key initialization to shadowSetup Some users of the shadow code don't call shadowInit, just shadowSetup and so make sure the key is initialized there. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6bd5f0d75bca727c4686b20eee166c8cae472ba2 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 5 21:07:15 2010 -0700 Fix exa_priv.h declarations of privates exa_priv.h exposes the privates to the rest of the exa code, and yet the declarations of the privates wasn't fixed when the exa.c versions were. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6b306f43384e5c2143197e746a5a39c4ebb2583c Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 5 20:58:04 2010 -0700 kdrive: Xv code uses shared screen private instead of kdrive-specific private When doing the devPrivate API conversion, I missed this as there was also a local private key which wasn't ever used. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit ab07e2b8ededaa2193fc199a8c09623d84032280 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 19:38:48 2010 -0700 Allocate per-screen device/cursor-bits private keys in midispcur midispcur was abusing the CursorScreenKey to index the cursor_bits privates, it also had a MAXSCREENS array of keys to index device privates. Switch both of these to the new dixCreatePrivateKey API and store a pointer to that in the screen private. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 34db537907c6cb2635dbefdce7dcfcae90f7c902 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 19:36:33 2010 -0700 Add dixCreatePrivateKey API Keys need to persist through server reset so that the private system can be cleaned up in dixResetPrivates. In particular, this means that keys cannot live in objects freed at reset time. This API provides suitable object lifetime by having the privates code free the key in the reset path. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 495fc3eb2d6c98bde82ae1278f89fcf131fd9bf8 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 19:38:38 2010 -0700 Change devPrivates implementation. Each key now declares which object type it belongs to, this permits keys for different types to share the same offset within the allocated privates. As a special case for XSELinux, a key may be allocated as PRIVATE_XSELINUX which will allow it to continue to be used across the relevant object types. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit faeebead7bfcc78535757ca7acc1faf7554c03b7 Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 26 17:22:21 2010 -0700 Change the devPrivates API to require dixRegisterPrivateKey This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit c865a24401f06bcf1347d8b41f736a066ab25693 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 22:05:27 2010 -0700 Create separate private key for midispcur cursor bits The CursorScreenKey array is supposed to be used by the DDX for cursor private data, but midispcur was abusing it to hold cursor bits private information. Create a separate set of privates for the dispcur cursor bits information. This also renames the device private index and macros to better reflect their usage: miDCSpriteKey -> miDCDeviceKey MIDCBUFFER -> miGetDCDevice Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 431781a921251d54782f0a4f194bbef1fabd1380 Author: Keith Packard <keithp@keithp.com> Date: Sat May 15 14:52:39 2010 -0700 Remove dixRegisterPrivateOffset; hard-code devPrivates offsets instead For predefined resource types, the offset of the devPrivates field was already kept in a constant table. The only non-predefined type needing this treatment was dbeDrawableResType, which is just a magic alias for RT_PIXMAP. This patch special-cases looking up RC_DRAWABLE offsets and uses the table directly for everything else. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 7ef612de784daaed09ba13f4615c10714614033f Author: Keith Packard <keithp@keithp.com> Date: Fri May 21 12:35:29 2010 -0700 Add REGION_ macros for source compatibility with existing drivers. This makes the region code changes source compatible with existing code, although none of them are used within the server source itself. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 965cade6ee7c226f850e806cb2e910793d1536f9 Author: Keith Packard <keithp@keithp.com> Date: Fri May 21 12:18:22 2010 -0700 Change region implementation from macros to inline functions. This makes all of the previous macros into inline functions and also turns all of the direct calls to pixman region code into inline functions as well. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2dc138922b7588515d5f2447e4b9dcdc0bef15e0 Author: Keith Packard <keithp@keithp.com> Date: Fri May 21 15:05:48 2010 -0700 Rename region macros to eliminate screen argument This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit d17e726e89ef644310de77b960b715c2d11088da Author: Keith Packard <keithp@keithp.com> Date: Sat May 22 00:09:47 2010 -0700 Move mi/miregion.c to dix/region.c Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9b6f5f549dfe4c20e3cb3c2ef7095ab47abaca3b Author: Keith Packard <keithp@keithp.com> Date: Fri May 21 11:14:59 2010 -0700 Change region implementation names to eliminate the 'mi' prefix This prepares the file to be moved from mi to dix. This patch was done mechanically with the included scripts 'fix-miregion' run over the entire X server and 'fix-miregion-private' run over include/regionstr.h and mi/miregion.c. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1768e51976ae8949d999309bd2384ccad72deecd Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Jun 5 15:58:21 2010 -0700 rootless: Fix SetShape regression This fixes a regression in miext/rootless from 643cb6e87c10ab554c03ada81930001a8ebcc909 Found-by: tinderbox Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6b4af3b7925978cd79f717761f1b6f33bd8dfbaf Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Fri Jun 4 16:27:28 2010 +0300 configure: Check for libsha1.pc xserver fails to detect libsha1. Problem is that configure checks for sha1.pc when libsha1 provides libsha1.pc. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit d163266692235261e1e0cfa6b900f54e6ec63de5 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Jun 3 18:59:04 2010 -0700 Stop searching for XF86Config files xorg.conf has been used since the X11R6.7 release in April 2004. 6 years has been a generous transition period for users to "mv XF86Config xorg.conf" and for distros to update their configuration tools and packages. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: James Cloos <cloos@jhcloos.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 01c75522b6ed15e979347acd38e234e2cb9006c3 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Jun 3 18:59:03 2010 -0700 Stop searching for XF86Config files xorg.conf has been used since the X11R6.7 release in April 2004. 6 years has been a generous transition period for users to "mv XF86Config xorg.conf" and for distros to update their configuration tools and packages. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: James Cloos <cloos@jhcloos.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7f19a7a6e90a4fd7b7ec0256974f62e575218541 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 4 14:15:04 2010 +1000 xkb: fix invalid memory writes in _XkbCopyGeom. Classic strlen/strcpy mistake of foo = malloc(strlen(bar)); strcpy(foo, bar); Testcase: valgrind Xephyr :1 ==8591== Invalid write of size 1 ==8591== at 0x4A0638F: strcpy (mc_replace_strmem.c:311) ==8591== by 0x605593: _XkbCopyGeom (xkbUtils.c:1994) ==8591== by 0x605973: XkbCopyKeymap (xkbUtils.c:2118) ==8591== by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560) ==8591== by 0x4472E2: CoreKeyboardProc (devices.c:577) ==8591== by 0x447162: ActivateDevice (devices.c:530) ==8591== by 0x4475D6: InitCoreDevices (devices.c:672) ==8591== by 0x4449EE: main (main.c:254) ==8591== Address 0x6f96505 is 0 bytes after a block of size 53 alloc'd ==8591== at 0x4A0515D: malloc (vg_replace_malloc.c:195) ==8591== by 0x6054B7: _XkbCopyGeom (xkbUtils.c:1980) ==8591== by 0x605973: XkbCopyKeymap (xkbUtils.c:2118) ==8591== by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560) ==8591== by 0x4472E2: CoreKeyboardProc (devices.c:577) ==8591== by 0x447162: ActivateDevice (devices.c:530) ==8591== by 0x4475D6: InitCoreDevices (devices.c:672) ==8591== by 0x4449EE: main (main.c:254) Reported-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by-and-apologised-for: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 959a1eaf1c15a691141f1b0dc53757fe9b6e9b13 Author: Dave Airlie <airlied@redhat.com> Date: Fri Jun 4 11:09:46 2010 +1000 composite: use config notify hook to do pixmap resize. Since reallocating the backing pixmap can fail, we need to try and do it before any other side effects of reconfiguring the window happen. This changes the ConfigNotify hook to return status, and moves the composite window reconfiguration wrappers to ConfigNotify. They all basically did the same thing, so we can drop the MoveWindow, ResizeWindow, ChangeBorderWidth wrappers, and allow ConfigNotify to do all the work. If reallocation fails we fail before we send any confiureNotify events, or enter the area we can't recover from. The only place we now enforce 32k limits are in EXA/UXA/fb, so drivers that don't use this should probably deal with it in their pixmap allocate if they don't already. This also breaks ABI, so we need an alternate fix for older servers, working on the X server makes me realise why I'm a kernel hacker. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0f12e86e600522768f5f64eafc1230526e700ab7 Merge: aa7c09f f114f54 Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 3 15:09:32 2010 -0700 Merge remote branch 'jamey/for-keith' commit f114f54986aca1add4c8808a05d9692e289547e7 Author: Jamey Sharp <jamey@minilop.net> Date: Fri Apr 23 19:33:49 2010 -0700 Accumulate graphics exposures incrementally in PanoramiXCopyArea/Plane. This fuses two loops in each function, eliminating an intermediate MAXSCREENS-sized array from each. Aside from being more efficient, I believe this is equivalent to the previous implementation, since - each per-screen GC has the graphicsExposures flag set the same way, and - the REGION_* macros ignore their screen argument. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) commit a7c7ebe4b3a0df1a4d1ffe3c690cfb21470f103d Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 22 21:13:48 2010 -0700 Delete XineramaScreenRegions cache. Every screen region consists of a single rectangle, so initializing a stack-allocated region for each screen on-demand does no heap allocation and is fast. This eliminates a MAXSCREENS-sized array. The REGION_UNINIT calls are no-ops since no boxes are actually allocated for a single-rectangle region, but it seemed wiser to include them. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) commit a0456da339fa9b3c3e6fead060338ee7348d6460 Author: Jamey Sharp <jamey@minilop.net> Date: Sun May 23 12:57:52 2010 -0700 XineramaSetCursorPosition: use screen bounds directly, not POINT_IN_REGION. This hides a MAXSCREENS-sized array as an implementation detail of panoramiX.c rather than an exported global. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) commit a83cff9f4d622b069c96a68b4e87a669bf1f6446 Author: Jamey Sharp <jamey@minilop.net> Date: Sun May 23 10:11:47 2010 -0700 Move each screen's x/y origin into ScreenRec. Many references to the dixScreenOrigins array already had the corresponding screen pointer handy, which meant they usually looked like "dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix declared the dixScreenOrigins array, I figure allocating a screen private for these values is overkill. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) commit 217ccaa5a341018457f468a774c035c0df47d918 Author: Jamey Sharp <jamey@minilop.net> Date: Sun May 23 11:05:01 2010 -0700 Delete panoramiXdataPtr: it's redundant. This eliminates a dynamically-allocated MAXSCREENS-sized array. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) commit e7fae9ecc42ab5e73b89117722dbf4117d928f9a Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 22 00:26:28 2010 -0700 Move each screen's root-window pointer into ScreenRec. Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) commit 80b5d3a3264d2c5167e5ac85a3b04af0f89cece1 Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 21 23:13:51 2010 -0700 Move each screen's screensaver data into ScreenRec. Most references to the savedScreenInfo array already had the corresponding screen pointer handy, which meant they usually looked like "savedScreenInfo[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux) commit 5030540d6cd2aa9bbd4ecb7f4487616f9ef0140a Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 27 11:50:52 2010 -0700 midispcur: Add comment explaining why pRootPicture must not be freed. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit f308cbea8c9fa5c5c6705bc301178b167de450d5 Author: Jamey Sharp <jamey@minilop.net> Date: Mon May 24 18:41:54 2010 -0700 mi: Delete unused flicker-free MoveCursor code. It's been commented-out for three and a half years and nobody seems to be missing it enough to resurrect it. Besides deleting code that is untested and therefore buggy, this saves a little memory for each pointer device on each screen. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit d1bad1b59f24ab4dcf2d1ce1c5d4f42b5fa40bc1 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 14:25:07 2010 -0700 dmx: Fix XSetExtensionErrorHandler calls to agree on constness. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit aa7c09f7d04d59852b850b2b6993f4cbdc7ec940 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Wed Jun 2 14:31:56 2010 -0700 Install fbdevhw module in normal module directory instead of linux/ Since we no longer support OS-independent custom elfloader modules, we don't need to put the OS-dependent modules into os-specific subdirs any more. We do however still need to install the stubs version of this module on non-Linux platforms, since a number of drivers link to functions in it, even when built on non-Linux platforms. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b13d7a8e09c8e3eb5003420c3c0484431e5a052b Merge: f0ab726 dcceb90 Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 3 07:01:26 2010 -0700 Merge remote branch 'vignatti/for-keith' commit dcceb90b1dccbbf5793f6ba1ed857013b71dafbc Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed May 19 11:45:46 2010 +0200 xext: delete wrong source reference from fontcache This should go away in 0b45ba48. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit c043de3261b6e14f2446b2cd9d62dde5860d4720 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon May 3 12:37:25 2010 +0200 configure: sha1: check libsha1 using pkg-config instead Previously the code was using AC_CHECK_LIB, guaranteeing whether the library is correct by tracking sha1_begin function. This paranoic checking is not necessary given there's only one libsha1 in the market, which surely contains such function. Moreover, this patch now improves a bit the sha1 implementation checking behavior using pkg-config to find the right flags that needs to link against. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit f0ab726d8966cab4e50154c216d577db79328d77 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Wed Apr 21 11:07:47 2010 +0300 DRI2: Use single error path in initialization Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit 6eef70dc56bcc1e3047e4e488bcd6ae62c8ffac6 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jan 22 18:34:36 2010 +0200 DRI2: Allow building without libdrm Some drivers use DRI protocol but implement their own kernel rendering manager. For these drivers, libdrm becomes useless. --disable-libdrm configure parameter can be used to disable libdrm support in dri2. To provide ABI/API compatibility for libdrm based drivers, libdrm call is wrapped in ifdef. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit cdcb575664d3d60b662c542e782de83a047165c9 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jan 22 17:58:17 2010 +0200 DRI2: add AuthMagic hook for driver side support With this new hook, drmAuthMagic becomes useless and should be deprecated. You might want to implement AuthMagic on driver side instead. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit 643cb6e87c10ab554c03ada81930001a8ebcc909 Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Thu May 27 09:11:50 2010 -0700 Only deal with input code when changing the input shape. Propagate the shape kind all the way to SetShape to avoid performing non-input operations such as revalidating the tree and generating exposures when only changing a window's input shape. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Acked-by: Aaron Plattner<aplattner@nvidia.com> Reviewed-by: Daniel Stone<daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit d90f2cd98a97e6534792d3867b3fba70d850b706 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu May 27 13:26:23 2010 +0100 xfree86: Unbreak autoconfig following 0abf065e38c4 The move of the PCI device id probing into a separate file neglected to return the number of found devices, and so the PCI devices were being overwritten by the default entries for vesa and fbdev. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tiago Vignatti <tiago.vignatti@nokia.com> Cc: Alex Deucher <alexdeucher@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1304b8b27cb12c803c4f51f04cb6f9d508b82c69 Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri May 28 09:35:54 2010 -0700 Fix pixmap validation in miDbePositionWindow. miDbePositionWindow allocates two pixmaps: a front buffer, and a back buffer. If the buffers are supposed to be initialized, it validates a GC against the front buffer, then uses it to fill and/or copy both the front buffer *and* the back buffer, without revalidating. If the acceleration architecture needs different GC funcs for the two pixmaps -- for example if allocation of the front buffer exhausted video memory -- then this can cause crashes because the GC is not validated for the back buffer pixmap. Fix this by performing the rendering for the front buffer first, then revalidating against the back buffer before performing the back buffer rendering. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 91a6359caf24d94343ff76f43ea7b7fc3223203d Author: Dave Airlie <airlied@redhat.com> Date: Thu Jun 3 12:16:40 2010 +1000 composite: initialise pOldPixmap to NullPixmap at alloc time. We just never initialised the malloced value. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 968a79dcf5e17ac3963953ef56b8f94dbd75323b Author: Nicolas George <nicolas.george@normalesup.org> Date: Wed Jun 2 13:40:51 2010 +0200 Change keyboard controls on slave keyboards (#27926) Makes the use of IsMaster in ProcChangeKeyboardControl consistent with other similar loops. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 108b766c31b57fb1955d34d85673a235c7f743aa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 20 11:04:53 2010 +1000 xfree86: initialize InputAttributes to NULL in the autoconfig code. Reported-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 151659f9636088fd70bc5586de97bf43ee706180 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 24 16:24:03 2010 +1000 test: fix up InputAttributes helper function test. Just some extra clarification as pointed out by Dan Nicholson, and that memcpy should have been a memcmp. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> commit 6cccf0131c8464d8838cae2200730873d7dd9e45 Author: Peter Korsgaard <peter.korsgaard@barco.com> Date: Tue May 25 11:03:28 2010 +0200 dix: add 3x3 transformation matrix xinput property for multi-head handling For absolute input devices (E.G. touchscreens) in multi-head setups, we need a way to bind the device to an randr output. This adds the infrastructure to the server to allow us to do so. positionSprite() scales input coordinates to the dimensions of the shared (total) screen frame buffer, so to restrict motion to an output we need to scale/rotate/translate device coordinates to a subset of the frame buffer before passing them on to positionSprite. This is done here using a 3x3 transformation matrix, which is applied to the device coordinates using homogeneous coordinates, E.G.: [ c0 c1 c2 ] [ x ] [ c3 c4 c5 ] * [ y ] [ c6 c7 c8 ] [ 1 ] Notice: As input devices have varying input ranges, the coordinates are first scaled to the [0..1] range for generality, and afterwards scaled back up. E.G. for a dual head setup (using same resolution) next to each other, you would want to scale the X coordinates of the touchscreen connected to the both heads by 50%, and translate (offset) the coordinates of the rightmost head by 50%, or in matrix form: left: right: [ 0.5 0 0 ] [ 0.5 0 0.5 ] [ 0 1 0 ] [ 0 1 0 ] [ 0 0 1 ] [ 0 0 0 ] Which can be done using xinput: xinput set-prop <left> --type=float "Coordinate Transformation Matrix" \ 0.5 0 0 0 1 0 0 0 1 xinput set-prop <right> --type=float "Coordinate Transformation Matrix" \ 0.5 0 0.5 0 1 0 0 0 1 Likewise more complication setups involving more heads, rotation or different resolution can be handled. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e4582d9e5c8649347742a13eae68cf27005296fc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 27 10:42:54 2010 -0400 xfree86: bump ABI_XINPUT_VERSION to 11. commit c2d0b3b437b7ce6ce975f2ead4d8bb8295ef0ddc "xfree86: store the InputAttributes in the input device." introduced the new API. Bump the input version so drivers can handle this appropriately. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit cd0ef0b6a2f9c6bfeda98684569da922792d3feb Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 14:30:22 2010 -0700 dmx: Delete unused ChangeKeyboardDevice/ChangePointerDevice. Daniel Stone deleted the API for these in 2006, in commit 96e32805d12fc36f0fa0926dbfb0dd8a5cadb739. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 70454864917f534483fa049e067b5646df61c88a Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 14 12:31:44 2010 -0700 Ignore build products in the server's test suite. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8bb88379d95356384e233225bfda6abfd71389b4 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 15:52:18 2010 -0700 dmx: Remove dead __glXDispSwap_DrawArraysEXT definition. Eric Anholt made the corresponding fix in glx/render2swap.c in commit 49d38ab2328c409b2a98465b52677af057121513. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit c97a3ade5a8718b063292c73a31aac2196fe2452 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 15:17:30 2010 -0700 dmx: Delete unused local variables. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3c3d099fc10c63d746f90c08043d45180d6a7226 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 13:44:32 2010 -0700 dmx: Xfree -> free Mikhail fixed the corresponding Xallocs, but missed these uses of Xfree in commit 3f3ff971ecff9936cebafc813af9193b97bba89c. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 01ca6400d949a873c0bb5de7e0dbf138e8a7949b Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 14:02:34 2010 -0700 Xephyr: Fix Xcalloc deprecation warnings. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 34df659687ad3936ab03d19ce8fdb21f385c2e8a Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 11:51:32 2010 -0700 xfree86/int10/helper_mem: Fix log message. Three years ago in commit f62beb6f3609e8b6e61325ac89017590811bbd07 ajax deleted the code that could have set this format string to anything else, so just use the format string literal. This makes GCC happy since it can check the argument types, which, by the way, weren't correct since this format string doesn't need any arguments. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 0a98d9e6cec7c611a3c56f97d4ddc0c546975c55 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 25 10:30:58 2010 -0700 xf86bigfont: Silence compiler warning by initializing pDesc. Access to pDesc was always guarded by (nCharInfos > 0), so the code wasn't actually buggy, but this makes it clear that it's correct. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 4e9d3e413245e7c01c2ff3c0f130b8967754131b Author: Keith Packard <keithp@keithp.com> Date: Wed May 26 07:54:35 2010 -0700 Revert "Add a "flags" field to DeleteInputDeviceRequest." Peter wants to get a larger patch sequence put together and I didn't read past the commit message to see the 'don't take this patch please'. This reverts commit 531ff40301975519af7b20109c17d296312d3f2b. commit 531ff40301975519af7b20109c17d296312d3f2b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 20 18:07:12 2010 +1000 Add a "flags" field to DeleteInputDeviceRequest. Some input drivers need to implement an internal hotplugging scheme for dependent devices to provide multiple X devices off one kernel device file. Such dependent devices can be added with NewInputDeviceRequest() but they are not removed when the config backend calls DeleteInputDeviceRequest(), leaving the original device to clean up. Example of the wacom driver: config/udev calls NewInputDeviceRequest("stylus") wacom PreInit calls NewInputDeviceRequest("eraser") NewInputDeviceRequest("pad") NewInputDeviceRequest("cursor") PreInit finishes. When the device is removed, the config backend only calls DeleteInputDeviceRequest for "stylus". The driver needs to call DeleteInputDeviceRequest for the dependent devices eraser, pad and cursor to clean up properly. However, when the server terminates, DeleteInputDeviceRequest is called for all devices - the driver must not remove the dependent devices to avoid double-frees. There is no method for the driver to detect why a device is being removed, leading to elaborate guesswork and some amount of wishful thinking. Though the input driver's UnInit already supports flags, they are unused. This patch uses the flags to supply information where the DeleteInputDeviceRequest request originates from, allowing a driver to selectively call DeleteInputDeviceRequest when necessary. Also bumps XINPUT ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c2d0b3b437b7ce6ce975f2ead4d8bb8295ef0ddc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 25 17:15:32 2010 +1000 xfree86: store the InputAttributes in the input device. InputAttributes largely decide which configuration values get merged from the xorg.conf.d snippets. While they are available in the config backend, they are not available for any other callers of NewInputDeviceRequest(). Drivers implementing driver-side hotplugging do not have access to these attributes and cannot have xorg.conf.d snippets specific to dependent devices. For example, the following case cannot work right now: Section "InputClass" MatchProduct "Wacom" Option "PressCurve" "0 0 100 100" ... EndSection Section "InputClass" MatchProduct "Wacom" MatchProduct "eraser" Option "PressCurve" "10 10 50 50" ... EndSection The second section is not triggered, as the wacom driver cannot supply the InputAttributes to NewInputDeviceRequest(). Add the attributes to the IDevRec and merge them into the InputInfoRec to make them accessible in the driver. This changes the ABI for input drivers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 86303a338ad563d0b986a3c052104301c310c4ac Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 25 17:12:34 2010 +1000 dix: add helper functions to duplicate and free InputAttributes. No special memory handling is used to give drivers the maximum flexibility with the data. Drivers should be able to call realloc on the product string if needed and perform similar operations. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit bf78e11839f8278020b604672ff7c3d194232be9 Author: Jamey Sharp <jamey@minilop.net> Date: Mon May 24 09:15:32 2010 -0700 midispcur: Construct Picture objects lazily in case Render is disabled. Reverts part of the effects of 518f3b189b6c8aa28b62837d14309fd06163ccbb, "mi: don't thrash resources when displaying the software cursor across screens". The per-screen cache is preserved, and the GCs are still allocated eagerly, but now it doesn't construct pRootPicture until somebody attempts to draw an ARGB cursor. I noticed crashes in Xnest, which doesn't support the RENDER extension, but I suspect other DDXes that support disabling that extension would have had issues as well. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> commit bf9b64eefbadbf299d3b841c1890bfcaef5aab1b Author: Jamey Sharp <jamey@minilop.net> Date: Mon May 24 09:14:27 2010 -0700 xnest: Don't ignore errors from DeviceCursorInitialize. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit b11465a6ecdc2b8373e6fc8af427edc4602bcaa1 Merge: 7c085ae 0abf065 Author: Keith Packard <keithp@keithp.com> Date: Mon May 24 22:18:31 2010 -0700 Merge remote branch 'vignatti/bus-cleanup-take2' commit 7c085aebfedeb621a6fbeb3f09f4fcc640452044 Author: Jamey Sharp <jamey@minilop.net> Date: Mon May 24 11:45:42 2010 -0700 xfixes: Remove the invisible cursor sprite, using NullCursor instead. Oliver McFadden reports that the invisible cursor sprite caused damage events and thus unnecessary redrawing, so removing it improves performance when using software cursor sprites, especially on those devices where you do not want a visible cursor: touchscreen tablets, embedded devices, etc. For the xfree86 DDX, if hardware cursors are used, the driver is required to provide a HideCursor function, which will be called instead of trying to set a null cursor. I think software cursors are already safe. The other DDXes also look safe. As far as I can tell, there's no reason to realize a null cursor. I think everything that handles null cursors doesn't rely on any setup in RealizeCursor, and treats them as empty cursors. Xnest assumes that if a cursor is created, it will be realized before it is freed, which didn't happen if the invisible cursor was never used in a server generation. So this fixes a segfault in Xnest as well. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Tested-by: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0abf065e38c4c48917054eb3e39e12bd20e6e8ec Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu May 20 19:24:47 2010 +0300 xfree86: move all pci code from auto configurator into a meaningful location This patch creates the private xf86PciMatchDriver hook, which goes inside pci code to match the drivers found in the system. Now there's no direct references to PCI inside xf86AutoConfig.c anymore. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 0ceac6f64f5ad9bc2ac4b19be2dd245ffba78b05 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu May 20 18:23:24 2010 +0300 xfree86: no need to check for the configuration case when matching devices xf86MatchDevice will never be called in configuration time. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit b0eef1101815b08da2d375af7bec2be3136cf713 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu May 20 18:19:14 2010 +0300 xfree86: organize and group all pci related stuff inside xf86.h Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 47df5a489ea69a68e753367423bfbe8830521f4e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu May 20 17:39:59 2010 +0300 xfree86: remove BUS_ISA type given we don't support anymore Should go together within commit df14682a. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 9d000a5509e0a356ee33ad08e4dc967a2ef8cbe0 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu May 20 16:52:37 2010 +0300 xfree86: remove all kind of bus and PCI dependency from the common helper file Move all PCI procedures from xf86Helper.c to a more meaningful place (namely xf86pciBus.c). xf86Helper.c is free of PCI code now. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 610009cf39984f2f5e818a221b626f7af10bd90e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue May 18 20:54:28 2010 +0300 xfree86: bus: remove useless field from EntityRec RAC is the champion of remaining trash for sure! Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 95889a569feabd3f803afb92950d067bd76e7397 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue May 18 20:48:35 2010 +0300 xfree86: bus: delete useless xf86FindPrimaryDevice This function had a wrong name and was just logging the primary device. No one cares about it honestly. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit f6865909485d7d282c8131a2ae306143ad51ba2b Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue May 18 19:39:31 2010 +0300 xfree86: bus: remove unused headers Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 111b1fff1ca69724a8350c4375089c312329c378 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue May 18 19:35:10 2010 +0300 xfree86: bus: remove unused pci macros Should be gone in commits 3c03d9f1 and a9d7d659a respectively. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 2ffffb4daf6161e6a22d81442ecf6209acc9e975 Merge: b5e0f6d d530608 Author: Keith Packard <keithp@keithp.com> Date: Sun May 23 23:22:08 2010 -0700 Merge remote branch 'alanc/docs' commit b5e0f6d8f45c5b24eb50b305c66fa80c783ef488 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 24 12:25:15 2010 +1000 xfree86: fix multiple InputAttributes tag matching. attr->tags is an array of strings (null-terminated). When matching, match against each string instead of each [i,end] substring in the first tag. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit d5306084b57583c670c56ce9e7d3c78cca7aa07b Author: Brice Goglin <bgoglin@debian.org> Date: Sat May 22 20:29:02 2010 +0200 Remove obsolete reference to README.DRI in xorg.conf.man Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 89dd7d2b6fe18f32c2f9336c3d8cd9f35490e5ae Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat May 22 10:33:04 2010 -0700 Remove ancient documentation of IBM RapidAccess keyboard hack Keyboard setup belongs in drivers, not in a document no one sees because we don't even install it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> commit 480fcdf0335abae0ee544b022c7985211eee462f Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat May 22 10:29:47 2010 -0700 Remove completely out-of-date README.DRI The license only allows distribution of verbatim copies, so we can't update it, even to correct the incorrect address to send updates to. The Mesa & DRI web pages are much better sources of current information anyway. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 1805c74d9b0ed46802481bcd6beea5feeb60212c Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat May 22 10:29:00 2010 -0700 Add RandR 1.2 README.modes doc to EXTRA_DIST Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 5939e39a641773a36c22104e1184143678dca7a2 Author: Dave Airlie <airlied@redhat.com> Date: Mon May 24 09:31:51 2010 +1000 xf86: allow for no outputs connected at startup operation. When nothing is connected at startup and we canGrow, allow the server to start with a 1024x768 framebuffer, and when the drivers send hotplug events this will expand to the correct size dynamically. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b9f48d60bc0c839bd323c582231e8e7e2b810af6 Author: Jamey Sharp <jamey@minilop.net> Date: Wed May 19 10:44:33 2010 -0700 Device init: Don't crash when CreateGC fails. ActivateDevice was ignoring errors from DeviceCursorInitialize, so cursor-related calls failed later. Jeremy Huddleston saw that crash in miPointerConstrainCursor, while with Xvfb I saw it in miSpriteRealizeCursor. miDCDeviceCleanup frees any non-NULL GCs. miDCDeviceInitialize calls Cleanup on any failure, but if it failed early then some of the pointers in the miDCBufferPtr were garbage. Switch from malloc to calloc to ensure everything's initialized safely first. With these two fixes, if CreateGC fails then the server gracefully fails in FatalError instead of segfaulting. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit c51534961e1bb4c68ff881758862d2f85f572ce7 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat May 22 11:11:48 2010 -0700 xorg-server.pc Requires: xproto >= 7.0.17 Since the headers we export in the SDK use the _X_NORETURN #define introduced in xproto 7.0.17, drivers built with the SDK will also need to have at least that version of xproto installed. I considered exporting the version from configure.ac, but decided not to since the minimum required to build the X server may not always be the same as the minimum required to build drivers (for instance, if the X server used a new #define in its .c files or internal headers, but didn't export it in any of the SDK headers). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit e90f20eed394de2200aba42bd61fd31c1067ac33 Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 21 22:16:50 2010 -0700 Declare functions that unconditionally call FatalError as _X_NORETURN. For AtomError, this should fix a clang warning; in the other cases it's just good documentation. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9d31d5b639c2a6ab8b1a80a0e2f0ee2c4f8cddd3 Author: Adam Jackson <ajax@redhat.com> Date: Mon May 10 11:48:31 2010 -0400 vfb: Remove dead variable and header file Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit d8cbcbc01d1355d55c1c0af64f7f7f61629f6c61 Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 21 11:12:26 2010 -0700 doPolyText: forget about FontChange's XID after looking up pFont. As of e2929db7b737413cf93fbebdf4d15abdfebff05c, doPolyText uses pFont consistently rather than looking it up again from the saved XID. clang noticed that "oldfid = fid" could run when fid hadn't been initialized yet. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 989db930d739483759087b13b8d9a043299feafb Author: Aaron Zang <Aaron.Zang@Sun.COM> Date: Thu May 20 17:56:28 2010 -0700 Solaris: Use VT_SET_CONSUSER ioctl to set Console User rights profile When Xorg is started on display :0, this ioctl is called to grant the user the rights traditionally associated with /dev/console (before VT support was added), such as access to local peripheral devices. Also adds a Solaris-specific -C flag to force starting on /dev/console instead of /dev/vt*, allowing programs like xterm -C to access the console device. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 98553e52a14b97a03aef8dc4fc0300b3f4c2c4b5 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu May 20 17:56:27 2010 -0700 vbe.h: Use __attribute__((packed)) on Sun cc 5.9 & later as well as gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7b09335a46f9428141811230c69eef7968531359 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu May 20 17:56:26 2010 -0700 Xserver(1) man page updates - Note that -br is now default. - Move -bs after -br for alphabetical ordering. - Remove -config option that's been hidden in "ignore" section, since ajax removed the -config code a couple years back. - Add -nocursor option. - Add xinput & xrandr to list of runtime server control programs - Replace XDarwin with Xquartz in list of Xservers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit cf4f3d051858aadedd6e333bb317a1daa3987ad7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 21 13:30:25 2010 +1000 dix: remove obsolete comment.from EnableDevice. The code this comment was referring to was removed in 8b5086250aa5dae8de8b763408ff480d7beac819 "Eliminate bogus event resizing." Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5754e66044571d549c295b7c9e02ce3348dbe3c7 Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 20 10:46:43 2010 -0700 Replace screen->rgf scratch GC flags with a bit in each GC. This eliminates a poorly-named, poorly-documented field from the ScreenRec, using a previously-unused flag bit in each GC instead. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5a7275d78a2f1c20ed5bb7b228cf370c4ada22c9 Author: Keith Packard <keithp@keithp.com> Date: Thu May 20 13:57:02 2010 -0700 Find windows GL wrapper files in $(srcdir) instead of . This fixes 'make distcheck' for me. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 1197a87b5638037cc48084fba4eec9d3b599e900 Author: Keith Packard <keithp@keithp.com> Date: Thu May 20 13:40:24 2010 -0700 winpriv.h was moved from hw/xwin to hw/xwin/glx in November hw/xwin/Makefile.am was referencing this instead of hw/xwin/glx/Makefile.am Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 1cad520f3f1d9d520422e3e4d5d8f4ea85a212a4 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon May 17 20:35:10 2010 -0700 XFree86 Design doc: Convert LinuxDoc ``quotes'' to DocBook <quote> tags Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> commit 8367913be3305be4f03d095615d3885107094427 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri May 14 22:05:50 2010 -0700 XFree86 Design doc: Explain this version covers the current Xorg release Update the title & preface to explain that while this was originally the XFree86 4.0 design, we've changed a lot since forking. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> commit 78fe4be4c43db1f07a30e8a6c9a17f81c1082d76 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon May 17 20:27:10 2010 -0700 Show Xserver release/version date in DIX & DDX docs Uses a fake absolute path to the entity definition files so that the xmlto --searchpath will work for finding the actual path Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> commit 2bdc73bcf41ff0c10e70ecc15fc8b8333af6db65 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri May 14 15:33:46 2010 -0700 Move Xserver-spec.xml from xorg-docs to doc/xml Allows keeping it in sync with the sources it documents, and to be released with them Requires the previous patch to convert the Xserver tree from LinuxDoc to DocBook for SGML/XML documents. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Tested-by: Gaetan Nadon <memsize@videotron.ca> commit fc6ebe1e1d3057378f61f992549a98e67a04dc6c Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri May 14 14:56:09 2010 -0700 Convert LinuxDoc documents to DocBook/XML Only the markup/formatting is changed - the contents should still be wildly out of date for now. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Tested-by: Gaetan Nadon <memsize@videotron.ca> commit ebd745ced89b2a2d9f6b4dcbd9f5f7e7f3b35451 Author: Simon Farnsworth <simon.farnsworth@onelan.com> Date: Thu May 20 09:58:38 2010 +0100 Add documentation for the new DefaultModes option This patch adds documentation for the DefaultModes monitor option added in the previous patch. Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit cfc629148891be317ba60f2495abcda485780191 Author: Simon Farnsworth <simon.farnsworth@onelan.com> Date: Thu May 20 09:58:37 2010 +0100 Add configuration option to disable default modes on an output Setting 'Option "DefaultModes" "No"' in an output will guarantee that X will omit the default modes, just picking up modes from the configuration file and modes provided by the output. Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a1c2bdb6ab7a4f374844f80e83620b155991e817 Author: Michel Dänzer <daenzer@vmware.com> Date: Thu May 20 10:13:06 2010 +0200 EXA: Wrap Glyphs even without Composite acceleration. In order to avoid migration ping-pong when accumulating glyphs in a mask picture. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 00581d4a42e2a0e7652834973645a4a9ed59cf93 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri May 14 19:31:56 2010 +0300 configure: force new xproto version dependency commit bca85e2e127a8a23e3a2debcfeb3ae07cd3c66ac introduced it. Use the version that includes _X_NORETURN Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 103507af0c0ce7d7482a67163249864af36a2374 Merge: 8bd8d81 99fcf65 Author: Keith Packard <keithp@keithp.com> Date: Wed May 19 22:27:53 2010 -0700 Merge remote branch 'vignatti/bus-cleanup' commit 8bd8d81dc473bf72ea108b1896a55e32defa02e2 Merge: c620a1c 66d5ecc Author: Keith Packard <keithp@keithp.com> Date: Wed May 19 22:27:20 2010 -0700 Merge remote branch 'vignatti/animcursor-state-fix' commit c620a1c0a4ca564e778cce019dd30046c6969956 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 20 10:26:56 2010 +1000 xfree86: fix typo in optionTypeToSting. Because we don't want anyone to get hurt. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8b6c1809c09f832051327d86e1a25dc0ec5cc878 Merge: d88ba77 c38552d Author: Keith Packard <keithp@keithp.com> Date: Wed May 19 12:58:02 2010 -0700 Merge remote branch 'jamey/for-keith' commit c38552d115e3bc71ad6179a8ad0d68778e943793 Author: Jamey Sharp <jamey@minilop.net> Date: Sat Apr 24 23:56:36 2010 -0700 Add typed resource-lookup errors for non-core resource types. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> commit e291c561821ae86b7dd74269d5cd29bc31703962 Author: Jamey Sharp <jamey@minilop.net> Date: Sat Apr 24 23:26:40 2010 -0700 Return an appropriately-typed error from dixLookupResourceByType. Rather than always returning BadValue, associate an error status like BadWindow with a resource type like RT_WINDOW, and return the appropriate one for the requested type. This patch only touches the core protocol resource types. Others still return BadValue and need to be mapped appropriately. dixLookupResourceByType can now return BadImplementation, if the caller asked for a resource type that has not been allocated in the server. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 90e612dcbe370da095d317fac62c80ac2447fa0b Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 15 15:51:32 2010 -0700 Use WriteEventsToClient rather than TryClientEvents where possible. If filter is NoEventMask (aka CantBeFiltered), grab is null, and the first event is not in the set of "critical events", then TryClientEvents simply calls WriteEventsToClient. In that case, it returns 0 for fake or dead clients, and 1 otherwise. Inline for this special case. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 8033fb6c9792820a82fbdff6a14ff8a7a141ba74 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 15 13:12:44 2010 -0700 Set event sequence number in WriteEventsToClient instead of at callers. TryClientEvents already did this; this commit just moves the assignment one level down so that no event source has to worry about sequence numbers. ...No event source, that is, except XKB, which inexplicably calls WriteToClient directly for several events. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 4b9600a4167427a8fe88bca9b738c9a99cac9469 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 15 12:31:34 2010 -0700 Make WriteEventsToClient/WriteToClient no-op on fake or dead clients. This matches the test in TryClientEvents, and is a superset of tests done by the callers of these functions. The consequence of forgetting these tests is a server crash, so they're always desirable. In my opinion, it's better to not require the callers to remember to do these checks. For callers that don't do very much work before calling WriteToClient or WriteEventsToClient, I've removed the redundant checks. hw/xquartz/xpr/appledri.c has an interesting case: While its check for "client == NULL" appears redundant with the test in WriteEventsToClient, it dereferences client to get the sequence number. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497 Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> commit ee9cd2df4a5af66c6b7073563785b8aef61fcdb8 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 15 13:37:34 2010 -0700 xv: TryClientEvents already checks client and sets sequenceNumber. So don't bother doing those steps again. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> commit e1e7deefb59cfdd82c9de46a7ca241d42436b2f8 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 18 16:49:21 2010 -0700 mi/misprite.c: Delete unused private lookups. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 936b09f2a3e31afe41050c00736bbb6b812c7003 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 18 16:48:08 2010 -0700 Replace miSpriteCursorFuncRec with direct calls to midispcur.c. Nobody wraps the mi software-cursor sprite rendering implementations. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 66d5ecc5fd36e21715531a39ac83dc2b6b988a7e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue May 18 13:53:29 2010 +0300 render: set anim cursor state for pointer enabled devices only The structure containing the state of animated cursor was amended within SpriteInfoRec, removing all previously privates logic to keep such state. API change: It was removed MAXDEVICES dependency \o/ Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 99fcf655bdc96f7e5b2249b05da51ba4fc9190c7 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 22:34:44 2010 +0300 xfree86: remove PCI dependency from InitOutput All functions that touch PCI and BUS were moved to their own files, organizing the mess inside the InitOutput. Now, inside InitOutput, mostly accesses to buses are coordinated by the new xf86BusConfig. Two PCI probe functions just changed the name and a procedure to receive the isolate devices parameters was created also, named xf86PciIsolateDevice. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 0dd299864a133d478e4635bd1cd305b67fc3964d Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 21:33:26 2010 +0300 xfree86: remove xf86EnableAccess It's RAC remnant. This was substituted by xf86VGAarbiter{Lock, Unlock} mechanism. It's an API break, but the few drivers using it were covered already with macros to avoid problems. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit f28515b5f774b83e0481acbcdda2f682738079b9 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 21:24:46 2010 +0300 xfree86: bus: remove SetSIGIOForState and simplify the code Also removed some dumb debug messages. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 211ca67e4d8d00b20a74a78304a61d4dbea62706 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 21:16:23 2010 +0300 xfree86: bus: fb drivers might want to use vga arbitration either Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 2464eb7d56407422e033ab3b94634ba802a119d5 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 21:14:53 2010 +0300 xfree86: bus: simplify entity related hooks Remove some out dated commentaries either. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 971768e6884f20981652da09a1617c51a760fb86 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri May 7 15:25:48 2010 +0300 xfree86: bus: enable declaration of sparc function as its code usage The code in xf86sbusBus.c seems too OS-specific to be usable on OpenBSD. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit a70ec0d136bbb9efb6f4e683d7ebcea00375083b Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 20:48:01 2010 +0300 xfree86: bus: rework xf86PostProbe logic and remove useless log info Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 2f7d630a1ee446711288af69711d57ea3054b594 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 20:29:11 2010 +0300 xfree86: bus: reuse already assigned variable when fb driver claimed Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 964f29bb80c1bb05508a27969c3ac34cbf072ee9 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 20:14:40 2010 +0300 xfree86: bus: fix Enter/Leave accesses behaviour Okay, seems we're not using extensively such hooks in fact. But fix the expected behaviour at least. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit b37462b4da7c389ec7bbcfd800e5f88bded79330 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 19:53:37 2010 +0300 xfree86: remove unused xf86AccessInit() The function was only initializing the boolean xf86ResAccessEnter, which couldn't get any other value in the life of the server. The only possible, though suspicious, code was in xf86AccessLeave(), which could be triggered if AbortDDX is called before xf86AccessInit(). Even so, such change is safety because no driver would have configured any entity leave procedure at this point. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit d88ba7721d2d3b58cdc664fd4c23a3c5e2a5f909 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 18 11:12:49 2010 +1000 xfree86: Add option parsing for percent options. In some cases, an option of "50%" would be preferable over fixed value configuration - especially if the actual values are autoprobed. Add a new set of functions to parse percent values from configurations. The percent value parsing differs slightly - if the option is not to marked as used (e.g. xf86CheckPercentOption()), no warning is emitted to the log file if the value is not a percent value. This allows double-options (either as % or as absolute number) without warnings. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 673eb707ce6737284c4886265ba149c5587a74e2 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 15 12:06:25 2010 -0700 SyncSendAlarmNotifyEvents: check the correct client's clientGone flag. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c3ba199aa643e59abd30170c53fbb4e03077c377 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Apr 27 16:27:55 2010 +0300 render: remove unused animcursor fields from private rec Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9db63e4766bde07ebc375c4390bcc5c854b46ac3 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Apr 27 16:18:50 2010 +0300 render: removed unused macro from animcursor Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit cba9942f7716b12c329616a9994c5bce857617fa Author: Kristian Høgsberg <krh@bitplanet.net> Date: Mon May 17 17:40:30 2010 -0400 dri2: Fix NULL check in allocation error handling 1461b31e40a3e44f6327199d23cf2ab70d8f5176 tests to see if the allocation of buffer[i] failed after i has been incremented, causing it to look at the wrong pointer. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Tested-by: Eric Anholt <eric@anholt.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 27cec0a0501369a68031c048e691bda4c7095f72 Author: Julien Cristau <jcristau@debian.org> Date: Mon May 17 19:23:44 2010 +0200 Fix build without XACE dix/colormap.c and dix/gc.c now dereference a ClientPtr, so they need to include dixstruct.h. Regression introduced by commit 11c69880c7c48ef9e755c4e09fadef7a629d7bc7. Reported-by: Robert Hooker <sarvatt@ubuntu.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5a387cf6d248e3cb3337a938200ed5a09fc1d8cb Author: Julien Cristau <jcristau@debian.org> Date: Sun May 16 21:29:02 2010 +0200 Only link Xorg with libconfig.la Other DDXs don't use input hotplugging since config_init was moved to the DDX in commit d33adcdf03c69407d151e732fa0cf9947151eb19, so there's no need to link this in. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 37f0b45dbe4ea52bc127720207c7157b2b803ac0 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun May 16 10:14:02 2010 -0700 XQuartz: Fix a build failure on Tiger Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ecfeabec8d0dcfe286fb893047f1fe1a7ea9f8f5 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun May 16 10:03:13 2010 -0700 XQuartz: Don't use deltaXY for determining pointer location on scroll events <rdar://problem/7989690> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Edward Moy <emoy@apple.com> commit a911292c85f7069d2caabcb677ed716a04227526 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat May 15 10:53:09 2010 -0700 XQuartz: Don't trust deltaXY for middle mouse clicks. The middle mouse clicks return erroneous values after returning from Fast User Switching. <rdar://problem/7979468> http://xquartz.macosforge.org/trac/ticket/389 Signed-off-by: Martin Otte <otte@duke.edu> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Edward Moy <emoy@apple.com> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 345eb171264325d73ea2c50ba8c692cf589c2a9b Author: Keith Packard <keithp@keithp.com> Date: Sat May 1 01:41:19 2010 -0700 Remove dbe screen private privates. Each DBE Screen private structure could have nested privates. Oddly, no code ever used them. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 87ea5760f86eb60840e6e2c10012915952df5377 Author: Keith Packard <keithp@keithp.com> Date: Mon May 10 11:46:25 2010 -0700 Check pixmap allocation return value when creating glyphs The driver may decide that the pixmap is too large or something and fail to allocate a pixmap; not checking would lead to a segfault. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 03f7e92a6cbfe58db08ce840283f9809695c70e7 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon May 10 13:44:30 2010 -0700 Update list of supported platforms in configure.ac error message Adds DragonFly BSD, OpenSolaris, & GNU Hurd. Drops MacOS X, since this is in the section specific to the Xorg/XFree86 DDX. (Matches the OS patterns the configure script checks for.) Also uses m4 macros to fix the spacing/formatting of the resulting message. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Gaetan Nadon <memsize@videotron.ca> commit e42a29d269fadc11e065c63ee369e3165196f2d7 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Thu Apr 29 18:45:34 2010 -0700 Fix compiler issues with getifaddrs() call on OpenSolaris OpenSolaris recently added support for the getifaddrs() API. Building with that uncovered two compiler issues (one warning, one error) in the code that was now being built for the first time in our builds: "access.c", line 768: warning: argument #1 is incompatible with prototype: prototype: pointer to struct sockaddr {unsigned short sa_family, array[14] of char sa_data} : "access.c", line 213 argument : pointer to struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2} "access.c", line 838: assignment type mismatch: struct sockaddr {unsigned short sa_family, array[14] of char sa_data} "=" struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2} Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit c6613cfc26e76b296e620640bf33e756eb4ae178 Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 14 10:36:13 2010 -0700 test/xi2: Initialize predefined atoms before XInputExtensionInit. XInputExtensionInit calls MakeAtom, which doesn't work without the atoms table initialized. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1461b31e40a3e44f6327199d23cf2ab70d8f5176 Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Date: Fri May 14 16:25:43 2010 +0300 dri2: Fix xserver crash if dri2 buffer allocation fails. If driver fails to allocate memory for dri2 buffer server would crash in send_buffers_reply. Solution is to handle the allocation failure and return BadAlloc to client. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit f87002cb7d8729b1da4cbefe7653f4cfd3a2d956 Merge: a4fbc0f 890f536 Author: Keith Packard <keithp@keithp.com> Date: Fri May 14 11:46:29 2010 -0700 Merge remote branch 'jamey/for-keith' commit 890f536f8d66f08e7d6a5685659eef4001a8757d Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 14 00:18:14 2010 -0700 Bugfix for "Pre-validate ChangeGC XIDs": off-by-one in loop index. Signed-off-by: Jamey Sharp <jamey@minilop.net> Tested-by: Colin Harrison <colin.harrison@virgin.net> commit a4fbc0fedafda6df98f647173a2deccb86ef0479 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Fri May 14 07:49:31 2010 +0300 scrnintstr.h: removed unused PaintWindow function pointers. Please note this patch breaks the ABI. Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 71296885b0bb946e7ab986169f5b872952c221a0 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Thu May 13 07:12:43 2010 +0300 mi: removed unused PointerNonInterestBox functions. Please note this patch breaks the ABI. Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 795432d4a92ed5b9fa4d9163e73c8e4fe4c74534 Merge: f2a0c32 92ed75a Author: Keith Packard <keithp@keithp.com> Date: Thu May 13 18:22:49 2010 -0700 Merge remote branch 'jamey/cleanups' commit 92ed75ac59e2d3af149cddb962efd05fc8487750 Author: Jamey Sharp <jamey@minilop.net> Date: Mon May 10 20:22:05 2010 -0700 Eliminate boilerplate around client->noClientException. Just let Dispatch() check for a noClientException, rather than making every single dispatch procedure take care of it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 11c69880c7c48ef9e755c4e09fadef7a629d7bc7 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 22:16:32 2010 -0700 Quit using clientErrorValue in dix/colormap.c. And that's it! No more clientErrorValue kludge. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit a3d948ddbb54b9e831e67f22d5031922a3c44107 Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 6 12:35:52 2010 -0700 clientErrorValue is never used outside dix. Stop importing it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 653e4878c4cc03613172a93ad4800e1eacc98f17 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 19:18:11 2010 -0700 Quit using clientErrorValue in dix/gc.c. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 5193f25ea33eed31d6a75cdc1a86427c23d8033c Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 19:08:47 2010 -0700 Define GCAllBits as the union of all valid CreateGC masks. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 6a84cd943430cfc9df55c83aef6a7f8dea6dbb94 Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 7 19:38:05 2010 -0700 Replace dixChangeGC with calls directly to the right variant. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 2d7eb4a19b773d0406c0c2e018a7da97f3565fd5 Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 7 18:11:36 2010 -0700 Pre-validate ChangeGC XIDs. In order to execute a wire-level ChangeGC request, we need to look up the resources named by any XIDs in the value-list. Various places in the server already have pointers to the resources they want to set into the GC, though, so over time the interface has evolved to accept either XIDs or pointers, with several different function call signatures used in different eras. This patch makes the existing code require pointers to resources rather than XIDs, and adds a simple wrapper that looks up any XIDs. The old dixChangeGC API is preserved by delegating to whichever implementation is appropriate. This affects error-handling: If any of the XIDs are invalid, then the GC is unchanged, and its ChangeGC callback is not invoked. This change is allowed by the protocol spec, which says, "The order in which components are verified and altered is server-dependent. If an error is generated, a subset of the components may have been altered." Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit e2929db7b737413cf93fbebdf4d15abdfebff05c Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 14:10:51 2010 -0700 dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere. The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 95728ca09d45afc84c8d1828c09c6b6725f1a58d Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 09:25:34 2010 -0700 Don't statically allocate the ChangeGC parameter array. Because that's insane. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit bff8525f8483304d5f93e83e36b47209381da721 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 12:06:50 2010 -0700 Simplify miFillPolyHelper and miLineArc. Both functions compute a set of spans and either fill them immediately or accumulate them into a caller-provided buffer. Computing the spans used only the miTranslate and lineWidth fields of pGC, and neither could have been changed by the initial ChangeGC/ValidateGC pair, so it's safe to compute the spans first. Then both functions consume the spans the same way, so factor that into a new fillSpans function. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 83f7ec97279405958aed86c6a57704a460c3bfba Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 13:38:00 2010 -0700 miwideline: Factor out span buffer allocation. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit f2a0c324e37c9fa3eb9087adbf963addb7f21d88 Author: Keith Packard <keithp@keithp.com> Date: Thu May 13 10:33:39 2010 -0700 Remove devPrivates init and delete callback lists. XSELinux was the only consumer of these interfaces and it no longer needs them. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit c9e7ca4404803fe44d4684e0bb2ca2ee10fd4bb3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed May 12 20:25:30 2010 -0400 xselinux: Remove use of devPrivates init/free callbacks. Commit eb9210097efea81065c301e5b6b4da7a566deb4a removed the sidget/sidput calls which were the major reason for using the callbacks. The remaining operations can be skipped or worked around. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit bca85e2e127a8a23e3a2debcfeb3ae07cd3c66ac Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu May 13 08:32:00 2010 -0700 Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN Use the values from xproto rather than duplicating the effort Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 421606a8ef447d10c2ee0986f20e752056a47675 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Tue May 11 10:52:18 2010 -0400 dri2: Send out event when auxillary buffers are invalidated This lets the DRI2 clients rely on the server to notify them when they need to get new buffers. Without this, OpenGL clients poll the server in glViewport() which can be a performance problems and also isn't completely correct behaviour. We bump the DRI2 protocol minor to indicate the availability of the event, which the DRI2 clients can use to avoid polling. This speeds up various piglit and oglc test cases as well as real applications. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f281db9a5e400c822e03a19937247baa20ecc213 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Wed May 12 23:57:58 2010 -0700 Remove ResNoAvoid definition, missed in the RAC removal ResNoAvoid is #defined to ResBios, but ResBios was removed from xf86str.h in 4b42448a2388d40f257774fbffdccaea87bd0347 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 315041762313598aad90df84226e2d2def4a0fc9 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 18:55:55 2010 -0700 CreateGC: Pass current client on to ChangeGC. Otherwise we can't check that the XIDs this GC is being initialized with are accessible to this client. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 04bad1b8a118a83064316d6e4327234aee19361e Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 6 21:56:10 2010 -0700 Kill ChangeGC in favor of dixChangeGC. This doesn't change any behavior, but it isn't clear whether NullClient is correct in all cases. As ajax says, > For most of these changes, I think it's correct to use NullClient, > since they are server-initiated changes and should not fail for (eg) > xace reasons. ... At any rate, you're certainly not changing any > semantics by leaving them all as NullClient, so this patch can't be > more wrong than before. The call in CreateGC is particularly questionable. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 65cedf39054cf3a1e695e84ac228cce9e8d48097 Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 6 21:39:43 2010 -0700 Kill DoChangeGC in favor of dixChangeGC. This doesn't change any behavior, but it isn't clear whether NullClient is correct in all cases. As ajax says, > For most of these changes, I think it's correct to use NullClient, > since they are server-initiated changes and should not fail for (eg) > xace reasons. ... At any rate, you're certainly not changing any > semantics by leaving them all as NullClient, so this patch can't be > more wrong than before. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit afcbbd6dfea51c5b0adca0d720edc02ba0c2dc16 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 15:19:03 2010 -0700 doPolyText needs UseAccess to each font, not ReadAccess. In commit 42d6112ec21949a336ee8b34469f2695273ee2d6, Eamon changed dixChangeGC to require DixUseAccess on any GCFont XID. I think doPolyText needs to require the same level of access. Otherwise dixChangeGC could fail when it does the same lookup, which doPolyText doesn't check for. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 59857ee5da5f1f3f4900292581b9586477513211 Merge: 21ceae9 432cbbe Author: Keith Packard <keithp@keithp.com> Date: Wed May 12 16:48:08 2010 -0700 Merge remote branch 'dottedmag/for-keithp' commit 432cbbec194e47bf2a117c9302146e786c8a4ee1 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 13 03:51:00 2010 +0700 Misc coding style cleanup Use a[b] instead of *(a+b), fix whitespace. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 816b79dd061e9839cec94a4986a7820b70ca8a7f Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 13 03:45:21 2010 +0700 Remove useless casts Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 63a647abd51f44226cbd16aa04ebc57d07463c6d Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 13 03:44:12 2010 +0700 Fix code style: extra whitespace before () Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 28211c443c693a1ca3db5740d0128274a3eef723 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 13 03:43:04 2010 +0700 Fix warning: it's safe to pass atom strings > XA_LAST_PREDEFINED to free(3) Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 8b5326aa98eba201dd78aea3dd7114e1a084489b Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Wed May 12 20:27:02 2010 +0000 Mark OsAbort as noreturn function to make gcc happier. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 868e372a73b377705217e0379bc6e00f36c4d8e5 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 13 01:59:06 2010 +0700 Introduce X_NORETURN macro defined as __attribute__((noreturn)) for gcc Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 5a8e2f2745ae1f74501cd3f42614a1ed2cf974f2 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Wed May 12 18:54:51 2010 +0000 Do not jump through the hoops to deallocate xkbbasedirflag variable Fixes gcc warning as well. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit ff2b4cf8329b1678adafcda02e5d47a072550d47 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 13 01:51:37 2010 +0700 Turn sprintf argument into literaral string, shutting up gcc warning Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit f62ba192c285b1e49bf299f03fc0b763680afaaf Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 13 01:47:26 2010 +0700 Do not use deprecated Xalloc function Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 21ceae9002c6364deb3d074cf2da7d3864cf6879 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 11 10:24:00 2010 -0700 SetFontPath: set client->errorValue on failure. Previously the callers were only setting errorValue on Success, when it's ignored, and leaving it alone on failure, when it's sent to the client. Since SetFontPath takes the ClientPtr, let it set client->errorValue instead of letting the callers continue to get it wrong. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 801162919d1c625d950a5d105ae4b3487ebc30a7 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 6 01:55:36 2010 +0700 Removed outdated comments obsoleted by documentation in headers Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4d55c8c4ffcb5d6c6500b462a41ace8e2359151d Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 6 01:54:13 2010 +0700 Use lowercase variant of XNFalloc and Xstrdup Using one variant of function/macro makes it easier to fix the code later. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3f3ff971ecff9936cebafc813af9193b97bba89c Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 6 01:44:06 2010 +0700 Replace X-allocation functions with their C89 counterparts The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 96c7ab27c383ec767f62a7a11e5fd76f86363fbc Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 6 00:28:25 2010 +0700 Deprecate allocation functions which are plain wrappers for C stdlib Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit a5dba0f5caefce236ebd5f71948e5a659bea58e4 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 6 00:27:47 2010 +0700 Document allocation functions, noting deviations from C library Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit e983848ab44b0769f97f6207f1aa8b4f127be6a9 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 6 00:16:24 2010 +0700 Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggage C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so stop fiddling with alignment manually and just pass the arguments to library functions. Also convert silent error when negative size is passed into function into warning in log file. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4f0006c2203abe0b7660c5068d6afe236f9bd2a4 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Mon May 10 08:36:02 2010 -0400 dri2: Copy front to fake front in swapbuffer If we don't have a fake front, nothing will happen. The fix was extracted from a bigger patch from Francisco Jerez. https://bugs.freedesktop.org/show_bug.cgi?id=27305 Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Pauli Nieminen <suokkos@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ba1f1f9d9e48226f1ef6b3222a8d92fc969d6560 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue May 11 09:49:34 2010 -0700 XQuartz GL: Fix __glXAquaScreenCreateDrawable prototype Fixes regression introduced in 9de0e31746d5f0d9d39d11c94ec3cbc04a9935fc Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 286935c6f4965a6b09de1fb9e579a00afa14082a Author: Keith Packard <keithp@keithp.com> Date: Tue May 11 09:08:40 2010 -0700 Remember drawable ID used to find damage target for use in events. Bug 5730. Using Composite, window pixmaps are given names in the client resource namespace and yet may not have any XID recorded in the drawable structure. As such, we need to remember the XID used to lookup the pixmap in the resource database so that we can report the correct XID back to the client in damage events. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 3df22b293c1f1d27e7ce16662744c578d35b5aba Merge: fa6c701 9de0e31 Author: Keith Packard <keithp@keithp.com> Date: Tue May 11 08:38:44 2010 -0700 Merge remote branch 'krh/dri2-resource-fixes' commit fa6c7012572093a82c9389682977efff85590719 Author: Cyril Brulebois <kibi@debian.org> Date: Mon Mar 1 02:11:36 2010 +0100 Fix null pointer dereference in xf86_reload_cursors(). Upon resume, X may try to dereference a null pointer, which has been reported in Debian bug #507916 (http://bugs.debian.org/507916). Jim Paris came up with a patch which solves the problem for him. Here's a (hopefully) fixed version of his patch (without the typo). Cc: Jim Paris <jim@jtan.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-By: Matthias Hopf <mhopf@suse.de> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9de0e31746d5f0d9d39d11c94ec3cbc04a9935fc Author: Kristian Høgsberg <krh@bitplanet.net> Date: Thu Apr 29 16:36:10 2010 -0400 dri2: Take an XID for tracking the DRI2 drawable Some pixmaps (window pixmaps and scratch pixmaps) don't have the drawable->id set and thus DRI2 gets confused when using that field for looking up the DRI2 drawable. Go back to using privates for getting at the DRI2 drawable from a DrawablePtr. We need to keep the resource tracking in place so we can remove the DRI2 drawable when the X resource it was created for goes away. Additionally, we also now track the DRI2 drawable using a client XID so we can reclaim the DRI2 drawable even if the client goes before the drawable and doesn't destroy the DRI2 drawable. Tested-by: Owen W. Taylor <otaylor@fishsoup.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> commit 32381363cd8f43aeb741bad70bcf96a287dac0c9 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Sat May 1 13:15:00 2010 -0400 list.h: Add list_for_each_entry_safe() Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 4a8a615d01b9ed18c272414bd11dc2fc661727e5 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Sat May 1 13:13:54 2010 -0400 glxdri2: Hard-code the extension version we need If we use the #define'd version from dri_interface.h, the server will require at least that version of the extension. If we're compiling against a dri_interface.h with a newer version we don't really require, glxdri2 will require a too high version of the extension. The right approach is to just hard-code the version we need instead of using the #defines. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 6d7ba5e0fcb5d1bce6bb213dec009f3a0f802d26 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Sat May 1 13:07:46 2010 -0400 dix: Update element count in FreeResource*() FreeResource() keeps clientTable[cid].elements up to date with the number of resources allocated to the client. The other free resource functions (FreeResourceByType(), FreeClientNeverRetainResources() and FreeClientResources()) don't maintain this invariant. Typically, the only consequence is that the element count is too high and we end up allocating the hash table bigger than necessary. However, FreeResource() also relies on the element count to restart the search if the list of resources has been changed during a resource destruction callback. Since FreeResourceByType() doesn't update the count, if we call that from a resource destruction callback from FreeResource(), the loop isn't restarted and we end up following an invalid next pointer. Furthermore, LookupClientResourceComplex() and FreeClientNeverRetainResources() don't use the element count to detect if a callback deleted a resource and may end up following an invalid next pointer if the resource system is called into recursively. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 10de9e8ee37265a35ceeceb2007d711da70d4f2d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Apr 16 16:35:22 2010 +1000 xfree86: dga needs to use the master keyboard state (#27573) GetPairedDevice() may not always return the keyboard, resulting in a null-pointer dereference when accessing the XKB state. For floating devices, the GetMaster() returns the device itself. X.Org Bug 27573 <http://bugs.freedesktop.org/show_bug.cgi?id=27573> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Ben Hutchings <ben@decadent.org.uk> commit 758b8614477b53dc3de2b884fec5ccaf8a736432 Author: David James <davidjames@google.com> Date: Mon May 10 14:00:49 2010 -0700 Fix wrong bracket values when startOver = FALSE. Currently, SyncComputeBracketValues reuses old values of bracket_greater and bracket_less when startOver = FALSE. This can result in incorrect bracket values. To fix this issue, the startOver parameter is removed, and we do not reuse old values of bracket_greater and bracket_less. X.Org Bug 27023 <http://bugs.freedesktop.org/show_bug.cgi?id=27023> Signed-off-by: David James <davidjames@google.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 95074538cce93abc1739a4d9dd78b0500fb8fec9 Merge: c079977 2160ff5 Author: Keith Packard <keithp@keithp.com> Date: Mon May 10 13:49:33 2010 -0700 Merge remote branch 'jamey/for-keith' commit 2160ff5240d7e11bdc6cec8859fd1f10395c8edd Author: Jamey Sharp <jamey@minilop.net> Date: Fri May 7 20:00:40 2010 -0700 Simplify error-handling in dixChangeGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 4080cd42fde8b4c693eab7557581af2622479109 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 09:41:46 2010 -0700 miPolyPoint bugfix: Check memory allocation before changing the GC. miPolyPoint ought to leave the GC unchanged even if it fails. ajax says: > We have a new winner for the oldest-bug competition! It's actually > been like that since X11R1: > > -rw-r--r--. 1 ajax ajax 2817 1987-09-12 01:20 ddx/mi/mipolypnt.c Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> commit ccdaecc5471cc2d56b1702eeed4280bb4d58c515 Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 12:26:47 2010 -0700 Move AppendSpanGroup from miwideline.h to miwideline.c. Also make it stop being a macro. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 4272d6722c0f65bdfafc95e91cc2fdb8f6bd072e Author: Jamey Sharp <jamey@minilop.net> Date: Sat May 8 12:18:37 2010 -0700 Expand macros that are used only in miFillPolyHelper. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit c0799779dffeef8cef228bdc57aa6c8b323e7485 Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 26 17:22:12 2010 -0700 dmxBERestoreRenderGlyph was passing wrong value to free Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 946f664b6ab421f69df3dc3213b14b085424c9e4 Author: Adam Jackson <ajax@redhat.com> Date: Thu May 6 17:58:29 2010 -0400 mi: Delete wide ellipse arc cache This does make wide ellipses slower, by a factor of twoish: 946000.0 521000.0 ( 0.55) 10-pixel wide ellipse 98300.0 49900.0 ( 0.51) 100-pixel wide ellipse 17700.0 9310.0 ( 0.53) 500-pixel wide ellipse 16900.0 7980.0 ( 0.47) 100-pixel wide dashed ellipse 16100.0 5370.0 ( 0.33) 100-pixel wide double-dashed ellipse But no one cares, and it's a modest size win: text data bss dec hex filename 1773824 69552 59288 1902664 1d0848 hw/vfb/Xvfb.before 1773112 69552 58648 1901312 1d0300 hw/vfb/Xvfb Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 580b99bb8af4ea093953c2b885bd4272aaf02baf Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 6 11:00:39 2010 -0700 Return BadPicture, not BadPixmap, if alpha-map is invalid. I believe this is what was intended. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c677fc611b124c44adfcfb95718798105f26357b Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 6 11:00:38 2010 -0700 VERIFY_PICTURE always returns BadPicture. Don't bother specifying. Same goes for VERIFY_ALPHA, VERIFY_XIN_PICTURE, and VERIFY_XIN_ALPHA. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 35761d5f811406bc0b6a68c1b02bdb699142745c Author: Jamey Sharp <jamey@minilop.net> Date: Thu May 6 11:00:37 2010 -0700 Introduce dixLookupFontable for "FONT or GC" parameters. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2eab697adba4b1858a530750e9a35fba79a7bf26 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri May 7 09:32:34 2010 -0700 Constify function prototypes in auth & xdmcp code Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit e2e2747f40c4b9e23dba38ea656d4c082e83a794 Author: Matthias Hopf <mhopf@suse.de> Date: Fri May 7 18:46:30 2010 +0200 Fix mod() definition. Presumably no implications, especially security-wise. Signed-off-by: Matthias Hopf <mhopf@suse.de> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 626f97688a89dbc5da80390d822d21b1a737de0e Author: Adam Tkac <atkac@redhat.com> Date: Fri May 7 17:02:03 2010 +1000 Export XkbCopyDeviceKeymap from Xorg, it is needed by VNC. Signed-off-by: Adam Tkac <atkac@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 21ed660f30a3f96c787ab00a16499e0fb034b2ad Author: Chris Humbert <freedesktop@mahadri.com> Date: Fri May 7 17:02:43 2010 +1000 dix: make DeviceEvent coordinates signed for Xinerama. #24986 With Xinerama enabled, event coordinates are relative to Screen 0, so they can be negative. The new DeviceEvent's coordinates are of type uint16_t, making screens above and to the left of Screen 0 unusable. X.Org Bug 24986 <https://bugs.freedesktop.org/show_bug.cgi?id=24986> Signed-off-by: Chris Humbert <freedesktop@mahadri.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9802839d35aaf788790f1d0e8300db4693a70096 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 7 16:22:12 2010 +1000 Xi: reset the known properties at the end of the server generation. Properties allocated through XIGetKnownProperty() aren't reset on the second server generation but keep the old value. As a result, wrong Atoms are supplied to the driver, resulting in potential data corruption or weird error message. Reproducible by running "xlsatom | grep FLOAT" twice on a plain X server. The second X server generation won't have the FLOAT atom defined anymore, despite the users of this atom not noticing any errors. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 72758287f79a4f1aa8fa388f20947042e3e14693 Author: Julien Cristau <jcristau@debian.org> Date: Tue May 4 15:15:02 2010 +0200 XQuartz: add new localization files to EXTRA_DIST commit 206531f75cd41c034e89fdfbc75ab0910682eef8 added localization files for ar, add them to the Makefile. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit a3f5d30ba61e70b3de8b48754dea32715ba93c40 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 16:10:32 2010 -0700 Make sure XFixes invisible cursor gets freed on server reset This uses the same hack that dix uses for the rootCursor -- allocate a resource ID for the invisible cursor so that it gets freed at reset time. This also allows us to unconditionally create it during extension initialization; necessary as the privates layout may well be different on subsequent generations. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit cdeb2c23f80ced961fe205125547e16905885534 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 12:18:09 2010 -0700 Fix cursor ref counting mistakes with sprites and xf86Cursor.c A few cursor value assignments weren't getting correctly ref counted, causing leaks of cursor objects. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a80b1f888f2f7674a715d512ab950eeadee20448 Merge: 4971099 0efd7b8 Author: Keith Packard <keithp@keithp.com> Date: Sun May 2 16:35:17 2010 -0700 Merge remote branch 'jeremyhu/master' commit 0efd7b8d82a48793341e27d4c224986e0971687c Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Apr 27 13:14:47 2010 -0700 XQuartz GLX: Change around includes for better compatability with different OS versions Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 7b506fdc840aebed6b5acb91437a2cb620b5bddc Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Apr 21 08:38:53 2010 -0700 rootless: Add some sanity checking to miPaintWindow This avoids painting the root window when it isn't actually drawable. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4d3789c9b3fbe6aad32fcacd964353b612640f27 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Apr 18 01:22:27 2010 -0700 rootless: Remove an unneeded comment Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 048d15192af39ba5111882d18a957b6ff4e34cad Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Thu Apr 22 10:29:44 2010 +0300 x-list.c: null-returning function malloc() was called without checking Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4971099860e8e6d7817ada92e2636cb435fd002d Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun May 2 19:14:39 2010 +0300 dix: wrap variables with #ifdef when panoramix is not used this shut up some warnings. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 40858960c02a7694b0e1b72e2a986805580ff6f1 Author: Keith Packard <keithp@keithp.com> Date: Thu Apr 29 12:24:51 2010 -0700 Delete loop with no effect from GlyphUninit Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 65e961fcc1da0f1e6c1c477701b2eeb36955ed24 Author: Keith Packard <keithp@keithp.com> Date: Thu Apr 29 12:24:49 2010 -0700 Replace some input devPrivates with regular struct fields In the process, fixes a memory leak in CloseDevice, and an unchecked memory allocation in InitializePredictableAccelerationProperties. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 998e982b775073da59412dce8ce609ea2ad7967c Author: Keith Packard <keithp@keithp.com> Date: Thu Apr 29 12:24:48 2010 -0700 Move callback definitions to their own file Needed as the privates stuff uses the callbacks before they would have been defined in dix.h Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 7dde50c649089b03650d6497079a690feea65e22 Author: Keith Packard <keithp@keithp.com> Date: Thu Apr 29 12:24:47 2010 -0700 Move X_DEPRECATED to misc.h so it can be used outside resource.h Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit 5623908aeef70e5083f3b49986c7547ed044fedd Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Apr 28 12:37:08 2010 -0700 dix: Improve documentation of the DIX private data functions. The functions exported by the devPrivates code were poorly documented. I tried to spruce it up a little. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 986d46144b183a36b4e98aed95eca0c55a8b4251 Merge: a974c8e b5b8f91 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 12:40:53 2010 -0700 Merge remote branch 'jamey/for-keith' Conflicts: hw/xfree86/common/xf86xv.c commit a974c8e7cba40c8d7d1b91e07de8c414627b71a2 Merge: 6581bc4 02e8622 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 12:33:00 2010 -0700 Merge remote branch 'whot/for-keith' commit 6581bc4591746c906d97f8b868f946c47bc6d756 Merge: 0e91e19 d073e51 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 12:29:52 2010 -0700 Merge remote branch 'yselkowitz/master' commit 0e91e19f783d21198fc2e210203e0f10040a9cd0 Merge: 81a081c edbc56c Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 30 12:27:51 2010 -0700 Merge remote branch 'vignatti/for-keith' commit 02e86221b851e5423a95782aa7e297ea051022ca Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 29 09:48:37 2010 +1000 xfree86: a missing input driver is not an error. We call NIDR on all devices that make it through the config backend. Including some that have no driver assigned to them (/dev/input/mouse0 for example). Those ones then simply get ignored by NIDR, but this should not be noted as an error in the log file. X_INFO is sufficient, and it may just prevent some bugreports. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 81a081c1f0cb55df94cb10495aa7ad71cd5a9afb Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Nov 7 19:28:18 2009 +0000 Cygwin/X: AIGLX using native WGL A rewrite of the XWin DDX AIGLX code to actually make it do something useful again Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 262c2c9031ea60cbe738ed80ddb7faa1b888d137 Author: Rami Ylimäki <ext-rami.ylimaki@nokia.com> Date: Tue Apr 27 14:04:47 2010 +0300 test: Fix linking of wrapped functions in XI2 tests. Running "make check" will lead to build problems in scratchbox. Building the first test that wraps dixLookupWindow fails because symbol __real_dixLookupWindow can't be resolved. Defining wrapping options as linker options instead of compiler options makes everything build nicely in scratchbox. Signed-off-by: Rami Ylimäki <ext-rami.ylimaki@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ffaae7c0c69a51a53a76146c79f3630ae197a443 Author: Adam Jackson <ajax@redhat.com> Date: Mon Apr 26 20:11:31 2010 -0700 Remove mibank support Banked framebuffers are so 1990. As of 7.4 the only drivers remaining that used this were chips, neomagic, trident, and vesa. vesa only used it when not using shadowfb, which is broadly undesirable anyway, and no longer uses it at all as of 2.3.0. neomagic never used it by default, and support for it is gone in git master. The other two effectively only ever used it for ISA chips; since ISA support is now gone from the server, they have been modified to only compile mibank support when ISA support is available. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b5b8f91b82d7b150c926dd3fecee6c3aafff6e39 Author: Jamey Sharp <jamey@minilop.net> Date: Thu Apr 22 21:35:17 2010 -0700 xfree86: use screen privates for Xv offscreen images. This replaces a globally-allocated array that depended on MAXSCREENS. Signed-off-by: Jamey Sharp <jamey@minilop.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit a1c2acfe798c57e5be7e5f6c111a6ce91400487a Author: Jamey Sharp <jamey@minilop.net> Date: Wed Apr 21 18:05:45 2010 -0700 xfree86: use screen privates for exclusive DGA clients. Most DGA requests allow at most one client to be using DGA on each screen. Instead of keeping track of the current client in a MAXSCREEN-sized array, track it in a per-screen private. Signed-off-by: Jamey Sharp <jamey@minilop.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit f9e3a2955d2ca73604c68fc9d51405581b832edb Author: Jamey Sharp <jamey@minilop.net> Date: Mon Apr 26 18:23:27 2010 -0700 Make Xvfb independent of MAXSCREENS. If a -screen option specifies a screen number higher than any previously specified, reallocate the vfb-private array of screen-info structs. If built with a DIX that still has a MAXSCREENS limit, asking for too many screens won't be detected until InitOutput calls AddScreen. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 20e84b0b44e8b3b40a3ecab5b2e64a27de247b16 Author: Jamey Sharp <jamey@minilop.net> Date: Mon Apr 26 18:09:23 2010 -0700 Xvfb: Simplify screen option processing. Inspired by Jon Turney's "Xwin: Simplify screen option processing" patch, which does something similar for the Xwin server. Besides making the code more readable, this eliminates most of Xvfb's references to MAXSCREENS. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit eeb84547556b943af2acff207e034823205c7dfe Author: Jamey Sharp <jamey@minilop.net> Date: Mon Apr 26 18:04:25 2010 -0700 Delete redundant scrnum field from Xvfb private screen-info struct. The screen number can be inferred from the position in the vfbScreens array, and it was only used in two places, so it was hardly important. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit da0217891904bc48d5f0b7ea5c62c8ea0e9b95f9 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Apr 21 22:26:28 2010 -0700 Track screens' installed colormaps as screen privates. Several DDXes allow each screen to have at most one (or in some cases, exactly one) installed colormap. These all use the same pattern: Declare a global-lifetime array of MAXSCREENS ColormapPtrs, and index it by screen number. This patch converts most of those to use screen privates instead. Signed-off-by: Jamey Sharp <jamey@minilop.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 22c4300ee25a20e1f815e46225bf0de9cfd6748f Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 7 09:00:02 2009 -0700 Simplify XineramifyXv. The structure of the adaptor-matching algorithm was obscured by trying to use "continue" and "break" as the only control-flow primitives. It's a lot more clear if you add "return" to that set. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> commit af170a4ab76d33254dd4e54a33bb410fa1624739 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 21 15:51:20 2010 +1000 Xext: only update the sprite on pointer events. A call to miPointerUpdateSprite for the XTEST keyboard may result in a NULL pointer dereference in miDCPutUpCursor() when the save buffer is NULL. XTS test case: Xlib 11 KeymapNotify Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bac1c5f1be4588b2b1eb646ee98a5442e1b767d5 Author: Dirk Wallenstein <halsmit@t-online.de> Date: Sat Apr 17 21:36:23 2010 +0200 xkb: Fix omissions in geometry initialization #27679 _XkbCopyGeom did not copy all of the data from the source geometry. This resulted in failures when trying to obtain the keymap from a server where the default geometry has not been replaced by a custom configuration. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3f63db89191701139d45332ca80b9d6eb327c773 Merge: 41bdb6c 54e51de Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 26 20:18:13 2010 -0700 Merge remote branch 'jamey/for-keith' commit 41bdb6c003cca3ef0ff88d9c7de318115bab1ba2 Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Wed Apr 21 18:11:05 2010 -0700 xf86: Don't crash when switching modes through RandR without owning the VT. While VT-switched, FB access is disabled and should remain so. Trying to switch modes in that state would re-enable it, potentially causing crashes if trying to access it before the driver has recovered from the mode switch. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2a763c9023b8bc978b32eaa56d2c625b6f2badee Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 15 16:54:35 2010 -0500 dix: Default DPMS timeout values to match screensaver values These have the same default, but if you specify something different with -s on the command line, only the screensaver time is changed. As DPMS is usually what's desired, change it to match. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 518f3b189b6c8aa28b62837d14309fd06163ccbb Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Wed Apr 21 16:46:17 2010 -0700 mi: don't thrash resources when displaying the software cursor across screens This changes the DC layer to maintain a persistent set of GCs/pixmaps/pictures for each pScreen instead of failing to thrash between them when changing screens. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> commit 54e51de8cd950b3f5b30e72cf1d604f54f619f0e Author: Jamey Sharp <jamey@minilop.net> Date: Sat Apr 24 23:07:47 2010 -0700 ProcGrabButton: remove redundant error check. If dixLookupResourceByType did not return Success, it will have set the pointer to NULL, so the second if will always be true. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> commit 7e573b5ccd2c759f74ebb84d3a5a23da6b88ec6d Author: Jamey Sharp <jamey@minilop.net> Date: Mon Apr 26 15:05:06 2010 -0700 Kill unused/useless macros in panoramiX.h: BREAK_IF, IF_RETURN, FORCE_ROOT This header doesn't seem to be used outside the server tree, so I don't think anything was depending on these except what I've fixed in this patch. FORCE_ROOT is not used anywhere, and never has been in all the history that's in git. ajax removed its FORCE_WIN and FORCE_CMAP companions three years ago, in 04b87d6dfae02e4ecdb5216d12c6cdafd1e8c2b4. BREAK_IF and IF_RETURN expanded to exactly the keywords in their names, which is silly. They were rarely used and served only to make callers inconsistent with the idioms used elsewhere in the server. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com> commit e372cc58e02391c3e8e82ac03f73fbe8b1f7d49c Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 7 11:06:34 2009 -0700 Boolean-or short-circuits, so (a || (!a && ...)) is redundant. Simplify. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> commit 25d1c6cd37cc4079adf7c4bad8d10678fb08b409 Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 26 11:04:38 2010 -0700 Exa screen private has SavedSourceValidate, not SourceValidate Need to check the right field to see if there is a wrapped SourceValidate function. Signed-off-by: Keith Packard <keithp@keithp.com> commit d073e51beeed2e702fa5c7534b1345360bc302f2 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Apr 26 11:39:19 2010 -0500 Clarify help strings for disabled features in configure Features which are disabled by default use the --enable-* syntax to show how they need to be passed to override the default. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> commit 57409af1267f48457f93134922f2450518182e09 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Apr 14 13:18:28 2010 -0500 Catch when requested SHA1 implementation is missing The other SHA1 implementation detections already error out if specifically requested but were not found. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 0d8fe2fe5c37659147cbecac793183c62fc6818a Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Tue Apr 13 13:32:51 2010 -0500 Prefer libsha1 over libgcrypt When no SHA1 implementation is specified, we should first prefer system-builtin solutions (libc/libmd/CommonCrypto), then smaller implementations over the larger ones. libsha1 is much smaller than libgcrypt, so it should be first. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Acked-by: Julien Cristau <jcristau@debian.org> commit 65a2c09549d2372c23b155addff428177708c910 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Apr 8 21:55:45 2010 -0500 Revert "Disable Record by default." Record was broken during the pre-1.6 development cycle and was not fixed until 1.7.6. Now that it is fixed, re-enable it by default. This reverts commit 3eaecdd66e791e0f3d86b23ce10be057ca44c044. Conflicts: configure.ac Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6e0d847c273ab89323883a05f806f449180e3669 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Mar 25 03:37:09 2010 -0500 xfree86: Fix reference to SGML entities XORG_CHECK_LINUXDOC sets the SGML search path to the parent of X11/defs.ent. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> commit 04b7d529c09af2c842cf020d5b26080e1ffd88d6 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Mar 25 03:36:25 2010 -0500 xfree86: Ignore linuxdoc generated docs Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Acked-by: Gaetan Nadon <memsize@videotron.ca> commit 39e5108c78e0802833a8e9ea7f29d042738625ba Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Mar 25 03:35:36 2010 -0500 dmx: use silent rules in doc Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Acked-by: Gaetan Nadon <memsize@videotron.ca> commit 3ba2ce5d1054c99354686aeb373247f1b9debf79 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Mar 25 03:33:55 2010 -0500 dmx: Ignore linuxdoc generated docs dmx.txt and scaled.txt are generated from SGML, so they probably never should have been in version control in the first place. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> commit 40972576b606237d5d42abc13d846163e264a4ac Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Tue Mar 23 04:47:27 2010 -0500 Use AC_PROG_SED and respect its result AC_PROG_SED sets SED as the path to a fully-functional 'sed' (which may also be called 'gsed' if GNU sed is installed alongside a proprietary version). This is a follow up to commit 9be4157391edf0c5fc4ee36adfb1eb1c3bdb8e3b. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Rémi Cardona <remi@gentoo.org> commit b557571dbff3d9a615e03cad904d46b8af9153a0 Author: Jerome Glisse <jglisse@redhat.com> Date: Mon Apr 26 16:01:48 2010 +0200 exa: avoid calling non existent SourceValidate callback In unaccel path we were unconditionaly calling the SourceValidate callback but in some case it could be NULL. Check if we have a valid callback before calling it. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0e6e75b04eaca311962390533acc03d0ac5ece83 Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 26 09:14:22 2010 -0700 Revert "exa: avoid calling non existent SourceValidate callback" This reverts commit daa6f9308fa57e41210f78d92dbdb3f1c8eae6ad. This one checked pScreen->SourceValidate instead of pExaScr->SourceValidate which would cause a segfault when pExaScr->SourceValidate was NULL. commit daa6f9308fa57e41210f78d92dbdb3f1c8eae6ad Author: Jerome Glisse <jglisse@redhat.com> Date: Mon Apr 26 15:55:26 2010 +0200 exa: avoid calling non existent SourceValidate callback In unaccel path we were unconditionaly calling the SourceValidate callback but in some case it could be NULL. Check if we have a valid callback before calling it. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit edbc56c088462844f6445f5e6d7cbcfc58a207dc Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Apr 26 14:49:25 2010 +0300 include: remove couple of unused structures fields and bump ABI Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 4f8dc1109dcdfa973466a038c16c07da5f6c16b4 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Apr 22 15:43:11 2010 +0300 dix and others: remove unused arraySize field from ScreenInfo Bizarre. This seems to never be used before. I left the field in ScreenInfo, with another name. So, stop looking at it. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> commit 64fd39f2f0ffbbdc2d5929047d260263d0962141 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Apr 22 15:48:48 2010 +0300 xfree86: no need to assign numScreens again numScreens is always being assigned to 0 in dix for any server generation. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit a7d398e545a4be5491248d5ccb303aa03ee1594f Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Apr 16 18:13:50 2010 +0100 Xwin: make screens structures run-time adjustable Change g_ScreenInfo, an array of winScreenInfo elements, from a static array of MAXSCREENS elements, to a dynamically allocated one Fix up the validation that -screen option screen numbers are contiguous from zero (which possibly didn't work correctly before anyhow) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jamey Sharp<jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit d8454ae488cfc073cd6010c9a08d53855a0c2612 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Apr 12 20:18:13 2010 +0100 Xwin: Simplify screen option processing Use an instance of the XWin DDX-specific screen info structure to hold the current default values, to simplify greatly the code for applying options to all screens and remove all those loops over MAXSCREENS screens in the command line option processing Use g_iNumScreens for tracking the current initialized screen count Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit b61870595ba4df06006d24ed8c07cfe781bce1b7 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Apr 22 20:20:48 2010 +0300 xfree86: track screens' installed colormaps as screen privates Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit a94f5455c71363d5047668ee093901b9e1645cf1 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Apr 22 20:20:43 2010 +0300 mi: track screens' installed colormaps as screen privates Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit a2c716eaf6b3a4ce75382394636a0a890b5dcfe0 Author: Jamey Sharp <jamey@minilop.net> Date: Thu Apr 22 07:34:04 2010 +0200 fb: track screens' installed colormaps as screen privates. Several DDXes allow each screen to have at most one (or in some cases, exactly one) installed colormap. These all use the same pattern: Declare a global-lifetime array of MAXSCREENS ColormapPtrs, and index it by screen number. This patch converts most of those to use screen privates instead. Signed-off-by: Jamey Sharp <jamey@minilop.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit e055bef055b6c726e9f3ef91a83585d13c80651d Author: Jamey Sharp <jamey@minilop.net> Date: Thu Apr 22 06:08:29 2010 +0200 xfree86: use screen privates for exclusive DGA clients Most DGA requests allow at most one client to be using DGA on each screen. Instead of keeping track of the current client in a MAXSCREEN-sized array, track it in a per-screen private. Signed-off-by: Jamey Sharp <jamey@minilop.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 7c9733d063acee04735a0e75d62e508fe4ea1163 Author: Jamey Sharp <jamey@minilop.net> Date: Fri Apr 23 06:41:00 2010 +0200 xfree86: use screen privates for Xv offscreen images. This replaces a globally-allocated array that depended on MAXSCREENS. Signed-off-by: Jamey Sharp <jamey@minilop.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 35d208125fa0ec78e8d694adc52886b977e789cf Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Apr 21 18:28:13 2010 +0300 xfree86: fix not reached code in fi1236 driver from i2c This issue was introduced in the first dump of the code in 2004. I haven't check what's the correct fix for it so I simply kept the behaviour of someone calling this and removed the unreachable code. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7ac6a6b7d0dfc5e021270b2898accd3425aa008a Merge: 0782894 f7ef6fd Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 21 16:07:38 2010 -0700 Merge remote branch 'vignatti/for-keith' Conflicts: exa/exa.c Signed-off-by: Keith Packard <keithp@keithp.com> commit 0782894b5702adcf6f4a90861793b717f3856fa5 Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 21 16:00:28 2010 -0700 Xvfb: Usage message typo fix. Signed-off-by: Keith Packard <keithp@keithp.com> commit ee3412b8702072c3a0b006bd20dd3bc7071d721c Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 21 15:58:23 2010 -0700 Restore some unused win32 debug code accidentally removed with unifdef unifdef found some code covered by which it decided to remove. This patch simply restores that in case someone wants it back. Signed-off-by: Keith Packard <keithp@keithp.com> commit e3d2a7a613366c26e5316cf582d9a8c6c6692b0a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 21 11:47:24 2010 +1000 Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit f7ef6fd9a1a1f48603df2796fe7c904c25a81077 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Apr 20 15:56:58 2010 +0300 xfree86: fix not reached code in tty code CLEARRTS_SUPPORT cannot be triggered at all. Notice that mouse driver manual page states the support for it though. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit b36eeb713a349961a6be8a6dd183ded6d27f9974 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Apr 20 16:26:02 2010 +0300 xkb: check for NULL pointer before dereferences it in XkbWriteXKBSymbols move srv assignment to before it's being used. Also, check for xkb being nil. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 471f350c99b2e7c5a9045eef5ebff65cd2ddb7c5 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Apr 19 20:34:30 2010 +0300 exa: don't need to check for NULL pointer if we already assumed it has a value the alternative would be to check ps in the beginning of the function. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Michel Dänzer <michel@daenzer.net> commit 96784f4fcb6c2fb82f6d1abbd28ea1e189e4e6f5 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Apr 19 20:46:12 2010 +0300 xkb: check for NULL pointer before dereferences it in XkbAddClientResource Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 057c147541bde6f0cbe22ca069b43a97ddc95baf Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Apr 16 18:01:41 2010 +0300 Xi: check for NULL pointer before dereferences it in ListButtonInfo Both dev and dev->button are already used before their checking were being performed. So check on the beginning. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 7f457351d2a09013cd57fcb2f95c0d6f56bfaccb Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Apr 19 20:18:51 2010 +0300 xfree86: check for NULL pointer before dereferences it in parser code Seems to be harmless. Meh. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit d948dcd9555c81ccb378054383ef8da464202bdf Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Apr 16 17:08:09 2010 +0300 Xi: fix not reached code in XSendExtensionEvent Error was introduced in 31a7994a. I.e., broken since 2007. I guess nobody uses XSendExtensionEvent. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit f491b0aa5b86a5242fc4e04218202bbb52d0af39 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Apr 16 16:47:33 2010 +0300 xfree86: fix not reached code in parser ...because Error is a macro that returns NULL. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 099946a3ac94ff5e575e9edcecd26cf9f346b241 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Apr 16 18:35:55 2010 +0300 mi: check for NULL pointer before dereferences it in miPointerSetPosition Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 49835eec0c996ad95a01f0fe340336b6b60e51aa Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Apr 16 17:50:43 2010 +0300 exa: check for NULL pointer before dereferences it Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 996c115deb558e8e9490ea773528b8e96650df53 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Mar 25 18:17:54 2010 +0200 configure: remove unused builtin font macro from autoconf file This should be removed together with 49b93df8. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 0ba82562eeba8bf3bcd00b6e3ff28ce5b2c8df3c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Mar 30 19:10:36 2010 +0300 Death to Multibuffer extension The rationale behind is because no sane application will use this when we have modern APIs such DRI2. Besides, as a fact, xfree86 server has already deprecated this extension in 1998: http://www.xfree86.org/3.3.6/isc7.html Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 28b7b2b8d02d975480080865f0dddebcaa2f7968 Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 19 09:26:10 2010 -0700 unifdef -B -DRENDER to always include RENDER code This patch was created with: git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done Signed-off-by: Keith Packard <keithp@keithp.com> commit b3ab978df861c08298f57529e3db980489055c35 Merge: a92b2c2 0ad022a Author: Keith Packard <keithp@keithp.com> Date: Sun Apr 18 22:01:40 2010 -0700 Merge remote branch 'whot/for-keith' commit 0ad022a729bafa56cc7b5d241f567444a34514ad Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 14 10:54:29 2010 +1000 xkb: rename XkbFakeDeviceButton and XkbFakeDeviceMotion, move into xkbActions.c The name XkbDDXFakeDeviceButton and XkbDDXFakeDeviceMotion is somewhat misleading, there's no DDX involved in the game at all anymore. This removes XkbFakeDeviceMotion and XkbFakeDeviceButton from the API where it arguably shouldn't have been in the first place. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit da4e2e382828d7ba460766709368ec6214b286dd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 14 09:48:53 2010 +1000 xkb: purge unneeded includes from ddxDevBtn.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit a92b2c2c8dd1e86ee852168146f01bdf72bfe2d0 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Fri Apr 16 05:55:35 2010 -0400 glx: Drop DestroyWindow hook Now that glx doesn't call DRI2DestroyDrawable anymore, we don't need to force a specific resource destruction order in the DestroyWindow hook. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Michel Dänzer <michel@daenzer.net> https://bugs.freedesktop.org/show_bug.cgi?id=26394 Signed-off-by: Keith Packard <keithp@keithp.com> commit 1da1f33f2dd5b437dd56cd9f5d6782de4ad5a1bc Author: Kristian Høgsberg <krh@bitplanet.net> Date: Fri Apr 16 05:55:34 2010 -0400 DRI2: Track DRI2 drawables as resources, not privates The main motivation here is to have the resource system clean up the DRI2 drawable automatically so glx doesn't have to. Right now, the glx drawable resource must be destroyed before the X drawable, so that calling DRI2DestroyDrawable doesn't crash. By making the DRI2 drawable a resource, GLX doesn't have to worry about that and the resource destruction order becomes irrelevant. https://bugs.freedesktop.org/show_bug.cgi?id=26394 Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 22da7aa9d743deee198aaf6df5d370a446db9763 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Fri Apr 16 05:55:33 2010 -0400 glx: Let the resource system destroy pixmaps GLX pbuffers are implemented using a pixmap allocated by the server. With the change to DRI2 to track DRI2 drawables as resources, we need to make sure that every drawable we create a DRI2 drawable for has an XID. By using the XID of the pbuffer, the resource system will automatically reclaim the hidden pixmap and the DRI2 drawable when the pbuffer is destroyed or the client exits. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit f0006aa58f6cf7552a239e169ff6e7e4fda532f4 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Fri Apr 16 05:55:32 2010 -0400 glx: Track GLX 1.3 style GLX drawables under their X drawable ID as well This ensures that the DrawableGone callback gets called as necessary when the X drawable goes away. Otherwise, using a GLX drawable (say, glXSwapBuffers) in indirect mode after the X drawable has been destroyed will crash the server. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit f4106c02318fcc4b534224df5b95a58aff555fb4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 13 14:44:59 2010 +1000 xkb: use GPE for XKB fake motion events. Section 4.6.1 of the XKB spec says that "the initial event always moves the cursor the distance specified in the action [...]", so skip the POINTER_ACCELERATE flag for GPE, it would cause double-acceleration. Potential regression - GPE expects the coordinates to be either relative or both. XKB in theory allows for x to be relative and y to be absolute (or vice versa). Let's pretend that scenario has no users. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 6c42c8c356be305dc7f3f92ad8d58675da8c2f07 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 14 10:51:41 2010 +1000 xkb: Guard against SIGIO updates during PointerKeys. In theory, an event coming in during GPE could reset our lastSlave, leading to rather interesting events lateron. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 108457dff816569453a2d88cd72595fa7eb02479 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 13 14:41:07 2010 +1000 xkb: Post PointerKeys through the XTEST device. Posting an event through a master device may cause pointer jumps once lastSlave == master, caused by double scaling. To avoid this, post the fake event generated by XKB through the XTEST device instead. Fedora bug #560356 <https://bugzilla.redhat.com/560356> Tested-by: Andrew McNabb Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit a780e5b3638a0ff81301fc68aca15b47ba0befb7 Author: Benjamin Tissoires <tissoire@cena.fr> Date: Wed Apr 14 17:27:51 2010 +0200 xf86ScaleAxis: support for high resolution devices High resolution devices was generating integer overflow. For instance the wacom Cintiq 21UX has an axis value up to 87000. Thus the term (dSx * (Cx - Rxlow)) is greater than MAX_INT32. Using 64bits integer avoids such problem. Signed-off-by: Philippe Ribet <ribet@cena.fr> Signed-off-by: Benjamin Tissoires <tissoire@cena.fr> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e424d5812300e82de375d83dc0b490a76d865016 Merge: 5b0faf3 0e7703f Author: Keith Packard <keithp@keithp.com> Date: Thu Apr 15 15:01:34 2010 -0700 Merge remote branch 'whot/for-keith' commit 0e7703f9b1927328954a2fc87aac6be244819329 Author: Julien Cristau <jcristau@debian.org> Date: Tue Apr 13 22:28:36 2010 +0200 vfb: add a name and type to the pointer and keyboard Fixes a crash in XIQueryDevice which calls strlen on a NULL pointer. #0 strlen () at ../sysdeps/x86_64/strlen.S:31 #1 0x00000000004c16ed in SizeDeviceInfo (dev=0x969bd0) at ../../Xi/xiquerydevice.c:204 #2 0x00000000004c1a01 in ProcXIQueryDevice (client=0xa57510) at ../../Xi/xiquerydevice.c:98 Debian bug#575905 <http://bugs.debian.org/575905> Reported-by: "Bernhard R. Link" <brlink@debian.org> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2f29b163bbdebe384c24f781bb97b446959e8f4c Author: Adam Tkac <atkac@redhat.com> Date: Mon Mar 22 14:52:29 2010 +0100 dix: Export AllocDevicePair GetPointerEvents, GetKeyboardEvents and generate_modkeymap functions from Xorg. Those functions are used by TigerVNC libvnc.so module which doesn't use standard XInput infrastructure but uses same functions like, for example, XTest devices. Signed-off-by: Adam Tkac <atkac@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 241b53b77750b5eea6759e79b23be4ff270a3d1f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 23 14:35:56 2010 +1000 mi: remove log-spamming bogus error message (#26843) miSpriteRealizeCursor is called whenever a device is set floating and it's fine to do so, no need for an error message. Same goes for the other miSprite messages. X.Org Bug 26843 <http://bugs.freedesktop.org/show_bug.cgi?id=26843> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 00b8b7ad61b6f818271fb4d1e383113170309d72 Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Wed Apr 7 13:52:47 2010 -0700 mi: don't thrash resources when displaying the software cursor across screens This changes the DC layer to maintain a persistent set of GCs/pixmaps/pictures for each pScreen instead of failing to thrash between them when changing screens. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5f31e2196179f8db3170d65a17d8ad40da1acb0d Author: Tim Yamin <plasm@roo.me.uk> Date: Mon Mar 8 12:45:15 2010 +1000 dix: fix cursor screen check for xinerama setups. The de-duplication of CheckPhysLimits 942eae6868b8b0f343b6a added a condition that is invalid for a Xinerama setup. pScreen is invalid for the Xinerama case, so comparing it to anything is a bad idea. Signed-off-by: Tim Yamin <plasm@roo.me.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5b0faf355465c9f21ad96e0ed266fbdbc29efb5b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Apr 15 10:55:53 2010 -0700 XQuartz GLX: Don't let garbage enter our pixel request https://bugs.freedesktop.org/show_bug.cgi?id=27654 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit fe7778e58e099d353689755ed2f5aa440569ebe3 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Apr 14 09:06:04 2010 -0700 XQuartz: Fix possible NULL dereference in ListenOnOpenFD <rdar://problem/7862319> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Marc Majka <majka@apple.com> commit 206531f75cd41c034e89fdfbc75ab0910682eef8 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Apr 13 14:33:49 2010 -0700 XQuartz: Localization update Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 9ddbb03fa56aa73c3f417d8ee6433e45b94445b3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 14 17:43:22 2010 +1000 dix: Fix crash in DeliverGrabbedEvents. If both devices are synchronously grabbed, first with a GrabPointer, then with a GrabKeyboard (GrabModeSync on both), sync.other of each device points to the grab of the respective other device. If the keyboard is then thawed through a AllowSome request, the VCK's sync.other is reset to NULL. Subsequently, an event on the VCP would crash the server when dereferencing sync.other on the VCP. The check's purpose is to compare if the other device is grabbed by the same client, which should be checked by accessing (dev->deviceGrab->grab->resource). A check of the server-1.3 sources confirms that. XTS test case: Xlib13 XAllowEvents 20. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7b6517526631a65891b806bca30be8f49955d0a8 Author: Michel Dänzer <daenzer@vmware.com> Date: Wed Apr 14 19:28:37 2010 +0200 EXA: Check sys_ptr isn't NULL before passing it to the UploadToScreen hook. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=27510 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fc5d76740851725e3788c68e14474a012a205892 Author: Julien Cristau <jcristau@debian.org> Date: Tue Apr 6 11:51:53 2010 +0200 XGE: don't register an extension event The GenericEvent is a core event, we never send an extension event, so don't reserve an id for one. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0b676acd47e0d6a675df374b42ddb200deab5d06 Author: Julien Cristau <jcristau@debian.org> Date: Tue Apr 13 11:45:41 2010 +0200 Bump version in configure.ac Signed-off-by: Keith Packard <keithp@keithp.com> commit 1760d2bef9f5b248cb2332f6ebf0220eb02bab42 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Fri Apr 9 10:58:48 2010 -0400 glx: Set the pbuffer bit for dri2 fbconfigs They've been implemented for a while, but we never advertised them. All we need to do is set the GLX_PBUFFER_BIT in the drawable type fbconfig field when we're using DRI2. https://bugs.freedesktop.org/show_bug.cgi?id=26581 Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ab60975fe28cb135b4183c57b7f50d3615921c1f Merge: adbbc66 59edde7 Author: Keith Packard <keithp@keithp.com> Date: Mon Apr 12 21:40:41 2010 -0700 Merge remote branch 'jeremyhu/master' commit 59edde7c28db2d3174a5813a0af334e4ead2082f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Apr 9 16:19:43 2010 -0700 XQuartz: Add a GUI preference for the Alt / Mode_switch toggle Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Kevin Van Vechten <kvv@apple.com> commit 5600f7f001529b3afdee95546aec212a70d6a5b2 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Apr 9 13:33:06 2010 -0700 XQuartz: Customize the NSDefaults id in the man file. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Kevin Van Vechten <kvv@apple.com> commit 840d12c7a6ac6a974da185045215ce944a61fab6 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Apr 9 13:29:34 2010 -0700 XQuartz: Add a defaults option to toggle Alt / Mode_switch See option_sends_alt in Xquartz(1) Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Kevin Van Vechten <kvv@apple.com> commit d6f160510a50d4c4eaa48c9c69a5ddda0d50052c Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Apr 5 16:54:22 2010 -0700 XQuartz: Blacklist some oddball legacy Mac keycodes that break wine http://xquartz.macosforge.org/trac/ticket/295 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Kevin Van Vechten <kvv@apple.com> commit adbbc661080ba4efdb764c154d40c4d2fe718e16 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Tue Feb 16 08:11:41 2010 -0800 xfree86: Fix priority ordering for ignoring input classes Commit 8736d112afb0dd61dfdaadd6378eafd200b2ef5f changed the priority ordering of the InputClass option merging to be "last match wins". This fixes the handling of Option "Ignore" to follow that logic. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit d7c98c1c81ae272f66edb05fde20f4c616604add Merge: 82cf3a4 03ccbd2 Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 7 22:25:51 2010 -0700 Merge remote branch 'whot/for-keith' commit 03ccbd2579948d11e5f16f88cdf68a55f57c9d26 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 8 13:47:26 2010 +1000 xfree86: remove dead input drivers from xorg.conf man page. These drivers have been deactivated for over a year now, let's not refer potential users to them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d4dd3d0085f8eaca8c989aaeace1a1a24c5ebf49 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sat Apr 3 09:33:51 2010 -0700 Move 10-evdev.conf to system config dir $datadir/X11/xorg.conf.d Since the server searches in a vendor specific path now, we can install the evdev catchall there without disturbing local administration files. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 95f01bdfee8241371675f0089170fa6b2908d815 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sat Apr 3 10:08:25 2010 -0700 xfree86: Search for a system xorg.conf.d In addition to the conf files found in /etc/X11 or $sysconfdir/X11 used for local administration, we also reserve a system directory for vendor and package usage. The simple search path is: /usr/share/X11/xorg.conf.d $datadir/X11/xorg.conf.d Files from these directories will have the lowest config priority. The directory $datadir/X11/xorg.conf.d is exported from xorg-server.pc in the variable "sysconfigdir". Packages should install their .conf files to the directory specified by: `pkg-config --variable=sysconfigdir xorg-server` Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a1bae63dc634a5a79861eab128c63506081f7ed9 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sat Apr 3 09:33:49 2010 -0700 xfree86: Set a saner search path for xorg.conf.d There's no reason to carry all the oddities from xorg.conf like appended hostname to the search path for xorg.conf.d. This changes it to something very simple: /etc/X11/<cmdline> $sysconfdir/X11/<cmdline> /etc/X11/xorg.conf.d $sysconfdir/X11/xorg.conf.d Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2ac33888a9a5766aaf88bc92a8bd1d489873524c Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sat Apr 3 09:33:48 2010 -0700 xfree86: Document how -configdir affects the xorg.conf.d search path Explain the "safe" path dance for -configdir, too. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2460e921d18fd264e6f6374be0908f4100442650 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sat Apr 3 09:33:47 2010 -0700 xfree86: Allow adding sysconfdir and datadir to config search paths We could just use $projectroot/etc and $projectroot/share, but the user might have other plans for them. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c8a608cb6ce8f9c86258c1ab49084f691fa9cc51 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 7 10:04:38 2010 +1000 config: only match sane devices in 10-evdev.conf Having a generic catchall also adds devices like accelerometers. These devices make X unusable, hence restrict matching to "known sane" devices like pointers, touchpads, keyboards, tablets and touchscreens. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Julien Cristau <jcristau@debian.org> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: James Cloos <cloos@jhcloos.com> commit 6b09f66d8c6ebcee70382b5cca1ba82b68f20afa Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Fri Apr 2 12:48:21 2010 -0700 Don't keep a pointer to a possibly freed cursor when changing screens, preventing a crash in xf86CursorEnableDisableFBAccess() trying to restore it. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 82cf3a4ae01811917f7903d6f62ba9b7132adf7e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue Apr 6 15:52:18 2010 -0700 Convert x86emu fixed size int typedefs to use stdint types Fixes x86emu builds when using non-gnu compilers now that u64 is required Before this fix, the u64 type would not be defined, causing x86emu/sys.c to fail to build: "sys.c", line 102: syntax error before or at: ldq_u "sys.c", line 102: syntax error before or at: * Since Keith requested using <stdint.h>, converted all the x86emu typedefs to use the stdint types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Matt Turner <mattst88@gmail.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a9fe7cfa77ccee64d68732dc3f37d35cbfc27a65 Author: Paulo Ricardo Zanoni <pzanoni@mandriva.com> Date: Thu Mar 11 14:28:18 2010 -0300 dix: be more verbose when we run out of opcodes If we run out of opcodes, nothing is print on the log, making the problem hard to debug. In the current Xserver, if you enable some extensions like multibuffer (+2 events) and use nvidia binary driver (+5 events) you can run out of opcode numbers. Signed-off-by: Paulo Ricardo Zanoni <pzanoni@mandriva.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6150595bdbacde13bb4f9aba81b15435089bee94 Author: Gaetan Nadon <memsize@videotron.ca> Date: Mon Apr 5 19:12:22 2010 -0400 doc: specify 1.6.1 as the minimum version for doxygen. Older versions generate filenames that are different from the ones listed in the Makefile. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit cbda58c963af5bb9c4643e9017dd4eec589ceff3 Merge: a7698a6 c983f40 Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 7 15:51:38 2010 -0700 Merge remote branch 'yselkowitz/master' commit a7698a677682a32960b885c22fdba2add70f4658 Merge: 495cec7 165a4a9 Author: Keith Packard <keithp@keithp.com> Date: Tue Apr 6 12:36:15 2010 -0700 Merge remote branch 'jbarnes/master' commit c983f40fe4f30311f31a9df699cdc888709251d0 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Feb 24 15:17:42 2010 -0600 Cygwin/X: Add configure option for WindowsWM WindowsWM support is still experimental, and uses the Rootless extension which currently breaks the simultaneous build of the other DDXs (see commit b3415187e92960cbff784108b5a3a8d130dc34c5). So we disable it by default for now; once the latter issue is fixed we can make this 'auto'. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> commit 20701522be803fe47e921fcf059dadf64c7f287d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Feb 18 14:19:21 2010 -0600 Don't enable ROOTLESS_WORKAROUND, it breaks composite This possibly brings back whatever the bug is in http://bugs.freedesktop.org/show_bug.cgi?id=1168 for -rootless mode, but since we don't have reproduction steps for that, I can't test that... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> commit 95c9947f6244d37592958b70760bd1ac885b625a Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Mar 24 00:08:23 2010 -0500 Cygwin/X: Disable unsupported extensions in configure Several extensions are not supported by XWin, some of which are enabled by default in configure. We forcefully disable these early on so that configure will succeed without arguments and without the corresponding proto installed. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> commit 24c9d48cd6999f1e90f9f0e2bbfebd8e95d314d8 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Mar 22 12:47:52 2010 -0500 Disable setuid configure test on Cygwin Only Xorg is installed setuid, so there is no need to run this configure test on Cygwin. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> commit 495cec794dad95ed0c79048f3c410ad23e7d5ea4 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 2 00:14:23 2010 -0700 xserver 1.8.0 Signed-off-by: Keith Packard <keithp@keithp.com> commit b9ad452ec92a7dcbed680acb3f3b8ec29fa660df Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Apr 1 18:57:50 2010 +0300 xfree86: die gracefully in the vga arbiter if AddScreen fails vga arbiter will be locked in one device while AbortDDX will call LeaveVT routines from the other device. Fail! Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit e75f202e7768b7cc0eb2ad0e0f3f51ea81cd7275 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 24 11:08:55 2010 +1000 configure: enable udev backend as "auto" Due to the checks in configure, this means it gets priority over HAL if libudev is found. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 24952b786625fef808cb26d539dd5109d623c053 Author: Keith Packard <keithp@keithp.com> Date: Thu Apr 1 23:44:24 2010 -0700 Install 10-evdev.conf in $(prefix)/etc/X11/xorg.conf.d under udev udev needs some xorg.conf file to tell it to load a suitable input driver, 10-evdev.conf is as simple as they come, mapping all evdev devices to the evdev driver. Signed-off-by: Keith Packard <keithp@keithp.com> commit 02328f190f893cb4ad0f3af7a2ecd39ed77ae5ad Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Apr 1 18:21:51 2010 -0700 Bump bundle version to 2.5.1 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 0e342add7768df55a1917e27f9b85feddd444e82 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Apr 1 15:30:46 2010 -0700 darwin: Correct inline assembly for ___crashreporter_info__ It was missing an underscore. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 67b814d9b2baea6beccfb1625a1e3f0b2ba7218b Author: Ruediger Oertel <ro@suse.de> Date: Mon Mar 29 00:23:40 2010 +0200 Remove now obsolete function chooseVideoDriver Signed-off-by: Keith Packard <keithp@keithp.com> commit 1dd5fbc5a4d860af1c102b33e04dedd8c72617a1 Author: Ruediger Oertel <ro@suse.de> Date: Fri Mar 26 09:33:20 2010 -0700 xfree86: Handle driver autoconfiguration when .conf files exist When doing driver autoconfiguration with some parts of the config file present but no driver set (e.g. only input configuration) fix the case that we may have multiple drivers to try. Create a screen section for each driver and let them be tried in a row. Signed-off-by: Ruediger Oertel <ro@suse.de> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Timo Aaltonen <timo.aaltonen@aalto.fi> Signed-off-by: Keith Packard <keithp@keithp.com> commit 57cb1a854a1b6d91d214b3fa250a7df2ed20d433 Merge: 4b3d67a 28a5f14 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 29 11:46:00 2010 -0700 Merge remote branch 'jeremyhu/master' commit 4b3d67a7647f696957727948f9757a261e15d14e Merge: 579715f aa91508 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 29 11:44:07 2010 -0700 Merge remote branch 'whot/for-keith' commit 165a4a9c7de0fcc6ef6a6421736b412ccb35965e Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Tue Mar 23 09:47:08 2010 -0700 GLX/DRI2: expose swap control extensions if DDX support is present Export DDX swap control status from the DRI2 module and check for it in GLX when initializing extensions. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 5933b0abc6a76aaea84aa534df89900cd795c888 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Mon Mar 8 15:10:47 2010 -0800 DRI2: prevent swap wakes from waking MSC waiters If a few swaps were queued leading to a throttle related block on the client, and then the client submitted an MSC wait, one of the previous swap wakeups could have caused the MSC wait to complete early. Add a flag for this to prevent a swap wake from prematurely waking an MSC waiter. Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit b00d435ddf2e9817e33bfd5f7e9b905442dc23c7 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Mon Mar 8 12:41:25 2010 -0800 DRI2: handle swapsPending better Avoid a potential swapsPending underflow by incrementing it before ScheduleSwap, which may complete it immediately. And be sure to decrement it again in case the schedule failed. Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 0294ff2a5cadddc8fcc77ba9a851f979f0b91fc3 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Mon Mar 8 12:39:54 2010 -0800 DRI2: throttle swaps at submission time too We need to throttle swaps here in addition to when the context is made current to avoid causing problems with clients that just swap. Throttling here also ensures our swaps get ordered as long as we block the client occasionally. Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit db1c7cb604167baf49e61be4c09ccf7b592c4af3 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Mon Mar 8 12:38:37 2010 -0800 DRI2: advertise lowest supported DRI2 protocol version Update our supported DRI2 protocol version as each driver does DRI2ScreenInit, since depending on available kernel features, each DDX may support different callbacks and therefore protocol. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 87ca6320f26eb3129e3c19056e1d8fa5c1784723 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Fri Mar 5 09:49:03 2010 -0800 DRI2: handle swap_interval of 0 correctly A 0 swap interval means that swaps shouldn't be sync'd to vblank, so just complete the swap immediately in that case. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 8476d99231cb725c090305d60f1c1c889d25c8dc Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Fri Mar 5 09:15:24 2010 -0800 DRI2: drawable lifetime fixes Handle drawable destruction and lifetime correctly. Check whether the drawable priv is valid in DRI2SwapInterval(), DRI2WaitSBC() and DRI2WaitMSC(); it may have gone away, so be sure to check it before using it. If more than 1 outstanding swap is queued, we may complete several after an app has exited. If we free it after the first one completes and the refcount reaches 0, we'll crash the server on subsequent completions. So delay freeing until all swaps complete and remove the error message as this is a normal occurence. To do this properly, we must also avoid destroying drawables in DRI2DestroyDrawable() if a swap or wait event is pending. And finally, make sure we free drawables in DRI2WaitMSCComplete() if necessary (i.e. if the refcount has reached 0 and this MSC was the last pending event on the object). Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit b180e43977710b56ccfd6780f204ddcc952987a1 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu Mar 4 10:31:59 2010 -0800 DRI2: fix swapbuffers handling of SBC and target MSC Returns expected SBC after completion of swap to caller, as required by OML_sync_control spec, instead of the last_swap_target value. Passes target_msc, divisor, remainder, correctly for glXSwapBuffersMscOML() call, while retaining old behaviour for simple glXSwapBuffers() call. An OML swap can have a 0 target_msc, which just means it needs to satisfy the divisor/remainder equation. Pass this down to the driver as needed so we can support it. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> commit 751e8c09d34df4b41e8d8384a3ec1bf5cb8ca028 Author: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Date: Sun Feb 21 05:26:00 2010 +0100 DRI2WaitSbc(): Fixes for correct semantic of glXWaitForSbcOML() Added implementation for case target_sbc == 0. In that case, the function shall schedule a wait until all pending swaps for the drawable have completed. Fix for non-blocking case. Old implementation returned random, uninitialized values for (ust,msc,sbc) if it returned immediately without scheduling a wait due to sbc >= target_sbc. Now if function doesn't schedule a wait, but returns immediately, it returns the (ust,msc,sbc) of the most recently completed swap, i.e., the UST and MSC corresponding to the time when the returned current SBC was reached. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> commit 0de4974b90b10fa6a447cdf980b4a114c6c9e5a8 Author: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Date: Sun Feb 21 05:25:59 2010 +0100 DRI2: Fix glitches in DRI2SwapComplete() and DRI2WakeupClient() DRI2SwapComplete(): Increment pPriv->swap_count++; before calling into callback for INTEL_swap_events extension, so the swap event contains the current SBC after swap completion instead of the previous one. DRI2WakeupClient: Check for pPriv->target_sbc <= pPriv->swap_count, had wrong comparison pPriv->target_sbc >= pPriv->swap_count for unblocking of clients of DRI2WaitSBC(). Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> commit 4c8ec49826a46eb3b36c69d2ad3f82320c179c38 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu Mar 4 09:54:15 2010 -0800 DRI2: make target_sbc signed We need to track invalid targets as well as 0 targets, so just make it signed so our comparisons work like they should. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reported-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit c4d54816f2ee4883d8f9bcf4595474fb58c95146 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu Mar 4 09:19:13 2010 -0800 DRI2: fixup handling of last_swap_target We need to initialize the swap target, which is passed to the driver to schedule events. Rather than using -1 to indicate that the field is uninitialized, just make sure we initialize it at drawable creation time. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 28a5f14b4089dccb8045cc4fdc923542a73dd22d Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Mar 28 13:46:23 2010 -0700 XQuartz: Re-query dixScreenOrigins as the value could've changed. Fix a regression in 9c9c3a85b094a3c7b2763a572715d710325091aa Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Adam Jackson <ajax@redhat.com> commit 436d0bb9cca122bfdde32902b683d2499f61e6fc Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Mar 27 17:35:10 2010 -0700 darwin: Generate crash reports on FatalError() Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Adam Jackson <ajax@redhat.com> commit 73b3b67aac9f3938a96cb8822b9c270bd82ded5c Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Mar 22 09:30:51 2010 -0700 GLX: Remove a redundant initialization Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Adam Jackson <ajax@redhat.com> commit 339207be6f184cc783076fc7e2cc12f92f57f2ba Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Mar 25 22:15:58 2010 -0700 XQuartz: Workaround weird key data reported on some layouts This should make 'Unicode Hex Input' work as an input layout. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Adam Jackson <ajax@redhat.com> commit aa91508356f243edc3b11795b1481edcfe0d39c2 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed Mar 24 23:18:35 2010 -0700 config/udev: Prefer product name from attribute rather than uevent The input device product name for evdev devices in the kernel uevent has embedded quotes that aren't expected here. Use the sysfs name attribute instead, which does not suffer this problem. The uevent name will be used as a fallback if no name attribute is found. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d00c3298a698ddddc8967215cef7dd941fa15804 Author: Fernando Carrijo <fcarrijo@yahoo.com.br> Date: Wed Mar 24 20:11:34 2010 -0300 Cleanup some comments in SpriteRec Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 70bd02f2ea3a91c0340df97ca3b8a4f9400f6f46 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 23 12:13:56 2010 +1000 xfree86: merge driver from the input class into the options. A driver that is assigned by an input class is only present as idev->driver. The driver itself has no access to this information once PreInit is called. For devices that rely on chain-hotplugging (wacom), this means that for the second device the driver information is lost and the second device cannot be initialized through NewInputDeviceRequest. Although this could be worked around by hardcoding the driver name in the wacom driver, having the assigned driver in the options seems like the better solution. This issue only manifests itself with the udev backend. With HAL, the driver is assigned by HAL and the option is duplicated in config/hal.c. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 579715f830fbbca9e1ecb17dc18176132f5969e7 Author: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Date: Wed Mar 17 12:16:57 2010 +0200 os: Prevent backtrace from being stopped in noreturn functions. There are two noreturn functions in the X server: FatalError and AbortServer. Having any of those two functions in the middle of a call stack will prevent unwinding the program properly and stops the backtrace at those functions in gdb. The file containing FatalError and AbortServer, os/log.c, has to be compiled with the -mapcs-frame option on ARM to get proper backtraces. Automake imposes its own restrictions on compiling individual source files with different options. The recommended way to do this is to put os/log.c into a convenience library and add this library inside os/libos.la. See the documentation of GNU Automake manual, version 1.11.1, section 27.8 Per-Object Flags Emulation, for details. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit e086b99c1f5ce351b578de7cd9f616bc79d6cf64 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Tue Mar 23 01:03:53 2010 +0600 kdrive: Bump evdev maxKeycode There are keycodes > 193 in evdev, e.g. KEY_WIMAX which is 246 . Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Adam Jackson <ajax@nwnk.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 185185eeb44a277c324be0f58a4b4a469b56b69b Author: Peter Harris <pharris@opentext.com> Date: Tue Mar 23 12:08:19 2010 -0400 Fix crash when all glyphs of a given depth are freed, but not all glyphsets This is how the crash can be triggered with only two clients on the system: Client A: (already running) Client B: Connect Client B: CreateGlyphSet(depthN) Client A: Disconnect Server: free globalGlyphs(depthN) Client B: AddGlyphs(depthN) Server: SEGV This crash was introduced with the FindGlyphsByHash function in 516b96387b0e57b524a37a96da22dbeeeb041712. Before that revision, ResizeGlyphSet was always called before FindGlyphRef, which would re-create globalGlyphs(depthN) if necessary. X.Org Bug 20718 <http://bugs.freedesktop.org/show_bug.cgi?id=20718> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Harris <pharris@opentext.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8311cd5f89ca6781842bb24671b8122cdf8be148 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Mar 23 10:37:36 2010 -0700 XKB: Fix garbage initialization XkbEnableDisableControls set extra garbage bits on the xkbControlsNotify changedControls mask because it was uninitialized on the stack. Found by clang Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0ecfab89d1754b0b7e32b3964b40663d1810cd62 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 22 14:04:09 2010 +1000 xfree86: remove if 1 from the dawn of time. 7+ years for an if 1 should be enough to just admit that there's no other option. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com> commit 6389405b56d2221d8a7b80c4bb3bd3b4e1a29bab Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 22 09:20:49 2010 +1000 configure: Always define XINPUT. This define was removed in e251c9e75afdc "Remove all traces of #ifdef XINPUT and the matching bits from the configure.ac". Drivers that support multiple server versions and still check for ifdef XINPUT now always build without XINPUT support if they're calling XORG_DRIVER_CHECK_EXT(XINPUT, inputproto). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 0c2fde5c8ad6e94b4ed1588aa93256a2b64f74d9 Author: Tomas Carnecky <tom@dbservice.com> Date: Mon Mar 22 11:20:15 2010 -0700 Fix typos in the swap functions This should fix bug #3539. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 3083c5d0c4386cdd7083b7a83ac72fdad2f1e61e Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Mar 22 18:01:17 2010 +0100 Xext: Fix cursor reference counting hazard. Make sure the reference count of the new cursor is increased before the old one is decreased, otherwise bad things will happen if they're one and the same and the reference count is 1 initially. Not sure this can actually happen here, but better safe than sorry. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b29220dc765cb6f878c5466e00e4bd21f3bd803d Merge: c3da766 ed31d50 Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 21 23:01:58 2010 -0700 Merge remote branch 'jeremyhu/master' commit c3da76643aeebdd24047e3e14a860507eac37ec3 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Mar 18 23:19:20 2010 -0500 Cygwin/X: Make X -> XWin symlink during install Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit abf4e0b7e349b0238b2b97a16b8a308b5026af31 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Mar 22 00:44:28 2010 -0500 New header for XF86Bigfont server functions Xext/xf86bigfont.c contains three non-static functions which are called elsewhere in the server. This creates a new header containing these declarations in order to fix several warnings: xf86bigfont.c:285: warning: no previous prototype for `XF86BigfontFreeFontShm' dixfonts.c:502: warning: implicit declaration of function `XF86BigfontFreeFontS$ dixfonts.c:502: warning: nested extern declaration of `XF86BigfontFreeFontShm' log.c:436: warning: implicit declaration of function `XF86BigfontCleanup' log.c:436: warning: nested extern declaration of `XF86BigfontCleanup' Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 57a049ea89b008c0b60316c3b6e6ff5c8fbd4cad Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Mar 18 04:46:20 2010 -0500 Xext: fix old-style function definitions in xf86bigfont.c Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 822b9f9a3e822df8848995eda246f83864d1366f Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Sun Feb 21 01:24:44 2010 -0600 mi: remove deprecated #include <X11/extensions/xf86bigfstr.h> in miinitext.c Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 946b49ebcbf47e030a6e00ce1a699f3b055f638a Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Mar 17 17:37:05 2010 -0500 Catch errors in recursive relink targets If make relink fails in a subdirectory, we need to catch the error otherwise make will continue iterating the 'for' loop. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 0820a6e2fb005b5f856dda25e1644f34fc994129 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Mar 17 13:40:41 2010 -0500 Fix .man.N targets for AM_SILENT_RULES Add $(AM_V_GEN) for sed-based rules so they appear as expected with automake silent rules, and $(AM_V_at) to completely hide cp/ln/rm commands which are not prone to fail. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 9be4157391edf0c5fc4ee36adfb1eb1c3bdb8e3b Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Mar 17 13:33:39 2010 -0500 Respect value of SED from configure We now use libtool, which calls AC_PROG_SED and sets SED as the path to a fully-functional 'sed' (which may also be called 'gsed' if GNU sed is installed alongside a proprietary version). Therefore we should respect the value of SED so we are sure to use the correct one. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 5e00f464c546debf9164f24c6d648623f7ee5946 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Mar 17 14:56:24 2010 -0500 Fix relink targets for silent rules Add $(AM_V_at) to all relink make targets to silence them when automake silent rules are in use. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit fa7e062962d17862032bc600bfcffd486addb063 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Mar 17 13:52:38 2010 -0500 Use EXEEXT in relink rules for portable DDXs On Cygwin and MinGW, executables use the .exe suffix. Autoconf and automake set EXEEXT on these platforms, and leave it empty on others where no suffix is used. $(EXEEXT) must be appended to executable names in custom rules for portability: http://www.gnu.org/software/automake/manual/html_node/EXEEXT.html Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 037869d7b876f43158df88d63788b93a5d6187c1 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Mar 17 13:48:49 2010 -0500 kdrive: Use $(MAKE) in relink rules Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Julien Cristau <jcristau@debian.org> commit 8e5de45513577c63a33833931f2afd0cc59d42a7 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Feb 24 02:56:59 2010 -0600 Use libtool -export-dynamic flag for portability The linker flag required for exporting symbols in executables varies by platform. libtool handles this with a single -export-dynamic flag (not to be confused with the similarly-named ELF linker flag) which tells it to use the correct platform-specific flag at link time. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 2a11ffa977d2267d8b2f27b76490a98e9c73b8c7 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Fri Feb 19 14:31:28 2010 -0600 Rename xdmx client to dmxinfo The DMX Xdmx server and xdmx client cannot both be installed on case-insensitive file systems. The client is undocumented and so renaming it is the best option. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit fbb4903eaa23174d21ab8c640d9de1fe3eb17539 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Sun Feb 21 02:08:08 2010 -0600 Cygwin/X: Fix windres rule for automake silent rules Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Rémi Cardona <rem@gentoo.org> Reviewed-by: Keith Packard <keithp@keithp.com> commit 8db894690988f2bac9c0acb96fd39811d2b42f47 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Fri Feb 19 00:05:28 2010 -0600 Cygwin/X: Fix make dist after 11252ed82e1f361b99e86521ac9314f868bd1a3a Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Acked-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit ed31d50b5f7f25e4db986711699704e615b8afcb Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Mar 19 17:24:27 2010 -0700 XQuartz: Constrain the pointer to the updated display bounds on display reconfigure. http://xquartz.macosforge.org/trac/ticket/346 commit 927480be12ff61deb4e8120d2f90ddef3a1a6beb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Mar 20 11:03:28 2010 -0700 XQuartz: pbproxy: Make standalone xpbproxy respect the launchd prefix Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit d16bc8a3cdbe0e8b9cba836c7aa2ff7c0458049e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Mar 20 03:28:57 2010 -0700 XQuartz: xpbproxy: Cleanup xpbproxy threading Confine xpbproxy to a single thread Runs inside its own CFRunLoop Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 9c9c3a85b094a3c7b2763a572715d710325091aa Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Fri Mar 19 17:23:12 2010 -0700 XQuartz: Minor cleanup Move RandRInit to where it will need to be (not yet implemented) Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit bb75d0df8b5238bfe8b011bb5737fae2a3584290 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Mar 19 15:26:50 2010 -0700 XQuartz: GLX: Fix Availability for Tiger ppc workaround Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit eac7cdabecafb7c505795207182ab2578d672c06 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Tue Mar 16 11:29:08 2010 -0700 Revert "XQuartz: Explicitly pass a bellProc to make XBell() work again." I'm not quite sure why this was necessary, but DDXRingBell is being called from CoreKeyboardBell, so we don't need a separate bellProc which would result in multiple rings. This reverts commit 9071b0d69748cfa7ecca17b4cb0e431bbb0ef2a4. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 13c007f9224ad871193e40466e64df1477ed26b0 Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 21 17:23:46 2010 -0700 Bump to 1.7.99.902 -- 1.8 RC2 commit 235fa5030428084368e5be57fca695647b7b79c4 Merge: 1c612ac fa5103a Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 21 15:38:40 2010 -0700 Merge commit 'fa5103a02bd509e4a102afdad2ab26cb22210367' commit 1c612acca8568fcdf9761d23f112adaf4d496f1b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 17 14:32:38 2010 +1000 dix: if owner-events is true for passive grabs, add the window mask (#25400) A client requesting a GrabModeSync button grab, owner-events true, with only the ButtonRelease mask set would never receive the press event even if the grab window had the ButtonPress mask set. The protocol requires that if owner-events is true, then the delivery mask is the combination of the grab mask + the window event mask. X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Jim Ramsay <i.am@jimramsay.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 95ca39b981624df5338a16b506289014c431ae82 Merge: e7ff956 bf18191 Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 21 15:24:06 2010 -0700 Merge remote branch 'jturney/master' commit e7ff956638780dc1c6f160a1fd041b92cebff9ac Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Mon Mar 15 23:46:36 2010 +0200 common: xf86Configure: alloc_strlen: Allocated memory does not have space for the terminating NUL of the string buffer_alloc: Called allocating function "realloc" which allocated memory dictated by parameter "len + strlen(displaySize_string)" alloc_strlen: Allocated memory does not have space for the terminating NUL of the string var_assign: Assigned "ptr->mon_comment" to storage allocated by "realloc(ptr->mon_comment, len + strlen(displaySize_string))" Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit aeae6637b52b042cf8b07c6943abcd5d31968d49 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Mon Mar 15 23:46:34 2010 +0200 fb: fbFinishScreenInit: leaked_storage: Variable "(visuals|depths)" goes out of scope Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d9ee31ab05efbd2d598cc93a41a8834f84d30803 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Mon Mar 15 23:46:33 2010 +0200 exa: exaFinishAccess: Overrun of static array "pExaScr->access" of size 6 at position 6 with index variable "i" Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit bf181915e103b0659c5a0bc3b2f6bccb18c9ec36 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Feb 1 17:11:51 2010 +0000 Cygwin/X: Allow the default log location to be configurable Allow the default log location to be configurable (e.g. /var/log), and use separate logs for each display instance (e.g. XWin.0.log). Make the type of g_pszLogFile const char*, per os/log.c:LogInit(). Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit cca4952d750779a4c58a11fe08a53336042930bb Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Feb 26 14:40:30 2010 +0000 Xming: Warning fixes Fix warnings due to prototypes not specifying function arguments Fix warning with RegQueryValueEx() Tidy up an include Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b8cf4153f84404b2a1b62a247d5d36d24bf481da Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Feb 26 14:41:00 2010 +0000 Xming: Dead code removal Remove some dead code, mostly code made obsolete by mandatory XKB Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 9b18f7ac0ba9aadb8c86bc2717cbdff75e951b69 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Feb 26 14:22:57 2010 +0000 Cygwin/X: Tidy up some cosmetic issues in log strings Tidy up some cosmetic issues in log strings: - Add missing '\n' - Fix some strings starting with '\n' - Remove '\f' from some log strings These all just look daft in a log with timestamps. Also clarify log message about screen origin coordinates Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 178e830378c3514b9c53a5b1c6d2d5f930c3779b Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Feb 22 19:13:30 2010 +0000 Cygwin/X: Fix thinko in mount option checking Fix a thinko in mount option checking. Use symbolic names for values assigned to binary flag for clarity. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit fa5103a02bd509e4a102afdad2ab26cb22210367 Author: Francisco Jerez <currojerez@riseup.net> Date: Wed Feb 24 23:18:01 2010 +0100 dri2: No need to blit from front on DRI2GetBuffers if they're just being reused. It can be quite an expensive operation, so we're better off not doing it unless it's totally required. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit e38e01081af42825bb7b44d18aa35845318f8556 Author: Francisco Jerez <currojerez@riseup.net> Date: Wed Feb 24 23:18:00 2010 +0100 Import linked list helpers from the intel DDX. Borrowed from i830.h, except for list_for_each_entry(). Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit b8a3be5f34016b745e38cd53825a4e398c6127bc Author: Francisco Jerez <currojerez@riseup.net> Date: Wed Feb 24 23:17:59 2010 +0100 Add a ConfigNotify hook. Executed from the ConfigureWindow request, right before sending ConfigureNotify to the clients. This commit breaks the ScreenRec ABI. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> commit 67a8c659f25218904bae64aac6e98e326c90330b Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Mar 12 16:53:30 2010 +0100 hw/xfree86: move reference counting out of the UseHWCursor[ARGB] functions The problem is that the xf86_use_hw_cursor(_argb) functions may get this correctly now, some drivers will replace these generic versions with their own functions. It is pretty insane to expect them to do reference counting of the cursor (as an example, look at driver/xf86-video-vmware to see how that looks like as a workaround). There are even places in xserver itself which replace these two functions. The segfaults if no reference counting is done are caused because the reference count of the cursor reached zero, hence the cursor was freed, however xf86CursorEnableDisableFBAccess() brought it back to life from the dead (from the SavedCursor). This patch hence adds reference counting in xf86CursorSetCursor. As per Michel Daenzer's suggestion, also free the cursor upon xf86CursorCloseScreen. In theory with this it should be possible to remove the reference counting in the UseHwCursor functions I think, though it should also be safe to keep them. Signed-off-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 75efb46a14fe45ffe73faff637b1fa6d017e1e52 Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Mar 12 16:52:56 2010 +0100 hw/xfree86: fix refcounting in xf86_use_hw_cursor This is the same fix as was done in fcdc1d78cca3b8bb6b77d53eda7e21d649df6943 for xf86_use_hw_cursor_argb. Signed-off-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit df9b6f16b27398545cd4cff8a56dd59a3813351d Merge: 5f169f5 5172253 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 15 08:26:58 2010 -0700 Merge remote branch 'jeremyhu/master' commit 5f169f54936c9868ad0f3778cb95c1f35eef41ea Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Mar 5 10:35:54 2010 -0500 XQuartz: remove undefined XSERVER_CFLAGS variable This is a variable local to configure.ac which is not AC_SUBST() It is undefined in any generated Makefile. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5172253bae3b9867118c6717434e73c173acd5e9 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Feb 10 15:52:14 2010 -0800 XQuartz: Use an empty xkb keymap by default Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit b117bc7a441bec8f61610fb384d747112f73d236 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Mar 11 00:06:01 2010 -0800 XQuartz: Include os.h for OsAbort() Fixes regression from 5b9a52be7e975e59e0bbc6b43539ecaff96b2ecd Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit b7a16117c6d87a9d33a5f682b592b4507f2c065e Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Thu Mar 11 00:03:08 2010 -0800 XQuartz: GLX: Fix prototype for swapBuffers This was a regression introduced by 04a54f69a8085ab3fe11a8713bd8b6b16ed1db27 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 178da6534fe7ab4b99fb87925c04e6f963c88583 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 8 16:33:37 2010 -0500 Xext: Link to external libraries when necessary. Although the DDX should be linked to the necessary libraries, we may also need to pull them in directly to the module to ensure the symbols are resolved at runtime. Should fix this bug with XSELINUX: /usr/bin/X: symbol lookup error: /usr/lib64/xorg/modules/extensions/libextmod.so: undefined symbol: is_selinux_enabled -v2: use _LIBADD instead of _LIBS; remove SELINUX_LIBS from XSERVER_SYS_LIBS as it should only be needed in extmod. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a2ea8c2f2cc53607d57d60f41c879380ea70cd02 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Mar 11 14:19:04 2010 +0200 Record: Avoid duplicates from replaying frozen events Reintroduce a check which used to be there in the old ProcessKeyboardEvent/ProcessPointerEvent codepath, which avoids us recording events subject to a grab twice: once when it's first processed in EnqueueEvent, and then again when it's thawed and being replayed. This required a tiny amount of code motion to expose syncEvents. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f2eacb4646beb25d055de22868f93e6b24f229b6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 10 09:39:05 2010 +1000 Revert "dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)" Several users have pointed out that this commit introduces regressions, most notably perhaps fluxbox which essentially stops working after a few clicks. This reverts commit cf72b5437d2d620521279077a29c5df6d0fbb576. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit df9f3273041c6c3e0da2d2254e8c156cd582e296 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 10 09:24:32 2010 +1000 xfree86: fix xf86Config.c build error in --enable-debug mode. (#26971) xf86Config.c: In function 'configInputDevices': xf86Config.c:1514: error: request for member 'lay_identifier' in something not a structure or union make[5]: *** [xf86Config.lo] Error 1 Introduced with e1165632bdfbd720889ed1adf5f7ab338032c0ee. X.Org Bug 26971 <http://bugs.freedesktop.org/show_bug.cgi?id=26971> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> commit 116068103282924ef1476231d13d54719a797252 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 9 09:35:23 2010 +1000 xfree86: don't warn about nonexisting core pointer/keyboard in config. In the vast majority of cases there is no xorg.conf that specifies a core pointer/keyboard. Skip this warning, since we'll get another notification about how the server relies on the config backend for input devices anyway. Leave the warning in for the error case (AEI off). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit c39c8ece9bd3ce025549f4bac7794f5a62266f4a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 10 15:06:52 2010 +1000 os: remove INTERNAL_MALLOC define. There doesn't seem to be anything that defines it and given that the counterpart (the X internal malloc) was removed in 01cfba75229f4b9bf1e4fe80814931acdacde14c it's unlikely to work anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9f462ff9082634719e64d2d8d4dbd09ec7deaf2e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 26 14:02:09 2010 +1000 dix: Clip only into axis ranges if we're in absolute mode. (#26543) An absolute device in relative mode may provide valuators outside of the axis range. Clipping back into the range prevents screen crossings in a multi-screen (Xinerama) setup as the required screen edge for crossing is never met: miPointerSetPosition crosses the screen conditional to the X coordinate being equal to the screen width or _less than_ 0. While the former can be met when clipping into the coordinate range and scaling, the latter cannot, resulting in a mouse pointer that gets stuck on the rightmost screen. This patch only applies axis clipping for valuators in mode Absolute. If relative, we allow the values to get above/below the axis ranges. Doesn't matter, miPointerSetPosition will reset the values to the allowed range even if no screen was crossed. This leads to interesting values provided to clients, the valuator range of the device resets once a screen is crossed and essentially reflects the position of the cursor on the screen - scaled into the valuator range. The values themselves are valid given the range though. In theory, the XI1 specs require that a relative device has a min/max range of 0/0. This doesn't really go well with devices that actually can switch mode between relative and absolute since they would have to reset their axis range when switching. If multiple XI clients are in use, we have no method of notifying them about the changes, so other clients may continue to use the wrong axis ranges (note: XI1 wasn't really designed to have multiple clients use a device). Expecting all relative devices to have this min/max of 0 is unrealistic at this point. So pick what is possibly the lesser of all evils, pass the beer and despair. X.Org Bug 26543 <http://bugs.freedesktop.org/show_bug.cgi?id=26543> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 1f0e69b3a13258b79bffdec76b46f7960eb334b3 Author: Matt Turner <mattst88@gmail.com> Date: Mon Mar 8 10:54:21 2010 -0500 Don't check for Xinerama. It doesn't seem to be used anywhere, so don't require it. CC: Jerome Glisse <jglisse@redhat.com> CC: Alex Deucher <alexdeucher@gmail.com> CC: Dave Airlie <airlied@redhat.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit bbae92795c7eab062e6722c42fa7915e0cee5d69 Author: Matt Turner <mattst88@gmail.com> Date: Mon Feb 15 20:08:09 2010 -0500 Replace assembly with generic unaligned access code Removes Alpha assembly, and probably works around unaligned accesses on other sensitive platforms. Signed-off-by: Matt Turner <mattst88@gmail.com> Acked-by: Adam Jackson <ajax@redhat.com> Compiled-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1c2abec479cfbac9aeadc121af0825d368317658 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 26 11:44:17 2010 +1000 configure: move SELINUX_LIBS to XSERVER_SYS_LIBS All ddxs require linking against selinux if enabled. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Keith Packard <keithp@keithp.com> commit cab99b947c66a42dbf8a906bdb02e23aa7cab519 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 26 11:41:38 2010 +1000 configure: move libselinux requirement up to the common section. Let's have all version-specific requirements in one block. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9e7b6e565f6e69f20002bf03ed05fe8b63f86924 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 26 10:14:00 2010 +1000 dmx: fix OsAbort()-related build error in examples/xinput.c 5b9a52be7e975e59e0bbc6b43539ecaff96b2ecd changed the server to use OsAbort() instead of abort(). xinput in dmx is a client program though and fails to link if it tries to use OsAbort(). Switch it back to using abort(). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit cf72b5437d2d620521279077a29c5df6d0fbb576 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 25 12:49:21 2010 +1000 dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400) A client requesting a GrabModeSync button grab, owner-events true, with only the ButtonRelease mask set would never receive the press event even if the grab window had the ButtonPress mask set. The protocol requires that if owner-events is true, then the delivery mask is the combination of the grab mask + the window event mask. DeliverGrabbedEvents does this already for us, checking first the delivery based on owner_events and then based on the grab mask. AFAICT, the device cannot enter the states FREEZE_BOTH_NEXT_EVENT or FREEZE_NEXT_EVENT that would be handled by DGE in any possible path here. Bonus point - CheckPassiveGrabsOnWindows suddenly becomes a lot lesss complicated. X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit de86a3a3448f0a55c1cd99aee9ea80070a589877 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 25 11:37:05 2010 -0800 Allow for missing or disabled compat_output When the compat output is missing (I don't think this is actually possible), or is disabled (and hence has no crtc), we would like to avoid dereferencing NULL pointers. This patch creates inline functions to extract the current compat output, crtc or associated RandR crtc structure, carefully checking for NULL pointers everywhere. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fbbadca7e88391e81ab0f470290f5eec36aa9ce7 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 25 11:35:03 2010 -0800 Share enum definition for det_monrec_parameter sync_source There were two separate enum definitions, one inside det_monrec_parameter struct and one for a local variable (which was then stored inside the struct). Sharing a single definition makes the code more obviously correct while making the compiler happier. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 4b55b2cf8a52c39b53bae11cd1bc7314481d4c86 Author: Robert Bragg <bob@o-hand.com> Date: Wed Jan 27 20:38:38 2010 +0000 DRI2: initialize event->drawable in DRI2SwapEvent We weren't initialising the drawable in the event structure so the client side DRI2WireToEvent used for translating the event into a GLX event wouldn't be able to lookup up the corresponding GLXDrawable before passing the event on. Signed-off-by: Robert Bragg <robert@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 780c95caf9888fa4548dfe4c1c78a7e7ce99a9ed Merge: 018b177 758f697 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 24 09:59:19 2010 -0800 Merge remote branch 'whot/for-keith' commit 018b177591c9fade6d065e31858cc6e054d33eff Author: Kristian Høgsberg <krh@bitplanet.net> Date: Wed Feb 24 10:37:26 2010 -0500 glx: Compile fix to let server compile with new and old mesa We broke the __DRI2_FLUSH API since it was never released, but since it's taking a little longer than expected to get the X server side of the changes ready, fix things up so it compiles. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 758f6971750ed507e64eee817d720a77181439f2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 15 16:32:16 2010 +1000 dix: try to ring the bell even if the current device doesn't have one. (#24503) Evdev devices do not have the bell proc set, but XTEST devices do. By exiting early, the bell only rings if the last keyboard used was the XTEST keyboard and hence the bell proc is still set on the master but not if an evdev keyboard was used last. The better approach here is to try to ring the bell on all devices attached to this master device in case one or more actually do produce an audible sound. That's also XKB's behaviour if XkbUseCoreKbd is specified as device identifier. X.Org Bug 24503 <http://bugs.freedesktop.org/show_bug.cgi?id=24503> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> commit c0d941913199ed251fceab62fcf65437f6f9bd31 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 18 16:00:15 2010 +1000 dix: remove now-erroneous comment about frozen slave devices. A direct grab on a slave device through XI2 detaches it, regardless of whether the grab is sync or async. So this comment doesn't apply to XI2 anyway. For XI1, aside from your life being miserable already, it doesn't matter as XI1 does not have a concept of attachment. You can freeze a device and if you don't freeze _all_ other devices at the same time, the master device can still happily send events to the client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Adam Jackson <ajax@redhat.com> commit db4f676f25c6d8e58263d5151942be730592d444 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 3 15:40:47 2010 -0500 xselinux: Bump extension minor version. Changes introduced in this version: - 3 window-related requests now handle pixmaps also. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit a6cbcf6e782e65f3d4d14202ed0b7a8f65b33c9d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 3 15:38:57 2010 -0500 xselinux: Rename window-related requests that now support pixmaps. Renamed requests: SetWindowCreateContext -> SetDrawableCreateContext GetWindowCreateContext -> GetDrawableCreateContext GetWindowContext -> GetDrawableContext Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit ab68c707fd02613d9359120ba6402639dd8bd89e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 3 15:08:40 2010 -0500 xselinux: Allow GetWindowContext to be used for pixmaps as well. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit eb9210097efea81065c301e5b6b4da7a566deb4a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Jan 6 12:52:51 2010 -0500 xselinux: Remove reference counting calls for SID objects. Starting with libselinux 2.0.86, SID objects are no longer reference counted and the sidput() and sidget() calls are no-ops. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit 0c4b75a08922416050bb73d2e279ce938d3823e7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 21 21:59:01 2009 -0400 Don't print a failure message when XACE denies an input event delivery. A denial is normal and the behavior should be to drop the event. Having the log message creates excessive log spam. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit e687e11b1248494a45b9a4e4c321675526808703 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 21 21:46:50 2009 -0400 Revert "Remove some debug messages that trigger on XACE event delivery failure." The log messages still need to be there for non-XACE failures. This reverts commit 4be354c4c2da5168b302601b91bd80cfaca7e193. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit 2ecb9f7d86117f212d7845741a3e155553954a85 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 21 19:28:26 2009 -0400 libselinux now has a pkgconfig file. Use it. Also remove HAVE_NETLINK_AVC_ACQUIRE_FD tests, because we now require a version of libselinux that has it. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit 9fc6b59d46382e949526dc10c3f5bfddbe2acb92 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 15 17:32:21 2009 -0400 xselinux: Allow SetWindowCreateContext to be used for pixmaps as well. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> commit 93ff1bc5884cdfca1132af7fbc06c48e06f218c8 Author: Simon Farnsworth <simon.farnsworth@onelan.co.uk> Date: Mon Feb 15 14:18:00 2010 +0200 Always enable outputs that have been forced on in the configuration file If the user has gone to the effort of manually enabling an output in the configuration file assume that they know what they're doing. X.org Bug 14611 <http://bugs.freedesktop.org/show_bug.cgi?id=14611> Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ca9c2472d74c7107ccc117e2c9c723c168d2eccf Merge: e40ba57 02d1116 Author: Keith Packard <keithp@keithp.com> Date: Mon Feb 22 13:26:06 2010 -0800 Merge remote branch 'whot/for-keith' commit e40ba5798c367bec584f6437b23d2c5f801fd013 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 18 15:49:09 2010 +1000 Xi: assume BadMode for non-BadMatch errors returned from SetDeviceMode. The XI protocol spec only allows for two errors on the SetDeviceMode requests: BadMatch or BadMode. BadMode however is a dynamically assigned extension error and the driver doesn't have access to the actual error number. Hence, if a SetDeviceMode driver returns an error other than BadMatch, assume BadMode. The two exceptions are BadAlloc and BadImplementations, pass these on to the client (any request is allowed to return either of those). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 02d1116e7eb84068fa32477f1640d29b0a81b638 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 11 16:35:36 2010 +1000 Xi: assume BadMode for non-BadMatch errors returned from SetDeviceMode. The XI protocol spec only allows for two errors on the SetDeviceMode requests: BadMatch or BadMode. BadMode however is a dynamically assigned extension error and the driver doesn't have access to the actual error number. Hence, if a SetDeviceMode driver returns an error other than BadMatch, assume BadMode. The two exceptions are BadAlloc and BadImplementations, pass these on to the client (any request is allowed to return either of those). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 122fc0e7a0712df4ec2bd9ca6773f90bcd2095cf Author: Chris Dekter <cdekter@gmail.com> Date: Thu Feb 11 16:34:09 2010 +1000 Re-enable RECORD extension. RECORD was disabled during the switch to internal events. This patch modifies the record callback to work with internal events instead of xEvents. The InternalEvents are converted to core/Xi events as needed. Since record is a loadable extension, the EventTo* calls must be externed. Signed-off-by: Chris Dekter <cdekter@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 03ef00ae79687046dc9f9987857062a16ff2c2e0 Author: Michel Dänzer <daenzer@vmware.com> Date: Wed Feb 17 11:40:44 2010 +0100 EXA/mixed: Clean up exaPrepareAccessReg_mixed() a little. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9623daad7c864d46b0dfcbb6e689820b96cc8115 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Feb 17 11:40:43 2010 +0100 exa/mixed: fix gnome-panel corruption - A mapped pixmap can't be used for acceleration, any decent memory manager will refuse this. - Source pixmaps migrated with a bounding region are incomplete (from the gpu point of view), so do the upload unconditionally, instead of just for deferred destination pixmaps. - Fixes fd.o bug #26076. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5b9a52be7e975e59e0bbc6b43539ecaff96b2ecd Author: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Date: Thu Jan 28 11:08:34 2010 +0200 os: Prevent core dump from being truncated. The problem fixed by this patch can be reproduced on Linux with the following steps. - Access NULL pointer intentionally in ProcessOtherEvent on key press. - Instead of saving core dump to a file, write it into a pipe. echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern - Dump the core by pressing a key. While the core is being dumped into the pipe, the smart schedule timer will cause a pending SIGALRM. Linux kernel stops writing data to the pipe when there are pending signals. This causes the core dump to be truncated. On my system I'm expecting a 6 MB dump but the size will be 60 kB instead. The problem is solved if we block the SIGALRM caused by expired smart schedule timer. I haven't been able to reproduce this problem in the following cases. - Save core dump to a file instead of a pipe. - kill -SEGV `pidof Xorg` - Press a key to dump core while gdb is attached to Xorg. - Give option -dumbSched to Xorg. Also note that the fix works only when NoTrapSignals has the default value FALSE. The problem can still be reproduced if error signals aren't trapped. In addition to pending SIGALRM, there is a similar problem with pending SIGIO from the keyboard driver during core dump. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ca364ca82a760d8e5347a6f9f79636c9a5e4e03f Author: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Date: Thu Jan 28 11:08:33 2010 +0200 os: Introduce OsAbort for proper core dumps. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 031f92bf9ab15226df410012a0d1c9c390efc36d Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Wed Feb 3 10:05:20 2010 +0200 parser: corrected xf86getBoolValue to use case insensitive compare commit c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 introduced this regression; it can cause existing config files to be parsed incorrectly. Acked-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit be96fb2f02c13a6ee8aba40f7d4c3f9141f06cea Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Feb 15 17:42:11 2010 -0800 Solaris xf86OSRingBell() off-by-one error in filling iov[] array When generating sound buffers for /dev/audio bells, insert waveform for beep *or* silence, but not both, so we don't write one entry past the end of the iov buffer when the final bit of soundwave ends up in the final entry allocated in the iov array. Fixes OpenSolaris bug 6894890: http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6894890 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2d40f22d1ec970a84b23aa42b1feca4feedeb4bb Author: Matt Turner <mattst88@gmail.com> Date: Mon Feb 15 20:05:24 2010 -0500 Use C-style comments in x86emu Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 4e8bf12b13690afa6d9fee0e339d3819ef16fb3f Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Feb 15 16:46:21 2010 -0800 XQuartz: Fix a possible buffer overrun in quartzAudio Also dropped deprecated API while there Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 4127e8e5be5c366eb752bbb8d7f0ff5b519e641b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Feb 10 17:56:30 2010 -0800 XQuartz: clang static analysis fixes Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit c686c5cbdc5f35744407af5f9aabbd18cc17714b Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Feb 15 15:03:01 2010 -0800 XQuartz: Fix linking (CloseInput()) Fixes regresison from d33adcdf03c69407d151e732fa0cf9947151eb19 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 84905007702da2c05a4f7446b3fc5ff52be49655 Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Mon Jan 4 15:00:49 2010 -0500 udev: Don't filter subsystem "input" This allows serial wacom devices to work, whose subsystem is "tty". Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8736d112afb0dd61dfdaadd6378eafd200b2ef5f Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sat Feb 13 10:40:40 2010 -0800 xfree86: Reorder InputClass option priorities Currently the config and InputClasses are merged together so that the options from the config backend have the highest priority. This is bad since it means options such as a default XKB layout set by the backend cannot be changed by the user. This patch changes order of precedence to be: 1. xorg.conf 2. xorg.conf.d (later files have higher priority) 3. config backend In order to allow this ordering, the config parsing has been changed to read the xorg.conf.d files before xorg.conf. This has the consequence that the core device picking which looks for the first InputDevice may not find it in xorg.conf. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 48f7298657f91843db36566b8d66d6c4c18dbd4c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jan 13 15:03:45 2010 +1000 Xi: reset the sli pointers after copying device classes. (#25640) If the indicator flags have the XkbSLI_IsDefault bit set, the indicator map and names aren't their own bit of memory but rather point into the device->key->xkbInfo->desc structure. XkbCopySrvLedInfo knows about this and leaves the pointers alone. When copying the classes from the slave to the master, these pointers are copied and still point to the dev->key class of the slave device. If the slave device is removed, the memory becomes invalid and a call to modify this data (e.g. XkbSetIndicators) may cause a deadlock. The copying of dev->key relies on dev->kbdfeed to be already set up. Hence the pointers need to be reset once _both_ kbdfeed and key have been copied into the master device. X.Org Bug 25640 <http://bugs.freedesktop.org/show_bug.cgi?id=25640> Fedora Bug 540584 <https://bugzilla.redhat.com/show_bug.cgi?id=540584> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit d33adcdf03c69407d151e732fa0cf9947151eb19 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:22:02 2010 +1000 dix: move config_init into the DDX. The only DDX currently using hotplugging is the xfree86 one and it looks like it'll stay that way for a bit. Move the initialization to the DDX, since Xephyr, Xnest, and friends don't need HAL or udev notifications. Add CloseInput (counterpart to InitInput) to be able to clean up the config initialization from the DDX as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 001ce71dc11287dc94cc2fbc5d35677c046e6c04 Author: Julien Cristau <jcristau@debian.org> Date: Fri Feb 12 23:34:57 2010 +0100 dix: restore lastDeviceEventTime update in dixSaveScreens This was removed in 6b5978dcf1f7ac3ecc2f22df06f7000f360e2066 (Do not reset lastDeviceEventTime when we do dixSaveScreens), but caused a regression for XResetScreenSaver. Add the lastDeviceEventTime update back, but restrict it to that case. X.Org bug#25855 <http://bugs.freedesktop.org/25855> Reported-by: Lubos Lunak <l.lunak@suse.cz> Tested-by: Lubos Lunak <l.lunak@suse.cz> Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 97b03037f4d99fcebc7603011f41c3aff9871ce2 Author: Peter Harris <pharris@opentext.com> Date: Fri Feb 12 15:36:30 2010 -0500 Don't double-swap the RandR PropertyNotify event The event is already swapped in randr.c/SRROutputPropertyNotifyEvent, so it should not be swapped here. X.Org Bugzilla #26511: http://bugs.freedesktop.org/show_bug.cgi?id=26511 Tested-by: Leonardo Chiquitto <leonardo@ngdn.org> Acked-by: Adam Jackson <ajax at redhat.com> Reviewed-by: Julien Cristau <jcristau at debian.org> Signed-off-by: Peter Harris <pharris@opentext.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0b73f98cbd1803b82c2faf1a40f1a0037673d712 Author: Soeren Sandmann <sandmann@daimi.au.dk> Date: Fri Feb 12 20:04:53 2010 +0100 xfree86: Add qxl driver to the autoconfig logic The qxl driver is for the QXL virtualized graphics device. Signed-off-by: Søren Sandmann Pedersen <ssp@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9c5bb550a2234e4bee2a144417d74c6bdf160e89 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 12 13:46:03 2010 -0800 Bump to 1.7.99.901 -- 1.8 RC1 commit 57ffeb3f2b3313dcef92a396f1f55fdbc064b2c5 Merge: c6d9bc0 c76248f Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 12 13:36:32 2010 -0800 Merge remote branch 'jturney/master' commit c6d9bc092c84ad5c68083a126aa7577baa42cef7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 10 15:36:50 2010 +1000 Add tag matching to input attributes. Tags may be a list of comma-separated strings that match against a MatchTag InputClass section. If any of the tags specified for a device match against the MatchTag of the section, this match is evaluated true and passed on to the next match condition. Tags are specified as "input.tags" (hal) or "ID_INPUT.tags" (udev), the value of the tags is case-sensitive and require an exact match (not a substring match). i.e. "quirk" will not match "QUIRK", "need_quirk" or "quirk_needed". Example configuration: udev: ENV{ID_INPUT.tags}="foo,bar" hal: <merge key="input.tags" type="string">foo,bar</merge> xorg.conf: Section "InputClass" Identifier "foobar quirks" MatchTag "foo|foobar" Option "Foobar" "on" EndSection Where the xorg.conf section matches against any device with the tag "foo" or tag "foobar" set. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 3ac43df5d4a25d6e0058b327fa05a1c1436b4794 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 10 15:36:49 2010 +1000 Add xstrtokenize to the dix. Move tokenize out of the parser, make it a dix util function instead. Splitting a string into multiple substrings is useful by other places, so let's use it across the line. Future users include config/hal, config/udev and of course the parser. Example usage: char **substrings = xstrtokenize(my_string, "\n"); Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 27d1b86d1b858f931b4cb1b6ddf857c76d92a6d9 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed Feb 10 15:36:48 2010 +1000 xfree86: Set fnmatch pathname flag for InputClass device matching Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9b369f71273fb117c982e6ce16cd4462f206d365 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed Feb 10 15:36:47 2010 +1000 xfree86: Allow multiple arguments to InputClass matches In order to keep the number of InputClass sections manageable, allow matches to contain multiple arguments. The arguments will be separated by the '|' character. This allows a policy to apply to multiple types of devices. For example: Section "InputClass" Identifier "Inverted Mice" MatchProduct "Crazy Mouse|Silly Mouse" Option "InvertX" "yes" EndSection This applies to the MatchProduct, MatchVendor and MatchDevicePath entries. Currently there is no way to escape characters, so names or patterns cannot contain '|'. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a378e361a5de89f0be8b68ebc3e854f56cefe666 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed Feb 10 15:36:46 2010 +1000 xfree86: Use "Ignore" option in InputClass to skip devices Sometimes it is desirable to skip adding specific input devices to the server. The "Ignore" option is used similarly to Monitor sections so that matched devices will not be added. BadIDChoice is returned to the config backend so that it will clean up all resources. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8b1a685f00ae76be864cc188943a0874f48b8d64 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed Feb 10 15:36:45 2010 +1000 xfree86: Handle config files ending without newline The config parser expects to find a newline at the end of each line, so files ending without one would confuse it. A newline is inserted at the end of the buffer in these situations. Additionally, switching to the next config file is moved to the higher level to allow parsing of the last line of the previous file to complete before shifting the index and resetting the line number. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Stephan Raue<stephan.raue@gmx.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 67bc278a511ca6ec42e1f8d2d5897c0109e94e2c Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed Feb 10 15:36:44 2010 +1000 xfree86: Make InputClass docs and comments match reality Drivers and options specified in InputClass sections work on a "first match wins" strategy. Let's be consistent when documenting it. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a34812b09000db2ff2a1dc6182602839123edd4e Author: Benjamin Tissoires <tissoire@cena.fr> Date: Mon Feb 8 13:50:43 2010 +0100 Add labels for multitouch valuators Thoses definitions have been included in the kernel but the X server is not updated accordingly. Without these definitions, the multitouch axes are not correctly labelled. Signed-off-by: Benjamin Tissoires <tissoire@cena.fr> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c76248fda99c38aef0ccf0ed6b58fbe95f6fe497 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Feb 2 20:53:44 2010 +0000 Cygwin/X: Avoid a collision between DEBUG and a token name Rename a token to avoid a collision between DEBUG defined via AC_DEFINE if --enable-debug is configured, and the token for the 'debug' instruction in the XWin preferences file Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit b7dbbd3cd4d28cd4939706b3bf6394ba8ecafaff Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 22 23:35:09 2009 +0000 Cygwin/X: Avoid cursor size log spam Fedora 12 likes to use a 39x26 animated wait cursor. Avoid spamming the log with warnings that each frame can't be completely contained in the 32x32 native cursor Also reformat log message so it doesn't contain a '\n\t'. I mean, it's not like we might want to grep the log or something... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit c9cbbd5d1cfa58a2d9f08e25534ea8439284322d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Nov 28 17:51:33 2009 +0000 Repair '-nolock' commit 446fe9eecddd1337f9d5164dd7c301e1ba3dfe32 removes the AC_DEFINE for SERVER_LOCK and conditional compilation checking it, making it always on everywhere, except in os/utils.c where code is left under SERVER_LOCK, which now never gets built, making the '-nolock' option non-functional... This seems to have been broken since Xserver 1.7.0, but this option is actually of some slight use on cygwin, as if /tmp resides on a FAT filesystem (yes, I know...), hard links aren't supported. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 7f54ccafadf99c0a1a3e788734199b306b4fa51d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Jan 16 13:12:12 2009 +0000 Cygwin/X: Make transient windows resizable again Reverts the change which makes parented windows non-resizeable Because this was trying to do something which we should be doing, as an alternative we try checking WM_NORMAL_HINTS for windows which shouldn't be resizable If a window has a maximum size specified, no maximize box If a window has a fixed size (max size == min size, per EWMH 1.3 Implementation Notes), no resizing frame Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 654d2e372dc2978ce379ab9f02137333ec224f0c Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Nov 10 13:24:40 2009 +0000 Cygwin/X: Discourage other WMs in multiwindow mode Tidying up of other WM detection code when ading SWT/Motif fix in commit 71519a572fe15b85c0eb2b02636c9e871f2c858f was rather over-agressive and now allows other WMs to think they can start when the internal WM is running. Revert to the behaviour of selecting ButtonPressMask events as well on the root window, so other WMs will be dissuaded from starting Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 26857b1c2003797b02e258247f63064aa1e37c10 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Oct 31 17:19:17 2009 +0000 Cygwin/X: Update XWin man page Restructure to group similar options and offer some commentary on those groups Review option descriptions, clarify and bring up-to-date Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 6f1836bfbd80e88d4c57a32757d0a5b398504c35 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Nov 2 17:37:14 2009 +0000 Cygwin/X: Update DDX specific -help text Alphabetize options Review option descriptions, clarify and bring up to date Add missing option descriptions Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 22982b9e95a2339d5ba60d66263e42a0331ee41f Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Oct 29 18:50:23 2009 +0000 Cygwin/X: XSupportsLocale() failure is non-critical Treat XSupportsLocale() returning false as non-critical to internal client theads startup, and issue a warning, not an error Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit f60b7712b3451649f138b158ee282be89a66b9ef Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Feb 1 17:13:00 2010 +0000 Cygwin/X: Report BUILDERSTRING with version information Report BUILDERSTRING with version information Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit ed2c2a68e1e6b409c198a52d99d300eb6d517e89 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Feb 1 17:12:57 2010 +0000 Define FD_SETSIZE on Cygwin regardless of XWin DDX All DDXs segfault on Cygwin unless -DFD_SETSIZE=256 is set, so make sure we do so whether or not we are building XWin. FD_SETSIZE must be at least XFD_SETSIZE for uses of select() to be correct. The Cygwin default is only 64, so it must be increased to 256 Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 2f2f3da080629d410dd99e281c382b54f0dbbf5d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Jun 19 21:14:47 2009 +0100 Cygwin/X: Copy the state of the Windows keyboard device to the Virtual Core Keyboard at startup. Otherwise, this happens lazily after the first keypress, which can lead to applications which are started from a shell window and inspect the keyboard state before a character is typed getting the wrong idea about the desired keymap (e.g. xemacs shows this behaviour) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 7a440e5b7a416e582b6c3cc4c33822854ce73aed Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Oct 4 15:55:40 2009 +0100 Cygwin/X: Tidy up system.Xwinrc Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 11252ed82e1f361b99e86521ac9314f868bd1a3a Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Feb 1 17:11:54 2010 +0000 Cygwin/X: Look for system.Xwinrc in SYSCONFDIR/X11 Look for system.Xwinrc in SYSCONFDIR/X11 (usually /etc/X11) Rename sample system.Xwinrc file not to have a X11R6 path in it's name Add makefile install rule for system.XWinrc Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 34269a90ea2087f883f5dc8805894fc4998e4b81 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Tue Feb 2 16:21:44 2010 +0000 Cygwin/X: Update resources file and About dialog Use the configured vendor web address in the About dialog Update resources file: rework About dialog, use 'MS Shell Dlg 2' logical font for all dialogs, add ellipsis to exit option in tray menu as it (may) trigger another dialog. Get short vendor name from xwin-config.h, like other configuration data presented in the About dialog box, rather than creating the PROJECT_NAME define Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 881812438b430d2856d0494707e028e5f30d6e9a Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 2 16:22:39 2010 +0000 Xming: Use 8 point font for URL in About dialog Use an 8 point font for URL in About dialog, to match the rest of the text in that dialog Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit c02638fd68440513b6046315547c554a910bd7e2 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 2 16:08:45 2010 +0000 Xming: Add a manifest file Use manifests to enable XP style controls (only effective for XP and later and when themes are enabled). The addition of manifests shouldn't cause compatibility problems with older Windows versions. Manifest must have execute permissions, otherwise attempts to execute XWin.exe in the same directory will fail... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit fd8a32baba77aba8d124658a19f4f6eda79e49c6 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Jun 19 21:14:39 2009 +0100 Cygwin/X: Window placement refinement for multiwindow mode Window placement refinement for multiwindow mode, ensure a window actually ends up somewhere visible if it tries to create itself offscreen (which can happen for e.g. if it has a stored position from a different sized display) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 7eb840fd42bc62d88fb4fcf6600546c9ff6e56be Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Feb 2 15:42:12 2010 +0000 Cygwin/X: Respect the system's ownership of the clipping region Respect the system's ownership of the clipping region used for shaped windows Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit bad41bdfd4a12f0c92fd221bffd9f3c5e40d0fe1 Author: Colin Harrison <colin.harrison@virgin.net> Date: Mon Feb 1 17:11:22 2010 +0000 Xming: Always update the Windows title Unicode (wide-character) in -multiwindow mode. Apply the Windows title wide-character in -multiwindow mode. Windows should now display correct client X Window titles for locales with wide characters. Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 901c4ebf620579c5bb951a8c003430d967ecf2ff Author: Julien Cristau <jcristau@debian.org> Date: Mon Jan 11 00:31:27 2010 +0000 main: move config_init() after InitInput() With the udev backend, config_init() calls NewInputDeviceRequest(), which enables devices. They can then start sending events, even though the event queue is only initialized later in InitInput(). Oops. Debian bug#564256 <http://bugs.debian.org/564256> Reported-by: Sedat Dilek <sedat.dilek@googlemail.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7f648777680b9dea31c4adb657e205fc6880d98b Author: Dan Nicholson <dbn.lists@gmail.com> Date: Thu Jan 14 16:42:16 2010 +1000 Don't use AC_CHECK_FILE for fontpath checks when cross compiling AC_CHECK_FILE chokes when cross compiling, so instead we set the default to the standard FONTROOTDIR directories in that case. Signed-off-by: Dan Nicholson<dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit db687f718f760ba254ab51994769db101dc9ca3a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 10:07:38 2010 +1000 xkb: sed True -> TRUE and False -> FALSE Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 0ea2b0bd02f8683998e8b9ebc2b96d606ce45f45 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 18 20:07:30 2009 +1000 xkb: Add XKM file format description. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 08b22c7faf97217ea4d497eec6624fc3dd916d9b Author: Oldřich Jedlička <oldium.pro@seznam.cz> Date: Sun Jan 17 17:59:03 2010 +0100 Allow driver to call DeleteInputDeviceRequest during UnInit When the input driver (like xf86-input-wacom) removes it's devices during a call to UnInit, the CloseDownDevices() cannot handle it. The "next" variable can become a pointer to freed memory. The patch introduces order-independent device freeing mechanism by remembering the already freed device ids. The devices can reorder any time during freeing. No device will be double-freed - if the removing failed for any reason; some implementations of DeleteInputDeviceRequest don't free the devices already. Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b91cec26de367f75388e620772747b08eee34294 Author: Horst Wente <horst.wente@acm.org> Date: Wed Dec 30 19:35:20 2009 +0100 xkb: make ctrl+alt+keypad + / ctrl+alt+keypad - work again (#25743) Video mode switching via keypad keys did not work Signed-off-by: Horst Wente <horst.wente@acm.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 993e78d6c433f65bd8a87890a6bb6da480b2cdc4 Author: Oldřich Jedlička <oldium.pro@seznam.cz> Date: Tue Jan 12 19:15:06 2010 +0100 Fix typo in updateSlaveDeviceCoords The index [0] for the second valuator looks bogus; fix it. Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 52456c602c3cdd7d5eac677889a18fad37dfb7ae Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sat Jan 30 14:49:02 2010 -0800 XQuartz: Attatch a stub display when CoreGraphics reports no displays. This is half of the required changes to address the "stuck mouse pointer" bug that occurs when X11 launches while the displays are asleep. The remainder of the fix is part of libXplugin which needs to be updated to send XP_EVENT_DISPLAY_CHANGED when the display wakes up. If you don't have a recent enough libXplugin (expected in 2.5.0_beta2 or later), you can cause this event to be sent by changing your display resolution (or you could just start X11.app with your screens awake). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 15f4bb6dc64313ff100aa5444a94c60922a498df Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Wed Jan 27 17:12:12 2010 -0800 XQuartz: Dead code removal Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit 7ba5de6e9e1e8efda9f79af601fb6269bae841ce Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jan 30 10:55:38 2010 -0800 XQuartz: Add some .gitignore magic Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 4d575b0559817258f7a0ce6c4d2d0f9e7e5bba63 Author: Robert Morell <rmorell@nvidia.com> Date: Fri Jan 29 19:07:03 2010 -0800 RENDER: Fix gradient and solid fill pictures with Xinerama, and misc cleanup If these aren't wrapped, then procs that are wrapped (such as RenderChangePicture) will fail in Xinerama when they see the resource type of a picture created through one of these interfaces is PictureType and not XRT_PICTURE like those allocated via RenderCreatePicture. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8d6b1838330625b758ebc55bb0df1b425c5cefaf Author: Robert Morell <rmorell@nvidia.com> Date: Thu Jan 21 12:38:47 2010 -0800 Render: Fix request size verification RenderSetPictureClipRectangles and the Xinerama version of RenderChangePicture were using the wrong structure types for request size verification. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5e81078cf56aabbf6551d96d312c7840ba9370ae Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Jan 18 14:31:12 2010 +0200 xfree86: vgaarb: remove useless debug This is RAC's remnant. Any sane person would use a more wise method of debugging instead. X.Org Bug 26074 <http://bugs.freedesktop.org/show_bug.cgi?id=26074> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit e38df06772965cd5099646f1e7032b7c944d16ed Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jan 28 14:33:25 2010 -0800 DRI2: Bump the dri2 module version to 1.2.0 to reflect recent API changes. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 60b6477f6dc005a1b052be8c5e5a549550a4aa88 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Jan 14 17:18:28 2010 +0200 dix/configure: remove null root cursor option The default behavior of the server is to start with an invisible root cursor. Be such cursor invisible or inexistent (null), in the end it doesn't matter - for the user. The content on screen will be the same. Besides, there's no difference, in terms of performance, whether such cursor is invisible or simply null. The paths that both take inside the server are roughly the same. Therefore create a null root cursor becomes irrelevant. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit b4baab90c0d98bef98d485682d4a69a327a380d6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 8 15:18:41 2010 +1000 dix: EventToCore needs to copy the root window too. This value isn't actually set for normal events but it saves us some work for the record extension support. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 27fc98ecfed99fefd5c14388b4c6242f87281895 Author: Keith Packard <keithp@keithp.com> Date: Wed Jan 27 14:37:32 2010 -0800 Revert "dix: EventToCore needs to copy the root window too." This reverts commit 0f2d297dedeff8bd227df4c498cc668b0e902344. Peter provided an updated patch which fixes the tests. commit 711e26466ae04ae93ff4c48d377d83d68a6320e9 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Mon Jan 25 09:21:51 2010 -0800 DRI2: handle drawable destruction properly at DRI2SwapComplete time Simon reported an issue with kwin that turned out to be a general problem. If a drawable goes away before its swap completes, we'll try to free it up. However, we free it improperly, which causes a server crash in DRI2DestroyDrawable. Fix that up by splitting the free code out and calling it from DRI2SwapComplete. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit b68f0204a2e4fa9d8884cbdd84b6a5df21d6b36e Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Wed Jan 27 09:10:41 2010 -0800 xserver: require libdri 7.8.0 to build We depend on new DRI interfaces now, so require them in configure.ac. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 003829072853546abd973266fe9b24d803f4f5cb Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jan 26 22:25:04 2010 -0800 Avoid segfaults in XF86VidMode GammaRamp functions if randr_crtc is NULL Fixes crash when xscreensaver tries to use GammaRamp calls to fade out http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6915712 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 19d03d4f49e08442f58cf02240e3e6bab04633d2 Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Jan 26 20:15:49 2010 -0500 doc: finish the removal of SecurityPolicy file man pages The variable was unassigned but all the code was left in. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7962c8f78964d460c76f76dda2795b971a8c2a94 Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Jan 26 20:02:13 2010 -0500 man: add missing __datadir__ for Xserver XWin man pages The man pages display __datadir__/fonts/X11/... because __datadir__ is missing in cpprules.in. Problem was introduced in commit: b54bc14ce0ae38c4863794bc3096ca86cdb23908 when replacing __projectroot__ in the previous font path. Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d2322b6309bf15a45002b42e7e6ba3d6b5bfa932 Author: Kok, Auke <auke-jan.h.kok@intel.com> Date: Wed Jan 27 11:34:45 2010 -0800 xserver: Add timestamps to logfile output. Add timestamps in seconds derived from clock_monotonic to the log file. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0b21a0416b4cb2c32da5e3fda05a0682eb97d56e Merge: 1e6fd65 837bd2b Author: Keith Packard <keithp@keithp.com> Date: Wed Jan 27 14:14:15 2010 -0800 Merge remote branch 'alanc/master' commit 1e6fd65d0b95260253828678131885a4ec21c594 Author: Michael Vogt <mvo@ubuntu.com> Date: Mon Jan 25 18:41:20 2010 +0100 xfree86/modes: only call gamma_set if its non NULL I ran accross a crash with xf86-video-nv-2.1.15 [1] and xserver 1.7.3.901. It looks like the problem is that gamma_set is called even if that is NULL. [1] https://launchpad.net/bugs/494627 Reviewed-By: Matthias Hopf <mhopf@suse.de> Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0688dca044f966abc3da667f6d4e79e7cf47f996 Author: Eric Anholt <eric@anholt.net> Date: Thu Jan 21 10:31:04 2010 -0800 dri2: Fix order of operations issue in __glXdriSwapEvent test. Clients would have received swap events regardless of asking for it. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1 Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Wed Jan 27 14:03:03 2010 -0800 Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5. *xoff and *yoff were uninitialized for source-only pictures.x Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c3395158678aaab9dca5fc6a812cbe715ddc0e1a Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Jan 15 14:13:18 2010 -0500 packaging: provide a default README file #24206 All modules should have a README file. The bottom URL section is found in all X.Org README files. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit f311f2d047120fb816897444d2101465ff5189db Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Jan 13 11:35:52 2010 -0800 DRI2: Allow multiple driver names. Each driver type (e.g. DRI2DriverDRI or DRI2DriverVDPAU) can have a name in the driverNames array in DRI2InfoRec. DRI2Connect returns the name for the driver specified by driverType. Also print names of supported drivers in DRI2ScreenInit. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit f57bc0ede8e018c7e264b917927c42a018cd1d5a Author: Christian Zander <chzander@nvidia.com> Date: Mon Jan 11 12:29:07 2010 -0800 x86emu: Respect the LEA 67h address size prefix. Signed-off-by: Christian Zander <chzander@nvidia.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 837bd2bbc02b893f96861b48c1f02b7b8e7e3e48 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 16 22:32:15 2009 -0700 Remove unbalanced ( from failure to move log error Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> commit 138d4c1670ebab435bf00627c97098a3a54b81a6 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Sat Jan 16 21:03:00 2010 -0800 glx: Sun compilers now support some gcc __attribute__ values Sun cc 5.9 and later (__SUNPRO_C >= 0x590) support __attribute__ calls for aligned, always_inline, noinline, pure, const, and malloc. This commit consists of the related updates to files that were regenerated by gl_XML.py in mesa after adding the __SUNPRO_C checks to it Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Brian Paul <brianp@vmware.com> commit 79e7b0b875634d0f9e1a95232a4e38adf617bc14 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Sat Jan 16 10:45:32 2010 -0800 Only enable kdrive input drivers on Linux by default Fixes build on non-Linux platforms by restoring the defaults to where they were before commit 6c2b3a4247d10a50699ffa6abb643c5e959eefa8, to only enable the Linux kbd, mouse & evdev drivers when building on Linux platforms. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 39ab474197bdad7d8e9ef496df2d61cbea39d370 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 15 19:07:38 2009 -0800 Move OS-specific VT key handler code from common to os-support Adds new function xf86Activate to the OS-specific *VTsw*.c files and calls it from xf86ProcessActionEvent Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (GNU/Linux) commit 15ca3312c069526b7f2207de9dfb9b9e851caf95 Author: Aaron Zang <Aaron.Zang@Sun.COM> Date: Mon Dec 14 17:55:46 2009 -0800 Solaris: Avoid switching to inactive VT's Fix for OpenSolaris bug 6876992: "[vconsole] Ctrl+Alt+F12 switchs to blank console screen with hotkeys property turned-off" http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6876992 Xorg needs to do sanity test for the VT it is commanded to switch to. If the VT is not opened by any process, discard the switching request. The changes also contain the fix for some flaws discovered when getting the new gdm to run. Signed-off-by: Aaron Zang <Aaron.Zang@Sun.COM> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 2984c18eb994696927a7f3b94d86fd47907334a0 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Jan 21 14:21:07 2010 -0500 config: replace custom code with reusable macro XORG_WITH_DOXYGEN XORG_WITH_DOXYGEN provides additional functions like a configure option which allow platform builders to control the usage of the doxygen program. This is a requirement from platforms that do not have such doc tool. A platform with a back level doxygen may use --without-doxygen to get the rest of the documentation built. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit d9c20ee4191de7276a08288adffc24dff48aff8f Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jan 15 19:34:29 2010 +0200 dix: move cursor realize code to its own function The semantic remains, only code was moved: reuse chunk of code to realize cursor on both AllocARGBCursor and AllocGlyphCursor. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f818f222362c93bcc859d997d96d8f3b447729f4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:19 2010 +1000 xkb: unexport xkbDevicePrivateKey and xkbUnwrapProc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6850ea8fb95417db9ce3a70fc17f90d6fdea1389 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:16 2010 +1000 xfree86: replace True/False with TRUE/FALSE. xf86Xinput.c relied on xkbsrv.h's definition of True/False which seems odd at first and weird on second glance. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 64b1372c15c3ede2696346e153bca9bd89016a20 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:15 2010 +1000 xkb: remove unused _XkbIsPressEvent and _XkbIsReleaseEvent defines Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c8bba14a390fe3fa16027e6b2433a314b3ea00c3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:13 2010 +1000 xkb: remove XkbAtomGetString, replace with NameForAtom. XKB really XKBdoes not XKBneed its own XKBdefines for XKBeverything. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Keith Packard <keithp@keithp.com> commit f37799c9712afb7769f369162b904d9ea2dbd608 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:12 2010 +1000 xkb: remove IsKeypadKey define, only used in two places. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Keith Packard <keithp@keithp.com> commit c8076f317ee5044ed3cc21b097f8b1741af8e0f1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:11 2010 +1000 xkb: remove XConvertCase. Since it's typedef'd to XkbConvertCase anyway and the headers are now split from the client headers, simply get rid of it altogether. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d627dd9d1ef436b01f0581e40a6736ffc6b5d2c8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:10 2010 +1000 xkb: remove _XkbClearElems, a memset will do. Bonus point - it's easier to understand what's actually being done with the memory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Keith Packard <keithp@keithp.com> commit ea1de3fcdc40d2060bb6d13775005eadd624e767 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 15 15:32:09 2010 +1000 xkb: remove _XkbTyped*alloc Please no extension-specific macros for memory allocation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0f2d297dedeff8bd227df4c498cc668b0e902344 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jan 5 16:31:37 2010 +1000 dix: EventToCore needs to copy the root window too. This value isn't actually set for normal events but it saves us some work for the record extension support. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6f6a99abc12ddee82898fdabfb50c17e90e094b9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jan 13 14:39:54 2010 -0800 XQuartz: Don't FatalError in x_hook_run if the list is empty Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 6bde306f7f6b9bbabeaa8bb910ea549be906cd8b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jan 13 11:20:29 2010 -0800 XQuartz: Update copyright in bundle for 2010 Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 6008cc116493cb2825ad0bda0b407b7aefabb3f4 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Jan 11 18:02:55 2010 -0800 XQuartz: Setup the modifier map in the quartz thread This avoids possible doing it twice which could result in incorrect keycodes for alt due to our loss of information about its side. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 44f9c3d16c9c9b3362306a9ba26ee52e7baafeca Merge: 032f978 84956ca Author: Keith Packard <keithp@keithp.com> Date: Wed Jan 13 10:19:21 2010 -0800 Merge remote branch 'jbarnes/master' commit 84956ca43b087600d9db297cffd62e960c516d9e Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Mon Jan 11 14:56:24 2010 -0500 GLX/DRI2: add INTEL_swap_event support This allows clients to easily check for swap completion status in their main loop. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@nwnk.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 04a54f69a8085ab3fe11a8713bd8b6b16ed1db27 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu Jul 16 09:01:17 2009 -0400 DRI2: add support for new DRI2 protocol requests Support the new DRI2 2.2 protocol requests: DRI2SwapBuffers, DRI2GetMSC, DRI2WaitMSC, DRI2WaitSBC and DRI2SwapInterval. These requests allow the server to support the SGI_video_sync, SGI_swap_interval, and OML_sync_control GLX extensions if DDX support is present. The new DDX APIs are documented in dri2.h. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@nwnk.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 032f97808c65771a07bac748212cf6457a5d1660 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jan 6 17:32:24 2010 +0100 xfree86: init pointer feedback controls from options With InputClass support, it makes more sense to cover all aspects of acceleration in options. Previously, one could only set the default on the command line. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0722c287a4c8a6cdedca9756192547bfcf77ade5 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jan 6 19:43:59 2010 +0100 xfree86: document pointer acceleration in xorg.conf.man Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1aca2d757534879eb55faaee421cb972a9546712 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jan 6 19:13:36 2010 +0100 whitespace fixes Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 14039b5a7982fbf8130501bb00766176a4e9bccb Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jan 6 18:16:20 2010 +0100 doc: actually document SendDragEvents Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 14e4e4a294e648e0bdcb70c34748e1b81c5bb64f Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jan 6 18:13:27 2010 +0100 os: state effect of -a and -t options more precisely Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d727ddb91a549d23f6bf323e91db4b8916c1b7a0 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat Jan 9 16:28:32 2010 -0500 kdrive: klinux.h breaks make dist This file is no longer part of the source code and must be removed from distribution. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6313d2da6c6910827d68cf31fe00b46a34c5bfc7 Author: Gaetan Nadon <memsize@videotron.ca> Date: Fri Jan 8 19:04:25 2010 -0500 configure: use backticks rather than $() for commands This patch to xserver configure.ac is to increase code portability to non POSIX system by using backticks rather than $() for command substitution for BUILD_DATE and BUILD_TIME. Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 74ab27f64a747ee45810f99cdc6e29b82cf8035e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Dec 28 18:00:28 2009 +0200 Revert "Make sys.c use unaligned access functions provided in compiler." This reverts commit da923d0bc15e99a8ed1986bd6f5df37f7af7284b. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6a2a57832709798d99d19ff4c587e22f3b3c150d Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Jan 7 15:23:34 2010 -0500 macros: use PKG_CONFIG variable rather than executable name User can defined alternate location for pkg-config. Once option in place, all instances of pkg-config must be converted. Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1b3132f5e981b3398e08263742332cc966bebc07 Author: Gaetan Nadon <memsize@videotron.ca> Date: Thu Jan 7 14:12:34 2010 -0500 xwin: ignore intermediate .man file Only detectable on a Cygwin build Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8ab4749aaefb3727b9fc58bb37b50a2d07eb1531 Merge: 8d53d84 9437504 Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 7 10:32:21 2010 -0800 Merge remote branch 'dottedmag/for-keithp' commit 8d53d84485fdce8ea9686e6f300a69f7ddebd467 Author: Adam Tkac <atkac@redhat.com> Date: Thu Jan 7 15:34:52 2010 +0100 Do not define members of include/eventstr.h:EventType enum conditionally. Main problem is that EventType enumeration members can be different in module and in server, which obviously causes problems. Signed-off-by: Adam Tkac <atkac@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9437504b21dfdb509ab8b3a00f64403e1e4026dd Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jan 4 05:42:02 2010 +0600 kdrive: Remove unused kdNoopOps external variable declaration Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit aa6e0936be15488455e6a4236806a58496da2979 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jan 4 05:30:22 2010 +0600 kdrive: Remove unused kmap.c Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit f78ac5c6e273f575af29746e08e7c182ff7b93b3 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jan 4 02:36:30 2010 +0600 kdrive: Make internal functions static Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 37a8ddc0dbf3fb7f059b689038979bace206dccf Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jan 4 02:28:37 2010 +0600 kdrive: Remove unused 'k' variable Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit af1f1a05e1aa9ec921f1288818a66766c301f8b0 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jan 4 01:50:04 2010 +0600 kdrive: Remove bus mouse driver Bus mice aren't used anymore, do not keep dead code around. Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit a3cc3af186b55ac80abd6859ffe491f4ae936596 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 23:31:28 2010 +0600 kdrive: Adjust kdrive usage message as shadow overlay support has been dropped Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit c40b9f959175057fac726fcdfff9641ae0681cf6 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jan 4 14:07:37 2010 +0600 kdrive: Remove unused VxWorks* variable declarations Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 4e0d580d5ac00d8d87c8e0080a02868c87a31caa Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 15:04:03 2010 +0600 kdrive: Remove unused KdCardInfo::lastMarker field Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit dbaab9759ba31edf63cf73eda86ba931d88e8cce Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 16:18:29 2010 +0600 kdrive: Extract common part of fbdevPutColors and fbdevEnable Put framebuffer colormap updating code in separate function for brevity. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 7ee14154b230b931d294288e1291c4fc617b1354 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 15:42:53 2010 +0600 kdrive: Remove unused overlay fb support Xfbdev, Xephyr and Xfake all use only one framebuffer, so simplify implementation by removing overlay support. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 730f7d1c4fae8ca582a4a9998a4dc4b325f98896 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 15:06:18 2010 +0600 kdrive: Remove unused KD_MAX_CARD_ADDRESS macro Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 5337ddcfd9dc2a5b823da39df7adaad6692214f0 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 14:59:07 2010 +0600 kdrive: Move Xephyr-specific fields out of KdScreenInfo memory_base, memory_size, off_screen_base fields in KdScreenInfo are used only by fake EXA in Xephyr. Move them into Xephyr, cleanup Xfake and Xfbdev. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 62883b499b72f678ab055de4d0370227ae441370 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 13:17:21 2010 +0600 kdrive: Remove unused KdCardAttr from KdCardInfo Card attrs are unused in all current kdrive servers, so remove it completely to avoid allocating and passing dummy values to KdCardInfoAdd. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 6c2b3a4247d10a50699ffa6abb643c5e959eefa8 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Jan 4 14:07:04 2010 +0600 kdrive: Add option to compile out input drivers Add --without-kdrive-{kbd,mouse,evdev} configure options disabling Linux keyboard driver, Linux mouse drivers (ps2, bus,ms), and Linux evdev driver. Build all drivers by default as before. Acked-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 72ba717b1d639e94fa9ab56ca026131edc020a30 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 15:03:24 2010 +0600 kdrive: Remove unused KdCardInfo::needSync field Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit d21b41cdb5e89eb428f36b19e965f0ab49e051d9 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 13:21:25 2010 +0600 kdrive: Remove .gitignore left from SDL server SDL server is gone, no need to keep its .gitignore anymore. Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> commit 6f265d55a61f9be323583b8acacae783be72bda9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jan 5 13:15:25 2010 +1000 dix: don't update the slave coordinates from the VCK. A keyboard event from a device with both valuators and keys will be posted through the VCK. In this case, do not update the slave device coordinates from the VCK - they're always 0/0. Leave them as-is, for the next pointer event will continue where it left. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 326429badfc76885e4652ddc72860810c0e8d102 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 10 14:56:36 2009 -0500 modes: Remove the ClockRanges type ba2d39dd5428cb5922b797a1d4ea45b859412b40 introduced warnings: xf86Mode.c: In function ‘xf86CheckModeForDriver’: xf86Mode.c:986: warning: passing argument 1 of ‘modeInClockRange’ from incompatible pointer type xf86Mode.c:253: note: expected ‘ClockRangePtr’ but argument is of type ‘ClockRangesPtr’ xf86Mode.c:1002: warning: passing argument 1 of ‘modeInClockRange’ from incompatible pointer type xf86Mode.c:253: note: expected ‘ClockRangePtr’ but argument is of type ‘ClockRangesPtr’ Because I foolishly didn't notice that we had types with nearly identical members named ClockRange and ClockRanges. The latter contained an extra 'strategy' member at the end, which claimed to be needed by the vidmode extension. Of course, this was a lie: the only time we'd use it was in mode validation, for drivers using LOOKUP_CLKDIV2 with non-programmable clocks. The only driver using LOOKUP_CLKDIV2 is rendition, which has a programmable clock. The only driver using the ClockRanges type was smi, which did not use it for its 'strategy' member, so has been fixed to use ClockRange instead. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 13c8bd3fde3b0831921e59f84936022a16379d63 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jan 4 18:21:54 2010 -0800 CloseDevice: call XkbRemoveResourceClient before freeing key class struct XkbRemoveResourceClient() returns immediately if dev->key is NULL. CloseDevice calls XkbRemoveResourceClient until it removes all resources. If we free dev->key and NULL it before XkbRemoveResourceClient, then infinite loop ensues, and the server appears to hang on exit or crash. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit e707612e9de4e5e1d91dc1a8152810912d7e18bb Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Jan 4 09:07:48 2010 +0100 EXA: Restore migration call in exaDoPutImage(). Turns out this is still necessary if the driver PrepareAccess hook succeeds. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Tested-by: Maarten Maathuis <madman2003@gmail.com> Tested-by: Andrew Chant <andrew.chant+debian@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit e10072b7c74a6f5e24f6dfa37e73688d1f3425e3 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 05:43:28 2010 +0600 Add Xephyr.man to .gitignore Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com> commit fb26cb793c6eba189050662c566f7ea0559bd486 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 05:43:27 2010 +0600 Remove unused pShadow field from drivers' private structures Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2c85d72fc7bd013af327321ad5d626dc73c3caf0 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 05:43:26 2010 +0600 Do not check xfree argument for NULL xfree itself checks for NULL, and even this is not necessary as passing NULL to free(3) is safe. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 15bc35c6e44c65812de5c3e85ec8bbf78b032ded Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Sat Jan 2 05:43:25 2010 +0600 Remove trailing whitespace Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1763550d0181ac1c775b9ddf490114eff2fbe67e Author: Simon Thum <simon.thum@gmx.de> Date: Fri Jan 1 19:58:05 2010 +0100 dix: add smooth limited pointer acceleration profile This profile is inspired by the accel code removed from the wacom driver. It ascends from zero to acceleration, maxing out at threshold. This means you can control the slope using threshold, which wasn't possible in wacom. For sanity's sake, threshold should grow with acceleration. Works best with adaptive deceleration, since otherwise it only generates acceleration above 1, causing seldom pixel skips. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 435f27667f84269768efecde34de4af2b2d43376 Author: Julien Cristau <jcristau@debian.org> Date: Sun Sep 27 14:45:47 2009 +0200 config: add libudev input-hotplug backend Add a backend using libudev for input hotplug, and disable the hal and dbus backends if this one is enabled. XKB configuration happens using xkb{rules,model,layout,variant,options} properties (case-insensitive) on the device. We fill in InputAttributes to allow configuration through InputClass in Xorg. Requires udev 148 for the input_id helper and ID_INPUT* properties. Signed-off-by: Julien Cristau <jcristau@debian.org> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit b8b12e41c453c3bf94b11e7a18934d3b6e1869bf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 23 16:05:16 2009 +1000 xfree86: move sanity checks below option and input classes merges. While the identifier is likely set before the input classes are merged, the driver may not be. Hence don't check for a driver before we've completed configuration for this device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 9fad8f06fb89ac2ae05bea0fa24cab3df7677297 Merge: 871bbe1 42e8c92 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 30 09:28:19 2009 -0800 Merge remote branch 'dbn/inputclass' commit 871bbe1d87fa3c7ebd075e1d1eec33e45b08493d Merge: db2c6f7 e116563 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 30 09:16:45 2009 -0800 Merge remote branch 'dbn/xorg.conf.d' commit db2c6f7c91289b5d49978974093a1002b3b53a56 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Dec 29 15:48:44 2009 +0100 EXA: Don't use UTS/DFS directly for Put/GetImage when there's a system copy. We want to save the result in the system memory copy, in case we'll need it again for subsequent software fallbacks. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-By: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f28ca728e90ccbb901e8e7215a842525d8e786d3 Author: Thomas Hellstrom <thellstrom@vmware.com> Date: Tue Dec 29 12:51:30 2009 +0100 EXA: Restrict the regions that need to be migrated for composite fallback for src / mask pictures. [ Michel: Minor fixups to address compiler warnings ] Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0c1f43c0f3e888172f11f62a2f208af70e0183cc Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Dec 29 12:51:29 2009 +0100 EXA/mixed: Handle results of software fallbacks in DamageReport hook. This is more elegant and probably also slightly more correct than doing it at FinishAccess time. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 08bf26c28fc8147b64f2fe8345b9581e0101571c Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Dec 29 12:51:28 2009 +0100 EXA: Fix migration avoidance for 1x1 pixmaps. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0bd8f0cd7f3823ee17ae8c88fd3e004bfff9982d Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Dec 29 12:51:27 2009 +0100 EXA/classic: Fix crash with migration heuristic "smart". Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 40453bf7718f1c3d672b87e9d84991032cbef859 Author: Thomas Hellstrom <thellstrom@vmware.com> Date: Tue Dec 29 09:34:44 2009 +0100 EXA: Limit src prepareAccess regions for a number of unaccelerated operations. When we can trivially calculate the affected source regions, do that before calling region bounded prepareAccess. [ Michel: Minor fixups to address compiler warnings ] Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit aa9ce8ab343d51a67924757c5a43c9572248bb24 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Dec 29 09:34:43 2009 +0100 EXA: Use relevant source region to minimize migration on CopyWindow fallbacks. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 39cc110caa1f6481a7213ae39f82669333ec1645 Author: Thomas Hellstrom <thellstrom@vmware.com> Date: Tue Dec 29 09:34:42 2009 +0100 EXA: Fix bugs in exaGetImage / ExaCheckGetImage migration. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Acked-by: Michel Dänzer <michel@daenzer.net> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d42f3960514f1c410863ac6c09c5638b5ddeae20 Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Dec 28 16:48:18 2009 +0100 EXA: Allow optimized migration to be enabled with mixed pixmaps. This was always the intention, I only recently realized it wasn't the case yet... Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 661630f9099f254e54c8da513aaed12f6532cc35 Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Dec 28 16:48:17 2009 +0100 EXA/mixed: Don't clear deferred status of pixmaps if migration is limited. * With optimized migration, only the pending damage region is synchronized for destination pixmaps. * Migration of source pixmaps can be limited to a bounding region. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 42e8c9224e6c54655c45f87999d37d0d67b3f7f5 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Fri Oct 2 06:29:28 2009 -0700 xfree86: Introduce InputClass configuration Currently Xorg uses hal's fdi files to decide what configuration options are applied to automatically added input devices. This is sub-optimal since it requires users to use a new and different configuration store than xorg.conf. The InputClass section attempts to provide a system similar to hal where configuration can be applied to all devices with certain attributes. For now, devices can be matched to: * A substring of the product name via a MatchProduct entry * A substring of the vendir name via a MatchVendor entry * A pathname pattern of the device file via a MatchDevicePath entry * A device type via boolean entries for MatchIsKeyboard, MatchIsPointer, MatchIsJoystick, MatchIsTablet, MatchIsTouchpad and MatchIsTouchscreen See the INPUTCLASS section in xorg.conf(5) for more details. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0711598dd3e8366217676f462f1af7d0899656d9 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed Sep 2 06:47:13 2009 -0700 config: Introduce InputAttributes in NewInputDeviceRequest In order to give NewInputDeviceRequest more information, a new InputAttributes type is introduced. Currently, this collects the product and vendor name, device path, and sets booleans for attributes such as having keys and/or a pointer. Only the HAL backend fills in the attributes, though. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> commit c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Fri Oct 2 06:28:03 2009 -0700 xfree86: Support non-Option boolean entries in configuration Refactored code into the parser to allow the freeform boolean types used in Option entries to be used in other configuration entries. This isn't as powerful as allowing "No" to precede the option names, but it atleast gives a common handling of "yes", "no", etc. A type xf86TriState has been added to support an optional boolean. This allows the boolean sense of the value to be kept while providing a means to signal that it is unset. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> commit e1165632bdfbd720889ed1adf5f7ab338032c0ee Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 21 15:56:35 2009 +1000 xfree86: Add Option AutoServerLayout for input devices. Any input device with this option will be automatically added to whichever server layout is selected at startup. This removes the need to reference a device from the ServerLayout section. The two following configuration are identical: CONFIG 1: Section "ServerLayout" InputDevice "foo" EndSection Section "InputDevice" Identifier "foo" ... EndSection CONFIG 2: Section "InputDevice" Identifier "foo" Option "AutoServerLayout" "on" ... EndSection The selection of the server layout affects both explicitly specified layouts and the implicit layout. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp at keithp.com> commit 592b20c517461d32daf44a940386ffcc11c434f8 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Dec 21 01:13:44 2009 -0800 xfree86: Allow config directory to be specified on command line Add a new command line parameter, -configdir, to specify the config directory to be used. Rules are the same as -config for root vs. user privileges. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> commit efa5269f23c2237eb5368bf5245ffbbf35714153 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Dec 21 00:04:16 2009 -0800 xfree86: Use xorg.conf.d directory for multiple config files Currently there is a single file, xorg.conf, for configuring the server. This works fine most of the time, but it becomes a problem when packages or system services need to adjust the configuration. Instead, allow multiple configuration files to live in a directory. Typically this will be /etc/X11/xorg.conf.d. Files with a suffix of .conf will be read and added to the server configuration after xorg.conf. The server won't fall back to using the auto configuration unless there is no config file and there are no files in the config directory. Right now this uses a simpler search template than the config file search path by not using the command line or environment variable parameters. The matching code was refactored a bit to make this more coherent. Any DDX wanting to read the config files will need to call xf86initConfigFiles before opening/reading them. This is to allow xf86openConfigFile without xf86openConfigDirFiles and vice-versa. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> commit f1e869aca176e9113f9d234b0ea59b4cac295cc4 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Dec 21 00:03:11 2009 -0800 xfree86: Unexport configuration file symbols These functions should not be used outside of DDXs, so no need to put them in the ABI. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> commit 90e6d93cf9bfafd63d7849dc16ce194d6f9c9d5f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 23 12:54:14 2009 +1000 test/xi2: fail if xi2 class type is garbage. (#25492) If the keycode range exceeds the allowable length, memory gets overwritten. Catch this case by making sure that only allowed class types are present. X.Org Bug 25492 <http://bugs.freedesktop.org/show_bug.cgi?id=25492> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 72286eae9f4a2f2ca6c46919ff8aa1011429e03a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 22 15:42:59 2009 +1000 xfree86: remove LAYOUT_DEBUG section. I don't think this one has been in use since 2003. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 38b5afb0b5b46b61effa6f0e5a377b343e357e7e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 22 15:40:40 2009 +1000 xfree86: remove some 'enable this later' and if 0 ifdefs 2003 called, they want their ifdefs back. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7dc78db79edd15b971110acaf16bbe7f69e40bdb Merge: 81a623f b44c9be Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 22 21:25:18 2009 -0800 Merge remote branch 'whot/master' commit b44c9be244cee286835855483a69c69e80b095c0 Author: Julien Cristau <jcristau@debian.org> Date: Tue Dec 22 17:14:09 2009 +0100 test/xi2: fix maximum max_keycode (bug#25492) The number of keycodes needs to be lower than 0xFFFD so that the length field of xXIKeyInfo doesn't overflow. Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 190610e0c62170a27ab3e40c6c6210a583ae1ad4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 21 11:08:26 2009 +1000 xfree86: remove HistorySize from the xorg.conf man page. This option isn't parsed by anything anymore. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 094c6b9f97a9f92e5a0ef3cf5be24c09ed4d6063 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 21 10:42:32 2009 +1000 xfree86: reword InputDevice man sections, deprecate CorePointer/CoreKeyboard Reshuffle and reword - InputDevice sections are only necessary if hotplugging is disabled. Put more emphasis on hotplugging and less on HAL since we'll switch backends eventually. CorePointer, CoreKeyboard, and AlwaysCore should be listed as deprecated since they don't do what they used to since 1.4. These days, only SendCoreEvents matters and it's enabled for any driver calling xf86ProcessCommonOptions (== every driver). It only controls the startup behavior too, so document this. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 81a623f036fe56d53c4e3bdafb3eaf945502525f Author: Keith Packard <keithp@keithp.com> Date: Sat Dec 19 20:11:41 2009 -0800 Bump to 1.7.99.3 (unreleased) Signed-off-by: Keith Packard <keithp@keithp.com> commit 3c30c5b6d321f34736c442c9cd982308d9b8b93a Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 18 22:58:59 2009 -0800 Set release date for 1.7.99.2 Signed-off-by: Keith Packard <keithp@keithp.com> commit 895f40792a14d8b88923bf3b428d31ae3bb31e46 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Dec 2 17:43:01 2009 -0800 Add type name argument to CreateNewResourceType Convert all calls of CreateNewResourceType to pass name argument Breaks DIX ABI. ABI versions bumped: Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a11c58fa0c5809f918b36b84be53385cb2d8ea59 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Dec 11 00:58:25 2009 -0800 Ensure all resource types created have names registered Calls RegisterResourceName to record the type name for use by X-Resource, XACE/SELinux/XTsol, and DTrace. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit eb750f8b5e14751d4c40b50499baec5d2ba79db9 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Dec 11 00:46:22 2009 -0800 Check for failures from CreateNewResourceType Make sure to check return value before setting bitmask flags. For most calls, just fails to init the extension. Since Xinput already calls FatalError() on initialization failure, so does failure to allocate Xinput's resource type. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit 1df4bd6011e110dcf0649b15bfffd4ab9e6961d6 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Dec 17 18:24:40 2009 -0800 Change default xkb model from pc104 to pc105 PC105 is a more useful default for non-American keyboard users, not harmful for American PC101/PC104 keyboard users. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1d2e189cdc1d65c9ca2aa0a950780dc18e6c50f1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Dec 17 18:24:39 2009 -0800 Change sysconfdir brackets to avoid some shells trying to run it as a command Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 48749cc21b074ee8e68c3854bd3977ec7c408225 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Dec 17 18:24:38 2009 -0800 Add platform compatibility defines for Sun Studio compilers Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b63912ed4c69fedd1bea92274d6cae0429a79677 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Dec 17 18:24:37 2009 -0800 Convert checks for PC98 support from platform #ifdefs to configure flag Default remains the same - on for most OS'es on i386 (except Solaris), off for everyone else. Can be manually toggled via --enable-pc98 or --disable-pc98. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 801bc8075aee664bd4c6b6ff842ab737c143a1de Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 14 08:43:19 2009 +1000 xfree86: update man page for special keys handling. SpecialKeyHandling was removed from the kbd driver with version 1.4.0. Since this is the only version that will build against server 1.7+ it's not reasonable to mention it in the man page. Reword, point to XKB instead and make clear that some key combinations _may_ not be available in any given config. Reported-by: Derek Fawcus Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 753310837cd3812882d8de67f063bb61813db675 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 14 08:41:18 2009 +1000 xfree86: DontZap has been disabled for a while now, say so in the man page. 1.7 always shipped with DontZap disabled, it's just the default keymaps that may not include the symbol to trigger it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 0cb638dc6822e54567a1731ea1cf588475a226e9 Merge: 6a6a041 fbdf493 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 16 21:58:44 2009 -0800 Merge remote branch 'alanc/master' commit 6a6a041c2d8d32f6355db77cd59cff371038c683 Merge: 8127465 d503195 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 16 21:57:32 2009 -0800 Merge remote branch 'jeremyhu/master' commit 8127465f44fee99181f37a5e55dafc90bfafe3d8 Author: Ville Syrjälä <ville.syrjala@nokia.com> Date: Mon Dec 14 19:19:01 2009 +0200 xf86xv: Fix off-by-one in viewport clipping Most of the Xv Put/Get operations have an off by one error in the viewport clipping. Apparently PutImage was fixed at some point but the same code was already copy-pasted all over the place, and so the other operations still suffer from the bug. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit faca1bc582e374d32ee9d63d10e072fbef4940a3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 14 11:05:20 2009 +1000 xfree86: belately init RandR12 if xinerama fails. (#24627) On Fri, Dec 11, 2009 at 10:19:01AM -0800, Keith Packard wrote: > On Wed, 9 Dec 2009 11:55:14 +1000, Peter Hutterer <peter.hutterer@who-t.net> wrote: > > On Tue, Dec 08, 2009 at 05:24:06PM -0800, Aaron Plattner wrote: > > > On Tue, Dec 08, 2009 at 03:52:27PM -0800, Peter Hutterer wrote: > > > > Xorg +xinerama crashes immediately due to whacky dependency between Xinerama > > > > and RandR12. The latter doesn't initialize if Xinerama is enabled, but if > > > > only one screen is found, Xinerama is disabled again and RandR12 tries to > > > > access data it never initialized. > > I'd sure like to have RandR get enabled when xinerama doesn't; is there > an easy way of making that happen here? Perhaps having the RandR12 code > disable Xinerama when only one screen is found? Or some other kludge? you know the dependency better than I do so any hints are apreciated. afaict, the screenInfo.numScreens (the check used by Xinerama) isn't necessarily initialized at this point so we can't use the same check. The following seems to work though: From 670b3ebdb7312a6433a8f093d0820785db2aea20 Mon Sep 17 00:00:00 2001 From: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon, 14 Dec 2009 11:00:58 +1000 Subject: [PATCH] xfree86: if only one screen was found, disable Xinerama (#24627) Xorg +xinerama crashes immediately due to whacky dependency between Xinerama and RandR12. The latter doesn't initialize if Xinerama is enabled, but if only one screen is found, Xinerama is disabled again and RandR12 tries to access data it never initialized. Dependency chain is: - ProcessCommandLine sets noPanoramiXExtension to FALSE - xf86RandR12Init() is a noop - PanoramiXExtensionInit sets noPanoramiXExtension to TRUE - xf86RandR12CreateScreenResources tries to use the devPrivates key it never initialized. This hack checks if there's only one screen at the time RandR12 is initialized. If so, we expect Xinerama to fail anyhow so we disable it ourselves and proceed as planned. X.Org Bug 24627 <http://bugs.freedesktop.org/show_bug.cgi?id=24627> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5f898ddbaa7df01d2479e40238d8c7954fc4b67a Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Dec 11 17:04:14 2009 +0200 xfree86: fix -quiet option behaviour Previously it was trying to set the same value as the default one. Sigh. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7284e198619cdacb38d0ad715e932acff86c8367 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Dec 11 17:04:13 2009 +0200 os: print log markers only if log level is >= 0 FWIW default log verbosity is 0, so this will affect only if one start the server with a different -verbose argument. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f57240a0a8c05e0a2589d0127f8888db140d6974 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Dec 11 17:04:12 2009 +0200 xfree86: spam output but with verbose level checked instead Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fbdf493a3e7e48039a0826531e11aa33b04bf391 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 14 18:46:00 2009 -0800 Add freetype & type1 to the LoadModules ignore list Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Adam Jackson <ajax@redhat.com> commit c9726bbe3148c7a8adb4dfde483741545d59c3dc Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 15 15:54:22 2009 -0800 Update Sun license notices to current X.Org standard form Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit d50319550458f8127298cf8672b47f914b74ab1f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Dec 11 16:42:43 2009 -0800 Xfake: Nuke -Wl,-undefined=InitExtensions from LDFLAGS This is not portable, and accodring to Paulo should not be required any more. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit ed7d2527190ec56aed38db19d9e958abe88441b9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Dec 11 11:53:28 2009 -0800 dtrace: Add Xserver-dtrace.h to CLEANFILES Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 44f102ed64e2552a0e04714c7574f74ca5ee66e2 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Nov 23 22:24:44 2009 -0800 COPYING: Update license preamble Update the comment about "a modification is currently under discussion" since there hasn't been any such discussion for some time and this is the consensus agreed upon preferred format. Also throw in a pointer to the OSI discussion page about the MIT license. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> commit 00a7252fe3e519e3e4d62cdd8746833ca59bce77 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Nov 20 13:38:30 2009 -0800 Fix dtrace object builds of libos to link with SHA1_LIBS Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Adam Jackson <ajax@redhat.com> commit dd2c83d03ecedce8b546d583e436c12f92510754 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 11 14:42:20 2009 -0800 Fix builds with --with-int10=stub Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Adam Jackson <ajax@redhat.com> commit 77221c9155a3c96cb63b210a048db1ea71a5e359 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 29 14:01:29 2009 -0400 glx: swrast can do GLX 1.4 too Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a72c65e9176c51de95db2fdbf4c5d946a4911695 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 2 08:37:20 2009 -0800 fb: Adjust transform or composite coordinates for pixman operations Windows (or even pixmaps, in some cases) may not sit at the origin of the containing pixmap, so any coordinates relative to the drawable must be adjusted. For destinations and untransformed sources, the operation coordinates are adjusted. For transformed sources, the transform matrix is adjusted. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk> commit bd567061c8b84b268d9bbb01bc4d8981feefb862 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 2 15:51:22 2009 -0800 Split fbGetDrawable into fbGetDrawablePixmap and fbGetPixmapBitsData These two sub-macros each perform half of the original macro work and the old macro is now implemented in terms of the new ones. This makes way for new code which wants to know the underlying pixmap for a window instead of just getting a pointer to the bits. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk> commit 61335052972a78d67c0ba74f902273b34c63a198 Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 1 11:09:32 2009 -0800 Revert "Fix clipping when windows are used as sources" This reverts commit e9aa61e9f0d663d5b34a397b943b4d1df44e873d. Conflicts: fb/fbpict.c Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk> commit 071b3c1810d9f2602173acc8578caac20e0b771e Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 1 11:05:04 2009 -0800 Revert "Use IncludeInferiors when copying windows before compositing." This reverts commit 7c7f0c2c6a04f7044d5ce69e97a615735e5831f1. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk> commit 8e640d6b131d2865a9725d8997023865b0ef3d69 Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 1 11:04:49 2009 -0800 Revert "Reserve space for two GC values in copy_drawable()." This reverts commit 08df24555cb432eb0d90a3f63275e9485e777c4c. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk> commit 0816c5482c25251da8af5978cc348e1c547bf731 Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 1 11:04:06 2009 -0800 Revert "fb: Don't crash if copy_drawable() returns NULL." This reverts commit 66a9616d645f5a23225251d197e00b94c79274f6. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk> commit d3e054ac07dae12a82ad764b0622fddbef4b9ec5 Merge: 12fb318 97a6454 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 11 09:22:22 2009 -0800 Merge remote branch 'jeremyhu/master' commit 12fb31815db9de9c01f2d4155a2b74531777c0bf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 7 12:58:57 2009 +1000 xkb: don't assign garbage value to led_return. As the comment for the function states, led_return is undefined if map is NULL. We might as well skip writing to it then. Found by clang. Reported-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> commit ea14a418214ba4c58910f5650d8b25b3fc3a7099 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Dec 3 11:21:31 2009 +1000 Xi: reset device properties to NULL after deleting them. (#25374) Commit 0e6cee853d8e5bef3274e632ef034d37f14674a9 introduced cleanup code to remove the accel properties when switching schemes. The same code is triggered by the default closedown code but only after unconditionally removing all device properties (as part of the cleanup). The properties, although deleted never got reset to NULL. X.Org Bug 25374 <http://bugs.freedesktop.org/show_bug.cgi?id=25374> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Andy Furniss <lists@andyfurniss.entadsl.com> Reviewed-by: Dave Airlie <airlied@redhat.com> commit 9ac6a048efaec51f158bbc1a4a3f448cbe5658ad Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 9 11:43:34 2009 +1000 xfree86: remove unused variable in configureDDMonitorSection. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> commit 3fad969a90ccab604359ec4de05e745bb4b909e1 Author: Julien Cristau <jcristau@debian.org> Date: Sun Dec 6 20:27:06 2009 +0100 Move config_init() after CreateWellKnownSockets() and InitCoreDevices() config_init() can now add devices directly instead of scheduling a timer. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 886140787852c660978a9bb3abc7cc2702cbaed1 Author: Tomas Carnecky <tom@dbservice.com> Date: Mon Dec 7 05:54:57 2009 +0100 Fix possible NULL dereference in XkbFlushLedEvents() Through some code paths it is possible that NULL is being passed in the 'ed' parameter to XkbFlushLedEvents(). Make sure we don't pass it along to bzero(). Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 92d9cb7e1340b259294ba317ea3a7d18487498b5 Author: Tomas Carnecky <tom@dbservice.com> Date: Sun Dec 6 23:52:54 2009 +0100 XkbWriteCountedString(): return early if str is NULL This avoids NULL from being passed to memcpy() later in the code. While that wasn't an issue before - that value being NULL implied 'size == 0' so memcpy() wouldn't try to dereference it - it made the code harder to read and also confused clang. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit df2635d4644d1fa2772ff58d8d34cdf788ece412 Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Dec 10 00:04:53 2009 +0100 EXA/mixed: Don't consider devKind for detecting dimension change. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=25536 . There should be no reason for the pitch to actually change when none of the other dimensions do, and this could lead to incorrectly freeing the system memory copy when allocating a GPU copy, resulting in loss of valid pixmap contents. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 97a6454ea57587db490873fee8ff0f899882972d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 9 18:27:31 2009 -0800 XQuartz: pbproxy: Fix building of standalone xpbproxy executable Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 1b8f90aa8b1017c74b254db2f398131b857323d4 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Dec 8 15:50:28 2009 -0800 Miscellaneous compilation warning fixes main.c:134: warning: no previous prototype for 'dix_main' rootlessScreen.c: In function 'RootlessMarkOverlappedWindows': rootlessScreen.c:434: warning: function declaration isn't a prototype backtrace.c:51: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int' backtrace.c:54: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int' set.c: In function 'RecordSetMemoryRequirements': set.c:413: warning: old-style function definition set.c: In function 'RecordCreateSet': set.c:425: warning: old-style function definition stub.c: In function ‘main’: stub.c:236: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 955b9f23a34cc79a5cd9676b45b3df4ffcc7302b Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Dec 8 20:25:02 2009 +0100 EXA: ModifyPixmapHeader_mixed fixes. * Better detection of dimension changes. * Make sure to re-create the system memory copy when the pixmap dimensions change (e.g. the screen pixmap on screen resize). * Clear the valid regions. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c1503861cf75654d4f7b22e6f7f6487c47a0a395 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Dec 8 20:25:01 2009 +0100 EXA: ExaDoPrepareAccess return value fixes. Only return TRUE if the GPU copy is being accessed, and preserve the return value on repeated / nested calls for the same pixmap. exaPrepareAccessReg_mixed could get inconsistent return values e.g. when the same pixmap is both the destination and source of an operation, potentially resulting in a crash. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fd867387335b6175d76bbe93118bbe5e1e45ce88 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Dec 5 03:18:31 2009 +0100 exa/mixed: pixmaps that succeed prepare access have no need for a cpu copy - When they have a gpu copy ofcource. - Use the presence of a cpu copy as a hint to fall back instead of UTS'ing in exaHWCopyNtoN. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit bb7acfbcfbc37869c2215c26791c6175a5a6c526 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Dec 4 08:37:14 2009 +0100 EXA: Use correct coordinate system for calculating Composite fallback region. Fixes incorrectly skipped rendering of some Composite operations to windows. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0f4ef7123d3e6e09e04dc55e8edb47aecf017648 Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Dec 3 19:28:13 2009 +0100 exa/mixed: setting devKind before exaCopyDirty* is not needed Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8ea415d417b3ef6b8a288d10da76ff4bc334e08b Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Dec 2 20:24:02 2009 +0100 Revert "exa: a few small pitch related changes" This reverts commit 99d88ef69d5f7dbf99ca605eceb92f42230a89f4. - Some pixmaps under classic have a sys_pitch which is 0, no idea why. This is causing rendering corruption. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 98c8b752254a27ab1aaf881b36bfda0f74929d0a Merge: 0e084d8 91c1bd7 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 2 15:28:07 2009 -0800 Merge remote branch 'whot/master' commit 91c1bd78f7240c92702828f8e5a6b6ce944b9e36 Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat Nov 28 21:32:47 2009 -0500 configure.ac: error while checking for XDMXCONFIG_DEP Introduced in commit 9998105a387e0294054502331a56e1e020cd93e4 The replacement third parameters to PKG_CHECK_MODULES([DMXMODULES] was not quoted. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 761ae22f880bd79550ccf93d321b8a28b3755956 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 1 14:38:19 2009 +1000 xfree86: tell users to disable AutoAddDevices, not AllowEmptyInput. Technically, disabling AEI is the right suggestion. AEI off forces the server to init the built-in defaults for input devices (or pick the first one from the config file). At the same time, hotplugging is still available with AEI off. Unfortunatly, in the vast majority of cases users want to simply disable hotplugging or have a working server while the local HAL configuration is broken or missing. Disabling AEI will lead to duplicate events, triple keystrokes, etc. once the configuration works again. It's not actually required to remove AEI once hotplugging works again, though it will in many cases lead to a setup that appears broken. Asking users to disable AutoAddDevices instead means those users disable hotplugging, can then fix the HAL setup and they _must_ remove the config line again to test if hotplugging works again. Which doesn't leave them with a broken config once everything is working nice and dandy. Less bugreports, everybody wins. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Rémi Cardona <remi@gentoo.org> Acked-by: James Cloos <cloos@jhcloos.com> commit b584c224a888c9e7f92d7e49021f74232a727c7f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 30 12:11:41 2009 +1000 Set the source and deviceid for key repeat events (#24785) X.Org Bug 24785 <http://bugs.freedesktop.org/show_bug.cgi?id=24785> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Adam Jackson <ajax@redhat.com> commit 66bb8c6fbdfc0fc0d971aac4ec6f949bb9288c1b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 27 16:20:13 2009 +1000 dix: remove core devices when shutting down. (#25028) NewInputDeviceRequest (and RemoveDevice) have checks in place to not allow removal of the VCP/VCK. When shutting down, they need to be cleaned up nonetheless to free the memory associated. X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 83d90b90bcb71c89750f92a177361e53dd261414 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 27 16:08:44 2009 +1000 dix: remove some obsolete comment. The "counterpart to biggest hack" included checking for the motion history function - which is unified in 1.7. Hence the check (which is already removed) would evaluate to true anyway, and this comment isn't needed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit c20c8897272427cb3f755a3e28e80a9ad46f08a1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 27 16:01:53 2009 +1000 dix: fix memory leak, free event list on shutdown. (#25028) X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 0e084d8c71e697a5cf5d5d7c749455ae14bd6eb7 Author: Luc Verhaegen <libv@skynet.be> Date: Wed Nov 11 15:59:27 2009 +0100 Xv: Fix AdjustFrame when driver implements ReputImage. Should probably also be applied to stabler xserver branches too. Luc Verhaegen. From a22bc20721bad506d8fa9772b1258568cbffe7d2 Mon Sep 17 00:00:00 2001 From: Luc Verhaegen <libv@skynet.be> Date: Wed, 11 Nov 2009 15:52:39 +0100 Subject: [PATCH] Xv: Fix AdjustFrame when driver implements ReputImage. Finally fixes fd.o #4653, filed more than 4 years ago. Patch can be happily applied to all modular Xorg versions. Signed-off-by: Luc Verhaegen <libv@skynet.be> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f4fc3406720410e37a2bce1b782cba0f0b734e42 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Mon Nov 30 11:03:59 2009 -0800 XQuartz: Drop calls to alloca This makes us more consistent with the rest of the codebase, using xalloc/xfree Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 66a9616d645f5a23225251d197e00b94c79274f6 Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Nov 30 13:17:53 2009 +0100 fb: Don't crash if copy_drawable() returns NULL. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24634 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8754db77d8169e5ea506a963cebee1a651bcf094 Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Nov 30 13:17:52 2009 +0100 EXA: Don't defragment offscreen memory at allocation time. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24300 . Offscreen memory allocation can occur from various places, and apparently doing defragmentation from at least some of them can confuse some driver acceleration code. There's still the regular background defragmentation in the WakeupHandler, which should manage to keep fragmentation at a reasonable level. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0e555a1033e5deed1db8582ca075455a6a2d4228 Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Nov 30 13:17:51 2009 +0100 Revert "EXA: Accumulate arbitrary number of glyphs without flushing." This reverts commit c11678cc189551f2a01eaa7a63969c16950739b4. Not sure what I was thinking, turns out alloca() of a size derived from client input is a bad idea. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 99d88ef69d5f7dbf99ca605eceb92f42230a89f4 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Nov 28 10:34:45 2009 +0100 exa: a few small pitch related changes - Setting pitch before exaCopyDirty* is not needed. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit a54c23fe647cb4d610d871094193ae5959606008 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Nov 28 10:34:44 2009 +0100 exa: s/PixmapIsOffscreen/PixmapHasGpuCopy and s/pExaPixmap->offscreen/pExaPixmap->use_gpu_copy - Fixup some variable names as well. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 342f3689d17256c92cbfee079d24501d27aa1153 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Nov 28 10:34:43 2009 +0100 exa: handle pixmap create/destroy in lower layers - Pixmaps that are created during a fallback are automatically prepared access. - During the fallback accelerated ops are blocked to prevent new/scratch gc's from triggering accelerated ops on mapped pixmaps. - A few cases of incorrect wrapping (on the top level pointer instead of between damage and (w)fb) have been removed. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit b54bc14ce0ae38c4863794bc3096ca86cdb23908 Author: Ingmar Vanhassel <ingmar@exherbo.org> Date: Wed Nov 25 20:31:48 2009 +0100 Update man-pages for new default font paths Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c0367028ac02b3ccfbc245863dc6b7295a4014d6 Author: Ingmar Vanhassel <ingmar@exherbo.org> Date: Wed Nov 25 20:31:47 2009 +0100 Update COMPILEDDEFAULTFONTPATH to match the new default font path Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0e6cee853d8e5bef3274e632ef034d37f14674a9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Nov 18 14:39:25 2009 +1000 dix: clean up accel old scheme data when switching schemes. InitValuatorClassDeviceStruct always initializes with the default profile. The default profile allocs data and adds a few properties which become obsolete if the profile is changed lateron by the driver. The property handlers are stored in the device's devPrivates and cleaned up. Ideally, the property handler ID's could be stored somewhere more obvious, but that seems to require breaking the ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Simon Thum <simon.thum@gmx.de> commit 1b127ab8429616adf9ec31ba4d8bdd9af6e104a9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 24 15:31:48 2009 +1000 Xi: when deleting all properties, reset property handler to NULL. Trying to unregister property handlers during the device closure process leads to invalid memory accesses. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 8806375ed72a3cd465fe0a49ead079a334accd6b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 17 09:25:47 2009 +1000 Move xdmxconfig modules into DMX conditionals (#25102) xdmxconfig requires additional modules not checked for if Xdmx build is set to auto (the default). This may lead to build errors if the Xdmx modules are installed, but not the extra ones required for xdmxconfig. X.Org Bug 25102 <http://bugs.freedesktop.org/show_bug.cgi?id=25102> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Remi Cardona <remi@gentoo.org> Acked-by: Julien Cristau <jcristau@debian.org> commit a2adda7ab3defd953cf0f48f5372efb037786a9e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Nov 19 16:35:55 2009 +1000 Revert "Move xdmxconfig modules into DMX conditionals (#25102)" New package dependency unnecessarily links in a few libraries that Xdmx doesn't need. This can be fixed more elegantly. This reverts commit 0ef15ca9d2d9c78c79a2771c550563bc6931b365. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit eb967ca36cfe0409972ac987a74d498cd6f6bafb Author: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Date: Tue Nov 17 17:13:43 2009 +0200 Xext: Fix a memory leak on GE client disconnect. Add a call to dixRequestPrivate to inform dixFreePrivates that memory allocated in GEClientCallback should be released when client disconnects. Otherwise there is a leak of sizeof(GEClientInfoRec) for every client connect/disconnect. Also remove the explicit allocation and let GEGetClient / dixLookupPrivate do it. This makes GEClientCallback similar to the other extension callbacks. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 55f60e192318132157d3dfdd6732f141bd9dc352 Author: Maarten Maathuis <madman2003@gmail.com> Date: Mon Nov 23 22:17:43 2009 +0100 Revert "exa/mixed: be more thorough about setting fb_pitch when needed" This reverts commit d4fc245115eb2cb323e06a82f9dd52518d9b6a16. - This is causing crashes/problems for some. Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 4677b5a80025b50ba2a3e953fd487a549586ae9f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Nov 23 16:33:00 2009 -0800 XQuartz: Allow better compatability with older versions of xinit If we are id="org.x" and the launchd socket is ":0", we will claim the socket to match the old behavior before we prefixed the socket name with our id. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit ec16357edaba23694b12fd234ffa12fd58a73dfa Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Nov 23 17:00:06 2009 +0200 configure: remove unused kdrive Xvesa config variable Xvesa was gone in commit 6d21fbf0 and this should be there as well. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a30e739a144912a68adcaa9f426d600c6ecbd529 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Nov 23 13:07:56 2009 +1000 Xi: don't crash when deleting invalid device properties. Deleting a property that was not set on a device leads to a null-pointer reference. The protocol allows deleting those properties - it has to be a noop. Reproducible: xinput --set-prop "My device" --type=int --format=8 "my property" 1 xinput --delete-prop "My other device" "my property" Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 19f7c15e2008dab3c46ba3e14dfa353d01c74f72 Author: Zhao Yakui <yakui.zhao@intel.com> Date: Fri Nov 20 14:43:35 2009 +0800 xfree86: Edid quirk for Philips LCD LP154W01 v1->v2: Make one condition case for one quirk instead of merging them together. This is based on the Keithp's suggestion. Move the EDID quirk for Philips LCD LP154W01 as the panel reports the vertical size in cm. https://bugs.freedesktop.org/show_bug.cgi?id=24482 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit b8b8db98353760738eead612fe846c2ce1c174fa Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Nov 19 10:46:30 2009 +0100 EXA: Don't use UploadToScreen for CopyNtoN with mixed pixmaps. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit d4fc245115eb2cb323e06a82f9dd52518d9b6a16 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Nov 18 21:23:09 2009 +0100 exa/mixed: be more thorough about setting fb_pitch when needed Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> commit 647b79f87a9891225678dc6fc2fbda3bdef8fa9d Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Nov 18 21:23:08 2009 +0100 exa/mixed: avoid copying back pixmap data when no migration took place - When the driver handles the prepare access no copying is needed. - Delayed pixmap creation should be fine, because it's handled by the first prepare access, but the exaPixmapIsOffscreen check in finish access will return FALSE without a driver pixmap. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> commit 30be7ceaf228497ac1ff0a1123c1b35e3aa1fc73 Author: Julien Cristau <jcristau@debian.org> Date: Sat Nov 14 18:39:00 2009 +0100 xfree86: set a sane umask before opening the log Xorg creates its log file following the umask of the user running startx, which may result in a world-writable log. Set umask to 022 to prevent this. Debian bug#555308 <http://bugs.debian.org/555308> See also http://thread.gmane.org/gmane.comp.security.oss.general/2299 Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit fb95090730360b6b7f5429c40937e8fc9dfe5c14 Author: Matt Turner <mattst88@gmail.com> Date: Mon Nov 9 03:33:45 2009 +0000 Use glibc's in/out routines Let's let glibc do the right thing for dense/sparse selection. The _alpha_iobase code has been unused since the switch to libpciaccess. It really should have been killed by fba700f1f6a8976. Signed-off-by: Matt Turner <mattst88@gmail.com> Tested-by: Michael Cree <mcree@orcon.net.nz> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0ef15ca9d2d9c78c79a2771c550563bc6931b365 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 17 11:48:35 2009 +1000 Move xdmxconfig modules into DMX conditionals (#25102) xdmxconfig requires additional modules not checked for if Xdmx build is set to auto (the default). This may lead to build errors if the Xdmx modules are installed, but not the extra ones required for xdmxconfig. X.Org Bug 25102 <http://bugs.freedesktop.org/show_bug.cgi?id=25102> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Keith Packard <keithp@keithp.com> commit df95be4d3d9a744720e37a16fd89d9569bf6e188 Author: Paulo Ricardo Zanoni <pzanoni@mandriva.com> Date: Thu Nov 12 11:27:34 2009 -0200 configure: change 'sigio-default' to 'use-sigio-by-default' This was discussed in this thread: http://lists.x.org/archives/xorg-devel/2009-September/002025.html The patch sent fixed the help string but not the configure option. Signed-off-by: Keith Packard <keithp@keithp.com> commit 801f0e59800ea4a3f6c85b22dea6f2c400bda703 Author: Gaetan Nadon <memsize@videotron.ca> Date: Wed Oct 28 14:09:11 2009 -0400 INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 Add missing INSTALL file. Use standard GNU file on building tarball README may have been updated Remove AUTHORS file as it is empty and no content available yet. Remove NEWS file as it is empty and no content available yet. Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c93f516e850c2ef2b47cc2e282f9081ae7165ac7 Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Oct 27 15:07:26 2009 -0400 Deploy the new XORG_DEFAULT_OPTIONS #24242 This macro aggregate a number of existing macros that sets commmon X.Org components configuration options. It shields the configuration file from future changes. Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 0f38159cdd154a29caab0342aee41378e9921929 Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Nov 10 09:12:27 2009 -0500 Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432 ChangeLog filename is known to Automake and requires no further coding in the makefile. Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c739beb439bb813e4c82b3216daee7e89aa96f2f Author: Gaetan Nadon <memsize@videotron.ca> Date: Tue Nov 10 08:56:21 2009 -0500 .gitignore: use common defaults with custom section #24239 Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults. Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9071b0d69748cfa7ecca17b4cb0e431bbb0ef2a4 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Nov 9 13:09:55 2009 -0800 XQuartz: Explicitly pass a bellProc to make XBell() work again. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit e87a03fd531ce7974877688680d3bf9b85c2d835 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 27 17:16:57 2009 -0700 XQuartz: pbproxy: Wait for the server to finish starting up, so display is valid. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 15fc56addcc906592af7c0f4c0a5ac906fa5c389 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Nov 8 20:25:42 2009 -0800 XQuartz: Buildfix for Leopard and older Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit b5aa2e0a5fe233dc883084a5026013472e85bca4 Author: Chase Douglas <chasedouglas@gmail.com> Date: Mon Nov 9 22:54:39 2009 -0500 Move FD_CLR above pInfo->read_input The event fd may be invalidated by the pInfo->read_input call. If it is invalidated, the subsequent FD_CLR call will segfault. Thus, the FD_CLR call must precede the pInfo->read_input call. Signed-off-by: Chase Douglas <chasedouglas@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 982f6648fd29d085265bf6035c1bf4d1b2499316 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Nov 10 09:50:50 2009 +1000 dix: increase default number of buttons to 10. Currently the XTEST device is limited to the same number of buttons the core device has. This breaks if a user has a mouse with more than 3 buttons connected and is using a core client to fake button 8+ presses. Rather than expecting all clients to fix themselves, just increase the default number of buttons to 10, which is somewhat a compromise. Ideally, the XTEST devices should adjust themselves to the highest number of buttons available on the slave devices (like the master pointers already do), but that's a taks for another day. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit ec5417b965616e60b51466fe9fd2b44cb5abb349 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Jul 12 23:58:32 2009 +0100 Cygwin/X: Ensure WM_STATE atom exists in multiwindow mode Workaround a bug in iiimxcf (assuming the WM_STATE atom exists), which can cause many Solaris clients to simply fail with a BadAtom error Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit aa860552fd7e2888258a7b48b8c3bd4af527dc6c Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Sun Nov 1 18:19:08 2009 +0000 Cygwin/X: Enable clipboard integration by default Enable clipboard integration by default, can be turned off with -noclipboard. We still accept -clipboard for backwards compatibility. If both are passed, the last one is accepted (just as other arguments are handled). Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 87b00ced3d308a9168828c0e38ecffa0640621a0 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 1 18:18:48 2009 +0000 Cygwin/X: Setup screen layout in Xinerama mode Setup screen layout according to the screen window native window positions in Xinerama mode Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 0fe2e8c64e7a5a9140c77b88b266d7ae58b0bca2 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Sun Nov 1 18:18:31 2009 +0000 Cygwin/X: Allow composite to be enabled for Xwin Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 26a69bbd9b6f415c443d6d6f8f450329f348edc3 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Sun Nov 1 18:19:04 2009 +0000 Cygwin/X: Mount options have changed in cygwin-1.7 Mount options have changed in cygwin-1.7 Also fix a typo in the warning issued if /tmp is a textmode mount Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 35901ece6a49e5f8e245364c27723da2f9009a1d Author: Paul Loewenstein <paul.loewenstein@gmail.com> Date: Sun Nov 1 18:18:45 2009 +0000 Cygwin/X: Handle fake keypresses generated by speech recognizers Apparently, fake keypresses generated by speech recognizers may not bother with a scan code, so look up what scan code corresponds to the virtual key code if this occurs. Patch by Paul Loewenstein <paul.loewenstein@gmail.com> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 0866322b574b1f3695467535ed5fa8f9e629ad1d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jul 13 13:46:45 2009 +0100 Cygwin/X: Always use an authorization cookie for internal clients Don't conditionalize use of an authorization cookie for internal client threads on XCSECURITY, always use one (this avoids certain problems with XDMCP setups where the XDMCP host removes localhost from the access list etc.) Conditionalize the use of a XCSECURITY authorization descriptor on XCSECURITY Consolidate the various places where the authorization cookie is set for internal threads into a new function, winSetAuthorization() Use authorization cookie for multiwindow WM X message thread as well Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 72f81f4e449defb0654e9bdb2c9ec014475a3977 Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Nov 6 17:46:58 2009 +0000 Xming: Make -auth option work in with -multiwindow Use an internally generated cookie for authentication of the internal window manager client when using the -auth option in -multiwindow mode. Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 6dbf8f27c885ea3a761548183fb00ba3df2df553 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Jul 21 01:15:25 2009 +0100 Xming: Tidy up code for initial native window positioning Tidy up code for initial native window positioning and avoid a duplicate call to winMultiWindowGetTransientFor() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 28eb61fc04811bb9bbb523e0a252933313bb16ce Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 1 18:19:14 2009 +0000 Avoid a null dereference if IFF_BROADCAST is set but there is no broadcast address It seems that the getifaddrs() function can return interfaces with IFF_BROADCAST & IFF_UP set, but no broadcast address (at least under Cygwin 1.7, this seems to happen for v6 mapped v4 addresses) Avoid a null dereference if this ever happens Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 091cbbaed7aafab6f9839a40fe977ab067d1ace1 Author: Colin Harrison <colin.harrison@virgin.net> Date: Mon Oct 12 13:40:11 2009 +0100 Xming: Fix UT8String and CompoundText clipboard text sharing with windows clipboard XConvertSelection() in libX11 always returns 1, so there is no point in testing it incorrectly against Success. This is possibly a bug in XConvertSelection() This should fix UTF8String and CompoundText selection via the clipboard. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 9657eae5d65eff289089afc46dfb629758ebbdf7 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 1 18:18:51 2009 +0000 Cygwin/X: Clearly diagnose a timeout while waiting for SelectionNotify event Clearly diagnose a timeout while waiting for SelectionNotify event in the clipboard integration internal client. (which seems to be behind some of the reported failures) Turn useless #if 0/ErrorF()/#endif into useful winDebug() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 062f49a8e0d1afb4dd32e9451a47ab2792639e7f Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Nov 4 17:36:54 2009 +0000 Cygwin/X: Add a workaround for a SWT/Motif bug to internal window manager SWT/Motif expects all top-level windows to get reparented, and waits until they do. So workaround that in our internal WM by forcing a reparent event to occur, even though we don't actually need to reparent the window to frame it (as the frame is a native window, not an X window) http://sourceware.org/bugzilla/show_bug.cgi?id=9848 https://bugs.eclipse.org/bugs/show_bug.cgi?id=36806 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 71519a572fe15b85c0eb2b02636c9e871f2c858f Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Nov 4 17:34:40 2009 +0000 Cygwin/X: Fix typo in g_fAnotherWMRunning and tidy up WM detection code Tidy up code for detecting another WM is already running Fix typo g_fAnotherWMRunnig -> g_fAnotherWMRunning Remove some unused event mask macros Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit f3fad371cce0f3836514ad5b29e59fa1ca0627a7 Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Nov 4 15:33:53 2009 +0000 Xming: Add FORCEEXIT option to configuration file Add a new option to configuration file: FORCEEXIT, like SILENTEXIT but ignores the client count. Unsaved client work may be lost with this option but it is useful if you want no dialogs. Add description of this new keyword to XWinrc man page Also fix grammar of the exit confirmation dialog warning to be correct when there is only one(1) client connected. Also rearrange yacc tokens to one per line to make future merges easier Also amend default system.XWinrc so that SILENTEXIT is on by default Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 019a601de6a8ae083852c2d384c814dcc7aeeb72 Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Nov 4 15:16:03 2009 +0000 Xming: Add mouse motion events with flag POINTER_SCREEN in winEnqueueMotion() Add mouse motion events with flag POINTER_SCREEN in winEnqueueMotion(), as they are in screen coordindates and may need to be scaled to the axis range appropriately Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 7af1240b57daa4ec55512276a9fda499d923eaa0 Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Nov 4 14:20:17 2009 +0000 Xming: Replace all the uses of deprecated functions in hw/xwin with current ones Replace uses of LookupIDByType() and SecurityLookupIDByType() with dixLookupResourceByType() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 2a38f7c0dbc890e6408eee143d77719f265d583d Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Jun 19 21:12:55 2009 +0100 Cygwin/X: Remove a couple of extraneous '\n' in logged version info Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 56658fc06cb773ed20ef1b23a3fe918c0d3b36bb Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Oct 15 22:40:02 2009 -0500 Set default font path with fontutil 1.1 and fontpath.d Look for $sysconfdir/X11/fontpath.d and, if it exists, set it to the default font path as a catalogue: entry. Based on app/xfs commit c66a46e35ae40a23ad9acee838ab42300eddbd67. Otherwise, use the font-util 1.1 macros to determine the system fontrootdir and standard subdirectories, or let the user configure it and the subdirectories themselves. This adds a build-time (or at least an autoconf/autogen time) dependency on font-util, and changes the --with-fontdir argument to --with-fontrootdir. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Alan Coopersmith <alan.coopersmith-xsfywfwIY+M@public.gmane.org> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit c7d1319872e0ae0b7d945e9af8c4027ee5aa2055 Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 9 11:12:22 2009 -0500 randr: Fill in errorValue when verifying outputs/crtcs/modes Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d85ab6b6483d6ca7d9d22298d05ed1fa3076b042 Author: Dave Airlie <airlied@redhat.com> Date: Tue Oct 13 10:15:00 2009 +1000 loader: actually stat something that has some chance of existing. (v2) FindModuleInSubdir seems to expect a / at the end of the subdir its finding for, so we add the / early, the stat will fail if its not a subdir, I'm leaving the S_ISDIR in just in case there is another reason it could return 0. This does look a bit silly in strace but it seems to work fine. I have a very intermittent issue where drivers loses its / that I've been seeing on/off for a while, this may or may not fix it. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit a5e59230de3abafda9cd9d571cea192897155a14 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 5 13:44:30 2009 -0800 randr: Turn on ModeDebug during server setup Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c61e77c77ca309f3676370992f41867807ed0c67 Author: Matt Turner <mattst88@gmail.com> Date: Thu Nov 5 22:40:03 2009 -0800 Remove lnx_font.c and lnx.h I couldn't find any version of the X xserver that ever used lnx_font.c so let's delete it. I tried contacting its author, Egbert, multiple times on IRC and email [*] but never got any response. It also hasn't been seriously touched since January 2005. [*] http://lists.x.org/archives/xorg-devel/2009-October/002855.html Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 15ffe9f51b122494a2b292b3ab1f199d3e81600c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Nov 5 18:28:28 2009 -0800 configure.ac: Notify user about which SHA1 implementation is being used Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 6b109919f6e1593b27b0760bb56a65b43fb86ea4 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Nov 5 18:13:07 2009 -0800 SHA1: Add support for Common Crypto libSystem on darwin can handle SHA1 computation without needing to pull in OpenSSL. See CC_crypto(3) Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 840a68dc5e3b4d285894f86df2a8c41fca5a4bec Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 4 18:39:16 2009 -0800 XQuartz: Cleanup X11Controller.m compilation warnings. Declare X11Controller as implementing NSTableViewDataSource. Use selectRowIndexes:byExtendingSelection instead of selectRow:byExtendingSelection Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 0e3ad44c3b05cbe7b1d8f5ce7949fec3c7ae2e7c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 4 18:15:08 2009 -0800 XQuartz: Use dixLookupResourceByType instead of LookupIDByType Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 069fc6ce0a0e7f2c418e11941568ffcc52b6b331 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 4 16:18:06 2009 -0800 XQuartz: Don't weed out duplicates in generated keymap There seems to be an issue in the 1.5+ server where shift-space does not produce a space when 'keycode 57 = space' but it does when 'keycode 57 = space space' Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 6d6e8fb27f00f0c3128cef624b39a60aa754fdc8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 4 13:34:20 2009 -0800 XQuartz: Controller thread launches clients This avoids a memory leak due to no active auto-release pool on the server thread. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit f7b375bd141d0cf1e3add5443a5838dd8f554ef6 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 5 11:42:34 2009 -0800 Enable XF86PM on all Solaris platforms, not just x86/x64 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit f77262513ea17401092479e17ad20fc0eb91ffb5 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 5 11:42:33 2009 -0800 Use $(MAKE) instead of "make" to build Solaris inline assembly Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 964040764387d89ef64324cfbee31872ee6ce41c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Nov 4 15:35:37 2009 +0200 EXA: Preserve pPixmap->devPrivate.ptr in exaPixmapIsOffscreen_driver It crash the server when the drawable is 32 bit and the framebuffer is 16. This is pretty much a copy-past from commit 8e873185. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7442f3355ab8f0bb2b1a270da18c65d8d315d4dd Merge: 0573042 7897b6c Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 4 08:55:20 2009 -0800 Merge remote branch 'jeremyhu/master' commit 0573042cddb6f9942e408687a16c6842e62a8bfa Author: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Date: Wed Nov 4 15:59:30 2009 +0200 dix: Fixes a memory leak when a cursor resource is released. Just open and close a client that creates cursors in order to reproduce. In the problem case bits->refcnt is -1 and therefore bits->devPrivates is never released. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7897b6c2d41bccb72c19418674c3526ecce29515 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 27 18:00:48 2009 -0700 dix: Properly detect if the other device is frozen Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> commit 5e79976c13c5b94b12392b493846ca26be11750b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 3 16:35:27 2009 -0800 XQuartz: Run xmodmap after programatically updating the keymap. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Signed-off-by: Martin Otte <otte@duke.edu> commit 412c56ef3332d09efbd861e41c3e985f44729729 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Nov 1 22:08:40 2009 +0100 exa: remove some outdated comment - This comment is still in exa_driver.c and there it makes sense. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 48b8c076a7b7dbbddfc472e8c6e5251a0b174cbc Author: Matthieu Herrb <matthieu@laas.fr> Date: Mon Nov 2 11:11:24 2009 +0100 add libc as a choice for SHA1 implementation On Sun, Nov 01, 2009 at 02:54:13PM -0800, Keith Packard wrote: > Excerpts from Matthieu Herrb's message of Sun Nov 01 09:34:35 -0800 2009: > > > +AC_CHECK_FUNCS([SHA1Init], [HAVE_LIBC_SHA1=yes]) > > I'd suggest AC_CHECK_FUNC instead; as far as I can tell, AC_CHECK_FUNCS > will also define HAVE_SHA1INIT. Also, can you use HAVE_LIBC_SHA1 > consistently rather than having two separate names (HAVE_LIBC_SHA1 and > HAVE_SHA1_IN_LIBC)? Yes, I know one is a preprocessor symbol and the > other is a cpp shell variable, but I think that will work anyway. > New version taking you comments into account. From: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun, 1 Nov 2009 18:19:27 +0100 Subject: [PATCH] Add a probe for SHA1 functions in libc in *BSD. The interface is the same as the one in libmd. Signed-off-by: Keith Packard <keithp@keithp.com> commit da923d0bc15e99a8ed1986bd6f5df37f7af7284b Author: Matt Turner <mattst88@gmail.com> Date: Sun Nov 1 14:30:48 2009 -0500 Make sys.c use unaligned access functions provided in compiler. Favorite deleted line was definitely /* to cope with broken egcs-1.1.2 :-(((( */ Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d30637339963950910e5f5fb755b8465ac7dddb4 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu Oct 29 11:46:22 2009 -0700 Supply all code using dl*() with DLOPEN_LIBS Previously DLOPEN_LIBS was managed in top-level configure.ac. Instead bundle it with the code using dl*() functions to avoid breakages in uncommon configurations. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ec98d7fc78efefcf9fc61492529157c0d289c3f2 Author: Adam Jackson <ajax@redhat.com> Date: Mon Sep 21 10:23:16 2009 -0400 EDID: Extend the HDTV hack to handle "1368x769" Hate televisions so much. Signed-off-by: Adam Jackson <ajax@redhat.com> commit 7c0803f555782dbf451b7c79112d7deae02e5c9f Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 28 15:44:37 2009 -0400 modes: Fix duplicate detection, and do it more consistently Signed-off-by: Adam Jackson <ajax@redhat.com> commit ba2d39dd5428cb5922b797a1d4ea45b859412b40 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 26 15:10:30 2009 -0400 modes: De-duplicate a clock range check. Signed-off-by: Adam Jackson <ajax@redhat.com> commit 25236d19e6ef07fcb2c71569f1b7b0c12810834a Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 26 14:49:57 2009 -0400 EDID: Fix interlaced detailed timings to be frame size, not field size Signed-off-by: Adam Jackson <ajax@redhat.com> commit fb86433d897c116315cc7994390d11ac2f577511 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 26 14:04:23 2009 -0400 modes: Decorate interlaced mode names with a trailing 'i' Signed-off-by: Adam Jackson <ajax@redhat.com> commit fc2ec95664d55f45f77f1ebb039a7c17a1fcdaa3 Author: Ma Ling <ling.ma@intel.com> Date: Wed Feb 18 17:41:26 2009 +0800 EDID: CEA extension support Reviewed-by: Adam Jackson <ajax@redhat.com> commit fab74d1081270fb8f1d231e6e10d10aa33e164da Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 28 17:48:19 2009 -0700 Suppress certain GCC warnings in auto-generated code. - Don't warn for references to deprecated functions in xorg_symbols. - Ignore functions generated by gl_apitemp.py that are never used. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 239435875d6a92ed31731b500a992a3af0943594 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 28 17:48:18 2009 -0700 Don't cast double to int: use default conversions or explicitly round. GCC warns about casting a double return value to int. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit e8c48fd8f7aab54327b0091cd17c60235ae27168 Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 28 17:48:17 2009 -0700 Suppress GCC warnings like "the address of `u1' will always evaluate as `true'". Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 662594aeff9d1767316f08600949c73ac5060d18 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu Oct 29 00:40:48 2009 +0600 kdrive: Grab evdev mouse/keyboard devices when X server is active Input events are directed to both vt and input devices by default. Unless input devices are grabbed, keyboard events fill it vt buffers and cause spontaneous wakeups in kernel tty layer when buffers are full. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 83d520d86c888f2c8a4abb18b7a8858d568aa18f Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 28 16:45:44 2009 -0700 Add video driver flag to indicate that console access is not needed. Existing video drivers will get the console enabled by default. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 25979c46b467847ccb54f5c86a1be6b9c303c99a Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 28 16:35:28 2009 -0700 Alloc/free drawables array for each ProcPanoramiXShmGetImage call. Updates my previous patch, b422b532f3dcab54c53f61a66f2ad76059d1874a. keithp recommended against allocating the drawables array globally, but my updated patch with that fixed isn't the patch that landed. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 757c11630d5999ad13dcac79191429badc92a3a6 Author: Tormod Volden <lists.tormod@gmail.com> Date: Wed Oct 28 23:10:43 2009 +0100 xfree86: Fix description of DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE The message ending up in the log is misleading as to what the quirk actually does: It ignores the sizes in the detailed timings and replaces them with the display "Max Image Size". Signed-off-by: Tormod Volden <debian.tormod@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ccf4a69db747b000aee09072aac0a2891bde139a Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu Oct 29 01:54:00 2009 +0600 os: Add libsha1 as a choice of SHA1 implementation There are small systems which don't need OpenSSL or gcrypt. Add libsha1 (http://github.com/dottedmag/libsha1) as an alternative small SHA1 implementation. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 8613e4b0eb04150b1e377871f02b164be5d001e9 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Wed Oct 28 11:44:27 2009 -0700 Add missing DLOPEN_LIBS to kdrive compilation flags Xfbdev failed to build due to dladdr being used by xorg_backtrace. Explicitly add DLOPEN_LIBS to KDRIVE_LIBS as there does not seem to be a better place for it. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit deb72fc61464250af8185dab2da8ee09f13c55d8 Merge: 55f4c80 a60e676 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 28 10:54:13 2009 -0700 Merge remote branch 'jcristau/sha1' commit 55f4c80a4c891b355a99e6a05978ca945397c5cc Author: Hans Nieser <hnsr@xs4all.nl> Date: Wed Oct 28 06:59:40 2009 +0100 Xinput: allow non-integer values again for Constant- and AdaptiveDeceleration This was initially fixed by commit 3932a848572f4eaf8b7f1d91d9b74aeafab069a2 but then (presumably not intentionally) undone by commit 1d54479cb3c8b4f75b7564f8b5e1c5da940b20f4 . Signed-off-by: Hans Nieser <hnsr@xs4all.nl> Signed-off-by: Keith Packard <keithp@keithp.com> commit 50a5c32430a5267f2a05656d2417f9a8a44d8b97 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Oct 23 19:32:42 2009 +0100 dmx: Correctly compute DMXGetScreenAttributes reply length Correctly allow for excess length of DMXGetScreenAttributes reply over standard 32 byte reply in addition to the displayName string when computing the length of reply http://bugs.freedesktop.org/show_bug.cgi?id=24685 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9a2f6135bfb0f12ec28f304c97917d2f7c64db05 Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 23 10:04:57 2009 +0900 DRI2: Report the correct extension minor version Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit d886008c96cd16f735f54dace070cb00b23c6f44 Author: Marcin Baczyński <marbacz@gmail.com> Date: Thu Oct 22 14:43:25 2009 +0200 Kill compilation warnings. Signed-off-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 15b30fde179cba3877182cd51b0f870ef29ffaee Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 22 17:29:01 2009 -0400 dix: Fix up colormap fixup. FindClientResourcesByType() will walk all colormaps on all screens; we only want to fix up the current screen. Otherwise, screens > 0 will have the visual pointers for their colormaps pointing off into space. Signed-off-by: Adam Jackson <ajax@redhat.com> commit 3785475a78636eb6547ef9e46be9e009c7cf7800 Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 23 09:03:39 2009 +0900 Bump to 1.7.99.2 (unreleased) commit 909df9beb3ddd02632f36ae682537280a6a8e5b4 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Oct 20 12:57:05 2009 +0100 Resolve an inconsistency between libX11 and Xserver over GetModifierMapping libX11 ModMap.c believes that GetModifierMapping can never return an error Xserver devices.c believes that GetModifierMapping can return an error if the ModMap couldn't be generated According to the protocol document I have, libX11 is right, so adjust the server to send back an empty modmap if one couldn't be made... http://bugs.freedesktop.org/show_bug.cgi?id=24621 Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9c48862ac1ac119b6cfb7e376533f53af6a857f4 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 22 01:12:03 2009 +0900 Bump version to 1.7.99.1 This is a development snapshot for 1.8. Signed-off-by: Keith Packard <keithp@keithp.com> commit 26f4d8a2c12ff06c4beb06842cd8d9c0d9ddd4aa Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 22 01:04:42 2009 +0900 Make sure dmx docs are built for distribution. Ok, dmx docs are driving me slightly nuts. We probably shouldn't include the built versions in the tarball, but we do, so this is an attempt to make that work by having both the 'all' and 'dist' targets depends on the doxygen output. Signed-off-by: Keith Packard <keithp@keithp.com> commit 4114854893ff57a1be525ec099a4b33e5f9963b1 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 22 00:17:37 2009 +0900 Don't attempt to build hw/kdrive/sdl/Makefile anymore With sdl removed, there's no way to build the sdl Makefile. Signed-off-by: Keith Packard <keithp@keithp.com> commit 4d333c5121818754356853724333eadec2dcd18c Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 22 00:16:12 2009 +0900 Always check for doxygen so that distcheck gets dmx docs make distcheck wants the built dmx documentation so that users don't have to install doxygen. This means that even if dmx isn't built, the docs need to be so that the tarball can include them. Signed-off-by: Keith Packard <keithp@keithp.com> commit 7e92bac5f769aca99bd20e21fe2811f0480b647b Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 22 00:00:35 2009 +0900 Make sure HAVE_DOXYGEN is defined when not building dmx The DMX docs are build using doxygen if present, so configure.ac checks to see if that is available. However, when not building dmx (the default), this conditional must still be defined to make automake happy. Signed-off-by: Keith Packard <keithp@keithp.com> commit 1228e2d052f0bb98175c55c194340773b5fedb40 Merge: 08e7f62 52bc6d9 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 21 22:46:53 2009 +0900 Merge remote branch 'whot/master' commit 08e7f62faf72540cb3a6f1023024c145f7fa1a23 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 21 16:46:55 2009 +0900 Fix 'distcheck' to use host xkb files but install to build dir 'make distcheck' needs to read xkb files and write out compiled versions as a part of the 'make check' phase. This patch passes suitable options to the configure stage of the distcheck process to read xkb files from the system location and write them to the distcheck _inst directory. Signed-off-by: Keith Packard <keithp@keithp.com> commit 52bc6d944946e66ea2cc685feaeea40bb496ea83 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 16 11:03:09 2009 +1000 kdrive: Purge Xsdl From the original Xsdl commit: "sdl x server so that we can x-on-x the fb stuff for ease of debugging. if anyone uses this in production, a big scary monster will eat them. hrm, perhaps i should make it have a --i-know-what-i'm-doing param that it doens't start without, heh" That should be reason enough to not spend time maintaing it. Also, no more elephants. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f713f447a2110718dfc091380699362d76f0cd6c Author: Lee Leahu <freedesktop-bugs@dyweni.com> Date: Mon Oct 19 15:43:59 2009 -0500 dmxDestroyWindow() - must call the X's native DetroyWindow() Don't really know why this section was disabled, but without it, certain pPicture resources do not get free'd until later in the FreeClientResources() process after the screen has been free'd - resulting in seg fault. With this patch, all resources normally free'd using vanilla X are now also being freed correctly by Xdmx. https://bugs.freedesktop.org/show_bug.cgi?id=24576 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 664a8e37fd83141974b772980f680b94e48b4f87 Author: Lee Leahu <freedesktop-bugs@dyweni.com> Date: Sat Oct 17 00:45:44 2009 -0500 dmx: when setting up device axis, use the correct counter number Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 010d5e28655d619693632938e9e4325eef938295 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 16 10:01:13 2009 +1000 dmx: remove doxygen-generated files. These can be recreated by simply running 'doxygen doxygen.conf' in hw/dmx/doc. Some of the files do not exist anymore, these have been removed. Some other files have a different naming scheme. Doxygen warnings about missing links fixed, two warnings remain: /home/whot/xorg/xserver/hw/dmx/dmxwindow.c:142: Warning: explicit link request to 'dmxConfigureRootWindow' could not be resolved /home/whot/xorg/xserver/hw/dmx/dmxwindow.c:119: Warning: explicit link request to 'dmxConfigureScreenWindow()' could not be resolved Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ff3e171568c8b604fc5eacd5f7e9b7ee9417f172 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 16 10:26:21 2009 +1000 xkb: don't conditionally include xkb-config.h. If HAVE_XKB_CONFIG_H is ever undefined, we fail to build anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0b9dbd4bf2d1061514bebd28648538a5fc0b60e6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 16 08:24:37 2009 +1000 Use the default XKB settings for dmx and kdrive. Drop the dmx-specific defines, there's no reason to have separate ones considering they're about as hardcoded as the default rules anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e08d8a2b043e5be821c5e8b2dbf37b09102b5d01 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 24 11:25:28 2009 +1000 kdrive: silence tslib compiler warnings tslib.c: In function 'TslibInit': tslib.c:157: warning: unused variable 'tsDev' tslib.c:156: warning: unused variable 'inputent' tslib.c:155: warning: unused variable 'inputdir' tslib.c:154: warning: unused variable 'i' tslib.c:154: warning: unused variable 'fd' Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 522ca8179ad2b2b935993f08c9382cd5ad1d8b2f Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Tue Oct 20 04:18:01 2009 +0700 Remove unused LinuxFindPci and LinuxGetPciCfg These two functions are not referenced from inside xserver. Remove now-empty klinux.h too. Signed-off-by: Keith Packard <keithp@keithp.com> commit 63f4bf39170eb2262617ef2dc95fd6d337b9dad5 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Oct 19 13:07:26 2009 +1000 Fix make dist after 78c87bdad1feab91c2a39e01513b4b0826665f06 Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 2bd71a6db241924bd17ac9dd4aa38e7e563ee5c1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 16 22:29:26 2009 -0700 Fix segfault when -extension XKEYBOARD is passed on the command line Users should be told they can't disable XKB or XInput via error messages, not core dumps. Reported by T`2 on #xorg irc Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a32b2420d85f076282721afe005e85fff7d9837e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Oct 15 13:50:36 2009 +1000 kdrive: fix Xfake build by removing the old keysym stuff Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 7c31dd5db8b43c7796bf97a07e08213af5afd2ae Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Oct 15 04:24:25 2009 -0500 Remove CopyISOLatin1Lowered This function was moved verbatim into libXfont-1.4, and it is not used by the server or any drivers. Exporting it in both places leads to multiple definition linking errors on Cygwin, where we need to use a static libXfont due to poor weak-symbol handling. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 9bc4e88d84daf0f4faf0599b575675e74c75f4b8 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Oct 15 01:53:43 2009 -0500 Define ddxBeforeReset stubs in platform-neutral DDXs XWin uses ddxBeforeReset, which is called in DIX. Other DDXs need to define these in order to avoid an undefined symbol error at link time when building alongside XWin. Xnest and Xvfb already provide empty stubs; this does the same for Xdmx and the platform-neutral KDrive servers. Also add a prototype to avoid a warning in all DDXs. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit a2f27b97900f335cd5f6a3e5bf8fa1d0ec9eb9ac Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Oct 15 01:53:42 2009 -0500 Remove duplicates from Xfake_LDADD KDRIVE_LIBS already contains the libs in XSERVER_LIBS, so linking against both leads to multiple-definition errors when linking on Cygwin. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit ed4c6bc79a797830895ad6c3601318b2d1c4bdcb Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Oct 15 01:53:41 2009 -0500 Fix XWIN_LIBS definition Move XWIN_LIBS from XWIN=auto conditional to XWIN=yes conditional, otherwise the build breaks if an explicit --enable-xwin is passed to configure. Also remove obsolete library values from the definition. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit bcd0c02cfd0707b5f8b1ca91dfbe4412df2c643e Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Thu Oct 15 01:53:40 2009 -0500 Install SDK pkg-config and aclocal files only if XORG Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 264ce9e8360374b3a43442c8bdea08abde705446 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 14 20:33:53 2009 -0400 xselinux: Use the now-exported IsPointerDevice() instead of a copy. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 0ae1632be045bfbb288bb57190c830f94247460f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 14 20:32:28 2009 -0400 dix: Export IsPointerDevice() and IsKeyboardDevice(). Makes the functions available to extmod for extensions to call. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 6c2ae5fec552366e11ad64a27626eb5dec4becf0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 22 13:31:49 2009 -0700 xselinux: switch from x_device to separate x_pointer and x_keyboard classes. This will allow separate controls over pointer and keyboard without having to relabel the devices to separate types. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 4be354c4c2da5168b302601b91bd80cfaca7e193 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 22 13:18:44 2009 -0700 Remove some debug messages that trigger on XACE event delivery failure. It is normal for XACE to deny an event delivery, so these log messages shouldn't trigger when that happens. Just drop them for now. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit c4ffce4dc84a0a9d134a59b7e7765c99ed767e53 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 22 13:13:03 2009 -0700 xace: Relax permissions on XkbGetState from Read to Getattr. This request is used to get the current keyboard group and is called from GTK. It does not return an actual keymap (aside from modifiers) so it should be safe to relax the permission on it. However it does return button state information which should be controlled through a separate pointer Read check. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 0ff28319906eeb3f236acd72201c416ce01f2c6e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 15 19:41:04 2009 -0400 xselinux: Stop special-casing QueryPointer access checks. XACE has been changed to not return BadAccess on device read failures. Thus, no need for this workaround code. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 8502c06e19a4c00bf1311f54f9a365ee9e026e97 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 15 19:29:34 2009 -0400 xace: Fake return values on denials in input polling requests. Instead of returning BadAccess when "read" permission is denied on a device, falsify the device state (buttons down, keys pressed). This is nicer to applications, but may still have undesired side effects. The long-term solution is not to use these requests in event-driven code! Requests affected: QueryPointer, QueryKeymap, XiQueryDevice. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 0493935691e925ae137af7636fa15befa76c8b45 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 31 21:20:53 2009 -0400 xselinux: Factor out some dynamic array code into common helpers. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit ae8891ba0b63bfe6941a324e201d9ab7c645c0f3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 31 18:46:23 2009 -0400 xselinux: refactor extension code into smaller files. New files: xselinux_ext.c: Extension init and request handlers. xselinux_hooks.c: XACE hook functions and other callbacks. xselinux_label.c: Object security-labeling code. xselinuxint.h: Shared internal functions. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit a60e676f1fd243c78859440b87652f523d3f2ec1 Author: Julien Cristau <jcristau@debian.org> Date: Wed Oct 14 23:51:22 2009 +0200 Add libgcrypt as an option for SHA1 Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Rémi Cardona <remi@gentoo.org> commit d2a6a395435919aff8943285f9cbfe6569a9728f Author: Julien Cristau <jcristau@debian.org> Date: Wed Oct 14 23:30:55 2009 +0200 configure: add --with-sha1={libmd,libcrypto} option Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Rémi Cardona <remi@gentoo.org> commit 55516094947dd78ad2734bb784a2fb109b64c990 Author: Julien Cristau <jcristau@debian.org> Date: Wed Oct 14 23:20:44 2009 +0200 Move SHA1 computation from render/glyph.c to os/ Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Rémi Cardona <remi@gentoo.org> commit 22b38f513c93c2f2aea5909878c3c9acae7d35c1 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Oct 3 12:44:50 2009 +0100 Cygwin/X: Avoid a potential null pointer dereference before input initialization Avoid a null pointer dereference if WM_MOUSEMOVE occurred before the input device had been initialized (a timing sensitive bug occassionally seen during initialization) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 1b0dfd8dee639870725d3bd9b70c3bd589d09e5a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Jul 21 02:23:21 2009 +0100 Cygwin/X: Make -logverbose affect the verbosity of logging to the log file Make -logverbose affect the verbosity of logging to the log file, not just the verbosity of logging to the console Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> commit 83d120b90482d356be730f63aead0f8e44a4e846 Author: Colin Harrison <colin.harrison@virgin.net> Date: Thu Oct 1 14:47:22 2009 +0100 Xming: Fix various 'ISO C90 forbids mixed declarations and code' warnings Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 78c87bdad1feab91c2a39e01513b4b0826665f06 Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Sep 25 17:49:59 2009 +0100 Xming: Remove unused X-boxed icon resource Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit fdf7f7e95c852734c620f58df408a324902172cf Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Sep 25 17:46:40 2009 +0100 Xming: update .rc file Remove the obsolete DISCARDABLE flag in the .rc file Replace the obsolete DIALOG resource with DIALOGEX in the .rc file Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 5ddfd9d0898629627e8ab10e65ea2e082be3af37 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sat Oct 3 13:07:23 2009 +0100 Cygwin/X: Don't build rootless extension code unless we need it Only try to build rootless extension code if we really need it (i.e. mwextwm mode is enabled) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 25344ba7f7845654364d62bf15322b3b79465bd9 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Tue Oct 13 20:14:58 2009 -0500 dolt: add Cygwin to supported platforms Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6e158003e80534ce007290f75c89d698aec1d00b Merge: 2b14e14 5e762f0 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 13 18:40:42 2009 -0700 Merge remote branch 'mattst88/master' * mattst88/master: [alpha] assume we have __NR_pciconfig_iobase [alpha] don't return from void functions Fix undefined symbols on alpha Fix breakage on alpha caused by c7680befe5ae Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus" commit 5e762f0e2f203b5121a3de3b9af3c8981b31a77f Author: Matt Turner <mattst88@gmail.com> Date: Tue Oct 13 20:42:14 2009 -0400 [alpha] assume we have __NR_pciconfig_iobase The code path if we didn't have support has been broken since before we switched to git. The pciconfig_iobase syscall has been supported since 2000. Signed-off-by: Matt Turner <mattst88@gmail.com> commit 46785c04bca16f495af3ed8d685aee939a1a8f39 Author: Matt Turner <mattst88@gmail.com> Date: Tue Oct 13 20:40:59 2009 -0400 [alpha] don't return from void functions Signed-off-by: Matt Turner <mattst88@gmail.com> commit 2b14e142039193ea854a02706662204f4f5f6db8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 13 12:54:56 2009 -0700 Rootless: src drawable window can now be NULL Fix a possible crash when pSrc->pDrawable is NULL. Signed-off-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 5b91dfac6fbdf35288a4558638d4923e230ab8d3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 13 12:54:11 2009 -0700 Rootless: Abstract some of the Xplugin specific stuff which has crept into rootlessWindow.c The rootless extension now directly calls some Xplugin functions, and relies on types defined in Xplugin.h, which isn't very abstracted :-) This patch is a start at abstracting some of the Xplugin specific stuff which has crept into rootlessWindow.c. This has been done in a pretty mindless fashion, without much thought as to if the additions to the generic rootless interface are the correct ones There is some confusion as to if RootlesscolormapCallback() returns a Bool or xp_error_enum value (not so abstact), but I have no way of checking, of finding out if Xplugin actually checks the result :-) Based on patches from Colin Harrison, Jon Turney and Yaakov Selkowitz Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Signed-off-by: Keith Packard <keithp@keithp.com> commit 72f5874434c0c015b671c492c1318f35f1793668 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Oct 13 13:15:05 2009 +1000 dix: extend IsPointerDevice check to valuator-only devices. A device with valuators but no keys is definitely a pointer device and needs to be attached to the VCP. Otherwise, the class copying happens on the VCK and the VCP isn't updated with the events that are to be sent through it. This addresses the trigger for #24441, not the actual issue. Jury is still out on valuator+key devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit 1088073b11ed488c0df45af3867b900ef93c6fe1 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Oct 9 11:31:44 2009 +0200 EXA: Fix exaTryDriverSolidFill() for solid source pictures. Solid pictures have a NULL pFormat field, but their format is always PICT_a8r8g8b8. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 55305cf8db7787883bc80b7348eb626e609626f8 Author: Ben Skeggs <bskeggs@redhat.com> Date: Fri Oct 9 16:08:15 2009 -0700 EXA: fix exaGetRGBAFromPixel to not loop forever on PICT_a8 picture Easily reproducible by running "rendercheck -t fill". It should be safe to just test against rbits for all colour components as we should always have values for r/g/bbits for PICT_FORMAT_COLOR formats. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Michel Dänzer <daenzer@vmware Signed-off-by: Keith Packard <keithp@keithp.com> commit b375be9285c40467578fac2f1360c29a75306ab4 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Oct 9 11:31:46 2009 +0200 composite: Revert changes from adding support for BGRA picture formats. They were aimed towards a since abandoned approach for making radeon KMS work on big endian machines, and Aaron Plattner pointed out that they break the Composite extension when the X server runs in 16bpp. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Tested-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit c0a1bb511a4629bf5683d8a710dc4a1c577a5d44 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Oct 7 22:10:55 2009 -0700 Fix make warning: overriding commands for target `dix.O' Not only does automake generate unnecessary rules for dix.O on platforms for which SPECIAL_DTRACE_OBJECTS is false, it generates duplicate sets when "if SPECIAL_DTRACE_OBJECTS" is nested inside "if XSERVER_DTRACE" Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> commit b0dd6be2c8703f7062d45ac9fd646550c7d54e3b Author: Jamey Sharp <jamey@minilop.net> Date: Thu Oct 8 13:38:44 2009 +1100 Cast small-int values through intptr_t when passed as pointers On 64-bit systems, int and pointers don't have the same size, so GCC gives warnings about casts between int and pointer types. However, in the cases covered by this patch, it's always a value that fits in int being stored temporarily as a pointer and then converted back later, which is safe. Casting through the pointer-sized integer type intptr_t convinces the compiler that this is OK. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit b680a89262efcfef4644adb4a61ae42ea0db0c93 Author: Jamey Sharp <jamey@minilop.net> Date: Thu Oct 8 13:38:01 2009 +1100 Fix GCC warnings in xorg_backtrace Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 9bf2ff4faf730913de3073f346646a8727be41d4 Author: Jamey Sharp <jamey@minilop.net> Date: Thu Oct 8 13:36:44 2009 +1100 Fix "possibly uninitialized" warnings in glx In both functions, "answer" was uninitialized if "compsize" was 0, but in that case __GLX_SEND_VOID_ARRAY(compsize) results in a call to WriteToClient for 0 bytes, which returns immediately without examining the "answer" argument. So initializing to a null pointer is as good as anything else. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit b422b532f3dcab54c53f61a66f2ad76059d1874a Author: Jamey Sharp <jamey@minilop.net> Date: Thu Oct 8 13:29:27 2009 +1100 Remove static MAXSCREENS limit from Xext/shm.c Dynamically allocate per-screen data in the SHM extension, instead of having a single static-sized array. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 4df3e8c8053d9d4b3043f339a73d0de97020d884 Author: Martin Ettl <ettl.martin@gmx.de> Date: Thu Oct 8 13:27:30 2009 +1100 Resource leakage: 0 is a valid file descriptor When testing if an fd is valid, the required construct is >= 0, not > 0. [Daniel: Fixed up the Linux MTRR case as well.] Signed-off-by: Martin Ettl <ettl.martin@gmx.de> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 4151a13c80f3afa43f88afcf19a7aeb16dace93a Author: Francisco Jerez <currojerez@riseup.net> Date: Mon Oct 5 02:39:03 2009 +0200 dix: Fix a double free in dixFreePrivates. It can be reproduced when the server is regenerated and for some reason the private keys are reassigned in a different order: a manually allocated private may get an index formerly used by a preallocated private. In that case it will first be manually freed and then again by dixFreePrivates, as items[i].size was never zeroed out. Do it in dixResetPrivates. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Acked-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Keith Packard <keithp@keithp.com> commit 34eddbbb73bb16395dba0818247909c1b4bee4c2 Author: Michael Cree <mcree@orcon.net.nz> Date: Wed Oct 7 18:33:29 2009 -0400 Fix undefined symbols on alpha Signed-off-by: Matt Turner <mattst88@gmail.com> commit 44efcdde501d54ca9c3e33ab5b1f699956fc3f9f Author: Jamey Sharp <jamey@minilop.net> Date: Wed Oct 7 09:07:03 2009 -0700 Fix overlay detection when matching Xv adaptors across screens. Signed-off-by: Jamey Sharp <jamey@minilop.net> Acked-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 68304215e25876ee639015969b4f07e1c9c515e0 Merge: 6676f49 315aaef Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 6 22:41:42 2009 -0700 Merge remote branch 'alanc/master' Conflicts: configure.ac Signed-off-by: Keith Packard <keithp@keithp.com> commit 315aaef55750a863c08a16ad9120ffb76f9b48e0 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 2 21:54:53 2009 -0700 Use $(AM_V_GEN) to silence more commands when AM_SILENT_RULES is active Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2e294380b64b6362173d0590c4292f290e50af50 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 2 16:51:24 2009 -0700 Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4b0911565d18b1aefca564315d0f1b9b4a17aa65 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Oct 5 16:52:19 2009 -0700 Add platform tests for Dtrace linker magic Replaces special handling for Xquartz DDX and scales better to handling the multiple platforms that now have some level of Dtrace support available. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit 8c51b886400c5962b31ff565771be1b01a3ca8fb Author: Julien Cristau <jcristau@debian.org> Date: Tue Oct 6 16:08:42 2009 +0200 configure: quote argument to m4_pattern_forbid Without this, configure spits out ../configure: line 15460: ac_fn_c_check_member: command not found Also anchor the pattern to make it stricter. Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 6ee61578ddb9f880ef12bbe9c3671d7dd53f2809 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Oct 5 17:27:27 2009 -0700 Remove shave now that automake-1.11 has AM_SILENT_RULES Revert "Add shave so that we can see the steaming piles of warnings generated." This reverts commit 181cc08c8908a119fc403f970dea8cc98d3e0b9b. shave was left in the xserver 1.7 release/branch to allow developers & distros time to transition to automake-1.11. xserver 1.8 series will require automake-1.11 for silencing build noise. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit d5d960f57834f16164457dab2e80290717dbf2cd Author: Kim Woelders <kim@woelders.dk> Date: Fri Oct 2 19:31:15 2009 +0200 render: Fix clip region translation in miClipPictureSrc(). Signed-off-by: Kim Woelders <kim@woelders.dk> Reviewed-by: Soren Sandmann Pedersen <sandmann@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d2118c8ca94fc7bcb8e0de547e63cf022f53a8a9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 5 15:31:54 2009 +1000 xfree86: remove log-spamming DebugF All input drivers use xf86PostKeyEventP indirectly now and have been since it exists. I guess that qualifies it as tested - no need to spam the logs. Reported-by: Felix Wenk Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit bf116057c7efd43c247c93f2f5d733a5db857cc9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 5 10:44:43 2009 +1000 Require libXtst >= 1.0.99.2 and libdmx >= 1.0.99.1 libXtst requirement is already implicit since we require xextproto 7.1 and that doesn't go well with pre 1.0.99.2 versions of libXtst. Nonetheless, list it explicitly. Since d0440275108920f5cb5d630f55fc9a3320c496d3 we require dmxproto 2.2.99.1. Complementing that is libdmx 1.0.99.1 with the dmxext.h header file. Reported-by: Mark Rosenstand Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9625f6d328d6f516520930227b218979309938bc Author: Matt Turner <mattst88@gmail.com> Date: Tue Oct 6 20:58:30 2009 -0400 Fix breakage on alpha caused by c7680befe5ae Pinpointed by by Michael Cree. Commit c7680befe5ae removed Jensen support, but at the same time broke support for dense memory systems. Signed-off-by: Matt Turner <mattst88@gmail.com> commit aa07957373fd7cbe67458a001e4afd6a7f1ea37f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 28 12:20:03 2009 +1000 Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus" The vesa driver still uses slowbcopy_frombus and slowbcopy_tobus. This reverts commit 5ef53a94ce4e48e11de26290cd677266308640c8. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6676f49e34f8db7ef5767a6dbf6c2a4d2087f79c Author: Julien Cristau <jcristau@debian.org> Date: Tue Oct 6 16:08:42 2009 +0200 configure: quote argument to m4_pattern_forbid Without this, configure spits out ../configure: line 15460: ac_fn_c_check_member: command not found Also anchor the pattern to make it stricter. Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit a0363bf7b135d816e73849c91fa53d98fd6072d1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Oct 5 17:27:27 2009 -0700 Remove shave now that automake-1.11 has AM_SILENT_RULES Revert "Add shave so that we can see the steaming piles of warnings generated." This reverts commit 181cc08c8908a119fc403f970dea8cc98d3e0b9b. shave was left in the xserver 1.7 release/branch to allow developers & distros time to transition to automake-1.11. xserver 1.8 series will require automake-1.11 for silencing build noise. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit cbc886a3513079c084fb7ce47b87c3e5bba19f3f Author: Kim Woelders <kim@woelders.dk> Date: Fri Oct 2 19:31:15 2009 +0200 render: Fix clip region translation in miClipPictureSrc(). Signed-off-by: Kim Woelders <kim@woelders.dk> Reviewed-by: Soren Sandmann Pedersen <sandmann@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bd7430a32e63df8cd60352764744076448ee623f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 5 15:31:54 2009 +1000 xfree86: remove log-spamming DebugF All input drivers use xf86PostKeyEventP indirectly now and have been since it exists. I guess that qualifies it as tested - no need to spam the logs. Reported-by: Felix Wenk Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 1a2dde3335864abfbbc133dbc709f564272dd540 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 2 20:44:19 2009 -0700 Set XQUARTZ to no on non-Darwin OS'es Fixes build with dtrace probes on Solaris after efacd7bfd08ffc0725de6f639c6afbf3b2f6c9fe Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> commit c629e0fc50dfaffaa40a56709da7f035c289fed2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 5 10:44:43 2009 +1000 Require libXtst >= 1.0.99.2 and libdmx >= 1.0.99.1 libXtst requirement is already implicit since we require xextproto 7.1 and that doesn't go well with pre 1.0.99.2 versions of libXtst. Nonetheless, list it explicitly. Since d0440275108920f5cb5d630f55fc9a3320c496d3 we require dmxproto 2.2.99.1. Complementing that is libdmx 1.0.99.1 with the dmxext.h header file. Reported-by: Mark Rosenstand Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 24e640e1fa6cfb3917ba90dcdabf1fadddff20aa Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 2 19:20:24 2009 -0700 XQuartz: Fix a possible minor memory leak commit c4886fbabc1d8b4054654b227fcad83f58e8e798 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 2 18:58:35 2009 -0700 XQuartz: Send mouse location with scroll events. This fixes the problem where (0, 0) was sent as the mouse location with scroll button events causing the event to not reach the client. commit 4c6bfa2c09ae2b0cffdf9211a6dfbcaefe0366b5 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Thu Oct 1 10:39:19 2009 -0700 GLX: More clearly document the GLX protocol version handling Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 45f447dafded5adfe11b7df3325c2d8f6ae0639b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Oct 1 21:19:11 2009 +1000 dix: force a minimum of 0 for screen coordinates. Currently the root coordinates may fall into ]-1..0] if the subpixel remainder is less than 0. Screen coordinates mustn't go below 0, so use miPointerSetPosition to cap off the remainder if the coordinates are below 0. This is cheating a bit, a more comprehensive solution to deal with subpixels correctly when crossing screens is needed. For now, this'll do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Simon Thum <simon.thum@gmx.de> commit 64fe5784b49347e1fd27b0c463be5c16557594c9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Oct 2 09:34:24 2009 +1000 configure: if xnest was requested but modules weren't found, fail. Tested-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Julien Cristau <jcristau@debian.org> commit 3ebb82d61c2b56e8f7145443a552a4e913bbfc80 Author: Dave Airlie <airlied@redhat.com> Date: Thu Oct 1 15:25:55 2009 +1000 rotate: drop unwrapping inside block handler. Keith has shown half the block handlers wrappers are wrong, also dynamic wrapping/unwrapping from what I can see will happen after the drivers, so its really accidental ABI, that we can't change now without modifing drivers. So be safe for 1.7. Signed-off-by: Dave Airlie <airlied@redhat.com> Declared-as-sane-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cb54cf1b3e8c4109541cfb698542c00f2473e731 Author: Dave Airlie <airlied@linux.ie> Date: Wed Sep 30 11:33:16 2009 +1000 glx: fixup deref of null pointer when glx screen init fails. I think this is what the original author wanted. Signed-off-by: Dave Airlie <airlied@redhat.com> Acked-by: Ian Romanick <ian.d.romanick@intel.com> commit 3d7cf468df96c0130a862f0d93fec990b9110c2f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 1 11:58:18 2009 -0700 XQuartz: Update version strings to be X11R7.5 and the bundle 2.5.0 Is fink really _still_ relying on this X11R7.x version string? commit 85b831f701d085e514afcf8a5ce9b11f8a57984e Author: Julien Cristau <jcristau@debian.org> Date: Thu Oct 1 17:27:11 2009 +0200 xfree86: fix xorg.conf manpage formatting error commit 9bc7cbf9c02656982c2525836b5498993f708e02 Author: Nirbheek Chauhan <nirbheek@gentoo.org> Date: Tue Sep 29 22:35:06 2009 +0530 xkb: check permissions on XKM_OUTPUT_DIR Checking just for root is insufficient since that does not guarantee write/read permissions in XKM_OUTPUT_DIR (for example with sandbox). Check if we can write a file, as well as read it later. Otherwise, invoke the fallback to /tmp Signed-off-by: Nirbheek Chauhan <nirbheek@gentoo.org> Signed-off-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 622fc98fd08aba98369e6933c3ab8c9ff85385d5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Oct 1 10:03:42 2009 +1000 render: Fix crash in RenderAddGlyphs (#23645) This patch fixes two bugs: size is calculated as glyph height * padded_width. If the client submits garbage, this may get above INT_MAX, resulting in a negative size if size is unsigned. The sanity checks don't trigger for negative sizes and the server goes and writes into random memory locations. If the client submits glyphs with a width or height 0, the destination pixmap is NULL, causing a null-pointer dereference. Since there's nothing to composite if the width/height is 0, we might as well skip the whole thing anyway. Tested with Xvfb, Xephyr and Xorg. X.Org Bug 23645 <http://bugs.freedesktop.org/show_bug.cgi?id=23645> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit 758ab55d2defc78d0169fd61a7036eb9f889e9e7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Oct 1 15:22:19 2009 +1000 render: set the glyph picture to NULL by default. In a follow-up patch we may have glyphs with a NULL picture. To cope with that, always set the pictures for glyphs to NULL at creation time and cope with cleaning up such glyphs. Also, since compositing a NULL source doesn't do a lot anyway, skip trying to do so. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> commit b5fcc5553eb784c9f4826936e839079c0cdee55a Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Oct 1 15:17:11 2009 +1000 exa: avoid infinite loops if UTS sw fallbacks. The upload in finish access can cause an infinite loop if UTS returns FALSE in here. Fixes fd.o bug #24246. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit db98b26ee145f70e732e2cf4a6ac3de77fdf4adc Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 30 11:40:19 2009 -0700 Re-fix DGA removal. Removing DGA ended up breaking any drivers calling into the old xf86DiDGAInit function as it tried to see if DGA was already enabled and ended up crashing if the VT wasn't completely initialized. Oops. Also, if the driver initializes DGA itself, have the DiDGA initialization overwrite that information as the DiDGA code will call ReInit on mode detect. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 873467adad479be02cd9cc6b43685919f5612d91 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 30 00:22:02 2009 -0700 XQuartz: Set the proper bitmap for key repeats... XkbSetRepeatKeys lies and doesn't do what it says it will... commit 7bef78e199a4e4f7916be506807513efcd8fd4cb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Sep 29 23:40:47 2009 -0700 xkb: Use XkbPerKeyBitArraySize instead of hardcoded value of 32 commit 4970666827e65424ee17ccf6341ff84aac974383 Author: Kim Woelders <kim@woelders.dk> Date: Tue Sep 29 20:31:45 2009 +0200 dix: Fix potential memory corruption in doListFontsWithInfo. Signed-off-by: Kim Woelders <kim@woelders.dk> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6ffda5aae75272fabdc27d6f693ae827be119e95 Author: Dave Airlie <airlied@redhat.com> Date: Tue Sep 29 11:49:09 2009 +1000 dix/glx/composite: consolidate visual resize in one place. The previous code was copied and in both cases incorrectly fixed up the colormaps after resizing the visuals, this patch consolidates the visual resize + colormaps fixups in one place. This version also consolidates the vid allocation for the DepthPtr inside the function. I'm not 100% sure colormap.[ch] is the correct place for this but visuals are mostly created in fb and I know thats not the place to be resizing them. Fixes fd.o bug #19470. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ad5c0d9efa47476ed5cf75c82265c73919e468b4 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Tue Sep 29 16:43:43 2009 -0700 GLX: Enable GLX 1.4 on DRI2 Return the minimum GLX version supported by all screens. Assume that DRI2 screens have all the required features for GLX 1.4. Assume that everyone else can only support GLX 1.2. Reviewed-by: Kristian Høgsberg <krh@redhat.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit f11a356bcef1bc0a6440325019d5967b745a42dd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 28 17:05:29 2009 -0700 XQuartz: Cleaned up keymap setting for easier maintenance (cherry picked from commit b9dfed9e88389cbd29406a20d38ee4297638649b) commit f3223c71cfc638e695981e527517d48ea00d124d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 28 23:01:59 2009 -0700 XQuartz: Remove the redundant xquartz_resetenv_display unsetenv(DISPLAY) takes care of this for us anyway (cherry picked from commit d2263645d839c9edeedea0835d26f1f41b37f70e) commit 9b98b883227ed23d5470e8de689afeec4a0fd742 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 28 17:47:31 2009 -0700 XQuartz: Query the BundleIdentifier from the bundle in X11.bin rather than using the configure option. This lets X11.bin drop into any .app ... the Info.plist and Xquartz binary need to have it hardcoded still. (cherry picked from commit 9ad16b8e50b13eb6d0cd20386d07aa8d7320f671) commit 11817a881cb93a89788105d1e575a468f2a8d27c Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Sep 29 08:56:59 2009 +0200 Fix ShmPutImage non-ZPixmap case. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=23298 . commit 19be992d9dc542b61fa3f4fd32a09071c9e64880 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 28 14:18:45 2009 +1000 ephyr: if -parent is given, check for a trailing -screen. (#24144) If -parent is given, don't open up a new window if -screen is given as well. The commandline option -screen allows to set the depth of the embedded Xephry instance, even though width and height are autoscaled on -parent. This patch checks for a -screen parameter after -parent and - if one is found - delays initializing the screen. The parent window id is stored temporarily but re-set after a -screen argument. The following command is thus valid: Xephyr -parent 1234 -screen 640x480@8 -screen 1024x768 It embeds the first 8-bit screen into window 1234 and opens up a new window for the second screen. Multiple parent arguments are possible, the screens are embedded in-order. X.Org Bug 24144 <http://bugs.freedesktop.org/show_bug.cgi?id=24144> Tested-by: Vic Lee Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit efacd7bfd08ffc0725de6f639c6afbf3b2f6c9fe Author: Ben Byer <bbyer@freedesktop.org> Date: Sun Sep 27 10:35:53 2009 -0700 Add (ok, fix) support for DTrace under OS X (cherry picked from commit 8428a57184f542941d2c8c90e97d18e111a69dd2) commit b3415187e92960cbff784108b5a3a8d130dc34c5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 23:09:51 2009 -0700 Rootless: Correct border rendering on parent-relative windows Resurected code from the punted RootlessPaintBackground/Border and added it conditionally to miPaintWindow (cherry picked from commit cf2e3312cff3f341e9edba8c321a4ca7ffd8748e) commit 6df00917cab5c1096070625385fd76ee6c52e0f1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 23:00:59 2009 -0700 XQuartz: Fix QuartzSetCursor to match the expected prototype. (cherry picked from commit dadab5a2279a19dcf709402d7f22f0cd48670db0) commit 67a51cd9ef60b4c9f25fdde84f9eb352936c8c67 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 22:57:25 2009 -0700 XQuartz: Fix a bunch of compilation warnings about style (cherry picked from commit 54000bdcbca52a2de31f7c1a1147de6d8e9dbbb8) commit 96780eaf32636c94a9cf33f22eb9f01d984ff754 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 22:29:49 2009 -0700 XQuartz: Nuke TSM It's deprecated in SnowLeopard. Ben and I both have no idea what it is for. It says something about unicode input, but urxvt seems fine taking in unicode, so /shrug... bye. (cherry picked from commit 29cb904e4de2411a9b6dbe68694954788f0525f7) commit 15e15816a2f011d0aeeaff9e394d30a147c973ce Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 22:26:22 2009 -0700 XQuartz: Fix inverse map from mode_switch to alt (cherry picked from commit de6cee11e1c335a0e5f708e7641e81d3cfe52529) commit 558d803b2966c2e44345a80e635e091dc3e49f02 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 18:25:57 2009 -0700 XQuartz: Force a keymap resync on the first keypress to workaround XKB mucking with our keymap. We need to find a better way to work with XKB on this. (cherry picked from commit ceaa5c779ceed3de5ea53727649613be3133b24e) commit 226b1033b48807fd6871ba626e20ef1411904939 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 17:08:12 2009 -0700 XQuartz: Transition from xEvent based mieq to InternalEvent (cherry picked from commit a3dbde2de87ee4f577748a8c447501a3ea462559) commit 0c2731596f27f2cdf5000ba41de37e7eb86ad6f9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 28 15:07:48 2009 +1000 Put tests for zero-sized strings in quotes (#24060) X.Org Bug 24060 <http://bugs.freedesktop.org/show_bug.cgi?id=24060> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 83023ffd09a84ff48e6b99f57ebad101a00478db Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 28 13:59:25 2009 +1000 xfree86: use the DDC size if either width or height of DisplaySize is bogus. If either width or height of DisplaySize is invalid, assume that the configuration is invalid and use the DDC-reported values instead. See Comment 9, Bug 9758. http://bugs.freedesktop.org/show_bug.cgi?id=9758#c9 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dave Airlie <airlied@redhat.com> commit f772014c435f56db56520ca13ffa39431684f122 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 23 10:53:51 2009 +1000 render: Plug a memory leak in AddGlyph. (#23286) AddGlyph was missing the FreePicture() call that DeleteGlyph used, resulting in a memory leak when more than one Glyph was added in a RenderAddGlyphs request. Since the code in AddGlyph and DeleteGlyph is identical, move into a static function to avoid such mistakes in the future. X.Org Bug 23286 <http://bugs.freedesktop.org/show_bug.cgi?id=23286> commit 3db28f92b0c810b452506abbed299a204c90ba0b Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Thu Sep 24 12:57:02 2009 +0200 configure: make XNEST default to auto. When we're checking whether to build Xnest, we're comparing the variable to auto but before it never was assigned that. Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de> [Xnest was enabled to yes to increase build exposure and catch compiler errors early. The requirements to Xnest are quite low and I expect most developers have them, so Xnext will be enabled on most boxes. Anyone missing those requires probably doesn't want to build Xnest anyway.] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 78ad6ca9a97440b74019c00a28144ea7d1e03431 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sun Sep 27 17:30:23 2009 +0200 xfree86: Hurd fix I hadn't paid attention that the parameters order had changed, here is a trivial patch, please apply. Signed-off-by: Julien Cristau <jcristau@debian.org> commit fb7938315bed9d4cb5641ee9acebf78a13bc109e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 27 09:48:43 2009 -0700 Xi: Make CopyKeyClass X_HIDDEN to avoid ugly ifdef-fu (cherry picked from commit 6d436e17a9ae7f4ce8537f3fabc052d4f07ca75f) commit a2cd21177859eb45320a94c96dde7d9058ab7650 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 26 23:41:45 2009 -0700 XQuartz: Stop checking version numbers of the bundle because CFBundleGetVersionNumber is gimpish (cherry picked from commit 9f5bdd89608ec12012592ff395b82e954fbb4da8) commit fbfbf93405222322571e15e78dea57c8f2755eae Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 26 22:52:39 2009 -0700 XQuartz: Add pressure/tilt property labels (cherry picked from commit 84ea67130ef6b4086042aad6036ce66f93ea3e56) commit 65f14840898dd7e9d61d8c966f3ff11ae3e82d4f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 26 22:48:49 2009 -0700 XQuartz: Fix a brain-o array indexing problem /bop Peter (cherry picked from commit 494a6b046a258ad83dc98eb92b7c3d8f1d2626bb) commit 7159381881e5da33a49e8735811b93cbfe4f681e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 26 22:17:09 2009 -0700 XQuartz: Nuke duplicate locks that make painful headaches (cherry picked from commit 1dd56322bd1722f2427fb2d833c5608248b60cf0) commit fba8c702ba6aa8fac27682e0838fd744e197d54f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 26 22:13:49 2009 -0700 Xi: CopyKeyClass is not static for XQuartz (cherry picked from commit 85d6402354cdf143c6490f2725744c2f08b5605b) commit dc1e1bebff8b9d1eb6196dfd4b2f52f1e4200efa Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 7 00:02:21 2009 -0700 XQuartz: Use internal xshm header for new xextproto (cherry picked from commit 1755239330c0bdac820d88a3e06ff391d65f29be) (cherry picked from commit 697be460d0e555e2c75eed6889293650e02d423c) commit 73ae547d5e687ef10dea45801fc627e10ac4b659 Author: Michel Dänzer <daenzer@vmware.com> Date: Sun Sep 27 02:08:10 2009 +0200 EXA: Fix mixed pixmaps crash with missing / failing UploadToScreen hook. For the recent mixed pixmaps changes, I failed to realize (or hit in my testing) a problem which can occur if the driver doesn't provide an UploadToScreen hook or provides one which can fail: There can be a crash in exaMemcpyBox() because exaCopyDirtyToFb() passes pExaPixmap->fb_ptr to exaCopyDirty(), but that's normally NULL with driver allocated pixmaps. The solution is to make exaCopyDirty*() no longer rely on pExaPixmap->fb_ptr but use pPixmap->devPrivate.ptr after PrepareAccess instead. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24167 . commit c9ec2bab2f258798fd6e6676698c732f09571a60 Author: Kevin E Martin <kem@redhat.com> Date: Sat Sep 26 13:10:54 2009 +1000 dmx: undefine MITSHM, move undefs to miinitext.c. This patch undefines MITSHM for dmx - we don't support the required screen->ModifyPixmapHeaders. All undefines are moved from dmx-config to miinitext.c, where they belong. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fc9d733bab3ff0e4e51b19c73b66196dca563a70 Author: Kevin E Martin <kem@redhat.com> Date: Sat Sep 26 13:09:52 2009 +1000 dmx: reshuffle linker order to avoid errors when MITSHM is undefined. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e7c2598f565e8252dd66ee3e6212b310856476cb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 25 14:53:33 2009 +1000 dmx: core events are always in screen coordinates when passed to GPE. This fixes input in dmx, the pointer appears at the right positions to the clients now. Also mark the spot where we pass in the button state as valuator to GPE with a FIXME. (??) Tested-by: Kevin Martin Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 43a2eb794f19a2ba56d653f465fc5f6b2ff0d3d3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 23 21:49:11 2009 +1000 configure: Unify all library defines that require a specific version. This patch moves all libraries that require a specific version into a single location instead or duplicating them across the configure.ac file. Libraries that do not require specific versions are left where they are. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9bd08c690fc687c4d69bb70536f3079a9184476d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 24 14:07:26 2009 +1000 Xi: update axisVals with the right subpixel data. Subpixel data in data_frac is stored as FP32.32, hence we need to get that down again before adding it to the current value. Reported-by: Thomas Jaeger Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit abb8108fb44cc9b08fe4ae7d805a0a22564ca6bb Author: Michel Dänzer <daenzer@vmware.com> Date: Sat Sep 26 02:05:24 2009 +0200 EXA: Only calculate cache position once for each glyph. commit c11678cc189551f2a01eaa7a63969c16950739b4 Author: Michel Dänzer <daenzer@vmware.com> Date: Sat Sep 26 02:05:06 2009 +0200 EXA: Accumulate arbitrary number of glyphs without flushing. commit 0369eeeb6bf8a808fa2df503fc8b8df81e6e07b8 Author: Michel Dänzer <daenzer@vmware.com> Date: Sat Sep 26 02:04:48 2009 +0200 EXA: Try to minimize UploadToScreen calls for mixed pixmaps. If there are several software fallbacks affecting the system memory copy of the same pixmap, only copy the results back to the driver pixmap when it's used for acceleration again, or in the BlockHandler, whichever happens first. commit 1818cbd70fc1f2e1487b4c678e67e28f1265c0ef Author: Michel Dänzer <daenzer@vmware.com> Date: Sat Sep 26 01:59:39 2009 +0200 EXA: Extend mixed pixmaps scheme to allow driver PrepareAccess hook to fail. If the PrepareAccess hook fails, use the DownloadFromScreen hook to retrieve driver pixmap contents to a system RAM copy, perform software rendering on that and copy the results back using the UploadToScreen hook. Use the classic migration logic to minimize transfers (which as a bonus allows slightly cleaning up some of the existing mixed pixmap code). This enables things that weren't possible before with driver-allocated pixmap storage: If some (or all) GPU pixmap storage can't be mapped directly by the CPU, this can be handled between the PrepareAccess and DownloadFrom/UploadToScreen hooks, e.g.: * Radeon KMS on big endian machines can fail PrepareAccess if the pixmap requires byte-swapping and swap bytes in DownloadFrom/UploadToScreen. * Environments where GPU and CPU don't have a shared address space at all. Here the driver PrepareAccess hook will always fail and leave all transfers between GPU / CPU storage to the Download/From/UploadToScreen hooks. Drivers which can handle all pixmaps in the PrepareAccess hook should notice little if any difference. commit e23bffc41b007f1bc2b8f5cd4ac54213062c95cc Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Sep 15 19:17:48 2009 -0700 Fix build of unit tests when dtrace probes are enabled ar loses the dtrace probe magic when building static libraries, so we have to link with the .O files in order to resolve the dtrace probe symbols. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 9fa73be9fa543a686ea35c861084f5af37d44caa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 22 20:34:54 2009 +1000 Require libXext >= 1.0.99.4 Reported-by: Tilman Sauerbeck Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a9c274df5c37cb4ece6449e934342d8ff8e61705 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 23 11:43:27 2009 +1000 kdrive: plug two memory leaks when freeing the KdKeyboard/Pointer. xkbRules, xkbModel and xkbLayout are strdup'd in KdNewKeyboard, need to be freed. The ephyr driver strdups the name on top of the already allocated kdrive-assigned name. Memory must be freed beforehand. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fd913136732ff14a0484ca28f60ac1fbf49be81d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 23 11:44:12 2009 +1000 dix: plug memory leak in DeviceEnterLeaveEvents. 'event' must be freed before exiting. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6ee796e9bb4e46782b50a69c7b4fa5b49576f139 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 24 14:05:52 2009 +1000 Xi: fix length calculation for ValuatorState in QueryDeviceState reply. The length field needs to include the bytes required for the valuators (INT32) as well. The reply length has the right value and since the valuator state is always last, clients didn't notice the wrong offset. Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3b5bbb149d4c932d9624336f5cbe9fe71c87bea3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 23 12:32:44 2009 +1000 configure: fix up tslib check once again. This patch addresses two issues: The check for HAVE_TSLIB = xauto can never be true, the check has been corrected to TSLIB = xauto. Pre-pkgconfig versions of tslib fail to be found, this patch restores the additional AC_CHECK_LIB. However, the pgk-config check must happen before AC_CHECK_LIB, as AC_CHECK_LIB does not seem to honour the LD_LIBRARY_PATH. Thus, if tslib is installed outside of the default paths, AC_CHECK_LIB fails. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked--by: Daniel Stone <daniel@fooishbar.org> commit 5402f18d9c3f7ba19cc05b3a814e3a9e94c8d551 Author: Thomas Jaeger <thjaeger@gmail.com> Date: Tue Sep 22 20:16:21 2009 -0400 dix: report XI1 axis values correctly if first_valuator != 0 Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 33bf9cb69dccbb6889b2f83e6db61f40dc644e17 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 23 17:41:28 2009 -0700 XQuartz: GLX capabilities: Allow 16bit accumulation buffers http://xquartz.macosforge.org/trac/ticket/308 (cherry picked from commit e9e63a2118b76b6c31c4081fec08a99e4d796e22) commit ce1fe8ddb4a4dbe6cfd909e5b1b73b459d742bec Author: Michel Dänzer <daenzer@vmware.com> Date: Wed Sep 23 13:10:05 2009 +0200 render: Don't add b8g8r8x8 format for depth 24. The components are required to be packed in the bottom of the pixel, so this format can't fit in depth 24. Also fix up a comment for the addition of BGRA formats. commit 096f21bb7a1217443d8a03529b1a2938518eb24f Author: Michel Dänzer <daenzer@vmware.com> Date: Wed Sep 23 08:24:06 2009 +0200 EXA: Fix some issues pointed out by clang. Remove dead variables, fix use of uninitialized values, that kind of thing. commit 824a09d856a5f750694e11d2fd2faaa3de705eaa Author: Simon Thum <simon.thum@gmx.de> Date: Mon Sep 21 15:23:27 2009 +0200 dix: move bounds check before access Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9edb9e9b4dde6f73dc5241d078425a7a70699ec9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 22 12:56:17 2009 +1000 Bump to 1.7.99.1 X Server 1.7 has branched off. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 66ece3bfb19642bf0f1ef73c3caa8a99c3dfb5a9 Author: Kevin E Martin <kem@redhat.com> Date: Tue Sep 22 11:42:24 2009 +1000 dmx: only free the default pixmaps that we actually allocated. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 20fb8c2e2fccb28c1b89e6e2a5c685e1287baedb Author: Kevin E Martin <kem@redhat.com> Date: Tue Sep 22 11:41:33 2009 +1000 dmx: disable Get/SetWindowPixmap, we don't support composite/redirected windows Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fcdc1d78cca3b8bb6b77d53eda7e21d649df6943 Author: Keith Packard <keithp@keithp.com> Date: Mon Sep 21 19:16:59 2009 +0200 Fix sporadic segfault on resume due to accidentally freeing cursor. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 91e1fe5863a180b2d70a6943e83b98bbd4c9ebce Author: Matthias Hopf <mhopf@suse.de> Date: Mon Sep 21 19:13:31 2009 +0200 Revert fe31f9c + 977953b to fix issue for good. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 90aa0e4a49cdd637178a771365e1e8dab8bceb87 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 18 10:03:02 2009 +1000 input: don't use typecasts to access members of InternalEvent. To avoid confusion, the member names are now postfixed with _event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 693d4fdb1c7b7c789a812790122454e718602449 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 22 11:13:58 2009 +1000 Xext: switch mbuf.c to dixLookupResourceByType Resolves a linker error caused by LookupIDByType. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 493d2f9c2fc56dd3b4c03451c07cd25e3012142e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 22 11:05:07 2009 +1000 Xext: remove DisplayImageBuffers from mbuf.c Not referenced by anything. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fff40b3353c7025c1d1e3dd14b5c78f7c9f5de7c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 22 10:53:47 2009 +1000 Xext: fix up multibuffer compiler errors. Triggered by the xextproto 7.1 change, fixed by moving the matching declarations from the header file to here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4c8f834da6c8c84849313453fe223a8165c6afc0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 21 14:52:31 2009 +1000 configure: fix up check for tslib. Reduce the tslib-check to the pkg-config check only instead of the previous library symbol check followd by a pkg-config check. This patch also reduces the required version of tslib back down to tslib-0.0. Unfortunately, the 1.0 tarball available through http://tslib.berlios.de/ still announces itself as 0.0.2. Reported-by: Werner Landgraf Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 977953bf14858d17c22208c848854ddbe7e86527 Author: Matthias Hopf <mhopf@suse.de> Date: Mon Sep 21 15:44:00 2009 +0200 Less intrusive workaround for sporadic segfault on resume. Hopefully fixes fdo #24010 (memleak). commit 55747d256d759850141e4a9c4dec965616a31dc8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 18 16:27:54 2009 +1000 input: define server-supported protocol versions in one single file. include/protocol-versions.h specifies each extension version as supported by the server and sent back on the wire to the client. This fixes up several issues with the server potentially reporting a higher version of the protocol if recompiled against a newer version of the protocol. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Rémi Cardona <remi@gentoo.org> Acked-by: Julien Cristau <jcristau@debian.org> commit 0b7c6c728c2e2d8433a188315cc591308a89cd85 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 18 21:12:17 2009 -0700 xfree86/modes: Remove all framebuffer support from DGA This removes all rendering and mapping code from xf86DiDGA, leaving just mode setting and raw input device access. The mapping code didn't have the offset within /dev/mem for the frame buffer and the pixmap support assumed that the framebuffer was never reallocated. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d3a3c904e5e3b5e8bb3c51ca6a563880ff589bf3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 21 09:41:46 2009 +1000 configure: resourceproto is optional. Although a --disable-xres flag is provided, resourceproto was listed in REQUIRED_MODULES since 2005 (5b218617fa8ba52bf65aef35da39e06c662495e6). Remove, make conditional on the xres flag only. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b9ae1b91f316a98eb3bbefe1fc61f3e0faa861e0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 21 09:22:53 2009 +1000 dmx: silence 'implicit declaration of function ‘XFixesSetPictureClipRegion’ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit aa71e268f55ac39351814ab6840196c4f58bad39 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 18 11:35:47 2009 +1000 Xext: silence 'warning: no previous prototype' for sync, bigreq and xcmisc. xcmisc and bigreq don't have their own header so just declare it here to shut up the compiler. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 00dfe69aab786ea650b41dfefc031f0e0fc72b0c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 17 14:48:51 2009 +1000 randr: reply with the server or client version, whichever is lower. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8b75d0f9d347d7c3aad1e53809e0a2bed03b92fc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 17 14:17:54 2009 +1000 render: reply with the server or client version, whichever is lower. Protocol requires that the lower of [server version, client version] is returned to the client. The other part of the issue discussed in reply to [1] remains. [1] http://lists.freedesktop.org/archives/xorg-devel/2009-September/001990.html Reported-by: Julien Cristau Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 20ccc66708bcd55372bff03fa0d78a7846e8c82d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Sep 20 21:12:31 2009 +1000 xfree86: silence warning: ‘ramplen’ may be used uninitialized 'ramplen' is only set and used if stuff->size > 0 but the compiler doesn't pick that up. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2df10a49867635c341b1d1a9faadf4dbae043a0f Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:38 2009 -0700 RRDestroyOutputProperty: Free randr property valid values These were leaked when the property was destroyed. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d3a84906c00b8fe4a4e33fa89bff3ed66ceafdec Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:37 2009 -0700 Free randr crtc and output pointer arrays All of the crts and outputs were freed, but not the arrays full of pointers to them. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6086a6065666fb9ded5d99919ddfa51c66b76246 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:36 2009 -0700 xf8CrtcSetModeTransform: free adjusted_mode name too The adjusted mode was freed, but any name allocated for that was leaked. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 088107827347cee05a6e5317bcebdbc282b9a3bc Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:35 2009 -0700 LoaderSortExtensions: free graph nodes Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d5959d37cd36895898786e4ea5bf72c480b79832 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:34 2009 -0700 Free libpciaccess iterator in xf86PciProbe Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ded35b7bf7a5ad27de152476c657a56a4f232800 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:33 2009 -0700 xf86Xinput.c: get DIX event queue pointer once at InitInput time The DIX event queue is allocated before InitInput is called, so fetch the pointer there and not randomly at other times. This avoids failing to fetch the pointer sometimes during server regen and then smashing memory through the stale pointer from the previous server generation. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 54f15a414130f89832b5c2604b0b44e7e4c6709f Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:32 2009 -0700 probe_devices_from_device_sections: don't leak list of devices xf86MatchDevice returned malloc'd storage containing the list of devices to look at; make sure that gets freed. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8b5086250aa5dae8de8b763408ff480d7beac819 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 17 18:14:31 2009 -0700 Eliminate bogus event resizing. Now that all event queues hold internal events only, they never need to be resized. Resizing them led to memory corruption as they would get sized for an appropriate xEvent, not an internal event. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c7987660fd665f32406b14db7078a3f5f7b76e9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 17 15:33:19 2009 +1000 xfree86: fix up wrong use of OptionRec for AutoAddDevices andAutoEnableDevices Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 971d4eac1274db78efa546ea50ca5e01a80bbd81 Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Sat Sep 19 15:48:30 2009 -0400 Xext: include security protocol header instead of client header Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a62664bc07b35aedb6b11b984c94341deb4486ca Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Sat Sep 19 16:01:52 2009 -0400 Bump fixesproto requirement to 4.1 Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2a890d85e923e1da0331b02e58e95f98b11f5de0 Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Sun Sep 20 01:31:59 2009 -0400 fixes: Make sure invisible cursor is inialized with zero src/mask This fixes a regression introduced in 9040dab76182d1a019ca7fef7b29733d2c199e61. Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2bb3f0c87119e73157141431d7c00ab104d4b34b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 18 10:27:14 2009 +1000 xfree86: remove now unused variable Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1888d7d3e3ae81b5cb23e3a0852317362c8e215a Author: Carl Worth <cworth@cworth.org> Date: Fri Sep 18 10:39:19 2009 -0700 configure: Fix broken quoting for initialization of REQUIRED_MODULES A recent change switched to C-style automatic string concatenation, (presumably for better readability and maintainability), but this doesn't actually work for the shell. So we revert to the previously working initialization. This commit reverts one hunk of c947605eda082fbca0821efc0cc14fec8f958fd0 commit 4982bbc3b49b1b61e63a8461ea803e41318c8187 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Sep 18 12:36:11 2009 +0300 xfree86: vgaarb: missing wrapping macro Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit af1af50de621bc451e6413fa5602ae5db2dc9809 Author: Martin-Éric Racine <q-funk@iki.fi> Date: Fri Sep 18 09:33:37 2009 +0300 xserver: added more Geode oddities to xf86AutoConfig.c commit ec0ad408ef8d5a2cf7a2bd65d13de3ef3147308c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 17 16:01:29 2009 +1000 xfree86: use SendDevicePresenceEvents instead of manual event handling. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d0440275108920f5cb5d630f55fc9a3320c496d3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 16 10:58:52 2009 +1000 Require dmxproto 2.2.99.1 This requirement was introduced in code with commit e85775aa64d1e9322c82090a26256af5e1fede0a. Reported-by: Marvin Schmidt Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c947605eda082fbca0821efc0cc14fec8f958fd0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 15 15:05:27 2009 +1000 configure.ac: move all protocol requirements to a single location. Protocol requirements were spread throughout configure.ac, leaving us with a few locations where one DDX asked for a different version of the package than another. For each protocol, define <NAME>PROTO="[<name>proto >= version]" and assemble REQUIRED_MODULES based on these. Future changes to protocol versions need to only be done in a single place. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4d6b20c25af5f590f19530b6c007e3648a8037c3 Author: Shunichi Fuji <palglowr@gmail.com> Date: Wed Sep 16 12:02:00 2009 +1000 dri: use noPanoramiXExtension directly. xf86LoaderCheckSymbol() is never useful if using externed variable directly. noPanoramiXExtension will be just used through dlopen() like other extension modules. Signed-off-by: Shunichi Fuji <palglowr@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3853314d13b503684c9922715323f8033febe5de Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Sep 17 08:11:27 2009 -0700 Fix typo in Xephyr man page Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 2edf967b00963559552d061bb98b15243d978279 Author: Dave Airlie <airlied@redhat.com> Date: Thu Sep 17 15:24:01 2009 +1000 xserver: SIGIO option handling was incorrect. reported by a user on #radeon when DRI1 broke. Signed-off-by: Dave Airlie <airlied@redhat.com> commit 715953bf5c00b4605dd6ab45c92140c0e81174ee Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Sep 15 21:13:00 2009 -0700 Check for -wrap support in the linker Allows unit tests to be built with non-gnu-linkers that also have -wrap support Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e2c64551808988657069006f74c6780973ec0557 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Sep 15 21:13:48 2009 -0700 Add configuration option for use of SIGIO handlers for input events Boolean option to enable/disable SIGIO handlers is set by the first of these found: - UseSIGIO option is set in xorg.conf ServerFlags - Default set at build time by ./configure --enable-use-sigio-by-default - Platform default value: Solaris = no, all others = yes This matches the current settings on all platforms except Solaris. This reverts Solaris (for now) to the settings used in Xorg 1.6, before SIGIO support for Solaris was added, due to some system level bugs that won't be resolved in time for Xorg 1.7 release, but allows us to enable when those are resolved (or when we need to test if they're resolved). See http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6879897 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3bdf36476179257561b9409c3f49a77640fbb9f9 Author: Matthias Hopf <mhopf@suse.de> Date: Wed Sep 16 16:03:46 2009 +0200 Work around sporadic segfault on resume with intel/KMS due to cursor->bits == NULL. Apparently SavedCursor is sometime tried to be set while already being set. commit fe31f9c646bc26163497f29c3b833c090df0b3f9 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Sep 14 19:51:23 2009 -0700 Change xf86dristr.h includes to use xf86driproto.h instead Clears warnings about obsolete headers, but raises minimum required version of xf86driproto to 2.1.0 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 159e03204093991ccd4133133c50c0cae88c828f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 15 11:39:09 2009 +1000 dmx: don't include panoramiXsrv.h if building w/o Xinerama Reported-by: Marvin Schmidt Tested-by: Marvin Schmidt Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f56cbe1ef24415d0142b9a7d0ab0a031069ccb52 Author: Rémi Cardona <remi@gentoo.org> Date: Mon Sep 14 17:09:59 2009 +0200 dix: append "built-ins" to the font path in SetDefaultFontPath 49b93df8a3002db7196aa3fc1fd8dca1c12a55d6 made the hard dependency on a "fixed" font go away but only Xorg could use the built-ins fonts by default. With this commit, all DDXs get "built-ins" appended to their FontPath, not just Xorg. Tested with Xorg, Xvfb and Xnest. Signed-off-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 139368f7ae192b592e24d013e8ca5ce4175effe1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Sep 15 17:53:50 2009 -0700 Fix num_masks/length overflow test for XiSelectEvents Have to set windowid to a valid value first, since that check appears earlier in the code than the masks/length check. Also have to have data[] set large enough so that reading mask data for 0xFFFF masks doesn't overflow past the end of the array into uninitialized data. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 13decf5efe76e735a003227c951e58a41e36a8b5 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Sep 15 13:54:51 2009 -0700 test_convert_XIRawEvent: Don't write more data than the struct holds sizeof(in.valuators.mask) * 8 == 40, but the valuators arrays only holds 36 entries, so the test was smashing the stack when 36 < i < 40 (leading to core dumps on Solaris x86, since the return address was overwritten with an invalid pointer). Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 38a61e9a7cf616e26a79dba815bf67737317d1eb Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Sep 15 13:54:50 2009 -0700 Remove stray semi-colon in protocol-common.c Caused Sun compilers to issue warning: "protocol-common.c", line 141: warning: syntax error: empty declaration Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e320736c457ea7b2f19a4c7c2dfc0c461d0dd405 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Sep 14 19:51:22 2009 -0700 Fix module path in xorg.conf man page Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 49b98d092ec3d032e657eeff62c22fce243b1e8b Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Sep 10 17:52:33 2009 +0300 xfree86: vgaarb: rework wrapping function No semantical changes. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 422cd7a674e6831f40be14ee853bd946cb62eadc Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 14 13:52:53 2009 -0700 XQuartz: pbproxy: Remove debugging XBell() (cherry picked from commit 1fd7c1fd4740393a32e261af33e64c19be48ca9a) commit 663807ce0e65b51537540bb95fbf3c18988c04c7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 14 16:44:52 2009 +1000 xserver 1.6.99.901 (xserver 1.7 RC1) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f450be999268d118b384c04ea070c87ad48c4c59 Author: Soeren Sandmann <sandmann@daimi.au.dk> Date: Fri Sep 11 04:03:06 2009 +0200 Add xoff and yoff to drawable->x and drawable->y in create_bits_picture(). These are 0, except when the drawable is a redirected window. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2b00afec4b5b51851aee4cb0fba7baff3e10ef3f Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Sep 14 15:59:41 2009 +1000 Update xorg.conf man page & sample for changes in Xorg 1.7 AllowMouseOpenFail description changed to reflect actual behaviour and point to AllowEmptyInput for previously described behaviour. Update default DPMS mode timeouts to match new defaults set in April 2009 by commit d52fddefaeb43f15b677eefbea4a288a9948373b Update autoloaded module list to match ModuleDefaults in xf86Config.c Update module subdir list to match stdSubdirs in loadmod.c Add xorg.conf options that were added to the code: - XkbDir option added in February 2009 by commit 76f18b94bd2719a8199334742d021c4d0806187d - DRI2 option added in April 2008 by 35982bc109d424c464551ab22ec90af69908c884 Remove xorg.conf options that were removed from the code: - XkbDisable option was removed in January 2009 by commit 40877c6680863bd6a8475f2bb0c54df55bcf0b0e - PciProbe/Config options were removed in August 2008 by commit fdf7c747a8e1bc59dfb31b7f90dd5eab2687315b - EstimateSizesAggressively was removed in August 2008 by commit cd1e8f26147919227e7624ac4c6b313d972a4d35 - loadable font modules were removed in July 2008 by commit affec10635343668839994ea2bac16c1d4524200 - ModInDev options were removed in December 2008 by commit 6de6ffff35ac03d49fa61de195d4a0605e0ef8bf (Also strips some trailing whitespaces to make git happier.) Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b6f5c54fc61588c638b987bde914b0e5ff9b655e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Sep 14 15:49:01 2009 +1000 xfree86: Change default font path to match configure.ac's --default-font-path. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 23dc4678e9333ba0ee1a5374521905fa3f4f309c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 14 14:14:27 2009 +1000 dmx: use top_builddir, not top_srcdir to get libxfixes.la Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Byeong-ryeol Kim <brofkims@gmail.com> commit 4650e6ebe6e3ea48a026ace60b25daa165580467 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 14 12:00:18 2009 +1000 xkb: drop key presses for already repeating keys. (#23889) The event sequence for continuously pressed keys with the keyboard driver is PRESS - PRESS - PRESS - ... - RELEASE. The first press sets the repeatKey to the keycode and the matching timer. The second press (on the same keycode) can be silently dropped instead of overwriting the timer again. X.Org Bug 23889 <http://bugs.freedesktop.org/show_bug.cgi?id=23889> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit c626a5578aa16c17ef68c1b15ed53828080d9d90 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Sep 13 17:35:51 2009 +1000 xfree86: fix VT_WAITACTIVE control flow (#11477) Move misplaced } to get the flow of if (!ShareVTs) { VT_ACTIVATE VT_WAITACTIVE } X.Org Bug 11477 <http://bugs.freedesktop.org/show_bug.cgi?id=11477> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit d3c66d6b69c04466b8388586090dc48a0aad7684 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 14 08:03:17 2009 +1000 dix: FindChildForEvent needs init child to None. silences compiler warning: events.c: In function 'FixUpEventFromWindow': events.c:2262: warning: 'child' may be used uninitialized in this function Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e85775aa64d1e9322c82090a26256af5e1fede0a Author: Kevin E Martin <kem@redhat.com> Date: Mon Sep 14 08:01:56 2009 +1000 Include <X11/extensions/dmx.h> and remove _DMX_SERVER_ define. Fixes build with newer dmx header files that have been split between dmx.h and dmxext.h. _DMX_SERVER_ is no longer needed with the split headers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 232d43510e0f9f780a9f8eb857366e03acf2fcdc Author: Kevin E Martin <kem@redhat.com> Date: Mon Sep 14 08:00:42 2009 +1000 dmx: Make description match default option. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6389a190faa7c06bdedfd1cc3acb280ebb5cc04a Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sat Sep 12 21:47:51 2009 +0300 shave: use CC tag variable on libtool This fix scratchbox compilation. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dfb106c846c880a06fa5caada92f45576eab7b00 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 18:09:12 2009 +1000 configure: re-enable dmx build (default=auto) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 72607960c136894c4533a54cef7a9be64246f1a3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 9 11:02:22 2009 +1000 dmx: Remove some dead code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 88187ad889ab707fcae3f64890cdb291b567ec23 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 9 11:02:18 2009 +1000 dmx: purge DMX EQ leftovers Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f3aaa46f27f802233e54b3c70ba827e0fcca2605 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 9 09:51:45 2009 +1000 dmx: formatting fix to improve readability Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7a588c833e87dd07f167b9885d5ec43dde271ebe Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 18:14:43 2009 +1000 dmx: Default rules are now base, not xfree86 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 33243ae971db90477a29dfb0e51cc00c95e561bc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 17:04:08 2009 +1000 dmx: include xfixes lib, reshuffle include order to resolve linker errors. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2d46678762b12c9746fc8f89821c15705680ba35 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 17:46:06 2009 +1000 dmx: remove dmx-internal event queue. The EQ is in the DIX now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 545f11139d600febf1c5fd46b11bea4352b82c32 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 17:14:53 2009 +1000 dmx: compiler warning fix (mixed declarations + code) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7d703af74ced36968f4480507a7eb54d249b5edc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 17:13:38 2009 +1000 dmx: get the state from XKB for dmxCheckSpecialKeys Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6e52f9233176986508356f6eee4fce86ba740e71 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 17:10:22 2009 +1000 dmx: fix dmxKeySymToKeyCode to work with mandatory XKB. Approach taken is inefficient, it converts the xkb symbol table to a core symbol table first and then extracts the keycode from there. Consider this a todo for a rainy afternoon when the beer fridge demands emptying. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 61ae0a5ca5de24590f444c405445124404ba9753 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 17:05:12 2009 +1000 dmx: fix up dmxKeyCodeToKeySym for XKB-only. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9caba3e2abceda0a1ff4ad4bf05708f0166c2218 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:12:25 2009 +1000 dmx: fix two calls to InitKeyboardDeviceStruct. Takes RMLVO now instead of the keysyms directly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 29b9a10dad1ca780dc90f4f1f63fd11fd7d1221b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:04:45 2009 +1000 dmx: XkbComponentNamesRec doesn't have a keymap field anymore. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a6f3f6a63ae76afbe01eb9049a63609476d2ed4d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 16:43:04 2009 +1000 dmx: switch lnx-input and usb-input over to xkb-only. kbd*Convert are nearly identical, it just asks for merging. Not today though. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5d81aee5f75e80ae9d3ac7cb32d293ade62d6c5c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:24:02 2009 +1000 dmx: include xkbsrv.h to silence compiler. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4da59f478686fa7e80a3837bf9fa61672c13c50b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 16:30:36 2009 +1000 xkb: split effectiveGroup calculation into separate utility function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8fb3fa28a5a1b36cdaad38055a607400828b9e1c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Sep 11 11:21:26 2009 -0700 compiler.h: include <string.h> before using memmove() Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit d908ee6e549fd8ff653e2c58e9637df347540ef9 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Sep 10 20:56:18 2009 +0300 Revert "Make sys.c use compiler.h unaligned access functions" This reverts commit 1b30545c04a51bfa3ff95a26d64962907a62ff15. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 281ebb453d2f5254e057a24e580dafa9abf82305 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Thu Sep 10 17:52:32 2009 +0300 xfree86: vgaarb: close and cleanup vga arbiter So far there are no apparently issues on not closing the fd. But let's do the right job here. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e62549b8d61cd739adbbd04487d96fe706da1370 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 9 16:03:38 2009 +1000 Xext: don't try to initialize XTEST device properties if they failed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 744cdc897746dca86f5ab9e57be982621c2f0986 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 9 15:05:15 2009 +1000 dix: Remove two _X_EXPORT defines from the function definition. These two are defined _X_EXPORT in their declaration anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9871f9be4e5b184b151ce93458b2578cc8c7b962 Author: Martin-Éric Racine <q-funk@iki.fi> Date: Wed Sep 9 13:43:45 2009 +0300 Use lowercase PCI vendor ID for NSC. commit f4350c66b493d63fa06be87caa958d7033232ea4 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Sep 9 15:48:33 2009 +1000 fbdevhw: Test for graphics:fb%d as well as graphics/fb%d Apparently the kernel can't decide on an API to expose to userspace, so let's just try both in the hope that one will work. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Michel Dänzer <michel@daenzer.net> commit 72f6be540840b46aa4b158b98fac11a6f90dc9d1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 11:13:55 2009 +1000 xfree86: remove now unused xf86CrtcShadowClear Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1f24638985ce053b696ca3359cc50b5bc26ccb03 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 9 09:28:46 2009 +1000 kdrive: output meaningful error message for HAL devices. kdrive ignores all devices from hal as they don't have the 'type' option set. Instead of "Unrecognised device identifier!" print out "Ignoring device from HAL." to indicate that the errors surrounding the device don't really matter. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit ae812bb79668e59cda1f851fb1fabe9db9ea705f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 13:53:26 2009 +1000 Xnest: set the default pointer accel to the host's values (#10013) The defaultPointerControl holds compile-time defaults for pointer acceleration. If an Xnest instance is started, it resets the hosts pointer accel values to these built-in defaults instead of using the host values. This patch queries the host for the values before initializing the device, thus leaving the host values untouched. X.Org Bug 10013 <http://bugs.freedesktop.org/show_bug.cgi?id=10013> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 97e3f4316b1c917f93d324f05d3a4551c1d051a3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 09:55:22 2009 +1000 dix: auto-float SD's with SendCoreEvents "false" AlwaysCore and SendCoreEvents specify whether a device is to send core events. A device that has either disabled is not supposed to send core events. With MPX/XI2, a device that is attached automatically sends core events when the event is routed through the master device. Floating a slave device disables core events by breaking the route. This patch automatically floats devices that have coreEvents disabled in the xorg.conf/HAL. This replicates the behaviour of a SendCoreEvents "false" device in server 1.6 and earlier. The devices may still be reattached to a master at runtime. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 447bd4ce90113037a489ce55d9878523fe5294c7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 7 16:02:50 2009 +1000 kdrive: fix sdl build by removing old keySymsRec references. These are set in kinput now through InitKeyboardDeviceStruct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d8aadfa5af85ce6613289efe119e592aa687ab03 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 7 15:04:33 2009 +1000 dix: remove unused and half-broken code to restore original classes. In theory, the MD should change back to its old, original classes when the last SD is detached. Thanks to the XTEST devices, we'll always have an SD attached until the MD is removed. So let's not worry about that and do nothing instead of having some code that's essentially untested. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e9a507acca01234de189f0f64da63bac32dc13fd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Sep 7 15:59:37 2009 +1000 kdrive: remove xkb member from KdKeyboardInfo Wasn't being used by anyone. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cafa7c5f9017efdc33c348b6a55d80d44df0fe17 Author: Martin-Éric Racine <q-funk@iki.fi> Date: Tue Sep 8 23:52:52 2009 +0300 Added comment with the PCI device ID of Geode SCx200 series. commit d3ad1804a5216487b5837a80f3e53b81212dcf84 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Sep 8 15:25:19 2009 +0200 EXA: Only take special code path for 1x1 fill for pixmaps. It doesn't make sense for windows. Also double-check that the data pointer is valid. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=23461 (not sure that could happen on master even without this, but just in case) commit a9d30f6a038166052a4684308db205bd4e60799e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 8 17:43:24 2009 +1000 dix: GetKeyboardValuatorEvents doesn't recurse anymore - fix comment. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1bdc9ec617d357b076c9e69296018bc212d91c7d Author: Eamon Walsh <efw@eamonwalsh.com> Date: Fri Sep 4 21:49:29 2009 -0400 Fix "warning: left-hand operand of comma expression has no effect" Signed-off-by: Eamon Walsh <efw@eamonwalsh.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9005ec4ce19d704d5055232d2a36acee3247be67 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 11:38:03 2009 +1000 dix: remove dixLookupResource - we don't have any users left. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Acked-by: Aaron Plattner <aplattner@nvidia.com> commit 1e0caf9a2ca983f171976822d9c04bacc14e9af7 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 6 14:02:53 2009 -0700 XQuartz: launchd: Fallback on :0 if prefix:0 gives an error for the socket name (cherry picked from commit 647c871dc9f2d0adc172b401cde89ffbdfcc4d7a) commit 081f72390a25e2244561e238f772f98289a6a581 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 5 14:04:53 2009 -0700 XQuartz: Fix "warning: function declaration isn’t a prototype" noise (cherry picked from commit 9a77905a975e562daa4230739937bbb0b4caf087) commit 7ece2cb220e4fe2c9a8c4c62361522a45adf22c1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 5 14:03:19 2009 -0700 XQuartz: pbproxy: 64bit fixes: Properly process an array of Atoms (cherry picked from commit 1b659cda1af02762a31cc7875e457b08c8dc68b5) commit 1747120043cc5b5d201b7efd06b75ef08b032922 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 5 02:51:09 2009 -0700 XQuartz: Fix a strcpy/strcmp typo (cherry picked from commit 701c24da3ef76a05ccb2d7e84ccfa1b7c5d38e15) commit be37f339a9ed90b9b5e44aeb396ca73347078027 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Sep 4 23:11:13 2009 +0200 EXA: Stop hiding solid or gradient pictures from the driver. Add support for solid pictures in exaTryDriverSolidFill(), but otherwise just pass solid and gradient pictures to the driver Composite hook. While we're at it, clean up the logic to detect Composite operations which are effectively solid fills or copies. This should also fix some false negatives and positives. commit 1f61bbeffdf2ad5a2c54121c75f3b049baf01708 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Sep 4 00:38:58 2009 -0700 XQuartz: Check the DISPLAY environment variable to see if the socket at startup is ours. If not, ignore it and fork/exec startx. (cherry picked from commit 3d5e10cce360a04bf917227615fb9b825675124f) commit 0a361d0e5f896351b98dc9765b4a33c79efa6f02 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Sep 3 19:40:11 2009 -0700 XQuartz: Use --with-launchd-id-prefix for consistency with xinit Also actually honor LAUNCHD_ID_PREFIX and APPLE_APPLICATION_NAME (cherry picked from commit 990038ab006b2f5e03dcef385514ba4e4584bd25) commit e6e83d81ee7366779d600cbb128034e248815339 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 14:51:08 2009 +1000 xserver 1.6.99.900 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc0841b6e87cdd752b44b17ccb021c831a3e02a5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 15:58:36 2009 +1000 shave: hack around the configure ld check for make distcheck. configure calls $(CC) -print-prog-name=ld to get the binary for the linker. The shave script prints " CC \nld" which can't be parsed by configure, resulting in a fatal error. This patch special-cases -print-prog-name and passes it though directly without any additional output. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 58d9a4c6356c98c32be2826410df027ece70d44d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 15:06:45 2009 +1000 xfree86: fix make distcheck after removal of Domain.note and RAC.Notes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8af2793a90e8e644a6a598adce3f752c15b3e37a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 3 11:30:48 2009 +1000 xkb: xkbGetKbdByName on the lastSlave needs to change the master (#21859) If the layout is changed on a master's lastSlave, the master needs to change layout immediately. Otherwise, the master stays on the same layout until the lastSlave changes - which may not happen if only a single keyboard is available. X.Org Bug 21859 <http://bugs.freedesktop.org/show_bug.cgi?id=21859> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 219ae5b628f9ffe2be0876d5911cc04e52bef5f8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 16:38:53 2009 +1000 dix: hide the sequenceNumber key repeat hack behind two functions. Just in case we figure out a better way to do it in the future. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bfb219f532f3c78ba905424365ee7c5f7b5f21a2 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 21 16:03:36 2009 +1000 input: allow for detectable autorepeat. For core and XI1 events, store the key_repeat flag in the sequence number until TryClientEvents. The sequenceNumber is unset until TryClientEvents. [Also thrown in, some random indentation changes. Thanks] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3d988e01e41e98fc5160f825a250522ba274d09f Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 21 15:15:41 2009 +1000 dix: improve code flow in TryClientEvents, better debugging messages. Instead of a massive if (blah && blah), return early where possible. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6fb01c8286c16968fd07e4a5b78da89cd8768d79 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 10:57:33 2009 +1000 require xf86vidmodeproto 2.2.99.1 or newer. commit 2122fedb2c058dc27f9df0e856d2193fabe725e2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 11:37:58 2009 +1000 os: silence bigreqsproto compiler warning Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 59e731ef66095723e74a16b2e5548aed627089ff Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 11:06:37 2009 +1000 xfree86: silence some xf86dgaproto compiler warnings We already require xf86dgaproto > 2.0.99 since 6fffcd582 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ead57a13531aa14033839112fa66e33e142f67da Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 11:03:55 2009 +1000 xfree86: silence 'unused variable' compiler warning Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 21f04f008e6b1ab66a63de3de668b1f261a6928a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Sep 4 11:01:09 2009 +1000 os: don't redefine GNU_SOURCE Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 09f0ee1324b046f2830bdd260f6e2a67ee8f2973 Author: Martin-Éric Racine <q-funk@iki.fi> Date: Fri Sep 4 04:17:09 2009 +0300 Formatted recent Geode PCI ID changes to fit a 80-column coding style. commit a17b50b130fe01c058a74f2696a8b97c756acb49 Author: Martin-Éric Racine <q-funk@iki.fi> Date: Fri Sep 4 03:51:01 2009 +0300 Further explained what the Geode PCI ID is all about as comments. commit afd800dae4f7491baee08509094a30160bb9c849 Author: Martin-Éric Racine <q-funk@iki.fi> Date: Fri Sep 4 03:41:08 2009 +0300 Removed unnecessary curly braces for Geode LX PCI ID. commit 842b7a47d583a7729099de3031ae20977dddf774 Author: Martin-Éric Racine <q-funk@iki.fi> Date: Fri Sep 4 03:25:32 2009 +0300 Updated the PCI Vendor and Device IDs for all Geode variants. In practice, some of the native drivers for older Geode products have become deprecated due to lack of e.g. libpciaccess upgrade, but that's OK, since most distributions don't ship them anymore. In that case, we'll let X server fall back to good old VESA. commit 8e873185f4cbfb2a36e1f43fe7da47fd9fd5aeea Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Sep 3 19:11:02 2009 +0200 EXA: Preserve pPixmap->devPrivate.ptr in exaPixmapIsOffscreen_mixed. Otherwise we may incorrectly clobber it to NULL on repeated PrepareAccess calls. commit 120286aef59dabdb7c9fa762e08457e5cc8ec3a6 Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Sep 3 08:05:59 2009 +0200 glx: Add screen DestroyWindow wrapper to destroy the GLX drawable. Fixes crashes exitting MacSlow's rgba-glx demo. commit f04fe06ae244b851b38be824b1a80f2f8a030591 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 3 14:17:14 2009 +1000 dix: don't return BadMatch from GetProperty (#23562) dixLookupWindow may return BadMatch if the window in question isn't actually a window. In this case, GetProperty needs to return BadWindow - not BadMatch. X.Org Bug 23562 <http://bugs.freedesktop.org/show_bug.cgi?id=23562> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 84eb4c66a4a09c360cef260fb2f35dfb6d8a93c6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 3 10:00:42 2009 +1000 test: add protocol testing for XIWarpPointer. TODO: some way to check src_x/y coordinates would be good. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1b7858e8469aea6d2031039ba41d7191a4b80f28 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 3 10:58:00 2009 +1000 test: expose the default screen to tests, some cleanup work. Provide common #define for invalid window IDs. Init the sprite's hotPhys, provide a common #define for the initial sprite position. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 61a6e1f074d9ff75d61446b946aab6c04019c287 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 3 10:00:00 2009 +1000 Xi: return BadDevice for master kbds and attached slaves in XIWarpPointer Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8939ad2b2aa0385f072d3e1169eaf99289ed737a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Sep 3 09:44:11 2009 +1000 Xi: return error values to client from XIWarpPointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d481720c57f558c47273bf89854fc69254319772 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 2 15:28:28 2009 +1000 Xi: standardise XI2 headers. Adding missing dix-config.h include, adding one missing header guard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 377a5f655ca88cd836da24ab42361df9f3ff51a2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 2 11:16:15 2009 +1000 Xi: if XISetEventMask fails, return this to the client. The only failure point can be a BadAlloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 993ca5acbdccef9e43cd6580e7cc22cfda1a2578 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 2 10:53:40 2009 +1000 dix: when unsetting a cursor, update the sprite immediately (#23608) Removing the device cursor while the cursor was within the window did not update the visible sprite until the next enter/leave event. X.Org Bug 23608 <http://bugs.freedesktop.org/show_bug.cgi?id=23608> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b41db8fe460fc0956922b79261752d1bb104684f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Sep 2 08:57:40 2009 +1000 Xi: fix broken swap code in XISelectEvents request processing. The pointer advanced 12 bytes too short. Rather unfortunate if both the code and the test have the same bug. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 727de7c90de4198222e0dc58d7503b4a1672f642 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 1 16:33:56 2009 +1000 Xi: Unify checking for invalid bits in grab masks. Bits above XI2LASTEVENT are invalid and cause in BadValues. These checks must be performed anywhere where a mask_len parameter is given. This patch also adds the missing checks to grab masks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 59a6d7d478903a8bc9c5d4cc8b2e62e2ad102dba Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 1 16:30:52 2009 +1000 Xi: don't overrun memory for grab masks. A grab mask provided in the request may be larger than the one used in the server. Cut down to size before memcopying. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 83db2b126e8623824e1303e74070375994984599 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 1 15:58:02 2009 +1000 Xi: don't try to set oversized or non-existing masks. Fixes crash if the first XISelectEvents has a zero sized event mask. Fixes crash if the mask provided is larger than others->xi2mask[]. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6fe235d3635aaf995dfa198c60ded1a43fe9dd45 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 1 15:46:34 2009 +1000 test: fix request length calculation, add length tests for XISelectEvents Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7ab1b50c545ae1a62384bedee60168e227bb2a94 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 1 15:27:29 2009 +1000 test: fix build after changing libxf86config.la Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 58c298acc1045927e0d90be73b8dbc8837252589 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Sep 1 15:16:17 2009 +1000 Xi: extra length checking for requests providing masks. masks can be of arbitrary length. If the client did not initialize mask_len, some sort of boundary check is needed to avoid running over memory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0e4dd3b2d28d3dbbfc152d6f5030901ec063a7ae Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 31 09:50:36 2009 +1000 Un-export ApplyPointerMapping. This is an in-server function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a470e8426ee290046a927a17fc969235c4b1e2e7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 2 17:56:52 2009 -0400 Correct outdated e-mail address in "Author" statements. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 17545ed80ee3bb6a058a2748fc7bfb0fc5139fc1 Author: Adam Jackson <ajax@redhat.com> Date: Wed Sep 2 14:40:07 2009 -0400 randr: Fix crtcs using set_mode_major() We'd never mark the crtc as active, meaning (among other things) gamma upload wouldn't work. commit 291408980f33b1e541c89d958535e6fad55fdac9 Author: Dave Airlie <airlied@linux.ie> Date: Wed Sep 2 20:14:30 2009 +1000 vgaarb: protect fini as well just in case commit 8aeadbff0840efc0c9a073e60d6fec0dba313060 Author: Dave Airlie <airlied@linux.ie> Date: Wed Sep 2 19:07:40 2009 +1000 vgaarb: if arb init fails, make sure locking doesn't occur. pointed out by Martin Jansa on irc. Signed-off-by: Dave Airlie <airlied@redhat.com> commit 0e46066efea4e385b2874d4a62a786957e572fe5 Author: Jerome Glisse <jglisse@redhat.com> Date: Tue Sep 1 13:59:47 2009 +0200 Xext: fix a typo for bigreqsproto.h header file Signed-off-by: Jerome Glisse <jglisse@redhat.com> commit c61d8ce1507318476b75b81bf871da19cb1bf747 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Aug 31 17:57:50 2009 -0700 Xext: Require newer versions of xcmiscproto, bigreqsproto, and xf86bigfontproto for new *proto.h header file names bigreqsproto >= 1.1.0 xcmiscproto >= 1.2.0 xf86bigfontproto >= 1.2.0 commit 1c37be80982151a5acd74fe4b960695f604f22ca Author: Michael Witrant <mike@lepton.fr> Date: Tue Sep 1 10:46:50 2009 +1000 XFree86: Linux: Fix 100% CPU usage with ShareVTs and kbd Leave consoleFd open over the course of the server, even though any use of it in this context is likely to be disastrous. Signed-off-by: Michael Witrant <mike@lepton.fr> Reviewed-by: Daniel Stone <daniel@fooishbar.org> commit 65183dc3153232943dff3cfbaacab141e7ed0e9c Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 5 19:53:55 2009 +0300 Input: Mark Xi input events as critical Note that the Xi events are critical and should thus cause a flush to the client when an input event is pending. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit a4e614d301cfa2577de1ee6a15abf023590586d1 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 25 16:46:10 2009 +1000 Xi: Fix harmless ButtonPress/ButtonRelease confusion A missing break meant that ButtonPress would fall through into ButtonRelease, but luckily it appears to have been completely harmless. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 5ef53a94ce4e48e11de26290cd677266308640c8 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 20:23:26 2009 -0400 alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus xf86SlowBCopyToBus and xf86SlowBCopyFromBus cause segfaults on my system. Also remove associated slowbcopy_tobus/slowbcopy_frombus macros. Signed-off-by: Matt Turner <mattst88@gmail.com> commit a8e634b86d47353ef354717904fa66ebe35e1303 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Aug 31 15:53:58 2009 -0700 XQuartz: GLX: Drawable does not contain resize anymore. (cherry picked from commit 1e642f22fbf029bb3917091cb5fa2f78b4a92f62) commit 1b30545c04a51bfa3ff95a26d64962907a62ff15 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 16:16:02 2009 -0400 Make sys.c use compiler.h unaligned access functions Signed-off-by: Matt Turner <mattst88@gmail.com> commit 9522ab9a98e98bc394703038e34b1c12aa39a179 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 16:12:29 2009 -0400 Remove unused Delay.c Signed-off-by: Matt Turner <mattst88@gmail.com> commit 4fac13ff8848bc38654b5567170fbc0d7b2c96d6 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 16:11:59 2009 -0400 Remove unused BUSmemcpy.c BUSmemcpy.c provides xf86BusToMem and xf86MemToBus, which are are memcpy wrappers written to avoid glibc's memcpy on Alpha. glibc'c memcpy on Alpha has improved much since this was written, so it's no longer needed. Neither function is used inside the xserver, and no module on my machine uses either as well. Signed-off-by: Matt Turner <mattst88@gmail.com> commit b65146fc8418b53b7e43dd34cc20000369475671 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 16:11:10 2009 -0400 Remove unused ia64_flush_cache function Signed-off-by: Matt Turner <mattst88@gmail.com> commit f201705e29bdc3309dd611b461ec67740cb706ef Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 16:09:33 2009 -0400 Simplify unaligned access code All architectures should be able to use the same unaligned access code, regardless of whether they need special unaligned access instructions. Let's let gcc do the heavy lifting. In the case that we're not using a gcc-compatible compiler, use memmove. The xserver already requires pixman, so include pixman.h for its uint*_t types. Signed-off-by: Matt Turner <mattst88@gmail.com> commit 3718beb69cc5b4cdb79dd97242fce9231a26a39a Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 16:08:52 2009 -0400 Clean up unaligned access functions on alpha Checks for __GNUC__ are superfluous since the only other compiler for the platform is Compaq C, and it doesn't support GCC style inline assembly. Signed-off-by: Matt Turner <mattst88@gmail.com> commit e1fdd7671346ce374a2b77fe94b8c1a25c0520da Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 16:08:20 2009 -0400 Move unaligned access functions to common section Signed-off-by: Matt Turner <mattst88@gmail.com> commit 628b863bcc6a2a14fd3c0e6c2be4394833cc314c Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 15:53:41 2009 -0400 Remove unused arm_flush_cache function Signed-off-by: Matt Turner <mattst88@gmail.com> commit a544139196ac7f5bc89bc642c6c5c0ea1b0bb60e Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 15:53:19 2009 -0400 Remove unused ppc_flush_icache function Signed-off-by: Matt Turner <mattst88@gmail.com> commit 52aa0495218dc7821a23b045b2c74b2a66e34616 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 15:52:39 2009 -0400 Replace 8 nops with proper sync instruction on mips Cc: Ralf Baechle <ralf@linux-mips.org> Acked-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Matt Turner <mattst88@gmail.com> commit 563fa1c5d762173cd6fb78f9e33cb960ef3153bb Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 15:52:10 2009 -0400 Use sfence and mfence instructions on amd64 Signed-off-by: Matt Turner <mattst88@gmail.com> commit 430c4af0d6e2cad03ca5f49ec6e87f3717d0d9e2 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 15:51:41 2009 -0400 Add x86 barrier macros Signed-off-by: Matt Turner <mattst88@gmail.com> commit 0d87f77a3ff4b22729220b7edcb98c6f06d0787c Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 15:51:05 2009 -0400 define barrier macros as nops if not otherwise defined Signed-off-by: Matt Turner <mattst88@gmail.com> commit 1b43ee13b30d9e3f828e94cdf686d103ce1cac07 Author: Matt Turner <mattst88@gmail.com> Date: Mon Aug 31 15:53:58 2009 -0400 Move memory barrier macros into common section alphabetize by architecture also. Signed-off-by: Matt Turner <mattst88@gmail.com> commit 295e598d9a83ff7162a093810ca9f546d00c0968 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Aug 31 20:04:51 2009 +0300 xfree86: remove _more_ RAC junk Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 38627b2eaf64aa8fe694fc3e1f5e4fee0c9c11c3 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Aug 31 19:36:02 2009 +0300 xfree86: shut up vgaarb warnings when server doesn't support it Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 79182538b43ecd35bf2b47eccfb2dd3bbcdc12eb Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Aug 31 19:25:13 2009 +0300 xfree86: removal of some dead code due VGA arbiter's inclusion Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 6f3cc08ec01609c7efe424ac3e30fe4ff9391007 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Aug 27 16:21:11 2009 -0700 XQuartz: GL: Unset GL_EXT_gpu_program_parameters for Tiger/ppc See http://trac.macports.org/ticket/20638 (cherry picked from commit 0f3a89d306838b3c75a73cd1e9e2928737222b70) commit fdb29ebeed143fa05630966b847b05399a446ddc Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Aug 27 11:04:00 2009 -0700 XQuartz: GL: Explicitly set GL_EXT symbols to 0 if they are not in OpenGL.framework to prevent X11's glext.h from setting them to 1. (cherry picked from commit 7fe37137d826d1b698e87a5b35050dd02f0a4d4b) commit 3be80bd98357cf362aa9a004d1292e5167d83a17 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 28 16:20:59 2009 +1000 Xi: silence compiler warning "type may be used uninitialized" GrabKey and GrabButton are only called from XI/XI2 code. Set type to -1, just in case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 24716b9254fa7d609792596723a192bb044a7d3f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Aug 28 22:52:48 2009 -0400 xace: fix up access modes in dixLookupDrawable calls from dri2. Referencing a screen through a drawable only requires GetAttr access. Treat dri2 drawables as child windows (Add/Remove access). Treat getting buffers as intent to read/write the drawable. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 0f3a64c3a5bce6cf3f00fe42cc7d1d3e69822945 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 27 15:11:12 2009 -0400 Add DRI2 requests to protocol.txt Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 3d17c4f6e1538986fe7b1f17614d76e28f2d1e11 Author: Adam Jackson <ajax@redhat.com> Date: Fri Aug 28 12:12:52 2009 -0400 EDID: Vendor detailed blocks aren't worth X_WARNING about commit 2c1a845521a31f08938b0f8d6e38835ce127c94a Author: Adam Jackson <ajax@redhat.com> Date: Fri Aug 28 12:09:57 2009 -0400 EDID: Print 1152x864 in established timings, not x870 The spec says x870, but we actually use x864 because that's a real DMT mode and x870 isn't. This might or might not be wrong, but we should at least tell the truth. commit 2a806d7fa372e28d039761c9b4087cf812e8e46b Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Aug 28 16:05:04 2009 +0300 os: remove unused -cursor option Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 9040dab76182d1a019ca7fef7b29733d2c199e61 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Aug 28 15:50:50 2009 +0300 xfixes: minor clean ups on createInvisibleCursor() - unused return value - no reason to declare static variable given the function is just called once - no reason to declare different type and cast it after. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 80ed8096f9b8e974b556a6c9f3b600fb71b994c3 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Aug 28 15:33:19 2009 +0300 render: delete unused headers declaration Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit f959b1e5485b93700c7da449a98182f5ce067ca2 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Aug 28 15:30:21 2009 +0300 render: AnimCurInit and AnimCursorCreate shouldn't be _X_EXPORT Pointed by Peter Hutterer on xorg-devel ml. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit e454f106dc65ecfacc154a1fa0810935022a8fee Author: Dave Airlie <airlied@redhat.com> Date: Fri Aug 28 11:39:42 2009 +1000 xf86 ddx: add vga arbiter support. This adds support for using the libpciaccess interface for vga arbitration support on top of a kernel which supports it. Currently patches are queued for kernel 2.6.32 in jbarnes pci tree, and shipping in Fedora kernel. Co-authors: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 6fffcd5825454a7fe58ffbcfb219f007cf38e731 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 27 13:43:15 2009 +1000 xfree86: require xf86dgaproto 2.0.99.1. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2fba2eac0b4c8d07bdf7bea20ef75ff579621728 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 11:23:23 2009 +1000 test: add a few tests for xtest device initialization. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 903c3db1d1685bd855dceed9e7b92890743663e1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 09:48:00 2009 +1000 Xext: rename Xtst* to XTest* This patch corrects a misnaming of XTest-related functions. The extension itself announces itself as XTEST. Xtst is the library name itself, but all library functions are prefixed by XTest. Same with the naming in the server. - Rename all *Xtst* functions to *XTest* for consistency with the library and in-server API. - Rename the "Xtst device" property to "XTEST device" for consistency with the extension naming. - Rename the device naming to "<master device name> XTEST device". The default xtest devices become "Virtual core XTEST pointer" and "Virtual core XTEST keyboard". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8bfd23e144e51401e3756de9260a4811fcc59e91 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 09:38:15 2009 +1000 input: move XTest device initialization into Xext/xtest.c XTest devices are non-optional but nonetheless specific to the XTEST extension. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a95f80fa914678d360f6dfd2b58926193df6ea4a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 09:26:56 2009 +1000 dix: use IsXtstDevice instead of the direct key lookup. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 16b7ebd7d876034edfe8f74562bd06e747879d79 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 14:34:23 2009 +1000 xfree86: Remove xf86GetMotionEvents from public API. This function was used as the default motion event queue API until including XINPUT_ABI 2 (server 1.5). This API was broken with 1883485 in May 2008 (wrong casting of parameters) and isn't in use by input drivers past ABI 3. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit af76bddd7a47092e2f0f85b2547c1cc74eb5cebc Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Aug 9 16:13:32 2009 -0700 XQuartz: Check NSINTEGER_DEFINED to make sure the NSInteger and NSUInteger types are defined. (cherry picked from commit 36e02a8649c0a545084cce5fb2c5717277b9273c) commit 07c935b72fb14cb12f1cb5afbf8cc81f97086bac Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 25 20:11:38 2009 -0700 XQuartz: Use applewmproto 1.4 updated headers. (cherry picked from commit 203df06c0eb2dcd5adfa788a1ba9569650c15f9c) commit 0f613007cd43545eda40825bd74ada3e6e5f36f6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 5 17:43:29 2009 -0700 CheckWindowOptionalNeed: Ensure w->optional is set to avoid SEGFAULT If CheckWindowOptionalNeed is called consecutively (and the first removes optional), then we will SEGFAULT. This can happen in XQuartz because ReparentWindow will call pScreen->ReparentWindow which can DeleteProperty which will CheckWindowOptionalNeed... then ReparentWindow will call it again later indiscriminantly. (cherry picked from commit b608c864ccc59628bd33c033393121b61580460e) commit e7dd1efef408effe52d0bd3d3aa0b5d4ee10ed90 Author: Keith Packard <keithp@keithp.com> Date: Tue Aug 25 18:07:00 2009 -0700 Ensure that rotation updates happen frequently The smart scheduler is designed to minimize scheduler overhead by increasing the interval between WaitForSomething calls when a single client is running. However, the software rotation code depends on its BlockHandler being invoked for screen updates; the long delays caused by the smart scheduler optimizations means that screen updates can be delayed a long time as well. The change is simple -- prevent the smart scheduler from increasing the scheduling interval while any screen is using software rotation. Signed-off-by: Keith Packard <keithp@keithp.com> commit 1740cda7a37abc7d0a169ab4555b446adaa62211 Author: Keith Packard <keithp@keithp.com> Date: Tue Aug 25 16:58:07 2009 -0700 Perform rotation redisplay before calling driver block handler (which may flush rendering) The rotation block handler uses regular driver rendering functions to repaint the screen, if those functions queue commands in the driver, it's important that the driver block handler be invoked after the rotated image is drawn. Signed-off-by: Keith Packard <keithp@keithp.com> commit 4aab05e3b3231f1ec9795a66a075d17a722634a7 Author: Keith Packard <keithp@keithp.com> Date: Tue Aug 25 16:54:16 2009 -0700 xf86_reload_cursors: fix cursor position to eliminate jumping after mode set xf86_reload_cursors restores the cursor to the correct position, but that must adjust for cursor hot spot and frame before calling down to the hardware function, otherwise the cursor jumps to the wrong position until it is repositioned by the user. Signed-off-by: Keith Packard <keithp@keithp.com> commit 0f9ffc887ca1471e98df746253d9300e03e46a15 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 15:10:52 2009 +1000 Xi: fix XIWarpPointer up for FP3232 as input coordinates. requires inputproto 1.9.99.902 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5e96945cf54136afdb80cc17f67611251d59205d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 12:15:54 2009 +1000 Xi: fix swapping for XIWarpPointer and XIChangeCursor requests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 990d204ef8074665763ad129d0b015b7ab3ae9ef Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 09:22:16 2009 +1000 Xext: remove un-used extern of DeviceMotionNotify. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 80f18a73267bd3090e459de609a7006a21e6c649 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 09:21:03 2009 +1000 input: move CorePointer/KeyboardProc declarations into header. The extern declaration in xichangehierarchy.c was broken anyway. This fixes a crash on creating a new master device. Reported-by: Maxim Levitsky Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b96823713129f641ee99306e3cadba8dfe21afa2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 24 09:06:29 2009 +1000 mi: include shmint.h if needed, silence compiler warning. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1b3859a49a3861517c9b34f6e8750f7ae0ff2b5d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 12:29:39 2009 +1000 Xi: add swapping hook for XIGetFocus reply. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fe430d7d3b0a85fbea9e93171423688f76dc9e1e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 12:09:32 2009 +1000 test: add XIQueryPointer protocol tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 285c88018ba4b3819500027c9b6a05b8c27ff2ee Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 11:38:42 2009 +1000 Xi: correct length field for XIQueryPointer reply. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e4ea91a02d6fac9dad844150c5d2fbe7dc9629b1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 12:12:05 2009 +1000 Xi: allow XIQueryPointer requests for master pointers and floating slaves. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8e396f2b806496cdcac233cc731b0322735020c3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 12:11:19 2009 +1000 Xi: fix swapping for XIQueryPointer request/reply handling. buttons_size is necessary as WriteToClient swaps the buttons_len field, resulting in the wrong number of bytes being written later. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f1c856ef9073d9d02bc84ce1472883c8441a9758 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 10:42:15 2009 +1000 test: fake initialization of a sprite trace and window locations Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 58fd28f6b6bebab7f31c54e696f96d64ebb50f5a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 09:44:37 2009 +1000 Xi: return deviceid as error value in XIQueryPointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b41dd4328bfb8a0981d299bb60f986a2bc55fd24 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 21 09:43:46 2009 +1000 record: include recordproto.h, require recordproto 1.13.99.1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 65354e5a698a5b527db09afc431110afba0e14b2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 20 10:52:52 2009 +1000 Xi: return BadDevice for changing device cursors on non-master pointers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ef75301854d41c6b11dd2742fa9d17a5de8a4cfa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 20 10:52:24 2009 +1000 dix: FixUpEventFromWindow mustn't scramble non-device events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c73cd3b265c301b8a54ffe484d6c696f2abefb46 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sun Aug 16 18:07:49 2009 -0700 xfree86: Link libselinux with Xorg system libraries Put the reference to -lselinux in XORG_SYS_LIBS so it isn't added as a make dependency for libxorg.la. Otherwise, make goes looking for a file -lselinux in the current directory, which it obviously won't find. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Justin P. Mattock <justinmattock@gmail.com> commit 9d8fc33cae2fee7777edd20658dbf6a3ffb3d557 Author: Adam Jackson <ajax@redhat.com> Date: Thu Aug 20 16:56:04 2009 -0400 composite: Move screen init before extension registration. Otherwise, you'd still advertise the extension even if no screens actually supported it, and the first Composite protocol request would probably crash. commit ae68708ebe24c4cdf8c5265e206f6913d9298f37 Author: Adam Jackson <ajax@redhat.com> Date: Thu Aug 20 15:45:57 2009 -0400 xfree86: dump /proc/cmdline in the log on Linux commit 0b131a5cd91cea54240777c66a9cd385029e8cb2 Author: Adam Jackson <ajax@redhat.com> Date: Thu Aug 20 15:28:57 2009 -0400 linux: Yet more malloc() avoidance for backtrace() Turns out, there's an initializer at the top of backtrace() that (on some arches) calls dlopen(). dlopen(), unsurprisingly, calls malloc(). So, call backtrace() early in signal handler setup so we can later safely call it from the signal handler itself. commit 792dee3854cbede64e17fdc4736831edad295706 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Aug 19 18:20:54 2009 +0300 xfree86: remove bus state change notification callback No one is using bus notifications now. We hope that the kernel take care of this properly. For other not-so-urgent-notifications (ACPI wakeups, etc) we can just register a handler on server's scheduler (using xf86AddGeneralHandler). And for external applications, the "trend" is to use HAL to kick notifications. So we're already provided of enough notification schemes. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit eb031d4013d36f6aef4aba45840762ae8635cc13 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 19 15:42:34 2009 -0400 linux: hand-roll a backtrace printer instead of using backtrace_symbols Why? Because backtrace_symbols calls malloc, which you can't do from a signal handler. Face? Palm. commit 75b9383d8a4c113ab3c6cfc1d5efcb5d9982a1bf Author: Jesse Adkins <jesse_adkins7@yahoo.com> Date: Tue Aug 18 21:13:40 2009 -0700 xserver doesn't stop all connections to localhost X.Org Bugzilla #23329: http://bugs.freedesktop.org/show_bug.cgi?id=23329 Patch #28648: http://bugs.freedesktop.org/attachment.cgi?id=28648 I noticed in xserver at os/access.c that xorg tries to stop connections to localhost by checking against the address 127.0.0.1. However, RFC 3330 defines the localhost network as 127.0.0.0/8. This means that any IPv4 address that starts with 127 is just another name for localhost. commit 2d34eace13c2016048c627c4e96c3b2399901078 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Aug 18 20:11:23 2009 -0700 Sun bug 6872917: Xorg not querying /dev/fb when no xorg.conf exists commit 48ee5558333bd324463b6994735cabb23de262ec (OpenSolaris VT support) broke the autoconfiguration code in xf86AutoConfig.c that uses the Solaris-specific VIS_GETIDENTIFIER ioctl on a frame buffer device like /dev/fb by changing xf86Info.consoleFd from /dev/fb to a /dev/vt/* device. This fixes it by reworking the code to split the console device (/dev/vt/*, the vtXX CLI option) from the frame buffer device (/dev/fb, -dev option) to allow both VT and autoconfig to work. It also fixes the console device to use /dev/fb when VT's are not supported instead of throwing a Fatal Error because it can't open /dev/vt/0. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit d225230148b3cdab3b32fce3abee26b818d4bab0 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Tue Aug 18 12:15:32 2009 -0700 xfree86/linux: don't change VT perms unless we're running as root In non-setuid root installations, we shouldn't try to adjust VT/tty ownership. It will fail, and shouldn't be necessary anyway (since startup scripts or PAM should be handling perms for us in that case). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> commit 41884b8f4dfe4d931c64a6046adfefcc2b7646c2 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Aug 18 15:47:56 2009 +0300 xfree86: remove unused code (xf86Configure.c) The xorg.conf generator was not assigning correctly the primary device ("bootable") as screen zero. So just skip this kind of routines for now. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 097376266f256e3ae37a16b343ed1e3441a8f003 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Aug 18 13:13:57 2009 +0300 xfree86: remove unaffected code (xf86Configure.c) Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit dd8960a9f37fbef65cb99e058c3772edfda7b6db Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Aug 18 12:53:47 2009 +0300 xfree86: remove stupid macro (xf86Configure.c) It was confusing more instead helping. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 4ec7667bb17839bd4ec11091c75ecfff317fc96c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Aug 18 12:33:35 2009 +0300 xfree86: remove wrong commentary Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 2e8c2b8ae6a092871838b7cceaaf4a7590bce1d3 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Aug 18 12:28:15 2009 +0300 xfree86: header clean up (xf86Configure.c) Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 2df414a33321ae772af1e7e52c36aec222bb3c8f Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Aug 18 12:14:27 2009 +0300 xfree86: reorganize xf86Configure.c No semantical changes. Only code moved around. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 113e66a1ffe2a43c4d1c92a7d78ca43b4db58822 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sun Aug 16 21:02:11 2009 +0300 xfree86: remove unused PCI header Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 6b5978dcf1f7ac3ecc2f22df06f7000f360e2066 Author: Richard Hughes <richard@hughsie.com> Date: Mon Aug 17 09:15:32 2009 +0100 Do not reset lastDeviceEventTime when we do dixSaveScreens When we turn off DPMS with DPMSModeOff and do dixSaveScreens, don't reset the event time else session clients using IDLETIME will be reset. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4098ad72d00e65d142fb9fe8a1194be35338508b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Sun Aug 16 00:06:10 2009 -0400 xace: fix access mode in dixLookupWindow within several RandR calls. Referencing a screen using a window only requires GetAttr access. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit d4b8f7602b5e266a0ebd3b1ba23724362cc7de3a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 10 18:39:04 2009 -0400 xace: fix access mode in dixLookupWindow call within ProcUngrabKey. Referencing a window (as grab-window) only requires GetAttr access. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 6d2f4e487869f10de4a62365b4d6de036c752ab8 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 10 18:36:53 2009 -0400 Add XI2 requests to protocol.txt Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 73975ef3a39ce522c6206ca800ed175fbf851dcf Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 10 18:34:07 2009 -0400 xselinux: Allow per-client device create contexts. The previous behavior was to set the serverClient's value which was used globally. This is in support of XI2, where clients can create device pairs directly. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 66e32d252cffcd4fe7d505f1c211253f23c5002c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 10 18:33:05 2009 -0400 xselinux: Add more new device permissions for XI2. Reflects the ability of clients to create/destroy device objects. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 1f4ea22a20fdd30412a259a87eee133155e1163d Author: Rémi Cardona <remi@gentoo.org> Date: Mon Aug 17 11:33:24 2009 +0200 configure: fix help string after Xnest default build was changed Signed-off-by: Rémi Cardona <remi@gentoo.org> commit 7e37e7c50e4fdcb53296a99d90af3d90081ce9bb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 11 14:39:50 2009 +1000 test: add protocol tests for DeviceChangedEvents Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2851f04cb2f6e5c30267f733d867c86d4e69a485 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 11 16:27:40 2009 +1000 dix: rework DeviceChangedEvents a bit. DCEs are now processed when sent throught the master device, not when sent through the slave device. This includes a removal of some un-used (or partly used) fields in the DCE itself to something more self-explanatory. TODO: if a device has events queued and its attachment is changed, the DCE is silently dropped now. Instead, it should be generated as soon as the first event after the attachment is sent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c1d901d723c3bee523736eacc15b44a7dff484fe Author: Richard Hughes <richard@hughsie.com> Date: Fri Aug 14 11:44:35 2009 +0100 Don't reset the lastDeviceEventTime when doing DPMS actions When we change the DPMS mode, don't play games with the last event time as this breaks applications using IDLETIME to turn the backlight off after a preset time. This patch fixes gnome-power-manager and xfce-power-manager Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dca4de72d375c4b9bcdd25b151e291a77a5b06cc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat Aug 15 20:17:20 2009 +1000 dix: fix potential use of unused variable 'mask'. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 978b65bce14598f2d42ca0177ea58fef71fc12c5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 14 15:05:42 2009 +1000 include: XInputExtensionInit doesn't need to be exported. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3989dc1d34f116f30915632cc5286937392e180a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 11 16:20:20 2009 +1000 dix: use the XI2 defines for class types. Doesn't matter really, they have the same values anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fe045820f1fb33991e8bff5c6e192097caa85727 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 15:34:00 2009 +1000 input: move DeviceChangedEvent conversion into eventconvert.c The version in eventconvert.c was half broken and for some reason we ended up with a second version in exevents.c (which works). Move it over to where it belongs and call EventToXI2 instad of having a custom function for it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 33eb6f70816921abc5da62e434f40e78d672274e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 14 13:49:58 2009 +1000 include: Unexport most symbols from exevents.h. And shuffle them around so that the part used by drivers is up the top and commented. Also, woo, the sdksyms script doesn't like declarations with return type and function name on the same line... Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1373c2ea877b562076a4a3c97e8e4f999c977217 Author: Dave Airlie <airlied@redhat.com> Date: Sat Aug 15 12:14:26 2009 +1000 exa: clarify createpixmap2 new pitch return commit 48ee5558333bd324463b6994735cabb23de262ec Author: Aaron Zang <Aaron.Zang@Sun.COM> Date: Mon Aug 3 23:21:39 2009 -0700 Add new VT support for OpenSolaris & future Solaris releases Signed-off-by: Aaron Zang <Aaron.Zang@Sun.COM> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 613e76ff9055d8ac2b1af1130668180646a9e14c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Aug 3 21:38:51 2009 -0700 Remove support for Solaris x86 releases older than Solaris 8 If you want to run a pre-1999 kernel, you'll need a pre-2009 X server [Some pre-Solaris 8 VT support is left by this patch to allow reuse by the new Solaris VT support that follows in the next patch.] Signed-off-by: Aaron Zang <Aaron.Zang@Sun.COM> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 6c292d17053eb2a7e7054e51210f423dbc0cb7e8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 14 11:48:54 2009 +1000 dix: update the sprite trace for all masters && floating slaves (#23257) When the windows are restructured, CheckMotion needs to be called for all masters and floating slaves to update the spriteTrace. X.Org Bug 23257 <http://bugs.freedesktop.org/show_bug.cgi?id=23257> Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 49046088f10cceaea7da97401d742d3fb59371f5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 14 09:48:45 2009 +1000 config: don't shutdown the libhal ctx if it failed to initialize (#23213) Regression introduced by b1c3dc6ae226db178420e3b5f297b94afc87c94c. Shutting down the libhal_ctx if the init failed may cause an abort. This can happen if hald is not yet running at server startup. X.Org Bug 23213 <http://bugs.freedesktop.org/show_bug.cgi?id=23213> Tested-by: Stefan Dirsch Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1545a120df6dffb5b84fe96c5a992357520b7c8d Author: Dave Airlie <airlied@redhat.com> Date: Tue Aug 11 15:00:36 2009 +1000 exa: fix CreatePixmap2 to be useful for tiling. This adds a pitch return so that the driver can align the pitch to any value it wishes and not just the one it gave to EXA at startup. commit db568f9eabf3450d8a023597ff007df355b13ea8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 13 16:37:00 2009 +1000 Xext: fix up wrong conditions for negative sync transitions. If the counter had a value higher than the trigger value for a negative transition, the trigger value did not get set. The correct sequence of checks is: if (positive transition) if (counter value < trigger value) set up trigger if (negative transition) if (counter value > trigger value) set up trigger Red Hat Bug 501601 <https://bugzilla.redhat.com/show_bug.cgi?id=501601> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a3e50b05747cab92090ae7d7f4475cd61d3fcadf Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Mon Jul 27 20:58:44 2009 +0200 Add 4 missing 10bpc picture formats to the server format list. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit 36e24a6d93bd5aced4e566b80bf2d03555fab9ca Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 13 10:50:26 2009 +1000 Xext: add missing return code check to ProcSyncDestroyAlarm Introduced with 57aff88c7d0761e590806d07bee1c9410680c89f. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ce69a06aff934b2dcded8606cab079ac6465007c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 11 16:16:54 2009 +1000 Xi: fix up broken DeviceChangedEvent swapping code commit b44d34d5fd0d8aaacb89121e8b4afba04f1dcc80 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 15:32:59 2009 +1000 include: correct a copy/paste error in a comment. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c477ac8a151a28ba23f5c87e8f7affd6e82cfaa9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 15:15:02 2009 +1000 dix: re-name internal eventToClassesChanged to eventToDeviceChanged DeviceClassesChangedEvents (where this name comes from) have been replaced with DeviceChangedEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit af38f6790c4c8ba1e70f5c5ba3530ded85d6e372 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 14:08:59 2009 +1000 test: add event conversion tests for XIDeviceEvents commit 3f2e4b9867b6877ee7be32b151fcaf221ef0812f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 14:07:54 2009 +1000 Xi: add event swapping for XIRawEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f3b2f9fb734ecfff6db9ae85b0d247856ede8112 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 13:12:40 2009 +1000 Xi: fix event swapping for XIDeviceEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e46f02fa2de79261221b42ab73f9daa2ce8ac650 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 09:50:16 2009 +1000 Xext: allocate a separate event list for XTest events (#23100) XTest event processing may be interrupted by a SIGIO. If Xtest uses the same event list as the rest of the server, this list may be overwritten in-flight. X.Org Bug 23100 <http://bugs.freedesktop.org/show_bug.cgi?id=23100> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8483b08152104dc619d9e44f877d2687d866355e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 7 16:11:37 2009 +1000 test: add focus and enter conversion testing. Doesn't actually convert anything, but verify the expected behaviour. commit 59dc59a72ffd4cbc4df207bc688c92bb4863e8a9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 7 11:23:33 2009 +1000 test: add XI2 eventconversion test for raw events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 10d7948e0360860e1e9633dca39f646d492e73bf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 7 10:17:14 2009 +1000 test: fix build error introduced by new AllocDevicePair API Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3f161a0aac39fbdeef393a17269486b8dace4672 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 10 14:14:35 2009 +1000 Xi: un-statify XI2EventSwap, it is needed for tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 55e1ea08d03d89ecc0f2db7652a4d15567204696 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 3 16:46:11 2009 +1000 Xi: get device changed data from DeviceChangedEvents, not the device (#23100) If a new device posts an event while the DCE is in the queue, getting the data from the device may result in invalid memory access. X.Org Bug 23100 <http://bugs.freedesktop.org/show_bug.cgi?id=23100> commit 8ce4fde76fdf747fd3e00836c9c9c542e516ae9a Author: Matt Turner <mattst88@gmail.com> Date: Wed Aug 12 14:45:13 2009 -0400 Fix build on Alpha commit a400dbb38f93030d51afe806b4b20d5ef501c855 Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Aug 12 17:48:36 2009 +0100 Xming: Add NET_WM_ICON to native icon conversion fd.o bugzilla #4491 originally from a patch by Joe Krahn <jkrahn@nc.rr.com> Convert a NET_WM_ICON to a native icon by converting to a native bitmap and then using CreateIconIndirect() Don't use icon alpha on Windows 2000 or if display isn't 32-bit, convert alpha channel to a 1-bit transparency mask using a threshold value Fix warning in winScaleXBitmapToWindows() about signedness of *iconData Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 211511f150ce189681aff176c311fa8f312517e9 Author: Soren Sandmann Pedersen <ssp@redhat.com> Date: Tue Aug 11 14:40:42 2009 -0400 Disable the out-of-bounds workaround in pixman. This workaround was necessary for older X servers, but now fb should be using correct coordinates. Also bump pixman requirement to 0.15.20. commit 93d9646c713336e03c135204c061f561d3654e23 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Sat Aug 8 20:18:10 2009 +0300 mi: fix indentation mieq.c looks indented-wise now. Let's see how long it will take to someone mess it again. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit f9a2fff2248d7254958857677cabfea914ed4853 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Aug 5 21:02:29 2009 +0300 mi: fix cursor warping screens The server was processing ET_RawMotion type when the cursor was wrapping to another screen and getting wrong valuator values. This fix such issue considering only ET_Motion, ET_KeyPress, ET_KeyRelease, ET_ButtonPress and ET_ButtonRelease types when the cursor detects a new screen, keeping the "normal" processing of device events. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d573cc46d3106824902ab4f926617bd9959af57c Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Aug 8 11:32:05 2009 +0200 exa: more safety commit 8b652435cd42929e2d187b353b3b20e798569356 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Aug 8 10:35:01 2009 +0200 exa: minor cleanup commit a73f95aa93634cf7ba2c7c9274a046b2df2adca7 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Aug 8 02:31:23 2009 +0200 exa: Fix the broken upload fallback for "mixed" - Replace it with something wfb friendly while i'm at it. commit c029678bf7883b91f3c8095e764abbee246c9bb6 Author: Julien Cristau <jcristau@debian.org> Date: Fri Aug 7 20:42:30 2009 +0200 configure.ac: drop dependency on fontenc Nothing in the server uses this anymore. commit 3943df7f76c1b4930fb7370d9d145cee96dd562b Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Aug 7 20:36:03 2009 +0200 exa: one can never be too careful commit 1548e8ae5d28ed0eb6057a1a19cfc84a78ef34dc Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Aug 7 20:04:53 2009 +0200 exa: fix a potential loophole in "mixed" - Always free sys_ptr before setting the pixmap to pinned. commit e94c7c42ce9d6a194b76ba7e8b3904b180f93a1b Author: Dave Airlie <airlied@redhat.com> Date: Fri Aug 7 13:36:52 2009 +1000 parser: make libxf86config_internal.la not installed. commit 5fb188b547e0ef4e2f2c59b66a3183b004e4a1e9 Author: Dave Airlie <airlied@redhat.com> Date: Fri Aug 7 12:05:51 2009 +1000 ddx: fix xf86Config.a generation We were generating a shared library, but this lib is foobar, the parser requires some symbols from the X server or from the program its being linked into. If the program its being linked into (say a python .so) has symbol visibility enabled then it will fail to dynamic link, also if this .so has symbol visiblity enabled it will fail to dynamic link. Screw it go back to a .a file really unless someone cleans it up properly. Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3047bd067464efb9857960d3fa6324b947faa970 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Aug 5 18:39:47 2009 +0200 exa: delay malloc for "mixed" commit e8ac2ed5dc4c2ac0a5e1e1f371f94c15b1c729dd Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Aug 5 16:12:16 2009 +0200 exa: implement exaMoveInPixmap for "mixed" - This can be used to force creation of driver pixmap. - Not for 1 or 4 bpp. - Driver can still fail (driver) pixmap creation. commit 9d2a7128d3e66b8c076a714d69f84bcad49391b9 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Aug 2 02:35:46 2009 +0200 exa: Use damage to optimise away useless copies. commit 03ecb164f2592c954aa408bf121e0c67b604d854 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Aug 1 19:19:19 2009 +0200 exa: A simple 3rd backend implementation. - Based on driver pixmaps with some changes (completely transparent to driver). - It helps with the problem of known software fallbacks, such as trapezoids. - exaDoMigration is now called for all cases that provide a do_migration hook. - exa_migration.c is renamed to exa_migration_classic.c commit ac7ac913fd98ea359c05c89968ab53a3223615b4 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Jul 22 21:35:41 2009 +0200 exa: Split out some classic and driver allocated pixmap code into seperate files - Create a few seperate functions and a few private function pointers. - Replace a few if conditions with a check for pExaPix->pDamage instead. - This is in preperation of a third scheme that lies somewhere in between. - Code clarity would have suffered (i started working on it and didn't like the mess). commit 3abbd327f4a732408119de1f8e9ecba4812772a5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 5 15:47:46 2009 +1000 dix: detach SD during XI2 grabs only. XI1 grabs on slave devices leave the device attached - just like in earlier versions of XI. Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c29aa7da220661532b05972cacd3dbaff29408b5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 5 15:33:07 2009 +1000 Revert "dix: Remove temporary detachment of slave devices." This reverts commit 0c0ef42292f4c910c73b308cd75d77637312da53. Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 931160fcf378120e58849d801dbc62bed6e65a4b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 4 02:53:17 2009 -0700 XQuartz: AIGLX: Provide empty __glXAquaDrawableResize to avoid crashing in DoMakeCurrent (cherry picked from commit 60a1d2c2764f2f02c0751940a264588717afce79) commit 0fe639a314de397516cf00d8100da8086abdd97a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Aug 1 22:53:45 2009 -0700 XQuartz: Only save lastpt on mouse/tablet events (cherry picked from commit 552be074e5be6492df3e290e8b7d9daff1a2cb34) commit 491c2d74c12d7f9bc9f31b427ece04e049ebff5a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Aug 1 12:43:14 2009 -0700 XQuartz: Use mouseLocation rather than locationInWindow when setting lastpt I don't understand the *why* ... I just see that it works better this way for games like Quake2 through wine. It *should* be better the other way, but somehow it's not. I guess this will go in my list of puzzles to unravel. (cherry picked from commit 65ae2d00e1a53f97f2ff9522406ab69d50bf3199) commit df6c01352471c766e9f71ceac03cab8c3911faa1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Aug 1 02:32:52 2009 -0700 XQuartz: Don't use location delta for tablets since NSEvent does not give a precise delta. (cherry picked from commit 6c5bf756a7f5389cdfe2e43a339d7c31a3e522e9) commit e360104880e6e2e666aa05dfd56e2ef3880f38ef Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 5 16:17:01 2009 -0700 XQuartz: Purge redundant QuartzBell (cherry picked from commit de14a63d20095e1537fd74352850c734d900031d) commit 8c0085c715effdc450d78eec14bc32e6214c78af Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Aug 5 22:50:44 2009 +0300 xfree86: remove more RAC junky Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 444723273ae82fc3f6707ed1a461aaaa8fdae39c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Aug 5 22:48:02 2009 +0300 xfree86: reorganize pci code - xf86PciVideoInfo doesn't need to be global - remove unused macros Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 20169414e1afd5d1d02cb1b57866b1c158b2fc6c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Aug 5 22:44:19 2009 +0300 xfree86: remove unused functions RAC trash. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 95b678e6dc41f2524ada4eb11289687fafce7588 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Aug 3 23:49:56 2009 -0700 Correct modifier map built when ProcSetModifierMapping is called Fixes xmodmap changes to modifiers to stop corrupting modifier maps Previous code had two bugs: - the code to increment mod was after the code to continue if no modifier was set, so mod wouldn't be incremented for modifiers with no keys mapped to them (such as if you called xmodmap -e 'clear Lock') - the value it set in the modifier map was the raw modifier number, not the bitmask value for that modifier Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4ca305956e5ea6f606b22ef62aa462186a7b95f0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 5 09:40:56 2009 +1000 Re-enable Xnest by default. Xnest was disabled in 82fc102568b3d6b0daeb6c5f5b3a1310a7f14fcd due do build errors. These errors have since been fixed. Re-enable Xnest by default to increase coverage by default builds. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5904ef2ccd6056b187ca76f104c21e2d686bfc1d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 5 10:40:20 2009 +1000 xnest: restore xnestUpdateModifierState The meat of xnestUpdateModifierState was ifdef'd out in 6ef46c40e62def4841a4cff4e0b443516a2ed782. This resulted in stuck modifiers when a modifier key release event wasn't sent to Xnest (e.g. Alt-Tab away). See X.Org Bug 3664 <https://bugs.freedesktop.org/show_bug.cgi?id=3664> for the original bug report. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 44afc7577ad3339f4555438388f6a4d8e220c991 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 5 09:51:05 2009 +1000 xnest: include exevents.h for XIGetKnownProperty. Silences compiler warning. Pointer.c: In function ‘xnestPointerProc’: Pointer.c:64: warning: implicit declaration of function ‘XIGetKnownProperty’ Pointer.c:64: warning: nested extern declaration of ‘XIGetKnownProperty’ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 32ce5c83a504d2cafd2b19ed628b40032ef347b3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 5 09:39:47 2009 +1000 xnest: use AllocDevicePair for Xnest device initalization All Xnest needs is a single pointer+keyboard pair. AllocDevicePair sets them up nicely with the name assigned etc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 26b83ad4a29dc180b336a19d9e97589814e93e37 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 5 09:32:50 2009 +1000 dix: require PointerProc and KeyboardProc to be passed into AllocDevicePair. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6a500fdd4d717947b86f6d6844ebf9a8603eb8e2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:29:55 2009 +1000 dmx: include exglobals.h for DeviceKeyPress and friends. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 591c2f8758ef36a9bbf1625f9c207a1804f58ef4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:30:52 2009 +1000 dmx: typecast to InternalEvent* before mieqEnqueue. Silences a few compiler warnings. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 15b425b5a6630d2ac95b490f4f4dbb9240ac9c5d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:31:42 2009 +1000 dmx: move 'state' around to silence compiler warning. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e10f802c8260e034fd6c835d3f2622d9cd5085f8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:40:17 2009 +1000 dmx: include inputstr.h for inputInfo.pointer Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9ffc3f280b3907a672f99101548a5eb52027b37f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:40:31 2009 +1000 dmx: don't call InitKbdFeedbackClassDeviceStruct - doesn't exist anymore. InitKeyboardDeviceStruct does the same task now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 63155cf985ee15bf6aad95066b076ab680cf5a31 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:28:30 2009 +1000 dmx: pass button/axis labels into the init functions (currently unset) Currently only None labels are passed in, in the future these labels should be whatever the respective buttions/axes are. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit af85973a0a80fb0ba82330ae3ec897f65d618003 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:25:06 2009 +1000 dmx: remove now-useless defines. XI is mandatory so we can expect both to be defined. commit 654d7a02600bbafd890f555a081aa0a2fcb5e253 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:23:01 2009 +1000 Revert "dmx: claim we support XI 2." XQueryInputVersion doesn't exist anymore and for now XI 1 support is good enough. This reverts commit 8da8a0fec4b1b9d9208635dedb2f449dc99e0004. commit e7c950c6273ff93f25c091c93d86da6e332a2277 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 15:15:24 2009 +1000 dmx: fix a call to XkbSetRulesDflts, takes XkbRMLVOSet now. commit 2cde9208ff756e33d162e2324f4b99540230d743 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 14:58:25 2009 +1000 dmx: Enable/DisableDevice take a boolean variable now. We want to send events here, so pass in TRUE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1e210d6d10ec63d22247e5801890e024826fc861 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Aug 4 14:41:46 2009 +1000 xkb: remove now-unused XkbGetKeysym. XkbGetKeysyms was only used by the now-removed Keysym grabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a6ce6c70cff5108f0751b662b8e52c83daab0722 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Aug 4 23:23:21 2009 +0200 EXA: Simplify exaGetPixmapFirstPixel using GetImage. commit 842373104d08d47efc863cecbe30431d3faebef1 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Aug 4 23:23:21 2009 +0200 Add support for RENDER BGRA formats. commit 0bf7eaf3052ce24066b0a7c14860b4762fb81364 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Aug 3 23:14:50 2009 -0700 Ansify function arguments in VTsw_noop.c Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 736f2d64725c6df8413e627bd40ce7ecb011acc7 Author: Paul Bender <pebender@gmail.com> Date: Tue Jun 30 15:50:46 2009 -0800 Bug 16832: XDMCP related build error when --disable-xdmcp is used X.Org Bugzilla #16832: http://bugs.freedesktop.org/show_bug.cgi?id=16832 Patch #27279: http://bugs.freedesktop.org/attachment.cgi?id=27279 commit b159a98f7fbdb3f8b337cd1bfd2ff27312856619 Author: Lee Leahu <freedesktop-bugs@dyweni.com> Date: Thu Oct 23 21:03:57 2008 -0500 seg fault when initializing DMX screens X.Org Bugzilla #18086: http://bugs.freedesktop.org/show_bug.cgi?id=18086 Patch #19837: http://bugs.freedesktop.org/attachment.cgi?id=19837 commit 5da9b255a64bec7dbf5ddb392d54dac9be5b43c0 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Aug 3 19:53:27 2009 -0700 Fix blddir != srcdir builds of solaris-*.il files Fixes http://bugs.freedesktop.org/show_bug.cgi?id=17509 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 1e69fd4a60147287b31e53bfc61543fb17bb82c8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 3 12:03:26 2009 +1000 xnest: fix up parameters to InitKeyboardDeviceStruct. IKDS takes a DeviceIntPtr as first argument, and an RMVLO struct as second. The keysyms stuff is long gone now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 008658049cbeea35a9f76f98037aa2f4173f3573 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 3 12:00:45 2009 +1000 xnest: silence compiler warnings by typecasing properly. Events.c: In function ‘xnestQueueKeyEvent’: Events.c:112: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type ../../mi/mi.h:203: note: expected ‘union InternalEvent *’ but argument is of type ‘struct xEvent *’ Events.c: In function ‘xnestCollectEvents’: Events.c:141: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type ../../mi/mi.h:203: note: expected ‘union InternalEvent *’ but argument is of type ‘struct xEvent *’ Events.c:150: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type ../../mi/mi.h:203: note: expected ‘union InternalEvent *’ but argument is of type ‘struct xEvent *’ Events.c:160: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type ../../mi/mi.h:203: note: expected ‘union InternalEvent *’ but argument is of type ‘struct xEvent *’ Events.c:193: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type ../../mi/mi.h:203: note: expected ‘union InternalEvent *’ but argument is of type ‘struct xEvent *’ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 664ac92d8bbe956dd6fd80fac5dc3161028803b2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 31 14:38:35 2009 +1000 xfixes: backup the DisplayCursor/CloseScreen proc before restoring it (#23034) The screen's DisplayCursor func is wrapped as AnimCurDisplayCursor -> CursorDisplayCursor -> miPointerDisplayCursor. Calling CursorDisplayCursor while an animated cursor was currently displayed would remove AnimCurDisplayCursor from the wrap stack. Thus, the next call to ChangeToCursor wouldn't update the animated cursor state. The block handler for animated cursors would then continuously overwrite the actual cursor, leaving an animated cursor everywhere on the screen. X.Org Bug 23034 <http://bugs.freedesktop.org/show_bug.cgi?id=23034> commit f48dfcc1b772a09428e328c72124ea0d46a73416 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 31 10:44:28 2009 +1000 xfixes: allocate CurrentCursor for all devices. XFixes requires cursor notifies to clients when the cursor changes. This should work on the ClientPointer and then on all master pointers. Hence change CurrentCursor to a MAXDEVICES array. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d3e5629fac224d53a972df5e2a87db02534f9b17 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 30 16:36:56 2009 +1000 dix: call SetFocusOut and LeaveWindow when disabling a device. PointerWindows[x] would be set after removing a master pointer. Destroying this window then crashed the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 97ed946cfccec5979c47b5fabf1ad56cc7d33ef4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 30 16:36:30 2009 +1000 dix: SetFocusOut and LeaveWindow don't need parameters other than dev. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d040940efe041b57e6323921c380ceb2bb43f41e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 30 16:16:51 2009 +1000 xfixes: FixesHideCursor should work on all master pointers. Presumably, a client calling HideCursor doesn't want any cursor displayed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b83c682e7ea4e10757eca6363de28281108591a8 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Mon Aug 3 02:46:57 2009 +0300 xf86Xinput: xf86PostButtonEventP must set POINTER_ACCELERATE for relative events. Thanks to Peter Hutterer for spotting this bug. commit ae65daab080c6269f0eadc6be1a48bf27866c542 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jul 31 15:32:07 2009 -0700 XQuartz: Unify how we set our bitmasks for visuals (cherry picked from commit c230b52c27ce50ac6c27011ec8e88f1b263b25f9) commit 4a53fed41d711f270c7d8a7fbeaafb4fb619e879 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jul 31 14:19:50 2009 -0700 XQuartz: Dead code removal for StaticColor visual (cherry picked from commit e457a44e87950207f6c16bf82bf5af11c777ecf1) commit da0a2747803dbecb1308181176a784e14cf02809 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jul 31 14:14:21 2009 -0700 XQuartz: Cleanup the bitmask setting for GLX visuals. (cherry picked from commit d32c3df258e748958ef997c675dc4fae118c0d7b) commit 70ac671af2f092471022590cb7a19ef9155c51b4 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Jul 30 01:30:52 2009 -0700 XQuartz: no DirectColor (cherry picked from commit df2fbc410f2c484612f65a6539a6cb069ef4a468) commit c0c72a866a237d3c2d9e69e1c69181ef5446e3f8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Jul 30 00:51:55 2009 -0700 XQuartz: Define DDXRingBell (cherry picked from commit 113347381289497cb2a79994d0ef5f427ae63ac5) commit 949811313989809f5b58424af04b9fd8e1d0bec4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 30 21:59:40 2009 +1000 test: fix build by including eventstr.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0565f4ed4519962bed40a0bbcf0b409471f4de40 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 16:46:45 2009 +1000 Xi: set the sourceid for focus devices to the device id. Unlike Enter/Leave events generated by a device pushing the pointer around, a device doesn't change focus all by itself. It's a result of a SetInputFocus call, a window becoming unviewable or a grab activating. As such, the sourceid for focus events is always the deviceid itself. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit de4dd5848cab90b0f8b8243ca0b49985ef047124 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 16:45:34 2009 +1000 include: DeviceFocusEvent is not to be exported. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 46ac9f92416f3cb99b5d84a9d200237dc33a3bb7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 16:34:28 2009 +1000 dix: pass the sourceid around for enter/leave events. The sourceid for enter/leave events as a result of pointer motion is the ID of the slave device. The sourceid for those as a result of a grab activating is the device itself. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c299b2228fb63c192b72851c90e14ceaceb67bbc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 16:00:19 2009 +1000 dix: remove obsolete comment, parameter described doesn't exist. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5085ac09a50721d87196bd9f2607dc76200ca399 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 13:45:32 2009 +1000 input: switch internal event types to enums. Use enum EventType instead of ints. This requires a load of default cases in various switch statements to silence compiler warnings. Reported-by: Aaron Plattner Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1ae8332d643299a3ee9a9f45a8e25b8c87c751e1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 13:39:38 2009 +1000 include: fix enum EventType declaration. Having EventType after the enum declares a variable. silly me. Reported-by: Aaron Plattner Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 994f7a1c814a89e90f710dac5bf6b2445fb64712 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 12:11:13 2009 +1000 record: silence some compiler warnings. warning: passing argument 4 of ‘RecordAProtocolElement’ discards qualifiers from pointer target type note: expected ‘pointer’ but argument is of type ‘const void *’ record.c:2745: warning: passing argument 1 of ‘SwapConnSetupInfo’ from incompatible pointer type ../include/swaprep.h:243: note: expected ‘char *’ but argument is of type ‘struct xConnSetup *’ record.c:2745: warning: passing argument 1 of ‘SwapConnSetupInfo’ from incompatible pointer type ../include/swaprep.h:243: note: expected ‘char *’ but argument is of type ‘struct xConnSetup *’ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a863d636293cd7361639c1a8cf9c4f7f15da1e1d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 12:09:34 2009 +1000 Xi: remove FIXME and obsolete include. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fac49df08f173f091cbb77feaf373d7d465358af Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 12:07:22 2009 +1000 Xi: remove obsolete comment. XI1 only uses 7 bits for deviceids, bit 8 is used for the MORE_EVENTS flag on the wire (when DeviceValuator events are required). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 845e65f08059e8f4bfd37356e99b48bba9416c0c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 29 11:54:14 2009 +1000 xkb: move XkbFilterEvents to xkbsrv.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8da0ff2d51086666d10ca7330d428e8610a4a0e3 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Tue Jul 28 08:20:37 2009 +0300 xf86Xinput: Add the xf86Post(Proximity|Button|Key)EventP helper functions. xf86PostKeyboardEvent also makes use of xf86PostKeyEventP to avoid code duplication, and the valuator verification has been split into the XI_VERIFY_VALUATORS macro. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a148d407429c7d13136b3fcafd2d279c5438df73 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 28 16:53:51 2009 +1000 xkb: restore XKB PtrBtn actions. Ifdef'd out since the switch to internal events. PtrBtn actions now work again. Instead of generating the event directly, GPE generates the event and it is then posted through the usual event processing routines (mieqProcessDeviceEvent). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3d3b8babd1a5407082f1a40875ed69f62ba2153f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 28 16:51:14 2009 +1000 mi: update master event copying to InternalEvents. This is long overdue. The device events are InternalEvents now (and only one at a time), diminishing the need for an EventList for the master event. Furthermore, don't make masterEvent a static since this will interfere if mieqProcessDeviceEvent is called from somewhere else (e.g. XKB actions). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f85619b14d130ec54d42cabfaee15e55ced0c665 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 28 16:48:56 2009 +1000 dix: update GetMaximumEventsNum() to real value (3). GPE and friends now use internal events so they may generate up to 3 events. One (optional) DeviceChanged event and one raw event plus a device event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0217d0370c0b0bce66a9c09092eda8e820274e2e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 28 14:54:30 2009 +1000 record: ifdef out RecordExtensionInit and print a warning to the log. The RECORD extension is currently broken. By ifdef'ing out the content of RecordExtensionInit the extension isn't added to the server's internal list and it does not get advertised to the client. Clients can thus fail gracefully with a "extension not supported" instead of waiting forever for events that never arrive. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4e9b2938cd8637a5d3b0a4c9f69d6ee75faab3a0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 27 16:54:33 2009 +1000 include: untangle events.h from the SDK headers. InternalEvents shouldn't be used anywhere outside the X server itself. Split up into events.h for opaque typedefs for the events needed by various headers and eventstr.h for the actual struct definitions. eventstr.h must only be included by code that requires internal events and is not part of the SDK. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fad5f96c01811af7490a071719e4017c019a8d9b Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Jul 29 13:50:48 2009 +0100 Cygwin/X: Only try to build rootless extension if multiwindow extwm mode is being built Rootless extension still needs a bit more work to build successfully for Cygwin/X commit de2ae521abde445daaf025a07aa01563ca5ddd41 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Jul 26 20:48:19 2009 +0100 Xming: Use RegisterClassEx() instead of superseded RegisterClass() RegisterClass is supserseded by RegisterClassEx, so change to using that everywhere Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 764ce6ee683db342264bbca4df6379eb6093fb85 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Jul 28 16:16:57 2009 +0100 Xming: Use GetClassLongPtr() instead of superseded GetClassLong() GetClassLong() is superseded by GetClassLongPtr(), so change to using that commit a85523dc50f392a33a1c00302a0946828bc9249d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jul 28 22:52:33 2009 -0700 XQuartz: Avoid a possible spinlock in applicationWillTerminate (cherry picked from commit f430cda0fdcc1a8fc5f4795743b40f09ff0bd869) commit 1e49c8d340ee8d8b6f90abcc2e2e9c390cbcd622 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jul 28 13:40:15 2009 -0700 XQuartz: Avoid namespace collission for BOOL in Sparkle (cherry picked from commit 227c6e01a641b72158201553273299283cdb5599) commit 442967c90dd9d8483a56bdc9237c49e33d619126 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jul 28 15:02:37 2009 -0700 Remove hardcoded gcc -Wall option from configure.ac Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 52e9ef5664a697a31102e8761eaa03cff01d14d8 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jul 28 19:04:59 2009 +0300 xfree86: remove some RAC junk Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit d57361bb9ac08bec470f76ca8ca602d60c339502 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jul 28 18:55:32 2009 +0300 doc: remove outdated PCI/RAC/Domain notes Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 7b3d05ebd5a55f88098f4a763d1fa7ca110bb780 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jul 28 18:45:16 2009 +0300 xfree86: remove pci debug macros there's no effect when their are enabled. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 6089d9cfde533c6a7aec7dfc08aec9c8f2f18e27 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jul 28 18:29:35 2009 +0300 xfree86: remove RAC/resource doc Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit c553161e17ebc577ecb91ec6c81f0bdd0ae85e13 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jul 24 13:47:31 2009 +0300 xfree86: delete devices probe code (-probe and -probeonly options) Inside a windowing system, it's not the place to probe for devices. Goodbye -probe and -probeonly. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit c09779f95a9772c0556760222dfc570dbaf8a28e Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jul 24 13:37:31 2009 +0300 xfree86: delete stupid video driver dump (-modalias option) Such stupid and ugly way to dump PCI information! Oh boy... Anyway, this doesn't belong to the X server at all. Go away! Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 0524420622df6cbdb3872917906f7b2a6ec02958 Author: Colin Harrison <colin.harrison@virgin.net> Date: Mon Jul 27 15:49:41 2009 +0100 Cygwin/X: use GWLP_WNDPROC, GWLP_USERDATA with Get/SetWindowLongPtr Missed from commit b3751454cbe02ee952bab213e8c3684d429c41b3 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b1c3dc6ae226db178420e3b5f297b94afc87c94c Author: Rémi Cardona <remi@gentoo.org> Date: Mon Jul 27 12:07:51 2009 +0200 config: add HAL error checks This patch simplifies error handling in the HAL code and fixes a segfault if libhal_find_device_by_capability() failed. Fixes http://bugs.gentoo.org/278760 Based on a patch by Martin von Gagern <Martin.vGagern@gmx.net> Signed-off-by: Rémi Cardona <remi@gentoo.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8898203b0d0e9fa03453b2bcd9b88843cccc3230 Author: Dave Airlie <airlied@redhat.com> Date: Tue Jul 28 19:35:37 2009 +1000 sbus: fixup for rac removal commit 4b42448a2388d40f257774fbffdccaea87bd0347 Author: Dave Airlie <airlied@redhat.com> Date: Tue Jul 28 14:47:42 2009 +1000 xserver: remove RAC/resource handling code. This changes the ABI, but since the video ABI is at 6 already it should be fine. driver changes are in the pipeline after this. Signed-off-by: Dave Airlie <airlied@redhat.com> commit 0a168401c401727e49a12cae43a6a387b1f2928d Author: Dave Airlie <airlied@redhat.com> Date: Tue Jul 28 14:19:24 2009 +1000 pci: add support for pci is boot vga call. This allows us to ask the kernel for the boot VGA device instead of nasty guessing. commit b3751454cbe02ee952bab213e8c3684d429c41b3 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Jul 21 16:07:56 2009 +0100 Cygwin/X: Update Get/SetWindowLong() to Get/SetWindowLongPtr() everywhere Get/SetWindowLong() is superseded by Get/SetWindowLongPtr(), so change to using that everywhere it remains Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit c81595e23b48368dafc054f023c1dd16bbad9494 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Jul 26 02:32:17 2009 -0700 XQuartz: Overhaul setting up visuals The main change is cleanup of the visualConfigs and setting up alpha correctly there to match the visuals being added earlier (so the default visual has a corresponding GLX visual) (cherry picked from commit 7351db5c8746be30a4047469ee9b50bc19e62a89) commit 7f28c555b80dda2ed4f518efdb79733647dfea80 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 20:19:05 2009 -0700 XQuartz: Use CopyKeyClass to copy the keymap to the virtual core keyboard. (cherry picked from commit 9a801d1716f005c30be076fcc9ac8dbb3e74d989) commit 1031ac3a7306e7a82169c79c64607696c826c47f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 20:18:38 2009 -0700 Revert "XQuartz: Copy the keyboard map to the core keyboard" This reverts commit 795de791cf18c658421d701af645718493eac51e. commit 48703083a1cf308306f254691d7c2ecda09b3812 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 19:34:17 2009 -0700 XQuartz: Use pDev=NULL for DarwinSendDDXEvent These events aren't really related to physical input devices anyways, so it doesn't make sense to use the pointer. (cherry picked from commit bfe0b9cfa7af4a48dba849cab1eb152c409b4e08) commit b8e0f740829d0c81324aeb59222fc8e3d22493cc Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 20:17:25 2009 -0700 mieq: Protect from pDev=NULL in mieqEnqueue and mieqProcessInputEvents (cherry picked from commit bf60ffb49700da367f7f88983b042a88fef7219b) commit dab8de036808e363a8ec9be826cff7fbcd92b953 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 15:21:12 2009 -0700 XQuartz: Bump the reported version to X11R7.4 (cherry picked from commit c83f701aa75c75433b8745f5d79bca3a7516df91) commit 9e74bb97ab6cb83dd99ec36bd3842197263b8a8c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 10:39:26 2009 -0700 XQuartz: xpr: Added missing include for RootlessHideAllWindows (cherry picked from commit 75e104730810acbb11bf8503bac24ea25243b2ac) commit 09b024db636f5a306c9cec3806fffde9acd3c408 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 15:22:01 2009 -0700 XQuartz: Use the master device in DarwinSendDDXEvent to avoid duplicate events. (cherry picked from commit 6fa62192af937aa9656f64b516050bc099231c7a) commit 795de791cf18c658421d701af645718493eac51e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 25 15:25:06 2009 -0700 XQuartz: Copy the keyboard map to the core keyboard This still doesn't handle the modifier map... gotta figure out what to do now that SwitchCoreKeyboard is gone (cherry picked from commit 427e1aab41dabb54354bfd30f2baae98ac8202c0) commit af8047f7816b39be7015e8cbbe085c57bb354592 Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Jul 17 15:10:46 2009 -0700 Damage: Add devPrivates to DamageRec Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit c80ed4945ef6dd50473fab871211b71b3d20dc3c Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Jul 17 15:10:32 2009 -0700 Damage: Add wrappable hooks for damage create, destroy, register, & unregister. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit fb46474feb69d52d3dfdd61452ced5cfc38f6651 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jul 24 09:16:37 2009 -0700 XQuartz: Rever the "Set can_quit to true during a Sparkle-initiated relaunch." change This was in place to work around the issue that was correctly solved with the previous commit (changing the Windows menu behavior). Reverting this change no longer causes crashing, so it's safe to show the dialog now. (cherry picked from commit 023cef31bbb2ab80a241098d82fcfd35ada75fc0) commit 0d73893a5795d5c1d28fd0287f2f1965f2ff1bda Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Jul 23 20:03:29 2009 -0700 XQuartz: Change handling of Windows menu to workaround a bug triggered by mixing Sparkle and X11 windows <rdar://problem/7088335> NSApplication releases the separator in the Windows menu even though it's an IBOutlet (cherry picked from commit 27ac5135267be9cb221329ae68461117dd43a4bf) commit 171409cecbd848e5fec6334fc61a20e882e80fa9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jul 21 00:22:12 2009 -0700 XQuartz: Set can_quit to true during a Sparkle-initiated relaunch. (cherry picked from commit b2e9a77111d4572402d8ca95e3368db97ba7d598) commit 7ff84d350b44fa40669c1d0d48a715a0bf056ece Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Jul 20 22:38:25 2009 -0700 XQuartz: Added a "Check for X11 Updates..." menu item. (cherry picked from commit 305144bfa4b59791123c44e869fab93a084792d6) commit 1e1dbd1e462f571dad2f9684fcf4cd8ae17eedd5 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Mon Jun 29 11:46:17 2009 +0300 xfree86: "Staticize" functions in xf86AutoConfig.c Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 7c6b5458de9bc7f6cd972a36b56888aaa3d201ee Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jul 23 15:16:44 2009 -0700 Fix dist. * Makefile.am: Include the test/ subdirectory in the dist tarball. * include/Makefile.am: Move events.h to sdk_HEADERS and eventconvert.h to EXTRA_DIST so they're included in the tarball. events.h shouldn't be included in the SDK either, but for now it's needed by input.h. commit 20daa145c437c3ba67970146f6182849f87a1b43 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 23 08:33:00 2009 +1000 mi: fix build error caused by missing xtest.h xtest.h was renamed to xtestconst.h in xextproto. Requires xextproto 7.0.99.3 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 587c3a2d1961834558193e8e14e8e381a077a253 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Jul 22 10:55:46 2009 -0700 Bug #22804: Reject out of bounds XGetImage requests The XGetImage man page states: If the drawable is a window, the window must be viewable, and it must be the case that if there were no inferiors or overlapping windows, the specified rectangle of the window would be fully visible on the screen and wholly contained within the outside edges of the window, or a BadMatch error results. Note that the borders of the window can be included and read with this request. However, the server was only checking the requested region against the screen bounds, allowing XGetImage requests to read pixels outside the bounds of a window's ancestors. Normally, this would just read other pixels from the screen, but if one of the ancestor windows is redirected, the window's backing pixmap may be smaller than the window itself. This change checks the region against the window's bounding drawable, which is either the screen pixmap, a redirected window's backing pixmap, or the root window for servers that don't support GetWindowPixmap. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> commit ecd618957ebf01cb4137f98efec3faed35f8a9f5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 22 15:19:34 2009 +1000 dix: fix null-pointer dereference on activating enter/focus grabs. EventToXI2 returns a NULL event for enter/focus events since these events aren't yet wrapped into internal events. This is a quickfix only, it works thanks to the alignment of internal and XI2 event types. Eventually, enter/leave events should be wrapped into internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 48585bd1e3e98db0f3df1ecc68022510216e00cc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 22 12:09:24 2009 +1000 dix: use the event mask of the grab for TryClientEvents. A client that grabs for button/key events may not have the ButtonPress/KeyPress mask set and should not receive an event in that case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4dc91b3e54503a1be555bae5b18f3e52f58be307 Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Tue Jul 21 17:21:28 2009 +0200 Check if new space was actually allocated before freeing. There will be no new space allocated, if mode != PropModeReplace and len == 0, or if mode is not one of the handled modes. This fixes freeing data that is still in use, leading to double frees and other memory corruption. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9a1bfa5664a80f03cedeb89b9f8a86115a08e7af Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 20 16:39:16 2009 +1000 input: remove XI2 keysym grabs, use keycode grabs instead. Keysym grabs are tricky in the details, keycode grabs are known to work. So for now, provide keycode grabs only. Requires inputproto 1.9.99.15. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit afc3e3b5955ea4a49308399820cc4c499f4312da Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Jul 21 16:14:21 2009 +0100 Cygwin/X: winInitMultiWindowClass() should be static Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 9dc8106ba095474fea1474622b0f0162c8fd5aa4 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jul 21 14:34:47 2009 +0200 randr12: Add compatibility for XF86VidMode gamma ramps. Fixes screensaver fadeout effects. Also make all RandR 1.2 compatibility code for XF86VidMode operate only on the CRTC associated with the compatibility output, not all CRTCs at once. commit 268e227ba06c027f5c56b1aaee5dcc6a2034403f Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jul 21 14:34:13 2009 +0200 EXA: Make Prepare/FinishAccess tracking resilient to repeated / nested calls. Use reference counting and do nothing unless the reference count transitions to/from 0. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=22822 . As a bonus, this avoids calling the driver Prepare/FinishAccess hooks more than once per pixmap and operation. Also update the Doxygen documentation for the PrepareAccess driver hook to better match current reality. commit de7a14ca92f99ff03c8ad204aab5be8203c86a72 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jul 21 12:55:27 2009 +0200 EXA: Fix up some issues introduced by 00fe4a297744c81b40f0243fb56ad848a9be6a2b. * Check all pixmaps involved for damage records, fixes visual corruption due to the screen pixmap never having one. * Fix an array size and remove a now superfluous assignment. commit be4dd35ffecbf49aff13aa9f604a44c9b665ae92 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jul 18 15:51:29 2009 -0700 XQuartz: Initial support for automatic updates through Sparkle (cherry picked from commit c45f1be36426bceeef9af67c26351114f14f5277) commit 2415e2dce918efd49d5e6d71f705255a234a866b Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Jul 20 02:08:31 2009 +0200 EXA: Bail earlier from exaDoPutImage if the driver has no UploadToScreen hook. Also remove dead code associated with access_prepared local variable. commit 00fe4a297744c81b40f0243fb56ad848a9be6a2b Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Jul 20 02:04:40 2009 +0200 EXA: Completely eliminate exaDoMigration calls for drivers that manage pixmaps. commit 7b9915b11ed9eedd0698b4563328504d686ac4ec Author: Gaetan Nadon <memsize@videotron.ca> Date: Sat Jul 18 20:52:20 2009 -0400 dix: xserver "make dist" fails due to eventconvert.h (#27825) This header file is not in the /dix dir, but in the /include dir. The makefile aborted and the xserver distribution files were not created. The fix is to remove this header file from the libdix_la_SOURCES in the dix/Makefile.am. X.Org Bug 27825 <http://bugs.freedesktop.org/show_bug.cgi?id=27825> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a98acb290737ac6b0776f2ea8128a4613c0f778b Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 15 13:56:19 2009 -0400 s/xf86EnableOutputs/xf86CollectEnabledOutputs/ for clarity commit 8fab7f72f2cc4ac5ca415c95ccbd05d3084f10c4 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 15 14:09:08 2009 -0400 randr: Add Option "Primary" to Monitor sections commit 053bb92145045e06f8d72c3bddb75806432faa1c Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 14:29:05 2009 -0400 xfree86: Remove xf86SetPriority GetClocks is pretty doomed to begin with, this really isn't going to make it worse. commit 3637945a45d55385335833197b18703379892884 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 14:10:45 2009 -0400 loader: Remove a useless check. commit ef2bb08c76f0d1eed0c8b3e4937648f0b6ae01e5 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 13:53:00 2009 -0400 loader: remove dead LoaderCheckUnresolved commit 06a2784232b5d0e2440ed365d272abdfa1f5d35f Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 13:40:48 2009 -0400 loader: Remove useless TestFree() macro commit 087745b809b9a834751e5c719b9d87967194369b Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 10:51:53 2009 -0400 fbdevhw: Remove pointless OS check, this never gets built on non-Linux commit 892c93553aa0b03aeb3f4c27d952cc4bb7120aff Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 10:51:27 2009 -0400 fbdevhw: Remove a #if 0 commit e5712f2926abf33b146a4ccfcf6e89c914dad37b Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 10:49:22 2009 -0400 fbdevhw: simplify some #if 1 commit 8868bb4131be25340bf65ec61b998d353965bab6 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 10:44:24 2009 -0400 randr: Un-duplicate the reduced blanking check. commit 453ee39bc6a6b46e6cda11512cfcd431ba32a4b7 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 10:39:37 2009 -0400 xfree86: Fix some misleading comments commit 2c57a7aa07fdf52be315ecb498341776268c1a10 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 10:32:53 2009 -0400 xfree86: Remove some #if 0 This code all lives in xf86Modes.c now anyway commit 1a8c89683ff40cdd1d33da89ab47e7bd240b9bb7 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 10:15:41 2009 -0400 xfree86: Remove TargetRefresh option This was a vestige from the days before we'd make the mode list from the EDID data, and from CRT technology when you could reasonably assume that higher refresh rates were better. Also it did not function as advertised, acting as a high-pass filter instead of a band-pass. commit b4ee3bf700e04ae1b3c4ec021373424ed6e5338f Author: Adam Jackson <ajax@redhat.com> Date: Fri Jul 17 14:57:50 2009 -0400 dbe: Fix indentation commit 0bb9a7e1650180a24246d14493a8168487cf8914 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 9 11:49:41 2009 -0400 displayid: Implement mode decoding. commit 2f1a9c5baa367818bf017bdb72f20a2f6fa7ac21 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 9 10:13:47 2009 -0400 ddc: s/xf86DDCMonitorSet/xf86EdidMonitorSet/ Since we need a second path for DisplayID. commit d0cb4f5a91932e901d10cac5f2a4ba12bb8a0e6f Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 9 10:10:18 2009 -0400 ddc: Refactor root window property code commit 14103b781201bc36896cbe9112a2e0d991fb785d Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 9 10:05:01 2009 -0400 ddc: Don't try to publish a root window property for DisplayID commit c302a5ff49146bff24df196fc36ed38745d42911 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 8 17:42:10 2009 -0400 ddc: Skeleton for xf86DoDisplayID() commit 0b36f68efb1171fcdbe53e93064394f5609b7fb5 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 8 15:36:15 2009 -0400 ddc: mv xf86DDC.c ddc.c commit 8eb82168fc5c7ea958a4f63676738510647dd203 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 8 15:34:42 2009 -0400 ddc: Give DisplayID a place to hang its hat commit ace0fe09aee48d57cd0079260cd8d20d041e8eb6 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 8 14:45:47 2009 -0400 ddc: Yet more code motion commit 3a350688bbe1257feaf1502b4009f5f701d2640e Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 8 14:37:38 2009 -0400 ddc: Code motion to eliminate forward decls commit 8797831f82637b0e65a08e1262d1ec57c075cc12 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 8 14:30:53 2009 -0400 ddc: Update a comment. commit bb6fa39eb3aa044ffc18632288fd59909ff06344 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 16 17:43:31 2009 -0400 dbe: Adapt to new headers commit 9965174f4f09a7de00a9569607e96226208bc2ce Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Thu Jul 16 12:12:48 2009 +0200 Check dev->u.master if there is a custom event handler, too Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c806162c133603a99d9cd844bb04485bb663707d Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Tue Jul 14 13:42:19 2009 +0200 Always update u.lastSlave Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4db8950b1dfc3150ee2e9f1f975e9ecb4eabb1f2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 17 10:40:59 2009 +1000 Xext: include securproto.h instead of securstr.h Reported-by: Byeong-ryeol Kim Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b5f6da1e9b37f52484948185dcf17950657cd65b Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Fri Jul 17 06:34:00 2009 +0300 Revert "Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty:" This reverts commit 7333dc2969f60af0abcfb28e7182a5fff9918223. False positive. commit f517fca31d8c341ad36f3de4863adb0bc5206176 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Jul 16 17:28:56 2009 -0700 XQuartz: Localization updates (cherry picked from commit 4b797fc1edf2bd963410a3133e3d2182ccfda4c3) commit c8a35165147a9b2f747b25da80d0fdb4279a8331 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Jul 16 17:20:16 2009 -0700 XQuartz: Cleanup getGlCapabilities to avoid hardcoding the number of displays (cherry picked from commit 12f7365f1f58d648217b16f09c2152fa47dcd7a1) commit e7bc9ff816c1848c700a376908a1411f1e20d29f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Jul 16 16:59:47 2009 -0700 XQuartz: Allow more than 3 OSX displays (cherry picked from commit 45045eb3968069a8d74ce9188890a5537dc60fec) commit 7333dc2969f60af0abcfb28e7182a5fff9918223 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Thu Jul 16 18:57:49 2009 +0300 Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty: Event alloc_arg: Called allocation function "XIPropToInt" on "ptr" [details] 167 rc = XIPropToInt(val, &nelem, &ptr); Event leaked_storage: Variable "ptr" goes out of scope commit 66eabbebaf1b40fed7670b7c05337ed6226dd81e Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Thu Jul 16 18:50:22 2009 +0300 Coverity Prevent: RESOURCE_LEAK in xf86CrtcSetInitialGamma commit 464e8ad733fa6afee028607d6e7d4663b4c273cc Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Thu Jul 16 17:51:08 2009 +0300 Coverity Prevent: NEGATIVE_RETURNS in fbdev_open_pci: Event var_tested_neg: Variable "fd" tested NEGATIVE At conditional (1): "fd != -1" taking false path 335 if (fd != -1) { Event negative_returns: Tracked variable "fd" was passed to a negative sink. 347 close(fd); commit 53ae6b63387e04324b23b6f8311cc22a154c1fb8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jul 15 23:18:35 2009 -0700 XQuartz: Cleanup keymap locking, fix a possible synchro bug (cherry picked from commit 33e7437a4984ee7c1b04b87d23dee7d4739d5f12) commit 6a90c7b93724a2d26eae70b5806ca06c91e7df4c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 16 09:28:42 2009 +1000 xkb: cosmetic fix, use TRUE instead of True. Rest of InitKeyboardDeviceStruct uses TRUE and FALSE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 52088d3c2d53a91b2690f9cc402f839d77769e37 Author: Éric Piel <eric.piel@trempin-utc.net> Date: Sun Jun 21 18:11:28 2009 +0200 xserver: remove unused code in clipValuators The axes variables was never used, remove it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d3f6b43a240eb763025b3cbf546cb7ae502c94fa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 15 16:51:05 2009 +1000 Update to xextproto 7.0.99.1. xextproto had Xlib client headers moved into libXext. Protocol header files are named fooproto.h, header files with constants foo.h or fooconst.h where foo.h was already in use for client-side headers. commit 693babbf12cc7969c3e211c4037c7af0d41c13e9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 15 12:30:02 2009 +1000 xkb: Remove XKMformat.h include from xkbsrv.h into the files that need it. xkbsrv.h is used by drivers, they don't need the XKM format and shouldn't require it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 35ff5cd26eb7564fefebf238e30b8d43cbb4dc25 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 15 10:29:46 2009 +1000 dix: fix wrong raw valuator copy internal events keep valuator data at the index for the valuator, not like the wire events that start with first_valuator. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 975bf60a82f863e3bdc36fc3f8201b48a4d1e6f7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 15 10:29:19 2009 +1000 dix: use sizeof(FP3232) instead of 2 * sizeof(int32_t). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d040af7fa3c7314917414a28d723bdda3c4289c3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 13 15:09:38 2009 +1000 Update to type-specific raw events - require inputproto 1.9.99.14. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 81b64f668541217c1c9518ac4a7e3fdf0a6e4002 Author: Fredrik Höglund <fredrik@kde.org> Date: Wed Jul 15 00:38:01 2009 +0200 Require renderproto >= 0.11 and pixman-1 >= 0.15.14 for the new blend modes. commit 0ce42adbf4cff9e7f049d9fc79d588ece5936177 Author: Fredrik Höglund <fredrik@kde.org> Date: Wed Jul 15 00:37:05 2009 +0200 Render: Add support for the PDF blend mode operators. commit 686e4867302a741f3029c4105b997d0f0ac7c13c Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Tue Jul 14 17:11:13 2009 +0300 xfree86: remove a bunch of unused pci headers Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit cc575a3ba4a52265e410b325c2291fe900a54f33 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 11:38:46 2009 +1000 test: add tests for ProcXIGetClientPointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 92b0065a19dcde50494d2528e19a4ee76723b3da Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 11:38:00 2009 +1000 test: add ProcXISetClientPointer tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 019bc9d70c5b3beb69ca20b6bca3551e00415992 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 11:37:17 2009 +1000 test: add ProcXIGetSelectedEvents tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8579d39c12b065d8e82fe75af4b254c8ad4f4ab8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 11:36:22 2009 +1000 test: add ProcXISelectEvents tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 60b7a7990003a22be5cc26ebe4d8d2d0803b97de Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 11:33:22 2009 +1000 test: add ProcXIQueryDevice tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 441c91be05912e2665cc1d3ee72fb70dcd32e7a2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 11:32:15 2009 +1000 test: Add ProcXIQueryVersion tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1d635ae65b217e124b3bd5a8844e73f447eb1b79 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 11:30:53 2009 +1000 test: add xi2 directory, prepare for protocol testing. These two files provide a couple of common defines, functions and variables that will be used in a number of protocol tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4b93413b2a490a74de2e27b37268332b609ac872 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 14 11:20:01 2009 +1000 Add test subdir to base Makefile.am If unittests are enabled, make will build those as well - spotting potential build errors in the tests faster. Furthermore, this allows for the tests to be run from the top-level directory. This patch removes the "run make check to build the test suite" message since that'd pop up after every build now. If unittests are disabled, this change has no effect. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e2226f3cd7d1bef598f9657b756a171b02f1a299 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 14:57:04 2009 +1000 dbe: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3e1a054423c22f0e35f25127dde1ea8263892480 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 14:24:45 2009 +1000 record: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 089c460058c4e6814d98d40179eb4c731f37fa80 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 14:22:40 2009 +1000 xkb: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0dc11da57562a7bbb6830ab657a2b818c596a537 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:41:29 2009 +1000 ephyr: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 34bfaa9d9ecd90cfe8413bc275179fdcc193eab3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:29:26 2009 +1000 xfixes: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e216527107fda470b92b7e526f3db22465962a43 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:27:23 2009 +1000 render: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1d6b71b8d0dc24355e84391ba413170a03ccdbf4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:25:39 2009 +1000 os: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 86b239ff9c4d01685c357ca2b1ef761d167e3224 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:24:27 2009 +1000 randr: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7b9e84e320a6f6449fe7bc58a8d6a094ae37b86c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:20:21 2009 +1000 Xext: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit aa19d355125a10b1a385c8f134d68e79d3d609c7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 10 14:25:22 2009 +1000 xwin: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0b4e6af857bcc5513e4c19912a54656d4696e56d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:12:57 2009 +1000 xquartz: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit ad508c93c239a5ba8381000c031e96caf2769265 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:12:20 2009 +1000 xfree86: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c20304226b3ca2f8d0a4f4866480b0d71913941c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:07:00 2009 +1000 glx: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 87ce93c9973067255b4197d82772f83cd4ea5d27 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:06:47 2009 +1000 dmx: switch to byte counting functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dc82e11e509ecf586d77c3e7c1325d515509ce51 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 12:03:34 2009 +1000 exa: switch to byte counting functions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Michel Dänzer <michel@daenzer.net> commit 2d35ea8d957a955e1200ba2b14424bddfe1f4148 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 3 16:50:03 2009 +1000 dix: switch to byte-counting functions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7dd415aa6a3959f15276741db168ba264948ecfe Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 3 13:57:14 2009 +1000 Xi: use byte-counting macros instead of manual calculation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 912402fd71144bcee255141efe12a78abad39240 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 29 13:09:57 2009 +1000 include: introduce byte counting functions. This patch adds the following three functions: bits_to_bytes(bits) - the number of bytes needed to hold 'bits' bytes_to_int32(bytes) - the number of 4-byte units to hold 'bytes' pad_to_int32(bytes) - the closest multiple of 4 equal to or larger than 'bytes'. All three operations are common in protocol processing and currently the server has ((foo + 7)/8 + 3)/4 operations all over the place. A common set of functions reduce the error rate of these (albeit simple) calculations and improve readability of the code. The functions do not check for overflow. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2c535b6f13ffbf2c4ac59834dae39bb8e172c003 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 14 08:58:23 2009 +1000 dix: don't send presence events for attaching/detaching slave devices. The code that didn't list attached slave devices for XI1 clients doesn't exist anymore, so there's no need for these presence events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0c0ef42292f4c910c73b308cd75d77637312da53 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jul 12 21:43:06 2009 +1000 dix: Remove temporary detachment of slave devices. Previously, an active grab on an attached slave device would send the device floating for the duration of the grab. This breaks existing XI applications (e.g. the GIMP) since they grab all devices automatically - resulting in the loss of control over the VCP. The behaviour of extended input devices during a grab in relation to the core pointer is not specified in the XI protocol specification. The removal of the temporary detachment restores the behaviour of extended input devices as present in currently released servers - even if a device is grabbed, an event from this device will result in an event from the core pointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9f1570c8f4f549cdd2fbae1234011290fcc73e18 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 26 09:12:47 2009 +1000 input: include effective modifiers in device events. Require inputproto 1.9.99.13 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 78aedbe609e309446e71835ed15e4557d3ccf723 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Jul 10 17:35:57 2009 -0700 Fix int10 module build after typo in commit 2638e9899 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 35758544813f156eaac28844e693b2a28f6de316 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Jul 10 20:06:02 2009 +0200 EXA: Only pass CT_YXBANDED to RECTS_TO_REGION() if that is really true. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=22642 . commit 2638e9899e57d9b25a2cade3247083a6e101dee2 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jul 10 16:09:08 2009 +0300 configure: introduce --{enable,disable}-int10-module Not all chipsets need to rely on the int10 scheme to do its daily work. Well, the ideal would be to remove all int10 module from the server. I'll try to provide some patches "soon" for this. Something like: http://cgit.freedesktop.org/~vignatti/libx86/ Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com> commit 42d95a38535f382bfb2ddfaef93839ab9bbf584f Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jul 10 15:54:07 2009 +0300 configure: introduce --{enable,disable}-vbe Not all drivers need this kind of access as well. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com> commit 53d64930513fecaa417bb5a922966b45c9ff8679 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jul 10 15:38:51 2009 +0300 configure: introduce --{enable,disable}-vgahw Not all drivers need this kind of access. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com> commit aafcae79d17c1f802bc880d2142af7171fed75d8 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Fri Jul 10 14:56:31 2009 +0300 xfree86: remove unused vbe header file Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com> commit 3711d68f657c77b947cc4670cc4eac4f62de3af8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 10 11:10:30 2009 +1000 Revert "XKB: Sanitise * actions" commits (#19602) Reverts the following four patches: feb757f384382c7782ceac55 "XKB: Sanitise vmods for redirected keys" b5f49382fe48f0a762d9a15f "XKB: Sanitise ctrls action" 1bd7fd195d85681e722161f8 "XKB: Sanitise pointer actions" 61c508fa78aa08ea2666fde9 "XKB: Sanitise vmods in actions" Strictly speaking, the structs used in the server are not part of the client ABI. Practically, they are as we copy from the wire straight into the structs. Changing the struct sizes breaks various wire/server conversions. Even when the structs have the same size, some internal magic causes conversions to fail. Visible by diffing the output files of: setxkbmap -layout de; xkbcomp -xkb :0 busted.xkb setxkbmap -layout de -print | xkbcomp -xkb - correct.xkb Interestingly enough, busted.xkb is the working one although the output is incorrect. Revert the four offending patches until the exact cause of this breakage can be determined. This patch restores functionality to Level3 modifiers. X.Org Bug 19602 <http://bugs.freedesktop.org/show_bug.cgi?id=19602> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 08df24555cb432eb0d90a3f63275e9485e777c4c Author: Soren Sandmann Pedersen <ssp@redhat.com> Date: Thu Jul 9 17:23:04 2009 -0400 Reserve space for two GC values in copy_drawable(). Pointed out by Pierre Willenbrock. commit 3c53f3241319d96affad2f4539f7661e02e80521 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 9 17:21:07 2009 -0400 Since font modules are dead, don't mention them in xorg-server.pc commit e812103382a7bc3f7ba8b2f44ab97960dec265a9 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 9 10:58:17 2009 -0400 config: drop i810. The driver assuredly no longer builds against 1.7. Please don't feel compelled to fix it. commit 55ac155d42268009eaecbc183329a8744d6ae48c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jul 7 16:59:39 2009 -0700 Xephyr & Xserver man page fixes Xephyr(1): Fix quote formatting, add missing ' to contraction Xserver(1): Add Xephyr(1) & startx(1) to SEE ALSO section Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 36dc66ae79b6e1cbe0a23587e32aebb68365b0d0 Author: Michael Lorenz <macallan@netbsd.org> Date: Tue Jul 7 20:21:39 2009 -0400 The way XaceHook() mixes struct initializers and va_arg() is not portable and gives bogus data on sparc and probably others leading to a crash. Fix: Don't use initializers, instead set each member directly to enforce order. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 48a9d65b88f56d1f8ab3bf824a4fe48c2f68725f Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Jul 5 16:06:32 2009 +0100 Cygwin/X: Window positioning improvements for multiwindow mode A few tweaks to winUpdateWindowPosition(): * Don't allow window decoration to disappear off to top or left edge of the display as a result of adjustments to add decoration for the window style * Honour the position requested by window geometry for the client area (so windows which save their position don't get moved by the decoration width every time they are created) (unless we need to bump it away from top or left edges) * Fix an issue with initial window placement being offscreen on multimonitor systems when some monitors have negative coordinates (are to the left of or above the primary monitor) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 5aec72745232dd61e60cfbf3acc4628d4fcd0315 Author: Keith Packard <keithp@keithp.com> Date: Mon Jul 6 11:53:02 2009 -0700 Remove old DRI2 buffer alloc/free interfaces These old interfaces are no longer supported by the server, removing them requires bumping the video driver ABI. Note that this is not guaranteed to be the last change in ABI version 6. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net> commit 2e2c5b216cc1c7a9bc26bd2c68226aaed5fc52ca Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 1 14:01:57 2009 -0700 dri2: Preserve compatibility with 1.6 DRI2 API/ABI The old DRI2 buffer allocation API wasn't great, but there's no reason to make the server stop working with those drivers. This patch has the X server adapting to the API provided by the driver, using the new API where available and falling back to the old API as necessary. A warning will be placed in the log file when the old API is in use. Signed-off-by: Keith Packard <keithp@keithp.com> commit 7c7f0c2c6a04f7044d5ce69e97a615735e5831f1 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Fri Jul 3 14:36:54 2009 -0400 Use IncludeInferiors when copying windows before compositing. Part of bug 22484. commit 43ee8d2ead862f84a4526a472519663ef27a8d6a Author: Matthias Hopf <mhopf@suse.de> Date: Wed Jun 24 18:26:23 2009 +0200 Unclaim PCI slot if driver probing fails. Otherwise no subsequent driver will be able to claim this pci slot. Example for this: fbdev tries to claim, but framebuffer device is not available. Later on VESA cannot claim the device. commit 73abdc94c3cceadeda26a9b6bd3cdfecf0df8db2 Author: RALOVICH, Kristóf <tade60@freemail.hu> Date: Sun Jul 5 16:42:54 2009 +0200 glx: damage is only used with DRI Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 7208a0f032d487bd3bc9809800f4557f1da1e2db Author: RALOVICH, Kristóf <tade60@freemail.hu> Date: Mon Jun 29 15:18:56 2009 +0200 glx: remove Xgl leftover GlxSetRenderTables was only used by the long gone Xgl. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> commit 89cf81cd85919e3dbb5adff5e6c6056c7990b60f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 3 10:29:40 2009 +1000 Xext: return BadValue for XTestFakeInput on unsupported capabilities. Calling XTestFakeDevice*Event on a device that doesn't allow the matching event returns BadValue. Reported-by: Florian Echtler Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b773b4e8e0087993406d1d8c2df895db4d6301ff Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 6 11:04:47 2009 +1000 s/MAX_DEVICES/MAXDEVICES/ updates. The number of input devices is MAXDEVICES, not MAX_DEVICES (f781a752e6) Two comments updated to refer to MAXDEVICES. MAX_FUNCS in sigio.c was set to 16 if MAX_DEVICES was undefined. If more than 15 physical input devices were present, this could result in a failure to install the SIGIO handler for any device above 15. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 183c075d2f9d5f6effa1ce7ab135fb0c2e46085a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 3 13:26:48 2009 +1000 dix: always init the full button map to default values (#22594) Master devices must have the standard button map applied for all buttons to ensure buttons larger than 7 (the default for MDs) are mapped appropriately. We can't copy the button map from SDs to MDs since that breaks the chained button mapping. However, by ensuring all buttons (even non-existing ones) are mapped, devices that send such buttons continue to work. X.Org Bug 22594 <http://bugs.freedesktop.org/show_bug.cgi?id=22594> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 744bb559826ede37a77e9000b6c620eaa6a3c837 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 3 13:58:38 2009 +1000 Xext: remove unused variable 'it'. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fd4eed69e40cf090aa16e79a8596eb1442461829 Author: Eric Anholt <eric@anholt.net> Date: Thu Jul 2 15:24:54 2009 -0700 dri2: Enable GLX_SGI_make_current_read when the DRI driver supports it. This matches idr's 82f150d73cc9a7d8eaf7241a51b03af05bcec159 for DRI1. commit d6b8205e699c0c62af76c4a9cbff1402337927b3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jul 3 19:25:33 2009 -0700 XQuartz: ProcAppleWMAttachTransient to play nice with the new Dock in SL (cherry picked from commit ddc0242d8f291d0f961ba9aa8c883e39861ce2ad) commit a49ae50370ec94e08e7dec3c742d33e20e79ef36 Author: Colin Harrison <colin.harrison@virgin.net> Date: Mon Jun 29 22:55:52 2009 +0100 Xming: Apply window style hints in -multiwindow mode Remove frames from 'dock' windows and make them topmost in -multiwindow mode. Remove frames from windows with MOTIF_WM_HINTS of no decorations in -multiwindow mode. Apply some _NET_WM_STATE hints in -multiwindow mode. Apply window styles overrides from .rc file Correctly update region of shaped windows when applying styles Copyright (C) Colin Harrison 2005-2009 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ commit 17e67c407d130c325d3899c18d68b8eef6a88bea Author: Joe Krahn <jkrahn@nc.rr.com> Date: Wed Jun 24 23:32:09 2009 +0100 Cygwin/X: Change to a single native window class for all X windows from fd.o Bugzilla #4491: There is no point in having one class for every window, aside from trying to set custom icons via the class, which we no longer do, so converted to using a single class for all client windows. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 2c69deb92e11542f615df0f24fdc03e3b4415475 Author: Rémi Cardona <remi@gentoo.org> Date: Fri Jul 3 10:51:50 2009 +0200 configure: libXinerama isn't needed anymore since libXinerama commit 90d4d23bf2e94721149ddc0a80093b10a82e8845 and xineramaproto commit 21477147613c28c968b5e1eb9d8aea7017dd399d, the server no longer needs libXinerama. Signed-off-by: Rémi Cardona <remi@gentoo.org> commit 97e29ffb5bf04a9d8280f1fa32ceced148503492 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 3 09:52:04 2009 +1000 xfree86: fix wrong IsMaster() check causing crashes. Crashes caused by dereferencing NULL if the path was executed for a floating slave device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 50a2a8dc76645d8736f7d712f0ef05f23089407e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 3 09:18:57 2009 +1000 Fix IsXtstDevice - returns false positives since 0814f511d5. Missing check for the value of 'mid' returned false positives if master was NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3525d140567e0ad5f0184e4b37893c47239e1628 Author: Felix Kuehling <felix.kuehling@amd.com> Date: Tue Jun 30 20:07:30 2009 -0400 Export symbols needed by the RandR implementation in fglrx GIT change http://cgit.freedesktop.org/xorg/xserver/commit/?id=45c8bd0fe54273039fdaa1eeeafb81b5774f2c75 changed the default symbol visibility of the Xserver. As a result 2 symbols that are needed by the RandR 1.2/1.3 implementation in the fglrx driver are no longer visible: xf86configptr xf86CursorScreenKey We would like to get these two symbols _X_EXPORT'ed before Xserver 1.7 is released. Otherwise it will be problematic for fglrx to support RandR 1.3 on Xserver 1.7. In the future, we may want to sync our RandR implementation to later versions of the RandR implementation in hw/xfree86/modes. Therefore it would be nice if all symbols used by the Xserver RandR implementation were _X_EXPORT'ed in the future. commit e13605ea40cfc671314a0086c75b917564298b55 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 23 14:09:22 2009 +1000 dix: introduce "Xtst Device" label property. Xtst devices get this property assigned automatically so they can be detected easily by a client. The property is read-only. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0814f511d56a89c7b1868b17eba7a89f990b9ab1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 23 10:50:52 2009 +1000 input: store the master device's ID in the devPrivate for XTest devices. Rather than storing a simple boolean in the devPrivate for XTest devices, store the actual master device's id (since it is constant for the life of the device anyway). Callers should use GetXtstDevice now instead of digging around in the devPrivates themselves. This patch allows for a cleanup in the creation of new master devices since GetMaster and GetXtstDevice spare the need for loops, IsPointer checks and similar. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> commit 1bcc0d3c244ce7d9f5cbab626aa5fd5784b41a1c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 22 16:55:12 2009 +1000 input: abstract Xtst device lookup The callers should need to use the dev privates key to look up xtest devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> commit 34424fab9abd7a4ca11036be25414129980db0e0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 23 11:50:29 2009 +1000 dix: set the client's error value to the bad deviceid in check_butmap_change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit da04e8f1354fa9d253443489dc002b16f94d6fab Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Jun 30 17:52:42 2009 -0400 dix/property.c: use memcpy where appropriate. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 65d74d93145d22b68bad5728a7ebe38dc662cb21 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed May 20 21:32:54 2009 +0100 Cygwin/X: Fix multiwindow extwm mode to build again Build and link with rootless extension Update Xwin code for removal of RootlessAccelInit() Fix Xwin code which now has a collision with the type name EventType Based on patches from Colin Harrison, Jon Turney and Yaakov Selkowitz Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 638ca9a7a2363757dc5b5d456e10d34f6f158885 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon May 18 18:14:41 2009 +0100 Cygwin/X: Avoid a visual glitch on window move in rootless modes Handle and ignore WM_ERASEBKGND since we repaint the entire invalidated region anyhow (this avoids a white flickering on window resize) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b718b2e0880cf2b969675da98d5ef8a4a01ca5d6 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon May 18 18:14:09 2009 +0100 Cygwin/X: Allow pointer warping to work in rootless modes Mouse pointer warping in multiwindow/rootless mode was never implemented, due to concerns that moving the mouse pointer without asking might be rude This patch allows X applications to move the mouse pointer in rootless modes, Let's hope they don't abuse this privilege ;-) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 85614946ba3d5a233eece612afc7f09572a347c2 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon May 18 18:13:08 2009 +0100 Cygwin/X: Improve mouse tracking for moving/resizing undecorated windows In -multiwindow mode, tell Windows we wish to capture the mouse when a button is down. This causes Windows to continue to send movement events for the mouse even if the mouse pointer moves outside the window frame. This helps greatly with undecorated windows which have regions you can grab to move (e.g. gmplayer, xine control panels) or resize (e.g. Songbird) the window, as it means the window continues to receive the mouse motion even if the mouse pointer moves out of the window (which presumably happens if we don't manage to update the window fast enough to track the mouse pointer) Consolidate the multiple instances of the code to start the mouse position polling timer into a new function winStartMousePolling(), and use that to restart the polling timer when we release the mouse. Also, start the timer on WM_SHOW, so that xeyes will track the mouse position when it is first shown, even if the mouse doesn't enter it's window (You probably need focus-stealing turned off to see this problem) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit f351c10a9774cc0ea2cbb58f00f07ece7f7c6e73 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Mon Jan 5 16:17:30 2009 +0000 Cygwin/X: Man page fixes Correct path names in man pages, using cpprules.in Install XWinrc man page into section 5 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 5c1afac5eea1d8327c74342d12d082b75f0cebde Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 29 11:16:16 2009 -0400 EDID: Fix timing class names to match the spec commit bf0f3b8f2bc830c8bd6f8f9410b89394b8d96257 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 29 13:31:02 2009 +1000 test: fix build error introduced by XINPUT_ABI 7 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cbeb6a73c44143674a700d36a7e9804d41003a4f Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Sat Jun 20 20:17:41 2009 -0400 dix: report subpixel coordinates for high-resolution devices Acked-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 069b4c5f0a38649de73d1e0f70ee81bf862399dd Author: Simon Thum <simon.thum@gmx.de> Date: Sat Jun 20 18:57:22 2009 +0200 dix: make part of ptrveloc.h internal Though this is a SDK header, some functions are intended solely for the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2830e8493757e0da1253fe5ab280562b84730e77 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jun 24 11:33:19 2009 +0200 dix: rename pDev->dev, pVel->vel for consistency Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 373e8c960d00e2b8c2250dd3f66859b081e14854 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jun 24 11:16:24 2009 +0200 dix: improve pointer acceleration API This makes the ptr accel api actually sensible from a driver perspective, since it avoids superfluous device lookups. Also, makes independent accel contexts possible. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b8050bb6deebdb1ee60731f63884ffca575c09ce Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jun 27 15:28:34 2009 -0700 XQuartz: Don't leave zombied processes at startup (cherry picked from commit 40c1406830588fa85d880e9f4e9ca570db1db306) commit aaff92c8c22a47804a21010d023ef76d82e7ec7e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jun 27 14:40:03 2009 -0700 XQuartz: 64bit fix for screen origin in AppleWM (cherry picked from commit 60a757d2802a5c34acd91ca9a052937b5a169ede) commit cabcc1a7ad697dde915794ddcea6a300f66b0a28 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jun 27 10:40:59 2009 -0700 XQuartz: More localization updates (cherry picked from commit 5925c1f48ad05bf94195b986c1fdefc52a20ae42) commit 31166c2ae0ce898c96995a8b16b58b127dc85a2f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 26 16:51:22 2009 -0400 xace: add a new hook for checking property content after it has been set. Allows security modules to enforce what property contents can be set by clients. Uses the new DixPostAccess bit to distinguish between the existing call made during the lookup (with the old property data) and this new call. Note that this only applies to writes, prepends, or appends to existing properties; for new properties the existing DixCreateAccess hook call may be used since it includes the new data. Refer to the XACE-Spec document in xorg-docs, section "Property Access." Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 51105de9b0d865c4b5e5a7d9ab23c89d808d1cfa Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 26 16:50:12 2009 -0400 xselinux: ignore property hook calls with the new Post access mode bit set. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 10812204b3415c969bcebd3215e84d758a0b4dd8 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 26 16:48:24 2009 -0400 dix: add a new DixAccess bit, "DixPostAccess". This will be used for follow-up checks after a client has written something, for security modules that enforce a set of valid values a client can set. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 9480725af0275b72b24b9e1cb3b68d5b97288d01 Author: Rémi Cardona <remi@gentoo.org> Date: Wed Jun 24 10:12:50 2009 +0200 xfree86: DIST_SUBDIRS should not contain variables This patch reverts a change done in commit 800d4ceb946c93724661ebfd28afb658ca63b6b1 to add conditional XAA support Signed-off-by: Rémi Cardona <remi@gentoo.org> commit 84662e40c3d4141ebb298a1ad714f75056a4ab74 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 18 23:19:21 2009 -0400 Xi: check for GetAttr permission when listing or querying devices. If the check fails, leave the device off the returned list of info structures. Under XI2, this may cause inconsistent views of the device topology after a change (for example, devices disappearing from view, or showing as attached to a master that cannot be seen). More work is needed to deal with topology changes and device relabeling. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 00bc8d34c68dab6c818cd1c7e03e9992d1d0cbfc Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 18 21:41:17 2009 -0400 Xi: check for Use permission on the device in SetClientPointer(). Presumably, some intelligent, XI2-aware management app will be calling XISetClientPointer on behalf of other clients; this check makes sure the target client has permission on the device. Requires changing the prototype to return status code instead of Bool. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 119b96667778391436998c76a68bf64e746c9e08 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 18 21:02:28 2009 -0400 Xi: fix up access modes for calls to dixLookupDevice(). New access modes are being passed to the device access hook for XI2: DixCreateAccess for creating a new master device; DixAdd/RemoveAccess for attaching/removing slave devices to a master; and DixListProp/GetProp/SetPropAccess for device properties. Refer to the XACE-Spec document in xorg-docs, section "Device Access." Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 07c36e4fdcd93df3d33bdab6cca4780ebc9c1f54 Author: Dave Airlie <airlied@redhat.com> Date: Wed Jun 10 13:33:47 2009 +1000 dix/resource: fix use after free in resource code with DRI LookupClientResourceComplex is used by DRI1 code to find and free a DRI drawable in a callback, however when the DRI code returns this->value is now pointing at freed memory. It seemed easiest to store the value to a temporary and return it afterwards. Another option might be a new FreeClientResourceComplex or one that also returns the id, so we can free it using an alternative means. found using valgrind. amended along ajax's suggestions commit 184deb9bc325eb7aa7eb7b7d4f98aa917f0269cb Author: Dave Airlie <airlied@redhat.com> Date: Wed Jun 24 10:40:05 2009 +1000 GLX: make function static. This function isn't called from anywhere else and I don't think it shuold be. commit 9d85b56078ec05da1369ca22930d8eb214c389db Author: Dave Airlie <airlied@redhat.com> Date: Wed Jun 24 10:38:49 2009 +1000 GLX: note the implicit flushes with ReadPixels in indirect contexts. This just notes the flush has occured when readpixels returns, and fixes the glean test. commit e341512bfa40dd98853a20596dc65dcac4dcaa37 Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Sat Jun 20 21:37:59 2009 -0400 dix: update a comment Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5cbd4d3d6e54d202ecdbb527b57aaefeb8435600 Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Sat Jun 20 20:17:04 2009 -0400 dix: do away with an instance of temporary in-place modification Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 94cdc1ef0a72802573a11ba292e2f5cc8474aa8e Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Mon Jun 22 13:00:37 2009 -0400 dix: deal with first_valuator > 0 correctly if POINTER_SCREEN is set Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 21cbb4c9de44e2629dc0fa6f647ce2d139f2cef0 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Wed Jun 24 00:24:44 2009 +0300 xorg-server.h.in: Export the X Access Control Extension (XACE), too. Acked-by: Daniel Stone <daniel@fooishbar.org> commit 800d4ceb946c93724661ebfd28afb658ca63b6b1 Author: Tiago Vignatti <tiago.vignatti@nokia.com> Date: Wed Jun 24 00:13:32 2009 +0300 configure: Provide the --enable/disable-xaa option. Acked-by: Daniel Stone <daniel@fooishbar.org> commit ce3d539ac6ecab3e343cef7c4dc112bc82ea3b02 Author: Oliver McFadden <oliver.mcfadden@nokia.com> Date: Wed Jun 24 00:08:51 2009 +0300 xf86Config: Avoid attempting to load non-compiled modules. Acked-by: Daniel Stone <daniel@fooishbar.org> commit 33e25143361d63ea776dfafeeb6d4ffb2f6fd8d4 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Fri May 15 22:42:30 2009 +0100 Cygwin/X: add hebrew to autodetected keyboard layouts Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b079945c39e2a72220b46953352e24c3a74ef39a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Feb 20 15:21:35 2009 +0000 Cygwin/X: more warnings fixes More warning fixes, mainly removing casts on function return values Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit e79db6a97d02c8a256a4a7e145ea0b48b5a084ab Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Feb 11 23:00:58 2009 +0000 Cygwin/X: Remove an obsolete mention of xf86Config Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 3020b1d43e34fca08cd51f7c7c8ed51497d49ef3 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jun 23 16:45:40 2009 +0200 glx: Clean up more thoroughly if the drawable of a current context goes away. Fixes crash when restarting compiz, due to cl->currentContexts[x] being stale. commit df597709d71f47b8516e27c6fb1bfffd59de5e48 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jun 23 16:45:39 2009 +0200 dri2: Don't crash if pPriv is NULL. commit 048697ccfa31cf7f7a29afa90a2f702d43efb7d4 Author: Ben Skeggs <bskeggs@redhat.com> Date: Wed May 27 15:24:34 2009 +1000 quirk: use first detailed timing as preferred for PEA prod 9003 (rh#492359) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 07154db4a8b96467785fd6be93d20379acacffa8 Author: Ben Gamari <bgamari.foss@gmail.com> Date: Mon Jun 22 08:59:45 2009 -0400 Xi: Remove redundant and incorrect butmap range check Maps are CARD8s, therefore checking for values above 255 is completely unnecessary. Moreover, 0 is a valid value for maps, so the check wasn't even correct to begin with. This fixes bug #22392, which was uncovered by commit 280b7f92d729ec910ffa3d18dce7bbc215be7a3c. Signed-off-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 96706c24bd57fbd9b11e5bd5e38d05d81b90aebe Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 18 15:40:08 2009 +1000 dix: fix wrong indices in set_valuator. Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ae20e748cd3a656173e1f50109bfd4af0712bb87 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jun 19 21:16:10 2009 -0700 XQuartz: More localization updates (cherry picked from commit 7fbe974246f54535c545861a57c043d80e127ee7) commit 30df49f54945e75f033a0eb6445c26d37eb33c5e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 18 23:15:47 2009 -0400 Xi: fix 2 memory leaks. In ProcXIQueryDevice() and XISendDeviceHierarchyEvent(). Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit eb35402d0a5290e8a73d7d1e92f173294c364cc2 Author: Adam Jackson <ajax@redhat.com> Date: Fri Jun 19 12:42:07 2009 -0400 pci: Dump vendor/devices ids in the printed device list commit c733660428c0a7c1d11f7bd21e23e1bb934d352e Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Fri Jun 19 08:37:18 2009 -0400 Use pixman_version_string() instead of PIXMAN_VERSION_STRING Pointed out by Julien Cristau. commit aef6b904ebf0d7de6259058606c7c04ea177bda3 Author: Dave Airlie <airlied@panoply-rh.(none)> Date: Thu Mar 13 16:16:46 2008 +1000 fbdev: make entity fail if PCI claimed already. bad kitty fbdev, been shipping this in Fedora for a while now commit 3efb23a6c40dc3583d083d25ada3853ecc56000d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 18 19:35:22 2009 -0400 xselinux: Add new device permissions for XI2. Refects the ability of clients to add/remove devices and device properties. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 1e060c3d8b13d352a58fc65980cb9a3c6cb5718f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 18 18:48:24 2009 -0400 xselinux: Move the security class mapping to the header file. Take the mapping of DixAccess bits to Flask permissions, move it into the header file, break up the extremely long lines, and annotate the permission names with the bit being referenced. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 75c51c67b340548286efd41a53882e2acaf74ab5 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jun 18 09:49:12 2009 -0700 Clarify use of and need for mffs vs. ffs Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 128cd03eecacc6d5c5903d59a11966dcf3697bf1 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Sat Jun 13 10:55:04 2009 -0400 Fix miComputeCompositeRegion() to follow new clip rules. Ignore the hierarchy clip, and always apply any client clip after transformation and repeating. commit e9aa61e9f0d663d5b34a397b943b4d1df44e873d Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Sat Jun 13 10:28:21 2009 -0400 Fix clipping when windows are used as sources The new clipping rules: - client clips happen after transformation - pixels unavailable due to the hierarchy are undefined The first one is implemented in pixman; the second one is realized by making a copy of window sources (to prevent out-of-bounds access). commit d9b5e77a0e48a16c53653b56bc61a0b8dc4122a1 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Tue Jun 9 14:36:21 2009 -0400 Print the current version of pixman. commit 1e9907499c27321a2aa5dc8a75a375b7a82c999a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 18 15:14:00 2009 +1000 record: use dixLookupResourceByClass instead of LookupIDByClass. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 66089e9129a821cfb1983d3d35f41b975a52de5e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 25 12:55:42 2009 +1000 xfree86: fix SWCursor check in xf86CursorSetCursor. Wrong check for inputInfo.pointer resulted in a SW cursor being rendered when the pointer left the screen (in a Xinerama setup). We must call the sprite rendering function if - SW cursors are enabled, or - The current device is not the VCP and not attached to the VCP. Reported-by: Gordon Yuan <GordonYuan@viatech.com.cn> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit afa680e495622f521cae80563511c0d284f57551 Author: David Miller <davem@davemloft.net> Date: Thu Jun 11 05:15:05 2009 -0700 mi: ignore DGA events in ChangeDeviceID DGA events don't have a deviceid, so they don't need changing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cd8abd17abcc8ae9da6704d03b97a9f134f36aab Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Jun 17 14:17:07 2009 +0100 Cygwin/X: Fix permuted args to InitPointerDeviceStruct() Fix a minor error in commit a30fef9956b296f59ea18a9ee38d0abafeb15a4e, new btn_labels argument to InitPointerDeviceStruct() wasn't added in the right place commit 14581afb474552716c02ca15220ca7050123c375 Author: Benjamin Close <Benjamin.Close@clearchain.com> Date: Thu Feb 26 17:32:10 2009 +1030 xfree86: correctly define barriers for FreeBSD amd64 Previously when compiling on freebsd amd64 we'd end up at xi86 block (line 1315) which would define mem_barrier and write_mem_barrier to be NOP's. Instead they should be valid, as per the linux amd64 setup. This stops the hangs experienced by many when using the nv driver which would hang due to out of order dma requests as noticed in http://bugs.freedesktop.org/show_bug.cgi?id=3168 Signed-off-by: Benjamin Close <Benjamin.Close@clearchain.com> commit e92dcb6ce07aa3cfb53e8bad5701481c106c4094 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 18 14:40:20 2009 +1000 input: unify button numbers on master devices. Master devices provide the union of all attached slave devices' buttons, i.e. the number of buttons on the master device is always the number of buttons of the slave device with the highest number of buttons. When slaves are attached or detached, the master device adjusts the button number to reflect the new buttons. On a slave switch, this slave's button labels are copied into the master (up to slave->num_buttons). The remaining button labels (if any) stay as they are. Thus, if any of the higher buttons is still pressed, it reflects the label of the last pressed device that provided this button. If two devices press the same button and it is differently labelled the last pressed one will be reflected in the master device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 280b7f92d729ec910ffa3d18dce7bbc215be7a3c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 17 22:38:24 2009 +1000 dix: reduce MDs and xtest pointers to 7 buttons by default. MD's will soon be the union of all devices anyway. XTest pointers are only for the core protocol XTest stuff, so 7 buttons (lmr + 4 wheel buttons) should do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6c7d992735eebbd7a20247926e7725896348b865 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 17 09:11:52 2009 +1000 Require inputproto 1.9.99.12 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 09cef7573938e5c08007e578e1b638bc5e1796a8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 17 09:04:08 2009 +1000 Xi: valuator/button labels are called labels now, not 'names' Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc2ff5365030ad8bc11efde430b1064080dd7098 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 19:36:57 2009 +1000 Xi: copy the valuator mode from SD to MD. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 87d1f44bad608507e3995e17eb84fa0a0119796c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 14:18:45 2009 +1000 Xi: copy the button and axes labels into the XIQueryDevice reply. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a30fef9956b296f59ea18a9ee38d0abafeb15a4e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 16:38:11 2009 +1000 input: Add labels to buttons and valuators - ABI_XINPUT_VERSION 7 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 17f9723f488d0470e3879c6b0dfdba61544cdd7b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 17 08:37:44 2009 +1000 input: bump to ints for deviceids - XI2 requires 16-bit deviceids. Note: ABI break, but ABI_XINPUT_VERSION has NOT been bumped. Recompile input drivers. Revert "Xi: return BadImplementation for deviceids 256 and above" This reverts commit 2b459f44f3edaea137df9a28bc7adfeb1b9f1df7. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cbeb73e2055f6c013c8fe6325851f2631170137d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 10:51:52 2009 +1000 Xi: return current valuator values in XIQueryDevice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 80837dbefd9d5e96ab5c1f4b4c2d5c66ce17ce67 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 10:51:17 2009 +1000 input: change axisVal from uint to double. With subpixel support, uint just doesn't cut it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 25b6fc4a42f7698e6ae0b16becb316bfd7835d05 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 10:48:48 2009 +1000 Xi: last_valuator is used like an index, so range it accordingly. The previous code would always skip the last valuator due to a wrong upper boundary in the loop. last_valuator is the index of the last set valuator - which also means it must be initialized to -1, not 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3fc762ea9474cf92f6b7ef60dd0bb68f59385272 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 10:48:03 2009 +1000 Xi: Motion events update the device state too. Without this line the device's axis values don't get updated properly for pure motion events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ad6347afead500fefb34131841f4beb5b03ad4ec Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 16:35:40 2009 +1000 Xi: don't use a constant number for class sizes - use sizeof instead The protocol is still changing, and having to debug crap like this is annoying. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d5a15e65b7d2fdda14fb719e3ebf076cce896386 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jun 14 09:15:42 2009 +1000 Xi: include button state in XIButtonInfo. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 01241b4247a7ad0974d48412cc0d88e1a09a3c49 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jun 7 19:43:11 2009 +1000 Xi: Add support for sourceid in the device classes. commit d230742ea820a21a3f1ed0c58b5e6d8680b2f2aa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 16 12:13:16 2009 +1000 Xi: namespace XI2 files. Some files (notably those merged with MPX before XI2 came along) didn't use a 'xi' prefix. This patch changes all of them to meaningful names. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4ddb002b6847e8a88e6f13ae0453a35ee79946ae Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 15 15:14:47 2009 +1000 xfree86: fix two compiler warnings in xf86vmode.c xf86vmode.c:1578: warning: pointer targets in passing argument 1 of ‘SwapShorts’ differ in signedness ../../../../include/misc.h:231: note: expected ‘short int *’ but argument is of type ‘CARD16 *’ xf86vmode.c:1543: warning: unused variable ‘i’ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9d039ef5047af2dedff0c583dda11032f71bed01 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 15 15:11:55 2009 +1000 xfree86: silence a few int10 compiler warnings. 'format ‘%#x’ expects type ‘unsigned int’, but argument 2 has type ‘CARD32’' and similar. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fb882b3da189847bc98b646faddac9e8b42aa435 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 16 14:58:10 2009 -0400 EDID: Carp about 1.4 monitors with no preferred refresh rate You would think, having finally tightened down the spec, that monitor vendors would bother to implement what the spec actually mandates. You would be wrong. commit b2d2af76b43d62c9be07fd736652f904632fd663 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 15 10:10:26 2009 -0400 randr: fix typo in swapped dispatch commit 1d20b9021e8aecb942619f64017cc2fc31f02d29 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jun 14 18:21:43 2009 +1000 Xi: fix wrong bit->byte conversion in ProcXIQueryPointer Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9afc3241c157e5c19454f913c7105b3fdfa97ec4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jun 14 18:24:22 2009 +1000 Xi: remove un-used IsOn macro. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b67ff1d6e0d01170c6261593ca36d0f51d917393 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 16:45:36 2009 +1000 Xi: XISelectEvents/XIGetSelectedEvents use 'win' instead of 'window' now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b2bf67b61c564a4b92a429ca9ad455403161f33a Author: Benjamin Defnet <benjamin.r.defnet@intel.com> Date: Wed Jun 10 21:35:48 2009 -0700 randr: fix operation order so that rotation+transform works The matrix multiply to combine rotation and projective transforms was being done in the wrong order. Signed-off-by: Keith Packard <keithp@keithp.com> commit 3627215e97734cc367fff273a3358c2a95a53481 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 5 16:38:46 2009 +1000 Add check for GNU ld in the test suite. The GNU linker supports a -wrap option to wrap function calls at link-time. This allows for easy overriding of functions in the X server with stubs in the test suite. This functionality is only supported on the GNU linker and will be used extensively in the tests. Disable the tests if GNU ld is not available. commit 5e0ca6fabd12401de6bd6039484be2079e28851e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 11 16:26:23 2009 +1000 input: remove un-used "setter" argument from SetClientPointer. It's obsolete, not likely to come back, let's drop it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e6a18762ef113296c6a09833be70cb4b45aa3940 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 11 15:40:56 2009 +1000 Xi: fix XISetClientPointer return values. If SetClientPointer fails, the only reason may be that the device is not a pointer or that the device is an SD. Return BadDevice instead of BadAccess. (BadAccess is a leftover from the early times of the ClientPointer implementation when only one client was allowed to set it). If the window parameter doesn't name a valid window or client, return BadWindow. Finally, allow both master keyboards and master pointers as deviceid. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ae7dab2a136d15b976b956f68feec53886951dd6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 11 15:40:38 2009 +1000 Xi: Fix XISetClientPointer swapping. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 98e8ec8deb09db1c56e06afed267e6f517042fa3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 10:54:55 2009 +1000 Xi: sanitize ProcXIGetClientPointer. This was quite old code and can be streamlined a bit. The new code is essentially the same as in ProcXISetClientPointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 96ea82fdac7c28feb2748cd4ff7faa7c00dbbdcd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 12 10:54:25 2009 +1000 Xi: fix reply swapping in XIGetClientPointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 76f25086a9ab6f0c27d9e2cd745f8463c6b3df5f Author: Adam Jackson <ajax@redhat.com> Date: Thu Jun 11 16:34:06 2009 -0400 vfb: Re-enable 30bpp support commit 0de58c88aba7ddd69b04f24ab5b2967c359aa69e Author: Dave Airlie <airlied@redhat.com> Date: Thu Jun 11 14:21:53 2009 +1000 xfree86: move didLock assignment down to where the function pointer is valid. crtc->funcs->lock is NULL, so it's no use calling it here. Move it down so it's actually defined before we use it. Introduced with 6f59a8160042ea145514fdcb410f17f33fd437c2. Tested-by: Peter Hutterer <peter.hutterer@who-t.net> commit a85d210b34506cb39e7f08d81d4586fe4448b47f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 11 12:32:39 2009 +1000 Xi: store mask_len before swapping in ProcXIGetSelectedEvents. Swapping the mask_len and then advancing the pointer by the swapped length is just a bad idea. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5043f42f36b49e7702d0c496dd4fe157788d44ee Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 11 12:31:40 2009 +1000 Xi: correct return buffer size for XIGetSelectedEvents. The maximum number of bytes is calculated by the mask len, and the mask len is always in 4-byte units. XI2MASKSIZE however is in bytes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fcf0c0b8f332cbde03c1a479376b7913197962eb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 11 13:23:40 2009 +1000 Xi: XISetEventMask needs to clear the mask if len is 0 zero-length masks are supposed to clear the device's mask. ProcXISelectEvents passes these masks through directly, so we need to clear the bits here if such a mask is supplied. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 22b4ac44e4fdbe8f36f2b570cdbdaf237062e33e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 11 11:08:07 2009 +1000 Xi: XIGetSelectedEvents mustn't returned masks from non-existing devices. Or devices the client doesn't have XACE permissions for. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7868956b0fb50a9d77506f01413612e429f540a3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 10 17:09:39 2009 +1000 Xi: ProcXIGetSelectedEvents must use WriteToClient for swapped data. The data is already swapped before, so we just post it to the client as-is, without attempting to swap it again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit aa2babf11c30be4d289b58212dc330b84efb4053 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 10 14:41:11 2009 +1000 input: remove dependency on XI2 protocol for XI_LASTEVENT. inputstr includes XI2proto.h for the sole purpose of XI_LASTEVENT. However, using XI_LASTEVENT in the server is prone to errors, if the server is recompiled against a newer version of the protocol it would bump this variable and associates bits, including potential ABI. This patch defines an XI2LASTEVENT for use in the server and removes the XI2proto.h require. XI2LASTEVENT is the current value of XI_LASTEVENT. This patch is required by components that require access to inputInfo (currently xf86-video-geode and xf86-video-cirrus) but should not have a require for the XI2 protocol. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 77cc816da4a2777110182ed01c22c0f5e6ac3b65 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 10 13:54:42 2009 +1000 Xi: rename ProcXISelectEvent to ProcXISelectEvents. The request name has the plural, so let's do it here too. Purely cosmetic change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9563feeeb5309de1971c4e04419fed6fd31c9cea Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 9 16:57:09 2009 +1000 Xi: start checking for invalid mask bits _after_ LASTEVENT. Two issues that combined to false positives and false negatives. - The checking for invalid bits must be performed when there are enough bits that an event outside of LASTEVENT may be selected. - The first invalid bit is LASTEVENT + 1, not LASTEVENT. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e2fbaebb87e18198143a4b8e6be7e650563cd819 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 9 14:38:25 2009 +1000 Xi: XISelectEvents returns BadValue for num_masks == 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cfeb65ac45b194dead5e8b9b26192df2619d6f9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 9 14:37:42 2009 +1000 Xi: XISelectEvents needs to be at least size 3, not exactly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f3c26034eca98924d93a004aaa1f61ffe5d344ca Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 9 13:04:56 2009 +1000 Xi: XIQueryDevice should use XIFooClass instead of the old FooClass defines. This is merely a cosmetic change, the actual values are the same anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 482cc72aa790bd2f23c7ebe12c5549b47c737115 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 9 13:03:38 2009 +1000 Xi: get the class length before swapping. Advancing by the already-swapped length lets our pointers point into nirvana. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9974249980894f74f3ead466655da87958a43670 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 9 13:02:52 2009 +1000 Xi: Swapping 32 bit keycodes requires swapl, not swaps. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 918923e285f4e269a257bb5be4d3c8a50174aad0 Author: Dave Airlie <airlied@redhat.com> Date: Wed Jun 10 15:13:45 2009 +1000 glx: fix open-coded linked list removal function OMG stab stab stab, YALL. removal function was made of crack, actually truncated the list from the one after the find point. However fixing this makes glean makecurrent fail with a GLX error. commit 3ea747c0dbbec0db6761d66d4f6c680d2e9ddeaf Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 25 16:53:18 2009 +1000 KDrive: Warning fixes xEvent vs. InternalEvent confusion still reigns though. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 754be1e2ec9be2486bf45000d7244d217556de07 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 25 16:51:48 2009 +1000 KDrive: Xephyr: DRI: Warning fixes Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit f534e6bea17746db952feb563ffea7320846b49d Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 25 15:38:54 2009 +1000 OS: Fix compile warnings It's a marvel the sigaction() ever actually worked. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 305ab237f666936cd812c464bf43f86f6079838e Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 25 22:11:19 2009 +1000 KDrive: Warning fixes and cleanups Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 4c8812b544ce5f319a7ac59a131c626c8509ef99 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jun 10 12:46:19 2009 -0400 kdrive: undef PSEUDO8 Whatever that was, it no longer is. commit 973ef5a7086aedb88a4888e73630c96ae68078e4 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jun 10 12:44:45 2009 -0400 kdrive: Remove a lie about PCMCIA support. commit e3c65cf1df9bbfb126f07b4b8e1254a855fb70c7 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jun 10 12:05:09 2009 -0400 xephyr: Add -title option. commit 803522300344265f11ea9f869ee6747730413bae Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Jun 10 13:32:54 2009 +0100 Xming: Simplify logic for ownership release of native clipboard Make the logic simpler for the ownership release of the Windows clipboard in winclipboardwrappers.c - We've already marked a selection as unowned if it is owned by our clipboard window Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit c7d3965bee0edb72468a0135aaa8a081348c2b23 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Jun 10 13:09:44 2009 +0100 Cygwin/X: Add a needed inputstr.h Add a needed inputstr.h to fix build after commit 6d4ffcc9e066bc7c49dcff1a2ff0111801c7286d Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 6d4ffcc9e066bc7c49dcff1a2ff0111801c7286d Author: Dave Airlie <airlied@redhat.com> Date: Wed Jun 10 11:15:24 2009 +1000 input: move inputstr.h to where its needed. This stops inputstr.h being needed to be included by output drivers. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6f59a8160042ea145514fdcb410f17f33fd437c2 Author: Benjamin Defnet <benjamin.r.defnet@intel.com> Date: Mon Jun 8 21:45:42 2009 -0700 hw/xf86/modes: Set crtc mode/rotation/transform before calling set_mode_major This moves code out of each implementation of set_mode_major and back into the X server. The real feature here is that the transform is now available in the crtc for use by either xf86CrtcRotate or whatever the driver wants to do. Without this change, the transform was lost for drivers providing the set_mode_major interface. Note that users of this API will want to stop smashing the transformPresent field, and could also stop setting mode/x/y/rotation for new enough X servers, but there's no reason to make that change as it will break things when running against older X servers. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> commit e244a5991e2cc55f5aa2f6e5255f1dabf56f0235 Author: Federico Mena Quintero <federico@novell.com> Date: Tue Jun 9 13:28:28 2009 -0700 dix/randr: Add missing fields to SRR*NotifyEvent() Also, remove redundant field swaps and make others match the order in which they are declared in the xRR*NotifyEvent structs. Signed-off-by: Federico Mena Quintero <federico@novell.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit 746e7b22e1bdfbf2363040367209b4c46b1c2fec Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 9 16:20:11 2009 -0400 cvt: Allow multiple-of-60Hz refresh rates for reduced blanking. Doing so generates the same timings as given in the DMT spec for 120Hz RB, so we should be set there. Other rates might be legal too but why push our luck. commit 2a035600e603117a4dbe668cad50bae2a5609094 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 9 10:14:18 2009 +1000 require inputproto 1.9.99.11 commit c5bebca46f63bcd7279f3c73ed1d50e0c1b6051f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 8 17:54:05 2009 +1000 Xi: hierarchy events have a num_info now instead of num_devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 810b74dbbcc1db3e68e0f95ff5223ddb2032e46d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 8 13:41:22 2009 +1000 Xi: change from XICreateMaster to XIAddMaster for consistency. add/remove is used for slave devices and hierarchy flags. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0e66a443a09176b8a875195d5473b953c07aa1d7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 8 12:24:24 2009 +1000 Xi: return BadValue for XI_HierarchyChangd mask on devices. This mask may only be selected for XIAllDevices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 69a9545d1f8110841538410818df19fd960412c5 Author: Keith Packard <keithp@keithp.com> Date: Thu May 28 14:43:27 2009 -0700 Make RANDR 'set' timestamps follow client specified time. Bug 21987. The lastSetTime value which indicates when the configuration within the server was last changed was not getting set in the appropriate RandR requests. Signed-off-by: Keith Packard <keithp@keithp.com> commit fa18c569ed26d2fdd442af6b39723cb7e30d18df Author: Ben Skeggs <bskeggs@redhat.com> Date: Tue Jun 9 09:14:50 2009 +1000 exa: driver pixmaps enabled if either CreatePixmap or CreatePixmap2 present commit 9390b7a133b0e17bc4d303effb7a99ff7017b086 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jun 7 19:26:45 2009 +1000 dix: protect against missing ButtonClasses in GetPointerMapping. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 21ee53060b4dcb5c12074cf6682ff0067021ff60 Author: Simon Thum <simon.thum@gmx.de> Date: Fri Jun 5 19:14:48 2009 +0200 config: fix build after XI2 API changes to RemoveDevice. This patch fixes the build with --enable-config-dbus is enabled (default disabled). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 07c59411817c10fbcbf1bc9efa6a0818b6e0493a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jun 6 22:17:44 2009 -0700 GLX: Make sure the types match for ALIAS in indirect_reqsize.c (cherry picked from commit 31a20a573b867fb7f02da15425e3b92eccb82dec) commit 077556ec39ca7e0d14486005cf71fcdc70a350cf Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jun 6 21:55:51 2009 -0700 XQuartz: AIGLX dispatch table cleanup This should fix some issues when building on different versions of OSX. We only use extensions that OpenGL.framework's glext.h header tells us are supported. (cherry picked from commit e10c53421f1e780573c8adcd8ea89d6ffa28a819) commit fc24a97a8d022e986082b65b5133701e7273805c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jun 2 19:12:41 2009 -0700 Rootless: Use serverClient instead of NullClient This seems to stop the crash when moving windows. (cherry picked from commit fcd857c8e295ac7a2b0e58d49dc71251ed9d1266) commit 2429daa7e6b35a4a8032e1c3736e417a5a9baa07 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jun 2 10:19:10 2009 -0700 XQuartz: Default to forcing the dialog box before quitting. This will show the quit dialog for users of other WMs. (cherry picked from commit 639ee0c913f892776fee40bcfb856e0d7c2c7db5) (cherry picked from commit 09432fa5b1cc8e9a30fb8aa4f8dfcd08c4a91e30) commit 6d75606a9e7f6ebc4d79a5261a48f5915c71cbcd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Jun 1 22:58:40 2009 -0700 Rootless: Despite its name, we still want to allow rootless to mess with the root window This fixes the bug whereby we weren't drawing the contents of the root window since RootlessPaintWindowBackground got nuked. (cherry picked from commit bb0e208787739fbed2a0c8d1af6b6504319fdf88) commit 7348bf4935c8887bca33fe340ac2548f551bee3d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jun 7 09:25:51 2009 +1000 dix: set the generic event type for implicit XI2 grabs. event->type is always GenericEvent for XI2 events. Instead, XI_ButtonPress (the generic event's evtype must be stored. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bb1c131b785ca30cf40041db3513b7669beebd34 Author: Simon Thum <simon.thum@gmx.de> Date: Thu May 28 16:43:42 2009 +0200 dix: suppress pointer acceleration on xtest devices Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 707b1241681c33401d5e0eb6edeace33f5970928 Author: Simon Thum <simon.thum@gmx.de> Date: Sat Mar 21 18:19:19 2009 +0100 dix: prefer lroundf() over roundf() in axis scaling it's unclear whether there actually is a problem, but in a very similar case there is (bug#21456). Also, integer addition is generally faster. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ef0e435052b2fda598cd8670c8e892aea685a102 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Jun 5 19:29:02 2009 +0100 Cygwin/X: Remove obsolete ChangeLog files Remove obsolete ChangeLog files, this information is preserved in the automatically generated top-level ChangeLog commit 752508577aa7f0a1d80c8b7f4d3fe2b098e5e5fa Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Tue Jun 2 21:19:46 2009 +0100 Cygwin/X: Tidy up a bodge to avoid collision between X header and native Win32 API definitions of ATOM Remove a bodge to avoid collision between X header and the native Win32 API definitions of ATOM, use X11/Xwindows.h which exists to address these issues Consequently, include misc.h in winclipboardthread.c, to provide the max() macro, as previously we were using the the one from windows.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 7f3456a4080d1bf21010170e126128cb653bd2ac Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 5 16:44:46 2009 +1000 Revert "test: check from INT_MIN to INT_MAX for core type conversion" This patch requires extra special casing to check if the linker supports the -wrap option. Patches to do so will follow, in the meantime, revert this commit. It shouldn't have been pushed in the first place anyway. This reverts commit d979f443946011158b6a183582728a6899c33b85. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d770d57f1701c7c8272b4ca3714f64c46c47adf1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 5 11:38:22 2009 +1000 Xi: fix XIQueryVersion major/minor swapping. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 17d62306b602ec61e8c5b44a79c9e1edc6b63a21 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 5 11:31:39 2009 +1000 Xi: add XIQueryVersion reply swapping hook. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2b459f44f3edaea137df9a28bc7adfeb1b9f1df7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 5 10:15:04 2009 +1000 Xi: return BadImplementation for deviceids 256 and above The protocol allows for 16 bit device ids, but the implementation doesn't yet. We need to break the input ABI once more to shift the DeviceIntRec's CARD8 to a CARD16, along with some changes in the privates. Once that is done, revert this patch. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c77f42049f77417c68bbce3dd2e995d916fc5af5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jun 5 09:29:04 2009 +1000 Xi: fix flawed logic in XIQueryVersion return value. The server returned the minimum of major/minor each instead of the lower of the combined major.minor version. As a result, a client reporting 3.0 and a server supporting 2.7, the return value would be 2.0 (the minimum of both). Reported-by: Rémi Cardona Reported-by: Simon Thum Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b6c16fc7dad5a4ffcaaab647c0e3fabed372efd5 Author: Dave Airlie <airlied@redhat.com> Date: Fri Jun 5 11:57:39 2009 +1000 crtc/gamma: check xf86_config is valid before using it. If you have multiple cards, some that support randr 1.2 and some that don't you can get a null dereference in here. Signed-off-by: Dave Airlie <airlied@redhat.com> commit da682abc78c9a5b2fde09679061fe08a3a1c665b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 4 17:33:25 2009 -0400 xace: fix a bad send access hook call. commit 993daf06497c85bb6a1e70592df380503d721dfb Merge: 2bda50e e1e8c7d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 4 15:11:36 2009 +1000 Merge branch 'master' into xi2 commit 2bda50ee14b7873f28081bf0f1bfb7b79a40de43 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 4 14:51:32 2009 +1000 Xi: memset the device name padding to 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 09266d6cd1bb6e09fe8bcb875c63fb4011c05b55 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 4 13:36:29 2009 +1000 Xi: XIQueryVersion requires major_version of 2 or higher. Otherwise, a BadValue error is sent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6ea76c550486bd17eb31f43757030fb44bdf1eab Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 4 12:55:59 2009 +1000 Xi: reply with the XI2 version that is supported by both client and server. XIQueryVersion must return the client's version if the client's version is lower than or equal to the server's version, or the server's version otherwise. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d979f443946011158b6a183582728a6899c33b85 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 4 11:40:14 2009 +1000 test: check from INT_MIN to INT_MAX for core type conversion ErrorF is link-wrapped to reduce the run-time of the test. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d8471bc7a19cd248fa3e0845496c86cd9251c013 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jun 4 11:32:15 2009 +1000 test: adjust event_to_core_conversion test for new ProximityIn/Out behaviour Both types now return BadMatch. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e1e8c7ddd7fdbfd674361364295fb1cbd5f28b45 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jun 3 13:37:32 2009 -0400 s/MIN/min/, s/MAX/max/ (#2968) commit 6de67d3206f0a4e307070714564c19efc84da2ec Merge: af4e658 7f027d9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 3 16:11:33 2009 +1000 Merge branch 'master' into xi2 commit 7f027d9dc0146e229802aeac342ea2dbab63264a Author: Olivier Blin <blino@mandriva.com> Date: Thu May 28 20:57:36 2009 +0200 kdrive: add protocol mouse option kdrive probes a lot of PS/2 protocols for the mouse device, which makes the mouse unusable for some seconds after X startup. This new "protocol" option allows forcing the mouse protocol. It can be used this way: Xfbdev -mouse mouse,,protocol=ps/2 -keybd keyboard Signed-off-by: Olivier Blin <blino@mandriva.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit af4e658401ecbd2f2cc515b4c5abe5aee361cd64 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 3 12:30:49 2009 +1000 mi: only process master if the SD is still attached. SDs may be detached during event processing (e.g. if a passive grab activates). In this case, the event must not be processed through the master device. Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit eb3fe72cbcd10c3953d713e07c321e695194a328 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 3 12:19:14 2009 +1000 dix: set the device state for XI valuator events. Valuator events need to include the device's state, while other device events need to include the state of the core devices. Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 08fd2ae652883393ecff6f3d5177e63408d58472 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 3 12:18:17 2009 +1000 dix: use GetMaster in PickPointer and PickKeyboard. GetMaster is more reliable than GetPairedDevice, it always returns the keyboard/pointer if desired, even if the wrong device was passed in. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a1d1dd06f8f91c1d1802f7581a4ba7568b85e69c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 3 12:15:32 2009 +1000 Xi: fix wrong grabtype from ProcXGrabDevice. 86077f0058ce88ee9b3df5d1ab854eeca43 switched from a boolean to a grabtype enum. ProcXGrabDevice didn't switch with it. PickPointer during an XI grab on a slave device would thus return a wrong (or NULL) device and crash the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a371a47205fc58a587e1aecaa4a031184481c228 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 3 11:47:16 2009 +1000 dix: EventToCore must return BadMatch for proximity events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2bd5ea80652358565346071bed829070ddf5de85 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jun 3 10:45:28 2009 +1000 dix: rework event conversion before delivery. Let EventToXI, EventToCore and EventToXI2 return BadMatch if there's no matching event for this protocol spec. Adjust the delivery paths to cope with BadMatch errors (and clean them up on the way). As a side-effect, this fixes server crashes on proximity events for a grabbed device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 20d9f11abfd6ce3630d9640ff7383c7e27196956 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 2 13:49:09 2009 -0400 Typo fix commit ab5d1ae82ebd467d0a5b39821b286097865ba0c7 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 2 13:39:55 2009 -0400 Remove some libXfont leftovers commit 75795637c7160f1579dbe81c2d7600e85b1d141f Author: Matthias Hopf <mhopf@suse.de> Date: Tue Jun 2 18:41:36 2009 +0200 Revert "randr: Setting gamma: inverse logic looks more sane" This reverts commit 79138eec1b49cbaca6a16f2bdd8579b5828aeb28. commit fc8cfc3a055d8af4ac809799c71f3db0d5246433 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 2 16:53:41 2009 +1000 dix: ensure EventIsDeliverable has inputMasks set at all times. For proximity events, the XI2 type is 0 and inputMasks never got set in the preceding condition. As a result, proximity events got never delivered. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ef9f851057a0ae214be02cb919f1e6634cead20b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 2 16:38:32 2009 +1000 dix: protect against floating slaves in DeviceFocusEvent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b40289c8766c5e7543b7288009b4d965f57c04ce Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 2 16:22:58 2009 +1000 xkb: allow pointer events to pass through for floating SDs without a key class. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 38df8351b36195070232b42a6d3369a9a08df8df Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 17:09:03 2009 +1000 test: add grab matching tests. commit a66686a83edd6093ed540414dda2b8700e4696fe Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 15:37:53 2009 +1000 input: add support for XIAllDevices and XIAllMasterDevices passive grabs. These grabs are suported through two fake devices inputInfo.all_devices and inputInfo.all_master_devices. These devices are not part of the device list and are only initialised for their device id, nothing else. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f00cf7675164bb984ef310412f9e09582813adb1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 2 10:23:21 2009 +1000 dix: get the current MD keyboard for the grab modifier state. A passive XI2 grab always uses the paired master device as a modifier device. After issuing a passive grab, the slave may be reattached to a different master and hence the modifier device may change. commit 1cd7ed75d903b5b0ea4e1070d2c26f4f931bdec7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 17:14:06 2009 +1000 dix: float slave devices during passive grabs. Exception - implicit passive grabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f56ad22e8fabdca6d9fd1e408a539696e30599fc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jun 2 15:07:53 2009 +1000 dix: rework temporary slave detachment. Rework addresses two issues: - storing the master device's pointer is a bad idea, we need to store the ID of the device in case it disappears during the grab. - restoring the old master did not actually reattach the device. Fixed now. commit b3e4810a283d369e1a2c6c3288177fe79fd1e9d6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 16:22:51 2009 +1000 dix: move grab device assignment into GRABTYPE_CORE block. grab->type is the device type and XI2 types overlap with core events (being less than GenericEvent). Thus, for passive grabs the grab device would be overwritten with whatever device was activating it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 18ae48670859d05788776e164c65985e3b35a723 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 16:06:52 2009 +1000 dix: don't try to activate a passive grab on top of an active one. If we already have an active grab on the device, don't attempt to activate another one. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ff1d6244eba8367a8d50601ca393e951c60c94b6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 12:14:52 2009 +1000 input: add support for XIAnyModifier in passive XI2 grabs. commit eb97d125fb6adeff0b23c2460108e0587ba253e2 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 1 15:50:50 2009 -0400 doc: Remove mention of Kerberos replay cache from Xserver.1 The krb5 auth code is gone, so this is no longer relevant. commit 80ea32ad4f1440d068e18db65830f45498703b09 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 12:06:55 2009 +1000 dix: switch grab checking from unsigned shorts to unsigned ints XIAnyModifier is outside of the unsigned short range. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 080b0331b3d1de1bab5ecdc9df175b287616e358 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 13:33:29 2009 +1000 input: Add grabtype to GrabParameters. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bee02a154145c0e4ed97980f7857dc27a96b1be8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 10:49:22 2009 +1000 dix: ensure implicit passive grabs have the xi2mask zeroed. This fixes XI2 enter/leave events being sent to non-xi2 clients. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cc71dfb4f5cf6113053951070dec9556e941aa24 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 13:19:30 2009 +1000 test: Add GetSelectedEvents request to struct size tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit de5c5b1db083a9c1d23e1461b54ca646c5a5c445 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jun 1 13:21:36 2009 +1000 test: fix compile error introduced with the removal of isMaster. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 45530d16097459a756696e255ab4e72d6e51fbc4 Author: Adam Jackson <ajax@redhat.com> Date: Fri May 29 18:07:48 2009 -0400 vfb: Fix depth setup. Initialize the depth corresponding to the root window before the pixmap-only depths. Otherwise you end up with the root window depth in the depth list twice, which is mildly confusing for clients and catastrophically confusing for PanoramiXConsolidate(). commit 5c8540d8cf9ebaafa7572cb2879d057cd3d15190 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 29 14:49:05 2009 -0700 GLX: Purge glxint.h usage Change (__GLXvisualConfig *) to (void *) in ABI compat stubs. (cherry picked from commit b4adec886c65e49cfbd30d1e3a41b613f75ed3f5) commit da2aaee24a77e1a9e5c623af4a78ca6acc94b787 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 29 14:27:46 2009 -0700 GLX: Purge some glxint.h usage in glxcmds.c This is related to d0b249f1c5df81f3941d638f9625fe1e16c31807 in the 1.4 branch and was ok'd by krh (cherry picked from commit e587436cf2e1237813c924699ff0662aea3034e1) commit f2151f1b0dcbfec23488a29a7ea887fbfd53b760 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 29 14:09:41 2009 -0700 XQuartz: Fix alpha to be 1 (screenshots bug, etc) This is related to: bc964ff1e3f3d8ab590eab40d767c6241e9480d4 XQuartz: Stab at fixing the alpha 0/1 bug (screenshots, etc) by pulling in some old code that got gutted from rootless. which was on the 1.4 branch and implemented in fbPaintWindow. Now that fbPaintWindow is gone, this is now in miPaintWindow(). (cherry picked from commit 032173f693f75385a40e144ffe2b7b5378bb6f2e) commit 7c158ffa766d32f5e8ec459693da5ef6ba0892e9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 29 14:02:18 2009 -0700 Rootless: Use miPaintWindow since PaintWindowBackground is dead (cherry picked from commit 4975c087257b52189a5c21d93d121f183e60e4c8) commit ec9e9c8bcabda3d8b4ea07037fb247f7408dde8b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 28 15:30:20 2009 -0700 XQuartz: English localization update for HIG compliance (cherry picked from commit 86b319d7cbef39d75b54c9d321e5dbf097b552be) commit 0f47203a9a690498c18b1c04e2ef5deed23a0e3e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 29 14:18:37 2009 +1000 dix: Set the implicit passive grab flag for keyboards too. Extension devices have ActivateKeyboardGrab as their grab activation function, hence we need to ensure the implicit passive grab flag is set accordingly in the grab for further event delivery. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 75c73ddbfc9236bb80a3709d467674c4a1018fa3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 29 14:01:21 2009 +1000 dix: fix broken XI event delivery during grabs. If an implicit passive grab is active, the XI event mask is in grab->deviceMask. Otherwise, for explicit grabs, the XI event mask is in grab->eventMask. Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 29ec14625111a8ae600d245ccbf905f059074d7c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 29 13:26:22 2009 +1000 Xi: passively grabbing slave devices must be possible. There's use-cases where this is useful, so take the check out preventing that. Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 235cf5713a8fe535c439628cce9ea5b42432acb1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 29 12:09:06 2009 +1000 dix: init inputMasks to NULL to avoid random value dereference. If the XI2 type is 0 (e.g. proximity events), inputMasks is never set and may not be NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 68d86adbe8d84099812c37a04098f2ab5ccc45a4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 29 12:03:07 2009 +1000 dix: GetProximityEvents doesn't need extra events for valuators. With internal events, we only have one event for all the data, no need to calculate for extra events. Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 71a83d68ab07536c0778d13cd7da974c40e77457 Author: Adam Jackson <ajax@redhat.com> Date: Thu May 28 15:32:03 2009 -0400 xfree86: Remove loader symbol list ABI stubs These have been nops since 2006 and functionally void since 7.0. commit d7aef3f663f4b5d861799f8615dcd301d5ce2906 Merge: a25f248 e08c6a0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 28 17:20:58 2009 +1000 Merge branch 'master' into xi2 Conflicts: Xext/geext.c Xi/chdevcur.c Xi/extgrbdev.c Xi/xiproperty.c configure.ac dix/ptrveloc.c hw/xfree86/common/xf86Config.c mi/mipointer.h test/input.c xkb/xkb.c commit a25f248fc3bd0375d91ca8a44320200d445ecfbb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 27 15:47:12 2009 +1000 Xi: Send Enter or Leave events with XIPassive(Un)grabNotify If a passive enter or focus in grab activates, send additional enter or focus events with mode XIPassiveGrabNotify to the grabbing client. Likewise, if the grab deactivates, send additional leave or focus out events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2107becb0ce2ffda001be65728c53563496d8d50 Author: Adam Jackson <ajax@redhat.com> Date: Wed May 27 17:13:19 2009 -0400 xfree86: Remove unused (and useless) xf86{Add,Delete}ModuleInfo commit e08c6a0752772745f35f7afcf6c2b1c927b91cc0 Author: Federico Mena Quintero <federico@novell.com> Date: Mon May 4 19:24:47 2009 -0500 randr: bug #21554 - re-probe outputs when coming back from laptop unsuspend Make xf86 RANDR wrap the EnterVT call chain, so it can re-probe the outputs when a laptop comes back from suspend/unsuspend (actually, any time that we enter our VT again). The X server should then send RR* events to clients, so they can cope with a monitor that was unplugged while the laptop was suspended. Signed-off-by: Federico Mena Quintero <federico@novell.com> commit b12010e10f38951358b48ff1076c026f943b7cc3 Merge: 6e69272 f1441b8 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Wed May 27 15:56:30 2009 -0400 Merge branch 'master' of git+ssh://sandmann@git.freedesktop.org/git/xorg/xserver commit 6e6927247359cc0db47501fb9d2dbb7856aa5985 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Wed May 27 15:51:19 2009 -0400 Fix alpha map computation in miComputeCompositeRegion() According to the RENDER spec, the origin of the alpha map is interpreted relative to the origin of the drawable of the image, not the origin of the drawable of the alpha map. This commit fixes that and adds an alpha-test.c test program. The only use of alpha maps I have been able to find is in Qt and they don't use a non-zero alpha origin. commit f1441b83538e6ba8a1557c4f5ea50c53a1837087 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed May 27 10:06:10 2009 -0700 XQuartz: More localization updates (cherry picked from commit b107390c9f30571902556b4d053e62d345a06254) commit 996357e905c1082479bb238110b93bc170b8cb84 Author: Joe Krahn <jkrahn@nc.rr.com> Date: Tue Jan 20 17:22:37 2009 +0000 Cygwin/X: Update icons directly, rather than modifying the window's class Update icons directly to windows rather than modifying the window's class. Respect custom icons overriden via the configuration file. fd.o bugzilla #4491 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 9955252564922e7e8702dfb6eab52c75605a4a22 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 5 17:55:58 2009 +0000 Cygwin/X: Remove unused TimeSinceLastInputEvent() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 966c8fccf16e77c8f459b4b175718323f2ec5d58 Author: Colin Harrison <colin.harrison@virgin.net> Date: Mon Jan 5 18:04:42 2009 +0000 Xming: Fix some log spam Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d190a27a33ab8c198568baf184fad14df57e24ad Author: Colin Harrison <colin.harrison@virgin.net> Date: Thu Jan 29 11:00:49 2009 +0000 Xming: Various tidy ups in winClipboardFlushXEvents() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit fbe9ed27b1c2f932a74aa6ced134ecec021a3fc1 Author: Colin Harrison <colin.harrison@virgin.net> Date: Thu Jan 29 10:55:38 2009 +0000 Xming: Avoid log spam if a windows application won't provide CF_UNICODETEXT clipboard format Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 71ba9856a4f01aa7a42f1178c8da98a2e5ac23ae Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 3 15:52:11 2009 +0000 Xming: Cache atom lookups in clipboard integration code Cache the CLIPBOARD atom lookups in winClipboardWindowProc() Cache atom lookups in winClipboardFlushXEvents() Recache on server regeneration Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 4ec110327bdc4f2617cd6116539812d7ef96b24e Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Jan 4 18:29:49 2009 +0000 Xming: Prevent the mouse wheel from stalling when another window is minimized. Fix internal WM to prevent the mouse wheel from stalling when another window is minimized. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 888e6961a4ee76d05d212cfb946f089caafb3f69 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Jan 7 18:29:16 2009 +0000 Cygwin/X: Correctly allow for the native window frame width in ValidateSizing() Fix internal WM to correctly calculate the native window border when validating window sizing Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit a72865868f03b675f86990476fcee601822894b3 Author: Joe Krahn <jkrahn@nc.rr.com> Date: Tue Jan 20 17:09:43 2009 +0000 Cygwin/X: Consolidate dialog initialization in winInitDialog() Changed windialogs.c to set icons via window properties rather than class properties, and use LoadImage() for small icons, because LoadIcon() can only open large icons. Since this code is redundant across the dialogs, I put it in the winCenterDialog function, along with a few other redundant instructions, and renamed in winInitDialog(). Also, don't bogusly put our dialogs at the center of the virtual desktop if we are on a multimonitor system (this causes the dialog to end up split across two monitors in a dual-monitor side-by-side setup) Corrections to use HWND_TOPMOST instead of HWND_TOP and not to use SWP_NOZORDER from Colin Harrison fd.o bugzilla #4491 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d053c3b35f730fdaddd22f841dbd8ed6c9a07ba0 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Nov 2 20:46:40 2008 +0000 Xming: Slightly adjust the formatting of the logged command line Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit a7e23a79c1fc429aedbf9b6c0e78b1c8d7e02238 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 26 14:42:25 2009 +1000 Xi: Add support for Enter and FocusIn grabs. Enter grabs are checked for in CheckMotion(), each time the sprite window changes the current grab is deactivated (if applicable) and the new grab is activated (if applicable). Exception - if the grab is on a parent window of the current window since we keep the grab across descendants. Since CheckMotion() may change the grab status of a device, we mustn't get "dev->deviceGrab.grab" in ProcessOtherEvents until after CheckMotion(). FocusIn grabs are checked in much the same manner. The event delivery for grabs replaces the NotifyNormal on window change with a NotifyGrab on window change. Note that this happens before the grab activates, so the EnterNotify(NotifyGrab) is still delivered to the window, not to the grabbing client. This is in line with the core protocol semantics for NotifyGrab events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ec2fe9660dbc0c16cdaca33b3b878011857e0fe2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 27 14:18:51 2009 +1000 Require inputproto 1.9.99.10 commit 0ef6ba9f3b9e68307bfe623e12dc36d44440e97f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 27 11:15:54 2009 +1000 Xi: set the passive grab's resource mask on ungrabbing. Not having the resource mask set means we never match an existing grab, hence we never actually ungrab. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1f61d6647f25add487c5cae9739643a6e33ef9f7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 27 11:15:23 2009 +1000 Xi: use GetMaster(MASTER_KEYBOARD) to get the modifier device for XI2 pgrabs Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bedfd561fa534b65baea45c4a05b1752ef172c45 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 26 15:28:33 2009 +1000 dix: fix wrong cast of eventMask into CreateGrab. commit 023f959e6812e63f9d38b078158275bc13d238ae Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 26 14:56:40 2009 +1000 Xi: fix an inputInfo.keyboard usage. In the case of a RevertToFollowKeyboard, the master device should be used (since this is the closest equivalent to the VCK as before). Only if the master keyboard is the same as the device, revert to the VCK itself. commit b3463fd6a89d50a7562c357aeb5314ce0fd6493d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 26 13:58:04 2009 +1000 dix: convert window coordinates to FP1616 before calculating event_x/y root_x/y are already in FP1616 at this point. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 10b5e981016132b4c07ad9ce68646d0a385e9c24 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 26 11:12:08 2009 +1000 dix: take grabs into account for XI_Enter/Leave events. commit 1815defdb2f19e79f4ec0354d188ea763ff1f15e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 26 10:08:46 2009 +1000 Xi: only deactivate passive grabs if the event type matches. This didn't use to be a problem when devices could only be pointers or keyboards, not both. Nowadays, slave devices may have both buttons and keyboards, and in this case we don't want to deactivate a passive keyboard grab when a button release is detected. commit 9dc3810a034f067096d71b33b0b47f1f52092fe6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 27 13:53:46 2009 +1000 dix: set the right grab event type for implicit passive grabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6583477035234e23ead2fad9db7a07e5862447a4 Author: Nicolai Hähnle <nhaehnle@gmail.com> Date: Sat May 23 13:35:24 2009 +0200 Remove reference to non-existing requestLog and requestLogIndex These fields were removed in 252ec504817e05b185e4896a2d899e9c00b8aeef. Signed-off-by: Nicolai Haehnle <nhaehnle@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 53e821ab4a41cbc85932b9ef150311bc2e57c108 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 25 12:20:37 2009 +1000 Xi: add request processing for XIGetSelectedEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b377994336c978875dd786f4a4a9ef2e7b20e32c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 25 13:55:17 2009 +1000 Xi: advance by the right number of bytes when trawling XI2 event masks. The wire layout is [struct xXIEventMask][mask bytes]. So the pointer needs to not only be advanced by the mask bytes, but also by the size of the struct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 12e725d08b4cf7dbb7f09b9ec09fa1b621156ea9 Author: Julien Cristau <jcristau@debian.org> Date: Fri May 22 09:54:38 2009 +0200 randr: fix server crash in RRGetScreenInfo We don't return rates to randr < 1.1 clients, so don't allocate space for them. This fixes a FatalError due to not all allocated space being used. X.Org bug#21861 <http://bugs.freedesktop.org/show_bug.cgi?id=21861> Reported-by: Guillaume Quintin <coincoin169g@gmail.com> Signed-off-by: Julien Cristau <jcristau@debian.org> commit c70511931ca1441878daed50e710fa514f6ab077 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun May 24 10:32:38 2009 +0200 fix typo in cabff9007 which led to an unintialized memory read and a crash. commit 99e22b86c5f1a3653f3caaf01368a777d2b208d0 Author: Adam Jackson <ajax@redhat.com> Date: Fri May 22 12:01:55 2009 -0400 EDID: Add modes from Established Timings III descriptor to mode pool EDID 1.4, section 3.10.3.9 commit b395da91c531d633ec47bb5a51e361d321663a3a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 22 15:24:46 2009 +1000 Xi: silence two compiler warnings chdevcur.c:97: warning: ‘SecurityLookupIDByType’ is deprecated (declared at ../include/resource.h:269) xiproperty.c:200: warning: passing argument 2 of ‘GetEventFilter’ from incompatible pointer type Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4a36db60774640ea92a2133a3b08fbf1a48d2cb6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 22 15:16:43 2009 +1000 os: fix compiler warning "too few arguments to format" Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit da0d3baf71b34657cc235d6c6b37d548541f9449 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 21 14:11:27 2009 +1000 dix: protect event generation against single-valuator devices. If we have a single-axis device and it sends events it should not access non-existant memory. commit b25e29e8014927815d4fdc9c416bfeb2af0ecba6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 21 12:07:03 2009 +1000 mi: use GetMaster() from MIPOINTER and MISPRITE. Both may in some cases be called for a SD attached to a master keyboard. In this case, we need to get the right master device (i.e. the pointer). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c9df51b070377ca33e48644dbc842b6e3dfb2975 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 21 11:16:37 2009 +1000 input: allow for master pointers to not have a button class. There's devices (e.g. some barcode readers) that have axes but no buttons. When such a device sends a motion event, the valuator and button class is copied into the master pointer (i.e. removing the button class). So we need a couple of extra sanity checks for the button class to exist. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ebe45e1a72a81ad22413e5d0514869b3e45a69b7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 10:55:03 2009 +1000 input: introduce partial class copying depending on the event. Copying all classes into the master device has drawbacks for hybrid devices (devices that are both mice and keyboards). If such a device posts an event, it's key classes are moved into the VCP. The key event itself is unaffected by keyboard grabs and the like. Partial class copying copies depending on the event and copies the classes into the right master device (i.e. the VCK for key events, the VCP for pointer events). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc63c8a4570c989f19a036965854bceb9800ce19 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 12:33:49 2009 +1000 dix: introduce GetMaster() For hybrid devices (keys + buttons/axes) the attached master device is generally the wrong one. One shouldn't post a button event through a keyboard and vice versa. GetMaster(dev) returns the right master device for the given type needed. This may be the MD paired with this device's MD. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d79318f269d959d566ec66239b4c985afd61b259 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 21 08:29:14 2009 +1000 dix: Add a deviceid to the DeviceChangedEvent. ChangeDeviceId would actually overwrite the flags field if deviceid wasn't present. Aside from the event of course not telling which device generated it in the first place. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit eeffb83fea2d87070beafd0c692fb0ad54d8335b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 18 20:03:07 2009 +1000 ABI_XINPUT_VERSION 6 commit 438a4eafa5d14ab676827f7a5d58782c02db4cdf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 17:02:50 2009 +1000 input: remove nested union from InternalEvent. There's no need for internal events to be a struct with a single nested union, we might as well make the union itself the InternalEvent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b12d302df8283186ce87882c29b2b0294adb2770 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 15:28:16 2009 +1000 Input: rename DeviceIntRec->isMaster to ->type. isMaster is not enough as long as we differ between master pointers and keyboard. With flexible device classes, the usual checks for whether a master device is a pointer (currently check for ->button, ->valuators or ->key) do not work as an SD may post an event through a master and mess this check up. Example, a device with valuators but no buttons would remove the button class from the VCP and thus result in the IsPointerDevice(inputInfo.pointer) == FALSE. This will become worse in the future when new device classes are introduced that aren't provided in the current system (e.g. a switch class). This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an IsMaster(dev). commit add2defac7e59dcb355e5ba12b6de60861741d57 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 16:23:38 2009 +1000 Split the signal-handler's lastSlave out into a separate variable. dev->u.lastSlave was not signal safe since it was accessed by the DIX and during signal handling. Replaced with: 'dev->last.slave' for the signal handler's lastSlave (used to generate DeviceChangedEvents), . 'dev->u.lastSlave' for the DIX lastSlave (currently only used in change_modmap) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 525aa17f804d37d1cfcbbf6b8e6cddb45e999b20 Author: Tomas Janousek <tomi@nomi.cz> Date: Wed May 20 15:03:01 2009 +0200 Bug #6428, #16458, #21464: Fix crash due to uninitialized VModMap fields. In ProcXkbGetKbdByName, mrep.firstVModMapKey, .nVModMapKeys and .totalVModMapKeys were not initialized, contained random values and caused accesses to unallocated and later modified memory, causing XkbSizeVirtualModMap and XkbWriteVirtualModMap to see different number of nonzero values, resulting in writes past the end of an array in XkbSendMap. This patch initializes those values sensibly and reverts commits 5c0a2088 and 6dd4fc46, which have been plain non-sense. Signed-off-by: Tomas Janousek <tomi@nomi.cz> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7db55a0806c82bd4143c8bf1b8eb2b62e456ad9a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 14:38:25 2009 +1000 dix: remove superfluous loop in change_modmap. A device can only be attached to a single master device. So instead of looping and searching for the master device, we can just use dev->u.master directly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cabff9007a4abad026b450a4aab155c7bcd94326 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 15 08:33:07 2009 +1000 xfree86: treat other drivers as mouse drivers in the config. Historically, if no input device was referenced in the ServerLayout, the server would pick the first "mouse" device found in the xorg.conf. This patch gives evdev, synaptics, vmmouse and void the same status. If there is a section in the config file using this driver - use it as the core pointer. Device selection is in driver-order, not in config-order. If a "mouse" device is listed after a "synaptics" device, the "mouse" device gets preference. This replicates the original behaviour. This code only takes effect if AllowEmptyInput is off and there is no core pointer in the server layout. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a8bd1e1f96d8e5380972a7dce8d9940cd912aa09 Author: Søren Sandmann Pedersen <ssp@l3000.localdomain> Date: Thu May 21 18:21:28 2009 -0400 Fix alpha map computation in miComputeCompositeRegion() According to the RENDER spec, the origin of the alpha map is interpreted relative to the origin of the drawable of the image, not the origin of drawable of the alpha map. The only use of alpha maps I have been able to find is in Qt and they don't use a non-zero alpha origin. commit a2c5ee36b21c2ee5c0468f1b251e74c1412dbecb Author: Adam Jackson <ajax@redhat.com> Date: Thu May 21 10:20:48 2009 -0400 EDID: Be more cautious about finding vendor blocks. Many old monitors zero-fill the detailed descriptors, so check for that to avoid a useless warning like: (WW) RADEON(0): Unknown vendor-specific block 0 commit 73c7398aafa050950ad614483fb0d5bdd2da97ca Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 10:40:50 2009 +1000 dix: 'namespace' HAS_OLD_SLAVE and HAS_NEW_SLAVE. We need more flags for this in the near future, so let's namespace them now. commit 5b5e3fa2771383a85afff679be34df19d3a4e290 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 15 08:33:07 2009 +1000 xfree86: treat other drivers as mouse drivers in the config. Historically, if no input device was referenced in the ServerLayout, the server would pick the first "mouse" device found in the xorg.conf. This patch gives evdev, synaptics, vmmouse and void the same status. If there is a section in the config file using this driver - use it as the core pointer. Device selection is in driver-order, not in config-order. If a "mouse" device is listed after a "synaptics" device, the "mouse" device gets preference. This replicates the original behaviour. This code only takes effect if AllowEmptyInput is off and there is no core pointer in the server layout. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1cce55cc0333a026474100cf2f784e220fd96473 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 14:07:03 2009 +1000 input: rename device->type to device->xinput_type. This type is only used in XI to give a hint of what type this device may be. Call it xinput_type for clarity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 81b3b0cce088866dc3cda099d7c8d6655849fd43 Author: Tomas Janousek <tomi@nomi.cz> Date: Wed May 20 15:03:01 2009 +0200 Bug #6428, #16458, #21464: Fix crash due to uninitialized VModMap fields. In ProcXkbGetKbdByName, mrep.firstVModMapKey, .nVModMapKeys and .totalVModMapKeys were not initialized, contained random values and caused accesses to unallocated and later modified memory, causing XkbSizeVirtualModMap and XkbWriteVirtualModMap to see different number of nonzero values, resulting in writes past the end of an array in XkbSendMap. This patch initializes those values sensibly and reverts commits 5c0a2088 and 6dd4fc46, which have been plain non-sense. Signed-off-by: Tomas Janousek <tomi@nomi.cz> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 79138eec1b49cbaca6a16f2bdd8579b5828aeb28 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Mar 10 16:03:26 2009 +0100 randr: Setting gamma: inverse logic looks more sane commit c2785ae7eb6197bbfc75e92e99fffbb8ad8064da Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 14:29:13 2009 +1000 dix: refuse events from disabled devices. If the device is disabled ("off"), it must not send events to a client. The driver shouldn't send events in that case anyway, but just to make sure we simply drop events coming while the device is disabled. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 47a89b1cba67a43ddc225f7e1b5d2b3b217c8d93 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 13:59:22 2009 +1000 Xi: remove DeviceIsPointerType This approach is broken anyway. DIPT only checked for the XInput type "MOUSE" and the only user of this is xf86ActivateDevice when it sets the Activate/DeactivateGrab functions. Since synaptics and wacom set their own types, evdev only sets MOUSE for, well, mice half the devices didn't have this set correctly anyway. Instead, ActivatePointerGrab should be merged together with ActivateKeyboardGrab. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7b891e450f005688e41e61016e6d3e394c67f6be Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 14:23:16 2009 +1000 dix: Remove obsolete comment CorePointerProc doesn't back up the device classes anymore. commit 42719ce5c715ac3a0c74c3c7df872d35e0449de9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 20 14:38:25 2009 +1000 dix: remove superfluous loop in change_modmap. A device can only be attached to a single master device. So instead of looping and searching for the master device, we can just use dev->u.master directly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 22a33a7250f879b8f3eb84176a1dc57027d8cfe4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue May 19 22:45:26 2009 -0400 glx: Register names for the GLX resource types. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 77e90261d5f91e1170c6e02deb0e3739c24fcfd6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue May 19 19:36:03 2009 -0400 dix/events.c: Use wClient where appropriate. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 3cea176d5abcb0f14eefbdcbe17fed0847524dd4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue May 19 19:30:33 2009 -0400 xace: Fix a bad device access hook call. Add a proper access mode, and reverse the logic of the return value. Zero ("Success") is returned on success from the hook calls. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> commit 4addfcd633484b7f53b5df1b92bfca8bfc1dc48d Author: Michel Dänzer <daenzer@vmware.com> Date: Mon May 18 17:53:35 2009 +0200 EXA: Allocate from the end of free offscreen memory rather than from the start. This way we don't always need to scan over previously allocated areas when looking for an available one, and there might be less fragmentation. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 510cbd43cd4e34bd459e8f74ab2855714b4ca95d Author: Michel Dänzer <daenzer@vmware.com> Date: Mon May 18 17:48:57 2009 +0200 EXA: Defragment offscreen memory. At most once per second, under the following circumstances: * We can't satisfy an offscreen memory allocation, but there seems to be enough offscreen memory available in total. or * The server has been idle for at least 100ms, and there is more than one available offscreen area. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 8331bde0adeccefb275c4d707e7b2cb1d95b1581 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri May 15 21:36:28 2009 +0100 Cygwin/X: link with libmain.a to provide main() Commit 987579c930bda803427a28cb82773c389f5110d6 moves main.c into into libmain.a to be linked with separately, and updates the various DDXs to link with libmain.a, except Xwin, which also needs this change. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b89dcfbfbd38f8d19f1d4f24f81820b1048572c8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 18 16:07:08 2009 +1000 Xi: fix length field in XIQueryPointer. Buttons append 4-byte units to the end of the reply, they need to be included too. Reported-by: Mark Dokter Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 33fcaaaea5ea30be39156ecfdbcca891b47ab465 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 18 16:05:35 2009 +1000 Fix missing parentheses in FP1616 macro. Missing parens led to interesting results if an expression instead of a constant was passed in (ProcXIQueryPointer for example). commit 6258bb1d6bb78ea4ba1d33470bc74e9b711b25f2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 15 20:24:45 2009 +1000 require inputproto 1.9.99.9 commit e7e94ff5fd3205a9ee01fe9342d9f3a426b0a068 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 14 21:45:35 2009 +1000 Xi: set the right length for the XIQueryPointer reply. commit 00ab04d73c612ac85e024105015bdb7c79e8874b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 14 16:24:35 2009 +1000 Include full modifier + button state in XIQueryPointer. commit de78aab0ea3a2d8c61222493f25911258dea65a2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 14 15:53:00 2009 +1000 Xi: take the paired device as modifier device only for MD pointers. commit 0e089f9ceb0edec532078c6e1df7f642f7220fb5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 14 15:29:20 2009 +1000 Xi: check cursor and grab_window before attempting the passive grab. Both values need to fail the request, so we need to check them before looping through the modifier masks. Otherwise, a wrong grab_window will show up in each failed modifier return but not actually cause an error. commit 5c3e7289801c958e2c70e2629d3ebee122449be8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 13 16:54:01 2009 +1000 dix: count must be 1 if we have an XI2 match. This fixes events that activated a grab not getting delivered to the client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e083a0d0692baa5ad29002a38293b36dd3b4c06f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 13 15:23:42 2009 +1000 Xi: set the correct length for XIPassiveGrab replies. commit 8ff1bff8f462b15e05fc298704e1e40cb244587f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 12 21:33:54 2009 +1000 Update to new XI2 names commit bbf266cca3de726e3eb932d66dd5b8981ef40fa8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 12 21:24:07 2009 +1000 mi: un-deprecate miPointerWarpCursor This function was deprecated in ef68273f5bdb27a492ec0b69548ec4fbede46c08 because it didn't take a device argument. The device argument was added in 1c7568b8a1417257fa67c7fca69aa253099b9461 though, so the deprecation is obsolete. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 273890924b8ed6f8b7949c0322c8258b9e6f8630 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 12 16:09:35 2009 +1000 input: reduce the number of superfluous hierarchy events There's only two reasons for hierarchy events: - device is added, removed, etc. In this case we want to send the event as it happens. - devices are added in a XIChangeDeviceHierarchy request. In this case we only want one event cumulating all changes. commit 033a2b12fcd02fa9a2c2f20a352bec0a43074512 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 12 14:50:57 2009 +1000 Xi: set per-device hierarchy changed flags. Rather than have one field per hierarchy change, XI2 has two fields - one generic one and one per-device that include the device-specific flags. This requires some funky handling for removed devices, but oh well. commit 8fb51feae222ff4f4aa1c440b6973ce7383bbc09 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 11 15:45:46 2009 +1000 xkb: if kbd init failed, NULL out the pointers after freeing them (#21278) Reproducible: Configure a server that uses the keyboard driver with an invalid ruleset, e.g. (Option "XkbRules" "foobar"). Ensure that Option "AllowEmptyInput" is "off" in the ServerFlags or ServerLayout section. Start the server. After failing to init the keymap, the server will try to clean up after the device, double-freeing some xkb structs that have not been reset properly. X.Org Bug 21278 <http://bugs.freedesktop.org/show_bug.cgi?id=21278> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0cea199eda772a5ddd5ce72e4823a00ec14405d4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 11 12:53:56 2009 +1000 kdrive: set Activate/Deactivate grab for input devices (#21591) X.Org Bug 21591 <http://bugs.freedesktop.org/show_bug.cgi?id=21591> commit fdce58ca822f4e43e03e84076190f52d7104e01f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 11 12:51:40 2009 +1000 dix: ensure Activate/DeactivateGrab has a valid value. Xephyr doesn't manually set Activate/DeactivateGrab for new devices, resulting in a NULL-pointer dereference later when a grab is activated. Avoid the segfault by ensuring that the pointer is always valid. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e3f296d91dfe6b827195e1d387e1a04aa73b85c3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat May 9 10:33:20 2009 +1000 xfree86: Remove superfluous ifdef DEBUG checks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2f6253376df45e508284ff7766b186cfc7fb56d6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat May 9 10:33:20 2009 +1000 xfree86: Remove superfluous ifdef DEBUG checks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b1b5ec45c1cb650ccb8c659218f9481379c777d9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 11 12:53:56 2009 +1000 kdrive: set Activate/Deactivate grab for input devices (#21591) X.Org Bug 21591 <http://bugs.freedesktop.org/show_bug.cgi?id=21591> commit 6f9e22049862ee9ac7f604411d005d8bb1b2dd1c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 11 12:51:40 2009 +1000 dix: ensure Activate/DeactivateGrab has a valid value. Xephyr doesn't manually set Activate/DeactivateGrab for new devices, resulting in a NULL-pointer dereference later when a grab is activated. Avoid the segfault by ensuring that the pointer is always valid. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c1d7deca9281ba1df0df1abcea1fe7f841b10ff9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 12 21:24:07 2009 +1000 mi: un-deprecate miPointerWarpCursor This function was deprecated in ef68273f5bdb27a492ec0b69548ec4fbede46c08 because it didn't take a device argument. The device argument was added in 1c7568b8a1417257fa67c7fca69aa253099b9461 though, so the deprecation is obsolete. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8609a4e883e917d1652fbe810108de99bc89713f Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri May 15 11:22:32 2009 -0700 Correct some Sun license notices to Sun's standard X11 license format Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 94c5093c8bc803d0b14429b5a4d07ae46da865cc Author: David Marx <David.Marx@Sun.COM> Date: Wed May 13 17:53:30 2009 -0700 Solaris: Make sure non-inline versions of asm routines end with ret statements Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 2be5eecb4b0f30b9c55d12521415edbb88c1f8fd Author: Julien Cristau <jcristau@debian.org> Date: Fri May 15 17:29:32 2009 +0200 xfree86: add edid quirk for Samsung Syncmaster 2333HD It reports vertical size in cm in the detailed mode. X.Org bug#21750 <http://bugs.freedesktop.org/show_bug.cgi?id=21750> Reported-by: Peter Poklop <Peter.Poklop@gmx.at> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 7c8327f0a75087a85864256a9cea80dd4b86def5 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri May 15 15:48:37 2009 +0200 EXA: Always damage glyph cache pixmap manually after uploading a glyph. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 850675d4de4373e5df95507dbf2cd9affaaf54bc Author: Michel Dänzer <daenzer@vmware.com> Date: Fri May 15 15:48:37 2009 +0200 EXA: Take GC client clip type into account for migration. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18950 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit c1bbac2708bbccbec01cecba39cdf2b8160c1dc3 Author: Matt Turner <mattst88@gmail.com> Date: Thu May 14 16:00:41 2009 -0400 Fix mem_barrier() on Alpha Some clean up (da086901c6579e41b28b1418fa12ebb82744fc87) went a bit too far and removed the needed mem_barrier macro on Alpha. This re-adds it. commit 4cc33190ef1a4207c0f8fc74201cdf2568a239c2 Author: Julien Cristau <jcristau@debian.org> Date: Thu May 14 17:01:57 2009 +0200 xfree86: Add two __FreeBSD_kernel__ checks Debian bug#525475 <http://bugs.debian.org/525475> Reported-by: Petr Salinger <Petr.Salinger@seznam.cz> Signed-off-by: Julien Cristau <jcristau@debian.org> commit ed9aecf8517bf74e943e3e5dd3ee407524e8f122 Author: Adam Jackson <ajax@redhat.com> Date: Thu May 14 06:55:21 2009 -0400 COPYING: SGI FreeB 1.1 -> SGI FreeB 2.0 commit c66cf7b64c7bcb31c81b9fde27cc40c1440753b1 Author: Adam Jackson <ajax@redhat.com> Date: Thu May 14 06:53:08 2009 -0400 Update several of my and/or Red Hat's licenses to standard form. commit 2075d4bf9e53b8baef0b919da6c44771220cd4a5 Author: Michel Dänzer <daenzer@vmware.com> Date: Thu May 14 11:46:41 2009 +0200 glx: If a destroyed window is bound to the current context, make it not current. Avoids subsequent crashes due to stale pointers to the DrawableRec, see https://bugs.freedesktop.org/show_bug.cgi?id=21132#c15 and previous comments. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 2c1190f888515292de01e60fe74657c34b99fd9e Author: Michel Dänzer <daenzer@vmware.com> Date: Thu May 14 11:39:16 2009 +0200 randr12: Initialize and keep track of updates to VidMode extension gamma value. This way clients querying the gamma value via the VidMode extension at least get the last value set via the same, rather than always something bogus. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit fc3ce861cdab8606610726ce7c53f57d950c2407 Author: Michel Dänzer <daenzer@vmware.com> Date: Thu May 14 11:35:25 2009 +0200 randr12: Fix calculation of gamma ramp values. The reciprocal gamma value was missed in the first copy and this mistake was propagated to the second one. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit f3c61377d0fb1f09a18833995556fc9ffd11e097 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue May 12 18:27:09 2009 -0700 COPYING file updates for git master changes since 1.6 branch Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit b746a00cffca5c553b607a8e9c1074294a23b443 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue May 12 16:11:01 2009 -0700 Resync COPYING file with notices in code base as of xorg-server-1.6.1 Remove notices for code no longer in tree (Xprint, Xgl, kdrive, cfb, etc.) Add/update notices for new/changed code in tree Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit f250eea2e90fc50bec5214c2f41132b95edc2c46 Author: Jerome Glisse <glisse@freedesktop.org> Date: Mon May 11 22:52:46 2009 +0200 DRI2: update DRI2 private drawable width & height according to X drawable commit 0952d12717031e9dda9e48123bb922d0f4e81834 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon May 11 15:27:46 2009 -0400 xselinux: Relax ownership restriction on SetSelectionUseContext. Instead, clients should keep track of the selection instances they use. commit ac13145dbcb284293582435409d8a90f276785c5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 11 15:45:46 2009 +1000 xkb: if kbd init failed, NULL out the pointers after freeing them (#21278) Reproducible: Configure a server that uses the keyboard driver with an invalid ruleset, e.g. (Option "XkbRules" "foobar"). Ensure that Option "AllowEmptyInput" is "off" in the ServerFlags or ServerLayout section. Start the server. After failing to init the keymap, the server will try to clean up after the device, double-freeing some xkb structs that have not been reset properly. X.Org Bug 21278 <http://bugs.freedesktop.org/show_bug.cgi?id=21278> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ebfd6688d1927288155221e7a78fbca9f9293952 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Sun May 10 23:27:56 2009 -0400 Make compositing with transformed windows work again. The coordinate translation was broken in pretty much every way imaginable. commit c2b668e6fff11c52f2a3f0dc3f4d1fc2c5bcf3e6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 5 20:27:53 2009 -0700 XQuartz: pbproxy standalone: added missing variable declarations. (cherry picked from commit 2d947d17a3ef5fb8cef959bff0eb08b8bb5b6548) commit 9c5b761c8c86cca56f4b4af272f42ba89c9c3ba5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat May 9 16:19:13 2009 +1000 Revert "xkb: write the _XKB_RF_RULES_PROP to each device." This commit shouldn't have been pushed, we're still sorting out the API we want to use. This reverts commit 876910a951053f0bd31e30098de3da15a1c1f5d6. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1e816065e5ec3b9394dc1fa5815457a664e15fd9 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri May 8 21:31:01 2009 -0700 Don't printf NULL pointers on HAL connection error Fixes Solaris bug 6801386 Xorg core dumps on startup if hald not running http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6801386 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit b680bda34da130ce408783f04214771471e41e8d Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Apr 30 18:49:06 2009 -0700 Fix a couple off-by-one array boundary checks. Error: Write outside array bounds at Xext/geext.c:406 in function 'GEWindowSetMask' [Symbolic analysis] In array dereference of cli->nextSib[extension] with index 'extension' Array size is 128 elements (of 4 bytes each), index <= 128 Error: Buffer overflow at dix/events.c:592 in function 'SetMaskForEvent' [Symbolic analysis] In array dereference of filters[deviceid] with index 'deviceid' Array size is 20 elements (of 512 bytes each), index >= 0 and index <= 20 Error: Read buffer overflow at hw/xfree86/loader/loader.c:226 in function 'LoaderOpen' [Symbolic analysis] In array dereference of refCount[new_handle] with index 'new_handle' Array size is 256 elements (of 4 bytes each), index >= 1 and index <= 256 These bugs were found using the Parfait source code analysis tool. For more information see http://research.sun.com/projects/parfait Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 00bc043fa0398a1d14d46b87da2ff3031a9535dc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 8 10:10:25 2009 +1000 dix: export subpixel precision in XI2 events for root/event coordinates. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bae070914fc27db122e6131ae4838559c4a72f65 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 7 16:52:31 2009 +1000 input: update to inputproto 1.9.99.8 XI2 defines. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 83f32d3972b8bfb0a87069dfb3fcd64b6b7c6424 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 7 10:05:29 2009 +1000 Xi: Add XI2 property requests. commit 9935bec6e860cba9a3cc5baadd372ddb89d72ef0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu May 7 09:43:56 2009 +1000 Xi: split some code out of the XI 1.5 property request processing. This is in preparation for the XI2 property requests that can re-use much of this code. commit f6f1e417063d2d61d65731a7e3ebca3ec2bdaacc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 22:25:28 2009 +1000 Xi: fix copy/paste error causing sizeof against wrong struct. This wrong check may cause BadLength to be returned to the client even if the length is correct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fc0013d744a345199f013ba5b6ef0e44201d0e68 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 16:55:32 2009 +1000 Xi: don't double-swap the XListDeviceProperties reply. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 409012061b7d361a172b20455d4aaa5e47527c42 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 16:42:46 2009 +1000 Xi: add missing break in XI event swapping function Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c3c64978c4a231a3a8c18211d0716df875c75efa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 15:05:06 2009 +1000 Xi: fix a couple of wrong dixLookupDevice permission tags. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0d947aa8e87c5d92b702c60190c8bc5d32c9ba9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 12:07:07 2009 +1000 xfree86: fix xf86PostMotionEventP type checking We only put internal events into the queue now, so let's check for ET_Motion rather than the MotionNotify. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9457ce448988dacea9a3a1c14b6955767118ff31 Author: Simon Thum <simon.thum@gmx.de> Date: Thu Apr 30 13:01:17 2009 +0200 dix: remove superfluous includes from ptrveloc.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ee30e1b102d779403eeda97e007b81e85f006a37 Author: Simon Thum <simon.thum@gmx.de> Date: Thu Apr 30 12:58:48 2009 +0200 dix: fix warning in pointer acceleration newer gcc's warn against how this cast is done (though it eludes me why), and lrintf() is also faster especially on insane processors like the P4 (http://www.mega-nerd.com/FPcast). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5cf70183812541b33a6e83c7e1e3bc6198730cbe Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 5 21:00:31 2009 +1000 xkb: remove _XkbAlloc, _XkbCalloc, _XkbRealloc and _XkbFree We all agree that wrapping is fun, but seriously. One of these days someone will get hurt. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0e31d3906deaee5d9ada66e538b9e93574a4d610 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 5 21:07:07 2009 +1000 xkb: remove some now-useless XFUNCPROTOBEGIN We bring them back if we start rewriting the server in C++, promise. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8b583ca2b21155359c6255f406c96599b277c762 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 22:25:28 2009 +1000 Xi: fix copy/paste error causing sizeof against wrong struct. This wrong check may cause BadLength to be returned to the client even if the length is correct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7ab5e9b97c300bba793a23fa13506b0c77c50ddf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 12:07:07 2009 +1000 xfree86: fix xf86PostMotionEventP type checking We only put internal events into the queue now, so let's check for ET_Motion rather than the MotionNotify. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 50cc8adafca4ba3838d468278d6eb8a4692d2488 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed May 6 16:55:32 2009 +1000 Xi: don't double-swap the XListDeviceProperties reply. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3fc6fcfb267888d65a22ed7c3eda175a2530a3d5 Author: Simon Thum <simon.thum@gmx.de> Date: Wed May 6 10:39:16 2009 +0200 dix: add 'none' pointer acceleration profile with number -1 This is a shorthand for disabling acceleration, while retaining the possiblity to use constant deceleration. If constant deceleration is also unused, it will optimize motion processing. Other possiblities to deactivate acceleration were quite hidden, and didn't always work as expected. E.g. xset m 1 1 would retain adaptive deceleration, while xset m 1 0 would not (in the default profile). Also removes the 'reserved' profile; it was unused and it's trivial to add new ones anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9d1597cbefea6a5e7959f2099c46f1a284def7ad Author: Simon Thum <simon.thum@gmx.de> Date: Thu Apr 30 13:01:17 2009 +0200 dix: remove superfluous includes from ptrveloc.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 35fce4e5c7fa34f98b3e4010c6cb09ce38a9205c Author: Simon Thum <simon.thum@gmx.de> Date: Thu Apr 30 12:58:48 2009 +0200 dix: fix warning in pointer acceleration newer gcc's warn against how this cast is done (though it eludes me why), and lrintf() is also faster especially on insane processors like the P4 (http://www.mega-nerd.com/FPcast). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d220d6907d1d5138d1528c48b739e77f65616225 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 4 17:38:02 2009 +1000 Xi: add GrabButton and GrabKeysym code. We don't do keycode grabs in XI2, they're pointless. commit 1b593ced171d02f1d00034f0f733060706bb6d41 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 5 16:57:46 2009 +1000 Xi: access the prev_state to get group/modifier state for key events. Key events may change the modifier state, so we need to get the prev_state for those (i.e. without the changes by the event already applied). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 35a4b8e7f4526a92d44cb16a783f21030cd1f6df Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 5 16:51:59 2009 +1000 xkb: remove oldState from XkbHandleActions. I really don't know what the purpose of this variable is or was, aside from potentially clobbering up our key state since there's a path where it may be used uninitialised. Also, this means that xkbi->prev_state is now accessible from the DIX with meaningful data. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d523fbe428e4513d85402caa83e9349256b680cc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 4 17:00:57 2009 +1000 test: add test for xi2 struct sizes. commit 1b1b20d6e3e696e4437a9ef56128cde70a485f66 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 5 13:47:55 2009 +1000 Change glib require for tests to auto. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 749cae82204f347248c815b1068ffcae9825fe70 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 30 14:58:00 2009 +1000 mi: don't crash if we're trying to update the pointer for a keyboard. If a device doesn't have a pointer, just return. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7ecedb0f2ee5b53513205d1f0aa381451893b9c5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 14:35:12 2009 +1000 include: up the number of max. input devices to 40. With the Xtest virtual slave devices we have 4 devices for each MD pointer/keyboard pair, plus the AllDevices and AllMasterDevices reserved deviceids. It's quite easy to hit the current limit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a38d33f6ac765bc5a3296b325e2c9b4a6a10ebf1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 15:24:02 2009 +1000 Xext: shut up compiler warnings in xtest.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 14d5471981151b27678de826daa078977217477a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 15:22:37 2009 +1000 Xext: return BadDevice from XTest if we don't have keys/buttons/valuators. BadDevice is an XI error, but this cannot happen for core XTest fake input anyway since the device will be the matching virtual XTest slave device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f1bed0959e803784af142a0f45177ee3b675d78a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 15:15:04 2009 +1000 Xext: fix core Xtest button presses, don't call PickPointer. We already did the device selection before, so dev should be the XTest virtual pointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 94648bb797d94b025746c60679c584e5be2fae28 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Mon May 4 15:38:22 2009 -0700 Don't prepare outputs & crtcs if set_mode_major is present A driver with this hook will take care of preparing the outputs & crtcs, so calling the prepare functions will just cause unnecessary flicker. Fixes bug #21077 commit 7d85169c7ab1d05c21fdbb2877ffd79f344dbb6b Author: Michel Dänzer <daenzer@vmware.com> Date: Mon May 4 10:14:43 2009 +0200 Fix typo in ProcRenderCreateAnimCursor. commit 59358de4b68a01452bf68593beb83605087ebc8f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 4 17:30:19 2009 +1000 input: ensure various ProcUngrabKey/Buttons have the right grabtype set. commit 834ea071b619506e0bef5bdbf0e3c59831cf6e99 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon May 4 15:58:15 2009 +1000 dix: if grab types differ, two grabs cannot be the same. commit 63a3c727b35d1ffd8a850a5177bd6623cd78b179 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 15:24:02 2009 +1000 Xext: shut up compiler warnings in xtest.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 226dd90597ef29998ac5db15c5457aad3fe9729e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 15:22:37 2009 +1000 Xext: return BadDevice from XTest if we don't have keys/buttons/valuators. BadDevice is an XI error, but this cannot happen for core XTest fake input anyway since the device will be the matching virtual XTest slave device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0fdff0a47a57a0096974ee83e07fefbad03075dd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 15:15:04 2009 +1000 Xext: fix core Xtest button presses, don't call PickPointer. We already did the device selection before, so dev should be the XTest virtual pointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f0124ed93cdcee8d22a6690e639a3f60b9a63c54 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 14:35:12 2009 +1000 include: up the number of max. input devices to 40. With the Xtest virtual slave devices we have 4 devices for each MD pointer/keyboard pair, plus the AllDevices and AllMasterDevices reserved deviceids. It's quite easy to hit the current limit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 08cd846000286eb5e07cc8d8cb313aff2d6e7faf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 1 11:06:06 2009 +1000 dix: only free the old cursor if the grab was successful. Testcase: start thunderbird and move a message around, crashes after two or three moves. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 557dbadf3be273255e8fdb12d9321f4e88bf2b65 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Sat May 2 00:26:18 2009 -0700 XkbSetNamedIndicator should ignore SD's without LED's When ProcXkbSetNamedIndicator is called on a core device, and we walk the slaves to set the LED's on each of them, ignore any slaves that do not have either a KbdFeedbackCtrl or LedCtrl structure. (This is much more critical in xserver-1.5-branch, where we walk *all* devices, not just the slaves of the specified master, and thus return failure when setting an LED on the Core Keyboard and hit a xf86-input-mouse device with no LED's to set.) Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0d9d3f3e361f769822caedccf4c2a58cc9930ecc Author: Ian Romanick <ian.d.romanick@intel.com> Date: Mon Apr 27 15:11:10 2009 -0700 DRI2: Force allocation of real-front buffer for non-windows as well For redirected rendering we end up with pixmaps (which the app thinks are windows) that are double buffered. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Tested-by: Pierre Willenbrock <pierre@pirsoft.de> commit 3d30789a05a730a03faa6058c73a5eda36ef3779 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 30 14:58:00 2009 +1000 mi: don't crash if we're trying to update the pointer for a keyboard. If a device doesn't have a pointer, just return. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 876910a951053f0bd31e30098de3da15a1c1f5d6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 30 14:46:45 2009 +1000 xkb: write the _XKB_RF_RULES_PROP to each device. We only have one root window and writing the rules used to the same property for each device is quite pointless if you don't have the same RMLVO on all devices. So let's be sensible and write the same property to the device too, so at least we know which device got loaded with which RMLVO. commit 44044adc92e6bb6537f48c84727523d5cb23528c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 30 11:39:50 2009 +1000 xfree86: print a message if NIDR fails due to AutoAddDevices off. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 43dbbc30327f826068bc7cd2cdaf870ed61b4522 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 28 21:01:36 2009 +1000 Xi: fix typo in ProcXIGrabDevice Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6a618929a0c06ba0d6dac13d7e644cd9658d98ed Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 28 16:49:45 2009 +1000 input: reshuffle CreateGrab and friends to take a GrabParameters param. This is cleaning up work in preparation for XI2 passive grabs. commit e8e26f700c9c70d3f1bb53bdb71d1100f5c43a69 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 26 21:43:25 2009 +1000 Xi: split some grab parameter checking out of GrabButton and GrabKey. commit 57aff88c7d0761e590806d07bee1c9410680c89f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Apr 29 01:04:37 2009 -0400 Fix most remaining deprecated resource lookups. Callsites updated to use dixLookupResourceBy{Type,Class}. TODO: Audit access modes to make sure they reflect the usage. commit 1abe0ee3da5e1268c7315f841d31337ea6524cf0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Apr 28 23:51:40 2009 -0400 kdrive: fix Xvfb build with separate libmain. commit 737b49199a05299486064e6e762cf2a2f6f95be6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 15:40:24 2009 +1000 xfree86: restore default off for DontZap Zapping is triggered by xkb these days, so note in the man page that it's the Terminate_Server action. Since it's XKB, personal preferences towards or against zapping should be achieved through xkb rulesets. If Terminate_Server is not in the xkb actions, then we can't zap anyway and we don't need a default of DontZap "on". This patch restores the old meaning of DontZap - disallow zapping altogether, regardless of XKB's current keymap. Ideally, this patch should be accompanied by b0f64bdab00db652e in xkeyboard-config. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 98a1fa994158feca8bc80a10296a7675465c0e56 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 21 22:18:23 2009 +1000 test: add InternalEvent to core event conversion tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 990e8362a76fadc173e890d9052a2e5274b6eac5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 16 11:41:58 2009 +1000 test: add a simple test to verify device axis intialization. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4eac0df060b897470fb01cfd3b70f500da757c74 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 15 17:21:08 2009 +1000 Add a test-suite for in-server unit-testing. This patch adds a test/ directory that contains the setup for a unit-testing suite designed for in-server unit-testing. All functions available to the X server are available to the test binaries through static linking. This test suite uses the glib testing framework. Do not use glib calls outside of the test/ directory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c2c515ead38d9a6c9eae0b83aa7a82208f177b7e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 22 13:26:40 2009 +1000 dix: remove all but main() from main.c All other functions are pushed into where they seemed to fit. main.c is now linked separately into libmain.a and linked in by the various DDXs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dc2767d1c5db60385867c76ba2de507fe0cb8a90 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 21 22:18:23 2009 +1000 test: add InternalEvent to core event conversion tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1127ca097cb75450bcccfc5f5d82e435de2fb5b7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 16 11:41:58 2009 +1000 test: add a simple test to verify device axis intialization. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4124c465a85713fe44843a16c5e2b13ece17e9d2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 15 17:21:08 2009 +1000 Add a test-suite for in-server unit-testing. This patch adds a test/ directory that contains the setup for a unit-testing suite designed for in-server unit-testing. All functions available to the X server are available to the test binaries through static linking. This test suite uses the glib testing framework. Do not use glib calls outside of the test/ directory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 987579c930bda803427a28cb82773c389f5110d6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 22 13:26:40 2009 +1000 dix: remove all but main() from main.c All other functions are pushed into where they seemed to fit. main.c is now linked separately into libmain.a and linked in by the various DDXs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2a2a7fa6856b2e1954e904577535118f20cd9133 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Apr 27 20:23:53 2009 -0700 Solaris: use <sys/agpgart.h> instead of stale copy in Xorg sources Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 707af5f8c5fae3b6c4c5125a91917667bb0ab908 Author: Simon Farnsworth <simon.farnsworth@onelan.co.uk> Date: Thu Apr 23 16:15:01 2009 +0100 Make the cursor completely optional For embedded use, it's convenient to be able to disable the cursor completely, without having to audit and fix up all your third-party code (e.g. Mozilla Firefox). Add -nocursor and -cursor server options to enable and disable the cursor. The default is still -cursor, but embedded users can run the server with -nocursor to hide the cursor regardless of what application developers do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 40a8f2f4088aa353de733a11327b628ef13a52e6 Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Sun Apr 19 21:15:22 2009 +0200 Fix obvious copypasta Reviewed-by: Ian Romanick <idr@freedesktop.org> commit a8cf63fd18b0ddadbadf7b47d620159854920050 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Apr 23 14:57:04 2009 -0700 Export CompositeRegisterAlternateVisuals. Drivers need this if they add visuals that require implicit redirection. Add a new SDK header, compositeext.h, to contain the prototype for this function. commit 48573e7ea13e279593249036e6d30f1d7507882f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 26 21:32:37 2009 +1000 Xi: swap stuff->cursor in SProcXIGrabDevice commit ff6c7764c2909e4126403b7211faa6c58556b341 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Fri Apr 24 12:49:19 2009 -0700 DRI2: Implement protocol for DRI2GetBuffersWithFormat This change implements the protocol for DRI2GetBuffersWithFormat, but the bulk of the differences are the changes to the extension / driver interface to make this function work. The old CreateBuffers and DeleteBuffers routines are replaced with CreateBuffer and DeleteBuffer (both singular). This allows drivers to allocate buffers for a drawable one at a time. As a result, 3D drivers can now allocate the (fake) front-buffer for a window only when it is needed. Since 3D drivers only ask for the front-buffer on demand, the real front-buffer is always created. This allows CopyRegion impelemenations of SwapBuffers to continue working. As with previous version of this code, if the client asks for the front-buffer for a window, we instead give it the fake front-buffer. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kristian Høgsberg <krh@redhat.com> commit 28ddfc88d8d547941c7f4713db527a3c2f9ec35a Author: Ian Romanick <ian.d.romanick@intel.com> Date: Fri Apr 24 12:09:21 2009 -0700 DRI2: Add interface for drivers to query DRI2 extension version Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit a1c98f7fa9aa0cd5075ef2054c5d2be4d1e740f0 Author: Joel Bosveld <Joel.Bosveld@gmail.com> Date: Fri Apr 24 10:12:26 2009 -0700 Correct fcntl(F_SETOWN) error check in non-Solaris sigio code commit 64b7f96dca accidentally inverted the comparison, could result in crashes on some systems later on. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 64b7f96dca23d2b33e0b8a8785d628d9a2f50e7b Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Apr 24 00:14:12 2009 -0700 Add SIGIO/SIGPOLL support for Solaris Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 0c467b1f990f156a34d5ef117bd825df6b633114 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Apr 24 00:05:28 2009 -0700 Add casts to generated entries in sdksyms.c to silence type mismatch warnings Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 7d0f7518c2235a9dc783029971259ddaada2db20 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Apr 23 08:42:38 2009 -0700 Fix byte swapping of XF86VidMode{Get,Set}GammaRamp Fixes OpenSolaris Bug 8315: Xorg segfaults when screensaver fades in cross-endian xdmcp session <http://defect.opensolaris.org/bz/show_bug.cgi?id=8315> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 057fc9a4f89282e440b5e11458f1dd8655879dd8 Merge: 95628b7 932d6bc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Apr 24 16:15:47 2009 +1000 Merge branch 'master' into xi2 Conflicts: Xi/chdevhier.c include/input.h commit 932d6bcbb68194c5bdfeb336f700dc8b31529223 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Apr 24 15:28:45 2009 +1000 mi: remove superfluous check. mieqProcessInputEvents doesn't process events from MDs anymore, so we don't need to check for pDev->isMaster. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fab563bf8f6b63906ce9d5a568c467425843265b Author: Benjamin Close <Benjamin.Close@clearchain.com> Date: Fri Mar 27 16:44:15 2009 +1030 input: propagate XTst events through virtual slave devices. A XTest virtual slave device pair (kbd/ptr) exists for every master device pair. This is so XTest events are correctly propogated via slave devices up to Master devices and the classes are correctly changed along the way. We add the XTest slave device pair to the Virtual Core pointer and provide a simple way of creating the devices. A XTest Slave Device is identified by the XTstDevicePrivateKey property being set in the devices devProperties XI events are still propagated through the matching device, in the hope the client knows what it is doing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ccd28ca2ad40aecf951ab058d89062828e3e5d8a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 22 19:23:17 2009 -0700 XQuartz: Localization update (cherry picked from commit 9435fc5e20e25ce66ec85bde033daff51f39f69c) commit a362d0f4fb79150f7b8e0eb3d1dc1cdee2f98d95 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 11 19:06:45 2009 -0700 XQuartz: Make sure the bgMouseLocationUpdated state is consistent (cherry picked from commit 8fa8a8e1db60c8ac60d10f1f15517471d2291f77) commit 8dc8812c226222fc64f8e489f9f123687a95d3d1 Author: Dave Airlie <airlied@redhat.com> Date: Thu Apr 23 12:13:35 2009 +1000 exa: add missing exa.h header include commit 3ec6a121e110ba3cae964ee201d4d5bf818b6dff Author: Dave Airlie <airlied@redhat.com> Date: Thu Apr 23 12:13:05 2009 +1000 exa: missed exa.h change commit 02ae85c4c93bbd0013c063ce0014b365a8ba061f Author: Dave Airlie <airlied@redhat.com> Date: Thu Apr 23 12:04:17 2009 +1000 exa: add CreatePixmap2 hook for driver pixmaps. This adds a revised pixmap hook for driver pixmaps, which is required to support tiling on various chips. Signed-off-by: Dave Airlie <airlied@redhat.com> commit 9d684ba0bcab53841a17ebd521507b6df8bc4b45 Author: Dave Airlie <airlied@redhat.com> Date: Thu Apr 16 10:28:36 2009 +1000 exa: avoid offscreen pixmap swapped out flag for driver pixmaps commit 0dfb97f15f591f85e079f5829c77d0c328d00464 Author: Julien Cristau <jcristau@debian.org> Date: Wed Apr 22 20:01:49 2009 +0200 Bug#21324: Add quirk for Iiyama Vision Master 450 Reported-by: Jeremy Henty <onepoint@starurchin.org> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 44227ef1b77467c76147b9bf79bdd0e6305a522a Author: Ian Romanick <ian.d.romanick@intel.com> Date: Mon Apr 20 18:20:52 2009 -0700 DRI2: Send the version the code actually supports This prevents building an older server with a new dri2proto.h from resulting in a DRI2 extension module that lies about the version it supports. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit d1e916d29be8b470cbc8cadcf6e83991fdbc5a9f Author: Ian Romanick <ian.d.romanick@intel.com> Date: Thu Apr 16 12:10:34 2009 -0700 DRI2: Add missing front-buffer flush callback. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit 826a5bff0136b2b4d55a9e6e6bc3a7a64da9031e Author: Benjamin Close <benjamin.close@clearchain.com> Date: Thu Apr 16 15:33:30 2009 +1000 dix: Change AllocMaster into AllocDevicePair, allow creation of SDs too. Allocating a slave device is essentially the same as allocating a master device. Hence we rename AllocMaster to AllocDevicePair and provided the ability to indicate if a master or slave device pair is required. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e2e5932bda3f473629d4be6f3ca4dcab18993eb6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 16 11:06:52 2009 +1000 dix: don't allow more than MAX_VALUATORS on one device. Some keyboards (?) advertise more than MAX_VALUATORS axes. Parts of the internal event delivery relies on not having more than MAX_VALUATOR axes, so let's cap it down. If there's real devices that require more than the current 36, I'm sure we can bump this up. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 063833f3a6d9f8f657e3de309c8d6d5c3d606513 Author: Julien Cristau <jcristau@debian.org> Date: Wed Dec 24 14:23:37 2008 +0100 Add XI 1.5 event and requests to protocol.txt commit 4f86ee61a4abf7a29e565d095aa08abd0ca9dc66 Author: Julien Cristau <jcristau@debian.org> Date: Wed Dec 24 14:17:27 2008 +0100 Add RandR 1.3 requests to protocol.txt commit 6559f02ef89cb0ee365110d6a928ebd29632ad53 Author: Colin Harrison <colin.harrison@virgin.net> Date: Fri Apr 17 15:14:45 2009 +0100 xkb: set bell_func in InitKeyboardDeviceStruct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 95628b797e2b326ae15406df4f736e25f5d2f12f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Apr 20 14:04:54 2009 +1000 Xi: use the XI2 defines for AsyncPair, SyncDevice, etc, not the XI ones. And don't allow some values on SDs either. commit 335c63fcd6a53c1d3dffd6e00c0acd400c61e3d3 Author: Werner LEMBERG <wl@gnu.org> Date: Fri Apr 17 15:22:57 2009 +0200 Add newline to some LogMessage strings. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d5ad14c8ed4d8360e1df8cd0bacf6a7c9c31df91 Merge: 54716fd 0e0642e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 19 22:28:22 2009 +1000 Merge branch 'master' into xi2 commit 54716fd3dbc251db9d251d1d0435942efaa63259 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 19 22:12:11 2009 +1000 Convert to using int32_t fixed point values on the wire. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 129ac9a9145323e3f126590b491e718f976f80ce Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 19 21:31:56 2009 +1000 dix: set root_x/y for device events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit eeb1e4cd254c047539933c3b886037e67ef30762 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 15 22:17:15 2009 +1000 Xi: add support for XIAllowEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 74d0fc3aee05bc4f505274d81dd44c0d2b4368ff Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 16 11:06:52 2009 +1000 dix: don't allow more than MAX_VALUATORS on one device. Some keyboards (?) advertise more than MAX_VALUATORS axes. Parts of the internal event delivery relies on not having more than MAX_VALUATOR axes, so let's cap it down. If there's real devices that require more than the current 36, I'm sure we can bump this up. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit edb70caf21fa5da3c336c47c62218a3f05c635b8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 15 22:16:49 2009 +1000 dix: remove un-used parameter "core" from AllowSome Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bb5418d4901017c657031181d3839f58b387a2a3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 12 22:22:21 2009 +1000 Xi: Add support for XI2 active grabs and ungrabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c11ef87931f920ba782ba4e9b47d9c31ad7c1cf7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 12 22:16:14 2009 +1000 Xi: take XI2 requests into account when checking opcodes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c94ea5bc055e4efc323e84b7a8266e8b8a4af48e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 12 17:38:28 2009 +1000 input: use a GrabMask union in GrabDevice to allow for XI2 masks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6bb4b5b93701535402f65ea828348ed7747c7dbf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 12 16:20:10 2009 +1000 Xi: add XI2 grab protocol request handling. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 09f9a86077f0058ce88ee9b3df5d1ab854eeca43 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Apr 12 16:19:45 2009 +1000 input: replace GrabRec's coreGrab field with grabtype. Don't allow grabs of different types to override each other. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7fbe1b7d63c94b344e8ff9d09c0bb162ca104909 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat Apr 11 13:10:31 2009 +1000 Xi: remove the GetExtensionVersion hack. Squashing data into a request that's defined to be padding is probably not the best idea. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0e0642ee9466d3268476d0084a83a9d93a4aa555 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 16 16:17:07 2009 +1000 os: don't malloc memory in LogVMessageVerb. LogVWrite is limited to a buffer size of 1024, so we don't loose anything here by truncating. This way we can use LogVMessageVerb (and xf86Msg and friends) during signal handlers with the normal message types. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 62d2fb68638e9f2aa3c1d72027619c4d38f5b812 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 16 17:06:33 2009 +1000 xkb: Add XkbFreeRMLVOSet helper function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> commit 73e1055b1275470dcc2d53b15898c866d9721d3e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat Apr 11 11:19:29 2009 +1000 Xi: fix a typo in a #ifdef Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cbbc7fed994448852961a987a8b0eadf718b24bf Author: Simon Thum <simon.thum@gmx.de> Date: Wed Apr 1 10:53:10 2009 +0200 dix: correctly utilize tracker buffer and protect from timer overruns two small related fixes hard to split up Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ca4918ac2ff003142aefbd8ac7ec2bc398ccc6eb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 19:31:04 2009 +1000 Xi: remove fail from SProcXISelectEvent. Leftover from rebasing once too often, I guess. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 463676f016a105a790cbb386d20eb5b188c04652 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 19:11:59 2009 +1000 Xi: remove un-used variable pXIClient Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 32b13ec4cd42842a133aa6428f49638b0448efc9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 19:11:27 2009 +1000 Xi: silence compiler warnings about "wrong" event types. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f2e957c5342aefc8329e9fe282b7072f767fcd28 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 19:07:36 2009 +1000 mi: add prototype for CopyGetMasterEvent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d80798ba2ae018086aaf230fcd8bc71d3bf06b11 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 20:27:00 2009 +1000 mi: fix wrong (*EnqueueEvent) declaration in miPointerScreenFuncRec. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4dedb900f4fbd3bdc9538b1e82cab2044438a770 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:42:06 2009 +1000 xfree86: shut up compiler warnings - typecast to InternalEvent Reported-by: Eric Anholt <eric@anholt.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4fa7fcf610d2ab91c1158f8034bbc0531060a86f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:40:20 2009 +1000 mi: fix compiler warning - explicitly typecast to InternalEvent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8bf2f562678107c346e8664f18c10f315c2768f5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:14:39 2009 +1000 dix: fix dev/keybd variable mixup. Reported-by: Eric Anhold <eric@anholt.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 012cb1956a69f6cf2a878c5331e792fb12c73e9d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:06:32 2009 +1000 xfree86: fix use of uninitialized variable in DGAProcessPointerEvent. Reported-by: Eric Anholt <eric@anholt.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 73b01a9aac5fde46ccd90c08a070e9d2496092b9 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Apr 8 14:35:01 2009 +0200 dix: fix pointer accelerations remainder handling This didn't really work as intended, but did amazingly well thanks to roundf() hiding the defect. Cheers! Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4318075140cc287871d3c3b9f777289ea4ffa23a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 7 21:51:02 2009 +1000 dix: store subpixel precision and send it down the wire to the client. For the valuator data, not yet for root x/y and event x/y. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9212948461c5e053abb61fff73ced4a00f138544 Author: Simon Thum <simon.thum@gmx.de> Date: Sat Mar 21 18:19:19 2009 +0100 dix: allow relative motion buffer to accumulate in a natural way Since with XI2 we pass sub-pixel motion, anything else is broken. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ad76656f8869e2065f0c4e66cfbeef0b42c61769 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 17 17:46:58 2009 -0400 randr: Accept gamma set requests from XF86VidMode clients too commit d9bf52b4abd29a3c206cd1e765b680659ddac1c6 Author: David Jander <david.jander@protonic.nl> Date: Fri Apr 17 01:34:18 2009 -0400 [kdrive] Fix rotation of pointer Rotation matrix for pointer coordinates was incomplete and pointers with absolute coordinates did not work correctly in xserver (kdrive) when the sceen was rotated other than by 0 degrees. Signed-off-by: David Jander <david.jander@protonic.nl> Signed-off-by: James Cloos <cloos@jhcloos.com> commit 4559d2ace6ac55fe361f572ded0769cdd1f3b545 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 16 22:48:11 2009 -0400 security: Grant untrusted windows remove access on all windows. This allows untrusted clients to destroy their own windows when they have been reparented by a trusted window manager. commit 3481b32ab971c41cb972f6819ae049f3e9f7033b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 16 22:39:54 2009 -0400 security: Fix a crash caused by wrong ordering of format arguments. commit 6045506be0cebca4ebbe943ae77f020aafa703d4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 16 22:33:12 2009 -0400 security: Revert behavior of extension access for compatibility. Previously, three extensions were defined as "trusted" by the extension: BIG-REQUESTS, XC-MISC, and XPrint. No other extensions were permitted to be used by untrusted clients. In commit 8b5d21cc1d1f4e9d20e5d5eca44cb1e60a419763 this was changed for some reason. Return to the old, compatible behavior. commit 56a5955c8cd87137248edb2cbc65d384376d72ad Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 14 17:05:04 2009 +1000 xkb: strdup the values returned by XkbGetRulesDflts XkbGetRulesDftls may get a copy of what will later be freed when passed into XkbSetRulesDftls. On the second run of XkbGet/SetRulesDflts: XkbGetRulesDflts(rmlvo) rmlvo->rules = current-rules XkbSetRulesDflts(rmlvo) free(current-rules) current-rules = strdup(rmlvo->rules) Leaving us with garbage in current-rules. This patch requires callers of XkbGetRulesDflts to free the associated memory. See also http://lists.freedesktop.org/archives/xorg-devel/2009-February/000305.html Reported-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit b406886bbffadaa52864a99f2a0520999eadc15d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 14 16:57:29 2009 +1000 input: allow NULL as XkbRMVLOSet in InitKeyboardDeviceStruct. Virtually all callers use XkbGetRulesDefault(&rmlvo); InitKeyboardDeviceStruct(..., rmlvo); Let's save them the trouble and accept NULL as a hint to take the default RMLVO. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 4e4e263bc073bf452f19c932b937c4881ae71f64 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Apr 15 22:16:49 2009 +1000 dix: remove un-used parameter "core" from AllowSome Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dd6e8a14ec1c8f4ed9c51ca2764261e6e48d13b3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat Apr 11 11:19:29 2009 +1000 Xi: fix a typo in a #ifdef Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit de1e43181bd670877b994db221ad8a04b5d63324 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Wed Apr 15 11:13:48 2009 -0700 DRI2: Don't leave empty entries in private->buffers This should fix bug #21130. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit b3e3154cce47add97f5561088036ce3b9e7dc937 Author: Robert Noland <rnoland@2hip.net> Date: Wed Apr 15 12:06:19 2009 -0500 One = is more than adequate here. Make is sh safe. commit 74d27c8b5bac7c8d2ed02ba86e09bf09924ce05c Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Wed Apr 15 15:44:17 2009 +0200 Fix build on hurd-i386 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523970 commit faf7dfa099f5b42a703313fbd1bf8afdad07a179 Author: Dave Airlie <airlied@linux.ie> Date: Wed Apr 15 18:26:06 2009 +1000 randr12: looking up these bits if randr isn't initialised is bad. When xinerama is enabled we don't get randr protocol, but the driver might still want randr internals commit efa31092d6703397121a0ada4f7205a8ecad3d3d Author: Ander Conselvan de Oliveira <ander@mandriva.com.br> Date: Mon Apr 6 16:01:20 2009 -0300 xfree86: Remove device from inputInfo.devices if ActivateDevice failed. After the call to xf86ActivateDevice, the new device will be added to inputInfo.devices. However, if the subsequent call to ActivateDevice fails, the correponding InputInfoRec for the device is deleted but an entry still remains in inputInfo.devices. This might lead to a server crash later on (on InitAndStartDevices for instance) when the device control proc would be called for an invalid device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d79bad0aa70403ead8ec87bac8463a6e2005802c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Apr 13 17:49:00 2009 +1000 xfree86: don't synthesise a mouse section if synaptics devices are found. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4a27618565f3151ab17f0ca9ecbde12fa7ba13c0 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Apr 14 16:21:04 2009 -0400 composite: Fix resource lookups commit e7785e8af3e34f9d1089d8499d16802984ab9823 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Apr 14 14:24:31 2009 -0400 xfixes: Fix a couple of resource lookups commit 0eb19f9437b7d8c19592e49eedb028771d300d80 Author: Adam Jackson <ajax@redhat.com> Date: Tue Apr 14 10:54:25 2009 -0400 xdmcp: Don't crash on X -query with more than 255 IP addresses. (#20675) You could be more clever than this, but the wire protocol says this really is an array of not more than 255 ARRAY8, so it's not just a matter of changing the types. commit f0543ae4ec0fcb5d696e7b2983653bd779f1eddc Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 8 14:17:41 2009 -0700 Fix unused var warning from pci cleanups. commit 181cc08c8908a119fc403f970dea8cc98d3e0b9b Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 8 14:17:40 2009 -0700 Add shave so that we can see the steaming piles of warnings generated. The old style output can be reenabled for build system debugging using "make V=1", or --disable-shave at configure time. commit 4474c200a102feda72f9572a96cb588009aa0147 Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 8 14:17:39 2009 -0700 Move VENDOR_* defines from AC_SUBST to a header to avoid angering shave. This is more sane anyway, as it ensures a rebuild when changing them. commit e72c85547b405fbd0117dc1236e5ca5a2126063c Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 8 14:17:38 2009 -0700 Move contributed m4 to a subdir so we can more easily update contributions. commit bef1cfb2395df47458159a0b7ae27b9db15025ef Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 14 16:54:42 2009 +1000 xnest: remove unused variable 'names'. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7b6400a1b8d2f228fcbedf17c30a7e3924e4dd2a Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Apr 9 13:16:37 2009 -0400 glx: Fix drawable private leak on destroy When a drawable goes away, we don't destroy the GLX drawable in full, since it may be current for a context. This means that when the drawable is destroyed in full later, the backend doesn't get a chance to destroy resources associated with the drawable (the DRI2Drawable). With this patch, we destroy the GLX drawable in full when it goes away and then track down all contexts that reference it and NULL their pointers. commit 140463a197fb93d0a4bfad924efc35b860e8cc54 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 11 16:53:59 2009 -0700 XQuartz: Use correct values for ProximityIn and ProximityOut This was the other underlying cause of teh 100% CPU tablet issue. (cherry picked from commit a9cecf34c23fbcd59b56b380c51d31a9fabc3eb7) commit 80a7bb2605f9b439d6221c0495a629a39177a018 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 11 17:26:07 2009 -0700 XQuartz: Solve the tablet 100% CPU bug This happened because we put a byte in the fd to wake up dispatch, but we never actually enqueued anything in mieq because the num_events was 0. (cherry picked from commit c21ca7558d2faf93c61f5feaafd7c878e9e21942) commit 6f8f7c78f1b722bc70a0ea8f6340116a1e09e858 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 11 16:13:42 2009 -0700 XQuartz: Re-enable background window checking since that code was not the culprit for the wacom tablet, background 100% CPU bug (cherry picked from commit fc1dc5d71b2a488a8a94d953dd8e67353161a590) commit 8522a759c9e78478bb399b91d3a0af2d23ea6766 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 11 16:12:23 2009 -0700 XQuartz: Only set MotionNotify on activation if it is updated. (cherry picked from commit ae8077a251ef27381a755d57ff974767bda16148) commit 5e55becddccc376ab7338789562ad6d6cd750de9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 11 14:23:41 2009 -0700 XQuartz: Make sure the Fn doesn't trigger unneccessary calls to DarwinUpdateModKeys() (cherry picked from commit 70a18558c6b0a02b633fd8974f002cdf3cdc713e) commit bd1d9179094657865b0606ed0ac835a8b8df3be1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 11 13:53:38 2009 -0700 XQuartz: Re-enable Fn as an option for 3button mouse simulation. Patch from Martin Otte <otte@duke.edu> (cherry picked from commit b5ec3be6b5449b5d575bc1472fdd1c9cb15cb8be) commit 1b5758bef0840c6614244e321790231b3c9477c9 Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Apr 9 15:45:57 2009 +0200 exa: implement UTS based upload through CopyArea - Some image viewers (eog, gqview) trigger the CopyArea path of Xext/shm.c - I'm not aware of any code path that wouldn't like UTS and trigger this code. - miDoCopy should handle src coordinate clipping. - Overlapping blits are obviously not an issue (both would have to be offscreen or not). commit 567cf67959b30432ae30f4851ec17b3a375ab838 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Thu Apr 9 14:38:24 2009 -0700 DRI2: Synchronize the contents of the real and fake front-buffers Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit f1a995d1496d73741731e32f475097c44a8da972 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Thu Apr 9 14:31:01 2009 -0700 DRI2: Do not send the real front buffer of a window to the client Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit aa2928325fe51d94a636dde9c090e8f54a311a12 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Wed Apr 8 15:44:34 2009 -0700 DRI2: Add fake front-buffer to request list for windows If a front-buffer is requested for a window, add the fake front-buffer to the list of requested buffers. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit 808fd2c67f303cb721769375b11ce8b90ffc1909 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 9 20:00:37 2009 -0700 XQuartz: xprSetWindowLevel updated to store the level requested by the WM (cherry picked from commit c28c2ddc3a8f3c5b9beec396953bb3ac9ee4714b) commit dfb0d7aefbbdfc0db966e3a84d52f638135d9138 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 9 18:51:22 2009 -0700 XQuartz: Update window levels when changing rootless state (cherry picked from commit 1359ded5bfc14a80fb998b01a54ecacb96c4ff88) commit d5ef88d7543ed787093099ab18db766c446b47d1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 9 18:27:22 2009 -0700 XQuartz: Fix window levels for rooted mode to allow showing the menu bar. (cherry picked from commit 80759a4186bf0335edc85aecea2faf11fe09f491) commit 15146b863759640e7a73fab2301fb28ef4dead84 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 9 17:47:41 2009 -0700 XQuartz: Properly set the window level for the root window (cherry picked from commit bdf9286d1cbfeaaf8eaf03d28091e91ee587ee25) commit 8d5dcfe2154f217bd8fde5509d78f3383add8725 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 9 04:36:26 2009 -0700 XQuartz: Properly set the menu bar and hotkey state when changing rootless mode. Currently no code path exhibits the broken behavior since we only toggle into rootless if we don't have the root. (cherry picked from commit 970f100ca3c5fc0662ae7658d49d118fbd9de943) commit 82d7cf5cdcbc5e451a87f8c2f64cd5d2e3627d54 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 9 03:55:13 2009 -0700 XQuartz: In rooted mode, make sure we start in the hidden state. (cherry picked from commit 5ecc497f71c2133f773f6c56ad76cb778862ddd6) commit e86f4e93020d56385418850a9eebae8076dcb9ac Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 6 21:34:14 2009 -0700 XQuartz: Send MotionNotify before button presses when X11 is in the background (cherry picked from commit c80d0ec18ef5b842447d31360406d0b5b9424222) commit 5ccfad8df099e8ebc4bf2dd53c3db1460903b135 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 6 19:21:46 2009 -0700 XQuartz: Revert most of the previous override redirect patch The changes actually caused all windows to move to the current space. Instead, we're going with a fix entirely within Xplugin that depends on quartz-wm being the window-manager for now. (cherry picked from commit 997b6f3142c622541bb5bac98652abae75d1101d) commit ff7f019bbcbc52618cc478db7baed57aa5b7c3d3 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Apr 1 10:53:10 2009 +0200 dix: correctly utilize tracker buffer and protect from timer overruns two small related fixes hard to split up Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 06aebecb19dd9d90d73b742a09b6068b862f1d05 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Apr 8 14:35:01 2009 +0200 dix: fix pointer accelerations remainder handling This didn't really work as intended, but did amazingly well thanks to roundf() hiding the defect. Cheers! Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 98f4179156391752e6688339487458ad7828abf4 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Mar 26 23:04:24 2009 -0700 Use RTLD_DI_SETSIGNAL to catch runtime dynamic loader errors and clean up Based on fix for Sun bug 6813925: Xorg needs to catch ld.so.1 failure so it can close down devices cleanly <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6813925> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit a0b6a363dca8ce0dc6f4eb79333e48496153cd67 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Mar 9 13:22:57 2009 -0700 Lift fatal signal handlers from DDX'es up to a common DIX implementation Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit fcc19e673e3ef33d64916dd933853f8aa667c4d7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 20:27:00 2009 +1000 mi: fix wrong (*EnqueueEvent) declaration in miPointerScreenFuncRec. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4fee979d0632751d3d54d2115e84e9654edf0622 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 19:11:27 2009 +1000 Xi: silence compiler warnings about "wrong" event types. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6b467bf879eeb77d167ef321e6dda97ca9d7010a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:42:06 2009 +1000 xfree86: shut up compiler warnings - typecast to InternalEvent Reported-by: Eric Anholt <eric@anholt.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8a2a184da78a3e9cbeae8290431f40d5ec7f3636 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:06:32 2009 +1000 xfree86: fix use of uninitialized variable in DGAProcessPointerEvent. Reported-by: Eric Anholt <eric@anholt.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 011cee3103c146c8096b7098a27993f99e07a824 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:14:39 2009 +1000 dix: fix dev/keybd variable mixup. Reported-by: Eric Anhold <eric@anholt.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 630a6e9d14ffbf036fa72f580c72c0172d7c20bd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 08:40:20 2009 +1000 mi: fix compiler warning - explicitly typecast to InternalEvent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e3bb7dea06b9ab0e30d801bf6c3a59f94290aaed Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Apr 9 19:07:36 2009 +1000 mi: add prototype for CopyGetMasterEvent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 346e71525fc545c6ca4ad79425722282d1544459 Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Apr 9 09:36:41 2009 +0200 EXA: If the driver can't composite to an a8 mask, try an argb mask for glyphs. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 682d7b55699cacbb2dbcd84a5e816bf6e2d2f02a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 9 02:48:04 2009 -0400 xselinux: Don't BadAlloc in List* requests if there are no items to list. commit 3a0ee199dcec39596756a995996eac388acf6315 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 9 02:26:24 2009 -0400 config: fix crash caused by strdup(NULL) commit 7b3982eb6518da33ab01c2fbf7ceb45b89f841df Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Apr 9 08:21:09 2009 +0200 glx: Test the error value, not its address... commit 03aebed519986c4dd03e02b3b3d4af1f64595ca7 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Wed Apr 8 14:54:30 2009 -0700 Use a #define instead of a magic number The number of buffers is likely to change in the future, so having this as a define is the right way to go. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit 0d9f3ca7eabd4c514808114d30627f682c8bd030 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Wed Apr 8 14:53:46 2009 -0700 Allow GLX sources to build against Mesa 7.4 sources Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit e8b324102f6e21ae2b8292a6f50d016dd6254dd6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Apr 8 15:10:16 2009 -0400 xselinux: Don't require incoming context strings to be null-terminated. commit df27b870a8db7a5153b18a556fe77efa590f9eee Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Apr 7 16:28:08 2009 -0400 Convert remaining GLX LookupIDByType() calls commit 92562747a0fdbef1dbedf734cb55dd6a9e1d2994 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Apr 7 13:58:53 2009 -0400 Add validGlxDrawable() and use dixLookupResourceByType(). Fixes deprecation warnings, and fixes a couple of GLX error codes for failing drawable lookups. commit f70cfc8f90091ef0f5ed0a5b2e023e7fd6369b36 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Apr 2 17:30:19 2009 -0400 Don't stomp on dixLookupDrawable() return value in DoCreateGLXPixmap(). commit 30d81ad72e870cc37754bd8c8aadf605450ec16e Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Apr 2 17:24:12 2009 -0400 Make GLX context lookup use dixLookupResourceByType() commit 66539cc05d0b017b9feb4a038499907810140623 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Mar 26 22:22:32 2009 -0700 Don't leak default font path when appending built-ins Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 6c3b633299f12051fcf37fb8439f358de876cf03 Merge: adf21db 0cfd481 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Apr 7 19:36:27 2009 +1000 Merge branch 'master' into xi2 commit 0cfd48130842685828e0662a27272a3a65facd23 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 23 11:41:16 2009 +1000 dix: Dont change the keyboard mapping on non-keyboard devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 69e73e5ce0e3971eceed71216d2d7e7d9cd57cc2 Author: Adam Jackson <ajax@redhat.com> Date: Mon Apr 6 17:56:49 2009 -0400 config: Remove useless xf86conf{{m,c,re}alloc},free} macros commit 485946120a6522db9298111752de9be3d675e0b3 Author: Adam Jackson <ajax@redhat.com> Date: Mon Apr 6 17:51:35 2009 -0400 config: s/xf86configStrdup/strdup/ commit 5f769b73441cf29c05a05c728ab81bdde1fc00b6 Author: David Jander <david.jander@protonic.nl> Date: Mon Apr 6 13:01:08 2009 -0400 kdrive: Fix segfault in tslib support commit 843166b033dc0544b9f3cf3c91fc3ae3650bda14 Author: Adam Jackson <ajax@redhat.com> Date: Mon Apr 6 11:05:17 2009 -0400 os: signal handlers return void. commit aa6fbc2a3679896181610aee7ce2844d4322a5ce Author: Adam Jackson <ajax@redhat.com> Date: Mon Apr 6 10:58:47 2009 -0400 Remove some OS/2 leftovers. commit 2c03a63ff6855272d587b4972a67f64115a1ce4c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Apr 5 03:20:40 2009 -0700 XQuartz: Use updated Xplugin API to send overide-redirect windows to the current space when they're ordered in This fixes the annoying "using a menu moves me to another space" bug (cherry picked from commit 9e6dab89e08a26d764ba1aeaeb804c3d25c667da) commit 67621f3b39c387b3f7bfc65781051aea51c0b83f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Apr 5 00:06:57 2009 -0700 XQuartz: Send a MotionNotify event for the mouse cursor when activating X11.app Otherwise if X11.app was activated with a mouse click, the location of the even is the last location of the cursor before X11 was deactivated (cherry picked from commit c7457d7b31ddd2ddfd04dd6294bed4532664e1ab) commit e1338d27141125af61634597c5dea880692c4017 Author: Julien Cristau <jcristau@debian.org> Date: Sat Apr 4 23:43:28 2009 +0200 xfree86: Remove unused DEFAULT_UNRESOLVED and DEFAULT_BEST_REFRESH macros commit e25d55ad546905c4921f0a26385bdb9f22038429 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 22:38:00 2009 -0400 Revert accidental Makefile change from previous commit commit 472811dc4ba741ab09db184216878700f4adf745 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 22:27:51 2009 -0400 DPMS: Re-export the various DPMS variables. The drivers might not need them but extmod does. Should move it to builtin though. commit cbb165ab88cb0810268001e84d87671440baf837 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 18:34:45 2009 -0400 os: Remove the useless -x option commit 6574ab092fb80b7731e06ede653b6af92fa7684e Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 18:03:43 2009 -0400 DPMS: Remove the defaultDPMS* variables commit c1cf36ee29e41901ecd382f0258110ebb4a0124e Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 17:51:55 2009 -0400 DPMS: Simplify command line parsing commit 2d0a4fff7985f58c21023cc4757090ee67067593 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 13:44:37 2009 -0400 DPMS: Remove unused DPMSGet() commit d52fddefaeb43f15b677eefbea4a288a9948373b Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 13:33:03 2009 -0400 DPMS: Align the default timeouts with the default screensaver timeout. On a typical LCD, a black screensaver is actually worse for power consumption than a normal screen, because it takes more energy to turn the crystals opaque. Also, the intermediate DPMS states are essentially useless and most monitors alias them to the 'off' state, so we may as well do the same. As a pleasant side effect, this brings the default DPMS timeouts in line with the EnergyStar Program Requirements for Computers: http://www.energystar.gov/index.cfm?c=revisions.computer_spec which state that products must be "shipped with the display's Sleep mode set to activate within 15 minutes of user inactivity". commit 38576dc3ae8ddec2baedd2f7e64abdfc56bedf93 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 11:55:41 2009 -0400 DPMS: Simplify some macro silliness. commit 1c01127a214731a21c4784249a429c74f17bd424 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 11:39:18 2009 -0400 DPMS: Unexport all the various setup variables. The drivers don't need to know any of this. commit a99b0ab918998c9a1b9f8692591b8cb59a12eb9e Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 11:32:00 2009 -0400 DPMS: Fix cast abuse commit 4da347adb1fcc39e8f4fb2cadd98e887d7ac877a Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 11:18:21 2009 -0400 DPMS: Code motion. commit 1731882341c191b4ffd78e0c1fd9297c636e0401 Author: Havoc Pennington <hp@pobox.com> Date: Fri Mar 27 12:30:37 2009 -0400 Set bg pixmap of composite overlay window to None (#20912) Otherwise it's impossible to get the COW without a white flash on the screen, because it's on top, mapped immediately, and unaffected by composite redirection. This makes initial login ugly when it doesn't need to be. commit d2690375dfd994817f004cda133ca2a492c0b956 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 3 11:06:50 2009 -0400 kdrive: s/KdSaveString/strdup/g This isn't even funny anymore. commit 91b697efdefba125348dbcaf584ee51a7f8c9bf6 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Apr 1 17:42:33 2009 -0400 Support setTexBuffer2 in AIGLX. Fixes broken GLX_tfp, specifically, lets compositors ignore un-defined alpha channel for pixmaps. commit 1c101d75d4855b2698e3fc8d2dd662f20585812f Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Mar 26 22:25:08 2009 -0700 Don't leak canonical module name and patterns if module is built-in Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9180081ec32b6c655d193de4c89b59d222a72579 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Apr 1 13:45:02 2009 -0700 XQuartz: Still send mouse events while X11 is in the background if we have test extensions enabled (cherry picked from commit f393fb686cfbedb11a1539d4eaf5c491af8b3a64) commit 029307e79a14cad5bde8f1f4a5d0a2f740271f06 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Apr 1 13:07:15 2009 -0700 XQuartz: Return BadRequest when SendPSN isn't implemented rather than success (cherry picked from commit 49871e99179d5176a1ec516c8f449e2dc219faea) commit 0603fbc1d3b2db5c25faabbfb5e04914110b4d0e Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Apr 1 12:46:51 2009 -0700 XQuartz: Pad xAppleDRINotifyEvent to 32bytes to match sizeof(xEvent) (cherry picked from commit 276ee3bb087c772f57a987519aa4d94afeceadaa) commit b1dab580bdfb4acfe3feddeda6e760098ec4922a Author: Tormod Volden <debian.tormod@gmail.com> Date: Wed Apr 1 19:32:21 2009 +0200 xfree86: edid quirk for Philips LCD LP154W01-TLAJ This panel reports its vertical size in cm. X.Org bug#21000 <http://bugs.freedesktop.org/show_bug.cgi?id=21000> Signed-off-by: Tormod Volden <debian.tormod@gmail.com> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 7d94414cf4b16501ce4c4291846498f393f150a4 Author: Adam Jackson <ajax@redhat.com> Date: Wed Apr 1 09:42:06 2009 -0400 input: Remove xf86ReloadInputDevs hack We have input hotplug now, no need to fake it. commit 3311ef6ec93df4325d198715e0fce73af19f0781 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Mar 31 18:11:19 2009 -0700 XQuartz: Don't report mouse events while X11 is not the foreground application (cherry picked from commit 5d1dd35096334b59564d77caef7a97bd58845c5d) commit 89887fadc97f6fd5059886396a6d7cf61de1982f Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 31 15:09:57 2009 -0400 APM: Don't carp if not available. commit 2e145989d10ef454581f8aa60358ed3782fd6442 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 30 17:22:28 2009 -0400 dix: Simplify InitClient() commit 252ec504817e05b185e4896a2d899e9c00b8aeef Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 30 15:18:30 2009 -0400 Document which bits of ClientRec are currently unused commit 0b6e14d46feaf8c46fd3768ee5353b844391b79b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Mar 30 20:37:25 2009 -0700 XQuartz: Fix mouse tracking for quake, et. al. in wine Patch courtesy of Codeweavers Fix mouse movement tracking. For a non-window-related mouse-move event, calculate the new position by adding the event's delta-x and delta-y values to the previous mouse position. Do not rely on the current mouse position because it may have been changed by a XWarpPointer call. (cherry picked from commit 7a67935b05a475215b9bdbb959e4f7e15f32416f) commit c74220b853cd99d03e33cc62d32431ca3a879483 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 30 14:56:15 2009 -0400 APM: Use general handlers, not input handlers. Otherwise APM events get treated as input events, which messes up idle time accounting and screensavers and such. Not, we hope, that anyone is using APM anymore. commit 283a081572d8db787c77d09e5ba6bcadebf4f7fe Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 15:56:15 2009 -0400 selinux: Only activate if policy says to be an object manager commit 8e7facfe3013abda12a0c39ad8b4d025618077a7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 15:48:17 2009 -0400 config: Fall back to vesa for Intel Poulsbo. commit 17239c8e3163fef0159835d43c0dde20e78192a1 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 12:44:20 2009 -0400 misprite: Remove private header, fold into misprite.c commit bb89fc2771d2e54d7e0cd0371db68ddb754a64e5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 12:36:42 2009 -0400 misprite: Fix software cursor on multiple ScreenRecs commit 2c000f4980d30015e6da95de3c77c0fdda0090e4 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 11:54:52 2009 -0400 misprite: Do window check first for Get{Image,Spans} too commit 8beced6c02610444105f3d0b8ee3a49e1072096d Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 11:43:33 2009 -0400 misprite: RECT_IN_REGION -> miRectIn commit a232116b9ecd41ce55f8eeee9dfe2b67d76479d6 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 11:41:40 2009 -0400 misprite: Fix a typo commit 1f0eaf886d88f3935e43985d2c889b374f412e43 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 27 11:29:40 2009 -0400 misprite: Fix cast abuse commit e3c1096273446bb7eb993b179ceb989617d149cc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 23 13:20:22 2009 +1000 dix: build_modmap_from_modkeymap needs to bounds-check its argument. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 45baef0b77f6f0e5e6230eca045dfcbb1e48c647 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 23 13:32:32 2009 +1000 dix: return BadValue as error in SetModifierMapping. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 603db34337a61754e0c5f71525011d10eab78411 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 25 15:51:43 2009 +1000 Xext: set POINTER_SCREEN flag in XTestFakeInput if necessary. (RH #490984) The POINTER_SCREEN flag must be set explicitly for XTest core events to avoid out-of-range events when the lastSlave was an SD with an explicit axis range. Device events sent through XTest don't need this flag, they are expected to be in the valuator range of the device anyway. Red Hat Bug 490984 <https://bugzilla.redhat.com/show_bug.cgi?id=490984> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4ab93f05664890ff6738ef1089bcd956ce3f06e9 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 23 15:19:47 2009 -0400 misprite: In SourceValidate, check that it's a Window first It almost never is. However, you have _lots_ of input devices now, and walking them all on every Composite operation is not the cheapest thing in the world. commit d698e62690e0a52fa537f1cd792cab7a5b1bafdf Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Mar 19 21:35:25 2009 +0100 xkb: plug a memory leak in XkbCopySrvLedInfo (#20756) X.Org Bug 20756 <http://bugs.freedesktop.org/show_bug.cgi?id=20756> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e26f79335bb7a9ad34fe9b23c283a214202f89ed Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 17 16:22:00 2009 +1000 xkb: put a few extra checks in against non-keyboards commit 844bb629fe786ecf536039df3f5f4b3b214c9d40 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 19 15:44:34 2009 +1000 dix: remove a truly useless a = (foo) ? bar : bar; statement. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 62183a06e5f72a18abc3d58c4bf5658a20ece217 Author: Tomas Carnecky <tom@dbservice.com> Date: Fri Mar 20 16:19:33 2009 +0100 Remove two unused defines in C files These two defines were defined in C files but not used anywhere: dix/window.c #define DeviceEventMasks (KeyPressMask | [...] os/connection.c #define MAXFD 500 Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4e0d7cc506b661b5e5cedf8be6e17aa4c8075aa8 Author: Tomas Carnecky <tom@dbservice.com> Date: Fri Mar 20 16:19:34 2009 +0100 FID, whatever that was, isn't anymore No traces of FID in the xserver nor in the modules listed in util/modular/xorg.modules Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit adf21dba7617542f08309415e315d4b2699c10e0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 19 20:40:43 2009 +1000 include: un-export a bunch of server-only functions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 111ef10375204a6981a5be5c045860854c4da4e6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 19 09:33:02 2009 +1000 dix: move ProcGrabPointer guts into GrabDevice. Yes, this means we have even more arguments to GrabDevice. But it beats having a copy of most but not all of GrabDevice in ProcGrabPointer. Also, reshuffle the order of parameters, the CARD* status is a return value and should be last. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dc153271b6458cacd63a4bc0208594011c6460b0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 18 15:13:00 2009 +1000 Xi: purge old device enter/leave masks. commit 15a969c0fcd4f19f3c560a7037c1a6a58bce51f0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 18 10:21:59 2009 +1000 dix: remove now obsolete mskidx parameter from DeliverEventsToWindow. mskidx would always be dev->id anyway, so if we're already passing in the device, mskidx is superfluous. commit f5409aa026b2cb501170867d04c6e220f3fe0a44 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:51:50 2009 +1000 mi: remove deprecated miPointerAbsoluteCursor Functions that don't specify the device are so last year. commit 46145a9312eaf5dcd0e8b6788ed8219e086f790e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:12:55 2009 +1000 dix: remove coreMods field from GrabRec. Nobody uses it anyway, and it's taking up a whole bit! commit 40e2a61e37109cd9c2ab57954ee40dcf4a062e31 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 12 16:53:56 2009 +1000 Add Get/SetDeviceFocus handling. commit d9b7343eac1157490442cc0fb3b5b6d7d6e9a705 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 12 12:56:18 2009 +1000 dix: even if we don't get a XI1 event, continue processing. commit e11dc10f01603b181e224c90d1dd4abe940f2ce7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 12 10:21:00 2009 +1000 dix: Send HierarchyEvents when devices are added/removed/enabled/disabled. commit 8634e1bcbae9317fc22132f7c9bde1a4a881b9a7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 12 10:42:05 2009 +1000 dix: send presence events when floating and unfloating SDs commit c9483a53bea1f721d2902ac11467f67317e7de14 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 11 16:20:22 2009 +1000 include: add a few prototypes to silence compiler warnings. commit a4b61cfc78d81de02a71fa6ad8a44a06616f6794 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 11 16:08:24 2009 +1000 dix: un-static FixUpEventFromWindow and deal with focus events too. commit 4cc6a96d7171e567a9bd5a10f552bb953077aafb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 10 16:08:14 2009 +1000 input: add support for RawDeviceEvents. commit a668d91e28d5a3042a8ce0d087474883b046869a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 9 16:36:07 2009 +1000 dix: store the xi2mask on grabs and pass it around as needed. This enables passive and implicit passive grabs for XI2 events, except that we don't have the protocol spec yet to request them. commit 32f338263ff7de1a2e76d570c98f5be979c18d4e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Mar 8 21:32:31 2009 +1000 Xi: Deliver XI2 HierarchyEvents when the hierarchy changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 97e89a59572a4be6757510a317c142ec1d82e8f8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 6 23:22:00 2009 +1000 Allow XI2 event selection for AllDevices and AllMasterDevices. commit 808a158182b0a3b985385899252c190947b4dbbd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 6 14:45:26 2009 +1000 dix: Enable XI2 delivery for events and focused events. No support for grabbed events yet. commit 87ff1159b497c66554a4036ae619f92d5631f00f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 11 09:01:23 2009 +1000 dix: deliver device enter/leave events. commit 04ed0bcb2530866f7248b412974ecd15f0fbf6ac Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 23 17:07:55 2009 +1000 xkb: remove Device/Enter leave handling - XI2 enter/leave don't have compat state. commit 3f37923a727d5fc4b1880a53dac1145884ba7140 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 23 16:12:25 2009 +1000 Xi: send XI2 focus events. commit daf7dd3bfecc9029bdd10c7a4ea5d2c875a89c41 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 11 09:01:12 2009 +1000 dix: Add GetWindowXI2Mask helper commit 8b6a370058ad5a20e0a0e49ec9443daf03775de8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 23 15:58:07 2009 +1000 Add XI2 masks and XISelectEvent() request handling. XI2 event masks are simply stored in the OtherEventMasks as a separate field. This replaces the XiSelectEvent code. commit 38bba0c1b75b84e8bbdfa7975cf701a9414a3afd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 20 16:07:33 2009 +1000 Xi: Change ChangeMasterDeviceClasses to new XI2 events. Split ChangeMasterDeviceClasses into an extra XISendDeviceChangedEvent that assembles the XI2 wire event for the DeviceChanged event. Re-use this when detaching the last SD. Not quite perfect yet, we still copy the device classes from the slave now rather than from the data we had when the event occured. But it's a start. (We can now unexport SizeDeviceInfo and CopySwapDevices, not needed anymore) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 181e41511d5772962b8bc998a1940d2a9ba62d5e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 23 16:14:51 2009 +1000 dix: fix up device enter/leave for XI_Enter/XI_Leave. commit 0befeb36c175b14eac8d5416851f1556af90dd86 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 24 15:27:07 2009 +1000 dix: Add device info to DeviceChangedEvent, and fill in CCCE. We need to fill the info here, as the device may change until we get a chance to process it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b2ba77bac4fc3edab39372dfdc529e745ae74f77 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 5 14:23:47 2009 +1000 dix: add EventToXI2 and GetXI2Type. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dfa2e8e966b699f9d292628119d5a9cbd2dbdf5a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 23 15:12:32 2009 +1000 Xi: add XIQueryDevice request handling. commit 560c58b53e4e60ebd26e0c66dd00399c438bd619 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 20 15:17:52 2009 +1000 Xi: name-space and fix XI2 requests All XI2 requests have XI prefixes. Requests affected: ChangeDeviceCursor QueryDevicePointer WarpDevicePointer SetClientPointer GetClientPointer XIChangeDeviceHierarchy. commit 903449615b1a1188955c0287a552aec8ac5b3fbb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 20 15:03:35 2009 +1000 Xi: add XIQueryVersion request handling. commit 77d51b94bd264be5a8625a2bdd98f2bfb2aa33d3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Mar 8 11:47:26 2009 +1000 dix: FixUpEventForWindow needs to handle XI2 events. commit 95ed2ab715fa881d36d508adf4ae5dadd92ae7b2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 12 11:46:07 2009 +1000 Add XI2_EVENT check. commit 92e0a324b5c738166ed4046cb00fe85ab8aea5a0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 12 14:15:02 2009 +1000 require inputproto 1.9.99.7 commit 906fe9547957917ac463d646935473ceca10a72b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 20 09:36:09 2009 +1000 Xi: don't allow OpenDevice on any MD. This restores the original behaviour of XI 1. Any slave device may be opened, but none of the MDs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c7eb27f3927ba9a36f9904938996f346cca33021 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Mar 4 18:45:09 2009 +1000 Xi: always only list VCP/VCK and the SD's in XListInputDevices. If a client wants other MDs, it should use XI2's XQueryDevice() instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 801f14d4b742e506201b619d472087a7e82bd018 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 3 17:04:08 2009 +1000 Xi: don't send attachment info down with ListInputDevices. commit 66dd8879b3527f30309fb747cad4a161d0709d91 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 20 15:01:05 2009 +1000 Xi: purge ExtendedGrabDevice request handling. commit 43e48900fccd245e98d6d697e4cdbb6fa866a0dd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 6 22:27:54 2009 +1000 dix: Force deviced ids of 2 and higher for actual devices. 0 is now reserved for the "AllDevices" virtual device. 1 is now reserved for the "AllMasterDevices" virtual device. This also means that wherever we passed in (mskidx = 0), we now need to pass in the deviceid. commit 70896f6127e2c12c13479a027fdd6e67853d1f8b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 13 16:42:02 2009 +1000 dix: abstract event filters through GetEventFilters. Don't let everyone acces the filters[] array directly. This is necessary once we start dealing with GenericEvents, where the filters are a bit more complicated. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8a8763f1502c9ddd1961f96f2cc7c73fbc0b49b5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 16:07:15 2009 +1000 dix: restructure DeliverEventsToWindow, a little bit anyway. Desperate attempt of making the code easy to read and understand. A failed desparate attempt, possibly. commit 891cfc802028c3e008ee6c2d3e2438a31f57f39f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 10:12:45 2009 +1000 dix: clean up DeliverDeviceEvents. Move mask checking into external function and streamline the code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6b6b660c3633af75a94302725137549df0dbe446 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 10 10:15:45 2009 +1000 Xext: remove ev_fill from GEExtensions. commit 445daa62e720fe58fa2d6c3cdc26663671b2bc48 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 15 17:16:22 2009 +1000 Xext: purge XGE event masks. The masks were originally designed to generically handle event masks for extensions. Since all that is in-server anyway, it's much better writing custom event masks for those extensions that need it and not providing a unified mechanism. XI2 needs more than the current implementation, which is already too complex for most other extensions. good riddance. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6fe4c28bf4f3a9f7c341b9403213470e9ded5cb3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 16 16:34:05 2009 +1000 Add agressive event type checking. Best to FatalError if a wrong event comes in. At least that forces me to fix it really quickly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 836864b65794dc0954a01245e418e714cead8125 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 12:43:17 2009 +1000 xkb: don't overrun the map index when accessing symbols. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 497a12533905b98f388775b6ba49adf21017cc75 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 11:52:33 2009 +1000 dix: remove duplicate PickKeyboard() command. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7d4df0ee4414779ad5e519e7bd297c5dfec409a3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 19 20:24:06 2009 +1000 dix: fix device sync state when calling SyncBoth during AllowEvents. This did access the wrong device's sync state, potentially freezing or not thawing the actual device that was supposed to be thawed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f1c7b95d83948160a0d5796ef6c16fc0d1bf5c5d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 20 13:55:00 2009 +1000 dix: do percentage check before device check in ProcBell This is just for correctness. The server should return BadValue for anything not in [-100, 100]. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d60391d8ca9918d2089c23c0baef5c91177325f0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 20 14:01:30 2009 +1000 dix: fix uncredible fail in PostSyntheticMotion. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1a71862d333282e2d251ff0036866cec22bcce85 Author: Simon Thum <simon.thum@gmx.de> Date: Sat Feb 28 22:17:47 2009 +0100 dix/xfree86: simplified velocity approximation algorithm Replace multi-stage filtering with simple linear velocity, tracked several instances backwards. A heuristic ensures only approximately linear motion is considered, so velocity remains valid in any case. Numerical stability is much better, and nothing changes to people who didn't tune the advanced features of the previous algorithm. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5ae129baef85b47590c02e4cf61b23904d8f7aa9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 17 15:47:57 2009 +1000 Xi: check for existence of the button class before accessing it Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e8094d8f3f69f45850af031efd79a3928e584638 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 19 10:09:04 2009 +1000 dix: ProcSendEvent shouldn't use inputInfo.keyboard directly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 12aeddf5ad41902a180f8108623f356642b3e911 Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Mar 19 19:07:59 2009 +0100 exa: Accept scratch pixmaps with offscreen memory as such. commit a635bb5357648779815ec6729d55f6b478493213 Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Mar 17 19:34:45 2009 +0100 exa: round of fb_pitch to the next byte commit ec328783593339e33772301a8c5fea35fd63c0a2 Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Mar 17 10:45:21 2009 +0100 exa: check if the pixmap is pinned for unsupported AUX indices. commit 3992dd38caf33b343affd8d732c94880d1099dcf Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 16 13:24:48 2009 -0400 selinux: Add support for avc_acquire_netlink_fd() Requires libselinux 2.0.79 or newer. Without this, libselinux will check for policy updates on the netlink socket on basically every policy lookup. Statistically speaking, they never happen, and the check translates to at least one more syscall on basically every operation. Instead, take control of the fd from the library, and check it in WakeupHandler if it polls readable. commit be6dc9023b5fb3995a9ce56d607627e247918aef Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 16:29:36 2009 +1000 xfree86: remove a superfluous assignment. If dev is NULL, we don't have a VCP and that means we have other issues anyway. commit bfab422dcdbb9c009b2a91fe0dba288fac9bc859 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 16:27:49 2009 +1000 xfixes: useless (void) typecast removal Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4eeaee1e5a05ea973cbeb653abf99f2a352edc70 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 16:25:12 2009 +1000 xkb: xkbi has a pointer to the device - use this instead of inputInfo.pointer. commit 3f801ba62ac493d4aeb664a5ae638e3fb0c9a262 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 16:23:50 2009 +1000 xkb: the VCP can post device events, don't stop xkb filtering on it. commit 23686e5680d565c36e0b6320ce62c38c7830d06b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 16:20:56 2009 +1000 xkb: Fix a mis-use of inputInfo.keyboard. commit c97c6c3de337f247406eaffd5845a847630ee6c1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 16:17:20 2009 +1000 xkb: fix a couple of device checks when looping through all devices. Generally, we want to apply stuff to the device and to all attached slave devices. commit d21a546e9604ce2d3c914900f6e6ff2df9f5ca8b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 16:02:22 2009 +1000 Xi: VCP and VCK may register for ext. events, so delete them if necessary. commit 6ec49098f7ef259b43870139511006627b308bb6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:57:27 2009 +1000 render: replace a wrong inputInfo.pointer with pDev Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0b2b330f6fbf8633ae682a17fbd95f6b5db2c112 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:54:27 2009 +1000 mi: remove a bunch of useless inputInfo.pointer assignments. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 31301861c1dd87a2f55c5c4300ac7c8f54154bf8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:49:22 2009 +1000 dix: remove wrong InputInfo.pointer usage - should be pDev instead. commit 639658b2eab480a5bfb943dff51e4bdfc1e16e3b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:34:29 2009 +1000 dix: use GetPairedDevice in ProcQueryPointer rather than inputInfo.keyboard. commit f01ee198ff0cbd7ca418217a84248d1c6131a0c6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:22:23 2009 +1000 dix: don't use inputInfo.keyboard to get the focus window in ActivateKbdGrab I'm not sure if that's the right solution, but the other one is wronger. commit de415743f4c1878df2de79f84f5fe087a88d5241 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 15:19:23 2009 +1000 dix: fix XACE checks in ProcWarpPointer commit 18430616cfd5d0bc5a3efe61fcc2982b1726b0de Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 14:59:18 2009 +1000 dix: use PickPointer() and PickKeyboard instead of inputInfo.pointer/keyboard. Affected calls: ProcChangeKeyboardControl ProcBell ProcUngrabKey ProcUngrabButton commit e31727158cda7729283233cfdc9bc5bcb59a52c1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 13 14:51:55 2009 +1000 dix: fix ProcChangePointerControl's wrong inputInfo.pointer usage. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fc5e8dc4a24c2b5bed4e6b5d00670c4401ec92d9 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 13 14:00:37 2009 -0400 Unexport xf86SetPriority commit 89d7b88f32f9227fa72a043675367b94c4c9283c Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Mar 13 00:40:43 2009 +0100 exa: allow exaModifyPixmapHeader to set sys_ptr for EXA_HANDLES_PIXMAPS - exaModifyPixmapHeader would save sys_ptr if needed, but it would be NULL'ed afterwards. - This is needed to support pixmaps that are not offscreen. commit 544cd9e7b50cd9905afc52404de1a5a2bcff91b5 Author: Ander Conselvan de Oliveira <ander@mandriva.com.br> Date: Thu Mar 5 12:57:28 2009 -0500 Honour Option "DPMS" "off" on xorg.conf Signed-off-by: James Cloos <cloos@jhcloos.com> commit 7abb72c5c711a26a27a82604bd2398bcb6df0a99 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Feb 25 10:55:36 2009 +0100 xfree86: remove obsolete code remove a few lines which redo part of the pointer acceleration init. Properties is the way to go for them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 97cb3cc28e4a5694d17f156276efd84555a96d18 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 12 10:17:16 2009 +1000 dix: Merge DevicePresence notify events generation into a single function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7f1ba804a1c1aef725e20a04e5f6ef74478ecf44 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Mar 10 11:55:04 2009 +1000 dix: s/numEvents/num_events/ in GetKeyboardValuatorEvents GPE and GProxE use the same. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 067f26f7ba4c8cf37af7ddf0eb204b7e1d06096d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 6 19:42:27 2009 +1000 Xi: set the modifier + group state during POE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit da724e8f1d1867c36c9550a153c58829939800fc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Mar 6 15:50:05 2009 +1000 Xi: Set the button state on the event during POE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b368dd1720c708aaec492b4a67fb7e4f87569c11 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Mar 5 15:22:41 2009 +1000 dix: remove a few pointless (void) casts of return values. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cadf65a6e190a8952ad3cc216dc9ea55241de91a Author: Matthias Hopf <mhopf@suse.de> Date: Tue Mar 10 15:49:49 2009 +0100 randr: Nuke broken set_origin shortcut Shortcut is impossible to implement this way, because we don't know for sure whether the crtc of an output has changed or not. commit 6544490700051b3b5e88ac1890d71b35634c9100 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 9 17:28:40 2009 -0400 Correct access mode in call to dixLookupWindow() within RRSelectInput. Reported by Alan Coopersmith. commit f8dd80d13bb5313a11b38b280f8ad3e22f0a6300 Author: Keith Packard <keithp@keithp.com> Date: Wed Aug 6 15:26:24 2008 -0700 Replace dixLookupResource by dixLookupResourceBy{Type,Class} dixLookupResource attempted to automatically detect whether the caller wanted a lookup by-type or by-class, unfortunately, it guessed wrong for RT_NONE. Instead of trying to make the guess better, this patch just reverts the unification and creates separate functions for each operation. commit 0d9a42dc0380d1583889b6b6521bd5a2451735d4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 9 08:59:01 2009 +1000 Xi: don't crash on a NULL property name, just return None. strcmp doesn't like NULL-pointers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 432a95032eb10f82fb59caa29e52d3f56dfb363c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Mar 8 21:34:02 2009 +1000 Remove useless (void) typecasts. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f508446a2bcd887df9cf5db786b15fc3cbc435a0 Author: Peter Åstrand <astrand@cendio.se> Date: Fri Mar 6 19:41:35 2009 -0800 Composite: Uninitialized borderClipX/borderClipY Valgrind warned me about two other uninitialized variables, which are not padding. Valgrind output at the end. I'm a bit unsure of what these should be initialized to, is zero fine? commit d1338a94805cc774fe0a5d00c2225a3ee9673a9f Author: Winfried Grünewald <winfried.gruenewald.ext@eizo-dt.de> Date: Fri Mar 6 12:59:35 2009 -0500 [hw/xfree86] Fix StaticGray cmap. Fix this bug report: ,----< from http://bugzilla.freedesktop.org/show_bug.cgi?id=20504 > | Using the Visual StaticGray (8 bit depth) is missing one gray level. | The gray level of index zero and index one are the same and all | other levels are shifted by one. The max level (255) cannot be used. `---- Signed-off-by: James Cloos <cloos@jhcloos.com> commit eba3bab71ff26d58bb0e49e4a9726fc21ff07258 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Mar 5 15:09:28 2009 -0800 Remove #ifdef macII code left over from ancient A/UX 3.0 support Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit daa9727a02701cfac7b92f3e61d752be6fcc005e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Mar 4 11:33:00 2009 -0800 XQuartz: Implement SendPSN for AppleWM (cherry picked from commit 779e9fdc2de9bfebc5f0a4c9d5f42e389fdd8593) commit ce6e1771be5f2c21af6f72a9705795df26210413 Author: Maarten Maathuis <madman2003@gmail.com> Date: Mon Mar 2 17:05:28 2009 +0100 exa: fix a serious issue in exaChangeWindowAttributes (and some more related things) - fbChangeWindowAttributes can create pixmaps (and access them) without use preparing access. - Also handle the destroyed pixmaps by finishing them first. - Switch to DEST indices again in exaCreatePixmapWithPrepare, because they are obviously being rendered to. - Also avoid calling FinishAccess on pixmaps that are destroyed (and their memory potentially invalid). commit 7fb68e8b31d259325ce311ad67befc43a933f009 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Feb 28 22:29:42 2009 +0100 exa: remove a few pExaPixmap checks. - And make some fatal for a debug build. commit bd2f35ef0d4b8c56eb205b8694b4fe5d2fa2c049 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Feb 28 22:15:04 2009 +0100 exa: fix unwrapping of ModifyPixmapHeader upon CloseScreen. - Cleanup wrapping too. commit da8ea41a542787691ea1120e5c8c7dc3182cbea5 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Feb 28 21:59:09 2009 +0100 exa: increase/rework safety checks in Prepare/FinishAccess. commit 3ea3d505e8128ab3e878edcef697fd5656b0c917 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Mar 1 01:15:28 2009 +0100 exa: avoid a potential Prepare/FinishAccess inbalance. commit 10334cf7e64e2e633cd507f2aa216027e840c8e5 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Feb 28 21:46:00 2009 +0100 exa: simplify exaPixmapIsOffscreen - This includes properly handling the framebuffer. commit 57bed76e218471b60d340b18c346d492f37798c2 Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Mar 4 10:29:34 2009 -0500 Remove dead EXTENSION_PROC_ARGS define Signed-off-by: Tomas Carnecky <tom@dbservice.com> commit a6fb9f4ccfc69dc090b152e29142e3159f812166 Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Mar 4 10:27:30 2009 -0500 Remove dead XTest code from extmod Signed-off-by: Tomas Carnecky <tom@dbservice.com> commit c4081fee0995dae691665a00ea9bfdb8b8043b8c Author: Topi Kanerva <topi.kanerva@nokia.com> Date: Wed Mar 4 10:23:10 2009 -0500 Make DGA optional. commit c7ebb4bef152b47880abb6ea4819416e89e6522c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 3 14:02:36 2009 -0500 Fix 2 const warnings. commit c7cf926d25523d5d0d8e5c83671c901660070d71 Author: Eric Paris <eparis@redhat.com> Date: Tue Mar 3 13:15:39 2009 -0500 This patch changes all places in the X code to use _raw functions. The X server should never see, translate, or deal with a munged context. Display managers which show contexts to the user should take care of translating these to human readable form. commit d84a2f855da9fd293e984084168c1e27f5a5115c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Mar 1 16:59:14 2009 +1000 xfree86: Add linebreak to two debug statements. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e0ed9f16d0ab871f3209837f54055446503c4108 Author: Jason Vas Dias <jason.vas.dias@gmail.com> Date: Tue Mar 3 13:24:54 2009 +1000 Fix build with --enable-debug. [amended by Peter Hutterer] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6093d3eb1d7d1e9cbacc2c2f4d376352f787dd53 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 26 15:38:45 2009 +1000 dix: fix two compiler warnings (old-style function definition). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b874a5c0aafc766891c9e567af48b891ea14be4f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 26 14:40:22 2009 +1000 mi: only print the "EQ overflowing" error once. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a706dd8771f87cf0a73578755552124d162baa5d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 26 10:04:14 2009 +1000 include: add a range of button labels. Mostly the same buttons as defined by linux/input.h, with five exceptions: "Button Unknown" for a button that cannot be labelled. "Button Wheel Up", "Button Wheel Down" for buttons 4/5, traditionally the wheel buttons. "Button Horiz Wheel Up", "Button Horiz Wheel Down" for buttons 6/7, traditionally the horiz. wheel buttons. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit 8a6ed44a8b2fc5f14729dc54fec17607ced03859 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 2 14:26:23 2009 -0500 randr: Fix thinko in xf86TargetPreferred The only-one-output case would only work right if that also happened to be the zeroth output. Oops. commit 7bfad37f7706da5a76174c0da78dce4d6c6a585b Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Feb 27 22:26:52 2009 +0100 exa: fixup aux indices and ensure that the indices are used as they should be. - In a previous patch i forgot to add a FALSE somewhere it seems. - Rename AUX indices so the driver (think of driver managed pixmaps) can do optimisations based upon them. - Fix one abuse of DEST index now that we have the AUX indices (same reason as above). commit 8c6b4a827624aa70aea94b449fee6d5df8504105 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 27 12:42:43 2009 -0500 DDC: Redo extended device probe slightly. We'll now only mention the E-EDID segment register if the device is actually E-EDID-capable. While we're here, check for DDC/CI and standard EEPROM support too. commit b030f858f2f1ce1fd27a73ebf7f9ec5db541a668 Author: Adam Jackson <ajax@redhat.com> Date: Sat Feb 21 19:56:20 2009 -0500 selinux: Don't bother relabeling resources that are being destroyed Makes window destroy about 40x faster in Xvfb. commit f028b14876dc536b575d4b6e1df7f37ee525acec Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Feb 27 13:06:28 2009 +0100 exa: whitespace commit ed00515ec54b294f304b8ae2857e3073f97860d2 Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Feb 26 22:18:03 2009 +0100 exa: fixup exaAssertNotDirty. - Do the right thing based on prepare access. commit 2e88b6004f09dbcb888abf05d4d5554231b2bd1a Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Feb 26 21:14:23 2009 +0100 exa: minor glyphs cleanup. - This should fix subtle coordinate bugs and make the code a bit cleaner to read. commit 265d20068af5434489752b6dba0bf0065b3cc3ec Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Feb 27 16:41:39 2009 +0100 EXA: Fix check for whether the glyph we're evicting from the cache is in use. Since commit f07f18231a921d3ae9dd9b75881c9e58e9e2e235 ('EXA: Allow using exaCompositeRects also when we can't use a mask in exaGlyphs.') we were checking the wrong set of coordinates in the buffer where glyphs to be rendered are accumulated when no mask is used in exaGlyphs. This fixes occasional glyph corruption which can be corrected with redraws, in particular with Qt4. Thanks to Maarten Maathuis for asking the right question: 'where do we protect against evicting glyphs that are still needed?' Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 9d5141f7bcfed36417873b47f850332506af83ac Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Feb 27 16:37:28 2009 +0100 EXA: No longer use the driver UploadToScratch hook. See http://bugs.freedesktop.org/show_bug.cgi?id=20213 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 4cfb36f6ad2df01215028fec48d99239a0e4496b Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Feb 27 16:37:28 2009 +0100 EXA: Handle separate alpha maps properly in Composite fallback, take two. Preserve the EXA ABI by introducing a new driver flag EXA_SUPPORTS_PREPARE_AUX. If the driver doesn't set this flag, we have to assume any Prepare/FinishAccess driver hooks can't handle the EXA_PREPARE_AUX* indices, so we move out such pixmaps at PrepareAccess time. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 4bf707f01822abe99286909fd561da7e7a4211d6 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Feb 27 16:37:27 2009 +0100 Revert "Fix up Xephyr build for recent EXA changes." This reverts commit 4e8d98b61e1f763c187e7994c683b543cca1a33c. commit de022f8e634baf5a7acd186934b370647df58355 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Feb 27 16:37:27 2009 +0100 Revert "EXA: Handle separate alpha maps properly in Composite fallback." This reverts commit 170cf1270dff38d3cce7f5ba5b940d1c0d70eff5. Conflicts: exa/exa_render.c commit d0dd649035fc3698c5b436f9d9d248116aa106a3 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Feb 12 16:03:16 2009 +0000 Remove references to rgb.txt from files section of Xserver and Xorg man pages The references to this file in the server code were removed in commit dda10c9066a660b647384179f82e1da8e063264f Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b0ad9e1ced9619f37acf77764c395c57b86cf463 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Thu Feb 12 16:02:17 2009 +0000 Remove long-gone '-co' option from Xserver man page The '-co' option was removed in commit dda10c9066a660b647384179f82e1da8e063264f Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 7907b37d96dc81f333351a6fedd6a9f4e31ae66a Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Feb 26 21:22:48 2009 -0800 XQuartz: Don't erase the mode_switch+keysym if it's the same as shift+keysym (cherry picked from commit 3e2427e6e9675dd655c8ad328b82e12191b064f2) commit f07f18231a921d3ae9dd9b75881c9e58e9e2e235 Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Feb 26 10:35:44 2009 +0100 EXA: Allow using exaCompositeRects also when we can't use a mask in exaGlyphs. This should give the full benefits of the glyph cache even when we can't use a mask. This also means we no longer need to scan the glyphs to see if they overlap, we can just use a mask or not as the client asks. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit b26c136ee9bf7015c583136af53d0c9e9da67ace Author: Michel Dänzer <daenzer@vmware.com> Date: Thu Feb 26 10:35:44 2009 +0100 EXA: Stop tracking damage for pixmaps subject to ModifyPixmapHeader. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 812e8d681a49b33d8748983843799ef692b8b148 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 25 11:08:01 2009 -0800 Oops. 62fc98c had crtc offsets applied backwards (fix from server-1.6-branch) Crtc offsets are in screen space, not crtc space, and hence should be applied relative to the screen->crtc transform, not the crtc->transform. This fix was found in the 'cherry pick' of 62fc98c on server-1.6-branch, clearly some new definition of 'cherry pick' that I am unaware of. Signed-off-by: Keith Packard <keithp@keithp.com> commit c090f5514d28e1602a6ebbe7c909e98a0e3374d7 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 25 10:14:36 2009 -0800 Pre-clip panning coordinates to keep crtc within panning region There is a separate panning region check, but that doesn't work under transformation, so just pre-clip the mouse coordinates when computing the panning offsets. This leaves the case where panning constants are changing unresolved. Signed-off-by: Keith Packard <keithp@keithp.com> commit 77c7a64e8885696665556c9fbcb3cffb552e367a Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 25 10:12:23 2009 -0800 RandR rotations and reflections offset by one pixel The matrix computation for rotation and reflection resulted in dropping a row or column of pixels as the offsets used in the matrix computations used width and height rather than width-1 and height-1. Signed-off-by: Keith Packard <keithp@keithp.com> commit 4e8d98b61e1f763c187e7994c683b543cca1a33c Author: Michel Dänzer <daenzer@vmware.com> Date: Wed Feb 25 10:26:04 2009 +0100 Fix up Xephyr build for recent EXA changes. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit d6976e1436c035b8e4a6d1e10971b083b1b4184b Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Tue Feb 24 23:12:57 2009 -0800 XQuartz: Re-enable support for capslock (cherry picked from commit 4901b8147e593d26d7a31a9b73a201254b948916) commit 4b63f88b0ad5f6614fee5b7af4f97ce4581ab935 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Tue Feb 24 18:54:16 2009 -0800 XQuartz: Comment out the background pointer interaction that seems to be causing CPU spinning on some configurations (cherry picked from commit 1d479fa4f3bca9cbd81808a6c87582422fd2a257) commit 5672e2d66444be74125c71b81373b82f8e1b7dd2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 20 14:55:51 2009 +1000 Xi: remove AllExtensionVersions. Keeping an AllExtensionVersions array to save all versions of all extension is rather pointless if only one extension uses it. Rename to XIVersion, reduce to a single struct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 59bc615ed2e60c595887dcc11fe04935b49bcaff Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 24 15:26:20 2009 +1000 dix: set the valuator mode in set_valuators We only have per-device mode for now anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cffa3c499a0495e132557bd6b08a8c0b858cdf3b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 24 15:25:49 2009 +1000 dix: remove unused variable 'tmp' Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8d6dd83a38020080808705a156d32ec2a135633c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 20 13:13:58 2009 +1000 include: fix indentation for lastSlave/master. Yeah! Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b3412adca8b2ba3fff348bceb4f01b9e968c0afc Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Feb 22 20:53:46 2009 +1000 Xi: don't need to set the XKB settings for new core devices. This is done by the XKB code these days anyway, so we might as well ignore it and keep using the stanard stuff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a180c2367974abe2ccdc88bb5c6f138c7df4d2e9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 23 16:38:41 2009 +1000 dix: remove ConvertBackToXI. This was a temporary solution for the internal-events rework and is not needed anymore. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 26cf709e712573548990d165e71137f28271a8bb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 23 22:39:08 2009 +1000 Doxygenify events.h and eventconvert.c Should have done that before pushing, but oh well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 170cf1270dff38d3cce7f5ba5b940d1c0d70eff5 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Feb 24 09:22:09 2009 +0100 EXA: Handle separate alpha maps properly in Composite fallback. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . As this can't work without new EXA_PREPARE_AUX* indices, this requires a major version bump, so we can also drop the UploadToScratch driver hook and ExaOffscreenSwap*(). So this also fixes http://bugs.freedesktop.org/show_bug.cgi?id=20213 . Moreover, introduce EXA_DRIVER_KNOWN_MAJOR to break compilation of drivers which may not be able to handle EXA_PREPARE_AUX*, giving instructions how to make them build again in the #error message. Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit d3b355875ac46104a174966e1974e6af99e40fd6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 24 11:14:14 2009 +1000 dix: fix wrong condition for setting valuators on the event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ef320bdd5ec3419abba77041d3a4d96a3ff87563 Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Feb 23 16:49:51 2009 +0100 DRI1: Make DRICreateDrawable return TRUE for pixmaps. GLX_EXT_texture_from_pixmap was broken since commit a26c77ff432d2e85a2665fc36fca25143460c476 ('glx: fix retval checks when failures occur for drawable creation.') Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 1df6716281579e2937743d840ab1079343c503ac Author: Adam Tkac <vonsch@gmail.com> Date: Mon Feb 23 09:28:26 2009 +1000 xfree86: don't try to UnInit virtual devices in DIDR. (#20087) DeleteInputDeviceRequest function doesn't handle "virtual" devices well. TightVNC libvnc.so module to X (which makes bare Xorg VNC capable) uses such kind of devices. Bare Xvnc (it is something like Xvfb) simply uses AddInputDevice & RegisterDevice functions. Xvnc uses DeleteInputDeviceRequest from Xi/stubs.c so everything works fine (now I see that DeleteInputDeviceRequest in Xi/stubs.c should call RemoveDevice function, shouldn't it? :) ) Situation is quite different when you use libvnc.so module. It uses same schema as Xvnc, so it simply calls AddInputDevice & RegisterDevice. Thus device is created correctly. When server is terminated it calls DeleteInputDeviceRequest (now from hw/xfree86/common/xf86Xinput.c) for each device. Here is the difference - Xvnc calls DeleteInputDeviceRequest from Xi/stubs.c as I wrote above. Thus Xorg gets sigsegv because "VNC" devices don't have real input driver. X.Org Bug 20087 <http://bugs.freedesktop.org/show_bug.cgi?id=20087> [This isn't really a fix (libVNC should behave correctly) but not crashing the server sounds like an improvement.] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a50c40be1f28467bcef7dc71fab54ebdddacffdf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat Feb 21 08:09:40 2009 +1000 dix: don't apply button mappings to SDs, or the device's MD. (#20122) Only ever change the button map on the device we actually care about, not the attached SDs, not the current MD of the device. X.Org Bug 20122 <http://bugs.freedesktop.org/show_bug.cgi?id=20122> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit 36583a49965c0bb40a84284939b1539b3cb9fc9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Feb 10 12:45:49 2009 +1000 mi: split EQ popping and event processing into two functions. mieqProcessInputEvents() - pop an event off the EQ and pass it to mieqProcessDeviceEvent() - process the event according to the MD/SD hierarchy. This way, we can use mieqPDE() from Xtest, xkb, and others to post an event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 47f136ed6fd80310f715a2555501d1b271dd084c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 6 12:08:43 2009 +1000 mi: change custom handlers to internal events This should re-enable DGA, but XQuartz needs to be changed to internal events too now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bdc262701a37a0c12ead810d63fa99a26cbb82ec Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 22:39:37 2009 +1000 dix: remove un-used getValuatorEvents and countValuatorEvents from getevents.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 763848d3ab84b4e33a0254120c44b5a1877c819d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 17:20:17 2009 +1000 Input: change processing API to InternalEvents. Don't pass xEvent* and count through to processing, pass a single InternalEvent. Custom handlers are disabled for the time being. And for extra fun, XKB's pointer motion emulation is disabled. But stick an error in there so that we get reminded should we forget about it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0b4066c116e07918a13dc6b4159df7ac9eb92b4b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 17:18:16 2009 +1000 xkb: _XkbFilterRedirectKey needs to pass InternalEvents down. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 085d50360863ccc8280cd3eccea2bcb4f3dd9a14 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 16:56:52 2009 +1000 dix: Fix PostSyntheticMotion to use a DeviceEvent for posting. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 155986a93dc78d6aa060ca3038d5fafa3d8753c2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 16:06:15 2009 +1000 dix: CheckPassiveGrabsOnWindow moved to internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1c38abd4b136301008ba77d4e68aea34508f4c22 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 14:54:34 2009 +1000 dix: switch DeliverGrabbedEvent to internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit fb858774b80eb75c2f8e81fe893bbbdd37065fbd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 14:44:13 2009 +1000 dix: switch DeliverDeviceEvents to internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3aa9404fcd161e94a80b057a77ef47afe428a56d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 14:00:41 2009 +1000 dix: switch DeliverFocusedEvent to internal events. And because of xfree() macro hilarity, rename "pointer" to "ptr". Oh, how we laughed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8c873e7f514844d1056f2b20e653f1dd75f4c327 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Feb 1 20:41:16 2009 +1000 dix: Switch DeliverGrabbedEvents to use internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a3718536989fa7d3358e0b2d859c25fde0a2d93e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Feb 1 20:18:33 2009 +1000 dix: Deliver{Grabbed|Focused|Device}Events API changed to InternalEvents. With the API change, we can now purge the XI conversion from POE. Note: this commit breaks DGA even more. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8f94ec6f788565474931cc7d5e3d4672f0f31670 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Feb 1 09:58:15 2009 +1000 dix: convert passive grabs to use internal events. deviceGrab.sync.event is now an internal event, and CheckDeviceGrabs and friends is changed over. Note that this currently breaks some frozen grabs. See towards the end of ComputeFreezes(). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit daa3245c479b19d445a070b5b76ee005915b5335 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat Jan 31 08:46:43 2009 +1000 dix: fix EnqueueEvent to work with internal events. Note that we're only partially switched to internal events. The event in the devices' event queue (dev->deviceGrab.sync.event) is still an XI event. The events in syncEvents are InternalEvents only now. This also implies fixing CheckVirtualMotion to work with internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 75595ba4aa9c3823ffe3b3388ce088929824816f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 15:14:46 2009 +1000 Xi: make ProcessOtherEvents more InternalEvent aware. Get rid of the deviceValuator processing and a few other things, but still drop back into XI before checking device grabs or doing anything else. NoticeEventTime now needs to take InternalEvents, and while we're at it, change NoticeTime from a macro to a function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3a02e538dbdb3cd482e01baeaf2aba2ddb7731df Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 14:59:22 2009 +1000 dix: update CheckMotion to deal with DeviceEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8829d966a6bacb05d322b60531c59366b58f4514 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 13:33:55 2009 +1000 Xi: support InternalEvents in UpdateDeviceState, parts of POE and EnqueueEvent Note that this breaks DGA. Life is tough. EnqueueEvent is a somewhat half-baked solution, we immediately drop back into XI and store them. But it should in theory work. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Don't let the dcce be random data. commit 007e93c869325cafcc29d975b356dbb8e7cd2ac1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 14:35:22 2009 +1000 xkb: Switch the xkb event processing path over to InternalEvents. Before dropping down into the DIX, convert back into XI events. This is a temporary solution only, until the DIX is capable of handling InternalEvents anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 64ea6078105f73d1b727619fc123920bc7e4a06c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 14:15:52 2009 +1000 dix: change eventconvert to always return an array of xEvents Just alloc the memory on demand rather than doing things with EventListPtrs etc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4026c63e4eb16481bafc1a41ad67cd2556728d40 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 14:34:02 2009 +1000 mi: switch the EQ to contain InternalEvents only. This gets rid of the nevents parameter, InternalEvents are always a single item per event. Also remove the special DeviceValuator handling in both enqueueing and dequeueing. Custom callback handlers are now broken until fixed. For bisectability, we copy the InternalEvent back into the XI required during POE and friends. Consider this a temporary solution. Note: Because of misc linker bonghits, Xvfb won't link in this revision. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5a827593f9517fd5593751dd8bd90c611de06c5d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 29 15:26:57 2009 +1000 dix: switch event generation to InternalEvents. GPE, GKVE, GProxE generate InternalEvents now. DeviceClassesChangedEvents generates an InternalEvent now, but incomplete! We need to tack on the information about the new SD in the ClassesChanged events. Note: To make the progress bisectable, we drop back into XI events at the end of the Get*Events functions. So the rest of the server still uses XI events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 00b03683d0e5cda40fa23b9fe6a83d7227f86f5d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 14:31:08 2009 +1000 dix: Add temporary conversion function ConvertBackToXI. Until the InternalEvents are used throughout the server, we can use this one to drop us back into XI la-la land where every event is the wire format. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 269d4d9f2e86fde8c6a28ef0293fb0e44b577886 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Feb 1 09:57:27 2009 +1000 dix: add GetCoreType and GetXIType. Convert from an InternalEvent type to the matching core/XI type. Currently only for a few events, those we actually need in the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 656491921e17b2371057041f4551ad6165067551 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jan 28 15:27:38 2009 +1000 dix: add InternalEvent -> core/xi event conversion routines. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e7867d12541ef9683d5d7fc766e918c13a742981 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 23 15:37:23 2009 +1100 include: add XInternalEvent. This is the event we want to feed into the EQ and process on the way through. Only applies for input events for now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 10dcf3ed9c543a6811340567e586ec0e476fcf61 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Fri Feb 20 15:22:35 2009 +0000 Cygwin/X: Fix keyboard layout mapping for Latin American keyboards Fix keyboard layout mapping table entry for Windows keyboard layout 0x80a (Latin American), layout should (now) be 'latam', not 'la' which is Laos Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 9531b96470a2fd812eb3fa0d1e10419331842496 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sun Feb 22 00:41:52 2009 -0800 XQuartz: DefineInitialRootWindow is gone commit c7c50157b5137a147e69abb70b43a28fac4a9ffa Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sun Feb 22 00:29:48 2009 -0800 XQuartz: quartzKeyboard compile fixes for recent XKB Changes Seems we're less divorced from XKB than we'd like for now... hopefully not having any rules installed will still let us override things the way we want to... commit 61abf3189f3f97ec5228d45c035dbfd0c249f844 Author: George Staplin <gstaplin@apple.com> Date: Sat Feb 21 22:33:10 2009 -0700 XQuartz: GL: Change from xalloc to xcalloc to potentially avoid uninitialized data in the __GLXAquaContext. (cherry picked from commit d3120241f9f48d21f9a6ecfb848434a4a0270855) commit 5587f9b771f5b5427a81d4d657f403667d20f310 Author: George Staplin <gstaplin@apple.com> Date: Sat Feb 21 22:22:52 2009 -0700 XQuartz: GL: Fix a bug with an uninitialized GLX data structure. This was causing a crash randomly, due to random memory contents. Use xcalloc to prevent this in the future, due to future changes or mistakes. Set the drawableType to include GLX_PIXMAP_BIT and GLX_PBUFFER_BIT. The new libGL supports these. Set the max Pbuffer width/height, based on the results of a test program. We may someday want to revisit this depending on what users need, so that we create a CGLContextObj, make it current, and call glGetIntegerv to gather the information at runtime. (cherry picked from commit c7e338330943e0d03a99328c740540d03f018d20) commit ab61033700b5383a7a15370dd054eaa80e72e811 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Feb 19 13:57:28 2009 -0800 Add Extensions section to xorg.conf man page Extensions section was added in X11R6.8.0 and documented in the release notes: http://www.x.org/archive/X11R6.8.0/doc/RELNOTES2.html#3 but never made it into the man page. Also fix a bonus typo. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit 372977354c3a09ca77ca13ba0aec00a61046f60d Author: George Staplin <gstaplin@apple.com> Date: Wed Feb 18 21:43:19 2009 -0700 XQuartz: Fix the new ProcAppleDRIDestroyPixmap code REQUEST_SIZE_MATCH. It had a copy and paste mistake that I didn't notice. :/ It was using the CreatePixmapReq. Also add a missing B16 to the end of the length for the DestroyPixmapReq struct. Now the AppleDRIDestroyPixmap request seem to work. (cherry picked from commit 295fe25bd8fa2d141291a9d9b6ef7b75fcccb4dd) commit 225853d51d1fb610261ab0c295b1b5a96ce177d5 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Thu Feb 19 06:45:05 2009 -0800 xkb: Use cached XKB keymap when rules haven't changed Rather than compiling a new keymap every time InitKeyboardDeviceStruct is called, cache the previous keymap and reuse it if the rules have not changed. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 64e595d12e05c4df56b0230cc57924b9beb274d3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 19 09:18:53 2009 +1000 dix: check if keybd->key is valid before getting the keyboard state. For floating SDs, GetPairedDevice() returns the SD itself, hence keybd->key may be NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e0a451eb7cc812f11db3614b730ba0f07d6ae18c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Feb 17 19:37:22 2009 -0800 Obsolete InputDevices keyword in xorg.conf Files section Was only used to provide a list of input devices that XF86-Misc could use, now that XF86-Misc is gone, was parsed and logged, then completely ignored. (Depends on previous patch that introduces OBSOLETE_TOKEN in parser to make obsolete keywords like InputDevices & RgbPath be non-fatal errors.) Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Adam Jackson <ajax@redhat.com> commit d2cf562bbad553d7f09b70202134f5b6ada0114e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Feb 17 18:48:52 2009 -0800 Make RgbPath keyword in xorg.conf a non-fatal error Xorg shouldn't refuse to run just because the user has an xorg.conf that had the previously-used RgbPath keyword in it. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 344b1f2b25d627bdf7d802c5831b6a72d22ffe34 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Tue Feb 17 23:25:14 2009 -0800 configure.ac: Support version strings like W.X.Y.Z-XXXXXX (cherry picked from commit 43967514cd57ad836d7fb85c8c9e58ada07e0232) commit 67faf41b3f3e0cd66e35e3c176a9adb37ff1a759 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Tue Feb 17 23:24:25 2009 -0800 XQuartz: Don't need GlxSetVisualConfig any more Fixes build failure resulting from 516f8e2cad1311a09764e2633644188d1e3c31bb (cherry picked from commit 066b17028a35956a089815716e38571f305469c5) commit b349a764e98f0d8f221190157ffa0904b91beca5 Author: Eric Anholt <eric@anholt.net> Date: Tue Feb 17 09:59:17 2009 -0800 xinerama: Put the proto version in the code instead using proto headers. Proto headers updating resulting in the server advertising new versions is broken. This should be applied to every extension. This fixes the build against slightly-older xineramaproto. commit 5394b7e66224d20888dd4020f5cb8ca930720fb4 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 6 06:34:35 2009 +0100 Eliminate the shadow clear on transform change When the crtc transformation changes, the entire crtc must be repainted. This was being done by clearing the shadow and then painting the rectangle containing the screen image; the clear being required as the screen image may not fill the crtc. When changing the transform rapidly, this leads to flashing. Eliminate the clear by painting the entire crtc instead of just the screen rectangle. Signed-off-by: Keith Packard <keithp@keithp.com> commit 76f18b94bd2719a8199334742d021c4d0806187d Author: Keith Packard <keithp@keithp.com> Date: Mon Feb 9 13:09:11 2009 +0100 Add XkbDir to Files config file section The XKB base directory was not configuable through the config file. Signed-off-by: Keith Packard <keithp@keithp.com> commit 123093996507c4d3b6dc457240ce00f8ac42f410 Author: Adam Jackson <ajax@redhat.com> Date: Tue Feb 17 12:59:16 2009 -0500 RANDR: Fail softly on GetPanning if the screen can't do it. Just return a zeroed-out reply in that case. This is unambiguous, and distinguishes "you didn't name a CRTC" from "you named a CRTC that can't do panning". commit b2ceea3635ec05dca9d4aa2f823b96ae9fce7fe8 Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Feb 17 19:40:59 2009 +0100 Revert "exa: the extent of the valid region is probably much larger than that of the pending damage." This reverts commit 97c1cbc70216366e92b9371de608ce94e60aa874. - Sorry for the thinko, pending damage is often not fragmentated. - Should the dst region become fragmentated, you actually want to copy more to unfragmentate it. commit 3175646b10c602d17d5dd37bdace7c1c7ee92b3d Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Feb 17 19:06:35 2009 +0100 exa: exaPixmapDirty should use official damage functions. - Otherwise other users will not be notified of damage. commit 97c1cbc70216366e92b9371de608ce94e60aa874 Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Feb 17 19:01:44 2009 +0100 exa: the extent of the valid region is probably much larger than that of the pending damage. - Since the default has been changed from nothing to everything. commit 4039603413f9f46d7f725463a70b4a51838e0049 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Tue Feb 17 08:27:32 2009 -0800 glx: Inialize best_score before calculating visual scores This bug was pointed out by Peter Åstrand. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> commit bac13e54b164ceff7b921a2d17c4a198b42aeccf Author: George Staplin <gstaplin@apple.com> Date: Mon Feb 16 17:33:19 2009 -0700 XQuartz: Add driWrap.h that I missed in the last commit. This should complete the GLXPixmap commits for now. (cherry picked from commit 7e99b55651bf7f6275bb227d02f203fb885a67a2) commit 95052caa2c8a79981cdc7936888a8a47e09415e0 Author: George Staplin <gstaplin@apple.com> Date: Mon Feb 16 17:22:18 2009 -0700 XQuartz: Add support for GLXPixmaps to the AppleDRI. This involved wrapping some GCOps to get the proper behavior when using X11 raster ops mixed with OpenGL (see driWrap.c). This extends the AppleDRI protocol with create and destroy pixmap functions. The dri.c code has been extended quite a bit to enable this, and to initialize the wrapping of CreateGC for GCOps. This has been tested with tests/glxpixmap and proven to work with the new libGL. Existing applications seem to work fine too. Redraws all appear to be correct. There may be some bugs lurking that I haven't found yet. I plan to drive them out by extending the libGL test suite. (cherry picked from commit 630518766b01022c49fe3a9e7d501808f71b06e2) commit 970725d23e83285d41e3f7cab678a825d9cc25cf Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 16 18:44:00 2009 -0500 kdrive: Nuke dead AGP and VGA code. (#19921) commit a932744d983845f81791045cf0dfb6a359790158 Author: Chris Ball <cjb@laptop.org> Date: Mon Feb 16 18:27:26 2009 -0500 Build fix, remove export of pciBusAddrToHostAddr a9d7d659.. (PCI: Remove pciBusAddrToHostAddr and associated nonsense) removes pciBusAddrToHostAddr(), but not its prototype, resulting in: ./.libs/libxorg.a(sdksyms.o):(.data.rel+0xe64): undefined reference to `pciBusAddrToHostAddr' Signed-off-by: Chris Ball <cjb@laptop.org> commit ab331aa76f0bc6a85a519b2deaafa4ce8a070c53 Author: Julien Cristau <jcristau@debian.org> Date: Mon Feb 16 21:56:03 2009 +0100 xfree86: ModeDebug is a boolean, not a string Signed-off-by: Julien Cristau <jcristau@debian.org> commit f5bf1fdaf36163d5c2f1b9b51df96326ebbb0e9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 13 09:56:22 2009 +1000 xkb: Fix wrong colour reference in XKB geometry copying. #20081 base_color and label_color need to reference the color in the destination, not in the source. X.Org Bug 20081 <http://bugs.freedesktop.org/show_bug.cgi?id=20081> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit a9d7d659a05e4b6b25e6acd2ce59926911aac0f7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 13 18:36:27 2009 -0500 PCI: Remove pciBusAddrToHostAddr and associated nonsense This was all a glorified no-op. We rely on pciaccess to create device maps anyway, so we should have no reason to care about what the host address is. Acked-by: Ian Romanick <ian.d.romanick at intel.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit be8c3d4022faa7d169778ea10d1f11e8f90e1c0c Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 13 17:54:33 2009 -0500 Linux: Remove dead USE_DEV_FB #ifdefs commit 51ae4d6bbfd95cac8a9cdefcd6f22fbe21a6cb9d Author: Ian Romanick <ian.d.romanick@intel.com> Date: Mon Feb 16 12:08:28 2009 -0800 glx: Add comments around some extension string weirdness commit caa5310e163b040689383f6d25ccab5ef1b2e215 Author: Maarten Maathuis <madman2003@gmail.com> Date: Mon Feb 16 20:41:14 2009 +0100 exa: reintroduce src rect optimisation, with a slightly higher threshold. - I got some feedback on gtkperf line test regression. - The increased threshold should ensure the destination optimisation is dominant. commit 46eeaf82e228df1c5971a24dc815566516e19be9 Author: Maarten Maathuis <madman2003@gmail.com> Date: Mon Feb 16 17:17:14 2009 +0100 exa: fix performance regression from 736b6fbd2c941b6276066cd1503523edebe7bf3d - The src optimisation is more aggressive and possibly harmful in light of the new initial state of pixmaps. - There is now actually a performance improvement by almost always keeping the number of rects low. commit 6198373ff2a8e36113bb1dcaebe975530ff01b86 Author: David Nusinow <dnusinow@debian.org> Date: Sun Feb 15 18:36:01 2009 -0500 xorg.conf (5) refer to mousedrv (4). Debian #394058 Signed-off-by: Julien Cristau <jcristau@debian.org> commit 2a8b8077d8f6001eb57deba60e1009fc99c28668 Author: Alan Hourihane <alanh@vmware.com> Date: Mon Feb 16 11:39:34 2009 +0000 dri2: support glXWaitGL & glXWaitX by copying fake front to front and vice-versa. commit ddb8d8945d1f44d16adc366b6612eef20ae813f7 Author: Peter Åstrand <astrand@cendio.se> Date: Fri Feb 13 10:23:28 2009 +0100 xserver: Avoid sending uninitialized padding data over the network Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b735a4b4951b607e614682836f24d5fd86c1f7fb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 14:29:23 2009 +1000 dix: Remove lastEventMask variable, substitute with a #define. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 772e0f9159ca3ab8fb4e03ed6feee3cc93697724 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 13:38:34 2009 +1000 dix: Don't set core events in SetMaskForEvent. Rather, modify the two callers to call separately for the two different. events. Unexport SetMaskForEvent too. And while we're at it, get rid of the MotionFilter macro, because it's one half confusing and one half pointless. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 58f3127919ba5fcb3bb467b6913c28ee1127c82b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 08:37:49 2009 +1000 Xi: remove dynamic mask assignment for XI events. They end up being the same anyway on startup, so let's not have a dynamic mask assignment mechanism and instead just hardcode them already. Also unexport SelectForWindow and remove the valid_masks parameter. We can check that before calling, since there's only one caller anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7057a9a97b9316b1de954d05451e04223fdd9fd8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 22:14:48 2009 +1000 Remove two more define XKB leftovers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 736b6fbd2c941b6276066cd1503523edebe7bf3d Author: Michel Dänzer <daenzer@vmware.com> Date: Sun Feb 15 17:44:51 2009 +0100 EXA: Try to prevent the valid regions from growing too many rects. This helps contain region management overhead in some pathological cases, see e.g. http://bugs.freedesktop.org/show_bug.cgi?id=16647 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> commit 45e14f515337159e600a47ebf349692751552af8 Author: Chris Ball <cjb@laptop.org> Date: Fri Feb 13 20:32:02 2009 -0500 Build fix for xf86EdidModes.c Commit 20ac314.. forgets to declare hsize/vsize/refresh. commit ae68be312619ad3bcb2d550a6267d38cce3284f5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 13 17:25:32 2009 -0500 Input: Don't re-block SIGIO in xf86SigioReadInput() It's already blocked on the way in, because we asked for it to be blocked at sigaction() time. commit c18f454e4a9cab03e5d55b6d761a4a735c943b6b Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Feb 12 18:27:48 2009 -0800 Query the DDX in ProcRRGetScreenInfo. This is the RandR 1.1 version of GetScreenResources and needs to re-query the DDX to see if the mode pool changed. Fixes Launchpad bug #325115. Signed-off-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 660c2a7d4c6cb52fd0992e9d2008a24805dc8c02) commit 20ac3140ce16af460992b83aa8aeff4afe28c2ee Author: Adam Jackson <ajax@redhat.com> Date: Mon Feb 9 13:36:05 2009 -0500 EDID: Hack for 1366x768 in standard timing descriptors All you get for standard timing descriptors is horizontal size in multiples of 8 pixels (which means you can't say 1366) and height in terms of aspect ratio (which means you can't say 768). You'd like to just fuzzy-match this by walking the DMT list for sufficiently close modes, but you can't because DMT is useless and only defines a 1360x768 mode, because it's _also_ specified in terms of character cells despite providing pixel exact timings. Neither can you use CVT or GTF to generate the timings, because they _also_ believe that modes have to be a multiple of 8 pixels. You'd also hope you could find a timing definition for this in CEA, but you can't because CEA only defines transmission formats that actually exist. So there's 480p, 720p, and 1080p, but no 768p. And why would there be, after all, the encoded signal is never 768p so obviously no one would ever make a display in that format. So instead, make a CVT mode since that's likely to be handled well by just about everything, smash the horizontal active down by 2, and shift the sync pulse by 1. Underscanning the hard way. Pass the suicide. commit bcafdfbed6f1e1f901c2459f60f94a0da506bd90 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 13 14:06:07 2009 -0500 RANDR: Validate entire mode list for interlace and doublescan Otherwise drivers have to refuse interlace twice: once in the output config, and once in ->valid_mode() to catch output and config modes. If you can't do interlaced modes, asking nicely for it in the config isn't going to suddenly make it work. commit a26c77ff432d2e85a2665fc36fca25143460c476 Author: Alan Hourihane <alanh@vmware.com> Date: Fri Feb 13 13:45:08 2009 +0000 glx: fix retval checks when failures occur for drawable creation. commit a38ca0063c91ef221f20bf0c4ac0dc84ce07d557 Author: Benjamin Close <Benjamin.Close@clearchain.com> Date: Fri Feb 13 14:44:53 2009 +1030 xext: Use proto header rather than the Xext include file, this prevents userspace being pulled in causing issues Signed-off-by: Benjamin Close <Benjamin.Close@clearchain.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit d62c085f36892c327785e85571bd2c7c70513ac6 Author: Benjamin Close <Benjamin.Close@clearchain.com> Date: Fri Feb 13 14:44:09 2009 +1030 dix: Remove includes which are not actually used directly Signed-off-by: Benjamin Close <Benjamin.Close@clearchain.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit 340f1576afcdaf883d185da356e5d6282aa65e19 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 10:44:27 2009 +1000 dix: remove DefineInitialRootWindow() Obsolete. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c178c3f814f7666f43cbf47d24c7543b289f9b1a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 15:29:38 2009 +1000 dix: doxygen-ify enterleave.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cc696a2b7928ec497b6a0df3602fc70dec83a629 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Feb 12 15:05:57 2009 +1000 Doxygen-ify bits of events.c commit 8364bf7374aa5f6d991700f0c02921dc6c638c9f Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 11 16:06:36 2009 +1000 Document the event masks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ed9d58c3c25ee1b3dedbc4c116823c263ccf164d Author: Simon Thum <simon.thum@gmx.de> Date: Sun Feb 8 17:21:09 2009 +0100 dix: refactor pointer acceleration The algorithm is split in a 2D-specific and a general part. This potentially allows to accelerate more than just screen motion. A state machine is intoduced to make code more explicit and readable. It also improves handling of 'phase 1' mickeys when axial correction kicks in (corner case). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ac470dfb4fadaa0b28b6f8b57f4f13a20842b897 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Feb 12 18:34:22 2009 -0800 Check for and report errors writing xorg.conf.new from Xorg -configure Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit bd713794ceaa1b2890522554562103c0a2d50f04 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Feb 12 18:23:59 2009 -0800 Correct error message if specified config file is not found By making the "Unable to open config file" header a warning, it was not appearing with the filename when a config file was specified and not found. Now we make it an error message again, but only issue the error if a filename was specified - if none was specified, then we don't even issue a warning, just the "Using autoconfig" info message. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> commit d229ba7068f0adf1bc8b30b7ccf2fce2c7e8b97b Author: George Staplin <gstaplin@apple.com> Date: Fri Feb 6 12:55:09 2009 -0700 XQuartz: xpr: The dri.c code for pixmaps was wrong in several ways. They weren't being exported correctly by Xplugin. This should fix a bug with the surface for a window, when an export fails. Before the export could fail and leave behind an invalid (freed) pointer in the dix privates. I have an idea of how to fix the GLXPixmaps now without using CGLSetOffScreen. This work is a step towards that. The Xplugin will need a small patch to fix an issue that this change brought forth. (cherry picked from commit 58c4116c47543b5e30c2232e7bee8efc0b9be176) commit b17d6bed97eddd0773d0845f93f842444b7de0ae Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Feb 12 15:33:47 2009 -0800 XQuartz: Fix copyright info in Info.plist to be prettier when viewed in Finder (cherry picked from commit 8b607c9c507a68a6abda63831d227d0f8947028c) commit d1ad43a8bc3a93a9cddcb4b0be1d722993bf5dd6 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Thu Feb 12 14:05:10 2009 -0800 Enable pbuffers If a driver does not actually support pbuffer rendering, it can just not enable any pbuffer fbconfigs. commit 0065896e1ae6d419a42b318b66d6e4d5f17a40ca Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Nov 2 20:46:37 2008 +0000 Xming: Update keyboard layouts mapping table An update to the keyboard layout mapping table which updates some no longer valid keyboard layout names (e.g. de_CH -> ch -variant de) and adds a few more reported layouts Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d7c27bfe553235e55eb48799129ff9f8e7e0d4f6 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 3 15:57:29 2009 +0000 Xming: Check clipboard selection ownership after taking it When you take ownership of a selection you should always check you got it (X11 ICCCM gospel). Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit cb6315072ff23740bdc5fc2f95dd960601df5664 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 3 15:54:31 2009 +0000 Xming: Fix a memory leak in clipboard integration code Free the memory allocated for ReturnData in FlushXEvents(). Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d54d24dd5f25188b951b82b1c95eb9d36b5be970 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 3 15:53:43 2009 +0000 Xming: Fix prototype for winProcessXEventsTimeout() in clipboard integration code Function 'winProcessXEventsTimeout()' is declared 'static Bool' and defined 'static int' (correct) in 'winclipboardwndproc.c'. This has been wrong since dot, but luckily was of no significance Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d8bae80305057acfb8e82341f68090eac0dccb90 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 3 15:52:57 2009 +0000 Xming: Improve clipboard integration startup in XDMCP mode Improve clipboard integration startup in XDMCP mode Stop the "Clipboard not yet started, aborting" message from spamming the log. Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 7cb1622ce44754d9dcd6f405fb8403bd79c3e7e4 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 3 15:51:02 2009 +0000 Xming: Select events correctly in clipboard integration code The clipboard should only select PropertyChange events and do this on the correct window, the messaging window for the clipboard not the root window! Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b997b3849d902894dd5b38673b73a23a47edf502 Author: Colin Harrison <colin.harrison@virgin.net> Date: Tue Feb 3 15:48:04 2009 +0000 Xming: Add Colin Harrison to copyright and authors list for clipboard integration files Add Colin Harrison to copyright and authors list Adjust license text for multiple authors Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 5ff289834d7445cc6f60dbb1cf18423e7236311a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 19 17:42:54 2009 +0000 Cygwin/X: Place prototype for winSelectIcons() in a header file Fixes warning as prototype is now in scope for the definition Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit ab2c98b86f1c3968581dfdad8b67432082feec78 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 19 17:36:58 2009 +0000 Cygwin/X: Place prototypes for winCheckKeyPressed() and winFixShiftKeys() in a header file Fixes warnings as they are now in scope at the definition Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit cc7a4c7c6e051fceacb32997740d83fc0655414e Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 19 17:29:28 2009 +0000 cygwin/X: Remove an unused variable to fix a warning Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 7c2fb098b206c0fb97c18cce8f88387cd0c0e82a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 19 17:22:59 2009 +0000 Cygwin/X: Fix several prototypes to return HICON Fix prototypes of winOverrideIcon(), winTaskbarIcon() and winOverrideDefaultIcon() to return HICON Also use HICON type in WINPREFS stucture Remove various casts these changes make unnecessary Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 19b3e44ce51cc2f74ba388cb2cd3a26467848e9a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 19 17:03:23 2009 +0000 Cygwin/X: Fix -Wold-style-definition warnings Fix old-style definition warnings caused by definitions with empty parameter lists "()", which should be "(void)" to indicate the function takes no parameters, rather than unspecified parameters Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 734b23e5982e171031077a2d5d6b5dc2a12e1a70 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Feb 11 14:31:17 2009 +0100 fb: add fbDoCopy and fbCopyRegion compatibility wrappers. commit 619c4d60eb3a8a51a8300ccf8ab5b98a688e6e12 Author: Eric Anholt <eric@anholt.net> Date: Sun Feb 8 12:37:50 2009 +0100 glx: Replace broken GLX visual setup with a fixed "all" mode. With trying to match depths so that you didn't end up with a depth 24 fbconfig for the 32-bit composite visual, I broke the alpha bits on the depth 24 X visual, which angered other applications. But in fixing that, the pickFBconfigs code for "minimal" also could end up breaking GLX visuals if the same FBconfig was chosen for more than one X visual. We have no reason to not expose as many visuals as possible, but the old "all" mode didn't match any existing X visuals to GLX visuals, so normal GL apps didn't work at all. Instead, replace it with a simple combination of the two modes: Create GLX visuals by picking unique FBconfigs with as many features as possible for each X visual in order. Then, for all remaining FBconfigs that are appropriate for display, add a corresponding X and GLX visual. This gets all applications (even ones that aren't smart enough to do FBconfigs) get all the options to get the visual configuration they want. The only potential downside is that the composite ARGB visual is unique and gets a nearly full-featured GLX visual (except that the root visual might have taken the tastiest FBconfig), which means that a dumb compositing manager could waste resources. Write compositing managers using FBconfigs instead, please. commit 7bbf05d9aa75b536a5321abf51f37852b8f109ed Author: Shunichi Fuji <palglowr@gmail.com> Date: Tue Feb 10 14:44:18 2009 +0900 dix: build fix if PANORAMIX is not defined. Signed-off-by: Shunichi Fuji <palglowr@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4844bff58f296b2851be4e6b955c3a68d02437a9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 4 11:50:18 2009 +1000 config: if we can't connect to HAL, listen for a startup notification. If HAL isn't available when we try to connect, the registered NameOwnerChanged signal handler waits until HAL is available. Once we connected to HAL, we unregister the signal handler again. This allows HAL to be started in parallel or after the server has started. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5b2bbffc12cd7d29e4200943f8736bd6336ae4aa Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 16:46:27 2009 +1000 dix: deduplicate SyntheticMotion. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 34820f9c1304891bebb4bff6a492288aec4fc0d1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 16:37:19 2009 +1000 dix: remove XineramaChangeToCursor. It's nearly identical to ChangeToCursor now anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 942eae6868b8b0f343b6aa921ddf77e8bb70798a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 16:25:22 2009 +1000 dix: Remove XineramaCheckPhysLimits. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bf044f6d10ad9f2baca91a2f04e82dc1af2657cd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 16:14:54 2009 +1000 dix: reduce redunancy in XineramaConfineCursorToWindow. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cdce5699f085e717ee1a2ed8390746dfcb9ddadf Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 30 16:09:23 2009 +1000 dix: Get rid of XineramaCheckVirtualMotion. Yes, this is an ugly piece mess of #ifdefs, but it beats having two nearly identical functions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1cb5afdf1ef53e72e0eef28ff6197bf5e86ef758 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Feb 8 18:59:17 2009 +0100 dix: always NULL pGC->tile.pixmap in Create{Scratch}GC. commit 6fd8fe9cb993f9b733cf7d878bc324acd09aa48d Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Feb 8 18:43:15 2009 +0100 exa: fix exaValidateGC. - use DEST in the createPixmap wrapper, because stipple already takes MASK (in case someone uses swappers). - Anticipate some of the less common situations when fbValidateDrawable will access tile related pixmaps. commit 30daba6903378dd47f386c0012a0667fd2368f3e Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Feb 8 02:08:13 2009 +0100 exa: All fallbacks should have a GC, remove some code. - I did some testing with full fallbacks forced by the driver. - I ran rendercheck, expedite and the (full) x11perf test suite. - Thanks to ajax for pointing out this should be unneeded. commit d591c7d1b87c61ee8add2fce689e35cf097eed4f Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Feb 7 20:47:54 2009 +0100 mi: kill a few warnings commit 00226d0b589595cdd45c75e7e28237334a8883b1 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Feb 6 20:56:49 2009 +0100 mi: clip exposures to pGC->clientClip. commit ffa72793e25f19a388a1369708f472921f721284 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Feb 6 20:47:01 2009 +0100 exa: Calling exaMarkSync after UTS is the drivers responsibility. commit da086901c6579e41b28b1418fa12ebb82744fc87 Author: Matt Turner <mattst88@gmail.com> Date: Fri Feb 6 18:31:12 2009 -0500 Remove unused barrier macros on alpha. commit 68665d78e72c4c564073d66a0f59ac8d3f5fd756 Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Feb 5 17:07:31 2009 +0100 exa: don't use fbCopyNtoN commit 2e76958d304a3c4080d62f32449724eeb9b95d93 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Feb 4 19:48:03 2009 +0100 fb: move some code to mi commit f06bde3d4bf9a0f245dfa6c65cd98f8e0c7dfdfc Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Jan 31 19:57:07 2009 +0100 exa: create ExaCheckGetImage commit 258fc4b106dfd7b583999f97caf4d4a7a11569b6 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Jan 31 19:40:48 2009 +0100 exa: wrap the remainder of exa_unaccel.c commit 6fabf249494bf38b69e3c9c6c9718ee8b12fc6e1 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Jan 31 19:25:20 2009 +0100 exa: use proper wrapping in exa.c commit 015c99a4ad572f5a1b68054efb070e1ffee1fed0 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Jan 31 18:53:52 2009 +0100 exa: properly wrap GC functions commit 5e6a06fe691db63ccf2dc7161a1f6c71c09741b7 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Jan 31 16:30:31 2009 +0100 exa: add GC private commit 5cc67ae94c066dcac78072ad8a819c3b602d8bab Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Jan 30 19:32:33 2009 +0100 exa: kill of exaImageGlyphBlt - It serves no obvious purpose, yet it directly accesses many fb symbols. commit 6483834200fab90164c27c72d4710014edeb4479 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Jan 30 18:40:46 2009 +0100 exa: Remove one of the many calls directly into the fb layer. commit f112d6bf59964f317ab236221f7bce7fe2603ab8 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Feb 6 18:30:43 2009 +0100 EXA: Try harder to keep current pixmap copy up to date in exaMigrateToward*. This is probably required, but apparently not sufficient, for making migration heuristics other than "always" work correctly again. Not that I really care about them... commit 3948b523893d3d44b6a088340c4252e969613769 Author: Michel Dänzer <daenzer@vmware.com> Date: Fri Feb 6 11:37:53 2009 +0100 EXA: Guard empty pending region warning by DEBUG_MIGRATE. It isn't very useful yet while the damage layer calls us for empty operations, mostly confuses users. commit 9a1d07ecb74b7c3267a6910af66ada917a525110 Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Feb 4 20:20:24 2009 +0100 Fix "warning: cast from pointer to integer of different size" Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0e15697b53c9448ce9911aa6499b2ea0bda92af6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 4 10:11:13 2009 +1000 dix: die if we can't activate or init the VCP/VCK. If we have a busted xkb setup, the XKB initialization on the core devices fails and leaves us with dev->key->xkbInfo == NULL. This in turn causes segfaults lateron. Return BadValue when the XKB configuration for a master device failed, and if that happens for the VCP/VCK, die semi-gracefully. The VCP init can only fail on OOM. Reported by Aaron Plattner. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit db836715198a445dc3b32c3df0610f700930483f Author: Adam Jackson <ajax@redhat.com> Date: Wed Feb 4 23:27:32 2009 -0500 Revert "Bus: Remove xf86SetAccessFuncs() and related machinery" This reverts commit 2fe79990e31ac684637ca3c47198ee0cead10abe. Reminder: nvidia uses this, because other parts of RAC are broken in worse ways, and it needs to disable that. commit 2fe79990e31ac684637ca3c47198ee0cead10abe Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 07:11:49 2009 -0500 Bus: Remove xf86SetAccessFuncs() and related machinery Only mga was using this, and even then only behind an ifdef that no one ever built. Not a great idea in the first place. commit 9ff6180161267e71ae750498da0ec4889cd5c260 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 06:23:09 2009 -0500 Bus: Delete some obfuscatory macros commit 8eca37cb8934e79f02291460eb7b49a5d528f391 Author: Adam Jackson <ajax@redhat.com> Date: Wed Feb 4 22:48:52 2009 -0500 Bus: Remove unused xf86ExtractTypeFromList commit b013111e98d50f5962e9b275eb28d969d5c9576e Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 03:14:18 2009 -0500 Bus: make the resource list static. commit bde028dd8d856f8d47c39e3c6d3731c34c398c74 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 22:58:58 2009 -0500 loader: Remove icache flushes on alpha. If libdl doesn't already get this right for you, you have two problems. commit 910a1e88d23e0b7e4ca4679ab50a883a918f2590 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 07:54:07 2009 -0500 loader: Remove a vestige of archive support commit 366f23c6eb504fc23112f121769bcb719948474f Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 07:53:05 2009 -0500 loader: Remove useless call to LoaderGetOS We know what OS you're running on anyway, it's printed in the uname string at the top of the log. commit 05e415a5a3f376e28955be3bf976390e8631e25f Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 07:52:07 2009 -0500 loader: Simplify loader magic commit bf1ca06a1693cbe5415a152936939ce3b088a022 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 07:51:35 2009 -0500 loader: Make a comment slightly less stupid commit 499908aeca9a31692c787070e23bfaa92d1b32a4 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 07:50:00 2009 -0500 loader: code motion. commit 28b6b1519c4c526662302fac4ed9b7f540bafd4a Author: Adam Jackson <ajax@redhat.com> Date: Mon Jan 26 07:47:46 2009 -0500 loader: Simplify handle allocation and refcounting. commit 0bad0552bfd4d10529ab51d618af8d08c5aeea71 Author: Adam Jackson <ajax@redhat.com> Date: Wed Feb 4 17:20:24 2009 -0500 XKB: Remove -kb and +kb from -help text and man page. commit 7968823cbc02615e1080c0d3f34dcebe14ea1771 Author: Keith Packard <keithp@keithp.com> Date: Tue Feb 3 20:18:37 2009 -0800 Handle the combination of panning and crtc transforms This patch gets the shadow scanout buffer repainted on panning area changes. It does not, however, track the mouse correctly. Signed-off-by: Keith Packard <keithp@keithp.com> commit 763df9eec79a867978efc5138d8635a46c1a0d17 Author: Keith Packard <keithp@keithp.com> Date: Tue Feb 3 20:15:41 2009 -0800 Damage re-used shadow scanout buffer using new transforms. When the shadow scanout buffer can be re-used, the underlying framebuffer area must be damaged so that the scanout will be repainted. This patch delays the addition of that damaged area until after the transform in the crtc has been updated, otherwise the old transform would have been used and the wrong area repainted. Signed-off-by: Keith Packard <keithp@keithp.com> commit 62fc98cb88e4e8b636f343453fc1168a87c58972 Author: Keith Packard <keithp@keithp.com> Date: Tue Feb 3 20:12:42 2009 -0800 Handle matrix computation overflow in RRTransformCompute If the computation of the composite fixed-point transform for RandR overflows at any point, take the resulting floating point transform and scale that back to fit in a fixed point matrix. This ensures that a matrix will always be available, although perhaps at reduced precision. Someday we should add floating point matrices to Render. Signed-off-by: Keith Packard <keithp@keithp.com> commit 7a3ddef3bc27982f3558183c74fc8e365cf2e7fd Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Feb 4 00:07:02 2009 +0100 fbdevHWGetRec() doesn't return the private data Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e04d9ab999978995b06f4b702293b96f69b0e8c3 Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Feb 4 00:08:21 2009 +0100 DBUS_API_SUBJECT_TO_CHANGE is already defined on the command line dbus-core.c:30:1: warning: "DBUS_API_SUBJECT_TO_CHANGE" redefined <command-line>: warning: this is the location of the previous definition Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9f60d127b5371f2853dcc53903c6ff8c7670ad1b Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Feb 4 00:07:40 2009 +0100 Fix "warning: braces around scalar initializer" Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a88995dfb88719ae4a03483dc571dbbe83565285 Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Feb 4 00:03:58 2009 +0100 Make gcc happy: correct third argument of CopyGetMasterEvent() Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit dd3f4e829286e62f4c5c07ee93f9f576876acbf9 Author: Tomas Carnecky <tom@dbservice.com> Date: Wed Feb 4 00:02:24 2009 +0100 Fix "warning: cast to pointer from integer of different size" Add parenthesis around the whole expression. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 731a907ac21a753f306b53706f689469cefeb953 Author: Tomas Carnecky <tom@dbservice.com> Date: Tue Feb 3 23:58:25 2009 +0100 Fix "warning: XXX defined but not used" generic.c:80: warning: ‘read_legacy_video_BIOS’ defined but not used Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc57efffe654c493ceb62555cccb7926f4a646f1 Author: Tomas Carnecky <tom@dbservice.com> Date: Tue Feb 3 23:54:53 2009 +0100 Fix "warning: unused variable XXX" events.c:4614: warning: unused variable ‘kbd’ xkbUtils.c:361: warning: unused variable ‘maxKeysPerMod’ xf86Events.c:409: warning: unused variable ‘ke’ generic.c:131: warning: unused variable ‘cs’ generic.c:130: warning: unused variable ‘size’ xf86RandR12.c:591: warning: unused variable ‘crtc’ Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 111fdef74dfc7e288cef675b171b673bf64fe056 Author: Tomas Carnecky <tom@dbservice.com> Date: Tue Feb 3 21:18:53 2009 +0100 ISO C90: Move declaration to the beginning of the function devices.c: In function ‘DoChangeKeyboardControl’: devices.c:1768: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9fe9b6e4ef669b192ee349e3290db5d2aeea273c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 10:20:13 2009 +1000 mi: don't call UpdateSpriteForScreen if we have Xinerama enabled. #18668 In Xinerama all windows hang off the first root window. Crossing the screens must not reset the spriteTrace, otherwise picking fails and events are sent to the root window. X.Org Bug 18668 <http://bugs.freedesktop.org/show_bug.cgi?id=18668> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f80332a04d0714a74f16b2552cccf3457e6494af Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 14:28:16 2009 +1000 dix: for core events, pass the core filter into DeliverEventsToWindow Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 01879e583b0ce0d8fddc37e36d9b69fe4f1d1e72 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Feb 3 13:49:19 2009 -0800 Don't enable XAA offscreen pixmaps with Option "XaaOffscreenPixmaps" "no". xf86IsOptionSet is rarely the right function to use for boolean options because it returns TRUE whenever the option is present, even if its value is "no", "off", "0", etc. commit 5623c27700b7b23a8dbbd8c8f45e5d4fa0c667e3 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Feb 2 19:25:14 2009 -0800 Constify atom name strings Changes MakeAtom to take a const char * and NameForAtom to return them, since many callers pass pointers to constant strings stored in read-only ELF sections. Updates in-tree callers as necessary to clear const mismatch warnings introduced by this change. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6869efae74381e5305b2d6517bf286e3ef7fdcb7 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Tue Feb 3 09:58:51 2009 -0800 XQuartz: Accept bundle version 2.1.6 to work with our startup method (cherry picked from commit 7f2966557374cb5ea22bc7b73d5ca04891eb5e78) commit 43a1c91a3dac4f0c8cea5de1b9785e349e09978a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Feb 1 20:44:27 2009 +1000 Xext: fix typo in GEEventFill macro Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 412e09e1e37b74421abd4dd9606536d2785da440 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 15 11:03:03 2009 +1000 dix: Use GenericEvent instead of LASTEvent to check for core events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9f3c5d46f81887b2b413b3e6cc9df8282f06522c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Feb 2 12:55:39 2009 +1000 Xi: initialize the device before applying button map changes. This part got lost in bc909f71367a0. Reported by Tomas Carnecky. Acked-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6bf6a4c47e94780bf0eef47702f21a505c336556 Author: Simon Thum <simon.thum@gmx.de> Date: Fri Jan 23 12:06:16 2009 +0100 Xi: create well-known atoms on demand, rather than preinit them Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 32adf8d34fb7db9b78859241f2670349b75c3f7e Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Jan 28 20:52:45 2009 +1000 Xi: If the MD doesn't have a key/kbdfeed class, init the keyboard. This fixes crashes on mouse/keyboard combos where the mouse is both a keyboard and a mouse. Upon copying the SD's key info into the VCP, the NULL xkbInfo of the VCP would crash the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit caade11b8465a743b2ecc890a4d180277e9ca716 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Jan 28 20:44:47 2009 +1000 Xi: remove now obsolete oldXkbInfo. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 5e0967f5fc2e0fcf2a55128eb03931cf6f5709e9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 12 10:49:53 2008 +1000 dix: add SetBit(arr, bit) and ClearBit(arr, bit) to include/inputstr.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit faeb18eb7eb20f15528f9c8004d843146ebc2a50 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jan 27 15:40:31 2009 +1000 Xext: rename shape's EventType to ShapeEventType to avoid name clashing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cfd3443fe81685e91a53063dee58e24a5684dc29 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jan 28 13:34:10 2009 +1000 Xext: rename saver's EventType to SaverEventType. Avoid namespace clashing with the internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8460425740c72e58bcb897557f033e2836251160 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 10 12:31:59 2008 +0000 render: rename SetBit to RenderSetBit. Avoiding namespace collision with the SetBit macro soon to be used in the input code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 940a7aeebc9b042b0208ee475ef162c485ac2274 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jan 27 15:52:49 2009 +1000 include: remove now-unused sempahore macros. Obsolete with the new enter/leave model. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f5c7f8a3ab5723b6c1c3cd21b90a87fd7f37cb7f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Feb 2 12:30:57 2009 -0800 XQuartz: GLX: Fix accidental exclusion of glBlitFramebufferEXT on Leopard (cherry picked from commit 8620579483789ae9ac1b68dbefe32b70011386de) commit 5100d829a4d71ce4a9fbc2b81694a1fb90066ccf Author: Eric Anholt <eric@anholt.net> Date: Mon Feb 2 10:13:46 2009 -0800 glx: Don't match fbconfigs to visuals with mismatched channel masks. This fixes at least one known bug, where the depth 32 visual would end up with a depth 24 fbconfig attached, angering compiz. commit 4475ae036c3d5a06a6ce88a359ce2a9a8ae9b4f1 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 26 13:15:07 2009 +0000 Cygwin/X: Fix compilation for mandatory XKB Fix a stray '}' Update to use RMLVO interface Remove g_winInfo.xkb.disable, can never be set since noXkbExtension has been removed Change to retrieve modifier key state using XkbStateFieldFromRec() from Colin Harrison Update to use XKB defaults from xkb-config.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit e2b4d3d4a1994347979508fbb483cd55c2232502 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Feb 1 15:08:02 2009 -0800 XQuartz: GLX: OpenGL.framework on Tiger doesn't have glBlitFramebufferEXT (cherry picked from commit e01662cadcaa4052e3a5aa82cbaed00a2d0220e0) commit 66a6fbbfa3a1fd0d91fe61cf2ab299d0e3df46b9 Author: Jim Huang <jserv@kaffe.org> Date: Sun Feb 1 09:19:20 2009 -0800 kdrive: Move a close() to the right place so we don't close(-1) normally. Bug #18343 commit 0055fe66d5f73742cafab868ccdb7a6f36ea1dd5 Author: Manuel Bouyer <bouyer@netbsd.org> Date: Sun Feb 1 09:14:19 2009 -0800 netbsd: Force the use of ev56 instructions for register access on ev56. This avoids 32-bit access which might affect other registers. The linux code uses gcc flags to get this to happen, but this seems like more of a sure thing. commit 1375c1b07df114d864a0a06786bc75a3a4f65177 Author: Manuel Bouyer <bouyer@netbsd.org> Date: Sun Feb 1 09:12:21 2009 -0800 netbsd: Fix alpha ev6 support. Bug #19721 commit ad8ffbe7cb50387e6a9cc4a24fea0d9c13b7bfc8 Author: John Hein <jhein@timing.com> Date: Fri Jan 30 21:30:35 2009 -0800 Actually require bigfontproto when it's enabled. Bug #13710. commit 29b3b88dc744f4919c6709747ddb7baac47486c5 Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Fri Jan 30 21:16:48 2009 -0800 Prevent double unref of glxdrawables Found by valgrind. Bug #18917. commit 60bcdd687040db76490851d4b459284ce37020e0 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Jan 30 21:44:08 2009 -0800 x11-input.fdi: Add options needed to handle adding USB devices on Solaris commit 4de5705545792d77c9990bbec3e263a517757a2a Author: Keith Packard <keithp@keithp.com> Date: Fri Jan 30 20:17:10 2009 -0800 RandR crtcs not fetched correctly when primary output is set. Primary outputs may not have a CRTC. Loops fetching CRTCs respecting primary output were broken. Signed-off-by: Keith Packard <keithp@keithp.com> commit f716e3f3445d443cbc6507d27f806e9ad387120a Author: Eric Anholt <eric@anholt.net> Date: Fri Jan 30 20:10:21 2009 -0800 modes: Protect xf86_crtc_supports_gamma() from non-RandR 1.2 drivers. commit 317f2b4a9fe4b606975711bc332166a82db5087d Author: Eric Anholt <eric@anholt.net> Date: Fri Jan 30 19:06:17 2009 -0800 randr: Avoid re-querying the configuration on everything but GetScreenResources. The new path should only re-query on the other requests when we haven't gathered the information from the DDX yet (such as with a non-RandR 1.2 DDX). Bug #19037. commit c1f2be1f3fd0c80cb4c85b98140b98aa9311242b Author: Keith Packard <keithp@keithp.com> Date: Fri Jan 30 19:14:36 2009 -0800 RandR SetOutputPrimary should work with or without a crtc connected The test was inverted from the protocol spec, and besides, the test is bogus anyways. Signed-off-by: Keith Packard <keithp@keithp.com> commit dd098501d800571e71d06ffc936635a6c9d44e05 Author: Eric Anholt <eric@anholt.net> Date: Fri Jan 30 16:17:58 2009 -0800 Move the apple fat binary hacks back to a header file, and make it apple-only. commit 6e49fdd2c839b6244c23ce95c3ae76a1a265b986 Author: Keith Packard <keithp@keithp.com> Date: Fri Jan 30 15:43:04 2009 -0800 Make RandR CRTC info report panning area instead of just crtc area This makes the RandR info consistent with the Xinerama info. Signed-off-by: Keith Packard <keithp@keithp.com> commit ea309e47457156b60aadbf113f04e5b6851029c8 Author: Keith Packard <keithp@keithp.com> Date: Fri Jan 30 14:19:41 2009 -0800 Make crtc_notify wrap/unwrap code do nothing unless mode code is inuse Drivers not using the new hw/xfree86/modes code would crash in DRI due to that code trying to monitor CRTC changes. Signed-off-by: Keith Packard <keithp@keithp.com> commit fff00df94d7ebd18a8e24537ec96073717375a3f Author: Keith Packard <keithp@keithp.com> Date: Fri Jan 30 14:16:12 2009 -0800 Ignore EDID-supplied monitor physical sizes for core screen size We report the EDID values in RandR, and we let people configure whatever they like for the screen in xorg.conf. Reporting the EDID values in the core means applications get inconsistent font sizes in the default configuration. Signed-off-by: Keith Packard <keithp@keithp.com> commit 4e7bc2d7a9879297aff0924febeca9bd3b6c336d Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Fri Jan 30 03:56:39 2009 -0200 Work around inclusion of <X11/extensions/panoramiXext.h> The X Server build only needs the macros PANORAMIX_MAJOR_VERSION and PANORAMIX_MINOR_VERSION from that header. Addition of extra prototypes to <X11/extensions/panoramiXext.h> caused a X Server build failure. commit 15ac25627e7239629be59adedda5d8a9deb330ef Author: Matt Turner <mattst88@gmail.com> Date: Thu Jan 29 14:40:27 2009 -0500 Remove extra / from Loading module line In the X log, upon module load, it prints a line similar to the following. > (II) Loading /usr/lib64/xorg/modules/extensions//libdbe.so The attached patch removes the extra / before the module name. Code already exists in hw/xfree86/loader/loadmod.c:InitPathList to add a trailing slash if needed, removing the one added by sprintf is harmless. Signed-off-by: James Cloos <cloos@jhcloos.com> commit 3903e23153a0d47704050944fa83a7b31bc2eebc Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Jan 29 12:42:57 2009 +0100 XKB: ifdef XKB is dead, yet it was still present in a few places. commit 756a2c848305aa06bfe636314e28ad7f97c1168a Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Wed Jan 28 22:18:50 2009 +0100 Fix duplicate code, off-by one in space calculation, not initialized members commit b55db937fee5ddf34518a54f352c0ee9b8cc2c2c Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Wed Jan 28 17:33:25 2009 -0500 [shadow] Store the closure in the buffer commit 82fc102568b3d6b0daeb6c5f5b3a1310a7f14fcd Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Jan 28 07:51:32 2009 +1000 Disable Xnest by default. Xneest doesn't build right now and is in the process of being removed. So let's not build it by default. commit f7585d020593345e7a61b1fe1a517c38da8f6d79 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Tue Jan 27 03:13:28 2009 -0200 Convert kdrive libraries to libtool convenience libraries. Also correct a link failure due to unresolved symbols. This is arguably a libtool/ranlib/ld bug, that "may" be corrected by linking all convenience libraries in a single one. But in this case, it was preferred to just add a linker option to Xfake_LDFLAGS, to force linkage of all libraries. This corrects #19725. commit b43a4e2d38adb9ff16204218f24df93cfd820d1b Author: Magnus Kessler <Magnus.Kessler@gmx.net> Date: Tue Jan 27 09:30:37 2009 +1000 Xvfb: add missing include for new xkbsrv.h Commit 08363c5830bdea34012dcd954b45ccfdc79a3a7e added call to XkbGetRulesDflts defined in xkbsrv.h Signed-off-by: Magnus Kessler <Magnus.Kessler@gmx.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a7e6424d992151c504a75bb807fa34c57ad52cad Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 23 17:11:57 2009 +1100 dix: remove obsolete comment. Event lists should not be allocated by the DDX commit b137a0cdb1d517a807d081fbde8e8dc0539fb3ca Author: George Staplin <gstaplin@apple.com> Date: Mon Jan 26 03:02:38 2009 -0700 XQuartz: GL: indirect.c changes to fix the build with newer OpenGL frameworks. (cherry picked from commit 143224405ba74929c702a95de52b56df140b0d1b) commit 34b896e50fa154ad890a458c60932964421e739f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jan 16 19:26:07 2009 -0800 XQuartz: SnowLeopard: Help system book name changed in 10.6 (cherry picked from commit b57cb05c69acbedb00a97234099ea104309aa2cb) commit c7d62d74bbd6e0067f511fd910b9e633576befb7 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Jan 25 19:19:01 2009 -0200 Explicitly add libxorg_la_LIBADD to libxorg_la_DEPENDENCIES Otherwise, for example, when hacking config/*.c, it is required to run make clean on that directory, to ensure the proper libconfig.a will be linked in the generated Xorg binary. commit 0eec7348875035792097f606487a558422774e2c Author: Magnus Kessler <Magnus.Kessler@gmx.net> Date: Fri Jan 23 12:11:00 2009 -0200 .gitignore: ignore sdksyms.dep Signed-off-by: Magnus Kessler <Magnus.Kessler@gmx.net> commit 88efe9c76f85423d952ff38e0cfd8b690439902a Author: Magnus Kessler <Magnus.Kessler@gmx.net> Date: Fri Jan 23 11:25:00 2009 -0200 Xvfb: Remove unused function GetLK201Mappings in InitInput.c Silence a gcc warning. After commit 08363c5830bdea34012dcd954b45ccfdc79a3a7e GetLK201Mappings is no longer needed. Signed-off-by: Magnus Kessler <Magnus.Kessler@gmx.net> commit 6ef46c40e62def4841a4cff4e0b443516a2ed782 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Jan 25 19:01:10 2009 -0200 Update xnest keyboard code to match xephyr/kdrive. Xnest was not updated in the last batch of xkb changes. This patch is basically cut&paste from hw/kdrive/src/kinput.c and hw/kdrive/ephyr/ephyr.c, and appears to generate a Xnest as functional as before the xkb changes. commit 759348f13ffa02fb1804238189ffce1c92d33e2a Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 22 22:09:11 2009 -0500 Xephyr: Add some rudimentary Xnest command line compat commit 01ffaf6834fd6a3b1ddbd33d0f0b8d086be0737e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 19 21:11:05 2009 +1100 Xi: define a range of axis labels. This is copied from linux/input.h, presumably that's the ones at least the Linux kernel can give us for any device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 132b464d734b077038e19b21e46d3a6258f4b998 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 22 02:11:16 2009 -0500 Remove a bunch of useless casts. We've had void * for twenty years now people let's try to act like we know how it works. commit 0fb4390526bb829ab17ff4635d41a3012f63c1b2 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 22 01:13:17 2009 -0500 Remove xorgcfg 'Options' list. commit b5ece46b76c9182a077141505cc0e788c0fca3ea Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 17 20:07:40 2009 +0200 Input: Clarify valuator FatalError messages Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ddb46c1421a98190313b79621c0f5ae43b97d3f6 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 17 20:03:10 2009 +0200 Input: Use previous state in valuator events Make valuator event state match other events by using the device state from before processing the event, not after. Also, we already check the number of valuators in UpdateDeviceState, so no need to do it again. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 18e51911f5748f9a27a18cd6bb421c899f5b048f Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 17 13:44:47 2009 +0200 Input: Add postdown to ButtonClassRec This mirrors that in KeyClassRec: the state of the buttons as posted to GetPointerEvents, rather than the state of the buttons as processed by ProcessOtherEvent and friends. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c05f3bc935bef4d98216d38c0e98bd57ced382df Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 17 19:35:15 2009 +0200 Input: Don't allow DDX to generate repeat events We always use soft-repeat at the moment; XKB posts a release/press sequence, which admittedly needs cleaning up, but that's for another day. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6aef4e96affcc26b9415c6bc9c9bebb5af05a1a7 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 17 13:42:46 2009 +0200 XKB: Fix logic error Use logical or instead of bitwise or. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0ec9b1069aeeaf66fd104c09f08202f7ebccd170 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 10 14:44:28 2009 +0200 XKB: Remove unused XkbProcessOtherEvent Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7af53799ccefe27b996bdc6073075b7f12353d3a Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jan 4 16:39:18 2009 +1100 Input: Remove unused CoreProcess{Keyboard,Pointer}Event Everything goes through XKB's Process{Keyboard,Pointer}Event on its way through to ProcessOtherEvent now, so get rid of the old, useless functions. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7c4c00649cae855e141ec9a3667bfe399e3156d0 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jan 1 05:25:52 2009 +1100 XKB: Remove unused DDX functions They were complete no-ops anyway. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4fa3872dc2bcfd6d1fc88d0a94c7071683eea899 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 18 20:26:00 2008 +0100 Input: Remove core keysyms from KeyClassRec Instead of always keeping two copies of the keymap, only generate the core keymap from the XKB keymap when we really need to, and use the XKB keymap as the canonical keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bc909f71367a02297e725bb5769c2bcadab22395 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 12 00:35:56 2008 +0300 Input: Centralise pointer map changing Replace both core and Xi functions with one function that validates the proposed map, and sends out both kinds of notification. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f06a9d2e05e13466c115fc706966a90b1fb0518e Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 18 20:59:30 2008 +0100 Input: Clean up keymap change notifications Keyboard map notifications are always generated from within XKB code, which also takes care of copying the keysyms, etc. If you need to mangle the keymap yourself, generate a new core keymap/modmap, and pass it to XkbApplyMappingChange. SendMappingNotify is renamed to SendPointerMappingNotify (and ditto its Device variants), which still only _sends_ the notifications, as opposed to also doing the copying a la XkbApplyMappingChange. Also have the modmap change code traverse the device hierachy, rather than just going off the core keyboard. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 1d1a0f67eee330a286fbdef17e967ce8ea201548 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Oct 28 16:27:37 2008 +1100 Xi: Introduce XIShouldNotify XIShouldNotify just lets you know if you should send an event for a keymap change (or similar) concerning a given device to a given client; at the moment, this is only for devices which are sending events to that client. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b5242789edb726bb539e4d42fa35bfdaca0025c9 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 9 17:02:02 2008 +0300 XKB: Simplify keymap writing a bit We don't need no temporary variable. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit feb757f384382c7782ceac55f99d54c7caadbd9d Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 25 19:54:29 2008 +0300 XKB: Sanitise vmods for redirected keys Turn two unsigned chars into one unsigned int for both vmods and the vmod mask. As a bonus, remove broken unused accessor macro for setting the vmods. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b5f49382fe48f0a762d9a15fb10a7d7e1183fc8d Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 25 19:52:11 2008 +0300 XKB: Sanitise ctrls action Turn four unsigned chars into one unsigned long. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1bd7fd195d85681e722161f8c636a28f11b40abb Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 25 19:50:12 2008 +0300 XKB: Sanitise pointer actions Turn two unsigned chars into one int. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 61c508fa78aa08ea2666fde950fbafad95d65056 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 25 19:47:16 2008 +0300 XKB: Sanitise vmods in actions Turn vmods from two unsigned chars into one int. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4f3078df2acf07364a17f738bc5c32f9a5962723 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 9 16:50:22 2008 +0300 XKB: Add a hell of a lot more FIXMEs For some reason, we insist on having daft internal representations that make no sense, that always have to be converted to be used. We should really sort this one out. Also, comment the hojillion members of XkbStateRec. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit edeb033f29ae2d52e86c543ccbf22fb7ae1fdb7f Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 15 18:07:52 2008 +0100 XKB: Explicitly decode action data Rather than requiring a one-to-one correspondence between XKM and struct formats in action data, explicitly fill the action data, so we can break API. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 699824a35791735b4b4378adf8648e3aaa599ace Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 18 16:41:29 2008 +0300 XKB: Remove descriptions from maprules We don't use them, as they're not up to the task. We'll get a better solution someday, promise. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1ad80678d88525159e55bb814205fd4eaca060a3 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 18 16:29:35 2008 +0300 XKB: Remove support for setting combined keymaps We don't do full keymaps anymore. Deal. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 133e0bd6f1cc147a2ddbbe1519d10300e7dbe669 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 18 16:27:57 2008 +0300 XKB: Remove 'extra' functionality from rules parsing When we find something weird in the rules, don't stash it as an extra freeform component, just state that the rules file is likely broken and move on with our lives. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cc5c6d628aa0dc87c2cc9d063972e09ad747a596 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 25 18:45:37 2008 +0300 XKB: Remove unsupported Xi operation flags We support every XKB operation on Xi devices, so always report that we support everything, and that nothing is ever unsupported. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 32db27a7f867b503c2840ca7b815e96d10be9210 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Apr 17 12:42:01 2008 -0700 Input: Remove modifierMap from core We already have modmap (in the exact same format!) in XKB, so just use that all the time, instead of duplicating the information. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f062e90a95f9b7ae5458ef2100615e8ace9b66a7 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 16 19:15:30 2008 +0300 Input: Remove modifierKeyMap Since modifierKeyMap is generated from modifierMap, just remove it, and only generate it when we need to send the modifier map to the client. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cf6a2fc2bd94b392cfea120444d5e032d26f1d37 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Mar 30 17:25:39 2008 +0300 Input: Ignore modifiers in core input processing Modifiers get cleared by the XKB code when we drop down into core input processing, so just delete the dead code path to simplify things a bit. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6727ee94086d238f9f99379280d4e4827f388cce Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 9 16:45:45 2008 +0300 Input: Remove state from KeyClassRec We already have state fully stored within XKB, so instead of duplicating it, just generate the values to send to clients when required. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 08363c5830bdea34012dcd954b45ccfdc79a3a7e Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 26 18:38:25 2008 +1100 Input: Overhaul keyboard initialisation process XkbInitKeyboardDeviceStruct is now the only valid keyboard initialisation: all the details are hidden behind here. This now makes it impossible to supply a core keymap at startup. If dev->key is valid, dev->key->xkbInfo->desc is also valid. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 40877c6680863bd6a8475f2bb0c54df55bcf0b0e Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Mar 18 10:05:57 2008 +0200 XKB: Make XKB mandatory No more #ifdef XKB, because you can't disable the build, and no more noXkbExtension either. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f9da417163b6b2d6234d2542c1f375e33db7159a Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 28 19:26:42 2008 +0200 Xephyr: Disable state inheritance hack Prepare for the impending removal of the state field by disabling this hack for a while: it's hell of nasty and I'm amazed it ever really worked. Basically, on focus out, it should do as current DDXes do and fake releases for all keys (not just mangle the core state) that are currently down; buttons too. When focus comes back in, we already have a KeymapNotify that lets us know what's currently down, so we can use this to fake the appropriate keypresses, and send it through the event routing layer. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 5c281446d2a8c38511d45baee6f0d25a640f12e1 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 28 11:56:34 2008 +0200 XKB: Remove lock actions disabling For some reason, XKB allows clients to set a global (!) flag that simply turns lock keys into state no-ops. Ignore this flag. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 2f7cb7306709d5266688e05a066701d309323035 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 26 18:36:30 2008 +1100 XKB: Add XkbRMLVOSet XkbRMLVOSet is just a set of strings for rules, model, layout, variant and options; use that in preference to XkbRF_VarDefsRec, which is a hideously complicated monster that somehow managed to not include the actual rules. While we're at it, clean up xkbrules.h so it doesn't require xkbstr.h. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 3208eff2d7b856a4ac0d650498ccb36e7e62e034 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 21 14:45:06 2009 -0800 Update xorg-server.h.in & Xnest to use new XKB default #defines commit cdf216aa17b776130a91fa6792c321620e810a18 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jan 20 16:50:43 2009 -0800 Fix XKB default configure options to use the right variables commit 0d3c3dad21857ef502fe0d0235620a1228248e13 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jan 20 23:46:48 2009 -0500 Don't include fontmod.h commit 4f004ab9a83e209943760e1faa39f06c8eeb27af Author: Benjamin Close <Benjamin.Close@clearchain.com> Date: Thu Jan 22 01:36:31 2009 +1030 XNest: Fix the build caused by __XKBDEFRULES__ -> XKB_DFLT_RULES in 23862ede59a9ce11a06ec5151bde460fb836c603 commit e45a8a498d1ee8e40fc334805c38c05cb04b49d0 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jan 20 22:07:07 2009 -0500 Remove CreateUnclippedWinSize from window.h This is utterly wrong, but then, so is sdksyms.sh commit 20d2117eb82fb7ce91afd4f01fe1b9d4b1bf0459 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jan 20 00:17:42 2009 -0500 Move CreateUnclippedWinSize to mbuf It's the only user, so. commit e1611d8d55ade35bf8c2e1da7bc2dbf05b011301 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 27 13:34:05 2008 +1100 XKB: Be more verbose about XkbCopyKeymap failure in debug mode Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 5ee504cae5f17d16ee7599beaa4b1944a9a8aee6 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 27 13:31:18 2008 +1100 XKB: Trying to copy to the same keymap is not fatal Humour the user if they run XkbCopyKeymap(foo, foo). Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d929ba6886c6f121b101c0bf0f7c63ef9d851a3e Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 26 18:32:41 2008 +1100 XFree86: Input: Fail NIDR if we can't enable devices If we can't enable a device, bail out of NewInputDeviceRequest rather than blithely continuing. Also, be more verbose when initialization failed. Also, be more verbose when initialization failed. Also, be more verbose when initialization failed. Also, be more verbose when initialization failed. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 534669b376a6a703fbc97269d279a5418cf60c98 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jan 4 16:24:44 2009 +1100 XKB: Remove unnecessary prototype Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 27ea1a7e4e7eca394e052791c64bc6be515e075e Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jan 4 16:40:46 2009 +1100 XKB: Only Xi events are processed Core events aren't run through these functions, so don't bother testing for them. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 2762cafc321166ac48f80146720709b1011e6894 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 27 13:35:42 2008 +1100 XkbCopyKeymap: inputInfo.keyboard is not a special case The device-walking code is still depressing, though. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 07c3bb922b8c1ae8fe28198f6c451430b836f21e Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jan 4 14:12:19 2009 +1100 XKB: Move XkbCopyKeymap definition to xkbsrv.h Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4f35a34f3cd3df3c8af129936d1808dcc063d8a7 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Aug 14 17:26:02 2008 +0930 dix: Remove traces of CoreDevicePrivateKey Obsolete with MPX. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 58a6b5b9eff25b1b9c6de239d6f5a952a31dfd15 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Aug 14 17:21:28 2008 +0930 Xi: don't care about CoreDevicePrivateKey when copying keys If we get here, we must copy. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 23862ede59a9ce11a06ec5151bde460fb836c603 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 10 14:36:16 2009 +0200 XKB: Allow build-time configuration of XKB defaults Instead of hardcoding base/pc105/us, allow users to change the defaults at ./configure time. Change the default model to be evdev on Linux. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 57a5eb2583bdf1069861fe2184de9739c0d0c7c1 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Jan 4 17:40:54 2009 +0000 Xming: Update .rc file to tidy About and Exit dialogs Tidy up About and Exit dialogs, add keyboard accelerators Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit df3f701ef2d41ff4be4839f473ae71d33777bea3 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Nov 2 20:17:23 2008 +0000 Xming: Ensure we dont try to print a null value when displaying xkb configuration Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit c612f0df45d388c98108e1e0c80afdfae05e338e Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Nov 2 20:46:41 2008 +0000 Xming: Add styles keyword and attributes. Add handling for style keyword and atttributes in .XWinrc Update man page to document these additions Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 847a91ad2e8c9b0992c09f0ec38466885d6d25d4 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Jan 4 19:57:56 2009 +0000 Xming: Notify X when the keyboard focus is lost to a pure Windows window in -multiwindow mode. Fix internal WM to notify X when the keyboard focus is lost to a pure Windows window in -multiwindow mode. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 6c3e7e4d0568ecb7d10b814593bbbd817b7d2aab Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Jan 4 18:28:34 2009 +0000 Xming: Only allow WM_MOUSEWHEEL messages to act on the client area of a focused window. Fix internal WM so it only allows WM_MOUSEWHEEL messages to act on the client area of a focused window. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d84e0e387764236c7e97509baf4606d96cfc19d4 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Jan 4 18:20:44 2009 +0000 Xming: Correctly parent XA_WM_TRANSIENT_FOR windows in -multiwindow mode when a windows window is created. Fix internal WM to correctly parent XA_WM_TRANSIENT_FOR windows in -multiwindow mode when a windows window is created, and to de-iconize parent windows when a child window acquires focus. XXX: Perhaps we should also shuffle parent(s) forward through Z-order when a child acquires focus? Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 8d82d806ee38d45ec7cdbf8b1f671ec1e4437567 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Nov 2 20:46:38 2008 +0000 Xming: Correct the way display and screen number is reported in window titles and tooltips Correct the tooltip text for the toolbar X icon to be strictly correct, 'display-number:screen' should be ':display-number.screen'. Also for the default window title. Adjust the style of the Windows title in XDMCP mode from 'Xming - hostname' to 'hostname:display-number.screen'. Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 656f92e247f2f257105daf1e0e6998e1b3d10eba Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 20:17:02 2008 +0000 Cygwin/X: should also use GetTickCount(), just like Xming Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 7f781e780ee2b261c5cb688a8e6c5dc1a53bdb6f Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Wed Dec 17 19:13:30 2008 +0000 Cygwin/X: Cygwin doesn't have RTLD_LOCAL RTLD_LOCAL is not defined on Cygwin Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 5630ff809676ab6b4833757060e48e201e8768a5 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Dec 22 13:53:43 2008 -0800 Ignore generated dmx manpages Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> commit 64f924fbf513b5f91b3f2bcf5767f6fe927d3f7a Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Dec 22 13:43:30 2008 -0800 Kill off --with-mesa-source completely There were a few spots left in the source that were using the --with-mesa-source defined headers or the now removed $(top_srcdir)/GL directory. These aren't needed anymore as all the necessary source for GLX is in $(top_srcdir)/glx. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> commit e1c8ee215797fa8c6a3a5421bb6f99b58064248b Author: Dan Nicholson <dbn.lists@gmail.com> Date: Sun Dec 14 14:18:58 2008 -0800 Don't reuse PKG_CHECK_MODULES identifiers Using GL for the PKG_CHECK_MODULES identifier multiple times means only the first call will actually be used. Later calls will be skipped due to GL_CFLAGS and GL_LIBS already being set. This changes DRI to using a different identifier and DMX to just reusing GL_CFLAGS. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> commit ca46c01869768a8661a9d8a71493ed5f0760a8ab Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jan 16 13:58:20 2009 -0800 XQuartz: mieq: Wait for the server to finish initializing before letting other threads mieqEnqueue Avoid possible race condition whereby one thread might call mieqEnqueue before InitAndStartDevices finishes (cherry picked from commit 94e417ac87a98cd5c6bf2d7c495d702748398931) commit b33905234025f005819c7e2acd653a3a0ecfeb82 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 9 14:32:14 2009 +1000 xfree86: always force RAW mode under linux. The previous check for AEI on left us with the possibility that AEI is forced off in the config, but devices are added through evdev nonetheless. A keyboard added this way can CTRL+C the server. Even when we use kbd, we can set the mode to RAW, so it's safer alround to to so. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 646add4eb47c01c045ef64405510a08ecfb5bfd6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 16 16:04:07 2009 +1000 dix: remove XineramaCheckMotion, merge into CheckMotion. For 5 lines difference, we don't need to duplicate the whole function. really. commit e76f904abe530df9ddaa09510088c545298b0b91 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 16 15:53:50 2009 +1000 dix: remove "notyet" conditional compilation. If it's "notyet" for 3 years, then "yet" won't arive anytime soon. commit 5c41b3f9c8b72f0115019237f812d74610b82c24 Author: George Staplin <gstaplin@apple.com> Date: Mon Jan 12 19:30:43 2009 -0700 XQuartz: xpr: Cleanup some of the code and possibly fix part of the GLX Pixmap problem. Split DRICreateSurface into 3 functions. Make CreateSurfaceForPixmap use xp_configure_surface. I suspect this is partly why GLXPixmaps never worked. It will require some more work and thoughts for pbuffers, unless we fake those with pixmaps and surfaces. (cherry picked from commit 9cf264e67744262b9f45079e6cd752eb3e3b0e08) commit c5d52d4c37ebec92cb668b0653bf3de2bdfc5782 Author: George Staplin <gstaplin@apple.com> Date: Mon Jan 12 14:14:44 2009 -0700 XQuartz: GL: Make indirect.c build and work in the 1.6 branch. Reorder some header files and provide some types earlier on. Remove the static __GLXextensionInfo __glDDXExtensionInfo; that isn't used in 1.4 or 1.5, and seems to have been removed from 1.6. Remove the data structures associated with that too. Remove __glXAquaDrawableResize. The GLX structure doesn't use it anymore, and the Apple version did nothing useful before. __glXAquaDrawableSwapBuffers(): base no longer contains a drawGlxc member. Now provide the the Apple/Aqua context in the __GLXAquaDrawable struct. Add the context member to the __GLXAquaDrawable struct. Remove the fallback configs. They aren't used in 1.4 or 1.5 either. Remove init_visuals(). It's not used in 1.4 or 1.5 either. In the drawable constructor initialize the state properly, including the new context member. Remove glAquaResetExtension() -- it's not used anymore. This has been tested remotely and proven to work with glxgears, fire, various texture programs I wrote, and various Mesa demos. (cherry picked from commit d514152195452ae11ec7769c76489651620ad380) commit 1c504dff8a84804888f18ee9b184f0c4584185d7 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Jan 15 21:03:27 2009 -0800 XQuartz: Fix builddir != srcdir issues and undef _XSERVER64 where appropriate on fat binary compilation commit 717a961528ec69a6e630d536e15568670e0b398a Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Sat Dec 20 16:17:02 2008 +0100 Don't release grabs unless all buttons are up Previously, only buttons <= 5 would count here, but the core protocol allows for 255 buttons. http://lists.freedesktop.org/archives/xorg/2009-January/042092.html Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit f7f85f696570541e2dd43462675de9e6ee46f545 Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Mon Dec 22 00:55:09 2008 +0100 Count the number of logically down buttons in buttonsDown This fixes the following bug. Assuming your window manager grabs Alt+Button1 to move windows, map Button3 to 0 via XSetPointerMapping, then press the physical button 3 (this shouldn't have any effect), press Alt and then button 1. The press event is delivered to the application instead of firing the grab. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 6f065a26db62aaf1d7aab9f9a3d0e6cd09d1c1dd Author: Colin Harrison <colin.harrison@virgin.net> Date: Thu Jan 15 21:42:26 2009 +0000 Xming: Reduce MOUSE_POLLING_INTERVAL Reduce MOUSE_POLLING_INTERVAL from 500ms to 50ms In -multiwindow mode, this determines how quickly X windows can track the mouse when it is outside any X window... Move the cursor around an xeyes, and you will see what this timing effects. commit c745db1674c3cb55249c9eb6e74939b74c42409c Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 5 13:52:45 2009 +0000 GLX: Avoid a crash when we have an uninitialized GL context If the GL dispatch table pointer points to glapi_noop_table, (due to some kind of GL initialization failure), DoGetString(GL_VERSION) (for example as invoked by glxinfo) will crash as it tries to do atof() on the null pointer returned by the noop dispatch function Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit e30032d0bbbf0bf71e1b53a4ac388f3bd6f68e53 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Dec 1 21:14:01 2008 +1000 Xext: clean up XGE macros. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 1ae529bef50a8ccc4a8a264ed120aeae544b21e7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jan 14 14:56:10 2009 +1000 dix: replace manual check for event types with IsPointerEvent() commit 1d54479cb3c8b4f75b7564f8b5e1c5da940b20f4 Author: Simon Thum <simon.thum@gmx.de> Date: Tue Nov 25 14:12:02 2008 +1000 xfree86: init properties when ptraccel configuration is found. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Simon Thum <simon.thum@gmx.de> commit 19275ea8e9dd93d5e61906943706dfe49003dd9c Author: Simon Thum <simon.thum@gmx.de> Date: Wed Nov 19 16:01:21 2008 +1000 dix: add property support for pointer acceleration. Note: properties don't need to be cleaned up, the DIX does it for us anyway. Data that is stored in properties is cleaned up by the property system. Handlers, etc. don't need to be unregistered while cleaning up, as they get deleted when the device is removed anyway. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Simon Thum <simon.thum@gmx.de> commit d645721170b1196e5064b397cfbffd1da8c79bb1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 8 11:53:30 2009 +1000 mi: ensure chained button mappings from SD -> MD (#19282) After copying the master event, flip the detail field to the mapped button of the SD, not the physical button. This way if the SD has a mapping 1:3 and the MD has a mapping of 3:4, a press on button 1 on the SD results in a core event on button 4. X.Org Bug 19282 <http://bugs.freedesktop.org/show_bug.cgi?id=19282> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 639f289dcdbe00a516820f573c01a8339e120ed4 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jan 13 13:05:32 2009 +0100 EXA: Declare glyph cache picture as component-alpha when necessary. Without this, rendering component-alpha glyphs may break without a mask. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=19233 . commit f4e00b783d3f824058a5f140e6462142688f5116 Author: Michel Dänzer <daenzer@vmware.com> Date: Tue Jan 13 11:03:27 2009 +0100 Fix build with --enable-visibility --disable-xdmcp. commit d36adf52a2b2711d22b11105f7bd907d4493fb9b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 12 15:29:36 2009 +1000 dix: fix WarpPointer calls for devices with custom valuator ranges (#19297) If the MD's lastSlave was a devices with custom axes ranges, then a WarpPointer would position the cursor at the wrong location. A WarpPointer request provides screen coordinates and these coordinates were scaled to the device range before warping. This patch consists of two parts: 1) in the WarpPointer handling, get the lastSlave and post the event through this device. 2) assume that WarpPointer coordinates are always in screen coordinates and scale them to device coordinates in GPE before continuing. Note that this breaks device-coordinate based XWarpDevicePointer calls (for which the spec isn't nailed down yet anyway) until a better solution is found. X.Org Bug 19297 <http://bugs.freedesktop.org/show_bug.cgi?id=19297> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 488d45295105daf10ccd17ca93ae6a6f4d0104f1 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 12 16:16:24 2009 +1000 dix: EnqueueEvent and PlayReleasedEvent need to handle DeviceMotionNotifies No MotionNotify events in the processing anymore, so let's have them treat DMN instead. Reported by Thomas Jaeger. commit 1e470645983ad18fa38c0885d674bc9d1dc1e560 Author: Julien Cristau <jcristau@debian.org> Date: Tue Jan 13 00:12:56 2009 +0100 require randrproto 1.2.99.3 commit a48c81dcdf569a3f634ac23e08d2491354de6a36 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 5 16:24:57 2008 +1000 Xi: add XATOM_FLOAT to server-defined properties. This property is used to denote type float for input properties. Such properties can be accessed easily through the XIPropToFloat() function. Code originally written by Simon Thum. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 669f6810af9a89187d6149841925fe765f3988ff Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 19 15:50:57 2008 +1000 Xi: add XIPropToInt() auxiliary function. Converts an XIPropertyValuePtr to an integer, provided that type and format is right. Code originally written by Simon Thum. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 56efbc0986e782da45addb05ece9f456d41d7a90 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 9 13:46:20 2009 +1000 dix: drop x/y back into last.valuators before updating the history (#19285) positionSprite needs to scale to screen coordinates and in the process of doing so alters dev->last.valuators[0:1]. Drop the real coordinates back after finishing and before updating the motion history. This way, we don't push the screen coordinates into the motion history. X.Org Bug 19285 <http://bugs.freedesktop.org/show_bug.cgi?id=19285> commit 67710ad1d172cc4d53e28e5cc7dab2efb57a9a85 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Jan 11 16:34:36 2009 -0800 XQuartz: Don't need explicit Activate/EnableDevice in InitInput (cherry picked from commit b1d29784410b3b93037e5636f336ba608d8ad6e3) commit dde5c591be74139ec6f2a90a3fdc7904d7342554 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Jan 11 16:10:45 2009 -0800 mieq: Avoid possible race condition whereby one thread might call mieqEnqueue before InitAndStartDevices finishes This is more of a hack around the problem. This is something that will need to be addressed in a more structured manner with the multi threaded input efforts. (cherry picked from commit 3c596c061e75848cfa76dd9259c23a3f3a67444c) commit 0720816aea20971ee94b5df3faa9cb9f16e93f82 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Jan 11 14:49:39 2009 -0800 XQuartz: Only call DarwinUpdateModKeys when needed Previously, we were calling it on almost every itteration through sendX11Event (cherry picked from commit 6461729647ff4441d80811e73f0c0d2f108f2700) commit c8bf582db8111f71b9250a602a9d5aa7bd828136 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 23 11:41:22 2008 -0700 XQuartz: Comment explaining the 0x10 flag for [e data2] (cherry picked from commit 3c695280641c1205b97d3bb9f1d5e15a19cfa45f) commit 5339c22a8ca8bce6cd2b51e97c904292e7c40e74 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Jan 11 01:56:45 2009 -0800 XQuartz: Add locking to make mieq thread safe on OSX (cherry picked from commit 7a8d2266861e74176b5310b83652a9c10a170494) commit 1beff89810cd193e45d437846929b3938cee6d96 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Jan 11 01:55:26 2009 -0800 XQuartz: misc 1.6 updates (still --disable-glx) rlAccel is not longer compatable, and it's not worth fixing Don't override DeviceCursorInitialize with a noop Don't do a SwitchCoreKeyboard (which wasn't even needed in the first place) (cherry picked from commit c137f681680e1d04b1513a8be68aeda4d1c56fd5) commit 2d917cfe56af1e74205f80ddbaddfb5c6ce82f0a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Jan 10 01:39:08 2009 -0800 Apple: Don't use DRI2 (cherry picked from commit a1d35cee5907a76977ee43c49cb55c8f411c9794) commit 7a8abb9c8554d7967d912dcd427804f65906dc5c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jan 6 15:32:44 2009 -0800 XQuartz: Bundle version 2.4.0 (cherry picked from commit 3a3ccf5354e4275abe9d01f41a92602df5d690dc) commit 63ff7d236f67e159943312e1a551fcf5bb3f463a Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:45:24 2009 +0100 os: don't mix declarations and code commit f43a3c61ab1eab8aecdc0e4bdee9f3bae2cab234 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:44:53 2009 +0100 os: backtrace() returns int, not size_t commit 5321ae76cffc5fcfe4bebcfb10e08eecaf640503 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:44:29 2009 +0100 os: ANSI cleanups commit 47438a2161a92fec08081d2de28966cf8d31654a Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:43:48 2009 +0100 randr: RRSetPrimaryOutput can be static commit 7f82114b1dc738f98b9f22f6e61d6d5191383b67 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:43:35 2009 +0100 xkb: ANSI cleanup commit 46f3c1b937002f9a860878b359dcf5756a82dcf2 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:42:57 2009 +0100 mi: don't mix declarations and code commit 5aa9483d3ee306a79a9235610ce6b2754d697585 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:42:28 2009 +0100 mi: ANSI cleanups commit 359ed32c9b013ed88e14c99aa7fd7a617a85e2c5 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:40:58 2009 +0100 xnest: only define ddxBeforeReset if needed commit 9651cd8d7ac26635b6fb1826806ac9f4e2bddb63 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:40:47 2009 +0100 xnest: ANSI cleanups commit 31439195c51f183f5a8989a8d4f95b3e6326eda0 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:37:06 2009 +0100 xfree86: linuxPci.c needs a prototype for xf86AccResFromOS commit a00dbd0015845e08ef2af9480cc3833819cf86f5 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:36:16 2009 +0100 xfree86: use %zu to format size_t arguments commit 17c8cb50990a9ad20bbd3f8ce14c149dac9d72ad Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:34:56 2009 +0100 xfree86: don't mix declarations and code commit aec4c0caca41a06832536ba82ba5bcdccf4a0aea Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:33:18 2009 +0100 xfree86: ANSI cleanups commit dba3b1944d04232f88bb310277639f2c1adcbe08 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:28:23 2009 +0100 Xvfb: ANSI cleanups commit a2a760e33c17e211650b1f53c05a89c013916cf3 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:25:39 2009 +0100 dix: don't mix declarations and code commit 466dddbb83aa37ae93fb32976d51ecaa947c3616 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:25:17 2009 +0100 dix: fix cast from pointer to integer commit 54332e4732577dc49e440d9c9f8dd7d791f03f8e Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:20:06 2009 +0100 dix: ANSI cleanups commit ef9902652b8a1c716ea3851565d6e2a98bd30eb0 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:18:56 2009 +0100 config: ANSI cleanups commit e64473b14e091e4b75e6ac2bf9a35e9aaa907258 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:17:41 2009 +0100 Xi: fix missing declaration of XkbSetRulesDflts commit 6e20a4ae731b7bc72266e5809faa0ecfde2bdfe4 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:16:55 2009 +0100 xsync: make SyncAlarmCounterDestroyed static commit 292311b421e53ead53c7df67d735a3d6d3e5b515 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 11 08:16:12 2009 +0100 Xext: ANSI cleanups commit 7a05c8b1e70680ddd3b3e09ad448788f8d70a428 Author: Julien Cristau <jcristau@debian.org> Date: Tue Dec 23 13:08:49 2008 +0100 xfree86/linux: fix log flood on acpid open error When we can't open the acpid socket, warn once, not once every second commit 0d8184de591c75794083c8a8ca3fb8459e9394bc Author: George Staplin <gstaplin@apple.com> Date: Fri Jan 9 16:08:26 2009 -0700 XQuartz: GL: Set the __GLXconfig renderType to GLX_RGBA_BIT. (cherry picked from commit 3c14546f58f8a138fe67c9cacc3bd0b7fa90c29a) commit 9c3975d63e129ad7230cae585f08a962d45fb861 Author: George Staplin <gstaplin@apple.com> Date: Fri Jan 9 15:53:39 2009 -0700 XQuartz: GL: Make many more fbconfigs and visuals available for the 1.5 branch. Use a __GLXconfig linked list struct to store the configurations for the fbconfigs and visuals in a pGlxScreen. Also, remove the __GLXvisualConfig/GlxSetVisualConfigs code that isn't used anymore. There is more code we can remove later, but I want to do that in separate commits. (cherry picked from commit 94162b0f8a25267aca280d25e216cc6bde47da6e) commit a68373994f4957a73f4eab52c90ebcfb96f285f8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jan 7 18:27:21 2009 -0800 XQuartz: Update padding in appledristr. This shouldn't change how the struct ends up in memory, but should make it more obvious for human eyes (cherry picked from commit f7b6c1907c326a1befd8b5c8a1d311d551e8670f) commit 5f3188228eb988bd8f08b62c84f98a8ff66ee283 Author: Xiang, Haihao <haihao.xiang@intel.com> Date: Tue Jan 6 10:03:19 2009 +0800 avoid a potential endless loop. Previously it is possible that creating rotation data, then cleaning up and creating again so that pScreen->BlockHandler and xf86_config->BlockHandler all point to xf86RotateBlockHandler. See bug #19343. commit b2756a71a432f7cf7c870a48676c98625512558d Author: Thomas Jaeger <ThJaeger@gmail.com> Date: Fri Jan 9 02:02:38 2009 -0500 Xext: Send out correct events in ProcXTestFakeInput Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9bf77569cc8f9b0cc25c99487672d375d7c32f99 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jan 8 16:32:24 2009 +1000 Xi: call CheckMotion for floating SDs too. CheckMotion updates the sprite position so we need to call it for all devices that have a sprite - including floating SDs (which have an invisible sprite). commit 83eb863e3cfcd62549b836f3195107d8908b36d0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 9 11:39:02 2009 +1000 Xext: don't accept DeviceValuator if the dev doesn't have valuators (in xtest) Reported by Chris Ball. commit a3f9e887d9ff5fdee6c35ccc0f7b324723a83a46 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jan 9 11:40:18 2009 +1000 dix: don't accept Button 0 presses in GPE. commit 0c6987df3b9b3a37d201d740d8248c326449835e Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 17 16:10:51 2008 -0400 XAA: Disable offscreen pixmaps by default. Say Option "XaaOffscreenPixmaps" to turn them back on. Apropos of bugs #13795 and #15098. But this still isn't correct. commit eb2d7b3d700952ba88c77deacf687b251300e660 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 19 21:05:47 2008 +1000 dix: move focus handling into enterleave.c. This commit moves the focus handling from events.c into enterleave.c and implements a model similar to the core enter/leave model. For a full description of the model, see: http://lists.freedesktop.org/archives/xorg/2008-December/041740.html This commit also gets rid of the focusinout array in the WindowRec, ditching it in favour of a local array that keeps the current focus window for each device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 673eb23aac578dcdc04e2a99d1fa5c2987eb58b8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 19 21:05:09 2008 +1000 dix: add a few auxiliary functions for the updated focus model. SetFocusIn and SetFocusOut, including the static array to keep all focus windows. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 38b28dcadd0990cb43f50db4300eebb8f044db96 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Dec 18 15:55:11 2008 +1000 dix: reduce FirstPointerChild complexity Instead of keeping a flag on each window for the devices that are in this window, keep a local array that holds the current pointer window for each device. Benefit: searching for the first descendant of a pointer is a simple run through the array. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 72ad4a85cc0ffe60a90011d65ef718d5852beae4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Dec 18 15:43:18 2008 +1000 dix: remove now unused "exclude" parameter from FirstPointerChild Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 0aa4460c3b4f9bb17d5412d76fa8c4c501132429 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 17 16:14:41 2008 +1000 dix: re-implement enter/leave model. The old model was implemented based on a misunderstanding of NotifyVirtual and NotifyNonlinearVirtual events. It became complicated and was broken in some places [1]. This patch wipes this model completely. A much simplified implementation is provided instead. Rather than a top-down approach ("we have a tree of windows, which ones need to get which event") this one uses a step-by-step approach. For each window W between A and B determine the pointer window P as perceived by this window and determine the event type based on this information. This is in-line with the model described by Owen Taylor [2]. [1] http://lists.freedesktop.org/archives/xorg/2008-December/041559.html [2] http://lists.freedesktop.org/archives/xorg/2008-August/037606.html commit f8ecc2f08fc375b14d60a74e2fdd7830bfdcd74f Author: Christian Beier <beier@informatik.hu-berlin.de> Date: Tue Jan 6 11:31:03 2009 +1000 Xi: fix typo in WarpDevicePointer handling. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3d549438c29004d78032ecc50ab45ca0e3f49623 Author: Thomas Jaeger <thjaeger@gmail.com> Date: Mon Jan 5 01:26:42 2009 -0500 Don't alter device button maps in DoSetPointerMapping Currently, if a device map differs from the core pointer map, then the request may return MappingBusy, even though all the affected core buttons are in the up state. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b72c6b083baeadfd7b18b6025df054be502d6e28 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jan 6 09:01:48 2009 +1000 dix: remove inputInfo.keyboard reference in QueryPointer handling. PickKeyboard() is to be used instead. commit 30d2cfcd3851870178d62e5067211aa36f87fbd2 Author: Kim Woelders <kim@woelders.dk> Date: Mon Jan 5 19:35:18 2009 +0100 dix: Fix handling of do_not_propagate_mask window attribute. This was broken in 32aa252e988be8cbfd4f7e373fb7b7736ef1f5f2. Signed-off-by: Kim Woelders <kim@woelders.dk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 515ce3e4ba42605a1ee9979e8bb5acd3cf6470a3 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jan 5 15:48:45 2009 +1000 xkb: fix typo - missing negation when checking button state. Introduced with a85f0d6b98237d8a196de624207acf1983a1859a. Reported by Thomas Jaeger. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 9a313fb03153eb764aab3e9cb9988b6603541637 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Wed Jan 7 23:07:01 2009 -0200 Don't call free, use xfree macro. There are several other direct calls to free, check % egrep '\<free\(' `find . -name \*.c` but they are free'ing memory from explicit malloc calls. This one was not intended, and corrected, so that it would both, follow the conventions everywhere (and work on some libc that doesn't like free(0)), and make it easier to use malloc wrappers. commit 49b93df8a3002db7196aa3fc1fd8dca1c12a55d6 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Wed Jan 7 19:37:03 2009 -0200 Default to use standard bitmap fonts, with builtins as fallback The builtin-fonts configure option was removed, as it at best should have been a runtime option. Instead, now it always register all "font path element" backends, and adds built-ins fonts at the end of the default font path. This should be a more reasonable solution, to "correct" the most common Xorg FAQ (could not open default font 'fixed'), and also don't break by default applications that use only the standard/historical X Font rendering. commit 4f004231871c830e16c4525cfaab183fad0aee86 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jan 7 10:55:08 2009 -0800 XQuartz: Fat binary buildfixes Let Xarch.h set X_BYTE_ORDER for us. Determine _XSERVER64 at build time. (cherry picked from commit f54736c2b0b537c8322ecb2db8e9cee5eea68165) commit fbf44d85bd59bfa629193d6494b16812a7343cab Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 5 23:18:11 2009 +0000 Cygwin/X: Tidy up an unused #define Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 1badeb78b0b974a381e563e3d4f4cf37debd4266 Author: Rémi Cardona <remi@gentoo.org> Date: Wed Jan 7 09:31:17 2009 -0500 Include Xmd.h from edid.h commit fc14d52297f8f408693ed867ab649ea5b210b0b3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Nov 16 15:35:17 2008 -0800 XQuartz: Use AvailabilityMacros.h instead of availability.h for Tiger (cherry picked from commit 91f3c3435716195e6d606c8e2f6b0de52eb5972d) commit 4c326c4d342bede0de57e71c1431f56188f812ce Author: Keith Packard <keithp@keithp.com> Date: Tue Jan 6 08:36:39 2009 -0800 Make cvt complain about invalid arguments more often. cvt doesn't correctly parse 'cvt -vr 1920 1080'. This patch doesn't fix that, but it does at least generate an error message now. Signed-off-by: Keith Packard <keithp@keithp.com> commit 1da4a41b0881b605c7cfa4c4bf637efa132c58fc Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Tue Jan 6 05:01:32 2009 -0200 Add sdksyms.sh to EXTRA_DIST to correct make distcheck Thanks to <vehemens at verizon.net> for noticing the problem. commit 200230535fa80c04faaa562bbbd8272713e2763b Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Mon Jan 5 16:49:57 2009 -0200 Update sdk headers to export new symbols. All symbols in installed sdk headers should be explicitly tagged as exported symbols. Otherwise, to ensure it is not a mistake, one could write it as something like: extern /* NOEXPORT */ type name ...; but the proper procedure really should be to use a non sdk header (or a "noinst_" one). This patch also removes prototypes to some functions that existed only temporarily. commit af6152499654a7146250d4ad0df89f611345434e Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Dec 17 14:15:34 2008 +0000 Cygwin/X: Add *.exe pattern to .gitignore Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 8428b92fcb478b041f778c0e8c66fdeb96c807f3 Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Jan 4 20:12:16 2009 +0000 Xming: Fix a couple of warnings Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit f6f97419bd2db651384ecaec0b296840810463a4 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Jan 5 18:35:52 2009 +0000 Cygwin/X: Add -static back to linker flags Add -static back to linker flags to avoid screwing things up for people who don't know that they need to avoid dynamically linking with libXfont, as weak symbol handling requires static linking to work correctly on Cygwin... commit 2ec0ac08addb938a3d5aa5b9888ce7c79a0daada Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Wed Dec 17 19:18:38 2008 +0000 Cygwin/X: Fix some remaining build issues Fixes for a few remaining build issues, omitted from commmit 6e85a8304b50c0bfd16a400a05d257f0168fb99b in error Provide VENDOR_RELEASE in XORG_VERSION_CURRENT for XWin Remove -static from linker flags for XWin Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit e351d10773742d1570e1111976b7c8b6adda5ae6 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Jan 5 17:41:38 2009 +0200 RandR: Only export Xinerama symbols when building Xinerama support Otherwise compilation fails due to sdksyms. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 3387cbb7c13636eb62b22640d28df7011c2268f0 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Jan 5 11:25:57 2009 +0200 XFree86: Xv: Add ClipNotify helper Add a ClipNotify helper that lets the driver know about changes in the clipping of an Xv backing drawable. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 55c4ec0a1ef78481b4d82153c19c20fbf88f1624 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Jan 5 11:24:24 2009 +0200 XFree86: fbdevhw: Add helper function to get fd Most devices need to do custom weird ioctls, so let them know what the fd is. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 7da4e901e078e5597b8dbcb7ee39b949edf7ef03 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Jan 5 11:23:39 2009 +0200 XFree86: Fix build with DGA disabled It's optional, so we might as well work when it's disabled. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 13ce7b98d48261b061da5768a6405bdbe9caa1fb Author: Dan Nicholson <dbn.lists@gmail.com> Date: Mon Dec 22 14:31:03 2008 -0800 dmx: Require newer libXi for XQueryInputVersion Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 27011254c4de4e573a0851bf46892fb488db6522 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 23 09:59:28 2008 +1000 xfree86: If an input device failed to activate, return immediately. Devices are only activated once - right after they've been added to the server. If a device failes activation, it's dead. There's no reason to continue. Return the error code from ActivateDevice() without setting up sprite information or even sending a event to the client. Then - in the DDX - just remove the device again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e1a3a1a0d85c9971aea65c2228b5fd4dbf3bf57a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 23 10:00:34 2008 +1000 xfree86: don't call CheckMotion if a device hasn't been enabled. #19176 X.Org Bug <http://bugs.freedesktop.org/show_bug.cgi?id=19176> commit af820259a06a6e8dbd299fe22347aa83b0c985b0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jan 2 11:06:12 2009 -0800 XQuartz: Copyright Update... happy new year (cherry picked from commit 9f1c26ae8d9ccf81cba0ab946326968a701f8c36) commit d8c9ba37abd0d63ea2c5394af434b46ec3b647fd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jan 2 10:58:40 2009 -0800 XQuartz: pbproxy: Push dpy init and CFRunLoop hook setup into the pbproxy thread to avoid possible deadlock (cherry picked from commit 49e59d32b88e4fad070f230b5efaa261b47f78db) commit 2f361186f93a791e446c4a9471bb0c3b9b818d98 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 31 12:40:02 2008 -0800 XQuartz: Don't use NX_SECONDARYFNMASK, NX_NUMERICPADMASK, NX_HELPMASK We don't have keycodes for them, so don't try to use them (cherry picked from commit cb912aca3a2834c4ad8e386c8a0d05c1bb31b0e7) commit a2abaa9fd3a5ad713c1f946e9d7f598825ad3a84 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 31 11:57:49 2008 -0800 XQuartz: Make sure to reset the saved key state when deactivating X11.app (cherry picked from commit 3eef78eb321f4f7dbca5a10c80666c621e28a1e0) commit 3986b683adc4f6f967cc5f643e973d89764234c7 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 31 12:44:43 2008 -0800 XQuartz: Honor system key repeat rate (cherry picked from commit 4303c9be39a86f5a21de108f72b90a989435905e) commit 1a69d56afda082298edc76271d2cb71af00526ce Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Dec 29 19:54:12 2008 -0800 XQuartz: Better avoid stuck keys on context switches (cherry picked from commit e9963f1a4f4f12f253eae9d4f01694b6cabe35ad) commit f464b5a9164b24f74adea198bcabe9affaf5552c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Dec 29 19:38:31 2008 -0800 XQuartz: Workaround OSX VNC server bug for modifier key state A better approach which ensures we have a L modifier key down if we are told neither are down and atleast one is down... =/ (cherry picked from commit bc13dda345f716bf4de9bfe4e1d85969263b60c2) commit 3ead9aa2602cab9c883aa7bcbd2a8d82c5c88f5a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Dec 29 00:30:31 2008 -0800 XQuartz: Updated man page fullscreen_hotkeys fullscreen_menu (cherry picked from commit 00f3a2e33c8e91da5f855821313a04ea97445656) commit 48dbaf173a82693fd72953983da9fc556cd1c6ed Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Dec 30 12:17:14 2008 +1100 XKB: Also copy keyboard feedback when copying the keymap When updating the XKB keymap, make sure the keyboard feedback is also copied, to preserve autorepeat settings etc. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit cf85a32b5f80694f3c2f434e91cf77edb33a7c17 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 28 15:57:59 2008 -0800 XQuartz: pbproxy: We explicitly need libX11 for pbproxy (cherry picked from commit 32824120da0749b8369c2592f851bb1030dea9f1) commit 997e8c321bb11067591785ba38103a3a5029301d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 28 01:53:38 2008 -0800 XQuartz: Try harder to get the user's login environment (cherry picked from commit 6bedaddd78aa04bd303df434a4c49bb87bd7deaa) commit ae8dc47fd910ec4b9edd64bf3b7ba33e212c5942 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 24 00:39:06 2008 -0800 XQuartz: Reposition windows when we enter fullscreen to ensure our root window (cherry picked from commit 7617d3659b5481ef85aecc1f936e7dd2662bdfbd) commit 895186e026881196ac9383aa165e123055d9cf09 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Dec 23 20:33:27 2008 -0800 XQuartz: Re-enable rlAccel It was incorrectly blamed for some crashes a few months ago, and it should be safe to use until we get an EXA driver to replace it. (cherry picked from commit 8121f30bd29591fc74fbc680fbbf20210271fa58) commit dc4498ec5cb7f25f710bdec8793746da2d2324ed Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 28 22:16:52 2008 -0800 Updated .gitignore (cherry picked from commit 06964c322e4da81f3146022049a2de13f6b2892d) commit 3534a5e5d9c5af85149c799f324257f89507fa23 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Dec 26 16:38:27 2008 +0100 exa: Allow drivers to set non-NULL devPrivate.ptr for !offscreen pixmaps. commit 027b440d4f9f0cdd46addff46fd2d5c44cd5c847 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Dec 26 15:51:55 2008 +0100 exa: preparing as source and finishing access as mask is a bad idea commit 89bbd07e9ddd688df81405151f9c6284fa3367a8 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 23 21:40:21 2008 -0800 Remove obsolete XF86_DATE & xf86Date.h commit 8dc3a7d6817b7371bbfece1108ef856788256853 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 23 14:59:46 2008 -0800 Remove unused CLOG_DATE (leftover from pre-git ChangeLog) commit fe05a46f191ebd36251dda7a9703d90c25efec11 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 23 14:55:26 2008 -0800 Remove powerpc load/store functions from export list on other platforms commit a1b201bcb01e702f8f0a5889a3d49317503b9475 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Dec 23 12:39:38 2008 -0800 XQuartz: Use depth=24 instead of FatalError if we can't figure out our depth (cherry picked from commit 80b65c5b78d125c4ad3620b87b121c9e666299c3) commit 86dc660588a615baefb1799d78a501c95a931d77 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Tue Dec 23 18:07:54 2008 -0200 Improve sdksyms.c automatic generation (Fix #19245). Since it is already parsing cpp output, create a dependency file in the same process. This will cause sdksyms.c to be regenerated whenever a sdk header is modified. This also uses the gmake 'sinclude' directive (don't fail if included file doesn't exist). This should not cause any problems given that gmake only constructs are used in several other Makefiles. commit 477c32708718f4470ac2e786b2446d7a44e45b9c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 19 08:56:35 2008 +1000 dix: don't disable uninitialized devices. If a device hasn't been initialized, it doesn't have a cursor yet. So don't set the cursor to the NullCursor, and don't try to DisableDevice either. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 25aac8b5793caa92116b766d5a9e12dbecdb0290 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Dec 2 16:16:58 2008 +1000 xkb: don't treat groups with different no of symbols as identical. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit f141c1b4bb9482f188783dd6f161d3c7960a3329 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Dec 2 14:54:50 2008 +1000 xkb: explicitly check for group replication in the core representation. Single-group keys may get replicated amongst all groups. Check explicitly for this case and squash it down to one group. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 70a977c021e107c4fabe46ec2f619be9fb55abeb Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Dec 2 15:36:51 2008 +1000 xkb: don't replicate past the number of groups we have. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a157575eeeb523cd43197c5caeb00cb3d56f9988 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Dec 2 13:31:58 2008 +1000 xkb: ensure enough symbols for core Group1 replication. A single-group key on a multi-group keyboard has to be replicated across all three groups (see Section 12.4 of the XKB protocol spec). Ensure that there's enough symbols available to actually do that. e.g. a key ABCD on a 3 group keyboard needs to be replicated as ABABCDCDABCD, hence requiring space for 12 symbols, even if maxSymsPerKey is less than that. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit b5736d237a21d5e65d839c4d213dd3bda5a11e9d Author: Maarten Maathuis <madman2003@gmail.com> Date: Mon Dec 22 19:53:14 2008 +0100 randr/xfree86: Fix initial gamma computation. - The previous version overflowed sometimes. commit ba9dc353a60e9a6bba64e854b23271011bff7015 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 21 21:03:59 2008 -0800 XQuartz: Don't use keycode 0 to determine !swallow since our most common key to swallow is actual keycode 0 (a) (cherry picked from commit 33f43a7f03023bfbab25a957cb81fc25b4afa4ca) commit f0cdccd1e22198f4f5e1aa0d0617441b79ffbc44 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 21 20:40:36 2008 -0800 XQuartz: Update our "screens" when we toggle rootless rather than when we toggle fullscreen This old behavior was used as a workaround for the menubar behavior in the older server, but we handle it better now and need to update our screens when we toggle the rootless state instead. (cherry picked from commit 508aa95bc2cd3fdc3dff448ec090919bf807d153) commit 8f04a5237384fa97ff960b4607a79b688ea03fc1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 21 14:54:11 2008 -0800 XQuartz: Run applications via '/bin/sh -c ...' to support users who expect shell parsing (cherry picked from commit 67455e716e3ecffd528930479192785958d37988) commit 029d255a654eca6401c374d145f63bbb923554b5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 21 14:43:12 2008 -0800 XQuartz: pbproxy: Release display notification lock when not needed to avoid deadlock (cherry picked from commit 22f664ab95a0cae981e9cefad6f075d051583ca5) commit b1f166f2981595aea6f8e2a336d6d25436f8a07d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Dec 21 14:42:26 2008 -0800 XQuartz: update quoting in case X11.app is moved to a directory with a space. (cherry picked from commit cc805dc799efa37c8dcefa3db04d87e9b835ffbd) commit 2f47bda645eb43c60b71315e8d265190acce481d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Dec 18 09:14:16 2008 -0800 XQuartz: Changed X11.sh to allow use of a ~/.x11run as requested by users of alternate shells (cherry picked from commit b62ed1f8eaf041a946bb591165bb18ee481dedbf) commit 83edcc08de4c815c5cbe815f521b3b728441cad6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 17 15:09:35 2008 -0800 XQuartz: Get rid of white rectangle bug (cherry picked from commit 3269959033ed0c675a3a906666454df34086896a) commit 1335a300b9cd03208a583acfdb7f7153eaef4ea6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 17 14:43:02 2008 -0800 rootless: Make expose_1 static (cherry picked from commit 60c8d2697036a125ca5381df8e2eaedabad4d242) commit 22b2811e6aa0bdbfa6a0682ac862063e52ec0c62 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 17 13:54:53 2008 -0800 XQuartz: Name the startup shell script X11 for better compatability (cherry picked from commit f84613d6fcbbb5f769ee34cff0900353a13693cf) commit 82fba7697fbbb6f66cc22424ba99755b99ff482e Author: Maarten Maathuis <madman2003@gmail.com> Date: Mon Dec 22 00:33:55 2008 +0100 xfree86/randr: Avoid a crash when xf86CrtcConfigPrivateIndex is -1. commit 1567b7243f4799808ab93fbd962df14ce3af2d49 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Dec 21 00:08:56 2008 +0100 exa: A more correct fix. commit 2db7b66863ae6055c3ce13c88b36d620de8a4d75 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Dec 19 23:12:37 2008 +0100 exa: a few cleanups - Some warnings silenced. - Some whitespace cleanup. commit aedd2f566df585db7a1614f302cc8d3feda54275 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Dec 19 19:10:23 2008 +0100 randr/xfree86: Fix a one off error in the panning calculations. - Example: mode 1280x1024, panned area 1281x1024 panned_area.x2 = 1281 mode.width = 1280 If you substract 1280 from 1281, then that leaves you with one. Which is the one pixel that you need to move to actually see the last pixel collumn. Substracting 1 from this will consistently prevent you from seeing the right and bottom edge. commit 332d65ec7a6e94d75efe95d53742f137835274de Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Dec 19 18:59:27 2008 +0100 randr: Consider panned crtc's when calculating xinerama screen sizes. - This will allow window managers and applications to actually use the panned area. commit f2d1de6c2a3e6e50db6d9714c293eb26324fbd3d Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 19 10:27:37 2008 -0500 xv: remove useless XVCALL macro commit 5a072c55350f4b73d911ea6a2aeddad844924834 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 19 09:51:52 2008 -0500 dmx: Fix calloc macro confusion. commit 8c488ac3b3990cd203baed7f2127b9bed8aab534 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Dec 18 19:47:49 2008 -0800 Fix linking of Xorg with dtrace probes on Solaris commit 396433d0da721951e6e7abc02dc3b2f682495154 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Dec 18 18:49:47 2008 -0800 Fix sdksyms.sh to work with Solaris/Sun compiler builds - Pass $(CPP) & $(AWK) settings from configure to sdksyms.sh - Only reset sdk variable (tracks if header is part of sdk) if a filename is included on the cpp # <line-no> <filename> line, since Sun compilers omit filename when it is unchanged from previous line. commit aea6f19f25e13768b1d09fac4991d6a5e6c2cdac Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 16 17:10:03 2008 +1000 xfree86: don't restore the TTY mode if we didn't initialize it ourselves Restoring it unconditionally means we restore to whatever tty_mode has as default value (i.e. 0). K_RAW happens to be 0x00, so we always restore to raw mode if allowEmptyInput is off. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Julien Cristau <jcristau@debian.org> commit 5d065a889074558634216eebd4bba35a60db9a09 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 18 13:59:36 2008 -0500 xselinux: Use xace Xtrans wrappers instead of the now-inaccessible wrapees. commit f87e66486c3610c56888915b66ae5ab0af03da8b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 18 13:58:35 2008 -0500 xace: Export wrappers around two Xtrans functions used by modules. Don't know a better way to do this, since Xtrans isn't a library that can be linked into modules. commit 777408914dbf395e9969e3f34720286e6f740369 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 18 12:35:57 2008 -0500 Add xace headers to the SDK when enabled and export the XaceHooks symbol to modules. commit 9e4ef3cfe5ee178c266edd64a8edd767827aa0d7 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Dec 18 15:00:25 2008 -0200 Use regex pattern understood by all known awk variants. Ubuntu uses mawk by default, but it doesn't understand posix character classes (which are locale dependent, and this patch uses only valid C identifiers). Also make sure awk runs with LC_ALL=C to match the regex patterns. commit 3d3c234b434a3443a00c3be9f32c698bcced111c Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Dec 18 16:26:38 2008 +0100 randr: add some notes about the stuff that changed in driver ABI 2 commit 1b244feb4cf11d1cdba79fbead50035965535552 Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Dec 18 16:11:21 2008 +0100 randr: check for malloc failure commit 21a2df9f359584e634dc12d8602401d54defd7db Author: Colin Harrison <colin.harrison@virgin.net> Date: Sun Nov 2 20:46:44 2008 +0000 Xming,Cygwin/X: Fix crashes when using the DirectDraw '-refresh rate-in-Hz' option in -fullscreen (#11128) fd.o bugzilla #11128 Fix crashes when using the '-refresh rate-in-Hz' option in -fullscreen mode and using a DirectDraw engine. On failure (typically 0x80004001 DDERR_UNSUPPORTED), use the default refresh rate for the driver, instead of the entered value. Also fix some nearby error reporting Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit b0ed1567c1782041cf3d14ec6dd4d622915c7d0c Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Dec 17 17:16:02 2008 +0000 Xming, Cygwin/X: Tidy up warnings, headers and unused variables (#11132) Tidy up various warnings, include headers and unused variables, etc. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 15c4a6e088039e14b4f2387ff204cb5448916b39 Author: Colin Harrison <colin.harrison@virgin.net> Date: Wed Dec 17 16:44:07 2008 +0000 Xming, Cygwin/X: Fix crash in function winMultiWindowGetTransientFor() (#11147) The function winMultiWindowGetTransientFor() crashes, due to a bogus pointer dereference, but this fact was previously hidden by the function not being called! Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 08a3d6928c87032998b6113d67f69b79b09eecee Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 16 14:19:12 2008 +1000 dix: Allocate the space for the DCCE when the last SD is removed. This still doesn't fix reset the MD's classes (a TODO that's been here for ages), but at least we don't segfault anymore when detaching the last SD. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 689be0cb4b259840208c17f974066a942196793a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Dec 16 14:19:38 2008 +1000 dix: set the correct length in CreateClassesChangedEvent. Fallout from aeff14d5f208d02f211b8b2a1a98999624e8c2cf. Yes, we don't malloc anymore because we are inside a SIGIO and the memory is already there anyway. But we still need to set the event length correctly, otherwise mieqEnqueue/mieqProcessInputEvent don't know how much memory to copy. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1001403301001fcc84ce6833938590956df40d2a Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Dec 18 00:19:06 2008 +0100 Forgot to fix a comment. commit 9fa15bef59881bdcf087889f16ab3c8d953da8f1 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Dec 17 23:42:30 2008 +0100 randr: some improvements, fixes and crtc abi bump - Add active field to crtc. - Set gamma (only) whenever a crtc becomes active. - Check for xf86_config being NULL. - Increase crtc abi to 3. - A few other fixes. commit bf65523ab0b39774f07a7ae478ff3f5653fad469 Author: Joe Krahn <jkrahn@nc.rr.com> Date: Sun Nov 2 20:17:03 2008 +0000 Cygwin/X: Fix for mis-aligned icon data creates bad background masks (#4491) fd.o bugzilla #4491 Transparent icon backgrounds appear with black stripes as mask data is incorrectly aligned. Modified the icon DDB bitmap data alignment to 16 bits Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 91f73b79b7ae64e5b846d1efeb470bb61a913720 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Dec 17 16:56:26 2008 +0100 randr: Improve per-crtc gamma support. - The Gamma values from the monitor section are now used during initial config. - The old colormap system is disabled when gamma set hook is available. - Gamma values are now persistent for the lifetime of the xserver. - This requires no driver changes and should be driver ABI compatible. commit 1556815d34cecb4b4b62d2a4ce813b1435a937ec Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:18 2008 +0000 Cygwin/X: Initialize native HWND atom when built !XWIN_MULTIWINDOWEXTWM Fix the native HWND atom identifier to be initialized correctly, when built without external WM support This is neccessary for native window naming to work correctly in multiwindow internal WM mode. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 92082a0a00f05ecdc90814a8104828853c9c8f29 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:15 2008 +0000 Cygwin/X: update to use standard DPMS stubs Bring Cygwin/X up to date with DPMS API changes by using the standard stubs Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 2850f26bb2999ef3fb2a10adb80fe358463aecb5 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:14 2008 +0000 Cygwin/X: update for changes to shadow framebuffer Bring Cygwin/X up to date with the change to damage-based shadow framebuffer. Register the screen bitmap as the shadow framebuffer after screen resources are created. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 35d76028304f910edeaf642376df71b8134ec02c Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:13 2008 +0000 Cygwin/X: enqueue a pointer motion event on mouse movement Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 816e0d243df068bc06d328874b5655d4530fe16a Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:12 2008 +0000 Cygwin/X: update for changes in mieq API Bring Cygwin/X up to date with mieq event API changes Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit bca7483c4e95ad450fb09048a3b85bb3056a0518 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:11 2008 +0000 Cygwin/X: update for MPX device changes Bring Cygwin/X up to date with MPX device API changes Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 829a8a970dd17623ef3cb5022d34190744f74741 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:10 2008 +0000 Cygwin/X: update for MPX cursor API changes Bring Cygwin/X up to date with cursor API changes Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit d61e902aab92c262e6c8ee9cd70aec4493cf6cae Author: Francis Giraldeau <francis.giraldeau@revolutionlinux.com> Date: Wed Dec 17 09:49:39 2008 +0200 Don't log audit messages when -audit 0 specified make the auditTrailLevel check more general and don't log when not using DTRACE and -audit 0 is set. commit 295a3fa721ee2f2226891de308c0c4b0ee26fe72 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Wed Dec 17 02:04:12 2008 -0200 Ensure symbols required by swrast_dri.so are visible. commit 6d8ea5104cf97dbf64612f58fc06f94f869ed5ec Author: Colin Guthrie <cguthrie@mandriva.org> Date: Tue Dec 16 17:44:27 2008 -0500 Fix compilation with -Werror=format-security commit 1bb5a919f4bf38ac96c73077021b0cdc82965f31 Author: Adam Jackson <ajax@redhat.com> Date: Tue Dec 16 13:46:59 2008 -0500 config: Add vboxvideo and tga to the magic driver list Also sort the list while I'm here. commit 8511a964f81b3b06a526f0fca4232afb2152f405 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Dec 16 18:21:20 2008 +0100 randr: Update EDID_ATOM_NAME to reflect RandR 1.3 name change commit a058192d970f7417b06334aa666c17e9891795c6 Author: Owen W. Taylor <otaylor@redhat.com> Date: Wed Oct 22 16:12:53 2008 -0400 Xephyr: Fix crash with control-shift and GLX (#18185) When we are looking up the screen for an event, we need to take into account the fact that the event may have been delivered to the "peer window" that we create when implementing GLX. Since we only ever create one such window per screen, just add a single peer_win field to EphyrHostScreen. commit 6e85a8304b50c0bfd16a400a05d257f0168fb99b Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Sun Nov 2 18:27:09 2008 +0000 Cygwin/X: build machinery fixes The Cygwin/X build has been broken for a long time, probably since modular X This patch fixes up configure/makefile and some general build issues (#18568) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> commit 7aa29b9d66c3cd0f8af4fafbe92efd0c0556d225 Author: Robert Noland <rnoland@2hip.net> Date: Tue Dec 16 00:07:42 2008 -0500 Support -sharevts on FreeBSD Bugzilla #11179 Submitted-by: Nathan Whitehorn Signed-off-by: Robert Noland <rnoland@2hip.net> commit 063eb6743cd0d98dd52d1a9559b804381ee5144d Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 15 19:53:45 2008 -0800 Patch brown-bag fix for bug 19017 (scrn->virtualX/virtualY 0 before PreInit) When a driver uses a crtc during device detection, the scrn has not yet been configured and virtualX/virtualY are still zero. This caused the X server to try and allocate a shadow frame buffer, which couldn't work. Detect this by checking for zero virtualX/virtualY values. Signed-off-by: Keith Packard <keithp@keithp.com> commit fde2f961035609cfff8761ef1e0f23e6a9761be2 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 15 11:39:24 2008 -0800 Use scrn->virtualX/virtualY in xf86CrtcFitsScreen. Fix bug 19017. pScreen->width/height are not initialized when doing initial mode setting, which makes this function incorrectly fail. Using scrn->virtualX should work in all cases though. Bug 19017 reports a crash in xf86CrtcSetModeTransform when doing a modeset for output probing, long before the screen array is initialized; that was caused by a work-around to set pScreen->width/height so that xf86CrtcFitsScreen could find the right values. Signed-off-by: Keith Packard <keithp@keithp.com> commit 29a5b0596b396d3e4a8a014cacd3e3ef77467ab7 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 15 11:38:00 2008 -0800 When disabling SIGIO tracking, use SIG_IGN instead of SIG_DFL. This avoids a race condition for drivers which mis-order the fd close and signal disable. Signed-off-by: Keith Packard <keithp@keithp.com> commit 1ba4cbb15919759aadd71960c5c057af9ba94fe3 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 15 11:36:43 2008 -0800 Clean up rotation data when crtc is turned off The shadow frame buffer and other data used for rotation need to be freed when the crtc is disabled, not just when rotation is disabled. Signed-off-by: Keith Packard <keithp@keithp.com> commit 2a61397d17339113b9e37995b06ca543589814ce Author: Cooper Yuan <Cooper.Yuan@amd.com> Date: Mon Dec 15 10:29:34 2008 -0500 Fix typo in xf86PickCrtcs() commit 3db60add6671f766f9360e7d03492dfd51eba225 Author: Jon TURNEY <jon.turney@dronecode.org.uk> Date: Mon Dec 15 12:42:10 2008 +0000 Cygwin/X: Update the native icon to one based on the X.Org logo Update the native icon for the X server to one created from the X.Org logo by Colin Harrison. commit 450739efa904a0fce5024372da7236bb7b84b67a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Dec 13 00:45:27 2008 -0800 XQuartz: Updated menu item ordering for better HIG compliance (cherry picked from commit 4c9bb241ce5fb856fab20ae96fa89bd2b71ef242) commit aee27be2785d8b09ac10f5be040b4d573190de0e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 10 23:04:30 2008 -0800 XQuartz: Tiger fix, don't call Xplugin code in the Appkit thread if Xplugin isn't threadsafe. (cherry picked from commit 748d9e5bd756513d42c4046f3b31e1fdc55bccb6) commit a939368ab8140d48c1da4ba0bb229d13b221189c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Dec 15 03:18:13 2008 -0800 mi: Reuse memory in mieqProcessInputEvents rather than making excessive calls to calloc() Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> commit f1c9b5ab230cbb4124d8d476ae4886d05022adcb Author: Ian Romanick <ian.d.romanick@intel.com> Date: Sun Dec 14 18:58:33 2008 -0800 GLX: Changes resulting from changes to Mesa generator scripts / data Several recent Mesa commits (listed below) make modifications to the protocol generator data and scripts. This commit represents the changes to the generated files resulting from the previous changes. - 0f73302d24f4201813da2939742c5bcb6964b3b1 GLX: Fix protocol for glTexSubImage#D - 1709ab01ef24279c782e420568e9257b4b92b224 Return 0 as the request size when the pixels parameter is NULL - 63cca2ba10ce7dcc8481cfa4be3872dfc269dded GLX: Include glapi.h before glapitable.h This is the server-side part of the fix for bugzilla #11003. commit 6383bc93b2ae76361a58653bc7e291df0d6ddfec Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sat Dec 13 15:44:52 2008 +1000 dix: Init DeviceEnterLeave event's type before FixUpEventFromWindow (#19064) X.Org Bug 19064 <http://bugs.freedesktop.org/show_bug.cgi?id=19064> commit 49d38ab2328c409b2a98465b52677af057121513 Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 2 15:09:57 2008 -0800 Warning fix: Remove dead glXDisp{,Swap}_DrawArraysEXT definitions. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Ian Romanick <ian.d.romanick@intel.com> commit 2c5bfffc832e3818bbf0c0a96522865ce1ef2653 Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 2 14:59:04 2008 -0800 Warning fix (GL likes to call strings GLubyte * instead of char *). Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Ian Romanick <ian.d.romanick@intel.com> commit 7be6520d94df874c6bbd46d06a1830a12d0967f2 Author: Stuart Bennett <sb476@cam.ac.uk> Date: Fri Dec 12 00:08:44 2008 +0000 dolt: allow older versions of bash to compile the xserver (#19031) Signed-off-by: James Cloos <cloos@jhcloos.com> commit aeff14d5f208d02f211b8b2a1a98999624e8c2cf Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Nov 25 20:23:50 2008 +1000 dix: don't alloc in ChangeMasterDeviceClasses. We mustn't realloc as we are inside a signal handler. With SetMinimumEventSize, this code should never be hit anyway, as the event list should have the required memory before this code is hit. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit fb2a8d0e59a3d187255538f6add22ec67551507a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 8 15:58:15 2008 +1000 Xi: silence compiler warning Don't mix declarations and statements. commit d961abb59f0a8bee4bd11b1540aa43ff83cddbb8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Dec 11 15:54:15 2008 +1000 dix: fix compiler warning (mixing declarations + statements) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit cb95642dc8edebb2935dd471f8b339cb98aa8481 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 28 22:28:32 2008 +1000 Remove #define NEED_EVENTS and NEED_REPLIES A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 920b7622be4a68ebb5d8432f55c5362fbe964fce Author: Simon Thum <simon.thum@gmx.de> Date: Tue Nov 25 14:28:26 2008 +1000 xfree86: dump the ptraccel filter setup to the log on init. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit fbb57a2c54b141ccbb50833143b0b7cb2c4cb903 Author: Simon Thum <simon.thum@gmx.de> Date: Tue Nov 25 13:43:28 2008 +1000 dix: ptraccel - Add GetAccelerationProfile() Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit beb749c87f383a62172a9ffa36373438e7a12d8e Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 11 17:04:37 2008 -0500 Fix syncsrv.h guard define commit 9fba808b4f43f5dc69d85a48fa40cb83dd4d9f9d Author: Colin Harrison <colin.harrison@virgin.net> Date: Thu Dec 11 13:22:53 2008 -0500 xsync: Prototype fix. commit dce887ff53222652c397bc96a1dd3566f5847745 Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 11 13:16:02 2008 -0500 xsync: build fix argh protocol header disaster commit d41b8960be8ad316504ef5657c0abfe6d76d3b5e Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 11 18:48:02 2008 +0100 randr: Fix initial panning border copy Thanks to Julien Cristau for finding this. commit fd77ce9f884f5ac4d36736f3a99ba86101f133ea Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 11 17:51:20 2008 +0100 randr: Oops, miscalculated panning rectangle's coordinates commit f8e52f1b6d7c59d007de99a1c9c69c053d4f3cbe Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 11 16:48:40 2008 +0100 randr: Update initial screen size if panning information is present commit 24d6b7d1c5fc5d07c2eb06a9fc4406e393d59b17 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 11 16:48:11 2008 +0100 randr: Fix error message for bad panning config commit fdbbe65a7e777b7777bfae5a161efb89d4fb9a8d Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 11 14:56:51 2008 +0100 randr: Add monitor option "Panning" for initial panning configuration commit 27261a950d91c352eac25a3036656c3e4f81fb12 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Dec 11 14:43:04 2008 -0200 Modify sdksyms.sh to receive $top_srcdir as first argument. If the basename of header file processed by cpp matches $top_srcdir, check for extern symbols in the output, and add to the xorg_symbols vector. Possibly a better solution then using this script would be to somehow tell the linker to not drop any symbols from the binary being generated. commit 1f4fb0225b278d1cf4145aebeb0bdd23dc8f62d5 Author: Adam Jackson <ajax@redhat.com> Date: Wed Dec 10 16:13:20 2008 -0500 xsync: Fix wakeup storm in idletime counter. Wakeup scheduling only considered the threshold values, and not whether the trigger was edge or level. See also: https://bugzilla.redhat.com/show_bug.cgi?id=474586 http://svn.gnome.org/viewvc/gnome-screensaver/trunk/src/test-idle-ext.c?view=markup commit 1a99110f0c221b79045ea26d61c4a1ec1e0d7341 Author: Adam Jackson <ajax@redhat.com> Date: Wed Dec 10 14:18:59 2008 -0500 xsync: ANSI cleanups commit e0d8f6a8084a3fe6c549c1dee11e4502e316c382 Author: Adam Jackson <ajax@redhat.com> Date: Wed Dec 10 13:32:04 2008 -0500 xsync: Use a local header for server API definitions commit 1208a1dbcaecbc218a77bf51068f9c0c768e16c5 Author: Adam Jackson <ajax@redhat.com> Date: Wed Dec 10 11:47:35 2008 -0500 xsync: remove cast abuse. commit 119d9c46e841f5fa35610f557e6fa1ec58587c24 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 10 01:56:01 2008 -0800 XQuartz: Fix path to executable (cherry picked from commit 7e9d3698e070a0c63dd2556651373c3aca58e2fe) commit c46b564c47fde3474e948aa1b188a975836cba47 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Dec 10 00:00:29 2008 -0800 XQuartz: fixed make dist (cherry picked from commit 2d52367ab92429e58596d1a1ed3ef52a0a38a7aa) commit 23156a21d8e2f1be7d19d69cb91dae1b885ef671 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Dec 9 23:48:18 2008 -0800 XQuartz: Make debugging output for invalid depths a bit more detailed (cherry picked from commit 609fb166b7062c76f0561df12ffe893811f6ac8f) commit 76351d2faf9ceb79aaa00b374c203b8b279c58f3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Dec 9 23:47:32 2008 -0800 XQuartz: Avoid using login /bin/sh blech. Just use a bash script to start the app, so it will inherit the right environment (cherry picked from commit f4b7ad9cc6b0c99fc7ee8516c4bf858ece938148) commit e5ce6e198f4c245f4dc840c5e9e90a7ef80fb6e9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Dec 8 21:59:49 2008 -0800 XQuartz: unset DISPLAY if we didn't get a launchd socket handoff (cherry picked from commit b959727f38733009c6381cc8ca06b5984257bdac) commit ecaaf0462d6c70cabfcaf6868a526e5415505e2c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Dec 8 21:00:11 2008 -0800 XQuartz: unsetenv(DISPLAY) if we're not org.x.X11 Also some prefix related fixes. (cherry picked from commit fd459e96581a883e30323c840b71004aa0747169) commit ea94995982d1cc585768d52fec75cae018457fa5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Dec 6 12:01:28 2008 -0800 XQuartz: Removed some debug spew (cherry picked from commit 370dcf11b360b87aa24cace35eb615419057fda0) commit 86c64ddf21763972aa7fc8c5770259123c9907b3 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 8 17:42:47 2008 -0500 randr: clear primaryOutput when the output is deleted commit fe65f400ed16cb39db8c9518b9446f590c34db1a Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 8 17:40:07 2008 -0500 randr: use primary output for RRFirstOutput() commit cdcb516e561e2f65eb2fa523ca001c57674d5caf Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 8 17:37:17 2008 -0500 randr: Mangle GetScreenResources sort order based on primary output commit d7b316e82bc7051f8829b4f4a640f50ae91c2db9 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 8 17:28:55 2008 -0500 randr: Mangle compat Xinerama reply based on primary output commit 9d58d2a319059989ccdfa758f586149ccdc16df6 Author: Adam Jackson <ajax@redhat.com> Date: Tue Dec 9 10:51:37 2008 -0500 randr: Add [GS]etOutputPrimary commit d281866b74f7067f2704c278fe9720eafc0ee5ef Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Dec 1 21:20:48 2008 +1000 mi: Clean up CopyGetMasterEvent, re-use the memory. Alloc an EventList once and then re-use instead of allocing a new event each time we need a master event. There's a trick included: because all the event processing handlers only take an xEvent, init a size 1 EventList and squash the events into this one. Events that have count > 1 must be squished into an xEvent array anyway before passing into the event handlers, so we don't lose anything here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> commit 0b4fef6337d88ae8ef05b8b73941350a9007565c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Dec 10 11:35:09 2008 +1000 dix: move MAX_VALUATOR_EVENTS into include/input.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit b36c398b11321a908cfe217108b26a32ffc1d850 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 8 16:41:20 2008 +1000 dix: purge dead device-based window access code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit aa71ac1dd4697738752c73fe4c106b665ea3ec25 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Wed Dec 10 00:32:34 2008 -0200 Add dependency tracking to sdksyms.c and export composite wrapper. Thanks to David Miller for noticing a make problem with sdksyms.c not being regenerated when sdksyms.sh is updated. This is not yet the best solution; automake generates dependency for sdksyms.o, but the build really should also regenerate sdksyms.c when sdksyms.o needs to be regenerated. Export the symbols in miext/cw/cw.h. These symbols are in libxaa, and at least the nvidia driver uses them. Maybe cw.h should be installed in the sdk. commit 090f63123975220819d531f569df6e5787607ec6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 8 11:53:20 2008 +1000 mi: always update the sprite for master devices. Follow-up to 9ce995373e4a. This re-enables cursor rendering if the MD is controlled through software (e.g. synergy). Reported by John Tapsell: "I use Xorg with no mouse attached, but use synergy to control the mouse. The commit means that I no longer have a visible mouse cursor. The mouse cursor is still 'there' in terms that I can click buttons etc with it, but it's just not visible." Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7c8720c1433d2c3b85bbf4b811cc54c2df4c0080 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Mon Dec 8 22:11:50 2008 -0200 Correct wrong symbol reference on sparc. The awk script was incorrectly referencing the struct name, and not the struct variable. Also added some comments to sdksyms.sh, for the reason it generates the "symbol table" and add a message to the generated file, telling is was automatically generated. commit 58a27d2932164e43c0db42b1286ec2f95250b420 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 8 16:28:00 2008 -0500 Default to x86emu even on i386 linux vm86 mode is a bad idea anyway, and using the emulator everywhere means we get a consistent set of bugs. commit bbf811514d3cdf84790bad5b852942a4e636902b Author: Sascha Hlusiak <saschahlusiak@arcor.de> Date: Mon Dec 8 12:24:39 2008 +0100 ddxCtrls.c: XkbDDXUsesSoftRepeat always returns 1 now We'd like to do soft repeat in the server for all keys. Remove obscure check, that'd prevent the server from autorepeating when delay is set to exactly 660ms and rate is set to exactly 25 (interval=40). Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 8c1dd40a04693f09f4fcea6e7f905af34c7589de Author: Benjamin Close <Benjamin.Close@clearchain.com> Date: Mon Dec 8 14:49:38 2008 +1030 Don't use gnu specific extensions to awk when builing symbols Traditional posix awk doesn't know about \W and whilst we check that awk exists in configure.ac we don't check which awk we are using. This corrects symbol generation for posix only awk. commit 39db182b637041255ed6dac739ff77c8e4e07c30 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Dec 8 12:12:39 2008 +1000 xfree86: init EQ before trying to initialise the devices (#18890) The kbd driver may send events during device initialisation, and these events need the EQ set up already. X.Org Bug 18890 <http://bugs.freedesktop.org/show_bug.cgi?id=18890> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 78a62d7713c708d067d8824ec41b0a0225c1997f Author: Tom Jaeger <ThJaeger@gmail.com> Date: Mon Dec 8 11:38:12 2008 +1000 Xi: XIGetDevice needs to ignore the MORE_EVENTS flag. Reported in X.Org Bug 18882, Comment 5. <http://bugs.freedesktop.org/show_bug.cgi?id=18882> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ee1a6c28418a6dad6c89f79a994f27bfbaa77368 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Dec 5 10:12:57 2008 +1000 dix: fix calculation of valuator events. Follow-up to 4971315296cb. countValuatorEvents was copied from GKVE where it was obviously broken but nobody noticed. GPE had the correct version, but that one got lost during de-duplication. Restoring the correct calculation - if we have 6 valuators, we want 1 valuator event, not 2. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 13de7511b17b57a28668e1a60b196ccfe61dbcbe Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Dec 4 10:30:02 2008 +1000 xfree86: Only use the evdev ruleset on linux. As suggested by Julien Cristau This is an follow-up to commit 9c5dd7337fa93fb1650cc017e523b939dcbf482a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Dec 3 14:24:25 2008 +1000 Let the DDX decide on the XkbRulesDefaults. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Acked-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 8e3279134987a45f2a89c963ef2d33bc3d3c8179 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Dec 4 09:47:25 2008 +1000 xfree86: fix compiler warning (use of uninitialized variable) drv and idev are only set for SDs, but are only dereferenced for SDs too, so initializing them to NULL is safe. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 22d4ddcc3d63b7fbf2a23f5162075e4ee06db781 Merge: d2dad38 c3bf15b Author: Matthieu Herrb <matthieu@crux.(none)> Date: Sun Dec 7 23:56:15 2008 +0100 Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver commit d2dad384f5725a36e593fd75f03d712f53b20620 Author: Matthieu Herrb <matthieu@crux.(none)> Date: Sun Dec 7 23:52:26 2008 +0100 Fix build in separate build directory. commit c3bf15ba85fd3ab2e1fe809428b75bf34db25cc8 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Dec 7 18:52:23 2008 -0200 Require macros 1.2.0 or newer for XORG_CHANGELOG and XORG_CWARNFLAGS. commit 5a8068b390b7d30eb526e954443d8e43a199b971 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Dec 7 18:31:32 2008 -0200 Convert libx86emu.a to a "libtool convenience library". commit ed4a17274015ecd8040ae85bd5cd9d1dbcc9460a Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Dec 7 14:59:25 2008 -0200 Export some symbols from libxf86config when installing it. These are private symbols, but used by the X Server. The newly exported symbols were not added to the sdk headers. Optionally, libxf86config could be compiled without hidden symbols when being installed. Thanks to Maarten Maathuis for noticing the problem. commit bf4c29ab48a166eb158cf4be7c597982d65ef214 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Dec 7 05:12:41 2008 -0200 Correct xf86acpiDisableFlag symbol. It is declared as <hash>ifdef HAVE_ACPI Bool xf86acpiDisableFlag = FALSE; <hash>endif in hw/xfree86/common/xf86Globals.c but not protected by the ifdef in the sdk header xf86Priv.h, what caused a build failure in the tinderbox, due to the address of the symbol being taken (to ensure it is available) in sdksyms.c. commit b1dac41fb3853ca8182048ea57b88b6e84ecceb3 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Dec 7 02:22:19 2008 -0200 Use libtool convenience libraries and better "symbol" table. All .a libraries were converted to .la, and instead of linking the Xorg binary with a mix of .a and .la, and adding some libraries more then once in the command line, etc, now it generates a single libxorg.la from all the required convenience libraries, and links with a dummy xorg.c (that should usually be the file with the main function...). This removes the requirement of some things like libosandcommon and libinit, that existed to circumvent problems when linking multiple .a and .la in the final Xorg binary. The "symbol table" is now generated dynamically, by a shell script, with an embedded gawk parser that parses cpp output. The new file sdksyms.sh is generated by hand by analyzing all Makefile.am's and making it create a sdksyms.c file, that includes all sdk headers that will add symbols for the Xorg binary. Module headers aren't read, and a in 2 files it was required to add a "<hash>ifndef XorgLoader" around declarations shared between the Xorg binary and libextmod. A few other changes were added to other sdk headers, like preventing multiple inclusion, or including other headers to satisfy dependencies. This should be a lot more portable, and better (hopefully properly) using libtool to generate convenience libraries. commit ccd2c668c13863ed704f86b29fc6b3ee628e56a2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Dec 6 14:11:52 2008 -0800 XQuartz: darwinPointer reports the actual pixel position now rather than a relative position (cherry picked from commit a41e7f75decd340d064fdc0d2c4fe6c88d7dbc82) commit 7ebd0c7e8d42a13079957d9bacf5cb30d7855a59 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Dec 5 12:42:31 2008 -0800 XQuartz: Corrected name/command labels in the customization widget (cherry picked from commit a689c23f17eb445c36b97eb617ef4b8bd157985f) commit 027ff97a1354ab4c83fecb615f6bc2a6b739b871 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Dec 5 12:00:08 2008 -0800 Make sure _X_EXPORT is defined in edid.h Fixes build error in xf86-video-intel utilities commit 466b0fca9ba5d5e7fb36e47a6d1bd60218f51c75 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Fri Dec 5 17:01:09 2008 -0200 Add back a simplified version of the loader static address tables. If not taking the symbol addresses, linkage will break badly, as not all symbols will be present, and it also requires changing library order, and/or making some changes like the "libosandcommon". This table should be modified to be generated automatically, as it is required to "fool" the compiler/loader into adding all required symbols to the X Server. commit 44bef8b850c5a78a3d3eca5f0d92b71bdd0a87e2 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Dec 5 15:37:15 2008 +0100 randr: Update SProcRandrVector for panning commit 44c8c3cf7de589fb8e987f4ab931294eaf0b405f Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Fri Dec 5 04:26:57 2008 -0200 Remove static symbol address tables in hw/xfree86/loader/*sym.{c,h} Those tables were once used to decide what symbols are visible to modules, but they were outdated. The only real usage was that, since it was taking the address of symbols, linkage should fail if the symbols were not available. Now the proper way to make symbols available to modules should be to use the _X_EXPORT macro, or not compile with hidden symbols, so that all symbols would be available. All symbols in the tables were revised to ensure they are exported, and only symbols that were not exported are ClientSleepUntil() and DuplicateModule(), that were not in the sdk for quite some time already, and should not have any users outside of the X Server (and/or builtin modules). commit 091a50d1260c70055aba1fa6a2d1b1a36de1114e Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Dec 4 18:23:25 2008 -0200 Move _X_EXPORT attribute to header file. The attribute should be set on header files to make it easier to manage what symbols are available to modules. _X_EXPORT should be used in sources only for special cases, like symbols that must be visible by non video/input driver/modules but should not be "advertised" in the sdk. commit e5ab9e66628cde081757cf2a1013a78e927a622e Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 4 18:13:40 2008 +0100 randr: Allow panning to be disabled per axis commit bad118ace6c5bae5a5ed8a35129c90c38f1c1932 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 4 16:55:14 2008 +0100 randr: Rework panning area verification commit 219c26ce0c65625d55cfd943ec66fe94a1a0ddfd Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 4 16:28:40 2008 +0100 randr: Don't change panning parameters if verification fails. commit 18a8bac1a1567b6215928f96870554ea63f39aab Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 4 16:30:38 2008 +0100 randr: Rename pan() to set_origin(), and xf86CrtcPan() to xf86CrtcSetOrigin() commit 825b2c2f4a59ac4852f90bbbddf18ab832297fdd Author: Matthias Hopf <mhopf@suse.de> Date: Thu Dec 4 16:11:21 2008 +0100 randr: Nuke config-timestamp for panning commit eeeb98d1df59baaaec954b6318d788a37e388d11 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Nov 28 17:51:20 2008 +0100 randr: Protocol bits for panning support commit b929d721efdb17bcc94b9984c4f34d0df3d267d5 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Nov 28 17:49:31 2008 +0100 randr: Panning support commit 834cbc16f3eb539704faade7bff347b161ce69d9 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Nov 28 17:39:23 2008 +0100 randr: Crtc interface update for panning support. commit a475eb9feec75e9ce1e316da0f1679acd7dd3aa8 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Nov 28 17:38:52 2008 +0100 randr: Weird enough, crtc->version was never set upon creation. Fix that. commit 9db84fac0cc767e23986223d22bc085cde0cc86f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Dec 2 14:54:10 2008 -0800 Removed unised option from configure.ac for launchd (cherry picked from commit 87e4de0a9a8af6e5e0cbba74e585761f1160a6ab) commit fa4f2527a5002711fe47c02b14097032fd845dc4 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Dec 2 14:53:21 2008 -0800 XQuartz: pbproxy: Simplify linking (cherry picked from commit 909cc5c4dca0f63e90505575bbd454b46a4670cc) commit 126d8a4c8a72b039903023dce0da64b251080e1d Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Dec 4 02:43:29 2008 -0200 Update .gitignore. Add files left by make distcheck and remove files that no longer are generated. commit 9826b95c198e74f89680cc247b9bd9dd884d72be Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Dec 4 02:05:05 2008 -0200 Correct make distcheck by removing dolt files. commit 5dbe70dd52fd8daf8d0797951cc5a758d2c3b44c Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Dec 4 01:57:46 2008 -0200 Remove dummylib. Only cvt required it, and only used XNF{,c}alloc via xnf{,c}alloc macros. Based on patch by Eric Anholt. commit f841d4e3cccbde02e91c948f5ffb9e32c8c3b3cc Author: Julien Cristau <jcristau@debian.org> Date: Wed Dec 3 23:02:03 2008 +0100 Move RELEASE_DATE closer to AC_INIT so it's more likely to be updated commit 75b02dd0be2ef64c0f8e3138c90b5c5e48b17913 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Wed Dec 3 14:46:30 2008 -0200 Include <X11/Xfuncproto.h> if _X_EXPORT is not defined. commit dd128ddcdcbe254a9cdd973590f6a979a7f0427e Author: Timo Aaltonen <tjaalton@cc.hut.fi> Date: Wed Dec 3 18:40:29 2008 +0200 If AEI is on, disable 'vmmouse' in addition to 'kbd' and 'mouse'. Signed-off-by: Timo Aaltonen <tjaalton@cc.hut.fi> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 0b5ecabfb803cd820338fb0364521fe39b05578b Author: Julien Cristau <jcristau@debian.org> Date: Wed Nov 26 21:19:55 2008 +0100 randr: add swapped dispatch for RR[GS]etCrtcTransform Fix a memory leak in ProcRRGetCrtcTransform() while I'm at it. Signed-off-by: Julien Cristau <jcristau@debian.org> Cc: Keith Packard <keithp@keithp.com> commit 110a71d11ab7a1a55a6a24d792457fdef0b0746d Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Dec 3 11:22:38 2008 -0500 Test for DRI2 extension in dri_internal.h and only enable AIGLX DRI2 if found. commit fd2d40b7ec5d685dac55453eb1f2da672dc83126 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Dec 3 11:31:48 2008 +1000 Xi: change XIUnRegisterPropertyHandler to XIUnregisterPropertyHandler CamelCase can be taken too far, and AFAICT there's no consumers of that function yet anyway. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 49f77fff1495c0a2050fb18f9b1fc627839bbfc2 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Wed Dec 3 05:43:34 2008 -0200 Rework symbol visibility for easier maintenance Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it). commit 0b8f8b24f718820a72ebdc52423c2e6a44e848c5 Author: Stuart Bennett <sb476@cam.ac.uk> Date: Tue Dec 2 22:52:53 2008 -0800 xf86Cursors: xf86_reload_cursors shouldn't unconditionally show hwcursor (#14820) Also, no need to call ShowCursor when SetCursorPosition already does it Based on a previous patch by Maarten Maathuis Signed-off-by: Keith Packard <keithp@keithp.com> commit 9c5dd7337fa93fb1650cc017e523b939dcbf482a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Dec 3 14:24:25 2008 +1000 Let the DDX decide on the XkbRulesDefaults. Rather than assuming rules in the CoreKeyboardProc, init the default rules in InitCoreDevices, then re-use them later. In the xfree86 DDX, set the rules to "base" or "evdev", depending on whether we'll load kbd or evdev. If we create a new MD, use pc105,us as default and re-use the rules file used previously. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 463e02e7de5da3e582a3a049110a476713c7210e Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Dec 3 15:06:37 2008 +1000 xkb: Allow NULL as rulesFile in XkbSetRulesDflts. If no rules file is given, simply re-use the previous one. If no RF is given the first time this function is called, use the built-in default. This includes fixing the built-in default to something that actually exists. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit e670fd889607fa712876218882cd4a9b46937661 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Dec 3 11:55:13 2008 +1000 dix: fix GetMaximumEventsNum(), may return a DCCE event too. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 85d84c7cf2d368d1803dc2cdd03d6c9df8cc0430 Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 2 17:33:43 2008 -0800 Fix GLX after 180bad84774493d48f2793a6281d825560944863. Sigh. commit 4a61ad427c634bcc38a31ce0f14ff5c2d3f706c7 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 2 14:35:45 2008 -0800 Update sample xorg.conf file commit c1db925d10fd37077bed90612ed95c3fd20cd2e2 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 2 14:32:48 2008 -0800 Add atKeynames.h to libdmxinput_a_SOURCES so it's included in tarballs Reported by geearu in #xorg-devel commit 8561514574b3540c729bcc3acca9c943adcdc778 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 2 13:32:34 2008 -0800 Don't need to check uid/euid for every commandline argument Check uid/euid only when handling the arguments that are restricted to root/non-setuid users commit 6de6ffff35ac03d49fa61de195d4a0605e0ef8bf Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 2 13:19:08 2008 -0800 Remove unused config flags from FlagValues & FlagOptions FLAG_DISABLEMODINDEV, FLAG_MODINDEVALLOWNONLOCAL, & FLAG_HANDLE_SPECIAL_KEYS commit bb072019fa8dd292a50ef433d05caeefd1304a73 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Dec 1 16:57:06 2008 +1000 xfree86: don't render SW cursors for devices attached to VCP (#16805) When leaving 3D games such as quake3 or sauerbraten, a cursor may stay on the screen. This is caused by one run of SW rendering for the SD, even though the SD was attached to the VCP and thus has HW rendering capabilities. Check for the SD's attachment (like in all other functions) before deciding on SW or HW rendering. X.Org Bug 16805 <http://bugs.freedesktop.org/show_bug.cgi?id=16805> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 3a690598cf18c4cdc6aadd10a1ecf0772cacd34b Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 2 12:59:57 2008 -0800 Remove unused HandleSpecialKeys config option Was only used by "keyboard" driver - the last place the value was checked was in xf86PostKbdEvent, which was removed in commit 60ea7b51fe2b8a19a08b63db48504971a7a50ee6 commit 1dfed222e93f4684c2a450944a9a0ea9e085c43f Author: Bernhard Rosenkraenzer <bero@arklinux.org> Date: Tue Dec 2 09:01:56 2008 +1000 Xext: fix MultiBuffer compilation error with TryClientEvents. (#18835) X.Org Bug 18835 <http://bugs.freedesktop.org/show_bug.cgi?id=18835> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 9ce995373e4aa4b1bf51b4adafa2324f781ec1cd Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Dec 1 21:32:39 2008 +1000 mi: UpdateSprite only if the device is attached. commit d507f60689f4e14383b0d24e63afc8cf836360d5 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 26 14:15:04 2008 +1000 xfree86: don't FatalError on "too many input devices". Just ignore devices after MAXDEVICES has been reached, but warn the user that the devices are ignored. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 9bf761468fa3baf4c5fa40efa717b4b581d920f9 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 28 11:44:58 2008 +1000 Xi: fix xi_filters size. commit 260e48c252c95fd1b1ba9ad7478791f6b9a67e2d Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 28 11:29:06 2008 +1000 dix: remove confusing (and wrong) comment. VCP is not the only pointer. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 5d02e580d7c4144ea6f0984240fc913e05fec877 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 28 11:46:15 2008 +1000 dix: use UpdateFromMaster in GetProximityEvents. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 95fc59a199f99bf167fbb09297a9bb0e33e31869 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 28 14:55:15 2008 +1000 xkb: Extra sanity checks to prevent dev->key == NULL dereferencing. commit a425abf0eaa61ee5ccb2f32a1af24edd190f7889 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 26 12:20:00 2008 +1000 xkb: don't attempt to filter events for devices without key classes. Reported by Magnus Kessler. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit a85f0d6b98237d8a196de624207acf1983a1859a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 26 11:15:05 2008 +1000 Xi: fix use of button->down - bitflags instead of int arrays. The device's button down state array was changed to use DOWN_LENGTH and thus bitflags for each button in cfcb3da7. Update the DBSN events to copy this bit-wise state. Update xkb and Xi to check for the bit flag instead of the array value. Reported by ajax. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 180bad84774493d48f2793a6281d825560944863 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Tue Dec 2 02:50:45 2008 -0200 Add visibility flags to XSERVER_CFLAGS. This is done to actually change DIX_CFLAGS, as not all "modules" use XORG_CFLAGS. Also export the symbols that are required by other modules after the change. commit 8c560422b44e012053612754430d2b87dc44ed59 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 1 20:02:34 2008 -0800 More man page updates for 1.6 release for Xorg, xorg.conf & exa man pages. - Remove remaining references to XFree86-Misc options AllowNonLocalModInDev and DisableModInDev. - Remove remaining references to grab-breaking keys & associated options. - Update description of Ctrl-Alt-Backspace to new -retro/DontZap defaults. - Add description of new options -modalias and -showopts. - Update list of modules loaded by default. - Update input driver references from keyboard to evdev & kbd. - Update list of driver man pages to match xf86-*-* drivers with man pages. - Add See Also section to exa man page. and various formatting/typo/etc. fixes. The Xorg/xorg.conf sections on input device selection could use further updates to better match the current state of HAL-enabled configuration. commit 6a1850b8c677e2a2993f6f6b731ee3d35aa55d09 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 1 19:19:04 2008 -0800 Correct warning for unknown GlxVisuals option in conf file commit afeacb8e74b2a1e366e5ca9f0e58805d8d96c457 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Dec 1 20:53:17 2008 -0500 Bump dri2proto requirement to 1.99.3. commit ad01e86b5c7c528adec8a1f95ecaa294f58a8922 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Dec 1 20:52:41 2008 -0500 Drop unused DRI2 vblank infrastructure. For this first iteration of DRI2 we don't have any vsync functionality in place yet, so back out the support in DRI2 and the protocol for now. commit 24c562f04b41d219c34f5fa3f963564accf329f2 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 1 16:28:45 2008 -0800 Update See Also lists in Xorg & xorg.conf man pages Remove xorgconfig & xorgcfg Update driver lists: - Remove vga - i810->intel - via->openchrome commit bd147e6f4b03f344c967c88fd433877b14fe1912 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 1 16:08:55 2008 -0800 Remove hack to only load font modules if magic strings appear in font path commit 5f3f14179edf48aad518f6f707bfdc37c27267c6 Author: Jay Cotton <jay.cotton@sun.com> Date: Mon Dec 1 16:06:09 2008 -0800 Sun bug 6618220: Xorg server core dump in xf86RandRModeRefresh(NULL) <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6618220> commit 09df7cc5ad7b72d8a23c3e22fc718aad8c16f4d3 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Dec 1 12:41:10 2008 -0500 Avoid dereferencing NULL pScreen in xf86CrtcSetModeTransform(). We can get there during PreInit as we set a mode for load detection. At that time there's no pScreen anywhere, so just skip the optimization then. commit b0d371ab0a6efd4956c3677faa20b2ac15c33765 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 1 11:36:06 2008 -0500 randr: Don't send output property events on server exit If the Window resource type is already gone, there's no point in trying to send events, all it can do is access already-freed memory. Relevant thread: http://lists.freedesktop.org/archives/xorg/2008-November/040443.html commit 16b11cd03d8c5def07f0e598f237f71a37883a46 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Nov 30 02:59:34 2008 -0200 Correct static symbol XkmReadTOC and first pass on compile warning fixes. The warnings corrected were only the ones that should correct real problems. The most common one is 64 bit integers as "printf %l" arguments. Note that there is a patch related to this at: http://bugs.freedesktop.org/show_bug.cgi?id=18204 commit fb22d4d928bc5d1a893494a059359da2ed2ac639 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sun Nov 30 01:33:20 2008 -0200 Remove declarations of symbols that are never defined. These symbols were removed from the X Server, or never declared. One symbol that may need special attention is XkbBuildCoreState(), that doesn't have a prototype anywhere, but is called from xkb/xkbEvents.c:XkbFilterEvents(), and also used by the macros XkbStateFieldFromRec() and XkbGrabStateFromRec() defined in include/xkbstr.h. fb/wfbrename.h also may need some cleanup, as it makes several "renames" of non existing symbols. commit d6cbd4511e35a89a0353f11834c6fdb8d4d2189f Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Sat Nov 29 23:56:06 2008 -0200 Export symbols defined in the sdk. This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode() commit ffb484f7ef84099019b196ef97bfb2355eb6d52a Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Nov 29 14:30:55 2008 +0100 randr: Avoid needlessly creating a shadow framebuffer. - pScreen->width and height were zero, so it didn't "fit" the screen. commit 01eaebdc98f30fdf543af6337cdf012d3ff16f09 Author: George Staplin <gstaplin@apple.com> Date: Fri Nov 28 13:57:45 2008 -0700 XQuartz: GL: Make various changes to makeFormat, so that it works better. Now glxgears looks normal with the old libGL. Add various GLX extensions to the list of supported extensions. Reformat the oddly formatted code in some areas. Use xalloc and xfree instead of malloc and free. (cherry picked from commit 755f53eb40c4329d8c82a31cb910c31fdd4ea12e) commit 3d527b91b4bfa31e78d5fc7a1447a4026876f14e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 28 12:59:09 2008 -0800 XQuartz: Added option to enable/disable test extensions defaults write org.x.X11 enable_test_extensions -boolean true (cherry picked from commit fd4710aff3723d5f3422cf6a6530172eafc556d9) (cherry picked from commit 635019ad18db921fec99256294debd8571074abf) commit 71d3df7cc37403b5842227a035d9b995fd920e0b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 28 11:18:14 2008 -0800 XQuartz: Avoid some warning messages being spewed to system.log by AppKit (cherry picked from commit 780eff230ce41ad785e54d61a82c731269ae0446) commit a9796c7bc43223df44f12a7be08e361aea963ec1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 28 01:45:37 2008 -0800 XQuarz: Setup our PATH and PWD earlier, so our initial client benefits from it as well... (cherry picked from commit cbae2b447357b3fed6ff19414c60dd3792045600) commit ef4179f43a84d90f867b95ee5974ad26884253b5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 26 12:15:58 2008 -0800 XQuartz: Fix dead-acute on Greek keyboards (cherry picked from commit 807f2ec35c5f95b56b3e2b5eac51aec300fe5cb6) commit 800f5c681bed300d8caf99935e8f80ea6c1993ba Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 26 12:07:52 2008 -0800 XQuartz: Fix Czech keyboard dead-acute (cherry picked from commit 771df2786bc60389489f0967e705c7c95bdda085) commit ac57bb36d56a7a4d41add8d5a206ff37544a1819 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 20:14:37 2008 -0800 XQuartz: Fix an uninitialized keyboard_type on Tiger (cherry picked from commit 27b1a5eb3482052253ebdce1a09aedf05ac1b099) commit 45c8bd0fe54273039fdaa1eeeafb81b5774f2c75 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Fri Nov 28 02:01:57 2008 -0200 Enable compiling the X Server and modules with hidden symbols by default. Note that it checks if support for symbol visibility is available by the compiler, not if it is functional. It may have problems on non x86 architectures. To disable the feature, just pass the option "--disable-visibility" to the X Server configure script. Unless using an alternate build schema, drivers built from a git checkout will use the same "visibility" related CFLAGS used to compile the X Server. commit 31285d063ec4623cb0764437d6d57e244f20460d Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Fri Nov 28 01:55:11 2008 -0200 Make visible symbols required by xorg modules. This patch exports all symbols required by the compilable (in a x86 linux computer) xorg/driver/* modules. Still missing symbols worth mentioning are: sunleo miFindMaxBand no longer available intel (uxa/uxa-accel.c) fbShmPutImage no longer available (and should have been static) mga MGAGetClientPointer (should come from matrox's libhal) This is not a definitive "visibility" patch, as all it does is to export missing symbols, but the modules that current don't compile, may require more symbols once fixed, and third party drivers should also require more symbols exported. A "definitive" patch should export symbols defined in the sdk. commit 6f18ea7e656b79e58f66f51067334414767b413f Author: Julien Cristau <jcristau@debian.org> Date: Wed Nov 26 19:07:04 2008 +0100 Typo fix commit efefc03f9b26738b69abb570c1af2167cc99c4d8 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 13:19:48 2008 +0100 Add missing include ../../../../hw/xfree86/xaa/xaaTables.c:9:14: warning: symbol 'byte_expand3' was not declared. Should it be static? ../../../../hw/xfree86/xaa/xaaTables.c:53:14: warning: symbol 'byte_reversed_expand3' was not declared. Should it be static? commit 74bc792e1814849b8eee9e448e36c3568b821e6c Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Nov 27 05:34:14 2008 -0200 Export symbols required by the vesa and fbdev drivers. This is a minimal set of patches, to have an usable X Server when compiling it with symbols hidden by default. commit 74e2669103b59d51b24ddc48f378b1d04a3effd4 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Nov 27 04:33:44 2008 -0200 Export symbols also defined in libXfont. libXfont has stubs for these symbols, so, when compiling with hidden symbols by default, these symbols must be visible in the X Server, or the stubs in libXfont will be used. commit 87a7fb7438b70d07ebf240c530b8548a01021d48 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Nov 27 00:12:59 2008 -0200 Rework code using return value of LoaderSymbol as a function pointer. The patch removes all macros in the format define xf86_sym ((type (*)(argument-list))LoaderSymbol("sym")) creates a new macro in the format define xf86_sym sym and ensures "sym" is a "visible" symbol. The patch doesn't add or remove features, and is source and binary compatible with previous shared objects (with the difference that it requires the dlloader). These symbols are a special case, as, due to the fact that LoaderSymbol was being used to reference them, they are not easily found by "automated" tools that check for missing symbols. And now it also have the benefit that the compiler/loader "knows what is going on". commit fc708394318ed92c612e2938b335c08c1ffebb28 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 26 15:49:02 2008 -0800 Add server support for RRGetScreenResourcesCurrent This depends on randrproto 1.2.99.1 Signed-off-by: Keith Packard <keithp@keithp.com> commit f710ce269c020a39f58b2bfbd0fe5192a3279c72 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed Nov 26 20:02:44 2008 +0000 bump master to 1.6.99.1 (now the 1.6 branch is created) commit f3edc1fb0210149f35eab4e413700b5c4ac48214 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 25 23:15:35 2008 -0800 New version of dolt commit 4715f079b9c61362755c95c1ebf89c97cc6fff2b Merge: 9ffc671 ed597f1 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 25 22:19:08 2008 -0800 Merge commit 'origin/master' commit 9ffc6719390df8fdd0a5295a7a7a0eaea792be45 Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 24 13:08:48 2008 -0800 Move matrix operations from X server to pixman 0.13.2 pixman 0.13.2 now holds all of the matrix operations. This leaves the protocol conversion routines and some ABI stubs in place Signed-off-by: Keith Packard <keithp@keithp.com> commit ed597f19fdc3017dde6d1452b5cdf8ddcd69a5b1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 25 19:36:31 2008 -0500 xselinux: use "raw context" variants of getpeercon() and getcon(). commit ec1d08442f69353cb0e73ac4eaf0346ebb975594 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Nov 21 15:13:00 2008 +1000 dix: Enable core devices in InitCoreDevices already. Updated patch, see http://lists.freedesktop.org/archives/xorg/2008-November/040540.html Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 2b45602e828a07a0817691b2838cd34ffee531bd Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 26 10:42:52 2008 +1000 Revert "dix: Enable core devices in InitCoreDevices already." I merged the wrong patch. See correct patch at: http://lists.freedesktop.org/archives/xorg/2008-November/040540.html Not activating the device before attempting to enable it would leave the sprite unset, crashing the server when enabling the real devices. This reverts commit e078901a4eca02bd3e7a80d9462dafbca939a187. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 416685c295353b5816689994c7c58ae7db3e878d Author: Jeremy Uejio <jeremy.uejio@sun.com> Date: Tue Nov 25 16:26:44 2008 -0800 Refix Sun bug #6685465: Xephyr uses wrong or bad colortable in 8-bit mode <http://bugs.opensolaris.org/view_bug.do?bug_id=6685465> This is a refix of the previous fix for CR 6685465. In the first fix I was shifting the colors to match the mask by the bits_per_rgb amount in the visual structure. That field has nothing to do with the # of bits to shift by. I should just instead shift the bits to match the mask. commit d5f9a131a2d5bd33f82fdd4e809880b0ff792b45 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Nov 25 15:46:39 2008 -0800 Fix const-mismatch warnings for DisplayModePtr's Includes fixes for: "xf86Config.c", line 2434: warning: argument #1 is incompatible with prototype: prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351 argument : pointer to const struct _DisplayModeRec "xf86EdidModes.c", line 312: warning: argument #1 is incompatible with prototype: prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351 argument : pointer to const struct _DisplayModeRec "xf86EdidModes.c", line 438: warning: assignment type mismatch: pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec "xf86Modes.c", line 701: warning: assignment type mismatch: pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec commit d5ad296869c38ab30136b5a293a0125b76aad994 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Nov 25 14:12:26 2008 -0800 Remove duplication from code paths in XkbDDXCompileKeymapByNames commit 2538fc0d893a150e978355d281750f0a989728a7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 25 18:18:46 2008 -0500 xselinux: don't pass a NULL key string to selabel_lookup(). commit c8472a74441838e16d0d3414db1fa7fe996868a9 Author: Michael Vogt <michael.vogt@ubuntu.com> Date: Tue Nov 25 19:35:17 2008 +0200 Do not send VisibilityNotify events when MapUnmapEvents are disabled This prevents a protocol visible side-effect (XVisibilityEvent) on XCompositeRedirectWindow() followed by a XCompositeUnredirectWindow(). The problem shows up in gnome-screensaver with compiz and "unredirect fullscreen windows" enable. A VisibilityNotify event is generated (first with obscured and than with unobscured) when the window swithces from redirected to unredirected. https://bugs.freedesktop.org/show_bug.cgi?id=18133 http://launchpad.net/bugs/278112 commit 88297558aada44bc714ad57adbeed3740aaadee5 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 14:20:58 2008 -0500 Dead code cleanup over DBE. No DDXes have explicit DBE support anymore, so the init registration table never got used. Just nuke it all. commit e5eaea599ab16428c69912b6b3427ebe46707d7c Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 14:05:51 2008 -0500 Warning fix xf86info.c:11: warning: initialization makes integer from pointer without a cast commit 37072500f7bcf39e0d6aa2ceb5d1f2aeeab0b26b Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 14:04:44 2008 -0500 Warning fix helper_exec.c: In function ‘port_rep_inb’: helper_exec.c:219: warning: implicit declaration of function ‘DEBUG_IO_TRACE’ helper_exec.c:219: warning: nested extern declaration of ‘DEBUG_IO_TRACE’ commit d96bffce2dcf209e76be9b36ca1ede7e0c976d77 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 13:59:00 2008 -0500 Warning fix Init.c:139: warning: no previous prototype for ‘ddxBeforeReset’ Just declare the prototype always, seriously. commit 09ea671cbff605fd2b2af71619e7db5002108bf8 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 13:40:47 2008 -0500 Warning fix lnx_bell.c:37: warning: no previous prototype for ‘xf86OSRingBell’ commit a9853c7d337b3b1ad49793e9b4b90e313b6fa536 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 00:53:55 2008 -0500 Warning fix Pixmap.c: In function ‘xnestPixmapToRegion’: Pixmap.c:93: warning: ‘Box.x1’ may be used uninitialized in this function commit 81eafe9f93a272b06aa9f9235ec5676b9aa3ee3e Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 00:45:07 2008 -0500 Warning fix. vbe.c: In function ‘VBEReadPanelID’: vbe.c:1145: warning: return from incompatible pointer type commit 09bfb25e031772611a2f0902d4ba77b587e4bdb2 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 00:43:36 2008 -0500 Remove unused XAAAvailableOptions commit 8b9253f6383df3fefe38bde43a5f892b158a77c4 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 00:38:47 2008 -0500 Code motion: subsume xf86DoProbe.c into xf86Init.c commit fbabb1c5c243cfd8c954dec4c060dff1a0b81015 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 00:34:28 2008 -0500 Warning fix. In file included from l3-xaaStipple.c:4: ./xaaStipple.c:35: warning: no previous prototype for ‘XAAGetStippleScanlineFunc3LSBFirst’ etc commit cbaca6ec666d7349c4680b8affc13b5c9cae1fa5 Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 25 00:14:24 2008 -0500 Remove dead FreeModuleDesc. commit eb474adf98229a43bbe17ab98ff084371cb9fa09 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 11:25:58 2008 -0800 XQuartz: Simplify the xquartz_resetenv_display path (cherry picked from commit d2e0624dd30eb234bb25595ceedfa51d48ca1724) commit 94df1ab7f09a64f57c1e1453e3640462e984619c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 01:30:03 2008 -0800 XQuartz: Force X11Controller to reset a broken DISPLAY envvar. (cherry picked from commit f1a52b5b5ac31702497937efe3ac578be9a6c54f) commit 0b314c50a2a0ca1afbdc06663c3b719b05ebb851 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 01:13:35 2008 -0800 XQuartz: Removed hardcoded org.x.X11 from MachIPC as well (cherry picked from commit b4add7826d485600a13eba6a9c7be533f2c02d51) commit 065d2afb0ca34f89806e0936c51cd27805bc5123 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 00:51:01 2008 -0800 XQuartz: Add fallback for xpbproxy's display for Tiger or no-launchd-Leopard (cherry picked from commit 7a8c6665949d7804a97ef2539a74ec4aa682e1cc) commit 13df49dca28cf680a4d104630cd675de25d3e944 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 00:39:52 2008 -0800 XQuartz: Use the environment to pass the bundle's prefs domain on to xinit/quartz-wm for Tiger or no-launchd-LEOPARD (cherry picked from commit fbf4b0d33fa5dc618c3191a4e823232dfa33cd95) commit 40187f782beae4ae751824ef511c9f56a80357c7 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 00:20:57 2008 -0800 XQuartz: Dead code removal (cherry picked from commit eeb323612e0adbea37befed31bbaa1d295728385) commit b55cad4569e34e3c10e9a327e20b91ea87d9dd98 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Nov 25 00:15:53 2008 -0800 XQuartz: Don't hardcode values of org.x.X11 for the preferences domain (cherry picked from commit 3a500d9247cf34686ec17b4a88c34d51ecd38ecd) commit d508a3dcca2f160021aced872715e1ded23cef97 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Nov 24 23:33:54 2008 -0800 XQuartz: More dead code removal (cherry picked from commit dcb0f6a2e62823a671051874d14a33ce59505892) commit 41fbdf72f2154a3fca8cf484a611501e3c174fbe Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Nov 24 12:33:20 2008 -0800 XQuartz: Disable some error spew on Tiger (where it wouldn't be an error) (cherry picked from commit 73ec6d3dfe0086d352f4eca25f1df5ae1884bb18) commit 09c3f6e04c273ffafcb547c252137fb17c8ce016 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 22 20:23:46 2008 -0800 XQuartz: Dead code removal (cherry picked from commit 46c077d9b4a883fc809c32077ce40f33a70d268b) commit ab12c7516207908f3e063a78904d68e2db14208e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 22 15:47:14 2008 -0800 XQuartz: More Tiger cleanup: bootstrap_strerror (cherry picked from commit 37f535aff3e9a7a02711daa98152cdff97745622) commit 208f091bfc657e9ee57b988f035d3aac7e9e173a Author: Adam Jackson <ajax@redhat.com> Date: Sun Oct 12 00:07:56 2008 -0400 Remove xf86IODelay commit 47478aa10adb20b6e48335ac8c4ef31f3fdfe68c Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 23:59:24 2008 -0400 Remove xf86{En,Dis}ableInterrupts entirely commit c7680befe5aebd0f4277d11ff3984d8a7deb9d5b Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 23:35:24 2008 -0400 Remove the remnants of Jensen support As being an EISA-only machine, and as ISA support is gone now... commit df14682a31b92751091571ed82f6095f55f19cca Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 22:48:51 2008 -0400 Bus: Remove ISA support. No, really. PCI is old enough to drive now. If you want this, get the kernel to expose a framebuffer device. commit a8bcab2d3b224e4d4d5b6a097ea530beee920213 Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 22:14:23 2008 -0400 Bus: Remove yet more unused overlap processing. commit 994b7c034fc20d76651cf7f6a285526d9aff8770 Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 22:11:12 2008 -0400 Bus: Don't pretend to care about IRQs, DMA, or PCI config space commit eb5ae45127fa9f08f0badec7e21f8c26c9c7c969 Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 21:44:16 2008 -0400 Bus: Simplify a failure case (that pretty much never happens) commit ee8b5cf94c2a9f8526a3bb5011ebb10f3246a4d9 Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 21:41:47 2008 -0400 Bus: Trust the kernel when registering driver resources ... everywhere, not just (linux && (ia64 || alpha)). commit 8397df89456558e3c85b05e0acfccb9f6af6b695 Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 21:36:14 2008 -0400 Remove unused MIN macro commit c251c0baae59714a6ac83b69cd106c08baa3613e Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 21:34:27 2008 -0400 Bus: remove special handling for init-only resources This isn't used by any driver, nor has it ever been as far as I can tell. commit 3e5281af17841cf50d0e52a728b12c6ab56e61df Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 21:16:45 2008 -0400 PCI: Unexport xf86scanpci commit 6b198daa46f2f609aff7900761cf82cc2fb4e0b4 Author: Adam Jackson <ajax@redhat.com> Date: Sat Oct 11 20:51:39 2008 -0400 Bus: remove useless isaConvertRange2Host commit a96db74c2a95bb1dce132cf47ea720ae939dfad7 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 9 00:43:26 2008 -0400 Bus: Don't try to find an ISA bus just for fun. commit b21311a99d58997cd1fc68726d0848242e9c34fc Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 9 00:34:42 2008 -0400 Bus: Remove unused RemoveOverlaps commit 41be6b3f0dc0baa1c6ae8d2b41a6be73ca0e7268 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 9 00:33:28 2008 -0400 Bus: Remove the notion of estimated resources. commit 095ba1435501776c8c8a34e767b89f89e5dc949a Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 9 00:27:33 2008 -0400 Bus: remove the "reducer" This code effectively didn't do anything anymore. commit 4457e31710af90f9ac295bb686c841e9473fb767 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 9 00:14:54 2008 -0400 PCI: Remove unused ia64 platform code. commit 86cfe0ee236bfd3613e5f9ba589211db42d009eb Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 23:45:40 2008 -0400 PCI: Simplify OS PCI function registration a bit. commit 2d427b9cb1594f8f2f66b463033fff5b459962fd Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 23:38:23 2008 -0400 PCI: Remove config mechanism details. pciaccess handles this for us now, no need to remember PC arcana. commit 5bb86bafd6fda296011cbcd5d15a85a6d770ae29 Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 23:34:41 2008 -0400 PCI: Remove non-pciaccess path for x86. commit a67360e79fa7e17c3d907771694009c57c1cd195 Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 23:31:38 2008 -0400 PCI: Always build domain support. commit 51e105ccc3d0ac8c0fe74efd029ffbddb80b140e Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 23:12:31 2008 -0400 Remove xf86GetResourcesImplicitly commit 599a0f3f1e3ae92676e3648471576c0001cfd9ae Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Nov 24 20:37:58 2008 -0800 Fix typo in 5bf2c88d2317230b95b2904cb975167d03ee13a2 Amazing how these things hide until you see the diff come back from the commit list. commit 5bf2c88d2317230b95b2904cb975167d03ee13a2 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Nov 24 20:34:46 2008 -0800 Simplify filename generation code for Xorg -configure commit 75784e1e53ad78e21518696dd9d297bc08c17d54 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Nov 24 20:32:20 2008 -0800 Solaris: Make KDSETMODE failure non fatal, and retry it on interrupts commit 3e6da1636093d7dc98baac40544c0b0fb7fd8aec Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 14 15:55:57 2008 +1000 include: remove ENTER_LEAVE_SEMAPHORE macros. commit b292a7a2d7e259177e1cc37346c2bee27a018630 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 14 15:44:29 2008 +1000 dix: updated enter/leave core event model. As proposed by Owen Taylor [1], the enter-leave event model needs to adjust the events sent to each window depending on the presence of pointers in a window, or in a subwindow. The new model can be summarised as: - if the pointer moves into or out of a window that has a pointer in a child window, the events are modified to appear as if the pointer was moved out of or into this child window. - if the pointer moves into or out of a window that has a pointer in a parent window, the events are modified to appear as if the pointer was moved out of or into this parent window. Note that this model requires CoreEnterLeaveEvent and DeviceEnterLeaveEvent to be split and treated separately. [1] http://lists.freedesktop.org/archives/xorg/2008-August/037606.html Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 724f83b87bb16472d4c328e35d2a477384b29f84 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 14 15:29:01 2008 +1000 dix: add FirstPointerChild, FirstPointerAncestor auxiliary functions. FirstPointerChild: Return the first child that has a pointer within its boundaries. FirstPointerAncestor: return the first ancestor with a child within its boundaries. These are required for the updated enter/leave model. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 7d3e595f93dcd3d334e766a9dea602c05affdbaf Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 14 15:27:19 2008 +1000 dix: Add EnterWindow, LeaveWindow, HasPointer auxiliary functions. These replace the ENTER_LEAVE_SEMAPHORE_* macros. Unused currently. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 6bdc963cdabb4a2e77de7f00a1d062aa2b873f9b Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 14 15:37:35 2008 +1000 dix: split enter/leave event handling into core and device handling. Device events always need to be delivered, core events only in some cases. Let's keep them completely separate so we can adjust core event delivery. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 5e48f5e2dd2dec7cfd1fa40b61e25123dfca515e Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 14 15:41:59 2008 +1000 dix: remove unused EnterLeaveSemaphoresIsset. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 868fd503b7aeab31dba72046b59061008d8b7501 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 14 15:18:56 2008 +1000 dix: move Enter-Leave related functions into new enterleave.c Preparation for the new core enter/leave model. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit c4b9ab6bf56139fdd8c7c584a6f523c6766cddd6 Author: Keith Packard <keithp@keithp.com> Date: Tue Apr 29 08:29:42 2008 -0700 Handle transform failure when computing shadow damage area. PictureTransformBounds can fail, when this happens, damage the entire screen so that the shadow gets repainted correctly. commit 9c7679240ad90367693a462e288308b3fdc08f26 Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 30 19:05:07 2008 -0700 [randr] don't try to compute crtc transform when no mode is set. Dereferencing the NULL mode pointer would cause a crash. As these transform matrices won't be used while the CRTC is disabled, just leave their values alone. commit 315b6d0a425d0257f226ee7032aca3ca31665e59 Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 27 11:46:39 2008 -0700 Update RandR global transform when driver notifies of transform change. Need to compute and save the global transform when the driver changes it. commit 5d9282fde919c936816a85c2a9c5734dc9d57cc2 Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 27 11:45:53 2008 -0700 Export rrtransform.h as needed by randrstr.h When the transform management was moved from randrstr.h, the associated header file became necessary to build drivers. Include it as a part of the sdk headers. commit 7236fd9dd4e9f5c4cb5bafa5c2a18cff12a0444c Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 21 03:16:09 2008 -0700 Be careful about copying transforms around; they have allocated memory. commit 7e69e364d2ef146d8ec3651d04bdd6d641017449 Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 21 03:15:00 2008 -0700 Fix rotated/reflected cursor positions. Doing projective transforms required repositioning the cursor using the hotspot, but that requires relocating the upper left corner in terms of said hotspot. commit 93179c214fc6ed88f72955a11c69ae0a47316d8c Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 21 03:14:47 2008 -0700 rrtransform needs randrstr to get RANDR_INTERFACE defines commit 7c61db66a470a8306e346ed8bf8934f014dada42 Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 21 02:39:49 2008 -0700 Create rrtransform.[ch]. Add RRTransform argument to RRCrtcNotify. Instead of using a separate function to notify DIX about transform changes, add the transform to RRCrtcNotify so that the whole Crtc state changes atomically. commit fa6a1df209bd74da1d545982cca437afc2198cc1 Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 21 02:35:28 2008 -0700 Avoid overflow in PictureTransformPoint. Fix PictureTransformIsIdentity. PictureTransformPoint computes homogeneous coordinates internally, but fails to handle intermediate values larger than 16.16. Use 64 bit intermediate values while computing the final result at 16.16 and only complain if that result is too large. PictureTransformIsIdentity was completely wrong -- it was not checking for identity transforms at all. commit 6fe9c15731be5f5afabacb3aa3ed71b840f4238b Author: Keith Packard <keithp@keithp.com> Date: Wed Mar 19 12:15:39 2008 -0700 Allow drivers to set crtc transforms. Track curent transform down in the mode setting code so that it may be set separately from RandR. commit 49db14e4ac26070ed86088419483888dda18b603 Author: Keith Packard <keithp@keithp.com> Date: Wed Mar 19 00:46:35 2008 -0700 Handle RandR transform matrices in floating point. RandR matrix computations lose too much precision in fixed point; computations using the inverted matrix can be as much as 10 pixels off. Convert them to double precision values and pass those around. These API changes are fairly heavyweight; the official Render interface remains fixed point, so the fixed point matrix comes along for the ride everywhere. commit 6f734aecaec4f5c6152c3ebca197ef65bb4523da Author: Keith Packard <keithp@keithp.com> Date: Tue Mar 18 16:06:06 2008 -0700 Eliminate inverse matrix from randr transform protocol It is easier, and potentially more precise, to compute the inverse in the server where everything can eventually be kept in floating point form. commit 197aa784694992f6bcfd194932309e440334c237 Author: Keith Packard <keithp@keithp.com> Date: Tue Mar 18 15:35:44 2008 -0700 Report whether transforms are support from driver through extension to client Add APIs to xf86RandR12 support and randr extension to record whether the driver supports transforms, report that value in the RRGetCrtcTransform reply. commit e86c34663ef97e946a1129450105efa89a123af6 Author: Keith Packard <keithp@keithp.com> Date: Tue Mar 18 15:25:31 2008 -0700 Clear shadow pixmaps before using them. This eliminates some ugly flashing, as well as clearing the borders when the shadow will not be completely painted. commit 97ab0c6eff870b52c0383b63a78cec49059b2545 Author: Keith Packard <keithp@keithp.com> Date: Tue Mar 18 15:15:40 2008 -0700 When converting from double to fixed, round carefully. This reduces the matrix representation error after inverting a transformation matrix (although it doesn't eliminate it entirely). Perhaps we should extend Render to include 64-bit floating point transforms... commit 6d3a9e40a4b9ec455af11cce31e4aa616c93db32 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 23:04:49 2008 -0700 Compute matrix inversion instead of using wire version in RRCrtcTransformSet It doesn't make sense to have the client invert this matrix when the server can do so reasonably efficiently. This avoids weird fixed point rounding errors when testing the transform against its inverse. Now to fix the protocol. commit 160252d94f04acc95f0a4e0f884ff565a5aa0744 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 23:03:56 2008 -0700 Add matrix inversion function (uses doubles) The obvious matrix inversion function, coded using doubles to avoid fiddling with fixed point precision adventures. commit 8fd82c88e3f2060fda4ba30376900ece77668c63 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 16:14:43 2008 -0700 Adjust transformed cursor position to account for hotspot commit eb222e64128034df8361d5a82d4f4aa1318923ce Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 16:14:15 2008 -0700 Actually use filter kernel size to expand transform redisplay box commit 3fdb963f6e8287edeb4c5bc7bbadbc02eb8bb910 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 16:13:25 2008 -0700 Correct bilinear filter kernel size (should be 2x2) commit ee6326a6b89b2d223f6e1eaf02aac1fe8aebfaf6 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 15:22:06 2008 -0700 Handle filter widths in xf86Rotate commit ddc8466137d229fdc100cc403f492c7d61a1ba89 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 15:21:26 2008 -0700 Initialize and cleanup new filter fields in xf86Crtc. commit 16c093afd4f6b30d889cacdc994b0024f9bd83d5 Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 15:20:52 2008 -0700 Pass filter kernel size through transforms commit 1df02d7ddd44f84bcaefd6583af1a9141cb3c78b Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 15:19:17 2008 -0700 Add kernel size to Render filters. This width/height value lets filter users know how far the filter spreads into the source image. commit 40f3dff6b350fe0be55ebf7dbca88a0ef8f6380f Author: Keith Packard <keithp@keithp.com> Date: Mon Mar 17 13:57:47 2008 -0700 Use transform when computing scanout size of modes Report transformed crtc sizes through RandR and Xinerama. Test screen size against transformed mode sizes when configuring the Crtc. commit f50349e1930e620cacdf27a6f8585fcb9cb5199a Author: Keith Packard <keithp@keithp.com> Date: Sat Mar 15 00:36:45 2008 -0700 [RANDR] Support filters in CRTC transforms. Create new RRTransform datatype to hold all of the transform related information, use that in lots of places to pass filters around. commit acda790e430b2a18c7c35379f6e538f3d01ff221 Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 14 13:46:30 2008 -0700 [render] Split out filter finding from filter setting. To prepare for RandR using filters in transforms, split out code paths so that the RandR code can validate the filter name and parameters during the transform set operation so that use of the filter later will not have unreportable errors. commit e3d6f279d5c305dfb81ca109fbfb665870712d2f Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 13 21:31:12 2008 -0700 Wire up RandR CRTC transform protocol, bump server to RandR 1.3 This involved removing a pile of matrix code from the DDX, as well as moving a bit of transform logic from DDX to DIX. commit ff9d1cd843a9b0aba69a3d788b21d5f6af702590 Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 13 21:30:18 2008 -0700 Add funcs to convert between protocol and pixman matrices commit c2f254da694731ea573aa8bbc2707c083743f2d4 Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 13 21:29:19 2008 -0700 Randr now depends on Render for matrices commit f547650328287545a7a4d96df8d6a6c606dd95a9 Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 13 14:50:13 2008 -0700 Export a bunch of matrix operations from render. The render extension uses many matrix operations internally, this change exposes those functions to other parts of the server, drivers and extensions. The change is motivated by the 'transform' additions to the RandR extension but will likely be useful elsewhere. commit e063162e80e51ed4368874b3af7ba690ea280d9e Author: Keith Packard <keithp@keithp.com> Date: Thu Mar 13 14:26:01 2008 -0700 Add projective transforms to RandR DIX/DDX API. New RRCrtcGetTransform function in DIX that DDX can use to get the pending transform. The DDX code should be complete; the DIX code is just a stub at this point. commit 9c7ac47b871a71e42d2f6933749ca462f1a65b40 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 4 00:10:08 2008 -0800 Notify DRI when crtc regions change Drivers that care about crtc positions on the screen to ensure that vblank works correctly need to be notified when crtcs are changed. Provide a hook in the mode setting code that is invoked whenever any configuration is done to the screen. Use this new hook in the DRI code so that DRI clients are notified and receive updated information. Signed-off-by: Keith Packard <keithp@keithp.com> commit 554592cd70543f87cd8bee5ff47cc8281511e041 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Nov 24 11:50:38 2008 +1000 DGA: silence compiler warning. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 0dbcbd35f63db14734199a0beb2a91b6937f3838 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 21 12:02:02 2008 +1000 xfree86: Split the working code of NIDR into new xf86NewInputDevice. The xfree86 server previously hat NewInputDeviceRequest and InitInput, and both basically did the same thing. Reduce NIDR to parameter checking and use xf86NewInputDevice from both InitInput and NIDR to actually create the device. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit e078901a4eca02bd3e7a80d9462dafbca939a187 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 21 12:39:55 2008 +1000 dix: Enable core devices in InitCoreDevices already. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> commit d939f2482e71ad20bac28b7aa4b2e8c8196e9d65 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 21 12:21:45 2008 +1000 dix: fix false comment. VCP and VCK are always present, this comment is a leftover from earlier MPX days. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 387563b77743d92be83420d982eaf57f5459a883 Merge: 85f650c f6e01fa Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Nov 23 13:15:46 2008 +0100 Merge branch 'master' of git+ssh://herrb@git.freedesktop.org/git/xorg/xserver commit 85f650c9b76ab2e244f01908a7941c320635becd Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Nov 23 13:14:27 2008 +0100 missing action in if statement. commit f6e01fa1b87ea190ea5ad723ce46893784ea1de4 Author: Stefan Dirsch <sndirsch@suse.de> Date: Sun Nov 23 11:16:03 2008 +0100 Added '-showopts' option to print available driver options (#5564). commit 8964b8d0ec2b7b3b6bf540cd647b14a20e8f64a5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 22 14:23:23 2008 -0800 XQuartz: More 1.6 server API updates commit ad0f232165fe1a25ca4fb6da817da02b6ce31779 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 22 14:04:28 2008 -0800 XQuartz: Fixed --disable-glx commit 8e2287c220694953e972cd5119c2b0cd256b7a30 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 22 13:57:45 2008 -0800 XQuartz: Updated some code to use newer server API commit 6eb33bc0cb2e62339d323e1f1894015d7e3142f3 Author: George Staplin <gstaplin@apple.com> Date: Sat Nov 22 11:37:08 2008 -0700 XQuartz: GL: Remove the inclusion of glcontextmodes.h. Add some commentary about future directions needed for the GLX drawable creation and destruction code. Match xalloc with xfree. I made some minor formatting improvements. (cherry picked from commit b772d64fce31d16b498c621096e39d5203994d6e) commit 429b4b20d5708d608fd55f91dd5bcd4ac0b51a12 Author: George Staplin <gstaplin@apple.com> Date: Sat Nov 22 10:57:58 2008 -0700 XQuartz: GL: Add a branch to prevent a NULL DrawablePtr structure access. In attach() check for pDraw being NULL, and also print an ErrorF message, because we eventually want to track down why this is occuring. It's unclear how this occurs, but as I noted in the 1.4 branch, I believe that the DrawablePtr/struct _Drawable -> id is the member being accessed that causes KERN_PROTECTION_FAILURE at 0x0000000000000004 This passes my tests using: env LIBGL_ALWAYS_INDIRECT=1 ./sometest. I fixed a warning: caused by initializing the screen->base.visuals with the configs. It is a ** not a *. It seems that some other part of GLX will initialize this for us. (cherry picked from commit 17f6a261fca6d5856069dce28bb4838261afc6bc) commit bc0c7075e29b1719409cf7de8a4ab9ae1315aa67 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Nov 22 19:10:09 2008 +0100 Remove the old libusbhid copy from os-support/bsd. This has been replaced by in-kernel support for USB mices several years ago and hasn't been enabled in build since X.Org 6.8. commit 76fcfc480133726112049e5bd9c3082d46825918 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 21 20:25:55 2008 -0800 XQuartz: GLX: sync up indirect.c to match George's updates in the xorg-server-1.5-apple branch commit 1a717779b67b9c1cdf734eef64135ac38829f726 Author: George Staplin <gstaplin@apple.com> Date: Fri Nov 21 17:28:11 2008 -0700 XQuartz: GL: remove glcontextmodes.* from the Makefile.am. It has been replaced. The new replacement is __GLXconfig. (cherry picked from commit 3bed9b65c807a1aeb662b8042826cbb54280181d) commit dacad9ae0bdaedff9403fbe84a5c5a4b4eef3542 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Nov 21 17:16:22 2008 -0800 Xephyr man page typo fixes. Also trailing white space removal to clear git warnings. commit ca64b5949d229a60a3c62b6d29d51873b7694bd6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 21 11:20:31 2008 -0800 XQuartz: Don't use LS to find X11.app on Tiger. (cherry picked from commit e62107e55261ef252a2a24dd26a60e5dd295d560) commit 701f8e3a94d2b659ebcfffd09acd1d66f9e797b8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 21 11:08:00 2008 -0800 XQuartz: Update applewm deps (cherry picked from commit 0ad91c59be8759a9c9e9d4f639056d8c689a3bc5) commit 393325f908f8bd6648e466183f3683a2d80b264e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 21 10:57:31 2008 -0800 XQuartz: spewCallStack is noop on Tiger now... (cherry picked from commit 56c469a68b92c6cf003802f418ea00bd596a41c3) commit 5d47a5d6526b7e52387647a15a580dfcafd1733f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 21 10:54:55 2008 -0800 XQuartz: pbproxy: Added some typedefs for types not available on Tiger (cherry picked from commit 0947aa7911f1de44bfe16e505a757b659c5ab2a8) commit b262788401715787c68cea4ca79f4b270307afee Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 21 10:53:39 2008 -0800 XQuartz: More Tiger ifdefs (cherry picked from commit 803509072f2c039e5cd555c4ac14d672f0e698c5) commit 510744444329170f702d31d43997a6bbc1591b44 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 21 10:44:11 2008 -0800 XQuartz: Resurrect the old audio path for Tiger (cherry picked from commit a61a8d9047e8765faf3892f4f2148c8553fd192c) commit d7ee76f9dd84da05b59591a971b96bf990136767 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 19 11:42:59 2008 -0800 XQuartz: pbproxy: Push the pbproxy Xevent processing into its own thread and just have the AppKit thread wake it up. (cherry picked from commit 799715b8f3327c8da59ab45706e85af2d2c438e4) commit a9e20306fbe3262602f21b876a52a1ef38cdf20a Author: Egbert Eich <eich@ovid.suse.de> Date: Fri Nov 21 18:50:01 2008 +0100 int10: Do an mprotect(..,PROT_EXEC) on shmat()ed memory ranges. When the linux kernel sets the NX bit vm86 segfaults when it tries to execute code in memory that is not marked EXEC. Such code gets called whenever we return from a VBIOS call to signal the calling program that the call is actually finished and that we are not trapping for other reasons (like IO accesses). Use mprotect(2) to set these memory ranges PROT_EXEC. commit a54153e669fd293a47f0077bf25505dd545ddce2 Author: Rémi Cardona <remi@gentoo.org> Date: Fri Nov 21 16:39:00 2008 +0100 xfree86: don't reset Auto(Add|Enable)Devices, use defaults from xf86Globals Without this, commit ace38fafb062372dcd3d56378b5b8f86525c6241 is useless when HAL support is disabled. Signed-off-by: Julien Cristau <jcristau@debian.org> commit 6a1b2fed7e465a9c652e8ee250b8eab440945862 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Sep 28 12:18:16 2008 +0200 Add a man page for Xephyr, with information from the README file. commit 10d472bf9d61bef32d0a383b2e3783e7a1d7621f Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon May 19 05:15:30 2008 +0200 Support for BSD apm XXX check amd64 pci init commit f4e725f248870a2de10449cc8f53de32e7840d45 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Nov 20 13:51:15 2008 +1000 dix: memset DeviceVelocityPtr to zero. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 7f818776b7a19bd6100596d327ecaa69be317bc6 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Nov 19 15:05:50 2008 +1000 dix: fix typos in comments, one formatting fix. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 037ec5a3c496b07f885a128828ef804b3aa8eee2 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 19 15:12:04 2008 +1000 gitignore: ignore .patch files commit ace38fafb062372dcd3d56378b5b8f86525c6241 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Nov 18 08:19:45 2008 +1000 xfree86: without CONFIG_HAL, Auto{Add|Enable}Devices and AEI is false. There's little chance that we'll get the input devices at runtime without HAL, we might as well force the server to add mouse/kbd devices automatically - just like in the olden days. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 1cd894173ee7fa3d1a78d330c12453ea53e7b908 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 19 13:44:26 2008 -0800 Always use server-<display>.xkm to avoid races when multiple servers start Previously each server starting ran xkbcomp with the output set to <keymapname>.xkm, read it, then deleted it - which led to races if two servers were starting at the same time with the same keymap. Sun bug #6773816 Xorg uses the same xkm output file for compiled keymap file <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6773816> commit 1e4412abc499b9938bbac8a3ecd82f7f12d448d9 Author: Rémi Cardona <remi.cardona@lri.fr> Date: Mon Nov 17 09:56:49 2008 +0100 drop unused HAVE_LIBDRM_2_2 Signed-off-by: Julien Cristau <jcristau@debian.org> commit c4ec71b405fcb5132d5089e3f8dd7b00c235265a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Nov 16 17:57:46 2008 -0800 XQuartz: pbproxy: nuke RCS Id, update header license/copyright (cherry picked from commit 477c6968a88429bb9c10222a5836bdc936d10ab1) commit 42f330cf9ef44aea7428a67d282dfb1a60196e55 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Nov 16 10:42:03 2008 -0800 XQuartz: pbproxy: Remove thread-main.m it got accidently added and isn't used. (cherry picked from commit cb6ffce68a2d10022fa92725d2d1837da4b3b89f) commit 19aac4274bbac55ce944acfaf3274a4403fe392e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 19 10:55:29 2008 -0800 mi: Push screen-saver/DPMS handling to after the EQ pop operation. This way we on't need to hold the mutex during the dixSaveScreens() call. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Tiago Vignatti <vignatti@c3sl.ufpr.br> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 56d1793c435abbaababab031860f1160f09fff06 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Nov 19 10:54:57 2008 -0800 mi: Only increment tail (push) when the event data is actually in the queue Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Tiago Vignatti <vignatti@c3sl.ufpr.br> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 570835b9a89187a36e08defbccc56051bb349b52 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 19 10:19:20 2008 -0800 Use bsd_pci stub routines on Solaris too, since we use pciaccess for real work Depends on commit 70e18a3b6b9d52169bca650f6cd4ef5d8ab40d95 to get definition of xf86InitVidMem on Solaris. commit 3932a848572f4eaf8b7f1d91d9b74aeafab069a2 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 18 14:21:01 2008 -0500 Xinput: use floats for ConstantDeceleration and AdaptiveDeceleration These values need not be constrained to integer values. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 08cd361234ed0410f67342f46ae01120c4fe3331 Author: Dave Airlie <airlied@redhat.com> Date: Mon Nov 17 10:28:48 2008 +1000 exa: avoid doing prepare/done without intervening copies in exaFillRegionTiled This does a precursor check to make sure the copies are required before entering the prepare/done code. commit 8f8a9c19ad58768b07461a3f4bccea98f7c4f958 Author: Dave Airlie <airlied@redhat.com> Date: Mon Nov 17 10:24:39 2008 +1000 EXA: avoid copy operations if no boxes in use Simple fix for now, I'm sure damage shouldn't be calling us with nbox = 0. commit 03f7a66a1ae3f522a49bcc783066d53d69c97262 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 15 19:45:49 2008 -0800 XQuartz: Don't use TIS on Tiger... (cherry picked from commit be8ac84c15e7e76c581b9e75cda74139394aa4c7) commit e8112784e8ef80a96ed54eca7e148b424001a38f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 15 19:52:34 2008 -0800 XQuartz: Integrated xpbproxy into the server. Added a configure option called --enable-standalone-xpbproxy which is useful for deveoping xpbproxy. The 'active' switch in preferences just disables the in-server xpbproxy (not this standalone). (cherry picked from commit 42944936326ef8732f622db9f75b79a92980550d) commit 24928b85dc996c8d0a052ddf383df25718ee5305 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Nov 15 13:28:53 2008 +0100 DRI2: Don't crash in DRI2ClipNotify when DRI2DrawablePtr is NULL. commit e5271c374715dd4e9a724ab3e5f77108d4ce8c23 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Nov 15 13:27:42 2008 +0100 Set libdrm flags correctly even when only DRI2 is enabled. commit bc4f804cd86497655f6765b0954e64dc959939e3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 14 15:13:22 2008 -0800 XQuartz: Actually add glcontextmodes.[hc] (cherry picked from commit 763195d338345e3637d112279bdbe002b6e7791a) commit aedafbea0e1c7bc780ebe7ae878f62525769aca8 Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 20:21:24 2008 -0700 fix compilation on systems that don't have XP_EVENT_SPACE_CHANGED defined (cherry picked from commit 6e833e41e2f3a84f7e5164b918737b3975517c12) commit b0789365719f48c0b477b4703f2072f932246b76 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 14 14:57:09 2008 -0800 XQuartz: Initial work on readding GLX to the 1.5 server (cherry picked from commit a186cab6ae82340770c13b37ff5df731ce2a0ceb) commit 1d7049f8fd3c0798250b9213149d3ce0b37ab77f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Nov 13 12:45:35 2008 -0800 Xquartz: Force sending mouse clicks to AppKit if we're over the menu bar (cherry picked from commit 7dff93ec1ac92aeaf3b70d5cfe787fa4a28c0dba) commit 3c124832642f1ec3228a57bea3d1eda68a188ff3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 20 10:37:17 2008 -0700 XQuartz: Made X11Application.m a little more tidy. (cherry picked from commit 3520386261b838196a8918e8bee16bdccbc9781d) commit e917806fc556c2054b2835c8f85770b554c78092 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Nov 14 10:56:21 2008 -0800 os/connection: TRANS_NOXAUTH bit comparison brainfart fix. https://bugs.freedesktop.org/show_bug.cgi?id=18524 commit 17bccff4ce905f46c074fd8ee7c6567b1371a0a1 Author: Fernando Carrijo <fcarrijo@yahoo.com.br> Date: Fri Nov 14 12:36:20 2008 -0500 [dix] Remove a duplicate statement. Signed-off-by: James Cloos <cloos@jhcloos.com> commit ba4e08244ed3923eecf26842dfc1df17c696e053 Merge: 81fd17f 5bad5d2 Author: Alex Deucher <alexdeucher@gmail.com> Date: Thu Nov 13 15:04:18 2008 -0500 Merge branch 'master' of git+ssh://agd5f@git.freedesktop.org/git/xorg/./xserver commit 81fd17f5f49cdd2c10d0bf3b7ddeb8b5953886a5 Author: Alex Deucher <alexdeucher@gmail.com> Date: Thu Nov 13 15:00:30 2008 -0500 Only add default modes if EDID supports continuous-frequency When an EDID is present, only add the default mode pool if the continuous-frequency bit is set in the EDID. Should fix bugs like 18512. commit c232f3d673fb00d7fceb8e82741349d64e5ac0ad Author: Adam Jackson <ajax@nwnk.net> Date: Thu Nov 13 14:58:21 2008 -0500 xf86TargetExact should try harder if there's only one monitor attached. If there's no preferred mode, but only one monitor, pick the biggest mode for its aspect ratio, assuming one exists. commit 5bad5d2abea2f51cbf53dc8dd016e90ccb086220 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Nov 13 11:32:40 2008 -0800 XQuartz: Fixed XBell() when not using system alert. (cherry picked from commit aa0e9ab1c7a226cdcb3c5e62be159355a290faf8) commit 0fca8588a238c91580b305c3671567e910150a02 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Nov 13 11:10:15 2008 -0800 XQuartz: Added more debugging to handoff spew (cherry picked from commit acefa7e3c8706ffedc052effd50b36ce10e72c22) commit 47d38218706564d1437dc3ff9d1bba3511db063c Author: George Staplin <gstaplin@apple.com> Date: Wed Nov 12 17:17:25 2008 -0700 XQuartz: GL: Handle the alpha differently when the alpha is equal to GLCAPS_COLOR_BUF_INVALID_VALUE. This prevents visuals with odd sizes. The machine I use didn't have this problem, but it shows up on some others. (cherry picked from commit ed181382ddeb77019577d39b9c06b1cd839e18e4) commit 6b501d7cc55f1d06966cdf3caf36bcfc6cf18939 Author: Alex Deucher <alexdeucher@gmail.com> Date: Thu Nov 13 13:57:30 2008 -0500 Add missing newline when printing edid info commit 33edd32702d963802e64d382124eabb9d0352fa8 Author: George Staplin <gstaplin@apple.com> Date: Sun Nov 9 18:35:10 2008 -0700 XQuartz: Disable 2 calls to miSetVisualTypesAndMasks that seem to be unnecessary, and possibly wrong (with regard to masks and bits per RGB). Use the settings queried from the system in xprScreen.c, rather than those 2 calls. The 2 calls increased the total number of visuals a great deal (when using GLXEXT), and not all of the visuals were usable with GLX. Some of the visuals aren't usable with GLX still, such as DirectColor, but that seems to be acceptable based on my understanding of the manual that states "a subset of visuals are made available for OpenGL rendering." (cherry picked from commit 373b8a5f32509722e06d8776109e6c3f06645ee0) commit 1523476afa6657c20eba112e3ee051d45e721164 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Nov 8 23:32:40 2008 -0800 XQuartz: CFBundleShortVersionString needs to conform to X.Y.Z as well... sigh (cherry picked from commit 54d20f6d33c347bcb37a0a8287c2d92fed2b9092) commit 1f301a0051d65296189248b2529616d9b33276b3 Author: George Staplin <gstaplin@apple.com> Date: Thu Nov 13 01:27:33 2008 -0700 XQuartz: Restore the logic of AppleWMDoReorderWindow to the same as the 1.4 branch. It was returning inverted values in comparison to the 1.4 branch. This resulted in the windows not drawing due to a deep path of: RootlessReorderWindow -> SCREENREC(pScreen)->imp->DoReorderWindow(winRec) - > xprDoReorderWindow -> AppleWMDoReorderWindow. (cherry picked from commit d1d398db762fe7d5720f9b5fafa2bbe8372fceac) commit f5841e96487234df5ead5f5c0fb3c587c418cb46 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Nov 11 22:50:35 2008 +1000 dix: don't store enter/leave and focus semaphores in a devPrivate. We need them for each window, every time a window is allocated. Storing them in a devPrivate is the wrong thing to do. This also removes the unused ENTER_LEAVE_SEMAPHORE_ISSET macro. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 26f701704b4e536cd91bd8a9f7d2194793471998 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 12 16:53:29 2008 +1000 dix: remove duplicate line in EnterLeaveEvent. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 8ff62ea5ba1bc331c886840b2b1e101cb4f2ebed Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Nov 12 15:19:09 2008 -0500 CopySubBuffer expects GL style coordinates. commit d91243beb63008fff2ce6affa7db091786e8c49a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Nov 7 08:39:38 2008 +1030 dix: formatting fix. commit dde09076c5c0c36a4a9321cd23a2c7922c4c755b Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Nov 5 12:52:03 2008 +1030 dix: remove superfluous variable devgrab grab == devgrab anyway, this is a leftover from the time when we had two different grabs per device (core and XI grab). Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit fc3e8bfb82323477b54181c6d546c90f53f1ebd8 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Nov 4 15:27:30 2008 +1030 mi: clean up mieqProcessInputEvents, copy all events before processing. Copy the EventRec's information into local variables before processing them, this should make it safer for upcoming threading and also makes it easier to read. Simplify the event allocation code from the abyss it was before. This also fixes a potential bug where a custom handler could scramble the event before the same -now scrambled- event was then passed through the master's custom event handler. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 31005efb1bb6be5a892ff905f754109dc3fa8fe6 Author: Fernando Carrijo <fcarrijo@yahoo.com.br> Date: Mon Nov 10 13:23:45 2008 -0500 input: Remove useless conditional. commit 24383056d0513cc588cee5cee78f1cba2c0fbe89 Author: James Cloos <cloos@jhcloos.com> Date: Sat Nov 8 13:04:20 2008 -0500 Don’t recommend fixing HAL if HAL support is disabled. As reported in http://bugs.freedesktop.org/show_bug.cgi?id=18438 the server suggests reconfiguring HAL if AllowEmptyInput is enabled and no input devices are known. Instead of that notice, if HAL is disabled at configure time, AllowEmptyInput is enabled in the config and no input devices are found report those facts and recommend disabling AllowEmptyInput. commit b3c7e62664457a3802ebc23785446051624a8c2f Author: James Cloos <cloos@jhcloos.com> Date: Sat Nov 8 12:18:13 2008 -0500 Remove some null statements. Remove several doubled statement-terminal semicolons. Reported by Fernando Carrijo. commit 21c116219cd5c6845a0955f2d88fdb5fab5c17cf Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Nov 8 01:25:14 2008 +0100 Fix typos which caused exaCompositeRects() to use an incorrect damage region. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18065 . Also, it can bail if either width or height of the bounding box is <= 0, not only if both of them are. commit 59f9fb4b8c031df69b3592a26b77e744ff4a556e Author: Luc Verhaegen <libv@skynet.be> Date: Fri Nov 7 19:11:11 2008 +0100 XAA PixmapOps: Sync before accessing unwrapped callbacks. When using any XAAPixmapOps, we call into unknown but freshly unwrapped callbacks (like fb ones). Unlike the XAA*Fallback calls, we did so without syncing first, exposing us to all kinds of synchronisation issues. I believe that the rendering errors appeared now because *PaintWindow vanished (e4d11e58), and we just use miPaintWindow instead. This takes a less direct route to the hw and ends up at PolyFillRectPixmap, which very often left drawing artifacts. We now sync accordingly, and no longer get the rendering artifacts i was methodically reproducing on radeonhd, radeon, unichrome... Also, in order to allow driver authors to remove extensive syncing or flushing to hide this issue, create XAA_VERSION_ defines, put them in xaa.h and bump the patchlevel. (novell bug #435791) commit 991c88b7542164194be73573e7644164416ea90c Author: Julien Cristau <jcristau@debian.org> Date: Fri Nov 7 17:36:38 2008 +0100 xfree86: xf86SetDepthBpp needs to respect the driver's depth24flags When setting the depth to 24, leave bpp unset so the logic to pick a supported value is used instead of ignoring the driver's preference and forcing 32 bpp. commit d3d6be4948fa19947fd3b03e6694247109cc0ffb Author: Julien Cristau <jcristau@debian.org> Date: Fri Nov 7 18:36:00 2008 +0100 mi: Fix infinite loop on regen when swrast_dri.so is missing The swrast DRI provider gets pushed on the glx provider stack at every server generation, so the stack turns into a circular list on regen. X.Org bug#18388 <https://bugs.freedesktop.org/show_bug.cgi?id=18388> commit f59352881f315a634f60c9aac885b2764b28b167 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Nov 6 14:41:55 2008 -0800 XQuartz: Make LS parse our version properly... it didn't like our CFBundleVersion (cherry picked from commit 980df1b4ff7d4dab9dc1462dc086542265b1fb1b) commit b4ca9dc2393ace2415163094b916f0d17ecba9ee Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 5 21:58:04 2008 -0800 When HAL returns a NULL property, print "(null)" instead of a NULL pointer They've promised to fix Solaris printf soon to check for NULL pointers instead of segfaulting, but that won't help people on existing releases. commit 13d06f5aaf6120c902a323649615c1ce3d1b5359 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Tue Nov 4 12:53:12 2008 -0700 XQuartz: GL: Add capability detection for depth buffers, and multisampling. GL/capabilities.c: Add handleDepthModes(), and extend handleRendererDescription() for the various depth and multisampling flags. Add initialization of the new config options to initConfig(). GL/capabilities.h: Add depth and multisample config members. GL/visualConfigs.c: Add depth and multisampling support to the visual config setup. (cherry picked from commit f527381eea6a8ae6cd791475b2060d21fcf8efb2) commit 34bb06b292dc8b07d8602941aab3e69a73811314 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Nov 3 19:52:48 2008 -0700 XQuartz: GL: Work around problems with really deep visuals. GL/capabilities.c: #if 0 (for now) any capabilities above 8 bits per channel, because they introduce drawing problems. GL/indirect.c: Comment out some visual setup code that shouldn't be running, and actually seemed to cause some problems. The current visualConfigs.c code seems to do a reasonable job of setting up visuals for XQuartz. GL/visualConfigs.c: Make use of the proper visual .class. Eliminate depth 0. It seems we really just want 24 for now, and 0 I think was a flaw in the original code. (cherry picked from commit 1e5f63f15e13a40a6e69a1505934d10d6990b6a2) commit 39e82a9b1250b23768136f3c397377a97f8b908c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Nov 2 15:52:22 2008 -0800 XQuartz: Replace deprecated API usage thanks to Robery Murphy (cherry picked from commit 71dd052412400362793f2f0c7c02bf4f4309738c) commit b4db46320a437ba8894cb8cfd4ee3abdcc894b01 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 20:18:27 2008 -0700 XQuartz: version string updated for 2.3.2_beta3 (cherry picked from commit 81bb4128570b44d779126a8dffcd3c5620747383) commit c9051b684b524549eab6d5b88ee3e195a6f6fbe8 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 5 18:25:57 2008 -0800 Use OsSignal in Popen/Pclose to avoid SysV signal() stupidity commit d63ea510138c8b6de66184c78cda39ed9981fc1f Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 5 14:52:29 2008 -0800 Non-Linux OS'es should default to kbd driver, not now-dead keyboard driver commit 446d9443cea31e493d05c939d0128a8116788468 Author: Adam Jackson <ajax@redhat.com> Date: Wed Nov 5 11:51:06 2008 -0500 linux: Drain the console fd of data when using evdev for keyboards Works around a silly bug in the kernel that causes wakeup storms after too many keypresses. Should fix the kernel bug too, but this at least keeps the idle wakeup count below 1000/sec. commit 6d21fbf00648307208146aca0837ec63ea490659 Author: Adam Jackson <ajax@redhat.com> Date: Wed Nov 5 11:39:46 2008 -0500 kdrive: Bye bye Xvesa commit 9a874a71a791c6110fd57b8a5c083f777a446d0f Author: Egbert Eich <eich@freedesktop.org> Date: Tue Nov 4 21:31:27 2008 +0100 DDX/RandR: When positioning outputs assume width/height = 0 if no modes exist. When a user specifies the position of an output for which no modes exist (for whatever reason) assume that the width and height of this output is 0. The result will be the same as if this output isn't taken into consideration at all and thus should be sane. It will prevent a segfault when trying to determine the width and height of a non-existent mode. commit a4d62bbf215894bad8e19d99f7330c637d3d49e3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Nov 4 11:27:53 2008 +0100 AIGLX: Reinstate call to driver texOffsetFinish hook. It was accidentally lost when factoring out __glXDRIdoReleaseTexImage, so this is a regression fix and should probably be backported to server-1.5-branch. commit 27f1ad466cd9662d638f4a8e59beafc32a8b2a8f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Nov 4 11:26:03 2008 +0100 AIGLX: Don't truncate offset returned by driver texOffsetStart hook on 32 bit. commit de1a8b68eb10c39a0d4a197107d68d7cc009edb2 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Nov 3 11:30:48 2008 +1030 xkb: extract the correct device in XkbFilterEvents. If the event is an XI event, we need to work on the correct device, not on the VCK. Adds XIGetDevice(event) function to extract the device from an event. commit d97239956667f8181f30271759573b75bf455fbb Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 16:40:41 2008 +1030 Purge device-based WindowAccess code. Really, this was a bad idea. It's not security, the UI features that would have been cool (e.g. clicking through windows) aren't implemented anyway, and there's nothing you can't achieve just by using plain XI anyway. Requires inputproto 1.9.99.6. commit cbc6f983959595aa21c9dd72fac6a7070a650ef7 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 14:36:48 2008 +1030 xkb: when faking mouse button events, fake them on the correct devices. When MouseKeys are activated, keyboard devices may generate fake mouse button events through XKB. Let's get then running through the appropriate paths, i.e. as XI events on the correct device. To make matters more fun, ProcessOtherEvents drops events if the DIX device state cannot be updated accordingly, i.e. all button events from keyboard devices. Hence we need to get the paired MD for the device in XkbDDXFakeDeviceButton, and post the event through the paired MD (usually the VCP). Removes now-unused ddxFakeBtn.c. Note: this patch only half-arsedly fixed button events, motion events are a more complicated matter. commit 4971315296cbf868dd738c1c0c1c504fcfe1b619 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Nov 3 17:47:36 2008 +1030 dix: clean up GetPointerEvents and GetKeyboardValuatorEvents. Split into several functions, remove some stale comments. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 6bb0e0a53656db6168a053fb51b242a8640c1461 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 24 16:22:09 2008 +1030 xnest: I'm sure xfree works fine, even if we're 64 bit. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 67b7e06c4fa4e8dafb64d9f3eb976836d0cc5889 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 25 19:39:48 2008 +0300 XKB: Remove pointless macros These weren't even being used, which isn't overly surprising, given that they were already in the struct. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit d9ff20e323ba9fb309629ac21946e85709625589 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Oct 23 16:48:15 2008 +1030 DIX: Remove unnecessary prototype We don't call XkbCopyKeymap from getevents.c anymore, so axe it. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 064ee458c7183eb91ef2e0f262b312ba1e3ad6e5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 9 15:54:56 2008 +0300 XKB: Tiny cleanups to _XkbLookupAnyDevice A couple of coding style cleanups, a warning fix via removing a now-unused label, and also put an else so we don't spuriously trip a condition that should admittedly never occur anyway. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 97c9e6a7139e07a0761be05034fae42fcd65ba36 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 28 17:10:28 2008 +0200 XKB: Fix thinko, causing warning (erroneously fixed in 5544c51447) newTypes is a local variable which always has an address. newTypesIn, on the other hand, might be sus. See also 5544c51447f551dfc6df64438873a7ce64743976. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit caf1e6a1c92a2e70de9159f93d6f5b48c202dd81 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Mar 18 10:05:00 2008 +0200 XKB: Move XKBrules.h to the server too Get our own local copy of this, so we don't have to define XKB_IN_SERVER anymore. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit f4036f6ace5f770f0fe6a6e3dc3749051a81325a Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 22 22:40:44 2008 +1030 Remove XEvIE It's unmaintained and has been broken for quite a while; MPX finally smashed it completely. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 8c3753a0b711b5708b61f64ab4010ca01608d679 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 22 22:29:54 2008 +1030 A bit of whitespace cleanup in include directives. It's #include <foo>, not # include <foo> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 889a8dc02bbd3926eaf16dce8f844dc58558e982 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 22 22:29:54 2008 +1030 Xi: XINPUT has been mandatory for ages Ditch all #ifdef XINPUT, since it's always built. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 4cf2f4172abc4bf848c1726e6dac535713e08f0b Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 3 12:50:28 2008 -0500 Add xf86MonitorIsHDMI() helper. commit a7951a4dad902edea76a5cd68f833f0e48ae804b Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Nov 3 10:00:54 2008 +0100 AIGLX: Allow 2D driver to prevent zero-copy texturing of a pixmap. The driver can return ~0ULL to achieve this, e.g. if the pixmap doesn't fit into offscreen storage or if its pixel format isn't supported by the 3D engine for texturing. See http://bugs.freedesktop.org/show_bug.cgi?id=17723 or http://bugs.freedesktop.org/show_bug.cgi?id=12385 . commit f8af66ddb21b4fb1ae5b4f7f852418ca7b0e7aec Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 20:03:34 2008 -0700 XQuartz: Add option to allow access to the menu in fullscreen mode (cherry picked from commit 637a9f4bd1ff2b55c870a08ead4940df0f9818e5) commit c5086badf0387d4d5af10882de90a1faa180550f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 18:58:57 2008 -0700 XQuartz: LP64 related casting fixes from Bob Murphy (cherry picked from commit ea71710aaa7166ab510abe70f2dc47942de0ead7) commit 20239a4deebccc9f86586ef6b8ef61311a6fa6a0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 18:58:25 2008 -0700 Rootless: LP64 related casting fixes from Bob Murphy (cherry picked from commit 40441c4e31167932721a79d7ca572caaa1d36e72) commit ecd55bc859eb5d7c639d5a6d531d9df524124247 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 15:10:34 2008 -0700 XQuartz: displayScreenBounds uses quartzEnableRootless rather than !quartzHasRoot (cherry picked from commit c883a78ef0c2e7e29437881db85d3815a89ab874) commit 4e762b8aa37b588e6cffcdd4a0152090190005e2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 14:39:54 2008 -0700 Rootless: Force initialization of static variable before use. (cherry picked from commit cece29317269385aa7a0d3047e6f90e6a17d01eb) commit 9f49f5172d10070ebd4a9e72ac3c5227c6f35853 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 13:00:01 2008 -0700 XQuartz: Silence pointer debug spam (cherry picked from commit 9ca099e928653b5a0fb745186e17bfcc3d74ccc0) commit 93298c7f8f73bdb9892da0e41d2c2a67719dc736 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 12:55:46 2008 -0700 XQuartz: Don't map the menu bar to the screen area. (cherry picked from commit 1115917ada127a1cd6a8b61efe7fd134e2ea85fd) commit 31907986a6d4dc726d8ce0071f5884ce6cfea33b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 31 12:37:32 2008 -0700 XQuartz: Fixed Xplugin thread safety issues, so rea-enable background window check (cherry picked from commit 5fc73b1141eca8b678e54412ca33afa31a76d088) commit 227d782a1bddfa1393cddd0c73c0288e18645c47 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Oct 30 13:44:55 2008 -0600 XQuartz: GL: Mark visuals that are slower than others, due to lack of acceleration. This is used in libGL to determine a preferred visual. glxinfo -v will also report "visualCaveat=Slow" for such visuals. (cherry picked from commit d5c17f585a240be9f9135975738e62951cde3353) commit 5287602a4161cd036e3125cda09ba750190a0b47 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Oct 29 17:20:11 2008 -0700 XQuartz: if 0 out a block to avoid thread-unsafe lockups (cherry picked from commit 60d7359a67900ad4601dbc73e07bcd8c803100a5) commit 93d7cd31c527afbf26f4e039afb6adbb6a60fab7 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Oct 29 17:18:05 2008 -0700 XQuartz: Purge the old XQUARTZ_EXPORTS_LAUNCHD_FD option (cherry picked from commit 490756c7fbe0792c4bd6ae434e7a48e0beffa5c7) commit 0a076b6a7f3c97ff712412eee32e013d3bfd7364 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 18:32:26 2008 +1030 xkb: remove unused label "out", clean up program flow. commit 971aef64416058665bc903fee39fea1619cd3727 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 17:05:40 2008 +1030 dix: FreeDeviceClass() and friends can be static. commit 3c3a47d0f5ce7fb9548a3eefee9e72488d3ac279 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 17:00:21 2008 +1030 include: remove unused declaration for RegisterPairingClient(). Matching functions got removed in 004876355b43fb4d3c2bc5653a7dc1bfd3f985ee. commit 7c5dec9f716962a6e67dba99418061cebe10e1d2 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 16:56:49 2008 +1030 dix: remove unused GuessFreePointerDevice(). Not used since the MD/SD hierarchy was introduced many moons ago. commit 12599af285a610fb429245798330f2317c75ac2c Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 16:50:28 2008 +1030 dix: NextFreePointerDevice() can be static. commit 5d0a945a030cd7626046e9f6c8d5c6bd170649d9 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 16:29:42 2008 +1030 dix: SwitchCorePointer is long gone, bury it. commit eb014021c2b3604fc67daebd6860b5dc959fabb6 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 16:27:58 2008 +1030 dix: PairDevices() can be static, remove from input. PairDevices() is only ever called in EnableDevice(). commit b6b26560d65d9468c89dd046396d9aeb14e1b227 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 16:23:34 2008 +1030 Move EXTENSION_BASE and EXTENSION_EVENT_BASE to misc.h. commit f781a752e642cfe7d08f841b332c3ae507315598 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 16:16:18 2008 +1030 Move MAX_DEVICES to misc.h, rename to MAXDEVICES for consistency. commit 245d1c162c7b13c98a9a28dc7ad441366d7e8006 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 31 11:50:47 2008 +1030 xkb: ProcXkbSetCompatMap should do dry-runs, then normal runs. Was doing only dry-runs, which kinda explains why changing the compat map didn't really have any effect. Fallout from e8c2a3d7c996cb41c4c44ba67acae5ff9438fc06. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 70e18a3b6b9d52169bca650f6cd4ef5d8ab40d95 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Oct 30 20:38:34 2008 -0700 Refactor Solaris mapping code to work with standard shared/vidmem.c Also merge sun_bios.c into sun_vid.c and upstream Solaris patch to keep aperture device open, to allow mappings to occur after X server has given up uid 0. commit 2809a56b4bc7f09f132c70dc39c6695495351c4d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 30 16:05:40 2008 -0400 xace: Fix an incorrect call to the RECEIVE_ACCESS hook. commit 0f2fd0577fe2740a32d3a2749e2c3582f891417c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 30 15:35:33 2008 -0400 xselinux: send more specific message types to libaudit. commit 4ce19b4477057a724b548e342d4c6da2b6721824 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 30 16:02:13 2008 +1030 xfree86: fix xf86ScaleAxis once again. Maybe one day I stop doing stupid patches like a3a7c12fcf8e4ac1418f9ea53f76091f309a721b. So, if X < low, reset to low, and _not_ to high. If X > high, reset to high, and _not_ to low. commit f12d7ad1647d12ccf92291ebc0607defe6a634a1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 28 12:38:05 2008 -0700 XQuartz: Pass along SIGINT and SIGTERM from the stub to X11.app (cherry picked from commit 183ca5d68b4f34e248749f304ce140de11bd451b) commit 273df54685768f74ed29926e88a63dc9f86744f1 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Oct 27 22:07:00 2008 -0600 XQuartz: pbproxy: Fix a bug that prevented nedit CLIPBOARD from being proxied. It seems that we were calling copy_completed: too soon. Now we return instead of falling through to the free_propdata, and copy_completed:. (cherry picked from commit 5797d5b662817a3369a74a673f4a7c995cde75cf) commit 313d87341aff2396645d2c315086d487c0073d27 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Oct 27 20:44:02 2008 -0600 XQuartz: pbproxy: Work around bugs in some apps that aren't ICCCM compliant. Eterm ends up setting the type of the property to TARGETS, instead of ATOM. That's why it wasn't working. (cherry picked from commit 9be5998ede7427f14dd9597e117b3d6b427ba4e5) commit 9007d3beea2e2d8b271f696d433cb30e32cda401 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Oct 27 16:34:24 2008 -0600 XQuartz: pbproxy: Add code to handle PICT conversion to PNG and JPEG. This may work, unfortunately I don't have test apps that fail. The way it works is by using an NSImage class initWithPasteboard: method, which we then get the TIFFRepresentation of, and convert to PNG or JPEG. The TIFFRepresentation uses NSTIFFCompressionNone; which should be lossless. (cherry picked from commit 8d048cfa956f4a0860250cc836a6748912b37ad8) commit b742da0b719198a42a086049771792af84f470ca Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Oct 26 13:17:49 2008 -0700 XQuartz: pbproxy: fixed blocking (cherry picked from commit bb330a1b1c480e89727fb75ff5aeb71f4afc5ee3) commit c885110aedc19e551de22a526397d77013c3dfcb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Oct 26 10:22:12 2008 -0700 Xquartz: pbproxy: Some debugging about unhandled mime types... this will spam up quick, but will be useful for a while... (cherry picked from commit 3647215310f5a52126661b9ec473dcfeed25b40f) commit e7c26964eef6732c9603b26b7396f95443c5ba8a Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Fri Oct 24 19:12:05 2008 -0600 XQuartz: GL: Fix several error handling mistakes in handleRenderDescriptions, that were leftover before the final code evolved. (cherry picked from commit fe35a3639081dc78ac6cc4123cde37770f6a39fd) commit 21ea9d82aab8ff0e0d1904d188f96f9cfb2b051d Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Fri Oct 24 18:11:46 2008 -0600 XQuartz: GL: Add feature detection of color sizes, and accum sizes. This gives us a *lot* more visuals, and they should be more accurate. Some of the visuals may have been wrong before. This may enable more OpenGL programs to behave correctly. I also suspect libGL needs a little work to handle some of these correctly. (cherry picked from commit 98a084ce9c455260ecdb5f8eecb67f33dbb53b69) commit c264826da96ad1859dd112b17eb8aa9e5278478f Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 16 11:22:29 2008 +1030 xfree86: If AEI is on, disable "kbd" and "mouse" devices. This consists of two parts: In the implicit server layout, ignore those drivers when looking for a core device. And after finishing the server layout, run through the list of devices and remove any that use mouse or kbd. AEI is mutually exclusive with the kbd and mouse drivers, so pick either - or. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 6c451859552e1fc78f6589617482f9ff96d7ed8a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Oct 20 12:19:55 2008 +1030 config: don't add duplicate devices through HAL. If HAL is restarted, the device list is sent to the server again, leading first to duplicate devices (and thus duplicate events), and later to a FatalError "Too many input devices." dev->config_info contains the UDI for the device. If the UDI of a new devices is equal to one we already have in the device list, just ignore it. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 102c4dac7c521941f52652152b1660cd7f559d56 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 13:17:31 2008 +0100 x86emu: fix sparse warnings ops2.c:113:18: warning: Using plain integer as NULL pointer ops2.c:207:18: warning: Using plain integer as NULL pointer commit ffaaa1a198a77eb6800c08d4613ee1cc0b068ba0 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 13:13:21 2008 +0100 xfree86: fix compiler warnings in DoModalias() The precedence of == is higher than that of &, so that code was probably buggy. xf86Init.c: In function 'DoModalias': xf86Init.c:300: warning: suggest parentheses around comparison in operand of & xf86Init.c:304: warning: suggest parentheses around comparison in operand of & xf86Init.c:308: warning: suggest parentheses around comparison in operand of & commit 66fd05acd6118102aaaebc230d5c03e0758c6089 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 13:11:41 2008 +0100 xfree86: Silence compiler warnings about function prototypes xf86Init.c:136: warning: function declaration isn't a prototype xf86Init.c:243: warning: function declaration isn't a prototype xf86Init.c:249: warning: function declaration isn't a prototype commit 4b96ba8ddf36f84d4b8c0f2964535bd90477a742 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:56:35 2008 +0100 Nuke unused miBankNewSerialNumber commit e85d5d707d51d6a1558dfcf0ebd50183b84be39d Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:55:50 2008 +0100 Ansify declaration of FontToXError() commit 30a7a06a9e91a91b8517f67897831c1407713e57 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:38:44 2008 +0100 Nuke prototype for nonexistent function miDoInitVisuals was removed in commit 94825ad3c72a1c3f6a61199c302841f63241cf87, but its prototype was left. commit 5244690a5e0285b6243ee1f28ae6c8287a32b73d Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:37:11 2008 +0100 Add prototypes for strlcpy/strlcat commit eadf90aa65d1ea63ddcd74e60e66a79ad567c7e8 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:20:33 2008 +0100 xaa: Fix compiler warning (implicit declaration) xaaInit.c: In function 'XAAInit': xaaInit.c:201: warning: implicit declaration of function 'miInitializeCompositeWrapper' xaaInit.c:201: warning: nested extern declaration of 'miInitializeCompositeWrapper' commit aee514cfb5e5a59b7770699765ccdad8fe42f904 Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:16:05 2008 +0100 xfree86: Fix compiler warnings (implicit declarations) Add missing includes to fix the following warnings: xf86DGA.c: In function 'DGAProcessKeyboardEvent': xf86DGA.c:1050: warning: implicit declaration of function 'UpdateDeviceState' xf86DGA.c:1050: warning: nested extern declaration of 'UpdateDeviceState' xf86Xinput.c: In function 'xf86ActivateDevice': xf86Xinput.c:303: warning: implicit declaration of function 'AssignTypeAndName' xf86Xinput.c:303: warning: nested extern declaration of 'AssignTypeAndName' xf86Xinput.c:311: warning: implicit declaration of function 'DeviceIsPointerType' xf86Xinput.c:311: warning: nested extern declaration of 'DeviceIsPointerType' xf86Xinput.c:324: warning: implicit declaration of function 'XkbSetExtension' xf86Xinput.c:324: warning: nested extern declaration of 'XkbSetExtension' commit add946daed531e29935593fb2e7ee70286185baf Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:14:40 2008 +0100 Nuke unused variables commit f2bda61c03f64133ef68dd1557b26ae7dc5beb0e Author: Julien Cristau <jcristau@debian.org> Date: Sun Oct 26 11:05:13 2008 +0100 Xext: Fix compiler warnings Make GEClientGone static and include registry.h, to fix the following warnings: geext.c:225: warning: no previous prototype for 'GEClientGone' geext.c: In function 'GEExtensionInit': geext.c:280: warning: implicit declaration of function 'RegisterResourceName' geext.c:280: warning: nested extern declaration of 'RegisterResourceName' commit 24e863b0eb6ff11010a14cfd252a39df87a09d0e Author: Bernhard R. Link <brlink@debian.org> Date: Sun Oct 26 00:19:34 2008 +0200 Bug#16501: autodetection of sbus graphic cards Add automatic detection of the graphic driver to load for sbus devices. This allows xorg to work on those devices without a "Device" section. Debian bug#483942. Signed-off-by: Julien Cristau <jcristau@debian.org> commit fd97ff1bdd30c358525068a4c833f681e00719a2 Author: Julien Cristau <jcristau@debian.org> Date: Sat Oct 25 22:54:15 2008 +0200 Bug#5851: Document the "Log" option in xorg.conf(5) commit 80b6768536fa439bfc5ce948bc8845a6f4af857b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 23 17:32:32 2008 -0700 XQuartz: Do check_xinitrc() later to avoid possible deadlock. (cherry picked from commit af95174a088dc787d124ec548b1005f5b67c9e8d) commit d837d4e2af35a83c7932e4d0422097ebd1f6ba2c Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Oct 23 17:56:46 2008 -0600 XQuartz: pbproxy: pbproxy.h had invalid macro usage with 2 #else statements, so it wasn't building. Fix the build. (cherry picked from commit 6bcbb9ba85d95d7df63811a482abc39c4d595366) commit 6a2693b2f9cfdec6f30e2ca4c4176f986f97249e Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Oct 23 17:40:23 2008 -0600 XQuartz: Remove the enable_stereo default. We now use feature detection to enable stereo visuals. We need to revisit the GL/indirect.c changes. I think indirect.c should be using the same feature detection and GLX visual config code. The indirect changes will require testing... (cherry picked from commit 49b7a7c6f20ca85d4d624444eb83db2f91344591) commit b015a021b28623b7b734833dc9b8269c41db4e8a Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Oct 21 20:30:35 2008 -0700 Allow non-gcc compilers to build xf86Xinput.c commit b7cc6ca22a4ff7a94abee6962a07fdd0b563d26a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 23 16:33:11 2008 -0700 miext/rootless: Silence some warnings by using proper C prototypes. (cherry picked from commit 050e46e09efcc7e6f090fa4a749e9076c972b760) commit b397cc727787a854417b11b482cce4807fc8ab58 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Oct 23 16:19:58 2008 -0600 miext/rootless: Fix the usage of DeleteProperty so that this builds again. (cherry picked from commit 3de250e28a9a86bcae4464a15c2025805877ce1e) commit 28d4f71193d2be26d1dcae724067539ac9db1123 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 23 15:01:03 2008 -0700 XQuartz: pbproxy: Fix compilation on case-sensitive file systems... (cherry picked from commit 6622efca216663c99d112c7a226bde691d1f3215) commit 40f9b6bf0dc62098680235a958e0733770902cca Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 23 17:33:52 2008 -0400 Argh, macros. commit 8b3c278fe7502f9343355f09213837622b0d9ca0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 23 11:39:04 2008 -0700 Rootless: Properly typed expose_1 (cherry picked from commit 78e874fe17174ac8f61586573edaf7f16ece7b21) commit 3e999d35c26b0ffb894c257a3057d44b949744bd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 23 11:37:13 2008 -0700 XQuartz: Honor the Spaces preference for "When switching to an application, switch to a space with open windows for the application" (cherry picked from commit bf561a06b2bf60395d26026ac7627d0cb254bc07) commit 75067d12e4f4daa080dfb0209a9abf9c5654271f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 21 19:36:48 2008 -0700 XQuartz: Added missing semicolons to Localizable.strings (cherry picked from commit e9fe3f36d9529f00daeefa1379cdd6f01a88f410) commit a003932dccc438c4500d383982cee2376e808bd5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 21 11:23:42 2008 -0700 XQuartz: Default dpi to 96 instead of 75 (cherry picked from commit 08a5a333d7fea68146cd9cf50682b811378ab3ce) commit 2d764e21f278ea26bae135db6dae07b94651951c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 21 11:19:06 2008 -0700 XQuartz: pbproxy: SIGHUP reloads preferences. (cherry picked from commit cbc0935ef74ebd76ed3db16d6ab86043eeed42a3) commit 0b695262176e96f508921905ee7f9cc086c7daf0 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 23 15:01:58 2008 -0400 Change some #define foo() -> static void foo() commit aab73d719a8de6b830e47c7f47860b7990ea8d03 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 23 13:20:59 2008 -0400 Fix previous cherry pick for API changes commit 8767fc8d47276c7489ae50dd556a446a462776ea Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 4 12:11:14 2008 -0700 Wrap AddTraps in exa and damage. This fine (and unused) function wasn't ever wrapped which made it not work under exa. (cherry picked from commit 06e7e1d0486e8c516a9b3219a2c86026f88825fc) commit 4c926dbac65ceb699b91bb0d3fd0005a5854572d Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 23 22:07:37 2008 +1030 dix: fix two more endian issues, correct initial "enabled" value. #18111 EnableDevice and DisableDevice both change the property too. And enabled must be set to FALSE in AddInputDevice, the device is not enabled yet. X.Org Bug 18111 <https://bugs.freedesktop.org/show_bug.cgi?id=18111> commit 084ae9e38812f19751a086eea7ce555761ae5a17 Author: Jerome Glisse <glisse@freedesktop.org> Date: Thu Oct 23 11:28:53 2008 +0200 dri2: fail at context creation if driver fail to create it's context commit ff60e592f003d8bc45789a1a14e86be22f5242b2 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 23 09:19:41 2008 +1030 dix: don't allow VCP/VCK be disabled through properties. commit 98f01c2abe4771d76febf8fe70111b2bddfab776 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 23 09:13:41 2008 +1030 dix: fix endianess issue in AddInputDevice. #18111 dev->enabled is a Bool. Bool is two bytes. BOOL on the other hand is a protocol type and always 1 byte. So copy the value into the one-byte type before passing it into XIChangeDeviceProperty. Found by Michel Dänzer. X.Org Bug 18111 <http://bugs.freedesktop.org/show_bug.cgi?id=18111> commit f6cbe0326c57e3c9897f17baef78199b06537c44 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Oct 22 18:16:12 2008 +1030 dix: init remaining three xkb fields to zero in a new client. commit 0b56b44addc323a00eb7cd86240cb0dd4275bcf8 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Oct 20 17:06:40 2008 +1030 xfree86: AllowEmptyInput is true by default - update the xf86Info defaults. Also set AutoAddDevices and AutoEnableDevices to their defaults. And in doing so, switch the rest of the defaults over to named intializers. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit d72cd753b99fae147ef4c189700fc697f1ea7fb0 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Oct 21 22:32:57 2008 +0200 Close well known connections in ServerAbort() commit 81e197b2a5457bb9f7ed72f82c2d33fd8dbfc202 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 21 16:00:32 2008 -0400 Bug #18159: Spell "anisotropic" correctly commit 3891dd892449fcdb7a514e3c5e7e763ba7e74003 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 21 13:10:44 2008 -0400 exa: Add exaDrawableIsOffscreen() to the driver API. commit c837d182c4674c01296bb7efd7d834d9dfd55f83 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 21 09:11:59 2008 -0700 XQuartz: Only send mouse events while in the background if we're over a visible window. This "breaks" xeyes but gets rid of annoying tooltips. (cherry picked from commit 10090a132a0110fe24c8c886d9f53e6e947f8038) commit 2a9613980f93959eedf9396735785d4c50546e2d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 21 09:07:08 2008 -0700 XQuartz: More fullscreen fixes Start in rooted mode when enabled Make the hotkey cmd-alt-a behave (cherry picked from commit 22a54e46176c9cbdfaaa59ef33a6ae6a9c4969ef) commit e4ea1494debda4d3da03864c2640921fe0430694 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Oct 20 12:23:04 2008 -0700 XQuartz: Cleaned up keyboard init and map reload. (cherry picked from commit f78c9fc06cac2cc6ddfd6e9ba435dd26a57d1f51) commit ebb2e1449cfb382a806e04c52d42240670717069 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Oct 20 09:46:34 2008 -0700 XQuartz: Fixed follow-keyboard-layout ≈ (cherry picked from commit a9f9fbf512c9fd5a773fce402182486edc71d5ab) commit f67cd31d2cf1b8ad850bd21dbed5a975d77b4c54 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 21 09:29:37 2008 -0700 XQuartz: More progress towards fullscreen... (cherry picked from commit 628cae86b4ad02c49d20df1e1afdcb7abcabb649) (cherry picked from commit b47b7ab6d6d0a7f6cbf678a5755124d6b7516d3e) commit d434ed400986653771bbd60c224a2275bd6147ef Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 17 09:25:26 2008 -0700 XQuartz: Fixed missing key-equiv for Hide-Others. (cherry picked from commit 2c4b0f9615b646712609ebef3c0851c9a22e781b) commit 3695f62d072e7864fdcee385c8b5ca40f2018101 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Oct 16 22:36:00 2008 -0700 XQuartz: Require applewmproto-1.1.1 (cherry picked from commit ed235e3406e603a8a92c4b72f9f9018bae72ad65) commit f935c11398b93860461672e88814026d75b71689 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Oct 16 13:09:21 2008 -0600 XQuartz: pbproxy: Fix 2 bugs with the preferences. Add dump_prefs() for instrospection. Make prefs_get_bool a little more clear. In get_property don't assume that the Mac realloc(NULL, 0); returns non-NULL. We shouldn't depend on implementation-defined behavior too much. Add more commentary in various spots. Add TARGETS in the TARGETS response. I don't know why some X11 apps do this, but it could be something that some weird toolkit/app tests for. In reload_preferences add preferences synchronization, so that xpbproxy reloads the preferences, and picks up any changes. Fix a typo/misspelling of the sync_clipboard_to_pasteboard preference. (cherry picked from commit 165cbbb90c793d9335ea76f0274b1f60ad295903) commit 4d978af5c71430f0043b1272f8dc6344b8f03f12 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Oct 15 21:26:58 2008 -0700 XQuartz: Fixed window levels. (cherry picked from commit ef4d37c73f31048dd74efee2c63fa08b92608f87) commit 58eacf0b7beb8c6f1971570ede0bfd3976a84665 Author: Rémi Cardona <remi@gentoo.org> Date: Tue Oct 21 10:07:24 2008 -0400 Force LC_ALL=C when building xf86DefModeSet.c Fixes build in not-quite-latin locales. commit 2188582e5ea90edb432a2f421d0a267439ba08f9 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Oct 20 09:55:24 2008 -0400 EXA: Avoid excessive syncing in PutImage commit 8d0cb507ae568c8da92f10ff1188d797bcaa3d1a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 17 09:59:29 2008 +1030 dmx: avoid hilarious #define Xcalloc xcalloc game. commit 8a23707b866c11807e01056db97afec56e9b19c8 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Oct 17 09:15:39 2008 +1030 dmx: change remainder of manual EQ allocation to GetEventList(). commit 8de26770a41ec87c46eed2eddfde6f867d71fe1f Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Thu Oct 16 14:28:14 2008 -0400 RANDR: Fix output property event delivery. commit d936a4235c9625bd41569cef3452dd086284e0d7 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Sun Oct 12 21:58:30 2008 +1030 xfree86: if AllowEmptyInput is true, enable RAW mode on the console. Usually, the console is set to RAW in the kbd driver. If we hotplug all input devices (i.e. the evdev driver for keyboards) and the console is left as-is. As a result, the evdev driver must put an EVIOCGRAB on the device to avoid characters leaking onto the console. This again breaks many things, amongst them lirc, in-kernel mouse button emulation and HAL. This patch sets the console to RAW if AllowEmptyInput is on. Use-cases: 1. AEI is off 1.1. Only kbd driver is used - behaviour as-is. 1.2. kbd and evdev driver is used: if evdev does not grab the device, duplicate events are generated. 2. AEI is on 2.1. Only evdev driver is used - behaviour as-is, but evdev does not need to grab the device anymore. 2.2. evdev and kbd are used: duplicate key events are generated if evdev does not grab the device. 1.2 is a marginal use-case that can be fixed by adding a "grab" option to the evdev driver (update of xorg.conf is needed). 2.2 is an issue. If we have no ServerLayout section, AEI is on, but devices specified in the xorg.conf are still added [1], resulting in duplicate events. This is a common configuration and needs sorting out. [1] 2eaed4a10fe5bf727579bca4ab8d4a47c8763a7d Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit 84ef8ed6fbefd8d6c0aaa3c862879f9804299bd8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Oct 15 14:11:18 2008 -0700 XQuartz: implemented primary-on-grab and fixed clipboard-to-pasteboard (cherry picked from commit bcb83eea729a01026d99d1cfc2b77385b5b275fd) commit 0195d318465d5a6a9039091bcb252202471df5a4 Author: Luc Verhaegen <libv@skynet.be> Date: Wed Oct 15 21:46:27 2008 +0200 GLX: fix build when dri2 _is_ available. Caught by Julien Cristau. commit 398cdf959afadfa964aece13cc9d89b2dd589930 Author: Luc Verhaegen <libv@skynet.be> Date: Wed Oct 15 18:24:10 2008 +0200 GLX: fix build when dri2 is not available. commit 2e60ebbd254290e19492b97c960d9678513c94bf Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 15 14:10:51 2008 +0100 XFree86: Simplify DontZap/-retro interaction How hard could it possibly be, right? commit 66a87517bd80b21e107df9d57968d81a92f91fd5 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed Oct 15 12:00:16 2008 +0100 re-enable DRI2 commit ced6690284fd334f225bbc94685c114ad3ab96d8 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Oct 7 13:49:28 2008 -0400 dri2: Update to latest protocol draft. Mainly rename SwapBuffers to CopyRegion, which adds the xfixes region argument and the bitmask argument to let us extend it in the future. commit 87a016ae00feac3fbaa7e7a518076a3852d49554 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Oct 15 00:02:13 2008 +0200 exa: restore {x,y}{Src,Dst} to their original values when !done commit b677bff97b62c3931df853bae25ab485892ae173 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 14 14:30:19 2008 -0400 int10: Degrade the checksum warning to X_INFO. I've seen about one case in three years where this has actually been correlated with the real cause of failure, and we've trained people to freak out about X_WARNING, so let's be less alarmist. commit bd9c6b3a4d726a3f83ac6d8cf7211eddbc28f25a Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 14 14:04:01 2008 -0400 EDID: Catch even more cases of encoding aspect as size. Very cute, Samsung, not only do you claim to be 16cm by 9cm in the global size record, you also claim to be 160mm by 90mm in the detailed timings. Grrr. commit ad677238bc96a8578113bbe76d605d7a87aca44c Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 14 13:00:50 2008 -0400 Add backtrace definitions to dix-config.h.in commit 8e368cf5b964f1d29fda0a463f9510457619b14d Author: Nathaniel McCallum <nathaniel@natemccallum.com> Date: Tue Oct 14 09:50:29 2008 -0400 Xorg: add -modalias option This scans the installed video drivers and prints a Linux-style modalias listing of the devices each driver claims to support. commit 3eb52de7f28b0050582f9ac4c28bc894d3f06f4b Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 14 09:45:19 2008 -0400 kdrive: Hardcode a different wrong value for number of mouse buttons This should really come from the input driver directly, but, kdrive. commit f3f6ea89aa9e0ffe9e37bc059e5e6bf75be4ee9f Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Oct 8 14:12:21 2008 +1030 Xi: check all handlers before applying property changes. The current code exposes to inconsistent updates, i.e. if handler N succeeds but handler N+1 fails in setting the property, an error is returned to the client although parts of the server now behave as if the property change succeeded. This patch adds a "checkonly" parameter to the SetProperty handler. The handlers are then called twice, once with checkonly set to TRUE. On the checkonly run, handlers _MUST_ return error codes if the property cannot be applied. Handlers are not permitted to actually apply the changes. On the second run, handlers are permitted to apply property changes. Errors codes returned on the second run are ignored. commit ad67e3f063aa79247270f29e989bbfe5f62c9ed7 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Sun Oct 12 10:19:36 2008 +1030 dix: remove duplicate code in ReleaseActiveGrabs Spotted by Colin Harrison. commit 3fc4f40b6c6cb416c9dc4bdb35c91b4f32c03ccc Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun Oct 12 16:08:26 2008 -0700 Restore xf86{Enable, Disable}GeneralHandler. These were useful as part of the generic handler ABI, and are used by the NVIDIA driver. This reverts part of commit 50081d2dfb79878cb931a15c265f0d60698dfd39. commit 2217d22a76cdb2460f9683a6bf74c7248612889d Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun Oct 12 16:07:24 2008 -0700 Revert "xfree86: xf86{Enable, Disable}InputHandler can be static." These were potentially useful as part of the input handler ABI, even if nobody currently uses them. This reverts commit 278c11f01fbc6d6bd91c5a7127928c9ef5d29fca. commit 5b336585a4cdf11d20831a9536ad581e959ea7f1 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Oct 10 23:23:02 2008 +0200 dri: don't set the dixPrivate key to NULL, as this is a staticly set variable. - This breaks on the 2nd server generation. - No other subsystem seems to NULL their key. - This should fix bug 17982. commit b736f477f5324f79af30fc0f941ba0714a34ccda Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 10 16:33:24 2008 -0400 mieq: Backtrace when the queue overflows. Since we're probably stuck down in a driver somewhere, let's at least try to point out where. This will need to be rethought when the input thread work lands though. commit 94ed0ba1b5043ad9fc33b42756af447d5ab15bbd Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 10 15:53:48 2008 -0400 Move xorg_backtrace() up to the OS level so we can call it from DIX. commit f650c1aeb06e957626bb0a74eddbb133f59dbecb Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 10 14:07:28 2008 -0400 Revert "Don't leak EDID_block" This reverts commit 05cdef18ca668ffc86b71033f71cfbd262cdd994. http://lists.freedesktop.org/archives/xorg/2008-October/039305.html commit 0660dd9d7009147c395b9ea904539f76f55b9a7f Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 10 13:41:50 2008 -0400 EDID: Catch monitors that encode aspect ratio for physical size. This is not legal in either EDID 1.3 or 1.4, but hey, when did a little thing like legality stop anyone. commit 956a4ba40b28251ab2d88b5d5b0796e01afd2bdd Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Oct 10 00:28:34 2008 +0200 pixmap: Add some notes to devKind and devPrivate. commit 4808bdec45775342eb9a6352b41e4919e1a69279 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 9 16:23:24 2008 +1030 Xi: don't memcpy the KeyClassRec from SD to MD. #16167 Most of its component get copied during CopyKeyClass anyway. The ones that aren't: postdown - never changed for virtual devices anyway. down - shouldn't change that without sending events. memcpy'ing the struct also copied mapWidth, which means we didn't realloc during SetKeySymsMap lateron, overwriting the memory assigned to us. X.Org Bug 16167 <http://bugs.freedesktop.org/show_bug.cgi?id=16167> commit 18cdd733ad3dd36fa0a23dfbf18c7d99b86c0276 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 9 17:26:00 2008 +1030 kdrive: fix dixflags so they're always defined before enqueuing events #17734 If absolute events were posted, dixflags got set conditionally on whether the valuators are different from the last posted set of values. If dixflags are undefined however, the DIX interprets them as relative valuators. Fix this by making sure defining dixflags is always defined. X.Org Bug 17724 <http://bugs.freedesktop.org/show_bug.cgi?id=17734> commit d58f2c30c64e8b2d8179dac06e0a54be06099da6 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 9 16:50:54 2008 +1030 kdrive: lastx/y needs to be set to the event coordinates #17728 X.Org Bug 17728 <http://bugs.freedesktop.org/show_bug.cgi?id=17728> commit decec14219bcd992ec426e202ff3c8681b520b74 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 9 15:10:21 2008 +1030 dix: silence "unused variable" compiler warning. commit 0b4b683f3eeec43536e73be302a4c396fe4d9894 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Oct 7 18:44:42 2008 +1030 xfree86: export NewInputDeviceRequest/DeleteInputDeviceRequest NIDR should be used to create a new SD from e.g. within a driver. DIDR should be used to remove a device from the server. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 5e213fe1022bf96747834a3ac227929b23136ee6 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 9 11:29:11 2008 +1030 xfree86: cache dev->isMaster before freeing the device. commit 05cdef18ca668ffc86b71033f71cfbd262cdd994 Author: Zhenyu Wang <zhenyu.z.wang@intel.com> Date: Fri Oct 10 13:45:51 2008 +0800 Don't leak EDID_block commit 2d9da7a5f384d5f38b2be79b1ea0df5a3deb52d1 Author: Luc Verhaegen <libv@skynet.be> Date: Thu Oct 9 22:22:53 2008 +0200 DGA: Track client state even when using old style DGA. This fixes the issue that a badly killed DGA will keep on hogging mode/framebuffer/mouse/keyboard. commit 322335d5b5b6f155f56fe3c1cbe372f13dc20932 Author: Luc Verhaegen <libv@skynet.be> Date: Thu Oct 9 22:21:05 2008 +0200 DGA: Mash together xf86dga.c and xf86dga2.c. This in preparation for an upcoming client state tracking fix. commit d13c3cbd43bc5e6b459c7df822292cf02ad2c9c4 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Oct 8 18:39:41 2008 -0700 XQuartz: Some motion made towards supporting fullscreen. (cherry picked from commit 99be3d68b64059caada739a373e5e01844c776e0) commit dc166bf6423f4243ea05f17340ff9ff99ecad74b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 7 11:39:08 2008 -0700 XQuartz: Fixed EXTRA_DIST for new GL files. (cherry picked from commit a11c9052030b44045f037050a5825256b539ed50) commit 803327929445256e159c10894e6305fbaa389982 Author: George Staplin <georgestaplin@george-staplins-mac-pro.local> Date: Tue Oct 7 12:12:38 2008 -0600 XQuartz: GL: setVisualConfigs() copied the behavior of indirect.c which is wrong, with regard to the handling of xcalloc failure. Use ErrorF for an error message after an xcalloc failure, and return instead of falling through to GlxSetVisualConfigs, or abort()ing at the test branch. (cherry picked from commit 1056700971fd5c034396ed6dbea15e092f0c6332) commit f1fec6f323b27a0165325d8fcf6af7ae163bde14 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Oct 8 18:45:04 2008 -0700 XQuartz: Call setVisualConfigs in InitOutput, and only when GLXEXT is defined. (cherry picked from commit 97173d4eda142c73bb975cc05225b791778f85af) commit 52accec7dbc613a521e40449b8bb5f0c92ddb105 Author: George Staplin <georgestaplin@george-staplins-mac-pro.local> Date: Tue Oct 7 11:31:48 2008 -0600 XQuartz: GL: Add the proper license information to the new files, and add more commentary to setVisualConfigs(). (cherry picked from commit 190a3d5e5de9915931928fb8e6da88bb9644cda4) commit 63abdf61151cc90f769ed1708ee19b6c434c27c9 Author: George Staplin <georgestaplin@george-staplins-mac-pro.local> Date: Mon Oct 6 18:05:12 2008 -0600 XQuartz: GL: Add the new C code to the Makefile.am. Commit the darwin.c changes I missed in the last commit, for calling setVisualConfigs(). (cherry picked from commit eb3c014e1710bf0b93bda10ddb9b795cd150d02d) commit a8f5d422c9c0a39f55e80bbd180439b6ec3a805c Author: George Staplin <georgestaplin@george-staplins-mac-pro.local> Date: Mon Oct 6 18:01:23 2008 -0600 XQuartz: GL: Provide code for getting the capabilities of the underlying system's CGL. Add a setVisualConfigs that is called before the fbScreenInit, to setup the __GLXvisualConfigs. (cherry picked from commit fc86f9e4482043eca76d9d7a96e166be1aabf674) commit 2998e48be343ab2a11d6d328fc961ab5b8eb9292 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Oct 4 21:25:50 2008 -0700 Xquartz: Fix parallel builds (cherry picked from commit 1fe7298a3b9a2ed82c612292f9e547cf78f99ae5) commit 7aa535708f1f33173bf05abc17b75e0841ffc385 Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 16:25:59 2008 -0400 Fix more xcalloc stupidity. Did I mention the hate? Pretty sure I mentioned the hate. commit 4fe80aa14a24df6d0611c47fc5654c3c4f56fdb1 Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 16:22:35 2008 -0400 I hate you xlib. Please die in a fire. commit 2c5332872f808e7a646a63ae7ec63a2b80f83ee7 Author: Adam Jackson <ajax@redhat.com> Date: Wed Oct 8 13:39:49 2008 -0400 s/kdDontZap/kdAllowZap/ commit 1feb69eb63e6739ff5db255ad529e84adf941a10 Author: Luc Verhaegen <libv@skynet.be> Date: Wed Oct 8 14:55:29 2008 +0200 DGA: Fix ProcXF86DGASetViewPort for missing support in driver. Fixes a segfault when trying to activate a DGA mode without checking whether DGA modesetting is at all possible. commit d1bb5e3b47ab71aa2f18f69daaf2a4c5ce06d800 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Oct 8 03:19:45 2008 -0300 mi: functions here are carrying 'time' without need. commit 4964a9ca6c3f26376469b6d8217815a47231f0a9 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Oct 8 03:06:32 2008 -0300 mi: remove deprecated and unused functions. miPointerDeltaCursor, miPointerGetMotionBufferSize and miPointerSetNewScreen. commit adf3e296e2b00164fb22e89ad4f44acbd2e3deae Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Oct 8 02:12:49 2008 -0300 Remove unused declarations. AvailableClientInput (LBX debris) and xf86XinputFinalizeInit. commit bca9fa2efe97d2816a2e9412cdff08a0145c8f96 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Oct 8 01:38:27 2008 -0300 Everyone knows that the loader is present. Silence it. commit 56c615368c5a8e7acb0398434c2c68578626aa38 Author: Zhenyu Wang <zhenyu.z.wang@intel.com> Date: Wed Oct 8 13:33:55 2008 +0800 Check nextEnabledOutput()'s return in bestModeForAspect() In case no enabled outputs, we will reference wrong index of output array. commit 278c11f01fbc6d6bd91c5a7127928c9ef5d29fca Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Oct 8 01:18:49 2008 -0300 xfree86: xf86{Enable, Disable}InputHandler can be static. commit 50081d2dfb79878cb931a15c265f0d60698dfd39 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Oct 8 01:11:38 2008 -0300 xfree86: remove xf86{Enable, Disable}GeneralHandler and others unused. commit 54294e15ecf4a8ec0fd9fa8b6ed1a1b2d912ec7e Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Oct 8 00:43:22 2008 -0300 xfree86: fix wrong function name message errors. commit 57dbb90f198116dcaf17c8111a7f80644d7ebe7f Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 7 20:36:45 2008 -0400 Document zap/-retro interaction more. commit 617933e8c259ad12388c0dd13421846a873975e3 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 8 02:45:59 2008 +0300 XFree86: Fix DontZap interaction with -retro -retro will now _not_ override (No)DontZap, if it's set in the config file. commit d80bae2237e555025465d4d761a5cc537cc2bcdd Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 8 02:43:27 2008 +0300 Update docs to reflect new DontZap default commit 42e7b64bf90604e0099702f5447163be80a2efb6 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 7 20:32:02 2008 -0400 -retro enables zapping commit 9d135ac10a7374c7ccda705f1eeb02cc53076c34 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 8 02:30:05 2008 +0300 Input: Make DontZap the default If you need to bail out the server, use Ctrl-Alt-Fx, or enable zapping if it bothers you that much. If Ctrl-Alt-Fx is broken, nag me until it's permanently fixed. commit b574365fca954a999ebaeb7203d1e0ea6d99b3ea Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Oct 7 13:09:11 2008 -0700 Revert "Unexport (and unimplement) xf86SetAccessFuncs" for now. The nvidia driver currently uses these hooks to work around problems where RAC will disable access to the hardware at unexpected times. This change restores these hooks until we can come up with a better API for working around RAC. This reverts commit c1df4fbede8058c15ce3a5759a7758fecafbb9e7. commit fe85ec34ec2b58188633dac4464a1e9e9977652b Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Oct 7 13:08:38 2008 -0700 Revert "Remove unused server state change callbackery" for now. The nvidia driver currently uses these callbacks to work around problems where RAC will disable access to the hardware at unexpected times. This change restores these hooks until we can come up with a better API for working around RAC. This reverts commit d7c0ba2e9eae7044ef4c31d9c3cbb9a71ee0f9f9. Conflicts: hw/xfree86/loader/xf86sym.c commit 94919480d8bb66e1807b4fe87b8f326ef6e012c6 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 7 13:41:25 2008 -0400 int10: Fix a nasty memory leak. commit a57b2f172c1291f22f7ba2780c1b2f55e353c3e9 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 7 13:39:10 2008 -0400 int10: Don't warn when scanning for devices we don't have. Some BIOSes (hi XGI!) will attempt to enumerate the PCI bus by asking for the config space of every possible device number. This despite perfectly functional BIOS methods to enumerate the bus exactly. commit a65e36a873cd1ba9896cd0f9a3e94dd933666005 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 7 13:38:12 2008 -0400 int10: Remove useless check. If you have more than one PCI device with the same d/b/d/f, you're already in trouble. commit 6dbfca571f6d214dc456710a60ebbbbd204cdbbd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Oct 7 10:07:03 2008 -0700 Depend on xtrans >= 1.2.2 for TRANS_NOXAUTH commit 30193fbff9d9284fbbd81fe5f7b6c4d102daf1d1 Author: Adam Jackson <ajax@redhat.com> Date: Tue Oct 7 10:36:12 2008 -0400 Reinstate cursorScreenDevPriv commit e7cd5d84ed1fb3637dce6e9e6ef58c8611818c4e Author: Dave Airlie <airlied@redhat.com> Date: Tue Oct 7 16:09:17 2008 +1000 fixup another calloc build issue commit 60cfaa45a532bd3cfcfb4bd57b2f657c0a8b6a6b Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 6 18:47:06 2008 -0400 Build fix. commit c6d6d3e87a472b641d883a6c000f96e5bdf48532 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 6 16:18:21 2008 -0400 Loader: Unexport a handful of consumerless symbols from dixsym. commit 8a5b89e8e184f4cbf33c6dee0b06e61d8f857576 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 6 15:36:51 2008 -0400 xalloc+memset(0) -> xcalloc commit 0b7b89fbac0b3865b2cf51295c68a5f4c7523f28 Author: Adam Jackson <ajax@redhat.com> Date: Mon Oct 6 14:19:30 2008 -0400 xalloc+bzero -> xcalloc commit 9187f6ad9ec7ba9569a93d92561aac17eaa83491 Author: Keith Packard <keithp@keithp.com> Date: Mon Oct 6 12:21:20 2008 -0400 RANDR: Delivery output property events. commit 717c7492a0f6ba3fb3eabda33515881eef314155 Author: Dave Airlie <airlied@linux.ie> Date: Tue Oct 7 02:38:44 2008 +1000 exa: don't call composite routines with no buffer. We can get a case with gnome-terminal + links, where we get two arrays of glyphs all with 0 width and 0 heights in them. If this happens we manage to get to this case without any buffer setup and segfault. commit aacac3edac7c6b82a0a0e3bc500f563d187e5df3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Oct 4 21:07:31 2008 -0700 XQuartz: Bumped bundle version to 2.3.2 for beta1 (cherry picked from commit 2021c4c4e726a6b8f27f19f16ed3d86e37dbe448) commit ed3134918dcbbd58a5ef8359a77e8024c98396e6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Oct 4 21:06:58 2008 -0700 XQuartz: pbcopy: Re-enabled some code I commented out for testing (cherry picked from commit 9b5d11409264080e394c8f18e06237122de80014) commit b3a971d8b5df5ab4af0be49105ef32f67d010901 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Oct 4 18:54:15 2008 -0700 XQuartz: xpbproxy: Support some of the preference toggles from X11.app, cleaned up CLIPBOARD_MANAGER atom management. (cherry picked from commit f7673bb4de3c1f71eb390a3279eed3589efc3df4) commit fc35c7a2e2888cb767413f5e85a79c7f422a6284 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Oct 4 21:16:54 2008 -0700 XQuartz: GLX - enable_stereo defaults option should work now (cherry picked from commit 3a6898f48756fdb2898292679301ef3dc109b4f6) commit 7818aba1d1e74f4ffe68b7d6806622b94ae8a230 Author: Roland Scheidegger <sroland@tungstengraphics.com> Date: Sat Oct 4 15:50:35 2008 +0200 dri2: fix compilation (remove no longer existing include file) commit a29af6465883796a6acf04b72ce812a0632b2186 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Oct 3 23:54:10 2008 +0200 exa: remove "direct" case for exa{Trapezoids,Triangles} - By adding a small hack to the xserver i was able to easily test the performance of the normally rare direct case (using cairo). - It turned out to be 70% slower for me (large test on an otherwise idle computer), which seems enough of a reason to remove it. - AddTraps could also use a 2nd look, but since noone is using that it's a bit hard and less useful to test. commit 416870d8c9e7e383b87c8513c2296a0cb66e7ef4 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Oct 3 22:59:40 2008 +0200 exa: remove some excessive whitespace commit b72a217ad59cc527327d7b1fc81898677b977d8f Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 18:30:37 2008 -0400 Dangling use of miDestroyGCOps commit f5bbc54a93f53cd4ba124712159bb44c93282a8e Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 18:18:02 2008 -0400 Fix compile for miSetScreenPixmap prototype. commit 9dbfcd89214241626ac2704d1ffffff1cc0c67ae Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 17:40:30 2008 -0400 Delete unused miModifyBanking() commit 94825ad3c72a1c3f6a61199c302841f63241cf87 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 17:39:34 2008 -0400 Remove unused wrapping for visual initialization. commit 4791f8e2ba9a0e318b7f13c83618ece036dd53ed Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 17:23:58 2008 -0400 staticize mi{G,S}etScreenPixmap commit 14d98b4a2fdea4a4f5cc9b751151672cb392fba3 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 17:21:16 2008 -0400 miFindMaxBand is dead code commit 48b47928133bc462947104bd0f4204f00b993862 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 17:16:28 2008 -0400 mi{Create,Destroy}GCOps are unused, nuke 'em. commit bd0e87c74789bd5447ec731aa2d2d6e05dd54abc Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 17:13:10 2008 -0400 Remove a bunch of unused API from the mi export list. commit ee5e07bc22f0c3af7a412b6bc430eae6a1dafe16 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 16:58:01 2008 -0400 loader: sort the mi symbol list commit 77d0b0ecfa3c67ff8d11e773a7f083721cf4c6d7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 16:53:08 2008 -0400 Remove unused pciNumBuses commit 0ce61e21d6d7dcca0090e319bbcdb678570f2c3f Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 16:05:19 2008 -0400 Remove the Must_have_memory hack. Also remove an astonishing amount of misunderstanding of how casts work. commit e6b1c1fada19268af559d89375989973729fdb19 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:47:50 2008 -0400 const cleanup commit fe616f9230b672edb89fca7516e750dc1b20c690 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:42:58 2008 -0400 Drop the never-called SkippedRequestCallback list. commit 31136b9467c2a17bbed4a51d6a6c41e3290bd236 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:33:47 2008 -0400 Unexport MakeClientGrab{Imp,P}ervious xtrap used to use these, but it's gone now. xtest still does but it's linked statically. commit eaf3fdf97014c27aececa8505c2713e7c9a537fc Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:24:35 2008 -0400 Unexport xf86NoSharedResources commit d7d9edb506bfea1c10516b6c4eb72dee3559863c Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:17:44 2008 -0400 Unexport xf86DeallocateResourcesForEntity commit 49673b43584928c22d699d1968ed6813b272aefe Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:13:39 2008 -0400 Unexport xf86SetEntityFuncs commit 949ef6b79a36d6f6bbc192c20ef0f13cc95d4f28 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:10:26 2008 -0400 Unexport xf86ChkConflict Also remove the unused internal ChkConflict() commit d7c0ba2e9eae7044ef4c31d9c3cbb9a71ee0f9f9 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 15:06:42 2008 -0400 Remove unused server state change callbackery. commit 9ada146a16bcf220b2dd2936fb3a0349a31e99d3 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 14:40:18 2008 -0400 xf86RegisterResources: Always print any failed registrations. commit a5d3fa90f3de763a5dcbb0ff4987562449819323 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 14:38:48 2008 -0400 Typo fix. commit cc3335858508ffbc52123eb5bb0c34f42800c8c4 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 14:37:59 2008 -0400 Remove the old implementation of RemoveOverlaps commit 8fbf1185f5d6a1836b3e4265de6f605d82478e0b Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 14:32:32 2008 -0400 Internalise some resource list API. commit 0ca4f3cee7e42a393cdd32d3a772a190ae68abc5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 13:29:55 2008 -0400 Unexport xf86EnterServerState commit c1df4fbede8058c15ce3a5759a7758fecafbb9e7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 13:08:43 2008 -0400 Unexport (and unimplement) xf86SetAccessFuncs. Because, no. commit 44269e604eb60ebaa6189fd4409d39a4ec6b9f4b Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 13:02:50 2008 -0400 RAC: NO_SEPARATE_*_FROM_* are useless. If anyone can come up with an example of a bus where: - both i/o and memory resources are addressable - access to them can be controlled - but they can't be controlled independently then by all means, reinstate this logic. commit 51fcb58f45824c7cde88b8b4ccbd6bdcf760280e Author: Adam Jackson <ajax@redhat.com> Date: Fri Oct 3 12:39:49 2008 -0400 RAC: AccessEnable() and AccessDisable() are mandatory. commit 9c5fc7762e9ca09847965e67e247d95dfc197266 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 3 11:24:34 2008 -0700 Partially reverts commit 505c216d030a8eb6e9fa757ecebed9597a850c88. I don't know how the hell git-cherrypick messed that up to delete fbwindow.c commit 7bb73a9513710feaebc127998950e9f472bfcc0d Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Tue Sep 30 23:53:12 2008 -0600 XQuartz: pbproxy: Possibly fix a memory leak by using an [NSApp run] loop, instead of calling CFRunLoopRun() directly. The leak wasn't reproducible on this machine, but someone was able to produce a leak trace with Instruments that indicates it was leaking in the CFRunLoopRun() path. x-input.m: dequeue and ignore events when pbproxy_active is false. x-selection.h: add an is_active method that is used by x-input.m to ignore events. x-selection.m: Handle nearly every preference, except for primary_on_grab, which I don't really understand yet. (cherry picked from commit 4d51ad851e64da83cbdfb0a4a22428418a7bcf75) commit 2a5ce41f0371ad5df52586b8d4072578b6206321 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Sep 30 13:54:08 2008 -0700 XQuartz: Use "pointer" and "pen" for device names to please GDK. (cherry picked from commit 00ca0f4d839abf47e9573a1552473e039cf787e6) commit d3f597a986dcbc7e4164f350300dbd2e438949d8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Sep 30 11:10:58 2008 -0700 XQuartz: Workaround for initial pressure/tilt being sent as 0 with motion during the proximity event (cherry picked from commit 9a91d770a6411dd876187e64a8bda1f0745169ae) commit 1657dfb843c0127ea31bfd0a8ef81d0c394cbc7b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Sep 30 08:46:08 2008 -0700 XQuartz: Using absolute ranges for pointer location to increase resolution and better support tablets. (cherry picked from commit d79ccb45f68b65d65718b5b77efe2fae6eeda762) commit 88bb8c6f485a7aaf40f684d484a33cfedfa74a70 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 29 22:33:02 2008 -0700 XQuartz: Removed resolved comment about localization. (cherry picked from commit 8ed5faf058ac7b0782a9cc13a2c58b80168358d2) commit b1d0b196617643619d24ed520b0a1161e26b66c6 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Tue Sep 30 13:04:35 2008 -0600 XQuartz: pbproxy: Make the signal handler safer by using _exit, and only exit. Remove some unnecesssary headers. Remove some dead code that was never called or used in pbproxy. Make use of an NSAutoreleasePool in x_init. It could potentially cause a leak on a startup without this. Start adding reload_preferences to the x_selection class, as well as event handling for that. (cherry picked from commit 602e8ba8f7ee196696bc9e3cea6ecdf3200dcf5c) commit ecd260143cf9f012f033ba029ad04cb49567c89a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 29 22:32:24 2008 -0700 XQuartz: Added some localizable strings that were missing. (cherry picked from commit 2c8205ea8b709c5859412b466e83aec7a94acdcf) commit aae878b89081ffba16386e8d4987469313049bea Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 29 22:26:20 2008 -0700 XQuartz: Actually send the pointer event from the pen even if it happes to actually have 0 pressure and 0 tilt. (cherry picked from commit f41583761955cb9c92c43239bfaa8ae0e5d95e33) commit b7ad86ff8a9115147c0cf02af9e80ec464129392 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 27 15:30:10 2008 -0700 Xquartz: xpbproxy: Split out app-specific stuff to app-main.m in prep for making this into a thread. (cherry picked from commit c2012138a520560f8a2160518ea73fced410c3b7) commit 5446adebfb085dd05471729bf5c55bf820b1cbe3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 3 11:12:49 2008 -0700 XQuartz: Send AppleWMReloadPreferences where appropriate. (cherry picked from commit 490cbe9888e2c1080495b003c429fdb1659444e1) commit 6020c3fbfe06530cb2b90178d17a7d63beae028a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 3 11:09:26 2008 -0700 XQuartz: Added a --enable-integrated-xpbproxy configure option for building xpbproxy as an app or as a thread. (cherry picked from commit 8edc5fb38c922f28659d2f823148339a8907c4d9) (cherry picked from commit 88033a66a5549870fd053795b019d4c22950425b) commit 505c216d030a8eb6e9fa757ecebed9597a850c88 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Oct 3 11:11:37 2008 -0700 Added dep on applewmproto 1.1.0 (cherry picked from commit b350b066740a2e72585153e35478538cf1bca9ef) commit 1c1a6e965da412e767ad8bc15a5362116d64c6b0 Author: Adam Jackson <ajax@redhat.com> Date: Mon Sep 22 22:09:19 2008 -0400 Remove an utterly, utterly ancient changelog. Wow. commit 9c8a2be2c73abf06245b1eb7f05f93e104dcfe42 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Oct 2 08:55:14 2008 +0930 dix: fix axis scaling. For two axes [a, b] and [x, y] (inclusive), the formula to scale point P(ab) to (x,y) is: (P - a)/(b - a) * (y - x) + x And the whole end result rounded of course to get the integer we need. commit 93ef72fa26b27cf90bf5c64ec19ac295a113aaae Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Sun Sep 28 21:47:21 2008 +0930 dix: don't lose subpixel precision when scaling. Only scale x/y back from screen range if we have crossed screen, otherwise leave it as it is. commit 5ef5e89f0e4b9b8820093e072430e295efce32fa Author: Simon Thum <simon.thum@gmx.de> Date: Sun Sep 28 22:32:44 2008 +0930 dix: fix non-initialization of pointer accel in master devices. Init MDs always with PtrAccelNoOp. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 036d424827726b0c804ae1532109253270744207 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Sep 26 17:01:12 2008 +0930 xfree86: don't let DGA steal key events outside of [9,255]. commit 56a24cf894a142b18c7f18e294074c32031f3d14 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 2 17:56:31 2008 -0400 xorg.conf.man: We don't look in root's ~ anymore, don't say we do. commit 7921c4a0bfc843c772dcb2fc185d4bcab1316330 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 2 17:08:48 2008 -0400 Remove some stale IPv6 debugging commit f836e1f11b7bf3449c3e469cc7799c4ed28d2356 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 2 17:03:54 2008 -0400 Unifdef ISC commit b1a31734731a768d586b4cb18317d4a5c5e20fa8 Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 2 17:03:21 2008 -0400 Fix bad preprocessor line commit 00f01f39454001846869496d9124f62c01e5691a Author: Adam Jackson <ajax@redhat.com> Date: Thu Oct 2 15:48:18 2008 -0400 Don't inherit XAUTHORITY from the environment. It's not especially obvious, and unpleasantly overloaded for the Xnest case. Typically this gives you a server that looks for its auth data in the authority file you were using for the running X session, which generally doesn't have an entry for the display you just started. All the major dm's, and startx, pass -auth explicitly, so this shouldn't cause too much upheaval. commit eb8be3e90a9c90a428696026d1e3b2152d7eefb4 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Sep 25 14:16:20 2008 -0600 XQuartz: pbproxy: Fix another STRING bug. Fix the usage of the NSString cStringUsingEncoding: - it doesn't NUL terminate the string, which lead to a bus error. So, we use lengthOfBytesUsingEncoding: to get the length in bytes instead of strlen(). (cherry picked from commit 6333d619e747c3b6bd3ba7557e35c0e5f6daa40f) commit edfa3f8233fde490cb4255f21473684e96d595a3 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Sep 25 12:29:57 2008 -0600 XQuartz: pbproxy: Fix a bug that rxvt brought out in STRING copying. Now I can copy and paste to/from rxvt correctly. (cherry picked from commit 82a4dc5f0f31a7911ee1cce5d1b162077befa811) commit 12a59c44cb68843a60fc43257930d1cbeb971b7a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 24 22:51:03 2008 -0700 XQuartz: Fixed threading issue with TSM. (cherry picked from commit 93ab4e0071670bb80bfa1170dd97ed9d6d51c67a) commit ee87c9b02401a7a08b396884ba412a503b078bbd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 24 18:57:36 2008 -0700 XQuartz: pbproxy: Removed stray SPI include. (cherry picked from commit 2fb2bc77b804d7b63002c1423cb0bfc658eeee45) commit 591cc57627a9137159fb5a13287c1d61d8d2fc8c Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Tue Sep 23 13:59:25 2008 -0600 XQuartz: pbproxy: Fix 3 paths that could leak memory. 2 of the paths leaked, when INCR transfers were done. Now we are leak free according to the leaks program for all transfers I have tried so far. (cherry picked from commit aa98db576bc02f0765cb35d0282a894ba3778213) commit 586fbc91df731150ff5e39170efe33f3cfac28a2 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Tue Sep 23 12:39:32 2008 -0600 XQuartz: pbproxy: Fix NSObject memory leaks by properly using the NSAutoreleasePool. Now the usage is consistent. In x_input_run() we create a pool, and release it after processing the XEvents. Add some getpid() output to main for debugging. It needs a bit more testing before the next release. Don't retain the NSPasteboard as the old code did. That may have contributed to the leak, and it made it so that we needed the NSAutoreleasePool created in main(). Remove the _known_types, and _pasteboard instance variables from the x_selection class. They aren't needed anymore. The leaks program now indicates 0 leaks after some usage. I want to test further, but this seems much better, and my memory usage graph indicates it's not growing. (cherry picked from commit b245d84a72ee3929546cd11a6eba3c60fb4a4d95) commit 238999cfc99dbf306184f0e846465a8707bcc9d2 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Sep 22 17:36:21 2008 -0600 XQuartz: pbproxy: Add a comment to pbproxy.h about how the DB() macro causes a leak (according to the leaks program). Attempt to fix several other leaks with release method calls. For some reason the process still grows more than it should... I will need to use some better methods than leaks, and malloc_history I suspect. Whatever is leaking, it's hard to find. I need to isolate the cases more. Add a missing image/jpeg branch. Remove read_prop_32 - it's not used. (cherry picked from commit 63a680354dcb545fef935ac97596dd35ceaed960) commit 106eb37e0214bbd864a59119b491abfc54f32629 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Sep 26 13:05:10 2008 +0930 Require inputproto 1.9.99.5 Pull and rebuild your input drivers, while you're at it. commit fbd09486c6e6c64db28d81caa5ef04821e49f2eb Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Sep 23 16:55:04 2008 +0930 Push server-known properties into xserver-properties.h. commit a2d83b9dc8387ec7e70689db1371cf6500b2f68e Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Sep 18 18:21:03 2008 +0930 Xi: add "deletable" flag to properties, add DeleteProperty handler. A property can only be deleted if any of the following is true: - if a property is deletable and all handlers return Success. - if a property is non-deleteable and the all handlers return Success AND the delete request does not come from a client (i.e. driver or the server). A client can never delete a non-deletable property. commit 22e90472681ebc7bdd28f82bbf2753a5b259e931 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Sep 18 16:12:02 2008 +0930 Xi: allow Set/GetProperties to return a status, and honour this status code. If a property handler now bails out, return the error code to the caller. This allows to be slightly more specific with the errors. commit 1e24e7b9df3d02350c7ea18e9379e87fe4d00026 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Sep 18 15:58:46 2008 +0930 Xi: remove configure/query device property calls. This removes all the meta-information about device properties (pending, fromClient, range, valid_values, immutable). commit feaa5fa6712c8c6f4ca97766e2ac0338253cf3b8 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Sep 25 11:03:22 2008 +0930 xfixes: realize the invisible cursor before displaying it. AllocARGBCursor realizes the cursor but can only do so if we have devices there already. If we don't - then the cursor needs to be realized elsewhere. This is usually done in InitializeSprite, but since xfixes just hard-swaps the (realized) cursor to the InvisibleCursor, we need to manually realize it before trying to display it. commit e58be0f3425fb3e946a222077672c3c01308f887 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Sep 23 10:01:30 2008 +0930 config: print error code if NIDR fails. commit 30c3c13f1030268aaa6a3598d538fafd0592d77a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Sep 22 11:10:46 2008 +0930 xkb: squash canonical types into explicit ones on core reconstruction. If we update key types from core, and groups 2 - n have a canonical type but the same symbols as the explicit type of group 1, assume that it was a core sym duplication according to Section 12.4 of the XKB Protocol Spec. Ignore the canonical types and pretend there's only one group for the key - with the explicit key type. The protocol spec does not cover this case, so we have to guess here. commit ae986d1c73d2f720bd0309d8c33328d14e8eed25 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Sep 19 18:27:24 2008 +0930 xkb: fix core keyboard map generation. #14373 According to Section 12.4 of the XKB Protocol Spec, if a key only has a single group but the keyboard has multiple groups defined, the core description of the key is a duplication of the single group across all symbols. i.e. G1L1 G1L2 G1L1 G1L2 G1L3 G1L4 G1L3 G1L4 The previous code generated G1L1 G1L2 G1L3 G1L4 G1L3 G1L4, leading to "invented" groups when the process is reversed. Note that this creates wrong key types on reconstruction from core to xkb, i.e. any single-group key with a key type that is not one of the canonical four (Sec 12.2.3), will get the assigned type on group 1, and a canonical type for the other gruops. X.Org Bug 14373 <http://bugs.freedesktop.org/show_bug.cgi?id=14373> commit 5bf3f0fd4e00f96cfebd14b58580c3c8733626fb Author: Dave Airlie <airlied@linux.ie> Date: Thu Sep 25 15:40:19 2008 +1000 exa: make sure pixmap devPrivate.ptr is NULL at create time commit 82f150d73cc9a7d8eaf7241a51b03af05bcec159 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Wed Sep 24 16:56:45 2008 -0700 GLX: Make sure GLX_SGI_make_current_read is enabled when possible commit 8d9defe8c2a685709318c1d43379443df3d2322a Author: Adam Jackson <ajax@redhat.com> Date: Wed Sep 24 10:11:00 2008 -0400 Fix un-suppressing the initial cursor. The intended behaviour was "show as soon as someone calls XDefineCursor". What you actually got was, uh, slightly less well defined, since the screen's ChangeWindowAttributes hook would run after DIX handled the cursor change. Oops. The trivial way to turn the cursor on is: % xsetroot -cursor_name gumby Refer to /usr/include/X11/cursorfont.h for cursor names. Thanks to anholt for catching this. commit a39377cbcbd3091095efbeab25bec18ae520147e Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 23 09:22:07 2008 -0700 Revert "Render: Use built-in SHA1 library" This reverts commit d3bd31fddff7894f89ba80a3cdddff49aff08db8. X.org should not be providing a custom SHA1 implementation. commit 10a9bac0257b381367cedff395b40425d584bf59 Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 23 09:21:37 2008 -0700 Revert "Update COPYING for SHA1 code" This reverts commit 64387c8573ca8b3909667e32d7a9fba9567b21d3. X.org should not be providing a custom SHA1 implementation. commit 64387c8573ca8b3909667e32d7a9fba9567b21d3 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Sep 23 19:05:14 2008 +0300 Update COPYING for SHA1 code commit d3bd31fddff7894f89ba80a3cdddff49aff08db8 Author: John Tapsell <johnflux@gmail.com> Date: Tue Sep 23 18:56:32 2008 +0300 Render: Use built-in SHA1 library Getting an external library for SHA1 is a mess, so just use our own, regrettably. Public domain implementation. commit 991ed2949ba682684952fe323f8f0f51ebdca98e Author: Adam Jackson <ajax@redhat.com> Date: Tue Sep 23 10:22:22 2008 -0400 Rename SaveSetMap() to SaveSetShouldMap(). Avoids preprocessor collision with xfixeswire.h commit ca9fae00795a114bca4397c32b543d6326a4c547 Author: Owen Taylor <otaylor@redhat.com> Date: Mon Sep 22 12:42:41 2008 -0700 Change 'remap' to 'map' in saveset functions/macros Now that the code has been fixed so that Unmap means unmap and not "don't remap", 'remap' was confusing to have in the function names/parameters, so change it to simple 'map'. Signed-off-by: Keith Packard <keithp@keithp.com> commit ad14239a358cf65e5702ec7d054aa1db4f1cdd68 Author: Adam Jackson <ajax@redhat.com> Date: Mon Sep 22 11:26:49 2008 -0400 Upgrade GLX Public License 1.0 to FreeB 2.0. According to the press release: Previous SGI contributions to the free and open source community are now available under the new license. These contributions include the SGI® OpenGL® Sample Implementation, the GLX™ API and other GLX extensions. [...] "SGI has been one of the most ardent commercial supporters of free and open source software, so it was important to us that we continue to support the free software development community by releasing our earlier OpenGL-related contributions under this new license," said Steve Neuner, director of Linux, SGI. "This license ensures that all existing user communities will benefit, and their work can proceed unimpeded. Both Mesa and the X.org Project can continue to utilize this code in free software distributions of GNU/Linux. Now more than ever, software previously released by SGI under earlier GLX and SGI Free Software License B is free." "The GLX API" is here read to include the original GLX source release from: http://www.sgi.com/products/software/opensource/glx/download.html ftp://ftp.sgi.com/sgi/opengl/glx/glx1_2.1.tgz which includes glxext.c as included in XFree86, from which our copies in glx/ and hw/dmx/glxProxy/ are derived. commit 722c51960dd4948b8a64f8eff115fa69da597ef9 Author: Owen W. Taylor <otaylor@redhat.com> Date: Mon Sep 22 11:04:26 2008 -0400 Don't remap windows for SaveSetUnmap Since ReparentWindow() does a unmap/map pair for windows that are already mapped, for saveset windows with SaveSetUnmap, we must unmap the window before calling ReparentWindow() to avoid the generation of MapRequest events, and so forth. commit 0bb317a78b96fddcdac319c9706b3a12f931ea44 Author: Adam Jackson <ajax@redhat.com> Date: Mon Sep 22 10:51:51 2008 -0400 Default to -br. Add -retro option for the nostalgic. -retro also reverts to the classic cursor display behavior, meaning, the cursor will be visible before anyone calls XDefineCursor(). commit ab17f88506a2dde32c50ff72b03743cd9c384ecc Author: Julien Cristau <jcristau@debian.org> Date: Mon Sep 22 01:59:31 2008 +0200 Don't use our version of ffs() if the system has one commit af0d5e2ef7b1b3f42e3522568c5f56850823c102 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Sep 20 19:41:46 2008 -0700 XQuartz: 64bit crash fix ... don't pass pointers through xe. (cherry picked from commit 5f1265b82edead8f15f2affc79c2782519502fa2) commit 852a0b0dde34e7179394d96d09122b99bf7fe904 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Sat Sep 20 17:49:16 2008 -0600 XQuartz: pbproxy: Add an X error handler that returns 0. Move the struct atom_list into the x-selection class, so that it's no longer a global variable named atoms. This may ease pthread integration and reduce the chances of symbols conflicting. (cherry picked from commit c1403c713ca80104ae3736bd2ed1eb6ffa5192b6) commit 7fa6fc5ad0b12bc52a1c22906709fbb003782d11 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Fri Sep 19 21:28:46 2008 -0600 XQuartz: pbproxy: Fix a bug that occured when a PICT format was available. We may need another branch to convert a PICT to a PNG or JPEG. For now TIFF works well in all of the test image copying apps when converted to PNG or JPEG with an NSBitmapImageRep class. (cherry picked from commit adf339d8f948fc1e308dbcae38fcfce504b5b0ab) commit f67490ceb5b9ddf25e734cc331705103599f3ed8 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Fri Sep 19 14:29:37 2008 -0600 XQuartz: pbproxy: Make the proxy handle copy request races, and PRIMARY INCR transfers mixed with a CLIPBOARD change. Fix a bug with some UTF-8 transfers. I can only guess that my UTF-8 tests before were inadequate. I can now copy/paste any characters between uxterm and Textedit.app. (cherry picked from commit 7ca1532e8e6e2c733c9c508eee0de73d09ecb947) commit b666ffd78155db228174041e9d7460b8a07dde0f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Sep 19 13:15:07 2008 -0700 XQuartz: "Disable" the text when syncing is disabled. (cherry picked from commit 7713d7ab66e74b212a6c0d634a3ad82373e178db) commit dba290ec231422740f453b69b187f80df3f50e4b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 21 17:40:35 2008 -0700 XQuartz: Added a preferences UI for pbproxy options. (cherry picked from commit d76cca5e1eae86450aa236e49a2024881d0bac01) commit a928cae57b47625c9e3d136840d3e5d17fd3c51e Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Fri Sep 19 00:18:44 2008 -0600 XQuartz: pbproxy: Add a missing include of Xutil.h. Another header seems to have done this before, but correctness matters. (cherry picked from commit 1b4987e779d97b90669bac2405a4672085677f7c) commit 749bdf19b2a50201fddd04207e31122470f435e3 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Fri Sep 19 00:02:48 2008 -0600 XQuartz: pbproxy: Add COMPOUND_TEXT handling. Do misc. cleanups with testing to verify that the behavior didn't change. main.m: XInternAtom compound_text, and atom_pair. pbproxy.h: Add compound_text and atom_pair to the struct atom_list. x-selection.m: Add an #include of Xutil.h. Refactor the reply struct initialization to be done in a common place. Add send_reply: to simplify the code a bit more. Add send_compound_text: which handles the COMPOUND_TEXT type. Add the beginnings of a send_multiple:. Change handle_image:extension: to handle_image:. The extension: message isn't needed anymore. (cherry picked from commit 1e9460abdf5bafe46215966bbef3e796cb1c33e0) commit 00bfbee59fe3b0c8d1a55d1851206857ca563ece Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Thu Sep 18 13:10:41 2008 -0600 XQuartz: pbproxy: pbproxy now responds to selection request events. We can now copy and paste images to and from X11. Text copying and pasting works as well. The NSPasteboard can contain TIFF or PICT images, and pbproxy will translate to an image/png or image/jpeg request, and list those in the TARGETS. I added a description of the basic design at the top of x-selection.m. I removed the request_data x_selection class struct. It's not needed. (cherry picked from commit 4a8daf884694c9c420c45d427f1f84e608e7e48f) commit 811e9f5e9e9c07f4b8fb1e9a4d9df91a2e359221 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Wed Sep 17 11:59:36 2008 -0600 XQuartz: pbproxy: Use an NSBitmapImageRep to convert an "image/png" selection to a TIFFRepresentation for use with NSPasteboard. This has been tested with the Gimp and works with some minor quartz-wm changes. The Finder clipboard shows the image updates after an Edit -> Copy. (cherry picked from commit 12912adaeea759d30f96d8ae51a84fd1659ea0ac) commit d8d555bac77509248d1145e928a2edf500b326b9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 17 10:11:00 2008 -0700 XQuartz: Don't enable 8bit visuals in the TrueColor server, since it's not working yet (cherry picked from commit 1317c8ff94c4bd32617a5398e929f667bd87da58) commit 23ec8261b6a746cb84e1328284fdc5587bca6faf Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Tue Sep 16 21:09:22 2008 -0600 XQuartz: pbproxy: The greedy CLIPBOARD handling now works for text. This change adds some [self own_clipboard] calls in the necessary places to get the proper greedy behavior. UTF8_STRING and STRING properties seem to work well now with the test cases (PRIMARY, and CLIPBOARD). I can copy from several different X apps, and have the behavior be correct when pasting. I also verified that quartz-wm isn't doing the copying, by disabling the quartz-wm paths. (cherry picked from commit 934669f732c28f07b9d934d8f8f0b63ccfebd900) commit 7c2eb3d41af33d1c52500111d0d34f9aab8a4542 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Tue Sep 16 15:21:18 2008 -0600 XQuartz: pbproxy: return the TARGETS list as a 32-bit list to fix a bug that was in the original. Add TRACE() calls where appropriate to try to figure out why we are losing CLIPBOARD at times, after transferring PRIMARY to the NSPasteboard. Use the new pbproxy_clipboard_to_pasteboard where appropriate. (cherry picked from commit 40190675a6c1889cca3574e5d1a9c16ab74315a7) commit 81c836902dc5b0b83cd95262d48cbc4c81ff3ae2 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Sep 15 13:35:46 2008 -0600 Rename reclaim_clipboard to claim_clipboard. Convert the puts usage to use DB(). Add the initial handle_image method. Check for nil in the NSString instantiation in various places. Add some commentary to enhance the clarity of why I did some things. (cherry picked from commit 37361567b65241eab64e8b30cd9729d0e71a86d2) commit 85e23affea7bf9aa7615b0292e67f170266d85f8 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Sep 15 13:31:19 2008 -0600 Add an image_jpeg Atom. (cherry picked from commit ea9dc27977c5eab666f2aa2d914e4e28d36758c7) commit 6b42f40ff9b9ff3e74ccbb2ce5cfad65016934de Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Sep 15 13:28:50 2008 -0600 Rename reclaim_clipboard to claim_clipboard. (cherry picked from commit d333a8e2b5514b8b76a78c6a13a3f5149ea8de27) commit 2ab56981b1a64138d6c1f9ecfb75655477b3e575 Author: George Peter Staplin <gps@Georges-Workstation.local> Date: Mon Sep 15 13:27:08 2008 -0600 Add image/jpeg type, and rename reclaim_clipboard to claim_clipboard. (cherry picked from commit 32b175ef62b68a971784e51e937e358cb10e20ac) commit cbd32645f7d1054f79ad137a16766da1076c610e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Sep 15 09:33:55 2008 -0700 XQuartz: pbproxy: Added global variables to customize how pbproxy behaves (cherry picked from commit 21a2d0b8d03faf1c66ec0c5c11fbd2ab24547727) commit 5b397642cdc29920245ebe64cc85243cac893e0e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 14 09:23:17 2008 -0700 XQuartz: pbproxy: First round of updates to pbproxy from George. (cherry picked from commit 5c8b956f8f3f17e8d577d97cb66424954be72684) commit dac9e91870f9c787eac97c9d7d0607979c57eb5b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Sep 21 17:32:24 2008 -0700 mieq: Made custom event handlers safer for nevents >1 commit 8c46505d7d91e0644b19cccc4b342fceb6f86cab Author: Kim Woelders <kim@woelders.dk> Date: Mon Sep 22 08:37:29 2008 +0930 xkb: fix use of uninitialized variable. And some cosmetic changes to use stuff->change consistently. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 2b266eda6e23d16116f8a8e258192df353970279 Author: Peter Harris <peter.harris@hummingbird.com> Date: Thu Dec 20 15:58:01 2007 -0500 Fix panoramiX request and reply swapping Fix panoramiX request and reply swapping Set window and screen values in panoramix replies Prevent buffer overrun in ProcPanoramiXGetScreenSize commit 03ab8f11d25b0ca39a3b37b5350bca4c1028768e Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 18 12:17:05 2008 -0700 When resizing a window with redirected descendents, don't expose them Bit/window gravity computations need to recompute exposures to manage the bits which are saved by gravity during the resize computation. That's easy for non-redirected windows where the bits are all within the parent's pixmap. For redirected windows, we don't need to deal with this at all, so just skip the whole re-computation adventure. Signed-off-by: Keith Packard <keithp@keithp.com> commit d26083fe02658e7312a8da6a5b11652f9fe57bc8 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 18 12:14:58 2008 -0700 Switching from Automatic to Manual redirect needs to unmap/remap When changing a window from automatic redirection to manual redirection, the parent clip list needs to be recomputed; the easy way to get that computed right is to unmap/map the window, just as when redirecting the window the first time. Thanks to Owen Taylor for helping diagnose this. Signed-off-by: Keith Packard <keithp@keithp.com> commit 8bfd88ca61a1747714781a090d1c9dd8f3ad5dfc Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 19 12:13:43 2008 -0400 Revert accidental edid changes from previous commit. commit 69b79c1a6648f0d04a1b37a728b2e3d76233530f Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 19 12:02:28 2008 -0400 Update to SGI FreeB 2.0. Under the terms of version 1.1, "once Covered Code has been published under a particular version of the License, Recipient may, for the duration of the License, continue to use it under the terms of that version, or choose to use such Covered Code under the terms of any subsequent version published by SGI." FreeB 2.0 license refers to "dates of first publication". They are here taken to be 1991-2000, as noted in the original license text: ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. Official FreeB 2.0 text: http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf As always, this code has not been tested for conformance with the OpenGL specification. OpenGL conformance testing is available from http://khronos.org/ and is required for use of the OpenGL logo in product advertising and promotion. commit cc20112a65d3f641ce0261c86a541f94fae5215c Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Sep 19 08:44:04 2008 +0930 Xi: don't include client-side headers. Spotted by Mikhail Gusarov. commit e76b5b5e731e2d6c61ff6e6e9b2f42b20ac473d5 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Sep 18 14:51:15 2008 +0930 dix: calloc, not malloc, ValuatorClassRec. For master devices, the ptraccel code could segfault on free since we'd be dereferencing random memory. Callocing the valuatorClassRec is the easy fix. commit f789408f7dbfe57a0111e185ac83d1c70f262ba8 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Mon Aug 25 14:52:35 2008 +0930 Xi: remove broken SDeviceEnterNotifyEvent, replace with ...Leave... The event format is the same for both (bar the type), so one is enough. commit 97b9374a8af5a4cc52f9074feb4ce40cf0b90796 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Sep 17 15:48:56 2008 -0700 Conditionalize Composite-based backing store on pScreen->backingStoreSupport. (cherry picked from commit 37876602957924c7cff759a800eddd574ee2385a) commit b4762c0245ed2966606171cf27f40aa745fdc76e Author: Julien Cristau <jcristau@debian.org> Date: Tue Sep 16 17:13:42 2008 +0200 exa: disable shared pixmaps They got re-enabled in ee7c684f21d220d5e046bab31ae617a7d64d60f6 ("Reimplement ShmPutImage.") commit 52bbfc5bfa64fd09ef625f35a2fb4a0518003825 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Mon Sep 15 10:43:46 2008 -0400 scrnsaver is optional at build time. commit b6ab114212c0e4c3346ceb5b207f14c526ab81e7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 12 19:11:53 2008 -0400 Array-index based devPrivates implementation. Note: DevPrivateKey is now pointer-to-int, which means each key now needs to point to some global storage of size at least sizeof(int). commit 999f3362d50a753c1801d565766219808efdb1a5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Sep 5 17:32:16 2008 -0700 XQuartz: Dead code removal (cherry picked from commit 43184cd379c4fb7254391b8a362016cbf89b5529) commit 6548a55ebdf43231a3c48debf54aa5aa2f1aa956 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Sep 5 17:05:03 2008 -0700 XQuartz: 256 color support (cherry picked from commit 8dd6d5c825d457f26b41b79d02d57ed4a5ecf1f5) commit bad7cd14c2021b14971b3f707f927803a053003e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Sep 5 10:46:36 2008 -0700 XQuartz: Dead code removal (cherry picked from commit bf10fb0b1f776e72db7c76db11f764e26f9d62c4) commit 1119fe136f8731f26fc6f50b92f5ddf78f3f83be Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Sep 5 10:46:20 2008 -0700 XQuartz: Changed around fd handoff model to be more robust (cherry picked from commit 4fe605c2bc62d50e0b5764d9edda245af227630b) commit 183233b27beb441742a53e440c3389b4ea125b8a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Sep 12 15:25:44 2008 -0700 XQuartz: Don't warp the pointer on server start for XQuartz (cherry picked from commit c0da576d4921c246a9ac747921b48ab9e718347f) commit 7a46dd30d332bc1d42f82b0391e806d3b067ebbd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Sep 4 09:18:40 2008 -0700 XQuartz: Dead code removal (cherry picked from commit 2e45344870f5d17181df6407da3448991036d783) commit 1c70e53f2560cb877c8b149034f296232de67a4e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Sep 4 08:55:22 2008 -0700 XQuartz: Fixed proximity logic errors for tablets. (cherry picked from commit d942849f248c368b92ca73e145e8a5bc339112d7) commit c661c6ae7a9cd981f914484aa4c3007922280def Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Sep 4 08:07:32 2008 -0700 XQuartz: Remove decls of crashtracer strings that we don't use anymore in here (cherry picked from commit 4a653c6bfd270f2960a8c7e726e7628cfc3c9051) commit 54162aca404a7de2e560cc2aea01445e14742efe Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Sep 4 05:18:31 2008 -0700 XQuartz: Fixed a crash in RootlessNativeWindowMoved (cherry picked from commit a16048cec08e173ce42a78a77704f5fdfcb4480f) commit ce781cac1b52003da6c025cd29e2c2ad97dbb324 Author: Eric Anholt <eric@anholt.net> Date: Thu Sep 11 16:24:20 2008 -0700 Fix distcheck. commit 31c62495f1de6e9ba41e1f6d7fa263eeb849129b Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 10 13:11:09 2008 +0800 Drop a reference to user mode after create User mode has no customer when create until assigned to some output. commit 079625570d51e41569b73b2fd9237eb8f967f408 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Sep 8 08:50:52 2008 -0700 Bump ABI major versions for the TryClientExceptions change from commit 883811c. commit 4e004c68283828660f2259a4a4120a84667dcafa Author: Zhenyu Wang <zhenyu.z.wang@intel.com> Date: Mon Sep 8 09:16:59 2008 +0800 Revert "randr: fix user mode create initial reference count" This reverts commit 7c5ca85a9e6d49ab572831b3e0c08bb4cafb395e. commit 40a9482f8c5b3eac86c221ccce78510e850f4d2b Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Fri Sep 5 06:09:51 2008 -0700 Add cscope files to .gitignore commit bf333c2f9833a178887e7bdd7fc338f1e09c387f Author: John Tapsell <john.tapsell@john-desktop.(none)> Date: Wed Sep 3 12:20:17 2008 +0100 fbdevhw: Remove pixclock check. The check can fail because the output from FBIOGET_VSCREENINFO is used to set Clock in fbdev2xfree_timing(). Then in fbdevHWSetMode(), xfree2fbdev_timing() is called which sets the pixclock based on Clock. The resulting circle results in slight rounding errors, causing the comparision check in fbdev_modes_equal to fail. commit 47bf269d5922a4998c33908a53ad1affa8de96c0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 12:54:56 2008 -0700 mieq: Fix my broken cherry pick. commit 1669308be6d4cc6265e5fa8ef47fbf2cbef6f093 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 09:23:06 2008 -0700 XQuartz: Added pasteboard proxy code stripped out of quartz-wm. (cherry picked from commit 1f842c71c35db031a24de646429834d6054adf1d) (cherry picked from commit 144746223d8dc3f6ff2a0e805aa27a6e57df558a) commit 46168b3b404164c1f2e7876031e70fb77192fe75 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 09:11:25 2008 -0700 XQuartz: Updated Tablet code to include ranges for valuators and added cursor and erasor (cherry picked from commit 6bca78760951cb5cb57ea66b7631a2dc230dc27a) (cherry picked from commit fafcafd6de39cf6b5967793f03b30b49db36fec5) commit 7f5318131ddf86bed5797c0d9641f6ff34f34be0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 03:54:42 2008 -0700 XQuartz: Removed "Done" button from Applications Customization. Now properly save on exit. (cherry picked from commit 2f1e163d5db6063e54fcaa045ea67c29ce3e46aa) (cherry picked from commit 7542c00b96461c3474b8c23545171c4b6ddfd29d) commit 9e70a3cf58c205948f6a415e203d825e9b660d9d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 09:33:39 2008 -0700 mieqProcessInputEvents: Check custom event handlers first. commit 700e8bf33f9b1c3921de912b8110fadf5e0626da Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 02:41:20 2008 -0700 XQuartz: Updated man page (cherry picked from commit 6932d0d19ea75c64ed38b82a246b68c6bbfb8cec) (cherry picked from commit 8e3da36b6b0a261975808bc67b5caca733a1a23d) commit 7430bb9093ea8cf9589d745742c7353e53a144f8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 02:37:09 2008 -0700 XQuartz: Removed dead code (unused option definitions) (cherry picked from commit 3d74f77490105c0704c0b10dc7a6eb859bf6e985) (cherry picked from commit c1e5ea9ba058f6a13f564165a3d6862335729630) commit b3836e5bdd7e2e04e563246d90f385e1b4741baa Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Sep 3 02:36:39 2008 -0700 XQuartz: Cleaned up our sleeping before adding the launchd socket. (cherry picked from commit ebfe49dfca6e04d66232bad760f522629397cc35) (cherry picked from commit 2cf74a76d54d795cfc3c0380a526b9177327782d) commit 7c5ca85a9e6d49ab572831b3e0c08bb4cafb395e Author: Zhenyu Wang <zhenyu.z.wang@intel.com> Date: Wed Sep 3 09:41:00 2008 +0800 randr: fix user mode create initial reference count Don't need extra reference count adding when creating user mode. This fixes user mode destroy, otherwise we get BadAccess error. commit 4e1f9f51a9eea115ce2a073824e9c5cef4e2f364 Author: Daniel Drake <dsd@laptop.org> Date: Tue Sep 2 16:20:40 2008 -0400 Don't try to destroy a NULL pixmap. commit 613ce0955032fb032de0a3940752828d314f057a Author: Adam Jackson <ajax@redhat.com> Date: Tue Sep 2 15:43:15 2008 -0400 Fix strict-aliasing silliness in XAA. commit b5cdcfa55c399e83d51242e93d4f25d8bc4fec1f Author: Julien Cristau <jcristau@debian.org> Date: Mon Sep 1 19:45:30 2008 +0200 Xevie: swap replies as necessary commit d3ae193f4ac87530f2745f8cb5e7b70dd516881e Author: Thorvald Natvig <slicer@users.sourceforge.net> Date: Mon Sep 1 19:36:56 2008 +0200 Xevie: always initialize rep.length (bug#17394) The XEvIE extension doesn't clear the rep.length field for any reply but the version check. Hence, if there is junk data in it and that is sent to the client, it hangs. X.Org bug#17394 (http://bugs.freedesktop.org/show_bug.cgi?id=17394) commit 0466b8811ce8ebc1d993f177cbb7a22e997640f1 Author: Dave Airlie <airlied@redhat.com> Date: Mon Sep 1 09:57:25 2008 +1000 exa: drop cw.h inclusion this doesn't seem to be needed, at least I can't see any warning without it. I'd like to build EXA into a driver and cw.h isn't exported commit 881bd15f445bb62c3fdea863c968c95217408b6e Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Aug 31 18:07:22 2008 +0200 xf86Crtc: Set mode to NULL, so nothing bad happens if crtc == NULL. - Fix is courtesy of math_b. commit f4e9a1a98f97155de62908309e87c10487125926 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Aug 31 17:45:08 2008 +0200 damage: choose less ambiguous function names commit 0cd6709db5febbe7fbd073e429421fcd81041e08 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Aug 30 16:13:58 2008 -0700 XQuartz: Fixed editing of Applications menu (cherry picked from commit da647f1add4c1ae7854c0fbfbf972666ce5d12c8) commit c4d290fc54542ccba7c3a46bc75b0c3322d0ca48 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Aug 30 14:19:47 2008 -0700 XQuartz: Fixed missing symbol in quartzKeyboard debugging (cherry picked from commit 8ad55e484f0ba9073ce07a03de660cc546a7b668) commit 5d7d959b1143979c3445639c9d108e02da0c1475 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Aug 30 14:18:07 2008 -0700 XQuartz: Don't even build with GLX support since swrast now depends on libdrm (cherry picked from commit 3739525d57dff2b3b034b5768f357b1c25577909) commit 45def7f0a342f4733cafb06adbfed14932f0e01b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 29 22:16:03 2008 -0700 Removed dead glcontextmodes (cherry picked from commit c6d0ac7471209d835e8d9a25adcbda893ddfa1cb) commit d01c5ca7935a8340a3cd68c325da6dfec005c952 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Aug 30 15:35:32 2008 +0200 Xserver.man: Typo (the the). commit 229e60db8f95232afc8cdcb7cd0572d117c84b90 Author: Thomas Bodzar <Thomas.Bodzar@quest.com> Date: Sat Aug 30 15:34:29 2008 +0200 Xorg.man: typo (the the). commit 1885582444fb06da73dea1f118a777bea26e1dc1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 29 21:18:26 2008 -0700 XQuartz: Placate automake which doesn't like escaped newlines even in comments... (cherry picked from commit 73db1170129a31ad2d55a7e83ac6dfc8030e47f1) commit 8abcc12fdd5bd9edc0288a1ab8f75e65ffcb8c71 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 29 20:55:25 2008 -0700 XQuartz: Added debugging output to the crash log to help track down two crashes, since people don't often report their system.log spew. (cherry picked from commit aaf0f71db197526b6b866cc1b39fbdfe051879ef) commit aee19c7b5542aa147b89b1ae8340e9931d81729f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 29 03:54:55 2008 -0700 XQuartz: xp_is_symbolic_hotkey_event catches the input menu, but not our mainMenu, so we still need to do that the old way. (cherry picked from commit 25eccf12c89d73b8bce2c9be14841efb230acedc) commit 974db58f5b730c3770ee461665a02dd4334d1dea Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Aug 30 00:37:11 2008 +0200 damage: initial attempt at a damage marker mechanism - This should allow drivers to recieve post submission events for X<->opengl synchronisation. - Lacking a testcase, i'm open to suggestion how to do it better. - The idea is: - driver recieves event - driver creates personal identification and inserts marker into X fifo. - when something wants to use an X pixmap, it checks if something is pending. - If so, it synchronizes the 2nd fifo using the initial identification. - Driver is not required to use interrupt based systems (price too high). - Lower latency is ofcource better. - If this is somehow unusable for you, then come up with improvements. - For that reason i wouldn't consider the api fixed for the moment. commit 454cb0802eec3c2c2cdbcc17971bced868462b83 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Aug 29 22:28:02 2008 +0200 damage: DamageReportRawRegion should set pDamage->damage - I found no evidence in the protocol, that it should be differently from all the other modes. - It seems to have been like this from day 1. - If anyone has evidence to the contrary, please enlighten me. commit ae6ca434104405302f30a58bde8738d9579d9dc9 Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Aug 29 22:21:54 2008 +0200 damage: internal functions start with a non-capital letter commit 1861250cd7e84b05e8298b74e3c7e97da72ddfba Author: Maarten Maathuis <madman2003@gmail.com> Date: Fri Aug 29 22:15:23 2008 +0200 {damage,exa}: sanitise damage - Redo damage naming for more consistency. - Call post submission functions only where appropriate. - EXA can now live without it's odd damage workarounds. commit 5af77d43fe812e127d5d335527fa940ab9d95f38 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Aug 11 16:59:17 2008 -0400 DRI2: Drop sarea use, implement server side swap buffers. commit 60ad8d5d05485339e89d7f1f9f1ded75de7c7ea1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 28 23:45:17 2008 -0400 Attempt getpeercon() on remote sockets as well as local ones. commit ebea78cdba0ff14a397239ee1936bd254c181e1b Author: Tomas Carnecky <tom@dbservice.com> Date: Thu Aug 28 18:05:40 2008 -0400 Prepare for array-index based devPrivates. TODO: static indices can be made just an int; some indices can be combined. commit ec7907f8fa04dcff2649cc4846975844314f737e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 27 19:27:13 2008 -0400 Add an array of integers for use as per-screen cursor private keys. Replaces the use of the screen pointer itself as the key, which was nice but won't work now that an array index is being stored. commit 86898491497a43814caf42013651086e62fe6162 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 27 19:17:15 2008 -0400 Remove unused GetGlyphPrivatesForScreen. commit 90b178cc7feda1f9c4995b98364739e71233fff3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 28 19:36:22 2008 -0400 Don't need to request space for Xnest pixmap private. commit 835b532d6f51d08998d7ab49fcb41db8266487ce Author: Adam Jackson <ajax@redhat.com> Date: Thu Aug 28 14:49:35 2008 -0400 Build fix. commit 040212ee60af9d043c4c3f98bba5120c3b8e33f7 Author: Adam Jackson <ajax@redhat.com> Date: Thu Aug 28 13:49:35 2008 -0400 MIT-SHM pixmaps, if they exist, are ZPixmap. commit ee7c684f21d220d5e046bab31ae617a7d64d60f6 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 27 16:05:47 2008 -0400 Reimplement ShmPutImage. There's no reason to not just dispatch this straight into the GC. As a bonus, if you do so, damage wraps correctly, and thus swcursor works. The side effect is it's no longer possible to override ShmPutImage with ShmRegisterFuncs(). Also remove the (broken) damage tracking for same from EXA, since it didn't work right, and is now superfluous. commit 2db1afbf2e56d8743c701d81a5797001ce9e5c52 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 26 23:09:20 2008 -0700 XQuartz: Always use TIS for the keyboard layout seed since KB* aren't thread safe. (cherry picked from commit c8244177b0dbcb28d2f5509e6f2a3e8057889790) commit 319405fa4a530804c19fb7d0fcece5c912e41c9d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 26 21:11:35 2008 -0700 XQuartz: Fixed needed xplugin version. >< (cherry picked from commit 01b3a99dff79e0d2b316e02658c19fa79d9144ae) commit 3350770bd6d90fefa1133ac738c1d4eae2d568a6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 26 19:13:56 2008 -0700 XQuartz: Use new Xplugin API to determine if a keypress event corresponds to an OS-X hotkey that we should dispatch to Appkit. (cherry picked from commit e7658e745f8a3eaf5cec9f54a8a1b7e5a7708e09) commit 7930ea9116f232a3762f0085e5ca65e06d1142fc Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Aug 25 22:10:46 2008 -0700 XQuartz: Made a note to come back to the xinitrc race condition in the 1.5 branch when we move up to it. (cherry picked from commit 54a882dcbdccef3f3eb4e6398e13c88185a8986c) commit dc1171df5baa0c4aa366ff2b07af5b8eb44dae12 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 22 01:12:37 2008 -0700 XQuartz: Fixed bogus args to debug ErrorF (cherry picked from commit f0351c2b80f30ae31f041798b84139141fc3d5a5) commit ac936525afe46bad329387232f8d48e77f6a4175 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 22 01:11:33 2008 -0700 XQuartz: Cleaned up mouse event translation a bit more. (cherry picked from commit c286f2a718fdaf6ad10249b59abb20731da8d904) commit 1b42f550001c11c93d5a2144df98a5c687c010c2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 22 00:45:12 2008 -0700 Xquartz: Added missing ev_type for NSTabletPoint event. (cherry picked from commit 07548f13947a212dcc020d52fe0ad679255121e2) commit 13a89f19208cf998808ff2896b7711310768f94c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 20 10:21:23 2008 -0700 XQuartz: Added more explanation to debug keylayout spew to cut down on report-spam. (cherry picked from commit fcdc9f8b5abd724d75f53d48fdadbed9859e9e79) commit dd1e54d6eed0bce289517b3cb95e6b1a187ca6e0 Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Aug 26 20:02:55 2008 +0200 exa: fix thinko from 988725f32e082aee9392a71464125157a83d1e67 - the drawable of the pixmap is not the same as the original drawable (possibly a DRAWABLE_WINDOW) commit 7c14fdbacfcd2f4d56a346e6c72e44e4ba9909c1 Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Aug 26 17:21:43 2008 +0200 exa: some minor cleanup - Fix compile warning - Order exa.h by source file that exports the function. - Move the function i created earlier to private headers. commit de79edbd9f67762950eaac2dc79668035239897c Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Aug 26 17:03:12 2008 +0200 exa: report damage manually for exa{Trapezoids,Triangles} when needed - Plus a micro cleanup of unused variables. commit 988725f32e082aee9392a71464125157a83d1e67 Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Aug 26 16:54:29 2008 +0200 exa: move destination damage for internal calls to a special function - This should improve clarity for someone who isn't familiar with the code. commit ce193476808f54d946351458361c62132d81b62f Author: Maarten Maathuis <madman2003@gmail.com> Date: Tue Aug 26 13:18:58 2008 +0200 exa_glyphs: remove useless offset commit fd94651fc3a6f49ec153ffb823b86c1d125bb298 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Aug 26 10:58:35 2008 -0400 Fix driGetConfigAttribIndex unaligned access to GLboolean. We don't actually send the float mode so just drop it. Drop a couple of other unused or redundant fields from GLXconfig. commit 41bd8d5dfe27d5c91fe7e4cdba1475a2a0741b1c Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 25 11:27:26 2008 -0400 EDID: Build fix. commit 76ed409acd772f2c041239345c6dc64cbef0e5b2 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 25 10:44:45 2008 -0400 EDID: Publish the whole block on the root window if we've got it. commit 5724f7fb5bea6fa1a354c64c0972c53d70e2f27b Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 25 10:39:36 2008 -0400 EDID: Publish the whole block in the RANDR property if we've got it. commit 668f89eba3e8f9da7843f5cb350f8dc1e5d7efbe Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Aug 22 10:32:18 2008 -0700 Remove unnecessary #ifdef __SOL8__'s commit cc78d977cac74fcfb7c9b27e7109a1e369018dd8 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Aug 22 10:14:11 2008 -0700 Convert Solaris #ifdef's for <sys/kd.h> to AC_CHECK_HEADERS check Upcoming virtual terminal support changes in Solaris kernel will provide <sys/kd.h> on SPARC too, so this gets us ready for them. commit 95b466e457542bfe08b0ed2bbb5db8d28a961cfd Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Aug 21 17:24:40 2008 +0930 Xi: don't include .c files. commit c696da75c7326c5e1f1cd48292c0519ddc22e11b Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Thu Aug 21 17:23:11 2008 +0930 Xi: swap devices property replies. commit 01264f17925005969c3b71ca945fc1014bcd8c8e Author: Julien Cristau <jcristau@debian.org> Date: Thu Aug 21 01:32:03 2008 +0200 Add swapped dispatch for randr 1.2 requests commit e02f864fdf19a5ab1682336be343c57fdb69ef43 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 20 13:24:03 2008 -0400 Suppress cursor display until the first XDefineCursor() request. Yes, this means the server will start without showing a cursor. Pretty much any application that wants to interact with the mouse will define cursors, so this essentially just delays showing it until gdm (or whatever) loads. commit 64ef7ed072007b1d0b4de5ff1e5eababa418c794 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 20 13:14:03 2008 -0400 Centralize declaration of ConnectionInfo. commit f1f44940f10b0209946ec0f08104a372d7d945a0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 20 09:50:54 2008 -0700 XQuartz: Support windowItemModMask=0 or -1 to disable window shortcuts. (cherry picked from commit 81187364e512606a6aebb95ab2967d9d420f57f2) (cherry picked from commit f2ec79e4a159dec6481691e4dd615db01770dd7a) commit 6c5612c2e1df1e89388ffff97251f5328558f8e8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 20 09:21:44 2008 -0700 XQuartz: Added window_item_modifiers defaults item (and option to localization) to change the modifier keys used for the windows menu. (cherry picked from commit e4110861d307a55d9032cb83cf024ec1f294e8d7) (cherry picked from commit fcfc05482a88696cb713c7a2ddfcf935ae8378a6) commit bdc277c9b3dc6b3b95f74b20a49ce163c5fae980 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 20 09:58:48 2008 -0700 XQuartz: Just cleaned up formatting of event processing code... no "meat" changed... (cherry picked from commit 745bc8ab387d6794f47d8b9dca33b4c81f6dd39c) (cherry picked from commit a28a2be52478a1557a363140f7bd70ececf144dc) commit ed42108920cc695b96ed57bf9dcfea1470e74669 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 19 02:02:11 2008 -0700 XQuartz: Added appkit_modifiers defaults option which users can set to 'rcommand' to get access to the input menu with right command (cherry picked from commit 02af74d7a5a7225f408915254c40856159dc7f19) (cherry picked from commit 2da32894dff8340f6ca7c980277fca7ec835a193) commit be06961312e2111778bfd97b2c8a927acc61f43d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 20 09:56:06 2008 -0700 XQuartz: More input fixes stuck-modifier fixes (capslock) 3button-emulation now doesn't send the modifier key with the click Added other options to fake_button2 and fake_button3 defaults options: ({l,r}{control,alt,command,shift}) (cherry picked from commit 8fb6a1cf44c35a20dfb0c05c9824f94898f88da7) (cherry picked from commit ae9c1b3cfb3874b4d1251681c24bda91c398bcab) commit 436b659091dd17bb3e316377ba31f5d2a5dfa12e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Aug 14 09:34:12 2008 -0700 XQuartz: Updated bundle version to 2.3.1 (cherry picked from commit eedecba0b882bb07931e8d9168589f5be7a08a69) (cherry picked from commit 7d9d864461858b25c5eb5858fdf4b53771795f11) commit bc4cef1d0ae7cbb8f5fe16d576db45abd4330370 Author: Maarten Maathuis <madman2003@gmail.com> Date: Mon Aug 18 16:28:33 2008 +0200 exa: remove useless cache{X,Y}off from UploadToScreen() arguments. commit 38bdc34d555f956a1ff1e1bb8eef95e3ba2bac64 Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 15:12:39 2008 -0400 Remove redundant check. commit 47b31233c26f710be70ffcca17e5402d03d5733f Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 15:10:12 2008 -0400 Simplify driver setup. No point warning about missing driver hooks, that just means the person who gave you the driver is inept. Might as well just crash. Also, just name anonymous screens as screen%d instead of failing after the 36th screen. Bonus points if you can figure out what the failure mode would be on the 36th screen, and what the effective screen limit was. commit b99fc65b53769400821a2bd8f691ece35a5b8847 Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 15:06:53 2008 -0400 Simplify calling xf86EnableIO() a bit. commit b1f2c7a89ace1f6e5750783f3c43c4c5a6d24374 Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 15:06:11 2008 -0400 The ->Identify hook is not mandatory. Best comment ever though. Mad props. commit af5125968a738ec8f496d04eb65acb7c8f812115 Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 14:47:10 2008 -0400 Refactor misprite a bit. No variable declarations in header files, please. commit 41b68e0dea9305d66bca2fc4ad96db01f5342c6d Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 11:02:31 2008 -0400 Remove unused -co option. What did this even do anyway? commit 1f416fba994ed7a7e072a9f0a86b515855ea3bac Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 10:56:45 2008 -0400 Remove unused -bestRefresh option. commit 5a72c45d42abc7227c6cf3d14fd7043ea7527c54 Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 10:54:11 2008 -0400 Remove unused -showunresolved option commit 9f08ffc557b52e2e8cd54fb692b66700c83d61c6 Author: Adam Jackson <ajax@redhat.com> Date: Tue Aug 19 10:29:23 2008 -0400 Remove unused xf86Info.pMouse commit f227fbf74f0c619ecf3275cdb4c10b1a4b3a8cfc Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Aug 19 11:36:12 2008 +0200 EXA: Inline Prepare/FinishAccessWindow into only caller, ChangeWindowAttributes. Also check the requested mask in addition to the GC state before doing work. commit 825b3fe11d1b813bf8d5b24a880ed04b78ae1acf Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Aug 19 11:22:40 2008 +0200 EXA: Don't use exaGlyphs if the driver doesn't provide a PrepareComposite hook. It's buggy without Composite acceleration (leading to cropped glyphs) and not really useful in that case anyway. The bug probably still needs to be found and fixed for drivers that provide a PrepareComposite hook but can't accelerate text rendering though. commit 75e495a4cd823b6fa42a8d167ecc9f4723320dea Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 17:58:08 2008 -0400 Remove unused xf86Info.mouseLocal commit b3dfd7e3e4deef21b40c885f8e7eae34b55888b2 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 17:56:18 2008 -0400 Remove unused xf86Info.sharedMonitor commit 5e43cd28692bc05cac80f38b47104a26c0524385 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 17:46:42 2008 -0400 Remove the remainder of grab deactivation and closedown. commit cd1e8f26147919227e7624ac4c6b313d972a4d35 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 17:40:46 2008 -0400 Remove unused EstimateSizesAggressively option. commit faaf0046155abbd15415d5a6b62ead4f58935c28 Author: Mathieu Bérard <mathieu.berard@crans.org> Date: Mon Aug 18 17:23:26 2008 -0400 Remove xaaTEGlyphBlt.S Should have been removed in 593144dddd977f53bcd1a115f9544eeece46df4c but ajax was asleep at the wheel. commit 562462e78dd6a5e2ed5b36aa22be52f31d55485d Author: Mathieu Bérard <mathieu.berard@crans.org> Date: Mon Aug 18 17:05:24 2008 -0400 Remove dead {bsd,lnx}Resource.c commit e3e47b35e369bf4abb0fe15865acca0b34600b1f Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 17:03:22 2008 -0400 Remove MAX_PCI_{BUSES,DOMAINS} and some associated #if 0. commit 593144dddd977f53bcd1a115f9544eeece46df4c Author: Mathieu Bérard <mathieu.berard@crans.org> Date: Mon Aug 18 16:46:36 2008 -0400 Remove some unused assembly code and assyntax.h commit 2d3e478384ef8af2a760f39792e35e4a6174c967 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 15:09:44 2008 -0400 int10: Fix int1A for %ax == 0xB101. pciNumBuses was pretty much always 1 post-pciaccess. That ain't good. commit 539717fe1f08a000d1eef9f345d24cb49e3663b5 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 14:50:33 2008 -0400 Remove (unused) pciMaxBusNum. commit 3c03d9f1efbbacec6e8be58da99bf0977a8e0fec Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 14:37:42 2008 -0400 Remove sparcPci.c There is no way this code can have been building for anyone since pciaccess was merged. BSD and Linux were already using OS code on sparc, the only people who could want this are Solaris, who should be using pciaccess anyway. commit 9a39b6cfbda306eb594e87ce828afa01cd7aa01e Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 14:26:01 2008 -0400 Remove XF86SCANPCI_WRAPPER. commit 470b05a610e641094d46742393684acd786d78a8 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 14:03:36 2008 -0400 Remove vestigial MAX_PCI_DEVICES. commit 244a635fcdc9e0a7212d51b26d74f49d8e1b071f Author: Fredrik Höglund <fredrik@kde.org> Date: Mon Aug 18 19:27:34 2008 +0200 Fix the tile offset in miPaintWindow for ParentRelative windows. commit fdf7c747a8e1bc59dfb31b7f90dd5eab2687315b Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 13:13:03 2008 -0400 Remove PciProbeType and associated weirdness. This code was effectively only used in ix86Pci.c to select PCI config access type. Nobody should be using that path anymore, in the glorious pciaccess world; kernel services should get it right for you. commit 95bb6f53624a3e6f4d62a2f789982c5544d2fc70 Author: Mathieu Bérard <mathieu.berard@crans.org> Date: Mon Aug 18 11:47:19 2008 -0400 Remove ancient unused inline hack. commit e1ae8db625b5e8c298a557592ef23656b3da4886 Author: Adam Jackson <ajax@redhat.com> Date: Mon Aug 18 09:53:48 2008 -0400 Drop dead PowerPC PCI code. Also add a warning for anyone still using legacy PCI code. commit 99583b43a9a202d047ff417d47485e4c0e0c9670 Author: Jie Luo <clotho67@gmail.com> Date: Sun Aug 17 23:13:22 2008 +0200 glx: avoid possible NULLptr deref, fix #16884 commit 421b7e8f12083e9518fa7deda968a2f73c9a0006 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Aug 17 19:57:02 2008 +0200 exa: fix assert logic thinko from 361a9eb953aaa38f8ebc057185de29e50f9eef26 - I guess failing PrepareAccess is rare, since this a 3 year old bug. commit 1e62e773273539352bc21b2da5262678dd3fc7df Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Aug 15 15:19:44 2008 +0930 Require inputproto 1.9.99.4 commit 609c04b62bdb0e86f33860069033c7142eecf210 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Aug 15 14:51:59 2008 +0930 dix: stick a warning in about loss of subpixel precision. commit de1573172ad2c2e98c101727930a468213295783 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Aug 13 13:11:44 2008 +0930 Backport device properties to XI 1.5 instead of XI 2.0 commit 8b9ed7dec2954d4890ddcc7c874fc0832b16495a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Aug 14 09:08:14 2008 -0700 XQuartz: Fixed a stuck modifier key bug. (cherry picked from commit eeb6e5a9e98dcf045ec230f160d5992080dceba6) commit 1770c85374883229ec5e9685229b2333e62705e6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Aug 14 07:32:37 2008 -0700 XQuartz: Made 3-button mouse simulation a little more consistent. (cherry picked from commit d207b037d2ae213369e5627a17d8831c9bc16ad8) commit f51f77d25e69b51fa3fd557ffdb5573b61759706 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 13 19:09:05 2008 -0700 XQuartz: Reverted "Control" text to be accurately "Command" in the input prefs. (cherry picked from commit b287c481e1cbe77ff84d10a708505f148a0c8434) commit 04956b80431169e0ae713a3e6ba4cdc157ce3a66 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Aug 9 10:07:32 2008 -0700 Transport/Apple: Add TRANS_NOXAUTH to incoming connections when the listener is flagged as such (cherry picked from commit ba4a7924261070ad0aff7211b7a1c9581fad4646) commit e6813e8de65eee854bbffe6ab0f8ba158f43b10b Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Wed Aug 13 14:24:45 2008 +0930 Xi: byte-swap device property requests. commit 0ce687634fa5e0d955e896a0d0d5f584a4cfd1a4 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 13 17:28:08 2008 -0400 Eviscerate save-under support. Use a compositing manager already. Plus I really wanted to use 'eviscerate' in a commit message. commit f456f32cd97684052cab4712e7f4c827132c554b Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 13 16:21:28 2008 -0400 Build fix. commit c1e9b7dc6f4600fe6c301aecd7d67461cb884df0 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 13 14:13:55 2008 -0400 Sledgehammer off the DRI2 build system. commit 544bfd06663ff71bc5275459cf74a3557530544f Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 13 11:09:54 2008 -0400 Remove xf86Version.h and related API. We haven't meaningfully been API-compatible with xf86 modules in ages, let's stop pretending. commit 139c3ab7b754dc425a09d5f7b6d2a8fb2b88138a Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Aug 12 17:49:49 2008 +0930 Xi: return the state from the correct keyboard in QueryDevicePointer. commit 998375f4154b000f75b2bafd4e276c0237d24dc7 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Aug 12 17:49:16 2008 +0930 dix: remove superfluous check. commit 9f9268821b13038556fbc029df54ab0e9b2aa77f Author: Mathieu Bérard <mathieu.berard@crans.org> Date: Mon Aug 11 13:52:38 2008 -0400 The smart scheduler is not optional. commit 2e2ce817ce404a5e000c9750fa96f656fed370b8 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Aug 10 23:07:46 2008 +0200 Move strcasecmp(), strcasencmp() and strcasestr() prototypes to os.h And make sure os.h is included in files that use it. commit 02efa78ce2da470b252289ff2af598d06bc84ece Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Aug 10 18:29:35 2008 +0200 add libXinerama to the list of dependencies. Now that panoramiXext.h is installed bt libXinerama, it becomes required to build Xext. commit be2210b69defa225d8bc4bb90d94bfd740ef8b1f Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Aug 9 23:43:50 2008 +0200 remove OpenBSD/amd64 specific mtrr API. The old code never worked anyways and was removed from OpenBSD. OpenBSD/amd64 4.4 and later support mtrr with the same API as OpenBSD/i386. commit 6e33e6f355f7f04e77a165eb67b1414724c1fba3 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Aug 9 23:43:03 2008 +0200 Move string comparaison functions to from dix/ to os/. commit 5968634996c08656a0c5e2fa35705cf7afac87e6 Author: Dave Miller <davem@davemloft.net> Date: Sat Aug 9 16:45:59 2008 +1000 glx: fix crash in driGetConfigAttribIndex Don't access GLboolean via int pointers commit 4212599c922373a224d2235c74672a3a3aa8e0b1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 8 12:17:58 2008 +0200 EXA: Make sure damage tracking code is inactive if the driver manages pixmaps. It was always supposed to be like that... It was only recently pointed out (in a rather convoluted way) that it was not in fact the case. commit 073116cc44859e96374cde46325df8540621d5ee Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 8 12:15:27 2008 +0200 Remove commented out lines that make automake 1.9 puke. commit 666781cd9b62207e45eebd3eb55a930f3a345f72 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 8 01:41:28 2008 -0700 Removed rogue #include (cherry picked from commit af238e99da45a4dd8d8cbb6564bb8d0a3d79d590) commit 4a0947bf06deacc3ae716730cfbbbeda1311bae3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 8 01:53:36 2008 -0700 XQuartz: Disable the Xquartz AIGLX for now since it doesn't even compile any more... (cherry picked from commit 4545ba91e9d6ad62b6cafde3c73a672d3ded91a2) commit 5accc9b3ce1af539150d59b1800b66783fd3e947 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Aug 8 00:19:41 2008 -0700 XQuartz: Re-added deprecated code fallback failsafe for keyboard layout on Leopard with some debugging spew. (cherry picked from commit 5854e712e9ebc210d2f8de6f5d4fb650944f314a) commit 465a9bb96e8a90e53e655b3245e22910201786d7 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Aug 8 17:37:06 2008 +0930 dix: don't try to create events if we don't have a screen. #16898 A NULL screen may happen during server shutdown, when the output has been shut down but the devices still generate events. X.Org Bug 16898 <http://bugs.freedesktop.org/show_bug.cgi?id=16898> commit d684f5760f40b682a8b879641300abe689a263c5 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Fri Aug 8 14:18:01 2008 +0930 xkb: actually initialise sli before using it. commit e00cd54c1ac57ea6e7767e90592200f343d9d08a Author: Simon Thum <simon.thum@gmx.de> Date: Thu Aug 7 11:06:21 2008 +0200 dix: remove misleading comment in ptrvelo.c Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> commit 6ca34549b89e73e3e0ec3cb7585686b880534cef Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 7 16:27:57 2008 +0930 dix: remove obsolete FIXME comment. Thanks to Simon Thum for pointing this out. commit 2c3645581ee3f180d34e32c8016d5e4e1af4dca4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Aug 7 11:55:10 2008 +0930 dix: SetModifierMapping should only apply to the ClientPointer and it's SDs. commit e1b286d495b760cf67ddf936eca11da50fba847a Author: Simon Thum <simon.thum@gmx.de> Date: Wed Aug 6 09:42:32 2008 +0200 dix: simplified debugging helper for pointer acceleration Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d95136e1510a48cc3ad066d880d56061fc6a42ee Author: Simon Thum <simon.thum@gmx.de> Date: Thu Jul 31 00:39:03 2008 +0200 xf86: don't replicate dix defaults for pointer acceleration the defaults from InitVelocityData() or hypothetic driver-side changes are now respected, not overridden. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4f333d53510b82db57cfac1bfea22422cbb7be79 Author: Simon Thum <simon.thum@gmx.de> Date: Thu Jul 31 00:33:38 2008 +0200 dix: simplify velocity tracking filters prefer fp-mul over fp-div and remove rather pointless check Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit bf084a0769eee36ff799e5e5f2d1e875c1ebcc51 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 6 13:36:43 2008 -0700 glcontextmodes.[hc] were not added with the removal of the meas symlinks patch. Copied from mesa head 2008.08.06. (cherry picked from commit 409e1dd1e9524b5c1a1ae58a759da77e587e3780) commit e72b1d21e44712e90595b1c31e67db6786d0d1bd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Aug 6 10:23:31 2008 -0700 XQuartz: Now properly disable xauth checking on launchd socket and mostly fix the xinitrc / launchd race condition commit d1b96cdea96f5321e0d254abde81cdaab2eca979 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Aug 6 10:37:32 2008 -0700 Add an xf86PrintBacktrace wrapper around xorg_backtrace to aid driver debugging. commit 26d31ad1c7f4c550d73419ecf76912d844186b30 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 5 15:14:08 2008 -0700 XQuartz: Added code and made comments more helpful for debugging first-client-auth bug. (cherry picked from commit a8f0d32216e321b8ae6da182be9b1ea792f6e004) commit 0ef3243fb59fa993a7a07a08debbd4329254c265 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 5 18:45:54 2008 -0700 XQuartz: More fd handoff cleanup. (cherry picked from commit 199d2dcb708c9f9d6b9ede149ea0fe9fba6c007c) commit e7dd3dd8f311d3872e0c4c9c2ca22c00f9d11f59 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 5 14:33:03 2008 -0700 XQuartz: Fixed some errors / typos in the preferences pane. (cherry picked from commit e1e0c398bbb50394b164394e1f1870016489c25b) commit 6836f9aac801c3add0ae4aece05b32e85a0c5f85 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 5 14:24:25 2008 -0700 XQUartz: UI Cleanup. Removed done/cancel buttons from Applications->Customize (cherry picked from commit d3157ca45c1f88edd040d721c1e944b9d2c090aa) commit c06e27b2f6fd9f7b9f827623a48876a225264132 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:42:15 2008 +0930 xkb: ProcXkbSetDeviceInfo should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit d9ca9819e975e0f6832a320f8be5958e5d942f85 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:41:40 2008 +0930 xkb: ProcXkbSetGeometry should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit 5ba87c3327786dd7c6e8e265a19c858e8faae8fd Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:41:08 2008 +0930 xkb: ProcXkbSetNames should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit 7e45c80204e06562d4475741caea65bc8758f3c7 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:40:25 2008 +0930 xkb: ProcXkbSetNamedIndicator should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit a609dbed7cf854a6ee9d33c7cf45615db9da1fb9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:38:59 2008 +0930 xkb: ProcXkbSetIndicatorMap should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit e8c2a3d7c996cb41c4c44ba67acae5ff9438fc06 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:37:39 2008 +0930 xkb: ProcXkbSetCompatMap should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit 3c7740aa8f21c1fda4190a1bf5d6ce089db5e35b Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:36:00 2008 +0930 xkb: ProcXkbSetMap should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit 31afd51dd49c0d0db2465fbc987044fab8b89f22 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 16:32:37 2008 +0930 xkb: ProcXkbBell should work on all attached SDs. If called with XkbUseCoreKbd, run through all attached SDs and replicate the call. This way, we keep the SDs in sync with the MD as long as core clients control the MDs. commit de4936d7482f820728efeef338a2041c7a9186d2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Aug 4 20:11:45 2008 -0700 XQuartz: Fixed proper processing of tablet button presses (cherry picked from commit ca0babafa4e9cf1b67ec460655bffe569ac9c3e9) commit b70a8ba3dc52b277194ab267a101a3fd15062685 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jul 15 17:48:29 2008 -0700 XQuartz: Nuke Sparkle. (cherry picked from commit 4991f54a8d84a9a8df89a99dbfc09391195578f8) commit 30851efdd4313506e92aeb6d3e5099dea99ab99c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Aug 5 12:54:51 2008 -0700 XQuartz: Fixed first-client-can't-connect bug Readded the old exec() server startup path for regression testing. Don't use the dynamic fd addition code since it's not quite working correctly. (cherry picked from commit 08f3fe153edc5ab4ca010e8ce82d5c3fc0ddb72c) commit 277a74bcbb7d0a93c4f2e1de11daabd8c5f93ee8 Author: Tomas Carnecky <tom@dbservice.com> Date: Mon Aug 4 23:26:00 2008 +0300 Redefine clients as a fixed array This removes yet another xalloc() each server generation. Also, I couldn't find the corresponding xfree() so I guess that used to be a memory leak there. commit 5532d63488ec45953ff7f925cfb4f87adb3b04a0 Author: Tomas Carnecky <tom@dbservice.com> Date: Mon Aug 4 23:06:08 2008 +0300 Redefine WindowTable as a fixed array Instead of xalloc'ing it every server generation. The array is always the same size (MAXSCREENS), anyway. commit e882ee7056f370e0619d137b4ec3973ecb4e3479 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jul 29 17:52:11 2008 +0300 EXA: Remove unnecessary #includes There wasn't actually any font code here, so no problem. commit 6c1bb64c6f2efd81856ca00591df37916713b142 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 4 15:19:45 2008 +0930 xkb: break up XkbCopyKeymap into bite-sized chunks. commit 3c6a9c531f673b7a0cb9ca01860b4dbe79686363 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 15:52:07 2008 +0930 config: protect against potential out-of-bounds indexing. commit 92c51b183c2ff06361dad7f918daed6577ba4935 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Aug 1 14:24:54 2008 +0930 config: support type strlist for XkbOptions property. For backwards compatibility with server 1.4. commit 35b14519b4a3158592a089170ec039bbc219603e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 29 12:59:57 2008 +0930 config: add parsing for input.x11_options.XkbOptions. #16874 X.Org Bug 16874 <http://bugs.freedesktop.org/show_bug.cgi?id=16784> commit d762c08aebe3b7e8c88e2e7a6fcf66057a21b403 Author: Simon Thum <simon.thum@gmx.de> Date: Mon Jul 28 14:07:48 2008 +0200 dix: export driver-side functions for acceleration also add additional safety for accel driver api Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 18e9fd69fe01298d825b46415b9c6bd86c75dfe5 Author: Simon Thum <simon.thum@gmx.de> Date: Tue Jul 29 10:07:43 2008 +0200 dix: use average of pointer accel profile Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 25882af6d3359e5ae42c927c555f5b257ba5665c Author: Ivaylo Boyadzhiev <iboyadzhiev@nvidia.com> Date: Sun Aug 3 18:55:12 2008 -0700 Fix a longstanding XAA CopyPlane bug. TmpBitPlane is a plane mask, not a plane index. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit d980913f3145cdc34baab27ff818c9631c4c8571 Author: Adam Jackson <ajax@redhat.com> Date: Fri Aug 1 16:15:04 2008 -0400 Erk. Actually check all the BARs, not just the first. commit 82d51e6df2bf677bdf24376092bcaa79b534f6e5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Aug 1 13:17:55 2008 -0400 Silence the "No matching Device section" warning in some harmless cases. If the device doesn't have any BARs then it's just a stub for some lame operating systems that need one PCI device per output for multihead. No point in warning about it. commit 9643e8d3482a35d355a243db7aa397ad47f29be0 Author: Adam Jackson <ajax@redhat.com> Date: Fri Aug 1 11:35:47 2008 -0400 Handle XGI cards in autoconfig. It's all a bit wonky since both sis(4) and xgi(4) claim to support the Volari Z7 and V5/8 (0x0020 and 0x0040), so let's side with xgi(4), why not. Note that the V3 (not V3XT) identifies itself as a trident chip. commit 63bdd4c27d47323b3282bf0b6eaecae91c79b45c Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 31 17:31:36 2008 -0400 Unifdef XIDLE. Seriously how was this still here. commit 8d214bc26f9b7ab6a5c54d7749cd4b6811cb0b96 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 31 15:46:52 2008 -0400 Document more of the OS and library assumptions. commit 2198e237b2ed85857c671eee2cd04dfc032befee Author: Tomas Carnecky <tom@dbservice.com> Date: Thu Jul 31 13:46:06 2008 -0400 Cosmetic cleanup to Xvfb/Xdmx configure check output. commit 148175fb8b365dcf00b13539b3f03ce33f3df707 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Jul 31 16:54:33 2008 +0200 EXA: Do still return FALSE if the driver PrepareCopy hook failed... Thanks to Stuart Bennett for pointing out the problem on IRC. commit 68fd6604a15b653d1fa244633eaaee9608a03ab3 Author: Tomas Carnecky <tom@dbservice.com> Date: Thu Jul 31 10:03:56 2008 -0400 OutputPropertyNotifyMask is a valid thing to select for. commit 64ebeeb5265a4c425b9397fdc86a6d81521a856e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Jul 31 10:58:52 2008 +0200 EXA: Fix exponential growth logic for GXcopy tiled fills. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16908 . commit 8405c25d9ddbfddb6b155a436f07ccad689e53bd Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Jul 31 10:55:44 2008 +0200 EXA: Simplify exaFillRegionTiled() control flow. Also only call REGION_TRANSLATE() when necessary. commit b37b1e66996f8335dafc97b12d25aaec452b931e Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Jul 30 18:48:27 2008 -0700 Make shmint.h part of the SDK. This includes ShmRegisterFuncs, ShmSetPixmapFormat, fbShmPutImage, and ShmRegisterFbFuncs. Note that fbShmPutImage was already exported. commit a3afa6f2fb80489f7b6a88d12def09281d32ed94 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jul 30 18:30:37 2008 +0200 EXA: Optimize GXcopy tiled fills. commit 37087bc10630ee7740df1369b3e56a44fd2ad2b0 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jul 30 18:27:33 2008 +0200 EXA: Replace open coded CopyArea logic with GC op call. commit bb2cacd33eb85f39b9e7fa554545611957df677d Author: Xavier Bestel <xavier.bestel@free.fr> Date: Tue Jul 29 13:06:10 2008 -0400 Cosmetic fix to EDID decoding. commit a70754a9fdb019d85fbfca1898699f3c6f609fdd Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Tue Jul 29 14:16:25 2008 +0100 require inputproto 1.9.99.3 commit 591ef3c047ab3597fef9d687205e99c254ff2040 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 29 10:00:01 2008 +0930 Xi: ChangeDeviceControl presence events should set the appropriate devchange. Requires inputproto 1.4.4 or higher. commit 25dd5ce0770c5ff91a79c12223fd4af52759900b Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Jul 28 12:33:58 2008 -0400 Add atKeynames.h in hw/dmx/input and drop evil cross-ddx #include. commit e39a16aa58456aaecee54edc64f189c958db0902 Author: Julien Cristau <jcristau@debian.org> Date: Sat Jul 26 16:35:19 2008 +0200 xfree86: don't output a spurious newline to the log when loading a module commit 2eaed4a10fe5bf727579bca4ab8d4a47c8763a7d Author: Julien Cristau <jcristau@debian.org> Date: Sat Jul 26 15:35:42 2008 +0200 xfree86: use xorg.conf input devices if there is no ServerLayout If xorg.conf has no ServerLayout section, use the first mouse and keyboard sections as core devices, even with AllowEmptyInput. commit 805f28e96ceb20bc53792ae3cf17f9c26564ae0e Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 12:10:52 2008 +0200 some trivial changes regarding C compat, indentation, etc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 3209bd21d00b8673d321f70afb65720588ddacb3 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 12:06:34 2008 +0200 xfree86: perform pointer accel scheme selection by name, not number Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit a17cb29f5acdfcdeac929d8c6be3600d44d038ef Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 12:03:17 2008 +0200 dix: preparation change: make runtime exchange of filter chain safe Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 1a9f9ac50f2b0db735789905cc29572a50c8ae4c Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 11:49:36 2008 +0200 dix: optimize precision in device velocity estimation Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit c184b91d9aa72031c2bac9f379f56633957ded30 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 11:33:25 2008 +0200 dix: improve the driver interface to predictable pointer acceleration Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 87aa5298576ed335ac31347e14fb30430288157a Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 11:28:09 2008 +0200 dix: introduce defines for accel profile numbers Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 4e32e6fb38d19c9993de86188e4f7e7916a028e2 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 11:10:22 2008 +0200 dix: rename classic accel _scheme_ to lightweight to avoid confusion with classic accel _profile_ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit d40183c665d458ac0a6e7952fbe986776a17fda7 Author: Simon Thum <simon.thum@gmx.de> Date: Wed Jul 23 09:28:06 2008 +0200 dix: add legal statements to ptrvelo.{c|h} Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit ec10eccd56be8b947cd63cae0687b8319857fe60 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jul 28 09:33:04 2008 +0200 GLX: Unreference drawables bound to the old context, not the new one. Apart from the obvious reference counting issue, this fixes http://bugs.freedesktop.org/show_bug.cgi?id=16867 . commit 6ab8d6010adfd5ad6f1e1094a26c84f0aff934b1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jul 28 09:32:59 2008 +0200 AIGLX/DRI1: Pay more attention to return value from DRIGetDrawableInfo(). Could have crashed otherwise if the num(Back)ClipRects variables referenced by the caller weren't pre-initialized to 0. commit b3e981c9d4ff31263a43b47f83cf8db4c2b5aeff Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jul 28 09:32:54 2008 +0200 Fix Makefile.am crack. Looks like an artifact from early modularization. commit 3575d9584edf35ec1720bc3755b6576a56613685 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Jul 25 16:46:44 2008 +0930 config: note that HAL options must be strings. Only strings are parsed by the server, all others are ignored. Doesn't matter, specifying int options as strings works fine anyway. commit 54651ff5ec54f4c621e060b19f31d77d519ef158 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 24 17:41:48 2008 +0930 xkb: remove superfluous inputInfo.keyboard treatment. Really not necessary, we can just walk the list and spare us the special treatment of the VCK. commit 70bd8261223366dae9dfdbb999691328d85f093c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 24 17:38:16 2008 +0930 xkb: use PickPointer/PickKeyboard in _XkbLookupAnyDevice. commit 47160edec7f0d9129576d83f1593a5549879a893 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 24 12:12:45 2008 +0930 xfree86: warn some more about potential missing input devices. Put out a warning if xorg.conf has InputDevice sections, but these aren't referenced in the used ServerLayout. This is only performed if AllowEmptyInput is enabled. The reason behind this is that the server used to auto-add the first mouse/keyboard sections if none where referenced. Now, with HAL and AEI enabled by default, setups that relied on this auto-adding break and are left without input devices. The least we can do is warn them. commit f30b0823dbfc5902e54b337b5b6b570ebf216584 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 24 09:56:00 2008 +0930 xfree86: if AllowEmptyInput is on, warn the user that we rely on HAL now. commit ad4cd2e241691427689591f7769a1184c8c1c7f5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 23 17:40:28 2008 +0930 xkb: don't send core events on SlowKeys. Core events don't happen until later in the DIX, so pump device events down instead. This makes modifiers work again when SlowKeys is enabled. commit 7d9dece74fc2bf130ceb8818ced5d9e3ac526900 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 21 22:12:45 2008 +0930 dix: fix up enter/leave system once again. Two corrections 1. the "detail" field has NotifyVirtual, etc., not the "mode" field. This was a clear bug. 2. don't set/unset the flags for NotifyGrab or NotifyUngrab. Clients are expected to deal with multiple enter/leave events per window if the mode is not NotifyNormal. Testable with TCL menu boxes (such as used in gitk): tk_optionMenu .menu globVar Val1 Val2 Val3 ValJunk pack .menu Thanks to Michel Dänzer for pointing this out. commit 2ce434f54bc0d6050ef115e310df62c035e84bf2 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jul 24 18:44:16 2008 -0400 Clean up unused definitions from glx headers. commit ae67508392261ae47858692668a0c192ef4a9d7b Author: Mathieu Bérard <mathieu.berard@crans.org> Date: Fri Jul 25 10:05:30 2008 -0400 Fix AddExtension now that CloseDownProc can be NULL. commit eff25430b4a391409e39337962ff7697165d23c7 Author: Daniel Drake <dsd@laptop.org> Date: Thu Jul 24 21:06:34 2008 -0500 Don't abort if swrast library is not present GLX is enabled by default, but the current swrast behaviour causes X to abort with fatal error if the swrast dri library dlopen fails. Handle the case where the swrast library is not present, and do not register the GLX extension unless at least one screen has a usable GL provider. commit 62b5690415786c4a6e8bac464aa8db578beb74f5 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 24 16:13:10 2008 -0400 Remove some more MEMBUG garbage. commit 036822584b26854e2f486f1bea84d8d19d9324de Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jul 24 16:03:58 2008 -0400 Drop xf86CommonSpecialKey() and atKeynames.h These are AT scancode specific, should really be part of xf86-input-keyboard. Remove from server, move to xf86-input-keyboard. commit f3ff2386016ced7e677817e9761a535f0f385813 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 24 15:28:07 2008 -0400 Sync is built-in and mandatory. commit 3fcf4d3eb89fecaa2be7b5ac4933b693c9c3d97e Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 24 15:09:05 2008 -0400 XC-MISC is built-in and mandatory. commit 9757106bba8f7bea99c5211817fc6b5fde4e6f66 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 24 14:59:14 2008 -0400 Remove all empty extension reset hooks, replace with NULL. commit 6bcde69585fcc8f8dbfe81c115649f19274922fa Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 24 09:13:26 2008 -0400 Allow extension closedown hook to be null. commit f65c50c4e902c7b5619fb7bbee8462434d809ec7 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 24 09:07:42 2008 -0400 Bigreqs are built-in and mandatory. commit d6228cb22aa89b90834d80d98b91862c1fc01b54 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 24 09:00:22 2008 -0400 Shape extension is built-in and mandatory. commit 990fc643ae90c034187707e7de414d80640ec6da Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jul 24 15:02:40 2008 -0400 Ugh, remove trailing backslash. commit 806e8cf3c01f955411445a7095f0957ea9a9b22a Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jul 24 14:25:24 2008 -0400 Remove SPARC muldiv code. Was used by ELF loader, which is no more. commit dff1a609bb4c0171e2abb92b54c16e739aec9ca2 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Jul 21 18:29:08 2008 -0400 Drop the glx resize hook and stop chaining PositionWindow. commit 24dddcd0ef845f4120f8588dc63ec754338ffac8 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Jul 21 18:16:38 2008 -0400 Drop unnecessary linked list of contexts from GLXDrawable. commit 5c1e254cc85e9ad409b0217780545c29f62d5feb Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 24 03:01:45 2008 +0300 Remove xorgcfg Us shipping a GUI configuration utility (especially as part of the server!) was pretty pointless. There was pretty much nothing it could configure which wasn't already runtime adjustable: if you could get a server up with functioning input and output, there wasn't much xorgcfg could do for you. Au revoir. commit b74927c3844bc2650d95f604fe782d95ade067f1 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 24 02:42:13 2008 +0300 Remove ioport I don't know why we would possibly be shipping this. commit 8c0518379089d230060e9ff672ba5eba34198325 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 24 02:40:02 2008 +0300 Remove kbd_mode We only built this on BSD and Solaris, and if such a tool is generally useful, ship it with the OS. commit 0d785bd635d135fcd67b4c9c88f5c8217e9b9240 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 13:43:09 2008 -0400 Unifdef hpux. commit 5035741fd4cb4918957064a8c9ded9c7c31b4e22 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 13:38:38 2008 -0400 Unifdef __osf__ commit bd8bd2c700e6ccac53b47c45766c0a3a08a59344 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 13:36:35 2008 -0400 Unifdef AIX. commit 5f5eed7f790db2f0ae0cd0f5c5ee5a312079c0b0 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 13:27:24 2008 -0400 Unifdef DGUX. commit 856db05b58b71c5ff22af727aba435a8c356abfa Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 13:25:37 2008 -0400 Unifdef sgi. commit ab6557fcd4bb4fd580bb1727dc8764f7dfb2cb30 Author: James Cloos <cloos@jhcloos.com> Date: Wed Jul 23 13:17:33 2008 -0400 Optimize commit 331cc3f0799a54910a99484264f76569beeee55a Reorder to minimize comparisons commit b699364b1c807d29666633523f5b5a608a07a8ee Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 11:43:59 2008 -0400 Unifdef VXWORKS. commit 2e3c43d306616f8accdeaffec9c108ba88324805 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 11:35:06 2008 -0400 Assume __GNUC__ >= 3. gcc 3.0 was seven years ago. Get with the times. commit 0c1c9d75089aac0cf673820db83801d3cab5bfc7 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 09:11:40 2008 -0400 Remove some broken debugging scaffolding. commit 0ff5bc404842f7264a8e77f9e2a0bd8d0b051356 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 23 09:09:11 2008 -0400 Unifdef QNX. Again, hasn't worked since at least 7.0. commit 331cc3f0799a54910a99484264f76569beeee55a Author: James Cloos <cloos@jhcloos.com> Date: Wed Jul 23 00:01:43 2008 -0400 Fix LookupColor Using strncasecmp(3) with the lenght of the user-supplied colour name will result in a false positive when the db key starts out with the same string. Eg, blue will also match BlueViolet (aka blue violet). Since the shorter strings occur first in the database, avoid such errors by treating a 0 result from strncasecmp(3) as a positive result when the key’s length is longer than the supplied string’s. commit bc3c03a3f3c091026310f0e8d55321cec570a0c5 Author: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Date: Tue Jul 22 17:34:37 2008 -0700 Don't return BadAlloc when trying to set a PictureFilter with no parameters when a filter with parameters was previously set. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit 92fdd01d8e46dd4b41338754e1a34e9d3c387d4a Author: Dodji Seketeli <dodji@seketeli.org> Date: Wed Jul 23 01:07:29 2008 +0200 [Xephyr] various X86_64 build cleanups commit 5de1867fbb0a336ff3fdc92cbf734849f6111b1b Author: Dodji Seketeli <dodji@seketeli.org> Date: Wed Jul 23 01:00:26 2008 +0200 [Xephyr] Fix #15839 Make sure the _XSERVER64 macro is not defined in Xlib client code. That macro is meant to be define only on pure server code, when necessary. commit d692e1a63e4718d3b6d486582c19f30259b813a7 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jul 22 10:21:22 2008 -0400 Build fix. commit d8937ce58137ad675f1ead8f2345eaed0ca63c8a Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jul 22 16:52:50 2008 +0300 autogen.sh: Pass --force to autoreconf Ensure we get all files installed when running autoreconf by passing --force to overwrite previously-generated ones, which fixes running it from tarballs. Also revert Peter's local changes to pass arguments to configure, all of which are the default now anyway, AIUI. commit 880625eef5d8b168df3e42836fa1b763c51a91b5 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 22 14:34:28 2008 +0930 xfree86: plug memory leak, free driver's private data when deleting the device. commit 67d7821ae783d3f123b6ba7203abf847374a1e36 Author: Keith Packard <keithp@keithp.com> Date: Mon Jul 21 11:48:24 2008 -0700 dix: reset potential lastSlaves when disabling an SD Unplug a mouse, then warp the pointer and the warp pointer code will try to update the position of the last slave device associated with the master. That pointer will be stale and the X server will crash. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 8c8c4fdf34bfc9d54ebea99fb0af14cad167b4a0 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jul 21 16:39:43 2008 -0400 EDID: Various reduced blanking fixes. - Use a single common function to compute reducedness. - Call it from both the old-school and new-school mode validation paths. - Define monitor reduced-blanking support in accord with EDID 1.4. - Attempt to filter RB DMT modes away from the "standard" EDID pool if the monitor doesn't claim RB support. commit e8cd77e14d3fa40e5cf1174acaf925362b2e0a11 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jul 21 16:15:03 2008 -0400 EDID: For standard timing blocks, prefer DMT timings if they exist. commit 6ba70091e2325f534a37ef185fea568d2c43edec Author: Adam Jackson <ajax@redhat.com> Date: Mon Jul 21 15:40:34 2008 -0400 EDID: Correct DDCEstablishedModes to conform to DMT. commit facb255fa9267e343cbc91f841f1b64e5dc99e98 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Jul 21 16:05:53 2008 -0400 Need to unref pixmaps backing pbuffers too. commit d5ae85b5b722821499d5796cf0973ecb6ec125f1 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Jul 21 15:28:50 2008 -0400 Fix embarrasing GLXPixmap leak. commit c74ddc87c995c73109827717a49f14846c7c4024 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jul 21 15:10:20 2008 -0400 EDID: Add quirk to clamp max pixel clock to single DVI link speed. On some panels you end up with all of: - No range descriptor - No description of physical connectivity - Native panel size mode in standard timings list In principle you're supposed to use the timings for that mode from the DMT spec, but in practice the DMT spec has timings for both 1920x1200 normal and 1920x1200RB, and the standard timing field gives you no way to distinguish. And, of course, the non-RB timings don't fit in a single DVI link. commit 55803473adb0a0975fea81035402bf6b4ec0e30b Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Mon Jul 21 10:32:57 2008 +0100 Bump inputproto to 1.9.99.2 for XI_PROP_ENABLED commit 69de40ee45a6e046be79b735cd1540f63b87aee9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 21 17:05:04 2008 +0930 dix: shift the duplicate button mapping check to ProcSetPointerMapping. XI 2 allows two buttons to have the same button code. commit 0dbfe0ebc69c307c0626ba824de15d03de1251d4 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Jul 21 03:50:15 2008 +0300 Revert "Try nvidia before nv under the assumption that people who install it usually want to *use* it, too." Per mailing list discussion. This reverts commit 66fb253082ea42179180303393e48846208987fa. commit 6b5206e7cb8e5279816b48f014d47d3f03f16972 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 18 15:38:10 2008 +0300 dix: Remove insane BC hacks If your DDX needs a 1bpp mode and doesn't set it up, your DDX is incompetent. commit 66fb253082ea42179180303393e48846208987fa Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Jul 8 02:39:00 2008 -0700 Try nvidia before nv under the assumption that people who install it usually want to *use* it, too. commit 376620460ec50cb98a1e3746629b7f73c2e926d7 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jul 20 16:53:01 2008 +0200 Drop some more configure-generated files from the tarball commit 35346a42271dfe65fe0a86dc522701028bf6daf6 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jul 20 16:40:59 2008 +0200 Don't put xf86Build.h in the tarball (bug#9277) This file is generated by configure, we don't need to ship a stale version in the tarball. X.Org bug#9277 <https://bugs.freedesktop.org/show_bug.cgi?id=9277> commit 43c6d5a6f83dfdf8596c8d0faf8ac1a64f73a8c1 Author: Julien Cristau <jcristau@debian.org> Date: Sun Jul 20 16:30:24 2008 +0200 distcheck fixes Still seems to fail because hw/xquartz has too long filenames commit 92b0a04ffd630a89705fc73d587182a62c34cd84 Author: James Cloos <cloos@jhcloos.com> Date: Sat Jul 19 18:21:37 2008 -0400 Fix compile failure This fixes a compile failure by ensuring that mouse-cfg.c can see the MTYPE_ constants. commit 0b45ba488d8a3e901b83e445d17e7e9a67047b6c Author: Adam Jackson <ajax@redhat.com> Date: Fri Jul 18 10:54:10 2008 -0400 Drop the FONTCACHE extension. This appears to have been dead code since X-TT was merged. commit b85392e66b4cbfcc95897ac342f19ac8ab04d4cc Author: Søren Sandmann <sandmann@redhat.com> Date: Thu Jul 17 23:10:11 2008 -0400 Give priority to clients that are receiving expose and configure events commit 3b687ffe1649449b3d182f5e7690274c6c96916a Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jul 17 18:16:59 2008 -0700 Make xstrcasestr prototype return value match the implementation commit f7bfa4ae971b43c3ed81cc84e6d1e071c413f04c Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 23:03:57 2008 +0300 configure.ac: Remove non-existant directory Oops. commit 16e40ecf43ea7df349e54f757db0223764d752ee Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 22:37:31 2008 +0300 Remove dead code, useless #defines, et al commit b0a99fb02bb7290266d7dddee4de0b9959fb3c52 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 21:42:17 2008 +0300 configure.ac: Fix release date Instead of putting something that's always wrong, at least just put unreleased, which will be more obviously wrong if it's, well, in a release. commit 711720650cc192022f0d91f5cf94292d48dbc891 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 21:39:46 2008 +0300 Everyone has urandom If you don't have urandom, please just add a fallback to /dev/random, rather than building our own random generator. commit 446fe9eecddd1337f9d5164dd7c301e1ba3dfe32 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 21:37:50 2008 +0300 Dead code removal Remove a whole bunch of code that was never built, be it entire files or just dead ifdefs. commit 0564b5454ac101d9e1218767bbbc2c2d9f3e0696 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 20:46:27 2008 +0300 XFree86: Restore AllowMouseOpenFail usage text This was incorrectly stuck behind the XFree86-Misc define, so got deleted with the rest of misc: restore it unconditionally, as it should be. commit 6c7c0ffeb71610ee00fc92b32fd2b1cc70383e38 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 20:45:01 2008 +0300 KDrive: Delete rafts of unused code Most of this stuff was gone with the last real hardware drivers that used it. Au revoir. commit ad7a7ae290b05f007062161418c929d9cebeef78 Author: Julien Cristau <jcristau@debian.org> Date: Thu Jul 17 18:51:05 2008 +0200 XF86BigFont is disabled by default 3c19ec47b434d4ca84db58363cc053cc0b6aa413 did that, but pretended to make it 'auto'. commit 058100fd19ed33a3100d18a9ca56fdcffac361b2 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jul 17 09:35:30 2008 -0700 Remove more Lynx leftovers A couple #if defined(Lynx) && defined(sun) had become just if defined(sun), resulting in wrong settings for Solaris builds, so they're now just deleted. commit 47833eef35b20a2eb0a74782edbb0877fd491c4c Author: Mathieu Bérard <mathieu.berard@crans.org> Date: Thu Jul 17 11:59:24 2008 -0400 Drop a bunch of #ifdef Lynx. commit af2138bfce34a28312b26106eaf9561d96712ee0 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 17 10:39:29 2008 -0400 Nuke some ancient code for commandline-challenged OSes. This appears to have been dead code even in 6.7. commit b9a0cee026361189dce63b87c738bd1d17e02830 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 17 10:32:35 2008 -0400 Drop hw/xfree86/os-support/lynxos/ This has never worked in any modular release, clearly no one cares. commit d87f170bd99f7908eb14272ac42c8963d089f54f Author: Adam Jackson <ajax@redhat.com> Date: Thu Jul 17 10:29:52 2008 -0400 Remove XF86Misc code from xorgcfg. commit e3ff8501749209ee2dd324d35ae16e37510e0574 Author: Jie Luo <clotho67@gmail.com> Date: Thu Jul 17 10:27:24 2008 -0400 Remove duplicate load of freetype font renderer. libXfont will do this for us in FontFileRegisterFpeFunctions. commit 8441e26266701776f1416bec864ae2949355da76 Author: Jie Luo <clotho67@gmail.com> Date: Thu Jul 17 10:23:37 2008 -0400 Remove freetype from the list of autoloaded modules. commit 5d11ae7a69e3a7611c667be4628a15a4b514f72c Author: Jie Luo <clotho67@gmail.com> Date: Thu Jul 17 10:22:29 2008 -0400 Fix color lookup. OsStrCaseCmp returned inverted comparison sense from normal strcasecmp. commit 478d3918d5b23fba1a7e3aaea766dfa785e5a0a6 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 17 03:29:26 2008 +0300 XFree86: Remove remnants of XFree86-Misc HandleMessage: dear god, no. commit 95000e34df9ba066905430eb0eb39a616567183e Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 16 16:37:14 2008 -0400 Build fixes commit affec10635343668839994ea2bac16c1d4524200 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 16 14:44:33 2008 -0400 Remove loadable font renderer support. commit acc91054316208844742495dea0b80a860ef02bb Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 16 14:24:47 2008 -0400 Remove font module support from xorgcfg. commit a82e6efb7b9b2ab9a1597b002f375c5ee105e7f5 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 16 14:19:04 2008 -0400 Remove the numVideoScreens xprintism. This was to account for cases where you had video and print screens in the same server. Lunacy. Leave the slot in ScreenInfo, but rename it, and stop looking at it. commit 1a573e402ec112913a404f092b5b97d8d9210f94 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 16 13:41:53 2008 -0400 Update the Allow*Grabs documentation for xf86misc removal. The API to turn the grab-break keys back off is gone now, so don't say it exists. commit 55644d2f1cddf1777587f213ed581b6087d9fdad Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 14:23:34 2008 +0300 Make --enable-debug usable again Enable region debugging causes assertion failures (should really look into that, though), and I don't need four messages every time I move my pointer. commit 22e64108ec63ba77779891f8df237913ef9ca731 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 06:25:26 2008 +0300 XFree86: Remove XFree86-Misc extension Its last remaining purpose in life has been destroyed by input properties. Au revoir: it's been fun, by which I mean awful. commit b8dd07f855c555af56cbf0f69df799f424da2cca Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 03:00:25 2008 +0300 HAL: Remove grotesque open-coded strcasestr Not only was this pretty ugly, but it didn't even work on systems without strcasestr anyway, due to the define not being in dix-config.h. Lack of strcasestr is handled transparently with the version from FreeBSD now anyway, so, huzzah. commit ad87c72edcc0d1f56658e0c4e73af335c8d5a516 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 02:59:51 2008 +0300 DIX: Add strcasestr from FreeBSD Add strcasestr for use on systems which don't have it. commit c3c901cf44cf16bb33c4176494361b429099a372 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 02:54:41 2008 +0300 configure.ac: Fix SHA1 handling Fix and marginally simplify the SHA1 handling. First, we allow people to override it. Secondly, we try for libmd. Then, we try for OpenSSL with pkg-config. In a last, desperate move, we try libcrypto on its own. This allows the server to, y'know, _link_ when using OpenSSL, instead of failing because we only have -lcrypto, and not -lssl. commit 69b57dc651e12a0d9a5a4295b185c62d5c0df63f Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 02:03:36 2008 +0300 dix: Actually build str(n)casecmp if we don't have it Remember to add stuff to dix-config.h when you add new AC_DEFINES, people ... commit dcf6293030126509d7d6c61d131222037d5ed7db Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 01:57:00 2008 +0300 strcasecmp: Actually use the right license Forgot to update the license when I committed the FreeBSD version, so it still had an old SGI license. Sorry. Sorry. commit 441f084bfe87a6ea1c94ec63f82888b8b3d81d89 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 2 19:52:58 2008 +0300 config: Don't attempt to use D-Bus when not strictly necessary If we have D-Bus but have explicitly disabled it, don't build it. commit 35c89f3f5b8fa222e37b799d5bb01595e8f30d0c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 16 01:43:58 2008 +0300 XFree86: Remove mysticism from Makefile.am The variables were always the same, so just shove them in with the rest of the plebs. commit b89a59248a4a0ff06b9a0ddee45881efc6063063 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jun 27 12:20:56 2008 +0300 XFree86: Delete OSMouse code This should be moved into the mouse driver, if anything. commit d0de5ea96d084fc5da87d8f323ddfc08fe9c03ba Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jun 25 17:56:28 2008 +0300 XFree86: Remove useless debugging code Also remove documentation which told you how to use a non-module-aware GDB, albeit only with old, non-shared, modules. commit 4b1273c9c2da113f634be80caa28e81df3beae98 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jun 25 17:51:12 2008 +0300 XFree86: Delete empty file & function xf86InitXkb() has been empty for as long as I can remember. commit 3a54f3f48fa1c0d60604c3ee767c569b5ec23430 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 12 01:05:04 2008 +0300 XFree86: Clean up init a tiny bit (no code changes) Reshuffle and delete. commit ddcefb50dda9e398647d1c84c7153127ed26a4d2 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jun 11 15:14:26 2008 +0300 XFree86: Remove trailing whitespace commit e6f35f28fb3526b911101bde4aa761de8b055aef Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jun 11 15:13:21 2008 +0300 OS/KDrive/XFree86: Sanitise colour initialisation OsInitColors always just returned TRUE, so just remove calls to it and insane special-case logic. Remove unused kcolor.c implementation, and merge oscolor.h into oscolor.c since it was the only user. Remove open-coded strncasecmp in oscolor.c. Since we no longer need to call OsInitColors after reading the config file, just call PostConfigInit() from one place, and move PM handling to one place so we can install the signal handlers earlier. commit 11f9e3520249a603b95e64503ee759998ff17feb Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jun 11 15:09:46 2008 +0300 DIX: Add strncasecmp from FreeBSD, make strcasecmp args const Add strncasecmp (as we're now using it) in case someone doesn't have it, and also change strncasecmp args to be const, in accordance with everything else. commit ae38151ddda9984effca5bb7c582540061201dce Author: Daniel Stone <daniel@fooishbar.org> Date: Mon May 19 08:35:05 2008 +0300 configure.ac: Add GLX_SYS_LIBS for Xvfb and Xnest This fixes the linking for these two when using DRI2, which requires DLOPEN_LIBS. commit ccec16e519c143f4c0017a37e93ebc52ac472e4e Author: Adam Jackson <ajax@redhat.com> Date: Tue Jul 15 11:24:08 2008 -0400 Bug #7300: Move xf86RAC to hw/xfree86/common commit 9111944b292355f7478b4ae75bead8dc25edbbcb Author: Julien Cristau <jcristau@debian.org> Date: Tue Jul 15 10:36:38 2008 -0400 Bug #16674: Make sure RANDR reports refresh as 0 if pixel clock is 0. commit 3f3f66de669caf3606eec8c5f8d405a283cbf12d Author: Brad Smith <brad@comstyle.com> Date: Mon Jul 14 22:20:41 2008 +0200 Fix the configure tests for swap16/__swap16 macros on OpenBSD. BSD systems need <sys/types.h> included before <sys/endian.h> for macros to work. <https://bugs.freedesktop.org/show_bug.cgi?id=16531> commit 11ee0ae9390a608a232ff94abcc0cbcf9ed7b70a Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 14 10:20:11 2008 +0930 xfree86: append, not prepent, new input devices to xf86InputDevs. If devices are prepended to the list, their wake-up order on resume is not the same as the original initialisation order. Hot-plugged devices, originally inited last, are re-enabled before the xorg.conf devices and in some cases may steal the device files. Result: we have different devices before and after suspend/resume. RedHat Bug 439386 <https://bugzilla.redhat.com/show_bug.cgi?id=439386> commit 5bcc45e07e8726a5442567472dd29cfb5c901f2d Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jul 13 18:40:53 2008 +0930 Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property. commit c9eb0e870c87d291311491452adf7f91a911e24b Author: Simon Thum <simon.thum@gmx.de> Date: Thu Jul 10 22:33:39 2008 +0930 Add support for multiple pointer acceleration schemes. #8583 Available acceleration schemes: - xorg classic scheme. - the new "Predictable" polynomial accel scheme. X.Org Bug 8583 <http://bugs.freedesktop.org/show_bug.cgi?id=8583> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e7abe1676a6a4e4249504b8c9660cbad70569199 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jul 13 18:41:53 2008 +0930 Xi: protect against NULL handlers, don't try to dereference. commit 2bbb12c355308d10bf123911044fbdf6ae7fb59c Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Sun Jul 13 20:23:14 2008 +0930 Xi: remove ChangeDeviceControl for CoreCtl. If you want to set a device to core, attach it to a master device. commit 18ff17756c988b6c21b76bf898e45685649d07bb Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 10 19:23:14 2008 +0930 Xi: GetDeviceProperty reply includes deviceid. commit c3267106fb599213555829cb76df7848c4ebe23b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jul 9 10:02:41 2008 -0700 XQuartz: Use CFEqual to compare keyboards (cherry picked from commit 5538e43b9ae7d06d2f48842b065810ce74286eb6) commit 90dd2de845ae12153296f6f1bff0c87f79c57854 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Jul 7 10:55:58 2008 -0700 XQuartz: Some fd handoff cleanup. (cherry picked from commit 9c20a4804d97e67a988f00f49866997209cce518) commit 26d8030c3836816de8c12b2cb9d67315e5c887eb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Jul 4 19:23:21 2008 -0700 XQuartz: Remove deprecated keyboard code. (cherry picked from commit 69cfc1a21e12bb38a6130dea2e5f20f1e6a3ee7c) commit 5cfcbd54d98cc77ee02a3a099ebbad9af511a0ee Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jul 2 00:47:08 2008 -0700 Set machine dependent defaults for ppc64 (cherry picked from commit 0733ef2e8abda99cfd62966e73017949e9cd507f) commit e69b9f9ca45c0c6bfb93ea9143737116bf1f2453 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jun 25 11:51:27 2008 -0700 XQuartz: Set noPanoramixExtension earlier to avoid a possible race. (cherry picked from commit 49668e8a88137e9f258eae970826883b88b7d8ba) commit 8d2e2e1d856efec4459de2a20af642dc1ec9b8a5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jun 11 11:44:45 2008 -0700 Xquartz: Removed include directive for removed header (cherry picked from commit e65a36d57f338410c5a5b02cb5ae1214a81d072d) commit ebd70c82fdbe483d149ac9bdb5a64cc6e0c10e0a Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jul 10 14:38:34 2008 -0700 Add LoaderShouldIgnoreABI to allow drivers that roll their own ABI checks (i.e. nvidia) to perform the check before ScreenInit. commit c42427f63f0e0495e56909ee99ad1e3c4321c39b Author: Ander Conselvan de Oliveira <ander@mandriva.com.br> Date: Wed Jul 9 10:50:21 2008 -0300 Fix incorrect test regarding keyboard map. In the map stored in each keyboard device, the first line refers to minimum keycode, i.e., the 0th line refers to keycode 8. When not using XKB the wrong test caused some keys to be interpreted as locks ('m' for instance). The had to be pressed twice to generate both KeyPress and KeyRelease events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit e4054e5cb3d919dfc83021be3f2b9036d0e5a2be Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 10 11:03:31 2008 +0930 Xi: pack the property stuff into a struct, make handlers a linked list. We may need more than one handler to deal with a property (e.g. one in the driver, one in the DIX), so get the handlers into a linked list and call them one-by-one. This is of course slightly less entertaining than the hilarious WRAP/UNWRAP game we play in other parts of the server. XIRegisterPropertyHandler/XIUnregisterPropertyHandler are the interface drivers/the DIX should use to attach themselves to the device. XIDeleteAllDeviceProperties destroys everything, including the handlers. commit 2039c6ea43244339659323d05d96c14e41996c20 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 7 22:10:17 2008 +0930 Xi: add support for input device properties. Basically just copied from randr properties, with minor changes only. Each device supports arbitrary properties that can be modified by clients. Modifications to the properties are passed to the driver (if applicable) and can then affect the configuration of the device. Note that device properties are limited to a specific device. A property set on a slave device does not migrate to the master. commit 4ab01fe5db7fb330b1ec463aa49b77859527e597 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Thu Jul 10 16:27:36 2008 +0930 Revert "Xi: add support for input device properties." Note to self: don't mix up branches with half-finished cherrypicks. This reverts commit 666838fcc8b71fdeae160844160187f345cbf4a6. commit 666838fcc8b71fdeae160844160187f345cbf4a6 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Jul 7 22:10:17 2008 +0930 Xi: add support for input device properties. Basically just copied from randr properties, with minor changes only. Each device supports arbitrary properties that can be modified by clients. Modifications to the properties are passed to the driver (if applicable) and can then affect the configuration of the device. Note that device properties are limited to a specific device. A property set on a slave device does not migrate to the master. commit acce27093571497a0626cee1cdb61ddf751dbc40 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 8 16:02:13 2008 +0930 Xext: store the GenericMasks in the resource system. This fixes a severe issue - when the client died the event mask didn't get unregistered and a future event would dereference dangling pointers. By storing the event masks in the resource system we can free them when the client dies. commit db86b8839f286e0e2efb5638b8ab2fe608707655 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 8 15:12:45 2008 +0930 dix: free GenericMask allocations when destroying window. commit 08e2c625f620688d35f3b443ffb878e8e991ff57 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jul 9 20:07:59 2008 -0700 Remove README.font, since it's just an old text copy of xorg-docs/sgml/fonts commit 5e847c1d4fc30a0d263a861a76982660f11998cd Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jul 7 17:08:01 2008 -0700 Improved driver selection when autoconfiguring driver without xorg.conf - Allow returning multiple drivers to try for a given PCI id (for instance, try "geode" then "amd" for AMD Geode hardware) - On Solaris, use VIS_GETIDENTIFIER ioctl as well as PCI id to choose drivers - Use wsfb instead of fbdev as a fallback on non-Linux SPARC platforms commit 235fea0e1a2101fb76a54e6505db321674530c60 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jul 7 15:21:59 2008 -0700 Update bsd & solaris descriptions in README.OS-lib commit d8af9d9ab1cd98c07fdf42490dcc0cab3c655b89 Author: Julien Cristau <jcristau@debian.org> Date: Mon Jul 7 13:14:49 2008 +0200 Export xkbfile.h in the SDK It's needed by xkbsrv.h commit d78bebb20a00e8519788c75c90b467a5750c78be Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Fri Jul 4 04:04:19 2008 -0300 Remove unused function and variables. commit a8c4727f01949da0ae266369f0d12a96c2bf0da5 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Fri Jul 4 04:03:46 2008 -0300 Fix typo in the last commit. commit 3164288b121990a5990747c0f92d4af13b1c929a Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Fri Jul 4 03:55:59 2008 -0300 Remove deprecated function miPointerPosition(). commit d1031a8972490ebf0ef6dc2762036a7a7172466b Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Fri Jul 4 03:46:21 2008 -0300 Update README.OS-lib to reflect reality. commit f72500c4a09cce5dbbd16639b1951a4bf943e4ac Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Fri Jul 4 03:45:18 2008 -0300 Nuke libc wrapper remaining stuffs. commit 3fd5fab5663fbdce2fc0b5377155aedf9a70b6c2 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Fri Jul 4 02:51:42 2008 -0300 Remove inexistent function headers. commit 0b9ef835a0fe900c121b84e43989591e58ab1126 Author: Dave Airlie <airlied@redhat.com> Date: Fri Jul 4 07:29:32 2008 +1000 modes: fix initial xorg.conf mode selection. This was all kinds of broken, we ignored user preferred modes for multiple monitors and also for side-by-side configurations. commit e317943c125d7fdbe62c750324640eb30c88fa15 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Jul 2 12:23:03 2008 +0930 xfree86: AllowEmptyInput is now enabled by default if hotplugging is enabled. Remove AEI check from configImpliedLayout as the setting isn't actually parsed at this point anyway (written by Sasha Hlusiak). Resurrect checkInput() and check for devices there if AEI is false (this also creates the default devices if required). Set AllowEmptyInput to enabled by default if hotplugging is enabled. commit fe5cf7cb00fd926cefff933adbdbceea7353f4c2 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue Jul 1 13:18:54 2008 +0930 xfree86: handle missing Screen lines in the ServerLayout #16301 If no Screen is specified in the ServerLayout section, either take the first one from the config file or autogenerate a default screen. X.Org Bug 16301 <http://bugs.freedesktop.org/show_bug.cgi?id=16301> commit 6674b87a7dca7d6ffd9dd9af888c5256b13d7877 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 29 20:05:27 2008 +0930 xfree86: move declaration of configured_device to start of function. Last I checked C doesn't allow declarations halfway down a block. commit 1e96782011f0b4ba6ed1d3d3df118964a58d15fd Author: Dave Airlie <airlied@linux.ie> Date: Thu Jul 3 20:00:22 2008 +1000 dri2: bump libdrm numbers as 2.3.1 is released without ttm interface commit 1771edcb44b564f83f509748b4e4cd5b7586e2a8 Author: Dave Airlie <airlied@redhat.com> Date: Thu Jul 3 18:57:09 2008 +1000 modes: check the crtc is valid before using its desired modes. this fixes a crash I was getting on radeon rotate when gnome is running. I'm sure g-s-d was doing something bad, but really not crashing ftw. commit 689292e58cc5242cbfeaa29fcf65b6dcd9dfabb9 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jul 2 11:25:50 2008 -0400 Fix GLX in Xvfb and kdrive. commit 9a73bca859be12721ef62304b1422c455d4aec49 Author: Chris Ball <cjb@laptop.org> Date: Wed Jul 2 09:46:06 2008 -0400 Remove KdOffscreenMarkUsed() as all its callers are gone. commit b84a27fd9fdcb579437cfa38f10cb12cf55dc7c3 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jul 2 06:25:03 2008 -0700 VBO: Regenerate files based on recent changes to gl_API.xml Since GL_ARB_vertex_buffer_object protocol isn't supported yet, these changes are innocuous. commit 703a9645f3d547144ea62dd81c41f5356a5f87d8 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jul 1 17:50:48 2008 -0400 Auf wiedersehen, KAA. commit c8216aede6c4ac41976947521d884fa010913204 Author: Jeremy Uejio <jeremy.uejio@sun.com> Date: Tue Jul 1 13:37:12 2008 -0700 Sun bug #6685465: Xephyr uses wrong or bad colortable in 8-bit mode <http://bugs.opensolaris.org/view_bug.do?bug_id=6685465> This bug is caused by Xephyr not handling the RGB byte order correctly of the server where Xephyr is displaying on. The previous code just assumed that the order was RGB and did not take into account that Xservers may use different order (such as BGR). The fix is to add a function to calculate the byte order and bits to shift based on the visual mask and the visual bits_per_rgb (which is usually 8, but could be server dependent). Since the shifts won't change once the display connection has been made, I can cache these values so that Xephyr doesn't have to keep recalculating them everytime it tries to translate the Xephyr colormap entries for Xephyr clients to the actual server colormap entries (i.e. calling the function hostx_set_cmap_entry() repeatedly for every colormap entry). commit 2e8daee05343b2853b677acf4554def0ceeada00 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Jun 30 17:29:35 2008 -0700 Work around the DIX losing mmWidth/mmHeight for RandR 1.1 DDXen. RandR 1.1 has a physical size for each mode. It used to be that the DIX would remember these modes and pass them back up to the DDX when changing the screen configuration. The DDX uses RR_GET_MODE_MM to query the driver for the physical dimensions of the screen, allowing it to preserve the DPI. With RandR 1.2, the physical dimensions are stored as part of the output, rather than per mode. The DIX only uses the sizes passed in from the DDX to select the mode pool for the "default" output, and forgets the physical sizes. Then, when reconfiguring the screen, it makes up a new RRScreenSizeRec using the dimensions from the output, screwing up the DPI. This change works around this problem by ignoring the DIX and querying the real size from the driver. commit e2bbf2d248a2d2a2db4adfe9d1bda94cf184d8bd Author: Adam Jackson <ajax@redhat.com> Date: Tue Jul 1 12:01:56 2008 -0400 Don't try to load DRI2 if built without it. commit 66d7c9de82b5e733e4995f079a96efe612fca881 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jul 1 10:55:54 2008 -0400 Declare xf86InterpretEEDID() properly. commit e4335e876d254e446a965259e845ad955da5b5c2 Author: root <root@samich.home.cworth.org> Date: Mon Jun 30 15:29:04 2008 -0700 Revert "XInput ABI is 2.1, not 3.1." This reverts commit 76576c87b0de106e006d1cfa59d42d3a483e966c. which was an incorrect revert of previous ABI bumps. Those responsible for the accidental ABI bumps in both directions have all been sacked. This allows xf86-input-mouse to build again, for example. commit 6447f80c17077f924b2d58e07b38d32429edcb9b Author: Carl Worth <cworth@samich.home.cworth.org> Date: Mon Jun 30 13:16:49 2008 -0700 Use AC_CHECK_LIB before PKG_CHECK_MODULES for openssl Previously, the code was using PKG_CHECK_EXISTS before PKG_CHECK_MODULES, (to cater to OpenBSD systems that include openssl by default but without a .pc file). But this meant that systems that didn't have openssl installed at all would not get any error message at configure time. Now, if the SHA1_Init function is found in -lcrypto without any additional flags, then that's used. Otherwise, pkg-config is used to find the right flags to link against libcrypto. And if that fails, a nice error message is now generated. commit 76576c87b0de106e006d1cfa59d42d3a483e966c Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 30 16:10:37 2008 -0400 XInput ABI is 2.1, not 3.1. commit bed12dd3df0129b7f28d0a42d470266bd3ae6b38 Author: Adam Jackson <ajax@redhat.com> Date: Sat Jun 21 16:07:54 2008 -0400 Do EEDID in RANDR 1.2. commit 4fc18b5fc31aa287e807ee520dc9117296e3d306 Author: Adam Jackson <ajax@redhat.com> Date: Sat Jun 21 16:07:36 2008 -0400 Hexdump the whole EDID block if extensions present. commit b4fbc31e109f1efe78613597f9a91d5363523493 Author: Adam Jackson <ajax@redhat.com> Date: Sat Jun 21 16:00:05 2008 -0400 Actually fetch all blocks of EEDID if asked to. commit 9c4c323d50bd8b369e82a1dff28abdc15a219a5e Author: Thomas Hellstrom <thomas-at-tungstengraphics.com> Date: Mon Jun 30 18:59:13 2008 +0100 Avoid an EXA init segfault. Don't allocate each VRAM buffer with a 16MB alignment. commit 211e2bdcc677122145998829a7f26610c7c567e6 Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 30 10:29:17 2008 -0400 Bump ABI minor numbers for the devPrivate ABI functions. commit d6b8d9eaffaf3f976db330bc35da3d30eb656bac Author: Dan Nicholson <dbn.lists@gmail.com> Date: Fri Jun 27 17:16:35 2008 -0700 DRI: Ensure we have the DRI headers from Mesa Change the DRI configure check to look for the dri pkg-config file. This prevents people who built an Xlib libGL from bombing later in the build. commit 7ddfb2f1587da3ec1cd27ae270e42700adf4f560 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 26 21:23:31 2008 -0400 Fix a leak of window devPrivates in window.c/CrushTree(). commit a65888d6785934a669ad3b822bf2d636db351858 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Fri Jun 27 17:32:28 2008 +0100 fixes for gallium stride changes commit e0c43fff3208350995c45604624dd4825f40598c Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Fri Jun 27 09:46:24 2008 +0100 More error checking commit 387ec961f2a5e791fd010906a5115cf8393471f3 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Jun 26 23:34:51 2008 +0100 add --with-gallium-dir to specify location of gallium tree commit 410b0a4254ca48548b443c1e8fbbcf7a6b9aa862 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Jun 26 22:49:33 2008 +0100 NULL checks commit 621fa337fb53d535f53cec30bb7161801001bb7f Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Jun 26 22:47:20 2008 +0100 Fix copy surface commit ccd0c76472a7d8a85aed0ea6fea4011109f305d6 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Jun 26 22:27:44 2008 +0100 Add EXA winsys for gallium pipe driver interface. Plug in the EXA framework into the pipe driver for surface_copy & surface_fill. Back pixmaps with drmBO's including the front buffer. commit 0e1aa03708d95cc1542bee31709a345d0f748f0c Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Jun 26 22:27:14 2008 +0100 yet more commit 2b3a3bc9202f4e6f9886a08a4dfa597a83a5e933 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Jun 26 22:26:16 2008 +0100 more formatting fixes commit 2a45c28712a544c6f1c3eb753678ba1738cfdd67 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Jun 26 22:25:17 2008 +0100 formatting fixes commit 15e4b6c57484b6afb790c7dc1db9f529ba2219cf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 24 13:46:40 2008 +0930 input: for non-device events (e.g. DevicePresence) use MAX_DEVICES as id. Using id = 0 only worked pre-MPX since XInput didn't allow XOpenDevice for the core devices (0 and 1). Now we can now legally register for events so we may overwrite our device-independent classes with the ones selected for the VCP. So, increase the EMASKSIZE to MAX_DEVICES + 1 and use MAX_DEVICES as the ID when we don't have a device. commit f0c56ffd980db19bea271aeebf118bd931f6f40d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 24 12:58:49 2008 +0930 dix: don't dereference dev->key if it doesn't exist. This may happen if we check for a passive grab on a floating pointer device. commit 01f0b9c9784c55c94104bafa6dd545b373c64104 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 25 19:23:20 2008 -0700 xf86GetOptValFreq wants a pointer to double, but maxPixClock is an int commit 7ce6dcef118139d0ccfc136b9a07f5bf0c078d70 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 25 15:06:49 2008 -0700 Don't log null device name in XkbDDXLoadKeymapByNames commit cbc20d92de92aad5ca240310a9156ccf97c24a01 Author: Adam Jackson <ajax@redhat.com> Date: Wed Jun 25 09:52:36 2008 -0400 XTrap delenda est. commit a81b5ce452766bbc4b2ac0849711284ba8591b46 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 25 13:23:09 2008 +0930 dix: free memory associated with the EventList. #16507 Un-deprecates CloseDownEvents. X.Org Bug 16507 <http://bugs.freedesktop.org/show_bug.cgi?id=16507> commit 3a2beb2f867fd47dc5a7723dcac345ea0b0ecf3d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 25 13:12:41 2008 +0930 dix: InitEventList does not need to be _X_EXPORT. commit 385943e0e97463ce4681a9b6a4a40d7e3c91e51e Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Tue Jun 24 23:13:32 2008 -0300 Set --enable-builtin-fonts as default. Some reasons to embed fonts by default: 1. X server doesn't pick a good default font path so it's easiest just to built in the core fonts and let new X hackers more happy. Developers and distro guys are wise enough to just set --disable-builtin-fonts when they want. 2. Seems that this is by far the most popular FAQ (http://www.x.org/wiki/FAQErrorMessages). 3. No one gave a good argument to not do this: http://lists.freedesktop.org/archives/xorg/2008-May/035479.html commit f3b29efc4d7bb346cdd3fd79e780f1022c8f46e8 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Tue Jun 24 23:07:49 2008 -0300 Remove NOFONTSERVERACCESS macro dix: this is semantically different but it goes through the same path in the code. commit 2ff7eb4995b663cf12a01124745de600f38d0bfc Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Tue Jun 24 22:09:34 2008 -0300 xfree86: kill INHERIT_LOCK_STATE macro. I don't know how this survived so long. Google didn't show anything usable related with this. commit a3ec22627355fc08730ad7e90022e374763d333f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Jun 24 20:32:24 2008 -0400 Fix a leak in the code that parses the protocol names. Also added some comments. Reported by Ben Gamari (bug #16492). commit a4cb25f8c816adc3bdf6a28d5beb558e8be40121 Author: Ben Gamari <bgamari@gmail.com> Date: Tue Jun 24 12:08:35 2008 +0930 dix: free FocusPrivates when deleting a window. #16493 Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> X.Org Bug 16493 <http://bugs.freedesktop.org/show_bug.cgi?id=16493> commit 32a7bbbba6fec0535a8faa1d6d2ecebe786bcc81 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 24 09:28:05 2008 +0930 xfree86: fix up leftover allocation of xf86Events. Thanks to Eamon Walsh for spotting this. commit bcc88a1d46c7ba469c4e2861875f84f8c77d4b15 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 22 22:34:30 2008 +0930 xkb: remove unused variable is_core. commit 9ed9d98dec58d1f7468d02c4b951811b8e1ca7c1 Author: Julien Cristau <jcristau@debian.org> Date: Tue Jun 24 22:36:32 2008 +0200 x86emu: fix build, fallout from 9719354 commit e9b4f3cd856e2401675452c387b4155246239f91 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Jun 23 16:18:20 2008 -0400 Fix "warning: suggest parentheses around && within ||". commit 8910dde96ec4318c9c44fb9717b6b52fad56cd1d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Jun 23 14:51:38 2008 -0400 Fix "warning: assignment discards qualifiers from pointer target type". commit 95d4ede538fbb68049ba3efa0acb0e9712e5cb01 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 20 23:49:32 2008 -0400 Fix "warning: passing argument 1 of `modeIsPresent' from incompatible pointer type". commit fa1545eeda2a7feebc006840a44d390177634231 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 20 23:47:22 2008 -0400 Fix "warning: passing argument 1 of `xf86addNewLoadDirective' from incompatible pointer type". commit 2725ba1fca45e5ba241695e24333d8efab1f862b Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 24 14:41:32 2008 -0400 Also remove xorgconfig from configure.ac. commit 9719354ae04a41e9834ac9ba8fd9e895092ba4f1 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 24 14:37:06 2008 -0400 Check for __amd64__, not __x86_64__. Spiritual revert of 1fa4de80fcfc697b5e5879cc351fb3e9dbf6acbe. Intel's C compiler claims to be gcc-compatible; if they're not defining the same macros as gcc then that's their bug, not ours. Even if we were to do this aliasing we should do it once and for all in servermd.h. commit 249c892784ca5e8c75863dd82097ca2bedec4723 Author: Roland Bär <roland@verifysoft.de> Date: Tue Jun 24 14:13:02 2008 -0400 Bug #11857: Avoid running off the end of a MAXCLIENTS-sized array. commit 9e5b3deafb97ec1f83e6bfe067bc68df7385bc6a Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 24 14:08:04 2008 -0400 Bug #11842: Fix emulation of int1A PCI BIOS services. Use only %di to name the PCI register to read/write, rather than %edi. DOS is only expecting the base PCI config space anyway, and the BIOS might be using the high bits of %edi. commit d34430414ac0e77eec61ab0ac9ef427b236eb639 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 24 13:32:55 2008 -0400 Remove xorgconfig. Use X -configure instead. commit 574c62e305e5380bb1b0f4bfec4f7cc3e3f03ada Author: Owen Taylor <otaylor@fishsoup.net> Date: Tue Jun 24 12:40:47 2008 -0400 Bug #15369: Don't reduce Over to Src for transform + RepeatNone. Only do no-src-alpha optimizations for a RepeatNone source if we can easily probe that we won't sample outside the edges of the source. commit 100afae578e59e31b65a6264c281ba7deea5ac39 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 24 10:52:31 2008 -0400 Bug #15586: (Correctly) refuse to redirect the root window. commit 4c4e06af7950df509fa02099788be66cf37a4d01 Author: Paul Bender <pebender@gmail.com> Date: Tue Jun 24 10:44:47 2008 -0400 Bug #15665: Fix building without Composite. commit 59510a76436c739fd9421f01cc4210607d9e7f57 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jun 24 10:40:36 2008 -0400 Remove some default modes that really shouldn't be in the default set. commit b622f6dc5d8d70d17be0374a85a9b16b43a62a01 Author: Julien Cristau <jcristau@debian.org> Date: Mon Jun 23 23:45:57 2008 +0200 kdrive: fix building with --disable-xv (bug#16488) commit 3b587826924c60f6736dc5faf584b964fde1b4da Author: Jesse Ruffin <jesse@eloquentpeasant.net> Date: Mon Jun 23 14:35:20 2008 -0400 Bug #16302: Fix GLX drawable refcounting in DMX. commit c8d066a15142678041c1d82ccf530dcdb2ea74ca Author: Adam Jackson <ajax@redhat.com> Date: Mon Jun 23 13:59:48 2008 -0400 Implement bswap in x86emu. Yes, this is a 486+ instruction and thus not strictly legal in vm86 mode, but enough BIOSes use it (looking at you VIA) that we might as well implement it. commit b55fbca4f0705aeff1c69d3ef851c5ff5af6ed94 Author: Adam Jackson <ajax@redhat.com> Date: Fri Jun 20 13:27:32 2008 -0400 Bug #12414: Create full-fledged pixmaps in fb24_32ReformatTile(). ... instead of creating pixmaps that only fb knows about, which will have no devPrivates for any other subsystem and thus cause havoc if (when) they leak out. commit 155fcecb320dbcfb899d6bcd78048ce0993bf28b Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon May 19 08:09:33 2008 +0200 Various messages clean-ups. commit 41a65e110409a290288180e8e1517f053f877586 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon May 19 06:12:04 2008 +0200 Fix ipc check on OpenBSD commit ce4d4b3c1b0e25f64d6f781b09528b2f3ae33207 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon May 19 05:19:01 2008 +0200 build fix commit 19c7e9da55646f1f6e05c28cd71865cd8d84e1ff Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon May 19 02:24:17 2008 +0200 preserve errno around the SIGIO handler commit 0a81d476388c51f8aa723400dffc375e112ea97a Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon May 19 02:20:44 2008 +0200 Remove RCS Id. commit c0d7ad9c88172d753b932069743ae65f75de3aa9 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Thu Jun 19 16:51:18 2008 +0200 Let code build with gcc 2.95 commit 219dd2d44a9da40427ad48b0f09b981fe0551f4b Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun May 18 13:53:32 2008 +0200 sprintf() -> snprintf() commit cfcb3da75e807dec225cc7ea469e04d2db10bf73 Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 18 11:37:00 2008 -0700 Make button down state a bitmask. Master buttons track union of slave buttons Mixing usage where some parts of the code treated this field as a bitmask and other parts as an array of card8 was wrong, and as the wire protocol wanted bitmasks, it was less invasive to switch the newer counting code use booleans. Master devices track slave buttons by waiting for all slave buttons to be released before delivering the release event to the client. This also removes the state merging code in DeepCopyDeviceClasses -- that code was changing master device state without delivering any events, violating protocol invariants. The result will be that existing slave button state which does not match the master will not be visible through the master device. Fixing this would require that we synthesize events in this function, which seems like a bad idea. Note that keyboards have the same issue. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 3cc5ae6a4f725483612c00fc8bcc2c61607f66a8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 18 16:14:42 2008 +0930 dix: don't attempt to send Enter/Leave events if we have a keyboard. Dereferencing into dev->valuator could crash the server, although it looks like I could only reproduce this by having a keyboard send an event after it was created and the WM was still replaying. Or so. commit 528b4e36ade482df99747081688ae52cfaeb28eb Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed Jun 18 22:34:02 2008 +0100 Set driverPriv immediately on CreatePixmap. If it's NULL anyway, we bail, if not, it lets ModifyPixmapHeader know about the private. commit 068fa63496c7c363706f0d356b5132bc591c04c6 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jun 18 09:23:09 2008 +0930 dix: fix a crash when the client has a different byteorder. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit d21155a3e9b51df946766926bc6155c8972c4439 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 15 20:00:41 2008 +0930 input: fix up usage of button->down, used to be a bitmask, is now an array. device->button->down used to be a 32-byte bitmask with one bit for each button. This has changed into a 256-byte array, with one byte assigned for each button. Some of the callers were still using this array as a bitmask however, this is fixed with this patch. Thanks to Keith Packard for pointing this out. See also: http://lists.freedesktop.org/archives/xorg/2008-June/036202.html commit 2b9c829bdebd16910bdf48b9d64862e3d34f5b7f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 18 09:55:53 2008 +0930 Xi: don't drop the grab status in XExtendedGrabDevice(). commit 4f3ed54dc9ea7780ff03378b13de0fddfdec2e15 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 17 10:43:36 2008 +0930 mi: remove trailing whitespaces from misprite.c commit 79dd600942bbac3c6b531f284b42c7b2c822da90 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Jun 17 19:09:44 2008 -0400 SELinux: Add an extension alias under the OS-agnostic "Flask" name. commit 656d3d7623c6b83024e9cdc60d1257f4d87aa268 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Jun 17 17:55:11 2008 -0400 SELinux: Bring server-side name registry up to date. commit f3490d3eba94c7d9e760d6d21991ab6677196c2b Author: Ian Romanick <idr@us.ibm.com> Date: Tue Jun 17 10:35:24 2008 -0400 Bug #15169: Make the server build again on Alpha. Still won't work until the kernel makes the resource files actually exist. commit 47969d79289ad92f658c9a6dd2a2fc6b5f1b6c99 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Mon Jun 16 15:07:39 2008 +0100 Add DRI2 support. Add EXA stubs. Currently tested with i915. commit 6a1910a0e562e36e0836e948b287ec37c90df02d Author: Zack Rusin <zack@tungstengraphics.com> Date: Mon Jun 16 00:31:53 2008 -0400 Adding some readme. commit 8c9234a163eceda2abc0a2523e0f5587ea399935 Author: Keith Packard <keithp@keithp.com> Date: Sun Jun 15 10:01:28 2008 +0930 Xi: avoid double button mapping. Button events were mapped once in GetPointerEvents and then again in UpdateDeviceState. While it might make sense to just fix up UpdateDeviceState, it turns out to be better to leave the raw button number in the event because DGA reports raw device events without button translation, and so when it calls UpdateDeviceState, the button down counts get scrambled and buttons get stuck down. See also: http://lists.freedesktop.org/archives/xorg/2008-June/036201.html Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit d894e86aa5bea81147c4a7ad8630bcfb04156792 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 15 10:55:08 2008 +0930 randr: remove superfluous check against uninitialised variable. Thanks to Eamon Walsh for pointing this out. commit 5544c51447f551dfc6df64438873a7ce64743976 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 22:49:47 2008 -0400 Fix "warning: the address of ‘newTypes’ will always evaluate as ‘true’". commit 2391c409a2840d61fed93832650c0d6c82ebebdf Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 22:48:17 2008 -0400 Fix "warning: unused variable `s'". commit 61dafe384a88fc397d7cd55cb23f4fdc3fb0645c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 22:47:10 2008 -0400 Fix "warning: unused variable `tsize'". commit 37a64b02df02d42a19d4b777930dc5e457d97d63 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 22:41:58 2008 -0400 Fix "warning: ‘rc’ may be used uninitialized in this function". commit e90fcd8294fe763c97610d39cab50f2836f87dca Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 22:26:43 2008 -0400 Fix "warning: no previous prototype for ‘miRROutputGetProperty’". commit 0b00bbca5df140edbfaffab627bd82165f1b1420 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 22:22:22 2008 -0400 Fix "Warning: no previous prototype for `SecureRPCInit'". commit 1c2f038d69605b0ed1067e47dc75ca6f216991f5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:59:09 2008 -0400 Fix multiple warnings in os/xdmauth.c. commit 384ebe02b354bf1ad0a2ac25e4b5290f2e795ea1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:49:01 2008 -0400 Fix "warning: label ‘done’ defined but not used". commit 720e44f9730b9e275579483c2a34b16bba77e146 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:42:37 2008 -0400 Fix "warning: no previous prototype for ‘XevieExtensionInit’". commit 9d871e19c9dee5d3ee7f123249e8890417d83093 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:35:29 2008 -0400 Fix "warning: unused variable ‘pDev’, `pPointer'". commit 60f64af075e8ac3e63586452f2f3d338a05785f0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:23:31 2008 -0400 Fix "warning: passing argument 1 of 'pixman_fill' from incompatible pointer type". commit c448460fdc23262f2b711a32599090c85c70447a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:05:26 2008 -0400 Fix "warning: pointer targets in assignment differ in signedness". commit 17ed6242e73c5f733601b15732ab30c23acf14d2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:03:17 2008 -0400 Fix "warning: assignment from incompatible pointer type". commit 02a8b118cd07d98f12aab8325d8443125703ba7d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 21:01:50 2008 -0400 Fix "warning: implicit declaration of function ‘miPointerGetScreen’". commit 2d7ba09dc4b5eff5dba8d7867f285111574b1737 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jun 13 16:39:40 2008 -0400 Make devPrivates lookup functions ABI instead of static inlines. This is required to preserve compatibility across changes to the internal representation of the privates list. commit 9e0e558f263a132babf8c91d31230831653f19c1 Author: Adam Jackson <ajax@redhat.com> Date: Fri Jun 13 11:17:49 2008 -0400 Fix unterminated endif. commit 6bbfadb9094bb6437a6825b8293d13a32e041aff Author: Adam Jackson <ajax@redhat.com> Date: Fri Jun 13 11:00:50 2008 -0400 ... and stay dead. commit f31bd087e8a7f65cd588bd1d022bb18e72b2a60c Author: Adam Jackson <ajax@redhat.com> Date: Fri Jun 13 10:35:07 2008 -0400 Death to mfb. Anyone still interested in 1 or 4 bpp framebuffers, talk to fb. commit af86c3b7ce705c1711c8cf8bf05a7a02b8afccf6 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat May 24 21:16:34 2008 +0300 clean .gitignore commit 3108980f5e78c129b23ff32f72564cf9a746c693 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri Jun 13 15:58:56 2008 +0300 glx: drop unused cleargc commit 23b55a61f89f69454a3b0e3413b1f07d5fdf43aa Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Jun 13 11:13:56 2008 +0200 AIGLX/DRI1: Switch to server context for calling pScreen->GetImage. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16292 . commit d15b3790307053587df8daed1936ff6923881b63 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jun 12 16:00:50 2008 -0400 Remove xgl. This code hasn't been updated with anything even resembling what anyone is shipping in nearly thirty months. It hasn't built out of the box since 7.1. Most of its features over AIGLX are accomplished with DRI2 and friends. commit c37a93b4850866c713e3cbf39a08bbc9645e24d4 Author: Dave Airlie <airlied@redhat.com> Date: Thu Jun 12 14:54:56 2008 +1000 modes: make aspect choosing work on single output case. In the single output enabled case we never enter the loop and test never gets set and so we fail to match a good mode. This was causing my 2560x1600 to end up at 2048x1536. commit 23e71ef71a178505494d4b410f9314acfff81524 Author: Dave Airlie <airlied@redhat.com> Date: Thu Jun 12 09:04:24 2008 +1000 dbe: fix DoS reported by iDefense. This isn't a security problem just a user could DoS themselves for fun or profit. commit 390b155135a451fa728b73c8107aea91dfd56ed1 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 11 18:21:33 2008 -0300 Welcome to hotplug era. `rm -rf xorg.conf` does not imply an error message. Maybe a warning. checkInput() is defined but not used. commit 6e018f6a30dab1259b8fdc1ae4c84056b2acf362 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 11 18:10:55 2008 -0300 No need for inputPending field in xf86Info. commit 881e551de92e5664f92ef1961092e35cd7a77b15 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 11 18:03:33 2008 -0300 CopyGetMasterEvent() can be static. commit 656949cbe24648a5b58f7df6ed49b25af0b47601 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 11 17:57:19 2008 -0300 Remove more unused things. In function ‘miSpriteCloseScreen’: warning: unused variable ‘pDev’ commit 84db8837d0faaac008be61df9f1261cd3028e923 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 11 17:47:00 2008 -0300 Remove unused xf86DeviceCursorUndisplay() function. commit dba5455f06c439c7e7d399f30dc7067e98e6e50b Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jun 11 11:41:34 2008 -0400 Un-K&R shm extension. commit 9171206db349a0c6fda719746be0b15049d57aaa Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Jun 10 12:23:03 2008 -0600 CVE-2008-2362 - RENDER Extension memory corruption Integer overflows can occur in the code validating the parameters for the SProcRenderCreateLinearGradient, SProcRenderCreateRadialGradient and SProcRenderCreateConicalGradient functions, leading to memory corruption by swapping bytes outside of the intended request parameters. commit 5257a0f83d5f3d80d0cd44dd76d047bac3869592 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Jun 10 12:22:30 2008 -0600 CVE-2008-2361 - RENDER Extension crash An integer overflow may occur in the computation of the size of the glyph to be allocated by the ProcRenderCreateCursor() function which will cause less memory to be allocated than expected, leading later to dereferencing un-mapped memory, causing a crash of the X server. commit c5f69b297b1227cb802394fa90efdbe1de607f3c Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Jun 10 12:21:26 2008 -0600 CVE-2008-2360 - RENDER Extension heap buffer overflow An integer overflow may occur in the computation of the size of the glyph to be allocated by the AllocateGlyph() function which will cause less memory to be allocated than expected, leading to later heap overflow. commit 063f18ef6d7bf834225ddfd3527e58c078628f5f Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Jun 10 12:20:43 2008 -0600 CVE-2008-1379 - MIT-SHM arbitrary memory read An integer overflow in the validation of the parameters of the ShmPutImage() request makes it possible to trigger the copy of arbitrary server memory to a pixmap that can subsequently be read by the client, to read arbitrary parts of the X server memory space. commit 95d162c4389857d960da9b0158345c1714e91f31 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Jun 10 12:20:00 2008 -0600 CVE-2008-1377 - RECORD and Security extensions memory corruption Lack of validation of the parameters of the SProcSecurityGenerateAuthorization SProcRecordCreateContext functions makes it possible for a specially crafted request to trigger the swapping of bytes outside the parameter of these requests, causing memory corruption. commit 656d5d98855eb608ec6581f8c574f343a216ea32 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 11 17:32:59 2008 +0930 kdrive: fix wrong use of &, should be | instead. Fallout from 26e7e69ab893d1f2b35213250ada40ec90944f62 commit 6528eb885dea0326aacdd026d44d82ab07f4a4fd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 11 15:01:36 2008 +0930 Xext: init firstValuator to zero, otherwise core XTest events may get lost. commit 6ab311c92d036dc63ee92ab4bb231f5f61ebe69f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 9 11:45:57 2008 +0930 dix: Call RealizeCursor during InitializeSprite. RealizeCursor should be called when the cursor is allocated. However, when the root cursor is allocated, no devices exist yet, and thus RealizeCursor is never called. This may lead to segfaults lateron in DDXes like Xnest that actually need to do something for each cursor, and lateron rely on that DDX-specific data for each cursor has been initialized. commit e083b5a07507d53de0d1d365ef1565346284c997 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 9 11:23:53 2008 +0930 xnest: wrap the xnest cursor sprite funcs around the mi funcs. Modelled after the xfree86 code. Call miDCInitialize to init the SW rendering engine, then take the pointers, store it in a xnest-local variable, and put the xnest-specific sprite funcs in place. In the xnest sprite funcs, call through to the mi sprite funcs after doing xnest-specific stuff. commit ea6a02c048e8589e99ee3b459f3612eb3d041558 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 9 11:22:33 2008 +0930 mi: protect mipointrst.h against multiple includes. commit a3a7c12fcf8e4ac1418f9ea53f76091f309a721b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 8 23:38:45 2008 +0930 xfree86: Fix up xf86ScaleAxis Some driver still call it, so we might as well work correctly. Always resetting X to the Sxhigh is sub-optimal. commit f8431a62d57ab3118a0b409bce977db8261e2930 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jun 10 02:15:25 2008 -0700 XQuartz: Under the new startup model, we no longer need to do the foreground/background dance. (cherry picked from commit 4505bae5d7341e1241be50c25cb3d1b941701de4) commit c180a52332385b98635068d63a8fe0bba4835be7 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jun 10 10:47:37 2008 -0700 XQuartz: Removed code path for old startup (cherry picked from commit a9ee6b0d00fab01a78408a85e6542e88c19fda7c) commit 49751fee3b82ebc4917bfb168ec78aad7874f1f1 Author: Roland Scheidegger <sroland@tungstengraphics.com> Date: Tue Jun 10 15:40:48 2008 +0200 glx: copy msaa visual capabilities commit 5170c169db78cad3fe47dee4e438b48e67f0c7d1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jun 10 01:39:15 2008 -0700 XQuartz: Fixed the "laggy" startup under the new model. This was caused by xinit blocking expecting SIGUSR1 and our stub never sending it. (cherry picked from commit ee92aced10d0743c4658e53b58b5d9f5a094a415) commit 01ace5f3fd56bc789ad7448059fcf907ef19a1c8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jun 4 18:28:20 2008 -0700 XQuartz: Updated icon with more rsolutions and made it more dark-background friendly (cherry picked from commit d8cf5623faab952a0f1196c8fe10baa09d1fc089) commit 607b0d09ea003f87cfb3331e59e13495a483832a Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Jun 9 09:52:04 2008 -0700 CreateColormap returns Success on success, not TRUE. Fixes a problem where enabling color index overlays disables the RENDER extension. commit 2854abd39d4deb79c9ee9bcc931fad969392cfc5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 8 23:20:11 2008 +0930 xnest: fix up sprite funcs to stop compiler warnings. commit c68ca0c7b2c72df0501d26bf7f640029ff2d9568 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 8 23:14:20 2008 +0930 xnest: switch to using EventList rather than xEvents. commit 34429d16d319ef2709c22a5c22f45d0e82c78b20 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 8 23:08:34 2008 +0930 xnest: call miDCInitialize rather than miPointerInitialize. This unfortunately gives us a lots of artefacts, so cursor rendering cannot be assumed complete. But it's better than crashing. commit a7d4bec884c24c0e1792fd7d6677cdd0a69978e3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 8 23:03:20 2008 +0930 mi: remove leftover old license comment. commit 585125685b5f09245021c8ee15f57950fe6cdd20 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 8 22:43:47 2008 +0930 ephyr: some whitespace changes. commit 782394fe53220deafed06ad282b5f9ce42964c42 Author: Julien Cristau <jcristau@debian.org> Date: Fri Jun 6 12:10:35 2008 +0200 mi: Fix typo in comments about deprecated functions commit 6b96281100f2118fe9d99536c33d48298a5bce7b Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Jun 6 11:01:03 2008 +0200 EXA: Fix exaGetPixmapFirstPixel() crash if the driver has a CreatePixmap hook. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16243 commit d25ffcfbfcfe8e059f2889873c9dbe76a28ad00c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 5 15:29:35 2008 +0930 mi: protect against possible NULL-pointer dereference. commit 874dcdb3bdb9320aae252d3c7927d412685059d5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 5 15:38:48 2008 +0930 dmx: remove a ifndef XINPUT, XINPUT is always defined now. commit 52752911ea8470dd8805f5e6c3febb9e1e1cc4b3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 4 17:04:16 2008 +0930 dmx: don't free event list after use. commit 5c5e58124581b845a6bfa7a2991a4e0ee7f7ebdb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 4 16:58:31 2008 +0930 dmx: add an XFlush. Beats me why we need it, but without it we get segfaults lateron. commit 246c10441bbf62646b77993b55233d5ceb93a81f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 4 16:37:25 2008 +0930 dmx: fix false memory allocation. beNumVisuals and the number of GLX Visuals can be significantly different. commit 17cd26225749a1daf7460b44e52f43082399b265 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 4 16:05:36 2008 +0930 dmx: don't dereference a nullpointer. commit 75eb635e3543fcb731331d01f50e62b696967667 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 3 22:25:33 2008 +0930 dmx: add stubs for DeviceCursorInitialize, DeviceCursorCleanup commit 3ff2f3a00ef3c484d1d53569b6cbc1f25dc6bd35 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 3 22:17:14 2008 +0930 dmx: for now, don't acknowledge SDs. commit 5bcd9e8953dfb5f13e90baeebea1f6eac797644b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 3 22:01:43 2008 +0930 dmx: learn about the existence of IsXExtensionPointer and IsXExtensionKeyboard commit 8da8a0fec4b1b9d9208635dedb2f449dc99e0004 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 3 21:59:33 2008 +0930 dmx: claim we support XI 2. We don't really, yet, but at least we get the full device list this way. commit 6f1d5147cb394b7c83c4c1447c78890fa2b40a45 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 3 21:36:03 2008 +0930 dmx: fix a segfault caused by GC devPrivates never being initalised. commit d10ba4591a599a317093ffcbdd7cece11ab6de26 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 3 21:28:26 2008 +0930 dmx: some more build fixes. commit 8d4d0b47a07a298a20ffae9fefe96c8c7ca9dccc Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Jun 5 09:19:16 2008 +0930 gl: include assert.h if we're compiling with DEBUG. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 8644aa47177bf20f3aa85181032ce75c08270fc5 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu Jun 5 08:55:09 2008 +0930 mi: minor build fix when compiling with debug enabled. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit fbf4b5f16ac23359872361c8c95a617fe8c92292 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 4 11:10:46 2008 +0930 dix: set dst->mapWidth when allocating a new map. commit ff3adf3e564d94fea18e48f966de40a7ded1279e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 4 11:10:11 2008 +0930 xkb: reset xkb_cached_map on CloseDownDevices. Could lead to some invalid pointers in the second server generation. commit 40855d8000b9b9f4e6c6b4317542378ecf516345 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jun 4 12:19:28 2008 -0700 XQuartz: Removed async debugging sleep (cherry picked from commit 7812a8bdf9fab651ea5c07b852b2999547ec628d) commit ee86b751192b690973ee2a1446a406bc721ce8eb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jun 4 12:01:19 2008 -0700 XQuartz: use a condition variable to signal when darwinEvents is ready rather than polling (cherry picked from commit ff1c443cadf11d12a7d939e51194f6105153870e) commit 38da26cd36957a45b2a47ef124282f7d863a9fd3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jun 4 11:35:24 2008 -0700 XQuartz: Don't forget to destroy the mutex and cond after we're done with them (cherry picked from commit c3558bb8cd889e5b957190e9f5d23afad1e17b72) commit ea40fcf4344c6e918d3be34354528940b05a70f3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Jun 4 11:18:52 2008 -0700 XQuartz: Fork for trigger (cherry picked from commit dd0f8a0f59593d7831fe09a2a086fcd57c84910e) commit 2393dae6ffff7db8281a7977039450e8754cc19f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Jun 3 00:06:26 2008 -0700 XQuartz: Switched over to new startup path for testing. Cleaned it up a bit. Server still crashes when using the icon to launch =/ (cherry picked from commit 7f840e9dc180421eaa9b0ea3ab993fdd5b2466e5) commit 45b661c67aca1a728f1793dd94d701488f1f196c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 4 13:39:39 2008 +0930 dix: Fix build with --disable-xinerama #16204 X.Org Bug 16204 <http://bugs.freedesktop.org/show_bug.cgi?id=16204> commit cba8b25a7e2608cd093283f86f08fba50a6a62f7 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Mon Jun 2 11:17:47 2008 +0100 Bring inline with current modesetting-101 branch for connector/encoder changes commit 26e7e69ab893d1f2b35213250ada40ec90944f62 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 2 11:04:41 2008 +0930 kdrive: don't post motion event if there was no motion. #16179 Based on the patch by Tomas Janousek. X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179> commit ac1db454497ff1839aa7f7ee0649ede112824ed9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 2 10:40:10 2008 +0930 xfree86: suspend signals while removing a device (corrected version). Block/Release is now symmetrical. commit 95ecaa411aefbcd8e2e00814132cb07b4be4e5bf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 2 10:38:45 2008 +0930 Revert "xfree86: suspend signals while removing a device." Left the signals blocked hanging after removing a master device. This reverts commit 74372fd0049676787904f1f9f80f836b97f5f60e. commit 5ba07cb54803b8c63e25e8ca1f1787860f684612 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Sun Jun 1 18:31:52 2008 -0300 kdrive: changes ephyr API according mpx merge. This fix host-cursor in Xephyr server. Signed-off-by: Tiago Vignatti <vignatti@c3sl.ufpr.br> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 5a3d06b8f42473cea3741dc722a775deaa2b73f6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jun 1 15:20:42 2008 +0930 xkb: delete default rules when devices are closed. We only have one set of default rules options in xkb. When the second keyboard is brought up with Xkb options specified, these new options overwrite the old. In future server generations, the rules used for the VCK are a mixture of the default ones and ones previously specified for other keyboards. Simply resetting the xkb default rules to NULL avoids this issue. Reproducable by setting XkbLayout "de" and XkbVariant "nodeadkeys". In the second server generation, the VCK has "us(nodeadkeys)". This again produces a SIGABRT when the first key is hit. I could not figure out why the SIGABRT happens. This patch is avoiding the issue rather than fixing it. commit 5ebe76f13fb6e96cebe5a386024a73eceeb828ff Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 22:13:03 2008 +0930 config: init dev to NULL to shut up a valgrind warning. commit a7ae9cbd78193fdafcafd5d7af1f6fabbb434628 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 20:44:58 2008 +0930 dix: don't read valuators past numAxes. commit f79ad5674ed41c3626e8055cd2bac0135de928c6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 18:46:35 2008 +0930 kdrive: fix up callers to KdQueueEvent, need to pass xEvent, not EventListPtr commit 58d12c99abc4d06cb8b43386d4bcd126f0bedf83 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 18:45:11 2008 +0930 mi: Remove #ifdef XINPUT, kdrive otherwise won't get events. commit 942086fc965fc9a24be2db4f537f0ff54db51083 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 18:17:49 2008 +0930 dix: ProcQueryPointer doesn't need special grab handling, PickPointer does it commit 6cecae0e8651b1fa58b3cd0e0a636db46f56f6a6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 13:12:53 2008 +0930 dix: Remove superfluous comment. This code can handle devices with < 2 valuators now. commit 105d28652d1fb80dd8ce8511e2605dccc8812e99 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 30 15:20:35 2008 +0930 Xext: use GPE/GKE from XTestFakeInput #16145 This commit fixes two problems: 1) XTFI used to assemble the event itself, then passed it to the device. It's much easier to just pass the variables into GPE/GKE and let the DIX do the rest. 2) XTFI would pass the VCP/VCK as default device to event processing. As a result, updating LEDs would be updated on the VCK, not on the actual keyboard. Instead, we now pass the events through the last-used SD, thus toggling the LEDs on the last keyboard that sent through this MD. Also some cleanup in XTFI to merge validity checks a bit closer together rather than having several different sections. This breaks XTestFakeMotion with Xinerama though. X.Org Bug 16145 <http://bugs.freedesktop.org/show_bug.cgi?id=16145> commit 341a61b608873c77b1a17fe7d145ed3ad716e5a3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 12:01:47 2008 +0930 mi: reduce noisyness. DebugF is enough if device ID can't be changed. Also - printing out the event type is actually helpful. commit 62c1a32976d571f3ced1812b8b96ed5a8e658b4a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 31 10:24:37 2008 +0930 dix: null out dummyDev, otherwise Xephyr dereferences random pointers. SendEventToAllWindow eventually causes a IsInterferingGrab(), which attempts to dereference dev->deviceGrab.grab. commit 150c2f55a508ed24b230f68e30ec140c0901d9ae Author: Julien Cristau <jcristau@debian.org> Date: Fri May 23 03:09:04 2008 +0200 Add xkbstr.h and xkbsrv.h to sdk_HEADERS commit f9bcecbe51e4cf0cb2d82ad953f8c6741ed5558b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 29 17:42:49 2008 +0930 Xext: only free events in case of core motion events. commit 000ead4503ddcfdf66ce9fffc572a3a741f4055a Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed May 28 19:59:38 2008 +0100 Plug in hardware cursor support commit f9f7a872bf3f8522213aabb291d9d54e56d48c4b Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed May 28 15:55:36 2008 +0100 Run indent commit 106bea5ad1bdd5795d6ed625fc6351a161bffa6e Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed May 28 13:33:07 2008 +0100 Initial commit of new modesetting driver commit 8cf7755a85f5c1e5da7805c12b7511581a368782 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 28 18:05:25 2008 +0930 Require x11proto 7.0.13, xextproto 7.0.4 and inputproto 1.9.99.1 commit 9b544fa40062b342ff3aa75f8f21d0bd4cec80ab Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 28 12:27:07 2008 +0930 mi: ansify. commit 64677f6a167a5bee99e5dfb599a3c3a6fb5dffe7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 27 21:01:26 2008 +0930 xfree86: fix offset error in EDID parsing. #15964 X.Org Bug 15964 <http://bugs.freedesktop.org/show_bug.cgi?id=15964> commit c8af7ce35a900ac9b898f51c1b95dabad3ba1d76 Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Fri May 23 13:50:39 2008 -0300 Correct a NULL pointer deference The problem happens if Monitor/Card combo doesn't provide EDID info, and the XFree86-VidModeExtension extension is used. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 3a1278907ea8059546c7b9ab0c02714832c693e3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 26 18:01:07 2008 +0930 xfree86: Bump XINPUT ABI to 3.0. commit 0050165a67bb462e0bf644a11644ad9d587c62bb Author: Simon Thum <simon.thum@gmx.de> Date: Mon May 26 17:56:08 2008 +0930 input: change dxremaind, dyremaind to floats for better acceleration #9156 X.Org Bug 9156 <http://bugs.freedesktop.org/show_bug.cgi?id=9156> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 26c1958c322be3ac4dfec9ba2c41c5202bd03709 Merge: 5fe5778 2958610 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 26 17:37:31 2008 +0930 Merge branch 'master' into mpx commit 5fe57787faa2ea4f2f57b25455d200bf924206d6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 26 17:23:34 2008 +0930 dix: store the absolute values in the motion history. The core protocol requires absolute values and it's a bit hard to get them if we only have relative ones in the history. Switch the motion history to absolute, and if we really need the relative values, we can probably generated them from the abs. ones in the future. commit 1883485edd7eb90c0b76bca41c71e26ae2c0b91a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 26 16:35:23 2008 +0930 If core motion history is required, scale back to screen coords and INT16. commit 0b88510069bdf6d020d73b424f62c2923c0db4a4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 26 13:53:45 2008 +0930 Ensure the motion history is merged for master devices. Add each event to the master's MH as well as to the SDs. In the MD, store min/max and the actual value. When retrieving the MH, rescale all coordinates to the current coordinate range and only post those valuators that are currently active on the device. commit d22c25bda450f6f1dfa634f0f72b32c4bec429cd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 26 09:26:18 2008 +0930 dix: Allocate MD's motion history to be large enough for potential valuators Since we can't predict how many valuators may be in a future SD attached to an MD, we need to preallocate a history buffer that is large enough to keep MAX_VALUATORS coordinates per event. In addition, the history buffer needs to memorize the coordinate ranges at the time, thus requiring MDs to store (min_val, max_val, current_val, time) instead of (current_val, time) for each motion history entry. This commit only fixes the allocation. commit 0877de13ac6ddfb55108aa3456d47f970c6c442c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun May 25 22:49:54 2008 +0930 Remove GetMotionProc from ValuatorClassRec. With the MD/SD device hierarchy we need control over the generation of the motion history as well as the conversion later before posting it to the client. So let's not let the drivers change it. No x.org driver currently uses it anyway, linuxwacom doesn't either so dumping it seems safe enough. commit 00b4339168c10dd4ce026deb8e04bfb63dfd11dc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun May 25 22:34:11 2008 +0930 dmx: remove some #if 0'd code. commit 096117cf023dc92dcadc91677931fc6ad1feb4a0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun May 25 10:38:33 2008 +0930 Xi: reset motion history when swapping device classes. This isn't really the correct solution, but it'll have to do until I figured out how to transfer the history over correctly. commit 29586101dc11d498b212510f8dedbfeca7f8c859 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat May 24 20:01:41 2008 +0200 EXA: Only record damage generated by rendering operations. Recording damage from other operations (e.g. creating a client damage record) may confuse the migration code resulting in corruption. Option "EXAOptimizeMigration" appears safe now, so enable it by default. Also remove it from the manpage, as it should only be necessary on request in the course of bug report diagnostics anymore. commit f6d61d3d86971d6a202b46ff2fab8c8799a4d057 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat May 24 20:01:36 2008 +0200 EXA: Don't migrate twice in exaImageGlyphBlt. exaPrepareAccess already handles migration. commit d73304398255e0c3b03a497a8d4a2f8d900eef44 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat May 24 20:01:31 2008 +0200 EXA: Don't suggest exaCopyDirty be inlined. Leave the decision to the compiler toolchain. commit 3baf3b42e079b4e7b61c1e20df305db0724d21f8 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat May 24 20:01:21 2008 +0200 EXA: Specify region used for source pixmap migration in exaCopyNtoN. Avoids excessive migration overhead in some pathological cases. See http://bugs.freedesktop.org/show_bug.cgi?id=15845 . commit ba557e0263eee0b75847c596f31c71492611b22c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat May 24 17:23:10 2008 +0930 Xi: remove deprecated comment. Axis clipping wouldn't be necessary here, it's already performed in GPE. commit e6cbb1e11e5da1a8b9001853c25f4e5a052e7110 Author: Julien Cristau <jcristau@debian.org> Date: Fri May 23 23:00:40 2008 +0200 xfree86: fix build on GNU/kFreeBSD GNU/kFreeBSD defines __FreeBSD_kernel__, but not __FreeBSD__. Unify preprocessor conditionals between variable declaration and use. Debian bug #482550. commit 6c72961d8fa1ab1543f1b3e2cc7d34ff6d254bf8 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri May 23 22:39:35 2008 +0300 glx: fix memory corruption with r5g6b5 should cherry-pick to xserver-1.5 commit 21a8052fdca2115668dfc747b0b58db437b4eb6d Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri May 23 22:39:09 2008 +0300 glx: fix forgotten swrast -> SWRast commit 877e6c35ff1f0f110627590ac0f12fddf47de506 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri May 23 22:38:36 2008 +0300 glx: missing swrast is fatal commit 1345c93ad4be875951256dae87bc4fd9a1b5e08a Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri May 23 22:38:11 2008 +0300 glx: drop stray glcore.h include commit ae0504d34d245f15b2f098a63ad1a9e1c4daef35 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri May 23 22:40:03 2008 +0300 kdrive: need not export symbols for glx anymore commit 7082929ef7db20b507dce5a8cec043e787d0b55e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 23 02:27:58 2008 -0700 XQuartz: A 2 second delay for launchd socket connections should be sufficient. (cherry picked from commit 2bb4251b3c6b30dbf1a556e1b51e6f03f02d2529) commit 5a388b27a094c71b4214aa744b2ba0fdda7fd607 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 23 02:10:14 2008 -0700 XQuartz: Add the launchd fd to AllSockets as well (cherry picked from commit 83f72529394be5871671d73b6ef4f8bc83708f8a) commit 77b688a73025238ed9fe286a2bae8f78da65fce3 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 23 02:32:28 2008 -0700 XQuartz: Don't need launchd checking in configure.ac anymore since its functionality has been removed from libxtrans and into the mach startup code. (cherry picked from commit 1e1f4fb717d2f3a3227be2a034d28d6a4f29b5d1) commit 225dddbaeded4d64fcc104da538449e5c4dedd2d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 23 01:39:02 2008 -0700 XQuartz: Move the launchd display grabbing into mach_startup (cherry picked from commit c3866c98d23020d2151977ee1177b6054d05832e) commit 3a22190061c7ebefee85564b0def5e1112c07ae8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 19 03:13:09 2008 -0700 XQuartz: Fixed a few issues with fd passing... still not working =( (cherry picked from commit 7dd351271522b475d8017e4bd1618f12817ee2fa) commit 3ae0f4fc832462444d03024c5fbb867f19d5e960 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 23 15:02:43 2008 +0930 dix: update valuators > 2 as well. master->last.valuator[x] for x > 2 is undefined. For all other devices, it's the respective device's last valuators. If the lastSlave did not have a valuator that is to be updated now, it is reset to 0. commit 0d1b41ace38bc918e2cc2a0a6ad107c76346fd00 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 23 13:32:33 2008 +0930 Xi: update device valuators based on the event. Event is always absolute, update the device's valuators (always absolute too), and then change the deviceValuator event to reflect the device's reporting mode. commit 7eec1c23a34591064ea64499acb24f22ada08dfa Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 23 13:23:02 2008 +0930 dix: don't allow relative data in deviceValuators. In GPE, we don't care about the device mode. Let's put the absolute values into the deviceValuator event and worry about relative valuators on the other side of the EQ. commit 75551a2ef949c2cfb53fdc4b97f3964a5e2f45f5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 23 12:55:50 2008 +0930 Revert "dix: Correct values in the device axisVal are calculated in GPE" We can't rely on GPE to update device->valuators->axisVal. If a SIGIO occurs during event processing this may have incoherent results. This reverts commit f6645ddbf754c80e9a8b1672519534a887622270. commit fe59b1a62b2c7f467d20132db4913317bbf308eb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 23 12:51:52 2008 +0930 dix: more device scaling insanity. Assuming master->last.valuators is in screen coords, SD's are always in device coordinates. 1. If an event comes in, scale masters->last to the device, drop into device's last->valuators. 2. Apply motion from the actual event 3. Scale back to screen coords, check if we may need to cross screens 4. Drop screen coords into master->last 5. Rescale to device coords, drop into deviceValuator event and SD->last 6. Drop screen coords into ev->root_x/y Whoopee... commit 6c9e9f8a40e20fb1761440acd2755f5fd31f4d44 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 23 11:51:53 2008 +0930 input: instead of lastx/y, use a last.valuators[] array on the device. During GetPointerEvents (and others), we need to access the last coordinates posted for this device from the driver (not as posted to the client!). Lastx/y is ok if we only have two axes, but with more complex devices we also need to transition between all other axes. ABI break, recompile your input drivers. commit fb146cbb0f28e4e480e5d16d61476ac46b5d00ce Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 23 12:00:13 2008 +0930 dix: coreEvents doesn't have meaning here, use master instead. We mustn't clip x/y if we are attached, otherwise we can't change screens. commit fc1cc0adcb91fdfa4c547bf379a85f9558c959ff Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Fri May 23 00:33:18 2008 +0200 dix: Cleanup of GetPointerEvents Changed all the checks for x&y valuator so the more complex calculation is only made once. Added TODOs for valuator/axis 2 and above for future correct handling of relative reporting of these. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit a0241d5380bb5d8b10865f8ea81a9a011de4aaf1 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Fri May 23 00:36:11 2008 +0200 dix: Correct clipAxis so it can handle devices with value ranges properly Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit f6645ddbf754c80e9a8b1672519534a887622270 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Thu May 22 23:33:45 2008 +0200 dix: Correct values in the device axisVal are calculated in GPE Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 7f85acdf70c67c567de688439e25081be5a7d5df Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 22 23:27:15 2008 +0930 dix: fill valuators with the correct values depending on the device mode (GPE) valuators[] is passed from the DDX. Depending on the device mode, update it with either absolute values or relative values. The deviceValuator event sent to the client will then contain the respective values. commit 1a3f351c50cba66f71a73239318174b09fd9b63b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 22 23:25:20 2008 +0930 dix: when floating a device, create a new cursor sprite. This is essentially necessary to allow calls to miPointerGetSprite etc. to work for floating slave devices. commit e0fbe404a436aef24624a3a15e8405a9ca38aadb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 22 23:24:29 2008 +0930 mi: handle sprite even for floating slave devices. We still don't render it, but we accept all the other calls to update it's internal state. commit 0f15875a271889ae3cc4997ad15f787ea28b3a08 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Sat May 17 19:24:00 2008 +0200 Make all conversion handling in GPE. This isn't quite finished yet, but at least it gives us the ability to use a tablet as a normal mouse - with all the scaling in place. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 74372fd0049676787904f1f9f80f836b97f5f60e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 22 18:02:10 2008 +0930 xfree86: suspend signals while removing a device. Getting a keyboard event while halfway through freeing memory can be unpleasant. commit 30e9a33f7d1972dcf1c29c7455b2cea4e5857913 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 22 16:00:21 2008 +0930 xkb: fix crash caused by uninitialised variable. commit e837244947fbb18192e9056c070ce439ef24d1a3 Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed May 21 16:14:55 2008 -0700 Actually enable building GLX without Mesa source commit ea4ec9e9983e25d94a3edf8a77ed2ad1db193284 Author: Dave Airlie <airlied@redhat.com> Date: Tue May 20 13:59:09 2008 +1000 int10: add pci_device_enable support on Linux commit 4230b92744d54528f48ddc3b096a265b488053c9 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed May 21 17:58:15 2008 -0400 Clean up remaining afb references. commit 20ea99c655140e101f2d20cfab78fb22765fec62 Author: Adam Jackson <ajax@redhat.com> Date: Wed May 21 17:03:25 2008 -0400 Death to afb. Planar framebuffer people, please talk to wfb for all your 1988 hardware needs. commit c76fddeea28b4f88db97a2a3487d7a57cd9d578c Author: Dan Nicholson <dbn.lists@gmail.com> Date: Wed May 21 10:51:15 2008 -0700 Fix up paths for GL/glx -> glx renaming commit c3eb5b80d8cc7ca6a425ccf359718d1ef3d5af55 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed May 21 13:33:36 2008 -0400 Move GL/glx on level up now that it's the only thing left under GL. commit a8a9b40e554dd0c184866978889a39519afc466a Author: Kristian Høgsberg <krh@redhat.com> Date: Wed May 21 12:34:07 2008 -0400 Move the windows GL files to the xwin DDX. commit e5aad4bc087036489e2af576628aa9b612054a6e Author: Kristian Høgsberg <krh@redhat.com> Date: Wed May 21 11:44:12 2008 -0400 Get out of the mesa symlinking business. This copies over the files generated from mesa/src/mesa/glapi. There's a corresponding mesa commit that makes it easy to generate the glapi files straight into the xserver tree when the XML definitions change. The only few files that are copied from mesa but aren't generated are glapi.[ch] and glthread.[ch]. Everything in there is technically DRI driver API and the whole setup is still a bit fragile, but it's not a new problem. The --with-mesa-source configure option is still around since other parts of the server (XGL and DMX - grep for MESA_SOURCE) need that, but for common case of building with GLX and AIGLX support, that option is no longer needed. commit f558c7d4d1d87affe1ce4aec2e62ff64545f2bc8 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed May 21 10:18:16 2008 -0400 Use LD_EXPORT_SYMBOLS_FLAG when linking Xnest. commit 77ff8fd5072fa57158463bfd84656389eeb7b503 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed May 21 10:17:53 2008 -0400 Drop glcore GLX provider. Obsoleted by the DRI swrast driver. commit 61eaef22359ae2abcee7dcd73ee8610a83776fc7 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue May 20 16:56:27 2008 -0400 Stop symlinking glcontextmodes.[ch] from mesa. commit 88f43e5d06fb5543bc40ca060b2c5d8e2673afad Author: George Sapountzis <gsap7@yahoo.gr> Date: Wed May 21 18:13:47 2008 +0300 glx: drop drm.h, sareaHandle from swrast loader commit 255142b61eb73843b16c2afdb95aa4d1f27e4f0d Author: George Sapountzis <gsap7@yahoo.gr> Date: Thu Jan 3 17:53:56 2008 +0200 drop xprint remnants: InitGlobals commit 641ce9c706ce3cbf726fb3fc9623161bb96ba127 Author: George Sapountzis <gsap7@yahoo.gr> Date: Thu Jan 3 17:28:04 2008 +0200 drop xprint remnants: xpstubs commit 5c5a1eaf68eb11053fd5b99d24eb8024b6d5b218 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 21 21:51:27 2008 +0930 Replace UniSA with full Uni name in Author affiliation. Big boss says UniSA isn't unique enough. Who am I to argue? commit 7509fb498c02fe1cebe4139612b8871ec877c130 Merge: 2ae3bed dfb7de6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 21 16:25:35 2008 +0930 Merge branch 'hwcursor' into mpx commit 2ae3bed33731d800bb28a968e3a1c8066d179740 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 21 15:51:35 2008 +0930 mi: shut up compiler warning (return w/o a value) commit 8b3d26f5b6caff1766669deb0e2100d2dee3f185 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue May 20 12:39:28 2008 -0700 Short-circuit PanoramiXTranslateVisualID after verifying that the visual actually exists first. This allows using PanoramiXTranslateVisualID to test whether a given visual made it through PanoramiXVisualConsolidate. commit 6ff6465931c397f72db27a4fd0ca0dcac0609537 Author: George Sapountzis <gsap7@yahoo.gr> Date: Tue May 20 16:36:22 2008 -0400 Add loader for the swrast dri driver. commit 4056595fc77c20052e226b402e38a2a914dca123 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 20 18:57:31 2008 +0930 xkb: remove superfluous checks in if statement. commit 925e895b869e461a9e7f135891463c56ee633cd6 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon May 19 18:43:29 2008 -0700 Restore return type on xf86SetScrnInfoModes Seems to have been accidentally lost by commit 76943fec860315f3c93539e59a59080b8a7b3e75 commit 7a550cefd9417c22a4397ea4d103ddc347ab1a0f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 20 11:07:39 2008 +0930 dix: shut up two compiler warnings. commit f9edecd1b53a2e234def9cbd954a47c4bda2bebc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 20 11:07:17 2008 +0930 mi: sync declaration and definition of mieqResizeEvents. commit e73a03d589b47ac9131f3932da7f78d2fef7bfb5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 20 10:54:32 2008 +0930 fb: shut up two compiler warnings. commit 99d28c3ef37aeffe7d8ec41e45a650ba248c6958 Merge: fc7e256 0178b6a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 20 10:20:14 2008 +0930 Merge branch 'master' into mpx Conflicts: Xext/xprint.c (removed in master) config/hal.c dix/main.c hw/kdrive/ati/ati_cursor.c (removed in master) hw/kdrive/i810/i810_cursor.c (removed in master) hw/xprint/ddxInit.c (removed in master) xkb/ddxLoad.c commit 0178b6a4abed0df3e90ba393709ed566105e7c2c Author: Adam Jackson <ajax@redhat.com> Date: Mon May 19 11:22:19 2008 -0400 Fix reduced-blanking mode filtering in RANDR 1.2. If the monitor isn't reduced-blanking (either through EDID logic, or config file setting), then remove RB modes from the default pool. Any RB modes from the driver and config file pools will stick around though; you asked for them, you got them. commit bb687465d0c5aef3cc1c865e6ea67c01a8b417fb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 19 02:45:47 2008 -0700 XQuartz: First stab at SCM_RIGHTS passing the $DISPLAY launchd fd from the stub to server (cherry picked from commit cccee9cfc29f85cca635df3b8dd54199b45c4df8) commit 4b69d22bcb79210225379da2cefb0cd8d5ffa10e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun May 18 23:51:06 2008 -0700 XQuartz: Fixed dropped code in the !XKB blocks, disable XKB support until we figure out a solution for xkeyboard-config (cherry picked from commit 2a72309c061f7060480d150791019ce232481462) commit e997df8cd3c4222ea9fc3f0ebda728c4d1f15df5 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun May 18 23:31:41 2008 -0700 XQuartz: Cleaned up ListenOnOpenFD... (cherry picked from commit 6fb587d3d5fbbaee9e46cdce24d03e5d1c66d58a) commit 738672858d9399ecbc170500c15f90bf657502d2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun May 18 23:02:12 2008 -0700 New XQuartz icon thanks to Simone Karin Lehmann (cherry picked from commit c27e0c8f3c5108192362735db8a80bf3a9a1cc3a) commit 4be2104c801340075e030d06d24ceb4d8a6d6549 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 15 12:26:32 2008 -0700 XQuartz: More work towards Mach-IPC startup... started working on FD passing (cherry picked from commit 27fbfeacfa16d620801ac3492b25c1e50aec8588) commit 82c4075d4ba3bea03341c80b754b0f9d2f62a826 Author: Julien Cristau <jcristau@debian.org> Date: Mon May 19 03:15:11 2008 +0200 xfree86: fix initial output positions with Above or LeftOf and rotation The fix in fa19e84714aa84a2f2e817e363d6440349d0b619 was incomplete, as it was still using the wrong output's initial rotation to compute the position. commit 7dca84f3ee7265119fb81d598d7d2f7363e25f1f Author: Dave Airlie <airlied@redhat.com> Date: Mon May 19 11:16:08 2008 +1000 cursor: don't dereference NULL pointer is devPrivates not yet set. This fixes a bug on server recycle with ati zaphod. commit 5af5db5033582a84b616d5c50f4288adb0210459 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat May 17 14:51:09 2008 -0700 XQuartz: Ok, pass XQUARTZ_USE_XKB since it breaks worse without it... but we have issues when we have the keyboard configs installed... need to figure out what to do there... (cherry picked from commit 301262b07024ad960f22d99a1267fe137f5c3fce) commit 2408303d79297385063cae557195bd5fd3698478 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat May 17 14:56:53 2008 -0700 XQuartz: Added functionality to add a file descriptor to the connection list after the server is already running. (cherry picked from commit 543c2cd68d1ffef65d4644b860faad7191c6b9da) commit 01612fe612aa27262fc3c8167f52e0376941f1ef Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 15 07:08:21 2008 -0700 XQuartz: Disable xkb since it doesn't work after getting xkeyboard-config installed Need to setup configs for the quartz keyboard (cherry picked from commit c28fecc621b1803a4d4536afbc724d141de9e6ee) commit 1d09deaa6e5a75420ea4f24f6b5533f0ebc3ba28 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 15 05:49:43 2008 -0700 XQuartz: Made DarwinSendDDXEvent a little more robust to context switching diring server init. (cherry picked from commit 5626b0949b1a6bdd2fa3ec2ef53a688084349b87) commit adc62f62b9f08aa6633718989ab61b61e3c1e8e2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed May 14 01:33:43 2008 -0700 Xquartz: Xquartz stub now can send Mach IPC to start the server. (cherry picked from commit 55a3bca8ea42f8677897f94bf0a429bdc08c6696) commit 93c082a060bfa8d2a204c0c57ec3507a8edea087 Author: Brad Smith <brad@comstyle.com> Date: Sat May 17 13:14:31 2008 +0200 OpenBSD doesn't define __x86_64__, simplify tests. Seeing as this code seems to be specific to OpenBSD I don't think __x86_64__ should have been added there at all. It appears to have been added wherever __amd64__ existed before which is wrong. I think that part of the commit should be reverted but also all four of the checks should be __OpenBSD__ && __amd64__ instead of two one direction and two flipped. commit 895d4e274d2b4638f0e6838dfee0e543311dba34 Author: Brad Smith <brad@comstyle.com> Date: Sat May 17 13:05:58 2008 +0200 BSD's also have /dev/urandom. commit aad1c37b0951eae216ac323c5d8bfc6fbcf096bd Author: Adam Jackson <ajax@redhat.com> Date: Fri May 16 10:52:41 2008 -0400 RANDR 1.1 compat: remove senseless comparison against the virtual size. commit 14726b776d6cebb7d864b6ffa7554e1ce5637d5c Author: Adam Jackson <ajax@redhat.com> Date: Fri May 16 10:51:32 2008 -0400 xf86SetDesiredModes(): Skip disabled CRTCs first thing. commit 459f34b089aca4f4eee9752600c3a9e4f4e343ab Author: Adam Jackson <ajax@redhat.com> Date: Fri May 16 10:48:00 2008 -0400 Fix initial mode selection even harder. The first guess used to be "is the preferred mode for one output the preferred mode on all outputs". Instead, do "find the largest mode that's preferred for at least one output and available on all outputs". commit 96111c154713600dd534dd82104ac18b91466202 Author: Adam Jackson <ajax@redhat.com> Date: Fri May 16 10:31:58 2008 -0400 Redo RANDR compatibility output selection. Old logic was just the first one that happened to have an associated CRTC. The new logic tries to find one that's definitely connected, has probed modes, and has the largest candidate mode. commit a4bbe1c8bca08f3df5ff7e50444af6aef7ec8b25 Author: Adam Jackson <ajax@redhat.com> Date: Fri May 16 10:25:12 2008 -0400 Re-add sync range inference from legacy setup to RANDR 1.2. commit f52f6c5c7efc281f9ac204fbaa4f71383df7463d Author: Adam Jackson <ajax@redhat.com> Date: Mon May 5 14:37:07 2008 -0400 Fix hal shutdown crash. Removing the device invalidates its ->next pointer. Copy it aside before destroying the device. commit 99e4531f7c3fafce065dfd21f65bad1cf190c3f1 Author: Adam Jackson <ajax@redhat.com> Date: Fri May 16 08:16:01 2008 -0400 The great kdrive purge. Most of these drivers didn't work. ati was the only one that even came close. The igs, ipaq, itsy, pcmcia, savage, sis530, trident, trio, ts300, and vxworks directories have never built since modularisation, so clearly no one can miss them. commit fc7e2566cc076c0d979f74871bc436df43401058 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 16 16:59:34 2008 +0930 Xext: fix typo in condition. Fall-out from dc3aba8a559d4304844ee1cc306c577a63b82762. We must free the event if it is NOT an extension event. commit 6fb76acc4524d6af4bfb6bc6d862c1ee2bbb8baa Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 16 19:22:32 2008 +0930 mi: remove miPointerUpdate() -> replaced by miPointerUpdateSprite(). In the xnest and vfb DDX we don't need the call anyway, it's performed by mieqProcessInputEvent. commit dfb7de6571345061d1cd88ab915064fc376529fd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 16 20:56:04 2008 +0930 mi: don't call from miPointerMoved into the spriteFuncs for anything but VCP. Calling ->MoveCursor for anything but the HW-rendered VCP causes the SW-rendered cursor routines to be started, including mallocs, etc. Since miPointerMoved is called during SIGIO, this is a bad idea. commit f611719edce2ae51dca8e53947a3938b53c20b00 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 16 19:49:29 2008 +0930 xfree86: always render first cursor in HW, all others in SW. commit 48ba58feacedf9781db81c82adbb37197d9a5cd1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 16 19:22:32 2008 +0930 mi: remove miPointerUpdate() -> replaced by miPointerUpdateSprite(). In the xnest and vfb DDX we don't need the call anyway, it's performed by mieqProcessInputEvent. commit 622d7c1d899a6146773a2ebd1d632a805f24025e Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed May 14 14:49:09 2008 -0300 Restructure and organize the code. It was removed and simplified some conditionals. We don't need test for pDev->isMaster inside xf86CursorSetCursor() because only MD enters there. In the last chunk, ScreenPriv fields were being assigned without need, so that code was wrapped inside the conditional to avoid it. I also tried to make the identation more sane in some parts that I touched. Signed-off-by: Tiago Vignatti <vignatti@c3sl.ufpr.br> Minor modification, part of the original patch led to cursors not being updated properly when controlled through XTest. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 5af90025fee6a92e7d94642978feed21f902d0cb Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed May 14 02:45:49 2008 -0300 Remove redundancy. The only function that cat set SWCursor before xf86DeviceCursorInitialize() is xf86InitCursor() when VCP and is created. Signed-off-by: Tiago Vignatti <vignatti@c3sl.ufpr.br> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 9fc94edfe3df4c4a84ad70714c0a4ef8bbf57fc9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 16 16:59:34 2008 +0930 Xext: fix typo in condition. Fall-out from dc3aba8a559d4304844ee1cc306c577a63b82762. We must free the event if it is NOT an extension event. commit 5127942f80983b2e053dddd5c5747d0c3d2f9d6d Author: Brian Rogers <brian_rogers@comcast.net> Date: Fri May 16 10:08:04 2008 +0930 DGA: pass nevents to UpdateDeviceState. #15936 Missing parameter caused event processing to go nuts when checking valuators. X.Org Bug 15936 <http://bugs.freedesktop.org/show_bug.cgi?id=15936> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 28378d26b4bae377ef1212f6a51cda9b5529f1b5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 15 11:09:15 2008 +0930 Xi: assemble button/modifier state before updating the device. #15934 The state field of the event must specify the state of the devices before the event occured. With the code as it was, the state would also include the event (e.g. state from a button press event would show the button as pressed) Gathering the state before updating the device should fix this. X.Org Bug 15934 <http://bugs.freedesktop.org/show_bug.cgi?id=15934> commit 7cabf81c8638739a15a1be6baa3fc569f38e7589 Author: Eric Anholt <eric@anholt.net> Date: Thu May 15 13:24:27 2008 -0700 Add necessary include for COMPILEDDISPLAYCLASS. Fixes build after 07f69023b0e75d98a4be8f0d1c3dd9391b8149a0. commit 07f69023b0e75d98a4be8f0d1c3dd9391b8149a0 Author: Adam Jackson <ajax@redhat.com> Date: Wed May 14 16:07:51 2008 -0400 Move defaultDisplayClass to xdmcp-only visibility. commit 166177e36bfc7bd1df03663ad89500cff056d563 Author: Adam Jackson <ajax@redhat.com> Date: Wed May 14 16:02:05 2008 -0400 Simplify default font path setup. commit 2efe1abb6fc786a4f86464978ae0d23fc7347a98 Author: Adam Jackson <ajax@redhat.com> Date: Wed May 14 15:53:11 2008 -0400 Remove global argc/argv variables. Was only used in the logging code anymore, and uselessly so there. commit 6c27b911222cdee9a057de0be7e8b2eff8b1ff2a Author: Adam Jackson <ajax@redhat.com> Date: Wed May 14 15:44:04 2008 -0400 Restore compression of duplicate log file entries. This undoes the workaround for bug #964, which was an Xprintism. commit 937e5aae33d3b5112b5d10d605e25f57b48caa3f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 14 22:30:15 2008 +0930 dix: don't undisplay cursor if we don't own a sprite. Sometimes we didn't have a cursor when coming back from suspend. Reason was that the suspend caused the server to lose the device that was attached to the VCP, and a RemoveDevice() would then set the cursor to NULL. Solution: only set the cursor to NULL if we actually own the sprite. commit cbb4e80eb7cc8dc2aff5e5268b49cdb7b3c3d5fa Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed May 14 01:13:15 2008 -0700 XQuartz: More work on the Mach-IPC startup path (cherry picked from commit 49cd0b185fd6c99b07357a74734b6a4023faca84) commit 3b57c59bb08c9a3211f4ae57d9e2fb569d61bf2f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 13 10:40:20 2008 -0700 Xquartz: More work on the new Mach startup (cherry picked from commit 6237acf75d3310d7d4f262556b677557c2907284) commit e435acc84cb9477455ad005cee658630cbd363a2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 12 17:57:07 2008 -0700 Added missing to EXTRA_DIST (cherry picked from commit e39613f4633ed992bc276b70833a703560e528f9) commit f7d6d20ad64b235700185784d317417a94d1814b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 12 13:36:35 2008 -0700 XQuartz: Cleaned up the about box. (cherry picked from commit 0279a5970694937e949ba533330ea48961c4edba) commit b37e1f1f5ccc5a48df665449b0e31c4d25cc323c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 12 11:34:06 2008 -0700 Don't need the fink-friendly printf in the DDX anymore. (cherry picked from commit fe2279440450c795d67ba5a2234b0797d0bfe39c) commit 68b4f250eef441a3d75e3b9b2665a51d3a1538d6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 14 16:18:48 2008 +0930 dmx: fix build. Just because it builds, doesn't mean it works. commit 00db0f35acc00cb771ab1c23f35b0db1c25d81bb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 14 15:29:28 2008 +0930 dix: InitAndStartDevices doesn't need a window parameter. Leftover from the old pointer-keyboard pairing code, obsolete and gone now. commit da728f2127aaa5c1ed5d22bb9f3d0c8ff19e4933 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 14 15:17:05 2008 +0930 dix: don't use serverClient in AddInputDevice, use the one supplied instead. We pass in the client that wants to create the device anyway, lets use the parameter instead of hardcoding the serverClient. Wow. I hope this is merge detritus, otherwise it'd be a sign that I didn't have enough coffee that day. commit a6659291c798f417a76d9aa7944694ff27c01fa7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 14 09:42:50 2008 +0930 mi: protect against NULL-pointer dereference. Required by the recent patch to use a NullCursor instead of UndisplayCursor(). commit 7cdc19b29d93bf15cecfd6b69e269fab2501bca0 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue May 13 16:39:30 2008 -0700 When XKB fails to open rules file, log the file name, not the NULL file pointer commit dc3aba8a559d4304844ee1cc306c577a63b82762 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 13 14:37:26 2008 +0930 Xext: emulate XI events from core events when faking input. We need XI events for event processing, so lets get rid of the pure core events ASAP. commit 8b3802d32041547fd6ed5393a56281c5c83d260e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 13 13:47:52 2008 +0930 Xext: core button events have rootX/Y unset too. commit ed65e8b4f02a6da7f1c5d85984a9ccf6a94d0181 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon May 12 18:49:34 2008 -0700 Check for strcasestr and workaround it on systems without it commit 8234af6c6a3ade13f7720743bde79957c7df3f6c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 13 11:17:39 2008 +0930 xfree86: remove Ubuntu-ism. Additional #include was required due to broken libc headers or something like that. Remove it, there's more to the world than ubuntu alone. commit 59b8d29b3a91c65787dfadb5610342a62e85c48c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 12 21:22:54 2008 +0930 Xi: Fix up ProcIVector, got out of sync with the protocol. When the opcode squash happened in the protocol, the processing vector got out of sync for a few requests. As a result, client and server would interpret requests differently, leading to a couple of BadLength problems. commit 1fc1a2897e9185838c29d9ffff07c39d2fdf174f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 12 20:14:05 2008 +0930 Remove UndisplayCursor API. We can achieve the same thing by simply displaying a NullCursor, there's no need for a separate API. commit 913989d643595030e67e7c0a758a16ae0da62ed9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 12 20:05:43 2008 +0930 mi: don't try to display a cursor for devices w/o cursors. commit 248a1df63430717550adb0e79068d8f9fcfacb0b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 12 20:05:21 2008 +0930 render: don't dereference cursor if cursor is NULL. commit c50b5d978981b13cdb22a9ad41c1b64f90cebe51 Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun May 4 13:45:27 2008 -0700 Bug #14692: Allow drivers to have a say in Xinerama visual consolidation. Create a new exported global variable, XineramaVisualsEqualPtr. Use this pointer to decide whether two visuals are equal during visual consolidation. This pointer can be wrapped, which allows drivers and extensions to control which visuals are consolidated. A wrapper can reject the visuals without calling down, but must call down and return that result if it deems the visuals equal. This ensures that all layers agree that the visuals are equal. Pass the screen of the other visual into the VisualsEqual callchain. Don't free PanoramiXVisuals since we need it for PanoramiXTranslateVisualID. Don't skip the first visual on the other screen in PanoramiXMaybeAddVisual. Skip the loop in PanoramiXTranslateVisualID if screen is 0. commit 86678e7cc2b021851ff508433fa160170f500c51 Author: Adam Jackson <ajax@redhat.com> Date: Mon May 12 14:53:37 2008 -0400 Fix fbdevhw initialization for PCI drivers. graphics/fb%d, not graphics:fb%d. Thanks sysfs. Thysfs. commit 1c8bd318fbaf65890ef16fe26c76dd5e6f14dfde Author: Adam Jackson <ajax@redhat.com> Date: Mon May 12 14:15:11 2008 -0400 X n'est pas une print API. commit f9fae16456c30479b0cb9317e57200af36795785 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 12 10:36:44 2008 -0700 XQuartz: Added some version checking protection so we don't trigger an infinite exec loop with new /usr/X11/bin/Xquartz and older X11.app (cherry picked from commit 78032815aeb10c22ff45b49702e9c9df82ab471c) commit ac4e33a9cd0ca2f0ec76181d11d5b90b82690c05 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 12 09:27:27 2008 -0700 XQuartz: More startup work... listen if we're the actual server (cherry picked from commit 3b0afb47c3d8ad922cb2315ed8034f4d77d4a249) commit a7800d9355377ac02833613c2ffc2423beec9970 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 9 16:44:31 2008 -0700 XQuartz: Starting to work on the new Mach IPC startup stuff for better launchd, ApplicationServices, and Dock support (cherry picked from commit 9b67fca9b7d3050d3d5582a5210270db7eb2ed05) commit 04211c3532ca078420e3745a5eac3d9de120bc32 Author: James Cloos <cloos@jhcloos.com> Date: Mon May 12 03:03:13 2008 -0400 Prevent the -wm command line option from causing a SEGV The -wm (when mapped) option for the BackingStore support has been causing the server to dereference a NULL pointer. This has probably been the case since backing store has been implemented on top of Composite. It looks like (some of?) Composite didn’t expect its WIndowPtr argument to be the root window. In Composite’s compCheckRedirect() function we now avoid calling compAllocPixmap() and compFreePixmap() when the pWin pointer’s parent member is NULL, as is it the case with a server’s root window. This addresses: https://bugs.freedesktop.org/show_bug.cgi?id=15878 commit 7e768c08f7809b8dba4db1931e63314e2b6e1cfa Author: James Cloos <cloos@jhcloos.com> Date: Mon May 12 02:53:59 2008 -0400 Clean up whitespace commit 3b6735528efc6d69ab7a7cd63dd09c87db7ef115 Author: Dave Airlie <airlied@redhat.com> Date: Mon May 12 16:36:42 2008 +1000 pci: don't do this pci stuff when we don't have hw access commit 9dfb525f6c91acab5d1a65765a046bf9ee2aa082 Author: Julien Cristau <jcristau@debian.org> Date: Sun May 11 23:17:27 2008 +0200 kdrive: allow disabling Composite KdInitOutput() used to enable Composite when it was disabled by default, but now this hack prevents ``-extension Composite'' from working. Remove it, as Composite is enabled by default anyway. commit 1a01e96c6d15ef17a8b5ab1afa361fb12476a25e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri May 9 15:38:44 2008 -0700 Return a valid X error when stuck in font alias loop Part of fix for Sun bug 4258475 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4258475> commit 7b3066d9b9099135d9c49e0682161d5568fc535b Merge: 2a3d142 315f089 Author: Drew Parsons <drew@emerall.com> Date: Sat May 10 00:01:15 2008 +1000 Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver into upstream-experimental commit 2a3d1421e0cc18822ae8f478fcc272e16a9e9340 Author: Drew Parsons <dparsons@debian.org> Date: Fri May 9 23:20:11 2008 +1000 Disable D-BUS from Xprint. Use dummy config functions to replace those from config/config.c, and therefore do not link Xprt with $CONFIG_LIB. Works around an endlessly spinning loop in dix/dispatch.c::Dispatch() (WaitForSomething() not waiting) when built with dbus, which was causing Xprt to use 95% cpu. commit 315f089056da67d4c463ed002eb2b74e38493b49 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 8 19:46:03 2008 -0700 XQuartz: Reorganized some of the build system in prep for the Mach IPC startup work. (cherry picked from commit 2232c91d5c277673929eab2abb5e0495c00877cb) commit 28ac79450c69219dc501e072c6e5028e7136380d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 8 19:47:40 2008 -0700 Updated .gitignore for new Xquartz layout (cherry picked from commit cd4d2355e227549a3410485a130549dd91ccdcfe) commit a07c5ad172b343ef26d2b41ff25f143950441c23 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 8 16:57:42 2008 -0700 XQuartz: Set bundle version to 2.3.0 (cherry picked from commit 8a0524b30e1e860f3ae35741c116fc8da28aef79) commit 05f23ed3ea6ee0f052aee41b6573325fe0063fd8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 6 16:12:41 2008 -0700 XQuartz: Fixed some issue in our bundle creation (cherry picked from commit 330ffad5477e32c5ab9ed338bc628bd5ae9f4c98) commit 90b963c0da2b33bdc21483f1a089b95c7e717333 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 6 16:07:33 2008 -0700 Set CSRG_BASED on OSX (cherry picked from commit ff085deba18682caa2f93d61a75b38db87d747b1) commit ff013b0da4e6d33b2b69ce1212e9bd62050574e1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 8 16:58:31 2008 +0930 config: override xkb_{r,m,l,v} with Xkb{r,m,l,v} if the latter is set. The HAL spec says that input.xkb.{rmlv}* can be sent, but if the user specifies a X-specific {rmlv}, then this is overridden through the use of input.x11_options.Xkb{RMLV}. However, the way how the server parses options--by ignoring capitalisation, underscores and spaces--the HAL and the x11_options would override each other. So we simply filter the options, letting Xkb{RMLV} override xkb_{rmlv} and only actually add them to the device after parsing _all_ options. * rmlv ... rules, model, layout, variant See Bug 13037 <http://bugs.freedesktop.org/show_bug.cgi?id=13037> (cherry picked from commit fc35d1e3be201e3821413bb2eeb8d43e1e56ba17) commit 901978ebe0f446532255701cd536e246e805a55b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 8 14:05:56 2008 +0930 config: remove trailing whitespaces. It makes my vim look ugly. Put "let c_space_errors=1" into your .vimrc. (cherry picked from commit 1f54c05cf8a6b82e5fc6362f7f8e8fdc2444b9e8) commit 1c54c148895225e4ab3c781fe57d09e5f64353aa Author: Daniel Stone <daniel@fooishbar.org> Date: Fri May 9 00:26:16 2008 +0300 Revert "GL: Make errors non-fatal" Turns out this just caused segfaults further down the line. Oops. This reverts commit 268d61e00cf4bc52c05f19eda7ab4f6accce12c8. commit f17ba5d5849c92603f453195aca384844ca76d74 Author: Adam Jackson <ajax@redhat.com> Date: Thu May 8 16:04:24 2008 -0400 Bug #13104: Remove broken XAA a1 glyph fast path. commit ddaecfa13cefee7c66b39b606c8640c6544d4943 Merge: 9c2e087 cf20df3 Author: Adam Jackson <ajax@redhat.com> Date: Thu May 8 14:33:58 2008 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit fc35d1e3be201e3821413bb2eeb8d43e1e56ba17 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 8 16:58:31 2008 +0930 config: override xkb_{r,m,l,v} with Xkb{r,m,l,v} if the latter is set. The HAL spec says that input.xkb.{rmlv}* can be sent, but if the user specifies a X-specific {rmlv}, then this is overridden through the use of input.x11_options.Xkb{RMLV}. However, the way how the server parses options--by ignoring capitalisation, underscores and spaces--the HAL and the x11_options would override each other. So we simply filter the options, letting Xkb{RMLV} override xkb_{rmlv} and only actually add them to the device after parsing _all_ options. * rmlv ... rules, model, layout, variant See Bug 13037 <http://bugs.freedesktop.org/show_bug.cgi?id=13037> commit 1f54c05cf8a6b82e5fc6362f7f8e8fdc2444b9e8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 8 14:05:56 2008 +0930 config: remove trailing whitespaces. It makes my vim look ugly. Put "let c_space_errors=1" into your .vimrc. commit 1a314a1ef06222977e7ccb94331ce31c17534b2a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 8 13:16:48 2008 +0930 Revert "config: deprecate (and ignore) the use of input.xkb.whatever options." daniels: "Hrm, I'd prefer to have input.xkb.{m,l,v,o} be the primary keys, and have input.x11_options be a backup for that, rather than the former being deprecated, for the reasons I listed earlier ..." see http://bugs.freedesktop.org/show_bug.cgi?id=13037#c51 This reverts commit 26188875de1ccc84ac60bfb251e3ec43de2b9e22. commit cf20df39cc78203d17b99223908af388ecbf7d0e Author: Daniel Stone <daniel@fooishbar.org> Date: Wed May 7 22:24:19 2008 +0300 XKB: Actually explain keymap failures When something went wrong building a keymap, try to explain to the user what it actually was, instead of the dreaded 'Failed to load XKB keymap' catch-all. commit 641a5f955b7b3ae04eeb6bc45fb30b0b531898e4 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed May 7 22:29:04 2008 +0300 Build: Ensure xf86DefModeSet.c ends in an empty line This shuts up a warning. commit 268d61e00cf4bc52c05f19eda7ab4f6accce12c8 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed May 7 22:28:45 2008 +0300 GL: Make errors non-fatal GLX, there's more to the world than just you. If you fail to load the software renderer, don't bring the entire server down. The error path probably needs better testing on this one, but it seems mostly okay to me. commit 9c2e0871cfbe54e73eec1f790a7e383d08555055 Author: Adam Jackson <ajax@redhat.com> Date: Wed May 7 13:21:26 2008 -0400 Bug #13104: XAA: Adapt to glyph storage changes. Glyph bits are now stored in a proper pixmap, not just hanging off the end of a GlyphRec. commit 26188875de1ccc84ac60bfb251e3ec43de2b9e22 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 7 13:13:57 2008 +0930 config: deprecate (and ignore) the use of input.xkb.whatever options. These options are still sent by some HAL implementations (e.g. HAL on FC8), and may overwrite the options set in the x11-input.fdi file. For a more detailed description of why see Bug #13037, comment 42. X.Org Bug 13037 <http://bugs.freedesktop.org/show_bug.cgi?id=13037#c42> commit b6a0c6d4864f73a18beb841b16e9be56f2fcd77e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue May 6 17:06:34 2008 -0700 Allow using libmd instead of libcrypto for SHA1 hashing in render/glyph.c Builders can force one or the other by passing SHA1_LIB & SHA1_CFLAGS to configure commit 718652eaf9221e0eeec2c971dd7baa97f827451b Author: Adam Jackson <ajax@redhat.com> Date: Tue May 6 17:52:37 2008 -0400 Bug #13104: Don't let XAA glyph pixmaps anywhere near video memory. Since glyphs are stored in pixmaps now, they can make their way into VRAM, which invalidates a bunch of fast-path assumptions in the XAA code. Thus you end up doing color-expands or WriteBitmap from la-la land and your aliased glyphs go all funny. Since XAA isn't ever growing the ability to do sane glyph accel, just force glyph pixmaps into host memory by catching them at CreatePixmap time. commit a85d3ac87cc354093bb1e88697c44254e7721bb9 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 6 02:59:13 2008 -0700 XQuartz: Fixed typo (cherry picked from commit 56b7988d2662caa4d31094695b414080e4470ed4) commit 077ced6384abad78253e857091e78f3685965b9d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 6 02:47:03 2008 -0700 XQuartz: Added uncommitted files (cherry picked from commit e414ec462cfc63f8eb7f504f526f5a2c73f51e69) commit 80e502c5d1f7e9221c6ae40716d6402fd28d8806 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 6 02:28:36 2008 -0700 Fixed up dist (cherry picked from commit f225222ba2bf4f03425107f258d60b73c88efaec) commit 7295e544332b0fa929f651304f9d4aca3db4a33e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue May 6 00:06:19 2008 -0700 XQuartz: Move server bits into bundle and setup stub in /usr/X11/bin/Xquartz in prep for startup rewrite (cherry picked from commit 453a982e6382cff06ea27abba225440b07068f50) commit d41d677ab4118e73140ea2392e0d48eb361af1cf Author: Ben Byer <bbyer@bushing.apple.com> Date: Mon May 5 20:55:08 2008 -0700 Xquartz: experimental embedding of Sparkle.framework (cherry picked from commit b7a1a640cef8c69442859cbf89034ad362a19684) commit 9e0d73fd8a43647b648ec5b2f0bcaae30c03259c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 6 17:52:15 2008 +0930 xfree86: call SetCursor for the VCP when switching between SW/HW rendering. We need a manual call to SetCursor when we switch from SW to HW rendering and the other way round. This way we display the new cursor after removing the old one. In addition, we only update the internal state for the VCP's sprite. This way, when we switch back to HW rendering the state is up-to-date and wasn't overwritten with the other sprite's state. The second part is a hack. It would be better to keep a state for each sprite, but then again we don't have hardware that can render multiple cursors so we might as well do with the hack. commit e4ebfed1785597b48b68e1bbdde3e5c4061b749f Author: Dave Airlie <airlied@linux.ie> Date: Tue May 6 16:46:37 2008 +1000 xf86edid: fix typo in debug output commit b9c1a57e7a98dea63cd362f714411547e728a85a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 6 14:51:23 2008 +0930 xfree86: switch between to SW cursors if more than 1 sprite is available. Switches back to HW cursors when sprites other than the VCP are removed. The current state requires the cursor to change shape once before it updates to SW / HW rendering (whatever is appropriate), e.g. by moving into a different window. Until this is done, the cursor is invisible. commit 3df88c17e315b5ae580096e4bc88920d1f452e83 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 6 11:50:20 2008 +0930 xfree86: re-enable hardware cursor (for a single cursor) This commit enables HW rendering for cursors again, but only for a single cursor. Other cursors can be created, however they will not be visible. commit 6acc2acd0db2826add7c47e94e4061d169a41f88 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon May 5 15:32:26 2008 -0700 Rootless: mi doesn't let us resize root, so we need to do it ourselves... (cherry picked from commit c1ec36e28cff857664090cc8792db1ae93b783fa) commit efa65a0317e12c9ad34fa00fe90bf5eae9fa2670 Author: Keith Packard <keithp@keithp.com> Date: Sun May 4 21:52:58 2008 -0700 Rework composite overlay window code to fix several resource management bugs. The composite overlay window code had several misunderstandings of the workings of the X server, in particular error handling paths would often double-free objects. Clean all of this up by using resource destruction as the sole mechanism for freeing resource-based objects. commit 6c1accce87c9bd640c1b4bbc49bae7d44b1cc97b Author: Keith Packard <keithp@keithp.com> Date: Sun May 4 21:51:08 2008 -0700 Empty the borderClip of manual redirect windows. (bug 15823) Thanks to Owen Taylor for root-causing this one. If a TreatAsTransparent window has any area in the borderClip, that will be added to the totalClip region for use by other windows. That's wrong. Instead, simply empty the borderClip for TreatAsTransparent windows right up front. commit d500eeb9458336780d77baf8b7db96e1f7ff4f0d Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun May 4 10:26:25 2008 -0700 Xephyr: Handle depth 30 and reject higher depths rather than crashing. commit f4a68f3701889950d3b98842d021f357f3913fea Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 2 17:35:57 2008 -0700 XQuartz: Fix mouse input offsets earlier since GetPointerEvents does not like negative (x,y) values (cherry picked from commit 8d9eab3a2ec5955cc2698fdcb1fa6ed12b2aadb7) commit 96fa7da3b87e2f9187ec13dad259beefdc17cd94 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri May 2 16:53:45 2008 -0700 XQuartz: Avoid a possible crash at startup due to unfavorable context switching. (cherry picked from commit ff10c37bdd09656cf2f7ee9577f5552caa1ffdb8) commit 6f63724b28c8b3fd85314fb95d1e4f363b610e19 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 2 14:56:58 2008 +0930 xfree86: don't try to repaint the cursor before cursors exist. commit 334456952930cb3e55c02fcdada2d0c074cd0520 Merge: 8e56fd9 3b8d534 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 2 11:00:14 2008 +0930 Merge branch 'master' into mpx Conflicts: Xi/exevents.c dix/devices.c commit a338007be6fd4302af012109d959f43ac7eab2b1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu May 1 18:02:59 2008 -0700 XQuartz: Adjust the screen origin offset properly for multimonitor setups (cherry picked from commit f2020b9836bacd0593ac0b4c8541e32714ab02a9) commit 8e56fd9728d63a7a48ef44503425c6e25c7c9ffb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri May 2 10:22:06 2008 +0930 dix: continue to check for invalid valuator ranges. In an ideal world, the drivers would init all axes with NO_AXIS_LIMIT. In the real world, this is an ABI break, so let's just leave the old check in. commit 3b8d53452cd6c74d32d7759964a7cd9ee775f161 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu May 1 15:10:52 2008 +0200 EXA: Fall back in CompositeRects if the driver can't accelerate Composite. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=15780 . commit 01c61f3d972fc2f4e5bb536dd00d8b6bbeb0fb3d Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Thu May 1 01:02:39 2008 -0300 xorgcfg: Fix a crash if xorg.conf doesn't have a Files section. This patch only creates a Files section if required, so if no entries are added, an empty Files section will not be created. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 6899ff81e8f668382e3e2f9afdd9cdf51d0e0f7d Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Wed Apr 30 16:38:42 2008 -0300 Fix an off by one read error in drmSIGIOHandler(). Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit ec0419b50534006a272278b79ee51538193661cb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 30 17:30:57 2008 -0700 XQuartz: Moved some relevant stuff from darwin.h to darwinEvents.h (cherry picked from commit 1fcf74a436f2e19cceb3f285b89859025d94c040) commit 28d1e21f1523d475cb757d3cfa33737ed62c534d Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 30 17:30:32 2008 -0700 Dix: Cleaned up sanity checking in Get{Pointer,Keyboard}Events XQuartz was crashing because the Appkit thread was trying to GetXXXEvents while the Xserver thread was exiting. This adds some more sanity checks and avoids that crash (cherry picked from commit 34ec4bd6acb834c0e3f9a5042a0cc3f52c6f3a68) commit ce36ae526d88d20ff67cd6cb429fb06f48d231f6 Author: Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> Date: Wed Apr 30 11:58:32 2008 +0300 Add M32R architecture support (bug #10020) Still needs autotools support, so this won't actually _build_: it's just a starting point. commit a0e6a7d4f507c5c0a0b11adb10394af58a0a6e07 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 30 17:57:48 2008 +0930 dix: resize EQ to minimum size to avoid reallocs during SIGIO. When a new device is added, calculate the event size needed if a DCCE event is sent and set the EQ's event size to this minimum. This avoids reallocs when a event is sent (which may happen during a SIGIO). commit b71b51c982706501b6229532ce342752207426bb Author: Ben Byer <bbyer@bushing.apple.com> Date: Tue Apr 29 23:37:58 2008 -0700 xquartz: created darwinTablet, to represent tablet events (cherry picked from commit 50641bce730ee03738fa0c4beb8125b34fda556f) commit 519581b0bab5cc6dac397877da485745f18c2120 Author: Ben Byer <bbyer@bushing.apple.com> Date: Tue Apr 29 23:00:09 2008 -0700 xquartz: remove unused params from DarwinEQInit (cherry picked from commit 299a056737168ca1faefd675dce6d6ab13176be9) commit d70487a4c09cfeb90d996ab40a23a74b2c15be6f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Apr 29 23:59:26 2008 -0700 XQuartz: Fix to tablet-event handling code; we now scale more conservatively (to match Linux's Wacom driver) and we now receive all tablet-related events. (cherry picked from commit 588683cecca2cfc65a28de035cd6ee3d64ff59d2) commit fea39c94bcc8b635d37530d8a27ee92acab484fe Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 30 13:17:14 2008 +0930 dix: fix typo from last commit. commit ffaccc2dc91f4ca4ea10da010206a0a7d2b5540c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 30 11:45:19 2008 +0930 input: replace -1 as default axis limit with NO_AXIS_LIMIT define. This allows easier refacturing of the coordinate limit handling. Grepping for -1 is boring. commit 00acb40f2bc5bb4a1977b9b08db75630677ff787 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 30 11:29:03 2008 +0930 dix: fix typo in clipAxis. Check needs to be (min_axis < max_axis), not (min_axis < min_axis) commit f65a1a62f9eac2f6620d5d469dbf6c79b2eadab7 Author: Hong Liu <hong.liu@intel.com> Date: Tue Apr 29 09:00:11 2008 -0700 Keep rotation wrappers in place while transforms are in use LeaveVT/EnterVT cycles will free/realloc shadow frame buffers. Because of this, the presense/absence of that data is insufficient to know whether the screen function wrappers are necessary. Instead, the 'transform_in_use' flag should be used. This patch also adds 'xf86RotateFreeShadow' for drivers to use at LeaveVT time to free the rotation data; it will be reallocated on EnterVT. commit 18b33dd4ff46f63bad70b493b1d0b0758c961ada Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 29 15:24:55 2008 +0930 Xi: stop excessive use of _X_EXPORT. commit 2b179c32ac40f5258d95ae16da96a79fa8eea696 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 29 15:15:16 2008 +0930 include: add declaration for CopyGetMasterEvent to shut up compiler warning. commit ff36753755360aaa16ab8604a0ab78123884b57d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 29 14:53:41 2008 +0930 mi: call the custom event handlers for both MD and SD. commit ec2fca7e6f7ce8fdf33d959b7adeaae935ec4b37 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 29 14:40:44 2008 +0930 xfree86: DGA needs to call into Xi. Two steps: first use UpdateDeviceState() instead of replicating the device changing code. And emulate XI events instead of core events. commit 8208b842b7dd3b30bafdd74147bdfa63bc00cc40 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 29 14:19:42 2008 +0930 Xi: add IEventBase global variable. Stores event base for X Input events. commit 46340b740640b76b52b8e69bc67f9201c7e974c3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 29 14:17:48 2008 +0930 Xi: change UpdateDeviceState to be _X_EXPORT. commit 3a922c5d07509703a3eeda2bbec6f332e6b0ffac Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 28 17:32:54 2008 +0930 Xi: apply ValuatorEvent data to the device's valuators. After UpdateDeviceState, the device has the current position in absolute coordinates, the event has the correct valuator data to be delivered to the client. commit f2a20294fe26f4c9d245d24d065331fefd8f830d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 28 16:56:22 2008 +0930 dix: store all valuators as they come from the device in the valuator events. The event's sequenceNumber is mis-used to determine whether the values are relative or absolute. commit d5ab89f4f1acbe2614036e8934122185ac0f81ee Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 28 15:52:24 2008 -0700 XQuartz: Unset CFProcessPath... blech (cherry picked from commit ce4fbfbc75c62a092214d140c7550279aebe69ef) commit 0c2312b21b6700c1425baccaf9c26150b4f0fd6a Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 28 15:28:21 2008 -0700 XQuartz: xprIsX11Window can be called from the Appkit thread (see X11Application.m) (cherry picked from commit 22cf72437601c07b8a6c744b4f2f1f4cd6713e60) commit c3dc4bdbb018c0606d561e2dfb9a36e9297fa312 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 28 15:42:02 2008 -0700 XQuartz: Disabled DPMS extension (cherry picked from commit 1448fed9b6d484f471b9b2982c76ca921a9273b9) commit 07382a70c7ac9807dfb31821a4763bea2309bde6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 28 12:36:54 2008 -0700 XQuartz: Added thread debugging to xprFrame.c (cherry picked from commit 41542502b321c697271c1752525b600872b6df96) commit 8349732a6720652bfbad7874a952be73a0e8e77b Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Apr 28 21:09:35 2008 +0200 EXA: Try to accelerate non-antialiased text via the glyph cache as well. Treat 1 bit glyphs and masks as PICT_a8 in the glyph cache. We're not able to accelerate them otherwise. commit a65d530040bb561ba88c5d8c71633a7c0bf11e89 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Apr 28 21:03:12 2008 +0200 EXA: Accumulate glyphs whenever possible, for full benefits of the glyph cache. commit e7eaac59c424a205dd106fc7d70734ff4b390f28 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Apr 28 21:00:55 2008 +0200 EXA: Glyph cache upload tweaks. Track damage after using UploadToScreen directly. Don't waste any effort on empty glyphs. commit cc08c06665ffe29ad44d023d75d0f86e5338875d Author: Owen Taylor <otaylor@huygens.home.fishsoup.net> Date: Mon Apr 28 21:00:55 2008 +0200 EXA: Use UploadToScreen() for uploads to glyph cache When possible, use UploadToScreen() rather than CompositePicture() to upload glyphs onto the glyph cache pixmap. This avoids allocating offscreen memory for each glyph making management of offscreen areas much more efficient. commit 13fd2256300b61d88b840952d838f834523f5dd7 Author: Owen Taylor <otaylor@huygens.home.fishsoup.net> Date: Mon Apr 28 21:00:55 2008 +0200 EXA: Clean up debug messages commit fcb5949928f1c27f67f40c094c3c673786574422 Author: Owen Taylor <otaylor@huygens.home.fishsoup.net> Date: Mon Apr 28 21:00:54 2008 +0200 EXA: Fix overlapping glyphs in glyph cache Allocate each cache at a different vertical position in the per-format pixmap. Fix width/height confusion when choosing the cache for a glyph. commit 40eb14c9482457969e0bde97c49edad536285e02 Author: Owen Taylor <otaylor@huygens.home.fishsoup.net> Date: Mon Apr 28 21:00:54 2008 +0200 EXA: Add exaCompositeRects() Add a function to composite multiple independent rectangles from the same source to the same destination in a single operation: this is useful for building a glyph mask. commit 54184110f6f3e5d7276d5431e739a4fcf0c3523e Author: Owen Taylor <otaylor@huygens.home.fishsoup.net> Date: Mon Apr 28 21:00:54 2008 +0200 EXA: Use a single large glyph cache pixmap Add back exaGlyphs(); the new version copies the glyph images onto a single large glyph pixmap and draws from their to the destination surface. This reduces the management of small offscreen areas and will allow us to avoid texture unit setup between each glyph. commit e9734306088e12f2cd68bf347ecf8415be4f0268 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 28 11:47:49 2008 -0700 XQuartz: More startup / threading house cleaning. (cherry picked from commit 72653c24c00dfba64ce35a3d400598bcd77defc1) commit 4b46fc931e61bec0abd6a86062e46dd7a408e745 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 28 10:50:51 2008 -0700 XQuartz: Updated Localizable.strings (cherry picked from commit d8d9c866b90fb24c93bd6e25fa90f8f2bf58ad34) commit 4017ebe5bfa7a261cd1135801756c44e9fe93ca1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Apr 27 00:01:14 2008 -0700 XQuartz: Added missing Xquartz.man.pre to EXTRA_DIST (cherry picked from commit 03e707987f7f32e47dd0355c6d16bfb9169a379b) commit 53dba5381fdd8f644e16aaa0ecb05df4dc615b23 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 28 11:37:52 2008 +0930 dix: if alloc of a master keyboard fails, remove the master pointer. commit 1fab51edfc82e1ef60dfa29fd5d93478066a3998 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 28 11:37:21 2008 +0930 mi: guard against NULL-pointer dereference. commit b5004722a208479a4bc762ff428bf4cbeb430d53 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 28 10:26:01 2008 +0930 Xi: Only return VCP, VCK and floating SDs to Xi 1.x clients. This is better than the approach implemented with 8973a3f7983240407dd6da59b3643f40e6a3d83a which disabled XI altogether for 1.x. Instead, return a device list that resembles a traditional XI setup on pre XI 2.0 servers. If the client tries to open a device other than a floating SD, return a BadDevice error. commit 0bd28315afc3b7223f8ff9f17597db09500a9388 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 26 23:00:42 2008 -0700 Xquartz: Added missing to EXTRA_DIST (cherry picked from commit f4b963256feb03e9e6b5521bdefeb390e9a49688) commit ef1c52053755fa14b4ca98b22c506f73f5f4a4b7 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 26 19:21:05 2008 -0700 XQuartz: Cleaned up startup and thread creation a tad. (cherry picked from commit c861fe00e112b21ee0156d09a6cd5281642a1dcc) commit b114d4e861885cc5b49cd81b33ad825461811b3e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 26 17:04:49 2008 -0700 XQuartz: Don't subtract the titlebar off of the pointer_y (cherry picked from commit 00a9567acce2b27a649cbebd4790e3043688a7d8) commit 684b5d8382bf0bc6cd55774226ee362e81c0adbf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Apr 26 19:55:59 2008 +0930 Xi: whoops, stray ! caused a bit of memory mess. commit 87071b604c4b7c3c79ab784e2c09ff691e2bc5ad Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Apr 26 19:37:57 2008 +0930 Revert "Xi: disable XI for clients < XI 2.0" Turns out some programs don't like this change. gnome-settings-daemon crashes hard if you tell it that XI doesn't exist. So, tell them we have XI, but leave the other change (the one that pretends no devices are available). This reverts commit 8973a3f7983240407dd6da59b3643f40e6a3d83a. commit 7447a30fb27ed50a20a85b5a2de9afe7dea8cfa5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Apr 26 19:03:13 2008 +0930 Xi: if a pre-XI2 client tries to list the devices, pretend we don't have any. XI 1.x isn't supported anymore, so let's pretend we don't have any devices. This stops clients from opening them and thus stops interference. commit 8973a3f7983240407dd6da59b3643f40e6a3d83a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Apr 26 17:48:52 2008 +0930 Xi: disable XI for clients < XI 2.0 Sorry. With the huge changes in the device handling I honestly don't know how to support XI and XI2 alongside. So let's just pretend XI doesn't exist if a client doesn't request it supporting XI2. commit b304b0a65cc57127cdea103f2c5114e4ea79af41 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Apr 26 17:38:55 2008 +0930 Xi: add versioning support. Remember the version the client sent to us, so we can adjust our replies accordingly. This requires the client to use the {major|minor}Version fields in the GetExtensionVersion request. However, they were padding before, so we must assume they are garbage if nbytes is non-zero. If nbytes is zero, the client is probably a new client and we can handle it correctly. commit b9ca7896356f79ee27be5d5aa62052f6984282b0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Apr 25 17:54:36 2008 -0700 XQuartz: Added some pseudoramiX debug traces (cherry picked from commit 5bee1585a399eab0a7b6fc80ad476d81b5d227d3) commit e251c9e75afdc5e32f2bc9801712272358934266 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 16:49:35 2008 +0930 Remove all traces of #ifdef XINPUT and the matching bits from the configure.ac commit 1d0438de176551aaeff549664f00b8bd83d465af Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 16:28:58 2008 +0930 Xi: remove RemoveOtherCoreGrabs() PickPointer() returns grabbed devices, so we can't get a double grab anyway. commit be5ff2b8d8a392eb8611e1fcd6da4752d68a7f9d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 16:25:13 2008 +0930 Xi: remove some superflous code commit 0209e46249b61974a6e3ed54a51cc36dfaf0064f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 24 23:48:11 2008 -0700 XQuartz: More multi-monitor work... reverted Ben's workaround (worked for side-by-side only) and added more debugging. (cherry picked from commit 515b8b855ac5d2d5aef881053f73b2ad07a6dd2e) commit b65dbd350b8518bb90bed9cdc64dd900bc75d20c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 24 21:14:04 2008 -0700 XQuartz: Cleaned up multi-monitor support. (cherry picked from commit c05abf0a19b0ef0fc4ace9400a095ce2521456bc) (cherry picked from commit 9112f290434c246d3e797551aaaf3a89d2006b23) commit b093bf3ec37367172be3b44a04f0f43890ba7d7d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 15:15:31 2008 +0930 dix: don't search for grabbed devices, PickPointer does it for us now. Follow-up to 93ee33830778b9ec85ad81496572677a30022b09. commit 6198bad07edc51ff4a264a9361c5e9b6c74647a6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 15:02:40 2008 +0930 dix: remove misleading (stale) comment commit 93ee33830778b9ec85ad81496572677a30022b09 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 15:02:13 2008 +0930 dix: let PickPointer() return devices that are core-grabbed by the client. If the client currently holds a core grab on any device, this device has priority, even over the ClientPointer. commit f5ac98747de921d48f36d4f3f66dbe73e26a6760 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 14:50:24 2008 +0930 Standardise copyright headers for all new files created as part of MPX. commit 3fc67b4205851dcffcc431a07a885828549bd9cf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 11:37:32 2008 +0930 Xi: remove leftover chpkpair.h file. Used to contain declarations for ChangePointerKeyboardPairing request handling. commit 89add4ee986e38b833bb58750b3e5a664efb6f4a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 11:19:12 2008 +0930 dix: remove obsolete InitWindowPrivates(). commit dcdc66fcfc7957aa7875fbf74fa3a55989a9a187 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 11:14:32 2008 +0930 dix: add mi.h include to stop compiler warning commit 97552413d213337e4bff8c89b06d58a09d722b05 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 11:13:05 2008 +0930 dix: remove "unused variable" compiler warning. commit d9c38e84cc492b931a2238757d438f562946e5bc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 11:04:02 2008 +0930 dix: remove pairingClient definition. This variable was used originally to determine which client is allowed to change the pointer-keyboard pairing. For now, we just let anyone change it and see how that works out. commit c14b858aeced81ff43723644f2de0f5c43f55755 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 11:02:12 2008 +0930 Xi: fix two compiler warnings unused variable in exevents.c implicit declaration in warpdevp.c commit 6015b7a81252cd1729e6f4045f9b0c885c95b183 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 10:41:30 2008 +0930 Xi: handle requests through a dispatch handler. Same principle as e.g. in the RandR extension, rather than having a load of if (type == XI_whatever) use an array of function pointers. commit cb8cb87bc6decf75832c3724687000ecb658226e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 25 10:09:50 2008 +0930 Xi: remove unused #define DISPATCH commit 5869e3f5551e7e2d18e06a2f220b77d8c4161db1 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 24 19:39:27 2008 -0700 darwin gots /dev/urandom, too yo! (cherry picked from commit bf0144f38034bc59f108bb2c5270ff37fbe70e10) commit b1ae7c79db78cc3b789701f81328669f9f8ed80f Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Apr 24 19:02:43 2008 -0700 Bug 14247: If pkg-config can't find openssl.pc, just link with -lcrypto X.Org bugzilla #14247 <http://bugs.freedesktop.org/show_bug.cgi?id=14247> commit 1daae4574c19a122baf73b6f9457b0d383b1bc66 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 24 18:22:05 2008 -0700 Added missing HAVE_LAUNCHD to dix-config.h.in (cherry picked from commit 1b4b73cefbc2f3e3f6d0cb84ea202f84fb60abb5) commit 63853e4ad211945ed25541223207a78f83766ced Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 24 18:21:42 2008 -0700 XQuartz: Compile in missing glx source that we still need (cherry picked from commit c611335dee267e41dcd1733a6bb5206b102f804e) commit ae982a27e4059fecd4048d245e6aa02f8dcc97d0 Author: Dave Airlie <airlied@redhat.com> Date: Thu Apr 24 16:37:29 2008 +1000 glx: test for valid read and draw privates before using them this should fix a bug where f-spot exiting blows up the X server commit f377141912594f87144d6d7f7fdd279a101d8e6c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 24 13:30:28 2008 +0930 Xi: don't attempt to send to a NULL window. Only applicable when the server comes down/restarts. In this case, WindowTable[i] may be NULL. Let's not try to send an event then. commit aec485f2dcc87b340759d67b60e7dee7931aaec5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 24 13:29:46 2008 +0930 dix: NULL out WindowTable after freeing all the windows. CloseDownDevices() tries to send PresenceNotify events. If the windows are already freed, then we are accessing dangling pointers. commit 9ab4e2fd8eaa87dbd16835affb1aa54dcb1a619e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 23 11:38:08 2008 +0930 xfree86: don't free the config-file related information in DIDR. #15645 In DeleteInputDeviceRequest, leave the conf_idev (which is shared with xf86ConfigLayout.input) alone for devices that were specified in the ServerLayout section of the config file. This way, in the next server generation we are left with what was the original config and can thus re-init the devices. This is an addon to 6d22a9615a0e6ab3d00b0bcb22ff001b6ece02ae, an attempt to fix Bug 14418. X.Org Bug 15645 <https://bugs.freedesktop.org/show_bug.cgi?id=15645> X.Org Bug 14418 <https://bugs.freedesktop.org/show_bug.cgi?id=15645> commit 7dc40c8eca90ec1bfab84b6f54418b64c0e62d63 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 24 12:47:29 2008 +0930 xfree86: Don't free master devices. The previous check works in the master-branch, but doesn't work with MPX. We actually copy the SD's information into the MDs public.devicePrivate, so we need to explicitly check whether a device is a MD before freeing the module. commit cc13f87cd8ac54223fdb0b3d3c043dc9b9be5a42 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 24 11:43:47 2008 +0930 Xext: XGE: change function definition to have return value on separate line. This seems to be the common style in most parts of the server. commit d0890c40b9a9c7965c08608e6950c078a29aac16 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 24 11:32:36 2008 +0930 Xext: add a few lines of comments to XGE. commit 745b90cde1007383ec8c887f02439a34ab427f31 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 24 11:27:22 2008 +0930 Xext: re-do the XGE versioning handling. Basically the same approach RandR takes. Remember which one the client requested, send back the one the server supports. Also divide XGE server version (now defined in geext.c) and the client's version (still in the protocol definition). commit 5f3e5b3462bb02e828c70d0e1890b5a83d399d42 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 24 11:03:23 2008 +0930 Xext: remove trailing whitespaces in geext.{c|h} commit d09c520b322ba5c5f4d6b630a7c0c62e56732f82 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 23 10:22:34 2008 -0700 Moved Apple GL bits into our DDX subtree (cherry picked from commit c9356f32892978faecb30f7b7af7488820ce37ff) commit b05b416c622063b84747702a54ffd9a802d6fc11 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 23 09:59:48 2008 -0700 XQuartz: No need to include indirect.c a second time (cherry picked from commit 41ed532525da85d1bd2c20af5ffa28ac6d1f4996) commit 565492c70a280d7e749500c5c0073bdcaf175c86 Author: Ben Byer <bbyer@apple.com> Date: Wed Apr 23 06:00:57 2008 -0700 xquartz: build fixes for GLX/DRI2 fallout (note: not guaranteed) (cherry picked from commit 85a5796b667461bf1fafc68c07b3a704cd8efd5b) commit 6f6505db51763d902142a8161e71cad44f52560c Author: Ben Byer <bbyer@apple.com> Date: Wed Apr 23 03:43:51 2008 -0700 glx / xquartz: we still need glxcontentmodes.[ch] kthx (cherry picked from commit 27545fd37f8c703b72f7cfc329778abc1ceabfa0) commit 4e3a8af5751ff88c0cadd612821b0ef349d250c5 Author: Ben Byer <bbyer@apple.com> Date: Wed Apr 23 03:39:41 2008 -0700 xquartz: clean up linker line for main binary (cherry picked from commit 821d7400f2ff917497b2ee58ceef2b69c2d47ec7) commit 3685b171da51f853bfdb312d36622dfa03ee75be Author: Ben Byer <bbyer@apple.com> Date: Tue Apr 22 23:53:23 2008 -0700 xquartz: remove vestigial aglGlx.c (cherry picked from commit 40bd041e4255f26fcbdf0831e68619ae0f46ab39) commit f6e22d69af6bc8f63c3a46535a09e217696a679f Author: Hans de Goede <j.w.r.degoede@hhs.nl> Date: Wed Apr 23 12:28:30 2008 -0400 Prefer glxvisuals with stencil buffer for default visuals The first fbconfig which has a depthbuffer > 0 and doublebuf is choosen when associating fbconfigs with the visuals, indepenent of stencil bits. This happens to work ok on intel as there all fbconfigs with a depthbuffer > 0 also have stencil bits. This patch fixes this by first trying to get a fbconfig for default X visuals with both stencilbuf, depthbuf and doublebuffering, and if that fails fallback to trying to get one with only a depthbuf and doublebuffering. commit 00effad583713e882c3f2518bcd3da51bf4db716 Author: George Sapountzis <gsap7@yahoo.gr> Date: Wed Apr 23 17:46:30 2008 +0300 xephyr: XEPHYR_DRI is identical to XF86DRI commit 6a9f7f28ec455d2879ca1a315ce77c48af49e7f4 Author: George Sapountzis <gsap7@yahoo.gr> Date: Wed Apr 23 17:46:15 2008 +0300 xephyr: sync with mesa commit 7ffc68c5cc7108c9e56af25f9f9b4398f5b027df Author: George Sapountzis <gsap7@yahoo.gr> Date: Wed Apr 23 17:45:54 2008 +0300 xephyr: libGL is client lib commit a27c244d72603e27766ff3900ab28fe094f7397e Author: George Sapountzis <gsap7@yahoo.gr> Date: Wed Apr 23 17:45:37 2008 +0300 xephyr: Makefile cleanup 2 commit d4d19b2f22002b1579438cb9cf08dd580c7ec005 Author: George Sapountzis <gsap7@yahoo.gr> Date: Wed Apr 23 17:45:19 2008 +0300 xephyr: Makefile cleanup 1 commit cdc4571b580a8f4fd279404215bff0fb9a5b4816 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sun Apr 20 17:06:26 2008 +0300 drop TOGCUP remnants commit 6cd9287aed3c128d9c10b9b042ba7b864143d522 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sun Apr 20 16:58:51 2008 +0300 drop EVI remnants commit a88c6b66465c039bf92a54a496516fee4d900784 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri Apr 18 17:47:16 2008 +0300 glcore: drop GLcore (files) commit dd7a53f8f21e41e1ab43f7e684ba586abc97ef7e Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri Apr 18 17:47:01 2008 +0300 glcore: drop GLcore (build system) commit 567d389d47dee233a973b101e04ce41c47a68f34 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri Apr 18 17:46:18 2008 +0300 glcore: build from mesa, dlopen from xorg * The GLcore interface is disposable * GLcore is installed in DRI_DRIVER_INSTALL_DIR which is overloaded for GLX_PROVIDER_INSTALL_DIR commit efb723e166e5fa89e90c7b400fb4c7979b1f50c0 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri Apr 18 17:45:53 2008 +0300 glcore: prepare for dynamic loading glcore gets linked with -ldl, -lpthread for s3tc and glapi xserver needs DLOPEN_LIBS - to dlopen the glcore dso LD_EXPORT_SYMBOLS_FLAG - to export symbols for glcore to use the ld flag is added to kdrive only when GLX is enabled, the net overhead for Xephyr is ~155KB, could be reduced with --dynamic-list. commit fbad87f2ae9f97fcb43546b0fa35f1100415dfec Author: Julien Cristau <jcristau@debian.org> Date: Tue Apr 22 23:50:11 2008 +0200 autoconfig: don't call closedir() when opendir() failed If opendir() fails, return from matchDriverFromFiles() immediately. Ubuntu bug 217647. commit 76381092e8f650ec7d1f058fa4c8a7348893f775 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 23 02:22:14 2008 -0700 XQuartz: Make sure QuartzAudioInit() gets run. (cherry picked from commit bb3d034675b70e22e78df5554cab0ec2a3d913d0) (cherry picked from commit 824b31c7f8144a67a320442abd3d854e99d2bfe2) commit 275cdc1c74b7e43ecd931d312469fecc8d998ed1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 23 16:16:15 2008 +0930 xfree86: pass correct value to mieqEnqueue (merge detritus I guess) commit c3659cb414ef05da8fa09009b2b82a3deeeb4f3a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 22 21:54:02 2008 +0930 dix: always send FocusIn events if mode is NotifyUngrab. In the case of a NotifyUngrab, the flag for the device may already be set but we still need to send the FocusIn event. commit 00815b3e5223e822f306db45cd4884a22ac9f7ed Author: Julien Cristau <jcristau@debian.org> Date: Mon Apr 21 14:34:39 2008 +0200 Don't set DRI2=yes if we can't find dri2proto or libdrm commit e77f65768efbf05cdf363a2f41f036f74eaa45de Author: Ross Burton <ross@burtonini.com> Date: Tue Apr 22 18:07:46 2008 +0100 Reuse the existing framebuffer mode in kdrive/fbdev When starting up kdrive/fbdev, if the current framebuffer mode is sensible use that unless told otherwise. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit c4fd1121531b0cba1a3e90fa747871d784365c7e Author: Ross Burton <ross@burtonini.com> Date: Tue Apr 22 18:05:53 2008 +0100 Add mediumraw support to the linux kdrive driver Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 455383db95618a05ebdbeae78423e08065f0e14e Author: Ross Burton <ross@burtonini.com> Date: Tue Apr 22 18:04:31 2008 +0100 Enable the epson kdrive driver Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit 82b37d35af13a9f402755e167493ab256b664b9c Author: Ross Burton <ross@burtonini.com> Date: Tue Apr 22 16:38:14 2008 +0100 Add support for AVR32 commit 20a90bef8b4993f06cf76ad05e3d4c974e1614f6 Author: Ross Burton <ross@burtonini.com> Date: Tue Apr 22 16:37:02 2008 +0100 Add a default touchscreen path When enabling the touchscreen, open /dev/input/touchscreen0 if no path was specified. commit b44e89f4683ffcfd75eaf39f1f37d7461db44689 Author: Ross Burton <ross@burtonini.com> Date: Tue Apr 22 16:28:39 2008 +0100 Update to tslib 1.0 Update the pkgconfig checks to tslib 1.0, and fix the LIBS definitions. commit 3848422d2354b7a5302fda92b05b0d728190e050 Author: Ross Burton <ross@burtonini.com> Date: Tue Apr 22 16:25:23 2008 +0100 Fix build when XKB is disabled. commit 744d0cfda74f8283801cc2d6c5eda48402455bc3 Author: Ben Byer <bbyer@apple.com> Date: Mon Apr 21 22:06:38 2008 -0700 add missing DARWIN_GLX_LIBS in configure.ac (cherry picked from commit a033c0b3dbb3b963261faa39f0236457cb00ff44) commit 8190ef87547b704848231bde10b1cdffc6442790 Merge: 179a082 2ddbfd3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 22 18:04:05 2008 +0930 Merge branch 'master' into mpx Conflicts: Xext/EVI.c Xext/appgroup.c Xext/cup.c Xext/mitmisc.c Xext/sampleEVI.c dix/window.c commit 179a082c26f9e562492ee2e59e7f44f949f39f9c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 18 21:13:10 2008 +0930 Xext: route event through master if required (XTestFakeInput) commit fb784d99c521823339bf00b70b9824f735d88875 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 18 20:57:42 2008 +0930 mi: fix typo in comment. commit 8209fdbc7c7f2dd068b30ff184b5fbf00db78686 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 18 20:53:57 2008 +0930 Xext: Update sprite on fake input only for MDs and floating SDs. commit 2ddbfd345786aa39b6ccaed82a1ca5c145284ee3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 22 16:31:44 2008 +0930 xnest: re-enable XKB support. #10015 XKB was disabled in 08928afb0500d46b0caa0a1d1244dee2ed80e6a0, with the comment "Disable XKB, as we can't yet use it". Seems like "yet" is over, running GNOME and changing XKB settings seems to work in Xnest now. X.Org Bug 10015 <https://bugs.freedesktop.org/show_bug.cgi?id=10015> commit a8b8700c7345b89953c8b63cb5c347a95e6ab988 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 21 23:44:37 2008 -0700 XQuartz: Fixed cmd-tab to bring all windows forward. (cherry picked from commit e48e2ce931228f4dfa36c39b8ec8c72a58025b1b) commit a368ab757edf36ed7bbda023673d28883ce11231 Author: Dave Airlie <airlied@linux.ie> Date: Tue Apr 22 15:13:57 2008 +1000 GLcore: make googleearth not crash the server on sw-rendering. I don't think this is the 100% correct answer as I get log spam saying (EE) DoSwapInterval: cx = 0x98b8998, GLX screen = 0x96dd780 (EE) AIGLX: cx->pGlxScreen->swapInterval == NULL but thats better than X exiting in my book. commit 449723510a1f9d024e23d9eb33795cac27f9443e Author: Egbert Eich <eich@pdx.freedesktop.org> Date: Tue Apr 22 13:30:03 2008 +0930 xkb: use the correct device instead of an uninitialised "dev". #15614 X.Org Bug 15614 <http://bugs.freedesktop.org/show_bug.cgi?id=15614> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit ba87c25321c3378fd1ad0c55dcb0af0a6e82a540 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 21 20:03:08 2008 -0700 Make rootless use dixLookupClient rather than deprecated LookupClient. (cherry picked from commit 582b5b01f9697b66489ea906a2ecb8bfc5915571) commit 8822110d7d6b684f373fc883aeb7cab9734e9ddb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Mon Apr 21 20:08:05 2008 -0700 Fixed dixLookupClient to work with client=NullClient as it did in the 1.3 branch (cherry picked from commit e41ccc64702f856e5e09dfa652fe73c14b8a0225) (cherry picked from commit ce5a5f93990647de85e535734ee6bb430ad591cb) commit 5ffb6a2fe8db5871eaf26b8535af1588c43f33d3 Author: Ben Byer <bbyer@apple.com> Date: Mon Apr 21 19:55:54 2008 -0700 Nuke a call to deprecated LookupClient, and hopefully prevent a null-pointer dereference, too! (cherry picked from commit 3d28e9f953709914e18807bc74c241333671cb30) commit 590688131d89595bdc78ca562ee88df86c9012a6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Apr 20 22:18:45 2008 -0700 XQuartz: Fixed quit dialog to be more conforming with HIG. (cherry picked from commit 14c6b837bb03bd0956f90882f550847f13d0ca09) commit d20b3ac22d960fa44632cc4a14be079daa2d5a33 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Apr 20 22:18:19 2008 -0700 .gitignore: Added Xquartz stuff (cherry picked from commit 0a9a3bec2de8d1f442493e13cf9f039902a4928f) commit 570b0dca261920c9b01b4eb11fe9b9987b1c636a Author: Ben Byer <bbyer@apple.com> Date: Mon Apr 21 17:52:10 2008 -0700 Fix for pointer-offset issue when using a multi-display environment on X11.app. (cherry picked from commit 9a7e14286ced55c5e2a4512e2629e03836443009) commit 3f081b4de55e1378728a24d069bf06575ffca2d8 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Apr 21 11:22:07 2008 +0200 EXA: Set pixmap->accel_blocked on the screen pixmap, too. commit 26c1801a27b81fdd988d5bd210ba0e76ecc274ae Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Apr 21 11:03:27 2008 +0200 EXA: Update sys_pitch/fb_pitch in exaModifyPixmapHeader. exaModifyPixmapHeader now also only evaluates arguments that have a meaningful value. commit 4fa89fbe18c929e0d36305ab47e7e17841309ffd Author: Jordan Crouse <jordan.crouse@amd.com> Date: Mon Apr 21 12:09:00 2008 -0600 xf86: Change AutoConfig driver for PCI ID 022:2091 to 'geode' commit 6c95fae1e9d6b0eb64bc78eced05a6e9f5faf02e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Apr 21 10:45:11 2008 +0200 EXA: Offscreen memory eviction improvements. * Make sure available areas are considered to have no eviction cost. This seems to help for https://bugs.freedesktop.org/show_bug.cgi?id=15513 but I'm afraid that may just be coincidence. * Only calculate eviction cost of each area once for each eviction pass. Safeguard against potential (though unlikely) division by zero. * Cosmetic enhancements: Name eviction cost related variables 'cost' instead of 'score' to emphasize that smaller values are better, update Doxygen file comment to the way eviction works now. commit 40c6be1408a1f0b236fdb28af27ae18aea0d578f Author: Julien Cristau <jcristau@debian.org> Date: Sun Apr 20 20:36:44 2008 +0200 Minor xorg.conf manpage fixups Use __libmansuffix__ instead of __oslibmansuffix__ which isn't getting replaced, and rewrap some text to get __xservername__ replaced in the description of Option "Accel" (cpp doesn't like the preceding quote). commit 4bcfed2f9cf5dbf682d3bc98873ba97c4efdff44 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sun Apr 20 08:35:42 2008 -0700 Revert "Removed XWin DDX" This reverts commit 6550078b0925f754e3eec3bbce94dbfe5de8c419. Doctor, I'm starting to get a pulse... commit 14396fdebac1868df17559220ed7aaa34c34251e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 19 23:31:05 2008 -0700 XQuartz: Cleanup turning off COMPOSITE (cherry picked from commit 8f920fca6f9149185649d52569d33bf81b6c6857) commit d13828797fe22856b07e08a55d2b9375902194bf Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Apr 18 20:38:31 2008 -0700 XQuartz: Cleaned up some casting to get rid of compiler warnings (cherry picked from commit 6f1c85b96550adf0bc34efb6ca649b87bcc1b18c) commit 6550078b0925f754e3eec3bbce94dbfe5de8c419 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 19 09:29:46 2008 -0700 Removed XWin DDX commit 587c010a1cd733fded4d49dc339df0634bda8be6 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Sat Apr 19 09:27:21 2008 -0700 Rootless: Kill off rlAccel commit d3d00d92586c3e1cbc88087c930b65c8b3832fcc Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Sat Apr 19 12:54:40 2008 +0200 Removed fbpseudocolor.h from sdk_HEADERS. commit 5bdc4198795ffd011bb07cffe3817e4cded87f60 Author: Adam Jackson <ajax@redhat.com> Date: Sat Apr 19 04:06:19 2008 -0400 Remove fbpseudocolor "An experimental pseudocolor emulation layer. Not fully completed, currently only works for 16bpp." That was almost four years ago. It still doesn't work, only one driver even attempts to use it, it contains an ad-hoc implementation of damage, and should really be done up in Composite now anyway. commit 60ff56050b64183cb6e58f54223c8a3ddc2e704b Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 18 22:17:53 2008 -0700 Revert "Optimize dixLookupPrivate for repeated lookups of the same private." The patch was wildly unsafe for SIGIO, and made everything full of crashy crashy fail. This reverts commit 9b30cc524867a0ad3d0d2227e167f4284830ab4e. commit ed9dabb47c467dbf49836b631d5d6bda4b0d98b0 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Apr 18 20:30:43 2008 -0700 Last of the spam... I promise... (cherry picked from commit 45ebee4f729b148a75e925a4863b4eb850c88f8e) commit 49f2bb4681fdee9e45f952ef0ac9c34a090117de Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Apr 18 20:25:38 2008 -0700 XQuartz: More sanitization of the namespace (cherry picked from commit bc50d41f9d1aec04f0de0478cbd5036f1fe9b81e) commit c2f0d020b5d7950267aa3df391a7a72b9ae5883b Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Apr 18 20:10:57 2008 -0700 XQuartz: Removed unneccessary include (cherry picked from commit 45ff59e69eddfcceafced31cf6e73e381d0f6914) commit 5183fea6d38de4bcf657e9c2a983dfd81a2a223f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Apr 18 20:06:17 2008 -0700 XQuartz: Handled sanitization of namespace better (cherry picked from commit 8cb23d672177da919257c885804cecd18cf9af88) commit edd3fb784bad893550ee270e0a09f22f99783cf5 Author: Ben Byer <bbyer@bbyer.local> Date: Fri Apr 18 17:17:01 2008 -0700 random flailing (cherry picked from commit 7fb9b2dc615a3bd1a3c087438af7a8b88265cfaa) commit a7503615a6893749d512f75d37646273f31b9dbf Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 18 19:56:41 2008 -0400 Death to TOG-CUP. If you still care about 8bpp visuals that much, fix Composite to provide synthetic visuals. commit 4da9ec16e9725ebb9817b49e33ea1035b6aff09a Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 18 19:54:09 2008 -0400 Remove appgroup mentions from configure.ac commit 25827fde68d3bb02a2b7e05fae53a1d97edf1f76 Author: Eric Anholt <eric@anholt.net> Date: Fri Apr 18 15:32:04 2008 -0700 Nuke the MIT-SUNDRY-NONSTANDARD extension. This extension provided bug-compatibility with pre-X11R6, but has been stubbed out in our server since 2006 to return BadRequest when you actually asked for it. commit 13adef8a17d8815f4db2aaac30ae04438e125343 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 18 19:01:06 2008 -0400 Finish deleting EVI commit eafaf40fb3368ca7e4cf48336fdb7a6c9f536bfa Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 18 18:50:05 2008 -0400 Death to APPGROUP. commit f6617b4127125516583f321c961d70f762f728be Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 18 18:28:01 2008 -0400 Death to Extended Visual Information. commit 3b93631e59ca4d312d318eac4015e0a79ad6351f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 18 11:31:54 2008 +0930 dix: remove coreOnly check. Core pointer must generate XI events now. This flag was only used when an event is generated by Warp[Device]Pointer. Since the VCP now happily generates core events, this flag is obsolete. commit e0eaf8e5e3fa7a11c087851dff93f50f6907c4a5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 18 10:57:47 2008 +0930 Xext: Let XTestFakeInput update the sprite for XI events. Since XI devices can have their own sprite now, we need to update the sprite coordinates too when processing an XI event. Note: This doesn't deal with the device hierarchy correctly yet. commit cb0168b4ac5c59cdce6f0a6d89ddd9f30d93b5f3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 18 09:48:06 2008 +0930 Xext: xtest.c: death to tabs+spaces indendation, remove #define XINPUT commit eebdf69e9a52e071e0467a1f99de135df4d1eabc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 18 09:22:37 2008 +0930 xkb: mixing up src and dst in a memcpy is suboptimal. commit aa6687322de85a2d1025a3ae851fb290a089b2d3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 15 23:03:06 2008 +0930 Xi: when copying button classes, copy xkb_acts as well. This should be the last piece in the quest for the class copy. commit c14f5dc237a31b13d98ae2d0d6143bd91083cf13 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 20:21:45 2008 -0700 XQuartz: Forgot to commit xprEvent.[hc] ... (cherry picked from commit 70e543baf2508d636f01b2b7e8cb05172195b68c) commit 22bb7608a025a4ec0f442637810b20e2cb0b0820 Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 17:04:08 2008 -0700 Added XKB support for Xquartz (cherry picked from commit 56dc1215202746590dbe8758411f47e8876e1317) commit 652479dba38470273313dc46f17e3bcb1bc5e383 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 15:49:13 2008 -0700 XQuartz: Moved some rootless-specific cruft into xpr (cherry picked from commit 31625cc03b58317120c2ac7877e227e2322e1de8) commit 2a1ba20af98c0e9a6a7f1a50d32058dcc9759c21 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 15:23:00 2008 -0700 XQuartz: Use a mutex to ensure we only have one thread calling mieqEnqueue at a time. (cherry picked from commit 7b087c965bce9f440ab5233d6383aa4a7de969b8) commit 55f80d754525398378de1ef28aa562bd29ee750f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 14:21:31 2008 -0700 XQuartz: A little more debugging output from threadSafety (cherry picked from commit f6fbdbf838ab77c3a4635f0b2356b1bbb060ff5b) commit 0d61f6fca1efeb4f68488e323d1c0508b9b7a711 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 13:17:58 2008 -0700 XQuartz: Fixed some missing prototypes (cherry picked from commit 95056afc562cfe58b116f5c36e4624018e79ff4a) commit dbd4c031565d269fef90af23386ff045ec78688c Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 13:12:56 2008 -0700 XQuartz: Added framework for asserting which thread we're in. (cherry picked from commit 00beb982510e7a82d77e1f1d43e77c84d7bf74c2) commit fa0645b452cbebd1800a63f1c95cb77fef4ab211 Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 12:27:12 2008 -0700 removed Xquartz debugging code that leaked into master. Our Bad. commit a3d40f0549f6c6f49fffc286bcdaad758fa92367 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 11:56:48 2008 -0700 XQuartz: Include version info for CrashReporter (cherry picked from commit b4992755c3e29086c5939683c38fa8fd7d2e6754) commit 6d11712c2a35b243c19eea3b26622d18c2446dbe Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 11:06:54 2008 -0700 XQuartz: Use strerror(errno)... cause I like text more than grepping header files (cherry picked from commit 1b4c37d8f9b517fbec5b94ed4e4a5e86a31472a5) commit dcf4f917cc9488de72711255bbb030d9aa8f8bfb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 17 11:03:31 2008 -0700 merged darwinKeyboard.[ch] into quartzKeyboard (cherry picked from commit 57bb07320908b74facea0a97822bb19ed6f960a9) commit 582397cd024c68df65ab9dececd6d2c40a5a261b Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 02:31:53 2008 -0700 oops, missed a spot (cherry picked from commit 19872a6aeb8ee9cb0e33e4b4ffd794c9dbefe0cf) commit 0bd1c369cce05d5a4da5e3fd7033aea8c68460ec Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 02:30:36 2008 -0700 formatting cleanup (cherry picked from commit 769acd29348abf9e5b0bebfca6ae695d345f3077) commit 700e14c22616b209867e4ea4d1811e53ca996164 Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 02:21:33 2008 -0700 delete debugging spew (cherry picked from commit f04f3af86a91d0cafbc86a0d71aeb0599d685f07) commit a440eebf2541ae0bb06bf65281b5facff2f04e00 Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 02:21:11 2008 -0700 add support for horizontal scrolling (buttons 6 and 7) (cherry picked from commit f525a4a432ebd0545ad1dd0a7ad84ad3e47e8b61) commit 612e901ef6aa3edc54b39e55e8040cda0e5ab7b6 Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 01:32:56 2008 -0700 enable keyboard map debugging -- it's going to x11-debug.txt, anyway ... so no harm (cherry picked from commit ab662c736e0654e2b4347091f0d9e87f26034216) commit 5bdfbfbedcbd9ff61cbb0b678cbf7ce7889a5826 Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 01:29:46 2008 -0700 darwinKeyboard: refactor slightly so that we're not cutting and pasting code from dix, kthx (cherry picked from commit a8a090b853e811b9843a5732572cbbe542224f32) commit 58e42683c9e998f6b8a55d5653b9caec7b6acf96 Author: Ben Byer <bbyer@apple.com> Date: Thu Apr 17 00:19:56 2008 -0700 hack to Xquartz to prevent xmodmap from wiping out our valid modmap, per daniels (cherry picked from commit cab54466a61281cfafc12825017c23d720cd75f4) commit cd3470a0cffbd6b8cec7c44227b33307c9e227ae Author: Ben Byer <bbyer@apple.com> Date: Wed Apr 16 22:48:54 2008 -0700 kludge: miEqEnqueue wants a device, even if we're passing custom messages, so give it one (cherry picked from commit a494ff04b2a14470eaf5a23c7cf6dbdea182c6d1) commit 966ae1781f3ca563e15a9a1b8cab6fab94e07fe9 Author: Drew Parsons <dparsons@debian.org> Date: Mon Mar 10 22:54:49 2008 +1100 Create dix/libXpdix.la for Xprint-specific build of libdix.la (cherry picked from commit 4e2c6dbabdbbaaca213fd08edd422de15d0900cc) required because of commit 7c0709a736c0f3aa011de67dd2c2962585ab146e, which made requestingClient in dix specific to Xprint only. Add to XPRINT_LIBS in hw/xprint/Makefile.am in front of $(XSERVER_LIBS) to override definitions in libdix.la for standard xservers. Follows 571206832d454771e3c638c7515767958365c19c (providing -DXPRINT to xprint subdirs). Note it may be possible to restructure the code so that requestingClient is stored elsewhere than in dix. See discussions following http://lists.freedesktop.org/archives/xorg/2008-March/033844.html If this is done it may be possible to revert this commit (if not 571206...). commit 571206832d454771e3c638c7515767958365c19c Author: Drew Parsons <dparsons@debian.org> Date: Mon Mar 10 13:48:05 2008 +1100 Define XPRINT in XPRINT_CFLAGS (configure.ac) -DXPRINT had only been set for Xprt in hw/xprint/Makefile.am After commit 7c0709a736c0f3aa011de67dd2c2962585ab146e it is also required for ps/PsArea.c and PsFonts.c to ensure ‘requestingClient’ is defined, so make it a global Xprint definition in configure.ac. (cherry picked from commit 28a6719fd486d9a9cecad0b057d9ea7c59c66055) commit 9b30cc524867a0ad3d0d2227e167f4284830ab4e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Apr 17 16:10:10 2008 +0200 Optimize dixLookupPrivate for repeated lookups of the same private. This gives me a 20% speedup for EXA text rendering, though I still seem to burn quite a lot of cycles in here... commit 886af8f3849a0fcfc6b63a9695107ce26d7a6955 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Wed Apr 16 16:20:19 2008 +0200 EXA: Avoid some fallbacks in exaCopyNtoN. In some cases we can still do the copying in hardware even if the dimensions of the pixmaps are out of range. This is true when the boxes that we're to copy are all in the card's range. commit dc10f0a0e243b7ba38d02a4e2c43027563aead7c Author: Julien Cristau <jcristau@debian.org> Date: Thu Apr 17 11:13:47 2008 +0200 Fix composite on !darwin 2ffdb0eb641ab6949783b4eb574f77e7486ac929 changes the default value of COMPOSITE to 'auto', but doesn't set it back to 'yes' as appropriate. commit 8716d081fdf61ddf956c30aff7697c70507911fd Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Thu Apr 3 16:29:43 2008 -0700 XQuartz: Don't enable rootless accelerated functionality... crashy... (cherry picked from commit cdb4c291d8c10c3a9ea59d8e79275a30d2ea82b4) commit 2ffdb0eb641ab6949783b4eb574f77e7486ac929 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 16 21:54:00 2008 -0700 XQuartz: Don't use composite. (cherry picked from commit 6d3d344b5b95b6dc4166556d03cfd8c9576dc3f0) commit 757a1bf3a3d72e17eeb362f825124c4ba40cc080 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 16 21:48:52 2008 -0700 Xquartz: Don't need to link against rlAccel since we don't use it (cherry picked from commit 180ec128adef11a9a90cea1189dc31ac5de8359f) commit ab8c6a3c5acb2a3bf288f1d6339b09a125bbb930 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Apr 14 19:12:00 2008 -0700 Update ac_define_dir macro in acinclude.m4 to 2008-04-12 version commit b907258ebe62642af088f6e2970a45a68cf4be19 Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 16 12:07:51 2008 -0700 Update dolt from upstream, fixing fallback to libtool. commit e1e189f8538f2b77ae0cf0d846d3899061e4c4b7 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Apr 15 14:49:51 2008 -0700 Include pciaccess in the xorg-server.pc Requires line. This pulls in the include path for pciaccess.h, which is needed by, among other things, xf86.h. commit 9e7ced94a5e3a14762fe934aa69d91f0831cf5ca Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Apr 15 12:06:07 2008 -0700 XQuartz: Removed a call to RootlessReorderWindow from the Carbon thread (cherry picked from commit cb27d5ca8230707b276763c0ec20e586203144c9) commit 51c8fd69ec9292f5e18cdc7f60e1716fbd6ae61a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 15 15:09:40 2008 +0930 dix: free the unused device classes when closing a device. This also requires to NULL-ify all pointers while we're actually using them, otherwise we'd try to free them twice. commit 48d33ab9b672b3b3ca308000cdbd573d1e368ff9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 15 14:29:53 2008 +0930 dix: float attached devices _before_ disabling the master. It also helps if we're actually providing the correct argument to AttachDevice... commit 4cf9c5909d926ec322ed1c7df47f95bd872bb607 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 15 13:56:11 2008 +0930 Xi: fix up button count. Some leftover code from the previously used alloc/free device classes left us with a incorrect button count. So a button release didn't come through if a different pointer was moved after the button press. commit 35982bc109d424c464551ab22ec90af69908c884 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Apr 11 11:09:13 2008 -0400 Make DRI2 a serverlayout/serverflags option. Add xf86DRI2Enabled() to export the value of the setting. commit f133d85778462134f366389bde7673bff7845fa8 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Apr 14 11:43:51 2008 +0200 EXA: Update pixmaps' accel_blocked field in ModifyPixmapHeader. commit bb8868540f017b121d698da45e552ffb55a57cea Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Apr 14 09:58:49 2008 +0200 EXA: Teach exaCompositeFallbackPictDesc() about x8r8g8b8. commit 1a9d7205cd5640eb65f019336097d86301942ea7 Merge: 90f491c 6866e84 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 14 16:25:58 2008 +0930 Merge whot@wombat:~/potoroo/xserver into mpx commit 3e12c5bb67f3049156475d5cbf4e899aaded76bb Author: Dave Airlie <airlied@redhat.com> Date: Mon Apr 14 11:45:12 2008 +1000 glx: silly nitpick... even though i and j are the same, we use i to derefence visuals everywhere else commit 97565c0f394f16d042c614695c8b7b4ac354f2a3 Author: Dave Airlie <airlied@redhat.com> Date: Mon Apr 14 11:40:38 2008 +1000 glcore: make visualRating GLX_NONE - note GLX_NONE is not == 0 Finally glxinfo returns the set of 3 visuals and glxgears works again for me on sw rendering commit c61087c82784633e522bd9392172b43656bdf45e Author: Dave Airlie <airlied@redhat.com> Date: Mon Apr 14 10:47:28 2008 +1000 glcore: zero fbconfigs before filling them in. I'm not sure this the complete proper solution, perhaps it should explicitly fill in ever field. This at least makes glxinfo on glcore return sensible information, it doesn't make gears work yet though. commit 6866e84e3c607d00d88eab2249c2619d6707c1a4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 19:57:51 2008 +0930 Xi: store feedback classes in devProviates system as well. This is a follow-up to cb48d880856fd196ab8e8de5eb1f14944a1b4fff. commit cb48d880856fd196ab8e8de5eb1f14944a1b4fff Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 19:48:28 2008 +0930 Xi: store unused classes in devPrivates. Rather than freeing/allocing classes each time the device capabilities need to swap, store them in the devPrivates system. When a class is unused, it is pushed into the devPrivates, and later recovered when needed again. This saves us a lot of memory allocations/frees, admittedly on the cost of some memory. commit fde3c836628b6cdec3e5d107d6b1b99bc8b86912 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 17:08:51 2008 +0930 Xi: copy the KeySyms.map over from the source. commit 3c4c9938f31755c5a59995fdcfa138c99db76bbf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 16:52:14 2008 +0930 Xi: Fix pointer handling in KeyClassRec copy. We don't free the class anymore, so just store the previous pointers, do the memcpy from the SD and then restore the pointers. Plugs a memleak too, before xkbInfo was never freed. commit 755f9e5d7898056cf3bead69ce25a10e23995582 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 16:49:25 2008 +0930 dix: Ignore focus for passive grabs if the event is a pointer event. commit 6faf5b97b92953c331d6540ceb18fd0a77197fea Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 15:42:33 2008 +0930 Xi: fix up modifierKeyMap copying. Setting it to NULL isn't correct either. The correct behaviour is to realloc it to the size necessary (or newly alloc it/free it). Otherwise we have a memleak. commit 3106ba1116e3b9d893f66a93e4a91cc61e23226a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 11:48:06 2008 +0930 xkb: two fixes to avoid server crashes. - map can be NULL in some cases, so don't try to dereference it. - don't default to inputInfo.keyboard This is firefighting, I presume something in the class copy may have gone wrong to get a NULL map in the first instance? commit 415c6df0da1197d487456b4c48e2e28e7ded8b8e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 11:46:44 2008 +0930 Xi: copy feedback classes first, in some cases xkb relies on kbdfeed. XkbInitIndicatorMap (in XkbInitDevice) calls XkbFindSrvLedInfo. This accesses the devices kbdfeed struct, which is all nice and dandy if it is NULL. When copying the device classes however, kbdfeed may not be NULL and thus XkbFindSrvLedInfo goes on its merry way to do whatever it does. By copying kbdfeed first, we avoid XkbFSLI to reference the "old" kbdfeed struct of the previous SD. commit 961f6660902163e99727c2dcc1a039f32b083859 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 09:31:16 2008 +0930 Xi: modifierKeyMap needs to be set to NULL when copying classes. Otherwise we have a double reference to the same memory area. commit bf6679cba40a936d46008c886d204ed521a4971a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 08:28:07 2008 +0930 Xi: copy the XkbSrvLedInfo too when copying device classes. commit 4219e94c2f7d431be433eceddfe79760a1ee31a1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Apr 13 08:27:31 2008 +0930 xkb: Add XkbCopySrvLedInfo, deep-copies a XkbSrvLedInfoRec. commit 1fa4de80fcfc697b5e5879cc351fb3e9dbf6acbe Author: Matt Turner <mattst88@gmail.com> Date: Sat Apr 12 20:39:18 2008 +0200 Check for __x86_64__ when we check for __amd64__ It seems Intel C Compiler neglects to define __amd64__, __amd64, or amd64, but *does* define __x86_64__. commit b1f3f42840ec01db417345a0740b59ad5e4471cb Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Apr 11 17:49:51 2008 -0700 Xquartz: Added applicationShouldHandleReopen:hasVisibleWindows to handle dock icon clicking (cherry picked from commit 55d9973b053f25bb95b26e00351dc5531caf5b04) commit eabcfce0a68d504d11be9479f09e66f574dd2f21 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 11 09:51:26 2008 -0400 Stop building mfb/afb/xf1bpp by default. commit 0dab6fa3582b70ccd0f01459902415c28dbc81ff Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 11 09:47:51 2008 -0400 So long, and thanks for all the cfb. commit 059b4876e6350aa1110648788cdfbb3f45b4d66d Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 11 09:46:48 2008 -0400 Add doltcompile to .gitignore commit 6d22a9615a0e6ab3d00b0bcb22ff001b6ece02ae Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Feb 22 11:01:51 2008 +1030 dix: Call DeleteInputDeviceRequest from CloseDownDevices (#14418) The DDX (xfree86 anyway) maintains its own device list in addition to the one in the DIX. CloseDevice will only remove it from the DIX, not the DDX. If the server then restarts (last client disconnects), the DDX devices are still there, will be re-initialised, then the hal devices come in and are added too. This repeats until we run out of device ids. This also requires us to strdup() the default pointer/keyboard in checkCoreInputDevices. X.Org Bug 14418 <http://bugs.freedesktop.org/show_bug.cgi?id=14418> commit 90f491cf8eb869f27c4278b26c1bb84432b12d63 Merge: cbe01b3 b4380d8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 11 08:29:52 2008 +0930 Merge whot@wombat:~/potoroo/xserver into mpx commit 3c337e18b933881e22b0d03312511f1d23a8640b Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Thu Apr 10 21:36:19 2008 +0200 Fixed configure.ac for autoconf 2.62. commit 13dcde6bf994fae09c67c3edce9de42df61ef043 Author: Eric Anholt <eric@anholt.net> Date: Thu Apr 10 11:08:49 2008 -0700 Fix dolt to error out on compile error, and not print errors on race to mkdir. Both of these changes have been submitted upstream. commit a7e3ad1c6b455bda7c4abb352a20845d1d4574a0 Author: Eric Anholt <eric@anholt.net> Date: Thu Apr 10 10:33:11 2008 -0700 Remove NDEBUG (assert() disable) define from the X Server. A few pieces of code were abusing this define for other purposes, which are converted to #ifndef DEBUG instead. There should be no ABI consequences to this change. The rationale is that having the define in xorg-server.h also disables assert() drivers, which is unexpected, and also difficult to avoid since xorg-server.h is included in their config.h, and you can't put a #undef in config.h. As for removing it from the server instead of moving it to an internal header, we probably shouldn't have unnecessary assert()s in critical server paths anyway, and if we do we could #define NDEBUG in the specific cases needed. commit b4380d8030927c940ddaea83c4cf24e0b9eb7b96 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 19:25:43 2008 +0930 dix: don't free MDs classes on init. The device classes aren't deleted anymore on a class change, so there's no need to store the MD's original classes. We should however restore the MD to sane defaults when disconnecting the last device, consider this as TODO item. commit 04dff74ffdf727015e3721aae4ea13acc498cd1c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 19:22:59 2008 +0930 dix: Rework Enter/Leave semaphore system. Instead of a simple counter, use bits to keep track of which device is where etc. When device enters a window (or sets focus), the bit matching the device is set, when it leaves again, it is unset. If there are 0 bits set, then Leave/Enter/Focus events may be sent to the client. Same theory as before, but this should get around the insanity with Grab/Ungrab special cases. Those cases are basically untested though. commit a88386ee277d136caaaeec305f8753f23f9b6274 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 14:36:57 2008 +0930 Xi: only DeliverFocusedEvents if the event is not a pointer event. A pointer device may have a focus class, but even if so, pointer events must be delivered to the sprite window, not the focus window. commit 48249425275cc90242497aee9968e5f1ffc86698 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 14:36:10 2008 +0930 Xi: dont copy FocusClassRec if the master already has one. Blindly copying will override the focus setting of the master. If there's XI applications running, they may set the SD focus, while leaving the MD's focus as it was. In this case, after a class swap we still want to get the MD's events to the same window as before. commit bce6091c6b04ff2db704ae4f161179d21dcbec59 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 09:59:45 2008 +0930 dix: Extend IsKeyboardDevice() to not include pointer devices. If a pointer devices has key classes as well, don't register it as a keyboard device. Let's see how much that change will break. commit cc7dab2d04da4ca164eeec1a3296df1706585466 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 09:58:50 2008 +0930 dix: Dont deliver grabbed pointer events to a focus window. If an pointer event is being processed during a device grab, don't deliver it to the focus window, even if the device has a focus class. Reason being that some pointers may have a focus class, thus killing drag-and-drop. commit df2545b98d888924209cb889a68737c15f1aa209 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 08:50:43 2008 +0930 xfree86: Sanity check before retrieving the paired device. Some pointer devices send key events [1], blindly getting the paired device crashes the server. So let's check if the device is a pointer before we try to get the paired device. [1] The MS Wireless Optical Desktop 2000's multimedia keys are sent through the pointer device, not through the keyboard device. commit 5a4c6621aaf4e886f2c3b633e837ba359fedf921 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 08:29:05 2008 +0930 Xi: some extra checks for validity of kbd and mouse. Floating SDs are paired with themselves, so the paired device may not be a proper keyboard or mouse. Put some extra checks in to avoid dereferencing a nullpointer later. commit 8e0a6529303a52acc10905dd47c72a0d60979676 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 08:25:36 2008 +0930 dix: When floating, set sprite to NULL before calling InitializeSprite. InitializeSprite won't create a new one if it already exists, with the result of overwriting the master's sprite. This master sprite is then assigned to the floating slave, and freed when the slave is reattached later. Setting the sprite to NULL forces InitializeSprite to alloc a new one, and this one can be freed without further repercussions. commit e7211eb0b3d10323dab681bcb18580405ea18ab2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 10 08:08:54 2008 +0930 Xi: When attaching, check for ptr -> ptr and keybd -> keybd. Some pointer devices have key classes (e.g. MS Optical Desktop 2000). The previous test was performed as Error if ptr -> keybd or keybd -> ptr. This doesnt work with such devices. New test is Succeed if ptr->ptr or keybd->keybd. commit 7909ebe7f163716520f843fae11ac7bdeffcb57c Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 9 10:43:25 2008 -0700 dolt: add FreeBSD support (this and ppc have been submitted upstream). commit b4842d8dc3b1619033c5c123c8adc6e164098dc3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Apr 9 16:17:35 2008 +0200 dolt works on powerpc Linux. commit 0d1746995d91b55e40f233f0c38b56bafe896d38 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Apr 9 13:37:59 2008 +0200 Fix off-by-one error in ProcXResQueryClients(). Fixes memory corruption reported at http://bugs.freedesktop.org/show_bug.cgi?id=14004 . commit 6d031cbdefd8072b61645955f01b470a3e6858c1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 9 14:36:26 2008 +0300 configure.ac: Do the dolt Use dolt instead of libtool whereever practical. See: http://lists.debian.org/debian-devel/2008/04/msg00286.html commit b19027fbaea4c3a146926e862983e0e3411fff3d Author: Dave Airlie <airlied@linux.ie> Date: Wed Apr 9 14:27:58 2008 +1000 quirk: add quirk for ACR 640x350 default mode is wrong RH #440186 commit 1f8188656a075dc7b1bb27a0795b5bd43610bbc8 Author: Ben Byer <bbyer@apple.com> Date: Tue Apr 8 20:37:25 2008 -0700 add missing dix-config include (cherry picked from commit 126e9bc8c480b403dedc44c1e8c4fe1476340ed9) commit cbe01b3083eb65c9d4259b1071683febebf11600 Merge: 5ffbcfe 389dae7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 9 10:46:46 2008 +0930 Merge whot@wombat:~/potoroo/xserver into mpx commit 3f51f493b6daf2464e6c2ba5a924219b88a9e57e Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Apr 8 17:02:56 2008 -0700 XQuartz: Fix issue where clicking on an X11 window might send that event to an X11 window in another space. (cherry picked from commit df21312c8b0e9ef0c809bfc57cdf64f27db0d8a7) (cherry picked from commit 2d4194a8d124e7a9c7cd1b83635ba6957aa4ae1c) commit 389dae73cc0f3693f49807fd2de146c454ba9783 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 9 08:26:00 2008 +0930 Xi: If device "to" has a class but "from" doesn't, free the class in "to". commit 60c38d248c1a89392c2c6695c3802f4b54e4c00b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 9 07:46:53 2008 +0930 Xi: plug memory leak, free previous motion history before allocating new. commit ea05cf0813b2b7c8cd2151cb935820753ae7997a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 8 22:09:11 2008 +0930 Xi: check if source has a key class before copying. commit 08073862f8c4e1219b6459708ffd28e2bc35885f Author: Hasso Tepper <hasso@estpak.ee> Date: Tue Apr 8 13:00:38 2008 +0300 configure.ac: Fix monotonic test harder This was only introduced in a later version of POSIX, so define that version to get it from more conformant systems. commit 5ffbcfec3d37d3b627a78acfa00dbafc5948df82 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Tue Apr 8 14:42:00 2008 +0930 dix: Ensure Proximity events don't kill the server. Add Prox events to the if-clauses with the other events that are usually sent from the input devices. Ensure that the event deliverers won't try to deliver events of type '0' (some extended events doesn't have an equivalent core-type) Small modification by Peter Hutterer. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 32e4a88ae613c7200d84d5621344b418b656346b Author: Peter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au> Date: Tue Apr 8 08:42:58 2008 +0930 xkb: don't overwrite CtrlProc in the second run of XkbFinishDeviceInit. XkbFinishDeviceInit is called once when the device is initialised, but also when a class copy causes the key class of a device to change. In this case, overwriting the CtrlProc of the KeybdFeedbackClass with XkbDDXKeybdCtrlProc sets up a nice recursive loop of XkbDDXKeybdCtrlProc calling itself until the cows come home. commit 6271df6953bea462be7e9e01744e5dd46841e867 Author: Peter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au> Date: Tue Apr 8 08:42:58 2008 +0930 xkb: don't overwrite CtrlProc in the second run of XkbFinishDeviceInit. XkbFinishDeviceInit is called once when the device is initialised, but also when a class copy causes the key class of a device to change. In this case, overwriting the CtrlProc of the KeybdFeedbackClass with XkbDDXKeybdCtrlProc sets up a nice recursive loop of XkbDDXKeybdCtrlProc calling itself until the cows come home. commit 726dcd9e4ebfb09c0685450dca6e9fae7e773814 Author: Adam Tkac <atkac@redhat.com> Date: Mon Apr 7 10:20:02 2008 -0400 Fix Xvfb input when building against current X sources. commit 0f87b41a432a6472a15ec0c9dee997e3bddbd0f2 Author: Hasso Tepper <hasso@estpak.ee> Date: Mon Apr 7 14:09:04 2008 +0300 configure.ac: DragonFly BSD support Add support for DragonFly BSD, which is just the same as FreeBSD for all of these cases. commit 6b1a27023e48b661c4bb3b61181ac57608d8e448 Author: Owen W. Taylor <otaylor@fishsoup.net> Date: Thu Apr 3 14:50:05 2008 -0400 EXA: Fix TS origin computation when implementing RenderComposite with tiling. commit fd06e8f8c1d82a9d91931e8532bee0fd9c9ca9ab Merge: b46a009 6c0cfe3 Author: Peter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au> Date: Mon Apr 7 07:56:41 2008 +0930 Merge branch 'master' into dcdc_rework Conflicts: Xext/xevie.c dix/dispatch.c commit 539bf3c2836727e7560c64144071b086f8ea32fe Merge: 3ab33e7 6c0cfe3 Author: Sascha Hlusiak <saschahlusiak@arcor.de> Date: Mon Apr 7 00:10:16 2008 +0200 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 3ab33e7cd46c25dfc461b2a1b13e138225a94524 Author: Sascha Hlusiak <saschahlusiak@arcor.de> Date: Sun Apr 6 23:23:47 2008 +0200 Remove stale code The jstk code for Joysticks is not used by any module, was never actually compiled and uses an API that is deprecated these days. No reason to keep it. commit b46a00918691cbd5ca80b6d3acae7614f93e073b Author: Peter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au> Date: Sun Apr 6 09:02:57 2008 +0930 dix: sprite may be NULL, don't dereference it then. In some rare cases (e.g. when the init fails) a device's sprite is NULL, dereferencing it to xfree the spriteTrace is a bad idea then. commit 638a50552e3e2190eac9721deb72e7365bdd52e4 Author: Peter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au> Date: Sun Apr 6 08:36:21 2008 +0930 dix: remove debug error message about XI->core type conversion. commit 8f38feb3e464986dc523dabd3447ba13263a3a4a Author: Peter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au> Date: Sat Apr 5 20:37:09 2008 +1030 Xi: add comments for DeepCopyDeviceClasses, ChangeMasterDeviceClasses. commit 6c0cfe3d43b177c4cfaf7e228f32c655f9a98459 Author: Julien Cristau <jcristau@debian.org> Date: Fri Apr 4 19:01:40 2008 +0200 Fix the clock_gettime check for glibc-based non-Linux systems We need to define _POSIX_C_SOURCE on glibc, not just Linux, so add a new test for the __GLIBC__ macro. commit cc7c045bae01d90d8f1b750080ba48a96e983c68 Author: Adam Jackson <ajax@redhat.com> Date: Fri Apr 4 12:58:12 2008 -0400 Fix PCI config space cycles from int10 emulator. The top bit of 0xCF8 is an enable bit, not part of the domain. Sending cycles to domain 128 instead of domain 0 is rarely the right thing to do. commit d1de3dda8efe501d4192c8a99c34ab4265316c32 Author: Eric Anholt <eric@anholt.net> Date: Mon Mar 17 14:22:39 2008 -0700 Fix clock_gettime presence detect on FreeBSD. For non-Linux, _POSIX_C_SOURCE and friends restrict symbols defined rather than enabling defines of symbols. Additionally, CLOCK_MONOTONIC was apparently added to the standard around 2000 anyway, not 1993. commit ec17900f52bbd25d07566834756e5c7e832e0463 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Apr 4 10:46:45 2008 -0400 Convert __DRIconfigs after we've made sure createNewScreen succeeded. commit 16a8ce75585ea360c39e0ffce4f7bb26a359b754 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Apr 3 16:44:32 2008 -0400 Only autoload RECORD if it was enabled. commit d0395a753079f291a78d9ab86810b5f84f237491 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 4 15:05:26 2008 +1030 Xi: realloc to->valuator instead of allocing it blindly. commit 502689847b86be5619da7134646d55a1ac322a2c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 4 15:01:53 2008 +1030 Xi: ALLOC_COPY_CLASS_IF should only alloc if to->field doesn't exist. commit 035b1b6995e670ce5593e8aceb08f9ec812c70ea Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 4 15:00:06 2008 +1030 Xi: remove duplicate copying of kbdfeed and ptrfeed. commit 52fc7aed18930fc9e6bcfdd5dbc28ae559978288 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 4 14:47:23 2008 +1030 Xi: only alloc memory for feedback classes if it doesn't already exist. commit 4eb87c8693b57d9354832c76417797394656333e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 4 14:20:18 2008 +1030 Xi: don't free device classes before copying them. First commit in a series to come. commit f0915fb3c4a9712200882440a64d11dc595a02bb Author: Dave Airlie <airlied@redhat.com> Date: Fri Apr 4 09:29:51 2008 +1000 quirk: add quirk for ACER EDID commit 2e42b67b82db0f9128dd00e339b9dfdd9fe6d667 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 2 18:05:34 2008 -0700 XQuartz: Change reporting of space change to debug log rather than stderr (cherry picked from commit ed15556a9fc4ebdb88f42961052fc8456082165f) commit c737d04c758e03e32f692a31ed2a665ccbafa931 Author: Ben Byer <bbyer@apple.com> Date: Tue Apr 1 00:40:46 2008 -0700 The AppKit thread should not be calling directly into the X server functions to change state when the keyboard is reloaded; instead, pass it as an event. (cherry picked from commit 7e653f806ff5508aace059312156f319a9ed4479) commit 15b0084f1ab23042190d8beeb3f088b92dee5a10 Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 23:31:25 2008 -0700 formatting cleanup for X11Application.m (no code changes) (cherry picked from commit eb083d3f68f459d90417558da1ed00729b749950) commit e9e2d88436597875f102085d216dc0a8fce1450a Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 22:55:24 2008 -0700 moved and renamed QuartzMessageServerThread to DarwinSendDDXEvent to make more clear what it actually does. (cherry picked from commit bee2b377efc930e25017636e5112093a3a6549c7) commit c1be4e3379d8780dff20390939b657ca0973995a Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 21:04:37 2008 -0700 shovelling code around ... (cherry picked from commit 2143182ba49195bbb2e9163ea6872fd68e7a4a85) commit 985c631b2e1f113039e6e620f030505435fd9815 Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 20:18:58 2008 -0700 just a bit of juggling headers around -- we're preparing to call our Xquartz-specific event handlers directly as mieqHandlers (cherry picked from commit 4aedba5aa727e22316e8ca456f7218bea9ee0313) commit 89f1d880e83e32b72d35c4dbd6795defa6efa847 Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 19:47:28 2008 -0700 nuke DarwinEventQueue (cherry picked from commit 1e0ec02202eeaffae480048b91bf02140ee29f8a) commit 8944b77ec0c18476a25ba3179bcc45b338be22b8 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 2 17:47:42 2008 -0700 continue with gutting darwinEvents.c (cherry picked from commit c34fce7051b996633291dddc061b696ff737f3fb) commit aa6d12e93e8661da841192ef7c3aa7c6a7731c7f Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 2 17:46:59 2008 -0700 turns out we weren't actually using these files. oops (cherry picked from commit bfec44d7b4baf0ad0aae55c8209bc60ac93c5b58) commit 6c5962e44730395f81cdb333322c9ad5242c32d4 Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 18:15:18 2008 -0700 remove vestigal DarwinEQPointerPost etc (cherry picked from commit a25704c423598d596fd7f2ed4290d4b860bd5d5f) commit c6f0d5d1e51326e5110d27918d834eb0096df7db Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 17:48:09 2008 -0700 gut darwinEQEnqueue, and make it just call mieqEnqueue (for the moment) (cherry picked from commit a9e081a60ca227c0d96d4613075d97d6b762366a) commit 5b6c273eaa53d7b554d69c2b4865988068e73a26 Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 17:08:45 2008 -0700 add prototype for DarwinEventHandler (cherry picked from commit 9a03ae33c4f9de830f15eabf3b994882ead7c000) commit 3713be8b470b1ac0fcb4f1e4c6b79c526b2196db Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 16:30:16 2008 -0700 add logging of current thread ID to DEBUG_LOG macro (cherry picked from commit 5848510cc5a8091b30230ab920d904ca6b159480) commit 1400a51ae70d8e498d9ae3975f58ba7c1768ca6f Author: Ben Byer <bbyer@apple.com> Date: Mon Mar 31 16:24:01 2008 -0700 Begin to move all of our Xquartz DDX-specific event handlers to miEQ, in preparation to remove the DDX-specific code entirely. (cherry picked from commit 3f4447b95f73a82b3aa0f7b0d1640aba5fb0d1bc) commit 8746daa6732d9837f66d925f2fd74818ecbf8ba2 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Wed Apr 2 15:01:33 2008 -0700 XQuartz: Fixed missing close-paren in preference pane text. (cherry picked from commit ea37e151dc6032d2a1a33cef809f2a7d507aae35) commit b5a0a865c3045cc08c33388320d4ec3ab7065efb Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Apr 2 19:21:41 2008 -0400 Pick up dri2proto from the standard proto header include path. commit 8cde0af3c57f0375ba8ba77af9fdf74b79d9496d Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Apr 2 19:06:40 2008 -0400 Send the GLX_EXT_texture_from_pixmap attributes to the client. commit 7c20f65fea3dd3170cde89d7113d85f377671bfb Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Apr 2 18:00:06 2008 -0400 Add @XORG_CFLAGS@ to satisfy xf86* includes. Pointed out by Hasso Tepper. commit b13ab156894074fb38cc812738bc7aeeebd9614d Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Apr 2 12:38:36 2008 -0400 dri2: Unbreak glcore visual setup. commit b31de6a59044f91f8230aa581c9ca8540289c168 Author: Xiang, Haihao <haihao.xiang@intel.com> Date: Wed Apr 2 16:29:30 2008 +1000 dri2: fix crasher if DRI2Connect fails commit ebc56aca8bdfec1918cac3c8380895dfddea48ce Author: Hong Liu <hong.liu@intel.com> Date: Wed Apr 2 10:43:19 2008 +0800 Bug #15160: quirk Proview AY765C prefer first detailed timing commit 9500033b9ecdfaf5a56a4355ffc94d74cb17ca17 Author: Goneri Le Bouder <goneri@rulezlan.org> Date: Tue Apr 1 20:19:40 2008 +0200 xfree86: don't crash in AutoConfig if the primary device is not pci Only call matchDriverFromFiles() if we found a pci device. Debian bug#472823 (http://bugs.debian.org/472823). commit 37b1258f0a288a79ce6a3eef3559e17a67c4dd96 Author: Thomas Jaeger <thjaeger@gmail.com> Date: Tue Apr 1 15:27:06 2008 +0300 XKB: Fix processInputProc wrapping If input processing is frozen, only wrap realInputProc: don't smash processInputProc as well. When input processing is thawed, pIP will be rewrapped correctly. This supersedes the previous workaround in 50e80c9. Signed-off-by: Daniel Stone <daniel@fooishbar.org> commit a4d034941100c6ca3b7cc4e59952c2745b9306cc Author: Ben Byer <bbyer@bushing.apple.com> Date: Fri Mar 28 20:47:44 2008 -0700 Add code to track 5 valuators for pointing device, in preparation for supporting tablet input in Xquartz. (cherry picked from commit 22c8849ea819eb70a14b2e06330b11b22aa63ebc) commit 6648867d8bd1e86458d2ade77a3ee4567c3d6a97 Author: Ben Byer <bbyer@bushing.apple.com> Date: Fri Mar 28 18:27:02 2008 -0700 add debug statements so we can see if/when our Xinput stubs are getting called. (cherry picked from commit 6e160bbe15dd2c2b8685847c06831cb6aebc6f74) commit 19ff23ab0e72a27d05ed4470f75a0934d6f6c1d1 Author: Ben Byer <bbyer@bushing.apple.com> Date: Fri Mar 28 18:25:03 2008 -0700 Remove calls to InitValuatorAxisStruct -- these are now handled in dix by InitValuatorDeviceClass. Add InitProximityClassDeviceStruct call to prepare for tablet support. (cherry picked from commit 1bd980a5b114f5320360943214f8f9f23b29c1e3) commit 9f56fc580646a519875b5a1452738d8c6e1fa860 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 31 17:34:07 2008 -0400 XSELinux: Add a request to get a client's context from a resource ID. commit c40e0b51f0d9ef5e1f30f233d7db1e6db9d6681b Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Mar 26 19:28:09 2008 -0400 Implement DRI2 direct rendering and update AIGLX to DRI interface changes. Get rid of glcontextmodes.[ch] from build, rename __GlcontextModes to __GLXcontext. Drop all #includes of glcontextmodes.h and glcore.h. Drop the DRI context modes extension. Add protocol code to DRI2 module and load DRI2 extension by default. commit 8074676d2df8d577b443e3fa5e22d7c71c944bd1 Author: Fredrik Höglund <fredrik@kde.org> Date: Mon Mar 31 21:24:59 2008 +0200 EXA: Optimize the eviction scanning loop in exaOffscreenAlloc. Reduce the cost of the inner loop, by keeping a set of pointers to the first and the last areas in the series, subtracting the cost of the first area from the score, and adding the cost of the last area while walking the list. This commit also moves the scanning loop from exaOffscreenAlloc into a separate function. Idea by Michel Dänzer. commit 93d876891dbba41b920a9a29a5de77f647f43928 Author: Fredrik Höglund <fredrik@kde.org> Date: Mon Mar 31 21:15:50 2008 +0200 EXA: Improve the algorithm used for tracking offscreen pixmap use. Replace the current score keeping algorithm with a rolling counter that's incremented in ExaOffscreenMarkUsed, with the previous value being stored in the area. exaOffscreenAlloc uses the difference between the counter value and the value in the area when deciding which area to evict. It now also takes the size of the areas into account, and favors evicting smaller areas. The credit for these ideas goes to Michel Dänzer. commit 7034484f0887ea0f8ab956515f2d9301ea5842ce Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 28 10:23:36 2008 +0200 gitignore: Add two more bits Get slightly better at ignoring vim swap files, and let people keep local changes if they want to. commit b8ea9f2a25aad88aee77a68f8e20ac07276f0dab Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Mar 28 17:00:08 2008 -0700 XQuartz: Fixed names of enums to be more consistent (cherry picked from commit c309a08806daf5d716a860c709e51eacad2c745a) commit bd28839eb866a9e6dc3ff80f13a67611da7eaf64 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Fri Mar 28 17:02:02 2008 -0700 =?utf-8?q?XQuartz:=20Another=20Expos=C3=A9=20fix:=20F9=20doesn't=20raise=20all=20windows =20(cherry=20picked=20from=20commit=20b9cffa20debae73737c674bf75ab65db1bd74556)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit commit 933ffcdf7d2eaaf7caabfe6f861f04bcb149918f Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 28 17:53:55 2008 -0400 Compile fix. commit 9e8451d869a4032ddb7de6a62920a3a7b0b1acc1 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 3 17:38:53 2007 -0500 Add E-EDID segment selection. commit 0b4aef4d6df7a5525d381de035fbbf78c5fffeef Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 3 16:00:00 2007 -0500 Refactor DDC2 code to allow for proper segmented addressing. commit 88ece11d6c45c6f4b94f7fb2da64a46e879d7c27 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 3 15:47:39 2007 -0500 Start E-EDID support in the DDC module. Since there's no way to safely know how many blocks xf86DoEDID_DDC2 would return, add a new xf86DoEEDID entrypoint to do that, and implement the one in terms of the other. commit b5f98fcea2024c67e598947782913982072cf4fb Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Mar 28 14:01:34 2008 -0400 XSELinux: Add xorg.conf option for permissive/enforcing/disabled. Patch by Joe Nall. The option goes in the "extmod" subsection. TODO: Make it easier for extension modules to handle their own options. commit 415e49b940bba2d08870db410ebb47d2add5d836 Author: Jeremy Huddleston <jeremyhu@freedesktop.org> Date: Tue Mar 25 23:01:02 2008 -0700 XQuartz: Sanity-check the removal of the 256-color option Fixes the 'one-time-preferences' bug in 2.2.0_rc1 (cherry picked from commit 38cbd13490fc21724e8eef0ec7e1a20a9cc2e39d) commit c1d37efe9aae5f2895b3437418f7e4bb2eb3400f Author: Ben Byer <bbyer@bushing.apple.com> Date: Tue Mar 25 19:25:00 2008 -0700 xquartz: copy in new stubs from Xi/stubs.c to replace our old Xinput stubs. Hey, it's a start. (cherry picked from commit 566412b4aece24ae6af8c7c835986b685aa456a2) commit c4a616a741e15865ce0ff98781c6f1dca4d62887 Author: Ben Byer <bbyer@bushing.apple.com> Date: Mon Mar 24 22:43:10 2008 -0700 prevent "fake mouse clicks" from generating spurious extra events (cherry picked from commit bd85a24969427e41389688663ead2d4dd41c9999) commit c747030a49dd289e873e2b686cd129d840e55468 Author: Dave Airlie <airlied@redhat.com> Date: Thu Mar 27 15:18:39 2008 +1000 quirk: fix LPL monitors properly. no point having a h cm fix when we really want to copy the sizes from the other place. RH BZ 435216 commit 9df915b84d45d39aed7557c98883b20a66da2e96 Merge: 47eb658 333e712 Author: Sascha Hlusiak <saschahlusiak@arcor.de> Date: Tue Mar 25 17:50:50 2008 +0100 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 333e7123dc484888d79c0f5aa3977bd72f1eb341 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 25 12:48:22 2008 -0400 Fix that last commit. I can apply patches, really. commit 47eb658e802775021e3efec109f95431cca188ca Author: Sascha Hlusiak <saschahlusiak@arcor.de> Date: Tue Mar 25 17:37:25 2008 +0100 Support to pass arbitrary options via HAL hotplugging Parse "input.x11_options" and pass every key/name pair to the driver. Remove check for input.capabilities, because that's part of the fdi files. Thanks to Dustin Spicuzza <dustin@virtualroadside.com> for the patch. commit e7a364425547103a98acabfc67d16e1ae0c2967f Author: Sascha Hlusiak <saschahlusiak@arcor.de> Date: Tue Mar 25 12:32:33 2008 -0400 Fix getValuatorEvents to compute number of valuators correctly. commit f028e245a7932362656701c08fcfbfa8e8949077 Author: David Nusinow <dnusinow@debian.org> Date: Thu Feb 28 19:45:21 2008 -0500 Bug #10016: Implement WM_CLASS hints in Xephyr. commit 862ff9ac92037e13629329eb6ba50ff6bd2c5f71 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 24 13:37:42 2008 -0400 Bug #11510: Fix build without RECORD. commit 87bfd3bd96c714a1c252d42408b5a1a4ff9dab06 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 24 13:33:38 2008 -0400 Bug #11508: Fix build without XV. commit 536f2ff5382aaaace3b55481e15366bb15d87801 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 24 12:22:19 2008 -0400 Bug #13962: Re-arm the DPMS timer when re-enabling DPMS. commit 4217ba0cf0c9bbea3774760e836ab372acf3237c Author: Julien Cristau <jcristau@debian.org> Date: Sat Mar 22 17:31:08 2008 +0100 xaa: use xf86ReturnOptValBool instead of xf86IsOptionSet The latter doesn't return the option's value, just whether it's present in the configuration. commit 6b9d2bb1f7f87acbf275027af9c2982e91e5faed Author: Julien Cristau <jcristau@debian.org> Date: Sat Mar 22 17:28:48 2008 +0100 exa: use xf86ReturnOptValBool instead of xf86IsOptionSet The latter doesn't give you the option's value, it just tells you if it's present in the configuration. So using Option "EXANoComposite" "false" disabled composite acceleration. commit 63859473965f911515bc6e8d87b32a65ec41eb73 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Fri Mar 21 19:31:31 2008 -0700 XQuartz: Disable 256 color option and fullscreen option (cherry picked from commit 7c1964338a33558d3f25e369dfca99e3ef9d10f9) commit 93daa3a3bf1a981757024847882ce92b6bdaae83 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Fri Mar 21 19:11:59 2008 -0700 Xquartz: Added separate preference tab for quartz-wm settings Added FFM and "Focus on new window" options (cherry picked from commit 6841d078b7cb0b0db3db948d26b4d5ec7747deb8) commit c49e11268322712c211f29d51d664d3f8a59b00b Author: Jeremy Huddleston <jeremy@tifa.local> Date: Fri Mar 21 18:07:38 2008 -0700 XQuartz: Initial framework for dealing with spaces on OS-X (cherry picked from commit 9831324998f9d1f05ff944c58c5bf60dcae17355) commit 4c76607b699431183ee7e88fa7818cb7644a5a02 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Mon Mar 17 23:57:41 2008 -0700 Rootless: Removed safeAlphaXXXX() in favor of using fb/pixman (cherry picked from commit f03202ad15457c98be7ca78cc59bac88cf5f1966) commit 87c64cfd6901083da5a9375d0bde65691d374b5b Author: Jeremy Huddleston <jeremy@tifa.local> Date: Fri Mar 14 17:31:54 2008 -0700 =?utf-8?q?Apple:=20Xserver=20half=20of=20the=20Expos=C3=A9=20bug-fix=20(requires=20updated=20libXplugin=20from=20Apple...=20coming=20with=202.2) =20(cherry=20picked=20from=20commit=2037be23e8c1d8e5c7a1157e9d66ef3f30a4c472c5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit commit 3bbd77ff98478153afe3251de9ba11d757218213 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 20 20:03:02 2008 -0400 XSELinux: Do a check for whether background "None" is allowed. commit e323bb426ce8a072d119cb2720b773241259c137 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 20 19:42:09 2008 -0400 XSELinux: Correctly handle some permission bits that are used more than once. commit da973e962d09854b571320dee7dd9569060bc39e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Mar 20 09:18:29 2008 -0400 Fix RandR 1.2 driver interface conversion of two colour cursors to ARGB This patch (and not setting HARDWARE_CURSOR_BIT_ORDER_MSBFIRST on big endian platforms) fixes it for me with the radeon driver and doesn't break intel. Correct patch this time :) commit f8c1eb29e28818895d744c4e1d6897353d51790b Author: Alex Deucher <alex@cube.(none)> Date: Thu Mar 20 09:14:41 2008 -0400 Revert "Fix RandR 1.2 driver interface conversion of two colour cursors to ARGB" This reverts commit 267352579612155adfd4743432d6569b2cdeebde. Pushed the wrong patch. commit 267352579612155adfd4743432d6569b2cdeebde Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Mar 19 19:12:37 2008 -0400 Fix RandR 1.2 driver interface conversion of two colour cursors to ARGB See bug 11796 commit 060a99444ee25a684b0ab9b4819bf8e855aea2d8 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Mar 19 16:04:16 2008 -0700 Make Xevie private symbol names less generic Makes it easier to figure out what you're seeing in the stack trace instead of wondering where in the server "ProcSend" is. commit f37046984d7839faefa4d716624e4a85ddde9634 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Mar 19 14:06:53 2008 -0700 Xevie cleanups, byteswapping fixes & request length check fixes commit edad0a9dfebcce5c54b2f9c32bd9d45549e20c51 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 18 17:51:21 2008 -0400 Apply __glXDisp_GetVisualConfigs message patch From http://bugs.freedesktop.org/show_bug.cgi?id=13863 Problem was that the glxcmds.c __glXDisp_GetVisualConfigs function left garbage in the tail end of the message used for extensions. commit cdadd2ff9bade318caac5c1d9bcdc8a001347da9 Author: Dodji Seketeli <dodji@seketeli.org> Date: Tue Mar 18 14:00:15 2008 +0100 [Xephyr/DRI] correctly route motion events targeted at GL drawable commit afd7428690d87097117ab20335658f6d59d60103 Author: Jesse Barnes <jbarnes@jbarnes-t61.(none)> Date: Mon Mar 17 14:55:44 2008 -0700 Cleanup logic in xf86PrepareOutputs Should have done this in the first place. Since we're checking for the absence of the get_crtc callback in the first place, we'll short circuit the later call and disable the output, so the ugly "continue" block is unnecesary. commit ba85caacb565b9aa0aeace52a362350304b0566d Author: Jesse Barnes <jbarnes@jbarnes-t61.(none)> Date: Mon Mar 17 14:13:09 2008 -0700 Make xf86SetDesiredModes aware of current output configuration By adding a new output callback, ->get_crtc, xf86SetDesiredModes is able to avoid turning off outputs & CRTCs if the current output<->CRTC mappings are the same as the desired configuration. This helps avoid flickering displays at startup time, which speeds things up a little and looks better. commit bee2ddf35f75086cee951142098637f2c756b96b Author: Jesse Barnes <jbarnes@jbarnes-t61.(none)> Date: Mon Mar 17 08:33:01 2008 -0700 Fail CRTC configuration if !vtSema Unless we check for vtSema before calling into the CRTC and output callbacks, we may end up trying to access video memory that no longer exists, leading to a crash. So if we don't have vtSema, return FALSE to the caller, indicating that we didn't do anything. Fixes #14444. commit db248ffb840a0c113b6eb508a0fa1e74e752474d Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 16 18:46:11 2008 +0100 test for the presence of pci_system_init_dev_mem() before calling it. This avoids creating a dependency on -current libpciaccess for BSD systems other than OpenBSD (which don't otherwise need it). commit aa231f28d56402d7daea6cbd3002fbf760f79497 Author: Donnie Berkholz <dberkholz@gentoo.org> Date: Fri Mar 14 18:41:25 2008 -0700 Xephyr: Build fix: Port across XF86dri.c changes from Mesa. commit a955c3b587b22b8bf20cb6bedbbec4ad5fcb32ac Author: Donnie Berkholz <dberkholz@gentoo.org> Date: Fri Mar 14 18:41:07 2008 -0700 Xephyr: Distribute ephyrdriext.h in tarballs. commit 090b26db767d296e7a3452da83b136d1caa0ed01 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 14 21:58:27 2008 +0200 XkbCopyKeymap: Fix broken indentation An astute observer will note that the entirety of XkbCopyKeymap is indented with spaces, and no tabs whatsoever, and not commit changes which break the otherwise consistent indentation. A non-astute observer will note the breakage when the commit mail comes through with clearly broken indentation. A polite, non-astute, observer will then fix it. C'est la vie. commit 88bec0915e3867f8dbf859a3dfbb771d0d07092d Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 14 21:54:13 2008 +0200 mi: More meaningful assert crashes When we fail an assert in miregion.c (which happens every now and then, though I haven't yet checked up why), at least generate a segfault, so we'll get a backtrace. commit 57d48d94b8947c571925e6fd4c9bf041fbd1b2ac Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 14 14:37:42 2008 -0400 Fix a stray use of ALLOCATE_LOCAL. commit 824853772241acf64bc37ac8b85254194741ae13 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 14 14:24:21 2008 -0400 RANDR 1.2: Fix initial mode aspect ratio match in a corner case. Actually more like in the mainline case, where the ideal mode happens to be the very first aspect match on the first monitor. But let's not split hairs. commit 1b9878ffcfc0c0dbc4a6e674827fe508ba77db4b Author: Bart Trojanowski <bart@jukie.net> Date: Thu Mar 13 17:42:16 2008 -0400 Bug #14332: Fix PCI access cycles from x86emu. The address written to 0xcf8 contains the PCI slot address to send the config cycle to. However, we would ignore that and always send the cycle to the device whose BIOS we were running. This breaks some integrated graphics platforms that have explicit knowledge about the system's host bridge, for example. commit f7abe05b3306ed9a6f2cf5e3e45ed524d725d029 Author: Doug Chapman <doug.chapman@hp.com> Date: Thu Mar 13 17:40:34 2008 -0400 Bug #14091: Fix build (and runtime) on ia64. commit 5d7437c29e686a081b20823450d78c4c2f4e0aec Author: Adam Jackson <ajax@redhat.com> Date: Thu Mar 13 17:37:12 2008 -0400 RANDR 1.2: Fix the RANDR 1.1 screen size estimation to approach reality. While the ScreenRec's notion of size in millimeters would get updates, the RANDR 1.1 notion wouldn't, so your screen would appear to be square and probably at some ludicrous DPI. commit 61c3f63a75d8b0cc47ffed4a0e30147fab2ae8f4 Author: Adam Jackson <ajax@redhat.com> Date: Thu Mar 13 17:34:54 2008 -0400 RANDR 1.2: Don't report a square resolution to RANDR 1.1 clients. It can't possibly do anything useful, and older versions of Gnome (and proably others) get very confused by it. So do the drivers, for that matter. commit 06c0372c3a1b45005eb6d50406f77f4e93f1de1e Author: Mark Kettenis <mark.kettenis@xs4all.nl> Date: Wed Mar 12 21:45:37 2008 +0100 OpenBSD support for libpciaccess. xserver and libpciaccess both need to open /dev/xf86, which can only be opened once. I implemented pci_system_init_dev_mem() like Ian suggested. This requires some minor changes to the BSD-specific os-support code. Since pci_system_init_dev_mem() is a no-op on FreeBSD this should be no problem. commit 2036851125226065891f13583ade3ce559e7bd37 Author: Matthias Hopf <mhopf@suse.de> Date: Mon Mar 10 19:29:07 2008 +0100 Return randr interface version in xf86CrtcScreenInit() Necessary to allow drivers to be run-time backwards compatible when using the modes/ functions w/o providing their own copy. commit c7536f4b87e089a7e7c43026b189922fec70c565 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 11 13:11:04 2008 -0400 Silence REGION_INIT() warning. Evaluating the address of a BoxRec as a boolean gives this warning: i830_driver.c:2317: warning: the address of 'ScreenBox' will always evaluate as 'true' which is pretty annoying. This patch compares the address to NULL to avoid the pointer->bool conversion and gets rid of the warning. Seems like a lame hack, but the warning is worse. commit cc05255191413b3f376edbc600122ff085f45f7b Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 11 00:51:43 2008 -0400 Make WriteToClient take a const void * like any decent IO write function. Enough with the casting. Doesn't break API or even ABI, but does make a lot of silly casts superfluos. commit bc504ffbba3dec2e3467bab8ba1ac25db6dd317e Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 11 00:35:31 2008 -0400 DRI2: Add DRI2AuthConnection(). DRI2 uses the same authentication scheme as XF86DRI, so implement this entry point so DRI2 protocol code can access it. commit b2657ec5981122e7cc0bda0d8802aec63cde9014 Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 6 16:51:57 2008 -0800 XkbCopyKeymap was mangling doodads and overlays commit ab9b0b36ac8ac72fc48c0abd91a83de49a18313c Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 10 13:40:00 2008 -0400 Add the "amd" driver to magic driver selection. commit 0f6aaf636b7ac4c98467284ff7baf1b83e0b72e7 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 10 09:14:20 2008 -0400 Bug #14927: Fix the math for xf86NumDefaultModes. commit 01c2e01f2aee580438b74bfb9da8f584f3878e6b Author: Kristian Høgsberg <krh@sasori.boston.redhat.com> Date: Sun Mar 9 21:40:27 2008 -0400 GLX: Track changes to DRI_TEX_BUFFER extension. We now just pass in the __DRIdrawable. commit acedc03367e9e69f03b4838f0f0e8d8a8e872b9b Author: Kristian Høgsberg <krh@sasori.boston.redhat.com> Date: Sun Mar 9 21:39:19 2008 -0400 DRI2: Return event buffer head index in DRI2CreateDrawable. And pass it to the DRI driver in AIGLX. commit 911f0c147699d3b8d97491be2ef6d2e4a6682a0b Author: Julien Cristau <jcristau@debian.org> Date: Fri Mar 7 23:24:06 2008 +0100 Programs in hw/dmx/examples/ want client-side xkb headers. commit 9abaad115cb6245b12b2adb3552ace99b634ab4a Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Mar 7 14:12:28 2008 -0500 Fix DRI2 texture target for GLX_EXT_texture_from_pixmap. Thanks to Dennis Kasprzyk for pointing it out and for reminding me to commit it. commit 3bf7ff70323d533a3a05c0f3e22393e63beada99 Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 7 09:25:06 2008 -0500 Size xf86DefaultModes explicitly. i.e., don't check for the end of the list by ->name == NULL, since that won't work now. Fix the consumers of xf86DefaultModes to use the new explicit size as well. commit 3fcb6445dc08f42488287162e3b7009d405e9c5b Author: Adam Jackson <ajax@redhat.com> Date: Fri Mar 7 08:29:49 2008 -0500 Fix segfault when a monitor exists but has no modes. Thanks to Zhenyu Wang for finding this. commit a8d760f567b19268329c4682495caa591f08a854 Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun Mar 2 20:13:11 2008 -0800 Get modes code building with old X servers again. This change uses XORG_VERSION_CURRENT < 7.0 to mean "server newer than 1.2" since XORG_VERSION current went backwards at some point. commit ca616b902b2c5d0f046c7a042c11f045479e373a Author: Jesse Barnes <jbarnes@jbarnes-t61.(none)> Date: Thu Mar 6 13:47:44 2008 -0800 Allow RandR get output property to call into drivers In order to report accurate values to users of the RandR property interface, it's sometimes necessary to ask the driver to update the value (for example when backlight brightness changes without the server's knowledge, due to hotkey events or direct sysfs banging). This patch wires up the core server code with a new xf86CrtcFuncs callback, get_property, to allow for this. The new code is available under the RANDR_13_INTERFACE define, which in turn depends on the RANDR_12_INTERFACE code. commit 34b69e3bc0e6462eb60029fbcb4f5479494007a2 Author: Adam Jackson <ajax@redhat.com> Date: Wed Mar 5 23:56:49 2008 -0500 Fix distcheck. (cherry picked from commit 2a47accff8dccded4dfe031f9366c028ba927824) commit 8e562fe26ff77c03be0855afb08e43f3ed0bd4b9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Mar 5 15:11:41 2008 +1030 Xi: remove false memset from DeepCopyDeviceClasses. It's wrong, needs to be different, but I haven't had enough coffee to figure out what it needs to do yet. commit d4101140f4e569f18554cf0cbf43138d08bd1277 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 4 22:39:41 2008 -0500 xselinux: Implement polyinstantiation support and related protocol. commit cf984dcc156958d4f8d98110e7add150628ce97e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Mar 4 16:03:04 2008 -0800 Make sure SIOGLIFCONF buffer is properly aligned for socket structures commit 27e7dacbf7ef17712be31ff90f98ee3a5c5cf909 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 4 11:38:34 2008 -0500 Make xf86InitialConfiguration slightly smarter. Old heuristic was to find the first monitor that expressed a preference, then attempt to get all other monitors to agree. This doesn't work particularly well when the two sets of modes don't precisely intersect, you get overlapping-but-not-identical output geometry and things go wrong. New heuristic is: - Exact user preference, if given - Exact output preference, if the same for all outputs - Best (largest) mode of modes common to all outputs: - with the same aspect ratio as all outputs (may be NULL) - with 4:3 aspect ratio - Then the old heuristic to try to get something lit Note that it is simply not doable to have a reliable initial output guess if you insist on trying to clone all outputs together. It's far too easy to end up with displays that simply don't have modes in common. We need to switch to right-of placement someday, once we're not limited to CRTC size limits and we have working multi-GPU in RANDR. commit 95df04b744c6a3498a9a9e2ea9bb03ee780e60f8 Author: Adam Jackson <ajax@redhat.com> Date: Tue Mar 4 10:59:24 2008 -0500 Remove all mention of the vga driver from the config logic. commit 7b4f3616f75a541b819d99c28bb6cb73761b6066 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Mar 4 18:29:15 2008 +1030 Xi: add deviceid to QueryDevicePointer request. Why not, we had the padding anyway. Suggested by Jim Gettys on the X.Org mailing list. commit 056a2ce02ce85013e89055ee44a7aa3eabedac09 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 4 02:44:48 2008 -0500 XACE: Check the return value of the selection create hook call. commit 4f2cd0ed96d3b10c78774c721c2ffbfb0556dddd Merge: 23ae68a 453661a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Mar 4 18:11:10 2008 +1030 Merge branch 'master' into mpx This merge reverts Magnus' device coorindate scaling changes. MPX core event generation is very different, so we can't scale in GetPointerEvents. Conflicts: Xi/opendev.c dix/devices.c dix/dixfonts.c dix/getevents.c dix/resource.c dix/window.c hw/xfree86/common/xf86Xinput.c mi/mipointer.c xkb/ddxBeep.c xkb/ddxCtrls.c xkb/ddxKeyClick.c xkb/ddxList.c xkb/ddxLoad.c xkb/xkb.c xkb/xkbAccessX.c xkb/xkbEvents.c xkb/xkbInit.c xkb/xkbPrKeyEv.c xkb/xkbUtils.c commit 72f2197545e734cd0aa785d05a57b2fc0351a763 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 4 02:02:54 2008 -0500 dix: Convert selection list to a linked list. Fixes a bug where pointers were being invalidated after a realloc. commit 0bd0f90d7c7928052197da7119177e5a1c9eee2c Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Mar 4 03:47:36 2008 +0200 XKB: Fix initial map setting on startup Due to an unwitting sense inversion when eliminating XkbFileInfo, we were setting the complete wrong keymap on startup (non-XKB map if we had an XKB map available, or the XKB map if we didn't have any available). Invert the sense properly, and add two small bits that also went missing in that commit. commit 613852ce6a821ce6f6382fc14629f517776a3701 Author: James Cloos <cloos@jhcloos.com> Date: Mon Mar 3 16:10:04 2008 -0500 Fix some documentation typos commit 3f23139137e024e09d207be05a61968100cf53e8 Author: Jesse Barnes <jesse.barnes@intel.com> Date: Mon Mar 3 13:05:12 2008 -0800 Add cscope files to .gitignore commit 708f07753ff22ade54e9ee8885e4198fff363b87 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 3 15:49:48 2008 -0500 RANDR 1.2: Inherit PreferredMode from the global configuration, if any. If you don't do this, then Modes "800x600" in the Display subsection will be dutifully ignored and the driver will start at whatever resolution it feels like. commit 605e6764dfd3e9cb917b9cfcd92fe89857c1a1c9 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 3 15:45:17 2008 -0500 Fix Motif menu drawing in Xnest. See also Red Hat bug #229350, OpenSolaris bug #6366490. commit 3b73d62791d925c465ec855f96981d151dd3c179 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 3 15:43:22 2008 -0500 xf86DDCMonitorSet: Honor the DisplaySize from the config file. We honor sync ranges and pixel clock settings from the config here, no reason to ignore DisplaySize. commit 7c16b68ab879f5b4b1aedfc6b2aadbe56193dd19 Author: Adam Jackson <ajax@redhat.com> Date: Mon Mar 3 15:09:11 2008 -0500 1.5 has branched, start 1.5.99.x. commit f7ab2d3821e6bccc943f088e308fd58395a186d2 Author: David Nusinow <dnusinow@debian.org> Date: Sun Mar 2 18:36:25 2008 -0500 Add missing file from previous commit. commit b5ce0e1d0b861dc5521fcd9db6287ed6da817726 Author: David Nusinow <dnusinow@debian.org> Date: Sun Mar 2 17:12:02 2008 -0500 Bug #13860: Ensure that the DRI mode is in octal format. commit c934366424b0d20e013c84e6b94b226b20e7baa2 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 2 19:27:53 2008 +0100 use UTILS_SYS_LIBS to pass SYS_LIBS to utils/ioports correctly commit 2bb9c1f36f685044b837f42076dec2ea7d22d034 Author: David Nusinow <dnusinow@debian.org> Date: Sat Mar 1 18:44:58 2008 -0500 bug #10008: Make Xvfb.1 document the correct default depth commit b0b9c811cda3e35a8f6d0813483f750602c55ff6 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Mar 1 20:24:50 2008 +0200 fix typo commit 3d642905477f4b1ec3223f1fbe0d0d37e959ec81 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Mar 1 16:18:18 2008 +0200 clean some "unused" warnings commit e7a6f79754816976d92857d55840262cccff80a6 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Mar 1 16:16:29 2008 +0200 glcore: split mesa and X in build system commit cdd46aa3cd2e720558186cdbe48d871ab385fcdd Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Mar 1 15:57:57 2008 +0200 configure: minor cleanup - dmx - darwin: remove from xorg options - xephyr: libxv is client lib commit 8af2c39bcc4ddc4693d5a2597c9622fa17b6c272 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sat Mar 1 16:54:01 2008 +0100 Fix big mistake in commit fd41f46ac62033a724bd1f4612f19448a21c1224. - When a mode is deleted, the name pointer is also free()'ed. - This leaves other modes with an invalid pointer. commit ef60632e200853680282016e32a7a9fb01882852 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 29 18:00:27 2008 -0500 dix: Modify callers of property and selection API to use new interfaces. commit cc76ea6e3ac6a405f0c198c4e62be40aa8d2b546 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 29 17:55:31 2008 -0500 XACE: Add generic support for property and selection polyinstantiation. commit 34bf308a9e66f1a2f48630a15b1802afad50ec24 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 29 18:00:23 2008 -0500 dix: Refactoring of selection code to allow for polyinstantiation. Introduces dixLookupSelection() API. Removes NumCurrentSelections from API. commit d5715f7beaad6816db27b01b67d7a3c69164d106 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 29 16:16:12 2008 -0500 dix: Refactoring of property code to allow for polyinstantiation. Introduces dixLookupProperty() API. commit c0e1959f285d7a7df66f42d55912a5a595decd0f Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 29 16:45:11 2008 -0500 On second thought, revert that, it'll make large pixmaps painfully slow. Need to just fix the callers. commit 4a44fe7c8678360d0549cf0e0d63870f3623b1db Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Feb 29 16:43:14 2008 -0500 Bug #10465: Use calloc() for allocating PixmapRec's. commit 5d5fcc7198ca54fa9dc24fe974763eff9fddabee Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Feb 29 16:42:04 2008 -0500 Bug #10464: Set pixel value to 0 before FindColor() commit 8f0a4282f0ac33625eda9466e3db0bcef64e403a Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Feb 29 16:39:29 2008 -0500 Bug #10463: Always initialize reference pixel before AllocColor() commit b7eb92774a58639aff3f26bb28a3dcff910c3fb6 Author: Adam Jackson <ajax@redhat.com> Date: Sat Jan 12 01:22:05 2008 -0500 EDID 1.4: Print additional CVT support data in the log. commit 31014d88aff8dc8a502cf0f26e4cde141e1a92f5 Author: Adam Jackson <ajax@redhat.com> Date: Sat Jan 12 01:03:44 2008 -0500 EDID 1.4: Decode additional CVT support information. Table 3.28: Display Range Limits & CVT Support Definition commit d1c48955f80692a32ab6adcee1384e3d298f471a Author: Adam Jackson <ajax@redhat.com> Date: Sat Jan 12 00:30:58 2008 -0500 Fix CVT abuse in DDCModesFromStandardTiming. CVT is enough different from GTF that it should not be used on monitors that aren't expecting it. This brings us closer to what the spec says the correct behaviour is. commit 26c2e95fa5bf30726356cf4bdd0fea32a771a179 Author: Adam Jackson <ajax@redhat.com> Date: Sat Jan 12 00:09:34 2008 -0500 Nuke a duplicate SYMFUNC(xf86CVTMode) commit ca5625b911e65fdfd410247b3eff57fedcfc1f79 Author: Adam Jackson <ajax@redhat.com> Date: Sat Jan 12 00:08:00 2008 -0500 Add xf86GTFMode(). This should probably be shared like xf86CVTMode(). commit 4cb4817c1072e1d31333db47d95f71d08bf0d1dc Author: Adam Jackson <ajax@redhat.com> Date: Fri Jan 11 23:38:48 2008 -0500 Remove the duplicate copy of xf86cvt.c commit e65e51a99b17a0510782775f010e9820ca567fcb Author: Adam Jackson <ajax@redhat.com> Date: Fri Jan 11 23:19:20 2008 -0500 Constify the built-in mode tables. commit 6828d8fc2b464e0755f46e3fbdeb07be0c38b620 Author: Adam Jackson <ajax@redhat.com> Date: Fri Jan 11 22:57:42 2008 -0500 Clean up DisplayModeRec handling in many places. Use xf86DuplicateMode() instead of rolling our own, and change malloc+memset to calloc. commit 85617b56e5e00e7b8c7d8ce5b49af289056921a7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Jan 11 22:55:37 2008 -0500 Remove some #if 0 guarding code duplicated in xf86Modes.c commit fd41f46ac62033a724bd1f4612f19448a21c1224 Author: Adam Jackson <ajax@redhat.com> Date: Fri Jan 11 22:38:21 2008 -0500 Allow xf86DuplicateMode() to work correctly on read-only modes. Before this it was meaningless to try to mark DisplayModeRec tables const, since the mode name would be emitted as a pointer to an anonymous string constant, and therefore would have to be fixed up by ld.so and so couldn't live in .rodata. With this change the standard mode lists can live in .rodata, and modes duplicated from them will have their names filled in on the fly. commit 8ac19d16a030ec416e30d3650cf43e024ada167f Author: Adam Jackson <ajax@redhat.com> Date: Fri Jan 11 21:58:21 2008 -0500 Add several comments documenting our EDID failures. commit 13bfa5937d43392f686b76a99ea6331e3dce5987 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Feb 29 15:10:36 2008 -0500 GLX: Adjust to changes in DRI driver interface. commit d04ea267a4a51c16088d9ef429681a1edde536b1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 28 21:53:16 2008 -0500 xselinux: Don't require device "read" permission for XQueryPointer. These keyboard and pointer state polling calls are a real problem. commit 3fb17a3e647e926688c91a49a9b5b97f37dbc367 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 28 21:52:57 2008 -0500 xselinux: Log messages to both libaudit and Xorg.0.log. commit 4d91b1d5e422c5c460b1b7050baa9487a59b8aa8 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 28 21:52:32 2008 -0500 XACE: Adjust the location of the COMPOSITE creation hook. Avoids incrementing the refcnt if the hook fails. commit 5675ae1f72145e9b719c613023da525731b42461 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 28 18:12:52 2008 -0500 XACE: Call the creation hook to properly label COMPOSITE window pixmaps. commit 27bcf40cda1d7c52b189cc76528f1f51cbe1d5eb Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 28 16:43:43 2008 -0500 XACE: Fix instances of DixUnknownAccess at hook callsites. commit 453661a9e193a511cf5e54e6d330454163817316 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Feb 27 20:43:50 2008 +1030 Xi: swap the control attached to a ChangeDeviceControl request. Bug #14170 Just swapping the request's data isn't enough, we need to swap the actual control as well. X.Org Bug 14170 <http://bugs.freedesktop.org/show_bug.cgi?id=14170> commit aebd9dc252449747416b23c740a550d914275399 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Thu Feb 28 01:22:31 2008 -0300 Oops, there's one more parenthesis. commit f616735f17a681e3add866bf199540327c322490 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 27 22:46:14 2008 -0500 xselinux: Prefix a few remaining error messages with "SELinux". commit e40cc5305bec656108077ab13fcc8e6e82b3707a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 27 22:29:15 2008 -0500 xselinux: Don't throw BadAccess if DixUnknownAccess is passed in to a hook. The avc will still appear, however, so that the callsite can be fixed. commit 3b1df47bd400be9dca34b5e5d1ac2b117f8cc4ed Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 27 22:28:54 2008 -0500 XACE: Require "manage" permission for XKBSetNames. commit 08afc70513e5496cc5cd8b76c8658c4292119e4b Author: Dave Airlie <airlied@redhat.com> Date: Thu Feb 28 10:45:41 2008 +1000 quirks: another LPL panel with the cm/mm wrong commit f6d51797a523ecc2d4a8f18b2681160fcd5d1d55 Author: Maarten Maathuis <madman2003@gmail.com> Date: Wed Feb 27 23:44:39 2008 +0100 EXA: Let the driver decide what repeat/extend types are supported. commit 41aea6194bd29ab34cc166b3fd90eee64299ddf8 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed Feb 27 17:06:27 2008 +0000 More checking for failed contexts/drawables commit 43e46a654fa7cf69f0c8bcb7f583008d96a98686 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Wed Feb 27 16:58:21 2008 +0000 Fix context sharing between direct/indirect contexts commit d74b0327e8355546e6b41e8ce684f461d65fa9dc Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Feb 27 09:48:10 2008 +0100 [Xephyr/GL] unbreak the build Don't touch Xephyr DRI stuff when not compiling in a DRI environment. commit 2257e20900460d85254734b595238e7ad5ee55c8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Feb 27 17:15:28 2008 +1030 dix: set dev->key to NULL after freeing it in CloseDevice. (Bug #12830) Otherwise XkbRemoveResourceClient may try to dereference it lateron. X.Org Bug 12830 <http://bugs.freedesktop.org/show_bug.cgi?id=12830> commit 3f0681fb0b2d0744c2ef892883ae5359b43a4a9a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 26 23:14:29 2008 -0500 xselinux: Stub out selection protocol requests. commit 4632ea22580c31d44b0786321668d9e78f02900e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 26 22:00:52 2008 -0500 xselinux: Rip out the selection code in advance of polyinstantiation support. This resolves an issue where BadWindow errors were being thrown. commit c8e979b3b800e4c58be454daa0213285d4ee6510 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 26 21:34:22 2008 -0500 security: Register resource names in the server-side name registry. commit d12b7b6632fb4cf41d2e28c7792eaa503f25404a Author: Dave Airlie <airlied@redhat.com> Date: Wed Feb 27 07:08:00 2008 +1000 xf86Crtc: add higher level modesetting entry point. For kernel modesetting work we need a bigger stick to beat the modesetting path commit dcc077c753137f37aa58231f1df3c4adb92b2c4b Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Feb 26 12:13:06 2008 +0100 AIGLX: Switch to server context for calling DamageDamageRegion(). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=14518 . commit 23ae68a4c74a2ec90b4130c37b0d0aec3f4082ce Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 26 15:12:36 2008 +1030 dix: before copying the classes the first time, set the VCK's classes to NULL. XkbFinishDeviceInit does the following: xkbi->kbdProc= pXDev->kbdfeed->CtrlProc; pXDev->kbdfeed->CtrlProc= XkbDDXKeybdCtrlProc; If we directly copy the device classes for the VCK, pXDev->kbdfeed->CtrlProc at the time of copying is still XbkDDXKeybdCtrlProc. So at some point XkbDDXKeybdCtrlProc is called, and calls itself, and calls itself, and... Setting the device's classes to NULL seems to fix things. The memory isn't lost, it gets stored into the devPrivates and freed at device closing time. commit ce9fb2f8c4610016e49321018fc9b24729380afc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 26 13:19:54 2008 +1030 Xi: MDs return the paired device's ID in attached field of ListInputDevices. commit c46f7b62d2bf9f35937cfef98325ed904895396a Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Mon Feb 25 18:14:08 2008 -0300 Fine, we don't need pciInit() anymore. Nuke, nuke, nuke... commit a9050d54249ed9f54c6fe59143b846c9c7548f59 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Mon Feb 25 18:10:18 2008 -0300 Jesus, pciInit() was called 32 times in my machine without need! xf86scanpci() will always call pciInit() before any other function, so there's no need to guarantee it after. commit 81272f7ec9a3465e1d102c2ce627a45f92268857 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Mon Feb 25 17:39:33 2008 -0300 Some doc clean up: clean up legacy things in os-support/bus/Pci.c. Put InitOutput() comment to its right place. commit 7c582dd6de27d2f4fedf73319d2dea2bfb240efa Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Mon Feb 25 17:31:37 2008 -0300 remove lnxPciInit() unused function. commit 9727db88d57089be6483104de435626cdbad883a Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Mon Feb 25 17:08:07 2008 -0300 No more "-scanpci" given that we already have it in libpciaccess. (Yeah, lets nuke dead code!) commit f19f7b8e53ed6609fc1fdd272de5521417946209 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Mon Feb 25 17:07:07 2008 -0300 Clean some garbage caused when pciaccess was merged: FindPCIVideoInfo() function isn't need anymore. xf86scanpci() is being called only once so we don't need permanent (static) variables there. restorePciState() is not used for now (until we find why multiple cards aren't working). commit d61f481a4455dd2a94674d2b7b26429cf9dcece3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Feb 25 17:52:45 2008 +1030 Xi: remove GetPairedPointer handling. obsolete, ListInputDevices provides this information now. commit 27b21278939a06ab6a22c9902f202eae6c5fae72 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Feb 25 17:00:42 2008 +1030 Xi: remove ungrab handling of ExtendedUngrabDevice request. This can be done by UngrabDevice, no need for separate codepaths. commit 4b50e71bf127c8e0f289e3b76c786f0398effe65 Author: Adam Jackson <ajax@redhat.com> Date: Sun Feb 24 20:25:13 2008 -0500 Bug #13736: Fix %bx in VBEGetPixelClock to match spec. Reported by Yannick Henault. commit 6dc369028d3ca741de57ad78febf2f5f82e0696e Author: Jeremy Huddleston <jeremy@tifa.local> Date: Sat Feb 23 00:01:02 2008 -0800 XQuartz: Quit now properly warns the user (cherry picked from commit ed3d7b3959c2a0cb63e37210455bcc6cf195b807) commit e6a4cde16dc99ea02ac93da1d1b9517b1073d159 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 22 18:36:29 2008 -0500 Use the client-side XKB headers for the config utilities commit 347db49ebe4596db16455ea8a1a608cfa826c5c7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 22 16:05:33 2008 -0500 s/via/openchrome/ in the autoconfig logic. Xorg's via driver is effectively dead anyway. commit 69f782676797744815ff76b8a11b11178066f501 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 22 16:04:35 2008 -0500 Match Xephyr DRI definitions to the ones in xf86dri.h commit 060a66b6e2feddba43ed207b6fcf2cf1f7fe39fd Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 24 15:55:58 2007 -0500 Normalize swapped dispatch for Fixes{ChangeSaveSet,SelectSelectionInput} commit 24bebdded44a9e184455b4fee7800257fee81efb Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 24 15:07:49 2007 -0500 fbFillRegionTiled() is now dead code. Only ever called from the old PaintWindow* screen hooks, but those are gone now. As a pleasant side effect, fb loses its #ifdef PANORAMIX. commit ee21aba6be0078949204e315ddfffd99de60c2f1 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 24 13:13:19 2007 -0500 Fix Xinerama's consolidated visual handling. Formerly the code claimed it could only handle up to 256 visuals, which was true. Also true, but not explicitly stated, was that it could only handle visuals with VID < 256. If you have enough screens, and subsystems that add lots of visuals, you can easily run off the end. (Made worse because we allocate visual IDs from the same pool as XIDs.) If your app then chooses a visual > 256, then the Xinerama code would throw BadMatch on CreateColormap and your app wouldn't start. With this change, PanoramiXVisualTable is gone. Other subsystems that were using it as a translation table between each screen's visuals now use a PanoramiXTranslateVisual() helper. commit a4202b898f07dd733590ae5adb21e48775369781 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Feb 22 18:22:58 2008 +0100 XKB: Actually use the keymap we compile at startup During XkbInitKeyboardDevice, we compiled a keymap and promptly threw it away; brief inspection revealed the embarassingly simple problem. Sorry. commit c14fd2a5cb3f45d5c4502e09f55f5e3732c5e698 Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Feb 21 15:33:02 2008 +0100 [Xephyr/GL] properly route expose event on GL drawables When an expose event happens on an host GL window paired with an internal drawable, route that expose event to the clients listening to the expose event on the internal drawable. commit 437c78ef9ff1177e04b3d6781b5805d89b2ab81a Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Feb 21 15:29:27 2008 +0100 [Xephyr/GL] don't crash when the host returns a NULL server string commit f343265a289724c81017f089c024a7618267c4e3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 15 19:53:45 2008 -0500 XACE: Make the default window background state configurable per-window. To recap: the original XC-SECURITY extension disallowed background "None" if the window was untrusted. XACE 1.0 preserved this check as a hook function. XACE pre-2.0 removed the hook and first abolished background "None entirely, then restored it as a global on/off switch in response to Bug #13683. Now it's back to being per-window, via a flag instead of a hook function. commit 7c2f0a8befb310707ea923dbcdfde84521e52c88 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 15 19:17:40 2008 -0500 Remove COMPOSITE ifdefs around WindowRec bitfield as it has no ABI effect. commit 5cb9e15562a32c1f102d94d5e15d5fd298baff3f Author: Eric Anholt <eric@anholt.net> Date: Wed Feb 20 10:36:06 2008 -0800 EXA: Fix Render acceleration in copy and tiling cases. Code shuffling in a634c9b03494ba80aeec28be19662ac96657cc23 broke this by leaving pSrcPixmap = NULL. commit f14a62f823e257f92745bbcde11838f2ddd32ac8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 19 21:44:10 2008 +1030 dix: set evlen to the size of the reallocated memory. What a good idea this is... I'm very proud of myself. commit 67a78e84a81571cedaf7fd214a21ce1bbdc4fb3b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 19 21:31:50 2008 +1030 Revert "xfree86: plug a memory leak in xf86LoadModules." This reverts commit 3abce3ea2b1f43bd111664d4a57e5ccd282acab0 and 6cbaf15e6109ba77819c4070f5b46c78237ec460. The memory returned to xf86LoadModule was allocated in doLoadModule, which calls the respective module's PreInit. As it turns out, input and output drivers store a pointer to the module elswhere, so freeing it in xf86LoadModule is a bad idea. For further reference: hw/xfree86/common/xf86Helper.c Input drivers: xf86InputDriverList[blah]->module = module; Output drivers: xf86DriverList[blah]->module = module; Unloading the module would not look pretty then. commit 5f5ec5db35e82ddd9659763875e5d6c63cf1b691 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Tue Feb 19 00:00:11 2008 -0800 XQuartz: unsetenv("DISPLAY") before startx if X11.app can't connect to it. Also fix casting to silence warning. (cherry picked from commit a5cbf78471ec6e6ad672dc00118fc7edbd6ddc7c) commit 750d70267679ddee10590c80ec621d890bd3d4a7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Feb 3 10:25:15 2008 +1030 dix: Ensure enough memory for ClassesChangedEvent for a new device. Before we enable the device through the driver, we size it up and make sure that the events in the event list contain enough bytes for a possible ClassesChangedEvent lateron. commit 74628d639719815c1beff4cac84662fa41c55925 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Feb 3 10:15:40 2008 +1030 dix: change GetEventList to return length of list and set parameter in place. Changing DDXs to use new prototype too. commit 77dba004a9aaf35f183f61ff6875a491a52aa030 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Feb 3 10:10:46 2008 +1030 dix: add InputEventListLen and SetMinimumEventSize The latter is used to increase the amount of allocated memory for the event list. This will be needed for ClassesChangedEvents that can be of more or less arbitrary size (larger than 32 anyway). commit 6cbaf15e6109ba77819c4070f5b46c78237ec460 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 19 12:02:22 2008 +1030 xfree86: guard against NULL-pointer dereferences in xf86LoadModules. Should have been part of 3abce3ea2b1f43bd111664d4a57e5ccd282acab0, but I forgot to git-update-index before I committed. Thanks to Bill Crawford for pointing it out. commit 3fe64d8d271aea0863bf01b0376f3eceec0c90b5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Feb 3 09:56:19 2008 +1030 Move input event list initialisation and storage from DDX to DIX. Rather than letting the DDX allocate the events, allocate them once in the DIX and just pass it around when needed. DDX should call GetEventList() to obtain this list and then pass it into Get{Pointer|Keyboard}Events. commit 09a8fc5c7a79ca22fc23224bb544f2e709681f3f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Feb 3 07:47:18 2008 +1030 Xi: make SizeDeviceInfo public and re-use from CreateClassesChangedEvent. commit 3abce3ea2b1f43bd111664d4a57e5ccd282acab0 Author: Arjan van de Ven <arjan@infradead.org> Date: Mon Feb 18 18:13:10 2008 +1030 xfree86: plug a memory leak in xf86LoadModules. LoadModule() returns the only reference to a fresh piece of memory (a ModuleDescPtr). Sadly, xf86LoadModules dropped the return value on the floor leaking memory for each module it loaded. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 6dc71f6b2c7ff49adb504426b4cd206e4745e1e3 Author: Arjan van de Ven <arjan@infradead.org> Date: Mon Feb 18 17:52:37 2008 +1030 xfree86: plug memory leak in InitPathList. All the failure paths were very diligent in freeing the "fullpath" temporary string, but the success case was not. All the content only got strdup()d, so it's not live memory anymore. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 1bec6ad8977cefa49cc297a310f5eb0b7cd0b8bc Author: Arjan van de Ven <arjan@infradead.org> Date: Mon Feb 18 17:46:04 2008 +1030 xfree86: plug memory leak in xf86LogInit() xf86LogInit allocates a piece of memory, stores it in lf. LogInit() will then effectively strdup it, but lf is never freed again. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 6d9d18bf7708eb9e640ef732b5dc4c99aa6d5feb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Feb 18 17:25:15 2008 +1030 dix: add support for WindowAccessAllowAll in device access checking. AllowAll is the last check before the parent window is checked. This allows to override a DenyAll in the parent window in a simpler way than before (the previous method required all devices to be in the permit list). commit 088067c891a78670d9509f48f56bf3ff9c16a30d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Feb 18 16:46:07 2008 +1030 Xi: even if ChangeDeviceHierarchy fails, we may need to send an event. Changes are committed instantly, so if at least one change was successful, we must send an event to the client, even if subsequent ones fail. commit 660739c6bc84cb74f43a277052ce163fae654417 Author: Benjamin Close <Benjamin.Close@clearchain.com> Date: Fri Feb 15 13:36:34 2008 +1030 dix: Handle the case where a device cursor was removed correctly In the case that the device cursor was the first in the list of cursors the window knew about, unsetting the cursor could lead to a segfault due to pPrev being NULL. Instead catch the condition and correctly remove the node from the list. Since there is no cursor now set on the device, we simply return success as the parent windows cursor will propogate down later. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> commit 24db28230120ecc2b65b25164b6e7b407970f9e2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Feb 18 16:16:19 2008 +1030 dix: set num_events to 1 by default. (no RawDeviceEvents anymore) This should have been part of acb412d5399f865b5048fdd683147cea0f19f0c1. commit 45d00433e7bfbab476dd02ec92a9fbee40af5dad Author: Dan Nicholson <dbn.lists@gmail.com> Date: Tue Jan 15 19:43:16 2008 -0800 glx: Use glapi sources from the mesa tree With recent mesa HEAD, the glapi sources used only in the xserver glx module are carried in the mesa tree. Previously, these were generated separately and committed to the xserver tree. The build is changed to symlink these files like the other mesa sources. This reduces the chance for mismatches between mesa's glX API and the xserver's glX API. commit fbd776894658e7afb2c55dc8582b2a3efab78a3c Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Feb 16 20:01:18 2008 +0200 XKB: Ditch XkbFileInfo Sorry about the megacommit, but this touches on a lot of stuff. Get rid of XkbFileInfo, which was pretty seriously redundant, and move the only useful thing it had (defined) into XkbDescRec. defined will be removed pretty soon anyway. Is the compat map pointer non-NULL? Then you have a compat map, congratulations! Anyhow, I digress. All functions that took an XkbFileInfoPtr now take an XkbDescPtr, _except_ XkmReadFile, which returns an XkbDescPtr *, because people want to deal in XkbDescPtrs, not XkbDescRecs. commit e5f002eddef1abe324033a3155f01d048536a48d Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Feb 16 20:00:47 2008 +0200 XkbProcessOtherEvent: Don't depend on now-removed header We don't do XKBsrv.h anymore. commit 2d256f098ae05033ad76672d5ebdb9dfa7e6b995 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Feb 16 19:57:37 2008 +0200 XKB: Always set size correctly in XkbCopyKeymap's geometry routines We were forgetting to set the sizes for sections and rows and a couple of other misc bits in XkbCopyKeymap's geometry. Sort that out, and add a couple of clarifying comments along the way. commit ab79110a84b2d299ecae0605fa535edbebd99565 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Feb 3 23:48:57 2008 +1100 XKB: Remove support for pre-built keymaps Don't load prebuilt keymaps anymore. commit 1332343910a1880854bae21a790cff198855cd24 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Feb 3 23:43:18 2008 +1100 XKB: Remove usage of client-side types Since we're no longer sharing with Xlib, don't pass Displays and XPointers everywhere. commit 534fc5140b039a8c98ab715d0a6740d513b41209 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Feb 3 23:30:22 2008 +1100 XKB: Remove a bunch of mad ifdefs We have SEEK_SET and size_t, seriously. Also use DebugF instead of ifdef DEBUG, and ditch a couple of random bits that were never used. commit 0f12a448dcbbbf1f40aa98d09c9d25ee511c5bbf Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Feb 3 23:15:39 2008 +1100 XKB: Deprecate XKBSRV_NEED_FILE_FUNCS There's no point in having the function definitions be conditional, so whatever. commit 68bd7ac1930b5cffb6657b8d5f5bf8ae58eae8d9 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Feb 3 23:12:15 2008 +1100 XKB: Move headers into the server tree We need to start breaking the XKB API to enforce sanity, so drag whichever headers we need to do so into the server tree, as the client API is set in stone, being part of Xlib. commit 37867626e314e74031378a8a4ff06f69b899a3b2 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Feb 1 14:41:04 2008 +1100 main(): Remove uncredible failure NO, NO, NO. NO. The only way this could possibly be worse is if you were viewing it in Comic Sans. commit e4eb7e5842f0f56f07e9cf3b16249c172d0a975d Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jan 30 23:24:14 2008 +1100 XKB: Delete xkberrs.c Get rid of the XKB errors code to save a bunch of space. commit a48cc88ea2674c28b69b8d738b168cbafcf4001f Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Feb 17 18:47:28 2008 +0100 Fix rotation for multi-monitor situation. - The (x,y)-coordinates of the crtc were not being passed as xFixed values, which made it an obscure bug to find. - Fix bug #13787. commit 70c0592a97c7dc9db0576d32b3bdbe4766520509 Author: Maarten Maathuis <madman2003@gmail.com> Date: Sun Feb 17 11:21:01 2008 +0100 Resize composite overlay window when the root window changes. - This allows some compositing managers to work, even after randr12 has changed the root window size. - Thanks to ajax for figuring out the best place to put this. - Example: - xf86RandR12SetMode() calls EnableDisableFBAccess(). - That calls xf86SetRootClip() which in turn calls ResizeChildrenWinSize(). - The final step is the call to PositionWindow(). commit b95059c20746a71e60ef152bb627e1d5c2210d75 Author: Jeremy Huddleston <jeremy@tifa-2.local> Date: Sat Feb 16 01:33:13 2008 -0800 Added Xquartz.plist to EXTRA_DIST (cherry picked from commit 70f9495e0c1f1459507064b673fe57b1c90d3c2c) commit d103820bb8635c63b34b85b45cad95ed9c152d90 Author: Jeremy Huddleston <jeremy@tifa-2.local> Date: Sat Feb 16 00:35:50 2008 -0800 Fixed unescaped newline in EXTRA_DIST (cherry picked from commit 567c172c4d400fdfe69e7b096a3877fce5c2de9f) commit a7d936c4ac8e3d7227ecbfe0ddc6cc257b450458 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Mon Feb 11 16:09:03 2008 -0800 XQuartz: Fixed EXTRA_DIST to include localization (cherry picked from commit 1b338c2a9330c85490a7c24d52adf24b124b70e6) commit 0ffb6a3ad010e80fe8f973fc228d549f9dd3effd Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Feb 14 22:20:56 2008 -0500 GLX: Implement support for TTM BO based TFP when available. commit 879515b1399f87a47010532af70f34b9b09e2a9b Author: Kristian Høgsberg <krh@sasori.boston.redhat.com> Date: Mon Feb 4 13:13:35 2008 -0500 Add GLX provider for DRI2. commit b71dc54352bc56a889823040ec19c1d8e118a1f3 Author: Kristian Høgsberg <krh@sasori.boston.redhat.com> Date: Mon Feb 4 11:58:24 2008 -0500 Add DRI2 module. commit 005e31d3de04e7003f84a94d30f2b75a9636266e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Feb 15 00:01:32 2008 +0000 AIGLX: Refactor code common between __glXDRI{drawableDestroy,releaseTexImage}. commit cd78f0d0fc08e4e2339ed09dad1a12802de7729c Author: Pierre Willenbrock <pierre@pirsoft.de> Date: Thu Feb 7 21:28:28 2008 +0100 AIGLX: Fix crash after client using GLX_EXT_texture_from_pixmap died. commit 3e0353c78571890f849a1db47b0540aacc6793bc Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 15 06:42:48 2008 +1100 Bah, macros are hard. commit c38feeb1492d9a47379b2e4d77dbadd8c421d17f Author: Maarten Maathuis <madman2003@gmail.com> Date: Thu Feb 14 18:52:47 2008 +0100 Fix typo in commit b8b7cdf6df3d338c50db670ce4cfd245f9fa8844. commit b8b7cdf6df3d338c50db670ce4cfd245f9fa8844 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 15 01:31:46 2008 +1100 Silence useless debug spew from XFree86-Misc extension. commit 4573cb2ce4b859744118d9a33de3599f033cdd2b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 13 20:16:56 2008 -0500 security: Revise set of permissions granted to untrusted clients. Bug #14480: untrusted access broken on 7.3. commit e99aadbc2635e87543fc9980d8156c3ede83544f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 13 19:46:29 2008 -0500 xselinux: Add use to permission map for devices. commit ae43d835bdaef96c3c73d7cee5b105f07340833d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Feb 13 19:39:49 2008 -0500 XACE: Change access modes for some device-related requests. Opening a device is not really "reading" it. Requests that globally configure a device should require "manage" access. commit 921c298c4cdd2c879403ebdacbef48129058cad4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 14 09:48:19 2008 +1030 Xi: QueryDevicePointer doesn't have a shared field anymore. commit b885588756450e2fa25fdd191e300e1c5dd37ec3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 14 09:47:31 2008 +1030 Xi: remove FakeDeviceData calls. And one leftover from GrabAccessControl. FakeDeviceData needs more thoughtful integration. commit c99a9a97290c51bf2843f42d5683888cea8a3ff6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 14 09:43:49 2008 +1030 Xi: remove raw device events. Need to be better refined. commit b35a9efa16d9e14378a95c11fa39171b78710996 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 14 09:41:49 2008 +1030 Xi: Remove files for GrabAccessControl. commit b81c330f70c4a4c8f37216aa4856c7f8db93a375 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 14 09:32:54 2008 +1030 mi: remove RawDeviceEvent's ID changing. commit acb412d5399f865b5048fdd683147cea0f19f0c1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 14 09:27:51 2008 +1030 dix: Don't generate RawDeviceEvents anymore. These events have been removed from the protocol pending some more refinement and more thoughtful integration. commit ba69904148acf755bec8fbda2eb869144f0ef7d4 Author: Adam Jackson <ajax@redhat.com> Date: Sun Feb 3 22:49:23 2008 +1100 Simplify dlloader a bit more. commit f750ce53ac450824d0c792d11eafdf311cf8abc0 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 17:33:48 2008 +1100 Remove some braindamage from ModuleDesc. Yay dead code elimination. commit e91ff09568c5579818b6641e88e95c6fe122cbe7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 17:21:34 2008 +1100 Friends don't let friends call xf86AddModuleInfo. That code only existed to leak memory. It can go now, thanks. commit 0bdd20a0454c94f902fd4874855125bf7510fcf5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 16:15:58 2008 +1100 Eradicate the VTInit code. "This option should rarely be used." Never sounds like a better idea. commit 24089b06243101b1bff4f2fd79fcbfd6a93992d5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 16:11:13 2008 +1100 Don't bother warning people about the keyboard driver rename, just do it. commit 2aaf6ac134fa9f61984b1c03929c7b596c971cc8 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 16:10:23 2008 +1100 Don't even attempt to parse -bpp in xfree86 DDX option parsing. This hasn't been valid since 1999. Get with the times, man. commit ef77e4c4419703b5a802f3eee92476a43f788a86 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 16:03:01 2008 +1100 Remove useless commentary from environment and argument processing. commit f3b3b37ec6197f8884417fbc26630d3a28f2e319 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 15:36:11 2008 +1100 Use strerror instead of errno values in user strings. commit b740b865e4c156a40adc6b63fcf215156fc9151a Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 15:16:01 2008 +1100 Silence an error message in ConfigureWindow that never happens. commit 89d3249c3e7611b22414bc84b10ca60aab4b9a77 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 15:11:27 2008 +1100 Silence FreeResource() commit 238b816469355159eea98600ca900e3baa8fa313 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 15:08:03 2008 +1100 X.Org Group -> X.Org Foundation commit 9113fa3de36e84bbae2727cace82b1cf0d709a86 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 15:03:57 2008 +1100 Silence the harmless FreeFontPath error message. commit 7c0709a736c0f3aa011de67dd2c2962585ab146e Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 14:59:58 2008 +1100 requestingClient is an xprintism, hide it for other servers. commit 62cfe8863823c0994f20555cb35ee3bacb9e5225 Author: Adam Jackson <ajax@redhat.com> Date: Fri Feb 1 14:57:25 2008 +1100 Redact all mention of PanoramiX from user strings. commit eb8dc11d19dd0b5354de408578ab0cfb865df672 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 31 21:45:14 2008 +1100 Remove some MAX* #defines that never get used. commit 2ce35f6d45c3e1761d33b786520ff5ba56a3c518 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 31 21:39:48 2008 +1100 Simplify critical output flushing. commit 3eaecdd66e791e0f3d86b23ce10be057ca44c044 Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 31 21:36:14 2008 +1100 Disable Record by default. commit aa5216e89797b600f382c04e3eaa657e808a5c3e Author: Adam Jackson <ajax@redhat.com> Date: Thu Jan 31 12:05:08 2008 +1100 Rip out useless indirection in the callback list management. commit 0d492b2166c4026b9078ffd86d89a31ebe590be4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 12 19:59:10 2008 -0500 XACE: Move the selection access hook to its own function. commit 4be69e41c07b784f75918141eead70415c0ec4a4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Feb 11 16:03:25 2008 -0500 Revert "Bug #8937: Extension setup functions not called on server resets" This reverts commit 5e946dd853a4ebc2722ae023429ce5797de3d7a6. The devPrivates rework makes this workaround unnecessary. commit 8a244c2bc04a4184535e42d1f2f8c9e3e55678b4 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Mon Feb 11 12:09:41 2008 -0800 XQuartz: Fixed layout of Applications->Customize menu Now resizing it won't produce weir overlaps of the widgets. Thanks to Pelle Johansson for his help showing me how to do this. (cherry picked from commit ef3498e92d13c82633fdbe8120396bfbe1e7489a) commit 3570ca1cb76f084272f7d8bd22c4cfdf03201a77 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Sun Feb 10 18:27:52 2008 -0800 XQuartz: Added option for setting quartz-wm click-through preference (cherry picked from commit bf54c267cba97b2b3b9a621da0575776a388b2cb) commit 8004e160fa8cc75a3f1b7385fee64e5864b3b50a Author: Jeremy Huddleston <jeremy@tifa.local> Date: Sun Feb 10 16:34:40 2008 -0800 XQuartz: Converted interface to nib 3.x format (cherry picked from commit 656aaab95773bd70fc3504b68bf7e1d292891d93) commit 0b0a09797302ac2171db5df20fc5110aafc8efbb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 7 15:48:04 2008 +1030 xkb: when copying the keymap, make sure the structs default to 0/NULL. It actually does help if a pointer is NULL rather than pointing to nirvana when you're trying to free it lateron. Who would have thought? (cherry picked from commit 7a97ca667405a42d008265c3a870210cc1da97dd) commit 7018f280406eb0ef899a4046de274cfdd582881b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 7 15:48:04 2008 +1030 xkb: when copying the keymap, make sure the structs default to 0/NULL. It actually does help if a pointer is NULL rather than pointing to nirvana when you're trying to free it lateron. Who would have thought? commit 66f8001b61d12eaf4905ac71ccbb3f304914d00d Author: Bart Trojanowski <bart@symbio-technologies.com> Date: Thu Feb 7 21:26:54 2008 -0500 X86EMU: handle CPUID instruction After trying to switch from X to VT (or just quit) the video-amd driver attempts to issue INT 10/0 to go to mode 3 (VGA). The emulator, running the BIOS code, would then spit out: c000:0282: A2 ILLEGAL EXTENDED X86 OPCODE! The opcode was 0F A2, or CPUID; it was not implemented in the emulator. This simple patch, against 1.3.0.0, handles the CPUID instruction in one of two ways: 1) if ran on __i386__ or __x86_64__ then it calls the CPUID instruction directly. 2) if ran elsewhere it returns a canned 486dx4 set of values for function 1. This fix allows the video-amd driver to switch back to console mode, with the GSW BIOS. Thanks to Symbio Technologies for funding my work, and ThinCan for providing hardware :) Signed-off-by: Bart Trojanowski <bart@jukie.net> Acked-by: Eric Anholt <eric@anholt.net> commit de16a8c53046764dbdf26a87acc5c984ef00d818 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 7 20:14:16 2008 -0500 XACE: Correct some protocol error values in the colormap routines. commit 31934132a490b1b8ae73010c44e0b23217d8dab2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 7 16:32:06 2008 -0500 xselinux: Use the device name in debugging output. commit 6dcb7d732bfeadc214228d68c5a13eef30248eb1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 7 16:00:52 2008 -0500 xselinux: Split devPrivate state into subject and object records. commit 2259b144f0fd4855085a656111a0c64246733e78 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 7 14:35:02 2008 -0500 xselinux: Add getattr and setattr to the permission map for properties. commit 9d5edebe9664f4ac35b82830e000a72d5ca9cbe4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 7 21:22:50 2008 +1030 Xi: finish XKB initialisation before copying the keymap. commit 96eafa3d4f05997dac8be6a8d66a92410511824c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 5 16:01:56 2008 +1030 xkb: when copying sections, make sure num_rows is set too. (cherry picked from commit 41991fb991313202e8e6b513fe928ba14f8fcb87) commit 5c30327275509576b7848a5f842e7a1bffabe980 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 5 21:06:05 2008 -0500 XACE: Push the dix "structure" includes down to the security modules. commit bb1a577a6822f781f1e38d2434a13914e74f89aa Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 5 20:07:08 2008 -0500 XACE: Move the property access hook to its own function. commit 019ad5acd20e34dc2aa3b89cc426138db5164c48 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 5 15:44:41 2008 -0500 XFixes: squash a pointer/integer size mismatch warning. commit d3c36fe721edc55636438bc3e0e7a6c03f62784e Author: liuhong <liuhong@devlinux-hong.sh.intel.com> Date: Tue Feb 5 10:54:58 2008 +0800 validate mode clock for probed modes Some modes claimed in monitor EDID data may not be supported by the monitor. So also validating the max clock for probed modes. commit 4b5b6e7baab58072a983d2ec136965f404c3a74a Author: liuhong <liuhong@devlinux-hong.sh.intel.com> Date: Tue Feb 5 10:54:10 2008 +0800 fix max clock unit max clock from EDID data is in MHz, while we need KHz to validate modes. commit a56ef7aaa4b6ac13c8181f68fc7dad3ca89e6973 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Sat Feb 2 23:04:46 2008 +0100 dix: Move motion history update until after screen crossing and clipping Cross screen and clip the coordinates before updating the motion history so that it will have the same contents as the events that are reported. commit a0284d577aabea8406b72dd63773e341430ebe56 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Sat Feb 2 23:03:51 2008 +0100 dix: Skip call to clipAxis for relative core-events Relative events that generates both core and extention events will have its axis cliped and screen changed by miPointerSetPosition when the events are processed. For absolute and non core-generating relative events the axis must be clipped if we shouldn't end up completely outside the defined ranges (if any). commit d9e23c4ff1607a62164b34717ef9afd352ce2b94 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Sat Feb 2 22:57:32 2008 +0100 Bug # 10324: dix: Add scaling of X and Y on the reported pointer-events Restore the rescaling code for x and y axis when generating motion events. commit f04c0838699f1a733735838e74cfbb1677b15dc4 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Sat Feb 2 22:45:31 2008 +0100 Bug # 10324: dix: Allow arbitrary value ranges in GetPointerEvents Don't use a possitive value as a marker for if a max-value is defined on the valuators. Use the existence of a valid value range instead. This will also make it possible to define arbitrary start and end-values for min and max as long as min < max. commit 12e532403210c15a25200ef448bfe9701735ab20 Author: Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> Date: Sat Feb 2 22:44:31 2008 +0100 dix: Always add valuator information if present Send valuator information for all event types, not only for MotionEvents and absolute button events. commit 41991fb991313202e8e6b513fe928ba14f8fcb87 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 5 16:01:56 2008 +1030 xkb: when copying sections, make sure num_rows is set too. commit 521a7f26e088029707fb9a2bb80c9ddc734a3f8b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Feb 5 18:34:31 2008 +1030 mi: Only UpdateSpriteForScreen if we actually changed the screen. (Bug #12650) X.Org Bug 12650 <http://bugs.freedesktop.org/show_bug.cgi?id=12650> commit 10617dc0fb7166ccd5b2e92fa708390c2d7d0d27 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Feb 1 14:24:04 2008 +1030 xfree86: stick two more checks in for num_valuators < MAX_VALUATORS commit c68f063be639f39c2facbb496e8455e8e3771b41 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Fri Feb 1 14:13:29 2008 +1030 xfree86: don't call xalloc from signal handlers when posting events. Reviewed-by: Peter Hutterer <peter@cs.unisa.edu.au> commit e5e531ce96264518f278f572a4d0bfcd345aa618 Merge: 6c38682 1692dcf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 31 16:36:17 2008 +1030 Merge branch 'master' into mpx Conflicts: dix/events.c commit 6c38682084e24b18bac0ea75729b1183aeb01600 Author: Benjamin Tissoires <tissoire@cena.fr> Date: Thu Jan 31 15:51:32 2008 +1030 kdrive: AddInputClient takes a ClientPtr. commit 1692dcf197470d074f69d5af1608cb2ff1d08872 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 30 13:04:58 2008 +1030 dix: print out event type if a bogus pointer event occurs. commit d954f9c80348de294602d931d387e5cd1ef4b9a5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 30 10:39:54 2008 +1030 xkb: don't update LEDs if they don't exist. (Bug #13961) In some weird cases we call this function when there is no SrvLedInfo on the device. And it turns out null-pointer dereferences are bad. X.Org Bug 13961 <http://bugs.freedesktop.org/show_bug.cgi?id=13961> commit df325be394e1f75c396b2768f81373f2989aef7c Author: Coleman Kane <cokane@cokane.org> Date: Tue Jan 29 09:47:00 2008 -0800 Bug 13101: xorg-server has a typo in hw/xfree86/os-support/bsd/i386_video.c X.Org Bug #13101 <https://bugs.freedesktop.org/show_bug.cgi?id=13101> Patch #12360 <https://bugs.freedesktop.org/attachment.cgi?id=12360> commit 94f412cb7e954fe872fed979057cbdfbef953c6f Author: Julien Goodwin <julien@studio442.com.au> Date: Sun Jan 27 12:30:16 2008 +1100 Loader: Fix verbosity confusion 'Loading foo' is verbosity 3, whereas 'already built-in' is verbosity 0. This means that gdm's log would just be full of bare 'module already built-in' messages. commit 442838fcb3bf07ac57553ae5600d9e6c59a559bb Author: Julien Goodwin <julien@studio442.com.au> Date: Sun Jan 27 12:27:26 2008 +1100 xorg.conf.man: Fix monitor/output confusion in monitor positioning On the Intel driver at least, LeftOf/RightOf/Above/Below in xorg.conf refers to output names, not monitor names. Fix nomenclature in xorg.conf.man. commit 5b8641a5fdc112c19e78ca2954878712e328d403 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jan 29 10:01:37 2008 +1030 xfree86: fix AlwaysCore handling. (Bug #14256) Assume AlwaysCore being set by default, just like the other options. X.Org Bug 14256 <http://bugs.freedesktop.org/show_bug.cgi?id=14256> commit 975ab11799c819a81da1dfe83505194410dbcb95 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Jan 26 09:39:54 2008 +1030 config: don't reset connection info on disconnect. If dbus is restarted, we try to connect again and this is difficult if the busname and/or busobject is not set. (cherry picked from commit 210eeef495770c1883c842ff003c28ce25f279d4) commit 7dde5a694a06efed0a9186f05d33f5be6f5dba71 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 25 13:54:47 2008 +1030 config: check connection != NULL before getting dbus' dispatch status. (cherry picked from commit d23266522390a4ef7203ae7c062b2b920e45f9d7) commit f0ba7707161b8866e6fde32d6f25be6afcdecb48 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 25 13:45:22 2008 +1030 config: only shutdown libhal if the connection is valid. Thanks to libdbus' extensive use of assert we won't just get an error, it'll bring the whole server down for us. (cherry picked from commit fb07fab2c07e7b0834724541dc47bfba02ba8574) commit 2cb0ebec2b85d96289c23c17cfdcdf97ef6877d2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 25 11:48:13 2008 +1030 config: add a debug message, fix a whitespace error. (cherry picked from commit 7732898aaa70e076000f6e6aa9420482896ed996) commit 4fc2d3cef8d7868b025aa14af7ed4b730e8f2c49 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Mon Jan 28 12:18:43 2008 -0800 Rootless: RootlessEnsureFrame: Added check for !IsRoot This was causing an issue with Apple-DRI and was reported here: http://trac.macosforge.org/projects/xquartz/ticket/51 (cherry picked from commit 116800279d2ec783c63f43d3902627edde6a4cff) commit 16b0614c8c441eb1692bde9e58fadf54a9c6f00f Merge: 1a88aed e915a26 Author: David Nusinow <dnusinow@debian.org> Date: Sat Jan 26 16:13:25 2008 -0500 Merge commit 'upstream/master' commit 0ac175597712edfeae676f536746a4d26d625e30 Merge: 210eeef e915a26 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Jan 26 13:55:07 2008 +1030 Merge branch 'master' into mpx Conflicts: Xext/sampleEVI.c commit e915a2639752bc0ea9e6e192e020cc2031c08063 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 25 19:22:19 2008 -0500 xselinux: Move the extension to extmod instead of being built-in. commit 210eeef495770c1883c842ff003c28ce25f279d4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Jan 26 09:39:54 2008 +1030 config: don't reset connection info on disconnect. If dbus is restarted, we try to connect again and this is difficult if the busname and/or busobject is not set. commit f6a78ee143e3a3ad69538adf2b9675d724468ffa Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 25 18:04:10 2008 -0500 XACE: Remove the extension code entirely, XACE is completely static now. commit 7724c30a751c653ca3e2e8a6752af27bc37de3f0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 25 17:28:17 2008 -0500 XACE: Stop using fake requestVectors in favor of a simple hook call. commit f82329b0811469ddae5c44dcfffa38185c11a67c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 25 16:20:46 2008 -0500 XACE: Don't need to actually register a protocol extension. commit d23266522390a4ef7203ae7c062b2b920e45f9d7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 25 13:54:47 2008 +1030 config: check connection != NULL before getting dbus' dispatch status. commit fb07fab2c07e7b0834724541dc47bfba02ba8574 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 25 13:45:22 2008 +1030 config: only shutdown libhal if the connection is valid. Thanks to libdbus' extensive use of assert we won't just get an error, it'll bring the whole server down for us. commit 7732898aaa70e076000f6e6aa9420482896ed996 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 25 11:48:13 2008 +1030 config: add a debug message, fix a whitespace error. commit 46794d0c9665f07913980830d038c88d00407612 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 24 19:49:13 2008 -0500 xselinux: Rename SelectionManager to more generic SecurityManager. commit 466f6552190d1b83d66ebfd71e07921ed6210ee2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 23 16:11:31 2008 +1030 Xi: if deviceid is > 127 assume GE mask is for all devices (XiSelectEvent). commit 379f057646588fa3211d7ba0ec8d77d2fc0ad246 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 23 16:08:37 2008 +1030 Xext: add GEDeviceMaskIsSet (GE mask checking per device) If a mask was set for the NULL device, then we pretend the mask is set for all devices. commit 91dc8c43d2343e494c59023484883f4683bdc639 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 23 15:45:02 2008 +1030 Xi: Change window access right check to RecieveAccess in XiSelectEvent. commit 94a6a65ae7414c8247aa1741ec5c7561e6f4bbe0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 23 15:43:48 2008 +1030 Xext: allow per-device GE masks. Instead of a single mask per client we allow the storage of a mask per client per device. commit 6ffeecabb7f3f3173864e0f0af21a99bdc5b5044 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 24 18:11:49 2008 -0500 xselinux: Use a privileged bit in the state instead of passing an index to the permission checking function. commit 7ba8e97cbabfef4d614a6a38314830ec0f925471 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 24 19:09:58 2008 -0500 xselinux: Implement "get context" protocol requests. commit f0bf9a5231d4f612ac916355118484d055715f32 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 24 19:02:35 2008 -0500 xselinux: Whitespace fixups. commit 734e115871ce98badb8800383c423493802ae3d3 Author: Hong Liu <hong.liu@intel.com> Date: Wed Jan 23 21:04:32 2008 +0800 Bug #12439: add a quirk to use +hsync +vsync for the probed detailed mode. Samsung 205BW quirk is somehow reworked. commit cc22b05ea06e08568d0f0abdaccf67bd32662e94 Author: Adam Jackson <ajax@redhat.com> Date: Tue Jan 22 18:57:11 2008 -0500 There is no such thing as /dev/cpu/mtrr. commit 1a88aed5c82c7c131e3d473ef7b8766a418fdf1b Author: David Nusinow <dnusinow@debian.org> Date: Mon Jan 21 21:16:13 2008 -0500 Add tags/TAGS to .gitignore for ctags usage commit be6c17fcf9efebc0bbcc3d9a25f8c5a2450c2161 Author: Matthias Hopf <mhopf@suse.de> Date: Mon Jan 21 16:13:21 2008 +0100 CVE-2007-6429: Always test for size+offset wrapping. commit ba315ae5ddd00763147a4b0cdcacba7691793dfc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jan 21 23:43:53 2008 +1030 Xi: add XACE hooks for device creation (ChangeDeviceHierarchy) AddInputDevice checks for permissions already, so all we do is modify a few callers to let AID sort it out. commit 94a21d757ce58254accbd5dd3a86810aadeec9f0 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Jan 19 13:17:45 2008 +0100 AIGLX: Fix GLX_EXT_texture_from_pixmap fallback with EXA. Use pScreen->GetImage to obtain the pixmap contents instead of dereferencing pPixmap->devPrivate.ptr directly. commit e9fa7c1c88a8130a48f772c92b186b8b777986b5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Jan 18 14:41:20 2008 -0500 CVE-2007-6429: Don't spuriously reject <8bpp shm pixmaps. Move size validation after depth validation, and only validate size if the bpp of the pixmap format is > 8. If bpp < 8 then we're already protected from overflow by the width and height checks. commit 6492d513c0022d70f838d1b2561442c7a41e401f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 18 21:44:22 2008 +1030 dix: if a client has a core grab, return the grab device on QueryPointer. The correct thing would be to return the ClientPointer. However, if the client for some reason has a core grab on another device (e.g. as result of a passive grab), return the coordinates of the grabbed device instead. This makes the use of nautilus a bit saner. commit cd2ad4c2ed58b49cee085174e77c242048159321 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 18 20:11:55 2008 +1030 dix: remove some superfluous lines in ProcChangeActivePointerGrab. commit 8a925d201efac52ef663ea3ff46acc5046178666 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 18 20:06:29 2008 +1030 dix: free the genericMasks when ungrabbing. This finally plugs a memory hole created by grabs registering for generic events. commit 8949d81a3c79eef351d7c018c76692dcca74b63e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 18 19:45:54 2008 +1030 include: mark CoreProcessPointerEvent, CoreProcessKeyboardEvent as deprecated. ProcessOtherEvent does all the work now. commit d323fd64206ddb4221daa7cf7504daf62c5e7d90 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 18 19:17:42 2008 +1030 dix: remove inputInfo.pointer refernce in EventSelectForWindow If the window being changed is set as the motion hint window for any device, the device's motion hint window is set to NULL. Which is kinda what the old code did, except that it did it with only the VCP. commit 883811c2bed9c6fcb706effbf83ddc97518b6f0c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 18 18:48:46 2008 +1030 dix: remove inputInfo.pointer reference in TryClientEvents. Unfortunately, this requires a change in the TCE API, and thus a change in all callers. Tough luck. commit 6e17184486c4309ec8b47c7cfd11fef60bb360ac Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 18 17:52:38 2008 +1030 Xi: Check for DestroyAccess when trying to delete a master device. commit 23f3f0e27dc90b7b3a375f2a5dd094e6f53552b5 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sun Jan 13 14:00:25 2008 -0800 XQuartz: Moved SetFrontProcess haco to set_front_process So it is done by the other thread... (cherry picked from commit 7429379eb1001ee3dc769daa8fe6b3aef1b9cc8a) commit 8e133d96740d010a4fd969a8188e6e71fb2cafe2 Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Thu Jan 17 15:29:06 2008 +0100 Fix for CVE-2008-0006 - PCF Font parser buffer overflow. commit 6de61f82728df22ea01f9659df6581b87f33f11d Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Thu Jan 17 15:28:42 2008 +0100 Fix for CVE-2007-6429 - MIT-SHM and EVI extensions integer overflows. commit 7dc1717ff0f96b99271a912b8948dfce5164d5ad Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Thu Jan 17 15:28:03 2008 +0100 Fix for CVE-2007-6428 - TOG-cup extension memory corruption. commit dd5e0f5cd5f3a87fee86d99c073ffa7cf89b0a27 Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Thu Jan 17 15:27:34 2008 +0100 Fix for CVE-2007-6427 - Xinput extension memory corruption. commit bbde5b62a137ba726a747b838d81e92d72c1b42b Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Thu Jan 17 15:26:41 2008 +0100 Fix for CVE-2007-5760 - XFree86 Misc extension out of bounds array index commit e85130c85f727466fc27be1cfa46c88b257499fb Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 5 10:47:39 2008 +0200 Xephyr: One-time keyboard leak fix Don't leak the originally-allocated keysym map. commit 0137b0394a248f694448a7d97c9a1a3efcf24e81 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 5 10:43:53 2008 +0200 XKB: XkbCopyKeymap: Don't leak all the sections Previously, we'd just keep num_sections at 0, which would break the geometry and lead us to leak sections. Don't do that. commit b99a43dfe97c1813e1c61f298b1c83c5d5ca88a2 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jan 5 10:38:16 2008 +0200 OS: IO: Zero out client buffers For alignment reasons, we can write out uninitialised bytes, so allocate the whole thing with xcalloc. commit a6a7fadbb03ee99312dfb15ac478ab3c414c1c0b Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jan 16 20:24:11 2008 -0500 Don't break grab and focus state for a window when redirecting it. Composite uses an unmap/map cycle to trigger backing pixmap allocation and cliprect recomputation when a window is redirected or unredirected. To avoid protocol visible side effects, map and unmap events are disabled temporarily. However, when a window is unmapped it is also removed from grabs and loses focus, but these state changes are not disabled. This change supresses the unmap side effects during the composite unmap/map cycle and fixes this bug: http://bugzilla.gnome.org/show_bug.cgi?id=488264 where compiz would cause gnome-screensaver to lose its grab when compiz unredirects the fullscreen lock window. commit e46f6ddeccd082b2d507a1e8b57ea30e6b0a2c83 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jan 16 14:24:22 2008 +0100 Yet another Xv extension byte swapping fix. commit b0bf4308acb706abc87c51658c2251fa86231c35 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jan 15 19:15:09 2008 +1030 dix: print out an error when core type can't be converted. Helps a bit in tracking down bugs. commit 2a988ed75b7634d7cb6e83bb7aa89bc8768d3a58 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jan 15 19:14:46 2008 +1030 xkb: don't do core key repeats, XI only is the path to light. commit 4fd0885978be286a68b689824f1d910f929a52b0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jan 15 18:58:42 2008 +1030 Xi: remove some leftovers from ProcessOtherEvents. Core handling not needed anymore here. commit 32aa252e988be8cbfd4f7e373fb7b7736ef1f5f2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jan 15 15:22:39 2008 +1030 dix: Process an input event as a single event, instead of two separate ones. This is a significant shift in how input events are perceived. The common approach was to treat a core event as a different entity than the XI event. This could result in the XI event being delivered to a different client than the core event. This doesn't work nicely if they come from the same device. Instead, we treat an input event as a single event, that is delivered through two separate APIs. So when delivering an event, we first try the XI event, then the core event. If the window want's neither, we go to the parent and repeat. Once either core or XI has been delivered, the processing stops. Important: Different to the previous method, if a client registers for core button events, the parent window will not get XI events. This should only cause problems when you're mixing core and XI events, so don't do that! Generic events don't fit into this yet, they cause me headaches. commit 7a0d16ef0a103bcb25fa8a20322685f017aaf5a3 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Tue Jan 15 03:27:16 2008 -0200 Removed some warnings. commit 315d6a2b1d2a3de308e98d548afe780c59a784fc Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Tue Jan 15 02:59:56 2008 -0200 Fix Xephyr compilation without GLX. commit 0969a9f7497e10794a6534321c10a0e1ac680ad7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jan 15 11:31:12 2008 +1030 dix: Emulate core events within CheckDeviceGrabs and ComputeFreezes. This should restore the correct passive grab processing. When checking for passive grabs, the core event is emulated and we check first for XI grabs on the window, then for core grabs. Regardless of which event activates the grab, the XI event is stored in the device's EQ. When replaying the event, we take the XI event and replay it on the next window, again including the emulation of the core event. commit 1f83f40525acd3aff8f50b3c519bc1f307ff1e19 Author: Dave Airlie <airlied@linux.ie> Date: Tue Jan 15 10:20:50 2008 +1000 xf86Cursors: fix memset for non-square cursors commit e6ea3147bfb686798dac381eb8900f9f18beb88e Author: Bernardo Innocenti <bernie@codewiz.org> Date: Sun Jan 13 19:50:37 2008 -0500 exa: make the prototype for exaGetPixmapFirstPixel() public This fixes a warning in amd_drv which is using it. Signed-off-by: Bernardo Innocenti <bernie@codewiz.org> commit a83a0c5a144da67dab96a857b849a5692b73245d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jan 13 16:14:29 2008 +1030 dix: remove obsolete comment. Pairings don't exist anymore and the documented issue is a non-issue now. commit 180a5aba4de3104fed8bc4e7d42a1e3a51575318 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Jan 12 21:24:34 2008 -0800 XQuartz: Fixed copy-paste error with login_shell commit (cherry picked from commit 6deec3acc6f8010b5b53a1e55a0a2c4080ba69d2) commit 6fd4a5e2e4d0be0ba0773df831687e11e1262c72 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Jan 12 11:56:00 2008 -0800 XQuartz: Corrected copyright X.org Project -> X.org Foundation (cherry picked from commit f21631444816fc12b8a534c2cf79e6ac6c2af7c9) commit f72255639c065d795f7767683e851b1b5b2d9480 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Jan 12 11:35:48 2008 -0800 XQuartz: added 'login_shell' option to defaults so the user can choose something other than /bin/sh (cherry picked from commit b549cf18cebd3435d70f62855239484974c455a1) commit ec24a6b5aa732ec6999a27889d9a33cf80123886 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sun Jan 6 18:29:54 2008 -0800 XQuartz: Fixed switching into XQuartz via expose. (cherry picked from commit 627ed60ce5d7499761028edf379ebd95250d3e04) commit 6844bd2e63490870bab3c469eec6030354ef2865 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 9 19:52:00 2008 -0800 More Xv extension byte swapping fixes commit 38bf01bd1c925614a6e67a38aa3cefc7b8fe3bca Merge: 4e85c7c 0883e83 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 10 13:38:46 2008 +1030 Merge branch 'master' into mpx commit 0883e838e25227f0af84d2a90979175724166d16 Author: Peter Harris <peter.harris@hummingbird.com> Date: Wed Jan 9 14:52:33 2008 -0500 xf86misc.c: Avoid use of swapped values commit 59a63d72a1407a8aaf9878eeff7ee7a66f65a42b Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 9 18:42:58 2008 -0800 Fix reference to old versions of XFree86 to not say "Xorg 4.2 or earlier" commit 4e85c7c322faf14c14e4229fa294b8e3d3a4d304 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 9 17:36:39 2008 +1030 Xi: keep a counter of buttons down to avoid duplicate press/release events. If two devices are attached to the same master device, pressing button 1 on each of them leads to two button presses from the same device. Some apps really don't like that. So we just put a counter in place and only send the first press and the last release. commit e070c2cbef0d6fbbafce8d417e8b29231c2fdc50 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Dec 7 20:18:49 2007 +1030 mi: change infamous "Tossed event ..." error for something more explanatory. Few whitespace errors fixed. Two ErrorF's prefixed with [mi]. (cherry picked from commit 117458d2db49efd3f04432ff45871b44c7d4ad57) commit c31aead0fe9fe424120ce221cd9f76cb6d29a5b5 Author: Richard Purdie <rpurdie@openedhand.com> Date: Tue Jan 8 12:12:06 2008 +0100 [Kdrive] make XCalibrate 'orientation aware' commit 30375cd6d1439a3390b41714fe116aecc94743ca Author: David Nusinow <dnusinow@debian.org> Date: Mon Jan 7 20:57:30 2008 -0500 Don't log DPMS enabling as being from xorg.conf if it's not commit 981bb9f1e33e4564d1b59c00c808cc43a2e9497b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 18 13:57:07 2007 +1030 dix: set the correct number of valuators in valuator events. (first_valuator + num_valuators) must never be larger than the number of axes, otherwise DIX freaks out. And from looking at libXI, anything larger than 6 is wrong too. (cherry picked from commit 9f6ae61ad12cc2813d04405458e1ca5aed8a539e) commit 20ace6321ac464d821c67a82c7023f74ae038176 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jan 7 20:08:56 2008 +1030 dix: don't try to confine cursor on screen restructure if there is no cursor. Stops segfaulting when using xrandr. Yay. commit 57a491e6d3ebec464c0c861b02c9ddcb1cc62c3c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jan 7 20:06:32 2008 +1030 dix: init GrabPrivateKey to correct value. Merge detritus from last pull. commit 260505e3c5a18044e97d31ea3bcc0955e46335c8 Author: David Nusinow <dnusinow@debian.org> Date: Sun Jan 6 16:37:13 2008 -0500 Log enabling of DPMS even when it's not set in xorg.conf commit 7e7622165940934e56ae96ae785a8f88eec1a5cf Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 6 18:23:09 2008 +0100 Fix the name of the XFree86-Misc extension in the xorg.conf manpage. commit 59df687835c68eda147de47edfe9bc415c0efb4f Author: Julien Cristau <jcristau@debian.org> Date: Sun Jan 6 16:57:45 2008 +0100 Document the AllowEmptyInput, AutoAddDevices and AutoEnableDevices flags Add documentation for the new AllowEmptyInput, AutoAddDevices and AutoEnableDevices server flags in the xorg.conf manpage. commit 7d226d6a251cb90765be2b50a1973986c5b7605b Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Jan 5 03:14:07 2008 -0800 XQuartz: Cleanup for strict-prototyping Also fixed DarwinEQEnqueue to match changes to the callback And also use dpmsstubs.c rather than copying the code into darwin.c (cherry picked from commit 4c5c30a4beb7a427b00b18097f548876ad3c11d7) commit 11967dce11cd953d123d53bb3389aa257c5158e8 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Jan 4 22:54:26 2008 -0800 XQuartz: Fixed copyright in About box for 2008. Happy New Year! commit aca75f389e2b08096c3cacec03b12a58075cf12c Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Jan 4 12:23:09 2008 -0800 XQuartz: Flush the debug log for easier debugging Also cleaned up formatting in xpr's eventHandler (cherry picked from commit 16861d6d4239c7f3918332ef07752f1e211afb23) commit 57468a696e1259c1e1c185fc60230e1d195defb7 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Fri Jan 4 12:37:55 2008 +0000 Fix Line drawing with CapNotLast set in PolySegment. commit 39cb782f28be4efb2621fd8c614f2367eb834412 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 3 23:16:06 2008 -0500 XACE: DeleteCallbackList zeroes out its argument so don't do it twice. commit 7f376f23db463a65176de632ca6094acb55db951 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 3 23:08:49 2008 -0500 devPrivates rework: Free callback lists after use. commit de18703d2a25999e391d11b4c82ee018fb87372d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 3 23:07:24 2008 -0500 dix: Fix bug+leak in callback manager DeleteCallbackList function. commit 20eb26f9d149993ae360a2cbd1b536b68c9f4069 Author: Alex Deucher <alex@samba.(none)> Date: Thu Jan 3 22:53:36 2008 -0500 Fix potential crasher in xf86CrtcRotate() xf86CrtcRotate() is called by randr 1.2 drivers via xf86CrtcSetMode() or xf86SetDesiredModes() during ScreenInit() at which point pScrn->pScreen is not set. If a user specifies a rotation in their config file pScrn->pScreen is dereferenced and boom. commit 249b9b30c11e03bb113b37cf4712bf88debf6f05 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 4 13:49:48 2008 +1030 Xi: remove file for the obsolete ChangePointerKeyboardPairing request handling. commit e4a214e40d35aa957c83b86b4e4abc86c22fbde0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 4 13:32:53 2008 +1030 dix: don't free device's devPrivates manually, dixFreePrivates does it. Merge detritus from last pull. commit cd0603c2dc5ee000ebce66056bc1a72f99bfb617 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 3 21:41:02 2008 -0500 Bug #13765: Heap corruption in XC-SECURITY extension code. commit e46d559739e020dc7f6fcbdc6d1fb39c57aab4b1 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 22 15:09:12 2007 -0800 XQuartz: Cleaned up color map configuration. 8 bit color still doesn't work, but the -depth command line argument now works properly. (cherry picked from commit 6765949c27c053d22882f54337cfd09203aa5383) commit 17a9714a6789a389d52dbb40fd1eed1e24c04d64 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jan 3 14:46:54 2008 -0500 Bug #13794: Update MBE extension devPrivates to new interface. commit b2da44c76d68a76f20e90bccb268ebf65e132b49 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 3 18:51:44 2008 +1030 dix: DoChangeKeyboardControl shouldn't be using inputInfo.keyboard. commit 9cc41b88dfebb3f1e0a7cb5c224146e651a2cda4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 3 18:47:28 2008 +1030 Xi: ProcXSetClientPointer should directly check for the client from the id. The window ID includes the client ID anyway, so we might as well just look up the client directly instead of trying to get the window first and the client from the window. This also fixes a possible issue with XACE. If the client had permission to write on the client but not on the window, the previous approach would have failed. commit 521fdc28d86d091495da3558d26ab4a938250ffe Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 3 18:43:18 2008 +1030 xfixes: switch a few inputInfo.pointer to PickPointer commit 37194b13554f0d36343cf73324b128b15bb6a338 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 3 18:36:33 2008 +1030 Xi: switch to using "rc" (instead of "err") as returncode. All the rest of XI uses rc and returns rc in case of error, so make mpx-related stuff comply. This stops the rest of XI sending the error manually. This is just a cosmetic change to be in line with the rest. commit c7e9b67c547c97b2c943eab555b4fe2844e8a91f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 3 18:09:56 2008 +1030 dix: free ClassesRec when a BadAlloc occurs during CoreKeyboardProc. commit 8da83836b60f7cdb75d08482f4311fa0e2ab4e1d Merge: eace889 ae869fc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 3 17:04:54 2008 +1030 Merge branch 'master' into mpx Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c commit ccf6636d2ca8acdaaeb8da34db507a10a082b0de Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 2 19:28:33 2008 -0800 Kill xf86getpagesize even harder (dummylib & ioport) commit dfd682b582636a36345144bcf835e3ee46718d90 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 2 19:27:22 2008 -0800 X.Org bug 4947/Sun bug 6646626: Xv extension not byte-swapping properly X.Org Bugzilla #4947 <https://bugs.freedesktop.org/show_bug.cgi?id=4947> Sun bug 6646626 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6646626> Don't use swapped data after swapping it. When done swapping data, send the swapped data, not the address of the pointer to it, to the client. commit f6666dcc3b1ac60f850ea53c357a9ef61672a52a Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 2 19:19:55 2008 -0800 Add dixAllocatePrivate stub to dummylib for utils Normally not necessary, except when building non-optimized/debug causes the inline functions from private.h to appear in os-support/libxorgos.la commit 73f422996016107d5f53492e4197bb05ed9c4bb9 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 2 19:17:54 2008 -0800 Fix names/types of new vuidMouse{Get,Set}ScreenPrivates macros commit 895073f6b41d9313cfe748232c492c5e9f76b443 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 2 18:09:26 2008 -0800 Restore include & typedef needed by dtrace 996b621bec1bbc4fb21970c75eaec62053bc6ccb deleted a couple lines too many commit 306fde4082044dfecbedd9af41e660bafb3ce438 Author: Brian <brian@i915.localnet.net> Date: Tue Jan 1 09:27:44 2008 -0700 regenerated to add framebuffer object tokens (bug 13800) commit 5c362c2eb2cfdf1f6d667a3e64a0a7bc4942c950 Author: Brian <brian@i915.localnet.net> Date: Tue Jan 1 09:07:48 2008 -0700 regenerated, adds GL_MAX_3D_TEXTURE_SIZE (see bug 13811) commit 85365ddf16e2b954d8249b380df53337420ed684 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 17:35:54 2007 -0500 EDID 1.4: If given a native pixel format, use it when inferring virtual. commit 312b30cb03e439644ea10e08fa93268116333f0d Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 17:18:30 2007 -0500 EDID 1.4: First detailed mode is always preferred. ... so act like it in the modelist generator, not just the parser. commit 9dbb73033ae60e7ab85f1469a696e2a52f0cb0fe Author: Colin Harrison <colin.harrison@virgin.net> Date: Sat Dec 29 00:02:16 2007 +0200 Rootless: Fix lvalue error from devPrivates change Instead of trying to use an invalid expression as an lvalue, use the function call instead. commit 36ff05771b0699aa80ad718e24097bc25cb4fb00 Author: Jurij Smakov <jurij@wooyd.org> Date: Fri Dec 28 23:59:53 2007 +0200 GL: Add GLX compile flags lost in modular X server changes RISC chips that trap on unaligned loads and stores need to define __GLX_ALIGN64. This used to get added to the cflags in the old *.cf files but it no longer does in the modular X server. Also, Alpha needs to pass -mieee to the compiler as well. This is a simple backport of a patch that debian, and probably other distributions, have been applying forever. To the best of my knowledge the patch was written by Jurij Smakov. See Debian bug number #388125. I just checked and this has been rotting for more than a year in freedesktop bugzilla as #8392. Signed-off-by: David S. Miller <davem@davemloft.net> commit bae459cfc4f17a5ec5f2810e9f913e3ad2d8b8d4 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 16:50:18 2007 -0500 Don't carp on EDID 1.4 blocks anymore. Also whine more loudly when we get something other than 1.x. commit 70b2d6cfeb3bcb7b862a2ae29f6ef7cb84d69486 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 16:39:00 2007 -0500 Check the gamma value, not its address. commit 592d814ee09e86e283116a7a1052762c8398e8e5 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 16:37:23 2007 -0500 EDID 1.4: Additional semantics for display feature bits. First mode is _always_ preferred in 1.4; the bit that used to mean this now means that the preferred mode is also the native pixel format. The old "is GTF" bit now means "is continuous-frequency" instead. Section 3.6.4, Table 3.14: Feature Support, Notes 4 and 5. commit 322d0103aee317500057c80d542d7270d69a5731 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 16:28:44 2007 -0500 EDID 1.4: Alternate color encodings for digital inputs. Section 3.6.4, Table 3.14: Feature support. commit f1f43caf7e26a84dbacd4e5d7d47c8b4e4982836 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 16:12:11 2007 -0500 EDID 1.4: Allow for gamma definition in extension blocks. Section 3.6.3, Table 3.13: Display Transfer Characteristics (Gamma) commit 861ee38817523a647e6be10d7e8fe26f66054217 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 16:06:45 2007 -0500 EDID 1.4: Additional aspect ratio semantics for screen size fields. Section 3.6.2, Table 3.12: Horizontal and Vertical Screen Size or Aspect Ratio. commit 14b5c8a447db0395fb14b2d404eafb1d8e4fb817 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 15:52:42 2007 -0500 EDID 1.4: Extended support for digital interfaces. Section 3.6.1, Table 3.11: Video Input Definition. commit a948216dccb5ee577a50a42035dc9bc49d0a00c6 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 15:00:41 2007 -0500 EDID 1.4: Decode CVT 3-byte codes and add them to the mode pool. Section 3.10.3.8: CVT 3 Byte Code Descriptor Definition. commit f6df66cc89bcd0a0be2e7bca05839fdd428c1d4c Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 13:55:39 2007 -0500 EDID 1.4: Trivial support for new detailed sections. Nothing actually decoded yet, but at least we print what they are. New in EDID 1.4: - Color Management Data (0xF9), Section 3.10.3.7 - CVT 3 Byte Code Descriptor (0xF8), Section 3.10.3.8 - Established Timings III Descriptor (0xF7), section 3.10.3.9 - Manufacturer-specified data tag (0x00 - 0x0F), section 3.10.3.12 commit bac3ecde39cc914ab515991234b7dc2138005b84 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 13:33:39 2007 -0500 EDID 1.4: Allow for sync range offsets. Table 3.26: Display Range Limits & Timing Descriptor Block Definition commit 3b23dd9fd43a28033d0af7b02088b0c6ca433158 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 28 13:29:45 2007 -0500 xselinux: Fix whitespace warnings. commit 643c52be32c187a0fdb9a031b1e31d97cd551339 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 28 13:26:26 2007 -0500 xselinux: Remove "X" prefix on remaining functions and strings. Should be evident from the context. commit f4bc333fc1e8d9fa9911771d2072df4df741c553 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 28 11:56:54 2007 -0500 xselinux: don't FatalError on an invalid class mapping, just disable support. commit f3780ece528ed3ead809ba6a388fa0f8aab2a775 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 20 20:32:07 2007 -0500 xselinux: Implement swapped protocol request logic. commit 1bbf64ab115e2a1121d6f9c0830b1b977f025178 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 20 20:31:34 2007 -0500 xselinux: Remove unnecessary structure definition. commit 938da5ee389975f910721f1c2cebc2dcec793117 Author: Adam Jackson <ajax@redhat.com> Date: Fri Dec 28 12:23:44 2007 -0500 Add HDMI and DisplayPort connector types. commit 24105cf6582201a94bc39aeac5a795297018aeb5 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 28 15:49:50 2007 +0200 Input: Don't reinit devices If a device is already initialised (i.e. the virtual core devices) during IASD, don't init them again. This fixes a leak. commit 941058f8da0d725f909dc97f68c32ce244a9dc0a Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 28 15:48:57 2007 +0200 KDrive: Xephyr: Don't leak screen damage structure commit b2f6cd290c43b88f0d08fb29f8657618a067d2a0 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 28 15:48:25 2007 +0200 OS: Don't leak connection translation table on regeneration commit 190a0506243b39cd8dfc0e12068e3a3f416330f1 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 28 15:47:57 2007 +0200 Config: HAL: Don't leak options on failure to add device This showed up in Xephyr in particular, which denies new device requests. commit f44fd3f9e41bf467360ace93ef5b532d8f61fb2c Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 28 15:47:21 2007 +0200 Config: D-Bus: Don't leak timers TimerCancel doesn't free the timer: you need TimerFree for that. commit ae869fc7669764729e13fdd70149ed636753f2a3 Author: David S. Miller <davem@davemloft.net> Date: Tue Dec 25 22:42:50 2007 -0800 [SBUS]: Fix build, use getpagesize() instead of xf86getpagesize(). xf86getpagesize() was removed, but this one call site was not fixed up. Signed-off-by: David S. Miller <davem@davemloft.net> commit 009f1e4e55200425de2fe0dbc1f0ac0f431fb4cf Author: Fatih Aşıcı <fatih@pardus.org.tr> Date: Tue Dec 25 23:09:49 2007 +0200 Config: Don't forget to add xkb_rules option commit 389e8917f66a489455f1d5c70f44c262717538ad Author: Fatih Aşıcı <fatih@pardus.org.tr> Date: Tue Dec 25 22:59:24 2007 +0200 Config: Fix a memory leak commit 743008a4812d6b046211ebcf4eab202687b458d5 Author: Adam Jackson <ajax@redhat.com> Date: Sun Dec 23 14:27:14 2007 -0500 Report serverClient resources in the X-Resource extension. commit beb29c605b8c66e1a18b89668aa421c1519645f6 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Dec 21 02:09:01 2007 -0800 XQuartz: *REALLY* use CFStringCreateWithCString I need sleep! Why am I making these stupid mistakes... sorry for pointless commit spam. ugg. (cherry picked from commit b16351fc6457aabead328472d16dc25789032940) commit 5dd895efa305954e2695aa22a9e49acfb65b4d5e Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Dec 21 02:06:47 2007 -0800 XQuartz: Use CFStringCreateWithCString (cherry picked from commit 79782b0e14761dcf5d6635b8eec161b74f06763a) commit 2c24231fc2027cf5034bb1b6636332687f586726 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Dec 21 01:57:43 2007 -0800 XQuartz: Reduce code duplication in X11.app (cherry picked from commit b81809cd91a9f90b7f2de77b1dcf514cee87c32d) commit f3042a63be0748bb60567144276d2c61b75ba0b7 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Dec 21 01:24:06 2007 -0800 XQuartz: Handle Pseudorami init in miinitext (cherry picked from commit a585c94fedd4ecbc87524703c01bb128fc2aa951) commit fa9680a7305d7f906da1bdeb40a0863ef66316e6 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 20 19:38:20 2007 -0800 XQuartz: Added localization. (cherry picked from commit 7a5cc7bfbb296a2c41a580b063324c448f7131db) commit 603a8b73d46d59e5f9f0be39be8317f3fadfe7e6 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 20 18:29:57 2007 -0800 XQuartz: Cleaned up command line arguments. commit 4cf3002b6020024f2fc2ed0cc40a872a066e482d Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 20 18:08:40 2007 -0800 XQuartz: Kill off server-main.c and launcher-main.c Now using xinit (cherry picked from commit 5d6ae3d299f72df714117948b3d31dcbddf6c0bc) commit 1f74bef1ad1399323fc0d2e309b808bf32c622e4 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 20 17:33:38 2007 -0800 XQuartz: Don't fork to exec app_to_run. Plus other housecleaning... (cherry picked from commit ae302db472f127be082d05b418ede332fae8ccc5) commit 2d15d439f844d4016f169664a338595c11b91b77 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 20 15:46:40 2007 -0800 Xquartz: Use X11ControllerMain() (cherry picked from commit a9ac932543374aa2540f5a12cc85ef82c85b0e0c) commit 1393a97ea97b5f7d7b90e3e8c58b5996b600e0c6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 20 16:23:35 2007 -0500 xselinux: Send AVC messages to audit system instead of log file/stderr. commit 42802a8e6b3d3795acc4f8b7597ea5a48619b5cd Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 20 13:17:30 2007 -0800 Xquartz: General Cleanup General code cleanup, whitespace, dead code removal, added missing prototypes. Made Xquartz come to foreground later in startup, so it doesn't appear for Xquartz -version (cherry picked from commit 36922e8ff4316c93843aa3fe959cf8df3c7d5892) commit 7ef7727b800fa4715b80a82850d65b88fde5fe6c Author: Dave Airlie <airlied@clockmaker.usersys.redhat.com> Date: Thu Dec 20 10:11:26 2007 +1000 entity sharing: make !shareable entity non-fatal. Just because the entity isn't shareable, we should bring down the server. Just ignore the extra screen and keep going. commit 50e80c39870adfdc84fdbc00dddf1362117ad443 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 19 16:20:36 2007 +1030 include: never overwrite realInputProc with enqueueInputProc. Bug #13511 In some cases (triggered by a key repeat during a sync grab) XKB unwrapping can overwrite the device's realInputProc with the enqueueInputProc. When the grab is released and the events are replayed, we end up in an infinite loop. Each event is replayed and in replaying pushed to the end of the queue again. This fix is a hack only. It ensures that the realInputProc is never overwritten with the enqueueInputProc. This fixes Bug #13511 (https://bugs.freedesktop.org/show_bug.cgi?id=13511) (cherry picked from commit eace88989c3b65d5c20e9f37ea9b23c7c8e19335) commit d0308b64655360517d83e07e866d103c3f2b389d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 19 18:18:10 2007 +1030 Xi: specify correct struct when calculating size of GetDeviceControl reply. This doesn't change much, as the struct previously given has the same size as the ones now anyway. Still, we should be pendantic. Thanks to Simon Thum for reporting. commit 66b00029e587cec628d0041179a301e888277f8e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 19 18:10:50 2007 +1030 Xext: remove redefinition of Bool. Thanks to Simon Thum. commit eace88989c3b65d5c20e9f37ea9b23c7c8e19335 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 19 16:20:36 2007 +1030 include: never overwrite realInputProc with enqueueInputProc. Bug #13511 In some cases (triggered by a key repeat during a sync grab) XKB unwrapping can overwrite the device's realInputProc with the enqueueInputProc. When the grab is released and the events are replayed, we end up in an infinite loop. Each event is replayed and in replaying pushed to the end of the queue again. This fix is a hack only. It ensures that the realInputProc is never overwritten with the enqueueInputProc. This fixes Bug #13511 (https://bugs.freedesktop.org/show_bug.cgi?id=13511) commit bcad2a5a24f30cfdf9eca31915ed5a55ed094285 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Dec 18 20:19:26 2007 -0500 XACE: Too many arguments to selection access hook. commit 7721d3e9217b41aab3a0ee5eaa52f5b53cbb07db Author: Adam Jackson <ajax@redhat.com> Date: Tue Dec 18 19:14:26 2007 -0500 Reference cvt and gtf in the xorg.conf man page. commit 51fab1eb30691c503f1b4dc98b465f2bc2e1394e Author: Sam Lau <sam.lau@sun.com> Date: Tue Dec 18 11:38:47 2007 -0800 Sun bug 6278039: Xevie checking wrong size in swapped XevieSelectInput requests <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6278039> commit 97c82ce0510808ea9d8a37a0a121e750f6dd8158 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Dec 17 23:11:29 2007 -0500 XACE: Restore the old background None behavior in response to bug #13683. From the X11 protocol spec: "If background None is specified, the window has no defined background." This means that toolkits and apps cannot rely on the "transparent" nature of the current implementation! At some point before the next release, XACE will switch back to a solid background as the default. commit 9f6ae61ad12cc2813d04405458e1ca5aed8a539e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 18 13:57:07 2007 +1030 dix: set the correct number of valuators in valuator events. (first_valuator + num_valuators) must never be larger than the number of axes, otherwise DIX freaks out. And from looking at libXI, anything larger than 6 is wrong too. commit 6a5c3e04fa43b98ccffd69ad86dd781602f88d0b Author: Dave Airlie <airlied@redhat.com> Date: Mon Dec 17 14:59:12 2007 +1000 mi: set the private key to a unique non-zero value commit a18d28a5efbe6021d6c800506cece28a73545aad Author: Dave Airlie <airlied@redhat.com> Date: Mon Dec 17 13:49:16 2007 +1000 damn then my cut-n-paste ate my end of lines... commit d096bbd01bf7c7e15b5a2c582718f3333e063ddc Author: Dave Airlie <airlied@redhat.com> Date: Mon Dec 17 13:45:15 2007 +1000 Xquartz ate my DMX - thanks commit bf20c4374aeb5160a0dc372df9b49f1bbc05f078 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sun Dec 16 01:14:32 2007 -0800 Xquartz: Removed launchd plist and x11-exec. The relevant code is now in xinit. (cherry picked from commit 767b4c9d9daa5d0ea59ac1f0d70146798da631cb) commit 58c2898b62fbf0d8e0f175de7cc208dc29d93788 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sun Dec 16 01:21:45 2007 +0100 xfree86: permit access to io port 0xffff on the hurd commit b4ef8885e1697b83a0dcc9f7fe79155f19241798 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 15 14:00:19 2007 -0800 Xquartz: Fixed launchd detection commit ff5abc72fcc459d7eac663e5f8e4d40b28749841 Author: Otavio Salvador <otavio@ossystems.com.br> Date: Fri Dec 14 17:59:29 2007 -0200 registry: XREGISTRY_UNKNOWN needs to be defined even if XREGISTRY isn't enabled In case XREGISTRY isn't enabled, XREGISTRY_UNKNOWN is used but it's not being available. It's now always available. commit a3f7f7b60e391e6106f5db40b3fe5fbc67ccd836 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Dec 13 20:45:14 2007 -0800 clarified debug message to indicate that we're sleeping (in case we get reports about slow launch times, this will help clarify what's happening) (cherry picked from commit 2eea3483cf893f8f81bacd434b31408dfb38cb06) commit e0e59b3bbc4d8e7ac3934a6f6a9e4a15b328c475 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Dec 13 20:44:33 2007 -0800 we need to link against CoreServices, not ApplicationServices (cherry picked from commit ba4d2096e7953ef5b971682f0e28535da968acb1) commit 062d9234e233fc4c1c617f59093da973c9d3e2ce Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Dec 13 20:40:27 2007 -0800 fixed bug in x11-exec that prevent icon from showing up (cherry picked from commit e1f4a0c20d3a52d98954c4b28d0ec4d44564bc32) commit 95c02adea80a14e18bb51876bc1418eccdade31d Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Dec 14 15:21:40 2007 -0800 Xquartz: Fixed cpprules include commit 86730337001ba4db6d77fe42406695e32784b157 Author: Otavio Salvador <otavio@ossystems.com.br> Date: Fri Dec 14 08:46:35 2007 -0200 kdrive/ati: use operating system input devices commit e110255501e2f699709e6978f5e52d3be96333c8 Author: Otavio Salvador <otavio@ossystems.com.br> Date: Fri Dec 14 08:45:09 2007 -0200 kdrive/vesa: use operating system input devices commit 863ba390e9fdf0d37cdf03bf5eebe7fdfe6288f5 Author: Otavio Salvador <otavio@ossystems.com.br> Date: Fri Dec 14 00:03:13 2007 -0200 kdrive/fbdev: use operating system input devices commit ca59d3f7bdb5f3724ff45ea57912c0b1098a73d6 Author: Arkadiusz Miskiewicz <arekm@maven.pl> Date: Thu Dec 13 00:09:08 2007 +0200 Xprint: Clean up generated files Remember to clean generated wrapper files. commit 5b02a6ca5b31db69d08f2f452494c0f93a6260d9 Author: Bartosz Fabianowski <freebsd@chillt.de> Date: Fri Dec 7 02:38:14 2007 +0000 Input: Fix proximity events with valuators Initialise num_events to 1, so we always send a proximity event, and then optionally valuator events. Also make sure mieq can deal with valuator events sent after proximity events. commit a14a143832be844b4b890b0160ccb9fc8293c28c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 14 00:57:16 2007 -0500 Bump server version for devPrivates rework / XACE. commit a2df51f8e95a814c54b806814020155ac8bd177d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 14 00:53:54 2007 -0500 Bump video driver ABI and extension ABI for devPrivates rework. commit 86b2e59bfb79bd042a13c35fbb4ccecec576f629 Merge: 1c1a4bc cb0d7e2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 14 00:32:24 2007 -0500 Merge branch 'master' into XACE-SELINUX Conflicts: configure.ac This is the last pull before merging to master. commit 1c1a4bc970be061484bb8dcccf945eb08144c656 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 13 19:51:40 2007 -0500 devPrivates rework: more cleanup from previous merge operation. commit cb0d7e2c2692a332e2bd5495478ebf9a6cd601d0 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 13 16:23:46 2007 -0800 Xquartz: Don't hardcode libexec dir (cherry picked from commit 67b479ef80cb740a24981335eb8d596744168a62) commit c39212fd7353fc1a07a30bade90f78356c748e2d Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Dec 13 15:56:31 2007 -0800 Xquartz: Don't hardcode LaunchAgents dir (cherry picked from commit 07a12d71fefd78c380078efa835700f2868ab204) commit 82e1aff9fbc1d15e3451707e3ccbf4b13eedda94 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Dec 13 15:57:39 2007 -0800 Modified X11 plist to use x11-exec (cherry picked from commit 7d9a11329e476f45e4d9f9aebcb43469321347c7) commit 1a5910588a60af0c136595e2457d897d9e54ac88 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Dec 13 15:55:28 2007 -0800 created x11-exec wrapper, which uses LaunchServices to find (and then exec) X11.app (cherry picked from commit fc04c9759b30d062111d4a7f3f411ed0f18cbde4) commit c8feb73f5841e7812d8dfdb91f1064e2033d028c Merge: 9a7ce57 a125ce4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 13 18:38:25 2007 -0500 Merge branch 'master' into XACE-SELINUX Conflicts: Xext/EVI.c Xext/bigreq.c Xext/cup.c Xext/dpms.c Xext/fontcache.c Xext/mitmisc.c Xext/xcmisc.c Xext/xf86bigfont.c Xext/xtest.c configure.ac dbe/dbe.c hw/darwin/darwin.h hw/darwin/darwinEvents.c hw/darwin/iokit/xfIOKit.h hw/darwin/iokit/xfIOKitCursor.c hw/darwin/quartz/fullscreen/fullscreen.c hw/darwin/quartz/fullscreen/quartzCursor.c hw/darwin/quartz/quartz.c hw/darwin/quartz/quartzCommon.h hw/darwin/quartz/quartzCursor.c hw/darwin/quartz/xpr/dri.c hw/darwin/quartz/xpr/dristruct.h hw/darwin/quartz/xpr/xprCursor.c hw/darwin/quartz/xpr/xprFrame.c hw/xfree86/modes/xf86RandR12.c include/cursor.h miext/rootless/rootlessCommon.h miext/rootless/rootlessScreen.c miext/rootless/rootlessWindow.c render/picturestr.h Trying to pick up the pieces from the darwin churn here... commit efcdc0d7010f4e6ec833842cb010a07068edf7ab Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 13 15:38:41 2007 -0500 Correct the documentation comments in xf86Modes.c Most of those functions do not, in fact, work with circular mode lists, and by this point the API isn't really "proposed" anymore. commit 1768af38c737f4c14d32f587b51a8ec3d3d6ed5f Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 13 15:06:18 2007 -0500 Add infrastructure for validating modes by memory bandwidth. commit 4359193aaa522599c502d012b9c163e993c01d79 Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 13 10:59:48 2007 -0500 Explain a confusing #ifdef. commit 8cedbb0a53d47b12f03edb726db9d5879c8a63a4 Author: Adam Jackson <ajax@redhat.com> Date: Thu Dec 13 10:57:35 2007 -0500 Clean up some #if 0. commit 9a7ce573636e349ee2967991c7cc1407e80ae524 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Dec 12 20:44:59 2007 -0500 xselinux: Add new protocol for setting device create context. commit a125ce4a84f5fb5934fefebd7cfb22a83180874d Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Dec 12 12:20:54 2007 -0800 Fix dist by including modeline2c.awk. This was broken by commit cb44b6121c4b7b9dd7ff4ff52aaab914c82ff013, which removed modeline2c.pl from EXTRA_DIST without adding modeline2c.awk. commit 671592343701d8174a70f1ffb9c818784ea3af7a Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Dec 12 10:59:15 2007 -0800 Get rid of xf86DefModes.c. It's out of date and not included in the build. Instead, xf86DefModeSet.c is built from vesamodes and extramodes using modeline2c.awk and *that's* what gets built. commit d86e7f2ecc0a0129a722ffaca93dfc7c0c60e842 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Dec 7 20:40:21 2007 +1030 dix: when getting a bogus event, at least print out the type. commit eab0c4e49015fe96f6d985316f9c5fa28a7eb1fe Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Mon Dec 10 20:57:24 2007 -0800 Xquartz: Pre-process Xquartz man page (cherry picked from commit dec2633c41dd0adf73264afdf251a6522d6ae76a) commit 1ff945a8e43e622b39b360ee49efd6ae3b77be67 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Mon Dec 10 20:47:48 2007 -0800 Xquartz: Make Alt work with Xmodmap again (cherry picked from commit 0e017177dcca7185716ca760dcce9ddedc7bfef9) commit 7d61893b49569a72bccb63f1ae8c9ce4ef4e354f Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Mon Dec 10 20:33:30 2007 -0800 Xquartz: Removed Xplugin.h from EXTRA_DIST (cherry picked from commit a746383eca77c9b9ea2cba0cf1c8fc39c0f7d536) commit 8f2eff643bf421bc4233fbaa2409b75d9f80d147 Author: Ben Byer <bbyer@bbyer.local> Date: Sat Dec 8 23:34:40 2007 -0800 remove Xplugin.h, because we should use the one in /usr/include (cherry picked from commit 3e881032f35f774ff9638678d7e3f77c81f62976) commit 7b573ed43672b1fac7b4e6df85a657942ab4cba6 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sun Dec 9 12:02:04 2007 -0800 Xquartz: Added missing link to libconfig.a (cherry picked from commit 14ec1cf1cb7ebc183c05e13f9c2b4b4eed679ff3) commit cd13c4ba5b7a1bdfb419cb492a96a72dccf2681e Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 8 13:18:17 2007 -0800 .gitignore: added hw/xquartz/bundle/org.x.X11.plist commit 020b0e92b039d6ddaea0bbdb890b6a01037bf9b6 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 8 11:49:37 2007 -0800 Xquartz Added quartzKeyboard.h to EXTRA_DIST (cherry picked from commit 37c9781fdb672229ceab101b080762e15512943f) commit 5e016fa9b2bf28971ed1794f4706c6538b1d411c Author: Ben Byer <bbyer@bbyer.local> Date: Sat Dec 8 06:12:46 2007 -0800 Added darwinEvents.h to EXTRA_DIST (cherry picked from commit 45e5247564c423a2bf02cfec1993155858c91a14) commit 6bb5dacc1710cdbededb9b28ba89a184ecd0931c Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 8 01:41:37 2007 -0800 Xquartz: Actually add quartzForeground.[hc] Sorry for the commit spam... I'm tired and was overly quick to commit... forgot to include a neccessary file. (cherry picked from commit e564b7aeaab63e4c943445275af680b3b5898a94) commit 02df03667052fa6a4e0405b91a005dc48e9b39c4 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 8 01:28:26 2007 -0800 Xquartz: Actually, it should be org.x.X11 for case-sensitive FS (cherry picked from commit c5ccb98d5d461c8a22fc0f3942a607ac90e1e37e) commit 740cc54f081393d4ffe1a3e91c9e504dfaee3fe9 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 8 01:24:58 2007 -0800 Xquartz: Use org.x.X11 instead of com.apple.X11 for preferences Fixed inconsistency so preferences get read from the correct source. (cherry picked from commit a74c38bd9f28735acd602d359d7ca6357aed1e93) commit 41a0aeaae9b7b2f8cc2468fd1f3ee11287d34828 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Sat Dec 8 00:13:47 2007 -0800 XQuartz: Fixed "Multiple Dock Icons" BAM! (cherry picked from commit d0dca8a88506f50b51f41f99a2f1feb6954c8a31) (cherry picked from commit 0502955a2af487b51bf22916ac02e497c2d96aba) commit a1b0346853720e98963910b82603c5cda72bb7f9 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Dec 7 23:26:11 2007 -0800 XQuartz: Cleaned up configure, X11.app path in launchd script Don't hardcode X11.app's path in the launchd plist. Only install the launchd plist if we --enable-launchd. (cherry picked from commit 6b74c535dc331d1d621b2541492a3336f69d70a2) commit 1157cfcc5a4e2a7299a4c48df04a1cc8d5093906 Author: Ben Byer <bbyer@bbyer.local> Date: Fri Dec 7 21:55:42 2007 -0800 Just a couple of small uninitialized pointer fixes (cherry picked from commit d12b650362da100ceaecb7e859cd4ef1908d4407) commit 0ad1c359c5b0be63748f5c630c97be88a8cc92ce Author: Jeremy Huddleston <jeremy@dhcp-38-248.EECS.Berkeley.EDU> Date: Fri Dec 7 18:54:58 2007 -0800 Darwin: Use __APPLE__ instead of __DARWIN__ (cherry picked from commit 54654815fa5e59b25cfd1fa72610120b72c10175) commit 85ed0bb44011312dfaa9f2dc31642a0f89ec0bd3 Author: Brice Goglin <bgoglin@debian.org> Date: Sat Dec 8 02:53:27 2007 +0100 Add a missing linebreak after LoadModule: "foo" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=454742 commit 4fc288a13f825db942c9dcd64f4abd0265652faf Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Dec 7 17:28:37 2007 -0800 Check for <sys/sdt.h> as well when determining to enable dtrace probes Avoids auto-detecting dtrace is present on systems with the ISDN trace tool named dtrace installed, but not the dynamic tracing facility named dtrace commit 67907904f094c803d5faf6fa2ce23c01f9a5a521 Author: Ben Byer <bbyer@bbyer.local> Date: Fri Dec 7 01:51:53 2007 -0800 fixed pathname in GL/apple/Makefile.am (cherry picked from commit b6357cec6d837226009c0d2b69026027da36656e) commit 56f5066d477836a975122f4e5748c0f4fb790175 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Dec 6 20:51:32 2007 -0800 ALLOCATE_LOCAL is dangerous on Darwin due to memory layout differences from Linux, so let's define NO_ALLOCA. (cherry picked from commit 7caf51d1a5a86ae884e0087795636222c082962c) commit c238ef06a270c0c1d48cdb9175b6d5815c7c2a49 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Dec 5 21:36:34 2007 -0800 Darwin: Dead coded removal Kill off assert macro (cherry picked from commit d6493abedb2caf03b2bc3a6440b637df67eff081) commit 3a058456e0ce531b21ae2b37be8868b8e0d56e56 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Dec 7 20:23:36 2007 +1030 mi: unify ErrorFs, prepend [mi] commit c5acf401dad6fbca47f2bb870185c1d08ac947a5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Dec 7 20:19:43 2007 +1030 mi: unify last two ErrorF's in mieq.c commit 117458d2db49efd3f04432ff45871b44c7d4ad57 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Dec 7 20:18:49 2007 +1030 mi: change infamous "Tossed event ..." error for something more explanatory. Few whitespace errors fixed. Two ErrorF's prefixed with [mi]. commit 8a8239f2e21795602fcff5281833b350e6b2a286 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Dec 5 21:23:36 2007 -0800 Darwin: Renamed DarwinModeBlah to QuartzBlah (cherry picked from commit 08ebf86d379b1ddfb08df65d29aea5df66de4327) commit 540439a966cce3fc68a7e4bffdb5bcab1b20725f Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Dec 5 20:55:06 2007 -0800 .gitignore: Added Xcode user files commit bc65a243930e4b02f06a861495420b0a120eae8c Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Dec 5 19:43:49 2007 -0800 Darwin: Flattened quartz into darwin, renamed darwin xquartz Leaving xpr unflattened since we want modularity to replace that with xpc (XPluginComposite) at some point (cherry picked from commit 48e6a75fbdd0fee86e364f02ace83f20b312a2b2) commit e00f7061b22001989edf5bd38c2d0cc1566fdd19 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Tue Dec 4 23:18:37 2007 -0800 Darwin: Cleaned up keyboard interface headers (cherry picked from commit 141f69dc3d8d6e7d8ff65607f43700ac11243041) commit cb44b6121c4b7b9dd7ff4ff52aaab914c82ff013 Author: Andrew Oakley <andrew@ado.is-a-geek.net> Date: Wed Dec 5 20:23:05 2007 -0500 Fix commit aa0dfb3f42f19bb351ca7f1a9507ff5ec4590e96 From bugzilla bug 13467¹: Currently the xserver fails to build without this (now deleted) file, as the Makefile tries to distribute it. The patch simply removes the reference to modeline2c.pl. 1] http://bugs.freedesktop.org/show_bug.cgi?id=13467 Signed-off-by: James Cloos <cloos@jhcloos.com> commit 320abd7d1d906807448fa01ad3377daf707f46cc Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 5 19:37:48 2007 +0000 XKB: Actions: Don't run certain actions on the core keyboard Don't run VT switches, terminations, or anything, on the core keyboard: only run actions which affect the keyboard state. If we get an action such as VT switch, just swallow the event. commit 85dd8efac1bc0715f03c99d261b1c5d0980623e1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 5 19:36:59 2007 +0000 WaitForSomething: Ignore EAGAIN If select ever returns EAGAIN, don't bother complaining. commit b7f3618f3933a810778093fd47564a1e3bf3fde6 Author: Rich Coe <Richard.Coe@med.ge.com> Date: Wed Dec 5 19:36:37 2007 +0000 OS: Connection: Keep trying select while it gets interrupted (bug #9240) If we got interrupted (EINTR or EAGAIN) during select, just try again, rather than shutting clients down on either of these errors. commit d8b2cad3771a09860e7be1726f67e684cf7caeec Author: Rich Coe <Richard.Coe@med.ge.com> Date: Wed Dec 5 19:31:07 2007 +0000 OS: Connection: Don't shut down disappeared clients (bug #7876) If a client disappears in the middle of CheckConnections (presumably because its appgroup leader disappears), then don't attempt to shut it down a second time, when it's already vanished. commit a8e27a108abeba73b2888da4e0604008f4b02045 Author: Kanru Chen <koster@debian.org.tw> Date: Mon Dec 3 12:46:45 2007 +0000 Config: HAL: Fix XKB option parsing Actually combine the XKB options into a string, rather than just repeatedly writing a comma. commit 2d723bbd0d36f6d7763b4df3298d40720f97fdd0 Author: Peter Harris <peter.harris@hummingbird.com> Date: Mon Oct 29 18:05:19 2007 -0400 Add missing swaps in panoramiXSwap.c commit 0fccb24aa978b838cf0fb008e9695837e612c529 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Nov 30 20:35:26 2007 +0200 ProcessOtherEvent: Don't do double translation of button events We already deal with the button mapping in GetPointerEvents, so don't do the remapping again in ProcessOtherEvent. commit c6cfcd408df3e44d0094946c0a7d2fa944b4d2d1 Author: Hong Liu <hong.liu@intel.com> Date: Wed Dec 5 17:48:28 2007 +0100 Bug 13308: Verify and reject obviously broken modes. commit 8d0efe4c2a48047680af40e5f6d639f426902e07 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Tue Dec 4 17:59:13 2007 -0800 Darwin: Rework build system to more accurately reveal code infrastructure and facilitate future modularity. (cherry picked from commit e8399fd4d66a2b77b770c277e2fa424229a721b2) commit cc98a8e2415f12c7a90fd846d1ec858068e8c796 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Mon Dec 3 23:59:19 2007 -0800 Darwin: RIP dumpkeymap, cr, and fullscreen Taking out the trash. We don't need dumpkeymap since we'll be getting keymaps straight from the OS. .Xmodmap should be sufficient for any user-needed changes. If this is not the case, please let us know, so we can address any problems you have. fullscreen never worked AFAIK cr isn't being used and xpr is much better. (cherry picked from commit e41af2967e885466c4d194fa4c3b358e6be37c30) commit 13af2d1efcc83d1412a4c727afddd97577b00f32 Author: Adam Jackson <ajax@redhat.com> Date: Tue Dec 4 17:36:21 2007 -0500 Restore xf86getsecs() as not having an ANSI equivalent. commit 447cd5d411875b62eb1a501bf00e604225b74d26 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 4 19:09:37 2007 +1030 dix: update comments about inputInfo.pointer. commit f44d7dcb5fefca3ddfd45e75d0bd0b47ec785e48 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 4 19:07:46 2007 +1030 dix: change the filters to be per-device. If we have one global filter, one pointer may change the filter value and affect another pointer. Reproduceable effect: blackbox and xterm, start dragging xterm then click anywhere with the other pointer (attached to different masterd device!). The button release resets the filter[Motion_Filter(button)] value, thus stopping dragging and no event is sent to the client anymore. Having the filters set per device gets around this. commit 0931f40bf1bd6e00b8d95968d761a495b2c9a46c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 4 17:08:56 2007 +1030 dix: comments, whitespaces, copyright fixes. Removing my copyright message for now, should eventually be in line with the rest of the messages. commit 09c0c1a3cc4807813774a3c0e28a7ba9a87bb5c7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 4 16:51:52 2007 +1030 dix: remove #ifdef XINPUT. No escaping XINPUT anymore. commit f8d7729df388c142624def36ba6d8c3b15922018 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Mon Dec 3 20:20:05 2007 -0800 Darwin: Combine launcher and server X11.app This should hopefully eliminate confusion some people have over which X11.app is which. Now BOTH are in /A/U/X11.app and we intelligently determine whether to execute our app_to_run or launch the server. If arguments are given, we launch the server. Otherwise if we can connect to an X DISPLAY, we execute app_to_run. Otherwise, we launch the server. (cherry picked from commit e7026216ccaa8e4fb073800ba947c9909d4faada) commit 678f786715d76e972f8a77807c9caf3e90c24418 Author: Dave Airlie <airlied@redhat.com> Date: Tue Dec 4 12:24:47 2007 +1100 xf86crtc: oh mon could be NULL, so check before quirks commit a9df4bb555fd91707a68794c2dce24fb06e6cf64 Author: Dave Airlie <airlied@redhat.com> Date: Tue Dec 4 12:17:29 2007 +1100 xf86Crtc: pass correct parameter. quite how this has worked I've no idea. commit fe25f897c62bb324660217e15dbd3091c808dbba Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 3 18:34:40 2007 -0500 xf86getpagesize -> getpagesize elsewhere in os-support/ commit b84f2833a681585162b8dabfb02ff62e7e0ef4d6 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 3 14:52:17 2007 -0800 xf86getpagesize() -> getpagesize() in os-support/solaris/sun_bios.c commit aa0dfb3f42f19bb351ca7f1a9507ff5ec4590e96 Author: James Cloos <cloos@jhcloos.com> Date: Mon Dec 3 16:57:58 2007 -0500 Remove Perl dependency from the build From bugzilla bug 13467¹: The modeline2c script is the only part of the Xorg server that requires Perl. [This] is a simpler replacement that works with any normal AWK. 1] http://bugs.freedesktop.org/show_bug.cgi?id=13467 Bug was posted by Joerg Sonnenberger <joerg@NetBSD.org>. commit 60086d90168265795e07a60939e9e2fe95c6e15c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 3 11:30:58 2007 -0800 Use pkg-config to get -I, -L & -R flags needed for OpenSSL Still just uses -lcrypto instead of the full library list from --libs commit b77ca7cc9c23184c4ab367baf1b3ed0acf27c269 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 3 11:29:54 2007 -0800 Use _X_EXPORT instead of __attribute__((visibility("default"))) commit 1faba797cbfe1a4804b7ea6b47e1ca9d4e4324e4 Author: Adam Jackson <ajax@redhat.com> Date: Mon Dec 3 14:12:58 2007 -0500 Death to libcwrapper. This has been deprecated since 1.1. Since we're breaking ABI again anyway, remove it entirely. commit 28b93d74a11a1064d68a214fcaa7b0aede864a38 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Dec 3 14:32:53 2007 +1030 ephyr: miPointerWarpCursor needs the device parameter. Thanks to Mitchell Quille for spotting it. commit 004876355b43fb4d3c2bc5653a7dc1bfd3f985ee Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 30 13:56:04 2007 +1030 dix: Remove RegisterPairingClient and UnregisterPairingClient. commit f4dc521b38560c8f93b614316a3a5511941a93a9 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Sun Dec 2 18:21:40 2007 -0800 Darwin: Added {/,/System/}Library/Fonts to DEFAULT_FONT_PATH (cherry picked from commit b0069b04dddaa2df6d4cdf86f96fd8a2a257e47e) commit 0fff01f5660fb3bb9284f97c45dc76154435d02b Author: Adam Jackson <ajax@aspartame.nwnk.net> Date: Sun Dec 2 14:15:36 2007 -0500 Fix swapped Xv dispatch under Xinerama. Same-endian dispatch was properly calling through the Xinerama wrapping, but other-endian dispatch wasn't. commit fa47910045c3700d8d668b5e214e5ffc1e8dc3e7 Author: Adam Jackson <ajax@redhat.com> Date: Sun Dec 2 12:39:05 2007 -0500 Clean up many #if 0. commit 83ba1e167c1473ac7d85239a6ee5ed629353cb16 Author: Ben Byer <bbyer@bbyer.local> Date: Sat Dec 1 18:28:19 2007 -0800 added missing call to xcb_connect() (cherry picked from commit dc2fb323ee11f081d447605be151024f9e2487f9) commit 9ad4560b3cbd42e647d6227746d4d037616d57cf Author: Jeremy Huddleston <jeremy@tifa.local> Date: Sat Dec 1 16:23:23 2007 -0800 Darwin: Alt is Mode_switch Switching to Mode_switch to maintain compatibility with Tiger X11. (cherry picked from commit 8a76c99c0ebbaf7375f3a9c75c4f7921a79024da) commit f83d758dcc4878849a851c8466f6fa16b2b7cd8e Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Nov 30 16:11:15 2007 -0800 Darwin: properly implemented xcb check for stale sockets (cherry picked from commit f543cb8fbb3d9213cb03396f4252ab9821319993) commit f54b28eeba119c42d0fcccfbe295306dd670221a Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Fri Nov 30 16:09:23 2007 -0800 Darwin: Undo focus-hack which didn't work right. commit f30abe30c5fea10e680aa12f3fe37ee8ce1a0201 Author: Dave Airlie <airlied@linux.ie> Date: Fri Nov 30 13:52:06 2007 +1000 edid quirk for MAX 0x77e monitor From RH bugzilla 306441 commit 6216abe0c1a94efa4b2f0d14e88278f128304cd2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 30 11:34:24 2007 +1030 dix: avoid activating the VCP/VCK twice. This may set dev->key-xkbinfo to NULL, causing a segfault in xkb code lateron. Spotted by David Huggins-Daines. commit 9eb8ea9e615ebd8b568711eeca36aa84aa781ad3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 30 11:32:59 2007 +1030 dix: only freeze the paired MD on a grab, not all other devices. commit 8a079be0dd0f2ce37868988cde4ac8895522b088 Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Thu Nov 29 02:19:22 2007 -0800 Darwin: #ifdefs around dix-config.h include and NDEBUG/assert.h workaround. (cherry picked from commit d2b768890f0878ae4e3fec8f7219e82b79256133) commit 38397560612424b5b348f34c1a0bea8c47a574be Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Wed Nov 28 23:07:41 2007 -0800 Darwin: Removed support for darwinSwapAltMeta (cherry picked from commit 3d153c8fa40986d194b7701f5eafa0080e32399a) commit 89c3dfe41e3a17a4f27b20e23623dc5777670feb Author: Dave Airlie <airlied@redhat.com> Date: Thu Nov 29 19:57:24 2007 +1100 modes: use xf86RandR12Index to stop illegal access xf86RandR12Index set to -1, and if initialised it gets 0 or higher. This allows the server to start with xinerama turned on with only one head commit 725710fd0bc990b2c35e4c76128ef1c668013299 Author: Dave Airlie <airlied@redhat.com> Date: Thu Nov 29 19:40:53 2007 +1100 randr: make randr code not segfault when xinerama set commit e4fe0a3cb789b8757f1c80f606dfe32bccada582 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 29 09:55:24 2007 +1030 xkb: swap a LookupKeyboardDevice over in favour of GetPairedDevice The former always returns the VCK, which is obviously wrong if we have multiple devices. commit 23b8ca8a373d919225de9739af7b064f650eceec Author: Adam Jackson <ajax@redhat.com> Date: Tue Nov 27 13:20:40 2007 -0500 RANDR 1.2: Only enable unknown outputs if there are no connected outputs. Otherwise you end up with a confusing initial geometry, and xscreensaver and friends get very angry. commit edebe76cfdb31072d18a6fcd3ee8f1d95006855f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 27 10:22:44 2007 +1030 Xi: set DeviceXXXState's length fields to the correct size of the struct. Setting it to the size of a pointer is an interesting but equally wrong approach. Luckily Xlib never used this field anyway so nobody got hurt so far. Spotted by Simon Thum. (cherry picked from commit 0f2398d06ce591724e388b3270800c5e22b3de2d) commit 0f2398d06ce591724e388b3270800c5e22b3de2d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 27 10:22:44 2007 +1030 Xi: set DeviceXXXState's length fields to the correct size of the struct. Setting it to the size of a pointer is an interesting but equally wrong approach. Luckily Xlib never used this field anyway so nobody got hurt so far. Spotted by Simon Thum. commit 601307615e4955be23fd86a057285074242ad83e Author: Jeremy Huddleston <jeremy@yuffie.local> Date: Mon Nov 26 13:04:57 2007 -0800 Darwin,Rootless: Makefile cleanup (cherry picked from commit 9c6d8a035b712b219833653ac637b89703a9b0c3) commit 8503072e1c2b89dca786d4afb72aa60a170d2fbd Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 26 16:52:41 2007 -0500 registry: add missing include statement. commit 996b621bec1bbc4fb21970c75eaec62053bc6ccb Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 26 15:59:44 2007 -0500 registry: swap out the DTRACE XErrorDB stuff for the new registry call. commit 54cb729ecc2d366c1af836cb3d2ffc8e864e9b79 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 26 15:59:01 2007 -0500 registry: Add a call for DTRACE compatibility. commit decd5a7c605e42c99b6a4523c8e1833b859d9b24 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 26 15:26:49 2007 -0500 registry: Rebase registry to use the server config file of protocol names. commit 9b0e72c8d960d056276f5fa93f3cc2872825711e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 26 15:26:04 2007 -0500 registry: Add a great big list of protocol names, like the XErrorDB that ships with Xlib. This is considered temporary, until server-side XCB can solve the problem programmatically. commit c0f9e204baf0218466973868c5ea6ed0f78e6b8b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 26 15:24:15 2007 -0500 registry: rename the SERVERCONFIGdir and relocate it to /usr/lib/xorg by default. commit a344920ae86c1970e4cc34ee91e2f2008d490c49 Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 26 11:53:08 2007 -0500 Allow Virtual to be specified globally in the Screen section. The Display subsections are optional, and it's confusing to need to create them just to set a Virtual size. commit c6c284e64b1f537a3243856cf78cf3f2324e4c2b Author: Matthias Hopf <mhopf@suse.de> Date: Mon Nov 26 15:38:20 2007 +0100 Initialize Mode with 0 in xf86RandRModeConvert. Asking for trouble if non-initialized values contain random data. commit a4edfbef022f9635c2c9b9eb229cb622834dc68c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Nov 24 16:16:48 2007 +1030 mi: only call UpdateSpriteForScreen if the screen actually changed. If we call it unconditionally, we flip the dev->spriteInfo->sprite permanently when using XTestFakeInput (once in CheckMotion as called from the processInputProc, another time in UpdateSpriteForScreen when we actually warp the cursor). USFS also updates to the screen's root window unconditionally, which is not really what we want if we haven't changed screen at all. commit bf3198c8c56289244c58d36c6869442479fd3481 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Nov 24 15:00:57 2007 +1030 dix: fix typo commit 5dabe448bda68a483bf444a4adfed2b25b30f600 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Nov 24 15:00:43 2007 +1030 dix: Add special treatment of NotifyUngrab for enter/leave events. In some cases (e.g. using x2x) the previous model broke, with a window ending not counting down to 0 anymore. Special treatment for NotifyUngrab seems to help here. Current solution: If a NotifyGrab is to be sent ignore it. If a NotifyUngrab enter is sent, only adjust the semaphore if it is on 0. Likewise, do the same for a NotifyUngrab leave if the semaphore is on 1. This seems to work alright so far. commit 33b94da6327d3423b4ebc1a58d5894c9904e67c9 Author: Keith Packard <keithp@keithp.com> Date: Fri Nov 23 16:01:11 2007 -0800 Re-add call to XFixesExtensionInit for static servers. This reverts a portion of bcbaf2a0ce34b6c5e41d2831b8b87dbd0617a89b which removed the call to XFixesExtensionInit and some cpp lines. commit f6401f944d327cc5d9a7ee0bbdf4f7fc8eaa31e8 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Nov 23 16:12:49 2007 +0100 Don't segfault if referring to a relative output where no modes survived. commit fa19e84714aa84a2f2e817e363d6440349d0b619 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Nov 20 16:54:50 2007 +0100 Fix initial placement of LeftOf and Above. commit 184e571957f697f2a125dc9c9da0c7dfb92c2cd9 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Nov 20 13:05:26 2007 +0100 Adjust offsets of modes that do not fit virtual screen size. Fixes memory corruption if a too small "Virtual" was specified in xorg.conf for the selected multi-monitor configuration. commit a80e64f1503a4d8b11c4a6608d296422c69e3e8b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Nov 17 22:50:07 2007 +0100 XKB: Generate correct key repeat events (bug #13114) Make sure we send the correct event for the type of device when we're sending key repeat events, which stops repeats being sent to incorrect windows. commit 63351df0eec320aa3ce27d4d2ee6bcdb58aa2d92 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 18:02:07 2007 -0800 Darwin: Fix compilation/linking problems commit bf4ef4da759c01e6794ed28ba4988a2c8ee049bf Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 17:45:15 2007 -0800 Darwin: Remove the PaintWindow optimization which snuck back in. commit 2082e7aa878fe1221fd50895a9de1f408b3157a8 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 17:18:48 2007 -0800 Rootless: Remove the PaintWindow optimization which snuck back in. commit a751bc12bee1d4d2ed35e3a0c64d9c8c9bf30a82 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 13:53:00 2007 -0800 Rootless: Imported changes made in xorg-server-1.2-apple branch commit 59c7ca6586e7c20e28ad407ca9a0883c4d621d64 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 13:29:15 2007 -0800 Darwin: Added missing Makefile.am commit 23596291c30a85e38c00aef2c01b46d561e2916e Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 13:17:44 2007 -0800 Darwin: More syncing witn xorg-server-1.2-apple commit 4e18c626350c7c2e0fb540aa64a98957699f3abe Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 12:21:59 2007 -0800 Rootless: Pulled in changes from fb{Blt,Fill} into rl{Blt,Fill} (cherry picked from commit 3f857e129df7ce492191e0c51b8e53eaf6179366) (cherry picked from commit 70374a58937d7a6f01c210bd6ac66cafb63e895a) commit ed9524d36e42a310bb128284f2b507f76b8c40d9 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 01:07:02 2007 -0800 Darwin: Copied over missing file (Localizable.strings) from xorg-server-1.2-apple commit 4d9cef197b12548e0716dab3557e48311519e325 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Thu Nov 22 00:35:09 2007 -0800 Darwin: Misc cleanups to line up with xorg-server-1.2-apple commit 5e950123daa167c9ffe289b3bd89e3bd288da0e3 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Wed Nov 21 23:32:00 2007 -0800 Darwin: Removed cvs tags from Xquartz man page commit 3a2f714eea475a13cde65921e24c7ee3f70ffc3c Author: Jeremy Huddleston <jeremy@tifa.local> Date: Wed Nov 21 23:30:37 2007 -0800 Darwin: Removed .svn dir commit 691da031319dc59b9496101358c267f317abfd1e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 22 17:44:39 2007 +1030 Xi: allocate motion history for master device. We're still missing out on the actual content of the history but at least this way we don't segfault. commit 602de4f70b6f4aab93b514f3a01917bd5d4ad640 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Wed Nov 21 16:53:10 2007 -0800 Darwin: Use UTF8String since lossyCString is deprecated (cherry picked from commit 1786f9464af51ff606a612aec6fe420fa9688a28) commit 13666e287c347aab2a5e9d8ee5f6bb29b9b85171 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 18 17:44:12 2007 -0800 Darwin: Added some DEBUG_LOG sauce to the XP_EVENT handling code (cherry picked from commit ec84a4cef66a2b46ed71f9758c434ea629d2f270) commit 829b6641bd64c352e1e8a7c619f84dedbdb07a09 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 18 17:43:40 2007 -0800 Darwin: Disabled ALT_IS_MODE_SWITCH (cherry picked from commit fd181254f85543558190140787dc7b41f6cf90db) commit 8486f8af91b477c7bcb8438a0e9a72d0c11d1d63 Author: Ben Byer <bbyer@bbyer.local> Date: Thu Nov 15 02:25:50 2007 -0800 Darwin: Added a lightweight debugging facility to support troubleshooting (for example) the stuck modifier key issue (cherry picked from commit 0e0b452d10c0af55497c3299b5f3db45d5b381cb) commit 74214a9f42b931f99d83ddb4efb3720881a2de16 Author: Ben Byer <bbyer@bbyer.local> Date: Thu Nov 15 00:56:54 2007 -0800 Darwin: Patch to avert (some) damage / rootless crashes, courtesy of Ken Thomases (cherry picked from commit 148a87ff20aa5e7a6d839610aa14fa1a31505c4a) commit f5f833b80609f1f98c93113183bd2b1bab3bfec9 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 11 04:30:34 2007 -0800 Darwin: These changes are necessary, yet not sufficient, to get 8-bit indexed color mode working in Xquartz. (cherry picked from commit a415f62f5289fae99ea9b0038d21fad7695b1336) commit 8358334180a4f8c1e73fc5647a62bcd3539dee45 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 11 04:30:00 2007 -0800 Darwin: Fixed the call to xp_init so that we now receive Motion notifications even if X is not the active application. fixes <rdar://problem/5167664> xeyes dead until window activation (cherry picked from commit c7573379a85a1480cc51650075078e41dafe56af) commit 512dee90878e552ad1b2bb5b27366707f6464f28 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Nov 8 22:17:38 2007 -0800 Darwin: fix for spurious "Are you sure you want to quit?" message (cherry picked from commit 30cbfc786e4fedda3fe070bacceabe1d9212d00b) commit 28e73e99a9a59223963312c5dd43ce5566d1db9d Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Nov 8 22:12:41 2007 -0800 Darwin: Adding "fake RandR" support from old X11.app (cherry picked from commit 633490c4e8dab30af7ecbe1bef076c22ad5f5da9) commit 01b70afaac0990b41d1fb6fadbfd64df1486b669 Author: Ben Byer <bbyer@bbyer.local> Date: Sat Nov 3 05:34:19 2007 -0700 Darwin: Initial support for Spaces -- if you use Expose to drag an X11 window to another Space, it will work correctly (as opposed to just leaving a ghost window). We accomplish this by listening for the notification from Xplugin that our window has been moved, and then we ask X11 to move the window to the new location. (cherry picked from commit 2d50ea8013e7c1639d570e227b53b037fb567565) commit b39edc01a6588697b65f831e8ab1dbb24cbe7b24 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Oct 31 23:46:50 2007 -0700 Darwin: Swap modifier keys for buttons 2 and 3 -- now Option-click is the middle click (cherry picked from commit 0aa61293b62aeb69a93b2035d0aef8644343eed3) commit 606a8dc73d91a198d72d249934dc027a23f4c338 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Oct 31 03:39:47 2007 -0700 Darwin: Trap Deactivate messages and release modifiers to avoid "stuck shift lock" (etc) bugs (cherry picked from commit 2b189a99330eb465fa0d17020fb1db1e38829151) commit 4c18ef4331aaee268431a3ba50991f0312b82870 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Oct 31 03:22:18 2007 -0700 Darwin: Workaround for a bug where the holding down Command to make a "fake" button 2 click would actually result in a Command-2 chord. (I.e. it wasn't releasing Command before clicking the fake button.) (cherry picked from commit 0d5dd5dffa4c5ce3f54dfe53720a39d524dc8e37) commit f9269bebae27bbc9d0e03e02943166b83946623d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 22 17:30:14 2007 +1030 DeviceIntRec: move lastx/lasty from valuator into DeviceIntRec. We free the ValuatorClassRec quite regularly. If a SIGIO is handled while we're swapping device classes, we can bring the server down when we try to access lastx/lasty of the master device. commit 7f2972d47a5d74fe92268c6d609b1eb6ad845824 Author: Jeremy Huddleston <jeremy@tifa.local> Date: Wed Nov 21 21:59:59 2007 -0800 Darwin: Really add launcher this time commit bcbaf2a0ce34b6c5e41d2831b8b87dbd0617a89b Author: Jeremy Huddleston <jeremy@tifa.local> Date: Wed Nov 21 19:51:14 2007 -0800 Darwin: Dead code removal, Code cleanup, Added launcher Imported changes from xorg-server-1.2-apple to make master more current wrt file layout, build system changes, and dead code removal. commit 9ed43eff48201520797f89a12bb3b2f5819bd99f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 21 17:16:27 2007 +1030 Xi: allow clients to specify pure client id in SetClientPointer. If no window was found with the given ID, try if there's a client with the ID. Allows us to set the CP for apps that don't open windows (e.g. x2x). commit 33f15689922ad9f1193f803bc1636c82c23ab99e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 21 16:06:44 2007 +1030 xtest: switch an inputInfo.pointer over to PickPointer. Couple of whitespace fixes too. commit e5dd7a95791748c57cab75c0d8ba9d37f72edccf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 21 15:59:31 2007 +1030 Xext: Scruffy the janitor don't like no "register" keywords. commit a55ec1a9f4b62139dc5e5462d79d47b330c27c79 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Nov 20 18:31:03 2007 -0800 Restore checks for __i386 where needed for Sun compilers on Solaris commit 2f387d913aa76f1b6d21d8e2698be165301c6bc1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Nov 20 18:27:12 2007 -0800 Enable use of /dev/urandom on Solaris as well commit 4363d70c6b420648b501126d1fbdebfafc7ae09f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:58:55 2007 -0500 registry: Fix some mistakes in the reversion of prior commits. commit 140a4660aca1c283613d5b62f51668b44b45baf6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:49:30 2007 -0500 Revert "registry: Register XTrap extension protocol names." This reverts commit b38a91993364aa80cfd99721e319e1458d9fb760. Moving all the names into dix/registry.c commit ed8a39c48ab9dac085fcf58b9641364b5608f3f4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:47:52 2007 -0500 Revert "registry: Register XKB extension protocol names." This reverts commit a5cf3f21f712e46dbf9bca289e67be75f2b531d3. Moving all the names into dix/registry.c commit 17b0c729b553e2f0f8f82497698b282a47db3326 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:46:43 2007 -0500 registry: Remove registry code from XInput extension. Moving all the names into dix/registry.c commit e86852aff62a861823b8e419434e0401b8cdc8e0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:44:56 2007 -0500 Revert "registry: Register XFixes extension protocol names." This reverts commit 106758893b68033f14f69c4ee6591fb6a149ba37. Moving all the names into dix/registry.c commit 5269da2bde3cf4feb12fa2bd87bff6ee6d8730a1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:43:38 2007 -0500 Revert "registry: Register XvMC extension protocol names." This reverts commit 853ea337bdad17f8f6ec7d940de14ce2cbbbf93e. Moving all the names into dix/registry.c commit 03a86c8d5e20a6e47f3c294f0087f205cf2a72dd Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:42:19 2007 -0500 Revert "registry: Register Xv extension protocol names." This reverts commit 12766c5b5ffdab95255a63b2c8421ee773fd43b5. Moving all the names into dix/registry.c commit edcf490cdb965e2a5bfc0169c01732d2924da3ae Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:41:10 2007 -0500 registry: Remove registry code from XTest extension. Moving all the names into dix/registry.c commit 5fea1ed50f37691a5273bf2897479781de808ff5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:39:48 2007 -0500 registry: Remove registry code from SELinux extension. Moving all the names into dix/registry.c commit 9a8af33718d085656a672e4c27df200485c84154 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:38:24 2007 -0500 Revert "registry: Register Resource extension protocol names." This reverts commit 5c8b1a91726817816d20faefad21c7a68ab634cc. Moving all the names into dix/registry.c commit e6023e0208fae8f19c566f9df1a8aa20494f40ab Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:36:49 2007 -0500 Revert "registry: Register XPrint extension protocol names." This reverts commit f077578e42eee424b0e534774574c84af9d6f85b. Moving all the names into dix/registry.c commit 277345fb7065d74c3b0d076382affb78cbe67569 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:35:57 2007 -0500 registry: Remove registry code from XF86Bigfont extension. Moving all the names into dix/registry.c commit bf27edd365ffd275e5453f44d130eeacbfe0ecd9 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:34:14 2007 -0500 Revert "registry: Register EVIE extension protocol names." This reverts commit 48891d5696f56711f23743cb03be39cf6b26c522. Moving all the names into dix/registry.c commit 687427179420b18a55a1a02b8a9f2a32ea8eac8d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:32:54 2007 -0500 registry: Remove registry code from XC-MISC extension. Moving all the names into dix/registry.c commit 4b0274e8f712e51b18618a2a0bdbe03b17b9736b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:25:15 2007 -0500 Revert "registry: Register SYNC extension protocol names." This reverts commit 9f597f6c87e0b14cc382d8e5929e42f822db4329. Moving all the names into dix/registry.c commit 4c7cf5aa4c802dcde895c723879a80a87620c0f7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:23:57 2007 -0500 Revert "registry: Register SHM extension protocol names." This reverts commit 2c9646ad4e65bb061d910c9e2b1a8a978f21fa17. Moving all the names to dix/registry.c commit 67e82e306f67a215c6c89868cc1d3649747bd93d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:22:59 2007 -0500 Revert "registry: Register SHAPE extension protocol names." This reverts commit 4e274e90e16b1d954391e1af3e2074fb10f70ee7. Moving all the names to dix/registry.c commit 8583bf78ad056ffe2d83b54e5c9a0a217e425a7b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:21:09 2007 -0500 registry: Remove registry code from XC-SECURITY extension. Moving all the names to dix/registry.c commit 55744d8e5d7bf1ff27cd25de54e14e799dd1a70a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:19:44 2007 -0500 Revert "registry: Register MIT-SCREEN-SAVER extension protocol names." This reverts commit 58c3240fcbec23aad122e1c340f6bb6d3b18f779. Moving all the names into dix/registry.c commit 36ef45928c783292cef18acfdd83ae057826c989 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:18:01 2007 -0500 registry: Remove registry code from MIT-MISC extension. Moving all the names to dix/registry.c commit 816e6e612e4bc3cea1e67e7ea79d5b640458011f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:15:37 2007 -0500 Revert "registry: Register Multibuffer extension protocol names." This reverts commit 3877faf7d9fe00ed634077e38a198ae4b91a2bb4. Moving all the names into dix/registry.c commit 40a0da044e911ea51de003f3621331ffbe2842bc Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:13:43 2007 -0500 registry: Remove registry code from Fontcache extension. Moving all the names into dix/registry.c commit 46412baf60ed639ddc1d5fb601f73a75e39737f7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:11:06 2007 -0500 registry: Remove registry code from EVI extension. Moving all the names into dix/registry.c commit 460c43032f05aad3f0f552901a52d199f61c7f4f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:08:18 2007 -0500 registry: Remove registry code from DPMS extension. Moving all the names into dix/registry.c commit 76e89d45b497d4afa4e60e1d0ec50b62f54f6b88 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:06:40 2007 -0500 registry: Remove registry code from TOG-CUP extension. Moving all the names into dix/registry.c commit ce93c5772da52ab88faef7e5b661b681d5b60b1e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 18:03:57 2007 -0500 registry: Remove registry code from BigRequests extension. Moving all the names into dix/registry.c commit 0756d1271209e6ae14cc641dddca095271b43150 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:59:40 2007 -0500 Revert "registry: Register APPGROUP extension protocol names." This reverts commit b504678ba5407a6fd8d47d051305f7c3d5606dfe. Moving all the names into dix/registry.c commit 5aff37d1d69be493727856a29628bd782d50b90f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:57:06 2007 -0500 Revert "registry: Register RENDER extension protocol names." This reverts commit 8964c6d8e14ae47798762191e359b2bf138ca32e. Moving all the names into dix/registry.c commit e585a2ddb495b50a53e15cccc368ca0858fc9d23 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:55:47 2007 -0500 Revert "registry: Register Record extension protocol names." This reverts commit ea09c9acc8f0d5577f54c864ff88b7f03d93b2f4. Moving all the names into dix/registry.c commit d4577e485367468227e031eb434b739eff7b5e9a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:51:27 2007 -0500 Revert "registry: Register RANDR extension protocol names." This reverts commit c827db57e4d9ca14c82b099dcfc9b7a0c0b5ba0a. Moving all the names into dix/registry.c commit a541e826c9310d3051e53834833c6c3a08654148 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:50:26 2007 -0500 Revert "registry: Register WINDOWSWM extension protocol names." This reverts commit 4c3285c883cc50a91bc5262bbc9d073d816f860a. Moving all the names into dix/registry.c commit 993595430bd0580ab4d936be6b70fb91b8bb1d16 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:48:46 2007 -0500 Revert "registry: Register XF86DRI extension protocol names." This reverts commit b7786724080fd3928ef7b8c294346661d7ffd90b. Moving all the names into dix/registry.c commit 6b73c215c9d612534af290230b2e914d42d819cd Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:47:30 2007 -0500 Revert "registry: Register XF86VidMode extension protocol names." This reverts commit 960677e876c068400fb45e1764bb5470cd8c389f. Moving all the names into dix/registry.c commit 8e2cd7a804664bbd2d03789dcd5c93223122e929 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:45:30 2007 -0500 Revert "registry: Register XF86Misc extension protocol names." This reverts commit 2cd1b32b77e0ceeaccb3f01c4ac13a97c557668c. Moving all the names into dix/registry.c commit 0356153a58cef87d655bccacd8e2cf03d577bd19 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:43:18 2007 -0500 Revert "registry: Register XF86DGA extension protocol names." This reverts commit 3815284e899b61731b6a63c4ba14c5d773e24eb6. Moving all the names into dix/registry.c commit de93c1e9df14577e158b6dc3ccec7ee48f592386 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:40:57 2007 -0500 Revert "registry: Register DMX extension protocol names." This reverts commit 32f3f5a1e7654f8bb43ea16b9227b3994e616739. Moving all the names into dix/registry.c commit 2d3e0cdf4bd7ab069bad7244ede7c2d489e92b17 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:39:56 2007 -0500 Revert "registry: Register APPLEDRI extension protocol names." This reverts commit 3464b419230c6d17e940d967b567c5d2cb22d232. Moving all the names into dix/registry.c commit 546d46224e355d4f00232da5538548e3c8853e40 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:37:48 2007 -0500 Revert "registry: Register XINERAMA extension protocol names." This reverts commit b9f5ab98c8dea36dcce1ad15fd2e059a77e77c39. Moving all the names into dix/registry.c commit fd2d83d5bf5b35c8a2b05f725486be166783921e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:34:48 2007 -0500 Revert "registry: Register APPLEWM extension protocol names." This reverts commit eee46b4681ec55297604b0425705f2b18381f7ca. Moving all the names into dix/registry.c commit c934e1af27189571c1e7dd838872e380c3580eeb Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:32:35 2007 -0500 Revert "registry: Register DBE extension protocol names." This reverts commit 2e1e5be1d9067816525aa13a1d818e8ca6899599. Moving all the names into dix/registry.c commit b9ab6f300a46aa8879b11eac51857357cc379c2f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:31:00 2007 -0500 Revert "registry: Register DAMAGE extension protocol names." This reverts commit 20db50b4c44a14f7eeac2b1de17ada68482521da. Moving all the names into dix/registry.c commit 26586a7ad5e999b34996d147fb43998deea89178 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 17:27:37 2007 -0500 Revert "registry: Register composite extension protocol names." This reverts commit 166ef972febc00c665e1d5aeb68e75d7bbcf9879. Moving all the names into dix/registry.c commit fae39db7957c0ebdc7af36f8d8f484473beb6d38 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 15:21:31 2007 -0500 devPrivates rework: put back some changes that were mistakenly removed during merge conflict resolution. commit 709c1a70c8c6a9e132bf0d92f78a12be72beee51 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 20 15:18:02 2007 -0500 Remove some duplicate include statements. commit be0cbe5a330f62cef47fffbc49e83b5e1637b7d0 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Nov 20 15:39:49 2007 +0100 kaa: update kaaCreatePixmap to support the new usage_int commit 5b0dfb73ca4699cc4b33720f10416de7440081b7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 19 21:01:22 2007 -0500 devPrivates rework: put back a comment that was mistakenly removed during merge conflict resolution. commit 2d17f47cc7d6b174857617d31ad1b437d8e97d94 Merge: 60be452 ea9c63e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 19 18:10:46 2007 -0500 Merge branch 'master' into XACE-SELINUX Conflicts: hw/xnest/Pixmap.c include/dix.h commit 60be452c2e88342f92a76ba5ec7d90b5b0211aaf Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 19 16:55:09 2007 -0500 xace: restore the old SaveScreens function and introduce new API, since the old version is called from drivers... commit a95bb52b4366d85fc049130c60af5c9e727c565b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 19 16:34:38 2007 -0500 devPrivates rework: add missing include of dix/privates.h commit ea9c63e93b9bb731796e8a8de2d127e6cc720076 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Nov 19 15:53:49 2007 +0100 DEFAULT_DPI was undefined here. commit db9ae863536fff80b5463d99e71dc47ae587980d Author: Adam Jackson <ajax@aspartame.nwnk.net> Date: Sun Nov 18 11:57:01 2007 -0500 Bump DEFAULT_DPI to 96. 75 is just nonsense. commit ee2d4626dca6e0d4fc6f524e5de4bdefa2ed43df Author: Tormod Volden <bugzi06.fdo.tormod@xoxy.net> Date: Sun Nov 18 11:56:31 2007 -0500 Bug #12932: Use DEFAULT_DPI in randr1.2 instead of hardcoded 96. commit a46c30c3be33ffb304a885503c8aaa78396ed3d9 Author: Jernej Azarija <azi.stdout@gmail.com> Date: Sun Nov 18 11:44:36 2007 -0500 Bug #12531: RRModesForScreen can fail to allocate. commit fac7e7e4e1809e865b9b3cf5b7eb69ba9d3a3759 Author: Adam Jackson <ajax@aspartame.nwnk.net> Date: Sun Nov 18 11:39:26 2007 -0500 Document the requirement for interleaved code and declarations. commit bad96e5a864e40fbd47265d7fb6eaa67c55fac11 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Nov 18 15:02:24 2007 +1030 dix: getevents.c remove trailing whitespaces. commit 75e5e9f88c5f974d996dd81e672cd3709d361a44 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sat Nov 17 13:46:01 2007 +1030 Xi: add missing XI_DeviceClassesChangedMask to XI filters array. commit d15339a92c4d689d2ab8a86e4f10107f3e45eff8 Author: Adam Jackson <ajax@aspartame.nwnk.net> Date: Sat Nov 17 22:12:10 2007 -0500 Bug #9725: Don't look in root's $HOME for config files, that's just confusing. commit 748cfbc820f8cdeb544c54a6db495fecf2e2457b Author: Adam Jackson <ajax@aspartame.nwnk.net> Date: Sat Nov 17 21:23:05 2007 -0500 Disinfect mi/ of mfb. commit a969db091cab16a448f82782e85b3dd19c81627a Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 17 22:34:47 2007 +0100 XKB: Don't ring the bell when we don't have a BellProc (bug #13246) commit c89b543198d5ec56ff025bdd6bb7229523478e58 Author: Ben Skeggs <skeggsb@gmail.com> Date: Sat Nov 17 18:20:49 2007 +1000 exa: set driverPriv to NULL before it might get used later with garbage commit 514ba4ca727f0b1076bc67500617722203d34daa Author: Adam Jackson <ajax@aspartame.nwnk.net> Date: Fri Nov 16 19:53:11 2007 -0500 Bug #1612: Use a stronger PRNG. Currently just reads from /dev/urandom, and only on Linux. commit 12dd6e9911de187e0ebee86434e8c24a67c990f9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 16 17:23:09 2007 +1030 dix: reset MD's devPrivate classes to NULL before device initialisation. XkbInitKeyboardDefviceStruct may call FatalError if it fails. FatalError then cleans up all the devices, resulting in a segfault if the pointer is uninitialised. commit be3321c2e9fad228a9ee5fef47680a47bc9e39a4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 16 12:12:41 2007 +1030 dix: Free both current classes and original classes when closing an MD. commit 3c39dd19ec2a53b8854279e3b03131098031473a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 16 12:12:14 2007 +1030 Xi: Deep-copy full list of FeedbackClasses. All feedback classes are linked lists and the whole list has to be duplicated, not just the first entry. Xkb stuff still missing. commit 497862df2fcd67531fbe0f876c20a09884ee74df Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 16 11:20:22 2007 +1030 dix: explicitly float all attached SDs before closing down devices. Some drivers flush on shutdown, if our SD is still attached we'd be trying to route an event through a non-existing device. commit 9de1ebe2a80164507cbe2ef688f284225e0ec808 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 16 10:45:28 2007 +1030 dix: Fix up class restoring when last SD disconnects. Old code was fundamentally broken, fixes now are: - free the MDs current device classes - copy the device classes instead of flipping the pointers - check for the old MD, not the new one. commit 20fd4783247b1b93d9675dc36768dd1ed59ba2d3 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 17:01:33 2007 -0500 Small static cleanups on dix/ commit 70e50fa51f05663f289eeeea4521e737e8e24bca Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 17:00:37 2007 -0500 Allocate RRCrtcRecs with calloc. commit 8d0cd1cd2c57ee5a2fc4d577d8182d66369f0617 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Nov 15 12:16:36 2007 -0800 Fix a really dumb typo. commit f797c96845a3fab37cda6839ebecf9ac5401fd6e Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Nov 15 12:12:02 2007 -0800 Save pixmap allocation hints into the PixmapRec. commit 6bc50de02108f822977fc7545da81fce95ea7ff4 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 15:03:58 2007 -0500 Simplify system resource range setup. osRes only existed to get copied into Acc. Waste of effort. commit e1ff14a9246e12d42ce8ca5afbe3b957333a5620 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 14:45:49 2007 -0500 Delete some dead code in X -configure. commit 01cfba75229f4b9bf1e4fe80814931acdacde14c Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 14:27:03 2007 -0500 Nuke the debugging allocator. This has never been hooked up in the modular build, and can not possibly have built since before 6.7. Clearly no one's using it. commit c67b9c5fc33002b13a2360929a37f24169710f64 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 14:24:36 2007 -0500 Clean up some garbage in driver enumeration. commit 0706e5e790060fbf046cfaff295b78806b7841c6 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 14:15:09 2007 -0500 Eliminate some redundancy in autoconfiguration. We already synthesize Monitor and Module sections for you, no need to specify them explicitly in the fake config buffer. commit 2c01a49bf0a407bd5510bb9ceb4ef86a2cc36be9 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 15 13:32:59 2007 -0500 Don't sleep(1) at exit on any platform. commit 83926cb8bef6288b89e801c5e60b3f40e923e16e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 17:41:07 2007 +1030 Xi: Only alloc modifierKeyMap if <slave device>->maxKeysPerModifier > 0 Sometimes (e.g. on my debian ppc box) maxKeysPerModifier of the SD is 0. So we try to malloc(0), bringing the whole server down with a FatalError because it looks as if the malloc failed. This is bad, so only alloc if we actually have something to alloc. commit 070195dbf88eb121e65f802e023aa37ed1f2c2ac Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 16:27:18 2007 +1030 Xi: fix up sloppy class copying causing segfaults. commit 53539688cab990a7df1851d64f3ee4e11920a86b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 16:23:48 2007 +1030 dix: SetKeySymMap should alloc the map if dst doesn't have one already. commit b40646dc104fb03ea7cc0b27fae573aecaab486e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 15:43:44 2007 +1030 dix: Add FreeDeviceClass and FreeFeedbackClass for centralised xfree. Ensures that we only have one way of freeing a device class to avoid leaks in ChangeMasterDeviceClasses and other places. commit 4c9cc82fc4461d180ae2c2fbe50e7f98b0777f91 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Thu Nov 15 01:46:11 2007 -0200 For some reason "-nozap" appeared twice. Weird. commit 18833d648fd7e1a5e962b93636bbbb38aca9c454 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 12:13:59 2007 +1030 Xi: reset xkb-stuff to NULL after copying (DeepCopyDeviceClasses) Having two devices point to the same xkb stuff causes SIGABRTs. Also, don't init a MD's xkbInfo unless the SD has an xkbInfo. commit 1635832c1635374033686d3a943b77adbd60bb98 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 11:35:07 2007 +1030 Revert "xkb: disable xkb key repeats (temporarily)" This reverts commit 2b1d946392ce28b96941341778b2b526aa0fb126. commit b05246696d14bd35aa53b49302707b51206c72a6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 11:31:43 2007 +1030 Xi: free XkbSrvLedInfos as well when freeing an MD's device classes. commit c758e5a664a52045ad419340044beebb6774a336 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 10:47:20 2007 +1030 dix: Make sure core MDs copy their initial classes before they are used. Anything in dev->key, dev->valuator etc. of a MD must always be a copy of the original class. The intial classes of an MD (the ones set up before an SD is attached) as well, as we may have to restore them if no SD is attached anymore. commit a08665d4d3b0a7d567a90bb9bbfe4abafd6f3887 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 10:42:29 2007 +1030 mi: don't call SwitchCoreKeyboard, we switch during event processing now. commit 64711a094893e83764bbeda538c6e877ebe2af79 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 15 10:41:34 2007 +1030 Xi: When switching MD classes, make a deep copy instead of pointer flip. Turns out it's really really hard synchronising device state across multiple duplicated events if they all share the same struct. So instead of doing so, when the SD changes deep-copy all it's classes into the MD. The MD then has the same capabilities, but the state can be set separately. This should fix xkb, key state, repeat etc. problems. Updating the device state allows us to remove the SwitchCoreKeyboard from the event gathering, it's all done during event processing now. commit 3dde66f96b9b8431381871cf85266da3ec57a0d4 Author: Adam Jackson <ajax@redhat.com> Date: Wed Nov 14 15:10:59 2007 -0500 Start 1.4.99 commit c3897ca7099fc007b4134a8fabd4c707f99f2ac7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Nov 9 13:55:32 2007 -0500 Add -pogo option for init/teardown performance testing. commit cecac794451b793871f297b91a11d3b52eeb6d1b Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 8 17:25:36 2007 -0500 Don't sleep(1) at server exit. commit 1603130236c55ddabc3854d4ba62d544debcf1f5 Merge: f207e69 f7dd0c7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Nov 14 13:35:50 2007 -0500 Merge branch 'master' into XACE-SELINUX Conflicts: Xext/xace.c Xext/xace.h commit f207e69d62bc04c7f254347b03e6d8fa8b569d66 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Nov 14 12:23:29 2007 -0500 xselinux: adjust receive hook to use new synthetic_event class. commit cc4586df600af571815d5cdda2028c0d074c8469 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 14 14:27:52 2007 +1030 Xi: toggle the public.devPrivate as well when switching device classes. The master needs to have the same devPrivate as the slave, in case a client issues a request that goes down to the driver. Example: if a driver wants to ring the keyboard bell, it'll pick a keyboard. The KeyClassPtr will direct it to the matching method in the driver, but because the MD doesn't have the devPrivate set the driver segfaults. Even if all drivers were updated to not dereference the nullpointer, nothing would actually ever happen. To avoid this, we flip the master's public.devPrivate to the last SDs devPrivate. commit b44c1118f3bab6d5f28fa42e0c322fbaec005012 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 14 14:08:21 2007 +1030 dix: Return Success from ProcBell if no BellProc is set. We must not return BadDevice, this causes applications to crash. If no BellProc is set, just quietly do nothing and report a Success. commit 240b10fa9c32510a380a73a8acdd8267c81e538b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 14 12:18:08 2007 +1030 Xi: Move updating the device state from POE into separate function. POE now only deals with processing the event and calling the appropriate delivery methods. Actually modifying the device state is done in UpdateDeviceState. This separation should make it easier to avoid setting the state twice when master events are processed. commit 0bdfeb55fc559ffe0334df69ba6e9e711b26dc18 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 13 17:31:20 2007 +1030 Xi: remove RegisterPairingClient handling. Deprecated with device hierarchy. commit e96d926d64f7fb63f6bf2aa0ea0a8440a188947b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 13 17:14:35 2007 +1030 Xi: remove trailing whitespaces. commit 5031238aad2b6b7511aab0f9d15edfbdd2b4cce7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 13 16:58:23 2007 +1030 dix: remove trailing/wrong whitespaces from devices.c and events.c commit c703849e79391bb1bb01a994bb8d5cf2eb64e48b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 13 16:50:18 2007 +1030 dix: Attach spriteInfoRec to same memory block as the DeviceIntRec. No need to alloc a separate one, we never do anything special with it anyway. commit 51239f87ce42ad564ceee1761980391947294511 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 13 11:26:16 2007 +1030 dix: Send MappingNotify when keyboard maps change. If a slave device is attached to a master device, then we need to send a mapping notify to the client. Mapping notify needs to be sent if - different slave device but on same master - different master This gives you funny behaviour with the ClientPointer. When a MappingNotify is sent to the client, the client usually responds with a GetKeyboardMapping. This will retrieve the ClientPointer's keyboard mapping, regardless of which keyboard sent the last mapping notify request. So depending on the CP setting, your keyboard may change layout in each app... commit 2b1d946392ce28b96941341778b2b526aa0fb126 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 13 09:51:33 2007 +1030 xkb: disable xkb key repeats (temporarily) Haven't quite figured out yet how to make these repeats work. Because we share the class between devices, the key state is already set when we process the master device's event, causing a repeat on each event. commit f7dd0c72b8f861f4d5443a43d1013e3fe3db43ca Author: Matthias Hopf <mhopf@suse.de> Date: Mon Nov 12 15:11:03 2007 +0100 Only clear crtc of output if it is the one we're actually working on. Upon recreation of the RandR internal data structures in RRCrtcNotify() the crtc of an output could be NULLed if the crtc was shared (cloned) between two outputs and one of them got another crtc assigned. commit 70b4087c4dd1904d9d655f4afb9dfcea4f137f7a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 12 13:10:39 2007 +1030 dix: don't unconditionally update valuators during key events. Master may not have valuators, device may not have valuators. commit 23365d28651f7942fdafb889bcbbd019470a4274 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 12 13:08:38 2007 +1030 dix: allow grab modifier device to be NULL. This can happen if we check for a passive core grab and our device is a floating slave device. Doesn't really change anything as SDs can't send core events but it stops the server from segfaulting. commit 5a7a65a3c978a65e8ff39d0cc9878527ec42adc9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 12 12:37:39 2007 +1030 mi: avoid SIGABRT by setting master_event to NULL. commit a05f43bf3e9629df98e93c366d4327f20ed81e6c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 12 11:35:18 2007 +1030 dix: When the last slave is removed, set master to the original classes. DeviceClassesChangedEvent is sent to the client, where device == new slave. commit 45f884d79c0eebaa1eb24d7db76c1177f6b710c9 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Nov 9 14:45:27 2007 -0500 xselinux: add new synthetic_event security class, and fix registry code. commit b092856baba5bd43b23950f23236b5cc3ce78c1e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Nov 9 14:45:02 2007 -0500 registry: Register XC-SECURITY extension protocol names. commit 7a81bafc9bc7048560b17483e6addf58469a05d0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 9 23:10:24 2007 +1030 Xi, dix: Add ability to change MD classes + send event when doing so. Each time a different slave device sends through a master, an DeviceClassesChangedEvent is enqueued. When this event is processed, all classes of the matching master device are changed, and the event is sent to the clients. Next time the master is queried, it thus shows the evclasses of the last slave device. The original classes are stored in the devPrivates. TODO: if all slave devices are removed, the master's original classes need to be restored. commit c0a05805783ee3d38fbcc0fb45f4aa3c511785f0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 9 23:07:10 2007 +1030 Xext: add simple macro to easily check a generic event's type. commit f48087b6c33c1f84bf2cfc0744b1c38697321c07 Author: Kristian Høgsberg <krh@temari.boston.redhat.com> Date: Fri Nov 9 05:49:26 2007 -0500 Regenerate GLX dispatch code for recent gl_API.xml changes (#12935). commit f2a3728868376a3646832d4af3a29549ce0b8f5d Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Nov 8 18:49:05 2007 -0800 Patch to rootless code that should fix many crashes. Credit to Ken Thomases at CodeWeavers for the patch. From his description: Fix a display bug with the X server. The Generic Rootless extension installs overrides for certain GC (graphics context) operations. Within these overrides, they temporarily uninstall themselves, perform their work, and then reinstall themselves. Except sometimes they would return early and wouldn't reinstall themselves when they should. Now they do in all cases. Fix a bug in RootlessCopyWindow where early returns could leave the screen's dispatch table entry for CopyWindow unwrapped. We think that this is another case (hopefully the last) of the rootless drawing bug. commit 338c1aedbdf3964e542947140f7c50d58542cf12 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Nov 7 03:56:44 2007 -0800 formatting fixes commit bd269d0d783d418ef99363478fdf849fd89eed76 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Nov 7 03:55:08 2007 -0800 Fix for off-by-one error in menu bar height calculation -- props to Nicholas Riley! commit b4d14484056e6f4a7374fc1acf3f223be4bd116f Author: Ben Byer <bbyer@bbyer.local> Date: Wed Nov 7 03:10:52 2007 -0800 Undo some last-minute breakage in xpr.h commit 05d5b9baa05a4ba14a4383d8a981bc327d99290c Author: Ben Byer <bbyer@bbyer.local> Date: Wed Nov 7 02:28:49 2007 -0800 removed debugging output commit 9a8abcfa6d6d0cdc17be02a3443a7e116eb07d07 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Nov 7 02:22:39 2007 -0800 Fixed focus problem (clicking on an X11 window that sits behind an Aqua window would not always bring it to the top of the stack. commit b34d2ffc38002f7c4980c138f57e9a828cd79c37 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Nov 7 01:56:37 2007 -0800 formatting changes. commit 50dac9b2cb3b40810fb79253adc0265a838a497b Author: Ben Byer <bbyer@bbyer.local> Date: Wed Nov 7 01:35:48 2007 -0800 Fixed Spaces issue, correctly -- dragging an X window from one Space to another in Expose mode now works. commit ce7cfbe261b7fd4fcd09d1a4a61344d1555a71f2 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Nov 8 20:10:51 2007 -0800 Fixed check to refer to DarwinApp, not all Darwin targets commit d68bd5510437c1fd3850e020f7cd90901fae8e1b Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Nov 8 20:08:49 2007 -0800 fixing GLX in Xquartz commit a6ac9002956767fefa37aac95513e21ac5246d15 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Mon Nov 5 20:25:10 2007 -0800 formatting cleanup commit 67e96be13cdb45be31db121ce216295cd9496d20 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Mon Nov 5 20:01:34 2007 -0800 Fixed logic error that prevent JIS (Japanese) keyboard layouts from being detected. commit 154fb6417e5d0bae5191984beac5ce045ce754bb Author: Ben Byer <bbyer@bbyer.local> Date: Sat Nov 3 05:34:19 2007 -0700 Initial support for Spaces -- if you use Expose to drag an X11 window to another Space, it will work correctly (as opposed to just leaving a ghost window). We accomplish this by listening for the notification from Xplugin that our window has been moved, and then we ask X11 to move the window to the new location. commit 5bbc468b702f62d7c91d41aabcc27eeb553f6959 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 9 11:33:27 2007 +1030 dix: grabbing an attached SD sets it floating for the duration of the grab. commit 676b26ca3e9b142cf007af3f439aa1993f2247c4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 8 17:54:17 2007 +1030 Xi: notify the clients when the device hierarchy has been changed. commit cb75f09146a3c17b1a67b636bbf7229c65c83b35 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 9 11:29:18 2007 +1030 dix: calloc root window's Generic Event mask, stops segfaults. commit 169f83e366f678ac5441ad21beb84c9b8c65d28e Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 4 19:14:10 2007 -0800 Disable deferred updates in xp_init to fix performance problems -- thanks to Eric Gouriou for pointing out the issue commit 1c6cb353f77747c101ce47716ff1fa055fbf85a4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Nov 8 16:46:49 2007 -0500 Restore the XC-SECURITY option in configure.ac, but disabled by default. commit 9d03cad1446c27b397c198cf6247e71e46bc9e6d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Nov 8 16:41:47 2007 -0500 Remove SecurityPolicy file and associated references in the manpages. commit 8b5d21cc1d1f4e9d20e5d5eca44cb1e60a419763 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Nov 8 16:32:42 2007 -0500 Rework of the XC-SECURITY extension. The gen-auth protocol has not changed, but the XC-QUERY-SECURITY-1 authorization method and the SecurityPolicy configuration file have been removed. The semantics of the trusted vs. untrusted split have been changed. This will be documented in a future commit. commit 476a9d85f819f454a6901ccb7eb028d1c563c341 Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Nov 8 09:11:05 2007 +0100 Xephyr: do not AM_CONDITIONAL inside a shell if branch commit 59b304d8a24fecd094296feb217823f0c73d6f82 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 8 15:44:18 2007 +1030 dix, mi: stop segfaults when a floating device emits events. For pointers: don't try to set master->valuator fields if there is no master. For keyboards: check if device is valid before trying to access the fields in miPointerGetScreen (btw. this disables DGA events for floating keyboards). Also stop the hideous number of ErrorFs if we request the paired device for a floating dev. commit 3063f0c6679bdbea13f360cff8d09a88b9871da9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 8 11:51:03 2007 +1030 mi: change the device id to the master devices' when duplicating the event. Move the event duplication into a CopyGetMasterEvent(), makes the code a bit better to read. commit 0e9ef65fa583bf2393dd0fda82df6f092387b425 Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Nov 7 16:33:10 2007 -0800 Don't frob timers unless SmartSchedule is running commit 180220f284823c486e7001ef00f1279dc548c9c7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 8 10:00:35 2007 +1030 Xi: return BadDevice for slave devices on ProcXSetClientPointer Also clean up to return error codes instead of sending the error manually. commit 184a7b8917a15bb2c719153b9b016c03aab42101 Merge: a8808ac 0b72905 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 8 09:34:35 2007 +1030 Merge branch 'mpx' into mdsd Conflicts: Xi/opendev.c commit e94ab0b502160376d1956345196f7e1c7e2e886f Merge: 26e1fc7 9bee1c6 Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Nov 7 19:04:24 2007 +0100 sync with 'master' commit 9bee1c6912817f65bbb8cf4078f0ad016d9d51cb Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Nov 7 18:56:45 2007 +0100 EXA: Disable problematic optimization of dest pixmap migration by default. Also add some code comments about these optimizations. commit 26e1fc7b42de850d69fba89703ffddd36480b997 Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Nov 7 18:48:23 2007 +0100 Xephyr: don't use Xv or GL when those are disabled. commit 950f9995d11aff2c51139b34fb27eba594f2bd20 Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Nov 7 18:43:16 2007 +0100 Xnest: fix lib dependancy to make libtool happy This fixes an undefined symbol error happening when compiling the server with the --disable-xv configure switch. Basically, xnest was linking against @XSERVER_LIBS@ and @XNEST_LIBS@ and the order of the libraries given to the linker at the end of the process was bogus. * configure.ac: make XNEST_LIBS contain the $XSERVER_LIBS re-ordered in such a way that the linker finds the symbols of all the libs contained in $XNEST_LIBS. * hw/xnest/Makefile.am: don't link against @XSERVER_LIBS@ anymore because XNEST_LIBS contains the right thing. commit 0b729051c04da7068f1e6dd319190bd0a362b2c0 Merge: b7ee005 d7c5e8b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 7 15:37:23 2007 +1030 Merge branch 'master' into mpx Conflicts: Xi/extinit.c Xi/grabdev.c Xi/setmode.c Xi/ungrdev.c dix/devices.c dix/events.c dix/getevents.c include/dix.h mi/midispcur.c mi/misprite.c xkb/xkbActions.c xkb/xkbEvents.c xkb/xkbPrKeyEv.c commit e717409bae355df9a617a226f12fbb8c54ae77e5 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Nov 6 21:36:13 2007 +0000 DIX/getevents: Document GetMaximumEventsNum() a little better Note that the number returned by GMEN can _never_ change, and be a little more explicit about the figure for repeats. commit 66fe554a59bb7de37354b618945cd5f30d78250d Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Nov 6 18:57:09 2007 +0000 COPYING: Collapse 'canonical license' into one statement For a few of us, the license statement is identical, and the only variant is the copyright. For these, aggregate the copyrights, and only list the license once. Put this at the top, and note that this is more or less our agreed canonical license. commit fda832772b3e630037bf1b822534996154a50861 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Nov 6 15:05:06 2007 +0000 .gitignore: Ignore build directories Ignore directories people might use for building. commit 512bac25ec0e980968b93a2ebe88bd89bf99b697 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Nov 6 14:52:03 2007 +0000 DIX: XKB: Set xkbInfo to NULL as well as freeing it (bug #10639) XkbRemoveResourceClient wants to access xkbInfo if it exists, so make sure we NULL it after freeing it. It doesn't make much sense to move the RemoveResourceClient call first, as there's not much point in notifying clients while we're shutting the server down anyway. commit a8808ac3d093f33b39de109107d396fe0a02c4fc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 7 11:42:58 2007 +1030 Xi: don't call CheckMotion for slave devices. This essentially disables enter/leave for slave devices, but re-enables them for master devices. Which is a good thing after all. commit 15944b8f02752eedd61be34a6a29dd6b82a0ac97 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 7 11:33:24 2007 +1030 mi: duplicate event before processing it, so master has original values Event values may get changed in the event processing stage, so we need to duplicate it to pump different events through for slave and master device. commit d7c5e8bfc1aecbd23a4cbb2eab08656587aac2e8 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 6 16:26:09 2007 -0500 Modified performance patches from Arjan van de Ven <arjan@infradead.org> Subject: [PATCH] fix some performance gaps in Xace The XaceHook function is used in several hotpaths. The problem with it (performance wise) is twofold: * The XaceHook function has a big switch() statement for the hook number in it * The XaceHook function uses varargs to reassemble the final dispatch arguments again Both are expensive operations... for something that is known at compile time This patch turns the hotpath XaceHook call into a direct call to avoid the switch and varargs; this gives me over 10% performance gain on the x11perf benchmark. commit aaa50b64113b122aaebd46e3b78e3fb7a8d70500 Merge: 868e303 ddce48e Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Nov 6 16:25:40 2007 +0100 resync with 'master' commit 868e303630d8b84070c2f1fd8d6da2cef045b029 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Nov 6 16:24:46 2007 +0100 Xephyr: fix a crash when using xrandr twice * hw/kdrive/ephyr/ephyr.c: (ephyrScreenFini): don't forget to free shadowfb data (if necessary) upon server is reset. commit ddce48ede036f3996f8e584b0012c396c5df42fb Author: Elvis Pranskevichus <el@prans.net> Date: Tue Nov 6 09:40:14 2007 +0000 Config: D-Bus: Fix dbus_bus_request_name failure check The code in connect_hook incorrectly checks for dbus_bus_request_name failure. The dbus_bus_request_name error indicator is -1, not 0. This leads to subsequent assertion failure in libdbus. commit a52c9b2a59f27266557ff9d5d2c08492e04135a6 Merge: c7e18be 5833289 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 5 19:08:36 2007 -0500 Merge branch 'master' into XACE-SELINUX Conflicts: dix/dispatch.c dix/property.c hw/xfree86/common/xf86VidMode.c include/xkbsrv.h render/glyph.c xkb/xkbActions.c commit 58332894c061ae96d6a457f65266660f5f65e88b Author: Adam Jackson <ajax@redhat.com> Date: Mon Nov 5 17:17:25 2007 -0500 Export the server ABI versions from xorg-server.pc commit c7e18beb3c87eb1ada9b21c4ffacd11c1939c087 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 5 15:01:13 2007 -0500 xselinux: Register SELinux extension protocol names. commit 632c33c5c18b3e091c4fce98280af4d583e99640 Merge: 4113f04 dda10c9 Author: Dodji Seketeli <dodji@openedhand.com> Date: Mon Nov 5 17:52:33 2007 +0100 pull 'master' commit 4113f040c587fc536adc693d7ee5a4c0a60b75d4 Author: Dodji Seketeli <dodji@openedhand.com> Date: Mon Nov 5 17:33:01 2007 +0100 GL: fix crash at mesa destruction time * GL/glx/glxglcore.c: (_glXMesaScreenDestroy): delete the same amount of visuals that those which were created in createMesaVisuals(). commit dda10c9066a660b647384179f82e1da8e063264f Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 16:28:35 2007 +0000 Remove all traces of external RGB database (and Speedo) Remove all references to an external RGB database (which hasn't been enabled for a very long time). Also get rid of some references to Speedo fonts. commit 6ff79ea5f7d3ff0c3b14e39849514784ccd40190 Author: Dodji Seketeli <dodji@openedhand.com> Date: Mon Nov 5 16:46:49 2007 +0100 Xephyr: fix some DRI build breakage commit 5e363500c86042c394595e1a6633581eb8fcd1bb Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:38:28 2007 +0000 OS: Remove ALLOCATE_LOCAL from os.h Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and remove the include of Xalloca.h as well. commit 83e5d9e75d0fa1135e2c9d8b59caee98c3291681 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:36:54 2007 +0000 DIX: Remove last alloca call Replace with heap allocations. commit 1179ddea94efae6606162e9a1b0f2bf752ae4dd0 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:36:36 2007 +0000 EXA: Remove usage of alloca Replace with heap allocations. commit 1eb6a1d0d2817cd0ce96fb27db3ceb2d0ff024af Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:18:35 2007 +0000 XTrap: Remove usage of alloca Replace with xalloc/xfree. commit 934281126f6c602fa4bd0c2e29d8c9f44fe532b8 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:18:22 2007 +0000 Xext: Remove usage of alloca Replace with heap allocations. commit fb32bb9839b615f7297fbfac2050bc216682f01c Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:17:54 2007 +0000 Xi: Remove usage of alloca Replace with xalloc/xfree. commit 683ee1776d172035c465aa8fc84ccd53bb8ba7fd Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:14:25 2007 +0000 afb: Remove usage of alloca Replace with heap allocations. commit ca75261beedc3e00767b3812a81b7dac4437f4a1 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:14:04 2007 +0000 cfb: Remove usage of alloca Replace with xalloc/xfree. commit 914922fd6100a409a3dfd1c64511ed6bdc344bef Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:12:59 2007 +0000 DIX: Remove usage of alloca Replace with heap allocations. commit 3b77689266e729411229ec83d2a90578ebc1d82f Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:12:34 2007 +0000 EXA: Remove usage of alloca Replace with heap allocations. commit 34cdf06e4ccb243664005cc33009d8759a7f6e4d Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:12:22 2007 +0000 fb: Remove usage of alloca Replace with heap storage. commit 733d42065f2c24505b3874ce51c18f6063c2b67e Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:11:59 2007 +0000 XFree86: Remove usage of alloca Replace with heap allocations. commit caf545063457591f88e1f7bcd25dbd0342f44343 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:10:55 2007 +0000 KDrive: Remove usage of alloca Replace with heap allocations. commit d57060f16714f5667722001bd1a4500059dd59e1 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:10:21 2007 +0000 DMX: Remove usage of alloca Replace with heap allocations. commit def6f74f2d7342f85f3df2053e0b9c1ac483b51d Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:10:03 2007 +0000 Xvfb: Remove usage of alloca Replace with heap allocations commit 259f4c36d581896ce605741b9e557a589013a9b8 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:09:49 2007 +0000 Xprint: Remove usage of alloca Replace with heap-based allocations. commit 1c84337af0ac40498a53aa36289e2f6f5ff8b1c6 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:09:32 2007 +0000 Xwin: Remove usage of alloca Replace with heap allocations. commit f7d5c292e44113ea8eb32e67e91cd02e520df5e3 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:09:14 2007 +0000 mfb: Remove usage of alloca Replace with heap-based allocations. commit be9ee17f960cc3d8a8f999cab1579e83d9aea520 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:08:51 2007 +0000 mi: Remove usage of alloca Replace with heap allocations. commit 3633ae6efb57c5405c26e8ae132b9371e5f920de Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:04:27 2007 +0000 Damage: Remove usage of alloca Replace with heap allocations. commit 2761c103311a1160bc483fd0367d654733df8598 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:03:26 2007 +0000 OS: Remove usage of alloca Replace with heap allocations. commit 2d738efb959912d8a89864e41190e0064fa77906 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:01:11 2007 +0000 RandR: Remove usage of alloca Replace with heap allocations. commit 3c1d2fdeff0ed61d86fa7d35cb0a61535d9b2816 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:00:40 2007 +0000 Record: Remove usage of alloca Replace with xalloc/xfree. commit e0491f470e130147191388168e878e3a7348afaf Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 13:59:51 2007 +0000 Render: Remove usage of alloca Replace it with heap-based allocations. commit 59774af86b851c7fb8989cef6c013522549000b8 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 13:59:15 2007 +0000 XKB: Remove usage of alloca alloca has no way to return failure, and instead can possibly arbitrarily overflow the stack. Let's avoid that one. commit 6e4f5cf83f35ffebb51633ab30b1826e63e37223 Author: Ben Byer <bbyer@bbyer.local> Date: Mon Nov 5 05:53:34 2007 -0800 changing ALLOCATE_LOCAL to xalloc to prevent stack overflow commit b1764ddf133cfdf979db62ee2491124a4798b55b Author: Ben Byer <bbyer@bbyer.local> Date: Mon Nov 5 05:44:54 2007 -0800 pulling more patches over from xorg-xserver-1.2-apple branch commit 10fde62fc88302f7d3b2546239b1679be249567c Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 4 18:59:41 2007 -0800 more CVS tags commit 27ecb89250398f45564fe454e20bfdd66f62c8e4 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 4 18:53:41 2007 -0800 Removed CVS tags. commit f2e310132fbe1520c1b5f3da4faa2d2d47835e72 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Oct 31 14:15:35 2007 -0700 Add CreatePixmap allocation hints. These hints allow an acceleration architecture to optimize allocation of certain types of pixmaps, such as pixmaps that will serve as backing pixmaps for redirected windows. commit 3f1b6765aadf665ede8253464da19a5878f16e56 Author: Markku Vire <markku.vire@movial.fi> Date: Thu Nov 1 22:43:04 2007 +0200 Config: HAL: Touchpads are pointers too Treat touchpads -- not just mice -- as pointer devices. commit 41c3069f7cf28155f8e6cfe0c10a12a1f5f76c7d Author: Mark Vytlacil <mrv@wi.rr.com> Date: Thu Nov 1 21:05:43 2007 +0200 XFree86: Input: Save/restore errno around SIGIO (bug #10683) Make sure errno is saved and restored from the SIGIO handler, so errors from system calls in input handlers don't break the interrupted code. commit ff9929ed48f2dec8b536d348e25e66a0bc4ac1a6 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 4 05:13:19 2007 -0800 pulling in changes from xorg-server-1.2-apple branch commit 181468db92d44a58080fc9a76e46dfc7011bf9f1 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Nov 4 04:50:26 2007 -0800 add missing null-pointer checks commit 4d0f35c81df307609b29c0f12aa1b4c6ee6fd8d2 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Nov 2 19:27:32 2007 +0100 Always duplicate mode name when duplicating a mode. If the originating mode didn't have a name, we would end up with the name of the original mode being setup correctly, but with the name of the copy still being NULL. commit dfb1cce28ac07d412598f7b9ab2ee908978b38e7 Author: Adam Jackson <ajax@redhat.com> Date: Fri Nov 2 12:51:56 2007 -0400 Restore build of xf8_16bpp. It doesn't link against cfb, so don't conditionalize its build against cfb. commit 7a0555e9bb59d02816803a1100f807d2d29f31d4 Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Oct 28 09:37:52 2007 +0100 Fix crash in xf86InitOrigins() In a multihead setup, if only the first screen can be initialized, but the second screen is mentioned first in the ServerLayout section, the xf86InitOrigins() function will crash because the screen referred to in the e.g. "RightOf" part is non-existent. commit 5b41d4e60be35cfb96bedec0931fd5922823b4b9 Author: Adam Jackson <ajax@redhat.com> Date: Sun Oct 28 09:37:52 2007 +0100 Don't filter modes away during VBE mode list construction. Pass all VBE modes back up to the driver, on the assumption that it knows how to filter modes intelligently. commit c095da04fe7c73b6503ef5b93549b13796c51b22 Author: Adam Jackson <ajax@redhat.com> Date: Sun Oct 28 09:37:52 2007 +0100 Fix magic number in fbdevhw The transformation between fbdev and xfree86 mode timings needs to be invertible, otherwise Xen and other framebuffers that don't have real pixel clocks won't initialize. commit f4fe66f6767d1941317dc0280ac359421a152587 Author: Adam Jackson <ajax@redhat.com> Date: Sun Oct 28 09:37:52 2007 +0100 Disable explicit commenting in Monitor section. commit 22f0e3a8b04e574047a51c8f928a007787303294 Author: Adam Jackson <ajax@redhat.com> Date: Sun Oct 28 09:37:52 2007 +0100 Avoid PS/2 protocol probing for /dev/input/mice The kernel will always upconvert to ExplorerPS/2 for all readers of /dev/input/mice, so don't waste time on startup trying to figure that out. commit b97518666dc32710fe69eee33ee56881dcff1bbc Author: Adam Jackson <ajax@redhat.com> Date: Sun Oct 28 09:37:52 2007 +0100 Fix accidental ABI usage in RANDR 1.2 drivers. Due to RANDR 1.2, xf86findOptionValue and xf86nameCompare are now ABI. Make sure they're exported from the server. commit f01e149d1af14ef9ee0e8a6743ab6a08f3bb677c Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 1 15:41:11 2007 -0400 Move SIGUSR1 notification as late as possible. If we inherited a signal mask from the parent process that ignores SIGUSR1, then we will send SIGUSR1 to the parent to indicate when we're ready to accept connections. Unfortunately, we send this notification way too early, right after creating the sockets rather than just before entering the main loop. Move it to just before Dispatch() so we're not lying quite so much. commit a2ee5fe0c4e863c7ff4f644e5ac86f2793903103 Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 1 13:46:20 2007 -0400 Enable MIT-SHM in Xdmx. The extension is entirely DIX-level, no new DDX changes needed. commit 2338d5c9914e2a43c3a4f7ee0f4355ad0a1ad9e7 Author: Arjan van de Ven <arjan@linux.intel.com> Date: Sun Oct 28 09:37:52 2007 +0100 reduce wakeups from smart scheduler The smart scheduler itimer currently always fires after each request (which in turn causes the CPU to wake out of idle, burning precious power). Rather than doing this, just stop the timer before going into the select() portion of the WaitFor loop. It's a cheap system call, and it will only get called if there's no more commands batched up from the active fd. This change also allows some of the functions to be simplified; setitimer() will only fail if it's passed invalid data, and we don't do that... so make it void and remove all the conditional code that deals with failure. The change also allows us to remove a few variables that were used for housekeeping between the signal handler and the main loop. Signed-off-by: Keith Packard <keithp@koto.keithp.com> commit 692654b4300e61a9481e6fa588bcb44a3c3ca150 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Oct 29 18:13:58 2007 -0400 Set up visuals for the existing X visuals. This makes the root visual a GLX capable visual again and adds a GLX visual for the COMPOSITE ARGB visual cleanly (as opposed to the hack we had before). commit a5546a99ac4da61aee0d49c55bcb38bbce9a96aa Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Oct 29 18:06:41 2007 -0400 Change the GLX module to initialize after COMPOSITE. This changes the module initalization order so that the GLX module initializes after COMPOSITE. The reason for this change is to be able to initialize a GLX visual config for the COMPOSITE ARGB visual. commit 8ead41388e36e21eea6fa0408c847f174911eab0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 18:57:00 2007 +0930 xfree86: wrap keyboard devices for XKB. Call ProcessOtherEvents first, then for all keyboard devices let them be wrapped by XKB. This way all XI events will go through XKB. Note that the VCK is still not wrapped, so core events will bypass XKB. (cherry picked from commit d627061b48ae06d27b37be209d67a3f4f2388dd3) commit e717cf08e99746761d74289c426bbd84176f4435 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 27 21:32:47 2007 +0300 XKB: Cope with all events in XkbProcessKeyboardEvent Cope with Xi and pointer events in the (now increasingly misnamed) XkbProcessKeyboardEvent. If it's the wrong type, call through the wrapping chain to get out; else, process it. commit 9db8846fa53d91193bbfe541b244e2326440011d Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 27 21:31:39 2007 +0300 XKB: Don't update indicators on all devices, add missing include file Don't get XkbUpdateIndicators to update the indicators on all our devices: we already deal with that ourselves. Add exevents.h include to get more (proto)types. commit ee3aa948eb8ed181d037294ed87df6ceec81684e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 18:04:59 2007 +0930 xkb: Unwrap properly in ProcessPointerEvent. Instead of hardcoding CoreProcessPointerEvent, actually try to unwrap properly and then call the unwrapped processInputProc. Seems to be a better idea, especially since it makes stuff actually work... (cherry picked from commit 8f9bf927e1beecf9b9ec8877131ec12c765e4d84) commit d3588a0aee33fbd233082f881c0d37152c6d4d8b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 27 11:44:03 2007 +0930 xkb: xkbHandleActions: let wrapping take care of event delivery. This is hopefully better than hardcodey calling CoreProcessPointerEvent. (cherry picked from commit 32d0440c7f6e604807cb14dd32349df6f22c903b) commit 352c5a311200bf491153fe9ef16126c5877a57bb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 12 17:40:11 2007 +0930 dix: don't compress motion events from different devices (EventEnqueue) (cherry picked from commit 8840829ab93c4eb62eb58753c015da5307133fe5) commit 8d3d027062c105b50863dce43b8070ec560bc12e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 18:52:02 2007 +0930 dix: add XI event support to FixKeyState. FixKeyState needs to be able to handle XI events, otherwise we get "impossible keyboard events" on server zaps and other special key combos. (cherry picked from commit 5ee409794ee604fcf84886f70429fc2d6b1ff4f1) commit 99e826e867c1c5520153c539ba07a884aec88d0c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 18:49:57 2007 +0930 xkb: enable XI event processing for xkb. XI events can now take the same processing paths as core events, and should do the correct state changes etc. There's some cases where XKB will use KeyPress as type for an event to be delivered to the client. Stuck warnings in, not sure what the correct solution is yet. (cherry picked from commit 6334d4e7be18de5f237c12a6dc20f75aa23477d0 with some additional compile fixes and non-MPX adaptations) commit 91077bfc50d54be37c217e377c55b6bf886a2fab Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 21 18:24:30 2007 +0930 Save processInputProc before wrapping it and restore it later, instead of using a hardcoded ProcessKeyboardEvent. Otherwise we lose the ability to process DeviceKeyEvents after the first key press. This should be the correct fix now. (cherry picked from commit 4d5df14f2c4a3108a8c8adfcf4766c0d1a9daad2) commit 8b9481a113b56078191e2298bf590905978f6289 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Sep 4 17:44:51 2007 +0930 xkb: Store the action filters per device in the XkbSrvInfoRec. Using a global array for action filters is bad. If two keyboard hit a modifier at the same time, releaseing the first one will deactivate the filter and thus the second keyboard can never release the modifier again. (cherry picked from commit bfe6b4d2d9952a80f8dbc63eec974ef894e5c226) commit 493b83bd097372ae0023da9919da83af39e3fc1c Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 27 21:33:52 2007 +0300 XFree86: Remove ridiculous SIGIO debugging YOU PRESSED A KEY AND AGAIN YOU RELEASED A KEY AND AGAIN YOU PRESSED A KEY AND AGAIN ... not so much. commit a3d48de5f2b7eacf3193c60f0fb461912201210b Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 27 21:35:31 2007 +0300 XKB: Add more bits to xkbsrv.h Add the device private index, given we use that in a macro here, and also the prototype for xkbUnwrapProc, since that's also useful. commit e29e69960d67aa4b7a4d1551af509dbac193f438 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 27 21:34:22 2007 +0300 Xi: Include XI protocol header in exevents.h Make sure we have all the types we need to use this header. commit df57ae1639ba4f1719883c5bf868394e4748a022 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 28 15:46:26 2007 +0200 configure.ac/XFree86: Only build XF86Misc and XF86VidMode when appropriate Don't build XF86Misc or XF86Vidmode in hw/xfree86/dixmod when it's been explicitly disabled in configure, or we don't have the proto modules installed. commit 3b7af72fe315c7c26c89838c0c5dacbe58765d0f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Oct 26 20:32:10 2007 -0400 xselinux: Add a SetDeviceContext request and stubs for more requests. commit 2251572062b2c25643671b8d5070de1c3f7ae976 Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Oct 26 15:13:50 2007 -0700 Restore the CompositeGlyphs -> ps->Glyphs -> miGlyphs callchain to allow acceleration architectures to wrap above miGlyphs. commit 497aba894904b08b15bb19916e2a163f96212a7d Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Oct 26 11:25:57 2007 -0400 Weed out some unused fluff from __GLXcontext. commit 0e749ceab421d72b48e18292c5ca0e337baf5ce8 Author: Bernardo Innocenti <bernie@codewiz.org> Date: Sat Oct 20 20:31:57 2007 -0400 Include stddef.h for size_t. This is required by a buggy version of the openssl/sha.h header which is distributed with Fedora 7. commit 80d8a3e1767609a92b0b85a7e92cea5f0748038a Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Oct 26 10:19:57 2007 -0400 Quiet glx visual debug info. commit 27b13eeb56a5cbac00b381309604505002e77228 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Oct 26 13:15:07 2007 +0200 Nuke superfluous ",", added missing include for xf86i2c.h. commit 6d59bb5709a99ab60b482bbf3393ebffda7f9407 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 26 09:12:15 2007 +0300 XFree86 Misc/VidMode: Remove ridiculous debug ErrorFs When we're building with --enable-debug, don't emit an ErrorF every time a function gets called. commit 5f9095f0d29bac0190d82c87a09cf32d6a34c17c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 25 19:02:03 2007 -0400 registry: Remove synthetic bit from event types in lookup function. commit 8c6923018c7d71cd15d9cf4ef9e8528ef5ec7c2e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 25 19:01:29 2007 -0400 xace: Add a "manage" access check when setting the Redirect event bits. commit 7d14ca59c5b942c09feaa2429c394cde9d8d3fd1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 25 19:00:50 2007 -0400 xselinux: Don't include the client in the receive hook audit messages. commit f62277d421023b3150d3a1accb00a8206ab2bde3 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Oct 25 18:48:39 2007 -0400 Clean up unused pVisual part of __GLXcontext. commit 30bcaa966d6b00f1630609a78db18dee683cc43d Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Oct 25 18:48:06 2007 -0400 Make glx destroy path handle cases where the X window goes away first. commit 40de9fcf18930811dd5ae355c83275af887a9f83 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 25 12:35:01 2007 -0400 xselinux: Label the default device directly with the process context. commit b633d54b94d746d26e13014634d9f63bbb7e8f7d Merge: 4b05f19 48ca596 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 25 12:19:30 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: GL/glx/glxscreens.c hw/xnest/Screen.c render/glyph.c render/glyphstr.h render/render.c commit 242f56f722243938e908d1957781ee53c2999783 Author: Naoki Hamada <nao@tom-yam.or.jp> Date: Thu Oct 25 18:45:50 2007 +0300 Input: Fix key down test (bug #12858) Fix the botched previous key_is_down test, which would give false positives. Also move key_autorepeats to a separate inline function. commit 4b05f19cb9e42d8c8eff5ca4e463f5bc2a05433d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 24 19:59:58 2007 -0400 xselinux: Introduce a type transition when labeling events. commit 0d2ef187e77b12713d2a9661932fa01dba58a945 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 24 18:23:31 2007 -0400 xselinux: Add audit message fields for selection and event names. commit 48ca5961caee62f2980017a6bdc96a1b4c747727 Author: Matthias Hopf <mhopf@suse.de> Date: Wed Oct 24 20:31:51 2007 +0200 Prefer configured DisplaySize to probed DDC data, if available. Based on patch by Hong Liu <hong.liu@intel.com>. commit 0388a59a6ef212c497cc3f64d677b1ca5b410982 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 23 20:59:21 2007 -0400 Revert "registry: special case minor number when looking up core requests." This reverts commit 31110d6837ee52fd654729d9e5c4b0c5395abab0. This is handled properly by StandardMinorOpcode(). commit 46521f529841e032e198e5df87974088548a68de Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 23 20:58:48 2007 -0400 xselinux: Add basic support for selection access control and redirection. Probably not fully baked yet. It's difficult to test since so few apps actually follow the ICCCM with respect to cut & paste. commit b7ee005d327372c1e414ee6c526f9f7aee14bc86 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 24 10:26:12 2007 +0930 dix: Don't interfere grabs the interfering device is of different type. A pointer device should be able to send events while the client has a core grab on a keyboard device, and likewise. commit 02508614b9f882ba1559fb4581dcf812118fdf89 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 24 10:09:18 2007 +0930 dix: check for core passive grabs on inferiors when replaying events. commit 825f09dffd94cfcd0562a01c5181998503851461 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 23 17:12:57 2007 -0400 xace: Still more changes to selection code. Removed the SelectionPtr from the hook - the hook only needs the Atom to control access to the selection object. Upgraded the SelectionCallback to take a client argument and additional type codes so that it can be used for redirection. commit 660557593ea961948722298ea8ffba83891c9914 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 23 14:46:37 2007 -0400 xselinux: Remove synthetic bit when looking up event type. commit d7db549db41a27aef28cff9bfb7973bc741f88b2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 23 14:08:54 2007 -0400 xselinux: Unregister callbacks on server reset. commit 9e0a468af19d8e46330bcff37c9adc5e11d3aee7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 23 13:35:30 2007 -0400 xace: try to pretend events were sent when a denial occurs. Probably need to redo the error return paths in these functions at some point. commit d502521c3669f3f22b94c39a64ab63bfd92c6a97 Author: Pierre Willenbrock <pierre@pirsoft.dnsalias.org> Date: Tue Oct 23 16:45:13 2007 +0200 EXA: Fix off-by-one in polyline drawing. commit a8a148919b84a293e3e7a49409ab833590357edb Author: Matthias Hopf <mhopf@suse.de> Date: Tue Oct 23 16:23:28 2007 +0200 Superfluous ','. commit 75f05086d04a90c3dcdcdd31bf79d7033708e3e0 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Oct 23 15:39:23 2007 +0200 Get rid of unnecessary GNU extended variadic macro. commit 7ef863720dc79107fc2cd17ce684366c87e001a4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 23 17:28:03 2007 +0930 dix: Create new sprite for floating devices. Floating devices get sprites, but still aren't spriteOwners. This prevents them from getting rendered, and also stops segfaulting. (not really solving the problems with keyboards though) commit d808d653d1fc16f1d5af76ab00fa862fb80fa3ba Author: David Nusinow <dnusinow@debian.org> Date: Mon Oct 22 21:30:04 2007 -0400 Define PCI_TXT_IDS_DIR more cleanly commit 29e0e180729a4f0cc020985a4de4c8bc4b9c7f5f Author: Keith Packard <keithp@koto.keithp.com> Date: Mon Oct 22 13:38:16 2007 -0700 Leave hardware-specified preferred modes alone when user preference exists. Instead of removing the preference bit marking the hardware declared mode preference, leave it in place and just move the user preferred mode to the front of the list while marking it with the USERPREF bit which will cause it to be selected by the initial mode selection code. commit fbe19c66c36acfb484809111cf02579a3baf2f0f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Oct 22 18:28:03 2007 +0200 GLX: Fix leak of X pixmaps associated with GLX pixmaps. commit c6d36b1cee44a9cbb690dff62a4683d7f6fbf30c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Oct 22 18:28:03 2007 +0200 GLX: Don't crash on unused client array members when switching to/from console. commit be9b0e558d6172ef01ed880d47da897d2ceb25fa Author: David Nusinow <dnusinow@debian.org> Date: Sun Oct 21 23:49:14 2007 -0400 Add a note as to why the text file based PCI ID scheme is present at all commit b79b965bd9a96f79781e85c0428068caa1ba381b Author: David Nusinow <dnusinow@debian.org> Date: Sun Oct 21 23:46:54 2007 -0400 Fix compilation issue on FreeBSD (bug #12841) Hide getline call by checking for glibc. If not, use fgetln instead. Even though this section is now #ifdef'ed for linux only, this should help make it more portable if non-linux folks end up wanting it. commit 7f5e71fa7347fb4ec2657ccc453831c04a0f288d Author: David Nusinow <dnusinow@debian.org> Date: Sun Oct 21 23:41:49 2007 -0400 Make PCI text file directory configurable commit ce7f6fe1268fef4f89aa21c7b44d73ecd98efe24 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Oct 19 19:40:04 2007 -0400 xselinux: properly update sizes when dynamic arrays are resized... commit 4b14c9a9cd2033d3839c4ba364d41ab4c4b198ab Author: Eric Anholt <eric@anholt.net> Date: Fri Oct 19 16:34:54 2007 -0700 Replace calls to Glyphs screen hook with CompositeGlyphs and remove dead code. Not all of the DDX/miext Glyphs hook implementations have been removed, but they should be. commit a3a95d3475dc91ed2e8a55bf484a6b3f2b5ac32a Merge: a358b87 7e1cada Author: Eric Anholt <eric@anholt.net> Date: Fri Oct 19 15:44:17 2007 -0700 Merge branch 'master' into glyph-pixmaps Conflicts: configure.ac commit 12e889d202ac9849f534c51167cbfed91c32027a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Oct 19 18:43:38 2007 -0400 xace: Bug fixes, name changes to selection access hooks and fields. commit 7e1cada6c6b9fa41ef3ead00bf7725d626dda193 Author: Eric Anholt <eric@anholt.net> Date: Fri Oct 19 15:16:19 2007 -0700 Disable debian pci-id-list autoconfig code on non-linux. It contains static paths, fails to build on non-glibc, and apparently just exists to support distributions managing binary drivers and open-source drivers together. Also restores previous code for fallback to vesa if nothing is detected. commit 89c6108531e603bdc81faf2ea860f318a2e94a39 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Oct 19 16:21:54 2007 -0400 Fix software GL to provide a list of supported fbconfigs like the DRI case. commit 74e84b8d891632141a60e2d29463ab46f622df3f Author: Matthias Hopf <mhopf@suse.de> Date: Fri Oct 19 17:28:15 2007 +0200 Only issue XF86_APM_CAPABILITY_CHANGED for video change ACPI events (not e.g. brightness etc.). commit 6fdf3ddfef2707755cec0fc9cbce354fd472bb52 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Oct 19 17:20:21 2007 +0200 Fix ids of ACPI events according to ACPI spec. commit d9caa469b9bb4eb6125b890820853062fc2c4441 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Oct 19 15:26:09 2007 +0930 Xi: allow VCP/VCK to be OpenDevice'd as well. All devices deserve to be equal. Except master devices, they are a bit more equal than the others. commit 155e2c559ed0dbf31b6d39d48648a3ee22b37635 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Oct 19 14:37:07 2007 +0930 Xi: advertise as XInput v2 capable commit 5ba738935f0d786e4670adf3b05ad42fc5e710fd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Oct 19 14:36:37 2007 +0930 Xi: remove ChangePointerKeyboardPairing in favour of ChangeDeviceHierarchy. commit 6dcde0e9c1d068d9fc4a772d29d1d4c6cc57aeb9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Oct 18 12:21:07 2007 +0930 Xi: set master device's id in ListDevices Reply. commit cfcc6e14b9a15f7979ba0df9c105cf563bef98fa Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Oct 19 11:28:44 2007 +0930 Xi: return all master devices as type IsXPointer/Keyboard when listing devs. Slave devices are reported as IsXExtensionPointer/Keyboard. commit 8e3c1dfc48930c455529313a42efa35e3b9071b2 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Oct 18 21:01:51 2007 -0400 Introduce a new "GlxVisuals" option that controls which visuals are added. Right now we default to "all" which gives us a situation much like before, but when the "typical" option is implemented, we can change the default and reduce the number of visuals the GLX module bloats the X server with. commit 9e3cfd950d279353f1795352ad2c4132aabc1bab Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Oct 18 19:12:24 2007 -0400 Add code to set up GLX visuals and add one for the first double buffered FBConfig. commit 8fc635e6a8072c7cd2777d804dd6f8eda2eecc15 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Oct 18 15:51:11 2007 -0400 Separate handling of GLX visuals and GLX FBConfigs. XIDs for GLX visuals and FBConfigs used to be interchangable and the list of GLX visuals was identical to the list for FBConfigs. This patch splits handling of these two data types and allows the X server to pick and choose the FBConfigs that are exposed as visuals. commit 0af8180683247955ce4cfd48e6a5b4d00bbe618a Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Oct 17 17:18:47 2007 -0400 Drop VisualConfigPriv support from the DRI module. No DDX driver uses this, and this patch stops the DRI module from poking around GLX module data structures. commit 7d74690536b64f7b8e8036507ab7790807349c50 Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Oct 14 15:39:21 2007 -0400 Simplify and clean up GLX visual initialization. Instead of the fragile setup where we filter the modes common between the DDX generated GLX visuals and the DRI driver generated fbconfigs, we now just take the fbconfigs returned by the DRI driver to be our supported set. commit ab4bce02a9457dd9c86b774fc74caf3dd6b287ca Author: Eric Anholt <eric@anholt.net> Date: Thu Oct 18 15:22:42 2007 -0700 Add a quirk for Philips 107P5 which lacks the preferred bit on detailed timing. Also fix the prefer-large-75 quirk if the prefer-first-detailed bit was set, though it's not the case for the existing prefer-large-75 consumer. commit 55a96aa6b0995fda6660b7e78c85b955a62b9735 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 18 14:11:11 2007 -0400 xselinux: add basic event labeling. commit e974bc1233608ec09fbd40b12217925e4d2205aa Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 18 12:33:39 2007 -0400 xselinux: add hooks for send and receive access. commit 06eb830169afd0631a31e8846c7d2533c49ea378 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 18 12:31:14 2007 -0400 xace: Fix bug in AddPassiveGrabToList(), was using wrong GrabPtr. commit 6107a245035366fe762756b6aa05ac0e3a5482bb Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 18 12:24:55 2007 -0400 dix: Add client parameter to AddPassiveGrabsToList(). commit ce50bfd3369686cfecee5a138bd84ef1107a249d Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Oct 18 17:44:48 2007 +0200 EXA: Skip empty glyphs. commit 5d74416740de883b7ef0994afea4bbd4d3901be0 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Oct 18 17:44:14 2007 +0200 EXA: Don't attempt to move in pixmaps that can't be accelerated. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=12815 . commit 31110d6837ee52fd654729d9e5c4b0c5395abab0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 18 10:30:44 2007 -0400 registry: special case minor number when looking up core requests. commit e3fd90ae9c3ddfc5d78e62614e311b73505d7ead Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 18 10:29:10 2007 -0400 registry: Add "X11:" prefix to core protocol names. commit aa340b2c7cbe9ddab53cff08c8ba165558209187 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 19:27:16 2007 -0400 xselinux: add hook for device acceses. commit 503f918f55d0cb29585d83b022bbb8dc29f446c5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 19:14:15 2007 -0400 xselinux: Move functions around; add some more comments. commit 50b27e1ad2a98d36728dc8157492ef5c59c132cd Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 16:09:40 2007 -0400 devPrivates rework: update new GL/glxext code. Need to merge so this type of thing stops happening. commit c3f7b862550fa8f46633162f83db8c27e46fc672 Merge: af4dde0 feac075 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 15:00:54 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: os/access.c commit af4dde0ac19ecec1d0ad988eb25b15401e7c6b36 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 14:13:02 2007 -0400 xselinux: Remove config file, this has been moved to the policy. commit baabae623b3658196b67a710dc72663c2105bf31 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 13:54:56 2007 -0400 xselinux: Started reworking extension using new XACE hooks. commit db66e66dbf26b91c655f1659859c022cc31f0db6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 13:51:11 2007 -0400 xace: Add an access_mode field to the extension structure. This allows the same callback to be used for both extension hooks. commit e3a8cbe523bae8b771ad3c8ad497f4444f6d05d5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 17 13:48:44 2007 -0400 xace: add creation/labeling hook to CreateRootWindow(). commit feac0759522cbdc3e61ccfa373df735903c5cb27 Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Oct 17 11:42:28 2007 +0800 Make config file preferred mode override monitor preferred mode. Add a new even-more-preferred bit to each mode which is used to make config file preferences selected instead of the monitor preferred mode. commit f2da10f7bc2ddb6ad2f18b793afc10d04b97c51c Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Oct 17 10:50:22 2007 +0800 KDRIVE_LOCAL_LIBS includes some system libraries, not just internal x server libs commit 9aadde377991bfbd88524d02106bec3dedd6e7c9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 17 12:05:50 2007 +0930 mi: don't call UndisplayCursor for non-sprite-owners. Segfaults are bad. commit 8b7c4249d82d07e852d8d8c15c7ab9977dd1f31c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 17 10:41:58 2007 +0930 mi: call processInputProc for master devices after slave event processing. More work is needed to sort out grabs though. commit ae9fc10adec8f9bf0492d14d435f8f11e0163b27 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 17 10:41:04 2007 +0930 Xi: don't send core events for slave devices. commit de70cfdbe60eb6e7bf3e74dfd1ac34de554deff1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 17 09:52:30 2007 +0930 mi: fix some macros to allow multiple cursors for master devices. Macros defaulted to inputInfo.pointe rfor devices that weren't spriteOwners. Changed to take the device's master device now. This includes sticking in a number of checks and warnings that cursor rendering won't be called for floating devices. commit 773f6491c1cc8819038e753d08c32ba213f80f8f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 16 19:11:36 2007 -0400 xace: update the DeleteProperty prototype to include the client argument. This should have been part of 8f23d40068151ad85cde239d07031284f0b2c4dc. commit 9dde53ed179336c7b483c9a94a97182ad1777dfb Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Tue Oct 16 19:55:56 2007 +0100 Fix walking of GLX providers. commit 70a5d33c9e41c077a8cd92abd43376e2956d3aed Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Oct 16 12:46:07 2007 +0200 Always check the return value of __glXGetDrawable first. Fixes spurious GLX protocol errors because __glXGetDrawable doesn't set the error code in case of success. Maybe it should, though. commit 1d9ebbac8c589cae7e4952083692b6d148def9bc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 18:46:12 2007 +0930 dix: Make InitCoreDevices use AllocMasterDevice. Also change naming a bit, append "pointer" and "keyboard" to master devices instead of -ptr and -keybd. commit 299573f4617c3b5599bb65069e96d050277b9471 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 18:40:15 2007 +0930 dix: add AllocMasterDevice for creation of new master devices. Devices are initiated pretty much the same as the core devices. commit 5fe9bfd23f17b84c3afaa82f75a7c517c9f8e0d3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 18:23:48 2007 +0930 xfree86: NIDR: don't call PairDevices explicitly. set isMaster to FALSE explicitly. Pairing isn't necessary, attachment should be done in EnableDevices. commit 5eb033835e92ea951cc385fd709af9656b3772d8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 18:03:52 2007 +0930 mi: don't exclude inputInfo.pointer from rendering. commit b697c4ed145968d3c3281bb85e628f1b068b09fc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 17:47:06 2007 +0930 dix: CheckPassiveGrabOnWindow: only get paired device for non-keyboards. commit caa69d8f7b92b80669df02e1001409d7c653e7e4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 17:38:13 2007 +0930 dix: fix detritus from adding lastSlave field. commit 90d077e537ac4cb7d79d67afcf3984a3e8d65fe8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 17:37:33 2007 +0930 dix: GetPointerEvents: get state from master device before applying valuators. We need to get lastx/y from the master device before we start applying acceleration etc. Otherwise we get jumping cursors, which is reasonably bad. commit b6ccf721b0a582150858d68f91967fb4e319c340 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 17:35:06 2007 +0930 include: add "lastSlave" field to DeviceIntRec. Set to the last slave device that routed events through the master. commit e6bd8ae0608bd8379c5ac962f69cd0bcc54f9734 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 15:59:30 2007 +0930 dix: set the device's sprite when using AttachDevice Sprite is set to the master device's sprite. commit 271d4c3d6255318aabb9ad1ea444f534ed456f0b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 15:50:07 2007 +0930 xfree86: remove XI86_SHARED_POINTER flag. Not needed anymore. By default, all devices are slaves of first master device. commit c7b878b90406781c97db751a9b454e2b6baee0e1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 15:07:31 2007 +0930 dix: don't treat VCK/VCP separately in DevHasCursor, IsPointer/KeyboardDevice. commit e9f149fb56747f7eaa0f714dce97b067b007c47e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 14:24:20 2007 +0930 Fix up detritus from removing GetPairedPointer/Keyboard. commit 840bde3d32f3627dfc3d7d8b6564a61a8014933b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 13:09:35 2007 +0930 dix: GetPairedDevice: return dev paired with master for slave devices. commit 6c259a08d917f94fd7381453b625b07826d3ef9c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 13:09:19 2007 +0930 include: remove unused GetPairedPointer/Keyboard declarations. commit fe97f7c54a1b42acd542696b6cdc9e83e89548f3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 22:46:08 2007 -0400 registry: Add some missing #include's. commit 9ecbbf198f4cec398897736e173e7e8c56bf6f94 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 08:00:06 2007 +0930 dix: adjust PickPointer and PickKeyboard to get the first master device. Simplifies it a lot, since we always have at least one master device available at all times, so less mucking around. commit 0c5f65ecd3ad11fbdb1cab3cb1d0eb4f33bb4e35 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 07:57:24 2007 +0930 dix: don't allow slave devices as ClientPointer commit 9ccc9ab6f29f68298b68cdb5c9b4bd57a095f05a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 07:53:00 2007 +0930 dix: don't call CloseDevice on VCP/VCK separately. commit e4fd981b48723b77a6c1a528638a771b9cc35472 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 07:52:11 2007 +0930 dix: check for isMaster before calling DeviceCursorCleanup. commit 7503d1340726e0a529f04304d177ed2ceb8fbc91 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 07:50:13 2007 +0930 dix: don't check VCK and VCP separately when looking for device ids. Both are part of the device list again, so we cover them there. commit 032e906711202d376af95b37bb0cdf14a3648256 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 11:57:42 2007 +0930 dix: Remove GetPairedPointer, GetPairedKeyboard in favour of GetPairedDevice. commit 853ea337bdad17f8f6ec7d940de14ce2cbbbf93e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 22:13:02 2007 -0400 registry: Register XvMC extension protocol names. commit 58c3240fcbec23aad122e1c340f6bb6d3b18f779 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 22:09:47 2007 -0400 registry: Register MIT-SCREEN-SAVER extension protocol names. commit 3e07e73fefc100e491d1e465cb162373d1d82425 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 11:34:29 2007 +0930 dix: remove pairing/attachment from InitAndStartDevices. If we enabled in the correct order, this has all been done already. commit 4e274e90e16b1d954391e1af3e2074fb10f70ee7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 22:04:20 2007 -0400 registry: Register SHAPE extension protocol names. commit 9f597f6c87e0b14cc382d8e5929e42f822db4329 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 22:01:20 2007 -0400 registry: Register SYNC extension protocol names. commit 38baac71bdbb8c7e882e3e39133615cfed894a6b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 04:21:42 2007 +0930 dix: Set bidirectional pairing, don't allow pairing with already paired devs. commit 70efd3d06a15093661933bda4ec21e306dece4a4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 11:30:32 2007 +0930 dix: fix up Activate/Enable/Disable device. Set isMaster for VCP/VCK. Init sprites for master pointer devices. Pair master kbds with master pointers (1:1 pairing!). Attach other devices to VCP/VCK. commit b504678ba5407a6fd8d47d051305f7c3d5606dfe Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:54:25 2007 -0400 registry: Register APPGROUP extension protocol names. commit 204f2dc89ef662b57400b128c30c15e8cf32f323 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 04:13:06 2007 +0930 include: add "isMaster" field to DeviceIntRec. Set to TRUE for master devices. Also fixing up comment for paired field in spriteInfo, will be set bidirectional from now on. commit bd7d5255ce4865b684f7d8bcf80ba9872a1af22d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 16 11:18:31 2007 +0930 dix: add AttachDevice, needed to attach a slave device to a master device. For now, we don't allow attaching slaves to other slaves, and we don't allow pairing slaves with other slaves. Pairing is for master keyboard->master pointer only. Attaching is for slave device->master device only. commit 6ec35a8cf539c900b334dd6df146b394f54e3706 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:46:56 2007 -0400 registry: Register BigRequests extension protocol names. commit 1254cc399c53eadcc32eeabf69990ed2526c7ae0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:43:06 2007 -0400 registry: Register Fontcache extension protocol names. commit e987648cf2c21dcbd77dd9a71793090a48e4f521 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:38:56 2007 -0400 registry: Register EVI extension protocol names. commit be1565f6b8fb09eba9941d6f7c485bf5fb25fe7a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 01:53:54 2007 +0930 dix: Set core devices to ProcessOtherEvents, set sendCore and XKB. Even the virtual core devices should send through ProcessOtherEvents. commit ce9bf9a19185a36ac2f7ae75acd320ab8d03d247 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Oct 14 01:50:40 2007 +0930 include: add "master" field to DeviceIntRec. "master" points to the device this device is attached to. Event sent by the device will also be routed through the master. master and spriteOwner are mutually exclusive. commit f6226d3bfe1515058e2092e8662ae87825501209 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:35:12 2007 -0400 registry: Register TOG-CUP extension protocol names. commit 7e182a5d89d618e20dcc77850131690733322d39 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:13:39 2007 -0400 registry: Register MIT-MISC extension protocol names. commit 32f6171862461d17ebea58a2fb6ddd16ac71358c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:10:14 2007 -0400 registry: Register XF86Bigfont extension protocol names. commit 12766c5b5ffdab95255a63b2c8421ee773fd43b5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 21:00:46 2007 -0400 registry: Register Xv extension protocol names. commit 35ae03871af88b2f420dd83448011a077852d7a0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 20:50:26 2007 -0400 registry: Register XC-MISC extension protocol names. commit 32fe282d5b8306514d641e15bc6d9fd4ab360977 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 20:45:18 2007 -0400 registry: Register XTest extension protocol names. commit 3877faf7d9fe00ed634077e38a198ae4b91a2bb4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 20:35:13 2007 -0400 registry: Register Multibuffer extension protocol names. commit 16764a2d299c7c0c98002aadd52ab4a1a36758c3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 20:29:23 2007 -0400 registry: Register DPMS extension protocol names. commit f077578e42eee424b0e534774574c84af9d6f85b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 19:43:02 2007 -0400 registry: Register XPrint extension protocol names. commit 5c8b1a91726817816d20faefad21c7a68ab634cc Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 19:35:04 2007 -0400 registry: Register Resource extension protocol names. commit 48891d5696f56711f23743cb03be39cf6b26c522 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 19:32:01 2007 -0400 registry: Register EVIE extension protocol names. commit 2c9646ad4e65bb061d910c9e2b1a8a978f21fa17 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 19:18:03 2007 -0400 registry: Register SHM extension protocol names. commit 8964c6d8e14ae47798762191e359b2bf138ca32e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 19:10:51 2007 -0400 registry: Register RENDER extension protocol names. commit c827db57e4d9ca14c82b099dcfc9b7a0c0b5ba0a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 19:06:01 2007 -0400 registry: Register RANDR extension protocol names. commit 20db50b4c44a14f7eeac2b1de17ada68482521da Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 18:56:59 2007 -0400 registry: Register DAMAGE extension protocol names. commit b38a91993364aa80cfd99721e319e1458d9fb760 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 18:50:06 2007 -0400 registry: Register XTrap extension protocol names. commit 106758893b68033f14f69c4ee6591fb6a149ba37 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 18:31:40 2007 -0400 registry: Register XFixes extension protocol names. commit ea09c9acc8f0d5577f54c864ff88b7f03d93b2f4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 18:25:12 2007 -0400 registry: Register Record extension protocol names. commit 2e1e5be1d9067816525aa13a1d818e8ca6899599 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 18:18:57 2007 -0400 registry: Register DBE extension protocol names. commit 4c3285c883cc50a91bc5262bbc9d073d816f860a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 18:04:47 2007 -0400 registry: Register WINDOWSWM extension protocol names. commit 3815284e899b61731b6a63c4ba14c5d773e24eb6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 17:57:59 2007 -0400 registry: Register XF86DGA extension protocol names. commit 2cd1b32b77e0ceeaccb3f01c4ac13a97c557668c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 17:37:58 2007 -0400 registry: Register XF86Misc extension protocol names. commit 960677e876c068400fb45e1764bb5470cd8c389f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 17:30:00 2007 -0400 registry: Register XF86VidMode extension protocol names. commit b7786724080fd3928ef7b8c294346661d7ffd90b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 17:15:34 2007 -0400 registry: Register XF86DRI extension protocol names. commit eee46b4681ec55297604b0425705f2b18381f7ca Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 17:06:22 2007 -0400 registry: Register APPLEWM extension protocol names. commit b9f5ab98c8dea36dcce1ad15fd2e059a77e77c39 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 16:18:37 2007 -0400 registry: Register XINERAMA extension protocol names. commit 3464b419230c6d17e940d967b567c5d2cb22d232 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 15:45:12 2007 -0400 registry: Register APPLEDRI extension protocol names. commit 32f3f5a1e7654f8bb43ea16b9227b3994e616739 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 15:32:17 2007 -0400 registry: Register DMX extension protocol names. commit 166ef972febc00c665e1d5aeb68e75d7bbcf9879 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 15:22:02 2007 -0400 registry: Register composite extension protocol names. commit a5cf3f21f712e46dbf9bca289e67be75f2b531d3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 14:27:32 2007 -0400 registry: Register XKB extension protocol names. commit 5277a6ff589b5ddb475b90e1aaf5dbd9172d9711 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Oct 15 13:38:35 2007 -0400 registry: Register Input extension protocol names. commit 8b5078b7d9ec08a588a78eb49096b698c6f4916b Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Oct 15 13:10:10 2007 -0400 Fix byte swapping for GetFBConfigs. commit c922d2eebe29f08f463ee76293dc9042712fb21c Author: George Sapountzis <gsap7@yahoo.gr> Date: Sun Oct 14 20:40:18 2007 +0300 glx: drop duplicate GetDrawableAttributesSGIX declarations. They are officially autogenerated in indirect_dispatch.h now. commit 3d4eb17b38dcb1468493f3686dc5ea3623ef9a73 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Oct 14 18:07:03 2007 -0700 mass change from #ifdef i386 to #ifdef __i386__ to conform to ANSI commit ec0fc012e91e703bb399a380df2912f71957a220 Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Oct 14 14:59:12 2007 -0400 Fix GLX byteswapping. commit 927757e1028f45f7fd94b9a2ab35567e0f34b2a8 Merge: ccda4b6 17ffc34 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Oct 12 19:28:39 2007 -0400 Merge branch 'master' of git://git.freedesktop.org/git/xorg/xserver commit ccda4b66bdfc179e661b24adc8ec72bb7db75b2b Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Aug 27 14:43:48 2007 -0400 Implement ChangeDrawableAttributes so we can support GLX_EVENT_MASK. We never need to actually send out the clobber event, so this should be sufficient for GLX 1.3. commit 695eb8b2e88abc9fa3a76d8da48c3214c7dd1f08 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Aug 27 14:23:50 2007 -0400 Implement GLX pbuffers. commit 516c181f57367847c3f317f8f8f5cc3211026f4c Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Aug 23 21:40:01 2007 -0400 Add dispatching for GLX_SGIX_pbuffer. commit d7ded953c4d263e3dd3374dc03eea19e80c05bc6 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Aug 23 19:07:52 2007 -0400 Implment GLXPixmaps. commit 526f40434c86548830c4f72940462b6253fe9790 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Oct 12 18:18:00 2007 -0400 NULL is not a valid argument to CreatePicture, please use serverClient as the client argument if no real client is creating the object. commit 2b0847c7aaf95b6b10f062dfff601032b2430a9b Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Aug 8 10:07:03 2007 -0400 Implement damage reporting for AIGLX. commit 600028305cc047e824b18369a026f89c9eb7e437 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu May 31 22:55:47 2007 -0400 Move hyperpipe and swapbarrier extension funcs to screen private struct. This gets rid of a couple more global arrays and gets the two extensions more in line with the general extension mechanism. commit 781515bb637de4fd79e3c83817cb6ffa8f2d8a4f Author: Kristian Høgsberg <krh@redhat.com> Date: Wed May 30 23:25:03 2007 -0400 Convert GLX module to use screen private indexes like everything else. commit 72a3d68a2f5abcd09fef1a55e976e1a5731d4b02 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu May 10 11:16:50 2007 -0400 Update the AIGLX DRI loader to use the new DRI interface. This lets us drop a bunch of workarounds and use the new DRI extension mechanism. commit 17ffc34ad5e9a8e2269afef05f209701f1895c01 Author: Matthias Hopf <mhopf@suse.de> Date: Fri Oct 12 15:33:31 2007 +0200 Drivers include miscstruct.h which requires pixman.h. commit eaf0e2a21c2cb14e19852e61a4521b3c240253af Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 22:31:24 2007 -0400 Fix another compiler warning commit a5089af726b6a4f833b95a31274743c994277e20 Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 22:24:31 2007 -0400 Fix a warning about the control logic in xchomp() commit cdf29ff45a3cb45573c9d0cb8f82e6ee97953fb5 Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 22:23:34 2007 -0400 Remove some unused variables commit 3367091f7fa14497aab40e668cad179e244eef81 Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 22:21:38 2007 -0400 Separate choosing driver from the file-based implementation This clears the implementation out of the way to prepare for development of a symbol-based resolution scheme commit 3aa41bcb8215c037512ddbd68a3f7bcad3b80a1f Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 21:29:13 2007 -0400 Remove obsolete error message define from parser commit e3e12221111886c4063d2da5d70d3830c56d39e2 Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 21:27:07 2007 -0400 Don't bother validating the Device section of the conf file All the previous tests can now be recovered from if not specified. commit 28ef7f59416677be380561709197b04df0479bef Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 20:56:46 2007 -0400 Re-enable validation of the screen section of xorg.conf This also fixes a problem where the server can't find the device section when it is specified in the screen section. commit ea2d4dc468dcebe6d38e676469ec51ed1d43490b Author: David Nusinow <dnusinow@debian.org> Date: Thu Oct 11 20:26:02 2007 -0400 When there's no xorg.conf, use the video driver autoloading function commit fc092334ac0a323b80a9602cb8bf60ca9dee3bfa Author: Eric Anholt <eric@anholt.net> Date: Thu Oct 11 16:48:56 2007 -0700 Bug #10304,12784,11603: Add quirks for several physical size issues. A lot of EDID writers apparently end up stuffing centimeters (like the maximum image size field) into the detailed timings, instead of millimeters. Some of them only get it wrong in one direction. Also, add a quirk to let us mark the largest 75hz mode as preferred, which will often be used for EDID 1.0 CRTs. commit 6adeba17301a309be2f34cd51eca84a13d5503fd Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 11 14:17:17 2007 -0400 dix: Add a new "registry" mechanism for registering string names of things. Supports protocol requests, events, and errors, and resource names. Modify XRES extension to use it. commit 45cc03726b49f6ad4afe6c3fb4ad65d1051928b4 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Oct 11 18:23:25 2007 +0200 Make mode checking more tolerant like in pre-RandR times. commit 8f23d40068151ad85cde239d07031284f0b2c4dc Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 10 19:56:03 2007 -0400 xace: move the property deletion hook inside the DeleteProperty function. commit 473bc6ec4c59e1a962b0b897c449a69aa5064ab0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 10 19:43:12 2007 -0400 xace: remove the special-cased "ignore" functionality from the property code. There will be no more faking of Success to hide things. XACE does not provide polyinstantiation. commit 7e9e01a4a34fa45521067d43c5bbff942dd5d51a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 10 17:40:22 2007 -0400 dix: pass a valid ClientPtr to SetFontPath in all cases. commit 8825d36a38c76ff8faf409c853061be2bd33430d Author: David Nusinow <dnusinow@debian.org> Date: Tue Oct 9 22:49:07 2007 -0400 Allow the user to not have a screen section If none is present, a default one will be created. This will be attached to either the first device section in the xorg.conf (allowing you to specify something like using EXA without having a screen section) or a default screen section if none is present in the file. commit 8665cf3327b713f334b0483593a924c197f892f2 Author: David Nusinow <dnusinow@debian.org> Date: Tue Oct 9 22:45:15 2007 -0400 Don't require that the screen explicitly attach the device section This will allow the screen to not explicitly have a device section. If this is the case and there is a device section in the xorg.conf, the first one will be used. If there is no device section at all, a default one will be created that loads the automatically determined module. commit 37898b824fdc94735495e3494aa2b9a681d477b9 Author: David Nusinow <dnusinow@debian.org> Date: Tue Oct 9 22:11:58 2007 -0400 Use the best guess heuristic as a fallback for autoloading This prevents breaking the current behavior commit 847fbbf4d25132e6c1f99fcf82fe757dbca94a34 Author: David Nusinow <dnusinow@debian.org> Date: Tue Oct 9 22:07:49 2007 -0400 Fix autoloading of drivers for pci-rework commit 6033d8150be3a115b90226eaa42f237bb0cf3369 Author: David Nusinow <dnusinow@debian.org> Date: Tue Oct 9 21:17:27 2007 -0400 First pass at improved video driver autoloading This is what we're currently shipping in Debian. Enables the ability for drivers to ship a text file listing PCI ID's they support, and have the server read them on startup when no driver is specified. This works, but isn't the final solution. commit 81d7b81146224f2b83278f5e21b3f9a36f30bd56 Author: David Nusinow <dnusinow@debian.org> Date: Sat Aug 25 15:00:30 2007 -0400 Load intel instead of i810 when autoconfiguring commit fdef7be5c8d5989e0aa453d0a5b86d0a6952e960 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Oct 9 18:44:04 2007 -0700 Sun bug 6589829: include zoneid of shm segment in access policy for MIT-SHM <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6589829> <http://www.opensolaris.org/os/community/arc/caselog/2007/500/> commit 49c8285e38e0e71c9ea43df63add08a4f2564ed1 Author: Christian Weisgerber <naddy@freebsd.org> Date: Tue Oct 9 15:25:16 2007 -0700 FreeBSD/alpha server build requires libio (missed in modularization). commit 042e16458b751ad0fcfa1ebbdd74d7d48036b22a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 9 23:07:51 2007 +0930 dix: change a few inputInfo.keyboard over to PickKeyboard() commit 6aab6a6e2ae0ef5fdedae09cf2cdc86f382e3a8a Author: Dodji Seketeli <dodji@openedhand.com> Date: Mon Oct 8 13:25:38 2007 +0200 EXA: dude, don't validation driver hooks twice ! commit d42909b23a9be64a26aa349c1d6dcd8b228bffa7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Oct 5 13:04:10 2007 +0930 dix: when disabling a device, make sure all paired devices are re-paired. We re-pair them with the VCP, not a real device! If we would do otherwise, somebody may change our keyboard focus and thus get us typing where we don't want to type. commit ff2351246da30b56a3a8f90654993c41b8eb3921 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Oct 5 12:19:03 2007 +0930 dix: When pairing, only check for access right if client is set. If the pairing client is not set, then the pairing is initiated internally (e.g. when a new keyboard device is configured). In this case we _must_ pair regardless of who is the pairing client. commit 4611f9568cdadf9c00f4b7ca4c77c8c6f07e94f8 Merge: ab11bad 3549a12 Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Oct 4 13:07:50 2007 +0200 updated from 'master' commit ab11bad54707941eb41be62c025b983760ce3900 Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Oct 4 13:05:29 2007 +0200 Xephyr: remove a potential crasher * hw/kdrive/ephyr/hostx.c: (hostx_has_dri): be more defensive. commit 06c8977966e76255ce7798f4839ef6e3530264a8 Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Oct 4 13:01:24 2007 +0200 Xephyr: better handling of the -nodri option * hw/kdrive/ephyr/ephyr.c: (ephyrInitScreen): try and detect when the host has no DRI support. In that case, switch to the -nodri behaviour. When in the -nodri case, make sure not to skip glx visual initialisation. commit ea94f59e9b8824b1a638c63e06ca16f0efd43869 Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Oct 4 12:54:26 2007 +0200 Xephyr: don't disable glx visual init by default * hw/kdrive/ephyr/ephyrinit.c: (ddxProcessArgument): disabling visual init here is bad because it gets disabled even when we want to use software GL, leading to Xephyr :1 -nodri crashing in mesa. commit a7f210e6fcda14eae4de64186904c6c676c758ee Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Oct 4 12:51:08 2007 +0200 Xephyr: fix a compiler warning commit 5d6eac1251f1e17baa74d0893bb225b775e8ec2e Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Oct 4 12:47:05 2007 +0200 Xephyr: remove an unused variable commit 8018733c39c283a931df424dcfd11e7aefbcd8cf Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Oct 4 12:06:19 2007 +0200 Xephyr: better compilation without GLX * hw/kdrive/ephyr/ephyrinit.c: protect GLX related code with GLXEXT macro commit 3549a1282365e69e70c7c2546cfa7d25923cce31 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Oct 4 11:38:01 2007 +0200 EXA: Disable 1x1 pixmap fill optimization for drivers that handle pixmaps. This reverts commit 1365aeff5499a051375e43a9fcbf54733ac93929. It defeated the optimization for drivers that don't provide a CreatePixmap hook. The optimization makes no sense for drivers that do anyway, so disable it for them completely. commit 604ebb5a6de372e6a8a96e0ee997db7929126860 Merge: 1365aef 4ba76a7 Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Oct 3 16:13:16 2007 +0200 Merge Xephyr-XV/GL stuff into master commit 4ba76a7e2b62d26f43c0e670de571afb75ec92f4 Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Oct 3 13:03:34 2007 +0200 Xephyr: port XV/GL stuff of the new multiscreen architecture We can now launch GL or XV apps in any of the Xephyr screens we want. * hw/kdrive/ephyr/hostx.c,h: (hostx_get_window): (hostx_create_window): make these functions be screen number aware. * hw/kdrive/ephyr/XF86dri.c : fix some compiler warnings. * hw/kdrive/ephyr/ephyrdri.c: (ephyrDRIQueryDirectRenderingCapable), (ephyrDRIOpenConnection), (ephyrDRIAuthConnection), (ephyrDRICloseConnection), (ephyrDRIGetClientDriverName), (ephyrDRICreateContext), (ephyrDRIDestroyContext), (ephyrDRICreateDrawable), (ephyrDRIGetDrawableInfo), (ephyrDRIGetDeviceInfo): in all those functions, don't forward the screen number we receive - from the client - to the host X. We (Xephyr) are always targetting the same X display screen, which is the one Xephyr got launched against. So we enforce that in the code. * hw/kdrive/ephyr/ephyrdriext.c: (EphyrMirrorHostVisuals): make this duplicate the visuals of the host X default screen into a given Xephyr screen. This way we have a chance to update the visuals of all Xephyr screen to make them mirror those of the host X. (many other places): specify screen number where required by the api change in hostx.h. * hw/kdrive/ephyr/ephyrglxext.c: specify screen number where required by the api change in hostx.h * hw/kdrive/ephyr/ephyrhostglx.c: don't forward the screen number we receive - from the client - to the host X. We (Xephyr) are always targetting the same X display screen, which is the one Xephyr got launched against. So we enforce that in the code. * hw/kdrive/ephyr/ephyrhostvideo.c,h: take in account the screen number received from the client app. This is useful to know on which Xephyr screen we need to display video stuff. * hw/kdrive/ephyr/ephyrvideo.c: update this to reflect the API change in hw/kdrive/ephyr/ephyrhostvideo.h. (ephyrSetPortAttribute): when parameters are not valid - they exceed their validity range - send them to the host anyway and do not return an error to clients. Some host expose buggy validity range, so rejecting client for that is too harsh. commit ab88cb8d2e7c1410f9ed2be928b38f176b132e11 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 3 18:08:33 2007 +0930 Xext: add missing geint.h to Makefile.am (un-breaks make dist) commit 9f2b493e34e93881101f31e631901d3fe56da4f0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 27 15:35:41 2007 +0930 xkb: remove some warning comments. Obsolete with 340911d7243a7f1095d79b5b2dcfa81b145c2474. commit 1eebb03a3190947a8102f2ddc73766cf98d34c84 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 3 15:18:17 2007 +0930 dix: ignore passive grab if the client already has a grab on the device. In some cases a button press may activate a passive core grab. If the client owning the passive grab already has a core grab on another device, don't actually activate it. Otherwise the client gets two simultaneous passive core grabs, and may never ungrab the device again (only if the other grab uses GrabModeSync). Reproducable: fire up gnome-session, open up gnome-terminal. Click with the ClientPointer onto the window decoration, then click with another pointer onto an application icon in the panel. Drag the icon out, release the button and voila - you just lost your second mouse. commit 0b485067823620b5dbd9ef2b3e13bd35ad5a4410 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 3 14:22:55 2007 +0930 dix: send NotifyGrab/NotifyUngrab focus events regardless of semaphore state. This is just papering over a problem. The whole focus system needs to be revised. commit 05106ac9839102c0e4a3ce5d9d83d19abf129f8a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Oct 3 11:33:10 2007 +0930 dix: change Enter/Leave semaphore handling to accommodate for NotifyGrab. This is a half-assed attempt at getting rid of some enter-leave problems. When a grab is activated, the events didn't get sent before, leading to interesting results. This commit papers over it but doesn't actually fix it properly. The whole enter/leave (focusin/out) structure needs to be ripped out and changed for multiple devices. commit 1365aeff5499a051375e43a9fcbf54733ac93929 Author: Dave Airlie <airlied@redhat.com> Date: Wed Oct 3 12:00:16 2007 +1000 exa: direct access to the pixmap sys ptr is bad if the pixmap isn't mapped commit 566dd3b7d789ba60d0adf33b3f729cfb02ff33cd Author: Dave Airlie <airlied@redhat.com> Date: Wed Oct 3 11:59:52 2007 +1000 exa: add new flags to denote driver handles all pixmap migration/hiding commit 1df1fee82d3565f6d8cfb91ce25a81c23a10a4b5 Author: Dave Airlie <airlied@redhat.com> Date: Wed Oct 3 11:56:04 2007 +1000 exa: make sure we set fb_ptr to NULL commit a358b87f45ce75e5d013fc904a07dfe394f74387 Author: Eric Anholt <eric@anholt.net> Date: Tue Oct 2 13:13:51 2007 -0700 Just link against libcrypto instead of relying on openssl pkg-config. Also fix incorrect library inclusion by kdrive which broke the build. commit 439edc768eea17667846ce573c843b8377e0dfb4 Merge: c8ccf46 93ae6fe Author: Eric Anholt <eric@anholt.net> Date: Tue Oct 2 12:14:04 2007 -0700 Merge branch 'glyph-pixmaps' Conflicts: configure.ac exa/exa_render.c commit 59cebcd2e9302d15a52588ecafbbc2d2c5ae3a6c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 2 13:39:25 2007 -0400 xace: add creation hook for new input devices. Unfortunately, more information is needed to properly label the device. This will come from the configuration file, the hotplug messages, etc. It will either have to be passed into this function, or this hook moved down into the callers. commit b77d272d7555c1e0f176ee74b8717030a6d6c7b0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 2 13:21:53 2007 -0400 xace: add hooks + new access codes: XTEST extension commit c8ccf469dcb2d7609b23faa8b4999c436263051e Author: Keith Packard <keithp@koto.keithp.com> Date: Tue Oct 2 08:59:40 2007 -0700 Do not build hw/xfree86/os-support/bus/ix86Pci.c on Linux. Linux has custom PCI bus support functions, so this generic code is unnecessary. commit dcb4db1bf5b6fcfaed4e7162eb6c7a3a509e14bd Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Sep 19 15:46:09 2007 +0200 Xephyr: glx fixlet * hw/kdrive/ephyr/ephyrhostglx.c: (ephyrHostGLXQueryVersion): properly query the host for its gxl version. commit 6a435b00003fb00930299a0e0810c93afc23a72e Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Sep 19 15:35:51 2007 +0200 Xephyr: check presence of extensions in host X * hw/kdrive/ephyr/hostx.c,h: (hostx_has_xshape), (hostx_has_glx), (hostx_has_dri): added these new entry points * hw/kdrive/ephyr/ephyrdriext.c: (ephyrDRIExtensionInit): check presence of DRI and XShape extensions before trying to use them. * hw/kdrive/ephyr/ephyrglxext.c: (ephyrHijackGLXExtension): check presence of glx extension before we use it. commit 2b217fc055300d4c709dd27c4e8ec8166183993b Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Sep 19 15:00:43 2007 +0200 Xephyr: cleanup XF86dri.c a bit commit f731b9da7dbafad50dd5a1e8da28ce86ffab19b7 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Sep 18 18:41:18 2007 +0200 Xephyr: add -nodri and -noxv switches. * hw/kdrive/ephyr/ephyr.c,ephyrinit.c:: add -nodri and -noxv to disable either DRI or XV. When -nodri, mesa GL (non acceleretated) works. commit 50674391388b3cfe987782a3ad81b4f240f3db67 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Sep 18 18:37:49 2007 +0200 Kdrive: use fbcmap_mi.c instead of fbcmap.c * hw/kdrive/src/Makefile.am: use fb/fbcmap_mi.c and not fb/fbcmap.c. This allows kdrive to take advantage of extensions redefining the entry points of micmap.c stuff. For instance it allows Xephyr to have a working GL, which is not possible otherwise, because GL redefines mInitVisualsProc to initialise its visuals. commit a5bd536869f646e4024befa84f6e677b990310bc Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Sep 18 18:28:25 2007 +0200 fbcmap_mi.c: add a missing api * fb/fbcmap_mi.c: (fbSetVisualTypesAndMasks): added this entry point that was missing. This is useful so that servers using this entry point can use fbcmap_mi.c, and be obliged to stick to fbcmap.c. Note that fbcmap.c does implement this entry point. Up to now, kdrive based server could not use fbcmap_mi.c because this entry point was missing. The will allow Xephyr to properly use GL. commit 6307ee77091041af2d34e93bc164352d4438a808 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Sep 18 18:22:44 2007 +0200 GLX: allow skipping of visual init wrapping * GL/glx/glxvisuals.c: added boolean to disable calling init_visuals(). This gives a chance to Xephyr to take over visuals manipulation and avoid a crash at server shutdown in __glXMesaScreenDestroy(), due to the fact that mesa might sees more visual than what it has actually created in init_visuals(). It might see more visuals because Xephyr can augment the number of visuals, dynamically. * os/utils.c: the boolean is actually defined here. commit ffe9ce6a843443606ad9367eca1645bf5e0635e5 Author: Dodji Seketeli <dodji@openedhand.com> Date: Mon Sep 17 22:13:51 2007 +0200 Xephyr: fix a clipping issue xephyr-dri * hw/kdrive/ephyr/ephyrdri.c: (ephyrDRIGetDrawableInfo): force the back clipping rects to equal the front clipping rects. * hw/kdrive/ephyr/ephyrdriext.c: (ProcXF86DRIGetDrawableInfo): properly overclip the clipping rects we got from the client. This bug fixes a clipping rect that was too small in height, basically. Also fix a possible mem corruption. * hw/kdrive/ephyr/hostx.c: (hostx_set_window_geometry): remove a useless XSync commit 79782726617d4b5a4f9b376f21936d035fc870e1 Author: Dodji Seketeli <dodji@openedhand.com> Date: Mon Sep 17 18:15:03 2007 +0200 Xephyr: properly clip GL drawables in Xephyr commit 3816d64e50a59e0ef276ddd6cb250cab98a49392 Author: Dodji Seketeli <dodji@seketeli.org> Date: Sun Sep 9 15:20:51 2007 +0200 Xephyr: oops, forgot to add ephyrdriext.h commit cf58781eee7d91a3bbca701a2c4523a36f8e0abb Author: Dodji Seketeli <dodji@openedhand.com> Date: Sat Sep 8 00:33:59 2007 +0200 Xephyr: make accelerated glxgears work in Xephyr * hw/kdrive/ephyr/ephyr.c: (ephyrInitialize): cleanup ephyrDRI extension init. remove functions that belongs in ephyrdriext.c . * hw/kdrive/ephyr/ephyrdri.c: (ephyrDRICreateDrawable): create the drawable on the host X peer window, not on the host xephyr main window. (ephyrDRIGetDrawableInfo): get drawable info of the host X peer window. * hw/kdrive/ephyr/ephyrdriext.c: make ephyr DRI extention wrap a bunch of screen ops so that it can update the host X peer window whenever DRI bound drawable are moved in Xephyr. Also code the building blocks of the management of the host X window peer. * hw/kdrive/ephyr/hostx.c,h: (hostx_create_window): added this new entry point (hostx_destroy_window): ditto ()hostx_set_window_geometry): ditto commit 6d1e44d3d53b451d466d43197be589d0ecc4b9f6 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Sep 4 18:28:16 2007 +0200 Xephyr: fix a host X hang. * hw/kdrive/ephyr/ephyrdri.c: (ephyrDRIGetDrawableInfo): quickly hook this into getting the drawable info from the host X server. For the time being, this only gets the drawable info of the Xephyr main window in the host. It should really get the info of a the peer drawable in the host X. So there should be a peer drawable to begin with. * hw/kdrive/ephyr/ephyrdriext.c: (ProcXF86DRIGetDrawableInfo): some cleanups. Properly get the the drawable info otherwise there is a host X hang. * hw/kdrive/ephyr/ephyrhostglx.c: do not (ephyrHostGLXQueryVersion): do not use C bindings of the glx protocol calls. Some of those actually access DRI context directly, resulting in the context having three clients. Instead all XF86DRI proto fowarding request should be coded by hand and only forward the protocol requests commit a39b57d2f784f14e3198c8506f5eb865bacc2440 Author: Dodji Seketeli <dodji@openedhand.com> Date: Fri Aug 31 16:53:18 2007 +0200 Xephyr: add more logging to GLX forwarding * hw/kdrive/ephyr/ephyrhostglx.c: added more logging. commit 9e192d2118246ad715e23cf5626a038274eb1eaa Author: Dodji Seketeli <dodji@openedhand.com> Date: Fri Aug 31 14:43:39 2007 +0200 Xephyr: better error handling in GLX forwarding * hw/kdrive/ephyr/ephyrglxext.c: fixed various logging functions (ephyrGLXGetStringReal): make sure all the string is sent to clients including the ending zero. * hw/kdrive/ephyr/ephyrhostglx.c: (ephyrHostGLXGetStringFromServer): better error handling. (ephyrHostGLXSendClientInfo): ditto. (ephyrHostGLXMakeCurrent): ditto commit 4dd4be99df38b70d43b02d9cb19e09e0ed94462b Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Aug 30 23:54:49 2007 +0200 Xephyr: Make glxinfo work on the ATI R200 free driver. * hw/kdrive/ephyr/ephyr.c: (EphyrDuplicateVisual): when duplicating the visual, copy the color component masks and the class from the hostX (EphyrMirrorHostVisuals): don't mix blue and green mask. * hw/kdrive/ephyr/ephyrdri.c: add more logs. (ephyrDRICreateDrawable): actually implement this. for the moment it creates a DRI drawable for the hostX window, no matter what drawable this call was issued for. (ephyrDRIGetDrawableInfo): actually implemented this. for the moment the drawable info queried for its attrs is the Xephyr main main window. * hw/kdrive/ephyr/ephyrdriext.c: (ProcXF86DRIGetDrawableInfo): properly hook this dispatch function to the ephyrDRIGetDrawableInfo() function. * hw/kdrive/ephyr/ephyrglxext.c: add a bunch of GLX implementation hooks here. Hijack some of the xserver GLX hooks with them. Still need to properly support byteswapped clients though. * hw/kdrive/ephyr/ephyrhostglx.c,h: actually implemented the protocol level forwarding functions used by the GLX entr points in ephyrglxext.c. Here as well, there are a bunch of them, but we are far from having implemented all the GLX calls. * hw/kdrive/ephyr/hostx.c,h: (hostx_get_window_attributes): added this new entry point (hostx_allocate_resource_id_peer): added this to keep track of resource IDs peers: one member of the peer is in Xephyr, the other is in host X. (hostx_get_resource_id_peer): ditto. commit 8c78df0ea36abc7d46c4f59670289f4280f75507 Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Aug 30 22:31:47 2007 +0200 Xserver: fix potential crash * dix/extension.c: (AddExtensionAlias): don't crash when failed to add extension alias. commit 024abe825cd702334266f6b8da289907bbd05970 Author: Dodji Seketeli <dodji@seketeli.org> Date: Tue Aug 28 15:59:45 2007 +0200 Xephyr: add logging in the DRI extension commit 1dd589410c6c5e8b62b4d15ec681b01452ec68c6 Author: Dodji Seketeli <dodji@seketeli.org> Date: Tue Aug 28 15:58:55 2007 +0200 mirror the visuals of the host X at startup. * hw/kdrive/ephyr/ephyr.c: make Xephyr mirror the visuals of the host X upon startup. This is important for GLX client apps. * hw/kdrive/ephyr/hostx.c,h: add a hostx_get_visuals_info() to get the visuals of the host X. commit 26da625055a3876c93a7a005520657b971748c4e Author: Dodji Seketeli <dodji@seketeli.org> Date: Tue Aug 28 15:55:05 2007 +0200 proxy the glXGetFBConfigSGIX call * hw/kdrive/ephyr/ephyrglxext.c: (ephyrGLXGetFBConfigsSGIX): proxy the GLXGetFBConfigsSGIX call. It is a vendor extension to get the visual configs as a list of name/value pairs. (ephyrHijackGLXExtension): hijack the VendorPriv_dispatch_info dispatch table to register our implementation of GLXGetFBConfigsSGIX (ephyrGLXGetFBConfigsSGIXReal): added this where the real implementation of GLXGetFBConfigsSGIX is. It support bytes swapping. (ephyrGLXGetFBConfigsSGIX,ephyrGLXGetFBConfigsSGIXSwap): these are the dispatch entry points. They just call ephyrGLXGetFBConfigsSGIXReal. * hw/kdrive/ephyr/ephyrhostglx.c,h: reorganize the proxies to get visual params from the host so that they clearly support the different methods of doing so. commit 5af73f98c46dfe5640185ca90feb20c39c6e06fa Author: Dodji Seketeli <dodji@seketeli.org> Date: Fri Aug 24 16:30:50 2007 +0200 EPHYR: Add an experiment proto proxy extension. * hw/kdrive/ephyr/Makefile.am: add the proxy extension to ephyr. The proxy extension is an experimental extension that forwards protocol packets targeted at a given extension to the host X. * hw/kdrive/ephyr/ephyr.c: init proxy ext. * hw/kdrive/ephyr/ephyrhostproxy.c,h: added this new file as part of the proxy extension. * hw/kdrive/ephyr/ephyrproxyext.c,h: ditto * hw/kdrive/ephyr/hostx.c: add the hostx_get_get_extension_info() entry point. commit c06fa924b4781a35b86e4a78d95ff3e9d95b02d1 Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Aug 23 11:53:02 2007 +0200 XEPHYR: more GLX/DRI proxying work. * hw/kdrive/ephyr/XF86dri.c: re format this correctly. Make function decls honour the Ansi-C standard. * hw/kdrive/ephyr/ephyr.c: protect glx/dri related extension initialisation with the XEPHYR_DRI macro. Initialize the GLX ext hijacking at startup. * hw/kdrive/ephyr/ephyrdri.c: add more logging to ease debugging * hw/kdrive/ephyr/ephyrdriext.c: ditto. reformat. * hw/kdrive/ephyr/ephyrglxext.c,h: add this extension to proxy GLX requests to the host X. started to proxy those nedded to make glxinfo work with fglrx. Not yet finished. * hw/kdrive/ephyr/ephyrhostglx.c,h: put here the actual Xlib code used to hit the host X server because Xlib stuff cannot be mixed with xserver internal code, otherwise compilation erros due to type clashes happen. So no Xlib type should be exported by the entrypoints defined here. commit 0b8545144975bf7ed43c2564d01c697144eb1244 Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Aug 16 17:30:13 2007 +0200 Implement ReputImage and StopVideo * hw/kdrive/ephyr/ephyrhostvideo.c/h: (ephyrHostXVStopVideo): add this entry point. * hw/kdrive/ephyr/ephyrvideo.c: Basically add ReputImage and StopVideo implementations. Now, when other windows obscur the video window, the reclipping seems to be well handled using StopVideo and ReputImage. To do this, I was obliged to save the frame in PutImage, so that I could resend it un ReputImage. commit 810dc55866d1c2343512354646c7ab309ea1fad2 Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Aug 16 17:11:22 2007 +0200 Ephyr-Xv: add a new line to a log * hw/kdrive/ephyr/ephyrvideo.c: (ephyrQueryImageAttributes): add newline to log. commit 47e6dff89e48249828e828502e98951eee7f85bc Author: Dodji Seketeli <dodji@seketeli.org> Date: Thu Aug 16 17:07:36 2007 +0200 Xephyr-Xv: fix a crash when host X support several ports * hw/kdrive/ephyr/ephyrvideo.c: (ephyrXVPrivQueryHostAdaptors): properly set port private luke. This fixes a crash when the host Xv supports multiple ports. Make sure number of ports cannot be zero. commit a38ad562a6f50e9d76a37917b936035215ea460e Author: Dodji Seketeli <dodji@seketeli.org> Date: Wed Aug 15 19:40:10 2007 +0200 make xephyr talk DRI protocol with hostX * configure.ac,include/dix-config.h.in: define the XEPHYR_DRI macro. define it when --enable-xephyr and --enable-dri are both turned on. * hw/kdrive/ephyr/XF86dri.c: copy this from mesa source to enable Xephyr to talk DRI protocol the host X. In mesa, this is used by libGL.so to talk DRI protocol with the server. * hw/kdrive/ephyr/ephyr.c: finally initialise the DRI extension in the ephyrInitScreen() function. * hw/kdrive/ephyr/ephyrdri.c,ephyrdriext.c: safeguard the compilation using the XEPHYR_DRI macro. commit e4239a48075c77e6a8d2d5cb21f58dd67687482f Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Aug 14 22:48:41 2007 +0200 Initial dri forwarding big bricks. * hw/kdrive/ephyr/ephyrdriext.c: added this to implement a DRI extension into Xephyr. Normally the DRI extension is only present in the xfree86 server, but I have ported it to Xephyr. The extension calls functions that declared/defined in ephyrdri.h ephyrdri.c that forwards the DRI calls to the host X. It does not work yet, as this entry is just to put the big bricks in place. * hw/kdrive/ephyr/ephyrdri.c,h: declaration & definition of the DRI client API that would hit the hostX server. * hw/kdrive/ephyr/GL/internal/dri_interface.h: added this, otherwise inclusion of /usr/include/X11/dri/xf86dri.h won't compile commit e01d3dd98d1b596e75d25f94dd89c7d41223011d Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Aug 9 10:55:10 2007 +0200 Support clipping region in PutImage. * hw/kdrive/ephyr/ephyrhostvideo.c,h: (ephyrHostXVPutImage): make this support clipping region. The clipping region is propagated to host using XSetClipRectangles. This changes the API of ephyrHostXVPutImage. * hw/kdrive/ephyr/ephyrvideo.c: (ephyrPutImage): propagate the clipping region to the new ephyrHostXVPutImage() entry point. commit 39d3895469f07304d72800d8dcef6c7732f13d5f Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Aug 8 14:27:32 2007 +0200 make EphyrXVPriv be a singleton * hw/kdrive/ephyr/ephyrvideo.c: (ephyrInitVideo) make the EphyrXVPriv object be a singleton instance, otherwise a new object is created at each generation. commit 4ed083095a13ec92bb4c8e705f26500f8312c138 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Aug 7 14:16:13 2007 +0200 add [Get/Put]Video and [Get/Put]Still support * hw/kdrive/ephyr/ephyrhostvideo.c,h: (ephyrHostXVAdaptorHasXXX): fix these. (ephyrHostXVAdaptorHasGetVideo): added this (ephyrHostXVAdaptorHasGetStill): ditto (ephyrHostXVPutVideo): added this (ephyrHostXVGetVideo): ditto (ephyrHostXVPutStill): ditto (ephyrHostXVGetStill): ditto * hw/kdrive/ephyr/ephyrvideo.c: (ephyrPutVideo): implement this (ephyrGetVideo): ditto (ephyrPutStill): ditto (ephyrGetStill): ditto (ephyrXVPrivSetAdaptorsHooks): advertise GetVideo and GetStill when the host X supports it. commit 6f7961bc218169aaa0d10cfad0952adb7fac2f00 Author: Dodji Seketeli <dodji@openedhand.com> Date: Mon Aug 6 18:38:54 2007 +0200 advertise only the hooks implemented by host X * hw/kdrive/ephyr/ephyrhostvideo.c,h: (ephyrHostXVAdaptorHasPutVideo): detect if host X has the PutVideo call. (ephyrHostXVAdaptorHasPutStill): detect if host X has the PutStill call (ephyrHostXVAdaptorHasPutImage): detect if host X has the PutImage call * hw/kdrive/ephyr/ephyrvideo.c: (ephyrXVPrivQueryHostAdaptors): make sure to create atoms for attribute names otherwise subsequent calls to get/set attribute from clients won't work. (ephyrXVPrivSetAdaptorsHooks): don't hardwire advertising of the PutImage call. Instead, advertise the calls advertised by the host. commit 1de89239bdfa68ded2ef25fbb7d08369f527f7a9 Author: Dodji Seketeli <dodji@openedhand.com> Date: Sat Aug 4 01:13:38 2007 +0200 don't crash when hostX reports an error. * hw/kdrive/ephyr/ephyrhostvideo.c,h: (ephyrHostXVLogXErrorEvent): add this to log X error events. Heavily copied from libx11 (ephyrHostXVErrorHandler): new x error handler that logs the error but does not exits. (ephyrHostXVInit): add this to be called at the beginning of xvideo lifetime. It sets an xerror handler that does not exit. * hw/kdrive/ephyr/ephyrvideo.c: (ephyrXVPrivIsAttrValueValid): this validates an attribute value. (ephyrSetPortAttribute): before setting an attribute, validate the new value so that we don't send a buggy request to host X. * hw/kdrive/ephyr/*.c: fix case in ephyrvideo code. * hw/kdrive/ephyr/ephyr.c: fix a typo commit 207714b60d18e94bbe2d755a431dbb29fe5677f7 Author: Dodji Seketeli <dodji@openedhand.com> Date: Fri Aug 3 01:10:39 2007 +0200 first implementation of putimage * hw/kdrive/ephyr/ephyrhostvideo.c,h: (EphyrHostXVPutImage): first implementation. does not support clipping regions yet. * hw/kdrive/ephyr/ephyrvideo.c: (DoSimpleClip): clip using a clipping box. Does not support regions yet. (EphyrPutImage): first implementation. Uses a simple clipping rectangle, no region yet. * hw/kdrive/ephyr/hostx.c: (hostx_get_window): added this to get the main window of the host x. commit aa478e09e25a1cb19b808e7e52b2ee155e34f03b Author: Dodji Seketeli <dodji@openedhand.com> Date: Thu Aug 2 12:49:36 2007 +0200 make properties setting/query code work and hopefully complete. * hw/kdrive/ephyr/ephyrhostvideo.c,h: (EphyrHostXVQueryImageAttributes): add this call. It calls XvQueryBestSize xserver entry point. It uses the protocol level machinery because Xvlib does not expose that entry point as a C function. (EphyrHostXVQueryBestSize): added this wrapper around XvQueryBestSize(). (EphyrHostGetAtom, EphyrHostGetAtomName): added this to get an atom or atom name from the host server * hw/kdrive/ephyr/ephyrvideo.c: (EphyrSetPortAttribute): convert the atom into an host server server atom before attacking the host server with it, because in in its current form, the input atom is only valid in xephyr. This fix makes this call work. (EphyrGetPortAttribute): ditto. (EphyrQueryBestSize): implement this. (EphyrQueryImageAttributes): implement this. commit 24c837c0be6f85a917582156ab61d6c9c69301f9 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Jul 31 23:18:52 2007 +0200 implement setportattribute and getportattribute calls commit b8cd313be467fd14b8e5c9ba68e1a2029c1e888b Author: Dodji Seketeli <dodji@seketeli.org> Date: Mon Jul 23 12:43:43 2007 +0200 make xvinfo work * hw/kdrive/ephyr/ephyrhostvideo.c: (EphyrHostXVAdaptorGetVideoFormats): properly get visual class instead of returning the visual id. (EphyrHostXVQueryEncodings): properly copy the fields because simple casting does truncate some fields. (EphyrHostAttributesDelete): XFree the whole array instead of trying to free invidial members. * hw/kdrive/ephyr/ephyrvideo.c: (ephyrInitVideo): fix a typo (EphyrXVPrivQueryHostAdaptors): set XvWindowMask mask to adaptors type. use host adaptor name. Don't forget to set nImages field. (EphyrXVPrivRegisterAdaptors): report an error when KdXVScreenInit() fails. commit aa2fae7b75f741e57bc4a9b754b5ea7518d78f47 Author: Dodji Seketeli <dodji@seketeli.org> Date: Sat Jul 21 23:56:13 2007 +0200 misc fixes. *(EphyrHostXVQueryAdaptors): return the queried adaptors list * (EphyrHostXVQueryPortAttributes): return port attributes number commit 2bf7f3c223fd32cd4922f98eadda2e3f06d9e119 Author: Dodji Seketeli <dodji@seketeli.org> Date: Sat Jul 21 17:55:12 2007 +0200 link and init xv commit 66b28532e533ff5688705c5286425e68d6403cee Author: Dodji Seketeli <dodji@seketeli.org> Date: Sat Jul 21 12:08:39 2007 +0200 initial commit of xv support work commit 1e8f8b36a56a884092ee01a0bb3f40436e30fa42 Author: Dodji Seketeli <dodji@seketeli.org> Date: Sat Jul 21 18:22:20 2007 +0200 works with no adaptors Debug the early code to make work when the host has no video adaptors commit 50ff2377cac50ae25218be5b30612fb8bf6046a6 Author: Dodji Seketeli <dodji@seketeli.org> Date: Sat Jul 21 18:20:59 2007 +0200 add -verbosity <level> option to command line commit 8426eb2433f964ea19848f24dc99eb4588d10d1a Author: Dodji Seketeli <dodji@seketeli.org> Date: Sat Jul 21 17:55:12 2007 +0200 link and init xv commit 50a64c84e1556ef7f8efcc7f8655e0c5e023ef4d Author: Dodji Seketeli <dodji@seketeli.org> Date: Sat Jul 21 12:08:39 2007 +0200 initial commit of xv support work commit 95fadbd4022ec99f42ba78ec8a18a064903e8a7f Author: Dodji Seketeli <dodji@seketeli.org> Date: Mon Jul 16 17:37:21 2007 +0200 Add basic Exa driver entry point validation. In exaDriverInit(), quickly check if the programmer forgot to set some mandadory driver hooks, in that case display a meaningful error message. commit e5e6514ffa0fd132e0cc1b15b94119e6e8755f43 Author: Andrew Christan <andrew.christian@nokia.com> Date: Tue Oct 2 13:25:51 2007 +0200 Xephyr: add "multiscreen" suport * This patch adds multiscreen support to Xephyr. For instance, the command line : "Xephyr :4 -ac -screen 320x240 -screen 640x480" will launch with two "screens" - namely two main windows. The first main window represents a screen that has the number :4.0, with a geometry of 320x240 pixels, and the second one represents a screen that has the number :4.1 with a geometry of 640x480. The command line: "DISPLAY=:4.1 xclock" will launch the xclock program on the second screen, for intance. * this patch was edited by Dodji Seketeli <dodji@openedhand.com> for: - better style compliance with the rest of the Xephyr code - make sure Xephyr could be launched with no -screen option. By default that creates a default screen of 640x480 pixel like before - display full titles on the windows - with insctructions to grab keyboard and mouse - like before. commit 81692b628f41cb64329f3cccc0503fb216a2b8e3 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Oct 2 13:11:28 2007 +0200 Fix #12650: "windows not receiving mouse events in multiple screens context" * dix/events.c, include/dix.h: (UpdateSpriteForScreen): added this to update the mouse sprite context when we switch from a pScreen to another. * mi/mipointer.c: (miPointerWarpCursor): as we are switching to a new pScreen, don't forget to update the mouse sprite context. commit f965a5f3454a95ddffb2faf9b291feff46305adf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 2 16:20:27 2007 +0930 dix: Ignore devices when deleting passive core grabs. commit dc90d500085dd74e90073be008fc514bd97b160a Author: Dave Airlie <airlied@redhat.com> Date: Tue Oct 2 14:05:07 2007 +1000 exa: increase minor version number for pixmap allocation hooks commit f15af2ae60bb8503c336bc3cba0560bd314a34bc Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Aug 3 16:33:33 2007 +1000 exa: only setup offscreen allocator if driver doesn't provide CreatePixmap commit ffb58f4fa8d86e87f831430b8627f27d85f971a9 Author: Dave Airlie <airlied@redhat.com> Date: Tue Oct 2 14:03:39 2007 +1000 exa: add hooks for drivers to take over pixmap allocation This adds hooks for the driver to access Create/DestroyPixmap and ModifyPixmapHe ader. It allocates a 0 sized pixmap using fb and calls the driver routine to do work of allocating the actual memory. ModifyPixmapHeader is mainly required for hooking the screen pixmap which isn't create by normal methods commit 2b075e97ec913ebe19290181e36bb169410b820b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 2 13:28:40 2007 +0930 mi: switch core keyboard on XI events, not only on core events. We only get core events through the EQ in exceptional cases, so make sure we actually swap the core keymap for XI events as well. Gives us back the ability to have multiple keyboard layouts simultaneously. commit 31555af0005a0bc4d7ef785214696ac84681e29f Author: Dave Airlie <airlied@redhat.com> Date: Tue Oct 2 13:32:57 2007 +1000 exa: add a pixmap private pointer for drivers to retrieve. commit 45ec6cd1fb242363c91ad8af1fd4a27a7f02621a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 2 13:19:07 2007 +0930 xfree86: fix DGA to use the correct devices. DGAStealXXXEvent modified to take in device argument. The evdev driver only sends one valuator when only one axis changed. We need to check for DGA either way (xf86PostMotionEventP), otherwise we lose purely horizontal/vertical movements. Note that DGA does not do XI events. commit 122ae65ed90195c584a770027b4d14ef65f72492 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 2 10:50:59 2007 +0930 xfree86: xf86DGA: some cleanup to use the correct devices instead of VCP/VCK. commit 54ce7436b2579bb20728eab7c8d460b531c378af Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Oct 2 10:49:46 2007 +0930 xfree86: update all pointers when calling xf86SwitchMode Center the frame around the first pointer found and then update all pointers on the same screen to move to the edges (if necessary). Note: xf86WarpCursor needs to be modified, is using deprecated miPointerWarpCursor and will kill the server when called with inputInfo.pointer. commit 113011221a4fcbd70bc592930b35f20d55809f1e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Oct 1 21:42:01 2007 +0930 Xi, xfree86: Remove leftovers of the XI wrapper code. commit 50551ec693f40b91652fe4814e9fe2e1f9ab6517 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 28 15:04:33 2007 -0400 xace: remove obsoleted DRAWABLE_ACCESS hook. commit 8b548657204000e18c7a38706a0071ae2f93159f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 28 13:34:18 2007 -0400 xace: add hooks + new access codes: XKB extension. Removes "LookupKeyboardDevice" and "LookupPointerDevice" in favor of inputInfo.keyboard and inputInfo.pointer, respectively; all use cases are non-XI compliant anyway. commit 5c03d131815cfe2f78792277ab8352e69e830196 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 28 08:02:00 2007 -0400 xace: add new hooks + access controls: XInput extension. Introduces new dix API to lookup a device, dixLookupDevice(), which replaces LookupDeviceIntRec and LookupDevice. commit a511c445debbd13e8c48146ecd2d7c97e793f788 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Sep 28 18:46:41 2007 +0930 Remove generation of core events, long live XI! Let the drivers only generate XI events and put those into the event queue. When processing events, generate core events as needed. This fixes a number of problems with XKB and the DIX in general. The previous approach was to put core events and XI events as separate events into the event queue. When being processed, the server had no knowledge of them coming from the same device state change. Anything that would then change the state of the device accordingly was in danger of changing it twice, leading to some funny (i.e. not funny at all) results. Emulating core events while processing XI events fixes this, there is only one path that actually changes the device state now. Although we have to be careful when replaying events from synced devices, otherwise we may lose events. Note: XI has precedence over core for passive grabs, but core events are delivered to the client first. This removes the wrapping added in 340911d7243a7f1095d79b5b2dcfa81b145c2474 commit be466d8df808c4e4067a7963617bc3f506768f2d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 27 22:23:05 2007 +0930 dix: GetPairedKeyboard() always returns a valid keyboard (VCK if necessary). We need it unconditionally in a few places, and the rest checked for NULL and then set it to VCK anyway. So, fixing up all callers to appreciate the defined return value. commit 53434edc3d306137d019d95189ecdf0dbff75205 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 27 22:14:09 2007 +0930 dix: take paired keyboard instead of VCK (CoreProcessPointerEvents) commit 2d93e69690d2c5d4a89a795ede6423796528e5df Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Sep 27 16:47:06 2007 -0700 Rework local client id finding code to be more uniform commit c7ead3a68e5839cb92129e35b21f55007fba8445 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Sep 27 16:13:28 2007 -0700 xorgcfg needs $(DIX_CFLAGS) for pixman-1 include path commit 62a9fb4cda988a896909a5620a68c51e46d0e403 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Sep 27 16:12:29 2007 -0700 Fix PCI rework build on Solaris (copy what BSD does) commit cfe549d1ba28396c44af94133d8c1d323e3c7086 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Thu Sep 27 22:36:52 2007 +0200 EXA: Added back the maxPitchPixels initialization code. This doesn't add real value yet, but it will be useful once I add code that splits large render operations into smaller parts if necessary. commit c11a27ef85674f1e77ffa7f083646b848e1dc0b8 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Sep 27 14:54:40 2007 +0100 Add the FB_ACCESS_WRAPPER checks commit e0bb33b3d2e4f54cf20853cde9a1664a7dbd0dc7 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Thu Sep 27 14:50:28 2007 +0100 Fix bug #12286 commit 6d5c1e0d896666bcb2b3c1de7bfa424f140be364 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Sep 27 13:04:41 2007 +0200 EXA: Remove bogus pitch checks. exaCreatePixmap should handle all cases correctly. commit 598698678b07cb3a9406a9ee98bd3186366949e7 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Sep 27 13:07:09 2007 +0200 EXA: Punt for all fallbacks in exaFillRegion*. Now that PaintWindow is gone, all callers already handle fallbacks. commit 006f6525057970a74382132237b2131286ad147c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Sep 27 13:08:41 2007 +0200 EXA: Make sure tile offsets passed to drivers are never negative. Thanks to Björn Steinbrink for pointing out the problem on IRC. commit da7d9aa1fb60e13a59c9f842fed7aefc5b97c195 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Sep 27 13:08:40 2007 +0200 EXA: Tile offscreen pixmap coordinate offsets are always 0. commit d6f4764bf5f3a601a0034ded039857e8ea5563b2 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Sep 27 13:08:40 2007 +0200 EXA: Remove some clearly bogus code from exaCopyNtoN. Not sure what I was thinking when I wrote this... it would cause the box coordinates to be off for exaCopyNtoNTwoDir or fallbacks. Thanks to Tilman Sauerbeck for pointing out the problem on IRC and testing the fix. commit c7d6d1f589d729fa689d22d82fe30afbc6e1cacb Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Sep 27 13:08:40 2007 +0200 EXA: Punt on fallback case not handled correctly in exaFillRegionTiled. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=12520 . commit 1d938a80fd4fa58d1791c146b6b5c2dfe148dce7 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Sep 26 19:42:46 2007 -0700 Remove unused pciAddrHostToBus functions from ix86Pci.c Matches linuxPci.c changes made in 8279444a54f38c5e2e5d4c2d936a10d74990e0be Fixes compiler errors: "ix86Pci.c", line 194: too many struct/union initializers "ix86Pci.c", line 204: too many struct/union initializers "ix86Pci.c", line 214: too many struct/union initializers commit de06a47d4ad9c845b098438d9492a5f42483a2ad Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 27 11:45:03 2007 +0930 dix: GetMaximumEventsNum() needs to return 3 + MAX_VALUATOR_EVENTS. Raw events can be generated for pointer events, so 2 + MVE isn't enough. commit 32d0440c7f6e604807cb14dd32349df6f22c903b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 27 11:44:03 2007 +0930 xkb: xkbHandleActions: let wrapping take care of event delivery. This is hopefully better than hardcodey calling CoreProcessPointerEvent. commit 27612748e0ec20f3a23839f0a12e39f598dd722c Merge: b614614 3b114f2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 26 07:47:29 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: dix/devices.c commit 3b114f2603fc2adeec7f5f8f20fe4870afb8dff1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 25 07:55:17 2007 -0400 Input: Properly swap DevicePresenceNotify events. commit 31a7994ac7365562ef1d00e0a7b25f967a961a4e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Sep 24 13:33:01 2007 -0400 Input: Return errors to the dispatcher instead of sending them ourself. Also fixed two "unused variable: stuff" warnings. commit 56ffc381d32687242dd094395fcf2216339bab2a Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Wed Sep 26 16:47:54 2007 +0200 EXA: Removed duplicated exaGetDrawablePixmap() calls. commit aa0325db7e8ab11d9418cae14f11c488f443ccaa Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Sep 26 15:26:42 2007 +0200 Xephyr: fix compiler warnings * hw/kdrive/ephyr/ephyr_draw.c: (ephyrDownloadFromScreen), (ephyrUploadToScreen): fix compiler warnings commit 8f9bf927e1beecf9b9ec8877131ec12c765e4d84 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 18:04:59 2007 +0930 xkb: Unwrap properly in ProcessPointerEvent. Instead of hardcoding CoreProcessPointerEvent, actually try to unwrap properly and then call the unwrapped processInputProc. Seems to be a better idea, especially since it makes stuff actually work... commit 3342b5ad47be25c6838321c0aafc28c329c308b5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 18:03:21 2007 +0930 Xi: fix the wrapper code for processInputProc wrapping. Followup to [1]. If a core grab causes the device to freeze, it overwrites the processInputProc of the device. [1] would then overwrite this while unwrapping, the device does not thaw anymore. Changing this to only re-wrap if the processInputProc hasn't been changed during the event handling. [1] 340911d7243a7f1095d79b5b2dcfa81b145c2474 commit e2cb8515661b1f7826981931d82dee6e05529f04 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 18:01:17 2007 +0930 xfree86: pass in the XKB event processing proc instead of the XI one. We need to pass ProcessPointerEvent or ProcessKeyboardEvent to XkbSetExtension, otherwise we lose the xkb layer. commit 27bc1a8fef2bfd3d62fb44f7c7eb0d463ed08632 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 15:24:41 2007 +0930 xkb: XkbFilterEvents: Remove unused variable compiler warning. commit bfc89c035542a10594f5f0cbde1c7e28b7d024a7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 15:23:37 2007 +0930 xkb: unify ErrorFs. Prefix all with [xkb]. Output for XkbUseMsg intentionally skipped. commit 8b508f5d6bd0d3995294d5ff300a856754442999 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 15:19:53 2007 +0930 dix: unify ErrorFs. prepend all with [dix]. commit 394f3c1dbee7270a1d930846d49278424c3072d4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 15:19:37 2007 +0930 dix: GetPointerEvents: remove unused variable compiler warning. commit 55fd50273ea67eb99a0c8a830349851931298387 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 15:15:34 2007 +0930 Xi: unify ErrorFs. Prefix all with [Xi]. commit 340911d7243a7f1095d79b5b2dcfa81b145c2474 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 15:12:49 2007 +0930 Wrap core event handling through ProcessOtherEvents. When processing events from the EQ, _always_ call the processInputProc of the matching device. For XI devices, this proc is wrapped in three layers. Core event handling is wrapped by XI event handling, which is wrapped by XKB. A core event now passes through XKB -> XI -> DIX. This gets rid of a sync'd grab problem: with the previous code, core events did disappear during a sync'd device grab on account of mieqProcessInputEvents calling the processInputProc of the VCP/VCK instead of the actual device. This lead to the event being processed as normal instead of being enqueued for later replaying. commit b2a4883bd89d406713d4f808e72721ecc1456d67 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 26 09:20:11 2007 +0930 dix: add comments to PlayReleasedEvents() Also stick another warning in, more changes needed for XGE if panoramix is active. commit 275dc77c2972147407584323b866b8acc1654ea0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Sep 25 21:40:08 2007 +0930 dix: add comments to ComputeFreezes() and syncEvents struct. commit ae8b4f7dcf1291a2f5a0d0159f3e6089eea0578a Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Sep 24 22:06:52 2007 +0200 EXA: Added pitch limitations. Drivers can now specify the max pitches that the accelerator supports. commit b61461425eb15fcff2a58330d74fe5a5a1f226fc Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 25 09:56:00 2007 -0400 xace: add hooks + new access codes: XV extension. May need to revisit this extension in the future, depending on observed use. commit 9bd04055a2175ec16756d3bf73ae03b5e163a28a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 25 09:33:51 2007 -0400 xace: change prototype of VALIDATE_DRAWABLE_AND_GC macro to allow access mode to be passed to dixLookupDrawable. commit 988f446fe00ac2b92c484a4440613dd82191eadd Author: Eric Anholt <eric@anholt.net> Date: Mon Sep 24 20:23:35 2007 -0700 [EDID] Ignore reserved bits in deciding monitor vs detailed timing descriptor. Even though they're defined to zero by the spec, we've seen an EDID block where the (empty) ASCII strings were stuffed in a byte early, leading to the descriptor being considered a detailed timing instead. commit 5d9f6cf51becdeb1d2be9bdeec4bb5d0c4dd0e8b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 13 23:33:07 2007 +0930 dix: cosmetic change. Remove "pointer" variable, might as well use pDev. commit c4db4d1fcf7fa2ba802a208beee6b3adc83921f5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 13 23:27:07 2007 +0930 include: remove register keywords. commit 1c25c46f3d5f98be8dbf36684aad4302b220e163 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 13 23:22:27 2007 +0930 dix: fix compiler warnings about unused variables. commit 68e0c4988e359e3c9da933946bc703cf8530bdbc Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 12 20:48:48 2007 +0930 dix: fix "possible use of uninitialized variable" warning. The device passed through to UnrealizeCursor isn't used anyway, so setting it to NULL is enough. commit b484451eab261a919fe94c0c0f56877f7571fc9e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 12 18:34:51 2007 +0930 dix: don't try to access "time" field for GenericEvents in PlayReleasedEvent. GenericEvents can't be parsed to keyButtonPointer, and there's no guarantee that it has a time field anyway. PlayReleasedEvent needs to store the millis when we know it (core events, XI event) and just re-use them for GenericEvents. Yes, this is a hack. But it looks like the time has zero significance anyway. commit 1c38eac442a3ab9e8469e944f382251957996c5a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 12 18:09:57 2007 +0930 dix: fix comment for DeliverDeviceEvents. DDE is not always called, grabbed or focused devices go through Deliver{Grabbed|Focus}Event first. Thanks to Eamon Walsh for spotting it. commit 06188ce90d2a8146140773f9367f23404b464282 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 12 18:00:03 2007 +0930 dix: Make EnqueueEvent aware of GenericEvents. GenericEvents can be > sizeof(xEvents), so we need to make sure we're allocating and copying enough memory for the event. commit 8840829ab93c4eb62eb58753c015da5307133fe5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 12 17:40:11 2007 +0930 dix: don't compress motion events from different devices (EventEnqueue) commit 27ad5d74c20f01516a1bff73be283f8982fcf0fe Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Sep 23 17:17:03 2007 +0300 Input: Generate XKB mapping changes for all core-sending devices (bug #12523) When we change the mapping on a core device, make sure we propagate this through to XKB for all extended devices as well. commit 0e800ca4651a947ccef239e6fe7bf64aab92257c Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Sep 23 12:43:31 2007 +0300 GetKeyboardEvents: Reject out-of-range keycodes (bug #12528) We can only deal with keycodes between 8 and 255, so make sure that we never accept anything out of this range. commit e1860f241b7322c54c109cf5727df45b54b73916 Author: Alex Deucher <alex@botch2.(none)> Date: Sat Sep 22 17:54:51 2007 -0400 Document xf86_crtc_clip_video_helper better. commit 19d30c1c771c0f5c9dfc0f4cfb084dd2e528d992 Author: Alex Deucher <alex@botch2.(none)> Date: Sat Sep 22 17:51:27 2007 -0400 Revert "Fix possible crash if Xv window is outside of either crtc" This reverts commit 92355314103d2193ca20786915eaf608922a36dc. This changes ABI. False means there was a memory failure of some kind, not that the video shouldn't be displayed commit 92355314103d2193ca20786915eaf608922a36dc Author: Michel Dänzer <daenzer@debian.org> Date: Sat Sep 22 14:25:02 2007 -0400 Fix possible crash if Xv window is outside of either crtc commit edd88170836ec985ab1a59179de69d50644b8dff Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Sat Sep 22 13:02:08 2007 +0200 EXA: Check ABI compatibility earlier. If the driver isn't compatible to the server, all bets are off anyway wrt the contents of the fields that we're validating, which can lead to bogus error messages. commit abe0a51f3f790f8c055289465e130177c4b647cc Author: Ben Byer <bbyer@bbyer.apple.com> Date: Fri Sep 21 17:07:36 2007 -0700 So, like, checking return codes of system calls (signal, etc) is good. Also, only restore an old signal handler if one was actually set (prevents the server from dying on OS X). commit eb82b19aa71333b46e927516cc228f25d3e05e4d Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Sep 20 19:55:48 2007 -0700 XDarwin: build fix for X11.app commit 5b08932bfbb7e4612733fffd2acc9682c6856d90 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Sep 20 19:27:31 2007 -0700 XDarwin: pulling in Indirect GLX fixes from downstream commit 742d5d6adc4d4a1b6fceeb3443d7931e107462f7 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Sep 20 18:03:51 2007 -0700 XDarwin: Fixes to quartzKeyboard.c to prevent a crash using certain non-US keyboards commit 374bd88d1025835fe36ca0ff6620eb1d3b0a06b0 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Sep 20 16:50:49 2007 -0700 XDarwin: Merging misc changes from downstream. The only functional changes in this patch are a removal of use of Xtrans internals -- replaced by xcb, which doesn't seem to be used elsewhere in the server? Pity. Also, a fix to make all X11 windows pop to the front of the display when the X11.app icon is clicked -- currently takes two clicks, not sure why. commit 3a965fdadccea7beff09a28c9c0ef4b4975eae38 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Sep 20 16:22:24 2007 -0700 Don't segfault on shutdown if we never managed to connect to dbus. commit 50fa8722d35c12e5f0322cebe25faf99c39d4f50 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Sep 20 14:00:33 2007 -0700 Set noCompositeExtension to TRUE when failing to initialize the extension (e.g. when Xinerama is enabled). commit a247886b082cea93fa8f8980616a9c388ba70111 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Sep 20 13:06:38 2007 -0400 xace: add hooks + new access codes: XF86-Bigfont extension commit f6532a81eec5f096e27285687964b77c17987f72 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Sep 20 12:17:17 2007 -0400 xace: add hooks + new access codes: APPGROUP extension commit 82f7195a628cc7ec94abc0cfe5bae2be8af443bc Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Sep 20 09:17:09 2007 -0400 xace: modifications to ChangeWindowAttributes special case: separate Receive and SetAttr. Refer to 963e69b8efc39369915e7f0c6f370ac0d5d2b60f commit 661b1328cf992d8855552677a94d60de1d8ce942 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Sep 20 08:41:26 2007 -0400 xace: add hooks + new access codes: SYNC extension May need to revisit this extension in the future, depending on observed use. commit 90bacdef723e1e49c72775144916750758d3568c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Sep 20 06:53:51 2007 -0400 xace: add hooks + new access codes: MIT-SHM extension commit 12a18cc8903fac53c3c77b23dd8093187594a4f3 Author: David Nolden <david.nolden.git@art-master.de> Date: Fri Sep 14 22:42:19 2007 +0200 compilation-fix in debug mode commit e93cff52fed9074aa007c2e6ec6b578f69aef3cb Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 19 14:48:20 2007 -0400 xace: add hooks + new access codes: DOUBLE-BUFFER extension commit 082c0f7fb34458ebb303cf875d1d75686eca25e6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 19 13:59:35 2007 -0400 devPrivates rework: move devPrivates field in drawable structure types to just below the DrawableRec. Wish there were a better way to do this but it has to be in the same place for all drawable types. commit 5b36b64192517e2470766ce7ff1d4dc04c936fad Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 19 11:11:54 2007 -0400 xace: add missing argument to hook call. commit 963e69b8efc39369915e7f0c6f370ac0d5d2b60f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 19 11:11:41 2007 -0400 xace: add special-case for just setting the event mask on a window, this should only check "receive" permission, not "setattr" permission. commit c140d20f4ade973496dcbbd06453402ef0c0e85c Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 19 05:58:22 2007 -0700 XDarwin: mass change from using xorg-config.h to dix-config.h cuz we're not using the X.org ddx anymore commit bcb5e3e6276ce9ae7a4dae7434cf2247764da078 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 19 04:46:10 2007 -0700 XDARWIN: More fixes to Makefile.am At least on my system (10.5 with the latest and greatest modules), Xquartz now builds out of the box. It doesn't quite work yet, but hey -- you have to start somewhere. ;) commit 97c150b61bbe436453b05d3c07cd2173870aac40 Merge: 57907e0 547ad21 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 19 07:25:55 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: afb/afbpntwin.c afb/afbscrinit.c afb/afbwindow.c cfb/cfb.h cfb/cfballpriv.c cfb/cfbscrinit.c cfb/cfbwindow.c configure.ac fb/wfbrename.h hw/xfree86/xf4bpp/ppcIO.c hw/xfree86/xf4bpp/ppcPntWin.c hw/xfree86/xf4bpp/ppcWindow.c hw/xfree86/xf8_32bpp/cfbscrinit.c mfb/mfb.h mfb/mfbpntwin.c mfb/mfbscrinit.c mfb/mfbwindow.c mi/miexpose.c Note: conflicts caused by devPrivates rework vs. paintwindow changes. commit 5e209b21f3d6b3268fa7dab1e8df892d8352cc08 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 19 03:44:46 2007 -0700 XNEST: removed obsolete hack to build under Darwin commit 378c7ebef444cdc9ae62ebf05c7111088a0c4bc1 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 19 03:43:40 2007 -0700 XVFB: Removed obsolete hack to build on Darwin commit 7813392d1c9a38d01cfff17732278bb7798eee5d Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 19 01:52:58 2007 -0700 XDarwin: changes to Makefile.am to use new conditionals commit 170fc77d9e73151f5c1c1f0f04598b3497db4284 Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Sep 19 09:54:09 2007 +0200 xserver: don't force DTRACE detection by default this fixes a breakage caused by 7a4ec34e256bf36b041c011a083916ad75a1d8bc. When running a non DTRACE aware system that is not darwin*, DTRACE was getting required. Now it is not anymore. commit 9b4f5157179a0d20756c16ea1f5130b171f72bb1 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Tue Sep 18 21:40:32 2007 -0700 XDarwin: We build many many different targets, let's break them out into autoconf conditionals commit 7a4ec34e256bf36b041c011a083916ad75a1d8bc Author: Ben Byer <bbyer@bbyer.apple.com> Date: Tue Sep 18 20:37:09 2007 -0700 XDarwin: Disable dtrace support on Darwin 9 (since it doesn't work ... yet ...) commit 3c19ec47b434d4ca84db58363cc053cc0b6aa413 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Tue Sep 18 20:15:44 2007 -0700 XDarwin: changed XF86BigFont support default from yes to auto so XDarwin can disable it commit 547ad2125ece93bbe01f6d09a3baf176ebd16bb3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Sep 17 20:33:56 2007 +0200 EXA: Make sure driver hooks get correct offscreen offsets from exaCopyDirty. This should ensure the driver UploadTo/DownloadFromScreen hooks can always work as intended. commit 56cc24ffb21f7fd41f9ea9e8f969aa85021b9f53 Author: Alan Hourihane <alanh@tungstengraphics.com> Date: Mon Sep 17 20:33:56 2007 +0200 EXA: Don't crash in ExaCheckPolyArc. See https://bugs.freedesktop.org/show_bug.cgi?id=12286 . commit 7ac89060e02c7a803018afd580720f8326561fd8 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Sep 17 20:33:55 2007 +0200 EXA: Don't crash in exaGetImage when swapped out. commit 3876c6c80534a6f7412ec806a2ba9ada22c5e505 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Sep 17 18:47:45 2007 +0200 EXA: Fixed compiler warnings. commit d5738ff2e0f93df4729c075ce31a1041d580e50e Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Sep 17 16:59:03 2007 +0200 EXA: Added missing exaPrepare/FinishAccess calls in ExaCheckPushPixels. commit a0dafd95e1e13a2f1b77ab9f82fd365a7be19de5 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Sep 17 16:45:20 2007 +0200 Removed hw/xwin/winpntwin.c from Makefile.am. winpntwin.c was removed in e4d11e58ce349dfe6af2f73ff341317f9b39684c. commit 7bd65577018a574970b767b67967b65fcd5c2bf0 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Sat Sep 15 14:01:57 2007 +0200 Initialize output->pendingProperties. commit b9f7aeb20015290a8acf938a11bf9272bf3527cf Merge: e4d11e5 06d27f8 Author: Eric Anholt <eric@anholt.net> Date: Thu Sep 13 00:15:45 2007 +0000 Merge remote branch 'origin/master' into paint-window Conflicts: mi/miexpose.c commit e4d11e58ce349dfe6af2f73ff341317f9b39684c Author: Eric Anholt <eric@anholt.net> Date: Wed Sep 12 13:58:46 2007 +0000 Remove the PaintWindow optimization. This was an attempt to avoid scratch gc creation and validation for paintwin because that was expensive. This is not the case in current servers, and the danger of failure to implement it correctly (as seen in all previous implementations) is high enough to justify removing it. No performance difference detected with x11perf -create -move -resize -circulate on Xvfb. Leave the screen hooks for PaintWindow* in for now to avoid ABI change. commit 06d27f8045966c1fb154eafaff308a01b93f265b Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Sep 12 23:57:30 2007 +0100 Try again to fix drawable and tile offsets in miPaintWindow Many coordinate spaces are hard. Let's go drinking. commit dd3992eb86377684a5dbe86fa19c756a9e53cda2 Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Sep 12 22:39:31 2007 +0100 miPaintWindow draw to window for background. Instead of drawing to window pixmap for everything, draw to window for background as that works for Xnest and Xdmx; draw to pixmap for borders which neither of those X servers use. commit 6da39c67905500ab2db00a45cda4a9f756cdde96 Author: Eric Anholt <eric@anholt.net> Date: Wed Sep 12 13:23:13 2007 +0000 Fix build on FreeBSD after Popen changes. commit 257c8ed17f4f908e0d0d5e53aaf13aa3b1313f50 Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Sep 12 12:11:49 2007 +0100 Rewrite miPaintWindow to draw to window pixmap. miPaintWindow was drawing to the root window, or (sometimes) drawing to the window after smashing the window clip list. This is losing, and easily fixed by just drawing to the window pixmap. commit 43dc41034735d84765233a78bd619f3f0e7ace75 Author: Brice Goglin <bgoglin@debian.org> Date: Wed Sep 12 01:43:37 2007 +0200 Replace a non-ascii char with the corresponding groff escape in exa.man.pre commit a5b8053606d6e786cdcf6734f271acc05f9cc588 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Sep 11 11:37:06 2007 -0400 Ignore - not just block - SIGALRM around Popen()/Pclose(). Because our "popen" implementation uses stdio, and because nobody's stdio library is capable of surviving signals, we need to make absolutely sure that we hide the SIGALRM from the smart scheduler. Otherwise, when you open a menu in openoffice, and it recompiles XKB to deal with the accelerators, and you popen xkbcomp because we suck, then the scheduler will tell you you're taking forever doing something stupid, and the wait() code will get confused, and input will hang and your CPU usage slams to 100%. Down, not across. commit 2e3e08d31e908ceadeef16d6069cdaf8c61d7ed1 Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Sep 11 08:50:41 2007 +0200 xserver: test presence of strlcpy in configure * configure.ac: define HAVE_STRLCPY when function strlcat is present this serves at least to unbreak libxtrans code compilation. commit e8c73ac697aa472e10b4d8c093a715df0bf545af Author: Dodji Seketeli <dodji@openedhand.com> Date: Tue Sep 11 00:20:45 2007 +0200 Xephyr: fix compilation breakage. * hw/kdrive/ephyr/ephyr_draw.c: (exaDDXDriverInit): pExaScr->hideOffscreenPixmapData does not exist anymore, so don't set it. commit 321e0a21600e418bbeb164043a9a21a0ff80cbe9 Author: Ben Byer <bbyer@bbyer.local> Date: Sun Sep 9 16:28:41 2007 -0700 fixed cut-and-paste typo commit 0ff273fd1e2ea7242b3e6c5effb2a623ef32ec6f Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Sep 6 18:52:26 2007 -0700 XDARWIN: fixes to make Xquartz build again commit f8637137ab43818d45d249b337820cbf427a05ec Author: Ben Byer <bbyer@bbyer.local> Date: Thu Sep 6 05:39:57 2007 -0700 XDARWIN: build fix for quartz/pseudoramiX.c commit e8093e15c7df7a3d5a9717bc9d7d7517b0743f29 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Sep 3 13:52:29 2007 +0200 EXA: Exclude bits that will be overwritten from migration in exaCopyNtoN. Also plug a region leak in exaPolyFillRect. commit e81af8ba643df3be53b0a46d9d4a0eaf21557c9e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Sep 3 13:14:29 2007 +0200 EXA: exaFillRegion{Solid,Tiled} improvements. Use region to exclude bits that will be overwritten from migration. Also make exaFillRegionSolid use the same logic as exaFillRegionTiled. commit 5f7da4da8de7449e1c2a4c679632a0b2a5858b7e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 31 16:59:28 2007 +0200 EXA: Use exaShmPutImage for pushing glyphs to scratch pixmap in exaGlyphs. commit be922b30486abce3a8c13996d579b211a7b56f0e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Aug 30 13:59:07 2007 +0200 EXA: exa(Shm)PutImage improvements. Improve exaShmPutImage performance and reuse its core in exaPutImage as it seems faster than the previous code when the driver doesn't provide an UploadToScreen hook. Make sure all damage records are notified of the damage incurred by actual ShmPutImage calls. Remove superfluous manual damage tracking for actual PutImage calls. commit ea92ea415665e294a1ba233e9a1d39b6daa0cee1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Aug 30 13:54:18 2007 +0200 EXA: exaGetImage improvements. Use the new migration infrastructure to cache FB bits we need in the system copy, for the benefit of repeated calls. commit aa2ed73e0ec881947c969b67269e3206da4de359 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Aug 30 13:50:42 2007 +0200 EXA: Remove superfluous manual damage tracking. These should all be covered by damage wrappers. commit a634c9b03494ba80aeec28be19662ac96657cc23 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Aug 30 13:48:03 2007 +0200 EXA: RENDER improvements. Exclude bits that will be overwritten from migration. Use exaGlyphs even when Composite can't be accelerated, to avoid PolyFillRect roundtrip via offscreen memory. Initialize mask pixmap in exaGlyphs in FB in addition to system if the driver provides Composite hooks to avoid migration overhead. Remove manual damage tracking where superfluous. commit 1f457ff3db24178eefecfbbf177aaf6554adb204 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Aug 30 13:44:20 2007 +0200 EXA: Improvements for 1x1 pixmaps. Initialize system and FB copy in exaFillRegionSolid and adapt exaGetPixmapFirstPixel to the new migration infrastructure. This should mostly eliminate migration overhead for these, whether they are used for acceleration or fallbacks. commit 489bc7551ffc7360ba9648ca5c98b59c7e7a1fd1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Aug 30 13:37:53 2007 +0200 EXA: exaImageGlyphBlt improvements. As we can't actually accelerate anything interesting here, just migrate out once and call fbSolidBoxClipped instead of taking a round trip via offscreen memory with exaSolidBoxClipped. Reuse pending damage region for extents and to prevent any actual migration of pixmap contents when we're overwriting the whole pending damage region. Remove superfluous manual damage tracking. commit 2e0895a4ba27c1308713022820444c8f57f7a69f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Aug 30 13:30:03 2007 +0200 EXA: Improvements for trapezoids and triangles. Only migrate once in exaTrapezoids/Triangles instead of every time in exaRasterizeTrapezoid/AddTriangles. Adapt manual damage tracking to new infrastructure. Also move definition of NeedsComponent() closer to where it's used. commit 6c9d7ed61bc4a19d21c53717b8af3d90b5d82ca9 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Sep 6 13:10:16 2007 +0200 EXA: Hide pixmap pointer outside of exaPrepare/FinishAccess whenever possible. We finally want to catch all cases where the pixmap pointer is dereferenced outside of exaPrepare/FinishAccess. Also fix a couple of such cases exposed by this change. commit 962eddd7a2863a8475f5fd8107d3112df08d1172 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Aug 29 19:55:22 2007 +0200 EXA: Support partial migration of pixmap contents between Sys and FB. The initiator of migration can pass in a region that defines the relevant area of each source pixmap or the irrelevant area of the destination pixmap. By default, the pending damage region is assumed relevant for the destination pixmap, and everything for source pixmaps. Thanks to Jarno Manninen for reassuring me that my own ideas for this were feasible and for providing additional ideas. commit f27931bdd26fc9a1e6bb5173b5537e32c51a98b3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Aug 29 19:41:52 2007 +0200 Add DamagePendingRegion. DamagePendingRegion returns a pointer to the region of a drawable that will be damaged by the current operation for damage records that chose to get damage reported only at the end of the operation. commit 5c7ee3f47fa0c067102a17dee3f75a51cc0bdb3a Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 24 19:24:18 2007 +0200 EXA: Track valid bits in Sys and FB separately. Also consolidate exaCopyDirtyToFb/Sys. commit 8cfcf9973c765f11d1b45b95b8091ef7e01d7f01 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Sep 5 20:10:09 2007 +0200 EXA: Migrate out pixmap in exaPrepareAccess. Also fix exaFinishAccessGC not to use the same index for tile and stipple. commit e510a77ba4d65d5d6ead514cd698f1b1e3f8a2b6 Author: Dave Airlie <airlied@linux.ie> Date: Tue Jul 17 17:16:51 2007 +1000 EXA: Add a couple of missing exaPrepare/FinishAccess calls. commit 72b347e681f5667b68257822e7cec02ab4c9cb6d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Sep 7 14:31:19 2007 +0930 dix: Enabling devices must not overwrite existing sprites/pairing. EnableDevices is (amongst others )called after a VT switch. We must not create a new sprite or re-pair the device, otherwise we lose the input device setup that we had before the VT switch. This requires the devices to be in exactly the same order as before the VT switch. Removing a device while on a different VT is probably a bad idea. commit 57907e0943da0c3fd3bf6c128d210b544629ce72 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Sep 6 16:55:51 2007 -0400 devPrivates rework: register an offset for every resource type, use signed values so -1 actually works correctly, and provide a macro for adding an offset to a pointer. commit 84eb7e62248ddc2761af8cefe33d1b7147477528 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Sep 6 13:36:37 2007 +0100 Fix Xdmx build commit 35ec8b89f4cdf5ec48b292d47b2dad42d2fb9534 Author: Ben Byer <bbyer@bbyer.local> Date: Thu Sep 6 05:34:14 2007 -0700 DDX changes for XDarwin Creating a real DDX section for XDarwin instead of stuffing it into the XORG section in a half-assed manner. commit d627061b48ae06d27b37be209d67a3f4f2388dd3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 18:57:00 2007 +0930 xfree86: wrap keyboard devices for XKB. Call ProcessOtherEvents first, then for all keyboard devices let them be wrapped by XKB. This way all XI events will go through XKB. Note that the VCK is still not wrapped, so core events will bypass XKB. commit 5ee409794ee604fcf84886f70429fc2d6b1ff4f1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 18:52:02 2007 +0930 dix: add XI event support to FixKeyState. FixKeyState needs to be able to handle XI events, otherwise we get "impossible keyboard events" on server zaps and other special key combos. commit 6334d4e7be18de5f237c12a6dc20f75aa23477d0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 18:49:57 2007 +0930 xkb: enable XI event processing for xkb. XI events can now take the same processing paths as core events, and should do the correct state changes etc. There's some cases where XKB will use KeyPress as type for an event to be delivered to the client. Stuck warnings in, not sure what the correct solution is yet. commit 49dbe9a757a3d7a0b9ab318242c6cc0cbd4dd1f0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 17:27:28 2007 +0930 dix: close virtual core devices after other devices. If a device is paired with the VCP, deleting the VCP before the device will segfault the server when the sprite should get updated. commit 03680a384aa423ece75b658f00b96db2628c39fa Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Sep 6 15:43:47 2007 +0930 dix: don't change the device struct while processing core events. The device state needs to be changed while processing the XI event. Core events are always processed after XI, so by then the device is already set up properly. However, we now rely on DeviceButtonMotionMask to be equal to ButtonMotionMask. It already is, but stick a big fat warning in so nobody attempts to change it. This commit disables XKB for the VCK, thus essentially for all devices. Temporarily anyway. commit f3f614cd01ae56d84d61b4f5c907c6edd7c8c6d3 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 5 20:34:00 2007 -0700 Revert "configure.ac: exclude pci-access dependency from XDarwin" This reverts commit 20c6677d1b5f8d77325dd878ffa3df1d0fb01864. commit bf1641b94cffa54b786e18eaeff3839d8790b9f2 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 5 20:33:43 2007 -0700 XDARWIN: Add launchd support This adds a bit of glue to configure.ac to support launchd detection; on OS X (or other platforms which choose to implement launchd), this allows the system to automagically start the Xserver as necessary to serve clients. commit 71c21dea748ea0dcad758679c40ee39192d170f9 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Wed Sep 5 18:45:50 2007 -0700 added HAVE_LAUNCHD check to configure.ac (mostly for OSX) commit 81c28ffd2b13a83770eadcfd7829d35d319d637f Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Sep 5 17:46:23 2007 -0700 Fix key repeats during VT switch. Add keyc->postdown, which represents the key state as of the last mieqEnqueue call, and use it when we need to know the posted state, instead of the processed state (keyc->down). Add small functions to getevents.c to query and modify key state in postdown and use them all through, eliminating previously broken uses. commit e332335241af28ef0ab66b102d0cbc4e5c73ac68 Merge: 7381e91 accd71b Author: Ben Byer <bbyer@bbyer.apple.com> Date: Wed Sep 5 15:51:23 2007 -0700 Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/xserver commit 7381e9149e3cbb7e672070781a16e3f096202be9 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Wed Sep 5 15:51:11 2007 -0700 added an exclusion for setting XORG on darwin commit accd71bda6f958ea6892ad3a10879232d345774c Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Sep 5 14:19:19 2007 -0700 Deliver correct event when releasing keys on VT switch. In commit 41bb9fce47f6366cc3f7d45790f7883f74289b5a, the event delivery loop for Xinput enabled keyboards was changed and accidentally used the wrong index variable, causing random events to be delivered when returning from VT switch. In addition, in commit aeba855b07832354f59678e20cc29a085e42bd99, SIGIO was blocked during delivery of these events, but not for the entire period the xf86Events array was being used. Block SIGIO for the whole loop to avoid other event delivery from trashing the key release events. (cherry picked from commit aa7ed1f5f35cd043bc38d985500aa0a32e857e84) commit 8b77dc7e808f61f1ed10fe05cf898bb47459a76d Author: Ben Byer <bbyer@bbyer.apple.com> Date: Wed Sep 5 14:48:38 2007 -0700 XDARWIN: build breakage fix commit 20c6677d1b5f8d77325dd878ffa3df1d0fb01864 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Wed Sep 5 14:31:01 2007 -0700 configure.ac: exclude pci-access dependency from XDarwin XDarwin doesn't need any of this pci stuff since it doesn't talk directly to hardware, so it doesn't make sense to require it when building on OSX/Darwin. commit ff01e44e33fd072958fb0157dae072f1b1c88944 Merge: 8ba8c16 47300ed Author: Ben Byer <bbyer@bbyer.apple.com> Date: Wed Sep 5 13:56:08 2007 -0700 Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/xserver commit 8ba8c16af773ec83a0b1c0661a23d746b401944e Author: Ben Byer <bbyer@bbyer.apple.com> Date: Wed Sep 5 13:46:30 2007 -0700 build fixes for XDarwin commit 47300ed2be59d0ba7ea9345b954bf3104877c095 Author: Eric Anholt <eric@anholt.net> Date: Wed Sep 5 12:34:29 2007 -0700 Fix server version reporting to be the server package version. Previously, the server version reported by xdpyinfo and Xorg -version would bear some vague resemblance to a X.Org katamari version, but in the presence of modularization (and client-server relationships with different katamari versions on each side) those numbers don't really make sense. Instead, just report the package version. When branching a stable branch, master's version should be immediately updated to the endpoint of the stable branch plus a snapshot of 1 (for example, 1.4.0.1 after server-1.4-branch). The stable branch should then be changed to RC0 at that time (1.3.99.0, for example). This scheme was partially attempted for server 1.3, but lacked the appropriate master updates, thus why it had to be revisited now. While here, we can also remove a lot of versioning complexity since everything is based on the package version. commit 6c89d1237c4fdce961b30a8eaee964af5d56565e Author: Dodji Seketeli <dodji@openedhand.com> Date: Wed Sep 5 17:46:49 2007 +0200 Kdrive: unbreak kdrive linking * configure.ac: re-sort Kdrive libs so that symbols get properly resolved. Basically, all some libs are present in both $KDRIVE_LIBS and $XSERVER_LIBS, and some libs orders are not correct. So I made sure Kdrive servers don't have to link against $KDRIVE_LIBS *and* $XSERVER_LIBS. They just have to link against $KDRIVE_LIBS now. * hw/kdrive/*/Makefile.am: update those makefile to reflect the change in configure.ac commit 0003ccfcdfae1b473aa024342304b84256d378b9 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Sep 5 11:18:36 2007 -0400 xace: add new fields to resource access hook to allow parent resource objects to be passed in at create time. Also added a missing devPrivates initializer. commit 28e48cd8e6e4c412a49d7177daad6d3c93c28e08 Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 5 04:43:17 2007 -0700 Another pathname fix for event_status_driver.h commit b6c0697fd67323893a9ad3676c33f2f1ec48e15e Author: Ben Byer <bbyer@bbyer.local> Date: Wed Sep 5 04:40:03 2007 -0700 fixed path for event_status_driver.h (The path currently used is deprecated on Tiger and invalid on Leopard.) commit c4fff050836feeef8390b7197f1de39af2997811 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Sep 5 16:19:45 2007 +0930 Revert "Input: Fix stuck modifiers (bug #11683)" This reverts commit 6b055e5d9751e3679ff98065e43225ec8a960053. MPX relies on the XI event being delivered before the core event. Device grabs break, amongst other things. I guess stuck modifiers need to be fixed some other way. Conflicts: dix/getevents.c commit bfe6b4d2d9952a80f8dbc63eec974ef894e5c226 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Sep 4 17:44:51 2007 +0930 xkb: Store the action filters per device in the XkbSrvInfoRec. Using a global array for action filters is bad. If two keyboard hit a modifier at the same time, releaseing the first one will deactivate the filter and thus the second keyboard can never release the modifier again. commit cc5c926267be099d793e6dfec17916f21c73c64d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Aug 30 15:51:22 2007 +0930 randr: RRPointerScreenConfigured needs to move all pointers. Previous version only moved the VCP, causing "bogus pointer events" lateron. Now we run through the device list, updating each pointer separately if necessary. Also stick a big warning into RRPointerMoved, not sure what device we need to work on here. commit 136fde2c7b5ed590bc6c63d11ede31e92dc679a2 Author: Ademar de Souza Reis Jr <ademar@mandriva.com.br> Date: Tue Jul 3 13:44:28 2007 -0300 Add Xserver man section about catalogue:<dir> FPE catalogue:<dir> FPEs were introduced in libXfont 1.2.9 commit eb6a933dc60bec5601260794eeb973e946af37b6 Author: Ademar de Souza Reis Jr <ademar@mandriva.com.br> Date: Tue Jul 3 13:44:03 2007 -0300 Add xorg.conf man section about catalogue:<dir> FPE catalogue:<dir> FPEs were introduced in libXfont 1.2.9 commit 205183a733237ea418a25c7423b689fcc8eae628 Author: Eric Anholt <eric@anholt.net> Date: Tue Sep 4 16:19:22 2007 -0700 Fix driver build by including an appropriate Requires.private line on pixman. We'd previously been substituting PIXMAN_CFLAGS, but we've got a better tool now, plus I deleted the PIXMAN_CFLAGS substitution without noticing. commit d67e210f3458b62d7d4a6032aabfda0004d661c1 Author: Gerte Hoogewerf <g.hoogewerf@gmail.com> Date: Tue Sep 4 16:09:38 2007 -0700 Add stub symbols to make xprint build. commit f7f79724fdea0cc6fda0e90e56431df937d49335 Author: Eric Anholt <eric@anholt.net> Date: Tue Sep 4 15:10:49 2007 -0700 Increase despair by fixing xprint build after my _DEPENDENCIES changes. commit e89d16be07e45e487913509788a9e8cb1ee09bc7 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Sep 4 14:49:49 2007 -0700 Revert part of 529acb175440969af9d7fa38aab8d7dea0dc2661 because libtool is smart. commit bf5948518763b5e21eff806a0a9abc5f7757fa10 Merge: 4062db4 735da3d Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Tue Sep 4 22:40:31 2007 +0200 Merge branch 'master' of git+ssh://herrb@git.freedesktop.org/git/xorg/xserver commit 4062db4020c671fc0921a3a4e7fe5d8dc1be2e1d Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Tue Sep 4 22:39:14 2007 +0200 typo in comment commit ce9e83d913511fe619da42f805d7bcd1a2a60d90 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 4 14:01:55 2007 -0400 xace: add hooks + new access codes: Damage extension commit 735da3dcd09f59c40f68eca8c9a91c2e826cd1b9 Author: Egbert Eich <eich@freedesktop.org> Date: Tue Sep 4 16:42:57 2007 +0200 Fixing xf86I2CGetScreenBuses(), now dereferencing the correct pointer. commit 7c5de093d499de63d39fe038d86da0a085262017 Author: Egbert Eich <eich@freedesktop.org> Date: Tue Sep 4 15:07:17 2007 +0200 Fixing sig11 in xf86I2CGetScreenBuses(). Dereferencing a pointer once too often caused a sig11 in xf86I2CGetScreenBuses(). commit 9adea807038b64292403ede982075fe1dcfd4c9a Author: Hong Liu <hong.liu@intel.com> Date: Tue Sep 4 08:46:46 2007 +0100 bgPixel (unsigned long) is 64-bit on x86_64, so -1 != 0xffffffff This patch should fix bug 8080. commit 529acb175440969af9d7fa38aab8d7dea0dc2661 Author: Eric Anholt <eric@anholt.net> Date: Sun Sep 2 15:16:01 2007 -0700 Fix Xorg build by listing circular dependency libraries twice. One of these I introduced by listing dix and mi in the same library list to simplify other servers. The other had been hacked around using libosandcommon, which is now gone. commit c56930e6ca90a61d2f4cbd845f7d0a51a66f83cb Author: Eric Anholt <eric@anholt.net> Date: Fri Aug 31 18:27:41 2007 -0700 Remove backend.[ch] from neomagic to fix distcheck. commit f98dfec79dadb70fa7bba84e7335f92b3a73dc02 Author: Keith Packard <keithp@koto.keithp.com> Date: Sat Sep 1 21:14:22 2007 -0700 [COMPOSITE] Composite used for pixmap population on redirect. (Bug #7447) compNewPixmap copies bits from the parent window to the redirected child pixmap to populate the pixmap with reasonable data. It cannot always use CopyArea as that only works across matching depths. Use Composite when the depths do not match. commit 1afdf8b0a92437dffe84fa98b6083b3d8fd55e27 Author: Adam Jackson <ajax@redhat.com> Date: Fri Aug 31 22:11:13 2007 -0700 [RANDR] Don't mark Xinerama as active if no crtcs are enabled. (bug #11504). Clients expect any Xinerama-enabled screen to report at least one monitor, but with RandR, there may not be any enabled crtcs. In this case, tell the client that Xinerama is not active. commit 0dc2bb6101704d0fd25f36e2c3df79687f119f5b Author: Marius Gedminas <mgedmin@b4net.lt> Date: Fri Aug 31 21:36:37 2007 -0700 [RANDR] Compare only milliseconds of config time. (Bug #6502) The timestamp transferred in the X protocol is a 32-bit number of milliseconds. The timestamp stored in the server is a structure that contains two fields: months (!) and milliseconds. When the server passes the config timestamp to the client, it discards the months part and sends only the milliseconds part. When the server receives the config timestamp from the client, it tries to guess the "months" part by looking at the current time and then maybe adding or subtracting one. The guess is wrong after the server has been running long enough (several hours). I have added two ErrorF calls around the 'if' statement that returns RRSetConfigInvalidConfigTimestamp in randr/randr.c and my Xorg.0.log has this: randr request got good config time: 0:-2103495671 for the first few successful xrandr calls, and randr request failed with RRSetConfigInvalidConfigTime: client passed 1:-2103495671, server has 0:-2103495671 when it fails. The server has been running for 8 and a half hours. The obvious fix would be to ignore the months field and only compare the milliseconds. commit 07630d897ef37cad8b79d073d9edc891d5a7bddd Author: Eric Anholt <eric@anholt.net> Date: Fri Aug 31 15:16:01 2007 -0700 Bug #7364: Require renderproto 0.9.3 on 64-bit, and fix build with it. commit ca82d4bddf235c9b68d51d68636bab40eafb9889 Author: Eric Anholt <eric@anholt.net> Date: Fri Aug 31 13:00:23 2007 -0700 Bug #7186: Fix an excessive request size limitation that broke big-requests. MAXBUFSIZE appears to be a leftover of some previous time. Instead, just use maxBigRequestSize when bigreqs are available (limiting buffers to ~16MB). When bigreqs are not available, needed won't be larger than the maximum size of a non-bigreqs request (256kB). commit a02db0d500cac20d0f0f107d27c064a175018421 Author: Eric Anholt <eric@anholt.net> Date: Fri Aug 31 12:24:07 2007 -0700 Convert servers to using _DEPENDENCIES to ensure proper rebuilds. This cleans up server Makefile.ams a little bit, but also means that people messing with configure.ac need to be careful with whether they put libraries in the _LIBS or _SYS_LIBS targets. Hopefully the comment in configure.ac will clarify the issues. commit c9ceb4878063ca22487c708d9d1f86e367f2cec8 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Aug 31 11:03:54 2007 -0400 xace: add hooks + new access codes: Composite extension commit fd04b983db6a70bf747abe02ca07c1fbbaae6343 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Aug 31 09:55:27 2007 -0400 xace: add hooks + new access codes: Render extension commit 3f42af8c0ef1e5379bc836f589e0cbee43c02ac5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Aug 30 18:22:12 2007 +0930 config: Use [config/dbus] consistently for error messages. commit 0fcde83d94507eadd9f99d4e6a63584b221c989c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Aug 30 18:20:20 2007 +0930 config: return BadValue to caller if add/remove doesn't have parameters. If message iterator cannot be created, the caller didn't supply any parameters. Return BadValue, instead of dying a horrible death while being stuck in an endless loop. commit 87495fc7064d5e0a7575a0713b6895a4172df0fa Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Aug 30 21:57:41 2007 +0100 Allow yres_virtual to be greater for some kernel fbdev drivers. (temporary fix for older fbdev drivers) commit 1005b29cc6939851b40397cc9cd0de9476ad3046 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 30 14:48:24 2007 -0400 xace: Correct some access modes. commit d8ab2353cbd7694b556b7b9d550104dc8c460a1b Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 30 10:39:53 2007 -0700 Remove dead xf86GetPciSizeFromOS and xf86GetPciOffsetFromOS. commit c2d80529fc7f514d80cf3cbed6f580cb999aca1b Author: Eric Anholt <eric@anholt.net> Date: Thu Aug 30 10:20:55 2007 -0700 Remove the now-dead PciAvoid symbol. commit 53f346b158fa8e10de5a8777fa6d8d86f918878b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 30 13:20:04 2007 -0400 xace: add hooks + new access codes: SHAPE extension commit 766c693ef3637ee6fc402df594060ed2c1346761 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 30 13:06:28 2007 -0400 xace: add hooks + new access codes: MIT-SCREEN-SAVER extension commit cda92bbf12107865e93c03c71b901ef51466dc31 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 30 11:48:45 2007 -0400 xace: add hooks + new access codes: XFixes extension. Required a new name argument to the selection access hook to handle XFixesSelectSelectionInput. commit 47ab4d648b31ea1d5800e0bc84cf5f25025bffe3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 30 11:40:39 2007 -0400 devPrivates rework: convert CursorRec and CursorBits over to new interface. commit 1d11e4bc4ccb169fb23fc18583f0b648f0a6a4e0 Author: Egbert Eich <eich@freedesktop.org> Date: Thu Aug 30 12:50:21 2007 +0200 Fixing a misleading comment which could suggest a GPL violation. The author of the int10 code looked at the VBIOS POSTing code in DOSEMU to get some initial idea on how to POST a VBIOS. To give credit to the DOSEMU Team for this inspiration a comment was added to the code which could suggest that code from the GPLed DOSEMU was directly incorporated into this code. This patch should clearify the situation. commit 45efe85003195bd45501630cef08349abb180c3a Author: Eric Anholt <eric@anholt.net> Date: Wed Aug 29 16:05:51 2007 -0700 Remove stale changelogs from kdrive. commit 5aaf00190157114780ab51f7268b396459ed1cad Author: Eric Anholt <eric@anholt.net> Date: Wed Aug 29 16:05:23 2007 -0700 Add more generated files to .gitignore. commit 87295b66a972a2bd194a79af6aa4f715018fcded Author: Eric Anholt <eric@anholt.net> Date: Wed Aug 29 15:54:32 2007 -0700 Bug #9629: Remove badly-licensed neomagic kdrive files. Licensing issues of these files include: - They claim to be licensed under the GPL, yet we haven't allowed that in the xserver repository in the past. - They refer the user to the top of the tree for GPL license text, yet it isn't there. - They claim to be derived from the (MIT-licensed) ati kdrive code, yet don't follow the licensing terms of those files. commit 4795df62456b73c6790f271e0a20a83c60496490 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 29 14:40:10 2007 -0400 xace: add hooks + new access codes: TOG-CUP extension. commit e39694789e31e221fc8dec44ace9c697daf7acad Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 29 14:16:46 2007 -0400 xace: drop map-window checking hook, add new hooks for controlling the delivery of events to windows and clients. This is tentative. It's likely that an additional last-resort hook will be necessary for code that calls TryClientEvents or WriteEventsToClient directly. It's also possible that new xace machinery will be necessary to classify events and pull useful resource ID's out of them. The failure case also needs some thinking through. Should event delivery "succeed" or should it report undeliverable? Finally, XKB appears to call WriteToClient to pass events. Sigh. commit 41355a53c29bbf879da0c6ea562294fcc7ef89ff Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Aug 28 15:10:20 2007 -0400 xace: add hooks + new access codes: core protocol input requests commit adf46b57ce6c69ab13a38b09a8104c802d54d052 Author: Eric Anholt <eric@anholt.net> Date: Tue Aug 28 10:08:38 2007 -0700 Replace BSD custom PCI code with a stub implementation thanks to pciaccess. Note that pciaccess doesn't yet have Net/OpenBSD support, but the relevant code should go there instead of disconnected code in the X Server. While here, remove the now-disabled INCLUDE_XF86_NO_DOMAIN from the headers, and un-disable xf8StdAccResFromOS for those OSes without domain support which will need it. commit 4017d3190234e189a0bbd33193a148d4d3c7556b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Aug 28 09:28:25 2007 -0400 devPrivates rework: since API is already broken, switch everything over to new system. Need to update documentation and address some remaining vestiges of old system such as CursorRec structure, fb "offman" structure, and FontRec privates. commit 85547073265ae9bc4ae3af920a6d3214fd1ca0c5 Merge: 860a09c 7d54399 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Aug 28 07:25:21 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: include/miscstruct.h mi/mibstore.c mi/midispcur.c os/Makefile.am commit 3fe67d23edaae3ddde20cd5f349aa5dfde1d26a3 Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 27 19:02:41 2007 -0700 Remove the BusAccWindows resource code which is now unused. This was a bunch of poorly defined resource ranges per OS/platform combination which were supposed to represent what regions could potentially have resources allocated into them. commit 9e2112b2b56af099a7f380ece9b5c1d25b20cce4 Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 27 18:50:34 2007 -0700 Remove unused xf8GetBlock and xf86GetSparse entry points. commit 801c359574d08ff2d6ac75a3325ff522bc862e30 Author: Eric Anholt <eric@anholt.net> Date: Mon Aug 27 15:46:05 2007 -0700 Fix fbdevhwstub for pci-rework. commit 7d54399cfdaa7f54e28828267a76b89c4e8e798f Author: Keith Packard <keithp@koto.keithp.com> Date: Sun Aug 26 22:11:45 2007 -0700 Add XSERVER_LIBPCIACCESS to xorg-server.h when using libpciaccess commit affda73a1d6e291516880dfbcb74b661374524c6 Author: Eugeniy Meshcheryakov <eugen@univ.kiev.ua> Date: Mon Aug 27 00:41:03 2007 +1000 Xprint: fix handling of TrueType font name Debian bug #272368 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=272368 In certain locales, some characters from some TrueType fonts were not appearing in the Xprint postscript output due to the font not being identified in the postscript output. commit 6f44a2c8a8d6e8f95681ebc7b2dd5ad9c3a02c6e Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Jul 29 14:16:10 2007 -0400 Refactor PictureInitIndexedFormats. The plural version is now static, which is fine since it was only ever called from within picture post-init anyway. The body of the work is now done with a one-shot (public) function that operates on a single format at a time. commit ae7f71a8b3d6756161e55d998d6eec37d2695c98 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Aug 25 15:08:20 2007 -0400 Implement core protocol backing store exclusively in terms of Composite. Composite's automatic redirection is a more general mechanism than the ad-hoc BS machinery, so it's much prettier to implement the one in terms of the other. Composite now wraps ChangeWindowAttributes and activates automatic redirection for windows with backing store requested. The old backing store infrastructure is completely gutted: ABI-visible structures retain the function pointers, but they never get called, and all the open-coded conditionals throughout the DIX layer to implement BS are gone. Note that this is still not a strictly complete implementation of backing store, since Composite will throw the bits away on unmap and therefore WhenMapped and Always hints are equivalent. commit bf0883ae5081bd75569115a3eb27c6d3d336c9f2 Author: David Nusinow <dnusinow@debian.org> Date: Sat Aug 25 14:53:17 2007 -0400 Fix bug in debugging info related to pci-rework merge commit 4eed88af8b7b6881b44ccf9f4a5c5875af6d2b78 Author: Ian Romanick <idr@us.ibm.com> Date: Fri Aug 24 18:06:50 2007 -0700 Remove files made obsolete by pci-rework. commit 1ab4b3e183d04bb20fb5039f7d2671752ab24cf6 Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Aug 24 16:00:31 2007 -0700 Bump video driver ABI for pci-rework. commit 91f358336f77c0e4f577be65cca977d17298e36c Merge: b9a806f 8b6b40b Author: Ian Romanick <idr@us.ibm.com> Date: Fri Aug 24 15:04:21 2007 -0700 Merge branch 'pci-rework' commit b9a806f0b3d495c7616b469281e5892ae7f3f6b3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 24 19:04:55 2007 +0200 exaPolyFillRect: pGC->alu doesn't matter with a single rectangle. commit d0f0d1092c7587a02404e1db07740e6334462ba6 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 24 14:10:13 2007 +0200 exaGetImage: Don't migrate pixmap out of FB with no DownloadFromScreen hook. Based on the assumption that GetImage is relatively rare, so the overhead of the migration is probably bigger than any potential savings. commit 5d9e2c282145897008d7d941e2a0a3fdc71f2373 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 24 14:03:14 2007 +0200 EXA: Improve ShmPutImage. Share as much code with exaPutImage as possible, and fall back to fbShmPutImage when that fails. commit 6085522d91e875c0e1ab8d4300e7378701c19b7c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 24 14:02:35 2007 +0200 Export fbShmPutImage to modules. To be used by EXA. commit c19f227b468d039c5ea136cc8a53c420da30263b Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 24 13:05:52 2007 +0200 EXA: Only mark offscreen memory as used when it really is. commit 095850596114178119a8cc854716ce0cc6e05121 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Aug 24 13:04:48 2007 +0200 __glXDRIbindTexImage: Fail if no texture bound to pixmap's texture target. We would most likely crash somewhere in Mesa if we tried to continue in this case. commit 8b6b40b7271acd81a9548f502c18f46f3b640640 Merge: ab7a6d8 3305d17 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Aug 23 18:19:17 2007 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/common/xf86.h hw/xfree86/common/xf86Init.c hw/xfree86/common/xf86pciBus.c hw/xfree86/int10/generic.c hw/xfree86/int10/helper_exec.c hw/xfree86/loader/xf86sym.c hw/xfree86/os-support/bus/Pci.c hw/xfree86/os-support/bus/Pci.h hw/xfree86/os-support/bus/linuxPci.c hw/xfree86/os-support/linux/int10/linux.c commit 93ae6fe18c417a22f1fccb22add4890a20cae713 Author: Carl Worth <cworth@cworth.org> Date: Thu Aug 23 16:33:05 2007 -0700 Avoid leaking a Pixmap for every glyph commit 3305d17195e3a0a5555300555bd7703312fa489f Author: Matthieu Herrb <matthieu@deville.herrb.com> Date: Thu Aug 23 22:48:19 2007 +0200 Fix indentation. commit a66c0f1dca2958835ff65a5b50579e3304ed316a Author: Matthieu Herrb <matthieu@bluenote.herrb.com> Date: Thu Aug 23 22:11:56 2007 +0200 Remove an extra cast. Thou should not apply patches manually without testing. commit 12d27cf33c6d963eae77795c0d247175907162a5 Author: Otto Moerbeek <otto@openbsd.org> Date: Thu Aug 23 21:59:25 2007 +0200 A high resolution device that's moving fast can potentially generate an int overflow, making dx*dx+dy*dy negative. Now pow(negative, non-integer) yields NaN, so you loose. Use fp math to avoid that. commit ff089e6cae634ac3eb509abd448a250bcbb17275 Author: Brian Paul <brian.paul@tungstengraphics.com> Date: Thu Aug 23 19:38:53 2007 +0200 glx: fix crash when freeing visuals Don't set screen->num_vis to a value greater than the actual number of visuals. X.Org Bug #10809 <http://bugs.freedesktop.org/show_bug.cgi?id=10809> commit 943dd6ad99670c283a6869ea6c5f751acbd73134 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Thu Aug 23 12:15:03 2007 -0400 Revert "Revert "Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fix"" since the pixman changes have been pushed now. This reverts commit 57f7f2a5327a2d967a726bb4706e4f6b2f4b2cea. commit 13949f997289068354e83bc83e50d97b8232efb1 Author: Julien Cristau <jcristau@debian.org> Date: Thu Aug 23 11:27:33 2007 +0200 Get rid of the type1 font module. It is completely replaced by freetype these days. commit 88a9828ef906bba973debc191e35ea669b7ec271 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Aug 23 18:02:10 2007 +0930 dix: Only check device events for possible ACLs. We shouldn't be able to restrict events like Expose, etc. with device based ACLs. So we just ignore all non-input events when checking for permissions. commit 76bf3cd7b8c6189b6b08518cde00c8bd991bdfb7 Author: Dave Airlie <airlied@redhat.com> Date: Thu Aug 23 16:22:03 2007 +1000 randr: fixup crtc and output destroy if you are moving pointers, you want to move the pointers not just a byte commit 81f8b652d99ee0f7116c1e34aed0e585d23a91fb Author: Alex Deucher <alex@botch2.(none)> Date: Wed Aug 22 19:26:34 2007 -0400 Add _X_EXPORT to exported functions in hw/xfree86/modes/* Also add missing exports to hw/xfree86/loader/xf86sym.c commit 57f7f2a5327a2d967a726bb4706e4f6b2f4b2cea Author: Eric Anholt <eric@anholt.net> Date: Wed Aug 22 09:02:03 2007 -0700 Revert "Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fix" The corresponding pixman code hasn't been pushed, so revert until the code is ready. This reverts commit 53941c8e68014619d3ded7f8bc0f07d9a38bb9b1. commit d0dc9698ae4324d44ed4c0482d6858d0b73bff33 Author: Eric Anholt <eric@anholt.net> Date: Wed Aug 22 09:00:45 2007 -0700 Revert "Fix <pixman.h> include to <pixman/pixman.h>" The pixman headers have been located under pixman-1/ instead of pixman/ since around 2007-08-06, and pixman-1.pc has the updated include paths to account for this. This reverts commit feb1b3e45513bd6eaa2e6a5ee536183f20d9cb68. commit bc2d516f16d94c805b4dfa8e5b9eef40ff0cbe98 Author: Eric Anholt <eric@anholt.net> Date: Fri Aug 17 12:14:16 2007 -0700 Fix overly-restrictive integer overflow check in EXA pixmap creation. The result was that at 32bpp, pixmaps of width 8192 or greater couldn't be created, due to treating a pitch value as a width. commit feb1b3e45513bd6eaa2e6a5ee536183f20d9cb68 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Aug 22 16:54:29 2007 +0100 Fix <pixman.h> include to <pixman/pixman.h> commit b6a7c0112c42a3287e53647c38b2c0c5bf8fefa0 Merge: 53941c8 6ef4ecd Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Tue Aug 21 14:26:34 2007 -0400 Merge branch 'master' of ssh+git://sandmann@git.freedesktop.org/git/xorg/xserver commit 53941c8e68014619d3ded7f8bc0f07d9a38bb9b1 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Tue Aug 21 14:26:14 2007 -0400 Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fix bug 11620 (reported by Jens Stroebel. commit 6ef4ecd82670c37a354243166750d76a97959c8b Author: Julien Cristau <jcristau@debian.org> Date: Tue Aug 21 18:17:35 2007 +0200 config: fix default xkb model (pc105, not keyboard) commit 1834cfb4470341aace64a2fa47d04f85dbf98a47 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Aug 21 10:44:37 2007 -0400 Fix an error message to not point to @xfree86.org. commit 265a633cf1fcbf497d6916d9e22403dffdde2e07 Author: Keith Packard <keithp@koto.keithp.com> Date: Sun Aug 19 20:29:37 2007 -0700 Screen size changing should leave FB alone when X is inactive. xf86RandR12ScreenSetSize must protect calls to EnableDisableFBAccess with suitable vtSema checks to avoid invoking driver code while the X server is inactive. commit 7dc8531548cc9573e28bb04363dcbb3af5864c9a Author: Keith Packard <keithp@koto.keithp.com> Date: Sun Aug 19 20:28:05 2007 -0700 Ref count cursors used in hw/xfree86/modes code. The multi-crtc cursor code in hw/xfree86/modes holds a reference to the current cursor. This reference must be correctly ref counted so the cursor is not freed out from underneath this code. commit 1f6ddae003ec65d6bc567831bf32bf75dfefdd6c Author: Alex Deucher <alex@botch2.com> Date: Tue Aug 21 00:37:33 2007 -0400 add xf86_crtc_clip_video_helper to xf86sym.c commit c839859d1bc35451923a2cbd5dfac4f3ca5eb3f9 Author: David Nusinow <dnusinow@debian.org> Date: Mon Aug 20 21:09:27 2007 -0400 Move module defaults from the header to the source file. This is where they should have been in the first place. All the rest of the code in the server defines such things in the source files, not the headers. commit 53c04351c462d2ae307684e50d5960debe1ee557 Author: Alex Deucher <alex@botch2.com> Date: Mon Aug 20 19:46:38 2007 -0400 move intel crtc xv clipping helper to the xserver The code is generic and can be used by any overlay-based card when adding randr 1.2 support. Tested on radeon. commit a1fe36b772f7edc162ea97368f86588c0fb77148 Author: Julien Cristau <jcristau@debian.org> Date: Mon Aug 20 12:57:06 2007 +0200 xfree86: Fix build on Linux/alpha. A bunch of CFLAGS had gone missing, so the build failed with errors like: ../../../../../hw/xfree86/os-support/linux/lnx_ev56.c:7:19: error: input.h: No such file or directory ../../../../../hw/xfree86/os-support/linux/lnx_ev56.c:8:24: error: scrnintstr.h: No such file or directory commit 2c1431a76e7219e3bd14fd7f7888a8bc4fea0f58 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Aug 20 10:06:13 2007 +0930 dix: ProcChangeActivePointerGrab: make sure variable is initialised. Thanks to Ben Close for spotting it. commit 65a49f0ca198e0366175367729a101211388b16b Author: Blair Sadewitz <blair.sadewitz@gmail.com> Date: Sun Aug 19 20:29:22 2007 +0200 Autoconfiguration of wsmouse for NetBSD. commit 3c448b0eb67337b56641e09a6d168aad6745e3ef Author: Fredrik Höglund <fredrik@kde.org> Date: Sat Aug 18 19:02:18 2007 +0200 EXA: Fix a couple of logic errors in exaGetPixmapFirstPixel. The fb pointer would be left uninitialized when exaPixmapIsOffscreen returned false. When it returned true and the pixmap was damaged, fb would be initialized from the pixmap's devPrivate.ptr before the exaDoMigration and exaPrepareAccess calls, at which point devPrivate.ptr would still be pointing at offscreen memory. commit 23fbd5292d356067e85e1eec4eb4f743532b0503 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Aug 17 15:29:16 2007 -0700 Actually build Secure RPC authentication support (missed in modularization) commit 6a32a96d8df184c3ace4847beb48fdcb846d2286 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Aug 16 17:43:29 2007 -0700 stride is in FbBits-sized chunks, but xoff is not. Fixes corruption problems with composite rendering to redirected windows in depth 16. commit 32666d77227fcd2c066de16bf3c07366f92b0457 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Aug 16 14:57:18 2007 -0700 Bug #12015: Use the right offsets in the dst arguments of pixman_blt. commit daee59b1703ac07c2def9e9fecc479e59b93f761 Author: Fredrik Höglund <fredrik@kde.org> Date: Wed Aug 15 19:19:11 2007 +0200 EXA: Wrap Trapezoids to prevent excessive migration of the alpha pixmap. miTrapezoids creates an alpha pixmap and initializes the contents using PolyFillRect, which causes the pixmap to be moved in for acceleration. The subsequent call to RasterizeTrapezoid won't be accelerated by EXA, which causing the pixmap to be moved back out again. By wrapping Trapezoids and using ExaCheckPolyFillRect instead of PolyFillRect to initialize the pixmap, we avoid this roundtrip. commit 860a09cfb8afc0a293c7eb5e01762724eb86847a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 16:10:44 2007 -0400 devPrivates rework: Nevermind, can't const due to return value warnings. This reverts commit 6fd0a0b08de912421718aca17fe34a55ae285ae7. commit 6fd0a0b08de912421718aca17fe34a55ae285ae7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 16:01:42 2007 -0400 devPrivates rework: add const qualifier to key type. commit b2b7817497dd5da73d23ec9cc637c563041fc490 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 15:30:25 2007 -0400 devPrivates rework: use camelcase standard for name of key type. commit 0a994d4f859a4e48d41a90ed9d2a282bb528c555 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 12:54:35 2007 -0400 xace: add hooks + new access codes: core protocol selection requests commit 3ef2e9e623819c625a92f464fb14f1e5c181df42 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 12:27:48 2007 -0400 xace: add hooks + new access codes: core protocol pixmap requests commit be536b79f2a364399937314cfa6c88bf8188da9c Author: Jeremy C. Reed <reed@glacier.reedmedia.net> Date: Thu Aug 16 11:23:28 2007 -0500 Update for support on NetBSD and DragonFly. From Joerg Sonnenberger and pkgsrc. commit 1d4bea6106d7a1c83e1dfe37fad8268589feaa0b Author: Jeremy C. Reed <reed@glacier.reedmedia.net> Date: Thu Aug 16 11:20:12 2007 -0500 Add some more support for DragonFly. From Joerg Sonnenberger and pkgsrc. commit fe9bc481efb0821134e10760c23993c6a7386450 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 12:02:59 2007 -0400 xace: add hooks + new access codes: core protocol font requests commit e89301c8790df9fc49de13dd7c7f36e5340c0c31 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 10:57:49 2007 -0400 xace: add hooks + new access codes: core protocol client requests commit 5bee8db003a5d552ee1d85bb6c40a3cb93bd6b2b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 10:44:51 2007 -0400 xace: drop background-none checking hook, add new hook for controlling access to other clients. commit b82557c9fb60f11fd2696c8fb2ae17b9dfd915ed Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 16 10:36:05 2007 -0400 xace: add hooks + new access codes: core protocol screensaver requests commit 568ae737d1d5d476a0bf85659d88910c4e0ef5e0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 15 14:14:45 2007 -0400 xace: add hooks + new access codes: core protocol server requests commit 14c13b8d62eb37cba8a044daffcddec578ba1644 Author: Dave Jones <davej@redhat.com> Date: Thu Aug 16 09:46:27 2007 +0200 Kdrive: fix nasty thinko in TslibEnable() commit 026534f945ae5652592a090a9d41375ca37ab618 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Aug 15 16:47:53 2007 -0700 Update pci.ids to 2007-08-15 snapshot Remove nvidia ids in extrapci.ids that are now in pci.ids commit 6cef7b9611297cb1d93cefe3890b26b69c87bce2 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Aug 15 16:44:49 2007 -0700 Correct XErrorDB path and make it configurable (used by DTrace support) commit 3c9553ac2cac7f3a41966def44a50d722d7e645b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 15 14:14:25 2007 -0400 xace: rename hostlist security hook to "server" as this hook will be used for other types of server access besides just the host list. commit dc84bb3418933297a8c005070902d9a91ed3d18f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 15 14:13:53 2007 -0400 xace: add hooks + new access codes: core protocol cursor requests commit b424e01ec59d9600a02823f1522949325797268c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Aug 14 13:20:42 2007 -0400 xace: add hooks + new access codes: core protocol property requests commit 14d0397cded699378fa3c19f4e61dbab7d3a9b2c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Aug 15 22:12:29 2007 +0930 dix: ProcUngrabKeyboard: make sure grab is initialized. This should fix the random segfaults with ProcUngrabKeyboard. Thanks to David Nolden for spotting it. commit 0f9e89b4e309e570d7d366489d250ca2143f0ad7 Author: Fredrik Höglund <fredrik@kde.org> Date: Tue Aug 14 22:47:49 2007 +0200 Fix the value comparisons in the IDLETIME wakeup handler. LessThan/GreaterThan comparisons were used in the wakeup handler, and LessOrEqual/GreaterOrEqual in the block handler. Change it to use LessOrEqual/GreaterOrEqual in both functions, since this is what XSyncNegativeComparison and XSyncPositiveComparison imply. commit 42d6112ec21949a336ee8b34469f2695273ee2d6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Aug 14 13:09:38 2007 -0400 xace: add hooks + new access codes: core protocol GC requests commit 9a183d7ba50e31afa133cc03aee7991517a283ea Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Aug 14 11:39:26 2007 -0400 dix: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. commit 2763056ab5ae31bed422a0948198d98c6ace6d55 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 13 13:40:47 2007 -0400 xace: add hooks + new access codes: core protocol window requests commit 6a195e816b9d60f728d77cc1c23538e7af00a879 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Aug 13 10:43:48 2007 -0400 Revert "Implement damage tracking for AIGLX." This reverts commit 2243b30e54df07892f75e3d65b687abe5b183cf3. The existing DRI interface doesn't let us get from a __DRIdrawable to the corresponding X drawable, and thus, we can't implement AIGLX damage tracking with the current interface. commit f367285fd5825e0adc271982a529c9904ad65c89 Merge: b1272ee ff4bd3a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Aug 12 15:31:10 2007 +0930 Merge branch 'master' into mpx Conflicts: Xi/exevents.c dix/devices.c dix/getevents.c include/dix.h mi/mieq.c commit 03f9da672466b9ab9a9814d784b8c44f1030587e Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sun Aug 12 03:07:04 2007 +0200 xfree86: Improve default mouse handling on the Hurd Make /dev/mouse the default device. This makes Xorg works with empty or missing InputDevice sections. commit c5741438a3a171f493e9da32a6b39f73403f6993 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Aug 10 16:13:55 2007 -0700 Only use evdev drivers in Xephyr #ifdef linux commit 59961e47df4ea621a6713a8c7d060555f8746c3a Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Aug 10 16:08:41 2007 -0700 xorgcfg needs PIXMAN_CFLAGS in order to build libc_wrapper.c commit 2243b30e54df07892f75e3d65b687abe5b183cf3 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Aug 10 15:53:05 2007 -0400 Implement damage tracking for AIGLX. commit ff4bd3addb48df3eacc4b121cc249a7f38eb981a Author: Eric Anholt <eric@anholt.net> Date: Wed Aug 8 14:24:42 2007 -0700 Fix the swapped decode of the EDID DTD h/v sync polarity fields. As a result, we can remove the quirks that existed to flip the bits back around for us. This is not confirmed in all cases due to lack of bugs containing EDID blocks associated with the quirks, but is likely true. commit 2926cf1da7e4ed63573bfaecdd7e19beb3057d9b Author: Gustavo Pichorim Boiko <boiko@mandriva.com> Date: Thu Aug 2 18:09:52 2007 -0300 [PATCH] Allocate the right number of entries for saving crtcs commit b2dcfbca2441ca8c561f86a78a76ab59ecbb40e4 Author: Keith Packard <keithp@koto.keithp.com> Date: Wed Aug 8 12:16:12 2007 -0700 RRScanOldConfig cannot use RRFirstOutput before output is configured. RRFirstOutput returns the first active output, which won't be set until after RRScanOldConfig is finished running. Instead, just use the first output (which is the only output present with an old driver, after all). commit b1272eefd9a3e340d65c14903f337747ec82d021 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Aug 8 15:00:02 2007 +0930 Fix typo from last commit. Oh well. commit c02128532e910e813fba94983733942d30c2d5cb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Aug 8 13:10:00 2007 +0930 dix: Allow flexible devices for passive core grabs. A passive core grab doesn't specify the device, and is thus created with the ClientPointer as device. When this grab is activated later, don't actually activate the grab on the grab device, but rather change the device to the one that caused the grab to activate. Same procedure for keyboards. Makes core apps _A LOT_ more useable and reduces the need to set the ClientPointer. Only applies to core grabs! commit ab3f601149e15789edfb7c9a0c33387070279582 Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Tue Aug 7 23:17:32 2007 -0300 Updates some piece of the dead mouse evdev code under the new hotplug scheme. I exported the evdev driver to Xephyr server. I'm running it using something like: $ ./hw/kdrive/ephyr/Xephyr :1 -mouse evdev,,device=/dev/input/event4 -keybd \ evdev,,device=/dev/input/event1,xkbmodel=abnt2,xkblayout=br It also closes /#5668. commit 7d1a749b210ba5b9f8d0e5a1feb9a9ef9fa4d992 Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Tue Aug 7 22:59:12 2007 -0300 Export device path key options to be called by the command line of server. commit aee3588a4a6829326770c84b860061f47f2cbcae Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Tue Aug 7 22:49:07 2007 -0300 Update KdUseMsg() for completeness. commit 30259d5a4e95ff20b30807e5e207ab5995a3fdaf Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 7 20:58:49 2007 +0300 Hotplug: HAL: Fix error handling Don't use our DBusError for property getting, because we simply don't care: this fixes D-Bus error spew to stderr. Thanks Michel Dänzer for debugging and testing. commit aef255425a3521d66c3405d34f7787628a22703e Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 7 16:37:42 2007 +0300 Config: HAL: Use input.xkb namespace Use an explicit input.xkb.foo namespace, not input.xkb_foo. commit 838e59c02ec06446fc180fb9d86fa8793c7b9903 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 6 16:07:20 2007 +0300 configure.ac: Add $CONFIG_LIB to server libraries Make sure all DDXes get $CONFIG_LIB. Build-tested with Xvfb and Xdmx. commit b4193a2eee80895c5641e77488df0e72a73a3d99 Author: Keith Packard <keithp@koto.keithp.com> Date: Tue Aug 7 12:45:53 2007 -0700 RRScanOldConfig wasn't getting crtcs set correctly The output crtc is set by RRCrtcNotify, which is called at the end of RRScanOldConfig. Several uses of output->crtc in this function were wrong. commit 2b93cbb5f8bac9b1b75f723baaa728430b5fefff Author: Keith Packard <keithp@koto.keithp.com> Date: Tue Aug 7 12:44:19 2007 -0700 Decrement mode count when removing RandR output mode. Removing an output mode without decrementing the mode count scrambles the output mode array badly. commit fef4c7a6f1a1ef34233b36137bb66d9a657307fb Author: Eric Anholt <eric@anholt.net> Date: Tue Aug 7 09:01:14 2007 -0700 Fix driver build after pixman changes. commit 1339e57485db5a285cfbecbe0bba7154458680ad Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Tue Aug 7 04:24:34 2007 -0300 Fix typo. commit d9ee5f3e3a3a814ebcd257736c305b41139cc354 Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Tue Aug 7 04:22:26 2007 -0300 Clean a little bit the code. commit 7a5eb3e96b74daaaeb6babf46b13d698280aa3f6 Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Tue Aug 7 02:16:44 2007 -0300 Let xkb options be passed through command line in kdrive servers. I start my Xephyr using something like: ./hw/kdrive/ephyr/Xephyr :1 -fp /usr/share/fonts/X11/misc/ -mouse ephyr -keybd ephyr,,xkblayout=br,xkbmodel=abnt2 commit 955d5f6c0d14fae63bfe7c4ab39ee0a708919479 Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Tue Aug 7 01:39:29 2007 -0300 When we call Xephyr with '-pointer' a new pointer is added inside the server and the Xephyr virtual mouse keeps alive. With this patch the semantic changes turning '-pointer' && 'Xephyr virtual mouse' always false. Now we can open a device pointer and pass its options in Xephyr's command line without having other pointer unused. commit b8abeaf74ee8296d4bc3164a5a253624f984a6d4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Aug 7 12:32:46 2007 +0930 dix: get the paired keyboard for a passive grab (ProcGrabButton). Taking the VCK is only correct if no physical device is connected, and even then it's not really a good idea. commit a0b87f87fb8753955505958bf3d438eef191302d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Aug 7 10:49:33 2007 +0930 dix: check for core event to determine if grab is a core grab (CreateGrab). Checking for VCP/VCK is simply not a safe way to check if a grab is a core grab. commit aa3c6aaaab213200591d29ddb2921adfb87ee5b4 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Aug 6 19:00:59 2007 -0400 Require pixman-1 0.9.4, update pixman includes to new scheme commit 74feba4d77d74979a0ea478d666439ffc55001e5 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Aug 1 14:30:03 2007 -0700 Don't unwrap too early in libwfb for Composite. Don't call fbFinishWrap until the pixman_image_t that stores the pointer is actually freed. This prevents corruption or crashes caused by accessing a wrapped pointer after the wrapping is torn down. commit f6aa2200f2fb4f4d4bb51e67d68e86aabcac0c4b Author: Roland "Test-tools" Bär <roland@verifysoft.de> Date: Mon Aug 6 12:37:52 2007 -0700 Probable off by one buffer overflow in .../xorgconfig/xorgconfig.c X.Org Bug #11858 <http://bugs.freedesktop.org/show_bug.cgi?id=11858> Patch #11005 <http://bugs.freedesktop.org/attachment.cgi?id=11005> commit d744df32a15103aa14237175f506350d25b2fec0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 6 12:23:21 2007 -0400 xace: add hooks + new access codes: core protocol colormap requests commit acc9a42c926a3f84159780de12ecc1dc6186068a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 6 12:16:59 2007 -0400 Temporarily disable Security and SELinux extensions while changes to XACE are being made. commit 102df4f9bac59d95963572d1a7f31d1a064ca4ca Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 6 09:16:30 2007 -0400 xace: drop site-policy and declare-extension-security hooks, add 2 new hooks for controlling access to screens and screen savers. commit 9eddede039f6cbcc323b7e3e4e841c43d3ed4f43 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jul 16 18:01:00 2007 +0930 mieqEnqueue: Don't try to update the time for GenericEvents. Doing so may overwrite the event's length field and cause havoc. Also check if realloc'd memory did actually return valid pointer. commit e717eb82dc2e55f852919312d04f5cfc8ee55bc8 Author: Dave Airlie <airlied@redhat.com> Date: Thu Aug 2 10:50:01 2007 +1000 xserver: stop bcopy from going really slow The outport is most likely unnecessary on any currently used hardware, the byte copy is necessary from what I know on IA64 and friends so leave it. Add a new API entry point which lets a driver select the old behaviour if such a needs is ever found. This gives me ~20% speed up on startup on 945 hardware. commit 600ef07113caa7a901c7d486bc8ebd1ae47f885c Author: Tiago Vignatti <tiagov@balalaika.(none)> Date: Fri Aug 3 15:33:41 2007 -0300 Fix kdrive command line parser. commit 375864cb74cced40ae688078b1f7750998972535 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Aug 3 13:23:34 2007 -0400 security: drop support for XC-QUERY-SECURITY authorization method. commit d445d2f22b5c97fa010370f4ba9cb0555df4a853 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Aug 3 10:56:18 2007 -0400 security: drop the "declare extension security" dix call. Use the SecurityPolicy configuration file instead. commit 0a71e1542a07abc5e32501973a7cf6de3f641317 Author: Carl Worth <cworth@cworth.org> Date: Thu Aug 2 22:48:32 2007 -0700 Create a Picture as well as a Pixmap at the time of AllocateGlyph This avoids some inefficiency in creating a temporary Picture for every glyph at rendering time. My measurements with an i965 showed the previous patch causing a 10-15% slowdown for NoAccel and XAA cases, (while providing an 18% speedup for EXA). With this change, the NoAccel and XAA performance regression is eliminated, and the overall EXA speedup, (before any of the glyphs-as-pixmaps work), is now 32%. commit a2af34d5a861982a03afad8e586bb0181b72bbd0 Author: Carl Worth <cworth@cworth.org> Date: Wed Aug 1 15:48:30 2007 -0700 Use per-screen Pixmaps for glyphs Instead of system-memory data which prevents accelerated compositing of glyphs, (at least without forcing an upload of the glyph data before compositing). commit 19b3b1fd8feb343a690331cafe88ef10b34b9d98 Author: Carl Worth <cworth@cworth.org> Date: Tue Jul 31 17:04:13 2007 -0700 Use strong hash (SHA1) for glyphs Using a cryptographically strong hash means that comparing the hash alone is sufficient for determining glyph equality (no need to compare the glyph bits directly). This will allow us to replace system-memory copies of the glyph bits, (which we've only been holding onto for comparisons), with Pixmaps. commit 516b96387b0e57b524a37a96da22dbeeeb041712 Author: Carl Worth <cworth@cworth.org> Date: Mon Jul 30 17:31:47 2007 -0700 ProcRenderAddGlyphs: Avoid allocating a glyph just to find it cached This is a cleanup without any real savings (yet). Previously, the implementation would allocate a new glyph, then (often) find it in the cache, and immediately discard the allocated object. This re-organization first uses a new FindGlyphByHash function and only allocates the glyph if nothing is found. This isn't a real savings yet, since FindGlyphByHash currently still does a temporary glyph allocation, but this is expected to be replaced immediately as we switch to an alternate hashing mechanism (SHA1). commit 4c6abe1c7c8abcf203572bbf86b21d97ea4e756f Author: Carl Worth <cworth@cworth.org> Date: Mon Jul 30 21:43:20 2007 -0700 Split HashGlyph functionality out into HashGlyphInfoAndBits This is in preparation for a future change that will take advantage of being able to compute a hash for a separate xGlyphInfo and chunk of bits without a combined Glyph object. commit 363d764ea32b938f3dff35df7cf3370363c04d5c Author: Carl Worth <cworth@cworth.org> Date: Mon Jul 30 15:10:11 2007 -0700 ProcRenderAddGlyphs: Take advantage of the for loops to simplify the code a bit commit dc8a528cd6b9a4da3e60fa31428c37f5b34a897f Author: Carl Worth <cworth@cworth.org> Date: Wed Jul 25 14:57:13 2007 -0700 ProcRenderAddGlyphs: Convert while loops to for loops where more natural commit e34fcd2bf42dbd72ab6ce2df80f2dcaa13416e74 Merge: 32c0dcc f3955c0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 2 14:27:03 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: dix/devices.c dix/property.c include/dix.h commit f3955c0a020b39021050cd33c20a17f14fc4b579 Author: Arkadiusz Miskiewicz <arekm@maven.pl> Date: Wed Aug 1 21:04:22 2007 +0300 XFree86: xf1bpp: distclean generated files as well Make sure we clean up after ourselves: not sure why distcheck didn't flag this one. commit a04c95f4446e5c169dea71019321d790ab4fa139 Author: Julien Cristau <jcristau@debian.org> Date: Wed Aug 1 20:37:05 2007 +0300 configure.ac: Fix argument quoting for argv[] m4 quoting. Yar boo sux. commit 99a88826e5e8cfa25c5f8a88c12799d33114729c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 20:34:58 2007 +0300 configure.ac: Actually use -lrt in monotonic clock test If we need -lrt to use clock_gettime, then make sure we link with it. commit 1c80e04f876e9254b93ef87eadfcff71234340c6 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 20:08:31 2007 +0300 configure.ac: Disable D-Bus config API support by default This is problematic, so don't even bother with it unless someone wants it. respeclaration is dead, long live HAL. commit c46663367329615bd2c9b63e93c9534036e5a2ae Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Aug 1 18:32:09 2007 +0200 GLX/DRI: Remove some unused variables. commit 17cb4f64e3c39725e83b1e311c09422d7e1c0e52 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Aug 1 18:13:18 2007 +0200 GLX_EXT_texture_from_pixmap: Use client provided texture target when available. This prevents situations where the server doesn't use the target the client thinks it does, usually resulting in the texture being sampled as all white. commit a4197db9504adae6af005b2218eee36b8af0d98b Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 14:04:51 2007 +0300 GL: GLX: Make sure glxbyteorder.h is distributed commit ad7421fc764e2b82e20d90f12225a03a1d636f18 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 08:30:00 2007 +0300 Bump version to 1.3.99.1 for development This is not actually .1, just bumping for a different devel version. commit 43e71a54502d9ab28ece7f6296d1416d60948dad Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 08:16:35 2007 +0300 XFree86: xf1bpp: Fix previous build system commit Amateur error. commit 6d6bc93b0a13c5356544561e326d4aedf33e61c2 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 08:11:22 2007 +0300 Build system: Add missing files A couple of headers weren't added to the build. commit 505ec436af3a173e0ba32c6f14b4cf9837a553eb Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 08:11:08 2007 +0300 XFree86: Properly clean up after ourselves CLEAN is not a useful variable. CLEANFILES/DISTCLEANFILES, on the other hand, are useful variables. commit 1ace9770fed4a2ba354ff06a96189428beb36088 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 08:10:38 2007 +0300 Build system: Non-dtrace distcheck hacks automake 1.10 really wants foo.c for foo.O, so give it some dummy files to deal with if it really needs them. commit cacbdf18ee771d43228c2e96e8ef9a32251ceb55 Author: Daniel Drake <d.drake@mmm.com> Date: Wed Aug 1 08:08:37 2007 +0300 Remove duplicated licenses Some files had two copies of the same license. commit bd49332e4772bd57ffb76c829f0e4770ab876057 Author: Daniel Drake <d.drake@mmm.com> Date: Wed Aug 1 08:07:08 2007 +0300 Add proper COPYING file I went through the entire xorg-server distribution and aggregated all the licenses I could find (except the questionable GPL files, see my last mail). There are many many permutations on essentially the same license terms, but I have been pedantic and treated slight differences as separate licenses. Here is a description of the process I used: tar xvjf /usr/portage/distfiles/xorg-server-1.1.1.tar.bz2 cd xorg-server-1.1.1 find -name '*.c' -o -name '*.h' | xargs gvim egrep -Rli "permission|copyright" * | grep -v "\.[ch]" \ | grep -v "\.in$" | xargs gvim cd .. tar xvjf /usr/portage/distfiles/xorg-server-1.3.0.0.tar.bz2 diff -urNp xorg-server-1.1.1 xorg-server-1.3.0.0 git clone git://anongit.freedesktop.org/git/xorg/xserver cd xserver git diff xorg-server-1.3.0.0.. For each file, licenses have been aggregated as follows: If 2 files have identical license text but different copyright notices, the copyright notices are aggregated and the license text is included only once. Note that by identical I mean really identical, i.e.: 'AUTHOR(S)' is not the same as 'AUTHORS' 'KEITH PACKARD DISCLAIMS' is not the same as 'KEITH PACKARD AND COMPAQ DISCLAIM' Otherwise, licenses and accompanying copyright notices have been stacked. When going through the changes from 1.1.1 to 1.3.0.0 then HEAD, licenses have been added and removed (so I have reflected this since the original version of my COPYING file). It's slightly concerning to see that even between 1.3.0.0 and HEAD, new license permutations are being added. I'd suggest that a primary license be chosen and this would be indicated at the top of this COPYING file. commit 51b735394f0aa9f953f9c320617c7a56028ec458 Author: Daniel Drake <dsd@gentoo.org> Date: Mon Apr 30 11:37:46 2007 -0400 [PATCH] xserver: Add COPYING terms I went through the entire xorg-server distribution and aggregated all the licenses I could find (except the questionable GPL files, see my last mail). There are many many permutations on essentially the same license terms, but I have been pedantic and treated slight differences as separate licenses. Here is a description of the process I used: tar xvjf /usr/portage/distfiles/xorg-server-1.1.1.tar.bz2 cd xorg-server-1.1.1 find -name '*.c' -o -name '*.h' | xargs gvim egrep -Rli "permission|copyright" * | grep -v "\.[ch]" \ | grep -v "\.in$" | xargs gvim cd .. tar xvjf /usr/portage/distfiles/xorg-server-1.3.0.0.tar.bz2 commit 7fa58385724fa7f441107a1793b601ba3dcb1f4c Author: Arkadiusz Miskiewicz <arekm@maven.pl> Date: Wed Aug 1 08:01:28 2007 +0300 XFree86: xf1bpp: Fix parallel build One of the constructs wasn't parallel-build safe: fix that. commit 18ab4d559409d4b682aab99fb75f8d861122eab6 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 07:27:53 2007 +0300 Darwin: Remove missing file Xserver.m is missing and still hasn't been added, so just remove it for now. commit 0bd6fe7401b2524cf34793c0b0c642e3d32fae00 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 07:27:30 2007 +0300 Config: Add missing include commit 48b3034d13bbbb69072eb11f4579389cc32b0850 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 07:01:51 2007 +0300 Config: Add current FDI file Add the FDI file we're using at the moment, until it gets into upstream HAL. commit 82b720cf3e09d8a6adcd40b25c4d48b34ba1ae80 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 06:57:11 2007 +0300 Config: Fix merge detritus commit 6b055e5d9751e3679ff98065e43225ec8a960053 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 06:55:36 2007 +0300 Input: Fix stuck modifiers (bug #11683) Disclaimer: It's 6:51am. I'm trying to be as understandable as possible. What was happening previously was this: * Press Alt * Extended event generated and processed: state is now Alt down once * Core event generated - keyboard switched: inherited state is Alt down once - event processed: Alt down twice * Release Alt * Extended event generated and processed: state is now null * Core event generated and processed: Alt down once If we switch the order: * Press Alt * Core event generated: - keyboard switched: inherited state is null - event processed: Alt down once * Extended event generated and processed: state is now Alt down once * Release Alt * Core event generated and processed: state is now null * Extended event generated and processed: state is now null When we carry over the previous state, it needs to be the _previous_ state (state and modifiersPerKey), assuming that we're going to catch now-core events for any of these. For example, if Ctrl is held down as we pivot, we need to carry Ctrl over with a count of one, for which an extended + core release will then clear. Carrying over the union of the previous state _and the state resulting from the immediate action_ was what broke things. commit 0e0174d45ecbeb7b6dddc4af53da9d6211038e0e Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 03:30:07 2007 +0300 XFree86: Allow disabling of HAL If NoAutoAddDevices is given as a server flag, then no devices will be added from HAL events at all. If NoAutoEnableDevices is given, then the devices will be added (and the DevicePresenceNotify sent), but not enabled, thus leaving policy up to the client. commit cd8e99e56ec5d02026e401cc15e0f8d75f2a4727 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 03:29:12 2007 +0300 Input: Don't enable devices when we open them Thanks to Xi's braindead design, it's otherwise impossible to query input devices without enabling them. Hurrah. commit 0a31db14b7c7c21ef550dbcc73a9f649f3613cbe Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 02:54:14 2007 +0300 Config: D-Bus core: Fix hook removal Make sure we properly initialise the entire hook when adding it, and bust out when we're done removing. commit 89f628394f7d831f2ba1e45c5884c3983bef6031 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 02:08:02 2007 +0300 XFree86: Input: Fix whitespace commit aec0d06469a2fa7440fdd5ee03dc256a68704e77 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Jul 31 16:33:37 2007 -0700 Fix a crash when rotating the screen. Remember output->crtc before setting a NULL mode because RRCrtcNotify now sets output->crtc to NULL. Use the saved crtc to set the new mode. commit a93033b0bc14ed0bb95c680ded26b63cfe5fd1d3 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 01:53:08 2007 +0300 XFree86: Module: Bump input version config_info changes the size (and ordering) of DeviceIntRec, so bump the input major. commit 1150969b826e2bd6d8345fa245ed499f2e4cf101 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 01:52:20 2007 +0300 Convert all my license statements to the standard form Convert all my license statements to the standard, accepted form: cf. <20070717142307.GD13478@fooishbar.org> http://lists.freedesktop.org/archives/xorg/2007-July/026451.html keithp's license on configure.ac changed with his verbal permission. commit 8658f5d923a69fb55b4cd9e1e84c2d271679f6e2 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 01:10:50 2007 +0300 Hotplug: Add HAL support Add support for HAL-based hotplugging, in which we just get the list of input devices and properties from HAL. Requires an FDI which is not yet in mainline HAL. commit aa75b3481724834da2f855d8dd2ff36074bd5706 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 01:09:07 2007 +0300 Hotplug: D-Bus: Dispatch harder Dispatch until we've got nothing left to dispatch, since apparently dispatching will only ever fire a single message ... commit 4d238c5c67461ed747aa6c021d1532734f4c63fe Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 01:08:26 2007 +0300 Input: GetPointerEvents: Deny events from devices without valuators For some reason, my keyboard has 25 mouse buttons, but zero valuators. This causes GPE to blow up spectacularly, trying to get (and set) co-ordinates from devices without valuators. For now, just prevent this from ever happening, and whack a dirty great FIXME in. commit 7c9e8fd56e1830f7a971187d14877ebbdf35c4b0 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 1 00:19:14 2007 +0300 Input: Allow enabling and disabling of devices Add DEVICE_ENABLE to KDrive and XFree86 to allow us to enable and disable devices on the fly. commit 0afeb0241a83796575da827bd81375c99ff10af5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 20:48:57 2007 +0300 DIX: Clean up null root cursor handling Move the null root cursor handling out of main() and into CreateRootCursor. commit 62ec6d09b3adaea82ff52c8672e6f611c15ec56d Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 20:47:28 2007 +0300 dix.h: Remove duplicate ffs() prototype. commit 4d3379d418a781938358e511fd41deb4115a032c Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 14:31:35 2007 +0300 Fonts: Fix builtin fonts Make sure the font path is always 'built-ins' when we use built-in fonts, rather than having it as a fixed path for a while, then clobbering it halfway through startup. commit 9ac7e8a559fe6008cafc95e8264680c50e72ba19 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 14:30:53 2007 +0300 Hotplug: D-Bus: API version 2 Use uint32s instead of int32s where practical, and add an API version request. Also, try to return all devices added, not just the first, and box device arguments. commit 1cdadc2f43d9069572814510d04b1a560c488fcb Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 14:28:58 2007 +0300 Hotplug: Separate D-Bus into core and hotplug API components Break up D-Bus into two components: a D-Bus core that can be used by any part of the server (for the moment, just the D-Bus hotplug API, and the forthcoming HAL hotplug API), and the old D-Bus hotplug API. commit 8bfa41e1bf3f588780d7e9f6f900b1fde0570a7e Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 04:29:43 2007 +0300 gitignore: Add automake lex/yacc wrapper commit 06dd2748da8b7af343f6cab409b9f351567de5f3 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 00:27:40 2007 +0300 configure.ac: Properly check XFree86 proto modules Not sure why these are conditionals, anyway. This one really needs revisiting, but at least causes configure, rather than the compilation, to bomb out. commit fd10312b4224197b937d9e696b53dc2a16c8912f Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 8 00:26:26 2007 +0300 configure.ac: Fix KDrive VESA/fbdev conditionals Make sure we actually respect anything explicitly given on the configure line, instead of just stomping it with what we detect. commit f37612c6f2375ca904411e6caa0be19fa24f032c Author: Nicolas Trangez <eikke@eikke.com> Date: Sun Jul 8 00:23:57 2007 +0300 Hotplug: Remove unused function definition from hotplug.h configDispatch hasn't been used in a long time. commit 951c058e7800308f7c472e77178c14400f45c1b3 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Jul 31 14:23:58 2007 -0700 Don't fail compScreenInit if the driver added its own alternate visuals. commit 722d73a0ef54c2ebd8ef38c4a6afa0e7c5aa3e30 Author: Dave Airlie <airlied@redhat.com> Date: Tue Jul 31 10:34:56 2007 +1000 Revert "Fix RandR 1.2 conversion of two colour to ARGB cursor on MSB first platforms." This reverts commit 0f057ebb272f0ee0b51b9ab37d4b07da0924fec4. This screws my cursor up just starting a bare X server on Intel, I get the X more like <> than ><.. commit 57b5b97a0710fc043b8a1c01d756cdb73dfe4567 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Jul 29 11:02:47 2007 -0400 ReduceCompositeOp returns a Render op, not a boolean. commit f62beb6f3609e8b6e61325ac89017590811bbd07 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Fri Jul 27 13:23:15 2007 -0400 Remove all trace of Option "BiosLocation". This code was deeply dangerous. If anyone actually had a use for this code, we should find a better way of doing it. commit 486fd4145aed93093d1f1655de40c0a8582bb8b1 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Fri Jul 27 13:10:39 2007 -0400 exaGetPixmapFirstPixel: avoid framebuffer readbacks if possible. If the pixel in framebuffer memory isn't modified since we uploaded it, we can just read from the system memory copy, wihch avoids both a readback and an accelerator stall. In principle this function is still wrong, and all the framebuffer pixel access should be going through (w)fb so we can get pixel layout corrections. commit 50cb6c7e4419e067c1f080d1de940811d21fc725 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Jun 15 15:29:00 2007 -0400 Don't map the front buffer in libdri if the ddx driver doesn't set the size. This lets drivers map the front buffer themselves by setting dontMapFramebuffer. commit cec793ef7a6dac9fa2a6538683e363a72672cde9 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jul 26 11:49:46 2007 -0700 Include picturestr.h in xf86Crtc.h to pick up definition of PictTransform. commit 27845fe197b74bf453d99f352e83513e201fdaae Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jul 26 09:32:16 2007 -0400 libconfig shouldn't be an installed library. commit 276f8e2ca42eec982d16b86d67217d68ff98f81d Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jul 25 17:42:23 2007 -0700 Include comment/copyright/license for AC_DEFINE_DIR in acinclude.m4 commit eba2be448bdd298ff2f7b8603bd9e976da1fdf72 Author: Brice Goglin <Brice.Goglin@ens-lyon.org> Date: Wed Jul 25 20:53:45 2007 +0200 Minor fixes in cvt and gtf manpages Reported by "A. Costa" <agcosta@gis.net> in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432065 commit 8d230319040f0a7f72231da2bf5ec97dc3612e21 Author: Gustavo Pichorim Boiko <boiko@mandriva.com> Date: Tue Jul 24 16:19:19 2007 -0300 Fix the output->crtc initialization in the old randr setup commit 0f057ebb272f0ee0b51b9ab37d4b07da0924fec4 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jul 25 17:04:04 2007 +0200 Fix RandR 1.2 conversion of two colour to ARGB cursor on MSB first platforms. Doesn't seem necessary to do anything here... commit 5b424b562eee863b11571de4cd0019cd9bc5b379 Author: Gustavo Pichorim Boiko <boiko@mandriva.com> Date: Mon Jul 23 18:27:41 2007 -0300 Set the crtc before the output change is notified Set the new randr crtc of the output before the output change notification is delivered to the clients. Remove RROutputSetCrtc as it is not really necessary. All we have to do is set the output's crtc on RRCrtcNotify commit 7da38bb6a15247948c90e00a59230453fcf13cbd Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Jul 21 15:27:40 2007 -0400 Partial redundancy elimination in PropertyNotify generation. commit 0f91abd5c68eb044d09733d18ef0f6b8ed128200 Author: Julien Cristau <jcristau@debian.org> Date: Thu Jul 19 20:37:26 2007 -0400 Fix alpha build failures Don't include <asm/pci.h> in os-support/linux/lnx_axp.c, use "lnx.h" and <unistd.h> instead commit dc9c5196282ba61bd542e198dfe0d53d93181591 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Jul 19 13:28:00 2007 -0700 Make PreferredMode option in config file override EDID mode preferences. When the PreferredMode option is selected in the config file, remove the M_T_PREFERRED bit from all other preferred modes to force the config file mode to be selected. commit 73a93c5a6b68f7ba21f9e75f50b1032603a3b39e Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Jul 19 13:26:36 2007 -0700 Query modes on disabled (but not ignored) outputs. Code that disabled mode detection on disabled outputs would confuse applications by listing said outputs as connected but without any modes. This makes the disabled state in the config file affect only the initial configuration and not subsequent modifications by RandR. commit 9fc36a391c11170cde1a28f548a2cae5f6f20d5b Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Jul 14 12:36:15 2007 -0700 Make pending property changes trigger mode setting. The DDX code was ignoring pending properties for computing when mode setting was required. This meant that configurations differing only in property values would not cause the mode to be set. commit aed6569309223ecc7e26fa84e4d430e422455607 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Jul 14 15:21:46 2007 -0400 Refactor how Composite adds visuals to the screen. Besides being slightly simpler to read, it's now trivial to add a depth-16 visual to a depth-24 screen just by adding a line for it in the alternate visual list. Visuals for indexed depths are slightly tricky still. commit 21bbd7d64b5f74915afd7a312e589654442f3461 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 21:42:50 2007 -0500 Delete some pre-dlloader debugging scaffolding. If your loader is as bad as elfloader, then it makes sense for the server to have some stubs for you to assign to / break on. However it is no longer 1996. commit 1f71f0c0574bafb36da20fec669f9a1138c69a47 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 21:28:03 2007 -0500 Remove (long-)deprecated xf86EnablePciBusMaster. commit 0a63d874e9c2f4fe4b38839a744461f9d41040b2 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 21:22:49 2007 -0500 Always normalize the module name. commit 9a1c6afd12caf0143483f72bfbba0c4c3daaa6ff Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 21:19:50 2007 -0500 Remove dead code for screen crossing. commit 8ca2fe8914af1a67bf597f99025e5cbe9b08da57 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 21:11:13 2007 -0500 Delete dead module test code. commit e2413cc7cae4e578b8e9b408ea85bef596b03ea3 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 21:07:37 2007 -0500 Remove MEMDEBUG This existed (but may not have worked) in the monolith, but is gone now. commit d1d65a84150dfbc3a4dbe108f237a85ab6e09bbb Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 21:01:08 2007 -0500 Dead ifdefs for BITMAP_SCANLINE_UNIT == 64 This appears to be a legacy of cfb24 not being smart enough to deal with this case. But since cfb24 unexists, die die die. commit cbe74394a5ed21ed80c0aab6eefd2716122cce11 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Feb 6 20:44:34 2007 -0500 Nuke dead X -configure code. commit 5657fb065cc79ba3ca5a836f45637ba9894f9abf Author: Dodji Seketeli <dodji@seketeli.org> Date: Tue Jul 17 12:12:02 2007 +0200 exaDriverInit: Fail if pScreenInfo or a member of it is invalid. EXA may attempt to use the invalid value and crash otherwise. commit bbe7ce10fa93017374d7a4611427b70a22d7507a Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jul 16 17:25:59 2007 -0700 Update pci.ids to 2007-07-16 snapshot Remove nvidia ids in extrapci.ids that are now in pci.ids Add nvidia ids to extrapci.ids that are in xf86-video-nv but not pci.ids commit ac979c165128704116cd40086320b6edc79018e2 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Jul 14 12:13:17 2007 -0700 MakeAtom needs length without trailing NUL. sizeof("string") includes NUL. I made a mistake in some new code using MakeAtom, passing the size of the string instead of the length of the string. Figuring there might be other such mistakes, I reviewed the server code and found four bugs of the same form. commit 393171034c15d8a1b82232b8f9455a358035e932 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Jul 14 09:03:40 2007 -0700 Add RandR reflection support. Replace the ad-hoc transformation mechanisms with matrices. Prepares for more general transformation as well. commit 8773ad023eb28950eb0f802d2ca31a67f84adddc Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Jul 14 08:47:50 2007 -0700 Screen size bounds check in ProcRRSetCrtcConfig not masking out reflections. When checking how to validate the selected mode and position against the current screen size, the test against 90/270 rotation did not mask out reflection, so that when reflection was specified, the 90/270 test would never succeed. This caused incorrect bounds checking and would return an error to the user instead of rotating the screen. commit 881a620b4d6ea7a54af14c8f8fbe6924c9aa9291 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Jul 14 08:45:10 2007 -0700 When sync'ing logfile, also flush it. When the logfile is set to sync, the actual sync occurs whenever the log file is flushed. If the log file is not also set to flush, no syncing occurs. commit 031b009ea678809bf1ddca883c2082b304c408c9 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Jul 13 14:54:45 2007 -0700 Use %S instead of %s for strftime seconds when printing build time commit c0e91777a9874fe2cd9a7e9180263f512c1e8f8d Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jul 12 16:37:11 2007 -0700 Add __SOL8__ to xorg-server.h.in since xf86-input-kbd needs it to build commit 6b4231e3b5b49b731c9a00930ae465fff8539831 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jul 12 16:36:27 2007 -0700 Use kbd driver when xorg.conf specifies "keyboard" or "Keyboard" (bug #11301) X.Org Bug #11301 <https://bugs.freedesktop.org/show_bug.cgi?id=11301> Sun Bug #6560332 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6560332> commit 9fcb30ebf7b7b2137955f759e95c1d58c4f27a11 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jul 12 13:00:32 2007 -0700 Make SOLARIS_INOUT_ARCH substitutions work better with automake-1.10 commit 7c0ca27f6dd0a800dc27429a33dbc8e133f9a9c1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jul 11 17:15:29 2007 -0700 "fbpict.c", line 215: void function cannot return value commit 0a4e9311158ed3ecda0722640f860ace2f87a97e Author: Hanno Boeck <hanno@gentoo.org> Date: Thu Jul 12 10:17:07 2007 +1000 xnest: fix linking since dbus Fixes bug 8955 commit b2f9ca6ac400d426d7a1ef0162f7e7ce28288dd1 Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Jul 10 21:33:34 2007 -0700 Redirect fix: Manual + Automatic - Manual = Automatic A window with redirect manual *and* redirect automatic which loses the manual redirecting client becomes redirect automatic. commit 561989f2f0fc31e3d3bf8df978a9cb3d4c85af59 Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Jul 10 21:06:51 2007 -0700 Generate ChangeLog file for make dist. Copy Makefile.am snippet which generates a complete git change history to the ChangeLog file during the distribution generation process. commit e316fa59fea8b7b18cdf3a227890351a9567ec65 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Jul 10 14:20:55 2007 -0400 Add per-monitor config file option for maximum pixel clock. commit ffdf8f3e452638e6b050fccabee465d6c0300f45 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jul 10 13:56:38 2007 +0930 DeliverEventsToWindow: ensure that genericMask has a defined value. commit 161624a5a45808fd56141dc2c64be729944f03ed Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Jul 10 09:02:40 2007 +0200 GLX: Only build code dealing with GLXPixmap damage field when DRI is enabled. commit 4abd00dab7e648dab8172f6009371e4e63d0c521 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Jul 10 09:02:08 2007 +0200 Make sure DRI drawables are cleaned up when client dies. The previous scheme didn't work when the client didn't create the core drawable, e.g. the root or composite overlay window. Use refcounting via special client resources to fix that. commit 583e988b9f7cfb9293144c8309023c0dd1766715 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jul 10 09:19:02 2007 +0930 Install geext.h, otherwise drivers won't build. commit 9809715afaafee9baf2aef348c1ebda7e8b3f076 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jul 9 10:42:03 2007 +0930 Change CheckMotion to ignore non-pointer events but acknowledge XI events. Call CheckMotion from ProcessOtherEvents() to make sure absolute XI events update the sprite before an event is sent. commit 62efc3951a96648cf975302aa6651cb67b87fa64 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jul 6 17:00:20 2007 +0930 DeliverGrabbedEvent: stop segfault when gemask == NULL. commit 3312e4dd5e055b2cb445b5d5c617aa7a611eedc1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jul 6 16:41:52 2007 +0930 Call CheckMotion for all core events. We need to do this to update the sprites x/y coordinate before we assemble a button event. Absolute devices may send a buttonEvent with valuators attached. If we don't update the sprite before assembling the event, the valuators are lost and the button press is delivered to the previous position of the device. Doesn't have any effect on relative devices. commit c1a6841a64576b7e688e9ca0d3e0db8acf52d4ae Author: Paulo Ricardo Zanoni <prz05@c3sl.ufpr.br> Date: Tue Jul 10 10:08:44 2007 +0930 ProcX{Change|Query}WindowAccess: change device list from char* to XID*. commit 5957aa6fdc580ccad4557eeefa0636ffad823f33 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jul 9 08:47:05 2007 +0200 Fix regression from recent composite changes. One pWin->redirectDraw test was converted incorrectly, causing incorrect rendering in some cases. commit 5ccc09b18244f91a06b3bea20b02a97280d1a229 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jul 6 15:43:08 2007 +0930 Use the same struct for generic event masks throughout the code. Renaming those structs too. Previously grabs were using a different struct than windows, which was reasonably stupid. commit bcb23527421578bd4c9397d4c2c19cbefa22fc59 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jul 5 15:56:25 2007 -0400 Clean up unused #ifdefs from fb. commit 9ff7ff2fda30f334515b16ef0867c1500c41bc0f Author: Keith Packard <keithp@neko.keithp.com> Date: Wed Jul 4 23:38:27 2007 -0700 Fix MEMORY SMASH in XkbCopyKeymap. XkbCopyKeymap reallocates the destination keymap when it is not large enough to hold the source data. When reallocating the map->types data, it needs to zero out the new entries. The computation for where to start bzero'ing was accounting for the size of the data type twice, once implicitly in the pointer arithmetic, and once explicitly with '* sizeof (XkbKeyTypeRec)'. This would often lead to random memory corruption when the destination keymap had existing map->types data. commit 9131d560a0d42067cc4e726e445e060216c9acdc Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Thu Jul 5 02:47:34 2007 -0300 Postpone options variable assignment to fix segfault when we got a device but its driver is incorrect. Also if (!ki && !pi) can never be true. This one also adds the device option field. commit 41b485d5507821e41c3281c3c565647ae7582101 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Thu Jul 5 02:40:07 2007 -0300 kdrive must to know that devices are unplugged. commit a92dc6b5295e4f352115fed2856169929819863f Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Thu Jul 5 02:28:14 2007 -0300 Remove redundant linking in kdrive. Fix configure.ac variable name and clean it up a little. commit 41b5155c8be75c4e171c0f64616cc09598b8ec54 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Thu Jul 5 01:57:41 2007 -0300 For each kdrive server put a dependencie on its own libraries. commit 16e429bcbf2f62cfc58162ab2857afb7376dda41 Author: Jonathan Lim <jlim@sgi.com> Date: Wed Jul 4 20:08:49 2007 +0200 Bug 5000: Fix domain support for SGI Altix commit f106c04b627d9f57b38627971dc79c75129e66d6 Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Jul 3 14:47:19 2007 -0700 Have Composite always report server version. It was reporting the lessor of the server and client versions, which doesn't make sense with the 0.4 semantic change in clipping. commit 4f88d68bdb90cc7d12170355105b4fd020acd306 Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Jul 3 14:43:17 2007 -0700 Force advertised Composite version to 0.4 instead of using header version. Installed protocol header version may be newer than the server code base. Use internal version number for Composite extension to make sure the server doesn't advertise capabilities it doesn't support. commit 866f092ca0160a366add01b48ad03438926c4d16 Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Jul 3 14:29:11 2007 -0700 Make Composite manual redirect windows not clip their parent. This patch changes the semantics of manual redirect windows so that they no longer affect the clip list of their parent. Doing this means the parent can draw to the area covered by the child without using IncludeInferiors. More importantly, this also means that the parent receives expose events when that region is damaged by other actions. commit 2a75c774975b50dd4e71b7dbea7bd65ca2984a43 Author: Dodji Seketeli <dodji@seketeli.org> Date: Tue Jul 3 11:00:29 2007 +0200 ExaOffscreenMarkUsed: Don't crash when there's no offscreen memory. commit 0ede39a25cf5b0b6c2c89677f810c21ce42b95df Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Jul 3 10:55:13 2007 +0200 Fix build when int10 doesn't use x86emu. commit 028a00bc518dc6908839e8ce7c50ab1837100945 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Jul 2 18:41:55 2007 -0400 Make x86emu's I/O cycle tracing more useful. Print debug messages only when the appropriate debug bit is set in the 8086 state vector, so you can focus in on the call you're actually interested in. commit 00e8295b7e0c7c0ba97707903004272818e3d87d Author: Gero Mudersbach <geroxp@web.de> Date: Mon Jul 2 11:40:11 2007 -0700 Bug #10814: Add needed quirk for Samsung 225BW like the 226BW. commit 667e95f2e8389d9f23c50446d6d664eddd16d260 Author: Eric Anholt <eric@anholt.net> Date: Mon Jul 2 11:36:11 2007 -0700 Correct the xf86EdidModes.c file description. commit 3de1f0d03b329b01856f664651db23ffefb58646 Author: Eric Anholt <eric@anholt.net> Date: Tue May 29 10:08:58 2007 -0700 Fix documentation of association of outputs to monitor sections in xorg.conf(5) commit c1a16bdcfe7aa907fe78f27dc606a8e5a2699952 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 27 18:08:03 2007 +0930 Add 'evfill' field to GEExtensions. We need this to allow extensions to fill in extra data for an event before it is sent to the client. This is probably to be used like FillUpEventsFromWindow(). commit 4d76075dbb618a47ff9fc15c4be2e2d34210fa8d Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Fri Jun 29 14:06:52 2007 -0400 Death to RCS tags. commit 2691c05fd647d9fa10f791ac397ecb9c423a076f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jun 29 11:56:18 2007 +0930 Make sure window->optional is allocated before assigning it. DeletePassiveGrabFromList() may remove the window optional, so we need to re-alloc it if it isn't there anymore. Thanks to Colin Harrison for spotting the bug. commit f7f3fe7fe7233a2ffc43106c48f44cbbd82b7c19 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jun 28 18:59:05 2007 -0400 Remove the remnants of OS/2 support. This has never worked in any modular server release, and as far as I know was never tested in 6.7 through 6.9. commit 8a06ff9ffa4816d192e58e43e7fe569b97b4dd7c Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jun 28 16:41:28 2007 -0400 Fix another usage of MAX_PCI_DEVICES. Fixes cases where the VGA device is above the 128th device on the system. commit 928836a5abd85466e920eb487fab9ccb295e0c5b Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jun 28 16:29:28 2007 -0400 Bug #10770: "Inputdevs" isn't a valid config file keyword. commit 62f43d8b33f67d8f3d0bd65787ffae9e6b634d65 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 27 16:24:42 2007 -0300 Relink properly all kdrive servers when changes happen. commit 3860996d5666b76600b1537e2cbd58e36b086308 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 27 16:06:12 2007 -0300 Remove double-defined. commit 1e189ed1daab58c1de67d387306fde0a9e7984a4 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Jun 27 10:16:40 2007 -0700 Handle tileStride > 1 in fbEvenTile. Patch courtesy of James Jones. commit bf1ad1aa4270dccf1540943d97e80b317c0adb56 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jun 27 09:19:28 2007 -0400 Add VBE PanelID support. Originally found only in the i810 driver. commit d73835efda4995a310188537233a984f4b73628d Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 27 03:34:13 2007 -0300 More janitor work. Remove 'defined but not used' warnings from kdrive and some minor cosmetic. commit 38f8e536684193c3f70b23be22d818053c676072 Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 27 03:19:37 2007 -0300 Janitor work. Remove 'defined but not used' warnings from xorg and other cosmetic. commit 1340f34ec98c41781164018d43bd7bb858d8132b Author: Tiago Vignatti <vignatti@c3sl.ufpr.br> Date: Wed Jun 27 03:04:55 2007 -0300 Fix kdrive XKB. commit 08779c62ba2f4cbfa47e3cf738daf8abd74b60cf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 27 11:16:55 2007 +0930 Reset grab->next to NULL when we're creating a grab. This is definitely necessary in CheckDeviceGrabAndHintWindow (thanks to Paulo Zanoni for spotting it). We're resetting it everywhere else too, just to be save. commit 49136d3e9fe2d065090ee90c18a49f65fb027c9f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 26 19:43:54 2007 +0930 mieqEnqueue: use modulo for queue tail wrapping. This was previously committed by Michael Daenzer, but was lost during a pull. commit 8396bf7c8b4eb6b8f2d1e1ef19887064c69591da Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 26 12:58:37 2007 +0930 Init genericMasks to 0, make sure list is NULL terminated. commit 9725516b4274ceaf9d6caf372c5439b4c9db2316 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Jun 22 17:05:21 2007 -0700 Split checks for dtrace & getpeerucred() commit edb9ccf3ecb4e35a840aa13815979c5fbd73f32d Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 25 10:51:38 2007 +0200 Make sure DRIScreenPrivIndex is -1 when no DRI screen private is allocated. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=11340 . commit c4e850a781e3b85631cb386d24efcca2a835d4c9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 25 13:38:25 2007 +0930 Quickfix to stop core key events from doubling up. commit 4c601b904ee6fb01da3343ff9ef00d36f1341fcb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 25 10:53:05 2007 +0930 configFiles(): don't return anything when declared as void. commit bec4e47d128ec40b58a2c9aae475f6a6fc4323c3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jun 25 10:51:42 2007 +0930 NULL-terminate device list when synthesizing core devices. This fix is required for 93ca526892c0d22afa05cce6496198c652043a19 to work. commit 8e5102b9f01821048e72e7f068193a0b3e1816f9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 21 15:47:48 2007 +0930 Set the detail field for DeviceKeyEvents to the keycode. (cherry picked from commit 0c33dc152e372cdc8ae59d9a5696b0774bcd03b7) commit 87564543d92c1ee1f8cb6fb9716a15d693e08cf5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 19 18:20:05 2007 +0930 Only decrement buttonsDown when the button count is greater than 0. Device drivers flush their buttons on device init and cause a button down event to be generated. If we unconditionally decrease the buttons, we won't be able to ever get a passive device grab. Format documentation for CheckDeviceGrabs to make it readable. (cherry picked from commit 3e894974cdd6a75683d4601f71622d1da7ec4395) Conflicts: Xi/exevents.c commit 24ee89fd60f489f2d3af0399e0d667057df74d02 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 19 15:31:56 2007 +0930 Add a few comments to devices.c commit 93ca526892c0d22afa05cce6496198c652043a19 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 13 15:28:15 2007 +0930 Split up memory for devices configured in the config file. If we're using a continuous block here, we segfault when a device removal triggers an xfree call. commit b141b85c254afff3ce2221d899787fab3dc295bd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jun 13 15:26:03 2007 +0930 Check for identical grabs when adding a new passive grab. If an identical grab exists, remove the old one and prepend the new one. X.org Bug 2738 <https://bugs.freedesktop.org/show_bug.cgi?id=2738> commit 19cde59c41cf167cc609debfee75bfc015beac12 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Fri Jun 22 00:38:50 2007 -0400 In fbFill() make sure the drawable is validated when pixman_fill() succeeds. In fbSolidBoxClipped() don't return when pixman_fill() succeeds. commit d2177c80915f2fe2e8a5c948d4ba2fa51dbfbea2 Author: Keith Packard <keithp@neko.keithp.com> Date: Fri Jun 22 02:08:21 2007 +0100 Skip driver mode detection/configuration when !vtSema. When the server is not active, make sure the driver functions related to mode setting are not called. commit 32c0dcc8c0d1edba5d7e418fd2dc916847a4f069 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 21 15:39:19 2007 -0400 xselinux: adjust the config file format to that expected by libselinux. This file will eventually be moved out of the X source tree. commit 2030e9e5395be43bd8eab15b65c21ca4c2f1e619 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Jun 21 15:37:18 2007 -0400 xselinux: use new libselinux support for context labeling. Remove all the config file parsing code and use the new lookup interface instead. commit 4d5df14f2c4a3108a8c8adfcf4766c0d1a9daad2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 21 18:24:30 2007 +0930 Save processInputProc before wrapping it and restore it later, instead of using a hardcoded ProcessKeyboardEvent. Otherwise we lose the ability to process DeviceKeyEvents after the first key press. This should be the correct fix now. commit f6f3322fc7562dbfccaf798b05d42ea222860ba8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 21 18:16:21 2007 +0930 Revert "Save processInputProc before wrapping it and restore it later, instead of" Mixed up source trees, this was a very bad fix. This reverts commit 8431f6083076cf1e701366767d8f8d32a628200f. commit 8431f6083076cf1e701366767d8f8d32a628200f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 21 17:00:41 2007 +0930 Save processInputProc before wrapping it and restore it later, instead of using a hardcoded ProcessKeyboardEvent. Otherwise we lose the ability to process DeviceKeyEvents after the first key press. commit 0c33dc152e372cdc8ae59d9a5696b0774bcd03b7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jun 21 15:47:48 2007 +0930 Set the detail field for DeviceKeyEvents to the keycode. commit e523859a952d49b20f3d10152cc0ef695d2c12a1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 20 17:54:38 2007 -0700 Include module name in "already built-in" message commit 5138f710a1574fef6f553f3fe2fccac0620d2584 Author: Arcady Goldmints-Orlov <arcadyg@nvidia.com> Date: Wed Jun 20 16:31:55 2007 -0700 Fixed fbSolidBoxClipped() to fill the right place. Changed an X2 to a Y1. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> commit c9b79a355845c895aca8303a39798264d80b6212 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jun 20 18:56:06 2007 +0200 exaPolyFillRect: Don't track damage explicitly. All callers should already do it. Also don't leak pReg. commit 87966c5d2889873cea6cbc16b7e4399490dfaec1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jun 20 18:42:00 2007 +0200 exaGetImage: Don't migrate or try to accelerate for 1x1. This is mainly to avoid wasting effort for XSync(), but just reading a single pixel directly is probably faster than DownloadFromScreen anyway. Though in light of the latter, even larger thresholds might be useful. Also move the swappedOut check before the migration checks because migration can't actually occur when swapped out. commit 1f97a7647606226cde61d6ad7a94f2b0b571a06c Merge: 5dee64f 2e7fef7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 19 17:20:52 2007 +0930 Merge branch 'master' into mpx Conflicts: dix/devices.c hw/xfree86/common/xf86Xinput.c hw/xfree86/loader/xf86sym.c mi/mieq.c commit 40f27a2df4906d9ceb1c78f6163a62c497321535 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Jun 19 09:11:16 2007 +0200 mieqEnqueue: Make local queue tail variables unsigned. So the modulo arithmetic actually works as intended... thanks to Peter Hutterer for pointing out the problem. commit 5dee64fc99f34e091abce65d47c4b6f026ab4849 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 19 11:31:22 2007 +0930 Add a few comments to ProcXGrabDevice. commit 9e257029c760883c4ea0715d4fd06476f3fe8053 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 19 11:28:07 2007 +0930 Add implicitGrab field to GrabInfoRec. Is set when passive grab is implicit as result of a ButtonPress event. If this is the case, we need to store the XI mask as well as the core mask to ensure delivery of XI events during the grab's lifetime. Remove all core grabs on other devices when client issues a GrabPointer or GrabKeyboard request. Let's assume that the client really only wants one device to interact, so this seems like a reasonable solution. commit ab7a6d860d4a275a810a64b1ba7b13726ed10575 Merge: e9130b8 2e7fef7 Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jun 18 16:51:13 2007 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/os-support/bus/Pci.c hw/xfree86/os-support/bus/linuxPci.c commit 2e7fef7d0837939e822c40b6ac77e7f0e66d57bd Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Jun 18 12:08:39 2007 -0400 Make xf86{En,Dis}ableInterrupts no-ops on Linux. commit 831d3b7f8d053aba649c8d04af3bef96376bdc3a Author: Lennart Buytenhek <buytenh@wantstofly.org> Date: Mon Jun 18 12:05:55 2007 -0400 Compile fixes for Linux ARM platforms. commit 562ca3f2f9005e7c5ed0a24b0759051ded2173e9 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Mon Jun 18 12:00:49 2007 -0400 In NewInputDeviceRequest, only call EnableDevice if xf86Screens[0]->vtSema is true, preventing unwanted behavior in the case where a device is added while the user is in a different VT. commit 3e894974cdd6a75683d4601f71622d1da7ec4395 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jun 15 17:16:16 2007 +0930 Only decrement buttonsDown when the button count is greater than 0. Device drivers flush their buttons on device init and cause a button down event to be generated. If we unconditionally decrease the buttons, we won't be able to ever get a passive device grab. Format documentation for CheckDeviceGrabs to make it readable. commit 42c2e14b254f6f882b3e79444360ab855db43e27 Author: Matthieu Herrb <matthieu@deville.herrb.com> Date: Fri Jun 15 00:14:02 2007 +0200 swap xOrigin and yOrigin in SProcRenderSetPictureClipRectangles. Fixes Xrender clipping rectangles when X server and client are of different endianness, shown by xterm 225 among others. commit 0aaf51546666f71e8d1711978bc7988ec2ecc7d9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Jun 12 16:55:26 2007 +0930 Zero deviceMask and genericMask when creating a grab via CreateGrab(). commit 78179ae827bb5d19abb1340084362bc51ad5c1e5 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 22:46:42 2007 -0400 Remove fbmmx.[ch] files commit eb2d7fe02f9cbca57b462bba05498e2d59316fbc Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 22:43:01 2007 -0400 Replace fbFillmmx() with pixman_fill() and remove fbmmx.[ch] commit f52ae237d3eec79ccd64cdd77271aeacc37af70c Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 22:02:39 2007 -0400 Require pixman 0.9.2 commit d1d85c04e248f46b1cf1b1d25fdd56aa69b8f0ee Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 21:25:42 2007 -0400 Delete fbBltmmx(). commit e2a720c9a17dc860ee0a858c2b21fd71e86cdcd0 Merge: 878cac7 3f9adb1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Jun 11 15:29:11 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: dix/dixutils.c commit 3f9adb18f127318d054f30a57e3a77176e14c692 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 15:19:27 2007 -0400 Port a few forgotten fbSolidFillmmx()'es to fbFillmmx(). Use pixman_blt() instead of fbBltmmx() in fbCopyNToN(). commit 878cac71aa0018deee861b297638c0744dba631b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Jun 11 14:19:37 2007 -0400 xselinux: use new libselinux support for private Flask definitions. Removes indirect dependency on kernel headers. commit d06099b38e8445e6e31f5178ffefcc31a71080ef Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 13:28:24 2007 -0400 Remove fbCopyAreammx() and fbSolidFillmmx() commit d4a034370c8ae71b2cc4fe824ceee58b19624f35 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 13:26:24 2007 -0400 Split fbSolidFillmmx() into a new FbFillmmx() function. Call that from fbFill(). commit 3210902a7334f3d8d6c18a34a3cb3f55803b0043 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 13:14:50 2007 -0400 Split fbCopyAreammx() into a new fbBltmmx() function; call this function from fbCopyNToN(). commit 8d5f4368eac1b259db3e61f877a4cc10f04efa2f Author: Clark Rawlins <clark.rawlins@escient.com> Date: Mon Jun 11 16:53:38 2007 +0200 Really make sure BUILD_TIME doesn't have a leading zero. date +'%k%M%S' still gives a leading zero in the hour after midnight... Add a leading 1 and remove it in xf86PrintBanner(). commit 54e023cec07aa7e392da36e11d0a4667b8341370 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Mon Jun 11 09:16:46 2007 -0400 Don't pass regions to pixman_image_composite() anymore. commit 5cbec267b6426960c90f6bcff1d051af5084538c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 11 12:38:41 2007 +0200 Make sure BUILD_TIME doesn't have a leading zero. It causes the compiler to treat it as an octal constant instead of decimal as intended, which could even cause a build failure in the cases of 08 and 09. Thanks to Clark Rawlins for pointing out the problem. commit 1aceec61ff203848576c47a1eab13f90a67d7176 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 11 09:23:19 2007 +0200 DRI: Clip cliprects obtained from DRIGetDrawableInfo to screen dimensions. This is to avoid issues with redirected windows which are located partly or fully outside of a screen edge, resulting in unusual cliprects which the 3D drivers generally can't handle. The symptoms in such cases would be incorrect rendering or even crashes or hangs. commit 5d896e43fd056d935935b4eb66562791edc247a1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 11 09:23:19 2007 +0200 DRITreeTraversal: Stop walking tree when we've seen all DRI windows. commit 0fb44c6f9a0415184818ba8357a21ff920e907dc Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 11 09:23:19 2007 +0200 DRI: Fix build warning. commit 644f7ddc0cb029e2ebca43742fd8a46a1a3f4c9f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 11 09:23:18 2007 +0200 dixLookupClient: Use access parameter. commit 30a3297fed9af3a594aba0875a8f58a0a38b33fc Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 11 09:23:18 2007 +0200 mieq queue handling cleanups. In particular, fix handling of wraparounds in mieqEnqueue. commit c1a49a9269f14b6975a1a2c751bb179757373f11 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Jun 10 22:14:57 2007 -0400 GNU is wrong and ` is not left-quote. commit 67a0a4da1a225ee3bd6bbd1846f8141fe333c884 Author: Dave Airlie <airlied@linux.ie> Date: Mon Jun 11 11:55:11 2007 +1000 update xproto dependency to at least 7.0.9 commit c079cce9d884ab03f305b3fba4a4e1247c023480 Author: Daniel Ciocea <daniel.ciocea@eosystems.ro> Date: Fri Jun 8 18:12:21 2007 -0700 Fix sync polarity on Samsung SyncMaster 205BW monitor. need to use standard VESA sync polarity instead of the EDID provided -hsync -vsync values. commit 9c47b86bd9a4633fda5fd305a09ac8623187efa0 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jun 7 13:57:12 2007 -0700 Add new fb symbols to wfbrename.h. Avoids crashes when wfbComposite calls the wrong image_from_pict. commit 567b5bf765254a4ae9cc7711bb6acfa89a9fd61c Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Tue Jun 5 20:26:49 2007 -0400 Delete fbCompositeCopyAreammx() commit 49ed31c0b323dd8c5887a803c199875e6f2330d8 Author: Søren Sandmann Pedersen <sandmann@redhat.com> Date: Tue Jun 5 17:44:21 2007 -0400 Remove most of the fast-path MMX operations from fbmmx. fbCopyAreammx and fbSolidFillmmx are still needed by other code. commit dfbe32b5b828cc4e3da36a0e2e6ad641164eaa5e Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Jun 4 18:07:00 2007 -0400 Remove the old Kerberos 5 authentication code. Before you complain, this code hasn't seen material change since at least X11R6. It certainly does not build with any modern version of Kerberos. Anybody wanting krb5 auth to their X server should probably be using GSSAPI instead of internal krb5 API anyway. commit 793470a8356976ddd427280a738dfb6e1c0e4e70 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Jun 4 12:33:49 2007 -0400 dix: fix null pointer dereference in new resource lookup function. commit 75dece08fb72803d5116e6776e9f1534ff20e37b Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Mon Jun 4 09:09:20 2007 -0400 xf86PostMotionEvents[P] calls xf86SendDragEvents, xf86SendDragEvents unconditionally checks device->button->buttonsDown. Let's make it possible to have a device with motion, but no buttons. Without segfaulting. commit fbb9b203950e9d0e82574cde5b3e006b0e6b404f Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Mon Jun 4 06:59:42 2007 -0400 Let's not do a calloc and a free on every call to xf86PostMotionEvents. commit 3f4295e643ca56c40f33af7966e8efd367ef8749 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Mon Jun 4 06:48:06 2007 -0400 Add xf86PostMotionEventP, takes a pointer instead of a variable number of arguments. Bump input ABI to 1.1 since we export this. commit a4f3473c88370b8411e016ebab619cffd33e58f9 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Mon Jun 4 06:39:02 2007 -0400 Fully init the AbsoluteClassRec in InitAbsoluteClassDeviceStruct. (Specificly, we were missing the screen field.) commit 0cbc3a4da2ddb6e4f30f60d2bc7f405d31aa554a Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Mon Jun 4 02:03:44 2007 -0400 Print the build time as well as the date if we can. commit 9a7aaeb3f6ff79af60fde91cd0575a54ba0b9587 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon May 28 13:54:16 2007 +0300 XFree86: Input: Assume core events per default Assume that a device will be sending core events, unless explicitly specified otherwise. commit 94361cbba7f866144691f6f5e9251a550e0e0cb8 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon May 28 13:54:47 2007 +0300 XFree86: Input: Perform case-insensitive comparisons on option names commit e5ce982381c4092252d6b55fcefcc9a3cd21e656 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Sun Jun 3 09:40:37 2007 +1000 Include pixman.h from fb.h or compile of some files will fail Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> commit 90eb22656c34d2d08a8dccaf05e6d081c56bd7f3 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Jun 2 16:49:26 2007 -0400 Minor cleanup/robustification to config parsing. commit f6a983533bdc84752562ef0be25b320678bf08a1 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Jun 2 16:37:39 2007 -0400 Don't warn about default behaviour when autoconfigging. commit 21e8f4eb02842f877336db08c332d8ee4a381ee0 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Jun 2 16:13:01 2007 -0400 Don't print lack of DRI support as an error in AIGLX init. commit 0e1384d8318637f75d04d3d1b7600f7cad40117e Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Jun 2 16:07:20 2007 -0400 Delete VDIF support; it was never used anyway. commit 66702f3c1c6c884e83744c72da173cc32f22b2f4 Author: Henry Zhao <henryz@localhost.localdomain> Date: Fri Jun 1 23:55:40 2007 -0700 Need to use minPitch in miScanLineWidth() to get the shrinked linePitch. commit 26b21157cf934ae387b15faa9ebb060120e6a0d6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 31 17:05:14 2007 +0930 Add a deviceMask to the GrabRec and don't interfere with passiveGrabs. This quickfixes event delivery problems with XI events when a grab was on. deviceMask is only used when the grab was from a ButtonPress to preserve potential XI event masks. This is not an ideal solution but it works until I have time to work on PassiveGrabs. commit fa877d7ff25c4ec45288e1fea70d4f5e1baf3ef3 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed May 30 13:06:45 2007 +0100 Fix mode validation against the maximum X/Y values configured at server startup, and not against the virtual X/Y parameters as they can change. This fixes an issue when canGrow is TRUE and modes get dropped when using the virtual X/Y parameters. commit 182ab3a3d5b28daa86e6d6155e76ce759687ae6d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 30 17:44:31 2007 +0930 Fix up comments for event.c commit b5db863945fa8045995b3bf742c44e40f2650f04 Author: Paulo Ricardo Zanoni <prz05@c3sl.ufpr.br> Date: Wed May 30 16:15:15 2007 +0930 Allow value None for windows when setting ClientPointer. We need this for clients that need to set the ClientPointer but don't have a window on display yet. If used, it will set the device as the ClientPointer for the requesting client. commit 99eae8bea6724a24477375ad5b2d31cc4883cf6b Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Tue May 29 22:04:36 2007 -0400 I/O enable/disable update for the Hurd commit 3c6f1428489c1f71acd41066ea73ef4ae7c60f17 Author: Julien Cristau <jcristau@debian.org> Date: Tue May 29 22:01:30 2007 -0400 Make sure that the ramdac symbols are present in the server The former ramdac module is now built into the server, so its symbols need to be explicitly exported to drivers (Debian #423129). commit ee20c481eede0954f4a8bef5113979b101863c32 Author: Matthieu Herrb <matthieu@deville.herrb.com> Date: Tue May 29 14:54:27 2007 -0600 Remove wscons keyboard handling stuff that doesn't belong there anymore. commit 60de6c7ef9bdcee043f63e8e0d493e6feba6a9d0 Merge: 3a6549a 2f13b7c Author: Matthieu Herrb <matthieu@deville.herrb.com> Date: Tue May 29 12:14:49 2007 -0600 Merge branch 'master' of ssh://herrb@git.freedesktop.org/git/xorg/xserver commit 3a6549a163aba26bf4ac58b050c493fba0df14c6 Author: Matthieu Herrb <matthieu@deville.herrb.com> Date: Tue May 29 12:14:23 2007 -0600 Make this build on OpenBSD commit 2f13b7c113c17239e382dd3640e9c29201d8ab1f Author: Drew Parsons <dparsons@debian.org> Date: Wed May 30 02:13:36 2007 +1000 Update Xprint build for pixman. Xprt links libfb, which now uses pixman. Update configure.ac to require module $PIXMAN for XPRINT. Also, use $(top_builddir) to reference libfb.la and other local libraries, rather than using the relative reference ../.. commit ba0b7d47ab0c24d5a29228f8af583044060464bd Author: David Nusinow <dnusinow@debian.org> Date: Mon May 28 21:57:04 2007 -0400 Fix for GNU/kFreeBSD commit 2267bf48b385c93243e26c3bb84ebb04c7fdb39f Author: Bastian Blank <waldi@debian.org> Date: Mon May 28 21:55:05 2007 -0400 Fixes for s390 commit 857ddbb660a21cad1c16f4fb2dc8a904d6655304 Author: Eugene Konev <ejka@imfi.kspu.ru> Date: Mon May 28 21:53:02 2007 -0400 Allow configurable serverconfigdir for security policy location Allow the location of the SERVERCONFIGdir variable to be defined at compile-time. This allows us to specify where the security policy will be located (Debian uses this to put it in /etc). The default is to the previous location. commit 78d01d1008973899d931ef44b47d5f0b5f220b0d Author: Gerhard Tonn <gt@debian.org> Date: Mon May 28 21:48:58 2007 -0400 Miscellaneous fixes for S/390. commit d98bd4bf908c2c51fcfd3a4c3230de17f2567244 Author: Branden Robinson <branden@debian.org> Date: Mon May 28 21:44:59 2007 -0400 Overhaul xorg.conf manpage Major stylistic cleanups, greatly expanded cross-reference ("SEE ALSO") section and some typo fixes. This patch by Branden Robinson. Forward-ported by Fabio M. Di Nitto. commit 6bf8d5019313ee2251a44dfb7ad3435a3c6db7eb Author: David Nusinow <dnusinow@debian.org> Date: Mon May 28 21:42:10 2007 -0400 Read ROM in chunks This patch speeds up reads of the ROM by reading in large chunks rather than one byte at a time. This patch was by Dann Frazier. commit 6fdd134a0c3e6fdde9b089100e8783705c9cc6ac Author: David Nusinow <dnusinow@debian.org> Date: Mon May 28 21:39:12 2007 -0400 Fix up xnest manpage I believe this patch was originally by Branden Robinson commit 6a870992d81a6bacfa9d313c15784fdb281d474f Author: Keith Packard <keithp@dulcimer.keithp.com> Date: Fri May 25 20:33:08 2007 -0700 xf86XVFillKeyHelper assumed root clip never changed. When the root window changed size, xf86XVFillKeyHelper would not revalidate the GC, leaving the clip at the old size causing lossage (and possibly memory corruption if the screen and frame buffer shrank). Fixed by just using a scratch GC; saving memory, eliminating bugs and shrinking the code. commit 3c982bc1a49509dda7bc469b0eced44df02755b3 Author: Luo Jie <luojie@nlsde.buaa.edu.cn> Date: Thu May 24 11:13:03 2007 -0700 Reinstate an apparently mis-deleted ';' from a for loop with no body. Fixes an error returning "No core keyboard" with multiple keyboards. commit 4d7469f75fadfc4a59664e88e18eb304203670f4 Author: Luo Jie <luojie@nlsde.buaa.edu.cn> Date: Thu May 24 11:04:06 2007 -0700 Fix a typo in using memcpy in xwin. commit 0b988450462ddb005311e68502357baf272e6371 Author: Luo Jie <luojie@nlsde.buaa.edu.cn> Date: Thu May 24 11:02:28 2007 -0700 Fix os/utils.c compile with mingw. commit 1f48995d66c0072caa7e5ce2845be642221dd56d Author: Luo Jie <luojie@nlsde.buaa.edu.cn> Date: Thu May 24 11:01:15 2007 -0700 Fix build of composite, dix, and randr when Xinerama is disabled. commit 8f98be7db303bc3db650054efb86843c70114451 Author: Eric Anholt <eric@anholt.net> Date: Thu May 24 11:00:04 2007 -0700 Fix bswap detection on BSD (mis-added '_' in function names). commit 9616a042855399f0ee9c6489ea824621ea5fee18 Author: Matthias Drochner <drochner@netbsd.org> Date: Tue Apr 10 16:15:40 2007 -0700 Fix build on NetBSD/amd64. commit ddb26bccd275f4fc011f7a2be685d1ce58555a00 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu May 24 12:20:24 2007 -0400 dix: Add a bunch of new access codes. These were determined through an analysis of the core protocol and 35 of the most common protocol extensions. There remain four bits for future use. commit 649e7f82d8d4333443493056b81eb20d6cf022bc Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu May 24 12:10:05 2007 +0200 Consolidate portPriv->pDraw assignments into xf86XVEnlistPortInWindow. This avoids a crash in xf86XVReputVideo and also cleans up the code slightly. commit 047bf3349bb697c73c95729a8bbf15f72605901f Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed May 23 16:56:05 2007 -0400 Delete trapezoid rendering code; replace with pixman calls commit 9d87ef4e0dff40ea39f1b209c67b90079fc79065 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed May 23 15:50:25 2007 -0400 - Make image_from_pict() non-static - Delete fbedge.c and fbedgeimp.h - Use pixman_rasterize_edges() in fbtrap.c commit 2a960c442bd7560630f52b55d82ec0517542ee5a Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed May 23 13:08:26 2007 -0400 Port renderedge.c to pixman commit 3ba3ede9bbdfc6376b6f6e0b6ce8280a05e6584d Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed May 23 12:56:04 2007 -0400 Add missing offsets for window coordinates - reported by Colin Harrison commit 2a4aa63a23ddd816b647b851a01865861827a7eb Merge: 9cee4ec cc648e6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue May 22 14:50:26 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: include/miscstruct.h commit cc648e609d472472bac4a2e568eb3598b3690ba3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue May 22 10:51:56 2007 +0200 EXA: Export ExaOffscreenMarkUsed. Can be used to inform EXA that an offscreen area is used outside of EXA. commit e6a7198e7cd96f1fe0654cc6811a977821579258 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue May 22 10:51:55 2007 +0200 Bug #8991: Add glXGetDrawableAttributes dispatch; fix texture format therein. Adapted to master branch by Michel Dänzer <michel@tungstengraphics.com>. commit 6324bfc468f7a645d2fee59f1c921a4328a4639f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue May 22 10:51:53 2007 +0200 AIGLX: Zero-copy texture-from-pixmap. When available, use the 2D driver texOffsetStart hook and the 3D driver setTexOffset hook to save the overhead of passing the pixmap data to glTex(Sub)Image. The basic idea is to update the driver specific 'offset' for bound pixmaps before dispatching a GLX render request and to flush immediately afterwards if there are any pixmaps bound. This should ensure that the 3D driver can use pixmaps for texturing directly regardless of the X server moving them around. commit 5006d08d7fc56d3d380cc6b75297f94e8594eb54 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue May 22 10:51:52 2007 +0200 DRI: Add TexOffset driver hooks. To be used by AIGLX for GLX_EXT_texture_from_pixmap without several data copies. The texOffsetStart hook must make sure that the given pixmap is accessible by the GPU for texturing and return an 'offset' that can be used by the 3D driver for that purpose. The texOffsetFinish hook is called when the pixmap is no longer being used for texturing. commit ff2eae86b6a8760befbbc5d605debebe7b024c05 Author: David Nusinow <dnusinow@debian.org> Date: Mon May 21 19:50:04 2007 -0400 Fix boolean thinko that prevented working without a server layout commit 56fd92715567cd32e4b725b3791de9ac4e3879aa Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Mon May 21 20:00:25 2007 -0400 Remove fast path code from fbpict.c Remove the various fast path functions from fbpict, and instead use pixman_image_composite(). commit d0e8f474099dea40bbea555427772724ccb787d1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 21 13:06:21 2007 +0930 Change GrabDevice's parameter name back to "coreGrab". Was changed during a global search/replace for 5c680e94938c16e04a4349715cf11796b80400db. Otherwise people like me introduce bugs (e.g. in 333bab4b235801efd2b2de5b60df5b0c44048d3e) commit 167e1773de0fb566559d4362ff929eedcdb6d055 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 21 10:45:10 2007 +0930 Remove unused include "gestr.h" commit 7e2c935920cafadbd87c351f1a3239932864fb90 Author: Fredrik Höglund <fredrik@kde.org> Date: Fri May 18 20:06:14 2007 +0200 Add a new IDLETIME system sync counter. This counter exposes the time in milliseconds since the last input event. Clients such as screen savers and power managers can set an alarm on this counter to find out when the idle time reaches a certain value, without having to poll the server. commit 756acea23a0cc56c470bcd77c6f5638d923ab3d1 Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Fri May 18 13:39:12 2007 -0400 Use pixman_image_set_indexed() to make 8 bit work commit 7916419a0092b8bf9713c0840f9e969950d7aa85 Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Fri May 18 11:58:24 2007 -0400 Comment out setup of general MMX code commit 998164bac648756e5b5254aa36e075ae360d3972 Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Fri May 18 11:36:20 2007 -0400 Move fbCompositeGeneral() to fbpict.c and remove fbcompose.c commit a2e3614eb8f0fa198615df492b03ff36bc9c1121 Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Fri May 18 11:33:11 2007 -0400 Break image_from_pict() into a few subfunctions. commit c5ef84c325440af5fbdf9f44c3781d99a0392df9 Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Thu May 17 21:31:08 2007 -0400 Make the general compositing code create a pixman image and call pixman_image_composite(). Leave the general code commented out for now. commit 076d070e186afeb416976ae74fbfd50c86db10c5 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu May 17 20:24:18 2007 -0700 Use Screen block handler for rotation to draw under DRI lock. DRI uses a non-screen block/wakeup handler which will be executed after the screen block handler finishes. To ensure that the rotation block handler is executed under the DRI lock, dynamically wrap the screen block handler for rotation. commit 915563eba530c5e2fdc2456cf1c7c3cc09b3add0 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu May 17 20:22:43 2007 -0700 Disable all outputs and crtcs at startup. Leaving devices enabled during server startup can cause problems during the initial mode setting in the server, especially when they are used for different purposes by the X server than by the BIOS. Disabling all of them before any mode setting is attempted provides a stable base upon which the remaining mode setting operations can be built. commit 0375009a97c2ab7f0e0f0265463d45c0580388c6 Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Thu May 17 12:59:24 2007 -0400 Remove excessive unrolling in fbCompositeSrc_x888x8x8888() and fix bug where the source alpha was used instead of 0xff. commit 0b4db74922299df785e6273fdb1bf65c38d36070 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 17 18:00:07 2007 +0930 Squish the flags into the upper bits of the mode field for EnterLeave events. This way we have enough space for the detail field. commit 333bab4b235801efd2b2de5b60df5b0c44048d3e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 17 17:59:02 2007 +0930 Clean up, correct some comments. Send event type down with the RawEvents. commit bc334286b060bc8d0c829b18acebadf24fbdaf19 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 17 10:36:46 2007 +0930 Init device axis with -1,-1 minimum values. This is needed to be able to cross to screens located east/north of the current active screen. commit 546465ee6aa6584780aec6357f32d205c807ae71 Author: Soren Sandmann Pedersen <sandmann@redhat.com> Date: Wed May 16 17:42:04 2007 -0400 Make fbFetch_b8g8r8() actually write the read value to the buffer commit 0fcd17c9181901c419cc32bc24c07fe5a6934d81 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue May 15 17:59:13 2007 -0400 Use pixman short formats, revert the gradient_stop change commit f4c1d5fc28a5a7fe2592505350f9e2331f6049b7 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue May 15 17:12:22 2007 -0400 Use pixman types for transforms and vectors commit f2e30e7d0a1d075e7e83c5b5ceca9e4752951138 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue May 15 16:51:21 2007 -0400 Use the pixman fixed point types and macros commit 3da842bf930d7875599ca0c06cb4a09cfa987ac5 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue May 15 14:57:14 2007 -0400 Revert various fast path functions to their pre-pixman-merge state since they fail rendercheck. Remove their associated macros. See bug 10903. commit 1568b6b6a0d7337f29c7b87cc46ae64b3b0f8fdf Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Sat May 12 20:33:23 2007 -0400 Port large amounts of the region code to pixman commit dde0ceac4ea7639d0096bfd26f37c5851778854c Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Sat May 12 17:41:47 2007 -0400 Add new InitRegions() function called from dix/main commit e037052ac522150786abf44d3a04c813cc490050 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Sat May 12 16:58:54 2007 -0400 Turn boxes and regions into typedefs for pixman types commit 8e56f5be4b70773c899f01b9ccd2e88d523327e4 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri May 11 11:45:37 2007 -0400 Add dependency on pixman 0.9.0 commit a8c56372ba8aa36bac09877c478ff53ea5358df7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 15 10:24:22 2007 +0930 Revert "Allow events to grabWindows event if the device is not grabbed." This reverts commit 339b73e710a0920608a3fbcb20b406f0f6c4e0f6. Allowing those events can lead to race conditions. Conflicts: dix/events.c commit 81fc6a128b64ad412064405ed45db0175398e3f0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 14 18:12:56 2007 +0930 Add ungrab support to ExtendedGrabDeviceRequest handling. Polish the code a bit. commit 5c680e94938c16e04a4349715cf11796b80400db Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 14 12:34:53 2007 +0930 Remove double-grab option. We only want one grab per device. commit 4dc973f08c54294e06bc831bd2839fd3aa24ecfb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon May 14 10:42:03 2007 +0930 Add ExtendedGrabDevice handling. Add XGE handling in DeliverGrabbedEvent. We can now grab something selecting XGE events, but the current code is a bit messy and doesn't work too well yet. commit a277f04ab08514462b7f10b4dd92eb326af85501 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed May 9 22:03:12 2007 -0400 Remove mfb and cfb from include paths where they're not needed. commit 20c5250e487e032d392e2e4624021fccb1bfb72c Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed May 9 21:49:44 2007 -0400 Use system copy of cbrt() if available. Also move the replacement inline into miarc.c, since that's the only user. commit 8dcc37520d5e8c8b52cee81faa67fd5205548377 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed May 9 18:57:05 2007 -0400 Use _X_INLINE instead of ad-hoc #defines. commit 6ff239cb4e67c0a2ea497a1714e5585c1d941af3 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed May 9 18:38:33 2007 -0400 Make the use of ICEIL slightly less ugly. commit 178d426311bb3c7160f72b5d95b0a137eda09ba9 Author: Colin Harrison <colin.harrison-at-virgin.net> Date: Fri May 11 10:08:42 2007 +0100 Missing piece from bug 9808 commit ebaa6c920c82401952a0ccc991b94574306449bd Author: Matthias Hopf <mhopf@suse.de> Date: Thu May 10 15:25:31 2007 +0200 Disable Simba PCI bridge routing code (Bug #8020). The code in hw/xfree86/os-support/bus/sparcPci.c:simbaCheckBus() is trying to mimmick VGA routing by disabling I/O space responses behind the Simba PCI-PCI controller. Unfortunately, doing this also happens to disable access to the IDE controller I/O space registers, thus crashing the system. The granularity of the I/O disabling in the Simba controller is not fine enough to disable VGA without also disabling the IDE controller registers. commit 86c4941727f7c673ae6bb88c67443fa25935c7f5 Author: Colin Harrison <colin.harrison-at-virgin.net> Date: Wed May 9 16:55:27 2007 +0100 fix an occasional crash in GetWindowName() (bug: 9798) commit be44018a3c6172caf3e91c36ea321420d104e79f Author: Colin Harrison <colin.harrison-at-virgin.net> Date: Wed May 9 16:55:09 2007 +0100 Fix bad use of hwnd (bug: 9808) commit d3248b66a650c6c629cd66240e25004869217d2e Author: Colin Harrison <colin.harrison-at-virgin.net> Date: Wed May 9 16:54:46 2007 +0100 Migrate some code to the new mi apis commit 021e5df85d7c9373a2fed55512751d16e08128db Author: David Nusinow <dnusinow@debian.org> Date: Mon May 7 21:03:40 2007 -0400 Add more informative logging for module default loading When the modules section is parsed, if a module is set to be loaded by default, this will be logged. If it is redundantly specified in xorg.conf, this will also be noted. None of this logging will happen if the xorg.conf lacks a modules section. commit 1b3a0508a7aee1c7b14cd62216b4727fcc9181d4 Author: Jesse Barnes <jbarnes@jbarnes-mobile.amr.corp.intel.com> Date: Sun May 6 01:30:59 2007 -0700 Fix documentation for Copy hook -- it can copy memory to the scanout buffer too. commit 030a578391c634bc68add6ada3f251cf3f8c3069 Author: David Nusinow <dnusinow@debian.org> Date: Thu May 3 22:51:07 2007 -0400 Provide UseDefaultFontPath option This provides a new option, UseDefaultFontPath. This option is enabled by default, and causes the X server to always append the default font path (defined at compile time) to the font path for the server. This will allow people to specify additional font paths if they want without breaking their font path, thus hopefully avoiding ye olde "fixed front" problem. Because this option is a ServerFlag option, the ServerFlags need to be processed before the files section of the config file, so swap the order that they are processed. commit e91b9ddc7aa95abc2d4d314e8db204860771a099 Author: David Nusinow <dnusinow@debian.org> Date: Thu May 3 22:00:23 2007 -0400 Improve modules loading defaults Provide default modules that may be overrided easily. Previously the server would load a set of default modules, but only if none were specified in the xorg.conf, or if you didn't have a xorg.conf at all. This patch provides a default set and you can add only the "Load" instructions to xorg.conf that you want without losing the defaults. Similarly, if you don't want to load a module that's loaded by default, you can add "Disable modulename" to your xorg.conf (see man xorg.conf in this release for details). This allows for a minimal "Modules" section, where the user only need specify what they want to be different. See bug #10541 for more. The list of default modules is taken from the set loaded by default when there was a xorg.conf containing no "Modules" section. A potential problem for some users is that some users disable a module, most notably DRI, by commenting out the "Load" line in their xorg.conf. This needs to be changed to an uncommented "Disable" line, as DRI is loaded by default. commit d2f813f7db157fc83abc4b3726821c36ee7e40b1 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed May 2 19:10:22 2007 -0400 New fbWalkCompositeRegion() function This new function walks the composite region and calls a rectangle compositing function on each compositing rectangle. Previously there were buggy duplicates of this code in fbcompose.c and miext/rootles/safealpha/safeAlphaPicture.c. commit e0959adcd8df2c61e98e76e708fceef9c7cd54eb Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue May 1 13:41:48 2007 -0400 Add fbCompositeRect() as another special case in the switch of doom in fbpict.c This is phase one of getting the two region walkers in fbcompose.c and fbpict.c merged together. commit cb22bdbe678a9948eda75d464d6701a729664ef0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu May 3 10:05:58 2007 +0930 Add selected RamDac functions to xfree86LookupTab. Adding those makes drivers for s3 and tga work again. commit c1e1d6b98a6708860e5b5f6e21d8d5b1d8ce9075 Author: Brian <brian@yutani.localnet.net> Date: Wed May 2 15:55:40 2007 -0600 In __glXCreateARGBConfig(), insert the new GL mode at the _end_ of the linked list. Previously, the new mode was added at the head of the list. This caused the positional correspondence between modes and the XMesaVisuals array to be off by one. The net result was GLX clients failing when they tried to use the last GLX mode/visual. We still have the problem of DRI drivers not being able to use the extra mode/visual introduced by __glXCreateARGBConfig(). glXCreateContext fails with BadAlloc if it's attempted. This is also the source of the often- seen warning "libGL warning: 3D driver claims to not support visual xxx" Look into fixing that someday... commit bd0abb2844ef9faf28703e592cfebb886004234c Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Wed May 2 17:20:48 2007 +0200 Bug #10823: Fixed default OSNAME value. We try to get OSNAME from uname by default now. commit 71fc5b3e9309182978ead676965d65ca93a4e3b9 Author: Keith Packard <keithp@keithp.com> Date: Wed May 2 11:41:11 2007 +0200 Fix for a divide by zero that can be triggered by a malicious client. Problem reported by Derek Abdine of rapid7.com. Thanks. commit c03d9a7217f9895feed8cfed3ede4752faf6187c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 2 18:16:40 2007 +0930 Cleaning up a bit. Register correct event in EventSwapVector. Fix up event swap for GE events, register XI's swap function at GE. commit e6fd4a24ebd205013b41e44aacbbfb847709d2fd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 2 17:49:20 2007 +0930 Add handling for FakeDeviceEvent request. Fix a stupid bug from last commit, mask names were wrong. commit af25720598bb35d9d953ac8d9a07528289ebfb4a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 2 13:51:16 2007 +0930 Add missing files for ProcXiSelectEvent. Should have been a part of 5e439109292e54b5c4d1a7bc7b6ac0e42ee285f7. Oh well. commit 58c0fd29272fb6c2f193cff82fb0b0573c607eec Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed May 2 13:50:09 2007 +0930 Adjust EQ to support long events. Add RawDeviceEvent (pointers only for now). This commit changes the event queue to use EventLists instead of xEvent arrays. Only EQ is affected, event delivery still uses xEvent* (look for comment in mieqProcessInputEvent). RawDeviceEvents deliver driver information to the client, without clipping or acceleration. commit 0214d0b96a9b900a8cf5c7f2183add3a411441f3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 1 15:49:41 2007 +0930 Start devices after windows are initialized. This fixes the hotplug segfault introduced with the multihead changes and cleans up the code a bit as well. commit 11d0e2109b699714055e263e8963f2c39eded28b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 1 14:16:36 2007 +0930 Correct enterleave semaphore value for root window. commit 8b42ba64e169a35df2a90528dcb0cd06be0f67a1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 1 12:12:58 2007 +0930 Send PointerKeyboardPairingChangedNotifyEvent using XGE. Needs updated inputproto and libXi. commit 325380adb20ec2b82e176d75599fd4bc97a3b918 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 1 11:02:05 2007 +0930 Check and re-set paired devices when initializing sprites. If we don't do this, a device that is paired before a sprite has been initialized for the paired device will not actually get the right sprite and segfault the server on focus events. Happens for the VCK. commit b043a184509cfe5c4c4691ecde1a4a065e53d575 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue May 1 09:54:33 2007 +0930 Check VCP's and VCK's ids when searching for a new device id. Both VCP and VCK are not in the inputInfo.devices list anymore, so we need to check them separately. If we don't do this, we end up re-using ids 0 and 1, causing all sorts of grief for clients. commit 873ef75b1e8c94d39670c981c4d830ab8bcc018b Author: Colin Guthrie <gmane@colin.guthr.ie> Date: Mon Apr 30 10:33:12 2007 -0600 fix __glXErrorCallBack() proto commit 6b33459bf5aac23c3ecc7002d091c02f327d907a Merge: 18252a5 3c91a99 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 30 10:26:19 2007 -0600 Merge branch 'master' of git+ssh://brianp@git.freedesktop.org/git/xorg/xserver commit 5e439109292e54b5c4d1a7bc7b6ac0e42ee285f7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 30 12:57:42 2007 +0930 Add GenericEvent extension to Xext. This adds (unconditional) support for the GE extension. Anything from now on that sends events in MPX will have to use the GE extension. No GE, no MPX events. GE is not actually used yet from anywhere with this commit. You will need to update x11proto, xextproto, libX11, libXext and xcb to the matching xge branches. Things will _NOT_ work without the updated protocol headers and libraries. commit 3c91a993e8c752002adf85c317216e1487c20780 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:49:41 2007 +0200 EXA: Fix OffscreenValidate build with DEBUG_OFFSCREEN enabled. commit a261e1325057974d58440812b93c00c0caa4423a Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:49:35 2007 +0200 EXA: Remove DrawableDirty. Convert the remaining callers to PixmapDirty. commit b1b6674a919943a8ac37e54d02e8d0d23a642b1d Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:49:28 2007 +0200 EXA: FillSpans improvements. * Don't need to track damage. * Always migrate for fallbacks. commit 584697a2231ac782f362a925e1489c15483a8791 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:49:09 2007 +0200 EXA: SolidBoxClipped improvements. * Centralize handling of fallbacks and damage tracking. * Always migrate for fallbacks. commit 982d7c2c0b948ba04c8eefa475d660981e6ed9f9 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:48:59 2007 +0200 EXA: CopyNtoN improvements. * Centralize handling of fallbacks and damage tracking. * Always migrate for fallbacks. commit d2245386eed200e77a8c84bdda36ab29e39fd593 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:48:31 2007 +0200 EXA: GetImage improvements. Only migrate when appropriate. In particular, don't migrate to offscreen in the no-fallback case as copying from system memory should usually be as fast if not faster than DownloadFromScreen, in particular if the bits need to be uploaded to offscreen first. commit 0880aaac9c83019fec2e3d32871f74c7a407f8b3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:48:19 2007 +0200 EXA: PutImage improvements. * Migrate for fallbacks when appropriate. * Add damage tracking in ExaCheckPutImage. commit 7fca16901187ade48e83e6a2684ef464b1912357 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:48:11 2007 +0200 EXA: ImageGlyphBlt improvements. * Don't waste effort on invisible glyphs. * Only track damage for bounding box instead of each glyph separately. * Always migrate for fallbacks. commit a8d6ebdf9338dc2f6ff9a532e6fec460a70d3b1e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:47:53 2007 +0200 EXA: Defer to FillRegionTiled in Composite when possible. Committed separately as this case is hard to hit and has only been tested lightly. commit 81b055605c34b5823f6c5f63cc0f92f43c6b7252 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:47:43 2007 +0200 EXA: Composite improvements. * Defer to simpler hooks in more cases (inspired by XAA behaviour). * Move damage tracking from lower to higher level functions. * Always migrate for fallbacks. commit ce317a5b76c053f449122c46e1372bf8e067cb4c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:47:16 2007 +0200 EXA: Glyphs improvements. * Don't waste effort on invisible glyphs. * Add damage tracking where necessary. * Always migrate for fallbacks. commit 0c8905ebc91cf654facef84ee52231a358deec5c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:47:08 2007 +0200 EXA: PolyFillRect improvements. * Convert rects to region and use it for damage tracking. * When possible, defer to exaFillRegion{Solid,Tiled} using converted region. * Always migrate for fallbacks. * Move damage tracking out of ExaCheckPolyFillRect. commit 567f18a09bfb05f448be40c7ebe0f210f955601c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:46:49 2007 +0200 EXA: FillRegion{Solid,Tiled} improvements. * Support planemasks, different ALUs and arbitrary tile origin. * Leave damage tracking and non-trivial fallbacks to callers. * Always migrate for fallbacks. This is in preparation for using these from more other functions. commit e869573b52fac69fb88cea120daaeec59c7a3461 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:45:48 2007 +0200 EXA: exaAssertNotDirty improvements. * Return early if the valid region is empty or the pixmap is pinned. * Fix loop for several cliprects. commit d3f8667341bfe6dc7d0258c4ad69377f37d88d95 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:44:27 2007 +0200 EXA: Fix exaEnableDisableFBAccess for nested disables and enables. commit 5e4b3232dafe3b0dec65bf639bebaba4774210b7 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:38:22 2007 +0200 Fix fbCompositeTrans_0888xnx0888 build for wfb on big endian. commit 2866e0bac9b8dd3892c5e68abcfc6c97cebaf88a Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Apr 29 23:38:13 2007 +0200 Fix a couple of picture repeat fields incorrectly compared to RepeatNormal. commit 78a20455356ccc310f73cfc65ad65a7677eee7e5 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 27 15:20:24 2007 -0400 Pixman merging More msvc++ porting commit 6c4f1826bf2c5f30f5fe6e489a02b6375478b380 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 27 08:13:08 2007 -0400 Bug fix in fbCompositeIn_nx8x8888 Make sure both halves of the dst word is set to zero when the masks are both 0. commit f28eea0647f007c2e2415ecc6fceef46201faad4 Merge: 339b73e ae04f2c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 27 16:34:36 2007 +0930 Merge branch 'master' into mpx Conflicts: dix/devices.c dix/events.c commit 339b73e710a0920608a3fbcb20b406f0f6c4e0f6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 27 13:24:27 2007 +0930 Allow events to grabWindows event if the device is not grabbed. This kinda makes popup windows useable if the WM doesn't set the ClientPointer. Kinda. commit ae04f2cb0a068cdc1e519627bf745de0c9e4a85a Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Apr 26 15:28:04 2007 -0400 Fix the 'relink' target for kdrive servers. commit 6c8152d6ee9eeb21a68a8bbfed1540939e5bcd1f Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Apr 26 14:59:04 2007 -0400 Remove old edid_modes.c, it lives in hw/xfree86/modes/ now. commit 2208c6087d6bffcb24a30891a56430e28735874c Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 14:40:30 2007 -0400 Change expand_alpha_rev to expand_alpha in mmxSaturateU commit a300ef84cee26febfbe08c497d0d063588130bdd Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 14:37:53 2007 -0400 Fix typo in previous commit commit 0ebe48be59368b55c618f60d4656300bd7f52ed9 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 14:36:32 2007 -0400 Pixman merge - Changes to support MS Visual C++ - use inline instead of __inline__ - Fix rounding errors (Billy Biggs, from xserver via pixman) commit 4fe918b38553133c27e5ae672e5c43984a9bbaea Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 12:41:01 2007 -0400 Fix bug 8871 - scrolling corruption with a compositing manager Call miHandleExposures() in CopyArea/CopyPlane explicitly in cw to generate GraphicsExposes correctly. commit 0ff7c94fcf6497ee8575f81cf97eeeb3a857739e Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 10:56:02 2007 -0400 Pixman merge Make use of fbCompositeSrcAdd_8888x8x8mmx commit 701ccb4a22cfd646ccb7f19b7b3a476aeb5ce2da Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 10:49:06 2007 -0400 Pixman merge - Remove stray default label - Integrate new MMX ops SolidMaskSrc_nx8x8888mmx, In_8x8mmx, and In_nx8x8mmx - Formatting changes to reduce diff noise commit a54ef54db19dcd36ed86b33cff2bc369f9690a15 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 10:24:25 2007 -0400 Pixman merge Make sure fbCompositeSrc_x888x8x8888mmx and fbCompositeSrc_8888x8x8888mmx are used when possible. commit 3571b8e65b0857322d12e291305cfe29ea497c3c Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 26 09:45:11 2007 -0400 More pixman merging - Move some code around to minimize diff noise - Add mmx ops from pixman that never made it into X - Merge Jeff Muizelaar's bugfixes to fbCompositeSrc_8888x8x8888mmx and fbCompositeSrc_x888x8x8888mmx. commit cfc01115af4136b2dad8218ba6b389513a356a2e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 26 22:18:35 2007 +0930 Fix cursor rendering for multi-head. Before putting anything on the screen, check if the GC was made for the ScreenRec we want to render to. If not, toss the GC and create a new one. This is not the best solution but it does the job for now. Same thing for ARGB cursors except that it's even uglier. Also remember the screen the cursor was rendered to and check for the right screen in the BlockHandler, SourceValidate and a few others. Only remove or restore the cursor if we are rendering to the same screen, otherwise we get artefacts that are both funky and really annoying. commit 82f97e1c0cc15b050edc82a8f3b9a423d6cf5fe7 Author: Paulo Ricardo Zanoni <prz05@c3sl.ufpr.br> Date: Thu Apr 26 15:58:50 2007 +0930 Enable event delivery for multiple heads. Requires moving the spriteTrace into the DeviceIntRec and adjusting a few functions to take in device argument, most notably XYToWindow(). Cursor rendering on the second screen is busted. commit c0346e57e6d3857994f7af76060c502c2fdea294 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 26 12:02:45 2007 +0930 Require inputproto 1.4.2. Requirement was introduced with c7e2ba0c9b9b1fc1aed8f91f86471c4c8e650b78. commit 67347739b0571b2978468e8088480b105f505ad2 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed Apr 25 14:19:39 2007 -0400 Don't treat convolution filters as transformations. Some rearrangement of code to get it closer to pixman. commit c056ce95d89ef1df57edf47149fc34cd3925496e Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed Apr 25 13:21:47 2007 -0400 Port MSVC++ CPU detection code from pixman. (Vladimir Vukicevic). commit c19ece1d8c32dc81740a4036a642661f54064e75 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed Apr 25 12:34:19 2007 -0400 Integrate optimization from xserver from David Reveman where repeats get handled by fbFetchTransformed() rather than in the region walking code. commit 48c73dfc369fdf8f6023436ebe82bb604f76bb80 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed Apr 25 12:09:22 2007 -0400 Add function fbCompositeSrcAdd_8888x8x8(), and fix a bug where srcRepeat = FALSE would be set in the wrong place. commit 66ba3d758a368bf83d75bab8b08bdb6b34925e40 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Wed Apr 25 10:31:38 2007 -0400 Various fixes from xserver via pixman (Billy Biggs) commit c09e68ce30dabd6b7068b163b9d2382d85d0d0bc Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Apr 25 16:46:26 2007 -0400 Paper over a crash at exit during GLX teardown. commit 9c80eda826448822328bb678a7d284cc43fffb17 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Apr 25 16:35:04 2007 -0400 Disable RANDR's fake Xinerama protocol when there's more than one screen. ... in the protocol sense. Xinerama doesn't have any provision for more than one protocol screen each with its own geometry. Red Hat bug #231257. commit d322608dc929d5f8cda07a53143a4f28423e0460 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Apr 25 16:29:48 2007 -0400 Fix a buffer overrun on machines with excessively large PCI busses. Formerly we sized an array with a compile time constant, then initialized its size to the same constant, but the Linux PCI init code would increase that "constant". So if you happened to have more than 128 PCI devices, you'd happily scribble into whatever variables happened to be in .bss after that array. Only really fixed for Linux atm. Other OSes will simply (still) fail to work on video devices above the 128th PCI device. commit 3ba1e8ab6d69566e1a3f8f0eb4605631aeffc8e5 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Apr 24 17:20:14 2007 -0700 Include xf86Rename.h in xf86RandR12.h. commit 0a2fe443d25b1ca25349aba3f748df986952e20f Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Apr 24 19:02:44 2007 -0400 Use READ/WRITE macros for new functions introduced in previous commits. commit 7e16da7b78c422f96387502b9cc29eaa1741543f Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Apr 24 18:15:34 2007 -0400 Remove #if 0'ed blocks commit 18252a515d4989b983a3b7389636045e06d0f246 Author: Brian <brian@yutani.localnet.net> Date: Tue Apr 24 14:10:09 2007 -0600 bump release date to reflect input code updates commit 2d9a7a768747ca39a800475f12c424c298018dc6 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Apr 24 14:46:59 2007 -0400 From pixman (Jeff Muizelaar) Fix up the fast-path compositing operators; those are useful for sources without alpha, but can't be used for sources with alpha. Also, replaced fbCompositeSrcSrc_nxn with call to fbBlt as this function must handle 1, 4, 8, 16, 24, 32 bpp objects. Would be nice to optimize fbBlt for common cases involving 8, 16, 24 and 32bpp. From Keith Packard. commit fde4a5adf02d3067a064ebf6bdd666aa5784cfe9 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Apr 24 13:30:43 2007 -0400 From xserver via pixman (Jeff Muizelaar) Add some optimizations from jaymz. Also adds some compile warnings that will hopefully go awa y as we continue merging. commit 13e1d5ea55b0a3b7729316c8e37d3d8fca2075b5 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Apr 24 12:59:18 2007 -0400 Fix format vs formatCode in previous commit commit 077a5d4555676d5775e990468a697b6890c6d609 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Apr 24 12:57:55 2007 -0400 Add functions fbCompositeSrcSrc_nxn() and fbCompositeTrans_0565xnx0565 from xserver via pixman. Add READ/WRITE and fbFinishAccess as appropriate. commit 09436fb7c38a9819bde770c4c21143591671c4d7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 24 22:52:33 2007 +0930 Disable devices before removing, remove unrecoverable devices. commit c7e2ba0c9b9b1fc1aed8f91f86471c4c8e650b78 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 24 21:34:47 2007 +0930 Use DevicePresence events to tell the client about enabled/disabled devices. Include the device id in the event sent to the client. commit ce099a9b78195540ec251a6a3dbe26019c1a686d Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 23 12:34:01 2007 -0600 fix bug in which maxKeysPerModifier wasn't getting set commit b5e1f7869b2f12a1c2baa7f699ae609fc9ad50aa Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Mon Apr 23 14:16:30 2007 -0400 Remove #if 0'ed merge leftovers commit 84838268b34661d598f8e4856fab355f414930d9 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Mon Apr 23 13:19:54 2007 -0400 Gradient fixes * Port fix for bug 7685 from pixman. Patch by Carl Worth * Add projective version of radial gradient code. * Make sure that all Pict*Gradient types have PictGradient as prefix, since code in various places relies on that. commit 38d14e858980a1b0c087344d24bf6aebf755663c Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun Apr 22 18:04:27 2007 -0700 Adjust the screen pixmap's dimensions in xf86RandR12ScreenSetSize. commit ca784df84e07227a4cc0a1add079884f557b7a00 Author: Aaron Plattner <aplattner@nvidia.com> Date: Sun Apr 22 16:26:01 2007 -0700 Fix unbalanced fbGetDrawable added in commit 0a9239ec. commit 55bd8668e7d4100579bcd6c16a804d9f25267070 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 20 14:53:37 2007 -0400 Remove #if 0'ed leftovers from merge commit 41dd7ab067adde8f66cd9f74c5a6570c325518a5 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 20 14:51:40 2007 -0400 Fix gradient walker to not reset needlessly Previously the gradient walker was doing excessive resets, (such as on every pixel in constant-colored regions or outside the gradient with CAIRO_EXTEND_NONE). Don't do that. Carl Worth, from pixman commit c1b73f0f2acd56b423b91a04f1e1b3cdcad0069f Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 20 14:34:13 2007 -0400 Fixing gradient repeat mode computations in previous patch. From David Turner. commit 38f718799c68995c2d9a1680355bd55fd925009e Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 20 13:59:11 2007 -0400 Remove a few memory references in fbFetchTransformed commit 9c4b14d4f6a1fe018acd64789434216cd1560a4a Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 20 13:23:58 2007 -0400 Integrate David Turner's gradient optimizations from pixman commit cd2c1714eb4946bf7b1fc194fe074f8024a2ec23 Author: Brian <brian@yutani.localnet.net> Date: Sat Apr 21 12:40:51 2007 -0600 add slang_mem.c commit 67545333ec0b08db783e94e9e3ec55873dea19a3 Author: Brian <brian@yutani.localnet.net> Date: Sat Apr 21 12:40:33 2007 -0600 replace occlude.c w/ queryobj.c commit 39bc8bb0fdc854dcf9bbc0857fec84d50fa4f3b2 Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Apr 20 14:22:42 2007 -0700 Don't call xf86RandR12TellChanged if it doesn't exist. Add some exports to xf86Rename.h. commit 3daa5c1a991d659b1386a09e33b044470d489cb3 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Fri Apr 20 09:43:16 2007 -0400 Fix pixman bug 5777, patch by David Reveman commit 9c2e955f6792e80fb84f848ed9e6ebbfd79f7130 Author: Brian <brian@yutani.localnet.net> Date: Fri Apr 20 07:21:19 2007 -0600 regenerated to add GL_CLIENT_ATTRIB_STACK_DEPTH (bug 9823) commit 96ef0f78438b60436c3940817980a3ab4070c7e8 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Apr 19 17:39:51 2007 -0700 Disable SourceValidate in rotation to capture cursor. SourceValidate is used exclusively by the software cursor code to pull the cursor off of the screen before using the screen as a source operand. This eliminates the software cursor from the frame buffer while painting the rotated image though. Disabling this function by temporarily setting the screen function pointer to NULL causes the cursor image to be captured. (cherry picked from commit 05e1c45ade9c558820685bfd2541617a2e8de816) commit 7ca4baffb5569ea12b578a4a3f69e93d272d6c6d Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Apr 19 17:37:18 2007 -0700 Was accidentally disabling rotation updates in mode set. Setting a mode on an unrotated CRTC was causing all of the rotation updates to be disabled; the loop looking for active rotation wasn't actually looking at each crtc, it was looking at the modified crtc many times. (cherry picked from commit 8b217dee3a6c46b13fc9571a4a9a95bc55686cdb) commit 806a537e644d8cc9e53f3ac52efb49453e5aa1fb Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Apr 19 17:49:34 2007 -0700 Revert "Suppress software cursor removal during rotated shadow buffer drawing." This reverts commit 999b681cf3973af4191506e49cde06963b11a774. Replacing this with simpler code that just disables SourceValidate during rotation redisplay. commit 0a9239ec258828ec1da6c208634a55fc4053d7da Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Thu Apr 19 18:19:34 2007 -0400 Merge David Reveman's gradient optimization patch from pixman commit d0e55774e0da641ba85c5173f27f68de27372747 Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Thu Apr 19 11:39:53 2007 +0200 libdri: Make sure the new DRIInfo keepFDOpen member is honoured. commit e1f0b3e70b696d7ea4cf9e6ed30d751e7fdbc577 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 19 12:00:24 2007 +0930 config: Return errors as negative numbers, device ids as positive numbers. Update dbus-api documentation. commit c6972c893359f8fa7631ae674330f3f4f7010ba0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 18 12:10:05 2007 +0930 Change dbus 'listDevices' call to not require an argument. Update dbus-api documentation, plug memory leak on dbus reply error. commit d61ed6c8a2823a3532439d5cb9f355129c93f523 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 19 18:08:55 2007 +0930 Check for NULL devices in CloseDevice(). commit 9c30f7422121a0443c8d612d06181e17d8af9730 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 19 12:00:24 2007 +0930 config: Return errors as negative numbers, device ids as positive numbers. Update dbus-api documentation. commit 999b681cf3973af4191506e49cde06963b11a774 Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 18 14:33:27 2007 -0700 Suppress software cursor removal during rotated shadow buffer drawing. commit 28bb34eec63bf3c98f38ba7fc044f6419aaa3307 Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 18 13:48:28 2007 -0700 Belatedly bump XORG_VERSION for 7.2. commit 5d8e8a7f4b3226bffd9e4d6d9326688f475b0183 Author: Eric Anholt <eric@anholt.net> Date: Wed Apr 18 13:22:26 2007 -0700 Remove libminimi build. It appears to have been a leftover of a previous incarnation of the build system that didn't handle miinitext.c well. commit 53fb42e65c2b2ff58a4a324b7f05cff8a587720a Author: Erik Andrén <erik.andren@gmail.com> Date: Tue Apr 17 21:34:47 2007 -0700 Syncmaster 226 monitor needs 60Hz refresh (#10545). I've managed to solve my own bug (#10545) by applying the following patch to the xserver. Please apply. <Conspiracy mode on> This monitor is "Vista Certified". I wonder if this is a pure coincidence... <Conspiracy mode off> With kind regards Erik Andrén (cherry picked from commit a63704f14a1d97b9a00fef6fa290e74e51b9732b) commit ae75afcb1b5419102c5be10b8826ceed50d2ef5d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 18 12:10:05 2007 +0930 Change dbus 'listDevices' call to not require an argument. Update dbus-api documentation, plug memory leak on dbus reply error. commit 9cee4ec5e6e06d23aafb302494b082c77ade4623 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Apr 17 16:01:56 2007 -0400 xace: change the semantics of the return value of XACE hooks to allow arbitrary X status codes instead of just TRUE/FALSE. The dix layer in most cases still does not propagate the return value of XACE hooks back to the client, however. There is more error propagation work to do. commit 47bd311e3dcc501cbb202ce79a55ac32e9db50f2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Apr 17 13:46:55 2007 -0400 security: remove debugging code. commit 1f06d32ef58749d0f0c062193d237ee98f60e90f Merge: cf962a8 fc162c6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Apr 17 12:10:22 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: dix/privates.c commit b6aec7f6f906a18d13586d63afabf1ee4fbb11c3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 17 16:51:16 2007 +0930 Change FocusIn/Out semantics to match Enter/Leave semantics. commit 451d5464b4e8a2516b8a4598b3c4eb14656be90e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 17 11:17:04 2007 +0930 Change enter/leave semantics for events with detail Notify{Nonlinear}Virtual. Core enter/leave events with detail Notify{Ancestor|Inferior|Nonlinear} are only sent for the first/last pointer to enter/leave. Events with detail Notify{Nonlinear}Virtual are sent at all times, but not to those windows that currently have one or more pointers inside their boundaries. commit fc162c6cfa06f0b012743d6d79cef45cf0166229 Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Apr 16 09:55:58 2007 -0700 Allow outputs to be explicitly enabled in config, overriding detect. Option "Enable" "True" will force the server to enable an output at startup time, even if the output is not connected. This also causes the default modes to be added for this output, allowing even sync ranges to be used to pick out standard modes. (cherry picked from commit a3d73ba2cb7e13a6d129cd88d6a7f7d756e2ced2) commit c41e3bd713206c0bbd8ab8cef4c83eb7ba7e1c3c Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Apr 16 09:53:42 2007 -0700 Use default screen monitor for one of the outputs. By default, use the screen monitor section for output 0, however, a driver can change which output gets the screen monitor by calling xf86OutputUseScreenMonitor. (cherry picked from commit f4a8e54caf6b9431711383a39f55a18e7fd654f4) commit 97a2c2579c56c304705c934f3b536473645747df Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Apr 16 09:39:47 2007 -0700 Using wrong log level in extension to built-in message was: typo in built-in module log message (cherry picked from commit 00cfd1f765895b4d1b2234f3203727a8871b64b0) commit deda7791dfa34d0563c8d7fa2a0660ac27e6858c Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 16 11:35:22 2007 -0600 remove sources deleted in Mesa commit 02d42f344ce020c9b84723671cb9c68d5c064933 Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Mon Apr 16 17:24:53 2007 +0200 Changes for single-entity multi-screen DRI. The entity (device) has a locking SAREA and a master file descriptor that optionally isn't closed between server generation. The locking SAREA contains the device hardware lock. Each DRI screen creates an new SAREA containing the drawable lock, drawable-and private info, the drawable SAREA. The first screen optionally shares its drawable SAREA with the device SAREA. Default is to close the master descriptor between server generations, and to share the drawable SAREA of the first screen with the device locking SAREA. Thus we should (hopefully) have full backwards compatibility. Mesa changes to support single-device multiple screens are pending. commit b5823ea3e1ed5a0449d44da05165a46719dcf287 Author: Keith Packard <keithp@neko.keithp.com> Date: Sun Apr 15 22:59:19 2007 -0300 RandR 1.2 spec says CRTC info contains screen-relative geometry. Was reporting mode size instead of adjusting for rotation. (cherry picked from commit e2e7c47a528447e90cff6cf10d2ce457742ef48d) commit cc4eb1c7ea1bace7ed69cfd80c99d22933282ae1 Author: Keith Packard <keithp@neko.keithp.com> Date: Fri Apr 13 15:04:29 2007 -0300 Add quirk for Acer AL1706 monitor to force 60hz refresh. This Acer monitor reports support for 75hz refresh via EDID, and yet when that rate is delivered, the monitor does not sync and reports out of range. Use the existing 60hz quirk for this monitor. (cherry picked from commit 1328a288e9030a472a915077160f090d1afd4126) commit eba81a0a01f8a61151d8bf9f3d83bda85ca26e73 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Apr 14 18:30:09 2007 +0300 glx: move __glXMesaProvider from GLcore module to glx module. This treats the GLcore provider similar to DRI provider, using a subset of XMesa as the GLcore interface. commit 6b040b79f0e247b6f2da8f7d239443743e96de67 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Apr 14 18:29:52 2007 +0300 glx: drop xmesaP.h include from xf86glx.c The declarations for the xfree86-specific XMesa functions were moved up to xmesa.h, requires Mesa as of 2007-04-13. commit 2c833f60acb3dc358815a99cd295ef7fc695c45d Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Apr 14 18:29:25 2007 +0300 glx: drop stray CAPI define. SI imports/exports were dropped from Mesa. commit ea27b09d3a973d9a4943f205b24940b8624cf405 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 13 17:15:22 2007 +0930 Deliver FocusIn/FocusOut events for all devices. Don't use VCK in SetInputFocus and DeliverFocusedEvent. commit 7ccebc50b98ac175fdbdfaab081bcead62e60ee3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Apr 13 13:08:44 2007 +0930 Documentation for events.c. commit 2bb3c81fc1ca98c909309f3af7e9c8ca6b695657 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 12 16:35:43 2007 +0930 Use paired kbd instead of VCK for EnterLeaveEvents, sanitize variable naming. commit e7b47b1758ed20e75ee267b3a09e91bf2861f6fd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 12 16:24:42 2007 +0930 Change core enter/leave semantics for multiple pointers. Send EnterNotify when first device enters the window, LeaveNotify when the last device leaves the window. Additional devices will not cause additional Enter/LeaveNotifies. commit 547d720938b3668666d60110d79b150b1e9325c6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 12 11:16:19 2007 +0930 Remove workaround for a NULL core pointer in ProcessInputEvents. This workaround is obsolete with 33a5d9605e3e282f6aa1921d7321a2a12ef02c42 commit d4dad6f84f82a4ade5005c3aa93511c1295875b8 Merge: f1f8b56 33a5d96 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 12 11:11:03 2007 +0930 Merge branch 'master' into mpx Conflicts: configure.ac dix/events.c hw/xfree86/common/xf86Xinput.c commit 33a5d9605e3e282f6aa1921d7321a2a12ef02c42 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 11 18:28:57 2007 +0300 XFree86: DGA: Don't call ProcessInputEvents from CloseScreen By the time CloseScreen gets called, we can't call ProcessInputEvents, as the event queue will get unhappy. So just unregister our hooks instantly, and hope that they don't get called. commit 0910540e4322bba72a2fa0a907072eab2547a7b6 Author: Remigiusz Marcinkiewicz <enleth@enleth.com> Date: Wed Apr 11 01:09:26 2007 +0300 Config: Extend D-BUS API Return device ID where available. Add listDevices call, which does what it says on the box. commit aecbc712144dd1aaf462bd758821438b1d22d957 Author: Remigiusz Marcinkiewicz <enleth@enleth.com> Date: Wed Apr 11 00:38:16 2007 +0300 Input: Allow a pointer to a device to be returned in NIDR Allow a pointer to the first device added to be returned, so we know which device(s) were added by the NIDR call. commit 4f05f9591e5492c72f3856bd7a2ff13378f59f2b Author: Magnus Vigerlöf <Magnus.Vigerlof@home.se> Date: Tue Apr 10 23:57:48 2007 +0300 Input: Always add devices with first available ID Scan the device list when adding a new device, and make sure we can use the first available ID, instead of always incrementing. commit 20674dcbb2373a0af287883bc008fb6fb23d4466 Author: Magnus Vigerlöf <Magnus.Vigerlof@home.se> Date: Tue Apr 10 23:55:36 2007 +0300 Config: Fix memory leaks Fix memory leaks that could occur along the error path. commit 82962bbae2b4fda274625d1712ef839ce1ab9dc8 Author: Magnus Vigerlöf <Magnus.Vigerlof@home.se> Date: Tue Apr 10 23:54:32 2007 +0300 Input: Add DeleteInputDeviceRequest Add DIDR, which asks the DDX to remove a device, analogous to NewInputDeviceRequest. Only implemented for XFree86 at the moment. commit 7b82a836c66ba88566255052caff63577e1a0384 Author: Magnus Vigerlöf <Magnus.Vigerlof@home.se> Date: Tue Apr 10 23:52:08 2007 +0300 XFree86: Fix memory leaks, option parsing, in NewInputDeviceRequest Plugged some possible memory leaks, and added some more checks on the options, particular for driver/identifier. Added an unwind. commit 4771fa8747791498e504d73afccfb5833499a38b Author: Magnus Vigerlöf <Magnus.Vigerlof@home.se> Date: Tue Apr 10 23:48:00 2007 +0300 XFree86: Fix memory leak in option parsing Fix option parsing functions and callers thereof to not leak memory. commit 07c56abf84080c020a3e7b7703a447c7f996975c Author: Magnus Vigerlöf <Magnus.Vigerlof@home.se> Date: Tue Apr 10 23:43:58 2007 +0300 Input: Plug memory leak in device free Remember to also free the motion history, if we're using the DIX-managed history. commit e92743bc9839c36914a44f3e5bc8cd85773ac794 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Apr 8 14:02:02 2007 +0300 getevents: Copy modifier state from extended to core devices Make core events carry the same modifier state as the extended events, so that holding down Ctrl on keyboard A and pressing Q on keyboard B won't cause your app to quit. commit e49f836d6fa2768cd6d2a6d0227b5dbf516013dc Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Apr 8 13:56:41 2007 +0300 mieq: Use larger default queue size Use a default queue size of 512 rather than 256, else Xephyr is too slow without a host cursor, so events get stuck in the queue. commit 4aae2de74b9224bac2b2e2522637dac09abc3837 Author: Jared D. McNeill <jmcneill@netbsd.org> Date: Tue Apr 10 12:57:15 2007 -0700 Add a real xf86EnableIO/xf86DisableIO for NetBSD/PPC. commit f77a8ea849d171a8ca00b2b7334866ace1ffbf73 Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Apr 9 14:29:46 2007 -0700 Rotate screen size as needed from RandR 1.1 change requests. Screen size must reflect rotated mode size when setting rotated mode using RandR 1.1 SetScreenConfig request. (cherry picked from commit efcec7dbd3c2736c7b421d29c4d37e231aa681d2) commit bcf17df69a232e5e84609abacdca36274316e170 Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Apr 9 14:12:27 2007 -0700 Disable CRTC when SetSingleMode has no matching mode. Update RandR as well. xf86SetSingleMode tries to resize all crtcs to match the selected mode. When a CRTC has no matching mode, it now disables the CRTC (instead of crashing). Also, poke the RandR extension when xf86SetSingleMode is done so that appropriate events can be delivered, and so that future RandR queries return correct information. (cherry picked from commit dc6c4f6989f87149d8605604f4514f5cbf11de67) commit 67e1c98895a566f927e1ae2384d56cfca104f971 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Apr 9 19:08:52 2007 -0400 Look for the PCI ROM file elsewhere in sysfs. /sys/devices reflects the bus topology, and we don't care that much. Easier (and more reliable) to just look in /sys/bus/pci/devices, which is a flat view. commit a08d5157f70567a0aa9583d4a15e62437340cf34 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Apr 9 19:04:56 2007 -0400 VT activate or waitactive are fatal if they fail. Also, be sure to waitactive on the way down, to make sure we're off the VT before exiting. commit 72b477f964c748a1ab668781643cc11877f19738 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Apr 9 18:59:01 2007 -0400 Don't write out empty sections from the parser. commit 1f6741db19d4c91b1eacb497dff1814acb1bf0c3 Author: Stefan Huehner <stefan@huehner.org> Date: Mon Apr 9 14:33:15 2007 -0700 Bug #10560: Code-Cleanup: function declarations () -> (void) X.Org Bugzilla #10560: <https://bugs.freedesktop.org/show_bug.cgi?id=10560> Patch #9511 <https://bugs.freedesktop.org/attachment.cgi?id=9511> commit f24391dbfd12a84253dfec794ee7884afd52e197 Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Apr 9 12:30:31 2007 -0700 In AIGLX EnterVT processing, invoke driver EnterVT before resuming glx. As the driver EnterVT function generally re-enables the hardware and prepares it for rendering, it must be called before any gl functions are called which could touch the hardware. commit 4c2e28b0916b5f75cfefb6df9fa0a7a09675539a Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Apr 9 12:28:53 2007 -0700 Add setrlimit call in -core option to make dumps occur. Default core size limit for most environments is 0, which disables core dumps. Add code in the -core option processing path to set the core limit to the maximum value. commit f1f8b562aaaa6ec32ab0d0697f964d92d6d536a4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 9 19:31:59 2007 +0930 Alloc sprite memory in devices' devPrivates, allow undisplaying cursors. Improve memory usage by allocating the sprite's memory only to devices that actually have a sprite and provide means to remove a device's cursor from the screen (more hotplugging, yay!). This commit breaks ScreenRec's ABI. commit 7cef789fa13ae53bfba6dc7b5a7928b7362b2522 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 9 18:37:48 2007 +0930 Close down virtual core devices when closing all devices. commit 6081b8c76f7d934bd4e9584a2f6d55636c5289d2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 9 18:35:47 2007 +0930 Don't explicitly init sprite for VCP, EnableDevice() will take care of that. commit 00b1d52f4103a07568dcebcdaa860b9b51f19b4d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 9 18:32:00 2007 +0930 Adding some comments to devices.c. commit aa77ffb510abe004802ab9acc6996e4c6fe3ebb2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 9 18:27:22 2007 +0930 Fix: pick new ClientPointer when device is closed. commit 4beeab8424774ea4c3142f29b90e33f1fc7cb154 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Apr 8 13:39:06 2007 +0300 XFree86: Treat evdev and vmmouse as mouse drivers (bug #10512, #10559) When we see an evdev or vmmouse section, assume that it's a mouse, and don't add a default mouse device. This will break users who have an evdev keyboard section but no mouse, and want the mouse to get added by default. commit 0a6ac992363343487dfe0a0fc985ea55bd448382 Author: Brian <brian@yutani.localnet.net> Date: Sat Apr 7 12:41:57 2007 -0600 regenerated to fix bug 10371 commit 7e385598613778de14c0feea0d32f17d7aa66a8e Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri Apr 6 13:38:12 2007 +0300 GLcore: fix after moving xf86glx_util.[hc] to Mesa. commit cf962a849db2b259ca558c6265ea7e3328a4d312 Merge: 5ad5625 5a804f2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 5 14:41:39 2007 -0400 Merge branch 'master' into XACE-SELINUX Conflicts: configure.ac commit 5ad562565ac8ef9257da3afb0de1ae4f90f80fe9 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 5 14:18:05 2007 -0400 devPrivates rework: properly free devPrivates on compatibility structures, type pixmap. Requires ddx'es to call the free function from DestroyPixmap. commit 5a804f2e97ab59745482660a635b801ac2b9e769 Author: George Sapountzis <gsap7@yahoo.gr> Date: Thu Apr 5 19:14:31 2007 +0300 configure: minor cosmetic, move GLX extension options together. commit a4e2fc703484fffed8dd50c1b4b24c564be4d3cd Author: George Sapountzis <gsap7@yahoo.gr> Date: Thu Apr 5 19:13:47 2007 +0300 glx: Remove stray __GLinterface. __GLinterface was droped from glcore.h commit 38ca7d388c47c4800c74442172d6595a9b3dfcc7 Author: George Sapountzis <gsap7@yahoo.gr> Date: Thu Apr 5 19:13:14 2007 +0300 glx: fix symlink, glcontextmodes.c was moved to mesa/src/glx/ commit 1d550bb2c5cb5b3e588f0e0b68a421dc1cb8bd7c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Apr 5 12:12:58 2007 -0400 devPrivates rework: minor fix; use calloc and avoid initialization. commit 5c4deb71a1cb981ea7e2e25d2b3a1179f27efa5a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Apr 5 14:21:46 2007 +0930 Synthesize WarpPointer events for the actual device rather than the VCP. commit ed75b056511ccb429c48c6c55d14dc7ae79e75a3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Apr 4 12:00:15 2007 -0400 dix: add new, combined resource lookup function. Move all dix lookup API deprecated so far to a new file dix/deprecated.c. Remove the deprecation warnings for the time being. commit 63e46e4fc3e98751f2edbed9c79ef3d5dc2dadc6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Apr 4 15:59:51 2007 -0400 devPrivates rework: properly free devPrivates on compatibility structures, excluding pixmap. commit f8482967ae8080f49dd1bbb0b79cc65020df679f Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Wed Apr 4 12:28:48 2007 +0200 Add an EXA driver callback to determine whether a pixmap is "offscreen" in exa terms, which means accessible to the GPU. Bump exa minor. The change is backwards-compatible. commit 7f36ba57062096e9c67889d5b7dd64e2fb0004e7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 4 17:38:10 2007 +0930 Allow for multiple animated cursors. commit 676188531b2bd7679ee1831b5c517df3e6d215c5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Apr 4 17:35:06 2007 +0930 Unrealize cursor only once, not per device. commit c10df5b967d4da4e11786520317e2917de5541fa Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Apr 3 15:47:01 2007 -0700 Swap RRScreenChangeNotifyEvent dimensions when the screen has one crtc and it's rotated. RandR 1.1 clients expect the size fields in this event to be the unrotated dimensions of the screen. This behavior is "weird", but that's the way the old code worked so we need to be bug-compatible with it. commit 1cb84768f376b477a08a558854609b0743f2bd29 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Apr 3 15:31:16 2007 -0400 security: rewrite to use new devPrivates support. commit 14aea12cadef647369e44639ff5024dd7034570a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Apr 3 15:23:56 2007 -0400 xace: forgot one of the hook call arguments. Add it. commit 353e19fd5e18ad55a0dd12a7b63f6af9df7bfe6b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Apr 3 14:06:02 2007 -0400 devPrivates rework: zero out newly allocated private space. commit e1dea151db6405e12d991feacba9446320739ee8 Author: Brian <brian@yutani.localnet.net> Date: Tue Apr 3 11:21:50 2007 -0600 Implement a minor hack in dmxCheckFunctionKeys() to detect special keys. Keep track of status of (left) alt/ctrl keys so that ctrl-alt-q to exit can be detected. Not ideal, but works for now. commit 0ee40c935750e25a9e178cdd70f6b2c667e79344 Author: Brian <brian@yutani.localnet.net> Date: Tue Apr 3 09:31:00 2007 -0600 s/intead/instead/ commit 23974f20bf0e0c2786cc75af026af5484f6dc331 Author: Brian <brian@yutani.localnet.net> Date: Tue Apr 3 09:30:24 2007 -0600 add DDXRingBell() stub to solve link problem commit a240c039c47c0be22ea5e100692307b26d938747 Author: Brian <brian@yutani.localnet.net> Date: Tue Apr 3 09:27:57 2007 -0600 Split the xserver/fb/fbcmap.c file into two files. Now, fbcmap_mi.c contains the fb functions which just wrap mi functions. Previously, these were in fbcmap.c and compiled when XFree86Server was defined. Now, clients of fbcmap should either use fbcmap.c or fbcmap_mi.c and not worry about setting the XFree86Server symbol. commit 1cc8db72816cd079f30255046e10043c350bf683 Merge: 645d87c a39f297 Author: Matthieu Herrb <matthieu@roadrock.(none)> Date: Tue Apr 3 16:04:45 2007 +0200 Merge branch 'master' of ssh://herrb@git.freedesktop.org/git/xorg/xserver commit 645d87cf8ef724d4591614f9994cdc4d7549a7a8 Author: Matthieu Herrb <matthieu@roadrock.(none)> Date: Tue Apr 3 15:47:18 2007 +0200 CVE-2007-1003: XC-MISC Extension ProcXCMiscGetXIDList() Memory Corruption commit 207f710d16337839c2427aa16fad70a49834153e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 3 19:02:14 2007 +0930 Delete all grabs from all devices when deleting a window. commit 5f382c9c7fbda6eccf8e76c28a90b55ff2f0aef3 Merge: 9b0b340 f09ee16 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 3 15:07:18 2007 +0930 Merge branch 'master' into mpx commit f09ee168e234d0a9416e15f2916726b975cad293 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 3 15:07:00 2007 +0930 Revert "o fix minor error in comment for GetPointerEvents()" This reverts commit 96ce17aa94413c4b8bcb61cae71167050130a307. commit 9b0b3406682b5a3161e6c3895771523214c37207 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Apr 3 15:06:26 2007 +0930 Make GrabDevice differ between core grabs and device grabs. commit a39f297ada4fa87c858395ae2aacefac5f8fba05 Author: Keith Packard <keithp@viola.jf.intel.com> Date: Mon Apr 2 14:15:36 2007 -0700 Don't erase current crtc for outputs on CloseScreen Erasing this variable causes some outputs (SDVO on intel) to fail to be correctly reset at server reset time. (cherry picked from commit 56262a4ee943f328d089a8eb4aa70b9a4bd5d135) commit 11797ffdcc22160317a5ebbc9291472570a51c6d Author: Eric Anholt <eric@anholt.net> Date: Mon Apr 2 18:21:58 2007 -0700 Move modes/ debugging output under Option "ModeDebug" in the Device section. commit e44f106ffc796c025abdfb66717c06db8b12b4e4 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 16:26:15 2007 -0600 clean-up, debug code commit 8d8bc8927760fad631bef83fa2841b455ff6d511 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 16:21:57 2007 -0600 fix formatting commit 3e482de7b145a5eed79b81c30c359fe43647824a Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 15:38:15 2007 -0600 checkpoint: more clean-up commit 76a7a5ca1f068c27c9b5fbd49d5a1da80ed6f488 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 15:24:05 2007 -0600 formatting fixes commit 69baad321d35dae0bfa535be0c6ed2131fed1e60 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 15:21:22 2007 -0600 clean-up dmxCoreMotion() dmxCoreMotion2() commit 44eb15adeee3b299677070f39625daa53679bd13 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 15:12:04 2007 -0600 checkpoint clean-up commit 0f873a9d4f02b399c37b4058c6a9a2e21aa205e8 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 14:51:38 2007 -0600 remove some debug code commit 3a0ce1084a18e17a3c8a009d99c228652b8763a9 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 14:51:21 2007 -0600 for completeness, init dummy's min/maxval[1] values (vertical axis) commit 12016f20f7f5365f30cfbeb05568b3fb89759e5a Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 14:50:48 2007 -0600 As for normal mouse device, init valuator maxval[] to real values, not zero. commit 0aaf28e5633a59563b89a2e42d19fabc84adc3ed Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 12:41:30 2007 -0600 In dmxBackendMouGetInfo() initialize the info->minval[], maxval[] arrays to the size of the backend display. It seems that the changes to X input exposed a problem that wasn't detected before. The axis clipping code in GetPointerEvents() uses those limits to constrain the pointer's coordinate range. The max was zero so the pointer couldn't move. commit 0013bf6ddb3867c9a504603434d8c2ec83f3f3bc Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 12:39:04 2007 -0600 undo 1280 valuator hack commit 08a88d1803f672555141011e082fbc0edeedcf05 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 12:28:14 2007 -0600 Pass num_valuators=0 for ButtonPress/Release. This seems to fix the button coordinate problem commit 70683e338dacc48e3adf489d66ec33b29dfc3b77 Author: Brian <brian@yutani.localnet.net> Date: Mon Apr 2 12:26:27 2007 -0600 formatting fixes commit e8777a91f37d828b9df839bf3d9cf2f954bdddb0 Merge: a120547 96ce17a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 2 15:36:26 2007 +0930 Merge branch 'master' into mpx Conflicts: Xi/closedev.c Xi/exevents.c Xi/extinit.c Xi/listdev.c dix/window.c hw/xfree86/common/xf86Xinput.c include/extinit.h mi/mipointer.c commit 96ce17aa94413c4b8bcb61cae71167050130a307 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 15 17:50:02 2006 +1030 o fix minor error in comment for GetPointerEvents() commit a12054757d21edacc1c24c3077b9214726652829 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Apr 2 11:20:44 2007 +0930 Xi: fix ProcXListInputDevices to include the virtual core devices. commit f2808005f4ee72c5fd7f5f3dcca181306485113e Author: Alberto Mardegan <mardy@users.sourceforge.net> Date: Sat Mar 31 16:51:24 2007 +0200 Bug #6620: Fixed a missing 'else' in ATIPseudoDMAInit(). Before this, we'd write some registers twice on R200 hardware and also possibly end up with a bad value in atis->cce_pri_size. commit 5257b32e492bd2082bef6a4cd0fea03ce093c0f8 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Mar 28 15:51:24 2007 -0700 Bump video driver ABI to 2.0 for cw change (commit 6ed08949af4f7ac09170d3d9581e4092b24a84ee). commit 73fdc16bc4f4e21ff604b3f9ded23b40398fb1b6 Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 16:07:26 2007 -0600 formatting fixes commit ebdc8ce5c108dc3b6b0004e7c7939d1a5bef8676 Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 16:05:46 2007 -0600 Checkpoint DMX updates: things are working much better now, but still not 100% right. Use new dmxCoreMotion2() function which enqueues motion events with GetPointerEvents()/mieqEnqueue(). The clipAxis() code in GetPointerEvents() is causing some grief. The limits seem to have always been (0,0) according to the original calls to InitValuatorAxisStruct() in dmxinputinit.c. Terrible hack for now: Call InitValuatorAxisStruct() with hard-coded max values of 1280 (my screen width). commit e9130b8bac73a0843d5ff6b2216eccfb3e094a48 Merge: 2c6d471 92e8cdb Author: Ian Romanick <idr@us.ibm.com> Date: Fri Mar 30 13:39:15 2007 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit 3c7413e0c2f87e154aa8aa4a83bd585a6d1091e8 Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 14:07:04 2007 -0600 Tweak some parameters, etc. Things seem a little better now, but still a ways to go. commit 7989dacdcb1449b10d7733dda11cd96e260e9fae Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 13:44:24 2007 -0600 num_valuators=1 for GetPointerEvents(), hack ButtonPress/Release position commit 1ea842960fddbc6363cc6e7f914d70ba45525a6b Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 13:43:15 2007 -0600 more debug commit 92e8cdbd32b0d86cabd4ad88e3240bf90c018b9a Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 13:19:33 2007 -0600 Checkpoint fixes to DMX for X input changes. Xdmx builds and runs now. Keyboard seems OK, and mouse pointer moves, but everything else is flakey. Something is still seriously wrong. commit d92da3d5f309392ac398c0975ef17bb04312d5e2 Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 12:56:34 2007 -0600 more formatting fixes commit 44acb2517d9fb07790d9d799aa9cc727d1b7d35c Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 12:54:22 2007 -0600 Fix some bad formatting. Doing this: if (something) stmt; is evil if you're debugging and want to break on stmt! commit 9f24798af50896cc3262c1201f75c10a688f2a83 Author: Brian <brian@yutani.localnet.net> Date: Fri Mar 30 12:49:34 2007 -0600 ompile fbcmap.c w/ -DXFree86Server instead of linking libfbcmap.a. The former works, the later doesn't (DMX blows up on visuals/pixel formats). This undos Daniel's patch, which undid my prev patch. Revisit someday. commit 76756f27561c6386cba0d338441e8ec7b98500ce Author: George Sapountzis <gsap7@yahoo.gr> Date: Thu Nov 30 04:20:32 2006 +0200 Make xf86glx.c unaware of Mesa internals Use newly added XMesaCopyContext() and drop the GlxSetRenderTables() call for Xgl, as this is now done inside XMesaForceCurrent(). This leaves xmesaP.h but only for the declarations of the three XMesa/XFree86 functions. Also, GlxSetRenderTables() stays but is only used in hw/xgl/glxext/ . Also drop xf86glxint.h, no longer used. Depends on mesa commit 7439a36785b6a2783e80a40a96c09db8f56dc2bc of 2007-03-30. commit 63d8f01819ef44ea3bf0d4fb20ba1d698ae91cd2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Mar 30 14:59:43 2007 +0930 dix: Fix wrong cursor refcount. Calloc cursor struct to ensure devPrivates are zeroed out and don't increase the refcnt for devices automatically when allocating a new cursor. Use new DeviceIsPointerType() to detect if device is a pointer _before_ device has been activated and can thus be identified and set up grab functions accordingly. This way we can increase the refcnt when we get a pointer grab. commit 20e4314b178e1a093bce85e93329d4bcfb4f4210 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 29 19:12:32 2007 +0930 dix: Try to get closer to the correct refcnt for cursors. This commit introduces a memory leak, as the refcnt never seems to get down to 0 and thus cursors will not be freed. Solves the problems with GNOME segfaulting every 30 seconds though. commit 307d2b57bbfcc281656011533627bea6ab98189e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 29 15:23:41 2007 +0930 Xi: remove 'register' keywords. commit 0c607f4b1902f993597e09ea7a2c83bc1cca9b96 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 29 14:43:50 2007 +0930 dix: Pick keyboard instead of using virtual keyboard in Grab/UngrabKey. commit 82a8b99a6c46018885600011913267d8af9dfe13 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Mar 28 15:17:02 2007 -0400 Move the XAA private indices to be static. Technically this is an ABI break, if you aren't smart enough to be using the getter functions. Cope. commit 8c7f56d92d8471ee059c14d322af5f7f555dd5c6 Author: Tomas Janousek <tomi@nomi.cz> Date: Wed Mar 28 14:46:30 2007 -0400 Bug #10296: Fix timer rescheduling. commit 327bc332a61294209d39286228199f54bdde73d1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 28 13:00:03 2007 -0400 xace: minor comment fixes. commit 299ff4c82998d2a32204bfbecde4993dfbd3d4a5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 28 12:57:11 2007 -0400 xace: provide creation-time resource hook call in CreateWindow(). commit 99b220969f2f8ba829bc8294b27ca90fd9311be4 Merge: 728ad64 82a8b99 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 28 12:54:04 2007 -0400 Merge branch 'master' into XACE-SELINUX commit 5ba4d9eedf1b4ce4795bf910cd184872e2d9b3fc Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Mar 28 12:03:19 2007 -0400 Refuse to create tiny modes from EDID detailed timing. commit 2c6d47108880584f1221ff86c6c8947627f9f607 Merge: c4fe1bc 8522044 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Mar 28 08:08:04 2007 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/Makefile.am hw/xfree86/dri/dri.c commit 85220446359a75ea2c359b418b4051c04eea739c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 28 13:03:32 2007 +0300 GL: Update for Mesa changes Added s_fragprog.c to fix the build. commit 1af2ef0b25fd8017a3271e624a5f1548f02b09f9 Author: Eric Anholt <eric@anholt.net> Date: Tue Mar 27 13:13:45 2007 -0700 Enable Composite by default now that it disables itself in the known bad cases. commit 0bfc3cc22db94ec6867596606fe93228e315c847 Author: Eric Anholt <eric@anholt.net> Date: Tue Mar 27 13:12:21 2007 -0700 Disable composite when Xinerama is active. It will likely take a decent bit of work to make that work right. commit 5e7936371c9e1ac48e19bf1e9e3f71f037fd9b5d Author: Eric Anholt <eric@anholt.net> Date: Mon Mar 26 20:18:18 2007 -0700 Disable Composite when the screen's visual is pseudocolor. Rendering fails badly in this case, and I don't care enough to fix it. commit 8afc7e2eb3ebec48d3879bf269143259c8bc18c8 Author: Eric Anholt <eric@anholt.net> Date: Mon Mar 26 15:55:38 2007 -0700 Refuse to initialize Composite if Render is not present. Composite relies on the presence of Render, in particular for the automatic compositing. commit 6ed08949af4f7ac09170d3d9581e4092b24a84ee Author: Eric Anholt <eric@anholt.net> Date: Tue Mar 27 17:31:28 2007 -0700 Move libcw setup to the only renderer requiring it (XAA). Additionally, protect libcw setup behind checks for Render, to avoid segfaulting if Render isn't available (xnest). The previous setup was an ABI-preserving dance, which is better nuked now. Now, anything that needs libcw must explicitly initialize it, and miDisableCompositeWrapper (previously only called by EXA and presumably binary drivers) is gone. commit e76b6349516d5d1c8f7167d6f5419e0d06a546c3 Author: Eric Anholt <eric@anholt.net> Date: Mon Mar 26 16:04:50 2007 -0700 Fix indentation of fakexa help text. commit 728ad64d979fd9e5cca28e8c15118c18d707c431 Merge: 0331c6a 6a0bed1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 27 13:16:40 2007 -0400 Merge branch 'master' into XACE-SELINUX commit 6a0bed16e80a91891cee6c7033c90875bc2af193 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Mar 27 16:51:12 2007 +0200 Fix typo in GL/mesa/shader/slang/Makefile.am. commit b8f846a9dfc6697d59ad5482ba7c9d738875318e Author: Dave Airlie <airlied@linux.ie> Date: Tue Mar 27 14:17:40 2007 +1000 gl: oops dodgy s appeared pointed out by jcristau on irc.. commit a63ee90bc2d490f6c5c1802c164391963cf6c1d9 Author: Dave Airlie <airlied@pegasus.(none)> Date: Tue Mar 27 11:05:52 2007 +1000 gl: update for latest mesa glsl-compiler merge commit d387a3ddf76716791e5e8b8f0954ca0df3c579d6 Author: Dave Airlie <airlied@pegasus.(none)> Date: Tue Mar 27 11:00:13 2007 +1000 fix loading of GLcore after recent loading changes commit 92ba435bd9aa7b6eca9aef8e5193576ef62fc9db Author: Eric Anholt <eric@anholt.net> Date: Mon Mar 26 12:44:58 2007 -0700 Update xorg.conf manpage for new RandR 1.2 monitor options. commit 0331c6a8fcba1dc27ef45aaf5f694799d0085413 Merge: 84a066c f7c5aa0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 26 10:28:05 2007 -0400 Merge branch 'master' into XACE-SELINUX commit f7c5aa0dc0fa3569a2ee412c4f996960f936b6ed Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 26 10:21:44 2007 -0400 Remove dead NEED_DBE_BUF_BITS code. commit 2e3cc861f90415f200826bc71dab6298d759c42b Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 22:01:34 2007 -0400 Since ddc, i2c, and ramdac are in core now, remove their ModuleData stubs. commit e88fa75c9b468b88bb7b87b1da235c6eb2fe8164 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 18 17:39:08 2007 -0400 Static cleanup on Xi/ commit 4b5802ddbd45271be3cadeae0a83a6742df2515b Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 17:57:54 2007 -0400 General DIX static and dead code cleanup. commit 04b87d6dfae02e4ecdb5216d12c6cdafd1e8c2b4 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 17:57:22 2007 -0400 Static and dead code cleaup for Xext/ commit af769892a91c9af59de53ca3bcd77fc4967daffb Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 17:56:32 2007 -0400 Static and dead code cleanup from mi/ commit 62224e39727fd6f1cf11a461983662f615a9fea1 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 17:55:15 2007 -0400 Static cleanup for xf86 ddx. commit e8bc1988d9ff10b65717574175f70df3c4d6334d Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 15:13:05 2007 -0400 Un-staticise VTSwitchEnabled, since kbd wants it apparently. commit 70e493d223b1e943e652191150bd0b7e1a6ebcfb Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 14:55:28 2007 -0400 Static and dead code cleanup over afb/ commit f36bf1a3e4ce9465ea4a6159c209924a3cafbe58 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 12:28:13 2007 -0400 Delete a dead file. commit 9a0f25de7ca3c68af867b38936103d17daa92ac6 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 25 12:27:01 2007 -0400 Static cleanups, dead code deletion. commit ac2356843e38b3400142bc54b65393c12976fc07 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Mar 25 09:41:33 2007 +0930 dix: Increase allocation size for core keyboard keymap to avoid buffer overrun when copying keymap from extension devices. commit 5f9c10e8da0d9d96cc00a38cdf9a8c3030063e03 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Mar 25 15:00:03 2007 +0930 Clean up DeviceIntPtr, prepare for Server 1.4 ABI. Move sprite-related information into a new SpriteInfoRec, remove isMPDev flag. commit e54311395e1e7ae458c8ce59da0914706c4a04f6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Mar 25 09:41:33 2007 +0930 dix: Increase allocation size for core keyboard keymap to avoid buffer overrun when copying keymap from extension devices. commit 1072b88a8f352484e70bc749e300c936e5600480 Author: Dave Airlie <airlied@linux.ie> Date: Sun Mar 25 10:06:00 2007 +1000 loader: fix already built-in message commit 804080a7096347d48c686f2c8fbfd06326bce400 Author: Keith Packard <keithp@neko.keithp.com> Date: Fri Mar 23 23:41:36 2007 -0700 Make pending properties force mode set. And, remove AttachScreen calls. Yes, two changes in one commit. Sorry 'bout that. The first change ensures that when pending property values have been changed, a mode set to the current mode will actually do something, rather than being identified as a no-op. In addition, the driver no longer needs to manage the migration of pending to current values, that is handled both within the xf86 mode setting code (to deal with non-RandR changes) as well as within the RandR extension itself. The second change eliminates the two-call Create/AttachScreen stuff that was done in a failed attempt to create RandR resources before the screen structures were allocated. Merging these back into the Create function is cleaner. (cherry picked from commit 57e87e0d006cbf1f5b175fe02eeb981f741d92f0) Conflicts: randr/randrstr.h randr/rrcrtc.c I think master and server-1.3-branch are more in sync now. commit 1f77120775dc05fc84a00dd55190af2fa50ae509 Author: Keith Packard <keithp@neko.keithp.com> Date: Fri Mar 23 14:39:10 2007 -0700 Ensure that crtc desired values track most recent mode. desiredX and desiredY were not recorded during xf86InitialConfiguration. desiredX, desiredY and desiredRotation were not recorded during xf86SetSingleMode. (cherry picked from commit 36e5227215e0912ddf8a010db042467f00efe0fc) commit 84a066cc88fe4326ddacd04ab5e1158a80571c33 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Mar 23 10:33:53 2007 -0400 xace: pass serverClient as default argument to dixChangeWindowProperty instead of NullClient. commit 476f2b5aefa518262b69e487555e6094818d857a Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Mar 23 01:17:14 2007 -0700 Incorrect extra memory copy in RRChangeOutputProperty. Left over from previous version of the code, this memmove will break when the mode is not Replace. (cherry picked from commit 945aa0aa556429b50dea8e8ebc0008304b093eb7) commit 7093367c3976bef5b9d219d9f2a7dc7dd3eeb091 Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Mar 23 01:05:55 2007 -0700 Fix Pending property API, adding RRPostPendingProperty. Pending Properties take effect when the driver says they do, so provide an API to tell DIX when a property effect is made. Also, allow driver to reject property values in RRChangeOutputProperty. (cherry picked from commit 8eb288fbd69e2ffd02521d2c6a964c8180d08ec8) commit 86d76390eb182f271f5fa5dc19205e97a867f7e7 Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Mar 23 01:03:40 2007 -0700 Make sure RandR events are delivered from RRCrtcSet. Some paths were skipping the event delivery stage. (cherry picked from commit 9ca7ba5d6012295a77ed773c656e786440da973d) commit 510eaa346e68fd82c852c7b41fb0e2c5be12da78 Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Mar 23 00:59:11 2007 -0700 Clean up xf86CrtcRec and xf86OutputRec objects at CloseScreen. Erase pointers to structures which are freed at server reset time. (cherry picked from commit 492c768065f49306a2194a88edf96b85de0ff4ff) commit 479b2be4badab0a67b1f091feb83c1364e27d783 Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Mar 23 00:57:18 2007 -0700 Clear allocated RandR screen private structure. Use xcalloc instead of xalloc when allocating this structure to ensure consistent contents at startup. (cherry picked from commit 16f4c0c1750824f2e5a001cef82a4122a7a2beb0) commit b63e0d2545bb75e14d9de019a88f31e20a2f7377 Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Mar 20 07:17:27 2007 -0700 Clean up Rotate state on server reset. The rotation state is stored in the xf86_config structure which is not re-initialized at server reset time. Clean it up at CloseScreen time. (cherry picked from commit f8db7665dcd7af78ca4db2461e0bf787ec662cb1) commit e1cc68add0bcdd5e0e4e15cf6ee8a3da136d3534 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 22 17:33:16 2007 -0400 xace: drop the name argument from the property callback. commit c9fb8a35332d101897607d8f06ed5a6512eac7cf Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 22 17:23:26 2007 -0400 dix: move access codes to separate header file, add DixCreateAccess. commit 1b766ffc0647d5e9a9bf6938d33548d977b5535e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 22 15:55:35 2007 -0400 dix: reorganize property code to better support xace hook; requires new API for changing a property, dixChangeWindowProperty, taking an additional client argument. commit 1b58304ac837735920747ed0f0d10ba331bdaeb7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 22 13:06:50 2007 -0400 xace: add new argument to property hook for property structure itself. commit 5486be4898766205149fadce71529724eb78fbf3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 22 10:59:21 2007 -0400 dix: devPrivates support for PropertyRec. commit f8cd19bd1692d12a6047c088a626a6ae715d469d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 22 17:47:01 2007 +1030 Xi: add GetClientPointer and GetPointerPairing requests. dix: use PickKeyboard for ProcSetInputFocus and ProcGetInputFocus instead of the core keyboard. commit a3296d111dc4d76aa3afa7e338cbab93eb390ec4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 21 17:01:26 2007 -0400 xace: add access_mode argument to selection hook. commit 4c1fb8069d5dd30a73277698503e9dcc2e9d64c6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 21 16:17:14 2007 -0400 dix: add new selection fields supporting redirection. This is a minor ABI break. commit 4fa482b4be1150bcffeabb64d018c00ac5951e41 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 21 14:49:56 2007 -0400 xace: bump major version since the hooks have changed. commit 9c144f8ac5cea25deaa543767dbaf371d029c608 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 21 14:39:00 2007 -0400 xace: add XACE_SELECTION_ACCESS hook for selection redirection/access. commit 3e9f7a5504ab41d845e88f293d8498c963d8a7d8 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 21 02:35:31 2007 +0200 XFree86 DGA: Guard against NULL pointer dereferences. Ass, u, me ... commit f292de2ef13dc994a38029cee9e2642576893332 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 21 02:04:12 2007 +0200 XKB: Fix size_syms calculation bug Apparently it needed to be nSyms*15/10, not *12/10; make it match the other allocation code. commit f34b9a20b0181d3c2641c305e91180711afbd4b9 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 21 02:03:37 2007 +0200 XKB: Be a tiny bit more conservative with type allocation Make sure size_types will _always_ be 0 if we don't have any types. commit 021fc5cb2cb4a7972b4a6fcb570c1da92787d68d Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Mar 18 16:31:19 2007 -0400 Static markup and dead code cull over xkb/. The former <X11/extensions/XKBsrv.h> has been pulled into the server now as include/xkbsrv.h, and the world updated to look for it in the new place, since it made no sense to define server API in an extension header. Any further work along this line will need to do similar things with XKBgeom.h and friends. commit 9398d62f27ee1b287e4458fd8b011c10f7b59efd Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 21 00:18:24 2007 +0200 XFree86 input: Add backwards compatibility for motion history Add the old motion history API back, as a shim around the new mi API. commit 0f75c47e0c5f4b2778930a6fabf894fc1dffd9d3 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 21 00:12:02 2007 +0200 xfree86 input: Re-enable DGA support Re-enable DGA support for relative mouse motion. commit 80d29475b9a2ebbb303a8e324e09a15c528d5556 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 21 00:10:38 2007 +0200 mieq: Allow event handlers for arbitrary events to be set Allow arbitrary events to use mieq by letting custom handlers be set. commit b8df961843a95b29258ae9c5d46ccfc620d8de1c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Mar 19 18:03:26 2007 -0700 Define XF86PM on Solaris x86 builds now that we have sun_apm.c commit 2945deba1d4a7dce4f6dd0c568297a1c537fdfb4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 19 17:09:10 2007 -0400 xace: drop XACE_WINDOW_INIT hook, it has been superseded by ResourceStateCallback. commit 78c962da76efe644b8d485265f1ecdda84b45d27 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 19 17:04:51 2007 -0400 xselinux: use the new ResourceStateCallback instead of the XACE_WINDOW_INIT hook. commit 6a89106e9c963a495fd40427d242ba0abd44f764 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 19 16:51:29 2007 -0400 xselinux + security: remove confusing CALLBACK macro. commit 0acf993e2878d0866fd4e2db8252c1ea6841e494 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Mar 19 16:11:01 2007 +1030 dix: Move sprite initalization/pairing from ActivateDevice to EnableDevice. zero out spriteTrace, otherwise GetCurrentRootWindow() may return invalid data. Evdev adds previously hotplugged devices on its own when rescanning, and ActivateDevice does not get called for those devices. Sprites need to be initialized or paired before the device gets started, so the safest place to do so is EnableDevice (which actually does get called by the evdev driver). commit 015d728bcde5b16a72a976579755421e3023626b Merge: 65b0eb6 b167583 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Mar 19 09:42:56 2007 +1030 Merge branch 'master' into mpx Conflicts: dix/devices.c dix/events.c mi/misprite.c commit 720f302d241e88e6e9f2962207da1aa9a79728b7 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Mar 17 20:14:05 2007 -0700 Slow down DDC I2C bus using a RiseFallTime of 20us for old monitors. This time value makes the bus run slowly enough for even the least reliable of monitors. Thanks to Pavel Troller for finding the necessary change. commit b5a8a71e64c76b8dd42962cbd7984215c6ce4aa8 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Mar 17 17:26:11 2007 -0700 Remove extra (and wrong) I2C ByteTimeout setting in DDC code. The DDC code sets the I2C timeouts to VESA standards, except that it had an extra setting of the ByteTimeout value which was wrong (off by a factor of 50). Removing this should help DDC work on many more monitors. Note that the Intel driver duplicated these settings, along with the error. Yay for cult and paste coding. commit 2489dae9f7def788910eee5733931392df83a0d6 Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Mar 15 20:26:07 2007 -0700 Correct ref counting of RRMode structures RRModes are referenced by the resource db, RROutput and RRCrtc structures. Ensure that the mode reference count is decremented each time a reference is lost from one of these sources. The missing destroys were in RRCrtcDestroyResource and RROutputDestroyResource, which only happen at server reset time, so modes would be unavailable in subsequent server generations. commit 9d0c3b52f25df89738fb1a62ccffda8c8cbb4689 Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Feb 20 23:04:26 2007 -0800 Eliminate RRModeRec devPrivate field. The xf86 mode setting code was mis-using this field to try and store a pointer to a DisplayModeRec, however, each output has its own copy of every DisplayModeRec leaving the one in in the RRModeRec devPrivate field pointing at a random DisplayModeRec. Instead of attempting to rectify this, eliminating the devPrivate entirely turned out to be very easy; the DDX code now accepts an arbitrary RRModeRec structure and set that to the hardware, converting it on the fly to a DisplayModeRec as needed. (cherry picked from commit 3506b9376c2b0db09bfff58d64e07af88a6e8195) commit 2c93083edd29a65e73bb2e8eff9d353e92845c9b Author: Keith Packard <keithp@guitar.keithp.com> Date: Sun Feb 18 23:49:38 2007 -0800 Add support for user-defined modelines in RandR. The RandR protocol spec has several requests in support of user-defined modes, but the implementation was stubbed out inside the X server. Fill out the DIX portion and start on the xf86 DDX portion. It might be necessary to add more code to the DDX to insert the user-defined modes into the output mode list. (cherry picked from commit 63cc2a51ef87130c632a874672a8c9167f14314e) Conflicts: randr/randrstr.h Updated code to work in master with recent security API changes. commit b167583fe234a536aa6187e17f21da85be4f0b7f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 15 17:50:02 2006 +1030 o fix minor error in comment for GetPointerEvents() commit 65b0eb60b0b9e6405aa2e3d4c712ec4d2f0da070 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Mar 16 15:52:24 2007 +1030 Xi: move IsPointerDevice into dix. dix: IsPointerDevice and IsKeyboardDevice, use same ways to identify type of device as XI does for the XListInputDevices reply. Autopair each non-pointer device with VCP when activating, pair with real device after activation. Don't return non-keyboard devices when calling GetPairedKeyboard or PickKeyboard, otherwise we segfault for 'evdev brain'. commit 3bffb281260476d2f74f0bf451d85d2f7cacd6c4 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Mar 15 16:16:16 2007 -0700 Don't wedge when rotating more than one CRTC. Rotation block handler was re-registering the rotation damage structure, creating an infinite loop in the damage code. Track registration of the damage structure to avoid this. (cherry picked from commit b14f003b0ed1252766c9e3b1c086ea2809521047) commit 9562b6abe1da566cf73a08c4f4c4339fb67fbc71 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Mar 15 10:50:45 2007 -0700 Allow xf86_reload_cursors during server init. xf86_reload_cursors is supposed to be called from the crtc mode setting commit hook; as that happens during server initialization, check for this case. (cherry picked from commit 5b77bf2d020b1ee56c1c5f2db089a8f7f64a76a6) commit 3b71b0f89f1db837da91650baa0ef4bb7ef2e98f Author: Eric Anholt <eric@anholt.net> Date: Thu Mar 15 13:21:00 2007 -0700 Set the RandR version returned, rather than just passing the proto's version. commit 2fe74ef339c3a4902ae8214f5a0454662895422c Author: Matthias Hopf <mhopf@suse.de> Date: Thu Mar 15 16:56:01 2007 +0100 Fix calculations in x86 emulator for the long long case (Andreas Schwab). commit 456f429ad655ab4d80e30c58291d801966a613b2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 15 21:48:19 2007 +1030 dix: fix: don't return when device is same as argument. fix: set access default rule to 0 on init. commit ae75019ccf1edac9e8be31b6a96293624f672ccb Author: Keith Packard <keithp@guitar.keithp.com> Date: Wed Mar 14 23:59:29 2007 -0700 Create driver-independent CRTC-based cursor layer. This moves most of the cursor management code out of the intel driver and into the general server code. Of course, the hope is that this code will be useful for other driver writers as well. Check out xf86Crtc.h for the usage information, making sure you add the needed hooks to the crtc funcs structure for your driver. (cherry picked from commit 4d81c99a4660a0bf9014f789de55edabd185bd14) commit c5b07fb717289f61b54d7b093421bcb92124b839 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Mar 14 17:42:30 2007 +1030 kdrive: update kdrive to new mi API with additional device argument. Includes an update of ati_cursor.c and i810_cursor.c commit c3eb248cf93a3afd9168acfb88254606beddd7a8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Mar 14 13:21:33 2007 +1030 dix: fix: don't skip first item in list when seeking for a device cursor. commit ce9409acebd994cf1809050f2cc8e1db66130f12 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Mar 13 19:16:56 2007 +1030 dix: Get the state from the paired device and the real device to fill the state field in the event, rather than using the virtual devices. ProcessPointerEvent: name argument "device" instead of "other". Add GetPairedKeyboard(). commit 4bf1b280f7cb676ec2b172f26dd2ad9bac2eb2ca Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Mar 9 14:18:14 2007 +0000 Set pScreen on context commit c366b82bd50066019cf82b3464445d5bc27d6f9f Author: Jay Estabrook <Jay.Estabrook@hp.com> Date: Fri Mar 9 12:26:55 2007 +0000 Ensure domain is stripped from the bus ID. commit 577464af4362e5a32cf7165b5128655dd86c6200 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Mar 9 17:13:05 2007 +1030 dix: restore commit b3b2a6a0d43d1724e04d69588f8a55c3270e5523 that for some reason got wiped. fix ProcGrabKeyboard to use PickKeyboard fix PickKeyboard to actually work. commit 07806f4081f8dcd3b5733b590eb6e5b4cae734ad Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Mar 9 15:45:25 2007 +1030 Xi: Add SetClientPointer request handling. commit 405483496538f1c82cbd7fe1e76c5d94e1a90525 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Mar 9 14:16:23 2007 +1030 mi: remove 'register' keywords. commit fe05ba75a10ec080e7ec34bff6936103185586b3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 8 12:14:30 2007 -0500 devPrivates rework: pass address of pointer to private callbacks instead of the pointer itself. commit 18339375cd332f0ab1cbdade3dcd9140212ce1ca Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 8 12:14:06 2007 -0500 xselinux: remove context validation function for now. commit b9cff1670f29949a5bc41afc19aca443f434febb Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 8 12:13:52 2007 -0500 Add ResourceStateCallback similar in function to ClientStateCallback. commit 2fcb45eb5dc1803b372df8b5765f6a43bea83611 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 8 12:13:36 2007 -0500 devPrivates rework: redo field offset registration, drop RC_PRIVATES class. commit 947f8d249bac61beb10669d935888c4c280b5062 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 8 12:13:18 2007 -0500 devPrivates rework: redo interface again, dropping parent and type parameters as well as preallocation routine. commit c45f6762080ef00b41d9f73441a9f0e605253008 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 7 11:22:42 2007 -0500 devPrivates rework: hook up new mechanism in backwards-compatibility mode on existing structures that support devPrivates. commit b3b2a6a0d43d1724e04d69588f8a55c3270e5523 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 8 22:16:17 2007 +1030 dix: Check if client has a grab on any other device before mouse/kbd event is delivered to the client. Client's don't cope well with receiving core events from other devices when having a grab on a pointer or keyboard. commit 63169ce52d354b4345dcfc46b89f0ea88379718f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 8 17:50:19 2007 +1030 dix: remove 'register' keyword for all variables. commit ceca5670fee99b5feceaa2453f1ac32d1bfe7dcd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 8 17:17:23 2007 +1030 dix: Each device needs to differ between a core grab and an XI grab, otherwise a Xi grab may overwrite or release a core grab. Replace grab and associates with coreGrab and deviceGrab structures, adjust rest of dix/Xi/etc to compile. xfree86: Don't check for core devices, we'll have the virtual ones anyway. If we check, the first mouse device is duplicated and sends double events. commit 40ae4f246d8818410490236ab183204a84765629 Author: Keith Packard <keithp@guitar.keithp.com> Date: Wed Mar 7 20:52:31 2007 -0800 Remove stale monitor data when output becomes disconnected. Remove parsed EDID and EDID property from disconnected outputs. (cherry picked from commit ae9d5aa479dd50cc81b755079fcf96a0d02f135a) commit b5fde366e2e21234ac0b81222fd5c42ca3e49cba Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 7 12:29:55 2007 -0500 Properly free device devPrivates - memory leak fix. commit a3d2c5d622d9ca36d6fa2966aff09524e3ea39ac Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Mar 7 11:02:47 2007 -0500 XORG_VERSION_CURRENT, not XF86_VERSION_CURRENT. If only this was the least wrong thing in this code. commit aaef4d6a4121d9341b670a0ce8fabc3b491049cf Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 7 09:57:02 2007 -0500 devPrivates rework: move reset functions into a single call. commit bb111291d854b4329e47367ce3c67e8a2785e6e9 Merge: 74175e0 e9bfb2b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Mar 7 09:03:46 2007 -0500 Merge branch 'master' into XACE-SELINUX commit 537bc2ead4d154552cbdc3a19e335f82af63792c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Mar 7 18:19:20 2007 +1030 Xi: Don't deactivate core grabs from non-core button/key releases. dix: set coreGrab flag for grabs caused by GrabPointer and button presses. remove virtual core devices from device list, only real devices are in the list now. Auto-pair each keyboard with a real pointer if one is available, provides multiple keyboards automatically after startup if devices are configured. fix GuessFreePointerDevice() to do what it's supposed to do. mi: fix: call miPointerMove from miPointerWarpCursor. fix: remove unused id field from miCursorInfoRec don't update sprite for virtual core pointer. commit e9bfb2b3d7dfaafd90d2ad0fa3d0e1acced4380b Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Mar 6 23:19:30 2007 -0800 Add hw/xfree86/docs/README.modes, documenting new mode setting APIs. This document covers both API and xorg.conf usage of the new mode setting APIs. (cherry picked from commit a59c31b0f7b94ed1f395c7586c37ef5fe7ba2a25) commit 72a23d88d73a8c72ed18847b004db05092d3e7be Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Mar 6 23:15:34 2007 -0800 Add xf86CrtcScreenInit to share initialization across drivers. xf86CrtcScreenInit performs initialization that needs to happen at ScreenInit time. (cherry picked from commit 558a4f5588ad2ec11254e0b5d6ce9515b137369e) commit 81526232bc0119d2ec7b8590be4f78cf066ae359 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 6 17:19:11 2007 -0500 remove PIXPRIV check as this flag is always set. commit a7cd53deb99957dec27a55ffd75e548b322ae0ce Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Mar 6 15:32:13 2007 -0500 remove PIXPRIV checks as this flag is always set. commit 024bbc7cbb924daaf3e305ddfc8e74509acd1e15 Author: Eric Anholt <eric@anholt.net> Date: Tue Mar 6 16:18:59 2007 -0800 Bug #9931: Fix linear allocations with a non-1-byte granularity. This was introduced in 83080809f9a1c1d24b0318e54632f25f5940da25. Instead of aligning the offset, it doubled it. Results were appropriately spectacular. commit 9d94c137596d3f9d9118ec70455b7a30b3582046 Author: Ben Byer <bbyer@apple.com> Date: Tue Mar 6 11:09:30 2007 -0800 updated todo list commit 81d581e655fc989da3be4256b83849a63b8607b7 Merge: a05ffca d5aba03 Author: Ben Byer <bbyer@bbyer.(none)> Date: Tue Mar 6 10:37:29 2007 -0800 Merge branch 'master' of git+ssh://bbyer@git.freedesktop.org/git/xorg/xserver commit a05ffca8dd0da9bdb5c1bf4c481028aeabf21e34 Author: Ben Byer <bbyer@bbyer.(none)> Date: Tue Mar 6 10:36:51 2007 -0800 rewrote event handling, Xquartz now has working mouse and keyboard. use it\! commit d5aba03feff41722c72b4c6193f09d141cbf1678 Author: Drew Parsons <dparsons@debian.org> Date: Tue Mar 6 23:53:23 2007 +1100 Xprint: shorten font filename to fit in tar length limit The length of the Xprint font file NewCenturySchlbk-BoldItalic.pmf pushes the full path over the traditional 100 character limit for tarballs (when module version number is included). Shorten it to NewCentSchlbk-BoldItal.pmf to get back below the limit and rename other font files in that family to match. commit 3206e9225897989638ad553e1f392b918ac4d21f Author: Ben Byer <bbyer@bbyer.(none)> Date: Tue Mar 6 02:31:59 2007 -0800 moved new event-handling code from X11Application.m to darwinEvents.c in preparation for making all Darwin servers use it commit 0ccd1443fd6db397b42e5b99ce733ce1316c785e Merge: ec1ef8a 9b6bb06 Author: Ben Byer <bbyer@bbyer.(none)> Date: Tue Mar 6 01:04:50 2007 -0800 Merge branch 'master' of git+ssh://bbyer@git.freedesktop.org/git/xorg/xserver commit ec1ef8a56d6217ca2b04899043874ce0bcad9784 Author: Ben Byer <bbyer@bbyer.(none)> Date: Tue Mar 6 00:57:23 2007 -0800 Fixed Darwin's Makefile.am to fix a problem building X11.app commit 9b6bb06f13a71f6078f762b4a78fa516faccb638 Author: Keith Packard <keithp@guitar.keithp.com> Date: Mon Mar 5 23:49:35 2007 -0800 Allow relative positions to use output names or monitor identifiers. Previous version used monitor identifiers if present, otherwise output names. That caused existing working configurations to break when additional information was added to the configuration file. (cherry picked from commit 3f5cedf00a82f08a433c95ffbb7f8ac69dcf6a50) commit bed76caa6caaea6a6598755b82a54425a9d9f73e Author: Keith Packard <keithp@guitar.keithp.com> Date: Mon Mar 5 23:36:00 2007 -0800 Use EDID data to set screen physical size at server startup. Screen physical size is set to a random value before the RandR code gets control, override that and reset it to a value based on the compat_output physical size (if available). If that output has no physical size, just use 96dpi as the default resolution and set the physical size as appropriate. (cherry picked from commit 843077f23a1b49bd712d931421753e3a09d4008c) commit 47f8361c3a64834587e54507653d8d5b258c2530 Author: Keith Packard <keithp@guitar.keithp.com> Date: Mon Mar 5 22:07:01 2007 -0800 Add xf86SetDesiredModes to apply desired modes to crtcs. xf86SetDesiredModes applies the desired modes to each crtc (as selected by xf86InitialConfiguration initially and modified by successful mode settings afterwards). For crtcs without a desired mode, pScrn->currentMode is used to select something workable. (cherry picked from commit bcade98ccaa18298d844a606cb44271f0254c185) commit 33d2cf93fb50464941e74efe246b10aee212223a Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Mar 3 23:10:31 2007 -0800 Move xf86SetSingleMode into X server from intel driver. This function applies a single mode to the screen (as from RandR 1.1, XFree86-VidModeExtension or XFree86-DGA) using a policy that selects one output to reconfigure to the requested mode and then makes all other outputs fit within that size. (cherry picked from commit 5a595c1f767a8d666348b845d18934aee0cfe38f) commit 689d52b6242434507a64a8fff27b01607628c393 Author: Jens Granseuer <jensgr@gmx.net> Date: Mon Mar 5 15:31:44 2007 -0800 Bugzilla #7145: fix build with gcc 2.95 Bugzilla #7145: <http://bugs.freedesktop.org/show_bug.cgi?id=7145> Patch #8987: <http://bugs.freedesktop.org/attachment.cgi?id=8987> commit 74175e0af74c530cb712a6772d3c5d61d1be9748 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 5 12:34:37 2007 -0500 devPrivates rework: remove some debugging code from dixFreePrivates. commit 23fc429aad5b2721911862617772c314e1036bb0 Merge: e684824 fe7b8f4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Mar 5 12:18:54 2007 -0500 Merge branch 'master' into XACE-SELINUX commit e684824709fa8ffe03dde3c8dfbc58c267515a4f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 1 15:00:02 2007 -0500 devPrivates rework: redo interface and implementation. commit fe7b8f4237874e3e45fe25a6bf06faddfa1ab8e1 Author: Ben Byer <bbyer@bbyer.(none)> Date: Mon Mar 5 03:48:27 2007 -0800 began to factor out code to move to darwinEvents.c commit 537dc5ecde46d0525c503d1d2b39b6eb89a1298e Author: Ben Byer <bbyer@bbyer.(none)> Date: Mon Mar 5 02:30:56 2007 -0800 started moving new input code into darwinEvents.c so that it may be shared by the three servers commit 39aa79177196e21bcdbaf8e44adead9ef91e6ee5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Mar 5 15:31:16 2007 +1030 dix: Add GuessFreePointerDevice(). Runs through device list and tries to find a pointer that hasn't been paired yet. xfree86: Use GuessFreePointerDevice() for newly connected non-sprite devices. commit 8ba5e8d82014b774a52f3e050ddbbb8bde4e0933 Author: Dave Airlie <airlied@linux.ie> Date: Mon Mar 5 13:46:41 2007 +1100 add a standard connector type and name for us as an output property commit 2e31872e05c2408d53ba0182bcddc5dabb3615fe Author: Dave Airlie <airlied@linux.ie> Date: Mon Feb 26 09:40:00 2007 +1100 modes: add commit/prepare hooks commit 1f0075786fedde538a95e2f39681052e25021d88 Merge: 57aa5e9 12175b6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Mar 5 12:37:17 2007 +1030 Merge branch 'master' into mpx Conflicts: configure.ac dix/getevents.c hw/xfree86/ramdac/xf86Cursor.c mi/mipointer.c xkb/xkbUtils.c commit 06b01186f6ae17aafdd1f628c306466ddea9e065 Author: Keith Packard <keithp@neko.keithp.com> Date: Sun Mar 4 17:15:24 2007 -0800 Remove debugging ErrorF from rotation code. (cherry picked from commit e6af7569f201842b4754aec6e72b30dc2daefdfb) commit c14507b6837387d867792a24778786311b2b38d5 Author: Keith Packard <keithp@neko.keithp.com> Date: Sun Mar 4 17:06:37 2007 -0800 Handle non-zero origin rotated crtc. Damage crtc area on re-rotate. Box transformation from source to dest area was broken, leaving the wrong areas painted when the crtc origin was non-zero. When rotating from left to right, the pixmap doesn't get reallocated, and so no damage was left in the pixmap from xf86RotatePrepare. Separately damage the whole crtc area when this occurs to repaint the area. (cherry picked from commit 2a50ca2160bc05af1c24421ec079e902ff730277) commit 97978b515b7af5fbaaa32b1729e835f3bfb9f5c6 Author: Drew Parsons <drew@pug.localdomain> Date: Sun Mar 4 16:28:54 2007 +1100 Xprint: fix font symlinks Change symlinks to Xprint base fonts in model/PSdefault using local relative links. This facilitates moving the Xprint config files, for instance for FHS compliance placing data files in /usr/share rather than /usr/lib. Also ensures NewCenturySchlbk-BoldItalic.pmf is installed. commit 215e3691b76a63e6af19865790193b20b105ec5a Author: Ben Byer <bbyer@xyzzy.local> Date: Sat Mar 3 21:52:56 2007 -0800 stopped using XTrans internals in X11.app because they're apparently no longer public commit ea8dcc458ea8870126cf8d3e21cab9d63d094c5e Author: Ben Byer <bbyer@xyzzy.local> Date: Sat Mar 3 21:51:20 2007 -0800 Makefile fix for X11.app commit 18508212599bf0964c450c69b9790208e5d428be Author: Ben Byer <bbyer@xyzzy.local> Date: Sat Mar 3 21:41:33 2007 -0800 fixed X11.xcodeproj to get CFLAGS and LDFLAGS from autoconf script commit 7f2b9f3790456044d01bf8e6404f9a1239b41da6 Author: Ben Byer <bbyer@xyzzy.local> Date: Sat Mar 3 19:27:53 2007 -0800 autoconf fixes for XDarwin (created DARWIN_LIBS) commit 12175b668a94e23994f724b366a691ec312cce69 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 15 17:50:02 2006 +1030 o fix minor error in comment for GetPointerEvents() commit ea1a72946d1aa4c256e6afb9d834c582ba4ac3a1 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Feb 28 14:26:47 2007 -0800 Add a canGrow argument to xf86InitialConfiguration. canGrow indicates to the DDX that the driver can enlarge the desktop via the xf86_config->funcs->resize hook. If so, xf86InitialConfiguration will set virtual[XY] to match the configuration it chooses and will leave the crtc config size ranges alone. If FALSE, it will bloat the screen to fit the largest probed mode and also set the crtc config max size to limit the desktop to the initial virtual[XY] size. commit 04d15da95d608766c7832a7aa881be499c1395ba Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Feb 28 13:36:58 2007 -0800 Add a screen resize hook to xf86CrtcConfigRec. This hook is called when the DDX needs to resize the screen. The driver is responsible for changing virtualX and virtualY, along with any other related screen properties (devPrivate.ptr, devKind, displayWidth, etc.). Use the size range from the crtc config instead of randrp->virtual[XY] when reporting the min and max screen sizes to the DDX. commit b11dfac287d65de7b83f63749087cba4e8ddaf4a Author: Matthias Hopf <mhopf@suse.de> Date: Fri Mar 2 12:30:26 2007 +0100 Legacy framebuffer support wasn't compiled if Xorg wasn't explicitly enabled. commit 57aa5e908dc11d5d8c27ed705c526f1416c1e8ad Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Mar 2 17:14:37 2007 +1030 dix, Xext, Xtrap, Xi: replace inputInfo.pointer with PickPointer where possible. More replacements to come. commit e43b8a4e40991ca6e545bda4cf9b9bd7a2bf22e2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Mar 2 15:21:46 2007 +1030 dix: Add ClientPointer to client, used for picking which pointer to use in ambiguious request. PickPointer and PickKeyboard are used for getting the appropriate pointer when situation is unclear. Fix some issues with InitializeSprite. dix, xfree86: Remove last traces of InitSprite. commit 2dafc46e3d814e02b25e5a2fa2e931f0257402a8 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Thu Mar 1 17:44:39 2007 -0800 Fixed pointer events in Xquartz -- Keyboard events work, but the keycodes are incorrect. commit 74f1de1de9633119c2cf26086875717181c8a6f7 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Mar 1 12:07:33 2007 -0500 devPrivates rework: unhook resource system; will try a different approach. commit 39ecd6fff4f946deebe310b4b26b171c842db223 Author: Ben Byer <bbyer@bbyer.(none)> Date: Thu Mar 1 01:45:19 2007 -0800 Rewrote parts of the Xquartz event-handling code (thanks daniels and whot!) It should still be considered a work in progress, but mouse events almost work. commit ed7ccc481ad1caaa518cafe944c2327a5d0b6c65 Author: Ben Byer <bbyer@bbyer.(none)> Date: Thu Mar 1 00:51:10 2007 -0800 AIGLX support for Darwin -- works well enough to run glxgears and glxinfo, but still needs more testing. commit 43bd35fcf85b51b7e5714844bade90184dbd746f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 1 17:19:37 2007 +1030 dix: Remove InitSprite, work can be done by InitializeSprite. Free sprite struct if a spriteOwner is paired. xfree86: Use PairDevices instead of passing booleans around when creating a sprite. Xext: Switch back to using LookupPointer/KeyboardDevice instead of inputInfo.xyz. commit 90ca76ba28fcd8bed945e33cf9674784fa2eb533 Author: Jay Cotton <jay.cotton@sun.com> Date: Wed Feb 28 17:40:58 2007 -0800 Add sun_apm.c for Suspend-and-Resume support on Solaris <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6205248> commit 06c3021aec720837bef432656e88ae9b4e35101d Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Feb 28 16:09:11 2007 -0800 Don't crash setting a NULL mode with a randr classic DDX. Also remember to update the screen size during modesets. commit 68c64ad7b1eea79c786b5a7f3459076780163a47 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Mar 1 09:51:20 2007 +1030 Xext: Update device's lastx/lasty when sending a motion event with XTest. commit 8b245758845523d5f8f017bb9d0e9aa57b616c28 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Feb 26 17:45:40 2007 -0800 Return BadMatch if a client tries to clone non-cloneable outputs. commit 2a35d44b6d87f96a7ce90dc8f0142f48cc176e95 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Feb 28 15:43:06 2007 +1030 Update device valuators on XTest motion event, otherwise the cursor jumps between coordinates stored in device and coordinates sent by the event. commit d9bcb22d199e8444b9762a35754e04d327dd5915 Merge: 272d934 c16343a Author: Ben Byer <bbyer@bbyer.apple.com> Date: Tue Feb 27 16:28:20 2007 -0800 Merge branch 'master' of git+ssh://bbyer@git.freedesktop.org/git/xorg/xserver commit 272d9341d0f7c3e9e0c9b9a8c0d4d8779cdcc5cf Author: Ben Byer <bbyer@bbyer.apple.com> Date: Tue Feb 27 16:27:26 2007 -0800 fix for hw/darwin/Makefile.am to properly use XSERVER_LIBS commit c16343ac2ca18391b21022b2edd02ad9f413d2b3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Feb 27 14:14:47 2007 -0500 Make mfb, cfb, and afb support configurable at build-time. commit 5680efc0d2baf0a9451e82e490e3690fc23dda0f Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Feb 27 09:55:48 2007 -0800 Sun bug 6529003: Xorg should not be including <sys/immu.h> on Solaris <sys/immu.h> was removed from the latest Solaris Nevada build, but it's been useless to Xorg for a long time (it only declared a couple of kernel variables) <http://bugs.opensolaris.org/view_bug.do?bug_id=6529003> commit ab0fc8c1ad7ea2dc3389a4a4bb1c45bbded5e7ad Author: Ben Byer <bbyer@bbyer.(none)> Date: Tue Feb 27 00:14:35 2007 -0800 verbiage corrected per daniels commit cdd4c84572cc3bdd004f8dca6d8b64e710344ac0 Author: Ben Byer <bbyer@bbyer.(none)> Date: Mon Feb 26 23:57:02 2007 -0800 added hw/darwin/README.apple file with some todo items and props. commit 776d4d6587c57f94bca8732f915d07a0d4e137c8 Author: Ben Byer <bbyer@bbyer.(none)> Date: Mon Feb 26 23:40:00 2007 -0800 X11.app now builds correctly commit 154d2c13f4ec22b7e6332808bbcd049d63784891 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Mon Feb 26 19:39:26 2007 -0800 more changes for X11.app commit fa06e11f972e2a75c84b2f1586997ffc1239cbd9 Author: Ben Byer <bbyer@bbyer.apple.com> Date: Mon Feb 26 17:06:53 2007 -0800 added hw/darwin/apple directory, which contains source and data files to build a version of the X11.app shipped with Mac OS X, using the X.org server. commit a16360733ea393ec1fc267e88fc604d9d7534484 Author: Jay Estabrook <Jay.Estabrook@hp.com> Date: Sun Feb 25 19:58:26 2007 +0000 Fix root bus/domain selection on alpha commit 566610680c4e1cab3e7fc7146adbeaba52fdd0ad Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Fri Feb 23 15:20:35 2007 -0500 Don't install libi2c.a commit 81372f9096b952f4be545654b0b44ac37ef4f2c2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 23 13:23:12 2007 -0500 devPrivates rework: hook up new interface in resource system; add new resource-adding function that takes an additional ScreenPtr argument. commit 16f2b8892d9ebcef6410a675d10549043223f617 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 23 13:20:43 2007 -0500 devPrivates rework: add new interface implementation. commit 779faccfb78648a9f7e70b77dcfa9f6e19559772 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 23 13:19:53 2007 -0500 devPrivates rework: add dix header file containing new interface. commit bc4ae25433e38a25a2012f9f233d500665172a4b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Feb 23 12:06:51 2007 +1030 xfree86: Don't initialize sprites for devices that don't own a sprite (stops keyboard hotplug segfaults) commit af550ea91c451cf4f831c2413266a19d1f211d0e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Feb 22 14:38:40 2007 -0800 Move SecurityPolicy file format from Xserver(1) to it's own man page Don't make users looking for Xserver information page through pages of details only interesting to the handful of people writing security policies. commit b1142cdbce76fed8cb22ba6d7ac027751dd56a76 Author: Brice Goglin <brice.goglin@ens-lyon.org> Date: Thu Feb 22 12:26:04 2007 -0800 Bug #10034: 'man Xserver' typos: s/dqoute/dquote/ Bugzilla #10034: <http://bugs.freedesktop.org/show_bug.cgi?id=10034> Patch #8780: <http://bugs.freedesktop.org/attachment.cgi?id=8780> commit 4b8b0e377a27ec904b2028c89aed11c6416af26c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 22 20:00:59 2007 +1030 Xi: Add access control request handling. dix: New file access.c to handle all access control for devices. commit 9a3eb0357e779d5d5f76858f23667956c4c5d721 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 16 19:30:03 2007 -0500 devPrivates rework: add RC_PRIVATES class, make ResourceRec visible in the API, and add extra fields and structure supporting private storage. commit cd0af7a7856e8246e27acc5513d219a094211625 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Feb 21 10:08:41 2007 +1030 Xi, dix: Only one client at a time can change the pointer-keyboard pairing, using xRegisterPairingClient request. commit 3344a4eda704edc7dc30037f095de277a60a70bb Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Feb 15 16:27:50 2007 +0100 DRI: Make sure number of DRI windows is accurate in driver ClipNotify hook. Always call DRI{De,In}creaseNumberVisible (which in turn calls DRIDriverClipNotify) after updating pDRIPriv->nrWindows. commit 3c7a27dc77595ad018bb7c4f7cef6bc178268cb6 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Feb 14 16:17:18 2007 +0100 DRI: New ClipNotify driver hook. The hook is called whenever the clipList of any DRI window changes, be it via DRIClipNotify, DRICreateDrawable or DRIDrawablePrivDelete. This allows the driver to keep track of which DRI windows are visible where. commit eedf148e5a1273ebbf4dc8dcac9c435712fc00ea Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Feb 2 18:27:40 2007 +0100 Track number of visible DRI windows separately for transitions. This allows e.g. doing page flipping with multiple DRI windows as long as only one of them is visible. commit 8a42af6a935b1cf0e15102e986bb527f4fab31a8 Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Feb 19 15:28:37 2007 -0800 Check for clientGone before sending events from XFixes (bug #1753). Freeing resources during client closedown can cause cursor changes which attempt to send cursor events through the XFixes extension; a client in the process of closing down has no file to send events to, causing a crash when this path is hit. commit 4660eaaffb36f526f71d5847ae1309c10ee133c6 Author: Ben Byer <bbyer@bbyer.(none)> Date: Sun Feb 18 14:09:51 2007 -0800 configure fixes for darwin commit 5631a67f648f5f151a849a918ee12871c71c32e9 Author: Keith Packard <keithp@neko.keithp.com> Date: Fri Feb 16 10:06:22 2007 -0800 Don't set subpixel order during startup; the screen won't be ready. in xf86CrtcSetMode, scrn->pScreen will be NULL during server startup time, so don't try to set the subpixel order. subpixel order will be set in the randr initialization anyways. (cherry picked from commit 5f6f8616d862ce4a37f6d3df4bdbc44fd21cc82a) commit 096965ec9c7514f0c9fc0d17e5166f2d26781f87 Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Feb 16 02:17:11 2007 -0800 Ensure drivers can use new modes header files. New modes header files required a few minor changes to be used by external drivers, the most notable of which is the publication of the config file parser header files. commit 55797dd252382d35ebab5d9e18a5e0e77872d775 Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Feb 16 00:56:00 2007 -0800 Respect rotation in initial screen size computation. commit e4507825bf0328ea59673f2bbe652de3a9105c86 Author: Keith Packard <keithp@guitar.keithp.com> Date: Fri Feb 16 00:41:29 2007 -0800 Enable startup-time rotation; change rotation pixmap creation API. Add monitor "Rotate" option taking one of "normal", "left", "inverted" or "right". However, because initial mode selection is made before the screen is completely initialized, we cannot create the shadow pixmap object at this point. Pend the shadow pixmap creation until the block handler. Note that this code is not completely functional yet. commit 8606aeb9b2ab2dafc11e64436db4d3a7e67dbcc0 Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Feb 15 22:23:16 2007 -0800 RRConfigureOutputProperty is a variable length request. Replace REQUEST_SIZE_MATCH with REQUEST_AT_LEAST_SIZE commit a88844eccb0e423e71d4fcb286866a026308babd Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Feb 17 20:35:07 2007 +0200 configure.ac: disable dmx per default Disable DMX until it gets ported to the new input API. commit e9a2cc7d9fcc73e16576be2522522cce675dc3f3 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Feb 17 16:17:48 2007 +0200 config: error message cleanup Demote failure to connect from ErrorF to DebugF. commit 81876bc5ddc2f3eda5078fe4bd101917fb32e586 Author: Ben Byer <bbyer@apple.com> Date: Sat Feb 17 04:07:11 2007 -0800 oops, missed a spot commit d287b76471f66c9aea54f969d050b35643cb2501 Author: Ben Byer <bbyer@apple.com> Date: Sat Feb 17 03:47:42 2007 -0800 cleaned up some linking ugliness in hw/darwin/quartz commit 81444486be4f182dde778bac6f7edcbfc4368482 Author: Ben Byer <bbyer@apple.com> Date: Sat Feb 17 02:23:11 2007 -0800 autoconf goodness for XDarwin, courtesy of pogma commit cf4994b0db2fef4c10ce8804adef766bc5118daf Author: Ben Byer <bbyer@apple.com> Date: Sat Feb 17 01:21:43 2007 -0800 dix mods for Darwin commit cece0601571f6304e392a3a40505664544b249f3 Author: Ben Byer <bbyer@apple.com> Date: Sat Feb 17 01:00:13 2007 -0800 build fix for configure.ac / BUILD_DARWIN, oops commit 00b0657b815b95964401c3e36eed54063afbd003 Author: Ben Byer <bbyer@bbyer.(none)> Date: Sat Feb 17 00:55:32 2007 -0800 glx fixes for XDarwin commit 93777c7b96e560da087963040e372aecbfca7bbc Author: Ben Byer <bbyer@bbyer.(none)> Date: Sat Feb 17 00:22:39 2007 -0800 more patches to make the Quartz part of XDarwin work again (thanks Peter and Torrey!) commit 612144c811fdf06b7c03cf48a321388fe411acd4 Author: Ben Byer <bbyer@bbyer.(none)> Date: Sat Feb 17 00:09:58 2007 -0800 More build fixes / updates for XDarwin: quartz/cr: "Cocoa Rootless" support (deprecated in favor of xpr?) quartz/fullscreen: Fullscreen support using Xplugin (not yet functional) commit 68d39d8571d8717d26cedc84015d537549520a14 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Feb 16 23:02:13 2007 +0200 kdrive/ephyr: fix keysym type confusion once and for all Take keysyms in as an XID in hostx_load_keymap() and explicitly convert them to CARD32 for loading into the server. Fixes Xephyr on AMD64, wa-hey. commit 5507cb885d861e974be240120ada2ace2a980a72 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Feb 16 23:01:27 2007 +0200 kdrive: delete input debugging, yet again ... I have no idea how this keeps on coming back. commit 2534f5a9027c196f677923aaa38fa9ed9917f73d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Feb 16 15:33:48 2007 -0500 Remove nasty function pointer type from DevUnion, return to documented type. commit 84efe23ae834dd3a4d3f3e08832b69469c7382aa Author: Ben Byer <bbyer@bbyer.(none)> Date: Fri Feb 16 04:37:38 2007 -0800 updated darwin/quartz/xpr (libXplugin interface for Mac OS X) support commit 5e7f7436a755a33e48ab91831cc6af710a8344ef Author: Ben Byer <bbyer@bbyer.(none)> Date: Fri Feb 16 04:12:26 2007 -0800 merged in miext/rootless changes for XDarwin support commit f350909d1696fcfda87e8f12c729254d762313c9 Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Feb 15 21:50:48 2007 -0800 Kludge around duplicate code added in hw/xfree86/modes. Code added in hw/xfree86/modes came from the server-1.3-branch. Portions of this code had previously been integrated into xf86Mode.c and edid_modes.c. To preserve hw/xfree86/modes as much as possible, the duplicate code from the other files has been disabled; a more careful review would figure out where that code actually belonged. commit 258beebc77510f84fbea66d6ebf29c5097bd11db Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Feb 15 20:13:15 2007 -0800 Report correct RandR 1.0 sizeID. Report correct subpixel order. RandR 1.0 sizeID must be computed the same way every time, so when reporting it in the ScreenChangeNotify event, just construct the usual 1.0 data block and use that. subpixel geometry information can be computed by looking at the connected outputs and finding any with subpixel geometry and using one of those for the global screen subpixel geometry. This might be improved by reporting None if more than one screen has information and they conflict. commit ef6b1235fd7d6dc422e8a150c089496a8e648067 Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Feb 15 11:27:35 2007 -0800 Allow new modes code to build inside drivers as well as server. Use config.h for driver builds where xorg-config.h isn't available. commit 3dbe8f6b6ea32a9a137ad6e9235f74009b095bd8 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Thu Feb 15 17:51:01 2007 +0100 Distribute hw/xfree86/modes. commit d4eb4d065032112a38444e36f791cb468a5ca8f4 Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Feb 15 20:36:20 2007 -0800 Merge crtc/output-based mode selection code. This code comes from the intel driver, so there's no history in this tree. As the crtc/output-based mode selection code uses ddc, the ddc and i2c modules have been merged into the server. Attempts to load them are safely ignored now. commit 37fe4c49dc3a5faf2d3d56112b6bd78453045f6a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Feb 16 09:57:57 2007 +1030 mi: Move WarpPointer event generation to miPointerMove to avoid duplicate events, cache event array allocation. commit c2f3f705f1db8ca78292912544a7e416116175f3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 15 14:38:24 2007 -0500 Bug #6988: Change behavior of Security extension per user feature request. commit 811675733e97416c990e6dc9c19271b43d96248d Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Feb 15 19:09:00 2007 +0200 os: fix client privates leak Minor leak here. Oops. commit 8f6961d385bda92703f18090cff551409d2710c9 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Feb 15 19:08:46 2007 +0200 configure.ac: add xdarwin stubs Add stub AM_CONDITIONALs to at least fix the build. commit a3b62623b8aac56b219633bdb2c2f6de19b0580b Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Feb 15 17:07:42 2007 +0200 change versioning for new server version scheme See: http://xorg.freedesktop.org/wiki/XDC2007Notes#head-2719037a1905516c45cf74f0e155c8703221e446 commit f452507ca9209598401d15da0039aaa4e1fed1a3 Merge: 0463283 8116757 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 15 09:47:20 2007 -0500 Merge branch 'master' into my-XACE-SELINUX commit 04632835b7402456fdcf6c8fa01970cd2804e27c Merge: 88f89b9 9ecf79c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Feb 15 09:27:05 2007 -0500 Merge branch 'master' into my-XACE-SELINUX commit 0f6dd4aea6176507dbe1c90c950d332fecbcaacb Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Feb 15 16:14:57 2007 +0200 kdrive/ephyr: free screen struct Free screen->driver on screenFini, instead of just leaking it. commit 9ecf79ca0111dd899ca88dd54156f71013220fcc Author: Ben Byer <bbyer@apple.com> Date: Thu Feb 15 05:22:21 2007 -0800 Beginnings of an update Darwin driver commit 136bb4874aadf4a731d7eb8671e8bb641f9980a7 Author: Ben Byer <bbyer@apple.com> Date: Thu Feb 15 05:14:38 2007 -0800 iokit support for XDarwin commit 3ead1afe78d2913f08c8144cb2d3813c6b159488 Author: Ben Byer <bbyer@apple.com> Date: Thu Feb 15 05:09:29 2007 -0800 Beginning of patches to add XDarwin support to the modular tree; special thanks to Torrey Lyons and Peter O'Gorman for making this possible. This is the automake framework for the XDarwin.app interface files. commit f6c3b9fa97ccf85e96f15435d564a1c261e40532 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Feb 15 13:51:20 2007 +1030 xfree86: mouse and keyboard hotplugging support. New mouse devices will get new cursors, keyboard devices use VCP's focus until paired. commit d570ff7c81858a3174686b46a088f67563b4a2d5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Feb 14 17:09:33 2007 +1030 fix: WarpCursor needs to send MotionNotify. commit c4fe1bcce1c1e4822e688959b331b47a051d6e0a Merge: e540d57 d570ff7 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Feb 14 15:39:52 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework commit e540d572c5acba877b3ce01e7b31e399dac2d44a Author: Ian Romanick <idr@us.ibm.com> Date: Wed Feb 14 15:38:10 2007 -0800 Merge fix missed on previous commit. commit 81aa7f059d3cfd8d28420b7932b8ff7e06d67979 Author: Eric Anholt <eric@anholt.net> Date: Wed Feb 14 12:48:15 2007 -0800 Add missing dirty marking in a couple of fallback cases in the exaGlyphs path. commit a5f19c5150a7b3dc2ff3ad759ee1a6ab0ad8925c Author: Eric Anholt <eric@anholt.net> Date: Wed Feb 14 10:39:46 2007 -0800 Mark sync when UploadToScreen succeeds in exaGlyphs(). commit a492d494f51caf15a5cb979dc335387486c105d1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Feb 13 18:32:59 2007 -0800 Update Xvfb man page: remove monolith build instructions, use /var/tmp instead of /usr/tmp commit 25104ed2e6050f86691104b34eeaf3147eb83c4a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Feb 14 11:26:53 2007 +1030 dix: fix typo in condition. commit 33ef546b942977bb2573156eaba5269350d16f99 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Feb 14 11:18:43 2007 +1030 dix: Clean up GetPointerEvents. If pDev == inputInfo.pointer, assume that we do not want Xi events. mi: Remove POINTER_CORE_ONLY flag. commit a23b0b069cac8a48e2b306b2095515d75f647705 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Feb 12 17:50:00 2007 -0500 Typo fix. commit d21c95f80bdba2f29eedd57fb0b00e580391c08e Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Feb 12 17:22:39 2007 -0500 Hook up --with-builderstring for vendor build identification. commit 46784d24c11767455a4986449a8037295912dcee Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Feb 12 17:18:29 2007 -0500 Remove spurious LIBADD from xf4bpp commit 16eb7254f861465f988ae3861ac3449c2c966062 Merge: 3814862 c4b7e9d Author: Ian Romanick <idr@us.ibm.com> Date: Fri Feb 9 12:38:49 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework commit c4b7e9d1c16797c3e4b1200b40aceab5696a7fb8 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Feb 6 14:57:22 2007 -0800 Add an RDTSC implementation to the x86 emulator. This instruction is being used in some debug VBIOSes. This implementation doesn't even try to be accurate. Instead, it just increments the counter by a fixed amount every time an rdtsc instruction in encountered, to avoid divides by zero. commit 262b9b104a04e55969593ef96a16004e53ecd00a Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Feb 6 17:30:22 2007 -0500 Use the new 8888x0565mmx function in fbpict.c commit 876b806ec09d5ff0c6cd19df91006c4eefedfaa6 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Feb 6 17:16:23 2007 -0500 Reapply patch to fix AMD CPU detection commit 13568d2aa43da4216bbcb46e1125ff28c323ac54 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Feb 6 17:12:01 2007 -0500 Revert "Fix for AMD cpu detection. Bug 9614, Dan Williams." This reverts commit b2cd3b133748cc5aa541905a703a6fdb1cbbb1e6 since unrelated changes in fbpict.c broke the build. commit 5a3334410367a2186b2c667fa1eb6cf0baf93e95 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Feb 6 17:11:01 2007 -0500 Add new fbCompositeSrc_8888x0565mmx() function, based on patch by Dan Williams. Bug 9682. commit b2cd3b133748cc5aa541905a703a6fdb1cbbb1e6 Author: Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> Date: Tue Feb 6 16:43:37 2007 -0500 Fix for AMD cpu detection. Bug 9614, Dan Williams. Credit for the fixes in this patch goes to: Marco Gritti <mpg at redhat dot com> Jordan Crouse <jordan dot crouse at amd dot com> commit 7cd73b00a29469d37a7f526cc9b35cc927a13ae2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Feb 5 14:48:48 2007 +1030 dix: If POINTER_CORE_ONLY is set, GetPointerEvents() only creates a core event mi: fix: Create motion event in miPointerMoved commit 760a38c4c7ab66ae653d3acb92f5cda4bd44edd6 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Feb 5 03:39:36 2007 +0200 XkbCopyKeymap: fix copy-and-waste accident When we reallocated modmap, we accidentally clobbered syms with the result, leaving syms definitely too small, and modmap also potentially too small (as well as not actually allocated anymore). commit 17d85387d1e6851d35474b65929e268ca64ef65b Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jan 18 15:23:57 2007 +1100 dmx, vfb, xnest: fix fbcmap compilation Don't always define XFree86Server, but only for damn fbcmap.c. Split fbcmap.c into its own library to achieve this. commit a309c936bb79e2fea04a96ce33c7da99ed902484 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Feb 5 11:38:44 2007 +1030 xkb: Daniel's patch to stop evdev keyboard segfaults. mi: Remove quickfix from ba547d4f6a2707f51f0d826389d2d418fb62367a commit 236f04b638e7d4d1656c6bedd8a6e8d7cec285ec Author: Dave Airlie <airlied@linux.ie> Date: Mon Feb 5 09:09:12 2007 +1100 remove array_cache from everywhere commit eb228e8d1eaa78911541b2fec5d04a74c1299718 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Sun Feb 4 22:06:59 2007 +0000 clean up more of the vbo fallout commit fb1bc1c65b88527b42a0e4abed23e5ddaae711b7 Author: Dave Airlie <airlied@linux.ie> Date: Sun Feb 4 18:39:58 2007 +1100 add vbo to .gitignore commit d8e148ec841d340327e6813127b0e0ffc4db712d Author: Dave Airlie <airlied@linux.ie> Date: Sun Feb 4 18:39:04 2007 +1100 update xserver for vbo code in mesa commit 5dcad9e9d7d9993d65f989219bee94a060bbf476 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Feb 2 14:44:55 2007 -0800 Fix bus error on startup in 64-bit Xephyr hostx_get_visual_masks takes unsigned long * arguments, but was being passed pointers to CARD32's. commit 170a55022ebc7b148bff93886eda152a0d5ce79a Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Feb 2 20:56:12 2007 +0000 remove file commit e6a505be84f5f72349d6860dc5a5058367516019 Author: Dan Nicholson <dan@conor.dwcab.com> Date: Fri Feb 2 20:53:01 2007 +0000 The array_cache sources don't exist anymore in the Mesa tree, so we shouldn't try to build them. commit af20485ec370801f2aabfaeae17bbd030a849bd1 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Feb 2 19:14:46 2007 +0000 Remove array_cache for recent Mesa changes commit cf5b29d75dad7c74543f49f010c817623a3df747 Author: George Sapountzis <gsap7@yahoo.gr> Date: Fri Feb 2 12:57:38 2007 +0200 dmx: drop leftover __GLXdrawablePrivateRec struct. commit 4f2f3233c808fd86bf9f6c09937feda9e0b367fd Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 1 15:10:29 2007 -0800 Fix the size expectations of xRRSetCrtcGamma. It was using REQUEST_SIZE_MATCH (client request length must equal request size) rather than REQUEST_AT_LEAST_SIZE (client request length must be at least big enough for request size), and this request has data following the request structure. commit 8274ea6aa97b06a56b7468c3908894c0ff72b687 Author: Eric Anholt <eric@anholt.net> Date: Thu Feb 1 12:15:54 2007 -0800 Set the Damage version supported in the server, instead of using damageproto. This was caught by distributions upgrading damageproto to 1.1, before the server they had supported it. The server then advertised the new version without supporting the protocol. commit 8bce182568f14edfb03911d8c5d791fd83bb6222 Author: Eric Anholt <eric@anholt.net> Date: Mon Jan 29 17:30:59 2007 -0800 Restore a few important lines killed in the previous commit. Typical results were failure to sync, and a black screen. commit 3814862a869ee83d307eb01225d5949039f435d8 Merge: a216de9 31f2d4a Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 29 15:14:31 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/os-support/bus/linuxPci.c commit 31f2d4a57e04f5ea635fbb50c508405c4fc37b65 Author: Eric Anholt <eric@anholt.net> Date: Mon Jan 29 09:39:33 2007 -0800 Bug #9680: Remove bogus blank length limiting in xf86SetModeCrtc(). Our modes typically come from EDID or default modes, and when the monitor asks for a specific mode, deciding to tweak it usually results in incorrect display. And if the user is specifying a mode by hand, tweaking it then is still pretty rude. Reviewed by: ajax commit 4aaaa70d1b52346213fad46777c006a93c4ece5d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jan 29 18:23:24 2007 +1030 Xi: Adding ChangePointerKeyboardPairing request Adding PointerKeyboardPairingChanged event Correct error values for XWarpDevicePointer dix: Adding device argument to SendMappingNotify Adding spriteOwner flag to devices commit f3418b52dcf2ab4982504856ab9fae3e726ee6d2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jan 29 16:10:03 2007 +1030 mi: Fix cursor rendering issues. commit 15a81b6325d359990017b8e9f17ce18a7eff1354 Merge: 3759254 cc3d66d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jan 28 17:18:57 2007 +1030 Merge branch 'master' commit cc3d66d4a53fee8f1d940bb8c7f032c94b9c25f6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 15 17:50:02 2006 +1030 o fix minor error in comment for GetPointerEvents() commit 3759254c0967ae83bdcbf097d9e8a58733c8e6f9 Merge: ba547d4 ca5ebe3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Sun Jan 28 17:05:55 2007 +1030 Merge branch 'master' commit 1627af54497bee659ea30f2850b39cbbf576e22d Author: Jonathan Lim <jlim@sgi.com> Date: Fri Jan 26 13:00:45 2007 +0100 Call linuxPciOpenFile() for r/w access if applicable. Currently, the call to linuxPciOpenFile() is always made for read only access which causes the subsequent mmap call to fail when the memory is mapped read/write. Xorg #9692 commit a216de9b7ff55e2b73c487d037f248f00bd2e63b Merge: 24506ea cf7ca9d Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 25 10:17:32 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework commit cf7ca9d09cba14d107152a5179de38e5ef7bd784 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 24 20:20:48 2007 -0800 Plug memory leak in doLoadModule() commit 5abd50e37ceda134897891ed32e05215db67e0b4 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 24 18:54:38 2007 -0800 Correct help lines for configure's --with-vendor-name flags commit b32a40817fc0e2ac2edf2fa22a8813087fce2e7b Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 24 16:29:49 2007 -0800 Correct variable descriptions in comment for SecurityCheckResourceIDAccess commit 24506ea65be4cb29c5e1486aa0a529a40ce5c230 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jan 24 15:33:49 2007 -0800 Move xf86ReadLegacyBIOS to the one place that uses it. xf86ReadLegacyBIOS is only used by one function in int10/generic.c. Move a generic implementation of that function there, rename it to read_legcay_BIOS, and delete all remnants of it from all other places. commit fdb3a0798f0d17e72ec7293d59a7a81b5ffdf95b Merge: 39b51e1 a53586e Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jan 24 14:49:39 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework commit a53586eebc166e35c1f48942205832810061daee Author: Eric Anholt <eric@anholt.net> Date: Wed Jan 24 13:36:25 2007 -0800 Warning fix for RRCrtcSetRotations(). commit 7a12952fd437b105ea0d013d680f9c3a775a183c Author: Eric Anholt <eric@anholt.net> Date: Wed Jan 24 13:34:29 2007 -0800 Bug #7639: Only swap out pixmaps (rather than everything) on VT switch in EXA. This is a new behavior for version 2.1 of EXA, and only takes effect if the driver has requested that. Otherwise, the previous behavior remains the same. commit b6b855932109b4bc3454f07bef8cb079d79ca369 Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 25 00:29:20 2007 +0800 Make Xinearama screen information reflect CRTC rotation. commit 39b51e1bfc4924fc3bda4342ef9c6c0125d9f4fa Merge: 637b19b 788cfce Author: Ian Romanick <idr@us.ibm.com> Date: Tue Jan 23 13:25:56 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework commit 788cfce911793a26aed16f38f30678ecee82c873 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Jan 23 10:15:22 2007 +0100 Bump video driver ABI version to 1.2. This is necessary because server-1.2-branch bumped to 1.1 for xf86CVTMode and we have xf86XVFillKeyHelperDrawable on top of that. commit 637b19b3ee7345c2d449ce94ceabe998d817c02e Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 22 09:58:33 2007 -0800 Eliminate pciControlBridge, pciGetBridgeBuses, and pciGetBridgeResources. commit a232e4ae938fa3a68f7614995676eda7929260db Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 22 09:16:45 2007 -0800 Convert xf86GetPciHostConfigFromTag to get_parent_bridge. Convert xf86GetPciHostConfigFromTag to a new function called get_parent_bridge. This name better represents what xf86GetPciHostConfigFromTag is used for: walking up the lists of PCI bridges from a device. commit 844560a02fa6c4ce18ea2af3ec27beaa60b7af11 Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 22 09:13:59 2007 -0800 Elminiate ARCH_PCI_OS_INIT. Never, ever use the ix86Pci stuff on Linux. This renders the whole ARCH_PCI_OS_INIT mechanism useless. Remove it. commit 7dfb3cea913b02a6b36c308d1330bd40abe6b41f Merge: c279d5f 2dc8662 Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 22 08:44:36 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework commit 2dc866252c84ed0e7b3afa25e8a5312f448d405b Author: Eric Anholt <eric@anholt.net> Date: Mon Jan 22 08:41:50 2007 +0800 Really fix optimized render cases being hit when they shouldn't. I don't know how this define slipped in there. Fixes 6fdfd9dad91d7b7aa292f8c4d268dd27c34de8d3. commit 88f89b9ac1b92a0916c46488350ff68c3ffdd490 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 19 19:15:49 2007 -0500 Policy updates: use x prefix in property and ext types. commit 2fb8b7f8199c35ae0870cb54b40ee28a4e01d479 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 19 19:14:51 2007 -0500 Split ObjectSIDByLabel into two functions since property labeling now involves an additional compute_create lookup. commit 0d6d373af95d0004d33b987d14ad7e04dd5d2003 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Jan 19 14:52:23 2007 -0800 Update Xserver man page to match commit ed33c7c98ad0c542e9e2dd6caa3f84879c21dd61 Remove unused -xkbdb and -noloadxkb options. Rename -ar1 and -ar2 to -ardelay and -arinterval, respectively. commit c279d5fdc53612a90f33fafe9e9c59ced008dd51 Merge: 88f248e 14d6a9b Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 19 12:59:54 2007 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework commit 700fccf863593cbea1691789f1f1cafc08a32fee Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 19 14:56:38 2007 -0500 Remove the root window context line from the configuration file. This context will be derived through a type_transition rule instead. commit 3a9791b456f35adb252a9059b19265c6c447f1ba Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Jan 19 14:53:09 2007 -0500 Policy updates. commit 14d6a9b327381a6bb2dac59c62728e5fd0f0bcfb Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Jan 19 18:30:21 2007 +0100 fbdevhw: Only deal with RGB weight if default visual is True- or DirectColor. commit 27a01e100bff21ac0b70c6d72071d7226fc91264 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Jan 19 18:28:05 2007 +0100 fbdevhw: Consider mode set equal to mode requested if virtual width is larger. commit 65f4690ecb4576f60396fcccff8e5bd5d4b6645f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Fri Jan 19 17:54:03 2007 +0100 __glXDRIscreenProbe: Use drmOpen/CloseOnce. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=9275 . Based on patch from Alan Swanson. commit 8b3a591cd39f2d51209dc71b641cac79663e1b16 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jan 18 16:03:30 2007 -0800 Update pci.ids to 2007-01-18 snapshot (includes a whole bunch of ATI device id updates) commit 0f0c321adf2850b3d7aafe281362bfe424cb0ca1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Jan 18 15:31:53 2007 -0800 Make xf1bpp build correctly with compilers that don't support -include commit a811e92104028ae60ba69f73e32ee1e0533b088c Author: Eric Anholt <eric@anholt.net> Date: Thu Jan 18 14:28:01 2007 -0800 Account for CRTC rotation in the cursor containment code. commit df147c10ce597c56c16cbca552e8a3e3ecb3cdaa Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 17 16:47:07 2007 -0800 Xserver man page: remove bc, add -wr commit 2dfd1aab244a2c8da3b62b522b9a8434e474af17 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 17 14:39:28 2007 -0800 Always include compiler.h in cfbmskbits.h instead of checking #ifdef XFREE86 commit 42a48786acf54f83167de4f561526986d4e27033 Author: Eric Anholt <eric@anholt.net> Date: Wed Jan 17 14:34:42 2007 -0800 Add a setter for randr_crtc->rotations. commit 88f248e67143175532cbafd6faf8fc6df97c7894 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jan 17 14:04:43 2007 -0800 Replace PciBusId with 'struct pci_device *' There's no need to store the slot information for a PCI device as its ID. Instead, skip the middle man and just store a pointer to the pci_device structure. commit 0361611080267727f570e17f2212aaa890223f6e Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jan 17 13:06:04 2007 -0800 Convert xf86IsolateDevice to a 'struct pci_slot_match'. This change was accidentally not committed on the previous commit. commit c1808f148405a28256e0480d6f8714691b0e964e Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jan 17 13:02:27 2007 -0800 Convert xf86IsolateDevice to a 'struct pci_slot_match'. commit d2f8c42c48ecc398d224d9e3b280a66042e68664 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jan 17 12:59:17 2007 -0800 Convert xf86FindPrimaryDevice to use a static buffer and snprintf. Rather than allocate a 9 byte buffer on each invocation, use a static 16 byte buffer. Use snprintf for safety. This commit should probably be cherry-picked to the trunk. commit 28976bebec8b6475d0703f8356edd116e25d40b2 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jan 17 12:15:09 2007 -0800 Eliminate unused fields in pciAccRec. commit f36a447d20c0a89b78c5899eeb303cab568ebac6 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Jan 16 14:49:19 2007 -0800 Eliminate use of Tag field. The Tag field was removed from the int10 structures in commit ca9c41e09ddb72d150d86f5d372eb07eeca7c1a2. This file was over looked. commit cde17015dff1ced2aabb8b76c08f9110237821a5 Author: Eric Anholt <eric@anholt.net> Date: Tue Jan 16 13:01:03 2007 -0800 When changing a non-pending property, call the screen rrOutputSetProperty hook. commit e3add7c8ecbb2a0a662860f208f6ae7d1857c717 Author: Eric Anholt <eric@anholt.net> Date: Tue Jan 16 12:59:34 2007 -0800 Don't forget to add the property we configure to the properties list. commit 780b55ec6f97864b50f00170b201e93eba188f1b Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 15 15:30:16 2007 -0800 Fix accidental commit (bug) in linuxOpenLegacy. commit 31bd8d150749c548eb70404395b4a52d46412f43 Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 15 15:19:30 2007 -0800 Fix domain insanity. Eliminate xf86GetPciDomain. The domain from libpciaccess is the domain. Period. This means that 0 is a valid domain. Make sure that INCLUDE_XF86_NO_DOMAIN is *not* set. Always run in "domain mode," even if the only domain possible is 0. commit 079a6a55a516778871a8b2f8e9c8dd9162105a76 Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 15 11:39:24 2007 -0800 Convert to new pci_device_cfg_write_u* interface. commit d8bd0c41de11d12976a5ea9f185b7ac6c7060b71 Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 15 11:38:22 2007 -0800 Convert to new pci_device_cfg_write_u* interface. commit a87af8218f97da76433a5192d5e51aca0d5c3ed0 Author: Ian Romanick <idr@us.ibm.com> Date: Mon Jan 15 11:21:37 2007 -0800 Remove unnecessary files from the sources list. commit 1c326bf75fc0d2c39507834d159d031291eddac4 Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 12:07:19 2007 -0800 Eliminate unused INCLUDE_XF86_MAP_PCI_MEM define. commit 3936caa00535d0b7543be5a4b315562111a6b3ab Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 10:59:35 2007 -0800 Refactor pciTagConvertRange2Host and pciConvertRange2Host. commit 1a493509e30412a0f6c6f8f8e47a446678dbbc1a Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 10:58:59 2007 -0800 Fix typos in conditionally compiled code. commit 8279444a54f38c5e2e5d4c2d936a10d74990e0be Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 10:41:03 2007 -0800 Eliminate unused pciAddrHostToBus infrastructure. commit e32fa10a04a15ce1b15c6faa7a64e68ee3906d59 Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 10:33:17 2007 -0800 Remove prototype for pciGetBaseSize. commit 7411f5c389db73a6731d853d603029b8cf0a66ba Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 10:32:04 2007 -0800 Eliminate pciHostAddrToBusAddr from interface. pciHostAddrToBusAddr is no longer used anywhere in the tree. Remove it with extreme prejudice. commit 60c5e023e8ddaae8e011f80736e7cc3e8c12583d Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 10:24:03 2007 -0800 Eliminate some dead code. commit dd12a94885bad9c9d064dcf7e0d9a7a7114ae3e6 Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 10:21:25 2007 -0800 Eliminate xf86GetPciEntity from public interface. xf86GetPciEntity was folded into the only place (xf86CheckPciSlot) in the tree that still called it. commit c3016a29964761478305cf2f5241c563ff3eab0a Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 12 09:56:00 2007 -0800 Missed file from previous commit. Convert xf86ReadLegacyVideoBIOS to take a 'struct pci_device *' parameter instead of a PCITAG. commit ca9c41e09ddb72d150d86f5d372eb07eeca7c1a2 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 11 21:09:20 2007 -0800 Convert int10 and vgaHW to use 'struct pci_device' instead of PCITAG. Convert all uses of PCITAG in int10 and vgaHW to 'struct pci_device'. This allows the conversion of xf86ReadLegacyVideoBIOS and xf86MapDomainMemory to 'struct pci_device' from PCITAG. commit ba547d4f6a2707f51f0d826389d2d418fb62367a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Jan 12 14:42:02 2007 +1030 mi: Quick fix to stop segfault on non-core keyboards. commit 5e2f8dee6331645fcbd2734c43698eb4f9c5b116 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Jan 11 14:05:39 2007 +1030 mi: remove core pointer special handling. No event has core pointer as device now. dix: zero pSprite memory, stop segfaults on server restart. commit 7fccec91c46baac4f8d2965180dc535b4eb7d65c Author: Eric Anholt <eric@anholt.net> Date: Wed Jan 10 13:10:43 2007 -0800 Bug #9555: Always define _GNU_SOURCE in glibc environments. This keeps us from having to define _POSIX_C_SOURCE, _BSD_SOURCE, and _XOPEN_SORUCE to get the C environment we want in different places. It also fixes the build on linux due to RTLD_DEFAULT having not been defined. commit 78f9592c112d4245f6119b98c244bbb4cae3e5aa Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Jan 10 16:04:20 2007 +0000 lnx_ev56.c has to be built with -mcpu=ev56. Fix it. commit ea82333dc1799a7e013205adbc89874bc8d273cb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Jan 10 14:52:13 2007 +1030 Xi: add missing call for SProcXChangeDeviceCursor add DeviceEnterNotify and DeviceLeaveNotify fix: QueryDevicePointer crashed if called with keyboard device commit 6a2fb2928714ce77ee342cdc23a1178e5e766cf2 Author: Eric Anholt <eric@anholt.net> Date: Tue Jan 9 16:34:40 2007 -0800 Track rename of DamagePost -> DamageAdd. commit da09964a931cc64d05ab571bf545fdad35a6d395 Merge: e1f73d2 e3aa6ad Author: Ian Romanick <idr@us.ibm.com> Date: Tue Jan 9 15:27:34 2007 -0800 Merge branch 'origin' into pci-rework Conflicts: hw/xfree86/int10/generic.c commit e3aa6ad201eb20862c11c000e76206e317a96dc9 Author: Matthieu Herrb <matthieu@blues.laas.fr> Date: Tue Jan 9 14:14:19 2007 +0100 Multiple integer overflows in dbe and render extensions CVE IDs: CVE-2006-6101 CVE-2006-6102 CVE-2006-6103 commit 359d20532bdcef6a540a551578d000afbb609c2d Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Jan 9 09:53:45 2007 +0100 Require glproto >= 1.4.8 for GLX. It builds against 1.4.7 as well, but it hardcodes the GLX_EXT_tfp tokens that were finalized in 1.4.8, so GLX_EXT_tfp breaks if the client side was built against an older glproto. This will hopefully alert people to rebuild other components (in particular Mesa) against the new glproto as well. commit 88740c4855babedbea420b5e1b35ae105d1f1026 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jan 8 17:36:07 2007 -0800 Use PKG_CHECK_EXISTS(libdrm) to determine if DRI should be enabled on Solaris commit 282a4dcaabc5f0cd6f7d3819aa648333b93b265e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jan 8 19:22:41 2007 +0100 Attempt to fix drawable type checks in dixLookupDrawable(). Not sure this is 100% correct either, but it fixes at least one reproducible crasher where it returned a pixmap to dixLookupWindow(). commit a7ab7932938820a795bb6fb8e0444e0824433b99 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jan 8 17:31:16 2007 +1030 xfree86: fix XI86_SHARED_POINTER flag setting commit 95e1a88050dde61e9b2407428042a43e47b46e18 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Jan 8 12:31:18 2007 +1030 Xi: Adding ChangeDeviceCursor request commit 0b73a7eb17fd848c6bdc6a65ba835aa2cbfc3cfd Author: Eric Anholt <eric@anholt.net> Date: Fri Jan 5 18:12:04 2007 -0800 Add support for the DamagePost (XDamage 1.1) request. This makes damageproto >= 1.1 a requirement to build. commit dfb2c10413e22afd8d486a982870f874326d5ef4 Author: Ian Romanick <idr@us.ibm.com> Date: Fri Jan 5 10:15:09 2007 -0800 Add missing #else from previous commits. commit f90c3e226b105bf77beb94723fc08bdff14834be Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 4 15:38:16 2007 -0800 Re-regenerate from Mesa scripts. DO NOT HAND EDIT THESE FILES! For cryin' out loud, there's even a comment to that effect in the file's header... commit b7ca5d14ce7ba410b0dab5c2289f6d7b75e763df Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 4 15:37:33 2007 -0800 Incorporate new byte-order related configure changes. commit 8dd5771a1b91c331860b667fb18e484452000aad Merge: 45aa26c 7d2ec92 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 4 15:01:38 2007 -0800 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver Conflicts: GL/glx/indirect_dispatch_swap.c GL/glx/swap_interval.c commit 45aa26ccb4f61c2919ce2475d0907c6e1b177da2 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 4 14:55:51 2007 -0800 Regenerate from Mesa scripts. Regenerate source files from Mesa scripts. This causes the generated files to use glxbyteorder.h. commit 6d603bb47ff9d238637adbf30c6e9697e6e7e6fa Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 4 14:49:26 2007 -0800 Add new header file containing byte-order wrappers. Move the byte-order related wrappers out of the individual source files into a dedicated header file. Modify the single hand-coded source file that uses the byte-order wrappers to use the new header file. commit 7d2ec92170ebbdfa10a05734cb7cfaac97d19d65 Author: Eric Anholt <eric@anholt.net> Date: Thu Jan 4 12:24:48 2007 -0800 Keep track of how many visuals we set up for GLcore, to avoid an invalid free. The proper fix would involve actually setting up the ARGB visual for GLcore, but I just want the server to not crash at exit. commit aab2ca204279b638c7e5bb6b8427c58be9704c57 Author: Eric Anholt <eric@anholt.net> Date: Thu Dec 21 09:16:19 2006 -0800 Try dlsym(RTLD_DEFAULT) first when finding symbols. The previous mechanism failed when finding drm symbols now that libdrm has moved to being linked by libdri instead of being linked into the server. commit 2fd4626fa6969b84d8e2f9db16d6e2d44c4bc499 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 3 15:44:55 2007 -0800 Make GLX byteswap macros more portable - Use autoconf tests instead of platform-specific #ifdef's to decide which macros to use. - Provide fallbacks for platforms like Solaris that don't provide any of the existing known forms. commit 66fa87292ef26bd0f464481287f3af992cd5741c Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Jan 3 10:27:07 2007 -0800 Fix BSF and BSR instructions in the x86 emulator. Patch courtesy of Michael Yaroslavtsev. commit 3b5b7ef5c2ab1d196806f6359e0972fd78d204dd Author: Fredrik Höglund <fredrik@kde.org> Date: Wed Jan 3 21:05:35 2007 +0100 Move the code for resetting the DPMS mode in response to input events, from WaitForSomething to mieqProcessInputEvents. mieqProcessInputEvents already handles resetting the screen saver. commit 953a9ef949b4c57d28daeec57031fe1ce368c27c Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Dec 21 23:50:39 2006 -0800 Track physical screen size and send out updates when that changes. Events and internal data structures need to be updated whenever the physical or pixel size of the screen changes. The code was ignoring the physical size, so changing only that would not be registered anywhere. (cherry picked from f42e3cea236fa0091ed398a818fc8e17b0e1b3df commit) commit e79602fca2f2cced66136729cdda4d356b0bdda0 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Dec 30 21:52:22 2006 -0800 Use RRScreenSetSizeRange in 1.0 compat. Check RRGetInfo for error. The RRScreenSizeSetRange function is used externally for 1.2 API drivers, but can also be used in the 1.0 compatibility code. This also ensures that the right changed bits are set so that clients are correctly notified when the range changes. RRGetInfo can return an error, use that to return BadAlloc to clients instead of blindly going on with various requests. (cherry picked from f05dd384d38c76dd9662933a03625dfef5b1c81f commit) commit dc5eb4523298f966bd5fd9ae6672160034b5e82c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Dec 31 17:59:44 2006 +0100 fbdevhw: Override RGB offsets and masks after setting initial mode. This is a hack, but it should be a NOP for all the setups that worked before and actually seems to fix some others... Based on a patch by Peter Teichmann from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=338241 . commit d077c0da470ab7291e8d838eaace57b066477d6f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Dec 31 17:23:31 2006 +0100 fbdevhw: Use displayWidth for fbdev virtual width when appropriate. The fbdev API doesn't allow setting the pitch explicitly, so we have to set the virtual width to the pitch we're using for drawing. This fixes corruption after changing the virtual width with RandR. commit c385bcf0bde38dd869f7065f859dd4b4126f5690 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Dec 30 16:44:31 2006 +0100 fbdevhw: Fix some issues with the previous commit. Fix a TRACE_ENTER typo and only update the internal fbdev mode state cache after actually setting a mode. commit f6815cb68b0f6698497348fc6e4214dacef33b95 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Dec 30 10:18:28 2006 +0100 fbdevhw: Consolidate modeset ioctl calling, report failure if it modifies mode. The fbdev API allows the driver to 'accept' modes it doesn't really support by modifying it to the nearest supported mode. Without this check, e.g. vesafb would appear to accept all modes, even though it actually can't set any modes other than the bootup mode at all. commit 083b790515faaf134a78abc4b0a7ef0d6ea5db75 Author: Eric Anholt <eric@anholt.net> Date: Thu Dec 28 13:21:25 2006 -0800 Switch the default migration heuristic for EXA to "always". This has been what has been used the most successfully post-damagetrack. The current thinking is that: 1) We should be able to accelerate basically everything. So we don't need to try to migrate trees of pixmaps permanently out of framebuffer to speed CPU drawing up. 2) Migration is cheaper in the thrashing case, so we don't want to go to a lot of effort to try (and fail badly) to find a working set. commit cfbc7379f0232bb336461f6d2a8496d3d0763e7e Author: Eric Anholt <eric@anholt.net> Date: Thu Dec 28 13:15:11 2006 -0800 Export exaMove{In,Out}Pixmap(). commit 683ca3f7afaf15fd3ca7918f6175b5a9e4a6f05b Merge: 05f9150 9563b2e Author: Eric Anholt <eric@anholt.net> Date: Wed Dec 27 16:11:31 2006 -0800 Merge branch 'exa-damagetrack' commit 05f915050cad72d4fb39cbb886be57beeac18749 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 27 16:38:06 2006 +0000 dix/events: take screen number, not pointer, in PostSyntheticMotion Since we were using PostSyntheticMotion incorrectly anyway, update the declared API to match. commit c1674660a7115ebf993dcde78f4e45f756e4c951 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Dec 24 06:28:44 2006 +0200 os: test for userland, not kernel It doesn't matter which kernel we're running on, the relevant part when dealing with includes is what our userland is. commit 83080809f9a1c1d24b0318e54632f25f5940da25 Author: Marc Aurele La France <tsi@ualberta.ca> Date: Sun Dec 24 06:28:21 2006 +0200 xfree86: deal with pitch that isn't a multiple of the granularity When the pitch isn't a multiple of the granularity, allocate more space to compensate. commit 329f6417275bb1201ba66c29b202028eeab3a355 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Dec 9 22:51:59 2006 +0200 XkbCopyKeymap: make sure sym_interpret is always valid Make sure we're not copying sym_interpret across from an empty source. commit 43a4376bd72ef1b6486cddb60ad57b2d6169292a Merge: 4b1c9ac d9e079d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 22 13:53:55 2006 -0500 Merge branch 'master' into my-XACE-SELINUX commit d9e079d2a385203fdd18d958cfc19d759cab4ba8 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 22 13:07:09 2006 -0500 Zero out client devPrivates on allocation. commit 4b1c9ac3d13767e395b47e76b37f9f3a569e7be1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 22 13:04:50 2006 -0500 Policy updates. commit cd71e861830081807e5b93ae89c73c17986c6330 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Dec 20 13:45:24 2006 -0500 Naming change: Security*Access -> Dix*Access. Clarify some error message strings. commit 9fd2f167ec02ee170b87f02ddca89eba0b2e2389 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 20 16:30:36 2006 +1030 xfree86: fix xf86ProcessCommonOptions() core and shared pointer assignment TAG: mpx-0.3.0 commit 056c919d849a78c8d507bfcecfa74c0b0165751a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 20 14:49:17 2006 +1030 removing MPX extension files commit b55e1239ac3b2962a33d8af1f911cc0f01f40f23 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 20 14:43:38 2006 +1030 xfree86: fix xf86ActivateDevice(): only set to MP device if not a keyboard commit 202b46eb6bf0d5f94973c2bf1e4ebe9d154eadbf Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Dec 20 13:05:53 2006 +1030 xfree86: Changing "IsMPDevice" to "SharedPointer" option. Devices will default to MP devices. Xi: Adding QueryDevicePointer request/reply Adding WarpDevicePointer request/reply commit e437f357b6850a6c87ca6696870b3abd40e5b8ed Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Dec 19 16:38:34 2006 -0800 xorg.conf man page should say "XFree86-DGA", not "Xorg-DGA" commit a81dbaae0597492f0245080c6f5af7158e05e2d0 Merge: fb6d676 d442998 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Dec 19 16:11:19 2006 -0500 Merge branch 'master' into my-XACE-SELINUX commit d442998e39611be6805ea261f2286a2fd00f49b1 Author: Eric Anholt <eric@anholt.net> Date: Fri Dec 8 13:35:36 2006 -0800 Only do the _POSIX_C_SOURCE hackery on linux where it's required. On other OSes, the nasty hack was resulting in prototypes being hidden, so just don't do it. commit 228b9f77696190e47d4c96d6e0809bf645751557 Author: Eric Anholt <eric@anholt.net> Date: Fri Dec 8 13:32:22 2006 -0800 Include sys/select.h to get FD_ISSET. commit 9563b2eea2f61246b6a9e14e00c701f693efa4e1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Dec 19 18:57:22 2006 +0100 EXA: Lots of damage tracking fixes. Mostly due to exaDrawableDirty() now calculating the backing pixmap coordinates internally, for cases where they aren't trivially known. There's a new exaPixmapDirty() function for the other cases. commit 467c00cf450826e0bf06fe94470ec193af625d68 Author: George Sapountzis <gsap7@yahoo.gr> Date: Tue Dec 19 18:45:25 2006 +0100 exaGlyphs: mark dirty for software path also. This affects drivers with no UploadToScreen or UploadToScreen failures. commit 4334860e69e7d5b156082bd05c7a86708e5bad4c Merge: 7e47176 fdcc22c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Dec 19 16:29:26 2006 +0100 Merge branch 'master' into exa-damagetrack Conflicts: exa/exa_accel.c exa/exa_migration.c commit fdcc22ca1704d3519156c66804528c21b04fea65 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Dec 19 16:11:17 2006 +0100 exaCopyNtoN: Fix usage of 'dx' and 'dy' instead of 'reverse' and 'upsidedown'. commit 67c2a86e59e915d9a5681e9d233478cfea3e51ed Author: Michel Dänzer <michel@tungstengraphics.com> Date: Tue Dec 19 15:44:18 2006 +0100 EXA: Compare backing pixmaps instead of drawables against driver limits. The driver operations are always contained within the backing pixmaps, it doesn't matter if the drawables are bigger. commit 6b1e354dbb6e8ed9f2c654bbe7f8bbf241843d1c Author: Eric Anholt <eric@anholt.net> Date: Tue Dec 19 15:24:19 2006 +0100 EXA: Disable SHM pixmaps. See https://bugs.freedesktop.org/show_bug.cgi?id=6772 . commit ca5ebe3971d8ebcfed00c5ebcd026cdd0ce0c6ba Merge: 4d07b50 1b029fd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 19 10:51:01 2006 +1030 Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver commit 2d0a63126b3d3a17005b7e122617ee0c5f44a55b Merge: d8b5394 1b029fd Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 19 10:31:40 2006 +1030 Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver commit 1b029fd896b76096905c516925ce0214fe14632c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 18 14:51:04 2006 -0800 Xorg & Xserver man page updates for 1.2 release - Added -extension & +extension to Xserver man page - Changed Xorg synopsis from X11R6 to X11R7 - Clarified Xorg ancestry description - Moved Solaris to free/Open Source OS list - Removed references to MetroLink module loader & getconfig - Converted (1) to (__appmansuffix__) in a few more places - Replaced http://www.freedesktop.org/cvs/ with http://gitweb.freedesktop.org/ commit d8b5394eda9d92b7193004931caa6c24a337b2e6 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Dec 18 17:35:34 2006 +1030 Cleaning up ifdef MPX from remaining files, removing it from configure.ac. Removing building mpx extension from Makefile.am commit 03c554283e49e449fd1282cf32564d15d9fd2c77 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Dec 18 15:33:54 2006 +1030 mi: removing MPX ifdefs global sprite renaming in mipointer and misprite fixed: multiple remove cursor call in miSpriteInstallColormap fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement removing MPX ifdefs removing MPX event generation (using Xi solely now) bugfix GrabDevice: uninitialized field in grab struct caused segfault xfree86: removing MPX fdefs Xi: removing MPX protocol events commit a5fcf1e5e7452c9be82f63b6c2be2a25c4109523 Author: James Steven Supancic III <arrummzen@arrummzen.net> Date: Sat Dec 16 12:02:38 2006 -0500 Fix RENDER issues (bug #7555) and implement RENDER add/remove screen support (bug #8485). commit c92f7bef54fa737766d65fe32c200f405f39228c Author: Kevin E Martin <kem@freedesktop.org> Date: Sat Dec 16 12:01:49 2006 -0500 For Xvfb, Xnest and Xprt, compile fbcmap.c with -DXFree86Server commit 012807356883128fde58bb2d4f91dd356d6418fc Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 15 18:27:16 2006 -0500 Add loud warnings to deprecated lookup functions. Hopefully this will alert external driver maintainers. commit ab1d5b0c31a1cfce95ab6b1d06f209f2c44e19ac Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 15 17:26:58 2006 -0500 Convert callers of LookupClient() to dixLookupClient(). commit f11dafaafc68f5cff1a1538d9566907786d8ab72 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 15 16:51:58 2006 -0500 Convert callers of SecurityLookupDrawable() to dixLookupDrawable(). commit 10aabb729d1586db344f9c1abdf1cf45e7ddaa7a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 15 16:36:29 2006 -0500 Convert callers of LookupDrawable() to dixLookupDrawable(). commit 25d5e0a629f82d95bd71daf9a920a70e095b5188 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 15 15:50:46 2006 -0500 Convert callers of SecurityLookupWindow() to dixLookupWindow(). commit 04c721854fbf1bd6379c165a53fab2bdc09961c0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 15 14:11:40 2006 -0500 Convert callers of LookupWindow() to dixLookupWindow(). commit 670bbb87310503fcc17203cecfa6f4f2f5db51d2 Author: Keith Packard <keithp@neko.keithp.com> Date: Wed Dec 13 01:21:32 2006 -0800 RandR 1.2 rotation code must adjust width/height. Mode lines reflect the monitor mode, not the projected size into the frame buffer. Flip width/height around so that the dimensions are oriented correctly. (cherry picked from 612a8e61803da8db0e305cbb093696b8e4284572 commit) commit 6c6901434ab469dd03b79fc98cd4a2b64d339305 Author: Keith Packard <keithp@mandolin.keithp.com> Date: Wed Dec 13 00:58:54 2006 -0800 RandR 1.0 refresh rates unscrambled. SetScreenConfig uses RRCrtcSet right. RandR 1.0 refresh rates were scrambled when working with a 1.2 driver that returned sizes in a mixed order. SetScreenConfig was treating RRCrtcSet as returning an RandR status instead of a Bool. (cherry picked from 6dc711833d7387372012fdff1ce1df3aefa2d234 commit) commit 628c7daeb12713d28e85e6b49fa037a7748dff83 Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Dec 12 22:59:03 2006 -0800 RandR: config time updates when hardware config changes. The config time in the RandR protocol reflects when the hardware state has changed. It was getting changed anytime the driver changed the usage of the hardware as well. (cherry picked from 98d18a6578130adb411ca4bcc776fcb7e07f189f commit) commit d742025f435f3eb7458cf8284d59300bc9a850aa Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Dec 12 20:16:49 2006 -0800 RandR mode list needs both output and crtc modes. When an output no longer reports the current mode, it must still be included in the list advertised by the X server. Walk the crtcs to ensure it is included. (cherry picked from 78689d0d6630afcbcd3ce5394d12c2564a489f45 commit) commit 9e32bf98bc9ab17a137664d01f59a8f426f7ff3b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 19:31:58 2006 -0500 Remove now-unused macro definitions from dix.h. commit 00f0705b3bb444ac934fc902cd23130f1777eab2 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 19:15:21 2006 -0500 Remove instances of macros SECURITY_VERIFY_GEOMETRABLE and SECURITY_VERIFY_GC. commit 5e334f06a1ef89891f9df2a371e4662340bec26b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 18:27:09 2006 -0500 Remove instances of macros VERIFY_GEOMETRABLE and VERIFY_GC. commit 51b69ff499c05f59cb1e577c4e8abf6f7f283b3e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 17:53:43 2006 -0500 Remove instances of macro SECURITY_VERIFY_DRAWABLE. commit 0cf75e74322e2b6a6efc7acf892e04365fde503b Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 17:27:12 2006 -0500 Remove instances of macros LOOKUP_DRAWABLE and VERIFY_DRAWABLE. commit ab1886df73b73360fa3bd7ce8e01affc074cbc8d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 15:42:19 2006 -0500 Add new, combined dix lookup functions (tweak). commit 60cdc592fe042c03ceb5d4c3344acfbbf5d8ae28 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 14:46:03 2006 -0500 Add new, combined dix lookup functions. commit 6c46645cfc1afda8aeabfe0ed4d9342673b702f1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Dec 14 14:45:42 2006 -0500 Naming change: Security*Access -> Dix*Access commit a96788058e48f3e97c66da6dafd58828f0c2ce53 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Dec 14 10:50:18 2006 +1030 mi: removing MPX ifdefs global sprite renaming in mipointer and misprite fixed: multiple remove cursor call in miSpriteInstallColormap fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement removing MPX ifdefs removing MPX event generation (using Xi solely now) commit b88ad820fac81d0dfd557a384bf0406e8893e7af Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Dec 13 12:13:11 2006 +0000 Set Int10Current->Tag for the linux native int10 module Fixes bug #9296 (cherry picked from 731952c561a3972d09d1315f4fd31466e459ccb9 commit) commit fb6d676de5aa606d943715437a12a68d9a41f386 Author: Eamon Walsh <ewalsh@moss-huskies.epoch.ncsc.mil> Date: Tue Dec 12 16:17:51 2006 -0500 Add xserver object class to list of object classes. commit 7b90944258eba66b61328480759833ad7589bcca Author: Eamon Walsh <ewalsh@moss-huskies.epoch.ncsc.mil> Date: Tue Dec 12 15:59:38 2006 -0500 Change MLS levels in config file contexts to more sane defaults. commit 568c09481e5d62091d032837171a36f409f39379 Author: Eamon Walsh <ewalsh@moss-huskies.epoch.ncsc.mil> Date: Tue Dec 12 15:59:08 2006 -0500 Split AssignClientState() into two routines, new routine is server-specific. commit 62e7722ebd8d341a23eb56cb330eeb00e6a975a6 Merge: e124806 f3c6090 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Dec 12 13:54:33 2006 -0500 Merge branch 'XACE-SELINUX' into my-XACE-SELINUX commit e124806994675e16ca8e3937388f2cadeb529fc3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Dec 12 13:35:22 2006 -0500 Remove trailing whitespace (whitespace police). commit ca77c121075a9de1f47d42f6aaf91c20185231de Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Dec 12 13:26:52 2006 -0500 Naming change: Security*Operation -> Xace*Operation commit a60da1db7cced28c07960a713eb18deb45beb432 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Nov 29 22:19:57 2006 -0500 Add required root window context to config file. commit 5719afe6d3a246985709e6f045617c1e16a7da51 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 26 20:20:57 2006 -0400 Change symbol in libaudit library test. commit 354c80da66af141e8ba6d75fed75a0f482987956 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 5 16:07:26 2006 -0400 Improve error handling, messages during initialization. commit 3714d9149928754afcd6b2466a1371ca32e17985 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 4 16:23:35 2006 -0400 Experimental window property holding security context. commit 7f16c38ae2b47b195609d8fedefb7b28f612b2d4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:31:18 2006 -0400 Add SELinux extension configure-time support. commit a7f4bbea87ada1d699bfd9e3b6a98f06191650f6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:17:01 2006 -0400 Add SELinux extension to the module/extension loader. commit 28e80cd65b1207b123c02f895851bb6d207aa3c1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:15:19 2006 -0400 Add SELinux extension configure-time support. commit 83aad2be8a80890f349c2f9caf84786333f7cc8c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:11:04 2006 -0400 Add SELinux extension source files. commit 81281cb298a5825bc7a2e692375a86199293bbbe Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Dec 12 11:28:24 2006 +0000 Fix bad commit commit 792e0f71c6a435b2e28f8a4cdcc790f3b982e62c Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Dec 11 14:54:49 2006 +0000 Fix Xming fails to use xkb bug bug #5049 (Colin Harrison) commit 27d4b84f268ac21601f7f52a7e257f70753396b3 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Dec 11 14:50:08 2006 +0000 Fix Tooltip from minimized clients Bug #3678 (Colin Harrison) commit ae3c24da34cd8eeb77a6389861856fd51e0841f5 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Dec 11 18:09:59 2006 +1030 dix: Moving SpriteRec into DeviceIntRec removing global sprite structure beginning to remove MPX ifdefs xnest: Fix to make xnest compile again commit fb8364bca30fe9268e807b0a9a3ebf875ee1fce2 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sun Dec 10 11:24:05 2006 -0500 Accept EDID > 1.3 but < 2.0 if we find it, assume it's compatible. commit e1f73d220873fa091695e46b7fcd008663a95a6f Merge: 27d682f d56249a Author: Ian Romanick <idr@us.ibm.com> Date: Fri Dec 8 17:24:15 2006 -0800 Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/common/xf86Configure.c hw/xfree86/common/xf86Helper.c hw/xfree86/common/xf86pciBus.c hw/xfree86/int10/helper_exec.c hw/xfree86/os-support/bus/Pci.c hw/xfree86/os-support/bus/linuxPci.c hw/xfree86/os-support/linux/lnx_pci.c hw/xfree86/scanpci/Makefile.am hw/xfree86/utils/pcitweak/Makefile.am hw/xfree86/utils/scanpci/Makefile.am commit d56249a15ead51ad4d2117d5538ada24af05b693 Merge: f1f8df1 ec84f72 Author: Jeremy C. Reed <reed@glacier.reedmedia.net> Date: Fri Dec 8 15:52:37 2006 -0600 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit f1f8df1889ab656bb57596e2f85408f15f42cd5d Author: Jeremy C. Reed <reed@glacier.reedmedia.net> Date: Fri Dec 8 15:51:44 2006 -0600 For MANDEFS, also replace __mandir__ for $(mandir) which includes the prefix. Noticed wrong path to man pages on both Ubuntu and on NetBSD with pkgsrc. commit ec84f72d077eaf2e7768a1f5398f65a5e1714d08 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 8 21:31:47 2006 +0200 XkbCopyKeymap: always initialise map and preserve If we don't have map or preserve in the source map, make sure the destination is initialised to NULL, and freed if it's a valid type. commit e59aeac1ff13ea53f44dba1ac7800f37f4532ca1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 6 23:44:06 2006 +0200 xfree86: remove stray debug line commit 729fca33a417ae3dfb180caf0ea8946ef9eee1df Author: Michel Dänzer <michel@tungstengraphics.com> Date: Thu Dec 7 12:09:18 2006 +0100 Revert "xfree86 DDX: Delete DDX screens in ddxGiveUp()." This reverts commit a6381e69845f58d2b3282992b1f881015190f1bc. See https://bugs.freedesktop.org/show_bug.cgi?id=9224 . commit 4ea6dfb984063117eef5c2f931205b1c3eb3108b Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 6 23:24:39 2006 +0200 whitespace police commit 4cba1a1ebfbdd7ab489b1b1ffb6656cbe88eb61e Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 6 23:21:38 2006 +0200 config: bus reconnect support Add support for reconnecting to the bus when it restarts. commit 0c5dab5c8eaa174f28054b9d20244a709c015210 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 6 23:21:15 2006 +0200 config: move config.h to hotplug.h Also, move configInitialise to after OsInit, since the next commit will make it use a timer. commit 72e7f2ac6cf0db474d0defa7918f2a3ba76c0e46 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 6 23:18:52 2006 +0200 GetPointerEvents: always send valuator events for MotionNotify Always chase a DeviceMotionNotify event with a DeviceValuator, which is not required in the spec, but will silently break the lib if you don't include. commit c458a70d650bd62b8f4706f022d1f3f347636db1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Dec 6 20:30:44 2006 +0200 GetPointerEvents: fix typo Fix typo that resulted in inverted axes when using an absolute positioning device that didn't report y, and thus relied on the previous value. commit edabf45425f9ed79547f918cc0dfff4c268de386 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Dec 2 16:37:19 2006 +0200 configure.ac: add CONFIG_LIB to Xvfb commit 8724af248cd6c93182fecd060fed09a556361080 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Dec 2 16:20:34 2006 +0200 kdrive/mga: fix compiler warning Change a case that only made one test for an if, preventing the compiler warning about all other PICT_* types being unsupported. commit 2f0a800ffdc881cdb3adf84f1ed97bbb63cba34c Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 27 22:22:53 2006 +0200 config: move to block/wakeup handler commit 99378b58dbc63160382ad9c41f9cb0dd2a24e9d1 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 27 22:22:33 2006 +0200 kdrive/tslib: remove vendor-specific hacks Parts of the KDrive merge accidentally contained a bunch of vendor-specific hacks; sorry. commit 8884a73a3f4efa8276c5e38b9573201574c4f1f6 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 27 22:39:56 2006 +0200 xfree86/input: re-add support for disabling drag events commit f2903c12bb4bb0b7c94b96c55af8fa55507f9d7d Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Nov 7 11:13:32 2006 +0200 SyntheticMotion: don't dereference sprite.screen when not using Xinerama (cherry picked from aa052e43c6c293e14f78837e00c6b7581f9713bb commit) commit d17ec01e8395a8f14b75a10c8bf082b3f5a4fb36 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 1 00:41:41 2006 +0200 remove CID support (bug #5553) Remove CID from all our fontpaths. (cherry picked from 69820a10e33e4582c192360996e866007114639d commit) commit abe5e079af715713097ab0daad29a3e9f523c398 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Dec 6 07:58:03 2006 -0800 Update pci.ids to 2006-12-06 from pciids.sf.net commit 724f9cb578086e8483a2d0636dd6eb05d664d31c Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Dec 5 13:44:05 2006 -0800 Bug #9219: Use pWin->viewable instead of pWin->realized to catch InputOnly windows too. commit 3690de9b1b0902d395bc7d071fc05ebc8f75be2b Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Dec 5 12:42:12 2006 -0800 Bug #9219: Return BadMatch when trying to name the backing pixmap of an unrealized window. Before this change, ProcCompositeNameWindowPixmap would name the screen pixmap if !pWin->realized. commit eb1d9f51af19dab20a95c2830ca1c508d8ee66bb Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 5 18:50:19 2006 +1030 Ironing some glitches caused by the merge commit 3c8f166022a2d19af14eb670fa382503ba1451cd Merge: 2a51149 f9f7d7f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 5 18:28:33 2006 +1030 Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver into mpx Conflicts: dix/events.c commit 2a511492f9a235d3f5390ab87b6c643cbea92d88 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Dec 5 15:45:18 2006 +1030 Xi: adding MPX checks to ProcessOtherEvents mpx: adding QueryPointer request and reply adjusting names of requests to Xlib compatible naming (xMPX*** instead of mpx***) commit f9f7d7f3be53c808abb5eaceb7a1abc55744a210 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Dec 4 13:36:30 2006 -0800 Check for __sparc as well as __sparc__ for compatibility with Sun cc (gcc defines __sparc__, Sun cc defines __sparc) commit ac90ce58ba1da3ed605adf75f4d54c34b578c402 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 1 21:12:21 2006 -0500 Naming change: Security*Operation -> Xace*Operation commit f44f14fe564d834568a0afefba944223a73ea0f5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Dec 1 20:48:15 2006 -0500 Define calls away when not building XACE, allowing ifdef's to be removed. commit a5d6499d666fea4a9988118ddd3a5e4c9cfcc32c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Dec 1 16:42:37 2006 -0800 Fix syntax error in configure check for SYSV_IPC that broke with Sun cc commit 89b2aa9be81613cb1a06bd535bf50ecf2a00208d Author: Keith Packard <keithp@guitar.keithp.com> Date: Mon Nov 27 21:40:24 2006 -0800 Destroying RandR crtc or output overwrites memory. RRCrtcDestroyResource and RROutputDestroyResource had matching bugs that would overwrite memory past the end of the storage of the crtc or output arrays. Oops. (cherry picked from 4202b23ed86405a4cebfdcf239df1b023c1d10ca commit) commit 23ba72323af785516db6cbcf6c1b2fa907a8232f Author: Keith Packard <keithp@ukulele.keithp.com> Date: Thu Nov 30 23:16:42 2006 -0800 RandR ListOutputProperties has nAtoms element, not nProperties Earlier RandR 1.2 encoding revisions used 8-bit nProperties field. Final RandR 1.2 spec uses 16-bit nAtoms field instead. (cherry picked from 66b6358a393972946f16394918db2401c51dc5ed commit) commit 416f1bb99a6d4557f2863ae941868e47e11bbb3b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Dec 1 15:56:52 2006 +1030 mpx: SelectEvents and GetEventBase requests. Some renaming and cleaning up in extinit.c MPXLastEvent added Xi: ShouldFreeInputMask() from XI is not static any more, used in mpx dix: GetPointerEvents() allocates MPX event for MPX devices. DeliverDeviceEvents() caters for MPX devices. commit ccd804c6c01cdfffe938fa5336be9b5668a6f0c0 Merge: 9423ac1 82912ad Author: Drew Parsons <drew@pug.localdomain> Date: Fri Dec 1 15:21:57 2006 +1100 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 9423ac134a2a9800787c4978d384827cc4e61fc8 Author: Drew Parsons <drew@pug.localdomain> Date: Fri Dec 1 15:21:05 2006 +1100 GNU/FreeBSD support in GLX: include byteswap.h for FreeBSD systems defining __GLIBC__, as done already for Linux and Hurd (cf. bug #5613). Also includes some more __GNU__ checks on top of those made in commit ade4bf09076d13dbf3549c0a2d987a0afe76d5c1. Thanks Petr Salinger (Debian bug #400869). commit 82912ad7709e8cf4a5f8a9fa6b47f789842a3fe9 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 30 20:13:52 2006 -0800 Make solaris version of xf86OSRingBell return void like other OS'es commit 8956f63a941bf0a5f157d47b33e6221601a75040 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 30 19:53:29 2006 -0800 Tell automake to STFU about the *.O files automake will not stop whining about the *.O files not being in normal library name format, so just tell automake they are PROGRAMS so it builds them without bitching. commit f3c60900e575e65254cd2576cc6c90b97c8f63ae Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Nov 29 22:19:57 2006 -0500 Add required root window context to config file. commit 143558500a89a5c887c75c03798bae68c953cac9 Merge: e3d3d29 ee9bdd3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Nov 29 20:41:41 2006 -0500 Merge branch 'master' into my-XACE-SELINUX commit ee9bdd3f4a14a42fb0747acc420966f0f669129b Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Nov 29 12:01:43 2006 -0800 Add DIX_CFLAGS to util builds. Fixes a build breakage when $(top_srcdir) != $(top_builddir) because -I$(top_srcdir)/include is missing for the cvt, ioport, pcitweak, and scanpci builds. Signed-off-by: Adam Jackson <ajax@nwnk.net> commit a6381e69845f58d2b3282992b1f881015190f1bc Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Nov 29 19:25:09 2006 +0100 xfree86 DDX: Delete DDX screens in ddxGiveUp(). This allows video drivers to clean up in the FreeScreen hook things they set up in the PreInit hook. commit afd6af65510b0147f16f08314045b3506bfa9d89 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 29 17:55:15 2006 +1030 mpx: Infrastructure for MPX extension, GetExtensionVersion request works. commit b0c8558b9d9a9984c0067960392e28f5a7622b29 Author: Keith Packard <keithp@neko.keithp.com> Date: Sun Nov 26 19:31:48 2006 -0800 Ensure RandR resource types are registered before resources are created. Now that resources can be created during server initialization, make sure the crtc, output and mode resource types are created before attempting to create associated resources. (cherry picked from commit ec83d674167e7045d5317b179c9998e3172a26dc) commit 6245e9dd4719c5dc15ff45d49cf626123794038b Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Nov 21 16:52:28 2006 -0800 Allocate correct size for RRPropertyRec (oops). Neglected to change the allocation size from sizeof (PropertyRec) to sizeof (RRPropertyRec). Lots of fun crashes this way. (cherry picked from commit 0626eb8e5c9fa05de6bdc9aa0c654f5148bf7cff) commit 24abce8032940e96bb2ccf9e463a7fff6f36283a Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Nov 21 01:15:26 2006 -0800 Change RandR property datatype to include pending/valid values. This patch tracks the protocol changes which introduce more complex semantics for RandR output properties including pending and valid value information. (cherry picked from commit af55c65bea40669fdc038aa34c6a1ec9ecb33e87) commit f62ac3ec39c6593df476985c630e499864c19c72 Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 28 10:31:40 2006 -0800 Separate DDC mode list creation from MonPtr creation. This will be used by the intel driver, and likely other RandR 1.2 drivers. commit fbd09443385c533416fa530399d54f130afaf985 Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 28 10:15:51 2006 -0800 Replace bad mode name-setting code with xf86SetModeDefaultName(). commit 4ad0bde661be2af4a17771d66066d49736e85cbe Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 28 10:12:02 2006 -0800 Clean up a bunch of long lines and trailing whitespace. commit 05778432dc6e688bc0beff0c20ffd7e27b74888e Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 28 10:07:57 2006 -0800 Move code to get a mode list from EDID data from ddcProperty.c to edid_modes.c. commit 38ecc66cd9c61346a46697bbf1d8319f4f6f9800 Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 28 10:06:15 2006 -0800 Typo that was missed in testing. commit 834e4b079866594b50be64ae79f3cb2a5baa2070 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Nov 28 18:57:13 2006 +0100 Fix potential NULL pointer access in timer code. https://bugzilla.novell.com/show_bug.cgi?id=223718 commit bdf718907b3202815a04ec28a868689708f43da9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 28 18:06:34 2006 +1030 dix: missing parameter to SetCursorPosition in CheckMotion ifndef MPX mi: missing include in misprite.c ifndef MPX commit e88bc0e55a6937ff0b47fe38f60bfa8991196578 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 28 14:34:36 2006 +1030 mi: Bugfix: FreeCursor ignores negative refcounts. mieq: Bugfix: Motion notifies did overwrite DeviceMotionNotifies commit 5dbcd34a0a6c0d10dbfea8fdc9d7dfe7a0261b19 Author: Eric Anholt <eric@anholt.net> Date: Mon Nov 27 16:26:14 2006 -0800 Register dependency on new RandR protocol. commit 16f8f10dc2106bc6253b2d89a1f8efee8d80e2ba Author: Eric Anholt <eric@anholt.net> Date: Mon Nov 27 16:21:31 2006 -0800 Move mode handling helpers from ddcProperty.c to xf86Mode.c. commit b4b0d901d98371a8aa7b17d195e18e83e2a6a618 Merge: 64de3ba d6cd031 Author: Eric Anholt <eric@anholt.net> Date: Mon Nov 27 15:43:15 2006 -0800 Merge branch 'randr-1.2' Conflicts: dix/events.c dix/getevents.c hw/xfree86/common/xf86Mode.c hw/xfree86/dri/Makefile.am hw/xfree86/os-support/drm/xf86drm.c hw/xfree86/os-support/xf86drm.h commit d6cd0313c7f23f32c9c7dda00ff739e772bf7db3 Author: Eric Anholt <eric@anholt.net> Date: Mon Nov 27 14:46:50 2006 -0800 Add some mode helper functions from the intel driver. This also removes static from some other functions that had been copied out to at least the intel driver, but perhaps others that were doing mode list handling. commit 85ea408e38f452bcf9109f14fd1016d159692a99 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 27 18:07:16 2006 +1030 mi: malloc checks for misprite and midispcur, code cleanup removed IsMPDev() commit 023da4e804ad260eaf0c50d2ec7213dd514e2113 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 27 15:54:33 2006 +1030 mi: mipointer.c cleanup, reducing code duplication, using MPHasCursor() instead of IsMPDev() commit a2340a73687dfd93affb6de28a33d73fd808c96b Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 27 14:47:23 2006 +1030 mi: free allocated memory in miDCCloseScreen and in miDCInitialize in case of errors. Some copyright notices. misprite.c passes DeviceIntPtr around and down to DC (previously miCursorInfoPtr and the plain device id). Large cleanup in misprite.c to avoid code duplication. commit 1c7568b8a1417257fa67c7fca69aa253099b9461 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 23 17:15:14 2006 +1030 mi: closing memory leak, miPointer is freed in miPointerCloseScreen bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX adding DeviceIntPtr parameter to ScreenRec's cursor functions. cleanup of miPointer code to use same scheme in each function dix: MPHasCursor() function determines checking whether to invoke cursor rendering. animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies on the core pointer right now. xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on the core pointer right now. rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on the core pointer right now. ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on the core pointer right now. commit 64de3baf85f6df274f71f736016f0848567cd9f6 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Nov 22 14:46:51 2006 -0800 Add a -showDefaultLibPath option. A corollary to the previous change, this option prints $libdir. commit 0a2a6e4070718b90af7ca0e047f028e0cabdfb9d Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Nov 17 18:27:23 2006 -0800 Add a -showDefaultModulePath option. As discussed on the mailing list, people would rather have an X command-line option to print the module path so installers can know where to put modules, rather than the installers using `pkg-config --variable=moduledir xorg-server`, since some distros choose not to install xorg-server.pc. commit 61832cb94c8a4d62cddb92188caeed86519e9d62 Author: Brian <brian@i915.localnet.net> Date: Wed Nov 22 09:16:43 2006 -0700 Regenerated from Mesa w/ latest gl_API.xml file commit 61863f09d22935406371e92bb75173d55ff9b29f Author: Brian <brian@i915.localnet.net> Date: Wed Nov 22 09:16:17 2006 -0700 Regenerated from Mesa, fixes glMap* protocol problem (bug 8899) commit f52d53e060d0468b658a565688d1f92c156405c7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 22 17:58:57 2006 +1030 dix: DeliverEventsToWindow adjusted for MPX mi: sprite debugging disabled commit 8c16f21d5df08b028e93440d632939a5fdbf5876 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 22 17:06:47 2006 +1030 dix GetSpriteWindow() adjusted for MPX added device dependency for MPX to DoEnterLeaveEvents, EnterLeaveEvents, EnterNotifies, LeaveNotifies and FixUpEventFromWindow. commit 70383105de279df553874efa56b37a7b3e426ea1 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 22 15:27:16 2006 +1030 mi: added DevToSprite() conversion function fixed miSpriteRealize to use passed pDev argument instead of looping. dix: changed sprite dependency and added MPX functionality to parts of events.c (XineramaChangeToCursor, XineramaCheckPhysLimits, XineramaConstrainCursor) Xi: fix: accessing other->buttons for keyboard segfaulted the server commit 33ff4cec5ff7533ec725f71d357c096dfb0acb79 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Nov 21 21:23:17 2006 +0000 Issue CloseDownDevices() in os/log.c and remove from dix/main.c. This ensures that all calls to FatalError() will shutdown the input devices. commit efd4f3c6ffec804c68ba5df17cc117da264fb7c4 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 21 20:31:30 2006 +1030 dix: WindowsRestructured() calls CheckMotion() on all devices mi: core pointer was checked twice in miSpriteReportDamage, miSpriteInstallColormap, miSpriteStoreColors, miSpriteSaveDoomedAreas and miSpriteRealiseCursor using damage bug (see comment in file) to avoid artefacts commit 9db851c22d4befb95bfb074b96620261d8e32ac9 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 21 18:15:04 2006 +1030 dix: moved sprite from static to be pointer of type SpritePtr added SpriteRecs for MPX devices changed sprite dependency and added MPX functionality to parts of events.c (ConfineToShape, PostNewCursor, XineramaCheckMotion, CheckMotion, XineramaChangeToCursor, ChangeToCursor, CheckPhysLimits, PointerConfinedToScreen) added DeviceIntRec param to GetSpritePosition(). This required some minor changes in ddx, xtest, xkb and xfixes. mi: changed miPointer to pointer instead of static struct. commit fd8b9a6eaee28a453a00af14195b81ef1890a577 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 21 15:24:43 2006 +1030 TAG: MPX_BEFORE_DIX_API_BREAK commit 447efdc01d4f8922205ba26e52c9e5ff9f5cb90e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 21 14:46:00 2006 +1030 mi: constrain MPX cursors to screen commit 1107d8bea22eea26f7b666f1c00a53360b7d237e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 21 14:00:46 2006 +1030 mi: added device ID to miSpriteCursorFuncRec functions added MPX code to midispcur.c BUG: Core pointer changes whenever MPX cursor changes shape. commit 3bad452d12d620df91b1f37d06c650ded96bfafe Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Tue Nov 21 11:26:21 2006 +1030 mi: added MPX to miSpriteReportDamage added id field to miCursorInfoPtr, required to pass through to miDC core pointer uses mpCursors array as well. added miDCBufferRec for future use with MPX TAG: MPX_BEFORE_MIDC_API_BREAK commit b1bbdf464d2f8799fa3429c1c27ca998c5f3e94a Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 20 17:58:30 2006 +1030 mi: added MPX to miSprite functions. NOTE: This version will render multiple cursors but with an artefact each time when devices alternate. commit 7b4b619d4c268804199f9f4775eb56604f0b80e8 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Mon Nov 20 13:10:07 2006 +1030 mi: moved core pointer information from miSpriteScreenRec into a miCursorInfoRec. bugfix in mipointer, semicolon after preprocessor statement commit ca2874b273232d9f51881b1cd754ed6847bfaf47 Merge: c9a5f9d e2f6dac Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Sat Nov 18 19:56:32 2006 +0000 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit c9a5f9d3911c2e6a8f81b0721c9eb914fb7719b5 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Sat Nov 18 19:55:42 2006 +0000 Shutdown input devices if FatalError occurs during startup. Fixes Xdmx problems when the input device has been initialized and the keyboard map has been destroyed. commit e2f6dacc736527790ed8e304698678afc17f71c6 Author: Dave Airlie <airlied@linux.ie> Date: Sat Nov 18 11:26:55 2006 +1100 dri: setup libdrm hooks as early as possible. This is due to radeon doing drm stuff before DRI extension gets initialised commit 90bea69dfdd63f58ee326887359ad1b35a31cb5f Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 17 18:03:43 2006 +1030 mi: added miCursorInfoRec to contain info of the MPX cursors. calling miUpdatePointerSprite() from event queue for MPX devices. adding device-specific processing to miPointer*() functions. dix: Call to SetCursorPosition in CheckMotion() temporarily disabled. xfree86/common: call to miPointerUpdateSprite() disabled, is done from the EQ NOTE: This build will not display cursor images. BUG: The second mouse does to take correct x coordinates. commit 94e106a898c44daeb228bcb031b85f996ddc96b0 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Fri Nov 17 15:10:37 2006 +1030 dix: moved isMPdev field to end of _DeviceIntRec structure mi: added miMPPointers array to mipointer.c added DeviceIntPtr to all miPointerSpriteFuncs. Coming from miPointer we use inputInfo.pointer as standard value. ABI BREAK! ramdac: forcing failed HW Cursor initialisation. MPX needs software rendering. changes to use new miPointerSpriteFunc (this required externing inputInfo, should probably be fixed at a later point). RAC: changes to use new miPointerSpriteFuncs. commit ef47d9c3ba63e9a6243fe5c81ccc60c8246352b4 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Nov 16 13:50:48 2006 -0800 Reduce calls to RRGetInfo. RRGetInfo can be expensive. Don't invoke it when quering Xinerama information or setting a new CRTC configuration. (cherry picked from commit b5aa9eb8e6eda36856a075f4b008c33f6c706bad) commit 07b26e690cd9a4fc626132feed0702515cbe5a88 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Nov 16 09:48:33 2006 -0800 Remove RandR output options. RandR output options are now expected to be handled by properties instead. (cherry picked from commit 8b2a7e94a1dc2776ab2cfaaebb309be02502602a) commit f17e3c34dfd1f1418440bdebf45764e4dbf550f0 Author: George Sapountzis <gsap7@yahoo.gr> Date: Thu Nov 16 02:18:03 2006 +0200 Fix GL context destruction with AIGLX. The logic for freeing GL contexts introduced by "Fix AIGLX VT switching." is inverted. As it is now, GL context destruction is deferred for glxDRIEnterVT(). commit ae3c9ad4abe66784d7ee474455003d2745699286 Author: Bjorn Helgaas <bjorn.helgaas@hp.com> Date: Thu Nov 16 17:29:06 2006 +0100 Bug 9041: Check the return code in xf86MapDomainMemory(). commit 5388423eb05daefcc71067b6ab96b6e57c44ef5c Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 16 20:43:27 2006 +1030 mieq: EQ processing handles MP devices global: MPX define added to xorg-server.h.in xfree86/common: small fix to avoid byte overflow commit c957a16180810fbd58526e1a670d82384fb4a61d Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 16 15:11:14 2006 +1030 dix: added isMPdev field to _DeviceIntRec, is used in GetPointerEvents() mieq: avoid merging events from different devices in mieqEnqueue() xfree86/common isMPdev field used from xf86ActivateDevice(), xf86PostMotionEvent() and xf86PostButtonEvent() commit 7ce2dc57844872cc340b60387d4d1cb3d982633e Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 16 12:51:08 2006 +1030 dix: merge with code cleanup from master GetPointerEvents treats events in the same way as XINPUT devices when flag has POINTER_MULTIPOINTER set. xfree86/common: added XI86_MP_DEVICE flag and parsing in xf86ProcessCommonOptions added POINTER_MULTIPOINTER define. Is used in xf86PostMotionEvent and xf86PostButtonEvent for the flags that are passed into GetPointerEvents() global: added flags to configure.ac to enable/disable MPX define added flags to dix-config.h.in to define MPX commit 4d07b503727ba86315b90d6f45b06ed6185724b2 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Thu Nov 16 10:55:15 2006 +1030 dix: cleaned up GetPointerEvents() to avoid code duplication. commit 6ff7f2ad6a5e2e769244590578e6809974b5235d Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 7 13:13:53 2006 -0800 Fix build on FreeBSD after input-hotplug. (cherry picked from commit 4e6e4baead6c565363abbcd9e06cc685be121596) commit bffb1f9b67c8d3d264c0c3fd703cf7e57dcdf7b7 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 15 17:53:13 2006 +1030 removed unused variables drag and local from xf86PostMotionEvent commit f737cd925efe452787443b039ae65b8d85081bb3 Author: Peter Hutterer <peter@cs.unisa.edu.au> Date: Wed Nov 15 17:50:02 2006 +1030 o fix minor error in comment for GetPointerEvents() commit 2eab230d9bd3f73ffe1b5a42111f89e85904ee11 Author: Jeremy C. Reed <reed@glacier.reedmedia.net> Date: Tue Nov 14 16:37:18 2006 -0600 For NetBSD, define PCVT_SUPPORT (System has PCVT console). Noticed by Joerg Sonnenberger. This fixes problem with console switching. This was in original imake NetBSD.cf. commit 26d2e45bdb0cf4d18ba7b0365425da49d60b3d5c Author: Matthias Hopf <mhopf@suse.de> Date: Tue Nov 14 15:33:07 2006 +0100 Bug #9023: Only check mice for "mouse" or "void" if identifier is != NULL. commit a724b7f1302ba7a59f140b521f13d2ddf0fcf9bf Merge: 6facd95 f80a8ae Author: Jeremy C. Reed <reed@glacier.reedmedia.net> Date: Mon Nov 13 20:32:26 2006 -0600 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 6facd958c2e7098cb68eac2810a88b8cd40f19c0 Author: Jeremy C. Reed <reed@glacier.reedmedia.net> Date: Mon Nov 13 20:23:06 2006 -0600 On DragonFLy, default to /dev/sysmouse (just like on FreeBSD). TODO: use autoconf to handle this so the code is not platform based but feature based. commit f80a8ae6e6820378ea70ac0849cee8bf3055e0e8 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Nov 13 18:26:05 2006 -0500 Disable Xprt server build by default. commit 5bfe7f4dfc6ab51b6790d74faf11574385234423 Author: George Sapountzis <gsap7@yahoo.gr> Date: Mon Nov 13 01:54:32 2006 +0200 DRI: call drmSetServerInfo() before drmOpen(). Also, remove some libdrm remnants. commit acb5ff4c73ac4d52201d7c421f488e2ead5c8b9c Author: Jurij Smakov <jurij@wooyd.org> Date: Sat Nov 11 14:09:15 2006 +0200 ffs: handle 0 argument (bug #8968) Handle an argument of 0 in ffs(), instead of looping indefinitely. Add an ffs prototype to dix.h, and add includes to ffs.c. (cherry picked from 34164e551e4c3909322d50b09835ca4ac1d49d68 commit) commit ca094684196886a4a1c10273049fae0705a3edc2 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Nov 10 18:02:05 2006 -0800 Correct symlink-mesa.sh usage message commit 28337cc1060bc08adef81c304dd9ed02d0a0e37b Author: Eric Anholt <eric@anholt.net> Date: Thu Nov 9 19:51:17 2006 -0800 Fix typo before the last commit. commit e1720b1089328af80ca0cb85e5289ced05263f95 Author: Eric Anholt <eric@anholt.net> Date: Thu Nov 9 18:53:37 2006 -0800 Bug #8868: Remove drm from SUBDIRS now that the directory is gone. commit 0dee48b8af3e054228aef0d15c1cb1c9e23790cc Author: Keith Packard <keithp@mandolin.keithp.com> Date: Wed Nov 8 23:17:55 2006 -0800 Add RRInit function to create resource types for RR objects. To allow RandR objects to be created before the screen object exists, the resource types must be registered with the resource database. A driver wishing to create RandR objects must call RRInit before doing so. Also, fix a segfault when setting Output data before it is associated with a screen. commit ec77a95a02329a2ee3a94d7de9d2a234aecb9ca0 Author: Keith Packard <keithp@mandolin.keithp.com> Date: Wed Nov 8 21:36:35 2006 -0800 Allow RandR objects to be created before the associated ScreenRec. xf86 drivers need to create RandR object in the PreInit stage, before the ScreenRec is allocated. Changing the RandR DIX code to permit this required the addition of functions that later associate the objects with the related screen. An additional change is that modes are now global, and no longer associated with a specific screen. This change actually makes mode management cleaner as there is no more per-screen list of modes to deal with. This changes the RandR 1.2 ABI/API for drivers. commit fd91630b73100e9d77ccb492c52807448bc772a5 Author: Dave Airlie <airlied@linux.ie> Date: Thu Nov 9 09:30:33 2006 +1100 make X server use system libdrm - this requires libdrm >= 2.3.0 This patch blacklists the load "drm" line, moves some functions in dri module links dri module against libdrm, and removes the X copy of libdrm commit 0409e1627a167db2efc1355f292d3c02a6989ffc Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Nov 8 16:17:20 2006 -0500 'make dist' fixes. commit 7e0aeebb8f8a5dff3cb4d88756e535dd70edeec4 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Nov 8 12:03:37 2006 -0500 Bug #6786: Use separate defines for server's Fixes support level. commit b5d09d4adb8088719ff494a4281a793717046576 Author: Rich Coe <Richard.Coe@med.ge.com> Date: Wed Nov 8 18:10:14 2006 +0200 CheckConnections: don't close down the server client (bug #7876) When an appgroup is shutting down, the list of clients can change, so make sure we're not trying to shut the server down. commit 0567a6337b84fa045b5732e98203f488274aa2a2 Author: Bram Verweij <amverweij@gmail.com> Date: Wed Nov 8 18:00:52 2006 +0200 xfree86/linux acpi: fix tokenising Split on a space, rather on the 'video' string, as strtok takes a char, not a string. commit e7900d68c3ee657158813f0650886d680c0a9a3c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 8 15:36:47 2006 +0200 remove trailing whitespace Whitespace police in full effect. commit 2035f115b7db3c4b7deabeab0d814b3107d6ef30 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 8 15:28:10 2006 +0200 xfree86: remove xf86Keymap.h commit 809e2841aaa54662a42498aacec558bc813bba1c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 8 15:27:58 2006 +0200 xfree86: add general handler, port ACPI to it (bug #5665) Add 'general' handler registration, which will not trigger DPMS when an event comes in. Make ACPI use this. commit b5438f7fb2879e0226b578f60b22a490e73c3a83 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 8 15:24:58 2006 +0200 Get*Events: massive reorganisation Reorganise the code logically, and put more comments in. Clip valuators in proximity calls. commit b0a7443ca8bd224994f98c1c1e25de88f2573224 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 8 15:23:52 2006 +0200 configure.ac: axe redundant SDL test commit 332f179db7c38310db1f752d45f51b6d8301fd30 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 8 15:23:35 2006 +0200 kdrive/sdl: fix compilation commit 988757a44197c91027109076e2e33ff6510ed71d Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 8 14:06:51 2006 +0200 config: error messages non-fatal, and before we free them Move error messages before we free the error structure, and make them all non-fatal. commit e2b78df5800fb4e3f0ed01b38a1974ba3577949c Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Nov 7 11:13:56 2006 +0200 xkb: warning fix commit b55007d8cc9d20baa23d5de67683e414c827d3e5 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Nov 7 11:13:32 2006 +0200 SyntheticMotion: don't dereference sprite.screen when not using Xinerama commit f93d10ce9bb4a6de83b561f44fb7b046def16234 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 6 18:33:45 2006 +0200 dix: remove staggeringly broken vendor workarounds Dear SGI, No. Scant regards, Daniel commit 389275d240e4ba19d62fda0f138a45c7ecb245ff Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Nov 5 02:47:59 2006 +0200 XkbCopyKeymap: don't iterate broken types, or dereference null pointers Don't iterate invalid destination types (>= num_types) when coping key types. Don't free key_aliases if it's NULL (theoretical, but sure). Make sure dst's label_font gets allocated if it's NULL. (Thanks, Chris Lee.) commit d585b4189aff8d7952847f75b19b4f092ab3b88b Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:47:55 2006 +0200 xkb: fix uninitialised warning Fix uninitialised warning with memset(); we never actually use it uninitialised, but gcc doesn't know that. commit b6d7b537ed8975363ad0f7c4180a62822358e418 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:43:22 2006 +0200 os: fix sun extensions test 'else if' is not very valid, plus the logic is kind of broken, so just move it outside the ifdef in the first place. commit 8ba0c7b62c78dead722b0c8aa414f37bac4414b7 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:41:03 2006 +0200 xace: avoid 'unused variable pScreen' Initialise pScreen explicitly, as REGION_* macros ignore pScreen. commit c3ea1f7db494365032526dc06a7283384bd0ecd1 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:38:31 2006 +0200 dix/mi: still more warning fixes Fix up prototypes for PrintChildren and PrintWindowTree in the dix. Make miPrintRegion be unconditionally defined, and move the prototype into regionstr.h. Change a bunch of ScreenPtr pScreen = foo; to ScreenPtr pScreen; pScreen = foo; in window.c, so we avoid unused variable references (as inline REGION_* doesn't reference pScreen). commit 3a9b96425851b495503bd2eb0fd0d01c08f6a097 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:33:09 2006 +0200 dix: add missing prototypes Add missing prototype for ffs, and include headers from ffs.c. Move PostSyntheticMotion prototype to input.h. commit 6716488fa256798070017232405b107d5c985479 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:30:23 2006 +0200 dix: remove unused debug code commit 51813d77bfb84609a58a98e678efe9b6c0bf5503 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:29:05 2006 +0200 dix: remove unused variable commit 844090a5b557705dd0adce2b7ed98813b5104d85 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:21:29 2006 +0200 xfree86/xf86misc: warning fixes commit 61b570d0c1eb448f0aa08b4598118f0d43bc7345 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:21:09 2006 +0200 xfree86/os-support: update prototype for OSRingBell commit c51fadc07d938f6a3edfd5620170fcb7d6486a11 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 21:20:45 2006 +0200 mieq: annotate with some more comments commit 578899139f133746634a7bf8845e25362b5dfca2 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Nov 4 20:35:55 2006 +0200 RemoveGeneralSocket: don't touch EnabledDevices RemoveGeneralSocket. Harmless, but. commit ae58d349c1cf5d63ad3616c485baa858350978d5 Author: Laurence Withers <l@lwithers.me.uk> Date: Sat Nov 4 19:34:37 2006 +0200 CreateColormap: fix return value (bug #7083) Return BadMatch when an unsupported visual type is given, not BadValue -- this is correct according to the spec. commit 96f78e3886791b723ccd9ba40bea701603537b0c Author: Erik Andren <erik.andren@gmail.com> Date: Sat Nov 4 19:29:49 2006 +0200 remove XFree86 changelogs (bug #7262) Without being able to tie these to specific commits, the text changelog is useless, as well as being huge. commit 5a40448f2d0ac2c86c617bebe3fb649174bf0d7f Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 7 15:48:05 2006 -0800 A couple more cases of error message before freeing strings. commit 05f1c302460a14c8fa9a943a12d69adcd3c30d58 Merge: 3e7e0e3 46af6d1 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Nov 7 18:42:54 2006 -0500 Merge branch 'autoconfig-for-7.2' commit 3e7e0e35094d09e0e764818ed125314be75be01a Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 7 14:13:23 2006 -0800 Report the error before freeing the error strings. commit 4e6e4baead6c565363abbcd9e06cc685be121596 Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 7 13:13:53 2006 -0800 Fix build on FreeBSD after input-hotplug. commit 20e9144c0746943624ff77a61791b8596f3f8458 Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Nov 7 12:49:28 2006 -0800 Add $(DIX_CFLAGS) to remaining Makefile.am files commit 5e946dd853a4ebc2722ae023429ce5797de3d7a6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Nov 7 13:50:19 2006 -0500 Bug #8937: Extension setup functions not called on server resets commit 1dcda4f3c56214464c0b6123fea6daa69aae69fc Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Nov 7 01:29:51 2006 -0800 Avoid dereferencing sprite.screen when Xinerama is not running. (#8925) With Xinerama support built into the X server but not in use, sprite.screen is NULL and yet the SyntheticMotion macro would dereference it. Avoid that by just passing sprite.screen to PostSyntheticMotion which can then dereference it when Xinerama is enabled. Also, define PostSyntheticMotion in dixevents.h and include dixevents.h in getevents.c commit c20d3bf7533da0bf26beaf7d8c359d18edbd70e8 Merge: 028bbdc 3d39c02 Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Nov 7 01:21:28 2006 -0800 Merge branch 'origin' into randr-1.2 commit 3d39c02fe6aaa602c52f1d4f0ea6cd3bd000cf9f Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 6 21:25:52 2006 -0500 More work on Bug #8875: revert previous fix and try using client argument instead of serverClient. Also don't use totalClientSize as it is not initialized until after the first call to InitClient. commit 75fe0670eb1f71144246f1c20759d58788bbee00 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 6 15:30:25 2006 -0500 whitespace adjust commit 0539d9cf2423fc0bed6f5c413beba3080f8abd85 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Nov 6 15:29:17 2006 -0500 Bug #8875: Security extension causes Xorg to core dump on server reset commit aa0261a98e9d5b1349b33e2639bd83c556dd4000 Author: Juliusz Chroboczek <jch@pps.jussieu.fr> Date: Mon Nov 6 02:29:49 2006 +0100 Improve vm86 error handling in Xvesa. commit 6b2c65fdd169037c6ede250d4a8fec3d29a080ae Author: Juliusz Chroboczek <jch@pps.jussieu.fr> Date: Mon Nov 6 00:30:09 2006 +0100 Fix typo in Xvesa: incorrect reporting of DAC capabilities. commit 028bbdc0417173803695808ba9f48498519273a3 Merge: 50504c6 8deaaa3 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Nov 4 17:46:26 2006 -0800 Merge master back to randr-1.2 commit 50504c68e1d407232cf83465981b235e542ef31f Merge: 8b87ce1 cde8806 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Nov 4 17:43:19 2006 -0800 Merge branch 'randr-1.2-origin' into randr-1.2 commit 8b87ce19741753eafbd99e7093bc3dea8f26e838 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Nov 4 17:41:25 2006 -0800 Allow X server to build against libdrm 2.1 commit 7ffbe9d232e3a4621a204448d67e434736465cbe Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Nov 4 17:41:09 2006 -0800 Add DIX_CFLAGS to hw/vfb/Makefile.am commit 2db62bce0725ba2d88cbe40fc440b6bda45046f3 Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Nov 4 17:40:34 2006 -0800 Define fbHasVisualTypes in fb.h as it is exported commit 8deaaa312ad7f9b492a2ae8ad17d74650112c25c Author: Bernhard Rosenkraenzer <bero@arklinux.org> Date: Sat Nov 4 18:59:39 2006 +0200 automake: avoid use of reserved _SOURCES keyword (bug #8866) Avoid using _SOURCES unless we're directly referencing a program or library to be built; use _SRCS instead. Shuts automake 1.10 up. commit f72927d26cd112d321f7bf187df3c740b3129d22 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sat Nov 4 19:00:57 2006 +0200 xfree86/hurd: remove OsMouseProc (bug #5613) Remove OsMouseProc, let the mouse driver deal with it. commit 0273610578485564c3c0be11b336b6554cc31b43 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sat Nov 4 19:02:04 2006 +0200 xfree86/hurd: add bell support, remove SERVER/LOADER defines (bug #5613) Add no-op bell ringing support, and remove obsolete @SERVER_DEFINES@ and @LOADER_DEFINES@ from CFLAGS. commit ade4bf09076d13dbf3549c0a2d987a0afe76d5c1 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sat Nov 4 19:03:13 2006 +0200 mesa/indirect: include byteswap.h on GNU userland (bug #5613) Include byteswap.h on all GNU-userland systems (including with the Hurd and FreeBSD kernels), not just Linux. commit 412e93349e1656c9650115328af4be0e59a66f74 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sat Nov 4 19:05:02 2006 +0200 kdrive: make building of Linux support conditional (bug #5613) Only try to build Linux support on Linux. We should probably disable all OS-dependent DDXes if we don't have a workable OS (and only build Xephyr/Xfake), but that's future work. commit cde8806c2930788ba8076e94651d391e45f3ccdb Author: Eric Anholt <eric@anholt.net> Date: Fri Nov 3 16:36:34 2006 -0800 Don't bump the refcnt if the new mode is NULL. commit 97fd471a627be185bee8cda3f709cfccea3fa12d Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Oct 27 12:36:56 2006 -0700 Fix standard VESA modes. The built-in mode timings were off slightly for the 640x480@60, 640x480@72, and 1024x768@75 modes. commit 22ee2e4e1f1d9fd9ca9f25c9bf25370034b771d4 Merge: 49a2668 bd0c829 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Nov 3 12:54:56 2006 -0800 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 49a26681b2bdd95ed65c425f1fa1441d2f092a6e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Nov 3 12:54:43 2006 -0800 Add DTrace probe points for X server <-> client communications See http://people.freedesktop.org/~alanc/dtrace/ for more details commit bd0c829654903ca45543dfa59cda967c4fafd8ac Author: Bjorn Helgaas <bjorn.helgaas@hp.com> Date: Fri Nov 3 18:54:06 2006 +0100 Do not map full 0-1MB legacy range If we're mapping something in the "legacy range" (0-1Mb), we shouldn't expand the requested range to the entire 0-1Mb range. Typically this is for mapping the VGA frame buffer, and some platforms support mmap of the frame buffer but not the entire 0-1Mb range. For example, HP sx1000 and sx2000 ia64 platforms can have memory from 0-0x9ffff, VGA frame buffer from 0xa0000-0xbffff, and memory from 0xc0000-0xfffff. On these platforms, we can't map the entire 0-1Mb range with the same attribute because the memory only supports WB, while the frame buffer supports only UC. But an mmap of just the frame buffer should work fine. commit c1828a8ff51c8db326c47e6710f4f42fab94fb6d Author: Egbert Eich <eich@freedesktop.org> Date: Fri Nov 3 18:32:48 2006 +0100 Fixing mach64 driver bailing out on ia64 Mach64 driver bails out on ia64 because it cannot map device memory. It turns out that some bogus and unneeded code attempts to find the root bridge of the device and fails to do so proberly as there this host-to-pci bridge is not existant. This code has been around for years although it completely unclear what it had been intended for. Fixing this by eliminating the bogus code. commit d50fc413b39f52663b46084c28e81fc4933a7b49 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 18:53:41 2006 +0100 Fix device path in altixPCI.c to be domain aware. commit 1d731fc54a2cf5d3f353d8ee1c7c4989df27f011 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 18:50:15 2006 +0100 Add domain support to linuxPciOpenFile(). Loosely based on patch from David S. Miller <davem@davemloft.net> See also bug #2368. commit caaa113acf4144fd47a1ac93ca440d78d1983e54 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 18:38:45 2006 +0100 Fixing domain support for ia64 ia64 specific functions + defines. Still uses /proc interface for some scaning code. Based on code from Egbert Eich <eich@freedesktop.org>. commit 16c5043fc0c84b14323cd211c2645106455ac320 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 18:22:09 2006 +0100 Fix 2 warnings. commit 072c022e731c3aadf34096f16364e29df47280d2 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 17:58:19 2006 +0100 Fix obviously wrong boundary checks + cleanup unused vars. Also disable compilation of code that is no longer used anywhere in the whole Xserver tree. commit 5afc6c1a14fea2966017493b045fa7209faeb8eb Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 15:42:03 2006 +0100 Added linux 2.6 compatible domain aware device scanning code. Additional scanning code uses the /sys interface of 2.6 kernels. Cleaned up the use of tags and already split domain/bus/dev/fn. commit 6319f7d713971f70f06166480f069eca3bcace36 Author: Egbert Eich <eich@freedesktop.org> Date: Thu Nov 2 12:50:52 2006 +0100 Make int10 fully domain aware. commit f4dd2665b0f9aa9c00a5152c73bc72cb7514eeb5 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 12:36:12 2006 +0100 Added missing domain stripping in already domain aware code. commit 46901063e8edc82b67989f4e5eec39d17c67dc98 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Nov 2 12:25:03 2006 +0100 Build with -D_PC on ix86 only. commit 543b397277d1f03b8091e44812010abcd5d80102 Merge: 4056e6e 645d057 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Nov 2 19:00:35 2006 -0800 Merge branch 'origin' into randr-1.2 commit 037f23e6f8fbe6e6fc8e71ed21958fc553df72d0 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 2 18:30:58 2006 -0800 Convert Xprt DDX to new motion history api commit 7dc54a40e900cbea1e509620623b091d54a3c2d1 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 2 16:38:47 2006 -0800 Remove references to xf86Info.kbd* from solaris code commit e46f7f78b362e76f5a553184e3f5ec7e109aa39d Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 2 16:38:12 2006 -0800 sun_bell.c needs to #include "xf86_OSlib.h" commit 58bf9a142d1957f4d77038ee4ce7b1116b1f7955 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Nov 2 14:43:02 2006 -0800 PostSyntheticMotion needs to be extern, not static, since it's in getevents.c commit 1ecd45fb8e4250fb51daa2bdf1a960af0f8b53fb Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 04:51:03 2006 +0200 Makefile.am: add config to DIST_SUBDIRS as well commit 01afa533aa872d1a101a41153f95d800e68fea3e Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 04:32:37 2006 +0200 xfree86/os-support: axe more unused files commit 57c1409151cb1f6e0e528fb92ebda58f86f12c1a Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 04:21:06 2006 +0200 xfree86/os-support: remove unused file from dist commit de5a4c63747a417cdece919f4fb5a4004a3ee7bb Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 04:18:33 2006 +0200 xkb: note that we allow full xi interaction We now allow maps to be set (etc) on different keyboards, so stop putting XkbXI_KeyboardsMask in unsupported. commit 1d65429a9e03871969552d0c31b022546cc46b12 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 04:12:55 2006 +0200 xfree86: don't attempt to enable and disable non-DIX devices Don't try to enable and disable devices with no entry in the DIX, such as the evdev brain. commit 64139c1950ea825c0a0124abc5f88499e91f797f Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 03:22:09 2006 +0200 bump to 1.2.99.0 commit 18c246a13b887b865de6a17e6cd1c259b9bc383d Merge: 794f2e7 4843d82 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 03:21:37 2006 +0200 Merge branch 'input-hotplug' commit 4843d823f4d38d8bd468ce3a8feddbff229ed416 Merge: ba9f513 a7b944f Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 03:18:13 2006 +0200 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit ba9f5138fc32a7a7b97bcf941bc92751b7c6c2c0 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 03:16:10 2006 +0200 xfree86: allow starting with no input devices Add a server flag (AllowEmptyInput), which will inhibit adding the standard keyboard and mouse drivers, if there are no input devices in the config file. commit be291a6d9764cf29a7d9a8114d47d9f41ce856e9 Merge: a2d6242 6fdfd9d Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 03:15:25 2006 +0200 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit a7b944f0d96c3e0e15e75378a04def1ac96089fb Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 1 16:17:49 2006 -0800 If getpeerucred() is available, include pid & zoneid in audit messages too commit fbfb35189ef6666707097704b43e052cb2f919ae Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 1 15:11:48 2006 -0800 Bug #1997: AUDIT messages should contain uid for local accesses <https://bugs.freedesktop.org/show_bug.cgi?id=1997> commit a2d6242106bb3a440faa9cad157e0120dbfa7b6e Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 00:46:33 2006 +0200 kdrive:remove Change{Keyboard,Pointer}Device This was removed in the DIX, so just axe it. commit d9a5e3e964b6c91fbca88b50674fce9660b972a4 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Nov 2 00:45:23 2006 +0200 XkbCopyKeymap: be more careful with levels, allocate compat/geom Take various extra precautions with copying levels across (thanks Chris Lee for a gdb session), including allocating when we don't already have a coherent map. Only free type components if they're present. Allocate geometry and compat components if we don't already have them in the dest map. commit 6fdfd9dad91d7b7aa292f8c4d268dd27c34de8d3 Author: Eric Anholt <eric@anholt.net> Date: Wed Nov 1 14:29:59 2006 -0800 Fix several cases where optimized paths were hit when they shouldn't be. This fixes a number of rendercheck cases. commit 40f84793bca40dcc6883d51aefa1bda44bd1ac61 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 1 14:34:46 2006 -0800 Propogate $LIBS for xtrans, clock_gettime, libm, etc. to libs used for each server commit d7d931abe01a8cf555b027f2bcfcccd5e9053e52 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 1 23:48:58 2006 +0200 configure.ac: remove check for rate/period Keyboard stuff is now handled in the kbd driver. commit 81728558a044fdde0e1d63da7b6314755f77296e Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 1 23:10:26 2006 +0200 input: add non-keyboard bell ringing function Add a generic 'ring the bell' function (console bell on Linux and BSD, /dev/audio on Solaris), and add DDX functions for this. Make this the core keyboard's bell. Port Xvfb and Xnest to this. Port XFree86 to this, with OS-specific hooks for Linux, BSD, and Solaris taken from foo_io.c in the old layer. commit 3df454719f9cbf6a046cb7458019ec621b3b42ee Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Nov 1 23:02:57 2006 +0200 kdrive: add KdRingBell prototype commit 4056e6e79a4e37101d298ae29139c83d3816368b Author: Keith Packard <keithp@mandolin.keithp.com> Date: Wed Nov 1 00:29:46 2006 -0800 Move physical size from mode to output. Modes can be shared across different sized monitors this way. Also caught some missing byteswapping and an incorrect return type. commit c03311a1e78daa291477a67b1bb7206772108c5d Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Oct 31 16:05:48 2006 -0800 Fix automake error: BUILT_SOURCES was defined multiple times on Solaris commit a2434ec5f3c9dc79d1f05c2d704a82a766718ed4 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Oct 31 15:57:59 2006 -0800 Make _POSIX_C_SOURCE hack work with Solaris headers Solaris headers are very literal - if you ask for POSIX_C_SOURCE 199309L, they limit to only the functions in that standard and no more, unless you also specify __EXTENSIONS__ to allow functions beyond the standard base. commit 645d0576205532a3610ae351267d5b84d76236bd Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Oct 29 18:19:56 2006 +0100 Handle building in a separate objdir commit 59584c375f4e4b2670a92002ecb7a78a0bc50cce Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Oct 29 17:49:46 2006 +0100 kill GNU-make'ism. commit 0107320fac0913aae2cb169992e31c670b4bd2f7 Merge: 06b6b97 a34446f Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Sun Oct 29 15:23:35 2006 +0100 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 06b6b971d065226b983ba25da7ea8236ec37df04 Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Sun Oct 29 15:22:37 2006 +0100 Make sure we have 64-bit file-offsets in libdrm. commit 644ee2434a4e09f5baea00a486911f8c24b9a261 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 29 03:52:11 2006 +0300 kdrive: avoid null dereferences Avoid jumping into NULL pointers for OS or card functions which do not exist. commit 738d2e88171bcce8782d670a1cda9a1d941d7977 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 29 03:48:02 2006 +0300 kdrive: move bell ringing into an OS function Move the bell into an OS function, and use that if it's declared; else, fall back to using the driver's function. Remove the Linux keyboard bell function; just move it into the OS layer. Use named initialisers when converting the old structures, and eliminate unused functions. commit 96e32805d12fc36f0fa0926dbfb0dd8a5cadb739 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 29 03:43:34 2006 +0300 Xi: disallow changing core keyboard and pointer Just short-circuit the change core keyboard/pointer requests. commit 68f595ca6c7883e030947b7f95c50e92aa733f2b Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 29 03:41:34 2006 +0300 GetTimeInMillis: use correct units for clock_gettime Make sure we're treating the nanoseconds as a long, not an int, so we don't overflow. commit 51a06b3c44509c72279b5cfcf2b52b9a35c461b0 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 29 03:40:57 2006 +0300 WaitForSomething: only rewind when delta is more than 250ms Only rewind time when we're more than (original delta + 250ms) away from executing the timer. When we're walking the timer list, use a goto to iterate all of them from the start again, since timers may drop out of the list. Don't bother trying to be smart in TimerSet, we'll pick it up in WaitForSomething anyway. commit a34446f5b3d90714969a90583c49cb1eae1c9651 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Oct 27 13:43:43 2006 -0400 Add missing file to list in Makefile.am commit 92d04e746bd9b8ad3ee217c165ace20468e079cf Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Fri Oct 27 18:26:30 2006 +0200 Import libdrm functions for the drm memory manager. commit e3d3d29db5eef057b4e8294377c9c3147436bc2f Merge: 92387e9 004d00e Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 26 20:21:16 2006 -0400 Merge branch 'master' into my-XACE-SELINUX commit 92387e99d085b0b081fcedb2f20304eb0ac536b1 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 26 20:20:57 2006 -0400 Change symbol in libaudit library test. commit 196c5836f463c28f633bbba847f59acd5935359d Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 27 01:27:31 2006 +0300 CoreKeyboardProc: annotate with FIXME Setting an empty keymap by default isn't wildly useful. commit f9a1e456f8a4eaa1a9c71fd0fe5231140975c22d Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 27 01:25:39 2006 +0300 CoreKeyboardProc: don't leak keymap and modmap SetKeySymsMap does a copy here, so try not to leak them. commit a5be65401769fabcb5001dc63035c69f9e4a2712 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 27 01:25:21 2006 +0300 mieqEnqueue: only compare DEVICE_BITS of deviceid Only compare DEVICE_BITS of the two deviceids, so we don't decide that a valuator event isn't for us, because (id | MORE_EVENTS) != id. commit 85212eb504f860b054eb0f0a5029fed86cb8d1c0 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 27 01:23:58 2006 +0300 getValuatorEvents: make sure we put MORE_EVENTS in the right places Make sure we put MORE_EVENTS in with the device id if there are, in fact, more valuator events coming. commit 794f2e7291ccb4e48f9fbfc8f08302e3aac0f79f Author: Myron Stowe <myron.stowe@hp.com> Date: Thu Oct 26 20:38:58 2006 +0300 xfree86: re-enable chipset-specific drivers for Linux/ia64 Re-enable chipset-specific support for Linux/ia64, by linking in lnx_ia64.c. commit 8c0556e7cb1de8c387ddd886a03a8f8afff1fd0e Merge: cdc8a4b 004d00e Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Oct 26 15:21:22 2006 +0300 Merge branch 'master' into input-hotplug commit 004d00e6689f452fc9fdf91f5ffc6d6aed697d54 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Oct 26 01:10:08 2006 +0300 GetTimeInMillis: simplify monotonic test We don't actually need to get the CPU clock ID, which means we don't need the monotonic_usable test. Since there's now only one branch, the compiler will treat that as likely, so we don't need xproto 7.0.9 anymore. The fallthrough to gettimeofday() is preserved. commit cdc8a4b7b2f099b8860a54c5c9f488e6f7c4913a Merge: 3da918a d285833 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Oct 26 00:28:30 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit d285833290316cb5dd1e7f1e52c96be3e9cf21cd Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 23:57:00 2006 +0300 GetTimeInMillis: spuport monotonic clock Add support for CLOCK_MONOTONIC from clock_gettime, and use that in GetTimeInMillis() if available, falling back to the old gettimeofday() implementation. This is _slightly_ faster on some 64-bit architectures, and _slightly_ slower on others (though barely measurable). commit d3e57faffee63df1424a209d0418d3a712f91ae6 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 23:55:43 2006 +0300 WaitForSomething: allow time to rewind If time rewinds dramatically, reset all the timers to fix their expiry. commit e21604914dccece6bc64c69b55512d1f1a969235 Author: Keith Packard <keithp@neko.keithp.com> Date: Wed Oct 25 09:48:23 2006 -0700 Merge master back in and clean up some unfinished code (closes 8745) commit becbda6d519a11c2c211afb8d46f9ea1a2676bc3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Oct 25 11:39:27 2006 +0200 Fix test for Option "IgnoreABI". This option has plenty of potential for wasting the time of bug triagers without pretending it's always on. commit 59511974db843fa7e11133894cfc10c20fdaf60f Merge: 054f8cd 598ac7a Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Oct 24 17:26:20 2006 -0700 Merge branch 'master' into randr-1.2 commit 598ac7a83698327b607084abaebcbd22f8d25fbb Merge: 828c34e 948a97b Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Oct 24 17:23:12 2006 -0700 Merge branch 'origin' commit 828c34e83ccdf3bcd2844d5af8b0cac4164b04ab Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Oct 24 17:23:02 2006 -0700 Byte swap RRSelectInput enable flags. commit 3da918a16c8908fdfaf89f2a1bcaec19e01528a9 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 02:22:07 2006 +0300 mipointer: remember to update pointer location Update pointer location so it doesn't get quickly reset by the next pointer update. commit aabc087998e680c2fcf0ebc1c5022c1fe8f58f0c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 02:21:39 2006 +0300 GetPointerEvents: always ensure correct number of events Ensure correct number of valuator events are returned, and that we always increment events correctly. commit 65cd5aa4d754624566c2263015f1a018d137fce1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 01:12:45 2006 +0300 kdrive/input: remove unnecessary #ifdef XINPUTs Xi is now mandatory, so don't bother with the ifdefs. commit 0514d53e10b3521bb708a9cbde4bab525248eadb Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 01:10:44 2006 +0300 xfree86: remove motion history handling Remove motion history handling, as we now deal with this in the DIX. commit b1debebf8fe20ded20ba27e871fd1a6a9de029e3 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 01:10:20 2006 +0300 mi: remove mi motion history This is now unneeded as we do motion history in the DIX. commit b9e180e632d04bf685ade9e32bd0b20882794486 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 01:09:19 2006 +0300 port all users to the new DIX motion history API Port KDrive, Xvfb, and Xnest, as well as the virtual core devices, to the new motion history API. Make GetPointerEvents also update the history. commit 5b38eb69cdaa154791c7f74e35dbe4d3256b19bd Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 01:08:29 2006 +0300 dix: add motion history support Add motion history support (sort of based on the XFree86 DDX's implementation) to the DIX. commit 11fb58be77ac163844e494b2b0a260cf28a7ecd1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 01:07:36 2006 +0300 miscellaneous warning fixes Use the correct type for time, and fix the mi prototype of EnqueueEvent. commit 2a74b8a91da1a98669993078f7fe9081f2d743ce Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 25 01:04:53 2006 +0300 xfree86: re-bump input abi to 1.0, yet again commit 37d1fffe79c35ada056ce9a56292c000014fe48a Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Oct 24 23:06:57 2006 +0300 inputstr: try to keep device structs the same size Try to make sure DeviceIntRec and friends stay the same size, regardless of whether or not XKB is enabled. commit 9f9ac01a819ee96fb5be5d7d346c91f461bf3979 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Oct 24 23:01:05 2006 +0300 inputstr: fix indentation commit 27d682fa030501611a5b52f41f29738134b45c0b Author: Ian Romanick <idr@us.ibm.com> Date: Tue Oct 24 09:04:14 2006 -0700 Fix from HEAD accidentally reverted during merge. commit 8b909135664abb69ada522e8e39495d9eca717ac Merge: 21291d6 948a97b Author: Ian Romanick <idr@us.ibm.com> Date: Tue Oct 24 08:57:59 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/Makefile.am hw/xfree86/common/xf86.h hw/xfree86/common/xf86DoScanPci.c hw/xfree86/os-support/bus/linuxPci.c hw/xfree86/scanpci/extrapci.ids hw/xfree86/scanpci/pci.ids hw/xfree86/scanpci/pciid2c.pl hw/xfree86/scanpci/xf86PciStdIds.h commit 0cd6a3d8efb5cc1ce4f85ab95bcdf4fb66c7245d Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 06:56:07 2006 +0300 xfree86/input: add proximity support, free valuators Re-add support for proximity events, and remember to both va_end our varargs, and free our valuators. commit cccf7ae0ff24d0c84b5144c457f3f86bbbc36e12 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 06:55:21 2006 +0300 GetProximityEvents: add (untested) function Add untested first guess at what GetProximityEvents should look like. commit 35fa4ac12b3da33f81e2a12bc9661ed075f323ed Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 06:23:45 2006 +0300 GetPointerEvents: break into separate functions Break out clipAxis, clipValuators, and getValuatorEvents, into separate functions, to be used by the proximity event code. commit a7c2d9a15dc2ff253bb69c3b0738ad993521b9c7 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 06:08:27 2006 +0300 kdrive: numerous warning fixes commit c8f76fb3a473a022d497bd0acd6c84f58fc6efbe Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 05:12:15 2006 +0300 xfree86/input: disallow pointer device changes, fix drag event calculation Don't allow users to change the core pointer. Fix xf86SendDragEvents to check the device button state, not the core pointer's. Remove unused xf86CheckButton. commit c5b5b046e86b159a9d32451308f38246cc4587f7 Merge: fab1d37 948a97b Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:58:30 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit fab1d37ecbeee9777ad1485b0cc62b55042d5014 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:57:00 2006 +0300 xfree86/options: don't blindly dereference NULL pointers Sure, conf_idev should be initialised, but if it's not, try to make the best of a bad situation. commit 523fe64ba16cf7a40f4095432d81300726d83e8d Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:56:28 2006 +0300 kdrive/lots of DDXes: make stubs use KdOsAddInputDrivers() In theory, removing LinuxPciScan should make these drivers OS-independent. commit 57f98e2b72d5c7fea93a9f6da86228ffb4856bf3 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:55:41 2006 +0300 kdrive/tslib: port to new absolute API, remove debugging Port to new absolute device (not touchscreen) API, and remove some leftover debugging. commit a6dc629052f0ad509cfa30e98217043a63c09552 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:54:59 2006 +0300 kdrive/os: add KdOsAddInputDrivers Add KdOsAddInputDrivers, which adds all relevant input drivers. Could possibly be refactored to KdAddInputDrivers, which called through OsFuncs to a new function, if it existed. commit ac240b00ff6fc354c1aa641406ae8b49244c0b8b Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:54:07 2006 +0300 kdrive/input: use Absolute instead of Touchscreen Adjust to suit Zepheniah's new absolute device API. commit b1ba4b3e8ad427af1fa8618b0bd839f741ec2ce3 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:53:15 2006 +0300 kdrive/neomagic: include vesa.h, use DebugF commit 29f28dd1a8a7ed07e945a67946e3510f4b32d12a Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:52:52 2006 +0300 configure.ac: add XSERVER_LIBS to XNEST_LIBS commit 2f33f4065d89ae2b6fdda43c7105d72f89920cae Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:52:35 2006 +0300 Xnest: port to new input API Port Xnest to Get{Pointer,Keyboard}Events, plus the new mieq API. commit 08928afb0500d46b0caa0a1d1244dee2ed80e6a0 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:51:52 2006 +0300 Xnest: disable XKB, reshuffle code Disable XKB, as we can't yet use it; move Composite disabling to ddxInitGlobals, along with XKB. commit cd3b16a57efaf89108054f18a94c91e2dd74fafa Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:51:13 2006 +0300 Xvfb: port to new mieq API commit bf4df9b73f0c1a84093aaf9a2e2cbc56fb341c60 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:50:53 2006 +0300 include: move POINTER_* flags from inputstr.h to input.h Given they're just numeric constants, they should be included in input.h, not inputstr.h. commit 4dd91c45abea9fb561a5acb10290e29487df6722 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:50:03 2006 +0300 miinitext: Xi and XKB are not hardware-only extensions Xi is now a required extension, and XKB can be used without hardware, so include them both when NO_HW_ONLY_EXTS is defined. commit 562096a012f4bb8f44d5ec6320a32f4010c189e4 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:49:22 2006 +0300 XkbCopyKeymap: increment shapes and outlines when copying Remember to increment the source and destination shapes when copying, instead of just endlessly copying the first one. commit eec182259112fba240751f974f7e5ca09fce8b9d Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 02:48:30 2006 +0300 dix/getevents: move SyntheticMotion to getevents.c Mostly, this is just a cheesy hack to ensure that getevents.o gets included when linking. Sigh. commit bc701a14292da5abfb601e3a040651a74f46df8f Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 23 00:08:32 2006 +0300 dix/getevents: cosmetic cleanups, remove keymap copy from GKVE Remove keymap copy from GetKeyboardValuatorEvents, as SwitchCoreKeyboard now takes care of this for us. Remove unused variable and function prototype. Update comments to be as informative as possible. commit b03e2f7029506640a8fe5cb88818b329c23503ff Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 22 19:56:49 2006 +0300 xi: fix NIDR return yet again For a one-line function, it was pretty broken. commit 90de7ce25a84cfe6c6790f9af2bc2399d25b9b9c Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 22 19:54:36 2006 +0300 xi: fix return type for NIDR commit f46dc272913ffb6b5b234a7ec6f4ba5cae44a831 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 22 19:51:35 2006 +0300 xi: add NewInputDeviceRequest to stubs commit 31a6307b7ba5adaa96deb8101ddfcda0262f537d Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 22 19:49:31 2006 +0300 xi: change DEVICE_TOUCHSCREEN to ABS_{AREA_CALIB} for stubs commit eae6594d03a606ddf1f433b5897b5938aa940c1e Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 22 16:39:44 2006 +0300 Xi: swap control in DevicePresenceNotify commit be21630164e865eca72ff2a686a38ae4e30fd79c Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 22 16:33:02 2006 +0300 dix, Xi: make use of deviceid in DevicePresenceNotify Use the deviceid and control fields in DevicePresenceNotify since the last push to inputproto to send a DPN whenever a control changes on a device. commit f08b6b2367705cb5b60e996e6328197430bf1919 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 22 12:30:02 2006 +0300 kdrive: change DEVICE_TOUCHSCREEN to DEVICE_ABS_{CALIB,AREA} commit 77e724585f6c53feb55475b94d8cfcb6acf1159b Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 20 00:44:46 2006 +0300 minor formatting fixes commit 948a97b97e93cee05a23f1f1ae699c5e181bc8ce Author: Drew Parsons <dparsons@debian.org> Date: Sat Oct 21 23:09:22 2006 +1000 Minor typo fix to xorg.conf man page. commit 04554a3adcddc32de5fdb0b3122da0bcdd4c24a9 Author: Drew Parsons <dparsons@debian.org> Date: Sat Oct 21 22:06:43 2006 +1000 Minor typos in Xserver man page. commit e26a494f417c3c700636ee68892c3015b2e0f27a Merge: 736b0d5 aeba855 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Sat Oct 21 04:26:14 2006 -0400 Merge branch 'input-hotplug' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 736b0d5078597abbda80444deef852879260af90 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Sat Oct 21 04:24:49 2006 -0400 DEVICE_TOUCHSCREEN becomes DEVICE_ABS_CALIB. Update the DEVICE_ABS_CALIB stuff to include the new elements. New DEVICE_ABS_AREA support. dev->touchscreen becomes dev->absolute, with _CALIB and _AREA stuff in it. Update xfree86 to compile with this, kdrive needs an update too. commit edd5f1745461f995670969cb736d1569ca94643f Author: Carl Switzky <Carl.Switzky@Sun.COM> Date: Thu Oct 19 17:30:54 2006 -0700 Add ast driver/device info to Xorg server & config utilities commit aeba855b07832354f59678e20cc29a085e42bd99 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 20 00:30:28 2006 +0300 move keymap copy to event processing, from enqueuing Move the keymap copying to event processing time (in ProcessInputEvents), instead of being at event enqueuing time. Break SetCore{Pointer,Keyboard} out into separate functions. Change mieqEnqueue to take a device pointer, that asks for the _original_ device associated with this event. commit a8d3dad9d9f2b9053843e655abe463a68ba8dcb7 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 20 00:28:40 2006 +0300 xi: add DEVICE_ENABLE control Add DEVICE_ENABLE control, which allows runtime enabling and disabling of specific devices. commit b0780312d80ea4af0136227f90fdd7ada3db71c5 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Oct 19 13:51:53 2006 -0700 Pre-release message should tell users to check git, not CVS, for updates commit c5dc997baf57ffa08025efadbbaf761296ce4bc4 Author: Joshua Baergen <joshuabaergen@gentoo.org> Date: Thu Oct 19 11:14:26 2006 -0700 Create xorg.conf.example (Gentoo bug #138623). commit d029c8f1b72019446a5c873f55ffa43504b03dfb Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Oct 18 18:11:06 2006 -0700 Use getisax() instead of asm code to determine available x86 ISA extensions on Solaris commit a8a0abdbea0573c861a5af9d58f3ce66790455ca Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Oct 18 10:59:07 2006 +0300 config/dbus: always unref the connection, not close commit 80642f37d40216035786eaf490952d16f6b5f597 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Oct 17 14:53:28 2006 -0400 Stop building xorgcfg by default. commit 5e17cde27b064174584d478130b0f95dcef78deb Author: Matthias Hopf <mhopf@suse.de> Date: Tue Oct 17 17:06:44 2006 +0200 StorePixels() macro could create invalid *x++=*x... code - fixed. commit 205c6788d7a34704e36b23f1a93d89e9b986266a Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 16 23:48:09 2006 +0300 config/dbus: properly initialise vtable Properly initialise the vtable, so we don't end up with an unregister_function pointing to god knows where. commit 85ac2f16abe9f6e88b4e71609da334d336a9a600 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Oct 16 12:39:05 2006 +0100 Small modification to blocking signals when switching modes. commit 0901eec87ee9f3a2a067695bdbd569ff42149879 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Oct 15 16:57:09 2006 +0200 Fix __glXDRIbindTexImage() for 32 bpp on big endian platforms. commit a232693c8c2a206aac47c07b133c071938204e0b Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Oct 15 16:48:59 2006 +0200 Add per-drawable Xv colour key helper function. This allows overlay Xv adaptors to work slightly better with compositing managers. Bump the video driver ABI minor so drivers only need to check for this at build time. commit 5563861ab7e56ec891cfce6b34af43fec53ccee3 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 13 19:05:28 2006 -0700 Make sure xorgcfg files are included even when dist made with --disable-xorgcfg commit e1dd1904c6c7ce33f347d822272831d54a6497c8 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Oct 19 13:51:53 2006 -0700 Pre-release message should tell users to check git, not CVS, for updates commit 62d24097932708fbbb62a23614fe63b4b7acf3bd Author: Joshua Baergen <joshuabaergen@gentoo.org> Date: Thu Oct 19 11:14:26 2006 -0700 Create xorg.conf.example (Gentoo bug #138623). commit 357b37b3826fa6e9878c0bd895164259c2ed3c0d Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Oct 18 18:11:06 2006 -0700 Use getisax() instead of asm code to determine available x86 ISA extensions on Solaris commit 1b1698af41b9038d9f9dbf521737d0baab5a2237 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Wed Oct 18 04:57:22 2006 -0400 Pass SetDeviceValuators down to the driver. NOTE: This changes the LocalDeviceRec struct, which breaks input drivers. commit 5eca750fe2f3f243fb352271ad8da196af0cb16a Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Tue Oct 17 14:53:28 2006 -0400 Stop building xorgcfg by default. commit df979b75c8cd8a7e0566aea58031bb9b8f5cd3d3 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Oct 17 17:06:44 2006 +0200 StorePixels() macro could create invalid *x++=*x... code - fixed. commit d430e76a161c963169067875c3654f5fd8f42b19 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Oct 16 12:39:05 2006 +0100 Small modification to blocking signals when switching modes. commit 6dd4fc4652f942724039dc2317c560ea7276ab59 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 16 00:22:00 2006 +0300 xkb: fix virtual modmap size computation Compute virtual modmap size bounded by nVModMapKeys-1, rather than nVModMapKeys. This is sort of a best guess. The other way seems a little more logical, but also leads to segfaults pretty quickly if you hammer GetMap hard enough. So let's try this one. commit a484ba15277e66e7ef9b21b238dcbf760695bc63 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 15 23:47:34 2006 +0300 XkbCopyKeymap: copy server vmods, and name atoms Copy server->vmods, and all the atoms in names. commit ad355fecee3965be576596aeed5da54d776edf1d Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 15 21:59:06 2006 +0300 xkb: make sure we set the map on the right device, not necessarily core Forgot that all XKB requests took a device spec: the comparison of 'if working on the core keyboard, does this device send core events; or, is this device the core keyboard?' was broken. Instead, what we want is 'if working on the core keyboard, does this device send core events; or, is this device the one we're working on?'. commit 4ae7745a0dc86de6346409a69c1e396e0b954514 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 15 21:48:01 2006 +0300 xfree86 input: always open devices on NewInputDeviceRequest commit acd8419948003032056a56d46adbef7c35e7739c Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 15 20:42:31 2006 +0300 config: unref connection, don't close it Just unref the connection instead of explicitly closing it (thanks, Rob McQueen). Add a commented-out unregister_object_path call: unfortunately, when we call it, libdbus segfaults. But if we don't unregister the path, we can't register it again. So regenerations are broken either way, but a little less violently like this. commit fc9b5f84b244ea08480b73bd15ac919b875800fb Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 15 20:01:01 2006 +0300 dix/devices: add devices in proper forward order Add devices in forward order with the normal linked list convention. Previously, AddInputDevice would add all the devices in reverse order to off_devices, before they were added again in reverse order to devices with EnableDevice. This just makes both work in forward order, which provides the ordering as you'd expect when hotplugging devices (i.e. adds them to the head, not the tail). commit ec35e7198debf938f1115f584e675ce5995743e3 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 15 19:44:49 2006 +0300 config: add replies and dbus api documentation Add replies, which use standard X error values, to the two currently-supported input configuration requests. Document the D-BUS API we use. Make sure we free everything when we encounter an error. Add a _source option to all incoming requests, noting that it came from a client. Reject all requests to add a device where an option name contains an underscore. commit 7e4717683d6c08d1e490a60b7493a94bbc57bf8d Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Oct 15 18:12:28 2006 +0200 exaDrawableDirty: Fix initialization of BoxRec. This will hopefully fix the partial window corruption experienced by some people. commit 3ad1642f1bbaa5f96558cdf3384b40f7122f8781 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Oct 15 16:57:09 2006 +0200 Fix __glXDRIbindTexImage() for 32 bpp on big endian platforms. commit f9bfee50981006a2c58d3f73e2b0d123bb2a41b7 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sun Oct 15 16:48:59 2006 +0200 Add per-drawable Xv colour key helper function. This allows overlay Xv adaptors to work slightly better with compositing managers. Bump the video driver ABI minor so drivers only need to check for this at build time. commit a05044cfc14a8bc6cc31236dcecada60bec09924 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 14 22:14:56 2006 +0300 xkb: better support of XkbDfltXIId XKB.h specifies that XkbDfltXIId should be used where the client doesn't care about the device identifier. We take this to mean core devices, where practical. commit 4d8030076ed1a7680bdfcb7b89af1045bdc40304 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 14 22:14:07 2006 +0300 dix: move GetKeyboardEvents/GetPointerEvents to a new file, export symbols Move GKE and GPE to a separate file, to help stem the events.c explosion. Mark GKE/GKVE/GPE as _X_EXPORT. commit 6afc7c284690b1e2bb7544b5bc4f31a3f6a05519 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 14 15:54:35 2006 +0300 dix/devices: remove XACE merge debris commit 93302452e737bd91a893eb495592538d40d921e5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 14 15:54:12 2006 +0300 XkbCopyKeymap: add geometry support Add a first cut at geometry support, which seems to generally work. commit b9108a13fc126d97c0393f911a1d9292563444ce Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 13 19:05:28 2006 -0700 Make sure xorgcfg files are included even when dist made with --disable-xorgcfg commit 054f8cd2675a80b14bc1ce266377fcfee2335cee Author: Keith Packard <keithp@neko.keithp.com> Date: Fri Oct 13 17:34:53 2006 -0700 Limit pointer to valid crtc areas. Add event swapping. Fix change tracking. Add function to keep pointer within valid crtc areas. Finish event delivery and swapping code. Separate configuration from layout changes to send correct events. commit 335b503c5e7041bb0c44611e496d1c46f554e630 Merge: bd3d93b cf948b7 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 13 18:10:45 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit cf948b7b04dfeb61a294889027b9a54f6b9b478e Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Oct 13 14:48:10 2006 +0100 Block IO on switchmode just as we do for VT switching to avoid cursor movements signalling io. commit 4b53a5e4b147ab748b28dffc1d330b7148d8efa6 Merge: 23f6f08 042d4a4 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 11 20:50:31 2006 -0400 Merge branch 'master' into my-XACE-SELINUX commit a6df780e4d3f90cc699b0b864bade03d6f15afd7 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Oct 11 15:41:22 2006 -0700 Fix bug #8608. Regenerate files based on recent commits to Mesa (that fix Mesa bug that return pixel data. commit 042d4a407d0eca9131d0420b0b9189559aac326d Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Oct 9 16:32:11 2006 -0700 Bug #8459: Don't forget to include AM_CFLAGS in libfb_la_CFLAGS on non-MMX platforms. Reported by Edgar Toernig. commit 1b94c117e0f294ef2f89bf24d45ba7a8e45efe35 Author: Matthias Hopf <mhopf@suse.de> Date: Tue Oct 10 19:37:22 2006 +0200 Fixing probably long-standing bug in domain support. commit 6776c0f0e9677a65ec36ceef9618ff701b99596c Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Oct 9 17:24:37 2006 -0700 Use bash on Solaris to run symlink-mesa.sh symlink-mesa.sh won't run with Solaris Bourne Shell (/bin/sh) so explicitly run it with /usr/bin/bash instead (cherry picked from cde68728860179dc84e615ccb378ce992513fd62 commit) commit bd3d93be82d91e4cf35ae317dfd658d1706257ea Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 23:21:12 2006 +0300 xkb: remove random broken vendor workarounds commit 33406da096b4ae21134484113b280e07d0c8f0d9 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 23:20:56 2006 +0300 GetKeyboardEvents: add first_valuator argument to GKVE commit ef7e05e9de57b9c9c27ed3307eede6d8fc6c1af3 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 21:42:15 2006 +0300 xfree86/xinput: pass first_valuator params, don't clip to first screen bound Pass first_valuator to GetPointerEvents/GetKeyboardValuatorEvents. Don't clip axis bounds to that of screen 0 when initialising axes. commit 1546a398144619a14ff06aaf84ebc1bf293eac66 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 21:40:53 2006 +0300 GetKeyboardValuatorEvents: also take first_valuator param Take a first_valuator parameter, which specifies the first valuator. commit b05a11478edc7e6d1e38ef7f8d6788c7bd917493 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 21:23:12 2006 +0300 doc/extensions: rename to c-extensions The old name could be somewhat confusing. commit 41bb9fce47f6366cc3f7d45790f7883f74289b5a Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 20:34:32 2006 +0300 mipointer: take device arguments, split miPointerAbsoluteCursor Update mipointer API to take a device argument to (almost) all functions, and split miPointerAbsoluteCursor into a couple of separate functions. Remove miPointerAbsoluteCursor call from mieq, as we now deal with it in GetPointerEvents. Make miPointerSetPosition (successor of miPointerAbsoluteCursor) take pointers to x and y, so it can return the clipped values. Modify callers of miPointer*() functions to generally use the new functions. This should fix things with multi-head setups. commit be8dfafd1d58b27bbfd953fc1216311523353db1 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 20:32:16 2006 +0300 warning cleanups Fix still more warnings. commit ca474e0920dd29ebe7ccf346cddc526732ad01ba Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 20:30:49 2006 +0300 Xi: move SendEventToAllWindows and FindInterestedChildren to exevents Move SendEventToAllWindows and FindInterestedChildren from chgptr to exevents, so the DIX can more easily use it. Clean up two warnings (type mismatch, unused variable) in exevents.c. commit c2fab469b66f2796c541e911202faa411d116b04 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 18:26:26 2006 +0300 dix/devices: clean up debugging commit 4493acb88c59721f7807093a3ed3c39396c2076d Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 17:51:03 2006 +0300 xkb: add FIXMEs to procedures which need to act on all core devices Add FIXME comments above request handlers which need to act on all core-sending devices if called on the core keyboard. commit ef68273f5bdb27a492ec0b69548ec4fbede46c08 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 17:44:37 2006 +0300 mi/mipointer: deprecate functions which don't take a device Deprecate all mi pointer functions which don't take a device argument, and replace them with versions which do, in preparation for MPX. commit 6eab4c55890660089067da0e944256b1ed3a8c67 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 17:24:33 2006 +0300 doc/extensions: document C extension use in the X server commit 80cdd26581508dd17c5d0a5739cd540113996bbb Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 17:23:54 2006 +0300 mi/pointer: mark public pointer functions as deprecated Deprecate miPointer functions which don't take a device pointer. Pointer movement should be handled through GetPointerEvents, and functions which take a device as an argument (e.g. miPointerPosition) will be added. commit 97030b6c6b0fb6ff629ae31e483704d0a2207a53 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 17:07:05 2006 +0300 config: fix compilation Accidentally built with --disable-config, didn't notice that the previous commit to clean up the debugging broke things horribly. commit 14b157bdb1f2cd5feba03ba0815d7c5b2dd6633f Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 17:04:12 2006 +0300 include: actually declare DebugF DebugF is ErrorF when DEBUG is defined, else a no-op. commit 9e37de193f5d7412ffd8de76d5eed0158c0a3609 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 16:32:15 2006 +0300 configure.ac: reactivate warnings when building with gcc We were inadvertently stomping XSERVER_CFLAGS after adding the warnings, so move them after we do that. commit b559cbb1601f93cb03ea3dcfb2c5ca94ee6b73bb Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 16:23:14 2006 +0300 dix/CoreProcessKeyboardEvent: remove debugging for every key event Also change #ifdef DEBUG/ErrorF/#endif to DebugF in FixKeyState. commit 3ae4d250185e71a0a218c062426f92b9b1adbf05 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 16:20:42 2006 +0300 xfree86 Xinput: remove still more excessive debugging There isn't any more debugging left for input events in the XFree86 DDX. commit 58314756aeecbb8fb04706c3e04d98e9ac531a02 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 16:18:05 2006 +0300 GetPointerEvents: add first_valuator parameter Add a first_valuator parameter. Looks correct by inspection, but untested with first_valuator != 0 as yet. commit 84f5d2291c1fe92fd8358e999e909bf3aab86c98 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 15:30:24 2006 +0300 GetPointerEvents: fix relatively harmless typo Change !(cp->button || !cp->valuator) to (!cp->button || !cp->valuator). commit cfc3e9ede2dc83741bd38bf3df13f096ecb8adc0 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 15:27:52 2006 +0300 config: remove excessive debugging commit 8d8e7f8bae4099f9e90ef9aac687607dae1d32bf Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Oct 8 15:26:54 2006 +0300 kdrive/input: remove excessive debugging in NIDR commit 22a836fafd39a8ef413826dc2c94bc5f96990e2d Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Oct 7 14:16:51 2006 +0300 xfree86/loader: bump input major ABI version Bump input major ABI version to 1.0, since we removed the OS keyboard layer. commit 4c342246300e06bdf5c9c62cc1d2f6aa57a524db Merge: 8382234 49a70c8 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Fri Oct 6 18:01:13 2006 -0700 Merge branch 'XACE-modular' commit 3686cd0fbf56d883f2f3b3fda11ffba1058b74e4 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 6 17:20:42 2006 +0300 xkb: make XkbSetControls work on all core-sending devices commit 7b4dc171b036107cfba87a1a16bf692b982005a5 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 6 16:26:54 2006 +0300 xkb: remove unused #ifndef commit ab56f0c5b516269bb99ae8b5f479e49e61a3af76 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 6 16:12:36 2006 +0300 xkb: simplify core device loop in GetKeyboardByName commit 4b6e2f12f7296e17b2850f36b3adcf8156125cbe Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 6 16:08:21 2006 +0300 xkb: make LatchLockGroup work on all core-sending devices Apply the settings to all devices sending core events, if we're working on the core keyboard. commit ebf9b3bbbb04acb78cdf8a84e47a96755fbfe854 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Oct 6 14:17:59 2006 +0300 xkb: update all core-sending keyboards on GetKeyboardByName Update the keymaps of all keyboards which send core events on GetKeyboardByName; still a few other procedures which need this treatment. commit 1178796a4dff5ebf0bd9fb3cacb35be9709b41e5 Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Oct 5 22:31:35 2006 -0700 Add preferred modes for each output. Round vrefresh. Deliver crtc events. commit 23f6f08b7b5c9a4297fd223d232a7e9f45376550 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Oct 5 16:07:26 2006 -0400 Improve error handling, messages during initialization. commit de63a469dcd0a8ae98554bca540ac0106cccf2a5 Merge: 9c7440b 8382234 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Oct 5 20:29:19 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit b4659faf9b455b44ac8e691cc7a8fc00a967c80b Merge: c4f30c6 8382234 Author: Keith Packard <keithp@neko.keithp.com> Date: Wed Oct 4 14:46:04 2006 -0700 Merge branch 'master' into randr-1.2 commit df351f1efbcc95f94c719fcf993c480155c511e9 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Oct 4 16:23:35 2006 -0400 Experimental window property holding security context. commit c4f30c63538e1451f15ed1991439869127d9b148 Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Oct 3 21:06:11 2006 -0700 Add mode origins and output options. Fix memmoves in resource free funcs. Output options and mode origins both affected driver ABI. memmove mistakes were causing 'Freeing resource which isn't there' messages. Prune unused non-user defined modes from available list now. commit 8382234a7f318057de66490299d63807cefb5201 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Oct 3 17:49:48 2006 -0700 Update pci.ids to Tue 2006-10-03 daily snapshot commit 96edf7b853c1045d12d957a2957a11879100a2de Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Oct 3 17:48:50 2006 -0700 Don't insert RCS tag into generated pci id header files commit 75e0cc41b201b9ceb2615e7cec0dd5b4c136b343 Merge: 6926776 20c0cee Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Oct 3 13:58:03 2006 -0400 Merge branch 'my-XACE-modular' into my-XACE-SELINUX commit df800d87e04ce984a8a9ab4252ac6478ab1e4426 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Oct 2 11:28:47 2006 -0700 Add (void) casts to clear compiler errors about ?: results having type mismatch commit 9c7440bdf5a4ecd113e102004c804a2ba354c422 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 2 20:58:33 2006 +0300 xkb: remove the world's most staggeringly broken vendor workaround Certain versions of LynxOS needed to sleep up to five seconds for closing a pipe to actually, y'know, be useful. commit d7c89c7c1c8c1e110345d9d8d300adbf5fe5804a Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 2 02:15:36 2006 +0300 symlink-mesa.sh: expand *.{c,h} commit d6ea96b13e2ea01c51998c41ae2a3677bdedf61c Author: Ivan Pascal <pascal@info.tsu.ru> Date: Mon Oct 2 02:17:14 2006 +0300 xkb: fix wrapping when switching between groups Use XkbCharToInt as that's what we're doing. commit 3c98cebb6e954855528794fec46830f456cbdec1 Merge: fa1ac94 2cf1098 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 2 02:18:17 2006 +0300 Merge branch 'input-hotplug' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit fa1ac94178cf976d4c8dae9a4dc8703303a62d4b Author: Ivan Pascal <pascal@info.tsu.ru> Date: Mon Oct 2 02:17:14 2006 +0300 xkb: fix wrapping when switching between groups Use XkbCharToInt as that's what we're doing. commit c31672e6aab168262bd7824a8082ecdf841fc3c0 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Oct 2 02:15:36 2006 +0300 symlink-mesa.sh: expand *.{c,h} commit 2cf1098436d6b4382d9ed3f6b88214d37bdd8ddb Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Sep 30 17:05:46 2006 +0300 dix/events, mi/eq: remove utterly ridiculous debugging Remove debugging which can cause long-lived Xorg logs to grow well above 1GB if built with --enable-debug. commit 20c0ceedfbce9ae5c70703900b52973917ac4cd0 Merge: 49a70c8 84eb2c0 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 29 15:37:00 2006 -0400 Merge branch 'master' into my-XACE-modular commit 518db35ca3f569e7cb95dbddeddb93f3691de498 Merge: 5d99e05 84eb2c0 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Sep 29 00:35:21 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 5d99e05f05a42a82a9f02844df9bfebaa673759d Merge: ad631af 5893375 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Sep 29 00:35:07 2006 +0300 Merge branch 'input-hotplug' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit ad631afcf3fbc74024cddaaacd05d38addc047a2 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Sep 29 00:34:23 2006 +0300 make core keyboard/pointer map functions act on all core-sending devices Make Set{Keyboard,Modifier,Pointer}Mapping act on all devices which send core events. Change LegalModifier to accept a DeviceIntPtr. commit 84eb2c0a06de60e88e14bb03fabe661d7cd8f1d3 Author: Brian <brian@yutani.localnet.net> Date: Thu Sep 28 15:09:40 2006 -0600 Replace hard-coded filesnames with loops (all .c and .h files). Should fix problems with Mesa adding/removing source files, for the most part. Patch by Dan Nicholson. commit 4bc5dc2854e33bf343cdea44a3c3b4c41f6f4145 Merge: cf6e968 f9542e7 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Sep 28 13:27:13 2006 -0700 Merge branch 'wfb' commit f9542e749544c7a3084fd72ecc6642ca3262f7c7 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Sep 28 13:26:54 2006 -0700 Restore the global xx* symbols and add them to wfbrename.h. I don't think they're ever used, but it's best to just leave them alone for ABI compatibility. commit cf6e9687ffcc52af0d64e9098186570719a575a2 Author: Jeff Smith <whydoubt@yahoo.com> Date: Thu Sep 28 15:34:17 2006 -0400 Bug #8449: Yet another Mesa symlink script resync. commit a5d639cd87f30f9b3d765352d27253940f33b2b7 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Sep 27 16:15:27 2006 +0300 remove merge detritus commit 2206a92a97901977910a6e39b4174ca805f9f4a7 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Aug 30 19:15:55 2006 +0200 Push information about cliprects of DRI windows to the DRM. commit 54d371e7a4ebab79a0f616669e2f601d8370cef3 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Aug 30 19:12:17 2006 +0200 Add wrapper for new ioctl to update drawable information in the DRM. commit ad321fad4b9ab3a2c70cfff37ca6c8faaa5cce9c Merge: 5e9d33f f7c1d94 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Sep 24 17:56:43 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit f7c1d942416db8d0d4c5a21f5ece1ccacb926b69 Author: Brian <brian@yutani.localnet.net> Date: Sat Sep 23 10:38:10 2006 -0600 Check for visual==NULL in dmxBECreateColormap() before calling XCreateColormap() to prevent potential segfault. commit 945b7c63946f5257d0f9b0dcf2f8f4882fb2c6f8 Author: Brian <brian@yutani.localnet.net> Date: Sat Sep 23 10:35:25 2006 -0600 The fbcmap.c file used by Xdmx _must_ be compiled with XFree86Server defined. Otherwise, Xdmx generates a slew of protocol errors. commit 891e9c3e6cbd0869a57395b96c8e18ff522c2bb4 Author: Brian <brian@yutani.localnet.net> Date: Sat Sep 23 10:28:24 2006 -0600 Replace broken DMXDBG3() with DMXDBG2() commit a10039a100dfe5f87e29e9cc4fa656176e0890f9 Author: David Nusinow <dnusinow@debian.org> Date: Thu Sep 21 23:58:32 2006 -0400 Allow the xfree86 ddx utils to be optionally built. Patch by Eugene Konev. commit ce78b0cd2b1c35d60eb5683a1d00222aa4797c79 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 21 20:42:47 2006 -0400 Close with Pclose() that which we open with Popen(). commit c1655f0fd457f9bdf0857c5e0904639925bb01f1 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Sep 21 14:45:17 2006 -0700 Bug 8386: Grow parser buffers to fit an entire line if it's longer than CONFIG_BUF_LEN. commit b36fde9257263fa502147df37e8331184c323e14 Author: Keith Packard <keithp@guitar.keithp.com> Date: Thu Sep 21 09:52:04 2006 -0700 When no mode is specified, don't validate mode-specific parameters. commit 8b4ed47c5d39f219866e3c72fa973c6fc4c70f18 Author: Drew Parsons <dparsons@debian.org> Date: Thu Sep 21 22:19:44 2006 +1000 * Install Xprint's Xsession script to $(sysconfdir)/X11/Xsession.d * Removing outdated references to CDE and dt, rename script to 92xprint-xpserverlist. commit 219546fd76750f358ffb6738f17b9237c58c15a6 Author: Keith Packard <keithp@guitar.keithp.com> Date: Wed Sep 20 22:43:05 2006 -0700 Steal Xinerama code from SiS driver. Add missing files. Provide a Xinerama implementation when DIX version isn't enabled. This version exposes each crtc as a separate 'screen' and reports the size of that patch. The extension also sends ConfigureNotify events to the root window whenever crtcs change so that applications will re-fetch xinerama information. This actually works for metacity. commit bde0a4c12cb393a6d7f1552b067624da1b0502ae Author: Keith Packard <keithp@guitar.keithp.com> Date: Wed Sep 20 19:42:34 2006 -0700 RRSetCrtcConfig status fix. RRGetScreenResources timestamp fix. RRSetCrtcConfig was returning the wrong status values. RRGetScreenResources was always returning currentTime. commit d812f486a01a6276aed7b4ebd3cd8eb8ddfe10d3 Author: Donnie Berkholz <donnie@supernova.(none)> Date: Wed Sep 20 15:39:39 2006 -0700 Really fix sparc on 64-bit kernel/32-bit userland. Commit b3a3020fd018df8bc5a8193d36e1a1c7ae8af8ba used a sparc64 ifdef instead of sparc. But for 32-bit userland, __sparc64__ is not defined so the wrong code is used. commit 09f7499851bd2f2eba1e30460c61c7a82ed9e853 Author: Keith Packard <keithp@guitar.keithp.com> Date: Wed Sep 20 13:15:20 2006 -0700 typo commit 9f870e0aa1ada238d6a0cd099996e8c47f6ba1d9 Author: Keith Packard <keithp@guitar.keithp.com> Date: Wed Sep 20 13:14:53 2006 -0700 When setting output state, leave output unchanged when setting to current. commit d16e83413e7e06adebd629d04de57bbedd8c3765 Author: Aaron Plattner <aplattner@nvidia.com> Date: Wed Sep 20 12:47:17 2006 -0700 Hide or rename more global symbols to avoid clashes with libfb. Rename composeFunctions, xxSetup, and xxPrintVisuals. Hide the other xx* symbols by making them static. commit d08718d8fd31477e90f13b9e122504c515b46ee0 Author: Keith Packard <keithp@guitar.keithp.com> Date: Wed Sep 20 12:05:52 2006 -0700 Avoid calling xalloc(0). Change rrScreenSizeSet to rrScreenSetSize. commit ef1f3248cb5fff0a02c0059f865c4d931eba23a6 Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Sep 19 22:48:54 2006 -0700 Split out 1.0-style info and new property routines to their own files. commit 07112adb0802d28488de5a495aa61bb3cfc280b6 Author: Keith Packard <keithp@guitar.keithp.com> Date: Tue Sep 19 00:46:27 2006 -0700 RRGetScreenResources and RRGetOutputInfo are working now. Removed separate id field in RRModeRec. Pull screen subpixel order from Render extension. Implement RGetScreenResources and RRGetOutputInfo commit afe5e9483b352ed06075ed68a6ffa50799194e2d Author: Keith Packard <keithp@guitar.keithp.com> Date: Mon Sep 18 12:18:22 2006 -0700 RandR working with old clients and old API. commit 2be1ac15aee592782d7693b8de2c3815478a094e Author: Keith Packard <keithp@guitar.keithp.com> Date: Mon Sep 18 12:11:18 2006 -0700 Remove smashing of CFLAGS from server build. CFLAGS is a user variable, extracted from the environment at configure time and settable by the user at build time. We must not override this variable. commit bf07893947cfca945598e194ed416fda6162b11c Author: Keith Packard <keithp@neko.keithp.com> Date: Sun Sep 17 23:03:23 2006 -0700 Split out RandR dispatch code from randr.c to rr*dispatch.c. More disassembly to ease ongoing development. commit 3e745745fecef1cb59e53bde52ded311b51e1dac Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Sep 16 23:21:37 2006 -0700 Split RandR implementation into separate files. RandR is getting too big to live in one file; split into one file per object type (crtc, mode, screen), leaving the rest of the code in randr.c. Code is slowly approaching the point where it will drop-in as a replacement for the old 1.0 implementation. commit d17fb9672e238a089e463ac74cc4cd3325b67e1f Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Sep 16 21:44:42 2006 -0700 Start moving to new randr 1.2 definition commit 8dec74321d916f204f8182f1b93a65defbe50e78 Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Jul 17 14:43:07 2006 -0400 Successful legacy RandR API/Protocol emulation for query. These changes clean up minor errors to make it possible to list the available modes for a monitor using legacy APIs in both the X server DDX and RandR protocol. Setting modes is untested, so it probably doesn't work. commit cab3a0145f2483fe43b5db5f5dd2076db9757fe5 Author: Keith Packard <keithp@neko.keithp.com> Date: Mon Jul 17 01:21:11 2006 -0400 RandR: New data structure, old API. At least it compiles now commit d95c758630f4aacec339a7ec80d2c4a9d7de1e4a Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Jul 1 19:46:38 2006 -0700 Preliminary RandR 1.2 work commit f057de4f73fa593fa3fc5f05f65b89e76273b158 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Sat Sep 16 03:49:11 2006 -0400 Don't install librac.a. Thanks, automake. commit 6926776f0ecd1e8e81c5c40ccd3a97227bc44dcb Merge: 6950267 49a70c8 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 15 15:28:13 2006 -0400 Merge branch 'my-XACE-modular' into my-XACE-SELINUX commit 49a70c8570b03aff8239324a2474918a6fbc52a0 Merge: d1110c5 05231e3 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 15 15:26:57 2006 -0400 Merge branch 'master' into my-XACE-modular commit 46af6d1e953f1eefb6edbba3d29fb9700e42c2bb Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:28:44 2006 -0400 Always believe the monitor when it reports a reduced-blanking mode. CVT reduced blanking modes are typically only seen on digital connections to LCDs, but there are some monitors that report them as supported over the VGA connector too, which is perfectly legitimate, electrically speaking. commit 63acf18b7e4ce3a9f7deab3a9088a1c41cab0191 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:26:37 2006 -0400 In xf86MatchPciInstances, fail gracefully when there's no PCI device at all. This allows the autoconfig logic to fall through sanely on non-PCI machines, which importantly includes Xen virtual machines. commit a8f9936f55c5364bb02e8c3187507eb1f70e2ef2 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:24:41 2006 -0400 Prefer driver-provided modes when matching name strings to modelines. Well, kinda. Strictly we prefer M_T_BUILTIN strongest since those are modes where the driver has said it absolutely can't do anything else (VBE). Then we look for user-defined modes, ie, modelines from the config file. Then we consider modes reported by the monitor via EDID. Finally if nothing has matched yet we consider the default mode pool. Within each of the above-mentioned classes, modes with the M_T_PREFERRED bit take priority over other modes in the same class. This logic ensures that the timings sent to the monitor exactly match the timings it reported as supported, which occasionally don't match the numbers you might get for that mode from CVT or GTF. commit 81ef1b6d6063c20db4963abf7b7848e235aa4ebb Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:18:58 2006 -0400 Mark EDID modes as driver modes. Infer virtual size from driver modes. This allows the server to guess an appropriate initial virtual size and resolution. The heuristic is to select the largest driver-reported mode that matches the monitor's physical aspect ratio. We revalidate this estimate after mode validation, since we may have filtered away all modes that would fill that size. Also, the EDID preferred timing is now marked as M_T_PREFERRED as well. commit 43d9edd31e31b33b9da4a50d8ab05004881c8d5a Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:09:02 2006 -0400 Attempt to add the 'mouse' driver in more situations. Always add a mouse driver instance configured to send core events, unless a core pointer already exists using either the mouse or void drivers. This handles the laptop case where the config file only specifies, say, synaptics, which causes the touchpad to work but not the pointing stick. We don't double-instantiate the mouse driver to avoid the mouse moving twice as fast, and we skip this logic when the user asked for a void core pointer since that probably means they want to run with no pointer at all. commit 739224d05eb4f356c9cab9dcb8a44a8d78287765 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:03:32 2006 -0400 Load the default module set when no Module section is given in the config. Also, synchronize that list with the list for the pseudoconfig file used when starting with no config file. These really need to be better unified. commit beac2bf1e48e6b77dbf7d95f086abc5abcd90cf0 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:01:13 2006 -0400 Expand the default sync ranges to be large enough for 800x600@60. commit 71a15a7d5721073eccb3a275f353b3aa584c0d68 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 19:00:10 2006 -0400 Publish the raw EDID block as a property on the root window. This was removed in the patch for bug #5386, but is still useful. commit 7939c8dfb7c7bed4febcdc12922fb2e17619ea36 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 18:57:57 2006 -0400 Bump the default pixel depth to 24, and default bpp to 32. commit 72af975f9c8de0ff6796f1ce4b76dcf841d21e99 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 18:56:34 2006 -0400 Fix up EDID blocks where the max pixclock exceeds the preferred mode clock. Base EDID only lets you specify the maximum dotclock in tens of MHz, which is too fuzzy for some monitors. 1600x1200@60 is just over 160MHz, but if the monitor really can't handle any mode at 170MHz, then 160 is more correct. Fix up the EDID block before the driver can see it in this case, so we don't spuriously reject modes. commit d05e0a97bb704a4986cf638487205da759c4ce17 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 18:49:12 2006 -0400 Enable DPMS by default. commit 334f7db9f653113d5d46236911d7de2ec4173f28 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 18:46:10 2006 -0400 Allow hsync and vsync ranges to be overridden independently again. commit ced46e17777b635df9371c4cfaec3f8968b4dbcf Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 18:41:59 2006 -0400 Record all standard timings from EDID as modes, instead of just the first five. commit d89fee68d0e49211871cd9eb3893ed55c1d478a6 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 18:41:15 2006 -0400 Record the maximum dot clock of the monitor, and filter by it. commit fa8ef7166839a7435e0017683f3e3c7f7904b285 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Sep 14 18:33:00 2006 -0400 Don't translate monitor gamma to X gamma. The X gamma is used to set the output ramp of the card. Setting a 2.2 output gamma going into a 2.2 monitor gives an effective gamma of 4.84, which is very much not what you want. commit 511c60bc7399b07c267d686a969880e5ec92408a Author: Luc Verhaegen <libv@skynet.be> Date: Thu Sep 14 18:30:36 2006 -0400 Bug #5386: Synthesize modelines from EDID data. commit 05231e336db8f959c15dda518641976f061df1a6 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Sep 14 14:13:39 2006 -0700 Use correct opcodes for GLX_EXT_texture_from_pixmap. Regenerate from glX_API.xml 1.3 from Mesa. The glproto package and libGL (from Mesa) must also be updated. commit 0a62840e2ce25e5c2554e7e5ab4c9c5b96899e2d Author: Bill Nottingham <notting@redhat.com> Date: Wed Sep 13 15:40:23 2006 -0700 Bug 7641: fix comment written to Xorg.conf (s/VertSync/VertRefresh/) X.Org Bugzilla #7641 <https://bugs.freedesktop.org/show_bug.cgi?id=7641> Patch #6349 <https://bugs.freedesktop.org/attachment.cgi?id=6349> commit 182e5e0f4ba4c98a34bc52bdf4032ba315fe80ad Author: Drew Parsons <dparsons@debian.org> Date: Tue Sep 12 14:30:46 2006 +1000 Xprint: revert installation of /etc/X11/Xsession.d/cde_xsessiond_xprint.sh pending resolution of #8232. commit 594d4019c613b0f4bf8f48cc074ecc3c8366f1d7 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Tue Sep 12 01:15:40 2006 +0200 transformIsIdentity() now doesn't accept a zero matrix as the identity. Added a non-zero test for one of the diagonal values. commit fc30370d14125f86ee1192890a184881fa139546 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Mon Sep 11 19:43:09 2006 +0200 Bug #8226: Fixed SetPictureTransform()'s handling of the argument matrix. It now recognizes scaled variants of the identity matrix, too. commit 2b357e9a2f9038cf9cd07da908e3103a3d0965c9 Author: Donnie Berkholz <dberkholz@gentoo.org> Date: Sun Sep 10 22:17:20 2006 -0700 If we're installing libxf86config, install headers needed to build against it. commit 58933757862c458e2da39bd464e50d9c0e41b313 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Sun Sep 10 15:50:51 2006 -0400 Warning fix, and a syntax fix in a #if 0 section of code. commit 0a3740a0000191e3039fe183ae51b938d0548340 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Sun Sep 10 15:49:25 2006 -0400 Typo correction, 'i' is not a '1', so no longer crash on some Xi requests. commit 8d709f0280b458515b32c2b87938749428e5c149 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Sun Sep 10 15:48:35 2006 -0400 Remove a merge artifact so that we can compile. commit b3a3020fd018df8bc5a8193d36e1a1c7ae8af8ba Author: Jesse Barnes <jbarnes@nietzche.virtuousgeek.org> Date: Sun Sep 10 11:13:18 2006 -0700 the new PCI mapping routines are broken on sparc64 (in fact they look broken for any 32 bit X server running on a 64 bit kernel) so #ifdef them out for now. the PCI rework tree will make all this crap go away, so I think we can tolerate the extra #ifdef for the next release. commit 60db190ecfce52cbfa888c0af3210634f9186bed Merge: 5e9d33f 6525610 Author: Zephaniah E. Hull <warp@agamemnon.b5> Date: Sun Sep 10 03:49:17 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 65256109bb8f5a26704ed960e1dd113981df5787 Author: Drew Parsons <dparsons@debian.org> Date: Sun Sep 10 17:40:37 2006 +1000 * Define XPSERVERLIST with `/etc/init.d/xprint get_xpserverlist` instead of `/bin/sh /etc/init.d/xprint get_xpserverlist` - allows the initscript to set its own different shell under #! - allows disabling of XPSERVERLIST by making the script non-executable * Allow files to be installed by using dist_*_DATA instead of EXTRA_DIST. Also, use dist_*_SCRIPTS to install scripts. * Fix minor typos in man pages. commit 6950267dd690ef8e29b1c32a157dd64c9b79c06d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:31:18 2006 -0400 Add SELinux extension configure-time support. commit fb34c02861ab3629c1c85c156e73b158518db7c7 Merge: 9c503f0 d1110c5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:30:12 2006 -0400 Merge branch 'my-XACE-modular' into my-XACE-SELINUX commit d1110c5c83a7f439158f369ab2f3ae614fa9d2a5 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:28:48 2006 -0400 Generalize the handling of configuration files that ship with extensions. commit 9deb579dc9366590203afe0576bf88643ab36c89 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:25:17 2006 -0400 Zero out newly created ExtensionEntry structures, but only after the devPrivates have been initialized. commit cec392656cda1c938d5462e1949e6eef489f9168 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:24:23 2006 -0400 Zero out newly allocated ClientRec structures. This is required to initialize the devPrivates to a known state. commit 0fba09cdfcc78161f5c92bef6cca53e5309656bd Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:23:06 2006 -0400 Include dix-config.h. commit c93877100eb98647c5b6b8556730d54677f730b6 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:21:57 2006 -0400 Don't need to allocate memory now that devPrivates are being used. commit 9c503f09ce78d952d0ece77c424e42b6df3fa9ad Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:17:01 2006 -0400 Add SELinux extension to the module/extension loader. commit 9aa44e3e4c321f42d8e64f83c7f0932470593c26 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:15:19 2006 -0400 Add SELinux extension configure-time support. commit 150eabc4c8a08c81c48493583f922a1240b7e91c Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Sep 8 15:11:04 2006 -0400 Add SELinux extension source files. commit 86450998da616e3d00d4d6293acc35eccc2061e7 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Sep 7 15:35:16 2006 -0400 Fix AIGLX VT switching. See https://bugs.freedesktop.org/show_bug.cgi?id=7916 There may be a simpler, less intrusive fix that involves just rearranging DRI locking between 2D and 3D drivers around VT switch. commit 5e9d33fe87f9d24e55c468d4b2bb761c9efdb26a Merge: 629798c 64479ff Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Sep 7 15:43:31 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 629798c73ad76a77fa6a55bc6403fd9b95ade2bb Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Sep 7 15:17:04 2006 +0300 XkbCopyKeymap/SrvXkbCopyKeymap: free geom harder, add cheery comments Unconditionally free geometry when copying the keymap (so we have none on core, oh well), add a couple of heartening comments. commit 64479fffa22581cc7d753065c33eda5520b7db9a Author: Ian Romanick <idr@us.ibm.com> Date: Wed Sep 6 16:13:21 2006 -0700 Remove prototypes and externs for non-existant functions and variables. commit a0179281a6522ec59830e8f2549633741bc56e10 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Sep 6 15:45:48 2006 -0700 Remove prototypes for non-existant functions. commit 8356be492c6b46abdffa08b13836571ed872e16f Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Sep 6 15:20:55 2006 +0200 Make sure _XSERVER64 is defined when it should be and gets tested. commit f6ce0839ba5b73247097826d28f7388fe248ec0c Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Sep 6 13:18:02 2006 +0200 Fix #include paths for fontcacheproto headers. commit f39fd4242902eaa862321d39337f429dd14ebacf Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Sep 5 15:23:54 2006 -0700 (unsigned long)(1 << 31) = bad news on x86_64. (cherry picked from 410e5b1d738ba47b36778e6cbed44023a27ce259 commit) commit 410e5b1d738ba47b36778e6cbed44023a27ce259 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Sep 5 15:23:54 2006 -0700 (unsigned long)(1 << 31) = bad news on x86_64. commit 0b81fccd2ee4e054e5cffb739de07460ff2c13f7 Merge: 20c4ac6 c281351 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Tue Sep 5 18:03:25 2006 -0400 Merge branch 'master' into my-XACE-modular Conflicts: configure.ac commit c2813514cf7b1a36caa848cbc2ceef99cf2eb769 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Aug 31 15:36:13 2006 -0700 Add missing file from previous commit. commit 0f9cfb2f752a9010ff07f4b2bd891db0cc30b8e6 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Aug 31 13:54:10 2006 -0700 Implement GLX_SGI_swap_control. Regenerate from glX_API.xml 1.2. Add infrastructure to support GLX_SGI_swap_control for AIGLX when the DRI driver enables it. Tested with R300. commit a9ef5862919313582f72fc0cfb5ab0af4df6507e Author: Ian Romanick <idr@us.ibm.com> Date: Thu Aug 31 13:47:50 2006 -0700 Fix problems with vertex program protocol There were two sets of bugs in the vertex program (ARB and NV) protocol. First, several of the ARB functions were missing the 'doubles_in_order="true"' annotation. Second, after the ARB decided that glVertexAttrib*ARB functions must not alias fixed-function state for GLSL, Nvidia re-assigned GLX protocol opcodes for glVertexAttrib*NV (circa Septeber 2004). For some reason gl_API.xml was never updated to reflect this, and the updated version of the GL_NV_vertex_program spec never made into the registry. This is just a server-side regeneration from gl_API.xml version 1.68. commit 69d5becce4ca2cfc8f8de53672ed54a47de62164 Author: Matthew Allum <mallum@openedhand.com> Date: Thu Aug 31 17:30:24 2006 +0100 Fix previous commit breaking other kdrives pulling in fbdev.a commit fd609956f27d76ee76ac8623787f0fc8633a5546 Author: Matthew Allum <mallum@openedhand.com> Date: Thu Aug 31 17:18:57 2006 +0100 Add framebuffer device command line switch for Xfbdev commit 2fb7b8795a9a36cce61f6449f6ca26ffd1b071f0 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Aug 29 16:35:32 2006 -0700 Minor extension tweaks. GLX_EXT_texture_from_pixmap should always be enabled. GLX_SGI_video_sync is only for direct rendering and should never appear in the server's string. commit 1c8851ad491dd02d1c79e620b46384956838ed42 Merge: d59b52f 5ddbf4b Author: Ian Romanick <idr@us.ibm.com> Date: Tue Aug 29 16:34:04 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit d59b52fc08f2d80b38993e383e61c3eeb0bb0763 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Aug 29 14:40:13 2006 -0700 Make sure unsupported extensions are disabled. GLX protocol isn't supported for GLX_SGI_swap_control or GLX_SGI_video_sync. Remove them from the list of available extensions until they are supported. commit db6d04d4b87fd9b6409a3ddf0479a88440c2eda1 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Aug 29 14:35:08 2006 -0700 Add support for AIGLX drivers to enable GLX extensions that they support. commit 5ddbf4bcd46fe0d3d682668c2748c712fea410ae Author: Matthew Allum <mallum@openedhand.com> Date: Tue Aug 29 22:07:15 2006 +0100 Re-add support for tslib (1.0 release) and Xcalibrate extension. commit 4524a2bf6f22c871ed109b027a065f0262137dc5 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 29 23:49:26 2006 +0300 configure.ac: move tslib from KDRIVE_PURE_LIBS to KDRIVE_LIBS Yeah. That was dumb. commit 942b4369990a255257f66835caf8671432c405a3 Merge: 77d315b 393dc0a Author: Ian Romanick <idr@us.ibm.com> Date: Tue Aug 29 13:30:37 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 77d315bd2fd2f9014c831d313efbe5821189177c Author: Ian Romanick <idr@us.ibm.com> Date: Tue Aug 29 13:30:20 2006 -0700 Remove __glXNoSuchRenderOpcode because it is no longer used. commit 260c3f32b69c98f8fc5360f860f69d32c19f04a7 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 29 23:18:12 2006 +0300 configure.ac: fix XSDL test commit 393dc0a3388d56186181b2bd9bcc1d267747e709 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 29 22:53:54 2006 +0300 kdrive: remove @KDRIVE_LIBS@ from Xfoo_DEPENDENCIES commit cff23616fe45e10c6786a303c8dcfc0a80463a53 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 29 22:44:09 2006 +0300 configure.ac: allow disabling of XSDL commit 89d272bb183e85715d8e6047929fb2d912033d82 Author: Daniel Stone <daniel.stone@nokia.com> Date: Tue Aug 29 15:05:31 2006 +0300 [PATCH] kdrive/linux keyboard: remove more debugging spew commit bd6f539ff9409aa7d9056fabe120b457b0a15997 Author: Daniel Stone <daniel.stone@nokia.com> Date: Tue Aug 29 13:21:58 2006 +0300 [PATCH] kdrive/linux keyboard: silence excessive debugging noise commit 5436fce09003e20744a388fa4ae49007c9cf8ede Author: Daniel Stone <daniel.stone@nokia.com> Date: Tue Aug 29 13:21:40 2006 +0300 [PATCH] GetKeyboardValutorEvents: be even more careful Don't accept devices without a keyboard feedback class. commit 0eb7299f445455a7bcacf2410e83227b23259675 Author: Daniel Stone <daniel.stone@nokia.com> Date: Tue Aug 29 13:19:12 2006 +0300 [PATCH] XkbCopyKeymap: still more range fixes Make sure we don't stomp preserve if it doesn't already exist, and fix a couple of range-related thinkos in level name copying. commit 7fa3383e3c8eea7d1eb0e556393f2431cf8e6ed2 Merge: 8d77d44 ebbdc13 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 29 15:16:01 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit ebbdc1342a243b301723390696f742dc91f59764 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Mon Aug 28 18:17:32 2006 -0400 Remove calls to LoaderCheckUnresolved(), since it's now a stub. commit 8d77d44fda3aacbae62864a3620e09095b79e92d Merge: d6f36bd 2fde560 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 27 23:08:49 2006 +0300 Merge branch 'origin' into input-hotplug commit 20c4ac6e038607ebbf6c04639670514c016d8597 Merge: 13c6713 8d4f21a Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Aug 25 18:49:46 2006 -0400 Merge branch 'my-XACE-SELINUX' into my-XACE-modular commit 13c6713c82763a85c725c998b37ad02156d803ba Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Fri Aug 25 18:17:01 2006 -0400 Add four new XACE hooks: auditing, key event notification, window init commit 2fde560bbb9c1148f26fd969dc30c4e736672b7c Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Aug 25 13:01:51 2006 -0700 Enable GL_EXT_texture_filter_anisotropic and GL_EXT_blend_equation_separate. Re-generate from gl_API.xml 1.65. This provides the missing bits for GL_EXT_texture_filter_anisotropic and GL_EXT_blend_equation_separate. Enable those extensions. commit e2d529963ed40b5f113cf82c17809d241cd4aac1 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Aug 25 12:05:16 2006 -0700 Enable vertex and fragment programs. Implement glGetProgramStringARB and glGetProgramStringNV. With these functions implemented, GL_ARB_{vertex,fragment}_program, GL_NV_{vertex,fragment}_program, and related extensions can be enabled. commit 21291d6ca7188e5733ed0c93215ee0f1f0f90cc9 Merge: 1a5561c cd2da4e Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Aug 25 09:34:21 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit d6f36bd28009881ef7f7a20cdadb3808d808ed97 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 25 12:43:17 2006 +0300 xfree86/parser: use 'kbd' driver when 'keyboard' specified Now that we've completely ditched the old driver, we should probably make a best-effort attempt to keep configs working. commit 7c4167f0d6b33c9c602b04fcfd246fd3aeddd709 Merge: 393f834 cd2da4e Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 25 11:15:33 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 393f8347edcccfc24d8902a86ea9def7ada2537b Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 25 10:46:32 2006 +0300 xorgconf.cpp: kbd, not keyboard commit c33e39c86be2010b169ffbd8adbe53b93222dc5f Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Aug 24 20:33:57 2006 -0700 Finish support for GL_ARB_texture_compression. Fill in __glXDisp_GetCompressedTexImageARB and __glXDispSwap_GetCompressedTexImageARB to finish support for GL_ARB_texture_compression. With this extension (and the related compression extensions), the server-side GLX supports all of the protocol for GL 1.4. w00t! The bad news is that this has received only minimal testing, and Mesa does not contain any good tests for GL_ARB_texture_compression. commit cd2da4e41eae233b50f8830d9a8f5d1d916a5a1b Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Aug 24 18:00:16 2006 -0700 Remove GL/glx/g_disptab.c, GL/glx/g_disptab_EXT.c, and GL/glx/g_disptab_EXT.h. Unfortunately GL/glx/g_disptab.h has to be kept around a bit longer. commit a29e6dd2d2d45c18c52737bb3b7945aafcea5032 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Aug 24 17:58:52 2006 -0700 Add some missing bits of GL_SGI_color_table. commit ae608b2071d882966e9c7ede71f846b1ecec0b23 Merge: 2c86527 b879356 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Aug 24 14:56:33 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 2c865277fe1d056981d1020e1af001d2319252c0 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Aug 24 14:54:49 2006 -0700 Regenerate from gl_API.xml 1.63. Enable extensions. gl_API.xml 1.63 corrects some problems with GLX protocol for GL_EXT_paletted_texture and GL_SGI_color_table. Regenerate from that file, and enable those extensions and GL_EXT_shared_texture_palette. commit 7d5de5c6657304246473d7ddd5c29bb0c7a3bc34 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Aug 24 14:49:46 2006 -0700 Regenerate from gl_API.xml 1.62. Functions move, no real changes. commit 3a36b0a24aa9e9e238faa7f00100f59800f5142b Merge: db1ab1b b879356 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 24 23:35:28 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit db1ab1bdb2f79eca593fe247056309a16ebd29c6 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 24 23:33:59 2006 +0300 XkbCopyKeymap: fix various range issues Fix a bunch of range issues caused by incorrect assumptions (e.g. that the design was at least halfway sensible), and copy types by hand, instead of just blindly memcpy()ing the lot, since it itself cleverly contains a ton of allocated pointers. commit 5fb8d947bb88d715b9b236342885c445cb5a9387 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 24 23:16:43 2006 +0300 configure.ac: more thinkos Fix auto tests for vidmode and xf86dga. I win at life. commit 4e37c07ba6e5d299d4f8922dc6cf054c814f7baf Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 24 23:16:17 2006 +0300 config: clean up debugging messages, make failure to acquire name fatal Bomb with FatalError when we can't acquire the bus and name. Clean up a bunch of debugging ErrorFs to be hidden behind #ifdef DEBUG. commit b879356ce96929d02bcb75b9aa24b17ac7e28125 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Aug 24 15:50:15 2006 -0400 More #ifdef USE_DEPRECATED_KEYBOARD_DRIVER. commit 4ed311cf1c29090c53e474a3001c5702ff8409df Merge: 73e58ad b29b236 Author: Matthias Hopf <mhopf@suse.de> Date: Thu Aug 24 20:17:10 2006 +0200 Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver commit b29b236d88789fd45d823a55dbedb393bb134c5b Author: Lukáš Turek <8an@centrum.cz> Date: Thu Aug 24 15:57:09 2006 +0200 Adapt to Mesa header name change. commit ce4a0a4ddafd3833d7025f83ed3729915c8aba70 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Aug 24 13:56:22 2006 +0100 Apply patch in bug #7919, blit improvements in multiwindow mode for Xming/CygwinX commit 866ca1f929c95689bac9f0a0b3478f7b4d77214b Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 24 15:46:44 2006 +0300 configure.ac: fix XF86VidMode test commit 2b06c69c8feaf3bdc065635ee711efa45b3033b3 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 24 14:51:26 2006 +0300 GKVE: pass correct arguments to XkbCopyKeymap Fix horrendous thinko. Indicators now work perfectly. commit 4adf9af313c9f63b6ad734e174efe1d36ddb5813 Merge: 33af05d 67bd672 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 24 10:59:33 2006 +0300 Merge branch 'master' into input-hotplug commit 67bd672c880869ef625ae0c0163c3ec1eba46abf Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Aug 24 08:47:06 2006 +0100 Fix typo commit 733c4beb16c2c4ad9e9a4ea9a85b09fc5062a775 Author: David Nusinow <dnusinow@debian.org> Date: Wed Aug 23 22:39:42 2006 +0000 Add xorg.conf IgnoreABI option which does the same thing as -ignoreABI commit b983773d446cef6a0948ca264ed48126e404ae9a Merge: 0623d36 d9a8656 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 17:16:50 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 0623d3643fc28ebc514b2ca872c985d0cf0c753a Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 17:16:02 2006 -0700 Fix the sorting of the extension string. Add a few extensions that are supported by the new code. A few of these were actually supported before but weren't advertised. commit 5d2caacff570dd68bb3fb05e776e02515b2a9da0 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 16:47:00 2006 -0700 Refector __glXDisp_Render and __glXDispSwap_Render to DoRender. Refector __glXDisp_RenderLarge and __glXDispSwap_RenderLarge to DoRenderLarge. commit 866bb3f34046045c9fa0744db1d76e035b3da9c7 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 16:41:53 2006 -0700 Memo to myself: Whenever a Makefile.am changes, autogen.sh must be re-run. This is especially true if the change is to remove a source file. Fix RenderLarge to actually use the new protocol decode tables. commit d9a86566c21afd7985673f3ed851b055d9dac46f Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Aug 23 16:15:19 2006 -0700 Add LOCALCONN to dix-config.h template for xtrans commit f6fd7d8f8393f93705e76b2b2777a0d9bcafa991 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 16:05:37 2006 -0700 Convert protocol decode tabels for Render and RenderLarge to use nice, compact N-way search trees generated by scripts in Mesa. commit 7ae82b5fc8721be78b43a322bbf2c46aac08b8cf Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 16:00:48 2006 -0700 Fix __glXDispatchInfo::dispatch_functions and __glXDispatchInfo::size_table. dispatch_functions had the const in the wrong place, and size_table was declared as an array of two pointers to int_fast16_t instead of a pointer to an array of 2 int_fast16_t. cdecl to the rescue! commit 39a620d17809dc71fb5ad61a955fe3c442f90a05 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 14:24:34 2006 -0700 Rename __glXDrawArraysSize to __glXDrawArraysReqSize. This makes its name match the pattern of all the other functions in __glXRenderSizeTable. commit 86406455f0e5fc977431948611e9bb5fda1e1d46 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 13:30:59 2006 -0700 Re-generated files after a fix to glX_API.xml (in Mesa). commit d7a7f12361d31001bbd9394a57de029ef0b934b8 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 23 13:30:13 2006 -0700 Convert protocol decode tables for Single, VendorPrivate, and VendorPrivateWithReply message to use nice, compact N-way search trees generated by scripts in Mesa. The Render protocol decode tables are next... commit bdec9680fa74dd23cf319d09af1940f8cf71a5b1 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Aug 23 14:43:23 2006 -0400 Make sure Composite is never enabled for Xnest. commit 9f2a108051aad9b024ab737b45fc12290a113e37 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Aug 23 14:38:34 2006 -0400 Make 'Xvfb -render' also disable Composite, lest we segfault on startup. commit 33af05d58f1f4f021036e9ce4b60fd76dbaebe73 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 23 19:05:50 2006 +0300 XkbCopyKeymap: use correct range for MapNotify We haven't copied {min,max}_key_code by the time the notifies run, so use src instead of dst to determine number of keys, et al. commit 6323a11d0db4d3cf0317af83f0362730142f5325 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 23 18:53:04 2006 +0300 XkbCopyKeymap: optionally send NewKeyboardNotify/MapNotify events Optionally send a NewKeyboardNotify or MapNotify event when copying the keymap; modify GetKeyboardValuatorEvents to make use of this. commit 728fbadd16a748b45c80bc2c65c46f82cf803578 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 23 14:33:59 2006 +0300 gitignore: ignore vi swap files commit 8f8487ff997670a4af0293fed77ff920cfc39fb1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 23 14:33:41 2006 +0300 xkb/gkve: copy XKB map, not pointer-assign Write a new function to copy an XKB map (does everything but geometry at the moment), and use that instead of nasty pointer assignments. commit 52ba722e4c89c052609b4fc62e965d92778aa2dd Merge: 9138d5a 0554125 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Mon Aug 21 18:49:31 2006 -0400 Merge branch 'XACE-modular' into my-XACE-modular commit 05541259bdb0dfaab015a01caa3722b7a1b782e2 Merge: c2535f6 a1ac044 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Aug 21 13:07:41 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into XACE-modular commit a56b98bb047003a05e26ca9365c212a2da7ac200 Author: Daniel Stone <daniel.stone@nokia.com> Date: Fri Aug 18 18:03:41 2006 +0300 dix: enable null root cursor Enable a blank root cursor, selectable with --enable-null-root-cursor at configure time. commit 0704bb298cc826cd117815898c6bc015a693c2c9 Merge: c140369 a1ac044 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 18 17:30:14 2006 +0300 Merge branch 'master' into input-hotplug commit a1ac0440bba690368aa4226468ce571be1a09d95 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 18 17:30:00 2006 +0300 dix: fix whiteroot thinko Note to self: run git update-index _after_ testing, not just before. commit c14036977fef7b8787c0b68f5262fa0b6a2834f5 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 18 17:24:34 2006 +0300 input.h: add InitCoreDevices prototype commit 1c2cb30cd88ba4453f9da339025f8ff39f7f5412 Merge: 633b6a6 70ddd0f Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 18 17:05:50 2006 +0300 Merge branch 'origin' into input-hotplug commit 19f673b7788d32c220e7e06734f1074b0e4a999c Merge: cb0a565 70ddd0f Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 18 17:05:41 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit cb0a565d2b2cf8823abbd77b4426cc2237731dc1 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 18 17:04:48 2006 +0300 dix: add whiteroot flag Add a -wr option to use a white root window, and use a BackPixel rather than BackPixmap for both white and black root windows. commit 70ddd0f39d5118db72a1a4e473cbfb502f1ed9ec Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Aug 18 14:43:10 2006 +0100 Fix bug #5735, Serious flaw in CygwinX clipboard integration prevents paste from X to Windows apps (Brett Stahlman & Colin Harrison) commit 708b225689b5a4ba9ffe3372b584b715ef9eacdc Merge: e1f4565 ee5e2cb Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Aug 18 09:13:52 2006 +0100 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit e1f4565be5ce80be4655e81f77f4073fa3fbf8d0 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Aug 18 09:11:48 2006 +0100 Fix bug #7302, make Xn.hosts work from the Microsoft Windows install directory on Xming. (Colin Harrison) commit 1880defe4eaba02f9585b154d0883235eabc6d11 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Aug 18 09:09:53 2006 +0100 Fix bug #7281, clipboard viewer should not call SetClipboard viewer when bogus in Xming/CygwinX (Colin Harrison) commit a1a8e4f7f5917f537eb3dd51d3d6fa3e129236ce Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Aug 18 09:08:12 2006 +0100 Fix bug #7280, round title corner background should be transparent not black in Xming/CygwinX (Colin Harrison) commit ee5e2cbd2bee610a95facc6b486c4a5070973099 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Aug 17 17:29:32 2006 -0400 Un-cut-and-paste the mode rejection message. commit 43e42eef1f5a22703eb64fc9cffecde036ea38e0 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Aug 17 16:22:07 2006 -0400 Fix default mouse device on Linux, again. It would be really nice if we only did this in one place instead of 40. commit 633b6a69f560c0a77dcff78fdef5fcf0041e2e04 Merge: 95dbfcf 7da5144 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 17 21:25:14 2006 +0300 Merge branch 'master' into input-hotplug commit 7da51447eaab34292e14077fb5a48e6b2e587781 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 17 21:24:07 2006 +0300 events.c: fix tiny XEvIE thinko Make sure xeviehot gets updated after the ConfineToShape() call. commit 5d082f05632906c29296a44ef5c3a4962c0cbe62 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 17 21:18:18 2006 +0300 events.c: make XEvIE a little less verbose Change a lot of: #ifdef XEVIE xeviehot.x = #endif sprite.hot.x = ... #ifdef XEVIE xeviehot.y = #endif sprite.hot.y = ... to one single #ifdef XEVIE xeviehot.x = sprite.hot.x; xeviehot.y = sprite.hot.y; #endif at the end of the functions. commit 95dbfcf8828c041c218145afc87d21a6c9c7bc02 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 17 21:18:18 2006 +0300 events.c: make XEvIE a little less verbose Change a lot of: #ifdef XEVIE xeviehot.x = #endif sprite.hot.x = ... #ifdef XEVIE xeviehot.y = #endif sprite.hot.y = ... to one single #ifdef XEVIE xeviehot.x = sprite.hot.x; xeviehot.y = sprite.hot.y; #endif at the end of the functions. commit c6c39afde3e5f43b623ca6b52162b83c98a28d45 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 17 21:13:09 2006 +0300 dix/events.c: add YAFIXME Add another FIXME to the cacaphony of XXX and FIXMEs in this file. commit f9624e0109cf12b6af43fb4235aaa0b54340a4bb Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 17 16:09:51 2006 +0300 kdrive/input: verify SIGIO with --enable-debug commit 73e58adda96c1d1b5176d819107faa7697c3eb94 Author: Matthias Hopf <mhopf@suse.de> Date: Wed Aug 16 18:17:58 2006 +0200 Fixed segfault w/ broken Xinerama configs. commit cd3f744b1f983f71476db99c050045d981c5f5b2 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 15 15:54:13 2006 +0300 fix missing brace, trim unused variables commit 5d073697adb3864133fa3221b82ab8d2f4a59758 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 15 15:37:10 2006 +0300 kdrive/input: minor warning cleanups And also a compiler error fix when VERIFY_SIGIO is defined. commit 47c1c948e69cfba950ad37a3133fa2db0bd0ff2c Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 15 15:25:16 2006 +0300 kdrive/input: only run special key behaviours on non-XKB Only attempt to manually deal with special key behaviours (e.g. terminating the server) when not using XKB, and leave locking behaviour up to GKVE. commit 34228d8b280ef105a0c60b8de5dacf70a5ce24b5 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 15 15:23:53 2006 +0300 GPE: fix absolute button events / GKVE: (non-XKB) don't repeat lock keys Fix absolute button events in GPE, where we would previously send valuator events without bumping numEvents accordingly, causing the core event to go missing. In the non-XKB path in GKVE, implement proper lock behaviour (one press to enable, one press to disable, discard releases). Fix debug_events prototype. commit d003bada3352ec7d734498c4c732904876a9d1e2 Merge: d6433be a815b9b Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 22:48:55 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit a815b9b990e068f02d9cbba2b17f2cc3a30a9310 Merge: 37943e2 984babe Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Aug 12 21:58:33 2006 +0300 Merge branch 'master' of git+ssh://gsap7@git.freedesktop.org/git/xorg/xserver commit d6433be3cca807dd78fbb1f45d9ba0212283083d Merge: 2bf9e3d 984babe Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 21:50:52 2006 +0300 Merge branch 'master' into input-hotplug commit 2bf9e3dc1ec5fd7bf84a4a96899e5663a721d4a4 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 21:50:39 2006 +0300 make DIX more tolerant of devices without a CtrlProc (Debian #269860) Return BadDevice on client requests for devices without a CtrlProc, instead of tanking horribly. commit 984babe86bf82002b4d6589b2750c7b5a5489bd5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 21:43:38 2006 +0300 remove obsolete vendor defines Remove random behaviour changes for SGI and MetroLink. commit 37943e2f1abc6709ff739000372b0394d5cd18c5 Author: George Sapountzis <gsap7@yahoo.gr> Date: Sat Aug 12 20:54:33 2006 +0300 Call exaTryComponentAlphaHelper() for solid src also. Also, rename to exaTryMagicTwoPassCompositeHelper() as it is now called for non-component-alpha masks also, and add function description from http://anholt.livejournal.com/32058.html. commit f7919c287936f55569c2301ebb1b5f52358e70fa Author: Bastian Blank <waldi@debian.org> Date: Sat Aug 12 20:43:25 2006 +0300 xfree86: don't do legacy IO on ARM or S/390 (Debian #362641) Don't attempt to poke legacy IO ranges on ARM or S/390. commit 59dcc62906d8ee597cd43aa307f414cb47995cea Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 20:39:08 2006 +0300 xfree86: remove Xqueue support completely commit e641000b98e7c2e92e3c801eaa42aa15d5c16ad0 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Sat Aug 12 19:41:59 2006 +0300 xfree86: add Hurd support (#5613) Add support for GNU/Hurd. commit 5a3488ccac8e5dabd9fc98bc41ef178ead1b2faf Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 19:25:06 2006 +0300 configure.ac: fix execinfo.h test (Debian #363218) Define HAVE_EXECINFO_H as well as HAVE_BACKTRACE, when we find execinfo.h. commit 26c3cd1c9e3f52548389817a6d89a377e20c4269 Merge: 008aa7e c4951e0 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 18:58:18 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 008aa7eb6ed090384e6c44f861410e317c78a1cd Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 12 18:56:05 2006 +0300 completely remove OS keyboard layer Completely axe the keyboard layer from os-support. commit c4951e0a6b6cf3eeee710cc5cda1d9bc929ee3d7 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Aug 10 20:49:06 2006 -0400 Fix a mode sanity check to not break reduced-blanking setups (LCDs). commit e1921f014b102e3eecf3b41972f8672cf23264d6 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Aug 10 20:43:15 2006 -0400 Rename some mode tokens to better reflect their use. Per #5386, M_T_EDID -> M_T_DRIVER, since it's really for any driver-detected mode. Also add M_T_PREFERRED bit, to select a 'best' mode out of a set. commit c2535f67923bde0bfb0e72363467110806e2f40f Merge: c0cb8d1 db82e12 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Aug 10 10:37:59 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into XACE-modular commit 9525c2709ea3245c6518d4c3b5a0a4afff37181d Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 20:29:57 2006 +0300 configure.ac: fix xephyr conditionals Fix Xephyr build conditions, allowing it to actually be disabled. commit 6d8d4abaaacf08140b673472d985117d448a62e7 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 20:28:06 2006 +0300 configure.ac: allow conditional building of XF86{DGA,Misc,VidMode} Allow conditional building of the above three extensions, defaulting to auto. commit 1a5561c4ecccaf32b03c41373adf376100d457aa Merge: 190f229 db82e12 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Aug 10 10:20:37 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit cec284f2b3e948deb9e56a1a8519fddf693ab952 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 18:03:58 2006 +0300 kdrive: properly ifdef composite enabling commit 45bce556e8665412b9f6e89f88ed5bedb41de1ba Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 18:02:47 2006 +0300 GetMaximumEventsNum: be more conservative Be slightly more conservative in our maximum event count if we're using XKB (and thus don't need to count the extra repeat events). commit 172d45b9b75f95c997d1e9358040eead496e2a06 Merge: 3832a3d db82e12 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 14:14:54 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 3832a3d7db0f3b5d7167e3b3b5ea6d6b3d96351a Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 14:13:51 2006 +0300 GKVE: don't repeat modifiers when using XKB Make sure we don't ever repeat modifiers (previously was repeating when using XKB); only do explicit KP/KR repeats in the non-XKB case. XKB will take care of repeating when we're using it. commit 9f188416bb6b4837d4c3f8773053d5eee0ff0ee1 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 14:00:34 2006 +0300 core devices: clear devicePrivates on close commit 539d1f33475484d35fb5a377efc76dba2d868e3f Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Aug 10 14:00:14 2006 +0300 GKVE/GPE: have DDX allocate events Don't allocate events on every GKE/GKVE/GPE call, just have the DDX manage it instead. Introduce GetMaximumEventsNum(), which is the maximum number of events these functions will ever produce. commit db82e12fac5eaa16a39fc1bd0bc31ad95089dc95 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Aug 9 14:55:17 2006 -0400 Remove TargetRefresh option from the autoconfig logic. The default target of 75Hz is almost always wrong for LCDs. commit fcd4167e8913f77bdf9e17a6955d0f2a9f4eeb10 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Aug 9 14:48:51 2006 -0400 Remove the bc flag from the -help text, since it's gone. commit 767f372dd02232469f9fd804b811a17eaf762e1e Merge: c4f5de6 462bb61 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Wed Aug 9 20:23:30 2006 +0200 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit c4f5de6cc3b935025829af971b0b8010c1ecfedb Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Wed Aug 9 20:21:52 2006 +0200 Sanitized glxdri's Block/Wakeuphandler calling. __glXDRIleaveServer() and _enterServer() used to call DRIDoBlockHandler (resp DRIDoWakeupHandler) directly. They are now calling DRIBlockHandler (resp DRIWakeupHandler) to account for driver specific block/wakeup hooks. commit 5506b4ad200745236f997c121e8200179c47b749 Merge: 4be9abb 462bb61 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 9 07:21:01 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 4be9abb8504b3761b5f3a01851e4eb3da86c76e2 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 9 07:20:16 2006 +0300 kdrive: remove ddx_DEPENDENCIES Remove foo_DEPENDENCIES as they weren't guaranteed to just be libs, and loader arguments (-lfoo, -Lfoo) might've crept in. commit 462bb61b0fe968fae1b99cf98ec6f7de09105dcd Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Aug 8 18:07:22 2006 -0700 Add CompositeRegisterAlternateVisuals. This provides drivers the ability to add their own alternate visuals and then register them with Composite for implicit redirection. commit 190f229ed77d87797e0f2f6762c86b3ad3a3dcbe Author: Ian Romanick <idr@umwelt.(none)> Date: Tue Aug 8 16:47:32 2006 -0700 Make xf86PciVideoInfo static since it is only used within this file. Dummy out all of the PCI bus and device access control functions. We need a better way to do this, and that will probably be in libpciaccess and / or the kernel. Refactor xf86GetPciInfoForEntity to use pci_device_find_by_slot. Refector xf86CheckPciSlot to use xf86GetPciEntity. Eliminate disablePciBios and the one place that calls it. commit 5508f7646f9754b054e961a1025b7a52913b563b Author: Ian Romanick <idr@umwelt.(none)> Date: Tue Aug 8 16:43:31 2006 -0700 Remove prototypes from some functions that were previously removed. commit 9df53d903ed68073bf7d2c2a275b6f6556a85c0f Author: Ian Romanick <idr@umwelt.(none)> Date: Tue Aug 8 16:42:23 2006 -0700 Rename xf86ReadDomainMemory to xf86ReadLegacyVideoBIOS, since that's what it is actually used for. Modify a few routines in linuxPci.c to take pci_device structures as parameters in stead of PCITAGs. commit fe351a711ef55c3ae1e784d4551147c080eda109 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 8 14:54:10 2006 +0300 GKVE: send XkbMapNotify, not XkbNewKeyboardNotify Sending MapNotify is more correct in this case than NKN, so do that. commit 31089816317f27c668b12a15c74fdd226a8df9f7 Merge: ab3ebfe 12dbd8a Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 8 12:01:12 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit ab3ebfefdb7d21aba72a5030f6f93bf4fafed709 Author: Tiago Vignatti <tv02@c3sl.ufpr.br> Date: Tue Aug 8 12:00:34 2006 +0300 xorgcfg: fix compilation error Add missing parentheses to IS_KBDDRIV macros. commit 12dbd8a02f797ad57a1be683a02a1fcb1ca35438 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 23:43:40 2006 +0300 remove optional R3 backwards compatibility Remove the permitOldBugs flag, which enabled backwards compatbility with broken R2/R3 era clients. commit 7721ee308fbbb6fc9c969f15fe04b3346c04f843 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 23:03:02 2006 +0300 config client: fix minor race with event queue Fix a small race whereby you could remove a device while events from it were still in the queue, by calling ProcessInputEvents immediately before RemoveDevice, to (hopefully) flush the event queue. commit 458c63a84110f64c7fce397a531a3a779c2239a2 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 23:02:17 2006 +0300 enable adding devices after removal of a middle device Allow new devices to be added after a device that _wasn't_ the last on the list was removed, by ensuring inputInfo.numDevices always increases, and never decreases. commit a31d11a7a8485cdc799f76c4d407d3b7f7c9b350 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 23:01:23 2006 +0300 GKVE: get rid of bogus double-release check Get rid of a bogus double-release check which broke non-XKB servers. commit bedc4ecf23c7150e3156e0d24602ed3bc3977225 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 23:00:45 2006 +0300 xephyr: aid input debugging Add the 'ephyr' mouse and keyboard drivers to the driver list so we can re-add devices. Set the names properly in Ephyr{Keyboard,Mouse}Init, not in InitInput. commit baf93b3abe1e88d82ee6a3d6939f50f96ded271a Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 21:12:45 2006 +0300 kdrive: move map initialisation to KdNewPointer Do a linear n -> n initialisation on the map up until KD_MAX_BUTTON in KdNewPointer, moving it out of both KdParsePointer, and KdPointerProc. Also remove dead pointer acceleration code. commit ccb53340b66a778abf10182fd88a7d699207fb84 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 21:12:00 2006 +0300 ephyr: cleanup Remove extraneous KdAddPointerDriver call. commit d1c18af27e0aed73104743afb4bf4b8d3d1186cf Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 21:11:38 2006 +0300 GPE: use button map for DBP/DBR, not just BP/BR Make sure we use the button map for extended events, not just core. commit 9b7ecbd1dd8d092221897e29c85f3306c7367716 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 21:09:32 2006 +0300 kdrive: prevent overrun in map We actually need n + 1 elements for the mouse button map, not n. commit eb6e8d4042252b13328dbb122e0e6186796a80ac Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 21:05:37 2006 +0300 kdrive: increase maximum number of buttons Increase KD_MAX_BUTTONS to 32. commit 1c72290cdf4d9b214e1b9c0526cb7cb8641051f3 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Aug 7 09:57:58 2006 -0700 Use DrawablePtrs instead of PixmapPtrs for Prepare/Finish access. Also, define some wfb functions even if FB_ACCESS_WRAPPER is not defined. This allows a client to use libfb and libwfb at the same time. commit afcad4ad99bbfc8bdcd0f4fdd70e072108410d30 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 18:11:05 2006 +0300 xfree86 ddx: always free GKE/GPE events free() events we get passed back from GKE and GPE so we don't just, er, leak them all. *cough*. commit 98fdf874eeadd5b37413922d8afba8415d0c56bb Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 16:51:39 2006 +0300 move all autorepeat logic to DIX Move core autorepeat logic for keyboards down to the DIX, remove it from KDrive. commit 5c7001fef8ffc6e3d8585a37d3f79a9495be8ed0 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 16:51:09 2006 +0300 memcpy() events in memcpy events into our event structure instead of doing pointer assignment. commit c85e64cba1d2d88f676ca7cf23b52a6f8219e90e Merge: a406f6b f54b71b Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 7 15:54:55 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit f54b71b772a1f587394ae3968782b611e52f0e2d Author: David Nusinow <david@nee.(none)> Date: Sun Aug 6 18:11:00 2006 +0000 Document enable/disable flag for AIGLX in xorg.conf manpage. commit a406f6bfeaa46e3236f7ab46813fe6c30b936a35 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 4 12:40:19 2006 +0300 mieq: don't leak events free all events posted through mieqEnqueue. commit 997ba45b192f21810099ed888792a45f1677a9ce Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 4 11:18:16 2006 +0300 fix incorrect button test Test for n (1..nButtons) being under nButtons, not button (1..(1<<nButtons)). commit 9138d5a51e411f598bc0e75a3e73d2c16187a518 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 3 18:24:04 2006 -0400 Make SecurityLookupIDBy* part of the base functionality. commit 45c229f526bf1dafb5e81b50d700449ba4e1613d Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Thu Aug 3 14:26:06 2006 -0400 Remove LBX code. commit 96e45626c43b7674b66e0258b0b1730d5ce71357 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 2 20:29:59 2006 -0400 Rebase Security extension to use devPrivates for storing security state. commit 83ebf61ec03ff31005375900bee1e55e0e694c4b Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 2 13:33:33 2006 -0700 Eliminate the last few places outside xf86pciBus.c that use xf86PciVideoInfo. In all cases this means converting the code to use the pci_device_iterator interfaces. commit 5bfb2ee9652e5ef6d076ef8b6df54baaa43b8e0c Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 2 13:29:21 2006 -0700 Remove the last remants of the pci{Read,Write}{Long,Word,Byte} functionality. This also allows the removal of PCI_CPU, PCI_CPU16, and a few other dangling bits of cruft. commit a0f2e1cae46f189ed97e2d92b485d315b3d2627a Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 2 10:54:41 2006 -0700 Move xf86FindPciDeviceVendor and xf86FindPciClass from xf86pciBus.c to xf86int10.c. Refactor common code from those functions to do_find. commit de8234606f87ce79d016f7ddeabdf57c4ad212f3 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 2 10:44:11 2006 -0700 Modify xf86FindPciDeviceVendor and xf86FindPciClass to use the pci_interator interface instead of the xf86PciVideoInfo array. commit 3c23dec5962b8b81ae838fe0ee2c7b0a789f5386 Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Date: Wed Aug 2 13:39:49 2006 -0400 Call ClientStateCallback on serverClient devPrivates initialization. commit 23f44df9009023e77508f03ac4a7595c7e3d40cb Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 2 09:55:32 2006 -0700 Remove pciConfigPtr and all of the associated cruft. commit 966ebd3d2d84b440e89504d055a0e937303ed11d Merge: a941766 39169fd Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Aug 2 08:14:58 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit ee02e647882a4be29e1130bd79904ee79ed6b802 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Aug 1 13:45:43 2006 -0700 Wrap libwfb memory access. Use the READ and WRITE macros to wrap memory accesses that could be in video memory. Add MEMCPY_WRAPPED and MEMSET_WRAPPED macros to wrap memcpy and memset, respectively. commit 39169fd373b97f34923f6494d697d9429d0b8aa3 Author: Matthew Allum <mallum@polystyrene.(none)> Date: Tue Aug 1 13:39:22 2006 +0100 Back out 'mystery' spurious host window hints. commit f737cc38baea6af8bf284c9e207e60a7d90eebe1 Author: Eamon Walsh <ewalsh@moss-uranus.epoch.ncsc.mil> Date: Mon Jul 31 19:58:42 2006 -0400 Adding devPrivates support to the ExtensionEntry structure. commit b04d64854712678701d5243aacf5cc93444cfadc Author: Eamon Walsh <ewalsh@moss-uranus.epoch.ncsc.mil> Date: Mon Jul 31 19:35:08 2006 -0400 Added devPrivates support to the ExtensionEntry structure. commit a94176627cdd6122ffadb618995f9bcec872609a Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 31 14:33:58 2006 -0700 Eliminate all uses of the businfo field of pciDevice / pciConfigPtr. commit a69335dc299be6de8b82ed34de1cb30f1255feb4 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Jul 31 14:15:55 2006 -0700 Make ReadMemoryProcPtr take a const pointer. Fixes some warnings when using READ with a const pointer. commit 26c9587f90806cce1c0d2a98e656e9c311a34ee5 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 31 13:54:36 2006 -0700 Build fixes for last pull from HEAD. commit 65dc25d8f86b962f2adc765a9ff327419f98092b Merge: 69533fc b74c845 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 31 12:30:30 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit b74c845a1233f78b841ff8840272c50873300c20 Merge: 3112a6c 02daa6b Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 31 10:26:06 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 3112a6c4f26d5e9258b8def7ce4109b4bd408c67 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 31 10:25:31 2006 -0700 Noting uses libdummy.a, so don't build it. Only libdummy-nonserver.a is actually used. commit 02daa6bb103e53e5a33db2bb6acbe57d0bf2c30e Author: Matthew Allum <mallum@polystyrene.(none)> Date: Mon Jul 31 17:32:05 2006 +0100 Improve XRes to; - Better estimate general pixmap memory usage. - Account for pixmaps shared between clients. - Account for window background and border pixmaps, and GC stripple and tile pixmaps. commit 69533fc04f38c67fd424776c5191a4ba57ba8c8f Merge: ef1aeca 24051ef Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 31 09:26:04 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/Makefile.am hw/xfree86/common/xf86AutoConfig.c commit 24051ef97406f28c102cf46a78223400b61fdae2 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 30 12:15:33 2006 +0300 remove filename that's too long for tar commit ecb7d43a76d507d04891ab7f189b23be5eccda51 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 30 11:52:41 2006 +0300 add sym.h to sources commit bf2d7499c84c94f228d03b21448f5688b3cda1a8 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 30 11:17:02 2006 +0300 add securitysrv.h commit e87e68634d8eb66ab783e2802e2d5d12ff1031be Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 30 11:11:59 2006 +0300 remove .cvsignores from EXTRA_DIST commit ed0c807de9f07468385fcbd2e8a9c0737759a461 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 30 11:08:54 2006 +0300 bump to 1.1.99.3 commit a68dc013a33d867e65a7e76b3eec5947b862a5b4 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 30 11:08:47 2006 +0300 remove README (which doesn't exist) from EXTRA_DIST commit 87fe85f38b6f781bf0e2eb555526e3d77779f9fa Merge: 3518e2d 654619d Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 30 10:51:34 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 654619d76c779606f2315782fc01d1410399fa3b Author: Kevin E Martin <kem@freedesktop.org> Date: Fri Jul 28 17:16:32 2006 -0400 Revert xkb changes that broke XkbGetKeyboard() commit 79016d4036786b091a9b9d1133a6cdfedd6c277d Author: Luc Verhaegen <libv@skynet.be> Date: Fri Jul 28 16:02:02 2006 -0400 Bug #5386 (partial): Move CVT mode generator from cvt(1) to server core, and export it from the X server to modules. commit e6ae1612be519ee6224d354244d076d85d44a750 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jul 27 18:24:59 2006 -0700 Add fbHasVisualTypes and fbSetVisualTypesAndMasks to wfbrename.h and include -DXFree86Server. commit 2a4ceb09ed5a09dc5763754ab865ec23df91ac9f Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jul 26 19:39:17 2006 -0400 Remove dead function prototypes. commit 990a4009057e068f41d20b95aa0c59357185650d Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jul 26 19:03:39 2006 -0400 Remove getconfig horrorshow. Replace with a static built-in rule list for now. commit 377a581ddf5e428a368efb1b59fcb317666fecdd Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Jul 25 15:27:31 2006 -0700 Switch to using void* pointers. Pass the size of the data pointed to by src or dst as an argument to wfb{Read,Write}Memory. This allows one set of macros to be used with any size pointer. Assumes that sizeof(FbBits) >= sizeof(FbStip). commit a4005c15fbb48231cb958c32b2c791a2d23a135a Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon Jul 10 18:58:09 2006 -0700 Add framebuffer access wrapper infrastructure. Create fbPrepareAccess macros to call into the driver to set up the wfbReadMemory and wfbWriteWemory pointers. Call these from fbGetDrawable and fbGetStipDrawable. Add the READ and WRITE macros, which expand to simple memory accesses for fb, and calls through the function pointers for wfb. Add fbFinishAccess macro to give the driver an opportunity to clean up. Add calls to this in the appropriate places. commit 319efac445cebda5a2ac1db67efebe54bc47ba9d Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Jul 7 18:45:30 2006 -0700 Prefix all of the exported symbols in libwfb.so with "wfb". For now, just #define all of the exported symbols in wfbrename.h. Later, we should add FBPREFIX() around the exported symbols and use -fvisiblity=hidden to hide the rest. commit 7608a63ff7409f399c9a26962a304b84196a1868 Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jul 6 17:05:21 2006 -0700 Build infrastructure for libwfb.so. Builds fb/* twice, defining FB_ACCESS_WRAPPER for libwfb.la. Define a macro, FBPREFIX(X) which expands to fbX for libfb.la and wfbX for libwfb.la. Use the macro on [w]fbModuleData so the new module loads. commit 39158e98acb29e97a2682d4a37385f9141b484c4 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jul 26 18:39:28 2006 -0400 Remove another latent PowerMAX hunk. All your favorite running jokes of 2005, today! commit ef1aecaaf6cd7e9e4f9d0c6373664e774500bc13 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Jul 26 13:25:13 2006 -0700 Pass correct pointer to xf86MapLegacyIO. commit 3518e2d0debc97e2bacdefe604b280e7fdfdd216 Merge: eb7733a 3821f6a Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 26 11:29:21 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit eb7733a48a92405660d5d2ab60913b62c30daaed Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 26 11:28:45 2006 +0300 kdrive: drop excessive NewInputDeviceRequest debugging commit 3821f6aeaa714582ee0a631de96c6e7cfd96303e Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jul 26 01:56:02 2006 -0400 Unlibc-wrap DMX glxscreens.c and fix tag-removal typo. commit 28ba8d56912ae56d7b9835188f621b0a491add30 Author: Ian Romanick <idr@umwelt.(none)> Date: Tue Jul 25 15:38:09 2006 -0700 Gut anything having to do with the PciBusPtr (or PciBusRec) type. Bump required version of libpciaccess to 0.5.0 so that pci_device_get_bridge_buses can be used. commit 380b51d605a82c98082a2cebd70a0d1d0735eaa7 Merge: 82f6b7e 8977b07 Author: Ian Romanick <idr@umwelt.(none)> Date: Tue Jul 25 11:30:04 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/common/xf86Init.c hw/xfree86/int10/pci.c hw/xfree86/scanpci/xf86PciData.h hw/xfree86/scanpci/xf86PciStdIds.h hw/xfree86/scanpci/xf86PciStr.h hw/xfree86/scanpci/xf86ScanPci.h hw/xfree86/utils/pcitweak/pcitweak.c hw/xfree86/utils/scanpci/scanpci.c Re-removed most of the conflicting files. commit 4ea475924c557ad0819b796f5369e5e669465709 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jul 25 20:00:48 2006 +0300 re-add OpenedHand copyright Ae-add OpenedHand copyright, accidentally dropped in KDrive new world order patch. Sorry guys. commit 82f6b7e75e04e3fb951ab71ad3c553c8b34ea995 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 13:52:58 2006 -0700 Don't re-look-up pointers that are already stored in structures. commit 2fd6b995ff927c8ca7267c201f535564b82e691f Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 13:33:34 2006 -0700 Global s/xf86MapDomainIO/xf86MapLegacyIO/. Let's call a duck a duck, okay? Since xf86MapLegacyIO is called from only one place, cut the parameter list down to the one parameter that actually conveys some information: the one that gives a PCI device. Change from using a PCITAG to a pci_device. commit aed6fe0bb12c68b94e564252bc03594728ed8c5b Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 13:13:05 2006 -0700 Refactor linuxGetSizesStruct to take a pci_device pointer instead of a PCITAG. Modify xf86BusAccWindowsFromOS and xf86AccResFromOS to call linuxGetSizesStruct directly with a pci_device pointer. Remove linuxGetSizes. commit e48762799248eb7e16ea2c0df1561ae1430f2112 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 12:23:23 2006 -0700 Modify xf86BusAccWindowsFromOS and xf86AccResFromOS to use the libpciaccess interfaces. commit 4b474cbc1a0fe17da2438a15291f04ee67ea28f8 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 12:17:27 2006 -0700 The functions xf86PciBusAccWindowsFromOS and xf86BusAccWindowsFromOS are identical. Just have one call the other. commit 7dff8d98a9ed11f92806cb8c4b3f10e01c5d063f Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 11:56:37 2006 -0700 Remove source files that have been dead since day-1 of this branch. commit eb95128f615e2f3fab17dcafd4fc260c6d4d0644 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 11:53:37 2006 -0700 Changes that were missed on the previous commit. Perhaps oddness caused by doing git-update-index at the wrong time. commit 05f8b772aec2b05d92078bb60a07bd8413386363 Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jul 24 11:23:03 2006 -0700 ScanPciDisplayPCICardInfo now uses pci_device interface for PCI scanning. Log messages simplified to make the code shorter and less convoluted. ScanPciDisplayPCICardInfo is now void since it was only called from one place with a constant parameter. commit ca3f4fc1b0c21a0620ab1eb35c199cd55d795095 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 23 19:02:12 2006 -0400 add fallback ChangeDeviceControl, allow XOpenDevice on closed device Add a fallback ChangeDeviceControl, which allows the attributes we know about so far. Allow XOpenDevice on closed devices. commit e73e5e2a4d8f22889d840a7719479f9af686cb9c Merge: a73cef1 8977b07 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jul 22 13:56:30 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 8977b07434d75ca396d236dc1324f0c862b633c7 Author: Dave Airlie <airlied@linux.ie> Date: Sun Jul 23 03:36:47 2006 +1000 glx: fix typo from tag removal commit a73cef1f005ca66db18e952e676ee5a21b829700 Merge: 672ca15 70869fc Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jul 22 12:07:22 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 70869fc6777f87cd05794446caa739e3d9a91ffe Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 23:39:37 2006 -0400 Yet more dead code. commit 7c1b2ee7a8238c267bc97e78bbff204dc7723dd3 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 23:35:13 2006 -0400 static markup, more dead code. commit 1c4f90b1d05d4c49279f3224a6dd94850a6bd8d0 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 23:03:21 2006 -0400 Open-coded path checks make baby Jesus cry. commit 114264584ca43091a5e07282566a30a6378a1502 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 22:55:41 2006 -0400 Remove a useless open() of the module we're about to load. commit 985611d5cd079f97da700c7b8e898d33da004be0 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 22:37:59 2006 -0400 Delete some long-unused testing code. commit 525257eb98b46209c69c8576daa6bd7afc1f48a9 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 21 19:16:38 2006 -0700 Fix stupid typos. commit 672ca156bfb11440e6e234650bfba9d38e1edb52 Merge: d14d91f 6cf844a Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:58:42 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 6cf844ab69926b6d23619a12c97734af3881ba67 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:57:28 2006 -0400 loader: walk directory paths with readdir(), don't stat() everything Walk the directories with readdir, and don't stat everything we can find. Thanks to davej for the public humiliation reminding me to go back and re-fix this one. commit d14d91f094c3897c889f6aafb66d738820dae0aa Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:57:28 2006 -0400 loader: walk directory paths with readdir(), don't stat() everything Walk the directories with readdir, and don't stat everything we can find. Thanks to davej for the public humiliation reminding me to go back and re-fix this one. commit e18d34f4238e13e226b0407fa2f5f77d2038de39 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 21 16:47:45 2006 -0700 Make the various implementations of xf86ExtendedInitInt10 use the libpciaccess interfaces. This eliminates all calls to mapPciRom, which in turn allows the elimination of hw/xfree86/int10/pci.c. commit 87a6346bf7f086b5f98b2b2ecd52f27efe864e56 Merge: b73fb2a 0486d39 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:36:25 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 0486d3966d2888ef86d36c19f31bdbc2a3e8c652 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:35:04 2006 -0400 fix kbproto dependency Depend on kbproto >= 1.0.3, for unconditional definition of XkbSA_XFree86Private. commit b73fb2ae35a82e0bdd48f01132e971fb84946ff1 Merge: e7ac27a aff404f Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:30:26 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit e7ac27ad81efbea6128b3cec443ca98e228d14ad Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:29:28 2006 -0400 revert accidental deletion of lnx_io.c; re-delete lnx_kbd.c Thinko'd which file to remove after merging from master. commit 81913a12910e39d7ea6af8657c1c66cc6791cd65 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:10:26 2006 -0400 remove undead files from master Remove dead files which worked their way back in when merging from master. Ugh. commit 7465010d59ec435bd00b738f0cef766b352dc7eb Merge: 1d31ed7 0aaac95 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:05:41 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 1d31ed778284082e1060bff63317c94581d9eb9b Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 19:02:52 2006 -0400 xephyr: load keysyms at init, not enable Load keysyms at init time, not enable, so we don't get the wrong map width. commit 63dfaa1d5ba556e09314ec914936e5471aab94b0 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 18:47:18 2006 -0400 Delete internal usage of the symbol ref/req lists. commit bca9364f3f4a2376edbcf57a34f704ce28be21ba Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 18:41:46 2006 -0400 Remove the loader's required and referenced symbol lists, dead code. commit 07ad92d2c4cb07db8487d76efc822fd7b88137cb Merge: 18624a9 22db3fd Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 21 15:25:35 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/common/xf86DoScanPci.c hw/xfree86/common/xf86Init.c hw/xfree86/common/xf86pciBus.c commit aff404f293ed86a44a093a51a9f11e79e6c3f4f6 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 18:24:37 2006 -0400 Detach xf4bpp from cfb. commit 0aaac95b0d12089b256c97f6ff955c8c229ae095 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Fri Jul 21 17:56:00 2006 -0400 Remove RCS tags. Fix Xprint makefile braindamage. commit eeaad0e956640aac653d194a992df7792e4abcbb Author: Aaron Plattner <aplattner@nvidia.com> Date: Thu Jul 20 18:19:07 2006 -0700 Fix the RandR failure path for rotated screens. commit 22db3fdb54d2f7f6b72638b46c186af6db04e214 Merge: 2f98841 93cd538 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 21 13:55:37 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 3eeb62e8f587732e6b433c2b9c6879eb26a3f1b4 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Jul 21 16:33:28 2006 -0400 bug #890: completely remove deprecated keyboard driver Remove all remnants of the old built-in keyboard driver. commit 60ea7b51fe2b8a19a08b63db48504971a7a50ee6 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 21 15:23:37 2006 -0400 xorg ddx: move to new input API, remove old keyboard driver Remove most of the rest of the old keyboard driver. Move to the new Get{Keyboard,Pointer}Events API, which is mostly complete at this stage: just missing the proximity events. commit d32dc8bf19e1071fc30af2f0bc6a6699b351f39e Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jul 20 18:40:47 2006 -0400 be more careful in IVAS Don't walk off the end of a NULL pointer in InitValuatorAxisStruct. commit 7711c56d2e2aeae4dcd6d9297bc144c1cb3cfab1 Author: Daniel Stone <daniel.stone@nokia.com> Date: Thu Jul 20 18:38:57 2006 -0400 xephyr: fix keymap, pointer; dix: fix multiple axes Initialise our axes properly in the DIX, and make sure we don't unnecessarily clip maxval when it's not set. Fix keymap copying in Xephyr (to some degree: it's still broken), and set nAxes and nButtons properly. commit f18c3122a57df9770087e5fc70ac488552222233 Author: Daniel Stone <daniel.stone@nokia.com> Date: Thu Jul 20 16:49:17 2006 -0400 sanitise debug output Don't spit out huge chunks of pointless ephemera, especially without --enable-debug. commit 463e0fe35bec3c91b19be9aacf34babb146a88c9 Author: Daniel Stone <daniel.stone@nokia.com> Date: Thu Jul 20 16:45:15 2006 -0400 update KDrive to new input API Update KDrive to fit the new API (mieqInit and InitPointerDeviceStruct), and include InitTouchscreenDeviceStruct in the DIX. commit 1987af8c498a1bf394a8951ca6d5b0b7f7a35188 Author: Daniel Stone <daniel.stone@nokia.com> Date: Thu Jul 20 16:39:54 2006 -0400 add virtual core devices to DIX Add virtual core devices, with proper keymaps etc, to the DIX. commit 737e6e4836a6af26fedc22cda8e7d366b52c8fa7 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jul 19 20:10:48 2006 -0400 define SDevicePresenceNotifyEvent prototype commit 7f36cc533e7f6ae44e973c5f00f9bfec7c6b7b50 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 19 20:09:13 2006 -0400 distribute config.h commit e896195eab726a2b307200958308eda8c93dd3cd Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 20:05:33 2006 -0400 remove extraneous font debugging code Some of it didn't compile, and some of it was just unnecessary. commit 99c57674c002c5e88c6db34488a27b05004c9197 Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 19:59:11 2006 -0400 avoid using font servers with built-in fonts commit ecfad74c48f633916305bcc25baaaad74aa52b78 Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 19:55:13 2006 -0400 add support for built-in fonts Use --enable-builtin-fonts to only use built-in fonts, and avoid loading fonts. commit 0a2068d123520d35818c38a555ae3ba06d8ca7fb Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 17:29:23 2006 -0400 Xi: add XExtension{Keyboard,Pointer} types Report XExtensionKeyboard for non-core keyboards, and XExtensionPointer for non-core pointers/mice. commit c7577f9b88aac84d59404f29d994ee7af583d33b Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jul 19 17:27:58 2006 -0400 Xi: add DevicePresenceNotify Add support for DevicePresenceNotify events. commit 3a23e499017d5823157806029263edac53c663fd Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 17:00:23 2006 -0400 make XInput mandatory Always build Xi, since GetPointerEvents/GetKeyboardEvents relies on it. commit 02d09105113fb9b560a770fe15f7bb041165831c Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 16:51:04 2006 -0400 new KDrive input world order Convert KDrive to GPE/GKE interface. Add first-class drivers and enumerate every device separately through Xi, instead of lamely attempting to aggregate them. Add XKB support to the Linux keyboard driver. Add 'thumb button' support to the tslib driver. Rejig InitInput, so each DDX has to add a list of drivers it supports. Support NewInputDeviceRequest, et al. commit a274e7296b1bdd6f6c921f28b087610cec9548e0 Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 13:56:23 2006 -0400 add GetPointerEvents/GetKeyboardEvents framework Add GetPointerEvents (with XFree86 pointer acceleration) and GetKeyboardEvents to the DIX. Extend the ValuatorClass structure to account for same. commit b308dbf273f8c26361b0fee7aca64aec3245f60b Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 12:15:18 2006 -0400 add DEVICE_TOUCHSCREEN and DEVICE_CORE Xi controls (DeviceIntRec ABI break) Add DEVICE_TOUCHSCREEN and DEVICE_CORE controls to the Xi code, and the TouchscreenClassRec and a coreEvents flag, to toggle propagation of core events. commit c9a3d9baa81ceb940032ffe529d9eadf2d202ab2 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 19 11:41:16 2006 -0400 xorg DDX: implement NewInputDeviceRequest Implement NewInputDeviceRequest for Xorg, mainly written by Kristian Høgsberg. Move MatchInput to xf86Helper.c, as xf86LookupInputDriver. commit 02a95311568e24e1055ea52c7df8cb7aa3f38ad0 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 19 10:05:12 2006 -0400 add basic D-BUS configuration mechanism Also move LookupDeviceIntRec into the DIX, and add InputOption type, and NewInputDeviceRequest prototype (DIX requests DDX to add a device). Does not link without an implemented NIDR. commit 93cd53860c3aca182a0a02543c41b5d71d65926b Author: Daniel Stone <daniel.stone@nokia.com> Date: Thu Jul 20 16:52:31 2006 -0400 kdrive: allow debugging commit cd0874dda1c30ef91a7d2b3cd455676422599ccf Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 20:13:02 2006 -0400 never define MEMBUG Definining MEMBUG causes allocations to randomly fail. commit 093943d4d02f1dbc8935b8cf835866a6e3885193 Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 20:09:55 2006 -0400 define DEBUG in DIX Which makes #ifdef DEBUG actually useful. Incredible. commit 68b0678254240a984db9adefefb0cf68e9bfd4e4 Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 20:08:32 2006 -0400 exa: only disable cw when COMPOSITE is built commit 27df2eda795681c9f05e2907d74e2c102d3441e4 Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 16:18:28 2006 -0400 fix KdXvCopyPackedData to actually work Remove extraneous bit shift in KdXvCopyPackedData, so it's actually useful. commit 00b24f119f03da86fa98ffea545c5b041810ce53 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jul 19 17:01:20 2006 -0400 fix minor typo commit f8a7a1e40c14a85ebde11c5854c07a8d529d38b9 Author: Daniel Stone <daniel.stone@nokia.com> Date: Wed Jul 19 17:06:00 2006 -0400 fix XEvIE build without XKB Don't unconditionally play with XKB stuff in XEvIE. commit 2f98841fde6bad807967ed15e954291240714198 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jul 20 16:08:27 2006 -0700 Remove unused variable. commit 985c34bf06af70a7296db8307899a17347a25558 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Thu Jul 20 17:33:13 2006 -0400 Remove the DDXTIME conditional, for being unused. commit c69c00d6523a35232a32e54a533811fc2b37815a Merge: 4636935 84683f1 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jul 20 12:08:38 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 84683f19b4d1c712281036bcabf8dc623e64b26a Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jul 18 18:16:12 2006 -0400 get rid of XFree86LOADER, XFree86Server, XFree86Module, and IN_MODULE Get rid of almost all uses of these definitions. They're still defined for delinquent out-of-tree drivers, and also for the Mesa build. As well as for miinitext.c. But largely gone. commit 881953813c7307f2aac4057b48d233e5f4a574cd Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Mon Jul 17 13:50:38 2006 -0400 Fix the Linux ACPI reopen code to use a repeating timer, rather than a one-shot sleep-and-reopen attempt. commit f029e9a32dcaa95b84e08ec173a0cc78fd92bdbf Author: Kristian Høgsberg <krh@redhat.com> Date: Sat Jul 15 22:05:38 2006 -0400 Un-glx-libcwrap DMX GLX proxy so it works without GL/include. commit 46369350d40819ecc2a9f37ed4aaa95866b80997 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 14 15:51:55 2006 -0700 Add some const qualifiers to serveral function parameters. commit 490fb304599b1f24b36439e5c1397781e7d2f612 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 14 15:26:56 2006 -0700 Rearrange code in xf86int10ParseBiosLocation to use strncasecmp. This eliminates the need for the first use of xstrdup in this function. The second use of xstrdup was *never* necessary and has also been eliminated. commit d3ee49bcbafe4b4e6b308686020847e978473779 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 14 15:13:35 2006 -0700 Refactor common code from the generic.c and linux.c version of xf86ExtendedInitInt10 to xf86int10GetBiosLocationType and xf86int10GetBiosSegment. These changes were tested on MGA hardware on x86-64 with various combinations of InitPrimary and BiosLocation. commit 8793c7fd4ba7d1b3e2eff3f2c18d042ee9bb3f62 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 14 09:11:39 2006 -0700 Refactor identical xf86InitInt10 function from generic.c and linux.c to helper_exec.c. commit 1450fd596433f7adfe3d0798dc2ddceb9d0a9034 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jul 14 09:10:32 2006 -0700 Trivial refactor of libint10_la_SOURCES. commit 18624a9b7cf88e769c53cc3a876b3647c5d5057c Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jul 13 21:10:48 2006 -0700 Modify linuxGetSizesStruct to use pci_device instead of pciConfigPtr. commit 12595a77d6c2f037f48dfe751bdc10505b3317df Merge: 37838de 4c225a3 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jul 13 12:48:03 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit 4c225a3a8b2e7e5e5510347d8473f1318bbac769 Author: James Steven Supancic III <arrummzen@arrummzen.net> Date: Thu Jul 13 10:03:57 2006 -0400 Bug #7482: Fix Xdmx's Render code to match reality; fixes BadLength client crashes. commit bb3aa94845a74d7718ba9539bb76203ec82957fc Author: Drew Parsons <dparsons@debian.org> Date: Tue Jul 11 18:26:55 2006 -0700 Bug #7346: Disable Composite extension in Xprt Xorg Bug #7346 <https://bugs.freedesktop.org/show_bug.cgi?id=7346> Patch #6184 <https://bugs.freedesktop.org/attachment.cgi?id=6184> commit 10f3e32726d5b4981abd1a3a022e5b4f219fb41e Author: Gustavo Pichorim Boiko <boiko@mandriva.com> Date: Mon Jul 10 16:37:53 2006 -0700 Fix the configure check for the --{enable,disable}-dpms option commit 2194d99d9ca3c607e0f5ddd911ee3df536d77564 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Jul 9 16:16:08 2006 +0200 Replace GNU make-ism. commit 90a9b82272446fdaebe71c966325fd7e670f75c6 Author: Matthew Allum <mallum@polystyrene.(none)> Date: Sat Jul 8 21:57:07 2006 +0100 Fix crash in Xephyr when running on host X with keymap width < 4 ( i.e xvnc ) commit 21e3e3ca298dce22e5fad6ef38aa6fe9736a1d3b Merge: e805621 39b2f7b Author: Matthew Allum <mallum@polystyrene.(none)> Date: Sat Jul 8 21:13:52 2006 +0100 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit e8056218944e873135c93039d1e9646d51364467 Author: Matthew Allum <mallum@polystyrene.(none)> Date: Sat Jul 8 21:10:58 2006 +0100 Add support to Xephyr for simulating 8bit grayscale. commit 39b2f7b2182aedb1ab45415efb4c263012ace512 Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Sat Jul 8 19:55:53 2006 +0200 Bug #3042: Use autoconf to get the correct name of a struct member. This allows us to remove the kernel version ifdefs from the code, which are ugly and broken. commit 63f13e01ee6e7df1753f2113f4cff9538596be0a Author: Tilman Sauerbeck <tilman@code-monkey.de> Date: Sat Jul 8 11:33:44 2006 +0200 Bug #7097: do case-insensitive comparison for some hotkeys. xkb's strcasecmp implementation has been moved to the dix so it's now safe to just use strcasecmp(). commit 5416f90e9c939027005fc01fa3ce3df56919ae0d Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jul 6 21:22:34 2006 -0400 Implement GLX_MESA_copy_sub_buffer. commit b84374b2917a91a7732e780ffab6a29c807a3ecc Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jul 6 02:28:55 2006 -0400 Add GLX_MESA_copy_sub_buffer marshalling support. commit 2152e2d364bdd179cf218cde446c763d8c8bb833 Author: Ed Catmur <ed@catmur.co.uk> Date: Thu Jul 6 17:45:36 2006 -0700 Remove hardcoded 'lib' in XPRINTDIR. commit 233c004641483a75985e09fea5416ab2c7a97fc4 Author: Ed Catmur <ed@catmur.co.uk> Date: Thu Jul 6 17:41:53 2006 -0700 Generate xprint.pre from xprint.cpp. commit b3e4d1d1f4bcf900146d7b8cd19e008209294663 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jul 6 18:51:29 2006 -0400 PPC64 build fix. commit f847f3c0a956c0aec8ade8e32f770daae147f40b Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Jul 6 15:33:31 2006 -0700 xorgcfg now needs libxkbui version 1.0.2 or better. Old versions of libxkbui use XkbStrCaseCmp which doesn't exist any longer; the server fails to link with that version of the libkbui library, so require the current version (1.0.2). commit 27ffd7e03c05dd2083a10e5acebd2b385d729eeb Author: Keith Packard <keithp@neko.keithp.com> Date: Thu Jul 6 14:43:10 2006 -0700 GL proto version 1.4.7 needed for texture-from-pixmap defines. GLX_TEXTURE_TARGET_EXT and GLX_TEXTURE_RECTANGLE_EXT are defined as a part of the new texture from pixmap GL extension in gl proto version 1.4.7 and are now used by the X server code. commit d7a96dd6f18e54c26fc5881772d033ac078db3a1 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jul 6 17:39:14 2006 -0400 Switch the default mouse device on Linux to /dev/input/mice. commit 37838de62edc474f44c0a48bd56470a6c23f8956 Merge: fd49a0d 8d07ee0 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jul 6 13:01:57 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework Conflicts: hw/xfree86/os-support/bus/linuxPci.c commit 8d07ee070ecf0d403d9d27c80764d343b80af6f0 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jul 6 12:48:51 2006 -0700 Refactor linuxGetIOSize and linuxGetSizes. Eliminate the unnecessary optimization in the search loop. commit 704e645207d88a2d0a372cf69f6abd778ed4c30b Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jul 6 14:22:33 2006 -0400 Remind dlloader that it needs to search the global scope as well as the loaded modules. Fixes LoaderSymbol() on symbols provided by the server. Spotted by Aaron Plattner. commit fd49a0dcc13280cf195bd6c7ee0f23d0840cb665 Merge: e66e7b4 28b95fd Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jul 6 09:52:15 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit 28b95fd9d1c2f078aaaac75c310a27b17c74a6fc Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jul 6 03:25:38 2006 -0400 Drop unused GL/include subtree. Woo, less Makefile's to generate. commit fc1a55671dceae0e2a701e044ff8203fae5eb1ba Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jun 29 04:35:45 2006 -0400 Implement glXCreateWindow and glXDestroyWindow. commit ee012588d28b468bd41da8d216210f8cb2bf8cb5 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jun 29 04:25:54 2006 -0400 Move __GLXdrawable lookup and creation into GetDrawableOrPixmap. Also refactors __glXSwapBuffers to use GetDrawableOrPixmap for getting the __GLXdrawable. This patch paves the way for GLXWindows with XIDs different from the X Windows they are created for, a prerequisite for glXCreateWindow(). commit 8b5bc6a9ab487fdea754266b120c686d75d9e100 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Jun 29 00:05:01 2006 -0400 Drop global GLX error integer variables and use __glXError() instead. Also drop glxerror.h (__glXError is now declared in glxserver.h) and global.c (last remaining globals are in glxext.c now). With this change we now support all GLX 1.3 error codes. commit 7cf3ec7b59223f15314a0629f122ecb796678421 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jun 28 17:00:23 2006 -0400 Move createDrawable from __GLXcontext to __GLXscreen. commit eea8efe4516750b2505b52ebc9f769f5e8a6f94c Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jun 28 15:59:01 2006 -0400 Add marshalling for GLX 1.3 requests. Also, hook up glXGetDrawableAttributes and glXQueryContext to existing DoGetDrawableAttributes and __glXQueryContextInfoEXT. commit e66e7b48e15543f3753951a19376f0446759963a Merge: a9d4842 eb35f81 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Jul 5 15:21:36 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit eb35f812a5b65adcc5f6cbb91b31b69cae5d7f3d Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jul 5 13:27:26 2006 -0700 add another file to .gitignore commit 863f5cc31b747bc9f2fcd6a9e20c613a11733bf4 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jul 5 13:26:34 2006 -0700 fix compiler warning in hw/xfree86/common/xf86Config.c commit f059b61ab3af25b03c704669eddb838d3ce4366c Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jul 5 11:47:25 2006 -0700 fix compiler warning about xnestRecolorCursor() not being defined commit cc3e99f747586f9d32622e5a682de39891b1fcba Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jul 5 10:13:19 2006 -0700 fix some more compiler warnings due to defines being declared differently commit 59836c0f2abee3339e1aa30dacadb82e477943d6 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jul 5 09:30:48 2006 -0700 fix wrong function pointer type in hw/dmx/dmxcmap.c commit 12563db59dd613ecc926e3bed9534152ebc0a2fb Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jul 3 12:52:27 2006 -0700 Revert "Optimize out computing a gradient pixel if the mask value is 0." This reverts cf46242e337481cd3b9b39d77dd621d2a63b11f9 commit. It wasn't meant to be pushed to master yet, and doesn't work. commit 002e28c12c74aa63777f65cbfb382c2bfd0d6850 Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jul 3 12:48:12 2006 -0700 Correct AGP memory deallocation argument on *BSD. This fixes leaks and eventual crashes with RandR resizing on Intel. commit cf46242e337481cd3b9b39d77dd621d2a63b11f9 Author: Eric Anholt <anholt@FreeBSD.org> Date: Wed Jun 28 18:35:59 2006 +0200 Optimize out computing a gradient pixel if the mask value is 0. Obtained from: kdrive CVS (DavidR XGL fb/ megapatch) commit a838fb70c52a829872680f6a2a2e7dd6d2dc9247 Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jul 3 19:22:36 2006 +0200 Bump server version to 7.1.99.2 for gradient and repeat fixes. commit 25d871d98462f0481ee419295ddc94b8c79dc881 Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jul 3 19:22:26 2006 +0200 Fix source picture filter check for multiple screens. Now, we only check for filter commonality if we're operating on a source picture, and we compare the id (screen-independent index of the filter name) rather than the pointer to the filter (per-screen state). commit 7106a77df37c06d2b5568eceeb9297096bff3137 Author: Eric Anholt <anholt@FreeBSD.org> Date: Sun Jul 2 12:41:35 2006 +0200 Fix bugs in support for new repeatTypes in XAA and EXA. EXA now won't pass pictures with new repeatTypes to drivers. We can add a flag for them to support it at a later time. commit f5e92542a14f51029347b6476e4e4af69144930b Author: Eric Anholt <anholt@FreeBSD.org> Date: Fri Jun 30 12:03:47 2006 +0200 Bug #7366: Fix crashes when setting filters on source pictures. Now, filters may only be set on source pictures when the filter is common to all screens. Also, like SetPictureTransform, ChangePictureFilter is now not called on source pictures. commit 6ef457913955d4289081c7d07d528963ccf5272c Author: Eric Anholt <anholt@FreeBSD.org> Date: Fri Jun 30 03:01:14 2006 +0200 Bug #7366: Fix two crashes in operations on source pictures. A screen's ChangePictureTransform now isn't called when changing the transform, as source pictures aren't associated with screens. Also, attempting to set an AlphaMap to a source picture will fail with BadMatch just like a Window would, preventing another crash. commit 50a3e1ad18c815a5adafee22beccdf970bae62d6 Author: Rudo Thomas <rudo@matfyz.cz> Date: Sat Jul 1 12:34:36 2006 -0700 Missing close parenthesis in one of the setuid() fixes. commit 124a81eb389dfa510ac07ca93ee17c4c9d6e56ea Merge: d3d6c5f 179737d Author: Keith Packard <keithp@neko.keithp.com> Date: Sat Jul 1 11:12:50 2006 -0700 Merge branch 'origin' commit d3d6c5f4d05e0ca5b566e19657e0fe2b3898482a Author: Paul Mackerras <paulus@samba.org> Date: Sat Jul 1 11:10:18 2006 -0700 Bug #7381: Coordinates get wrapped in accelerated line drawing on pixmap XAAPolylinesWideSolid was adding the drawable origin onto each element in the pPts array. Since the values got stored back into the pPts array, they got truncated to 16 bits, causing the overflow I saw. This patch avoids storing the coords back into the pPts array (and actually reduces the size of the code too :). Now the 32-bit sum of coords + origin doesn't get truncated to 16 bits, and the problem is solved. commit 179737d4a07ed10a734fe017b5680f8e78ffda96 Author: Jens Granseuer <jensgr@gmx.net> Date: Wed Jun 7 01:46:00 2006 -0700 Bug 7145: fix build with gcc 2.95 & other c89 compilers Move variable declarations to start of blocks as required by c89 commit a9d4842893b65232d61fe4c63f074d30e81021d2 Merge: 66cac9b 6bd4c25 Author: Ian Romanick <idr@umwelt.(none)> Date: Fri Jun 30 11:49:29 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit 6bd4c254396cb0f4e8ae21ff455ebb15cd9f4f10 Author: Martin Bochnig <mb1x@gmx.com> Date: Mon Jun 26 01:52:24 2006 +0200 Updated Solaris aperture driver to build on sun4v & amd64 kernels Updated for Solaris 10 changes to DDI commit 66cac9b17498497d939bfb7a4075bcee5a485e5f Merge: 7c4e540 54d9acd Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Jun 28 14:11:49 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit 54d9acd5113318274e291abab4554b8e678227df Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Jun 27 19:44:52 2006 -0400 Add damage tracking to GLX_EXT_tfp implementation. - Only update when pixmap content actually change; - Only update the regions that acutally changed. This is a worthwhile optimization, but it doesn't completely remove the bottleneck, as mesa still uploads then entire texture whenever it changes. commit adfe8e7437ff739f54d1d074008e8cc0e3bcb4d3 Author: Eric Anholt <anholt@FreeBSD.org> Date: Tue Jun 27 21:49:00 2006 +0200 Bump server release to 7.1.99.1. This will be important for a couple of cairo workaround tests. commit 63c169e3b1f7d6a7375a414fcd50cce32358a525 Author: Eric Anholt <anholt@FreeBSD.org> Date: Tue Jun 27 04:11:47 2006 +0200 Fix MMX Saturate implementation. The code was expanding the source blend factor from the wrong channel. Fixes cairo's clip-operator test. commit 7c4e54025345455f420cd2abaa7a40679689d3cb Merge: 9d0a15d ff6b59a Author: Ian Romanick <idr@umwelt.(none)> Date: Mon Jun 26 14:39:44 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit ff6b59a0dbadbe61a53e48c23965d3073d95791b Merge: b3c8693 48c8715 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jun 26 13:02:33 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit b3c869304cd85af034aa9debaa874e29d14fcbe6 Author: Peter Breitenlohner <peb@mppmu.mpg.de> Date: Mon Jun 26 10:48:44 2006 -0700 Free small, one-time memory leak in xdmcp -from handling Part of Patch #6046 <https://bugs.freedesktop.org/attachment.cgi?id=6046> commit 48c871564d493203d434d5da015903399287f619 Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jun 26 15:57:32 2006 +0200 Move EXA_PM_IS_SOLID() to the public API, since drivers will want it frequently. commit afb84c2fca56887b3bfe7aa93f337c49b087acdc Author: George Fufutos <fufutos610@hotmail.com> Date: Sat Jun 24 15:23:14 2006 +0200 Bug #6911: Check return value of exaGetPixelFromRGBA(). commit 930b9a069a425818d4e9965f53be7df1f4d7d422 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Jun 24 15:21:17 2006 +0200 Bug #6818: Avoid infinite loop in exaLog2() with negative arguments. commit 36756fdb2ddc154b406f664a6af0f38d26e6973d Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Jun 24 15:09:24 2006 +0200 Make sure <execinfo.h> is actually included when needed. configure only defines HAVE_BACKTRACE, not HAVE_EXECINFO_H. This could cause problems on platforms where the size of a pointer is greater than that of an integer, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=363218 . commit 4426215a6e99f84550aaac23ac9c2018668bfbc1 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Jun 24 15:02:56 2006 +0200 Bug #7213: Fix the XFree86-DRI extension for byte-swapped clients. These clients are by definition non-local and thus not direct rendering capable, but they still need the QueryVersion and QueryDirectRenderingCapable requests to find out cleanly. commit a195a3debca02572d9f7d7a9976b5bf67acc5d08 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Sat Jun 24 14:54:52 2006 +0200 Fix byte swapping in some GLX requests. commit bc6cfde19887eff7a07dc739ffa29609fb55b83d Author: Eric Anholt <anholt@FreeBSD.org> Date: Fri Jun 23 20:07:34 2006 -0700 Use correct OSNAME setting so we can find os-specific modules like libdrm. commit c7ac485a59709572307b9a4a9abacc52c7021b65 Author: Eric Anholt <anholt@FreeBSD.org> Date: Wed Jun 21 09:34:55 2006 -0700 Remove the default case from fbcompose.c switches which should cover all cases. Instead, stick the NULL return default case afterwards, so that the compiler can warn us when we've got unimplemented cases. Removes some unimplemented and unused 8bpp, depth 4 picture format names. commit 2cf1f39ca974c81a2f52d2f7509aa3d098a87176 Author: Eric Anholt <anholt@FreeBSD.org> Date: Wed Jun 21 09:30:59 2006 -0700 Add a manpage for EXA. commit 9d0a15dca56b14821cad474f9db9c332acb3b1e6 Merge: 6c514ca d67fd10 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jun 22 16:21:10 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver Conflicts: hw/xfree86/loader/xf86sym.c commit 6c514ca14c2326c2cf82b73196429789d11e4a01 Author: Ian Romanick <idr@umwelt.(none)> Date: Thu Jun 22 15:51:16 2006 -0700 Use XSERVER_LIBS instead of XORG_LIBS for -lpciaccess. The former is only for libraries that are built as part of the xserver build. commit d67fd106968e371d8be3966ed5ecdd3c69f36e3a Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jun 22 12:47:51 2006 -0400 Add kdrive servers to .gitignore commit bf17c6dede1c0cf1edee10f2cc7e1e619b944d3a Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jun 22 12:24:09 2006 -0400 Drop libz from the server's link line, it was only needed for LBX. commit c0cb8d1fb80540e093da54da3ee2f55bdf139274 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 21 18:12:41 2006 -0700 Use XACE, not XCSECURITY to decide if SecurityLookup* are exported commit 3177dc498a955cd58cd6054a7c7e69724db4a59b Merge: 3f19803 91dcac5 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 21 18:06:06 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 3f19803e0b1adc66e695f63f915b8dc85eb84215 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 21 18:05:51 2006 -0700 APPGROUP requires both X-ACE & XC-SECURITY now commit 91dcac5295486cc55a34ad91704bfa483bd31eeb Merge: d8135eb 77c947b Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jun 21 20:49:30 2006 -0400 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit d8135eb9e414bf6957f64c5102ee0ef7c2404c6f Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jun 21 20:49:21 2006 -0400 Unbreak unbreaking the loader. Re-add the symbol reference lists so that the linker will include everything it's supposed to. This is a terrible solution, but ld semantics don't let you do anything better. commit f83cee0338eca095ad601374a87775be823a2565 Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:07:37 2004 +0000 Modify XC-SECURITY and XC-APPGROUP extensions to work with XACE commit 15c9002d68a7eeb02a6db1f231af7a18a3cf7512 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 21 16:24:20 2006 -0700 Correct ifdef - should be XACE, not XSECURITY commit 90af38fa0c46c2081d2becac262a614c26ba6ef1 Merge: 3e098ef 77c947b Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 21 16:23:31 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver Conflicts: Xext/appgroup.c commit 3e098efa35ba70ad4d5699af3130a3b02e1cb06e Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 21 16:21:03 2006 -0700 Correct ifdef - should be XACE, not XCSECURITY commit 77c947b900faf34f425eef1549d8210c475e093b Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jun 21 16:18:41 2006 -0700 Move Xserver internal API for appgroup from Xagsrv.h to appgroup.h (Since all use is inside the xserver module, might as well keep the header in the Xserver module instead of in proto/XExt to allow easier synchronization of updates.) commit aa131c51e06e735d7b54cadf51205f703a3de4ef Merge: 1708b0c 77aa701 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Jun 21 14:39:52 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 1708b0c7d962b80073500eb1c483447bbf965bc9 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Jun 21 14:39:39 2006 -0700 Eliminate "ugly" spaces around parenthesis. Add const qualifier. General code clean-ups. commit a3c26d01a16e4ae20a5d1acf9d888e95760c3da1 Author: Ian Romanick <idr@umwelt.(none)> Date: Wed Jun 21 14:38:07 2006 -0700 Move declaration of "j" inside #ifdef block where it is used to eliminate compiler warning. commit 40aafaf154ba8a2cba857689d1481be2d4a610c2 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 21 14:36:09 2006 -0700 fix a number of compiler warnings in os/* commit 77aa701e898c6525322cc4029d95167dd9f6e618 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 21 14:16:48 2006 -0700 add some function prototypes to hw/xprint/DiPrint.h as they are exported commit 865884d050e1778180f7677e15f9ee1625ea4bb2 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 21 14:16:28 2006 -0700 fix compiler warning in dix/xpstubs.c when XPRINT is not defined commit ed18d776f02e2ab235954501ef64936af9f9d909 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Jun 21 16:22:14 2006 -0400 Fix #2488 for fb too: sample pixel center when transforming. commit ea5e0eabd1303a55d8fc10f44d21a3d371ce8919 Author: Matthias Hopf <mhopf@suse.de> Date: Wed Jun 21 17:08:51 2006 +0200 Bug 4320: Fastpath corner case improvement for Composite. commit 9af315a9be19b48faa1249e0575cbe3d1e31dec5 Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:07:37 2004 +0000 Modify XC-SECURITY and XC-APPGROUP extensions to work with XACE commit f68ecfa482b2c2037f929710310c7b9ce6fe9291 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jun 20 19:01:34 2006 -0700 Add X-ACE to build system - Added --disable-xace to configure.ac and issue configure error if trying to build XC-Security without X-ACE - Added XACE #define to dix-config.h - Added X-ACE sources to Xext/Makefile.am commit a46c06dab8392cf8012c7cc0b916de9a9e569671 Merge: 49b368c d44b2a0 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jun 20 18:40:18 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver Conflicts: Xext/appgroup.c Xext/security.c dix/devices.c dix/dispatch.c dix/dixutils.c dix/events.c dix/extension.c dix/property.c dix/window.c os/access.c commit d44b2a0a57fb89741173c31676af0ccc822387dc Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jun 20 18:22:51 2006 -0700 Move Xserver API for security extension to securitysrv.h commit a54435946544a039fc333bb5e3438501d0d1ffc6 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Tue Jun 20 18:14:27 2006 -0700 Move Xserver API for security extension to securitysrv.h commit 49b368c0bb04816c4a3579071c596b2398cae3ec Merge: 63f6e6b 481d401 Author: Alan Coopersmith <alanc@alf.(none)> Date: Tue Jun 20 16:22:39 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 481d4012e74d9b0e98911f0ae02700ecf4cfc5ac Author: Alan Coopersmith <alanc@alf.(none)> Date: Tue Jun 20 16:16:19 2006 -0700 Don't add -ldl to XORG_LIBS if it's not needed for dlopen commit 63f6e6bbfd0d3677e29621af982c9392ead98dd7 Merge: 88ede2c 6df52fb Author: Alan Coopersmith <alanc@alf.(none)> Date: Tue Jun 20 16:03:34 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 6df52fb7745c185c0168060f69cc6b4f5315914e Author: Alan Coopersmith <alanc@alf.(none)> Date: Tue Jun 20 16:02:55 2006 -0700 Delete code that's been inside #if 0 since X11R6.7. commit 75398cff82b56c0a8fc301e84e2087f59a61a360 Merge: 1f91b57 2b58685 Author: Ian Romanick <idr@umwelt.(none)> Date: Tue Jun 20 15:49:47 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver Conflicts: hw/xfree86/loader/Makefile.am hw/xfree86/loader/xf86sym.c commit 88ede2cec79281a43cecb43ee6dec65770f82530 Merge: 227a319 2b58685 Author: Alan Coopersmith <alanc@alf.(none)> Date: Tue Jun 20 15:29:55 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 227a3193405147fbbee2971cc15bac92cc13285a Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Tue Jun 1 21:09:25 2004 +0000 Add XACE extension source files. (Copied from XACE-SELINUX branch in Xorg monolith CVS since these were never imported to modular cvs or git trees.) commit 1f91b5726c721778de0627c0139100744db06934 Author: Ian Romanick <idr@umwelt.(none)> Date: Tue Jun 20 15:03:13 2006 -0700 Fix a compiler warning about varibles being used without being set. Add some const qualifiers. Remove some "ugly" space around parenthesis. commit 2b58685402e70f123e131fd8146e6083ff5214a4 Author: Matthieu Herrb <matthieu@deville.herrb.com> Date: Tue Jun 20 21:07:53 2006 +0200 Check setuid() return value. Bugzilla #7116. commit 4365d16c8629e824973ee0c357efdfbfd28b672c Author: Kristan Høgsberg <krh@redhat.com> Date: Mon Jun 19 22:13:22 2006 -0400 Pull over convolution filter fixes from xgl-0-0-1 branch. Cherry-picking patches: 8a5ea68800b9d7dca90ff4e573ad8533852f1ea3 and 4d755fe14274a7293748ce9aa666ab85df6297c5 commit f818e0ab60da3779ab2602c6e6d3ff261b50917e Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:07:37 2004 +0000 Modify XC-SECURITY and XC-APPGROUP extensions to work with XACE (cherry picked from 0106715000196c7b349a0b4494b61545f0f5e138 commit) commit 0707eb33d6826e1300a905edea28c12134600b12 Merge: 37f0ae0 98d17bb Author: Alan Coopersmith <alanc@alf.(none)> Date: Mon Jun 19 17:09:51 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 37f0ae02457bd22b27f8f30a373e5cb19f2fbaea Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:04:52 2004 +0000 Replace XC-SECURITY code with XACE security hooks (cherry picked from 8526cd6395490b03b279f1962df777fb0e4a9878 commit) commit 98d17bba716619e3402bd74c7c3e1c01d055ef6e Author: Alan Coopersmith <alanc@alf.(none)> Date: Mon Jun 19 17:07:59 2006 -0700 Tell git to ignore emacs *~ droppings and git .msg files commit 569c808a2375be71f835ee8693605487484bd22e Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jun 19 16:42:09 2006 -0700 Fix crash when using PICT_x4a4 by supplying an appropriate fbFetchPixel_x4a4. commit 8d9ccc90a54c786ca4ba5620ab0a965e3f3bc8ea Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:15:41 2004 +0000 Add XACE extension (partially cherry picked from 8d4f21ab53c44ca48501d6211ea6db0c0b8af916 commit) commit 55426650417df4ec22ea0e2a67f6074f0ac1d54e Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jun 19 15:04:46 2006 -0700 Clean up gcc warnings from picture format CARD32 -> enum change. commit 520c80f4b807ae6419e70fe2b524532465b509ac Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jun 19 14:40:27 2006 -0700 Don't forget to step the rows when verifying the equivalence of fb/sys areas. This is only used by fakexa, but we would have missed some errors without this fix. commit e793f0eeee3e9c83b6a7b50d451fb6db12839087 Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jun 19 14:06:02 2006 -0700 Correct component ordering when fetching [ax]4b4g4r4 pixels. Noticed by: rendercheck commit e1672a12eb70836a2ceec803d505294897ae8cd2 Author: Eric Anholt <anholt@FreeBSD.org> Date: Mon Jun 19 13:20:56 2006 -0700 Convert PICT_* names from #defines to an enum to aid in debugging. commit 9742d55c820a260a42a4537502295931d4529deb Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Mon Jun 19 14:40:14 2006 -0700 update .gitignore to handle Xprint move commit d97a21acb878bc4e5e6542912fbd820503bba312 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Mon Jun 19 14:36:54 2006 -0700 fix compiler warnings in hw/xfree86/i2c/fi1236.c commit 29c78321e86956c4ce0c1c899d82557f927e04da Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Mon Jun 19 14:36:41 2006 -0700 fix compiler warning in hw/xfree86/i2c/tda9850.c commit 9f2793551f335e5fb08990fc8bb9e05e0ffb68d5 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Mon Jun 19 11:50:47 2006 -0700 fix compiler warning in hw/vfb/InitOutput.c commit b20ae5ddb7682bafcee6f8bf0c8208a3f70b882b Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Mon Jun 19 11:38:52 2006 -0700 fix compiler warnings in hw/xfree86/xf4bpp/ppcGC.c commit 4d258f31967141e3c4a6e4abbef89ffa717e85aa Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Mon Jun 19 11:27:47 2006 -0700 fix compiler warnings in XTrap/xtrapdi.c commit 870cecb72c2cba44dc64cb202917453603c8f287 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Mon Jun 19 11:22:42 2006 -0700 fix compiler warnings in XTrap/xtrapdiswp.c commit a28652f9c35fbc009245382a5cc2a022f42366fc Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Mon Jun 19 00:57:18 2006 -0400 Another round of loader sense-beating. Remove the (unused) server export lists, a really bad hash table, the last vestiges of the other backends, and some miscellaneous cleanups. Good for dropping 300k from the size of the built server on x86. commit 98a602fab1f307a07a96868d7dae12b6f8d7f405 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Sun Jun 18 23:54:04 2006 -0400 Don't bother building RAC as a module, that's just absurd. commit 76aaf7eae7409162c5ed2963f2e27d019cb30263 Author: Eric Anholt <anholt@FreeBSD.org> Date: Sun Jun 18 19:47:29 2006 -0700 Add a couple of (doxygen) comments I wrote while looking at modesetting. commit 6aaf0e5b581b06fc73e56f863a26cd9d684eb9c0 Author: Eric Anholt <anholt@FreeBSD.org> Date: Sun Jun 18 19:12:15 2006 -0700 Add options to disable EXA acceleration for Composite/UTS/DFS, and always print out how much memory EXA is managing for offscreen pixmaps. commit 21ef7e17ef6dca177461c9438b9df707a4d664a2 Author: Eric Anholt <anholt@FreeBSD.org> Date: Sun Jun 18 18:57:55 2006 -0700 Add some missing .gitignore stuff for Mesa symlinks and other generated files. commit 71fbda8049f64c7fefae8ab817fb5f37ee2ee134 Author: Adam Jackson <ajax@theobromine.nwnk.net> Date: Sun Jun 18 21:07:28 2006 -0400 Xprint/ -> hw/xprint XpConfig -> hw/xprint/config commit 868e2cab706e317618646e064b0559d4e68c7b32 Author: Eric Anholt <anholt@FreeBSD.org> Date: Fri Jun 16 10:17:51 2006 -0700 Add explicit dependencies (Xorg_DEPENDENCIES = ) on the internal libraries (such as libcw.la) that we link into the server, causing it to be rebuild automatically when they're updated. Some system libraries are included, but don't appear to cause any harm. You would think this would be automatic... commit 53f74b6aa95fe57fda45fd8a051595e772f00402 Author: Eric Anholt <anholt@FreeBSD.org> Date: Fri Jun 16 10:14:30 2006 -0700 Bugzilla #5120, #7246: In CW's GC ops, validate the backing GC against the backing drawable if the serial numbers differ. Fixes crash in XAA which occurred when the DDX bumped the serial number on the backing drawable and expected it to get re-validated, and we didn't because the wrapped drawable hadn't been bumped. commit 72ac20c0e878ad48ff61f7e846cbf1005a4eb435 Merge: fc3e814 b900883 Author: Ian Romanick <idr@localhost.localdomain> Date: Tue Jun 13 21:13:02 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit b90088321e6ef84970aa97d7c851af93f49bf4b7 Author: Ian Romanick <idr@localhost.localdomain> Date: Mon Jun 12 15:22:31 2006 -0700 Add arrayobj.c to the Makefile as well. commit f9f33b72e34eaeccea2a20f4a3dd68c2dbefc90e Author: Michel Dänzer <michel@tungstengraphics.com> Date: Mon Jun 12 20:19:11 2006 +0200 Track per-drawable damage to minimize UTS and DFS transfers. Based on work by Eric Anholt. commit 6060b612de6b41f872d034c6130770c1d189d0a3 Author: Eric Anholt <eric@anholt.net> Date: Mon Jun 12 20:12:31 2006 +0200 Provide option to report damage after operation is complete. commit fc3e81473a98d3b932faa73c0c01c21366a48a9e Merge: 4bedaad 041ef23 Author: Ian Romanick <idr@localhost.localdomain> Date: Mon Jun 12 09:41:06 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 041ef23192b193b87f6cfc3e74e2e77f9f47cd4b Author: Ian Romanick <idr@localhost.localdomain> Date: Mon Jun 12 09:39:18 2006 -0700 Add new Mesa files arrayobj.c and arrayobj.h. commit 4bedaad17dc75dfbada91f47e1007a8c090300a9 Author: Ian Romanick <idr@localhost.localdomain> Date: Mon Jun 12 09:29:05 2006 -0700 Add new Mesa files arrayobj.c and arrayobj.h. commit 4e3c9ab8c90d474a2224dbfa0807bc01fc012f7c Author: Ian Romanick <idr@localhost.localdomain> Date: Fri Jun 9 16:56:54 2006 -0700 Remove some static declarations for things that were removed in previous commits. commit 8b6596b1e1864dd79a3c53ee3ceb7a8e9bdb6ec7 Author: Ian Romanick <idr@localhost.localdomain> Date: Fri Jun 9 16:08:06 2006 -0700 Move probe_devices_from_device_sections, add_matching_devices_to_configure_list, and check_for_matching_devices from xf86Helper.c to xf86Init.c. These functions are only called from a single place in xf86Init.c, so it makes sense for them to live there. They were originally in xf86Helper.c because they evolved out another function that was already in that file. commit 7810d87cd6ae9316d88f6a2e7696deb8837cec27 Merge: dcfaa9f caad8b7 Author: Ian Romanick <idr@localhost.localdomain> Date: Fri Jun 9 15:16:50 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit caad8b724b97074e41de447fe77dda189f287a26 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 11:24:57 2006 -0700 fix compiler warnings in record/set.c (note this only fixed up the function definitions for the static functions which can not cause any abi incompatibility) commit 51489bb5ed86cb6aa07e26a13618765c29f913e4 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 10:59:47 2006 -0700 more .gitignore updates commit c4d251bd3e88cf8dfd6872537dbe30c07344b196 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 10:46:18 2006 -0700 updated .gitignore with more pre-generated files commit 9f31ef83be61a900c701fcbc9a43ffae40ca7005 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 10:44:46 2006 -0700 fix compiler warning in hw/xfree86/loader/loaderProcs.h commit 490ffc205a7714145cac0c63efeb6374ea28141f Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 10:44:25 2006 -0700 fix compiler warning in hw/xfree86/loader/loadmod.c commit 6119845d1ff832ea2b7c9cbe7ed6c6637cdcf305 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 10:14:08 2006 -0700 fix compiler warnings in hw/xnest/Keyboard.c commit 1a7335ff932baa59a3283c50dd6007d81989b7e3 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 10:02:08 2006 -0700 remove unneeded externs from Xprint/ps/psout.c commit 9583859d538394e98ac1f38b8e6f0997e321621d Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 09:59:22 2006 -0700 remove unneeded "extern" in Xprint/ddxInit.c commit cb9e29c184474edd75645e3b52e22a097a242e40 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 09:54:50 2006 -0700 removed unneeded extern in Xprint/ps/PsWindow.c commit 96c19a3ec1b7e43782d373b8015fa0ca24cb4f5b Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Fri Jun 9 09:51:28 2006 -0700 put function prototype for ShapeExtensionInit() in proper place based on FIXME in mi/miinitext.c commit dcfaa9f4f8fb10b75be50c9a49ccd88caf6d0f6a Merge: af9afe4 576e6fb Author: Ian Romanick <idr@localhost.localdomain> Date: Thu Jun 8 15:03:00 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 576e6fb1124a47493371210adf99d6f2076e72c5 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jun 8 17:49:02 2006 -0400 Bug #7120: Multimonitor (non-Xinerama) support for xwin servers. (Tom Whittock) commit d42cf4a2a4980fdd29fb15c4fd8fddda67b36256 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Thu Jun 8 17:46:53 2006 -0400 Bug #7121: fix clipboard handling in Xming (Colin Harrison) commit af9afe4cc50df973bea2293a803f7dfdefaa6411 Merge: caffac3 3930da3 Author: Ian Romanick <idr@localhost.localdomain> Date: Thu Jun 8 11:37:09 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 3930da3f6209312dd0f10aba0b16ef45996a07fe Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:27:29 2006 -0700 fix compiler warnings in Xprint/ps/psout.c commit c496a3b9c981dc079fcc6c0ac4db3aa912b3dcf1 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:23:53 2006 -0700 fix compiler warning in Xprint/ps/PsImageUtil.c commit ea24b5a25c2544f3b3de6480da125edb23a6b3a9 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:22:01 2006 -0700 add proper function prototypes for Xprint/ps/PsCache.c to Xprint/ps/Ps.h commit ee2bb4d1929e20436cf0e830ece02fe07db2d524 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:15:34 2006 -0700 fix compiler warnings in Xprint/ps/PsArea.c commit 92303d534a91cb0ea30e4cd0f639efd70b9739b4 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:12:16 2006 -0700 fix compiler warning in Xprint/ps/PsGC.c commit cf6169f9e99e6e8ab264f284cfa13cb379b36207 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:09:56 2006 -0700 fix compiler warnings in Xprint/ps/PsFonts.c commit 1abc7f96edf37a1e2c766b9cdba7fc9b2cb06d19 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:06:51 2006 -0700 fix compiler warnings in Xprint/ps/PsInit.c commit 2dc291384c550badf55542ae645240e166676848 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 11:04:40 2006 -0700 fixed compiler warnings in Xprint/ps/PsPixmap.c commit aef092e0290143c2b8b1cb98fdf55c9630032aaf Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:53:17 2006 -0700 fix compiler warnings in Xprint/ps/PsPolygon.c commit 511b231ded61159ebd70cab020ca1ca003fd0784 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:41:34 2006 -0700 fix compiler warnings in Xprint/ps/PsPrint.c commit 35fccb0068e8d73d1e6a16aefdc771506e620f83 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:40:24 2006 -0700 remove some compiler warnings in Xprint/ps/PsText.c Note that one of the existing warnings is pointing out a real bug (uninitialized use for fontPage in PsPolyText16()) if anyone really cares about this code. commit caffac38432009e8dc01e7d3e72a7fa6fba2f078 Merge: c5b3aa1 9fa7372 Author: Ian Romanick <idr@localhost.localdomain> Date: Thu Jun 8 10:38:43 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 1ac30947f4a222ba78558eddf8e5f03cec31f613 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:35:18 2006 -0700 fix compiler warnings in Xprint/ps/PsWindow.c commit 9fa73721f0c3df73e508da909a5665f47a54cb57 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:27:28 2006 -0700 fix up EnableDisableExtension() and EnableDisableExtensionError() prototypes commit c405659626477f2009603d8c0e381b8b62277bb6 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:19:24 2006 -0700 comment out QualifyName in Xprint/Init.c which is not used anymore If someone else wants to delete this function, that's fine with me too. commit a940b851faba569e36983f7885aefa72f7bf2ade Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:17:53 2006 -0700 fix function pointer warning in Xprint/Init.c commit 9e0c82386ae389bcc296a5ad44e996790b033ad3 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:16:37 2006 -0700 fix already-defined warning in Xprint/Init.c commit 40fb7eecaf14a76f35ac2dc350ad2fffdaf6e0d0 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 10:11:17 2006 -0700 fix noDamageExtension warning in Xprint/Init.c Also took out duplicate definition of this variable in mi/miinitext.c commit 494895e0fbbf0a71bc535c0a2358c9db54c95c5a Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 09:43:44 2006 -0700 Properly define dispatchExceptionAtReset to fix compiler warnings commit d90eecf40ea768b2bf6340f15bb0af9dab2f3cf3 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 09:11:41 2006 -0700 add some missing function prototypes to Xprint/AttrValid.h to fix compiler warnings commit bccde1609153dee93f6fe5a138fc0c0f2fe08212 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 09:01:59 2006 -0700 fix incompatible pointer warning in Xprint/ddxInit.c commit 60bd8893d50ed1da9b94f4b96a07ea432e23f467 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 09:01:21 2006 -0700 Properly #ifdef out ddxBeforeReset() to fix compiler warning commit ac21e6a594eac69101aa8920d70a9d60412b57f6 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Jun 8 09:00:42 2006 -0700 remove unused variable warning in Xprint/ddxInit.c commit 71dd44b0ad617dd36ce4ed328f9e1e8c5ef713a5 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 19:17:26 2006 -0700 Fixed up most "warning: function declaration isn't a prototype" warnings from Xprint/ commit 839305bac98856a2bb1d96691e4dcf49db229f90 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 19:12:23 2006 -0700 Remove unused variables from Xprint/attributes.c commit c5b3aa120bf96ee169d07c33a2698499944a1624 Author: Ian Romanick <idr@localhost.localdomain> Date: Wed Jun 7 17:46:23 2006 -0700 Added a comment about some suspicious code. commit 50112dfcc82dd476727fa453b9e3d1852e06d678 Author: Ian Romanick <idr@localhost.localdomain> Date: Wed Jun 7 17:46:05 2006 -0700 Fixed severly broken calls to pci_device_find_by_slot. I mis-read the tag bits when I originally coded it. I mistakenly thought that the original code masked off the PCI function bits, so I just always passed 0 as the function. That was a mistake. commit f9e7128d948a0b62e6f03295305e0080d9233fd8 Author: Ian Romanick <idr@localhost.localdomain> Date: Wed Jun 7 17:44:06 2006 -0700 Added missing include of Pci.h. This caused the server to terminate when the symbol PCI_DOM_FROM_TAG couldn't be resolved at run-time. commit 23182315f34e3a0065739b43b15d4560e75b41a1 Merge: bc05158 757f40f Author: Ian Romanick <idr@localhost.localdomain> Date: Wed Jun 7 17:03:48 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 7a40ac2585028860730ffcd333eb3fe9de63680c Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 16:23:45 2006 -0700 remove a bunch of unused variables in Xprint/Init.c (fixing the compiler warnings) commit 163980138cc0bfc9124456781b3dc45a49e2a129 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 16:11:20 2006 -0700 remove some unused local variables in Xprint/Oid.c commit 8e41640db884a4633b598d0a52b269e6547c8bf0 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 15:56:43 2006 -0700 add bison generated files to .gitignore commit 78f4ab6b89fca3086b9c9471b40c11c23fbb6142 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 14:12:40 2006 -0700 Fix compiler warning about undefined ReinitializeRootWindow function commit 757f40fca50a99377e437949ee77b983c8cd6087 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 14:09:13 2006 -0700 updated the .gitignore file with more auto-generated files commit bc05158a5ab00c548e4b04b5638afe07bc702260 Merge: 46f55f5 cc46580 Author: Ian Romanick <idr@localhost.localdomain> Date: Wed Jun 7 14:09:12 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver commit 46f55f5dead5d70cdff30531d80a72f6be042315 Author: Ian Romanick <idr@localhost.localdomain> Date: Wed Jun 7 14:09:02 2006 -0700 Initial batch of changes for PCI rework. All future changes will be tracked individually. commit cc465800ddca5fb6c9ec09fdfa8f1f05359cf396 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 14:03:35 2006 -0700 Fix compiler warnings about SetVendorRelease and SetVendorString commit 785c9789704ed142fe98cd17b5995e4a95b7141f Merge: 21ebcfd 36d786e Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 13:20:21 2006 -0700 Merge ../xserver commit 36d786e9f051c5c95c1cc8c098c84e118ed3cc85 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 12:47:50 2006 -0700 add more files to .gitignore commit 8f5aa38abf1158a789b5528df9d98826342e30cf Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 12:33:44 2006 -0700 fix compiler warning about XKB_IN_SERVER redefinition commit 101ae616962c355388722e05ab8413eb5f5c3402 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 12:06:22 2006 -0700 Add PanoramiXExtensionDisabledHack to globals.h as it was missing. commit e5b72bd9c6fb06640a5de4031be0dc9b04b4b215 Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 12:05:39 2006 -0700 Remove 3 compiler warnings in the Xext/xevie.c file commit e3c11f66516521959127b9ab8fd88cc4c954f5bb Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Wed Jun 7 12:05:01 2006 -0700 Added first cut at a .gitignore file to make using git easier. commit 21ebcfd7027b2a6182d4065e56a2ef814f5181ae Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jun 7 14:17:31 2006 -0400 Demolish now-unused loader functions. commit f90761b06eaa5fa44fe85289e54eed5f47eff3b9 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jun 7 13:58:24 2006 -0400 Add a token for EDID-supplied modes. commit d00aa6b8559d3e5f70c6558ce0abd12f7d758491 Author: Adam Jackson <ajax@benzedrine.nwnk.net> Date: Wed Jun 7 11:44:36 2006 -0400 Delete a (now misleading) message from the crash handler. commit f8535edec736cf19740bd41ed2adfe531f2c26ac Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Jun 6 10:29:34 2006 -0700 Remove ChangeLog file. commit 8444bb77c91cf8a23d32b3cc9749e2a3d3f9f9eb Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Jun 5 20:22:06 2006 +0000 When we can, bound the maximum number of PCI devices to attempt to scan, by the number found on the system. Only implemented for Linux right now. commit 11cf4d2fde9219e8d6ca427acae89a0c9f5d71b1 Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 5 07:15:23 2006 +0000 Update AC_DEFINE_DIR to version compatible with CVS autoconf which requires double eval to avoid leaving ${prefix} in output commit 52fc7c8dc70226cc7f03454e9be86a627672295f Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jun 5 03:00:24 2006 +0000 Ensure all *ModuleData symbols are marked _X_EXPORT. Start removing XFree86LOADER ifdefs, non-loadable hasn't been supported for a while now. Remove completely gratuitious REMOVE_LOADER_CHECK_MODULE_INFO ifdefs surrounding a call to a function added in XFree86 4.1 (!). Miscellaneous static markings. commit d22582dc5a070f72d4653e24d1e4ebe4a112276e Author: Adam Jackson <ajax@nwnk.net> Date: Sun Jun 4 16:13:26 2006 +0000 Remove a stray LBX reference. commit ddc6b99505e227f99585b8c2392da524022a73e6 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jun 3 11:24:33 2006 +0000 Bump to 1.1.99.2. commit 4fd668940f2155c4b06d24b6da8bcccd01f66f4c Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jun 3 10:58:37 2006 +0000 Bug #6619: Fix disappearing hardware cursor. (Colin Harrison) commit ee71cb61f8da29bcf36ea4b199d629e34f89b119 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jun 3 10:54:38 2006 +0000 Bug #6956: Fix crash when removing session leader before its children. (Rich Coe) commit cd384af3058fe15077c57eccdffed3b61e261e7f Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jun 3 10:50:23 2006 +0000 Completely remove relocation pointer table. commit 8e8c6faecddbe014d8760822e1f705b43a00fa33 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jun 3 10:48:37 2006 +0000 Add support for kFreeBSD systems. (Robert Millan, Aurelien Jarno) commit 5b703f847d166176920077c1e6ba1d9559fc8481 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jun 2 12:05:32 2006 +0000 Fix type confusion. commit 56f21bda1ce95741c88c423b60bd709eef26eb12 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 22:30:52 2006 +0000 Bug #6583: Only open /proc/bus/pci/devices once. (Bill Nottingham) commit a9ed5a87902a839a5a135af03db78f113b18bd86 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 22:06:41 2006 +0000 Kill LBX, too. commit df6da66525836d515f408a82f1a13ca5251ff0f7 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 20:56:39 2006 +0000 Simplify the unsupported XI function list. commit 97203f1cf6e5b7c6389f69cbb1b75ac675d09531 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 20:41:21 2006 +0000 Clean up a warning, and remove excess multiple-suffix code. commit 6d594ebc667afd404556ec3e108c810946b20ac5 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 20:22:39 2006 +0000 Ditch more alternate-loader braindamage. commit c9468177486833d521ec62c7b0266b4be8200de7 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 20:18:30 2006 +0000 Kill a.out, COFF and ELF loaders with FIRE. commit a3a4221495dfe4cc0a3874a08dd5364ef45a7f2e Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jun 1 19:53:06 2006 +0000 Add bitmap to the ignored module list. commit ee689c104287140db38bbd26959ab1b4847c168e Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 19:49:55 2006 +0000 Ignore requests to load GLcore and speedo. commit 07c731a2bc21e6b98f28a2c0ebc42f01b67b824b Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jun 1 19:37:53 2006 +0000 Bug #5089: Die, libbitmap, die! commit 32be08ba7242da74de5defd6a4dcb536a273f57a Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 19:22:38 2006 +0000 Remove horrendously ugly DDX backward-compatibility. commit d81edb9e00680e3c0001f343fa1d0c310b86cb93 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 19:22:01 2006 +0000 Forgot to remove this one too. commit a73e0f8cdfec1c9199ffe696146ba7d677c4c10d Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jun 1 18:47:47 2006 +0000 Die XTESTEXT1, die! commit fc5ca97284ef237a91f6adb433148ff57a673c08 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue May 30 22:56:36 2006 +0000 Powerpc machines also need ioperm_noop.c commit 07b168c8d8b2d79a4e7cf8dc5124eafc0f2bbcd0 Author: Adam Jackson <ajax@nwnk.net> Date: Tue May 30 16:10:59 2006 +0000 Properly document the DPMS, SyncOnGreen, and TargetRefresh options. commit 107defd920d9b1eb52b15e8ca8665bc48bb933d6 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon May 29 19:53:18 2006 +0000 Remove superfluous definition of tfp tokens. commit fd8bde8bb0f9d796b3464973b53285c0a6d22a31 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon May 29 11:14:03 2006 +0000 Remove -xkbmap argument. commit db0680cf70b8367e1f8a7fff9c0f6ec414db0542 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon May 29 09:26:32 2006 +0000 Minor #include cleanups. commit c38aab293a06f43c04f14223f94f822d91d73396 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat May 27 23:15:05 2006 +0000 check buffersize before reading next char, fixes the "mouse stuck at left" bug (bugzilla #3113) for BSD systems using wscons. (Dale Rahn). commit 2102fdd0a58e18aeaa842b2ec73b6071970fafb7 Author: Jeremy C. Reed <reed@reedmedia.net> Date: Fri May 26 00:12:18 2006 +0000 RGB color database and XErrorDB install to "share" not "lib" by default (by app/rgb and libX11). TODO: They are customizable, so maybe cpprules.in should be extended. commit 354086d7e8e13fc7acbcc6603ca2a03c8cc806ee Author: Jeremy C. Reed <reed@reedmedia.net> Date: Thu May 25 23:32:33 2006 +0000 Don't do fixup_video_driver_list if no drivers. (I had signal 11 and core dump when drivers not installed yet.) TODO: fix fixup_video_driver_list to handle NULL argument. commit c6b1cff43238deded11dc58945778aec3d844598 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Thu May 25 13:27:42 2006 +0000 update to build against Mesa CVS HEAD (Carlos Eduardo Rodrigues Diogenes). commit 99724c16c9c58eb3e20ba91c79464747b8ee3fcf Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Thu May 25 10:14:39 2006 +0000 typo commit 5c7aef148de23f39027fda647bbb53bb5b992683 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Thu May 25 09:57:47 2006 +0000 Don't destroy a pixmap twice on server exit (bugzilla #4247). commit 693079442377daa2dc48bf318a0d7dd256cb2738 Author: Jeremy C. Reed <reed@reedmedia.net> Date: Wed May 24 22:58:03 2006 +0000 NetBSD also has curses.h instead of ncurses.h. (TODO: Maybe instead of checking for SCO, UnixWare, Sun SVR4 and NetBSD, the curses.h versus ncurses.h should be tested in configure.) commit 9477e5e0be04f4f6fa311de8b3693fbc8a082fbf Author: Jeremy C. Reed <reed@reedmedia.net> Date: Wed May 24 22:43:13 2006 +0000 On NetBSD, add -li386 for i386 and -lx86_64 for x86_64 to SYS_LIBS. (x86_64 on NetBSD not tested.) commit b3031532ca96b22e81863202efb8bbcb9d701fac Author: Jeremy C. Reed <reed@reedmedia.net> Date: Wed May 24 20:11:38 2006 +0000 Remove tolower() which was missed in the _XkbStrCaseCmp/strcmp changes. commit eb696f72a0819edef550bce9ff55730c02f70452 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue May 23 16:17:09 2006 +0000 Add AC_SUBST([SOLARIS_ASM_CFLAGS]) that I forgot when splitting them out of the XORG_CFLAGS. commit bc0c56c407117d1545e20d21f7d30eb3472d618b Author: Adam Jackson <ajax@nwnk.net> Date: Mon May 22 15:47:56 2006 +0000 Bug #6924: Restore the ABI for DrawableRec and ColormapRec to the state they were in prior to the fix for #6438. Based on a patch from Andy Ritger. commit cc3b882bd141218052cdde0144fc2a707ceee83d Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat May 20 00:55:44 2006 +0000 Update to 2006-05-19 snapshot Remove entries now present in pci.ids Regenerate from updated pci.ids & extrapci.ids commit 0b2c2b6bba5b578d5f0ac2d709d5d2ce7cb32bef Author: Adam Jackson <ajax@nwnk.net> Date: Fri May 19 20:29:47 2006 +0000 Remove dead DPMS timer functions from the installed headers. (Fredrik Höglund) commit deebf6bd51117c01a3217f134bd952481b9e41ab Author: Adam Jackson <ajax@nwnk.net> Date: Thu May 18 23:52:51 2006 +0000 Bug #4139: Fix a BAR remapping bug that could lead to IERR and system hang. (Egbert Eich) commit 91239d83f4e27835cf871348b5ff6c892bd4f4f4 Author: Adam Jackson <ajax@nwnk.net> Date: Thu May 18 23:52:41 2006 +0000 file getemptypci.c was initially added on branch server-1_1-branch. commit c11cfcfaffc79be5686c666f881c4c08f69e1b86 Author: Adam Jackson <ajax@nwnk.net> Date: Thu May 18 23:48:57 2006 +0000 Bug #6377: Ignore disabled BARs, and allow matching BARs aligned to less than 16 bytes. (Felix Kühling, ATI) commit fa9a49a92db52de968d7147c71c6b9a8fd480f1e Author: Adam Jackson <ajax@nwnk.net> Date: Thu May 18 18:18:41 2006 +0000 Bug #5877: Avoid burning CPU when acpid dies. Require acpid to be running for ACPI support on Linux. Minor errno handling fixes. (Valery Inozemtsev, Adam Jackson) commit 7893dadb2f6df218a4f4ea30a41c1aa9838da1f0 Author: Adam Jackson <ajax@nwnk.net> Date: Thu May 18 14:39:59 2006 +0000 Bug #6827: Fix texel fetch in fbFetchTransformed to avoid crashes. Still not 100% correct, but better than 7.0. (Radek Doulik, Matthias Hopf) commit 2892dd6d2e34957650ef1630a94d471dfa71f888 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed May 17 16:20:03 2006 +0000 Make Xv symbols conditional. (Enrico Wiegelt) commit a317bf482257f0e1b612dec7961fdfa564f0b9f2 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed May 17 15:00:18 2006 +0000 Make DBE support conditional. (Enrico Wiegelt) commit 321dbed5f5a857a23525167ab85d4d7699429132 Author: Adam Jackson <ajax@nwnk.net> Date: Mon May 15 18:27:18 2006 +0000 Bug #5209: Fix APM/ACPI support, again. (Michel Dänzer, Valery Inozemtsev) commit dd38d3bd673cf830c2cd591fe1245909aa729892 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun May 14 16:22:24 2006 +0000 Don't use AM_CONDITIONAL inside shell conditionals. Bugzilla #6916. commit 6558ba4e62dba99f2a4d830f1c16f8d1c255b316 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri May 12 21:53:28 2006 +0000 Fri May 12 17:51:26 2006 Søren Sandmann <sandmann@redhat.com> Keep track of the previous item and update its next pointer when deleting from the linked list. commit 9e239a0df7ededb50de091e5271cbfddd2b683c3 Author: Matthias Hopf <mhopf@suse.de> Date: Thu May 11 11:23:43 2006 +0000 Bug #5796: Wrong fastpath selection for repeating sources. commit 9db5d2dfc33e384ea4db1b7cbc377e0b05cfb3ff Author: Matthias Hopf <mhopf@suse.de> Date: Thu May 11 10:18:08 2006 +0000 Bug #4320: Improved XAA Composite fastpath. commit 9a2a63ca3ff30d15e82a29e75a3720ba5b446978 Author: Adam Jackson <ajax@nwnk.net> Date: Wed May 10 15:44:27 2006 +0000 Bug #3561: Crash fix in the Record extension. (Paul Anderson) commit ab1a0249ba5e3174f18a1db212bc511fd7d74cb0 Author: Adam Jackson <ajax@nwnk.net> Date: Tue May 9 22:36:01 2006 +0000 Bug #6867: Yet another Render crash fix. (Michel Dänzer) commit 24310f827b71009c7510a674d2f92ced89847e37 Author: Adam Jackson <ajax@nwnk.net> Date: Tue May 9 18:12:50 2006 +0000 Revert accidental commit commit 86ffb46358965509aa3ee536f15cb5a4e5e04426 Author: Adam Jackson <ajax@nwnk.net> Date: Tue May 9 18:04:29 2006 +0000 Bug #5209: Re-enable building APM and ACPI support. (Michel Dänzer) commit b46d6a44fa97a3e66de828385026b7f84d9e59b8 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed May 3 23:45:16 2006 +0000 Make Xephyr build on Solaris: Add #include <sys/file.h> on Solaris for FNONBLOCK/FASYNC definitions hw/kdriver/linux/Makefile.am Move agp.c & agp.h to KDRIVE_HW_SOURCES since they're not needed for Xephyr-only builds Add -lrt to XEPHYR_LIBS if needed to get nanosleep(). commit fc91ca069dd55490b99b096f029e0864b049120c Author: Adam Jackson <ajax@nwnk.net> Date: Wed May 3 17:50:10 2006 +0000 Redact a few mentions of speedo font support. commit b9a9cf618566bdd796556b8a1f31949f66184352 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue May 2 14:09:30 2006 +0000 Typo in ALLLOCATE_LOCAL() arguments, causing mis-computation of the buffer. Bugzilla #6642. commit 1e8a594957d84a37e66183e9c0cb9d42b62bdb24 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue May 2 01:37:25 2006 +0000 Fix Solaris build with Sun compilers to work when exa is built before hw/xfree86/os-support/solaris (as it is by default now). commit 724dbc2f8bbe2f21bf16f20ca7b8bb555516626c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue May 2 01:30:37 2006 +0000 Use min() [defined in include/misc.h] instead of MIN() [not defined in any Xorg header]. commit ad124742ae2a265a54a4a7ac91709ec6fd6ced34 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Apr 30 20:33:27 2006 +0000 Remove stray mfb/cfb references. commit 291e89d4f2a4bb3177b2dfe6421680e23f120b8e Author: Adam Jackson <ajax@nwnk.net> Date: Sun Apr 30 19:16:14 2006 +0000 Remove NEED_LINEHELPER BC cruft for pre-R6 DDXes. commit fdcacc5a4bc1d6cb7347fc66041a9c686c5c74d1 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Apr 28 03:27:12 2006 +0000 Add Polylines and PolyPoint acceleration as well. This is primarily to clean up fallback debugging output, so I can focus on more imporant cases. Performance is comparable but without hardware stalls, and passes Xlib9. commit 005529a1c9c9e78f06565dff081f03b74988081e Author: Eric Anholt <anholt@freebsd.org> Date: Fri Apr 28 03:26:30 2006 +0000 Correct some bugs causing performance issues in the "Smart" scheme. commit 8738bc295bba229e36d064713e0c28aa8720c494 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Apr 27 20:27:27 2006 +0000 Improve EXA fallback debugging output to include the locations of pixmaps. This is being used in tracking down recent compositing performance regressions. commit 83b061776a57025076fc26d6d01fe2e049c2243b Author: Eric Anholt <anholt@freebsd.org> Date: Thu Apr 27 19:17:34 2006 +0000 Add trivial PolySegment acceleration for 0-width horizontal/vertical lines, which still happen somewhat frequently and were cluttering up my fallback debugging output. x11perf says it's a major performance win in those cases (though probably irrelevant), and it passes Xlib9. commit 69164ec00c749787dd59d5913ec6b3d159ad74d7 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Apr 27 02:15:19 2006 +0000 In drawing glyphs, shortcut our way to exaComposite instead of going through the whole CompositePicture stack and doing things like computing damage over again. This is a sizeable win for text drawing with a compmgr. Also avoid calling down into the server for dealing with the scratch pixmap when we are able to do UploadToScreen successfully and never need it. commit 3d4ca57b69c40d27fe191170d0819013f8cc4947 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Apr 26 18:27:40 2006 +0000 Add a helper for the Component Alpha Over case, which breaks the operation down into an OutReverse and an Add. Turn off the fallback to software glyphs when component alpha, now that we expect all (new) drivers to be able to support it. Also, make Xephyr fall back in the CA Over case to exercise this code. This speeds up my rgb24text and ls -lR in gnome-terminal by a factor of 5. commit 26fa45b64258894201496f921eccb0cb7028c28c Author: Dave Airlie <airlied@linux.ie> Date: Wed Apr 26 11:40:58 2006 +0000 Bug #6751: Use the Linux PCI ROM interface on Linux properly. The old domain code, still modified BARs not a good idea, Just talk to sysfs, if 0 read, fallback to old methods. commit c339b221d3f59130a39e63d4cec3de7e3de95bf3 Author: Dave Airlie <airlied@linux.ie> Date: Wed Apr 26 11:31:07 2006 +0000 Bug #6750: This patch detects Intel bridges that are transparent but aren't reported as such. From the Linux kernel fixups. This patch also removes the reserved BIOS area from the area to allocate resources in. commit 6d156c044085881c6ecbd8a13521c0a26df71c30 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Apr 26 01:33:15 2006 +0000 Improve the migration debugging output. commit eaed7545a25a08b3223bf620c2ab6f80fe7cfdf6 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Apr 26 01:32:55 2006 +0000 Fix a bug in the intersection computation that could concievably cause incorrect results to be returned (but would probably usually be over-conservative). commit 5d00859c6e7d4b7ebce56f438ec4993334de2328 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Apr 25 23:56:17 2006 +0000 Bug #4668: Check if the lists of glyphs don't have any intersecting glyphs, and if they all have a maskFormat matching the format of the actual glyphs If so, we can avoid the temporary pixmap for accumulating glyphs, which reduces the number of operations done, and makes it easier on the migration system. This fixes some significant performance issues, particularly with subpixel antialiasing. Note that it does increase the amount of damage computation which is done, so is not always a win with a compositing manager running. commit 074dc9a023b3967ce00aa42c26a7c988423afe8a Author: Eric Anholt <anholt@freebsd.org> Date: Tue Apr 25 16:47:23 2006 +0000 Add an option to verify at the point of migration that pixmaps which aren't marked dirty are in fact not dirty. This will hopefully help catch issues like the previous commit. Leave it on in fakexa. commit 702d9226d57ec1584de2e8a85c268795650b1094 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Apr 25 15:46:04 2006 +0000 Don't forget to mark the drawable as dirty in exaPutImage(). Fixes corruption with drivers that have UTS. (Michel Dänzer) commit 39ca0867c7dd6f3bdecc52aec8df435946682098 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Mon Apr 24 05:44:06 2006 +0000 Remove another reference to cfb16. commit 81f3c2937df6230542f3223c201da8c41ff59945 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Mon Apr 24 05:39:47 2006 +0000 strlcpy() doesn't exist on Linux, so use the implementation in os/. commit a715634d23fb3124261dbbd8d7d4e6522551bb9b Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Apr 23 13:14:50 2006 +0000 Don't access free memory after unloading a module. Bugzilla #4168. commit 79dc6892610c9f8385cde4f0d601cc7481225c16 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Sat Apr 22 03:22:17 2006 +0000 When reading the kernel keyboard mapping (readKernelMapping in os-support/linux/lnx_KbdMap.c) we overrun the usefully-named global array 'map', scribbling on other random static variables elsewhere. This is fixed by changing the size of at2lnx. (David Woodhouse). Bug #5169 commit b37c515320dc8df2b1d160cc3f37d6bfac109b91 Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 19 21:56:13 2006 +0000 Add support for x4a4 format (depth 4 at 8bpp). Bug #6325. commit c947d796aad0b81d661a10b787deed967376da79 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Apr 18 19:18:43 2006 +0000 Missed in previous commit: Add a new migration scheme, called "Smart" for lack of a better name. This one behaves somewhat between Greedy and Always. It moves in if we can accelerate, unless the destination is clean and shouldn't be kept in framebuffer according to the score, in which case we migrate out (and force-migrate anything where migration is free). This should help fix lack of acceleration for drivers without UTS since removing exaAsyncPixmapGCOps, and has removed one performance trap with Radeon I'd noticed. It is the new default. commit b17a4de83e7ab18bef29ae898195889638f1cc6a Author: Eric Anholt <anholt@freebsd.org> Date: Tue Apr 18 19:14:07 2006 +0000 Add a new migration scheme, called "Smart" for lack of a better name. This one behaves somewhat between Greedy and Always. It moves in if we can accelerate, unless the destination is clean and shouldn't be kept in framebuffer according to the score, in which case we migrate out (and force-migrate anything where migration is free). This should help fix lack of acceleration for drivers without UTS since removing exaAsyncPixmapGCOps, and has removed one performance trap with Radeon I'd noticed. It is the new default. commit 771b366abe0bc060592b548612ec413291e14bf0 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Apr 18 18:50:35 2006 +0000 Fix exaGetPixmapFirstPixel to migrate as unaccelerated. Also adds a bit of fallback debugging info to PolyGlyphBlt. commit 782d61a03176264e0a9eb222ae97be3d175cf0ab Author: Donnie Berkholz <spyderous@gentoo.org> Date: Tue Apr 18 17:28:44 2006 +0000 Update all prefixes in config tools, so they mostly work again. Also, make RgbPath commented out when using xorgconfig. Start using /dev/input/mice as the default mouse location on Linux. commit 0f065059dcaf9c452f1cdec115f619f697fd71cc Author: Donnie Berkholz <spyderous@gentoo.org> Date: Mon Apr 17 07:27:43 2006 +0000 Wrap a couple more SDK headers in if XORG, as per Dave Airlie's commit on 2006-01-18. commit ba632f697a782cd47870705b6cecaac2c60d30ff Author: Donnie Berkholz <spyderous@gentoo.org> Date: Mon Apr 17 07:10:31 2006 +0000 Fix kdrive build by linking in libexa before KDRIVE_LIBS. commit 0e62d92d5b809bc3a6503e9bc386cf961fc22557 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 14 23:43:32 2006 +0000 Coverity #804: Another leak on OOM path. commit d61219aaadf9e4aa83644a69627d3a1d3282c95f Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 14 23:38:11 2006 +0000 Coverity #806: Another memory leak on OOM path. commit 1b04e313920447e4c1f42bdd5a61f188d463210c Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 14 23:32:22 2006 +0000 Coverity #847, #848, #849: Three more memory leaks. commit 6545051902f2ce00c98bd1373f97ebc942667e9c Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 14 23:10:59 2006 +0000 Coverity #1003, #1004: Two more useless null checks. commit ab1d420022fb09d36a0d6ad948c38147c65b9adf Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 14 23:09:38 2006 +0000 Coverity #1005: Avoid a null deref. commit d01e0956a8903fb41e8a34c78973b9b2860b6446 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 14 23:08:10 2006 +0000 Coverity #1007: Fix a silly null check. commit 6d29f659318364afe046dc242d6f506ce40a944a Author: Luc Verhaegen <libv@skynet.be> Date: Fri Apr 14 23:01:35 2006 +0000 CVT means Coordinated Video Timing instead of Common. commit 82b6ea1a4b414426072bf001daeb3e9de0e93589 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 14 22:51:19 2006 +0000 Bug #6580: Don't install xf86drm.h, that's libdrm's job. commit aefa347bded9a3179ab139d0ccddce314040e9b9 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Apr 13 21:08:25 2006 +0000 Fix build for added file to Mesa CVS. This is always fun. :( commit 6aadd454e70d83921685b58bf57ec30d95920734 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Apr 10 10:11:19 2006 +0000 Fix stupid thinko. commit c9f6e60d42dec82d06995c05a2a011c338cadd87 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Apr 10 08:50:33 2006 +0000 Coverity #826: Fix potential memory leak. commit 1357af2474be9a3bce7ee2350fd4252eee89a3b1 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Apr 9 17:39:10 2006 +0000 Coverity #340: Fix potential NULL dereference. Clean up proliferation of 'register int n' in loops of ProcXkbGetNames. commit f324be00c547effc698ae6679d12ffe90bd90e43 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Apr 9 17:28:42 2006 +0000 Coverity #324: Fix potential NULL dereference. (Alan Coopersmith) commit 7637aa17f21e26d979fbb210a638d6751c98b1eb Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Apr 9 17:26:17 2006 +0000 Coverity #169: Fix potential fgets() into NULL (?!?). commit d5bc41b88272b4a3a1841cc1189720b0549db215 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Apr 9 17:15:51 2006 +0000 Coverity #323, #445, #446, #447: Fix potential NULL dereferences. commit 2387bfa5ff5ed82f3f732fb9152c1ea95850a914 Author: Aaron Plattner <aplattner@nvidia.com> Date: Fri Apr 7 18:56:04 2006 +0000 Bump the ABI versions. Due to Glyph privates and the XV update below, the video driver ABI needs to be bumped to 1.0. The rest of the ABI minor versions were bumped to include the LoaderGetABIVersion function. Add a DrawblePtr argument to the XV hooks. This allows drivers to determine that the target window is redirected and draw to the appropriate place. commit dc43909219fe2a4d03139638814b89032b2921b9 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Apr 7 17:49:32 2006 +0000 Fri Apr 7 13:46:45 2006 Søren Sandmann <sandmann@redhat.com> Use FreeResource instead of deleteCompOverlayClient() commit 94e7213d594dbbb53a6bb05d1dab7514c4ff5350 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 16:08:50 2006 +0000 Remove libc wrapper types from Xisb interfaces. commit 47bdc9528c2dd4ea9d59a0944c023173ea7a7a66 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 7 16:07:50 2006 +0000 Coverity #844, #845, #846: Fix memory leaks. commit 2c90c3bfef8563f739a72bb645dd52b35b6ff6d5 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 7 15:57:17 2006 +0000 Coverity #987: Avoid potential NULL dereference. commit 843146cfbaef234e13df9a62b6f0232a5efdf7f0 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Apr 7 15:53:21 2006 +0000 Coverity #1216: Fix double-close of file on error. commit 5dacc822327689c0f096093756473c96fba67d76 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 7 02:20:11 2006 +0000 Coverity #333, #334 - eliminate unncessary test for always true condition in fbEvenStipple. commit 75a9afdbf42e4196471774102e1758f18866bec6 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:53:43 2006 +0000 Coverity #488: Avoid smashing an array on malformed config files. commit 20c1ef2cc30abe45eeaf5b0833cbc0095ed05c02 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:50:07 2006 +0000 Coverity #769: Fix a potential memory leak for systems that allocate on malloc(0) commit 5ef711032b821be82fd7281fe64872bcbaff0327 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:41:00 2006 +0000 Coverity #838: Plug two more memory leaks. commit 69477ea4b6e666940c5dd4422bedfa6432dead04 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:37:11 2006 +0000 Coverity #837: Fix another another memory leak. commit b472ce7307dd88a21c7713a2b127e34f5c2bc817 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:35:43 2006 +0000 Coverity #836: Fix another memory leak. commit 9c84ed5f8d9eded1a8b509c9cad1ca0ebcf2166a Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:34:29 2006 +0000 Coverity #835: Plug memory leak in extension section parsing. commit 12924d0da36ad2266bb040caac58534c07e85261 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:29:39 2006 +0000 Coverity #812: Fix parser memory leak. commit 49abff79957799e9229d5c0226ee1b0d7505003d Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:26:33 2006 +0000 Coverity #818: Avoid memory leak on error path. commit bda292120fc97f890c1f58a31177c0f7c0bfa048 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:23:50 2006 +0000 Coverity #985: Avoid segfault on malloc failure. commit 536628bb4bcb0a0d749e0c01412a5eb5d6d24063 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 7 01:18:01 2006 +0000 Coverity #1037: Sanity check idx before use. commit 53e97ce4ddd993248561c245143b61915ea254b5 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Apr 6 22:04:12 2006 +0000 missed a line while removing cfb16 commit 4ae12636694af05cee4287b119bde08e9ceaa8aa Author: Adam Jackson <ajax@nwnk.net> Date: Thu Apr 6 18:59:11 2006 +0000 Remove cfb16, no longer used. commit e1fc15a85fb367ee9afd63c920c3327c3f45158d Author: Fredrik Höglund <fredrik@kde.org> Date: Wed Apr 5 21:08:45 2006 +0000 Put the screensaver extension back in the Xext module. Move the screenSaverSuspended variable to DIX globals. Restore the old link order for the Xorg and Xdmx binaries. commit 383c2e1e9ec54ab9de356993ad552c1aa6ec094f Author: Ian Romanick <idr@us.ibm.com> Date: Wed Apr 5 19:52:12 2006 +0000 Include fbmmx.h in fb/fbwindow.c when USE_MMX is defined. Fixes build problem on x86-64 resulting from fbHaveMMX being a macro instead of a function on that platform. commit 4697da177d545a2f8bb6fd0d6588a1c40532c339 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Apr 4 18:30:28 2006 +0000 Initial checkin commit 83ea57bcc82f478a7ecdcd6ed73ca4be01cd9c26 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Apr 4 14:39:06 2006 +0000 Bug #5729: Convert xf8_16bpp to fb. chips(4) users please test. commit 4c7da861185080d15b3ff4301af4af0e85a71f93 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Apr 4 14:17:04 2006 +0000 Bug #5300: Fix missing spaces in the Build OS line in the log. (Egmont Koblinger) commit fb6f61b50f1c701041680e49f6a406a6603f1577 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Apr 4 12:36:16 2006 +0000 Bug #4806: Dump the raw EDID contents in hex to the log file for better debugging. (Philip Prindeville) commit 14af50371c7f23855781924cdf6afa6ab7566a87 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 22:00:06 2006 +0000 Bug #2142: Make font path logging more readable. (Eduard Fuchs) commit 373f9f92566290d979730c09c9c5c5d50e23390c Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 21:45:54 2006 +0000 Bug #4766: Convert all Xprint drivers to fb. commit d9b8bfbfafe8758ceb629606607e37546d51ca52 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 21:16:30 2006 +0000 Bug #5478: More use of fbSOlidFillmmx. (Jim Huang) commit b0e67782653033c6518944adfbf23e466bd8bc39 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 19:50:15 2006 +0000 Bug #6346: Build fix when using gcc -mno-sse. (Jonathan Adamczewski) commit 66500819b1ca730a7b1df400a8368a08cbe49335 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Apr 3 11:37:30 2006 +0000 Bug #1358: Make ISO_Prev_Group cycle/wrap as ISO_Next_Group does. commit 2a6c11aa3b06f13dad94f3441c7184e6720a2bf4 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Apr 3 09:12:28 2006 +0000 Fix a server crash due to memsetting beyond allocated memory when running GL applications. commit f6ca2b3ea92b7fe98408c51a17a590435e808b1d Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 02:15:55 2006 +0000 Coverity #38: Dead branch elimination. commit 9b9dd747d8f4697c6d5c947c160d5991c7c8fde5 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 02:13:47 2006 +0000 Coverity #75: Dead variable elimination. commit 3f87aeefb4be3ac23ae636d3756ffdc446eaa62d Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 02:12:11 2006 +0000 Coverity #82: Dead variable elimination. commit 61926dbe592468076f8c9a666f0098d067d2213e Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 02:09:05 2006 +0000 Coverity #271: Fix an unbelievably boneheaded NULL chase. commit 7ef95da8a3e22e710882590fc47d56893159cb5d Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 01:51:54 2006 +0000 Coverity #616: Fix a rare memory leak. commit 01ebd633017249c496f378df511586c973d49708 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 01:43:33 2006 +0000 Coverity #833: Fix a rather nasty memory leak. commit a01f17d6dec02f80144e108f748783cb4e429ebb Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 01:35:05 2006 +0000 Coverity #983: Move some risky debugging code inside #ifdef DEBUG. commit c03cfca3806f45948627715b25b46839a07be979 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 01:31:59 2006 +0000 Coverity #986: Prevent a NULL chase. commit 07ecf49521973bbb205b199c39e1171f1163df2b Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 3 01:28:11 2006 +0000 Coverity #992: Prevent a NULL chase. commit c6b3b3354c2d9139b19b132051d434e97dd19715 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Apr 2 22:51:42 2006 +0000 Bump to 1.1.99.1. commit 7e085f52b6f07c076bd3bcfdce27c17d14d7822e Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Apr 2 22:31:13 2006 +0000 Use xf86LoaderCheckSymbol to check for DRI symbols instead of dlsym, avoiding RTLD_DEFAULT. (__glXDRIscreenProbe): Change GLX-DRI to AIGLX in LogMessage for consitency. commit b2097b99a2e6cc045ee9b6d80946bc06c4d9302c Author: Adam Jackson <ajax@nwnk.net> Date: Sun Apr 2 21:45:03 2006 +0000 ../stub commit 4e3a4cfdd1d7153eb88aab05ed02ddb32601ae93 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Apr 2 06:22:05 2006 +0000 Use RTLD_DEFAULT, rather than relying on NULL happening to map to it as it does on Linux. commit 323fec20292fc5ad90bfee9015ecccdc13c968ad Author: Adam Jackson <ajax@nwnk.net> Date: Sun Apr 2 00:46:20 2006 +0000 Reorder link order for Xdmx to fix new screensaver variable reference properly; remove previous awful hack. commit a605b9ffd3c2e7d227e35b911761f720bf07b7e6 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Apr 2 00:09:43 2006 +0000 Fix some includes to point into X11/fonts/ properly. commit e5b1d38e142807b59ce4ec89764c949f707ec541 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Apr 1 23:53:33 2006 +0000 Disable Xprint freetype support momentarily. Needs ttf2pt1.c, which exists in the monolith but has an advertising clause in the license. commit ccca76b8083b83825fa16483b44e8926a35412bb Author: Eric Anholt <anholt@freebsd.org> Date: Sat Apr 1 23:41:23 2006 +0000 Clean up warnings and a debug printf. commit 6afa814ab16f351b2eb787e5bf481a1f9738b391 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Apr 1 23:28:17 2006 +0000 Pull out fb's tile handling during fbValidateGC so we can do the necessary exaPrepare/FinishAccess()es. Revealed by xtest with fakexa. commit 277f612d4eeb89adb8ccda4e8fd3d211d8d1705e Author: Adam Jackson <ajax@nwnk.net> Date: Sat Apr 1 23:19:08 2006 +0000 Hack around the new screensaver variable for DMX, which is otherwise blissfully ignorant of it. commit 5f95146fcfcae60cc29265799ba3b851647105d6 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Apr 1 22:35:16 2006 +0000 Export exaPrepare/FinishGC to the rest of EXA, and use it in the ImageGlyph implementation to avoid unprepared access to the tile. Also, relocate the fbGetDrawable to avoid using a stale dest pointer after exaSolidBoxClipped() may have migrated it. Revealed by xtest. commit c720ffe875e4b2038746ff9b4767f8b90db0a307 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Apr 1 22:17:44 2006 +0000 Use fb's depth-to-planemask computation, which doesn't suffer from getting a 1 planemask at depth 32. Fixes Get/PutImage xtest tests. commit 5c0a2088e229d05c38e5df7daea45af0d7db7daf Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 1 21:49:44 2006 +0000 Bug #6428: Fix off-by-one error when walking off the end of the vmodmap list. commit 1e764feab595b781dab22d6e41c26f118c9d41b5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 1 21:20:31 2006 +0000 Bug #5801: Check for MTRR support under Linux. Minor refactoring of MTRR checks for other OSes. commit 978c7b14a18caffde5600480824d04492fc32aef Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 1 21:02:40 2006 +0000 Make Xprint AC_ARG_ENABLEs and AC_ARG_WITHs unconditional also. commit 71a6f2ef6c1138c5c6918a54dfb856183f4f242c Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Apr 1 20:58:42 2006 +0000 Unconditionally run XP_USE_FREETYPE AM_CONDITIONAL, not only in the Xprint path. commit d1e90113fc32b6ddc4dbe1a074763c31bc133e75 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 31 23:22:29 2006 +0000 Don't attempt to Prepare/FinishAccess NULL pDrawables. Exposed by new gradient testing in rendercheck. commit 2e38fedd29e7e55d01e3edce6a73b8ceaac17911 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 31 19:41:28 2006 +0000 Add an option to EXA for the DDX to request that EXA hide the pixmap's devPrivate.ptr when pointing at offscreen memory, outside of exaPrepare/FinishAccess(). This was used with fakexa to find (by NULL dereference) many instances of un-Prepared CPU access to the framebuffer: - GC tiles used in several ops when fillStyle == FillTiled were never Prepared. - Migration could lead to un-Prepared access to mask data in render's Trapezoids and Triangles - PutImage's UploadToScreen failure fallback failed to Prepare. commit f480dc797b51f080f912efc7867d6d8e50be074c Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 31 19:25:42 2006 +0000 Revert mistaken commit to exa_unaccel.c. Should have been to exa_offscreen.c: Correct a typo in debug-only offscreen validation code. (Wang Zhenyu) commit 1a8167c1baa767fc056d1e17d96d0ea98a5f3b17 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 31 19:16:51 2006 +0000 Correct a typo in debug-only offscreen validation code. (Wang Zhenyu) commit 7ea30b507f4ce5ce20fbfaca80f7d5b53a99eb1d Author: Fredrik Höglund <fredrik@kde.org> Date: Fri Mar 31 18:49:38 2006 +0000 Move the screensaver extension from module to builtins. Add the server side implementation of the ScreenSaverSuspend request. Require scrnsaverproto >= 1.1, and change the linking order of the Xorg static libs. commit acca49b1a5a6c034f3b9d51d9016b8a7d43da809 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Mar 31 17:39:35 2006 +0000 Fri Mar 31 12:37:16 2006 Søren Sandmann <sandmann@redhat.com> Fix copyright statement commit b074ce22470ba0a51eda2af7100d09a260a1e8bb Author: Egbert Eich <eich@suse.de> Date: Fri Mar 31 15:11:51 2006 +0000 fixed typo. commit 710bb2e6c8b2874406e48fa8ad24539290c98d41 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 31 14:52:57 2006 +0000 Reindent with -cbi0. commit 7c44bb8c49656133eae675377edea55322d254ca Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 31 07:33:34 2006 +0000 Simplify XkbWriteXKBKeymapForNames a bit, and remove debug spew. commit 4c317bbc1259fa555dc5d5278226b21c42845c0c Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 31 07:21:41 2006 +0000 Add full FreeType support for Xprint. (Drew Parsons) commit 759033703ce17b20d57756206f48a7ae410a50d1 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 30 21:44:36 2006 +0000 Remove the exaAsyncPixmapGCOps mostly-unaccelerated ops vector, and always plug in the accelerated one, even if the destination pixmap is currently offscreen. This was a leftover from when kaa originally got accelerated offscreen pixmap support, and its only concievable use was to avoid a little overhead on ops to in-system pixmaps that weren't going to get migrated. At this point, we probably care more about just getting everything accelerated that we easily can, which should happen with the new migration support. commit b9203dc068ccd4c0d22d49a94b910783432b96a8 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 30 21:25:43 2006 +0000 Don't do an extra fallback path for CopyWindow while swappedOut, since exaCopyNtoN takes care of the fallback anyway, and we don't care about the performance of this path. commit 5c04610f8aeceed9ec7cd0ca8c5eb314cacc3c25 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 30 21:21:59 2006 +0000 Add a dependency on EXA, so it rebuilds when the library does. The manual indicated I shouldn't do this, but experience indicates I should. commit 8ec42a10ff04e51e8d0b4cffb15064d901bc398d Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Mar 30 20:08:44 2006 +0000 Mark the ARGB FBConfig as nonconforming to prevent drivers and apps from falling over. Add @GLX_DEFINES@ so GLcore gets compiled with TLS support if configured. Only destroy the mesa buffer if it got initialized. commit 08e319091fae7a60ae9fa757659cfde2966af9e9 Author: Egbert Eich <eich@suse.de> Date: Thu Mar 30 18:53:41 2006 +0000 Added notice to last ChangeLog entry Fixes for some vsw4 failures on 64bit BE platforms such as PPC64 and s390x. Provided by Hong Bo Peng of IBM (slightly modified). Patches try to resolve some of the careless mixtures of ulong and uint (which are different size on 64bit). > This patch will break the driver ABI! < Bugzilla #6438. commit 9da1d2257d02155cc8b4541cf5fcb4e64d756945 Author: Egbert Eich <eich@suse.de> Date: Thu Mar 30 18:48:11 2006 +0000 Fixes for some vsw4 failures on 64bit BE platforms such as PPC64 and s390x. Provided by Hong Bo Peng of IBM (slightly modified). Patches try to resolve some of the careless mixtures of ulong and uint (which are different size on 64bit). Bugzilla #6438. commit 6d7ad353bafe914f0b50887daaeaae89ada6ebd3 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Mar 30 18:29:53 2006 +0000 Regenerate these files using updated scripts to avoid unused variable warnings. commit 2153fa97482bae5737def3ecd4fe1cdc03834991 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 30 05:24:27 2006 +0000 Bug #2986: Add PutImage acceleration for the ZPixmap, planeMask ~= FB_ALLONES, bitsPerPixel >= 8, GXcopy cases. With the radeon driver on my machine, this gives about 10% speedup in PutImage 10x10 and 500x500, and 40% speedup for 10x10 ShmPutImage, up to 65% improvement in 500x500 ShmPutImage. Also fixes a crasher in GetImage that slipped in at the last minute. commit 3cf46cc1e32efc0e4be1d88be111ba0438e0f021 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 30 05:15:58 2006 +0000 Add an UploadToScreen implementation, for testing PutImage support, and make the DownloadFromScreen more robust. commit e799dd68e2bd0fa8ac3c344111fb12e1f32d4c10 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Mar 29 22:25:17 2006 +0000 Bug #2986: Add acceleration of GetImage using DownloadFromScreen for the ZPixmap, planeMask ~= FB_ALLONES, bitsPerPixel >= 8 case. I'm pretty convinced that this is the only case that we care about at all. Tested with xwd -root and xwd on a gnome-terminal, in a composited environment or not. commit 4bb5ab0b4453208573b91b334940f190a8f7210a Author: Eric Anholt <anholt@freebsd.org> Date: Wed Mar 29 22:03:18 2006 +0000 Add a DownloadFromScreen implementation, used for testing GetImage acceleration, and set the migration scheme to Always on init (since this is all for testing, and Always should make migration happen more frequently than Greedy). commit e31e8ace1043eab340d6b60a6e98b23ebf102786 Author: Deron Johnson <deron.johnson@sun.com> Date: Wed Mar 29 17:51:54 2006 +0000 Fix composite overlay window bug 6411 commit ff6f88348c7498e83b0b143ef3737fd6eb0995e4 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 29 01:05:09 2006 +0000 More warning cleanup. commit 52d9ce7f4fc599d30dec2e61fc1720597043d91c Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 28 21:45:14 2006 +0000 Fix another typo. commit 7df64898eac46a487e8eab2af7213d133b9ca419 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 28 07:46:04 2006 +0000 Fix a couple of typos. commit bd283c2464e2c0e1fd0aca1dedff0f39c2564c34 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Mar 28 07:21:50 2006 +0000 Add a new export, LoaderGetABIVersion. This function allows modules to query the versions directly instead of having to guess. Bug #6416: Add LoaderGetABIVersion. commit a06342eccc76035ff859fee4d283b288c90ee923 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 28 02:57:07 2006 +0000 Add --enable-glx-tls ./configure option to enable use of TLS for storing current GL context. Use this option to let AIGLX load DRI drivers compiled for TLS. commit 77531dfb9f9f3ca0e38ad0555ee3735d6f28cf19 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Mar 28 01:22:01 2006 +0000 Silence some editorializing in the configure help text. commit 7deaaa797cf8e7ca71e9b34fa6f413d1ed2b3dab Author: Adam Jackson <ajax@nwnk.net> Date: Tue Mar 28 01:21:00 2006 +0000 Big old pile of warning fixes. commit 7342dbe4b2108827eaf30993ceeecbd828da2290 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Mar 28 00:18:31 2006 +0000 Remove long-dead screen region code. commit 0e88cefbfecbff0c7dd606ce0caca840f45cbc0d Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Mar 27 23:03:47 2006 +0000 Prune XKB code to only what we need to run the server. Remove dead !XKB_IN_SERVER codepaths. Remove HAVE_CONFIG_H codepaths. commit 5be8a66d324f3d5840b134ad29069eace64e6f12 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Mar 27 22:28:32 2006 +0000 Fix remnants of previous busted _XkbStrCaseCmp commit. commit 9e202dfe40e2bdd66f461a6ba531e927f82096ae Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Mar 27 22:25:56 2006 +0000 Remove remnants of XkbCF code. commit 7257590651328f89d23e80da1ec6241542a660cd Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Mar 27 21:15:06 2006 +0000 Move XFree86 DDX XKB actions into dixmods. commit d7b9e2b0e9d6889ea6b05e63892e612f4e5f19f5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Mar 25 23:09:50 2006 +0000 Bug #3819: Remove open-coding of strcasecmp. commit b3570dd94aa72f94e537a17680150e91e7712f5a Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Mar 25 22:37:58 2006 +0000 Remove INITARGS braindamage, change to void; add XkbExtensionInit prototype to xkb.h. Explicitly initialise nTypes in xkb.c. commit 1ef60ce8ebb681b3cfb5e515be5c187c0442dcda Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Mar 25 22:35:48 2006 +0000 Really remove all DDX pre-config code. commit ec10f70b2114e5369a5b2f34b084dcf55634dcb4 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Mar 25 21:52:49 2006 +0000 Remove XkbCF DDX configuration code. commit aae4238360b842ac34dc8ee16e165a1821f9a801 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Mar 25 20:17:58 2006 +0000 Fix two glaring unconditional-NULL-dereferences. commit a68c11bb1d7c5419004a1714e49dffac57304e78 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Mar 25 19:52:05 2006 +0000 Mark everything in xf86sym.c as _X_EXPORT. commit ae935832facfa81a9689882406ecca74b0346790 Author: Fredrik Höglund <fredrik@kde.org> Date: Fri Mar 24 20:50:13 2006 +0000 Refactored the screensaver and DPMS timer code to use the screensaver timer for both screensaver and DPMS. Removed the SetDPMSTimers() and FreeDPMSTimers() functions. commit d1746ec0f0c8a0b750f390e7a7faf21b67683f4a Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Mar 24 17:58:39 2006 +0000 Make sure DRI module is loaded before calling DRI functions. commit f1616508c95d12dfaad2cfd61b40228b3dba6f60 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Mar 23 23:54:08 2006 +0000 Add ast driver/pci id (Carl Switzky, Sun Microsystems) commit 6d2896b384e17512e8f12036daabcd575d21f804 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Mar 22 22:49:52 2006 +0000 Improve error logging. commit 5449634e3c9428005aba5b3322ced7e86c62f185 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Mar 22 21:37:49 2006 +0000 Wed Mar 22 16:28:46 2006 Søren Sandmann <sandmann@redhat.com> Use inline assembly for copy area, since gcc doesn't generate movq instructions. commit 5b3084c64f7bd1232603ffb3e985600b8d045453 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Mar 22 21:13:08 2006 +0000 Wed Mar 22 16:05:09 2006 Søren Sandmann <sandmann@redhat.com> Use inline assembly for solid fills, since gcc doesn't use the movq instructions. commit a08e5e0c68baaf85b0fc3ecde74a6bcf80bcd4bf Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Mar 22 18:44:26 2006 +0000 Wed Mar 22 13:42:44 2006 Søren Sandmann <sandmann@redhat.com> Patch by Keith Packard to make sure redirected windows don't get considered "FullyObscured". commit 966d93ef6d1f2ed02f3b81b5bf5a1ebbdd48c93d Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 21 22:54:38 2006 +0000 Make the server distcheck and tag 1.0.99.1 snapshot. Bump CVS version to 1.0.99.1. Distcheck fixes. commit 8e3ad87d01c102591c7dc25614f6ac10e444a1b1 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 21 22:32:13 2006 +0000 #include indirect_dispatch to get prototypes for FBO functions. Fix a couple of warnings. commit dcc43d57cbe9d2b65384fe9ba2e4e4fbb43cb0a1 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Mon Mar 20 20:10:29 2006 +0000 Finish glx_ansic.h wrapper changes to make Xvfb and Xnest link again. commit 9509c6799e31e96677b6d07bdf24ea91ddd30020 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Mar 20 19:32:18 2006 +0000 dead file removal commit 61a020265c5915e3d671d5b2047b81a5d15594c3 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Mar 20 18:43:18 2006 +0000 Bug #5549: Fix build for sparc64. (Matthieu Herrb) commit 6eb4e2303aaab8d64e3f6cbc0bbee55689bdcb82 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Mar 20 14:01:05 2006 +0000 Bug #6213: Check geteuid's return value, not its address, otherwise unprivileged users can set the modulepath and run arbitrary code. Patch from Matthieu Herrb. (CVE-2006-0745, Coverity #4) commit 8c1bb37d0649b269b78c457b8b41ff59a41d89af Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Mar 17 08:55:07 2006 +0000 Typo fix, reindent. commit 2d2d38d17cc2558f8a41166a4a1578bc4c663c37 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Mar 17 01:47:25 2006 +0000 Check for glproto when building GLX and make sure we have at least 1.4.6. Drop glx_ansic.h wrapper and call xalloc, xrealloc, xfree and str-funcs directly. commit 2c11cde3367fcd22740b577a4364b1e41cf3e1d2 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Mar 17 00:35:18 2006 +0000 More patches from David Reveman: Add GL_ARB_texture_non_power_of_two, GL_EXT_framebuffer_object and GL_NV_texture_env_combine4 extensions. Add __GLXcontext destructor and flush context cache there and on loseCurrent. Chain back to new __GLXcontext destructor. (__glXMesaContextForceCurrent): Set render table on forceCurrent. (init_screen_visuals): Index pVis array correctly. (GlxGetMesaProvider): Add this. Hook up FBO marshalling. commit 14aafc258cd774cf937f9798a888c2d3c97ccacf Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 16 18:43:55 2006 +0000 Change EXA so that exaMoveOutPixmap() retains the framebuffer copy of the pixmap, and damage is tracked so that a later exaMoveInPixmap won't result in an upload if no upload is necessary. This will likely improve the performance of the "Always" migration scheme significantly, and is a step in the path to more exact damage tracking between framebuffer and system memory. commit d0d336efd58896718f31a400651bacd9b769fb5a Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Mar 16 16:29:17 2006 +0000 Add support for ZX2 PCI-E local bus adaptors. (Alex Williamson, HP) Use soft timeout register to avoid MCAs when probing for non-existent local bus adaptors on ZX2. (Alex Williamson, HP) commit 175980580e572745a9a381b4432e3ba0457d3ba3 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 23:05:53 2006 +0000 Bump to requiring fixesproto >= 4.0 and compositeproto >= 0.3. commit 6fe377af5a82deb6f8b0f3b75414335e7845caac Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Wed Mar 15 21:25:38 2006 +0000 - OpenBSD needs -Wl,-export-dynamic to export symbols from main executable to modules. - Probe for OpenBSD aperture driver and define HAS_APERTURE_DRV accordingly. commit 21f7f2fb113ee4f9cd011c3cc2d45d43bbdd35fa Author: Felix Kuehling <fxkuehl@gmx.de> Date: Wed Mar 15 18:43:32 2006 +0000 Enable correct handling of the BTS instruction (opcode 0f ab) The code was there but #ifdefed out. Insead of BTS, BT was executed. This patch enables the BTS function and hooks it up the the correct opcode. (ATI Technologies Inc.) commit b726aa502a871c700bc42b5325abf2c6820ff756 Author: Felix Kuehling <fxkuehl@gmx.de> Date: Wed Mar 15 18:37:44 2006 +0000 Update to build against Mesa CVS HEAD. commit c74464d92cd673ff0669375757caab798cc57e95 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Mar 15 16:59:45 2006 +0000 Don't let pinned pixmaps get migrated in when using the "Always" migration scheme. This notably keeps the visible screen from getting migrated in to a new location in framebuffer. Reported by: Michel Dänzer. commit b9c43cde1e368903786977b06368d5e36db9ffe8 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:56:10 2006 +0000 Coverity #1042, 1043: Nuke some dead variables. commit 5e106a71b9f8077216d41619402952b0005dd8a4 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:49:04 2006 +0000 Coverity #807: Fix a memory leak in XFixesExpandRegion. commit a3ef63696cac950b2520e7c85564befc0a830fde Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:36:31 2006 +0000 Coverity #490: Fix a range check in xf86vidmode extension. commit 152090ce442e94de1ae920208a92931af6493c8c Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:33:12 2006 +0000 Coverity #487: Check version number correctly. commit 72cc6307257fcbb800267464487bf918ee674328 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:32:05 2006 +0000 Coverity #491: Check version number correctly. commit 460f2ea4a594a53536f34c4ad27795fceec50bcc Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:21:04 2006 +0000 Coverity #794: Fix a highly unlikely memory leak. commit 116d158e85ec43577ff69aeb3271ab1f888500c9 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:16:24 2006 +0000 Coverity #269: Compare the requested ABI class against the ABI class of the module, not the module class. commit d8221a9b70a11606a0f7e1f69afee6049d7f182f Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:11:34 2006 +0000 Coverity #484: Fix an off-by-one in module refcounting. commit 6bb2dc02a7cffd6ed7dd28e88d584920a4150749 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 16:01:47 2006 +0000 Coverity #337: Remove useless NULL check. commit 1e5c0842af99027cc6c30a16f967d8b60c9a894d Author: Adam Jackson <ajax@nwnk.net> Date: Wed Mar 15 15:34:57 2006 +0000 Coverity #1053: Nuke a dead variable. commit 7314d16cde4c3f99d9d9f1d539f0c5ff4942e653 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Wed Mar 15 03:18:42 2006 +0000 Fix DRIExtensionInit() to not register callbacks when it hasn't been initialized for the current server generation. Fixes a problem where it would use stale private index and blow up in colorful ways if no driver called DRIScreenInit() on the second generation (which happens due to a bug in radeon that i'll fix separately). Note: clearing the index in DRIReset() wouldn't work as DRIReset() is called before the CloseScreen() chain commit 02d80a0de93f7592e69065b0fbe5820dcdebdb44 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Wed Mar 15 03:12:32 2006 +0000 Make xf86 linear allocator smarter when dealing with alignment constraints when falling back to X/Y allocations. Fixes various problems of Xv allocation failures, notably with "nv" driver. commit c1601717d536419693b3ef6e8a3d69b9f2fdc2b3 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Mar 15 01:20:08 2006 +0000 Add a new migration scheme, "always", which will move pixmaps to their desired location always (unless they don't fit in FB, in which case they all get moved out for software rendering). The default remains as before, but can be controlled by the MigrationHeuristic xorg.conf option (which is intentionally not documented, as it may be short-lived). This is part of the exa-damagetrack work, which appears stable in testing with fakexa, unlike the work as a whole. commit a90cff266cc81993ed804fb320c1dbfe5e0d4787 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Mar 15 00:13:52 2006 +0000 Add more doxygen documentation, including notes on WaitMarker() and MarkSync() that I noticed were needed while reading the VIA driver. commit 693e42114f1127528448126d78a5209dd1198d8d Author: Eric Anholt <anholt@freebsd.org> Date: Tue Mar 14 21:30:12 2006 +0000 Move migration logic to a new function, exaDoMigration(). This is largely a manual conversion to allow for different migration schemes to be implemented reasonably, but does include some minor improvements such as accounting for pinned pixmaps not being acceleratable, and for our current GetImage and GetSpans not being accelerated. commit d30905478078036383977ae9d4a3685c2e2c642f Author: Eric Anholt <anholt@freebsd.org> Date: Tue Mar 14 20:38:06 2006 +0000 Pull code for getting the (0,0) pixel from a pixmap out to a separate function, since it gets repeated (with bad error handling, in one case). commit 01aa209f2056ef04e3f2735756a0f8b4a67a3d87 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Mar 14 19:32:27 2006 +0000 Bail out early if screen doesn't support DRI. commit 0cc34266d6e84bb491fcf9aa74e34615b2fca4fc Author: Deron Johnson <deron.johnson@sun.com> Date: Mon Mar 13 22:43:42 2006 +0000 Updated ChangeLog for my latest composite and xfixes changes. commit 450018f48b2796345a4eaccbb94c1971ebd30114 Author: Deron Johnson <deron.johnson@sun.com> Date: Mon Mar 13 21:59:55 2006 +0000 Part 3 of 3 (Other parts are in proto and lib) Composite Version 0.3: CompositeGetOverlayWindow, CompositeReleaseOverlayWindow Xfixes Version 4.0: XFixesHideCursor, XFixesShowCursor commit e5956f49b217b0ee9c9f35b6a58f339a8d22b1d7 Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Mar 13 01:54:59 2006 +0000 First batch of AIGLX fixes from David Reveman. Add getter for Mesa provider. Export this for Xgl. Move resource tracking out of drawable constructor to allow wrapping. Use corrent reply size #define. Add this function. (DoGetDrawableAttributes): Fix array length. commit eb63e50d95da4e1e08fc6fcec46ac63d5e3b7bf4 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 12 17:14:03 2006 +0000 Fix build when AIGLX is false. commit 9ed3463450469c3108e0be7e4baabc0a403a78b2 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Mar 12 03:04:52 2006 +0000 Improve doxygen formatting, and attempt to clarify the 1:1 ratio of successful PrepareCopy()s to DoneCopy()s. commit 9a7fba5fd07c8831d0acab8d901605de537ae273 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Mar 12 03:02:26 2006 +0000 Make exaCopyNtoNTwoDir() call DoneCopy() at the end of each string of consecutive Copy() calls (rather than exactly once at the end of the function). Reviewed by: jbarnes commit c3342c8000f6d2bfb61e2cf95e028d11b59698fa Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Mar 12 00:11:34 2006 +0000 Merge accel_indirect branch to HEAD. commit b1b731c28630965d9e2defe62d1108270dc8264c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Mar 11 02:43:51 2006 +0000 Fix buffer size checks to prevent 2-byte buffer overflows. (Coverity #480, #481, #482, #483) commit fc0772de36315f19f5b57220db69f48a3b1fdc9a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Mar 11 02:10:14 2006 +0000 Add HAS_MMAP for Xvfb Fix Xvfb option parsing to exit on bad arguments, not just issue error messages and continue on. (Coverity #492) commit f2ecbb30187000547a98ca7cbaee433ea4ba8fe3 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Mar 11 01:58:32 2006 +0000 Pass sizeof the correct buffer to XmuSnprintf. (Coverity #489) commit d6955798489813ef77cca13cf5f5c67d49e6dece Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 10 21:36:24 2006 +0000 If fakexa is enabled, create a larger buffer in the Ximage, but keep the same width/height for front-buffer drawing. The fakexa code then uses this extra space for offscreen pixmaps. Note that this tones down the absurdity of fakexa's offscreen pixmap alignment requirements (odd alignment is too weird, so stick with "24", which is still strange but exists out there). It also fixes a couple of bugs in the fakexa implementation revealed by using offscreen pixmaps. commit 5b1a7b478f072f56e836f2d4c0fbc1985842e2bb Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 10 21:32:34 2006 +0000 Move the exaDrawableDirty in exaPrepareAccess to exaFinishAccess, which is after the drawing is done. Previously, a failed PrepareAccess could have migrated and cleared the dirty flag before the damage was ever done. commit ffdbb547becc71f1cfdd035d0d6c71539f185fb1 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 10 08:06:42 2006 +0000 Coverity #1011: Remove a useless NULL check on a pVbe that had been dereferenced many times before. commit 1bc72dce5f8bc40e369e69b684816fdaaa07da43 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 10 08:03:24 2006 +0000 Coverity #857: Fix resource leak in error path by freeing earlier. commit 55f677d600370b19d62ef821025481f2be6f5edb Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 10 07:58:27 2006 +0000 Coverity #813, #814, #815, #816: Fix resource leaks in error paths of config parsing code. commit 2bd41105496b729395fbcf97f09581eb0efb3510 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Mar 10 07:45:25 2006 +0000 Document the restriction on PrepareAccess() failure, from discussion with benh. commit 21dcd0304879f38ea8ea01ba88e7cc7783771adf Author: Jeremy C. Reed <reed@reedmedia.net> Date: Fri Mar 10 01:34:45 2006 +0000 Just like FreeBSD, let DragonFly's default mouse Device be /dev/sysmouse (since /dev/mouse don't even exist by default). commit 9a99afdfb292f303f914039952fdd772eed9e03a Author: Jeremy C. Reed <reed@reedmedia.net> Date: Fri Mar 10 01:22:26 2006 +0000 Add DragonFly support. (It is like FreeBSD.) This patch is from DragonFly developer Joerg Sonnenberger and the pkgsrc collection. I tested using /dev/sysmouse with moused using my serial /dev/cuaa0. commit 7a0f7f739804bc7d9c5562701abee8d134878977 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 9 23:29:44 2006 +0000 Coverity #349: Fall back to software early if pSrc->pDrawable is NULL, or pMask is non-NULL but pMask->pDrawable is NULL. This prevents NULL dereferences on gradients and other Pictures which have no pDrawable. commit 8a3ff42abb726d1604af39b4653ede5f760b7e69 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 9 23:25:35 2006 +0000 Commit changes missed in last commit (mis-typed path and didn't notice): Do a first pass of doxygen documentation of EXA. This removes the corresponding pieces of exa-driver.txt, which were becoming stale. Hopefully the documentation will stay much more up-to-date this way. Many thanks to jbarnes for writing exa-driver.txt which was used a lot in writing this documentation. commit ab35c3fbc135bafdfc5057ef5d6227ca3534ed26 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 9 23:18:15 2006 +0000 Do a first pass of doxygen documentation of EXA. This removes the corresponding pieces of exa-driver.txt, which were becoming stale. Hopefully the documentation will stay much more up-to-date this way. Many thanks to jbarnes for writing exa-driver.txt which was used a lot in writing this documentation. commit d8f8bfeccef0750d79f852b9ae7152e841227d5a Author: Matthias Hopf <mhopf@suse.de> Date: Thu Mar 9 14:23:57 2006 +0000 Do Xorg configure checks for Xgl only as well commit 2822cbc1fb2271844e7ae10c3629aaa940ae4042 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Mar 9 06:04:07 2006 +0000 Rearrange EXA driver structures so that there's a hope of maintaining ABI when extending the driver interface. The card and accel structures are merged into the ExaDriverRec, which is to be allocated using exaDriverAlloc(). The driver structure also grows exa_major and exa_minor, which drivers fill in and have checked by EXA (double-checking that the driver really did check that the EXA version was correct). Removes exaInitCard(), which is replaced by the driver filling in the rec by hand, and the exaGetVersion() and related EXA_*VERSION which are replaced by always using the XFree86 loadable module versioning. commit 65aa33f9173b1554924437685698f7c5f645a3c4 Author: Lars Knoll <lars@trolltech.com> Date: Wed Mar 8 06:19:37 2006 +0000 render/picture.c Initialize the format of a source picture to PICT_a8r8g8b8. Fixes a failure in the gradients test of rendercheck. In the long term we could do better by setting the format to something without alpha whenever the gradient doesn't contain colors with alpha. This triggers a reduction of the over operation to a pure source operation. commit cb5090e8d60f4e9780c859faeea5c24587f6bee7 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Mar 8 03:32:07 2006 +0000 Bug #6150: Do the obvious fix of an insane sanity check in xf86InitFBManager. (Julio M. Merino Vidal) commit 2e6f801fe1a749f6a4db2cfd8a43abec5caceae0 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Mar 7 23:58:22 2006 +0000 Numerous amounts refactoring and comment adding (see ChangeLog for file by file details). The primary intention for these changes is to pave the way for the new device probing and PCI configuration code that I'm working on. commit b7d2dfc1e5e07051732303731ff3e4e76852dd94 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Mar 7 20:06:15 2006 +0000 Add appropriate MIT license. Oops. commit 9d8c0e4bcbb111e860b7c3c33c224c22589006b1 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Mar 7 19:57:46 2006 +0000 Add a new flag to ephyr, "-fakexa", which turns on an EXA acceleration implementation that calls fb to get its work done. The purpose is to have a trusted EXA driver for use with testing changes to the core of EXA. However, fakexa has not received much testing yet, lacks offscreen pixmaps support, and doesn't reliably provide garbage when EXA doesn't get its syncing right. All of these should be fixed soon. commit 0a3d6c739968bf5af81fc0e8ea7211c20d52080b Author: Eric Anholt <anholt@freebsd.org> Date: Tue Mar 7 19:49:31 2006 +0000 Remove stale EXA files, which failed to get removed during the move to top-level, somehow. commit 68a8963f726cb92624665669813b6d952d53556e Author: Luc Verhaegen <libv@skynet.be> Date: Tue Mar 7 16:00:57 2006 +0000 Fix cvt -r check again. CH7011 TV encoder had 800x600 PAL hit the check. commit 0693083335185ce05ee64546151f3fc43ce98575 Author: Lars Knoll <lars@trolltech.com> Date: Mon Mar 6 21:00:09 2006 +0000 render/picture.c Correctly initialize devPrivates variable in source only pictures to 0 miext/cw/cw.h Don't try to access devPrivates of source only pictures commit 448997ebcd2bab02be1059b07b91b63b0d05d268 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 5 16:43:10 2006 +0000 Only output SetClientVersion message if verbosity > 1, like other extensions do commit d921173833cc207380eb08b6675393f5e8139d5f Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 5 16:35:08 2006 +0000 define SYS_LIBS to hold system dependant libraries that may needed. and add it to libraries list where needed. Update ChangeLog for previous changes too commit 82cbd2ee0d20225b9edbb5246c8ed116b4614e1a Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 5 16:33:17 2006 +0000 Don't hard-code -DUSE_DEV_IO here. configure generates the proper OS specific values here. commit b56a1513d27f84dcd55f3dc6053f183aa6f7855b Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 5 16:32:40 2006 +0000 Definitions for bswapxx() macros on OpenBSD. commit 4335868476af7c821c64def52b102b93ae91f8b0 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Mar 5 16:13:21 2006 +0000 Fix build with non GNU make. commit b2f8f410c0bb8bc24039b2a593f8a2a483659914 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Mar 3 09:54:54 2006 +0000 https://bugs.freedesktop.org/show_bug.cgi?id=4341 Make Xming error messages more meaningful. commit 29237c1977e454511e0d0244c68d34d572b68458 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Mar 3 09:50:55 2006 +0000 https://bugs.freedesktop.org/show_bug.cgi?id=4538 Fix mouse button release on multiwindows scrolling. commit 06f01623fde61f1a11c2c1ecfae6a4c346473b05 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Mar 3 09:43:42 2006 +0000 https://bugs.freedesktop.org/show_bug.cgi?id=5138 Check for NULL pointer commit 054c291b274b238893e408e070aef13a7933400b Author: Felix Kuehling <fxkuehl@gmx.de> Date: Thu Mar 2 18:35:08 2006 +0000 Fix build against Mesa CVS HEAD: added s_blit.c to symlink-mesa.sh. commit c1a82b9554028640dc4e08f042f1a8faf3372627 Author: Brian Paul <brian.paul@tungstengraphics.com> Date: Thu Mar 2 03:43:26 2006 +0000 added s_blit.c file commit 5f4d11c8d926cf396e0a8e203e14a8e1e123e011 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Wed Mar 1 16:31:53 2006 +0000 fix spelling error, document EXA_TWO_BITBLT_DIRECTIONS device flag commit 044a3abb382a4850722c391f04d09d3160790814 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Wed Mar 1 16:28:34 2006 +0000 Add accelerated two directional blt support to EXA commit 96ca329382141fd50dccb1cc35a71a333d80bce4 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Feb 28 23:07:09 2006 +0000 Remove redundant definition of struct Inst. Safeguard xf86AddDriver against future additions to DriverRec. commit 1cfa9f647e0241f4b9e56556b128d7bfd987eaca Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Feb 28 16:55:26 2006 +0000 Bug #5216: Allow options to appear with other components. commit e3b6b95f29cb2ea00b4290d694c5e202b8d180ad Author: Adam Jackson <ajax@nwnk.net> Date: Tue Feb 28 16:26:16 2006 +0000 Bug #5627: Fix Xprint font symlinking. (TIlman Sauerbeck) commit e7f0b84fa7bd0c40cb456ec4e447103442c8dae3 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Tue Feb 28 05:20:20 2006 +0000 fix exaInitCard by making it a real function commit 088e5768faa90fe16de41b135b1111b5d25c64ad Author: Felix Kuehling <fxkuehl@gmx.de> Date: Mon Feb 27 18:12:24 2006 +0000 Fixing the Mesa build again, sigh. Add slang_execute_x86.c. Add -I../shader/slang to swrast INCLUDES. commit 345d99c972cac67f2cdc38750e4ba2dea1cdb360 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Feb 27 16:19:39 2006 +0000 Typo fixes (Nicholas Joly, XFree86 bugzilla #1658) commit 6b08a5013b4e9e350ba461c9a59d30bb41feef8f Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Sat Feb 25 20:26:49 2006 +0000 EXA driver doc cleanups and additions. commit f41ec003f39c575299429897d4287233184583ad Author: Roland Scheidegger <rscheidegger_lists@hispeed.ch> Date: Sat Feb 25 01:17:10 2006 +0000 Add two radeon pci ids (one is used for a radeon mobility X700 XL in a medion notebook, the other is for a AIW X800 VE) commit 01a0bf881ada03ca3c27bdef7423c760c3bc2f9c Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Fri Feb 24 17:01:57 2006 +0000 OpenBSD supports PCVT and WSCONS. PCCONS is long gone. commit d3e1587c20c155b7873b6646ddf0b96f806f8a7f Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Feb 24 16:50:42 2006 +0000 file glxdri.c was initially added on branch accel_indirect_branch. commit 5d9a620726d2b0ad89625574478d2fd4536485b0 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Feb 23 19:25:57 2006 +0000 Remove redundant composite op reduction, done in Render now. commit 028d6903f674fa77617f333b25356710d1682b05 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Feb 22 16:29:07 2006 +0000 Bug #5978: Added missing swap of input variables. Added missing cases for GL_SECONDARY_COLOR_ARRAY and GL_FOG_COORD_ARRAY (Colin McDonald) commit 43324132afcbb6b231efcc24ec72ee44678d5771 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Feb 22 16:08:56 2006 +0000 Added Mesa include directory commit 43fbcc28c960ce5abe1d3223441c3dc5a10cde27 Author: Jeremy C. Reed <reed@reedmedia.net> Date: Wed Feb 22 02:47:00 2006 +0000 Update to build against Mesa HEAD. (Thank you Felix for feedback on xorg list.) commit cfdacab33a62b47f22bb54683e3ca20ec9824864 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Feb 21 00:02:08 2006 +0000 Eliminate unused PCI BIOS reading functionality. The old code used several function pointers to implement a level of flexability that was never used. The code also had unused support for extracting a single image type from a larger expansion ROM. Fix the spelling of PCI_BIOS_OPEN_FIRMWARE. Fix a couple errors in #ifdef debug code. These changes have been tested on x86 and x86-64 Linux. commit 5fd0f94006775e2271107c960dfa3314dddd9a5f Author: Ian Romanick <idr@us.ibm.com> Date: Mon Feb 20 23:45:50 2006 +0000 Eliminate all the code for querying the PCI class from the PCI ID database. Class information is not, and never has been, stored there. Therefore, this is just a bunch of elaborate code to read 0x00000000. This has received testing on x86 and x86-64 Linux. commit 6d7083bd69724586338d79784655328f1fcd2ae5 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Feb 20 22:16:49 2006 +0000 indent fixes (OMG SO UGLY), and nuke old RCS keywords. commit 5480c537cee79b324736eac3e438a4713dfa1036 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Feb 20 21:50:49 2006 +0000 ANSIfy Xi/. Mostly automated via protoize(1). commit cc42e153c2437fe9c94b0c20e1b56277474d94d0 Author: Felix Kuehling <fxkuehl@gmx.de> Date: Mon Feb 20 03:00:09 2006 +0000 Update to build against Mesa HEAD. commit ed3ea887a6b1c9fdc83895c40da34076121f05e9 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 21:49:51 2006 +0000 Fix the encoding of DES's name. commit ea0b3f65f77a78df1671b09739c00762a8875607 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 21:45:12 2006 +0000 Fix build of Xorg by putting xf86bigfont back into builtin instead of module sources list. commit d97f29be22e22e6f5bc23229ffa5ef087f992c8c Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 21:35:32 2006 +0000 Bug #5453: Don't forget to still do AM_CONDITIONAL for XVMC even if XV is disabled, and also force XVMC disabled if XV is disabled. (Dag-Erling Sm�rgrav) commit d33c2e0d1079f93f4ba8b28d19950d384a9e7c32 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 16 19:36:39 2006 +0000 Add oscolor.h commit 60d4839a2d373cc6d8c0d5004284494d3a994a63 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 16 19:03:07 2006 +0000 Forgot to include this file in previous patch commit 8987b2c1efc9a4667e278e6ba411772ba2a4a4e6 Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 16 07:17:31 2006 +0000 Make more extensions optional in build (for kdrive). Fix kdrive build for actual hardware. Fix kdrive pointer signed/unsigned types. Add kdrive-required YX rotation functions. Replace rgb text file loading with static rgb color table. commit c8acb342695936db062c966029019a458d45459e Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Thu Feb 16 06:52:12 2006 +0000 Fix an occasional crash on VT switches: the server would save a pointer to the current cursor when disabling FB access and would try to restore that cursor when re-enabling. However, that cursor might have been destroyed in between. This fixes it by updating the saved cursor pointer when a cursor is set and vtSema is FALSE. commit c845e152f52b3e8cef579797c5c8834ad2fd2cd5 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 05:46:08 2006 +0000 Bug #5871: Drop special build infrastructure left over from libcwrapper times. (George Fufutos) commit c2f685e64464ccf86ed47ae37f74bf46877e0739 Author: Dave Airlie <airlied@linux.ie> Date: Thu Feb 16 05:18:20 2006 +0000 Fix XSERVER64 should be _XSERVER64 commit 1bbd5e49b1dcc2e3f9785bd2bb58f946b9998099 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 04:59:45 2006 +0000 Bug #5869: Remove traces of EXTMODULE define, which doesn't appear to be useful any more. (George Fufutos) commit c03b06bdf04fa8500d0f85314c7268848b4d50be Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 04:39:00 2006 +0000 Bug #5888: Remove orphaned laymodule.c from miext/layer removal. (George Fufutos) commit 3b32e902c7a12aa2320da27d984029cde28fd8c3 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 01:49:23 2006 +0000 Add entry missed in my last commit. commit c4767794ef5b014ae25fe8541e72348ecfb1ee49 Author: Zephaniah E. Hull <warp@aehallh.com> Date: Thu Feb 16 01:03:09 2006 +0000 Export xf86ActivateDevice, used by the evdev driver. commit dc0354104cb4057dfcc7b2ccb8e2ae8474d70b15 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 16 00:14:11 2006 +0000 Move EXA implementation up to the top level and remove its XFree86 dependencies. It was nearly abstract enough already to be used by multiple DDXes. This will be useful for EXA development through providing a fake acceleration implementation within Xephyr, so that testing can be done on new EXA code without worrying about buggy drivers. commit c170aa830d0ce3dbff6b30081e04c3f91bf921be Author: Eric Anholt <anholt@freebsd.org> Date: Wed Feb 15 23:27:40 2006 +0000 Forced commit to note repocopy from hw/xfree86/exa/ commit 6770f1bdb145e7a6c431d0523f10d12155f58273 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Feb 15 21:09:14 2006 +0000 Define NO_LIBCWRAPPER in dix-config.h, and rely on Mesa including dix-config.h if DIX_HAVE_CONFIG_H is defined to get it and _XSERVER64, instead of defining things like this per directory. commit 7d7fc927cd90146788780477b8e3379d91c3b910 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Feb 15 20:47:44 2006 +0000 Remove a few #ifdef vms; whatever problem that was solving should assuredly be solved some other way. commit f105b8da11fcf337512b3c39da3368f98da07a33 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Feb 15 20:44:13 2006 +0000 Mark everything in dixsym.c as _X_EXPORT. commit 010d6effa6fa210251b12459882e88aeee82c2c0 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Feb 15 19:15:32 2006 +0000 Mark everything in {ext,font}sym.c as _X_EXPORT. commit 3fe482c77e7b3e46739d011d8bbdee527d7a42fc Author: Adam Jackson <ajax@nwnk.net> Date: Wed Feb 15 19:05:55 2006 +0000 Mark everything in misym.c as _X_EXPORT. commit 6ad4325b87889e1aada9333d750b7bb586c38b52 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Feb 15 18:26:45 2006 +0000 Update to build against mesa head. commit 50e2ff9a2500078ebbd833fddab0d93f3a50b6a6 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Feb 15 03:20:55 2006 +0000 Remove the waitSync from KdDisableScreen and push it off to drivers' disableAccel hook, which is more correct anyway. This makes kdrive.c not have any knowledge of kaa, opening the way for using exa from kdrive. commit 0446aafa9467f43515fb578d50f45e2c3153c8cf Author: Eric Anholt <anholt@freebsd.org> Date: Wed Feb 15 03:07:23 2006 +0000 Avoid some more libcwrapper damage that prevented kdrive linking. commit 5c9b6f0fb01252d704de1bbdf3015dee7f956593 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Tue Feb 14 08:14:42 2006 +0000 DRIGetSecs() would call getsecs() when XFree86LOADER is defined, relying on the wrappers to provide it. Wrapper gone, and getsecs doesn't exist on linux so it now blows up. Fixes it by just calling gettimeofday() in all cases instead. commit 049dca0f43eb2179d2c61033a17ff1a89f8fb689 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Tue Feb 14 08:11:41 2006 +0000 Remove useless line of code that contained a bug and triggered a gcc warning. This variable will be overriden before being used anyway. (Bugzilla #5595) commit 1132d0e6102d4564f70f0e8c98854e3acf25b109 Author: Dave Airlie <airlied@linux.ie> Date: Tue Feb 14 06:27:59 2006 +0000 update to latest Mesa CVS HEAD commit bb8c36690ab411c11aa8dd3d4520d513eb8f9091 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Feb 14 04:20:37 2006 +0000 Bump shadow module version number to 1.1.0 from 1.0.0 commit cc9dfab0b31c7956f99d1f1b9c195065b5e18c29 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Feb 13 18:57:38 2006 +0000 (Reverted) commit 83dd6241c8cd81e8d897bd17588ada92a945e647 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Feb 13 18:55:44 2006 +0000 Reverted, did nothing anyway, I'm not smart today. commit 4a7f6f53cad541e8c5042a6472e3b3886fc9b7e6 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Feb 13 18:09:51 2006 +0000 Further op reduction when both src and dst alpha are absent. commit 28ced9f3e0dd4bd81067f590a1d64ba0844edb06 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Feb 13 05:29:00 2006 +0000 Add missing ChangeLog text for r1.2 of GL/glx/indirect_reqsize.h commit 4839e91fcab4c344e672154a447d8c7035fce1f4 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Mon Feb 13 05:03:13 2006 +0000 HAS_MKSTEMP vs. HAVE_MKSTEMP (From Fredrik Höglund) commit 1a4f20541a9f4f41f444d826d743899ea2dee2db Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Mon Feb 13 04:56:27 2006 +0000 Fix linux build without libc wrappers (From Fredrik Höglund) commit 2dc7b5e0d96a187bfbb355caa788f0fdcd88eaad Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Mon Feb 13 04:43:40 2006 +0000 Move call to xf86WrapperInit() to OsVendorInit() in xf86Init.c and remove stubs in other DDX. commit 34d0b9228f46c2f87be74dddc9c7d97aab091d03 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Feb 12 20:53:35 2006 +0000 Simplify ops that would use the alpha channel when an alpha channel is always 1.0, and short circuit PictOpDst for good measure. commit 5f45776ef3b9256bea44842d1c50f269422531a1 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Feb 12 10:30:47 2006 +0000 Add missing HAVE_DIX_CONFIG_H which caused issues with mismatched screen structure interpretations, and remove a bunch of unused junk from kdrive-config.h. Xephyr almost works on my amd64. commit 5249416d091d59c248c8dda44529b8aa4910b1a0 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Feb 11 22:40:50 2006 +0000 Add stub xf86WrapperInits so that the servers will build even if os/ was built with XFree86LOADER set. commit a2a5254675a6b7ef0f7da9caa76c028b7c526502 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Feb 11 19:16:51 2006 +0000 Add <string.h>, <stdlib.h>, and <stdio.h> to clear undefined function warnings after the removal of libcwrapper headers. commit d6337c83241f0fa4bb03039a9767b58d8a1a7c91 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Feb 11 17:42:31 2006 +0000 <sys/limits.h> -> <limits.h> so we can compile on non-BSD OS'es commit 4fafba61d5402d4e4d2c21ba1be3ed8969b99334 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Feb 11 03:03:45 2006 +0000 Remove libcwrapper damage from GLX (requires fresh Mesa HEAD), and get it compiling in kdrive. commit c3d14036729fd186d4ec7ca1de603e1f2d174e2f Author: Eric Anholt <anholt@freebsd.org> Date: Fri Feb 10 22:00:30 2006 +0000 Remove libcwrapper usage from xorg server modules. The libcwrapper is only of (marginal) use in the drivers, and that usage remains. commit a8cec1b656f57746758613213de1d6e5acb79451 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Feb 10 09:00:02 2006 +0000 Merge from kdrive: use RECT_PRIM to avoid tearing in xvideo. commit efc3fab7f4b29f56fffd21304c64c03a48aa5b4b Author: Eric Anholt <anholt@freebsd.org> Date: Fri Feb 10 07:52:05 2006 +0000 Make kdrive (i.e. Xephyr only) buildable on FreeBSD and probably other OSes without linux VT switching, fbdev, and vm86 support. commit fa3a65e33d8c893c7867ea507afc7caa1361aa9c Author: Eric Anholt <anholt@freebsd.org> Date: Fri Feb 10 07:47:21 2006 +0000 Remove the include of X11/misc.h, which fails to compile and isn't necessary. commit d875bdb2756b082ce93bd86016c369ea85c04d17 Author: Jeremy C. Reed <reed@reedmedia.net> Date: Fri Feb 3 02:44:19 2006 +0000 hw/xfree86/os-support/xf86_OSlib.h Fix sysmouse handling on DragonFly, mostly garbage arrived. From Joerg Sonnenberger. commit 0946bb9427695a4314e5c43de573b3a75a18e466 Author: Jeremy C. Reed <reed@reedmedia.net> Date: Fri Feb 3 02:37:52 2006 +0000 Fix sysmouse handling on DragonFly, mostly garbage arrived. From Joerg Sonnenberger. commit 5e2a7af23bd0f46fbddca34098cb297be58b7a55 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 2 21:07:06 2006 +0000 Move the frequently-repeated code to get the pixmap that backs a drawable to a new function, exaGetDrawablePixmap(). commit ee3c7ccb175752dbeaed6b0113d0819b3fcd2398 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 2 20:51:54 2006 +0000 Remove more debugging leftovers. commit 3366b6836572461209bb2f8aa28d9e662067dc54 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 2 20:09:14 2006 +0000 Rearrange and rename EXA code to be a bit more logically organized. Also removes a little bit of debugging leftovers. Summary: exa.c -> exa.c (miscellaneous code) exa_accel.c (all acceleration code) exa_migration.c (migration logic) exaasync.c -> exa_unaccel.c (software fallbacks) exapict.c -> exa_render.c (render extension stuff) exaoffscreen.c -> exa_offscreen.c exaPriv.h -> exa_priv.h commit 25d4ff870d49533d82a77f144722ff7934d52e0b Author: Eric Anholt <anholt@freebsd.org> Date: Thu Feb 2 20:04:15 2006 +0000 Forced commit to note repocopies: exa.c -> exa_accel.c exa_migration.c exaasync.c -> exa_unaccel.c exapict.c -> exa_render.c exaoffscreen.c -> exa_offscreen.c exaPriv.h -> exa_priv.h commit 2ab487d4d20e4e34e73cc6d87f41bf0836c7a8af Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Feb 1 22:20:05 2006 +0000 Add a new function RRGetRotation() which does exactly the same thing as xf86GetRotation(), but allows for drivers to provide their own RandR implementation. xf86GetRotation could be obsoleted by this change. commit f4898b409376803c9a9dd8475bdd5576ff1cc59d Author: Luc Verhaegen <libv@skynet.be> Date: Tue Jan 31 14:49:43 2006 +0000 Further bug #5386 fixes: Fix some problems with the EDID code: Some bitoffsets were wrong. Unknown Detailed Sections weren't handled properly and defaulted to Detailed Timing. commit 437b385ce4cc3ff00e14d3d39f4a2f6c8f0c67a0 Author: Luc Verhaegen <libv@skynet.be> Date: Tue Jan 31 13:55:01 2006 +0000 Bring the cvt utility up to date with bug #5386 changes. Fix 2 issues with the generator routine: the allocated modeline wasn't nulled and mode->name's \0 wasn't copied over. PrintModeLine was rewritten and HDisplay gets rounded up to character width instead of refused. commit 8f3c69dcf17691f71bca7b0a2cd34f7788a97b8c Author: Luc Verhaegen <libv@skynet.be> Date: Tue Jan 31 13:04:02 2006 +0000 Accept modes with less than 25% horizontal blanking again (you can push old gtf timing to below 25%), only stop cvt reduced blanking. Users should be free to blow up their monitors if they so choose. commit 701b63cf1dcd3e49602114fb1dde45a74b4e1122 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Mon Jan 30 20:04:56 2006 +0000 Update to build against Mesa trunk. commit dd50015b05b901fe0c60717512c854389610aea2 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jan 28 02:20:37 2006 +0000 Add libc_wrapper support for random(), which will be used in upcoming EXA memory manager work. commit 3d1667278ff309d7f8e61a6d330f712bae5bcd41 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jan 28 00:37:52 2006 +0000 Remove leftover variables for cfb24 build, and finish commenting out Xglx standalone stuff, which some versions of automake get whiny about. commit ab01eb247f9e5d7c9995bf2d6432358cd64bf11d Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Jan 27 12:27:34 2006 +0000 update pci ids commit 261aa4403c77203f8f02b399ddd382c731dda324 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Jan 26 09:04:22 2006 +0000 remove that, and will put it in a i810 driver specific Changelog commit 94e678fd014c61d12591d7398b6591f24c3d71f1 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Jan 26 08:49:19 2006 +0000 add changelog for i810 updates commit c5e93182905332383ca3ef5db3f334cec69c8dda Author: Donnie Berkholz <spyderous@gentoo.org> Date: Thu Jan 26 04:32:45 2006 +0000 Really allow linking against Mesa trunk to work. commit 0dc0f17f27f99da79c99031b41b0c0e95ef035f5 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jan 26 04:10:43 2006 +0000 Speed up checkout and autogen by removing disused iplan2p4 and ilbm. commit 023d2b4e3c392eed1f149dc5b13a83429cd052a3 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jan 26 00:23:44 2006 +0000 Add forgotten HAVE_BACKTRACE define. commit 14fdd81614cdd6ef7e01976a43da8b6a3bf8386e Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jan 25 23:05:26 2006 +0000 Remove xf8_32wid, it's dead code with no maintainer interest. Also remove cfb24, since xf8_32wid was the only user. commit 2e28f4104ddf94a8f9a70fe6b2a2a6859ffedc8f Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Jan 24 22:05:33 2006 +0000 Allow current trunk to build against Mesa trunk commit 0d9ed2624fe8fb95c57930da523351556ba11351 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Jan 23 22:01:34 2006 +0000 Commit #4633 - Initial mouse pointer incorrect with EXA which also fixes the repaint of the cursor image with randr events. commit 9148d8700b7c5afc2644e5820c57c509378f93ce Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Jan 23 13:59:14 2006 +0000 Commit slight variation of bug #5460 which is the merge of the new shadow code from kdrive. commit cfd3988ed906ab48ca4362256f8dbb8852d7ca0a Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Jan 23 13:58:19 2006 +0000 wrap with if XORG / endif commit f51ecc66e9ad6d2c3541b1dafa7659da5a0a3a86 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Jan 23 13:54:59 2006 +0000 #include "gcstruct.h" commit 80f45fa4dfa011c2ae7bcb34f87aafb91763f1fe Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Jan 23 13:54:34 2006 +0000 add damage.h & damagestr.h to SDK headers commit af5b3ea4b3df9e9c6dd6993c5e7238a366a3f508 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Jan 19 14:51:09 2006 +0000 add randrstr.h to sdk_HEADERS commit 03ebd37baba2f5af3ab502ff02ec14c15859dc3f Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Jan 19 12:25:01 2006 +0000 Make error() bomb with exit code 1, not 0. commit adce1f16e0d815e5c762407da3544a7d2eff9303 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 19 00:06:57 2006 +0000 Only try to use byteswap.h on linux. Assume that everyone else (thinking of BSDs here) has sys/endian.h, and use macros as appropriate for the names. This should probably be in a gloabl header. commit 1c3f8727b2349c9b988eaa744f11366322d42538 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jan 18 19:42:56 2006 +0000 More kdrive merge, fast path fbBlt to use memcpy() when possible. Good for -5% to 60% speedup on XGetImage, and 0% to 10% speedup on copies within host memory. Based on work by Jaymz Julian. commit e70b64b93024d05519014fb1b76fe26bd9f3a496 Author: Dave Airlie <airlied@linux.ie> Date: Wed Jan 18 07:15:55 2006 +0000 Updated xgl code drop from Novell + xserver tree changes commit b5356e0afaf2b660c8905f63d5fdcb03402b81c5 Author: Dave Airlie <airlied@linux.ie> Date: Wed Jan 18 07:00:50 2006 +0000 typo in last change commit 506eca5f57b960a6650c3387047a6ae8a22181e9 Author: Dave Airlie <airlied@linux.ie> Date: Wed Jan 18 06:56:52 2006 +0000 Wrap sdk_HEADERS in if XORG as otherwise installing non-xorg servers breaks. commit 8ccf4f2b8fdb5e57d2ec5f2d54731fbf83fb9d8c Author: Dave Airlie <airlied@linux.ie> Date: Wed Jan 18 06:49:17 2006 +0000 This is a fix from David Reveman from the xserver tree, Make fbPadPixmap work with negative stride commit a1f9262c6acd195c0fcf5f602d5ca0c252993521 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Jan 17 21:27:49 2006 +0000 file glxvisuals.c was initially added on branch accel_indirect_glx. commit c2dedf4d17f8a5b1a8037fd2b4e29122ef78945a Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Jan 12 22:14:56 2006 +0000 Thu Jan 12 17:09:18 2006 Søren Sandmann <sandmann@redhat.com> Add new functions to enable and disable events on Map and Unmap. Use them here to make sure Composite redirect doesn't cause Map/UnmapNotify events that would confuse window managers. commit 847d83ec3c90c5b298eaf19ba55251b4a30f4155 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jan 12 00:21:59 2006 +0000 Bug #2996: libglx / libGLcore should use a dispatch table Port all changes from the (monolithic) accelerated_indirect-0-0-1 branch to the modular trunk. This will break the Darwin and cygwin builds. Other than the changes to symlink-mesa.sh and the various Makefile.am files, to code is identical to what's in the branch. Reviewed by: airlied, krh commit c56e9a8849ce8dd5c09732ae1860e409e7886690 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jan 10 03:24:53 2006 +0000 Bomb when symlink-mesa.sh continues, instead of silently failing. commit 2949c705f11f8710301555c039bcecbe748cabd9 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jan 10 03:23:05 2006 +0000 Add all subdirs used to DIST_SUBDIRS, and files to EXTRA_DIST. Attempt to build xeglmodule.c, not xglxmodule.c. Add xf86Sbus.h to EXTRA_DIST, as _HEADERS doesn't appear to get the same treatment as _SOURCES in terms of automatically DISTing. commit 4fc9eb592a446ad5711bdaa82c60e9fe010fd76a Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jan 10 02:32:20 2006 +0000 Bomb out if symlink-mesa.sh failed. commit 890ec849479db2510a9b4bc5e5e2f7978ca37b83 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jan 10 02:30:56 2006 +0000 Add xgl to DIST_SUBDIRS. commit 53dbd00a75313ec5301ca95b2e91d5d02bdaf820 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Jan 8 23:43:54 2006 +0000 Remove remaining #ifdef DPSEXT stanzas. commit 7fc9bc44e099f8f046bf707cb87ef7d736933f80 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jan 7 01:29:05 2006 +0000 Compile fix, again, stupid non-clean builds commit 9d62d1e6903ccc095f784279a699b3f40a8f0cf8 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jan 7 00:45:17 2006 +0000 Bug #5218: Don't crash on unconfigured interfaces. (Andrei Barbu) commit 3c58072956c28ebc3ca2eb50c1ff09823e1219d7 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jan 7 00:33:41 2006 +0000 One more build fix. commit 07303c1b42afd1ada98cbc11d1ba616d366017fb Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jan 7 00:05:46 2006 +0000 This version will actually compile commit 7f46aba35ee482e9b28ecc81d1a99d423fc88a70 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jan 6 23:52:23 2006 +0000 Compile fix commit 25babf2791ad42101a86ba2a0f14564328256ee2 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jan 6 23:36:53 2006 +0000 Missed file. commit 13c9e0c094c4e34cd1e43a7cc08b2dca39a32412 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jan 6 23:06:15 2006 +0000 Bug #5525: Build a working Xprt. (Drew Parsons) commit fe0c838b5d8bc8d9cf5a686bb7d3e90682d2d19a Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jan 6 18:06:02 2006 +0000 Move drawable lock acquisition into DRIClipNotify from DRIValidateTree, so we only take it when clipping a DRI drawable instead of on every tree update. Note drawable lock acquisition per- screen instead of globally, and drop it in BlockHandler if necessary. commit 39ce5f1544029412f4060f3e89ce1d87222ef42b Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jan 6 17:05:26 2006 +0000 Remove unused X11R4 DDX compatibility function miClipNotify. commit 07ecb969d7eb8d4ab0bb0b8a55a5f40f3c8ec5e3 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jan 4 03:29:15 2006 +0000 Forced commit to note that glyph privates commit was: Obtained from: xserver tree (David Reveman) commit b6b88d2f62d8c596171f487dd25fbdbc85d0c5a8 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jan 4 00:05:16 2006 +0000 Correct rounding in divide-by-255 code. Obtained from xserver. commit b9c0ae867e1b52186c26841a77745f7f5a0a76dd Author: Eric Anholt <anholt@freebsd.org> Date: Tue Jan 3 22:36:46 2006 +0000 Remove the manual AddFilter for convolution, which I'm pretty sure shouldn't be necessary due to it already happening from PictureSetDefaultFilters. commit 601ab861b46a62b0742ffd3e937c4fab129664f0 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Jan 3 22:06:23 2006 +0000 Add glyph privates for Xgl, which uses them to implement a glyph cache. EXA would probably also like to do this. This breaks module ABI for EXA and XAA, and likely breaks proprietary drivers as well. commit 1729fc882ceec392331566c95efd5968fe9e97fd Author: Eric Anholt <anholt@freebsd.org> Date: Sat Dec 31 08:06:00 2005 +0000 Change REGION_INIT(pScreen, &foo, NullBox, 0) to REGION_NULL(pScreen, &foo). While it is no longer (or rather, once again not) required as of regionstr.h r1.4, it matches the style of the rest of the xorg code. commit c25536a7937b11a5347bfb8796d5cb6eb0445b51 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Dec 31 08:01:31 2005 +0000 Initialize the fourcc value in stack-allocated glitz_pixel_format_t structures. Greatly reduces the number of uninitialized-value accesses during Xgl startup according to valgrind. Allocating and filling these in by hand on the stack seems very shady to me. commit e6dab3d7c429a2d30d31f188c4554e870011e051 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Dec 30 12:05:47 2005 +0000 Fix the AC_TRY_RUN for sys/linker.h which had no hope due to lacking a main() to instead use a nice AC_CHECK_HEADERS that works. Also, fix the nearby SYSV IPC check which was lacking an argument and giving bogus results (it's "AC_TRY_LINK(includes, main, yes, no)"). commit eef16c36ad6e90fd8eaad4d8bdbc1205bc28a66f Author: Eric Anholt <anholt@freebsd.org> Date: Fri Dec 30 05:44:14 2005 +0000 Add #undef BSD44SOCKETS, without which the listener socket on FreeBSD would be created without the port number due to xtrans's define not being used when xtrans was compiled in the X Server. commit 7aa0ea23bc9b8df582fe06f2bc39dcfe34583c7e Author: Eric Anholt <anholt@freebsd.org> Date: Fri Dec 30 04:11:42 2005 +0000 Add an empty all-local target for FreeBSD make's sake, which doesn't deal with .PHONY. commit 49a9249239b0dd105b83a101db6e32549978f0d5 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Dec 29 21:11:41 2005 +0000 Make kdInputMachine static const, shrinks .data a bit. commit 6d7ee4167d9daeef9b793789a70aa724c4fe6bf4 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Dec 29 20:54:08 2005 +0000 Style fix, make SCREEN_EPILOGUE two arguments instead of three. commit b1efb3810cfea8116d76bae3ff3acfee521f4793 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Dec 29 20:42:54 2005 +0000 Missed one commit 858b4bc14a7adc7314ce5043c7ff8ca1891dd0c9 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Dec 29 20:38:29 2005 +0000 missed changelog entry: Enough build fixes to get {sdl,ephyr,fake} to link. commit 54922aeadb29df0a1819afd3f616131aa56e140a Author: Adam Jackson <ajax@nwnk.net> Date: Thu Dec 29 20:29:26 2005 +0000 Disable building LBX by default. commit fc69a2e729532ee062af6676fb187a89f7fffe8a Author: Dave Airlie <airlied@linux.ie> Date: Thu Dec 29 08:42:49 2005 +0000 Remove PowerMAX_OS define it never worked , it'll never work again, finishes running joke of OLS2005 commit 25d3852b833bc0b61ce8313ce116251a2602b827 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Dec 29 00:44:20 2005 +0000 Undo spamming of libv's ChangeLog entry. commit d6646307f063b938c44d6193a2e8872e178aa90f Author: Eric Anholt <anholt@freebsd.org> Date: Thu Dec 29 00:19:33 2005 +0000 Add necessary *CONFIG_H declarations and a force-off of XF86* extensions in miinitext in the XGL case. Prevents mismatched structure sizes on my _XSERVER64 machine. At this point, with the uncommitted render/ diffs, Xglx starts up but displays badly. commit 3664c3ebf348d07ae3fe301fb8720adf32cf6d64 Author: Luc Verhaegen <libv@skynet.be> Date: Wed Dec 28 15:22:21 2005 +0000 Bug #5153: standalone CVT modeline generator. - add hw/xfree86/utils/cvt/, cvt.c, cvt.man.pre and Makefile.am. - Adjust configure.ac and hw/xfree86/utils/Makefile.am for cvt. - Add MonPtr->reducedblanking and Option "ReducedBlanking" to the Monitor section. - Check for reduced blanking in xf86CheckModeForMonitor and disallow modes with less than 25% blanking otherwise. - Fix some warnings in hw/xfree86/common/xf86Config.c. commit 08708f7d616a7c0a596fb71dd7acd76d45257fec Author: Eric Anholt <anholt@freebsd.org> Date: Wed Dec 28 11:48:14 2005 +0000 Merge from xserver: Make the existing ChangePictureFilter and ChangePictureTransform screen hooks get called at appropriate times. commit 31d0fdde19598ce9375cc9638ad4e2c8b5af8d9a Author: Adam Jackson <ajax@nwnk.net> Date: Wed Dec 28 10:46:56 2005 +0000 Remove a debugging printf commit 64ac7401ad5022462279dff4dcfb12844c9857ae Author: Eric Anholt <anholt@freebsd.org> Date: Wed Dec 28 10:43:02 2005 +0000 Fix a copy'n'paste-o that would result in mis-rounding of the results of several composite operators in A and G channels. commit 9ceffb6b92e55f0d74d71489900d43940f14dfd9 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Dec 28 10:37:17 2005 +0000 Merge from xserver a header for shm's server internal functions, which are called by DDXes. Desired by XGL, and should be used in other locations, probably. commit b1b40ed6a87f72d07825624730cca193d5a89baf Author: Eric Anholt <anholt@freebsd.org> Date: Wed Dec 28 10:31:46 2005 +0000 Initial commit of XGL build infrastructure and XGL code changes for building within the xorg server tree. Requires additional, uncommitted dix changes to successfully build, and successful running is still yet to happen. commit 36061c75ae42aa733cde9b3fd05e0c8280b31655 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Dec 28 10:10:59 2005 +0000 Forced commit to note repocopy from xserver CVS as of a few minutes ago. commit 05c139d4cdfd11d39c0168d0c80ac1dbdd069b4c Author: Adam Jackson <ajax@nwnk.net> Date: Wed Dec 28 10:02:54 2005 +0000 Enough build fixes to get {sdl,ephyr,fake} to link. commit aeb770f645e2d591b255ec4ab06addcb1beafa5f Author: Dave Airlie <airlied@linux.ie> Date: Wed Dec 28 02:43:50 2005 +0000 recommit previous changes to evdev.c commit ce7c0c89375ec74f89ae5727998fd75fb768d280 Author: Dave Airlie <airlied@linux.ie> Date: Wed Dec 28 01:57:11 2005 +0000 some updates for default colormap install commit 022aa1127c7dcd133ce73dbc12a10bfba8b1ed6e Author: Adam Jackson <ajax@nwnk.net> Date: Wed Dec 28 01:01:06 2005 +0000 Get Xsdl closer to linking. commit 27d79ab2bcebb634d0b69c851c72283a7514eb0c Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 27 23:03:15 2005 +0000 s/XSERVER/KDRIVE/ commit 72817714a0787536ce8e8ad0d5473dea0f1c1abe Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 27 23:01:27 2005 +0000 Remove Imakefiles. commit 9dd0af6cb4e2c8976ada57a4f4ed16faae090a9d Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 27 08:31:37 2005 +0000 Skeletal kdrive build system. Totall non-functional atm. commit 7fd73d2953cf9449c15462cf4bf67639db64f997 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 27 08:29:50 2005 +0000 Build fixes: XSERVER_LIBS -> KDRIVE_LIBS, config.h -> kdrive-config.h commit 2f3ac6e5fcbd0e954a094fb6b975d7c8816c44b7 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 27 08:26:03 2005 +0000 Start importing kdrive. commit 6798fd0170f4225ce4e69148978533fcee9bdc34 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Dec 26 19:13:52 2005 +0000 Bug #4190: Add a rule for 'make relink' since automake sucks. commit 8fc4ea8620913776a903ee2b4f22c306d5778623 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Dec 26 18:55:09 2005 +0000 Nuke unsupported NDBM routines. Shrink the hash table a bit, over 25% of the buckets were going empty. commit ed33c7c98ad0c542e9e2dd6caa3f84879c21dd61 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Dec 26 04:23:58 2005 +0000 Remove unused -xkbdb and -noloadxkb options. Rename -ar1 and -ar2 to -ardelay and -arinterval, respectively. Remove XKB banner from help text. commit 7e3cb9a09ac422179be89773f7fb14a462d25434 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Dec 25 22:25:15 2005 +0000 Remove unused layer module. commit 9b083369ded2258cbc8ac2058e06ec8a3b171178 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Dec 23 20:11:12 2005 +0000 Change list of X server man pages in "See Also" section to list the ones actually included and remove the ones that are no longer. commit 5fd978b1e7bce9169f87712a4a7c2c36a68ac00a Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Dec 23 07:40:44 2005 +0000 Make LBX configuration default to auto. commit 5230e86b1cc841bfb35806618052aa835b7eb7e7 Author: Dave Airlie <airlied@linux.ie> Date: Fri Dec 23 04:13:37 2005 +0000 fix up xglglx.c commit feb735c5bb0cd391136f1c73476703dff82dc9b0 Author: Dave Airlie <airlied@linux.ie> Date: Fri Dec 23 02:07:58 2005 +0000 Well there were a couple of snapshots later than CVS available outside of Novell, so I've done a crazy merge to try and get them into a workable CVS, I suspect I may have failed.. there is a pre-xgldrop-merge tag if I did. commit ade104ce5a016623c1ce97b0d52b531185b35baf Author: Dave Airlie <airlied@linux.ie> Date: Fri Dec 23 01:51:40 2005 +0000 check drawable is available commit 7fb521e80d6e2c05e9475e74fbf80bfbe74cda95 Author: Dave Airlie <airlied@linux.ie> Date: Fri Dec 23 01:50:04 2005 +0000 from davidr's tree update some fixes commit c88a3145d057ab72466a3ea8b789bf419e4efc33 Author: Dave Airlie <airlied@linux.ie> Date: Fri Dec 23 01:49:21 2005 +0000 from davidr's tree if source picture defined return commit c59508566f11982aa3f4be383597d0e6178718c2 Author: Dave Airlie <airlied@linux.ie> Date: Fri Dec 23 01:13:28 2005 +0000 fix glx up for newest glitz interface commit d822bc159672e7327054e572b659ae7dde040e83 Author: Dave Airlie <airlied@linux.ie> Date: Fri Dec 23 00:08:35 2005 +0000 make xgl code at least build against latest glitz. commit 6e2086395d99081d8d682b90cec650a06e41fc2c Author: Dave Airlie <airlied@linux.ie> Date: Thu Dec 22 23:32:49 2005 +0000 fixups for newer glitz API commit f3ae42c0fd910b7f9feb9be91ccb056bce0cd999 Author: Dave Airlie <airlied@linux.ie> Date: Thu Dec 22 23:31:15 2005 +0000 small fix towards new glitz interface commit 2af7e94eab6847159a3439301ecc93c62a12b1a0 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Dec 22 13:54:08 2005 +0000 Adjust the rules for auto-generating some source files, so that they work on both GNU make and FreeBSD's make. commit 0d7ec5c7d9b451066a079fe56bcc9722341a91ff Author: Kevin E Martin <kem@kem.org> Date: Wed Dec 21 02:30:08 2005 +0000 Update package version for X11R7 release. commit b37e738d5f4e1769bdee98acca788aeeb1556bcc Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 20 21:40:19 2005 +0000 Fix an fb regression on A8 pictures. (Fredrik Höglund) commit 03d37eb03864cfc1a2f8d239d5a4c8341bf274f7 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 20 21:34:21 2005 +0000 Bug #5359: Fix a segfault (Mark Kettenis) commit 7b89b643c12fa0f7a662b3ff76e05ece53101312 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Dec 19 16:44:21 2005 +0000 Bug #5116: Refer DRI section details to dri.fd.o. commit 3ef3add90351e3cb7b54dbcedc234bc5d3d65f1c Author: Adam Jackson <ajax@nwnk.net> Date: Mon Dec 19 16:34:07 2005 +0000 Stub COPYING files commit 3566307c8d44f89622ea51169f67c79092cb56d1 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Dec 19 09:18:29 2005 +0000 Fix typos. commit 137447c5f3c6f1914ac869297f823ae93ce428ac Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Dec 15 01:54:45 2005 +0000 Update to 2005-12-14 snapshot from pciids.sf.net commit 2cf86fce41e3fd2ac48c5088da11e19077e42e65 Author: Kevin E Martin <kem@kem.org> Date: Thu Dec 15 00:20:27 2005 +0000 Update package version number for final X11R7 release candidate. Update release string to 6.99.99.904. commit f1ba3b4f33a928a3a59538799b3863de5c87e70e Author: Adam Jackson <ajax@nwnk.net> Date: Wed Dec 14 20:11:16 2005 +0000 Bug #4718: Command line flag to disable ACPI. commit cf605eb91619a8c0589a08674ffc3e018471b3fc Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 13 17:35:26 2005 +0000 Build libglx correctly when not building the Xorg DDX. commit b076dd787ff71c4b385ab4e2e4eb367f3de378f6 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 13 17:34:06 2005 +0000 Spell it XINERAMA_SRCS, not PANORAMIX_SRCS. commit 3666dbb5f3e06fa6a72def64556d64cf73141777 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Dec 12 23:33:55 2005 +0000 Remove unnecessary include of dgaproc.h that broke Solaris builds. commit 438a5549f08ab03443d45dd46323579a2f2e4ba2 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Dec 12 03:06:18 2005 +0000 Bugzilla #4715 <https://bugs.freedesktop.org/show_bug.cgi?id=4715> Files in xserver/xorg/Xext not included in tarball after make dist commit 62f3ef930adc7edd49b27dd1f7b0f51bc8bc0afa Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 18:35:21 2005 +0000 Bug #5258: Restore binary compatibility with 6.8.2's PictureRec. (Aaron Plattner) commit b99dea9dcf99f907a3536c0db1c39cc67931a5b1 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 18:32:46 2005 +0000 Bug #4935: Fix includes. (Eric Anholt) commit f4957ee94810b471110deebf03d7413399b45db3 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 18:30:51 2005 +0000 Bug #4809: Re-fix that doesn't break distcheck. (Alan Coopersmith) commit de22d0c2264bd6dbacbbb4160d09c7e84ad37e70 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 15:30:05 2005 +0000 Fix a thinko so the code matches the comment commit 6fcb049cd0d2291da5943176716d1f7bbb85fdc2 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 06:49:39 2005 +0000 Bug #1288: Additional refactor of the driver probe logic to keep ati loaded before atimisc. commit 17ac5e9fec1e07bd18ae1407043c300cb4695ede Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 05:36:41 2005 +0000 Push the fallback drivers to the end of the list so driver probe order stays useful. commit 80ea67e37980d07438749f1aa4dfdd7ee1086799 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 03:59:41 2005 +0000 Bug #4361: Change driver probe logic to read the driver list from disk instead of using a compile-time array. commit 7fa2d11d85d43f42aa9c02f8d772c91d1b04df43 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Dec 9 03:57:41 2005 +0000 Bug #4361: Define XF86CONFIGFILE properly so config file generation works commit 26b41ff43959a07a778bc3d6e4db8da036f09de3 Author: Kevin E Martin <kem@kem.org> Date: Fri Dec 9 03:02:21 2005 +0000 Fix sgml docs build. commit d6f98cbdb8fb74c504a92939d3741420eeed7110 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Dec 8 19:33:09 2005 +0000 Bug #3944: Fix 24bpp packed pixel. (Søren Sandmann Pedersen) commit f9ccebe8c5cd674c08fe8ed860d1c456e42c937e Author: Adam Jackson <ajax@nwnk.net> Date: Thu Dec 8 19:27:13 2005 +0000 Bug #4928: Fix compilation for Alpha. (Stefaan DeRoeck) commit 3a6bdf0715b994d6ecaa5b6e448695a8a8ec7d72 Author: Kevin E Martin <kem@kem.org> Date: Thu Dec 8 19:21:12 2005 +0000 Add configure option to set the top level font dir. commit 008c2dd5e4614e6a21123ee3a2ac9c5d3bafa97a Author: Kevin E Martin <kem@kem.org> Date: Thu Dec 8 17:55:19 2005 +0000 Add configure options to allow hard-coded paths to be changed. commit 39189c2b86a4c2ab5f3f161d423eb072356668e5 Author: Kevin E Martin <kem@kem.org> Date: Thu Dec 8 17:54:40 2005 +0000 Allow hard-coded paths to be configurable. commit 20c0ebe7b3feb85abf9bf140b7799aafc6f59513 Author: Kevin E Martin <kem@kem.org> Date: Wed Dec 7 16:18:02 2005 +0000 Change to use the app-defaults default dir configured in libXt. commit 4a39354e14c3c360046b04ea0d4825832b05df05 Author: Kevin E Martin <kem@kem.org> Date: Tue Dec 6 22:48:51 2005 +0000 Change *man_SOURCES ==> *man_PRE to fix autotools warnings. commit 84faf8dc9747bc4f1db5ebc2f23e17cf1460e2e9 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Dec 6 16:22:47 2005 +0000 Bug #5230: Fix whitespace bugs. commit 9439297b7bc07dcb90f0d01da09eea1bac3d42ff Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Dec 6 15:50:35 2005 +0000 Bugzilla #5219 <https://bugs.freedesktop.org/show_bug.cgi?id=5219> Make sure all optional sources are included in EXTRA_DIST, even if they aren't used on the platform the distballs are made on. commit f259fd680caccb59546d7788704e46e51a9c6146 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Dec 3 22:47:47 2005 +0000 Disable the xf8_32wid logic for now, breaks distcheck commit 26f9c4305660c2b3dc7fe8d214bcdd3c24e1b198 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Dec 3 17:04:45 2005 +0000 Bugzilla #4809 <https://bugs.freedesktop.org/show_bug.cgi?id=4809> Patch #3908 <https://bugs.freedesktop.org/attachment.cgi?id=3908> xf8_32wid and cfb24 only need to be built on sparc commit 98231c6b38c98976f4ac2b9417ecfbc37a8cbe9a Author: Kevin E Martin <kem@kem.org> Date: Sat Dec 3 05:47:25 2005 +0000 Update package version number for X11R7 RC3 release. Update release string to 6.99.99.903 (i.e., 7.0 RC3). commit 7c00afd0ec94e491f1a9ef32d6543ed51ea3319d Author: Kevin E Martin <kem@kem.org> Date: Fri Dec 2 06:02:45 2005 +0000 Define XFree86Server only where it is required. commit 924518605b613eb66aa569877fa9f131e6f2a2fd Author: Kevin E Martin <kem@kem.org> Date: Thu Dec 1 23:39:00 2005 +0000 Fix GL build when srcdir != builddir (Donnie Berkholz). commit 14b9315379fe8c783013906616d868f93fd51c83 Author: Kevin E Martin <kem@kem.org> Date: Thu Dec 1 22:06:49 2005 +0000 Add missing XvExtension and XvMCExtension defines. commit df8fa21d3189e20260328b88cc8a86224a9b1ebf Author: Kevin E Martin <kem@kem.org> Date: Thu Dec 1 16:20:09 2005 +0000 Fix typo: xorg_bus_linuxbsdpci ==> xorg_bus_linuxpci commit ccfaf82367c9d057fd8314ce36b47f0a8eb696b6 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Dec 1 05:04:07 2005 +0000 Bug #5160: Fix the modular build to try to use the same logic for choosing the architecture/os-specific bus support as monolithic. commit 9c0bd9687fe7d20f2f0793332ae0db06f035eb23 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Nov 30 22:59:22 2005 +0000 Import libdrm 2.0 commit 4ec0b623b6ab5f8a1e5af2cc3d839251acf81ce2 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Nov 30 02:36:25 2005 +0000 Bug #5093: Fix fb for non-SSE machines. (Xavier Bachelot) commit ed826d563cba82c516fd41f6a29ee50aa1fe6c6a Author: Adam Jackson <ajax@nwnk.net> Date: Tue Nov 29 23:34:30 2005 +0000 Only build dlloader modules by default. commit da5d66f2ff27b21fe5c39a4abb4f627edd707f1d Author: Kevin E Martin <kem@kem.org> Date: Tue Nov 29 16:39:33 2005 +0000 Fix usage of XFree86LOADER/XFree86Module/IN_MODULE and update loadable module builds to reflect this change. commit 51a721a6dbb42702347aad3115147e4922fc1a25 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Nov 28 22:05:09 2005 +0000 Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4 update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir) commit 381931b15b15d0a2ec384b0c22864412c44f9c6e Author: Kevin E Martin <kem@kem.org> Date: Wed Nov 23 07:14:46 2005 +0000 Add configure option to install libxf86config.a (disabled by default). commit 594ca0966e8fd5992ebf95170cc42e19c698fec6 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Nov 22 02:11:00 2005 +0000 Bug #5118: Use "rm -f" instead of "$(RM)", which isn't always defined. commit 1c8c1179c0789e3e134d31a62dbb88bfdb594b26 Author: Felix Kuehling <fxkuehl@gmx.de> Date: Mon Nov 21 04:24:07 2005 +0000 Fix Xprt library dependencies in the case that Xprint is auto-detected by configure. commit a1f110bda80bb3b8e4f602385ca5ccd96cf3f786 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Nov 20 23:01:02 2005 +0000 Make sure XKM_OUTPUT_DIR (used in code) ends in / (so paths don't get hosed when appending file names) but XKB_COMPILED_DIR (used in Makefiles) does not so install-sh -d doesn't get confused when the directory already exists. commit 385730d23944c24dd9af45b27f62c1161abc48b2 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Nov 20 04:15:15 2005 +0000 Add xext to list of modules xorgcfg depends on. commit 63aa96c08a8390621b017ea498c88cf88152024b Author: Kevin E Martin <kem@kem.org> Date: Sat Nov 19 07:15:50 2005 +0000 Update pkgconfig files to separate library build-time dependencies from application build-time dependencies, and update package deps to work with separate build roots. commit d3b6653a2892e8c929c79fe3ace19ac9d8366fc4 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Nov 19 03:53:04 2005 +0000 Bug #4824: Build XTrap support by default, matching monolith. commit 627ac1fe1dbcbc070575da7bee9e686a7dce5262 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Nov 18 23:34:04 2005 +0000 Bug #5060: Fix non-Linux DRI on 64 bit post Linux 32/64 changes. commit e3ec048ff2fe0ee0862472e9b147b7ce488ea898 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Nov 18 22:43:50 2005 +0000 Bug #4928: Unbreak Makefile.am for Alpha chips. (Stefan DeRoeck) commit de95d8ee197a0bb738037195997d754a20e10254 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Nov 18 18:02:24 2005 +0000 Bug #4859: Don't segfault on bad DDC read. (Tony Houghton) commit 21f7d03dbc347f6bf97a40671275ac75df15bd10 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Nov 16 07:28:19 2005 +0000 Fix builds when not building the Xorg DDX. commit fb2d9df869af0c96f1488ef7cf364e01a9d28f3f Author: Adam Jackson <ajax@nwnk.net> Date: Tue Nov 15 00:29:23 2005 +0000 Make fb build on darwin/ppc without addition #define hacks commit 16b315affa30e34b9bab81778978484137a5d9bb Author: Kevin E Martin <kem@kem.org> Date: Mon Nov 14 21:04:12 2005 +0000 Use glcontextmodes.[ch] from Mesa. commit 0c110c80e7afbef50bb354cf1df30123ed048250 Author: Kevin E Martin <kem@kem.org> Date: Mon Nov 14 20:18:03 2005 +0000 Add GL_CFLAGS so that GLX can find its proto headers when using separate build dirs. commit fc81c13e4dafb0eb818879454ee7ae3fa3dae6d0 Author: Kean Johnson <kean@armory.com> Date: Mon Nov 14 18:49:30 2005 +0000 Dont prevent SCO platforms for using the default ZAxisMapping now that the OS layer correctly sends z-axis events when the wheel button is used. commit bd9fb533b31c2427d854199fa59dccd357cf874b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Nov 14 00:01:34 2005 +0000 Default xkb-output directory needs trailing slash. commit 267cbffa41fffff69c692911d128462f5bab2a69 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Nov 13 20:53:24 2005 +0000 Bug #5019 <https://bugs.freedesktop.org/show_bug.cgi?id=5019> xserver installs manpages into 'man1' instead of 'man1x' commit 3179d29b8212c197634d81fbeb8dd2e8df995735 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Nov 12 18:03:34 2005 +0000 use RGB_DB not RGB_PATH as that's what configure defines (Jürg Billeter <j@bitron.ch>) commit 0e7e4c7064df64c29b1a0ccd84fba1be7c748f18 Author: Kevin E Martin <kem@kem.org> Date: Thu Nov 10 04:59:21 2005 +0000 Fix typo to enable DGA support. EXTMODULE is required to build DGA support into extmod. commit e4554db8f87c6a39a3087186395972000bd2085c Author: Kean Johnson <kean@armory.com> Date: Thu Nov 10 02:41:20 2005 +0000 Dont pass wheel mouse buttons as real buttons, map them as Z-Axis movement on SCO and USL. Re-instate the ZAxisMapping default for the mouse driver. commit 1b26fe6d2092c202141a0371f47ef1cd7c66ec00 Author: Kevin E Martin <kem@kem.org> Date: Wed Nov 9 21:28:54 2005 +0000 Update package version number for X11R7 RC2 release. Update release string to 6.99.99.902 (i.e., 7.0 RC2). commit f886e632b8dab1bfa0de42b9759a8284ecd9b94f Author: Matthias Hopf <mhopf@suse.de> Date: Wed Nov 9 17:05:41 2005 +0000 Bug #4915: ButtonMapping option which allows to define arbitrary button mappings (including left-handed mouse etc.). Fixed incorrect usage of non-reversed, but ZAxisMapped buttons for state detection. Nuked unused part of reverseMap. commit a25871ae52dd5ce094ba8c1b2021dd027d3e71bd Author: Kevin E Martin <kem@kem.org> Date: Wed Nov 9 01:00:46 2005 +0000 DRM 1.0.5 import commit c9709c0a38af46368726857f7261cbeb84e53911 Author: Kevin E Martin <kem@kem.org> Date: Tue Nov 8 22:47:57 2005 +0000 Add newly checked in files to Xorg server build. Fix release date. Enable DGA extension by default. commit f8430a1b8651f4b52d9d3b54694a60d929b48925 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Nov 8 19:04:56 2005 +0000 Bug #2880, add functions for byte and word level access to pci config space. Fix broken utf8 again. commit 5390c7ab05d23f64e6d9afaa558be246a6d6e1b4 Author: Kean Johnson <kean@armory.com> Date: Tue Nov 8 06:33:30 2005 +0000 See ChangeLog entry 2005-11-07 for details. commit f5814bf3fff5352ed6edef4c58aadf2d4593f094 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Nov 8 03:12:43 2005 +0000 Don't reference noXkbExtension when building without XKB. (Bob Terek - Sun Microsystems) commit e73cdba865f36ebf78c2dc4ff674b4d9bfe85013 Author: Kevin E Martin <kem@kem.org> Date: Mon Nov 7 21:03:49 2005 +0000 Fix Xvfb to work properly in depth 15 mode. Fixes XTS5 XCloseDisplay-3 server crash. commit 890ed0e082e048fa8daf48229b40558381bd131d Author: Thomas Hellstrom <unichrome@shipmail.org> Date: Sun Nov 6 16:40:59 2005 +0000 Fix a bug where a system memory pixmap got a wrong address if memcpy() fallback was used for downloading from screen. commit 70aedcf32a0c924fd073f5b36d20813e8323026b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Nov 5 18:56:50 2005 +0000 Bug #4948: <https://bugs.freedesktop.org/show_bug.cgi?id=4948> Incorrect URL in log file for Xorg CVS. Also fixed wording of statement to not refer to monolithic CVS since modular uses the same code, so it was appearing in modular builds too. commit 89c661d61f1b9c70a08237476fa1f7f42c1783ab Author: Kevin E Martin <kem@kem.org> Date: Fri Nov 4 21:37:32 2005 +0000 Only use fbCopyAreammx if planemask is FB_ALLONES (fixes XTS5 XCopyArea tests 22 and 23). commit 0b150a05e6fadca7ee8240697d6cbeadea0c53b3 Author: Ian Romanick <idr@us.ibm.com> Date: Thu Nov 3 17:12:53 2005 +0000 Whitespace change just to make sure I created the branch correctly. commit 90cf8e339b71c2f8f2d7a362e6e1ca8078d7f4fd Author: Kevin E Martin <kem@kem.org> Date: Thu Nov 3 17:08:06 2005 +0000 Fix vendor string and release version reported by the servers. Enable security, lbx and xevie extensions to give us parity with monolithic tree. commit f23defeef285b4a5bb58405589294bd557c9bb01 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Nov 3 16:57:01 2005 +0000 Use APP_MAN_SUFFIX for Xserver man page instead of hardcoding section 1 commit f5daec674aeb4fe6ccbc95ead8a319bbeb368d9f Author: Kevin E Martin <kem@kem.org> Date: Wed Nov 2 15:56:40 2005 +0000 Add support for enabling/disabling DBE (part of generic enable/disable extension support in the server). commit a311bfa73afa1af76f81958d23bc8e0c631d6828 Author: Kevin E Martin <kem@kem.org> Date: Wed Nov 2 15:53:57 2005 +0000 Fix support for enabling/disabling extensions loaded from modules. commit 462a2407d540eac831c9be4dcee8a16aa1cea6ac Author: Kevin E Martin <kem@kem.org> Date: Tue Nov 1 15:01:51 2005 +0000 Add xorg-server.m4 for driver dependency checking. Update pkgcheck depedencies to work with separate build roots. commit 56101c9d6ec3585a0a8550da4b83dd399e3bcce6 Author: Kevin E Martin <kem@kem.org> Date: Mon Oct 31 05:45:40 2005 +0000 Fix fd leak by closing them in the ACPI code instead of just using shutdown. commit 7993486e80711bd6f6f5b6c2b1f2ac32bfba735b Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Sun Oct 30 17:38:49 2005 +0000 RandR: Add a driver func to let the driver determine the physical size of a screen size (display mode). Useful for faked widescreen modes, modes which are scaled by the driver, etc. This really helps fixing RandR's sometimes dumb DPI assumptions. commit c818d3a1a5439c54fc687927a99d69712602ed5e Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Sun Oct 30 09:27:06 2005 +0000 Add xf86RandRSetNewVirtualAndDimensions to loader symlist commit fdbb3ea60949a12eb2f4805d16e8acc2348e39c7 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Sat Oct 29 21:31:23 2005 +0000 Add function for drivers to change RandR's idea of the virtual screen size. (This allows drivers to reserve a larger virtual size at start and change it later) commit e921eec1c6d6ce32630977bd876c529a7c694459 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Oct 29 00:12:33 2005 +0000 Make X -> Xorg symlink at install time. commit f842c229d4c4dbd5c01364f9e99709bedfd32be6 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Oct 28 16:01:17 2005 +0000 build fix on alpha commit 7416fd61a17a70a2c27c4b1d19796955c296dc7a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Oct 27 21:03:27 2005 +0000 Improved stack trace dump code for Solaris - try fork & exec of pstack first so we can see the names of non-exported symbols that aren't visible to walkcontext/dladdr1 code. commit b588bdfe2ac3758d7188706078d79fa276a303e3 Author: Dave Airlie <airlied@linux.ie> Date: Sat Oct 22 04:38:50 2005 +0000 programs/Xserver/GL/mesa/X/xf86glx.c: Missing initializer in xf86glx.c spotted while debugging something else. commit 59279da49806b032027bb54410bc2513d21e3d9e Author: Adam Jackson <ajax@nwnk.net> Date: Fri Oct 21 19:06:13 2005 +0000 Bug #1429: Report input device type correctly. (Stéphane VOLTZ) commit 4a8072011895e6f472e429af7503fc07e0561144 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Oct 21 18:50:09 2005 +0000 Bug #4730: Byte-swap the pixmap ID correctly. (Neil Campbell) commit 81e913d3106066de73792f59f3e50e2b5458c567 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Oct 21 18:23:33 2005 +0000 Bug #4840: Typo, x$xRES -> x$RES. (George Fufutos) commit f5a58178347878e0409b592330a07867bea02bef Author: Ian Romanick <idr@us.ibm.com> Date: Thu Oct 20 23:24:47 2005 +0000 Make sure that the __gl*_size prototypes are seen in all the places that they need to be seen. commit 279cf9f79da5778b6e14ecc437379d73e3bec5b0 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Thu Oct 20 22:41:28 2005 +0000 Bug #4817 <https://bugs.freedesktop.org/show_bug.cgi?id=4817> Restore '=' to '==' in test for mmx_capable. commit 1f43d218cc24358a0379535ed517c23011633c31 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Thu Oct 20 21:45:40 2005 +0000 EXA: The "optimization" for using a fill operation instead of 1x1 copies checked the destination drawable's dimensions (!) instead of the tile's. Really.... commit 15f56b203dbc14ea59885d40fd4bed3da9e8e190 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Oct 20 18:52:51 2005 +0000 Move xf86XTrapModule.c to dixmods, guess at a build system. commit da43c778f4a831061ad2c8b8a312b7a54c9cd79e Author: Adam Jackson <ajax@nwnk.net> Date: Wed Oct 19 22:45:54 2005 +0000 Bug #3224: Degrade XKB fallback message to X_WARNING. commit 4ebd26f04b32f1b09e0759f1a83437d0b1c4d646 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Oct 19 22:36:22 2005 +0000 Bug #3196: Fix Load foo.so syntax. commit af211a9bc1bcab0aa631558e5d6ce013095f9802 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Oct 19 22:30:09 2005 +0000 Fix PCI bus scan on ia64 E8870 chipsets. commit 5744308e2957781449bfe6fee9b465617a88384d Author: Kevin E Martin <kem@kem.org> Date: Tue Oct 18 22:06:54 2005 +0000 Update package version number for RC1 release. Update release string to 6.99.99.901 (i.e., 7.0 RC1). commit 2769c3e72c470b472dae013e256a7ee73c3e53f2 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Oct 18 19:43:48 2005 +0000 Fix distcheck by forcing Xorg to be installed before chmod/chown. commit dd0d010e9c34278f968be486a6c5c91e021b6609 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Oct 18 19:14:08 2005 +0000 Fix parallel builds my ensuring libdmxconfig builds first. commit 79e6ac79f983b6cbd88a868dfd2235d9cbe75e8b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Oct 18 07:18:21 2005 +0000 Don't use $< in explicit rules since neither BSD nor Solaris make allow that. commit fb282ef43a1936dcdefa57f16a8363b2adaf983b Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Oct 18 04:03:01 2005 +0000 Add miext/damage so misym.c can export DamageDamageRegion. commit 959db6028d232dc76396cb658aa48d3b4e605aed Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Oct 18 04:02:31 2005 +0000 Export DamageDamageRegion. Not bumping the ABI version since we did that already for this release. commit b61c828b0455ec1d4a7ffb54b5ac9b65764a458b Author: Kevin E Martin <kem@kem.org> Date: Tue Oct 18 02:23:58 2005 +0000 DRM 20051017 import commit d6a40bcd4a745b5d6d1070deb696b21d128ca0fe Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Oct 18 00:32:55 2005 +0000 Change default install dir for app-default files from $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match the monolith & allow localization commit e7007f7d51c9e1d39118865fefb1716c579a70bd Author: Adam Jackson <ajax@nwnk.net> Date: Mon Oct 17 22:42:03 2005 +0000 More automake 1.7 braindamage: use mkdir -p, not . commit 151ba8b67fd88a721f9f72d3019212b22f5cd3e2 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Oct 17 22:25:58 2005 +0000 Work around automake-1.7 braindamage by providing an explicit rule for XOrgCfg. commit eec3df1503e561aff6656e15c73b25a0bba1b06b Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Oct 17 17:11:12 2005 +0000 Fix whitespace in AS_HELP_STRING uses, convert all help strings to use AS_HELP_STRING. commit 1859c62607d567aa05334df1662f7249c983f793 Author: Kevin E Martin <kem@kem.org> Date: Mon Oct 17 07:18:59 2005 +0000 include/dix-config.h.in Add support for more extensions Add missing files to EXTRA_DIST commit ccfe9e7e9b49cbbf7c50fbf1a5c33178f27f79eb Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Oct 16 21:57:34 2005 +0000 Link Xprint config directories in $(C_LOCALE) list to C locale dir, not en_US commit a7d6a4fb321415b8aaad72760ff8a1ca3fd077f9 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Sun Oct 16 03:02:53 2005 +0000 Change '==' to portable '='. commit c2e461c7e970830ea430de3e5f352d144e9f0239 Author: Kevin E Martin <kem@kem.org> Date: Sat Oct 15 20:44:44 2005 +0000 Fix typo and add new Makefiles to AC_OUTPUT Fix typos Add xorg.conf.man to CLEANFILES Add missing files to EXTRA_DIST commit 34b7b57b3c80507f63a542c6adb4b5c8ed80b642 Author: Kristian Høgsberg <krh@redhat.com> Date: Sat Oct 15 19:34:28 2005 +0000 Doh, remember to add this file. commit 744aa34ca5228ea176cc56a7bdd48bbf5f29b0b5 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Oct 15 02:19:09 2005 +0000 Add an additional meaning to the "dirty" flag. Now, if !dirty && !area, the pixmaps's contents are undefined, so we won't need to upload the undefined contents in MoveIn. Use the ExaCheck* for async ops as well, so that dirty is always tracked. While the performance impact for my ls -lR test was not significant (though the avoiding-upload path was being hit), it's likely to be important for the upcoming Get/PutImage acceleration from ajax. commit 21e7339c1eead1148eea462bc99cf8faf02c8d39 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Oct 14 22:44:56 2005 +0000 Hook up lbx. commit d62943c040fd3d45079c9918c57f74f993b585d4 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Oct 14 22:19:51 2005 +0000 Set default font path to match the default in the monolith so fonts are actually found. commit 0ee70f53ef9b05052ee079560df107d05a9c5407 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Oct 14 22:01:46 2005 +0000 Install Xorg & xorg.conf man pages even when not building docs commit 0676a2874a62a3661a718cdf21e75ffc77197ad9 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Oct 14 20:01:36 2005 +0000 Add sysv and sco os-support subdirs and add simple EXTRA_DIST Makefile.am in those dirs. Remove unsupported os-support subdirs (bsdi, dgux, hurd, nto, os2, pmax, qnx4) that have no maintainer and we don't dist. Add Options. commit 57abb5b171b2fe88252aeb788463e533106d66b9 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Oct 14 08:29:16 2005 +0000 remove reference to non-existent agpgart.h commit 7e3e9ed97ba25bb84286f97fe6882a37c9aa7e25 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Fri Oct 14 06:10:06 2005 +0000 Add XTRAP_LIB to XPRINT_EXTENSIONS to fix xprint build when xtrap is enabled. commit 821584fcd3bf83f3aaacd35e54323f71d976db44 Author: Donnie Berkholz <spyderous@gentoo.org> Date: Fri Oct 14 05:36:39 2005 +0000 Require glproto >= 1.4.1 if building DRI with GLX. This fixes a build failure on a number of hyperpipe functions. commit 8df7628a2ad93edf8271f13e0b43c0fa8f766668 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Oct 14 00:41:51 2005 +0000 Remove reference to XF86config-4. Add xorgcfg(1) to See Also list. commit b54c8154ca19edce00b9c6379d5daf94268bade1 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Oct 14 00:34:49 2005 +0000 Set substitutions needed in xorgconfig man page. commit 1df705e465a103c94ffbb9fe97bdbe6b0aefc746 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Oct 13 20:30:38 2005 +0000 AC_SUBST VENDOR_STRING & VENDOR_RELEASE for xorgcfg's app-defaults file commit b349b20d783252d5126451142419aae554f9b776 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Oct 13 18:08:24 2005 +0000 Dist NOTES. Dist helper shell scripts. Dist XAA.HOWTO and a few more unused C files. Dist xorgconf.cpp. Fix DIST_EXTRA typo. Clean yacc and lex generated files only during make maintainer-clean as we don't expect users to have those tools installed. commit 35a767590e481b15ae66dccc2dd91098992b2751 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Thu Oct 13 01:13:58 2005 +0000 Fix stupid mistake in yesterday's allocator commit, would cause exa to consider a random available memory size commit a16dabd05ee7ec97877f07bd40ed83c01e72fc22 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Oct 12 11:15:44 2005 +0000 Remove an RM line that appears unnecessary and was breaking the build at xf86DefModeSet.c with FreeBSD make, where RM was undefined. While here, make the build of xf86DefModeSet.c depend on its sources, so it'll rebuild properly, and make it a normal CLEANFILE rather than a DISTCLEANFILE, since the intention seems to be to build it at the user's build time. commit b819c8378fbf29f185332e8435a80eb35991cd1f Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Oct 12 08:22:31 2005 +0000 remove unneeded line of code commit e573b272bf2b06fb62d0306ddc966f3230ead967 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Wed Oct 12 07:46:36 2005 +0000 Use proper access size when reading pixel based on bpp of the source pixmap commit 55efb41f6cc064763cbfd3ee2a1239dc46cb109a Author: Eric Anholt <anholt@freebsd.org> Date: Wed Oct 12 07:35:20 2005 +0000 If a window background is a 1x1 pixmap, read the value out and go to exaFillRegionSolid rather than sending piles and piles of Copies to the hardware. commit fce11fdf03acc1f3f1dafb79fc8fff0251cf5473 Author: Kevin E Martin <kem@kem.org> Date: Wed Oct 12 02:11:06 2005 +0000 Fix typo (DIST_EXTRA -> EXTRA_DIST) commit 12994b9afbc18bfb7209f677abf673415c9ddf15 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Tue Oct 11 23:11:37 2005 +0000 Fix a couple of bugs in the offscreen allocator. One mostly harmless was causing our search loop for evictable blocks to possibly skip a good candiate, and another was the allocator would occasionally use area->offset as if it was the base of the pixmap, while for a pixmap that is not in available state, it is not. This caused some funny miscalculation leading to overlapping pixmaps and accesses beyond the end of the framebuffer. To make things cleared, I renamed save_offset to base_offset, made sure it's the one used everywhere in the allocator, and only align "offset" for the client at the end of exaOffscreenAlloc(). commit 8444a1f3918b0433f89cae31673ab63628b4543d Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Oct 11 21:01:04 2005 +0000 missed commit commit 3b683b63eed603ae58a8cddab48eb81f7ba0dbdf Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Oct 11 20:12:24 2005 +0000 missed ChangeLog entry for previous commit commit b4450f3242ab408e80bc3d6d5d1cf6765f3e5339 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Tue Oct 11 19:03:02 2005 +0000 Add DGAReInitModes, Part 2 commit d91d18e1d6d663244288748ab86a35a6c151a535 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Tue Oct 11 19:02:18 2005 +0000 Add DGAReInitModes in order to allow the driver to change the list of supported DGA modes. (Part 1) commit c1a2abadfbb862cbaac3e23d0c1317ce5473ebdd Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Oct 11 14:50:47 2005 +0000 fix a typo commit 697f64a22ac5a7742a0022605a1074351296d4f8 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Oct 11 14:50:03 2005 +0000 check randrp has been initialized commit 2828d92c6ca400b603b6a20a221d9c858732292f Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Oct 11 14:45:01 2005 +0000 programs/Xserver/hw/xfree86/common/xf86RandR.c programs/Xserver/hw/xfree86/loader/xf86sym.c Add a new function xf86GetRotation to allow third party modules to obtain the current rotation. commit cad18ec979e38ef80a606f0e4abf2142b9d0d2b1 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Oct 10 10:07:47 2005 +0000 don't move x or y depending on the screen size change commit 7f72f94aa4f0655b8aab6c67eef2a5f5ac4b418f Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Oct 10 09:31:49 2005 +0000 rework that again commit 7c1d9a31a36552467d194e7d009c17dc526256c2 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Oct 10 09:24:28 2005 +0000 a furthur tweak to the randr cursor position fix commit 13f958fbe8420e406f24c01d320f29002ee860b7 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Mon Oct 10 05:58:41 2005 +0000 Add missing {Prepare,Finish}Access() wrappers for the tile pixmap in the fallback case commit d82aeb55ca3b6abe4cafa7b9c39777a5f67308e5 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Oct 9 23:47:52 2005 +0000 Bug #3254 <https://bugs.freedesktop.org/show_bug.cgi?id=3254> Make sure screensaver & DPMS timeouts don't overflow when multiplied by MILLI_PER_MIN. (Reported by Zachary J. Slater) commit 29b5f846d261976f466d2c7181d6a75de670066b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Oct 9 17:47:34 2005 +0000 Bug #4715 <https://bugs.freedesktop.org/show_bug.cgi?id=4715> Add SecurityPolicy to EXTRA_DIST (Bill Crawford) commit 046234b3ebdfe221de9e87d70d287f69a6f59d6e Author: Eric Anholt <anholt@freebsd.org> Date: Sun Oct 9 02:03:22 2005 +0000 Don't try the accelerated glyphs path for component-alpha text (which I don't expect drivers to be able to accelerate without exa assistance). Instead, drop back to plain old miGlyphs for a 62.5% +/- 1.5% reduction in runtime of my ls -lR test (n=5) with component alpha. While a reasonable approach would seem to be making a better test to see whether the entire path would be accelerated and force migration appropriately, my attempt at this made the situation much worse. commit 526d1502df8db6799c9d1155b86ce79cef90872b Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Oct 7 21:29:39 2005 +0000 another update to the RandR fix (thanks Aaron) commit 5a71a5667eb5b01e0f65f9310f4af1f6c5711ab7 Author: Kristian Høgsberg <krh@redhat.com> Date: Fri Oct 7 19:01:10 2005 +0000 Add Xprint init scrips to EXTRA_DIST. commit 470213753b158225b44a39a872599344acbc7101 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Oct 7 18:15:08 2005 +0000 update the last RandR fix commit 348242f35aeb2869ef390241035b5f3266fc0288 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri Oct 7 15:39:52 2005 +0000 programs/Xserver/hw/xfree86/common/xf86RandR.c Use PointerMoved instead of SetCursorPosition, as PointerMoved will call AdjustFrame to reposition the window if necessary and avoid the cursor ending up offscreen. commit 578e18d11b3d61449c1dd7eba04e1748f19c68f3 Author: Kevin E Martin <kem@kem.org> Date: Fri Oct 7 14:27:47 2005 +0000 Add darwin to dist Include missing docs in EXTRA_DIST Include headers and other files in dist commit 148df64a05d69adaac4b0f3684b846eb1da60219 Author: Kevin E Martin <kem@kem.org> Date: Fri Oct 7 04:11:02 2005 +0000 Add README.compiled to dist tarball commit ff258ac2783203ed2a7698894d951391d1aecebc Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Thu Oct 6 23:45:29 2005 +0000 Clients tend to set picture->repeat when not necessary. Most HW cannot accelerate repeat NPOT thus triggering software fallback (this is the case with gnome desktop for example). This adds a simple optimisation to exa that removes "repeat" when it's obviously useless, that is, the single picture instance covers the entire rectangle beeing used commit e4ed43c3a6c248ba2b82b8bbf29da537a68407e6 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Oct 6 22:25:35 2005 +0000 symlink.sh: New files linked: xorgconf.cpp Options usb.3 usb_hid_usages lynx_ppc.S BUSmemcpy.S IODelay.S PortIO.S SlowBcopy.S sun_inout.s xaaTEGlyphBlt.S xkbcomp/compiled/README New files excluded: All of lib/GL/apple xlibi18n/*/*.mapfile xxserver/xorg/configure.ac, xkb/Makefile.am: Install README.compiled in the xkb output dir commit 1614a31a9dad9482ae4526c194c2bae1c4993f8f Author: Eric Anholt <anholt@freebsd.org> Date: Thu Oct 6 21:55:41 2005 +0000 Bug #4699: Correct some memory leaks in EXA and damage related to region handling. commit cd9ff6aec81e04bbfe14364407ccb28df05fc063 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Oct 6 20:16:13 2005 +0000 cpp processing for Xvfb man page commit 370b8c8f1cb1a3531d52ea3b430852a0d76b2a4c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Oct 6 20:14:43 2005 +0000 App-defaults file not supposed to have .ad suffix when installed Fix cpp rules to set needed flags for app-defaults file commit 2770233069d3845c681bea8eccff22e92254487e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Oct 6 19:59:26 2005 +0000 Don't build "ev" example on systems without <linux/input.h> commit 460145a5d52b5325fa5e920cee3699fcf7dd9afe Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Oct 6 19:37:39 2005 +0000 Add cpconfig.c to EXTRA_DIST. Add CURSOR.NOTES to EXTRA_DIST. Add extrapci.ids to EXTRA_DIST and fix xf86PciIds.h rule. commit e63f76caa1b1342422567fdcb9f8af24792c8ca1 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Oct 6 17:55:54 2005 +0000 Sun bug #6326551: xkbSetDetectableAutoRepeat broken when using XEvIE <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6326551> (Derek Wang, Sun Microsystems) commit 5f30a7b10286b4f55821acd4eb5580a8f5a3c56a Author: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: Thu Oct 6 08:08:04 2005 +0000 Bug #4689: Treat DirectColor as TrueColor in Render. It fixes some crashes with xcompmgr when using apps that use a DirectColor visual for their windows commit 9000c0321baf1e25e1796e6a333aad0e5a22cbe2 Author: Kevin E Martin <kem@kem.org> Date: Thu Oct 6 04:05:30 2005 +0000 Install correct man page and add to dist commit 9b894df44b575f768a2400d044d8c1eb6ef2ec97 Author: Kevin E Martin <kem@kem.org> Date: Thu Oct 6 02:40:41 2005 +0000 Include dmx-config.h for modular build Use <X11/extensions/dmxext.h> intead of "dmxext.h" commit 30c1369bf5816ffd7bd52d9a9dbcb72500684e2f Author: Kevin E Martin <kem@kem.org> Date: Thu Oct 6 02:35:22 2005 +0000 Add support for building DMX config and examples programs Add missing files to EXTRA_DIST Install Xdmx man page commit 1f9b6dc1ccd999c90ba825cf5fbdfa29770224a6 Author: Kevin E Martin <kem@kem.org> Date: Thu Oct 6 00:34:29 2005 +0000 Clean up generated files to pass distcheck Clean up generated files to pass distcheck Distribute getconfig.man.pre, not getconfig.man commit 61cd478b545de0313271cf6852e2df770e8f5914 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Oct 5 22:39:41 2005 +0000 Bug #3652: Server-side GLX support for GLX_SGIX_swap_barrier and GLX_SGIX_hyperpipe extensions. (Eric Kunze, SGI) commit e891d9c078bd31447ae3e1fc7f8c15953b0bb916 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Oct 5 22:19:09 2005 +0000 Update to 2005-10-05 snapshot from pciids.sf.net (includes a couple new Radeon id's). commit dc6ac8e46f80157960a24a1be1fb83f22dff45a0 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Oct 5 21:38:40 2005 +0000 Add DGA configure option and add various files that we should be dist'ing. Simplify xf86DefModeSet.c rule a bit. commit 8391eaa4aa1ae3744ad8c45f5d148ba362d2c9dd Author: Adam Jackson <ajax@nwnk.net> Date: Wed Oct 5 21:13:49 2005 +0000 Preprocess and install XOrgCfg.ad as in the monolith. commit a9df169f108b15d312421e498675cd2e48206660 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Oct 5 17:27:58 2005 +0000 Add missing $(DESTDIR) to custom install target commit a6cbe0776fcc8fb19a2bf2ecef41559eed6e5cef Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Oct 5 16:39:09 2005 +0000 Fix the rest of the XFree86 DDX options that require an argument to say so instead of reporting "unrecognized option" when the argument is missing. Also give correct error instead of "unrecognized option" for options only available to root. commit 8c524f9966d2a167ea71dd81e235140e0db31471 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Oct 5 15:33:40 2005 +0000 Xdmx & Xprint also need xau & xdmcp module dependencies commit 9f3ad65251832631630f7e587b409b750a144bd3 Author: Luc Verhaegen <libv@skynet.be> Date: Wed Oct 5 07:27:52 2005 +0000 Fix lnx_pci.c's xf86GetOSOffsetFromPCI return value. Clears up the resource ranges awkwardness and the "INVALID MEM ALLOCATION" warning. commit da989e988cc96c0ec4f07fceb4c36b30c2e37f4a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Oct 5 02:18:10 2005 +0000 Xnest depends on xdmcp & xau modules too commit 9e8b5f3d478ca18a9ff9c26745de77c91a5d36d9 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Oct 5 01:38:50 2005 +0000 Make Xorg -config stop lying to people and claiming it doesn't exist when you fail to specify a file name. Also, include it in the list of available options for non-root users when listing all available flags. commit 34a8411ede185553f1387ee0bf534cf77b0fc004 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Oct 5 00:55:08 2005 +0000 Bug #4038: Unbreak the SYSVIPC check for cross builds. (Detlef Vollman) commit f47f00ab747563678c8625de5e5b2a588660064e Author: Eric Anholt <anholt@freebsd.org> Date: Tue Oct 4 11:24:09 2005 +0000 Mark the temporary pixmap dirty if UploadToScreen succeeds. Failure to do so resulted in a solid black glyph if the font rendering actually resulted in a fallback (subpixel AA, for example) and the temporary got migrated after 10 or so glyphs. commit 89a1a91b88b94b341075bc208941337ce11465b7 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Oct 4 07:42:21 2005 +0000 Add miext/cw to the module loader include path so that misym.c can export miDisableCompositeWrapper. commit 43625a47063c246e7bf9d687caded0b7e2ea0dc6 Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Oct 4 07:31:53 2005 +0000 Bump the video driver module ABI minor version to 8 so modules statically linked against miDisableCompositeWrapper won't load on older servers. #include "cw.h" instead of #include "cw/cw.h" commit ca57db6fc1e6100c47ad935d626fdd490ed6116e Author: Aaron Plattner <aplattner@nvidia.com> Date: Tue Oct 4 04:30:33 2005 +0000 Export miDisableCompositeWrapper. commit b2e451b93c20efc49a6cc565239432b2c705fe37 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Oct 4 03:44:14 2005 +0000 Correct the test for whether projective transform is necessary. Also, use "affine" to describe the variable (universally) on suggestion from vektor. Corrects a rendercheck failure. commit cdded97a0ad717f4f9120b37d2687fa661696c9b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Oct 4 00:45:42 2005 +0000 Add #include <xorg-config.h> for modular build commit 4ae4fc7d51aeb0f27bed52f7e6a346745f3ea453 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Oct 4 00:43:16 2005 +0000 Add gtf to xserver/xorg/hw/xfree86/utils commit d51962378ef6371456e034d6d7f6780e05bc1207 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Oct 3 19:31:50 2005 +0000 Bug #3781: Only use fbCopyAreammx when alu == GXcopy. Originally Gentoo bug #96053, patch by bartron@gmx.net. commit 6d4b350dee9495e54e6e5492815885f1d8455ac9 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Oct 3 16:46:14 2005 +0000 Bug #3815 <https://bugs.freedesktop.org/show_bug.cgi?id=3815> Patch #3463 <https://bugs.freedesktop.org/attachment.cgi?id=3463> GNU/kFreeBSD Xserver support (Robert Millan) commit 22b4200b01310e7b4743ef0b3541c3053a2d8279 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Oct 3 15:41:10 2005 +0000 Whoops, need to be in DIST_SUBDIRS too. commit 14a2bd33307fd937804a9fbb03787ec30858a05c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Oct 3 15:37:57 2005 +0000 Add missing ] (Dawid Gajownik) Add getconfig (Dawid Gajownik) commit 84141fc299b03b5552be093f9b698a85bc670d65 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Oct 3 11:43:55 2005 +0000 Merge r1.36 of fbcompose.c from xserver CVS: Special case projective transforms so we can avoid doing the expensive 64-bit math. Unroll the bilinear interpolation loops for an extra boost. I tested this with the up/downscaling cairo-benchmarks with Xvfb and saw a 12% +/- 4% decrease in time taken to run them. commit c024262eae4e00567ccb66a59b4d572621233cbc Author: Eric Anholt <anholt@freebsd.org> Date: Mon Oct 3 10:20:29 2005 +0000 Merge r1.2 of fbedge.c from xserver CVS: Optimize spans where the same value is being added to multiple pixels. This improves the speed of rendering wide trapezoids. I tested this with a small set of xlibs cairo-benchmarks with Xvfb and saw a 4% decrease in time taken to run them. commit a7e3c6fa8ceb6a3a423377aa32ab0da5a6ab9286 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Oct 3 06:31:48 2005 +0000 Real configure check for execinfo.h (Yuri Vasilevski) commit e3d2a7d57bc57453d66aa63ca7fe4d910b64737c Author: Adam Jackson <ajax@nwnk.net> Date: Mon Oct 3 06:29:14 2005 +0000 Bug #4393: uClibc lies and defines __GLIBC__ even though it's not source compatible with glibc, so the backtrace support check fails. Work around this by wrapping the code in a configure check for execinfo.h, and emulate detection for the monolith. (Yuri Vasilevski) commit 5037d3441d65f1fb6493c3b55137ef1b5eddd6b0 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Oct 2 22:17:38 2005 +0000 Bug #1465 <https://bugs.freedesktop.org/show_bug.cgi?id=1465> /etc/init.d/Xprint should use PROJECTROOT from build (Grzegorz D?browski) commit b05e78dd40e1fe915096362f32c3af8aee0ed36a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Oct 2 19:30:57 2005 +0000 Fix typo in MAN_SRCS (Dawid Gajownik) commit 8814896da83b19be01beedd0b2b3380298778328 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Oct 2 08:53:18 2005 +0000 Fix include path for commit of bug #4616. commit ecaa46380ed0a920186407b9294c5c60f75f1a13 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Oct 2 08:28:27 2005 +0000 Bugzilla #4616: - Merge various fb/ bits of COMPOSITE support from xserver, which weren't necessary before due to cw hiding the issues. Fixes offset calculations for a number of operations, and may pull some fixes that cairo has wanted for XAA as well. - Add a new call, miDisableCompositeWrapper(), which a DDX can call to keep cw from getting initialized from the damage code. While it would be cleaner to have each DDX initialize it if it needs it, we don't have control over all of them (e.g. nvidia). - Use the miDisableCompositeWrapper() to keep cw from getting set up for screens using EXA, because EXA is already aware of composite. Avoiding cw improved performance 0-35% on operations tested by ajax in x11perf. commit 2c82429f8957ed0268c0e4e4fe5aed9093f33960 Author: Ian Romanick <idr@us.ibm.com> Date: Sat Oct 1 22:25:13 2005 +0000 Refactors __glXImageSize and __glXImage3DSize into a single function. It replaces all calls to the old functions with calls to __glXImageSize with the new parameter list. I have also added 'target' as a parameter. This is a stepping stone to the code in patch #2410. Basically, if the texture target is one of GL_PROXY_*, the image size is always zero. This gathers all the checks for that into a single place. I have *not* modified the existing callers to take this into account. They still do their own checks for GL_PROXY_*. However, when the generated versions of those functions are added to the tree, they *will* rely on that. The code growth is mainly due to the new 40 line comment before __glXImageSize. I have tested this with a few of the texture using demos and tests from Mesa, including tunnel, texdown, and drawpix. Reviewed by: Adam Jackson, Eric Anholt, and Brian Paul. commit e27b3e4ea1ddf9b2e9c2d63a0e60400b523a8a94 Author: Ian Romanick <idr@us.ibm.com> Date: Sat Oct 1 22:19:04 2005 +0000 Remove some more incorrect prototypes for the __gl*_size functions. commit e270e6394b623b48d416feeef0c3856f2e303c8d Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Oct 1 17:53:38 2005 +0000 Bug #3822: out of bound reads in fbbltone and fbblt (Mark Kettenis, Thierry Deval). commit 54b2a14f0fa4397f3e9ae75dd63d5cacfdd778eb Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Oct 1 17:30:58 2005 +0000 Bug #3411: fix handling of keyboard Autorepeat rate in xorg.conf. commit a07dd03748c8fa2633e294ee4d9ab38265970e5e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Oct 1 07:17:55 2005 +0000 Add hw/xfree86/getconfig commit abc6aa50fb52fa4fa9b9436dbc3a70f86e62dc27 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Oct 1 06:27:12 2005 +0000 Oops - fix build/install of fbdevhw.man commit 13e0db19d8c0b1df636f218bcbfbb2c54fa7576f Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Oct 1 06:19:02 2005 +0000 Adding more doc files & fbdevhw man page commit b5ce065a5e91e2ad3213ea8c711cfe7ed9060c16 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Fri Sep 30 08:54:44 2005 +0000 RandR: Fix failure handling (Closes #4635; Thomas Winischhofer) commit 4608a2b654be84b2e345bcada63422d18c74a06e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Sep 30 02:37:57 2005 +0000 Man page processing/installation and other doc file updates commit aa74468aa59b95424cd0000179b8985b267d639b Author: Adam Jackson <ajax@nwnk.net> Date: Fri Sep 30 02:03:45 2005 +0000 sparse cleanups. s/0/NULL/ and mark a few things static. commit c65fde5343719d3e9ebc76cc371c6f5f7948de8c Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Sep 28 20:38:42 2005 +0000 Make the server distcheck: - Fix up the XpConfig directory to remove the stuff it installs - Add a few files to CLEANFILES here and there commit 58abce3f90504dd48838a2f7ae7bb5db6a6cff70 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Sep 28 20:01:37 2005 +0000 - Use the dirty flag (which should be set correctly all the time, particularly thanks to Prepare/FinishAccess) to avoid DFS/memcpy on pixmap move-out if it's unnecessary. This was disabled in KAA because cache misuse on ATI made me guess that this code was wrong. - Unwrap Glyphs on closescreen. commit f53404bdbba23fd46420564565ab815f7c20b101 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Sep 28 16:55:25 2005 +0000 Add kbd_mode build system commit 940158a6f2e98069a47293d713df674e16ad8a11 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Sep 28 03:37:22 2005 +0000 Replace all uses of __glEvalComputeK (and the doubly redundant EvalComputeK) with calls to one of __glMap[12][df]_size. This was tested with progs/samples/eval (from Mesa). commit 806d74bc0640f4f3dcc034b36a36aea289b01685 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Sep 28 01:57:47 2005 +0000 Add __SVR4 #ifdefs to work in non-Imake builds. commit 88957862b812b3e1e19d5e11365a22dc249cf4d2 Author: Kevin E Martin <kem@kem.org> Date: Tue Sep 27 23:28:46 2005 +0000 Fix distcheck build and install errors. commit 003655c02ad3a031031bb4ac859966a513f63e10 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Sep 27 18:36:14 2005 +0000 Make XpConfig build system call mkfont{scale,dir} commit 156b2cf3f76ae53cc37b6f5910b446c776ccc9ba Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Sep 27 17:49:35 2005 +0000 Add forgotten Makefile.am commit f3d0cb4a5722e0512bbdcd179215532795cba38f Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Sep 27 16:15:55 2005 +0000 Get XpConfig build system in pretty much working state commit 1c2e8b1ecc8b7b8c8562461eed7892ff22d17e71 Author: Kevin E Martin <kem@kem.org> Date: Tue Sep 27 15:11:56 2005 +0000 Fix make dist to include only sgml files. commit ca64aab609c3585234410cd8d908f8e1efe5c788 Author: Kevin E Martin <kem@kem.org> Date: Tue Sep 27 14:09:31 2005 +0000 Add build system for building docs and fix setuid issues. Add build system for sgml docs. commit 1a4e30d508e62ab304722c3525748ff0e3c2899d Author: Kevin E Martin <kem@kem.org> Date: Tue Sep 27 13:47:26 2005 +0000 Include xorg-config.h so the generated file will also include it. commit 30ff9e26196bdba8435e0dcdb96864e81c8cb136 Author: Ian Romanick <idr@us.ibm.com> Date: Tue Sep 27 00:04:40 2005 +0000 Fix some problems that caused incorrectly annotated prototypes for __gl*_size functions to be used. The result was that, on x86, the code would be compiled with FASTCALL semantics, but the callers would not. This should fix GLX protocol errors that people are seeing. There doesn't appear to be a bugzilla associated with this problem. commit 6c5c54b9a2872f1bb7de36a8d2d4efcef70b14c6 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Sep 26 23:07:44 2005 +0000 Various small fixups to get XpConfig to 'build' commit 604f7c64efb57a48ec667c2ed62d3b4bad0c302b Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Sep 26 22:45:43 2005 +0000 Check in skeleton Makefile.am's for the rest of XpConfig commit 8907195d784ff2c72a00b64edab6a8ac3b31dec5 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Sep 26 20:58:26 2005 +0000 Take care of more files from monolith's Xserver/hw/xfree86/etc dir: hw/xfree86/utils/ioport/Makefile.am Add ioport and pcitweak utils from monolith hw/xfree86/etc dir. Generate xf86DefModeSet.c from vesamodes & extramodes Add apSolaris.shar to EXTRA_DIST commit 9abccb5e65628c938c6f01b685ab8fbffae7bc3b Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Sep 26 19:33:06 2005 +0000 Add initial build system for XpConfig commit 0531c4be2f1a30082cfec5e411ab34d17978d66e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Sep 26 02:41:38 2005 +0000 alanc@alf:/export/alanc/X.org/head/cvs-rw/xc [7:40pm - 628] head -14 ChangeLog include xorg-config.h for modular build Adjust XF86CONFIG defines for modular build Fixes for modular build: - include modular server config headers - change default XCONFIGFILE to xorg.conf - define XKB_RULES_DIR if not defined by Imake commit 256fa24945bcaa6e5a68a48c1b757f8084e88a38 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Sep 25 17:48:09 2005 +0000 Add SecurityPolicy file for XCSECURITY extension. Add README to EXTRA_DIST commit 54639964cc344f1086196729fde37515f11e7972 Author: Bogdan Diaconescu <b_diaconescu@yahoo.com> Date: Sat Sep 24 21:56:00 2005 +0000 Changed the license to a X/MIT one commit 3192f400c72b3b606fcc1798d577737502897b43 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Sep 24 18:45:45 2005 +0000 Disable the {Open,Close}FullScreen DRI protocol. Remove empty FullScreen stubs from drivers, comment the non-empty ones. commit a5477ae7ac9a56c1a586950db1dee6661bff149d Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Sep 24 02:40:51 2005 +0000 Add scanpci, xorgcfg, & xorgconfig utilities. commit 2ba865b3f57340fd1d75f7614c17f615cc127b89 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Sep 23 23:04:04 2005 +0000 Fri Sep 23 19:00:06 2005 Søren Sandmann <sandmann@redhat.com> Apply patch from Ronald Wahl to make sure that the stack pointer is not modified at points where we access external variables. (Bug 4269). commit 7554e1bf29e5aef8e76f88bac2994ea45a924f2b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Sep 23 00:27:07 2005 +0000 Sun bug #6321613 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6321613> xorgcfg dumps core when it reads a configuration file that has a Monitor Section, but does not have a "VendorName" entry inside it. (Henry Zhao, Sun Microsystems) commit 99793543c0fcfd4d699549fcc2bf0ed12aed6a19 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Sep 22 12:40:41 2005 +0000 put back some agp related allocation messages commit 02566dff4abbda6888f719727c169b966617a83d Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu Sep 22 12:33:36 2005 +0000 fix typo commit 56e7766c775385b0c6e09e6a65a1c8e10dba786e Author: Eric Anholt <anholt@freebsd.org> Date: Wed Sep 21 22:26:07 2005 +0000 Bug #4541: Fix text drawing in the case where a list contains no non-zero-sized glyphs. Several variables weren't updated, resulting in rendering simply stopping when this case was hit. (Anders Kaseorg) commit 32497ff479d0c34c05eb5acfcd5f7e186bac3227 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Sep 21 18:14:32 2005 +0000 Accept --with-xkb-output argument to specify output dir for compiled xkb keymaps. Define XKM_OUTPUT_DIR and XKB_BIN_DIRECTORY. Add XKM_OUTPUT_DIR and XKB_BIN_DIRECTORY. Add XKB_CFLAGS. commit 361a9eb953aaa38f8ebc057185de29e50f9eef26 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Sep 21 10:27:53 2005 +0000 - Change migration-in rule slightly: previously, if your score was less than the max, it was bumped, and then if you were above the threshhold you got moved in. Instead, do the above-threshhold check separate from score starting out less than max. While this will likely make thrashing cases worse, I hope it will fix some issues with long term performance (think of an xcompmgr with a backbuffer it's doing only accelerated operations to. If some new pixmap comes in and bumps it out, even once, it will never get a chance to re-migrate because its score will be maxed). Change migration-out to be the same way for symmetry, though it shouldn't ever affect anything. - Fix a lot of debugging output, both in terms of printing quality, and completeness. The fallback debugging covers a lot more now, pointing out new areas for improvement. Debugging toggles are now centralized in exaPriv.h. commit 6a29c4cec156a135d1d9cdb65995f7a84de7cb56 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Sep 21 07:43:01 2005 +0000 Add support for hardware accelerating tiled background painting. One example of this is the root weave, which paints slightly slower on SiS now in my testing. However, according to keithp some apps use this feature for a sort of cheap backing store, which this could help with significantly. While I haven't done much performance testing with it, it will at least rule out one possible source of terrible performance. commit 1115ff4c008dea6d6cafcb39e4ce6d0b3ed4fcc0 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Sep 21 00:38:05 2005 +0000 Bug #4487: Add the bsd subdir to DIST_SUBDIRS. (Joshua Baergen) commit 00bd8968b264c1f69487dd99c212e0ce889b11db Author: Adam Jackson <ajax@nwnk.net> Date: Wed Sep 21 00:24:10 2005 +0000 Bug #4257: Move cfbcmap.c to cfb_common_sources. commit b7e723ed6f23cc8d85f1f1eced9d8ccbc2a6b38c Author: Adam Jackson <ajax@nwnk.net> Date: Tue Sep 20 23:32:21 2005 +0000 Missing backslash commit 15b2f94de5e2cc7e4df8d897d562dffeda31c82c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Sep 20 18:26:24 2005 +0000 Update CVS project tag & notice about pci.ids license in output .h. Update to match recent changes to pci.ids, extrapci.ids, & pciid2c.pl for people building on systems without perl. commit 7d0f47c43c5c177cae0f375ceaeef892e4c9663a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Sep 20 15:50:31 2005 +0000 Add --disable-install-setuid option so you can build as non-root and chown/chmod later. Also disable by default on platforms that don't need setuid root X servers (Darwin & SPARC's, according to InstallXserverSetUID settings in the old Imake config files). commit b623c60745ca486667657fa39ad517d1f7a72794 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Sep 19 22:44:49 2005 +0000 Linux/Alpha support (Stefaan De Roeck) commit bd906c6bb803b286c39eca80e437a21c14e808a3 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Sep 19 18:54:05 2005 +0000 Update to latest version from pciids.sf.net Sync with updates to pci.ids & PCI id list in nv driver commit 535cd292c809314efe4730a27b0271adfa842775 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Sep 19 18:38:26 2005 +0000 #include "xf86Axp.h" -> "shared/xf86Axp.h" for modular build. (Stefaan De Roeck) commit a1bcf25a1f819768672ac837cb0a3d0c66937656 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 18 02:32:23 2005 +0000 Break EXA ABI while we still can. Add coordinates to the UploadToScreen hook so we can upload a subset of a pixmap, and convert the current drivers to respect that. Use this support to directly UploadToScreen in exaGlyphs, providing a 47.4% +/-2.4% decrease in wall time for ls -lR programs/Xserver in an antialiased gnome-terminal on an M6 (n=3, caches hot). I would have bumped major version, only I can't tell what the EXA_VERSION_* is supposed to be doing as opposed to the module version. commit 074913c8a9c1f66c8752387db2c81ad669e91878 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Sep 17 20:02:02 2005 +0000 - Don't try to upload 0 byte-per-pixel (PICT_a1) data using RADEONHostDataBlit. - Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It appears that we do need the cache flush here, thought it's not clear why. Disable the 2d to 2d shortcut while here, since I'm unsure of what we're doing. Exposed by the following bit: - Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs were being accumulated in from non-migratable scratch pixmaps, causing the destination pixmap to move towards screen but the migration necessary for source never to happen, leading to abysmal performance. Instead, copy the scratch glyph data into a real pixmap first, then composite from that into the destination, allowing for migration. time ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall time (n=3). - Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of windows needing backing store. Makes migration code prettier, and ensures that composited windows will be migrated as normal when we turn off cw for EXA. (issue brought up by keithp) commit be2bdab4339e493bb0ac3d0e36508b7aa1cd6e92 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Sep 15 06:46:05 2005 +0000 Bug #3990: Require glproto in the cases that it's necessary (DRI or DMX with GLX). (spyderous) commit ef7eef0f68af6bfbb4ee56115ac2f3c1b7425755 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Sep 15 05:55:21 2005 +0000 Bug #4046: Install the X.Org server setuid root. (David Schleef) commit 88d7eb1f7ed6afc85c07797838714f2601356018 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Sep 15 05:06:54 2005 +0000 Bug #3889: Create the log dir on install, and allow configuring specifically that directory. Failure to have the directory keeps the xorg server from starting. commit 25a0ecdc1868f4b53225b92e8ccd222814e2da2a Author: Eric Anholt <anholt@freebsd.org> Date: Thu Sep 15 04:07:19 2005 +0000 Don't put a version number on the module filename. commit 0888ad3874414e32535fecdb717ee7ab86f9d4cc Author: Eric Anholt <anholt@freebsd.org> Date: Wed Sep 14 07:49:22 2005 +0000 Build xf8_32bpp, which is wanted by the mga driver, and export elf.h, which is wanted by the rendition driver. commit dfb5da93bc16b2fd2b00e939dbe101a04bdeab4f Author: Eric Anholt <anholt@freebsd.org> Date: Tue Sep 13 20:59:05 2005 +0000 Turn on DRI by default on Linux, NetBSD, FreeBSD, and fix the build of the module for FreeBSD by setting some missing defines (XFree86Module, IN_MODULE) in the dri directory. Note that those missing defines should be somewhere generic, since there are other consumers of them, but I haven't figured out where. commit 12fbcfefe672ec226bdbc7597bf2fd2cb0ee1e19 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Sep 13 18:37:35 2005 +0000 Add some initial BSD support for the xorg server. Incomplete on NetBSD, OpenBSD, and non-i386/amd64 FreeBSD for sure. Plus I haven't actually run it yet. commit 51eb6c83a3b2721703ca50758853bbf9f99fc4d2 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Sep 13 15:28:29 2005 +0000 Tue Sep 13 11:27:05 2005 S%Gï¿¿%@ren Sandmann <sandmann@redhat.com> * programs/Xserver/miext/shadow/shadow.c (shadowDamageBox): Add missing REGION_UNINIT. commit 133edff1b499b2c794fcc9a1860c1b5526b58869 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Sep 13 05:44:47 2005 +0000 Don't define POSIX_SOURCE on any BSDs, since it breaks things. Define NO_SYS_HEADERS, as the monolithic build does. Helps FreeBSD. Don't include validate.c in the library, since it seems to be a userland test program. commit c3d6799cee7ff8411b3a05a7ab7e2a9e80c95059 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Sep 13 01:33:19 2005 +0000 Bug #594: CAN-2005-2495: Fix exploitable integer overflow in pixmap creation, where we could create a far smaller pixmap than we thought, allowing changes to arbitrary chunks of memory. (Søren Sandmann Pedersen) commit b290884719e18646326f0c2412c2494a07fe3cfd Author: Adam Jackson <ajax@nwnk.net> Date: Tue Sep 13 00:44:52 2005 +0000 Bug #3284: Make the DRI lock reference count per-screen. commit 846f797f37c1ae57a8dad981113b1139359d8c94 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 12 08:24:48 2005 +0000 Add missing fontsproto and fontenc to REQUIRED_MODULES. commit 5b218617fa8ba52bf65aef35da39e06c662495e6 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 12 07:53:16 2005 +0000 Add missing resourceproto to REQUIRED_MODULES. commit ade158d238475ce923fbc5c49275c78cf3864223 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 12 07:07:59 2005 +0000 Define WITH_VGAHW, since we always build it; add to Xorg headers. commit 34dc481a16c0c1cbd69a9ec7172331b59b85e9a7 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 12 07:02:46 2005 +0000 Put DMX AC_CONDITIONALS at the top level, since they must always be called. commit b0f6fe1f38b448b5f1a280e86b01353865866c70 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 11 21:38:41 2005 +0000 Add some optional (disabled) fallback debugging code to the async code, for better tracking of when we're hitting software. commit 1c003ccf5d68baaae6fafdc75eff964f2a62fc35 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 11 19:08:10 2005 +0000 Add a pair of hooks, PrepareAccess() and FinishAccess(), which get called around CPU access to the framebuffer. This allows the hardware to set up swappers to deal with endianness, or to tell EXA to move the pixmap out to framebuffer if insufficient swappers are available (note: must not fail on front buffer!). Submitted by: benh commit ca210830bd361e3d91b6bc741c495b61c424d1d2 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Sep 11 18:43:55 2005 +0000 Simplify life for EXA drivers by reducing some {Con,Dis}joint ops. commit 04f81cacb9fd0944879b2c23a99fa3a1ae979b12 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Sep 11 18:33:31 2005 +0000 OpenBSD also doesn't like defining POSIX_SOURCE: it limits available functionnality in headers beyond what's used by Xorg. commit 089b4272cf32fc9429c1a0e666c2ffb34fda0b93 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Sep 11 01:16:14 2005 +0000 use RGB_DB not RGB_PATH as that's what it's looking for define HAVE_XKB_CONFIG_H so setting xkb-path works (Jürg Billeter) commit 2f9d01c9681d80235a70263e2e087dc6c181cdc8 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Sep 8 01:15:47 2005 +0000 Remove some references to mfb/cfb support that is no longer there. commit b5d42012f9be87f3b45a089c596ce6dba8845794 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Sep 7 01:30:23 2005 +0000 Fix typo resulting in failure to swap between RGB/BGR properly. (Stephen P. Becker) commit c8de8c23fbccb3296747f429a02c0c0682b74bf5 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 5 07:43:51 2005 +0000 Fix tests for maximum number of colours when creating a colourmap, so a 32-bit visual (e.g. ARGB) doesn't overflow an int when attempting to do 1 << 32. (Benjamin Herrenschmidt) commit 5c5c51fa6da03f19831632a092761a1e4bcf653b Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Sep 5 07:40:50 2005 +0000 Initialise private arrays with calloc, rather than standard malloc. (Benjamin Herrenschmidt) commit 691669c0121494df90c8523f7d17e01ba0b14a57 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Sep 3 07:08:58 2005 +0000 xorg-server.h -> dix-config.h (thinko). commit 4b2f5ba1b5d59fd6bd7f82da5730f72e8df04858 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Sep 3 03:27:55 2005 +0000 Use macros from xtrans.m4, issue error if not found. commit 733a6d7a268945d149bcea159253408bedc69b12 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Sat Sep 3 02:21:36 2005 +0000 Add EXA driver writer documentation for the benefit of future generations of X hackers. commit 854010d71dc0f1e9b73cdc764c9d2cf36f1da625 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Sep 2 03:22:01 2005 +0000 Add -include dix-config.h to GL/mesa/X to catch _XSERVER64, et al. commit 287336f3c9e5023acbfba6508b05a68ccca9ddf0 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Sep 1 19:56:14 2005 +0000 Teach xkb how to optionally run xkbcomp from $bindir instead of $datadir/xkb. commit 94fbdb5c6d2cdc7b70ecdabe22a9de8b9aabeced Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Sep 1 14:56:35 2005 +0000 Make RGB_PATH configurable. Move I2C modules back to $(moduledir)/multimedia. commit a65c5796133d126b1810749b5206607e7c42d787 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Aug 31 14:58:09 2005 +0000 Include xkb-config.h if we have it so we pick up the paths defined there. commit 9d3b5e89d691b79ea3361e6dc82938c22d70d0e3 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 30 22:34:14 2005 +0000 Save keyboard LED state on startup and restore on exit so text console mode LEDs match text console mode state. Move push of streams module earlier so it's loaded before we start using kbd ioctls provided by the streams module. commit fa6fbd018da939fda7cc2b9a9aa2717b9675a178 Author: Kristian Høgsberg <krh@redhat.com> Date: Tue Aug 30 22:31:52 2005 +0000 Use the $(moduledir) makefile variable instead of @moduledir@ so it can be overridden at make install time. Remove driverdir and inputdir from pkg-config file. The directory layout of moduledir is fixed and well known by drivers. commit b4f4bf028a88ee709f4536373de2d40b6445006e Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Aug 30 19:51:59 2005 +0000 programs/Xserver/hw/xwin/winmultiwindowshape.c Fix off by one error (Colin Harrison) commit 0e50af8b7f459aafd1d1d52414629e926167a751 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Aug 30 19:35:06 2005 +0000 typo fix commit 0c74799af4f924ba64ebd6052802b73547f55c72 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Aug 30 04:41:04 2005 +0000 Remove existing broken maxX/maxY code for composite (results in infinite loops, doesn't deal with failure, doesn't present the interface to drivers that I expected) and instead replace it with a simple fallback to software when coordinate limits could be violated. Act similarly in other acceleration cases as well. The solution I want to see (and intend to do soon) is to (when necessary) create temporary pictures/pixmaps pointing towards the real ones' bits, with the offsets adjusted, then render from/to those using adjusted coordinates. commit f20e845b04dee5fc0780811f565180e322b60b73 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Aug 30 03:42:07 2005 +0000 More 0 -> NULL for pointers missed in previous commit to this file. commit 7777d325a3d049cc233c004cba288ed5d10539c2 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Aug 30 03:05:21 2005 +0000 Apply an xserver patch from cworth: Avoid buffer ovverrun when a trapezoid's right edge is on a pixel boundary. commit e321f9e7ff7de9aa702e33a22743b55c8bb66953 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Aug 30 03:01:38 2005 +0000 Apply the xserver patch from vektor for bug #4208: Use NULL for pointers instead of 0. commit 20813d3af065f9b719b39d2e7a3382b8fa278a48 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Aug 28 19:47:39 2005 +0000 Bug #3974: Fix unaligned memory access on LP64. (Matthieu Herrb) commit 0926cf79c030f29dce32a9dc944734960ec93d19 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Aug 26 20:21:57 2005 +0000 Add diagnostic messages for exaDriverInit failure cases. commit 5ffff7cb868a768307ff6faf164210020e6b94a2 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Aug 26 20:08:09 2005 +0000 Bug #4160: Fix Altix kernel version check. commit 6b0cdc5dd9e451021c562ac4b6b2101d50187a30 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 16:46:41 2005 +0000 Change use of dix-config.h to xorg-config.h. commit 9d1b349b3765fb587b353c78cca9aa083f5d0eee Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 16:34:55 2005 +0000 Back out previous change until I figure out something smarter. commit 3075df24e7931901c6f0526e10a89631fd73c4d0 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 07:35:55 2005 +0000 Subvert SIGUSR2 to reload all input devices. (Ubuntu #020) commit 89c84575ea905c7598d6b6029c9209abe1cfb074 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 07:24:21 2005 +0000 Undo rate/period change after function body, so the damage doesn't leak into other functions. (Debian #050) commit bb5e934df7f23fb365ed673a12d283ff52af79c0 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 07:15:04 2005 +0000 Only open /proc/bus/pci/devices once. (Ubuntu #029) commit c937faadd0a0a5f2598b84286ac1ed8996a512e5 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 06:48:24 2005 +0000 Better error message on failure to set iopl. (Debian #021) commit 6d34a2ac8a33bd6c9083106b38fab6062e033e39 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 06:35:00 2005 +0000 Add Xv symbol from Xext. commit b8f0d4c3ebee363279f9dc7318de3e3c854ca5ef Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 06:29:15 2005 +0000 Spit out an error when there is no valid FB device, instead of just failing silently. (Debian #070) commit b48a24e7969d99a0116bc780c70d3e1c18b34769 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 06:23:41 2005 +0000 Don't assume that all sun4m CPUs support muldiv; the Cypress CPU, which implements the 4m MMU but only v7 instructions, does not. (Debian #100). commit fd158d3d5215b0a013f5305a76097b0b8fa14cf6 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 05:49:44 2005 +0000 Get prototype for ntohl from SuSv3-compliant location, fixing it for systems which define ntohl as a macro only, not both macro and function. (Debian #076) commit 53e489c0e39b89f41213a726fe1b611d7d9a18db Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 05:47:36 2005 +0000 Work around ATI expansion ROM problem on IA64 caused by prototype HP McKinley systems. (Bdale Garbee) commit 40374d1149d6dcf0b4521faae8bdfecc8a3af077 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 26 05:00:07 2005 +0000 Accept 'Enabled' and 'Disabled' for Extensions section (Ubuntu #990) commit ea80b5db257f4c22cf5a152084aef5fe05079db0 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Aug 25 22:11:04 2005 +0000 Fix a use-after-free of cursor data by refcounting for the sprite.current reference. The particular path seen was XFixes' ReplaceCursor() resulting in the sprite.current being freed, but then it getting accessed during the ChangeToCursor() that happens as a result of WindowHasNewCursor(). commit 54cc45b09bc6c860b3de2012b57c4b35ca18ffd2 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Aug 25 21:22:41 2005 +0000 Thu Aug 25 17:15:01 2005 Søren Sandmann <sandmann@redhat.com> Add all the drivers to the module_LTLIBRARIES instead of having separate variables for them. Pointed out by Kristian Høgsberg. commit ff22adc09763b2bd860e7f780a5d0855cab0ab30 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Aug 25 14:19:43 2005 +0000 Remove sun_inout.s so make dist works (discussed with Alan Coopersmith). commit 344a24b6229f477c892dd855546391bc1e091bd7 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Aug 25 04:09:45 2005 +0000 Use system curses library on Solaris for xorgcfg text mode. commit 0711502f1847ed461672b9842218b9afa9d349ed Author: Eric Anholt <anholt@freebsd.org> Date: Wed Aug 24 23:48:11 2005 +0000 Bugzilla #4226: Change the pixmap migration strategy for the CopyNtoN case. Now, if either source or dest were in framebuffer, try to get both there, but prefer system memory for both otherwise. Required making exaasync.c go through the try-acceleration path. This significantly improves window resizing under composite, because previously the pattern of creating a new pixmap and copying default contents from the screen caused a fallback every time due to the new destination pixmap being in system memory. commit 2261710fe0dffd60433e3362ac12adf4db570fe5 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Aug 24 23:38:25 2005 +0000 Fix a bug where NULL could be dereferenced during the pixmap kick-out process by referencing the correct offscreen area. Also drive-by the comments related to these for clarity. commit 55c5c6953a3a661758a42b147f9542950a62fc4d Author: Eric Anholt <anholt@freebsd.org> Date: Wed Aug 24 22:43:27 2005 +0000 Bugzilla #4090: Introduce getters for pixmap pitch and offset, to simplify/clarify it for driver writers who probably don't want to know what pPixmap->devPrivate.ptr or pPixmap->devKind mean. Converts the sis driver to use them, and bumps the EXA module minor version. commit 079ad773e09ed0c5baf01de3d4f02a5568da5634 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Aug 24 22:37:15 2005 +0000 Fill in xf86DeallocateGARTMemory stub based on lnx_agp.c version. Add include of xorg-config.h for modular builds commit 8fd250e5e4c2016614b82e2d653b7fbf8a3a5b99 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Aug 24 21:51:28 2005 +0000 Bugzilla #4089: Fix crashes in !EXA_OFFSCREEN_PIXMAPS case by not trying to do migration when the EXA pixmap private is NULL. commit 79dc5f3d5fe5a66f5fa53af9afc30d27d1af0bce Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Aug 24 21:28:40 2005 +0000 Don't export non-standard symbols generated GCCs stack protection feature (__guard, __stack_smash_handler). commit d2952de6e3d9197529695bb88d8c3af679ad71af Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Aug 24 19:41:43 2005 +0000 Wed Aug 24 15:39:07 2005 Søren Sandmann <sandmann@redhat.com> Add GLX_{INC,LIBS} for xprint. Add @DIX_FLAGS@ to AM_CFLAGS commit 81e708440ced309adc62ebf43d00becd32338db5 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Aug 24 19:35:51 2005 +0000 Wed Aug 24 15:29:50 2005 Søren Sandmann <sandmann@redhat.com> Conditionally include dix-config.h Conditionally include dix-config.h commit 9657e0e9def47dba5b0bfa7461874362712a07bb Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Aug 24 15:18:06 2005 +0000 Don't try to build dmx/input/lnx-*.c if <linux/keyboard.h> isn't found Don't try to build dmx/input/usb-*.c if <linux/input.h> isn't found Replace -rdynamic with $(LD_EXPORT_SYMBOLS_FLAG) for compatibility with compilers other than gcc commit 825a95a1fab69f84c99ae132888fced22e28be33 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 24 11:18:35 2005 +0000 Remove use of dix-config and xorg-config.h from public headers. commit 1fb4a5a4ea993a7913a7bcc362315d31b2907836 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Aug 24 09:12:50 2005 +0000 Add xcmiscproto and bigreqsproto to REQUIRED_MODULES, since Xext uses them. commit b47535bd661743946851099f226f9e6aa4cc8c90 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Aug 24 08:49:31 2005 +0000 programs/Xserver/GL/windows/glwrap.c Wrap PointParameteriNV & PointParameterivNV for Windows builds. commit 9f498a37dd3d8456d2a97be9c039b63abc81a5fe Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 23 20:58:29 2005 +0000 Display more friendly mouse protocol names. Enable mouse wheel mapping by default. commit cff4b1c2166aa2e75618c8df09554a602c3a68c5 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 23 20:12:26 2005 +0000 Check for getconfig in GETCONFIG_DIR if it's not found in module dir. commit bfd13645867aab831b7a0f2b1757cb80837c07d9 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 23 09:20:49 2005 +0000 Add missing saver, evie, video, trap proto pkg-config checks. (Georgi Georgiev) commit 27afac2ce6a77bc68669c1af6a61c589aa9ef384 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 23 08:59:30 2005 +0000 Fix test for Xnest presence. (Donnie Berkholz) commit fed61462be281c568df6407f94ea519748f0b720 Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Aug 23 08:58:40 2005 +0000 Fix up warning on debugging. commit e848eb289c9251742a88e76017603952394f4262 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 23 01:14:35 2005 +0000 Rename app-defaults entries from xf86cfg to xorgcfg to match name passed to XtAppInitialize. (Henry Zhao, Sun Microsystems) Also, display vendor version instead of 4.0 for server version. commit 6076fca82528da8d50b0ed6be8da6f811321474d Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 23 00:32:27 2005 +0000 User message cleanups/updates for modern configurations. commit b07602014061cb41540f6a7e74e4132e67aa1117 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Aug 22 21:47:59 2005 +0000 If MAKE_XKM_OUTPUT_DIR is defined, call trans_mkdir to create directory if it doesn't already exist. (ported from Solaris Xsun bug #5039004) When BuildLikeSun is set, define MAKE_XKM_OUTPUT_DIR and set the xkb output directory to /var/run/xkb. commit 4a19a33db6d04b5835830a665daa679ee2fcafe7 Author: Kevin E Martin <kem@kem.org> Date: Mon Aug 22 21:29:18 2005 +0000 bugzilla #2880 (https://bugs.freedesktop.org/show_bug.cgi?id=2880) attachment #2987 (https://bugs.freedesktop.org/attachment.cgi?id=2987) Use system method to access PCI config space for inb and inw in addition to inl (Olivier Baudron and Kevin Martin). commit 5557a40a022b0ede36edd3370a60f5fc3d147796 Author: Kevin E Martin <kem@kem.org> Date: Mon Aug 22 19:52:26 2005 +0000 Fix linking errors for xprint. commit 7693f668efd206a6c259166665bc36d3c6335e8d Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Aug 22 12:05:18 2005 +0000 programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c programs/Xserver/hw/xfree86/os-support/linux/Imakefile Add basic ACPI Linux support so that events can be passed to the driver. (Alan Hourihane) commit 02c834f198eab4c4686d8156b88508fe102099c1 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 22 09:15:31 2005 +0000 Include Xv and XvMC headers in the SDK. commit 3c4d605c7e8a9f6d296086a5b03b4f11b90590db Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Aug 22 09:15:20 2005 +0000 Fix linkage for Xnest, Xvfb, Xdmx and Xorg DDXes; include all libs. commit 79be1f6d4d1ab48841d31d5553dd36b1b3632650 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 21 19:29:55 2005 +0000 Fix inclusion order of dix-config.h, so _XSERVER64 gets defined before X.h or Xdefs.h get included. (Jürg Billeter) commit 8d6e743bc4e6854ee0bb0fa4f197acd6d7683ccd Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 21 19:23:17 2005 +0000 Add _XSERVER64 definition to config headers. commit 588105173840355717d7b2f7f652289a41166c3f Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 21 19:15:11 2005 +0000 Huge cleanup. Group into sections: hardware feature detection, extension detection/configuration, DDX options. Make building of Xorg DDX fully optional. Clarify and correct some help texts. Change all comments to use dnl instead of #. Quote all tests correctly, and guard pure-variable tests with 'x' (e.g. test $DMX = yes -> test "x$DMX" = xyes). Since the DDXes seem to have pretty divergent extension support these days, get rid of EXTENSION_LIBS, DMX_EXTENSIONS and XPRINT_EXTENSIONS, and go back to building extension lists by hand in the DDX-specific sections. Use portable POSIX constructs everywhere (e.g. test foo && test bar, instead of test foo -a bar). Clean up old cruft. Set _XSERVER64 on 64-bit architectures, and use x86_64 for host_cpu instead of amd64 (Jürg Billeter). commit 367f45073953f8f99a2d9dd054f479e1070f856e Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 21 08:43:46 2005 +0000 Change xorg_bus_sbus to xorg_bus_sparc; build sparcPci.c on all SPARCs. commit 71b3fea94e8845f35e47503636ca1fe78d2d48ca Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 21 08:24:52 2005 +0000 Typo fix (SOURCE -> SOURCES). commit db2909ce76b178663de301c09fb97f2936b1997e Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 21 06:56:19 2005 +0000 Add test for SPARC. Build SparcMulDiv.S on all SPARCs. Make the default font path configurable. commit d96e6666862553d59fc1f9fdd14fb65f36d589af Author: Adam Jackson <ajax@nwnk.net> Date: Sat Aug 20 18:52:07 2005 +0000 Add sparcPci.c to EXTRA_DIST. commit a402c876a465904ac71ebf39af67ea451b2457dc Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 20 18:11:17 2005 +0000 Make DRI/GLcore builds srcdir != builddir safe, and invoke symlink-mesa.sh in our builddir, not our srcdir. commit 238d45d2f148e1e0af4b1619cc1d5e8cc4bf9661 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 20 18:10:03 2005 +0000 Make Xprint build optional. commit abab3fd628c2d1096e8534192f33c1068a573c12 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 20 18:09:21 2005 +0000 Make Xext linkage srcdir != builddir safe. commit bb1d99ee72cc560e95010ea1008d5e796177ae62 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 20 18:07:59 2005 +0000 Build libxkbstubs.la to stub XKB DDX functions (e.g. VT switches), and build libxorggxkb.la from within the Xorg DDX to replace the previous xf86VT.o, et al, hacks. commit 8a32ed46480d78b69f289c90098f5ed4a830851f Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 19 15:48:18 2005 +0000 Really hopefully the last xorg-commit test. commit 2fd951434507d2a2c0266a052bdca6e223d31bfa Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 19 15:45:55 2005 +0000 Another test commit for xorg-commit. commit 39630b301f769118959b20d962404555714a5812 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 19 15:25:19 2005 +0000 Testing xorg-commit, nothing else. commit b13d3382de0027e897532926983b79caaa1eb655 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 19 15:21:54 2005 +0000 Fix dates on Søren's entries. commit 8ec79e05feacd61562b53ebf36a8b30967affc1e Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Aug 19 15:15:51 2005 +0000 Make symlink-mesa.sh call srcdir != objdir safe. Remove requirement for XF86Rush protocol headers, which we don't even use. commit 057a8709a116feb0fd0004141bbac20d2766f3db Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Aug 19 00:13:46 2005 +0000 More updates for Panoramix -> Xinerama rename commit bed3235d222fd6e2207f6c0d551c67d5a53322cd Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Aug 18 21:28:09 2005 +0000 Thu Aug 18 17:27:09 2005 Søren Sandmann <sandmann@redhat.com> Move fbmmx to a convenience library since the mmx flags may be harmful when applied to non-mmx code. commit a0366ddb8cb1c57b85a5806eb348abc19c7f92d6 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Aug 18 17:14:11 2005 +0000 Replace gnu-makeism with portable rules commit ea5c49cb17ac956d6dea6bf563e392e61c39da2b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Aug 18 01:40:33 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2901> Patch #2331 <https://bugs.freedesktop.org/attachment.cgi?id=2331> Lines ending in <backslash><space> break with cpp from gcc >= 3.3 (Peter Breitenlohner) commit 22694500e0dd8752b4c01e340f587ecba1ff7fb7 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Aug 17 23:20:27 2005 +0000 Add xf86Sbus.h to EXTRA_DIST files (bugzilla #4128) commit df938987d6c19fbdfff8d3334bb497f4814ae384 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Aug 17 19:03:18 2005 +0000 Add buildsystem for Xprint, and: Wed Aug 17 14:50:58 2005 Soren Sandmann <sandmann@redhat.com> Include <X11/extensions/Print{,str}.h> instead of "Print{,str}.h" Include <X11/fonts/fontstruct.h> isntead of "fonts/fontstruct.h" Wed Aug 17 14:54:49 2005 Søren Sandmann <sandmann@redhat.com> Conditionally compile in xprint.c Add Xprint commit f2f6820c3f01810a4da5a8bb4e43119ef2a3fcb6 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Aug 17 17:20:13 2005 +0000 Wed Aug 17 13:13:00 2005 Søren Sandmann <sandmann@redhat.com> Make asm labels local. Bug 4073, patch from Diego Pettenò. commit ad7f2fc67376f4fbfe81047273de12f7926f0b17 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Aug 16 16:21:09 2005 +0000 symlink.sh: Temporarily disable xkbdata, add type1mod.c Tue Aug 16 12:09:09 2005 Søren Sandmann <sandmann@redhat.com> Add ft and type1 modules. commit 24597a1ee2c567ec6bc2f2208457f2778937a034 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 16 00:40:25 2005 +0000 2005-08-15 Alan Coopersmith <alan.coopersmith@sun.co>m Convert sunPostKbdEvent to use xf86ProcessAction like xf86PostKbdEvent. commit b86282b764387ef8315fc4045d4e1ca1bb74fee1 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Aug 15 23:48:35 2005 +0000 Set ZAxisMapping default to "4 5 6 7". commit a6c8d0d71eef7cb964797f7595be36ee0ac10a1a Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Aug 15 19:42:48 2005 +0000 Mon Aug 15 15:41:26 2005 Søren Sandmann <sandmann@redhat.com> Link this module with libXext.la. Mon Aug 15 14:56:57 2005 Søren Sandmann <sandmann@redhat.com> Remove the xkb* files. Add xkbVT.o and friends as the last things on the link line so they will override the symbols in libxkb.a. Add a comment on how this situation might not be considered ideal. commit 46aede552aa43cd59f81980303826b5c3d889c02 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Aug 15 18:59:16 2005 +0000 Mon Aug 15 14:56:57 2005 Søren Sandmann <sandmann@redhat.com> Remove the xkb* files. Add xkbVT.o and friends as the last things on the link line so they will override the symbols in libxkb.a. Add a comment on how this situation might not be considered ideal. commit bcc95c83406a4498227ffd8384bc272fd8cdc49c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Aug 15 18:32:08 2005 +0000 Add AC_SYS_LARGEFILE to match flags used in monolith commit 809906a754a1289b7e88489241a2065aa0bf27a2 Author: Dave Airlie <airlied@linux.ie> Date: Mon Aug 15 08:24:45 2005 +0000 make mouse support work - note you need to change the evdev devices in the source.. hacky... commit fe5abff38e65c1a49886924efdf0242ab8048008 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Aug 15 07:30:05 2005 +0000 Egbert's 64bit fixes for mixed 32/64bit clients commit ebedc8bbb54b9b4e1814bc2758216af2bab93540 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Aug 14 19:46:55 2005 +0000 - Fix the exa pixmap offset/pitch alignment to deal with non-POT alignment requirements. MGA, notably, uses a multiple of 3 in some cases. - Rename the pixmap offset/pitch alignment fields to more clearly state their meaning. commit e3509c940fa1fc3988d23f884ca8bffc87d091e5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Aug 14 16:24:30 2005 +0000 Don't link libXext, as it is linked in to the server also. commit 05071ae0fb847c211b1f20770d3b57fc2172738c Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Aug 13 07:41:33 2005 +0000 Don't link in libx86emu.a as this a) fails badly on non-x86 systems, and b) is done via x86emu.c including all the source files anyway. commit 1ffe9ceb2f6a7261fb62c90dfea861f9dadd27ce Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Aug 13 06:15:35 2005 +0000 Oops, forgot a file in earlier Solaris kbd commit commit c29051f9d108fe49c23d9cf36fd08cc64c87262a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Aug 13 00:11:28 2005 +0000 Add LintTarget() Bugzilla #1068 <https://bugs.freedesktop.org/show_bug.cgi?id=1068> Port Solaris keyboard code to work with kbd driver. Also incorporated "audio bell" feature from Xsun keyboard DDX to play bell tones via /dev/audio (specified via Option "BellDevice" "/dev/audio" in keyboard device options). commit 616a65c4cc528278168db1414776f3a867cd463e Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Aug 12 18:50:33 2005 +0000 Fri Aug 12 14:49:24 2005 Søren Sandmann <sandmann@redhat.com> Apply another patch from Billy Biggs to fix precision issues. commit 1eed84f227311730ce1f9ffab190e95de967c7da Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Aug 12 18:47:17 2005 +0000 Fri Aug 12 14:45:54 2005 Søren Sandmann <sandmann@redhat.com> Fix up multiplications based on patch by Billy Biggs. Part of bug 3945. commit 8bfffb96b552a3facb77ff9e81658e80becbf2f4 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Aug 12 18:31:07 2005 +0000 Fri Aug 12 14:29:09 2005 Søren Sandmann <sandmann@redhat.com> Apply patch from Billy Biggs that fixes rounding problems with division. Part of bug 3945. commit 812ed2e17bfe8e232313cf9ab78000a564cb6b3c Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Aug 12 17:43:38 2005 +0000 Fri Aug 12 10:45:01 2005 S%Gï¿¿%@ren Sandmann <sandmann@redhat.com> Make this function compute the same results as the fbByteMul macro. commit 370b111f4882a95248bcc4727438c95a065c174d Author: Ian Romanick <idr@us.ibm.com> Date: Fri Aug 12 16:30:57 2005 +0000 Use '$(DRMSRCDIR)/shared-core' instead of '$(DRMSRCDIR)/shared' for DRM includes. This matches the way drivers are built in the Mesa tree and fixes a build problem in the Savage driver. Convert uses of __glPointParameterfvARB_size to __glPointParameterfvEXT_size and uses of __glPointParameteriv_size to __glPointParameterivNV_size. This eliminates the need to hand-edit indirect_size.c after it is generated. commit 5f5117729de3a8a4eb6e17dc0979e4b1c1ef9918 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Aug 12 01:17:58 2005 +0000 Fix segfault when "kbd" fails to load and "keyboard" driver is not configured. commit 13e16ee93a328a55494c2933143c66559fe7ba98 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Aug 11 15:46:42 2005 +0000 Thu Aug 11 11:43:32 2005 Søren Sandmann <sandmann@redhat.com> Make sure we don't crash on glyphs with NULL bits. Bug 659. commit 3e471ddf1dbf58ed021d6f31bdaf438872f03ca8 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Aug 11 14:36:29 2005 +0000 Add check for whether the platform is MMX capable and add the relevant flags if so. commit 130fffc0cdbfdc29f33f1ee97c09e744c19e243a Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Aug 10 20:22:57 2005 +0000 Wed Aug 10 16:17:38 2005 Søren Sandmann <sandmann@redhat.com> Add back non-SSE implementations. Define USE_SSE if the CPU is amd64/x86-64 commit ef50bba5694ef276a239882fae3502638b4ec784 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Aug 10 19:42:36 2005 +0000 Revert previous patch as it causes build failures commit b99360e264c9531593ce8eb67bd006275ca5e5a0 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Aug 10 19:15:44 2005 +0000 Add XF86DDXACTIONS to AM_CFLAGS commit 73a335a926e50afde36816ab47dae689202df319 Author: Jon Smirl <jonsmirl@yahoo.com> Date: Tue Aug 9 16:51:05 2005 +0000 Point xegl at the DRI driver commit 29d0ba9f06d90a1c7f619db87d681ca53fa1bf38 Author: Jon Smirl <jonsmirl@yahoo.com> Date: Tue Aug 9 15:58:20 2005 +0000 Touchup xgl for modular tree commit 435e2a09de7c9dd843b05f4a0484371a67940515 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 9 01:18:04 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=3950> Xorg prints version numbers in wrong format for modules compiled for Xorg 6.99 & later (Adam Jackson & Alan Coopersmith) commit 5849c69db80b2320bddb7fafb519300cc0435c84 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Aug 8 18:02:08 2005 +0000 Mon Aug 8 13:39:45 2005 Søren Sandmann <sandmann@redhat.com> Conditionally include xorg-config.h commit 5e6e5e6d8c6add3aac5c3aebc984d3afb842edc1 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Aug 8 17:38:37 2005 +0000 Mon Aug 8 13:36:23 2005 Søren Sandmann <sandmann@redhat.com> #undef PIXPRIV here. commit a11ce76b0625501a202fa34e18777b7bd42b2713 Author: Keith Packard <keithp@keithp.com> Date: Mon Aug 8 06:25:21 2005 +0000 Build with modular X.org libraries and headers. composite/compwindow.c Don't damage unmoved windows. Let border clip reset leave damage alone, pending actual damage for painting. commit 129e812c339879b68bb162331ac9b7e0f86a7474 Author: Keith Packard <keithp@keithp.com> Date: Mon Aug 8 02:30:31 2005 +0000 Re-add _XOPEN_SOURCE as it's needed *sometimes*. Place it in #ifndef to avoid whinging. commit 4dfc3357a78a52ef70750608138dfeef0371cbc4 Author: Keith Packard <keithp@keithp.com> Date: Mon Aug 8 00:38:41 2005 +0000 Add autogenerated source files and other various non-CVS material to .cvsignore files Use XORG_CFLAGS. Ensure that all exa files are in SOURCES remove _XOPEN_SOURCE as it's always in xtrans.pc these days and gcc whines libdamage.la needs libcw.la when COMPOSITE is defined, but that libdamage.la must be after libcomposite.la, so add libcw.la to DAMAGE_LIB instead of EXTENSION_LIBS. Regularize library link order across all X servers commit 7d2b08aa4786eb4d181c88f7dc6b7eb059cc9dad Author: Adam Jackson <ajax@nwnk.net> Date: Sun Aug 7 20:42:50 2005 +0000 Invert the sense of the composite configure flag to match reality. commit fcaa6f30c489578589af19ef798ab31150e696a2 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Aug 7 19:02:32 2005 +0000 Bug #3989: Fix Composite builds, enable Composite build by default. (Olli Helenius) commit 3639fb243450ae447e9901de9f909e975a919514 Author: Chris Lee <clee@c133.org> Date: Sat Aug 6 23:56:18 2005 +0000 Enabling EXA by default in the modular build. commit a16357ebc9344fbf3e393da9e7b28164ad5b9dc8 Author: Chris Lee <clee@c133.org> Date: Sat Aug 6 23:46:38 2005 +0000 Last bits of changes to make exa build properly in the modular server. commit cc67bd187f06bfade0d2fe1b4cca92805458b210 Author: Chris Lee <clee@c133.org> Date: Sat Aug 6 23:34:09 2005 +0000 EXA support in the modular build. commit 33326f4ee884aa677e4568c3eaed4311a8ed0f2a Author: Chris Lee <clee@c133.org> Date: Sat Aug 6 23:27:33 2005 +0000 Adding exa support to the modular server. commit b90a88e80310e5650e2abed4c151889d9c0bd316 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Aug 6 19:48:12 2005 +0000 Add checks for functions used in os/access.c & os/connection.c: getdtablesize(), getifaddrs(), getpeereid(), getpeerucred() commit 2304c14fe5d3796c557a86d0ece1f0fb92591469 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Aug 6 19:14:24 2005 +0000 Fix endian test to work on big-endian platforms correctly commit fc29d014aa586229cdc976aa1bfe38bd949f7cde Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Aug 6 16:29:20 2005 +0000 Merge in patch release RC handling code from 6.8.2 (Kevin Martin) commit 9828a38ed695fed9788ace8bba575e521fa354b7 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Aug 6 03:14:50 2005 +0000 Solaris build fixes needed for modular builds commit f51047c0b6749ae8f04925eb62706b4743328383 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Aug 5 15:43:31 2005 +0000 Fix 32-bit vs. 64-bit test for Solaris commit 4220a0c4ccd0672460d31db239829384aee69f9a Author: Matthew Allum <breakfast@10.am> Date: Fri Aug 5 09:08:32 2005 +0000 Make Xephyr work without shadow fb commit fedbce2186bbe3bd8d23a4d74c35f10286930a7d Author: Adam Jackson <ajax@nwnk.net> Date: Fri Aug 5 00:13:31 2005 +0000 EXTRA_DIST hacks to get all the OS support files into the tarball. commit 39a80312e0c6e9f3b260d2f8279c71aef0a60d12 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Aug 4 22:31:20 2005 +0000 - Bug #3960: Add remaining GLX and pci.ids stuff to DIST (Cha Young-Ho, Olli Helenius) - Fix some distcheck problems for non-solaris systems - Change server version number from the Xorg rev to an independent one - _POSIX_SOURCE and _XOPEN_SOURCE defined to the right values commit ed4d77a16a226a7bc88d0d4f5c595d16cdf46360 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Aug 4 21:05:12 2005 +0000 Thu Aug 4 16:08:00 2005 Søren Sandmann <sandmann@redhat.com> Make the fbCompose paths use the existing inline functions instead of macros. Various other cleanups. Remove macro definitions, move typedef to fbmmx.c commit e62be6d2721e7f43c7bba6b8da4e5ec8c364697d Author: Adam Jackson <ajax@nwnk.net> Date: Thu Aug 4 18:45:46 2005 +0000 - Check for vsnprintf - Don't build the Xorg DDX on darwin - Workaround for gcc defining __ppc__ but not __powerpc__ commit 13bec87f45509452c643e20745e12878584d606a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Aug 4 02:39:56 2005 +0000 Fix inline assembly versions of in*/out* for Sun compilers Add check for ancient USL console code on Solaris to allow building on old Solaris x86 versions commit 9802106864a6b2c24df8e9fcb3c3471033abd5c6 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Aug 3 01:41:34 2005 +0000 dist fixes for cw and GL (Donnie Berkholz, me) commit d7c246f35b1ba7ecbbc086dd1229b298faddec96 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 2 23:57:52 2005 +0000 Only build ix86Pci.c on x86 & amd64 platforms Set DEFAULT_INT10 to x86emu on everything but Linux/x86 Fix Sbus.c inclusion on sparc platforms commit 3d0d95004c65cd3a29c94fec99e13ab7fdc19c7c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 2 20:47:47 2005 +0000 Add check for walkcontext() to enable stack trace dumper on Solaris commit bb5258a21d9efbb7d8b4226a44bd5738eb46d32a Author: Keith Packard <keithp@keithp.com> Date: Tue Aug 2 17:57:36 2005 +0000 Mark generated files as BUILT_SOURCES and CLEANFILES to ensure they are regenerated after 'make clean' and to make parallel builds work right. commit 0c608a690e85064345d7ebdf6b03e2f3bd861708 Author: Keith Packard <keithp@keithp.com> Date: Tue Aug 2 06:48:20 2005 +0000 Note yacc and lex generated files as BUILT_SOURCES so they are created before anything is compiled; required for parallel builds commit d31de217e6e9bfb0e1cc99141d80def9382de9a9 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Aug 2 03:36:09 2005 +0000 distcheck fixes commit c83772fef7ea0379db9bab1120f064b80b74f377 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 2 01:50:48 2005 +0000 Set OSNAME for "Build Operating System" line in Xorg log commit 005a9cf1f5fe688f303b954870afd35635fc33bf Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Aug 2 01:03:25 2005 +0000 Fix Solaris assembly source to work with libtool commit 48b130285ad1309a1ff5b2148b3bae5f5b642488 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Aug 2 00:47:08 2005 +0000 Move AM_CONDITIONAL for ia64 to global scope commit 03379474e0fd9c21ac058e2319618934359b3262 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Aug 2 00:45:30 2005 +0000 only do the AS_HELP_STRING workaround once, d'oh commit 2d7b1893befb84850f3221cbe70b3bce4e621d63 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Aug 2 00:41:07 2005 +0000 - Workaround for AS_HELP_STRING compatibility with older autoconf. - New intermediate build target for Xorg server - ia64 fixes commit 7c84189ea1dc236bc979bb4bf158ecb1a6b45137 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Aug 1 22:22:16 2005 +0000 Bugzilla #3566 <https://bugs.freedesktop.org/show_bug.cgi?id=3566> Patch #2906 <https://bugs.freedesktop.org/attachment.cgi?id=2906> Fix for RENDER, repeating pictures and offscreen memory (Owen Taylor) commit 2acd29c93fd3b3d438887f0ca9be6713db81c1e8 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Aug 1 22:13:20 2005 +0000 Bump autoconf dependency to 2.57 from 2.53. Add 2.57 compatibility hack for the new AS_HELP_STRING syntax from 2.58+. commit b7a43fa0f112d92cce71642142e07276da4de681 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Aug 1 19:00:21 2005 +0000 Bug #3739: Fail soft on unknown extension string. commit 0285804811bd24ad7de8894f8188b87e821e54cc Author: Adam Jackson <ajax@nwnk.net> Date: Mon Aug 1 18:41:54 2005 +0000 GLX fix for loadable servers: indirect_size.c goes in libglx, not libGLcore commit 78d51253e229bcb428039911d80a5d89d4bf4491 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Aug 1 16:07:14 2005 +0000 Fri Jul 29 17:20:53 2005 Søren Sandmann <sandmann@redhat.com> Fix rounding bug. commit fd84b3b56280ef88a8c848c4338f0bea906ce6d8 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jul 30 18:56:32 2005 +0000 Clear compiler warnings. (Stefan Dirsch) commit 9e9f9cb4878d597b3fa6de7732d2866e24c32f54 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Jul 29 21:55:57 2005 +0000 Need to define SVR4 on SVR4-ish systems since many headers and source files check for it, expecting Imake to have defined it already. (Should be replaced with more specific checks & defines, but there's too many to get them all right now.) commit 14ade55b83aa72240a555b3b9def9f40a6a38cd9 Author: Kevin E Martin <kem@kem.org> Date: Fri Jul 29 21:22:58 2005 +0000 Various changes preparing packages for RC0: - Verify and update package version numbers as needed - Implement versioning scheme - Change bug address to point to bugzilla bug entry form - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to reenable it) - Fix makedepend to use pkgconfig and pass distcheck - Update build script to build macros first - Update modular Xorg version commit 2654f88cee86fae9db169dc8668492857fbbad98 Author: Kevin E Martin <kem@kem.org> Date: Fri Jul 29 18:40:54 2005 +0000 Fix code to handle printing 7.0 release candidates properly. commit d5d669b04ecbd91bb2db9ddc6238acabbeaabbe0 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 28 23:33:57 2005 +0000 If neither --enable-dmx or --disable-dmx are specified, default to "yes" on Linux, "no" on everything else (matches defaults in monolith Imake) commit 86529c07d6ff69ef936ee370be07b373e2961360 Author: Kevin E Martin <kem@kem.org> Date: Thu Jul 28 23:28:34 2005 +0000 Fix distcheck for server commit 3e4bf8a8f46e14078c64c56ad303c80cd9d8d5be Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 28 02:38:23 2005 +0000 Rework wrapping of common mouse driver to not require mousePriv.h, so that modular tree xserver can be built on Solaris. Wrap more ioctls in SYSCALL() to restart on signals. commit cfd6c74067de7fdb2aeddee6780c29231a56acdc Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Jul 27 17:50:13 2005 +0000 Add dbestruct.h to sdk_HEADERS commit 5ced854186b851ba2c9ac84eb6d7f141fdee487b Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Jul 27 17:35:25 2005 +0000 Add miwideline.h mistruct.h mifpoly.h to sdk_HEADERS commit 7bd6b0640e69552ed4c9daac26e41410dd7338b4 Author: Kevin E Martin <kem@kem.org> Date: Wed Jul 27 08:16:35 2005 +0000 Add #include <dmx-config.h> for building dmx/glxProxy in the modular tree. commit b9ccd89918e1c79d6013fe563c7fa933c1274837 Author: Kevin E Martin <kem@kem.org> Date: Wed Jul 27 08:11:26 2005 +0000 Fix dmx/glxProxy build commit 8f6664fcff319ee155e7864ce25fa11c1fa5594b Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Jul 26 23:40:45 2005 +0000 Add these files to the sdk: cbf32.h cfb16.h cfbmap.h cfbunmap.h cfbunmap.h cfbmskbits.h xf86sbusBus.h mifillarch.h mispans.h commit 3cbb55f309b8eaba246d1d948b59883f9ed28bf4 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Jul 26 22:17:27 2005 +0000 Install xorgVersion.h commit df5d47560c19b01f2998806c4b62f459a6b5fc02 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Jul 26 18:56:45 2005 +0000 xserver/xorg/fb/Makefile.am: install fboverlay.h commit b25e6f82a1189a67208a2a4980d732ab77e64a35 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Jul 26 18:21:22 2005 +0000 fb/Makefile.am: add fbpseudocolor.h to sdk_HEADERS hw/xfree86/xaa/Makefile.am: add xaaWrapper.h to sdk_HEADERS commit e7502158d6922a149d0aaf1de209f0b58fa444bf Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Jul 24 16:24:17 2005 +0000 Add xf86DeallocateGARTMemory stub so that Xorg can be built on Solaris again. commit 7c1148c0fbc00716bb7ec621a1b968b4127cbb00 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 23 19:32:57 2005 +0000 Fire the Mesa symlink script from the configure stage. commit f331a325447449982efba8adc5bc079371dfb77a Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 23 19:29:58 2005 +0000 Add the symlink script for the Mesa source. commit a5532e456d763718036e84891ff57c6f7417615a Author: Stuart R. Anderson <anderson@netsweng.com> Date: Sat Jul 23 18:16:06 2005 +0000 Change the default depth back to 8 like it was originally. Disable the addition of depth 12 & 30. It causes more than MAXFORMATS depths to be added to the screen which causes an array in the Screen structure to overflow and crash on server reset. commit d8a1241a24d75c258548875350bff4d0acc795ab Author: Stuart R. Anderson <anderson@netsweng.com> Date: Sat Jul 23 17:49:45 2005 +0000 Add a safety check to catch when numDepths GCperDepthexceeps MAXFORMATS commit 93d29b4554d26b22ca43311264f85ea8e14804c2 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 23 02:04:39 2005 +0000 Emit makefiles for glapi, slang, and grammar. Conditionally define GLX_LIBS if GLX support is requested. Add GLX_LIBS to the link deps for Xvfb and Xnest. All GLX support should work now for the vfb, xnest, and xfree86 DDXes. commit 525d663ec5a8a181a1e36f3787b24cdb77290c17 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 23 02:02:18 2005 +0000 glapi build (forgot this one somehow) commit 6aaceef3231818682dccf1969b211f1dc798da1f Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 23 02:00:52 2005 +0000 Fix the build system to reflect the rest of the Mesa core. Almost links, needs a code fix to Mesa though. commit d7e2cadb13ef0e77d864c8282489f544b0e1dede Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jul 21 02:29:05 2005 +0000 GLX needs gl.h from Mesa too commit bf32f4739c6ef7f41cde6cc409d42e00462402fb Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Jul 19 20:51:46 2005 +0000 programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h //bugs.freedesktop.org/show_bug.cgi?id=3164> Add xf86DeallocateGARTMemory() function call (Austin Yuan) commit 931abdba8410bf1188d69d54c57543a21ea36968 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Jul 19 02:50:00 2005 +0000 Change #include "X.h" to <X11/X.h> commit 4f2e731aba0c5694abb65a877395cc5f9869c556 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 17 07:34:31 2005 +0000 objdir != srcdir fixes. commit a6bd7ad985e138874bb0e1f33f545651dfde32a9 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Jul 17 01:52:33 2005 +0000 Set GLX automake conditional after we've tested for mesa source and set GLX to "no" if it's --with-mesa-source wasn't set. commit ead37b08699f665a856c7ba29578c27c27db4100 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jul 16 20:52:25 2005 +0000 Mark variables modified in signal handlers as volatile (part of Sun bug id 4496504) commit bbb49449cbc0815fd9c4faf9b6ee32be99a8aa3d Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 16 16:30:40 2005 +0000 Fix --with-mesa-source parsing, and turn GLX off if no path to Mesa given. commit d69e9872ae91c9c17a33e1ed763f98453d950b39 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 16 16:29:30 2005 +0000 Typo fix, and re-add GLcore to the dixmods build commit 8bc883c48c8f99502707998a8257c0563cae7d3a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jul 16 09:00:44 2005 +0000 Update build instructions. Add details about how the expat, fontconfig, libpng, freetype, and xterm builds are now handled. Update text docs from SGML masters. commit 8e600b87643f7f4e19923dd6a0f2eec83303363a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jul 16 07:39:48 2005 +0000 Only pass -rdynamic when using gcc commit 4f04e26c69747929243f176feaa90f3042481f53 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 16 04:30:33 2005 +0000 Say --with-mesa-source to get GLcore built. commit 4913316f25e76381844cf15aa64eff620c2807a1 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 16 04:29:28 2005 +0000 Switch to MESA_SOURCE which we're already AC_SUBSTing commit 7facb209a705ca406b05272c233ea0cfd6a5b266 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 16 04:24:21 2005 +0000 Hook in the GLcore build commit 2f9a7c6ee1012b2c7664c53f405affaf82bd0953 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 16 04:13:33 2005 +0000 Hey look, GLcore links commit 5f81eb1d89f623dd9281e686a4d4d4f403e459c6 Author: Kevin E Martin <kem@kem.org> Date: Sat Jul 16 03:49:59 2005 +0000 Fix the *-config.h includes so that it is possible to build modules without having to use -include in the Makefile. commit 0635acab08bade9bfd9d2abd3ea5a3fe525bc647 Author: Kevin E Martin <kem@kem.org> Date: Sat Jul 16 03:46:01 2005 +0000 Add record module building support Change module building to not use -include Fix xnest, dmx and vfb builds to -DXFree86Server for fbcmap compilation commit 92b23ff426936909e1ff5e063b75e5f112b93ca1 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jul 16 01:17:52 2005 +0000 Update to match recent changes to pci.ids & extrapci.ids for people building on systems without perl. commit 6ce3743948a7151c721194594091a7e1183e2f32 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 16 00:51:14 2005 +0000 start the GLcore build system commit 2f0487521da3da6784dd964c915071b82d749108 Author: Kevin E Martin <kem@kem.org> Date: Fri Jul 15 23:08:31 2005 +0000 Fix the *-config.h includes for the files that have moved in the modular tree. commit a407fa373bb72f29050e3f027042011075b3bdf0 Author: Kevin E Martin <kem@kem.org> Date: Fri Jul 15 22:51:05 2005 +0000 Move drm up to os-support since the files are shared by multiple platforms. Fix the dri and drm build. Fix server-side DMX extension build. Make xf4bpp use the correct version of mfbline.c for mfbseg.c. Add #ifndef _HEADERNAME_H_/#define _HEADERNAME_H_/.../#endif to the headers. commit eb6fa0dc15516a0a436090efc6d85f22baeec015 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jul 15 22:14:28 2005 +0000 Enable GLX build by default commit 0e352a8b2b4c78c291074b9531ed7afa7a20ac17 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jul 15 21:59:39 2005 +0000 disable GLcore momentarily until a build system exists. --enable-glx should work now. commit 4bf453086418e93e81b24d3d2a0f49a9357acff3 Author: Kevin E Martin <kem@kem.org> Date: Fri Jul 15 05:48:29 2005 +0000 Fix keyboard state when XEVIE is not enabled (Keith Packard). commit 562acf2e69dcf08f8db8f8eeaa162949d45f70b2 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Jul 14 23:41:15 2005 +0000 Add -I$(top_builddir)/hw/xfree86/dixmods/extmod to Xext/Makefile.am Patch from Stefan Dirsch commit defeb56fc9559661fa632935a4c76c500c7edcf4 Author: Kevin E Martin <kem@kem.org> Date: Thu Jul 14 22:20:16 2005 +0000 Fix the build when DRI is enabled commit 6b546d0ec07e493b501e82300b3e6c143cd4d0ac Author: Kevin E Martin <kem@kem.org> Date: Thu Jul 14 03:36:44 2005 +0000 Add #include <xnest-config.h> to the Xnest source files for modularization. commit 7375f4d13626bbba4204e2f08f41c212b2eed992 Author: Kevin E Martin <kem@kem.org> Date: Thu Jul 14 03:32:09 2005 +0000 Add support for Xnest commit c582560c62fd8181b7521e470f118a59c418a95f Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 14 02:59:34 2005 +0000 Add partial in*/out* assembly support for Sun compilers on x86 commit 64bf3a81a3212dc2c0f55aebdc74a618ca6a32c0 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jul 14 02:53:31 2005 +0000 loadable extmod build system. commit 6c96e0c9e4b3f1e8dfa5dcf7366bb838dc0724ec Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jul 14 01:36:58 2005 +0000 loader support for extmod commit 8ea4a1b759eae0279ce619c663f2cd2f6dee8d71 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 14 01:00:39 2005 +0000 First pass at Solaris os-support commit f07e905553783dc0133015bcbf94d3b6be68b19c Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Jul 14 00:28:47 2005 +0000 - Add build system for xf86-video-ati - Add build system for xserver/xorg/hw/xfree86/dri - Add glcore.h to symlink.sh - Symlink.sh: add some more DRI files, symlink glcore.h from extras/Mesa/include/GL/internal to proto/GL - proto/GL/Makefile.am: install glcore.h - xf86-video-ark: s/module-dir/xorg-module-dir/ commit 939b7720f17ec5ac5edcc6cfe70453160ecb0161 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 14 00:02:05 2005 +0000 Merge SVR4/pre-Solaris 8 and Solaris 8+ sections for greater consistency, easier maintenance, and to fix some missing headers when building the modular Xorg on Solaris. commit 23d25a656d7fdbafa1c78be2950fb405f0a1b87b Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jul 13 23:41:21 2005 +0000 Remove references to DDX-specific extensions commit f4626bb72b9955846abee018ae31c1aeb51b8dbf Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jul 13 22:59:39 2005 +0000 dlloader is the default in 6.9, but the loader doesn't get told to prefer dlloader modules unless you -DDLOPEN_HACK. commit 4f38526566dbcc296d124bb852adfa30ac4d927e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Jul 13 22:54:02 2005 +0000 - Use fbdevhwstub.c if <linux/fb.h> is not found - Use x86emu on Solaris instead of vm86 - Better per-OS control over which xf86Kbd*.c and *Pci.c files to build - Set various #defines to be defined or not on Solaris as needed commit db8aa17f15f62f243400b0267bf281dd27738644 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jul 13 22:19:36 2005 +0000 updated comment for libbitmap commit 4f9e76ed6a61b414ffc94550727a138c3f73996f Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jul 13 22:09:52 2005 +0000 Dear libtool: Loadable modules do not need version numbers. kthnxbye. commit 40ad7321f5d8d216523d575c4414736d8cfe9e88 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jul 13 21:52:51 2005 +0000 Generate useful loadable modules by actually linking in the blobs from the DIX commit 0e08818d3951c324e5953bd23a8a9457b3fec78f Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jul 13 21:41:02 2005 +0000 Hook dbe into the build commit 2d4ddb5606b7328c591a7bffafbb49bdaf2adcf9 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Jul 13 21:36:27 2005 +0000 double-buffering extension commit c2ec9fbb15c776b9c64451cf32927b1b8d1c560c Author: Kevin E Martin <kem@kem.org> Date: Wed Jul 13 21:17:53 2005 +0000 Only build Xi/stubs.c on DDXs that don't support the Xinput extension commit 74a534f63c1ed016f24dbc3ca31f05b81076e8f0 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Jul 13 20:19:38 2005 +0000 xc/programs/Xserver/hw/xfree86/drivers/i2c/*.c: include xorg-config.h instead of config.h xserver/xorg/hw/xfree86/i2c/Makefile.am: Add i2c drivers commit 1dc3e96e4077a912dd3aa13fa80099f5864b641f Author: Torrey Lyons <torrey@mrcla.com> Date: Wed Jul 13 16:30:53 2005 +0000 Fix compilation where uint is not defined. commit 19e20c1470c1f8d15f2a78fb29545bde06a65516 Author: Lars Knoll <lars@trolltech.com> Date: Wed Jul 13 08:58:37 2005 +0000 don't clobber %ebx in the assembler. commit bfb10bd2dcca65ba5d346c9d7da594a81c35c101 Author: Lars Knoll <lars@trolltech.com> Date: Wed Jul 13 07:28:17 2005 +0000 Fix potential buffer overflow and a smaller bug in the convolution filter commit 778a2703b233641e298fa81ef9c477943c496305 Author: Lars Knoll <lars@trolltech.com> Date: Wed Jul 13 07:12:33 2005 +0000 fix compilation commit 66bc36473c238fdee7e6c1d31e6e5f6813a7541a Author: Daniel Stone <daniel@fooishbar.org> Date: Tue Jul 12 23:36:27 2005 +0000 Use builddir, not srcdir, for built files. commit d6808a48d2dffd72f618fa372fba993736638799 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Jul 12 18:16:03 2005 +0000 Fix scanpci -v core dump when subsys vendor/device id's are NOVENDOR & NODEVICE. Bug #3763 <https://bugs.freedesktop.org/show_bug.cgi?id=3763> Patch #3074 <https://bugs.freedesktop.org/attachment.cgi?id=3074> commit cda9c7b2678ea08ac6176a9eee72e6e511134b8e Author: Lars Knoll <lars@trolltech.com> Date: Tue Jul 12 14:50:10 2005 +0000 add x86emu. commit 41002623f314444bd416fd5f445a0425c5b59df0 Author: Lars Knoll <lars@trolltech.com> Date: Tue Jul 12 10:02:10 2005 +0000 Add MMX Code paths for the basic composition operations in fbComposeGeneral. commit 697cf74fb50a550b8f7e124dc8f463a55519795f Author: Keith Packard <keithp@keithp.com> Date: Tue Jul 12 03:09:20 2005 +0000 Make Xprt run when linked against Xlib for Xrm commit 419448ea7b0d7f672e568cb1d8b4e190a1f54825 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Jul 12 03:03:16 2005 +0000 Pull libdri out of the build for now until I get something better worked out commit f054bf2ff6b94e285e7f2d174163c01b07b07143 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Jul 12 01:29:41 2005 +0000 build fix commit 02427d4d04f70109a499578c6762654463ebdae4 Author: Kevin E Martin <kem@kem.org> Date: Tue Jul 12 01:20:36 2005 +0000 Add support for building Xdmx and Xvfb commit 3fe6b5bb30e8e1b9017a9cf818fcceb279a28e65 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Jul 12 01:17:39 2005 +0000 GLX server support commit 377e3bddd4d73154520a9582d75de2b20ae532a5 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Jul 12 00:55:43 2005 +0000 Forgot to add these for some reason commit e348ac4b4dfb1112c19fe5fe5441182e66716087 Author: Kevin E Martin <kem@kem.org> Date: Tue Jul 12 00:52:48 2005 +0000 Prepare Xdmx and Xvfb for modularization by adding appropriate #include <{dix,dmx}-config.h> to the source files. commit b7a9a6a03560bdf6584c71bf0b546301bba9ab89 Author: Kevin E Martin <kem@kem.org> Date: Mon Jul 11 17:52:00 2005 +0000 Remove unneeded xf86drm.h includes to fix modular build. commit cf4dfd650dbc2bb65eae4eea2acfb4a4c5295548 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jul 11 02:29:50 2005 +0000 Prep for modular builds by adding guarded #include "config.h" everywhere. commit c5548086f3864c828f0cad65d2708cefd2025947 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jul 11 00:42:52 2005 +0000 Start filling in glx build. Add xf86Version.h and a few DRI headers to the sdk (needed for modular driver builds). commit 955fe17133d841758a18072a9acabedc81dc4562 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Jul 10 21:45:55 2005 +0000 add some convenience variables for the drivers commit 78fab90230c61241af29f0c94f401ce0bc749b6b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jul 9 16:51:58 2005 +0000 Bug #3740 <https://bugs.freedesktop.org/show_bug.cgi?id=3740> Patch #3058 <https://bugs.freedesktop.org/attachment.cgi?id=3058> 08-Jul-2005 nv driver updates from Mark Vojkovich: Change some console restore code for NV11. Hopefully, we can more reliably restore the console for desktop systems using DVI. This may correct a recent regression on NV11. Also, new PCI IDs. Add new nVidia PCI ids to match nv_driver.c changes. commit 3c92389185f0c9fa3b8c299a084b10c12bcab52c Author: Zack Rusin <zack@kde.org> Date: Sat Jul 9 14:15:35 2005 +0000 Patch from Thomas Winischhofer to kick out all pixmaps to system ram upon a VT switch and vice versa when returning. commit 327741486e807c068383a771c04c9042b0589c37 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 9 02:22:29 2005 +0000 Don't try to link fb, shadow, or vgahw into the loadable Xorg server, as they're only supposed to be loadable modules. commit 2b8e4db9ac4b4c8f8fd73c00436d6abec2faa535 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jul 8 20:27:30 2005 +0000 -lXfont isn't enough for libbitmap, you need to get the -L from pkg-config commit e84648df7d7eb700b7c2d35fdef0be1f463853fa Author: Zack Rusin <zack@kde.org> Date: Fri Jul 8 17:07:52 2005 +0000 mark drawable as dirty on copying/painting windows commit 4ab73a73f4aa1f02cc8dada185b5dcbddfe43878 Author: Zack Rusin <zack@kde.org> Date: Fri Jul 8 07:43:00 2005 +0000 heh, oops (thanks Thomas) commit 0a28516a6e641b41e674f69fc228b0babbe1743b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 7 19:07:28 2005 +0000 More compiler warning fixes for missing prototypes: Add prototype for XkbSetExtension() Add #include <ctype.h> for isspace() & isdigit() Add #include <grp.h> (for initgroups()) and remove extra * Add prototype for xorgGetVersion() commit 2c3c4060fd2a52f147eda01b11222c341c6e3dee Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 7 16:18:52 2005 +0000 Bug #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> Add prototype for XdmAuthenticationInit() (Peter Breitenlohner) commit d0dc574adb79ffacf90b786d4ccfcd1cd8598728 Author: Zack Rusin <zack@kde.org> Date: Thu Jul 7 15:05:02 2005 +0000 Check vtSema before accelerating primitives and sync in fallbacks only if we got vtSema commit 6cba5f1260c20b3bc072fdcc5f3e49fa28ba6414 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 7 14:59:48 2005 +0000 Bug #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> Patch #2332 <https://bugs.freedesktop.org/attachment.cgi?id=2332> This patch avoids 79 gcc-3.4.3 warnings 'xxx' declared `static' but never defined mostly due to including "ftfuncs.h" with the declaration of static functions defined in "ftfuncs.c". (Peter Breitenlohner) commit 7da3f4a786d9b61f4129c7dbbef80c84abbfde68 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 7 03:12:40 2005 +0000 Bug #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> Fix warnings about redefined macros (Peter Breitenlohner) commit f86562540d1c945bfd96d4b89259d81e4ed25255 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jul 7 02:47:06 2005 +0000 Bug #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> Patch #2325 <https://bugs.freedesktop.org/attachment.cgi?id=2325> Avoid 38 gcc-3.4.2 warnings: suggest parentheses around assignment used as truth value suggest explicit braces to avoid ambiguous `else' suggest parentheses around && within || suggest parentheses around arithmetic in operand of ^ "/*" within comment (Peter Breitenlohner) Bug #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> Patch #2326 <https://bugs.freedesktop.org/attachment.cgi?id=2326> This patch removes these 2 gcc-3.4.3 warnings: missing braces around initializer implicit declaration of function `XpOidTrayMediumListHasTray' (Peter Breitenlohner) commit 4047191124c237518110e698bde6dab445644449 Author: Damien Ciabrini <braun@club-internet.fr> Date: Wed Jul 6 15:34:22 2005 +0000 Added hardware support for transformation matrix (zoom, rotation, etc...). Fixed the composition function for RGB and A8 format. Avoid syncing hardware after HW fills or copies. commit 4073f24c90d4aff3f7d83af4c0e733eed082b53b Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Jul 6 15:14:30 2005 +0000 add missing PictureTransformPoint3d call commit c48f631cdb6a279ab1a24a486b05956cfa9ca3da Author: Damien Ciabrini <braun@club-internet.fr> Date: Wed Jul 6 13:57:41 2005 +0000 Fix offset alignment code in the offscreen memory allocator to prevent textures from being allocated in the next free memory area. commit baa99be190c51b533bf8748c6c6a9bce62594e96 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jul 6 07:16:19 2005 +0000 Put the correct value in the length field of the reply. Previously, the number of tag/date pairs was specified. This was incorrect. The correct value is the number of values (one for the tag and one for the value). Xorg bug: #3210 commit 6ba4a2e78a73858648b5b6a39306446d519c3a75 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 5 23:01:51 2005 +0000 Add more defines for XWin DDX Make building of cfb*, afb and mfb conditional Set FD_SETSIZE=256 on cygwin commit 71ed3ae0c696152e82a98ce2ac0fa67ce6f23464 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 5 22:58:29 2005 +0000 wrap fInternalWM with XWIN_MULTIWINDOWEXTWM commit 456844a613240ce56181f6f3ec7873be9b2dc85d Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Jul 5 18:42:32 2005 +0000 Remove Speedo font module documentation. Remove Speedo from list of font directories Update default font path to remove Speedo, add TTF. commit 20c15003f9648de0c03f7d4fa4508afd896b19f5 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 5 18:25:44 2005 +0000 Fix crash on server shutdown commit d72fef26d44e649f39a56730830148d48d77ee9e Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 5 17:52:35 2005 +0000 Fix simultanious presses of Left and Right Control and Shift keys. https://bugs.freedesktop.org/show_bug.cgi?id=3677 commit 0f2c8221c938ce8eebd9f0e111a6b87223c18f9e Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 5 16:35:42 2005 +0000 Fix typo which broke window titles commit 0bb2eb8eaaf4054fefbc45bf3cb47bbcf10b7cfd Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 5 15:43:20 2005 +0000 Fix problem with fake Control press on Alt-Gr https://bugs.freedesktop.org/show_bug.cgi?id=3680 https://bugs.freedesktop.org/show_bug.cgi?id=3497 Fix static declaration of winGetBaseDir commit 3af77ad3e754c4d419a1996ca73a9fd01f92388a Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 5 14:09:48 2005 +0000 External windowmanagers could connect in multiwindow mode which lead to strange results with the internal windowmanager. commit 426282268bcdd0e0ca973fa79b414e9065fbfd9d Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jul 4 23:40:09 2005 +0000 Build miinitext.c and fbcmap.c as DDX specific files Do not define _POSIX_SOURCE on cygwin. commit 845a0ac68b02148db6f2cca81debf20b2331607b Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jul 4 23:11:20 2005 +0000 Revert last changes. They have to be addressed in a different way commit 048045a9e714fc85c26028c4de36dff47644b826 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jul 4 22:18:40 2005 +0000 Add XWin DDX, make Xorg DDX conditional Make XF86VidMode and XF86Misc conditional Add XWin DDX Added DDXTIME, DDXOSFATALERROR, DDXOSVERRORF and DDXBEFORERESET Added fbcmap.c Added miinitext.c Added -I$(top_srcdir)/Xext/extmod to INCLUDES commit 508cdb5cb01a91b1bf3ef31da80b6b1d36286bf0 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jul 4 22:10:43 2005 +0000 Include xwin-config.h if HAVE_XWIN_CONFIG is defined Cleanup X11 includes handling Warning fixes commit 5e50ae22bf206d6c2cc05e772e05fa5a363acb81 Author: Zack Rusin <zack@kde.org> Date: Mon Jul 4 18:55:53 2005 +0000 remove the temporary debugging output commit 7586ac6edea64b30d6187f9ec4d867521c1e769c Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jul 4 18:41:04 2005 +0000 Bug #2216: Multiseat support. From various Debian and Ubuntu patches by Aivils Stoss, Andreas Schuldei, Branden Robinson, and Daniel Stone. commit ba011dc77dcfaea2843481fbba45a76d8cb9aa83 Author: Lars Knoll <lars@trolltech.com> Date: Mon Jul 4 14:47:03 2005 +0000 don't be too smart and try to replace PictOpOver by PictOpSrc when we have an external alpha map. Make fbmmx.c compile on gcc 4.0.1. commit a4df8ad75579d9c183f110d79d87cfb9aaf23acd Author: Lars Knoll <lars@trolltech.com> Date: Mon Jul 4 14:23:59 2005 +0000 Fix handling of "super luminescent" colors Fix off by one error in the transformation handling. commit e34f31762e0454930f30547a9407cc8b941c70f2 Author: Zack Rusin <zack@kde.org> Date: Mon Jul 4 14:15:57 2005 +0000 This fixes the close screen mess (crash reported by Thomas). Also hide the private Exa screen definition. Properly cleanup on screen close and do not delete the private screen in the DriverFini call. commit 4ef813961dc8dea8924a79e0954d5b6da12e77c0 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jul 4 09:01:43 2005 +0000 provide the uint datatype on WIN32 commit 7dc547252af3b23652b1d496957645726c7125a4 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Jul 4 00:16:23 2005 +0000 Fix builds on non-GLIBC systems (missing __GLIBC_PREREQ). Add Solaris stack backtrace dumper. commit d010de6979a6c51a628f2f8e6d7f479a542d1e8b Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 15:51:23 2005 +0000 Abandon the nostdinc experiment. commit b0d80e76d28dbc1ee14453950db000bb4d7f377f Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 12:17:04 2005 +0000 Add missing include paths. commit 461eb6ebd9273dc3dcd601ee0a0491981a98acd9 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 12:16:29 2005 +0000 Change HAVE_CONFIG_H to HAVE_DIX_CONFIG_H. commit c1e69798ad14fb706f5f6de67e3f53df56f524c6 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 12:15:16 2005 +0000 Add explicit PSZ defines, remove unnecessary dix-config.h include. Add -DXF86PM, forgotten from last commit. commit 4e501d35e260775a43f340b3e1a9aa092570aba4 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 10:51:16 2005 +0000 Remove needless usage of DECkeysym.h. commit a107f599518a175dd689417b48788a746303966a Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 09:39:54 2005 +0000 Predicate usage of xf86OSPM functions on #ifdef XF86PM. Remove needless include of ../input/mouse/mouse.h. commit 0bb669638f032e61471007b2fa88285aa5d63903 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 08:53:54 2005 +0000 Change <X11/misc.h> and <X11/os.h> to "misc.h" and "os.h". commit 401e4580d6dd9867a691045688680ce410f84cb5 Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 07:55:00 2005 +0000 Move misc.h and os.h from proto/X11 to xserver/xorg/include. commit 46b64bd5c66abb1bb9f3538c887d10867607bfff Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 07:37:35 2005 +0000 Fix more include paths; add dix-config.h to XKB code. commit e03198972ca78b03ad13cb49112c03a052bb763b Author: Daniel Stone <daniel@fooishbar.org> Date: Sun Jul 3 07:02:09 2005 +0000 Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings. Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings. Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all source files in the xserver/xorg tree, predicated on defines of HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to <X11/fonts/foo.h>. commit b8aef6c474ffc6d637bec178674898ea95ccde47 Author: Kevin E Martin <kem@kem.org> Date: Sun Jul 3 03:28:27 2005 +0000 Fix build issues. commit 826a6f029faeabaa783a93dfdccca846f9326b58 Author: Daniel Stone <daniel@fooishbar.org> Date: Sat Jul 2 18:59:44 2005 +0000 Continuing Makefile cleanup; add DIX_CFLAGS and XORG_CFLAGS everywhere. commit e58c09d31bdf90210e2ec1ef976cea0459cdc02a Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 2 18:06:05 2005 +0000 Bug #3687: Print backtraces on fatal signal on glibc systems. commit e6602b041fe489d51a1d7fac55cbbb12b1826ba1 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 2 17:02:23 2005 +0000 Bug #3546: Use MAP_LENGTH instead of a magic number. (Mark McLoughlin) Bug #3664: Further fixes to Xnest modifier state handling. (Mark McLoughlin) commit 9b1debcdb6c7df956c06350a6525afb8e6d691fa Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 22:43:43 2005 +0000 Change all misc.h and os.h references to <X11/foo.h>. commit 657b4cb8aa0076acae85997c4f0c353b4d86b632 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 22:32:34 2005 +0000 Change all misc.h and os.h references to <X11/foo.h>. commit 303c281f956d55e35b05ef8521d0b60d24aa7a10 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 21:15:20 2005 +0000 Add auto-generated header files. commit 9a6ec34d2545a23586f11ad51c81f41a940d73d0 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 21:13:36 2005 +0000 Use canonical autogen.sh, which supports srcdir != objdir autogen. commit 7ecc2d526c4ea5db2589644a2fec0daf71df36da Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 21:12:24 2005 +0000 Remove fbcmap.c hacks from the DIX. commit 6251f9c00a866f64207d23b0a06306ead15298e8 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 21:11:16 2005 +0000 Minor build system tweaks. commit 641f32c4368db07831d9d703161a9d4699307621 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 20:54:30 2005 +0000 Adding initial build system. commit 507d30546f56bfd172fc43857459c78c1026e97c Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 20:54:01 2005 +0000 Adding initial build system. commit a822df1cc16d150614dead70fd00750095a05c35 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 20:49:35 2005 +0000 Adding initial build system. commit ded56b1a74e6b3e4c48054b7e142d924b19e6104 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri Jul 1 20:29:53 2005 +0000 Adding initial build system. commit aabb868920658c9d3979dc194c6bd9702171f101 Author: Zack Rusin <zack@kde.org> Date: Fri Jul 1 13:30:29 2005 +0000 removing all debugging output from the default build :) commit 0fa9d1fb4886c418e3d8e0886ad815513eda0633 Author: Zack Rusin <zack@kde.org> Date: Fri Jul 1 12:24:30 2005 +0000 Leave debugging output for only the interested parties. commit 0df446ab8875430508ff51d3548955a215475084 Author: Zack Rusin <zack@kde.org> Date: Fri Jul 1 10:39:21 2005 +0000 Missed this. Spotted by Thomas. commit b5b2a0522efd61bd99b5d5d75cdd27960cd1c7e1 Author: Lars Knoll <lars@trolltech.com> Date: Fri Jul 1 10:05:43 2005 +0000 Add support for gradients and solid fills to Render. Changed the semantics of the Convolution filter a bit. It now doesn't try to normalize the filter values but leaves this to the client. This gives more reasonable behaviour in the limit where the filter parameters sum up to 0. commit 30c019e847adef6f7f3963df8ef1f3f994669a54 Author: Zack Rusin <zack@kde.org> Date: Fri Jul 1 08:56:12 2005 +0000 Adding the new acceleration architecture: Exa. It's meant to replace XAA in the coming months. commit 276821605ee50e71f30dd52f2c12237fc61f288f Author: David Reveman <c99drn@cs.umu.se> Date: Fri Jul 1 03:14:54 2005 +0000 Fix return values in Xgl render texture implementation commit 5e381441fff411316ea202a9f85aceb0e0dcf46b Author: Alex Deucher <agd5f@yahoo.com> Date: Fri Jul 1 02:56:04 2005 +0000 - Fix Support for Philips FM1236/F tuner on ATI AIW 9600 XT (Jeff Smith) Bug 3401 commit c4d1b4e0424d53cd0470e0e3f57c10ee8fe3d8c2 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Jun 30 21:33:46 2005 +0000 Added another test of checkForInput for WIN32 Windows keyboard and mouse events are added to the input queue in Block- and WakupHandlers. There is no device to check if input is ready. commit 1230c55ac3f75f4902b51b223d40354a54d0d0ab Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Jun 30 18:50:20 2005 +0000 Pass serverClient instead of NULL to ConfigureWindow. This should fix a crash reported by Øyvind Harboe commit 0929f79c1baa5b65808ab034591510906623e841 Author: Matthew Allum <breakfast@10.am> Date: Thu Jun 30 13:39:00 2005 +0000 Another Xephyr focus/modifier fix commit b6c7afe0b9faed7025c70334d464fd75ce5c84c4 Author: Lars Knoll <lars@trolltech.com> Date: Wed Jun 29 15:19:14 2005 +0000 compile commit d8a98454e305973dd7fec76db2ef80705cf7c298 Author: Lars Knoll <lars@trolltech.com> Date: Wed Jun 29 11:57:16 2005 +0000 Add support for gradients and solid fills to Render. Changed the semantics of the Convolution filter a bit. It now doesn't try to normalize the filter values but leaves this to the client. This gives more reasonable behaviour in the limit where the filter parameters sum up to 0. commit ce0e11aeac76119b96b463605bc1f5318e3d2bde Author: Adam Jackson <ajax@nwnk.net> Date: Tue Jun 28 21:05:31 2005 +0000 Bug #2447: Fix argument order to xf86DrvMsgVerb. (Luc Verhaegen) commit 5ef5aec9bb5ee85295c0913afca891572d1315a4 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Jun 28 02:04:54 2005 +0000 Update to latest snapshot (27-May-2005) from http://pciids.sf.net/ commit b262a18aad36b2de729f6d00d144ac7277687f19 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Jun 26 02:48:36 2005 +0000 Cosmetic correctness fixes: miEmptyBox and miEmptyData are variables, and miGlyphExtents is a function. commit aa7fb99bc76e62036c73ff50f58337558859b814 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jun 25 21:28:48 2005 +0000 Bug #3030: Fix Xnest keyboard state handling. (Mark McLoughlin) commit 8562f800b879ae461317da9640961f753e107250 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jun 25 21:16:54 2005 +0000 Bug #3626: _X_EXPORT tags for video and input drivers. commit 582a9f0d2ec01f1a3c5625e2f45a4599be7a11d5 Author: Zack Rusin <zack@kde.org> Date: Sat Jun 25 12:39:58 2005 +0000 Correctly handle empty rects on region initialization. commit 56201222067e793a3542bcdcd39bb257b4fad2a6 Author: Matthew Allum <breakfast@10.am> Date: Thu Jun 23 16:50:07 2005 +0000 Fix issues with focus in and modifiers from host confusing Xephr commit a668b6c11a2d6b4800407ad918481d90be87a732 Author: Matthew Allum <breakfast@10.am> Date: Thu Jun 23 16:34:07 2005 +0000 redo tslib commit 5e863851a61207ade1ac807bc8cff7d9cf02dbbe Author: Adam Jackson <ajax@nwnk.net> Date: Sun Jun 19 01:30:29 2005 +0000 Build workaround. Add glcontextmodes.[ch] from Mesa. commit 9743adbe94f29417818b90e18aebb96a72f332f0 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Jun 16 20:50:12 2005 +0000 Add Type1 subdirectory to lib/Xfonts, update build system accordingly. commit 68e856ff5b1842ba10421714b5f6b21d528f6071 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jun 15 18:31:52 2005 +0000 DRM 20050615 import commit 6e301a8e97e99d58eaed25453f66c6d73bafd460 Author: Ian Romanick <idr@us.ibm.com> Date: Wed Jun 15 18:31:52 2005 +0000 Initial revision commit f0c76610b72a5b54bae5a5eb51ff4c420a27320e Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jun 15 16:46:59 2005 +0000 Conditionalise another use of XEvIE. commit 28ee3dd955302a1e99ffdc66cf0f512c6234d043 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Jun 15 16:27:16 2005 +0000 Conditionalise building of XEvIE code with #ifdef XEVIE. commit c6166ee74137084775c7550b708c5f71f16e7d3f Author: Lars Knoll <lars@trolltech.com> Date: Wed Jun 15 14:51:12 2005 +0000 Fix projective transformations in fbcompose.c Bugfix for convolution filters commit bd54b96034e640f202821eac0a2c40e66c1ddfd0 Author: David Reveman <c99drn@cs.umu.se> Date: Wed Jun 15 05:50:15 2005 +0000 Shut up compiler commit 7fa782dfd548498474830c7268032ffc5fb406a5 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Jun 13 21:51:46 2005 +0000 Add xkbfile to symlink.sh, conditionally include "config.h" in xc/lib/xkbfile commit 0802a2824c06d294ea42f0f6256644da5c0038c2 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Jun 13 18:14:53 2005 +0000 Correct the CHIPSET lines for the 3dfx cards so the tdfx driver will recognize them. I'm not sure if this file is supposed to be maintained still, but I'd like to close FreeBSD ports/32121 which has been around for far too long. commit 2eab094816726542c4de6c9db5efa102ab1e1593 Author: David Reveman <c99drn@cs.umu.se> Date: Mon Jun 13 16:38:06 2005 +0000 Build fixes commit 49476ca73c86a599a1bc49cba1117d42f59996a8 Author: Lars Knoll <lars@trolltech.com> Date: Mon Jun 13 14:40:25 2005 +0000 add the convolution filter from xserver to xorg commit f0ab6d57df66da5de1a8182f8250cc2c8e1450ad Author: David Reveman <c99drn@cs.umu.se> Date: Mon Jun 13 06:00:35 2005 +0000 Remove xgloffscreen.c commit f5aeaa7710de5ba4aad125bc8472bad1f17e23c6 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jun 13 00:09:23 2005 +0000 Bug #3513: Silence unhandled event messages from Xnest when running with -parent. (Mark McLoughlin) commit 521916d0074901db58ab6b9edab52373da28bdb3 Author: David Reveman <c99drn@cs.umu.se> Date: Fri Jun 10 12:30:39 2005 +0000 New implementation of GLX_MESA_render_texture commit bdb3eb86f02e233b6aeef0995ea9afeaa7b035ac Author: Kean Johnson <kean@armory.com> Date: Fri Jun 10 06:54:07 2005 +0000 file usl_xqueue.c was initially added on branch sco_port_update. commit 988ffddfe082fb27fadf9aa60ab22dce6855508c Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jun 10 04:01:14 2005 +0000 Bug #2799: Input shape. (Keith Packard) commit d24ed90547122832d4168ad761f68e107bb1a2db Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jun 10 02:14:44 2005 +0000 Axe a few dead fields from the port priv struct and add my name to the "Copyright" line of the license to ati_video.c that already has my name in the text. commit 75065f3a54ec760bbe81160fa233810f14d8aaa2 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jun 9 23:22:55 2005 +0000 Perform a warnings sweep on hw/kdrive. A number of these were my fault, but some come from others. commit e11e60b361d63ae02918dd6b43038a5c92b73a49 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jun 9 21:59:26 2005 +0000 Greatly improve the correctness and performance of the MGA render implementation. Includes cache flushing to prevent bad first reads of the framebuffer, fixing blending of many formats, falling back on many unsupported operations, and falling back early to prevent migration. Passes all of rendercheck except some of the blend (!) tests. commit 9f81ce945680515e6db7da6c87458bee7c0f053d Author: Ian Romanick <idr@us.ibm.com> Date: Thu Jun 9 21:48:45 2005 +0000 Re-enable GL_HP_occlusion_test. The problems in Mesa that caused this bug were fixed by Brian Paul in Mesa version 6.1. The current Mesa version in the X.org tree is 6.2.1. Xorg bug: 762 commit 92b3775ae8bdd4a84d7e101b36b306fbd3ac17a2 Author: Matthew Allum <breakfast@10.am> Date: Thu Jun 9 16:22:27 2005 +0000 TSLib fixes. Add fullscreen support to ephyr commit 545c082cf9c86f2a809ea6b4dca33643afb0c3d3 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jun 9 10:44:45 2005 +0000 - Replace the syncAccel hook in the kdrive structure with a pair of hooks in the kaa structure: markSync and waitMarker. The first, if set, returns a hardware-dependent marker number which can then be waited for with waitMarker. If markSync is absent (which is the case on all drivers currently), waitMarker must wait for idle on any given marker number. The intention is to allow for more parallelism when we get downloading from framebuffer, or more fine-grained idling. - Replace the KdMarkSync/KdCheckSync functions with kaaMarkSync and kaaWaitSync. These will need to be refined when KAA starts being smart about using them. Merge kpict.c into kasync.c since kasyn.c has all the rest of these fallback funcs. - Restructure all drivers to initialize a KaaInfo structure by hand rather than statically in dubious order. - Whack the i810 driver into shape in hopes that it'll work after this change (it certainly wouldn't have before this). Doesn't support my i845 though. - Make a new KXV helper to avoid duplicated code to fill the region with the necessary color key. Use it in i810 and mach64 (tested). commit 72ca8e1b5432db57401e66af8a07fcd8cbbbb9f1 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Jun 9 03:11:58 2005 +0000 Add agpgart support for Solaris x86/x64. [Requires Solaris "Nevada" build 16 or later to get kernel side for now.] (Sophia Li - Sun Microsystems) commit ca37d5755259ca03c61cf0567be3dea99d0c79f6 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jun 9 03:01:57 2005 +0000 Bug #2469: More accurate damage reports. (Jonathan Lennox) commit cdc15e2294a9bffc570e33bc31170081abfc55fb Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jun 9 02:29:42 2005 +0000 Bug #1846: Add intentionally undocumented -disablexineramaextension flag to the server to work around ignorant clients on large display walls. (Kevin E. Martin) commit e3cdec7cdcd76f6294ba1f296e4bcdee43b1eb3c Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jun 9 02:19:10 2005 +0000 Bug #1880: Remove unused xnestConfineWindow. (Mark McLoughlin) commit 0f7136191b54e587b66958985e14d8b0687c5ee1 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jun 9 02:03:50 2005 +0000 Bug #3434: Don't define fbAddTraps twice. (Mike A. Harris) commit e7fec996eb43a0bea94a37d329e3902299e6e895 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Jun 8 16:13:11 2005 +0000 Merge from CYGWIN Added layout "French (Canada)" as ca_enhanced Added Czech (QWERTY) layout Merge from CYGWIN Print error code if winStoreColorsShadowDDNL fails commit d0d164e6daf6c1d8afe8099fb6187d8a74ff652b Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Jun 8 09:01:41 2005 +0000 Fix crash reported by yvind Harboe commit d146c41882e50dd1ed6022f8a5866514067ba9d2 Author: David Reveman <c99drn@cs.umu.se> Date: Tue Jun 7 08:53:40 2005 +0000 GLX improvements and remove use of pbuffers for offscreen rendering in Xgl commit 8237b31f60245a8e67735d6c231dfb7dd0bbc388 Author: Jon Smirl <jonsmirl@yahoo.com> Date: Mon Jun 6 04:06:38 2005 +0000 Keyboard sort of works now with evdev commit c5026577cbc70c7365a9c81b2775136b45c850d2 Author: Jon Smirl <jonsmirl@yahoo.com> Date: Sun Jun 5 17:32:41 2005 +0000 Create a default colormap commit 021a5cd170051aae25cf61651d07b47a4df31ab4 Author: Jon Smirl <jonsmirl@yahoo.com> Date: Sun Jun 5 01:58:41 2005 +0000 Enable egl server in automake --enable-xeglserver commit aa959672863aad71c807d6c09938bb296c347bcf Author: Jon Smirl <jonsmirl@yahoo.com> Date: Sat Jun 4 23:33:03 2005 +0000 Initial Xegl check-in. Works on EGL fbdev driver Input is totally broken. commit 88d49bed008264092245c4f6c53174f93f6ab387 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Jun 3 21:49:11 2005 +0000 Need to set initial screen size at device open time too. commit 0d206e177f46eedfffd8f88e985efdfaf117021c Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Jun 3 08:12:22 2005 +0000 Backout last winRaiseWindow patch which caused stacking problems commit 2fc290f646eb48f3c20ccff98355c2d082569160 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Jun 1 17:45:17 2005 +0000 Solaris VUID mouse protocol updates: - support for mouse-like devices that report absolute coordinates - support for mouse-like devices that need to know screen size so they can scale absolute coordinates to screen size - fix 3-button emulation commit 8537146e3662cdc66ef4692bfd3886a676096fb8 Author: Adam Jackson <ajax@nwnk.net> Date: Mon May 30 18:44:55 2005 +0000 Bug #3368: Cosmetic cleanup to DIX export list. commit 547c47aaea9f31f7c873376b0db859c1c1d3d918 Author: Adam Jackson <ajax@nwnk.net> Date: Mon May 30 18:36:19 2005 +0000 Bug #3407: Clean out ancient #ifdef X11R5 conditionals. commit cebd7348d271591b7ebeebe3b332f835cfa8a068 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat May 28 00:08:03 2005 +0000 Change hardcoded /usr/X11R6 to PROJECTROOT. Change hardcoded XF86Config to XCONFIGFILE. commit 1cb18a4bad565d1f783a4cefb3ed467699051068 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed May 25 12:14:29 2005 +0000 Workaround bug in pthread.h commit 62343f5162066f19ca6e62d1c85a4a40d45b3295 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun May 22 01:12:49 2005 +0000 Bugzilla #2800 <https://bugs.freedesktop.org/show_bug.cgi?id=2800> Xevie extension crash with signal 11 on keyboard Bugzilla #1205 <https://bugs.freedesktop.org/show_bug.cgi?id=1205> Xevie client receives two KeyPress events on consumed keys when XKB is enabled Patch #2223 <https://bugs.freedesktop.org/attachment.cgi?id=2223> Fixes for both of these and some other Xevie bugs (Derek Wang - Sun Microsystems) commit a8a61bbe22361b12d4a2dd511894987a338e3eef Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat May 21 07:46:38 2005 +0000 Initial experimental support for AMD64 builds on Solaris 10 x86. Improved support for 64-bit SPARC builds on Solaris as well. commit ef4401ff8a8c4d7c22ef6af7bf47ccb24f83967f Author: Adam Jackson <ajax@nwnk.net> Date: Thu May 19 18:53:51 2005 +0000 Bug #3334: Clean up remnants from the PEX, XIE, and BEZIER extensions. commit 1e51e18382de61a67027759eccee9ccbb0924304 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu May 19 01:25:02 2005 +0000 Wed May 18 21:20:35 2005 Søren Sandmann <sandmann@redhat.com> s/dst/src that I missed in the previous patch. Pointed out by Owen Taylor. commit be3875994d7778ffad0cd957a4bd1500bf58ac2c Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed May 18 20:49:31 2005 +0000 Wed May 18 16:47:44 2005 Søren Sandmann <sandmann@redhat.com> Actually assign the computed results. (Reported by Michael Dänzer, patch by Owen Taylor). commit 07d1e9ae5f0da65427ac52f065b173d340d70d6d Author: Adam Jackson <ajax@nwnk.net> Date: Wed May 18 19:44:35 2005 +0000 Bug #3066: Promote frameBufferPhysicalAddress to pointer from CARD32; bump DRIINFO version to match. Fix various pointer printfs in libdri to be 64-bit aware. Silence a warning about redefining noXFree86DRIExtension. (Jesse Barnes) commit b87a32fb0eafa6d5f12a6faa634662c71fdc97fa Author: Adam Jackson <ajax@nwnk.net> Date: Wed May 18 17:47:35 2005 +0000 Bug #3163: Create new DRIINFO_*_VERSION macros to indicate the version number of the DRIInfoRec, disambiguating it from the XF86DRI protocol version number. Modify DRIQueryVersion to return the libdri version number, which all DDXes were requesting implicitly. Fix the DDXes to check for the DRIINFO version they were compiled against. commit fddcde777f50611099d8888456d93be7e566c84e Author: Egbert Eich <eich@suse.de> Date: Wed May 18 15:38:50 2005 +0000 VBESetVBEMode() calls int10 0x4f02 to set a VBE video mode. This can be a standard mode solely determined by the mode ID or it may be a detailed mode with almost arbitrary mode parameters. The mode parameters are passed to the BIOS in a memory area pointed to by es:di. If bit 11 in the video mode is set this memory area is evaluated. When we don't have such an area (passed to VBESetVBEMode() this function should unset this bit for sanity reasons. (Bugzilla #3329) commit f28d644d9fb1feeab1bbb3d5e68255bfa20905d8 Author: Zack Rusin <zack@kde.org> Date: Wed May 18 14:24:14 2005 +0000 rewrite the rootless compositing code (1) compiles which is already a huge improvement ;) , 2) matches the new render composition semantics) commit bbbb0a3a84bf21f5120c73ef387d6190154c0f65 Author: Egbert Eich <eich@suse.de> Date: Wed May 18 10:31:53 2005 +0000 Avoid segfaults if the number of user supplied monitor ranges exceed the number of preallocated slots. We should really make this dynamic - but I don't think this ever caused a problem so it's more or less academic. A. Avoid that *SyncStart starts before *BlankStart. If *BlankStart > *SyncStart it is made = *SyncStart and its width is made maximal but such that the blank does not exceed *Total. Since the Sync width has the same restrictions as the Blank width monitors should still be able to clamp after the sync pulse. B. Over time mode validation has become inconsistent when people started to add additional features to the mode validation. One such feature is that the mode->Crtc* values have been (ab)used to allow the driver ValidMode() function to pass driver normalized timing values back to the validation function. The introduction of these features made the code less readable and created numerous possibly unintended side effects in the validation semantics. I've attempted to consolidate these changes making the code more consistent and eliminating a number of side effects. This should not cause problems for the majority of drivers, still it should receive testing - especially with ATi Mach64 and Radeon code. (Bugzilla #3325). commit a90af4a2e6e38cbe20af13aaa7822836c01290ae Author: Thomas Hellstrom <unichrome@shipmail.org> Date: Sun May 15 17:45:47 2005 +0000 Bug 2750: Prevent mtrr_remove_offending from ending up in an endless loop if the offending region refuses to be removed. commit f58a54668b96884ece6ecbff732e880677d5d19e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat May 14 20:13:45 2005 +0000 Change return statements to fix compiler errors: "fbcompose.c", line 2815: void function cannot return value "fbcompose.c", line 2861: void function cannot return value commit a9d820b454bbb418d04e1d3c3d5d4dd10d7bb3af Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri May 13 22:53:44 2005 +0000 - For now put xtrans in X11/Xtrans/X11, since libX11 is looking for it in <X11/...> - For Xcomposite and Xdamage, don't link the build system out of the xc tree - Link the public X11 headers into their own directory - Add links to XKeysymDB and XErrorDB - Add links to all the Xlib man pages - Add links to the lcUniConv subdirectory - Conditionally include config.h in Xlib source commit 8993e70d8da89e130455369ccb504b3adea5344f Author: Eric Anholt <anholt@freebsd.org> Date: Tue May 10 00:12:17 2005 +0000 Bugzilla #2561: Disable some keycode translations on PC98, which had various bad effects including modifier keys not working. commit e78abf3bdfbf5fc13fbc5b1d3ec00e9484297b89 Author: Eric Anholt <anholt@freebsd.org> Date: Mon May 9 23:42:26 2005 +0000 Bugzilla #2429: Correct the sysarch prototype for FreeBSD/alpha. commit 3f1a1551df2a9f45b3b8821f3f168d4dc8b8b438 Author: Eric Anholt <anholt@freebsd.org> Date: Mon May 9 23:26:02 2005 +0000 Increase the maximum number of buttons from 12 to 24. Helps with button-happy mice like the Logitech MediaPlay. (Bugzilla #2390) commit eca5dff173d5af0a31bbf84579909b88a86e4c92 Author: Adam Jackson <ajax@nwnk.net> Date: Mon May 9 12:46:53 2005 +0000 Render performance improvements. (Lars Knoll, Zack Rusin) commit 2de24db63eb65974ac547facf2a99aa4709d54b3 Author: Adam Jackson <ajax@nwnk.net> Date: Sun May 8 23:34:15 2005 +0000 Render performance improvements. (Lars Knoll, Zack Rusin) commit 2c9b1e337b2e82e10909f62e8cd8c2c7a402fdd8 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun May 8 21:14:55 2005 +0000 Only call ConfigureWindow from winRaiseWindow if the windows message dispatch loop is running. commit 78e4cb67d0f595f4fba5e98a9fa46de044556905 Author: Torrey Lyons <torrey@mrcla.com> Date: Fri May 6 00:45:30 2005 +0000 Fix build issues on Mac OS X 10.4.0. commit d5739efd2c266081ed6b844767dcdd0a3331bfd3 Author: Eric Anholt <anholt@freebsd.org> Date: Wed May 4 04:14:58 2005 +0000 Port X.Org to FreeBSD/powerpc. This makes a bit of math for sysmouse in mouse.c explicitly signed, avoiding the need for -fsigned-chars. (Peter Grehan, grehan at FreeBSD dot org) commit 6700847458427cbdbaf837ab06bfea9b80d92df2 Author: Harold L Hunt II <huntharo@msu.edu> Date: Mon May 2 22:01:08 2005 +0000 Fix comments for pointers in parameter lists to work with fussy compilers commit e50ab8feade400efd8e88ee0b2deeb924f169034 Author: Harold L Hunt II <huntharo@msu.edu> Date: Mon May 2 21:57:32 2005 +0000 Fix message type (respose->response) and fix */*comment*/ blocks to work with fussy compilers. commit baa0cfc15442287557e44fa2614d89ab0b5c2539 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon May 2 14:07:31 2005 +0000 Print correct logfile in FatalError message commit bc977945a53206d70ef9817d6ede4137eb5f7e3c Author: David Reveman <c99drn@cs.umu.se> Date: Mon May 2 00:33:52 2005 +0000 Set stencil size for Xgl GLX visuals commit 5b4462ed9bbb17212dd57617cb7e837142b6270a Author: David Reveman <c99drn@cs.umu.se> Date: Sun May 1 22:55:25 2005 +0000 New algorithm for calculating glyph extents in Xgl commit e4b33f4e91a5379c99ecf78ffb6a3e836cb42491 Author: Egbert Eich <eich@suse.de> Date: Wed Apr 27 15:42:15 2005 +0000 Catch SIGCHLD in OsBlockSignals() too to make sure this signal doesn't intercept reading the authority file (Fabian Franz, Bugzilla #3137). commit 246b14cb29250517912d9c661ab037a953f4bbf4 Author: David Reveman <c99drn@cs.umu.se> Date: Wed Apr 27 10:34:33 2005 +0000 Minor optimization commit 28a2d841cee596c0242b1649587d6b180529c0ef Author: David Reveman <c99drn@cs.umu.se> Date: Wed Apr 27 09:29:33 2005 +0000 Line drawing improvements to Xgl commit abcc8c352e5fe6dd3b7ce5c6a25f435f877264c3 Author: David Reveman <c99drn@cs.umu.se> Date: Wed Apr 27 08:45:16 2005 +0000 Fix typo commit 8bc5a387c365d6367813eac374150440d0edbf6e Author: David Reveman <c99drn@cs.umu.se> Date: Tue Apr 26 11:04:23 2005 +0000 Add glCopy operation and glPushAttrib/glPopAttrib support to Xgl GLX commit f010131a1964b5ec35f3b333ffa7459c38f8ce45 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 26 06:12:07 2005 +0000 xc/programs/Xserver/Xprint/Init.c //bugs.freedesktop.org/show_bug.cgi?id=2879) attachment #2556 (https://bugs.freedesktop.org/attachment.cgi?id=2556) Refix for bug 2879 - downgrade 15bit PseudoColor to 14bit - the current datatype for the |ColormapEntries| is a |signed short| which is too small for |32768| colors (=integer overflow). commit ba24ae89d33fbf3aacb8bbaf920d7436b77fda46 Author: David Reveman <c99drn@cs.umu.se> Date: Mon Apr 25 17:18:01 2005 +0000 Add scissor based clipping to Xgl GLX commit 07cc29cf69ff1e079efe3c9bfc55e8ac0f9bac93 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 25 00:25:39 2005 +0000 Bug #2138: When the server is built with MakeDllModules YES, prefer dlloader modules to elfloader modules, and vice versa when MakeDllModules is NO. Based on 028_loader_speed_hack.diff from Ubuntu (Daniel Stone). commit 6c37648754c9bd901adecf8d38f9bb46db65efad Author: Adam Jackson <ajax@nwnk.net> Date: Mon Apr 25 00:11:21 2005 +0000 Bug #2141: Rework misleading warning message when APM support is unavailable. (Previous patch on 2005-04-14 changed the wrong message.) commit a369d390a87ab0189c465be6cfd914e4b9329691 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sun Apr 24 01:10:12 2005 +0000 xc/config/cf/X11.tmpl xc/programs/Xserver/Xext/Imakefile xc/programs/Xserver/dix/Imakefile xc/programs/Xserver/dix/main.c xc/programs/Xserver/dix/xpstubs.c xc/programs/Xserver/mi/miinitext.c //bugs.freedesktop.org/show_bug.cgi?id=2792) attachment #2526 (https://bugs.freedesktop.org/attachment.cgi?id=2526) bug 2792 part II: Make Xprint headers in dix/, mi/, os/ and Xext/ conditional on whether the Xprint extension is build or not. Patch by Egbert Eich <eich@freedesktop.org> and Roland Mainz <roland.mainz@nrubsig.org>. commit 13fcfee37305f46e95ff81d7d5eec4d88a63a63b Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat Apr 23 22:55:40 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=3118) attachment #2525 (https://bugs.freedesktop.org/attachment.cgi?id=2525) Get Xprint server working again which was broken by the 05/04/20 05:49:46 commit commit (the CPP symbol |XPRINT| is not universally available when building the Xserver and should be used with care). commit 39eb2797183bf871a2dd01bff63dd35c146471f5 Author: Adam Jackson <ajax@nwnk.net> Date: Sat Apr 23 19:16:10 2005 +0000 Bug #3016: Don't complain as loudly about failing to load a module that's already loaded. commit 139f900c56a6f44df2b411fe4bbc025a147e3abe Author: Adam Jackson <ajax@nwnk.net> Date: Sat Apr 23 19:01:13 2005 +0000 Bug #3109: Handle R_ALPHA_BRSGP relocations in elfloader. (Sergey Tikhonov) commit 0e80fe0e607cc73856332563becd70ef92d1aa75 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Apr 22 22:11:26 2005 +0000 Clean up formatting, projectroot substutition, and grammatical nits. commit dcfb97204b021738c0ee9f1f8f40243dfa0b2ce0 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Apr 22 22:04:37 2005 +0000 Work around clash between Solaris headers and module loader headers over definition of FILE. commit 07bd7df6a6a07834277b4bf505db6727841e1153 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 22 20:49:50 2005 +0000 Bug #3069: Drop the BuildLowMem hack, it doesn't compile and isn't useful. commit d450a70e00b50427ecb2065d3cc44f43d102cade Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 22 17:45:14 2005 +0000 Bug #2373: SGI Altix platform support. (Shrijeet Mukherjee, Jesse Barnes, Bjorn Helgaas, Egbert Eich.) commit 16c2499b8f5c2405e36c7d5a922bb0b150df1762 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 22 16:49:22 2005 +0000 Bug #2373: SGI Altix platform support. (Shrijeet Mukherjee, Jesse Barnes, Bjorn Helgaas, Egbert Eich.) commit 8565b6c0e2851cc3f194ba72d3db02a4e2976528 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Apr 21 00:31:31 2005 +0000 Change xf86bigfont.h include to X11/extensions/xf86bigfont.h. commit b241c703a2c4164420dd26ee11f583bbf9cfe0f3 Author: Daniel Stone <daniel@fooishbar.org> Date: Thu Apr 21 00:31:13 2005 +0000 Change keymap.h includes to X11/keymap.h commit 44528218d5ca75b842e4cefd8fdc58be2f35f0f4 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 23:33:53 2005 +0000 Change dmxext.h and dmxproto.h to <X11/extensions/...>. commit efa9d5f4757bfc0588cee361bcc78dd8a09efa62 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 23:11:12 2005 +0000 Change "eviestr.h" to <X11/extensions/eviestr.h>. commit db5bd04097fd815ab6523f187679682a5e5047fa Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Apr 20 16:40:52 2005 +0000 Fix includes right throughout the Xserver tree: apply changes to windows specific includes Fix includes right throughout the Xserver tree: apply changes to Xdmcp.h commit 8963a220f36cf0ae2a8a653fd39c983140e29736 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Apr 20 16:34:46 2005 +0000 warning fix for Win32 commit e6a0820d1b479058bddef66018d321940e79260c Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 15:16:36 2005 +0000 Change "xf86bigfstr.h" to <X11/extensions/xf86bigfstr.h> for includes. commit 025724f9f5874159c20ebd705288ec60b960caac Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Apr 20 14:17:35 2005 +0000 Add missing space after -query hostname commit 35cd1684622f4528c68e07eea798c33bc4b93667 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 14:16:37 2005 +0000 Change xf86bigfstr.h to X11/extensions/xf86bigfstr.h for includes. commit c7c27e61870b42de044b183c854a960582d98dbf Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 13:33:54 2005 +0000 Change xf86bigfont.h to X11/extensions/xf86bigfont.h for includes. commit abd246c6c272a2c6f9c37404b2ed439911880e75 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 13:01:55 2005 +0000 Add glyphstr.h to includes. commit 956dfa22f6076969776546fb1151e900d8d773a1 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 12:49:46 2005 +0000 Conditionalise usage of Xprint functions and headers. commit 2cdfab0ed7eb33a6a50f9b7ec212b498dd8318b5 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 12:42:02 2005 +0000 Change keysymdef.h to X11/keysymdef.h for include statement. commit fa5539247d3b246db9ff1469d08167178c85d7ad Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 12:39:28 2005 +0000 Change Xalloca.h to X11/Xalloca.h for include. commit 292c4cff26687e6ef86c285b97813ab587daf009 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Apr 20 12:25:48 2005 +0000 Fix includes right throughout the Xserver tree: change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h; change "foo.h", "extensions/foo.h" and "X11/foo.h" to <X11/extensions/foo.h> for extension headers, e.g. Xv.h; change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files. commit c062d7f96f47bdd31640be1fbce682d0774db3d9 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Apr 19 18:21:01 2005 +0000 Prevent recursive calls to winRaiseWindow. commit 4e914c5ed7679a1102f3e25af0c087380f834865 Author: David Reveman <c99drn@cs.umu.se> Date: Tue Apr 19 14:51:29 2005 +0000 Hash texture objects and display lists in Xgl commit 6bde764de102a56d2c71b971eaa36535e9760b52 Author: Bogdan Diaconescu <b_diaconescu@yahoo.com> Date: Sun Apr 17 23:02:25 2005 +0000 Added a log pring for the parameters commit 8594b8f2893e58ae824e140334c18ba3d7467217 Author: Bogdan Diaconescu <b_diaconescu@yahoo.com> Date: Sun Apr 17 23:00:58 2005 +0000 Added new tuner FM1236MK3 PAL version commit 7f74e3aebdf79fbca4141e6ffcdad39812df9335 Author: Bogdan Diaconescu <b_diaconescu@yahoo.com> Date: Sun Apr 17 22:58:03 2005 +0000 This is the UDA1380 sound coder-decoder module commit 7a4e5f4006319e025e3ff561eccc3f1ad6c661a0 Author: Torrey Lyons <torrey@mrcla.com> Date: Sat Apr 16 00:21:21 2005 +0000 Fix cases in Darwin build where a variable is declared static and later as extern (XFree86 Bug #1576, Jordan Frank). commit 4f686f158b00478a3d074128f9e4cb6dc0d928cd Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Apr 15 23:34:39 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2885) attachment #2434 (https://bugs.freedesktop.org/attachment.cgi?id=2434) Fix Solaris build bustage caused by namespace collision between symbols defined in <sys/kbd.h> and those in "xf86_OSlib.h". Patch by Alan Coopersmith <alan.coopersmith@sun.com>. commit 7472fcfdd40e29cd2847e45d4bd2dd11ccc41ff5 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 15 00:18:58 2005 +0000 Bug #2141: Rework misleading warning message when APM support is unavailable. commit 504067819a4f1a8564dcacc278933f533618b666 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Apr 14 17:51:51 2005 +0000 Bug #3025: gcc4 build fix. commit e40db7f26af39a8b1f3675a2c87ce90c4fd59d85 Author: David Reveman <c99drn@cs.umu.se> Date: Wed Apr 13 14:27:47 2005 +0000 Add GLX code to Xgl commit ddfa6f00da7c80b246b57c592361baa4bc5a8e9d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Apr 13 00:05:37 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=3001) attachment #2404 (https://bugs.freedesktop.org/attachment.cgi?id=2404) Improve rendering performance when glXSwapBuffers()| or |XPutImage()| are called for the PostScript DDX via optimizing the codepath around |PsOut_OutImageBytes()|. Patch by Simon Toedt <simon.toedt@gmail.com> and Roland Mainz <roland.mainz@nrubsig.org>. commit f45208a7e9c39345ac431c2e7da8777d6c466dcc Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Apr 11 11:06:21 2005 +0000 update static file from pci.ids commit b47f39b417cbe220690155a08c6bc18cd7cfa388 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Mon Apr 11 10:57:33 2005 +0000 import latest pci.ids file commit 00a551393ce7aa9d2b23634737ced5071e3cdd35 Author: Egbert Eich <eich@suse.de> Date: Mon Apr 11 10:54:13 2005 +0000 Reenable BackingStore in Xvfb. commit 1fbd38f3b46df62561f8be74cbc05fcf8ad88a21 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Apr 11 10:16:25 2005 +0000 Added wizard page for clipboard selection and additional server parameters commit 6848b0353897a6a5d1218b266c22fb87a7c6d730 Author: Egbert Eich <eich@suse.de> Date: Mon Apr 11 10:05:38 2005 +0000 Correct the mask bits when checking for a 64bit memory base in PCI config space (bugzilla #2963). commit adac7011965ed75ea399b93dae917cb48180c77a Author: Egbert Eich <eich@suse.de> Date: Mon Apr 11 09:33:43 2005 +0000 Preventing hight for drawing from becoming negative when face->dy < 0. The height value is used in miFillPolyHelper() to calculate the size of memory to be allocated. A negative value will lead to a crash (Bugzilla #2690, Keith Packard, Egbert Eich). commit 5e2080ef93a598c6d68e1b2f446f251ab025b702 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Apr 11 01:06:15 2005 +0000 xc/programs/Xserver/Xprint/attributes.c xc/programs/glxgears/glxgears.c xc/programs/xdbedizzy/xdbedizzy.c xc/programs/xedit/Imakefile xc/programs/xedit/Xedit-xprint.ad xc/programs/xedit/util.c xc/programs/xedit/xedit.h xc/programs/xlogo/print.c xc/programs/xlogo/xlogo.c xc/programs/xlogo/xlogo.h xc/programs/xman/Imakefile xc/programs/xman/print.h xc/programs/xmore/Imakefile xc/programs/xmore/print.c xc/programs/xmore/print.h xc/programs/xmore/printdialog.c xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c xc/programs/xphelloworld/xphelloworld/xphelloworld.c xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c //bugs.freedesktop.org/show_bug.cgi?id=790) attachment #2379 (https://bugs.freedesktop.org/attachment.cgi?id=2379) Implement support client+Xserver support for passing output (stdout+stderr) of the spooler command started by the Xprint server back to the application using the "xp-spooler-command-results" XPJobAttr attribute (applications can fetch the attribute value after the XPEndJobNotify event was received; more details can be found in http://xprint.mozdev.org/docs/dtprint_fspec.ps). commit 9af443f5976ab3987e4ee9d397391e82206676b4 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Apr 9 19:20:03 2005 +0000 Fix passing of non-RGB visuals. The old code did not initialize the structure properly which lead to a crash in 8bpp mode commit f02440dfa3439ab493c7918b472c23bb22e29707 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Apr 6 15:18:59 2005 +0000 First import of xlaunch frontend for Xming commit de5d24a200e4426e458fc447884d1a5b0257faaa Author: Egbert Eich <eich@suse.de> Date: Mon Apr 4 10:17:06 2005 +0000 Fixed sentinels in Xt, editres and xedit to reduce number of warnings with gcc4 (Andreas Schwab). commit 277ff06e9999f2efe0f082a3565f6279219c13e4 Author: Egbert Eich <eich@suse.de> Date: Mon Apr 4 10:11:51 2005 +0000 Fix typo leading to bogus code in xorgcfg (Andreas Schwab). commit 7eb6b69ebd945c753ee0988e1a85dffde982446e Author: Egbert Eich <eich@suse.de> Date: Mon Apr 4 09:55:25 2005 +0000 Support for HP's IPF ZX1 systems (Alex Williamson). commit 231c00e8fba91b580ec3e2703dd1ceacf13a6624 Author: Egbert Eich <eich@suse.de> Date: Mon Apr 4 09:47:07 2005 +0000 When not using dlopen ia64 needs an extra cache flush to ensure the icache is coherent when modules are loaded (Alex Williamson). commit 55dc930a180553c08d8546cc2078451c20e34934 Author: Torrey Lyons <torrey@mrcla.com> Date: Sat Apr 2 02:29:24 2005 +0000 Fix XDarwin's handling of Wacom tablet mouse buttons (Based on patch suggested by Daphne Pfister). commit 03d126081e5ba57ea2304753289528a896f3baaf Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Apr 1 21:45:20 2005 +0000 xc/programs/Xserver/Xprint/Init.c xc/programs/Xserver/Xprint/ps/Imakefile xc/programs/Xserver/Xprint/ps/Ps.h xc/programs/Xserver/Xprint/ps/PsArea.c xc/programs/Xserver/Xprint/ps/PsColor.c xc/programs/Xserver/Xprint/ps/PsImageUtil.c xc/programs/Xserver/Xprint/ps/PsInit.c //bugs.freedesktop.org/show_bug.cgi?id=2879) attachment #2287 (https://bugs.freedesktop.org/attachment.cgi?id=2287) Follow-up to bugzilla #1299: Add new visuals in the Postscript DDX (including TrueColor 16bit, PseudoColor 15bit/12bpg(12 bits per R-, G-, B-channel as in PostScript Level 2 (and above) colors can have 12 bits per component (36 bit for RGB)), PseudoColor+GrayScale+StaticGray 12bit/12bpg) and switch the default visual from PseudoColor 8bit/8bpg to PseudoColor 12bit/12bpg. commit fe37cc7e7b3036e538930c16bbdb39a7915b1685 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Fri Apr 1 21:28:50 2005 +0000 programs/Xserver/hw/xfree86/loader/xf86sym.c programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c Fix setjump0 declaration for DllLoader. commit ef60998a828951e61f1480e29c2fec62e7454bbc Author: Kevin E Martin <kem@kem.org> Date: Fri Apr 1 20:21:38 2005 +0000 bugzilla #2880 (https://bugs.freedesktop.org/show_bug.cgi?id=2880) attachment #2285 (https://bugs.freedesktop.org/attachment.cgi?id=2285) Use system method to access PCI config space. commit 33ab2a2abc8c1e4ca9c7139454c60f5ad8a61a94 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Apr 1 20:05:11 2005 +0000 Bug #2835: Add symbol exports to support the ReadDisplay extension. commit cbccac448a1466ab098e8fe5dbfff98264c7260a Author: Alex Deucher <agd5f@yahoo.com> Date: Thu Mar 31 23:18:10 2005 +0000 - Add new Radeon pci ids (ATI devrel), bug 2827 commit 59d7222b13775efb2159159cc897e7789bdf10b2 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Sun Mar 27 00:17:12 2005 +0000 Sat Mar 26 19:00:30 2005 Søren Sandmann <sandmann@redhat.com> Remove accidentally committed prototype. commit 476ae15640d2b97cb0ebccab8255ccf728596c62 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Sat Mar 26 23:50:24 2005 +0000 Sat Mar 26 18:49:21 2005 Soeren Sandmann <sandmann@redhat.com> programs/Xserver/fb/fbmmx.h New function. Hook it up here commit 0d33b588376a4d86d50ed8b7e06eaf0dbd8c5ba5 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Mar 25 23:11:14 2005 +0000 xc/programs/Xserver/Xprint/ps/Imakefile //bugs.freedesktop.org/show_bug.cgi?id=2821) attachment #xxx (https://bugs.freedesktop.org/attachment.cgi?id=xxx) Remove the cfb dependicy from the PostScript DDX as this is not needed in a vector DDX (mfb is still needed to fill the |BitmapToRegion()| callback with |mfbPixmapToRegion()|). commit 5f320335c3a8148ae98f82a00ff44954197f4251 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Wed Mar 23 21:09:48 2005 +0000 bugzilla #2194: fix an alignement problem on 64 bit architectures. commit f4e9f522fe8bec3dd6294d062c2244a06623add3 Author: Thomas Hellstrom <unichrome@shipmail.org> Date: Wed Mar 23 21:03:41 2005 +0000 Bugzilla #2750 (https://bugs.freedesktop.org/show_bug.cgi?id=2750) Linux-only fixes: Fix case where a smaller write-combining region blocks write-combining setting of the whole frame buffer. Fix bug in wc setting code when regions are first splitted and setting of write-combining then fails. commit 1be6e2388bcc5835ab62f0855d443fb508697deb Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Mar 23 20:49:52 2005 +0000 xc/programs/Xserver/hw/vfb/InitOutput.c //bugs.freedesktop.org/show_bug.cgi?id=2791) attachment #2197 (https://bugs.freedesktop.org/attachment.cgi?id=2197) Add support for 12bit PseudoColor and 30bit TrueColor to Xvfb. commit 26aec10adad51deb35a8398abb884d90be077a6b Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Mar 23 19:58:45 2005 +0000 xc/programs/Xserver/Imakefile xc/programs/Xserver/Xprint/DiPrint.h xc/programs/Xserver/Xprint/Imakefile xc/programs/Xserver/Xprint/Init.c xc/programs/Xserver/Xprint/ddxInit.c xc/programs/Xserver/dix/Imakefile xc/programs/Xserver/dix/main.c xc/programs/Xserver/dix/xpstubs.c xc/programs/Xserver/os/Imakefile //bugs.freedesktop.org/show_bug.cgi?id=2792) attachment #2193 (https://bugs.freedesktop.org/attachment.cgi?id=2193) Fix build bustage when |PrintOnlyServer| is set to |NO|. Patch by Roland Mainz <roland.mainz@nrubsig.org> and Julien Lafon <julien.lafon@gmail.com>. commit ac18f8e308221af368fd4153b4eee7b89f8dd4bc Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Mar 23 00:32:49 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2789) attachment #2187 (https://bugs.freedesktop.org/attachment.cgi?id=2187) Fix Xvfb to honor the "-dpi" option (instead of using a hardcoded value of 100DPI). commit 45bcb8e22ad949c456368b7d4f4226110f8b5cfc Author: Adam Jackson <ajax@nwnk.net> Date: Tue Mar 22 21:30:43 2005 +0000 Bug #1821: Typo fix in xorg.conf man page (Jens Schweikhardt) commit cc95e597b51f06e835c6a9def1bc6681029bf41e Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Mar 22 17:49:14 2005 +0000 Tue Mar 22 12:47:16 2005 Søren Sandmann <sandmann@redhat.com> Only validate the source if it is a viewable window. Stops the cursor flickering when it is above an unviewable window. commit 1d68ede0eed62b48354a954a62fca98aa2ce9d2d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat Mar 19 20:51:34 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2771) attachment #2148 (https://bugs.freedesktop.org/attachment.cgi?id=2148) Remove RENDER extension from exclusion list for the standalone print server (Xprt) to get this extension enabled if the print DDX support it. commit 64f1b3fe7e85245865666607d7b32ef7807df08f Author: Michel Daenzer <michel@daenzer.net> Date: Fri Mar 18 22:36:47 2005 +0000 Add support for production version of ATI RN50/ES1000. (ATI Technologies Inc.) commit 36dcc9bb1d51fb8c0d67c7e15700e3473a06e47b Author: Torrey Lyons <torrey@mrcla.com> Date: Thu Mar 17 01:12:07 2005 +0000 Fix build on stock Mac OS X: Out of the box, Mac OS X does not include Freetype2, Expat, or PNG. Also global variables should be initalized in the Xserver. commit 82f5a127522e48ff7ff78400eadbce0a5a362064 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Wed Mar 16 21:25:43 2005 +0000 Wed Mar 16 16:17:43 2005 Søren Sandmann <sandmann@redhat.com> Only validate the source if it is a viewable window. Stops the cursor flickering when it is above an unviewable window. commit 226c0907d4327a440fb0ac5380a19538ffdc6fa0 Author: David Reveman <c99drn@cs.umu.se> Date: Wed Mar 16 21:05:51 2005 +0000 Add cursor support to Xglx commit 7109ae147c3a9d243d11f386cfbcfbf7b4ea7918 Author: David Reveman <c99drn@cs.umu.se> Date: Wed Mar 16 20:05:19 2005 +0000 Fix a few problems in Xgl commit 04ccba4d40bef6cee902b118598272f26eebb1df Author: Egbert Eich <eich@suse.de> Date: Wed Mar 16 12:16:06 2005 +0000 Don't fail calling function when DriverFunc() for RandR fails as DriverFunc() also returns FALSE when the specific sub function isn't supported. In the case of xf86RandRGetInfo() we simply rely on what has been set before and return TRUE. In the case of xf86RandRSetConfig() we only bail with FALSE if we have to do a rotation and the call fails. We presently cannot do rotation on the fly without the help of a driver function (Bugzilla #2745). commit 1011762254b41db5ce67cb652a2d4965efd7ec20 Author: Egbert Eich <eich@suse.de> Date: Wed Mar 16 11:54:54 2005 +0000 Make message that gets printed when loader encounters a .o with no symbols less conspicuous. commit 816606b9eabee334ce6e0b79e8aa67544f428c19 Author: David Reveman <c99drn@cs.umu.se> Date: Fri Mar 11 12:26:20 2005 +0000 Return early from xglFillRect when no rectangles should be filled commit 4de5aa428514f2cacc60d4708dad996dedee1092 Author: David Reveman <c99drn@cs.umu.se> Date: Fri Mar 11 00:58:49 2005 +0000 Use negative stride and PBOs in Xgl commit 8653db5d57199d53c9b2b993c35a7b70c8949989 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Mar 10 20:05:46 2005 +0000 Force rebuilding of window stack if a window changes it's state from minimized. commit 522628f25b4a075c8daf547991ea5b80c5efe9c7 Author: Egbert Eich <eich@suse.de> Date: Tue Mar 8 10:26:59 2005 +0000 Adding more errnos to the libc wrapper (Bugzilla #2672). commit db7c9d349b86216ed00888181c64ab707fbe18d4 Author: David Reveman <c99drn@cs.umu.se> Date: Tue Mar 8 09:27:09 2005 +0000 Return early from xglCopy if fall-back is more efficient commit e09d1d2ae3ccd59408b1dc6f264897ae12dfa2b8 Author: David Reveman <c99drn@cs.umu.se> Date: Tue Mar 8 09:12:17 2005 +0000 Better ShmPutImage support in Xgl commit 5d9885c5b95286c8d7f777c7232283e8b1e81d1b Author: David Reveman <c99drn@cs.umu.se> Date: Tue Mar 8 09:03:38 2005 +0000 Minor improvement to CopyArea in Xgl commit 51155ca68bf7539bd3ace2ac068a2be1fbcf400c Author: David Reveman <c99drn@cs.umu.se> Date: Tue Mar 8 08:48:22 2005 +0000 Improve Xgl offscreen memory manager commit e26a096cb662700387c7b43289d1f6f7ab4a0aac Author: David Reveman <c99drn@cs.umu.se> Date: Tue Mar 8 08:30:47 2005 +0000 Fix Xgl glyph caching commit 8d0e520721ab7697d2d4f639425499b79c61b43f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Mar 7 23:02:59 2005 +0000 xc/programs/Xserver/dix/atom.c xc/programs/Xserver/dix/colormap.c xc/programs/Xserver/dix/cursor.c xc/programs/Xserver/dix/devices.c xc/programs/Xserver/dix/dispatch.c xc/programs/Xserver/dix/dixfonts.c xc/programs/Xserver/dix/dixutils.c xc/programs/Xserver/dix/events.c xc/programs/Xserver/dix/extension.c xc/programs/Xserver/dix/gc.c xc/programs/Xserver/dix/glyphcurs.c xc/programs/Xserver/dix/grabs.c xc/programs/Xserver/dix/main.c xc/programs/Xserver/dix/pixmap.c xc/programs/Xserver/dix/privates.c xc/programs/Xserver/dix/property.c xc/programs/Xserver/dix/resource.c xc/programs/Xserver/dix/swaprep.c xc/programs/Xserver/dix/swapreq.c //bugs.freedesktop.org/show_bug.cgi?id=2560) attachment #2037 (https://bugs.freedesktop.org/attachment.cgi?id=2037) ANSI-fy Xserver/dix code. The conversion preserves the comments which annotate variables. These have been moved into doxygen(esque?) "stubs" above each function. Patch by Mike Owens <etc@filespanker.com>. commit cb0aa2b4d8875f1ea66e720ca7c6cc2f403be26a Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Mar 7 22:26:59 2005 +0000 Prevent winRaiseWindow from calling ConfigureWindow if the message was sent from within winDestroyWindowsWindow DestroyWindow send a WM_WINDOWPOSCHANGED to another window causing a restacking of all windows, even of the window which is just about to destroyed and whose structures may not be intact anymore. commit 978f3b496b9951ee8120a0efcc5cd12503e26770 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat Mar 5 21:38:29 2005 +0000 xc/programs/Xserver/Imakefile xc/programs/Xserver/hw/xnest/Imakefile //bugs.freedesktop.org/show_bug.cgi?id=2653) attachment #2020 (https://bugs.freedesktop.org/attachment.cgi?id=2020): Cleanup Xnest usage of the DPMS dummy stub functions from dpmsstubs.c instead of using it's own copy of these functions. commit 602209990dbbc96b4c5a96e2221a418cf29e613d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat Mar 5 20:47:12 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2543) attachment #2019 (https://bugs.freedesktop.org/attachment.cgi?id=2019): Fix |xf86SignalHandler()| which resets the signal handler before setting the flag indicating a signal has been caught, theoretically allowing the possibility of infinite recursion. Patch by Andrew Church <xzilla@achurch.org>. commit d995fe631a5706de93a05fda498333442af3d207 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Mar 2 14:21:40 2005 +0000 xc/programs/Xserver/hw/xnest/Screen.c xc/programs/Xserver/hw/xnest/Window.c //bugs.freedesktop.org/show_bug.cgi?id=2546) attachment #2005 (https://bugs.freedesktop.org/attachment.cgi?id=2005): Fix Xnest to update the shape regions in the backend server whenever a client changes them in Xnest (the fix is to add a new wrapper which calls |xnestShapeWindow()| before calling |miSetShape()|). Patch by Mark McLoughlin <mark@skynet.ie> commit 3f79c5eefc0d62d3a9b095472cd75b446ba2a56e Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Mar 2 11:20:30 2005 +0000 xc/config/cf/DragonFly.cf xc/config/cf/Imake.cf xc/config/cf/Imakefile xc/config/imake/imake.c xc/config/imake/imakemdep.h xc/extras/drm/shared/drm.h xc/include/Xos_r.h xc/lib/xtrans/Xtranssock.c xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c //bugs.freedesktop.org/show_bug.cgi?id=1712) attachment #2004 (https://bugs.freedesktop.org/attachment.cgi?id=2004): Add support for DragonFly/BSD platform. Patch by Jeroen Ruigrok <asmodai@tendra.org> and Mike Verona <firedragonfly@gmail.com>. commit 6c6151b2339a05c60ec58e013f915f79a3f9d756 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Mar 1 18:58:17 2005 +0000 If a context is already attached copy it instead of reattaching to keep displaylists and share displaylists Enable tracing of often called functions with GLWIN_ENABLE_TRACE ForceCurrent is a no-op now commit d323c4f59a653f364164d2a57fbbd102306a6ee9 Author: David Reveman <c99drn@cs.umu.se> Date: Tue Mar 1 16:57:54 2005 +0000 Minor improvement to pixel transfers in Xgl commit 2d2c1732620a83215983ee7a7dd469a1a85fcc12 Author: David Reveman <c99drn@cs.umu.se> Date: Tue Mar 1 16:34:31 2005 +0000 Add dither support to Xgl commit b4b27e9eaa43401ae70e5d03823012bf8c78848f Author: Keith Packard <keithp@keithp.com> Date: Mon Feb 28 20:45:15 2005 +0000 Force DPMS normal on screen enable Add placeholder for bit used to redirect input Add macrovision register defines commit 409c0618bced6df02eed7af77107ff74508c0f3f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Feb 24 22:53:17 2005 +0000 on WM_WINDOWPOSCHANGED raise window directly and in sync without utilizing the async windowmanager thread. Fixes some restacking problems occuring which were timing dependent Do not raise the window on WM_ACTIVATE Removed unused code for WM_WINDOWPOSCHANGING ESC is debug key. Print status but do not abort processing the message commit 775efdbd79448040b822fcc0556e98d3968ba8c3 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Feb 23 19:17:10 2005 +0000 Bugzilla #2599 (https://bugs.freedesktop.org/show_bug.cgi?id=2599) attachment #1964 (https://bugs.freedesktop.org/attachment.cgi?id=1964): move miScreenInit in front of pScreen->function initializations to prevent it from resetting ClipNotify. commit c4b3fcda98a92c204534f04bd386ace5d3620d86 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Feb 21 03:44:10 2005 +0000 Move the draw tracing supplies into ati_draw.h, and do some touchups on it. (When tracing drawing, I want to know what I'm drawing to, at a minimum). commit de34b0eefc9f8a29147659454398cabb187c7cb6 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Feb 21 03:05:55 2005 +0000 Extend the filter support to R200, and do the check for filter settings in Check rather than Prepare, to avoid migration of things we won't be able to accelerate. commit 535c178286f94cc593b6cda753bbeb9b7cf6df4c Author: Michel Daenzer <michel@daenzer.net> Date: Fri Feb 18 19:55:35 2005 +0000 Bug #2576: Add support for ATI RN50/ES1000. (ATI Technologies Inc.) commit 2f07222106358a02f56bf1e344d1fbf7ead14cbd Author: Adam Jackson <ajax@nwnk.net> Date: Fri Feb 18 17:52:48 2005 +0000 Bug #2455: Make x86emu handle JNL correctly. (David Wong) commit 01b156240ce66703b38a67ee3cfbb475352cdf68 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Feb 12 14:55:24 2005 +0000 winmultiwindowwindow.c winmultiwindowwndproc.c Cleanup some message debugging commit 8df7126f09d6d7cb35a5912a71531cad28ba2545 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Feb 12 14:47:17 2005 +0000 win.h winfont.c winmultiwindowshape.c winmultiwindowwindow.c winpfbdd.c winshaddd.c winshadddnl.c winshadgdi.c Fix incorrect wrapping of functions. Ensure the pointers from pScreen point to the called function even if wrapped functions changed it Set the window properties to NULL to avoid referencing freed memory because of timing problems after deleting a window Do not wrap ChangeWindowAttributes. All functions are noops currently commit 676fdb03f3fb27ac24834aeb895df7d6d6e83f78 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Feb 12 14:43:07 2005 +0000 print window handle in message outout commit 046bdb17169ecb1361a42ab52043da699590d39a Author: David Reveman <c99drn@cs.umu.se> Date: Fri Feb 11 20:19:20 2005 +0000 Fixes a few problems in Xgl commit 35bd81dfec62402f9d6c68d98e651e8cd87a8758 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Feb 11 19:38:04 2005 +0000 Fri Feb 11 14:28:22 2005 Søren Sandmann <sandmann@redhat.com> When COMPOSITE is enabled, call CopyWindow even when the pixels "don't move" on screen. Don't reject modes that are not supported by the unused monitor. commit e5ccccfbd45c78c1be5e311b2cb4135a9a27540b Author: Adam Jackson <ajax@nwnk.net> Date: Fri Feb 11 06:37:38 2005 +0000 Bug #826: Make xorgconfig respect font installation outside $PROJECTROOT. (Donnie Berkholz) commit e7369daba58bb4fad5cef37fefbd851e59446045 Author: Egbert Eich <eich@suse.de> Date: Wed Feb 9 11:12:54 2005 +0000 Added PCI2Host bus translations for linux PPC and fixed fixed bugs in macros that apply these functions (Bill Randle Bugzilla #325 and #327). commit aab9a8dd99e52297ed9b40c936600429f38fe9ad Author: Keith Packard <keithp@keithp.com> Date: Wed Feb 9 03:56:35 2005 +0000 Add initial evdev framework commit a85c33b52c40fbae544c7dd40df8c8968e0cf7e9 Author: Keith Packard <keithp@keithp.com> Date: Tue Feb 8 22:45:21 2005 +0000 update Xgl to changes in damage API. Remove some flags to support software mesa commit db2c83551cd3516800b88784c461fb33ee15aacf Author: Keith Packard <keithp@keithp.com> Date: Tue Feb 8 22:43:54 2005 +0000 hw/kdrive/ati/radeon_composite.c Support linear filtering Change how touch screens work -- make them just another 'mouse' device. Add unfinished (and unused) code to accelerate tiled fills. commit 70d3a9192feefd54be93ea71231574c3ed815bf2 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Feb 8 15:20:01 2005 +0000 Updated fix for ABNT2 and HK_Toggle keys. commit 384099457e9d938871019ba2e5afc20280328884 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Feb 8 10:15:49 2005 +0000 Backout ABNT2 and HK_Toggle fix since it broke keys F1 and F4. commit ea5b09f95d6f25d8b0f8858c36b680055edd0da9 Author: Egbert Eich <eich@suse.de> Date: Mon Feb 7 18:16:05 2005 +0000 Save gs register before calling the vm86_old syscall thru int 0x80. This is required for linuxthreads as the TLS uses this register to keep track of local thread storage (Bugzilla #2431, J. Scott Berg). commit 4d55065b35baa7e13f6e726cb9d6675562648000 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Feb 7 15:08:31 2005 +0000 Moved keyboard layout table to external file. commit e132cb7590b5518ef1b7fce5f9151beed916fafc Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Feb 7 15:05:39 2005 +0000 file winlayouts.h was initially added on branch CYGWIN. commit c12ef1b34a55544f54401a5a66a36cd728e2f944 Author: Egbert Eich <eich@suse.de> Date: Mon Feb 7 11:56:31 2005 +0000 Check the pixel clock choosen for a specific refresh rate against the maximally allowed pixel clock when choosing mode lines for VBESetVBEMode() and VESA BIOS version >= 3.0 (Bugzilla #2486). commit 859be7a52b778df8acb676683351a6562a6d4400 Author: Felix Kuehling <fxkuehl@gmx.de> Date: Fri Feb 4 01:14:49 2005 +0000 Applied patch (id=1354) by Mike A. Harris from bug #1901: The attached patch updates a couple of PCI IDs for the Savage driver -- Debian/Ubuntu/Red Hat/Fedora. commit 5feca068d740b165d3c36a690f5a68b7588b6625 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Feb 3 09:58:47 2005 +0000 Bugzilla #1865 (https://bugs.freedesktop.org/show_bug.cgi?id=1865) attachment #1827 (https://bugs.freedesktop.org/attachment.cgi?id=1827): check for va_copy not being defined and use __va_copy if available commit 3dda2fe0e2e7e4d2c058d32fa8691d12386b978d Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Feb 2 18:06:14 2005 +0000 Force ShowWindow if XWin was started via run.exe. Fixes mainwindow not showing bug commit e8d3da3c753677cc1ae86bc5a79f2b7eba181d74 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Feb 2 17:17:56 2005 +0000 Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866) attachment #1819 (https://bugs.freedesktop.org/attachment.cgi?id=1819): Define APIENTRY on windows to prevent <GL/gl.h> from loading <windows.h> removed leftovers from attachment #1818 commit 81b862509c87281705f8a8641c28ae2f45f15751 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Feb 2 15:03:44 2005 +0000 Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866) attachment #1818 (https://bugs.freedesktop.org/attachment.cgi?id=1818): Include Xwindows.h before GL/gl.h on windows to prevent loading windows.h which pollutes our namespace with some symbols. commit b532bfb483cc8ea87c28302e3d676234cab7c3f0 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Feb 2 04:07:04 2005 +0000 Bug #1294: Make sure RenderAccel hooks get wrapped in XAA init. commit 44e2d9167943182fea530dfd7ec16aa53db20f4c Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Feb 2 00:55:21 2005 +0000 xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c //bugs.freedesktop.org/show_bug.cgi?id=825) attachment #956 (https://bugs.freedesktop.org/attachment.cgi?id=956): Fix build problems on Linux/SPARC. Patch by Jeremy Huddleston <eradicator@gentoo.org>. Approved in the 2005-01-31 Xorg release-wranglers phone call. commit 15c555a25df76e0e95bc8eaa2ca7ec80a7695a6c Author: David Reveman <c99drn@cs.umu.se> Date: Tue Feb 1 21:22:02 2005 +0000 Use negative stride for trapezoid masks in Xgl commit 2f0bdf77dd37d1763c4f4f409d55a6aad6031b9f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Feb 1 18:14:01 2005 +0000 xc/programs/Xserver/xkb/ddxLoad.c Bugzilla #2245 (https://bugs.freedesktop.org/show_bug.cgi?id=2245) attachment #1649 (https://bugs.freedesktop.org/attachment.cgi?id=1649): cleanup the generation of xkbcomp command lines. Allocate them dynamicly and remove unmaintainable length calculation. commit d3ca132061a861cb9292b5a95dbcb2f67695883b Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jan 31 10:49:30 2005 +0000 winmultiwindowwindow.c Create windows with SWP_NOACTIVATE flag (updated) (Kensuke Matsuzaki) Fixes for window ordering problem (updated) (Kensuke Matsuzaki) commit 374b9aa8ce14cd20a6768519eee63948c83488d6 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jan 31 10:47:32 2005 +0000 Added hungarian keyboard layout. commit 8d277ceb22929fcb44f2d4def8c5b70535eb087f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jan 31 10:43:37 2005 +0000 winmessages.h winmsg.h winmsg.c winmultiwindowwndproc.c winwin32rootlesswndproc.c Make logging of messages configurable with environment variables commit 2982d173cad762b801869b7ceacc237afdad88d6 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jan 31 10:32:19 2005 +0000 resolve SHGetFolderPath dynamicly since it is not available on all Windows systems. commit 8ac3be3f6c4bcaa8c3f6080cbfe72db4967feff8 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Jan 30 21:18:46 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=1692> Remove reference to nonexistent Monitors file from xorgconfig (Report & patch from Dejan Lesjak <dejan.lesjak@ijs.si>) commit 206072c475408b8d4cfd75d897854d8478fe0905 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Jan 30 20:12:07 2005 +0000 programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c Fix option dontVTSwitch under *BSD, when XKB is disabled. Bugzilla #2252. commit 327922f006dcc2e30ec0391d7fa786560fcd1599 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jan 29 01:01:03 2005 +0000 Update to latest rev from http://pciids.sf.net/ Remove entries that now duplicate pci.ids Add entries for new Nvidia boards added in recent nv driver update commit d23c46dd3e2cbf84012055bad43b1bb15809a244 Author: Egbert Eich <eich@suse.de> Date: Fri Jan 28 16:13:00 2005 +0000 Modifying X.Org Xserver DDX to allow to run X with ordinary user permissions when no access to HW registers is required. For API changes which mostly involve the modifications to make the RRFunc (introduced with 6.8) more flexible please check Bugzilla #2407. NOTE: This patch applies changes to OS specific files for other OSes which I cannot test. commit 1562ec5cc3706acfac1db04366f78e4949ef5502 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Jan 27 20:33:34 2005 +0000 Functions like glGenTextures and glBindTexture are in OpenGL 1.1 and can be resolved at linktime. Fixes tuxkart (at least with wine) commit 5ca5fe71119f35f1f24aeb49e2608684024d450a Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 27 05:25:57 2005 +0000 Add an OUT_RING_REG macro for use with DMA_PACKET0, which is like OUT_RING but includes debugging to ensure that the reg being submitted is the one that follows in the packet. Convert most uses of OUT_RING to it, and convert a couple of OUT_REG sets to DMA_PACKET0/OUT_RING_REG. Also, add checking to see if more registers are submitted to a DMA_PACKET0 than should be, to avoid hangs during stupid mistakes (checking for less isn't done). commit 0bd459488bf88084d703d801bfd5e79ea6d2b5a5 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 27 03:52:49 2005 +0000 Move the bailing out due to ATIUploadToScreen() being unfinished up farther, so that the traces aren't as confusing. commit a973af4a9ade68b271d0695898d72aea50d8953b Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 27 03:50:48 2005 +0000 Remove an unused field. commit 59c7005bb155393c44792d457d98d72e34bb1b51 Author: Egbert Eich <eich@suse.de> Date: Wed Jan 26 15:50:17 2005 +0000 When we tested if a PCI base address was unassigned we didn't take into account that this bar could have been the upper part of a 64bit base address. This fix makes this code 64bit bar aware (Bugzilla #2382). commit 7c3dd0a5a76bea2c64972ae19d99775b5a992513 Author: Egbert Eich <eich@suse.de> Date: Wed Jan 26 15:45:49 2005 +0000 Rewrite of RemoveOverlaps() to make the code more readable. It was virtually impossible to determine if the old code did what it was supposed to do. Also changed paradigm: Trust the based address more than the (guessed) size. (Bugzilla #2383) commit 9817582328cdafee59de616136172c2ce361a4b3 Author: David Reveman <c99drn@cs.umu.se> Date: Wed Jan 26 10:58:52 2005 +0000 Xgl improvements commit 13b5a93b70839053b9165b5087872164f0612536 Author: Egbert Eich <eich@suse.de> Date: Tue Jan 25 10:08:18 2005 +0000 Fix interpretation of 64bit PCI bases: read hi long word from the right bar (Michael Yaroslavtsev, Bugzilla #2322). commit 8813898ef6b9eb470e079bcdcffa89d1243b63b9 Author: Keith Packard <keithp@keithp.com> Date: Tue Jan 25 06:04:21 2005 +0000 Fix R100 text by forcing the 3d engine to idle before executing more 3d commands. Add docs for the ISYNC_CNTL register, which doesn't quite do what we want. commit 33155b4fd3ce025d555f07833f96b760d5cdfbd3 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Jan 25 03:37:05 2005 +0000 Finish converting RB2D_DSTCACHE to RB3D_DSTCACHE. Remove an extra pixel cache flush in the idle function. Init an extra reg for r200, and annotate the TCL_BYPASS better. Also, clean up some style nits from the last commit. commit 3b1f1508b13520626839d45185dec09a42b9ff71 Author: Keith Packard <keithp@keithp.com> Date: Tue Jan 25 02:39:48 2005 +0000 Add tracing. Hack Radeon cache registers to use 3D addresses. Works on M6 commit 6eaca06dac037851ae5c9575048faf932ad5ffc8 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Jan 25 01:40:18 2005 +0000 Fix a leak of a region when the driver's CheckComposite fails. commit 8a1bee8ea9a028eef65b8884f73a79fbe84a9f3a Author: Eric Anholt <anholt@freebsd.org> Date: Tue Jan 25 01:38:26 2005 +0000 Silence a warning about uninitialized variable (though it would be). commit 67eeede4e16324990e1a6afc237a3f51b8edea39 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jan 24 20:44:49 2005 +0000 Bug #2004: Make DDC delay slightly longer. (Thomas J. Moore) commit 55736aa8c17f762b15e9bcd7b3f68f8680b7cb33 Author: Egbert Eich <eich@suse.de> Date: Fri Jan 21 14:25:26 2005 +0000 Alan Cox requested that we check the kernel version before we use kernel VGA font save/restore as the required features have been added to Linux 2.6.11 (Bugzilla #2277). commit d7263b11f043c8c0f83d6e05095143c70177926b Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 20 20:51:27 2005 +0000 Reinitialize offscreen memory before enabling cursor on VT switch-to commit 13c6b2f0b6c464ce11f6c332b2fa1a529bdbab01 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 20 16:22:04 2005 +0000 Add a set of macros for dealing with the repeated code to wait for a while reading a register/attempting DMA. Now it'll wait for a certain number of seconds rather than a certain number of times through the loop before deciding that it's timed out and resetting the hardware. Also, add more timeout handling, and reset the draw state after resetting the engine. commit dbe45c71590ac319250d04a2bf37ec07cd79e42a Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 20 07:28:02 2005 +0000 Use RadeonSwitchTo3D() instead of doing the WAIT_UNTIL ourselves (RST3D() also does DC_FLUSH, which may be important). commit fc43c154943fb1d277a9cffa9a4db7e76db461bc Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 20 07:09:00 2005 +0000 Add R200 XV support, and make R100 (hopefully) use linear filtering instead of nearest. Also, use RadeonSwitchTo3D instead of doing the WAIT_UNTIL ourselves. commit 77755065345eb71c997c1ff74dcfd2b2bbbf1305 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 20 01:09:48 2005 +0000 Make R200 PDMA work -- primary queue sizes are now 9 bits, not 8. commit 9bd876768b2165ec3903ad0848ae2ae950330290 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Jan 19 22:23:20 2005 +0000 Fix debugging ErrorF() so it compiles when DEBUG is true. commit ff433adba3a643512fdd44e41cd08965fab9c9cb Author: Keith Packard <keithp@keithp.com> Date: Wed Jan 19 06:35:28 2005 +0000 Prefer 32bpp to 24bpp. Fix 16 color planar mode (!) commit cbcdae5a3f7c4009121f86de52bba6c657f20fff Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jan 17 17:17:45 2005 +0000 more static server build fixes commit 79a7120983eff6fa114d4250fe01b62d4a99a612 Author: Adam Jackson <ajax@nwnk.net> Date: Sun Jan 16 01:59:23 2005 +0000 Bug #1895: Fix fbComposeGetSolid for BGR. (David S. Miller) commit 24cdd188dc3c10b56d6a7b46dafefb16c6d13efc Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Jan 14 22:07:59 2005 +0000 Fri Jan 14 17:03:40 2005 Søren Sandmann <sandmann@redhat.com> Fix from Keith Packard for bitgravity bugs in the Composite extension, reported by Amir Bukhari. commit 7db2e666e2dc9a1dba468e35e9d382e76ed8be54 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Jan 14 21:56:51 2005 +0000 Fri Jan 14 11:12:46 2005 Søren Sandmann <sandmann@redhat.com> Use mmx CopyArea in a few more places. commit 761f937fdee9ccd10ad54c1f06e12f2f102547a6 Author: Egbert Eich <eich@suse.de> Date: Fri Jan 14 19:29:18 2005 +0000 - Don't suspend Xserver on APM standby request as this seems to cause problems on may systems which don't support APM standby and might not be required as according to the APM specs the chips should receive enough power to retain its state. - Print out power state change requests to log file in all verbosity levels. - Don't change server state if no driver PM function is registered. (Bugzilla #2279) commit 16f9d2d72a2378470e9c5b31c59fa6c9a00892d6 Author: Egbert Eich <eich@suse.de> Date: Fri Jan 14 18:42:26 2005 +0000 Let the OS instead of X save/restore text console fonts on Linux. So far we relied on the generic VGA layer to restore text console fonts for us when shutting down the server or VT switching back to the text console. This has worked rather well but it has some downsides on Linux: a. Many people use fbdev as console text mode. In this case it is not necessary to save/restore console fonts as the console is running in graphics mode anyway. b. Some architectures don't have a fbdev console but require a full POST of even the primary card (ie. IA64). This posting has to take place before we even have a chance to save anything. Therefore the fonts we save are the once written to the chip by POST, not what has been programmed by the user. c. Certain chipsets utilize the BIOS to perform mode setting. This may interfer with the vga save/restore font function in a strange way. It would therefore be preferrable to let the OS - which has been used to set up the font in the first place - take care of saving/restoring the data. I will attach a patch which will do so for Linux. To make this fully functional a small patch needs to be applied to the Linux kernel. To disable this feature add: #define DoOSFontRestore NO to your host.def. (Bugzilla #2277) commit 6c0b03a2362f33ae24a2f6845ed1418c9af4b8bc Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jan 14 17:14:08 2005 +0000 Build fixes for static server. commit df4a1fa9c5cc5d54a9347a2bf4843cae87a942f1 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Jan 14 12:17:10 2005 +0000 Added copyright notice. commit 2137bc6eb9f36f4ba999023d83c637024f3a6e4c Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Jan 14 08:37:30 2005 +0000 xc/programs/Xserver/afb/afbbres.c xc/programs/Xserver/afb/afbbresd.c xc/programs/Xserver/afb/afbclip.c xc/programs/Xserver/afb/afbhrzvert.c xc/programs/Xserver/afb/afbline.c xc/programs/Xserver/afb/afbmodule.c xc/programs/Xserver/afb/afbpixmap.c xc/programs/Xserver/afb/afbpolypnt.c xc/programs/Xserver/afb/afbpushpxl.c xc/programs/Xserver/afb/afbtegblt.c xc/programs/Xserver/cfb/Imakefile.inc xc/programs/Xserver/cfb/cfballpriv.c xc/programs/Xserver/cfb/cfbbitblt.c xc/programs/Xserver/cfb/cfbcppl.c xc/programs/Xserver/cfb/cfbgc.c xc/programs/Xserver/cfb/cfbglblt8.c xc/programs/Xserver/cfb/cfbmap.h xc/programs/Xserver/cfb/cfbpixmap.c xc/programs/Xserver/cfb/cfbscrinit.c xc/programs/Xserver/cfb/cfbtab.h xc/programs/Xserver/cfb/cfbteblt8.c xc/programs/Xserver/cfb/cfbunmap.h xc/programs/Xserver/mfb/maskbits.c xc/programs/Xserver/mfb/maskbits.h xc/programs/Xserver/mfb/mergerop.h xc/programs/Xserver/mfb/mfb.h xc/programs/Xserver/mfb/mfbclip.c xc/programs/Xserver/mfb/mfbfont.c xc/programs/Xserver/mfb/mfbgc.c xc/programs/Xserver/mfb/mfbmisc.c xc/programs/Xserver/mfb/mfbpushpxl.c //bugs.freedesktop.org/show_bug.cgi?id=1114) attachment #667 (https://bugs.freedesktop.org/attachment.cgi?id=667): Convert afb and cfb{,16,24,32} to be dlloader-friendly. Patch by Adam Jackson <ajax@freedesktop.org>. commit 61b3c3aef5437f14d413a60da792257b01e9f8fa Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Jan 13 23:07:41 2005 +0000 Thu Jan 13 17:45:13 2005 Søren Sandmann <sandmann@redhat.com> Make sure the pixmap is a valid new resource Make sure the context is a legal new resource. Handle null attrib_list. Handle null attrib_list; copy attrib_list to data; actually allocate the new GLXDrawable. commit 433c38f22fa96486a43dc0c9871cc09875251b34 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Jan 13 20:49:21 2005 +0000 Thu Jan 13 15:40:29 2005 Søren Sandmann <sandmann@redhat.com> Add MMX implementation of non-repeating source IN repeating mask, aka "translucent window". Add MMX implementation of CopyArea. Use MMX implementation of CopyArea. Use the new implementations. commit a303670107f205c6ca76919ca6cd6af6013073f1 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Jan 13 01:22:53 2005 +0000 Bug #2114: PPC64 Linux build fix: use system definition of eieio(). Originally Gentoo bug #66223. (Tim Yamin, Donnie Berkholz) commit 15895b411779aa3c14ffb92fb58cd8ec24845ea7 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Jan 12 16:10:00 2005 +0000 winmsg.c Introduce function winTrace which prints log message with verbosity 10 Use winTrace for 3 heavily called functions commit 8aabc94596dae0fd4ce2c975de75946685faf2cd Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jan 11 17:33:03 2005 +0000 Document the -silent-dup-error switch commit b6301dc41090899b20003eab1356bc09fc5eed1a Author: Egbert Eich <eich@suse.de> Date: Tue Jan 11 14:59:02 2005 +0000 Minor format fix. Added explanatory comment and debug code. Added comment. commit 27fc6874b34d70a7ddae5ed8f516f6cfaab518b8 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jan 11 12:03:34 2005 +0000 Do not grab ALT-TAB when window is in multiwindow mode commit d365664c58919edb5e121a7c884384438df79776 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jan 11 11:58:12 2005 +0000 Fix crash with not matching definitions of PATH_MAX commit 65b893a707ad8b3e4d0971825c05a965dca36d10 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Jan 10 23:38:50 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2167) attachment #1641 (https://bugs.freedesktop.org/attachment.cgi?id=1641): Fix broken Solaris print queue enumeration. commit c6b5a9431178ac7eb90ec498e6830366865d1268 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Jan 10 18:47:55 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2254) attachment #1659 (https://bugs.freedesktop.org/attachment.cgi?id=1659): Refix for gcc4.0 build failure. It seems that the |ExecCommand()| function has no consumer and can safely be removed. commit eb701e9b4481f984fdcfece181126f7424e2bf45 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jan 10 17:54:31 2005 +0000 winkeybd.h Adjust keysyms for Hiragana_Katakana toggle and backslash/underscore on Japanese and ABNT2 keyboards commit 2ef9d01c4d3b03f0a5d829304f2a7e2cc1327f3b Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Jan 10 14:16:29 2005 +0000 xc/programs/Xserver/Xprint/Util.c xc/programs/Xserver/Xprint/attributes.h //bugs.freedesktop.org/show_bug.cgi?id=2254) attachment #1654 (https://bugs.freedesktop.org/attachment.cgi?id=1654): Fix gcc4.0 build failure. Patch by Egbert Eich <eich@freedesktop.org> and Roland Mainz <roland.mainz@nrubsig.org> commit 57387e115caf5a4b9501cc8f6ddeb1946b0e6547 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jan 10 13:13:08 2005 +0000 winkeybd.h winkeyhook.c Make keyhook feature work in multiwindowmode too Hook windows keys commit f417159e51afe22de7d4e6ba9f154313c6af59bc Author: Egbert Eich <eich@suse.de> Date: Mon Jan 10 12:20:33 2005 +0000 Make option 'DontVTSwitch' work again with kbd driver under Linux. The kbd driver now calls the OS layer to handle special keys. Possibly other special keys and other OSes need to be looked at also. (Helmut Fahrion). commit fe4e74241f6791cb1cefdddeb492ed0f56ce99b4 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun Jan 9 17:35:47 2005 +0000 xc/programs/Xserver/xkb/ddxList.c //bugs.freedesktop.org/show_bug.cgi?id=2245) attachment #1647 (https://bugs.freedesktop.org/attachment.cgi?id=1647): export Win32System and Win32TempDir remove #ifdef WIN32 block for building xkbcomp commandline create win32 tempfile in system tempdir use PATH_MAX*4 for commandline buffer unlink tmpfile again commit ba25f7e8dcaa2690ce3eab839904fac034002e0b Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun Jan 9 15:29:45 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2245) attachment #1645 (https://bugs.freedesktop.org/attachment.cgi?id=1645): cleanup some #ifdef __UNIXOS2__ and WIN32 blocks. make OutputDirectory check the size of the buffer quote all file and pathnames in the xkbcomp commandline use PATH_MAX*4 for commandline buffer commit 2410b61f430c3ac4be79043f8b00defe6d53148c Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sun Jan 9 00:38:08 2005 +0000 //bugs.freedesktop.org/show_bug.cgi?id=2240) attachment #1642 (https://bugs.freedesktop.org/attachment.cgi?id=1642): Fix incorrect usage of /usr/bin/tr in startup script (the used "[\n]" is neither correct or portable, using "\n" seems to be sufficient (this fixes various "random" issues, including including Debian bug #258419 and Debian bug #264983). Patch by Drew Parsons <dparsons@debian.org>. commit 709a2343a8c12ea7e158c63a9737b11744b50994 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Jan 8 13:01:03 2005 +0000 Fix a possible null-pointer dereference (Keishi Suenaga) commit d332a909f8b8741af75047d78a62a3d19e0776e1 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Jan 6 21:29:09 2005 +0000 Imakefile InitOutput.c XWin.rc winerror.c wintrayicon.c winvideo.c winshaddd.c Set PROJECT_NAME in Imakefile to create alternative window titles for Cygwin/X and Xming commit d6a74f2c4aec9c914ec0837bd0bf0d212019093f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Jan 6 16:02:47 2005 +0000 Imakefile InitOutput.c XWin.rc winerror.c wintrayicon.c winvideo.c Set PROJECT_NAME in Imakefile to create alternative window titles for Cygwin/X and Xming commit 3165236483de936b4ca22f8b6d2d2b8b1a1a4909 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Jan 6 13:24:57 2005 +0000 Fix crash with non-nullterminated strings (reported by yvind Harboe) commit 591ac9c811de0871d3bdcc19cada0ff6715bf67c Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Jan 4 00:16:20 2005 +0000 Bugzilla #2211 (https://bugs.freedesktop.org/show_bug.cgi?id=2211) attachment #1627 (https://bugs.freedesktop.org/attachment.cgi?id=1627): xorgconfig default keyboard model outdated (should be pc105, not pc101/pc102) commit af8bd7161724b6709ffe582dfd830c05d9bf4f26 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Jan 3 21:32:22 2005 +0000 Mon Jan 3 12:45:10 2005 Søren Sandmann <sandmann@redhat.com> Clean-ups and support for AMD64. Bug 1067. Patch by Nicholas Miell (nmiell@comcast.net) Add support for AMD64 Many cleanups using <mmintrin.h> instead of __builin_ia32_*, and intrinsics instead of inline assembly. Also unconditionally use pshufw on AMD64. s/USE_GCC34_MMX/USE_MMX/g commit 5f39eff85109a73d006832ad35d9d5b58f93ef0c Author: Egbert Eich <eich@suse.de> Date: Mon Jan 3 15:43:55 2005 +0000 Added missing return value (Bugzilla #2205) Problem found by Stefan Kulow. commit ae6d52092bca6068a7847b3944148336ab489869 Author: Egbert Eich <eich@suse.de> Date: Mon Jan 3 15:39:35 2005 +0000 Added missing return value (Bugzilla #2206) Problem found by Stefan Kulow. commit 83e13e21c8d9a3b54cae2ecc2943be3316659870 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Dec 24 14:40:28 2004 +0000 Print error message if CreateProcess fails Simplify popen simulation code for WIN32 Remove temporary file after executing xkbcomp commit 106703edf67139fa52f6810f9ced0ce5ba86a3cd Author: Eric Anholt <anholt@freebsd.org> Date: Wed Dec 22 18:39:41 2004 +0000 Back out the previous day's broken R200 "fix" -- the same number of coords are always emitted. Fix the real problem, which was not enough regs being initialized in ati_draw.c. Fix a typo that was resulting in alpha coming out as 0 * src or 0 * broken instead of src * 1 or src * mask. Assign the blending results to R0, as appears to be necessary. Unbreak the dst-alpha-blend-with-no-dst-alpha code. Yow. And set the right DMA count for the r200 traps code. commit 3035739e5b7d5a9042292d64455feb4b38788fe4 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Dec 22 08:28:16 2004 +0000 Bug #2123 <https://bugs.freedesktop.org/show_bug.cgi?id=2123> Attachment #1587 <https://bugs.freedesktop.org/attachment.cgi?id=1587> Call to uname should not check for return == 0, but for >= 0 instead commit fa0677ab43722462042f87c4636a7d59d1cb873f Author: Eric Anholt <anholt@freebsd.org> Date: Tue Dec 21 09:51:47 2004 +0000 Fix r200 render (for real this time?) by setting tex1_comp_cnt right for non-mask rendering. Reenable it. Also, R200TexFormats was used instead of R100 in one place. Harmless so far, because the formats were in the same order. commit 4b0247b9e0a6b7f40cd2738fb29d2ed1acba99e7 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Dec 21 09:49:30 2004 +0000 Whitespace nit. commit 894431412613265fd315cf7a707ffa741f93cf47 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Wed Dec 15 20:51:25 2004 +0000 Use snprintf. commit eea11301fd9247a28b1daeb340a018c7ea309c41 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Wed Dec 15 15:05:35 2004 +0000 Another fix for MiscPassMessage(): Initialize returned "status". commit 264c3eefe6c0cdee1ff0a5de914f051ab23026b7 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Dec 15 12:22:39 2004 +0000 latest changes from CYGWIN commit c7fec26b50f8a64360d1252cdf48370935fb2f76 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Wed Dec 15 00:32:56 2004 +0000 Make MISC extention's PassMessage() actually work and fix memory leaks commit d0b17bda4dc469e2ce72f4f8965916b316e1deb7 Author: Egbert Eich <eich@suse.de> Date: Tue Dec 14 08:59:20 2004 +0000 Removed #ifdef'ed out code together with the comment explaining why it was #ifdef'ed out. Fixed typo. Added comment to a changed that's been committed with one of the previous commits. commit 0e6a122316a94c96051f1d832990032a386097bc Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Dec 13 03:42:32 2004 +0000 //bugs.freedesktop.org/show_bug.cgi?id=1695) attachment #1230 (https://bugs.freedesktop.org/attachment.cgi?id=1230): Fix crash in Xscreensaver code which allowed any authentificated X client to crash the Xserver using |XScreenSaverUnsetAttributes()|. Patch by ajax@nwnk.net commit 159e443a2209eb3ea305e84b847b76ef1637d005 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Dec 13 02:13:32 2004 +0000 //bugs.freedesktop.org/show_bug.cgi?id=1688) attachment #1530 (https://bugs.freedesktop.org/attachment.cgi?id=1530): Fix the current implementation to make it possible to slow down the mouse pointer or use arbitrary fractions (without running into rounding error issues). The change is using the same method of preserving rounding errors that the exponential method is already using. Patch by Jan Brunner <Jan_B@gmx.ch>. commit f1768677f73150c686cf5678f5f5d63c0cfa8e56 Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Dec 12 23:29:20 2004 +0000 Reduce vidmode logging. commit 9286a5d032ea6bed102db39281c3d2537da4dccc Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Dec 12 22:58:37 2004 +0000 Add fix for 460gx pci scan code. commit 8266a2581d21a1a2880a0e8babb8b0305c435ec0 Author: Torrey Lyons <torrey@mrcla.com> Date: Thu Dec 9 22:40:35 2004 +0000 Fix crash with more than one screen reported by John Davidorff Pell. commit 081b33d73f73572cfefba7e5489408a7117b6e9f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Dec 8 15:48:15 2004 +0000 import changes from CYGWIN branch commit 6c317c1c1323bd11292f8f9f179d75c96a18e616 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Dec 8 05:52:20 2004 +0000 //bugs.freedesktop.org/show_bug.cgi?id=1361) attachment #1287 (https://bugs.freedesktop.org/attachment.cgi?id=1287): Avoid DRI initalisation when the Xfree86-DRI extension was turned off. Patch by Kristian Hgsberg <krh@bitplanet.net>. commit b9476cd96faf19153c11e3370e9fced8045600f4 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Dec 8 05:48:16 2004 +0000 //bugs.freedesktop.org/show_bug.cgi?id=1361) attachment #938 (https://bugs.freedesktop.org/attachment.cgi?id=938): Allow more extensions to be enabled/disabled. commit 47935dd7f010f2f77768774ceb6f85667efe4264 Author: Matthew Allum <breakfast@10.am> Date: Mon Dec 6 22:29:31 2004 +0000 Xephyr on Xorg fix commit 8091b301c941473ab99626a6e66f72acdb6750f7 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon Dec 6 21:54:19 2004 +0000 xf86Config.c references USE_DEPRECATED_KEYBOARD_DRIVER so define it if needed when building this file - bug fix: pointerMsg -> keyboardMsg in auto-configuration code. - make the 'kbd' driver the default for autoconfiguration everywhere. commit cde3a175005104e061c1ff133f07c598868bdc4e Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Dec 6 18:28:12 2004 +0000 include windows.h commit 9c94971617db11861aed82e16804fc14a9ca1260 Author: Egbert Eich <eich@suse.de> Date: Mon Dec 6 15:53:00 2004 +0000 Use the same method of finding the screen pixmap of COMPOSITE extension is compiled in or not. Removed stale make variable. Updated xaaWrapper.c: Under certain circumstances the accel path was not used when possible. Removed some debugging stuff and stale code that had been commented out. Check if maps are really installed before attempting to list them. commit 4945034792b28d1a222a615404bfceaf48a130c5 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Dec 6 12:26:50 2004 +0000 problem with max() macro. this one slipped though again commit 531776becf95f66e6e435aad0dc21ead436ff5aa Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun Dec 5 21:33:23 2004 +0000 missed another wBOOL issue commit 9bd1328c49aafae67a6a6d9fd17063c75d8547a2 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun Dec 5 21:24:48 2004 +0000 redone ddraw.h to be able to mix it with w32api style COM header files. obj_base.h is not needed anymore. Using <objbase.h> instead. Use Xwindows.h instead of windows.h do not include win_ms.h remove extra definition of sleep() Set HOME to Documents and Settings/username if not set Use Xming basedir instead of ProjectRoot for system.XWinrc Fix callback functions to use wBOOL instead of BOOL Fix compiler warnings. Added debug output. Fix warning about undefined macro max commit bf0a760331e2fe4dbc00e78f87022c7464d9ca4f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sun Dec 5 04:39:34 2004 +0000 //freedesktop.org/bugzilla/show_bug.cgi?id=1800): Fix Postscript DDX's 1bit StaticGray visual to report only 1bit of significant bits in color specification (instead of 8bits). Patch by Julien Lafon <julien.lafon@gmail.com> commit 44f4713a056b7a6a076b2f65fbed43e0cfe9ff06 Author: Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk> Date: Sat Dec 4 00:43:13 2004 +0000 Encoding of numerous files changed to UTF-8 commit f264a7ea741f57fbc3bb900cfbb9e0cc23f46e90 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Dec 3 12:04:15 2004 +0000 Removed scprintf, aprintf and snprintf stuff and use newXprintf commit 16a683f4d164899ecfdafb853f48cff10fd13fd4 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Dec 3 11:57:42 2004 +0000 Bugzilla #1865, https://bugs.freedesktop.org/show_bug.cgi?id=1865 Added X(NF)printf and X(NF)vprintf functions which allocate the buffer with X(NF)alloc Bugzilla #1865, https://bugs.freedesktop.org/show_bug.cgi?id=1865 extend snprintf to work on NULL. commit fe2a2213d1db8700f6078379f86ebe8827793c20 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Thu Dec 2 23:47:39 2004 +0000 //freedesktop.org/bugzilla/show_bug.cgi?id=1998): Fix Xserver standalone build when RENDER extension includes are not availabe. commit 30a4202f3d59a32fd6f93dfd257d93ee21b68ed9 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Dec 2 21:58:58 2004 +0000 Use __printf__ in gcc function attributes to avoid clash with libc wrapper define, and remove the last bits of the old workaround. commit e62d85baa31fc853aefdef49962ad4cb86ae8245 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Dec 2 21:49:54 2004 +0000 Remove some of the ifdef WIN32 checks from WaitForSomething commit 2782b8871196ef28f9a6c84bf6c8b5086d00d5d4 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Dec 2 14:19:01 2004 +0000 Adjust the width of the rootless backbuffer to match 32 bit alignment Make multiplemonitors default for -internalwm commit 3b3e24dc4d89b471d80428dd9ad122f259b1fc81 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Dec 2 13:38:30 2004 +0000 Set HasFfs to NO Fix link order problems with mingw. Add libdix.a after libmi.a. Pass -DHAS_FFS to compiler remove inline code for ffs(). It will link to dix/ffs.c instead added declaration for ffs() commit 2620676306d1eccd24a6bf0637a60842656e6f7c Author: Phil Blundell <pb@reciva.com> Date: Wed Dec 1 19:43:29 2004 +0000 Patch from Florian Boor <florian.boor@kernelconcepts.de>: Check return value from ts_config. (TslibInit): Likewise. commit 96545d038837bbc7dc435ed7c1f631454e86cecb Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Dec 1 14:57:45 2004 +0000 Remove code which sneaked in recently. It is not proven to be correct, just a workaround and disabled by default commit 3f063fc49cc2d456359a1b0b9f36f27befdb09b0 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Dec 1 14:16:07 2004 +0000 Set XERRORDB environment variable to relocate the XErrorDB file commit 908442301478b21febab17e31aa55918eaaa5101 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Nov 30 23:43:33 2004 +0000 //freedesktop.org/bugzilla/show_bug.cgi?id=811): Updating generated Xprt.html which was forgotten during the previous work. commit af717ae57dd6c5e6ad41b4142d62cdbb55f13777 Author: Egbert Eich <eich@suse.de> Date: Tue Nov 30 08:38:44 2004 +0000 Make Xorg the default server to install. Avoid PIO access on IA64. Some IA64 machine check if legacy ports outside the VGA range are accessed. The ATi driver however does this to probe for ISA Mach8/32/64. Since no IA64 has ISA slots this restriction should not be relevant to the user. Avoid recursive calls of xf86scanpci(). This function normally detects that it has been called before by checking if the PCI structure is filled out. So far if this was not the case (because PCI probing has failed for some reason) the function is traversed again. With the chipset specific PCI bus probing this can lead to an endless recursive loop as the post-probing code calls xf86scanpci() from within this function. The OS specific PCI code for Linux worked only if bus 0 was populated as it checked for the presence of /proc/bus/pci/00. Fixed to check for /proc/bus/pci/<bus_to_look_for> instead. commit 59ccc6465ca15e046ad11362ae5fbb3c71d2c148 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 29 12:34:55 2004 +0000 Fixed windows.h include for cygwin. Bugzilla #1945: Stop unnecessary reordering. commit df2f2ff5a4ebf6c5289da64bf3f572341a0f7656 Author: Phil Blundell <pb@reciva.com> Date: Sun Nov 28 23:20:17 2004 +0000 Re-read "fix" structure from kernel after mode selection, in case line pitch has changed. commit 6062f6a6e7b3c444a35e3f11b2541df2aa0066a2 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Thu Nov 25 22:42:51 2004 +0000 xc/programs/Xserver/Xprint/Imakefile xc/programs/Xserver/Xprint/Xprt.html xc/programs/Xserver/Xprint/Xprt.man //freedesktop.org/bugzilla/show_bug.cgi?id=811): Add missing manual page for "Xprt" (DocBook master file (Xprt.sgml) and the generated files (Xprt.html, Xprt.man). commit cbce4cf96dfa2eeecb253d73d7d9acecbc52ad67 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Nov 25 12:48:21 2004 +0000 Bugzilla #1914: fix size limit for -fp argument commit 2b75c19ea2bb76512d51e99c5c9ecb073fdb9163 Author: Matthew Allum <breakfast@10.am> Date: Wed Nov 24 17:50:50 2004 +0000 minor Xephyr fix commit a96254234fc9410944406f6ae878815cd3cfcee3 Author: Matthew Allum <breakfast@10.am> Date: Wed Nov 24 17:08:06 2004 +0000 XEphyr -parent switch fixes commit a7a07d0c71aa3f2e224cceea7e8d8348523136ee Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Nov 24 16:56:03 2004 +0000 Finally the multiwindow mode defines a default cursor commit ca4da62478a3ad86ab087245bf8eb7d7fadf31de Author: Eric Anholt <anholt@freebsd.org> Date: Wed Nov 24 09:07:58 2004 +0000 Add <sys/types.h> include to unbreak build on FreeBSD. commit da3df7522d15855fa871c45f3b8db23e7c639a44 Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Nov 24 02:45:33 2004 +0000 Remove this file and all references to the binary expiry code. Remove old obsolete include/extensions/damage.h. Include srvrv_ctrl(xfree86) in macintosh US XKB symbol file so VT switching works again on mac (#1872). Remove out of place #define's of printf to xf86printf. This definition should only be in xfree86/os-support/xf86_libc.h commit 9a26d6f39e199bad287d4e538ef75700a0102788 Author: Thomas Hellstrom <unichrome@shipmail.org> Date: Tue Nov 23 17:29:47 2004 +0000 Bugzilla #1883 (https://freedesktop.org/bugzilla/show_bug.cgi?id=1883): Fix insufficient SHM detection in XvMC local test. Removed reference to getpagesize() which caused linking problems on s390. Reported by Stefan Dirsch <sndirsh@suse.de> commit fec868bf0f67a8f62fc69d55e2ff72b6cacea6f8 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Nov 23 17:10:55 2004 +0000 //freedesktop.org/bugzilla/show_bug.cgi?id=1204): Fix X11 test suite (caused by DAMAGE layer) failure with Xvfb when rendering text using |XDrawText*()| (XDrawText() tests 1, 3, 4, 27, 28, 29, 30, 34, 37, 39, 41, 43 and XDrawText16() tests 1, 3, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 34, 37, 39, 41, 43). Patch by Hong Bo Peng <penghb@cn.ibm.com> and Stefan Dirsch <sndirsch@suse.de>. commit b09f2a0495071a068c2b6b36084c974acf7aab9b Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 22 16:04:04 2004 +0000 Windows does not have ffs() implementation. added one Enable RootlessSafeAlpha and RootlessAcceleration for the Windows port too commit bb43f234c5d418e064c89b928b81b53987f14e92 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 22 15:00:04 2004 +0000 Use GetTempPath for finding a place where to store temporary files on Windows commit bc7493801d1f5177d9ba3fe09accc2a2d72cfe3d Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 22 14:28:25 2004 +0000 Fixes for building multiwindow and internalwm on mingw Changed some debugging output commit 255c3c0e8ca0f402b2c327d70c8a254ba65eda03 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 22 14:12:33 2004 +0000 Xming: Place logfile in users tempdir commit 0f7874cbfc01da339cc6be221351ddffdb37805d Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 22 13:23:25 2004 +0000 Use a simple hashtable as ConnectionTranslation instead of a plain array on Windows because socket fds are not sequential and do not start at 0 commit e6bc551e3451efe4fcbb55475d6d0ff53fcc9807 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 15 18:13:41 2004 +0000 Use CreateProcess instead of system() to spawn xkbcomp on windows. system() can not handle spaces in the path component. Quoted all filenames on the commandline. commit 6618567311f41f5e237f12b4204aa32ce174a514 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 15 15:58:51 2004 +0000 Remove override of HasSnprintf commit 9826b83826190e514ed115e15691ca015780f9bc Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Nov 15 15:06:51 2004 +0000 Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Added mingw (Win32) port commit cecb668149e1956fb29bc89855182349122e2f4e Author: David Reveman <c99drn@cs.umu.se> Date: Sun Nov 14 23:21:29 2004 +0000 Add xglPixmapToRegion commit 343f965749af0a985573c525dc6084c2519b6ffe Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Nov 14 17:29:56 2004 +0000 Fix typos in output file. (Bugzilla #1849, reported by Yi Ren-Chen) commit 636a9e786881dd42cd6fd579e13b7895cf9f10eb Author: Phil Blundell <pb@reciva.com> Date: Sat Nov 13 18:03:16 2004 +0000 Don't leave stale pointers hanging around after ts_close(). (TslibFini): Likewise. commit 36d9e01c0d36eaf0d9cb1e77dd2908b09d55a35d Author: Phil Blundell <pb@reciva.com> Date: Sat Nov 13 16:41:00 2004 +0000 New global variable. (KdProcessArgument): Set it to TRUE on -nozap switch. (KdUseMsg): Add help for -nozap and -rgba switches. Declare. Honour dontZap flag. commit 3b0dce3620e4cce74c3a2c7f9077cc28be11740d Author: Thomas Hellstrom <unichrome@shipmail.org> Date: Sat Nov 13 11:09:23 2004 +0000 lib/XvMC/Imake Added support for automatic loading of the correct hardware XvMC driver. This involves a protocol extension of the XvMC protocol. The XvMC revision number was bumped. commit a97548b1c9bb69b5824609c1da1ad66c3a9c5065 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Nov 11 20:10:28 2004 +0000 Cosmetic fix to make xf86pciBus.c use standard min() macro. commit e5040e24f03a2fe770139e6f37acef3da48aa0f9 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Thu Nov 11 16:09:58 2004 +0000 oops commited wrong version previously commit e380fd548ed5452d08184723145dd992ad72288c Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Thu Nov 11 15:44:31 2004 +0000 update shared lib revisions on OpenBSD (Bug #1828). update references to xf86site.def in comments (Bug #1827). fix kbd driver for wskbd protocol and pure wscons console driver (Bug #1825). don't add '-4' to generated default file name (bug #1826). typo in resource name (XFree86 bug #1300, X.org bug #1825) commit d7f46f71d892768ea85552a0d5458b69b561fe21 Author: Matthew Allum <breakfast@10.am> Date: Thu Nov 11 14:55:30 2004 +0000 Xephyr grab fix commit 2854fa438ff721637f2e53fbafa141b3db8a9082 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Nov 9 17:06:15 2004 +0000 Bug #557: Don't use "bool" as a variable name in xf86cfg, to avoid compiler bugs. (Donnie Berkholz) commit 367b963b6333ee58e197845f1389a95ff26f108e Author: Adam Jackson <ajax@nwnk.net> Date: Tue Nov 9 15:58:41 2004 +0000 Bug #1765: Add support for R_ALPHA_SREL32 relocations in elfloader. Originally Debian patch 202_alpha_elfloader_support_R_ALPHA_SREL32.diff. (Falk Hueffner) commit 50cdff7ee2a1b448da24e85efae02237cff9b6b7 Author: Matthew Allum <breakfast@10.am> Date: Tue Nov 9 11:36:49 2004 +0000 Xephyr improvements commit 81a3b6fe27567b4f91033ece69996aa6bf8d01a3 Author: Matthew Allum <breakfast@10.am> Date: Mon Nov 8 22:39:47 2004 +0000 Add support to Xephyr for lower depths than hosts commit e494e24c508b34b144355cb380aac16abf2fb891 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Nov 6 11:56:57 2004 +0000 Wrap all mwextwm and internalwm code with XWIN_MULTIWINDOWEXTWM commit 16ee24cd994fa3f8d479c972f18c8207a5116cb7 Author: Torrey Lyons <torrey@mrcla.com> Date: Fri Nov 5 19:51:38 2004 +0000 Use ROOTLESS instead of platform specific defines. commit 64c7f8e667eef955b266c359291206c7188ce20c Author: David Reveman <c99drn@cs.umu.se> Date: Fri Nov 5 13:26:07 2004 +0000 Use UTF-8 encoding in Xgl sources commit 1d994e1d14225c1dec5251edeae40e24923a31c6 Author: David Reveman <c99drn@cs.umu.se> Date: Fri Nov 5 12:46:29 2004 +0000 Use negative strides in Xgl if pixel data have bottom-top scanline order commit 2dd76d646c517e1988897692e9ff8b6194d25c87 Author: David Reveman <c99drn@cs.umu.se> Date: Thu Nov 4 23:19:13 2004 +0000 Add working Xgl server code commit 1aef1060647d22b676a29f6dcf1ac54f9fe7ff5d Author: Kensuke Matsuzaki <zakki@peppermint.jp> Date: Thu Nov 4 11:52:22 2004 +0000 Add InternalWM mode. commit 522c878fca3bfe97cd408e37065f827c004faa04 Author: Egbert Eich <eich@suse.de> Date: Tue Nov 2 08:54:53 2004 +0000 Removing unneeded private FreeType2 symbol. Updating to EDID 1.3. (Bugzilla# 1490, Jay Cotton, Egbert Eich). Removing unneeded code. Fixed KGA handling for i810. KGA handling for chips derived from C&T chips is slightly different. The changes make the code consistent with the C&T (chips) and i740 drivers. commit 1074992c285835ca9d96d11e8352bbe2cdbc2a28 Author: Egbert Eich <eich@suse.de> Date: Mon Nov 1 16:05:27 2004 +0000 Fixed sig11 which occured when calling a CloseDisplay() after XScreenSaverSetAttributes() followed by XScreenSaverUnsetAttributes(). Caused by missing FreeResource() in XScreenSaverUnsetAttributes(). Removing unused DDC sections that caused misinterpretation of DDC data due to a missing break statement in a switch. Fixed typo: #if <-> #ifdef. commit 7e588ba9abdcc2078b6c361c81806337b8ff0827 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Oct 30 20:33:43 2004 +0000 Add -d flag for compilers like the Sun C compilers that produce dependency lists themselves. To use with the Sun compilers, add to host.def: # define UseCCMakeDepend YES # define DependFlags -cc $(CC) -d -xM (Sun bug id #4245688 - fix by Alan Coopersmith) Add Solaris to the platforms on which mprotect is run to set execute permissions when necessary. (Sun bug id #6175128 - fix by Alan Coopersmith) Internationalize digital output (Sun bug id #4119396 - fix by Steve Swales), add -bgpixmap option to set XPM file as background (originally from STSF project version of xclock by Alan Coopersmith) xc/programs/xmodmap/handle.c,pf.c xmodmap was printing line numbers which are one too low in error messages (Xorg bugzilla #1739, Sun bug id 4637857 - fix by Sam Lau) commit 612bd1c27322a69a98b59193e7d31501688359bd Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Fri Oct 29 02:07:15 2004 +0000 Add facility for catching signal 4 from driver. This can be used to check for OS SSE support. (Part 2) commit 09fdfaa28d2afe33dfadd4293b39a34da268fbdb Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Fri Oct 29 02:06:17 2004 +0000 Add facility to catch sig 4 from driver. This can be used to check for OS SSE support. (Part 1) commit b0185a4bf77a668e65e94197bdb13331680521c7 Author: Thomas Winischhofer <thomas@winischhofer.net> Date: Thu Oct 28 22:12:23 2004 +0000 Add xf86[GetGammaRamp|ChangeGammaRamp|GetGammaRampSize] to symlist in order to allow drivers to use them commit 9d4823adc8319a20d2ace3d0944ca32e300f6eeb Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Oct 28 14:23:08 2004 +0000 Import recent changes from CYGWIN branch commit db65fce04ddec1dac0d92ad3abc95ab4996bd206 Author: Torrey Lyons <torrey@mrcla.com> Date: Mon Oct 25 19:09:11 2004 +0000 Fix rootless Cygwin crash due to acceleration code illegally modifying a const structure (Reported by Kensuke Matsuzaki). commit a57e85b52357f15f52e81c8d9b310a76e0c62b3f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Oct 25 07:12:21 2004 +0000 Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1664 - RFE: Add support for the DOUBLE-BUFFER extension to the Xprint server and DDX. Additionally a "pixmap-scrubber" optimisation is added to the PostScript DDX to remove all content from a vector pixmap when a |PolyFillRect()| call covers the whole pixmap surface with a solid fill (this avoids that a backbuffer vector pixmap gets constantly filled even when the content is not visible anymore after |XdbeSwapBuffers()| has cleared the hidden buffer with the background color). commit e0cc4871491ab7a8c52749ff2c077d8f11516b15 Author: Phil Blundell <pb@reciva.com> Date: Wed Oct 20 18:06:58 2004 +0000 Add epson. Build Makefile in hw/kdrive/epson. commit 258c9016a0c966187a81f9d956766791d6e8c505 Author: Phil Blundell <pb@reciva.com> Date: Wed Oct 20 18:02:32 2004 +0000 Block SIGIO before disabling input fds. (KdEnableInput): Unblock it after enabling them again. commit cbd5fbcb7e5b802cbcff317fdc2f848043207690 Author: Phil Blundell <pb@reciva.com> Date: Wed Oct 20 08:20:51 2004 +0000 Import Epson 13806 driver from Costas Stylianou: New files. commit 0584d92b36910d42e4fba96cee5f3380eeb3b493 Author: Egbert Eich <eich@suse.de> Date: Mon Oct 18 14:21:46 2004 +0000 Made handling of DevelDrivers for x86-64 more conformant to other platforms. Compress all font encodings (Stefan Dirsch). Fixed warnings. Turn on forwarding XNSpotLocation event to XIM server in OffTheSpot and Root mode (bugzilla #1580, James Su). Added another compose key combination for the Euro symbol (Stefan Dirsch). Added support for UTF-8 in ja_JP, ko_KR and zh_TW locales (Mike Fabian). Changed default encoding for ru from KOI8-R to ISO8859-5 (Mike Fabian). This is the encoding that is also used by glibc. We may break other libcs - lets see who complains. Added explanation for DESTDIR to install to a different directory than /. Added some early bailouts to atiprobe if PCI structure pointer is NULL to prevent sig11. XV support doesn't depend on 2D acceleration any more. This patch removes this limitation from the NSC driver. This is a patch that I have committed to XFree86 a while ago but never ported over to X.Org. Matthieu Herrb contributed some build fixes. Fixing SetDPMSTimers() so that DPMS*Time == 0 disables the appropriate timer. This takes advantage of the fact that TimerSet() with a timeout argument 0 behaves like TimerCanel(). Use /dev/xconsole (named pipe) or devpts for system logger (Werner Fink). Create missing links for backward compatibility to XFree86 (Stefan Dirsch). Changed comment to mention xorg. Changed cursor for the 'kill' action from XC_draped_box to XC_Pirate. If you don't like it we can change it back (original author unkown). Added 'pic' to the man page rendering command pipeline (Werner Fink). Added missing return value (Stefan Dirsch, Roland Mainz) commit 77dab254402073bf96234a6b1056b2277578a976 Author: Alex Deucher <agd5f@yahoo.com> Date: Sun Oct 17 20:29:35 2004 +0000 - Add interlaced support to S3 driver (bug 332, Leo Savernik) - EmulateWheelTimeout (bug 323, Mathias Fröhlich) - single button double-click (bug 322, Rob Brown) commit 9a0cf1eb43878308c0a83e4f935933b647edc6d5 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Oct 17 10:46:14 2004 +0000 Remove some remaining AMOEBA specific code. commit 5505555c15bfa2de1f596ae0997335fdbf07eb5a Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Oct 15 22:29:40 2004 +0000 Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1647 - Fix the problem that |XpSubmitJob()| returns a random value (patch by Stefan Dirsch/SuSE). commit 60caca718d23012c4c85ce70547610fe05168342 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Oct 15 22:08:38 2004 +0000 Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1646 - Fix the problem that |PsCreateColormap()| returns a random value (patch by Stefan Dirsch/SuSE). commit 4782b2f7c10708f9662d9fc743c692d0bec85743 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Oct 15 21:43:31 2004 +0000 Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1637 - Fix problems in oid code which may cause the usage of an invalid string pointer (original patch by Egbert Eich). commit 881b5756dc96dc33f6966ec6fccd324f63559dc2 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Oct 14 23:10:30 2004 +0000 Bug #1628: Convert xf86{BusToMem,MemToBus} to PIC code, eliminating a text relocation and enabling the server to be built as a position-independent executable. (PaX Team) commit a0251ee285e1f1e28d06927d8ab7d35d59fda607 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Thu Oct 14 02:20:52 2004 +0000 Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1629 - Fix crash on AMD64, regression caused by bug 1496 ("Xorg Xprt does not support "*xp-listfonts-mode: xp-list-internal-printer-fonts" to toggle the usage of printer-builtin fonts"). commit 3a055ea35b687e381da4d729dbdd0ebac47f673b Author: Vladimir Dergachev <volodya@mindspring.com> Date: Wed Oct 13 23:02:42 2004 +0000 Modified: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c xc/programs/Xserver/hw/xfree86/drivers/i2c/fi1236.h Squash annoying warning about fi1236_dump_status commit 3364e7fbd44537b98212820fb2b1941abf0d5ef3 Author: Egbert Eich <eich@suse.de> Date: Tue Oct 12 19:13:43 2004 +0000 Set fbdev mode as the default mode on PPC (Olaf Hering). Added support for IBM space saver keyboard (Stefan Dirsch). Added support for Cherry CyMotion Master XPress (Marcus Schaefer). Change order of SetDisplayDevice(), HWRestore(), UnbindGART() and RestoreBIOSMemSize() to be exactly opposite to the Save procedure in EnterVT() (Matthias Hopf, Alan Hourihane). Fix text mode restauration by removing the assumption that the register which determines which head is programmed is set. to the active head by the BIOS (Mark Vojkovich). When I wrote the resource code 5 years ago I made some assumptions which turned out to be false: I've assumed that the bus number of the PCI hostbridge would be the PCI bus the bridge links to. This is not correct. Fixing this assumption is not easy. However I hope that the attached patch will make the system work regardless as it 'ignores' host bridges from which the target bus is not known. This should not matter at all as we really don't care about host bridges (unless we have bridge specific code which retrieves information about the bridge). Fixed server crash on reset when a structure allocated in PreInit() was freed on CloseScreen(). Fixed ring buffer lock ups that happened because the structure that contained ringbuffer data was not zeroed after allocation. Fixed numerous warnings due to signed unsigned comparisons. programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c: (NVBacklightEnable): Changed the order in which the sequencer registers and the backlight control registers are written. The sequencer control register need to be written first otherwise DPMS screen blanking produces vertical bars on a mobile device. lib/Xau/Imakefile: Build libXau static library PIC so it can be linked into toolkits that would like to wrap its functionality. commit 4ab7d316eceb23c81c1b208f9291750cf6b37513 Author: Egbert Eich <eich@suse.de> Date: Mon Oct 11 09:58:04 2004 +0000 Improving DPMS handling on VT swich and server termination/abort: previous version called the driver directly and too late. Unblank secondary screen explicitely. Don't rely on the value read during register save as the BIOS have blanked the secondary head. Checking if server isn't switched away before calling sync. Sanity check for possible bugs in aother areas of the code. Fixing default amount of of allocated video memory from AGP for i810: Use 16MB if less than 192MB are installed else use 24MB (Matthias Hopf). commit ca1fda2a3f674a6d59de236612c7077387738ec3 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun Oct 10 17:48:43 2004 +0000 programs/Xserver/Xext/saver.c Fix for XFree86 bugzilla #1224. commit fa9847aeb9094aafc3798aee1fc8379e77a18d6a Author: Torrey Lyons <torrey@mrcla.com> Date: Fri Oct 8 00:35:08 2004 +0000 Allow rootless implementations to override frame reordering. This is used on Mac OS X when genie-restoring from the Dock to ensure that the animation completes before drawing the frame. commit d737bc3300cf1847bcea08ca781f37ee3ee62692 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue Oct 5 17:28:15 2004 +0000 Make xorgconfig ask again instead of giving up and throwing away all your answers when you give a bad file name or bad amount of video RAM. (Sun bug id 5070654 - Derek Wang) commit 75217be88ccb87a54c84e31697ffb98b5f9b8e0a Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Oct 4 05:34:32 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=661 - Xprt producing spurious characters in PS output when using the bitmap cache (Originally reported against Solaris Xprt as Sun bug id #4369307, and fixed in Solaris by Jay Hobson. commit 658b4ed81f777df2d8b9f47904de90bde1897113 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Oct 4 05:04:14 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1299 - Add more visuals to the Postscript DDX (8bit GrayScale/StaticGray, 1bit StaticGray and the basic infratructure for "deep" visuals with more than 8bits per RGB gun). commit e622b346113f65788110777d7d1b5fc436600a4d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sun Oct 3 23:29:21 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1496 : Fixed Xprt font handling which did not support "*xp-listfonts-modes: xp-list-internal-printer-fonts" or "*xp-listfonts-modes: xp-list-glyph-fonts" to toggle the usage of printer-builtin and glyph fonts in XListFonts*(), XLoad*Font(), etc. Additionally the Xprint DDX now explicitly list "xp-listfonts-modes" in "document-attributes-supported" (for document-level) or "xp-page-attributes-supported" (for page-level) when the DDX implements this feature (as described in the CDE DtPrint specification). commit 8b2f127ea0db2c7fee223b69f4fceee0427fb2e4 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sun Oct 3 15:34:33 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1416 - Fix Xprt PostScript DDX crashes when copying offscreen pixmap content to the same pixmap. commit 7b27bf869dcf02bccf730706fc451c6f4c72b1f0 Author: Vladimir Dergachev <volodya@mindspring.com> Date: Sun Oct 3 15:01:31 2004 +0000 Modified: xc/programs/Xserver/hw/xfree86/drivers/i2c/fi1236.c Make sure formatting style is consistent within a single function. MT2032 functions are best be in separate file anyway. commit 4046653cb63f4cd752212e7cf65fad5408d8f5b8 Author: Vladimir Dergachev <volodya@mindspring.com> Date: Sun Oct 3 14:38:31 2004 +0000 Modified: xc/programs/Xserver/hw/xfree86/drivers/i2c/fi1236.c Fix compilation with gcc 3.4.x Cleanup xf86DrvMsg noise. commit ebe7b3fe160259b6f19fe760d6ff4f5bb1dd4b72 Author: Vladimir Dergachev <volodya@mindspring.com> Date: Sat Oct 2 01:35:33 2004 +0000 xc/programs/Xserver/hw/xfree86/drivers/i2c/*_module.c Change version strings to XORG. commit 0d474149f1cb68a60927529f6eac611a12acf5e6 Author: Vladimir Dergachev <volodya@mindspring.com> Date: Thu Sep 30 22:58:07 2004 +0000 Initial code from GATOS. This needs to be cleaned up, for example the bt829 code is practically untouched since xatitv (which was a standalone test program). However, it all worked and was debugged over long period of time, so I prefer to to mess with these for now. New drivers: fi12xx (including MT2032 - this would be be split off later). tdaXXX msp34xx bt8xx commit 1dfafe2aeec864a9bdfd6da3324243b2be8e3a62 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Sep 29 04:17:44 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1489 - Use |long| instead of |int| for BIGREQUESTS commandline option. commit de89181444a2f2258a446fe20a25e37fd225a568 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Sep 24 02:11:14 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1453 - Fix spaces in usage output for BIGREQUESTS extension (option "-maxbigreqsize"). commit 884cb060eea2b914191c269a0c9955ed83d07ff9 Author: Torrey Lyons <torrey@mrcla.com> Date: Wed Sep 22 23:52:39 2004 +0000 Update XDarwin project to Xcode 1.5 format and remove unused QUARTZ_SAFETY_DELAY code. commit 35a3bf13a8be96bb29dce32399c3684c6baa527d Author: Torrey Lyons <torrey@mrcla.com> Date: Wed Sep 22 23:38:33 2004 +0000 Add option for XDarwin to track system keyboard layout changes as they occur (John Harper and Torrey T. Lyons). commit 1b3fa4d53b287cbe9d38c5f8c9fbbc2298690959 Author: Torrey Lyons <torrey@mrcla.com> Date: Wed Sep 22 22:52:03 2004 +0000 Warning fixes. commit de68a3339b9f19630e29a17773cad060b1f65300 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Sep 22 17:20:56 2004 +0000 Allow overriding DPMS defaults (timeouts & default for on/off) from #defines/-D options. programs/Xserver/hw/xfree86/common/xf86DPMS.c Use defaultDPMSEnabled global for the default state of DPMS if not set in any config files. programs/Xserver/hw/xfree86/os-support/sunos/solaris-sparcv8plus.S Add support for required assembly inline functions for Sun compilers on Solaris/sparc. Add support for Solaris/sparc libraries. commit d7514b9162648f894211884b199ef2edc458aa86 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Sep 22 04:38:03 2004 +0000 Bug #1252, #1253, #1255, #1256: Various typo fixes from Dave Jones. commit 269012e6014d7c23bf6805ba14ca0b598cdd6313 Author: Torrey Lyons <torrey@mrcla.com> Date: Tue Sep 21 22:01:14 2004 +0000 Add offscreen GLX direct rendering with XDarwin's xpr backend (John Harper). commit 0514f8b65616d8878000764485e71384b71e3860 Author: Egbert Eich <eich@suse.de> Date: Tue Sep 21 17:57:36 2004 +0000 Merged over libXpm security fix provided by Chris Evans, Matthieu Herrb and Alan Coopersmith from release 6.8.1. Fail during initialization with error if font/fontset is not set for widget. This prevents a sig11 later when the non-existent font/fontset structs are referenced. Check if xf86Info.kbdProc pointer is really set before calling it on abort as this pointer won't be set if the new modular keyboard driver is used (Matthias Hopf). Added new libs to the bindist control files. Removed inclusion of unnecessary kernel header on Linux. This may fail in an -ansi environment. commit 814b74662103710665c0b5659a93974ad609276c Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Sep 20 08:44:54 2004 +0000 Bugzilla #1402: The last patch was broken on linux. Take definition of badSysCall out of the OS specific block. commit b600fcda38f4ab4796b5536cbedc5dee1abd25b1 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Sep 20 03:12:00 2004 +0000 Fix the R200 Render code. Composite and Trapezoids are now supported just as well as on R100. commit 908287addaff10a0f5f6f14bf06a9b85870737ec Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun Sep 19 12:59:52 2004 +0000 Bugzilla #1402: fix BigFont extension if SHM is compiled in but not working. Does not access SHM and privates if the SHM syscall failed during extension initialization. commit 90ff3688cdc0c2c1b5ccdbd9cc0659b9a355e85f Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 19 10:57:31 2004 +0000 Unbreak the AGP DRI case. That was quite a pile of broken code. commit 9297c6149f83de22395503c484a2ca65dbffaf6b Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat Sep 18 23:18:35 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1404 - Fixing random crashes (like in DAMAGE code etc.) in Xnest due uninitalised GetWindowPixmap. Original patch by Alexander Gottwald <ago@freedesktop.org> commit 6344bb51e2a97d9678cec2ec1dab19abfe9d9e8d Author: Torrey Lyons <torrey@mrcla.com> Date: Sat Sep 18 00:38:30 2004 +0000 Bugzilla #1032: Make rootless acceleration functions compatible with Damage. commit cedb9a8d62df3391fd89a8b05a2dd64bd098a7df Author: Torrey Lyons <torrey@mrcla.com> Date: Fri Sep 17 21:57:26 2004 +0000 Update Apple's list and hash utility routines to latest versions (John Harper). commit b56f4532d1a5febb8df45da0e3d3ad7bf8838e5f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu Sep 16 13:22:52 2004 +0000 Remove code which prevented the use from specifying the window size in nodecoration mode. commit c4083511acd1d0f20a242b8cd3ed62629629ce8f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Wed Sep 15 17:58:50 2004 +0000 add support for mice with more than 3 buttons and one scroll wheel (Chris B) commit 516f452e78170bc643117a71bd2246a83b071316 Author: Egbert Eich <eich@suse.de> Date: Wed Sep 15 09:23:59 2004 +0000 Adding support for OS dependent probing of IA64 chipsets. Not all IA64 chipsets can be probed without OS support as probing them is only possible using ACPI. One example of this are the HP ZX1/2 chipsets: previously the code assumed that these chips were present when no other of the known chipsets could be probed. This assumption brought SGI Altrix machines with 64 CPUs to a grinding halt. commit a3aa6a2d865239c5b8f29cbd849ae3288e36b8a9 Author: Egbert Eich <eich@suse.de> Date: Wed Sep 15 09:05:22 2004 +0000 Unregistering events in XSelectInput() when unregistering IM filter callbacks may be a bad idea as others may be interested in this event. Removed the call to XSelectInput() altogether as we are in root window anyway (Lubos Lunak). Fix size of a variable that gets assigned the value of SmartScheduleTime (long) to long. This should help to prevent smart scheduler lockup on 64 bit systems due to overruns (Andreas Schwab). commit f642fc729b481c55073c75beca301b2f17881179 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Sep 14 23:21:22 2004 +0000 Refix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1361 - RFE: Allow enabling/disabling of more extensions (fixing duplicate symbols caused by previous checkin; attachment #899) commit 0d95bdfbabf4c526f6f54d6f1de8811f4e6d5d5f Author: Phil Blundell <pb@reciva.com> Date: Tue Sep 14 23:08:10 2004 +0000 Only set screen parameters if resolution has changed from current values. Patch from scoony@noos.fr. commit ba3b6fd23be5f1f900fcff57bc586e08bc524e99 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Sep 14 06:26:54 2004 +0000 Add proper PCI/AGP detection, based on Mike Harris's code for Radeon, but using the MMIO mirror of the bits instead of config space. commit d9df39ee2b5b462be87718046b16d30c231563ec Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Sep 14 00:51:25 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=1361 - RFE: Allow enabling/disabling of more extensions commit 80dc84d067c5af29e33a0c7ac62eecc8ba4e0871 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 12 23:22:31 2004 +0000 - Fix a segfault on VT switch with DRI. Still dies due to cursor allocation troubles. - Move the RemoveBlockAndWakeupHandlers to match RegisterBlockAndWakeupHandlers. - Enable R100 trapezoid "acceleration" when DRI is working, so that it can be exposed and worked on. commit ab50679aabdda9e6197568f745d02fe1e65c7a24 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 12 23:01:24 2004 +0000 Fix a bad argument missed in the previous commit for ATIDRIDMA* functions. commit 2d069b1d1950b5f6f9140e5573e349e6559251e6 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 12 22:21:12 2004 +0000 Move the RegisterBlockAndWakeupHandlers to before DRI initialization. The change to use that instead of manual wrapping made the DMA dispatch come after the lock had been dropped, causing lots of pain. commit 27b5a65f05c78a0b6de0d0ace4f4275d990cc3a4 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 12 20:31:39 2004 +0000 Reset the CCE/CP on engine reset, and make the ATIDRIDMA functions take a more useful argument. commit fcd52d276f0276490ef08af2f0d6c52ed631f130 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 12 20:19:15 2004 +0000 Add missing kaa.h include for kaaInitTrapOffsets. commit b5d406e8c84d8aba2b45e985e43d02c2e6770019 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 12 20:02:10 2004 +0000 Fix handling of is_agp. is_agp is whether the card is actually AGP, while using_agp should say whether AGP is being used as part of DMA/DRI. commit 7cab70d1cb7298035429dd8953e521a31fc6770d Author: Eric Anholt <anholt@freebsd.org> Date: Sun Sep 12 19:52:51 2004 +0000 Improve error handling, especially in the DRI case. Do some FatalErrors instead of ErrorFs for things that are really bad, and put limits on some loops. Now, sometimes instead of hanging the entire system, we (mostly-) cleanly drop to console when the card has hung. commit 0cd662ea80579c317d706ebe04971bb29d0f9b4f Author: Eric Anholt <anholt@freebsd.org> Date: Sat Sep 11 09:28:19 2004 +0000 - Add disabled WIP trapezoid code for R128 and R100. The R128 rendering is not doing an add of 1 per triangle like I hoped, and instead seems to be saturating all the pixels or something. The R100 acceleration renders pretty well, with some gaps. Note that both are slower than software due to lack of DMA to submit vertices. - Mostly fix R128 and Radeon transform support, including supporting bilinear filtering on R128. Subpixel offsets are still probably an issue (reported by rendercheck), but I want to make 100% sure about my understanding of the protocol before changing everybody, including fb. - Add support for dst formats without alpha to R128 Composite. - Remove the R128 Blend code, which has long outlived its usefulness. (I kept it around for one reason: It could be useful for the w/h > 1024 case with no mask and a non-src op. That seems pretty infrequent and not worth the trouble). commit 396100dd235105a0e2c9013f1e07e4dae0cc3404 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Sep 11 09:23:12 2004 +0000 - Don't require Imrecise mode for Trapezoid acceleration. It looks like we might be able to do Precise in hardware, so leave it up to the driver. - Add a helper function for computing a set of offsets for smooth trapezoid rasterizing using many sharp trapezoids. commit 501dcf37aac4ec9298e8c79ca65c048c362bce31 Author: Matthew Allum <breakfast@10.am> Date: Wed Sep 8 11:31:49 2004 +0000 cursor fixes commit 20918ab480c8c8285a68e9f974b0208a18acec94 Author: Matthew Allum <breakfast@10.am> Date: Tue Sep 7 19:00:04 2004 +0000 avoid ephyr breakage when tslib enabled commit 8bf6ea903be4c052c747e3e81fc977155072299d Author: Matthew Allum <breakfast@10.am> Date: Tue Sep 7 12:44:19 2004 +0000 fixes to Xephyr debug mode commit b3322257815ec4550e1634453167535b02c1bfbd Author: Kevin E Martin <kem@kem.org> Date: Fri Sep 3 23:41:21 2004 +0000 Update formatted docs. commit b2135e589baeb2ea26da50b9167feaea23bcce3c Author: Kevin E Martin <kem@kem.org> Date: Fri Sep 3 16:18:23 2004 +0000 First set of documentation updates. Include more correct fix for rootless interaction with damage (Bug #1168, Keith Packard). commit d7fef52254126aa5897a5c58faeda1f61d5b13d8 Author: Kevin E Martin <kem@kem.org> Date: Thu Sep 2 04:04:47 2004 +0000 Workaround for servers using rootless layer with damage (Bug #1168, Torrey T. Lyons). commit 0e56515aa3ebc5ee8cc33213fb22b69bb4b3a0da Author: Kevin E Martin <kem@kem.org> Date: Thu Sep 2 01:38:17 2004 +0000 Fix AGL display problems (Bug #1210, Torrey T. Lyons). commit 2753c8e2c84cc1fb6d73a05258ab7200068e7830 Author: Matthew Allum <breakfast@10.am> Date: Wed Sep 1 15:30:58 2004 +0000 see changelog commit 7c0aaa53bf8dcf3d0a8c9e78d31cf62b1766fb35 Author: Matthew Allum <breakfast@10.am> Date: Wed Sep 1 11:13:36 2004 +0000 '-dpi' fixes for Xephyr commit 16ff3a872731633b6f1f4920f793153722026189 Author: Matthew Allum <breakfast@10.am> Date: Wed Sep 1 08:31:20 2004 +0000 Actuall select events for -parent option commit 2d065c4c33b9ec17c4c791070cf8189cb57bbb9c Author: Matthew Allum <breakfast@10.am> Date: Tue Aug 31 16:33:05 2004 +0000 Added ephyr server sources commit 6ec9ecd591fba9e9b69b8ebbd2fa08c0a2beac08 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Aug 30 22:16:46 2004 +0000 Add a set of three hooks for accelerating trapezoids, and use it for the RasterizeTrapezoid screen function. These hooks will be called for imprecise, non-sharp trapezoids with A8 destinations. Note that the current main consumer of trapezoids, cairo, is requesting precise, sharp trapezoids by not changing the default Picture attributes, but gets non-sharp effects in software because fb bases its choice of sharp/non-sharp on the mask format being A8 vs A1, and cairo asks for A8. Follow fb's (poor?) example by ignoring the sharp setting and basing the choice off of the mask being A8. commit ccaf332ce3a9393715317edd3b92420c27fc94eb Author: Eric Anholt <anholt@freebsd.org> Date: Mon Aug 30 16:43:10 2004 +0000 Rather than initially place pixmaps in framebuffer based on a size heuristic, delay the decision until the first kaaPixmapUse{Screen|Memory}, and put it in framebuffer if UseScreen was called. Provides a significant improvement in cairo speeds (100% speedup in cairogears here) and is likely to improve text performance as well. commit 14b2db63e7ae0c0d356062cd15811484038f97d9 Author: Kevin E Martin <kem@kem.org> Date: Sun Aug 29 21:06:00 2004 +0000 Fix make install when BuildServersOnly is YES (Bug #1213). Fix build failures when UseDeprecatedKeyboardDriver is YES and DoLoadableServer is NO (Bug #1229, Kristian Hgsberg). Fix failure when using DLL loader and LD_BIND_NOW is set (Bug #1212, Adam Jackson). commit ac038e9cc6f7708fdd9f36494861d2f611d5a90a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Aug 29 00:48:17 2004 +0000 Don't define _XOPEN_SOURCE before including math.h on Solaris - it's not needed on older releases, and breaks builds on Solaris 10. (Same as bugzilla #189). commit 89d702763875831604751bac396c3d2400ec59b6 Author: Egbert Eich <eich@suse.de> Date: Fri Aug 27 21:44:54 2004 +0000 Fix for XV memory allocation: Also use tiled area for allocation even if it hasn't been used before. commit 971755765d6ef9cadf11127478af59189034d356 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Aug 27 21:09:23 2004 +0000 Bug #1101: Fix PaintWindow in the pixmap case when the window's origin is not at the backing pixmap's origin. Resulted in incorrect rendering in at least aisleriot, fluxbox, and KDE apps, and probably many more. While here, move the ParentRelative loop above the drawable grab -- may improve correctness with ParentRelative background origins as well. Note that the border code doesn't handle ParentRelative yet. commit 1840a50bb763d5c94195eaffa3954c1afd77a31a Author: Kevin E Martin <kem@kem.org> Date: Fri Aug 27 20:39:17 2004 +0000 Add missing reply for DMX (Rik Faith). commit f30fbc600f3e5c3b4aceafb8256594af0069f2c9 Author: Egbert Eich <eich@suse.de> Date: Fri Aug 27 20:20:54 2004 +0000 Fixed typos. commit 276cf271527b7a6f464025457e5dd452ac13605e Author: Egbert Eich <eich@suse.de> Date: Fri Aug 27 20:16:28 2004 +0000 - adding missing file commit ecd889c6ff7427b4e7d3f820586aac178a4dfdc2 Author: Egbert Eich <eich@suse.de> Date: Fri Aug 27 19:27:12 2004 +0000 Added support for LynxOS 4.0 (Thomas Mueller). Fix arm netwinder build (Donnie Berkholz). commit 7c087078694a6895a9bcbe62d091665c05a86b5a Author: Egbert Eich <eich@suse.de> Date: Fri Aug 27 12:32:14 2004 +0000 - Make DDC code more VESA compliant: when MaxClock is set to 0xFF it means 'no value specified'. Therefore setting it to 0. commit c0bff215de2d034118d06cac42e234008612204b Author: Kevin E Martin <kem@kem.org> Date: Fri Aug 27 01:15:10 2004 +0000 Fix xtest failures in Xvfb from XMatchVisualInfo test. commit 5335bc8a0657b3e378795b44698ed23020c13891 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Aug 26 20:32:59 2004 +0000 Bug #1138: Wrap funcs in CW's GC ops as well. While this is unnecessary according to the rules as I understand them (bug #1045), not everybody follows the rules. GC funcs were being called on the same GC from within GC ops, and the cwValidateGC caused a loop in the funcs chain that resulted in a crash, notably in cwPolylines. commit c8672e7ac79c872344f287f7cc106cb5c006e619 Author: Egbert Eich <eich@suse.de> Date: Thu Aug 26 11:58:08 2004 +0000 Fixed support for LynxOS 3.1 (LynxOS 4 will follow) (Thomas Mueller). 2 commit 198e62c44b99ee0890b944f92b162387f77aa10d Author: Torrey Lyons <torrey@mrcla.com> Date: Sat Aug 21 00:46:01 2004 +0000 Documentation only update: Update XDarwin application version for release. commit 74d84d7b122802230579a4da8c2e6914d2f5f060 Author: Kevin E Martin <kem@kem.org> Date: Fri Aug 20 05:22:39 2004 +0000 Fix keyboard driver failing to initialize if DoLoadableServer is NO (Bug #1133, Kristian Hgsberg). commit bd3e6e44259155cb37f39eb2ca5e1f0de1c2ebb7 Author: Kevin E Martin <kem@kem.org> Date: Thu Aug 19 04:08:40 2004 +0000 Add missing no.*Extension symbols (Bug #1131, Aaron Plattner). commit 87842285007e9ac4f9de0349abee1fb66b7c795f Author: Kevin E Martin <kem@kem.org> Date: Wed Aug 18 21:11:17 2004 +0000 Fix CopyArea for non-redir dst, redir src (Bug #1105, Eric Anholt). commit 9223baf985778c536ce93846c431b46a0192cf32 Author: Kevin E Martin <kem@kem.org> Date: Wed Aug 18 18:41:41 2004 +0000 Fix AIX build problems (Bugs #1020, 1102, 1103, Dan McNichol). Remove old config files (Bug #1123, Jim Gettys). Remove old log message (Bug #1123, Jim Gettys). commit a45bc0df7a1c369e8429e84414ac813187c90059 Author: Kevin E Martin <kem@kem.org> Date: Tue Aug 17 17:55:02 2004 +0000 Fix DRI module loading (Bug #1057, Ronny Vindenes). Fix Xvfb at 8bpp (Bug #1091). Fix link order when building with Xprint in glxgears (Bug #1060, Alexander Gottwald). commit 75de2fe82e7da755555028a724f68b9fb9ddfb14 Author: Kevin E Martin <kem@kem.org> Date: Mon Aug 16 22:48:50 2004 +0000 Update release and date for first RC. Fix kbd/keyboard driver for DoLoadableServer NO. Revert change since it is better to set date in the config files. commit 1798cac6fa2e909c9f3df26b97ee8232a0bf1592 Author: Kevin E Martin <kem@kem.org> Date: Mon Aug 16 20:17:51 2004 +0000 Add kdb <-> keyboard aliasing when UseDeprecatedKeyboardDriver is NO (Bug #1072, Kristian Hgsberg). commit 6cac342517892a20bab6a6177f8b5742feaaed38 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Aug 16 15:48:53 2004 +0000 document broken composite in XWin commit 9aa6beb6b7e6272b05a03e0a4fd34eb8ad21bf47 Author: Kevin E Martin <kem@kem.org> Date: Mon Aug 16 02:07:53 2004 +0000 Fix banner to print out proper version information. commit 9da0c214ab5f4ee9c1610b4888f5c7c0dd2bcacc Author: Keith Packard <keithp@keithp.com> Date: Sun Aug 15 21:13:11 2004 +0000 Clip destination instead of source. Should be the same, but it looks nicer to me. Clean up transition between cheap and expensive GC wrappers by using the prologue and epilogue macros. Before, the GC would be left unvalidated sometimes which would cause all kinds of entertaining bugs against a DDX which cares (XAA). commit a68f350195c1c54034f98e2b78c2c3da70044884 Author: Keith Packard <keithp@keithp.com> Date: Sun Aug 15 19:05:01 2004 +0000 Remove debugging code which did a full tree walk on every window operation Eliminate needless (and, it turns out, dangerous) call to ChangeGC on DestroyGCPrivate. in cwSetWindowPixmap, check if the pixmap is the screen pixmap and disable the wrapper by setting the private to NULL. commit 5db70ae2575e3e8669d7a66e2218ba28e8bdfa68 Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Aug 15 15:40:19 2004 +0000 Remove #error used for testing. commit 1e728c3e88f6a74b93dc11827c9fcfe7b39ca5a5 Author: Keith Packard <keithp@keithp.com> Date: Sun Aug 15 03:34:18 2004 +0000 Copy bits from parent window when allocating pixmaps so that Background == None works. Copy filter to backing picture during validation. Mark picture serialNumber when setting Filter or Transform so Validate occurs. Initialize xf86Screens[i]->pScreen to NULL so that RADEON driver doesn't crash during server reset using old pScreen. commit 943308517905d16bda1bb27cd745bd291a84dbf6 Author: Keith Packard <keithp@keithp.com> Date: Sun Aug 15 00:43:39 2004 +0000 Redraw window borders when switching window pixmaps around Make cw "own" the window pixmaps by wrapping GetWindowPixmap/SetWindowPixmap. commit 597fdae93e6e1b7e4052097baf3d91e7a134c162 Author: Kristian Høgsberg <krh@redhat.com> Date: Sat Aug 14 23:59:52 2004 +0000 More kbd fun: write out "kbd" from Xorg -configure (#1078). commit e483fe3ec384da556c31292001a86ec95c2ddc46 Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 14 21:57:58 2004 +0000 Fix offsets again. Really, it works this time. Promise. commit e6216b48f5feee72f107348cb21bad724536ec62 Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 14 21:36:10 2004 +0000 Fix offsets, do whole region at once by using GC clipping commit ed425d1d88a72586d5d7a4aad9d0be0b06637070 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Aug 14 20:29:28 2004 +0000 Bug #1077: Fix source copy performance problem exposed by Composite. commit cc3ad0ed4302f54318e190a2b10646337f242d40 Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 14 19:53:36 2004 +0000 Fix clip list computation and setting to ignore clip changes to "real" GC/Picture and track serial numbers correctly when copying pCompositeClip down. commit 183c6d06455114c61f6db57ec0a084caf11ece3a Author: Eric Anholt <anholt@freebsd.org> Date: Sat Aug 14 19:51:11 2004 +0000 Wrap CopyWindow in cw, which fixes scrolling in many apps. commit e61b5d38ab30c4f73ba0d070f485a32708a03eb6 Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 14 07:12:37 2004 +0000 Use XLIB_SKIP_ARGB_VISUALS environment variable to disable all depth 32 visuals. Necessary to keep Flash from crashing. Must call ValidateGC/ValidatePicture on "real" GC/Picture to ensure pCompositeClip is set correctly. Need to take the composite clip from the "real" GC/Picture and turn it into the clientClip for the backing version. Adjust pixmap screen origin to account for drawable->x/y Change debugging output a bit (disabled by default) commit 05f6329eb6f564ad4fc366d75f4ebf9f3ba4b5dd Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Aug 13 23:57:38 2004 +0000 Don't enable speedo & type1 modules if they're not being built Clean up a couple of hardcoded paths & vendor names to use defines set by Imakefile commit 3f84e4f71d9c7c560f9bef675b1cc96fa1d83b14 Author: Kevin E Martin <kem@kem.org> Date: Fri Aug 13 19:51:34 2004 +0000 Fix Xprt bug by disabling code that merges multiple audit messages (Bug #964, Roland Mainz). commit 922fd3a2e568571171dfd64a94f804350829230f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Aug 13 19:18:29 2004 +0000 Added $(MESASRCDIR)/src/mesa/glapi to INCLUDES. Removed $(SERVERSRC)/mi from INCLUDES. Rearranged INCLUDES for better readability. Removed mipointrst.h and miscstruct.h from #include since they are not used anymore. commit f63f4b768cd5ec5bffd270e448e6e51b8ad67016 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Fri Aug 13 18:24:07 2004 +0000 Fri Aug 13 19:53:10 2004 Soeren Sandmann <sandmann@redhat.com> Fix for lockups on some versions of Matrox Mystique. #687, Patch from Mike Harris. Call xf86EnableDisableFBAccess though the function pointer instead of directly. #1041, Patch from Aaron Plattner. Swap the phsyical size of the screen when rotiation. #1050, Patch from Aaron Plattner. Fri Aug 13 19:47:12 2004 Soeren Sandmann <sandmann@redhat.com> Make HAVE_FT_BITMAP_SIZE_Y_PPEM conditional on the FreeType version instead of proping it. This way it will work with the monolithic version too. #1062, Patch by Owen Taylor. commit a29bfbd3d0a5d39ccee5b83ac1ba632091b031bb Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 13 08:16:14 2004 +0000 Empty damage object when freeing pixmap. Wrap InstallColormap so that the DDX doesn't see colormaps from our ARGB visual (avoids lovely green tint to screen). Also, set visual->nplanes of ARGB visual to all used (including alpha) planes so DIX can set pixel values correctly. Translate automatic update regions correctly to account for borders When nplanes == 32 (ARGB visuals), mask in all ones for alpha values to allocated pixel values. Remove redundant fbAddTraps declaration Fix fbCopyWindow to work on non-screen pixmaps (not needed yet) Replace broken clipping code with that from modular tree. Respect subWindowMode. commit 24bed5cff908a6f8b1857e3dadac22d6db54c69e Author: Eric Anholt <anholt@freebsd.org> Date: Fri Aug 13 07:47:21 2004 +0000 Fix copy'n'paste-os of x/y in CopyPicture for AlphaXOrigin and ClipXOrigin. commit 5825e4559e7aaf3b40205a0dca49a785c8de7b92 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Aug 12 23:14:50 2004 +0000 Fix after Mesa 20040812 merge: revert glxext.h to vendor branch, and fix bug #1022. commit 2889ad2cb8827f20b6d69da4fe99db33bf9c5ff2 Author: Torrey Lyons <torrey@mrcla.com> Date: Thu Aug 12 20:24:36 2004 +0000 Fix crash in rootless XDarwin due to rootless being initialized before damage extension. commit 961333143e2df3e3f33e8624fc61e79cf3e86cd1 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Aug 12 08:45:33 2004 +0000 Apply a kludge to initialize the composite wrapper before DamageSetup. If not, DamageSetup will wrap some operations first, and the cw initializes during ExtensionInit, so cw comes higher in the wrapping chain. cw going first will result in damage getting confused when the drawables get changed around. commit 6e0228722cc2fa37a0e2359bc3dab3646e36c4b7 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Aug 12 08:11:59 2004 +0000 Fix various cw issues, including a couple reported by deronj: - Fix wrapping of GC ops/funcs according to policy described in bug #1045. - Remove ValidateGC/ValidatePictures on the redirected drawables/pictures -- it's not needed, and DDXs shouldn't be seeing redirected drawables in render or GC ops/funcs when cw is running. - Mark all GC/Picture state as dirty when moving from redirected to non-redirected, since it hadn't been passed down in Change* or Validate* while redirected. - Remove CreatePicture wrapper that didn't do anything. - Comment on why AddTraps wrapper isn't needed. commit 789cf3ed846045d91f950cb177ef6bae4c8966fc Author: Eric Anholt <anholt@freebsd.org> Date: Thu Aug 12 07:57:03 2004 +0000 Fix some issues reported by deronj: - Hopefully fix a crash in compCheckRedirect on unrealizing windows. - Remove an extern that doesn't point at anything. commit 1a073786e0159a80ac3b8772a1d89b0618a8ff33 Author: Kevin E Martin <kem@kem.org> Date: Thu Aug 12 05:11:57 2004 +0000 Update version and date for next snapshot commit 47ee5f4ba72f0e0bc92a5e04073c70808e85fc08 Author: Kristian Høgsberg <krh@redhat.com> Date: Thu Aug 12 01:57:51 2004 +0000 Add call to SourceValidate() when pDst == pSrc, so misprite.c get a chance to remove the sprite before the area is copied. The drivers handle pDst != pSrc (#1030). commit 09d0056b8bc103f67a35980934f03d28fed51164 Author: Adam Jackson <ajax@nwnk.net> Date: Thu Aug 12 01:30:57 2004 +0000 Wrap the Propolice fix in #ifdef __SSP__; Propolice doesn't define this yet but an RFE has been submitted upstream. commit e30c22dbbffa2605f8d7ac010c8208a135a2293a Author: Adam Jackson <ajax@nwnk.net> Date: Thu Aug 12 01:16:36 2004 +0000 Back out the propolice fix for a second, it causes linktime errors. commit 9d0213525f4f692c250f10309146fe9db76ba12d Author: Keith Packard <keithp@keithp.com> Date: Thu Aug 12 00:09:30 2004 +0000 Paint to parent window instead of parent window's pixmap (helps for servers that don't have a pixmap for the root) Fix offsets for render drawing. commit c7bc76f663008119b3681d4b7adef7dc9ffdc236 Author: Torrey Lyons <torrey@mrcla.com> Date: Wed Aug 11 23:53:36 2004 +0000 Fix leftover XF86_VERSION_SNAP macro. commit eb607030e32cbad846696a20cfb3045c5f8f65c1 Author: Adam Jackson <ajax@nwnk.net> Date: Wed Aug 11 23:10:02 2004 +0000 Teach the loader about the extra symbols needed for Propolice-protected modules to work under elfloader. From Travis Tilley (Gentoo). commit fd439afdfe7ba451aff19b62d1764e4dfd0b782f Author: Keith Packard <keithp@keithp.com> Date: Wed Aug 11 22:40:14 2004 +0000 Add COMPOSITE change to fbCopyWindow (not needed yet) Xnest was half-using midispcur and doing a bad job of it. Replace all of that code with mipointer which does a lot of the work. Support DDXen which don't provide GetWindowPixmap, or which return NULL for the root pixmap. commit f95293e5253904883d3b40f9e68e6175247754a3 Author: Kevin E Martin <kem@kem.org> Date: Wed Aug 11 22:27:50 2004 +0000 Fix bogus contact address in Xserver/os/util.c (Bug #738). commit 56520ecd5ceb9526541c241634b467eba6a8f7cf Author: Eric Anholt <anholt@freebsd.org> Date: Wed Aug 11 22:13:01 2004 +0000 In CopyPicture, add missing call to ChangePicture to notify about the changes that CopyPicture has done. commit f77f1d50723aceb5059a96f7a4068046b7961c51 Author: Kevin E Martin <kem@kem.org> Date: Wed Aug 11 21:14:18 2004 +0000 Apply PPC64 build patch (Bug #303, Mike A. Harris, Alan Coopersmith). commit 3dbaeb2e126d9424b21df91f0be9129c4eea6f1b Author: Kristian Høgsberg <krh@redhat.com> Date: Wed Aug 11 20:25:13 2004 +0000 Patch xorgconfig to generate config files with correct keyboard driver; use "kbd" by default, "keyboard" if UseDeprecatedKeyboarDriver is YES (#1040). commit ca458e3c9b25c3efc10532eb8e31bdcff44dc321 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Aug 11 13:55:03 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=492 - /etc/init.d/xprint did not source xorg.conf for font paths additionally to xfree86 config files commit 81881b96861d707b0729e0146a4b53b3dd234885 Author: Kevin E Martin <kem@kem.org> Date: Tue Aug 10 21:37:35 2004 +0000 Update version to 6.7.99.1 and fix problem with snapshot string generation. commit 21c7c8cdc7d2f607177634601cef8b0290fb0e80 Author: Kevin E Martin <kem@kem.org> Date: Mon Aug 9 22:37:22 2004 +0000 Fix install problem on platforms not using xorg.cf/xfree86.cf (Bug #339, Harold L. Hunt II, Alexander Gottwald). Fix crash when using X core font in zh_CN.UTF-8 locale (Bug #368, Yu Shao, David Dawes). Fix glXMakeCurrent(Dpy, None, NULL) crash (Bug #719, Adam Jackson). HP-PA build fix (Bug #828, Guy Martin, Paul Anderson). Fix SDK build for GATOS and Wacom driver (Bug #829, Bryan Stine). Fix attempt to read video ROM before enabling it (Bug #843, Ivan Kokshaysky, Mike A. Harris). Fix detection of primary adapter (Bug #843, Ivan Kokshaysky, Mike A. Harris). Clarify xset man page description of how to use the keyboard repeat rate settings (Bug #846, Mike A. Harris). Fix problem where print-screen key would get remapped to sys-req in certain keymaps, which broke GNOME printscreen functionality (Bug #847, Owen Taylor). Fix several render problems: - MMIO mode support - Hang on IGP chips - VT switching hang - 3D render corruption (Bug #922, Hui Yu). commit 26847ef9268f687c4f45f3d048eff4b06c2ba3bf Author: Kristian Høgsberg <krh@redhat.com> Date: Mon Aug 9 03:40:50 2004 +0000 Move the new render symbols to dixsym.c instead so they are grouped with the other render symbols. Initialize screen_x and screen_y to 0. This fixes a problem with the new Damage based sprite, where intersection test against the root pixmap would fail because the two fields were not initialized (damage.c, 166-170). commit 57eab4dc87670da42e645a4c341d1ee661b43b5b Author: Kevin E Martin <kem@kem.org> Date: Mon Aug 9 02:08:35 2004 +0000 - Fix building without Xfixes extension - Fix building without Xevie - Fix building without DPMS - Fix "Extensions" section config file support to accept general boolean options commit a2e51b13ea5a2e5fc5626905b6c2caac6358eb11 Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Aug 8 20:56:56 2004 +0000 Disable legacy keyboard driver "keyboard", unless USE_DEPRECATED_KEYBOARD_DRIVER is defined. Print warning if the old driver is used. commit 3431692bf44e7be01187b421cfb0e46131c5e4c7 Author: Kristian Høgsberg <krh@redhat.com> Date: Sun Aug 8 17:02:19 2004 +0000 Add new render symbols to list of exported extension symbols so DoLoadableServer works again. commit 1e694d2b51a954d1bc4afdde390723e9a1a5b9bf Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 7 01:23:07 2004 +0000 Fix minor timestamp lossage in mieq. Replace miSprite implementation with Damage-based one. Otherwise damage and misprite conflict causing looping. Change pScreen usage around a bit to eliminate warnings commit 45fde3b041c071ae5a604cefbbfa4da5c1e828f8 Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 7 01:19:01 2004 +0000 Eliminate mfb support. Fix visuals to match "normal" PC hardware (making lightpipe work). commit 2bdbc2c0d39b1618440a6a8ed1c38a11703e898c Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 7 01:02:41 2004 +0000 Clean up cw initialization, make sure wrappers re-wrap on exit. commit cff0043a347ba06e8ab16a84a35c99794b45149b Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 7 00:58:21 2004 +0000 Remove alpha-related fields from visual structure to retain binary compatibilty. Applications using ARGB visuals will need to use Render or other mechanisms to compute pixel values instead of AllocColor commit 196aafb19a3cfdc8c21f9bf75814cf0d84ff4446 Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 6 23:42:10 2004 +0000 Add RenderAddTraps. Rewrite trapezoid rendering code. commit e847bcda0827ffb87689a0162c648570de6d6f69 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Aug 6 00:31:28 2004 +0000 Fix missing ';' in cw.c and unwrap the render wrapper properly. commit ae1580c494fde2b56f9faa40f7ebcf637728efc8 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Aug 5 18:24:58 2004 +0000 - Add a new Render function, CopyPicture, which will update a picture with the flagged bits from a source picture. Approved in principle by keithp. - Use CopyPicture and SetTransform to update most of the backing picture's state in the composite wrapper. Filters are still missing. - Don't allocate a picture private, now that we calculate clipping properly and don't need the serialNumber or stateChanges. - Use the format of the source pixmap rather than generating the format from the window's visual. - Wrap the rest of the Render primitives that were stubbed out before. commit 73e14bd611fa7eac649a2b4c7964959d9eae887b Author: Eric Anholt <anholt@freebsd.org> Date: Wed Aug 4 23:18:38 2004 +0000 - Always validate the backing GC in cwValidateGC, not just when the clip list changes. - Use FillTiled instead of FillSolid for painting tiled border/background pixmaps, and don't needlessly change the scratch GC's defaults. - Use the preferred dixChangeGC instead of DoChangeGC. - Simplify a silly loop and clean up a couple of comments. commit d240c41a3ab9cde9921cc96cf86e630ca5c9005a Author: Egbert Eich <eich@suse.de> Date: Wed Aug 4 12:21:48 2004 +0000 Optimization of CJK rendering when using versions of freetype prior to 2.1.8 (Chisato Yamauchi). A small backward compatibility fix to make the freetype module build with freetype version < 2.1.7. Fixed/added some debugging code. commit 751fd11a9ad1a473d7311362246b0869a008001b Author: Eric Anholt <anholt@freebsd.org> Date: Wed Aug 4 10:05:37 2004 +0000 - Add two new XAA hooks, SetupForCPUToScreenTexture2 and SetupForCPUToScreenAlphaTexture2. These add a dstFormat argument after the previous format argument, which the driver needs to use to properly set up the destination format. Two new arrays are added for the list of destination formats supported that correspond to the previous format arrays for sources. - Make Render acceleration only occur when the new hook for that acceleration type is supplied and the dst format list is set, along with the src format list being set. Without knowing the destination format, the Render acceleration couldn't properly support all the destinations it might encounter. - Bump XAA module minor version. - Update the Radeon Render acceleration to use the new hooks when the XAA module is sufficiently new. Fix a bug in the src/dst alpha booleans for ops, and use them to set blend_cntl to support destinations without alpha. Add missing PICT_a1r5g5b5 texture format, and add list terminator. (!) commit 9c1d52a69db841ac85ef97d7223361b83a66ae29 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Aug 3 10:12:25 2004 +0000 Merge from CYGWIN branch 2004-08-02 Kensuke Matsuzaki Fix the bug that we can't copy & paste multi-byte string to Unicode-base Windows application. Rename fUnicodeSupport to fUseUnicode, because it don't mean wheather Windows support Unicode or not. commit defcfe3c7ee3e39ef02da08b7227b758dbede325 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Aug 3 09:33:54 2004 +0000 programs/Xserver/hw/xfree86/ddc/xf86DDC.h programs/Xserver/hw/xfree86/vgahw/vgaHW.c programs/Xserver/hw/xfree86/vgahw/vgaHW.h programs/Xserver/miext/shadow/shadow.h programs/Xserver/miext/shadow/shpacked.c programs/Xserver/miext/shadow/shplanar.c programs/Xserver/miext/shadow/shrotate.c Fix glitches in pointer to functions declarations. commit e6d0b18c24f7f84aabed763be1cc8414883fab95 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Aug 3 08:52:17 2004 +0000 Fix declaration of XAACachePlanarMonoStippleProc. Rename XAACachePlanarMonoStippleWeak to XAAGetCachePlanarMonoStipple() for consistency with other parts of xaa and fix forward declaration in xaalocal.h. Fixes last comments on Bug #962. commit bfbb40c28ce6e98c82973bd96054d4787579eaa6 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Aug 3 05:49:48 2004 +0000 Major improvements to Composite wrapper. Several issues remain, but it now appears stable in limited testing. - Allocate the picture private, avoiding segfault. - Wrap PaintWindow to draw the background/border to the backing pixmap (based on Deron Johnson's comptran.c). - Set the x_off/y_off returns to translate coordinates properly. - Don't bother allocating temporary areas for the modified coordinates. Layers above are responsible for handling lower layers changing the arguments, so cw doesn't have to worry about it. mibstore.c has to do the allocation because it calls down twice (front buffer and backing store). (Suggested by keithp) - Handle the mode argument to PolyPoint, Polylines, and FillPolygon. - Remove some dead elements in the cw privates. - Kill a prototype warning in compinit.c by adding the cw.h header. commit b7ba272da0910c6558f71cfedd0bf9836fc892c1 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Aug 3 05:39:19 2004 +0000 The Damage extension has to wrap after (be called before) the Composite extension so that the redirecting of drawables by the wrapper doesn't confuse Damage. commit d112e55992e9e03e74fdf5738c8c47cd90033a37 Author: Adam Jackson <ajax@nwnk.net> Date: Tue Aug 3 02:44:23 2004 +0000 Bug #962: Remove LoaderSymbol calls introduced by the dlloader work so DoLoadableServer NO builds work again. commit 734cb34dc1697530ecd971b84e1061ed86b4c2a4 Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Mon Aug 2 21:15:30 2004 +0000 Mon Aug 2 21:49:33 2004 Soeren Sandmann <sandmann@redhat.com> Remove double cast. commit e6b9cc79c204420117a1f7b23d131ec24923d612 Author: Egbert Eich <eich@suse.de> Date: Mon Aug 2 19:35:07 2004 +0000 Removed distro specific stuff. Fixed FreeType module to build with FreeType versions older than 2.1.7. Fixed typo. Added vtSema to protect call of driver DPMS function. removed unneeded variable Modified RandR driver hook to reduce the number of function calls to one. Function is sufficiently generic to be extended in the future. commit b759da83ae62a897b7727d9180a68b962b571286 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun Aug 1 16:16:18 2004 +0000 added README for Cygwin/X This file currently contains the Cygwin/X specific release notes from 6.7.0 and a first collection of what will make up the release notes for the next release commit d638a50f3f039d84d86c00696d7d3ec22560bc3c Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Jul 31 18:33:56 2004 +0000 adjust prototype for winInitCmapPrivates to match Egberts change. commit 488be6611919af97d7e4f8b0994487882eb78e18 Author: Kevin E Martin <kem@kem.org> Date: Sat Jul 31 09:41:27 2004 +0000 Fix typo commit 383b6b59864098b03d991628ff5933d997793ea1 Author: Kevin E Martin <kem@kem.org> Date: Sat Jul 31 09:14:06 2004 +0000 Add "Extensions" section support to configuration parser commit d690556d496c7331bd112903a0c9e6553c7d3342 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jul 31 08:24:14 2004 +0000 Integrate COMPOSITEWRAP branch including composite wrapper. This code still has several issues, including: - CopyWindow and PaintWindow wrappers missing (will be done soon) - Some segfaults seen in the Render wrappers. - Xprt server build breaks with Composite. - DDXs must be recompiled for Composite due to VisualRec size change. - Composite bugs pointed out by Deron Johnson in email. Also, reorder XFixes initialization according to comments by Keith which are also in xserver CVS. commit 8763cca7f9927bd6c9caf804bf09dcfea929eed0 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jul 31 07:26:50 2004 +0000 Update xfixes server code to major version 3 from xserver CVS, and perform minor diff-reduction versus xserver CVS. commit 25bd6ff4a622d09fb0c247b7c40281744c61431e Author: Kevin E Martin <kem@kem.org> Date: Sat Jul 31 04:23:21 2004 +0000 Add new extension enable/disable feature. This code is a small step in the right direction -- i.e., moving towards full run-time config of extensions. Currently, only XTEST, XINERAMA, RENDER, XKB, and XEVIE are supported. commit 326729ebca863c99cf913445126294a3c6d3db5d Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jul 31 01:48:27 2004 +0000 - Add some XFIXES bits apparently missed in the DAMAGE-XFIXES merge - Add missing XCSECURITY ifdef. - Sync some whitespace to xserver CVS and surrounding style. commit 370bda820b2912b93dcc34c088075f8e65a9e5cb Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jul 31 01:38:46 2004 +0000 Integrate latest damage bits, including the addition of Composite code. Includes REGION_INIT -> REGION_NULL necessary to avoid segfaults with inlined region macros. commit 7542d8a17ad469f9c760f0f843bd6a4fb6deb57d Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Sat Jul 31 01:37:47 2004 +0000 Turn on XEVIE https://freedesktop.org/bugzilla/show_bug.cgi?id=947 Modified Files: miinitext.c commit b2065f376b932e49f1f96dfb92ddb52d15796abe Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Sat Jul 31 01:34:26 2004 +0000 Integration of XEVIE branch to trunk, latest updates https://freedesktop.org/bugzilla/show_bug.cgi?id=947 Modified Files: Imakefile xevie.c commit e68bfc801680f2852c59099aa3d7502e49b48b2c Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Sat Jul 31 01:33:40 2004 +0000 Integration of XEVIE branch to trunk, Some updates from latest reviews https://freedesktop.org/bugzilla/show_bug.cgi?id=947 Modified Files: events.c commit 706b2a7e02aa0085769fb87782118488d0f90eaa Author: Adam Jackson <ajax@nwnk.net> Date: Sat Jul 31 01:21:19 2004 +0000 Change several LoaderSymbol calls introduced by the bug #400 patch to *Weak() resolver functions. commit 9e13805b02f37497971c789b4035abc29463c550 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sat Jul 31 00:44:45 2004 +0000 adjust prototype for winInitCmapPrivates to match Egberts change. commit 4da507a03fd5659e5944d9e47dd2f8920636383b Author: Kevin E Martin <kem@kem.org> Date: Sat Jul 31 00:32:43 2004 +0000 Fix compiler warning commit 64a6d3e9c84a36b4e0550d112f288b695c5056cd Author: Hui YU <hyu@ati.com> Date: Fri Jul 30 22:20:21 2004 +0000 Support for New radeon chips: R420/M18, R423, RV370/M22, RV380/M24, RS300. Add special handlings for DELL triple-head server (RV100). Misc. bug fixes for flat panel, host aperture, etc (Bug #946) commit d3c98fed2c37a863a6765a3e288bcdbc2738878a Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 21:53:09 2004 +0000 Add support for on-the-fly screen rotation when supported by hardware (Aron Plattner). commit 4baf0029418d3eeeac5d1026a7cfea3234e44e48 Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 21:46:38 2004 +0000 An experimental pseudocolor emulation layer. Not fully completed, currently only works for 16bpp. commit 63a152f7812d0981e3e7aa41a42e59cd0c3e50dc Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 21:39:20 2004 +0000 removing some unnecessary restricitons on the allowed visuals. commit 0ba15599466ddb644728c6b68e64e05b1317ac2e Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 21:10:46 2004 +0000 Adding a colormap index to the InitColormapPrivate() func call. Without it it was completely useless. test if colormap with index really exists in the list of installed maps before using it. commit bbfe7bed3fe4d9bd089327cd59e6faedb592dabb Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 20:56:53 2004 +0000 Set DPMS to ON when VT switching away or shutting down the server. Failing to do this may leave the text console blank. commit 40b975e3acb11c1ec2fd4c5984f5efa20b669489 Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 20:51:09 2004 +0000 Improved error messages. build fixes for AMD64. Made shm* functions in the libc_wrapper more standard conformant by setting errno correctly. Use xf86ExendedInitInt10() in VBEExtendedInit() to be able to pass flags. commit 7643199de1c4f12a2aadeaf2d539a37ddb45672b Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 20:38:27 2004 +0000 Fix static build. add i845 to the list of chips that allow memory size tweaking. commit 48514fee3c8ec26f36e142ffc9272e510b9a4238 Author: Adam Jackson <ajax@nwnk.net> Date: Fri Jul 30 20:30:57 2004 +0000 Bug #400 (partial): Driver fixes for the dlloader. When using dlloader, all framebuffer formats except cfb and the overlay modes should work, and r128 and radeon need to be loaded from the ati driver (both issues to be fixed soon). Tested on i740, s3virge, mach64, tdfx, vesa, and vga drivers. elfloader users shouldn't be affected. commit 29012adb37c533f57c684ad94c4d83a6c31793e5 Author: Torrey Lyons <torrey@mrcla.com> Date: Fri Jul 30 19:28:03 2004 +0000 Add generic rootless layer documentation missed from last commit. commit 784e4d1cc02dea837a38a4140a18013953296366 Author: Torrey Lyons <torrey@mrcla.com> Date: Fri Jul 30 19:12:18 2004 +0000 Merge many XDarwin improvements: - Fix launch of X clients by double clicking in the Finder when there is a space in the path (Torrey T. Lyons). - Interpret scroll wheel mouse events correctly when shift is held down (Benjamin Burke). - Add option to always use Mac command key equivalents (John Harper and Torrey T. Lyons). - Add support for dynamic screen configuration changes in rootless mode (John Harper and Torrey T. Lyons). - Add documentation on generic rootless layer (Torrey T. Lyons). commit c2275b31adc3c4292c171055db16e00ee0e69e43 Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 19:04:14 2004 +0000 Removed bugs on TweakMemorySize() which prevented it from working at all. Initialized last element of BIOS version number string to 0 to avoid random problems. commit 5ed0aefc67e86abaddf1b6bffdc832996b86fb46 Author: Egbert Eich <eich@suse.de> Date: Fri Jul 30 18:40:36 2004 +0000 Fixed typo in a comment. Deleted bogus comment. Added debugging support. commit d380647739e4767da69edc44bbb441b3b9554b03 Author: Torrey Lyons <torrey@mrcla.com> Date: Fri Jul 30 18:22:13 2004 +0000 Add initial Xinput support for XDarwin (Greg Parker). commit 41641c11ec8994f1bc4bd1b05ae2cb38167c8312 Author: Torrey Lyons <torrey@mrcla.com> Date: Fri Jul 30 17:37:09 2004 +0000 Make XDarwin not default to StaticColor on ix86 (Shantonu Sen). commit f4c84e7dbf0f25a2544d4400e600310421683f3c Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Jul 30 12:03:56 2004 +0000 Fix for http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=940 - Filter /etc/init.d/xprint throught CPP/|MakeScriptFromCpp()| to allow platform-specific customisation. commit ed923a42b800e3f701084ef5828cabbbefe8361f Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:41 2004 +0000 file cw_render.c was initially added on branch COMPOSITEWRAP. commit 69e379ddaf85feda6a163b5f4e855ffe86b254df Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:41 2004 +0000 file cw_ops.c was initially added on branch COMPOSITEWRAP. commit 0ee93acd103af947fef0a28e32b5b3f2857789bf Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:40 2004 +0000 file cw.c was initially added on branch COMPOSITEWRAP. commit 3bdaa0e7fa7b6f5d550907d5fe7d0fb16c53e243 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:40 2004 +0000 file cw.h was initially added on branch COMPOSITEWRAP. commit 94e1ea569171334eb40a2d4a63138c02915203db Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:40 2004 +0000 file compwindow.c was initially added on branch COMPOSITEWRAP. commit 705536d04c4f09c84bb04827c07bb899584f399d Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:40 2004 +0000 file compinit.c was initially added on branch COMPOSITEWRAP. commit b80dbd886d7cc3a72772f3231a8c8e8df7f6679f Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:40 2004 +0000 file compalloc.c was initially added on branch COMPOSITEWRAP. commit beb26caf68d3e25bf85fd63dbb499eca4b1f05ba Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:40 2004 +0000 file compext.c was initially added on branch COMPOSITEWRAP. commit 97afc846003bb521cf9d6e92b298024d83db8759 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jul 30 06:54:40 2004 +0000 file compint.h was initially added on branch COMPOSITEWRAP. commit 854c1afa867ff617b47c4cde3cfd86bd26e9931a Author: Kevin E Martin <kem@kem.org> Date: Fri Jul 30 04:44:13 2004 +0000 Fix "DoLoadableServer NO" build commit 71164d118c192e96eb2b0fc45514233e9563a568 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Fri Jul 30 01:21:57 2004 +0000 Integration of XEVIE branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=947 Modified Files: cursorstr.h input.h inputstr.h windowstr.h commit 82a6a659248bb66a0364eb9eaf331747834fb5c6 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Fri Jul 30 01:20:42 2004 +0000 Integration of XEVIE branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=947 Modified Files: Imakefile Added Files: xevie.c commit dd7077cadcdc323e1a301ed5eefa7ff12599aa4d Author: Kevin E Martin <kem@kem.org> Date: Fri Jul 30 01:15:57 2004 +0000 Cleaned up code since client's saveSet is no longer defined as a pointer* (forgot one change in previous check-in) commit 813d75f9d3c7b540977926e37310fa683daf12e1 Author: Kevin E Martin <kem@kem.org> Date: Thu Jul 29 23:43:40 2004 +0000 Use LibraryTargetName when not building a loadable server Move extern function declarations to window.h Cleaned up code since client's saveSet is no longer defined as a pointer* Added externs back in Change #if to #ifdef to fix compiler warning Add function declarations that were inadvertently removed by previous check in Disable extensions that are not (yet) supported by DMX commit 274d5044ac41523ff23912c223177c429c710e09 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 18:49:42 2004 +0000 Integration of DAMAGE-XFIXES branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=859 Modified Files: Imakefile miinitext.c commit 406c49eb810cbdcfd833cac4eeaa465598238691 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 18:46:37 2004 +0000 Integration of DAMAGE-XFIXES branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=859 DAMAGE calls some shape functions. Modified Files: Imakefile shape.c commit 0bca00e1205bf1a4537cbf7be6339b3b1f9b953f Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 18:43:58 2004 +0000 Integration of DAMAGE-XFIXES branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=859 Modified Files: dispatch.c dixutils.c events.c window.c commit d4a101d4ef9943dcddf08b00b2d3ab4319597193 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 18:37:54 2004 +0000 Integration of DAMAGE-XFIXES branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=859 These RENDER changes come from the experimental freedesktop tree formerly known as "Xserver". Partly motivated by compatibility with DAMAGE as pulled from that tree, also some of the code just is better implemented. Modified Files: filter.c picture.c picture.h picturestr.h commit e1281790bb3d7cdcc5de85829806dd53da67e326 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 18:16:56 2004 +0000 Integration of DAMAGE-XFIXES branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=859 Modified Files: cursorstr.h dix.h dixstruct.h regionstr.h window.h commit d2f798b6dbaebd0300f42c2e083a962c37647620 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 14:42:24 2004 +0000 Integration of DAMAGE-XFIXES branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=859 Added Files: Imakefile damage.c damage.h damagestr.h commit 682ee8a9f8d55c6a6f517a277d1bfad2a0f28594 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 14:40:33 2004 +0000 Integration of DAMAGE-XFIXES branch to trunk https://freedesktop.org/bugzilla/show_bug.cgi?id=859 commit 6ed1c3845517c7731dcc74baa51bb801838afaff Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Jul 29 14:33:43 2004 +0000 bugzilla 859 -merging DAMAGE-XFIXES into trunk commit 736e511824c4f5e77e637c680a4e45f0b7631644 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Jul 28 03:57:19 2004 +0000 Fix shared reqs for Xlibi18n, Xaw6 & Xmu for Solaris Improved support for Compose and Kana Lock LED's on Sun keyboards Add event definitions for additional keys on Sun Japanese keyboards VUID mouse protocol support for Solaris Make default mouse message clearer on machines that use a default other than /dev/mouse. commit d374dffb20364a3df184cc28888ee7edbe50f474 Author: Rik Faith <faith@alephnull.com> Date: Wed Jul 28 00:28:00 2004 +0000 When using DMX console input, make detached screens display as grey (vs. white for attached and black for dead-space). commit 1498414cc85c148ef15b9b57d9f9b6b850bf2702 Author: Torrey Lyons <torrey@mrcla.com> Date: Tue Jul 27 20:26:47 2004 +0000 Fix Xprint build on Darwin. commit ddd58356123f61b863754eb0bdd42a8defa0461b Author: Torrey Lyons <torrey@mrcla.com> Date: Tue Jul 27 20:24:00 2004 +0000 Fix XDarwin's broken build of libGL and server side GLX. GL library is only known to build correctly on Mac OS X 10.3.4 and still needs some work for earlier versions. commit 8ef3e7052e8e1db869411e9f6fc88491e3f05474 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 27 09:53:14 2004 +0000 Merge latest changes from CYGWIN branch Use find | xargs combination instead of simple shell globbing to prevent commandline argument overflow commit a12a678bc9af8df1a3078f574b0c910e3e6983f8 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Tue Jul 27 06:20:52 2004 +0000 Fix a bug that caused an entire batch of events to be thrown out when one of an unknown type is encountered. (Ty Sarna, NetBSD). commit 19002e47a0dbf55e035b674116a533ec9814edfa Author: Alex Deucher <agd5f@yahoo.com> Date: Tue Jul 27 02:50:41 2004 +0000 - enable maven support for TV detection, DPMS, and DDC on crtc2 on G400 (Ryan Underwood) (http://bugs.xfree86.org/show_bug.cgi?id=1098) - expose I2CStart; needed for mga maven support (Ryan Underwood) commit 2a7b137d41eb8ce6efc45b47b5df0c89eb4f5d93 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Mon Jul 26 22:41:47 2004 +0000 remove extra ';' (Alan Hourihane, Keith Packard). commit 799208dd44a65b18dda97b4843a27a2628f955f4 Author: Adam Jackson <ajax@nwnk.net> Date: Mon Jul 26 19:06:04 2004 +0000 Bug #377: Make lib{glx,GLcore,dri} work when compiled as dlloader modules. commit f15f881727cee9a879bd43be8dc849320f8d3cbd Author: Keith Packard <keithp@keithp.com> Date: Mon Jul 26 17:14:27 2004 +0000 Eliminate bogus rate check in fbdevModeSupported. Hmm. Potentially bogus rate selection necessary for Mac fbdev Don't know about fb changes to pixmaps, so can't track dirt. Add Mac specific 1280x854 mode. Warn when requested mode isn't found. Add ability to soft-boot video cards. Add region expand request. FIXME: need test cases commit 20913b7d5daf90e0f7ad1ee967ad2f0daaec40f9 Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Jul 24 17:35:39 2004 +0000 Fix a problem with wsmouse driver loosing events on 64bit architectures (XFree86 Bugzilla #1438, John Heasley). "To fix this, I've added a mouse buffer (Xisb buffer) "scale" value to the MouseDevPtr type. If set, it is used as structure size of which we want space for a few." commit c57944cd9aaac717d4d4ada44626e35925b39bbd Author: Keith Packard <keithp@keithp.com> Date: Sat Jul 24 17:02:49 2004 +0000 Check for mmio before restoring crtc/crtc2 pitch registers commit 5fdff8b95e8f90221a46717c2f84715ab238460c Author: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sat Jul 24 16:32:39 2004 +0000 Bugzilla #884: OpenBSD/amd64 support. commit cc3e0173d9fae8a40eb46606d9951e3aa1df975a Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Thu Jul 22 19:24:50 2004 +0000 Thu Jul 22 20:03:11 2004 Soeren Sandmann <sandmann@daimi.au.dk> Call MMX solid fill routine when available. Call MMX operations when available. New HasGcc34 macro New file with many operations implemented with MMX intrinsics, conditional on having GCC 3.4 on i386. commit 9565d9e0cf85e6f5fb47acebdd66212bd6cc3e08 Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 22 18:17:59 2004 +0000 Correct pitch so that accelerator can run on 1400x1050 screens. Add a few more register sets for cursors. commit 67dbad6b3b9163eafae7d9dd7698708e10372a21 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jul 22 06:48:19 2004 +0000 DRM 20040721 import commit 829b2c72a6433ebaf63f2d2726259c73cca4bd1a Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jul 22 06:48:19 2004 +0000 Initial revision commit 448e0754e369d433a61ae337bbfd7dba195c5e69 Author: Phil Blundell <pb@reciva.com> Date: Wed Jul 21 20:33:35 2004 +0000 Include -lts if appropriate. Patch from pattieja@bentham.ispvip.biz. commit 0c32a94623b13dd1ac5b015b465bdf890f498282 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Tue Jul 20 15:15:13 2004 +0000 Bugzilla #889: Bind -from address to port number 0 instead of 177 commit 07e6011106dcfa0ab69861aa7dcbb88382625c16 Author: Phil Blundell <pb@reciva.com> Date: Tue Jul 20 14:33:42 2004 +0000 Select optimized 16bpp shadow copy functions if screen is 16bpp. Select -YX versions for 90 and 270 rotations if architecture is ARM. commit 797114414096d7bf7ed0d73a878d0cffef262301 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Jul 19 22:01:52 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=893 - Fixing the bug that Xprt did not honor ${LC_ALL} when looking for model-config dirs. commit 8853f9331826899229e5b7c964e9c852c0371ce5 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Jul 19 12:07:01 2004 +0000 Add support for a8b8g8r8 and x8b8g8r8 pictures, which showed up frequently with metacity usage. commit adf4b38f49da063576b48f9c0750b78bb753b3de Author: Eric Anholt <anholt@freebsd.org> Date: Mon Jul 19 11:42:49 2004 +0000 Breakage in last commit to this file: pCurPriv->area isn't set up until Enable, these days. commit d2e74e419d2c75c5a5b97236d2714730e6f69ee0 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Jul 19 11:19:12 2004 +0000 Set the right number of texture coordinates for r200 Render support (still disabled, needs to be tested). commit cefcb7f123c962c3715b0c46f30430e87c82a017 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Jul 19 11:16:13 2004 +0000 - Add Radeon picture transform support. - On R128, don't refer to an old Composite's mask transform when the current Composite doesn't have a mask. - Staticize some global variables in r128_composite.c. commit 9fe216a45836b98b5aea55725019668de3900e83 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Jul 19 07:53:54 2004 +0000 Use the offscreen memory manager as much as possible to do the reservation of memory at startup. Do some drive-by cleanups while I'm here (sorry!). commit e2bb9f38cdcb74fd7630f4efe310ad14d597171e Author: Eric Anholt <anholt@freebsd.org> Date: Mon Jul 19 07:20:01 2004 +0000 Add support for transforms of textures on R128. commit c04264727860cbe2e276e1934d6700d0baaf9f73 Author: Rik Faith <faith@alephnull.com> Date: Sun Jul 18 22:19:33 2004 +0000 Addition of console input after removal of core backend input that is not on screen 0 can cause a segfault. Fix by preventing reinitialization of detached inputs. When Xinerama is active and screen 0 is detached, pixmaps for XGetImage must be obtained from another screen. commit 0addd0d499046fc8a6cdc18fc41d34cac2ba77ea Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sun Jul 18 05:21:20 2004 +0000 Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=858 - Fixing the problem that clients cannot use the TrueColor visual without calling |XInstallColormap();|. commit 7f9e263658b1c9c435db851a8afd904a2f584d13 Author: Kevin E Martin <kem@kem.org> Date: Sat Jul 17 20:44:14 2004 +0000 Revert change to MAXFORMATS to maintain binary compatibility commit c47a1bdd7463b6863018e2c4237acfd28b89f38f Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Jul 17 01:13:31 2004 +0000 Fix typo in debug message in MakeAllCLTSServerListeners Add $(GETPEER_DEFINES) to DEPEND_DEFINES for makedepend Add "localuser" and "localgroup" access types to server-interpreted authentication scheme. commit 3e52373fc8179a59efc9e7ab22ce0cb5160d0409 Author: Carlos Romero <kcrashcore@bellsouth.net> Date: Thu Jul 15 09:56:40 2004 +0000 Enable i810. commit aeb78eaa980ac93f6af3e947ab1ad8bce5bc5bd1 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jul 8 08:21:25 2004 +0000 Commit the rest of the dirty optimization from 20040703 and add a missing header include. I don't know how this happened, but I'm going to blame a "few" fscks having happened between testing the code and committing (due to other driver changes that made me not blame dirty for the failures I saw) for disappearance of kasync.c changes. Fixes a lot of corruption. commit b46767352822b09e5dab8b54cbb7a37a9b62de53 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jul 8 06:57:58 2004 +0000 Remove duplicate protos in kdrive.h. commit 764d9e822b01fdfe3ff088028959cbc48b349026 Author: Carlos Romero <kcrashcore@bellsouth.net> Date: Wed Jul 7 20:43:25 2004 +0000 missing xkb/[xkb.h, xkbDflts.h] and hw/kdrive/mga/g400_common.h commit f96ef08d48b01f6119799ede9ffc43d0134cbf8b Author: Carlos Romero <kcrashcore@bellsouth.net> Date: Wed Jul 7 19:21:07 2004 +0000 Initial kdrive XKB/XINPUT support, use --enable-xkb --enable-xinput commit a5c9b3229ce418a5e3eacc40b7a7f11c0a26d958 Author: Rik Faith <faith@alephnull.com> Date: Wed Jul 7 04:32:52 2004 +0000 Bugzilla #817 commit 1498d7a096f0855fa965585acd9ca4a2780cc959 Author: Kevin E Martin <kem@kem.org> Date: Tue Jul 6 23:51:00 2004 +0000 - Disable building DMX on OSs that have not been verified to build correctly (Kevin Martin). - Fix DMX build when Xinerama is not enabled (Kevin Martin). commit 0e45f2a7536bf4b66d6f64d96b44431310884af3 Author: Egbert Eich <eich@suse.de> Date: Tue Jul 6 14:49:13 2004 +0000 ifdef'ed some IA32-only assembler statements. Presently these chipsets are IA32 only, anyway (Egbert Eich). Disabling generic VGA testing for IA64 architectures. Temporarily disabling support for ZX1 bus. This code is extremely invasive and is executed as fallback without testing for a ZX1 chipset. It brings a SGI Altrix to a grinding halt. (Egbert Eich). commit df2b55a25b7056ac92c1f6cbee9f16bd0a37ba8c Author: Egbert Eich <eich@suse.de> Date: Tue Jul 6 14:37:48 2004 +0000 Separated Intel drivers from default DriDrivers to avoid building them on IA64 (Egbert Eich). Fixed wrong function prototype (Egbert Eich). Don't test for generic VGA on IA64 (Egbert Eich). Fixed a segfault when accessing a structure before verifying the pointer exists (Egbert Eich). Added a showcache option for debugging (Egbert Eich). Increase default video RAM size to 16MB when DRI is enabled and more than 128MB are available (Egbert Eich). Fixed lockups during mode switch. Problem was introduced when attempting to copy the behavior during LeaveVT()/EnterVT() but but forgetting to call I810DRILeave() before I810DRIEnter(). The entire DRILeave()/Enter() scenario has been commented out as it didn't seem to be necessary (Egbert Eich). Fix TweakMemorySize() (tested with i855/i865) (Egbert Eich). increased MAX_DEVICES to 128 (Egbert Eich). Use OS provided PCI config space access as default method (Egbert Eich). Added support for Linux 2.6 proc file format. Fixed unaligned accesses to pieces of the VBE info block. VESA did not align elements to size (Egbert Eich). commit 7c466d64c34e68e0bc50e083861874161ae02db9 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jul 3 10:23:03 2004 +0000 Clean up Rage 128 composite code. Now it composites more operations correctly and is simpler. commit 020701566916c8569f5af7f2efe1de36fea2002e Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jul 3 09:16:30 2004 +0000 Add a "dirty" flag to the pixmap private. Clear it when setting up an offscreen pixmap area, and set it when any rendering occurs. When moving a pixmap out of offscreen, don't read data back if it wasn't dirtied (compared to the system memory copy). commit fd594b0559caa98ee0823be956aecf9c9d2e52bc Author: Phil Blundell <pb@reciva.com> Date: Fri Jul 2 21:30:00 2004 +0000 Call ts_read multiple times, to avoid events getting stuck in the pipeline. commit 7976ee51afcad41b611e642d2feb31d805dedcf6 Author: Kevin E Martin <kem@kem.org> Date: Wed Jun 30 20:06:56 2004 +0000 Add Distributed Multihead X (DMX) support commit d5db59bd79f5d8788b99056bf9d969b5b3ad99e1 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Jun 29 20:37:51 2004 +0000 Add an offscreen area scoring to improve choosing offscreen areas to kick out when allocation can't find a free area of the requested size. When offscreen pixmaps get used, the offscreen area's score is increased by a constant value. Every certain number of increases, all offscreen area scores get decreased by a fraction. When choosing a set of areas to remove for a new allocation, the set of areas with the smallest total score is chosen for removal. While this is not the smartest system, it prevents things like always removing the first offscreen area in memory (likely the most recent) to be kicked out when doing replacing. commit ea78d1c6fcd27d28e69cb97faf72b7b719f6f93e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Jun 28 18:08:26 2004 +0000 Add GLX_ALIAS_VOID for GLX_ALIAS of functions with return type void to fix builds with non-gcc compilers that refuse to let you do return function_that_returns_void(...) programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c Remove includes of xf86drm.h that break non-DRI builds commit 7ff67f2872ddd15908f789ec9bdb76e8211d6431 Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 28 00:48:51 2004 +0000 Separate out off-screen allocation from Init. Fix Enable to update off-screen addresses. Wrap RandR to update off-screen addresses. Set off_screen_base and memory_size fields correctly. commit 5b75aae2cf1ad38556e9a55da72ad65419aa7f84 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 26 04:13:03 2004 +0000 Add ARGB cursor support for Radeon cards. commit 8bc0bc6d36dbc5000069017a1984905065164016 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Jun 25 08:58:18 2004 +0000 #Bug 784: Ignore unconfigured interfaces with xdmcp commit c5ab3fdd928d12b4dc28108f2242b3b75e1ac65f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Jun 25 08:56:04 2004 +0000 #Bug 780: add RRSetScreenConfig commit f8226cee08a00b49f32dc3db814478490febe45d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Fri Jun 25 00:02:11 2004 +0000 Fix for http://xprint.freedesktop.org/bugzilla/show_bug.cgi?id=791 - Adding special support for Canon C3200N commit ad6b9644a39343437967b4c3b2442dbd47508443 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Thu Jun 24 06:26:27 2004 +0000 Fix for http://xprint.freedesktop.org/bugzilla/show_bug.cgi?id=660 : Fix for the issue that GetPrinterList does not return printer descriptions on Solaris. The patch implements a framework which allows the printer enumerator scripts to pass additional printer attributes to the information pool (currently only "xp-printerattr.descriptor" is implemented). commit 884908a63c624585c9b5fcf22d565236298c2916 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Jun 22 10:18:13 2004 +0000 Fix for http://xprint.freedesktop.org/bugzilla/show_bug.cgi?id=789 : Adding a workaround for the issue that Xprt may hang when the CUPS spooler frontend sends messages to stdout. commit c66cc2a219e860ae3c0b5d4ad18b22a6dc4e16df Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jun 21 13:51:57 2004 +0000 Bug 783: rootless patches for cygwin commit ed7f92e791f052d64cffef4b44eae5160fb24689 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jun 21 13:44:14 2004 +0000 Bug 778: add ddxBeforeReset commit 68d92cca1a696521599db6a826d2187ec0c15f01 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jun 21 13:35:05 2004 +0000 Bug 782: Merge native OpenGL for Windows from CYGWIN branch commit d6e8b1affec7351549c0006cc63b6923091cdd68 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Jun 21 13:19:32 2004 +0000 Bug 777: Merge from CYGWIN branch commit dfdbb60bf5f613b3554d5435f08f16bde72aa353 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Jun 21 00:29:46 2004 +0000 Fix for http://xprint.freedesktop.org/bugzilla/show_bug.cgi?id=772 - RFE: Switch default resolution from 300DPI to 600DPI commit dd831c7a5c1b0c540a78350aadaeb34a8aa67395 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat Jun 19 21:56:01 2004 +0000 Refix for http://freedesktop.org/bugzilla/show_bug.cgi?id=764 : Rework previous solution and make Xprt to default to "-noreset" (the default of Solaris version of Xprt) and add a "-reset" option which can be used to restore the default behaviour on demand. commit da78a4ddd833f78baf1d2579a1adea8208016ddb Author: Damien Ciabrini <braun@club-internet.fr> Date: Wed Jun 16 21:36:54 2004 +0000 Update MGA composite patch commit. (some files were missing in the previous commit) commit e56e24af252bd3b8e58076adf0f8eabf1103f187 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jun 16 09:37:59 2004 +0000 Merge DRI-trunk-20040613 changes in programs/Xserver/GL. commit 2e1868b560315a8b20d688e646c489a5ad93eeae Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jun 16 09:25:21 2004 +0000 DRI trunk-20040613 import commit f45c46c630855e8e0d1c28b1f0d3b2ad54334619 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jun 16 09:25:15 2004 +0000 Initial revision commit 22bad9474b8822f03f84a8a39edce624bfb9befa Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jun 16 09:22:17 2004 +0000 DRI XFree86-4_3_99_12-merge import commit 1c133c27ccc1f09b95922fdece3c8d73cc182def Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jun 16 09:22:05 2004 +0000 Initial revision commit b61ff0daa4bd1e3b828dc5b985c3a2f3c92b202e Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jun 16 09:16:01 2004 +0000 DRM 20040613 import commit bcc1eab1fd57e8cb686d625934a6e527b7ae4ea2 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jun 16 09:16:01 2004 +0000 Initial revision commit 580b9a7da1bf0e20acdcddd676d471b3d6589023 Author: Jaymz Julian <jaymz@artificial-stupidity.net> Date: Mon Jun 14 08:43:57 2004 +0000 MGA composite support from Damien Ciabrini - thanks! commit 95d65cf6bb753d10f4db3d857fb98bb09389228e Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Jun 13 04:50:21 2004 +0000 Manual page X(7) does not reference Xprt(1x), xplsprinters(1x), etc. xc/config/cf/Imake.rules Correct comment to match rule name for InstallDriverSDKObjectModule xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c Log results of ioctls to probe keyboard type & layout commit 4ffde8a6b3299f002c10b1abd881e4c6849767ea Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jun 10 19:22:58 2004 +0000 - Pass the right pixel mask (all ones) in to PrepareSolid in the solid-fill-based composite acceleration. - Use a real pixmap when doing an UploadToScratch (For pDrawable->type == DRAWABLE_WINDOW, you need to get the backing pixmap). - Pass back the x/y offsets from kaaGetOffscreenPixmap unconditionally, because they'll be used in the scratch case. - Turn on the Render acceleration for Rage 128 and Radeon 100-series at last! commit c3bc6dd551436d5e37a07f37b3b77a83bb5b5da0 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jun 10 09:50:59 2004 +0000 Align scratch area offsets to the offscreen byte alignment. commit cf3f95d2164604047866b283fe0071574bf16dbc Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jun 10 08:37:28 2004 +0000 Oops, testers reported that the last patch actually didn't work (conflicts occurred), so the R300 PDMA doesn't work. Disable. commit 0b7647ee359537953b67b0dbf9daa807e356062b Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jun 10 05:57:31 2004 +0000 Bug #242: Fix setup of R300 cards, by providing R300 CP code from volodya-project and initializing PDMA. commit b3a18ca8b827cfe2ebb295a03a9776028242c1a0 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Mon Jun 7 05:13:29 2004 +0000 Neomagic driver enabled commit 893ea125597f3c6273f45a51673d4dc514e754e9 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Mon Jun 7 05:05:10 2004 +0000 small fixes. README added commit d9cca52feba13b69f3eea9e1d958b8a4711e7d67 Author: Keith Packard <keithp@keithp.com> Date: Fri Jun 4 17:06:18 2004 +0000 Add (stubbed out) Xgl server code commit f8a1dd3ce725195baa6f38a880299752c6c6c2c4 Author: Keith Packard <keithp@keithp.com> Date: Fri Jun 4 16:10:50 2004 +0000 Add top-level build support for GL X server (not working yet) Fix a few allocation bugs with alternate visual ids Allow for non-8/8/8 alternate visuals Turn off any existing shadow before enabling it again (avoids re-registering existing damage) Add some validation code to catch re-registered damages commit 6741fadc52598af0096f106a2cefd640abb434b3 Author: Phil Blundell <pb@reciva.com> Date: Wed Jun 2 20:49:50 2004 +0000 New conditional. (REQUIRED_MODULES): Demand xcalibrateext if building XCalibrate. New file. Add xcalibrate.c. Read raw events if requested. commit d4d0c8470c4272dec642ab4c68f44a83cda06971 Author: Phil Blundell <pb@reciva.com> Date: Sun May 30 20:40:30 2004 +0000 Add -lts if using tslib. commit 8124810950d7e0b9db7f66dadee7218b0c26c4c3 Author: Carlos Romero <kcrashcore@bellsouth.net> Date: Sun May 30 13:51:18 2004 +0000 Initialize permedia engine for acceleration to work. commit ea1bbf8d83d3780ccce5ebcdff48f0b19863cee1 Author: Ralph Thomas <ralpht@68k.org> Date: Sat May 29 12:15:46 2004 +0000 Adding driver for VIA CLE266 graphics chip. Currently it only accelerates copy and fill operations. commit 6af411b02e808220d3afcef14abb97eec86cf1f3 Author: Daniel Stone <daniel@fooishbar.org> Date: Fri May 28 04:56:49 2004 +0000 Hey, I like devfs. Try /dev/fb/0 if /dev/fb0 fails. commit a7b42f685e7a4bf57cf89a3ef664a581ecedb50f Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Thu May 27 14:11:42 2004 +0000 file ChangeLog was initially added on branch CYGWIN. commit 05a3dbf5dc55ea534c68fc9d05b3949805a0752e Author: Egbert Eich <eich@suse.de> Date: Wed May 26 17:44:29 2004 +0000 Updated x86emu and resynced with upsteam at Scitech. commit 9549f628e066396e6bc9a7edfc919bdd6860f170 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Tue May 25 20:33:46 2004 +0000 getconfig: file '/usr/X11R6/lib/X11/getconfig/xorg.cfg' has bad signature (Change "Xorg Project" to "Xorg Foundation" to match getconfig script) commit f8124d3ef5890d59c3ce41bee46b5e3576d0f9b1 Author: Carlos Romero <kcrashcore@bellsouth.net> Date: Tue May 25 13:02:44 2004 +0000 Add pm2 to the build commit 32d0920ef9ec3c5e61089b88dedc82ffab294276 Author: Carlos Romero <kcrashcore@bellsouth.net> Date: Mon May 24 19:31:41 2004 +0000 Initial import of Permedia2 driver commit 5b2211ec3545f1634f807daf84b6c4bc2c0fdecf Author: Egbert Eich <eich@suse.de> Date: Mon May 24 19:05:01 2004 +0000 Muffle compiler warnings. fix option name in log message. improve debugging messages. commit 932efe8e6d4e6280aed9b5e25af56888c964d37b Author: Keith Packard <keithp@keithp.com> Date: Fri May 21 03:32:27 2004 +0000 Allow for multiple composite-based visuals, then add an RGB24 visual in addition to the ARGB32 one. This allows 'glitz' to run on top of any X server using mesa. Switch to using 32bpp for depth 24 pixmaps (even when the frame buffer is not depth 24). commit cde51fd05b2bd413d8db8ad750e6a72398a7039c Author: Keith Packard <keithp@keithp.com> Date: Thu May 20 19:51:44 2004 +0000 Miscomputing pitch in 24bpp modes because of rounding errors. commit b9d920f3dc060d230a4a7b2d40210524acf50666 Author: Keith Packard <keithp@keithp.com> Date: Thu May 20 05:27:03 2004 +0000 Fix SYNC_ALWAYS (debugging) code to use mach64WaitIdle instead of KdCheckSync -- the boolean used in the latter won't be set yet. Oops. == instead of =. Must sync hardware before rasterizing trapezoids in case the mask is in off-screen memory and has just been erased. Yes, it is silly to place masks in off-screen memory. That's a separate issue. commit 94648799c82e59166155ca5abf22a9391693e6a1 Author: Keith Packard <keithp@keithp.com> Date: Thu May 20 02:42:20 2004 +0000 Pin header-only pixmaps in memory. Off-screen reallocation could have used a stale pointer. Separate framebuffer mapping computation from actual frame buffer mapping. Now map the frame buffer from vesaEnable so that VT switch shares the same mapping code. This makes sure any shadow framebuffer is allocated again. commit cade317d31dddab61199d5e90bcff36fb12f3cd1 Author: Eric Anholt <anholt@freebsd.org> Date: Mon May 17 20:18:02 2004 +0000 Overhaul of the ATI driver: - Add monochrome hardware cursor support. - Try to auto-detect AGP support for DRI on Radeons. And fail. Detect it properly on R128. - Set up card for pseudo-DMA if possible. Convert 2D rendering code to prepare DMA packets only. Use generic code to decode DMA packets to MMIO if PDMA is unavailable. Add WIP code to support "real" DMA without DRM support. - Dispatch pending DMA commands when the server sleeps. Otherwise some things, such as typing in an xterm, wouldn't show up for a time. - Fix Radeon Composite acceleration in many ways, and add Rage 128 Composite acceleration. Disable them both due to still-not-understood issues they have. They fail with In, Out, AtopReverse, and Xor, and text rendering is strange. - Add textured XV support for R100 and Rage 128. No brightness/sat controls, but it does support multiple ports, and cooperates with Composite. - Add WIP code for hostdata uploads. - Many cleanups and fixes. commit 834537e212e01314b60737278b7abc6bb7cef102 Author: Eric Anholt <anholt@freebsd.org> Date: Mon May 17 07:19:49 2004 +0000 Make kaaMoveInPixmap public. This will be used by the ATI driver's xvideo support to ensure that the destination is in framebuffer. commit 85f46e0bcdf60d145a6868ee71d10688c9113e6e Author: Eric Anholt <anholt@freebsd.org> Date: Mon May 17 07:14:23 2004 +0000 Add new CheckComposite hook. This allows a driver to avoid the migration of pixmaps for a Composite operation if the operation can't be supported. This hook is optional. commit 47fb207c8ae2b54e976066f78892a1ee3fb35d30 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun May 16 05:08:39 2004 +0000 xc/programs/Xserver/fb/fb.h xc/programs/Xserver/fb/fboverlay.c xc/programs/Xserver/fb/fbscreen.c - Change #ifdef for checking for old format miScreenInit to FB_OLD_MISCREENINIT for easier portability to xservers with updated screen structs but old function prototypes. Make it automatically defined if FB_OLD_SCREEN is defined. - Add _LP64 to list of #ifdefs for 64-bit platforms to support 64-bit Solaris. commit fc2dd516c3c7382915452207180a1c483d0d73ca Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun May 16 00:03:54 2004 +0000 xc/programs/Xserver/hw/xfree86/xf86config/Imakefile xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.c - Clean up server name changes from TM branch - Set default XKB rules file name correctly - Use default font path from Imake configuration for the default font path in generated xorg.conf files. - Use path variables from Imake configuration for paths to files, in case vendor has configured them to install somewhere other than the defaults. commit b1aa9499ffb827f4b1acc75f197e332bba382565 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat May 15 14:43:05 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=622 - RFE: Xprt default BIGREQUESTS extension buffer size should be 8MB (to make |XpPutDocumentData()| happy and to improve performance). commit 74b2a7694791297a4f798ecc05c7eb8f68634722 Author: Eric Anholt <anholt@freebsd.org> Date: Fri May 14 00:34:28 2004 +0000 Add new flag, KAA_OFFSCREEN_ALIGN_POT, which tells KAA to align pixmap pitches to a power-of-two number of bytes. Useful for Render acceleration on older cards. commit 2bea33e881693e7d7dcf938db79c888a71dfb2fb Author: Eric Anholt <anholt@freebsd.org> Date: Fri May 14 00:27:29 2004 +0000 Don't let the visible screen get "migrated" offscreen, which manifests itself as a hang. Reported by: Ginokas <ginokas@free.fr> commit 40354e761892dc2ef88d2e722d8d7896642003eb Author: Eric Anholt <anholt@freebsd.org> Date: Thu May 13 22:57:15 2004 +0000 Add generic functions for copying packed/planar XV data, copied from mach64. commit 2e330e980f61b256c55f5b9debb00574e4e85b26 Author: Eric Anholt <anholt@freebsd.org> Date: Thu May 13 21:41:48 2004 +0000 Move fourcc.h to a generic location in src/. commit f52a4d472d2463482d865c5006208182c294e670 Author: Keith Packard <keithp@keithp.com> Date: Thu May 13 21:25:51 2004 +0000 Follow GLX in setting ARGB visual nplanes to 24. Retry current mouse protocol when sync is lost commit aa5a87847290d49b03a33351ebfd8df652a42489 Author: Eric Anholt <anholt@freebsd.org> Date: Thu May 13 21:15:06 2004 +0000 There's no need to explicitly set softCursor -- kdrive handles this if the cursor hooks aren't set. commit 4078457919708a8dbf9db8ee6e4871ecbf72518f Author: Eric Anholt <anholt@freebsd.org> Date: Wed May 12 01:49:46 2004 +0000 Fix problems in render fb implementation found by rendercheck: - fbCombineSaturate was pointed at fbCombineDisjointOver, instead of fbCombineDisjointOverReverse as it should. Instead, point fbCombineDisjointOverReverse at fbCombineSaturate (which is likely to be faster). - fix previously-unused fbCombineSaturate implementation. - fbCombineMaskAlphaC was just a copy of fbCombineMaskValueC. Make it do what it's supposed to (return a cs.alpha). - fbCombineAtopC didn't invert the source alpha value. - fix copy'n'paste errors in fbCombine(Dis/Con)jointGeneralC, also source alpha wasn't treated in a component fashion. - fbCompositeSrc_8888* didn't handle when the source lacks an alpha channel. Rather than adding that and possilby slowing down the (normal) alpha case, don't let x8r8g8b8/x8b8g8r8 Pictures be used in fbCompositeSrc_8888* because Over with one of these is just Src. commit a43d5412b4d79d67af20dc8af144a9ca80263e9d Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Sun May 9 16:20:13 2004 +0000 file ChangeLog was initially added on branch CYGWIN. commit 0498d818fe40cb4eb03983e27a980791bbadf6db Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sat May 8 02:06:46 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=608 ("Can not print on Debian/CUPS due to error |Xprt_64:lpr: unable to print file: server-error-not-accepting-jobs|"): Xprt did not setup the list of supplementary group ids, causing print failure when the the calling user must be a member in a specific group to be allowed to print. commit 75d96afcc4a1f201da665bd73b7067e8e7139a3f Author: Egbert Eich <eich@suse.de> Date: Thu May 6 17:31:17 2004 +0000 BugZilla #601: Fixing makedepend choking on floating point exception because CHAR_BIT is defined to __CHAR_BIT__ which is a compiler intrinsic define. BugZilla #605: Fixing build on IA64 which is broken due to the inclusion of the kernel header asm/page.h. Kernel headers however don't work with -ansi. The inclusion of asm/page.h can however savely be removed as it there are plenty of other ways to determine the page size. commit 7124cfaa006e840ba48dcc466c0dc8b34503a686 Author: Keith Packard <keithp@keithp.com> Date: Thu May 6 16:19:32 2004 +0000 Use current resolution by default, change rate to 75 to match fbdevModeSupported cut-off (?). Glenn McGrath <glennm@hydrix.com> commit e4ac2411eddf1f01ef9204f27b6d1ce8f1749439 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Thu May 6 01:53:52 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=551 - PS DDX will not build on platforms with BuildFreeType NO. Patch by Alan Coopersmith <alan.coopersmith@sun.com>. commit b1c65e1ca6828ea82ee7790f22c26503b0a5e17d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Thu May 6 00:24:32 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=536 - RFE: PS output should contain the FreeType2 version being used. commit 8d4f21ab53c44ca48501d6211ea6db0c0b8af916 Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:15:41 2004 +0000 Add XACE and XSELINUX extensions to the build system commit 0106715000196c7b349a0b4494b61545f0f5e138 Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:07:37 2004 +0000 Modify XC-SECURITY and XC-APPGROUP extensions to work with XACE commit 8526cd6395490b03b279f1962df777fb0e4a9878 Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Wed May 5 20:04:52 2004 +0000 Replace XC-SECURITY code with XACE security hooks commit 6d066cb10990d951449b342b40dec1f1b1ae593c Author: Eamon Walsh <ewalsh@epoch.ncsc.mil> Date: Tue May 4 19:44:02 2004 +0000 Merge the new release from HEAD commit b5f200ce9d495c6ce94e0170909465a30e8799d9 Author: Keith Packard <keithp@keithp.com> Date: Tue May 4 03:28:06 2004 +0000 Attached is a patch to fix a build error whe ncompiling with tslib support, a variable wasnt set, i just changed it to be like the other MAkefile.ams :) -- Glenn McGrath <glennm@hydrix.com> commit 5ca651e66f3d0ab189962bb4609b87a865364ef8 Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Apr 30 12:48:56 2004 +0000 file winmessages.h was initially added on branch CYGWIN. commit 2c2c1704b542f29fe5ac9917e1141040a0dbd3e9 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Thu Apr 29 23:59:15 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=567 - Xorg Xprt starts to consume 100% CPU when being idle for some time (internal screensaver goes mad after 10mins) commit a8429d76103ff0f4fc61db86201c741f91bfcba2 Author: Keith Packard <keithp@keithp.com> Date: Wed Apr 28 07:26:46 2004 +0000 Add completely fake X server -- draws to allocated buffer, has no keyboard or mouse. commit 85e4e5445218d70f627fb132a8e8f18470e6749d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Mon Apr 26 11:07:03 2004 +0000 Work-in-progress for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=542 - GLX support for PS DDX / part #1: Fix visual setup (attachment #243) commit 46472cbee679f9757c4003a0dcf158aeb3852f47 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Apr 26 02:39:58 2004 +0000 xc/config/cf/sun.cf xc/config/cf/sv4Lib.rules xc/programs/Xserver/Imakefile xc/programs/Xserver/hw/xfree86/os-support/sunos/find_deps.pl Make Solaris builds work when using MakeDllModules (it's not the default yet, but at least it works now if you turn it on) Also improve default compiler, optimizer, & linker flags for Solaris builds using either Sun cc or gcc xc/programs/Xserver/cfb/Imakefile.inc xc/programs/Xserver/cfb/stipsparc.s xc/programs/Xserver/cfb/stipsprc32.s Remove text relocation error when building shared versions commit 36e3e5430e1ca7103a4e0b796eb3817975b40d90 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Sun Apr 25 22:42:09 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=541 - Xorg Xprt may crash with "Freeing resource id=40200000 which isnt there" commit 2fb588620030ad393f8500d60e16144d59e4effe Author: Egbert Eich <eich@suse.de> Date: Fri Apr 23 19:54:30 2004 +0000 Merging XORG-CURRENT into trunk commit 0664db19bf37f9dd69cca6adff4e238e310c3092 Author: Egbert Eich <eich@suse.de> Date: Fri Apr 23 18:54:16 2004 +0000 Merging XORG-CURRENT into trunk commit 68fd529608c58334f13beb88dbcc1d5db85b9b00 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Apr 21 23:24:20 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=535 - Xprt should not annouce extensions which are not supported commit 1af13123fa79ad1c6747aad60ed458bbd69da12d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Wed Apr 21 10:03:41 2004 +0000 Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=530 - Land XPRINT branch on XORG-CURRENT commit 449e83a9470ec4bdd0871e2f263f608b24455423 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Apr 18 03:00:43 2004 +0000 xc/lib/GL/glx/Imakefile xc/lib/GL/mesa/src/Imakefile LargePICTable required for Solaris SPARC builds xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c xc/programs/Xserver/hw/xfree86/common/xf86Events.c Add != NULL to if statements to get past syntax error reported by Sun Forte 6.1 cc. xc/config/imake/imake.c xc/config/cf/sun.cf xc/config/cf/sunLib.tmpl Allow compiling with Sun compilers installed somewhere other than /opt/SUNWspro xc/programs/Xserver/hw/xfree86/common/compiler.h xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h Check for defined(sparc) as well as defined(__sparc__) since Sun compilers don't define __sparc__ commit 425251a752805affb6ce14baa58d92c384f39501 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sat Apr 17 18:47:05 2004 +0000 Bugzilla #495: LocalClientCred should use getpeerucred on Solaris 10 commit 7215fb186f076a24d0a04c9c20ac9b92cae1f49b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Apr 16 00:21:24 2004 +0000 xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_mouse.c Solaris mouse enhancements, including autoprobe support, VUID wheel mouse events, and streams module pushing. Bugzilla #434. (Russ Blaine & Alan Coopersmith, Sun Microsystems) xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_init.c Xorg doesn't reset console to text mode on Solaris x86 8 and later Bugzilla #469. commit c6c6d0de2309019999fa75a2f36a4f4a93ad2f31 Author: Egbert Eich <eich@suse.de> Date: Thu Apr 15 10:17:35 2004 +0000 Merged changes from RELEASE-1 branch commit 9d24a5fa91bf165bbd2048a844edeb59b5e34aad Author: Harold L Hunt II <huntharo@msu.edu> Date: Wed Apr 14 00:01:22 2004 +0000 file XWinrc.man was initially added on branch CYGWIN. commit 01bb5eb5032a7566c86a51053146dba98a3ed749 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:46 2004 +0000 file psout_ftpstype3.c was initially added on branch XPRINT. commit cb3f3d8f2283d384dc5a3af3f38053cc8a2d192e Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:46 2004 +0000 file psout_ft.c was initially added on branch XPRINT. commit 7cfb4c2b33ae2147b5d6ddc2afc8b777686a666f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:46 2004 +0000 file psout_ftpstype1.c was initially added on branch XPRINT. commit 4ae42e79d46d7db30f7b6f321bbb0d134862138d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:46 2004 +0000 file PsFTFonts.c was initially added on branch XPRINT. commit b5fb71922b02024aa5a8f349c9d2c956e2f83f0f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:45 2004 +0000 file xprint.sh was initially added on branch XPRINT. commit ca9a9a58be51a21f123b11dd68047034696cae84 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:45 2004 +0000 file xprint.csh was initially added on branch XPRINT. commit 7c1f840108172d6b18af47465ea72f4820640598 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:45 2004 +0000 file cde_xsessiond_xprint.sh was initially added on branch XPRINT. commit 579221198aeac7010435b29db1ad8fe9ee2d7c5d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:44 2004 +0000 file spooler.c was initially added on branch XPRINT. commit 7677b4992fee7eb73cc97914163dcf689ad13d6a Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:44 2004 +0000 file spooler.h was initially added on branch XPRINT. commit d3907ca519b476c99e29a58c22258f22dbe63244 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:44 2004 +0000 file document was initially added on branch XPRINT. commit 3646bb9c894d5f011e2df4fac402118d8350102e Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:39 2004 +0000 file spooltodir.sh was initially added on branch XPRINT. commit 8c006df3c6d8e5ac95f0b0fa38a030100541598f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:39 2004 +0000 file model-config was initially added on branch XPRINT. commit 95a84bc0cb809e5c7141d0411e329a3ec300b8aa Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file ZapfDingbats.pmf was initially added on branch XPRINT. commit 5527b39e668ea7a88c41186dbb6d7b66e892547a Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Times-Roman.pmf was initially added on branch XPRINT. commit 69c405ac66b1a15076e247dd1b578b7b4b210b00 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Times-Italic.pmf was initially added on branch XPRINT. commit b6b75f677292ed0c694921df0abf40038dd5e99d Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Times-BoldItalic.pmf was initially added on branch XPRINT. commit 6605566bcf008551d33a9a68bd03e9a0c57c4f60 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Souvenir-LightItalic.pmf was initially added on branch XPRINT. commit 38ad2972bffea1019214785ee479f7670ca70d1f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Souvenir-Light.pmf was initially added on branch XPRINT. commit 10d8eace174a9778a3313ac36a3422637b020d5f Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Souvenir-DemiItalic.pmf was initially added on branch XPRINT. commit fb5ac8e2bdfe1217663679f5eae8045473456752 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file NewCenturySchlbk-Roman.pmf was initially added on branch XPRINT. commit 5ec311b05dc1e509c115ccca808ee05090cfddad Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file NewCenturySchlbk-Italic.pmf was initially added on branch XPRINT. commit 70947a8f1addf4ca17e50d9e6ae590266ac446cc Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Symbol.pmf was initially added on branch XPRINT. commit 436ff77b21515cd9fe9732e0bd5361f2bfba44ed Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Times-Bold.pmf was initially added on branch XPRINT. commit 4db563027844245d6c9085f997e75da743410885 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file NewCenturySchlbk-Bold.pmf was initially added on branch XPRINT. commit 79110faa2eac849756b859071ce68fba64de57aa Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file NewCenturySchlbk-BoldItalic.pmf was initially added on branch XPRINT. commit 4e1ae7e9cc04806f4436759764cc680ecf1f014c Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Souvenir-Demi.pmf was initially added on branch XPRINT. commit 433913bacf988908b94c420452c042eebcb381ac Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file LubalinGraph-Demi.pmf was initially added on branch XPRINT. commit d5bae63138ab833fdd56bb983436ac514536d7b6 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file LubalinGraph-DemiOblique.pmf was initially added on branch XPRINT. commit 3acd6856617e784ee30333dc9b779189a3f44052 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file LubalinGraph-Book.pmf was initially added on branch XPRINT. commit 5f73192458136fe4b6b82372c3b1653fbf831ebd Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Helvetica.pmf was initially added on branch XPRINT. commit e129abc3bf269e857aa65065cc18a31a56ba0373 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Helvetica-Oblique.pmf was initially added on branch XPRINT. commit 576a4cddf995082d10e2e29e1b58c1564eb11ee7 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Helvetica-BoldOblique.pmf was initially added on branch XPRINT. commit cf26c87833a79427b665abce67ca19f2b68bc8e5 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Helvetica-Bold.pmf was initially added on branch XPRINT. commit a091408c372a2aa89fb83b023248f45aa8cd4173 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Courier.pmf was initially added on branch XPRINT. commit 9e4221d08ff9a408fb25a32887390b14788b1558 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Courier-Oblique.pmf was initially added on branch XPRINT. commit 6b2674078079a5959a2b7758e6c628a14ec1a46c Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Courier-BoldOblique.pmf was initially added on branch XPRINT. commit 6aee2d37b95170a65ee08c0866c425f115ebc9f1 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file LubalinGraph-BookOblique.pmf was initially added on branch XPRINT. commit 7a59fe1dd987e1ef0abd92e0ac80dd87a15137fe Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file AvantGarde-Demi.pmf was initially added on branch XPRINT. commit 22e0316acc8992033fc82a38f663fce130e4031b Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file AvantGarde-DemiOblique.pmf was initially added on branch XPRINT. commit f8aded3a7f8c97731e33b4362243da947fb4e774 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file AvantGarde-Book.pmf was initially added on branch XPRINT. commit 2224187c05d4dc05f7e03e22307cf7816d69f789 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file AvantGarde-BookOblique.pmf was initially added on branch XPRINT. commit 9eafaaf83294d1988b30bde4485a299cf8ae5035 Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file Courier-Bold.pmf was initially added on branch XPRINT. commit f9eea9864e333efde97143278916da44639cc18a Author: Roland Mainz <roland.mainz@nrubsig.org> Date: Tue Apr 13 03:16:38 2004 +0000 file ps2pdf_spooltodir.sh was initially added on branch XPRINT. commit 20248eedd69c42c27605d7bcfb265994f5846f17 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Sun Apr 11 16:39:48 2004 +0000 fixed Changelog format commit bc7168ee763ffac9cbb992096a53b346cd640a13 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Sun Apr 11 16:24:03 2004 +0000 Added ROP commit 784d37ee369b94c83c4cc6e280a39f32da8aa678 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Sun Apr 11 15:51:04 2004 +0000 Fixed size calculation in solid rendering commit 056322336cbb6093d74aa9d22bbfd42e2248a16a Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Sun Apr 11 15:20:17 2004 +0000 Basic bitblt implementation commit c231856a1343e38381e1b4e545ff1ac279141bf0 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Sun Apr 11 00:53:10 2004 +0000 First acceleration function implemented (DrawSolid) commit 47436a8af82a00d0d392cef4d5906729d9a37649 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Sun Apr 11 00:15:57 2004 +0000 Finnally got MMIO working all timecat ChangeLog cat ChangeLog cat ChangeLog :-D commit 1740b938e4c4f1cd3de700ea26143b01c0312325 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Tue Apr 6 18:09:44 2004 +0000 Return back to VESA only version commit 07bc231872e7e056fa3049a0fcd963c61f826f80 Author: Franco Catrin L <fcatrin@tuxpan.com> Date: Mon Apr 5 18:19:34 2004 +0000 small fixes, but still can't get this driver woking again commit b526276faa765df893197e04370a915ed73947dc Author: Brent Cook <busterbcook@yahoo.com> Date: Mon Apr 5 02:52:35 2004 +0000 removed hardcoded vesa references so we can operate with any backend. fbdev works for initializing the screen, but input fails shortly after. commit 920e6ff81baeec16465f81bacbcff711ce82e149 Author: Brent Cook <busterbcook@yahoo.com> Date: Sun Apr 4 07:30:07 2004 +0000 Begin separating VESA calls into a more generic backend wrapper like the ati driver, cascading between VESA and FBDEV. We only have init functions done so far; need to add all of the others. Fixed some compiler warnings. Whitespace and formatting cleanups (using 4 spaces, no tabs) commit 530371ceaf7f593badf38bbc2d2e50f6a920d24f Author: Brent Cook <busterbcook@yahoo.com> Date: Sat Apr 3 22:26:37 2004 +0000 added touchscreen support, detect all known PCI chips in the Neomagic line. We'll not bother with ISA for now. commit 962b898868dcab959c390986dcb0b4dd750dc107 Author: Brent Cook <busterbcook@yahoo.com> Date: Sat Apr 3 22:22:48 2004 +0000 initial import of original driver by Franco Catrin L. Wraps VESA for most parts, with some hardware acceleration enabled for the cursor on the NM2300. commit 8a2fce3b90b5efc8bab19675cb8e02690e24442e Author: Harold L Hunt II <huntharo@msu.edu> Date: Sat Apr 3 05:01:21 2004 +0000 file winkeyhook.c was initially added on branch CYGWIN. commit 12d5371ed2fbefab069dea46be972a7269b8c2db Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 18:31:54 2004 +0000 file xfixes.h was initially added on branch DAMAGE-XFIXES. commit a4b319dbf375461c975450659723e6326153e536 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 18:31:54 2004 +0000 file xfixes.c was initially added on branch DAMAGE-XFIXES. commit 5319d30d45d5f8ec04a496327f32cc6431c6a511 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 18:31:54 2004 +0000 file select.c was initially added on branch DAMAGE-XFIXES. commit 76f247bd0ef23d688028c63b5f8bd3e9ad6b1b45 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 18:31:54 2004 +0000 file saveset.c was initially added on branch DAMAGE-XFIXES. commit 83f0f1babb612774f609c71879a225c43f63ac1f Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 18:31:54 2004 +0000 file cursor.c was initially added on branch DAMAGE-XFIXES. commit 52bc7693dbe7e3db916f8d463d9a750e3c6ffa4d Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 18:31:54 2004 +0000 file region.c was initially added on branch DAMAGE-XFIXES. commit 5d9098cb17cd88cfdf49de92bec2a787d6681649 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 18:31:54 2004 +0000 file xfixesint.h was initially added on branch DAMAGE-XFIXES. commit ace9aa7c45ff2ea6b3476006574da5c27d05afd4 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 17:41:24 2004 +0000 file damage.c was initially added on branch DAMAGE-XFIXES. commit 72dc7569c6bbc216f613be21ea4f79d3ef1d5534 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 17:41:24 2004 +0000 file damage.h was initially added on branch DAMAGE-XFIXES. commit 95da7b7e061b6925d8cd85bc7b25708ff253fcb1 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 17:41:24 2004 +0000 file damagestr.h was initially added on branch DAMAGE-XFIXES. commit 629c3792225cec28572081ebc8dda3fd803fe616 Author: Egbert Eich <eich@suse.de> Date: Tue Mar 30 14:23:15 2004 +0000 36. Conversion: __AMD64__ > __amd64__ (Egbert Eich). 35. Fixed stretching option and centering in C&T driver (Egbert Eich). 34. Added support for memory size tweaking in BIOS for i845 (Egbert Eich, thanks to Christian Ziez) 33. Removed video playback dependency on Accel in NSC drivers (Egbert 3Eich). 32. Fix HW cursor state on Savage driver when entering VT as some BIOSes seem to enable it unconditionally (Egbert Eich). 31. Fixed Emulate3Button message to distinguish between 'hard' (ie. configured) and 'soft' (ie. automatic emulation that is disabled as soon as the middle button is pressed) (Egbert Eich). 30. Free XrmDB in XCloseDisplay() only when implicitely allocated by XGetDefaults(). If Client allocates it itself it should free it also. Trying to free it for the client may result in segfault if the client has already freed it (Egbert Eich). commit b5e400867feab935aa04e9aadb12deb0601b7f83 Author: Egbert Eich <eich@suse.de> Date: Tue Mar 30 14:14:31 2004 +0000 - backing out XFIXES and DAMAGE related code that accidentally went in here. commit 0017ddaa6406524d0a86ff7020eed4c33758ddbd Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 02:16:15 2004 +0000 file damageextint.h was initially added on branch DAMAGE-XFIXES. commit 4b5112fd0593b34e6e096d88b0841a28636600f6 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 02:16:15 2004 +0000 file damageext.c was initially added on branch DAMAGE-XFIXES. commit 733bfa4b5dd5255713a98f390a1fb65be6e16c2d Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Tue Mar 30 02:16:15 2004 +0000 file damageext.h was initially added on branch DAMAGE-XFIXES. commit b1ed473ef2e1da99d7fe3df14fdef4d8b6365626 Author: Harold L Hunt II <huntharo@msu.edu> Date: Tue Mar 30 00:31:28 2004 +0000 file winrandr.c was initially added on branch CYGWIN. commit fec5095bdfb376d0046e2f52188c68bef4e31fd7 Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 28 07:14:30 2004 +0000 file xorgcfg.man was initially added on branch XORG-RELEASE-1-TM. commit 136a9364be80f407f498e9e9695cadaab39227ad Author: Keith Packard <keithp@keithp.com> Date: Sun Mar 28 07:14:30 2004 +0000 file XOrgCfg.cpp was initially added on branch XORG-RELEASE-1-TM. commit 881afb356d6992bcfbbfcbdf31f1f71c64d648da Author: Keith Packard <keithp@keithp.com> Date: Sat Mar 27 17:01:11 2004 +0000 file Xorg.man was initially added on branch XORG-RELEASE-1-TM. commit d2119ac7c56ba94db1d8639937b13e72288a328c Author: Keith Packard <keithp@keithp.com> Date: Sat Mar 27 17:01:11 2004 +0000 file xorg.conf.man was initially added on branch XORG-RELEASE-1-TM. commit 5a9f3a36a35549f30fc67a8e3a3e9a201efb91ec Author: Egbert Eich <eich@suse.de> Date: Fri Mar 26 20:02:03 2004 +0000 file xorgHelper.c was initially added on branch XORG-RELEASE-1-TM. commit b2b0e70fe5c65c8f2d518f5f0ce89a86938701ed Author: Egbert Eich <eich@suse.de> Date: Fri Mar 26 19:54:39 2004 +0000 file xorgconf.cpp was initially added on branch XORG-RELEASE-1-TM. commit 83880dd464a415d3d0efa546b1f0b9887342e809 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Fri Mar 26 17:11:49 2004 +0000 29. XkbWriteRulesProp fails if XkbRulesFile is NULL. Bug #376. (Alan Coopersmith) commit 861a33678243349b987ff30912985968ede8ac84 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Fri Mar 26 01:22:18 2004 +0000 oops commit 23d552bbef2984afee889f82ded154478548ee15 Author: Egbert Eich <eich@suse.de> Date: Thu Mar 25 11:00:52 2004 +0000 file xorg.cfg was initially added on branch XORG-RELEASE-1-TM. commit d1e52f13ad4610ec4907432c21384d08d6aaaf27 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Mar 25 05:11:16 2004 +0000 oops commit f0336f18ee4106050104cb060c38fe87541615da Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Thu Mar 25 03:45:49 2004 +0000 built,working DAMAGE/XFIXES in mono tree commit f1394ec3cec09ff9c5fbbff3c1f595a642b25f91 Author: Torrey Lyons <torrey@mrcla.com> Date: Wed Mar 24 22:15:25 2004 +0000 Change XFree86 Project to X.Org Foundation in localized XDarwin splash screens. commit d2bbcc0deed3a607d347ed4ef07ded9bcb44f1bb Author: Torrey Lyons <torrey@mrcla.com> Date: Wed Mar 24 22:12:34 2004 +0000 Change XFree86 Project to X.Org Foundation in XDarwin splash screen. commit 84d25a5e178835234261a63f0a1b8131c01bbe1f Author: Egbert Eich <eich@suse.de> Date: Wed Mar 24 15:58:45 2004 +0000 file xorgVersion.h was initially added on branch XORG-RELEASE-1-TM. commit 685d1630c1540e29644849254bd45708aa5763bb Author: Egbert Eich <eich@suse.de> Date: Tue Mar 23 12:46:30 2004 +0000 file xorgconfig.man was initially added on branch XORG-RELEASE-1-TM. commit 6631bd586f74f89e2dce74fe1cc25ee982883323 Author: Egbert Eich <eich@suse.de> Date: Tue Mar 23 12:46:30 2004 +0000 file xorgconfig.c was initially added on branch XORG-RELEASE-1-TM. commit 05a16f4acce3b6ef4ddafe044f96774de3f75b7c Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Mon Mar 22 13:43:35 2004 +0000 file glwindows.h was initially added on branch CYGWIN. commit 3c2e2d9ae0704931737bb0879a49a8575a07d13b Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sun Mar 21 22:55:35 2004 +0000 bug #357. Fix XDarwin so it builds on Mac OS X 10.2 and earlier. Merged down from -RELEASE-1-TM and -RELEASE-1 commit 122be5328ffea0a3b92612b8ea0f5b02736ac175 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Fri Mar 19 23:16:06 2004 +0000 no bug report. Restore Credits to the hw/darwin ddx that were deleted previously. RTF may or may not be "human readable," but with a little effort it's about as readable as SGML, IMNSHO. commit 551c93da612923f8d32707adc16431979bad6fb0 Author: Harold L Hunt II <huntharo@msu.edu> Date: Mon Mar 15 04:33:23 2004 +0000 file winkeynames.h was initially added on branch CYGWIN. commit 0c97b290015186acbaadae9a9bf79f37c3d38b40 Author: Harold L Hunt II <huntharo@msu.edu> Date: Mon Mar 15 04:33:23 2004 +0000 file winkeymap.h was initially added on branch CYGWIN. commit dae90c3af98edd5e95289abd930b3872c996c503 Author: Egbert Eich <eich@suse.de> Date: Sun Mar 14 08:34:49 2004 +0000 Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 commit 4e996f9d76f51e9b1e33bef610bb9c2a746c8b9c Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Mar 12 21:05:47 2004 +0000 file winpriv.c was initially added on branch CYGWIN. commit c79b4bfd15534de12aaf8eca9965403b4913ca4b Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> Date: Fri Mar 12 21:05:47 2004 +0000 file winpriv.h was initially added on branch CYGWIN. commit 24c02f84cc31475bfba27417dfef66b11c09b25c Author: Harold L Hunt II <huntharo@msu.edu> Date: Fri Mar 12 01:11:23 2004 +0000 file X-boxed.ico was initially added on branch CYGWIN. commit 45b638b87f0daf94f9fce566179775fb2889c663 Author: Daniel Stone <daniel@fooishbar.org> Date: Wed Mar 10 11:49:11 2004 +0000 Twenty link errors for Xizzle now - count 'em. 20. Get rid of all references to SCO. Change SDK include dir to $(includedir)/xizzle. Add SDK libs where necessary. Reformat to be nicer and easier to shuffle around; also, fix lib ordering so we get so much closer to the elusive final link. Shuffle common/xf86Init.c into libxizzle.a. Fix a couple of early snafus - s/BUILDXI/XINPUT/, et al; make the SDK stuff conditional as needed; fix the SBus includes. Name library os-support/libxizzleos.a, not os-support/foo/libxizzlefoo.a. Clean up ARCH_SOURCES so it's always initialised to something. Move linked libraries to _LIBADD, which somehow escaped my attention. Make inclusion of drm/libxizzlelinuxdrm.a dependent on DRI. s/VERSION/VBE_VERSION/; Axe this redundant dir. All Xizzle-specific: axe hw/xizzle/Xi, shuffle link order, fix list of required modules to be vaguely sane, add some pertinent libs/incs. commit 519f76a0867fb2711d311b7929632408c3633e37 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Sun Mar 7 23:45:10 2004 +0000 24. Update license for Xinerama code from DEC to the version requested by Compaq for X11R6.5.1 that allows redistribution without written permission from DEC. Originally X.org Defect #9263. freedesktop.org bugzilla #283. (Alan Coopersmith) commit 505fe2ba307e9270627ca7f3cb6b4e1dbacc327b Author: Egbert Eich <eich@suse.de> Date: Fri Mar 5 13:41:12 2004 +0000 23. Merged with XFree86 4.4.0. Added changes that went into infected files. Reverted darwin/bundle/**/Credits.rtf to XFree86 versions to avoid future conflicts on ASCII but not humal readable files. (There should probably be separate CreditsXorg.rtf files) (Egbert Eich). commit 1b22db1ebcf1ba98ca8519fa38210e275373f8f6 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Thu Mar 4 02:13:09 2004 +0000 21. X server crashes when X-Resource has to byte-swap. Sun bug #5007488. freedesktop.org bugzilla #267. (Alan Coopersmith) commit 47c9395969593a4e897e8c8110d5f2414e47b06a Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Mar 3 17:03:46 2004 +0000 file solaris-ia32.S was initially added on branch XORG-CURRENT. commit ed066cc67b1fca03fb38c80ecb8194b5b40963be Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Mar 3 17:03:46 2004 +0000 Enable inlining of assembly functions for inX/outX on Solaris 8 with Sun compilers commit 867451f1ab7b9870621725bd4be3dd8694c364b8 Author: Egbert Eich <eich@suse.de> Date: Wed Mar 3 12:12:50 2004 +0000 Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 commit 2934f0731b3d2bc9c1e25ceab26d9e0d9cadb054 Author: Harold L Hunt II <huntharo@msu.edu> Date: Tue Mar 2 20:00:16 2004 +0000 file winvalargs.c was initially added on branch CYGWIN. commit f72efebf280547c80ff7010e32f56416e7121164 Author: Harold L Hunt II <huntharo@msu.edu> Date: Tue Mar 2 19:26:34 2004 +0000 Replace a handful of calls to ErrorF and exit(1) with a single call to FatalError. These direct calls to exit(1) made it impossible to do anything ddx-specific in these cases; note that most of these calls occur during argument processing. commit 7557d4da10cc482fcec40acadf7744b04c1615a0 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Tue Mar 2 19:00:06 2004 +0000 bug #230 Revert to Xinerama 1.1 In order to make a "quick" release it has been decided that the priority is to preserve the server's internal API/ABI so that third-party drivers that depend on symbols like noPanoramiXExtension, etc., would not need to be recompiled. Toobad gcc on Linux doesn't support ELF's weak symbols as that would have been a reasonable solution for preserving the ABI. N.B.: While symbols, i.e. functions and variables revert to the old name, I did not revert build names, i.e. -DXINERAMA, to the old -DPANORAMIX. There was no need, and it's just a build issue that has no impact on the binary output of the build. commit 215a13aa8f537dcb62b0a2f6d335901ee47e9e9b Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Mar 1 16:38:20 2004 +0000 Add the .stab.indexstr section produced by Sun's compilers to the list of SHT_STRTAB sections with debug information to ignore when loading ELF objects. commit d87b05563dc13ba8d9825ec3bb772702dce6c9fe Author: Harold L Hunt II <huntharo@msu.edu> Date: Mon Mar 1 03:33:28 2004 +0000 file indirect.c was initially added on branch CYGWIN. commit f81d63ec5396c8d7f62ddd6ff6bab10b32493264 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sun Feb 29 20:11:11 2004 +0000 bug #240 Instead of both Meta keys generating Meta_L, and both Alt keys generating Alt_L, etc, fix the implementation so that you get Meta_L for the left Meta key and Meta_R for the right Meta key. Ditto for Alt, Control, and Shift. commit 6c412a43e42538a51d3a4d92a6db12b0b6cf0e9b Author: Jaymz Julian <jaymz@artificial-stupidity.net> Date: Sat Feb 28 09:47:55 2004 +0000 sdl x server so that we can x-on-x the fb stuff for ease of debugging. if anyone uses this in production, a big scary monster will eat them. hrm, perhaps i should make it have a --i-know-what-i'm-doing param that it doens't start without, heh commit bb93fef9877a885da2c6108410155fa996b19abf Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Fri Feb 27 19:35:49 2004 +0000 bug #238 test for root-window that XFree86 fixed in their programs/Xserver/Xext/shm.c 3.37 and programs/Xserver/Xext/xvdisp.c 1.26 got zapped when Xinerama2 was merged into the tree. (Xinerama has since been reverted to 1.1, but that's another story.) commit cb718ce08eb25c3999c91b8d614fb88237fad03d Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Fri Feb 27 16:17:12 2004 +0000 Revert to Xinerama 1.1 In order to make a "quick" release it has been decided that the priority is to preserve the server's internal API/ABI so that third-party drivers that depend on symbols like noPanoramiXExtension, etc., would not need to be recompiled. Toobad gcc on Linux doesn't support ELF's weak symbols as that would have been a reasonable solution for preserving the ABI. N.B.: While symbols, i.e. functions and variables revert to the old name, I did not revert build names, i.e. -DXINERAMA, to the old -DPANORAMIX. There was no need, and it's just a build issue that has no impact on the binary output of the build. commit df0313d35bc89abe9374ed25533db283430716e0 Author: Egbert Eich <eich@suse.de> Date: Thu Feb 26 13:36:15 2004 +0000 readding XFree86's cvs IDs commit 147aae87fde5edeed395f77e60f0f8e812d3b6af Author: Egbert Eich <eich@suse.de> Date: Thu Feb 26 09:23:53 2004 +0000 Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 commit 8844423f890194bcb0419a38249029f1997c8c66 Author: Stuart Kreitman <stuart.kreitman@sun.com> Date: Wed Feb 25 23:28:43 2004 +0000 file xevie.c was initially added on branch XEVIE. commit b052486adb9ea26f37be120966eb60cd3ac3db2f Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Wed Feb 25 21:47:10 2004 +0000 bug #230 Revert to Xinerama 1.1 In order to make a "quick" release it has been decided that the priority is to preserve the server's internal API/ABI so that third-party drivers that depend on symbols like noPanoramiXExtension, etc., would not need to be recompiled. Too bad gcc on Linux doesn't support ELF's weak symbols as that would have been a reasonable solution for preserving the ABI. N.B.: While symbols, i.e. functions and variables revert to the old name, I did not revert build names, i.e. -DXINERAMA, to the old -DPANORAMIX. There was no need, and it's just a build issue that has no impact on the binary output of the build. commit 14ab4ade74e946c09d633b15ab4d447d7b69ea29 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Tue Feb 24 15:22:40 2004 +0000 bug #214. Merge most of 4.4RC3 commit 9343c8f5ac180043c29ead5e83a3efef16d7b3f2 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Tue Feb 24 15:16:35 2004 +0000 bug #188, #214, see versions 1.1.4.3 and 1.1.4.4 of this file. fix bad merge commit 03d893bff9bf5d6be9663a21cc983873d8e8d4c7 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Mon Feb 23 21:37:29 2004 +0000 merge most of XFree86 RC3 (4.3.99.903) from vendor branch. bug #214 commit 4ee0a53de870192d57c02baffa106b10bae6e0bf Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Mon Feb 23 20:35:22 2004 +0000 Import most of XFree86 4.4RC3. This import excludes files which have the new license. If we want to, later we can import 4.4RC3 again and pick up the files that have the new license, but for now the vendor branch is "pure." commit dcdd47ebbd4e9b5f4cbb598a5217004df0e80844 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Mon Feb 23 20:35:19 2004 +0000 Initial revision commit 30ac3efde2c3f08b98f31833df4ea7d87f33b092 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Mon Feb 23 16:32:14 2004 +0000 bug #188 report bugs to X.org bugzilla, not XFree86 commit d52f3ac58fd596fca392394f16acff84115f6e1d Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Feb 18 21:43:19 2004 +0000 Additional fixes to allow building with Sun compilers on Solaris x86 commit 07109fd63e0999905e6f7df8fd7f9c713d0dc2cc Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Wed Feb 18 21:30:12 2004 +0000 Sun cc on Solaris x86 defines __i386 but not __i386__ so the x86 architecture #ifdef should accept either form commit a27ffd2678ef76453c4fa27932462425d804df6d Author: Warren Turkal <wt@penguintechs.com> Date: Wed Feb 18 02:12:44 2004 +0000 completely get rid of NeedNestedPrototypes completely get rid of NeedVarargsPrototypes remove a lot of NeedFunctionPrototypes ansify many function declarations commit d17586c4dc858d0127fa021e6db62f8cc28ef7a6 Author: Alan Coopersmith <Alan.Coopersmith@sun.com> Date: Mon Feb 16 20:19:59 2004 +0000 [fd.o bugzilla #189] _XOPEN_SOURCE defines break builds on Solaris Express commit b146ef1548d36d6897fbd674f1c3b8324bed11a7 Author: Warren Turkal <wt@penguintechs.com> Date: Sun Feb 15 15:04:57 2004 +0000 Moving toward a working input extension. commit e90274c2bba1f66a68c2bc30ddb589dbf6fa0929 Author: Egbert Eich <eich@suse.de> Date: Wed Feb 11 19:29:37 2004 +0000 2. Fixing segfaults that may happen in some corner cases when VT switching and during int10 initialization (Egbert Eich). commit 453a0743eb524da88dd364ccac86f35e61899e64 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sun Feb 8 00:17:31 2004 +0000 revert to RC1 version of file with the license we like commit d6f33d897221450f3cfcc1162e2a6d09b227326e Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sun Feb 8 00:12:27 2004 +0000 revert to RC1 version of the file with the license we like commit bd20c8d340fce0700ae813bd5b55fe7f4b9e0c98 Author: Jaymz Julian <jaymz@artificial-stupidity.net> Date: Thu Feb 5 09:09:51 2004 +0000 Polling input mode for the kdrive os layer. And a moose! commit af798d27743dbc4f70e85e297daa5863ec89640b Author: Jaymz Julian <jaymz@artificial-stupidity.net> Date: Wed Feb 4 16:08:27 2004 +0000 More NULL checks. These ones are more useful than the last (which just made debugging a bunch of problems easier), since you can implement less in the basic simplest case driver now (not that i'm lazy, mind :-p) commit 3c64b65d805915e5c5628663113c54c3e9c3013b Author: Egbert Eich <eich@suse.de> Date: Thu Jan 29 08:08:57 2004 +0000 Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004 commit 2ec70aa70133190ad31a83114fdb9a218e6aa8e6 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Jan 25 05:31:24 2004 +0000 Disable GLX visuals code on !GLXEXT, and remove a useless prototype. commit 01e9cc858ac646b3140d1d85ea9c069bc708fb28 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Jan 25 01:30:33 2004 +0000 - Add glx visuals code based on XFree86's Radeon driver. - Reserve areas for back/depth/span when USING_DRI && GLXEXT. This would be better in a TransitionTo3d, but we'd need to work with the offscreen memory manager for that. - Misc. fixes to ati_dri.c for DRI+GLX. Needs more work still. commit f2bedd17af7c3b9241c02dc1c899f32fc0cd2f10 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Jan 25 01:16:19 2004 +0000 Oops, turn fallback output back off. commit 26c5a8dfdd2aa09db46c4cf963ca697df3e777ef Author: Eric Anholt <anholt@freebsd.org> Date: Sun Jan 25 01:04:12 2004 +0000 Whitespace cleanup. commit 6870c081572fcf32997e7906a54d09da0ca58ac3 Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 15 09:19:56 2004 +0000 Oops, lost a diff needed for the non-screen format pixmap code commit 3867e03cb63e49aeb1742a8a4bdaed0b7a23749e Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 15 09:15:53 2004 +0000 Fix up some mis-used variable names commit f233bbf3652327e62e03efbb8a355e6af2703a1c Author: Keith Packard <keithp@keithp.com> Date: Thu Jan 15 09:13:01 2004 +0000 Accelerate non-screen format pixmaps. commit 751fb0374b12679f63c922adf0f0e7cadd83d861 Author: Harold L Hunt II <huntharo@msu.edu> Date: Thu Jan 15 06:06:44 2004 +0000 file winresource.h was initially added on branch CYGWIN. commit a265167f19e37aec2173c0ca6c9955450aa69941 Author: Anders Carlsson <andersca@gnome.org> Date: Wed Jan 14 10:00:00 2004 +0000 Add IPAQ modeline by Dennis Noordsij. commit 6c97b277d9140b9d6bca047c56e303f6fc1d92e0 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Jan 11 00:10:34 2004 +0000 Support 1x1 repeat sources in R128's Blend. commit 92702565657d48f1fcc2bae1b5989b1d6d3dd164 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jan 9 08:43:48 2004 +0000 Change PCI ID information field to be one of r128, r100, r200, r300. This is all the information we need so far. Put that information into atic, and use it correctly in the code (unlike before). commit 5d51dfc69cb245f6a1c7b106954a3365524741e2 Author: Eric Anholt <anholt@freebsd.org> Date: Fri Jan 9 08:40:32 2004 +0000 Use the scratch area for Composite when one of src or dst is in memory. commit 6d8001f4688e2149fcdd480401c46c7540680576 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 8 20:18:13 2004 +0000 Compile fixes for non-DRI case and for non-C99 compiler. commit 1be4b2d5e8048eb3653fad3a1267a0da865bcee8 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 8 08:25:49 2004 +0000 Forced commit: Previous commit included the removal of the 8192 scanline limit on offscreen memory in the fbdev case. I remember daenzer (who originally put that code in) saying he wasn't sure of it, and there doesn't seem to be any reason for that limit given how acceleration is done. commit b27729ec88f5d4153a0debfe2347bbed022329ba Author: Eric Anholt <anholt@freebsd.org> Date: Thu Jan 8 08:16:24 2004 +0000 - Add a new UploadToScratch kaa hook for putting the data for a single pixmap into temporary offscreen storage. Subsequent UploadToScratch may clobber the data of previous ones. This allows hardware acceleration of composite operations on glyphs. - Add a new UploadToScreen kaa hook for doing the actual moving of data to framebuffer. This would allow us to do things like hostdata blits or memcpy to agp and then blit. - Add an UploadToScreen on ATI which is just memcpy, but which will be replaced with a hostdata blit soon. - Add UploadToScratch on ATI and reserve 64k of scratch space. This provided a 3x speedup of rgb24text on my Radeon. commit d640cf4cb4e031a0e93dfd5955405847fe4475c0 Author: Harold L Hunt II <huntharo@msu.edu> Date: Thu Jan 8 05:10:33 2004 +0000 file winprocarg.c was initially added on branch CYGWIN. commit 77183abbc499c69fbbbae1d92a6b012c5f80b6c4 Author: Harold L Hunt II <huntharo@msu.edu> Date: Thu Jan 8 05:10:32 2004 +0000 file winglobals.c was initially added on branch CYGWIN. commit eb5bb9c1a16db308eae84ea45a5920c768d4a2ff Author: Harold L Hunt II <huntharo@msu.edu> Date: Thu Jan 8 05:10:32 2004 +0000 file winclipboardwrappers.c was initially added on branch CYGWIN. commit e93d468df21840007cbeea03ed545e75f0f0baf1 Author: Harold L Hunt II <huntharo@msu.edu> Date: Thu Jan 8 05:10:32 2004 +0000 file winauth.c was initially added on branch CYGWIN. commit 737eddfa4b6a8851e20823405b7269dd49c49b89 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jan 7 09:50:28 2004 +0000 Disconnect the sis300 driver. I've never managed to fix it, and it breaks the build on PPC. commit 5a2c23f8a18767f0eb2fe2846ca3ba18fd236284 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Jan 7 02:30:29 2004 +0000 Speed things up slightly by removing Z values from emitted vertices and by emitting as a tri fan rather than a tri list. A rect list would save an additional vertex (out of 4) per rectangle, but there's no measurable speed difference and the tri fan may be useful when transforms come into play. commit cff782078cec9b10606c5873816b7acd9977ce4d Author: Eric Anholt <anholt@freebsd.org> Date: Sun Jan 4 20:51:53 2004 +0000 - Don't forget to UNINIT miComputeCompositeRegion's regions - Fix a bit of whitespace nearby. commit 34d1529731fff0cb61c71f76edc5c6499ece68d1 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Jan 4 20:47:30 2004 +0000 - Correctly set the texture coordinate set source for the second texture unit. - Re-enable Radeon's Composite accel now that fonts work again. commit 9f1a92cd092e87f774ce4ed99d4b3e15f905d4f7 Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jan 3 21:52:14 2004 +0000 - Call appropriate Done function for Composite. - Don't allow src transforms for Copy acceleration. - Minor whitespace fixes. commit 3db761a17b60b80acb83f365628b093f0ba6958c Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jan 3 11:46:57 2004 +0000 - Add more Composite operations, including Saturate, to Radeon Composite accel. I don't 100% trust that the math works for Saturate, but I can't tell from existing information. - Fix texture pitch fallback checks. - Fallback when src or mask have transforms. - Disable Radeon Composite accel until the offset thing is fixed. - Set offscreenPitch to 64 on Radeon thanks to new information and a kaa fix. Fixes acceleration at width!=1024. commit d15acfa79b64b8dab1e930ce8e5423a212a1360b Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jan 3 11:25:27 2004 +0000 Split the various attempts at accelerating Composite into separate functions. Along with making things more readable, it fixes a problem where the coordinates would get messed up if acceleration failed due to things like pixmaps being in the wrong locations. commit 1e1a35e20c1d281bc9700b349cda1e67f65905dd Author: Eric Anholt <anholt@freebsd.org> Date: Sat Jan 3 11:17:44 2004 +0000 Actually align the offset of allocated offscreen areas. commit 354f8f7e943d1a0732f4181420211efff27532b8 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Dec 31 23:24:33 2003 +0000 Some strange \240 character snuck into the original commit of this file. commit 5f947b04da13256e5f514c40dedb98c6e1cbe0f1 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Dec 30 08:45:53 2003 +0000 There's never a copy between different depths. Remove the check. commit c8eb20a08ee9174374b6f5ac6e79f31fce26e181 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Dec 30 08:23:56 2003 +0000 - Add new Composite hook for kdrive drivers, which only ensures that the pixmaps are offscreen and don't have alpha maps. It is the last case checked before going to software fallback - Use the new Composite hook in the ati driver to implement acceleration of most Composites that get done in an xcompmgr environment on r100 series cards. It is only available when using the DRM. There are still some corruption issues, but the DRI is still non-default and I need to get this into version control. commit adfc1ed8e1e150100accf014e46241201275138f Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 29 09:04:20 2003 +0000 Add dependency lines so that servers are rebuilt when server libraries are changed. commit df03e80ae9162ec87f503322ccbcf2846ad38bef Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 29 06:24:01 2003 +0000 Merge dri-0-1-branch to trunk. Notable changes: - Add libdrm and libdri. Portions of the DRI extension are stubbed out. - Use the DRM in the ATI driver when available. This provides a minor performance improvement in x11perf, and opens the possibility of using the 3d hardware for acceleration in the future. - Implement solid fill acceleration for Composite in KAA. - Implement Blend hook for Composite and use it on r128. - Fix a bug of mine that resulted in overuse of offscreen memory. - Fix many miscellaneous bugs in ATI driver and add PCI IDs. commit 9bea538745f1a0c14faaac0e61dee5cf86f98dc6 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Dec 28 09:56:54 2003 +0000 file kaa.h was initially added on branch dri-0-1-branch. commit fb8cd7454baec0bc0f693d222f3920ce03dde7c6 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Dec 28 09:56:54 2003 +0000 file kaapict.c was initially added on branch dri-0-1-branch. commit f388f1509cb131cdf0675415214c9610d3d322c7 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Dec 23 22:29:38 2003 +0000 file r128_blendtmp.h was initially added on branch dri-0-1-branch. commit 918958705dd97ce678b8901666c85fb359d0e013 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sun Dec 21 13:39:58 2003 +0000 Use a different icon commit e97c634593dd171a05aa0fa5a35d218dcc3ecfb0 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sat Dec 20 00:28:31 2003 +0000 merge XFree86 RC2 (4.3.99.902) from vendor branch commit 12e532010b9e8cb67bedd44d489c9c40dd265165 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Fri Dec 19 20:55:39 2003 +0000 XFree86 4.3.99.902 (RC 2) commit 4b75c7f6358b28978b05ffa4b73853d936454f50 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Thu Dec 18 19:32:17 2003 +0000 First pass at "Standard" Xinerama. The sources for this came from Heather Lanigan's xinerama tree on Sourceforge.Net. No attempt has been made to handle previous, non-standard versions of the protocol. Nor has any attempt been made to preserve the ABI of previous versions -- that part will be added at a later time, and then probably only on systems that have nice object/linker semantics, e.g. ELF systems with weak symbols. commit 305c444de3baa863d7abc4221e8cebb973805847 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 8 01:55:10 2003 +0000 Add initial SiS 300-series (300, 305, 540, 630, 730) driver based off of the ATI driver. It suffers from hw/sw synchronization problems, it looks like, but may be good enough to work on Render acceleration experiments. Committing it as-is so I don't lose it again. commit 8a7481a27496c842ec2ef5bac5e4d0b5e6279deb Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sat Dec 6 13:24:29 2003 +0000 merge XFree86 4.3.99.901 (RC1) from vendor branch commit e82928826f60a2e76a670c936bd557838fc1764c Author: Kensuke Matsuzaki <zakki@peppermint.jp> Date: Fri Dec 5 03:37:26 2003 +0000 file winwin32rootlesswindow.c was initially added on branch CYGWIN. commit fc40d0a3cbee053d446032ae3150b06edf66a335 Author: Kensuke Matsuzaki <zakki@peppermint.jp> Date: Fri Dec 5 03:37:26 2003 +0000 file winwin32rootlesswndproc.c was initially added on branch CYGWIN. commit c3f26a1b989dbbf5167e6e352aebf2f53bfcc442 Author: Kensuke Matsuzaki <zakki@peppermint.jp> Date: Fri Dec 5 03:37:26 2003 +0000 file winwindowswm.c was initially added on branch CYGWIN. commit 0f06636a9a088fc27262da0f0bc9a20a3dbeab69 Author: Kensuke Matsuzaki <zakki@peppermint.jp> Date: Fri Dec 5 03:37:26 2003 +0000 file winwin32rootless.c was initially added on branch CYGWIN. commit a84f16a9ad2ed0f874d2c1816aedee96725d2657 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Thu Dec 4 22:03:38 2003 +0000 XFree86 4.3.99.901 (RC 1) commit 33fdd50a94baab1db342bfce442907db8f8ad03e Author: Keith Packard <keithp@keithp.com> Date: Tue Dec 2 01:59:38 2003 +0000 Wrap ClipNotify to see region motions during MoveWindow. Check window reorigin in PositionWindow and bump pixmap serial numbers to revalidate GCs. Fix picture clip region origin in automatic update Initialize client private 'critical' value Clean up pixmap bounds checking code to only affect contents allocated by fb. Oops. Call SourceValidate for Composite operations. Add Xchips server (vesa based) commit 6db77925406a0ee600998ad558a50190ba631649 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file radeon_sarea.h was initially added on branch dri-0-1-branch. commit 313046b42832fa2434d617997d5701157b55e7c8 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file radeon_common.h was initially added on branch dri-0-1-branch. commit 2ad126286e524392741164babe530210892c377f Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file r128_sarea.h was initially added on branch dri-0-1-branch. commit f486c136ad8d2d893cdf3aee6aa752578a6809d7 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file r128_common.h was initially added on branch dri-0-1-branch. commit 1eb63ef1b5d0ce10117196df3e81e8312a55a93c Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file ati_sarea.h was initially added on branch dri-0-1-branch. commit 1fa5f28406f8a7ad54049e4bec129953149bd3ed Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file ati_dri.c was initially added on branch dri-0-1-branch. commit 14ce4f2c3ebc20e5f6d57adda0a7e14229541a72 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file ati_dri.h was initially added on branch dri-0-1-branch. commit 8887456e7d4fc1280287ed3e35c6c4464525827b Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file ati_dripriv.h was initially added on branch dri-0-1-branch. commit 6c9e7f47357b02f41b9f1f43f7f1d9b5a139e5b6 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file ati_draw.h was initially added on branch dri-0-1-branch. commit 2ad20d4e99d0d8ecb922507e0bfead8b7b7d4a55 Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 22:56:06 2003 +0000 file ati_drawtmp.h was initially added on branch dri-0-1-branch. commit ae2454f65698eef66b3507e586e4f8125cb1790d Author: Anders Carlsson <andersca@gnome.org> Date: Mon Dec 1 22:11:12 2003 +0000 Add support for setting the video mode. commit e31051ba26c18f6232798c5a5c4725f5ce53d6b9 Author: Phil Blundell <pb@reciva.com> Date: Mon Dec 1 21:49:41 2003 +0000 Call KdShadowUnset before fbdevSetShadow. commit 9cdd6fd9e3d6e44adf392279093f92fb6678a49c Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 04:33:36 2003 +0000 - Add fbdev mode-setting backend to Xati. It and vesa are compiled in when available, with fbdev being used by default. - Use depth 16 by default when vesa backend is used. - Add MMIO defines for PowerPC (should be in a common location). Many thanks for Michel Daenzer for much of this code. commit ec7f5539302fafd1ac7609ac423f1379f54916ab Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 03:15:13 2003 +0000 Add more RV250 PCI IDs. commit d221c484f9521c780fc3c7e88833c62e50463c6d Author: Eric Anholt <anholt@freebsd.org> Date: Mon Dec 1 01:46:42 2003 +0000 Remove sys/io.h inclusion from some files that didn't need it, and change asm/io.h to sys/io.h in vga.c, which newer Linux complains about. commit 5fd7f82390d78621a8aad959eb216b8fb7e1a97f Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sun Nov 30 16:47:13 2003 +0000 xfree86 merge commit 77836ebda2a47e04c56c5842f62fab5992909712 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sat Nov 29 16:08:53 2003 +0000 xfree86 merge commit 88193e928be7cf5a526b50ad1e0b4ac9cddef297 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Sat Nov 29 15:10:02 2003 +0000 xfree86 merge commit 0097b6fe2d1739e46e4e7726aaa481b6dc84870c Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Wed Nov 26 22:49:07 2003 +0000 merge latest (4.3.99.16) from XFree86 (vendor) branch commit d803918a9fb5f80a2d6e4b711d8e43916cd09da5 Author: Eric Anholt <anholt@freebsd.org> Date: Tue Nov 25 22:39:54 2003 +0000 Add new Radeon 9200 PCI IDs. commit adc7f9a4ebdfe11d4cd6de9388b63dfe36450b39 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Tue Nov 25 19:29:01 2003 +0000 XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks commit 90f1536dd315cd265bfc7ef35058761a65a01734 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Tue Nov 25 19:29:01 2003 +0000 Initial revision commit d461855a73d8c9f51a18673aef7ce88f94a71629 Author: Eric Anholt <anholt@freebsd.org> Date: Sun Nov 23 10:12:04 2003 +0000 - Fix Radeon offscreen pixmap pitch alignment. - Remove usleeps from idle and waitavail code, recommended by keithp. - Add a workaround for apparent broken acceleration with Rage 128 and offset alignment with 8-bit acceleration (24-hack and plain 8-bit). - Minor cleanup of setup code. commit 8e09afe657b110bc1ea9e58dea81a120c343d16e Author: Eric Anholt <anholt@freebsd.org> Date: Sun Nov 23 02:08:16 2003 +0000 Add RV250 PCI IDs. commit b3247251fb7d9f2d50ef41d9c2089629544d534d Author: Eric Anholt <anholt@freebsd.org> Date: Thu Nov 20 07:49:46 2003 +0000 - Fix a bug in pitch alignment for offscren pixmaps. - Add 24-bit acceleration for Xati using the 8-bit trick from mach64. - Add offscreen pixmap support to Xati. commit 41dde24b229f4bc4738637d9cd0a86b74b9f8457 Author: Eric Anholt <anholt@freebsd.org> Date: Thu Nov 20 00:05:56 2003 +0000 - Fix confusion of depth/bitsPerPixel in ati_draw.c - Disable acceleration with 24bpp due to apparent broken acceleration. Accel at 24bpp was the cause of the crashes when people tried to use any depth over 16. XFree86 doesn't support 24 either. - Disable at < 8bpp, too. - Add the other Rage 128 PCI IDs. - Remove unnecessary setting of scissor registers (only default scissor gets used). commit 7abbcce4222958b4670873a17f67ea1ec1d958e2 Author: Eric Anholt <anholt@freebsd.org> Date: Wed Nov 19 08:32:38 2003 +0000 - Add PCI information (device/vendor id, bus location) to KdCardAttr to help with ati, and future DRM drivers. - Add new "ati" kdrive driver. It has ancestry in the r128 driver from andersca, but took a detour through being the WIP SiS 300 driver on the way. It supports Radeons (tested on QD VIVO and 7500) and Rage 128. Current limitations include that it requires depth 16 and that the other Rage 128 PCI IDs aren't included yet. commit e9cb70dae0a85fcd116d7ffac73d1322ec282a94 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 18 18:38:48 2003 +0000 Reset available offscreen segment save function pointer. (Not a functional change, just cleaning up a bit) Reset the screen->memory_base value when frame buffer is remapped. This makes sure new off-screen allocations point at the newly mapped region rather than the old (now unmapped) region. commit f333581b7b4066ab054dd765a1c9bae0f3407188 Author: Seth W. Klein <sk@sethwklein.net> Date: Tue Nov 18 04:53:16 2003 +0000 Added infrastructure for driver specific usage messages and added vesa usage message. commit 003e87717cfe378261ed1a1e7bcb2cf0d200b1b8 Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 17 22:09:12 2003 +0000 Recompute winSize/borderSize to fix them when changing redirection. Sufficient, but not always necessary. Add borderClip to damage on creation so that clients needn't guess. Fix API to FbDots functions to make PolyPoint work with screen_x/screen_y offsets Add debugging code to make sure no pictures are left pointing at freed pixmaps. "Can't" happen, but it did once. Change KdOffscreenArea structure to eliminate separate private structure, eliminate the ScreenPtr, change from doubly linked to singly linked list. Don't damage BackgroundNone windows on PW_BACKGROUND. Re-clip damage to borderClip in DamageSubtract. commit c57959ad6a4c0f5329762f401fd7871ffb2ee90c Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Mon Nov 17 19:03:47 2003 +0000 merge XFree86 4.3.0.1 to -CURRENT commit acd200770513ad03dd3f4bdc7448edfd69b1ff9d Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 17 06:54:52 2003 +0000 Clear window when Manual Subwindows redirect is destroyed Fix Tile/Stipple origin with non-zero pixmap window origins Use computed depth for TrueColor visuals as fbdev doesn't have one. commit d568221710959cf7d783e6ff0fb80fb43a231124 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Fri Nov 14 16:49:22 2003 +0000 XFree86 4.3.0.1 commit 9508a382f8a9f241dab097d921b6d290c1c3a776 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Fri Nov 14 16:48:57 2003 +0000 Initial revision commit ded6147bfb5d75ff1e67c858040a628b61bc17d1 Author: Kaleb Keithley <kaleb@freedesktop.org> Date: Fri Nov 14 15:54:54 2003 +0000 R6.6 is the Xorg base-line commit cb6ef07bf01e72d1a6e6e83ceb7f76d6534da941 Author: Keith Packard <keithp@keithp.com> Date: Fri Nov 14 07:46:20 2003 +0000 Accelerated image text code drew glyphs at wrong location when compositing manager enabled. commit 318d525bf2fe52b059b1568e9b31d144b297a781 Author: Keith Packard <keithp@keithp.com> Date: Thu Nov 13 09:14:29 2003 +0000 Have the composite extension tell the damage extension about clients which have redirected subwindows in manual mode. Those clients are marked Critical and given a significant scheduling boost whenever they receive a damage notify event. This dramatically improves update frequency. If the kernel reported a large number of keys, readKernelMapping would walk off the end of the kdKeysym array. Fix usage of _IOWR; the 'size' argument is actually a datatype. commit e9904cefa39e1c9d3c7bf2f335dbafb23809cdba Author: Eric Anholt <anholt@freebsd.org> Date: Tue Nov 11 05:46:15 2003 +0000 Fix Makefile.am's to include header files needed for distcheck. Remove -Werror default and add --enable-werror switch to add it back. commit 5dc119b73ffcae32c2d470b734dfa2f8af58e77e Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 10 20:35:05 2003 +0000 Fix KdXv interface to pass drawable down so that bits can be put into drawable pixmap rather than directly into the frame buffer. Rewrite logic in kdoffscreen to make space for new allocations, now deals correctly with locked areas. commit e500986657ea8b4e14a1ff4730ecda4583c75277 Author: Keith Packard <keithp@keithp.com> Date: Mon Nov 10 06:40:23 2003 +0000 Must offset composite parameters by drawable coordinates in accelerated case. commit d694b44259ff51cfca2c3ec9a58bf164010cc1ad Author: Phil Blundell <pb@reciva.com> Date: Sat Nov 8 18:51:59 2003 +0000 Avoid ugly shell error when libXdmcp isn't present. New functions. (TsInit): Register them. commit 3e18c6363454aa87e1ad8c121019bab185e613b8 Author: Keith Packard <keithp@keithp.com> Date: Sat Nov 8 00:28:19 2003 +0000 Fix KAA to work with screen_x/screen_y hacks from COMPOSITE Also add kaaComposite acceleration for simple bltblt case. commit 1280f79054dc16ccf321006cd2de53e0f53c7b70 Author: Keith Packard <keithp@keithp.com> Date: Fri Nov 7 23:29:29 2003 +0000 Ok, Composite extension is semi-working; when no-one asks for redirection, the server seems to act as before. With RedirectSubwindows (root, automatic), the server looks just like a regular X server. Now to go rewrite the (currently lame) compositing manager to get some real action on the screen. Some of the fixes here are to make valgrind quiet with various ioctls used by kdrive/linux. Also fixed a bug where fbdev initialization was out of order in fbdev.c and smi.c commit d319a0a610c90524ad29cab3c6d4d21b5298fc7f Author: Phil Blundell <pb@reciva.com> Date: Fri Nov 7 23:00:06 2003 +0000 Fix warnings. commit 598c5d549abbb819f3391a2c88432941b546a213 Author: Matthew Allum <breakfast@10.am> Date: Thu Nov 6 14:01:46 2003 +0000 tslib improvements commit 7e1a564c416f6dc337a0021b1c0e1f2cb3b27296 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 5 06:46:13 2003 +0000 Replace translucent compositing hacks with PictOpSrc to match eventual extension semantics. Replace mouse acceleration with quadratic. commit 5378236aa647ec9a723a3e5fbd2a57eb286a1938 Author: Keith Packard <keithp@keithp.com> Date: Sun Nov 2 19:56:10 2003 +0000 merge xfixes_2_branch back to HEAD commit 9e94665cf9cf0f74dff5b3cdaa4cde99e234fa45 Author: Phil Blundell <pb@reciva.com> Date: Tue Oct 28 22:28:33 2003 +0000 try /dev/misc/apm_bios if /dev/apm_bios doesn't exist commit bb99451f275827da580dcfa3b66cd0705fcc900a Author: Phil Blundell <pb@reciva.com> Date: Tue Oct 28 22:27:35 2003 +0000 move smi into VESA_SUBDIRS commit 9a05f8f7858641b780046ad69d61f21ccbb93db8 Author: Keith Packard <keithp@keithp.com> Date: Sun Oct 19 20:46:23 2003 +0000 Minor cleanups -- remove a couple of bogus KdCheckSync calls, restructure KdOffscreenSwapOut to avoid unneeded 'continue' commit 16b2ea64e7e0bd32d6dba078b4891167bd335d44 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 16 08:03:25 2003 +0000 Discard/reconstruct list of offscreen areas on VT switch so no allocations can occur while switched away. Set type of off_screen_areas member to actual type instead of pointer commit f4bcd36a386116c450ea6893ab3d08e81cea663b Author: Anders Carlsson <andersca@gnome.org> Date: Wed Oct 15 05:34:54 2003 +0000 Add a memory_base variable and use it. commit f5916edb172738c73c8f78b23981abfd8d03a079 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 15 04:59:45 2003 +0000 hw/kdrive/*/Makefile.am Libraries in local dir must not use global path or make doesn't build things in the right order (-j) hw/kdrive/mga/mga.h, mgadraw.c Fix warnings commit b3e47ce18ff9c86833fc6302b1e074912edce404 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 15 01:00:38 2003 +0000 various Split out pixmap allocation debug statements Fix bogus offscreen pixmap size test Add migration to composite function for source operands VbeDPMS Remove extraneous call to VbeGetVib. commit 28bcd2efd134bfea3daa0738c9155b36cdf84168 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 14 21:33:04 2003 +0000 Avoid attempting acceleration on non-screen formats (for now) Offscreen allocator API changes. commit cb46169759a833605b78409ae68c9fb57618ceba Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 14 21:10:53 2003 +0000 Use same assumptions as layergc about what layer kind is approprate for unwrapping pixmap operations. This makes sure the accelerated code gets invoked for pixmaps Add pixmap migration support to kaa. Can't quite automatically migrate pixmaps off-screen, but soon we will. Can kick objects out of video memory. Move per-screen linked list pointers to pixmap private. Wrap Composite in preparation for migrating pixmaps. Have kasync ignore drawable type so that pixmaps trigger sync Add KdOffscreenFini to cleanup on server reset. Switch off screen area to have only a 'save' function; moving objects to off screen memory is done by saving then freeing the area. commit 109b94951654171ada94e2ffb29568b8a1bcde77 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 14 05:08:35 2003 +0000 -Wall fixes. Might have fixed VESA based DPMS code as a result commit 4b844cafb2516139c8407822b61939cd6c743742 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 14 05:07:39 2003 +0000 Check for off-screen pixmap support in KaaDrawableIsOffscreenPixmap. -Wall fixes. Allocate pixmap private space only for screens with off-screen pixmap support commit cdf3377f6d3789628495ac64df80ac7dc235e46d Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 14 05:05:53 2003 +0000 -Wall fixes. Support off-screen pixmaps commit 777f31cd0b5ec387d975e6d10ae73fa325e4c311 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 14 05:05:28 2003 +0000 -Wall fixes. Add klinux.h to export function declarations commit a398339b6d5209a11af93a3b836b0cad326a0799 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 14 05:04:22 2003 +0000 -Wall fixes commit 44f2e82f1b463e272f4e521561f74eb14bf24082 Author: Anders Carlsson <andersca@gnome.org> Date: Mon Oct 13 02:19:47 2003 +0000 Use pixmaps instead of drawables in the kaa functions. Have the mga server support accelerated operations on offscreen pixmaps. commit 47a9fab5e286c5224047690482a2cb36a3c17b88 Author: Anders Carlsson <andersca@gnome.org> Date: Mon Oct 13 01:19:37 2003 +0000 Add support for offscreen pixmaps. commit c538fa874257a2cbf53f329d3982e7a01fefe629 Author: Anders Carlsson <andersca@gnome.org> Date: Mon Oct 13 00:56:21 2003 +0000 Fix a couple of bugs. commit a50438b4709b32ec869e232628971b0dccd27adf Author: Anders Carlsson <andersca@gnome.org> Date: Mon Oct 13 00:19:58 2003 +0000 Add offscreen memory manager and update the servers to reflect the name change for the kaa structure. commit 307f3dbd10e0c8e392865e85e9e3e4dff108df02 Author: Anders Carlsson <andersca@gnome.org> Date: Sun Oct 12 14:17:24 2003 +0000 Remove this for now. commit ab3305d0ac805d0c9e917c35b316d9b58dde2187 Author: Anders Carlsson <andersca@gnome.org> Date: Sat Oct 11 19:36:13 2003 +0000 Add ATI Rage 128 server. commit ed98d3814ee65cd9fd18eeadbd20c8fc6b4ab342 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 9 23:35:44 2003 +0000 use #if instead of #ifdef commit 4dd37de858464c576bfdcd10255a8e233a5b05d5 Author: Anders Carlsson <andersca@gnome.org> Date: Thu Oct 9 16:21:24 2003 +0000 Build smi after vesa. commit e5a1c9952f7d621493f08257c8b9456b7608c55a Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 9 07:29:31 2003 +0000 Initialize smi chip on graphics setup. Seems to help some. commit 10f721acc5e59ea4152b94246b62963f2ff9d678 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 9 07:12:01 2003 +0000 Leave iopl set to 3 so vesa module will work commit f74555e94264e6f703d399a5e0475c7283e20a88 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 9 06:36:26 2003 +0000 Add xfixes, fix smi driver to use either fbdev or vesa. Add hole mapping to vesa server by default commit 346aff7ef6f47a191c7f134b7843a634189b9e83 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 9 06:35:11 2003 +0000 Use either vesa or fbdev, selectable at compile time commit adc5b8068d5532a6f3f23e64d3c668a22d5b1504 Author: Keith Packard <keithp@keithp.com> Date: Sun Oct 5 05:22:35 2003 +0000 Fix fbdev server to allow accelerated servers on top to use RandR. Switch smi server to fbdev (vesa bios doesnt work on the Acer I have here) commit f3d8476ced1e3ba4b4ca7c9e23e98c2cc7ffcc14 Author: Phil Blundell <pb@reciva.com> Date: Sat Oct 4 02:56:54 2003 +0000 few more fixes for h3600 ts commit aae3e6dcb3d72eba6d7d8d99079782ed1bfe63bd Author: Keith Packard <keithp@keithp.com> Date: Sat Oct 4 02:43:16 2003 +0000 configure.ac Makefile.am os/oscolor.c Xext/saver.c Xext/Makefile.am hw/kdrive/linux/ts.c hw/kdrive/src/Makefile.am hw/kdrive/src/kdrive.h hw/kdrive/src/kinput.c hw/kdrive/src/kmap.c Autodetect VM86 (for vesa), AGPGART, APM, MTRR, tslib and handhelds.org touch screen. Add USE_RGB_BUILTIN and code for fileless RGB database. Add MIT-SCREEN-SAVER commit efbf205a2ac4792b71d39f8fe3ef3b1cf12697c0 Author: Phil Blundell <pb@reciva.com> Date: Fri Oct 3 15:27:46 2003 +0000 add --disable-kdrivevesa option commit 89a536f349525e642bb4cd233bc47864ed4a6ad7 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 2 02:30:28 2003 +0000 Add smi server commit 5a21f4f4d0c03e0e34f1979fd7cec8f0d19b00d4 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 1 06:43:50 2003 +0000 Add XDM cookies. Fix up support for pkgconfig X bits commit a42e31b28c493dc3d6b32cde4e72ff17fc983183 Author: Matthew Allum <breakfast@10.am> Date: Tue Sep 30 22:14:59 2003 +0000 Fixed tslib driver to handle VT switches commit a0876ade6479c40dcef63f70f4c6c5a5988edeba Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 30 20:49:47 2003 +0000 Enable maintainer mode from autogen.sh. Fix vesa build to create library before program. Remove bogus AC_SUBST lines for XSERVER_CFLAGS and XSERVER_LIBS commit e8c02296476f068bc8158d112dc15df00dddac2a Author: Matthew Allum <breakfast@10.am> Date: Tue Sep 30 20:15:14 2003 +0000 Added --enable-tslib configure option commit a42384e9356ec79510682bacf08410e87d7102ff Author: Keith Packard <keithp@keithp.com> Date: Mon Sep 29 01:42:40 2003 +0000 Use other freedesktop.org packages to build the server commit 6a098a88af174db1674662c09e2385b4e6e0bb4e Author: Anders Carlsson <andersca@gnome.org> Date: Wed Sep 24 23:36:54 2003 +0000 Add beginnings of offscreen memory manager. commit 918a8273eeabcb14fc82742cc68223d8a7c2a67a Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 24 21:07:06 2003 +0000 hw/kdrive/src/kdrive.c hw/kdrive/src/kdrive.h Add -switchCmd option to set command that is executed whenever the VT is enabled or disabled. This permits input device to be customized by external apps when switching to X. commit 20bbd750d0d359e55cbdcc86aeea6013ac665bce Author: Anders Carlsson <andersca@gnome.org> Date: Mon Sep 22 21:14:59 2003 +0000 Accelerate server. commit 49771e3f074cae3947b0084e6514a19dc4c4cad1 Author: Anders Carlsson <andersca@gnome.org> Date: Thu Sep 18 20:48:48 2003 +0000 Add mga server to the build. commit 07ab15d61d2468fc858453cdabe7296d19fc9e10 Author: Anders Carlsson <andersca@gnome.org> Date: Thu Sep 18 20:47:43 2003 +0000 Add mga server commit b260825e880615f589e2bad35491ebb598e21a0f Author: Anders Carlsson <andersca@gnome.org> Date: Thu Sep 18 14:44:57 2003 +0000 Try this. commit b889d4ba2c2e59769a3ff6fd00ee5bb395108827 Author: Anders Carlsson <andersca@gnome.org> Date: Thu Sep 18 14:42:00 2003 +0000 Try things out. commit 85ff67670c6216a8c4368a8bd70fd0434a4e0aca Author: Anders Carlsson <andersca@gnome.org> Date: Tue Sep 16 21:07:16 2003 +0000 Add fbdev server to the build. commit be12dcdcf39a30f69fe73cbb5a4acacef8024db6 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 12 07:00:19 2003 +0000 Switch to freedesktop.org libXfont commit eca43a59ec95646836f9704714823249a15747fa Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 12 01:51:16 2003 +0000 Clean up mach64 for autofoo commit 6b16b827bb125b43b41b7f8558991e90ada316de Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 12 01:49:46 2003 +0000 Add some configure options, make the mach64 server build commit ce55d3234dc34157f0fc8059a6793cdd17fa4519 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 11 05:15:08 2003 +0000 Move kdrive common sources to src dir commit 269b9dac5a96005fe38379377526592cb7930a51 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 11 05:12:51 2003 +0000 Get Xvesa building commit 0d775576b9b3cf410e9a463b87340612d34bc13d Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 11 03:26:03 2003 +0000 Add Makefile.am commit ef8977a30ccb55af8e8bbb635127efb94f232983 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 11 03:23:13 2003 +0000 More build fixes commit 14a8311bb3b6273617f7c7b70222e97835e9c8af Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 11 02:31:24 2003 +0000 Make more stuff build commit 8bc8fd8678b20dde2a3fc47ff5b617bc8046ea9f Author: Mike A. Harris <mharris@redhat.com> Date: Thu Sep 11 02:02:54 2003 +0000 POSIX sigaction cleanups - removed act.sa_restorer as it's not in POSIX and is not portable commit 514ab46ce3c6eb0163720315474cba884d029b62 Author: Anders Carlsson <andersca@gnome.org> Date: Thu Sep 11 00:47:36 2003 +0000 Start autoifying everything. commit 283a7f32c449b1970e5a484351f8396a8afd99da Author: Keith Packard <keithp@keithp.com> Date: Mon Jul 7 19:13:03 2003 +0000 Update RCS tags, fix keyboard hang on VT switch, fix scroll wheel mice, add -rawcoord option to not transform mice on rotate, fix mtrr to use power-of-two size, add a few vesa options commit 804b89284665f19e2c92a07fadc72c25fbb3f5d9 Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 2 17:53:46 2003 +0000 Silicon motion driver for kdrive commit b923d897a51707c25b2dc62395d9765ba1a47bfe Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 2 17:53:46 2003 +0000 Initial revision commit 544ee9bb7a060d6a85b5168a2de74ff1db430c89 Author: Marc Aurele La France <tsi@ualberta.edu> Date: Wed Apr 23 21:51:18 2003 +0000 136. Fix bug that prevented fbman from using the last partial scanline of a Mach64 framebuffer (Marc La France). 135. Make ATI Mach64 FIFO cache integrity testing optional (Marc La France). 134. Export ATI Mach64 hardware overlay as an XVideo adaptor (derived from GATOS project, Egbert Eich, Marc La France). 133. Reorganise ATI Mach64 support into separate source files (Marc La France). 132. Refine atimisc's decoding of the panel mode on server entry in an attempt to reduce the effect of atyfb bugs (Marc La France). 131. Make Rage128 and Radeon XVideo available even when 2D acceleration is disabled (Marc La France). 130. There is no longer any need to require hardware cursors during Rage128 and Radeon XVideo displays (Marc La France). 129. Initialise v4l's XVideo adaptors last (Marc La France). 128. Reduce cut&paste effects by adding more helpers to Xv (derived from #5645, Bjrn Augustsson, Marc La France). 127. Centralise a region comparison primitive into 'mi' and use it instead of local definitions throughout the server (Marc La France). 126. DPMSExtension & XvExtension driver cleanups (Marc La France). commit 870d0f8752c11c3df42185786ab1e2bd200e4de1 Author: Egbert Eich <eich@suse.de> Date: Thu Dec 12 18:29:05 2002 +0000 621. Let kbd driver test if Xserver is in suspend before handling any input events (Egbert Eich). 620. Fixed agp version checking to accept minor versions >= the specified number (Leif Delgass). commit 7827fce0b5ff600d0adc3a30eab69e8141c2e548 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 13 16:37:39 2002 +0000 Allow input devices to be closed while the VT is switched away (needs per-driver support) commit 3eaea6608bc33633c00860008f246f59ad5687a7 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 12 22:20:42 2002 +0000 Update ipaq-specific ts driver to match generic tslib version commit 612e82053d986df70bcc9c87038244eab8c3dc13 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 5 05:28:34 2002 +0000 Clean up touch screen hacks for controlling pointer on alternate screen commit 358d887cbef4d2ec34532a364dd44205eab36c23 Author: Keith Packard <keithp@keithp.com> Date: Fri Nov 1 22:27:49 2002 +0000 Add support for ARM linux TS lib (disabled by default) in kdrive commit f0a8d06fcaf3fe0a652efa65966f4b0b0d688c12 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 31 18:29:50 2002 +0000 Refix mouse matrix computation for touch screens. Update usage message for -screen option commit 28d191680ecbcd50dc1cccec12e55a3c433fbf48 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 30 21:25:53 2002 +0000 Uninitialized mouse matrix elements commit dd7c85f108d01d207248300019e88d56012c33c9 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Oct 30 12:52:06 2002 +0000 441. Import Mesa-4.0.4, and resync with the DRI trunk (DRI Project). commit d04246c8fca4132063234ab44a68a7fac8c22261 Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 18 06:31:17 2002 +0000 Changed arguments to vesaRandRSetConfig commit 7d214e2e2a2a1601ca14be6b52190c5b22611e2d Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 18 06:08:10 2002 +0000 Fix additions of RandR support in kmode.c commit 5bb4a7b6998132d574d823301333b7e119dc7213 Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 18 06:00:29 2002 +0000 Fix other half of kdrive mach64 video code after randr update commit e1c304e22b1a29a5259aec1e956dbc75e0fa0138 Author: Keith Packard <keithp@keithp.com> Date: Mon Oct 14 18:01:42 2002 +0000 Add refresh rates to RandR (v1.1) commit 5804e69f4c20dcd33f69673aa82da3051e6eed3c Author: Keith Packard <keithp@keithp.com> Date: Sun Oct 13 19:35:56 2002 +0000 Custom file for rotating pcmcia screens commit b5d1c538622b21bed8eb59b557d79323f65ffbd7 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 8 21:28:05 2002 +0000 Add vtxx option to kdrive servers commit f214cab20baf57fc23389ef9b63a3e3a50b2a4f6 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 8 21:27:18 2002 +0000 Clear screen on mode switch commit b28a8c6e2a1fbc57d96d94b7445c86f94c2d8d4d Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 8 21:25:35 2002 +0000 Add another mach64 PCI id commit 9373d9186b413e1d53200b191816b9143d19c4bf Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 4 01:44:20 2002 +0000 Fix mouse mapping under reflection commit a80e1e5aed07cb57151408b0481f18e2ffb7f146 Author: Keith Packard <keithp@keithp.com> Date: Thu Oct 3 22:09:04 2002 +0000 Update kdrive servers to support reflection commit 238a2ec201a52d59a46540ddd419d8d6f6bf8daa Author: Keith Packard <keithp@keithp.com> Date: Sun Sep 29 23:39:47 2002 +0000 Update RandR to 1.0 (library version 2.0) commit 5d871996431e33b0d64ad9158e040e46770b6ee4 Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 26 02:56:48 2002 +0000 Add image transformation and sub-pixel ordering to Render commit a2637ba1f6c8417a48c95c9b65542c696ba0c8c0 Author: Egbert Eich <eich@suse.de> Date: Mon Sep 16 18:05:35 2002 +0000 319. Moved LdPreLib define after the vendor/OS specific config files as it may depend on setting done there (Egbert Eich). 318. Several fixes for cross compile environment (Egbert Eich). 317. Added code to allow for building of static only libraries with -fPIC for platforms which require it (Egbert Eich). 316. Added '-m32' to gcc flags as default for ia32 builds when gcc version is >= 3.1. This allows building a 32 bit Version of X on 64bit x86-64 (Egbert Eich). 315. Changed direct calls of ld to 'gcc -nostdlib' for Linux (Egbert Eich). 314. Changed calls to as to 'gcc -c -x assembler-with-cpp' for Linux (Egbert Eich). 313. Added '-fno-strict-aliasing' flag to gcc version >= 3.1 (Egbert Eich). Strict requires that one address must not contain pointers to different types - a feature heavily used by X (Egbert Eich). 312. Fixed a core dump problem in libXtt (?) (Egbert Eich). 311. Removed '#pragma pack' from structures that contain function pointers in x86emu. This causes problems on gcc 3.1 for ia64 (Egbert Eich). 310. Added defines for missing X types to saverproto.h (Egbert Eich). 309. Fixed compiler warings generated by gcc >= 3.1 in mesa drivers (Egbert Eich). 308. For platforms that allow both 32 and 64 bit libraries to be executed split Xlib i18n modules path into <libpath>/X11R6/lib/X11/locale/lib/common and <libpath>/X11R6/lib/X11/locale/lib64/common. 'lib64' has been defined to be the default path for 64bit shared libraries on these platforms (Egbert Eich). 307. Fixed obvious typo in OMlib (Egbert Eich). 306. Fixed code in cfb that didn't comply with C sequence rules. Modern C compilers tend to be more aggressive on code reordering (Egbert Eich). 305. Changed arguments of NoopDDA() from VarArgs to void. Handling of VarArgs by gcc isn't compatible with the way it was used on certain platforms (Egbert Eich). 304. Added support for 32bit pixmaps for 24bit overlay framebuffers in fb overlay code (Egbert Eich). 303. Fixed kdrive to print a meaningful error message instead of just core dump when no matching graphics cards is found (Egbert Eich). 302. fixed portability bug in xwd (Andreas Schwab <schwab@suse.de>) 301. fixed X Server crash, which happended each time a proportional iso10646 font was loaded with xtt backend (Yong Li <rigel863@yahoo.com>) 300. Added some ARM specific fixes to compiler.h (Uli Hecht). 299. Added a virtual 'dummy' driver (Egbert Eich). 298. Fixed core dump when certain access functions are not set in xf86Bus.c (Egbert Eich). 297. Fixed problem where SIGIO could be disabled after a server reset. 296. Added configurable list of devices the xf86Misc extension is allowed to change the mouse device to (Egbert Eich). 295. Changed default mouse type to 'auto' when generating config file with '-configure' (Egbert Eich). 294. Made sure keyboard modifier settings are consistent after exit from DGA when the xkb extension is used (Egbert Eich). 293. Disabled keyboard processing when Xserver is suspended by power management. This allows effective locking of laptops when stolen (Egbert Eich). 292. Added/improved options for lockfile syncing (Egbert Eich). 291. Added support for backup copy of Xserver logfile (Egbert Eich). 290. Fixed GetTimeInMillis() to use deltas instead of absolute time returend by gettimeofday(). This ensures time is monotonic in X (Egbert Eich). 289. Fixed xf86Misc extension to allow modification of Expps2 mice (Egbert Eich). 288. Made code in xf86MiscExt.c more readable (Egbert Eich). 287. Fixed PCI CardBus bridge handling (Egbert Eich). 286. Added code to reenable PCI bus mastering after coming back from a VT switch to radeon driver (Charl P. Botha <http://cpbotha.net/>) (Egbert Eich). 285. Dito for r128 driver (M. Harris). 284. Dito for glint and mga driver (Egbert Eich). 283. Fixed double scan issues for low res modes in C&T driver (Egbert Eich). 282. Set rgbBits to 8 for all HiQV chips in chips driver (Egbert Eich). 281. Moved initialization of accel funtions past initialization of offscreen fb manager in chips driver (Egbert Eich). 280. Fixed initialization of video in chips driver (?). 279. Fixed HALlib problem restoring text mode on G550 (Egbert Eich). 278. Restructured and included Matrox's Merged Framebuffer changes to mga driver (Egbert Eich). 277. G450/550 clockchip programming fixes (Matrox). 276. Fixed HW Cursor for HALlib frame granularity (Egbert Eich). 275. Enabling 2D accel in 24-bit for neomagic 2360 and 2380 (Egbert Eich). 274. Added support for builtin 1024x480 mode of Sony subnotebooks for Neomagic driver (Egbert Eich). 273. Fixed support for lowRes (320x240) modes in neomagic driver (Egbert Eich). 272. Fixed RAC function registration in S3 driver (Egbert Eich). 271. Added some voodoo to screen initialization of S3 driver (Egbert Eich). 270. Fixed vbe/int10 support in SMI driver. It used to core dump when BIOS was not usable (Egbert Eich). 269. Separated BRIGHTNESS and and CAPTURE_BRIGNTESS video attributes in smi driver: CAPTURE_BRIGHTNESS refers to the capture chip (ie. Philips SAA7110) while BRIGHTNESS controls the video overlay of the SMI chip itself (Egbert Eich). 268. Disable automatic loading of DRI when running SUN ffb as this is inconsistent with other drivers (Thorsten Kukuk). 267. Fixed Gamma/Brightness code in trident driver (Egbert Eich). 266. Added FpDelay debugging option (Egbert Eich). 260. Fixed video support for Trident 9397 (Egbert Eich). 265. Fixed Cursor/VT switch support for vmware driver (Egbert Eich). 264. Fixed Blit problems in vmware driver when running KDE (Egbert Eich). 263. Added RENDER support to vmware driver (Egbert Eich). 262. Added C&T 69030 to extrapci.ids (Egbert Eich). 261. Improved mouse autodetection code (Egbert Eich). 260. Restructured int10 code so that vm86 and x86emu support can be loaded as modules. Implemented heuristic to try vm86 first and fall back to x86emu. This allows 32 bit Xservers to run on x86_64 on 64-bit kernel without vm86 support (Egbert Eich). 259. Restructured elf loader: determine which section to load from elfheader flags (Egbert Eich). 258. Adding RENDER Support to RAC (Egbert Eich). 257. Using borderClip instead of borderSize region for redisplay function in miext/shadow code to avoid core dumps when vt switched away (Egbert Eich). 256. Replacing sprintf() by snprintf() in lbxproxy to eliminate possible buffer overrun exploits (Egbert Eich). 255. KP_Decimal fixes to Czech and Slovak keybards (Jan Holesovsky <kendy@suse.cz>) (Egbert Eich). commit 2698ee9f29189a44de1c92df99f48d45f0111577 Author: Keith Packard <keithp@keithp.com> Date: Thu Aug 15 18:07:57 2002 +0000 Prefer touchscreen to mouse commit fe477855d7d714c154dc9fcb1d0aa67fb8e4e5a5 Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 2 16:30:50 2002 +0000 Fix for iPaq IOCTL changes commit cf49ce6f26caee30f4160e6e0b2b658863e7a145 Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 2 16:15:02 2002 +0000 Allow both touchscreen and mouse at the same time commit 1a5f923c62dcffb3a81c6532f3dc071c70345cb3 Author: David Dawes <dawes@xfree86.org> Date: Tue Jun 4 22:19:58 2002 +0000 174. Fix makedepend so that it can parse a unary '+' operator (#5185, Mark Snitily). 173. Fix a typo in Xvesa's emulation of instructions forbidden in vm86 mode (#5184, Juliusz Chroboczek) 172. Fix a bounds check in Xlib's Region code (#5183, Owen Taylor). commit 98f8d7af3cb7a10cc268a8bdd3039539b1bf90f2 Author: Keith Packard <keithp@keithp.com> Date: Tue Feb 19 00:18:05 2002 +0000 kdrive/vesa: apply vm86 patch from Juliusz commit 6d8cedf68c7803330bc920cf7506727c4ad6108c Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 14 16:08:05 2002 +0000 update kdrive manual and usage commit 44b20bfa587def11f3127980e67ff47e695c3e51 Author: Keith Packard <keithp@keithp.com> Date: Fri Feb 1 00:52:15 2002 +0000 kdrive/mach64: recognize the mach64li commit 3abb3e073961986137f8fec1f194c60636b9e864 Author: Keith Packard <keithp@keithp.com> Date: Fri Jan 18 16:25:19 2002 +0000 kdrive: fix button emulation for iPAQ commit 88810cfc02941d7e54924e25aa872e5cc740d274 Author: Keith Packard <keithp@keithp.com> Date: Thu Dec 20 16:47:30 2001 +0000 kdrive/linux/mouse.c: convert mouse data to signed values for compilers with default unsigned chars commit 83388cb23282471e80d513bd3ab472b51c110b35 Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 10 16:34:20 2001 +0000 kdrive/i810: bit swap for i810 cursor (from Pontus Lidman) commit 4646a6c3b925676039f50bacb4f3c780f6e81bcc Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 7 02:19:04 2001 +0000 kdrive: work around ipaq touch screen compile problems commit 54feb8a4c8f0e0cb6eb40b494171fa4f3552cfc3 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 7 02:18:19 2001 +0000 kdrive: missing registration for mouse input type commit 636390fb9d6314e506f593da6556fa198b4e9bf6 Author: Keith Packard <keithp@keithp.com> Date: Thu Nov 22 23:38:21 2001 +0000 kdrive: initialize all Linux mouse driver fields commit 668c25a769044f06ed47a3145a11aceeb9574c9d Author: Keith Packard <keithp@keithp.com> Date: Thu Nov 8 10:26:24 2001 +0000 kdrive: fix ALTGR keyboard mappings commit e76c6b2acae5622dd2d4944cd6f3673dbc70a571 Author: Keith Packard <keithp@keithp.com> Date: Thu Nov 8 09:35:08 2001 +0000 kdrive/linux: update ps/2 mouse detection/configuration code from FreeBSD bits commit 6fafe3b092f799da788a1ae75be1c23da42f0983 Author: Keith Packard <keithp@keithp.com> Date: Thu Nov 8 09:33:51 2001 +0000 kdrive: Open APM device r/w for kernel 2.4.14 commit 2f2e256de71c42b7856440ec43b1c122019b95b7 Author: Marc Aurele La France <tsi@ualberta.edu> Date: Mon Oct 29 16:34:56 2001 +0000 DPMS warning fix commit b8d90c5ea4659a01694864e6c05a563dcea296eb Author: Marc Aurele La France <tsi@ualberta.edu> Date: Sun Oct 28 03:33:10 2001 +0000 407. Fix for threaded libraries (Marc La France). 406. Finish removal of SuperProbe (Marc La France). 405. A rather large number of warning fixes throughout (Marc La France). 404. Fix bug in HTML install script (Marc La France). 403. Missing ident lines for some XFree86-modified files (Marc La France). 402. Add default half-width doublescanned modes (Marc La France). 401. Mark all driver-registered resources with ResBus (Maarc La France). 400. Fix DPMS-related build problem (Marc La France). 399. Log a message just before calling each ChipProbe() during '-probe' processing (Marc La France). 398. Temporarily disable ISA probing on SPARCs and PowerPCs (Marc La France). 397. Add PCI IDs for Sun hardware (Marc La France). 396. Fix memory leak in resource relocation (Marc La France). 395. Do not relocate resources that only conflict with disabled non-video PCI devices or disabled PCI ROMs (Marc La France). 394. Re-organise SBUS code (Marc La France). 393. Add as-yet-unused definitions for PCI resource types other than I/O and memory (Marc La France). 392. Add doc for Solaris, but don't format it yet (Marc La France). 391. Normalise driver names (Marc La France). 390. For SPARCs, disable DGA support in ATI driver (Marc La France). 389. Clean up some debugging messages (Marc La France). 388. Fix newport driver for when a /proc fs isn't mounted (Marc La France). 387. Fix DAC handling bugs in s3 driver (Marc La France). 386. Fix resource registration bug for PCI Tseng's (Marc La France). 385. Add aperture driver for Solaris (not yet used) (Marc La France). 384. Rework scanpci to fix problems that prevented it from completely displaying non-PCI bridges and Simba bridges (Marc La France). 383. Fix build problems in some input drivers (Marc La France). 382. Fix int10 compile problem for SPARCs and PowerPCs (Marc La France). 381. Ensure master aborts on secondary buses complete normally during PCI scans (Marc La France). 380. Some memory mapping and Solaris cleanups (Marc La France). commit a8518b35617a479f50c735c015115b853f4aa327 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 24 20:14:52 2001 +0000 kdrive/savage: Long lines cant be drawn with accelerator commit 28fd5f7525848cf0109f9cf2d6311f3717570a5d Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 12 06:33:12 2001 +0000 kdrive: add new auto-detecting and auto-switching mouse driver commit 5f310d7f8b566b1e331286752d349f87ef43a811 Author: Keith Packard <keithp@keithp.com> Date: Sat Sep 29 04:16:39 2001 +0000 kdrive: restructure APM/VT switch support to reset keyboard state and flush buffer on APM resume commit bb2e1c53b58ac94539f0d11ae195186a9ee0a2f7 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 21 21:58:34 2001 +0000 hw/kdrive: Xv window private should be allocated on demand commit 59cd35f634468acfa2e48711da09fabc811d96f9 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 14 19:25:17 2001 +0000 hw/kdrive/vesa: initialize mouse matrix for non-rotated case correctly commit fbaf3ceae0519ebdfee4b6a73b1bc0000f141cf2 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 14 19:24:11 2001 +0000 hw/kdrive/trident: solid fill checks busted for planemasking commit 216090d1aedb23c691a75da25b14d8543b932e1c Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 5 07:12:43 2001 +0000 kdrive: Add primitive ct65550 server. Update kdrive/vesa code to support DPMS using VESA bios routines. Include support for Toshiba SMM DPMS as well commit f856b952ec7251d6e95f0b93d62fb026d07b0ebc Author: David Dawes <dawes@xfree86.org> Date: Thu Aug 9 20:45:15 2001 +0000 187. Add an MS mouse driver for KDrive (#4754, Juliusz Chroboczek). commit f4db75ac431c14e0c24ff7549c6ce1e3b0b86b87 Author: Keith Packard <keithp@keithp.com> Date: Thu Aug 9 09:08:55 2001 +0000 kdrive/mach64: support Xv under RandR commit 628d7695d1696f6f5cba6ea1f2548aa5d0f38c80 Author: Keith Packard <keithp@keithp.com> Date: Thu Aug 9 09:06:08 2001 +0000 kdrive: disable sigio debugging commit 958c0374a6709386e91b4b3ed7ba8fa81d415ebf Author: Keith Packard <keithp@keithp.com> Date: Tue Jul 24 21:26:17 2001 +0000 kdrive: add apm support, fix MTRR unmapping bug commit b7eb8a35b51aa2edc9ff59f091ee88ea7000b757 Author: Keith Packard <keithp@keithp.com> Date: Tue Jul 24 19:06:04 2001 +0000 kdrive: Unmap vesa device when disabled commit d2d221a012950b98e48e47b6dea38e6ad385fef8 Author: Keith Packard <keithp@keithp.com> Date: Mon Jul 23 03:44:17 2001 +0000 kdrive/mach64: Force read of GUI_STAT on every op to avoid problems across suspend/resume commit 79486b3b5c792a990cb73b4efa453218262e605f Author: Keith Packard <keithp@keithp.com> Date: Fri Jul 20 19:35:30 2001 +0000 Too many changes, but all in kdrive: Add support for global screen origins (-origin option), handles both Xinerama and mouse crossings. Fix XV enable/disable sequences -- can't use card wrappers as cards have more than one screen. Change vesa/fbdev to use new depth-independent rotation shadow update Fix vesa to allow starting rotation value (again) Make vesa driver write all colormap changes in one INT10 call commit 9826d5a1339570c037ae1ef29c9a237874a6ffa2 Author: Keith Packard <keithp@keithp.com> Date: Thu Jul 19 08:46:30 2001 +0000 kdrive/fbdev: only setting first colormap entry on static hardware commit 35d8b5f44269c97497c73d3638b8f0345757c04c Author: Keith Packard <keithp@keithp.com> Date: Mon Jul 16 19:48:00 2001 +0000 kdrive/fbdev: fix static color case commit 090a429573dfb965ebc4ea8ea57e3bef5f9a8539 Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 11 16:42:17 2001 +0000 kdrive/fbdev: dont set DPMS mode repeatedly to the same value commit 99fb2eb76d8f93578e4aba75c73b9be0766f7b6f Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 11 05:02:24 2001 +0000 Generalize kludge in fbdev that normalizes pixel formats to something that Render can handle commit 562474091a3d52a062eb89d25a7d38200a785425 Author: Keith Packard <keithp@keithp.com> Date: Wed Jul 11 02:58:19 2001 +0000 Fix TOUCHSCREEN support in kdrive commit 67cd53abfce7ed17ae4c428332a9e0fd908da97a Author: Keith Packard <keithp@keithp.com> Date: Fri Jun 29 14:00:41 2001 +0000 Rework kdrive input fd handling, enable multiple simultaneous mice commit c872ee82045e8c7ce019df2577d06bec549cd71c Author: Keith Packard <keithp@keithp.com> Date: Fri Jun 29 13:57:45 2001 +0000 kdrive: typo in MTRR calculations commit 63dd090655ba995b8f26386bb50cb5b7568f7da0 Author: Keith Packard <keithp@keithp.com> Date: Fri Jun 29 13:55:53 2001 +0000 kdrive: dont touch hardware when disabled commit 01a53daa03a8ee36ce136dde3a9a9b152e9c2e2f Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 23 03:41:24 2001 +0000 Clean up mach64 video code to add ReputVideo and make StopVideo not crash the machine commit 31d47ec8bed1b02d04563ba502eaeb028975f653 Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 21 21:44:09 2001 +0000 kdrive/mach64: remove useless Xv debug printfs commit bd61c15279e2195c72b3add32961ed21e293d48b Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 21 01:01:30 2001 +0000 Add RCS tag commit 66c9184807997d2a0a155ba1697906c07396863f Author: Keith Packard <keithp@keithp.com> Date: Thu Jun 21 00:58:51 2001 +0000 Fix screen physical size in RandR code for kdrive fbdev and pcmcia servers commit f8a456f094d8f61c021bbfb6e6f0a4723ebdc73f Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed Jun 20 21:53:31 2001 +0000 Add RandR support to the Kdrive pcmcia driver. commit 918ff10f2697ee8c17013bd31596072a38c5ac9b Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 19 09:31:47 2001 +0000 Finish Xv support for kdrive/mach64 commit 6d86517b0ed0db51f3eaf19c186db52feb1e47e0 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 16 05:53:05 2001 +0000 Screen flipping broken pointer remapping commit 54aea8ec0c1c3633788fd9b19636093860c75d53 Author: Keith Packard <keithp@keithp.com> Date: Sat Jun 16 05:48:49 2001 +0000 Patch DPMS support in kdrive/mach64, add preliminary (broken) Xv support commit f386ca6c69ba10cd8c0dd60bb25cde37ecfc8bc7 Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 13 19:18:44 2001 +0000 Support initial rotation in kdrive/fbdev, use that as the normal orientation commit 93dbdc89c172fd5d6450f21ebc91011771ac0100 Author: Keith Packard <keithp@keithp.com> Date: Wed Jun 13 19:18:03 2001 +0000 Add -dpi support to kdrive commit a6517a3056a88fca35a47185a0e6d83f3e8b0015 Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 11 01:38:54 2001 +0000 Advertise supported rotations in kdrive/vesa server commit 4f8254b31f30bd12224c2fdcecfbd67b41ecd7e1 Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 5 17:17:39 2001 +0000 Attempt to make kdrive/fbdev run on static gray hardware (iPaq 3150) commit bf4dbfbf45e4e6b1b86c624b1995a1050b7a0eef Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Tue Jun 5 16:57:44 2001 +0000 fix some warnings due to new shadow code commit a4ba10ba6ffb1c01a0df5b34669b9fb24ad0e7d9 Author: Keith Packard <keithp@keithp.com> Date: Tue Jun 5 16:49:31 2001 +0000 kdrive/fbdev: RandR initialization sequence change commit 7fcf46356ba70563f036f535e60667727db442ae Author: Keith Packard <keithp@keithp.com> Date: Mon Jun 4 09:45:42 2001 +0000 Allow for hardware acceleration under RandR with Layer. Hardware/Software cursor switching still busted commit 54e66d92db917923e33e018e628a7629d6705507 Author: Keith Packard <keithp@keithp.com> Date: Sun Jun 3 21:52:46 2001 +0000 Update RandR protocol commit 88ae32841d766c7d0df79ee25e1db62996d4ecb3 Author: Keith Packard <keithp@keithp.com> Date: Sun Jun 3 18:48:19 2001 +0000 Add mach64 driver to Tiny-X commit 14ed0c3d6d674df4edcbcd8840a7cea4b41a0673 Author: Keith Packard <keithp@keithp.com> Date: Wed May 30 15:36:25 2001 +0000 Fix kaa to not try Copy for pixmap sources commit a2bd75d15a99d4ee117e17921f0426228d53f5e8 Author: Keith Packard <keithp@keithp.com> Date: Tue May 29 21:55:41 2001 +0000 Xfbdev: Make sure screen gets re-enabled on RandR failure commit 562925c439cf1746f2caa720d4f2dce54ba0311b Author: Keith Packard <keithp@keithp.com> Date: Tue May 29 17:47:55 2001 +0000 Fix Xipaq build after layer/RandR additions commit 78b53386b51cde4fe4664963ddafa36b814360f2 Author: Keith Packard <keithp@keithp.com> Date: Tue May 29 04:54:13 2001 +0000 Add miext/layer for more complete RandR support in kdrive/Xfbdev commit 06f758797ab3651b0e293ae26daf4df77702fdde Author: Keith Packard <keithp@keithp.com> Date: Sat May 26 01:25:42 2001 +0000 Add initial RandR support to Xvesa commit ba8351609869165aa2de92b7a876dc2d2768cb5b Author: David Dawes <dawes@xfree86.org> Date: Fri May 25 18:40:59 2001 +0000 38. Fix xmh's use of XtNewString() with getenv (#4694, Tim Waugh). 37. Xdm/PAM fixes: leave it to PAM to observe whether or not an account is locked, and reinitialize credentials after calling initgroups(), because sometimes the credentials pam_setcred() gives are in the form of group membership (#4693, Mike Harris). 35. Fix warnings when building mieq.c (#4689, Adam Sulmicki). 34. Fix some bugs in the cz and sk entried in XKB's keymap/xfree86 file (#4692, Ivan Pascal). 33. Add 'hr' entries to XKB's keymap/xfree86 and rules/xfree86.lst files (#4687, Nerijus Baliunas). 32. Include <X11/Xutil.h> in shape.h to get Region typedef (#4686, Adam Sulmicki). commit e9314bd34ec39cc699591123cc8a05a934b66b85 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Fri May 25 07:44:29 2001 +0000 wrap some stuff around #ifdef TOUCHSCREEN commit e6497f39af98cd25719eab72b0be04fa4146172f Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Thu May 24 19:31:46 2001 +0000 fix ifdef->if commit 0e1a49a7dd00ae494d92ab480d9776ec5320cb3e Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed May 23 17:28:39 2001 +0000 add missing pieces for the pcmcia driver commit 85d827f5329fa93dea1125788457fac6835cd134 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Wed May 23 08:56:09 2001 +0000 Add PCMCIA server for HP VGA Out PC Card and the Voyager VGA Card. Use on the Compaq IPAQ. Use -listmodes to see supported modes. Hack the touchscreen driver to work as a mouse pad for the VGA screen. Fixup key bindings so xmodmap can remap IPAQ's buttons as mouse buttons. commit f9104754cda1212cf48d6d24a0a586c5368d7549 Author: Keith Packard <keithp@keithp.com> Date: Wed May 23 03:29:44 2001 +0000 Add RandR extension commit dc383e8f77f99e8c2b799a6ab4e4998a1fcacb24 Author: Marc Aurele La France <tsi@ualberta.edu> Date: Sun Apr 1 14:00:04 2001 +0000 317. glxinfo needs libGLU (Marc La France). 316. Rage128 fix to Cards database (Marc La France). 315. Minor fix to PCI resource overlap handling (Marc La France). 314. Loader code simplification and IA-64 cache flushes (Marc La France). 313. Workaround in the ATI driver for troublesome interaction between loader and compiler optimisation (Marc La France). 312. Warning fixes for `gcc -fno-builtin`, which appears to be the default on some systems (Marc La France). more of #301, tags, warnings and build fixes. commit 518e205b06d0dc7a0cd35fbc2c6a4376f2959020 Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 30 17:35:55 2001 +0000 kdrive/igs: add missing register definitions that used to be in igsregs.t commit eb3da37564593b7c9fb574af824e2f5e0cc6bb24 Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 30 02:18:41 2001 +0000 Add files for Xmuu and i810 driver commit f39a62d122b6e63e2971d8593bf6b24933f66ec8 Author: Keith Packard <keithp@keithp.com> Date: Fri Mar 30 02:15:20 2001 +0000 Add Xmuu library to remove requirement for Xt/Xaw from most X utilities Add i810 and Xv support to kdrive commit a161cfd72870ae6dca66ef02f5cdd13b7ac75fd6 Author: David Dawes <dawes@xfree86.org> Date: Wed Mar 21 16:43:16 2001 +0000 remove Id line commit 0aa54b4d409647778b563d77ef6100085d86c6f3 Author: David Dawes <dawes@xfree86.org> Date: Tue Feb 13 21:15:15 2001 +0000 144. Fix the neomagic driver so that it saves/restores the palette (#4452, Ken Hornstein). 143. Fix a palette saving bug in the vgahw module (#4452, Ken Hornstein). 142. Fix a typo in Xfbdev.man (#4446, Juliusz Chroboczek). 141. Major updates to the savage driver, including: - DDC support - I2C support - XVideo YUV overlay support for Savage/MX and Savage/IX - DGA support - yanks Ani Joshi's depth/bitsPerPixel patch for searching the BIOS - fixes interactions with frame buffer and SVGATextMode consoles; VT switching now seems quite reliable for almost everyone - yanks unused options - adds new options for hacks to deal with the status register hangs - adds one special case memory configuration for Savage 4 - adds support for doublescan modes (320x240 works) - adds LCD panel detection - fixes a panning bug at depth 24 (panning must be to even pixels) - adds a workaround for bugs in the latest ProSavage BIOSes (#4445, 4448, Tim Roberts). 140. Make 'X -configure' use the long monitor name when present in the DDC info (#4444, Andrew C. Aitchison). 139. Make glxinfo respect $DISPLAY (#4443, Meelis Roos). 138. Fix TrueType font problems in 4.0.2 (#4439, Juliusz Chroboczek). 137. Document the "DisplaySize" keyword in the XF86Config man page (#4438, Andrew C. Aitchison). commit 3dfa6cce9938413e10cc400ba6d9b19b8f28e485 Author: David Dawes <dawes@xfree86.org> Date: Sat Jan 27 18:20:40 2001 +0000 88. Set the version strings in man pages dynamically (David Dawes). 87. Remove the XF86_VERSION string from xf86Version.h, leaving just the numerical values. All the version information is now derived from that single set of values (David Dawes). commit 60c7a912e257045d1189a19a38d9dbedc20ae78b Author: David Dawes <dawes@xfree86.org> Date: Wed Jan 24 00:06:10 2001 +0000 79. Preprocess all man pages to make sure that the references to pages in sections that are platform-dependent are correct. Also fixed some misc formatting problems found while doing that (David Dawes). commit dacbf5671da08d161cd7a32496e0b58f50a93453 Author: Keith Packard <keithp@keithp.com> Date: Tue Jan 23 06:25:05 2001 +0000 Integrate jg patch for iPAQ commit 2869e08a328cb6aa51c17b96bdebd37e9eeefc88 Author: Keith Packard <keithp@keithp.com> Date: Wed Dec 13 18:06:54 2000 +0000 kdrive: non-x86 compiles broken in kmap.c commit ec4916836c42cb4a1dc1622dddd27951a90a52c9 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 8 23:04:57 2000 +0000 kdrive: dont try MTRR on non-x86, fix backspace mapping commit d09a156d92dbcd9368be20dabe47ea197f19357e Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 8 22:59:37 2000 +0000 kdrive: allow screen size specification commit 6b61d48f2146f18c94d5f2b3d16a822c0eee9841 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 8 21:40:29 2000 +0000 kdrive/vesa: type cast warning fix commit b59eabd230110d604515868893d9aa06e6d3b748 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 8 21:40:02 2000 +0000 kdrive: A few iPAQ inspired changes to event management commit a25637fe789c5127451233c759074780cbc110ac Author: David Dawes <dawes@xfree86.org> Date: Mon Dec 4 21:01:00 2000 +0000 missing ident lines commit 1adbdf76a903aa37d553c1c2cc43a783f21acaa5 Author: Keith Packard <keithp@keithp.com> Date: Fri Dec 1 00:01:32 2000 +0000 kdrive: add Xkdrive/Xfbdev man pages, update Xvesa manual commit 5f8e75f27d49719f5fd07d48481435f93779da6c Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 29 08:42:25 2000 +0000 kdrive: add MTRR support, add clock support to trident driver commit 02568ec5a8f278faaa26c973fcb424da3fd31f2b Author: Keith Packard <keithp@keithp.com> Date: Sun Nov 19 20:51:12 2000 +0000 kdrive: vesa get mode using uninitialized value commit 8f634a6516caca0e4be875e696820a820e480cff Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 20 00:19:51 2000 +0000 Add VGA BIOS modes to Tiny-X Xvesa server commit f16d5d6817f15be35293ee995d073eb57fafe283 Author: Keith Packard <keithp@keithp.com> Date: Wed Oct 11 06:04:40 2000 +0000 Add composite operator support to trident commit d579bd5676ea570a8f2765cd2f6ba40074171593 Author: Marc Aurele La France <tsi@ualberta.edu> Date: Tue Oct 10 14:05:48 2000 +0000 Static build fix and ident lines. commit 5f5b9ed1ad0591d70354c2b90609051d169fc33e Author: Keith Packard <keithp@keithp.com> Date: Sun Oct 8 02:08:39 2000 +0000 kdrive: Add timeout to screen switching to avoid unintentional flipping commit fb8b58270fcaee236337d3818df04e651acbcea9 Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 6 22:13:40 2000 +0000 kdrive: support jgs new linux keysyms commit 15d45ffbd9af5ccce07264d6182b2222c417a2a5 Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 6 22:05:53 2000 +0000 kdrive: fix any-edge screen-switching behaviour commit fae164a4958b95e3ba4e4d5125da4611fcb14f6d Author: Keith Packard <keithp@keithp.com> Date: Fri Oct 6 05:54:09 2000 +0000 kdrive: ignore mouse/keyboard fds in WakeupHandler while switched away commit b814019be970bc45f808ec19eef0a48b789d6646 Author: Keith Packard <keithp@keithp.com> Date: Tue Oct 3 17:22:14 2000 +0000 kdrive: zero out fbdev screen private as its supposed to be commit e0ccbaab226bd3e1d619d66c9ec718c67c0a559a Author: Keith Packard <keithp@keithp.com> Date: Thu Sep 28 20:58:21 2000 +0000 kdrive: fix typo initializing touch screen commit 6171187e92152a443f7d5dd7f0dad866b3e275ea Author: Keith Packard <keithp@keithp.com> Date: Wed Sep 27 20:47:37 2000 +0000 kdrive: memory/fd leaks fixed in fbdev/vesa/trident drivers commit 367cab99ece8655bbd8a65096bb68bcfd7ef6fea Author: Marc Aurele La France <tsi@ualberta.edu> Date: Tue Sep 26 15:57:04 2000 +0000 721. PCI chip ID updates to ATI driver (Marc La France). 720. Fix i810 driver for -probe and -configure (Marc La France). 719. Change message when default modes are deleted (Marc La France). 718. Fix Xinerama byte swapping bug (Marc La France). 717. IA-64 and Alpha fixes for pswrap, Mesa, DRI, Xpm, libX11, Xt, Xaw, Xmu, dps, Type1 fonts, cfb24, most output drivers, ELF loader, ramdac module, xf4bpp and xf86cfg (Marc La France). 716. Improve IA-64 support by removing a plethora of 32-bit'isms (Marc La France). 715. Default HasLinuxDoc to NO (Marc La France). ident lines and warning fixes. commit 94368c3b92b8513d5135fb3c20165f108b0e96fd Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 26 04:31:23 2000 +0000 kdrive: Add iPAQ and Touch screen support commit 03e3689701007ea40422b4d729b65aaebcd84869 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Sun Sep 24 13:52:40 2000 +0000 reversed a tag accidentally - put it back. commit 61e8a40f0d4e886bec96c3f9ee90433a3fab9d54 Author: Alan Hourihane <alanh@fairlite.demon.co.uk> Date: Sun Sep 24 13:51:22 2000 +0000 DRI merge commit 2bbb90ebd927607e0b2c7cd8f3a402b44705fe03 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 22 06:25:29 2000 +0000 Changes for PPC support under linux and a few overlay additions commit 02777941e6ac8c79f934ba95b6b2e7f388ffbd14 Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 19 23:50:48 2000 +0000 kdrive: fix bug in vesa 4plane in 8bpp mode commit 5b9f49f64c7fb51afbfaab4f848fc7d67851582c Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 19 23:49:55 2000 +0000 kdrive: use VESA instead of FBDEV for trident driver commit 18692160c964c80ba83b63bc207660b6254e11cb Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 19 23:49:17 2000 +0000 kdrive: make sure allocation worked before accessing commit d6e151ce4deaff506c580da7e3baf055db1c3ae3 Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 15 15:19:00 2000 +0000 Tiny-X: Add mouse matrix to rotate mouse, allow enable to fail, add render by default commit f7421d836186cd6dfb919c5a48d556a68d6c5a5d Author: Keith Packard <keithp@keithp.com> Date: Fri Sep 15 07:25:13 2000 +0000 Add rotation to fbdev and vesa commit 5ec29fe9ea788e0dcc47534a2eca479b2c465160 Author: Marc Aurele La France <tsi@ualberta.edu> Date: Thu Sep 7 19:44:26 2000 +0000 Ident lines commit db1a883d32ce8138dde288d32c11e147cdfc81a0 Author: Keith Packard <keithp@keithp.com> Date: Sun Sep 3 05:12:28 2000 +0000 Rework tiny-x vesa driver for shadowing and multiple screen support. Allow enable to fail and avoid crashing commit c97fb611dd7dedef6d075ef9d56f3d32c8018d39 Author: Keith Packard <keithp@keithp.com> Date: Sun Sep 3 05:11:46 2000 +0000 Rework vesa driver for shadowing and multiple screen support. Allow enable to fail and avoid crashing commit 38059656849a5bab5b56b23359a90aca4ba396c7 Author: Keith Packard <keithp@keithp.com> Date: Tue Aug 29 17:20:15 2000 +0000 Use VESA driver underneath commit 77331f967077ca2fefbfb117c7e9bc2bf65b5e31 Author: Keith Packard <keithp@keithp.com> Date: Tue Aug 29 17:19:51 2000 +0000 Changes from Juliusz for emulating some in/out insns, make ready for other layers to use commit 3095deed7701a1a14be85dff4a6994028b5a6d09 Author: David Dawes <dawes@xfree86.org> Date: Mon Aug 28 15:29:19 2000 +0000 565. Support for multithreaded libraries on NetBSD when used in conjunction with the GNU pth library (#4113, Chris Sekiya). 564. Add /usr/pkg/bin to NetBSD's DefaultUserPath (#4112, Bernd Ernesti). 563. Add a (Linux-specific) VESA driver for Keith's small X server (#4111, Juliusz Chroboczek). 562. Update Hungarian xkb maps (#A.145, Peter Soos). remove koi8-r encoding file since it's built-in commit f32448679118b77825625aafdc4d6ae4d636cc21 Author: Marc Aurele La France <tsi@ualberta.edu> Date: Mon Aug 28 02:43:14 2000 +0000 Ident lines commit 83a388c96d665b6bfb0ae195c8c74e0e1520ab8f Author: Keith Packard <keithp@keithp.com> Date: Sat Aug 26 00:24:38 2000 +0000 Try to avoid hitting hardware during server reset when not active, add KdPicture code commit 4223801110c8d5873dd668880dff411765dfc18d Author: Keith Packard <keithp@keithp.com> Date: Wed Aug 9 17:52:45 2000 +0000 Add overlay support for savage. Make sis setup code work on nIc commit 325fb002e8832a05361516bbaf19d1e8b67a3486 Author: Keith Packard <keithp@keithp.com> Date: Wed May 24 23:57:56 2000 +0000 Fix 640x480x60 mode, drop inb/outb on non-x86 machines commit a6d519e527a81341ad333cb25b410dfde07176ae Author: Keith Packard <keithp@keithp.com> Date: Wed May 24 23:52:48 2000 +0000 Add modes, cursors and acceleration commit 240aeb4cda91d19f5b19ebd7f7d6c1aad19f1642 Author: Marc Aurele La France <tsi@ualberta.edu> Date: Thu May 11 18:14:13 2000 +0000 162. Fix possible SEGV in generic int10 module (Marc La France). 161. Fix *BSD aperture driver to allow for int10 (Bernd Ernesti, Marc La France). 160. Fix vesafb restore problem in ATI driver (Marc La France). 159. Fix a few more compilation glitches (Marc La France). commit 3731c184d69e3c1face0c731926433d522d48067 Author: Keith Packard <keithp@keithp.com> Date: Sat May 6 22:17:53 2000 +0000 Lots of Tiny-X changes: Add overlay support in the Tiny-X Savage4 driver (required changing lots of Tiny-X code). Savage4 now support 8/16, 8/32 overlays. Add IGS Cyberpro 5050 driver. This chip has bus support for embeded systems. commit 4b54f22b6accf438f31fbbe79877545c38375351 Author: David Dawes <dawes@xfree86.org> Date: Wed Feb 23 20:30:15 2000 +0000 remove/disable standard RCS ident lines that are in some files some bindist updates don't define noPanoramiXExtension when Xinerama is not enabled Add xfontsel to programs/Imakefile commit be2dad5954b8fee09a84f417e41bb65745dadf76 Author: David Dawes <dawes@xfree86.org> Date: Fri Jan 21 18:41:49 2000 +0000 missing ident lines commit 306ac1db85c30a796c9a69c639e7f2e4efd98d50 Author: David Dawes <dawes@xfree86.org> Date: Fri Jan 21 01:12:02 2000 +0000 3554. Fix "controlization" in XLookupString for chars > 127 (#3569, Ivan Pascal). 3553. Take advantage of FB speedups in Tiny-X (#3568, Keith Packard). 3552. Speed up FB and do 32bit accesses instead of 64bit accesses (#3567, Keith Packard). 3551. Eliminate saving the contents of the screen durint VT switching (#3562, Keith Packard). 3550. Make using fb easier for driver writers (#3561, Keith Packard). 3549. Fix TCP font server connections (#3560, Keith Packard). 3548. Implement the "OverclockMem" option for the Millennium and Millennium II (#3558, Andrew Aitchison). 3547. Speed up some FB performance problems (#3557, 3559, 3560, Keith Packard). 3546. Work around a bad code generation bug in gcc 2.7.2.3 that shows up in XAA (#3550, Rik Faith). 3545. Add a -brief option to xclock to show only hours and minutes when in digital mode (#3549, Keith Packard). 3544. Fix some dead key problems with xkb symbols for Swiss French and Swiss German keyboards (#3546, Charles Lopes). commit 6d978d21b0bea6c73b65f2f47c68de4b94dd73c4 Author: Robin Cutshaw <robin@intercore.com> Date: Thu Dec 30 03:42:58 1999 +0000 Itsy cleanup. commit 30e35cb44b6ea11d0eac8ce0d986517f3224852a Author: Robin Cutshaw <robin@intercore.com> Date: Thu Dec 30 03:03:21 1999 +0000 3516. Jumbo Tiny-X patch with Itsy support (#3527, Keith Packard). commit f13b792a3a8d307a18cd6a41aa5a06622009e42f Author: Dirk Hohndel <dirk.hohndel@intel.com> Date: Fri Nov 19 13:54:06 1999 +0000 3336. Fx up new MMIO macros (#3337, Matt Grossman). 3335. Clean up compiler warnings in lib/font/bitmap (#3411, Matt Grossman). 3334. TGA fixes, add sync on green (#3410, Matt Grossman). 3333. Fix NULL pointer dereference in libXaw (#3406, Christopher Sekiya). 3332. Add Rage128 support (#3405, Rik Faith, funded by ATI). 3331. Add MTRR support for NetBSD and OpenBSD. Add new NetBSD aperture driver (#3404, Matthieu Herrb). 3330. Xterm patch #121 (#3402, Thomas Dickey). 3329. Rendition driver bugfixes and alpha related cleanups (#3400, Dejan Ilic, Marc Langenbach, Egbert Eich). 3328. Add void input device (#3392, Frederic Lepied). 3327. Changed the Xon serial option to be able to select xon/xoff for input, output or both. Add support for Graphire models. Change wacom init phase to use new Xoff option (#3391, Frederic Lepied). 3326. Change the SwapAxes option to SwapXY in elographics/microtouch driver to match an already existing option in the Dynapro driver. Add a Focus class capability to the elographics driver (#3395, Patrick Lecoanet). 3325. Update mouse rate handling (#3388, Harald Koenig). 3324. Fix NULL pointer dereference in misprite.c (#3380, Edward Wang). 3323. Add FBDev and ShadowFB support to glint driver. Add new option "NoWriteBitmap" (#3383, Michel Daenzer). 3322. Update SuperProbe to handle S3 Savage4, Savage200 and clean up Trio3D/Savage3D detection (#3382,3384 Harald Koenig). 3321. Add new framebuffer code and tiny X DDX architecture (#3379, Keith Packard). 3320. Add DGA2 documentation (#3378, Mark Vojkovich). 3319. Update XFree86 manpage wrt -bpp/-depth/-fbbpp (#3377, Andy Isaacson). 3318. Make SuperProbe check primary cards, only (#3374, Harald Koenig). 3317. Add SilkenMouse to *BSD (#3373, Matthieu Herrb). 3316. Allow SilkenMouse to work if not all drivers of an OS support SIGIO (#3372, Keith Packard). 3315. Fix a few problems in TGA driver and add support for backing store and SilkenMouse (#3371, Matt Grossman). 3314. Add smarter scheduler (#3370, Keith Packard). 3313. Xterm patch #120 (#3369, Thomas Dickey). 3312. Enable xf86SetKbdRate function on Solaris 8 (#3364, David Holland). 3311. Fix some bugs and add acceleration to Rendition server (#3360, Dejan Ilic). 3310. Make raw DDC information available as properties in the root window (#3357, Andrew Aitchison). 3309. Fix for xf86CreateRootWindow (#3355, Andrew Aitchison). 3308. Add manpage for the chips driver (#3353, David Bateman). 3307. Update contact info (#3352, Andrew van der Stock). 3306. Add kbd rate support for Linux (#3363, Harald Koenig). 3305. Update Portuguese XKB map (#3351, Joao Esteves, Francisco Colaco). 3304. Fix text clipping in 3dfx driver (#3349, Henrik Harmsen). 3303. Fix S3 ViRGE hw cursor (#3348, Harald Koenig). 3302. Fix clipping in 3dfx driver (#3342, Daryll Strauss). 3301. Enable SilkenMouse for 3dfx driver (#3341, Henrik Harmsen). 3300. Enable SIGIO support on LynxOS (#3339, Thomas Mueller). 3299. Get TRUE defined in sigio.c. Fix xterm compile problem on ISC (#3338, Michael Rohleder). 3298. Correct DPMS suspend/standby modes for 3dfx driver (#3336, Henrik Harmsen) 3297. Xterm patch #119 (#3335, Thomas Dickey). ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/manpages.am����������������������������������������������������������������������0000664�0001751�0001751�00000003601�12323563340�013124� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS += -e 's|__logdir__|$(logdir)|g' \ -e 's|__datadir__|$(datadir)|g' \ -e 's|__mandir__|$(mandir)|g' \ -e 's|__sysconfdir__|$(sysconfdir)|g' \ -e 's|__xconfigdir__|$(__XCONFIGDIR__)|g' \ -e 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' \ -e 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' \ -e 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' \ -e 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' \ -e 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' \ -e 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' \ -e 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' \ -e 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' \ -e 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' \ -e 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' \ -e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ �������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dri3/����������������������������������������������������������������������������0000775�0001751�0001751�00000000000�12466505444�011744� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dri3/Makefile.am�����������������������������������������������������������������0000664�0001751�0001751�00000000324�12234570262�013710� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������noinst_LTLIBRARIES = libdri3.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ @DIX_CFLAGS@ @XORG_CFLAGS@ libdri3_la_SOURCES = \ dri3.h \ dri3_priv.h \ dri3.c \ dri3_request.c \ dri3_screen.c sdk_HEADERS = dri3.h ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dri3/dri3_request.c��������������������������������������������������������������0000664�0001751�0001751�00000025462�12456571574�014460� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> #endif #include "dri3_priv.h" #include <syncsrv.h> #include <unistd.h> #include <xace.h> #include "../Xext/syncsdk.h" #include <protocol-versions.h> static int proc_dri3_query_version(ClientPtr client) { REQUEST(xDRI3QueryVersionReq); xDRI3QueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_DRI3_MAJOR_VERSION, .minorVersion = SERVER_DRI3_MINOR_VERSION }; REQUEST_SIZE_MATCH(xDRI3QueryVersionReq); (void) stuff; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.majorVersion); swapl(&rep.minorVersion); } WriteToClient(client, sizeof(rep), &rep); return Success; } int dri3_send_open_reply(ClientPtr client, int fd) { xDRI3OpenReply rep = { .type = X_Reply, .nfd = 1, .sequenceNumber = client->sequence, .length = 0, }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } if (WriteFdToClient(client, fd, TRUE) < 0) { close(fd); return BadAlloc; } WriteToClient(client, sizeof (rep), &rep); return Success; } static int proc_dri3_open(ClientPtr client) { REQUEST(xDRI3OpenReq); RRProviderPtr provider; DrawablePtr drawable; ScreenPtr screen; int fd; int status; REQUEST_SIZE_MATCH(xDRI3OpenReq); status = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess); if (status != Success) return status; if (stuff->provider == None) provider = NULL; else if (!RRProviderType) { return BadMatch; } else { VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); if (drawable->pScreen != provider->pScreen) return BadMatch; } screen = drawable->pScreen; status = dri3_open(client, screen, provider, &fd); if (status != Success) return status; if (client->ignoreCount == 0) return dri3_send_open_reply(client, fd); return Success; } static int proc_dri3_pixmap_from_buffer(ClientPtr client) { REQUEST(xDRI3PixmapFromBufferReq); int fd; DrawablePtr drawable; PixmapPtr pixmap; int rc; SetReqFds(client, 1); REQUEST_SIZE_MATCH(xDRI3PixmapFromBufferReq); LEGAL_NEW_RESOURCE(stuff->pixmap, client); rc = dixLookupDrawable(&drawable, stuff->drawable, client, M_ANY, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->drawable; return rc; } if (!stuff->width || !stuff->height) { client->errorValue = 0; return BadValue; } if (stuff->width > 32767 || stuff->height > 32767) return BadAlloc; if (stuff->depth != 1) { DepthPtr depth = drawable->pScreen->allowedDepths; int i; for (i = 0; i < drawable->pScreen->numDepths; i++, depth++) if (depth->depth == stuff->depth) break; if (i == drawable->pScreen->numDepths) { client->errorValue = stuff->depth; return BadValue; } } fd = ReadFdFromClient(client); if (fd < 0) return BadValue; rc = dri3_pixmap_from_fd(&pixmap, drawable->pScreen, fd, stuff->width, stuff->height, stuff->stride, stuff->depth, stuff->bpp); close (fd); if (rc != Success) return rc; pixmap->drawable.id = stuff->pixmap; /* security creation/labeling check */ rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP, pixmap, RT_NONE, NULL, DixCreateAccess); if (rc != Success) { (*drawable->pScreen->DestroyPixmap) (pixmap); return rc; } if (AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) return Success; return Success; } static int proc_dri3_buffer_from_pixmap(ClientPtr client) { REQUEST(xDRI3BufferFromPixmapReq); xDRI3BufferFromPixmapReply rep = { .type = X_Reply, .nfd = 1, .sequenceNumber = client->sequence, .length = 0, }; int rc; int fd; PixmapPtr pixmap; REQUEST_SIZE_MATCH(xDRI3BufferFromPixmapReq); rc = dixLookupResourceByType((void **) &pixmap, stuff->pixmap, RT_PIXMAP, client, DixWriteAccess); if (rc != Success) { client->errorValue = stuff->pixmap; return rc; } rep.width = pixmap->drawable.width; rep.height = pixmap->drawable.height; rep.depth = pixmap->drawable.depth; rep.bpp = pixmap->drawable.bitsPerPixel; rc = dri3_fd_from_pixmap(&fd, pixmap, &rep.stride, &rep.size); if (rc != Success) return rc; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.size); swaps(&rep.width); swaps(&rep.height); swaps(&rep.stride); } if (WriteFdToClient(client, fd, TRUE) < 0) { close(fd); return BadAlloc; } WriteToClient(client, sizeof(rep), &rep); return client->noClientException; } static int proc_dri3_fence_from_fd(ClientPtr client) { REQUEST(xDRI3FenceFromFDReq); DrawablePtr drawable; int fd; int status; SetReqFds(client, 1); REQUEST_SIZE_MATCH(xDRI3FenceFromFDReq); LEGAL_NEW_RESOURCE(stuff->fence, client); status = dixLookupDrawable(&drawable, stuff->drawable, client, M_ANY, DixGetAttrAccess); if (status != Success) return status; fd = ReadFdFromClient(client); if (fd < 0) return BadValue; status = SyncCreateFenceFromFD(client, drawable, stuff->fence, fd, stuff->initially_triggered); return status; } static int proc_dri3_fd_from_fence(ClientPtr client) { REQUEST(xDRI3FDFromFenceReq); xDRI3FDFromFenceReply rep = { .type = X_Reply, .nfd = 1, .sequenceNumber = client->sequence, .length = 0, }; DrawablePtr drawable; int fd; int status; SyncFence *fence; REQUEST_SIZE_MATCH(xDRI3FDFromFenceReq); status = dixLookupDrawable(&drawable, stuff->drawable, client, M_ANY, DixGetAttrAccess); if (status != Success) return status; status = SyncVerifyFence(&fence, stuff->fence, client, DixWriteAccess); if (status != Success) return status; fd = SyncFDFromFence(client, drawable, fence); if (fd < 0) return BadMatch; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } if (WriteFdToClient(client, fd, FALSE) < 0) return BadAlloc; WriteToClient(client, sizeof(rep), &rep); return client->noClientException; } int (*proc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { proc_dri3_query_version, /* 0 */ proc_dri3_open, /* 1 */ proc_dri3_pixmap_from_buffer, /* 2 */ proc_dri3_buffer_from_pixmap, /* 3 */ proc_dri3_fence_from_fd, /* 4 */ proc_dri3_fd_from_fence, /* 5 */ }; int proc_dri3_dispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data >= DRI3NumberRequests || !proc_dri3_vector[stuff->data]) return BadRequest; return (*proc_dri3_vector[stuff->data]) (client); } static int sproc_dri3_query_version(ClientPtr client) { REQUEST(xDRI3QueryVersionReq); REQUEST_SIZE_MATCH(xDRI3QueryVersionReq); swaps(&stuff->length); swapl(&stuff->majorVersion); swapl(&stuff->minorVersion); return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } static int sproc_dri3_open(ClientPtr client) { REQUEST(xDRI3OpenReq); REQUEST_SIZE_MATCH(xDRI3OpenReq); swaps(&stuff->length); swapl(&stuff->drawable); swapl(&stuff->provider); return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } static int sproc_dri3_pixmap_from_buffer(ClientPtr client) { REQUEST(xDRI3PixmapFromBufferReq); REQUEST_SIZE_MATCH(xDRI3PixmapFromBufferReq); swaps(&stuff->length); swapl(&stuff->pixmap); swapl(&stuff->drawable); swapl(&stuff->size); swaps(&stuff->width); swaps(&stuff->height); swaps(&stuff->stride); return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } static int sproc_dri3_buffer_from_pixmap(ClientPtr client) { REQUEST(xDRI3BufferFromPixmapReq); REQUEST_SIZE_MATCH(xDRI3BufferFromPixmapReq); swaps(&stuff->length); swapl(&stuff->pixmap); return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } static int sproc_dri3_fence_from_fd(ClientPtr client) { REQUEST(xDRI3FenceFromFDReq); REQUEST_SIZE_MATCH(xDRI3FenceFromFDReq); swaps(&stuff->length); swapl(&stuff->drawable); swapl(&stuff->fence); return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } static int sproc_dri3_fd_from_fence(ClientPtr client) { REQUEST(xDRI3FDFromFenceReq); REQUEST_SIZE_MATCH(xDRI3FDFromFenceReq); swaps(&stuff->length); swapl(&stuff->drawable); swapl(&stuff->fence); return (*proc_dri3_vector[stuff->dri3ReqType]) (client); } int (*sproc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { sproc_dri3_query_version, /* 0 */ sproc_dri3_open, /* 1 */ sproc_dri3_pixmap_from_buffer, /* 2 */ sproc_dri3_buffer_from_pixmap, /* 3 */ sproc_dri3_fence_from_fd, /* 4 */ sproc_dri3_fd_from_fence, /* 5 */ }; int sproc_dri3_dispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data >= DRI3NumberRequests || !sproc_dri3_vector[stuff->data]) return BadRequest; return (*sproc_dri3_vector[stuff->data]) (client); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dri3/dri3.h����������������������������������������������������������������������0000664�0001751�0001751�00000005471�12366751547�012713� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2013 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. */ #ifndef _DRI3_H_ #define _DRI3_H_ #ifdef DRI3 #include <X11/extensions/dri3proto.h> #include <randrstr.h> #define DRI3_SCREEN_INFO_VERSION 1 typedef int (*dri3_open_proc)(ScreenPtr screen, RRProviderPtr provider, int *fd); typedef int (*dri3_open_client_proc)(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd); typedef PixmapPtr (*dri3_pixmap_from_fd_proc) (ScreenPtr screen, int fd, CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp); typedef int (*dri3_fd_from_pixmap_proc) (ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size); typedef struct dri3_screen_info { uint32_t version; dri3_open_proc open; dri3_pixmap_from_fd_proc pixmap_from_fd; dri3_fd_from_pixmap_proc fd_from_pixmap; /* Version 1 */ dri3_open_client_proc open_client; } dri3_screen_info_rec, *dri3_screen_info_ptr; extern _X_EXPORT Bool dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info); extern _X_EXPORT int dri3_send_open_reply(ClientPtr client, int fd); #endif #endif /* _DRI3_H_ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dri3/dri3_priv.h�����������������������������������������������������������������0000664�0001751�0001751�00000004743�12274325511�013736� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2013 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. */ #ifndef _DRI3PRIV_H_ #define _DRI3PRIV_H_ #include <X11/X.h> #include "scrnintstr.h" #include "misc.h" #include "list.h" #include "windowstr.h" #include "dixstruct.h" #include <randrstr.h> #include "dri3.h" extern int dri3_request; extern DevPrivateKeyRec dri3_screen_private_key; typedef struct dri3_screen_priv { CloseScreenProcPtr CloseScreen; ConfigNotifyProcPtr ConfigNotify; DestroyWindowProcPtr DestroyWindow; dri3_screen_info_ptr info; } dri3_screen_priv_rec, *dri3_screen_priv_ptr; #define wrap(priv,real,mem,func) {\ priv->mem = real->mem; \ real->mem = func; \ } #define unwrap(priv,real,mem) {\ real->mem = priv->mem; \ } static inline dri3_screen_priv_ptr dri3_screen_priv(ScreenPtr screen) { return (dri3_screen_priv_ptr)dixLookupPrivate(&(screen)->devPrivates, &dri3_screen_private_key); } int proc_dri3_dispatch(ClientPtr client); int sproc_dri3_dispatch(ClientPtr client); /* DDX interface */ int dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd); int dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd, CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp); int dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size); #endif /* _DRI3PRIV_H_ */ �����������������������������xorg-server-1.17.1/dri3/dri3_screen.c���������������������������������������������������������������0000664�0001751�0001751�00000006145�12366220413�014223� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> #endif #include "dri3_priv.h" #include <syncsdk.h> #include <misync.h> #include <misyncshm.h> #include <randrstr.h> static inline Bool has_open(dri3_screen_info_ptr info) { if (info == NULL) return FALSE; return info->open != NULL || (info->version >= 1 && info->open_client != NULL); } int dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd) { dri3_screen_priv_ptr ds = dri3_screen_priv(screen); dri3_screen_info_ptr info = ds->info; int rc; if (!has_open(info)) return BadMatch; if (info->version >= 1 && info->open_client != NULL) rc = (*info->open_client) (client, screen, provider, fd); else rc = (*info->open) (screen, provider, fd); if (rc != Success) return rc; return Success; } int dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd, CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp) { dri3_screen_priv_ptr ds = dri3_screen_priv(screen); dri3_screen_info_ptr info = ds->info; PixmapPtr pixmap; if (!info || !info->pixmap_from_fd) return BadImplementation; pixmap = (*info->pixmap_from_fd) (screen, fd, width, height, stride, depth, bpp); if (!pixmap) return BadAlloc; *ppixmap = pixmap; return Success; } int dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { ScreenPtr screen = pixmap->drawable.pScreen; dri3_screen_priv_ptr ds = dri3_screen_priv(screen); dri3_screen_info_ptr info = ds->info; int fd; if (!info || !info->fd_from_pixmap) return BadImplementation; fd = (*info->fd_from_pixmap)(screen, pixmap, stride, size); if (fd < 0) return BadAlloc; *pfd = fd; return Success; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dri3/Makefile.in�����������������������������������������������������������������0000664�0001751�0001751�00000065621�12466505430�013736� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = dri3 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libdri3_la_LIBADD = am_libdri3_la_OBJECTS = dri3.lo dri3_request.lo dri3_screen.lo libdri3_la_OBJECTS = $(am_libdri3_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 = $(libdri3_la_SOURCES) DIST_SOURCES = $(libdri3_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libdri3.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ @DIX_CFLAGS@ @XORG_CFLAGS@ libdri3_la_SOURCES = \ dri3.h \ dri3_priv.h \ dri3.c \ dri3_request.c \ dri3_screen.c sdk_HEADERS = dri3.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 dri3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dri3/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libdri3.la: $(libdri3_la_OBJECTS) $(libdri3_la_DEPENDENCIES) $(EXTRA_libdri3_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdri3_la_OBJECTS) $(libdri3_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri3_request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri3_screen.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: ���������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dri3/dri3.c����������������������������������������������������������������������0000664�0001751�0001751�00000005762�12374224060�012671� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> #endif #include "dri3_priv.h" int dri3_request; DevPrivateKeyRec dri3_screen_private_key; DevPrivateKeyRec dri3_window_private_key; static int dri3_screen_generation; static Bool dri3_close_screen(ScreenPtr screen) { dri3_screen_priv_ptr screen_priv = dri3_screen_priv(screen); unwrap(screen_priv, screen, CloseScreen); free(screen_priv); return (*screen->CloseScreen) (screen); } Bool dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info) { dri3_screen_generation = serverGeneration; if (!dixRegisterPrivateKey(&dri3_screen_private_key, PRIVATE_SCREEN, 0)) return FALSE; if (!dri3_screen_priv(screen)) { dri3_screen_priv_ptr screen_priv = calloc(1, sizeof (dri3_screen_priv_rec)); if (!screen_priv) return FALSE; wrap(screen_priv, screen, CloseScreen, dri3_close_screen); screen_priv->info = info; dixSetPrivate(&screen->devPrivates, &dri3_screen_private_key, screen_priv); } return TRUE; } void dri3_extension_init(void) { ExtensionEntry *extension; int i; /* If no screens support DRI3, there's no point offering the * extension at all */ if (dri3_screen_generation != serverGeneration) return; #ifdef PANORAMIX if (!noPanoramiXExtension) return; #endif extension = AddExtension(DRI3_NAME, DRI3NumberEvents, DRI3NumberErrors, proc_dri3_dispatch, sproc_dri3_dispatch, NULL, StandardMinorOpcode); if (!extension) goto bail; dri3_request = extension->base; for (i = 0; i < screenInfo.numScreens; i++) { if (!dri3_screen_init(screenInfo.screens[i], NULL)) goto bail; } return; bail: FatalError("Cannot initialize DRI3 extension"); } ��������������xorg-server-1.17.1/configure������������������������������������������������������������������������0000775�0001751�0001751�00003677173�12466505420�012754� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for xorg-server 1.17.1. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" as_awk_strverscmp=' # Use only awk features that work with 7th edition Unix awk (1978). # My, what an old awk you have, Mr. Solaris! END { while (length(v1) && length(v2)) { # Set d1 to be the next thing to compare from v1, and likewise for d2. # Normally this is a single character, but if v1 and v2 contain digits, # compare them as integers and fractions as strverscmp does. if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { # Split v1 and v2 into their leading digit string components d1 and d2, # and advance v1 and v2 past the leading digit strings. for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) if (d1 ~ /^0/) { if (d2 ~ /^0/) { # Compare two fractions. while (d1 ~ /^0/ && d2 ~ /^0/) { d1 = substr(d1, 2); len1-- d2 = substr(d2, 2); len2-- } if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { # The two components differ in length, and the common prefix # contains only leading zeros. Consider the longer to be less. d1 = -len1 d2 = -len2 } else { # Otherwise, compare as strings. d1 = "x" d1 d2 = "x" d2 } } else { # A fraction is less than an integer. exit 1 } } else { if (d2 ~ /^0/) { # An integer is greater than a fraction. exit 2 } else { # Compare two integers. d1 += 0 d2 += 0 } } } else { # The normal case, without worrying about digits. d1 = substr(v1, 1, 1); v1 = substr(v1, 2) d2 = substr(v2, 1, 1); v2 = substr(v2, 2) } if (d1 < d2) exit 1 if (d1 > d2) exit 2 } # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10), # which mishandles some comparisons of empty strings to integers. if (length(v2)) exit 1 if (length(v1)) exit 2 } ' SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' PACKAGE_VERSION='1.17.1' PACKAGE_STRING='xorg-server 1.17.1' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' ac_unique_file="Makefile.am" # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # ifdef HAVE_STDLIB_H # include <stdlib.h> # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS DIX_CFLAGS BUILD_TIME BUILD_DATE RELEASE_DATE SYSCONFDIR PROJECTROOT WAYLAND_SCANNER XWAYLAND_SYS_LIBS XWAYLAND_LIBS XWAYLAND_FALSE XWAYLAND_TRUE XWAYLANDMODULES_LIBS XWAYLANDMODULES_CFLAGS XFAKESERVER_FALSE XFAKESERVER_TRUE BUILD_KDRIVEFBDEVLIB_FALSE BUILD_KDRIVEFBDEVLIB_TRUE XEPHYR_FALSE XEPHYR_TRUE KDRIVEFBDEV_FALSE KDRIVEFBDEV_TRUE TSLIB_FALSE TSLIB_TRUE KDRIVE_MOUSE_FALSE KDRIVE_MOUSE_TRUE KDRIVE_KBD_FALSE KDRIVE_KBD_TRUE KDRIVE_EVDEV_FALSE KDRIVE_EVDEV_TRUE KDRIVELINUX_FALSE KDRIVELINUX_TRUE KDRIVE_LIBS KDRIVE_LOCAL_LIBS KDRIVE_PURE_LIBS KDRIVE_CFLAGS KDRIVE_PURE_INCS KDRIVE_INCS XEPHYR_INCS XEPHYR_LIBS XEPHYR_CFLAGS TSLIB_LIBS TSLIB_CFLAGS KDRIVE_FALSE KDRIVE_TRUE DMX_BUILD_USB_FALSE DMX_BUILD_USB_TRUE DMX_BUILD_LNX_FALSE DMX_BUILD_LNX_TRUE X11EXAMPLES_DEP_LIBS X11EXAMPLES_DEP_CFLAGS XRESEXAMPLES_DEP_LIBS XRESEXAMPLES_DEP_CFLAGS XTSTEXAMPLES_DEP_LIBS XTSTEXAMPLES_DEP_CFLAGS DMXXIEXAMPLES_DEP_LIBS DMXXIEXAMPLES_DEP_CFLAGS DMXXMUEXAMPLES_DEP_LIBS DMXXMUEXAMPLES_DEP_CFLAGS DMXEXAMPLES_DEP_LIBS DMXEXAMPLES_DEP_CFLAGS XDMX_SYS_LIBS XDMX_LIBS XDMX_CFLAGS DMX_FALSE DMX_TRUE XDMXCONFIG_DEP_LIBS XDMXCONFIG_DEP_CFLAGS DMXMODULES_LIBS DMXMODULES_CFLAGS STANDALONE_XPBPROXY_FALSE STANDALONE_XPBPROXY_TRUE XQUARTZ_SPARKLE_FALSE XQUARTZ_SPARKLE_TRUE XQUARTZ_FALSE XQUARTZ_TRUE am__fastdepOBJC_FALSE am__fastdepOBJC_TRUE OBJCDEPMODE OBJCFLAGS OBJCLINK OBJCCLD OBJC PSEUDORAMIX_FALSE PSEUDORAMIX_TRUE XPBPROXY_LIBS XPBPROXY_CFLAGS XQUARTZ_LIBS XWIN_XV_FALSE XWIN_XV_TRUE XWIN_RANDR_FALSE XWIN_RANDR_TRUE XWIN_GLX_WINDOWS_FALSE XWIN_GLX_WINDOWS_TRUE XWIN_CLIPBOARD_FALSE XWIN_CLIPBOARD_TRUE XWIN_MULTIWINDOWEXTWM_FALSE XWIN_MULTIWINDOWEXTWM_TRUE XWIN_MULTIWINDOW_FALSE XWIN_MULTIWINDOW_TRUE XWIN_FALSE XWIN_TRUE KHRONOS_SPEC_DIR KHRONOS_OPENGL_REGISTRY_LIBS KHRONOS_OPENGL_REGISTRY_CFLAGS PYTHON3 XWIN_SYS_LIBS XWIN_SERVER_NAME XWIN_LIBS WINDOWSWM_LIBS WINDOWSWM_CFLAGS XWINMODULES_LIBS XWINMODULES_CFLAGS WINDRES GLAMOR_EGL_FALSE GLAMOR_EGL_TRUE GBM_LIBS GBM_CFLAGS GLAMOR_LIBS GLAMOR_CFLAGS GLAMOR_FALSE GLAMOR_TRUE XORG_DRIVER_MODESETTING_FALSE XORG_DRIVER_MODESETTING_TRUE XORG_BUS_PLATFORM_FALSE XORG_BUS_PLATFORM_TRUE XF86VIDMODE_FALSE XF86VIDMODE_TRUE DGA_FALSE DGA_TRUE SOLARIS_VT_FALSE SOLARIS_VT_TRUE LNXAPM_FALSE LNXAPM_TRUE LNXACPI_FALSE LNXACPI_TRUE LINUX_ALPHA_FALSE LINUX_ALPHA_TRUE XORG_BUS_SPARC_FALSE XORG_BUS_SPARC_TRUE XORG_BUS_BSDPCI_FALSE XORG_BUS_BSDPCI_TRUE XORG_BUS_PCI_FALSE XORG_BUS_PCI_TRUE XORG_FALSE XORG_TRUE abi_extension abi_xinput abi_videodrv abi_ansic logdir sysconfigdir extdir sdkdir driverdir moduledir DEFAULT_XDG_DATA_HOME_LOGDIR DEFAULT_XDG_DATA_HOME DEFAULT_LOGPREFIX DEFAULT_LOGDIR DEFAULT_LIBRARY_PATH DEFAULT_MODULE_PATH __XCONFIGDIR__ XF86CONFIGFILE __XCONFIGFILE__ XF86CONFIGDIR XORG_CFLAGS XORG_OS_SUBDIR XORG_INCS XORG_SYS_LIBS XORG_LIBS XORG_MODULES_LIBS XORG_MODULES_CFLAGS XF86VIDMODE_LIBS XF86VIDMODE_CFLAGS DGA_LIBS DGA_CFLAGS SOLARIS_INOUT_ARCH PCI_TXT_IDS_PATH PCIACCESS_LIBS PCIACCESS_CFLAGS symbol_visibility XNEST_SYS_LIBS XNEST_LIBS XNEST_FALSE XNEST_TRUE XNESTMODULES_LIBS XNESTMODULES_CFLAGS 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 XSERVER_LIBS HAVE_LIBUNWIND_FALSE HAVE_LIBUNWIND_TRUE LIBUNWIND_LIBS LIBUNWIND_CFLAGS XSERVERLIBS_LIBS XSERVERLIBS_CFLAGS XSERVERCFLAGS_LIBS XSERVERCFLAGS_CFLAGS SHA1_CFLAGS SHA1_LIBS OPENSSL_LIBS OPENSSL_CFLAGS LIBSHA1_LIBS LIBSHA1_CFLAGS MAIN_LIB OS_LIB DIX_LIB DEBUG_FALSE DEBUG_TRUE VENDOR_NAME_SHORT DRI_DRIVER_PATH BASE_FONT_PATH SERVER_MISC_CONFIG_PATH COMPILEDDEFAULTFONTPATH XDMAUTH_FALSE XDMAUTH_TRUE XDMCP_FALSE XDMCP_TRUE XDMCP_LIBS XDMCP_CFLAGS XKB_DFLT_OPTIONS XKB_DFLT_VARIANT XKB_DFLT_LAYOUT XKB_DFLT_MODEL XKB_DFLT_RULES XKB_COMPILED_DIR XKM_OUTPUT_DIR XKB_BIN_DIRECTORY XKB_BASE_DIRECTORY INT10MODULE_FALSE INT10MODULE_TRUE VBE_FALSE VBE_TRUE VGAHW_FALSE VGAHW_TRUE XF86UTILS_FALSE XF86UTILS_TRUE DPMSExtension_FALSE DPMSExtension_TRUE XF86BIGFONT_FALSE XF86BIGFONT_TRUE DBE_FALSE DBE_TRUE XCSECURITY_FALSE XCSECURITY_TRUE SELINUX_LIBS SELINUX_CFLAGS XSELINUX_FALSE XSELINUX_TRUE XACE_FALSE XACE_TRUE XINERAMA_FALSE XINERAMA_TRUE PRESENT_FALSE PRESENT_TRUE GLX_SYS_LIBS GLX_DEFINES AIGLX_DRI_LOADER_FALSE AIGLX_DRI_LOADER_TRUE GLX_FALSE GLX_TRUE GL_LIBS GL_CFLAGS XLIB_LIBS XLIB_CFLAGS DRI2_AIGLX_FALSE DRI2_AIGLX_TRUE DRI3_FALSE DRI3_TRUE XSHMFENCE_FALSE XSHMFENCE_TRUE XSHMFENCE_LIBS XSHMFENCE_CFLAGS BUSFAULT_FALSE BUSFAULT_TRUE DRI3PROTO_LIBS DRI3PROTO_CFLAGS DRI2_FALSE DRI2_TRUE DRI2PROTO_LIBS DRI2PROTO_CFLAGS DRI_FALSE DRI_TRUE CLIENTIDS_FALSE CLIENTIDS_TRUE RES_FALSE RES_TRUE SCREENSAVER_FALSE SCREENSAVER_TRUE RECORD_FALSE RECORD_TRUE MITSHM_FALSE MITSHM_TRUE COMPOSITE_FALSE COMPOSITE_TRUE XVMC_FALSE XVMC_TRUE XV_FALSE XV_TRUE CONFIG_WSCONS_FALSE CONFIG_WSCONS_TRUE NEED_DBUS_FALSE NEED_DBUS_TRUE SUID_WRAPPER_FALSE SUID_WRAPPER_TRUE SUID_WRAPPER_DIR LIBDRM_LIBS LIBDRM_CFLAGS SYSTEMD_LOGIND_FALSE SYSTEMD_LOGIND_TRUE CONFIG_HAL_FALSE CONFIG_HAL_TRUE HAL_LIBS HAL_CFLAGS 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 UDEV_CFLAGS HAVE_SYSTEMD_DAEMON_FALSE HAVE_SYSTEMD_DAEMON_TRUE SYSTEMD_DAEMON_LIBS SYSTEMD_DAEMON_CFLAGS SDK_REQUIRED_MODULES PIXMAN_LIBS PIXMAN_CFLAGS INSTALL_LIBXF86CONFIG_FALSE INSTALL_LIBXF86CONFIG_TRUE INT10_STUB_FALSE INT10_STUB_TRUE INT10_X86EMU_FALSE INT10_X86EMU_TRUE INT10_VM86_FALSE INT10_VM86_TRUE SECURE_RPC_FALSE SECURE_RPC_TRUE INSTALL_SETUID_FALSE INSTALL_SETUID_TRUE GLX_TLS XQUARTZ_SPARKLE BUNDLE_ID_PREFIX APPLE_APPLICATION_NAME APPLE_APPLICATIONS_DIR FONT100DPIDIR FONT75DPIDIR FONTTYPE1DIR FONTTTFDIR FONTOTFDIR FONTMISCDIR FONTROOTDIR SPARC64_VIDEO_FALSE SPARC64_VIDEO_TRUE PPC_VIDEO_FALSE PPC_VIDEO_TRUE I386_VIDEO_FALSE I386_VIDEO_TRUE ARM_VIDEO_FALSE ARM_VIDEO_TRUE ALPHA_VIDEO_FALSE ALPHA_VIDEO_TRUE GLX_ARCH_DEFINES BSD_KQUEUE_APM_FALSE BSD_KQUEUE_APM_TRUE BSD_APM_FALSE BSD_APM_TRUE FREEBSD_KLDLOAD_FALSE FREEBSD_KLDLOAD_TRUE FBDEVHW_FALSE FBDEVHW_TRUE AGP_FALSE AGP_TRUE LIBOBJS DLOPEN_LIBS SPECIAL_DTRACE_OBJECTS_FALSE SPECIAL_DTRACE_OBJECTS_TRUE XSERVER_DTRACE_FALSE XSERVER_DTRACE_TRUE DTRACE TRADITIONALCPPFLAGS RAWCPPFLAGS RAWCPP YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR NM ac_ct_DUMPBIN DUMPBIN LD FGREP LIBTOOL OBJDUMP DLLTOOL AS LN_S am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE CCASFLAGS CCAS HAVE_LD_WRAP_FALSE HAVE_LD_WRAP_TRUE ENABLE_UNIT_TESTS_FALSE ENABLE_UNIT_TESTS_TRUE XORG_MALLOC_DEBUG_ENV HAVE_XSLTPROC_FALSE HAVE_XSLTPROC_TRUE XSLTPROC HAVE_FOP_FALSE HAVE_FOP_TRUE FOP HAVE_XMLTO_FALSE HAVE_XMLTO_TRUE HAVE_XMLTO_TEXT_FALSE HAVE_XMLTO_TEXT_TRUE XMLTO ENABLE_DEVEL_DOCS_FALSE ENABLE_DEVEL_DOCS_TRUE ENABLE_DOCS_FALSE ENABLE_DOCS_TRUE HAVE_STYLESHEETS_FALSE HAVE_STYLESHEETS_TRUE XSL_STYLESHEET STYLESHEET_SRCDIR XORG_SGML_PATH HAVE_DOXYGEN_FALSE HAVE_DOXYGEN_TRUE HAVE_DOT_FALSE HAVE_DOT_TRUE HAVE_DOT DOT DOXYGEN MAN_SUBSTS XORG_MAN_PAGE ADMIN_MAN_DIR DRIVER_MAN_DIR MISC_MAN_DIR FILE_MAN_DIR LIB_MAN_DIR APP_MAN_DIR ADMIN_MAN_SUFFIX DRIVER_MAN_SUFFIX MISC_MAN_SUFFIX FILE_MAN_SUFFIX LIB_MAN_SUFFIX APP_MAN_SUFFIX SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build INSTALL_CMD PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CHANGELOG_CMD STRICT_CFLAGS CWARNFLAGS BASE_CFLAGS EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_selective_werror enable_strict_compilation with_doxygen enable_docs enable_devel_docs with_xmlto with_fop with_xsltproc enable_unit_tests enable_static enable_shared with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_largefile with_dtrace enable_werror enable_debug enable_use_sigio_by_default with_int10 with_vendor_name with_vendor_name_short with_vendor_web with_module_dir with_log_dir with_builder_addr with_os_name with_os_vendor with_builderstring enable_listen_tcp enable_listen_unix enable_listen_local with_fontrootdir with_fontmiscdir with_fontotfdir with_fontttfdir with_fonttype1dir with_font75dpidir with_font100dpidir with_default_font_path with_xkb_path with_xkb_output with_default_xkb_rules with_default_xkb_model with_default_xkb_layout with_default_xkb_variant with_default_xkb_options with_serverconfig_path with_apple_applications_dir with_apple_application_name with_launchd_id_prefix with_bundle_id_prefix enable_sparkle enable_install_libxf86config enable_visibility enable_aiglx enable_glx_tls with_khronos_spec_dir enable_composite enable_mitshm enable_xres enable_record enable_xv enable_xvmc enable_dga enable_screensaver enable_xdmcp enable_xdm_auth_1 enable_glx enable_dri enable_dri2 enable_dri3 enable_present enable_xinerama enable_xf86vidmode enable_xace enable_xselinux enable_xcsecurity enable_tslib enable_dbe enable_xf86bigfont enable_dpms enable_config_udev enable_config_udev_kms enable_config_hal enable_config_wscons enable_xfree86_utils enable_vgahw enable_vbe enable_int10_module enable_windowswm enable_libdrm enable_clientids enable_pciaccess enable_linux_acpi enable_linux_apm enable_systemd_logind enable_suid_wrapper enable_xorg enable_dmx enable_xvfb enable_xnest enable_xquartz enable_xwayland enable_standalone_xpbproxy enable_xwin enable_glamor enable_kdrive enable_xephyr enable_xfake enable_xfbdev enable_kdrive_kbd enable_kdrive_mouse enable_kdrive_evdev enable_libunwind enable_xshmfence enable_install_setuid enable_unix_transport enable_tcp_transport enable_ipv6 enable_local_transport enable_secure_rpc with_systemd_daemon with_shared_memory_dir enable_xtrans_send_fds with_xkb_bin_directory with_sha1 ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR DOXYGEN DOT XMLTO FOP XSLTPROC XORG_MALLOC_DEBUG_ENV CCAS CCASFLAGS YACC YFLAGS PIXMAN_CFLAGS PIXMAN_LIBS SYSTEMD_DAEMON_CFLAGS SYSTEMD_DAEMON_LIBS UDEV_CFLAGS UDEV_LIBS DBUS_CFLAGS DBUS_LIBS HAL_CFLAGS HAL_LIBS LIBDRM_CFLAGS LIBDRM_LIBS DRI2PROTO_CFLAGS DRI2PROTO_LIBS DRI3PROTO_CFLAGS DRI3PROTO_LIBS XSHMFENCE_CFLAGS XSHMFENCE_LIBS XLIB_CFLAGS XLIB_LIBS GL_CFLAGS GL_LIBS SELINUX_CFLAGS SELINUX_LIBS XDMCP_CFLAGS XDMCP_LIBS LIBSHA1_CFLAGS LIBSHA1_LIBS OPENSSL_CFLAGS OPENSSL_LIBS XSERVERCFLAGS_CFLAGS XSERVERCFLAGS_LIBS XSERVERLIBS_CFLAGS XSERVERLIBS_LIBS LIBUNWIND_CFLAGS LIBUNWIND_LIBS XNESTMODULES_CFLAGS XNESTMODULES_LIBS PCIACCESS_CFLAGS PCIACCESS_LIBS DGA_CFLAGS DGA_LIBS XF86VIDMODE_CFLAGS XF86VIDMODE_LIBS XORG_MODULES_CFLAGS XORG_MODULES_LIBS GLAMOR_CFLAGS GLAMOR_LIBS GBM_CFLAGS GBM_LIBS XWINMODULES_CFLAGS XWINMODULES_LIBS WINDOWSWM_CFLAGS WINDOWSWM_LIBS KHRONOS_OPENGL_REGISTRY_CFLAGS KHRONOS_OPENGL_REGISTRY_LIBS XPBPROXY_CFLAGS XPBPROXY_LIBS DMXMODULES_CFLAGS DMXMODULES_LIBS XDMXCONFIG_DEP_CFLAGS XDMXCONFIG_DEP_LIBS DMXEXAMPLES_DEP_CFLAGS DMXEXAMPLES_DEP_LIBS DMXXMUEXAMPLES_DEP_CFLAGS DMXXMUEXAMPLES_DEP_LIBS DMXXIEXAMPLES_DEP_CFLAGS DMXXIEXAMPLES_DEP_LIBS XTSTEXAMPLES_DEP_CFLAGS XTSTEXAMPLES_DEP_LIBS XRESEXAMPLES_DEP_CFLAGS XRESEXAMPLES_DEP_LIBS X11EXAMPLES_DEP_CFLAGS X11EXAMPLES_DEP_LIBS TSLIB_CFLAGS TSLIB_LIBS XEPHYR_CFLAGS XEPHYR_LIBS XWAYLANDMODULES_CFLAGS XWAYLANDMODULES_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # 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.17.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xorg-server] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xorg-server 1.17.1:";; esac cat <<\_ACEOF 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-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-selective-werror Turn off selective compiler errors. (default: enabled) --enable-strict-compilation Enable all warnings from compiler and make them errors (default: disabled) --enable-docs Enable building the documentation (default: yes) --enable-devel-docs Enable building the developer documentation (default: yes) --enable-unit-tests Enable building unit test cases (default: auto) --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --enable-werror Obsolete - use --enable-strict-compilation instead --enable-debug Enable debugging (default: disabled) --enable-use-sigio-by-default Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT) --enable-listen-tcp Listen on TCP by default (default:disabled) --disable-listen-unix Listen on Unix by default (default:enabled) --disable-listen-local Listen on local by default (default:enabled) --enable-sparkle Enable updating of X11.app using the Sparkle Framework (default: disabled) --enable-install-libxf86config Install libxf86config (default: disabled) --enable-visibility Enable symbol visibility (default: auto) --enable-aiglx Build accelerated indirect GLX (default: enabled) --enable-glx-tls Build GLX with TLS support (default: auto) --disable-composite Build Composite 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) --disable-xvmc Build XvMC extension (default: enabled) --disable-dga Build DGA extension (default: auto) --disable-screensaver Build ScreenSaver extension (default: enabled) --disable-xdmcp Build XDMCP extension (default: auto) --disable-xdm-auth-1 Build XDM-Auth-1 extension (default: auto) --disable-glx Build GLX extension (default: enabled) --enable-dri Build DRI extension (default: auto) --enable-dri2 Build DRI2 extension (default: auto) --enable-dri3 Build DRI3 extension (default: auto) --disable-present Build Present extension (default: enabled) --disable-xinerama Build Xinerama extension (default: enabled) --disable-xf86vidmode Build XF86VidMode extension (default: auto) --disable-xace Build X-ACE extension (default: enabled) --enable-xselinux Build SELinux extension (default: disabled) --enable-xcsecurity Build Security extension (default: disabled) --enable-tslib Build kdrive tslib touchscreen support (default: disabled) --disable-dbe Build DBE extension (default: enabled) --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) --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-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) --enable-windowswm Build XWin with WindowsWM extension (default: no) --enable-libdrm Build Xorg with libdrm support (default: enabled) --disable-clientids Build Xorg with client ID tracking (default: enabled) --enable-pciaccess Build Xorg with pciaccess library (default: enabled) --disable-linux-acpi Disable building ACPI support on Linux (if available). --disable-linux-apm Disable building APM support on Linux (if available). --enable-systemd-logind Build systemd-logind support (default: auto) --enable-suid-wrapper Build suid-root wrapper for legacy driver support on rootless xserver systems (default: no) --enable-xorg Build Xorg server (default: auto) --enable-dmx Build DMX server (default: no) --enable-xvfb Build Xvfb server (default: yes) --enable-xnest Build Xnest server (default: auto) --enable-xquartz Build Xquartz server for OS-X (default: auto) --enable-xwayland Build Xwayland server (default: auto) --enable-standalone-xpbproxy Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no) --enable-xwin Build XWin server (default: auto) --enable-glamor Build glamor dix module (default: no) --enable-kdrive Build kdrive servers (default: no) --enable-xephyr Build the kdrive Xephyr server (default: auto) --enable-xfake Build the kdrive 'fake' server (default: auto) --enable-xfbdev Build the kdrive framebuffer device server (default: auto) --enable-kdrive-kbd Build kbd driver for kdrive (default: auto) --enable-kdrive-mouse Build mouse driver for kdrive (default: auto) --enable-kdrive-evdev Build evdev driver for kdrive (default: auto) --enable-libunwind Use libunwind for backtracing (default: auto) --disable-xshmfence Disable xshmfence (default: auto) --enable-install-setuid Install Xorg server as owned by root with setuid bit (default: auto) --enable-unix-transport Enable UNIX domain socket transport --enable-tcp-transport Enable TCP socket transport --enable-ipv6 Enable IPv6 support --enable-local-transport Enable os-specific local transport --enable-secure-rpc Enable Secure RPC --disable-xtrans-send-fds Use Xtrans support for fd passing (default: auto) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-doxygen Use doxygen to regenerate documentation (default: auto) --with-xmlto Use xmlto to regenerate documentation (default: auto) --with-fop Use fop to regenerate documentation (default: auto) --with-xsltproc Use xsltproc for the transformation of XML documents (default: auto) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-dtrace=PATH Enable dtrace probes (default: enabled if dtrace found) --with-int10=BACKEND int10 backend: vm86, x86emu or stub --with-vendor-name=VENDOR Vendor string reported by the server --with-vendor-name-short=VENDOR Short version of vendor string reported by the server --with-vendor-web=URL Vendor web address reported by the server --with-module-dir=DIR Directory where modules are installed (default: $libdir/xorg/modules) --with-log-dir=DIR Directory where log files are kept (default: $localstatedir/log) --with-builder-addr=ADDRESS Builder address (default: xorg@lists.freedesktop.org) --with-os-name=OSNAME Name of OS (default: output of "uname -srm") --with-os-vendor=OSVENDOR Name of OS vendor --with-builderstring=BUILDERSTRING Additional builder string --with-fontrootdir=DIR Path to root directory for font files --with-fontmiscdir=DIR Path to misc files [FONTROOTDIR/misc] --with-fontotfdir=DIR Path to OTF files [FONTROOTDIR/OTF] --with-fontttfdir=DIR Path to TTF files [FONTROOTDIR/TTF] --with-fonttype1dir=DIR Path to Type1 files [FONTROOTDIR/Type1] --with-font75dpidir=DIR Path to 75dpi files [FONTROOTDIR/75dpi] --with-font100dpidir=DIR Path to 100dpi files [FONTROOTDIR/100dpi] --with-default-font-path=PATH Comma separated list of font dirs --with-xkb-path=PATH Path to XKB base dir (default: ${datadir}/X11/xkb) --with-xkb-output=PATH Path to XKB output dir (default: ${datadir}/X11/xkb/compiled) --with-default-xkb-rules=RULES Keyboard ruleset (default: base/evdev) --with-default-xkb-model=MODEL Keyboard model (default: pc105) --with-default-xkb-layout=LAYOUT Keyboard layout (default: us) --with-default-xkb-variant=VARIANT Keyboard variant (default: (none)) --with-default-xkb-options=OPTIONS Keyboard layout options (default: (none)) --with-serverconfig-path=PATH Directory where ancillary server config files are installed (default: ${libdir}/xorg) --with-apple-applications-dir=PATH Path to the Applications directory (default: /Applications/Utilities) --with-apple-application-name=NAME Name for the .app (default: X11) --with-launchd-id-prefix=PATH Deprecated: Use --with-bundle-id-prefix. --with-bundle-id-prefix=PATH Prefix to use for bundle identifiers (default: org.x) --with-khronos-spec-dir=PATH Path to Khronos OpenGL registry database files (default: auto) --with-systemd-daemon support systemd socket activation (default: auto) --with-shared-memory-dir=PATH Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto) --with-xkb-bin-directory=DIR Directory containing xkbcomp program (default: ${bindir}) --with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI choose SHA1 implementation Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path DOXYGEN Path to doxygen command DOT Path to the dot graphics utility XMLTO Path to xmlto command FOP Path to fop command XSLTPROC Path to xsltproc command XORG_MALLOC_DEBUG_ENV Environment variables to enable memory checking in tests CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. PIXMAN_CFLAGS C compiler flags for PIXMAN, overriding pkg-config PIXMAN_LIBS linker flags for PIXMAN, overriding pkg-config SYSTEMD_DAEMON_CFLAGS C compiler flags for SYSTEMD_DAEMON, overriding pkg-config SYSTEMD_DAEMON_LIBS linker flags for SYSTEMD_DAEMON, overriding pkg-config UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config UDEV_LIBS linker flags for UDEV, overriding pkg-config DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config HAL_CFLAGS C compiler flags for HAL, overriding pkg-config HAL_LIBS linker flags for HAL, overriding pkg-config LIBDRM_CFLAGS C compiler flags for LIBDRM, overriding pkg-config LIBDRM_LIBS linker flags for LIBDRM, overriding pkg-config DRI2PROTO_CFLAGS C compiler flags for DRI2PROTO, overriding pkg-config DRI2PROTO_LIBS linker flags for DRI2PROTO, overriding pkg-config DRI3PROTO_CFLAGS C compiler flags for DRI3PROTO, overriding pkg-config DRI3PROTO_LIBS linker flags for DRI3PROTO, overriding pkg-config XSHMFENCE_CFLAGS C compiler flags for XSHMFENCE, overriding pkg-config XSHMFENCE_LIBS linker flags for XSHMFENCE, overriding pkg-config XLIB_CFLAGS C compiler flags for XLIB, overriding pkg-config 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 SELINUX_CFLAGS C compiler flags for SELINUX, overriding pkg-config SELINUX_LIBS linker flags for SELINUX, overriding pkg-config XDMCP_CFLAGS C compiler flags for XDMCP, overriding pkg-config XDMCP_LIBS linker flags for XDMCP, overriding pkg-config LIBSHA1_CFLAGS C compiler flags for LIBSHA1, overriding pkg-config LIBSHA1_LIBS linker flags for LIBSHA1, overriding pkg-config OPENSSL_CFLAGS C compiler flags for OPENSSL, overriding pkg-config OPENSSL_LIBS linker flags for OPENSSL, overriding pkg-config XSERVERCFLAGS_CFLAGS C compiler flags for XSERVERCFLAGS, overriding pkg-config XSERVERCFLAGS_LIBS linker flags for XSERVERCFLAGS, overriding pkg-config XSERVERLIBS_CFLAGS C compiler flags for XSERVERLIBS, overriding pkg-config XSERVERLIBS_LIBS linker flags for XSERVERLIBS, overriding pkg-config LIBUNWIND_CFLAGS C compiler flags for LIBUNWIND, overriding pkg-config LIBUNWIND_LIBS linker flags for LIBUNWIND, overriding pkg-config XNESTMODULES_CFLAGS C compiler flags for XNESTMODULES, overriding pkg-config XNESTMODULES_LIBS linker flags for XNESTMODULES, overriding pkg-config PCIACCESS_CFLAGS C compiler flags for PCIACCESS, overriding pkg-config PCIACCESS_LIBS linker flags for PCIACCESS, overriding pkg-config DGA_CFLAGS C compiler flags for DGA, overriding pkg-config DGA_LIBS linker flags for DGA, overriding pkg-config XF86VIDMODE_CFLAGS C compiler flags for XF86VIDMODE, overriding pkg-config XF86VIDMODE_LIBS linker flags for XF86VIDMODE, overriding pkg-config XORG_MODULES_CFLAGS C compiler flags for XORG_MODULES, overriding pkg-config XORG_MODULES_LIBS linker flags for XORG_MODULES, overriding pkg-config GLAMOR_CFLAGS C compiler flags for GLAMOR, overriding pkg-config GLAMOR_LIBS linker flags for GLAMOR, overriding pkg-config GBM_CFLAGS C compiler flags for GBM, overriding pkg-config GBM_LIBS linker flags for GBM, overriding pkg-config XWINMODULES_CFLAGS C compiler flags for XWINMODULES, overriding pkg-config XWINMODULES_LIBS linker flags for XWINMODULES, overriding pkg-config WINDOWSWM_CFLAGS C compiler flags for WINDOWSWM, overriding pkg-config WINDOWSWM_LIBS linker flags for WINDOWSWM, overriding pkg-config KHRONOS_OPENGL_REGISTRY_CFLAGS C compiler flags for KHRONOS_OPENGL_REGISTRY, overriding pkg-config KHRONOS_OPENGL_REGISTRY_LIBS linker flags for KHRONOS_OPENGL_REGISTRY, overriding pkg-config XPBPROXY_CFLAGS C compiler flags for XPBPROXY, overriding pkg-config XPBPROXY_LIBS linker flags for XPBPROXY, overriding pkg-config DMXMODULES_CFLAGS C compiler flags for DMXMODULES, overriding pkg-config DMXMODULES_LIBS linker flags for DMXMODULES, overriding pkg-config XDMXCONFIG_DEP_CFLAGS C compiler flags for XDMXCONFIG_DEP, overriding pkg-config XDMXCONFIG_DEP_LIBS linker flags for XDMXCONFIG_DEP, overriding pkg-config DMXEXAMPLES_DEP_CFLAGS C compiler flags for DMXEXAMPLES_DEP, overriding pkg-config DMXEXAMPLES_DEP_LIBS linker flags for DMXEXAMPLES_DEP, overriding pkg-config DMXXMUEXAMPLES_DEP_CFLAGS C compiler flags for DMXXMUEXAMPLES_DEP, overriding pkg-config DMXXMUEXAMPLES_DEP_LIBS linker flags for DMXXMUEXAMPLES_DEP, overriding pkg-config DMXXIEXAMPLES_DEP_CFLAGS C compiler flags for DMXXIEXAMPLES_DEP, overriding pkg-config DMXXIEXAMPLES_DEP_LIBS linker flags for DMXXIEXAMPLES_DEP, overriding pkg-config XTSTEXAMPLES_DEP_CFLAGS C compiler flags for XTSTEXAMPLES_DEP, overriding pkg-config XTSTEXAMPLES_DEP_LIBS linker flags for XTSTEXAMPLES_DEP, overriding pkg-config XRESEXAMPLES_DEP_CFLAGS C compiler flags for XRESEXAMPLES_DEP, overriding pkg-config XRESEXAMPLES_DEP_LIBS linker flags for XRESEXAMPLES_DEP, overriding pkg-config X11EXAMPLES_DEP_CFLAGS C compiler flags for X11EXAMPLES_DEP, overriding pkg-config X11EXAMPLES_DEP_LIBS linker flags for X11EXAMPLES_DEP, overriding pkg-config TSLIB_CFLAGS C compiler flags for TSLIB, overriding pkg-config TSLIB_LIBS linker flags for TSLIB, overriding pkg-config XEPHYR_CFLAGS C compiler flags for XEPHYR, overriding pkg-config XEPHYR_LIBS linker flags for XEPHYR, overriding pkg-config XWAYLANDMODULES_CFLAGS C compiler flags for XWAYLANDMODULES, overriding pkg-config XWAYLANDMODULES_LIBS linker flags for XWAYLANDMODULES, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF xorg-server configure 1.17.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------------------------- ## ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## ## ---------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case <limits.h> declares $2. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $2 /* 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 $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 <conftest.val; ac_retval=0 else ac_retval=1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext rm -f conftest.val fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member 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.17.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu RELEASE_DATE="2015-02-10" RELEASE_NAME="lambic" am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='xorg-server' VERSION='1.17.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: <http://www.gnu.org/software/coreutils/>. If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdbool.h> #include <stdlib.h> #include <wchar.h> #include <stdio.h> // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi ac_fn_c_check_decl "$LINENO" "__clang__" "ac_cv_have_decl___clang__" "$ac_includes_default" if test "x$ac_cv_have_decl___clang__" = xyes; then : CLANGCC="yes" else CLANGCC="no" fi ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default" if test "x$ac_cv_have_decl___INTEL_COMPILER" = xyes; then : INTELCC="yes" else INTELCC="no" fi ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default" if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then : SUNCC="yes" else SUNCC="no" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed # Check whether --enable-selective-werror was given. if test "${enable_selective_werror+set}" = set; then : enableval=$enable_selective_werror; SELECTIVE_WERROR=$enableval else SELECTIVE_WERROR=yes fi # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then BASE_CFLAGS="-v" else BASE_CFLAGS="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wall" >&5 $as_echo_n "checking if $CC supports -Wall... " >&6; } cacheid=xorg_cv_cc_flag__Wall if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wall" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-arith" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-arith" >&5 $as_echo_n "checking if $CC supports -Wpointer-arith... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_arith if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-arith" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-declarations" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-declarations" >&5 $as_echo_n "checking if $CC supports -Wmissing-declarations... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_declarations if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-declarations" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat=2" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat=2" >&5 $as_echo_n "checking if $CC supports -Wformat=2... " >&6; } cacheid=xorg_cv_cc_flag__Wformat_2 if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat=2" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat" >&5 $as_echo_n "checking if $CC supports -Wformat... " >&6; } cacheid=xorg_cv_cc_flag__Wformat if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wstrict-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wstrict-prototypes" >&5 $as_echo_n "checking if $CC supports -Wstrict-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wstrict_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wstrict-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-prototypes" >&5 $as_echo_n "checking if $CC supports -Wmissing-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnested-externs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnested-externs" >&5 $as_echo_n "checking if $CC supports -Wnested-externs... " >&6; } cacheid=xorg_cv_cc_flag__Wnested_externs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnested-externs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wbad-function-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wbad-function-cast" >&5 $as_echo_n "checking if $CC supports -Wbad-function-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wbad_function_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wbad-function-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wold-style-definition" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wold-style-definition" >&5 $as_echo_n "checking if $CC supports -Wold-style-definition... " >&6; } cacheid=xorg_cv_cc_flag__Wold_style_definition if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wold-style-definition" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -fd" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -fd" >&5 $as_echo_n "checking if $CC supports -fd... " >&6; } cacheid=xorg_cv_cc_flag__fd if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -fd" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wdeclaration-after-statement" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wdeclaration-after-statement" >&5 $as_echo_n "checking if $CC supports -Wdeclaration-after-statement... " >&6; } cacheid=xorg_cv_cc_flag__Wdeclaration_after_statement if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wdeclaration-after-statement" found="yes" fi fi # This chunk adds additional warnings that could catch undesired effects. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wunused" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wunused" >&5 $as_echo_n "checking if $CC supports -Wunused... " >&6; } cacheid=xorg_cv_cc_flag__Wunused if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wunused" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wuninitialized" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wuninitialized" >&5 $as_echo_n "checking if $CC supports -Wuninitialized... " >&6; } cacheid=xorg_cv_cc_flag__Wuninitialized if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wuninitialized" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wshadow" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wshadow" >&5 $as_echo_n "checking if $CC supports -Wshadow... " >&6; } cacheid=xorg_cv_cc_flag__Wshadow if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wshadow" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-noreturn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-noreturn" >&5 $as_echo_n "checking if $CC supports -Wmissing-noreturn... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_noreturn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-noreturn" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-format-attribute" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-format-attribute" >&5 $as_echo_n "checking if $CC supports -Wmissing-format-attribute... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_format_attribute if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-format-attribute" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wredundant-decls" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5 $as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; } cacheid=xorg_cv_cc_flag__Wredundant_decls if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wlogical-op" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wlogical-op" >&5 $as_echo_n "checking if $CC supports -Wlogical-op... " >&6; } cacheid=xorg_cv_cc_flag__Wlogical_op if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wlogical-op" found="yes" fi fi # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=implicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=implicit" >&5 $as_echo_n "checking if $CC supports -Werror=implicit... " >&6; } cacheid=xorg_cv_cc_flag__Werror_implicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=implicit" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5 $as_echo_n "checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_NO_EXPLICIT_TYPE_GIVEN__errwarn_E_NO_IMPLICIT_DECL_ALLOWED if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=nonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=nonnull" >&5 $as_echo_n "checking if $CC supports -Werror=nonnull... " >&6; } cacheid=xorg_cv_cc_flag__Werror_nonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=nonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=init-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=init-self" >&5 $as_echo_n "checking if $CC supports -Werror=init-self... " >&6; } cacheid=xorg_cv_cc_flag__Werror_init_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=init-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=main" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=main" >&5 $as_echo_n "checking if $CC supports -Werror=main... " >&6; } cacheid=xorg_cv_cc_flag__Werror_main if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=main" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=missing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=missing-braces" >&5 $as_echo_n "checking if $CC supports -Werror=missing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Werror_missing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=missing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=sequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=sequence-point" >&5 $as_echo_n "checking if $CC supports -Werror=sequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Werror_sequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=sequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=return-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=return-type" >&5 $as_echo_n "checking if $CC supports -Werror=return-type... " >&6; } cacheid=xorg_cv_cc_flag__Werror_return_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=return-type" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5 $as_echo_n "checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_FUNC_HAS_NO_RETURN_STMT if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=trigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=trigraphs" >&5 $as_echo_n "checking if $CC supports -Werror=trigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Werror_trigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=trigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=array-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=array-bounds" >&5 $as_echo_n "checking if $CC supports -Werror=array-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Werror_array_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=array-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=write-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=write-strings" >&5 $as_echo_n "checking if $CC supports -Werror=write-strings... " >&6; } cacheid=xorg_cv_cc_flag__Werror_write_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=write-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=address" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=address" >&5 $as_echo_n "checking if $CC supports -Werror=address... " >&6; } cacheid=xorg_cv_cc_flag__Werror_address if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=address" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=int-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=int-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports -Werror=int-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_int_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=int-to-pointer-cast" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION" >&5 $as_echo_n "checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_BAD_PTR_INT_COMBINATION if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=pointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=pointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports -Werror=pointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_pointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=pointer-to-int-cast" found="yes" fi fi # Also -errwarn=E_BAD_PTR_INT_COMBINATION else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&5 $as_echo "$as_me: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&2;} xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wimplicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wimplicit" >&5 $as_echo_n "checking if $CC supports -Wimplicit... " >&6; } cacheid=xorg_cv_cc_flag__Wimplicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wimplicit" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnonnull" >&5 $as_echo_n "checking if $CC supports -Wnonnull... " >&6; } cacheid=xorg_cv_cc_flag__Wnonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Winit-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Winit-self" >&5 $as_echo_n "checking if $CC supports -Winit-self... " >&6; } cacheid=xorg_cv_cc_flag__Winit_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Winit-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmain" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmain" >&5 $as_echo_n "checking if $CC supports -Wmain... " >&6; } cacheid=xorg_cv_cc_flag__Wmain if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmain" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-braces" >&5 $as_echo_n "checking if $CC supports -Wmissing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wsequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wsequence-point" >&5 $as_echo_n "checking if $CC supports -Wsequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Wsequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wsequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wreturn-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wreturn-type" >&5 $as_echo_n "checking if $CC supports -Wreturn-type... " >&6; } cacheid=xorg_cv_cc_flag__Wreturn_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wreturn-type" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wtrigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wtrigraphs" >&5 $as_echo_n "checking if $CC supports -Wtrigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Wtrigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wtrigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Warray-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Warray-bounds" >&5 $as_echo_n "checking if $CC supports -Warray-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Warray_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Warray-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wwrite-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wwrite-strings" >&5 $as_echo_n "checking if $CC supports -Wwrite-strings... " >&6; } cacheid=xorg_cv_cc_flag__Wwrite_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wwrite-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Waddress" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Waddress" >&5 $as_echo_n "checking if $CC supports -Waddress... " >&6; } cacheid=xorg_cv_cc_flag__Waddress if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Waddress" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wint-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wint-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports -Wint-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wint_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wint-to-pointer-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports -Wpointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-to-int-cast" found="yes" fi fi fi CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi # Check whether --enable-strict-compilation was given. if test "${enable_strict_compilation+set}" = set; then : enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval else STRICT_COMPILE=no fi STRICT_CFLAGS="" xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -pedantic" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -pedantic" >&5 $as_echo_n "checking if $CC supports -pedantic... " >&6; } cacheid=xorg_cv_cc_flag__pedantic if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -pedantic" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror" >&5 $as_echo_n "checking if $CC supports -Werror... " >&6; } cacheid=xorg_cv_cc_flag__Werror if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn" >&5 $as_echo_n "checking if $CC supports -errwarn... " >&6; } cacheid=xorg_cv_cc_flag__errwarn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -errwarn" found="yes" fi fi # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=attributes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=attributes" >&5 $as_echo_n "checking if $CC supports -Werror=attributes... " >&6; } cacheid=xorg_cv_cc_flag__Werror_attributes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes" found="yes" fi fi if test "x$STRICT_COMPILE" = "xyes"; then BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS" CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PVM _ACEOF PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_PATCHLEVEL $PVP _ACEOF CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi XORG_MAN_PAGE="X Version 11" MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' # Check whether --with-doxygen was given. if test "${with_doxygen+set}" = set; then : withval=$with_doxygen; use_doxygen=$withval else use_doxygen=auto fi if test "x$use_doxygen" = x"auto"; then # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$DOXYGEN" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - documentation targets will be skipped" >&5 $as_echo "$as_me: WARNING: doxygen not found - documentation targets will be skipped" >&2;} have_doxygen=no else have_doxygen=yes fi elif test "x$use_doxygen" = x"yes" ; then # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$DOXYGEN" = "x"; then as_fn_error $? "--with-doxygen=yes specified but doxygen not found in PATH" "$LINENO" 5 fi have_doxygen=yes elif test "x$use_doxygen" = x"no" ; then if test "x$DOXYGEN" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ignoring DOXYGEN environment variable since --with-doxygen=no was specified" >&5 $as_echo "$as_me: WARNING: ignoring DOXYGEN environment variable since --with-doxygen=no was specified" >&2;} fi have_doxygen=no else as_fn_error $? "--with-doxygen expects 'yes' or 'no'" "$LINENO" 5 fi if test "$have_doxygen" = yes; then # scrape the doxygen version { $as_echo "$as_me:${as_lineno-$LINENO}: checking the doxygen version" >&5 $as_echo_n "checking the doxygen version... " >&6; } doxygen_version=`$DOXYGEN --version 2>/dev/null` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doxygen_version" >&5 $as_echo "$doxygen_version" >&6; } as_arg_v1=$doxygen_version as_arg_v2=1.6.1 awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null case $? in #( 1) : if test "x$use_doxygen" = xauto; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen version $doxygen_version found, but 1.6.1 needed" >&5 $as_echo "$as_me: WARNING: doxygen version $doxygen_version found, but 1.6.1 needed" >&2;} have_doxygen=no else as_fn_error $? "doxygen version $doxygen_version found, but 1.6.1 needed" "$LINENO" 5 fi ;; #( 0) : ;; #( 2) : ;; #( *) : ;; esac fi HAVE_DOT=no if test "x$have_doxygen" = "xyes"; then # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DOT+:} false; then : $as_echo_n "(cached) " >&6 else case $DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DOT="$DOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOT=$ac_cv_path_DOT if test -n "$DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 $as_echo "$DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$DOT" != "x"; then HAVE_DOT=yes fi fi if test "$HAVE_DOT" = "yes"; then HAVE_DOT_TRUE= HAVE_DOT_FALSE='#' else HAVE_DOT_TRUE='#' HAVE_DOT_FALSE= fi if test "$have_doxygen" = yes; then HAVE_DOXYGEN_TRUE= HAVE_DOXYGEN_FALSE='#' else HAVE_DOXYGEN_TRUE='#' HAVE_DOXYGEN_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X.Org SGML entities >= 1.8" >&5 $as_echo_n "checking for X.Org SGML entities >= 1.8... " >&6; } XORG_SGML_PATH= if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-sgml-doctools >= 1.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "xorg-sgml-doctools >= 1.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools` else : fi # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing # the path and the name of the doc stylesheet if test "x$XORG_SGML_PATH" != "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XORG_SGML_PATH" >&5 $as_echo "$XORG_SGML_PATH" >&6; } STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XSL_STYLESHEET" != "x"; then HAVE_STYLESHEETS_TRUE= HAVE_STYLESHEETS_FALSE='#' else HAVE_STYLESHEETS_TRUE='#' HAVE_STYLESHEETS_FALSE= fi # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then : enableval=$enable_docs; build_docs=$enableval else build_docs=yes fi if test x$build_docs = xyes; then ENABLE_DOCS_TRUE= ENABLE_DOCS_FALSE='#' else ENABLE_DOCS_TRUE='#' ENABLE_DOCS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5 $as_echo_n "checking whether to build documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_docs" >&5 $as_echo "$build_docs" >&6; } # Check whether --enable-devel-docs was given. if test "${enable_devel_docs+set}" = set; then : enableval=$enable_devel_docs; build_devel_docs=$enableval else build_devel_docs=yes fi if test x$build_devel_docs = xyes; then ENABLE_DEVEL_DOCS_TRUE= ENABLE_DEVEL_DOCS_FALSE='#' else ENABLE_DEVEL_DOCS_TRUE='#' ENABLE_DEVEL_DOCS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build developer documentation" >&5 $as_echo_n "checking whether to build developer documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_devel_docs" >&5 $as_echo "$build_devel_docs" >&6; } # Check whether --with-xmlto was given. if test "${with_xmlto+set}" = set; then : withval=$with_xmlto; use_xmlto=$withval else use_xmlto=auto fi if test "x$use_xmlto" = x"auto"; then # Extract the first word of "xmlto", so it can be a program name with args. set dummy xmlto; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XMLTO+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLTO in [\\/]* | ?:[\\/]*) ac_cv_path_XMLTO="$XMLTO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XMLTO=$ac_cv_path_XMLTO if test -n "$XMLTO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLTO" >&5 $as_echo "$XMLTO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XMLTO" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xmlto not found - documentation targets will be skipped" >&5 $as_echo "$as_me: WARNING: xmlto not found - documentation targets will be skipped" >&2;} have_xmlto=no else have_xmlto=yes fi elif test "x$use_xmlto" = x"yes" ; then # Extract the first word of "xmlto", so it can be a program name with args. set dummy xmlto; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XMLTO+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLTO in [\\/]* | ?:[\\/]*) ac_cv_path_XMLTO="$XMLTO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XMLTO=$ac_cv_path_XMLTO if test -n "$XMLTO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLTO" >&5 $as_echo "$XMLTO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XMLTO" = "x"; then as_fn_error $? "--with-xmlto=yes specified but xmlto not found in PATH" "$LINENO" 5 fi have_xmlto=yes elif test "x$use_xmlto" = x"no" ; then if test "x$XMLTO" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ignoring XMLTO environment variable since --with-xmlto=no was specified" >&5 $as_echo "$as_me: WARNING: ignoring XMLTO environment variable since --with-xmlto=no was specified" >&2;} fi have_xmlto=no else as_fn_error $? "--with-xmlto expects 'yes' or 'no'" "$LINENO" 5 fi # Test for a minimum version of xmlto, if provided. if test "$have_xmlto" = yes; then # scrape the xmlto version { $as_echo "$as_me:${as_lineno-$LINENO}: checking the xmlto version" >&5 $as_echo_n "checking the xmlto version... " >&6; } xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xmlto_version" >&5 $as_echo "$xmlto_version" >&6; } as_arg_v1=$xmlto_version as_arg_v2=0.0.20 awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null case $? in #( 1) : if test "x$use_xmlto" = xauto; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xmlto version $xmlto_version found, but 0.0.20 needed" >&5 $as_echo "$as_me: WARNING: xmlto version $xmlto_version found, but 0.0.20 needed" >&2;} have_xmlto=no else as_fn_error $? "xmlto version $xmlto_version found, but 0.0.20 needed" "$LINENO" 5 fi ;; #( 0) : ;; #( 2) : ;; #( *) : ;; esac fi # Test for the ability of xmlto to generate a text target have_xmlto_text=no cat > conftest.xml << "EOF" EOF if test "$have_xmlto" = yes; then : if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; then : have_xmlto_text=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xmlto cannot generate text format, this format skipped" >&5 $as_echo "$as_me: WARNING: xmlto cannot generate text format, this format skipped" >&2;} fi fi rm -f conftest.xml if test $have_xmlto_text = yes; then HAVE_XMLTO_TEXT_TRUE= HAVE_XMLTO_TEXT_FALSE='#' else HAVE_XMLTO_TEXT_TRUE='#' HAVE_XMLTO_TEXT_FALSE= fi if test "$have_xmlto" = yes; then HAVE_XMLTO_TRUE= HAVE_XMLTO_FALSE='#' else HAVE_XMLTO_TRUE='#' HAVE_XMLTO_FALSE= fi # Check whether --with-fop was given. if test "${with_fop+set}" = set; then : withval=$with_fop; use_fop=$withval else use_fop=auto fi if test "x$use_fop" = x"auto"; then # Extract the first word of "fop", so it can be a program name with args. set dummy fop; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FOP+:} false; then : $as_echo_n "(cached) " >&6 else case $FOP in [\\/]* | ?:[\\/]*) ac_cv_path_FOP="$FOP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi FOP=$ac_cv_path_FOP if test -n "$FOP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5 $as_echo "$FOP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$FOP" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fop not found - documentation targets will be skipped" >&5 $as_echo "$as_me: WARNING: fop not found - documentation targets will be skipped" >&2;} have_fop=no else have_fop=yes fi elif test "x$use_fop" = x"yes" ; then # Extract the first word of "fop", so it can be a program name with args. set dummy fop; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FOP+:} false; then : $as_echo_n "(cached) " >&6 else case $FOP in [\\/]* | ?:[\\/]*) ac_cv_path_FOP="$FOP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi FOP=$ac_cv_path_FOP if test -n "$FOP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5 $as_echo "$FOP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$FOP" = "x"; then as_fn_error $? "--with-fop=yes specified but fop not found in PATH" "$LINENO" 5 fi have_fop=yes elif test "x$use_fop" = x"no" ; then if test "x$FOP" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ignoring FOP environment variable since --with-fop=no was specified" >&5 $as_echo "$as_me: WARNING: ignoring FOP environment variable since --with-fop=no was specified" >&2;} fi have_fop=no else as_fn_error $? "--with-fop expects 'yes' or 'no'" "$LINENO" 5 fi # Test for a minimum version of fop, if provided. if test "$have_fop" = yes; then HAVE_FOP_TRUE= HAVE_FOP_FALSE='#' else HAVE_FOP_TRUE='#' HAVE_FOP_FALSE= fi # Preserves the interface, should it be implemented later # Check whether --with-xsltproc was given. if test "${with_xsltproc+set}" = set; then : withval=$with_xsltproc; use_xsltproc=$withval else use_xsltproc=auto fi if test "x$use_xsltproc" = x"auto"; then # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XSLTPROC" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xsltproc not found - cannot transform XML documents" >&5 $as_echo "$as_me: WARNING: xsltproc not found - cannot transform XML documents" >&2;} have_xsltproc=no else have_xsltproc=yes fi elif test "x$use_xsltproc" = x"yes" ; then # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$XSLTPROC" = "x"; then as_fn_error $? "--with-xsltproc=yes specified but xsltproc not found in PATH" "$LINENO" 5 fi have_xsltproc=yes elif test "x$use_xsltproc" = x"no" ; then if test "x$XSLTPROC" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ignoring XSLTPROC environment variable since --with-xsltproc=no was specified" >&5 $as_echo "$as_me: WARNING: ignoring XSLTPROC environment variable since --with-xsltproc=no was specified" >&2;} fi have_xsltproc=no else as_fn_error $? "--with-xsltproc expects 'yes' or 'no'" "$LINENO" 5 fi if test "$have_xsltproc" = yes; then HAVE_XSLTPROC_TRUE= HAVE_XSLTPROC_FALSE='#' else HAVE_XSLTPROC_TRUE='#' HAVE_XSLTPROC_FALSE= fi # Check for different types of support on different platforms case $host_os in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for umem_alloc in -lumem" >&5 $as_echo_n "checking for umem_alloc in -lumem... " >&6; } if ${ac_cv_lib_umem_umem_alloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lumem $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 umem_alloc (); int main () { return umem_alloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_umem_umem_alloc=yes else ac_cv_lib_umem_umem_alloc=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_umem_umem_alloc" >&5 $as_echo "$ac_cv_lib_umem_umem_alloc" >&6; } if test "x$ac_cv_lib_umem_umem_alloc" = xyes; then : malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default' fi ;; *-gnu*) # GNU libc - Value is used as a single byte bit pattern, # both directly and inverted, so should not be 0 or 255. malloc_debug_env='MALLOC_PERTURB_=15' ;; darwin*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' ;; *bsd*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1' ;; esac # User supplied flags override default flags if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" fi XORG_MALLOC_DEBUG_ENV=$malloc_debug_env # Check whether --enable-unit-tests was given. if test "${enable_unit_tests+set}" = set; then : enableval=$enable_unit_tests; enable_unit_tests=$enableval else enable_unit_tests=auto fi if test "x$enable_unit_tests" != xno; then ENABLE_UNIT_TESTS_TRUE= ENABLE_UNIT_TESTS_FALSE='#' else ENABLE_UNIT_TESTS_TRUE='#' ENABLE_UNIT_TESTS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build unit test cases" >&5 $as_echo_n "checking whether to build unit test cases... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_unit_tests" >&5 $as_echo "$enable_unit_tests" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-wrap,exit" >&5 $as_echo_n "checking whether the linker accepts -Wl,-wrap,exit... " >&6; } if ${xorg_cv_linker_flags__Wl__wrap_exit+:} false; then : $as_echo_n "(cached) " >&6 else ax_save_FLAGS=$LDFLAGS LDFLAGS="-Wl,-wrap,exit" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> void __wrap_exit(int status) { return; } int main () { exit(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : xorg_cv_linker_flags__Wl__wrap_exit=yes else xorg_cv_linker_flags__Wl__wrap_exit=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__wrap_exit { $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 have_ld_wrap=yes else have_ld_wrap=no fi # Not having ld wrap when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes" -a "xoptional" != "xoptional"; then if test "x$have_ld_wrap" = x"no"; then as_fn_error $? "--enable-unit-tests=yes specified but ld -wrap support is not available" "$LINENO" 5 fi fi if test "$have_ld_wrap" = yes; then HAVE_LD_WRAP_TRUE= HAVE_LD_WRAP_FALSE='#' else HAVE_LD_WRAP_TRUE='#' HAVE_LD_WRAP_FALSE= fi # ac_config_headers="$ac_config_headers include/do-not-use-config.h" ac_config_headers="$ac_config_headers include/xorg-server.h" ac_config_headers="$ac_config_headers include/dix-config.h" ac_config_headers="$ac_config_headers include/xorg-config.h" ac_config_headers="$ac_config_headers include/xkb-config.h" ac_config_headers="$ac_config_headers include/xwin-config.h" ac_config_headers="$ac_config_headers include/kdrive-config.h" ac_config_headers="$ac_config_headers include/version-config.h" # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CCAS_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CCAS_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CCAS_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 $as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then am__fastdepCCAS_TRUE= am__fastdepCCAS_FALSE='#' else am__fastdepCCAS_TRUE='#' am__fastdepCCAS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi for ac_prog in cpp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_RAWCPP+:} false; then : $as_echo_n "(cached) " >&6 else case $RAWCPP in [\\/]* | ?:[\\/]*) ac_cv_path_RAWCPP="$RAWCPP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RAWCPP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RAWCPP=$ac_cv_path_RAWCPP if test -n "$RAWCPP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RAWCPP" >&5 $as_echo "$RAWCPP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$RAWCPP" && break done test -n "$RAWCPP" || RAWCPP="${CPP}" # Check for flag to avoid builtin definitions - assumes unix is predefined, # which is not the best choice for supporting other OS'es, but covers most # of the ones we need for now. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $RAWCPP requires -undef" >&5 $as_echo_n "checking if $RAWCPP requires -undef... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ Does cpp redefine unix ? _ACEOF if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS=-undef { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # under Cygwin unix is still defined even with -undef elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS="-undef -ansi" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, with -ansi" >&5 $as_echo "yes, with -ansi" >&6; } else as_fn_error $? "${RAWCPP} defines unix with or without -undef. I don't know what to do." "$LINENO" 5 fi fi rm -f conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $RAWCPP requires -traditional" >&5 $as_echo_n "checking if $RAWCPP requires -traditional... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ Does cpp preserve "whitespace"? _ACEOF if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then TRADITIONALCPPFLAGS="-traditional" RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do." "$LINENO" 5 fi fi rm -f conftest.$ac_ext # Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow # easier overrides at build time. XSERVER_CFLAGS='$(CWARNFLAGS)' if test "x$GCC" = xyes ; then XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing" fi # Check whether --with-dtrace was given. if test "${with_dtrace+set}" = set; then : withval=$with_dtrace; WDTRACE=$withval else WDTRACE=auto fi if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then # Extract the first word of "dtrace", so it can be a program name with args. set dummy dtrace; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DTRACE+:} false; then : $as_echo_n "(cached) " >&6 else case $DTRACE in [\\/]* | ?:[\\/]*) ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/sbin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DTRACE" && ac_cv_path_DTRACE="not_found" ;; esac fi DTRACE=$ac_cv_path_DTRACE if test -n "$DTRACE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 $as_echo "$DTRACE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$DTRACE" = "xnot_found" ; then if test "x$WDTRACE" = "xyes" ; 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 $? "dtrace requested but not found See \`config.log' for more details" "$LINENO" 5; } fi WDTRACE="no" else ac_fn_c_check_header_mongrel "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sdt_h" = xyes; then : HAS_SDT_H="yes" else HAS_SDT_H="no" fi if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then WDTRACE="no" fi fi fi if test "x$WDTRACE" != "xno" ; then $as_echo "#define XSERVER_DTRACE 1" >>confdefs.h # Solaris/OpenSolaris require dtrace -G to build dtrace probe information into # object files, and require linking with those as relocatable objects, not .a # archives. MacOS X handles all this in the normal compiler toolchain, and on # some releases (like Tiger), will error out on dtrace -G. For now, other # platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux # ports appear to, based on my web searches, but have not yet been tested). case $host_os in darwin*) SPECIAL_DTRACE_OBJECTS=no ;; *) SPECIAL_DTRACE_OBJECTS=yes ;; esac fi if test "x$WDTRACE" != "xno"; then XSERVER_DTRACE_TRUE= XSERVER_DTRACE_FALSE='#' else XSERVER_DTRACE_TRUE='#' XSERVER_DTRACE_FALSE= fi if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"; then SPECIAL_DTRACE_OBJECTS_TRUE= SPECIAL_DTRACE_OBJECTS_FALSE='#' else SPECIAL_DTRACE_OBJECTS_TRUE='#' SPECIAL_DTRACE_OBJECTS_FALSE= fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \ fnmatch.h sys/mkdev.h sys/utsname.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $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 : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define X_BYTE_ORDER X_BIG_ENDIAN" >>confdefs.h ;; #( no) $as_echo "#define X_BYTE_ORDER X_LITTLE_ENDIAN" >>confdefs.h ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 $as_echo_n "checking size of unsigned long... " >&6; } if ${ac_cv_sizeof_unsigned_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_long" = yes; 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 77 "cannot compute sizeof (unsigned long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 $as_echo "$ac_cv_sizeof_unsigned_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF if test "$ac_cv_sizeof_unsigned_long" = 8; then $as_echo "#define _XSERVER64 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi # Checks for headers/macros for byte swapping # Known variants: # <byteswap.h> bswap_16, bswap_32, bswap_64 (glibc) # <sys/endian.h> __swap16, __swap32, __swap64 (OpenBSD) # <sys/endian.h> bswap16, bswap32, bswap64 (other BSD's) # and a fallback to local macros if none of the above are found # if <byteswap.h> is found, assume it's the correct version for ac_header in byteswap.h do : ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" if test "x$ac_cv_header_byteswap_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BYTESWAP_H 1 _ACEOF fi done # if <sys/endian.h> is found, have to check which version ac_fn_c_check_header_mongrel "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" if test "x$ac_cv_header_sys_endian_h" = xyes; then : HAVE_SYS_ENDIAN_H="yes" else HAVE_SYS_ENDIAN_H="no" fi if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __swap16 variant of <sys/endian.h> byteswapping macros" >&5 $as_echo_n "checking for __swap16 variant of <sys/endian.h> byteswapping macros... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/endian.h> int main () { int a = 1, b; b = __swap16(a); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : SYS_ENDIAN__SWAP='yes' else SYS_ENDIAN__SWAP='no' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYS_ENDIAN__SWAP" >&5 $as_echo "$SYS_ENDIAN__SWAP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bswap16 variant of <sys/endian.h> byteswapping macros" >&5 $as_echo_n "checking for bswap16 variant of <sys/endian.h> byteswapping macros... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/endian.h> int main () { int a = 1, b; b = bswap16(a); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : SYS_ENDIAN_BSWAP='yes' else SYS_ENDIAN_BSWAP='no' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYS_ENDIAN_BSWAP" >&5 $as_echo "$SYS_ENDIAN_BSWAP" >&6; } if test "$SYS_ENDIAN_BSWAP" = "yes" ; then USE_SYS_ENDIAN_H=yes BSWAP=bswap else if test "$SYS_ENDIAN__SWAP" = "yes" ; then USE_SYS_ENDIAN_H=yes BSWAP=__swap else USE_SYS_ENDIAN_H=no fi fi if test "$USE_SYS_ENDIAN_H" = "yes" ; then $as_echo "#define USE_SYS_ENDIAN_H 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define bswap_16 ${BSWAP}16 _ACEOF cat >>confdefs.h <<_ACEOF #define bswap_32 ${BSWAP}32 _ACEOF cat >>confdefs.h <<_ACEOF #define bswap_64 ${BSWAP}64 _ACEOF fi fi ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : DLOPEN_LIBS="-ldl" fi fi for ac_func in backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h else case " $LIBOBJS " in *" strcasecmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = xyes; then : $as_echo "#define HAVE_STRCASESTR 1" >>confdefs.h else case " $LIBOBJS " in *" strcasestr.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strcasestr.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" if test "x$ac_cv_func_strlcat" = xyes; then : $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h else case " $LIBOBJS " in *" strlcat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcat.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes; then : $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h else case " $LIBOBJS " in *" strlcpy.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" if test "x$ac_cv_func_strndup" = xyes; then : $as_echo "#define HAVE_STRNDUP 1" >>confdefs.h else case " $LIBOBJS " in *" strndup.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strndup.$ac_objext" ;; esac fi ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> " if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 $as_echo_n "checking for sqrt in -lm... " >&6; } if ${ac_cv_lib_m_sqrt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_sqrt=yes else ac_cv_lib_m_sqrt=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_m_sqrt" >&5 $as_echo "$ac_cv_lib_m_sqrt" >&6; } if test "x$ac_cv_lib_m_sqrt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi for ac_func in cbrt do : ac_fn_c_check_func "$LINENO" "cbrt" "ac_cv_func_cbrt" if test "x$ac_cv_func_cbrt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CBRT 1 _ACEOF fi done for ac_header in ndbm.h dbm.h rpcsvc/dbm.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in linux/agpgart.h sys/agpio.h sys/agpgart.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF AGP=yes fi done if test "x$AGP" = xyes; then AGP_TRUE= AGP_FALSE='#' else AGP_TRUE='#' AGP_FALSE= fi for ac_header in linux/fb.h do : ac_fn_c_check_header_mongrel "$LINENO" "linux/fb.h" "ac_cv_header_linux_fb_h" "$ac_includes_default" if test "x$ac_cv_header_linux_fb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_FB_H 1 _ACEOF FBDEV=yes fi done if test "x$FBDEV" = xyes; then FBDEVHW_TRUE= FBDEVHW_FALSE='#' else FBDEVHW_TRUE='#' FBDEVHW_FALSE= fi for ac_header in sys/linker.h do : ac_fn_c_check_header_compile "$LINENO" "sys/linker.h" "ac_cv_header_sys_linker_h" "#include <sys/param.h> " if test "x$ac_cv_header_sys_linker_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_LINKER_H 1 _ACEOF ac_cv_sys_linker_h=yes else ac_cv_sys_linker_h=no fi done if test "x$ac_cv_sys_linker_h" = xyes; then FREEBSD_KLDLOAD_TRUE= FREEBSD_KLDLOAD_FALSE='#' else FREEBSD_KLDLOAD_TRUE='#' FREEBSD_KLDLOAD_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSV IPC" >&5 $as_echo_n "checking for SYSV IPC... " >&6; } if ${ac_cv_sysv_ipc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> #include <sys/stat.h> int main () { { int id; id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR); if (id < 0) return -1; return shmctl(id, IPC_RMID, 0); } ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sysv_ipc=yes else ac_cv_sysv_ipc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sysv_ipc" >&5 $as_echo "$ac_cv_sysv_ipc" >&6; } if test "x$ac_cv_sysv_ipc" = xyes; then $as_echo "#define HAVE_SYSV_IPC 1" >>confdefs.h fi if test -c /dev/xf86 ; then $as_echo "#define HAS_APERTURE_DRV 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "machine/apmvar.h" "ac_cv_header_machine_apmvar_h" "$ac_includes_default" if test "x$ac_cv_header_machine_apmvar_h" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" if test "x$ac_cv_header_sys_event_h" = xyes; then : ac_cv_BSD_KQUEUE_APM=yes else ac_cv_BSD_APM=yes fi fi if test "x$ac_cv_BSD_APM" = xyes; then BSD_APM_TRUE= BSD_APM_FALSE='#' else BSD_APM_TRUE='#' BSD_APM_FALSE= fi if test "x$ac_cv_BSD_KQUEUE_APM" = xyes; then BSD_KQUEUE_APM_TRUE= BSD_KQUEUE_APM_FALSE='#' else BSD_KQUEUE_APM_TRUE='#' BSD_KQUEUE_APM_FALSE= fi ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" if test "x$ac_cv_header_execinfo_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lc" >&5 $as_echo_n "checking for backtrace in -lc... " >&6; } if ${ac_cv_lib_c_backtrace+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $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 backtrace (); int main () { return backtrace (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_backtrace=yes else ac_cv_lib_c_backtrace=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_c_backtrace" >&5 $as_echo "$ac_cv_lib_c_backtrace" >&6; } if test "x$ac_cv_lib_c_backtrace" = xyes; then : $as_echo "#define HAVE_BACKTRACE 1" >>confdefs.h $as_echo "#define HAVE_EXECINFO_H 1" >>confdefs.h fi fi DEFAULT_INT10="x86emu" case $host_cpu in alpha*) ALPHA_VIDEO=yes case $host_os in *freebsd*) SYS_LIBS=-lio ;; *netbsd*) $as_echo "#define USE_ALPHA_PIO 1" >>confdefs.h ;; esac GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee" ;; arm*) ARM_VIDEO=yes DEFAULT_INT10="stub" ;; i*86) I386_VIDEO=yes case $host_os in *freebsd*) $as_echo "#define USE_DEV_IO 1" >>confdefs.h ;; *dragonfly*) $as_echo "#define USE_DEV_IO 1" >>confdefs.h ;; *netbsd*) $as_echo "#define USE_I386_IOPL 1" >>confdefs.h SYS_LIBS=-li386 ;; *openbsd*) $as_echo "#define USE_I386_IOPL 1" >>confdefs.h SYS_LIBS=-li386 ;; esac ;; powerpc*) PPC_VIDEO=yes case $host_os in *freebsd*) DEFAULT_INT10=stub ;; esac ;; sparc*) SPARC64_VIDEO=yes BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c" GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; x86_64*|amd64*) I386_VIDEO=yes case $host_os in *freebsd*) $as_echo "#define USE_DEV_IO 1" >>confdefs.h ;; *dragonfly*) $as_echo "#define USE_DEV_IO 1" >>confdefs.h ;; *netbsd*) $as_echo "#define USE_I386_IOPL 1" >>confdefs.h SYS_LIBS=-lx86_64 ;; *openbsd*) $as_echo "#define USE_AMD64_IOPL 1" >>confdefs.h SYS_LIBS=-lamd64 ;; esac GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; ia64*) GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; s390*) GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; esac if test "x$ALPHA_VIDEO" = xyes; then ALPHA_VIDEO_TRUE= ALPHA_VIDEO_FALSE='#' else ALPHA_VIDEO_TRUE='#' ALPHA_VIDEO_FALSE= fi if test "x$ARM_VIDEO" = xyes; then ARM_VIDEO_TRUE= ARM_VIDEO_FALSE='#' else ARM_VIDEO_TRUE='#' ARM_VIDEO_FALSE= fi if test "x$I386_VIDEO" = xyes; then I386_VIDEO_TRUE= I386_VIDEO_FALSE='#' else I386_VIDEO_TRUE='#' I386_VIDEO_FALSE= fi if test "x$PPC_VIDEO" = xyes; then PPC_VIDEO_TRUE= PPC_VIDEO_FALSE='#' else PPC_VIDEO_TRUE='#' PPC_VIDEO_FALSE= fi if test "x$SPARC64_VIDEO" = xyes; then SPARC64_VIDEO_TRUE= SPARC64_VIDEO_FALSE='#' else SPARC64_VIDEO_TRUE='#' SPARC64_VIDEO_FALSE= fi DRI=no USE_SIGIO_BY_DEFAULT="yes" case $host_os in *freebsd* | *dragonfly*) case $host_os in kfreebsd*-gnu) ;; *) $as_echo "#define CSRG_BASED 1" >>confdefs.h ;; esac $as_echo "#define PCCONS_SUPPORT 1" >>confdefs.h $as_echo "#define PCVT_SUPPORT 1" >>confdefs.h $as_echo "#define SYSCONS_SUPPORT 1" >>confdefs.h DRI=yes ;; *netbsd*) $as_echo "#define CSRG_BASED 1" >>confdefs.h $as_echo "#define PCCONS_SUPPORT 1" >>confdefs.h $as_echo "#define PCVT_SUPPORT 1" >>confdefs.h $as_echo "#define WSCONS_SUPPORT 1" >>confdefs.h DRI=yes ;; *openbsd*) $as_echo "#define CSRG_BASED 1" >>confdefs.h $as_echo "#define PCVT_SUPPORT 1" >>confdefs.h $as_echo "#define WSCONS_SUPPORT 1" >>confdefs.h ;; *linux*) DRI=yes ;; *solaris*) if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then DRI=yes else DRI=no fi # Disable use of SIGIO by default until some system bugs are # fixed - see Sun/OpenSolaris bug id 6879897 USE_SIGIO_BY_DEFAULT="no" ;; darwin*) $as_echo "#define CSRG_BASED 1" >>confdefs.h ;; cygwin*|mingw*) CFLAGS="$CFLAGS -DFD_SETSIZE=256" ;; esac PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1` PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1` if test "x$PVS" = "x"; then PVS="0" fi VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)" VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" VENDOR_NAME="The X.Org Foundation" VENDOR_NAME_SHORT="X.Org" VENDOR_WEB="http://wiki.x.org" # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; as_fn_error $? "--enable-werror has been replaced by --enable-strict-compilation" "$LINENO" 5 fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; DEBUGGING=$enableval else DEBUGGING=no fi # Check whether --enable-use-sigio-by-default was given. if test "${enable_use_sigio_by_default+set}" = set; then : enableval=$enable_use_sigio_by_default; USE_SIGIO_BY_DEFAULT=$enableval fi # Check whether --with-int10 was given. if test "${with_int10+set}" = set; then : withval=$with_int10; INT10="$withval" else INT10="$DEFAULT_INT10" fi # Check whether --with-vendor-name was given. if test "${with_vendor_name+set}" = set; then : withval=$with_vendor_name; VENDOR_NAME="$withval" fi # Check whether --with-vendor-name-short was given. if test "${with_vendor_name_short+set}" = set; then : withval=$with_vendor_name_short; VENDOR_NAME_SHORT="$withval" fi # Check whether --with-vendor-web was given. if test "${with_vendor_web+set}" = set; then : withval=$with_vendor_web; VENDOR_WEB="$withval" fi # Check whether --with-module-dir was given. if test "${with_module_dir+set}" = set; then : withval=$with_module_dir; moduledir="$withval" else moduledir="${libdir}/xorg/modules" fi # Check whether --with-log-dir was given. if test "${with_log_dir+set}" = set; then : withval=$with_log_dir; logdir="$withval" else logdir="$localstatedir/log" fi # Check whether --with-builder-addr was given. if test "${with_builder_addr+set}" = set; then : withval=$with_builder_addr; BUILDERADDR="$withval" else BUILDERADDR="xorg@lists.freedesktop.org" fi # Check whether --with-os-name was given. if test "${with_os_name+set}" = set; then : withval=$with_os_name; OSNAME="$withval" else OSNAME=`uname -srm` fi # Check whether --with-os-vendor was given. if test "${with_os_vendor+set}" = set; then : withval=$with_os_vendor; OSVENDOR="$withval" else OSVENDOR="" fi # Check whether --with-builderstring was given. if test "${with_builderstring+set}" = set; then : withval=$with_builderstring; BUILDERSTRING="$withval" fi # Check whether --enable-listen-tcp was given. if test "${enable_listen_tcp+set}" = set; then : enableval=$enable_listen_tcp; LISTEN_TCP=$enableval else LISTEN_TCP=no fi # Check whether --enable-listen-unix was given. if test "${enable_listen_unix+set}" = set; then : enableval=$enable_listen_unix; LISTEN_UNIX=$enableval else LISTEN_UNIX=yes fi # Check whether --enable-listen-local was given. if test "${enable_listen_local+set}" = set; then : enableval=$enable_listen_local; LISTEN_LOCAL=$enableval else LISTEN_LOCAL=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for root directory for font files" >&5 $as_echo_n "checking for root directory for font files... " >&6; } # Check whether --with-fontrootdir was given. if test "${with_fontrootdir+set}" = set; then : withval=$with_fontrootdir; FONTROOTDIR="$withval" fi # if --with-fontrootdir not specified... if test "x${FONTROOTDIR}" = "x"; then FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil` fi # ...and if pkg-config didn't find fontdir in fontutil.pc... if test "x${FONTROOTDIR}" = "x"; then FONTROOTDIR="${datadir}/fonts/X11" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FONTROOTDIR}" >&5 $as_echo "${FONTROOTDIR}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory for misc files" >&5 $as_echo_n "checking for directory for misc files... " >&6; } # Check whether --with-fontmiscdir was given. if test "${with_fontmiscdir+set}" = set; then : withval=$with_fontmiscdir; FONTMISCDIR="${withval}" else FONTMISCDIR='${FONTROOTDIR}/misc' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FONTMISCDIR}" >&5 $as_echo "${FONTMISCDIR}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory for OTF files" >&5 $as_echo_n "checking for directory for OTF files... " >&6; } # Check whether --with-fontotfdir was given. if test "${with_fontotfdir+set}" = set; then : withval=$with_fontotfdir; FONTOTFDIR="${withval}" else FONTOTFDIR='${FONTROOTDIR}/OTF' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FONTOTFDIR}" >&5 $as_echo "${FONTOTFDIR}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory for TTF files" >&5 $as_echo_n "checking for directory for TTF files... " >&6; } # Check whether --with-fontttfdir was given. if test "${with_fontttfdir+set}" = set; then : withval=$with_fontttfdir; FONTTTFDIR="${withval}" else FONTTTFDIR='${FONTROOTDIR}/TTF' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FONTTTFDIR}" >&5 $as_echo "${FONTTTFDIR}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory for Type1 files" >&5 $as_echo_n "checking for directory for Type1 files... " >&6; } # Check whether --with-fonttype1dir was given. if test "${with_fonttype1dir+set}" = set; then : withval=$with_fonttype1dir; FONTTYPE1DIR="${withval}" else FONTTYPE1DIR='${FONTROOTDIR}/Type1' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FONTTYPE1DIR}" >&5 $as_echo "${FONTTYPE1DIR}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory for 75dpi files" >&5 $as_echo_n "checking for directory for 75dpi files... " >&6; } # Check whether --with-font75dpidir was given. if test "${with_font75dpidir+set}" = set; then : withval=$with_font75dpidir; FONT75DPIDIR="${withval}" else FONT75DPIDIR='${FONTROOTDIR}/75dpi' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FONT75DPIDIR}" >&5 $as_echo "${FONT75DPIDIR}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory for 100dpi files" >&5 $as_echo_n "checking for directory for 100dpi files... " >&6; } # Check whether --with-font100dpidir was given. if test "${with_font100dpidir+set}" = set; then : withval=$with_font100dpidir; FONT100DPIDIR="${withval}" else FONT100DPIDIR='${FONTROOTDIR}/100dpi' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FONT100DPIDIR}" >&5 $as_echo "${FONT100DPIDIR}" >&6; } DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/" case $host_os in darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;; esac # Check whether --with-default-font-path was given. if test "${with_default_font_path+set}" = set; then : withval=$with_default_font_path; FONTPATH="$withval" else FONTPATH="${DEFAULT_FONT_PATH}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default font path" >&5 $as_echo_n "checking for default font path... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTPATH" >&5 $as_echo "$FONTPATH" >&6; } # Check whether --with-xkb-path was given. if test "${with_xkb_path+set}" = set; then : withval=$with_xkb_path; XKBPATH="$withval" else XKBPATH="${datadir}/X11/xkb" fi # Check whether --with-xkb-output was given. if test "${with_xkb_output+set}" = set; then : withval=$with_xkb_output; XKBOUTPUT="$withval" else XKBOUTPUT="compiled" fi # Check whether --with-default-xkb-rules was given. if test "${with_default_xkb_rules+set}" = set; then : withval=$with_default_xkb_rules; XKB_DFLT_RULES="$withval" else XKB_DFLT_RULES="" fi # Check whether --with-default-xkb-model was given. if test "${with_default_xkb_model+set}" = set; then : withval=$with_default_xkb_model; XKB_DFLT_MODEL="$withval" else XKB_DFLT_MODEL="pc105" fi # Check whether --with-default-xkb-layout was given. if test "${with_default_xkb_layout+set}" = set; then : withval=$with_default_xkb_layout; XKB_DFLT_LAYOUT="$withval" else XKB_DFLT_LAYOUT="us" fi # Check whether --with-default-xkb-variant was given. if test "${with_default_xkb_variant+set}" = set; then : withval=$with_default_xkb_variant; XKB_DFLT_VARIANT="$withval" else XKB_DFLT_VARIANT="" fi # Check whether --with-default-xkb-options was given. if test "${with_default_xkb_options+set}" = set; then : withval=$with_default_xkb_options; XKB_DFLT_OPTIONS="$withval" else XKB_DFLT_OPTIONS="" fi # Check whether --with-serverconfig-path was given. if test "${with_serverconfig_path+set}" = set; then : withval=$with_serverconfig_path; SERVERCONFIG="$withval" else SERVERCONFIG="${libdir}/xorg" fi # Check whether --with-apple-applications-dir was given. if test "${with_apple_applications_dir+set}" = set; then : withval=$with_apple_applications_dir; APPLE_APPLICATIONS_DIR="${withval}" else APPLE_APPLICATIONS_DIR="/Applications/Utilities" fi # Check whether --with-apple-application-name was given. if test "${with_apple_application_name+set}" = set; then : withval=$with_apple_application_name; APPLE_APPLICATION_NAME="${withval}" else APPLE_APPLICATION_NAME="X11" fi # Check whether --with-launchd-id-prefix was given. if test "${with_launchd_id_prefix+set}" = set; then : withval=$with_launchd_id_prefix; BUNDLE_ID_PREFIX="${withval}" else BUNDLE_ID_PREFIX="org.x" fi # Check whether --with-bundle-id-prefix was given. if test "${with_bundle_id_prefix+set}" = set; then : withval=$with_bundle_id_prefix; BUNDLE_ID_PREFIX="${withval}" fi cat >>confdefs.h <<_ACEOF #define BUNDLE_ID_PREFIX "$BUNDLE_ID_PREFIX" _ACEOF # Check whether --enable-sparkle was given. if test "${enable_sparkle+set}" = set; then : enableval=$enable_sparkle; XQUARTZ_SPARKLE="${enableval}" else XQUARTZ_SPARKLE="no" fi # Check whether --enable-install-libxf86config was given. if test "${enable_install_libxf86config+set}" = set; then : enableval=$enable_install_libxf86config; INSTALL_LIBXF86CONFIG=$enableval else INSTALL_LIBXF86CONFIG=no fi # Check whether --enable-visibility was given. if test "${enable_visibility+set}" = set; then : enableval=$enable_visibility; SYMBOL_VISIBILITY=$enableval else SYMBOL_VISIBILITY=auto fi # Check whether --enable-aiglx was given. if test "${enable_aiglx+set}" = set; then : enableval=$enable_aiglx; AIGLX=$enableval else AIGLX=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) support" >&5 $as_echo_n "checking for thread local storage (TLS) support... " >&6; } if ${ac_cv_tls+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_tls=none keywords="__thread __declspec(thread)" for kw in $keywords ; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int $kw test; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_tls=$kw ; break ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5 $as_echo "$ac_cv_tls" >&6; } if test "$ac_cv_tls" != "none"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tls_model attribute support" >&5 $as_echo_n "checking for tls_model attribute support... " >&6; } if ${ac_cv_tls_model+:} false; then : $as_echo_n "(cached) " >&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $STRICT_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int $ac_cv_tls __attribute__((tls_model("initial-exec"))) test; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_tls_model=yes else ac_cv_tls_model=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls_model" >&5 $as_echo "$ac_cv_tls_model" >&6; } if test "x$ac_cv_tls_model" = "xyes" ; then xorg_tls=$ac_cv_tls' __attribute__((tls_model("initial-exec")))' else xorg_tls=$ac_cv_tls fi cat >>confdefs.h <<_ACEOF #define TLS $xorg_tls _ACEOF fi # Check whether --enable-glx-tls was given. if test "${enable_glx_tls+set}" = set; then : enableval=$enable_glx_tls; GLX_USE_TLS=$enableval if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then as_fn_error $? "GLX with TLS support requested, but the compiler does not support it." "$LINENO" 5 fi else GLX_USE_TLS=no if test "${ac_cv_tls}" != "none" ; then GLX_USE_TLS=yes fi fi GLX_TLS=${GLX_USE_TLS} # Check whether --with-khronos-spec-dir was given. if test "${with_khronos_spec_dir+set}" = set; then : withval=$with_khronos_spec_dir; KHRONOS_SPEC_DIR="${withval}" else KHRONOS_SPEC_DIR=auto fi # Check whether --enable-composite was given. if test "${enable_composite+set}" = set; then : enableval=$enable_composite; COMPOSITE=$enableval else COMPOSITE=yes fi # Check whether --enable-mitshm was given. if test "${enable_mitshm+set}" = set; then : enableval=$enable_mitshm; MITSHM=$enableval else MITSHM=auto fi # Check whether --enable-xres was given. if test "${enable_xres+set}" = set; then : enableval=$enable_xres; RES=$enableval else RES=yes fi # Check whether --enable-record was given. if test "${enable_record+set}" = set; then : enableval=$enable_record; RECORD=$enableval else RECORD=yes fi # Check whether --enable-xv was given. if test "${enable_xv+set}" = set; then : enableval=$enable_xv; XV=$enableval else XV=yes fi # Check whether --enable-xvmc was given. if test "${enable_xvmc+set}" = set; then : enableval=$enable_xvmc; XVMC=$enableval else XVMC=yes fi # Check whether --enable-dga was given. if test "${enable_dga+set}" = set; then : enableval=$enable_dga; DGA=$enableval else DGA=auto fi # Check whether --enable-screensaver was given. if test "${enable_screensaver+set}" = set; then : enableval=$enable_screensaver; SCREENSAVER=$enableval else SCREENSAVER=yes fi # Check whether --enable-xdmcp was given. if test "${enable_xdmcp+set}" = set; then : enableval=$enable_xdmcp; XDMCP=$enableval else XDMCP=auto fi # Check whether --enable-xdm-auth-1 was given. if test "${enable_xdm_auth_1+set}" = set; then : enableval=$enable_xdm_auth_1; XDMAUTH=$enableval else XDMAUTH=auto fi # Check whether --enable-glx was given. if test "${enable_glx+set}" = set; then : enableval=$enable_glx; GLX=$enableval else GLX=yes fi # Check whether --enable-dri was given. if test "${enable_dri+set}" = set; then : enableval=$enable_dri; DRI=$enableval fi # Check whether --enable-dri2 was given. if test "${enable_dri2+set}" = set; then : enableval=$enable_dri2; DRI2=$enableval else DRI2=auto fi # Check whether --enable-dri3 was given. if test "${enable_dri3+set}" = set; then : enableval=$enable_dri3; DRI3=$enableval else DRI3=auto fi # Check whether --enable-present was given. if test "${enable_present+set}" = set; then : enableval=$enable_present; PRESENT=$enableval else PRESENT=yes fi # Check whether --enable-xinerama was given. if test "${enable_xinerama+set}" = set; then : enableval=$enable_xinerama; XINERAMA=$enableval else XINERAMA=yes fi # Check whether --enable-xf86vidmode was given. if test "${enable_xf86vidmode+set}" = set; then : enableval=$enable_xf86vidmode; XF86VIDMODE=$enableval else XF86VIDMODE=auto fi # Check whether --enable-xace was given. if test "${enable_xace+set}" = set; then : enableval=$enable_xace; XACE=$enableval else XACE=yes fi # Check whether --enable-xselinux was given. if test "${enable_xselinux+set}" = set; then : enableval=$enable_xselinux; XSELINUX=$enableval else XSELINUX=no fi # Check whether --enable-xcsecurity was given. if test "${enable_xcsecurity+set}" = set; then : enableval=$enable_xcsecurity; XCSECURITY=$enableval else XCSECURITY=no fi # Check whether --enable-tslib was given. if test "${enable_tslib+set}" = set; then : enableval=$enable_tslib; TSLIB=$enableval else TSLIB=no fi # Check whether --enable-dbe was given. if test "${enable_dbe+set}" = set; then : enableval=$enable_dbe; DBE=$enableval else DBE=yes fi # Check whether --enable-xf86bigfont was given. if test "${enable_xf86bigfont+set}" = set; then : enableval=$enable_xf86bigfont; XF86BIGFONT=$enableval else XF86BIGFONT=no fi # Check whether --enable-dpms was given. if test "${enable_dpms+set}" = set; then : enableval=$enable_dpms; DPMSExtension=$enableval else DPMSExtension=yes fi # Check whether --enable-config-udev was given. if test "${enable_config_udev+set}" = set; then : enableval=$enable_config_udev; CONFIG_UDEV=$enableval 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-hal was given. if test "${enable_config_hal+set}" = set; then : enableval=$enable_config_hal; CONFIG_HAL=$enableval else CONFIG_HAL=auto fi # Check whether --enable-config-wscons was given. if test "${enable_config_wscons+set}" = set; then : enableval=$enable_config_wscons; CONFIG_WSCONS=$enableval else CONFIG_WSCONS=auto fi # Check whether --enable-xfree86-utils was given. if test "${enable_xfree86_utils+set}" = set; then : enableval=$enable_xfree86_utils; XF86UTILS=$enableval else XF86UTILS=yes fi # Check whether --enable-vgahw was given. if test "${enable_vgahw+set}" = set; then : enableval=$enable_vgahw; VGAHW=$enableval else VGAHW=yes fi # Check whether --enable-vbe was given. if test "${enable_vbe+set}" = set; then : enableval=$enable_vbe; VBE=$enableval else VBE=yes fi # Check whether --enable-int10-module was given. if test "${enable_int10_module+set}" = set; then : enableval=$enable_int10_module; INT10MODULE=$enableval else INT10MODULE=yes fi # Check whether --enable-windowswm was given. if test "${enable_windowswm+set}" = set; then : enableval=$enable_windowswm; WINDOWSWM=$enableval else WINDOWSWM=no fi # Check whether --enable-libdrm was given. if test "${enable_libdrm+set}" = set; then : enableval=$enable_libdrm; DRM=$enableval else DRM=yes fi # Check whether --enable-clientids was given. if test "${enable_clientids+set}" = set; then : enableval=$enable_clientids; CLIENTIDS=$enableval else CLIENTIDS=yes fi # Check whether --enable-pciaccess was given. if test "${enable_pciaccess+set}" = set; then : enableval=$enable_pciaccess; PCI=$enableval else PCI=yes fi # Check whether --enable-linux_acpi was given. if test "${enable_linux_acpi+set}" = set; then : enableval=$enable_linux_acpi; enable_linux_acpi=$enableval else enable_linux_acpi=yes fi # Check whether --enable-linux_apm was given. if test "${enable_linux_apm+set}" = set; then : enableval=$enable_linux_apm; enable_linux_apm=$enableval else enable_linux_apm=yes fi # Check whether --enable-systemd-logind was given. if test "${enable_systemd_logind+set}" = set; then : enableval=$enable_systemd_logind; SYSTEMD_LOGIND=$enableval else SYSTEMD_LOGIND=auto fi # Check whether --enable-suid-wrapper was given. if test "${enable_suid_wrapper+set}" = set; then : enableval=$enable_suid_wrapper; SUID_WRAPPER=$enableval else SUID_WRAPPER=no fi # Check whether --enable-xorg was given. if test "${enable_xorg+set}" = set; then : enableval=$enable_xorg; XORG=$enableval else XORG=auto fi # Check whether --enable-dmx was given. if test "${enable_dmx+set}" = set; then : enableval=$enable_dmx; DMX=$enableval else DMX=no fi # Check whether --enable-xvfb was given. if test "${enable_xvfb+set}" = set; then : enableval=$enable_xvfb; XVFB=$enableval else XVFB=yes fi # Check whether --enable-xnest was given. if test "${enable_xnest+set}" = set; then : enableval=$enable_xnest; XNEST=$enableval else XNEST=auto fi # Check whether --enable-xquartz was given. if test "${enable_xquartz+set}" = set; then : enableval=$enable_xquartz; XQUARTZ=$enableval else XQUARTZ=auto fi # Check whether --enable-xwayland was given. if test "${enable_xwayland+set}" = set; then : enableval=$enable_xwayland; XWAYLAND=$enableval else XWAYLAND=auto fi # Check whether --enable-standalone-xpbproxy was given. if test "${enable_standalone_xpbproxy+set}" = set; then : enableval=$enable_standalone_xpbproxy; STANDALONE_XPBPROXY=$enableval else STANDALONE_XPBPROXY=no fi # Check whether --enable-xwin was given. if test "${enable_xwin+set}" = set; then : enableval=$enable_xwin; XWIN=$enableval else XWIN=auto fi # Check whether --enable-glamor was given. if test "${enable_glamor+set}" = set; then : enableval=$enable_glamor; GLAMOR=$enableval else GLAMOR=no fi # Check whether --enable-kdrive was given. if test "${enable_kdrive+set}" = set; then : enableval=$enable_kdrive; KDRIVE=$enableval else KDRIVE=no fi # Check whether --enable-xephyr was given. if test "${enable_xephyr+set}" = set; then : enableval=$enable_xephyr; XEPHYR=$enableval else XEPHYR=auto fi # Check whether --enable-xfake was given. if test "${enable_xfake+set}" = set; then : enableval=$enable_xfake; XFAKE=$enableval else XFAKE=auto fi # Check whether --enable-xfbdev was given. if test "${enable_xfbdev+set}" = set; then : enableval=$enable_xfbdev; XFBDEV=$enableval else XFBDEV=auto fi # Check whether --enable-kdrive-kbd was given. if test "${enable_kdrive_kbd+set}" = set; then : enableval=$enable_kdrive_kbd; KDRIVE_KBD=$enableval else KDRIVE_KBD=auto fi # Check whether --enable-kdrive-mouse was given. if test "${enable_kdrive_mouse+set}" = set; then : enableval=$enable_kdrive_mouse; KDRIVE_MOUSE=$enableval else KDRIVE_MOUSE=auto fi # Check whether --enable-kdrive-evdev was given. if test "${enable_kdrive_evdev+set}" = set; then : enableval=$enable_kdrive_evdev; KDRIVE_EVDEV=$enableval else KDRIVE_EVDEV=auto fi # Check whether --enable-libunwind was given. if test "${enable_libunwind+set}" = set; then : enableval=$enable_libunwind; LIBUNWIND="$enableval" else LIBUNWIND="auto" fi # Check whether --enable-xshmfence was given. if test "${enable_xshmfence+set}" = set; then : enableval=$enable_xshmfence; XSHMFENCE="$enableval" else XSHMFENCE="auto" fi # Check whether --enable-install-setuid was given. if test "${enable_install_setuid+set}" = set; then : enableval=$enable_install_setuid; SETUID=$enableval else SETUID=auto fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we can install the Xorg server as root" >&5 $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 sparc) SETUID="no" ;; *) SETUID="yes" ;; esac esac if test "x$SETUID" = xyes; then touch testfile chown root testfile > /dev/null 2>&1 || SETUID="no" rm -f testfile fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETUID" >&5 $as_echo "$SETUID" >&6; } if test "x$SETUID" = "xyes"; then INSTALL_SETUID_TRUE= INSTALL_SETUID_FALSE='#' else INSTALL_SETUID_TRUE='#' INSTALL_SETUID_FALSE= fi # Transport selection macro from xtrans.m4 case $host_os in mingw*) unixdef="no" ;; *) unixdef="yes" ;; esac # Check whether --enable-unix-transport was given. if test "${enable_unix_transport+set}" = set; then : enableval=$enable_unix_transport; UNIXCONN=$enableval else UNIXCONN=$unixdef fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Xtrans should support UNIX socket connections" >&5 $as_echo_n "checking if Xtrans should support UNIX socket connections... " >&6; } if test "$UNIXCONN" = "yes"; then $as_echo "#define UNIXCONN 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNIXCONN" >&5 $as_echo "$UNIXCONN" >&6; } # Check whether --enable-tcp-transport was given. if test "${enable_tcp_transport+set}" = set; then : enableval=$enable_tcp_transport; TCPCONN=$enableval else TCPCONN=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Xtrans should support TCP socket connections" >&5 $as_echo_n "checking if Xtrans should support TCP socket connections... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCPCONN" >&5 $as_echo "$TCPCONN" >&6; } if test "$TCPCONN" = "yes"; then $as_echo "#define TCPCONN 1" >>confdefs.h # SVR4 hides these in libraries other than libc { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 $as_echo_n "checking for library containing socket... " >&6; } if ${ac_cv_search_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 socket (); int main () { return socket (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_socket=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_socket+:} false; then : break fi done if ${ac_cv_search_socket+:} false; then : else ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 $as_echo "$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 $as_echo_n "checking for library containing gethostbyname... " >&6; } if ${ac_cv_search_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_gethostbyname=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gethostbyname+:} false; then : break fi done if ${ac_cv_search_gethostbyname+:} false; then : else ac_cv_search_gethostbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 $as_echo "$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 $as_echo_n "checking for main in -lws2_32... " >&6; } if ${ac_cv_lib_ws2_32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lws2_32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ws2_32_main=yes else ac_cv_lib_ws2_32_main=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_ws2_32_main" >&5 $as_echo "$ac_cv_lib_ws2_32_main" >&6; } if test "x$ac_cv_lib_ws2_32_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi fi # Needs to come after above checks for libsocket & libnsl for SVR4 systems # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; IPV6CONN=$enableval else ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" if test "x$ac_cv_func_getaddrinfo" = xyes; then : IPV6CONN=yes else IPV6CONN=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IPv6 support should be built" >&5 $as_echo_n "checking if IPv6 support should be built... " >&6; } if test "$IPV6CONN" = "yes"; then $as_echo "#define IPv6 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPV6CONN" >&5 $as_echo "$IPV6CONN" >&6; } # 4.3BSD-Reno added a new member to struct sockaddr_in ac_fn_c_check_member "$LINENO" "struct sockaddr_in" "sin_len" "ac_cv_member_struct_sockaddr_in_sin_len" " #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> " if test "x$ac_cv_member_struct_sockaddr_in_sin_len" = xyes; then : $as_echo "#define BSD44SOCKETS 1" >>confdefs.h fi # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc. ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " $ac_includes_default #include <sys/socket.h> " if test "x$ac_cv_type_socklen_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi # XPG4v2/UNIX95 added msg_control - check to see if we need to define # _XOPEN_SOURCE to get it (such as on Solaris) ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " $ac_includes_default #include <sys/socket.h> " if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : fi # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then unset ac_cv_member_struct_msghdr_msg_control { $as_echo "$as_me:${as_lineno-$LINENO}: trying again with _XOPEN_SOURCE=600" >&5 $as_echo "$as_me: trying again with _XOPEN_SOURCE=600" >&6;} ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " #define _XOPEN_SOURCE 600 $ac_includes_default #include <sys/socket.h> " if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : $as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h fi fi # If that didn't work, fall back to XPG5/UNIX98 with C89 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then unset ac_cv_member_struct_msghdr_msg_control { $as_echo "$as_me:${as_lineno-$LINENO}: trying again with _XOPEN_SOURCE=500" >&5 $as_echo "$as_me: trying again with _XOPEN_SOURCE=500" >&6;} ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " #define _XOPEN_SOURCE 500 $ac_includes_default #include <sys/socket.h> " if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h fi fi fi case $host_os in solaris*|sco*|sysv4*) localdef="yes" ;; *) localdef="no" ;; esac # Check whether --enable-local-transport was given. if test "${enable_local_transport+set}" = set; then : enableval=$enable_local_transport; LOCALCONN=$enableval else LOCALCONN=$localdef fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Xtrans should support os-specific local connections" >&5 $as_echo_n "checking if Xtrans should support os-specific local connections... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCALCONN" >&5 $as_echo "$LOCALCONN" >&6; } if test "$LOCALCONN" = "yes"; then $as_echo "#define LOCALCONN 1" >>confdefs.h fi # Secure RPC detection macro from xtrans.m4 # Check whether --enable-secure-rpc was given. if test "${enable_secure_rpc+set}" = set; then : enableval=$enable_secure_rpc; SECURE_RPC=$enableval else SECURE_RPC="try" fi if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then FOUND_SECURE_RPC="no" for ac_func in authdes_seccreate authdes_create do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF FOUND_SECURE_RPC="yes" fi done if test "x$FOUND_SECURE_RPC" = "xno" ; then if test "x$SECURE_RPC" = "xyes" ; then as_fn_error $? "Secure RPC requested, but required functions not found" "$LINENO" 5 fi SECURE_RPC="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getsecretkey" >&5 $as_echo_n "checking for library containing getsecretkey... " >&6; } if ${ac_cv_search_getsecretkey+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 getsecretkey (); int main () { return getsecretkey (); ; return 0; } _ACEOF for ac_lib in '' rpcsvc; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getsecretkey=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getsecretkey+:} false; then : break fi done if ${ac_cv_search_getsecretkey+:} false; then : else ac_cv_search_getsecretkey=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getsecretkey" >&5 $as_echo "$ac_cv_search_getsecretkey" >&6; } ac_res=$ac_cv_search_getsecretkey if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi SECURE_RPC="yes" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Secure RPC authentication (\"SUN-DES-1\") should be supported" >&5 $as_echo_n "checking if Secure RPC authentication (\"SUN-DES-1\") should be supported... " >&6; } if test "x$SECURE_RPC" = "xyes" ; then $as_echo "#define SECURE_RPC 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SECURE_RPC" >&5 $as_echo "$SECURE_RPC" >&6; } if test "x$SECURE_RPC" = xyes; then SECURE_RPC_TRUE= SECURE_RPC_FALSE='#' else SECURE_RPC_TRUE='#' SECURE_RPC_FALSE= fi if test "x$INT10" = xvm86; then INT10_VM86_TRUE= INT10_VM86_FALSE='#' else INT10_VM86_TRUE='#' INT10_VM86_FALSE= fi if test "x$INT10" = xx86emu; then INT10_X86EMU_TRUE= INT10_X86EMU_FALSE='#' else INT10_X86EMU_TRUE='#' INT10_X86EMU_FALSE= fi if test "x$INT10" = xstub; then INT10_STUB_TRUE= INT10_STUB_FALSE='#' else INT10_STUB_TRUE='#' INT10_STUB_FALSE= fi if test "x$INSTALL_LIBXF86CONFIG" = xyes; then INSTALL_LIBXF86CONFIG_TRUE= INSTALL_LIBXF86CONFIG_FALSE='#' else INSTALL_LIBXF86CONFIG_TRUE='#' INSTALL_LIBXF86CONFIG_FALSE= fi case $host_os in cygwin* | mingw*) CONFIG_HAL=no CONFIG_UDEV=no CONFIG_UDEV_KMS=no DGA=no DRM=no DRI2=no DRI3=no INT10MODULE=no PCI=no VGAHW=no VBE=no XF86UTILS=no XF86VIDMODE=no XSELINUX=no XV=no SYMBOL_VISIBILITY=no ;; darwin*) PCI=no INT10MODULE=no VGAHW=no VBE=no DRM=no DRI2=no DRI3=no if test x$XQUARTZ = xauto; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Xquartz" >&5 $as_echo_n "checking whether to build Xquartz... " >&6; } if ${xorg_cv_Carbon_framework+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -framework Carbon" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ char FSFindFolder(); int main() { FSFindFolder(); return 0;} _ACEOF if ac_fn_c_try_link "$LINENO"; then : xorg_cv_Carbon_framework=yes else xorg_cv_Carbon_framework=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_Carbon_framework" >&5 $as_echo "$xorg_cv_Carbon_framework" >&6; } if test "X$xorg_cv_Carbon_framework" = Xyes; then XQUARTZ=yes else XQUARTZ=no fi fi ac_fn_c_check_func "$LINENO" "dispatch_async" "ac_cv_func_dispatch_async" if test "x$ac_cv_func_dispatch_async" = xyes; then : $as_echo "#define HAVE_LIBDISPATCH 1" >>confdefs.h fi if test "x$XQUARTZ" = xyes ; then XQUARTZ=yes XVFB=no XNEST=no XWAYLAND=no COMPOSITE=no DGA=no DPMSExtension=no XF86VIDMODE=no fi ;; *) XQUARTZ=no ;; esac XEXT_INC='-I$(top_srcdir)/Xext' XEXT_LIB='$(top_builddir)/Xext/libXext.la' VIDEOPROTO="videoproto" COMPOSITEPROTO="compositeproto >= 0.4" RECORDPROTO="recordproto >= 1.13.99.1" SCRNSAVERPROTO="scrnsaverproto >= 1.1" RESOURCEPROTO="resourceproto >= 1.2.0" DRIPROTO="xf86driproto >= 2.1.0" DRI2PROTO="dri2proto >= 2.8" DRI3PROTO="dri3proto >= 1.0" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" GLPROTO="glproto >= 1.4.17" DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" LIBXSHMFENCE="xshmfence >= 1.1" XPROTO="xproto >= 7.0.26" RANDRPROTO="randrproto >= 1.4.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" INPUTPROTO="inputproto >= 2.3" KBPROTO="kbproto >= 1.0.3" FONTSPROTO="fontsproto >= 2.1.3" FIXESPROTO="fixesproto >= 5.0" DAMAGEPROTO="damageproto >= 1.1" XCMISCPROTO="xcmiscproto >= 1.2.0" BIGREQSPROTO="bigreqsproto >= 1.1.0" XTRANS="xtrans >= 1.3.5" PRESENTPROTO="presentproto >= 1.0" LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" LIBDRM="libdrm >= 2.3.0" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" LIBXEXT="xext >= 1.0.99.4" LIBXFONT="xfont >= 1.4.2" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.12.901" LIBUDEV="libudev >= 143" LIBSELINUX="libselinux >= 2.0.86" LIBDBUS="dbus-1 >= 1.0" LIBPIXMAN="pixman-1 >= 0.27.2" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PIXMAN" >&5 $as_echo_n "checking for PIXMAN... " >&6; } if test -n "$PIXMAN_CFLAGS"; then pkg_cv_PIXMAN_CFLAGS="$PIXMAN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBPIXMAN\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBPIXMAN") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PIXMAN_CFLAGS=`$PKG_CONFIG --cflags "$LIBPIXMAN" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PIXMAN_LIBS"; then pkg_cv_PIXMAN_LIBS="$PIXMAN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBPIXMAN\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBPIXMAN") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PIXMAN_LIBS=`$PKG_CONFIG --libs "$LIBPIXMAN" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 PIXMAN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBPIXMAN" 2>&1` else PIXMAN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBPIXMAN" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PIXMAN_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBPIXMAN) were not met: $PIXMAN_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 PIXMAN_CFLAGS and PIXMAN_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 PIXMAN_CFLAGS and PIXMAN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else PIXMAN_CFLAGS=$pkg_cv_PIXMAN_CFLAGS PIXMAN_LIBS=$pkg_cv_PIXMAN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau" SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $KBPROTO $FONTSPROTO $LIBPIXMAN" # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES" # Check whether --with-systemd-daemon was given. if test "${with_systemd_daemon+set}" = set; then : withval=$with_systemd_daemon; WITH_SYSTEMD_DAEMON=$withval else WITH_SYSTEMD_DAEMON=auto fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_DAEMON" >&5 $as_echo_n "checking for SYSTEMD_DAEMON... " >&6; } if test -n "$SYSTEMD_DAEMON_CFLAGS"; then pkg_cv_SYSTEMD_DAEMON_CFLAGS="$SYSTEMD_DAEMON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-daemon\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd-daemon") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_DAEMON_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-daemon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SYSTEMD_DAEMON_LIBS"; then pkg_cv_SYSTEMD_DAEMON_LIBS="$SYSTEMD_DAEMON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-daemon\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd-daemon") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_DAEMON_LIBS=`$PKG_CONFIG --libs "libsystemd-daemon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 SYSTEMD_DAEMON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-daemon" 2>&1` else SYSTEMD_DAEMON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-daemon" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_DAEMON_PKG_ERRORS" >&5 HAVE_SYSTEMD_DAEMON=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_SYSTEMD_DAEMON=no else SYSTEMD_DAEMON_CFLAGS=$pkg_cv_SYSTEMD_DAEMON_CFLAGS SYSTEMD_DAEMON_LIBS=$pkg_cv_SYSTEMD_DAEMON_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_SYSTEMD_DAEMON=yes fi if test "x$WITH_SYSTEMD_DAEMON" = xauto; then WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON" fi if test "x$WITH_SYSTEMD_DAEMON" = xyes; then if test "x$HAVE_SYSTEMD_DAEMON" = xno; then as_fn_error $? "systemd support requested but no library has been found" "$LINENO" 5 fi $as_echo "#define HAVE_SYSTEMD_DAEMON 1" >>confdefs.h REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon" fi if test "x$HAVE_SYSTEMD_DAEMON" = "xyes"; then HAVE_SYSTEMD_DAEMON_TRUE= HAVE_SYSTEMD_DAEMON_FALSE='#' else HAVE_SYSTEMD_DAEMON_TRUE='#' HAVE_SYSTEMD_DAEMON_FALSE= fi if test "x$CONFIG_UDEV" = xyes && test "x$CONFIG_HAL" = xyes; then as_fn_error $? "Hotplugging through both libudev and hal not allowed" "$LINENO" 5 fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5 $as_echo_n "checking for UDEV... " >&6; } if test -n "$UDEV_CFLAGS"; then pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBUDEV\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBUDEV") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "$LIBUDEV" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UDEV_LIBS"; then pkg_cv_UDEV_LIBS="$UDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBUDEV\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBUDEV") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "$LIBUDEV" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBUDEV" 2>&1` else UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBUDEV" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UDEV_PKG_ERRORS" >&5 HAVE_LIBUDEV=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_LIBUDEV=no else UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS UDEV_LIBS=$pkg_cv_UDEV_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LIBUDEV=yes fi if test "x$CONFIG_UDEV" = xauto; then CONFIG_UDEV="$HAVE_LIBUDEV" $as_echo "#define HAVE_LIBUDEV 1" >>confdefs.h fi if test "x$CONFIG_UDEV" = xyes; then CONFIG_UDEV_TRUE= CONFIG_UDEV_FALSE='#' else CONFIG_UDEV_TRUE='#' CONFIG_UDEV_FALSE= fi if test "x$CONFIG_UDEV" = xyes; then 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 LIBS=$UDEV_LIBS for ac_func in udev_monitor_filter_add_match_tag do : ac_fn_c_check_func "$LINENO" "udev_monitor_filter_add_match_tag" "ac_cv_func_udev_monitor_filter_add_match_tag" if test "x$ac_cv_func_udev_monitor_filter_add_match_tag" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG 1 _ACEOF fi done for ac_func in udev_enumerate_add_match_tag do : ac_fn_c_check_func "$LINENO" "udev_enumerate_add_match_tag" "ac_cv_func_udev_enumerate_add_match_tag" if test "x$ac_cv_func_udev_enumerate_add_match_tag" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG 1 _ACEOF fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 $as_echo_n "checking for DBUS... " >&6; } if test -n "$DBUS_CFLAGS"; then pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDBUS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDBUS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "$LIBDBUS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_LIBS"; then pkg_cv_DBUS_LIBS="$DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDBUS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDBUS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "$LIBDBUS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBDBUS" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBDBUS" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_PKG_ERRORS" >&5 HAVE_DBUS=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_DBUS=no else DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS DBUS_LIBS=$pkg_cv_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_DBUS=yes fi if test "x$HAVE_DBUS" = xyes; then $as_echo "#define HAVE_DBUS 1" >>confdefs.h fi if test "x$HAVE_DBUS" = xyes; then HAVE_DBUS_TRUE= HAVE_DBUS_FALSE='#' else HAVE_DBUS_TRUE='#' HAVE_DBUS_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HAL" >&5 $as_echo_n "checking for HAL... " >&6; } if test -n "$HAL_CFLAGS"; then pkg_cv_HAL_CFLAGS="$HAL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hal\""; } >&5 ($PKG_CONFIG --exists --print-errors "hal") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_HAL_CFLAGS=`$PKG_CONFIG --cflags "hal" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$HAL_LIBS"; then pkg_cv_HAL_LIBS="$HAL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hal\""; } >&5 ($PKG_CONFIG --exists --print-errors "hal") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_HAL_LIBS=`$PKG_CONFIG --libs "hal" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 HAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hal" 2>&1` else HAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hal" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$HAL_PKG_ERRORS" >&5 HAVE_HAL=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_HAL=no else HAL_CFLAGS=$pkg_cv_HAL_CFLAGS HAL_LIBS=$pkg_cv_HAL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_HAL=yes fi if test "x$CONFIG_HAL" = xauto; then CONFIG_HAL="$HAVE_HAL" fi if test "x$CONFIG_HAL" = xyes; then if ! test "x$HAVE_HAL" = xyes; then as_fn_error $? "HAL hotplug API requested, but HAL is not installed." "$LINENO" 5 fi $as_echo "#define CONFIG_HAL 1" >>confdefs.h NEED_DBUS="yes" fi if test "x$CONFIG_HAL" = xyes; then CONFIG_HAL_TRUE= CONFIG_HAL_FALSE='#' else CONFIG_HAL_TRUE='#' CONFIG_HAL_FALSE= fi if test "x$SYSTEMD_LOGIND" = xauto; then if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then SYSTEMD_LOGIND=yes else SYSTEMD_LOGIND=no fi fi if test "x$SYSTEMD_LOGIND" = xyes; then if ! test "x$HAVE_DBUS" = xyes; then as_fn_error $? "systemd-logind requested, but D-Bus is not installed." "$LINENO" 5 fi if ! test "x$CONFIG_UDEV" = xyes ; then as_fn_error $? "systemd-logind is only supported in combination with udev configuration." "$LINENO" 5 fi $as_echo "#define SYSTEMD_LOGIND 1" >>confdefs.h NEED_DBUS="yes" fi if test "x$SYSTEMD_LOGIND" = xyes; then SYSTEMD_LOGIND_TRUE= SYSTEMD_LOGIND_FALSE='#' else SYSTEMD_LOGIND_TRUE='#' SYSTEMD_LOGIND_FALSE= fi if test "x$SUID_WRAPPER" = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDRM" >&5 $as_echo_n "checking for LIBDRM... " >&6; } if test -n "$LIBDRM_CFLAGS"; then pkg_cv_LIBDRM_CFLAGS="$LIBDRM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDRM\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDRM") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBDRM_CFLAGS=`$PKG_CONFIG --cflags "$LIBDRM" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBDRM_LIBS"; then pkg_cv_LIBDRM_LIBS="$LIBDRM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDRM\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDRM") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBDRM_LIBS=`$PKG_CONFIG --libs "$LIBDRM" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 LIBDRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBDRM" 2>&1` else LIBDRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBDRM" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBDRM_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBDRM) were not met: $LIBDRM_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 LIBDRM_CFLAGS and LIBDRM_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 LIBDRM_CFLAGS and LIBDRM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else LIBDRM_CFLAGS=$pkg_cv_LIBDRM_CFLAGS LIBDRM_LIBS=$pkg_cv_LIBDRM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$libexecdir\"" eval ac_define_dir="\"$ac_define_dir\"" SUID_WRAPPER_DIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define SUID_WRAPPER_DIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE SETUID="no" fi if test "x$SUID_WRAPPER" = xyes; then SUID_WRAPPER_TRUE= SUID_WRAPPER_FALSE='#' else SUID_WRAPPER_TRUE='#' SUID_WRAPPER_FALSE= fi if test "x$NEED_DBUS" = xyes; then $as_echo "#define NEED_DBUS 1" >>confdefs.h fi if test "x$NEED_DBUS" = xyes; then NEED_DBUS_TRUE= NEED_DBUS_FALSE='#' else NEED_DBUS_TRUE='#' NEED_DBUS_FALSE= fi if test "x$CONFIG_WSCONS" = xauto; then case $host_os in *openbsd*) CONFIG_WSCONS=yes; ;; *) CONFIG_WSCONS=no; ;; esac fi if test "x$CONFIG_WSCONS" = xyes; then CONFIG_WSCONS_TRUE= CONFIG_WSCONS_FALSE='#' else CONFIG_WSCONS_TRUE='#' CONFIG_WSCONS_FALSE= fi if test "x$CONFIG_WSCONS" = xyes; then $as_echo "#define CONFIG_WSCONS 1" >>confdefs.h fi if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then USE_SIGIO_BY_DEFAULT_VALUE=TRUE else USE_SIGIO_BY_DEFAULT_VALUE=FALSE fi cat >>confdefs.h <<_ACEOF #define USE_SIGIO_BY_DEFAULT $USE_SIGIO_BY_DEFAULT_VALUE _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc..." >&5 $as_echo_n "checking for glibc...... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <features.h> #ifndef __GLIBC__ #error #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : glibc=yes else glibc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibc" >&5 $as_echo "$glibc" >&6; } for ac_func in clock_gettime do : ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CLOCK_GETTIME 1 _ACEOF have_clock_gettime=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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 clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=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_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : have_clock_gettime=-lrt else have_clock_gettime=no fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a useful monotonic clock ..." >&5 $as_echo_n "checking for a useful monotonic clock ...... " >&6; } if ! test "x$have_clock_gettime" = xno; then if ! test "x$have_clock_gettime" = xyes; then CLOCK_LIBS="$have_clock_gettime" else CLOCK_LIBS="" fi LIBS_SAVE="$LIBS" LIBS="$CLOCK_LIBS" CPPFLAGS_SAVE="$CPPFLAGS" if test x"$glibc" = xyes; then CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L" fi if test "$cross_compiling" = yes; then : MONOTONIC_CLOCK="cross compiling" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <time.h> int main(int argc, char *argv[]) { struct timespec tp; if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) return 0; else return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : MONOTONIC_CLOCK=yes else MONOTONIC_CLOCK=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$LIBS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" else MONOTONIC_CLOCK=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MONOTONIC_CLOCK" >&5 $as_echo "$MONOTONIC_CLOCK" >&6; } if test "x$MONOTONIC_CLOCK" = xyes; then $as_echo "#define MONOTONIC_CLOCK 1" >>confdefs.h LIBS="$LIBS $CLOCK_LIBS" fi if test "x$XV" = xyes; then XV_TRUE= XV_FALSE='#' else XV_TRUE='#' XV_FALSE= fi if test "x$XV" = xyes; then $as_echo "#define XV 1" >>confdefs.h $as_echo "#define XvExtension 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $VIDEOPROTO" else XVMC=no fi if test "x$XVMC" = xyes; then XVMC_TRUE= XVMC_FALSE='#' else XVMC_TRUE='#' XVMC_FALSE= fi if test "x$XVMC" = xyes; then $as_echo "#define XvMCExtension 1" >>confdefs.h fi if test "x$COMPOSITE" = xyes; then COMPOSITE_TRUE= COMPOSITE_FALSE='#' else COMPOSITE_TRUE='#' COMPOSITE_FALSE= fi if test "x$COMPOSITE" = xyes; then $as_echo "#define COMPOSITE 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO" COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la' 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='#' else MITSHM_TRUE='#' MITSHM_FALSE= fi if test "x$MITSHM" = xyes; then $as_echo "#define MITSHM 1" >>confdefs.h $as_echo "#define HAS_SHM 1" >>confdefs.h fi if test "x$RECORD" = xyes; then RECORD_TRUE= RECORD_FALSE='#' else RECORD_TRUE='#' RECORD_FALSE= fi if test "x$RECORD" = xyes; then $as_echo "#define XRECORD 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO" RECORD_LIB='$(top_builddir)/record/librecord.la' fi if test "x$SCREENSAVER" = xyes; then SCREENSAVER_TRUE= SCREENSAVER_FALSE='#' else SCREENSAVER_TRUE='#' SCREENSAVER_FALSE= fi if test "x$SCREENSAVER" = xyes; then $as_echo "#define SCREENSAVER 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $SCRNSAVERPROTO" fi if test "x$RES" = xyes; then RES_TRUE= RES_FALSE='#' else RES_TRUE='#' RES_FALSE= fi if test "x$RES" = xyes; then $as_echo "#define RES 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $RESOURCEPROTO" fi if test "x$LISTEN_TCP" = xyes; then $as_echo "#define LISTEN_TCP 1" >>confdefs.h fi if test "x$LISTEN_UNIX" = xyes; then $as_echo "#define LISTEN_UNIX 1" >>confdefs.h fi if test "x$LISTEN_LOCAL" = xyes; then $as_echo "#define LISTEN_LOCAL 1" >>confdefs.h fi # The XRes extension may support client ID tracking only if it has # been specifically enabled. Client ID tracking is implicitly not # supported if XRes extension is disabled. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to track client ids" >&5 $as_echo_n "checking whether to track client ids... " >&6; } if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then $as_echo "#define CLIENTIDS 1" >>confdefs.h else CLIENTIDS=no fi if test "x$CLIENTIDS" = xyes; then case $host_os in openbsd*) SYS_LIBS="$SYS_LIBS -lkvm" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLIENTIDS" >&5 $as_echo "$CLIENTIDS" >&6; } if test "x$CLIENTIDS" = xyes; then CLIENTIDS_TRUE= CLIENTIDS_FALSE='#' else CLIENTIDS_TRUE='#' CLIENTIDS_FALSE= fi if test "x$DRI" = xyes; then DRI_TRUE= DRI_FALSE='#' else DRI_TRUE='#' DRI_FALSE= fi if test "x$DRI" = xyes; then $as_echo "#define XF86DRI 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI2PROTO" >&5 $as_echo_n "checking for DRI2PROTO... " >&6; } if test -n "$DRI2PROTO_CFLAGS"; then pkg_cv_DRI2PROTO_CFLAGS="$DRI2PROTO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DRI2PROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DRI2PROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRI2PROTO_CFLAGS=`$PKG_CONFIG --cflags "$DRI2PROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DRI2PROTO_LIBS"; then pkg_cv_DRI2PROTO_LIBS="$DRI2PROTO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DRI2PROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DRI2PROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRI2PROTO_LIBS=`$PKG_CONFIG --libs "$DRI2PROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DRI2PROTO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$DRI2PROTO" 2>&1` else DRI2PROTO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$DRI2PROTO" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRI2PROTO_PKG_ERRORS" >&5 HAVE_DRI2PROTO=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_DRI2PROTO=no else DRI2PROTO_CFLAGS=$pkg_cv_DRI2PROTO_CFLAGS DRI2PROTO_LIBS=$pkg_cv_DRI2PROTO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_DRI2PROTO=yes fi case "$DRI2,$HAVE_DRI2PROTO" in yes,no) as_fn_error $? "DRI2 requested, but dri2proto not found." "$LINENO" 5 ;; yes,yes | auto,yes) $as_echo "#define DRI2 1" >>confdefs.h DRI2=yes LIBGL="gl >= 9.2.0" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO" ;; esac if test "x$DRI2" = xyes; then DRI2_TRUE= DRI2_FALSE='#' else DRI2_TRUE='#' DRI2_FALSE= fi # Check whether --with-shared-memory-dir was given. if test "${with_shared_memory_dir+set}" = set; then : withval=$with_shared_memory_dir; else with_shared_memory_dir=yes fi shmdirs="/run/shm /var/tmp /tmp" case x"$with_shared_memory_dir" in xyes) for dir in $shmdirs; do case x"$with_shared_memory_dir" in xyes) echo Checking temp dir "$dir" if test -d "$dir"; then with_shared_memory_dir="$dir" fi ;; esac done ;; x/*) ;; xno) ;; *) as_fn_error $? "Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir" "$LINENO" 5 ;; esac case x"$with_shared_memory_dir" in xyes) as_fn_error $? "No directory found for shared memory temp files." "$LINENO" 5 ;; xno) ;; *) cat >>confdefs.h <<_ACEOF #define SHMDIR "$with_shared_memory_dir" _ACEOF ;; esac # Check whether --enable-xtrans-send-fds was given. if test "${enable_xtrans_send_fds+set}" = set; then : enableval=$enable_xtrans_send_fds; XTRANS_SEND_FDS=$enableval else XTRANS_SEND_FDS=auto fi case "x$XTRANS_SEND_FDS" in xauto) case "$host_os" in linux*|solaris*) XTRANS_SEND_FDS=yes ;; *) XTRANS_SEND_FDS=no ;; esac esac case "x$XTRANS_SEND_FDS" in xyes) $as_echo "#define XTRANS_SEND_FDS 1" >>confdefs.h ;; esac case "$DRI3,$XTRANS_SEND_FDS" in yes,yes | auto,yes) ;; yes,no) as_fn_error $? "DRI3 requested, but xtrans fd passing support not found." "$LINENO" 5 DRI3=no ;; no,*) ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: DRI3 disabled because xtrans fd passing support not found." >&5 $as_echo "$as_me: DRI3 disabled because xtrans fd passing support not found." >&6;} DRI3=no ;; esac pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI3PROTO" >&5 $as_echo_n "checking for DRI3PROTO... " >&6; } if test -n "$DRI3PROTO_CFLAGS"; then pkg_cv_DRI3PROTO_CFLAGS="$DRI3PROTO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DRI3PROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DRI3PROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRI3PROTO_CFLAGS=`$PKG_CONFIG --cflags "$DRI3PROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DRI3PROTO_LIBS"; then pkg_cv_DRI3PROTO_LIBS="$DRI3PROTO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DRI3PROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DRI3PROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRI3PROTO_LIBS=`$PKG_CONFIG --libs "$DRI3PROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DRI3PROTO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$DRI3PROTO" 2>&1` else DRI3PROTO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$DRI3PROTO" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRI3PROTO_PKG_ERRORS" >&5 HAVE_DRI3PROTO=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_DRI3PROTO=no else DRI3PROTO_CFLAGS=$pkg_cv_DRI3PROTO_CFLAGS DRI3PROTO_LIBS=$pkg_cv_DRI3PROTO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_DRI3PROTO=yes fi case "$DRI3,$HAVE_DRI3PROTO" in yes,yes | auto,yes) ;; yes,no) as_fn_error $? "DRI3 requested, but dri3proto not found." "$LINENO" 5 DRI3=no ;; no,*) ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: DRI3 disabled because dri3proto not found." >&5 $as_echo "$as_me: DRI3 disabled because dri3proto not found." >&6;} DRI3=no ;; esac for ac_func in sigaction do : ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" if test "x$ac_cv_func_sigaction" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGACTION 1 _ACEOF fi done BUSFAULT=no case x"$ac_cv_func_sigaction" in xyes) $as_echo "#define HAVE_SIGACTION 1" >>confdefs.h BUSFAULT=yes ;; esac case x"$BUSFAULT" in xyes) $as_echo "#define BUSFAULT 1" >>confdefs.h ;; esac if test x"$BUSFAULT" = xyes; then BUSFAULT_TRUE= BUSFAULT_FALSE='#' else BUSFAULT_TRUE='#' BUSFAULT_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHMFENCE" >&5 $as_echo_n "checking for XSHMFENCE... " >&6; } if test -n "$XSHMFENCE_CFLAGS"; then pkg_cv_XSHMFENCE_CFLAGS="$XSHMFENCE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXSHMFENCE\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXSHMFENCE") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XSHMFENCE_CFLAGS=`$PKG_CONFIG --cflags "$LIBXSHMFENCE" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XSHMFENCE_LIBS"; then pkg_cv_XSHMFENCE_LIBS="$XSHMFENCE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXSHMFENCE\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXSHMFENCE") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XSHMFENCE_LIBS=`$PKG_CONFIG --libs "$LIBXSHMFENCE" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XSHMFENCE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBXSHMFENCE" 2>&1` else XSHMFENCE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBXSHMFENCE" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XSHMFENCE_PKG_ERRORS" >&5 HAVE_XSHMFENCE=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_XSHMFENCE=no else XSHMFENCE_CFLAGS=$pkg_cv_XSHMFENCE_CFLAGS XSHMFENCE_LIBS=$pkg_cv_XSHMFENCE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_XSHMFENCE=yes fi if test "x$XSHMFENCE" = "xauto"; then XSHMFENCE="$HAVE_XSHMFENCE" fi if test "x$XSHMFENCE" = "xyes"; then if test "x$HAVE_XSHMFENCE" != "xyes"; then as_fn_error $? "xshmfence requested but not installed." "$LINENO" 5 fi $as_echo "#define HAVE_XSHMFENCE 1" >>confdefs.h REQUIRED_LIBS="$REQUIRED_LIBS $LIBXSHMFENCE" fi if test "x$XSHMFENCE" = xyes; then XSHMFENCE_TRUE= XSHMFENCE_FALSE='#' else XSHMFENCE_TRUE='#' XSHMFENCE_FALSE= fi case "$DRI3,$XSHMFENCE" in yes,yes | auto,yes) ;; yes,no) as_fn_error $? "DRI3 requested, but xshmfence not found." "$LINENO" 5 DRI3=no ;; no,*) ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: DRI3 disabled because xshmfence not found." >&5 $as_echo "$as_me: DRI3 disabled because xshmfence not found." >&6;} DRI3=no ;; esac case x"$DRI3" in xyes|xauto) DRI3=yes $as_echo "#define DRI3 1" >>confdefs.h DRI3_LIB='$(top_builddir)/dri3/libdri3.la' SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI3PROTO" { $as_echo "$as_me:${as_lineno-$LINENO}: DRI3 enabled" >&5 $as_echo "$as_me: DRI3 enabled" >&6;}; ;; esac if test "x$DRI3" = xyes; then DRI3_TRUE= DRI3_FALSE='#' else DRI3_TRUE='#' DRI3_FALSE= fi if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then if test "x$DRM" = xyes; then $as_echo "#define WITH_LIBDRM 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDRM" >&5 $as_echo_n "checking for LIBDRM... " >&6; } if test -n "$LIBDRM_CFLAGS"; then pkg_cv_LIBDRM_CFLAGS="$LIBDRM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDRM\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDRM") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBDRM_CFLAGS=`$PKG_CONFIG --cflags "$LIBDRM" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBDRM_LIBS"; then pkg_cv_LIBDRM_LIBS="$LIBDRM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDRM\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDRM") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBDRM_LIBS=`$PKG_CONFIG --libs "$LIBDRM" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 LIBDRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBDRM" 2>&1` else LIBDRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBDRM" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBDRM_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBDRM) were not met: $LIBDRM_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 LIBDRM_CFLAGS and LIBDRM_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 LIBDRM_CFLAGS and LIBDRM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else LIBDRM_CFLAGS=$pkg_cv_LIBDRM_CFLAGS LIBDRM_LIBS=$pkg_cv_LIBDRM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi fi if test "x$DRI2" = xyes; then save_CFLAGS=$CFLAGS CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <GL/gl.h> #include <GL/internal/dri_interface.h> #ifndef __DRI_DRI2 #error DRI2 extension not available. #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : HAVE_DRI2EXTENSION=yes else HAVE_DRI2EXTENSION=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$save_CFLAGS if test "x$HAVE_DRI2EXTENSION" = xyes; then $as_echo "#define DRI2_AIGLX 1" >>confdefs.h DRI2_AIGLX=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h." >&5 $as_echo "$as_me: DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h." >&6;} DRI2_AIGLX=no fi fi if test "x$DRI2_AIGLX" = xyes; then DRI2_AIGLX_TRUE= DRI2_AIGLX_FALSE='#' else DRI2_AIGLX_TRUE='#' DRI2_AIGLX_FALSE= fi if test "x$GLX" = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XLIB" >&5 $as_echo_n "checking for XLIB... " >&6; } if test -n "$XLIB_CFLAGS"; then pkg_cv_XLIB_CFLAGS="$XLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XLIB_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XLIB_LIBS"; then pkg_cv_XLIB_LIBS="$XLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XLIB_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1` else XLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (x11) were not met: $XLIB_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 XLIB_CFLAGS and XLIB_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XLIB_CFLAGS and XLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XLIB_CFLAGS=$pkg_cv_XLIB_CFLAGS XLIB_LIBS=$pkg_cv_XLIB_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 GL" >&5 $as_echo_n "checking for GL... " >&6; } if test -n "$GL_CFLAGS"; then pkg_cv_GL_CFLAGS="$GL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GLPROTO \$LIBGL\""; } >&5 ($PKG_CONFIG --exists --print-errors "$GLPROTO $LIBGL") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "$GLPROTO $LIBGL" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GL_LIBS"; then pkg_cv_GL_LIBS="$GL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GLPROTO \$LIBGL\""; } >&5 ($PKG_CONFIG --exists --print-errors "$GLPROTO $LIBGL") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "$GLPROTO $LIBGL" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$GLPROTO $LIBGL" 2>&1` else GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$GLPROTO $LIBGL" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GL_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($GLPROTO $LIBGL) were not met: $GL_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 GL_CFLAGS and GL_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 GL_CFLAGS and GL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else GL_CFLAGS=$pkg_cv_GL_CFLAGS GL_LIBS=$pkg_cv_GL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define GLXEXT 1" >>confdefs.h GLX_LIBS='$(top_builddir)/glx/libglx.la' GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS" else GLX=no fi if test "x$GLX" = xyes; then GLX_TRUE= GLX_FALSE='#' else GLX_TRUE='#' GLX_FALSE= fi if test "x$GLX" = xno; then AIGLX=no fi if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then $as_echo "#define AIGLX 1" >>confdefs.h fi if { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes; then AIGLX_DRI_LOADER_TRUE= AIGLX_DRI_LOADER_FALSE='#' else AIGLX_DRI_LOADER_TRUE='#' AIGLX_DRI_LOADER_FALSE= fi if test "x$GLX_USE_TLS" = xyes ; then GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" fi if test "x$PRESENT" = xyes; then PRESENT_TRUE= PRESENT_FALSE='#' else PRESENT_TRUE='#' PRESENT_FALSE= fi if test "x$PRESENT" = xyes; then $as_echo "#define PRESENT 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $PRESENTPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $PRESENTPROTO" PRESENT_INC='-I$(top_srcdir)/present' PRESENT_LIB='$(top_builddir)/present/libpresent.la' fi if test "x$XINERAMA" = xyes; then XINERAMA_TRUE= XINERAMA_FALSE='#' else XINERAMA_TRUE='#' XINERAMA_FALSE= fi if test "x$XINERAMA" = xyes; then $as_echo "#define XINERAMA 1" >>confdefs.h $as_echo "#define PANORAMIX 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO" fi if test "x$XACE" = xyes; then XACE_TRUE= XACE_FALSE='#' else XACE_TRUE='#' XACE_FALSE= fi if test "x$XACE" = xyes; then $as_echo "#define XACE 1" >>confdefs.h fi if test "x$XSELINUX" = xyes; then XSELINUX_TRUE= XSELINUX_FALSE='#' else XSELINUX_TRUE='#' XSELINUX_FALSE= fi if test "x$XSELINUX" = xyes; then if test "x$XACE" != xyes; then as_fn_error $? "cannot build SELinux extension without X-ACE" "$LINENO" 5 fi for ac_header in libaudit.h do : ac_fn_c_check_header_mongrel "$LINENO" "libaudit.h" "ac_cv_header_libaudit_h" "$ac_includes_default" if test "x$ac_cv_header_libaudit_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBAUDIT_H 1 _ACEOF else as_fn_error $? "SELinux extension requires audit system headers" "$LINENO" 5 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for audit_open in -laudit" >&5 $as_echo_n "checking for audit_open in -laudit... " >&6; } if ${ac_cv_lib_audit_audit_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-laudit $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 audit_open (); int main () { return audit_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_audit_audit_open=yes else ac_cv_lib_audit_audit_open=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_audit_audit_open" >&5 $as_echo "$ac_cv_lib_audit_audit_open" >&6; } if test "x$ac_cv_lib_audit_audit_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBAUDIT 1 _ACEOF LIBS="-laudit $LIBS" else as_fn_error $? "SELinux extension requires audit system library" "$LINENO" 5 fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SELINUX" >&5 $as_echo_n "checking for SELINUX... " >&6; } if test -n "$SELINUX_CFLAGS"; then pkg_cv_SELINUX_CFLAGS="$SELINUX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBSELINUX\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBSELINUX") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SELINUX_CFLAGS=`$PKG_CONFIG --cflags "$LIBSELINUX" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SELINUX_LIBS"; then pkg_cv_SELINUX_LIBS="$SELINUX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBSELINUX\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBSELINUX") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SELINUX_LIBS=`$PKG_CONFIG --libs "$LIBSELINUX" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 SELINUX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBSELINUX" 2>&1` else SELINUX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBSELINUX" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SELINUX_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBSELINUX) were not met: $SELINUX_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 SELINUX_CFLAGS and SELINUX_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 SELINUX_CFLAGS and SELINUX_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else SELINUX_CFLAGS=$pkg_cv_SELINUX_CFLAGS SELINUX_LIBS=$pkg_cv_SELINUX_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi SELINUX_LIBS="$SELINUX_LIBS -laudit" $as_echo "#define XSELINUX 1" >>confdefs.h fi if test "x$XCSECURITY" = xyes; then XCSECURITY_TRUE= XCSECURITY_FALSE='#' else XCSECURITY_TRUE='#' XCSECURITY_FALSE= fi if test "x$XCSECURITY" = xyes; then if test "x$XACE" != xyes; then as_fn_error $? "cannot build Security extension without X-ACE" "$LINENO" 5 fi $as_echo "#define XCSECURITY 1" >>confdefs.h fi if test "x$DBE" = xyes; then DBE_TRUE= DBE_FALSE='#' else DBE_TRUE='#' DBE_FALSE= fi 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 XF86BIGFONT_TRUE= XF86BIGFONT_FALSE='#' else XF86BIGFONT_TRUE='#' XF86BIGFONT_FALSE= fi if test "x$XF86BIGFONT" = xyes; then $as_echo "#define XF86BIGFONT 1" >>confdefs.h REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $BIGFONTPROTO" fi if test "x$DPMSExtension" = xyes; then DPMSExtension_TRUE= DPMSExtension_FALSE='#' else DPMSExtension_TRUE='#' DPMSExtension_FALSE= fi if test "x$DPMSExtension" = xyes; then $as_echo "#define DPMSExtension 1" >>confdefs.h fi $as_echo "#define RENDER 1" >>confdefs.h RENDER_LIB='$(top_builddir)/render/librender.la' RENDER_INC='-I$(top_srcdir)/render' $as_echo "#define RANDR 1" >>confdefs.h RANDR_LIB='$(top_builddir)/randr/librandr.la' RANDR_INC='-I$(top_srcdir)/randr' $as_echo "#define XFIXES 1" >>confdefs.h FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la' FIXES_INC='-I$(top_srcdir)/xfixes' $as_echo "#define DAMAGE 1" >>confdefs.h DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la' DAMAGE_INC='-I$(top_srcdir)/damageext' MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la' MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage' # XINPUT extension is integral part of the server $as_echo "#define XINPUT 1" >>confdefs.h XI_LIB='$(top_builddir)/Xi/libXi.la' XI_INC='-I$(top_srcdir)/Xi' if test "x$XF86UTILS" = xyes; then XF86UTILS_TRUE= XF86UTILS_FALSE='#' else XF86UTILS_TRUE='#' XF86UTILS_FALSE= fi if test "x$VGAHW" = xyes; then VGAHW_TRUE= VGAHW_FALSE='#' else VGAHW_TRUE='#' VGAHW_FALSE= fi if test "x$VBE" = xyes; then VBE_TRUE= VBE_FALSE='#' else VBE_TRUE='#' VBE_FALSE= fi if test "x$INT10MODULE" = xyes; then INT10MODULE_TRUE= INT10MODULE_FALSE='#' else INT10MODULE_TRUE='#' INT10MODULE_FALSE= fi $as_echo "#define SHAPE 1" >>confdefs.h prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XKBPATH\"" eval ac_define_dir="\"$ac_define_dir\"" XKB_BASE_DIRECTORY="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define XKB_BASE_DIRECTORY "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE # Check whether --with-xkb-bin-directory was given. if test "${with_xkb_bin_directory+set}" = set; then : withval=$with_xkb_bin_directory; XKB_BIN_DIRECTORY="$withval" else XKB_BIN_DIRECTORY="$bindir" fi prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XKB_BIN_DIRECTORY\"" eval ac_define_dir="\"$ac_define_dir\"" XKB_BIN_DIRECTORY="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define XKB_BIN_DIRECTORY "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` if [ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ] ; then XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" fi XKBOUTPUT=`echo $XKBOUTPUT/ | $SED 's|/*$|/|'` XKB_COMPILED_DIR=`echo $XKBOUTPUT | $SED 's|/*$||'` prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XKBOUTPUT\"" eval ac_define_dir="\"$ac_define_dir\"" XKM_OUTPUT_DIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define XKM_OUTPUT_DIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE if test "x$XKB_DFLT_RULES" = x; then case $host_os in linux*) XKB_DFLT_RULES="evdev" ;; *) XKB_DFLT_RULES="base" ;; esac fi cat >>confdefs.h <<_ACEOF #define XKB_DFLT_RULES "$XKB_DFLT_RULES" _ACEOF cat >>confdefs.h <<_ACEOF #define XKB_DFLT_MODEL "$XKB_DFLT_MODEL" _ACEOF cat >>confdefs.h <<_ACEOF #define XKB_DFLT_LAYOUT "$XKB_DFLT_LAYOUT" _ACEOF cat >>confdefs.h <<_ACEOF #define XKB_DFLT_VARIANT "$XKB_DFLT_VARIANT" _ACEOF cat >>confdefs.h <<_ACEOF #define XKB_DFLT_OPTIONS "$XKB_DFLT_OPTIONS" _ACEOF XKB_LIB='$(top_builddir)/xkb/libxkb.la' XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' REQUIRED_MODULES="$REQUIRED_MODULES xkbfile" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XDMCP" >&5 $as_echo_n "checking for XDMCP... " >&6; } if test -n "$XDMCP_CFLAGS"; then pkg_cv_XDMCP_CFLAGS="$XDMCP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xdmcp\""; } >&5 ($PKG_CONFIG --exists --print-errors "xdmcp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XDMCP_CFLAGS=`$PKG_CONFIG --cflags "xdmcp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XDMCP_LIBS"; then pkg_cv_XDMCP_LIBS="$XDMCP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xdmcp\""; } >&5 ($PKG_CONFIG --exists --print-errors "xdmcp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XDMCP_LIBS=`$PKG_CONFIG --libs "xdmcp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XDMCP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xdmcp" 2>&1` else XDMCP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xdmcp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XDMCP_PKG_ERRORS" >&5 have_libxdmcp="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libxdmcp="no" else XDMCP_CFLAGS=$pkg_cv_XDMCP_CFLAGS XDMCP_LIBS=$pkg_cv_XDMCP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_libxdmcp="yes" fi if test "x$have_libxdmcp" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XdmcpWrap in -lXdmcp" >&5 $as_echo_n "checking for XdmcpWrap in -lXdmcp... " >&6; } if ${ac_cv_lib_Xdmcp_XdmcpWrap+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXdmcp $XDMCP_LIBS $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 XdmcpWrap (); int main () { return XdmcpWrap (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xdmcp_XdmcpWrap=yes else ac_cv_lib_Xdmcp_XdmcpWrap=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_Xdmcp_XdmcpWrap" >&5 $as_echo "$ac_cv_lib_Xdmcp_XdmcpWrap" >&6; } if test "x$ac_cv_lib_Xdmcp_XdmcpWrap" = xyes; then : have_xdmcpwrap="yes" else have_xdmcpwrap="no" fi fi if test "x$XDMCP" = xauto; then if test "x$have_libxdmcp" = xyes; then XDMCP=yes else XDMCP=no fi fi if test "x$XDMAUTH" = xauto; then if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then XDMAUTH=yes else XDMAUTH=no fi fi if test "x$XDMCP" = xyes; then XDMCP_TRUE= XDMCP_FALSE='#' else XDMCP_TRUE='#' XDMCP_FALSE= fi if test "x$XDMCP" = xyes; then $as_echo "#define XDMCP 1" >>confdefs.h REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" XDMCP_MODULES="xdmcp" fi if test "x$XDMAUTH" = xyes; then XDMAUTH_TRUE= XDMAUTH_FALSE='#' else XDMAUTH_TRUE='#' XDMAUTH_FALSE= fi if test "x$XDMAUTH" = xyes; then $as_echo "#define HASXDMAUTH 1" >>confdefs.h if ! test "x$XDMCP" = xyes; then REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" XDMCP_MODULES="xdmcp" fi fi prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$FONTPATH\"" eval ac_define_dir="\"$ac_define_dir\"" COMPILEDDEFAULTFONTPATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define COMPILEDDEFAULTFONTPATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$SERVERCONFIG\"" eval ac_define_dir="\"$ac_define_dir\"" SERVER_MISC_CONFIG_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define SERVER_MISC_CONFIG_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$FONTROOTDIR\"" eval ac_define_dir="\"$ac_define_dir\"" BASE_FONT_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define BASE_FONT_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$dridriverdir\"" eval ac_define_dir="\"$ac_define_dir\"" DRI_DRIVER_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DRI_DRIVER_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE cat >>confdefs.h <<_ACEOF #define XVENDORNAME "$VENDOR_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define XVENDORNAMESHORT "$VENDOR_NAME_SHORT" _ACEOF cat >>confdefs.h <<_ACEOF #define XORG_DATE "$RELEASE_DATE" _ACEOF cat >>confdefs.h <<_ACEOF #define XORG_MAN_VERSION "$VENDOR_MAN_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define BUILDERADDR "$BUILDERADDR" _ACEOF if test -z "$OSNAME"; then OSNAME="UNKNOWN" fi cat >>confdefs.h <<_ACEOF #define OSNAME "$OSNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define OSVENDOR "$OSVENDOR" _ACEOF cat >>confdefs.h <<_ACEOF #define BUILDERSTRING "$BUILDERSTRING" _ACEOF cat >>confdefs.h <<_ACEOF #define VENDOR_NAME "$VENDOR_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define VENDOR_NAME_SHORT "$VENDOR_NAME_SHORT" _ACEOF cat >>confdefs.h <<_ACEOF #define VENDOR_RELEASE $VENDOR_RELEASE _ACEOF cat >>confdefs.h <<_ACEOF #define VENDOR_MAN_VERSION "$VENDOR_MAN_VERSION" _ACEOF $as_echo "#define NO_LIBCWRAPPER 1" >>confdefs.h if test "x$DEBUGGING" = xyes; then $as_echo "#define DEBUG 1" >>confdefs.h fi if test "x$DEBUGGING" = xyes; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi $as_echo "#define XTEST 1" >>confdefs.h $as_echo "#define XSYNC 1" >>confdefs.h $as_echo "#define XCMISC 1" >>confdefs.h $as_echo "#define BIGREQS 1" >>confdefs.h if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then DIX_LIB='$(top_builddir)/dix/dix.O' OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)' else DIX_LIB='$(top_builddir)/dix/libdix.la' OS_LIB='$(top_builddir)/os/libos.la' fi MAIN_LIB='$(top_builddir)/dix/libmain.la' MI_LIB='$(top_builddir)/mi/libmi.la' MI_EXT_LIB='$(top_builddir)/mi/libmiext.la' MI_INC='-I$(top_srcdir)/mi' FB_LIB='$(top_builddir)/fb/libfb.la' FB_INC='-I$(top_srcdir)/fb' MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow' MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la' MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync' MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la' CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' # SHA1 hashing # Check whether --with-sha1 was given. if test "${with_sha1+set}" = set; then : withval=$with_sha1; fi ac_fn_c_check_func "$LINENO" "SHA1Init" "ac_cv_func_SHA1Init" if test "x$ac_cv_func_SHA1Init" = xyes; then : HAVE_SHA1_IN_LIBC=yes fi if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then with_sha1=libc fi if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then as_fn_error $? "libc requested but not found" "$LINENO" 5 fi if test "x$with_sha1" = xlibc; then $as_echo "#define HAVE_SHA1_IN_LIBC 1" >>confdefs.h SHA1_LIBS="" fi ac_fn_c_check_func "$LINENO" "CC_SHA1_Init" "ac_cv_func_CC_SHA1_Init" if test "x$ac_cv_func_CC_SHA1_Init" = xyes; then : HAVE_SHA1_IN_COMMONCRYPTO=yes fi if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then with_sha1=CommonCrypto fi if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then as_fn_error $? "CommonCrypto requested but not found" "$LINENO" 5 fi if test "x$with_sha1" = xCommonCrypto; then $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 <windows.h> " 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 : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmd $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 SHA1Init (); int main () { return SHA1Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_md_SHA1Init=yes else ac_cv_lib_md_SHA1Init=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_md_SHA1Init" >&5 $as_echo "$ac_cv_lib_md_SHA1Init" >&6; } if test "x$ac_cv_lib_md_SHA1Init" = xyes; then : HAVE_LIBMD=yes fi if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then with_sha1=libmd fi if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then as_fn_error $? "libmd requested but not found" "$LINENO" 5 fi if test "x$with_sha1" = xlibmd; then $as_echo "#define HAVE_SHA1_IN_LIBMD 1" >>confdefs.h SHA1_LIBS=-lmd fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSHA1" >&5 $as_echo_n "checking for LIBSHA1... " >&6; } if test -n "$LIBSHA1_CFLAGS"; then pkg_cv_LIBSHA1_CFLAGS="$LIBSHA1_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsha1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsha1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBSHA1_CFLAGS=`$PKG_CONFIG --cflags "libsha1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBSHA1_LIBS"; then pkg_cv_LIBSHA1_LIBS="$LIBSHA1_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsha1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsha1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBSHA1_LIBS=`$PKG_CONFIG --libs "libsha1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 LIBSHA1_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsha1" 2>&1` else LIBSHA1_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsha1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBSHA1_PKG_ERRORS" >&5 HAVE_LIBSHA1=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_LIBSHA1=no else LIBSHA1_CFLAGS=$pkg_cv_LIBSHA1_CFLAGS LIBSHA1_LIBS=$pkg_cv_LIBSHA1_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LIBSHA1=yes fi if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then with_sha1=libsha1 fi if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then as_fn_error $? "libsha1 requested but not found" "$LINENO" 5 fi if test "x$with_sha1" = xlibsha1; then $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 : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgcrypt $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 gcry_md_open (); int main () { return gcry_md_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gcrypt_gcry_md_open=yes else ac_cv_lib_gcrypt_gcry_md_open=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_gcrypt_gcry_md_open" >&5 $as_echo "$ac_cv_lib_gcrypt_gcry_md_open" >&6; } if test "x$ac_cv_lib_gcrypt_gcry_md_open" = xyes; then : HAVE_LIBGCRYPT=yes fi if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then with_sha1=libgcrypt fi if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then as_fn_error $? "libgcrypt requested but not found" "$LINENO" 5 fi if test "x$with_sha1" = xlibgcrypt; then $as_echo "#define HAVE_SHA1_IN_LIBGCRYPT 1" >>confdefs.h SHA1_LIBS=-lgcrypt fi # We don't need all of the OpenSSL libraries, just libcrypto { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1_Init in -lcrypto" >&5 $as_echo_n "checking for SHA1_Init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA1_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $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 SHA1_Init (); int main () { return SHA1_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA1_Init=yes else ac_cv_lib_crypto_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_crypto_SHA1_Init" >&5 $as_echo "$ac_cv_lib_crypto_SHA1_Init" >&6; } if test "x$ac_cv_lib_crypto_SHA1_Init" = xyes; then : HAVE_LIBCRYPTO=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 $as_echo_n "checking for OPENSSL... " >&6; } if test -n "$OPENSSL_CFLAGS"; then pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$OPENSSL_LIBS"; then pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl" 2>&1` else OPENSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$OPENSSL_PKG_ERRORS" >&5 HAVE_OPENSSL_PKC=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_OPENSSL_PKC=no else OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_OPENSSL_PKC=yes fi if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then if test "x$with_sha1" = x; then with_sha1=libcrypto fi else if test "x$with_sha1" = xlibcrypto; then as_fn_error $? "OpenSSL libcrypto requested but not found" "$LINENO" 5 fi fi if test "x$with_sha1" = xlibcrypto; then if test "x$HAVE_LIBCRYPTO" = xyes; then SHA1_LIBS=-lcrypto else SHA1_LIBS="$OPENSSL_LIBS" SHA1_CFLAGS="$OPENSSL_CFLAGS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1 implementation" >&5 $as_echo_n "checking for SHA1 implementation... " >&6; } if test "x$with_sha1" = x; then as_fn_error $? "No suitable SHA1 implementation found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sha1" >&5 $as_echo "$with_sha1" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSERVERCFLAGS" >&5 $as_echo_n "checking for XSERVERCFLAGS... " >&6; } if test -n "$XSERVERCFLAGS_CFLAGS"; then pkg_cv_XSERVERCFLAGS_CFLAGS="$XSERVERCFLAGS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$REQUIRED_MODULES \$REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$REQUIRED_MODULES $REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XSERVERCFLAGS_CFLAGS=`$PKG_CONFIG --cflags "$REQUIRED_MODULES $REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XSERVERCFLAGS_LIBS"; then pkg_cv_XSERVERCFLAGS_LIBS="$XSERVERCFLAGS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$REQUIRED_MODULES \$REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$REQUIRED_MODULES $REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XSERVERCFLAGS_LIBS=`$PKG_CONFIG --libs "$REQUIRED_MODULES $REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XSERVERCFLAGS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$REQUIRED_MODULES $REQUIRED_LIBS" 2>&1` else XSERVERCFLAGS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$REQUIRED_MODULES $REQUIRED_LIBS" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XSERVERCFLAGS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($REQUIRED_MODULES $REQUIRED_LIBS) were not met: $XSERVERCFLAGS_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 XSERVERCFLAGS_CFLAGS and XSERVERCFLAGS_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XSERVERCFLAGS_CFLAGS and XSERVERCFLAGS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XSERVERCFLAGS_CFLAGS=$pkg_cv_XSERVERCFLAGS_CFLAGS XSERVERCFLAGS_LIBS=$pkg_cv_XSERVERCFLAGS_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 XSERVERLIBS" >&5 $as_echo_n "checking for XSERVERLIBS... " >&6; } if test -n "$XSERVERLIBS_CFLAGS"; then pkg_cv_XSERVERLIBS_CFLAGS="$XSERVERLIBS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XSERVERLIBS_CFLAGS=`$PKG_CONFIG --cflags "$REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XSERVERLIBS_LIBS"; then pkg_cv_XSERVERLIBS_LIBS="$XSERVERLIBS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XSERVERLIBS_LIBS=`$PKG_CONFIG --libs "$REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XSERVERLIBS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$REQUIRED_LIBS" 2>&1` else XSERVERLIBS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$REQUIRED_LIBS" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XSERVERLIBS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($REQUIRED_LIBS) were not met: $XSERVERLIBS_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 XSERVERLIBS_CFLAGS and XSERVERLIBS_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XSERVERLIBS_CFLAGS and XSERVERLIBS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XSERVERLIBS_CFLAGS=$pkg_cv_XSERVERLIBS_CFLAGS XSERVERLIBS_LIBS=$pkg_cv_XSERVERLIBS_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 LIBUNWIND" >&5 $as_echo_n "checking for LIBUNWIND... " >&6; } if test -n "$LIBUNWIND_CFLAGS"; then pkg_cv_LIBUNWIND_CFLAGS="$LIBUNWIND_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUNWIND_CFLAGS=`$PKG_CONFIG --cflags "libunwind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBUNWIND_LIBS"; then pkg_cv_LIBUNWIND_LIBS="$LIBUNWIND_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUNWIND_LIBS=`$PKG_CONFIG --libs "libunwind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libunwind" 2>&1` else LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libunwind" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBUNWIND_PKG_ERRORS" >&5 HAVE_LIBUNWIND=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_LIBUNWIND=no else LIBUNWIND_CFLAGS=$pkg_cv_LIBUNWIND_CFLAGS LIBUNWIND_LIBS=$pkg_cv_LIBUNWIND_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LIBUNWIND=yes fi if test "x$LIBUNWIND" = "xauto"; then LIBUNWIND="$HAVE_LIBUNWIND" fi if test "x$LIBUNWIND" = "xyes"; then if test "x$HAVE_LIBUNWIND" != "xyes"; then as_fn_error $? "libunwind requested but not installed." "$LINENO" 5 fi $as_echo "#define HAVE_LIBUNWIND 1" >>confdefs.h fi if test "x$LIBUNWIND" = xyes; then HAVE_LIBUNWIND_TRUE= HAVE_LIBUNWIND_FALSE='#' else HAVE_LIBUNWIND_TRUE='#' HAVE_LIBUNWIND_FALSE= fi # Autotools has some unfortunate issues with library handling. In order to # get a server to rebuild when a dependency in the tree is changed, it must # be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be # listed there, or some versions of autotools will break (especially if a -L # is required to find the library). So, we keep two sets of libraries # detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which # will go into the _DEPENDENCIES and _LDADD of the server, and # NAMESPACE_SYS_LIBS which will go into only the _LDADD. The # NAMESPACEMODULES_LIBS detected from pkgconfig should always go in # NAMESPACE_SYS_LIBS. # # XSERVER_LIBS is the set of in-tree libraries which all servers require. # XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers # require. # XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}" XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB" XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" UTILS_SYS_LIBS="${SYS_LIBS}" # The Xorg binary needs to export symbols so that they can be used from modules # Some platforms require extra flags to do this. libtool should set the # necessary flags for each platform when -export-dynamic is passed to it. LD_EXPORT_SYMBOLS_FLAG="-export-dynamic" LD_NO_UNDEFINED_FLAG= XORG_DRIVER_LIBS= case "$host_os" in cygwin*) LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a" LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a" XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined" CYGWIN=yes ;; solaris*) # We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT # that we can link against for testing if the system linker is new # enough to support -z parent=<program> for verifying loadable modules # are only calling functions defined in either the loading program or # the libraries they're linked with. 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 $as_echo_n "checking if SVR4 needs to be defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined(SVR4) || defined(__svr4__) || defined(__SVR4) I_AM_SVR4 #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "I_AM_SVR4" >/dev/null 2>&1; then : $as_echo "#define SVR4 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 $DBE_INC $PRESENT_INC" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Xvfb DDX" >&5 $as_echo_n "checking whether to build Xvfb DDX... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XVFB" >&5 $as_echo "$XVFB" >&6; } if test "x$XVFB" = xyes; then XVFB_TRUE= XVFB_FALSE='#' else XVFB_TRUE='#' XVFB_FALSE= fi if test "x$XVFB" = xyes; then XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XNESTMODULES" >&5 $as_echo_n "checking for XNESTMODULES... " >&6; } if test -n "$XNESTMODULES_CFLAGS"; then pkg_cv_XNESTMODULES_CFLAGS="$XNESTMODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXEXT x11 xau \$XDMCP_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXEXT x11 xau $XDMCP_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XNESTMODULES_CFLAGS=`$PKG_CONFIG --cflags "$LIBXEXT x11 xau $XDMCP_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XNESTMODULES_LIBS"; then pkg_cv_XNESTMODULES_LIBS="$XNESTMODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXEXT x11 xau \$XDMCP_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXEXT x11 xau $XDMCP_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XNESTMODULES_LIBS=`$PKG_CONFIG --libs "$LIBXEXT x11 xau $XDMCP_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XNESTMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBXEXT x11 xau $XDMCP_MODULES" 2>&1` else XNESTMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBXEXT x11 xau $XDMCP_MODULES" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XNESTMODULES_PKG_ERRORS" >&5 have_xnest=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_xnest=no else XNESTMODULES_CFLAGS=$pkg_cv_XNESTMODULES_CFLAGS XNESTMODULES_LIBS=$pkg_cv_XNESTMODULES_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_xnest=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Xnest DDX" >&5 $as_echo_n "checking whether to build Xnest DDX... " >&6; } if test "x$XNEST" = xauto; then XNEST="$have_xnest" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XNEST" >&5 $as_echo "$XNEST" >&6; } if test "x$XNEST" = xyes; then XNEST_TRUE= XNEST_FALSE='#' else XNEST_TRUE='#' XNEST_FALSE= fi if test "x$XNEST" = xyes; then if test "x$have_xnest" = xno; then as_fn_error $? "Xnest build explicitly requested, but required modules not found." "$LINENO" 5 fi XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Xorg DDX" >&5 $as_echo_n "checking whether to build Xorg DDX... " >&6; } if test "x$XORG" = xauto; then XORG="yes" case $host_os in cygwin*) XORG="no" ;; mingw*) XORG="no" ;; darwin*) XORG="no" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XORG" >&5 $as_echo "$XORG" >&6; } if test "x$XORG" = xyes; then XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' 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 $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB" symbol_visibility= have_visibility=disabled if test x$SYMBOL_VISIBILITY != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symbol visibility support" >&5 $as_echo_n "checking for symbol visibility support... " >&6; } if test x$GCC = xyes; then VISIBILITY_CFLAGS="-fvisibility=hidden" else if test x$SUNCC = xyes; then VISIBILITY_CFLAGS="-xldscope=hidden" else have_visibility=no fi fi if test x$have_visibility != xno; then save_CFLAGS="$CFLAGS" proto_inc=`$PKG_CONFIG --cflags xproto` CFLAGS="$CFLAGS $VISIBILITY_CFLAGS $proto_inc" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <X11/Xfuncproto.h> extern _X_HIDDEN int hidden_int; extern _X_EXPORT int public_int; extern _X_HIDDEN int hidden_int_func(void); extern _X_EXPORT int public_int_func(void); int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_visibility=yes else have_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$save_CFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_visibility" >&5 $as_echo "$have_visibility" >&6; } if test x$have_visibility != xno; then symbol_visibility=$VISIBILITY_CFLAGS XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS" XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS" fi fi xorg_bus_bsdpci=no xorg_bus_sparc=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Xorg PCI functions" >&5 $as_echo_n "checking whether to build Xorg PCI functions... " >&6; } if test "x$PCI" = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5 $as_echo_n "checking for PCIACCESS... " >&6; } if test -n "$PCIACCESS_CFLAGS"; then pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBPCIACCESS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBPCIACCESS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "$LIBPCIACCESS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PCIACCESS_LIBS"; then pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBPCIACCESS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBPCIACCESS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "$LIBPCIACCESS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBPCIACCESS" 2>&1` else PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBPCIACCESS" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PCIACCESS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBPCIACCESS) were not met: $PCIACCESS_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 PCIACCESS_CFLAGS and PCIACCESS_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 PCIACCESS_CFLAGS and PCIACCESS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS" XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $LIBDRM_LIBS" XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS" $as_echo "#define XSERVER_LIBPCIACCESS 1" >>confdefs.h prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$PCI_TXT_IDS_DIR\"" eval ac_define_dir="\"$ac_define_dir\"" PCI_TXT_IDS_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define PCI_TXT_IDS_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE case $host_os in gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*) xorg_bus_bsdpci="yes" ;; esac case $host_cpu in sparc*) xorg_bus_sparc="yes" ;; esac else if test "x$CONFIG_UDEV_KMS" = xyes; then as_fn_error $? "Platform device enumeration requires libpciaccess" "$LINENO" 5 fi if test "x$INT10MODULE" = xyes && test "x$INT10" != xstub; then as_fn_error $? "Cannot build int10 without libpciaccess" "$LINENO" 5 fi fi { $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*) XORG_OS_SUBDIR="linux" linux_acpi="no" case $host_cpu in alpha*) linux_alpha=yes ;; i*86|amd64*|x86_64*|ia64*) linux_acpi=$enable_linux_acpi ;; *) ;; esac for ac_header in linux/apm_bios.h do : ac_fn_c_check_header_mongrel "$LINENO" "linux/apm_bios.h" "ac_cv_header_linux_apm_bios_h" "$ac_includes_default" if test "x$ac_cv_header_linux_apm_bios_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_APM_BIOS_H 1 _ACEOF linux_apm=$enable_linux_apm fi done if test "x$linux_apm" = xyes -o "x$linux_acpi" = xyes; then $as_echo "#define XF86PM 1" >>confdefs.h fi ;; freebsd* | kfreebsd*-gnu | dragonfly*) XORG_OS_SUBDIR="bsd" ;; netbsd*) XORG_OS_SUBDIR="bsd" ;; openbsd*) if test "x$ac_cv_BSD_APM" = xyes \ -o "x$ac_cv_BSD_KQUEUE_APM" = xyes; then XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" fi XORG_OS_SUBDIR="bsd" ;; solaris*) XORG_OS_SUBDIR="solaris" XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" for ac_header in sys/kd.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/kd.h" "ac_cv_header_sys_kd_h" "$ac_includes_default" if test "x$ac_cv_header_sys_kd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_KD_H 1 _ACEOF fi done for ac_header in sys/vt.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/vt.h" "ac_cv_header_sys_vt_h" "$ac_includes_default" if test "x$ac_cv_header_sys_vt_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_VT_H 1 _ACEOF solaris_vt=yes else solaris_vt=no fi done # Check for minimum supported release { $as_echo "$as_me:${as_lineno-$LINENO}: checking Solaris version" >&5 $as_echo_n "checking Solaris version... " >&6; } OS_MINOR=`echo ${host_os}|$SED -e 's/^.*solaris2\.//' -e s'/\..*$//'` if test "${OS_MINOR}" -ge 7 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Solaris ${OS_MINOR}" >&5 $as_echo "Solaris ${OS_MINOR}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Solaris \`echo ${host_os}|$SED -e 's/^.*solaris//\`" >&5 $as_echo "Solaris \`echo ${host_os}|$SED -e 's/^.*solaris//\`" >&6; } fi if test "${OS_MINOR}" -lt 8 ; then as_fn_error $? "This release no longer supports Solaris versions older than Solaris 8." "$LINENO" 5 fi ac_fn_c_check_decl "$LINENO" "_LP64" "ac_cv_have_decl__LP64" "$ac_includes_default" if test "x$ac_cv_have_decl__LP64" = xyes; then : SOLARIS_64="yes" else SOLARIS_64="no" fi case $host_cpu in sparc*) SOLARIS_INOUT_ARCH="sparcv8plus" ;; i*86) if test x$SOLARIS_64 = xyes ; then SOLARIS_INOUT_ARCH="amd64" else SOLARIS_INOUT_ARCH="ia32" fi ;; *) as_fn_error $? "Unsupported Solaris platform. Only SPARC & x86 \ are supported on Solaris in this release. If you are \ interested in porting Xorg to your platform, please email \ xorg@lists.freedesktop.org." "$LINENO" 5 ;; esac ;; gnu*) XORG_OS_SUBDIR="hurd" ;; cygwin*) XORG_OS_SUBDIR="stub" ;; *) XORG_OS_SUBDIR="stub" { $as_echo "$as_me:${as_lineno-$LINENO}: Your OS is unknown. If you are interested in porting Xorg to your platform, please email xorg@lists.freedesktop.org." >&5 $as_echo "$as_me: Your OS is unknown. If you are interested in porting Xorg to your platform, please email xorg@lists.freedesktop.org." >&6;} ;; esac case $host_cpu in i*86) ;; esac if test "x$DGA" = xauto; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGA" >&5 $as_echo_n "checking for DGA... " >&6; } if test -n "$DGA_CFLAGS"; then pkg_cv_DGA_CFLAGS="$DGA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DGAPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DGAPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DGA_CFLAGS=`$PKG_CONFIG --cflags "$DGAPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DGA_LIBS"; then pkg_cv_DGA_LIBS="$DGA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DGAPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DGAPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DGA_LIBS=`$PKG_CONFIG --libs "$DGAPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DGA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$DGAPROTO" 2>&1` else DGA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$DGAPROTO" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DGA_PKG_ERRORS" >&5 DGA=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } DGA=no else DGA_CFLAGS=$pkg_cv_DGA_CFLAGS DGA_LIBS=$pkg_cv_DGA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } DGA=yes fi fi if test "x$DGA" = xyes; then XORG_MODULES="$XORG_MODULES $DGAPROTO" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGA" >&5 $as_echo_n "checking for DGA... " >&6; } if test -n "$DGA_CFLAGS"; then pkg_cv_DGA_CFLAGS="$DGA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DGAPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DGAPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DGA_CFLAGS=`$PKG_CONFIG --cflags "$DGAPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DGA_LIBS"; then pkg_cv_DGA_LIBS="$DGA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DGAPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$DGAPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DGA_LIBS=`$PKG_CONFIG --libs "$DGAPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DGA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$DGAPROTO" 2>&1` else DGA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$DGAPROTO" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DGA_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($DGAPROTO) were not met: $DGA_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 DGA_CFLAGS and DGA_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 DGA_CFLAGS and DGA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else DGA_CFLAGS=$pkg_cv_DGA_CFLAGS DGA_LIBS=$pkg_cv_DGA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define DGA 1" >>confdefs.h $as_echo "#define XFreeXDGA 1" >>confdefs.h fi if test "x$XF86VIDMODE" = xauto; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VIDMODE" >&5 $as_echo_n "checking for XF86VIDMODE... " >&6; } if test -n "$XF86VIDMODE_CFLAGS"; then pkg_cv_XF86VIDMODE_CFLAGS="$XF86VIDMODE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XF86VIDMODE_CFLAGS=`$PKG_CONFIG --cflags "$VIDMODEPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XF86VIDMODE_LIBS"; then pkg_cv_XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XF86VIDMODE_LIBS=`$PKG_CONFIG --libs "$VIDMODEPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1` else XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XF86VIDMODE_PKG_ERRORS" >&5 XF86VIDMODE=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } XF86VIDMODE=no else XF86VIDMODE_CFLAGS=$pkg_cv_XF86VIDMODE_CFLAGS XF86VIDMODE_LIBS=$pkg_cv_XF86VIDMODE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } XF86VIDMODE=yes fi fi if test "x$XF86VIDMODE" = xyes; then XORG_MODULES="$XORG_MODULES $VIDMODEPROTO" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VIDMODE" >&5 $as_echo_n "checking for XF86VIDMODE... " >&6; } if test -n "$XF86VIDMODE_CFLAGS"; then pkg_cv_XF86VIDMODE_CFLAGS="$XF86VIDMODE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XF86VIDMODE_CFLAGS=`$PKG_CONFIG --cflags "$VIDMODEPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XF86VIDMODE_LIBS"; then pkg_cv_XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XF86VIDMODE_LIBS=`$PKG_CONFIG --libs "$VIDMODEPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1` else XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XF86VIDMODE_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($VIDMODEPROTO) were not met: $XF86VIDMODE_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 XF86VIDMODE_CFLAGS and XF86VIDMODE_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XF86VIDMODE_CFLAGS=$pkg_cv_XF86VIDMODE_CFLAGS XF86VIDMODE_LIBS=$pkg_cv_XF86VIDMODE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define XF86VIDMODE 1" >>confdefs.h fi if test -n "$XORG_MODULES"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XORG_MODULES" >&5 $as_echo_n "checking for XORG_MODULES... " >&6; } if test -n "$XORG_MODULES_CFLAGS"; then pkg_cv_XORG_MODULES_CFLAGS="$XORG_MODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XORG_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$XORG_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XORG_MODULES_CFLAGS=`$PKG_CONFIG --cflags "$XORG_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XORG_MODULES_LIBS"; then pkg_cv_XORG_MODULES_LIBS="$XORG_MODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XORG_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$XORG_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XORG_MODULES_LIBS=`$PKG_CONFIG --libs "$XORG_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XORG_MODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$XORG_MODULES" 2>&1` else XORG_MODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$XORG_MODULES" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XORG_MODULES_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($XORG_MODULES) were not met: $XORG_MODULES_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 XORG_MODULES_CFLAGS and XORG_MODULES_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XORG_MODULES_CFLAGS and XORG_MODULES_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XORG_MODULES_CFLAGS=$pkg_cv_XORG_MODULES_CFLAGS XORG_MODULES_LIBS=$pkg_cv_XORG_MODULES_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS" XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" fi if test "x$DRM" = xyes; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm >= 2.4.46\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm >= 2.4.46") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : fi XORG_DRIVER_MODESETTING=yes fi XF86CONFIGFILE="xorg.conf" XF86CONFIGDIR="xorg.conf.d" CONFIGFILE="$sysconfdir/$XF86CONFIGFILE" LOGPREFIX="Xorg." XDG_DATA_HOME=".local/share" XDG_DATA_HOME_LOGDIR="xorg" $as_echo "#define XORG_SERVER 1" >>confdefs.h $as_echo "#define XORGSERVER 1" >>confdefs.h $as_echo "#define XFree86Server 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define XORG_VERSION_CURRENT $VENDOR_RELEASE _ACEOF $as_echo "#define NEED_XF86_TYPES 1" >>confdefs.h $as_echo "#define NEED_XF86_PROTOTYPES 1" >>confdefs.h $as_echo "#define __XSERVERNAME__ \"Xorg\"" >>confdefs.h prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XF86CONFIGFILE\"" eval ac_define_dir="\"$ac_define_dir\"" __XCONFIGFILE__="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define __XCONFIGFILE__ "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XF86CONFIGFILE\"" eval ac_define_dir="\"$ac_define_dir\"" XF86CONFIGFILE="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define XF86CONFIGFILE "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XF86CONFIGDIR\"" eval ac_define_dir="\"$ac_define_dir\"" __XCONFIGDIR__="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define __XCONFIGDIR__ "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$moduledir\"" eval ac_define_dir="\"$ac_define_dir\"" DEFAULT_MODULE_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFAULT_MODULE_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$libdir\"" eval ac_define_dir="\"$ac_define_dir\"" DEFAULT_LIBRARY_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFAULT_LIBRARY_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$logdir\"" eval ac_define_dir="\"$ac_define_dir\"" DEFAULT_LOGDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFAULT_LOGDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$LOGPREFIX\"" eval ac_define_dir="\"$ac_define_dir\"" DEFAULT_LOGPREFIX="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFAULT_LOGPREFIX "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XDG_DATA_HOME\"" eval ac_define_dir="\"$ac_define_dir\"" DEFAULT_XDG_DATA_HOME="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFAULT_XDG_DATA_HOME "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$XDG_DATA_HOME_LOGDIR\"" eval ac_define_dir="\"$ac_define_dir\"" DEFAULT_XDG_DATA_HOME_LOGDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFAULT_XDG_DATA_HOME_LOGDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE cat >>confdefs.h <<_ACEOF #define __VENDORDWEBSUPPORT__ "$VENDOR_WEB" _ACEOF if test "x$VGAHW" = xyes; then $as_echo "#define WITH_VGAHW 1" >>confdefs.h fi driverdir="$moduledir/drivers" sdkdir="$includedir/xorg" extdir="$includedir/X11/extensions" sysconfigdir="$datadir/X11/$XF86CONFIGDIR" # stuff the ABI versions into the pc file too extract_abi() { grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }' } abi_ansic=`extract_abi ANSIC` abi_videodrv=`extract_abi VIDEODRV` abi_xinput=`extract_abi XINPUT` abi_extension=`extract_abi EXTENSION` fi if test "x$XORG" = xyes; then XORG_TRUE= XORG_FALSE='#' else XORG_TRUE='#' XORG_FALSE= fi if test "x$PCI" = xyes; then XORG_BUS_PCI_TRUE= XORG_BUS_PCI_FALSE='#' else XORG_BUS_PCI_TRUE='#' XORG_BUS_PCI_FALSE= fi if test "x$xorg_bus_bsdpci" = xyes; then XORG_BUS_BSDPCI_TRUE= XORG_BUS_BSDPCI_FALSE='#' else XORG_BUS_BSDPCI_TRUE='#' XORG_BUS_BSDPCI_FALSE= fi if test "x$xorg_bus_sparc" = xyes; then XORG_BUS_SPARC_TRUE= XORG_BUS_SPARC_FALSE='#' else XORG_BUS_SPARC_TRUE='#' XORG_BUS_SPARC_FALSE= fi if test "x$linux_alpha" = xyes; then LINUX_ALPHA_TRUE= LINUX_ALPHA_FALSE='#' else LINUX_ALPHA_TRUE='#' LINUX_ALPHA_FALSE= fi if test "x$linux_acpi" = xyes; then LNXACPI_TRUE= LNXACPI_FALSE='#' else LNXACPI_TRUE='#' LNXACPI_FALSE= fi if test "x$linux_apm" = xyes; then LNXAPM_TRUE= LNXAPM_FALSE='#' else LNXAPM_TRUE='#' LNXAPM_FALSE= fi if test "x$solaris_vt" = xyes; then SOLARIS_VT_TRUE= SOLARIS_VT_FALSE='#' else SOLARIS_VT_TRUE='#' SOLARIS_VT_FALSE= fi if test "x$DGA" = xyes; then DGA_TRUE= DGA_FALSE='#' else DGA_TRUE='#' DGA_FALSE= fi if test "x$XF86VIDMODE" = xyes; then XF86VIDMODE_TRUE= XF86VIDMODE_FALSE='#' else XF86VIDMODE_TRUE='#' 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 if test "x$XORG_DRIVER_MODESETTING" = xyes; then XORG_DRIVER_MODESETTING_TRUE= XORG_DRIVER_MODESETTING_FALSE='#' else XORG_DRIVER_MODESETTING_TRUE='#' XORG_DRIVER_MODESETTING_FALSE= fi if test "x$GLAMOR" = xyes; then GLAMOR_TRUE= GLAMOR_FALSE='#' else GLAMOR_TRUE='#' GLAMOR_FALSE= fi if test "x$GLAMOR" = xyes; then $as_echo "#define GLAMOR 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLAMOR" >&5 $as_echo_n "checking for GLAMOR... " >&6; } if test -n "$GLAMOR_CFLAGS"; then pkg_cv_GLAMOR_CFLAGS="$GLAMOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"epoxy\""; } >&5 ($PKG_CONFIG --exists --print-errors "epoxy") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLAMOR_CFLAGS=`$PKG_CONFIG --cflags "epoxy" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLAMOR_LIBS"; then pkg_cv_GLAMOR_LIBS="$GLAMOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"epoxy\""; } >&5 ($PKG_CONFIG --exists --print-errors "epoxy") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLAMOR_LIBS=`$PKG_CONFIG --libs "epoxy" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 GLAMOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "epoxy" 2>&1` else GLAMOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "epoxy" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLAMOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (epoxy) were not met: $GLAMOR_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 GLAMOR_CFLAGS and GLAMOR_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 GLAMOR_CFLAGS and GLAMOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else GLAMOR_CFLAGS=$pkg_cv_GLAMOR_CFLAGS GLAMOR_LIBS=$pkg_cv_GLAMOR_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 GBM" >&5 $as_echo_n "checking for GBM... " >&6; } if test -n "$GBM_CFLAGS"; then pkg_cv_GBM_CFLAGS="$GBM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"\$LIBGBM\"\""; } >&5 ($PKG_CONFIG --exists --print-errors ""$LIBGBM"") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GBM_CFLAGS=`$PKG_CONFIG --cflags ""$LIBGBM"" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GBM_LIBS"; then pkg_cv_GBM_LIBS="$GBM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"\$LIBGBM\"\""; } >&5 ($PKG_CONFIG --exists --print-errors ""$LIBGBM"") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GBM_LIBS=`$PKG_CONFIG --libs ""$LIBGBM"" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 GBM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs ""$LIBGBM"" 2>&1` else GBM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs ""$LIBGBM"" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GBM_PKG_ERRORS" >&5 GBM=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } GBM=no else GBM_CFLAGS=$pkg_cv_GBM_CFLAGS GBM_LIBS=$pkg_cv_GBM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } GBM=yes fi if test "x$GBM" = xyes; then $as_echo "#define GLAMOR_HAS_GBM 1" >>confdefs.h fi fi if test "x$GBM" = xyes; then GLAMOR_EGL_TRUE= GLAMOR_EGL_FALSE='#' else GLAMOR_EGL_TRUE='#' GLAMOR_EGL_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build XWin DDX" >&5 $as_echo_n "checking whether to build XWin DDX... " >&6; } if test "x$XWIN" = xauto; then case $host_os in cygwin*) XWIN="yes" ;; mingw*) XWIN="yes" ;; *) XWIN="no" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XWIN" >&5 $as_echo "$XWIN" >&6; } if test "x$XWIN" = xyes; then prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$logdir\"" eval ac_define_dir="\"$ac_define_dir\"" DEFAULT_LOGDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFAULT_LOGDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE cat >>confdefs.h <<_ACEOF #define XORG_VERSION_CURRENT $VENDOR_RELEASE _ACEOF cat >>confdefs.h <<_ACEOF #define __VENDORDWEBSUPPORT__ "$VENDOR_WEB" _ACEOF if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_WINDRES+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$WINDRES"; then ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_WINDRES="${ac_tool_prefix}windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 $as_echo "$WINDRES" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_WINDRES"; then ac_ct_WINDRES=$WINDRES # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_WINDRES+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_WINDRES"; then ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_WINDRES="windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES if test -n "$ac_ct_WINDRES"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5 $as_echo "$ac_ct_WINDRES" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_WINDRES" = x; then WINDRES="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac WINDRES=$ac_ct_WINDRES fi else WINDRES="$ac_cv_prog_WINDRES" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XWINMODULES" >&5 $as_echo_n "checking for XWINMODULES... " >&6; } if test -n "$XWINMODULES_CFLAGS"; then pkg_cv_XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWINMODULES_CFLAGS=`$PKG_CONFIG --cflags "x11 xdmcp xau xfixes" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XWINMODULES_LIBS"; then pkg_cv_XWINMODULES_LIBS="$XWINMODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWINMODULES_LIBS=`$PKG_CONFIG --libs "x11 xdmcp xau xfixes" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` else XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XWINMODULES_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (x11 xdmcp xau xfixes) were not met: $XWINMODULES_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 XWINMODULES_CFLAGS and XWINMODULES_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XWINMODULES_CFLAGS and XWINMODULES_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XWINMODULES_CFLAGS=$pkg_cv_XWINMODULES_CFLAGS XWINMODULES_LIBS=$pkg_cv_XWINMODULES_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test "x$WINDOWSWM" = xauto; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$WINDOWSWMPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$WINDOWSWMPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then WINDOWSWM=yes else WINDOWSWM=no fi fi if test "x$WINDOWSWM" = xyes ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WINDOWSWM" >&5 $as_echo_n "checking for WINDOWSWM... " >&6; } if test -n "$WINDOWSWM_CFLAGS"; then pkg_cv_WINDOWSWM_CFLAGS="$WINDOWSWM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$WINDOWSWMPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$WINDOWSWMPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WINDOWSWM_CFLAGS=`$PKG_CONFIG --cflags "$WINDOWSWMPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$WINDOWSWM_LIBS"; then pkg_cv_WINDOWSWM_LIBS="$WINDOWSWM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$WINDOWSWMPROTO\""; } >&5 ($PKG_CONFIG --exists --print-errors "$WINDOWSWMPROTO") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WINDOWSWM_LIBS=`$PKG_CONFIG --libs "$WINDOWSWMPROTO" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 WINDOWSWM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$WINDOWSWMPROTO" 2>&1` else WINDOWSWM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$WINDOWSWMPROTO" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$WINDOWSWM_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($WINDOWSWMPROTO) were not met: $WINDOWSWM_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 WINDOWSWM_CFLAGS and WINDOWSWM_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 WINDOWSWM_CFLAGS and WINDOWSWM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else WINDOWSWM_CFLAGS=$pkg_cv_WINDOWSWM_CFLAGS WINDOWSWM_LIBS=$pkg_cv_WINDOWSWM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS" $as_echo "#define ROOTLESS 1" >>confdefs.h fi case $host_os in cygwin*) XWIN_SERVER_NAME=XWin $as_echo "#define HAS_DEVWINDOWS 1" >>confdefs.h ;; mingw*) XWIN_SERVER_NAME=Xming $as_echo "#define RELOCATE_PROJECTROOT 1" >>confdefs.h $as_echo "#define HAS_WINSOCK 1" >>confdefs.h 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 $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" if test "x$DEBUGGING" = xyes; then $as_echo "#define CYGDEBUG 1" >>confdefs.h $as_echo "#define CYGWINDOWING_DEBUG 1" >>confdefs.h $as_echo "#define CYGMULTIWINDOW_DEBUG 1" >>confdefs.h fi $as_echo "#define DDXOSVERRORF 1" >>confdefs.h $as_echo "#define DDXBEFORERESET 1" >>confdefs.h if test "x$XWIN" = xyes && test "x$AIGLX" = xyes ; then # Extract the first word of "python3", so it can be a program name with args. set dummy python3; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON3+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON3"; then ac_cv_prog_PYTHON3="$PYTHON3" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON3="python3" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON3=$ac_cv_prog_PYTHON3 if test -n "$PYTHON3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5 $as_echo "$PYTHON3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$PYTHON3"; then as_fn_error $? "python3 not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python module lxml" >&5 $as_echo_n "checking for python module lxml... " >&6; } $PYTHON3 -c "import lxml;" if test $? -ne 0 ; then as_fn_error $? "not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KHRONOS_OPENGL_REGISTRY" >&5 $as_echo_n "checking for KHRONOS_OPENGL_REGISTRY... " >&6; } if test -n "$KHRONOS_OPENGL_REGISTRY_CFLAGS"; then pkg_cv_KHRONOS_OPENGL_REGISTRY_CFLAGS="$KHRONOS_OPENGL_REGISTRY_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"khronos-opengl-registry\""; } >&5 ($PKG_CONFIG --exists --print-errors "khronos-opengl-registry") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_KHRONOS_OPENGL_REGISTRY_CFLAGS=`$PKG_CONFIG --cflags "khronos-opengl-registry" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$KHRONOS_OPENGL_REGISTRY_LIBS"; then pkg_cv_KHRONOS_OPENGL_REGISTRY_LIBS="$KHRONOS_OPENGL_REGISTRY_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"khronos-opengl-registry\""; } >&5 ($PKG_CONFIG --exists --print-errors "khronos-opengl-registry") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_KHRONOS_OPENGL_REGISTRY_LIBS=`$PKG_CONFIG --libs "khronos-opengl-registry" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 KHRONOS_OPENGL_REGISTRY_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "khronos-opengl-registry" 2>&1` else KHRONOS_OPENGL_REGISTRY_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "khronos-opengl-registry" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$KHRONOS_OPENGL_REGISTRY_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (khronos-opengl-registry) were not met: $KHRONOS_OPENGL_REGISTRY_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 KHRONOS_OPENGL_REGISTRY_CFLAGS and KHRONOS_OPENGL_REGISTRY_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 KHRONOS_OPENGL_REGISTRY_CFLAGS and KHRONOS_OPENGL_REGISTRY_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else KHRONOS_OPENGL_REGISTRY_CFLAGS=$pkg_cv_KHRONOS_OPENGL_REGISTRY_CFLAGS KHRONOS_OPENGL_REGISTRY_LIBS=$pkg_cv_KHRONOS_OPENGL_REGISTRY_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir` fi fi fi if test "x$XWIN" = xyes; then XWIN_TRUE= XWIN_FALSE='#' else XWIN_TRUE='#' XWIN_FALSE= fi if test "x$XWIN" = xyes; then XWIN_MULTIWINDOW_TRUE= XWIN_MULTIWINDOW_FALSE='#' else XWIN_MULTIWINDOW_TRUE='#' XWIN_MULTIWINDOW_FALSE= fi if test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes; then XWIN_MULTIWINDOWEXTWM_TRUE= XWIN_MULTIWINDOWEXTWM_FALSE='#' else XWIN_MULTIWINDOWEXTWM_TRUE='#' XWIN_MULTIWINDOWEXTWM_FALSE= fi if test "x$XWIN" = xyes; then XWIN_CLIPBOARD_TRUE= XWIN_CLIPBOARD_FALSE='#' else XWIN_CLIPBOARD_TRUE='#' XWIN_CLIPBOARD_FALSE= fi if test "x$XWIN" = xyes && test "x$AIGLX" = xyes; then XWIN_GLX_WINDOWS_TRUE= XWIN_GLX_WINDOWS_FALSE='#' else XWIN_GLX_WINDOWS_TRUE='#' XWIN_GLX_WINDOWS_FALSE= fi if test "x$XWIN" = xyes; then XWIN_RANDR_TRUE= XWIN_RANDR_FALSE='#' else XWIN_RANDR_TRUE='#' XWIN_RANDR_FALSE= fi if test "x$XWIN" = xyes && test "x$XV" = xyes; then XWIN_XV_TRUE= XWIN_XV_FALSE='#' else XWIN_XV_TRUE='#' XWIN_XV_FALSE= fi if test "x$XQUARTZ" = xyes; then $as_echo "#define XQUARTZ 1" >>confdefs.h $as_echo "#define ROOTLESS 1" >>confdefs.h XQUARTZ_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $PRESENT_LIB" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xp_init in -lXplugin" >&5 $as_echo_n "checking for xp_init in -lXplugin... " >&6; } if ${ac_cv_lib_Xplugin_xp_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXplugin $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 xp_init (); int main () { return xp_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xplugin_xp_init=yes else ac_cv_lib_Xplugin_xp_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_Xplugin_xp_init" >&5 $as_echo "$ac_cv_lib_Xplugin_xp_init" >&6; } if test "x$ac_cv_lib_Xplugin_xp_init" = xyes; then : : fi CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XPBPROXY" >&5 $as_echo_n "checking for XPBPROXY... " >&6; } if test -n "$XPBPROXY_CFLAGS"; then pkg_cv_XPBPROXY_CFLAGS="$XPBPROXY_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$APPLEWMPROTO \$LIBAPPLEWM xfixes x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$APPLEWMPROTO $LIBAPPLEWM xfixes x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XPBPROXY_CFLAGS=`$PKG_CONFIG --cflags "$APPLEWMPROTO $LIBAPPLEWM xfixes x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XPBPROXY_LIBS"; then pkg_cv_XPBPROXY_LIBS="$XPBPROXY_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$APPLEWMPROTO \$LIBAPPLEWM xfixes x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$APPLEWMPROTO $LIBAPPLEWM xfixes x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XPBPROXY_LIBS=`$PKG_CONFIG --libs "$APPLEWMPROTO $LIBAPPLEWM xfixes x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XPBPROXY_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$APPLEWMPROTO $LIBAPPLEWM xfixes x11" 2>&1` else XPBPROXY_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$APPLEWMPROTO $LIBAPPLEWM xfixes x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XPBPROXY_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($APPLEWMPROTO $LIBAPPLEWM xfixes x11) were not met: $XPBPROXY_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 XPBPROXY_CFLAGS and XPBPROXY_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XPBPROXY_CFLAGS and XPBPROXY_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XPBPROXY_CFLAGS=$pkg_cv_XPBPROXY_CFLAGS XPBPROXY_LIBS=$pkg_cv_XPBPROXY_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test "x$XQUARTZ_SPARKLE" = xyes ; then $as_echo "#define XQUARTZ_SPARKLE 1" >>confdefs.h fi if test "x$STANDALONE_XPBPROXY" = xyes ; then $as_echo "#define STANDALONE_XPBPROXY 1" >>confdefs.h fi fi if test "x$XQUARTZ" = xyes -o "x$XWIN" = xyes ; then PSEUDORAMIX_TRUE= PSEUDORAMIX_FALSE='#' else PSEUDORAMIX_TRUE='#' PSEUDORAMIX_FALSE= fi # Support for objc in autotools is minimal and not documented. OBJC='$(CC)' OBJCLD='$(CCLD)' OBJCLINK='$(LINK)' OBJCFLAGS='$(CFLAGS)' # internal, undocumented automake func follows :( depcc="$OBJC" am_compiler_list='gcc3 gcc' { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_OBJC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_OBJC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_OBJC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_OBJC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_OBJC_dependencies_compiler_type" >&5 $as_echo "$am_cv_OBJC_dependencies_compiler_type" >&6; } OBJCDEPMODE=depmode=$am_cv_OBJC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_OBJC_dependencies_compiler_type" = gcc3; then am__fastdepOBJC_TRUE= am__fastdepOBJC_FALSE='#' else am__fastdepOBJC_TRUE='#' am__fastdepOBJC_FALSE= fi if test "x$XQUARTZ" = xyes; then XQUARTZ_TRUE= XQUARTZ_FALSE='#' else XQUARTZ_TRUE='#' XQUARTZ_FALSE= fi if test "x$XQUARTZ_SPARKLE" != "xno"; then XQUARTZ_SPARKLE_TRUE= XQUARTZ_SPARKLE_FALSE='#' else XQUARTZ_SPARKLE_TRUE='#' XQUARTZ_SPARKLE_FALSE= fi if test "x$STANDALONE_XPBPROXY" = xyes; then STANDALONE_XPBPROXY_TRUE= STANDALONE_XPBPROXY_FALSE='#' else STANDALONE_XPBPROXY_TRUE='#' STANDALONE_XPBPROXY_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DMXMODULES" >&5 $as_echo_n "checking for DMXMODULES... " >&6; } if test -n "$DMXMODULES_CFLAGS"; then pkg_cv_DMXMODULES_CFLAGS="$DMXMODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmuu \$LIBXEXT x11 >= 1.6 xrender xfixes \$LIBXI \$DMXPROTO xau \$XDMCP_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXMODULES_CFLAGS=`$PKG_CONFIG --cflags "xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DMXMODULES_LIBS"; then pkg_cv_DMXMODULES_LIBS="$DMXMODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmuu \$LIBXEXT x11 >= 1.6 xrender xfixes \$LIBXI \$DMXPROTO xau \$XDMCP_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXMODULES_LIBS=`$PKG_CONFIG --libs "xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DMXMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES" 2>&1` else DMXMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DMXMODULES_PKG_ERRORS" >&5 have_dmx=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_dmx=no else DMXMODULES_CFLAGS=$pkg_cv_DMXMODULES_CFLAGS DMXMODULES_LIBS=$pkg_cv_DMXMODULES_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XDMXCONFIG_DEP" >&5 $as_echo_n "checking for XDMXCONFIG_DEP... " >&6; } if test -n "$XDMXCONFIG_DEP_CFLAGS"; then pkg_cv_XDMXCONFIG_DEP_CFLAGS="$XDMXCONFIG_DEP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 xmu xt xpm x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "xaw7 xmu xt xpm x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XDMXCONFIG_DEP_CFLAGS=`$PKG_CONFIG --cflags "xaw7 xmu xt xpm x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XDMXCONFIG_DEP_LIBS"; then pkg_cv_XDMXCONFIG_DEP_LIBS="$XDMXCONFIG_DEP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 xmu xt xpm x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "xaw7 xmu xt xpm x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XDMXCONFIG_DEP_LIBS=`$PKG_CONFIG --libs "xaw7 xmu xt xpm x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XDMXCONFIG_DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xaw7 xmu xt xpm x11" 2>&1` else XDMXCONFIG_DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xaw7 xmu xt xpm x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XDMXCONFIG_DEP_PKG_ERRORS" >&5 have_dmx=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_dmx=no else XDMXCONFIG_DEP_CFLAGS=$pkg_cv_XDMXCONFIG_DEP_CFLAGS XDMXCONFIG_DEP_LIBS=$pkg_cv_XDMXCONFIG_DEP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_dmx=yes fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Xdmx DDX" >&5 $as_echo_n "checking whether to build Xdmx DDX... " >&6; } if test "x$DMX" = xauto; then DMX="$have_dmx" case $host_os in cygwin*) DMX="no" ;; mingw*) DMX="no" ;; darwin*) DMX="no" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DMX" >&5 $as_echo "$DMX" >&6; } if test "x$DMX" = xyes; then DMX_TRUE= DMX_FALSE='#' else DMX_TRUE='#' DMX_FALSE= fi if test "x$DMX" = xyes; then if test "x$have_dmx" = xno; then as_fn_error $? "Xdmx build explicitly requested, but required modules not found." "$LINENO" 5 fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" ac_fn_c_check_header_mongrel "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" if test "x$ac_cv_header_linux_input_h" = xyes; then : DMX_BUILD_USB="yes" else DMX_BUILD_USB="no" fi ac_fn_c_check_header_mongrel "$LINENO" "linux/keyboard.h" "ac_cv_header_linux_keyboard_h" "$ac_includes_default" if test "x$ac_cv_header_linux_keyboard_h" = xyes; then : DMX_BUILD_LNX="yes" else DMX_BUILD_LNX="no" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DMXEXAMPLES_DEP" >&5 $as_echo_n "checking for DMXEXAMPLES_DEP... " >&6; } if test -n "$DMXEXAMPLES_DEP_CFLAGS"; then pkg_cv_DMXEXAMPLES_DEP_CFLAGS="$DMXEXAMPLES_DEP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDMX \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDMX $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXEXAMPLES_DEP_CFLAGS=`$PKG_CONFIG --cflags "$LIBDMX $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DMXEXAMPLES_DEP_LIBS"; then pkg_cv_DMXEXAMPLES_DEP_LIBS="$DMXEXAMPLES_DEP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDMX \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDMX $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXEXAMPLES_DEP_LIBS=`$PKG_CONFIG --libs "$LIBDMX $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DMXEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBDMX $LIBXEXT x11" 2>&1` else DMXEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBDMX $LIBXEXT x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DMXEXAMPLES_DEP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBDMX $LIBXEXT x11) were not met: $DMXEXAMPLES_DEP_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 DMXEXAMPLES_DEP_CFLAGS and DMXEXAMPLES_DEP_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 DMXEXAMPLES_DEP_CFLAGS and DMXEXAMPLES_DEP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else DMXEXAMPLES_DEP_CFLAGS=$pkg_cv_DMXEXAMPLES_DEP_CFLAGS DMXEXAMPLES_DEP_LIBS=$pkg_cv_DMXEXAMPLES_DEP_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 DMXXMUEXAMPLES_DEP" >&5 $as_echo_n "checking for DMXXMUEXAMPLES_DEP... " >&6; } if test -n "$DMXXMUEXAMPLES_DEP_CFLAGS"; then pkg_cv_DMXXMUEXAMPLES_DEP_CFLAGS="$DMXXMUEXAMPLES_DEP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDMX xmu \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDMX xmu $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXXMUEXAMPLES_DEP_CFLAGS=`$PKG_CONFIG --cflags "$LIBDMX xmu $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DMXXMUEXAMPLES_DEP_LIBS"; then pkg_cv_DMXXMUEXAMPLES_DEP_LIBS="$DMXXMUEXAMPLES_DEP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDMX xmu \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDMX xmu $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXXMUEXAMPLES_DEP_LIBS=`$PKG_CONFIG --libs "$LIBDMX xmu $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DMXXMUEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBDMX xmu $LIBXEXT x11" 2>&1` else DMXXMUEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBDMX xmu $LIBXEXT x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DMXXMUEXAMPLES_DEP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBDMX xmu $LIBXEXT x11) were not met: $DMXXMUEXAMPLES_DEP_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 DMXXMUEXAMPLES_DEP_CFLAGS and DMXXMUEXAMPLES_DEP_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 DMXXMUEXAMPLES_DEP_CFLAGS and DMXXMUEXAMPLES_DEP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else DMXXMUEXAMPLES_DEP_CFLAGS=$pkg_cv_DMXXMUEXAMPLES_DEP_CFLAGS DMXXMUEXAMPLES_DEP_LIBS=$pkg_cv_DMXXMUEXAMPLES_DEP_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 DMXXIEXAMPLES_DEP" >&5 $as_echo_n "checking for DMXXIEXAMPLES_DEP... " >&6; } if test -n "$DMXXIEXAMPLES_DEP_CFLAGS"; then pkg_cv_DMXXIEXAMPLES_DEP_CFLAGS="$DMXXIEXAMPLES_DEP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDMX \$LIBXI \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDMX $LIBXI $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXXIEXAMPLES_DEP_CFLAGS=`$PKG_CONFIG --cflags "$LIBDMX $LIBXI $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DMXXIEXAMPLES_DEP_LIBS"; then pkg_cv_DMXXIEXAMPLES_DEP_LIBS="$DMXXIEXAMPLES_DEP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBDMX \$LIBXI \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBDMX $LIBXI $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DMXXIEXAMPLES_DEP_LIBS=`$PKG_CONFIG --libs "$LIBDMX $LIBXI $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DMXXIEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBDMX $LIBXI $LIBXEXT x11" 2>&1` else DMXXIEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBDMX $LIBXI $LIBXEXT x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DMXXIEXAMPLES_DEP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBDMX $LIBXI $LIBXEXT x11) were not met: $DMXXIEXAMPLES_DEP_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 DMXXIEXAMPLES_DEP_CFLAGS and DMXXIEXAMPLES_DEP_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 DMXXIEXAMPLES_DEP_CFLAGS and DMXXIEXAMPLES_DEP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else DMXXIEXAMPLES_DEP_CFLAGS=$pkg_cv_DMXXIEXAMPLES_DEP_CFLAGS DMXXIEXAMPLES_DEP_LIBS=$pkg_cv_DMXXIEXAMPLES_DEP_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 XTSTEXAMPLES_DEP" >&5 $as_echo_n "checking for XTSTEXAMPLES_DEP... " >&6; } if test -n "$XTSTEXAMPLES_DEP_CFLAGS"; then pkg_cv_XTSTEXAMPLES_DEP_CFLAGS="$XTSTEXAMPLES_DEP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXTST \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXTST $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XTSTEXAMPLES_DEP_CFLAGS=`$PKG_CONFIG --cflags "$LIBXTST $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XTSTEXAMPLES_DEP_LIBS"; then pkg_cv_XTSTEXAMPLES_DEP_LIBS="$XTSTEXAMPLES_DEP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXTST \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXTST $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XTSTEXAMPLES_DEP_LIBS=`$PKG_CONFIG --libs "$LIBXTST $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XTSTEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBXTST $LIBXEXT x11" 2>&1` else XTSTEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBXTST $LIBXEXT x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XTSTEXAMPLES_DEP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBXTST $LIBXEXT x11) were not met: $XTSTEXAMPLES_DEP_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 XTSTEXAMPLES_DEP_CFLAGS and XTSTEXAMPLES_DEP_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XTSTEXAMPLES_DEP_CFLAGS and XTSTEXAMPLES_DEP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XTSTEXAMPLES_DEP_CFLAGS=$pkg_cv_XTSTEXAMPLES_DEP_CFLAGS XTSTEXAMPLES_DEP_LIBS=$pkg_cv_XTSTEXAMPLES_DEP_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 XRESEXAMPLES_DEP" >&5 $as_echo_n "checking for XRESEXAMPLES_DEP... " >&6; } if test -n "$XRESEXAMPLES_DEP_CFLAGS"; then pkg_cv_XRESEXAMPLES_DEP_CFLAGS="$XRESEXAMPLES_DEP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xres \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "xres $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XRESEXAMPLES_DEP_CFLAGS=`$PKG_CONFIG --cflags "xres $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XRESEXAMPLES_DEP_LIBS"; then pkg_cv_XRESEXAMPLES_DEP_LIBS="$XRESEXAMPLES_DEP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xres \$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "xres $LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XRESEXAMPLES_DEP_LIBS=`$PKG_CONFIG --libs "xres $LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XRESEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xres $LIBXEXT x11" 2>&1` else XRESEXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xres $LIBXEXT x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XRESEXAMPLES_DEP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xres $LIBXEXT x11) were not met: $XRESEXAMPLES_DEP_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 XRESEXAMPLES_DEP_CFLAGS and XRESEXAMPLES_DEP_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XRESEXAMPLES_DEP_CFLAGS and XRESEXAMPLES_DEP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XRESEXAMPLES_DEP_CFLAGS=$pkg_cv_XRESEXAMPLES_DEP_CFLAGS XRESEXAMPLES_DEP_LIBS=$pkg_cv_XRESEXAMPLES_DEP_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 X11EXAMPLES_DEP" >&5 $as_echo_n "checking for X11EXAMPLES_DEP... " >&6; } if test -n "$X11EXAMPLES_DEP_CFLAGS"; then pkg_cv_X11EXAMPLES_DEP_CFLAGS="$X11EXAMPLES_DEP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11EXAMPLES_DEP_CFLAGS=`$PKG_CONFIG --cflags "$LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$X11EXAMPLES_DEP_LIBS"; then pkg_cv_X11EXAMPLES_DEP_LIBS="$X11EXAMPLES_DEP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXEXT x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "$LIBXEXT x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11EXAMPLES_DEP_LIBS=`$PKG_CONFIG --libs "$LIBXEXT x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 X11EXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBXEXT x11" 2>&1` else X11EXAMPLES_DEP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBXEXT x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$X11EXAMPLES_DEP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($LIBXEXT x11) were not met: $X11EXAMPLES_DEP_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 X11EXAMPLES_DEP_CFLAGS and X11EXAMPLES_DEP_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 X11EXAMPLES_DEP_CFLAGS and X11EXAMPLES_DEP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else X11EXAMPLES_DEP_CFLAGS=$pkg_cv_X11EXAMPLES_DEP_CFLAGS X11EXAMPLES_DEP_LIBS=$pkg_cv_X11EXAMPLES_DEP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$DMX_BUILD_LNX" = xyes; then DMX_BUILD_LNX_TRUE= DMX_BUILD_LNX_FALSE='#' else DMX_BUILD_LNX_TRUE='#' DMX_BUILD_LNX_FALSE= fi if test "x$DMX_BUILD_USB" = xyes; then DMX_BUILD_USB_TRUE= DMX_BUILD_USB_FALSE='#' else DMX_BUILD_USB_TRUE='#' DMX_BUILD_USB_FALSE= fi XEPHYR_LIBS= XEPHYR_INCS= if test x$KDRIVE = xyes; then KDRIVE_TRUE= KDRIVE_FALSE='#' else KDRIVE_TRUE='#' KDRIVE_FALSE= fi if test "$KDRIVE" = yes; then $as_echo "#define KDRIVESERVER 1" >>confdefs.h $as_echo "#define KDRIVEDDXACTIONS /**/" >>confdefs.h for ac_header in linux/fb.h do : ac_fn_c_check_header_mongrel "$LINENO" "linux/fb.h" "ac_cv_header_linux_fb_h" "$ac_includes_default" if test "x$ac_cv_header_linux_fb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_FB_H 1 _ACEOF fi done if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then XFBDEV=yes fi if test "x$XFBDEV" = xyes; then KDRIVEFBDEVLIB=yes $as_echo "#define KDRIVEFBDEV 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TSLIB" >&5 $as_echo_n "checking for TSLIB... " >&6; } if test -n "$TSLIB_CFLAGS"; then pkg_cv_TSLIB_CFLAGS="$TSLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tslib-0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "tslib-0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TSLIB_CFLAGS=`$PKG_CONFIG --cflags "tslib-0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TSLIB_LIBS"; then pkg_cv_TSLIB_LIBS="$TSLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tslib-0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "tslib-0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TSLIB_LIBS=`$PKG_CONFIG --libs "tslib-0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 TSLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "tslib-0.0" 2>&1` else TSLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "tslib-0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TSLIB_PKG_ERRORS" >&5 HAVE_TSLIB="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_TSLIB="no" else TSLIB_CFLAGS=$pkg_cv_TSLIB_CFLAGS TSLIB_LIBS=$pkg_cv_TSLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_TSLIB="yes" fi if test "x$HAVE_TSLIB" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ts_open in -lts" >&5 $as_echo_n "checking for ts_open in -lts... " >&6; } if ${ac_cv_lib_ts_ts_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lts $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 ts_open (); int main () { return ts_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ts_ts_open=yes else ac_cv_lib_ts_ts_open=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_ts_ts_open" >&5 $as_echo "$ac_cv_lib_ts_ts_open" >&6; } if test "x$ac_cv_lib_ts_ts_open" = xyes; then : HAVE_TSLIB="yes" TSLIB_LIBS="-lts" fi fi if test "xTSLIB" = xauto; then TSLIB="$HAVE_TSLIB" fi if test "x$TSLIB" = xyes; then if ! test "x$HAVE_TSLIB" = xyes; then as_fn_error $? "tslib must be installed to build the tslib driver. See http://tslib.berlios.de/" "$LINENO" 5 else $as_echo "#define TSLIB 1" >>confdefs.h fi fi if test "x$KDRIVE_KBD" = xyes; then $as_echo "#define KDRIVE_KBD 1" >>confdefs.h fi if test "x$KDRIVE_EVDEV" = xyes; then $as_echo "#define KDRIVE_EVDEV 1" >>confdefs.h fi if test "x$KDRIVE_MOUSE" = xyes; then $as_echo "#define KDRIVE_MOUSE 1" >>confdefs.h fi XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi if test "x$DRI" = xyes && test "x$GLX" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6" fi if test "x$GLAMOR" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb" fi if test "x$XEPHYR" = xauto; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEPHYR" >&5 $as_echo_n "checking for XEPHYR... " >&6; } if test -n "$XEPHYR_CFLAGS"; then pkg_cv_XEPHYR_CFLAGS="$XEPHYR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XEPHYR_REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$XEPHYR_REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEPHYR_CFLAGS=`$PKG_CONFIG --cflags "$XEPHYR_REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XEPHYR_LIBS"; then pkg_cv_XEPHYR_LIBS="$XEPHYR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XEPHYR_REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$XEPHYR_REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEPHYR_LIBS=`$PKG_CONFIG --libs "$XEPHYR_REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XEPHYR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$XEPHYR_REQUIRED_LIBS" 2>&1` else XEPHYR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$XEPHYR_REQUIRED_LIBS" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XEPHYR_PKG_ERRORS" >&5 XEPHYR="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } XEPHYR="no" else XEPHYR_CFLAGS=$pkg_cv_XEPHYR_CFLAGS XEPHYR_LIBS=$pkg_cv_XEPHYR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } XEPHYR="yes" fi elif test "x$XEPHYR" = xyes ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEPHYR" >&5 $as_echo_n "checking for XEPHYR... " >&6; } if test -n "$XEPHYR_CFLAGS"; then pkg_cv_XEPHYR_CFLAGS="$XEPHYR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XEPHYR_REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$XEPHYR_REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEPHYR_CFLAGS=`$PKG_CONFIG --cflags "$XEPHYR_REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XEPHYR_LIBS"; then pkg_cv_XEPHYR_LIBS="$XEPHYR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XEPHYR_REQUIRED_LIBS\""; } >&5 ($PKG_CONFIG --exists --print-errors "$XEPHYR_REQUIRED_LIBS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEPHYR_LIBS=`$PKG_CONFIG --libs "$XEPHYR_REQUIRED_LIBS" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XEPHYR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$XEPHYR_REQUIRED_LIBS" 2>&1` else XEPHYR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$XEPHYR_REQUIRED_LIBS" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XEPHYR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($XEPHYR_REQUIRED_LIBS) were not met: $XEPHYR_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 XEPHYR_CFLAGS and XEPHYR_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}: result: no" >&5 $as_echo "no" >&6; } { { $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 XEPHYR_CFLAGS and XEPHYR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5; } else XEPHYR_CFLAGS=$pkg_cv_XEPHYR_CFLAGS XEPHYR_LIBS=$pkg_cv_XEPHYR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Xephyr needs nanosleep() which is in librt on Solaris ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nanosleep in -lrt" >&5 $as_echo_n "checking for nanosleep in -lrt... " >&6; } if ${ac_cv_lib_rt_nanosleep+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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 nanosleep (); int main () { return nanosleep (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_nanosleep=yes else ac_cv_lib_rt_nanosleep=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_rt_nanosleep" >&5 $as_echo "$ac_cv_lib_rt_nanosleep" >&6; } if test "x$ac_cv_lib_rt_nanosleep" = xyes; then : XEPHYR_LIBS="$XEPHYR_LIBS -lrt" fi fi # damage shadow extension glx (NOTYET) fb mi KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src' KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' case $host_os in *linux*) KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' KDRIVELINUX=yes if test "x$KDRIVE_EVDEV" = xauto; then KDRIVE_EVDEV=yes fi if test "x$KDRIVE_KBD" = xauto; then KDRIVE_KBD=yes fi if test "x$KDRIVE_MOUSE" = xauto; then KDRIVE_MOUSE=yes fi ;; *) if test "x$KDRIVE_EVDEV" = xauto; then KDRIVE_EVDEV=no fi if test "x$KDRIVE_KBD" = xauto; then KDRIVE_KBD=no fi if test "x$KDRIVE_MOUSE" = xauto; then KDRIVE_MOUSE=no fi ;; esac KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" fi if test "x$KDRIVELINUX" = xyes; then KDRIVELINUX_TRUE= KDRIVELINUX_FALSE='#' else KDRIVELINUX_TRUE='#' KDRIVELINUX_FALSE= fi if test "x$KDRIVE_EVDEV" = xyes; then KDRIVE_EVDEV_TRUE= KDRIVE_EVDEV_FALSE='#' else KDRIVE_EVDEV_TRUE='#' KDRIVE_EVDEV_FALSE= fi if test "x$KDRIVE_KBD" = xyes; then KDRIVE_KBD_TRUE= KDRIVE_KBD_FALSE='#' else KDRIVE_KBD_TRUE='#' KDRIVE_KBD_FALSE= fi if test "x$KDRIVE_MOUSE" = xyes; then KDRIVE_MOUSE_TRUE= KDRIVE_MOUSE_FALSE='#' else KDRIVE_MOUSE_TRUE='#' KDRIVE_MOUSE_FALSE= fi if test "x$HAVE_TSLIB" = xyes; then TSLIB_TRUE= TSLIB_FALSE='#' else TSLIB_TRUE='#' TSLIB_FALSE= fi if test "x$XFBDEV" = xyes; then KDRIVEFBDEV_TRUE= KDRIVEFBDEV_FALSE='#' else KDRIVEFBDEV_TRUE='#' KDRIVEFBDEV_FALSE= fi if test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes; then XEPHYR_TRUE= XEPHYR_FALSE='#' else XEPHYR_TRUE='#' XEPHYR_FALSE= fi if test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes; then BUILD_KDRIVEFBDEVLIB_TRUE= BUILD_KDRIVEFBDEVLIB_FALSE='#' else BUILD_KDRIVEFBDEVLIB_TRUE='#' BUILD_KDRIVEFBDEVLIB_FALSE= fi if test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes; then XFAKESERVER_TRUE= XFAKESERVER_FALSE='#' else XFAKESERVER_TRUE='#' XFAKESERVER_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XWAYLANDMODULES" >&5 $as_echo_n "checking for XWAYLANDMODULES... " >&6; } if test -n "$XWAYLANDMODULES_CFLAGS"; then pkg_cv_XWAYLANDMODULES_CFLAGS="$XWAYLANDMODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.3.0 libdrm epoxy\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.3.0 libdrm epoxy") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWAYLANDMODULES_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= 1.3.0 libdrm epoxy" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XWAYLANDMODULES_LIBS"; then pkg_cv_XWAYLANDMODULES_LIBS="$XWAYLANDMODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.3.0 libdrm epoxy\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.3.0 libdrm epoxy") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWAYLANDMODULES_LIBS=`$PKG_CONFIG --libs "wayland-client >= 1.3.0 libdrm epoxy" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XWAYLANDMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client >= 1.3.0 libdrm epoxy" 2>&1` else XWAYLANDMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client >= 1.3.0 libdrm epoxy" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XWAYLANDMODULES_PKG_ERRORS" >&5 have_xwayland=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_xwayland=no else XWAYLANDMODULES_CFLAGS=$pkg_cv_XWAYLANDMODULES_CFLAGS XWAYLANDMODULES_LIBS=$pkg_cv_XWAYLANDMODULES_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_xwayland=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Xwayland DDX" >&5 $as_echo_n "checking whether to build Xwayland DDX... " >&6; } if test "x$XWAYLAND" = xauto; then XWAYLAND="$have_xwayland" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XWAYLAND" >&5 $as_echo "$XWAYLAND" >&6; } if test "x$XWAYLAND" = xyes; then XWAYLAND_TRUE= XWAYLAND_FALSE='#' else XWAYLAND_TRUE='#' XWAYLAND_FALSE= fi if test "x$XWAYLAND" = xyes; then if test "x$have_xwayland" = xno; then as_fn_error $? "Xwayland build explicitly requested, but required modules not found." "$LINENO" 5 fi XWAYLAND_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS" WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` # Extract the first word of "wayland-scanner", so it can be a program name with args. set dummy wayland-scanner; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_WAYLAND_SCANNER+:} false; then : $as_echo_n "(cached) " >&6 else case $WAYLAND_SCANNER in [\\/]* | ?:[\\/]*) ac_cv_path_WAYLAND_SCANNER="$WAYLAND_SCANNER" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in ${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_WAYLAND_SCANNER="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi WAYLAND_SCANNER=$ac_cv_path_WAYLAND_SCANNER if test -n "$WAYLAND_SCANNER"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WAYLAND_SCANNER" >&5 $as_echo "$WAYLAND_SCANNER" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <features.h> #ifndef __GLIBC__ #error not glibc #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define _GNU_SOURCE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$prefix\"" eval ac_define_dir="\"$ac_define_dir\"" PROJECTROOT="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define PROJECTROOT "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$sysconfdir\"" eval ac_define_dir="\"$ac_define_dir\"" SYSCONFDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define SYSCONFDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE BUILD_DATE="`date +'%Y%m%d'`" BUILD_TIME="`date +'1%H%M%S'`" DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" ac_config_commands="$ac_config_commands sdksyms" if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *********************************************** Neither HAL nor udev backend will be enabled. Input device hotplugging will not be available! ***********************************************" >&5 $as_echo "$as_me: WARNING: *********************************************** Neither HAL nor udev backend will be enabled. Input device hotplugging will not be available! ***********************************************" >&2;} fi 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 glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh 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/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/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/xwin/winclipboard/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/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= 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 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DOT_TRUE}" && test -z "${HAVE_DOT_FALSE}"; then as_fn_error $? "conditional \"HAVE_DOT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_STYLESHEETS_TRUE}" && test -z "${HAVE_STYLESHEETS_FALSE}"; then as_fn_error $? "conditional \"HAVE_STYLESHEETS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DOCS_TRUE}" && test -z "${ENABLE_DOCS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DEVEL_DOCS_TRUE}" && test -z "${ENABLE_DEVEL_DOCS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEVEL_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_XMLTO_TEXT_TRUE}" && test -z "${HAVE_XMLTO_TEXT_FALSE}"; then as_fn_error $? "conditional \"HAVE_XMLTO_TEXT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_XMLTO_TRUE}" && test -z "${HAVE_XMLTO_FALSE}"; then as_fn_error $? "conditional \"HAVE_XMLTO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_FOP_TRUE}" && test -z "${HAVE_FOP_FALSE}"; then as_fn_error $? "conditional \"HAVE_FOP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_XSLTPROC_TRUE}" && test -z "${HAVE_XSLTPROC_FALSE}"; then as_fn_error $? "conditional \"HAVE_XSLTPROC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_UNIT_TESTS_TRUE}" && test -z "${ENABLE_UNIT_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_UNIT_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LD_WRAP_TRUE}" && test -z "${HAVE_LD_WRAP_FALSE}"; then as_fn_error $? "conditional \"HAVE_LD_WRAP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XSERVER_DTRACE_TRUE}" && test -z "${XSERVER_DTRACE_FALSE}"; then as_fn_error $? "conditional \"XSERVER_DTRACE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SPECIAL_DTRACE_OBJECTS_TRUE}" && test -z "${SPECIAL_DTRACE_OBJECTS_FALSE}"; then as_fn_error $? "conditional \"SPECIAL_DTRACE_OBJECTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AGP_TRUE}" && test -z "${AGP_FALSE}"; then as_fn_error $? "conditional \"AGP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FBDEVHW_TRUE}" && test -z "${FBDEVHW_FALSE}"; then as_fn_error $? "conditional \"FBDEVHW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FREEBSD_KLDLOAD_TRUE}" && test -z "${FREEBSD_KLDLOAD_FALSE}"; then as_fn_error $? "conditional \"FREEBSD_KLDLOAD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BSD_APM_TRUE}" && test -z "${BSD_APM_FALSE}"; then as_fn_error $? "conditional \"BSD_APM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BSD_KQUEUE_APM_TRUE}" && test -z "${BSD_KQUEUE_APM_FALSE}"; then as_fn_error $? "conditional \"BSD_KQUEUE_APM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ALPHA_VIDEO_TRUE}" && test -z "${ALPHA_VIDEO_FALSE}"; then as_fn_error $? "conditional \"ALPHA_VIDEO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ARM_VIDEO_TRUE}" && test -z "${ARM_VIDEO_FALSE}"; then as_fn_error $? "conditional \"ARM_VIDEO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${I386_VIDEO_TRUE}" && test -z "${I386_VIDEO_FALSE}"; then as_fn_error $? "conditional \"I386_VIDEO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PPC_VIDEO_TRUE}" && test -z "${PPC_VIDEO_FALSE}"; then as_fn_error $? "conditional \"PPC_VIDEO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SPARC64_VIDEO_TRUE}" && test -z "${SPARC64_VIDEO_FALSE}"; then as_fn_error $? "conditional \"SPARC64_VIDEO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_SETUID_TRUE}" && test -z "${INSTALL_SETUID_FALSE}"; then as_fn_error $? "conditional \"INSTALL_SETUID\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SECURE_RPC_TRUE}" && test -z "${SECURE_RPC_FALSE}"; then as_fn_error $? "conditional \"SECURE_RPC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INT10_VM86_TRUE}" && test -z "${INT10_VM86_FALSE}"; then as_fn_error $? "conditional \"INT10_VM86\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INT10_X86EMU_TRUE}" && test -z "${INT10_X86EMU_FALSE}"; then as_fn_error $? "conditional \"INT10_X86EMU\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INT10_STUB_TRUE}" && test -z "${INT10_STUB_FALSE}"; then as_fn_error $? "conditional \"INT10_STUB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LIBXF86CONFIG_TRUE}" && test -z "${INSTALL_LIBXF86CONFIG_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LIBXF86CONFIG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SYSTEMD_DAEMON_TRUE}" && test -z "${HAVE_SYSTEMD_DAEMON_FALSE}"; then as_fn_error $? "conditional \"HAVE_SYSTEMD_DAEMON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi 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 fi if test -z "${CONFIG_HAL_TRUE}" && test -z "${CONFIG_HAL_FALSE}"; then as_fn_error $? "conditional \"CONFIG_HAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SYSTEMD_LOGIND_TRUE}" && test -z "${SYSTEMD_LOGIND_FALSE}"; then as_fn_error $? "conditional \"SYSTEMD_LOGIND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SUID_WRAPPER_TRUE}" && test -z "${SUID_WRAPPER_FALSE}"; then as_fn_error $? "conditional \"SUID_WRAPPER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NEED_DBUS_TRUE}" && test -z "${NEED_DBUS_FALSE}"; then as_fn_error $? "conditional \"NEED_DBUS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONFIG_WSCONS_TRUE}" && test -z "${CONFIG_WSCONS_FALSE}"; then as_fn_error $? "conditional \"CONFIG_WSCONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XV_TRUE}" && test -z "${XV_FALSE}"; then as_fn_error $? "conditional \"XV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XVMC_TRUE}" && test -z "${XVMC_FALSE}"; then as_fn_error $? "conditional \"XVMC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COMPOSITE_TRUE}" && test -z "${COMPOSITE_FALSE}"; then as_fn_error $? "conditional \"COMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MITSHM_TRUE}" && test -z "${MITSHM_FALSE}"; then as_fn_error $? "conditional \"MITSHM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${RECORD_TRUE}" && test -z "${RECORD_FALSE}"; then as_fn_error $? "conditional \"RECORD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SCREENSAVER_TRUE}" && test -z "${SCREENSAVER_FALSE}"; then as_fn_error $? "conditional \"SCREENSAVER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${RES_TRUE}" && test -z "${RES_FALSE}"; then as_fn_error $? "conditional \"RES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CLIENTIDS_TRUE}" && test -z "${CLIENTIDS_FALSE}"; then as_fn_error $? "conditional \"CLIENTIDS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DRI_TRUE}" && test -z "${DRI_FALSE}"; then as_fn_error $? "conditional \"DRI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DRI2_TRUE}" && test -z "${DRI2_FALSE}"; then as_fn_error $? "conditional \"DRI2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUSFAULT_TRUE}" && test -z "${BUSFAULT_FALSE}"; then as_fn_error $? "conditional \"BUSFAULT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XSHMFENCE_TRUE}" && test -z "${XSHMFENCE_FALSE}"; then as_fn_error $? "conditional \"XSHMFENCE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DRI3_TRUE}" && test -z "${DRI3_FALSE}"; then as_fn_error $? "conditional \"DRI3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DRI2_AIGLX_TRUE}" && test -z "${DRI2_AIGLX_FALSE}"; then as_fn_error $? "conditional \"DRI2_AIGLX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GLX_TRUE}" && test -z "${GLX_FALSE}"; then as_fn_error $? "conditional \"GLX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AIGLX_DRI_LOADER_TRUE}" && test -z "${AIGLX_DRI_LOADER_FALSE}"; then as_fn_error $? "conditional \"AIGLX_DRI_LOADER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PRESENT_TRUE}" && test -z "${PRESENT_FALSE}"; then as_fn_error $? "conditional \"PRESENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XINERAMA_TRUE}" && test -z "${XINERAMA_FALSE}"; then as_fn_error $? "conditional \"XINERAMA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XACE_TRUE}" && test -z "${XACE_FALSE}"; then as_fn_error $? "conditional \"XACE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XSELINUX_TRUE}" && test -z "${XSELINUX_FALSE}"; then as_fn_error $? "conditional \"XSELINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XCSECURITY_TRUE}" && test -z "${XCSECURITY_FALSE}"; then as_fn_error $? "conditional \"XCSECURITY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DBE_TRUE}" && test -z "${DBE_FALSE}"; then as_fn_error $? "conditional \"DBE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XF86BIGFONT_TRUE}" && test -z "${XF86BIGFONT_FALSE}"; then as_fn_error $? "conditional \"XF86BIGFONT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DPMSExtension_TRUE}" && test -z "${DPMSExtension_FALSE}"; then as_fn_error $? "conditional \"DPMSExtension\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi 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 "${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 fi if test -z "${VBE_TRUE}" && test -z "${VBE_FALSE}"; then as_fn_error $? "conditional \"VBE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INT10MODULE_TRUE}" && test -z "${INT10MODULE_FALSE}"; then as_fn_error $? "conditional \"INT10MODULE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XDMCP_TRUE}" && test -z "${XDMCP_FALSE}"; then as_fn_error $? "conditional \"XDMCP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XDMAUTH_TRUE}" && test -z "${XDMAUTH_FALSE}"; then as_fn_error $? "conditional \"XDMAUTH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi 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 "${HAVE_LIBUNWIND_TRUE}" && test -z "${HAVE_LIBUNWIND_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBUNWIND\" 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 fi if test -z "${XNEST_TRUE}" && test -z "${XNEST_FALSE}"; then as_fn_error $? "conditional \"XNEST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XORG_TRUE}" && test -z "${XORG_FALSE}"; then as_fn_error $? "conditional \"XORG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XORG_BUS_PCI_TRUE}" && test -z "${XORG_BUS_PCI_FALSE}"; then as_fn_error $? "conditional \"XORG_BUS_PCI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XORG_BUS_BSDPCI_TRUE}" && test -z "${XORG_BUS_BSDPCI_FALSE}"; then as_fn_error $? "conditional \"XORG_BUS_BSDPCI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XORG_BUS_SPARC_TRUE}" && test -z "${XORG_BUS_SPARC_FALSE}"; then as_fn_error $? "conditional \"XORG_BUS_SPARC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LINUX_ALPHA_TRUE}" && test -z "${LINUX_ALPHA_FALSE}"; then as_fn_error $? "conditional \"LINUX_ALPHA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LNXACPI_TRUE}" && test -z "${LNXACPI_FALSE}"; then as_fn_error $? "conditional \"LNXACPI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LNXAPM_TRUE}" && test -z "${LNXAPM_FALSE}"; then as_fn_error $? "conditional \"LNXAPM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SOLARIS_VT_TRUE}" && test -z "${SOLARIS_VT_FALSE}"; then as_fn_error $? "conditional \"SOLARIS_VT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DGA_TRUE}" && test -z "${DGA_FALSE}"; then as_fn_error $? "conditional \"DGA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi 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 "${XORG_DRIVER_MODESETTING_TRUE}" && test -z "${XORG_DRIVER_MODESETTING_FALSE}"; then as_fn_error $? "conditional \"XORG_DRIVER_MODESETTING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GLAMOR_TRUE}" && test -z "${GLAMOR_FALSE}"; then as_fn_error $? "conditional \"GLAMOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GLAMOR_EGL_TRUE}" && test -z "${GLAMOR_EGL_FALSE}"; then as_fn_error $? "conditional \"GLAMOR_EGL\" 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 fi if test -z "${XWIN_MULTIWINDOW_TRUE}" && test -z "${XWIN_MULTIWINDOW_FALSE}"; then as_fn_error $? "conditional \"XWIN_MULTIWINDOW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XWIN_MULTIWINDOWEXTWM_TRUE}" && test -z "${XWIN_MULTIWINDOWEXTWM_FALSE}"; then as_fn_error $? "conditional \"XWIN_MULTIWINDOWEXTWM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XWIN_CLIPBOARD_TRUE}" && test -z "${XWIN_CLIPBOARD_FALSE}"; then as_fn_error $? "conditional \"XWIN_CLIPBOARD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XWIN_GLX_WINDOWS_TRUE}" && test -z "${XWIN_GLX_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"XWIN_GLX_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XWIN_RANDR_TRUE}" && test -z "${XWIN_RANDR_FALSE}"; then as_fn_error $? "conditional \"XWIN_RANDR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XWIN_XV_TRUE}" && test -z "${XWIN_XV_FALSE}"; then as_fn_error $? "conditional \"XWIN_XV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PSEUDORAMIX_TRUE}" && test -z "${PSEUDORAMIX_FALSE}"; then as_fn_error $? "conditional \"PSEUDORAMIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepOBJC_TRUE}" && test -z "${am__fastdepOBJC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepOBJC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XQUARTZ_TRUE}" && test -z "${XQUARTZ_FALSE}"; then as_fn_error $? "conditional \"XQUARTZ\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XQUARTZ_SPARKLE_TRUE}" && test -z "${XQUARTZ_SPARKLE_FALSE}"; then as_fn_error $? "conditional \"XQUARTZ_SPARKLE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STANDALONE_XPBPROXY_TRUE}" && test -z "${STANDALONE_XPBPROXY_FALSE}"; then as_fn_error $? "conditional \"STANDALONE_XPBPROXY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DMX_TRUE}" && test -z "${DMX_FALSE}"; then as_fn_error $? "conditional \"DMX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DMX_BUILD_LNX_TRUE}" && test -z "${DMX_BUILD_LNX_FALSE}"; then as_fn_error $? "conditional \"DMX_BUILD_LNX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DMX_BUILD_USB_TRUE}" && test -z "${DMX_BUILD_USB_FALSE}"; then as_fn_error $? "conditional \"DMX_BUILD_USB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${KDRIVE_TRUE}" && test -z "${KDRIVE_FALSE}"; then as_fn_error $? "conditional \"KDRIVE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${KDRIVELINUX_TRUE}" && test -z "${KDRIVELINUX_FALSE}"; then as_fn_error $? "conditional \"KDRIVELINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${KDRIVE_EVDEV_TRUE}" && test -z "${KDRIVE_EVDEV_FALSE}"; then as_fn_error $? "conditional \"KDRIVE_EVDEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${KDRIVE_KBD_TRUE}" && test -z "${KDRIVE_KBD_FALSE}"; then as_fn_error $? "conditional \"KDRIVE_KBD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${KDRIVE_MOUSE_TRUE}" && test -z "${KDRIVE_MOUSE_FALSE}"; then as_fn_error $? "conditional \"KDRIVE_MOUSE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TSLIB_TRUE}" && test -z "${TSLIB_FALSE}"; then as_fn_error $? "conditional \"TSLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${KDRIVEFBDEV_TRUE}" && test -z "${KDRIVEFBDEV_FALSE}"; then as_fn_error $? "conditional \"KDRIVEFBDEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XEPHYR_TRUE}" && test -z "${XEPHYR_FALSE}"; then as_fn_error $? "conditional \"XEPHYR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_KDRIVEFBDEVLIB_TRUE}" && test -z "${BUILD_KDRIVEFBDEVLIB_FALSE}"; then as_fn_error $? "conditional \"BUILD_KDRIVEFBDEVLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XFAKESERVER_TRUE}" && test -z "${XFAKESERVER_FALSE}"; then as_fn_error $? "conditional \"XFAKESERVER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XWAYLAND_TRUE}" && test -z "${XWAYLAND_FALSE}"; then as_fn_error $? "conditional \"XWAYLAND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # 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.17.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>." _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.17.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "include/do-not-use-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/do-not-use-config.h" ;; "include/xorg-server.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xorg-server.h" ;; "include/dix-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/dix-config.h" ;; "include/xorg-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xorg-config.h" ;; "include/xkb-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xkb-config.h" ;; "include/xwin-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/xwin-config.h" ;; "include/kdrive-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/kdrive-config.h" ;; "include/version-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/version-config.h" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "sdksyms") CONFIG_COMMANDS="$CONFIG_COMMANDS sdksyms" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "glx/Makefile") CONFIG_FILES="$CONFIG_FILES glx/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "composite/Makefile") CONFIG_FILES="$CONFIG_FILES composite/Makefile" ;; "damageext/Makefile") CONFIG_FILES="$CONFIG_FILES damageext/Makefile" ;; "dbe/Makefile") CONFIG_FILES="$CONFIG_FILES dbe/Makefile" ;; "dix/Makefile") CONFIG_FILES="$CONFIG_FILES dix/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/dtrace/Makefile") CONFIG_FILES="$CONFIG_FILES doc/dtrace/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "fb/Makefile") CONFIG_FILES="$CONFIG_FILES fb/Makefile" ;; "glamor/Makefile") CONFIG_FILES="$CONFIG_FILES glamor/Makefile" ;; "record/Makefile") CONFIG_FILES="$CONFIG_FILES record/Makefile" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "mi/Makefile") CONFIG_FILES="$CONFIG_FILES mi/Makefile" ;; "miext/Makefile") CONFIG_FILES="$CONFIG_FILES miext/Makefile" ;; "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/rootless/Makefile") CONFIG_FILES="$CONFIG_FILES miext/rootless/Makefile" ;; "os/Makefile") CONFIG_FILES="$CONFIG_FILES os/Makefile" ;; "pseudoramiX/Makefile") CONFIG_FILES="$CONFIG_FILES pseudoramiX/Makefile" ;; "randr/Makefile") CONFIG_FILES="$CONFIG_FILES randr/Makefile" ;; "render/Makefile") CONFIG_FILES="$CONFIG_FILES render/Makefile" ;; "xkb/Makefile") CONFIG_FILES="$CONFIG_FILES xkb/Makefile" ;; "Xext/Makefile") CONFIG_FILES="$CONFIG_FILES Xext/Makefile" ;; "Xi/Makefile") CONFIG_FILES="$CONFIG_FILES Xi/Makefile" ;; "xfixes/Makefile") CONFIG_FILES="$CONFIG_FILES xfixes/Makefile" ;; "exa/Makefile") CONFIG_FILES="$CONFIG_FILES exa/Makefile" ;; "dri3/Makefile") CONFIG_FILES="$CONFIG_FILES dri3/Makefile" ;; "present/Makefile") CONFIG_FILES="$CONFIG_FILES present/Makefile" ;; "hw/Makefile") CONFIG_FILES="$CONFIG_FILES hw/Makefile" ;; "hw/xfree86/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/Makefile" ;; "hw/xfree86/Xorg.sh") CONFIG_FILES="$CONFIG_FILES hw/xfree86/Xorg.sh" ;; "hw/xfree86/common/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/common/Makefile" ;; "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/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" ;; "hw/xfree86/dri2/pci_ids/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dri2/pci_ids/Makefile" ;; "hw/xfree86/drivers/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/drivers/Makefile" ;; "hw/xfree86/drivers/modesetting/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/drivers/modesetting/Makefile" ;; "hw/xfree86/exa/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/exa/Makefile" ;; "hw/xfree86/exa/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/exa/man/Makefile" ;; "hw/xfree86/fbdevhw/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/fbdevhw/Makefile" ;; "hw/xfree86/fbdevhw/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/fbdevhw/man/Makefile" ;; "hw/xfree86/glamor_egl/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/glamor_egl/Makefile" ;; "hw/xfree86/i2c/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/i2c/Makefile" ;; "hw/xfree86/int10/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/int10/Makefile" ;; "hw/xfree86/loader/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/loader/Makefile" ;; "hw/xfree86/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/man/Makefile" ;; "hw/xfree86/modes/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/modes/Makefile" ;; "hw/xfree86/os-support/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/Makefile" ;; "hw/xfree86/os-support/bsd/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/bsd/Makefile" ;; "hw/xfree86/os-support/bus/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/bus/Makefile" ;; "hw/xfree86/os-support/hurd/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/hurd/Makefile" ;; "hw/xfree86/os-support/misc/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/misc/Makefile" ;; "hw/xfree86/os-support/linux/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/linux/Makefile" ;; "hw/xfree86/os-support/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/solaris/Makefile" ;; "hw/xfree86/os-support/stub/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/os-support/stub/Makefile" ;; "hw/xfree86/parser/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/parser/Makefile" ;; "hw/xfree86/ramdac/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/ramdac/Makefile" ;; "hw/xfree86/shadowfb/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/shadowfb/Makefile" ;; "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/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" ;; "hw/xfree86/utils/gtf/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/utils/gtf/Makefile" ;; "hw/dmx/config/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/config/Makefile" ;; "hw/dmx/config/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/config/man/Makefile" ;; "hw/dmx/doc/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/doc/Makefile" ;; "hw/dmx/doxygen/doxygen.conf") CONFIG_FILES="$CONFIG_FILES hw/dmx/doxygen/doxygen.conf" ;; "hw/dmx/doxygen/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/doxygen/Makefile" ;; "hw/dmx/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/examples/Makefile" ;; "hw/dmx/input/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/input/Makefile" ;; "hw/dmx/glxProxy/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/glxProxy/Makefile" ;; "hw/dmx/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/Makefile" ;; "hw/dmx/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/dmx/man/Makefile" ;; "hw/vfb/Makefile") CONFIG_FILES="$CONFIG_FILES hw/vfb/Makefile" ;; "hw/vfb/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/vfb/man/Makefile" ;; "hw/xnest/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xnest/Makefile" ;; "hw/xnest/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xnest/man/Makefile" ;; "hw/xwin/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/Makefile" ;; "hw/xwin/glx/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/glx/Makefile" ;; "hw/xwin/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/man/Makefile" ;; "hw/xwin/winclipboard/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/winclipboard/Makefile" ;; "hw/xquartz/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/Makefile" ;; "hw/xquartz/GL/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/GL/Makefile" ;; "hw/xquartz/bundle/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/bundle/Makefile" ;; "hw/xquartz/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/man/Makefile" ;; "hw/xquartz/mach-startup/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/mach-startup/Makefile" ;; "hw/xquartz/pbproxy/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/pbproxy/Makefile" ;; "hw/xquartz/xpr/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/xpr/Makefile" ;; "hw/kdrive/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/Makefile" ;; "hw/kdrive/ephyr/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/ephyr/Makefile" ;; "hw/kdrive/ephyr/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/ephyr/man/Makefile" ;; "hw/kdrive/fake/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/fake/Makefile" ;; "hw/kdrive/fbdev/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/fbdev/Makefile" ;; "hw/kdrive/linux/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/linux/Makefile" ;; "hw/kdrive/src/Makefile") CONFIG_FILES="$CONFIG_FILES hw/kdrive/src/Makefile" ;; "hw/xwayland/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwayland/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/xi1/Makefile") CONFIG_FILES="$CONFIG_FILES test/xi1/Makefile" ;; "test/xi2/Makefile") CONFIG_FILES="$CONFIG_FILES test/xi2/Makefile" ;; "xserver.ent") CONFIG_FILES="$CONFIG_FILES xserver.ent" ;; "xorg-server.pc") CONFIG_FILES="$CONFIG_FILES xorg-server.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' <confdefs.h | sed ' s/'"$ac_delim"'/"\\\ "/g' >>$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "sdksyms":C) touch hw/xfree86/sdksyms.dep ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/xserver.ent.in�������������������������������������������������������������������0000664�0001751�0001751�00000000245�12160102336�013617� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- shared -*-xml-*- entity definitions for the X server documentation --> <!ENTITY xserver.version "@PACKAGE_VERSION@"> <!ENTITY xserver.reldate "@RELEASE_DATE@"> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/�����������������������������������������������������������������������������0000775�0001751�0001751�00000000000�12466505443�011666� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/Makefile.am������������������������������������������������������������������0000664�0001751�0001751�00000002731�12401504431�013626� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������noinst_LTLIBRARIES = libdix.la libmain.la AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = $(DIX_CFLAGS) libmain_la_SOURCES = \ stubmain.c libdix_la_SOURCES = \ atom.c \ colormap.c \ cursor.c \ devices.c \ dispatch.c \ dispatch.h \ dixfonts.c \ main.c \ dixutils.c \ enterleave.c \ enterleave.h \ events.c \ eventconvert.c \ extension.c \ ffs.c \ gc.c \ getevents.c \ globals.c \ glyphcurs.c \ grabs.c \ initatoms.c \ inpututils.c \ pixmap.c \ privates.c \ property.c \ ptrveloc.c \ region.c \ registry.c \ resource.c \ selection.c \ swaprep.c \ swapreq.c \ tables.c \ touch.c \ window.c EXTRA_DIST = buildatoms BuiltInAtoms Xserver.d Xserver-dtrace.h.in # Install list of protocol names miscconfigdir = $(SERVER_MISC_CONFIG_PATH) dist_miscconfig_DATA = protocol.txt if XSERVER_DTRACE # Generate dtrace header file for C sources to include BUILT_SOURCES = Xserver-dtrace.h Xserver-dtrace.h: $(srcdir)/Xserver.d $(AM_V_GEN)$(DTRACE) -C -h -o $@ -s $(srcdir)/Xserver.d \ || cp Xserver-dtrace.h.in $@ endif if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libdix dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) noinst_PROGRAMS = dix.O dix_O_SOURCES = dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) $(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) endif CLEANFILES = Xserver-dtrace.h ���������������������������������������xorg-server-1.17.1/dix/eventconvert.c���������������������������������������������������������������0000664�0001751�0001751�00000066003�12274325511�014472� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * */ /** * @file eventconvert.c * This file contains event conversion routines from InternalEvent to the * matching protocol events. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdint.h> #include <X11/X.h> #include <X11/extensions/XIproto.h> #include <X11/extensions/XI2proto.h> #include <X11/extensions/XI.h> #include <X11/extensions/XI2.h> #include "dix.h" #include "inputstr.h" #include "misc.h" #include "eventstr.h" #include "exevents.h" #include "exglobals.h" #include "eventconvert.h" #include "inpututils.h" #include "xiquerydevice.h" #include "xkbsrv.h" #include "inpututils.h" static int countValuators(DeviceEvent *ev, int *first); static int getValuatorEvents(DeviceEvent *ev, deviceValuator * xv); 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 */ BOOL EventIsKeyRepeat(xEvent *event); /** * Hack to allow detectable autorepeat for core and XI1 events. * The sequence number is unused until we send to the client and can be * misused to store data. More or less, anyway. * * Do not use this. It may change any time without warning, eat your babies * and piss on your cat. */ static void EventSetKeyRepeatFlag(xEvent *event, BOOL on) { event->u.u.sequenceNumber = on; } /** * Check if the event was marked as a repeat event before. * NOTE: This is a nasty hack and should NOT be used by anyone else but * TryClientEvents. */ BOOL EventIsKeyRepeat(xEvent *event) { return ! !event->u.u.sequenceNumber; } /** * Convert the given event to the respective core event. * * Return values: * Success ... core contains the matching core event. * BadValue .. One or more values in the internal event are invalid. * BadMatch .. The event has no core equivalent. * * @param[in] event The event to convert into a core event. * @param[in] core The memory location to store the core event at. * @return Success or the matching error code. */ int EventToCore(InternalEvent *event, xEvent **core_out, int *count_out) { xEvent *core = NULL; int count = 0; int ret = BadImplementation; switch (event->any.type) { case ET_Motion: { DeviceEvent *e = &event->device_event; /* Don't create core motion event if neither x nor y are * present */ if (!BitIsOn(e->valuators.mask, 0) && !BitIsOn(e->valuators.mask, 1)) { ret = BadMatch; goto out; } } /* fallthrough */ case ET_ButtonPress: case ET_ButtonRelease: case ET_KeyPress: case ET_KeyRelease: { DeviceEvent *e = &event->device_event; if (e->detail.key > 0xFF) { ret = BadMatch; goto out; } core = calloc(1, sizeof(*core)); if (!core) return BadAlloc; count = 1; core->u.u.type = e->type - ET_KeyPress + KeyPress; core->u.u.detail = e->detail.key & 0xFF; core->u.keyButtonPointer.time = e->time; core->u.keyButtonPointer.rootX = e->root_x; core->u.keyButtonPointer.rootY = e->root_y; core->u.keyButtonPointer.state = e->corestate; core->u.keyButtonPointer.root = e->root; EventSetKeyRepeatFlag(core, (e->type == ET_KeyPress && e->key_repeat)); ret = Success; } break; case ET_ProximityIn: case ET_ProximityOut: case ET_RawKeyPress: case ET_RawKeyRelease: case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: case ET_RawTouchBegin: case ET_RawTouchUpdate: case ET_RawTouchEnd: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: case ET_TouchOwnership: case ET_BarrierHit: case ET_BarrierLeave: ret = BadMatch; break; default: /* XXX: */ ErrorF("[dix] EventToCore: Not implemented yet \n"); ret = BadImplementation; } out: *core_out = core; *count_out = count; return ret; } /** * Convert the given event to the respective XI 1.x event and store it in * xi. xi is allocated on demand and must be freed by the caller. * count returns the number of events in xi. If count is 1, and the type of * xi is GenericEvent, then xi may be larger than 32 bytes. * * Return values: * Success ... core contains the matching core event. * BadValue .. One or more values in the internal event are invalid. * BadMatch .. The event has no XI equivalent. * * @param[in] ev The event to convert into an XI 1 event. * @param[out] xi Future memory location for the XI event. * @param[out] count Number of elements in xi. * * @return Success or the error code. */ int EventToXI(InternalEvent *ev, xEvent **xi, int *count) { switch (ev->any.type) { case ET_Motion: case ET_ButtonPress: case ET_ButtonRelease: case ET_KeyPress: case ET_KeyRelease: case ET_ProximityIn: case ET_ProximityOut: return eventToKeyButtonPointer(&ev->device_event, xi, count); case ET_DeviceChanged: case ET_RawKeyPress: case ET_RawKeyRelease: case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: case ET_RawTouchBegin: case ET_RawTouchUpdate: case ET_RawTouchEnd: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: case ET_TouchOwnership: case ET_BarrierHit: case ET_BarrierLeave: *count = 0; *xi = NULL; return BadMatch; default: break; } ErrorF("[dix] EventToXI: Not implemented for %d \n", ev->any.type); return BadImplementation; } /** * Convert the given event to the respective XI 2.x event and store it in xi. * xi is allocated on demand and must be freed by the caller. * * Return values: * Success ... core contains the matching core event. * BadValue .. One or more values in the internal event are invalid. * BadMatch .. The event has no XI2 equivalent. * * @param[in] ev The event to convert into an XI2 event * @param[out] xi Future memory location for the XI2 event. * * @return Success or the error code. */ int EventToXI2(InternalEvent *ev, xEvent **xi) { switch (ev->any.type) { /* Enter/FocusIn are for grabs. We don't need an actual event, since * the real events delivered are triggered elsewhere */ case ET_Enter: case ET_FocusIn: *xi = NULL; return Success; case ET_Motion: case ET_ButtonPress: case ET_ButtonRelease: case ET_KeyPress: case ET_KeyRelease: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: return eventToDeviceEvent(&ev->device_event, xi); case ET_TouchOwnership: return eventToTouchOwnershipEvent(&ev->touch_ownership_event, xi); case ET_ProximityIn: case ET_ProximityOut: *xi = NULL; return BadMatch; case ET_DeviceChanged: return eventToDeviceChanged(&ev->changed_event, xi); case ET_RawKeyPress: case ET_RawKeyRelease: case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: case ET_RawTouchBegin: 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; } ErrorF("[dix] EventToXI2: Not implemented for %d \n", ev->any.type); return BadImplementation; } static int eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count) { int num_events; int first; /* dummy */ deviceKeyButtonPointer *kbp; /* Sorry, XI 1.x protocol restrictions. */ if (ev->detail.button > 0xFF || ev->deviceid >= 0x80) { *count = 0; return Success; } num_events = (countValuators(ev, &first) + 5) / 6; /* valuator ev */ if (num_events <= 0) { switch (ev->type) { case ET_KeyPress: case ET_KeyRelease: case ET_ButtonPress: case ET_ButtonRelease: /* no axes is ok */ break; case ET_Motion: case ET_ProximityIn: case ET_ProximityOut: *count = 0; return BadMatch; default: *count = 0; return BadImplementation; } } num_events++; /* the actual event event */ *xi = calloc(num_events, sizeof(xEvent)); if (!(*xi)) { return BadAlloc; } kbp = (deviceKeyButtonPointer *) (*xi); kbp->detail = ev->detail.button; kbp->time = ev->time; kbp->root = ev->root; kbp->root_x = ev->root_x; kbp->root_y = ev->root_y; kbp->deviceid = ev->deviceid; kbp->state = ev->corestate; EventSetKeyRepeatFlag((xEvent *) kbp, (ev->type == ET_KeyPress && ev->key_repeat)); if (num_events > 1) kbp->deviceid |= MORE_EVENTS; switch (ev->type) { case ET_Motion: kbp->type = DeviceMotionNotify; break; case ET_ButtonPress: kbp->type = DeviceButtonPress; break; case ET_ButtonRelease: kbp->type = DeviceButtonRelease; break; case ET_KeyPress: kbp->type = DeviceKeyPress; break; case ET_KeyRelease: kbp->type = DeviceKeyRelease; break; case ET_ProximityIn: kbp->type = ProximityIn; break; case ET_ProximityOut: kbp->type = ProximityOut; break; default: break; } if (num_events > 1) { getValuatorEvents(ev, (deviceValuator *) (kbp + 1)); } *count = num_events; return Success; } /** * Set first to the first valuator in the event ev and return the number of * valuators from first to the last set valuator. */ static int countValuators(DeviceEvent *ev, int *first) { int first_valuator = -1, last_valuator = -1, num_valuators = 0; int i; for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++) { if (BitIsOn(ev->valuators.mask, i)) { if (first_valuator == -1) first_valuator = i; last_valuator = i; } } if (first_valuator != -1) { num_valuators = last_valuator - first_valuator + 1; *first = first_valuator; } return num_valuators; } static int getValuatorEvents(DeviceEvent *ev, deviceValuator * xv) { int i; int state = 0; int first_valuator, num_valuators; num_valuators = countValuators(ev, &first_valuator); if (num_valuators > 0) { DeviceIntPtr dev = NULL; dixLookupDevice(&dev, ev->deviceid, serverClient, DixUseAccess); /* State needs to be assembled BEFORE the device is updated. */ state = (dev && dev->key) ? XkbStateFieldFromRec(&dev->key->xkbInfo-> state) : 0; state |= (dev && dev->button) ? (dev->button->state) : 0; } for (i = 0; i < num_valuators; i += 6, xv++) { INT32 *valuators = &xv->valuator0; // Treat all 6 vals as an array int j; xv->type = DeviceValuator; xv->first_valuator = first_valuator + i; xv->num_valuators = ((num_valuators - i) > 6) ? 6 : (num_valuators - i); xv->deviceid = ev->deviceid; xv->device_state = state; /* Unset valuators in masked valuator events have the proper data values * in the case of an absolute axis in between two set valuators. */ for (j = 0; j < xv->num_valuators; j++) valuators[j] = ev->valuators.data[xv->first_valuator + j]; if (i + 6 < num_valuators) xv->deviceid |= MORE_EVENTS; } return (num_valuators + 5) / 6; } static int appendKeyInfo(DeviceChangedEvent *dce, xXIKeyInfo * info) { uint32_t *kc; int i; info->type = XIKeyClass; info->num_keycodes = dce->keys.max_keycode - dce->keys.min_keycode + 1; info->length = sizeof(xXIKeyInfo) / 4 + info->num_keycodes; info->sourceid = dce->sourceid; kc = (uint32_t *) &info[1]; for (i = 0; i < info->num_keycodes; i++) *kc++ = i + dce->keys.min_keycode; return info->length * 4; } static int appendButtonInfo(DeviceChangedEvent *dce, xXIButtonInfo * info) { unsigned char *bits; int mask_len; mask_len = bytes_to_int32(bits_to_bytes(dce->buttons.num_buttons)); info->type = XIButtonClass; info->num_buttons = dce->buttons.num_buttons; info->length = bytes_to_int32(sizeof(xXIButtonInfo)) + info->num_buttons + mask_len; info->sourceid = dce->sourceid; bits = (unsigned char *) &info[1]; memset(bits, 0, mask_len * 4); /* FIXME: is_down? */ bits += mask_len * 4; memcpy(bits, dce->buttons.names, dce->buttons.num_buttons * sizeof(Atom)); return info->length * 4; } static int appendValuatorInfo(DeviceChangedEvent *dce, xXIValuatorInfo * info, int axisnumber) { info->type = XIValuatorClass; info->length = sizeof(xXIValuatorInfo) / 4; info->label = dce->valuators[axisnumber].name; info->min.integral = dce->valuators[axisnumber].min; info->min.frac = 0; info->max.integral = dce->valuators[axisnumber].max; info->max.frac = 0; info->value = double_to_fp3232(dce->valuators[axisnumber].value); info->resolution = dce->valuators[axisnumber].resolution; info->number = axisnumber; info->mode = dce->valuators[axisnumber].mode; info->sourceid = dce->sourceid; return info->length * 4; } static int appendScrollInfo(DeviceChangedEvent *dce, xXIScrollInfo * info, int axisnumber) { if (dce->valuators[axisnumber].scroll.type == SCROLL_TYPE_NONE) return 0; info->type = XIScrollClass; info->length = sizeof(xXIScrollInfo) / 4; info->number = axisnumber; switch (dce->valuators[axisnumber].scroll.type) { case SCROLL_TYPE_VERTICAL: info->scroll_type = XIScrollTypeVertical; break; case SCROLL_TYPE_HORIZONTAL: info->scroll_type = XIScrollTypeHorizontal; break; default: ErrorF("[Xi] Unknown scroll type %d. This is a bug.\n", dce->valuators[axisnumber].scroll.type); break; } info->increment = double_to_fp3232(dce->valuators[axisnumber].scroll.increment); info->sourceid = dce->sourceid; info->flags = 0; if (dce->valuators[axisnumber].scroll.flags & SCROLL_FLAG_DONT_EMULATE) info->flags |= XIScrollFlagNoEmulation; if (dce->valuators[axisnumber].scroll.flags & SCROLL_FLAG_PREFERRED) info->flags |= XIScrollFlagPreferred; return info->length * 4; } static int eventToDeviceChanged(DeviceChangedEvent *dce, xEvent **xi) { xXIDeviceChangedEvent *dcce; int len = sizeof(xXIDeviceChangedEvent); int nkeys; char *ptr; if (dce->buttons.num_buttons) { len += sizeof(xXIButtonInfo); len += dce->buttons.num_buttons * sizeof(Atom); /* button names */ len += pad_to_int32(bits_to_bytes(dce->buttons.num_buttons)); } if (dce->num_valuators) { int i; len += sizeof(xXIValuatorInfo) * dce->num_valuators; for (i = 0; i < dce->num_valuators; i++) if (dce->valuators[i].scroll.type != SCROLL_TYPE_NONE) len += sizeof(xXIScrollInfo); } nkeys = (dce->keys.max_keycode > 0) ? dce->keys.max_keycode - dce->keys.min_keycode + 1 : 0; if (nkeys > 0) { len += sizeof(xXIKeyInfo); len += sizeof(CARD32) * nkeys; /* keycodes */ } dcce = calloc(1, len); if (!dcce) { ErrorF("[Xi] BadAlloc in SendDeviceChangedEvent.\n"); return BadAlloc; } dcce->type = GenericEvent; dcce->extension = IReqCode; dcce->evtype = XI_DeviceChanged; dcce->time = dce->time; dcce->deviceid = dce->deviceid; dcce->sourceid = dce->sourceid; dcce->reason = (dce->flags & DEVCHANGE_DEVICE_CHANGE) ? XIDeviceChange : XISlaveSwitch; dcce->num_classes = 0; dcce->length = bytes_to_int32(len - sizeof(xEvent)); ptr = (char *) &dcce[1]; if (dce->buttons.num_buttons) { dcce->num_classes++; ptr += appendButtonInfo(dce, (xXIButtonInfo *) ptr); } if (nkeys) { dcce->num_classes++; ptr += appendKeyInfo(dce, (xXIKeyInfo *) ptr); } if (dce->num_valuators) { int i; dcce->num_classes += dce->num_valuators; for (i = 0; i < dce->num_valuators; i++) ptr += appendValuatorInfo(dce, (xXIValuatorInfo *) ptr, i); for (i = 0; i < dce->num_valuators; i++) { if (dce->valuators[i].scroll.type != SCROLL_TYPE_NONE) { dcce->num_classes++; ptr += appendScrollInfo(dce, (xXIScrollInfo *) ptr, i); } } } *xi = (xEvent *) dcce; return Success; } static int count_bits(unsigned char *ptr, int len) { int bits = 0; unsigned int i; unsigned char x; for (i = 0; i < len; i++) { x = ptr[i]; while (x > 0) { bits += (x & 0x1); x >>= 1; } } return bits; } static int eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) { int len = sizeof(xXIDeviceEvent); xXIDeviceEvent *xde; int i, btlen, vallen; char *ptr; FP3232 *axisval; /* FIXME: this should just send the buttons we have, not MAX_BUTTONs. Same * with MAX_VALUATORS below */ /* btlen is in 4 byte units */ btlen = bytes_to_int32(bits_to_bytes(MAX_BUTTONS)); len += btlen * 4; /* buttonmask len */ vallen = count_bits(ev->valuators.mask, sizeof(ev->valuators.mask) / sizeof(ev->valuators.mask[0])); len += vallen * 2 * sizeof(uint32_t); /* axisvalues */ vallen = bytes_to_int32(bits_to_bytes(MAX_VALUATORS)); len += vallen * 4; /* valuators mask */ *xi = calloc(1, len); xde = (xXIDeviceEvent *) * xi; xde->type = GenericEvent; xde->extension = IReqCode; xde->evtype = GetXI2Type(ev->type); xde->time = ev->time; xde->length = bytes_to_int32(len - sizeof(xEvent)); if (IsTouchEvent((InternalEvent *) ev)) xde->detail = ev->touchid; else xde->detail = ev->detail.button; xde->root = ev->root; xde->buttons_len = btlen; xde->valuators_len = vallen; xde->deviceid = ev->deviceid; xde->sourceid = ev->sourceid; 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 (IsTouchEvent((InternalEvent *)ev)) { if (ev->type == ET_TouchUpdate) xde->flags |= (ev->flags & TOUCH_PENDING_END) ? XITouchPendingEnd : 0; if (ev->flags & TOUCH_POINTER_EMULATED) xde->flags |= XITouchEmulatingPointer; } else { xde->flags = ev->flags; if (ev->key_repeat) xde->flags |= XIKeyRepeat; } xde->mods.base_mods = ev->mods.base; xde->mods.latched_mods = ev->mods.latched; xde->mods.locked_mods = ev->mods.locked; xde->mods.effective_mods = ev->mods.effective; xde->group.base_group = ev->group.base; xde->group.latched_group = ev->group.latched; xde->group.locked_group = ev->group.locked; xde->group.effective_group = ev->group.effective; ptr = (char *) &xde[1]; for (i = 0; i < sizeof(ev->buttons) * 8; i++) { if (BitIsOn(ev->buttons, i)) SetBit(ptr, i); } ptr += xde->buttons_len * 4; axisval = (FP3232 *) (ptr + xde->valuators_len * 4); for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++) { if (BitIsOn(ev->valuators.mask, i)) { SetBit(ptr, i); *axisval = double_to_fp3232(ev->valuators.data[i]); axisval++; } } return Success; } static int eventToTouchOwnershipEvent(TouchOwnershipEvent *ev, xEvent **xi) { int len = sizeof(xXITouchOwnershipEvent); xXITouchOwnershipEvent *xtoe; *xi = calloc(1, len); xtoe = (xXITouchOwnershipEvent *) * xi; xtoe->type = GenericEvent; xtoe->extension = IReqCode; xtoe->length = bytes_to_int32(len - sizeof(xEvent)); xtoe->evtype = GetXI2Type(ev->type); xtoe->deviceid = ev->deviceid; xtoe->time = ev->time; xtoe->sourceid = ev->sourceid; xtoe->touchid = ev->touchid; xtoe->flags = 0; /* we don't have wire flags for ownership yet */ return Success; } static int eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) { xXIRawEvent *raw; int vallen, nvals; int i, len = sizeof(xXIRawEvent); char *ptr; FP3232 *axisval, *axisval_raw; nvals = count_bits(ev->valuators.mask, sizeof(ev->valuators.mask)); len += nvals * sizeof(FP3232) * 2; /* 8 byte per valuator, once raw, once processed */ vallen = bytes_to_int32(bits_to_bytes(MAX_VALUATORS)); len += vallen * 4; /* valuators mask */ *xi = calloc(1, len); raw = (xXIRawEvent *) * xi; raw->type = GenericEvent; raw->extension = IReqCode; raw->evtype = GetXI2Type(ev->type); raw->time = ev->time; raw->length = bytes_to_int32(len - sizeof(xEvent)); raw->detail = ev->detail.button; raw->deviceid = ev->deviceid; raw->sourceid = ev->sourceid; raw->valuators_len = vallen; raw->flags = ev->flags; ptr = (char *) &raw[1]; axisval = (FP3232 *) (ptr + raw->valuators_len * 4); axisval_raw = axisval + nvals; for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++) { if (BitIsOn(ev->valuators.mask, i)) { SetBit(ptr, i); *axisval = double_to_fp3232(ev->valuators.data[i]); *axisval_raw = double_to_fp3232(ev->valuators.data_raw[i]); axisval++; axisval_raw++; } } 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. */ int GetCoreType(enum EventType type) { int coretype = 0; switch (type) { case ET_Motion: coretype = MotionNotify; break; case ET_ButtonPress: coretype = ButtonPress; break; case ET_ButtonRelease: coretype = ButtonRelease; break; case ET_KeyPress: coretype = KeyPress; break; case ET_KeyRelease: coretype = KeyRelease; break; default: break; } return coretype; } /** * Return the corresponding XI 1.x type for the given event or 0 if no * equivalent exists. */ int GetXIType(enum EventType type) { int xitype = 0; switch (type) { case ET_Motion: xitype = DeviceMotionNotify; break; case ET_ButtonPress: xitype = DeviceButtonPress; break; case ET_ButtonRelease: xitype = DeviceButtonRelease; break; case ET_KeyPress: xitype = DeviceKeyPress; break; case ET_KeyRelease: xitype = DeviceKeyRelease; break; case ET_ProximityIn: xitype = ProximityIn; break; case ET_ProximityOut: xitype = ProximityOut; break; default: break; } return xitype; } /** * Return the corresponding XI 2.x type for the given event or 0 if no * equivalent exists. */ int GetXI2Type(enum EventType type) { int xi2type = 0; switch (type) { case ET_Motion: xi2type = XI_Motion; break; case ET_ButtonPress: xi2type = XI_ButtonPress; break; case ET_ButtonRelease: xi2type = XI_ButtonRelease; break; case ET_KeyPress: xi2type = XI_KeyPress; break; case ET_KeyRelease: xi2type = XI_KeyRelease; break; case ET_Enter: xi2type = XI_Enter; break; case ET_Leave: xi2type = XI_Leave; break; case ET_Hierarchy: xi2type = XI_HierarchyChanged; break; case ET_DeviceChanged: xi2type = XI_DeviceChanged; break; case ET_RawKeyPress: xi2type = XI_RawKeyPress; break; case ET_RawKeyRelease: xi2type = XI_RawKeyRelease; break; case ET_RawButtonPress: xi2type = XI_RawButtonPress; break; case ET_RawButtonRelease: xi2type = XI_RawButtonRelease; break; case ET_RawMotion: xi2type = XI_RawMotion; break; case ET_RawTouchBegin: xi2type = XI_RawTouchBegin; break; case ET_RawTouchUpdate: xi2type = XI_RawTouchUpdate; break; case ET_RawTouchEnd: xi2type = XI_RawTouchEnd; break; case ET_FocusIn: xi2type = XI_FocusIn; break; case ET_FocusOut: xi2type = XI_FocusOut; break; case ET_TouchBegin: xi2type = XI_TouchBegin; break; case ET_TouchEnd: xi2type = XI_TouchEnd; break; case ET_TouchUpdate: xi2type = XI_TouchUpdate; break; case ET_TouchOwnership: xi2type = XI_TouchOwnership; break; case ET_BarrierHit: xi2type = XI_BarrierHit; break; case ET_BarrierLeave: xi2type = XI_BarrierLeave; break; default: break; } return xi2type; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/buildatoms�������������������������������������������������������������������0000664�0001751�0001751�00000002322�12160102336�013654� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh hfile=../../../include/Xatom.h cfile=initatoms.c rm -f $hfile $cfile umask 222 awk ' BEGIN { hfile = "'$hfile'"; cfile = "'$cfile'"; hformat = "#define XA_%s ((Atom) %d)\n"; printf("#ifndef XATOM_H\n") > hfile; printf("#define XATOM_H 1\n\n") > hfile; printf("/* THIS IS A GENERATED FILE\n") > hfile; printf(" *\n") > hfile; printf(" * Do not change! Changing this file implies a protocol change!\n") > hfile; printf(" */\n\n") > hfile; printf("/* THIS IS A GENERATED FILE\n") > cfile; printf(" *\n") > cfile; printf(" * Do not change! Changing this file implies a protocol change!\n") > cfile; printf(" */\n\n") > cfile; printf("#include \"X.h\"\n") > cfile; printf("#include \"Xatom.h\"\n") > cfile; printf("#include \"misc.h\"\n") > cfile; printf("#include \"dix.h\"\n") > cfile; printf("void MakePredeclaredAtoms()\n") > cfile; printf("{\n") > cfile; } NF == 2 && $2 == "@" { printf(hformat, $1, ++atomno) > hfile ; printf(" if (MakeAtom(\"%s\", %d, 1) != XA_%s) AtomError();\n", $1, length($1), $1) > cfile ; } END { printf("\n") > hfile; printf(hformat, "LAST_PREDEFINED", atomno) > hfile ; printf("#endif /* XATOM_H */\n") > hfile; printf("}\n") > cfile ; } ' BuiltInAtoms exit 0 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/dispatch.c�������������������������������������������������������������������0000664�0001751�0001751�00000346504�12456571574�013574� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ********************************************************/ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ /* XSERVER_DTRACE additions: * Copyright (c) 2005-2006, Oracle and/or its affiliates. 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 (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #include <version-config.h> #endif #ifdef PANORAMIX_DEBUG #include <stdio.h> int ProcInitialConnection(); #endif #include "windowstr.h" #include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #include "gcstruct.h" #include "selection.h" #include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" #include "opaque.h" #include "input.h" #include "servermd.h" #include "extnsionst.h" #include "dixfont.h" #include "dispatch.h" #include "swaprep.h" #include "swapreq.h" #include "privates.h" #include "xace.h" #include "inputstr.h" #include "xkbsrv.h" #include "site.h" #include "client.h" #ifdef XSERVER_DTRACE #include "registry.h" #include <sys/types.h> typedef const char *string; #include "Xserver-dtrace.h" #endif #define mskcnt ((MAXCLIENTS + 31) / 32) #define BITMASK(i) (1U << ((i) & 31)) #define MASKIDX(i) ((i) >> 5) #define MASKWORD(buf, i) buf[MASKIDX(i)] #define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i) #define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i) #define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) xConnSetupPrefix connSetupPrefix; PaddingInfo PixmapWidthPaddingInfo[33]; static ClientPtr grabClient; #define GrabNone 0 #define GrabActive 1 #define GrabKickout 2 static int grabState = GrabNone; static long grabWaiters[mskcnt]; CallbackListPtr ServerGrabCallback = NULL; HWEventQueuePtr checkForInput[2]; int connBlockScreenStart; static void KillAllClients(void); static int nextFreeClientID; /* always MIN free client ID */ static int nClients; /* number of authorized clients */ CallbackListPtr ClientStateCallback; /* dispatchException & isItTimeToYield must be declared volatile since they * are modified by signal handlers - otherwise optimizer may assume it doesn't * need to actually check value in memory when used and may miss changes from * signal handlers. */ volatile char dispatchException = 0; volatile char isItTimeToYield; #define SAME_SCREENS(a, b) (\ (a.pScreen == b.pScreen)) void SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1) { checkForInput[0] = c0; checkForInput[1] = c1; } void UpdateCurrentTime(void) { TimeStamp systime; /* To avoid time running backwards, we must call GetTimeInMillis before * calling ProcessInputEvents. */ systime.months = currentTime.months; systime.milliseconds = GetTimeInMillis(); if (systime.milliseconds < currentTime.milliseconds) systime.months++; if (*checkForInput[0] != *checkForInput[1]) ProcessInputEvents(); if (CompareTimeStamps(systime, currentTime) == LATER) currentTime = systime; } /* Like UpdateCurrentTime, but can't call ProcessInputEvents */ void UpdateCurrentTimeIf(void) { TimeStamp systime; systime.months = currentTime.months; systime.milliseconds = GetTimeInMillis(); if (systime.milliseconds < currentTime.milliseconds) systime.months++; if (CompareTimeStamps(systime, currentTime) == LATER) currentTime = systime; } #undef SMART_DEBUG /* in milliseconds */ #define SMART_SCHEDULE_DEFAULT_INTERVAL 5 #define SMART_SCHEDULE_MAX_SLICE 15 #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; long SmartScheduleTime; int SmartScheduleLatencyLimited = 0; static ClientPtr SmartLastClient; static int SmartLastIndex[SMART_MAX_PRIORITY - SMART_MIN_PRIORITY + 1]; #ifdef SMART_DEBUG long SmartLastPrint; #endif void Dispatch(void); static int SmartScheduleClient(int *clientReady, int nready) { ClientPtr pClient; int i; int client; int bestPrio, best = 0; int bestRobin, robin; long now = SmartScheduleTime; long idle; bestPrio = -0x7fffffff; bestRobin = 0; idle = 2 * SmartScheduleSlice; for (i = 0; i < nready; i++) { client = clientReady[i]; pClient = clients[client]; /* Praise clients which haven't run in a while */ if ((now - pClient->smart_stop_tick) >= idle) { if (pClient->smart_priority < 0) pClient->smart_priority++; } /* check priority to select best client */ robin = (pClient->index - SmartLastIndex[pClient->smart_priority - SMART_MIN_PRIORITY]) & 0xff; if (pClient->smart_priority > bestPrio || (pClient->smart_priority == bestPrio && robin > bestRobin)) { bestPrio = pClient->smart_priority; bestRobin = robin; best = client; } #ifdef SMART_DEBUG if ((now - SmartLastPrint) >= 5000) fprintf(stderr, " %2d: %3d", client, pClient->smart_priority); #endif } #ifdef SMART_DEBUG if ((now - SmartLastPrint) >= 5000) { fprintf(stderr, " use %2d\n", best); SmartLastPrint = now; } #endif pClient = clients[best]; SmartLastIndex[bestPrio - SMART_MIN_PRIORITY] = pClient->index; /* * Set current client pointer */ if (SmartLastClient != pClient) { pClient->smart_start_tick = now; SmartLastClient = pClient; } /* * Adjust slice */ if (nready == 1 && SmartScheduleLatencyLimited == 0) { /* * If it's been a long time since another client * has run, bump the slice up to get maximal * performance from a single client */ if ((now - pClient->smart_start_tick) > 1000 && SmartScheduleSlice < SmartScheduleMaxSlice) { SmartScheduleSlice += SmartScheduleInterval; } } else { SmartScheduleSlice = SmartScheduleInterval; } return best; } void EnableLimitedSchedulingLatency(void) { ++SmartScheduleLatencyLimited; SmartScheduleSlice = SmartScheduleInterval; } void DisableLimitedSchedulingLatency(void) { --SmartScheduleLatencyLimited; /* protect against bugs */ if (SmartScheduleLatencyLimited < 0) SmartScheduleLatencyLimited = 0; } void Dispatch(void) { int *clientReady; /* array of request ready clients */ int result; ClientPtr client; int nready; HWEventQueuePtr *icheck = checkForInput; long start_tick; nextFreeClientID = 1; nClients = 0; clientReady = malloc(sizeof(int) * MaxClients); if (!clientReady) return; SmartScheduleSlice = SmartScheduleInterval; while (!dispatchException) { if (*icheck[0] != *icheck[1]) { ProcessInputEvents(); FlushIfCriticalOutputPending(); } nready = WaitForSomething(clientReady); if (nready && !SmartScheduleDisable) { clientReady[0] = SmartScheduleClient(clientReady, nready); nready = 1; } /***************** * Handle events in round robin fashion, doing input between * each round *****************/ while (!dispatchException && (--nready >= 0)) { client = clients[clientReady[nready]]; if (!client) { /* KillClient can cause this to happen */ continue; } /* GrabServer activation can cause this to be true */ if (grabState == GrabKickout) { grabState = GrabActive; break; } isItTimeToYield = FALSE; start_tick = SmartScheduleTime; while (!isItTimeToYield) { if (*icheck[0] != *icheck[1]) ProcessInputEvents(); FlushIfCriticalOutputPending(); if (!SmartScheduleDisable && (SmartScheduleTime - start_tick) >= SmartScheduleSlice) { /* Penalize clients which consume ticks */ if (client->smart_priority > SMART_MIN_PRIORITY) client->smart_priority--; break; } /* now, finally, deal with client requests */ /* Update currentTime so request time checks, such as for input * device grabs, are calculated correctly */ UpdateCurrentTimeIf(); result = ReadRequestFromClient(client); if (result <= 0) { if (result < 0) CloseDownClient(client); break; } client->sequence++; client->majorOp = ((xReq *) client->requestBuffer)->reqType; client->minorOp = 0; if (client->majorOp >= EXTENSION_BASE) { ExtensionEntry *ext = GetExtensionEntry(client->majorOp); if (ext) client->minorOp = ext->MinorOpcode(client); } #ifdef XSERVER_DTRACE if (XSERVER_REQUEST_START_ENABLED()) XSERVER_REQUEST_START(LookupMajorName(client->majorOp), client->majorOp, ((xReq *) client->requestBuffer)->length, client->index, client->requestBuffer); #endif if (result > (maxBigRequestSize << 2)) result = BadLength; else { result = XaceHookDispatch(client, client->majorOp); if (result == Success) result = (*client->requestVector[client->majorOp]) (client); XaceHookAuditEnd(client, result); } #ifdef XSERVER_DTRACE if (XSERVER_REQUEST_DONE_ENABLED()) XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), client->majorOp, client->sequence, client->index, result); #endif if (client->noClientException != Success) { CloseDownClient(client); break; } else if (result != Success) { SendErrorToClient(client, client->majorOp, client->minorOp, client->errorValue, result); break; } } FlushAllOutput(); client = clients[clientReady[nready]]; if (client) client->smart_stop_tick = SmartScheduleTime; } dispatchException &= ~DE_PRIORITYCHANGE; } #if defined(DDXBEFORERESET) ddxBeforeReset(); #endif KillAllClients(); free(clientReady); dispatchException &= ~DE_RESET; SmartScheduleLatencyLimited = 0; ResetOsBuffers(); } static int VendorRelease = VENDOR_RELEASE; static const char *VendorString = VENDOR_NAME; void SetVendorRelease(int release) { VendorRelease = release; } void SetVendorString(const char *vendor) { VendorString = vendor; } Bool CreateConnectionBlock(void) { xConnSetup setup; xWindowRoot root; xDepth depth; xVisualType visual; xPixmapFormat format; unsigned long vid; int i, j, k, lenofblock, sizesofar = 0; char *pBuf; memset(&setup, 0, sizeof(xConnSetup)); /* Leave off the ridBase and ridMask, these must be sent with connection */ setup.release = VendorRelease; /* * per-server image and bitmap parameters are defined in Xmd.h */ setup.imageByteOrder = screenInfo.imageByteOrder; setup.bitmapScanlineUnit = screenInfo.bitmapScanlineUnit; setup.bitmapScanlinePad = screenInfo.bitmapScanlinePad; setup.bitmapBitOrder = screenInfo.bitmapBitOrder; setup.motionBufferSize = NumMotionEvents(); setup.numRoots = screenInfo.numScreens; setup.nbytesVendor = strlen(VendorString); setup.numFormats = screenInfo.numPixmapFormats; setup.maxRequestSize = MAX_REQUEST_SIZE; QueryMinMaxKeyCodes(&setup.minKeyCode, &setup.maxKeyCode); lenofblock = sizeof(xConnSetup) + pad_to_int32(setup.nbytesVendor) + (setup.numFormats * sizeof(xPixmapFormat)) + (setup.numRoots * sizeof(xWindowRoot)); ConnectionInfo = malloc(lenofblock); if (!ConnectionInfo) return FALSE; memmove(ConnectionInfo, (char *) &setup, sizeof(xConnSetup)); sizesofar = sizeof(xConnSetup); pBuf = ConnectionInfo + sizeof(xConnSetup); memmove(pBuf, VendorString, (int) setup.nbytesVendor); sizesofar += setup.nbytesVendor; pBuf += setup.nbytesVendor; i = padding_for_int32(setup.nbytesVendor); sizesofar += i; while (--i >= 0) *pBuf++ = 0; memset(&format, 0, sizeof(xPixmapFormat)); for (i = 0; i < screenInfo.numPixmapFormats; i++) { format.depth = screenInfo.formats[i].depth; format.bitsPerPixel = screenInfo.formats[i].bitsPerPixel; format.scanLinePad = screenInfo.formats[i].scanlinePad; memmove(pBuf, (char *) &format, sizeof(xPixmapFormat)); pBuf += sizeof(xPixmapFormat); sizesofar += sizeof(xPixmapFormat); } connBlockScreenStart = sizesofar; memset(&depth, 0, sizeof(xDepth)); memset(&visual, 0, sizeof(xVisualType)); for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen; DepthPtr pDepth; VisualPtr pVisual; pScreen = screenInfo.screens[i]; root.windowId = pScreen->root->drawable.id; root.defaultColormap = pScreen->defColormap; root.whitePixel = pScreen->whitePixel; root.blackPixel = pScreen->blackPixel; root.currentInputMask = 0; /* filled in when sent */ root.pixWidth = pScreen->width; root.pixHeight = pScreen->height; root.mmWidth = pScreen->mmWidth; root.mmHeight = pScreen->mmHeight; root.minInstalledMaps = pScreen->minInstalledCmaps; root.maxInstalledMaps = pScreen->maxInstalledCmaps; root.rootVisualID = pScreen->rootVisual; root.backingStore = pScreen->backingStoreSupport; root.saveUnders = FALSE; root.rootDepth = pScreen->rootDepth; root.nDepths = pScreen->numDepths; memmove(pBuf, (char *) &root, sizeof(xWindowRoot)); sizesofar += sizeof(xWindowRoot); pBuf += sizeof(xWindowRoot); pDepth = pScreen->allowedDepths; for (j = 0; j < pScreen->numDepths; j++, pDepth++) { lenofblock += sizeof(xDepth) + (pDepth->numVids * sizeof(xVisualType)); pBuf = (char *) realloc(ConnectionInfo, lenofblock); if (!pBuf) { free(ConnectionInfo); return FALSE; } ConnectionInfo = pBuf; pBuf += sizesofar; depth.depth = pDepth->depth; depth.nVisuals = pDepth->numVids; memmove(pBuf, (char *) &depth, sizeof(xDepth)); pBuf += sizeof(xDepth); sizesofar += sizeof(xDepth); for (k = 0; k < pDepth->numVids; k++) { vid = pDepth->vids[k]; for (pVisual = pScreen->visuals; pVisual->vid != vid; pVisual++); visual.visualID = vid; visual.class = pVisual->class; visual.bitsPerRGB = pVisual->bitsPerRGBValue; visual.colormapEntries = pVisual->ColormapEntries; visual.redMask = pVisual->redMask; visual.greenMask = pVisual->greenMask; visual.blueMask = pVisual->blueMask; memmove(pBuf, (char *) &visual, sizeof(xVisualType)); pBuf += sizeof(xVisualType); sizesofar += sizeof(xVisualType); } } } connSetupPrefix.success = xTrue; connSetupPrefix.length = lenofblock / 4; connSetupPrefix.majorVersion = X_PROTOCOL; connSetupPrefix.minorVersion = X_PROTOCOL_REVISION; return TRUE; } int ProcBadRequest(ClientPtr client) { return BadRequest; } int ProcCreateWindow(ClientPtr client) { WindowPtr pParent, pWin; REQUEST(xCreateWindowReq); int len, rc; REQUEST_AT_LEAST_SIZE(xCreateWindowReq); LEGAL_NEW_RESOURCE(stuff->wid, client); rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess); if (rc != Success) return rc; len = client->req_len - bytes_to_int32(sizeof(xCreateWindowReq)); if (Ones(stuff->mask) != len) return BadLength; if (!stuff->width || !stuff->height) { client->errorValue = 0; return BadValue; } pWin = CreateWindow(stuff->wid, pParent, stuff->x, stuff->y, stuff->width, stuff->height, stuff->borderWidth, stuff->class, stuff->mask, (XID *) &stuff[1], (int) stuff->depth, client, stuff->visual, &rc); if (pWin) { Mask mask = pWin->eventMask; pWin->eventMask = 0; /* subterfuge in case AddResource fails */ if (!AddResource(stuff->wid, RT_WINDOW, (void *) pWin)) return BadAlloc; pWin->eventMask = mask; } return rc; } int ProcChangeWindowAttributes(ClientPtr client) { WindowPtr pWin; REQUEST(xChangeWindowAttributesReq); int len, rc; Mask access_mode = 0; REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); access_mode |= (stuff->valueMask & CWEventMask) ? DixReceiveAccess : 0; access_mode |= (stuff->valueMask & ~CWEventMask) ? DixSetAttrAccess : 0; rc = dixLookupWindow(&pWin, stuff->window, client, access_mode); if (rc != Success) return rc; len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq)); if (len != Ones(stuff->valueMask)) return BadLength; return ChangeWindowAttributes(pWin, stuff->valueMask, (XID *) &stuff[1], client); } int ProcGetWindowAttributes(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); xGetWindowAttributesReply wa; int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; memset(&wa, 0, sizeof(xGetWindowAttributesReply)); GetWindowAttributes(pWin, client, &wa); WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); return Success; } int ProcDestroyWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixDestroyAccess); if (rc != Success) return rc; if (pWin->parent) { rc = dixLookupWindow(&pWin, pWin->parent->drawable.id, client, DixRemoveAccess); if (rc != Success) return rc; FreeResource(stuff->id, RT_NONE); } return Success; } int ProcDestroySubwindows(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixRemoveAccess); if (rc != Success) return rc; DestroySubwindows(pWin, client); return Success; } int ProcChangeSaveSet(ClientPtr client) { WindowPtr pWin; REQUEST(xChangeSaveSetReq); int rc; REQUEST_SIZE_MATCH(xChangeSaveSetReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); if (rc != Success) return rc; if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) return BadMatch; if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) return AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); client->errorValue = stuff->mode; return BadValue; } int ProcReparentWindow(ClientPtr client) { WindowPtr pWin, pParent; REQUEST(xReparentWindowReq); int rc; REQUEST_SIZE_MATCH(xReparentWindowReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); if (rc != Success) return rc; rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess); if (rc != Success) return rc; if (!SAME_SCREENS(pWin->drawable, pParent->drawable)) return BadMatch; if ((pWin->backgroundState == ParentRelative) && (pParent->drawable.depth != pWin->drawable.depth)) return BadMatch; if ((pWin->drawable.class != InputOnly) && (pParent->drawable.class == InputOnly)) return BadMatch; return ReparentWindow(pWin, pParent, (short) stuff->x, (short) stuff->y, client); } int ProcMapWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixShowAccess); if (rc != Success) return rc; MapWindow(pWin, client); /* update cache to say it is mapped */ return Success; } int ProcMapSubwindows(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); if (rc != Success) return rc; MapSubwindows(pWin, client); /* update cache to say it is mapped */ return Success; } int ProcUnmapWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixHideAccess); if (rc != Success) return rc; UnmapWindow(pWin, FALSE); /* update cache to say it is mapped */ return Success; } int ProcUnmapSubwindows(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); int rc; REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); if (rc != Success) return rc; UnmapSubwindows(pWin); return Success; } int ProcConfigureWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xConfigureWindowReq); int len, rc; REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess | DixSetAttrAccess); if (rc != Success) return rc; len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq)); if (Ones((Mask) stuff->mask) != len) return BadLength; return ConfigureWindow(pWin, (Mask) stuff->mask, (XID *) &stuff[1], client); } int ProcCirculateWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xCirculateWindowReq); int rc; REQUEST_SIZE_MATCH(xCirculateWindowReq); if ((stuff->direction != RaiseLowest) && (stuff->direction != LowerHighest)) { client->errorValue = stuff->direction; return BadValue; } rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); if (rc != Success) return rc; CirculateWindow(pWin, (int) stuff->direction, client); return Success; } static int GetGeometry(ClientPtr client, xGetGeometryReply * rep) { DrawablePtr pDraw; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixGetAttrAccess); if (rc != Success) return rc; rep->type = X_Reply; rep->length = 0; rep->sequenceNumber = client->sequence; rep->root = pDraw->pScreen->root->drawable.id; rep->depth = pDraw->depth; rep->width = pDraw->width; rep->height = pDraw->height; if (WindowDrawable(pDraw->type)) { WindowPtr pWin = (WindowPtr) pDraw; rep->x = pWin->origin.x - wBorderWidth(pWin); rep->y = pWin->origin.y - wBorderWidth(pWin); rep->borderWidth = pWin->borderWidth; } else { /* DRAWABLE_PIXMAP */ rep->x = rep->y = rep->borderWidth = 0; } return Success; } int ProcGetGeometry(ClientPtr client) { xGetGeometryReply rep = { .type = X_Reply }; int status; if ((status = GetGeometry(client, &rep)) != Success) return status; WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); return Success; } int ProcQueryTree(ClientPtr client) { xQueryTreeReply reply; int rc, numChildren = 0; WindowPtr pChild, pWin, pHead; Window *childIDs = (Window *) NULL; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); if (rc != Success) return rc; 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++; if (numChildren) { int curChild = 0; childIDs = malloc(numChildren * sizeof(Window)); if (!childIDs) return BadAlloc; for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) childIDs[curChild++] = pChild->drawable.id; } reply.nChildren = numChildren; reply.length = bytes_to_int32(numChildren * sizeof(Window)); WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply); if (numChildren) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); free(childIDs); } return Success; } int ProcInternAtom(ClientPtr client) { Atom atom; char *tchar; REQUEST(xInternAtomReq); REQUEST_FIXED_SIZE(xInternAtomReq, stuff->nbytes); if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse)) { client->errorValue = stuff->onlyIfExists; return BadValue; } tchar = (char *) &stuff[1]; atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); if (atom != BAD_RESOURCE) { xInternAtomReply reply = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .atom = atom }; WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); return Success; } else return BadAlloc; } int ProcGetAtomName(ClientPtr client) { const char *str; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); if ((str = NameForAtom(stuff->id))) { int len = strlen(str); xGetAtomNameReply reply = { .type = X_Reply, .sequenceNumber = client->sequence, .length = bytes_to_int32(len), .nameLength = len }; WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); WriteToClient(client, len, str); return Success; } else { client->errorValue = stuff->id; return BadAtom; } } int ProcGrabServer(ClientPtr client) { int rc; REQUEST_SIZE_MATCH(xReq); if (grabState != GrabNone && client != grabClient) { ResetCurrentRequest(client); client->sequence--; BITSET(grabWaiters, client->index); IgnoreClient(client); return Success; } rc = OnlyListenToOneClient(client); if (rc != Success) return rc; grabState = GrabKickout; grabClient = client; if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = SERVER_GRABBED; CallCallbacks(&ServerGrabCallback, (void *) &grabinfo); } return Success; } static void UngrabServer(ClientPtr client) { int i; grabState = GrabNone; ListenToAllClients(); for (i = mskcnt; --i >= 0 && !grabWaiters[i];); if (i >= 0) { i <<= 5; while (!GETBIT(grabWaiters, i)) i++; BITCLEAR(grabWaiters, i); AttendClient(clients[i]); } if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = SERVER_UNGRABBED; CallCallbacks(&ServerGrabCallback, (void *) &grabinfo); } } int ProcUngrabServer(ClientPtr client) { REQUEST_SIZE_MATCH(xReq); UngrabServer(client); return Success; } int ProcTranslateCoords(ClientPtr client) { REQUEST(xTranslateCoordsReq); WindowPtr pWin, pDst; xTranslateCoordsReply rep; int rc; REQUEST_SIZE_MATCH(xTranslateCoordsReq); rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixGetAttrAccess); if (rc != Success) return rc; rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixGetAttrAccess); if (rc != Success) return rc; rep = (xTranslateCoordsReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) { rep.sameScreen = xFalse; rep.child = None; rep.dstX = rep.dstY = 0; } else { INT16 x, y; rep.sameScreen = xTrue; rep.child = None; /* computing absolute coordinates -- adjust to destination later */ x = pWin->drawable.x + stuff->srcX; y = pWin->drawable.y + stuff->srcY; pWin = pDst->firstChild; while (pWin) { BoxRec box; if ((pWin->mapped) && (x >= pWin->drawable.x - wBorderWidth(pWin)) && (x < pWin->drawable.x + (int) pWin->drawable.width + wBorderWidth(pWin)) && (y >= pWin->drawable.y - wBorderWidth(pWin)) && (y < pWin->drawable.y + (int) pWin->drawable.height + wBorderWidth(pWin)) /* When a window is shaped, a further check * is made to see if the point is inside * borderSize */ && (!wBoundingShape(pWin) || RegionContainsPoint(&pWin->borderSize, x, y, &box)) && (!wInputShape(pWin) || RegionContainsPoint(wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) ) { rep.child = pWin->drawable.id; pWin = (WindowPtr) NULL; } else pWin = pWin->nextSib; } /* adjust to destination coordinates */ rep.dstX = x - pDst->drawable.x; rep.dstY = y - pDst->drawable.y; } WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); return Success; } int ProcOpenFont(ClientPtr client) { int err; REQUEST(xOpenFontReq); REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes); client->errorValue = stuff->fid; LEGAL_NEW_RESOURCE(stuff->fid, client); err = OpenFont(client, stuff->fid, (Mask) 0, stuff->nbytes, (char *) &stuff[1]); if (err == Success) { return Success; } else return err; } int ProcCloseFont(ClientPtr client) { FontPtr pFont; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupResourceByType((void **) &pFont, stuff->id, RT_FONT, client, DixDestroyAccess); if (rc == Success) { FreeResource(stuff->id, RT_NONE); return Success; } else { client->errorValue = stuff->id; return rc; } } int ProcQueryFont(ClientPtr client) { xQueryFontReply *reply; FontPtr pFont; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; { xCharInfo *pmax = FONTINKMAX(pFont); xCharInfo *pmin = FONTINKMIN(pFont); int nprotoxcistructs; int rlength; nprotoxcistructs = (pmax->rightSideBearing == pmin->rightSideBearing && pmax->leftSideBearing == pmin->leftSideBearing && pmax->descent == pmin->descent && pmax->ascent == pmin->ascent && pmax->characterWidth == pmin->characterWidth) ? 0 : N2dChars(pFont); rlength = sizeof(xQueryFontReply) + FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + nprotoxcistructs * sizeof(xCharInfo); reply = calloc(1, rlength); if (!reply) { return BadAlloc; } reply->type = X_Reply; reply->length = bytes_to_int32(rlength - sizeof(xGenericReply)); reply->sequenceNumber = client->sequence; QueryFont(pFont, reply, nprotoxcistructs); WriteReplyToClient(client, rlength, reply); free(reply); return Success; } } int ProcQueryTextExtents(ClientPtr client) { xQueryTextExtentsReply reply; FontPtr pFont; ExtentInfoRec info; unsigned long length; int rc; REQUEST(xQueryTextExtentsReq); REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); rc = dixLookupFontable(&pFont, stuff->fid, client, DixGetAttrAccess); if (rc != Success) return rc; length = client->req_len - bytes_to_int32(sizeof(xQueryTextExtentsReq)); length = length << 1; if (stuff->oddLength) { if (length == 0) return BadLength; length--; } if (!QueryTextExtents(pFont, length, (unsigned char *) &stuff[1], &info)) return BadAlloc; 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; } int ProcListFonts(ClientPtr client) { REQUEST(xListFontsReq); REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes); return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes, stuff->maxNames); } int ProcListFontsWithInfo(ClientPtr client) { REQUEST(xListFontsWithInfoReq); REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes); return StartListFontsWithInfo(client, stuff->nbytes, (unsigned char *) &stuff[1], stuff->maxNames); } /** * * \param value must conform to DeleteType */ int dixDestroyPixmap(void *value, XID pid) { PixmapPtr pPixmap = (PixmapPtr) value; return (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap); } int ProcCreatePixmap(ClientPtr client) { PixmapPtr pMap; DrawablePtr pDraw; REQUEST(xCreatePixmapReq); DepthPtr pDepth; int i, rc; REQUEST_SIZE_MATCH(xCreatePixmapReq); client->errorValue = stuff->pid; LEGAL_NEW_RESOURCE(stuff->pid, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, DixGetAttrAccess); if (rc != Success) return rc; if (!stuff->width || !stuff->height) { client->errorValue = 0; return BadValue; } if (stuff->width > 32767 || stuff->height > 32767) { /* It is allowed to try and allocate a pixmap which is larger than * 32767 in either dimension. However, all of the framebuffer code * is buggy and does not reliably draw to such big pixmaps, basically * because the Region data structure operates with signed shorts * for the rectangles in it. * * Furthermore, several places in the X server computes the * size in bytes of the pixmap and tries to store it in an * integer. This integer can overflow and cause the allocated size * to be much smaller. * * So, such big pixmaps are rejected here with a BadAlloc */ return BadAlloc; } if (stuff->depth != 1) { pDepth = pDraw->pScreen->allowedDepths; for (i = 0; i < pDraw->pScreen->numDepths; i++, pDepth++) if (pDepth->depth == stuff->depth) goto CreatePmap; client->errorValue = stuff->depth; return BadValue; } CreatePmap: pMap = (PixmapPtr) (*pDraw->pScreen->CreatePixmap) (pDraw->pScreen, stuff->width, stuff->height, stuff->depth, 0); if (pMap) { pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; /* security creation/labeling check */ rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess); if (rc != Success) { (*pDraw->pScreen->DestroyPixmap) (pMap); return rc; } if (AddResource(stuff->pid, RT_PIXMAP, (void *) pMap)) return Success; } return BadAlloc; } int ProcFreePixmap(ClientPtr client) { PixmapPtr pMap; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupResourceByType((void **) &pMap, stuff->id, RT_PIXMAP, client, DixDestroyAccess); if (rc == Success) { FreeResource(stuff->id, RT_NONE); return Success; } else { client->errorValue = stuff->id; return rc; } } int ProcCreateGC(ClientPtr client) { int error, rc; GC *pGC; DrawablePtr pDraw; unsigned len; REQUEST(xCreateGCReq); REQUEST_AT_LEAST_SIZE(xCreateGCReq); client->errorValue = stuff->gc; LEGAL_NEW_RESOURCE(stuff->gc, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixGetAttrAccess); if (rc != Success) return rc; len = client->req_len - bytes_to_int32(sizeof(xCreateGCReq)); if (len != Ones(stuff->mask)) return BadLength; pGC = (GC *) CreateGC(pDraw, stuff->mask, (XID *) &stuff[1], &error, stuff->gc, client); if (error != Success) return error; if (!AddResource(stuff->gc, RT_GC, (void *) pGC)) return BadAlloc; return Success; } int ProcChangeGC(ClientPtr client) { GC *pGC; int result; unsigned len; REQUEST(xChangeGCReq); REQUEST_AT_LEAST_SIZE(xChangeGCReq); result = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess); if (result != Success) return result; len = client->req_len - bytes_to_int32(sizeof(xChangeGCReq)); if (len != Ones(stuff->mask)) return BadLength; return ChangeGCXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]); } int ProcCopyGC(ClientPtr client) { GC *dstGC; GC *pGC; int result; REQUEST(xCopyGCReq); REQUEST_SIZE_MATCH(xCopyGCReq); result = dixLookupGC(&pGC, stuff->srcGC, client, DixGetAttrAccess); if (result != Success) return result; result = dixLookupGC(&dstGC, stuff->dstGC, client, DixSetAttrAccess); if (result != Success) return result; if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) return BadMatch; if (stuff->mask & ~GCAllBits) { client->errorValue = stuff->mask; return BadValue; } return CopyGC(pGC, dstGC, stuff->mask); } int ProcSetDashes(ClientPtr client) { GC *pGC; int result; REQUEST(xSetDashesReq); REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); if (stuff->nDashes == 0) { client->errorValue = 0; return BadValue; } result = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess); if (result != Success) return result; /* If there's an error, either there's no sensible errorValue, * or there was a dash segment of 0. */ client->errorValue = 0; return SetDashes(pGC, stuff->dashOffset, stuff->nDashes, (unsigned char *) &stuff[1]); } int ProcSetClipRectangles(ClientPtr client) { int nr, result; GC *pGC; REQUEST(xSetClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) && (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded)) { client->errorValue = stuff->ordering; return BadValue; } result = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess); if (result != Success) return result; nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); if (nr & 4) return BadLength; nr >>= 3; return SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, nr, (xRectangle *) &stuff[1], (int) stuff->ordering); } int ProcFreeGC(ClientPtr client) { GC *pGC; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupGC(&pGC, stuff->id, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->id, RT_NONE); return Success; } int ProcClearToBackground(ClientPtr client) { REQUEST(xClearAreaReq); WindowPtr pWin; int rc; REQUEST_SIZE_MATCH(xClearAreaReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess); if (rc != Success) return rc; if (pWin->drawable.class == InputOnly) { client->errorValue = stuff->window; return BadMatch; } if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse)) { client->errorValue = stuff->exposures; return BadValue; } (*pWin->drawable.pScreen->ClearToBackground) (pWin, stuff->x, stuff->y, stuff->width, stuff->height, (Bool) stuff->exposures); return Success; } /* send GraphicsExpose events, or a NoExpose event, based on the region */ void SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable, int major, int minor) { if (pRgn && !RegionNil(pRgn)) { xEvent *pEvent; xEvent *pe; BoxPtr pBox; int i; int numRects; numRects = RegionNumRects(pRgn); pBox = RegionRects(pRgn); if (!(pEvent = calloc(numRects, sizeof(xEvent)))) return; pe = pEvent; for (i = 1; i <= numRects; i++, pe++, pBox++) { pe->u.u.type = GraphicsExpose; pe->u.graphicsExposure.drawable = drawable; pe->u.graphicsExposure.x = pBox->x1; pe->u.graphicsExposure.y = pBox->y1; pe->u.graphicsExposure.width = pBox->x2 - pBox->x1; pe->u.graphicsExposure.height = pBox->y2 - pBox->y1; pe->u.graphicsExposure.count = numRects - i; pe->u.graphicsExposure.majorEvent = major; pe->u.graphicsExposure.minorEvent = minor; } /* GraphicsExpose is a "critical event", which TryClientEvents * handles specially. */ TryClientEvents(client, NULL, pEvent, numRects, (Mask) 0, NoEventMask, NullGrab); free(pEvent); } else { xEvent event = { .u.noExposure.drawable = drawable, .u.noExposure.majorEvent = major, .u.noExposure.minorEvent = minor }; event.u.u.type = NoExpose; WriteEventsToClient(client, 1, &event); } } int ProcCopyArea(ClientPtr client) { DrawablePtr pDst; DrawablePtr pSrc; GC *pGC; REQUEST(xCopyAreaReq); RegionPtr pRgn; int rc; REQUEST_SIZE_MATCH(xCopyAreaReq); VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess); if (stuff->dstDrawable != stuff->srcDrawable) { rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0, DixReadAccess); if (rc != Success) return rc; if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) { client->errorValue = stuff->dstDrawable; return BadMatch; } } else pSrc = pDst; pRgn = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, stuff->srcX, stuff->srcY, stuff->width, stuff->height, stuff->dstX, stuff->dstY); if (pGC->graphicsExposures) { SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyArea, 0); if (pRgn) RegionDestroy(pRgn); } return Success; } int ProcCopyPlane(ClientPtr client) { DrawablePtr psrcDraw, pdstDraw; GC *pGC; REQUEST(xCopyPlaneReq); RegionPtr pRgn; int rc; REQUEST_SIZE_MATCH(xCopyPlaneReq); VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess); if (stuff->dstDrawable != stuff->srcDrawable) { rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (pdstDraw->pScreen != psrcDraw->pScreen) { client->errorValue = stuff->dstDrawable; return BadMatch; } } else psrcDraw = pdstDraw; /* Check to see if stuff->bitPlane has exactly ONE good bit set */ if (stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) || (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) { client->errorValue = stuff->bitPlane; return BadValue; } pRgn = (*pGC->ops->CopyPlane) (psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY, stuff->width, stuff->height, stuff->dstX, stuff->dstY, stuff->bitPlane); if (pGC->graphicsExposures) { SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); if (pRgn) RegionDestroy(pRgn); } return Success; } int ProcPolyPoint(ClientPtr client) { int npoint; GC *pGC; DrawablePtr pDraw; REQUEST(xPolyPointReq); REQUEST_AT_LEAST_SIZE(xPolyPointReq); if ((stuff->coordMode != CoordModeOrigin) && (stuff->coordMode != CoordModePrevious)) { client->errorValue = stuff->coordMode; return BadValue; } VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq)); if (npoint) (*pGC->ops->PolyPoint) (pDraw, pGC, stuff->coordMode, npoint, (xPoint *) &stuff[1]); return Success; } int ProcPolyLine(ClientPtr client) { int npoint; GC *pGC; DrawablePtr pDraw; REQUEST(xPolyLineReq); REQUEST_AT_LEAST_SIZE(xPolyLineReq); if ((stuff->coordMode != CoordModeOrigin) && (stuff->coordMode != CoordModePrevious)) { client->errorValue = stuff->coordMode; return BadValue; } VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq)); if (npoint > 1) (*pGC->ops->Polylines) (pDraw, pGC, stuff->coordMode, npoint, (DDXPointPtr) &stuff[1]); return Success; } int ProcPolySegment(ClientPtr client) { int nsegs; GC *pGC; DrawablePtr pDraw; REQUEST(xPolySegmentReq); REQUEST_AT_LEAST_SIZE(xPolySegmentReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); if (nsegs & 4) return BadLength; nsegs >>= 3; if (nsegs) (*pGC->ops->PolySegment) (pDraw, pGC, nsegs, (xSegment *) &stuff[1]); return Success; } int ProcPolyRectangle(ClientPtr client) { int nrects; GC *pGC; DrawablePtr pDraw; REQUEST(xPolyRectangleReq); REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); if (nrects & 4) return BadLength; nrects >>= 3; if (nrects) (*pGC->ops->PolyRectangle) (pDraw, pGC, nrects, (xRectangle *) &stuff[1]); return Success; } int ProcPolyArc(ClientPtr client) { int narcs; GC *pGC; DrawablePtr pDraw; REQUEST(xPolyArcReq); REQUEST_AT_LEAST_SIZE(xPolyArcReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); narcs = (client->req_len << 2) - sizeof(xPolyArcReq); if (narcs % sizeof(xArc)) return BadLength; narcs /= sizeof(xArc); if (narcs) (*pGC->ops->PolyArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); return Success; } int ProcFillPoly(ClientPtr client) { int things; GC *pGC; DrawablePtr pDraw; REQUEST(xFillPolyReq); REQUEST_AT_LEAST_SIZE(xFillPolyReq); if ((stuff->shape != Complex) && (stuff->shape != Nonconvex) && (stuff->shape != Convex)) { client->errorValue = stuff->shape; return BadValue; } if ((stuff->coordMode != CoordModeOrigin) && (stuff->coordMode != CoordModePrevious)) { client->errorValue = stuff->coordMode; return BadValue; } VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); things = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq)); if (things) (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape, stuff->coordMode, things, (DDXPointPtr) &stuff[1]); return Success; } int ProcPolyFillRectangle(ClientPtr client) { int things; GC *pGC; DrawablePtr pDraw; REQUEST(xPolyFillRectangleReq); REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); if (things & 4) return BadLength; things >>= 3; if (things) (*pGC->ops->PolyFillRect) (pDraw, pGC, things, (xRectangle *) &stuff[1]); return Success; } int ProcPolyFillArc(ClientPtr client) { int narcs; GC *pGC; DrawablePtr pDraw; REQUEST(xPolyFillArcReq); REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); if (narcs % sizeof(xArc)) return BadLength; narcs /= sizeof(xArc); if (narcs) (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); return Success; } #ifdef MATCH_CLIENT_ENDIAN int ServerOrder(void) { int whichbyte = 1; if (*((char *) &whichbyte)) return LSBFirst; return MSBFirst; } #define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder()) void ReformatImage(char *base, int nbytes, int bpp, int order) { switch (bpp) { case 1: /* yuck */ if (BITMAP_BIT_ORDER != order) BitOrderInvert((unsigned char *) base, nbytes); #if IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER && BITMAP_SCANLINE_UNIT != 8 ReformatImage(base, nbytes, BITMAP_SCANLINE_UNIT, order); #endif break; case 4: break; /* yuck */ case 8: break; case 16: if (IMAGE_BYTE_ORDER != order) TwoByteSwap((unsigned char *) base, nbytes); break; case 32: if (IMAGE_BYTE_ORDER != order) FourByteSwap((unsigned char *) base, nbytes); break; } } #else #define ReformatImage(b,n,bpp,o) #endif /* 64-bit server notes: the protocol restricts padding of images to * 8-, 16-, or 32-bits. We would like to have 64-bits for the server * to use internally. Removes need for internal alignment checking. * All of the PutImage functions could be changed individually, but * as currently written, they call other routines which require things * to be 64-bit padded on scanlines, so we changed things here. * If an image would be padded differently for 64- versus 32-, then * copy each scanline to a 64-bit padded scanline. * Also, we need to make sure that the image is aligned on a 64-bit * boundary, even if the scanlines are padded to our satisfaction. */ int ProcPutImage(ClientPtr client) { GC *pGC; DrawablePtr pDraw; long length; /* length of scanline server padded */ long lengthProto; /* length of scanline protocol padded */ char *tmpImage; REQUEST(xPutImageReq); REQUEST_AT_LEAST_SIZE(xPutImageReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); if (stuff->format == XYBitmap) { if ((stuff->depth != 1) || (stuff->leftPad >= (unsigned int) screenInfo.bitmapScanlinePad)) return BadMatch; length = BitmapBytePad(stuff->width + stuff->leftPad); } else if (stuff->format == XYPixmap) { if ((pDraw->depth != stuff->depth) || (stuff->leftPad >= (unsigned int) screenInfo.bitmapScanlinePad)) return BadMatch; length = BitmapBytePad(stuff->width + stuff->leftPad); length *= stuff->depth; } else if (stuff->format == ZPixmap) { if ((pDraw->depth != stuff->depth) || (stuff->leftPad != 0)) return BadMatch; length = PixmapBytePad(stuff->width, stuff->depth); } else { client->errorValue = stuff->format; return BadValue; } tmpImage = (char *) &stuff[1]; lengthProto = length; if (stuff->height != 0 && lengthProto >= (INT32_MAX / stuff->height)) return BadLength; if ((bytes_to_int32(lengthProto * stuff->height) + bytes_to_int32(sizeof(xPutImageReq))) != client->req_len) return BadLength; ReformatImage(tmpImage, lengthProto * stuff->height, stuff->format == ZPixmap ? BitsPerPixel(stuff->depth) : 1, ClientOrder(client)); (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY, stuff->width, stuff->height, stuff->leftPad, stuff->format, tmpImage); return Success; } static int DoGetImage(ClientPtr client, int format, Drawable drawable, int x, int y, int width, int height, Mask planemask) { DrawablePtr pDraw, pBoundingDraw; int nlines, linesPerBuf, rc; int linesDone; /* coordinates relative to the bounding drawable */ int relx, rely; long widthBytesLine, length; Mask plane = 0; char *pBuf; xGetImageReply xgi; RegionPtr pVisibleRegion = NULL; if ((format != XYPixmap) && (format != ZPixmap)) { client->errorValue = format; return BadValue; } rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixReadAccess); if (rc != Success) return rc; memset(&xgi, 0, sizeof(xGetImageReply)); relx = x; rely = y; if (pDraw->type == DRAWABLE_WINDOW) { WindowPtr pWin = (WindowPtr) pDraw; /* "If the drawable is a window, the window must be viewable ... or a * BadMatch error results" */ if (!pWin->viewable) return BadMatch; /* If the drawable is a window, the rectangle must be contained within * its bounds (including the border). */ if (x < -wBorderWidth(pWin) || x + width > wBorderWidth(pWin) + (int) pDraw->width || y < -wBorderWidth(pWin) || y + height > wBorderWidth(pWin) + (int) pDraw->height) return BadMatch; relx += pDraw->x; rely += pDraw->y; if (pDraw->pScreen->GetWindowPixmap) { PixmapPtr pPix = (*pDraw->pScreen->GetWindowPixmap) (pWin); pBoundingDraw = &pPix->drawable; #ifdef COMPOSITE relx -= pPix->screen_x; rely -= pPix->screen_y; #endif } else { pBoundingDraw = (DrawablePtr) pDraw->pScreen->root; } xgi.visual = wVisual(pWin); } else { pBoundingDraw = pDraw; xgi.visual = None; } /* "If the drawable is a pixmap, the given rectangle must be wholly * contained within the pixmap, or a BadMatch error results. If the * drawable is a window [...] it must be the case that if there were no * inferiors or overlapping windows, the specified rectangle of the window * would be fully visible on the screen and wholly contained within the * outside edges of the window, or a BadMatch error results." * * We relax the window case slightly to mean that the rectangle must exist * within the bounds of the window's backing pixmap. In particular, this * means that a GetImage request may succeed or fail with BadMatch depending * on whether any of its ancestor windows are redirected. */ if (relx < 0 || relx + width > (int) pBoundingDraw->width || rely < 0 || rely + height > (int) pBoundingDraw->height) return BadMatch; xgi.type = X_Reply; xgi.sequenceNumber = client->sequence; xgi.depth = pDraw->depth; if (format == ZPixmap) { widthBytesLine = PixmapBytePad(width, pDraw->depth); length = widthBytesLine * height; } else { widthBytesLine = BitmapBytePad(width); plane = ((Mask) 1) << (pDraw->depth - 1); /* only planes asked for */ length = widthBytesLine * height * Ones(planemask & (plane | (plane - 1))); } xgi.length = length; xgi.length = bytes_to_int32(xgi.length); if (widthBytesLine == 0 || height == 0) linesPerBuf = 0; else if (widthBytesLine >= IMAGE_BUFSIZE) linesPerBuf = 1; else { linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; if (linesPerBuf > height) linesPerBuf = height; } length = linesPerBuf * widthBytesLine; if (linesPerBuf < height) { /* we have to make sure intermediate buffers don't need padding */ while ((linesPerBuf > 1) && (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1))) { linesPerBuf--; length -= widthBytesLine; } while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1)) { linesPerBuf++; length += widthBytesLine; } } if (!(pBuf = calloc(1, length))) return BadAlloc; WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); if (pDraw->type == DRAWABLE_WINDOW) { pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw); if (pVisibleRegion) { RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y); } } if (linesPerBuf == 0) { /* nothing to do */ } else if (format == ZPixmap) { linesDone = 0; while (height - linesDone > 0) { nlines = min(linesPerBuf, height - linesDone); (*pDraw->pScreen->GetImage) (pDraw, x, y + linesDone, width, nlines, format, planemask, (void *) pBuf); if (pVisibleRegion) XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y + linesDone, width, nlines, format, pBuf); /* Note that this is NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ ReformatImage(pBuf, (int) (nlines * widthBytesLine), BitsPerPixel(pDraw->depth), ClientOrder(client)); WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); linesDone += nlines; } } else { /* XYPixmap */ for (; plane; plane >>= 1) { if (planemask & plane) { linesDone = 0; while (height - linesDone > 0) { nlines = min(linesPerBuf, height - linesDone); (*pDraw->pScreen->GetImage) (pDraw, x, y + linesDone, width, nlines, format, plane, (void *) pBuf); if (pVisibleRegion) XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y + linesDone, width, nlines, format, pBuf); /* Note: NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ ReformatImage(pBuf, (int) (nlines * widthBytesLine), 1, ClientOrder(client)); WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); linesDone += nlines; } } } } if (pVisibleRegion) RegionDestroy(pVisibleRegion); free(pBuf); return Success; } int ProcGetImage(ClientPtr client) { REQUEST(xGetImageReq); REQUEST_SIZE_MATCH(xGetImageReq); return DoGetImage(client, stuff->format, stuff->drawable, stuff->x, stuff->y, (int) stuff->width, (int) stuff->height, stuff->planeMask); } int ProcPolyText(ClientPtr client) { int err; REQUEST(xPolyTextReq); DrawablePtr pDraw; GC *pGC; REQUEST_AT_LEAST_SIZE(xPolyTextReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); err = PolyText(client, pDraw, pGC, (unsigned char *) &stuff[1], ((unsigned char *) stuff) + (client->req_len << 2), stuff->x, stuff->y, stuff->reqType, stuff->drawable); if (err == Success) { return Success; } else return err; } int ProcImageText8(ClientPtr client) { int err; DrawablePtr pDraw; GC *pGC; REQUEST(xImageTextReq); REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); err = ImageText(client, pDraw, pGC, stuff->nChars, (unsigned char *) &stuff[1], stuff->x, stuff->y, stuff->reqType, stuff->drawable); if (err == Success) { return Success; } else return err; } int ProcImageText16(ClientPtr client) { int err; DrawablePtr pDraw; GC *pGC; REQUEST(xImageTextReq); REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); err = ImageText(client, pDraw, pGC, stuff->nChars, (unsigned char *) &stuff[1], stuff->x, stuff->y, stuff->reqType, stuff->drawable); if (err == Success) { return Success; } else return err; } int ProcCreateColormap(ClientPtr client) { VisualPtr pVisual; ColormapPtr pmap; Colormap mid; WindowPtr pWin; ScreenPtr pScreen; REQUEST(xCreateColormapReq); int i, result; REQUEST_SIZE_MATCH(xCreateColormapReq); if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll)) { client->errorValue = stuff->alloc; return BadValue; } mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); result = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (result != Success) return result; pScreen = pWin->drawable.pScreen; for (i = 0, pVisual = pScreen->visuals; i < pScreen->numVisuals; i++, pVisual++) { if (pVisual->vid != stuff->visual) continue; return CreateColormap(mid, pScreen, pVisual, &pmap, (int) stuff->alloc, client->index); } client->errorValue = stuff->visual; return BadMatch; } int ProcFreeColormap(ClientPtr client) { ColormapPtr pmap; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupResourceByType((void **) &pmap, stuff->id, RT_COLORMAP, client, DixDestroyAccess); if (rc == Success) { /* Freeing a default colormap is a no-op */ if (!(pmap->flags & IsDefault)) FreeResource(stuff->id, RT_NONE); return Success; } else { client->errorValue = stuff->id; return rc; } } int ProcCopyColormapAndFree(ClientPtr client) { Colormap mid; ColormapPtr pSrcMap; REQUEST(xCopyColormapAndFreeReq); int rc; REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); rc = dixLookupResourceByType((void **) &pSrcMap, stuff->srcCmap, RT_COLORMAP, client, DixReadAccess | DixRemoveAccess); if (rc == Success) return CopyColormapAndFree(mid, pSrcMap, client->index); client->errorValue = stuff->srcCmap; return rc; } int ProcInstallColormap(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->id, RT_COLORMAP, client, DixInstallAccess); if (rc != Success) goto out; rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); if (rc != Success) { if (rc == BadValue) rc = BadColor; goto out; } (*(pcmp->pScreen->InstallColormap)) (pcmp); return Success; out: client->errorValue = stuff->id; return rc; } int ProcUninstallColormap(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->id, RT_COLORMAP, client, DixUninstallAccess); if (rc != Success) goto out; rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); if (rc != Success) { if (rc == BadValue) rc = BadColor; goto out; } if (pcmp->mid != pcmp->pScreen->defColormap) (*(pcmp->pScreen->UninstallColormap)) (pcmp); return Success; out: client->errorValue = stuff->id; return rc; } int ProcListInstalledColormaps(ClientPtr client) { xListInstalledColormapsReply *preply; int nummaps, rc; WindowPtr pWin; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, DixGetAttrAccess); if (rc != Success) return rc; preply = malloc(sizeof(xListInstalledColormapsReply) + pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if (!preply) return BadAlloc; preply->type = X_Reply; preply->sequenceNumber = client->sequence; nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) (pWin->drawable.pScreen, (Colormap *) &preply[1]); preply->nColormaps = nummaps; preply->length = nummaps; WriteReplyToClient(client, sizeof(xListInstalledColormapsReply), preply); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); free(preply); return Success; } int ProcAllocColor(ClientPtr client) { ColormapPtr pmap; int rc; REQUEST(xAllocColorReq); REQUEST_SIZE_MATCH(xAllocColorReq); rc = dixLookupResourceByType((void **) &pmap, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { 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; #ifdef PANORAMIX if (noPanoramiXExtension || !pmap->pScreen->myNum) #endif WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); return Success; } else { client->errorValue = stuff->cmap; return rc; } } int ProcAllocNamedColor(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xAllocNamedColorReq); REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { 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)) { ancr.screenRed = ancr.exactRed; ancr.screenGreen = ancr.exactGreen; ancr.screenBlue = ancr.exactBlue; ancr.pixel = 0; if ((rc = AllocColor(pcmp, &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue, &ancr.pixel, client->index))) return rc; #ifdef PANORAMIX if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif WriteReplyToClient(client, sizeof(xAllocNamedColorReply), &ancr); return Success; } else return BadName; } else { client->errorValue = stuff->cmap; return rc; } } int ProcAllocColorCells(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xAllocColorCellsReq); REQUEST_SIZE_MATCH(xAllocColorCellsReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { int npixels, nmasks; long length; Pixel *ppixels, *pmasks; npixels = stuff->colors; if (!npixels) { client->errorValue = npixels; return BadValue; } if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) { client->errorValue = stuff->contiguous; return BadValue; } nmasks = stuff->planes; length = ((long) npixels + (long) nmasks) * sizeof(Pixel); ppixels = malloc(length); if (!ppixels) return BadAlloc; pmasks = ppixels + npixels; if ((rc = AllocColorCells(client->index, pcmp, npixels, nmasks, (Bool) stuff->contiguous, ppixels, pmasks))) { free(ppixels); return rc; } #ifdef PANORAMIX if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif { 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); } free(ppixels); return Success; } else { client->errorValue = stuff->cmap; return rc; } } int ProcAllocColorPlanes(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xAllocColorPlanesReq); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { xAllocColorPlanesReply acpr; int npixels; long length; Pixel *ppixels; npixels = stuff->colors; if (!npixels) { client->errorValue = npixels; return BadValue; } if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) { client->errorValue = stuff->contiguous; return BadValue; } acpr = (xAllocColorPlanesReply) { .type = X_Reply, .sequenceNumber = client->sequence, .nPixels = npixels }; length = (long) npixels *sizeof(Pixel); ppixels = malloc(length); if (!ppixels) return BadAlloc; if ((rc = AllocColorPlanes(client->index, pcmp, npixels, (int) stuff->red, (int) stuff->green, (int) stuff->blue, (Bool) stuff->contiguous, ppixels, &acpr.redMask, &acpr.greenMask, &acpr.blueMask))) { free(ppixels); return rc; } acpr.length = bytes_to_int32(length); #ifdef PANORAMIX if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif { WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, length, ppixels); } free(ppixels); return Success; } else { client->errorValue = stuff->cmap; return rc; } } int ProcFreeColors(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixRemoveAccess); if (rc == Success) { int count; if (pcmp->flags & AllAllocated) return BadAccess; count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq)); return FreeColors(pcmp, client->index, count, (Pixel *) &stuff[1], (Pixel) stuff->planeMask); } else { client->errorValue = stuff->cmap; return rc; } } int ProcStoreColors(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xStoreColorsReq); REQUEST_AT_LEAST_SIZE(xStoreColorsReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixWriteAccess); if (rc == Success) { int count; count = (client->req_len << 2) - sizeof(xStoreColorsReq); if (count % sizeof(xColorItem)) return BadLength; count /= sizeof(xColorItem); return StoreColors(pcmp, count, (xColorItem *) &stuff[1], client); } else { client->errorValue = stuff->cmap; return rc; } } int ProcStoreNamedColor(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xStoreNamedColorReq); REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixWriteAccess); if (rc == Success) { xColorItem def; if (OsLookupColor(pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, &def.red, &def.green, &def.blue)) { def.flags = stuff->flags; def.pixel = stuff->pixel; return StoreColors(pcmp, 1, &def, client); } return BadName; } else { client->errorValue = stuff->cmap; return rc; } } int ProcQueryColors(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xQueryColorsReq); REQUEST_AT_LEAST_SIZE(xQueryColorsReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { int count; xrgb *prgbs; xQueryColorsReply qcr; count = bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq)); prgbs = calloc(1, count * sizeof(xrgb)); if (!prgbs && count) return BadAlloc; if ((rc = QueryColors(pcmp, count, (Pixel *) &stuff[1], prgbs, client))) { free(prgbs); return rc; } 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; WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); } free(prgbs); return Success; } else { client->errorValue = stuff->cmap; return rc; } } int ProcLookupColor(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xLookupColorReq); REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { CARD16 exactRed, exactGreen, exactBlue; if (OsLookupColor (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, &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); WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); return Success; } return BadName; } else { client->errorValue = stuff->cmap; return rc; } } int ProcCreateCursor(ClientPtr client) { CursorPtr pCursor; PixmapPtr src; PixmapPtr msk; unsigned char *srcbits; unsigned char *mskbits; unsigned short width, height; long n; CursorMetricRec cm; int rc; REQUEST(xCreateCursorReq); REQUEST_SIZE_MATCH(xCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); rc = dixLookupResourceByType((void **) &src, stuff->source, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->source; return rc; } if (src->drawable.depth != 1) return (BadMatch); /* Find and validate cursor mask pixmap, if one is provided */ if (stuff->mask != None) { rc = dixLookupResourceByType((void **) &msk, stuff->mask, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->mask; return rc; } if (src->drawable.width != msk->drawable.width || src->drawable.height != msk->drawable.height || src->drawable.depth != 1 || msk->drawable.depth != 1) return BadMatch; } else msk = NULL; width = src->drawable.width; height = src->drawable.height; if (stuff->x > width || stuff->y > height) return BadMatch; n = BitmapBytePad(width) * height; srcbits = calloc(1, n); if (!srcbits) return BadAlloc; mskbits = malloc(n); if (!mskbits) { free(srcbits); return BadAlloc; } (*src->drawable.pScreen->GetImage) ((DrawablePtr) src, 0, 0, width, height, XYPixmap, 1, (void *) srcbits); if (msk == (PixmapPtr) NULL) { unsigned char *bits = mskbits; while (--n >= 0) *bits++ = ~0; } else { /* zeroing the (pad) bits helps some ddx cursor handling */ memset((char *) mskbits, 0, n); (*msk->drawable.pScreen->GetImage) ((DrawablePtr) msk, 0, 0, width, height, XYPixmap, 1, (void *) mskbits); } cm.width = width; cm.height = height; cm.xhot = stuff->x; cm.yhot = stuff->y; rc = AllocARGBCursor(srcbits, mskbits, NULL, &cm, stuff->foreRed, stuff->foreGreen, stuff->foreBlue, stuff->backRed, stuff->backGreen, stuff->backBlue, &pCursor, client, stuff->cid); if (rc != Success) goto bail; if (!AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) { rc = BadAlloc; goto bail; } return Success; bail: free(srcbits); free(mskbits); return rc; } int ProcCreateGlyphCursor(ClientPtr client) { CursorPtr pCursor; int res; REQUEST(xCreateGlyphCursorReq); REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); res = AllocGlyphCursor(stuff->source, stuff->sourceChar, stuff->mask, stuff->maskChar, stuff->foreRed, stuff->foreGreen, stuff->foreBlue, stuff->backRed, stuff->backGreen, stuff->backBlue, &pCursor, client, stuff->cid); if (res != Success) return res; if (AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) return Success; return BadAlloc; } int ProcFreeCursor(ClientPtr client) { CursorPtr pCursor; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupResourceByType((void **) &pCursor, stuff->id, RT_CURSOR, client, DixDestroyAccess); if (rc == Success) { FreeResource(stuff->id, RT_NONE); return Success; } else { client->errorValue = stuff->id; return rc; } } int ProcQueryBestSize(ClientPtr client) { xQueryBestSizeReply reply; DrawablePtr pDraw; ScreenPtr pScreen; int rc; REQUEST(xQueryBestSizeReq); REQUEST_SIZE_MATCH(xQueryBestSizeReq); if ((stuff->class != CursorShape) && (stuff->class != TileShape) && (stuff->class != StippleShape)) { client->errorValue = stuff->class; return BadValue; } rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, DixGetAttrAccess); if (rc != Success) return rc; if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) return BadMatch; pScreen = pDraw->pScreen; rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess); if (rc != Success) return rc; (*pScreen->QueryBestSize) (stuff->class, &stuff->width, &stuff->height, pScreen); reply = (xQueryBestSizeReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .width = stuff->width, .height = stuff->height }; WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); return Success; } int ProcSetScreenSaver(ClientPtr client) { int rc, i, blankingOption, exposureOption; REQUEST(xSetScreenSaverReq); REQUEST_SIZE_MATCH(xSetScreenSaverReq); for (i = 0; i < screenInfo.numScreens; i++) { rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i], DixSetAttrAccess); if (rc != Success) return rc; } blankingOption = stuff->preferBlank; if ((blankingOption != DontPreferBlanking) && (blankingOption != PreferBlanking) && (blankingOption != DefaultBlanking)) { client->errorValue = blankingOption; return BadValue; } exposureOption = stuff->allowExpose; if ((exposureOption != DontAllowExposures) && (exposureOption != AllowExposures) && (exposureOption != DefaultExposures)) { client->errorValue = exposureOption; return BadValue; } if (stuff->timeout < -1) { client->errorValue = stuff->timeout; return BadValue; } if (stuff->interval < -1) { client->errorValue = stuff->interval; return BadValue; } if (blankingOption == DefaultBlanking) ScreenSaverBlanking = defaultScreenSaverBlanking; else ScreenSaverBlanking = blankingOption; if (exposureOption == DefaultExposures) ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; else ScreenSaverAllowExposures = exposureOption; if (stuff->timeout >= 0) ScreenSaverTime = stuff->timeout * MILLI_PER_SECOND; else ScreenSaverTime = defaultScreenSaverTime; if (stuff->interval >= 0) ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND; else ScreenSaverInterval = defaultScreenSaverInterval; SetScreenSaverTimer(); return Success; } int ProcGetScreenSaver(ClientPtr client) { xGetScreenSaverReply rep; int rc, i; REQUEST_SIZE_MATCH(xReq); for (i = 0; i < screenInfo.numScreens; i++) { rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i], DixGetAttrAccess); if (rc != Success) return rc; } 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; } int ProcChangeHosts(ClientPtr client) { REQUEST(xChangeHostsReq); REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength); if (stuff->mode == HostInsert) return AddHost(client, (int) stuff->hostFamily, stuff->hostLength, (void *) &stuff[1]); if (stuff->mode == HostDelete) return RemoveHost(client, (int) stuff->hostFamily, stuff->hostLength, (void *) &stuff[1]); client->errorValue = stuff->mode; return BadValue; } int ProcListHosts(ClientPtr client) { xListHostsReply reply; int len, nHosts, result; BOOL enabled; void *pdata; /* REQUEST(xListHostsReq); */ REQUEST_SIZE_MATCH(xListHostsReq); /* untrusted clients can't list hosts */ result = XaceHook(XACE_SERVER_ACCESS, client, DixReadAccess); if (result != Success) return result; result = GetHosts(&pdata, &nHosts, &len, &enabled); if (result != Success) return result; 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; WriteSwappedDataToClient(client, len, pdata); } free(pdata); return Success; } int ProcChangeAccessControl(ClientPtr client) { REQUEST(xSetAccessControlReq); REQUEST_SIZE_MATCH(xSetAccessControlReq); if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess)) { client->errorValue = stuff->mode; return BadValue; } return ChangeAccessControl(client, stuff->mode == EnableAccess); } /********************* * CloseDownRetainedResources * * Find all clients that are gone and have terminated in RetainTemporary * and destroy their resources. *********************/ static void CloseDownRetainedResources(void) { int i; ClientPtr client; for (i = 1; i < currentMaxClients; i++) { client = clients[i]; if (client && (client->closeDownMode == RetainTemporary) && (client->clientGone)) CloseDownClient(client); } } int ProcKillClient(ClientPtr client) { REQUEST(xResourceReq); ClientPtr killclient; int rc; REQUEST_SIZE_MATCH(xResourceReq); if (stuff->id == AllTemporary) { CloseDownRetainedResources(); return Success; } rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess); if (rc == Success) { CloseDownClient(killclient); if (client == killclient) { /* force yield and return Success, so that Dispatch() * doesn't try to touch client */ isItTimeToYield = TRUE; } return Success; } else return rc; } int ProcSetFontPath(ClientPtr client) { unsigned char *ptr; unsigned long nbytes, total; long nfonts; int n; REQUEST(xSetFontPathReq); REQUEST_AT_LEAST_SIZE(xSetFontPathReq); nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq); total = nbytes; ptr = (unsigned char *) &stuff[1]; nfonts = stuff->nFonts; while (--nfonts >= 0) { if ((total == 0) || (total < (n = (*ptr + 1)))) return BadLength; total -= n; ptr += n; } if (total >= 4) return BadLength; return SetFontPath(client, stuff->nFonts, (unsigned char *) &stuff[1]); } int ProcGetFontPath(ClientPtr client) { xGetFontPathReply reply; int rc, stringLens, numpaths; unsigned char *bufferStart; /* REQUEST (xReq); */ REQUEST_SIZE_MATCH(xReq); rc = GetFontPath(client, &numpaths, &stringLens, &bufferStart); if (rc != Success) return rc; reply = (xGetFontPathReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = bytes_to_int32(stringLens + numpaths), .nPaths = numpaths }; WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); if (stringLens || numpaths) WriteToClient(client, stringLens + numpaths, bufferStart); return Success; } int ProcChangeCloseDownMode(ClientPtr client) { int rc; REQUEST(xSetCloseDownModeReq); REQUEST_SIZE_MATCH(xSetCloseDownModeReq); rc = XaceHook(XACE_CLIENT_ACCESS, client, client, DixManageAccess); if (rc != Success) return rc; if ((stuff->mode == AllTemporary) || (stuff->mode == RetainPermanent) || (stuff->mode == RetainTemporary)) { client->closeDownMode = stuff->mode; return Success; } else { client->errorValue = stuff->mode; return BadValue; } } int ProcForceScreenSaver(ClientPtr client) { int rc; REQUEST(xForceScreenSaverReq); REQUEST_SIZE_MATCH(xForceScreenSaverReq); if ((stuff->mode != ScreenSaverReset) && (stuff->mode != ScreenSaverActive)) { client->errorValue = stuff->mode; return BadValue; } rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, (int) stuff->mode); if (rc != Success) return rc; return Success; } int ProcNoOperation(ClientPtr client) { REQUEST_AT_LEAST_SIZE(xReq); /* noop -- don't do anything */ return Success; } /********************** * CloseDownClient * * Client can either mark his resources destroy or retain. If retained and * then killed again, the client is really destroyed. *********************/ char dispatchExceptionAtReset = DE_RESET; void CloseDownClient(ClientPtr client) { Bool really_close_down = client->clientGone || client->closeDownMode == DestroyAll; if (!client->clientGone) { /* ungrab server if grabbing client dies */ if (grabState != GrabNone && grabClient == client) { UngrabServer(client); } BITCLEAR(grabWaiters, client->index); DeleteClientFromAnySelections(client); ReleaseActiveGrabs(client); DeleteClientFontStuff(client); if (!really_close_down) { /* This frees resources that should never be retained * no matter what the close down mode is. Actually we * could do this unconditionally, but it's probably * better not to traverse all the client's resources * twice (once here, once a few lines down in * FreeClientResources) in the common case of * really_close_down == TRUE. */ FreeClientNeverRetainResources(client); client->clientState = ClientStateRetained; if (ClientStateCallback) { NewClientInfoRec clientinfo; clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *) NULL; clientinfo.setup = (xConnSetup *) NULL; CallCallbacks((&ClientStateCallback), (void *) &clientinfo); } } client->clientGone = TRUE; /* so events aren't sent to client */ if (ClientIsAsleep(client)) ClientSignal(client); ProcessWorkQueueZombies(); CloseDownConnection(client); /* If the client made it to the Running stage, nClients has * been incremented on its behalf, so we need to decrement it * now. If it hasn't gotten to Running, nClients has *not* * been incremented, so *don't* decrement it. */ if (client->clientState != ClientStateInitial) { --nClients; } } if (really_close_down) { if (client->clientState == ClientStateRunning && nClients == 0) dispatchException |= dispatchExceptionAtReset; client->clientState = ClientStateGone; if (ClientStateCallback) { NewClientInfoRec clientinfo; clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *) NULL; clientinfo.setup = (xConnSetup *) NULL; CallCallbacks((&ClientStateCallback), (void *) &clientinfo); } TouchListenerGone(client->clientAsMask); FreeClientResources(client); /* Disable client ID tracking. This must be done after * ClientStateCallback. */ ReleaseClientIds(client); #ifdef XSERVER_DTRACE XSERVER_CLIENT_DISCONNECT(client->index); #endif if (client->index < nextFreeClientID) nextFreeClientID = client->index; clients[client->index] = NullClient; SmartLastClient = NullClient; dixFreeObjectWithPrivates(client, PRIVATE_CLIENT); while (!clients[currentMaxClients - 1]) currentMaxClients--; } } static void KillAllClients(void) { int i; for (i = 1; i < currentMaxClients; i++) if (clients[i]) { /* Make sure Retained clients are released. */ clients[i]->closeDownMode = DestroyAll; CloseDownClient(clients[i]); } } void InitClient(ClientPtr client, int i, void *ospriv) { client->index = i; client->clientAsMask = ((Mask) i) << CLIENTOFFSET; client->closeDownMode = i ? DestroyAll : RetainPermanent; client->requestVector = InitialVector; client->osPrivate = ospriv; QueryMinMaxKeyCodes(&client->minKC, &client->maxKC); client->smart_start_tick = SmartScheduleTime; client->smart_stop_tick = SmartScheduleTime; client->clientIds = NULL; } /************************ * int NextAvailableClient(ospriv) * * OS dependent portion can't assign client id's because of CloseDownModes. * Returns NULL if there are no free clients. *************************/ ClientPtr NextAvailableClient(void *ospriv) { int i; ClientPtr client; xReq data; i = nextFreeClientID; if (i == MAXCLIENTS) return (ClientPtr) NULL; clients[i] = client = dixAllocateObjectWithPrivates(ClientRec, PRIVATE_CLIENT); if (!client) return (ClientPtr) NULL; InitClient(client, i, ospriv); if (!InitClientResources(client)) { dixFreeObjectWithPrivates(client, PRIVATE_CLIENT); return (ClientPtr) NULL; } data.reqType = 1; data.length = bytes_to_int32(sz_xReq + sz_xConnClientPrefix); if (!InsertFakeRequest(client, (char *) &data, sz_xReq)) { FreeClientResources(client); dixFreeObjectWithPrivates(client, PRIVATE_CLIENT); return (ClientPtr) NULL; } if (i == currentMaxClients) currentMaxClients++; while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) nextFreeClientID++; /* Enable client ID tracking. This must be done before * ClientStateCallback. */ ReserveClientIds(client); if (ClientStateCallback) { NewClientInfoRec clientinfo; clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *) NULL; clientinfo.setup = (xConnSetup *) NULL; CallCallbacks((&ClientStateCallback), (void *) &clientinfo); } return client; } int ProcInitialConnection(ClientPtr client) { REQUEST(xReq); xConnClientPrefix *prefix; int whichbyte = 1; char order; 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) + bytes_to_int32(prefix->nbytesAuthString); if (client->swapped) { swaps(&stuff->length); } if (order == 'r' || order == 'R') { client->local = FALSE; } ResetCurrentRequest(client); return Success; } static int SendConnSetup(ClientPtr client, const char *reason) { xWindowRoot *root; int i; int numScreens; char *lConnectionInfo; xConnSetupPrefix *lconnSetupPrefix; if (reason) { xConnSetupPrefix csp; csp.success = xFalse; csp.lengthReason = strlen(reason); csp.length = bytes_to_int32(csp.lengthReason); csp.majorVersion = X_PROTOCOL; csp.minorVersion = X_PROTOCOL_REVISION; if (client->swapped) WriteSConnSetupPrefix(client, &csp); else WriteToClient(client, sz_xConnSetupPrefix, &csp); WriteToClient(client, (int) csp.lengthReason, reason); return client->noClientException = -1; } numScreens = screenInfo.numScreens; lConnectionInfo = ConnectionInfo; lconnSetupPrefix = &connSetupPrefix; /* We're about to start speaking X protocol back to the client by * sending the connection setup info. This means the authorization * step is complete, and we can count the client as an * authorized one. */ nClients++; client->requestVector = client->swapped ? SwappedProcVector : ProcVector; client->sequence = 0; ((xConnSetup *) lConnectionInfo)->ridBase = client->clientAsMask; ((xConnSetup *) lConnectionInfo)->ridMask = RESOURCE_ID_MASK; #ifdef MATCH_CLIENT_ENDIAN ((xConnSetup *) lConnectionInfo)->imageByteOrder = ClientOrder(client); ((xConnSetup *) lConnectionInfo)->bitmapBitOrder = ClientOrder(client); #endif /* fill in the "currentInputMask" */ root = (xWindowRoot *) (lConnectionInfo + connBlockScreenStart); #ifdef PANORAMIX if (noPanoramiXExtension) numScreens = screenInfo.numScreens; else numScreens = ((xConnSetup *) ConnectionInfo)->numRoots; #endif for (i = 0; i < numScreens; i++) { unsigned int j; xDepth *pDepth; WindowPtr pRoot = screenInfo.screens[i]->root; root->currentInputMask = pRoot->eventMask | wOtherEventMasks(pRoot); pDepth = (xDepth *) (root + 1); for (j = 0; j < root->nDepths; j++) { pDepth = (xDepth *) (((char *) (pDepth + 1)) + pDepth->nVisuals * sizeof(xVisualType)); } root = (xWindowRoot *) pDepth; } if (client->swapped) { WriteSConnSetupPrefix(client, lconnSetupPrefix); WriteSConnectionInfo(client, (unsigned long) (lconnSetupPrefix->length << 2), lConnectionInfo); } else { WriteToClient(client, sizeof(xConnSetupPrefix), lconnSetupPrefix); WriteToClient(client, (int) (lconnSetupPrefix->length << 2), lConnectionInfo); } client->clientState = ClientStateRunning; if (ClientStateCallback) { NewClientInfoRec clientinfo; clientinfo.client = client; clientinfo.prefix = lconnSetupPrefix; clientinfo.setup = (xConnSetup *) lConnectionInfo; CallCallbacks((&ClientStateCallback), (void *) &clientinfo); } return Success; } int ProcEstablishConnection(ClientPtr client) { const char *reason; char *auth_proto, *auth_string; xConnClientPrefix *prefix; REQUEST(xReq); prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); auth_proto = (char *) prefix + sz_xConnClientPrefix; auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); if ((prefix->majorVersion != X_PROTOCOL) || (prefix->minorVersion != X_PROTOCOL_REVISION)) reason = "Protocol version mismatch"; else reason = ClientAuthorized(client, (unsigned short) prefix->nbytesAuthProto, auth_proto, (unsigned short) prefix->nbytesAuthString, auth_string); return (SendConnSetup(client, reason)); } void SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, XID resId, int errorCode) { xError rep = { .type = X_Error, .errorCode = errorCode, .resourceID = resId, .minorCode = minorCode, .majorCode = majorCode }; WriteEventsToClient(client, 1, (xEvent *) &rep); } void MarkClientException(ClientPtr client) { client->noClientException = -1; } /* * This array encodes the answer to the question "what is the log base 2 * of the number of pixels that fit in a scanline pad unit?" * Note that ~0 is an invalid entry (mostly for the benefit of the reader). */ static int answer[6][4] = { /* pad pad pad pad */ /* 8 16 32 64 */ {3, 4, 5, 6}, /* 1 bit per pixel */ {1, 2, 3, 4}, /* 4 bits per pixel */ {0, 1, 2, 3}, /* 8 bits per pixel */ {~0, 0, 1, 2}, /* 16 bits per pixel */ {~0, ~0, 0, 1}, /* 24 bits per pixel */ {~0, ~0, 0, 1} /* 32 bits per pixel */ }; /* * This array gives the answer to the question "what is the first index for * the answer array above given the number of bits per pixel?" * Note that ~0 is an invalid entry (mostly for the benefit of the reader). */ static int indexForBitsPerPixel[33] = { ~0, 0, ~0, ~0, /* 1 bit per pixel */ 1, ~0, ~0, ~0, /* 4 bits per pixel */ 2, ~0, ~0, ~0, /* 8 bits per pixel */ ~0, ~0, ~0, ~0, 3, ~0, ~0, ~0, /* 16 bits per pixel */ ~0, ~0, ~0, ~0, 4, ~0, ~0, ~0, /* 24 bits per pixel */ ~0, ~0, ~0, ~0, 5 /* 32 bits per pixel */ }; /* * This array gives the bytesperPixel value for cases where the number * of bits per pixel is a multiple of 8 but not a power of 2. */ static int answerBytesPerPixel[33] = { ~0, 0, ~0, ~0, /* 1 bit per pixel */ 0, ~0, ~0, ~0, /* 4 bits per pixel */ 0, ~0, ~0, ~0, /* 8 bits per pixel */ ~0, ~0, ~0, ~0, 0, ~0, ~0, ~0, /* 16 bits per pixel */ ~0, ~0, ~0, ~0, 3, ~0, ~0, ~0, /* 24 bits per pixel */ ~0, ~0, ~0, ~0, 0 /* 32 bits per pixel */ }; /* * This array gives the answer to the question "what is the second index for * the answer array above given the number of bits per scanline pad unit?" * Note that ~0 is an invalid entry (mostly for the benefit of the reader). */ static int indexForScanlinePad[65] = { ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 0, ~0, ~0, ~0, /* 8 bits per scanline pad unit */ ~0, ~0, ~0, ~0, 1, ~0, ~0, ~0, /* 16 bits per scanline pad unit */ ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 2, ~0, ~0, ~0, /* 32 bits per scanline pad unit */ ~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, 3 /* 64 bits per scanline pad unit */ }; /* grow the array of screenRecs if necessary. call the device-supplied initialization procedure with its screen number, a pointer to its ScreenRec, argc, and argv. return the number of successfully installed screens. */ static int init_screen(ScreenPtr pScreen, int i, Bool gpu) { int scanlinepad, format, depth, bitsPerPixel, j, k; dixInitScreenSpecificPrivates(pScreen); if (!dixAllocatePrivates(&pScreen->devPrivates, PRIVATE_SCREEN)) { 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 * one at a time calling AddScreen() after each, then each * iteration will make it a little more accurate. Worst case * we do this loop N * numPixmapFormats where N is # of screens. * Anyway, this must be called after InitOutput and before the * screen init routine is called. */ for (format = 0; format < screenInfo.numPixmapFormats; format++) { depth = screenInfo.formats[format].depth; bitsPerPixel = screenInfo.formats[format].bitsPerPixel; scanlinepad = screenInfo.formats[format].scanlinePad; j = indexForBitsPerPixel[bitsPerPixel]; k = indexForScanlinePad[scanlinepad]; PixmapWidthPaddingInfo[depth].padPixelsLog2 = answer[j][k]; PixmapWidthPaddingInfo[depth].padRoundUp = (scanlinepad / bitsPerPixel) - 1; j = indexForBitsPerPixel[8]; /* bits per byte */ PixmapWidthPaddingInfo[depth].padBytesLog2 = answer[j][k]; PixmapWidthPaddingInfo[depth].bitsPerPixel = bitsPerPixel; if (answerBytesPerPixel[bitsPerPixel]) { PixmapWidthPaddingInfo[depth].notPower2 = 1; PixmapWidthPaddingInfo[depth].bytesPerPixel = answerBytesPerPixel[bitsPerPixel]; } else { 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 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.screens[i] = pScreen; screenInfo.numScreens++; if (!(*pfnInit) (pScreen, argc, argv)) { dixFreeScreenSpecificPrivates(pScreen); dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); free(pScreen); screenInfo.numScreens--; return -1; } update_desktop_dimensions(); dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, PRIVATE_CURSOR, 0); 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); 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); 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; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/swaprep.c��������������������������������������������������������������������0000664�0001751�0001751�00000106017�12456571574�013447� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "dixstruct.h" #include <X11/fonts/fontstruct.h> #include "scrnintstr.h" #include "swaprep.h" #include "globals.h" static void SwapFontInfo(xQueryFontReply * pr); static void SwapCharInfo(xCharInfo * pInfo); static void SwapFont(xQueryFontReply * pr, Bool hasGlyphs); /** * Thanks to Jack Palevich for testing and subsequently rewriting all this * * \param size size in bytes */ void Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { int i; size >>= 2; for (i = 0; i < size; i++) /* brackets are mandatory here, because "swapl" macro expands to several statements */ { swapl(&pbuf[i]); } WriteToClient(pClient, size << 2, pbuf); } /** * * \param size size in bytes */ void CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { int bufsize = size; CARD32 *pbufT; CARD32 *from, *to, *fromLast, *toLast; CARD32 tmpbuf[1]; /* Allocate as big a buffer as we can... */ while (!(pbufT = malloc(bufsize))) { bufsize >>= 1; if (bufsize == 4) { pbufT = tmpbuf; break; } } /* convert lengths from # of bytes to # of longs */ size >>= 2; bufsize >>= 2; from = pbuf; fromLast = from + size; while (from < fromLast) { int nbytes; to = pbufT; toLast = to + min(bufsize, fromLast - from); nbytes = (toLast - to) << 2; while (to < toLast) { /* can't write "cpswapl(*from++, *to++)" because cpswapl is a macro that evaulates its args more than once */ cpswapl(*from, *to); from++; to++; } WriteToClient(pClient, nbytes, pbufT); } if (pbufT != tmpbuf) free(pbufT); } /** * * \param size size in bytes */ void CopySwap16Write(ClientPtr pClient, int size, short *pbuf) { int bufsize = size; short *pbufT; short *from, *to, *fromLast, *toLast; short tmpbuf[2]; /* Allocate as big a buffer as we can... */ while (!(pbufT = malloc(bufsize))) { bufsize >>= 1; if (bufsize == 4) { pbufT = tmpbuf; break; } } /* convert lengths from # of bytes to # of shorts */ size >>= 1; bufsize >>= 1; from = pbuf; fromLast = from + size; while (from < fromLast) { int nbytes; to = pbufT; toLast = to + min(bufsize, fromLast - from); nbytes = (toLast - to) << 1; while (to < toLast) { /* can't write "cpswaps(*from++, *to++)" because cpswaps is a macro that evaulates its args more than once */ cpswaps(*from, *to); from++; to++; } WriteToClient(pClient, nbytes, pbufT); } if (pbufT != tmpbuf) free(pbufT); } /* Extra-small reply */ void SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep) { swaps(&pRep->sequenceNumber); WriteToClient(pClient, size, pRep); } /* Extra-large reply */ void SGetWindowAttributesReply(ClientPtr pClient, int size, xGetWindowAttributesReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->visualID); swaps(&pRep->class); swapl(&pRep->backingBitPlanes); swapl(&pRep->backingPixel); swapl(&pRep->colormap); swapl(&pRep->allEventMasks); swapl(&pRep->yourEventMask); swaps(&pRep->doNotPropagateMask); WriteToClient(pClient, size, pRep); } void SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->root); swaps(&pRep->x); swaps(&pRep->y); swaps(&pRep->width); swaps(&pRep->height); swaps(&pRep->borderWidth); WriteToClient(pClient, size, pRep); } void SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->root); swapl(&pRep->parent); swaps(&pRep->nChildren); WriteToClient(pClient, size, pRep); } void SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->atom); WriteToClient(pClient, size, pRep); } void SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nameLength); WriteToClient(pClient, size, pRep); } void SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->propertyType); swapl(&pRep->bytesAfter); swapl(&pRep->nItems); WriteToClient(pClient, size, pRep); } void SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nProperties); WriteToClient(pClient, size, pRep); } void SGetSelectionOwnerReply(ClientPtr pClient, int size, xGetSelectionOwnerReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->owner); WriteToClient(pClient, size, pRep); } void SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->root); swapl(&pRep->child); swaps(&pRep->rootX); swaps(&pRep->rootY); swaps(&pRep->winX); swaps(&pRep->winY); swaps(&pRep->mask); WriteToClient(pClient, size, pRep); } static void SwapTimecoord(xTimecoord * pCoord) { swapl(&pCoord->time); swaps(&pCoord->x); swaps(&pCoord->y); } void SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep) { int i, n; xTimecoord *pRepT; n = size / sizeof(xTimecoord); pRepT = pRep; for (i = 0; i < n; i++) { SwapTimecoord(pRepT); pRepT++; } WriteToClient(pClient, size, pRep); } void SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->nEvents); WriteToClient(pClient, size, pRep); } void STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->child); swaps(&pRep->dstX); swaps(&pRep->dstY); WriteToClient(pClient, size, pRep); } void SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->focus); WriteToClient(pClient, size, pRep); } /* extra long reply */ void SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); WriteToClient(pClient, size, pRep); } static void SwapCharInfo(xCharInfo * pInfo) { swaps(&pInfo->leftSideBearing); swaps(&pInfo->rightSideBearing); swaps(&pInfo->characterWidth); swaps(&pInfo->ascent); swaps(&pInfo->descent); swaps(&pInfo->attributes); } static void SwapFontInfo(xQueryFontReply * pr) { swaps(&pr->minCharOrByte2); swaps(&pr->maxCharOrByte2); swaps(&pr->defaultChar); swaps(&pr->nFontProps); swaps(&pr->fontAscent); swaps(&pr->fontDescent); SwapCharInfo(&pr->minBounds); SwapCharInfo(&pr->maxBounds); swapl(&pr->nCharInfos); } static void SwapFont(xQueryFontReply * pr, Bool hasGlyphs) { unsigned i; xCharInfo *pxci; unsigned nchars, nprops; char *pby; swaps(&pr->sequenceNumber); swapl(&pr->length); nchars = pr->nCharInfos; nprops = pr->nFontProps; SwapFontInfo(pr); pby = (char *) &pr[1]; /* Font properties are an atom and either an int32 or a CARD32, so * they are always 2 4 byte values */ for (i = 0; i < nprops; i++) { swapl((int *) pby); pby += 4; swapl((int *) pby); pby += 4; } if (hasGlyphs) { pxci = (xCharInfo *) pby; for (i = 0; i < nchars; i++, pxci++) SwapCharInfo(pxci); } } void SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply * pRep) { SwapFont(pRep, TRUE); WriteToClient(pClient, size, pRep); } void SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply * pRep) { swaps(&pRep->sequenceNumber); swaps(&pRep->fontAscent); swaps(&pRep->fontDescent); swaps(&pRep->overallAscent); swaps(&pRep->overallDescent); swapl(&pRep->overallWidth); swapl(&pRep->overallLeft); swapl(&pRep->overallRight); WriteToClient(pClient, size, pRep); } void SListFontsReply(ClientPtr pClient, int size, xListFontsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nFonts); WriteToClient(pClient, size, pRep); } void SListFontsWithInfoReply(ClientPtr pClient, int size, xListFontsWithInfoReply * pRep) { SwapFont((xQueryFontReply *) pRep, FALSE); WriteToClient(pClient, size, pRep); } void SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nPaths); WriteToClient(pClient, size, pRep); } void SGetImageReply(ClientPtr pClient, int size, xGetImageReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->visual); WriteToClient(pClient, size, pRep); /* Fortunately, image doesn't need swapping */ } void SListInstalledColormapsReply(ClientPtr pClient, int size, xListInstalledColormapsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nColormaps); WriteToClient(pClient, size, pRep); } void SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply * pRep) { swaps(&pRep->sequenceNumber); swaps(&pRep->red); swaps(&pRep->green); swaps(&pRep->blue); swapl(&pRep->pixel); WriteToClient(pClient, size, pRep); } void SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->pixel); swaps(&pRep->exactRed); swaps(&pRep->exactGreen); swaps(&pRep->exactBlue); swaps(&pRep->screenRed); swaps(&pRep->screenGreen); swaps(&pRep->screenBlue); WriteToClient(pClient, size, pRep); } void SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nPixels); swaps(&pRep->nMasks); WriteToClient(pClient, size, pRep); } void SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nPixels); swapl(&pRep->redMask); swapl(&pRep->greenMask); swapl(&pRep->blueMask); WriteToClient(pClient, size, pRep); } static void SwapRGB(xrgb * prgb) { swaps(&prgb->red); swaps(&prgb->green); swaps(&prgb->blue); } void SQColorsExtend(ClientPtr pClient, int size, xrgb * prgb) { int i, n; xrgb *prgbT; n = size / sizeof(xrgb); prgbT = prgb; for (i = 0; i < n; i++) { SwapRGB(prgbT); prgbT++; } WriteToClient(pClient, size, prgb); } void SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nColors); WriteToClient(pClient, size, pRep); } void SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep) { swaps(&pRep->sequenceNumber); swaps(&pRep->exactRed); swaps(&pRep->exactGreen); swaps(&pRep->exactBlue); swaps(&pRep->screenRed); swaps(&pRep->screenGreen); swaps(&pRep->screenBlue); WriteToClient(pClient, size, pRep); } void SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep) { swaps(&pRep->sequenceNumber); swaps(&pRep->width); swaps(&pRep->height); WriteToClient(pClient, size, pRep); } void SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); WriteToClient(pClient, size, pRep); } void SGetKeyboardMappingReply(ClientPtr pClient, int size, xGetKeyboardMappingReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); WriteToClient(pClient, size, pRep); } void SGetPointerMappingReply(ClientPtr pClient, int size, xGetPointerMappingReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); WriteToClient(pClient, size, pRep); } void SGetModifierMappingReply(ClientPtr pClient, int size, xGetModifierMappingReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); WriteToClient(pClient, size, pRep); } void SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->ledMask); swaps(&pRep->bellPitch); swaps(&pRep->bellDuration); WriteToClient(pClient, size, pRep); } void SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply * pRep) { swaps(&pRep->sequenceNumber); swaps(&pRep->accelNumerator); swaps(&pRep->accelDenominator); swaps(&pRep->threshold); WriteToClient(pClient, size, pRep); } void SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep) { swaps(&pRep->sequenceNumber); swaps(&pRep->timeout); swaps(&pRep->interval); WriteToClient(pClient, size, pRep); } void SLHostsExtend(ClientPtr pClient, int size, char *buf) { char *bufT = buf; char *endbuf = buf + size; while (bufT < endbuf) { xHostEntry *host = (xHostEntry *) bufT; int len = host->length; swaps(&host->length); bufT += sizeof(xHostEntry) + pad_to_int32(len); } WriteToClient(pClient, size, buf); } void SListHostsReply(ClientPtr pClient, int size, xListHostsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nHosts); WriteToClient(pClient, size, pRep); } void SErrorEvent(xError * from, xError * to) { to->type = X_Error; to->errorCode = from->errorCode; cpswaps(from->sequenceNumber, to->sequenceNumber); cpswapl(from->resourceID, to->resourceID); cpswaps(from->minorCode, to->minorCode); to->majorCode = from->majorCode; } void SKeyButtonPtrEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.keyButtonPointer.time, to->u.keyButtonPointer.time); cpswapl(from->u.keyButtonPointer.root, to->u.keyButtonPointer.root); cpswapl(from->u.keyButtonPointer.event, to->u.keyButtonPointer.event); cpswapl(from->u.keyButtonPointer.child, to->u.keyButtonPointer.child); cpswaps(from->u.keyButtonPointer.rootX, to->u.keyButtonPointer.rootX); cpswaps(from->u.keyButtonPointer.rootY, to->u.keyButtonPointer.rootY); cpswaps(from->u.keyButtonPointer.eventX, to->u.keyButtonPointer.eventX); cpswaps(from->u.keyButtonPointer.eventY, to->u.keyButtonPointer.eventY); cpswaps(from->u.keyButtonPointer.state, to->u.keyButtonPointer.state); to->u.keyButtonPointer.sameScreen = from->u.keyButtonPointer.sameScreen; } void SEnterLeaveEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.enterLeave.time, to->u.enterLeave.time); cpswapl(from->u.enterLeave.root, to->u.enterLeave.root); cpswapl(from->u.enterLeave.event, to->u.enterLeave.event); cpswapl(from->u.enterLeave.child, to->u.enterLeave.child); cpswaps(from->u.enterLeave.rootX, to->u.enterLeave.rootX); cpswaps(from->u.enterLeave.rootY, to->u.enterLeave.rootY); cpswaps(from->u.enterLeave.eventX, to->u.enterLeave.eventX); cpswaps(from->u.enterLeave.eventY, to->u.enterLeave.eventY); cpswaps(from->u.enterLeave.state, to->u.enterLeave.state); to->u.enterLeave.mode = from->u.enterLeave.mode; to->u.enterLeave.flags = from->u.enterLeave.flags; } void SFocusEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.focus.window, to->u.focus.window); to->u.focus.mode = from->u.focus.mode; } void SExposeEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.expose.window, to->u.expose.window); cpswaps(from->u.expose.x, to->u.expose.x); cpswaps(from->u.expose.y, to->u.expose.y); cpswaps(from->u.expose.width, to->u.expose.width); cpswaps(from->u.expose.height, to->u.expose.height); cpswaps(from->u.expose.count, to->u.expose.count); } void SGraphicsExposureEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.graphicsExposure.drawable, to->u.graphicsExposure.drawable); cpswaps(from->u.graphicsExposure.x, to->u.graphicsExposure.x); cpswaps(from->u.graphicsExposure.y, to->u.graphicsExposure.y); cpswaps(from->u.graphicsExposure.width, to->u.graphicsExposure.width); cpswaps(from->u.graphicsExposure.height, to->u.graphicsExposure.height); cpswaps(from->u.graphicsExposure.minorEvent, to->u.graphicsExposure.minorEvent); cpswaps(from->u.graphicsExposure.count, to->u.graphicsExposure.count); to->u.graphicsExposure.majorEvent = from->u.graphicsExposure.majorEvent; } void SNoExposureEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.noExposure.drawable, to->u.noExposure.drawable); cpswaps(from->u.noExposure.minorEvent, to->u.noExposure.minorEvent); to->u.noExposure.majorEvent = from->u.noExposure.majorEvent; } void SVisibilityEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.visibility.window, to->u.visibility.window); to->u.visibility.state = from->u.visibility.state; } void SCreateNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.createNotify.window, to->u.createNotify.window); cpswapl(from->u.createNotify.parent, to->u.createNotify.parent); cpswaps(from->u.createNotify.x, to->u.createNotify.x); cpswaps(from->u.createNotify.y, to->u.createNotify.y); cpswaps(from->u.createNotify.width, to->u.createNotify.width); cpswaps(from->u.createNotify.height, to->u.createNotify.height); cpswaps(from->u.createNotify.borderWidth, to->u.createNotify.borderWidth); to->u.createNotify.override = from->u.createNotify.override; } void SDestroyNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.destroyNotify.event, to->u.destroyNotify.event); cpswapl(from->u.destroyNotify.window, to->u.destroyNotify.window); } void SUnmapNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.unmapNotify.event, to->u.unmapNotify.event); cpswapl(from->u.unmapNotify.window, to->u.unmapNotify.window); to->u.unmapNotify.fromConfigure = from->u.unmapNotify.fromConfigure; } void SMapNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.mapNotify.event, to->u.mapNotify.event); cpswapl(from->u.mapNotify.window, to->u.mapNotify.window); to->u.mapNotify.override = from->u.mapNotify.override; } void SMapRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.mapRequest.parent, to->u.mapRequest.parent); cpswapl(from->u.mapRequest.window, to->u.mapRequest.window); } void SReparentEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.reparent.event, to->u.reparent.event); cpswapl(from->u.reparent.window, to->u.reparent.window); cpswapl(from->u.reparent.parent, to->u.reparent.parent); cpswaps(from->u.reparent.x, to->u.reparent.x); cpswaps(from->u.reparent.y, to->u.reparent.y); to->u.reparent.override = from->u.reparent.override; } void SConfigureNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.configureNotify.event, to->u.configureNotify.event); cpswapl(from->u.configureNotify.window, to->u.configureNotify.window); cpswapl(from->u.configureNotify.aboveSibling, to->u.configureNotify.aboveSibling); cpswaps(from->u.configureNotify.x, to->u.configureNotify.x); cpswaps(from->u.configureNotify.y, to->u.configureNotify.y); cpswaps(from->u.configureNotify.width, to->u.configureNotify.width); cpswaps(from->u.configureNotify.height, to->u.configureNotify.height); cpswaps(from->u.configureNotify.borderWidth, to->u.configureNotify.borderWidth); to->u.configureNotify.override = from->u.configureNotify.override; } void SConfigureRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; /* actually stack-mode */ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.configureRequest.parent, to->u.configureRequest.parent); cpswapl(from->u.configureRequest.window, to->u.configureRequest.window); cpswapl(from->u.configureRequest.sibling, to->u.configureRequest.sibling); cpswaps(from->u.configureRequest.x, to->u.configureRequest.x); cpswaps(from->u.configureRequest.y, to->u.configureRequest.y); cpswaps(from->u.configureRequest.width, to->u.configureRequest.width); cpswaps(from->u.configureRequest.height, to->u.configureRequest.height); cpswaps(from->u.configureRequest.borderWidth, to->u.configureRequest.borderWidth); cpswaps(from->u.configureRequest.valueMask, to->u.configureRequest.valueMask); } void SGravityEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.gravity.event, to->u.gravity.event); cpswapl(from->u.gravity.window, to->u.gravity.window); cpswaps(from->u.gravity.x, to->u.gravity.x); cpswaps(from->u.gravity.y, to->u.gravity.y); } void SResizeRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.resizeRequest.window, to->u.resizeRequest.window); cpswaps(from->u.resizeRequest.width, to->u.resizeRequest.width); cpswaps(from->u.resizeRequest.height, to->u.resizeRequest.height); } void SCirculateEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.circulate.event, to->u.circulate.event); cpswapl(from->u.circulate.window, to->u.circulate.window); cpswapl(from->u.circulate.parent, to->u.circulate.parent); to->u.circulate.place = from->u.circulate.place; } void SPropertyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.property.window, to->u.property.window); cpswapl(from->u.property.atom, to->u.property.atom); cpswapl(from->u.property.time, to->u.property.time); to->u.property.state = from->u.property.state; } void SSelectionClearEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.selectionClear.time, to->u.selectionClear.time); cpswapl(from->u.selectionClear.window, to->u.selectionClear.window); cpswapl(from->u.selectionClear.atom, to->u.selectionClear.atom); } void SSelectionRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.selectionRequest.time, to->u.selectionRequest.time); cpswapl(from->u.selectionRequest.owner, to->u.selectionRequest.owner); cpswapl(from->u.selectionRequest.requestor, to->u.selectionRequest.requestor); cpswapl(from->u.selectionRequest.selection, to->u.selectionRequest.selection); cpswapl(from->u.selectionRequest.target, to->u.selectionRequest.target); cpswapl(from->u.selectionRequest.property, to->u.selectionRequest.property); } void SSelectionNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.selectionNotify.time, to->u.selectionNotify.time); cpswapl(from->u.selectionNotify.requestor, to->u.selectionNotify.requestor); cpswapl(from->u.selectionNotify.selection, to->u.selectionNotify.selection); cpswapl(from->u.selectionNotify.target, to->u.selectionNotify.target); cpswapl(from->u.selectionNotify.property, to->u.selectionNotify.property); } void SColormapEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.colormap.window, to->u.colormap.window); cpswapl(from->u.colormap.colormap, to->u.colormap.colormap); to->u.colormap.new = from->u.colormap.new; to->u.colormap.state = from->u.colormap.state; } void SMappingEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); to->u.mappingNotify.request = from->u.mappingNotify.request; to->u.mappingNotify.firstKeyCode = from->u.mappingNotify.firstKeyCode; to->u.mappingNotify.count = from->u.mappingNotify.count; } void SClientMessageEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; /* actually format */ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); cpswapl(from->u.clientMessage.window, to->u.clientMessage.window); cpswapl(from->u.clientMessage.u.l.type, to->u.clientMessage.u.l.type); switch (from->u.u.detail) { case 8: memmove(to->u.clientMessage.u.b.bytes, from->u.clientMessage.u.b.bytes, 20); break; case 16: cpswaps(from->u.clientMessage.u.s.shorts0, to->u.clientMessage.u.s.shorts0); cpswaps(from->u.clientMessage.u.s.shorts1, to->u.clientMessage.u.s.shorts1); cpswaps(from->u.clientMessage.u.s.shorts2, to->u.clientMessage.u.s.shorts2); cpswaps(from->u.clientMessage.u.s.shorts3, to->u.clientMessage.u.s.shorts3); cpswaps(from->u.clientMessage.u.s.shorts4, to->u.clientMessage.u.s.shorts4); cpswaps(from->u.clientMessage.u.s.shorts5, to->u.clientMessage.u.s.shorts5); cpswaps(from->u.clientMessage.u.s.shorts6, to->u.clientMessage.u.s.shorts6); cpswaps(from->u.clientMessage.u.s.shorts7, to->u.clientMessage.u.s.shorts7); cpswaps(from->u.clientMessage.u.s.shorts8, to->u.clientMessage.u.s.shorts8); cpswaps(from->u.clientMessage.u.s.shorts9, to->u.clientMessage.u.s.shorts9); break; case 32: cpswapl(from->u.clientMessage.u.l.longs0, to->u.clientMessage.u.l.longs0); cpswapl(from->u.clientMessage.u.l.longs1, to->u.clientMessage.u.l.longs1); cpswapl(from->u.clientMessage.u.l.longs2, to->u.clientMessage.u.l.longs2); cpswapl(from->u.clientMessage.u.l.longs3, to->u.clientMessage.u.l.longs3); cpswapl(from->u.clientMessage.u.l.longs4, to->u.clientMessage.u.l.longs4); break; } } void SKeymapNotifyEvent(xEvent *from, xEvent *to) { /* Keymap notify events are special; they have no sequence number field, and contain entirely 8-bit data */ *to = *from; } static void SwapConnSetup(xConnSetup * pConnSetup, xConnSetup * pConnSetupT) { cpswapl(pConnSetup->release, pConnSetupT->release); cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase); cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask); cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize); cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor); cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize); pConnSetupT->minKeyCode = pConnSetup->minKeyCode; pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode; pConnSetupT->numRoots = pConnSetup->numRoots; pConnSetupT->numFormats = pConnSetup->numFormats; pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder; pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder; pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit; pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad; } static void SwapWinRoot(xWindowRoot * pRoot, xWindowRoot * pRootT) { cpswapl(pRoot->windowId, pRootT->windowId); cpswapl(pRoot->defaultColormap, pRootT->defaultColormap); cpswapl(pRoot->whitePixel, pRootT->whitePixel); cpswapl(pRoot->blackPixel, pRootT->blackPixel); cpswapl(pRoot->currentInputMask, pRootT->currentInputMask); cpswaps(pRoot->pixWidth, pRootT->pixWidth); cpswaps(pRoot->pixHeight, pRootT->pixHeight); cpswaps(pRoot->mmWidth, pRootT->mmWidth); cpswaps(pRoot->mmHeight, pRootT->mmHeight); cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps); cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps); cpswapl(pRoot->rootVisualID, pRootT->rootVisualID); pRootT->backingStore = pRoot->backingStore; pRootT->saveUnders = pRoot->saveUnders; pRootT->rootDepth = pRoot->rootDepth; pRootT->nDepths = pRoot->nDepths; } static void SwapVisual(xVisualType * pVis, xVisualType * pVisT) { cpswapl(pVis->visualID, pVisT->visualID); pVisT->class = pVis->class; pVisT->bitsPerRGB = pVis->bitsPerRGB; cpswaps(pVis->colormapEntries, pVisT->colormapEntries); cpswapl(pVis->redMask, pVisT->redMask); cpswapl(pVis->greenMask, pVisT->greenMask); cpswapl(pVis->blueMask, pVisT->blueMask); } void SwapConnSetupInfo(char *pInfo, char *pInfoT) { int i, j, k; xConnSetup *pConnSetup = (xConnSetup *) pInfo; xDepth *depth; xWindowRoot *root; SwapConnSetup(pConnSetup, (xConnSetup *) pInfoT); pInfo += sizeof(xConnSetup); pInfoT += sizeof(xConnSetup); /* Copy the vendor string */ i = pad_to_int32(pConnSetup->nbytesVendor); memcpy(pInfoT, pInfo, i); pInfo += i; pInfoT += i; /* The Pixmap formats don't need to be swapped, just copied. */ i = sizeof(xPixmapFormat) * pConnSetup->numFormats; memcpy(pInfoT, pInfo, i); pInfo += i; pInfoT += i; for (i = 0; i < pConnSetup->numRoots; i++) { root = (xWindowRoot *) pInfo; SwapWinRoot(root, (xWindowRoot *) pInfoT); pInfo += sizeof(xWindowRoot); pInfoT += sizeof(xWindowRoot); for (j = 0; j < root->nDepths; j++) { depth = (xDepth *) pInfo; ((xDepth *) pInfoT)->depth = depth->depth; cpswaps(depth->nVisuals, ((xDepth *) pInfoT)->nVisuals); pInfo += sizeof(xDepth); pInfoT += sizeof(xDepth); for (k = 0; k < depth->nVisuals; k++) { SwapVisual((xVisualType *) pInfo, (xVisualType *) pInfoT); pInfo += sizeof(xVisualType); pInfoT += sizeof(xVisualType); } } } } void WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) { char *pInfoTBase; pInfoTBase = malloc(size); if (!pInfoTBase) { pClient->noClientException = -1; return; } SwapConnSetupInfo(pInfo, pInfoTBase); WriteToClient(pClient, (int) size, pInfoTBase); free(pInfoTBase); } void SwapConnSetupPrefix(xConnSetupPrefix * pcspFrom, xConnSetupPrefix * pcspTo) { pcspTo->success = pcspFrom->success; pcspTo->lengthReason = pcspFrom->lengthReason; cpswaps(pcspFrom->majorVersion, pcspTo->majorVersion); cpswaps(pcspFrom->minorVersion, pcspTo->minorVersion); cpswaps(pcspFrom->length, pcspTo->length); } void WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix * pcsp) { xConnSetupPrefix cspT; SwapConnSetupPrefix(pcsp, &cspT); WriteToClient(pClient, sizeof(cspT), &cspT); } /* * Dummy entry for ReplySwapVector[] */ void ReplyNotSwappd(ClientPtr pClient, int size, void *pbuf) { FatalError("Not implemented"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/colormap.c�������������������������������������������������������������������0000664�0001751�0001751�00000246437�12456571574�013615� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include <stdio.h> #include <string.h> #include <strings.h> #include "misc.h" #include "dix.h" #include "dixstruct.h" #include "colormapst.h" #include "os.h" #include "scrnintstr.h" #include "resource.h" #include "windowstr.h" #include "privates.h" #include "xace.h" static Pixel FindBestPixel(EntryPtr /*pentFirst */ , int /*size */ , xrgb * /*prgb */ , int /*channel */ ); static int AllComp(EntryPtr /*pent */ , xrgb * /*prgb */ ); static int RedComp(EntryPtr /*pent */ , xrgb * /*prgb */ ); static int GreenComp(EntryPtr /*pent */ , xrgb * /*prgb */ ); static int BlueComp(EntryPtr /*pent */ , xrgb * /*prgb */ ); static void FreePixels(ColormapPtr /*pmap */ , int /*client */ ); static void CopyFree(int /*channel */ , int /*client */ , ColormapPtr /*pmapSrc */ , ColormapPtr /*pmapDst */ ); static void FreeCell(ColormapPtr /*pmap */ , Pixel /*i */ , int /*channel */ ); static void UpdateColors(ColormapPtr /*pmap */ ); static int AllocDirect(int /*client */ , ColormapPtr /*pmap */ , int /*c */ , int /*r */ , int /*g */ , int /*b */ , Bool /*contig */ , Pixel * /*pixels */ , Pixel * /*prmask */ , Pixel * /*pgmask */ , Pixel * /*pbmask */ ); static int AllocPseudo(int /*client */ , ColormapPtr /*pmap */ , int /*c */ , int /*r */ , Bool /*contig */ , Pixel * /*pixels */ , Pixel * /*pmask */ , Pixel ** /*pppixFirst */ ); static Bool AllocCP(ColormapPtr /*pmap */ , EntryPtr /*pentFirst */ , int /*count */ , int /*planes */ , Bool /*contig */ , Pixel * /*pixels */ , Pixel * /*pMask */ ); static Bool AllocShared(ColormapPtr /*pmap */ , Pixel * /*ppix */ , int /*c */ , int /*r */ , int /*g */ , int /*b */ , Pixel /*rmask */ , Pixel /*gmask */ , Pixel /*bmask */ , Pixel * /*ppixFirst */ ); static int FreeCo(ColormapPtr /*pmap */ , int /*client */ , int /*color */ , int /*npixIn */ , Pixel * /*ppixIn */ , Pixel /*mask */ ); static int TellNoMap(WindowPtr /*pwin */ , Colormap * /*pmid */ ); static void FindColorInRootCmap(ColormapPtr /* pmap */ , EntryPtr /* pentFirst */ , int /* size */ , xrgb * /* prgb */ , Pixel * /* pPixel */ , int /* channel */ , ColorCompareProcPtr /* comp */ ); #define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1) #define NUMGREEN(vis) ((vis->greenMask >> vis->offsetGreen) + 1) #define NUMBLUE(vis) ((vis->blueMask >> vis->offsetBlue) + 1) #if COMPOSITE #define ALPHAMASK(vis) ((vis)->nplanes < 32 ? 0 : \ (CARD32) ~((vis)->redMask|(vis)->greenMask|(vis)->blueMask)) #else #define ALPHAMASK(vis) 0 #endif #define RGBMASK(vis) (vis->redMask | vis->greenMask | vis->blueMask | ALPHAMASK(vis)) /* GetNextBitsOrBreak(bits, mask, base) -- * (Suggestion: First read the macro, then read this explanation. * * Either generate the next value to OR in to a pixel or break out of this * while loop * * This macro is used when we're trying to generate all 2^n combinations of * bits in mask. What we're doing here is counting in binary, except that * the bits we use to count may not be contiguous. This macro will be * called 2^n times, returning a different value in bits each time. Then * it will cause us to break out of a surrounding loop. (It will always be * called from within a while loop.) * On call: mask is the value we want to find all the combinations for * base has 1 bit set where the least significant bit of mask is set * * For example,if mask is 01010, base should be 0010 and we count like this: * 00010 (see this isn't so hard), * then we add base to bits and get 0100. (bits & ~mask) is (0100 & 0100) so * we add that to bits getting (0100 + 0100) = * 01000 for our next value. * then we add 0010 to get * 01010 and we're done (easy as 1, 2, 3) */ #define GetNextBitsOrBreak(bits, mask, base) \ if((bits) == (mask)) \ break; \ (bits) += (base); \ while((bits) & ~(mask)) \ (bits) += ((bits) & ~(mask)); /* ID of server as client */ #define SERVER_ID 0 typedef struct _colorResource { Colormap mid; int client; } colorResource; /* Invariants: * refcnt == 0 means entry is empty * refcnt > 0 means entry is useable by many clients, so it can't be changed * refcnt == AllocPrivate means entry owned by one client only * fShared should only be set if refcnt == AllocPrivate, and only in red map */ /** * Create and initialize the color map * * \param mid resource to use for this colormap * \param alloc 1 iff all entries are allocated writable */ int CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, ColormapPtr *ppcmap, int alloc, int client) { int class, size; unsigned long sizebytes; ColormapPtr pmap; EntryPtr pent; int i; Pixel *ppix, **pptr; class = pVisual->class; if (!(class & DynamicClass) && (alloc != AllocNone) && (client != SERVER_ID)) return BadMatch; size = pVisual->ColormapEntries; sizebytes = (size * sizeof(Entry)) + (MAXCLIENTS * sizeof(Pixel *)) + (MAXCLIENTS * sizeof(int)); if ((class | DynamicClass) == DirectColor) sizebytes *= 3; sizebytes += sizeof(ColormapRec); if (mid == pScreen->defColormap) { pmap = malloc(sizebytes); if (!pmap) return BadAlloc; if (!dixAllocatePrivates(&pmap->devPrivates, PRIVATE_COLORMAP)) { free(pmap); return BadAlloc; } } else { pmap = _dixAllocateObjectWithPrivates(sizebytes, sizebytes, offsetof(ColormapRec, devPrivates), PRIVATE_COLORMAP); if (!pmap) return BadAlloc; } pmap->red = (EntryPtr) ((char *) pmap + sizeof(ColormapRec)); sizebytes = size * sizeof(Entry); pmap->clientPixelsRed = (Pixel **) ((char *) pmap->red + sizebytes); pmap->numPixelsRed = (int *) ((char *) pmap->clientPixelsRed + (MAXCLIENTS * sizeof(Pixel *))); pmap->mid = mid; pmap->flags = 0; /* start out with all flags clear */ if (mid == pScreen->defColormap) pmap->flags |= IsDefault; pmap->pScreen = pScreen; pmap->pVisual = pVisual; pmap->class = class; if ((class | DynamicClass) == DirectColor) size = NUMRED(pVisual); pmap->freeRed = size; memset((char *) pmap->red, 0, (int) sizebytes); memset((char *) pmap->numPixelsRed, 0, MAXCLIENTS * sizeof(int)); for (pptr = &pmap->clientPixelsRed[MAXCLIENTS]; --pptr >= pmap->clientPixelsRed;) *pptr = (Pixel *) NULL; if (alloc == AllocAll) { if (class & DynamicClass) pmap->flags |= AllAllocated; for (pent = &pmap->red[size - 1]; pent >= pmap->red; pent--) pent->refcnt = AllocPrivate; pmap->freeRed = 0; ppix = malloc(size * sizeof(Pixel)); if (!ppix) { free(pmap); return BadAlloc; } pmap->clientPixelsRed[client] = ppix; for (i = 0; i < size; i++) ppix[i] = i; pmap->numPixelsRed[client] = size; } if ((class | DynamicClass) == DirectColor) { pmap->freeGreen = NUMGREEN(pVisual); pmap->green = (EntryPtr) ((char *) pmap->numPixelsRed + (MAXCLIENTS * sizeof(int))); pmap->clientPixelsGreen = (Pixel **) ((char *) pmap->green + sizebytes); pmap->numPixelsGreen = (int *) ((char *) pmap->clientPixelsGreen + (MAXCLIENTS * sizeof(Pixel *))); pmap->freeBlue = NUMBLUE(pVisual); pmap->blue = (EntryPtr) ((char *) pmap->numPixelsGreen + (MAXCLIENTS * sizeof(int))); pmap->clientPixelsBlue = (Pixel **) ((char *) pmap->blue + sizebytes); pmap->numPixelsBlue = (int *) ((char *) pmap->clientPixelsBlue + (MAXCLIENTS * sizeof(Pixel *))); memset((char *) pmap->green, 0, (int) sizebytes); memset((char *) pmap->blue, 0, (int) sizebytes); memmove((char *) pmap->clientPixelsGreen, (char *) pmap->clientPixelsRed, MAXCLIENTS * sizeof(Pixel *)); memmove((char *) pmap->clientPixelsBlue, (char *) pmap->clientPixelsRed, MAXCLIENTS * sizeof(Pixel *)); memset((char *) pmap->numPixelsGreen, 0, MAXCLIENTS * sizeof(int)); memset((char *) pmap->numPixelsBlue, 0, MAXCLIENTS * sizeof(int)); /* If every cell is allocated, mark its refcnt */ if (alloc == AllocAll) { size = pmap->freeGreen; for (pent = &pmap->green[size - 1]; pent >= pmap->green; pent--) pent->refcnt = AllocPrivate; pmap->freeGreen = 0; ppix = malloc(size * sizeof(Pixel)); if (!ppix) { free(pmap->clientPixelsRed[client]); free(pmap); return BadAlloc; } pmap->clientPixelsGreen[client] = ppix; for (i = 0; i < size; i++) ppix[i] = i; pmap->numPixelsGreen[client] = size; size = pmap->freeBlue; for (pent = &pmap->blue[size - 1]; pent >= pmap->blue; pent--) pent->refcnt = AllocPrivate; pmap->freeBlue = 0; ppix = malloc(size * sizeof(Pixel)); if (!ppix) { free(pmap->clientPixelsGreen[client]); free(pmap->clientPixelsRed[client]); free(pmap); return BadAlloc; } pmap->clientPixelsBlue[client] = ppix; for (i = 0; i < size; i++) ppix[i] = i; pmap->numPixelsBlue[client] = size; } } pmap->flags |= BeingCreated; if (!AddResource(mid, RT_COLORMAP, (void *) pmap)) return BadAlloc; /* * Security creation/labeling check */ i = XaceHook(XACE_RESOURCE_ACCESS, clients[client], mid, RT_COLORMAP, pmap, RT_NONE, NULL, DixCreateAccess); if (i != Success) { FreeResource(mid, RT_NONE); return i; } /* If the device wants a chance to initialize the colormap in any way, * this is it. In specific, if this is a Static colormap, this is the * time to fill in the colormap's values */ if (!(*pScreen->CreateColormap) (pmap)) { FreeResource(mid, RT_NONE); return BadAlloc; } pmap->flags &= ~BeingCreated; *ppcmap = pmap; return Success; } /** * * \param value must conform to DeleteType */ int FreeColormap(void *value, XID mid) { int i; EntryPtr pent; ColormapPtr pmap = (ColormapPtr) value; if (CLIENT_ID(mid) != SERVER_ID) { (*pmap->pScreen->UninstallColormap) (pmap); WalkTree(pmap->pScreen, (VisitWindowProcPtr) TellNoMap, (void *) &mid); } /* This is the device's chance to undo anything it needs to, especially * to free any storage it allocated */ (*pmap->pScreen->DestroyColormap) (pmap); if (pmap->clientPixelsRed) { for (i = 0; i < MAXCLIENTS; i++) free(pmap->clientPixelsRed[i]); } if ((pmap->class == PseudoColor) || (pmap->class == GrayScale)) { for (pent = &pmap->red[pmap->pVisual->ColormapEntries - 1]; pent >= pmap->red; pent--) { if (pent->fShared) { if (--pent->co.shco.red->refcnt == 0) free(pent->co.shco.red); if (--pent->co.shco.green->refcnt == 0) free(pent->co.shco.green); if (--pent->co.shco.blue->refcnt == 0) free(pent->co.shco.blue); } } } if ((pmap->class | DynamicClass) == DirectColor) { for (i = 0; i < MAXCLIENTS; i++) { free(pmap->clientPixelsGreen[i]); free(pmap->clientPixelsBlue[i]); } } if (pmap->flags & IsDefault) { dixFreePrivates(pmap->devPrivates, PRIVATE_COLORMAP); free(pmap); } else dixFreeObjectWithPrivates(pmap, PRIVATE_COLORMAP); return Success; } /* Tell window that pmid has disappeared */ static int TellNoMap(WindowPtr pwin, Colormap * pmid) { 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; #ifdef PANORAMIX if (noPanoramiXExtension || !pwin->drawable.pScreen->myNum) #endif DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL); if (pwin->optional) { pwin->optional->colormap = None; CheckWindowOptionalNeed(pwin); } } return WT_WALKCHILDREN; } /* Tell window that pmid got uninstalled */ int TellLostMap(WindowPtr pwin, void *value) { Colormap *pmid = (Colormap *) value; #ifdef PANORAMIX if (!noPanoramiXExtension && pwin->drawable.pScreen->myNum) return WT_STOPWALKING; #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; DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL); } return WT_WALKCHILDREN; } /* Tell window that pmid got installed */ int TellGainedMap(WindowPtr pwin, void *value) { Colormap *pmid = (Colormap *) value; #ifdef PANORAMIX if (!noPanoramiXExtension && pwin->drawable.pScreen->myNum) return WT_STOPWALKING; #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; DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL); } return WT_WALKCHILDREN; } int CopyColormapAndFree(Colormap mid, ColormapPtr pSrc, int client) { ColormapPtr pmap = (ColormapPtr) NULL; int result, alloc, size; Colormap midSrc; ScreenPtr pScreen; VisualPtr pVisual; pScreen = pSrc->pScreen; pVisual = pSrc->pVisual; midSrc = pSrc->mid; alloc = ((pSrc->flags & AllAllocated) && CLIENT_ID(midSrc) == client) ? AllocAll : AllocNone; size = pVisual->ColormapEntries; /* If the create returns non-0, it failed */ result = CreateColormap(mid, pScreen, pVisual, &pmap, alloc, client); if (result != Success) return result; if (alloc == AllocAll) { memmove((char *) pmap->red, (char *) pSrc->red, size * sizeof(Entry)); if ((pmap->class | DynamicClass) == DirectColor) { memmove((char *) pmap->green, (char *) pSrc->green, size * sizeof(Entry)); memmove((char *) pmap->blue, (char *) pSrc->blue, size * sizeof(Entry)); } pSrc->flags &= ~AllAllocated; FreePixels(pSrc, client); UpdateColors(pmap); return Success; } CopyFree(REDMAP, client, pSrc, pmap); if ((pmap->class | DynamicClass) == DirectColor) { CopyFree(GREENMAP, client, pSrc, pmap); CopyFree(BLUEMAP, client, pSrc, pmap); } if (pmap->class & DynamicClass) UpdateColors(pmap); /* XXX should worry about removing any RT_CMAPENTRY resource */ return Success; } /* Helper routine for freeing large numbers of cells from a map */ static void CopyFree(int channel, int client, ColormapPtr pmapSrc, ColormapPtr pmapDst) { int z, npix; EntryPtr pentSrcFirst, pentDstFirst; EntryPtr pentSrc, pentDst; Pixel *ppix; int nalloc; switch (channel) { default: /* so compiler can see that everything gets initialized */ case REDMAP: ppix = (pmapSrc->clientPixelsRed)[client]; npix = (pmapSrc->numPixelsRed)[client]; pentSrcFirst = pmapSrc->red; pentDstFirst = pmapDst->red; break; case GREENMAP: ppix = (pmapSrc->clientPixelsGreen)[client]; npix = (pmapSrc->numPixelsGreen)[client]; pentSrcFirst = pmapSrc->green; pentDstFirst = pmapDst->green; break; case BLUEMAP: ppix = (pmapSrc->clientPixelsBlue)[client]; npix = (pmapSrc->numPixelsBlue)[client]; pentSrcFirst = pmapSrc->blue; pentDstFirst = pmapDst->blue; break; } nalloc = 0; if (pmapSrc->class & DynamicClass) { for (z = npix; --z >= 0; ppix++) { /* Copy entries */ pentSrc = pentSrcFirst + *ppix; pentDst = pentDstFirst + *ppix; if (pentDst->refcnt > 0) { pentDst->refcnt++; } else { *pentDst = *pentSrc; nalloc++; if (pentSrc->refcnt > 0) pentDst->refcnt = 1; else pentSrc->fShared = FALSE; } FreeCell(pmapSrc, *ppix, channel); } } /* Note that FreeCell has already fixed pmapSrc->free{Color} */ switch (channel) { case REDMAP: pmapDst->freeRed -= nalloc; (pmapDst->clientPixelsRed)[client] = (pmapSrc->clientPixelsRed)[client]; (pmapSrc->clientPixelsRed)[client] = (Pixel *) NULL; (pmapDst->numPixelsRed)[client] = (pmapSrc->numPixelsRed)[client]; (pmapSrc->numPixelsRed)[client] = 0; break; case GREENMAP: pmapDst->freeGreen -= nalloc; (pmapDst->clientPixelsGreen)[client] = (pmapSrc->clientPixelsGreen)[client]; (pmapSrc->clientPixelsGreen)[client] = (Pixel *) NULL; (pmapDst->numPixelsGreen)[client] = (pmapSrc->numPixelsGreen)[client]; (pmapSrc->numPixelsGreen)[client] = 0; break; case BLUEMAP: pmapDst->freeBlue -= nalloc; pmapDst->clientPixelsBlue[client] = pmapSrc->clientPixelsBlue[client]; pmapSrc->clientPixelsBlue[client] = (Pixel *) NULL; pmapDst->numPixelsBlue[client] = pmapSrc->numPixelsBlue[client]; pmapSrc->numPixelsBlue[client] = 0; break; } } /* Free the ith entry in a color map. Must handle freeing of * colors allocated through AllocColorPlanes */ static void FreeCell(ColormapPtr pmap, Pixel i, int channel) { EntryPtr pent; int *pCount; switch (channel) { default: /* so compiler can see that everything gets initialized */ case PSEUDOMAP: case REDMAP: pent = (EntryPtr) &pmap->red[i]; pCount = &pmap->freeRed; break; case GREENMAP: pent = (EntryPtr) &pmap->green[i]; pCount = &pmap->freeGreen; break; case BLUEMAP: pent = (EntryPtr) &pmap->blue[i]; pCount = &pmap->freeBlue; break; } /* If it's not privately allocated and it's not time to free it, just * decrement the count */ if (pent->refcnt > 1) pent->refcnt--; else { /* If the color type is shared, find the sharedcolor. If decremented * refcnt is 0, free the shared cell. */ if (pent->fShared) { if (--pent->co.shco.red->refcnt == 0) free(pent->co.shco.red); if (--pent->co.shco.green->refcnt == 0) free(pent->co.shco.green); if (--pent->co.shco.blue->refcnt == 0) free(pent->co.shco.blue); pent->fShared = FALSE; } pent->refcnt = 0; *pCount += 1; } } static void UpdateColors(ColormapPtr pmap) { xColorItem *defs; xColorItem *pdef; EntryPtr pent; VisualPtr pVisual; int i, n, size; pVisual = pmap->pVisual; size = pVisual->ColormapEntries; defs = malloc(size * sizeof(xColorItem)); if (!defs) return; n = 0; pdef = defs; if (pmap->class == DirectColor) { for (i = 0; i < size; i++) { if (!pmap->red[i].refcnt && !pmap->green[i].refcnt && !pmap->blue[i].refcnt) continue; pdef->pixel = ((Pixel) i << pVisual->offsetRed) | ((Pixel) i << pVisual->offsetGreen) | ((Pixel) i << pVisual->offsetBlue); pdef->red = pmap->red[i].co.local.red; pdef->green = pmap->green[i].co.local.green; pdef->blue = pmap->blue[i].co.local.blue; pdef->flags = DoRed | DoGreen | DoBlue; pdef++; n++; } } else { for (i = 0, pent = pmap->red; i < size; i++, pent++) { if (!pent->refcnt) continue; pdef->pixel = i; if (pent->fShared) { pdef->red = pent->co.shco.red->color; pdef->green = pent->co.shco.green->color; pdef->blue = pent->co.shco.blue->color; } else { pdef->red = pent->co.local.red; pdef->green = pent->co.local.green; pdef->blue = pent->co.local.blue; } pdef->flags = DoRed | DoGreen | DoBlue; pdef++; n++; } } if (n) (*pmap->pScreen->StoreColors) (pmap, n, defs); free(defs); } /* Get a read-only color from a ColorMap (probably slow for large maps) * Returns by changing the value in pred, pgreen, pblue and pPix */ int AllocColor(ColormapPtr pmap, unsigned short *pred, unsigned short *pgreen, unsigned short *pblue, Pixel * pPix, int client) { Pixel pixR, pixG, pixB; int entries; xrgb rgb; int class; VisualPtr pVisual; int npix; Pixel *ppix; pVisual = pmap->pVisual; (*pmap->pScreen->ResolveColor) (pred, pgreen, pblue, pVisual); rgb.red = *pred; rgb.green = *pgreen; rgb.blue = *pblue; class = pmap->class; entries = pVisual->ColormapEntries; /* If the colormap is being created, then we want to be able to change * the colormap, even if it's a static type. Otherwise, we'd never be * able to initialize static colormaps */ if (pmap->flags & BeingCreated) class |= DynamicClass; /* If this is one of the static storage classes, and we're not initializing * it, the best we can do is to find the closest color entry to the * requested one and return that. */ switch (class) { case StaticColor: case StaticGray: /* Look up all three components in the same pmap */ *pPix = pixR = FindBestPixel(pmap->red, entries, &rgb, PSEUDOMAP); *pred = pmap->red[pixR].co.local.red; *pgreen = pmap->red[pixR].co.local.green; *pblue = pmap->red[pixR].co.local.blue; npix = pmap->numPixelsRed[client]; ppix = (Pixel *) realloc(pmap->clientPixelsRed[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return BadAlloc; ppix[npix] = pixR; pmap->clientPixelsRed[client] = ppix; pmap->numPixelsRed[client]++; break; case TrueColor: /* Look up each component in its own map, then OR them together */ pixR = FindBestPixel(pmap->red, NUMRED(pVisual), &rgb, REDMAP); pixG = FindBestPixel(pmap->green, NUMGREEN(pVisual), &rgb, GREENMAP); pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP); *pPix = (pixR << pVisual->offsetRed) | (pixG << pVisual->offsetGreen) | (pixB << pVisual->offsetBlue) | ALPHAMASK(pVisual); *pred = pmap->red[pixR].co.local.red; *pgreen = pmap->green[pixG].co.local.green; *pblue = pmap->blue[pixB].co.local.blue; npix = pmap->numPixelsRed[client]; ppix = (Pixel *) realloc(pmap->clientPixelsRed[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return BadAlloc; ppix[npix] = pixR; pmap->clientPixelsRed[client] = ppix; npix = pmap->numPixelsGreen[client]; ppix = (Pixel *) realloc(pmap->clientPixelsGreen[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return BadAlloc; ppix[npix] = pixG; pmap->clientPixelsGreen[client] = ppix; npix = pmap->numPixelsBlue[client]; ppix = (Pixel *) realloc(pmap->clientPixelsBlue[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return BadAlloc; ppix[npix] = pixB; pmap->clientPixelsBlue[client] = ppix; pmap->numPixelsRed[client]++; pmap->numPixelsGreen[client]++; pmap->numPixelsBlue[client]++; break; case GrayScale: case PseudoColor: if (pmap->mid != pmap->pScreen->defColormap && pmap->pVisual->vid == pmap->pScreen->rootVisual) { ColormapPtr prootmap; dixLookupResourceByType((void **) &prootmap, pmap->pScreen->defColormap, RT_COLORMAP, clients[client], DixReadAccess); if (pmap->class == prootmap->class) FindColorInRootCmap(prootmap, prootmap->red, entries, &rgb, pPix, PSEUDOMAP, AllComp); } if (FindColor(pmap, pmap->red, entries, &rgb, pPix, PSEUDOMAP, client, AllComp) != Success) return BadAlloc; break; case DirectColor: if (pmap->mid != pmap->pScreen->defColormap && pmap->pVisual->vid == pmap->pScreen->rootVisual) { ColormapPtr prootmap; dixLookupResourceByType((void **) &prootmap, pmap->pScreen->defColormap, RT_COLORMAP, clients[client], DixReadAccess); if (pmap->class == prootmap->class) { pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed; FindColorInRootCmap(prootmap, prootmap->red, entries, &rgb, &pixR, REDMAP, RedComp); pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen; FindColorInRootCmap(prootmap, prootmap->green, entries, &rgb, &pixG, GREENMAP, GreenComp); pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue; FindColorInRootCmap(prootmap, prootmap->blue, entries, &rgb, &pixB, BLUEMAP, BlueComp); *pPix = pixR | pixG | pixB; } } pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed; if (FindColor(pmap, pmap->red, NUMRED(pVisual), &rgb, &pixR, REDMAP, client, RedComp) != Success) return BadAlloc; pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen; if (FindColor(pmap, pmap->green, NUMGREEN(pVisual), &rgb, &pixG, GREENMAP, client, GreenComp) != Success) { (void) FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel) 0); return BadAlloc; } pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue; if (FindColor(pmap, pmap->blue, NUMBLUE(pVisual), &rgb, &pixB, BLUEMAP, client, BlueComp) != Success) { (void) FreeCo(pmap, client, GREENMAP, 1, &pixG, (Pixel) 0); (void) FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel) 0); return BadAlloc; } *pPix = pixR | pixG | pixB | ALPHAMASK(pVisual); break; } /* if this is the client's first pixel in this colormap, tell the * resource manager that the client has pixels in this colormap which * should be freed when the client dies */ if ((pmap->numPixelsRed[client] == 1) && (CLIENT_ID(pmap->mid) != client) && !(pmap->flags & BeingCreated)) { colorResource *pcr; pcr = malloc(sizeof(colorResource)); if (!pcr) { (void) FreeColors(pmap, client, 1, pPix, (Pixel) 0); return BadAlloc; } pcr->mid = pmap->mid; pcr->client = client; if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *) pcr)) return BadAlloc; } return Success; } /* * FakeAllocColor -- fake an AllocColor request by * returning a free pixel if availible, otherwise returning * the closest matching pixel. This is used by the mi * software sprite code to recolor cursors. A nice side-effect * is that this routine will never return failure. */ void FakeAllocColor(ColormapPtr pmap, xColorItem * item) { Pixel pixR, pixG, pixB; Pixel temp; int entries; xrgb rgb; int class; VisualPtr pVisual; pVisual = pmap->pVisual; rgb.red = item->red; rgb.green = item->green; rgb.blue = item->blue; (*pmap->pScreen->ResolveColor) (&rgb.red, &rgb.green, &rgb.blue, pVisual); class = pmap->class; entries = pVisual->ColormapEntries; switch (class) { case GrayScale: case PseudoColor: temp = 0; item->pixel = 0; if (FindColor(pmap, pmap->red, entries, &rgb, &temp, PSEUDOMAP, -1, AllComp) == Success) { item->pixel = temp; break; } /* fall through ... */ case StaticColor: case StaticGray: item->pixel = FindBestPixel(pmap->red, entries, &rgb, PSEUDOMAP); break; case DirectColor: /* Look up each component in its own map, then OR them together */ pixR = (item->pixel & pVisual->redMask) >> pVisual->offsetRed; pixG = (item->pixel & pVisual->greenMask) >> pVisual->offsetGreen; pixB = (item->pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (FindColor(pmap, pmap->red, NUMRED(pVisual), &rgb, &pixR, REDMAP, -1, RedComp) != Success) pixR = FindBestPixel(pmap->red, NUMRED(pVisual), &rgb, REDMAP) << pVisual->offsetRed; if (FindColor(pmap, pmap->green, NUMGREEN(pVisual), &rgb, &pixG, GREENMAP, -1, GreenComp) != Success) pixG = FindBestPixel(pmap->green, NUMGREEN(pVisual), &rgb, GREENMAP) << pVisual->offsetGreen; if (FindColor(pmap, pmap->blue, NUMBLUE(pVisual), &rgb, &pixB, BLUEMAP, -1, BlueComp) != Success) pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP) << pVisual->offsetBlue; item->pixel = pixR | pixG | pixB; break; case TrueColor: /* Look up each component in its own map, then OR them together */ pixR = FindBestPixel(pmap->red, NUMRED(pVisual), &rgb, REDMAP); pixG = FindBestPixel(pmap->green, NUMGREEN(pVisual), &rgb, GREENMAP); pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP); item->pixel = (pixR << pVisual->offsetRed) | (pixG << pVisual->offsetGreen) | (pixB << pVisual->offsetBlue); break; } } /* free a pixel value obtained from FakeAllocColor */ void FakeFreeColor(ColormapPtr pmap, Pixel pixel) { VisualPtr pVisual; Pixel pixR, pixG, pixB; switch (pmap->class) { case GrayScale: case PseudoColor: if (pmap->red[pixel].refcnt == AllocTemporary) pmap->red[pixel].refcnt = 0; break; case DirectColor: pVisual = pmap->pVisual; pixR = (pixel & pVisual->redMask) >> pVisual->offsetRed; pixG = (pixel & pVisual->greenMask) >> pVisual->offsetGreen; pixB = (pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (pmap->red[pixR].refcnt == AllocTemporary) pmap->red[pixR].refcnt = 0; if (pmap->green[pixG].refcnt == AllocTemporary) pmap->green[pixG].refcnt = 0; if (pmap->blue[pixB].refcnt == AllocTemporary) pmap->blue[pixB].refcnt = 0; break; } } typedef unsigned short BigNumUpper; typedef unsigned long BigNumLower; #define BIGNUMLOWERBITS 24 #define BIGNUMUPPERBITS 16 #define BIGNUMLOWER (1 << BIGNUMLOWERBITS) #define BIGNUMUPPER (1 << BIGNUMUPPERBITS) #define UPPERPART(i) ((i) >> BIGNUMLOWERBITS) #define LOWERPART(i) ((i) & (BIGNUMLOWER - 1)) typedef struct _bignum { BigNumUpper upper; BigNumLower lower; } BigNumRec, *BigNumPtr; #define BigNumGreater(x,y) (((x)->upper > (y)->upper) ||\ ((x)->upper == (y)->upper && (x)->lower > (y)->lower)) #define UnsignedToBigNum(u,r) (((r)->upper = UPPERPART(u)), \ ((r)->lower = LOWERPART(u))) #define MaxBigNum(r) (((r)->upper = BIGNUMUPPER-1), \ ((r)->lower = BIGNUMLOWER-1)) static void BigNumAdd(BigNumPtr x, BigNumPtr y, BigNumPtr r) { BigNumLower lower, carry = 0; lower = x->lower + y->lower; if (lower >= BIGNUMLOWER) { lower -= BIGNUMLOWER; carry = 1; } r->lower = lower; r->upper = x->upper + y->upper + carry; } static Pixel FindBestPixel(EntryPtr pentFirst, int size, xrgb * prgb, int channel) { EntryPtr pent; Pixel pixel, final; long dr, dg, db; unsigned long sq; BigNumRec minval, sum, temp; final = 0; MaxBigNum(&minval); /* look for the minimal difference */ for (pent = pentFirst, pixel = 0; pixel < size; pent++, pixel++) { dr = dg = db = 0; switch (channel) { case PSEUDOMAP: dg = (long) pent->co.local.green - prgb->green; db = (long) pent->co.local.blue - prgb->blue; case REDMAP: dr = (long) pent->co.local.red - prgb->red; break; case GREENMAP: dg = (long) pent->co.local.green - prgb->green; break; case BLUEMAP: db = (long) pent->co.local.blue - prgb->blue; break; } sq = dr * dr; UnsignedToBigNum(sq, &sum); sq = dg * dg; UnsignedToBigNum(sq, &temp); BigNumAdd(&sum, &temp, &sum); sq = db * db; UnsignedToBigNum(sq, &temp); BigNumAdd(&sum, &temp, &sum); if (BigNumGreater(&minval, &sum)) { final = pixel; minval = sum; } } return final; } static void FindColorInRootCmap(ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb * prgb, Pixel * pPixel, int channel, ColorCompareProcPtr comp) { EntryPtr pent; Pixel pixel; int count; if ((pixel = *pPixel) >= size) pixel = 0; for (pent = pentFirst + pixel, count = size; --count >= 0; pent++, pixel++) { if (pent->refcnt > 0 && (*comp) (pent, prgb)) { switch (channel) { case REDMAP: pixel <<= pmap->pVisual->offsetRed; break; case GREENMAP: pixel <<= pmap->pVisual->offsetGreen; break; case BLUEMAP: pixel <<= pmap->pVisual->offsetBlue; break; default: /* PSEUDOMAP */ break; } *pPixel = pixel; } } } /* Tries to find a color in pmap that exactly matches the one requested in prgb * if it can't it allocates one. * Starts looking at pentFirst + *pPixel, so if you want a specific pixel, * load *pPixel with that value, otherwise set it to 0 */ int FindColor(ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb * prgb, Pixel * pPixel, int channel, int client, ColorCompareProcPtr comp) { EntryPtr pent; Bool foundFree; Pixel pixel, Free = 0; int npix, count, *nump = NULL; Pixel **pixp = NULL, *ppix; xColorItem def; foundFree = FALSE; if ((pixel = *pPixel) >= size) pixel = 0; /* see if there is a match, and also look for a free entry */ for (pent = pentFirst + pixel, count = size; --count >= 0;) { if (pent->refcnt > 0) { if ((*comp) (pent, prgb)) { if (client >= 0) pent->refcnt++; *pPixel = pixel; switch (channel) { case REDMAP: *pPixel <<= pmap->pVisual->offsetRed; case PSEUDOMAP: break; case GREENMAP: *pPixel <<= pmap->pVisual->offsetGreen; break; case BLUEMAP: *pPixel <<= pmap->pVisual->offsetBlue; break; } goto gotit; } } else if (!foundFree && pent->refcnt == 0) { Free = pixel; foundFree = TRUE; /* If we're initializing the colormap, then we are looking for * the first free cell we can find, not to minimize the number * of entries we use. So don't look any further. */ if (pmap->flags & BeingCreated) break; } pixel++; if (pixel >= size) { pent = pentFirst; pixel = 0; } else pent++; } /* If we got here, we didn't find a match. If we also didn't find * a free entry, we're out of luck. Otherwise, we'll usurp a free * entry and fill it in */ if (!foundFree) return BadAlloc; pent = pentFirst + Free; pent->fShared = FALSE; pent->refcnt = (client >= 0) ? 1 : AllocTemporary; switch (channel) { case PSEUDOMAP: pent->co.local.red = prgb->red; pent->co.local.green = prgb->green; pent->co.local.blue = prgb->blue; def.red = prgb->red; def.green = prgb->green; def.blue = prgb->blue; def.flags = (DoRed | DoGreen | DoBlue); if (client >= 0) pmap->freeRed--; def.pixel = Free; break; case REDMAP: pent->co.local.red = prgb->red; def.red = prgb->red; def.green = pmap->green[0].co.local.green; def.blue = pmap->blue[0].co.local.blue; def.flags = DoRed; if (client >= 0) pmap->freeRed--; def.pixel = Free << pmap->pVisual->offsetRed; break; case GREENMAP: pent->co.local.green = prgb->green; def.red = pmap->red[0].co.local.red; def.green = prgb->green; def.blue = pmap->blue[0].co.local.blue; def.flags = DoGreen; if (client >= 0) pmap->freeGreen--; def.pixel = Free << pmap->pVisual->offsetGreen; break; case BLUEMAP: pent->co.local.blue = prgb->blue; def.red = pmap->red[0].co.local.red; def.green = pmap->green[0].co.local.green; def.blue = prgb->blue; def.flags = DoBlue; if (client >= 0) pmap->freeBlue--; def.pixel = Free << pmap->pVisual->offsetBlue; break; } (*pmap->pScreen->StoreColors) (pmap, 1, &def); pixel = Free; *pPixel = def.pixel; gotit: if (pmap->flags & BeingCreated || client == -1) return Success; /* Now remember the pixel, for freeing later */ switch (channel) { case PSEUDOMAP: case REDMAP: nump = pmap->numPixelsRed; pixp = pmap->clientPixelsRed; break; case GREENMAP: nump = pmap->numPixelsGreen; pixp = pmap->clientPixelsGreen; break; case BLUEMAP: nump = pmap->numPixelsBlue; pixp = pmap->clientPixelsBlue; break; } npix = nump[client]; ppix = (Pixel *) realloc(pixp[client], (npix + 1) * sizeof(Pixel)); if (!ppix) { pent->refcnt--; if (!pent->fShared) switch (channel) { case PSEUDOMAP: case REDMAP: pmap->freeRed++; break; case GREENMAP: pmap->freeGreen++; break; case BLUEMAP: pmap->freeBlue++; break; } return BadAlloc; } ppix[npix] = pixel; pixp[client] = ppix; nump[client]++; return Success; } /* Comparison functions -- passed to FindColor to determine if an * entry is already the color we're looking for or not */ static int AllComp(EntryPtr pent, xrgb * prgb) { if ((pent->co.local.red == prgb->red) && (pent->co.local.green == prgb->green) && (pent->co.local.blue == prgb->blue)) return 1; return 0; } static int RedComp(EntryPtr pent, xrgb * prgb) { if (pent->co.local.red == prgb->red) return 1; return 0; } static int GreenComp(EntryPtr pent, xrgb * prgb) { if (pent->co.local.green == prgb->green) return 1; return 0; } static int BlueComp(EntryPtr pent, xrgb * prgb) { if (pent->co.local.blue == prgb->blue) return 1; return 0; } /* Read the color value of a cell */ int QueryColors(ColormapPtr pmap, int count, Pixel * ppixIn, xrgb * prgbList, ClientPtr client) { Pixel *ppix, pixel; xrgb *prgb; VisualPtr pVisual; EntryPtr pent; Pixel i; int errVal = Success; pVisual = pmap->pVisual; if ((pmap->class | DynamicClass) == DirectColor) { int numred, numgreen, numblue; Pixel rgbbad; numred = NUMRED(pVisual); numgreen = NUMGREEN(pVisual); numblue = NUMBLUE(pVisual); rgbbad = ~RGBMASK(pVisual); for (ppix = ppixIn, prgb = prgbList; --count >= 0; ppix++, prgb++) { pixel = *ppix; if (pixel & rgbbad) { client->errorValue = pixel; errVal = BadValue; continue; } i = (pixel & pVisual->redMask) >> pVisual->offsetRed; if (i >= numred) { client->errorValue = pixel; errVal = BadValue; continue; } prgb->red = pmap->red[i].co.local.red; i = (pixel & pVisual->greenMask) >> pVisual->offsetGreen; if (i >= numgreen) { client->errorValue = pixel; errVal = BadValue; continue; } prgb->green = pmap->green[i].co.local.green; i = (pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (i >= numblue) { client->errorValue = pixel; errVal = BadValue; continue; } prgb->blue = pmap->blue[i].co.local.blue; } } else { for (ppix = ppixIn, prgb = prgbList; --count >= 0; ppix++, prgb++) { pixel = *ppix; if (pixel >= pVisual->ColormapEntries) { client->errorValue = pixel; errVal = BadValue; } else { pent = (EntryPtr) &pmap->red[pixel]; if (pent->fShared) { prgb->red = pent->co.shco.red->color; prgb->green = pent->co.shco.green->color; prgb->blue = pent->co.shco.blue->color; } else { prgb->red = pent->co.local.red; prgb->green = pent->co.local.green; prgb->blue = pent->co.local.blue; } } } } return errVal; } static void FreePixels(ColormapPtr pmap, int client) { Pixel *ppix, *ppixStart; int n; int class; class = pmap->class; ppixStart = pmap->clientPixelsRed[client]; if (class & DynamicClass) { n = pmap->numPixelsRed[client]; for (ppix = ppixStart; --n >= 0;) { FreeCell(pmap, *ppix, REDMAP); ppix++; } } free(ppixStart); pmap->clientPixelsRed[client] = (Pixel *) NULL; pmap->numPixelsRed[client] = 0; if ((class | DynamicClass) == DirectColor) { ppixStart = pmap->clientPixelsGreen[client]; if (class & DynamicClass) for (ppix = ppixStart, n = pmap->numPixelsGreen[client]; --n >= 0;) FreeCell(pmap, *ppix++, GREENMAP); free(ppixStart); pmap->clientPixelsGreen[client] = (Pixel *) NULL; pmap->numPixelsGreen[client] = 0; ppixStart = pmap->clientPixelsBlue[client]; if (class & DynamicClass) for (ppix = ppixStart, n = pmap->numPixelsBlue[client]; --n >= 0;) FreeCell(pmap, *ppix++, BLUEMAP); free(ppixStart); pmap->clientPixelsBlue[client] = (Pixel *) NULL; pmap->numPixelsBlue[client] = 0; } } /** * Frees all of a client's colors and cells. * * \param value must conform to DeleteType * \unused fakeid */ int FreeClientPixels(void *value, XID fakeid) { void *pmap; colorResource *pcr = value; int rc; rc = dixLookupResourceByType(&pmap, pcr->mid, RT_COLORMAP, serverClient, DixRemoveAccess); if (rc == Success) FreePixels((ColormapPtr) pmap, pcr->client); free(pcr); return Success; } int AllocColorCells(int client, ColormapPtr pmap, int colors, int planes, Bool contig, Pixel * ppix, Pixel * masks) { Pixel rmask, gmask, bmask, *ppixFirst, r, g, b; int n, class; int ok; int oldcount; colorResource *pcr = (colorResource *) NULL; class = pmap->class; if (!(class & DynamicClass)) return BadAlloc; /* Shouldn't try on this type */ oldcount = pmap->numPixelsRed[client]; if (pmap->class == DirectColor) oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; if (!oldcount && (CLIENT_ID(pmap->mid) != client)) { pcr = malloc(sizeof(colorResource)); if (!pcr) return BadAlloc; } if (pmap->class == DirectColor) { ok = AllocDirect(client, pmap, colors, planes, planes, planes, contig, ppix, &rmask, &gmask, &bmask); if (ok == Success) { for (r = g = b = 1, n = planes; --n >= 0; r += r, g += g, b += b) { while (!(rmask & r)) r += r; while (!(gmask & g)) g += g; while (!(bmask & b)) b += b; *masks++ = r | g | b; } } } else { ok = AllocPseudo(client, pmap, colors, planes, contig, ppix, &rmask, &ppixFirst); if (ok == Success) { for (r = 1, n = planes; --n >= 0; r += r) { while (!(rmask & r)) r += r; *masks++ = r; } } } /* if this is the client's first pixels in this colormap, tell the * resource manager that the client has pixels in this colormap which * should be freed when the client dies */ if ((ok == Success) && pcr) { pcr->mid = pmap->mid; pcr->client = client; if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *) pcr)) ok = BadAlloc; } else free(pcr); return ok; } int AllocColorPlanes(int client, ColormapPtr pmap, int colors, int r, int g, int b, Bool contig, Pixel * pixels, Pixel * prmask, Pixel * pgmask, Pixel * pbmask) { int ok; Pixel mask, *ppixFirst; Pixel shift; int i; int class; int oldcount; colorResource *pcr = (colorResource *) NULL; class = pmap->class; if (!(class & DynamicClass)) return BadAlloc; /* Shouldn't try on this type */ oldcount = pmap->numPixelsRed[client]; if (class == DirectColor) oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; if (!oldcount && (CLIENT_ID(pmap->mid) != client)) { pcr = malloc(sizeof(colorResource)); if (!pcr) return BadAlloc; } if (class == DirectColor) { ok = AllocDirect(client, pmap, colors, r, g, b, contig, pixels, prmask, pgmask, pbmask); } else { /* Allocate the proper pixels */ /* XXX This is sort of bad, because of contig is set, we force all * r + g + b bits to be contiguous. Should only force contiguity * per mask */ ok = AllocPseudo(client, pmap, colors, r + g + b, contig, pixels, &mask, &ppixFirst); if (ok == Success) { /* now split that mask into three */ *prmask = *pgmask = *pbmask = 0; shift = 1; for (i = r; --i >= 0; shift += shift) { while (!(mask & shift)) shift += shift; *prmask |= shift; } for (i = g; --i >= 0; shift += shift) { while (!(mask & shift)) shift += shift; *pgmask |= shift; } for (i = b; --i >= 0; shift += shift) { while (!(mask & shift)) shift += shift; *pbmask |= shift; } /* set up the shared color cells */ if (!AllocShared(pmap, pixels, colors, r, g, b, *prmask, *pgmask, *pbmask, ppixFirst)) { (void) FreeColors(pmap, client, colors, pixels, mask); ok = BadAlloc; } } } /* if this is the client's first pixels in this colormap, tell the * resource manager that the client has pixels in this colormap which * should be freed when the client dies */ if ((ok == Success) && pcr) { pcr->mid = pmap->mid; pcr->client = client; if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *) pcr)) ok = BadAlloc; } else free(pcr); return ok; } static int AllocDirect(int client, ColormapPtr pmap, int c, int r, int g, int b, Bool contig, Pixel * pixels, Pixel * prmask, Pixel * pgmask, Pixel * pbmask) { Pixel *ppixRed, *ppixGreen, *ppixBlue; Pixel *ppix, *pDst, *p; int npix, npixR, npixG, npixB; Bool okR, okG, okB; Pixel *rpix = 0, *gpix = 0, *bpix = 0; npixR = c << r; npixG = c << g; npixB = c << b; if ((r >= 32) || (g >= 32) || (b >= 32) || (npixR > pmap->freeRed) || (npixR < c) || (npixG > pmap->freeGreen) || (npixG < c) || (npixB > pmap->freeBlue) || (npixB < c)) return BadAlloc; /* start out with empty pixels */ for (p = pixels; p < pixels + c; p++) *p = 0; ppixRed = malloc(npixR * sizeof(Pixel)); ppixGreen = malloc(npixG * sizeof(Pixel)); ppixBlue = malloc(npixB * sizeof(Pixel)); if (!ppixRed || !ppixGreen || !ppixBlue) { free(ppixBlue); free(ppixGreen); free(ppixRed); return BadAlloc; } okR = AllocCP(pmap, pmap->red, c, r, contig, ppixRed, prmask); okG = AllocCP(pmap, pmap->green, c, g, contig, ppixGreen, pgmask); okB = AllocCP(pmap, pmap->blue, c, b, contig, ppixBlue, pbmask); if (okR && okG && okB) { rpix = (Pixel *) realloc(pmap->clientPixelsRed[client], (pmap->numPixelsRed[client] + (c << r)) * sizeof(Pixel)); if (rpix) pmap->clientPixelsRed[client] = rpix; gpix = (Pixel *) realloc(pmap->clientPixelsGreen[client], (pmap->numPixelsGreen[client] + (c << g)) * sizeof(Pixel)); if (gpix) pmap->clientPixelsGreen[client] = gpix; bpix = (Pixel *) realloc(pmap->clientPixelsBlue[client], (pmap->numPixelsBlue[client] + (c << b)) * sizeof(Pixel)); if (bpix) pmap->clientPixelsBlue[client] = bpix; } if (!okR || !okG || !okB || !rpix || !gpix || !bpix) { if (okR) for (ppix = ppixRed, npix = npixR; --npix >= 0; ppix++) pmap->red[*ppix].refcnt = 0; if (okG) for (ppix = ppixGreen, npix = npixG; --npix >= 0; ppix++) pmap->green[*ppix].refcnt = 0; if (okB) for (ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++) pmap->blue[*ppix].refcnt = 0; free(ppixBlue); free(ppixGreen); free(ppixRed); return BadAlloc; } *prmask <<= pmap->pVisual->offsetRed; *pgmask <<= pmap->pVisual->offsetGreen; *pbmask <<= pmap->pVisual->offsetBlue; ppix = rpix + pmap->numPixelsRed[client]; for (pDst = pixels, p = ppixRed; p < ppixRed + npixR; p++) { *ppix++ = *p; if (p < ppixRed + c) *pDst++ |= *p << pmap->pVisual->offsetRed; } pmap->numPixelsRed[client] += npixR; pmap->freeRed -= npixR; ppix = gpix + pmap->numPixelsGreen[client]; for (pDst = pixels, p = ppixGreen; p < ppixGreen + npixG; p++) { *ppix++ = *p; if (p < ppixGreen + c) *pDst++ |= *p << pmap->pVisual->offsetGreen; } pmap->numPixelsGreen[client] += npixG; pmap->freeGreen -= npixG; ppix = bpix + pmap->numPixelsBlue[client]; for (pDst = pixels, p = ppixBlue; p < ppixBlue + npixB; p++) { *ppix++ = *p; if (p < ppixBlue + c) *pDst++ |= *p << pmap->pVisual->offsetBlue; } pmap->numPixelsBlue[client] += npixB; pmap->freeBlue -= npixB; for (pDst = pixels; pDst < pixels + c; pDst++) *pDst |= ALPHAMASK(pmap->pVisual); free(ppixBlue); free(ppixGreen); free(ppixRed); return Success; } static int AllocPseudo(int client, ColormapPtr pmap, int c, int r, Bool contig, Pixel * pixels, Pixel * pmask, Pixel ** pppixFirst) { Pixel *ppix, *p, *pDst, *ppixTemp; int npix; Bool ok; npix = c << r; if ((r >= 32) || (npix > pmap->freeRed) || (npix < c)) return BadAlloc; if (!(ppixTemp = malloc(npix * sizeof(Pixel)))) return BadAlloc; ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask); if (ok) { /* all the allocated pixels are added to the client pixel list, * but only the unique ones are returned to the client */ ppix = (Pixel *) realloc(pmap->clientPixelsRed[client], (pmap->numPixelsRed[client] + npix) * sizeof(Pixel)); if (!ppix) { for (p = ppixTemp; p < ppixTemp + npix; p++) pmap->red[*p].refcnt = 0; free(ppixTemp); return BadAlloc; } pmap->clientPixelsRed[client] = ppix; ppix += pmap->numPixelsRed[client]; *pppixFirst = ppix; pDst = pixels; for (p = ppixTemp; p < ppixTemp + npix; p++) { *ppix++ = *p; if (p < ppixTemp + c) *pDst++ = *p; } pmap->numPixelsRed[client] += npix; pmap->freeRed -= npix; } free(ppixTemp); return ok ? Success : BadAlloc; } /* Allocates count << planes pixels from colormap pmap for client. If * contig, then the plane mask is made of consecutive bits. Returns * all count << pixels in the array pixels. The first count of those * pixels are the unique pixels. *pMask has the mask to Or with the * unique pixels to get the rest of them. * * Returns True iff all pixels could be allocated * All cells allocated will have refcnt set to AllocPrivate and shared to FALSE * (see AllocShared for why we care) */ static Bool AllocCP(ColormapPtr pmap, EntryPtr pentFirst, int count, int planes, Bool contig, Pixel * pixels, Pixel * pMask) { EntryPtr ent; Pixel pixel, base, entries, maxp, save; int dplanes, found; Pixel *ppix; Pixel mask; Pixel finalmask; dplanes = pmap->pVisual->nplanes; /* Easy case. Allocate pixels only */ if (planes == 0) { /* allocate writable entries */ ppix = pixels; ent = pentFirst; pixel = 0; while (--count >= 0) { /* Just find count unallocated cells */ while (ent->refcnt) { ent++; pixel++; } ent->refcnt = AllocPrivate; *ppix++ = pixel; ent->fShared = FALSE; } *pMask = 0; return TRUE; } else if (planes > dplanes) { return FALSE; } /* General case count pixels * 2 ^ planes cells to be allocated */ /* make room for new pixels */ ent = pentFirst; /* first try for contiguous planes, since it's fastest */ for (mask = (((Pixel) 1) << planes) - 1, base = 1, dplanes -= (planes - 1); --dplanes >= 0; mask += mask, base += base) { ppix = pixels; found = 0; pixel = 0; entries = pmap->pVisual->ColormapEntries - mask; while (pixel < entries) { save = pixel; maxp = pixel + mask + base; /* check if all are free */ while (pixel != maxp && ent[pixel].refcnt == 0) pixel += base; if (pixel == maxp) { /* this one works */ *ppix++ = save; found++; if (found == count) { /* found enough, allocate them all */ while (--count >= 0) { pixel = pixels[count]; maxp = pixel + mask; while (1) { ent[pixel].refcnt = AllocPrivate; ent[pixel].fShared = FALSE; if (pixel == maxp) break; pixel += base; *ppix++ = pixel; } } *pMask = mask; return TRUE; } } pixel = save + 1; if (pixel & mask) pixel += mask; } } dplanes = pmap->pVisual->nplanes; if (contig || planes == 1 || dplanes < 3) return FALSE; /* this will be very slow for large maps, need a better algorithm */ /* we can generate the smallest and largest numbers that fits in dplanes bits and contain exactly planes bits set as follows. First, we need to check that it is possible to generate such a mask at all. (Non-contiguous masks need one more bit than contiguous masks). Then the smallest such mask consists of the rightmost planes-1 bits set, then a zero, then a one in position planes + 1. The formula is (3 << (planes-1)) -1 The largest such masks consists of the leftmost planes-1 bits set, then a zero, then a one bit in position dplanes-planes-1. If dplanes is smaller than 32 (the number of bits in a word) then the formula is: (1<<dplanes) - (1<<(dplanes-planes+1) + (1<<dplanes-planes-1) If dplanes = 32, then we can't calculate (1<<dplanes) and we have to use: ( (1<<(planes-1)) - 1) << (dplanes-planes+1) + (1<<(dplanes-planes-1)) << Thank you, Loretta>>> */ finalmask = (((((Pixel) 1) << (planes - 1)) - 1) << (dplanes - planes + 1)) + (((Pixel) 1) << (dplanes - planes - 1)); for (mask = (((Pixel) 3) << (planes - 1)) - 1; mask <= finalmask; mask++) { /* next 3 magic statements count number of ones (HAKMEM #169) */ pixel = (mask >> 1) & 033333333333; pixel = mask - pixel - ((pixel >> 1) & 033333333333); if ((((pixel + (pixel >> 3)) & 030707070707) % 077) != planes) continue; ppix = pixels; found = 0; entries = pmap->pVisual->ColormapEntries - mask; base = lowbit(mask); for (pixel = 0; pixel < entries; pixel++) { if (pixel & mask) continue; maxp = 0; /* check if all are free */ while (ent[pixel + maxp].refcnt == 0) { GetNextBitsOrBreak(maxp, mask, base); } if ((maxp < mask) || (ent[pixel + mask].refcnt != 0)) continue; /* this one works */ *ppix++ = pixel; found++; if (found < count) continue; /* found enough, allocate them all */ while (--count >= 0) { pixel = (pixels)[count]; maxp = 0; while (1) { ent[pixel + maxp].refcnt = AllocPrivate; ent[pixel + maxp].fShared = FALSE; GetNextBitsOrBreak(maxp, mask, base); *ppix++ = pixel + maxp; } } *pMask = mask; return TRUE; } } return FALSE; } /** * * \param ppixFirst First of the client's new pixels */ static Bool AllocShared(ColormapPtr pmap, Pixel * ppix, int c, int r, int g, int b, Pixel rmask, Pixel gmask, Pixel bmask, Pixel * ppixFirst) { Pixel *pptr, *cptr; int npix, z, npixClientNew, npixShared; Pixel basemask, base, bits, common; SHAREDCOLOR *pshared, **ppshared, **psharedList; npixClientNew = c << (r + g + b); npixShared = (c << r) + (c << g) + (c << b); psharedList = malloc(npixShared * sizeof(SHAREDCOLOR *)); if (!psharedList) return FALSE; ppshared = psharedList; for (z = npixShared; --z >= 0;) { if (!(ppshared[z] = malloc(sizeof(SHAREDCOLOR)))) { for (z++; z < npixShared; z++) free(ppshared[z]); free(psharedList); return FALSE; } } for (pptr = ppix, npix = c; --npix >= 0; pptr++) { basemask = ~(gmask | bmask); common = *pptr & basemask; if (rmask) { bits = 0; base = lowbit(rmask); while (1) { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == (common | bits)) { pmap->red[*cptr].fShared = TRUE; pmap->red[*cptr].co.shco.red = pshared; } } GetNextBitsOrBreak(bits, rmask, base); } } else { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == common) { pmap->red[*cptr].fShared = TRUE; pmap->red[*cptr].co.shco.red = pshared; } } } basemask = ~(rmask | bmask); common = *pptr & basemask; if (gmask) { bits = 0; base = lowbit(gmask); while (1) { pshared = *ppshared++; pshared->refcnt = 1 << (r + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == (common | bits)) { pmap->red[*cptr].co.shco.green = pshared; } } GetNextBitsOrBreak(bits, gmask, base); } } else { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == common) { pmap->red[*cptr].co.shco.green = pshared; } } } basemask = ~(rmask | gmask); common = *pptr & basemask; if (bmask) { bits = 0; base = lowbit(bmask); while (1) { pshared = *ppshared++; pshared->refcnt = 1 << (r + g); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == (common | bits)) { pmap->red[*cptr].co.shco.blue = pshared; } } GetNextBitsOrBreak(bits, bmask, base); } } else { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == common) { pmap->red[*cptr].co.shco.blue = pshared; } } } } free(psharedList); return TRUE; } /** FreeColors * Free colors and/or cells (probably slow for large numbers) */ int FreeColors(ColormapPtr pmap, int client, int count, Pixel * pixels, Pixel mask) { int rval, result, class; Pixel rmask; class = pmap->class; if (pmap->flags & AllAllocated) return BadAccess; if ((class | DynamicClass) == DirectColor) { rmask = mask & RGBMASK(pmap->pVisual); result = FreeCo(pmap, client, REDMAP, count, pixels, mask & pmap->pVisual->redMask); /* If any of the three calls fails, we must report that, if more * than one fails, it's ok that we report the last one */ rval = FreeCo(pmap, client, GREENMAP, count, pixels, mask & pmap->pVisual->greenMask); if (rval != Success) result = rval; rval = FreeCo(pmap, client, BLUEMAP, count, pixels, mask & pmap->pVisual->blueMask); if (rval != Success) result = rval; } else { rmask = mask & ((((Pixel) 1) << pmap->pVisual->nplanes) - 1); result = FreeCo(pmap, client, PSEUDOMAP, count, pixels, rmask); } if ((mask != rmask) && count) { clients[client]->errorValue = *pixels | mask; result = BadValue; } /* XXX should worry about removing any RT_CMAPENTRY resource */ return result; } /** * Helper for FreeColors -- frees all combinations of *newpixels and mask bits * which the client has allocated in channel colormap cells of pmap. * doesn't change newpixels if it doesn't need to * * \param pmap which colormap head * \param color which sub-map, eg, RED, BLUE, PSEUDO * \param npixIn number of pixels passed in * \param ppixIn number of base pixels * \param mask mask client gave us */ static int FreeCo(ColormapPtr pmap, int client, int color, int npixIn, Pixel * ppixIn, Pixel mask) { Pixel *ppixClient, pixTest; int npixClient, npixNew, npix; Pixel bits, base, cmask, rgbbad; Pixel *pptr, *cptr; int n, zapped; int errVal = Success; int offset, numents; if (npixIn == 0) return errVal; bits = 0; zapped = 0; base = lowbit(mask); switch (color) { case REDMAP: cmask = pmap->pVisual->redMask; rgbbad = ~RGBMASK(pmap->pVisual); offset = pmap->pVisual->offsetRed; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsRed[client]; npixClient = pmap->numPixelsRed[client]; break; case GREENMAP: cmask = pmap->pVisual->greenMask; rgbbad = ~RGBMASK(pmap->pVisual); offset = pmap->pVisual->offsetGreen; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsGreen[client]; npixClient = pmap->numPixelsGreen[client]; break; case BLUEMAP: cmask = pmap->pVisual->blueMask; rgbbad = ~RGBMASK(pmap->pVisual); offset = pmap->pVisual->offsetBlue; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsBlue[client]; npixClient = pmap->numPixelsBlue[client]; break; default: /* so compiler can see that everything gets initialized */ case PSEUDOMAP: cmask = ~((Pixel) 0); rgbbad = 0; offset = 0; numents = pmap->pVisual->ColormapEntries; ppixClient = pmap->clientPixelsRed[client]; npixClient = pmap->numPixelsRed[client]; break; } /* zap all pixels which match */ while (1) { /* go through pixel list */ for (pptr = ppixIn, n = npixIn; --n >= 0; pptr++) { pixTest = ((*pptr | bits) & cmask) >> offset; if ((pixTest >= numents) || (*pptr & rgbbad)) { clients[client]->errorValue = *pptr | bits; errVal = BadValue; continue; } /* find match in client list */ for (cptr = ppixClient, npix = npixClient; --npix >= 0 && *cptr != pixTest; cptr++); if (npix >= 0) { if (pmap->class & DynamicClass) { FreeCell(pmap, pixTest, color); } *cptr = ~((Pixel) 0); zapped++; } else errVal = BadAccess; } /* generate next bits value */ GetNextBitsOrBreak(bits, mask, base); } /* delete freed pixels from client pixel list */ if (zapped) { npixNew = npixClient - zapped; if (npixNew) { /* Since the list can only get smaller, we can do a copy in * place and then realloc to a smaller size */ pptr = cptr = ppixClient; /* If we have all the new pixels, we don't have to examine the * rest of the old ones */ for (npix = 0; npix < npixNew; cptr++) { if (*cptr != ~((Pixel) 0)) { *pptr++ = *cptr; npix++; } } pptr = (Pixel *) realloc(ppixClient, npixNew * sizeof(Pixel)); if (pptr) ppixClient = pptr; npixClient = npixNew; } else { npixClient = 0; free(ppixClient); ppixClient = (Pixel *) NULL; } switch (color) { case PSEUDOMAP: case REDMAP: pmap->clientPixelsRed[client] = ppixClient; pmap->numPixelsRed[client] = npixClient; break; case GREENMAP: pmap->clientPixelsGreen[client] = ppixClient; pmap->numPixelsGreen[client] = npixClient; break; case BLUEMAP: pmap->clientPixelsBlue[client] = ppixClient; pmap->numPixelsBlue[client] = npixClient; break; } } return errVal; } /* Redefine color values */ int StoreColors(ColormapPtr pmap, int count, xColorItem * defs, ClientPtr client) { Pixel pix; xColorItem *pdef; EntryPtr pent, pentT, pentLast; VisualPtr pVisual; SHAREDCOLOR *pred, *pgreen, *pblue; int n, ChgRed, ChgGreen, ChgBlue, idef; int class, errVal = Success; int ok; class = pmap->class; if (!(class & DynamicClass) && !(pmap->flags & BeingCreated)) { return BadAccess; } pVisual = pmap->pVisual; idef = 0; if ((class | DynamicClass) == DirectColor) { int numred, numgreen, numblue; Pixel rgbbad; numred = NUMRED(pVisual); numgreen = NUMGREEN(pVisual); numblue = NUMBLUE(pVisual); rgbbad = ~RGBMASK(pVisual); for (pdef = defs, n = 0; n < count; pdef++, n++) { ok = TRUE; (*pmap->pScreen->ResolveColor) (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual); if (pdef->pixel & rgbbad) { errVal = BadValue; client->errorValue = pdef->pixel; continue; } pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed; if (pix >= numred) { errVal = BadValue; ok = FALSE; } else if (pmap->red[pix].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } else if (pdef->flags & DoRed) { pmap->red[pix].co.local.red = pdef->red; } else { pdef->red = pmap->red[pix].co.local.red; } pix = (pdef->pixel & pVisual->greenMask) >> pVisual->offsetGreen; if (pix >= numgreen) { errVal = BadValue; ok = FALSE; } else if (pmap->green[pix].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } else if (pdef->flags & DoGreen) { pmap->green[pix].co.local.green = pdef->green; } else { pdef->green = pmap->green[pix].co.local.green; } pix = (pdef->pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (pix >= numblue) { errVal = BadValue; ok = FALSE; } else if (pmap->blue[pix].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } else if (pdef->flags & DoBlue) { pmap->blue[pix].co.local.blue = pdef->blue; } else { pdef->blue = pmap->blue[pix].co.local.blue; } /* If this is an o.k. entry, then it gets added to the list * to be sent to the hardware. If not, skip it. Once we've * skipped one, we have to copy all the others. */ if (ok) { if (idef != n) defs[idef] = defs[n]; idef++; } else client->errorValue = pdef->pixel; } } else { for (pdef = defs, n = 0; n < count; pdef++, n++) { ok = TRUE; if (pdef->pixel >= pVisual->ColormapEntries) { client->errorValue = pdef->pixel; errVal = BadValue; ok = FALSE; } else if (pmap->red[pdef->pixel].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } /* If this is an o.k. entry, then it gets added to the list * to be sent to the hardware. If not, skip it. Once we've * skipped one, we have to copy all the others. */ if (ok) { if (idef != n) defs[idef] = defs[n]; idef++; } else continue; (*pmap->pScreen->ResolveColor) (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual); pent = &pmap->red[pdef->pixel]; if (pdef->flags & DoRed) { if (pent->fShared) { pent->co.shco.red->color = pdef->red; if (pent->co.shco.red->refcnt > 1) ok = FALSE; } else pent->co.local.red = pdef->red; } else { if (pent->fShared) pdef->red = pent->co.shco.red->color; else pdef->red = pent->co.local.red; } if (pdef->flags & DoGreen) { if (pent->fShared) { pent->co.shco.green->color = pdef->green; if (pent->co.shco.green->refcnt > 1) ok = FALSE; } else pent->co.local.green = pdef->green; } else { if (pent->fShared) pdef->green = pent->co.shco.green->color; else pdef->green = pent->co.local.green; } if (pdef->flags & DoBlue) { if (pent->fShared) { pent->co.shco.blue->color = pdef->blue; if (pent->co.shco.blue->refcnt > 1) ok = FALSE; } else pent->co.local.blue = pdef->blue; } else { if (pent->fShared) pdef->blue = pent->co.shco.blue->color; else pdef->blue = pent->co.local.blue; } if (!ok) { /* have to run through the colormap and change anybody who * shares this value */ pred = pent->co.shco.red; pgreen = pent->co.shco.green; pblue = pent->co.shco.blue; ChgRed = pdef->flags & DoRed; ChgGreen = pdef->flags & DoGreen; ChgBlue = pdef->flags & DoBlue; pentLast = pmap->red + pVisual->ColormapEntries; for (pentT = pmap->red; pentT < pentLast; pentT++) { if (pentT->fShared && (pentT != pent)) { xColorItem defChg; /* There are, alas, devices in this world too dumb * to read their own hardware colormaps. Sick, but * true. So we're going to be really nice and load * the xColorItem with the proper value for all the * fields. We will only set the flags for those * fields that actually change. Smart devices can * arrange to change only those fields. Dumb devices * can rest assured that we have provided for them, * and can change all three fields */ defChg.flags = 0; if (ChgRed && pentT->co.shco.red == pred) { defChg.flags |= DoRed; } if (ChgGreen && pentT->co.shco.green == pgreen) { defChg.flags |= DoGreen; } if (ChgBlue && pentT->co.shco.blue == pblue) { defChg.flags |= DoBlue; } if (defChg.flags != 0) { defChg.pixel = pentT - pmap->red; defChg.red = pentT->co.shco.red->color; defChg.green = pentT->co.shco.green->color; defChg.blue = pentT->co.shco.blue->color; (*pmap->pScreen->StoreColors) (pmap, 1, &defChg); } } } } } } /* Note that we use idef, the count of acceptable entries, and not * count, the count of proposed entries */ if (idef != 0) (*pmap->pScreen->StoreColors) (pmap, idef, defs); return errVal; } int IsMapInstalled(Colormap map, WindowPtr pWin) { Colormap *pmaps; int imap, nummaps, found; pmaps = malloc(pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if (!pmaps) return FALSE; nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) (pWin->drawable.pScreen, pmaps); found = FALSE; for (imap = 0; imap < nummaps; imap++) { if (pmaps[imap] == map) { found = TRUE; break; } } free(pmaps); return found; } struct colormap_lookup_data { ScreenPtr pScreen; VisualPtr visuals; }; static void _colormap_find_resource(void *value, XID id, void *cdata) { struct colormap_lookup_data *cmap_data = cdata; VisualPtr visuals = cmap_data->visuals; ScreenPtr pScreen = cmap_data->pScreen; ColormapPtr cmap = value; int j; if (pScreen != cmap->pScreen) return; j = cmap->pVisual - pScreen->visuals; cmap->pVisual = &visuals[j]; } /* something has realloced the visuals, instead of breaking ABI fix it up here - glx and compsite did this wrong */ Bool ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth) { struct colormap_lookup_data cdata; int numVisuals; VisualPtr visuals; XID *vids, vid; int first_new_vid, first_new_visual, i; first_new_vid = depth->numVids; first_new_visual = pScreen->numVisuals; vids = realloc(depth->vids, (depth->numVids + new_visual_count) * sizeof(XID)); if (!vids) return FALSE; /* its realloced now no going back if we fail the next one */ depth->vids = vids; numVisuals = pScreen->numVisuals + new_visual_count; visuals = realloc(pScreen->visuals, numVisuals * sizeof(VisualRec)); if (!visuals) { return FALSE; } cdata.visuals = visuals; cdata.pScreen = pScreen; FindClientResourcesByType(serverClient, RT_COLORMAP, _colormap_find_resource, &cdata); pScreen->visuals = visuals; for (i = 0; i < new_visual_count; i++) { vid = FakeClientID(0); pScreen->visuals[first_new_visual + i].vid = vid; vids[first_new_vid + i] = vid; } depth->numVids += new_visual_count; pScreen->numVisuals += new_visual_count; return TRUE; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/tables.c���������������������������������������������������������������������0000664�0001751�0001751�00000065013�12456571574�013240� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "windowstr.h" #include "extnsionst.h" #include "dixstruct.h" #include "dixevents.h" #include "dispatch.h" #include "swaprep.h" #include "swapreq.h" 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 (*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, NotImplemented, SKeyButtonPtrEvent, SKeyButtonPtrEvent, SKeyButtonPtrEvent, SKeyButtonPtrEvent, /* 5 */ SKeyButtonPtrEvent, SEnterLeaveEvent, SEnterLeaveEvent, SFocusEvent, SFocusEvent, /* 10 */ SKeymapNotifyEvent, SExposeEvent, SGraphicsExposureEvent, SNoExposureEvent, SVisibilityEvent, /* 15 */ SCreateNotifyEvent, SDestroyNotifyEvent, SUnmapNotifyEvent, SMapNotifyEvent, SMapRequestEvent, /* 20 */ SReparentEvent, SConfigureNotifyEvent, SConfigureRequestEvent, SGravityEvent, SResizeRequestEvent, /* 25 */ SCirculateEvent, SCirculateEvent, SPropertyEvent, SSelectionClearEvent, SSelectionRequestEvent, /* 30 */ SSelectionNotifyEvent, SColormapEvent, SClientMessageEvent, SMappingEvent, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented, NotImplemented }; ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetWindowAttributesReply, ReplyNotSwappd, ReplyNotSwappd, /* 5 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 10 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetGeometryReply, (ReplySwapPtr) SQueryTreeReply, /* 15 */ (ReplySwapPtr) SInternAtomReply, (ReplySwapPtr) SGetAtomNameReply, ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetPropertyReply, /* 20 */ (ReplySwapPtr) SListPropertiesReply, ReplyNotSwappd, (ReplySwapPtr) SGetSelectionOwnerReply, ReplyNotSwappd, ReplyNotSwappd, /* 25 */ (ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 30 */ (ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 35 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SQueryPointerReply, (ReplySwapPtr) SGetMotionEventsReply, (ReplySwapPtr) STranslateCoordsReply, /* 40 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetInputFocusReply, (ReplySwapPtr) SQueryKeymapReply, ReplyNotSwappd, /* 45 */ ReplyNotSwappd, (ReplySwapPtr) SQueryFontReply, (ReplySwapPtr) SQueryTextExtentsReply, (ReplySwapPtr) SListFontsReply, (ReplySwapPtr) SListFontsWithInfoReply, /* 50 */ ReplyNotSwappd, (ReplySwapPtr) SGetFontPathReply, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 55 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 60 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 65 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 70 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetImageReply, ReplyNotSwappd, ReplyNotSwappd, /* 75 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 80 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SListInstalledColormapsReply, (ReplySwapPtr) SAllocColorReply, (ReplySwapPtr) SAllocNamedColorReply, /* 85 */ (ReplySwapPtr) SAllocColorCellsReply, (ReplySwapPtr) SAllocColorPlanesReply, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 90 */ (ReplySwapPtr) SQueryColorsReply, (ReplySwapPtr) SLookupColorReply, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 95 */ ReplyNotSwappd, (ReplySwapPtr) SQueryBestSizeReply, (ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */ (ReplySwapPtr) SListExtensionsReply, ReplyNotSwappd, /* 100 */ (ReplySwapPtr) SGetKeyboardMappingReply, ReplyNotSwappd, (ReplySwapPtr) SGetKeyboardControlReply, ReplyNotSwappd, ReplyNotSwappd, /* 105 */ (ReplySwapPtr) SGetPointerControlReply, ReplyNotSwappd, (ReplySwapPtr) SGetScreenSaverReply, ReplyNotSwappd, (ReplySwapPtr) SListHostsReply, /* 110 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 115 */ (ReplySwapPtr) SGenericReply, /* SetPointerMapping */ (ReplySwapPtr) SGetPointerMappingReply, (ReplySwapPtr) SGenericReply, /* SetModifierMapping */ (ReplySwapPtr) SGetModifierMappingReply, /* 119 */ ReplyNotSwappd, /* 120 */ ReplyNotSwappd, /* 121 */ ReplyNotSwappd, /* 122 */ ReplyNotSwappd, /* 123 */ ReplyNotSwappd, /* 124 */ ReplyNotSwappd, /* 125 */ ReplyNotSwappd, /* 126 */ ReplyNotSwappd, /* NoOperation */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/atom.c�����������������������������������������������������������������������0000664�0001751�0001751�00000013417�12456571574�012727� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xatom.h> #include <stdio.h> #include <string.h> #include "misc.h" #include "resource.h" #include "dix.h" #define InitialTableSize 100 typedef struct _Node { struct _Node *left, *right; Atom a; unsigned int fingerPrint; const char *string; } NodeRec, *NodePtr; static Atom lastAtom = None; static NodePtr atomRoot = NULL; static unsigned long tableLength; static NodePtr *nodeTable; void FreeAtom(NodePtr patom); Atom MakeAtom(const char *string, unsigned len, Bool makeit) { NodePtr *np; unsigned i; int comp; unsigned int fp = 0; np = &atomRoot; for (i = 0; i < (len + 1) / 2; i++) { fp = fp * 27 + string[i]; fp = fp * 27 + string[len - 1 - i]; } while (*np != NULL) { if (fp < (*np)->fingerPrint) np = &((*np)->left); else if (fp > (*np)->fingerPrint) np = &((*np)->right); else { /* now start testing the strings */ comp = strncmp(string, (*np)->string, (int) len); if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string)))) np = &((*np)->left); else if (comp > 0) np = &((*np)->right); else return (*np)->a; } } if (makeit) { NodePtr nd; nd = malloc(sizeof(NodeRec)); if (!nd) return BAD_RESOURCE; if (lastAtom < XA_LAST_PREDEFINED) { nd->string = string; } else { nd->string = strndup(string, len); if (!nd->string) { free(nd); return BAD_RESOURCE; } } if ((lastAtom + 1) >= tableLength) { NodePtr *table; table = realloc(nodeTable, tableLength * (2 * sizeof(NodePtr))); if (!table) { if (nd->string != string) { /* nd->string has been strdup'ed */ free((char *) nd->string); } free(nd); return BAD_RESOURCE; } tableLength <<= 1; nodeTable = table; } *np = nd; nd->left = nd->right = NULL; nd->fingerPrint = fp; nd->a = ++lastAtom; nodeTable[lastAtom] = nd; return nd->a; } else return None; } Bool ValidAtom(Atom atom) { return (atom != None) && (atom <= lastAtom); } const char * NameForAtom(Atom atom) { NodePtr node; if (atom > lastAtom) return 0; if ((node = nodeTable[atom]) == NULL) return 0; return node->string; } void AtomError(void) { FatalError("initializing atoms"); } void FreeAtom(NodePtr patom) { if (patom->left) FreeAtom(patom->left); if (patom->right) FreeAtom(patom->right); if (patom->a > XA_LAST_PREDEFINED) { /* * All strings above XA_LAST_PREDEFINED are strdup'ed, so it's safe to * cast here */ free((char *) patom->string); } free(patom); } void FreeAllAtoms(void) { if (atomRoot == NULL) return; FreeAtom(atomRoot); atomRoot = NULL; free(nodeTable); nodeTable = NULL; lastAtom = None; } void InitAtoms(void) { FreeAllAtoms(); tableLength = InitialTableSize; nodeTable = malloc(InitialTableSize * sizeof(NodePtr)); if (!nodeTable) AtomError(); nodeTable[None] = NULL; MakePredeclaredAtoms(); if (lastAtom != XA_LAST_PREDEFINED) AtomError(); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/ptrveloc.c�������������������������������������������������������������������0000664�0001751�0001751�00000106202�12274325511�013602� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * Copyright © 2006-2009 Simon Thum simon dot thum at gmx dot de * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <math.h> #include <ptrveloc.h> #include <exevents.h> #include <X11/Xatom.h> #include <os.h> #include <xserver-properties.h> /***************************************************************************** * Predictable pointer acceleration * * 2006-2009 by Simon Thum (simon [dot] thum [at] gmx de) * * Serves 3 complementary functions: * 1) provide a sophisticated ballistic velocity estimate to improve * the relation between velocity (of the device) and acceleration * 2) make arbitrary acceleration profiles possible * 3) decelerate by two means (constant and adaptive) if enabled * * Important concepts are the * * - Scheme * which selects the basic algorithm * (see devices.c/InitPointerAccelerationScheme) * - Profile * which returns an acceleration * for a given velocity * * The profile can be selected by the user at runtime. * The classic profile is intended to cleanly perform old-style * function selection (threshold =/!= 0) * ****************************************************************************/ /* fwds */ static double SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc); static PointerAccelerationProfileFunc GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); static BOOL InitializePredictableAccelerationProperties(DeviceIntPtr, DeviceVelocityPtr, PredictableAccelSchemePtr); static BOOL DeletePredictableAccelerationProperties(DeviceIntPtr, PredictableAccelSchemePtr); /*#define PTRACCEL_DEBUGGING*/ #ifdef PTRACCEL_DEBUGGING #define DebugAccelF(...) ErrorFSigSafe("dix/ptraccel: " __VA_ARGS__) #else #define DebugAccelF(...) /* */ #endif /******************************** * Init/Uninit *******************************/ /* some int which is not a profile number */ #define PROFILE_UNINITIALIZE (-100) /** * Init DeviceVelocity struct so it should match the average case */ void InitVelocityData(DeviceVelocityPtr vel) { memset(vel, 0, sizeof(DeviceVelocityRec)); vel->corr_mul = 10.0; /* dots per 10 milisecond should be usable */ vel->const_acceleration = 1.0; /* no acceleration/deceleration */ vel->reset_time = 300; vel->use_softening = 1; vel->min_acceleration = 1.0; /* don't decelerate */ vel->max_rel_diff = 0.2; vel->max_diff = 1.0; vel->initial_range = 2; vel->average_accel = TRUE; SetAccelerationProfile(vel, AccelProfileClassic); InitTrackers(vel, 16); } /** * Clean up DeviceVelocityRec */ void FreeVelocityData(DeviceVelocityPtr vel) { free(vel->tracker); SetAccelerationProfile(vel, PROFILE_UNINITIALIZE); } /** * Init predictable scheme */ Bool InitPredictableAccelerationScheme(DeviceIntPtr dev, ValuatorAccelerationPtr protoScheme) { DeviceVelocityPtr vel; ValuatorAccelerationRec scheme; PredictableAccelSchemePtr schemeData; scheme = *protoScheme; vel = calloc(1, sizeof(DeviceVelocityRec)); schemeData = calloc(1, sizeof(PredictableAccelSchemeRec)); if (!vel || !schemeData) return FALSE; InitVelocityData(vel); schemeData->vel = vel; scheme.accelData = schemeData; if (!InitializePredictableAccelerationProperties(dev, vel, schemeData)) return FALSE; /* all fine, assign scheme to device */ dev->valuator->accelScheme = scheme; return TRUE; } /** * Uninit scheme */ void AccelerationDefaultCleanup(DeviceIntPtr dev) { DeviceVelocityPtr vel = GetDevicePredictableAccelData(dev); if (vel) { /* the proper guarantee would be that we're not inside of * AccelSchemeProc(), but that seems impossible. Schemes don't get * switched often anyway. */ OsBlockSignals(); dev->valuator->accelScheme.AccelSchemeProc = NULL; FreeVelocityData(vel); free(vel); DeletePredictableAccelerationProperties(dev, (PredictableAccelSchemePtr) dev->valuator->accelScheme. accelData); free(dev->valuator->accelScheme.accelData); dev->valuator->accelScheme.accelData = NULL; OsReleaseSignals(); } } /************************* * Input property support ************************/ /** * choose profile */ static int AccelSetProfileProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr vel; int profile, *ptr = &profile; int rc; int nelem = 1; if (atom != XIGetKnownProperty(ACCEL_PROP_PROFILE_NUMBER)) return Success; vel = GetDevicePredictableAccelData(dev); if (!vel) return BadValue; rc = XIPropToInt(val, &nelem, &ptr); if (checkOnly) { if (rc) return rc; if (GetAccelerationProfile(vel, profile) == NULL) return BadValue; } else SetAccelerationProfile(vel, profile); return Success; } static long AccelInitProfileProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) { int profile = vel->statistics.profile_number; Atom prop_profile_number = XIGetKnownProperty(ACCEL_PROP_PROFILE_NUMBER); XIChangeDeviceProperty(dev, prop_profile_number, XA_INTEGER, 32, PropModeReplace, 1, &profile, FALSE); XISetDevicePropertyDeletable(dev, prop_profile_number, FALSE); return XIRegisterPropertyHandler(dev, AccelSetProfileProperty, NULL, NULL); } /** * constant deceleration */ static int AccelSetDecelProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr vel; float v, *ptr = &v; int rc; int nelem = 1; if (atom != XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION)) return Success; vel = GetDevicePredictableAccelData(dev); if (!vel) return BadValue; rc = XIPropToFloat(val, &nelem, &ptr); if (checkOnly) { if (rc) return rc; return (v > 0) ? Success : BadValue; } vel->const_acceleration = 1 / v; return Success; } static long AccelInitDecelProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) { float fval = 1.0 / vel->const_acceleration; Atom prop_const_decel = XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION); XIChangeDeviceProperty(dev, prop_const_decel, XIGetKnownProperty(XATOM_FLOAT), 32, PropModeReplace, 1, &fval, FALSE); XISetDevicePropertyDeletable(dev, prop_const_decel, FALSE); return XIRegisterPropertyHandler(dev, AccelSetDecelProperty, NULL, NULL); } /** * adaptive deceleration */ static int AccelSetAdaptDecelProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr veloc; float v, *ptr = &v; int rc; int nelem = 1; if (atom != XIGetKnownProperty(ACCEL_PROP_ADAPTIVE_DECELERATION)) return Success; veloc = GetDevicePredictableAccelData(dev); if (!veloc) return BadValue; rc = XIPropToFloat(val, &nelem, &ptr); if (checkOnly) { if (rc) return rc; return (v >= 1.0f) ? Success : BadValue; } if (v >= 1.0f) veloc->min_acceleration = 1 / v; return Success; } static long AccelInitAdaptDecelProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) { float fval = 1.0 / vel->min_acceleration; Atom prop_adapt_decel = XIGetKnownProperty(ACCEL_PROP_ADAPTIVE_DECELERATION); XIChangeDeviceProperty(dev, prop_adapt_decel, XIGetKnownProperty(XATOM_FLOAT), 32, PropModeReplace, 1, &fval, FALSE); XISetDevicePropertyDeletable(dev, prop_adapt_decel, FALSE); return XIRegisterPropertyHandler(dev, AccelSetAdaptDecelProperty, NULL, NULL); } /** * velocity scaling */ static int AccelSetScaleProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr vel; float v, *ptr = &v; int rc; int nelem = 1; if (atom != XIGetKnownProperty(ACCEL_PROP_VELOCITY_SCALING)) return Success; vel = GetDevicePredictableAccelData(dev); if (!vel) return BadValue; rc = XIPropToFloat(val, &nelem, &ptr); if (checkOnly) { if (rc) return rc; return (v > 0) ? Success : BadValue; } if (v > 0) vel->corr_mul = v; return Success; } static long AccelInitScaleProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) { float fval = vel->corr_mul; Atom prop_velo_scale = XIGetKnownProperty(ACCEL_PROP_VELOCITY_SCALING); XIChangeDeviceProperty(dev, prop_velo_scale, XIGetKnownProperty(XATOM_FLOAT), 32, PropModeReplace, 1, &fval, FALSE); XISetDevicePropertyDeletable(dev, prop_velo_scale, FALSE); return XIRegisterPropertyHandler(dev, AccelSetScaleProperty, NULL, NULL); } static BOOL InitializePredictableAccelerationProperties(DeviceIntPtr dev, DeviceVelocityPtr vel, PredictableAccelSchemePtr schemeData) { int num_handlers = 4; if (!vel) return FALSE; schemeData->prop_handlers = calloc(num_handlers, sizeof(long)); if (!schemeData->prop_handlers) return FALSE; schemeData->num_prop_handlers = num_handlers; schemeData->prop_handlers[0] = AccelInitProfileProperty(dev, vel); schemeData->prop_handlers[1] = AccelInitDecelProperty(dev, vel); schemeData->prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel); schemeData->prop_handlers[3] = AccelInitScaleProperty(dev, vel); return TRUE; } BOOL DeletePredictableAccelerationProperties(DeviceIntPtr dev, PredictableAccelSchemePtr scheme) { DeviceVelocityPtr vel; Atom prop; int i; prop = XIGetKnownProperty(ACCEL_PROP_VELOCITY_SCALING); XIDeleteDeviceProperty(dev, prop, FALSE); prop = XIGetKnownProperty(ACCEL_PROP_ADAPTIVE_DECELERATION); XIDeleteDeviceProperty(dev, prop, FALSE); prop = XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION); XIDeleteDeviceProperty(dev, prop, FALSE); prop = XIGetKnownProperty(ACCEL_PROP_PROFILE_NUMBER); XIDeleteDeviceProperty(dev, prop, FALSE); vel = GetDevicePredictableAccelData(dev); if (vel) { for (i = 0; i < scheme->num_prop_handlers; i++) if (scheme->prop_handlers[i]) XIUnregisterPropertyHandler(dev, scheme->prop_handlers[i]); } free(scheme->prop_handlers); scheme->prop_handlers = NULL; scheme->num_prop_handlers = 0; return TRUE; } /********************* * Tracking logic ********************/ void InitTrackers(DeviceVelocityPtr vel, int ntracker) { if (ntracker < 1) { ErrorF("invalid number of trackers\n"); return; } free(vel->tracker); vel->tracker = (MotionTrackerPtr) calloc(ntracker, sizeof(MotionTracker)); vel->num_tracker = ntracker; } enum directions { N = (1 << 0), NE = (1 << 1), E = (1 << 2), SE = (1 << 3), S = (1 << 4), SW = (1 << 5), W = (1 << 6), NW = (1 << 7), UNDEFINED = 0xFF }; /** * return a bit field of possible directions. * There's no reason against widening to more precise directions (<45 degrees), * should it not perform well. All this is needed for is sort out non-linear * motion, so precision isn't paramount. However, one should not flag direction * too narrow, since it would then cut the linear segment to zero size way too * often. * * @return A bitmask for N, NE, S, SE, etc. indicating the directions for * this movement. */ static int DoGetDirection(int dx, int dy) { int dir = 0; /* on insignificant mickeys, flag 135 degrees */ if (abs(dx) < 2 && abs(dy) < 2) { /* first check diagonal cases */ if (dx > 0 && dy > 0) dir = E | SE | S; else if (dx > 0 && dy < 0) dir = N | NE | E; else if (dx < 0 && dy < 0) dir = W | NW | N; else if (dx < 0 && dy > 0) dir = W | SW | S; /* check axis-aligned directions */ else if (dx > 0) dir = NE | E | SE; else if (dx < 0) dir = NW | W | SW; else if (dy > 0) dir = SE | S | SW; else if (dy < 0) dir = NE | N | NW; else dir = UNDEFINED; /* shouldn't happen */ } else { /* compute angle and set appropriate flags */ double r; int i1, i2; r = atan2(dy, dx); /* find direction. * * Add 360° to avoid r become negative since C has no well-defined * modulo for such cases. Then divide by 45° to get the octant * number, e.g. * 0 <= r <= 1 is [0-45]° * 1 <= r <= 2 is [45-90]° * etc. * But we add extra 90° to match up with our N, S, etc. defines up * there, rest stays the same. */ r = (r + (M_PI * 2.5)) / (M_PI / 4); /* this intends to flag 2 directions (45 degrees), * except on very well-aligned mickeys. */ i1 = (int) (r + 0.1) % 8; i2 = (int) (r + 0.9) % 8; if (i1 < 0 || i1 > 7 || i2 < 0 || i2 > 7) dir = UNDEFINED; /* shouldn't happen */ else dir = (1 << i1 | 1 << i2); } return dir; } #define DIRECTION_CACHE_RANGE 5 #define DIRECTION_CACHE_SIZE (DIRECTION_CACHE_RANGE*2+1) /* cache DoGetDirection(). * To avoid excessive use of direction calculation, cache the values for * [-5..5] for both x/y. Anything outside of that is calcualted on the fly. * * @return A bitmask for N, NE, S, SE, etc. indicating the directions for * this movement. */ static int GetDirection(int dx, int dy) { static int cache[DIRECTION_CACHE_SIZE][DIRECTION_CACHE_SIZE]; int dir; if (abs(dx) <= DIRECTION_CACHE_RANGE && abs(dy) <= DIRECTION_CACHE_RANGE) { /* cacheable */ dir = cache[DIRECTION_CACHE_RANGE + dx][DIRECTION_CACHE_RANGE + dy]; if (dir == 0) { dir = DoGetDirection(dx, dy); cache[DIRECTION_CACHE_RANGE + dx][DIRECTION_CACHE_RANGE + dy] = dir; } } else { /* non-cacheable */ dir = DoGetDirection(dx, dy); } return dir; } #undef DIRECTION_CACHE_RANGE #undef DIRECTION_CACHE_SIZE /* convert offset (age) to array index */ #define TRACKER_INDEX(s, d) (((s)->num_tracker + (s)->cur_tracker - (d)) % (s)->num_tracker) #define TRACKER(s, d) &(s)->tracker[TRACKER_INDEX(s,d)] /** * Add the delta motion to each tracker, then reset the latest tracker to * 0/0 and set it as the current one. */ static inline void FeedTrackers(DeviceVelocityPtr vel, double dx, double dy, int cur_t) { int n; for (n = 0; n < vel->num_tracker; n++) { vel->tracker[n].dx += dx; vel->tracker[n].dy += dy; } n = (vel->cur_tracker + 1) % vel->num_tracker; vel->tracker[n].dx = 0.0; vel->tracker[n].dy = 0.0; vel->tracker[n].time = cur_t; vel->tracker[n].dir = GetDirection(dx, dy); 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; } /** * calc velocity for given tracker, with * velocity scaling. * This assumes linear motion. */ static double CalcTracker(const MotionTracker * tracker, int cur_t) { double dist = sqrt(tracker->dx * tracker->dx + tracker->dy * tracker->dy); int dtime = cur_t - tracker->time; if (dtime > 0) return dist / dtime; else return 0; /* synonymous for NaN, since we're not C99 */ } /* find the most plausible velocity. That is, the most distant * (in time) tracker which isn't too old, the movement vector was * in the same octant, and where the velocity is within an * acceptable range to the inital velocity. * * @return The tracker's velocity or 0 if the above conditions are unmet */ static double QueryTrackers(DeviceVelocityPtr vel, int cur_t) { int offset, dir = UNDEFINED, used_offset = -1, age_ms; /* initial velocity: a low-offset, valid velocity */ double initial_velocity = 0, result = 0, velocity_diff; double velocity_factor = vel->corr_mul * vel->const_acceleration; /* premultiply */ /* loop from current to older data */ for (offset = 1; offset < vel->num_tracker; offset++) { MotionTracker *tracker = TRACKER(vel, offset); double tracker_velocity; age_ms = cur_t - tracker->time; /* bail out if data is too old and protect from overrun */ if (age_ms >= vel->reset_time || age_ms < 0) { DebugAccelF("query: tracker too old (reset after %d, age is %d)\n", vel->reset_time, age_ms); break; } /* * this heuristic avoids using the linear-motion velocity formula * in CalcTracker() on motion that isn't exactly linear. So to get * even more precision we could subdivide as a final step, so possible * non-linearities are accounted for. */ dir &= tracker->dir; if (dir == 0) { /* we've changed octant of movement (e.g. NE → NW) */ 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; } tracker_velocity = CalcTracker(tracker, cur_t) * velocity_factor; if ((initial_velocity == 0 || offset <= vel->initial_range) && tracker_velocity != 0) { /* set initial velocity and result */ result = initial_velocity = tracker_velocity; used_offset = offset; } else if (initial_velocity != 0 && tracker_velocity != 0) { velocity_diff = fabs(initial_velocity - tracker_velocity); if (velocity_diff > vel->max_diff && velocity_diff / (initial_velocity + tracker_velocity) >= vel->max_rel_diff) { /* we're not in range, quit - it won't get better. */ DebugAccelF("query: tracker too different:" " old %2.2f initial %2.2f diff: %2.2f\n", tracker_velocity, initial_velocity, velocity_diff); break; } /* we're in range with the initial velocity, * so this result is likely better * (it contains more information). */ result = tracker_velocity; used_offset = offset; } } if (offset == vel->num_tracker) { 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("result: offset %i [dx: %f dy: %f diff: %i]\n", used_offset, tracker->dx, tracker->dy, cur_t - tracker->time); #endif } return result; } #undef TRACKER_INDEX #undef TRACKER /** * Perform velocity approximation based on 2D 'mickeys' (mouse motion delta). * return true if non-visible state reset is suggested */ BOOL ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time) { double velocity; vel->last_velocity = vel->velocity; FeedTrackers(vel, dx, dy, time); velocity = QueryTrackers(vel, time); DebugAccelF("velocity is %f\n", velocity); vel->velocity = velocity; return velocity == 0; } /** * this flattens significant ( > 1) mickeys a little bit for more steady * constant-velocity response */ static inline double ApplySimpleSoftening(double prev_delta, double delta) { double result = delta; if (delta < -1.0 || delta > 1.0) { if (delta > prev_delta) result -= 0.5; else if (delta < prev_delta) result += 0.5; } return result; } /** * Soften the delta based on previous deltas stored in vel. * * @param[in,out] fdx Delta X, modified in-place. * @param[in,out] fdx Delta Y, modified in-place. */ static void ApplySoftening(DeviceVelocityPtr vel, double *fdx, double *fdy) { if (vel->use_softening) { *fdx = ApplySimpleSoftening(vel->last_dx, *fdx); *fdy = ApplySimpleSoftening(vel->last_dy, *fdy); } } static void ApplyConstantDeceleration(DeviceVelocityPtr vel, double *fdx, double *fdy) { *fdx *= vel->const_acceleration; *fdy *= vel->const_acceleration; } /* * compute the acceleration for given velocity and enforce min_acceleration */ double BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { double result; result = vel->Profile(dev, vel, velocity, threshold, acc); /* enforce min_acceleration */ if (result < vel->min_acceleration) result = vel->min_acceleration; return result; } /** * Compute acceleration. Takes into account averaging, nv-reset, etc. * If the velocity has changed, an average is taken of 6 velocity factors: * current velocity, last velocity and 4 times the average between the two. */ static double ComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel, double threshold, double acc) { double result; if (vel->velocity <= 0) { DebugAccelF("profile skipped\n"); /* * If we have no idea about device velocity, don't pretend it. */ return 1; } if (vel->average_accel && vel->velocity != vel->last_velocity) { /* use simpson's rule to average acceleration between * current and previous velocity. * Though being the more natural choice, it causes a minor delay * in comparison, so it can be disabled. */ result = BasicComputeAcceleration(dev, vel, vel->velocity, threshold, acc); result += BasicComputeAcceleration(dev, vel, vel->last_velocity, threshold, acc); result += 4.0f * BasicComputeAcceleration(dev, vel, (vel->last_velocity + vel->velocity) / 2, threshold, acc); result /= 6.0f; DebugAccelF("profile average [%.2f ... %.2f] is %.3f\n", vel->velocity, vel->last_velocity, result); } else { result = BasicComputeAcceleration(dev, vel, vel->velocity, threshold, acc); DebugAccelF("profile sample [%.2f] is %.3f\n", vel->velocity, result); } return result; } /***************************************** * Acceleration functions and profiles ****************************************/ /** * Polynomial function similar previous one, but with f(1) = 1 */ static double PolynomialAccelerationProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double ignored, double acc) { return pow(velocity, (acc - 1.0) * 0.5); } /** * returns acceleration for velocity. * This profile selects the two functions like the old scheme did */ static double ClassicProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { if (threshold > 0) { return SimpleSmoothProfile(dev, vel, velocity, threshold, acc); } else { return PolynomialAccelerationProfile(dev, vel, velocity, 0, acc); } } /** * Power profile * This has a completely smooth transition curve, i.e. no jumps in the * derivatives. * * This has the expense of overall response dependency on min-acceleration. * In effect, min_acceleration mimics const_acceleration in this profile. */ static double PowerProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { double vel_dist; acc = (acc - 1.0) * 0.1f + 1.0; /* without this, acc of 2 is unuseable */ if (velocity <= threshold) return vel->min_acceleration; vel_dist = velocity - threshold; return (pow(acc, vel_dist)) * vel->min_acceleration; } /** * just a smooth function in [0..1] -> [0..1] * - point symmetry at 0.5 * - f'(0) = f'(1) = 0 * - starts faster than a sinoid * - smoothness C1 (Cinf if you dare to ignore endpoints) */ static inline double CalcPenumbralGradient(double x) { x *= 2.0f; x -= 1.0f; return 0.5f + (x * sqrt(1.0 - x * x) + asin(x)) / M_PI; } /** * acceleration function similar to classic accelerated/unaccelerated, * but with smooth transition in between (and towards zero for adaptive dec.). */ static double SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { if (velocity < 1.0f) return CalcPenumbralGradient(0.5 + velocity * 0.5) * 2.0f - 1.0f; if (threshold < 1.0f) threshold = 1.0f; if (velocity <= threshold) return 1; velocity /= threshold; if (velocity >= acc) return acc; else return 1.0f + (CalcPenumbralGradient(velocity / acc) * (acc - 1.0f)); } /** * This profile uses the first half of the penumbral gradient as a start * and then scales linearly. */ static double SmoothLinearProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { double res, nv; if (acc > 1.0f) acc -= 1.0f; /*this is so acc = 1 is no acceleration */ else return 1.0f; nv = (velocity - threshold) * acc * 0.5f; if (nv < 0) { res = 0; } else if (nv < 2) { res = CalcPenumbralGradient(nv * 0.25f) * 2.0f; } else { nv -= 2.0f; res = nv * 2.0f / M_PI /* steepness of gradient at 0.5 */ + 1.0f; /* gradient crosses 2|1 */ } res += vel->min_acceleration; return res; } /** * From 0 to threshold, the response graduates smoothly from min_accel to * acceleration. Beyond threshold it is exactly the specified acceleration. */ static double SmoothLimitedProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { double res; if (velocity >= threshold || threshold == 0.0f) return acc; velocity /= threshold; /* should be [0..1[ now */ res = CalcPenumbralGradient(velocity) * (acc - vel->min_acceleration); return vel->min_acceleration + res; } static double LinearProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { return acc * velocity; } static double NoProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { return 1.0f; } static PointerAccelerationProfileFunc GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num) { switch (profile_num) { case AccelProfileClassic: return ClassicProfile; case AccelProfileDeviceSpecific: return vel->deviceSpecificProfile; case AccelProfilePolynomial: return PolynomialAccelerationProfile; case AccelProfileSmoothLinear: return SmoothLinearProfile; case AccelProfileSimple: return SimpleSmoothProfile; case AccelProfilePower: return PowerProfile; case AccelProfileLinear: return LinearProfile; case AccelProfileSmoothLimited: return SmoothLimitedProfile; case AccelProfileNone: return NoProfile; default: return NULL; } } /** * Set the profile by number. * Intended to make profiles exchangeable at runtime. * If you created a profile, give it a number here and in the header to * make it selectable. In case some profile-specific init is needed, here * would be a good place, since FreeVelocityData() also calls this with * PROFILE_UNINITIALIZE. * * returns FALSE if profile number is unavailable, TRUE otherwise. */ int SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num) { PointerAccelerationProfileFunc profile; profile = GetAccelerationProfile(vel, profile_num); if (profile == NULL && profile_num != PROFILE_UNINITIALIZE) return FALSE; /* Here one could free old profile-private data */ free(vel->profile_private); vel->profile_private = NULL; /* Here one could init profile-private data */ vel->Profile = profile; vel->statistics.profile_number = profile_num; return TRUE; } /********************************************** * driver interaction **********************************************/ /** * device-specific profile * * The device-specific profile is intended as a hook for a driver * which may want to provide an own acceleration profile. * It should not rely on profile-private data, instead * it should do init/uninit in the driver (ie. with DEVICE_INIT and friends). * Users may override or choose it. */ void SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, PointerAccelerationProfileFunc profile) { if (vel) vel->deviceSpecificProfile = profile; } /** * Use this function to obtain a DeviceVelocityPtr for a device. Will return NULL if * the predictable acceleration scheme is not in effect. */ DeviceVelocityPtr GetDevicePredictableAccelData(DeviceIntPtr dev) { BUG_RETURN_VAL(!dev, NULL); if (dev->valuator && dev->valuator->accelScheme.AccelSchemeProc == acceleratePointerPredictable && dev->valuator->accelScheme.accelData != NULL) { return ((PredictableAccelSchemePtr) dev->valuator->accelScheme.accelData)->vel; } return NULL; } /******************************** * acceleration schemes *******************************/ /** * Modifies valuators in-place. * This version employs a velocity approximation algorithm to * enable fine-grained predictable acceleration profiles. */ void acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime) { double dx = 0, dy = 0; DeviceVelocityPtr velocitydata = GetDevicePredictableAccelData(dev); Bool soften = TRUE; if (valuator_mask_num_valuators(val) == 0 || !velocitydata) return; if (velocitydata->statistics.profile_number == AccelProfileNone && velocitydata->const_acceleration == 1.0f) { return; /*we're inactive anyway, so skip the whole thing. */ } if (valuator_mask_isset(val, 0)) { dx = valuator_mask_get_double(val, 0); } if (valuator_mask_isset(val, 1)) { dy = valuator_mask_get_double(val, 1); } if (dx != 0.0 || dy != 0.0) { /* reset non-visible state? */ if (ProcessVelocityData2D(velocitydata, dx, dy, evtime)) { soften = FALSE; } if (dev->ptrfeed && dev->ptrfeed->ctrl.num) { double mult; /* invoke acceleration profile to determine acceleration */ mult = ComputeAcceleration(dev, velocitydata, dev->ptrfeed->ctrl.threshold, (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); ApplyConstantDeceleration(velocitydata, &dx, &dy); if (dx != 0.0) valuator_mask_set_double(val, 0, mult * dx); if (dy != 0.0) valuator_mask_set_double(val, 1, mult * dy); DebugAccelF("delta x:%.3f y:%.3f\n", mult * dx, mult * dy); } } } /* remember last motion delta (for softening/slow movement treatment) */ velocitydata->last_dx = dx; velocitydata->last_dy = dy; } /** * Originally a part of xf86PostMotionEvent; modifies valuators * in-place. Retained mostly for embedded scenarios. */ void acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val, CARD32 ignored) { double mult = 0.0, tmpf; double dx = 0.0, dy = 0.0; if (valuator_mask_isset(val, 0)) { dx = valuator_mask_get(val, 0); } if (valuator_mask_isset(val, 1)) { dy = valuator_mask_get(val, 1); } if (valuator_mask_num_valuators(val) == 0) return; if (dev->ptrfeed && dev->ptrfeed->ctrl.num) { /* modeled from xf86Events.c */ if (dev->ptrfeed->ctrl.threshold) { if ((fabs(dx) + fabs(dy)) >= dev->ptrfeed->ctrl.threshold) { if (dx != 0.0) { tmpf = (dx * (double) (dev->ptrfeed->ctrl.num)) / (double) (dev->ptrfeed->ctrl.den); valuator_mask_set_double(val, 0, tmpf); } if (dy != 0.0) { tmpf = (dy * (double) (dev->ptrfeed->ctrl.num)) / (double) (dev->ptrfeed->ctrl.den); valuator_mask_set_double(val, 1, tmpf); } } } else { mult = pow(dx * dx + dy * dy, ((double) (dev->ptrfeed->ctrl.num) / (double) (dev->ptrfeed->ctrl.den) - 1.0) / 2.0) / 2.0; if (dx != 0.0) valuator_mask_set_double(val, 0, mult * dx); if (dy != 0.0) valuator_mask_set_double(val, 1, mult * dy); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/getevents.c������������������������������������������������������������������0000664�0001751�0001751�00000203765�12456571574�014002� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2006 Nokia Corporation * Copyright © 2006-2007 Daniel Stone * Copyright © 2008 Red Hat, Inc. * Copyright © 2011 The Chromium Authors * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: Daniel Stone <daniel@fooishbar.org> * Peter Hutterer <peter.hutterer@who-t.net> */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/keysym.h> #include <X11/Xproto.h> #include <math.h> #include <limits.h> #include "misc.h" #include "resource.h" #include "inputstr.h" #include "scrnintstr.h" #include "cursorstr.h" #include "dixstruct.h" #include "globals.h" #include "dixevents.h" #include "mipointer.h" #include "eventstr.h" #include "eventconvert.h" #include "inpututils.h" #include "mi.h" #include "windowstr.h" #include <X11/extensions/XKBproto.h> #include "xkbsrv.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #include <X11/extensions/XI.h> #include <X11/extensions/XI2.h> #include <X11/extensions/XIproto.h> #include <pixman.h> #include "exglobals.h" #include "exevents.h" #include "extnsionst.h" #include "listdev.h" /* for sizing up DeviceClassesChangedEvent */ #if XSERVER_DTRACE #include <sys/types.h> typedef const char *string; #include <Xserver-dtrace.h> #endif /* Number of motion history events to store. */ #define MOTION_HISTORY_SIZE 256 /** * InputEventList is the storage for input events generated by * QueuePointerEvents, QueueKeyboardEvents, and QueueProximityEvents. * This list is allocated on startup by the DIX. */ InternalEvent *InputEventList = NULL; /** * Pick some arbitrary size for Xi motion history. */ int GetMotionHistorySize(void) { return MOTION_HISTORY_SIZE; } void set_button_down(DeviceIntPtr pDev, int button, int type) { if (type == BUTTON_PROCESSED) SetBit(pDev->button->down, button); else SetBit(pDev->button->postdown, button); } void set_button_up(DeviceIntPtr pDev, int button, int type) { if (type == BUTTON_PROCESSED) ClearBit(pDev->button->down, button); else ClearBit(pDev->button->postdown, button); } Bool button_is_down(DeviceIntPtr pDev, int button, int type) { Bool ret = FALSE; if (type & BUTTON_PROCESSED) ret = ret || BitIsOn(pDev->button->down, button); if (type & BUTTON_POSTED) ret = ret || BitIsOn(pDev->button->postdown, button); return ret; } void set_key_down(DeviceIntPtr pDev, int key_code, int type) { if (type == KEY_PROCESSED) SetBit(pDev->key->down, key_code); else SetBit(pDev->key->postdown, key_code); } void set_key_up(DeviceIntPtr pDev, int key_code, int type) { if (type == KEY_PROCESSED) ClearBit(pDev->key->down, key_code); else ClearBit(pDev->key->postdown, key_code); } Bool key_is_down(DeviceIntPtr pDev, int key_code, int type) { Bool ret = FALSE; if (type & KEY_PROCESSED) ret = ret || BitIsOn(pDev->key->down, key_code); if (type & KEY_POSTED) ret = ret || BitIsOn(pDev->key->postdown, key_code); return ret; } static Bool key_autorepeats(DeviceIntPtr pDev, int key_code) { return ! !(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] & (1 << (key_code & 7))); } static void init_touch_ownership(DeviceIntPtr dev, TouchOwnershipEvent *event, Time ms) { memset(event, 0, sizeof(TouchOwnershipEvent)); event->header = ET_Internal; event->type = ET_TouchOwnership; event->length = sizeof(TouchOwnershipEvent); event->time = ms; event->deviceid = dev->id; } static void init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail) { memset(event, 0, sizeof(RawDeviceEvent)); event->header = ET_Internal; event->length = sizeof(RawDeviceEvent); switch (type) { case MotionNotify: event->type = ET_RawMotion; break; case ButtonPress: event->type = ET_RawButtonPress; break; case ButtonRelease: event->type = ET_RawButtonRelease; break; case KeyPress: event->type = ET_RawKeyPress; break; case KeyRelease: event->type = ET_RawKeyRelease; break; case XI_TouchBegin: event->type = ET_RawTouchBegin; break; case XI_TouchUpdate: event->type = ET_RawTouchUpdate; break; case XI_TouchEnd: event->type = ET_RawTouchEnd; break; } event->time = ms; event->deviceid = dev->id; event->sourceid = dev->id; event->detail.button = detail; } static void set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, double *data) { int i; for (i = 0; i < valuator_mask_size(mask); i++) { if (valuator_mask_isset(mask, i)) { SetBit(event->valuators.mask, i); data[i] = valuator_mask_get_double(mask, i); } } } static void set_valuators(DeviceIntPtr dev, DeviceEvent *event, ValuatorMask *mask) { int i; /* Set the data to the previous value for unset absolute axes. The values * may be used when sent as part of an XI 1.x valuator event. */ for (i = 0; i < valuator_mask_size(mask); i++) { if (valuator_mask_isset(mask, i)) { SetBit(event->valuators.mask, i); if (valuator_get_mode(dev, i) == Absolute) SetBit(event->valuators.mode, i); event->valuators.data[i] = valuator_mask_get_double(mask, i); } else event->valuators.data[i] = dev->valuator->axisVal[i]; } } void CreateClassesChangedEvent(InternalEvent *event, DeviceIntPtr master, DeviceIntPtr slave, int flags) { int i; DeviceChangedEvent *dce; CARD32 ms = GetTimeInMillis(); dce = &event->changed_event; memset(dce, 0, sizeof(DeviceChangedEvent)); dce->deviceid = slave->id; dce->masterid = master ? master->id : 0; dce->header = ET_Internal; dce->length = sizeof(DeviceChangedEvent); dce->type = ET_DeviceChanged; dce->time = ms; dce->flags = flags; dce->sourceid = slave->id; if (slave->button) { dce->buttons.num_buttons = slave->button->numButtons; for (i = 0; i < dce->buttons.num_buttons; i++) dce->buttons.names[i] = slave->button->labels[i]; } if (slave->valuator) { dce->num_valuators = slave->valuator->numAxes; for (i = 0; i < dce->num_valuators; i++) { dce->valuators[i].min = slave->valuator->axes[i].min_value; dce->valuators[i].max = slave->valuator->axes[i].max_value; dce->valuators[i].resolution = slave->valuator->axes[i].resolution; dce->valuators[i].mode = slave->valuator->axes[i].mode; dce->valuators[i].name = slave->valuator->axes[i].label; dce->valuators[i].scroll = slave->valuator->axes[i].scroll; dce->valuators[i].value = slave->valuator->axisVal[i]; } } if (slave->key) { dce->keys.min_keycode = slave->key->xkbInfo->desc->min_key_code; dce->keys.max_keycode = slave->key->xkbInfo->desc->max_key_code; } } /** * Rescale the coord between the two axis ranges. */ static double rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to, double defmin, double defmax) { double fmin = defmin, fmax = defmax; double tmin = defmin, tmax = defmax; if (from && from->min_value < from->max_value) { fmin = from->min_value; fmax = from->max_value + 1; } if (to && to->min_value < to->max_value) { tmin = to->min_value; tmax = to->max_value + 1; } if (fmin == tmin && fmax == tmax) return coord; if (fmax == fmin) /* avoid division by 0 */ return 0.0; return (coord - fmin) * (tmax - tmin) / (fmax - fmin) + tmin; } /** * Update all coordinates when changing to a different SD * to ensure that relative reporting will work as expected * without loss of precision. * * pDev->last.valuators will be in absolute device coordinates after this * function. */ static void updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) { int i; DeviceIntPtr lastSlave; /* master->last.valuators[0]/[1] is in desktop-wide coords and the actual * position of the pointer */ pDev->last.valuators[0] = master->last.valuators[0]; pDev->last.valuators[1] = master->last.valuators[1]; if (!pDev->valuator) return; /* scale back to device coordinates */ if (pDev->valuator->numAxes > 0) { pDev->last.valuators[0] = rescaleValuatorAxis(pDev->last.valuators[0], NULL, pDev->valuator->axes + 0, screenInfo.x, screenInfo.width); } if (pDev->valuator->numAxes > 1) { pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1], NULL, pDev->valuator->axes + 1, screenInfo.y, screenInfo.height); } /* calculate the other axis as well based on info from the old * slave-device. If the old slave had less axes than this one, * last.valuators is reset to 0. */ if ((lastSlave = master->last.slave) && lastSlave->valuator) { for (i = 2; i < pDev->valuator->numAxes; i++) { if (i >= lastSlave->valuator->numAxes) { pDev->last.valuators[i] = 0; valuator_mask_set_double(pDev->last.scroll, i, 0); } else { double val = pDev->last.valuators[i]; val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i, pDev->valuator->axes + i, 0, 0); pDev->last.valuators[i] = val; valuator_mask_set_double(pDev->last.scroll, i, val); } } } } /** * Allocate the motion history buffer. */ void AllocateMotionHistory(DeviceIntPtr pDev) { int size; free(pDev->valuator->motion); if (pDev->valuator->numMotionEvents < 1) return; /* An MD must have a motion history size large enough to keep all * potential valuators, plus the respective range of the valuators. * 3 * INT32 for (min_val, max_val, curr_val)) */ if (IsMaster(pDev)) size = sizeof(INT32) * 3 * MAX_VALUATORS; else { ValuatorClassPtr v = pDev->valuator; int numAxes; /* XI1 doesn't understand mixed mode devices */ for (numAxes = 0; numAxes < v->numAxes; numAxes++) if (valuator_get_mode(pDev, numAxes) != valuator_get_mode(pDev, 0)) break; size = sizeof(INT32) * numAxes; } size += sizeof(Time); pDev->valuator->motion = calloc(pDev->valuator->numMotionEvents, size); pDev->valuator->first_motion = 0; pDev->valuator->last_motion = 0; if (!pDev->valuator->motion) ErrorF("[dix] %s: Failed to alloc motion history (%d bytes).\n", pDev->name, size * pDev->valuator->numMotionEvents); } /** * Dump the motion history between start and stop into the supplied buffer. * Only records the event for a given screen in theory, but in practice, we * sort of ignore this. * * If core is set, we only generate x/y, in INT16, scaled to screen coords. */ int GetMotionHistory(DeviceIntPtr pDev, xTimecoord ** buff, unsigned long start, unsigned long stop, ScreenPtr pScreen, BOOL core) { char *ibuff = NULL, *obuff; int i = 0, ret = 0; int j, coord; Time current; /* The size of a single motion event. */ int size; AxisInfo from, *to; /* for scaling */ INT32 *ocbuf, *icbuf; /* pointer to coordinates for copying */ INT16 *corebuf; AxisInfo core_axis = { 0 }; if (!pDev->valuator || !pDev->valuator->numMotionEvents) return 0; if (core && !pScreen) return 0; if (IsMaster(pDev)) size = (sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(Time); else size = (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time); *buff = malloc(size * pDev->valuator->numMotionEvents); if (!(*buff)) return 0; obuff = (char *) *buff; for (i = pDev->valuator->first_motion; i != pDev->valuator->last_motion; i = (i + 1) % pDev->valuator->numMotionEvents) { /* We index the input buffer by which element we're accessing, which * is not monotonic, and the output buffer by how many events we've * written so far. */ ibuff = (char *) pDev->valuator->motion + (i * size); memcpy(¤t, ibuff, sizeof(Time)); if (current > stop) { return ret; } else if (current >= start) { if (core) { memcpy(obuff, ibuff, sizeof(Time)); /* copy timestamp */ icbuf = (INT32 *) (ibuff + sizeof(Time)); corebuf = (INT16 *) (obuff + sizeof(Time)); /* fetch x coordinate + range */ memcpy(&from.min_value, icbuf++, sizeof(INT32)); memcpy(&from.max_value, icbuf++, sizeof(INT32)); memcpy(&coord, icbuf++, sizeof(INT32)); /* scale to screen coords */ to = &core_axis; to->max_value = pScreen->width; coord = rescaleValuatorAxis(coord, &from, to, 0, pScreen->width); memcpy(corebuf, &coord, sizeof(INT16)); corebuf++; /* fetch y coordinate + range */ memcpy(&from.min_value, icbuf++, sizeof(INT32)); memcpy(&from.max_value, icbuf++, sizeof(INT32)); memcpy(&coord, icbuf++, sizeof(INT32)); to->max_value = pScreen->height; coord = rescaleValuatorAxis(coord, &from, to, 0, pScreen->height); memcpy(corebuf, &coord, sizeof(INT16)); } else if (IsMaster(pDev)) { memcpy(obuff, ibuff, sizeof(Time)); /* copy timestamp */ ocbuf = (INT32 *) (obuff + sizeof(Time)); icbuf = (INT32 *) (ibuff + sizeof(Time)); for (j = 0; j < MAX_VALUATORS; j++) { if (j >= pDev->valuator->numAxes) break; /* fetch min/max/coordinate */ memcpy(&from.min_value, icbuf++, sizeof(INT32)); memcpy(&from.max_value, icbuf++, sizeof(INT32)); memcpy(&coord, icbuf++, sizeof(INT32)); to = (j < pDev->valuator->numAxes) ? &pDev->valuator-> axes[j] : NULL; /* x/y scaled to screen if no range is present */ if (j == 0 && (from.max_value < from.min_value)) from.max_value = pScreen->width; else if (j == 1 && (from.max_value < from.min_value)) from.max_value = pScreen->height; /* scale from stored range into current range */ coord = rescaleValuatorAxis(coord, &from, to, 0, 0); memcpy(ocbuf, &coord, sizeof(INT32)); ocbuf++; } } else memcpy(obuff, ibuff, size); /* don't advance by size here. size may be different to the * actually written size if the MD has less valuators than MAX */ if (core) obuff += sizeof(INT32) + sizeof(Time); else obuff += (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time); ret++; } } return ret; } /** * Update the motion history for a specific device, with the list of * valuators. * * Layout of the history buffer: * for SDs: [time] [val0] [val1] ... [valn] * for MDs: [time] [min_val0] [max_val0] [val0] [min_val1] ... [valn] * * For events that have some valuators unset: * min_val == max_val == val == 0. */ static void updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask, double *valuators) { char *buff = (char *) pDev->valuator->motion; ValuatorClassPtr v; int i; if (!pDev->valuator->numMotionEvents) return; v = pDev->valuator; if (IsMaster(pDev)) { buff += ((sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(CARD32)) * v->last_motion; memcpy(buff, &ms, sizeof(Time)); buff += sizeof(Time); memset(buff, 0, sizeof(INT32) * 3 * MAX_VALUATORS); for (i = 0; i < v->numAxes; i++) { int val; /* XI1 doesn't support mixed mode devices */ if (valuator_get_mode(pDev, i) != valuator_get_mode(pDev, 0)) break; if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i)) { buff += 3 * sizeof(INT32); continue; } memcpy(buff, &v->axes[i].min_value, sizeof(INT32)); buff += sizeof(INT32); memcpy(buff, &v->axes[i].max_value, sizeof(INT32)); buff += sizeof(INT32); val = valuators[i]; memcpy(buff, &val, sizeof(INT32)); buff += sizeof(INT32); } } else { buff += ((sizeof(INT32) * pDev->valuator->numAxes) + sizeof(CARD32)) * pDev->valuator->last_motion; memcpy(buff, &ms, sizeof(Time)); buff += sizeof(Time); memset(buff, 0, sizeof(INT32) * pDev->valuator->numAxes); for (i = 0; i < MAX_VALUATORS; i++) { int val; if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i)) { buff += sizeof(INT32); continue; } val = valuators[i]; memcpy(buff, &val, sizeof(INT32)); buff += sizeof(INT32); } } pDev->valuator->last_motion = (pDev->valuator->last_motion + 1) % pDev->valuator->numMotionEvents; /* If we're wrapping around, just keep the circular buffer going. */ if (pDev->valuator->first_motion == pDev->valuator->last_motion) pDev->valuator->first_motion = (pDev->valuator->first_motion + 1) % pDev->valuator->numMotionEvents; return; } /** * Returns the maximum number of events GetKeyboardEvents * and GetPointerEvents will ever return. * * This MUST be absolutely constant, from init until exit. */ int GetMaximumEventsNum(void) { /* One raw event * One device event * One possible device changed event * Lots of possible separate button scroll events (horiz + vert) * Lots of possible separate raw button scroll events (horiz + vert) */ return 100; } /** * Clip an axis to its bounds, which are declared in the call to * InitValuatorAxisClassStruct. */ static void clipAxis(DeviceIntPtr pDev, int axisNum, double *val) { AxisInfoPtr axis; if (axisNum >= pDev->valuator->numAxes) return; axis = pDev->valuator->axes + axisNum; /* If a value range is defined, clip. If not, do nothing */ if (axis->max_value <= axis->min_value) return; if (*val < axis->min_value) *val = axis->min_value; if (*val > axis->max_value) *val = axis->max_value; } /** * Clip every axis in the list of valuators to its bounds. */ static void clipValuators(DeviceIntPtr pDev, ValuatorMask *mask) { int i; for (i = 0; i < valuator_mask_size(mask); i++) if (valuator_mask_isset(mask, i)) { double val = valuator_mask_get_double(mask, i); clipAxis(pDev, i, &val); valuator_mask_set_double(mask, i, val); } } /** * Create the DCCE event (does not update the master's device state yet, this * is done in the event processing). * Pull in the coordinates from the MD if necessary. * * @param events Pointer to a pre-allocated event array. * @param dev The slave device that generated an event. * @param type Either DEVCHANGE_POINTER_EVENT and/or DEVCHANGE_KEYBOARD_EVENT * @param num_events The current number of events, returns the number of * events if a DCCE was generated. * @return The updated @events pointer. */ InternalEvent * UpdateFromMaster(InternalEvent *events, DeviceIntPtr dev, int type, int *num_events) { DeviceIntPtr master; master = GetMaster(dev, (type & DEVCHANGE_POINTER_EVENT) ? MASTER_POINTER : MASTER_KEYBOARD); if (master && master->last.slave != dev) { CreateClassesChangedEvent(events, master, dev, type | DEVCHANGE_SLAVE_SWITCH); if (IsPointerDevice(master)) { updateSlaveDeviceCoords(master, dev); master->last.numValuators = dev->last.numValuators; } master->last.slave = dev; (*num_events)++; events++; } return events; } /** * Move the device's pointer to the position given in the valuators. * * @param dev The device whose pointer is to be moved. * @param mask Valuator data for this event. */ static void clipAbsolute(DeviceIntPtr dev, ValuatorMask *mask) { int i; for (i = 0; i < valuator_mask_size(mask); i++) { double val; if (!valuator_mask_isset(mask, i)) continue; val = valuator_mask_get_double(mask, i); clipAxis(dev, i, &val); valuator_mask_set_double(mask, i, val); } } static void add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, double value) { double v; if (!valuator_mask_fetch_double(mask, valuator, &v)) return; /* protect against scrolling overflow. INT_MAX for double, because * we'll eventually write this as 32.32 fixed point */ if ((value > 0 && v > INT_MAX - value) || (value < 0 && v < INT_MIN - value)) { v = 0; /* reset last.scroll to avoid a button storm */ valuator_mask_set_double(dev->last.scroll, valuator, 0); } else v += value; valuator_mask_set_double(mask, valuator, v); } static void scale_for_device_resolution(DeviceIntPtr dev, ValuatorMask *mask) { double y; ValuatorClassPtr v = dev->valuator; int xrange = v->axes[0].max_value - v->axes[0].min_value + 1; int yrange = v->axes[1].max_value - v->axes[1].min_value + 1; double screen_ratio = 1.0 * screenInfo.width/screenInfo.height; double device_ratio = 1.0 * xrange/yrange; double resolution_ratio = 1.0; double ratio; if (!valuator_mask_fetch_double(mask, 1, &y)) return; if (v->axes[0].resolution != 0 && v->axes[1].resolution != 0) resolution_ratio = 1.0 * v->axes[0].resolution/v->axes[1].resolution; ratio = device_ratio/resolution_ratio/screen_ratio; valuator_mask_set_double(mask, 1, y / ratio); } /** * Move the device's pointer by the values given in @valuators. * * @param dev The device whose pointer is to be moved. * @param[in,out] mask Valuator data for this event, modified in-place. */ static void moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask) { int i; Bool clip_xy = IsMaster(dev) || !IsFloating(dev); ValuatorClassPtr v = dev->valuator; /* 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 && v && v->numAxes > 1 && v->axes[0].min_value < v->axes[0].max_value && v->axes[1].min_value < v->axes[1].max_value) { scale_for_device_resolution(dev, mask); } /* calc other axes, clip, drop back into valuators */ for (i = 0; i < valuator_mask_size(mask); i++) { double val = dev->last.valuators[i]; if (!valuator_mask_isset(mask, i)) continue; add_to_scroll_valuator(dev, mask, i, val); /* x & y need to go over the limits to cross screens if the SD * isn't currently attached; otherwise, clip to screen bounds. */ if (valuator_get_mode(dev, i) == Absolute && ((i != 0 && i != 1) || clip_xy)) { val = valuator_mask_get_double(mask, i); clipAxis(dev, i, &val); valuator_mask_set_double(mask, i, val); } } } /** * Accelerate the data in valuators based on the device's acceleration scheme. * * @param dev The device which's pointer is to be moved. * @param valuators Valuator mask * @param ms Current time. */ static void accelPointer(DeviceIntPtr dev, ValuatorMask *valuators, CARD32 ms) { if (dev->valuator->accelScheme.AccelSchemeProc) dev->valuator->accelScheme.AccelSchemeProc(dev, valuators, ms); } /** * Scale from absolute screen coordinates to absolute coordinates in the * device's coordinate range. * * @param dev The device to scale for. * @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, int flags) { double scaled; ScreenPtr scr = miPointerGetScreen(dev); if (valuator_mask_isset(mask, 0)) { scaled = valuator_mask_get_double(mask, 0); if (flags & POINTER_SCREEN) scaled += scr->x; scaled = rescaleValuatorAxis(scaled, NULL, dev->valuator->axes + 0, screenInfo.x, screenInfo.width); valuator_mask_set_double(mask, 0, scaled); } if (valuator_mask_isset(mask, 1)) { scaled = valuator_mask_get_double(mask, 1); if (flags & POINTER_SCREEN) scaled += scr->y; scaled = rescaleValuatorAxis(scaled, NULL, dev->valuator->axes + 1, screenInfo.y, screenInfo.height); valuator_mask_set_double(mask, 1, scaled); } } /** * Scale from (absolute) device to screen coordinates here, * * The coordinates provided are always absolute. see fill_pointer_events for * information on coordinate systems. * * @param dev The device to be moved. * @param mask Mask of axis values for this event * @param[out] devx x desktop-wide coordinate in device coordinate system * @param[out] devy y desktop-wide coordinate in device coordinate system * @param[out] screenx x coordinate in desktop coordinate system * @param[out] screeny y coordinate in desktop coordinate system */ static ScreenPtr scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask, double *devx, double *devy, double *screenx, double *screeny) { ScreenPtr scr = miPointerGetScreen(dev); double x, y; BUG_WARN(dev->valuator && dev->valuator->numAxes < 2); if (!dev->valuator || dev->valuator->numAxes < 2) { /* if we have no axes, last.valuators must be in screen coords * anyway */ *devx = *screenx = dev->last.valuators[0]; *devy = *screeny = dev->last.valuators[1]; return scr; } if (valuator_mask_isset(mask, 0)) x = valuator_mask_get_double(mask, 0); else x = dev->last.valuators[0]; if (valuator_mask_isset(mask, 1)) y = valuator_mask_get_double(mask, 1); else y = dev->last.valuators[1]; /* scale x&y to desktop coordinates */ *screenx = rescaleValuatorAxis(x, dev->valuator->axes + 0, NULL, screenInfo.x, screenInfo.width); *screeny = rescaleValuatorAxis(y, dev->valuator->axes + 1, NULL, screenInfo.y, screenInfo.height); *devx = x; *devy = y; return scr; } /** * If we have HW cursors, this actually moves the visible sprite. If not, we * just do all the screen crossing, etc. * * We use the screen coordinates here, call miPointerSetPosition() and then * scale back into device coordinates (if needed). miPSP will change x/y if * the screen was crossed. * * The coordinates provided are always absolute. The parameter mode * specifies whether it was relative or absolute movement that landed us at * those coordinates. see fill_pointer_events for information on coordinate * systems. * * @param dev The device to be moved. * @param mode Movement mode (Absolute or Relative) * @param[out] mask Mask of axis values for this event, returns the * per-screen device coordinates after confinement * @param[in,out] devx x desktop-wide coordinate in device coordinate system * @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, int *nevents, InternalEvent* events) { ScreenPtr scr = miPointerGetScreen(dev); double tmpx, tmpy; if (!dev->valuator || dev->valuator->numAxes < 2) return scr; tmpx = *screenx; tmpy = *screeny; /* 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, nevents, events); /* If we were constrained, rescale x/y from the screen coordinates so * the device valuators reflect the correct position. For screen * crossing this doesn't matter much, the coords would be 0 or max. */ if (tmpx != *screenx) *devx = rescaleValuatorAxis(*screenx, NULL, dev->valuator->axes + 0, screenInfo.x, screenInfo.width); if (tmpy != *screeny) *devy = rescaleValuatorAxis(*screeny, NULL, dev->valuator->axes + 1, screenInfo.y, screenInfo.height); /* Recalculate the per-screen device coordinates */ if (valuator_mask_isset(mask, 0)) { double x; x = rescaleValuatorAxis(*screenx - scr->x, NULL, dev->valuator->axes + 0, 0, scr->width); valuator_mask_set_double(mask, 0, x); } if (valuator_mask_isset(mask, 1)) { double y; y = rescaleValuatorAxis(*screeny - scr->y, NULL, dev->valuator->axes + 1, 0, scr->height); valuator_mask_set_double(mask, 1, y); } return scr; } /** * Update the motion history for the device and (if appropriate) for its * master device. * @param dev Slave device to update. * @param mask Bit mask of valid valuators to append to history. * @param num Total number of valuators to append to history. * @param ms Current time */ static void updateHistory(DeviceIntPtr dev, ValuatorMask *mask, CARD32 ms) { if (!dev->valuator) return; updateMotionHistory(dev, ms, mask, dev->last.valuators); if (!IsMaster(dev) && !IsFloating(dev)) { DeviceIntPtr master = GetMaster(dev, MASTER_POINTER); updateMotionHistory(master, ms, mask, dev->last.valuators); } } static void queueEventList(DeviceIntPtr device, InternalEvent *events, int nevents) { int i; for (i = 0; i < nevents; i++) mieqEnqueue(device, &events[i]); } static void event_set_root_coordinates(DeviceEvent *event, double x, double y) { event->root_x = trunc(x); event->root_y = trunc(y); event->root_x_frac = x - trunc(x); event->root_y_frac = y - trunc(y); } /** * Generate internal events representing this keyboard event and enqueue * them on the event queue. * * This function is not reentrant. Disable signals before calling. * * FIXME: flags for relative/abs motion? * * @param device The device to generate the event for * @param type Event type, one of KeyPress or KeyRelease * @param keycode Key code of the pressed/released key * @param mask Valuator mask for valuators present for this event. * */ void QueueKeyboardEvents(DeviceIntPtr device, int type, int keycode, const ValuatorMask *mask) { int nevents; nevents = GetKeyboardEvents(InputEventList, device, type, keycode, mask); queueEventList(device, InputEventList, nevents); } /** * Returns a set of InternalEvents for KeyPress/KeyRelease, optionally * also with valuator events. * * The DDX is responsible for allocating the event list in the first * place via InitEventList(), and for freeing it. * * @return the number of events written into events. */ int GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int key_code, const ValuatorMask *mask_in) { int num_events = 0; CARD32 ms = 0; DeviceEvent *event; 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; if (!events || !pDev->key || !pDev->focus || !pDev->kbdfeed || (type != KeyPress && type != KeyRelease) || (key_code < 8 || key_code > 255)) return 0; if (mask_in && valuator_mask_size(mask_in) > 1) { ErrorF("[dix] the server does not handle valuator masks with " "keyboard events. This is a bug. You may fix it.\n"); } num_events = 1; events = UpdateFromMaster(events, pDev, DEVCHANGE_KEYBOARD_EVENT, &num_events); /* Handle core repeating, via press/release/press/release. */ if (type == KeyPress && key_is_down(pDev, key_code, KEY_POSTED)) { /* If autorepeating is disabled either globally or just for that key, * or we have a modifier, don't generate a repeat event. */ if (!pDev->kbdfeed->ctrl.autoRepeat || !key_autorepeats(pDev, key_code) || pDev->key->xkbInfo->desc->map->modmap[key_code]) return 0; } ms = GetTimeInMillis(); raw = &events->raw_event; events++; num_events++; valuator_mask_copy(&mask, mask_in); init_raw(pDev, raw, ms, type, key_code); set_raw_valuators(raw, &mask, raw->valuators.data_raw); clipValuators(pDev, &mask); set_raw_valuators(raw, &mask, raw->valuators.data); event = &events->device_event; init_device_event(event, pDev, ms); event->detail.key = key_code; if (type == KeyPress) { event->type = ET_KeyPress; set_key_down(pDev, key_code, KEY_POSTED); } else if (type == KeyRelease) { event->type = ET_KeyRelease; set_key_up(pDev, key_code, KEY_POSTED); } clipValuators(pDev, &mask); set_valuators(pDev, event, &mask); if (!IsFloating(pDev)) { DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER); event_set_root_coordinates(event, master->last.valuators[0], master->last.valuators[1]); } return num_events; } /** * Initialize an event array large enough for num_events arrays. * This event list is to be passed into GetPointerEvents() and * GetKeyboardEvents(). * * @param num_events Number of elements in list. */ InternalEvent * InitEventList(int num_events) { InternalEvent *events = calloc(num_events, sizeof(InternalEvent)); return events; } /** * Free an event list. * * @param list The list to be freed. * @param num_events Number of elements in list. */ void FreeEventList(InternalEvent *list, int num_events) { free(list); } /** * Transform vector x/y according to matrix m and drop the rounded coords * back into x/y. */ static void transform(struct pixman_f_transform *m, double *x, double *y) { struct pixman_f_vector p = {.v = {*x, *y, 1} }; pixman_f_transform_point(m, &p); *x = p.v[0]; *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 * 0 and 1, others will be untouched. * * @param dev The device the valuators came from * @param[in,out] mask The valuator mask. */ static void transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) { double x, y, ox, oy; int has_x, has_y; has_x = valuator_mask_isset(mask, 0); has_y = valuator_mask_isset(mask, 1); if (!has_x && !has_y) return; if (!has_x || !has_y) { struct pixman_f_transform invert; /* undo transformation from last event */ ox = dev->last.valuators[0]; oy = dev->last.valuators[1]; pixman_f_transform_invert(&invert, &dev->scale_and_transform); transform(&invert, &ox, &oy); } if (has_x) ox = valuator_mask_get_double(mask, 0); if (has_y) oy = valuator_mask_get_double(mask, 1); x = ox; y = oy; transform(&dev->scale_and_transform, &x, &y); if (has_x || ox != x) valuator_mask_set_double(mask, 0, x); if (has_y || oy != y) valuator_mask_set_double(mask, 1, y); } static void storeLastValuators(DeviceIntPtr dev, ValuatorMask *mask, int xaxis, int yaxis, double devx, double devy) { int i; /* store desktop-wide in last.valuators */ if (valuator_mask_isset(mask, xaxis)) dev->last.valuators[0] = devx; if (valuator_mask_isset(mask, yaxis)) dev->last.valuators[1] = devy; for (i = 0; i < valuator_mask_size(mask); i++) { if (i == xaxis || i == yaxis) continue; if (valuator_mask_isset(mask, i)) dev->last.valuators[i] = valuator_mask_get_double(mask, i); } } /** * Generate internal events representing this pointer event and enqueue them * on the event queue. * * This function is not reentrant. Disable signals before calling. * * @param device The device to generate the event for * @param type Event type, one of ButtonPress, ButtonRelease, MotionNotify * @param buttons Button number of the buttons modified. Must be 0 for * MotionNotify * @param flags Event modification flags * @param mask Valuator mask for valuators present for this event. */ void QueuePointerEvents(DeviceIntPtr device, int type, int buttons, int flags, const ValuatorMask *mask) { int nevents; nevents = GetPointerEvents(InputEventList, device, type, buttons, flags, mask); queueEventList(device, InputEventList, nevents); } /** * Helper function for GetPointerEvents, which only generates motion and * raw motion events for the slave device: does not update the master device. * * Should not be called by anyone other than GetPointerEvents. * * We use several different coordinate systems and need to switch between * the three in fill_pointer_events, positionSprite and * miPointerSetPosition. "desktop" refers to the width/height of all * screenInfo.screens[n]->width/height added up. "screen" is ScreenRec, not * output. * * Coordinate systems: * - relative events have a mask_in in relative coordinates, mapped to * pixels. These events are mapped to the current position±delta. * - absolute events have a mask_in in absolute device coordinates in * device-specific range. This range is mapped to the desktop. * - POINTER_SCREEN absolute events (x86WarpCursor) are in screen-relative * screen coordinate range. * - rootx/rooty in events must be be relative to the current screen's * origin (screen coordinate system) * - XI2 valuators must be relative to the current screen's origin. On * the protocol the device min/max range maps to the current screen. * * For screen switching we need to get the desktop coordinates for each * event, then map that to the respective position on each screen and * position the cursor there. * The device's last.valuator[] stores the last position in desktop-wide * coordinates (in device range for slave devices, desktop range for master * devices). * * screen-relative device coordinates requires scaling: A device coordinate * x/y of range [n..m] that maps to positions Sx/Sy on Screen S must be * rescaled to match Sx/Sy for [n..m]. In the simplest example, x of (m/2-1) * is the last coordinate on the first screen and must be rescaled for the * event to be m. XI2 clients that do their own coordinate mapping would * otherwise interpret the position of the device elsewere to the cursor. * However, this scaling leads to losses: * if we have two ScreenRecs we scale from e.g. [0..44704] (Wacom I4) to * [0..2048[. that gives us 2047.954 as desktop coord, or the per-screen * coordinate 1023.954. Scaling that back into the device coordinate range * gives us 44703. So off by one device unit. It's a bug, but we'll have to * live with it because with all this scaling, we just cannot win. * * @return the number of events written into events. */ static int fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, CARD32 ms, int flags, const ValuatorMask *mask_in) { int num_events = 1; DeviceEvent *event; RawDeviceEvent *raw = NULL; double screenx = 0.0, screeny = 0.0; /* desktop coordinate system */ double devx = 0.0, devy = 0.0; /* desktop-wide in device coords */ int sx = 0, sy = 0; /* for POINTER_SCREEN */ ValuatorMask mask; ScreenPtr scr; int num_barrier_events = 0; switch (type) { case MotionNotify: if (!pDev->valuator) { ErrorF("[dix] motion events from device %d without valuators\n", pDev->id); return 0; } if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0) return 0; break; case ButtonPress: case ButtonRelease: if (!pDev->button || !buttons) return 0; if (mask_in && valuator_mask_size(mask_in) > 0 && !pDev->valuator) { ErrorF ("[dix] button event with valuator from device %d without valuators\n", pDev->id); return 0; } break; default: return 0; } valuator_mask_copy(&mask, mask_in); if ((flags & POINTER_NORAW) == 0) { raw = &events->raw_event; events++; num_events++; init_raw(pDev, raw, ms, type, buttons); set_raw_valuators(raw, &mask, raw->valuators.data_raw); } /* valuators are in driver-native format (rel or abs) */ if (flags & POINTER_ABSOLUTE) { 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); if ((flags & POINTER_NORAW) == 0 && raw) 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 && raw) set_raw_valuators(raw, &mask, raw->valuators.data); 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, &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) devx/devy is in device coordinate desktop-wide */ updateHistory(pDev, &mask, ms); clipValuators(pDev, &mask); storeLastValuators(pDev, &mask, 0, 1, devx, devy); /* Update the MD's co-ordinates, which are always in desktop space. */ if (!IsMaster(pDev) && !IsFloating(pDev)) { DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER); master->last.valuators[0] = screenx; master->last.valuators[1] = screeny; } event = &events->device_event; init_device_event(event, pDev, ms); if (type == MotionNotify) { event->type = ET_Motion; event->detail.button = 0; } else { if (type == ButtonPress) { event->type = ET_ButtonPress; set_button_down(pDev, buttons, BUTTON_POSTED); } else if (type == ButtonRelease) { event->type = ET_ButtonRelease; set_button_up(pDev, buttons, BUTTON_POSTED); } event->detail.button = buttons; } /* root_x and root_y must be in per-screen co-ordinates */ event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y); if (flags & POINTER_EMULATED) { if (raw) raw->flags = XIPointerEmulated; event->flags = XIPointerEmulated; } set_valuators(pDev, event, &mask); return num_events; } /** * Generate events for each scroll axis that changed between before/after * for the device. * * @param events The pointer to the event list to fill the events * @param dev The device to generate the events for * @param type The real type of the event * @param axis The axis number to generate events for * @param mask State before this event in absolute coords * @param[in,out] last Last scroll state posted in absolute coords (modified * in-place) * @param ms Current time in ms * @param max_events Max number of events to be generated * @return The number of events generated */ static int emulate_scroll_button_events(InternalEvent *events, DeviceIntPtr dev, int type, int axis, const ValuatorMask *mask, ValuatorMask *last, CARD32 ms, int max_events) { AxisInfoPtr ax; double delta; double incr; int num_events = 0; double total; int b; int flags = 0; if (dev->valuator->axes[axis].scroll.type == SCROLL_TYPE_NONE) return 0; if (!valuator_mask_isset(mask, axis)) return 0; ax = &dev->valuator->axes[axis]; incr = ax->scroll.increment; if (type != ButtonPress && type != ButtonRelease) flags |= POINTER_EMULATED; if (!valuator_mask_isset(last, axis)) valuator_mask_set_double(last, axis, 0); delta = valuator_mask_get_double(mask, axis) - valuator_mask_get_double(last, axis); total = delta; b = (ax->scroll.type == SCROLL_TYPE_VERTICAL) ? 5 : 7; if ((incr > 0 && delta < 0) || (incr < 0 && delta > 0)) b--; /* we're scrolling up or left → button 4 or 6 */ while (fabs(delta) >= fabs(incr)) { int nev_tmp; if (delta > 0) delta -= fabs(incr); else if (delta < 0) delta += fabs(incr); /* fill_pointer_events() generates four events: one normal and one raw * event for button press and button release. * We may get a bigger scroll delta than we can generate events * for. In that case, we keep decreasing delta, but skip events. */ if (num_events + 4 < max_events) { if (type != ButtonRelease) { nev_tmp = fill_pointer_events(events, dev, ButtonPress, b, ms, flags, NULL); events += nev_tmp; num_events += nev_tmp; } if (type != ButtonPress) { nev_tmp = fill_pointer_events(events, dev, ButtonRelease, b, ms, flags, NULL); events += nev_tmp; num_events += nev_tmp; } } } /* We emulated, update last.scroll */ if (total != delta) { total -= delta; valuator_mask_set_double(last, axis, valuator_mask_get_double(last, axis) + total); } return num_events; } /** * Generate a complete series of InternalEvents (filled into the EventList) * representing pointer motion, or button presses. If the device is a slave * device, also potentially generate a DeviceClassesChangedEvent to update * the master device. * * events is not NULL-terminated; the return value is the number of events. * The DDX is responsible for allocating the event structure in the first * place via InitEventList() and GetMaximumEventsNum(), and for freeing it. * * In the generated events rootX/Y will be in absolute screen coords and * the valuator information in the absolute or relative device coords. * * last.valuators[x] of the device is always in absolute device coords. * last.valuators[x] of the master device is in absolute screen coords. * * master->last.valuators[x] for x > 2 is undefined. */ int GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, int flags, const ValuatorMask *mask_in) { CARD32 ms = GetTimeInMillis(); int num_events = 0, nev_tmp; ValuatorMask mask; ValuatorMask scroll; 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 BUG_RETURN_VAL(buttons >= MAX_BUTTONS, 0); /* refuse events from disabled devices */ if (!pDev->enabled) return 0; if (!miPointerGetScreen(pDev)) return 0; events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events); valuator_mask_copy(&mask, mask_in); /* Turn a scroll button press into a smooth-scrolling event if * necessary. This only needs to cater for the XIScrollFlagPreferred * axis (if more than one scrolling axis is present) */ if (type == ButtonPress) { double adj; int axis; int h_scroll_axis = -1; int v_scroll_axis = -1; if (pDev->valuator) { h_scroll_axis = pDev->valuator->h_scroll_axis; v_scroll_axis = pDev->valuator->v_scroll_axis; } /* Up is negative on valuators, down positive */ switch (buttons) { case 4: adj = -1.0; axis = v_scroll_axis; break; case 5: adj = 1.0; axis = v_scroll_axis; break; case 6: adj = -1.0; axis = h_scroll_axis; break; case 7: adj = 1.0; axis = h_scroll_axis; break; default: adj = 0.0; axis = -1; break; } 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; flags |= POINTER_EMULATED; } } /* First fill out the original event set, with smooth-scrolling axes. */ nev_tmp = fill_pointer_events(events, pDev, type, buttons, ms, flags, &mask); events += nev_tmp; num_events += nev_tmp; valuator_mask_zero(&scroll); /* Now turn the smooth-scrolling axes back into emulated button presses * for legacy clients, based on the integer delta between before and now */ for (i = 0; i < valuator_mask_size(&mask); i++) { if ( !pDev->valuator || (i >= pDev->valuator->numAxes)) break; if (!valuator_mask_isset(&mask, i)) continue; valuator_mask_set_double(&scroll, i, pDev->last.valuators[i]); nev_tmp = emulate_scroll_button_events(events, pDev, realtype, i, &scroll, pDev->last.scroll, ms, GetMaximumEventsNum() - num_events); events += nev_tmp; num_events += nev_tmp; } return num_events; } /** * Generate internal events representing this proximity event and enqueue * them on the event queue. * * This function is not reentrant. Disable signals before calling. * * @param device The device to generate the event for * @param type Event type, one of ProximityIn or ProximityOut * @param keycode Key code of the pressed/released key * @param mask Valuator mask for valuators present for this event. * */ void QueueProximityEvents(DeviceIntPtr device, int type, const ValuatorMask *mask) { int nevents; nevents = GetProximityEvents(InputEventList, device, type, mask); queueEventList(device, InputEventList, nevents); } /** * Generate ProximityIn/ProximityOut InternalEvents, accompanied by * valuators. * * The DDX is responsible for allocating the events in the first place via * InitEventList(), and for freeing it. * * @return the number of events written into events. */ int GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const ValuatorMask *mask_in) { int num_events = 1, i; 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; /* Sanity checks. */ if ((type != ProximityIn && type != ProximityOut) || !mask_in) return 0; if (!pDev->valuator || !pDev->proximity) return 0; valuator_mask_copy(&mask, mask_in); /* ignore relative axes for proximity. */ for (i = 0; i < valuator_mask_size(&mask); i++) { if (valuator_mask_isset(&mask, i) && valuator_get_mode(pDev, i) == Relative) valuator_mask_unset(&mask, i); } /* FIXME: posting proximity events with relative valuators only results * in an empty event, EventToXI() will fail to convert → no event sent * to client. */ events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events); event = &events->device_event; init_device_event(event, pDev, GetTimeInMillis()); event->type = (type == ProximityIn) ? ET_ProximityIn : ET_ProximityOut; clipValuators(pDev, &mask); set_valuators(pDev, event, &mask); return num_events; } int GetTouchOwnershipEvents(InternalEvent *events, DeviceIntPtr pDev, TouchPointInfoPtr ti, uint8_t reason, XID resource, uint32_t flags) { TouchClassPtr t = pDev->touch; TouchOwnershipEvent *event; CARD32 ms = GetTimeInMillis(); if (!pDev->enabled || !t || !ti) return 0; event = &events->touch_ownership_event; init_touch_ownership(pDev, event, ms); event->touchid = ti->client_id; event->sourceid = ti->sourceid; event->resource = resource; event->flags = flags; event->reason = reason; return 1; } /** * Generate internal events representing this touch event and enqueue them * on the event queue. * * This function is not reentrant. Disable signals before calling. * * @param device The device to generate the event for * @param type Event type, one of XI_TouchBegin, XI_TouchUpdate, XI_TouchEnd * @param touchid Touch point ID * @param flags Event modification flags * @param mask Valuator mask for valuators present for this event. */ void QueueTouchEvents(DeviceIntPtr device, int type, uint32_t ddx_touchid, int flags, const ValuatorMask *mask) { int nevents; nevents = GetTouchEvents(InputEventList, device, ddx_touchid, type, flags, mask); queueEventList(device, InputEventList, nevents); } /** * Get events for a touch. Generates a TouchBegin event if end is not set and * the touch id is not active. Generates a TouchUpdate event if end is not set * and the touch id is active. Generates a TouchEnd event if end is set and the * touch id is active. * * events is not NULL-terminated; the return value is the number of events. * The DDX is responsible for allocating the event structure in the first * place via GetMaximumEventsNum(), and for freeing it. * * @param[out] events The list of events generated * @param dev The device to generate the events for * @param ddx_touchid The touch ID as assigned by the DDX * @param type XI_TouchBegin, XI_TouchUpdate or XI_TouchEnd * @param flags Event flags * @param mask_in Valuator information for this event */ int GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, uint16_t type, uint32_t flags, const ValuatorMask *mask_in) { ScreenPtr scr = dev->spriteInfo->sprite->hotPhys.pScreen; TouchClassPtr t = dev->touch; ValuatorClassPtr v = dev->valuator; DeviceEvent *event; CARD32 ms = GetTimeInMillis(); ValuatorMask mask; double screenx = 0.0, screeny = 0.0; /* desktop coordinate system */ double devx = 0.0, devy = 0.0; /* desktop-wide in device coords */ int i; int num_events = 0; RawDeviceEvent *raw; 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 */ 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; } client_id = ti->client_id; emulate_pointer = ti->emulate_pointer; if (!IsMaster(dev)) events = UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT, &num_events); valuator_mask_copy(&mask, mask_in); if (need_rawevent) { raw = &events->raw_event; events++; num_events++; init_raw(dev, raw, ms, type, client_id); set_raw_valuators(raw, &mask, raw->valuators.data_raw); } event = &events->device_event; num_events++; init_device_event(event, dev, ms); switch (type) { case XI_TouchBegin: event->type = ET_TouchBegin; /* If we're starting a touch, we must have x & y co-ordinates. */ if (!mask_in || !valuator_mask_isset(mask_in, 0) || !valuator_mask_isset(mask_in, 1)) { 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) { 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 */ TouchEndDDXTouch(dev, ti); break; default: return 0; } /* 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) { for (i = 0; i < max(valuator_mask_size(&mask), 2); i++) { double 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 { screenx = dev->spriteInfo->sprite->hotPhys.x; screeny = dev->spriteInfo->sprite->hotPhys.y; } if (need_rawevent) set_raw_valuators(raw, &mask, raw->valuators.data); /* Indirect device touch coordinates are not used for cursor positioning. * They are merely informational, and are provided in device coordinates. * The device sprite is used for positioning instead, and it is already * scaled. */ if (t->mode == XIDirectTouch) scr = scale_to_desktop(dev, &mask, &devx, &devy, &screenx, &screeny); if (emulate_pointer) scr = positionSprite(dev, Absolute, &mask, &devx, &devy, &screenx, &screeny, NULL, NULL); /* see fill_pointer_events for coordinate systems */ if (emulate_pointer) updateHistory(dev, &mask, ms); clipValuators(dev, &mask); 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 - scr->x, screeny - scr->y); event->touchid = client_id; event->flags = flags; if (emulate_pointer) { event->flags |= TOUCH_POINTER_EMULATED; event->detail.button = 1; } set_valuators(dev, event, &mask); for (i = 0; i < v->numAxes; i++) { if (valuator_mask_isset(&mask, i)) v->axisVal[i] = valuator_mask_get(&mask, i); } 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] - scr->x, dev->last.valuators[1] - scr->y); 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. * * Used in cursor functions, e.g. when cursor confinement changes, and we need * to shift the pointer to get it inside the new bounds. */ void PostSyntheticMotion(DeviceIntPtr pDev, int x, int y, int screen, unsigned long time) { DeviceEvent ev; #ifdef PANORAMIX /* Translate back to the sprite screen since processInputProc will translate from sprite screen to screen 0 upon reentry to the DIX layer. */ if (!noPanoramiXExtension) { x += screenInfo.screens[0]->x - screenInfo.screens[screen]->x; y += screenInfo.screens[0]->y - screenInfo.screens[screen]->y; } #endif memset(&ev, 0, sizeof(DeviceEvent)); init_device_event(&ev, pDev, time); ev.root_x = x; ev.root_y = y; ev.type = ET_Motion; ev.time = time; /* FIXME: MD/SD considerations? */ (*pDev->public.processInputProc) ((InternalEvent *) &ev, pDev); } �����������xorg-server-1.17.1/dix/Xserver.d��������������������������������������������������������������������0000664�0001751�0001751�00000005147�12160102336�013401� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2005-2006, Oracle and/or its affiliates. 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 (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. */ /* * Xserver dtrace provider definition */ #ifdef __APPLE__ #define string char * #define pid_t uint32_t #define zoneid_t uint32_t #else #include <sys/types.h> #endif provider Xserver { /* reqType, data, length, client id, request buffer */ probe request__start(string, uint8_t, uint16_t, int, void *); /* reqType, data, sequence, client id, result */ probe request__done(string, uint8_t, uint32_t, int, int); /* client id, client fd */ probe client__connect(int, int); /* client id, client address, client pid, client zone id */ probe client__auth(int, string, pid_t, zoneid_t); /* client id */ probe client__disconnect(int); /* resource id, resource type, value, resource type name */ probe resource__alloc(uint32_t, uint32_t, void *, string); /* resource id, resource type, value, resource type name */ 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 #pragma D attributes Private/Private/Unknown provider Xserver module #pragma D attributes Private/Private/Unknown provider Xserver function #pragma D attributes Unstable/Unstable/Common provider Xserver name #pragma D attributes Unstable/Unstable/Common provider Xserver args �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/registry.c�������������������������������������������������������������������0000664�0001751�0001751�00000021213�12406661137�013616� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdlib.h> #include <string.h> #include <X11/X.h> #include <X11/Xproto.h> #include "resource.h" #include "registry.h" #define BASE_SIZE 16 #ifdef X_REGISTRY_REQUEST #define CORE "X11" #define FILENAME SERVER_MISC_CONFIG_PATH "/protocol.txt" #define PROT_COMMENT '#' #define PROT_REQUEST 'R' #define PROT_EVENT 'V' #define PROT_ERROR 'E' static FILE *fh; static char ***requests, **events, **errors; static unsigned nmajor, *nminor, nevent, nerror; #endif #ifdef X_REGISTRY_RESOURCE static const char **resources; static unsigned nresource; #endif #if defined(X_REGISTRY_RESOURCE) || defined(X_REGISTRY_REQUEST) /* * File parsing routines */ static int double_size(void *p, unsigned n, unsigned size) { char **ptr = (char **) p; unsigned s, f; if (n) { s = n * size; n *= 2 * size; f = n; } else { s = 0; n = f = BASE_SIZE * size; } *ptr = realloc(*ptr, n); if (!*ptr) { dixResetRegistry(); return FALSE; } memset(*ptr + s, 0, f - s); return TRUE; } #endif #ifdef X_REGISTRY_REQUEST /* * Request/event/error registry functions */ static void RegisterRequestName(unsigned major, unsigned minor, char *name) { while (major >= nmajor) { if (!double_size(&requests, nmajor, sizeof(char **))) return; if (!double_size(&nminor, nmajor, sizeof(unsigned))) return; nmajor = nmajor ? nmajor * 2 : BASE_SIZE; } while (minor >= nminor[major]) { if (!double_size(requests + major, nminor[major], sizeof(char *))) return; nminor[major] = nminor[major] ? nminor[major] * 2 : BASE_SIZE; } free(requests[major][minor]); requests[major][minor] = name; } static void RegisterEventName(unsigned event, char *name) { while (event >= nevent) { if (!double_size(&events, nevent, sizeof(char *))) return; nevent = nevent ? nevent * 2 : BASE_SIZE; } free(events[event]); events[event] = name; } static void RegisterErrorName(unsigned error, char *name) { while (error >= nerror) { if (!double_size(&errors, nerror, sizeof(char *))) return; nerror = nerror ? nerror * 2 : BASE_SIZE; } free(errors[error]); errors[error] = name; } void RegisterExtensionNames(ExtensionEntry * extEntry) { char buf[256], *lineobj, *ptr; unsigned offset; if (fh == NULL) return; rewind(fh); while (fgets(buf, sizeof(buf), fh)) { lineobj = NULL; ptr = strchr(buf, '\n'); if (ptr) *ptr = 0; /* Check for comments or empty lines */ switch (buf[0]) { case PROT_REQUEST: case PROT_EVENT: case PROT_ERROR: break; case PROT_COMMENT: case '\0': continue; default: goto invalid; } /* Check for space character in the fifth position */ ptr = strchr(buf, ' '); if (!ptr || ptr != buf + 4) goto invalid; /* Duplicate the string after the space */ lineobj = strdup(ptr + 1); if (!lineobj) continue; /* Check for a colon somewhere on the line */ ptr = strchr(buf, ':'); if (!ptr) goto invalid; /* Compare the part before colon with the target extension name */ *ptr = 0; if (strcmp(buf + 5, extEntry->name)) goto skip; /* Get the opcode for the request, event, or error */ offset = strtol(buf + 1, &ptr, 10); if (offset == 0 && ptr == buf + 1) goto invalid; /* Save the strdup result in the registry */ switch (buf[0]) { case PROT_REQUEST: if (extEntry->base) RegisterRequestName(extEntry->base, offset, lineobj); else RegisterRequestName(offset, 0, lineobj); continue; case PROT_EVENT: RegisterEventName(extEntry->eventBase + offset, lineobj); continue; case PROT_ERROR: RegisterErrorName(extEntry->errorBase + offset, lineobj); continue; } invalid: LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n"); skip: free(lineobj); } } const char * LookupRequestName(int major, int minor) { if (major >= nmajor) return XREGISTRY_UNKNOWN; if (minor >= nminor[major]) return XREGISTRY_UNKNOWN; return requests[major][minor] ? requests[major][minor] : XREGISTRY_UNKNOWN; } const char * LookupMajorName(int major) { if (major < 128) { const char *retval; if (major >= nmajor) return XREGISTRY_UNKNOWN; if (0 >= nminor[major]) return XREGISTRY_UNKNOWN; retval = requests[major][0]; return retval ? retval + sizeof(CORE) : XREGISTRY_UNKNOWN; } else { ExtensionEntry *extEntry = GetExtensionEntry(major); return extEntry ? extEntry->name : XREGISTRY_UNKNOWN; } } const char * LookupEventName(int event) { event &= 127; if (event >= nevent) return XREGISTRY_UNKNOWN; return events[event] ? events[event] : XREGISTRY_UNKNOWN; } const char * LookupErrorName(int error) { if (error >= nerror) return XREGISTRY_UNKNOWN; return errors[error] ? errors[error] : XREGISTRY_UNKNOWN; } #endif /* X_REGISTRY_REQUEST */ #ifdef X_REGISTRY_RESOURCE /* * Resource registry functions */ void RegisterResourceName(RESTYPE resource, const char *name) { resource &= TypeMask; while (resource >= nresource) { if (!double_size(&resources, nresource, sizeof(char *))) return; nresource = nresource ? nresource * 2 : BASE_SIZE; } resources[resource] = name; } const char * LookupResourceName(RESTYPE resource) { resource &= TypeMask; if (resource >= nresource) return XREGISTRY_UNKNOWN; return resources[resource] ? resources[resource] : XREGISTRY_UNKNOWN; } #endif /* X_REGISTRY_RESOURCE */ void dixFreeRegistry(void) { #ifdef X_REGISTRY_REQUEST /* Free all memory */ while (nmajor--) { while (nminor[nmajor]) free(requests[nmajor][--nminor[nmajor]]); free(requests[nmajor]); } free(requests); free(nminor); while (nevent--) free(events[nevent]); free(events); while (nerror--) free(errors[nerror]); free(errors); requests = NULL; nminor = NULL; events = NULL; errors = NULL; nmajor = nevent = nerror = 0; #endif #ifdef X_REGISTRY_RESOURCE free(resources); resources = NULL; nresource = 0; #endif } void dixCloseRegistry(void) { #ifdef X_REGISTRY_REQUEST if (fh) { fclose(fh); fh = NULL; } #endif } /* * Setup and teardown */ void dixResetRegistry(void) { #ifdef X_REGISTRY_REQUEST ExtensionEntry extEntry = { .name = CORE }; #endif dixFreeRegistry(); #ifdef X_REGISTRY_REQUEST /* Open the protocol file */ fh = fopen(FILENAME, "r"); if (!fh) LogMessage(X_WARNING, "Failed to open protocol names file " FILENAME "\n"); /* Add the core protocol */ RegisterExtensionNames(&extEntry); #endif #ifdef X_REGISTRY_RESOURCE /* Add built-in resources */ RegisterResourceName(RT_NONE, "NONE"); RegisterResourceName(RT_WINDOW, "WINDOW"); RegisterResourceName(RT_PIXMAP, "PIXMAP"); RegisterResourceName(RT_GC, "GC"); RegisterResourceName(RT_FONT, "FONT"); RegisterResourceName(RT_CURSOR, "CURSOR"); RegisterResourceName(RT_COLORMAP, "COLORMAP"); RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY"); RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT"); RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB"); #endif } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/events.c���������������������������������������������������������������������0000664�0001751�0001751�00000574473�12362011423�013263� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ********************************************************/ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ /* * Copyright (c) 2003-2005, Oracle and/or its affiliates. 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 (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. */ /** @file events.c * This file handles event delivery and a big part of the server-side protocol * handling (the parts for input devices). */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include "misc.h" #include "resource.h" #include <X11/Xproto.h> #include "windowstr.h" #include "inputstr.h" #include "inpututils.h" #include "scrnintstr.h" #include "cursorstr.h" #include "dixstruct.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #include "globals.h" #include <X11/extensions/XKBproto.h> #include "xkbsrv.h" #include "xace.h" #ifdef XSERVER_DTRACE #include <sys/types.h> typedef const char *string; #include "Xserver-dtrace.h" #endif #include <X11/extensions/XIproto.h> #include <X11/extensions/XI2proto.h> #include <X11/extensions/XI.h> #include <X11/extensions/XI2.h> #include "exglobals.h" #include "exevents.h" #include "extnsionst.h" #include "dixevents.h" #include "dixgrabs.h" #include "dispatch.h" #include <X11/extensions/ge.h> #include "geext.h" #include "geint.h" #include "eventstr.h" #include "enterleave.h" #include "eventconvert.h" #include "mi.h" /* Extension events type numbering starts at EXTENSION_EVENT_BASE. */ #define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ #define StructureAndSubMask ( StructureNotifyMask | SubstructureNotifyMask ) #define AllButtonsMask ( \ Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) #define MotionMask ( \ PointerMotionMask | Button1MotionMask | \ Button2MotionMask | Button3MotionMask | Button4MotionMask | \ Button5MotionMask | ButtonMotionMask ) #define PropagateMask ( \ KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \ MotionMask ) #define PointerGrabMask ( \ ButtonPressMask | ButtonReleaseMask | \ EnterWindowMask | LeaveWindowMask | \ PointerMotionHintMask | KeymapStateMask | \ MotionMask ) #define AllModifiersMask ( \ ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) #define LastEventMask OwnerGrabButtonMask #define AllEventMasks (LastEventMask|(LastEventMask-1)) /* @return the core event type or 0 if the event is not a core event */ static inline int core_get_type(const xEvent *event) { int type = event->u.u.type; return ((type & EXTENSION_EVENT_BASE) || type == GenericEvent) ? 0 : type; } /* @return the XI2 event type or 0 if the event is not a XI2 event */ static inline int xi2_get_type(const xEvent *event) { const xGenericEvent *e = (const xGenericEvent *) event; return (e->type != GenericEvent || e->extension != IReqCode) ? 0 : e->evtype; } /** * Used to indicate a implicit passive grab created by a ButtonPress event. * See DeliverEventsToWindow(). */ #define ImplicitGrabMask (1 << 7) #define WID(w) ((w) ? ((w)->drawable.id) : 0) #define XE_KBPTR (xE->u.keyButtonPointer) CallbackListPtr EventCallback; CallbackListPtr DeviceEventCallback; #define DNPMCOUNT 8 Mask DontPropagateMasks[DNPMCOUNT]; static int DontPropagateRefCnts[DNPMCOUNT]; static void CheckVirtualMotion(DeviceIntPtr pDev, QdEventPtr qe, WindowPtr pWin); 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); /** * Main input device struct. * inputInfo.pointer * is the core pointer. Referred to as "virtual core pointer", "VCP", * "core pointer" or inputInfo.pointer. The VCP is the first master * pointer device and cannot be deleted. * * inputInfo.keyboard * is the core keyboard ("virtual core keyboard", "VCK", "core keyboard"). * See inputInfo.pointer. * * inputInfo.devices * linked list containing all devices including VCP and VCK. * * inputInfo.off_devices * Devices that have not been initialized and are thus turned off. * * inputInfo.numDevices * Total number of devices. * * inputInfo.all_devices * Virtual device used for XIAllDevices passive grabs. This device is * not part of the inputInfo.devices list and mostly unset except for * the deviceid. It exists because passivegrabs need a valid device * reference. * * inputInfo.all_master_devices * Virtual device used for XIAllMasterDevices passive grabs. This device * is not part of the inputInfo.devices list and mostly unset except for * the deviceid. It exists because passivegrabs need a valid device * reference. */ InputInfo inputInfo; EventSyncInfoRec syncEvents; static struct DeviceEventTime { Bool reset; TimeStamp time; } lastDeviceEventTime[MAXDEVICES]; /** * The root window the given device is currently on. */ #define RootWindow(sprite) sprite->spriteTrace[0] static xEvent *swapEvent = NULL; static int swapEventLen = 0; void NotImplemented(xEvent *from, xEvent *to) { FatalError("Not implemented"); } /** * Convert the given event type from an XI event to a core event. * @param[in] The XI 1.x event type. * @return The matching core event type or 0 if there is none. */ int XItoCoreType(int xitype) { int coretype = 0; if (xitype == DeviceMotionNotify) coretype = MotionNotify; else if (xitype == DeviceButtonPress) coretype = ButtonPress; else if (xitype == DeviceButtonRelease) coretype = ButtonRelease; else if (xitype == DeviceKeyPress) coretype = KeyPress; else if (xitype == DeviceKeyRelease) coretype = KeyRelease; return coretype; } /** * @return true if the device owns a cursor, false if device shares a cursor * sprite with another device. */ Bool DevHasCursor(DeviceIntPtr pDev) { return pDev->spriteInfo->spriteOwner; } /* * @return true if a device is a pointer, check is the same as used by XI to * fill the 'use' field. */ Bool IsPointerDevice(DeviceIntPtr dev) { return (dev->type == MASTER_POINTER) || (dev->valuator && dev->button) || (dev->valuator && !dev->key); } /* * @return true if a device is a keyboard, check is the same as used by XI to * fill the 'use' field. * * Some pointer devices have keys as well (e.g. multimedia keys). Try to not * count them as keyboard devices. */ Bool IsKeyboardDevice(DeviceIntPtr dev) { return (dev->type == MASTER_KEYBOARD) || ((dev->key && dev->kbdfeed) && !IsPointerDevice(dev)); } Bool IsMaster(DeviceIntPtr dev) { return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD; } Bool IsFloating(DeviceIntPtr dev) { return !IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == NULL; } /** * Max event opcode. */ extern int lastEvent; #define CantBeFiltered NoEventMask /** * Event masks for each event type. * * One set of filters for each device, initialized by memcpy of * default_filter in InitEvents. * * Filters are used whether a given event may be delivered to a client, * usually in the form of if (window-event-mask & filter); then deliver event. * * One notable filter is for PointerMotion/DevicePointerMotion events. Each * time a button is pressed, the filter is modified to also contain the * matching ButtonXMotion mask. */ Mask event_filters[MAXDEVICES][MAXEVENTS]; static const Mask default_filter[MAXEVENTS] = { NoSuchEvent, /* 0 */ NoSuchEvent, /* 1 */ KeyPressMask, /* KeyPress */ KeyReleaseMask, /* KeyRelease */ ButtonPressMask, /* ButtonPress */ ButtonReleaseMask, /* ButtonRelease */ PointerMotionMask, /* MotionNotify (initial state) */ EnterWindowMask, /* EnterNotify */ LeaveWindowMask, /* LeaveNotify */ FocusChangeMask, /* FocusIn */ FocusChangeMask, /* FocusOut */ KeymapStateMask, /* KeymapNotify */ ExposureMask, /* Expose */ CantBeFiltered, /* GraphicsExpose */ CantBeFiltered, /* NoExpose */ VisibilityChangeMask, /* VisibilityNotify */ SubstructureNotifyMask, /* CreateNotify */ StructureAndSubMask, /* DestroyNotify */ StructureAndSubMask, /* UnmapNotify */ StructureAndSubMask, /* MapNotify */ SubstructureRedirectMask, /* MapRequest */ StructureAndSubMask, /* ReparentNotify */ StructureAndSubMask, /* ConfigureNotify */ SubstructureRedirectMask, /* ConfigureRequest */ StructureAndSubMask, /* GravityNotify */ ResizeRedirectMask, /* ResizeRequest */ StructureAndSubMask, /* CirculateNotify */ SubstructureRedirectMask, /* CirculateRequest */ PropertyChangeMask, /* PropertyNotify */ CantBeFiltered, /* SelectionClear */ CantBeFiltered, /* SelectionRequest */ CantBeFiltered, /* SelectionNotify */ ColormapChangeMask, /* ColormapNotify */ CantBeFiltered, /* ClientMessage */ CantBeFiltered /* MappingNotify */ }; /** * For the given event, return the matching event filter. This filter may then * be AND'ed with the selected event mask. * * For XI2 events, the returned filter is simply the byte containing the event * mask we're interested in. E.g. for a mask of (1 << 13), this would be * byte[1]. * * @param[in] dev The device the event belongs to, may be NULL. * @param[in] event The event to get the filter for. Only the type of the * event matters, or the extension + evtype for GenericEvents. * @return The filter mask for the given event. * * @see GetEventMask */ Mask GetEventFilter(DeviceIntPtr dev, xEvent *event) { int evtype = 0; if (event->u.u.type != GenericEvent) return event_get_filter_from_type(dev, event->u.u.type); else if ((evtype = xi2_get_type(event))) return event_get_filter_from_xi2type(evtype); ErrorF("[dix] Unknown event type %d. No filter\n", event->u.u.type); return 0; } /** * Return the single byte of the device's XI2 mask that contains the mask * for the event_type. */ int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type) { /* we just return the matching filter because that's the only use * for this mask anyway. */ if (xi2mask_isset(mask, dev, event_type)) return event_get_filter_from_xi2type(event_type); else return 0; } /** * @return TRUE if the mask is set for this event from this device on the * window, or FALSE otherwise. */ Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent *ev) { OtherInputMasks *inputMasks = wOtherInputMasks(win); int evtype; if (!inputMasks || xi2_get_type(ev) == 0) return 0; evtype = ((xGenericEvent *) ev)->evtype; return xi2mask_isset(inputMasks->xi2mask, dev, evtype); } Mask GetEventMask(DeviceIntPtr dev, xEvent *event, InputClients * other) { int evtype; /* XI2 filters are only ever 8 bit, so let's return a 8 bit mask */ if ((evtype = xi2_get_type(event))) { return GetXI2MaskByte(other->xi2mask, dev, evtype); } else if (core_get_type(event) != 0) return other->mask[XIAllDevices]; else return other->mask[dev->id]; } static CARD8 criticalEvents[32] = { 0x7c, 0x30, 0x40 /* key, button, expose, and configure events */ }; static void SyntheticMotion(DeviceIntPtr dev, int x, int y) { int screenno = 0; #ifdef PANORAMIX if (!noPanoramiXExtension) screenno = dev->spriteInfo->sprite->screen->myNum; #endif PostSyntheticMotion(dev, x, y, screenno, (syncEvents.playingEvents) ? syncEvents.time. milliseconds : currentTime.milliseconds); } #ifdef PANORAMIX static void PostNewCursor(DeviceIntPtr pDev); static Bool XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent) { ScreenPtr pScreen; int i; SpritePtr pSprite = pDev->spriteInfo->sprite; /* x,y are in Screen 0 coordinates. We need to decide what Screen to send the message too and what the coordinates relative to that screen are. */ pScreen = pSprite->screen; x += screenInfo.screens[0]->x; y += screenInfo.screens[0]->y; if (!point_on_screen(pScreen, x, y)) { FOR_NSCREENS(i) { if (i == pScreen->myNum) continue; if (point_on_screen(screenInfo.screens[i], x, y)) { pScreen = screenInfo.screens[i]; break; } } } pSprite->screen = pScreen; pSprite->hotPhys.x = x - screenInfo.screens[0]->x; pSprite->hotPhys.y = y - screenInfo.screens[0]->y; x -= pScreen->x; y -= pScreen->y; return (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); } static void XineramaConstrainCursor(DeviceIntPtr pDev) { SpritePtr pSprite = pDev->spriteInfo->sprite; ScreenPtr pScreen; BoxRec newBox; pScreen = pSprite->screen; newBox = pSprite->physLimits; /* Translate the constraining box to the screen the sprite is actually on */ newBox.x1 += screenInfo.screens[0]->x - pScreen->x; newBox.x2 += screenInfo.screens[0]->x - pScreen->x; newBox.y1 += screenInfo.screens[0]->y - pScreen->y; newBox.y2 += screenInfo.screens[0]->y - pScreen->y; (*pScreen->ConstrainCursor) (pDev, pScreen, &newBox); } static Bool XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) { SpritePtr pSprite = pDev->spriteInfo->sprite; if (pWin == screenInfo.screens[0]->root) { int i; FOR_NSCREENS(i) pSprite->windows[i] = screenInfo.screens[i]->root; } else { PanoramiXRes *win; int rc, i; rc = dixLookupResourceByType((void **) &win, pWin->drawable.id, XRT_WINDOW, serverClient, DixReadAccess); if (rc != Success) return FALSE; FOR_NSCREENS(i) { rc = dixLookupWindow(pSprite->windows + i, win->info[i].id, serverClient, DixReadAccess); if (rc != Success) /* window is being unmapped */ return FALSE; } } return TRUE; } static void XineramaConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents) { SpritePtr pSprite = pDev->spriteInfo->sprite; int x, y, off_x, off_y, i; if (!XineramaSetWindowPntrs(pDev, pWin)) return; i = PanoramiXNumScreens - 1; RegionCopy(&pSprite->Reg1, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; off_y = screenInfo.screens[i]->y; while (i--) { x = off_x - screenInfo.screens[i]->x; y = off_y - screenInfo.screens[i]->y; if (x || y) RegionTranslate(&pSprite->Reg1, x, y); RegionUnion(&pSprite->Reg1, &pSprite->Reg1, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; off_y = screenInfo.screens[i]->y; } pSprite->hotLimits = *RegionExtents(&pSprite->Reg1); if (RegionNumRects(&pSprite->Reg1) > 1) pSprite->hotShape = &pSprite->Reg1; else pSprite->hotShape = NullRegion; pSprite->confined = FALSE; pSprite->confineWin = (pWin == screenInfo.screens[0]->root) ? NullWindow : pWin; CheckPhysLimits(pDev, pSprite->current, generateEvents, FALSE, NULL); } #endif /* PANORAMIX */ /** * Modifies the filter for the given protocol event type to the given masks. * * There's only two callers: UpdateDeviceState() and XI's SetMaskForExtEvent(). * The latter initialises masks for the matching XI events, it's a once-off * setting. * UDS however changes the mask for MotionNotify and DeviceMotionNotify each * time a button is pressed to include the matching ButtonXMotion mask in the * filter. * * @param[in] deviceid The device to modify the filter for. * @param[in] mask The new filter mask. * @param[in] event Protocol event type. */ void SetMaskForEvent(int deviceid, Mask mask, int event) { if (deviceid < 0 || deviceid >= MAXDEVICES) FatalError("SetMaskForEvent: bogus device id"); event_filters[deviceid][event] = mask; } void SetCriticalEvent(int event) { if (event >= MAXEVENTS) FatalError("SetCriticalEvent: bogus event number"); criticalEvents[event >> 3] |= 1 << (event & 7); } void ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py) { BoxRec box; int x = *px, y = *py; int incx = 1, incy = 1; if (RegionContainsPoint(shape, x, y, &box)) return; box = *RegionExtents(shape); /* this is rather crude */ do { x += incx; if (x >= box.x2) { incx = -1; x = *px - 1; } else if (x < box.x1) { incx = 1; x = *px; y += incy; if (y >= box.y2) { incy = -1; y = *py - 1; } else if (y < box.y1) return; /* should never get here! */ } } while (!RegionContainsPoint(shape, x, y, &box)); *px = x; *py = y; } static void 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; if (!cursor) return; new = pSprite->hotPhys; #ifdef PANORAMIX if (!noPanoramiXExtension) /* I don't care what the DDX has to say about it */ pSprite->physLimits = pSprite->hotLimits; else #endif { if (pScreen) new.pScreen = pScreen; else pScreen = new.pScreen; (*pScreen->CursorLimits) (pDev, pScreen, cursor, &pSprite->hotLimits, &pSprite->physLimits); pSprite->confined = confineToScreen; (*pScreen->ConstrainCursor) (pDev, pScreen, &pSprite->physLimits); } /* constrain the pointer to those limits */ if (new.x < pSprite->physLimits.x1) new.x = pSprite->physLimits.x1; else if (new.x >= pSprite->physLimits.x2) new.x = pSprite->physLimits.x2 - 1; if (new.y < pSprite->physLimits.y1) new.y = pSprite->physLimits.y1; else if (new.y >= pSprite->physLimits.y2) new.y = pSprite->physLimits.y2 - 1; if (pSprite->hotShape) ConfineToShape(pDev, pSprite->hotShape, &new.x, &new.y); if (( #ifdef PANORAMIX noPanoramiXExtension && #endif (pScreen != pSprite->hotPhys.pScreen)) || (new.x != pSprite->hotPhys.x) || (new.y != pSprite->hotPhys.y)) { #ifdef PANORAMIX if (!noPanoramiXExtension) XineramaSetCursorPosition(pDev, new.x, new.y, generateEvents); else #endif { if (pScreen != pSprite->hotPhys.pScreen) pSprite->hotPhys = new; (*pScreen->SetCursorPosition) (pDev, pScreen, new.x, new.y, generateEvents); } if (!generateEvents) SyntheticMotion(pDev, new.x, new.y); } #ifdef PANORAMIX /* Tell DDX what the limits are */ if (!noPanoramiXExtension) XineramaConstrainCursor(pDev); #endif } static void CheckVirtualMotion(DeviceIntPtr pDev, QdEventPtr qe, WindowPtr pWin) { SpritePtr pSprite = pDev->spriteInfo->sprite; RegionPtr reg = NULL; DeviceEvent *ev = NULL; if (qe) { ev = &qe->event->device_event; switch (ev->type) { case ET_Motion: case ET_ButtonPress: case ET_ButtonRelease: case ET_KeyPress: case ET_KeyRelease: case ET_ProximityIn: case ET_ProximityOut: pSprite->hot.pScreen = qe->pScreen; pSprite->hot.x = ev->root_x; pSprite->hot.y = ev->root_y; pWin = pDev->deviceGrab.grab ? pDev->deviceGrab.grab-> confineTo : NullWindow; break; default: break; } } if (pWin) { BoxRec lims; #ifdef PANORAMIX if (!noPanoramiXExtension) { int x, y, off_x, off_y, i; if (!XineramaSetWindowPntrs(pDev, pWin)) return; i = PanoramiXNumScreens - 1; RegionCopy(&pSprite->Reg2, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; off_y = screenInfo.screens[i]->y; while (i--) { x = off_x - screenInfo.screens[i]->x; y = off_y - screenInfo.screens[i]->y; if (x || y) RegionTranslate(&pSprite->Reg2, x, y); RegionUnion(&pSprite->Reg2, &pSprite->Reg2, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; off_y = screenInfo.screens[i]->y; } } else #endif { if (pSprite->hot.pScreen != pWin->drawable.pScreen) { pSprite->hot.pScreen = pWin->drawable.pScreen; pSprite->hot.x = pSprite->hot.y = 0; } } lims = *RegionExtents(&pWin->borderSize); if (pSprite->hot.x < lims.x1) pSprite->hot.x = lims.x1; else if (pSprite->hot.x >= lims.x2) pSprite->hot.x = lims.x2 - 1; if (pSprite->hot.y < lims.y1) pSprite->hot.y = lims.y1; else if (pSprite->hot.y >= lims.y2) pSprite->hot.y = lims.y2 - 1; #ifdef PANORAMIX if (!noPanoramiXExtension) { if (RegionNumRects(&pSprite->Reg2) > 1) reg = &pSprite->Reg2; } else #endif { if (wBoundingShape(pWin)) reg = &pWin->borderSize; } if (reg) ConfineToShape(pDev, reg, &pSprite->hot.x, &pSprite->hot.y); if (qe && ev) { qe->pScreen = pSprite->hot.pScreen; ev->root_x = pSprite->hot.x; ev->root_y = pSprite->hot.y; } } #ifdef PANORAMIX if (noPanoramiXExtension) /* No typo. Only set the root win if disabled */ #endif RootWindow(pDev->spriteInfo->sprite) = pSprite->hot.pScreen->root; } static void ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bool confineToScreen) { SpritePtr pSprite = pDev->spriteInfo->sprite; if (syncEvents.playingEvents) { CheckVirtualMotion(pDev, (QdEventPtr) NULL, pWin); SyntheticMotion(pDev, pSprite->hot.x, pSprite->hot.y); } else { #ifdef PANORAMIX if (!noPanoramiXExtension) { XineramaConfineCursorToWindow(pDev, pWin, generateEvents); return; } #endif pSprite->hotLimits = *RegionExtents(&pWin->borderSize); pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize : NullRegion; CheckPhysLimits(pDev, pSprite->current, generateEvents, confineToScreen, pWin->drawable.pScreen); } } Bool PointerConfinedToScreen(DeviceIntPtr pDev) { return pDev->spriteInfo->sprite->confined; } /** * Update the sprite cursor to the given cursor. * * ChangeToCursor() will display the new cursor and free the old cursor (if * applicable). If the provided cursor is already the updated cursor, nothing * happens. */ static void ChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor) { SpritePtr pSprite = pDev->spriteInfo->sprite; ScreenPtr pScreen; if (cursor != pSprite->current) { if ((pSprite->current->bits->xhot != cursor->bits->xhot) || (pSprite->current->bits->yhot != cursor->bits->yhot)) CheckPhysLimits(pDev, cursor, FALSE, pSprite->confined, (ScreenPtr) NULL); #ifdef PANORAMIX /* XXX: is this really necessary?? (whot) */ if (!noPanoramiXExtension) pScreen = pSprite->screen; else #endif pScreen = pSprite->hotPhys.pScreen; (*pScreen->DisplayCursor) (pDev, pScreen, cursor); FreeCursor(pSprite->current, (Cursor) 0); pSprite->current = RefCursor(cursor); } } /** * @returns true if b is a descendent of a */ Bool IsParent(WindowPtr a, WindowPtr b) { for (b = b->parent; b; b = b->parent) if (b == a) return TRUE; return FALSE; } /** * Update the cursor displayed on the screen. * * Called whenever a cursor may have changed shape or position. */ static void PostNewCursor(DeviceIntPtr pDev) { WindowPtr win; GrabPtr grab = pDev->deviceGrab.grab; SpritePtr pSprite = pDev->spriteInfo->sprite; CursorPtr pCursor; if (syncEvents.playingEvents) return; if (grab) { if (grab->cursor) { ChangeToCursor(pDev, grab->cursor); return; } if (IsParent(grab->window, pSprite->win)) win = pSprite->win; else win = grab->window; } else win = pSprite->win; for (; win; win = win->parent) { if (win->optional) { pCursor = WindowGetDeviceCursor(win, pDev); if (!pCursor && win->optional->cursor != NullCursor) pCursor = win->optional->cursor; if (pCursor) { ChangeToCursor(pDev, pCursor); return; } } } } /** * @param dev device which you want to know its current root window * @return root window where dev's sprite is located */ WindowPtr GetCurrentRootWindow(DeviceIntPtr dev) { return RootWindow(dev->spriteInfo->sprite); } /** * @return window underneath the cursor sprite. */ WindowPtr GetSpriteWindow(DeviceIntPtr pDev) { return pDev->spriteInfo->sprite->win; } /** * @return current sprite cursor. */ CursorPtr GetSpriteCursor(DeviceIntPtr pDev) { return pDev->spriteInfo->sprite->current; } /** * Set x/y current sprite position in screen coordinates. */ void GetSpritePosition(DeviceIntPtr pDev, int *px, int *py) { SpritePtr pSprite = pDev->spriteInfo->sprite; *px = pSprite->hotPhys.x; *py = pSprite->hotPhys.y; } #ifdef PANORAMIX int XineramaGetCursorScreen(DeviceIntPtr pDev) { if (!noPanoramiXExtension) { return pDev->spriteInfo->sprite->screen->myNum; } else { return 0; } } #endif /* PANORAMIX */ #define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ static void MonthChangedOrBadTime(CARD32 *ms) { /* If the ddx/OS is careless about not processing timestamped events from * different sources in sorted order, then it's possible for time to go * backwards when it should not. Here we ensure a decent time. */ if ((currentTime.milliseconds - *ms) > TIMESLOP) currentTime.months++; else *ms = currentTime.milliseconds; } void NoticeTime(const DeviceIntPtr dev, TimeStamp time) { lastDeviceEventTime[XIAllDevices].time = currentTime; lastDeviceEventTime[dev->id].time = currentTime; LastEventTimeToggleResetFlag(dev->id, TRUE); LastEventTimeToggleResetFlag(XIAllDevices, TRUE); } static void NoticeTimeMillis(const DeviceIntPtr dev, CARD32 *ms) { TimeStamp time; if (*ms < currentTime.milliseconds) MonthChangedOrBadTime(ms); time.months = currentTime.months; time.milliseconds = *ms; NoticeTime(dev, time); } void NoticeEventTime(InternalEvent *ev, DeviceIntPtr dev) { if (!syncEvents.playingEvents) NoticeTimeMillis(dev, &ev->any.time); } TimeStamp LastEventTime(int deviceid) { return lastDeviceEventTime[deviceid].time; } Bool LastEventTimeWasReset(int deviceid) { return lastDeviceEventTime[deviceid].reset; } void LastEventTimeToggleResetFlag(int deviceid, Bool state) { lastDeviceEventTime[deviceid].reset = state; } void LastEventTimeToggleResetAll(Bool state) { DeviceIntPtr dev; nt_list_for_each_entry(dev, inputInfo.devices, next) { LastEventTimeToggleResetFlag(dev->id, FALSE); } LastEventTimeToggleResetFlag(XIAllDevices, FALSE); LastEventTimeToggleResetFlag(XIAllMasterDevices, FALSE); } /************************************************************************** * The following procedures deal with synchronous events * **************************************************************************/ /** * EnqueueEvent is a device's processInputProc if a device is frozen. * Instead of delivering the events to the client, the event is tacked onto a * linked list for later delivery. */ void EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) { QdEventPtr tail = NULL; QdEventPtr qe; SpritePtr pSprite = device->spriteInfo->sprite; int eventlen; DeviceEvent *event = &ev->device_event; if (!xorg_list_is_empty(&syncEvents.pending)) tail = xorg_list_last_entry(&syncEvents.pending, QdEventRec, next); NoticeTimeMillis(device, &ev->any.time); /* Fix for key repeating bug. */ if (device->key != NULL && device->key->xkbInfo != NULL && event->type == ET_KeyRelease) AccessXCancelRepeatKey(device->key->xkbInfo, event->detail.key); if (DeviceEventCallback) { DeviceEventInfoRec eventinfo; /* The RECORD spec says that the root window field of motion events * must be valid. At this point, it hasn't been filled in yet, so * we do it here. The long expression below is necessary to get * the current root window; the apparently reasonable alternative * GetCurrentRootWindow()->drawable.id doesn't give you the right * answer on the first motion event after a screen change because * the data that GetCurrentRootWindow relies on hasn't been * updated yet. */ if (ev->any.type == ET_Motion) ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id; eventinfo.event = ev; eventinfo.device = device; CallCallbacks(&DeviceEventCallback, (void *) &eventinfo); } if (event->type == ET_Motion) { #ifdef PANORAMIX if (!noPanoramiXExtension) { event->root_x += pSprite->screen->x - screenInfo.screens[0]->x; event->root_y += pSprite->screen->y - screenInfo.screens[0]->y; } #endif pSprite->hotPhys.x = event->root_x; pSprite->hotPhys.y = event->root_y; /* do motion compression, but not if from different devices */ if (tail && (tail->event->any.type == ET_Motion) && (tail->device == device) && (tail->pScreen == pSprite->hotPhys.pScreen)) { DeviceEvent *tailev = &tail->event->device_event; tailev->root_x = pSprite->hotPhys.x; tailev->root_y = pSprite->hotPhys.y; tailev->time = event->time; tail->months = currentTime.months; return; } } eventlen = event->length; qe = malloc(sizeof(QdEventRec) + eventlen); if (!qe) return; xorg_list_init(&qe->next); qe->device = device; qe->pScreen = pSprite->hotPhys.pScreen; qe->months = currentTime.months; qe->event = (InternalEvent *) (qe + 1); memcpy(qe->event, event, eventlen); xorg_list_append(&qe->next, &syncEvents.pending); } /** * Run through the list of events queued up in syncEvents. * For each event do: * If the device for this event is not frozen anymore, take it and process it * as usually. * After that, check if there's any devices in the list that are not frozen. * If there is none, we're done. If there is at least one device that is not * frozen, then re-run from the beginning of the event queue. */ void PlayReleasedEvents(void) { QdEventPtr tmp; QdEventPtr qe; DeviceIntPtr dev; DeviceIntPtr pDev; restart: xorg_list_for_each_entry_safe(qe, tmp, &syncEvents.pending, next) { if (!qe->device->deviceGrab.sync.frozen) { xorg_list_del(&qe->next); pDev = qe->device; if (qe->event->any.type == ET_Motion) CheckVirtualMotion(pDev, qe, NullWindow); syncEvents.time.months = qe->months; syncEvents.time.milliseconds = qe->event->any.time; #ifdef PANORAMIX /* Translate back to the sprite screen since processInputProc will translate from sprite screen to screen 0 upon reentry to the DIX layer */ if (!noPanoramiXExtension) { DeviceEvent *ev = &qe->event->device_event; switch (ev->type) { case ET_Motion: case ET_ButtonPress: case ET_ButtonRelease: case ET_KeyPress: case ET_KeyRelease: case ET_ProximityIn: case ET_ProximityOut: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: ev->root_x += screenInfo.screens[0]->x - pDev->spriteInfo->sprite->screen->x; ev->root_y += screenInfo.screens[0]->y - pDev->spriteInfo->sprite->screen->y; break; default: break; } } #endif (*qe->device->public.processInputProc) (qe->event, qe->device); free(qe); for (dev = inputInfo.devices; dev && dev->deviceGrab.sync.frozen; dev = dev->next); if (!dev) break; /* Playing the event may have unfrozen another device. */ /* So to play it safe, restart at the head of the queue */ goto restart; } } } /** * Freeze or thaw the given devices. The device's processing proc is * switched to either the real processing proc (in case of thawing) or an * enqueuing processing proc (usually EnqueueEvent()). * * @param dev The device to freeze/thaw * @param frozen True to freeze or false to thaw. */ static void FreezeThaw(DeviceIntPtr dev, Bool frozen) { dev->deviceGrab.sync.frozen = frozen; if (frozen) dev->public.processInputProc = dev->public.enqueueInputProc; else dev->public.processInputProc = dev->public.realInputProc; } /** * Unfreeze devices and replay all events to the respective clients. * * ComputeFreezes takes the first event in the device's frozen event queue. It * runs up the sprite tree (spriteTrace) and searches for the window to replay * the events from. If it is found, it checks for passive grabs one down from * the window or delivers the events. */ static void ComputeFreezes(void) { DeviceIntPtr replayDev = syncEvents.replayDev; WindowPtr w; GrabPtr grab; DeviceIntPtr dev; for (dev = inputInfo.devices; dev; dev = dev->next) FreezeThaw(dev, dev->deviceGrab.sync.other || (dev->deviceGrab.sync.state >= FROZEN)); if (syncEvents.playingEvents || (!replayDev && xorg_list_is_empty(&syncEvents.pending))) return; syncEvents.playingEvents = TRUE; if (replayDev) { DeviceEvent *event = replayDev->deviceGrab.sync.event; syncEvents.replayDev = (DeviceIntPtr) NULL; w = XYToWindow(replayDev->spriteInfo->sprite, event->root_x, event->root_y); if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin)) { if (IsTouchEvent((InternalEvent *) event)) { TouchPointInfoPtr ti = TouchFindByClientID(replayDev, event->touchid); BUG_WARN(!ti); TouchListenerAcceptReject(replayDev, ti, 0, XIRejectTouch); } else if (replayDev->focus && !IsPointerEvent((InternalEvent *) event)) DeliverFocusedEvent(replayDev, (InternalEvent *) event, w); else DeliverDeviceEvents(w, (InternalEvent *) event, NullGrab, NullWindow, replayDev); } } for (dev = inputInfo.devices; dev; dev = dev->next) { if (!dev->deviceGrab.sync.frozen) { PlayReleasedEvents(); break; } } syncEvents.playingEvents = FALSE; for (dev = inputInfo.devices; dev; dev = dev->next) { if (DevHasCursor(dev)) { /* the following may have been skipped during replay, so do it now */ if ((grab = dev->deviceGrab.grab) && grab->confineTo) { if (grab->confineTo->drawable.pScreen != dev->spriteInfo->sprite->hotPhys.pScreen) dev->spriteInfo->sprite->hotPhys.x = dev->spriteInfo->sprite->hotPhys.y = 0; ConfineCursorToWindow(dev, grab->confineTo, TRUE, TRUE); } else ConfineCursorToWindow(dev, dev->spriteInfo->sprite->hotPhys.pScreen-> root, TRUE, FALSE); PostNewCursor(dev); } } } #ifdef RANDR void ScreenRestructured(ScreenPtr pScreen) { GrabPtr grab; DeviceIntPtr pDev; for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (!IsFloating(pDev) && !DevHasCursor(pDev)) continue; /* GrabDevice doesn't have a confineTo field, so we don't need to * worry about it. */ if ((grab = pDev->deviceGrab.grab) && grab->confineTo) { if (grab->confineTo->drawable.pScreen != pDev->spriteInfo->sprite->hotPhys.pScreen) pDev->spriteInfo->sprite->hotPhys.x = pDev->spriteInfo->sprite->hotPhys.y = 0; ConfineCursorToWindow(pDev, grab->confineTo, TRUE, TRUE); } else ConfineCursorToWindow(pDev, pDev->spriteInfo->sprite->hotPhys.pScreen-> root, TRUE, FALSE); } } #endif static void CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) { GrabPtr grab = thisDev->deviceGrab.grab; DeviceIntPtr dev; if (thisMode == GrabModeSync) thisDev->deviceGrab.sync.state = FROZEN_NO_EVENT; else { /* free both if same client owns both */ thisDev->deviceGrab.sync.state = THAWED; if (thisDev->deviceGrab.sync.other && (CLIENT_BITS(thisDev->deviceGrab.sync.other->resource) == CLIENT_BITS(grab->resource))) thisDev->deviceGrab.sync.other = NullGrab; } if (IsMaster(thisDev)) { dev = GetPairedDevice(thisDev); if (otherMode == GrabModeSync) dev->deviceGrab.sync.other = grab; else { /* free both if same client owns both */ if (dev->deviceGrab.sync.other && (CLIENT_BITS(dev->deviceGrab.sync.other->resource) == CLIENT_BITS(grab->resource))) dev->deviceGrab.sync.other = NullGrab; } } ComputeFreezes(); } /** * Save the device's master device id. This needs to be done * if a client directly grabs a slave device that is attached to a master. For * the duration of the grab, the device is detached, ungrabbing re-attaches it * though. * * We store the ID of the master device only in case the master disappears * while the device has a grab. */ static void DetachFromMaster(DeviceIntPtr dev) { if (IsFloating(dev)) return; dev->saved_master_id = GetMaster(dev, MASTER_ATTACHED)->id; AttachDevice(NULL, dev, NULL); } static void ReattachToOldMaster(DeviceIntPtr dev) { DeviceIntPtr master = NULL; if (IsMaster(dev)) return; dixLookupDevice(&master, dev->saved_master_id, serverClient, DixUseAccess); if (master) { AttachDevice(serverClient, dev, master); dev->saved_master_id = 0; } } /** * Update touch records when an explicit grab is activated. Any touches owned by * the grabbing client are updated so the listener state reflects the new grab. */ static void UpdateTouchesForGrab(DeviceIntPtr mouse) { int i; if (!mouse->touch || mouse->deviceGrab.fromPassiveGrab) return; for (i = 0; i < mouse->touch->num_touches; i++) { TouchPointInfoPtr ti = mouse->touch->touches + i; TouchListener *listener = &ti->listeners[0]; GrabPtr grab = mouse->deviceGrab.grab; if (ti->active && CLIENT_BITS(listener->listener) == grab->resource) { listener->listener = grab->resource; listener->level = grab->grabtype; listener->state = LISTENER_IS_OWNER; listener->window = grab->window; if (grab->grabtype == CORE || grab->grabtype == XI || !xi2mask_isset(grab->xi2mask, mouse, XI_TouchBegin)) listener->type = LISTENER_POINTER_GRAB; else listener->type = LISTENER_GRAB; if (listener->grab) FreeGrab(listener->grab); listener->grab = AllocGrab(grab); } } } /** * Activate a pointer grab on the given device. A pointer grab will cause all * core pointer events of this device to be delivered to the grabbing client only. * No other device will send core events to the grab client while the grab is * on, but core events will be sent to other clients. * Can cause the cursor to change if a grab cursor is set. * * Note that parameter autoGrab may be (True & ImplicitGrabMask) if the grab * is an implicit grab caused by a ButtonPress event. * * @param mouse The device to grab. * @param grab The grab structure, needs to be setup. * @param autoGrab True if the grab was caused by a button down event and not * explicitely by a client. */ void ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, TimeStamp time, Bool autoGrab) { GrabInfoPtr grabinfo = &mouse->deviceGrab; GrabPtr oldgrab = grabinfo->grab; WindowPtr oldWin = (grabinfo->grab) ? grabinfo->grab->window : mouse->spriteInfo->sprite->win; Bool isPassive = autoGrab & ~ImplicitGrabMask; /* slave devices need to float for the duration of the grab. */ if (grab->grabtype == XI2 && !(autoGrab & ImplicitGrabMask) && !IsMaster(mouse)) DetachFromMaster(mouse); if (grab->confineTo) { if (grab->confineTo->drawable.pScreen != mouse->spriteInfo->sprite->hotPhys.pScreen) mouse->spriteInfo->sprite->hotPhys.x = mouse->spriteInfo->sprite->hotPhys.y = 0; ConfineCursorToWindow(mouse, grab->confineTo, FALSE, TRUE); } DoEnterLeaveEvents(mouse, mouse->id, oldWin, grab->window, NotifyGrab); mouse->valuator->motionHintWindow = NullWindow; if (syncEvents.playingEvents) grabinfo->grabTime = syncEvents.time; else grabinfo->grabTime = time; grabinfo->grab = AllocGrab(grab); grabinfo->fromPassiveGrab = isPassive; grabinfo->implicitGrab = autoGrab & ImplicitGrabMask; PostNewCursor(mouse); UpdateTouchesForGrab(mouse); CheckGrabForSyncs(mouse, (Bool) grab->pointerMode, (Bool) grab->keyboardMode); if (oldgrab) FreeGrab(oldgrab); } /** * Delete grab on given device, update the sprite. * * Extension devices are set up for ActivateKeyboardGrab(). */ void 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)) { int mode = XIRejectTouch; /* 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)) { mode = XIAcceptTouch; /* NOTE: we set the state here, but * ProcessTouchOwnershipEvent() will still call * TouchEmitTouchEnd for this listener. The other half of * this hack is in DeliverTouchEndEvent */ ti->listeners[0].state = LISTENER_HAS_END; } TouchListenerAcceptReject(mouse, ti, 0, mode); } } TouchRemovePointerGrab(mouse); mouse->valuator->motionHintWindow = NullWindow; mouse->deviceGrab.grab = NullGrab; mouse->deviceGrab.sync.state = NOT_GRABBED; mouse->deviceGrab.fromPassiveGrab = FALSE; for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev->deviceGrab.sync.other == grab) dev->deviceGrab.sync.other = NullGrab; } DoEnterLeaveEvents(mouse, mouse->id, grab->window, mouse->spriteInfo->sprite->win, NotifyUngrab); if (grab->confineTo) ConfineCursorToWindow(mouse, GetCurrentRootWindow(mouse), FALSE, FALSE); PostNewCursor(mouse); if (!wasImplicit && grab->grabtype == XI2) ReattachToOldMaster(mouse); ComputeFreezes(); FreeGrab(grab); } /** * Activate a keyboard grab on the given device. * * Extension devices have ActivateKeyboardGrab() set as their grabbing proc. */ void ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive) { GrabInfoPtr grabinfo = &keybd->deviceGrab; GrabPtr oldgrab = grabinfo->grab; WindowPtr oldWin; /* slave devices need to float for the duration of the grab. */ if (grab->grabtype == XI2 && keybd->enabled && !(passive & ImplicitGrabMask) && !IsMaster(keybd)) DetachFromMaster(keybd); if (!keybd->enabled) oldWin = NULL; else if (grabinfo->grab) oldWin = grabinfo->grab->window; else if (keybd->focus) oldWin = keybd->focus->win; else oldWin = keybd->spriteInfo->sprite->win; if (oldWin == FollowKeyboardWin) oldWin = keybd->focus->win; if (keybd->valuator) keybd->valuator->motionHintWindow = NullWindow; if (oldWin) DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab); if (syncEvents.playingEvents) grabinfo->grabTime = syncEvents.time; else grabinfo->grabTime = time; grabinfo->grab = AllocGrab(grab); grabinfo->fromPassiveGrab = passive; grabinfo->implicitGrab = passive & ImplicitGrabMask; CheckGrabForSyncs(keybd, (Bool) grab->keyboardMode, (Bool) grab->pointerMode); if (oldgrab) FreeGrab(oldgrab); } /** * Delete keyboard grab for the given device. */ void DeactivateKeyboardGrab(DeviceIntPtr keybd) { GrabPtr grab = keybd->deviceGrab.grab; DeviceIntPtr dev; WindowPtr focusWin; Bool wasImplicit = (keybd->deviceGrab.fromPassiveGrab && keybd->deviceGrab.implicitGrab); if (keybd->valuator) keybd->valuator->motionHintWindow = NullWindow; keybd->deviceGrab.grab = NullGrab; keybd->deviceGrab.sync.state = NOT_GRABBED; keybd->deviceGrab.fromPassiveGrab = FALSE; for (dev = inputInfo.devices; dev; dev = dev->next) { 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) ReattachToOldMaster(keybd); ComputeFreezes(); FreeGrab(grab); } void AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState) { Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced; TimeStamp grabTime; DeviceIntPtr dev; GrabInfoPtr devgrabinfo, grabinfo = &thisDev->deviceGrab; thisGrabbed = grabinfo->grab && SameClient(grabinfo->grab, client); thisSynced = FALSE; otherGrabbed = FALSE; othersFrozen = FALSE; grabTime = grabinfo->grabTime; for (dev = inputInfo.devices; dev; dev = dev->next) { devgrabinfo = &dev->deviceGrab; if (dev == thisDev) continue; if (devgrabinfo->grab && SameClient(devgrabinfo->grab, client)) { if (!(thisGrabbed || otherGrabbed) || (CompareTimeStamps(devgrabinfo->grabTime, grabTime) == LATER)) grabTime = devgrabinfo->grabTime; otherGrabbed = TRUE; if (grabinfo->sync.other == devgrabinfo->grab) thisSynced = TRUE; if (devgrabinfo->sync.state >= FROZEN) othersFrozen = TRUE; } } if (!((thisGrabbed && grabinfo->sync.state >= FROZEN) || thisSynced)) return; if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, grabTime) == EARLIER)) return; switch (newState) { case THAWED: /* Async */ if (thisGrabbed) grabinfo->sync.state = THAWED; if (thisSynced) grabinfo->sync.other = NullGrab; ComputeFreezes(); break; case FREEZE_NEXT_EVENT: /* Sync */ if (thisGrabbed) { grabinfo->sync.state = FREEZE_NEXT_EVENT; if (thisSynced) grabinfo->sync.other = NullGrab; ComputeFreezes(); } break; case THAWED_BOTH: /* AsyncBoth */ if (othersFrozen) { for (dev = inputInfo.devices; dev; dev = dev->next) { devgrabinfo = &dev->deviceGrab; if (devgrabinfo->grab && SameClient(devgrabinfo->grab, client)) devgrabinfo->sync.state = THAWED; if (devgrabinfo->sync.other && SameClient(devgrabinfo->sync.other, client)) devgrabinfo->sync.other = NullGrab; } ComputeFreezes(); } break; case FREEZE_BOTH_NEXT_EVENT: /* SyncBoth */ if (othersFrozen) { for (dev = inputInfo.devices; dev; dev = dev->next) { devgrabinfo = &dev->deviceGrab; if (devgrabinfo->grab && SameClient(devgrabinfo->grab, client)) devgrabinfo->sync.state = FREEZE_BOTH_NEXT_EVENT; if (devgrabinfo->sync.other && SameClient(devgrabinfo->sync.other, client)) devgrabinfo->sync.other = NullGrab; } ComputeFreezes(); } break; case NOT_GRABBED: /* Replay */ if (thisGrabbed && grabinfo->sync.state == FROZEN_WITH_EVENT) { if (thisSynced) grabinfo->sync.other = NullGrab; syncEvents.replayDev = thisDev; syncEvents.replayWin = grabinfo->grab->window; (*grabinfo->DeactivateGrab) (thisDev); syncEvents.replayDev = (DeviceIntPtr) NULL; } break; case THAW_OTHERS: /* AsyncOthers */ if (othersFrozen) { for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev == thisDev) continue; devgrabinfo = &dev->deviceGrab; if (devgrabinfo->grab && SameClient(devgrabinfo->grab, client)) devgrabinfo->sync.state = THAWED; if (devgrabinfo->sync.other && SameClient(devgrabinfo->sync.other, client)) devgrabinfo->sync.other = NullGrab; } ComputeFreezes(); } break; } /* We've unfrozen the grab. If the grab was a touch grab, we're now the * owner and expected to accept/reject it. Reject == ReplayPointer which * we've handled in ComputeFreezes() (during DeactivateGrab) above, * anything else is accept. */ if (newState != NOT_GRABBED /* Replay */ && IsTouchEvent((InternalEvent*)grabinfo->sync.event)) { TouchAcceptAndEnd(thisDev, grabinfo->sync.event->touchid); } } /** * Server-side protocol handling for AllowEvents request. * * Release some events from a frozen device. */ int ProcAllowEvents(ClientPtr client) { TimeStamp time; DeviceIntPtr mouse = NULL; DeviceIntPtr keybd = NULL; REQUEST(xAllowEventsReq); REQUEST_SIZE_MATCH(xAllowEventsReq); time = ClientTimeToServerTime(stuff->time); mouse = PickPointer(client); keybd = PickKeyboard(client); switch (stuff->mode) { case ReplayPointer: AllowSome(client, time, mouse, NOT_GRABBED); break; case SyncPointer: AllowSome(client, time, mouse, FREEZE_NEXT_EVENT); break; case AsyncPointer: AllowSome(client, time, mouse, THAWED); break; case ReplayKeyboard: AllowSome(client, time, keybd, NOT_GRABBED); break; case SyncKeyboard: AllowSome(client, time, keybd, FREEZE_NEXT_EVENT); break; case AsyncKeyboard: AllowSome(client, time, keybd, THAWED); break; case SyncBoth: AllowSome(client, time, keybd, FREEZE_BOTH_NEXT_EVENT); break; case AsyncBoth: AllowSome(client, time, keybd, THAWED_BOTH); break; default: client->errorValue = stuff->mode; return BadValue; } return Success; } /** * Deactivate grabs from any device that has been grabbed by the client. */ void ReleaseActiveGrabs(ClientPtr client) { DeviceIntPtr dev; Bool done; /* XXX CloseDownClient should remove passive grabs before * releasing active grabs. */ do { done = TRUE; for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev->deviceGrab.grab && SameClient(dev->deviceGrab.grab, client)) { (*dev->deviceGrab.DeactivateGrab) (dev); done = FALSE; } } } while (!done); } /************************************************************************** * The following procedures deal with delivering events * **************************************************************************/ /** * Deliver the given events to the given client. * * More than one event may be delivered at a time. This is the case with * DeviceMotionNotifies which may be followed by DeviceValuator events. * * TryClientEvents() is the last station before actually writing the events to * the socket. Anything that is not filtered here, will get delivered to the * client. * An event is only delivered if * - mask and filter match up. * - no other client has a grab on the device that caused the event. * * * @param client The target client to deliver to. * @param dev The device the event came from. May be NULL. * @param pEvents The events to be delivered. * @param count Number of elements in pEvents. * @param mask Event mask as set by the window. * @param filter Mask based on event type. * @param grab Possible grab on the device that caused the event. * * @return 1 if event was delivered, 0 if not or -1 if grab was not set by the * client. */ int TryClientEvents(ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, int count, Mask mask, Mask filter, GrabPtr grab) { int type; #ifdef DEBUG_EVENTS ErrorF("[dix] Event([%d, %d], mask=0x%lx), client=%d%s", pEvents->u.u.type, pEvents->u.u.detail, mask, client ? client->index : -1, (client && client->clientGone) ? " (gone)" : ""); #endif if (!client || client == serverClient || client->clientGone) { #ifdef DEBUG_EVENTS ErrorF(" not delivered to fake/dead client\n"); #endif return 0; } if (filter != CantBeFiltered && !(mask & filter)) { #ifdef DEBUG_EVENTS ErrorF(" filtered\n"); #endif return 0; } if (grab && !SameClient(grab, client)) { #ifdef DEBUG_EVENTS ErrorF(" not delivered due to grab\n"); #endif return -1; /* don't send, but notify caller */ } type = pEvents->u.u.type; if (type == MotionNotify) { if (mask & PointerMotionHintMask) { if (WID(dev->valuator->motionHintWindow) == pEvents->u.keyButtonPointer.event) { #ifdef DEBUG_EVENTS ErrorF("[dix] \n"); ErrorF("[dix] motionHintWindow == keyButtonPointer.event\n"); #endif return 1; /* don't send, but pretend we did */ } pEvents->u.u.detail = NotifyHint; } else { pEvents->u.u.detail = NotifyNormal; } } else if (type == DeviceMotionNotify) { if (MaybeSendDeviceMotionNotifyHint((deviceKeyButtonPointer *) pEvents, mask) != 0) return 1; } else if (type == KeyPress) { if (EventIsKeyRepeat(pEvents)) { if (!_XkbWantsDetectableAutoRepeat(client)) { xEvent release = *pEvents; release.u.u.type = KeyRelease; WriteEventsToClient(client, 1, &release); #ifdef DEBUG_EVENTS ErrorF(" (plus fake core release for repeat)"); #endif } else { #ifdef DEBUG_EVENTS ErrorF(" (detectable autorepeat for core)"); #endif } } } else if (type == DeviceKeyPress) { if (EventIsKeyRepeat(pEvents)) { if (!_XkbWantsDetectableAutoRepeat(client)) { deviceKeyButtonPointer release = *(deviceKeyButtonPointer *) pEvents; release.type = DeviceKeyRelease; #ifdef DEBUG_EVENTS ErrorF(" (plus fake xi1 release for repeat)"); #endif WriteEventsToClient(client, 1, (xEvent *) &release); } else { #ifdef DEBUG_EVENTS ErrorF(" (detectable autorepeat for core)"); #endif } } } if (BitIsOn(criticalEvents, type)) { if (client->smart_priority < SMART_MAX_PRIORITY) client->smart_priority++; SetCriticalOutputPending(); } WriteEventsToClient(client, count, pEvents); #ifdef DEBUG_EVENTS ErrorF("[dix] delivered\n"); #endif return 1; } static BOOL ActivateImplicitGrab(DeviceIntPtr dev, ClientPtr client, WindowPtr win, xEvent *event, Mask deliveryMask) { GrabPtr tempGrab; OtherInputMasks *inputMasks; CARD8 type = event->u.u.type; enum InputLevel grabtype; if (type == ButtonPress) grabtype = CORE; else if (type == DeviceButtonPress) grabtype = XI; else if ((type = xi2_get_type(event)) == XI_ButtonPress) grabtype = XI2; else return FALSE; tempGrab = AllocGrab(NULL); if (!tempGrab) return FALSE; tempGrab->next = NULL; tempGrab->device = dev; tempGrab->resource = client->clientAsMask; tempGrab->window = win; tempGrab->ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE; tempGrab->eventMask = deliveryMask; tempGrab->keyboardMode = GrabModeAsync; tempGrab->pointerMode = GrabModeAsync; tempGrab->confineTo = NullWindow; tempGrab->cursor = NullCursor; tempGrab->type = type; tempGrab->grabtype = grabtype; /* get the XI and XI2 device mask */ inputMasks = wOtherInputMasks(win); tempGrab->deviceMask = (inputMasks) ? inputMasks->inputEvents[dev->id] : 0; if (inputMasks) xi2mask_merge(tempGrab->xi2mask, inputMasks->xi2mask); (*dev->deviceGrab.ActivateGrab) (dev, tempGrab, currentTime, TRUE | ImplicitGrabMask); FreeGrab(tempGrab); return TRUE; } /** * Attempt event delivery to the client owning the window. */ static enum EventDeliveryState DeliverToWindowOwner(DeviceIntPtr dev, WindowPtr win, xEvent *events, int count, Mask filter, GrabPtr grab) { /* if nobody ever wants to see this event, skip some work */ if (filter != CantBeFiltered && !((wOtherEventMasks(win) | win->eventMask) & filter)) return EVENT_SKIP; if (IsInterferingGrab(wClient(win), dev, events)) return EVENT_SKIP; if (!XaceHook(XACE_RECEIVE_ACCESS, wClient(win), win, events, count)) { int attempt = TryClientEvents(wClient(win), dev, events, count, win->eventMask, filter, grab); if (attempt > 0) return EVENT_DELIVERED; if (attempt < 0) return EVENT_REJECTED; } return EVENT_NOT_DELIVERED; } /** * Get the list of clients that should be tried for event delivery on the * given window. * * @return 1 if the client list should be traversed, zero if the event * should be skipped. */ static Bool GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win, xEvent *events, Mask filter, InputClients ** iclients) { int rc = 0; if (core_get_type(events) != 0) *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; *iclients = inputMasks->inputClients; } else { OtherInputMasks *inputMasks = wOtherInputMasks(win); /* Has any client selected for the event? */ if (!inputMasks || !(inputMasks->inputEvents[dev->id] & filter)) goto out; *iclients = inputMasks->inputClients; } rc = 1; out: return rc; } /** * Try delivery on each client in inputclients, provided the event mask * accepts it and there is no interfering core grab.. */ static enum EventDeliveryState DeliverEventToInputClients(DeviceIntPtr dev, InputClients * inputclients, WindowPtr win, xEvent *events, int count, Mask filter, GrabPtr grab, ClientPtr *client_return, Mask *mask_return) { int attempt; enum EventDeliveryState rc = EVENT_NOT_DELIVERED; Bool have_device_button_grab_class_client = FALSE; for (; inputclients; inputclients = inputclients->next) { Mask mask; ClientPtr client = rClient(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)) /* do nothing */ ; else if ((attempt = TryClientEvents(client, dev, events, count, mask, filter, grab))) { if (attempt > 0) { /* * The order of clients is arbitrary therefore if one * client belongs to DeviceButtonGrabClass make sure to * catch it. */ if (!have_device_button_grab_class_client) { rc = EVENT_DELIVERED; *client_return = client; *mask_return = mask; /* Success overrides non-success, so if we've been * successful on one client, return that */ if (mask & DeviceButtonGrabMask) have_device_button_grab_class_client = TRUE; } } else if (rc == EVENT_NOT_DELIVERED) rc = EVENT_REJECTED; } } return rc; } /** * Deliver events to clients registered on the window. * * @param client_return On successful delivery, set to the recipient. * @param mask_return On successful delivery, set to the recipient's event * mask for this event. */ static enum EventDeliveryState DeliverEventToWindowMask(DeviceIntPtr dev, WindowPtr win, xEvent *events, int count, Mask filter, GrabPtr grab, ClientPtr *client_return, Mask *mask_return) { InputClients *iclients; if (!GetClientsForDelivery(dev, win, events, filter, &iclients)) return EVENT_SKIP; return DeliverEventToInputClients(dev, iclients, win, events, count, filter, grab, client_return, mask_return); } /** * Deliver events to a window. At this point, we do not yet know if the event * actually needs to be delivered. May activate a grab if the event is a * button press. * * Core events are always delivered to the window owner. If the filter is * something other than CantBeFiltered, the event is also delivered to other * clients with the matching mask on the window. * * More than one event may be delivered at a time. This is the case with * DeviceMotionNotifies which may be followed by DeviceValuator events. * * @param pWin The window that would get the event. * @param pEvents The events to be delivered. * @param count Number of elements in pEvents. * @param filter Mask based on event type. * @param grab Possible grab on the device that caused the event. * * @return a positive number if at least one successful delivery has been * made, 0 if no events were delivered, or a negative number if the event * has not been delivered _and_ rejected by at least one client. */ int DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent *pEvents, int count, Mask filter, GrabPtr grab) { int deliveries = 0, nondeliveries = 0; ClientPtr client = NullClient; Mask deliveryMask = 0; /* If a grab occurs due to a button press, then this mask is the mask of the grab. */ int type = pEvents->u.u.type; /* Deliver to window owner */ if ((filter == CantBeFiltered) || core_get_type(pEvents) != 0) { enum EventDeliveryState rc; rc = DeliverToWindowOwner(pDev, pWin, pEvents, count, filter, grab); switch (rc) { case EVENT_SKIP: return 0; case EVENT_REJECTED: nondeliveries--; break; case EVENT_DELIVERED: /* We delivered to the owner, with our event mask */ deliveries++; client = wClient(pWin); deliveryMask = pWin->eventMask; break; case EVENT_NOT_DELIVERED: break; } } /* CantBeFiltered means only window owner gets the event */ if (filter != CantBeFiltered) { enum EventDeliveryState rc; rc = DeliverEventToWindowMask(pDev, pWin, pEvents, count, filter, grab, &client, &deliveryMask); switch (rc) { case EVENT_SKIP: return 0; case EVENT_REJECTED: nondeliveries--; break; case EVENT_DELIVERED: deliveries++; break; case EVENT_NOT_DELIVERED: break; } } if (deliveries) { /* * Note that since core events are delivered first, an implicit grab may * be activated on a core grab, stopping the XI events. */ if (!grab && ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask)) /* grab activated */ ; else if (type == MotionNotify) pDev->valuator->motionHintWindow = pWin; else if (type == DeviceMotionNotify || type == DeviceButtonPress) CheckDeviceGrabAndHintWindow(pWin, type, (deviceKeyButtonPointer *) pEvents, grab, client, deliveryMask); return deliveries; } return nondeliveries; } /** * Filter out raw events for XI 2.0 and XI 2.1 clients. * * If there is a grab on the device, 2.0 clients only get raw events if they * have the grab. 2.1+ clients get raw events in all cases. * * @return TRUE if the event should be discarded, FALSE otherwise. */ static BOOL FilterRawEvents(const ClientPtr client, const GrabPtr grab, WindowPtr root) { XIClientPtr client_xi_version; int cmp; /* device not grabbed -> don't filter */ if (!grab) return FALSE; client_xi_version = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); cmp = version_compare(client_xi_version->major_version, 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 */ if (cmp == 0) return TRUE; return (grab->window != root) ? FALSE : SameClient(grab, client); } /** * Deliver a raw event to the grab owner (if any) and to all root windows. * * Raw event delivery differs between XI 2.0 and XI 2.1. * XI 2.0: events delivered to the grabbing client (if any) OR to all root * windows * XI 2.1: events delivered to all root windows, regardless of grabbing * state. */ void DeliverRawEvent(RawDeviceEvent *ev, DeviceIntPtr device) { GrabPtr grab = device->deviceGrab.grab; xEvent *xi; int i, rc; int filter; rc = EventToXI2((InternalEvent *) ev, (xEvent **) &xi); if (rc != Success) { ErrorF("[Xi] %s: XI2 conversion failed in %s (%d)\n", __func__, device->name, rc); return; } if (grab) DeliverGrabbedEvent((InternalEvent *) ev, device, FALSE); filter = GetEventFilter(device, xi); for (i = 0; i < screenInfo.numScreens; i++) { WindowPtr root; InputClients *inputclients; root = screenInfo.screens[i]->root; if (!GetClientsForDelivery(device, root, xi, filter, &inputclients)) continue; for (; inputclients; inputclients = inputclients->next) { ClientPtr c; /* unused */ Mask m; /* unused */ InputClients ic = *inputclients; /* Because we run through the list manually, copy the actual * list, shorten the copy to only have one client and then pass * that down to DeliverEventToInputClients. This way we avoid * double events on XI 2.1 clients that have a grab on the * device. */ ic.next = NULL; if (!FilterRawEvents(rClient(&ic), grab, root)) DeliverEventToInputClients(device, &ic, root, xi, 1, filter, NULL, &c, &m); } } free(xi); } /* If the event goes to dontClient, don't send it and return 0. if send works, return 1 or if send didn't work, return 2. Only works for core events. */ #ifdef PANORAMIX static int XineramaTryClientEventsResult(ClientPtr client, GrabPtr grab, Mask mask, Mask filter) { if ((client) && (client != serverClient) && (!client->clientGone) && ((filter == CantBeFiltered) || (mask & filter))) { if (grab && !SameClient(grab, client)) return -1; else return 1; } return 0; } #endif /** * Try to deliver events to the interested parties. * * @param pWin The window that would get the event. * @param pEvents The events to be delivered. * @param count Number of elements in pEvents. * @param filter Mask based on event type. * @param dontClient Don't deliver to the dontClient. */ int MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents, int count, Mask filter, ClientPtr dontClient) { OtherClients *other; if (pWin->eventMask & filter) { if (wClient(pWin) == dontClient) return 0; #ifdef PANORAMIX if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return XineramaTryClientEventsResult(wClient(pWin), NullGrab, pWin->eventMask, filter); #endif if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count)) return 1; /* don't send, but pretend we did */ return TryClientEvents(wClient(pWin), NULL, pEvents, count, pWin->eventMask, filter, NullGrab); } for (other = wOtherClients(pWin); other; other = other->next) { if (other->mask & filter) { if (SameClient(other, dontClient)) return 0; #ifdef PANORAMIX if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return XineramaTryClientEventsResult(rClient(other), NullGrab, other->mask, filter); #endif if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, pEvents, count)) return 1; /* don't send, but pretend we did */ return TryClientEvents(rClient(other), NULL, pEvents, count, other->mask, filter, NullGrab); } } return 2; } static Window FindChildForEvent(SpritePtr pSprite, WindowPtr event) { WindowPtr w = DeepestSpriteWin(pSprite); Window child = None; /* If the search ends up past the root should the child field be set to none or should the value in the argument be passed through. It probably doesn't matter since everyone calls this function with child == None anyway. */ while (w) { /* If the source window is same as event window, child should be none. Don't bother going all all the way back to the root. */ if (w == event) { child = None; break; } if (w->parent == event) { child = w->drawable.id; break; } w = w->parent; } return child; } /** * Adjust event fields to comply with the window properties. * * @param xE Event to be modified in place * @param pWin The window to get the information from. * @param child Child window setting for event (if applicable) * @param calcChild If True, calculate the child window. */ void FixUpEventFromWindow(SpritePtr pSprite, xEvent *xE, WindowPtr pWin, Window child, Bool calcChild) { int evtype; if (calcChild) child = FindChildForEvent(pSprite, pWin); if ((evtype = xi2_get_type(xE))) { xXIDeviceEvent *event = (xXIDeviceEvent *) xE; switch (evtype) { case XI_RawKeyPress: case XI_RawKeyRelease: case XI_RawButtonPress: case XI_RawButtonRelease: case XI_RawMotion: case XI_RawTouchBegin: case XI_RawTouchUpdate: case XI_RawTouchEnd: case XI_DeviceChanged: case XI_HierarchyChanged: case XI_PropertyEvent: case XI_BarrierHit: case XI_BarrierLeave: return; default: break; } event->root = RootWindow(pSprite)->drawable.id; event->event = pWin->drawable.id; if (evtype == XI_TouchOwnership) { event->child = child; return; } if (pSprite->hot.pScreen == pWin->drawable.pScreen) { 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 { event->event_x = 0; event->event_y = 0; event->child = None; } if (event->evtype == XI_Enter || event->evtype == XI_Leave || event->evtype == XI_FocusIn || event->evtype == XI_FocusOut) ((xXIEnterEvent *) event)->same_screen = (pSprite->hot.pScreen == pWin->drawable.pScreen); } else { XE_KBPTR.root = RootWindow(pSprite)->drawable.id; XE_KBPTR.event = pWin->drawable.id; if (pSprite->hot.pScreen == pWin->drawable.pScreen) { XE_KBPTR.sameScreen = xTrue; XE_KBPTR.child = child; XE_KBPTR.eventX = XE_KBPTR.rootX - pWin->drawable.x; XE_KBPTR.eventY = XE_KBPTR.rootY - pWin->drawable.y; } else { XE_KBPTR.sameScreen = xFalse; XE_KBPTR.child = None; XE_KBPTR.eventX = 0; XE_KBPTR.eventY = 0; } } } /** * Check if a given event is deliverable at all on a given window. * * This function only checks if any client wants it, not for a specific * client. * * @param[in] dev The device this event is being sent for. * @param[in] evtype The event type of the event that is to be sent. * @param[in] win The current event window. * * @return Bitmask of ::EVENT_XI2_MASK, ::EVENT_XI1_MASK, ::EVENT_CORE_MASK, and * ::EVENT_DONT_PROPAGATE_MASK. */ int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win) { int rc = 0; int filter = 0; int type; OtherInputMasks *inputMasks = wOtherInputMasks(win); if ((type = GetXI2Type(evtype)) != 0) { if (inputMasks && xi2mask_isset(inputMasks->xi2mask, dev, type)) rc |= EVENT_XI2_MASK; } if ((type = GetXIType(evtype)) != 0) { filter = event_get_filter_from_type(dev, type); /* Check for XI mask */ if (inputMasks && (inputMasks->deliverableEvents[dev->id] & filter) && (inputMasks->inputEvents[dev->id] & filter)) rc |= EVENT_XI1_MASK; /* Check for XI DontPropagate mask */ if (inputMasks && (inputMasks->dontPropagateMask[dev->id] & filter)) rc |= EVENT_DONT_PROPAGATE_MASK; } if ((type = GetCoreType(evtype)) != 0) { filter = event_get_filter_from_type(dev, type); /* Check for core mask */ if ((win->deliverableEvents & filter) && ((wOtherEventMasks(win) | win->eventMask) & filter)) rc |= EVENT_CORE_MASK; /* Check for core DontPropagate mask */ if (filter & wDontPropagateMask(win)) rc |= EVENT_DONT_PROPAGATE_MASK; } return rc; } static int DeliverEvent(DeviceIntPtr dev, xEvent *xE, int count, WindowPtr win, Window child, GrabPtr grab) { SpritePtr pSprite = dev->spriteInfo->sprite; Mask filter; int deliveries = 0; if (XaceHook(XACE_SEND_ACCESS, NULL, dev, win, xE, count) == Success) { filter = GetEventFilter(dev, xE); FixUpEventFromWindow(pSprite, xE, win, child, FALSE); deliveries = DeliverEventsToWindow(dev, win, xE, count, filter, grab); } return deliveries; } static int DeliverOneEvent(InternalEvent *event, DeviceIntPtr dev, enum InputLevel level, WindowPtr win, Window child, GrabPtr grab) { xEvent *xE = NULL; int count = 0; int deliveries = 0; int rc; switch (level) { case XI2: rc = EventToXI2(event, &xE); count = 1; break; case XI: rc = EventToXI(event, &xE, &count); break; case CORE: rc = EventToCore(event, &xE, &count); break; default: rc = BadImplementation; break; } if (rc == Success) { deliveries = DeliverEvent(dev, xE, count, win, child, grab); free(xE); } else BUG_WARN_MSG(rc != BadMatch, "%s: conversion to level %d failed with rc %d\n", dev->name, level, rc); return deliveries; } /** * Deliver events caused by input devices. * * For events from a non-grabbed, non-focus device, DeliverDeviceEvents is * called directly from the processInputProc. * For grabbed devices, DeliverGrabbedEvent is called first, and _may_ call * DeliverDeviceEvents. * For focused events, DeliverFocusedEvent is called first, and _may_ call * DeliverDeviceEvents. * * @param pWin Window to deliver event to. * @param event The events to deliver, not yet in wire format. * @param grab Possible grab on a device. * @param stopAt Don't recurse up to the root window. * @param dev The device that is responsible for the event. * * @see DeliverGrabbedEvent * @see DeliverFocusedEvent */ int DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, WindowPtr stopAt, DeviceIntPtr dev) { Window child = None; int deliveries = 0; int mask; verify_internal_event(event); while (pWin) { if ((mask = EventIsDeliverable(dev, event->any.type, pWin))) { /* XI2 events first */ if (mask & EVENT_XI2_MASK) { deliveries = DeliverOneEvent(event, dev, XI2, pWin, child, grab); if (deliveries > 0) break; } /* XI events */ if (mask & EVENT_XI1_MASK) { deliveries = DeliverOneEvent(event, dev, XI, pWin, child, grab); if (deliveries > 0) break; } /* Core event */ if ((mask & EVENT_CORE_MASK) && IsMaster(dev) && dev->coreEvents) { deliveries = DeliverOneEvent(event, dev, CORE, pWin, child, grab); if (deliveries > 0) break; } } if ((deliveries < 0) || (pWin == stopAt) || (mask & EVENT_DONT_PROPAGATE_MASK)) { deliveries = 0; break; } child = pWin->drawable.id; pWin = pWin->parent; } return deliveries; } /** * Deliver event to a window and it's immediate parent. Used for most window * events (CreateNotify, ConfigureNotify, etc.). Not useful for events that * propagate up the tree or extension events * * In case of a ReparentNotify event, the event will be delivered to the * otherParent as well. * * @param pWin Window to deliver events to. * @param xE Events to deliver. * @param count number of events in xE. * @param otherParent Used for ReparentNotify events. */ int DeliverEvents(WindowPtr pWin, xEvent *xE, int count, WindowPtr otherParent) { DeviceIntRec dummy; int deliveries; #ifdef PANORAMIX if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return count; #endif if (!count) return 0; dummy.id = XIAllDevices; switch (xE->u.u.type) { case DestroyNotify: case UnmapNotify: case MapNotify: case MapRequest: case ReparentNotify: case ConfigureNotify: case ConfigureRequest: case GravityNotify: case CirculateNotify: case CirculateRequest: xE->u.destroyNotify.event = pWin->drawable.id; break; } switch (xE->u.u.type) { case DestroyNotify: case UnmapNotify: case MapNotify: case ReparentNotify: case ConfigureNotify: case GravityNotify: case CirculateNotify: break; default: { Mask filter; filter = GetEventFilter(&dummy, xE); return DeliverEventsToWindow(&dummy, pWin, xE, count, filter, NullGrab); } } deliveries = DeliverEventsToWindow(&dummy, pWin, xE, count, StructureNotifyMask, NullGrab); if (pWin->parent) { xE->u.destroyNotify.event = pWin->parent->drawable.id; deliveries += DeliverEventsToWindow(&dummy, pWin->parent, xE, count, SubstructureNotifyMask, NullGrab); if (xE->u.u.type == ReparentNotify) { xE->u.destroyNotify.event = otherParent->drawable.id; deliveries += DeliverEventsToWindow(&dummy, otherParent, xE, count, SubstructureNotifyMask, NullGrab); } } return deliveries; } Bool PointInBorderSize(WindowPtr pWin, int x, int y) { BoxRec box; if (RegionContainsPoint(&pWin->borderSize, x, y, &box)) return TRUE; #ifdef PANORAMIX if (!noPanoramiXExtension && XineramaSetWindowPntrs(inputInfo.pointer, pWin)) { SpritePtr pSprite = inputInfo.pointer->spriteInfo->sprite; int i; FOR_NSCREENS_FORWARD_SKIP(i) { if (RegionContainsPoint(&pSprite->windows[i]->borderSize, x + screenInfo.screens[0]->x - screenInfo.screens[i]->x, y + screenInfo.screens[0]->y - screenInfo.screens[i]->y, &box)) return TRUE; } } #endif return FALSE; } /** * Traversed from the root window to the window at the position x/y. While * traversing, it sets up the traversal history in the spriteTrace array. * After completing, the spriteTrace history is set in the following way: * spriteTrace[0] ... root window * spriteTrace[1] ... top level window that encloses x/y * ... * spriteTrace[spriteTraceGood - 1] ... window at x/y * * @returns the window at the given coordinates. */ WindowPtr XYToWindow(SpritePtr pSprite, int x, int y) { ScreenPtr pScreen = RootWindow(pSprite)->drawable.pScreen; return (*pScreen->XYToWindow)(pScreen, pSprite, x, y); } /** * Ungrab a currently FocusIn grabbed device and grab the device on the * given window. If the win given is the NoneWin, the device is ungrabbed if * applicable and FALSE is returned. * * @returns TRUE if the device has been grabbed, or FALSE otherwise. */ BOOL ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) { BOOL rc = FALSE; DeviceEvent event; if (dev->deviceGrab.grab) { if (!dev->deviceGrab.fromPassiveGrab || dev->deviceGrab.grab->type != XI_Enter || dev->deviceGrab.grab->window == win || IsParent(dev->deviceGrab.grab->window, win)) return FALSE; DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab); (*dev->deviceGrab.DeactivateGrab) (dev); } if (win == NoneWin || win == PointerRootWin) return FALSE; 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) DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab); return rc; } /** * Ungrab a currently Enter grabbed device and grab the device for the given * window. * * @returns TRUE if the device has been grabbed, or FALSE otherwise. */ static BOOL ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) { BOOL rc = FALSE; DeviceEvent event; if (dev->deviceGrab.grab) { if (!dev->deviceGrab.fromPassiveGrab || dev->deviceGrab.grab->type != XI_Enter || dev->deviceGrab.grab->window == win || IsParent(dev->deviceGrab.grab->window, win)) return FALSE; DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab); (*dev->deviceGrab.DeactivateGrab) (dev); } 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) DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveGrab); return rc; } /** * Update the sprite coordinates based on the event. Update the cursor * position, then update the event with the new coordinates that may have been * changed. If the window underneath the sprite has changed, change to new * cursor and send enter/leave events. * * CheckMotion() will not do anything and return FALSE if the event is not a * pointer event. * * @return TRUE if the sprite has moved or FALSE otherwise. */ Bool CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) { WindowPtr prevSpriteWin, newSpriteWin; SpritePtr pSprite = pDev->spriteInfo->sprite; verify_internal_event((InternalEvent *) ev); prevSpriteWin = pSprite->win; if (ev && !syncEvents.playingEvents) { /* GetPointerEvents() guarantees that pointer events have the correct rootX/Y set already. */ switch (ev->type) { case ET_ButtonPress: case ET_ButtonRelease: case ET_Motion: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: break; default: /* all other events return FALSE */ return FALSE; } #ifdef PANORAMIX if (!noPanoramiXExtension) { /* Motion events entering DIX get translated to Screen 0 coordinates. Replayed events have already been translated since they've entered DIX before */ ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x; ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y; } else #endif { if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen) { pSprite->hot.pScreen = pSprite->hotPhys.pScreen; RootWindow(pDev->spriteInfo->sprite) = pSprite->hot.pScreen->root; } } pSprite->hot.x = ev->root_x; pSprite->hot.y = ev->root_y; if (pSprite->hot.x < pSprite->physLimits.x1) pSprite->hot.x = pSprite->physLimits.x1; else if (pSprite->hot.x >= pSprite->physLimits.x2) pSprite->hot.x = pSprite->physLimits.x2 - 1; if (pSprite->hot.y < pSprite->physLimits.y1) pSprite->hot.y = pSprite->physLimits.y1; else if (pSprite->hot.y >= pSprite->physLimits.y2) pSprite->hot.y = pSprite->physLimits.y2 - 1; if (pSprite->hotShape) ConfineToShape(pDev, pSprite->hotShape, &pSprite->hot.x, &pSprite->hot.y); pSprite->hotPhys = pSprite->hot; if ((pSprite->hotPhys.x != ev->root_x) || (pSprite->hotPhys.y != ev->root_y)) { #ifdef PANORAMIX if (!noPanoramiXExtension) { XineramaSetCursorPosition(pDev, pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE); } else #endif { (*pSprite->hotPhys.pScreen->SetCursorPosition) (pDev, pSprite-> hotPhys.pScreen, pSprite-> hotPhys.x, pSprite-> hotPhys.y, FALSE); } } ev->root_x = pSprite->hot.x; ev->root_y = pSprite->hot.y; } newSpriteWin = XYToWindow(pSprite, pSprite->hot.x, pSprite->hot.y); if (newSpriteWin != prevSpriteWin) { int sourceid; if (!ev) { UpdateCurrentTimeIf(); sourceid = pDev->id; /* when from WindowsRestructured */ } else sourceid = ev->sourceid; if (prevSpriteWin != NullWindow) { if (!ActivateEnterGrab(pDev, prevSpriteWin, newSpriteWin)) DoEnterLeaveEvents(pDev, sourceid, prevSpriteWin, newSpriteWin, NotifyNormal); } /* set pSprite->win after ActivateEnterGrab, otherwise sprite window == grab_window and no enter/leave events are sent. */ pSprite->win = newSpriteWin; PostNewCursor(pDev); return FALSE; } return TRUE; } /** * Windows have restructured, we need to update the sprite position and the * sprite's cursor. */ void WindowsRestructured(void) { DeviceIntPtr pDev = inputInfo.devices; while (pDev) { if (IsMaster(pDev) || IsFloating(pDev)) CheckMotion(NULL, pDev); pDev = pDev->next; } } #ifdef PANORAMIX /* This was added to support reconfiguration under Xdmx. The problem is * that if the 0th screen (i.e., screenInfo.screens[0]) is moved to an origin * other than 0,0, the information in the private sprite structure must * be updated accordingly, or XYToWindow (and other routines) will not * compute correctly. */ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) { GrabPtr grab; DeviceIntPtr pDev; SpritePtr pSprite; if (noPanoramiXExtension) return; pDev = inputInfo.devices; while (pDev) { if (DevHasCursor(pDev)) { pSprite = pDev->spriteInfo->sprite; pSprite->hot.x -= xoff; pSprite->hot.y -= yoff; pSprite->hotPhys.x -= xoff; pSprite->hotPhys.y -= yoff; pSprite->hotLimits.x1 -= xoff; pSprite->hotLimits.y1 -= yoff; pSprite->hotLimits.x2 -= xoff; pSprite->hotLimits.y2 -= yoff; if (RegionNotEmpty(&pSprite->Reg1)) RegionTranslate(&pSprite->Reg1, xoff, yoff); if (RegionNotEmpty(&pSprite->Reg2)) RegionTranslate(&pSprite->Reg2, xoff, yoff); /* FIXME: if we call ConfineCursorToWindow, must we do anything else? */ if ((grab = pDev->deviceGrab.grab) && grab->confineTo) { if (grab->confineTo->drawable.pScreen != pSprite->hotPhys.pScreen) pSprite->hotPhys.x = pSprite->hotPhys.y = 0; ConfineCursorToWindow(pDev, grab->confineTo, TRUE, TRUE); } else ConfineCursorToWindow(pDev, pSprite->hotPhys.pScreen->root, TRUE, FALSE); } pDev = pDev->next; } } #endif /** * Initialize a sprite for the given device and set it to some sane values. If * the device already has a sprite alloc'd, don't realloc but just reset to * default values. * If a window is supplied, the sprite will be initialized with the window's * cursor and positioned in the center of the window's screen. The root window * is a good choice to pass in here. * * It's a good idea to call it only for pointer devices, unless you have a * really talented keyboard. * * @param pDev The device to initialize. * @param pWin The window where to generate the sprite in. * */ void InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) { SpritePtr pSprite; ScreenPtr pScreen; CursorPtr pCursor; if (!pDev->spriteInfo->sprite) { DeviceIntPtr it; pDev->spriteInfo->sprite = (SpritePtr) calloc(1, sizeof(SpriteRec)); if (!pDev->spriteInfo->sprite) FatalError("InitializeSprite: failed to allocate sprite struct"); /* We may have paired another device with this device before our * device had a actual sprite. We need to check for this and reset the * sprite field for all paired devices. * * The VCK is always paired with the VCP before the VCP has a sprite. */ for (it = inputInfo.devices; it; it = it->next) { if (it->spriteInfo->paired == pDev) it->spriteInfo->sprite = pDev->spriteInfo->sprite; } if (inputInfo.keyboard->spriteInfo->paired == pDev) inputInfo.keyboard->spriteInfo->sprite = pDev->spriteInfo->sprite; } pSprite = pDev->spriteInfo->sprite; pDev->spriteInfo->spriteOwner = TRUE; pScreen = (pWin) ? pWin->drawable.pScreen : (ScreenPtr) NULL; pSprite->hot.pScreen = pScreen; pSprite->hotPhys.pScreen = pScreen; if (pScreen) { pSprite->hotPhys.x = pScreen->width / 2; pSprite->hotPhys.y = pScreen->height / 2; pSprite->hotLimits.x2 = pScreen->width; pSprite->hotLimits.y2 = pScreen->height; } pSprite->hot = pSprite->hotPhys; pSprite->win = pWin; if (pWin) { pCursor = wCursor(pWin); pSprite->spriteTrace = (WindowPtr *) calloc(1, 32 * sizeof(WindowPtr)); if (!pSprite->spriteTrace) FatalError("Failed to allocate spriteTrace"); pSprite->spriteTraceSize = 32; RootWindow(pDev->spriteInfo->sprite) = pWin; pSprite->spriteTraceGood = 1; pSprite->pEnqueueScreen = pScreen; pSprite->pDequeueScreen = pSprite->pEnqueueScreen; } else { pCursor = NullCursor; pSprite->spriteTrace = NULL; pSprite->spriteTraceSize = 0; pSprite->spriteTraceGood = 0; pSprite->pEnqueueScreen = screenInfo.screens[0]; pSprite->pDequeueScreen = pSprite->pEnqueueScreen; } pCursor = RefCursor(pCursor); if (pSprite->current) FreeCursor(pSprite->current, None); pSprite->current = pCursor; if (pScreen) { (*pScreen->RealizeCursor) (pDev, pScreen, pSprite->current); (*pScreen->CursorLimits) (pDev, pScreen, pSprite->current, &pSprite->hotLimits, &pSprite->physLimits); pSprite->confined = FALSE; (*pScreen->ConstrainCursor) (pDev, pScreen, &pSprite->physLimits); (*pScreen->SetCursorPosition) (pDev, pScreen, pSprite->hot.x, pSprite->hot.y, FALSE); (*pScreen->DisplayCursor) (pDev, pScreen, pSprite->current); } #ifdef PANORAMIX if (!noPanoramiXExtension) { pSprite->hotLimits.x1 = -screenInfo.screens[0]->x; pSprite->hotLimits.y1 = -screenInfo.screens[0]->y; pSprite->hotLimits.x2 = PanoramiXPixWidth - screenInfo.screens[0]->x; pSprite->hotLimits.y2 = PanoramiXPixHeight - screenInfo.screens[0]->y; pSprite->physLimits = pSprite->hotLimits; pSprite->confineWin = NullWindow; pSprite->hotShape = NullRegion; pSprite->screen = pScreen; /* gotta UNINIT these someplace */ RegionNull(&pSprite->Reg1); RegionNull(&pSprite->Reg2); } #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 * from a pScreen to another. Never updating the pScreen of the mouse sprite * implies that windows that are in pScreen whose pScreen->myNum >0 will never * get pointer events. This is because in CheckMotion(), sprite.hotPhys.pScreen * always points to the first pScreen it has been set by * DefineInitialRootWindow(). * * Calling this function is useful for use cases where the server * has more than one pScreen. * This function is similar to DefineInitialRootWindow() but it does not * reset the mouse pointer position. * @param win must be the new pScreen we are switching to. */ void UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen) { SpritePtr pSprite = NULL; WindowPtr win = NULL; CursorPtr pCursor; if (!pScreen) return; if (!pDev->spriteInfo->sprite) return; pSprite = pDev->spriteInfo->sprite; win = pScreen->root; pSprite->hotPhys.pScreen = pScreen; pSprite->hot = pSprite->hotPhys; pSprite->hotLimits.x2 = pScreen->width; pSprite->hotLimits.y2 = pScreen->height; pSprite->win = win; pCursor = RefCursor(wCursor(win)); if (pSprite->current) FreeCursor(pSprite->current, 0); pSprite->current = pCursor; pSprite->spriteTraceGood = 1; pSprite->spriteTrace[0] = win; (*pScreen->CursorLimits) (pDev, pScreen, pSprite->current, &pSprite->hotLimits, &pSprite->physLimits); pSprite->confined = FALSE; (*pScreen->ConstrainCursor) (pDev, pScreen, &pSprite->physLimits); (*pScreen->DisplayCursor) (pDev, pScreen, pSprite->current); #ifdef PANORAMIX if (!noPanoramiXExtension) { pSprite->hotLimits.x1 = -screenInfo.screens[0]->x; pSprite->hotLimits.y1 = -screenInfo.screens[0]->y; pSprite->hotLimits.x2 = PanoramiXPixWidth - screenInfo.screens[0]->x; pSprite->hotLimits.y2 = PanoramiXPixHeight - screenInfo.screens[0]->y; pSprite->physLimits = pSprite->hotLimits; pSprite->screen = pScreen; } #endif } /* * This does not take any shortcuts, and even ignores its argument, since * it does not happen very often, and one has to walk up the tree since * this might be a newly instantiated cursor for an intermediate window * between the one the pointer is in and the one that the last cursor was * instantiated from. */ void WindowHasNewCursor(WindowPtr pWin) { DeviceIntPtr pDev; for (pDev = inputInfo.devices; pDev; pDev = pDev->next) if (DevHasCursor(pDev)) PostNewCursor(pDev); } void NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y) { DeviceIntPtr ptr; SpritePtr pSprite; ptr = IsFloating(pDev) ? pDev : GetXTestDevice(GetMaster(pDev, MASTER_POINTER)); pSprite = ptr->spriteInfo->sprite; pSprite->hotPhys.x = x; pSprite->hotPhys.y = y; #ifdef PANORAMIX if (!noPanoramiXExtension) { pSprite->hotPhys.x += newScreen->x - screenInfo.screens[0]->x; pSprite->hotPhys.y += newScreen->y - screenInfo.screens[0]->y; if (newScreen != pSprite->screen) { pSprite->screen = newScreen; /* Make sure we tell the DDX to update its copy of the screen */ if (pSprite->confineWin) XineramaConfineCursorToWindow(ptr, pSprite->confineWin, TRUE); else XineramaConfineCursorToWindow(ptr, screenInfo.screens[0]->root, TRUE); /* if the pointer wasn't confined, the DDX won't get told of the pointer warp so we reposition it here */ if (!syncEvents.playingEvents) (*pSprite->screen->SetCursorPosition) (ptr, pSprite->screen, pSprite->hotPhys.x + screenInfo.screens[0]-> x - pSprite->screen->x, pSprite->hotPhys.y + screenInfo.screens[0]-> y - pSprite->screen->y, FALSE); } } else #endif if (newScreen != pSprite->hotPhys.pScreen) ConfineCursorToWindow(ptr, newScreen->root, TRUE, FALSE); } #ifdef PANORAMIX static Bool XineramaPointInWindowIsVisible(WindowPtr pWin, int x, int y) { BoxRec box; int i, xoff, yoff; if (!pWin->realized) return FALSE; if (RegionContainsPoint(&pWin->borderClip, x, y, &box)) return TRUE; if (!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE; xoff = x + screenInfo.screens[0]->x; yoff = y + screenInfo.screens[0]->y; FOR_NSCREENS_FORWARD_SKIP(i) { pWin = inputInfo.pointer->spriteInfo->sprite->windows[i]; x = xoff - screenInfo.screens[i]->x; y = yoff - screenInfo.screens[i]->y; if (RegionContainsPoint(&pWin->borderClip, x, y, &box) && (!wInputShape(pWin) || RegionContainsPoint(wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box))) return TRUE; } return FALSE; } static int XineramaWarpPointer(ClientPtr client) { WindowPtr dest = NULL; int x, y, rc; SpritePtr pSprite = PickPointer(client)->spriteInfo->sprite; REQUEST(xWarpPointerReq); if (stuff->dstWid != None) { rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess); if (rc != Success) return rc; } x = pSprite->hotPhys.x; y = pSprite->hotPhys.y; if (stuff->srcWid != None) { int winX, winY; XID winID = stuff->srcWid; WindowPtr source; rc = dixLookupWindow(&source, winID, client, DixReadAccess); if (rc != Success) return rc; winX = source->drawable.x; winY = source->drawable.y; if (source == screenInfo.screens[0]->root) { winX -= screenInfo.screens[0]->x; winY -= screenInfo.screens[0]->y; } if (x < winX + stuff->srcX || y < winY + stuff->srcY || (stuff->srcWidth != 0 && winX + stuff->srcX + (int) stuff->srcWidth < x) || (stuff->srcHeight != 0 && winY + stuff->srcY + (int) stuff->srcHeight < y) || !XineramaPointInWindowIsVisible(source, x, y)) return Success; } if (dest) { x = dest->drawable.x; y = dest->drawable.y; if (dest == screenInfo.screens[0]->root) { x -= screenInfo.screens[0]->x; y -= screenInfo.screens[0]->y; } } x += stuff->dstX; y += stuff->dstY; if (x < pSprite->physLimits.x1) x = pSprite->physLimits.x1; else if (x >= pSprite->physLimits.x2) x = pSprite->physLimits.x2 - 1; if (y < pSprite->physLimits.y1) y = pSprite->physLimits.y1; else if (y >= pSprite->physLimits.y2) y = pSprite->physLimits.y2 - 1; if (pSprite->hotShape) ConfineToShape(PickPointer(client), pSprite->hotShape, &x, &y); XineramaSetCursorPosition(PickPointer(client), x, y, TRUE); return Success; } #endif /** * Server-side protocol handling for WarpPointer request. * Warps the cursor position to the coordinates given in the request. */ int ProcWarpPointer(ClientPtr client) { WindowPtr dest = NULL; int x, y, rc; ScreenPtr newScreen; DeviceIntPtr dev, tmp; SpritePtr pSprite; REQUEST(xWarpPointerReq); REQUEST_SIZE_MATCH(xWarpPointerReq); dev = PickPointer(client); for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { if (GetMaster(tmp, MASTER_ATTACHED) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixWriteAccess); if (rc != Success) return rc; } } if (dev->lastSlave) dev = dev->lastSlave; pSprite = dev->spriteInfo->sprite; #ifdef PANORAMIX if (!noPanoramiXExtension) return XineramaWarpPointer(client); #endif if (stuff->dstWid != None) { rc = dixLookupWindow(&dest, stuff->dstWid, client, DixGetAttrAccess); if (rc != Success) return rc; } x = pSprite->hotPhys.x; y = pSprite->hotPhys.y; if (stuff->srcWid != None) { int winX, winY; XID winID = stuff->srcWid; WindowPtr source; rc = dixLookupWindow(&source, winID, client, DixGetAttrAccess); if (rc != Success) return rc; winX = source->drawable.x; winY = source->drawable.y; if (source->drawable.pScreen != pSprite->hotPhys.pScreen || x < winX + stuff->srcX || y < winY + stuff->srcY || (stuff->srcWidth != 0 && winX + stuff->srcX + (int) stuff->srcWidth < x) || (stuff->srcHeight != 0 && winY + stuff->srcY + (int) stuff->srcHeight < y) || !PointInWindowIsVisible(source, x, y)) return Success; } if (dest) { x = dest->drawable.x; y = dest->drawable.y; newScreen = dest->drawable.pScreen; } else newScreen = pSprite->hotPhys.pScreen; x += stuff->dstX; y += stuff->dstY; if (x < 0) x = 0; else if (x >= newScreen->width) x = newScreen->width - 1; if (y < 0) y = 0; else if (y >= newScreen->height) y = newScreen->height - 1; if (newScreen == pSprite->hotPhys.pScreen) { if (x < pSprite->physLimits.x1) x = pSprite->physLimits.x1; else if (x >= pSprite->physLimits.x2) x = pSprite->physLimits.x2 - 1; if (y < pSprite->physLimits.y1) y = pSprite->physLimits.y1; else if (y >= pSprite->physLimits.y2) y = pSprite->physLimits.y2 - 1; if (pSprite->hotShape) ConfineToShape(dev, pSprite->hotShape, &x, &y); (*newScreen->SetCursorPosition) (dev, newScreen, x, y, TRUE); } else if (!PointerConfinedToScreen(dev)) { NewCurrentScreen(dev, newScreen, x, y); } return Success; } static Bool BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) { if (RegionNotEmpty(&pWin->borderSize)) return TRUE; #ifdef PANORAMIX if (!noPanoramiXExtension && XineramaSetWindowPntrs(pDev, pWin)) { int i; FOR_NSCREENS_FORWARD_SKIP(i) { if (RegionNotEmpty (&pDev->spriteInfo->sprite->windows[i]->borderSize)) return TRUE; } } #endif return FALSE; } /** * Activate the given passive grab. If the grab is activated successfully, the * event has been delivered to the client. * * @param device The device of the event to check. * @param grab The grab to check. * @param event The current device event. * @param real_event The original event, in case of touch emulation. The * real event is the one stored in the sync queue. * * @return Whether the grab has been activated. */ Bool ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, InternalEvent *real_event) { SpritePtr pSprite = device->spriteInfo->sprite; GrabInfoPtr grabinfo = &device->deviceGrab; xEvent *xE = NULL; int count; int rc; /* The only consumers of corestate are Xi 1.x and core events, which * are guaranteed to come from DeviceEvents. */ if (grab->grabtype == XI || grab->grabtype == CORE) { DeviceIntPtr gdev; event->device_event.corestate &= 0x1f00; if (grab->grabtype == CORE) gdev = GetMaster(device, KEYBOARD_OR_FLOAT); else gdev = grab->modifierDevice; if (gdev && gdev->key && gdev->key->xkbInfo) event->device_event.corestate |= gdev->key->xkbInfo->state.grab_mods & (~0x1f00); } if (grab->grabtype == CORE) { rc = EventToCore(event, &xE, &count); if (rc != Success) { BUG_WARN_MSG(rc != BadMatch, "[dix] %s: core conversion failed" "(%d, %d).\n", device->name, event->any.type, rc); return FALSE; } } else if (grab->grabtype == XI2) { rc = EventToXI2(event, &xE); if (rc != Success) { if (rc != BadMatch) BUG_WARN_MSG(rc != BadMatch, "[dix] %s: XI2 conversion failed" "(%d, %d).\n", device->name, event->any.type, rc); return FALSE; } count = 1; } else { rc = EventToXI(event, &xE, &count); if (rc != Success) { if (rc != BadMatch) BUG_WARN_MSG(rc != BadMatch, "[dix] %s: XI conversion failed" "(%d, %d).\n", device->name, event->any.type, rc); return FALSE; } } (*grabinfo->ActivateGrab) (device, grab, ClientTimeToServerTime(event->any.time), TRUE); if (xE) { FixUpEventFromWindow(pSprite, xE, grab->window, None, TRUE); /* XXX: XACE? */ TryClientEvents(rClient(grab), device, xE, count, GetEventFilter(device, xE), GetEventFilter(device, xE), grab); } if (grabinfo->sync.state == FROZEN_NO_EVENT) grabinfo->sync.state = FROZEN_WITH_EVENT; *grabinfo->sync.event = real_event->device_event; free(xE); return TRUE; } static BOOL CoreGrabInterferes(DeviceIntPtr device, GrabPtr grab) { DeviceIntPtr other; BOOL interfering = FALSE; for (other = inputInfo.devices; other; other = other->next) { GrabPtr othergrab = other->deviceGrab.grab; if (othergrab && othergrab->grabtype == CORE && SameClient(grab, rClient(othergrab)) && ((IsPointerDevice(grab->device) && IsPointerDevice(othergrab->device)) || (IsKeyboardDevice(grab->device) && IsKeyboardDevice(othergrab->device)))) { interfering = TRUE; break; } } return interfering; } enum MatchFlags { NO_MATCH = 0x0, CORE_MATCH = 0x1, XI_MATCH = 0x2, XI2_MATCH = 0x4, }; /** * Match the grab against the temporary grab on the given input level. * Modifies the temporary grab pointer. * * @param grab The grab to match against * @param tmp The temporary grab to use for matching * @param level The input level we want to match on * @param event_type Wire protocol event type * * @return The respective matched flag or 0 for no match */ static enum MatchFlags MatchForType(const GrabPtr grab, GrabPtr tmp, enum InputLevel level, int event_type) { enum MatchFlags match; BOOL ignore_device = FALSE; int grabtype; int evtype; switch (level) { case XI2: grabtype = XI2; evtype = GetXI2Type(event_type); BUG_WARN(!evtype); match = XI2_MATCH; break; case XI: grabtype = XI; evtype = GetXIType(event_type); match = XI_MATCH; break; case CORE: grabtype = CORE; evtype = GetCoreType(event_type); match = CORE_MATCH; ignore_device = TRUE; break; default: return NO_MATCH; } tmp->grabtype = grabtype; tmp->type = evtype; if (tmp->type && GrabMatchesSecond(tmp, grab, ignore_device)) return match; return NO_MATCH; } /** * Check an individual grab against an event to determine if a passive grab * should be activated. * * @param device The device of the event to check. * @param grab The grab to check. * @param event The current device event. * @param checkCore Check for core grabs too. * @param tempGrab A pre-allocated temporary grab record for matching. This * must have the window and device values filled in. * * @return Whether the grab matches the event. */ static Bool CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event, Bool checkCore, GrabPtr tempGrab) { DeviceIntPtr gdev; XkbSrvInfoPtr xkbi = NULL; enum MatchFlags match = 0; int emulated_type = 0; gdev = grab->modifierDevice; if (grab->grabtype == CORE) { gdev = GetMaster(device, KEYBOARD_OR_FLOAT); } else if (grab->grabtype == XI2) { /* if the device is an attached slave device, gdev must be the * attached master keyboard. Since the slave may have been * reattached after the grab, the modifier device may not be the * same. */ if (!IsMaster(grab->device) && !IsFloating(device)) gdev = GetMaster(device, MASTER_KEYBOARD); } if (gdev && gdev->key) xkbi = gdev->key->xkbInfo; tempGrab->modifierDevice = grab->modifierDevice; tempGrab->modifiersDetail.exact = xkbi ? xkbi->state.grab_mods : 0; /* Check for XI2 and XI grabs first */ match = MatchForType(grab, tempGrab, XI2, event->any.type); if (!match && IsTouchEvent(event) && (event->device_event.flags & TOUCH_POINTER_EMULATED)) { emulated_type = TouchGetPointerEventType(event); match = MatchForType(grab, tempGrab, XI2, emulated_type); } if (!match) match = MatchForType(grab, tempGrab, XI, event->any.type); if (!match && emulated_type) match = MatchForType(grab, tempGrab, XI, emulated_type); if (!match && checkCore) { match = MatchForType(grab, tempGrab, CORE, event->any.type); if (!match && emulated_type) match = MatchForType(grab, tempGrab, CORE, emulated_type); } if (!match || (grab->confineTo && (!grab->confineTo->realized || !BorderSizeNotEmpty(device, grab->confineTo)))) return FALSE; /* In some cases a passive core grab may exist, but the client * already has a core grab on some other device. In this case we * must not get the grab, otherwise we may never ungrab the * device. */ if (grab->grabtype == CORE) { /* A passive grab may have been created for a different device than it is assigned to at this point in time. Update the grab's device and modifier device to reflect the current state. Since XGrabDeviceButton requires to specify the modifierDevice explicitly, we don't override this choice. */ if (grab->type < GenericEvent) { grab->device = device; grab->modifierDevice = GetMaster(device, MASTER_KEYBOARD); } if (CoreGrabInterferes(device, grab)) return FALSE; } return TRUE; } /** * "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a * passive grab set on the window to be activated. * If activate is true and a passive grab is found, it will be activated, * and the event will be delivered to the client. * * @param pWin The window that may be subject to a passive grab. * @param device Device that caused the event. * @param event The current device event. * @param checkCore Check for core grabs too. * @param activate If a grab is found, activate it and deliver the event. */ GrabPtr CheckPassiveGrabsOnWindow(WindowPtr pWin, DeviceIntPtr device, InternalEvent *event, BOOL checkCore, BOOL activate) { GrabPtr grab = wPassiveGrabs(pWin); GrabPtr tempGrab; if (!grab) return NULL; tempGrab = AllocGrab(NULL); if (tempGrab == NULL) return NULL; /* Fill out the grab details, but leave the type for later before * comparing */ switch (event->any.type) { case ET_KeyPress: case ET_KeyRelease: tempGrab->detail.exact = event->device_event.detail.key; break; case ET_ButtonPress: case ET_ButtonRelease: case ET_TouchBegin: case ET_TouchEnd: tempGrab->detail.exact = event->device_event.detail.button; break; default: tempGrab->detail.exact = 0; break; } tempGrab->window = pWin; tempGrab->device = device; tempGrab->detail.pMask = NULL; tempGrab->modifiersDetail.pMask = NULL; tempGrab->next = NULL; for (; grab; grab = grab->next) { if (!CheckPassiveGrab(device, grab, event, checkCore, tempGrab)) continue; if (activate && !ActivatePassiveGrab(device, grab, event, event)) continue; break; } FreeGrab(tempGrab); return grab; } /** * CheckDeviceGrabs handles both keyboard and pointer events that may cause * a passive grab to be activated. * * If the event is a keyboard event, the ancestors of the focus window are * traced down and tried to see if they have any passive grabs to be * activated. If the focus window itself is reached and it's descendants * contain the pointer, the ancestors of the window that the pointer is in * are then traced down starting at the focus window, otherwise no grabs are * activated. * If the event is a pointer event, the ancestors of the window that the * pointer is in are traced down starting at the root until CheckPassiveGrabs * causes a passive grab to activate or all the windows are * tried. PRH * * If a grab is activated, the event has been sent to the client already! * * The event we pass in must always be an XI event. From this, we then emulate * the core event and then check for grabs. * * @param device The device that caused the event. * @param xE The event to handle (Device{Button|Key}Press). * @param count Number of events in list. * @return TRUE if a grab has been activated or false otherwise. */ Bool CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor) { int i; WindowPtr pWin = NULL; FocusClassPtr focus = IsPointerEvent((InternalEvent *) event) ? NULL : device->focus; BOOL sendCore = (IsMaster(device) && device->coreEvents); Bool ret = FALSE; if (event->type != ET_ButtonPress && event->type != ET_KeyPress) return FALSE; if (event->type == ET_ButtonPress && (device->button->buttonsDown != 1)) return FALSE; if (device->deviceGrab.grab) return FALSE; i = 0; if (ancestor) { while (i < device->spriteInfo->sprite->spriteTraceGood) if (device->spriteInfo->sprite->spriteTrace[i++] == ancestor) break; if (i == device->spriteInfo->sprite->spriteTraceGood) goto out; } if (focus) { for (; i < focus->traceGood; i++) { pWin = focus->trace[i]; if (CheckPassiveGrabsOnWindow(pWin, device, (InternalEvent *) event, sendCore, TRUE)) { ret = TRUE; goto out; } } if ((focus->win == NoneWin) || (i >= device->spriteInfo->sprite->spriteTraceGood) || (pWin && pWin != device->spriteInfo->sprite->spriteTrace[i - 1])) goto out; } for (; i < device->spriteInfo->sprite->spriteTraceGood; i++) { pWin = device->spriteInfo->sprite->spriteTrace[i]; if (CheckPassiveGrabsOnWindow(pWin, device, (InternalEvent *) event, sendCore, TRUE)) { ret = TRUE; goto out; } } out: if (ret == TRUE && event->type == ET_KeyPress) device->deviceGrab.activatingKey = event->detail.key; return ret; } /** * Called for keyboard events to deliver event to whatever client owns the * focus. * * The event is delivered to the keyboard's focus window, the root window or * to the window owning the input focus. * * @param keybd The keyboard originating the event. * @param event The event, not yet in wire format. * @param window Window underneath the sprite. */ void DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) { DeviceIntPtr ptr; WindowPtr focus = keybd->focus->win; BOOL sendCore = (IsMaster(keybd) && keybd->coreEvents); xEvent *core = NULL, *xE = NULL, *xi2 = NULL; int count, rc; int deliveries = 0; if (focus == FollowKeyboardWin) focus = inputInfo.keyboard->focus->win; if (!focus) return; if (focus == PointerRootWin) { DeliverDeviceEvents(window, event, NullGrab, NullWindow, keybd); return; } if ((focus == window) || IsParent(focus, window)) { if (DeliverDeviceEvents(window, event, NullGrab, focus, keybd)) return; } /* just deliver it to the focus window */ ptr = GetMaster(keybd, POINTER_OR_FLOAT); rc = EventToXI2(event, &xi2); if (rc == Success) { /* XXX: XACE */ int filter = GetEventFilter(keybd, xi2); FixUpEventFromWindow(ptr->spriteInfo->sprite, xi2, focus, None, FALSE); deliveries = DeliverEventsToWindow(keybd, focus, xi2, 1, filter, NullGrab); if (deliveries > 0) goto unwind; } else if (rc != BadMatch) ErrorF ("[dix] %s: XI2 conversion failed in DFE (%d, %d). Skipping delivery.\n", keybd->name, event->any.type, rc); rc = EventToXI(event, &xE, &count); if (rc == Success && XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, xE, count) == Success) { FixUpEventFromWindow(ptr->spriteInfo->sprite, xE, focus, None, FALSE); deliveries = DeliverEventsToWindow(keybd, focus, xE, count, GetEventFilter(keybd, xE), NullGrab); if (deliveries > 0) goto unwind; } else if (rc != BadMatch) ErrorF ("[dix] %s: XI conversion failed in DFE (%d, %d). Skipping delivery.\n", keybd->name, event->any.type, rc); if (sendCore) { rc = EventToCore(event, &core, &count); if (rc == Success) { if (XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, core, count) == Success) { FixUpEventFromWindow(keybd->spriteInfo->sprite, core, focus, None, FALSE); deliveries = DeliverEventsToWindow(keybd, focus, core, count, GetEventFilter(keybd, core), NullGrab); } } else if (rc != BadMatch) ErrorF ("[dix] %s: core conversion failed DFE (%d, %d). Skipping delivery.\n", keybd->name, event->any.type, rc); } unwind: free(core); free(xE); free(xi2); return; } int DeliverOneGrabbedEvent(InternalEvent *event, DeviceIntPtr dev, enum InputLevel level) { SpritePtr pSprite = dev->spriteInfo->sprite; int rc; xEvent *xE = NULL; int count = 0; int deliveries = 0; Mask mask; GrabInfoPtr grabinfo = &dev->deviceGrab; GrabPtr grab = grabinfo->grab; Mask filter; if (grab->grabtype != level) return 0; switch (level) { case XI2: rc = EventToXI2(event, &xE); count = 1; if (rc == Success) { int evtype = xi2_get_type(xE); mask = GetXI2MaskByte(grab->xi2mask, dev, evtype); filter = GetEventFilter(dev, xE); } break; case XI: if (grabinfo->fromPassiveGrab && grabinfo->implicitGrab) mask = grab->deviceMask; else mask = grab->eventMask; rc = EventToXI(event, &xE, &count); if (rc == Success) filter = GetEventFilter(dev, xE); break; case CORE: rc = EventToCore(event, &xE, &count); mask = grab->eventMask; if (rc == Success) filter = GetEventFilter(dev, xE); break; default: BUG_WARN_MSG(1, "Invalid input level %d\n", level); return 0; } if (rc == Success) { FixUpEventFromWindow(pSprite, xE, grab->window, None, TRUE); if (XaceHook(XACE_SEND_ACCESS, 0, dev, grab->window, xE, count) || XaceHook(XACE_RECEIVE_ACCESS, rClient(grab), grab->window, xE, count)) deliveries = 1; /* don't send, but pretend we did */ else if (level != CORE || !IsInterferingGrab(rClient(grab), dev, xE)) { deliveries = TryClientEvents(rClient(grab), dev, xE, count, mask, filter, grab); } } else BUG_WARN_MSG(rc != BadMatch, "%s: conversion to mode %d failed on %d with %d\n", dev->name, level, event->any.type, rc); free(xE); return deliveries; } /** * Deliver an event from a device that is currently grabbed. Uses * DeliverDeviceEvents() for further delivery if a ownerEvents is set on the * grab. If not, TryClientEvents() is used. * * @param deactivateGrab True if the device's grab should be deactivated. * * @return The number of events delivered. */ int DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, Bool deactivateGrab) { GrabPtr grab; GrabInfoPtr grabinfo; int deliveries = 0; DeviceIntPtr dev; SpritePtr pSprite = thisDev->spriteInfo->sprite; BOOL sendCore = FALSE; grabinfo = &thisDev->deviceGrab; grab = grabinfo->grab; if (grab->ownerEvents) { WindowPtr focus; /* Hack: Some pointer device have a focus class. So we need to check * for the type of event, to see if we really want to deliver it to * the focus window. For pointer events, the answer is no. */ if (IsPointerEvent(event)) focus = PointerRootWin; else if (thisDev->focus) { focus = thisDev->focus->win; if (focus == FollowKeyboardWin) focus = inputInfo.keyboard->focus->win; } else focus = PointerRootWin; if (focus == PointerRootWin) deliveries = DeliverDeviceEvents(pSprite->win, event, grab, NullWindow, thisDev); else if (focus && (focus == pSprite->win || IsParent(focus, pSprite->win))) deliveries = DeliverDeviceEvents(pSprite->win, event, grab, focus, thisDev); else if (focus) deliveries = DeliverDeviceEvents(focus, event, grab, focus, thisDev); } if (!deliveries) { sendCore = (IsMaster(thisDev) && thisDev->coreEvents); /* try core event */ if ((sendCore && grab->grabtype == CORE) || grab->grabtype != CORE) deliveries = DeliverOneGrabbedEvent(event, thisDev, grab->grabtype); if (deliveries && (event->any.type == ET_Motion)) thisDev->valuator->motionHintWindow = grab->window; } if (deliveries && !deactivateGrab && (event->any.type == ET_KeyPress || event->any.type == ET_KeyRelease || event->any.type == ET_ButtonPress || event->any.type == ET_ButtonRelease)) { switch (grabinfo->sync.state) { case FREEZE_BOTH_NEXT_EVENT: dev = GetPairedDevice(thisDev); if (dev) { FreezeThaw(dev, TRUE); if ((dev->deviceGrab.sync.state == FREEZE_BOTH_NEXT_EVENT) && (CLIENT_BITS(grab->resource) == CLIENT_BITS(dev->deviceGrab.grab->resource))) dev->deviceGrab.sync.state = FROZEN_NO_EVENT; else dev->deviceGrab.sync.other = grab; } /* fall through */ case FREEZE_NEXT_EVENT: grabinfo->sync.state = FROZEN_WITH_EVENT; FreezeThaw(thisDev, TRUE); *grabinfo->sync.event = event->device_event; break; } } return deliveries; } /* This function is used to set the key pressed or key released state - this is only used when the pressing of keys does not cause the device's processInputProc to be called, as in for example Mouse Keys. */ void FixKeyState(DeviceEvent *event, DeviceIntPtr keybd) { int key = event->detail.key; if (event->type == ET_KeyPress) { DebugF("FixKeyState: Key %d %s\n", key, ((event->type == ET_KeyPress) ? "down" : "up")); } if (event->type == ET_KeyPress) set_key_down(keybd, key, KEY_PROCESSED); else if (event->type == ET_KeyRelease) set_key_up(keybd, key, KEY_PROCESSED); else FatalError("Impossible keyboard event"); } #define AtMostOneClient \ (SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask) #define ManagerMask \ (SubstructureRedirectMask | ResizeRedirectMask) /** * Recalculate which events may be deliverable for the given window. * Recalculated mask is used for quicker determination which events may be * delivered to a window. * * The otherEventMasks on a WindowOptional is the combination of all event * masks set by all clients on the window. * deliverableEventMask is the combination of the eventMask and the * otherEventMask plus the events that may be propagated to the parent. * * Traverses to siblings and parents of the window. */ void RecalculateDeliverableEvents(WindowPtr pWin) { OtherClients *others; WindowPtr pChild; pChild = pWin; while (1) { if (pChild->optional) { pChild->optional->otherEventMasks = 0; for (others = wOtherClients(pChild); others; others = others->next) { pChild->optional->otherEventMasks |= others->mask; } } pChild->deliverableEvents = pChild->eventMask | wOtherEventMasks(pChild); if (pChild->parent) pChild->deliverableEvents |= (pChild->parent->deliverableEvents & ~wDontPropagateMask(pChild) & PropagateMask); if (pChild->firstChild) { pChild = pChild->firstChild; continue; } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } } /** * * \param value must conform to DeleteType */ int OtherClientGone(void *value, XID id) { OtherClientsPtr other, prev; WindowPtr pWin = (WindowPtr) value; prev = 0; for (other = wOtherClients(pWin); other; other = other->next) { if (other->resource == id) { if (prev) prev->next = other->next; else { if (!(pWin->optional->otherClients = other->next)) CheckWindowOptionalNeed(pWin); } free(other); RecalculateDeliverableEvents(pWin); return Success; } prev = other; } FatalError("client not on event list"); } int EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask) { Mask check; OtherClients *others; DeviceIntPtr dev; int rc; if (mask & ~AllEventMasks) { client->errorValue = mask; return BadValue; } check = (mask & ManagerMask); if (check) { rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW, pWin, RT_NONE, NULL, DixManageAccess); if (rc != Success) 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 ((wClient(pWin) != client) && (check & pWin->eventMask)) return BadAccess; for (others = wOtherClients(pWin); others; others = others->next) { if (!SameClient(others, client) && (check & others->mask)) return BadAccess; } } if (wClient(pWin) == client) { check = pWin->eventMask; pWin->eventMask = mask; } else { for (others = wOtherClients(pWin); others; others = others->next) { if (SameClient(others, client)) { check = others->mask; if (mask == 0) { FreeResource(others->resource, RT_NONE); return Success; } else others->mask = mask; goto maskSet; } } check = 0; if (!pWin->optional && !MakeWindowOptional(pWin)) return BadAlloc; others = malloc(sizeof(OtherClients)); if (!others) return BadAlloc; others->mask = mask; others->resource = FakeClientID(client->index); others->next = pWin->optional->otherClients; pWin->optional->otherClients = others; if (!AddResource(others->resource, RT_OTHERCLIENT, (void *) pWin)) return BadAlloc; } maskSet: if ((mask & PointerMotionHintMask) && !(check & PointerMotionHintMask)) { for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev->valuator && dev->valuator->motionHintWindow == pWin) dev->valuator->motionHintWindow = NullWindow; } } RecalculateDeliverableEvents(pWin); return Success; } int EventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask, Bool *checkOptional) { int i, freed; if (mask & ~PropagateMask) { client->errorValue = mask; return BadValue; } if (pWin->dontPropagate) DontPropagateRefCnts[pWin->dontPropagate]--; if (!mask) i = 0; else { for (i = DNPMCOUNT, freed = 0; --i > 0;) { if (!DontPropagateRefCnts[i]) freed = i; else if (mask == DontPropagateMasks[i]) break; } if (!i && freed) { i = freed; DontPropagateMasks[i] = mask; } } if (i || !mask) { pWin->dontPropagate = i; if (i) DontPropagateRefCnts[i]++; if (pWin->optional) { pWin->optional->dontPropagateMask = mask; *checkOptional = TRUE; } } else { if (!pWin->optional && !MakeWindowOptional(pWin)) { if (pWin->dontPropagate) DontPropagateRefCnts[pWin->dontPropagate]++; return BadAlloc; } pWin->dontPropagate = 0; pWin->optional->dontPropagateMask = mask; } RecalculateDeliverableEvents(pWin); return Success; } /** * Assembles an EnterNotify or LeaveNotify and sends it event to the client. * Uses the paired keyboard to get some additional information. */ void CoreEnterLeaveEvent(DeviceIntPtr mouse, int type, int mode, int detail, WindowPtr pWin, Window child) { xEvent event = { .u.u.type = type, .u.u.detail = detail }; WindowPtr focus; DeviceIntPtr keybd; GrabPtr grab = mouse->deviceGrab.grab; Mask mask; keybd = GetMaster(mouse, KEYBOARD_OR_FLOAT); if ((pWin == mouse->valuator->motionHintWindow) && (detail != NotifyInferior)) mouse->valuator->motionHintWindow = NullWindow; if (grab) { mask = (pWin == grab->window) ? grab->eventMask : 0; if (grab->ownerEvents) mask |= EventMaskForClient(pWin, rClient(grab)); } else { mask = pWin->eventMask | wOtherEventMasks(pWin); } event.u.enterLeave.time = currentTime.milliseconds; event.u.enterLeave.rootX = mouse->spriteInfo->sprite->hot.x; event.u.enterLeave.rootY = mouse->spriteInfo->sprite->hot.y; /* Counts on the same initial structure of crossing & button events! */ FixUpEventFromWindow(mouse->spriteInfo->sprite, &event, pWin, None, FALSE); /* Enter/Leave events always set child */ event.u.enterLeave.child = child; event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? ELFlagSameScreen : 0; event.u.enterLeave.state = mouse->button ? (mouse->button->state & 0x1f00) : 0; if (keybd) event.u.enterLeave.state |= XkbGrabStateFromRec(&keybd->key->xkbInfo->state); event.u.enterLeave.mode = mode; focus = (keybd) ? keybd->focus->win : None; if ((focus != NoneWin) && ((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin))) event.u.enterLeave.flags |= ELFlagFocus; if ((mask & GetEventFilter(mouse, &event))) { if (grab) TryClientEvents(rClient(grab), mouse, &event, 1, mask, GetEventFilter(mouse, &event), grab); else DeliverEventsToWindow(mouse, pWin, &event, 1, GetEventFilter(mouse, &event), NullGrab); } if ((type == EnterNotify) && (mask & KeymapStateMask)) { xKeymapEvent ke = { .type = KeymapNotify }; ClientPtr client = grab ? rClient(grab) : wClient(pWin); int rc; rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess); if (rc == Success) memcpy((char *) &ke.map[0], (char *) &keybd->key->down[1], 31); if (grab) TryClientEvents(rClient(grab), keybd, (xEvent *) &ke, 1, mask, KeymapStateMask, grab); else DeliverEventsToWindow(mouse, pWin, (xEvent *) &ke, 1, KeymapStateMask, NullGrab); } } void DeviceEnterLeaveEvent(DeviceIntPtr mouse, int sourceid, int type, int mode, int detail, WindowPtr pWin, Window child) { GrabPtr grab = mouse->deviceGrab.grab; xXIEnterEvent *event; WindowPtr focus; int filter; int btlen, len, i; DeviceIntPtr kbd; if ((mode == XINotifyPassiveGrab && type == XI_Leave) || (mode == XINotifyPassiveUngrab && type == XI_Enter)) return; btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; btlen = bytes_to_int32(btlen); len = sizeof(xXIEnterEvent) + btlen * 4; event = calloc(1, len); event->type = GenericEvent; event->extension = IReqCode; event->evtype = type; event->length = (len - sizeof(xEvent)) / 4; event->buttons_len = btlen; event->detail = detail; event->time = currentTime.milliseconds; event->deviceid = mouse->id; event->sourceid = sourceid; event->mode = mode; 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)) SetBit(&event[1], i); kbd = GetMaster(mouse, MASTER_KEYBOARD); if (kbd && kbd->key) { event->mods.base_mods = kbd->key->xkbInfo->state.base_mods; event->mods.latched_mods = kbd->key->xkbInfo->state.latched_mods; event->mods.locked_mods = kbd->key->xkbInfo->state.locked_mods; event->group.base_group = kbd->key->xkbInfo->state.base_group; event->group.latched_group = kbd->key->xkbInfo->state.latched_group; 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); filter = GetEventFilter(mouse, (xEvent *) event); if (grab && grab->grabtype == XI2) { Mask mask; mask = xi2mask_isset(grab->xi2mask, mouse, type); TryClientEvents(rClient(grab), mouse, (xEvent *) event, 1, mask, 1, grab); } else { if (!WindowXI2MaskIsset(mouse, pWin, (xEvent *) event)) goto out; DeliverEventsToWindow(mouse, pWin, (xEvent *) event, 1, filter, NullGrab); } out: free(event); } void CoreFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin) { xEvent event = { .u.u.type = type, .u.u.detail = detail }; event.u.focus.mode = mode; 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 = { .type = KeymapNotify }; ClientPtr client = wClient(pWin); int rc; rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess); if (rc == Success) memcpy((char *) &ke.map[0], (char *) &dev->key->down[1], 31); DeliverEventsToWindow(dev, pWin, (xEvent *) &ke, 1, KeymapStateMask, NullGrab); } } /** * Set the input focus to the given window. Subsequent keyboard events will be * delivered to the given window. * * Usually called from ProcSetInputFocus as result of a client request. If so, * the device is the inputInfo.keyboard. * If called from ProcXSetInputFocus as result of a client xinput request, the * device is set to the device specified by the client. * * @param client Client that requested input focus change. * @param dev Focus device. * @param focusID The window to obtain the focus. Can be PointerRoot or None. * @param revertTo Specifies where the focus reverts to when window becomes * unviewable. * @param ctime Specifies the time. * @param followOK True if pointer is allowed to follow the keyboard. */ int SetInputFocus(ClientPtr client, DeviceIntPtr dev, Window focusID, CARD8 revertTo, Time ctime, Bool followOK) { FocusClassPtr focus; WindowPtr focusWin; int mode, rc; TimeStamp time; DeviceIntPtr keybd; /* used for FollowKeyboard or FollowKeyboardWin */ UpdateCurrentTime(); if ((revertTo != RevertToParent) && (revertTo != RevertToPointerRoot) && (revertTo != RevertToNone) && ((revertTo != RevertToFollowKeyboard) || !followOK)) { client->errorValue = revertTo; return BadValue; } time = ClientTimeToServerTime(ctime); keybd = GetMaster(dev, KEYBOARD_OR_FLOAT); if ((focusID == None) || (focusID == PointerRoot)) focusWin = (WindowPtr) (long) focusID; else if ((focusID == FollowKeyboard) && followOK) { focusWin = keybd->focus->win; } else { rc = dixLookupWindow(&focusWin, focusID, client, DixSetAttrAccess); if (rc != Success) return rc; /* It is a match error to try to set the input focus to an unviewable window. */ if (!focusWin->realized) return BadMatch; } rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetFocusAccess); if (rc != Success) return Success; focus = dev->focus; if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, focus->time) == EARLIER)) return Success; mode = (dev->deviceGrab.grab) ? NotifyWhileGrabbed : NotifyNormal; if (focus->win == FollowKeyboardWin) { if (!ActivateFocusInGrab(dev, keybd->focus->win, focusWin)) DoFocusEvents(dev, keybd->focus->win, focusWin, mode); } else { if (!ActivateFocusInGrab(dev, focus->win, focusWin)) DoFocusEvents(dev, focus->win, focusWin, mode); } focus->time = time; focus->revert = revertTo; if (focusID == FollowKeyboard) focus->win = FollowKeyboardWin; else focus->win = focusWin; if ((focusWin == NoneWin) || (focusWin == PointerRootWin)) focus->traceGood = 0; else { int depth = 0; WindowPtr pWin; for (pWin = focusWin; pWin; pWin = pWin->parent) depth++; if (depth > focus->traceSize) { focus->traceSize = depth + 1; focus->trace = realloc(focus->trace, focus->traceSize * sizeof(WindowPtr)); } focus->traceGood = depth; for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--) focus->trace[depth] = pWin; } return Success; } /** * Server-side protocol handling for SetInputFocus request. * * Sets the input focus for the virtual core keyboard. */ int ProcSetInputFocus(ClientPtr client) { DeviceIntPtr kbd = PickKeyboard(client); REQUEST(xSetInputFocusReq); REQUEST_SIZE_MATCH(xSetInputFocusReq); return SetInputFocus(client, kbd, stuff->focus, stuff->revertTo, stuff->time, FALSE); } /** * Server-side protocol handling for GetInputFocus request. * * Sends the current input focus for the client's keyboard back to the * client. */ int ProcGetInputFocus(ClientPtr client) { DeviceIntPtr kbd = PickKeyboard(client); xGetInputFocusReply rep; FocusClassPtr focus = kbd->focus; int rc; /* REQUEST(xReq); */ REQUEST_SIZE_MATCH(xReq); rc = XaceHook(XACE_DEVICE_ACCESS, client, kbd, DixGetFocusAccess); if (rc != Success) return rc; 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; WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep); return Success; } /** * Server-side protocol handling for GrabPointer request. * * Sets an active grab on the client's ClientPointer and returns success * status to client. */ int ProcGrabPointer(ClientPtr client) { xGrabPointerReply rep; DeviceIntPtr device = PickPointer(client); GrabPtr grab; GrabMask mask; WindowPtr confineTo; BYTE status; REQUEST(xGrabPointerReq); int rc; REQUEST_SIZE_MATCH(xGrabPointerReq); UpdateCurrentTime(); if (stuff->eventMask & ~PointerGrabMask) { client->errorValue = stuff->eventMask; return BadValue; } if (stuff->confineTo == None) confineTo = NullWindow; else { rc = dixLookupWindow(&confineTo, stuff->confineTo, client, DixSetAttrAccess); if (rc != Success) return rc; } grab = device->deviceGrab.grab; if (grab && grab->confineTo && !confineTo) ConfineCursorToWindow(device, GetCurrentRootWindow(device), FALSE, FALSE); mask.core = stuff->eventMask; rc = GrabDevice(client, device, stuff->pointerMode, stuff->keyboardMode, stuff->grabWindow, stuff->ownerEvents, stuff->time, &mask, CORE, stuff->cursor, stuff->confineTo, &status); if (rc != Success) return rc; rep = (xGrabPointerReply) { .type = X_Reply, .status = status, .sequenceNumber = client->sequence, .length = 0 }; WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep); return Success; } /** * Server-side protocol handling for ChangeActivePointerGrab request. * * Changes properties of the grab hold by the client. If the client does not * hold an active grab on the device, nothing happens. */ int ProcChangeActivePointerGrab(ClientPtr client) { DeviceIntPtr device; GrabPtr grab; CursorPtr newCursor, oldCursor; REQUEST(xChangeActivePointerGrabReq); TimeStamp time; REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); if (stuff->eventMask & ~PointerGrabMask) { client->errorValue = stuff->eventMask; return BadValue; } if (stuff->cursor == None) newCursor = NullCursor; else { int rc = dixLookupResourceByType((void **) &newCursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = stuff->cursor; return rc; } } device = PickPointer(client); grab = device->deviceGrab.grab; if (!grab) return Success; if (!SameClient(grab, client)) return Success; time = ClientTimeToServerTime(stuff->time); if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, device->deviceGrab.grabTime) == EARLIER)) return Success; oldCursor = grab->cursor; grab->cursor = RefCursor(newCursor); PostNewCursor(device); if (oldCursor) FreeCursor(oldCursor, (Cursor) 0); grab->eventMask = stuff->eventMask; return Success; } /** * Server-side protocol handling for UngrabPointer request. * * Deletes a pointer grab on a device the client has grabbed. */ int ProcUngrabPointer(ClientPtr client) { DeviceIntPtr device = PickPointer(client); GrabPtr grab; TimeStamp time; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->deviceGrab.grab; time = ClientTimeToServerTime(stuff->id); if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->deviceGrab.grabTime) != EARLIER) && (grab) && SameClient(grab, client)) (*device->deviceGrab.DeactivateGrab) (device); return Success; } /** * Sets a grab on the given device. * * Called from ProcGrabKeyboard to work on the client's keyboard. * Called from ProcXGrabDevice to work on the device specified by the client. * * The parameters this_mode and other_mode represent the keyboard_mode and * pointer_mode parameters of XGrabKeyboard(). * See man page for details on all the parameters * * @param client Client that owns the grab. * @param dev The device to grab. * @param this_mode GrabModeSync or GrabModeAsync * @param other_mode GrabModeSync or GrabModeAsync * @param status Return code to be returned to the caller. * * @returns Success or BadValue or BadAlloc. */ int GrabDevice(ClientPtr client, DeviceIntPtr dev, unsigned pointer_mode, unsigned keyboard_mode, Window grabWindow, unsigned ownerEvents, Time ctime, GrabMask *mask, int grabtype, Cursor curs, Window confineToWin, CARD8 *status) { WindowPtr pWin, confineTo; GrabPtr grab; TimeStamp time; Mask access_mode = DixGrabAccess; int rc; GrabInfoPtr grabInfo = &dev->deviceGrab; CursorPtr cursor; UpdateCurrentTime(); if ((keyboard_mode != GrabModeSync) && (keyboard_mode != GrabModeAsync)) { client->errorValue = keyboard_mode; return BadValue; } if ((pointer_mode != GrabModeSync) && (pointer_mode != GrabModeAsync)) { client->errorValue = pointer_mode; return BadValue; } if ((ownerEvents != xFalse) && (ownerEvents != xTrue)) { client->errorValue = ownerEvents; return BadValue; } rc = dixLookupWindow(&pWin, grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; if (confineToWin == None) confineTo = NullWindow; else { rc = dixLookupWindow(&confineTo, confineToWin, client, DixSetAttrAccess); if (rc != Success) return rc; } if (curs == None) cursor = NullCursor; else { rc = dixLookupResourceByType((void **) &cursor, curs, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = curs; return rc; } access_mode |= DixForceAccess; } if (keyboard_mode == GrabModeSync || pointer_mode == GrabModeSync) access_mode |= DixFreezeAccess; rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); if (rc != Success) return rc; time = ClientTimeToServerTime(ctime); grab = grabInfo->grab; if (grab && grab->grabtype != grabtype) *status = AlreadyGrabbed; else if (grab && !SameClient(grab, client)) *status = AlreadyGrabbed; else if ((!pWin->realized) || (confineTo && !(confineTo->realized && BorderSizeNotEmpty(dev, confineTo)))) *status = GrabNotViewable; else if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, grabInfo->grabTime) == EARLIER)) *status = GrabInvalidTime; else if (grabInfo->sync.frozen && grabInfo->sync.other && !SameClient(grabInfo->sync.other, client)) *status = GrabFrozen; else { GrabPtr tempGrab; tempGrab = AllocGrab(NULL); if (tempGrab == NULL) return BadAlloc; tempGrab->next = NULL; tempGrab->window = pWin; tempGrab->resource = client->clientAsMask; tempGrab->ownerEvents = ownerEvents; tempGrab->keyboardMode = keyboard_mode; tempGrab->pointerMode = pointer_mode; if (grabtype == CORE) tempGrab->eventMask = mask->core; else if (grabtype == XI) tempGrab->eventMask = mask->xi; else xi2mask_merge(tempGrab->xi2mask, mask->xi2mask); tempGrab->device = dev; tempGrab->cursor = RefCursor(cursor); tempGrab->confineTo = confineTo; tempGrab->grabtype = grabtype; (*grabInfo->ActivateGrab) (dev, tempGrab, time, FALSE); *status = GrabSuccess; FreeGrab(tempGrab); } return Success; } /** * Server-side protocol handling for GrabKeyboard request. * * Grabs the client's keyboard and returns success status to client. */ int ProcGrabKeyboard(ClientPtr client) { xGrabKeyboardReply rep; BYTE status; REQUEST(xGrabKeyboardReq); int result; DeviceIntPtr keyboard = PickKeyboard(client); GrabMask mask; REQUEST_SIZE_MATCH(xGrabKeyboardReq); mask.core = KeyPressMask | KeyReleaseMask; result = GrabDevice(client, keyboard, stuff->pointerMode, stuff->keyboardMode, stuff->grabWindow, stuff->ownerEvents, stuff->time, &mask, CORE, None, None, &status); if (result != Success) return result; rep = (xGrabKeyboardReply) { .type = X_Reply, .status = status, .sequenceNumber = client->sequence, .length = 0 }; WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep); return Success; } /** * Server-side protocol handling for UngrabKeyboard request. * * Deletes a possible grab on the client's keyboard. */ int ProcUngrabKeyboard(ClientPtr client) { DeviceIntPtr device = PickKeyboard(client); GrabPtr grab; TimeStamp time; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->deviceGrab.grab; time = ClientTimeToServerTime(stuff->id); if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->deviceGrab.grabTime) != EARLIER) && (grab) && SameClient(grab, client) && grab->grabtype == CORE) (*device->deviceGrab.DeactivateGrab) (device); return Success; } /** * Server-side protocol handling for QueryPointer request. * * Returns the current state and position of the client's ClientPointer to the * client. */ int ProcQueryPointer(ClientPtr client) { xQueryPointerReply rep; WindowPtr pWin, t; DeviceIntPtr mouse = PickPointer(client); DeviceIntPtr keyboard; SpritePtr pSprite; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; rc = XaceHook(XACE_DEVICE_ACCESS, client, mouse, DixReadAccess); if (rc != Success && rc != BadAccess) return rc; keyboard = GetMaster(mouse, MASTER_KEYBOARD); pSprite = mouse->spriteInfo->sprite; if (mouse->valuator->motionHintWindow) MaybeStopHint(mouse, client); 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; rep.winY = pSprite->hot.y - pWin->drawable.y; for (t = pSprite->win; t; t = t->parent) if (t->parent == pWin) { rep.child = t->drawable.id; break; } } else { rep.sameScreen = xFalse; rep.winX = 0; rep.winY = 0; } #ifdef PANORAMIX if (!noPanoramiXExtension) { rep.rootX += screenInfo.screens[0]->x; rep.rootY += screenInfo.screens[0]->y; if (stuff->id == rep.root) { rep.winX += screenInfo.screens[0]->x; rep.winY += screenInfo.screens[0]->y; } } #endif if (rc == BadAccess) { rep.mask = 0; rep.child = None; rep.rootX = 0; rep.rootY = 0; rep.winX = 0; rep.winY = 0; } WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep); return Success; } /** * Initializes the device list and the DIX sprite to sane values. Allocates * trace memory used for quick window traversal. */ void InitEvents(void) { int i; QdEventPtr qe, tmp; inputInfo.numDevices = 0; inputInfo.devices = (DeviceIntPtr) NULL; inputInfo.off_devices = (DeviceIntPtr) NULL; inputInfo.keyboard = (DeviceIntPtr) NULL; inputInfo.pointer = (DeviceIntPtr) NULL; for (i = 0; i < MAXDEVICES; i++) { DeviceIntRec dummy; memcpy(&event_filters[i], default_filter, sizeof(default_filter)); dummy.id = i; NoticeTime(&dummy, currentTime); LastEventTimeToggleResetFlag(i, FALSE); } syncEvents.replayDev = (DeviceIntPtr) NULL; syncEvents.replayWin = NullWindow; if (syncEvents.pending.next) xorg_list_for_each_entry_safe(qe, tmp, &syncEvents.pending, next) free(qe); xorg_list_init(&syncEvents.pending); syncEvents.playingEvents = FALSE; syncEvents.time.months = 0; syncEvents.time.milliseconds = 0; /* hardly matters */ currentTime.months = 0; currentTime.milliseconds = GetTimeInMillis(); for (i = 0; i < DNPMCOUNT; i++) { DontPropagateMasks[i] = 0; DontPropagateRefCnts[i] = 0; } InputEventList = InitEventList(GetMaximumEventsNum()); if (!InputEventList) FatalError("[dix] Failed to allocate input event list.\n"); } void CloseDownEvents(void) { FreeEventList(InputEventList, GetMaximumEventsNum()); InputEventList = NULL; } #define SEND_EVENT_BIT 0x80 /** * Server-side protocol handling for SendEvent request. * * Locates the window to send the event to and forwards the event. */ int ProcSendEvent(ClientPtr client) { WindowPtr pWin; WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ DeviceIntPtr dev = PickPointer(client); DeviceIntPtr keybd = GetMaster(dev, MASTER_KEYBOARD); SpritePtr pSprite = dev->spriteInfo->sprite; REQUEST(xSendEventReq); REQUEST_SIZE_MATCH(xSendEventReq); /* libXext and other extension libraries may set the bit indicating * that this event came from a SendEvent request so remove it * since otherwise the event type may fail the range checks * and cause an invalid BadValue error to be returned. * * This is safe to do since we later add the SendEvent bit (0x80) * back in once we send the event to the client */ stuff->event.u.u.type &= ~(SEND_EVENT_BIT); /* The client's event type must be a core event type or one defined by an extension. */ if (!((stuff->event.u.u.type > X_Reply && stuff->event.u.u.type < LASTEvent) || (stuff->event.u.u.type >= EXTENSION_EVENT_BASE && stuff->event.u.u.type < (unsigned) lastEvent))) { client->errorValue = stuff->event.u.u.type; return BadValue; } if (stuff->event.u.u.type == ClientMessage && stuff->event.u.u.detail != 8 && stuff->event.u.u.detail != 16 && stuff->event.u.u.detail != 32) { client->errorValue = stuff->event.u.u.detail; return BadValue; } if (stuff->eventMask & ~AllEventMasks) { client->errorValue = stuff->eventMask; return BadValue; } if (stuff->destination == PointerWindow) pWin = pSprite->win; else if (stuff->destination == InputFocus) { WindowPtr inputFocus = (keybd) ? keybd->focus->win : NoneWin; if (inputFocus == NoneWin) return Success; /* If the input focus is PointerRootWin, send the event to where the pointer is if possible, then perhaps propogate up to root. */ if (inputFocus == PointerRootWin) inputFocus = GetCurrentRootWindow(dev); if (IsParent(inputFocus, pSprite->win)) { effectiveFocus = inputFocus; pWin = pSprite->win; } else effectiveFocus = pWin = inputFocus; } else dixLookupWindow(&pWin, stuff->destination, client, DixSendAccess); if (!pWin) return BadWindow; if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) { client->errorValue = stuff->propagate; return BadValue; } stuff->event.u.u.type |= SEND_EVENT_BIT; if (stuff->propagate) { for (; pWin; pWin = pWin->parent) { if (XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, &stuff->event, 1)) return Success; if (DeliverEventsToWindow(dev, pWin, &stuff->event, 1, stuff->eventMask, NullGrab)) return Success; if (pWin == effectiveFocus) return Success; stuff->eventMask &= ~wDontPropagateMask(pWin); if (!stuff->eventMask) break; } } else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, &stuff->event, 1)) DeliverEventsToWindow(dev, pWin, &stuff->event, 1, stuff->eventMask, NullGrab); return Success; } /** * Server-side protocol handling for UngrabKey request. * * Deletes a passive grab for the given key. Works on the * client's keyboard. */ int ProcUngrabKey(ClientPtr client) { REQUEST(xUngrabKeyReq); WindowPtr pWin; GrabPtr tempGrab; DeviceIntPtr keybd = PickKeyboard(client); int rc; REQUEST_SIZE_MATCH(xUngrabKeyReq); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixGetAttrAccess); if (rc != Success) return rc; if (((stuff->key > keybd->key->xkbInfo->desc->max_key_code) || (stuff->key < keybd->key->xkbInfo->desc->min_key_code)) && (stuff->key != AnyKey)) { client->errorValue = stuff->key; return BadValue; } if ((stuff->modifiers != AnyModifier) && (stuff->modifiers & ~AllModifiersMask)) { client->errorValue = stuff->modifiers; return BadValue; } tempGrab = AllocGrab(NULL); if (!tempGrab) return BadAlloc; tempGrab->resource = client->clientAsMask; tempGrab->device = keybd; tempGrab->window = pWin; tempGrab->modifiersDetail.exact = stuff->modifiers; tempGrab->modifiersDetail.pMask = NULL; tempGrab->modifierDevice = keybd; tempGrab->type = KeyPress; tempGrab->grabtype = CORE; tempGrab->detail.exact = stuff->key; tempGrab->detail.pMask = NULL; tempGrab->next = NULL; if (!DeletePassiveGrabFromList(tempGrab)) rc = BadAlloc; FreeGrab(tempGrab); return rc; } /** * Server-side protocol handling for GrabKey request. * * Creates a grab for the client's keyboard and adds it to the list of passive * grabs. */ int ProcGrabKey(ClientPtr client) { WindowPtr pWin; REQUEST(xGrabKeyReq); GrabPtr grab; DeviceIntPtr keybd = PickKeyboard(client); int rc; GrabParameters param; GrabMask mask; REQUEST_SIZE_MATCH(xGrabKeyReq); 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) return rc; if (((stuff->key > keybd->key->xkbInfo->desc->max_key_code) || (stuff->key < keybd->key->xkbInfo->desc->min_key_code)) && (stuff->key != AnyKey)) { client->errorValue = stuff->key; return BadValue; } rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; mask.core = (KeyPressMask | KeyReleaseMask); grab = CreateGrab(client->index, keybd, keybd, pWin, CORE, &mask, ¶m, KeyPress, stuff->key, NullWindow, NullCursor); if (!grab) return BadAlloc; return AddPassiveGrabToList(client, grab); } /** * Server-side protocol handling for GrabButton request. * * Creates a grab for the client's ClientPointer and adds it as a passive grab * to the list. */ int ProcGrabButton(ClientPtr client) { WindowPtr pWin, confineTo; REQUEST(xGrabButtonReq); CursorPtr cursor; GrabPtr grab; DeviceIntPtr ptr, modifierDevice; Mask access_mode = DixGrabAccess; GrabMask mask; GrabParameters param; int rc; REQUEST_SIZE_MATCH(xGrabButtonReq); if ((stuff->pointerMode != GrabModeSync) && (stuff->pointerMode != GrabModeAsync)) { client->errorValue = stuff->pointerMode; return BadValue; } if ((stuff->keyboardMode != GrabModeSync) && (stuff->keyboardMode != GrabModeAsync)) { client->errorValue = stuff->keyboardMode; return BadValue; } if ((stuff->modifiers != AnyModifier) && (stuff->modifiers & ~AllModifiersMask)) { client->errorValue = stuff->modifiers; return BadValue; } if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) { client->errorValue = stuff->ownerEvents; return BadValue; } if (stuff->eventMask & ~PointerGrabMask) { client->errorValue = stuff->eventMask; return BadValue; } rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; if (stuff->confineTo == None) confineTo = NullWindow; else { rc = dixLookupWindow(&confineTo, stuff->confineTo, client, DixSetAttrAccess); if (rc != Success) return rc; } if (stuff->cursor == None) cursor = NullCursor; else { rc = dixLookupResourceByType((void **) &cursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = stuff->cursor; return rc; } access_mode |= DixForceAccess; } ptr = PickPointer(client); modifierDevice = GetMaster(ptr, MASTER_KEYBOARD); if (stuff->pointerMode == GrabModeSync || stuff->keyboardMode == GrabModeSync) access_mode |= DixFreezeAccess; rc = XaceHook(XACE_DEVICE_ACCESS, client, ptr, access_mode); if (rc != Success) return rc; param = (GrabParameters) { .grabtype = CORE, .ownerEvents = stuff->ownerEvents, .this_device_mode = stuff->keyboardMode, .other_devices_mode = stuff->pointerMode, .modifiers = stuff->modifiers }; mask.core = stuff->eventMask; grab = CreateGrab(client->index, ptr, modifierDevice, pWin, CORE, &mask, ¶m, ButtonPress, stuff->button, confineTo, cursor); if (!grab) return BadAlloc; return AddPassiveGrabToList(client, grab); } /** * Server-side protocol handling for UngrabButton request. * * Deletes a passive grab on the client's ClientPointer from the list. */ int ProcUngrabButton(ClientPtr client) { REQUEST(xUngrabButtonReq); WindowPtr pWin; GrabPtr tempGrab; int rc; DeviceIntPtr ptr; REQUEST_SIZE_MATCH(xUngrabButtonReq); if ((stuff->modifiers != AnyModifier) && (stuff->modifiers & ~AllModifiersMask)) { client->errorValue = stuff->modifiers; return BadValue; } rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixReadAccess); if (rc != Success) return rc; ptr = PickPointer(client); tempGrab = AllocGrab(NULL); if (!tempGrab) return BadAlloc; tempGrab->resource = client->clientAsMask; tempGrab->device = ptr; tempGrab->window = pWin; tempGrab->modifiersDetail.exact = stuff->modifiers; tempGrab->modifiersDetail.pMask = NULL; tempGrab->modifierDevice = GetMaster(ptr, MASTER_KEYBOARD); tempGrab->type = ButtonPress; tempGrab->detail.exact = stuff->button; tempGrab->grabtype = CORE; tempGrab->detail.pMask = NULL; tempGrab->next = NULL; if (!DeletePassiveGrabFromList(tempGrab)) rc = BadAlloc; FreeGrab(tempGrab); return rc; } /** * Deactivate any grab that may be on the window, remove the focus. * Delete any XInput extension events from the window too. Does not change the * window mask. Use just before the window is deleted. * * If freeResources is set, passive grabs on the window are deleted. * * @param pWin The window to delete events from. * @param freeResources True if resources associated with the window should be * deleted. */ void DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) { WindowPtr parent; DeviceIntPtr mouse = inputInfo.pointer; DeviceIntPtr keybd = inputInfo.keyboard; FocusClassPtr focus; OtherClientsPtr oc; GrabPtr passive; GrabPtr grab; /* Deactivate any grabs performed on this window, before making any input focus changes. */ grab = mouse->deviceGrab.grab; if (grab && ((grab->window == pWin) || (grab->confineTo == pWin))) (*mouse->deviceGrab.DeactivateGrab) (mouse); /* Deactivating a keyboard grab should cause focus events. */ grab = keybd->deviceGrab.grab; if (grab && (grab->window == pWin)) (*keybd->deviceGrab.DeactivateGrab) (keybd); /* And now the real devices */ for (mouse = inputInfo.devices; mouse; mouse = mouse->next) { grab = mouse->deviceGrab.grab; if (grab && ((grab->window == pWin) || (grab->confineTo == pWin))) (*mouse->deviceGrab.DeactivateGrab) (mouse); } for (keybd = inputInfo.devices; keybd; keybd = keybd->next) { 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 ((pWin == focus->win) && (pWin->parent != NullWindow)) { int focusEventMode = NotifyNormal; /* If a grab is in progress, then alter the mode of focus events. */ if (keybd->deviceGrab.grab) focusEventMode = NotifyWhileGrabbed; switch (focus->revert) { case RevertToNone: DoFocusEvents(keybd, pWin, NoneWin, focusEventMode); focus->win = NoneWin; focus->traceGood = 0; break; case RevertToParent: parent = pWin; do { 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 */ #ifdef NOTDEF || wClient(parent)->clientGone #endif ); if (!ActivateFocusInGrab(keybd, pWin, parent)) DoFocusEvents(keybd, pWin, parent, focusEventMode); focus->win = parent; focus->revert = RevertToNone; break; case RevertToPointerRoot: if (!ActivateFocusInGrab(keybd, pWin, PointerRootWin)) DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode); focus->win = PointerRootWin; focus->traceGood = 0; break; } } } if (IsPointerDevice(keybd)) { if (keybd->valuator->motionHintWindow == pWin) keybd->valuator->motionHintWindow = NullWindow; } } if (freeResources) { if (pWin->dontPropagate) DontPropagateRefCnts[pWin->dontPropagate]--; while ((oc = wOtherClients(pWin))) FreeResource(oc->resource, RT_NONE); while ((passive = wPassiveGrabs(pWin))) FreeResource(passive->resource, RT_NONE); } DeleteWindowFromAnyExtEvents(pWin, freeResources); } /** * Call this whenever some window at or below pWin has changed geometry. If * there is a grab on the window, the cursor will be re-confined into the * window. */ void CheckCursorConfinement(WindowPtr pWin) { GrabPtr grab; WindowPtr confineTo; DeviceIntPtr pDev; #ifdef PANORAMIX if (!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return; #endif for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { grab = pDev->deviceGrab.grab; if (grab && (confineTo = grab->confineTo)) { if (!BorderSizeNotEmpty(pDev, confineTo)) (*pDev->deviceGrab.DeactivateGrab) (pDev); else if ((pWin == confineTo) || IsParent(pWin, confineTo)) ConfineCursorToWindow(pDev, confineTo, TRUE, TRUE); } } } } Mask EventMaskForClient(WindowPtr pWin, ClientPtr client) { OtherClientsPtr other; if (wClient(pWin) == client) return pWin->eventMask; for (other = wOtherClients(pWin); other; other = other->next) { if (SameClient(other, client)) return other->mask; } return 0; } /** * Server-side protocol handling for RecolorCursor request. */ int ProcRecolorCursor(ClientPtr client) { CursorPtr pCursor; int rc, nscr; ScreenPtr pscr; Bool displayed; SpritePtr pSprite = PickPointer(client)->spriteInfo->sprite; REQUEST(xRecolorCursorReq); REQUEST_SIZE_MATCH(xRecolorCursorReq); rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, RT_CURSOR, client, DixWriteAccess); if (rc != Success) { client->errorValue = stuff->cursor; return rc; } pCursor->foreRed = stuff->foreRed; pCursor->foreGreen = stuff->foreGreen; pCursor->foreBlue = stuff->foreBlue; pCursor->backRed = stuff->backRed; pCursor->backGreen = stuff->backGreen; pCursor->backBlue = stuff->backBlue; for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { pscr = screenInfo.screens[nscr]; #ifdef PANORAMIX if (!noPanoramiXExtension) displayed = (pscr == pSprite->screen); else #endif displayed = (pscr == pSprite->hotPhys.pScreen); (*pscr->RecolorCursor) (PickPointer(client), pscr, pCursor, (pCursor == pSprite->current) && displayed); } return Success; } /** * Write the given events to a client, swapping the byte order if necessary. * To swap the byte ordering, a callback is called that has to be set up for * the given event type. * * In the case of DeviceMotionNotify trailed by DeviceValuators, the events * can be more than one. Usually it's just one event. * * Do not modify the event structure passed in. See comment below. * * @param pClient Client to send events to. * @param count Number of events. * @param events The event list. */ void WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) { #ifdef PANORAMIX xEvent eventCopy; #endif xEvent *eventTo, *eventFrom; int i, eventlength = sizeof(xEvent); if (!pClient || pClient == serverClient || pClient->clientGone) return; for (i = 0; i < count; i++) if ((events[i].u.u.type & 0x7f) != KeymapNotify) events[i].u.u.sequenceNumber = pClient->sequence; /* Let XKB rewrite the state, as it depends on client preferences. */ XkbFilterEvents(pClient, count, events); #ifdef PANORAMIX if (!noPanoramiXExtension && (screenInfo.screens[0]->x || screenInfo.screens[0]->y)) { switch (events->u.u.type) { case MotionNotify: case ButtonPress: case ButtonRelease: case KeyPress: case KeyRelease: case EnterNotify: case LeaveNotify: /* When multiple clients want the same event DeliverEventsToWindow passes the same event structure multiple times so we can't modify the one passed to us */ count = 1; /* should always be 1 */ memcpy(&eventCopy, events, sizeof(xEvent)); eventCopy.u.keyButtonPointer.rootX += screenInfo.screens[0]->x; eventCopy.u.keyButtonPointer.rootY += screenInfo.screens[0]->y; if (eventCopy.u.keyButtonPointer.event == eventCopy.u.keyButtonPointer.root) { eventCopy.u.keyButtonPointer.eventX += screenInfo.screens[0]->x; eventCopy.u.keyButtonPointer.eventY += screenInfo.screens[0]->y; } events = &eventCopy; break; default: break; } } #endif if (EventCallback) { EventInfoRec eventinfo; eventinfo.client = pClient; eventinfo.events = events; eventinfo.count = count; CallCallbacks(&EventCallback, (void *) &eventinfo); } #ifdef XSERVER_DTRACE if (XSERVER_SEND_EVENT_ENABLED()) { for (i = 0; i < count; i++) { XSERVER_SEND_EVENT(pClient->index, events[i].u.u.type, &events[i]); } } #endif /* Just a safety check to make sure we only have one GenericEvent, it just * makes things easier for me right now. (whot) */ for (i = 1; i < count; i++) { if (events[i].u.u.type == GenericEvent) { ErrorF("[dix] TryClientEvents: Only one GenericEvent at a time.\n"); return; } } if (events->u.u.type == GenericEvent) { eventlength += ((xGenericEvent *) events)->length * 4; } if (pClient->swapped) { if (eventlength > swapEventLen) { swapEventLen = eventlength; swapEvent = realloc(swapEvent, swapEventLen); if (!swapEvent) { FatalError("WriteEventsToClient: Out of memory.\n"); return; } } for (i = 0; i < count; i++) { eventFrom = &events[i]; eventTo = swapEvent; /* Remember to strip off the leading bit of type in case this event was sent with "SendEvent." */ (*EventSwapVector[eventFrom->u.u.type & 0177]) (eventFrom, 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, events); } } /* * Set the client pointer for the given client. * * A client can have exactly one ClientPointer. Each time a * request/reply/event is processed and the choice of devices is ambiguous * (e.g. QueryPointer request), the server will pick the ClientPointer (see * PickPointer()). * If a keyboard is needed, the first keyboard paired with the CP is used. */ int SetClientPointer(ClientPtr client, DeviceIntPtr device) { int rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixUseAccess); if (rc != Success) return rc; if (!IsMaster(device)) { ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n"); return BadDevice; } else if (!device->spriteInfo->spriteOwner) { ErrorF("[dix] Device %d does not have a sprite. " "Cannot be ClientPointer\n", device->id); return BadDevice; } client->clientPtr = device; return Success; } /* PickPointer will pick an appropriate pointer for the given client. * * An "appropriate device" is (in order of priority): * 1) A device the given client has a core grab on. * 2) A device set as ClientPointer for the given client. * 3) The first master device. */ DeviceIntPtr PickPointer(ClientPtr client) { DeviceIntPtr it = inputInfo.devices; /* First, check if the client currently has a grab on a device. Even * keyboards count. */ for (it = inputInfo.devices; it; it = it->next) { GrabPtr grab = it->deviceGrab.grab; if (grab && grab->grabtype == CORE && SameClient(grab, client)) { it = GetMaster(it, MASTER_POINTER); return it; /* Always return a core grabbed device */ } } if (!client->clientPtr) { it = inputInfo.devices; while (it) { if (IsMaster(it) && it->spriteInfo->spriteOwner) { client->clientPtr = it; break; } it = it->next; } } return client->clientPtr; } /* PickKeyboard will pick an appropriate keyboard for the given client by * searching the list of devices for the keyboard device that is paired with * the client's pointer. */ DeviceIntPtr PickKeyboard(ClientPtr client) { DeviceIntPtr ptr = PickPointer(client); DeviceIntPtr kbd = GetMaster(ptr, MASTER_KEYBOARD); if (!kbd) { ErrorF("[dix] ClientPointer not paired with a keyboard. This " "is a bug.\n"); } return kbd; } /* A client that has one or more core grabs does not get core events from * devices it does not have a grab on. Legacy applications behave bad * otherwise because they are not used to it and the events interfere. * Only applies for core events. * * Return true if a core event from the device would interfere and should not * be delivered. */ Bool IsInterferingGrab(ClientPtr client, DeviceIntPtr dev, xEvent *event) { DeviceIntPtr it = inputInfo.devices; switch (event->u.u.type) { case KeyPress: case KeyRelease: case ButtonPress: case ButtonRelease: case MotionNotify: case EnterNotify: case LeaveNotify: break; default: return FALSE; } if (dev->deviceGrab.grab && SameClient(dev->deviceGrab.grab, client)) return FALSE; while (it) { if (it != dev) { if (it->deviceGrab.grab && SameClient(it->deviceGrab.grab, client) && !it->deviceGrab.fromPassiveGrab) { if ((IsPointerDevice(it) && IsPointerDevice(dev)) || (IsKeyboardDevice(it) && IsKeyboardDevice(dev))) return TRUE; } } it = it->next; } 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); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/window.c���������������������������������������������������������������������0000664�0001751�0001751�00000336103�12456571574�013276� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2006, 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 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. */ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "misc.h" #include "scrnintstr.h" #include "os.h" #include "regionstr.h" #include "validate.h" #include "windowstr.h" #include "propertyst.h" #include "input.h" #include "inputstr.h" #include "resource.h" #include "colormapst.h" #include "cursorstr.h" #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" #include "mivalidate.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #include "dixevents.h" #include "globals.h" #include "mi.h" /* miPaintWindow */ #ifdef COMPOSITE #include "compint.h" #endif #include "selection.h" #include "privates.h" #include "xace.h" #include "exevents.h" #include <X11/Xatom.h> /* must come after server includes */ /****** * Window stuff for server * * CreateRootWindow, CreateWindow, ChangeWindowAttributes, * GetWindowAttributes, DeleteWindow, DestroySubWindows, * HandleSaveSet, ReparentWindow, MapWindow, MapSubWindows, * UnmapWindow, UnmapSubWindows, ConfigureWindow, CirculateWindow, * ChangeWindowDeviceCursor ******/ Bool bgNoneRoot = FALSE; static unsigned char _back_lsb[4] = { 0x88, 0x22, 0x44, 0x11 }; static unsigned char _back_msb[4] = { 0x11, 0x44, 0x22, 0x88 }; static Bool WindowParentHasDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCurs); static Bool WindowSeekDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, DevCursNodePtr * pNode, DevCursNodePtr * pPrev); int screenIsSaved = SCREEN_SAVER_OFF; static Bool TileScreenSaver(ScreenPtr pScreen, int kind); #define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ CWDontPropagate | CWOverrideRedirect | CWCursor ) #define BOXES_OVERLAP(b1, b2) \ (!( ((b1)->x2 <= (b2)->x1) || \ ( ((b1)->x1 >= (b2)->x2)) || \ ( ((b1)->y2 <= (b2)->y1)) || \ ( ((b1)->y1 >= (b2)->y2)) ) ) #define RedirectSend(pWin) \ ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureRedirectMask) #define SubSend(pWin) \ ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask) #define StrSend(pWin) \ ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask) #define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent)) #ifdef COMPOSITE static const char *overlay_win_name = "<composite overlay>"; #endif static const char * get_window_name(WindowPtr pWin) { #define WINDOW_NAME_BUF_LEN 512 PropertyPtr prop; static char buf[WINDOW_NAME_BUF_LEN]; int len; #ifdef COMPOSITE CompScreenPtr comp_screen = GetCompScreen(pWin->drawable.pScreen); if (comp_screen && pWin == comp_screen->pOverlayWin) return overlay_win_name; #endif for (prop = wUserProps(pWin); prop; prop = prop->next) { if (prop->propertyName == XA_WM_NAME && prop->type == XA_STRING && prop->data) { len = min(prop->size, WINDOW_NAME_BUF_LEN - 1); memcpy(buf, prop->data, len); buf[len] = '\0'; return buf; } } return NULL; #undef WINDOW_NAME_BUF_LEN } static void log_window_info(WindowPtr pWin, int depth) { int i; const char *win_name, *visibility; BoxPtr rects; ScreenPtr pScreen = pWin->drawable.pScreen; for (i = 0; i < (depth << 2); i++) ErrorF(" "); win_name = get_window_name(pWin); ErrorF("win 0x%.8x (%s), [%d, %d] to [%d, %d]", (unsigned) pWin->drawable.id, win_name ? win_name : "no name", pWin->drawable.x, pWin->drawable.y, pWin->drawable.x + pWin->drawable.width, pWin->drawable.y + pWin->drawable.height); if (pWin->overrideRedirect) ErrorF(" (override redirect)"); #ifdef COMPOSITE if (pWin->redirectDraw) ErrorF(" (%s compositing: pixmap %x)", (pWin->redirectDraw == RedirectDrawAutomatic) ? "automatic" : "manual", (unsigned) pScreen->GetWindowPixmap(pWin)->drawable.id); #endif switch (pWin->visibility) { case VisibilityUnobscured: visibility = "unobscured"; break; case VisibilityPartiallyObscured: visibility = "partially obscured"; break; case VisibilityFullyObscured: visibility = "fully obscured"; break; case VisibilityNotViewable: visibility = "unviewable"; break; } ErrorF(", %s", visibility); if (REGION_NOTEMPTY(pScreen, &pWin->clipList)) { ErrorF(", clip list:"); rects = REGION_RECTS(&pWin->clipList); for (i = 0; i < REGION_NUM_RECTS(&pWin->clipList); i++) ErrorF(" [(%d, %d) to (%d, %d)]", rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2); ErrorF("; extents [(%d, %d) to (%d, %d)]", pWin->clipList.extents.x1, pWin->clipList.extents.y1, pWin->clipList.extents.x2, pWin->clipList.extents.y2); } ErrorF("\n"); } void PrintWindowTree(void) { int scrnum, depth; ScreenPtr pScreen; WindowPtr pWin; for (scrnum = 0; scrnum < screenInfo.numScreens; scrnum++) { pScreen = screenInfo.screens[scrnum]; ErrorF("[dix] Dumping windows for screen %d (pixmap %x):\n", scrnum, (unsigned) pScreen->GetScreenPixmap(pScreen)->drawable.id); pWin = pScreen->root; depth = 1; while (pWin) { log_window_info(pWin, depth); if (pWin->firstChild) { pWin = pWin->firstChild; depth++; continue; } while (pWin && !pWin->nextSib) { pWin = pWin->parent; depth--; } if (!pWin) break; pWin = pWin->nextSib; } } } int TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, void *data) { int result; WindowPtr pChild; if (!(pChild = pWin)) return WT_NOMATCH; while (1) { result = (*func) (pChild, data); if (result == WT_STOPWALKING) return WT_STOPWALKING; if ((result == WT_WALKCHILDREN) && pChild->firstChild) { pChild = pChild->firstChild; continue; } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } return WT_NOMATCH; } /***** * WalkTree * Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on * each window. If FUNC returns WT_WALKCHILDREN, traverse the children, * if it returns WT_DONTWALKCHILDREN, dont. If it returns WT_STOPWALKING * exit WalkTree. Does depth-first traverse. *****/ int WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, void *data) { return (TraverseTree(pScreen->root, func, data)); } /* hack for forcing backing store on all windows */ int defaultBackingStore = NotUseful; /* hack to force no backing store */ Bool disableBackingStore = FALSE; Bool enableBackingStore = FALSE; static void SetWindowToDefaults(WindowPtr pWin) { pWin->prevSib = NullWindow; pWin->firstChild = NullWindow; pWin->lastChild = NullWindow; pWin->valdata = NULL; pWin->optional = NULL; pWin->cursorIsNone = TRUE; pWin->backingStore = NotUseful; pWin->backStorage = 0; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ pWin->viewable = FALSE; pWin->visibility = VisibilityNotViewable; pWin->overrideRedirect = FALSE; pWin->saveUnder = FALSE; pWin->bitGravity = ForgetGravity; pWin->winGravity = NorthWestGravity; pWin->eventMask = 0; pWin->deliverableEvents = 0; pWin->dontPropagate = 0; pWin->forcedBS = FALSE; pWin->redirectDraw = RedirectDrawNone; pWin->forcedBG = FALSE; #ifdef ROOTLESS pWin->rootlessUnhittable = FALSE; #endif #ifdef COMPOSITE pWin->damagedDescendants = FALSE; #endif } static void MakeRootTile(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; GCPtr pGC; unsigned char back[128]; int len = BitmapBytePad(sizeof(long)); unsigned char *from, *to; int i, j; pWin->background.pixmap = (*pScreen->CreatePixmap) (pScreen, 4, 4, pScreen->rootDepth, 0); pWin->backgroundState = BackgroundPixmap; pGC = GetScratchGC(pScreen->rootDepth, pScreen); if (!pWin->background.pixmap || !pGC) FatalError("could not create root tile"); { ChangeGCVal attributes[2]; attributes[0].val = pScreen->whitePixel; attributes[1].val = pScreen->blackPixel; (void) ChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes); } ValidateGC((DrawablePtr) pWin->background.pixmap, pGC); from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb; to = back; for (i = 4; i > 0; i--, from++) for (j = len; j > 0; j--) *to++ = *from; (*pGC->ops->PutImage) ((DrawablePtr) pWin->background.pixmap, pGC, 1, 0, 0, len, 4, 0, XYBitmap, (char *) back); FreeScratchGC(pGC); } /***** * CreateRootWindow * Makes a window at initialization time for specified screen *****/ Bool CreateRootWindow(ScreenPtr pScreen) { WindowPtr pWin; BoxRec box; PixmapFormatRec *format; pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW); if (!pWin) return FALSE; pScreen->screensaver.pWindow = NULL; pScreen->screensaver.wid = FakeClientID(0); pScreen->screensaver.ExternalScreenSaver = NULL; screenIsSaved = SCREEN_SAVER_OFF; pScreen->root = pWin; pWin->drawable.pScreen = pScreen; pWin->drawable.type = DRAWABLE_WINDOW; pWin->drawable.depth = pScreen->rootDepth; for (format = screenInfo.formats; format->depth != pScreen->rootDepth; format++); pWin->drawable.bitsPerPixel = format->bitsPerPixel; pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; pWin->parent = NullWindow; SetWindowToDefaults(pWin); pWin->optional = malloc(sizeof(WindowOptRec)); if (!pWin->optional) return FALSE; pWin->optional->dontPropagateMask = 0; pWin->optional->otherEventMasks = 0; pWin->optional->otherClients = NULL; pWin->optional->passiveGrabs = NULL; pWin->optional->userProps = NULL; pWin->optional->backingBitPlanes = ~0L; pWin->optional->backingPixel = 0; pWin->optional->boundingShape = NULL; pWin->optional->clipShape = NULL; pWin->optional->inputShape = NULL; pWin->optional->inputMasks = NULL; pWin->optional->deviceCursors = NULL; pWin->optional->colormap = pScreen->defColormap; pWin->optional->visual = pScreen->rootVisual; pWin->nextSib = NullWindow; pWin->drawable.id = FakeClientID(0); pWin->origin.x = pWin->origin.y = 0; pWin->drawable.height = pScreen->height; pWin->drawable.width = pScreen->width; pWin->drawable.x = pWin->drawable.y = 0; box.x1 = 0; box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; RegionInit(&pWin->clipList, &box, 1); RegionInit(&pWin->winSize, &box, 1); RegionInit(&pWin->borderSize, &box, 1); RegionInit(&pWin->borderClip, &box, 1); pWin->drawable.class = InputOutput; pWin->optional->visual = pScreen->rootVisual; pWin->backgroundState = BackgroundPixel; pWin->background.pixel = pScreen->whitePixel; pWin->borderIsPixel = TRUE; pWin->border.pixel = pScreen->blackPixel; pWin->borderWidth = 0; /* security creation/labeling check */ if (XaceHook(XACE_RESOURCE_ACCESS, serverClient, pWin->drawable.id, RT_WINDOW, pWin, RT_NONE, NULL, DixCreateAccess)) return FALSE; if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pWin)) return FALSE; if (disableBackingStore) pScreen->backingStoreSupport = NotUseful; if (enableBackingStore) pScreen->backingStoreSupport = WhenMapped; #ifdef COMPOSITE if (noCompositeExtension) pScreen->backingStoreSupport = NotUseful; #endif pScreen->saveUnderSupport = NotUseful; return TRUE; } void InitRootWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; int backFlag = CWBorderPixel | CWCursor | CWBackingStore; if (!(*pScreen->CreateWindow) (pWin)) return; /* XXX */ (*pScreen->PositionWindow) (pWin, 0, 0); pWin->cursorIsNone = FALSE; pWin->optional->cursor = RefCursor(rootCursor); if (party_like_its_1989) { MakeRootTile(pWin); backFlag |= CWBackPixmap; } else if (pScreen->canDoBGNoneRoot && bgNoneRoot) { pWin->backgroundState = XaceBackgroundNoneState(pWin); pWin->background.pixel = pScreen->whitePixel; backFlag |= CWBackPixmap; } else { pWin->backgroundState = BackgroundPixel; if (whiteRoot) pWin->background.pixel = pScreen->whitePixel; else pWin->background.pixel = pScreen->blackPixel; backFlag |= CWBackPixel; } pWin->backingStore = defaultBackingStore; pWin->forcedBS = (defaultBackingStore != NotUseful); /* We SHOULD check for an error value here XXX */ (*pScreen->ChangeWindowAttributes) (pWin, backFlag); MapWindow(pWin, serverClient); } /* Set the region to the intersection of the rectangle and the * window's winSize. The window is typically the parent of the * window from which the region came. */ static void ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, int x, int y, int w, int h) { BoxRec box = *RegionExtents(&pWin->winSize); /* we do these calculations to avoid overflows */ if (x > box.x1) box.x1 = x; if (y > box.y1) box.y1 = y; x += w; if (x < box.x2) box.x2 = x; y += h; if (y < box.y2) box.y2 = y; if (box.x1 > box.x2) box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; RegionReset(Rgn, &box); RegionIntersect(Rgn, Rgn, &pWin->winSize); } static RealChildHeadProc realChildHeadProc = NULL; void RegisterRealChildHeadProc(RealChildHeadProc proc) { realChildHeadProc = proc; } WindowPtr RealChildHead(WindowPtr pWin) { if (realChildHeadProc) { return realChildHeadProc(pWin); } if (!pWin->parent && (screenIsSaved == SCREEN_SAVER_ON) && (HasSaverWindow(pWin->drawable.pScreen))) return pWin->firstChild; else return NullWindow; } /***** * CreateWindow * Makes a window in response to client request *****/ WindowPtr CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, unsigned h, unsigned bw, unsigned class, Mask vmask, XID *vlist, int depth, ClientPtr client, VisualID visual, int *error) { WindowPtr pWin; WindowPtr pHead; ScreenPtr pScreen; int idepth, ivisual; Bool fOK; DepthPtr pDepth; PixmapFormatRec *format; WindowOptPtr ancwopt; if (class == CopyFromParent) class = pParent->drawable.class; if ((class != InputOutput) && (class != InputOnly)) { *error = BadValue; client->errorValue = class; return NullWindow; } if ((class != InputOnly) && (pParent->drawable.class == InputOnly)) { *error = BadMatch; return NullWindow; } if ((class == InputOnly) && ((bw != 0) || (depth != 0))) { *error = BadMatch; return NullWindow; } pScreen = pParent->drawable.pScreen; if ((class == InputOutput) && (depth == 0)) depth = pParent->drawable.depth; ancwopt = pParent->optional; if (!ancwopt) ancwopt = FindWindowWithOptional(pParent)->optional; if (visual == CopyFromParent) { visual = ancwopt->visual; } /* Find out if the depth and visual are acceptable for this Screen */ if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) { fOK = FALSE; for (idepth = 0; idepth < pScreen->numDepths; idepth++) { pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; if ((depth == pDepth->depth) || (depth == 0)) { for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) { if (visual == pDepth->vids[ivisual]) { fOK = TRUE; break; } } } } if (fOK == FALSE) { *error = BadMatch; return NullWindow; } } if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) && (class != InputOnly) && (depth != pParent->drawable.depth)) { *error = BadMatch; return NullWindow; } if (((vmask & CWColormap) == 0) && (class != InputOnly) && ((visual != ancwopt->visual) || (ancwopt->colormap == None))) { *error = BadMatch; return NullWindow; } pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW); if (!pWin) { *error = BadAlloc; return NullWindow; } pWin->drawable = pParent->drawable; pWin->drawable.depth = depth; if (depth == pParent->drawable.depth) pWin->drawable.bitsPerPixel = pParent->drawable.bitsPerPixel; else { for (format = screenInfo.formats; format->depth != depth; format++); pWin->drawable.bitsPerPixel = format->bitsPerPixel; } if (class == InputOnly) pWin->drawable.type = (short) UNDRAWABLE_WINDOW; pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; pWin->drawable.id = wid; pWin->drawable.class = class; pWin->parent = pParent; SetWindowToDefaults(pWin); if (visual != ancwopt->visual) { if (!MakeWindowOptional(pWin)) { dixFreeObjectWithPrivates(pWin, PRIVATE_WINDOW); *error = BadAlloc; return NullWindow; } pWin->optional->visual = visual; pWin->optional->colormap = None; } pWin->borderWidth = bw; /* security creation/labeling check */ *error = XaceHook(XACE_RESOURCE_ACCESS, client, wid, RT_WINDOW, pWin, RT_WINDOW, pWin->parent, DixCreateAccess | DixSetAttrAccess); if (*error != Success) { dixFreeObjectWithPrivates(pWin, PRIVATE_WINDOW); return NullWindow; } pWin->backgroundState = XaceBackgroundNoneState(pWin); pWin->background.pixel = pScreen->whitePixel; pWin->borderIsPixel = pParent->borderIsPixel; pWin->border = pParent->border; if (pWin->borderIsPixel == FALSE) pWin->border.pixmap->refcnt++; pWin->origin.x = x + (int) bw; pWin->origin.y = y + (int) bw; pWin->drawable.width = w; pWin->drawable.height = h; pWin->drawable.x = pParent->drawable.x + x + (int) bw; pWin->drawable.y = pParent->drawable.y + y + (int) bw; /* set up clip list correctly for unobscured WindowPtr */ RegionNull(&pWin->clipList); RegionNull(&pWin->borderClip); RegionNull(&pWin->winSize); RegionNull(&pWin->borderSize); pHead = RealChildHead(pParent); if (pHead) { pWin->nextSib = pHead->nextSib; if (pHead->nextSib) pHead->nextSib->prevSib = pWin; else pParent->lastChild = pWin; pHead->nextSib = pWin; pWin->prevSib = pHead; } else { pWin->nextSib = pParent->firstChild; if (pParent->firstChild) pParent->firstChild->prevSib = pWin; else pParent->lastChild = pWin; pParent->firstChild = pWin; } SetWinSize(pWin); SetBorderSize(pWin); /* We SHOULD check for an error value here XXX */ if (!(*pScreen->CreateWindow) (pWin)) { *error = BadAlloc; DeleteWindow(pWin, None); return NullWindow; } /* We SHOULD check for an error value here XXX */ (*pScreen->PositionWindow) (pWin, pWin->drawable.x, pWin->drawable.y); if (!(vmask & CWEventMask)) RecalculateDeliverableEvents(pWin); if (vmask) *error = ChangeWindowAttributes(pWin, vmask, vlist, wClient(pWin)); else *error = Success; if (*error != Success) { DeleteWindow(pWin, None); return NullWindow; } if (!(vmask & CWBackingStore) && (defaultBackingStore != NotUseful)) { XID value = defaultBackingStore; (void) ChangeWindowAttributes(pWin, CWBackingStore, &value, wClient(pWin)); pWin->forcedBS = TRUE; } if (SubSend(pParent)) { 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; DeliverEvents(pParent, &event, 1, NullWindow); } return pWin; } static void DisposeWindowOptional(WindowPtr pWin) { if (!pWin->optional) return; /* * everything is peachy. Delete the optional record * and clean up */ if (pWin->optional->cursor) { FreeCursor(pWin->optional->cursor, (Cursor) 0); pWin->cursorIsNone = FALSE; } else pWin->cursorIsNone = TRUE; if (pWin->optional->deviceCursors) { DevCursorList pList; DevCursorList pPrev; pList = pWin->optional->deviceCursors; while (pList) { if (pList->cursor) FreeCursor(pList->cursor, (XID) 0); pPrev = pList; pList = pList->next; free(pPrev); } pWin->optional->deviceCursors = NULL; } free(pWin->optional); pWin->optional = NULL; } static void FreeWindowResources(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; DeleteWindowFromAnySaveSet(pWin); DeleteWindowFromAnySelections(pWin); DeleteWindowFromAnyEvents(pWin, TRUE); RegionUninit(&pWin->clipList); RegionUninit(&pWin->winSize); RegionUninit(&pWin->borderClip); RegionUninit(&pWin->borderSize); if (wBoundingShape(pWin)) RegionDestroy(wBoundingShape(pWin)); if (wClipShape(pWin)) RegionDestroy(wClipShape(pWin)); if (wInputShape(pWin)) RegionDestroy(wInputShape(pWin)); if (pWin->borderIsPixel == FALSE) (*pScreen->DestroyPixmap) (pWin->border.pixmap); if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap) (pWin->background.pixmap); DeleteAllWindowProperties(pWin); /* We SHOULD check for an error value here XXX */ (*pScreen->DestroyWindow) (pWin); DisposeWindowOptional(pWin); } static void CrushTree(WindowPtr pWin) { WindowPtr pChild, pSib, pParent; UnrealizeWindowProcPtr UnrealizeWindow; if (!(pChild = pWin->firstChild)) return; UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow; while (1) { if (pChild->firstChild) { pChild = pChild->firstChild; continue; } while (1) { pParent = pChild->parent; if (SubStrSend(pChild, pParent)) { xEvent event = { .u.u.type = DestroyNotify }; event.u.destroyNotify.window = pChild->drawable.id; DeliverEvents(pChild, &event, 1, NullWindow); } FreeResource(pChild->drawable.id, RT_WINDOW); pSib = pChild->nextSib; pChild->viewable = FALSE; if (pChild->realized) { pChild->realized = FALSE; (*UnrealizeWindow) (pChild); } FreeWindowResources(pChild); dixFreeObjectWithPrivates(pChild, PRIVATE_WINDOW); if ((pChild = pSib)) break; pChild = pParent; pChild->firstChild = NullWindow; pChild->lastChild = NullWindow; if (pChild == pWin) return; } } } /***** * DeleteWindow * Deletes child of window then window itself * If wid is None, don't send any events *****/ int DeleteWindow(void *value, XID wid) { WindowPtr pParent; WindowPtr pWin = (WindowPtr) value; UnmapWindow(pWin, FALSE); CrushTree(pWin); pParent = pWin->parent; if (wid && pParent && SubStrSend(pWin, pParent)) { xEvent event = { .u.u.type = DestroyNotify }; event.u.destroyNotify.window = pWin->drawable.id; DeliverEvents(pWin, &event, 1, NullWindow); } FreeWindowResources(pWin); if (pParent) { if (pParent->firstChild == pWin) pParent->firstChild = pWin->nextSib; if (pParent->lastChild == pWin) pParent->lastChild = pWin->prevSib; if (pWin->nextSib) pWin->nextSib->prevSib = pWin->prevSib; if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; } else pWin->drawable.pScreen->root = NULL; dixFreeObjectWithPrivates(pWin, PRIVATE_WINDOW); return Success; } int DestroySubwindows(WindowPtr pWin, ClientPtr client) { /* XXX * The protocol is quite clear that each window should be * destroyed in turn, however, unmapping all of the first * eliminates most of the calls to ValidateTree. So, * this implementation is incorrect in that all of the * UnmapNotifies occur before all of the DestroyNotifies. * If you care, simply delete the call to UnmapSubwindows. */ UnmapSubwindows(pWin); while (pWin->lastChild) { int rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->lastChild->drawable.id, RT_WINDOW, pWin->lastChild, RT_NONE, NULL, DixDestroyAccess); if (rc != Success) return rc; FreeResource(pWin->lastChild->drawable.id, RT_NONE); } return Success; } static void SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2) { /* following the protocol: "Changing the background of a root window to * None or ParentRelative restores the default background pixmap" */ if (bgNoneRoot) { pWin->backgroundState = XaceBackgroundNoneState(pWin); pWin->background.pixel = pScreen->whitePixel; } else if (party_like_its_1989) MakeRootTile(pWin); else { pWin->backgroundState = BackgroundPixel; if (whiteRoot) pWin->background.pixel = pScreen->whitePixel; else pWin->background.pixel = pScreen->blackPixel; *index2 = CWBackPixel; } } /***** * ChangeWindowAttributes * * The value-mask specifies which attributes are to be changed; the * value-list contains one value for each one bit in the mask, from least * to most significant bit in the mask. *****/ int ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) { XID *pVlist; PixmapPtr pPixmap; Pixmap pixID; CursorPtr pCursor, pOldCursor; Cursor cursorID; WindowPtr pChild; Colormap cmap; ColormapPtr pCmap; xEvent xE; int error, rc; ScreenPtr pScreen; Mask index2, tmask, vmaskCopy = 0; unsigned int val; Bool checkOptional = FALSE, borderRelative = FALSE; if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK))) return BadMatch; error = Success; pScreen = pWin->drawable.pScreen; pVlist = vlist; tmask = vmask; while (tmask) { index2 = (Mask) lowbit(tmask); tmask &= ~index2; switch (index2) { case CWBackPixmap: pixID = (Pixmap) * pVlist; pVlist++; if (pWin->backgroundState == ParentRelative) borderRelative = TRUE; if (pixID == None) { if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap) (pWin->background.pixmap); if (!pWin->parent) SetRootWindowBackground(pWin, pScreen, &index2); else { pWin->backgroundState = XaceBackgroundNoneState(pWin); pWin->background.pixel = pScreen->whitePixel; } } else if (pixID == ParentRelative) { if (pWin->parent && pWin->drawable.depth != pWin->parent->drawable.depth) { error = BadMatch; goto PatchUp; } if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap) (pWin->background.pixmap); if (!pWin->parent) SetRootWindowBackground(pWin, pScreen, &index2); else pWin->backgroundState = ParentRelative; borderRelative = TRUE; /* Note that the parent's backgroundTile's refcnt is NOT * incremented. */ } else { rc = dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (rc == Success) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || (pPixmap->drawable.pScreen != pScreen)) { error = BadMatch; goto PatchUp; } if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap) (pWin->background.pixmap); pWin->backgroundState = BackgroundPixmap; pWin->background.pixmap = pPixmap; pPixmap->refcnt++; } else { error = rc; client->errorValue = pixID; goto PatchUp; } } break; case CWBackPixel: if (pWin->backgroundState == ParentRelative) borderRelative = TRUE; if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap) (pWin->background.pixmap); pWin->backgroundState = BackgroundPixel; pWin->background.pixel = (CARD32) *pVlist; /* background pixel overrides background pixmap, so don't let the ddx layer see both bits */ vmaskCopy &= ~CWBackPixmap; pVlist++; break; case CWBorderPixmap: pixID = (Pixmap) * pVlist; pVlist++; if (pixID == CopyFromParent) { if (!pWin->parent || (pWin->drawable.depth != pWin->parent->drawable.depth)) { error = BadMatch; goto PatchUp; } if (pWin->parent->borderIsPixel == TRUE) { if (pWin->borderIsPixel == FALSE) (*pScreen->DestroyPixmap) (pWin->border.pixmap); pWin->border = pWin->parent->border; pWin->borderIsPixel = TRUE; index2 = CWBorderPixel; break; } else { pixID = pWin->parent->border.pixmap->drawable.id; } } rc = dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (rc == Success) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || (pPixmap->drawable.pScreen != pScreen)) { error = BadMatch; goto PatchUp; } if (pWin->borderIsPixel == FALSE) (*pScreen->DestroyPixmap) (pWin->border.pixmap); pWin->borderIsPixel = FALSE; pWin->border.pixmap = pPixmap; pPixmap->refcnt++; } else { error = rc; client->errorValue = pixID; goto PatchUp; } break; case CWBorderPixel: if (pWin->borderIsPixel == FALSE) (*pScreen->DestroyPixmap) (pWin->border.pixmap); pWin->borderIsPixel = TRUE; pWin->border.pixel = (CARD32) *pVlist; /* border pixel overrides border pixmap, so don't let the ddx layer see both bits */ vmaskCopy &= ~CWBorderPixmap; pVlist++; break; case CWBitGravity: val = (CARD8) *pVlist; pVlist++; if (val > StaticGravity) { error = BadValue; client->errorValue = val; goto PatchUp; } pWin->bitGravity = val; break; case CWWinGravity: val = (CARD8) *pVlist; pVlist++; if (val > StaticGravity) { error = BadValue; client->errorValue = val; goto PatchUp; } pWin->winGravity = val; break; case CWBackingStore: val = (CARD8) *pVlist; pVlist++; if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) { error = BadValue; client->errorValue = val; goto PatchUp; } pWin->backingStore = val; pWin->forcedBS = FALSE; break; case CWBackingPlanes: if (pWin->optional || ((CARD32) *pVlist != (CARD32) ~0L)) { if (!pWin->optional && !MakeWindowOptional(pWin)) { error = BadAlloc; goto PatchUp; } pWin->optional->backingBitPlanes = (CARD32) *pVlist; if ((CARD32) *pVlist == (CARD32) ~0L) checkOptional = TRUE; } pVlist++; break; case CWBackingPixel: if (pWin->optional || (CARD32) *pVlist) { if (!pWin->optional && !MakeWindowOptional(pWin)) { error = BadAlloc; goto PatchUp; } pWin->optional->backingPixel = (CARD32) *pVlist; if (!*pVlist) checkOptional = TRUE; } pVlist++; break; case CWSaveUnder: val = (BOOL) * pVlist; pVlist++; if ((val != xTrue) && (val != xFalse)) { error = BadValue; client->errorValue = val; goto PatchUp; } pWin->saveUnder = val; break; case CWEventMask: rc = EventSelectForWindow(pWin, client, (Mask) *pVlist); if (rc) { error = rc; goto PatchUp; } pVlist++; break; case CWDontPropagate: rc = EventSuppressForWindow(pWin, client, (Mask) *pVlist, &checkOptional); if (rc) { error = rc; goto PatchUp; } pVlist++; break; case CWOverrideRedirect: val = (BOOL) * pVlist; pVlist++; if ((val != xTrue) && (val != xFalse)) { error = BadValue; client->errorValue = val; goto PatchUp; } if (val == xTrue) { rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW, pWin, RT_NONE, NULL, DixGrabAccess); if (rc != Success) { error = rc; client->errorValue = pWin->drawable.id; goto PatchUp; } } pWin->overrideRedirect = val; break; case CWColormap: cmap = (Colormap) * pVlist; pVlist++; if (cmap == CopyFromParent) { if (pWin->parent && (!pWin->optional || pWin->optional->visual == wVisual(pWin->parent))) { cmap = wColormap(pWin->parent); } else cmap = None; } if (cmap == None) { error = BadMatch; goto PatchUp; } rc = dixLookupResourceByType((void **) &pCmap, cmap, RT_COLORMAP, client, DixUseAccess); if (rc != Success) { error = rc; client->errorValue = cmap; goto PatchUp; } if (pCmap->pVisual->vid != wVisual(pWin) || pCmap->pScreen != pScreen) { error = BadMatch; goto PatchUp; } if (cmap != wColormap(pWin)) { if (!pWin->optional) { if (!MakeWindowOptional(pWin)) { error = BadAlloc; goto PatchUp; } } else if (pWin->parent && cmap == wColormap(pWin->parent)) checkOptional = TRUE; /* * propagate the original colormap to any children * inheriting it */ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (!pChild->optional && !MakeWindowOptional(pChild)) { error = BadAlloc; goto PatchUp; } } pWin->optional->colormap = cmap; /* * check on any children now matching the new colormap */ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->optional->colormap == cmap) 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; DeliverEvents(pWin, &xE, 1, NullWindow); } break; case CWCursor: cursorID = (Cursor) * pVlist; pVlist++; /* * install the new */ if (cursorID == None) { if (pWin == pWin->drawable.pScreen->root) pCursor = rootCursor; else pCursor = (CursorPtr) None; } else { rc = dixLookupResourceByType((void **) &pCursor, cursorID, RT_CURSOR, client, DixUseAccess); if (rc != Success) { error = rc; client->errorValue = cursorID; goto PatchUp; } } if (pCursor != wCursor(pWin)) { /* * patch up child windows so they don't lose cursors. */ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (!pChild->optional && !pChild->cursorIsNone && !MakeWindowOptional(pChild)) { error = BadAlloc; goto PatchUp; } } pOldCursor = 0; if (pCursor == (CursorPtr) None) { pWin->cursorIsNone = TRUE; if (pWin->optional) { pOldCursor = pWin->optional->cursor; pWin->optional->cursor = (CursorPtr) None; checkOptional = TRUE; } } else { if (!pWin->optional) { if (!MakeWindowOptional(pWin)) { error = BadAlloc; goto PatchUp; } } else if (pWin->parent && pCursor == wCursor(pWin->parent)) checkOptional = TRUE; pOldCursor = pWin->optional->cursor; pWin->optional->cursor = RefCursor(pCursor); pWin->cursorIsNone = FALSE; /* * check on any children now matching the new cursor */ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->optional && (pChild->optional->cursor == pCursor)) CheckWindowOptionalNeed(pChild); } } CursorVisible = TRUE; if (pWin->realized) WindowHasNewCursor(pWin); /* Can't free cursor until here - old cursor * is needed in WindowHasNewCursor */ if (pOldCursor) FreeCursor(pOldCursor, (Cursor) 0); } break; default: error = BadValue; client->errorValue = vmask; goto PatchUp; } vmaskCopy |= index2; } PatchUp: if (checkOptional) CheckWindowOptionalNeed(pWin); /* We SHOULD check for an error value here XXX */ (*pScreen->ChangeWindowAttributes) (pWin, vmaskCopy); /* If the border contents have changed, redraw the border. Note that this has to be done AFTER pScreen->ChangeWindowAttributes for the tile to be rotated, and the correct function selected. */ if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative) && pWin->viewable && HasBorder(pWin)) { RegionRec exposed; RegionNull(&exposed); RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize); miPaintWindow(pWin, &exposed, PW_BORDER); RegionUninit(&exposed); } return error; } /***** * GetWindowAttributes * Notice that this is different than ChangeWindowAttributes *****/ void GetWindowAttributes(WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply * wa) { wa->type = X_Reply; wa->bitGravity = pWin->bitGravity; wa->winGravity = pWin->winGravity; if (pWin->forcedBS && pWin->backingStore != Always) wa->backingStore = NotUseful; else wa->backingStore = pWin->backingStore; wa->length = bytes_to_int32(sizeof(xGetWindowAttributesReply) - sizeof(xGenericReply)); wa->sequenceNumber = client->sequence; wa->backingBitPlanes = wBackingBitPlanes(pWin); wa->backingPixel = wBackingPixel(pWin); wa->saveUnder = (BOOL) pWin->saveUnder; wa->override = pWin->overrideRedirect; if (!pWin->mapped) wa->mapState = IsUnmapped; else if (pWin->realized) wa->mapState = IsViewable; else wa->mapState = IsUnviewable; wa->colormap = wColormap(pWin); wa->mapInstalled = (wa->colormap == None) ? xFalse : IsMapInstalled(wa->colormap, pWin); wa->yourEventMask = EventMaskForClient(pWin, client); wa->allEventMasks = pWin->eventMask | wOtherEventMasks(pWin); wa->doNotPropagateMask = wDontPropagateMask(pWin); wa->class = pWin->drawable.class; wa->visualID = wVisual(pWin); } WindowPtr MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib) { WindowPtr pParent = pWin->parent; WindowPtr pFirstChange = pWin; /* highest window where list changes */ if (pWin->nextSib != pNextSib) { WindowPtr pOldNextSib = pWin->nextSib; if (!pNextSib) { /* move to bottom */ if (pParent->firstChild == pWin) pParent->firstChild = pWin->nextSib; /* if (pWin->nextSib) *//* is always True: pNextSib == NULL * and pWin->nextSib != pNextSib * therefore pWin->nextSib != NULL */ pFirstChange = pWin->nextSib; pWin->nextSib->prevSib = pWin->prevSib; if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; pParent->lastChild->nextSib = pWin; pWin->prevSib = pParent->lastChild; pWin->nextSib = NullWindow; pParent->lastChild = pWin; } else if (pParent->firstChild == pNextSib) { /* move to top */ pFirstChange = pWin; if (pParent->lastChild == pWin) pParent->lastChild = pWin->prevSib; if (pWin->nextSib) pWin->nextSib->prevSib = pWin->prevSib; if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; pWin->nextSib = pParent->firstChild; pWin->prevSib = NULL; pNextSib->prevSib = pWin; pParent->firstChild = pWin; } else { /* move in middle of list */ WindowPtr pOldNext = pWin->nextSib; pFirstChange = NullWindow; if (pParent->firstChild == pWin) pFirstChange = pParent->firstChild = pWin->nextSib; if (pParent->lastChild == pWin) { pFirstChange = pWin; pParent->lastChild = pWin->prevSib; } if (pWin->nextSib) pWin->nextSib->prevSib = pWin->prevSib; if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; pWin->nextSib = pNextSib; pWin->prevSib = pNextSib->prevSib; if (pNextSib->prevSib) pNextSib->prevSib->nextSib = pWin; pNextSib->prevSib = pWin; if (!pFirstChange) { /* do we know it yet? */ pFirstChange = pParent->firstChild; /* no, search from top */ while ((pFirstChange != pWin) && (pFirstChange != pOldNext)) pFirstChange = pFirstChange->nextSib; } } if (pWin->drawable.pScreen->RestackWindow) (*pWin->drawable.pScreen->RestackWindow) (pWin, pOldNextSib); } #ifdef ROOTLESS /* * In rootless mode we can't optimize away window restacks. * There may be non-X windows around, so even if the window * is in the correct position from X's point of view, * the underlying window system may want to reorder it. */ else if (pWin->drawable.pScreen->RestackWindow) (*pWin->drawable.pScreen->RestackWindow) (pWin, pWin->nextSib); #endif return pFirstChange; } void SetWinSize(WindowPtr pWin) { #ifdef COMPOSITE if (pWin->redirectDraw != RedirectDrawNone) { BoxRec box; /* * Redirected clients get clip list equal to their * own geometry, not clipped to their parent */ box.x1 = pWin->drawable.x; box.y1 = pWin->drawable.y; box.x2 = pWin->drawable.x + pWin->drawable.width; box.y2 = pWin->drawable.y + pWin->drawable.height; RegionReset(&pWin->winSize, &box); } else #endif ClippedRegionFromBox(pWin->parent, &pWin->winSize, pWin->drawable.x, pWin->drawable.y, (int) pWin->drawable.width, (int) pWin->drawable.height); if (wBoundingShape(pWin) || wClipShape(pWin)) { RegionTranslate(&pWin->winSize, -pWin->drawable.x, -pWin->drawable.y); if (wBoundingShape(pWin)) RegionIntersect(&pWin->winSize, &pWin->winSize, wBoundingShape(pWin)); if (wClipShape(pWin)) RegionIntersect(&pWin->winSize, &pWin->winSize, wClipShape(pWin)); RegionTranslate(&pWin->winSize, pWin->drawable.x, pWin->drawable.y); } } void SetBorderSize(WindowPtr pWin) { int bw; if (HasBorder(pWin)) { bw = wBorderWidth(pWin); #ifdef COMPOSITE if (pWin->redirectDraw != RedirectDrawNone) { BoxRec box; /* * Redirected clients get clip list equal to their * own geometry, not clipped to their parent */ box.x1 = pWin->drawable.x - bw; box.y1 = pWin->drawable.y - bw; box.x2 = pWin->drawable.x + pWin->drawable.width + bw; box.y2 = pWin->drawable.y + pWin->drawable.height + bw; RegionReset(&pWin->borderSize, &box); } else #endif ClippedRegionFromBox(pWin->parent, &pWin->borderSize, pWin->drawable.x - bw, pWin->drawable.y - bw, (int) (pWin->drawable.width + (bw << 1)), (int) (pWin->drawable.height + (bw << 1))); if (wBoundingShape(pWin)) { RegionTranslate(&pWin->borderSize, -pWin->drawable.x, -pWin->drawable.y); RegionIntersect(&pWin->borderSize, &pWin->borderSize, wBoundingShape(pWin)); RegionTranslate(&pWin->borderSize, pWin->drawable.x, pWin->drawable.y); RegionUnion(&pWin->borderSize, &pWin->borderSize, &pWin->winSize); } } else { RegionCopy(&pWin->borderSize, &pWin->winSize); } } /** * * \param x,y new window position * \param oldx,oldy old window position * \param destx,desty position relative to gravity */ void GravityTranslate(int x, int y, int oldx, int oldy, int dw, int dh, unsigned gravity, int *destx, int *desty) { switch (gravity) { case NorthGravity: *destx = x + dw / 2; *desty = y; break; case NorthEastGravity: *destx = x + dw; *desty = y; break; case WestGravity: *destx = x; *desty = y + dh / 2; break; case CenterGravity: *destx = x + dw / 2; *desty = y + dh / 2; break; case EastGravity: *destx = x + dw; *desty = y + dh / 2; break; case SouthWestGravity: *destx = x; *desty = y + dh; break; case SouthGravity: *destx = x + dw / 2; *desty = y + dh; break; case SouthEastGravity: *destx = x + dw; *desty = y + dh; break; case StaticGravity: *destx = oldx; *desty = oldy; break; default: *destx = x; *desty = y; break; } } /* XXX need to retile border on each window with ParentRelative origin */ void ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) { ScreenPtr pScreen; WindowPtr pSib, pChild; Bool resized = (dw || dh); pScreen = pWin->drawable.pScreen; for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib) { if (resized && (pSib->winGravity > NorthWestGravity)) { int cwsx, cwsy; cwsx = pSib->origin.x; cwsy = pSib->origin.y; GravityTranslate(cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh, pSib->winGravity, &cwsx, &cwsy); if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) { 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; DeliverEvents(pSib, &event, 1, NullWindow); pSib->origin.x = cwsx; pSib->origin.y = cwsy; } } pSib->drawable.x = pWin->drawable.x + pSib->origin.x; pSib->drawable.y = pWin->drawable.y + pSib->origin.y; SetWinSize(pSib); SetBorderSize(pSib); (*pScreen->PositionWindow) (pSib, pSib->drawable.x, pSib->drawable.y); if ((pChild = pSib->firstChild)) { while (1) { pChild->drawable.x = pChild->parent->drawable.x + pChild->origin.x; pChild->drawable.y = pChild->parent->drawable.y + pChild->origin.y; SetWinSize(pChild); SetBorderSize(pChild); (*pScreen->PositionWindow) (pChild, pChild->drawable.x, pChild->drawable.y); if (pChild->firstChild) { pChild = pChild->firstChild; continue; } while (!pChild->nextSib && (pChild != pSib)) pChild = pChild->parent; if (pChild == pSib) break; pChild = pChild->nextSib; } } } } #define GET_INT16(m, f) \ if (m & mask) \ { \ f = (INT16) *pVlist;\ pVlist++; \ } #define GET_CARD16(m, f) \ if (m & mask) \ { \ f = (CARD16) *pVlist;\ pVlist++;\ } #define GET_CARD8(m, f) \ if (m & mask) \ { \ f = (CARD8) *pVlist;\ pVlist++;\ } #define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight)) /* * IsSiblingAboveMe * returns Above if pSib above pMe in stack or Below otherwise */ static int IsSiblingAboveMe(WindowPtr pMe, WindowPtr pSib) { WindowPtr pWin; pWin = pMe->parent->firstChild; while (pWin) { if (pWin == pSib) return Above; else if (pWin == pMe) return Below; pWin = pWin->nextSib; } return Below; } static BoxPtr WindowExtents(WindowPtr pWin, BoxPtr pBox) { pBox->x1 = pWin->drawable.x - wBorderWidth(pWin); pBox->y1 = pWin->drawable.y - wBorderWidth(pWin); pBox->x2 = pWin->drawable.x + (int) pWin->drawable.width + wBorderWidth(pWin); pBox->y2 = pWin->drawable.y + (int) pWin->drawable.height + wBorderWidth(pWin); return pBox; } #define IS_SHAPED(pWin) (wBoundingShape (pWin) != NULL) static RegionPtr MakeBoundingRegion(WindowPtr pWin, BoxPtr pBox) { RegionPtr pRgn = RegionCreate(pBox, 1); if (wBoundingShape(pWin)) { RegionTranslate(pRgn, -pWin->origin.x, -pWin->origin.y); RegionIntersect(pRgn, pRgn, wBoundingShape(pWin)); RegionTranslate(pRgn, pWin->origin.x, pWin->origin.y); } return pRgn; } static Bool ShapeOverlap(WindowPtr pWin, BoxPtr pWinBox, WindowPtr pSib, BoxPtr pSibBox) { RegionPtr pWinRgn, pSibRgn; Bool ret; if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib)) return TRUE; pWinRgn = MakeBoundingRegion(pWin, pWinBox); pSibRgn = MakeBoundingRegion(pSib, pSibBox); RegionIntersect(pWinRgn, pWinRgn, pSibRgn); ret = RegionNotEmpty(pWinRgn); RegionDestroy(pWinRgn); RegionDestroy(pSibRgn); return ret; } static Bool AnyWindowOverlapsMe(WindowPtr pWin, WindowPtr pHead, BoxPtr box) { WindowPtr pSib; BoxRec sboxrec; BoxPtr sbox; for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) { if (pSib->mapped) { sbox = WindowExtents(pSib, &sboxrec); if (BOXES_OVERLAP(sbox, box) && ShapeOverlap(pWin, box, pSib, sbox)) return TRUE; } } return FALSE; } static Bool IOverlapAnyWindow(WindowPtr pWin, BoxPtr box) { WindowPtr pSib; BoxRec sboxrec; BoxPtr sbox; for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) { if (pSib->mapped) { sbox = WindowExtents(pSib, &sboxrec); if (BOXES_OVERLAP(sbox, box) && ShapeOverlap(pWin, box, pSib, sbox)) return TRUE; } } return FALSE; } /* * WhereDoIGoInTheStack() * Given pWin and pSib and the relationshipe smode, return * the window that pWin should go ABOVE. * If a pSib is specified: * Above: pWin is placed just above pSib * Below: pWin is placed just below pSib * TopIf: if pSib occludes pWin, then pWin is placed * at the top of the stack * BottomIf: if pWin occludes pSib, then pWin is * placed at the bottom of the stack * Opposite: if pSib occludes pWin, then pWin is placed at the * top of the stack, else if pWin occludes pSib, then * pWin is placed at the bottom of the stack * * If pSib is NULL: * Above: pWin is placed at the top of the stack * Below: pWin is placed at the bottom of the stack * TopIf: if any sibling occludes pWin, then pWin is placed at * the top of the stack * BottomIf: if pWin occludes any sibline, then pWin is placed at * the bottom of the stack * Opposite: if any sibling occludes pWin, then pWin is placed at * the top of the stack, else if pWin occludes any * sibling, then pWin is placed at the bottom of the stack * */ static WindowPtr WhereDoIGoInTheStack(WindowPtr pWin, WindowPtr pSib, short x, short y, unsigned short w, unsigned short h, int smode) { BoxRec box; WindowPtr pHead, pFirst; if ((pWin == pWin->parent->firstChild) && (pWin == pWin->parent->lastChild)) return NULL; pHead = RealChildHead(pWin->parent); pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild; box.x1 = x; box.y1 = y; box.x2 = x + (int) w; box.y2 = y + (int) h; switch (smode) { case Above: if (pSib) return pSib; else if (pWin == pFirst) return pWin->nextSib; else return pFirst; case Below: if (pSib) if (pSib->nextSib != pWin) return pSib->nextSib; else return pWin->nextSib; else return NullWindow; case TopIf: if ((!pWin->mapped || (pSib && !pSib->mapped))) return pWin->nextSib; else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Above) && (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) return pFirst; else return pWin->nextSib; } else if (AnyWindowOverlapsMe(pWin, pHead, &box)) return pFirst; else return pWin->nextSib; case BottomIf: if ((!pWin->mapped || (pSib && !pSib->mapped))) return pWin->nextSib; else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Below) && (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) return NullWindow; else return pWin->nextSib; } else if (IOverlapAnyWindow(pWin, &box)) return NullWindow; else return pWin->nextSib; case Opposite: if ((!pWin->mapped || (pSib && !pSib->mapped))) return pWin->nextSib; else if (pSib) { if (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT) { if (IsSiblingAboveMe(pWin, pSib) == Above) return pFirst; else return NullWindow; } else return pWin->nextSib; } else if (AnyWindowOverlapsMe(pWin, pHead, &box)) { /* If I'm occluded, I can't possibly be the first child * if (pWin == pWin->parent->firstChild) * return pWin->nextSib; */ return pFirst; } else if (IOverlapAnyWindow(pWin, &box)) return NullWindow; else return pWin->nextSib; default: { /* should never happen; make something up. */ return pWin->nextSib; } } } static void ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind) { /* Note that pSib might be NULL */ Bool WasViewable = (Bool) pWin->viewable; Bool anyMarked; WindowPtr pFirstChange; WindowPtr pLayerWin; ScreenPtr pScreen = pWin->drawable.pScreen; /* if this is a root window, can't be restacked */ if (!pWin->parent) return; pFirstChange = MoveWindowInStack(pWin, pSib); if (WasViewable) { anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pFirstChange, &pLayerWin); if (pLayerWin != pWin) pFirstChange = pLayerWin; if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pFirstChange, kind); (*pScreen->HandleExposures) (pLayerWin->parent); if (pWin->drawable.pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, kind); } } if (pWin->realized) WindowsRestructured(); } /***** * ConfigureWindow *****/ int ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) { #define RESTACK_WIN 0 #define MOVE_WIN 1 #define RESIZE_WIN 2 #define REBORDER_WIN 3 WindowPtr pSib = NullWindow; WindowPtr pParent = pWin->parent; Window sibwid = 0; Mask index2, tmask; XID *pVlist; short x, y, beforeX, beforeY; unsigned short w = pWin->drawable.width, h = pWin->drawable.height, bw = pWin->borderWidth; int rc, action, smode = Above; if ((pWin->drawable.class == InputOnly) && (mask & CWBorderWidth)) return BadMatch; if ((mask & CWSibling) && !(mask & CWStackMode)) return BadMatch; pVlist = vlist; if (pParent) { x = pWin->drawable.x - pParent->drawable.x - (int) bw; y = pWin->drawable.y - pParent->drawable.y - (int) bw; } else { x = pWin->drawable.x; y = pWin->drawable.y; } beforeX = x; beforeY = y; action = RESTACK_WIN; if ((mask & (CWX | CWY)) && (!(mask & (CWHeight | CWWidth)))) { GET_INT16(CWX, x); GET_INT16(CWY, y); action = MOVE_WIN; } /* or should be resized */ else if (mask & (CWX | CWY | CWWidth | CWHeight)) { GET_INT16(CWX, x); GET_INT16(CWY, y); GET_CARD16(CWWidth, w); GET_CARD16(CWHeight, h); if (!w || !h) { client->errorValue = 0; return BadValue; } action = RESIZE_WIN; } tmask = mask & ~ChangeMask; while (tmask) { index2 = (Mask) lowbit(tmask); tmask &= ~index2; switch (index2) { case CWBorderWidth: GET_CARD16(CWBorderWidth, bw); break; case CWSibling: sibwid = (Window) *pVlist; pVlist++; rc = dixLookupWindow(&pSib, sibwid, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = sibwid; return rc; } if (pSib->parent != pParent) return BadMatch; if (pSib == pWin) return BadMatch; break; case CWStackMode: GET_CARD8(CWStackMode, smode); if ((smode != TopIf) && (smode != BottomIf) && (smode != Opposite) && (smode != Above) && (smode != Below)) { client->errorValue = smode; return BadValue; } break; default: client->errorValue = mask; return BadValue; } } /* root really can't be reconfigured, so just return */ if (!pParent) return Success; /* Figure out if the window should be moved. Doesnt make the changes to the window if event sent */ if (mask & CWStackMode) pSib = WhereDoIGoInTheStack(pWin, pSib, pParent->drawable.x + x, pParent->drawable.y + y, w + (bw << 1), h + (bw << 1), smode); else pSib = pWin->nextSib; 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.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 if (MaybeDeliverEventsToClient(pParent, &event, 1, SubstructureRedirectMask, client) == 1) return Success; } if (action == RESIZE_WIN) { Bool size_change = (w != pWin->drawable.width) || (h != pWin->drawable.height); if (size_change && ((pWin->eventMask | wOtherEventMasks(pWin)) & ResizeRedirectMask)) { xEvent eventT = { .u.resizeRequest.window = pWin->drawable.id, .u.resizeRequest.width = w, .u.resizeRequest.height = h }; eventT.u.u.type = ResizeRequest; if (MaybeDeliverEventsToClient(pWin, &eventT, 1, ResizeRedirectMask, client) == 1) { /* if event is delivered, leave the actual size alone. */ w = pWin->drawable.width; h = pWin->drawable.height; size_change = FALSE; } } if (!size_change) { if (mask & (CWX | CWY)) action = MOVE_WIN; else if (mask & (CWStackMode | CWBorderWidth)) action = RESTACK_WIN; else /* really nothing to do */ return (Success); } } if (action == RESIZE_WIN) /* we've already checked whether there's really a size change */ goto ActuallyDoSomething; if ((mask & CWX) && (x != beforeX)) goto ActuallyDoSomething; if ((mask & CWY) && (y != beforeY)) goto ActuallyDoSomething; if ((mask & CWBorderWidth) && (bw != wBorderWidth(pWin))) goto ActuallyDoSomething; if (mask & CWStackMode) { #ifndef ROOTLESS /* See above for why we always reorder in rootless mode. */ if (pWin->nextSib != pSib) #endif goto ActuallyDoSomething; } return Success; ActuallyDoSomething: if (pWin->drawable.pScreen->ConfigNotify) { int ret; ret = (*pWin->drawable.pScreen->ConfigNotify) (pWin, x, y, w, h, bw, pSib); if (ret) { client->errorValue = 0; return ret; } } if (SubStrSend(pWin, pParent)) { 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; #ifdef PANORAMIX if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { event.u.configureNotify.x += screenInfo.screens[0]->x; event.u.configureNotify.y += screenInfo.screens[0]->y; } #endif DeliverEvents(pWin, &event, 1, NullWindow); } if (mask & CWBorderWidth) { if (action == RESTACK_WIN) { action = MOVE_WIN; pWin->borderWidth = bw; } else if ((action == MOVE_WIN) && (beforeX + wBorderWidth(pWin) == x + (int) bw) && (beforeY + wBorderWidth(pWin) == y + (int) bw)) { action = REBORDER_WIN; (*pWin->drawable.pScreen->ChangeBorderWidth) (pWin, bw); } else pWin->borderWidth = bw; } if (action == MOVE_WIN) (*pWin->drawable.pScreen->MoveWindow) (pWin, x, y, pSib, (mask & CWBorderWidth) ? VTOther : VTMove); else if (action == RESIZE_WIN) (*pWin->drawable.pScreen->ResizeWindow) (pWin, x, y, w, h, pSib); else if (mask & CWStackMode) ReflectStackChange(pWin, pSib, VTOther); if (action != RESTACK_WIN) CheckCursorConfinement(pWin); return Success; #undef RESTACK_WIN #undef MOVE_WIN #undef RESIZE_WIN #undef REBORDER_WIN } /****** * * CirculateWindow * For RaiseLowest, raises the lowest mapped child (if any) that is * obscured by another child to the top of the stack. For LowerHighest, * lowers the highest mapped child (if any) that is obscuring another * child to the bottom of the stack. Exposure processing is performed * ******/ int CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) { WindowPtr pWin, pHead, pFirst; xEvent event; BoxRec box; pHead = RealChildHead(pParent); pFirst = pHead ? pHead->nextSib : pParent->firstChild; if (direction == RaiseLowest) { for (pWin = pParent->lastChild; (pWin != pHead) && !(pWin->mapped && AnyWindowOverlapsMe(pWin, pHead, WindowExtents(pWin, &box))); pWin = pWin->prevSib); if (pWin == pHead) return Success; } else { for (pWin = pFirst; pWin && !(pWin->mapped && IOverlapAnyWindow(pWin, WindowExtents(pWin, &box))); pWin = pWin->nextSib); if (!pWin) return Success; } 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; if (MaybeDeliverEventsToClient(pParent, &event, 1, SubstructureRedirectMask, client) == 1) return Success; } event.u.u.type = CirculateNotify; DeliverEvents(pWin, &event, 1, NullWindow); ReflectStackChange(pWin, (direction == RaiseLowest) ? pFirst : NullWindow, VTStack); return Success; } static int CompareWIDs(WindowPtr pWin, void *value) { /* must conform to VisitWindowProcPtr */ Window *wid = (Window *) value; if (pWin->drawable.id == *wid) return WT_STOPWALKING; else return WT_WALKCHILDREN; } /***** * ReparentWindow *****/ int ReparentWindow(WindowPtr pWin, WindowPtr pParent, int x, int y, ClientPtr client) { WindowPtr pPrev, pPriorParent; Bool WasMapped = (Bool) (pWin->mapped); xEvent event; int bw = wBorderWidth(pWin); ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; if (TraverseTree(pWin, CompareWIDs, (void *) &pParent->drawable.id) == WT_STOPWALKING) return BadMatch; if (!MakeWindowOptional(pWin)) return BadAlloc; if (WasMapped) UnmapWindow(pWin, FALSE); 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; #ifdef PANORAMIX if (!noPanoramiXExtension && !pParent->parent) { event.u.reparent.x += screenInfo.screens[0]->x; event.u.reparent.y += screenInfo.screens[0]->y; } #endif DeliverEvents(pWin, &event, 1, pParent); /* take out of sibling chain */ pPriorParent = pPrev = pWin->parent; if (pPrev->firstChild == pWin) pPrev->firstChild = pWin->nextSib; if (pPrev->lastChild == pWin) pPrev->lastChild = pWin->prevSib; if (pWin->nextSib) pWin->nextSib->prevSib = pWin->prevSib; if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; /* insert at begining of pParent */ pWin->parent = pParent; pPrev = RealChildHead(pParent); if (pPrev) { pWin->nextSib = pPrev->nextSib; if (pPrev->nextSib) pPrev->nextSib->prevSib = pWin; else pParent->lastChild = pWin; pPrev->nextSib = pWin; pWin->prevSib = pPrev; } else { pWin->nextSib = pParent->firstChild; pWin->prevSib = NullWindow; if (pParent->firstChild) pParent->firstChild->prevSib = pWin; else pParent->lastChild = pWin; pParent->firstChild = pWin; } pWin->origin.x = x + bw; pWin->origin.y = y + bw; pWin->drawable.x = x + bw + pParent->drawable.x; pWin->drawable.y = y + bw + pParent->drawable.y; /* clip to parent */ SetWinSize(pWin); SetBorderSize(pWin); if (pScreen->ReparentWindow) (*pScreen->ReparentWindow) (pWin, pPriorParent); (*pScreen->PositionWindow) (pWin, pWin->drawable.x, pWin->drawable.y); ResizeChildrenWinSize(pWin, 0, 0, 0, 0); CheckWindowOptionalNeed(pWin); if (WasMapped) MapWindow(pWin, client); RecalculateDeliverableEvents(pWin); return Success; } static void RealizeTree(WindowPtr pWin) { WindowPtr pChild; RealizeWindowProcPtr Realize; Realize = pWin->drawable.pScreen->RealizeWindow; pChild = pWin; while (1) { if (pChild->mapped) { pChild->realized = TRUE; pChild->viewable = (pChild->drawable.class == InputOutput); (*Realize) (pChild); if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) return; pChild = pChild->nextSib; } } static Bool MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client) { 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); } /***** * MapWindow * If some other client has selected SubStructureReDirect on the parent * and override-redirect is xFalse, then a MapRequest event is generated, * but the window remains unmapped. Otherwise, the window is mapped and a * MapNotify event is generated. *****/ int MapWindow(WindowPtr pWin, ClientPtr client) { ScreenPtr pScreen; WindowPtr pParent; WindowPtr pLayerWin; if (pWin->mapped) return Success; /* 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)) { Bool anyMarked; if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) if (MaybeDeliverMapRequest(pWin, pParent, client)) return Success; pWin->mapped = TRUE; if (SubStrSend(pWin, pParent)) DeliverMapNotify(pWin); if (!pParent->realized) return Success; RealizeTree(pWin); if (pWin->viewable) { anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTMap); (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, VTMap); } } WindowsRestructured(); } else { RegionRec temp; pWin->mapped = TRUE; pWin->realized = TRUE; /* for roots */ pWin->viewable = pWin->drawable.class == InputOutput; /* We SHOULD check for an error value here XXX */ (*pScreen->RealizeWindow) (pWin); if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pWin, 0, 0); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (NullWindow, pWin, VTMap); RegionNull(&temp); RegionCopy(&temp, &pWin->clipList); (*pScreen->WindowExposures) (pWin, &temp); RegionUninit(&temp); } return Success; } /***** * MapSubwindows * Performs a MapWindow all unmapped children of the window, in top * to bottom stacking order. *****/ void MapSubwindows(WindowPtr pParent, ClientPtr client) { WindowPtr pWin; WindowPtr pFirstMapped = NullWindow; ScreenPtr pScreen; Mask parentRedirect; Mask parentNotify; Bool anyMarked; WindowPtr pLayerWin; pScreen = pParent->drawable.pScreen; parentRedirect = RedirectSend(pParent); parentNotify = SubSend(pParent); anyMarked = FALSE; for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) { if (!pWin->mapped) { if (parentRedirect && !pWin->overrideRedirect) if (MaybeDeliverMapRequest(pWin, pParent, client)) continue; pWin->mapped = TRUE; if (parentNotify || StrSend(pWin)) DeliverMapNotify(pWin); if (!pFirstMapped) pFirstMapped = pWin; if (pParent->realized) { RealizeTree(pWin); if (pWin->viewable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); } } } } if (pFirstMapped) { pLayerWin = (*pScreen->GetLayerWindow) (pParent); if (pLayerWin->parent != pParent) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pLayerWin, pLayerWin, NULL); pFirstMapped = pLayerWin; } if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pFirstMapped, VTMap); (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstMapped, VTMap); } WindowsRestructured(); } } static void UnrealizeTree(WindowPtr pWin, Bool fromConfigure) { WindowPtr pChild; UnrealizeWindowProcPtr Unrealize; MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; Unrealize = pWin->drawable.pScreen->UnrealizeWindow; MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow; pChild = pWin; while (1) { if (pChild->realized) { pChild->realized = FALSE; pChild->visibility = VisibilityNotViewable; #ifdef PANORAMIX if (!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) { PanoramiXRes *win; int rc = dixLookupResourceByType((void **) &win, pChild->drawable.id, XRT_WINDOW, serverClient, DixWriteAccess); if (rc == Success) win->u.win.visibility = VisibilityNotViewable; } #endif (*Unrealize) (pChild); DeleteWindowFromAnyEvents(pChild, FALSE); if (pChild->viewable) { pChild->viewable = FALSE; (*MarkUnrealizedWindow) (pChild, pWin, fromConfigure); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; } if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) return; pChild = pChild->nextSib; } } 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. * Otherwise, the window is unmapped and an UnMapNotify event is * generated. Cannot unmap a root window. *****/ int UnmapWindow(WindowPtr pWin, Bool fromConfigure) { WindowPtr pParent; Bool wasRealized = (Bool) pWin->realized; Bool wasViewable = (Bool) pWin->viewable; ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pLayerWin = pWin; if ((!pWin->mapped) || (!(pParent = pWin->parent))) return Success; if (SubStrSend(pWin, pParent)) DeliverUnmapNotify(pWin, fromConfigure); if (wasViewable && !fromConfigure) { pWin->valdata = UnmapValData; (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin); (*pScreen->MarkWindow) (pLayerWin->parent); } pWin->mapped = FALSE; if (wasRealized) UnrealizeTree(pWin, fromConfigure); if (wasViewable) { if (!fromConfigure) { (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); } } if (wasRealized && !fromConfigure) { WindowsRestructured(); WindowGone(pWin); } return Success; } /***** * UnmapSubwindows * Performs an UnmapWindow request with the specified mode on all mapped * children of the window, in bottom to top stacking order. *****/ void UnmapSubwindows(WindowPtr pWin) { WindowPtr pChild, pHead; Bool wasRealized = (Bool) pWin->realized; Bool wasViewable = (Bool) pWin->viewable; Bool anyMarked = FALSE; Mask parentNotify; WindowPtr pLayerWin = NULL; ScreenPtr pScreen = pWin->drawable.pScreen; if (!pWin->firstChild) return; parentNotify = SubSend(pWin); pHead = RealChildHead(pWin); if (wasViewable) pLayerWin = (*pScreen->GetLayerWindow) (pWin); for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) { if (pChild->mapped) { if (parentNotify || StrSend(pChild)) DeliverUnmapNotify(pChild, xFalse); if (pChild->viewable) { pChild->valdata = UnmapValData; anyMarked = TRUE; } pChild->mapped = FALSE; if (pChild->realized) UnrealizeTree(pChild, FALSE); } } if (wasViewable) { if (anyMarked) { if (pLayerWin->parent == pWin) (*pScreen->MarkWindow) (pWin); else { WindowPtr ptmp; (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); (*pScreen->MarkWindow) (pLayerWin->parent); /* Windows between pWin and pLayerWin may not have been marked */ ptmp = pWin; while (ptmp != pLayerWin->parent) { (*pScreen->MarkWindow) (ptmp); ptmp = ptmp->parent; } pHead = pWin->firstChild; } (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap); (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, VTUnmap); } } if (wasRealized) { WindowsRestructured(); WindowGone(pWin); } } void HandleSaveSet(ClientPtr client) { WindowPtr pParent, pWin; int j; for (j = 0; j < client->numSaved; j++) { pWin = SaveSetWindow(client->saveSet[j]); if (SaveSetToRoot(client->saveSet[j])) pParent = pWin->drawable.pScreen->root; else { pParent = pWin->parent; while (pParent && (wClient(pParent) == client)) pParent = pParent->parent; } if (pParent) { if (pParent != pWin->parent) { /* unmap first so that ReparentWindow doesn't remap */ if (!SaveSetShouldMap(client->saveSet[j])) UnmapWindow(pWin, FALSE); ReparentWindow(pWin, pParent, pWin->drawable.x - wBorderWidth(pWin) - pParent->drawable.x, pWin->drawable.y - wBorderWidth(pWin) - pParent->drawable.y, client); if (!pWin->realized && pWin->mapped) pWin->mapped = FALSE; } if (SaveSetShouldMap(client->saveSet[j])) MapWindow(pWin, client); } } free(client->saveSet); client->numSaved = 0; client->saveSet = NULL; } /** * * \param x,y in root */ Bool PointInWindowIsVisible(WindowPtr pWin, int x, int y) { BoxRec box; if (!pWin->realized) return FALSE; if (RegionContainsPoint(&pWin->borderClip, x, y, &box) && (!wInputShape(pWin) || RegionContainsPoint(wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box))) return TRUE; return FALSE; } RegionPtr NotClippedByChildren(WindowPtr pWin) { RegionPtr pReg = RegionCreate(NullBox, 1); if (pWin->parent || screenIsSaved != SCREEN_SAVER_ON || !HasSaverWindow(pWin->drawable.pScreen)) { RegionIntersect(pReg, &pWin->borderClip, &pWin->winSize); } return pReg; } void SendVisibilityNotify(WindowPtr pWin) { xEvent event; unsigned int visibility = pWin->visibility; #ifdef PANORAMIX /* This is not quite correct yet, but it's close */ if (!noPanoramiXExtension) { PanoramiXRes *win; WindowPtr pWin2; int rc, i, Scrnum; Scrnum = pWin->drawable.pScreen->myNum; win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum); if (!win || (win->u.win.visibility == visibility)) return; switch (visibility) { case VisibilityUnobscured: FOR_NSCREENS(i) { if (i == Scrnum) continue; rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient, DixWriteAccess); if (rc == Success) { if (pWin2->visibility == VisibilityPartiallyObscured) return; if (!i) pWin = pWin2; } } break; case VisibilityPartiallyObscured: if (Scrnum) { rc = dixLookupWindow(&pWin2, win->info[0].id, serverClient, DixWriteAccess); if (rc == Success) pWin = pWin2; } break; case VisibilityFullyObscured: FOR_NSCREENS(i) { if (i == Scrnum) continue; rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient, DixWriteAccess); if (rc == Success) { if (pWin2->visibility != VisibilityFullyObscured) return; if (!i) pWin = pWin2; } } break; } win->u.win.visibility = visibility; } #endif event = (xEvent) { .u.visibility.window = pWin->drawable.id, .u.visibility.state = visibility }; event.u.u.type = VisibilityNotify; DeliverEvents(pWin, &event, 1, NullWindow); } #define RANDOM_WIDTH 32 int dixSaveScreens(ClientPtr client, int on, int mode) { int rc, i, what, type; if (on == SCREEN_SAVER_FORCER) { if (mode == ScreenSaverReset) what = SCREEN_SAVER_OFF; else what = SCREEN_SAVER_ON; type = what; } else { what = on; type = what; if (what == screenIsSaved) type = SCREEN_SAVER_CYCLE; } for (i = 0; i < screenInfo.numScreens; i++) { rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i], DixShowAccess | DixHideAccess); if (rc != Success) return rc; } for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; if (on == SCREEN_SAVER_FORCER) (*pScreen->SaveScreen) (pScreen, on); if (pScreen->screensaver.ExternalScreenSaver) { if ((*pScreen->screensaver.ExternalScreenSaver) (pScreen, type, on == SCREEN_SAVER_FORCER)) continue; } if (type == screenIsSaved) continue; switch (type) { case SCREEN_SAVER_OFF: if (pScreen->screensaver.blanked == SCREEN_IS_BLANKED) { (*pScreen->SaveScreen) (pScreen, what); } else if (HasSaverWindow(pScreen)) { pScreen->screensaver.pWindow = NullWindow; FreeResource(pScreen->screensaver.wid, RT_NONE); } break; case SCREEN_SAVER_CYCLE: if (pScreen->screensaver.blanked == SCREEN_IS_TILED) { WindowPtr pWin = pScreen->screensaver.pWindow; /* make it look like screen saver is off, so that * NotClippedByChildren will compute a clip list * for the root window, so miPaintWindow works */ screenIsSaved = SCREEN_SAVER_OFF; (*pWin->drawable.pScreen->MoveWindow) (pWin, (short) (- (rand() % RANDOM_WIDTH)), (short) (- (rand() % RANDOM_WIDTH)), pWin->nextSib, VTMove); screenIsSaved = SCREEN_SAVER_ON; } /* * Call the DDX saver in case it wants to do something * at cycle time */ else if (pScreen->screensaver.blanked == SCREEN_IS_BLANKED) { (*pScreen->SaveScreen) (pScreen, type); } break; case SCREEN_SAVER_ON: if (ScreenSaverBlanking != DontPreferBlanking) { if ((*pScreen->SaveScreen) (pScreen, what)) { pScreen->screensaver.blanked = SCREEN_IS_BLANKED; continue; } if ((ScreenSaverAllowExposures != DontAllowExposures) && TileScreenSaver(pScreen, SCREEN_IS_BLACK)) { pScreen->screensaver.blanked = SCREEN_IS_BLACK; continue; } } if ((ScreenSaverAllowExposures != DontAllowExposures) && TileScreenSaver(pScreen, SCREEN_IS_TILED)) { pScreen->screensaver.blanked = SCREEN_IS_TILED; } else pScreen->screensaver.blanked = SCREEN_ISNT_SAVED; break; } } screenIsSaved = what; if (mode == ScreenSaverReset) { if (on == SCREEN_SAVER_FORCER) { DeviceIntPtr dev; UpdateCurrentTimeIf(); nt_list_for_each_entry(dev, inputInfo.devices, next) NoticeTime(dev, currentTime); } SetScreenSaverTimer(); } return Success; } int SaveScreens(int on, int mode) { return dixSaveScreens(serverClient, on, mode); } static Bool TileScreenSaver(ScreenPtr pScreen, int kind) { int j; int result; XID attributes[3]; Mask mask; WindowPtr pWin; CursorMetricRec cm; unsigned char *srcbits, *mskbits; CursorPtr cursor; XID cursorID = 0; int attri; mask = 0; attri = 0; switch (kind) { case SCREEN_IS_TILED: switch (pScreen->root->backgroundState) { case BackgroundPixel: attributes[attri++] = pScreen->root->background.pixel; mask |= CWBackPixel; break; case BackgroundPixmap: attributes[attri++] = None; mask |= CWBackPixmap; break; default: break; } break; case SCREEN_IS_BLACK: attributes[attri++] = pScreen->root->drawable.pScreen->blackPixel; mask |= CWBackPixel; break; } mask |= CWOverrideRedirect; attributes[attri++] = xTrue; /* * create a blank cursor */ cm.width = 16; cm.height = 16; cm.xhot = 8; cm.yhot = 8; srcbits = malloc(BitmapBytePad(32) * 16); mskbits = malloc(BitmapBytePad(32) * 16); if (!srcbits || !mskbits) { free(srcbits); free(mskbits); cursor = 0; } else { for (j = 0; j < BitmapBytePad(32) * 16; j++) srcbits[j] = mskbits[j] = 0x0; result = AllocARGBCursor(srcbits, mskbits, NULL, &cm, 0, 0, 0, 0, 0, 0, &cursor, serverClient, (XID) 0); if (cursor) { cursorID = FakeClientID(0); if (AddResource(cursorID, RT_CURSOR, (void *) cursor)) { attributes[attri] = cursorID; mask |= CWCursor; } else cursor = 0; } else { free(srcbits); free(mskbits); } } pWin = pScreen->screensaver.pWindow = CreateWindow(pScreen->screensaver.wid, pScreen->root, -RANDOM_WIDTH, -RANDOM_WIDTH, (unsigned short) pScreen->width + RANDOM_WIDTH, (unsigned short) pScreen->height + RANDOM_WIDTH, 0, InputOutput, mask, attributes, 0, serverClient, wVisual(pScreen->root), &result); if (cursor) FreeResource(cursorID, RT_NONE); if (!pWin) return FALSE; if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pScreen->screensaver.pWindow)) return FALSE; if (mask & CWBackPixmap) { MakeRootTile(pWin); (*pWin->drawable.pScreen->ChangeWindowAttributes) (pWin, CWBackPixmap); } MapWindow(pWin, serverClient); return TRUE; } /* * FindWindowWithOptional * * search ancestors of the given window for an entry containing * a WindowOpt structure. Assumptions: some parent will * contain the structure. */ WindowPtr FindWindowWithOptional(WindowPtr w) { do w = w->parent; while (!w->optional); return w; } /* * CheckWindowOptionalNeed * * check each optional entry in the given window to see if * the value is satisfied by the default rules. If so, * release the optional record */ void CheckWindowOptionalNeed(WindowPtr w) { WindowOptPtr optional; WindowOptPtr parentOptional; if (!w->parent || !w->optional) return; optional = w->optional; if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate]) return; if (optional->otherEventMasks != 0) return; if (optional->otherClients != NULL) return; if (optional->passiveGrabs != NULL) return; if (optional->userProps != NULL) return; if (optional->backingBitPlanes != (CARD32)~0L) return; if (optional->backingPixel != 0) return; if (optional->boundingShape != NULL) return; if (optional->clipShape != NULL) return; if (optional->inputShape != NULL) return; if (optional->inputMasks != NULL) return; if (optional->deviceCursors != NULL) { DevCursNodePtr pNode = optional->deviceCursors; while (pNode) { if (pNode->cursor != None) return; pNode = pNode->next; } } parentOptional = FindWindowWithOptional(w)->optional; if (optional->visual != parentOptional->visual) return; if (optional->cursor != None && (optional->cursor != parentOptional->cursor || w->parent->cursorIsNone)) return; if (optional->colormap != parentOptional->colormap) return; DisposeWindowOptional(w); } /* * MakeWindowOptional * * create an optional record and initialize it with the default * values. */ Bool MakeWindowOptional(WindowPtr pWin) { WindowOptPtr optional; WindowOptPtr parentOptional; if (pWin->optional) return TRUE; optional = malloc(sizeof(WindowOptRec)); if (!optional) return FALSE; optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate]; optional->otherEventMasks = 0; optional->otherClients = NULL; optional->passiveGrabs = NULL; optional->userProps = NULL; optional->backingBitPlanes = ~0L; optional->backingPixel = 0; optional->boundingShape = NULL; optional->clipShape = NULL; optional->inputShape = NULL; optional->inputMasks = NULL; optional->deviceCursors = NULL; parentOptional = FindWindowWithOptional(pWin)->optional; optional->visual = parentOptional->visual; if (!pWin->cursorIsNone) { optional->cursor = RefCursor(parentOptional->cursor); } else { optional->cursor = None; } optional->colormap = parentOptional->colormap; pWin->optional = optional; return TRUE; } /* * Changes the cursor struct for the given device and the given window. * A cursor that does not have a device cursor set will use whatever the * standard cursor is for the window. If all devices have a cursor set, * changing the window cursor (e.g. using XDefineCursor()) will not have any * visible effect. Only when one of the device cursors is set to None again, * this device's cursor will display the changed standard cursor. * * CursorIsNone of the window struct is NOT modified if you set a device * cursor. * * Assumption: If there is a node for a device in the list, the device has a * cursor. If the cursor is set to None, it is inherited by the parent. */ int ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor) { DevCursNodePtr pNode, pPrev; CursorPtr pOldCursor = NULL; ScreenPtr pScreen; WindowPtr pChild; if (!pWin->optional && !MakeWindowOptional(pWin)) return BadAlloc; /* 1) Check if window has device cursor set * Yes: 1.1) swap cursor with given cursor if parent does not have same * cursor, free old cursor * 1.2) free old cursor, use parent cursor * No: 1.1) add node to beginning of list. * 1.2) add cursor to node if parent does not have same cursor * 1.3) use parent cursor if parent does not have same cursor * 2) Patch up children if child has a devcursor * 2.1) if child has cursor None, it inherited from parent, set to old * cursor * 2.2) if child has same cursor as new cursor, remove and set to None */ pScreen = pWin->drawable.pScreen; if (WindowSeekDeviceCursor(pWin, pDev, &pNode, &pPrev)) { /* has device cursor */ if (pNode->cursor == pCursor) return Success; pOldCursor = pNode->cursor; if (!pCursor) { /* remove from list */ if (pPrev) pPrev->next = pNode->next; else /* first item in list */ pWin->optional->deviceCursors = pNode->next; free(pNode); goto out; } } else { /* no device cursor yet */ DevCursNodePtr pNewNode; if (!pCursor) return Success; pNewNode = malloc(sizeof(DevCursNodeRec)); pNewNode->dev = pDev; pNewNode->next = pWin->optional->deviceCursors; pWin->optional->deviceCursors = pNewNode; pNode = pNewNode; } if (pCursor && WindowParentHasDeviceCursor(pWin, pDev, pCursor)) pNode->cursor = None; else { pNode->cursor = RefCursor(pCursor); } pNode = pPrev = NULL; /* fix up children */ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (WindowSeekDeviceCursor(pChild, pDev, &pNode, &pPrev)) { if (pNode->cursor == None) { /* inherited from parent */ pNode->cursor = RefCursor(pOldCursor); } else if (pNode->cursor == pCursor) { pNode->cursor = None; FreeCursor(pCursor, (Cursor) 0); /* fix up refcnt */ } } } out: CursorVisible = TRUE; if (pWin->realized) WindowHasNewCursor(pWin); if (pOldCursor) FreeCursor(pOldCursor, (Cursor) 0); /* FIXME: We SHOULD check for an error value here XXX (comment taken from ChangeWindowAttributes) */ (*pScreen->ChangeWindowAttributes) (pWin, CWCursor); return Success; } /* Get device cursor for given device or None if none is set */ CursorPtr WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev) { DevCursorList pList; if (!pWin->optional || !pWin->optional->deviceCursors) return NULL; pList = pWin->optional->deviceCursors; while (pList) { if (pList->dev == pDev) { if (pList->cursor == None) /* inherited from parent */ return WindowGetDeviceCursor(pWin->parent, pDev); else return pList->cursor; } pList = pList->next; } return NULL; } /* Searches for a DevCursorNode for the given window and device. If one is * found, return True and set pNode and pPrev to the node and to the node * before the node respectively. Otherwise return False. * If the device is the first in list, pPrev is set to NULL. */ static Bool WindowSeekDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, DevCursNodePtr * pNode, DevCursNodePtr * pPrev) { DevCursorList pList; if (!pWin->optional) return FALSE; pList = pWin->optional->deviceCursors; if (pList && pList->dev == pDev) { *pNode = pList; *pPrev = NULL; return TRUE; } while (pList) { if (pList->next) { if (pList->next->dev == pDev) { *pNode = pList->next; *pPrev = pList; return TRUE; } } pList = pList->next; } return FALSE; } /* Return True if a parent has the same device cursor set or False if * otherwise */ static Bool WindowParentHasDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor) { WindowPtr pParent; DevCursNodePtr pParentNode, pParentPrev; pParent = pWin->parent; while (pParent) { if (WindowSeekDeviceCursor(pParent, pDev, &pParentNode, &pParentPrev)) { /* if there is a node in the list, the win has a dev cursor */ if (!pParentNode->cursor) /* inherited. */ pParent = pParent->parent; else if (pParentNode->cursor == pCursor) /* inherit */ return TRUE; else /* different cursor */ return FALSE; } else /* parent does not have a device cursor for our device */ return FALSE; } return FALSE; } /* * SetRootClip -- * Enable or disable rendering to the screen by * setting the root clip list and revalidating * all of the windows */ void SetRootClip(ScreenPtr pScreen, Bool enable) { WindowPtr pWin = pScreen->root; WindowPtr pChild; Bool WasViewable; Bool anyMarked = FALSE; WindowPtr pLayerWin; BoxRec box; if (!pWin) return; WasViewable = (Bool) (pWin->viewable); if (WasViewable) { for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { (void) (*pScreen->MarkOverlappedWindows) (pChild, pChild, &pLayerWin); } (*pScreen->MarkWindow) (pWin); anyMarked = TRUE; if (pWin->valdata) { if (HasBorder(pWin)) { RegionPtr borderVisible; borderVisible = RegionCreate(NullBox, 1); RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } pWin->valdata->before.resized = TRUE; } } /* * Use REGION_BREAK to avoid optimizations in ValidateTree * that assume the root borderClip can't change well, normally * it doesn't...) */ if (enable) { box.x1 = 0; box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; RegionInit(&pWin->winSize, &box, 1); RegionInit(&pWin->borderSize, &box, 1); if (WasViewable) RegionReset(&pWin->borderClip, &box); pWin->drawable.width = pScreen->width; pWin->drawable.height = pScreen->height; RegionBreak(&pWin->clipList); } else { RegionEmpty(&pWin->borderClip); RegionBreak(&pWin->clipList); } ResizeChildrenWinSize(pWin, 0, 0, 0, 0); if (WasViewable) { if (pWin->firstChild) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin->firstChild, pWin->firstChild, NULL); } else { (*pScreen->MarkWindow) (pWin); anyMarked = TRUE; } if (anyMarked) { (*pScreen->ValidateTree) (pWin, NullWindow, VTOther); (*pScreen->HandleExposures) (pWin); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pWin, NullWindow, VTOther); } } if (pWin->realized) 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; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/glyphcurs.c������������������������������������������������������������������0000664�0001751�0001751�00000014305�12456571574�014004� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ************************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "misc.h" #include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #include "scrnintstr.h" #include "gcstruct.h" #include "resource.h" #include "dix.h" #include "cursorstr.h" #include "opaque.h" #include "servermd.h" /* get the bits out of the font in a portable way. to avoid dealing with padding and such-like, we draw the glyph into a bitmap, then read the bits out with GetImage, which uses server-natural format. since all screens return the same bitmap format, we'll just use the first one we find. the character origin lines up with the hotspot in the cursor metrics. */ int ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned char **ppbits) { ScreenPtr pScreen; GCPtr pGC; xRectangle rect; PixmapPtr ppix; long nby; char *pbits; ChangeGCVal gcval[3]; unsigned char char2b[2]; /* turn glyph index into a protocol-format char2b */ char2b[0] = (unsigned char) (ch >> 8); char2b[1] = (unsigned char) (ch & 0xff); pScreen = screenInfo.screens[0]; nby = BitmapBytePad(cm->width) * (long) cm->height; pbits = calloc(1, nby); if (!pbits) return BadAlloc; ppix = (PixmapPtr) (*pScreen->CreatePixmap) (pScreen, cm->width, cm->height, 1, CREATE_PIXMAP_USAGE_SCRATCH); pGC = GetScratchGC(1, pScreen); if (!ppix || !pGC) { if (ppix) (*pScreen->DestroyPixmap) (ppix); if (pGC) FreeScratchGC(pGC); free(pbits); return BadAlloc; } rect.x = 0; rect.y = 0; rect.width = cm->width; rect.height = cm->height; /* fill the pixmap with 0 */ gcval[0].val = GXcopy; gcval[1].val = 0; gcval[2].ptr = (void *) pfont; ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, gcval); ValidateGC((DrawablePtr) ppix, pGC); (*pGC->ops->PolyFillRect) ((DrawablePtr) ppix, pGC, 1, &rect); /* draw the glyph */ gcval[0].val = 1; ChangeGC(NullClient, pGC, GCForeground, gcval); ValidateGC((DrawablePtr) ppix, pGC); (*pGC->ops->PolyText16) ((DrawablePtr) ppix, pGC, cm->xhot, cm->yhot, 1, (unsigned short *) char2b); (*pScreen->GetImage) ((DrawablePtr) ppix, 0, 0, cm->width, cm->height, XYPixmap, 1, pbits); *ppbits = (unsigned char *) pbits; FreeScratchGC(pGC); (*pScreen->DestroyPixmap) (ppix); return Success; } Bool CursorMetricsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm) { CharInfoPtr pci; unsigned long nglyphs; CARD8 chs[2]; FontEncoding encoding; chs[0] = ch >> 8; chs[1] = ch; encoding = (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit; if (encoding == Linear16Bit) { if (ch < pfont->info.firstCol || pfont->info.lastCol < ch) return FALSE; } else { if (chs[0] < pfont->info.firstRow || pfont->info.lastRow < chs[0]) return FALSE; if (chs[1] < pfont->info.firstCol || pfont->info.lastCol < chs[1]) return FALSE; } (*pfont->get_glyphs) (pfont, 1, chs, encoding, &nglyphs, &pci); if (nglyphs == 0) return FALSE; cm->width = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; cm->height = pci->metrics.descent + pci->metrics.ascent; if (pci->metrics.leftSideBearing > 0) { cm->width += pci->metrics.leftSideBearing; cm->xhot = 0; } else { cm->xhot = -pci->metrics.leftSideBearing; if (pci->metrics.rightSideBearing < 0) cm->width -= pci->metrics.rightSideBearing; } if (pci->metrics.ascent < 0) { cm->height -= pci->metrics.ascent; cm->yhot = 0; } else { cm->yhot = pci->metrics.ascent; if (pci->metrics.descent < 0) cm->height -= pci->metrics.descent; } return TRUE; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/property.c�������������������������������������������������������������������0000664�0001751�0001751�00000046635�12456571574�013663� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "windowstr.h" #include "propertyst.h" #include "dixstruct.h" #include "dispatch.h" #include "swaprep.h" #include "xace.h" /***************************************************************** * Property Stuff * * dixLookupProperty, dixChangeProperty, DeleteProperty * * Properties belong to windows. The list of properties should not be * traversed directly. Instead, use the three functions listed above. * *****************************************************************/ #ifdef notdef static void PrintPropertys(WindowPtr pWin) { PropertyPtr pProp; int j; pProp = pWin->userProps; while (pProp) { ErrorF("[dix] %x %x\n", pProp->propertyName, pProp->type); ErrorF("[dix] property format: %d\n", pProp->format); ErrorF("[dix] property data: \n"); for (j = 0; j < (pProp->format / 8) * pProp->size; j++) ErrorF("[dix] %c\n", pProp->data[j]); pProp = pProp->next; } } #endif int dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName, ClientPtr client, Mask access_mode) { PropertyPtr pProp; int rc = BadMatch; client->errorValue = propertyName; for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) if (pProp->propertyName == propertyName) break; if (pProp) rc = XaceHookPropertyAccess(client, pWin, &pProp, access_mode); *result = pProp; return rc; } static void deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom) { 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; DeliverEvents(pWin, &event, 1, (WindowPtr) NULL); } int ProcRotateProperties(ClientPtr client) { int i, j, delta, rc; REQUEST(xRotatePropertiesReq); WindowPtr pWin; Atom *atoms; PropertyPtr *props; /* array of pointer */ PropertyPtr pProp, saved; REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); UpdateCurrentTime(); rc = dixLookupWindow(&pWin, stuff->window, client, DixSetPropAccess); if (rc != Success || stuff->nAtoms <= 0) return rc; atoms = (Atom *) &stuff[1]; props = malloc(stuff->nAtoms * sizeof(PropertyPtr)); saved = malloc(stuff->nAtoms * sizeof(PropertyRec)); if (!props || !saved) { rc = BadAlloc; goto out; } for (i = 0; i < stuff->nAtoms; i++) { if (!ValidAtom(atoms[i])) { rc = BadAtom; client->errorValue = atoms[i]; goto out; } for (j = i + 1; j < stuff->nAtoms; j++) if (atoms[j] == atoms[i]) { rc = BadMatch; goto out; } rc = dixLookupProperty(&pProp, pWin, atoms[i], client, DixReadAccess | DixWriteAccess); if (rc != Success) goto out; props[i] = pProp; saved[i] = *pProp; } delta = stuff->nPositions; /* If the rotation is a complete 360 degrees, then moving the properties around and generating PropertyNotify events should be skipped. */ if (abs(delta) % stuff->nAtoms) { while (delta < 0) /* faster if abs value is small */ delta += stuff->nAtoms; for (i = 0; i < stuff->nAtoms; i++) { j = (i + delta) % stuff->nAtoms; deliverPropertyNotifyEvent(pWin, PropertyNewValue, atoms[i]); /* Preserve name and devPrivates */ props[j]->type = saved[i].type; props[j]->format = saved[i].format; props[j]->size = saved[i].size; props[j]->data = saved[i].data; } } out: free(saved); free(props); return rc; } int ProcChangeProperty(ClientPtr client) { WindowPtr pWin; char format, mode; unsigned long len; int sizeInBytes, totalSize, err; REQUEST(xChangePropertyReq); REQUEST_AT_LEAST_SIZE(xChangePropertyReq); 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(xChangePropertyReq, totalSize); err = dixLookupWindow(&pWin, stuff->window, client, DixSetPropAccess); if (err != Success) return err; if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; return BadAtom; } if (!ValidAtom(stuff->type)) { client->errorValue = stuff->type; return BadAtom; } err = dixChangeWindowProperty(client, pWin, stuff->property, stuff->type, (int) format, (int) mode, len, &stuff[1], TRUE); if (err != Success) return err; else return Success; } int dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, Atom type, int format, int mode, unsigned long len, void *value, Bool sendevent) { PropertyPtr pProp; PropertyRec savedProp; int sizeInBytes, totalSize, rc; unsigned char *data; Mask access_mode; sizeInBytes = format >> 3; totalSize = len * sizeInBytes; access_mode = (mode == PropModeReplace) ? DixWriteAccess : DixBlendAccess; /* first see if property already exists */ rc = dixLookupProperty(&pProp, pWin, property, pClient, access_mode); if (rc == BadMatch) { /* just add to list */ if (!pWin->optional && !MakeWindowOptional(pWin)) return BadAlloc; pProp = dixAllocateObjectWithPrivates(PropertyRec, PRIVATE_PROPERTY); if (!pProp) return BadAlloc; data = malloc(totalSize); if (!data && len) { dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); return BadAlloc; } memcpy(data, value, totalSize); pProp->propertyName = property; pProp->type = type; pProp->format = format; pProp->data = data; pProp->size = len; rc = XaceHookPropertyAccess(pClient, pWin, &pProp, DixCreateAccess | DixWriteAccess); if (rc != Success) { free(data); dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); pClient->errorValue = property; return rc; } pProp->next = pWin->optional->userProps; pWin->optional->userProps = pProp; } else if (rc == Success) { /* 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 != pProp->format) && (mode != PropModeReplace)) return BadMatch; if ((pProp->type != type) && (mode != PropModeReplace)) return BadMatch; /* save the old values for later */ savedProp = *pProp; if (mode == PropModeReplace) { data = malloc(totalSize); if (!data && len) return BadAlloc; memcpy(data, value, totalSize); pProp->data = data; pProp->size = len; pProp->type = type; pProp->format = format; } else if (len == 0) { /* do nothing */ } else if (mode == PropModeAppend) { data = malloc((pProp->size + len) * sizeInBytes); if (!data) return BadAlloc; memcpy(data, pProp->data, pProp->size * sizeInBytes); memcpy(data + pProp->size * sizeInBytes, value, totalSize); pProp->data = data; pProp->size += len; } else if (mode == PropModePrepend) { data = malloc(sizeInBytes * (len + pProp->size)); if (!data) return BadAlloc; memcpy(data + totalSize, pProp->data, pProp->size * sizeInBytes); memcpy(data, value, totalSize); pProp->data = data; pProp->size += len; } /* Allow security modules to check the new content */ access_mode |= DixPostAccess; rc = XaceHookPropertyAccess(pClient, pWin, &pProp, access_mode); if (rc == Success) { if (savedProp.data != pProp->data) free(savedProp.data); } else { if (savedProp.data != pProp->data) free(pProp->data); *pProp = savedProp; return rc; } } else return rc; if (sendevent) deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp->propertyName); return Success; } int ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, int mode, unsigned long len, void *value, Bool sendevent) { return dixChangeWindowProperty(serverClient, pWin, property, type, format, mode, len, value, sendevent); } int DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName) { PropertyPtr pProp, prevProp; int rc; rc = dixLookupProperty(&pProp, pWin, propName, client, DixDestroyAccess); if (rc == BadMatch) return Success; /* Succeed if property does not exist */ if (rc == Success) { if (pWin->optional->userProps == pProp) { /* Takes care of head */ if (!(pWin->optional->userProps = pProp->next)) CheckWindowOptionalNeed(pWin); } else { /* Need to traverse to find the previous element */ prevProp = pWin->optional->userProps; while (prevProp->next != pProp) prevProp = prevProp->next; prevProp->next = pProp->next; } deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName); free(pProp->data); dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); } return rc; } void DeleteAllWindowProperties(WindowPtr pWin) { PropertyPtr pProp, pNextProp; pProp = wUserProps(pWin); while (pProp) { deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName); pNextProp = pProp->next; free(pProp->data); dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); pProp = pNextProp; } if (pWin->optional) pWin->optional->userProps = NULL; } static int NullPropertyReply(ClientPtr client, ATOM propertyType, int format) { 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; } /***************** * GetProperty * If type Any is specified, returns the property from the specified * window regardless of its type. If a type is specified, returns the * property only if its type equals the specified type. * If delete is True and a property is returned, the property is also * deleted from the window and a PropertyNotify event is generated on the * window. *****************/ int ProcGetProperty(ClientPtr client) { PropertyPtr pProp, prevProp; unsigned long n, len, ind; int rc; WindowPtr pWin; xGetPropertyReply reply; Mask win_mode = DixGetPropAccess, prop_mode = DixReadAccess; REQUEST(xGetPropertyReq); REQUEST_SIZE_MATCH(xGetPropertyReq); if (stuff->delete) { UpdateCurrentTime(); win_mode |= DixSetPropAccess; prop_mode |= DixDestroyAccess; } rc = dixLookupWindow(&pWin, stuff->window, client, win_mode); if (rc != Success) return rc; 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; } rc = dixLookupProperty(&pProp, pWin, stuff->property, client, prop_mode); if (rc == BadMatch) return NullPropertyReply(client, None, 0); else if (rc != Success) return rc; /* If the request type and actual type don't match. Return the property information, but not the data. */ if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType)) ) { 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; } /* * Return type, format, value to client */ n = (pProp->format / 8) * pProp->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); 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); WriteReplyToClient(client, sizeof(xGenericReply), &reply); if (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, (char *) pProp->data + ind); } if (stuff->delete && (reply.bytesAfter == 0)) { /* Delete the Property */ if (pWin->optional->userProps == pProp) { /* Takes care of head */ if (!(pWin->optional->userProps = pProp->next)) CheckWindowOptionalNeed(pWin); } else { /* Need to traverse to find the previous element */ prevProp = pWin->optional->userProps; while (prevProp->next != pProp) prevProp = prevProp->next; prevProp->next = pProp->next; } free(pProp->data); dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); } return Success; } int ProcListProperties(ClientPtr client) { Atom *pAtoms = NULL, *temppAtoms; xListPropertiesReply xlpr; int rc, numProps = 0; WindowPtr pWin; PropertyPtr pProp, realProp; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixListPropAccess); if (rc != Success) return rc; for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) numProps++; if (numProps && !(pAtoms = malloc(numProps * sizeof(Atom)))) return BadAlloc; numProps = 0; temppAtoms = pAtoms; for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) { realProp = pProp; rc = XaceHookPropertyAccess(client, pWin, &realProp, DixGetAttrAccess); if (rc == Success && realProp == pProp) { *temppAtoms++ = pProp->propertyName; numProps++; } } 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; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); } free(pAtoms); return Success; } int ProcDeleteProperty(ClientPtr client) { WindowPtr pWin; REQUEST(xDeletePropertyReq); int result; REQUEST_SIZE_MATCH(xDeletePropertyReq); UpdateCurrentTime(); result = dixLookupWindow(&pWin, stuff->window, client, DixSetPropAccess); if (result != Success) return result; if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; return BadAtom; } return DeleteProperty(client, pWin, stuff->property); } ���������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/BuiltInAtoms�����������������������������������������������������������������0000664�0001751�0001751�00000024523�12160102336�014072� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������File: .../x11/server/dix/BuiltInAtoms This file is of a fixed format and is used to generate both the file include/XAtom.h and dix/initatoms.c. Neither of those files should be edited directly. Changing the atoms in this file, or even the order in which they occur, is equivalent to forcing a new (minor) version number on the server. Take care. The format of the file is that each built in atom starts in column 1 with no text, other than spaces and tabs, on that line other than a mandatory trailing "@" at the end of the line. For each atom (Foo) below the defines will be of the form #define XA_Foo <n> and the string value of the atom will be "Foo". The comment lines in this file are not guaranteed to be accurate. To see the current truth, look at the Xlib documentation as well as the protocol spec. Atoms occur in five distinct name spaces within the protocol. Any particular atom may or may not have some client interpretation within each of the name spaces. For each of the built in atoms, the intended semantics and the space within which it is defined is indicated. Those name spaces are Property names Property types Selections Font properties Type of a ClientMessage event (none built into server) For the font properties mentioned here, see the spec for more information. -- Selections -- PRIMARY @ Selection. SECONDARY @ Selection. -- Property types and names -- ARC @ Property type: x, y: INT16 width, height: CARD16, angle1, angle2: INT16 ATOM @ Property type: atom: ATOM BITMAP @ Property type: bitmap: PIXMAP This is asserted to be of depth 1. CARDINAL @ Property type: card: CARD32 or CARD16 or CARD8 the datum size is dependent on the property format COLORMAP @ Property type: colormap: COLORMAP CURSOR @ Property type: cursor: CURSOR CUT_BUFFER0 @ CUT_BUFFER1 @ CUT_BUFFER2 @ CUT_BUFFER3 @ CUT_BUFFER4 @ CUT_BUFFER5 @ CUT_BUFFER6 @ CUT_BUFFER7 @ Property name: (type: STRING) Used to implement cut buffer ring, in particular Andrew uses this mechanism. Anyone else using this sort of IPC mechanism should use these properties. Data is normally fetched and stored out of CUT_BUFFER0; the RotateProperties request is used to rotate these buffers. DRAWABLE @ Property type: drawable: DRAWABLE FONT @ Property type: font: FONT INTEGER @ Property type: card: INT32 or INT16 or INT8 the datum size is dependent on the property format PIXMAP @ Property type: pixmap: PIXMAP POINT @ Property type: x, y: INT16 RECTANGLE @ Property type: x, y: INT16 width, height: CARD16 RESOURCE_MANAGER @ Property name: (type: STRING) Contents of the user's resource manager data base. RGB_COLOR_MAP @ Property type: colormap: COLORMAP red-max: CARD32 red-mult: CARD32 green-max: CARD32 green-mult: CARD32 blue-max: CARD32 blue-mult: CARD32 base-pixel: CARD32 The fields `red_max', `green_max', and `blue_max' give the maximum red, green, and blue values, respectively. Each color coefficient ranges from 0 to its max, inclusive. For example, a common colormap allocation is 3/3/2: 3 planes for red, 3 planes for green, and 2 planes for blue. Such a colormap would have red_max == 7, green_max = 7, and blue_max = 3. An alternate allocation that uses only 216 colors is red_max = 5, green_max = 5, and blue_max = 5. The fields `red_mult', `green_mult', and `blue_mult' give the scale factors used to compose a full pixel value. (See next paragraph.) For a 3/3/2 allocation red_mult might be 32, green_mult might be 4, and blue_mult might be 1. For a 6-colors-each allocation, red_mult might be 36, green_mult might be 6, and blue_mult might be 1. The field `base_pixel' gives the base pixel value used to compose a full pixel value. Normally base_pixel is obtained from a call to XAllocColorPlanes(). Given integer red, green, and blue coefficients in their appropriate ranges, one can compute a corresponding pixel value with the expression: r * red_mult + g * green_mult + b * blue_mult + base_pixel For gray-scale colormaps, only the colormap, red_max, red_mult, and base_pixel fields are defined; the other fields are ignored. To compute a gray-scale pixel value, use: gray * red_mult + base_pixel This is provided to allow applications to share color maps. RGB_BEST_MAP @ RGB_BLUE_MAP @ RGB_DEFAULT_MAP @ RGB_GRAY_MAP @ RGB_GREEN_MAP @ RGB_RED_MAP @ Property name: (type: RGB_COLOR_MAP) The needs of most applications can be met with five colormaps. Polite applications may need only a small RGB space, and can use a portion of the default color map. Applications doing high-quality RGB rendering will need an entire colormap, filled with as large an RGB space as possible, e.g. 332. For color separations, an application may need maximum device resolution for each of red, green, and blue, even if this requires three renderings with three colormaps. Each of the above five names would be used for sharing color maps. STRING @ Property type: sequence of Bytes VISUALID @ Property type: visual: VISUALID WINDOW @ Property type: window: WINDOW WM_COMMAND @ Property name: (type: STRING) Command line arguments used to invoke this application. The arguments are delimited by null characters (ASCII 0). WM_HINTS @ Property type: flags: CARD32 input: BOOL32 initial-state: CARD32 icon-pixmap: PIXMAP icon-window: WINDOW icon_mask: BITMAP icon-x, icon-y: INT32 flags contains the following bits 0x00000001 input hint 0x00000002 state hint 0x00000004 icon pixmap hint 0x00000008 icon window hint 0x00000010 icon position hint values for initial-state 0 unspecified -> application does not care and WM should pick one. 1 normal 2 zoomed 3 iconic 4 inactive -> application believes itself to be seldomly used. WM may wish to place it on an inactive menu. This type is potentially extensible. The order is critical; append to the end only. Property name: (type: WM_HINTS) Additional hints set by the client for use by the window manager. WM_CLIENT_MACHINE @ Property name: (type: STRING) used to communicate with the window manager. The host name of the machine the client is running on may be set here. WM_ICON_NAME @ Property name: (type: STRING) what the application would like the label to be for the iconic form of the window. WM_ICON_SIZE @ Property type: minWidth, min-height: CARD32 maxWidth, max-height: CARD32 widthInc, height-inc: CARD32 Property name: (type: ICON_SIZE) The window manager may set this property on the root window to specify the icon sizes it allows. WM_NAME @ Property name: (type: STRING) used to communicate with the window manager. This is what the application would like the label for the window. WM_NORMAL_HINTS @ Property name: (type: SIZE_HINTS) used to communicate with the window manager. This is size hints for a window in its "normal" state. WM_SIZE_HINTS @ Property type: flags: CARD32 x, y: INT32 width, height: CARD32 min-width, min-height: CARD32 max-width, max-height: CARD32 width-inc, height-inc: CARD32 min-aspect-x, min-aspect-y: CARD32 max-aspect-x, max-aspect-y: CARD32 flags contains the following bits 0x00000001 user specified x and y 0x00000002 user specified width and height 0x00000004 program specified position 0x00000008 program specified size 0x00000010 program specified minimum size 0x00000020 program specified maximum size 0x00000040 program specified resize increment 0x00000080 program specified aspect ratio This type is potentially extensible. The order is critical; append to the end only. WM_ZOOM_HINTS @ Property name: (type: SIZE_HINTS) used to communicate with the window manager. This is size hints for a window in its "zoomed" state. -- Font properties -- MIN_SPACE @ Font property: CARD32 NORM_SPACE @ Font property: CARD32 MAX_SPACE @ Font property: CARD32 END_SPACE @ Font property: CARD32 SUPERSCRIPT_X @ Font property: INT32 SUPERSCRIPT_Y @ Font property: INT32 SUBSCRIPT_X @ Font property: INT32 SUBSCRIPT_Y @ Font property: INT32 UNDERLINE_POSITION @ Font property: INT32 UNDERLINE_THICKNESS @ Font property: CARD32 STRIKEOUT_ASCENT @ Font property: INT32 STRIKEOUT_DESCENT @ Font property: INT32 ITALIC_ANGLE @ Font property: INT32 X_HEIGHT @ Font property: INT32 QUAD_WIDTH @ Font property: INT32 WEIGHT @ Font property: CARD32 POINT_SIZE @ Font property: CARD32 RESOLUTION @ Font property: CARD32 The following optional properties on fonts have values that are atoms. The atom print name is the useful information. COPYRIGHT @ of the font distribution NOTICE @ trademark/copyright of the character shapes FONT_NAME @ name of this particular instance of a font FAMILY_NAME @ name of the 'font family' to which it belongs FULL_NAME @ full text name of the font The following aren't in order but putting them at the end avoids encoding changes. CAP_HEIGHT @ Font property: CARD32 WM_CLASS @ Property name: (type: STRING) Used (possibly by some window managers; definitely by session managers) to look up resources in the resource data base on behalf of the client who set this property. There are 2 elements: {char *resource_name; char *resource_class;} delimited by a null character (ascii 0) WM_TRANSIENT_FOR @ Property name: (type: WINDOW) Used by transient top-level windows, such as dialog boxes, to point to their logical "parents". The window manager can then take down the dialog boxes when the "parent" gets iconified, for instance. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/pixmap.c���������������������������������������������������������������������0000664�0001751�0001751�00000017243�12404747323�013254� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include "scrnintstr.h" #include "misc.h" #include "os.h" #include "windowstr.h" #include "resource.h" #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" #include "site.h" /* * Scratch pixmap management and device independent pixmap allocation * function. */ /* callable by ddx */ PixmapPtr GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData) { PixmapPtr pPixmap = pScreen->pScratchPixmap; if (pPixmap) pScreen->pScratchPixmap = NULL; else /* width and height of 0 means don't allocate any pixmap data */ pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, 0); if (pPixmap) { if ((*pScreen->ModifyPixmapHeader) (pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData)) return pPixmap; (*pScreen->DestroyPixmap) (pPixmap); } return NullPixmap; } /* callable by ddx */ void FreeScratchPixmapHeader(PixmapPtr pPixmap) { if (pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */ if (pScreen->pScratchPixmap) (*pScreen->DestroyPixmap) (pPixmap); else pScreen->pScratchPixmap = pPixmap; } } Bool CreateScratchPixmapsForScreen(ScreenPtr pScreen) { unsigned int pixmap_size; pixmap_size = sizeof(PixmapRec) + dixScreenSpecificPrivatesSize(pScreen, PRIVATE_PIXMAP); pScreen->totalPixmapSize = BitmapBytePad(pixmap_size * 8); /* let it be created on first use */ pScreen->pScratchPixmap = NULL; return TRUE; } void FreeScratchPixmapsForScreen(ScreenPtr pScreen) { FreeScratchPixmapHeader(pScreen->pScratchPixmap); } /* callable by ddx */ PixmapPtr AllocatePixmap(ScreenPtr pScreen, int pixDataSize) { PixmapPtr pPixmap; assert(pScreen->totalPixmapSize > 0); if (pScreen->totalPixmapSize > ((size_t) - 1) - pixDataSize) return NullPixmap; pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); if (!pPixmap) return NullPixmap; dixInitScreenPrivates(pScreen, pPixmap, pPixmap + 1, PRIVATE_PIXMAP); return pPixmap; } /* callable by ddx */ void 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 PixmapStartDirtyTracking2(PixmapPtr src, PixmapPtr slave_dst, int x, int y, int dst_x, int dst_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->dst_x = dst_x; dirty_update->dst_y = dst_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 PixmapStartDirtyTracking(PixmapPtr src, PixmapPtr slave_dst, int x, int y) { return PixmapStartDirtyTracking2(src, slave_dst, x, y, 0, 0); } 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) { 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; if (!dst) dst = dirty->slave_dst; 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, dirty->dst_x + dst_box.x1, dirty->dst_y + dst_box.y1); b++; } FreeScratchGC(pGC); pScreen->SourceValidate = SourceValidate; return TRUE; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/stubmain.c�������������������������������������������������������������������0000664�0001751�0001751�00000002633�12366220413�013566� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 2012 Jon TURNEY 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. ******************************************************************/ int dix_main(int argc, char *argv[], char *envp[]); /* A default implementation of main, which can be overridden by the DDX */ int main(int argc, char *argv[], char *envp[]) { return dix_main(argc, argv, envp); } �����������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/enterleave.h�����������������������������������������������������������������0000664�0001751�0001751�00000005371�12274325511�014110� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2008 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. * * Authors: Peter Hutterer * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef ENTERLEAVE_H #define ENTERLEAVE_H #include <dix.h> /* DoFocusEvents() */ extern void DoEnterLeaveEvents(DeviceIntPtr pDev, int sourceid, WindowPtr fromWin, WindowPtr toWin, int mode); extern void EnterLeaveEvent(DeviceIntPtr mouse, int type, int mode, int detail, WindowPtr pWin, Window child); extern WindowPtr CommonAncestor(WindowPtr a, WindowPtr b); extern void CoreEnterLeaveEvent(DeviceIntPtr mouse, int type, int mode, int detail, WindowPtr pWin, Window child); extern void DeviceEnterLeaveEvent(DeviceIntPtr mouse, int sourceid, 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); extern void LeaveWindow(DeviceIntPtr dev); extern void CoreFocusEvent(DeviceIntPtr kbd, int type, int mode, int detail, WindowPtr pWin); extern void SetFocusIn(DeviceIntPtr kbd, WindowPtr win); extern void SetFocusOut(DeviceIntPtr dev); #endif /* _ENTERLEAVE_H_ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/gc.c�������������������������������������������������������������������������0000664�0001751�0001751�00000076123�12456571574�012363� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xmd.h> #include <X11/Xproto.h> #include "misc.h" #include "resource.h" #include "gcstruct.h" #include "pixmapstr.h" #include "dixfontstr.h" #include "scrnintstr.h" #include "region.h" #include "dixstruct.h" #include "privates.h" #include "dix.h" #include "xace.h" #include <assert.h> extern FontPtr defaultFont; static Bool CreateDefaultTile(GCPtr pGC); static unsigned char DefaultDash[2] = { 4, 4 }; void ValidateGC(DrawablePtr pDraw, GC * pGC) { (*pGC->funcs->ValidateGC) (pGC, pGC->stateChanges, pDraw); pGC->stateChanges = 0; pGC->serialNumber = pDraw->serialNumber; } /* * ChangeGC/ChangeGCXIDs: * * The client performing the gc change must be passed so that access * checks can be performed on any tiles, stipples, or fonts that are * specified. ddxen can call this too; they should normally pass * NullClient for the client since any access checking should have * already been done at a higher level. * * If you have any XIDs, you must use ChangeGCXIDs: * * CARD32 v[2]; * v[0] = FillTiled; * v[1] = pid; * ChangeGCXIDs(client, pGC, GCFillStyle|GCTile, v); * * However, if you need to pass a pointer to a pixmap or font, you must * use ChangeGC: * * ChangeGCVal v[2]; * v[0].val = FillTiled; * v[1].ptr = pPixmap; * ChangeGC(client, pGC, GCFillStyle|GCTile, v); * * If you have neither XIDs nor pointers, you can use either function, * but ChangeGC will do less work. * * ChangeGCVal v[2]; * v[0].val = foreground; * v[1].val = background; * ChangeGC(client, pGC, GCForeground|GCBackground, v); */ #define NEXTVAL(_type, _var) { \ _var = (_type)(pUnion->val); pUnion++; \ } #define NEXT_PTR(_type, _var) { \ _var = (_type)pUnion->ptr; pUnion++; } int ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion) { BITS32 index2; int error = 0; PixmapPtr pPixmap; BITS32 maskQ; assert(pUnion); pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; maskQ = mask; /* save these for when we walk the GCque */ while (mask && !error) { index2 = (BITS32) lowbit(mask); mask &= ~index2; pGC->stateChanges |= index2; switch (index2) { case GCFunction: { CARD8 newalu; NEXTVAL(CARD8, newalu); if (newalu <= GXset) pGC->alu = newalu; else { if (client) client->errorValue = newalu; error = BadValue; } break; } case GCPlaneMask: NEXTVAL(unsigned long, pGC->planemask); break; case GCForeground: NEXTVAL(unsigned long, pGC->fgPixel); /* * this is for CreateGC */ if (!pGC->tileIsPixel && !pGC->tile.pixmap) { pGC->tileIsPixel = TRUE; pGC->tile.pixel = pGC->fgPixel; } break; case GCBackground: NEXTVAL(unsigned long, pGC->bgPixel); break; case GCLineWidth: /* ??? line width is a CARD16 */ NEXTVAL(CARD16, pGC->lineWidth); break; case GCLineStyle: { unsigned int newlinestyle; NEXTVAL(unsigned int, newlinestyle); if (newlinestyle <= LineDoubleDash) pGC->lineStyle = newlinestyle; else { if (client) client->errorValue = newlinestyle; error = BadValue; } break; } case GCCapStyle: { unsigned int newcapstyle; NEXTVAL(unsigned int, newcapstyle); if (newcapstyle <= CapProjecting) pGC->capStyle = newcapstyle; else { if (client) client->errorValue = newcapstyle; error = BadValue; } break; } case GCJoinStyle: { unsigned int newjoinstyle; NEXTVAL(unsigned int, newjoinstyle); if (newjoinstyle <= JoinBevel) pGC->joinStyle = newjoinstyle; else { if (client) client->errorValue = newjoinstyle; error = BadValue; } break; } case GCFillStyle: { unsigned int newfillstyle; NEXTVAL(unsigned int, newfillstyle); if (newfillstyle <= FillOpaqueStippled) pGC->fillStyle = newfillstyle; else { if (client) client->errorValue = newfillstyle; error = BadValue; } break; } case GCFillRule: { unsigned int newfillrule; NEXTVAL(unsigned int, newfillrule); if (newfillrule <= WindingRule) pGC->fillRule = newfillrule; else { if (client) client->errorValue = newfillrule; error = BadValue; } break; } case GCTile: NEXT_PTR(PixmapPtr, pPixmap); if ((pPixmap->drawable.depth != pGC->depth) || (pPixmap->drawable.pScreen != pGC->pScreen)) { error = BadMatch; } else { pPixmap->refcnt++; if (!pGC->tileIsPixel) (*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap); pGC->tileIsPixel = FALSE; pGC->tile.pixmap = pPixmap; } break; case GCStipple: NEXT_PTR(PixmapPtr, pPixmap); if (pPixmap && ((pPixmap->drawable.depth != 1) || (pPixmap->drawable.pScreen != pGC->pScreen))) { error = BadMatch; } else { if (pPixmap) pPixmap->refcnt++; if (pGC->stipple) (*pGC->pScreen->DestroyPixmap) (pGC->stipple); pGC->stipple = pPixmap; } break; case GCTileStipXOrigin: NEXTVAL(INT16, pGC->patOrg.x); break; case GCTileStipYOrigin: NEXTVAL(INT16, pGC->patOrg.y); break; case GCFont: { FontPtr pFont; NEXT_PTR(FontPtr, pFont); pFont->refcnt++; if (pGC->font) CloseFont(pGC->font, (Font) 0); pGC->font = pFont; break; } case GCSubwindowMode: { unsigned int newclipmode; NEXTVAL(unsigned int, newclipmode); if (newclipmode <= IncludeInferiors) pGC->subWindowMode = newclipmode; else { if (client) client->errorValue = newclipmode; error = BadValue; } break; } case GCGraphicsExposures: { unsigned int newge; NEXTVAL(unsigned int, newge); if (newge <= xTrue) pGC->graphicsExposures = newge; else { if (client) client->errorValue = newge; error = BadValue; } break; } case GCClipXOrigin: NEXTVAL(INT16, pGC->clipOrg.x); break; case GCClipYOrigin: NEXTVAL(INT16, pGC->clipOrg.y); break; case GCClipMask: NEXT_PTR(PixmapPtr, pPixmap); if (pPixmap) { if ((pPixmap->drawable.depth != 1) || (pPixmap->drawable.pScreen != pGC->pScreen)) { error = BadMatch; break; } pPixmap->refcnt++; } (*pGC->funcs->ChangeClip) (pGC, pPixmap ? CT_PIXMAP : CT_NONE, (void *) pPixmap, 0); break; case GCDashOffset: NEXTVAL(INT16, pGC->dashOffset); break; case GCDashList: { CARD8 newdash; NEXTVAL(CARD8, newdash); if (newdash == 4) { if (pGC->dash != DefaultDash) { free(pGC->dash); pGC->numInDashList = 2; pGC->dash = DefaultDash; } } else if (newdash != 0) { unsigned char *dash; dash = malloc(2 * sizeof(unsigned char)); if (dash) { if (pGC->dash != DefaultDash) free(pGC->dash); pGC->numInDashList = 2; pGC->dash = dash; dash[0] = newdash; dash[1] = newdash; } else error = BadAlloc; } else { if (client) client->errorValue = newdash; error = BadValue; } break; } case GCArcMode: { unsigned int newarcmode; NEXTVAL(unsigned int, newarcmode); if (newarcmode <= ArcPieSlice) pGC->arcMode = newarcmode; else { if (client) client->errorValue = newarcmode; error = BadValue; } break; } default: if (client) client->errorValue = maskQ; error = BadValue; break; } } /* end while mask && !error */ if (pGC->fillStyle == FillTiled && pGC->tileIsPixel) { if (!CreateDefaultTile(pGC)) { pGC->fillStyle = FillSolid; error = BadAlloc; } } (*pGC->funcs->ChangeGC) (pGC, maskQ); return error; } #undef NEXTVAL #undef NEXT_PTR static const struct { BITS32 mask; RESTYPE type; Mask access_mode; } xidfields[] = { {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) { ChangeGCVal vals[GCLastBit + 1]; int i; if (mask & ~GCAllBits) { client->errorValue = mask; return BadValue; } for (i = Ones(mask); i--;) vals[i].val = pC32[i]; for (i = 0; i < sizeof(xidfields) / sizeof(*xidfields); ++i) { int offset, rc; if (!(mask & xidfields[i].mask)) continue; offset = Ones(mask & (xidfields[i].mask - 1)); if (xidfields[i].mask == GCClipMask && vals[offset].val == None) { vals[offset].ptr = NullPixmap; continue; } rc = dixLookupResourceByType(&vals[offset].ptr, vals[offset].val, xidfields[i].type, client, xidfields[i].access_mode); if (rc != Success) { client->errorValue = vals[offset].val; return rc; } } 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->clientClip = (void *) 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. Returns a pointer to the new GC on success, NULL otherwise. returns status of non-default fields in pStatus BUG: should check for failure to create default tile */ GCPtr CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, XID gcid, ClientPtr client) { GCPtr pGC; pGC = NewGCObject(pDrawable->pScreen, pDrawable->depth); if (!pGC) { *pStatus = BadAlloc; return (GCPtr) NULL; } pGC->serialNumber = GC_CHANGE_SERIAL_BIT; if (mask & GCForeground) { /* * magic special case -- ChangeGC checks for this condition * and snags the Foreground value to create a pseudo default-tile */ pGC->tileIsPixel = FALSE; } else { pGC->tileIsPixel = TRUE; } /* security creation/labeling check */ *pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC, RT_NONE, NULL, DixCreateAccess | DixSetAttrAccess); if (*pStatus != Success) goto out; pGC->stateChanges = GCAllBits; if (!(*pGC->pScreen->CreateGC) (pGC)) *pStatus = BadAlloc; else if (mask) *pStatus = ChangeGCXIDs(client, pGC, mask, pval); else *pStatus = Success; out: if (*pStatus != Success) { if (!pGC->tileIsPixel && !pGC->tile.pixmap) pGC->tileIsPixel = TRUE; /* undo special case */ FreeGC(pGC, (XID) 0); pGC = (GCPtr) NULL; } return pGC; } static Bool CreateDefaultTile(GCPtr pGC) { ChangeGCVal tmpval[3]; PixmapPtr pTile; GCPtr pgcScratch; xRectangle rect; CARD16 w, h; w = 1; h = 1; (*pGC->pScreen->QueryBestSize) (TileShape, &w, &h, pGC->pScreen); pTile = (PixmapPtr) (*pGC->pScreen->CreatePixmap) (pGC->pScreen, w, h, pGC->depth, 0); pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen); if (!pTile || !pgcScratch) { if (pTile) (*pTile->drawable.pScreen->DestroyPixmap) (pTile); if (pgcScratch) FreeScratchGC(pgcScratch); return FALSE; } tmpval[0].val = GXcopy; tmpval[1].val = pGC->tile.pixel; tmpval[2].val = FillSolid; (void) ChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval); ValidateGC((DrawablePtr) pTile, pgcScratch); rect.x = 0; rect.y = 0; rect.width = w; rect.height = h; (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pTile, pgcScratch, 1, &rect); /* Always remember to free the scratch graphics context after use. */ FreeScratchGC(pgcScratch); pGC->tileIsPixel = FALSE; pGC->tile.pixmap = pTile; return TRUE; } int CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask) { BITS32 index2; BITS32 maskQ; int error = 0; if (pgcSrc == pgcDst) return Success; pgcDst->serialNumber |= GC_CHANGE_SERIAL_BIT; pgcDst->stateChanges |= mask; maskQ = mask; while (mask) { index2 = (BITS32) lowbit(mask); mask &= ~index2; switch (index2) { case GCFunction: pgcDst->alu = pgcSrc->alu; break; case GCPlaneMask: pgcDst->planemask = pgcSrc->planemask; break; case GCForeground: pgcDst->fgPixel = pgcSrc->fgPixel; break; case GCBackground: pgcDst->bgPixel = pgcSrc->bgPixel; break; case GCLineWidth: pgcDst->lineWidth = pgcSrc->lineWidth; break; case GCLineStyle: pgcDst->lineStyle = pgcSrc->lineStyle; break; case GCCapStyle: pgcDst->capStyle = pgcSrc->capStyle; break; case GCJoinStyle: pgcDst->joinStyle = pgcSrc->joinStyle; break; case GCFillStyle: pgcDst->fillStyle = pgcSrc->fillStyle; break; case GCFillRule: pgcDst->fillRule = pgcSrc->fillRule; break; case GCTile: { if (EqualPixUnion(pgcDst->tileIsPixel, pgcDst->tile, pgcSrc->tileIsPixel, pgcSrc->tile)) { break; } if (!pgcDst->tileIsPixel) (*pgcDst->pScreen->DestroyPixmap) (pgcDst->tile.pixmap); pgcDst->tileIsPixel = pgcSrc->tileIsPixel; pgcDst->tile = pgcSrc->tile; if (!pgcDst->tileIsPixel) pgcDst->tile.pixmap->refcnt++; break; } case GCStipple: { if (pgcDst->stipple == pgcSrc->stipple) break; if (pgcDst->stipple) (*pgcDst->pScreen->DestroyPixmap) (pgcDst->stipple); pgcDst->stipple = pgcSrc->stipple; if (pgcDst->stipple) pgcDst->stipple->refcnt++; break; } case GCTileStipXOrigin: pgcDst->patOrg.x = pgcSrc->patOrg.x; break; case GCTileStipYOrigin: pgcDst->patOrg.y = pgcSrc->patOrg.y; break; case GCFont: if (pgcDst->font == pgcSrc->font) break; if (pgcDst->font) CloseFont(pgcDst->font, (Font) 0); if ((pgcDst->font = pgcSrc->font) != NullFont) (pgcDst->font)->refcnt++; break; case GCSubwindowMode: pgcDst->subWindowMode = pgcSrc->subWindowMode; break; case GCGraphicsExposures: pgcDst->graphicsExposures = pgcSrc->graphicsExposures; break; case GCClipXOrigin: pgcDst->clipOrg.x = pgcSrc->clipOrg.x; break; case GCClipYOrigin: pgcDst->clipOrg.y = pgcSrc->clipOrg.y; break; case GCClipMask: (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); break; case GCDashOffset: pgcDst->dashOffset = pgcSrc->dashOffset; break; case GCDashList: if (pgcSrc->dash == DefaultDash) { if (pgcDst->dash != DefaultDash) { free(pgcDst->dash); pgcDst->numInDashList = pgcSrc->numInDashList; pgcDst->dash = pgcSrc->dash; } } else { unsigned char *dash; unsigned int i; dash = malloc(pgcSrc->numInDashList * sizeof(unsigned char)); if (dash) { if (pgcDst->dash != DefaultDash) free(pgcDst->dash); pgcDst->numInDashList = pgcSrc->numInDashList; pgcDst->dash = dash; for (i = 0; i < pgcSrc->numInDashList; i++) dash[i] = pgcSrc->dash[i]; } else error = BadAlloc; } break; case GCArcMode: pgcDst->arcMode = pgcSrc->arcMode; break; default: FatalError("CopyGC: Unhandled mask!\n"); } } if (pgcDst->fillStyle == FillTiled && pgcDst->tileIsPixel) { if (!CreateDefaultTile(pgcDst)) { pgcDst->fillStyle = FillSolid; error = BadAlloc; } } (*pgcDst->funcs->CopyGC) (pgcSrc, maskQ, pgcDst); return error; } /** * does the diX part of freeing the characteristics in the GC. * * \param value must conform to DeleteType */ int FreeGC(void *value, XID gid) { GCPtr pGC = (GCPtr) value; CloseFont(pGC->font, (Font) 0); (*pGC->funcs->DestroyClip) (pGC); if (!pGC->tileIsPixel) (*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap); if (pGC->stipple) (*pGC->pScreen->DestroyPixmap) (pGC->stipple); (*pGC->funcs->DestroyGC) (pGC); if (pGC->dash != DefaultDash) free(pGC->dash); dixFreeObjectWithPrivates(pGC, PRIVATE_GC); return Success; } /* CreateScratchGC(pScreen, depth) like CreateGC, but doesn't do the default tile or stipple, since we can't create them without already having a GC. any code using the tile or stipple has to set them explicitly anyway, since the state of the scratch gc is unknown. This is OK because ChangeGC() has to be able to deal with NULL tiles and stipples anyway (in case the CreateGC() call has provided a value for them -- we can't set the default tile until the client-supplied attributes are installed, since the fgPixel is what fills the default tile. (maybe this comment should go with CreateGC() or ChangeGC().) */ static GCPtr CreateScratchGC(ScreenPtr pScreen, unsigned depth) { GCPtr pGC; pGC = NewGCObject(pScreen, depth); if (!pGC) return (GCPtr) NULL; pGC->stateChanges = GCAllBits; if (!(*pScreen->CreateGC) (pGC)) { FreeGC(pGC, (XID) 0); pGC = (GCPtr) NULL; } return pGC; } void FreeGCperDepth(int screenNum) { int i; ScreenPtr pScreen; GCPtr *ppGC; pScreen = screenInfo.screens[screenNum]; ppGC = pScreen->GCperDepth; for (i = 0; i <= pScreen->numDepths; i++) { (void) FreeGC(ppGC[i], (XID) 0); ppGC[i] = NULL; } } Bool CreateGCperDepth(int screenNum) { int i; ScreenPtr pScreen; DepthPtr pDepth; GCPtr *ppGC; pScreen = screenInfo.screens[screenNum]; ppGC = pScreen->GCperDepth; /* do depth 1 separately because it's not included in list */ if (!(ppGC[0] = CreateScratchGC(pScreen, 1))) return FALSE; ppGC[0]->graphicsExposures = FALSE; /* Make sure we don't overflow GCperDepth[] */ if (pScreen->numDepths > MAXFORMATS) return FALSE; pDepth = pScreen->allowedDepths; for (i = 0; i < pScreen->numDepths; i++, pDepth++) { if (!(ppGC[i + 1] = CreateScratchGC(pScreen, pDepth->depth))) { for (; i >= 0; i--) (void) FreeGC(ppGC[i], (XID) 0); return FALSE; } ppGC[i + 1]->graphicsExposures = FALSE; } return TRUE; } Bool CreateDefaultStipple(int screenNum) { ScreenPtr pScreen; ChangeGCVal tmpval[3]; xRectangle rect; CARD16 w, h; GCPtr pgcScratch; pScreen = screenInfo.screens[screenNum]; w = 16; h = 16; (*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen); if (!(pScreen->PixmapPerDepth[0] = (*pScreen->CreatePixmap) (pScreen, w, h, 1, 0))) return FALSE; /* fill stipple with 1 */ tmpval[0].val = GXcopy; tmpval[1].val = 1; tmpval[2].val = FillSolid; pgcScratch = GetScratchGC(1, pScreen); if (!pgcScratch) { (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); return FALSE; } (void) ChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval); ValidateGC((DrawablePtr) pScreen->PixmapPerDepth[0], pgcScratch); rect.x = 0; rect.y = 0; rect.width = w; rect.height = h; (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->PixmapPerDepth[0], pgcScratch, 1, &rect); FreeScratchGC(pgcScratch); return TRUE; } void FreeDefaultStipple(int screenNum) { ScreenPtr pScreen = screenInfo.screens[screenNum]; (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); } int SetDashes(GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash) { long i; unsigned char *p, *indash; BITS32 maskQ = 0; i = ndash; p = pdash; while (i--) { if (!*p++) { /* dash segment must be > 0 */ return BadValue; } } if (ndash & 1) p = malloc(2 * ndash * sizeof(unsigned char)); else p = malloc(ndash * sizeof(unsigned char)); if (!p) return BadAlloc; pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; if (offset != pGC->dashOffset) { pGC->dashOffset = offset; pGC->stateChanges |= GCDashOffset; maskQ |= GCDashOffset; } if (pGC->dash != DefaultDash) free(pGC->dash); pGC->numInDashList = ndash; pGC->dash = p; if (ndash & 1) { pGC->numInDashList += ndash; indash = pdash; i = ndash; while (i--) *p++ = *indash++; } while (ndash--) *p++ = *pdash++; pGC->stateChanges |= GCDashList; maskQ |= GCDashList; if (pGC->funcs->ChangeGC) (*pGC->funcs->ChangeGC) (pGC, maskQ); return Success; } int VerifyRectOrder(int nrects, xRectangle *prects, int ordering) { xRectangle *prectP, *prectN; int i; switch (ordering) { case Unsorted: return CT_UNSORTED; case YSorted: if (nrects > 1) { for (i = 1, prectP = prects, prectN = prects + 1; i < nrects; i++, prectP++, prectN++) if (prectN->y < prectP->y) return -1; } return CT_YSORTED; case YXSorted: if (nrects > 1) { for (i = 1, prectP = prects, prectN = prects + 1; i < nrects; i++, prectP++, prectN++) if ((prectN->y < prectP->y) || ((prectN->y == prectP->y) && (prectN->x < prectP->x))) return -1; } return CT_YXSORTED; case YXBanded: if (nrects > 1) { for (i = 1, prectP = prects, prectN = prects + 1; i < nrects; i++, prectP++, prectN++) if ((prectN->y != prectP->y && prectN->y < prectP->y + (int) prectP->height) || ((prectN->y == prectP->y) && (prectN->height != prectP->height || prectN->x < prectP->x + (int) prectP->width))) return -1; } return CT_YXBANDED; } return -1; } int SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, xRectangle *prects, int ordering) { int newct, size; xRectangle *prectsNew; newct = VerifyRectOrder(nrects, prects, ordering); if (newct < 0) return BadMatch; size = nrects * sizeof(xRectangle); prectsNew = malloc(size); if (!prectsNew && size) return BadAlloc; pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; pGC->clipOrg.x = xOrigin; pGC->stateChanges |= GCClipXOrigin; pGC->clipOrg.y = yOrigin; pGC->stateChanges |= GCClipYOrigin; if (size) memmove((char *) prectsNew, (char *) prects, size); (*pGC->funcs->ChangeClip) (pGC, newct, (void *) prectsNew, nrects); if (pGC->funcs->ChangeGC) (*pGC->funcs->ChangeGC) (pGC, GCClipXOrigin | GCClipYOrigin | GCClipMask); return Success; } /* sets reasonable defaults if we can get a pre-allocated one, use it and mark it as used. if we can't, create one out of whole cloth (The Velveteen GC -- if you use it often enough it will become real.) */ GCPtr GetScratchGC(unsigned depth, ScreenPtr pScreen) { int i; GCPtr pGC; for (i = 0; i <= pScreen->numDepths; i++) { pGC = pScreen->GCperDepth[i]; if (pGC && pGC->depth == depth && !pGC->scratch_inuse) { pGC->scratch_inuse = TRUE; pGC->alu = GXcopy; 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 = ArcChord; pGC->patOrg.x = 0; pGC->patOrg.y = 0; pGC->subWindowMode = ClipByChildren; pGC->graphicsExposures = FALSE; pGC->clipOrg.x = 0; pGC->clipOrg.y = 0; if (pGC->clientClip) (*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0); pGC->stateChanges = GCAllBits; return pGC; } } /* if we make it this far, need to roll our own */ pGC = CreateScratchGC(pScreen, depth); if (pGC) pGC->graphicsExposures = FALSE; return pGC; } /* if the gc to free is in the table of pre-existing ones, mark it as available. if not, free it for real */ void FreeScratchGC(GCPtr pGC) { if (pGC->scratch_inuse) pGC->scratch_inuse = FALSE; else FreeGC(pGC, (GContext) 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/globals.c��������������������������������������������������������������������0000664�0001751�0001751�00000010545�12456571574�013411� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xmd.h> #include "misc.h" #include "windowstr.h" #include "scrnintstr.h" #include "input.h" #include "dixfont.h" #include "site.h" #include "dixstruct.h" #include "os.h" ScreenInfo screenInfo; KeybdCtrl defaultKeyboardControl = { DEFAULT_KEYBOARD_CLICK, DEFAULT_BELL, DEFAULT_BELL_PITCH, DEFAULT_BELL_DURATION, DEFAULT_AUTOREPEAT, DEFAULT_AUTOREPEATS, DEFAULT_LEDS, 0 }; PtrCtrl defaultPointerControl = { DEFAULT_PTR_NUMERATOR, DEFAULT_PTR_DENOMINATOR, DEFAULT_PTR_THRESHOLD, 0 }; ClientPtr clients[MAXCLIENTS]; ClientPtr serverClient; int currentMaxClients; /* current size of clients array */ long maxBigRequestSize = MAX_BIG_REQUEST_SIZE; unsigned long globalSerialNumber = 0; unsigned long serverGeneration = 0; /* these next four are initialized in main.c */ CARD32 ScreenSaverTime; CARD32 ScreenSaverInterval; int ScreenSaverBlanking; int ScreenSaverAllowExposures; #ifdef DPMSExtension CARD16 DPMSPowerLevel = 0; Bool DPMSDisabledSwitch = FALSE; Bool DPMSCapableFlag = FALSE; CARD32 DPMSStandbyTime; CARD32 DPMSSuspendTime; CARD32 DPMSOffTime; Bool DPMSEnabled; #endif CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME; CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL; int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING; int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES; #ifdef SCREENSAVER Bool screenSaverSuspended = FALSE; #endif const char *defaultFontPath = COMPILEDDEFAULTFONTPATH; const char *defaultTextFont = COMPILEDDEFAULTFONT; const char *defaultCursorFont = COMPILEDCURSORFONT; FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in every compilation of dix code */ CursorPtr rootCursor; Bool party_like_its_1989 = FALSE; Bool whiteRoot = FALSE; TimeStamp currentTime; int defaultColorVisualClass = -1; int monitorResolution = 0; const char *display; int displayfd = -1; Bool explicit_display = FALSE; char *ConnectionInfo; CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND; �����������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/grabs.c����������������������������������������������������������������������0000664�0001751�0001751�00000054660�12456571574�013072� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN action OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include "misc.h" #include <X11/Xproto.h> #include <X11/extensions/XI2.h> #include "windowstr.h" #include "inputstr.h" #include "cursorstr.h" #include "dixgrabs.h" #include "xace.h" #include "exevents.h" #include "exglobals.h" #include "inpututils.h" #include "client.h" #define BITMASK(i) (((Mask)1) << ((i) & 31)) #define MASKIDX(i) ((i) >> 5) #define MASKWORD(buf, i) buf[MASKIDX(i)] #define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i) #define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i) #define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) void PrintDeviceGrabInfo(DeviceIntPtr dev) { ClientPtr client; LocalClientCredRec *lcc; int i, j; GrabInfoPtr devGrab = &dev->deviceGrab; GrabPtr grab = devGrab->grab; Bool clientIdPrinted = FALSE; ErrorF("Active grab 0x%lx (%s) on device '%s' (%d):\n", (unsigned long) grab->resource, (grab->grabtype == XI2) ? "xi2" : ((grab->grabtype == CORE) ? "core" : "xi1"), dev->name, dev->id); client = clients[CLIENT_ID(grab->resource)]; if (client) { pid_t clientpid = GetClientPid(client); const char *cmdname = GetClientCmdName(client); const char *cmdargs = GetClientCmdArgs(client); if ((clientpid > 0) && (cmdname != NULL)) { ErrorF(" client pid %ld %s %s\n", (long) clientpid, cmdname, cmdargs ? cmdargs : ""); clientIdPrinted = TRUE; } else if (GetLocalClientCreds(client, &lcc) != -1) { ErrorF(" client pid %ld uid %ld gid %ld\n", (lcc->fieldsSet & LCC_PID_SET) ? (long) lcc->pid : 0, (lcc->fieldsSet & LCC_UID_SET) ? (long) lcc->euid : 0, (lcc->fieldsSet & LCC_GID_SET) ? (long) lcc->egid : 0); FreeLocalClientCreds(lcc); clientIdPrinted = TRUE; } } if (!clientIdPrinted) { ErrorF(" (no client information available for client %d)\n", CLIENT_ID(grab->resource)); } /* XXX is this even correct? */ if (devGrab->sync.other) ErrorF(" grab ID 0x%lx from paired device\n", (unsigned long) devGrab->sync.other->resource); ErrorF(" at %ld (from %s grab)%s (device %s, state %d)\n", (unsigned long) devGrab->grabTime.milliseconds, devGrab->fromPassiveGrab ? "passive" : "active", devGrab->implicitGrab ? " (implicit)" : "", devGrab->sync.frozen ? "frozen" : "thawed", devGrab->sync.state); if (grab->grabtype == CORE) { ErrorF(" core event mask 0x%lx\n", (unsigned long) grab->eventMask); } else if (grab->grabtype == XI) { ErrorF(" xi1 event mask 0x%lx\n", devGrab->implicitGrab ? (unsigned long) grab->deviceMask : (unsigned long) grab->eventMask); } else if (grab->grabtype == XI2) { for (i = 0; i < xi2mask_num_masks(grab->xi2mask); i++) { const unsigned char *mask; int print; print = 0; for (j = 0; j < XI2MASKSIZE; j++) { mask = xi2mask_get_one_mask(grab->xi2mask, i); if (mask[j]) { print = 1; break; } } if (!print) continue; ErrorF(" xi2 event mask for device %d: 0x", dev->id); for (j = 0; j < xi2mask_mask_size(grab->xi2mask); j++) ErrorF("%x", mask[j]); ErrorF("\n"); } } if (devGrab->fromPassiveGrab) { ErrorF(" passive grab type %d, detail 0x%x, " "activating key %d\n", grab->type, grab->detail.exact, devGrab->activatingKey); } ErrorF(" owner-events %s, kb %d ptr %d, confine %lx, cursor 0x%lx\n", grab->ownerEvents ? "true" : "false", grab->keyboardMode, grab->pointerMode, grab->confineTo ? (unsigned long) grab->confineTo->drawable.id : 0, grab->cursor ? (unsigned long) grab->cursor->id : 0); } void UngrabAllDevices(Bool kill_client) { DeviceIntPtr dev; ClientPtr client; ErrorF("Ungrabbing all devices%s; grabs listed below:\n", kill_client ? " and killing their owners" : ""); for (dev = inputInfo.devices; dev; dev = dev->next) { if (!dev->deviceGrab.grab) continue; PrintDeviceGrabInfo(dev); client = clients[CLIENT_ID(dev->deviceGrab.grab->resource)]; if (!kill_client || !client || client->clientGone) dev->deviceGrab.DeactivateGrab(dev); if (kill_client) CloseDownClient(client); } ErrorF("End list of ungrabbed devices\n"); } GrabPtr AllocGrab(const GrabPtr src) { GrabPtr grab = calloc(1, sizeof(GrabRec)); if (grab) { grab->xi2mask = xi2mask_new(); if (!grab->xi2mask) { free(grab); grab = NULL; } else if (src && !CopyGrab(grab, src)) { free(grab->xi2mask); free(grab); grab = NULL; } } return grab; } GrabPtr 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; grab = AllocGrab(NULL); if (!grab) return (GrabPtr) NULL; grab->resource = FakeClientID(client); grab->device = device; grab->window = window; 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; grab->pointerMode = param->other_devices_mode; grab->modifiersDetail.exact = param->modifiers; grab->modifiersDetail.pMask = NULL; grab->modifierDevice = modDevice; grab->type = type; grab->grabtype = grabtype; grab->detail.exact = keybut; grab->detail.pMask = NULL; grab->confineTo = confineTo; grab->cursor = RefCursor(cursor); grab->next = NULL; if (grabtype == XI2) xi2mask_merge(grab->xi2mask, mask->xi2mask); return grab; } void FreeGrab(GrabPtr pGrab) { BUG_RETURN(!pGrab); free(pGrab->modifiersDetail.pMask); free(pGrab->detail.pMask); if (pGrab->cursor) FreeCursor(pGrab->cursor, (Cursor) 0); xi2mask_free(&pGrab->xi2mask); free(pGrab); } Bool CopyGrab(GrabPtr dst, const GrabPtr src) { Mask *mdetails_mask = NULL; Mask *details_mask = NULL; XI2Mask *xi2mask; if (src->modifiersDetail.pMask) { int len = MasksPerDetailMask * sizeof(Mask); mdetails_mask = malloc(len); if (!mdetails_mask) return FALSE; memcpy(mdetails_mask, src->modifiersDetail.pMask, len); } if (src->detail.pMask) { int len = MasksPerDetailMask * sizeof(Mask); details_mask = malloc(len); if (!details_mask) { free(mdetails_mask); return FALSE; } memcpy(details_mask, src->detail.pMask, len); } if (!dst->xi2mask) { xi2mask = xi2mask_new(); if (!xi2mask) { free(mdetails_mask); free(details_mask); return FALSE; } } else { xi2mask = dst->xi2mask; xi2mask_zero(xi2mask, -1); } *dst = *src; dst->modifiersDetail.pMask = mdetails_mask; dst->detail.pMask = details_mask; dst->xi2mask = xi2mask; dst->cursor = RefCursor(src->cursor); xi2mask_merge(dst->xi2mask, src->xi2mask); return TRUE; } int DeletePassiveGrab(void *value, XID id) { GrabPtr g, prev; GrabPtr pGrab = (GrabPtr) value; /* it is OK if the grab isn't found */ prev = 0; for (g = (wPassiveGrabs(pGrab->window)); g; g = g->next) { if (pGrab == g) { if (prev) prev->next = g->next; else if (!(pGrab->window->optional->passiveGrabs = g->next)) CheckWindowOptionalNeed(pGrab->window); break; } prev = g; } FreeGrab(pGrab); return Success; } static Mask * DeleteDetailFromMask(Mask *pDetailMask, unsigned int detail) { Mask *mask; int i; mask = malloc(sizeof(Mask) * MasksPerDetailMask); if (mask) { if (pDetailMask) for (i = 0; i < MasksPerDetailMask; i++) mask[i] = pDetailMask[i]; else for (i = 0; i < MasksPerDetailMask; i++) mask[i] = ~0L; BITCLEAR(mask, detail); } return mask; } static Bool IsInGrabMask(DetailRec firstDetail, DetailRec secondDetail, unsigned int exception) { if (firstDetail.exact == exception) { if (firstDetail.pMask == NULL) return TRUE; /* (at present) never called with two non-null pMasks */ if (secondDetail.exact == exception) return FALSE; if (GETBIT(firstDetail.pMask, secondDetail.exact)) return TRUE; } return FALSE; } static Bool IdenticalExactDetails(unsigned int firstExact, unsigned int secondExact, unsigned int exception) { if ((firstExact == exception) || (secondExact == exception)) return FALSE; if (firstExact == secondExact) return TRUE; return FALSE; } static Bool DetailSupersedesSecond(DetailRec firstDetail, DetailRec secondDetail, unsigned int exception) { if (IsInGrabMask(firstDetail, secondDetail, exception)) return TRUE; if (IdenticalExactDetails(firstDetail.exact, secondDetail.exact, exception)) return TRUE; return FALSE; } static Bool GrabSupersedesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab) { unsigned int any_modifier = (pFirstGrab->grabtype == XI2) ? (unsigned int) XIAnyModifier : (unsigned int) AnyModifier; if (!DetailSupersedesSecond(pFirstGrab->modifiersDetail, pSecondGrab->modifiersDetail, any_modifier)) return FALSE; if (DetailSupersedesSecond(pFirstGrab->detail, pSecondGrab->detail, (unsigned int) AnyKey)) return TRUE; return FALSE; } /** * Compares two grabs and returns TRUE if the first grab matches the second * grab. * * A match is when * - the devices set for the grab are equal (this is optional). * - the event types for both grabs are equal. * - XXX * * @param ignoreDevice TRUE if the device settings on the grabs are to be * ignored. * @return TRUE if the grabs match or FALSE otherwise. */ Bool GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab, Bool ignoreDevice) { unsigned int any_modifier = (pFirstGrab->grabtype == XI2) ? (unsigned int) XIAnyModifier : (unsigned int) AnyModifier; if (pFirstGrab->grabtype != pSecondGrab->grabtype) return FALSE; if (pFirstGrab->grabtype == XI2) { if (pFirstGrab->device == inputInfo.all_devices || pSecondGrab->device == inputInfo.all_devices) { /* do nothing */ } else if (pFirstGrab->device == inputInfo.all_master_devices) { if (pSecondGrab->device != inputInfo.all_master_devices && !IsMaster(pSecondGrab->device)) return FALSE; } else if (pSecondGrab->device == inputInfo.all_master_devices) { if (pFirstGrab->device != inputInfo.all_master_devices && !IsMaster(pFirstGrab->device)) return FALSE; } else if (pSecondGrab->device != pFirstGrab->device) return FALSE; } else if (!ignoreDevice && ((pFirstGrab->device != pSecondGrab->device) || (pFirstGrab->modifierDevice != pSecondGrab->modifierDevice))) return FALSE; if (pFirstGrab->type != pSecondGrab->type) return FALSE; if (GrabSupersedesSecond(pFirstGrab, pSecondGrab) || GrabSupersedesSecond(pSecondGrab, pFirstGrab)) return TRUE; if (DetailSupersedesSecond(pSecondGrab->detail, pFirstGrab->detail, (unsigned int) AnyKey) && DetailSupersedesSecond(pFirstGrab->modifiersDetail, pSecondGrab->modifiersDetail, any_modifier)) return TRUE; if (DetailSupersedesSecond(pFirstGrab->detail, pSecondGrab->detail, (unsigned int) AnyKey) && DetailSupersedesSecond(pSecondGrab->modifiersDetail, pFirstGrab->modifiersDetail, any_modifier)) return TRUE; return FALSE; } static Bool GrabsAreIdentical(GrabPtr pFirstGrab, GrabPtr pSecondGrab) { unsigned int any_modifier = (pFirstGrab->grabtype == XI2) ? (unsigned int) XIAnyModifier : (unsigned int) AnyModifier; if (pFirstGrab->grabtype != pSecondGrab->grabtype) return FALSE; if (pFirstGrab->device != pSecondGrab->device || (pFirstGrab->modifierDevice != pSecondGrab->modifierDevice) || (pFirstGrab->type != pSecondGrab->type)) return FALSE; if (!(DetailSupersedesSecond(pFirstGrab->detail, pSecondGrab->detail, (unsigned int) AnyKey) && DetailSupersedesSecond(pSecondGrab->detail, pFirstGrab->detail, (unsigned int) AnyKey))) return FALSE; if (!(DetailSupersedesSecond(pFirstGrab->modifiersDetail, pSecondGrab->modifiersDetail, any_modifier) && DetailSupersedesSecond(pSecondGrab->modifiersDetail, pFirstGrab->modifiersDetail, any_modifier))) return FALSE; return TRUE; } /** * Prepend the new grab to the list of passive grabs on the window. * Any previously existing grab that matches the new grab will be removed. * Adding a new grab that would override another client's grab will result in * a BadAccess. * * @return Success or X error code on failure. */ int AddPassiveGrabToList(ClientPtr client, GrabPtr pGrab) { GrabPtr grab; Mask access_mode = DixGrabAccess; int rc; for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next) { if (GrabMatchesSecond(pGrab, grab, (pGrab->grabtype == CORE))) { if (CLIENT_BITS(pGrab->resource) != CLIENT_BITS(grab->resource)) { FreeGrab(pGrab); return BadAccess; } } } if (pGrab->keyboardMode == GrabModeSync || pGrab->pointerMode == GrabModeSync) access_mode |= DixFreezeAccess; rc = XaceHook(XACE_DEVICE_ACCESS, client, pGrab->device, access_mode); if (rc != Success) return rc; /* Remove all grabs that match the new one exactly */ for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next) { if (GrabsAreIdentical(pGrab, grab)) { DeletePassiveGrabFromList(grab); break; } } if (!pGrab->window->optional && !MakeWindowOptional(pGrab->window)) { FreeGrab(pGrab); return BadAlloc; } pGrab->next = pGrab->window->optional->passiveGrabs; pGrab->window->optional->passiveGrabs = pGrab; if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (void *) pGrab)) return Success; return BadAlloc; } /* the following is kinda complicated, because we need to be able to back out * if any allocation fails */ Bool DeletePassiveGrabFromList(GrabPtr pMinuendGrab) { GrabPtr grab; GrabPtr *deletes, *adds; Mask ***updates, **details; int i, ndels, nadds, nups; Bool ok; unsigned int any_modifier; unsigned int any_key; #define UPDATE(mask,exact) \ if (!(details[nups] = DeleteDetailFromMask(mask, exact))) \ ok = FALSE; \ else \ updates[nups++] = &(mask) i = 0; for (grab = wPassiveGrabs(pMinuendGrab->window); grab; grab = grab->next) i++; if (!i) return TRUE; deletes = malloc(i * sizeof(GrabPtr)); adds = malloc(i * sizeof(GrabPtr)); updates = malloc(i * sizeof(Mask **)); details = malloc(i * sizeof(Mask *)); if (!deletes || !adds || !updates || !details) { free(details); free(updates); free(adds); free(deletes); return FALSE; } any_modifier = (pMinuendGrab->grabtype == XI2) ? (unsigned int) XIAnyModifier : (unsigned int) AnyModifier; any_key = (pMinuendGrab->grabtype == XI2) ? (unsigned int) XIAnyKeycode : (unsigned int) AnyKey; ndels = nadds = nups = 0; ok = TRUE; for (grab = wPassiveGrabs(pMinuendGrab->window); grab && ok; grab = grab->next) { if ((CLIENT_BITS(grab->resource) != CLIENT_BITS(pMinuendGrab->resource)) || !GrabMatchesSecond(grab, pMinuendGrab, (grab->grabtype == CORE))) continue; if (GrabSupersedesSecond(pMinuendGrab, grab)) { deletes[ndels++] = grab; } else if ((grab->detail.exact == any_key) && (grab->modifiersDetail.exact != any_modifier)) { UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact); } else if ((grab->modifiersDetail.exact == any_modifier) && (grab->detail.exact != any_key)) { UPDATE(grab->modifiersDetail.pMask, pMinuendGrab->modifiersDetail.exact); } else if ((pMinuendGrab->detail.exact != any_key) && (pMinuendGrab->modifiersDetail.exact != any_modifier)) { GrabPtr pNewGrab; GrabParameters param; UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact); memset(¶m, 0, sizeof(param)); param.ownerEvents = grab->ownerEvents; param.this_device_mode = grab->keyboardMode; param.other_devices_mode = grab->pointerMode; param.modifiers = any_modifier; pNewGrab = CreateGrab(CLIENT_ID(grab->resource), grab->device, grab->modifierDevice, grab->window, grab->grabtype, (GrabMask *) &grab->eventMask, ¶m, (int) grab->type, pMinuendGrab->detail.exact, grab->confineTo, grab->cursor); if (!pNewGrab) ok = FALSE; else if (!(pNewGrab->modifiersDetail.pMask = DeleteDetailFromMask(grab->modifiersDetail.pMask, pMinuendGrab->modifiersDetail. exact)) || (!pNewGrab->window->optional && !MakeWindowOptional(pNewGrab->window))) { FreeGrab(pNewGrab); ok = FALSE; } else if (!AddResource(pNewGrab->resource, RT_PASSIVEGRAB, (void *) pNewGrab)) ok = FALSE; else adds[nadds++] = pNewGrab; } else if (pMinuendGrab->detail.exact == any_key) { UPDATE(grab->modifiersDetail.pMask, pMinuendGrab->modifiersDetail.exact); } else { UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact); } } if (!ok) { for (i = 0; i < nadds; i++) FreeResource(adds[i]->resource, RT_NONE); for (i = 0; i < nups; i++) free(details[i]); } else { for (i = 0; i < ndels; i++) FreeResource(deletes[i]->resource, RT_NONE); for (i = 0; i < nadds; i++) { grab = adds[i]; grab->next = grab->window->optional->passiveGrabs; grab->window->optional->passiveGrabs = grab; } for (i = 0; i < nups; i++) { free(*updates[i]); *updates[i] = details[i]; } } free(details); free(updates); free(adds); free(deletes); return ok; #undef UPDATE } Bool GrabIsPointerGrab(GrabPtr grab) { return (grab->type == ButtonPress || grab->type == DeviceButtonPress || grab->type == XI_ButtonPress); } Bool GrabIsKeyboardGrab(GrabPtr grab) { return (grab->type == KeyPress || grab->type == DeviceKeyPress || grab->type == XI_KeyPress); } ��������������������������������������������������������������������������������xorg-server-1.17.1/dix/protocol.txt�����������������������������������������������������������������0000664�0001751�0001751�00000073760�12414702051�014210� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Registry of protocol names used by X Server # This will eventually be replaced by server-side XCB # # Format is Xnnn <extension-name>:<object-name> # R=Request, V=Event, E=Error # # This is a security-sensitive file, please set permissions as appropriate. # R001 Adobe-DPS-Extension:Init R002 Adobe-DPS-Extension:CreateContext R003 Adobe-DPS-Extension:CreateSpace R004 Adobe-DPS-Extension:GiveInput R005 Adobe-DPS-Extension:GetStatus R006 Adobe-DPS-Extension:DestroySpace R007 Adobe-DPS-Extension:Reset R008 Adobe-DPS-Extension:NotifyContext R009 Adobe-DPS-Extension:CreateContextFromID R010 Adobe-DPS-Extension:XIDFromContext R011 Adobe-DPS-Extension:ContextFromXID R012 Adobe-DPS-Extension:SetStatusMask R013 Adobe-DPS-Extension:CreateSecureContext R014 Adobe-DPS-Extension:NotifyWhenReady R000 Apple-DRI:QueryVersion R001 Apple-DRI:QueryDirectRenderingCapable R002 Apple-DRI:CreateSurface R003 Apple-DRI:DestroySurface R004 Apple-DRI:AuthConnection V000 Apple-DRI:ObsoleteEvent1 V001 Apple-DRI:ObsoleteEvent2 V002 Apple-DRI:ObsoleteEvent3 V003 Apple-DRI:SurfaceNotify E000 Apple-DRI:ClientNotLocal E001 Apple-DRI:OperationNotSupported R000 Apple-WM:QueryVersion R001 Apple-WM:FrameGetRect R002 Apple-WM:FrameHitTest R003 Apple-WM:FrameDraw R004 Apple-WM:DisableUpdate R005 Apple-WM:ReenableUpdate R006 Apple-WM:SelectInput R007 Apple-WM:SetWindowMenuCheck R008 Apple-WM:SetFrontProcess R009 Apple-WM:SetWindowLevel R010 Apple-WM:SetCanQuit R011 Apple-WM:SetWindowMenu V000 Apple-WM:ControllerNotify V001 Apple-WM:ActivationNotify V002 Apple-WM:PasteboardNotify E000 Apple-WM:ClientNotLocal E001 Apple-WM:OperationNotSupported R000 BIG-REQUESTS:Enable R000 Composite:CompositeQueryVersion R001 Composite:CompositeRedirectWindow R002 Composite:CompositeRedirectSubwindows R003 Composite:CompositeUnredirectWindow R004 Composite:CompositeUnredirectSubwindows R005 Composite:CompositeCreateRegionFromBorderClip R006 Composite:CompositeNameWindowPixmap R007 Composite:CompositeGetOverlayWindow R008 Composite:CompositeReleaseOverlayWindow R000 DAMAGE:QueryVersion R001 DAMAGE:Create R002 DAMAGE:Destroy R003 DAMAGE:Subtract R004 DAMAGE:Add V000 DAMAGE:Notify E000 DAMAGE:BadDamage R000 DEC-XTRAP:Reset R001 DEC-XTRAP:GetAvailable R002 DEC-XTRAP:Config R003 DEC-XTRAP:StartTrap R004 DEC-XTRAP:StopTrap R005 DEC-XTRAP:GetCurrent R006 DEC-XTRAP:GetStatistics R007 DEC-XTRAP:SimulateXEvent R008 DEC-XTRAP:GetVersion R009 DEC-XTRAP:GetLastInpTime V000 DEC-XTRAP:Event E002 DEC-XTRAP:BadIO E004 DEC-XTRAP:BadStatistics E005 DEC-XTRAP:BadDevices E007 DEC-XTRAP:BadScreen E008 DEC-XTRAP:BadSwapReq R000 DMX:DMXQueryVersion R001 DMX:DMXGetScreenCount R002 DMX:DMXGetScreenInfoDEPRECATED R003 DMX:DMXGetWindowAttributes R004 DMX:DMXGetInputCount R005 DMX:DMXGetInputAttributes R006 DMX:DMXForceWindowCreationDEPRECATED R007 DMX:DMXReconfigureScreenDEPRECATED R008 DMX:DMXSync R009 DMX:DMXForceWindowCreation R010 DMX:DMXGetScreenAttributes R011 DMX:DMXChangeScreensAttributes R012 DMX:DMXAddScreen R013 DMX:DMXRemoveScreen R014 DMX:DMXGetDesktopAttributes R015 DMX:DMXChangeDesktopAttributes R016 DMX:DMXAddInput R017 DMX:DMXRemoveInput R000 DOUBLE-BUFFER:GetVersion R001 DOUBLE-BUFFER:AllocateBackBufferName R002 DOUBLE-BUFFER:DeallocateBackBufferName R003 DOUBLE-BUFFER:SwapBuffers R004 DOUBLE-BUFFER:BeginIdiom R005 DOUBLE-BUFFER:EndIdiom R006 DOUBLE-BUFFER:GetVisualInfo R007 DOUBLE-BUFFER:GetBackBufferAttributes E000 DOUBLE-BUFFER:BadBuffer R000 DPMS:GetVersion R001 DPMS:Capable R002 DPMS:GetTimeouts R003 DPMS:SetTimeouts R004 DPMS:Enable R005 DPMS:Disable R006 DPMS:ForceLevel R007 DPMS:Info R000 DRI2:QueryVersion R001 DRI2:Connect R002 DRI2:Authenticate R003 DRI2:CreateDrawable R004 DRI2:DestroyDrawable R005 DRI2:GetBuffers R006 DRI2:CopyRegion R007 DRI2:GetBuffersWithFormat R000 Extended-Visual-Information:QueryVersion R001 Extended-Visual-Information:GetVisualInfo R000 FontCache:QueryVersion R001 FontCache:GetCacheSettings R002 FontCache:ChangeCacheSettings R003 FontCache:GetCacheStatistics E000 FontCache:BadProtocol E001 FontCache:CannotAllocMemory R001 GLX: R002 GLX:Large R003 GLX:CreateContext R004 GLX:DestroyContext R005 GLX:MakeCurrent R006 GLX:IsDirect R007 GLX:QueryVersion R008 GLX:WaitGL R009 GLX:WaitX R010 GLX:CopyContext R011 GLX:SwapBuffers R012 GLX:UseXFont R013 GLX:CreateGLXPixmap R014 GLX:GetVisualConfigs R015 GLX:DestroyGLXPixmap R016 GLX:VendorPrivate R017 GLX:VendorPrivateWithReply R018 GLX:QueryExtensionsString R019 GLX:QueryServerString R020 GLX:ClientInfo R101 GLX:NewList R102 GLX:EndList R103 GLX:DeleteLists R104 GLX:GenLists R105 GLX:FeedbackBuffer R106 GLX:SelectBuffer R107 GLX:Mode R108 GLX:Finish R109 GLX:PixelStoref R110 GLX:PixelStorei R111 GLX:ReadPixels R112 GLX:GetBooleanv R113 GLX:GetClipPlane R114 GLX:GetDoublev R115 GLX:GetError R116 GLX:GetFloatv R117 GLX:GetIntegerv R118 GLX:GetLightfv R119 GLX:GetLightiv R120 GLX:GetMapdv R121 GLX:GetMapfv R122 GLX:GetMapiv R123 GLX:GetMaterialfv R124 GLX:GetMaterialiv R125 GLX:GetPixelfv R126 GLX:GetPixelMapuiv R127 GLX:GetPixelMapusv R128 GLX:GetPolygonStipple R129 GLX:GetString R130 GLX:GetTexEnvfv R131 GLX:GetTexEnviv R132 GLX:GetTexGendv R133 GLX:GetTexGenfv R134 GLX:GetTexGeniv R135 GLX:GetTexImage R136 GLX:GetTexParameterfv R137 GLX:GetTexParameteriv R138 GLX:GetTexLevelParameterfv R139 GLX:GetTexLevelParameteriv R140 GLX:IsEnabled R141 GLX:IsList R142 GLX:Flush E000 GLX:BadContext E001 GLX:BadContextState E002 GLX:BadDrawable E003 GLX:BadPixmap E004 GLX:BadContextTag E005 GLX:BadCurrentWindow E006 GLX:BadRenderRequest E007 GLX:BadLargeRequest E008 GLX:UnsupportedPrivateRequest R000 LBX:QueryVersion R001 LBX:StartProxy R002 LBX:StopProxy R003 LBX:Switch R004 LBX:NewClient R005 LBX:CloseClient R006 LBX:ModifySequence R007 LBX:AllowMotion R008 LBX:IncrementPixel R009 LBX:Delta R010 LBX:GetModifierMapping R011 LBX:QueryTag R012 LBX:InvalidateTag R013 LBX:PolyPoint R014 LBX:PolyLine R015 LBX:PolySegment R016 LBX:PolyRectangle R017 LBX:PolyArc R018 LBX:FillPoly R019 LBX:PolyFillRectangle R020 LBX:PolyFillArc R021 LBX:GetKeyboardMapping R022 LBX:QueryFont R023 LBX:ChangeProperty R024 LBX:GetProperty R025 LBX:TagData R026 LBX:CopyArea R027 LBX:CopyPlane R028 LBX:PolyText8 R029 LBX:PolyText16 R030 LBX:ImageText8 R031 LBX:ImageText16 R032 LBX:QueryExtension R033 LBX:PutImage R034 LBX:GetImage R035 LBX:BeginLargeRequest R036 LBX:LargeRequestData R037 LBX:EndLargeRequest R038 LBX:InternAtoms R039 LBX:GetWinAttrAndGeom R040 LBX:GrabCmap R041 LBX:ReleaseCmap R042 LBX:AllocColor R043 LBX:Sync E000 LBX:BadLbxClient R000 MIT-SCREEN-SAVER:QueryVersion R001 MIT-SCREEN-SAVER:QueryInfo R002 MIT-SCREEN-SAVER:SelectInput R003 MIT-SCREEN-SAVER:SetAttributes R004 MIT-SCREEN-SAVER:UnsetAttributes R005 MIT-SCREEN-SAVER:Suspend V000 MIT-SCREEN-SAVER:Notify R000 MIT-SHM:QueryVersion R001 MIT-SHM:Attach R002 MIT-SHM:Detach R003 MIT-SHM:PutImage R004 MIT-SHM:GetImage R005 MIT-SHM:CreatePixmap V000 MIT-SHM:Completion E000 MIT-SHM:BadShmSeg R000 MIT-SUNDRY-NONSTANDARD:SetBugMode R001 MIT-SUNDRY-NONSTANDARD:GetBugMode R000 Multi-Buffering:GetBufferVersion R001 Multi-Buffering:CreateImageBuffers R002 Multi-Buffering:DestroyImageBuffers R003 Multi-Buffering:DisplayImageBuffers R004 Multi-Buffering:SetMBufferAttributes R005 Multi-Buffering:GetMBufferAttributes R006 Multi-Buffering:SetBufferAttributes R007 Multi-Buffering:GetBufferAttributes R008 Multi-Buffering:GetBufferInfo R009 Multi-Buffering:CreateStereoWindow R010 Multi-Buffering:ClearImageBufferArea V000 Multi-Buffering:ClobberNotify V001 Multi-Buffering:UpdateNotify E000 Multi-Buffering:BadBuffer R000 RANDR:QueryVersion R001 RANDR:OldGetScreenInfo R002 RANDR:SetScreenConfig R003 RANDR:OldScreenChangeSelectInput R004 RANDR:SelectInput R005 RANDR:GetScreenInfo R006 RANDR:GetScreenSizeRange R007 RANDR:SetScreenSize R008 RANDR:GetScreenResources R009 RANDR:GetOutputInfo R010 RANDR:ListOutputProperties R011 RANDR:QueryOutputProperty R012 RANDR:ConfigureOutputProperty R013 RANDR:ChangeOutputProperty R014 RANDR:DeleteOutputProperty R015 RANDR:GetOutputProperty R016 RANDR:CreateMode R017 RANDR:DestroyMode R018 RANDR:AddOutputMode R019 RANDR:DeleteOutputMode R020 RANDR:GetCrtcInfo R021 RANDR:SetCrtcConfig R022 RANDR:GetCrtcGammaSize R023 RANDR:GetCrtcGamma R024 RANDR:SetCrtcGamma R025 RANDR:GetScreenResourcesCurrent R026 RANDR:SetCrtcTransform R027 RANDR:GetCrtcTransform R028 RANDR:GetPanning R029 RANDR:SetPanning R030 RANDR:SetOutputPrimary R031 RANDR:GetOutputPrimary R032 RANDR:RRGetProviders R033 RANDR:RRGetProviderInfo R034 RANDR:RRSetProviderOffloadSink R035 RANDR:RRSetProviderOutputSource R036 RANDR:RRListProviderProperties R037 RANDR:RRQueryProviderProperty R038 RANDR:RRConfigureProviderProperty R039 RANDR:RRChangeProviderProperty R040 RANDR:RRDeleteProviderProperty R041 RANDR:RRGetProviderProperty V000 RANDR:ScreenChangeNotify V001 RANDR:Notify E000 RANDR:BadRROutput E001 RANDR:BadRRCrtc E002 RANDR:BadRRMode E003 RANDR:BadRRProvider R000 RECORD:QueryVersion R001 RECORD:CreateContext R002 RECORD:RegisterClients R003 RECORD:UnregisterClients R004 RECORD:GetContext R005 RECORD:EnableContext R006 RECORD:DisableContext R007 RECORD:FreeContext E000 RECORD:BadContext R000 RENDER:QueryVersion R001 RENDER:QueryPictFormats R002 RENDER:QueryPictIndexValues R003 RENDER:QueryDithers R004 RENDER:CreatePicture R005 RENDER:ChangePicture R006 RENDER:SetPictureClipRectangles R007 RENDER:FreePicture R008 RENDER:Composite R009 RENDER:Scale R010 RENDER:Trapezoids R011 RENDER:Triangles R012 RENDER:TriStrip R013 RENDER:TriFan R014 RENDER:ColorTrapezoids R015 RENDER:ColorTriangles R016 RENDER:Transform R017 RENDER:CreateGlyphSet R018 RENDER:ReferenceGlyphSet R019 RENDER:FreeGlyphSet R020 RENDER:AddGlyphs R021 RENDER:AddGlyphsFromPicture R022 RENDER:FreeGlyphs R023 RENDER:CompositeGlyphs8 R024 RENDER:CompositeGlyphs16 R025 RENDER:CompositeGlyphs32 R026 RENDER:FillRectangles R027 RENDER:CreateCursor R028 RENDER:SetPictureTransform R029 RENDER:QueryFilters R030 RENDER:SetPictureFilter R031 RENDER:CreateAnimCursor R032 RENDER:AddTraps R033 RENDER:CreateSolidFill R034 RENDER:CreateLinearGradient R035 RENDER:CreateRadialGradient R036 RENDER:CreateConicalGradient E000 RENDER:BadPictFormat E001 RENDER:BadPicture E002 RENDER:BadPictOp E003 RENDER:BadGlyphSet E004 RENDER:BadGlyph R000 SECURITY:QueryVersion R001 SECURITY:GenerateAuthorization R002 SECURITY:RevokeAuthorization V000 SECURITY:AuthorizationRevoked E000 SECURITY:BadAuthorization E001 SECURITY:BadAuthorizationProtocol R000 SELinux:SELinuxQueryVersion R001 SELinux:SELinuxSetDeviceCreateContext R002 SELinux:SELinuxGetDeviceCreateContext R003 SELinux:SELinuxSetDeviceContext R004 SELinux:SELinuxGetDeviceContext R005 SELinux:SELinuxSetWindowCreateContext R006 SELinux:SELinuxGetWindowCreateContext R007 SELinux:SELinuxGetWindowContext R008 SELinux:SELinuxSetPropertyCreateContext R009 SELinux:SELinuxGetPropertyCreateContext R010 SELinux:SELinuxSetPropertyUseContext R011 SELinux:SELinuxGetPropertyUseContext R012 SELinux:SELinuxGetPropertyContext R013 SELinux:SELinuxGetPropertyDataContext R014 SELinux:SELinuxListProperties R015 SELinux:SELinuxSetSelectionCreateContext R016 SELinux:SELinuxGetSelectionCreateContext R017 SELinux:SELinuxSetSelectionUseContext R018 SELinux:SELinuxGetSelectionUseContext R019 SELinux:SELinuxGetSelectionContext R020 SELinux:SELinuxGetSelectionDataContext R021 SELinux:SELinuxListSelections R022 SELinux:SELinuxGetClientContext R000 SHAPE:QueryVersion R001 SHAPE:Rectangles R002 SHAPE:Mask R003 SHAPE:Combine R004 SHAPE:Offset R005 SHAPE:QueryExtents R006 SHAPE:SelectInput R007 SHAPE:InputSelected R008 SHAPE:GetRectangles V000 SHAPE:Notify R000 SYNC:Initialize R001 SYNC:ListSystemCounters R002 SYNC:CreateCounter R003 SYNC:SetCounter R004 SYNC:ChangeCounter R005 SYNC:QueryCounter R006 SYNC:DestroyCounter R007 SYNC:Await R008 SYNC:CreateAlarm R009 SYNC:ChangeAlarm R010 SYNC:QueryAlarm R011 SYNC:DestroyAlarm R012 SYNC:SetPriority R013 SYNC:GetPriority V000 SYNC:CounterNotify V001 SYNC:AlarmNotify E000 SYNC:BadCounter E001 SYNC:BadAlarm R000 TOG-CUP:QueryVersion R001 TOG-CUP:GetReservedColormapEntries R002 TOG-CUP:StoreColors R000 Windows-WM:QueryVersion R001 Windows-WM:FrameGetRect R002 Windows-WM:FrameDraw R003 Windows-WM:FrameSetTitle R004 Windows-WM:DisableUpdate R005 Windows-WM:ReenableUpdate R006 Windows-WM:SelectInput R007 Windows-WM:SetFrontProcess V000 Windows-WM:ControllerNotify V001 Windows-WM:ActivationNotify E000 Windows-WM:ClientNotLocal E001 Windows-WM:OperationNotSupported R000 X-Resource:QueryVersion R001 X-Resource:QueryClients R002 X-Resource:QueryClientResources R003 X-Resource:QueryClientPixmapBytes R001 X11:CreateWindow R002 X11:ChangeWindowAttributes R003 X11:GetWindowAttributes R004 X11:DestroyWindow R005 X11:DestroySubwindows R006 X11:ChangeSaveSet R007 X11:ReparentWindow R008 X11:MapWindow R009 X11:MapSubwindows R010 X11:UnmapWindow R011 X11:UnmapSubwindows R012 X11:ConfigureWindow R013 X11:CirculateWindow R014 X11:GetGeometry R015 X11:QueryTree R016 X11:InternAtom R017 X11:GetAtomName R018 X11:ChangeProperty R019 X11:DeleteProperty R020 X11:GetProperty R021 X11:ListProperties R022 X11:SetSelectionOwner R023 X11:GetSelectionOwner R024 X11:ConvertSelection R025 X11:SendEvent R026 X11:GrabPointer R027 X11:UngrabPointer R028 X11:GrabButton R029 X11:UngrabButton R030 X11:ChangeActivePointerGrab R031 X11:GrabKeyboard R032 X11:UngrabKeyboard R033 X11:GrabKey R034 X11:UngrabKey R035 X11:AllowEvents R036 X11:GrabServer R037 X11:UngrabServer R038 X11:QueryPointer R039 X11:GetMotionEvents R040 X11:TranslateCoords R041 X11:WarpPointer R042 X11:SetInputFocus R043 X11:GetInputFocus R044 X11:QueryKeymap R045 X11:OpenFont R046 X11:CloseFont R047 X11:QueryFont R048 X11:QueryTextExtents R049 X11:ListFonts R050 X11:ListFontsWithInfo R051 X11:SetFontPath R052 X11:GetFontPath R053 X11:CreatePixmap R054 X11:FreePixmap R055 X11:CreateGC R056 X11:ChangeGC R057 X11:CopyGC R058 X11:SetDashes R059 X11:SetClipRectangles R060 X11:FreeGC R061 X11:ClearArea R062 X11:CopyArea R063 X11:CopyPlane R064 X11:PolyPoint R065 X11:PolyLine R066 X11:PolySegment R067 X11:PolyRectangle R068 X11:PolyArc R069 X11:FillPoly R070 X11:PolyFillRectangle R071 X11:PolyFillArc R072 X11:PutImage R073 X11:GetImage R074 X11:PolyText8 R075 X11:PolyText16 R076 X11:ImageText8 R077 X11:ImageText16 R078 X11:CreateColormap R079 X11:FreeColormap R080 X11:CopyColormapAndFree R081 X11:InstallColormap R082 X11:UninstallColormap R083 X11:ListInstalledColormaps R084 X11:AllocColor R085 X11:AllocNamedColor R086 X11:AllocColorCells R087 X11:AllocColorPlanes R088 X11:FreeColors R089 X11:StoreColors R090 X11:StoreNamedColor R091 X11:QueryColors R092 X11:LookupColor R093 X11:CreateCursor R094 X11:CreateGlyphCursor R095 X11:FreeCursor R096 X11:RecolorCursor R097 X11:QueryBestSize R098 X11:QueryExtension R099 X11:ListExtensions R100 X11:ChangeKeyboardMapping R101 X11:GetKeyboardMapping R102 X11:ChangeKeyboardControl R103 X11:GetKeyboardControl R104 X11:Bell R105 X11:ChangePointerControl R106 X11:GetPointerControl R107 X11:SetScreenSaver R108 X11:GetScreenSaver R109 X11:ChangeHosts R110 X11:ListHosts R111 X11:SetAccessControl R112 X11:SetCloseDownMode R113 X11:KillClient R114 X11:RotateProperties R115 X11:ForceScreenSaver R116 X11:SetPointerMapping R117 X11:GetPointerMapping R118 X11:SetModifierMapping R119 X11:GetModifierMapping R127 X11:NoOperation V000 X11:X_Error V001 X11:X_Reply V002 X11:KeyPress V003 X11:KeyRelease V004 X11:ButtonPress V005 X11:ButtonRelease V006 X11:MotionNotify V007 X11:EnterNotify V008 X11:LeaveNotify V009 X11:FocusIn V010 X11:FocusOut V011 X11:KeymapNotify V012 X11:Expose V013 X11:GraphicsExpose V014 X11:NoExpose V015 X11:VisibilityNotify V016 X11:CreateNotify V017 X11:DestroyNotify V018 X11:UnmapNotify V019 X11:MapNotify V020 X11:MapRequest V021 X11:ReparentNotify V022 X11:ConfigureNotify V023 X11:ConfigureRequest V024 X11:GravityNotify V025 X11:ResizeRequest V026 X11:CirculateNotify V027 X11:CirculateRequest V028 X11:PropertyNotify V029 X11:SelectionClear V030 X11:SelectionRequest V031 X11:SelectionNotify V032 X11:ColormapNotify V033 X11:ClientMessage V034 X11:MappingNotify V035 X11:GenericEvent E000 X11:Success E001 X11:BadRequest E002 X11:BadValue E003 X11:BadWindow E004 X11:BadPixmap E005 X11:BadAtom E006 X11:BadCursor E007 X11:BadFont E008 X11:BadMatch E009 X11:BadDrawable E010 X11:BadAccess E011 X11:BadAlloc E012 X11:BadColor E013 X11:BadGC E014 X11:BadIDChoice E015 X11:BadName E016 X11:BadLength E017 X11:BadImplementation R001 X3D-PEX:GetExtensionInfo R002 X3D-PEX:GetEnumeratedTypeInfo R003 X3D-PEX:GetImpDepConstants R004 X3D-PEX:CreateLookupTable R005 X3D-PEX:CopyLookupTable R006 X3D-PEX:FreeLookupTable R007 X3D-PEX:GetTableInfo R008 X3D-PEX:GetPredefinedEntries R009 X3D-PEX:GetDefinedIndices R010 X3D-PEX:GetTableEntry R011 X3D-PEX:GetTableEntries R012 X3D-PEX:SetTableEntries R013 X3D-PEX:DeleteTableEntries R014 X3D-PEX:CreatePipelineContext R015 X3D-PEX:CopyPipelineContext R016 X3D-PEX:FreePipelineContext R017 X3D-PEX:GetPipelineContext R018 X3D-PEX:ChangePipelineContext R019 X3D-PEX:CreateRenderer R020 X3D-PEX:FreeRenderer R021 X3D-PEX:ChangeRenderer R022 X3D-PEX:GetRendererAttributes R023 X3D-PEX:GetRendererDynamics R024 X3D-PEX:BeginRendering R025 X3D-PEX:EndRendering R026 X3D-PEX:BeginStructure R027 X3D-PEX:EndStructure R028 X3D-PEX:OutputCommands R029 X3D-PEX:Network R030 X3D-PEX:CreateStructure R031 X3D-PEX:CopyStructure R032 X3D-PEX:DestroyStructures R033 X3D-PEX:GetStructureInfo R034 X3D-PEX:GetElementInfo R035 X3D-PEX:GetStructuresInNetwork R036 X3D-PEX:GetAncestors R037 X3D-PEX:GetDescendants R038 X3D-PEX:FetchElements R039 X3D-PEX:SetEditingMode R040 X3D-PEX:SetElementPointer R041 X3D-PEX:SetElementPointerAtLabel R042 X3D-PEX:ElementSearch R043 X3D-PEX:StoreElements R044 X3D-PEX:DeleteElements R045 X3D-PEX:DeleteElementsToLabel R046 X3D-PEX:DeleteBetweenLabels R047 X3D-PEX:CopyElements R048 X3D-PEX:ChangeStructureRefs R049 X3D-PEX:CreateNameSet R050 X3D-PEX:CopyNameSet R051 X3D-PEX:FreeNameSet R052 X3D-PEX:GetNameSet R053 X3D-PEX:ChangeNameSet R054 X3D-PEX:CreateSearchContext R055 X3D-PEX:CopySearchContext R056 X3D-PEX:FreeSearchContext R057 X3D-PEX:GetSearchContext R058 X3D-PEX:ChangeSearchContext R059 X3D-PEX:SearchNetwork R060 X3D-PEX:CreatePhigsWks R061 X3D-PEX:FreePhigsWks R062 X3D-PEX:GetWksInfo R063 X3D-PEX:GetDynamics R064 X3D-PEX:GetViewRep R065 X3D-PEX:RedrawAllStructures R066 X3D-PEX:UpdateWorkstation R067 X3D-PEX:RedrawClipRegion R068 X3D-PEX:ExecuteDeferredActions R069 X3D-PEX:SetViewPriority R070 X3D-PEX:SetDisplayUpdateMode R071 X3D-PEX:MapDCtoWC R072 X3D-PEX:MapWCtoDC R073 X3D-PEX:SetViewRep R074 X3D-PEX:SetWksWindow R075 X3D-PEX:SetWksViewport R076 X3D-PEX:SetHlhsrMode R077 X3D-PEX:SetWksBufferMode R078 X3D-PEX:PostStructure R079 X3D-PEX:UnpostStructure R080 X3D-PEX:UnpostAllStructures R081 X3D-PEX:GetWksPostings R082 X3D-PEX:GetPickDevice R083 X3D-PEX:ChangePickDevice R084 X3D-PEX:CreatePickMeasure R085 X3D-PEX:FreePickMeasure R086 X3D-PEX:GetPickMeasure R087 X3D-PEX:UpdatePickMeasure R088 X3D-PEX:OpenFont R089 X3D-PEX:CloseFont R090 X3D-PEX:QueryFont R091 X3D-PEX:ListFonts R092 X3D-PEX:ListFontsWithInfo R093 X3D-PEX:QueryTextExtents R094 X3D-PEX:MatchRenderingTargets R095 X3D-PEX:Escape R096 X3D-PEX:EscapeWithReply R097 X3D-PEX:Elements R098 X3D-PEX:AccumulateState R099 X3D-PEX:BeginPickOne R100 X3D-PEX:EndPickOne R101 X3D-PEX:PickOne R102 X3D-PEX:BeginPickAll R103 X3D-PEX:EndPickAll R104 X3D-PEX:PickAll E000 X3D-PEX:ColorTypeError E001 X3D-PEX:erStateError E002 X3D-PEX:FloatingPointFormatError E003 X3D-PEX:LabelError E004 X3D-PEX:LookupTableError E005 X3D-PEX:NameSetError E006 X3D-PEX:PathError E007 X3D-PEX:FontError E008 X3D-PEX:PhigsWksError E009 X3D-PEX:PickMeasureError E010 X3D-PEX:PipelineContextError E011 X3D-PEX:erError E012 X3D-PEX:SearchContextError E013 X3D-PEX:StructureError E014 X3D-PEX:OutputCommandError R000 XC-APPGROUP:QueryVersion R001 XC-APPGROUP:Create R002 XC-APPGROUP:Destroy R003 XC-APPGROUP:GetAttr R004 XC-APPGROUP:Query R005 XC-APPGROUP:CreateAssoc R006 XC-APPGROUP:DestroyAssoc E000 XC-APPGROUP:BadAppGroup R000 XC-MISC:GetVersion R001 XC-MISC:GetXIDRange R002 XC-MISC:GetXIDList R000 XFIXES:QueryVersion R001 XFIXES:ChangeSaveSet R002 XFIXES:SelectSelectionInput R003 XFIXES:SelectCursorInput R004 XFIXES:GetCursorImage R005 XFIXES:CreateRegion R006 XFIXES:CreateRegionFromBitmap R007 XFIXES:CreateRegionFromWindow R008 XFIXES:CreateRegionFromGC R009 XFIXES:CreateRegionFromPicture R010 XFIXES:DestroyRegion R011 XFIXES:SetRegion R012 XFIXES:CopyRegion R013 XFIXES:UnionRegion R014 XFIXES:IntersectRegion R015 XFIXES:SubtractRegion R016 XFIXES:InvertRegion R017 XFIXES:TranslateRegion R018 XFIXES:RegionExtents R019 XFIXES:FetchRegion R020 XFIXES:SetGCClipRegion R021 XFIXES:SetWindowShapeRegion R022 XFIXES:SetPictureClipRegion R023 XFIXES:SetCursorName R024 XFIXES:GetCursorName R025 XFIXES:GetCursorImageAndName R026 XFIXES:ChangeCursor R027 XFIXES:ChangeCursorByName R028 XFIXES:ExpandRegion R029 XFIXES:HideCursor R030 XFIXES:ShowCursor V000 XFIXES:SelectionNotify V001 XFIXES:CursorNotify E000 XFIXES:BadRegion R000 XFree86-Bigfont:QueryVersion R001 XFree86-Bigfont:QueryFont R000 XFree86-DGA:QueryVersion R001 XFree86-DGA:GetVideoLL R002 XFree86-DGA:DirectVideo R003 XFree86-DGA:GetViewPortSize R004 XFree86-DGA:SetViewPort R005 XFree86-DGA:GetVidPage R006 XFree86-DGA:SetVidPage R007 XFree86-DGA:InstallColormap R008 XFree86-DGA:QueryDirectVideo R009 XFree86-DGA:ViewPortChanged R010 XFree86-DGA:Obsolete1 R011 XFree86-DGA:Obsolete2 R012 XFree86-DGA:QueryModes R013 XFree86-DGA:SetMode R014 XFree86-DGA:SetViewport R015 XFree86-DGA:InstallColormap R016 XFree86-DGA:SelectInput R017 XFree86-DGA:FillRectangle R018 XFree86-DGA:CopyArea R019 XFree86-DGA:CopyTransparentArea R020 XFree86-DGA:GetViewportStatus R021 XFree86-DGA:Sync R022 XFree86-DGA:OpenFramebuffer R023 XFree86-DGA:CloseFramebuffer R024 XFree86-DGA:SetClientVersion R025 XFree86-DGA:ChangePixmapMode R026 XFree86-DGA:CreateColormap E000 XFree86-DGA:ClientNotLocal E001 XFree86-DGA:NoDirectVideoMode E002 XFree86-DGA:ScreenNotActive E003 XFree86-DGA:DirectNotActivated E004 XFree86-DGA:OperationNotSupported R000 XFree86-DRI:QueryVersion R001 XFree86-DRI:QueryDirectRenderingCapable R002 XFree86-DRI:OpenConnection R003 XFree86-DRI:CloseConnection R004 XFree86-DRI:GetClientDriverName R005 XFree86-DRI:CreateContext R006 XFree86-DRI:DestroyContext R007 XFree86-DRI:CreateDrawable R008 XFree86-DRI:DestroyDrawable R009 XFree86-DRI:GetDrawableInfo R010 XFree86-DRI:GetDeviceInfo R011 XFree86-DRI:AuthConnection R012 XFree86-DRI:OpenFullScreen R013 XFree86-DRI:CloseFullScreen E000 XFree86-DRI:ClientNotLocal E001 XFree86-DRI:OperationNotSupported R000 XFree86-Misc:QueryVersion R001 XFree86-Misc:GetSaver R002 XFree86-Misc:SetSaver R003 XFree86-Misc:GetMouseSettings R004 XFree86-Misc:GetKbdSettings R005 XFree86-Misc:SetMouseSettings R006 XFree86-Misc:SetKbdSettings R007 XFree86-Misc:SetGrabKeysState R008 XFree86-Misc:SetClientVersion R009 XFree86-Misc:GetFilePaths R010 XFree86-Misc:PassMessage E000 XFree86-Misc:BadMouseProtocol E001 XFree86-Misc:BadMouseBaudRate E002 XFree86-Misc:BadMouseFlags E003 XFree86-Misc:BadMouseCombo E004 XFree86-Misc:BadKbdType E005 XFree86-Misc:ModInDevDisabled E006 XFree86-Misc:ModInDevClientNotLocal E007 XFree86-Misc:NoModule R000 XFree86-VidModeExtension:QueryVersion R001 XFree86-VidModeExtension:GetModeLine R002 XFree86-VidModeExtension:ModModeLine R003 XFree86-VidModeExtension:SwitchMode R004 XFree86-VidModeExtension:GetMonitor R005 XFree86-VidModeExtension:LockModeSwitch R006 XFree86-VidModeExtension:GetAllModeLines R007 XFree86-VidModeExtension:AddModeLine R008 XFree86-VidModeExtension:DeleteModeLine R009 XFree86-VidModeExtension:ValidateModeLine R010 XFree86-VidModeExtension:SwitchToMode R011 XFree86-VidModeExtension:GetViewPort R012 XFree86-VidModeExtension:SetViewPort R013 XFree86-VidModeExtension:GetDotClocks R014 XFree86-VidModeExtension:SetClientVersion R015 XFree86-VidModeExtension:SetGamma R016 XFree86-VidModeExtension:GetGamma R017 XFree86-VidModeExtension:GetGammaRamp R018 XFree86-VidModeExtension:SetGammaRamp R019 XFree86-VidModeExtension:GetGammaRampSize R020 XFree86-VidModeExtension:GetPermissions V000 XFree86-VidModeExtension:Notify E000 XFree86-VidModeExtension:BadClock E001 XFree86-VidModeExtension:BadHTimings E002 XFree86-VidModeExtension:BadVTimings E003 XFree86-VidModeExtension:ModeUnsuitable E004 XFree86-VidModeExtension:ExtensionDisabled E005 XFree86-VidModeExtension:ClientNotLocal E006 XFree86-VidModeExtension:ZoomLocked R001 XIE:QueryImageExtension R002 XIE:QueryTechniques R003 XIE:CreateColorList R004 XIE:DestroyColorList R005 XIE:PurgeColorList R006 XIE:QueryColorList R007 XIE:CreateLUT R008 XIE:DestroyLUT R009 XIE:CreatePhotomap R010 XIE:DestroyPhotomap R011 XIE:QueryPhotomap R012 XIE:CreateROI R013 XIE:DestroyROI R014 XIE:CreatePhotospace R015 XIE:DestroyPhotospace R016 XIE:ExecuteImmediate R017 XIE:CreatePhotoflo R018 XIE:DestroyPhotoflo R019 XIE:ExecutePhotoflo R020 XIE:ModifyPhotoflo R021 XIE:RedefinePhotoflo R022 XIE:PutClientData R023 XIE:GetClientData R024 XIE:QueryPhotoflo R025 XIE:Await R026 XIE:Abort E000 XIE:ColorListError E001 XIE:LUTError E002 XIE:PhotofloError E003 XIE:PhotomapError E004 XIE:PhotospaceError E005 XIE:ROIError E006 XIE:FloError R000 XINERAMA:QueryVersion R001 XINERAMA:GetState R002 XINERAMA:GetScreenCount R003 XINERAMA:GetScreenSize R004 XINERAMA:IsActive R005 XINERAMA:QueryScreens R001 XInputExtension:GetExtensionVersion R002 XInputExtension:ListInputDevices R003 XInputExtension:OpenDevice R004 XInputExtension:CloseDevice R005 XInputExtension:SetDeviceMode R006 XInputExtension:SelectExtensionEvent R007 XInputExtension:GetSelectedExtensionEvents R008 XInputExtension:ChangeDeviceDontPropagateList R009 XInputExtension:GetDeviceDontPropagageList R010 XInputExtension:GetDeviceMotionEvents R011 XInputExtension:ChangeKeyboardDevice R012 XInputExtension:ChangePointerDevice R013 XInputExtension:GrabDevice R014 XInputExtension:UngrabDevice R015 XInputExtension:GrabDeviceKey R016 XInputExtension:UngrabDeviceKey R017 XInputExtension:GrabDeviceButton R018 XInputExtension:UngrabDeviceButton R019 XInputExtension:AllowDeviceEvents R020 XInputExtension:GetDeviceFocus R021 XInputExtension:SetDeviceFocus R022 XInputExtension:GetFeedbackControl R023 XInputExtension:ChangeFeedbackControl R024 XInputExtension:GetDeviceKeyMapping R025 XInputExtension:ChangeDeviceKeyMapping R026 XInputExtension:GetDeviceModifierMapping R027 XInputExtension:SetDeviceModifierMapping R028 XInputExtension:GetDeviceButtonMapping R029 XInputExtension:SetDeviceButtonMapping R030 XInputExtension:QueryDeviceState R031 XInputExtension:SendExtensionEvent R032 XInputExtension:DeviceBell R033 XInputExtension:SetDeviceValuators R034 XInputExtension:GetDeviceControl R035 XInputExtension:ChangeDeviceControl R036 XInputExtension:ListDeviceProperties R037 XInputExtension:ChangeDeviceProperty R038 XInputExtension:DeleteDeviceProperty R039 XInputExtension:GetDeviceProperty R040 XInputExtension:QueryPointer R041 XInputExtension:WarpPointer R042 XInputExtension:ChangeCursor R043 XInputExtension:ChangeHierarchy R044 XInputExtension:SetClientPointer R045 XInputExtension:GetClientPointer R046 XInputExtension:SelectEvents R047 XInputExtension:QueryVersion R048 XInputExtension:QueryDevice R049 XInputExtension:SetFocus R050 XInputExtension:GetFocus R051 XInputExtension:GrabDevice R052 XInputExtension:UngrabDevice R053 XInputExtension:AllowEvents R054 XInputExtension:PassiveGrabDevice R055 XInputExtension:PassiveUngrabDevice R056 XInputExtension:ListProperties R057 XInputExtension:ChangeProperty R058 XInputExtension:DeleteProperty R059 XInputExtension:GetProperty R060 XInputExtension:GetSelectedEvents V000 XInputExtension:DeviceValuator V001 XInputExtension:DeviceKeyPress V002 XInputExtension:DeviceKeyRelease V003 XInputExtension:DeviceButtonPress V004 XInputExtension:DeviceButtonRelease V005 XInputExtension:DeviceMotionNotify V006 XInputExtension:DeviceFocusIn V007 XInputExtension:DeviceFocusOut V008 XInputExtension:ProximityIn V009 XInputExtension:ProximityOut V010 XInputExtension:DeviceStateNotify V011 XInputExtension:DeviceMappingNotify V012 XInputExtension:ChangeDeviceNotify V013 XInputExtension:DeviceKeystateNotify V014 XInputExtension:DeviceButtonstateNotify V015 XInputExtension:DevicePresenceNotify V016 XInputExtension:DevicePropertyNotify E000 XInputExtension:BadDevice E001 XInputExtension:BadEvent E002 XInputExtension:BadMode E003 XInputExtension:DeviceBusy E004 XInputExtension:BadClass R000 XKEYBOARD:UseExtension R001 XKEYBOARD:SelectEvents R002 XKEYBOARD:Obsolete R003 XKEYBOARD:Bell R004 XKEYBOARD:GetState R005 XKEYBOARD:LatchLockState R006 XKEYBOARD:GetControls R007 XKEYBOARD:SetControls R008 XKEYBOARD:GetMap R009 XKEYBOARD:SetMap R010 XKEYBOARD:GetCompatMap R011 XKEYBOARD:SetCompatMap R012 XKEYBOARD:GetIndicatorState R013 XKEYBOARD:GetIndicatorMap R014 XKEYBOARD:SetIndicatorMap R015 XKEYBOARD:GetNamedIndicator R016 XKEYBOARD:SetNamedIndicator R017 XKEYBOARD:GetNames R018 XKEYBOARD:SetNames R019 XKEYBOARD:GetGeometry R020 XKEYBOARD:SetGeometry R021 XKEYBOARD:PerClientFlags R022 XKEYBOARD:ListComponents R023 XKEYBOARD:GetKbdByName R024 XKEYBOARD:GetDeviceInfo R025 XKEYBOARD:SetDeviceInfo R101 XKEYBOARD:SetDebuggingFlags V000 XKEYBOARD:EventCode E000 XKEYBOARD:BadKeyboard R000 XTEST:GetVersion R001 XTEST:CompareCursor R002 XTEST:FakeInput R003 XTEST:GrabControl R000 XVideo:QueryExtension R001 XVideo:QueryAdaptors R002 XVideo:QueryEncodings R003 XVideo:GrabPort R004 XVideo:UngrabPort R005 XVideo:PutVideo R006 XVideo:PutStill R007 XVideo:GetVideo R008 XVideo:GetStill R009 XVideo:StopVideo R010 XVideo:SelectVideoNotify R011 XVideo:SelectPortNotify R012 XVideo:QueryBestSize R013 XVideo:SetPortAttribute R014 XVideo:GetPortAttribute R015 XVideo:QueryPortAttributes R016 XVideo:ListImageFormats R017 XVideo:QueryImageAttributes R018 XVideo:PutImage R019 XVideo:ShmPutImage V000 XVideo:VideoNotify V001 XVideo:PortNotify E000 XVideo:BadPort E001 XVideo:BadEncoding E002 XVideo:BadControl R000 XVideo-MotionCompensation:QueryVersion R001 XVideo-MotionCompensation:ListSurfaceTypes R002 XVideo-MotionCompensation:CreateContext R003 XVideo-MotionCompensation:DestroyContext R004 XVideo-MotionCompensation:CreateSurface R005 XVideo-MotionCompensation:DestroySurface R006 XVideo-MotionCompensation:CreateSubpicture R007 XVideo-MotionCompensation:DestroySubpicture R008 XVideo-MotionCompensation:ListSubpictureTypes R009 XVideo-MotionCompensation:GetDRInfo E000 XVideo-MotionCompensation:BadContext E001 XVideo-MotionCompensation:BadSurface E002 XVideo-MotionCompensation:BadSubpicture ����������������xorg-server-1.17.1/dix/region.c���������������������������������������������������������������������0000664�0001751�0001751�00000131311�12456571574�013244� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1988, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987, 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "regionstr.h" #include <X11/Xprotostr.h> #include <X11/Xfuncproto.h> #include "gc.h" #include <pixman.h> #undef assert #ifdef REGION_DEBUG #define assert(expr) { \ CARD32 *foo = NULL; \ if (!(expr)) { \ ErrorF("Assertion failed file %s, line %d: %s\n", \ __FILE__, __LINE__, #expr); \ *foo = 0xdeadbeef; /* to get a backtrace */ \ } \ } #else #define assert(expr) #endif #define good(reg) assert(RegionIsValid(reg)) /* * The functions in this file implement the Region abstraction used extensively * throughout the X11 sample server. A Region is simply a set of disjoint * (non-overlapping) rectangles, plus an "extent" rectangle which is the * smallest single rectangle that contains all the non-overlapping rectangles. * * A Region is implemented as a "y-x-banded" array of rectangles. This array * imposes two degrees of order. First, all rectangles are sorted by top side * y coordinate first (y1), and then by left side x coordinate (x1). * * Furthermore, the rectangles are grouped into "bands". Each rectangle in a * band has the same top y coordinate (y1), and each has the same bottom y * coordinate (y2). Thus all rectangles in a band differ only in their left * and right side (x1 and x2). Bands are implicit in the array of rectangles: * there is no separate list of band start pointers. * * The y-x band representation does not minimize rectangles. In particular, * if a rectangle vertically crosses a band (the rectangle has scanlines in * the y1 to y2 area spanned by the band), then the rectangle may be broken * down into two or more smaller rectangles stacked one atop the other. * * ----------- ----------- * | | | | band 0 * | | -------- ----------- -------- * | | | | in y-x banded | | | | band 1 * | | | | form is | | | | * ----------- | | ----------- -------- * | | | | band 2 * -------- -------- * * An added constraint on the rectangles is that they must cover as much * horizontal area as possible: no two rectangles within a band are allowed * to touch. * * Whenever possible, bands will be merged together to cover a greater vertical * distance (and thus reduce the number of rectangles). Two bands can be merged * only if the bottom of one touches the top of the other and they have * rectangles in the same places (of the same width, of course). * * Adam de Boor wrote most of the original region code. Joel McCormack * substantially modified or rewrote most of the core arithmetic routines, * and added RegionValidate in order to support several speed improvements * to miValidateTree. Bob Scheifler changed the representation to be more * compact when empty or a single rectangle, and did a bunch of gratuitous * reformatting. */ /* true iff two Boxes overlap */ #define EXTENTCHECK(r1,r2) \ (!( ((r1)->x2 <= (r2)->x1) || \ ((r1)->x1 >= (r2)->x2) || \ ((r1)->y2 <= (r2)->y1) || \ ((r1)->y1 >= (r2)->y2) ) ) /* true iff (x,y) is in Box */ #define INBOX(r,x,y) \ ( ((r)->x2 > x) && \ ((r)->x1 <= x) && \ ((r)->y2 > y) && \ ((r)->y1 <= y) ) /* true iff Box r1 contains Box r2 */ #define SUBSUMES(r1,r2) \ ( ((r1)->x1 <= (r2)->x1) && \ ((r1)->x2 >= (r2)->x2) && \ ((r1)->y1 <= (r2)->y1) && \ ((r1)->y2 >= (r2)->y2) ) #define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data) #define RECTALLOC_BAIL(pReg,n,bail) \ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ if (!RegionRectAlloc(pReg, n)) { goto bail; } #define RECTALLOC(pReg,n) \ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ if (!RegionRectAlloc(pReg, n)) { return FALSE; } #define ADDRECT(pNextRect,nx1,ny1,nx2,ny2) \ { \ pNextRect->x1 = nx1; \ pNextRect->y1 = ny1; \ pNextRect->x2 = nx2; \ pNextRect->y2 = ny2; \ pNextRect++; \ } #define NEWRECT(pReg,pNextRect,nx1,ny1,nx2,ny2) \ { \ if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\ { \ if (!RegionRectAlloc(pReg, 1)) \ return FALSE; \ pNextRect = RegionTop(pReg); \ } \ ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \ pReg->data->numRects++; \ assert(pReg->data->numRects<=pReg->data->size); \ } #define DOWNSIZE(reg,numRects) \ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ { \ size_t NewSize = RegionSizeof(numRects); \ RegDataPtr NewData = \ (NewSize > 0) ? realloc((reg)->data, NewSize) : NULL ; \ if (NewData) \ { \ NewData->size = (numRects); \ (reg)->data = NewData; \ } \ } BoxRec RegionEmptyBox = { 0, 0, 0, 0 }; RegDataRec RegionEmptyData = { 0, 0 }; RegDataRec RegionBrokenData = { 0, 0 }; static RegionRec RegionBrokenRegion = { {0, 0, 0, 0}, &RegionBrokenData }; void InitRegions(void) { pixman_region_set_static_pointers(&RegionEmptyBox, &RegionEmptyData, &RegionBrokenData); } /***************************************************************** * RegionCreate(rect, size) * This routine does a simple malloc to make a structure of * REGION of "size" number of rectangles. *****************************************************************/ RegionPtr RegionCreate(BoxPtr rect, int size) { RegionPtr pReg; pReg = (RegionPtr) malloc(sizeof(RegionRec)); if (!pReg) return &RegionBrokenRegion; RegionInit(pReg, rect, size); return pReg; } void RegionDestroy(RegionPtr pReg) { pixman_region_fini(pReg); if (pReg != &RegionBrokenRegion) free(pReg); } RegionPtr RegionDuplicate(RegionPtr pOld) { RegionPtr pNew; pNew = RegionCreate(&pOld->extents, 0); if (!pNew) return NULL; if (!RegionCopy(pNew, pOld)) { RegionDestroy(pNew); return NULL; } return pNew; } void RegionPrint(RegionPtr rgn) { int num, size; int i; BoxPtr rects; num = RegionNumRects(rgn); size = RegionSize(rgn); rects = RegionRects(rgn); ErrorF("[mi] num: %d size: %d\n", num, size); ErrorF("[mi] extents: %d %d %d %d\n", rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2); for (i = 0; i < num; i++) ErrorF("[mi] %d %d %d %d \n", rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2); ErrorF("[mi] \n"); } #ifdef DEBUG Bool RegionIsValid(RegionPtr reg) { int i, numRects; if ((reg->extents.x1 > reg->extents.x2) || (reg->extents.y1 > reg->extents.y2)) return FALSE; numRects = RegionNumRects(reg); if (!numRects) return ((reg->extents.x1 == reg->extents.x2) && (reg->extents.y1 == reg->extents.y2) && (reg->data->size || (reg->data == &RegionEmptyData))); else if (numRects == 1) return !reg->data; else { BoxPtr pboxP, pboxN; BoxRec box; pboxP = RegionRects(reg); box = *pboxP; box.y2 = pboxP[numRects - 1].y2; pboxN = pboxP + 1; for (i = numRects; --i > 0; pboxP++, pboxN++) { if ((pboxN->x1 >= pboxN->x2) || (pboxN->y1 >= pboxN->y2)) return FALSE; if (pboxN->x1 < box.x1) box.x1 = pboxN->x1; if (pboxN->x2 > box.x2) box.x2 = pboxN->x2; if ((pboxN->y1 < pboxP->y1) || ((pboxN->y1 == pboxP->y1) && ((pboxN->x1 < pboxP->x2) || (pboxN->y2 != pboxP->y2)))) return FALSE; } return ((box.x1 == reg->extents.x1) && (box.x2 == reg->extents.x2) && (box.y1 == reg->extents.y1) && (box.y2 == reg->extents.y2)); } } #endif /* DEBUG */ Bool RegionBreak(RegionPtr pReg) { xfreeData(pReg); pReg->extents = RegionEmptyBox; pReg->data = &RegionBrokenData; return FALSE; } Bool RegionRectAlloc(RegionPtr pRgn, int n) { RegDataPtr data; size_t rgnSize; if (!pRgn->data) { n++; rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL; if (!pRgn->data) return RegionBreak(pRgn); pRgn->data->numRects = 1; *RegionBoxptr(pRgn) = pRgn->extents; } else if (!pRgn->data->size) { rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL; if (!pRgn->data) return RegionBreak(pRgn); pRgn->data->numRects = 0; } else { if (n == 1) { n = pRgn->data->numRects; if (n > 500) /* XXX pick numbers out of a hat */ n = 250; } n += pRgn->data->numRects; rgnSize = RegionSizeof(n); data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL; if (!data) return RegionBreak(pRgn); pRgn->data = data; } pRgn->data->size = n; return TRUE; } /*====================================================================== * Generic Region Operator *====================================================================*/ /*- *----------------------------------------------------------------------- * RegionCoalesce -- * Attempt to merge the boxes in the current band with those in the * previous one. We are guaranteed that the current band extends to * the end of the rects array. Used only by RegionOp. * * Results: * The new index for the previous band. * * Side Effects: * If coalescing takes place: * - rectangles in the previous band will have their y2 fields * altered. * - pReg->data->numRects will be decreased. * *----------------------------------------------------------------------- */ _X_INLINE static int RegionCoalesce(RegionPtr pReg, /* Region to coalesce */ int prevStart, /* Index of start of previous band */ int curStart) { /* Index of start of current band */ BoxPtr pPrevBox; /* Current box in previous band */ BoxPtr pCurBox; /* Current box in current band */ int numRects; /* Number rectangles in both bands */ int y2; /* Bottom of current band */ /* * Figure out how many rectangles are in the band. */ numRects = curStart - prevStart; assert(numRects == pReg->data->numRects - curStart); if (!numRects) return curStart; /* * The bands may only be coalesced if the bottom of the previous * matches the top scanline of the current. */ pPrevBox = RegionBox(pReg, prevStart); pCurBox = RegionBox(pReg, curStart); if (pPrevBox->y2 != pCurBox->y1) return curStart; /* * Make sure the bands have boxes in the same places. This * assumes that boxes have been added in such a way that they * cover the most area possible. I.e. two boxes in a band must * have some horizontal space between them. */ y2 = pCurBox->y2; do { if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) { return curStart; } pPrevBox++; pCurBox++; numRects--; } while (numRects); /* * The bands may be merged, so set the bottom y of each box * in the previous band to the bottom y of the current band. */ numRects = curStart - prevStart; pReg->data->numRects -= numRects; do { pPrevBox--; pPrevBox->y2 = y2; numRects--; } while (numRects); return prevStart; } /* Quicky macro to avoid trivial reject procedure calls to RegionCoalesce */ #define Coalesce(newReg, prevBand, curBand) \ if (curBand - prevBand == newReg->data->numRects - curBand) { \ prevBand = RegionCoalesce(newReg, prevBand, curBand); \ } else { \ prevBand = curBand; \ } /*- *----------------------------------------------------------------------- * RegionAppendNonO -- * Handle a non-overlapping band for the union and subtract operations. * Just adds the (top/bottom-clipped) rectangles into the region. * Doesn't have to check for subsumption or anything. * * Results: * None. * * Side Effects: * pReg->data->numRects is incremented and the rectangles overwritten * with the rectangles we're passed. * *----------------------------------------------------------------------- */ _X_INLINE static Bool RegionAppendNonO(RegionPtr pReg, BoxPtr r, BoxPtr rEnd, int y1, int y2) { BoxPtr pNextRect; int newRects; newRects = rEnd - r; assert(y1 < y2); assert(newRects != 0); /* Make sure we have enough space for all rectangles to be added */ RECTALLOC(pReg, newRects); pNextRect = RegionTop(pReg); pReg->data->numRects += newRects; do { assert(r->x1 < r->x2); ADDRECT(pNextRect, r->x1, y1, r->x2, y2); r++; } while (r != rEnd); return TRUE; } #define FindBand(r, rBandEnd, rEnd, ry1) \ { \ ry1 = r->y1; \ rBandEnd = r+1; \ while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1)) { \ rBandEnd++; \ } \ } #define AppendRegions(newReg, r, rEnd) \ { \ int newRects; \ if ((newRects = rEnd - r)) { \ RECTALLOC(newReg, newRects); \ memmove((char *)RegionTop(newReg),(char *)r, \ newRects * sizeof(BoxRec)); \ newReg->data->numRects += newRects; \ } \ } /*- *----------------------------------------------------------------------- * RegionOp -- * Apply an operation to two regions. Called by RegionUnion, RegionInverse, * RegionSubtract, RegionIntersect.... Both regions MUST have at least one * rectangle, and cannot be the same object. * * Results: * TRUE if successful. * * Side Effects: * The new region is overwritten. * pOverlap set to TRUE if overlapFunc ever returns TRUE. * * Notes: * The idea behind this function is to view the two regions as sets. * Together they cover a rectangle of area that this function divides * into horizontal bands where points are covered only by one region * or by both. For the first case, the nonOverlapFunc is called with * each the band and the band's upper and lower extents. For the * second, the overlapFunc is called to process the entire band. It * is responsible for clipping the rectangles in the band, though * this function provides the boundaries. * At the end of each band, the new region is coalesced, if possible, * to reduce the number of rectangles in the region. * *----------------------------------------------------------------------- */ typedef Bool (*OverlapProcPtr) (RegionPtr pReg, BoxPtr r1, BoxPtr r1End, BoxPtr r2, BoxPtr r2End, short y1, short y2, Bool *pOverlap); static Bool RegionOp(RegionPtr newReg, /* Place to store result */ RegionPtr reg1, /* First region in operation */ RegionPtr reg2, /* 2d region in operation */ OverlapProcPtr overlapFunc, /* Function to call for over- * lapping bands */ Bool appendNon1, /* Append non-overlapping bands */ /* in region 1 ? */ Bool appendNon2, /* Append non-overlapping bands */ /* in region 2 ? */ Bool *pOverlap) { BoxPtr r1; /* Pointer into first region */ BoxPtr r2; /* Pointer into 2d region */ BoxPtr r1End; /* End of 1st region */ BoxPtr r2End; /* End of 2d region */ short ybot; /* Bottom of intersection */ short ytop; /* Top of intersection */ RegDataPtr oldData; /* Old data for newReg */ int prevBand; /* Index of start of * previous band in newReg */ int curBand; /* Index of start of current * band in newReg */ BoxPtr r1BandEnd; /* End of current band in r1 */ BoxPtr r2BandEnd; /* End of current band in r2 */ short top; /* Top of non-overlapping band */ short bot; /* Bottom of non-overlapping band */ int r1y1; /* Temps for r1->y1 and r2->y1 */ int r2y1; int newSize; int numRects; /* * Break any region computed from a broken region */ if (RegionNar(reg1) || RegionNar(reg2)) return RegionBreak(newReg); /* * Initialization: * set r1, r2, r1End and r2End appropriately, save the rectangles * of the destination region until the end in case it's one of * the two source regions, then mark the "new" region empty, allocating * another array of rectangles for it to use. */ r1 = RegionRects(reg1); newSize = RegionNumRects(reg1); r1End = r1 + newSize; numRects = RegionNumRects(reg2); r2 = RegionRects(reg2); r2End = r2 + numRects; assert(r1 != r1End); assert(r2 != r2End); oldData = NULL; if (((newReg == reg1) && (newSize > 1)) || ((newReg == reg2) && (numRects > 1))) { oldData = newReg->data; newReg->data = &RegionEmptyData; } /* guess at new size */ if (numRects > newSize) newSize = numRects; newSize <<= 1; if (!newReg->data) newReg->data = &RegionEmptyData; else if (newReg->data->size) newReg->data->numRects = 0; if (newSize > newReg->data->size) if (!RegionRectAlloc(newReg, newSize)) return FALSE; /* * Initialize ybot. * In the upcoming loop, ybot and ytop serve different functions depending * on whether the band being handled is an overlapping or non-overlapping * band. * In the case of a non-overlapping band (only one of the regions * has points in the band), ybot is the bottom of the most recent * intersection and thus clips the top of the rectangles in that band. * ytop is the top of the next intersection between the two regions and * serves to clip the bottom of the rectangles in the current band. * For an overlapping band (where the two regions intersect), ytop clips * the top of the rectangles of both regions and ybot clips the bottoms. */ ybot = min(r1->y1, r2->y1); /* * prevBand serves to mark the start of the previous band so rectangles * can be coalesced into larger rectangles. qv. RegionCoalesce, above. * In the beginning, there is no previous band, so prevBand == curBand * (curBand is set later on, of course, but the first band will always * start at index 0). prevBand and curBand must be indices because of * the possible expansion, and resultant moving, of the new region's * array of rectangles. */ prevBand = 0; do { /* * This algorithm proceeds one source-band (as opposed to a * destination band, which is determined by where the two regions * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the * rectangle after the last one in the current band for their * respective regions. */ assert(r1 != r1End); assert(r2 != r2End); FindBand(r1, r1BandEnd, r1End, r1y1); FindBand(r2, r2BandEnd, r2End, r2y1); /* * First handle the band that doesn't intersect, if any. * * Note that attention is restricted to one band in the * non-intersecting region at once, so if a region has n * bands between the current position and the next place it overlaps * the other, this entire loop will be passed through n times. */ if (r1y1 < r2y1) { if (appendNon1) { top = max(r1y1, ybot); bot = min(r1->y2, r2y1); if (top != bot) { curBand = newReg->data->numRects; RegionAppendNonO(newReg, r1, r1BandEnd, top, bot); Coalesce(newReg, prevBand, curBand); } } ytop = r2y1; } else if (r2y1 < r1y1) { if (appendNon2) { top = max(r2y1, ybot); bot = min(r2->y2, r1y1); if (top != bot) { curBand = newReg->data->numRects; RegionAppendNonO(newReg, r2, r2BandEnd, top, bot); Coalesce(newReg, prevBand, curBand); } } ytop = r1y1; } else { ytop = r1y1; } /* * Now see if we've hit an intersecting band. The two bands only * intersect if ybot > ytop */ ybot = min(r1->y2, r2->y2); if (ybot > ytop) { curBand = newReg->data->numRects; (*overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot, pOverlap); Coalesce(newReg, prevBand, curBand); } /* * If we've finished with a band (y2 == ybot) we skip forward * in the region to the next band. */ if (r1->y2 == ybot) r1 = r1BandEnd; if (r2->y2 == ybot) r2 = r2BandEnd; } while (r1 != r1End && r2 != r2End); /* * Deal with whichever region (if any) still has rectangles left. * * We only need to worry about banding and coalescing for the very first * band left. After that, we can just group all remaining boxes, * regardless of how many bands, into one final append to the list. */ if ((r1 != r1End) && appendNon1) { /* Do first nonOverlap1Func call, which may be able to coalesce */ FindBand(r1, r1BandEnd, r1End, r1y1); curBand = newReg->data->numRects; RegionAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2); Coalesce(newReg, prevBand, curBand); /* Just append the rest of the boxes */ AppendRegions(newReg, r1BandEnd, r1End); } else if ((r2 != r2End) && appendNon2) { /* Do first nonOverlap2Func call, which may be able to coalesce */ FindBand(r2, r2BandEnd, r2End, r2y1); curBand = newReg->data->numRects; RegionAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2); Coalesce(newReg, prevBand, curBand); /* Append rest of boxes */ AppendRegions(newReg, r2BandEnd, r2End); } free(oldData); if (!(numRects = newReg->data->numRects)) { xfreeData(newReg); newReg->data = &RegionEmptyData; } else if (numRects == 1) { newReg->extents = *RegionBoxptr(newReg); xfreeData(newReg); newReg->data = NULL; } else { DOWNSIZE(newReg, numRects); } return TRUE; } /*- *----------------------------------------------------------------------- * RegionSetExtents -- * Reset the extents of a region to what they should be. Called by * Subtract and Intersect as they can't figure it out along the * way or do so easily, as Union can. * * Results: * None. * * Side Effects: * The region's 'extents' structure is overwritten. * *----------------------------------------------------------------------- */ static void RegionSetExtents(RegionPtr pReg) { BoxPtr pBox, pBoxEnd; if (!pReg->data) return; if (!pReg->data->size) { pReg->extents.x2 = pReg->extents.x1; pReg->extents.y2 = pReg->extents.y1; return; } pBox = RegionBoxptr(pReg); pBoxEnd = RegionEnd(pReg); /* * Since pBox is the first rectangle in the region, it must have the * smallest y1 and since pBoxEnd is the last rectangle in the region, * it must have the largest y2, because of banding. Initialize x1 and * x2 from pBox and pBoxEnd, resp., as good things to initialize them * to... */ pReg->extents.x1 = pBox->x1; pReg->extents.y1 = pBox->y1; pReg->extents.x2 = pBoxEnd->x2; pReg->extents.y2 = pBoxEnd->y2; assert(pReg->extents.y1 < pReg->extents.y2); while (pBox <= pBoxEnd) { if (pBox->x1 < pReg->extents.x1) pReg->extents.x1 = pBox->x1; if (pBox->x2 > pReg->extents.x2) pReg->extents.x2 = pBox->x2; pBox++; }; assert(pReg->extents.x1 < pReg->extents.x2); } /*====================================================================== * Region Intersection *====================================================================*/ /*- *----------------------------------------------------------------------- * RegionIntersectO -- * Handle an overlapping band for RegionIntersect. * * Results: * TRUE if successful. * * Side Effects: * Rectangles may be added to the region. * *----------------------------------------------------------------------- */ /*ARGSUSED*/ #define MERGERECT(r) \ { \ if (r->x1 <= x2) { \ /* Merge with current rectangle */ \ if (r->x1 < x2) *pOverlap = TRUE; \ if (x2 < r->x2) x2 = r->x2; \ } else { \ /* Add current rectangle, start new one */ \ NEWRECT(pReg, pNextRect, x1, y1, x2, y2); \ x1 = r->x1; \ x2 = r->x2; \ } \ r++; \ } /*====================================================================== * Region Union *====================================================================*/ /*- *----------------------------------------------------------------------- * RegionUnionO -- * Handle an overlapping band for the union operation. Picks the * left-most rectangle each time and merges it into the region. * * Results: * TRUE if successful. * * Side Effects: * pReg is overwritten. * pOverlap is set to TRUE if any boxes overlap. * *----------------------------------------------------------------------- */ static Bool RegionUnionO(RegionPtr pReg, BoxPtr r1, BoxPtr r1End, BoxPtr r2, BoxPtr r2End, short y1, short y2, Bool *pOverlap) { BoxPtr pNextRect; int x1; /* left and right side of current union */ int x2; assert(y1 < y2); assert(r1 != r1End && r2 != r2End); pNextRect = RegionTop(pReg); /* Start off current rectangle */ if (r1->x1 < r2->x1) { x1 = r1->x1; x2 = r1->x2; r1++; } else { x1 = r2->x1; x2 = r2->x2; r2++; } while (r1 != r1End && r2 != r2End) { if (r1->x1 < r2->x1) MERGERECT(r1) else MERGERECT(r2); } /* Finish off whoever (if any) is left */ if (r1 != r1End) { do { MERGERECT(r1); } while (r1 != r1End); } else if (r2 != r2End) { do { MERGERECT(r2); } while (r2 != r2End); } /* Add current rectangle */ NEWRECT(pReg, pNextRect, x1, y1, x2, y2); return TRUE; } /*====================================================================== * Batch Rectangle Union *====================================================================*/ /*- *----------------------------------------------------------------------- * RegionAppend -- * * "Append" the rgn rectangles onto the end of dstrgn, maintaining * knowledge of YX-banding when it's easy. Otherwise, dstrgn just * becomes a non-y-x-banded random collection of rectangles, and not * yet a true region. After a sequence of appends, the caller must * call RegionValidate to ensure that a valid region is constructed. * * Results: * TRUE if successful. * * Side Effects: * dstrgn is modified if rgn has rectangles. * */ Bool RegionAppend(RegionPtr dstrgn, RegionPtr rgn) { int numRects, dnumRects, size; BoxPtr new, old; Bool prepend; if (RegionNar(rgn)) return RegionBreak(dstrgn); if (!rgn->data && (dstrgn->data == &RegionEmptyData)) { dstrgn->extents = rgn->extents; dstrgn->data = NULL; return TRUE; } numRects = RegionNumRects(rgn); if (!numRects) return TRUE; prepend = FALSE; size = numRects; dnumRects = RegionNumRects(dstrgn); if (!dnumRects && (size < 200)) size = 200; /* XXX pick numbers out of a hat */ RECTALLOC(dstrgn, size); old = RegionRects(rgn); if (!dnumRects) dstrgn->extents = rgn->extents; else if (dstrgn->extents.x2 > dstrgn->extents.x1) { BoxPtr first, last; first = old; last = RegionBoxptr(dstrgn) + (dnumRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && (first->x1 > last->x2))) { if (rgn->extents.x1 < dstrgn->extents.x1) dstrgn->extents.x1 = rgn->extents.x1; if (rgn->extents.x2 > dstrgn->extents.x2) dstrgn->extents.x2 = rgn->extents.x2; dstrgn->extents.y2 = rgn->extents.y2; } else { first = RegionBoxptr(dstrgn); last = old + (numRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && (first->x1 > last->x2))) { prepend = TRUE; if (rgn->extents.x1 < dstrgn->extents.x1) dstrgn->extents.x1 = rgn->extents.x1; if (rgn->extents.x2 > dstrgn->extents.x2) dstrgn->extents.x2 = rgn->extents.x2; dstrgn->extents.y1 = rgn->extents.y1; } else dstrgn->extents.x2 = dstrgn->extents.x1; } } if (prepend) { new = RegionBox(dstrgn, numRects); if (dnumRects == 1) *new = *RegionBoxptr(dstrgn); else memmove((char *) new, (char *) RegionBoxptr(dstrgn), dnumRects * sizeof(BoxRec)); new = RegionBoxptr(dstrgn); } else new = RegionBoxptr(dstrgn) + dnumRects; if (numRects == 1) *new = *old; else memmove((char *) new, (char *) old, numRects * sizeof(BoxRec)); dstrgn->data->numRects += numRects; return TRUE; } #define ExchangeRects(a, b) \ { \ BoxRec t; \ t = rects[a]; \ rects[a] = rects[b]; \ rects[b] = t; \ } static void QuickSortRects(BoxRec rects[], int numRects) { int y1; int x1; int i, j; BoxPtr r; /* Always called with numRects > 1 */ do { if (numRects == 2) { if (rects[0].y1 > rects[1].y1 || (rects[0].y1 == rects[1].y1 && rects[0].x1 > rects[1].x1)) ExchangeRects(0, 1); return; } /* Choose partition element, stick in location 0 */ ExchangeRects(0, numRects >> 1); y1 = rects[0].y1; x1 = rects[0].x1; /* Partition array */ i = 0; j = numRects; do { r = &(rects[i]); do { r++; i++; } while (i != numRects && (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1))); r = &(rects[j]); do { r--; j--; } while (y1 < r->y1 || (y1 == r->y1 && x1 < r->x1)); if (i < j) ExchangeRects(i, j); } while (i < j); /* Move partition element back to middle */ ExchangeRects(0, j); /* Recurse */ if (numRects - j - 1 > 1) QuickSortRects(&rects[j + 1], numRects - j - 1); numRects = j; } while (numRects > 1); } /*- *----------------------------------------------------------------------- * RegionValidate -- * * Take a ``region'' which is a non-y-x-banded random collection of * rectangles, and compute a nice region which is the union of all the * rectangles. * * Results: * TRUE if successful. * * Side Effects: * The passed-in ``region'' may be modified. * pOverlap set to TRUE if any retangles overlapped, else FALSE; * * Strategy: * Step 1. Sort the rectangles into ascending order with primary key y1 * and secondary key x1. * * Step 2. Split the rectangles into the minimum number of proper y-x * banded regions. This may require horizontally merging * rectangles, and vertically coalescing bands. With any luck, * this step in an identity tranformation (ala the Box widget), * or a coalescing into 1 box (ala Menus). * * Step 3. Merge the separate regions down to a single region by calling * Union. Maximize the work each Union call does by using * a binary merge. * *----------------------------------------------------------------------- */ Bool RegionValidate(RegionPtr badreg, Bool *pOverlap) { /* Descriptor for regions under construction in Step 2. */ typedef struct { RegionRec reg; int prevBand; int curBand; } RegionInfo; int numRects; /* Original numRects for badreg */ RegionInfo *ri; /* Array of current regions */ int numRI; /* Number of entries used in ri */ int sizeRI; /* Number of entries available in ri */ int i; /* Index into rects */ int j; /* Index into ri */ RegionInfo *rit; /* &ri[j] */ RegionPtr reg; /* ri[j].reg */ BoxPtr box; /* Current box in rects */ BoxPtr riBox; /* Last box in ri[j].reg */ RegionPtr hreg; /* ri[j_half].reg */ Bool ret = TRUE; *pOverlap = FALSE; if (!badreg->data) { good(badreg); return TRUE; } numRects = badreg->data->numRects; if (!numRects) { if (RegionNar(badreg)) return FALSE; good(badreg); return TRUE; } if (badreg->extents.x1 < badreg->extents.x2) { if ((numRects) == 1) { xfreeData(badreg); badreg->data = (RegDataPtr) NULL; } else { DOWNSIZE(badreg, numRects); } good(badreg); return TRUE; } /* Step 1: Sort the rects array into ascending (y1, x1) order */ QuickSortRects(RegionBoxptr(badreg), numRects); /* Step 2: Scatter the sorted array into the minimum number of regions */ /* Set up the first region to be the first rectangle in badreg */ /* Note that step 2 code will never overflow the ri[0].reg rects array */ ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo)); if (!ri) return RegionBreak(badreg); sizeRI = 4; numRI = 1; ri[0].prevBand = 0; ri[0].curBand = 0; ri[0].reg = *badreg; box = RegionBoxptr(&ri[0].reg); ri[0].reg.extents = *box; ri[0].reg.data->numRects = 1; /* Now scatter rectangles into the minimum set of valid regions. If the next rectangle to be added to a region would force an existing rectangle in the region to be split up in order to maintain y-x banding, just forget it. Try the next region. If it doesn't fit cleanly into any region, make a new one. */ for (i = numRects; --i > 0;) { box++; /* Look for a region to append box to */ for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; riBox = RegionEnd(reg); if (box->y1 == riBox->y1 && box->y2 == riBox->y2) { /* box is in same band as riBox. Merge or append it */ if (box->x1 <= riBox->x2) { /* Merge it with riBox */ if (box->x1 < riBox->x2) *pOverlap = TRUE; if (box->x2 > riBox->x2) riBox->x2 = box->x2; } else { RECTALLOC_BAIL(reg, 1, bail); *RegionTop(reg) = *box; reg->data->numRects++; } goto NextRect; /* So sue me */ } else if (box->y1 >= riBox->y2) { /* Put box into new band */ if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; if (reg->extents.x1 > box->x1) reg->extents.x1 = box->x1; Coalesce(reg, rit->prevBand, rit->curBand); rit->curBand = reg->data->numRects; RECTALLOC_BAIL(reg, 1, bail); *RegionTop(reg) = *box; reg->data->numRects++; goto NextRect; } /* Well, this region was inappropriate. Try the next one. */ } /* for j */ /* Uh-oh. No regions were appropriate. Create a new one. */ if (sizeRI == numRI) { /* Oops, allocate space for new region information */ sizeRI <<= 1; rit = (RegionInfo *) realloc(ri, sizeRI * sizeof(RegionInfo)); if (!rit) goto bail; ri = rit; rit = &ri[numRI]; } numRI++; rit->prevBand = 0; rit->curBand = 0; rit->reg.extents = *box; rit->reg.data = NULL; if (!RegionRectAlloc(&rit->reg, (i + numRI) / numRI)) /* MUST force allocation */ goto bail; NextRect:; } /* for i */ /* Make a final pass over each region in order to Coalesce and set extents.x2 and extents.y2 */ for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; riBox = RegionEnd(reg); reg->extents.y2 = riBox->y2; if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; Coalesce(reg, rit->prevBand, rit->curBand); if (reg->data->numRects == 1) { /* keep unions happy below */ xfreeData(reg); reg->data = NULL; } } /* Step 3: Union all regions into a single region */ while (numRI > 1) { int half = numRI / 2; for (j = numRI & 1; j < (half + (numRI & 1)); j++) { reg = &ri[j].reg; hreg = &ri[j + half].reg; if (!RegionOp(reg, reg, hreg, RegionUnionO, TRUE, TRUE, pOverlap)) ret = FALSE; if (hreg->extents.x1 < reg->extents.x1) reg->extents.x1 = hreg->extents.x1; if (hreg->extents.y1 < reg->extents.y1) reg->extents.y1 = hreg->extents.y1; if (hreg->extents.x2 > reg->extents.x2) reg->extents.x2 = hreg->extents.x2; if (hreg->extents.y2 > reg->extents.y2) reg->extents.y2 = hreg->extents.y2; xfreeData(hreg); } numRI -= half; } *badreg = ri[0].reg; free(ri); good(badreg); return ret; bail: for (i = 0; i < numRI; i++) xfreeData(&ri[i].reg); free(ri); return RegionBreak(badreg); } RegionPtr RegionFromRects(int nrects, xRectangle *prect, int ctype) { RegionPtr pRgn; size_t rgnSize; RegDataPtr pData; BoxPtr pBox; int i; int x1, y1, x2, y2; pRgn = RegionCreate(NullBox, 0); if (RegionNar(pRgn)) return pRgn; if (!nrects) return pRgn; if (nrects == 1) { x1 = prect->x; y1 = prect->y; if ((x2 = x1 + (int) prect->width) > MAXSHORT) x2 = MAXSHORT; if ((y2 = y1 + (int) prect->height) > MAXSHORT) y2 = MAXSHORT; if (x1 != x2 && y1 != y2) { pRgn->extents.x1 = x1; pRgn->extents.y1 = y1; pRgn->extents.x2 = x2; pRgn->extents.y2 = y2; pRgn->data = NULL; } return pRgn; } rgnSize = RegionSizeof(nrects); pData = (rgnSize > 0) ? malloc(rgnSize) : NULL; if (!pData) { RegionBreak(pRgn); return pRgn; } pBox = (BoxPtr) (pData + 1); for (i = nrects; --i >= 0; prect++) { x1 = prect->x; y1 = prect->y; if ((x2 = x1 + (int) prect->width) > MAXSHORT) x2 = MAXSHORT; if ((y2 = y1 + (int) prect->height) > MAXSHORT) y2 = MAXSHORT; if (x1 != x2 && y1 != y2) { pBox->x1 = x1; pBox->y1 = y1; pBox->x2 = x2; pBox->y2 = y2; pBox++; } } if (pBox != (BoxPtr) (pData + 1)) { pData->size = nrects; pData->numRects = pBox - (BoxPtr) (pData + 1); pRgn->data = pData; if (ctype != CT_YXBANDED) { Bool overlap; /* result ignored */ pRgn->extents.x1 = pRgn->extents.x2 = 0; RegionValidate(pRgn, &overlap); } else RegionSetExtents(pRgn); good(pRgn); } else { free(pData); } return pRgn; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/cursor.c���������������������������������������������������������������������0000664�0001751�0001751�00000035057�12456571574�013310� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xmd.h> #include "servermd.h" #include "scrnintstr.h" #include "dixstruct.h" #include "cursorstr.h" #include "dixfontstr.h" #include "opaque.h" #include "inputstr.h" #include "xace.h" typedef struct _GlyphShare { FontPtr font; unsigned short sourceChar; unsigned short maskChar; CursorBitsPtr bits; struct _GlyphShare *next; } GlyphShare, *GlyphSharePtr; static GlyphSharePtr sharedGlyphs = (GlyphSharePtr) NULL; DevScreenPrivateKeyRec cursorScreenDevPriv; static CARD32 cursorSerial; static void FreeCursorBits(CursorBitsPtr bits) { if (--bits->refcnt > 0) return; free(bits->source); free(bits->mask); #ifdef ARGB_CURSOR free(bits->argb); #endif dixFiniPrivates(bits, PRIVATE_CURSOR_BITS); if (bits->refcnt == 0) { GlyphSharePtr *prev, this; for (prev = &sharedGlyphs; (this = *prev) && (this->bits != bits); prev = &this->next); if (this) { *prev = this->next; CloseFont(this->font, (Font) 0); free(this); } free(bits); } } /** * To be called indirectly by DeleteResource; must use exactly two args. * * \param value must conform to DeleteType */ int FreeCursor(void *value, XID cid) { int nscr; CursorPtr pCurs = (CursorPtr) value; ScreenPtr pscr; DeviceIntPtr pDev = NULL; /* unused anyway */ UnrefCursor(pCurs); if (CursorRefCount(pCurs) != 0) return Success; BUG_WARN(CursorRefCount(pCurs) < 0); for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { pscr = screenInfo.screens[nscr]; (void) (*pscr->UnrealizeCursor) (pDev, pscr, pCurs); } FreeCursorBits(pCurs->bits); dixFiniPrivates(pCurs, PRIVATE_CURSOR); free(pCurs); return Success; } CursorPtr RefCursor(CursorPtr cursor) { if (cursor) cursor->refcnt++; return cursor; } CursorPtr UnrefCursor(CursorPtr cursor) { if (cursor) cursor->refcnt--; return cursor; } int CursorRefCount(const CursorPtr cursor) { return cursor ? cursor->refcnt : 0; } /* * We check for empty cursors so that we won't have to display them */ static void CheckForEmptyMask(CursorBitsPtr bits) { unsigned char *msk = bits->mask; int n = BitmapBytePad(bits->width) * bits->height; bits->emptyMask = FALSE; while (n--) if (*(msk++) != 0) return; #ifdef ARGB_CURSOR if (bits->argb) { CARD32 *argb = bits->argb; n = bits->width * bits->height; while (n--) if (*argb++ & 0xff000000) return; } #endif bits->emptyMask = TRUE; } /** * realize the cursor for every screen. Do not change the refcnt, this will be * changed when ChangeToCursor actually changes the sprite. * * @return Success if all cursors realize on all screens, BadAlloc if realize * failed for a device on a given screen. */ static int RealizeCursorAllScreens(CursorPtr pCurs) { DeviceIntPtr pDev; ScreenPtr pscr; int nscr; for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { pscr = screenInfo.screens[nscr]; for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { if (!(*pscr->RealizeCursor) (pDev, pscr, pCurs)) { /* Realize failed for device pDev on screen pscr. * We have to assume that for all devices before, realize * worked. We need to rollback all devices so far on the * current screen and then all devices on previous * screens. */ DeviceIntPtr pDevIt = inputInfo.devices; /*dev iterator */ while (pDevIt && pDevIt != pDev) { if (DevHasCursor(pDevIt)) (*pscr->UnrealizeCursor) (pDevIt, pscr, pCurs); pDevIt = pDevIt->next; } while (--nscr >= 0) { pscr = screenInfo.screens[nscr]; /* now unrealize all devices on previous screens */ pDevIt = inputInfo.devices; while (pDevIt) { if (DevHasCursor(pDevIt)) (*pscr->UnrealizeCursor) (pDevIt, pscr, pCurs); pDevIt = pDevIt->next; } (*pscr->UnrealizeCursor) (pDev, pscr, pCurs); } return BadAlloc; } } } } return Success; } /** * does nothing about the resource table, just creates the data structure. * does not copy the src and mask bits * * \param psrcbits server-defined padding * \param pmaskbits server-defined padding * \param argb no padding */ int AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb, CursorMetricPtr cm, unsigned foreRed, unsigned foreGreen, unsigned foreBlue, unsigned backRed, unsigned backGreen, unsigned backBlue, CursorPtr *ppCurs, ClientPtr client, XID cid) { CursorBitsPtr bits; CursorPtr pCurs; int rc; *ppCurs = NULL; pCurs = (CursorPtr) calloc(CURSOR_REC_SIZE + CURSOR_BITS_SIZE, 1); if (!pCurs) return BadAlloc; bits = (CursorBitsPtr) ((char *) pCurs + CURSOR_REC_SIZE); dixInitPrivates(pCurs, pCurs + 1, PRIVATE_CURSOR); dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS) bits->source = psrcbits; bits->mask = pmaskbits; #ifdef ARGB_CURSOR bits->argb = argb; #endif bits->width = cm->width; bits->height = cm->height; bits->xhot = cm->xhot; bits->yhot = cm->yhot; pCurs->refcnt = 1; bits->refcnt = -1; CheckForEmptyMask(bits); pCurs->bits = bits; pCurs->serialNumber = ++cursorSerial; pCurs->name = None; pCurs->foreRed = foreRed; pCurs->foreGreen = foreGreen; pCurs->foreBlue = foreBlue; pCurs->backRed = backRed; pCurs->backGreen = backGreen; pCurs->backBlue = backBlue; pCurs->id = cid; /* security creation/labeling check */ rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCurs, RT_NONE, NULL, DixCreateAccess); if (rc != Success) goto error; rc = RealizeCursorAllScreens(pCurs); if (rc != Success) goto error; *ppCurs = pCurs; return Success; error: FreeCursorBits(bits); dixFiniPrivates(pCurs, PRIVATE_CURSOR); free(pCurs); return rc; } int AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, unsigned foreRed, unsigned foreGreen, unsigned foreBlue, unsigned backRed, unsigned backGreen, unsigned backBlue, CursorPtr *ppCurs, ClientPtr client, XID cid) { FontPtr sourcefont, maskfont; unsigned char *srcbits; unsigned char *mskbits; CursorMetricRec cm; int rc; CursorBitsPtr bits; CursorPtr pCurs; GlyphSharePtr pShare; rc = dixLookupResourceByType((void **) &sourcefont, source, RT_FONT, client, DixUseAccess); if (rc != Success) { client->errorValue = source; return rc; } rc = dixLookupResourceByType((void **) &maskfont, mask, RT_FONT, client, DixUseAccess); if (rc != Success && mask != None) { client->errorValue = mask; return rc; } if (sourcefont != maskfont) pShare = (GlyphSharePtr) NULL; else { for (pShare = sharedGlyphs; pShare && ((pShare->font != sourcefont) || (pShare->sourceChar != sourceChar) || (pShare->maskChar != maskChar)); pShare = pShare->next); } if (pShare) { pCurs = (CursorPtr) calloc(CURSOR_REC_SIZE, 1); if (!pCurs) return BadAlloc; dixInitPrivates(pCurs, pCurs + 1, PRIVATE_CURSOR); bits = pShare->bits; bits->refcnt++; } else { if (!CursorMetricsFromGlyph(sourcefont, sourceChar, &cm)) { client->errorValue = sourceChar; return BadValue; } if (!maskfont) { long n; unsigned char *mskptr; n = BitmapBytePad(cm.width) * (long) cm.height; mskptr = mskbits = malloc(n); if (!mskptr) return BadAlloc; while (--n >= 0) *mskptr++ = ~0; } else { if (!CursorMetricsFromGlyph(maskfont, maskChar, &cm)) { client->errorValue = maskChar; return BadValue; } if ((rc = ServerBitsFromGlyph(maskfont, maskChar, &cm, &mskbits))) return rc; } if ((rc = ServerBitsFromGlyph(sourcefont, sourceChar, &cm, &srcbits))) { free(mskbits); return rc; } if (sourcefont != maskfont) { pCurs = (CursorPtr) calloc(CURSOR_REC_SIZE + CURSOR_BITS_SIZE, 1); if (pCurs) bits = (CursorBitsPtr) ((char *) pCurs + CURSOR_REC_SIZE); else bits = (CursorBitsPtr) NULL; } else { pCurs = (CursorPtr) calloc(CURSOR_REC_SIZE, 1); if (pCurs) bits = (CursorBitsPtr) calloc(CURSOR_BITS_SIZE, 1); else bits = (CursorBitsPtr) NULL; } if (!bits) { free(pCurs); free(mskbits); free(srcbits); return BadAlloc; } dixInitPrivates(pCurs, pCurs + 1, PRIVATE_CURSOR); dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS); bits->source = srcbits; bits->mask = mskbits; #ifdef ARGB_CURSOR bits->argb = 0; #endif bits->width = cm.width; bits->height = cm.height; bits->xhot = cm.xhot; bits->yhot = cm.yhot; if (sourcefont != maskfont) bits->refcnt = -1; else { bits->refcnt = 1; pShare = malloc(sizeof(GlyphShare)); if (!pShare) { FreeCursorBits(bits); return BadAlloc; } pShare->font = sourcefont; sourcefont->refcnt++; pShare->sourceChar = sourceChar; pShare->maskChar = maskChar; pShare->bits = bits; pShare->next = sharedGlyphs; sharedGlyphs = pShare; } } CheckForEmptyMask(bits); pCurs->bits = bits; pCurs->refcnt = 1; pCurs->serialNumber = ++cursorSerial; pCurs->name = None; pCurs->foreRed = foreRed; pCurs->foreGreen = foreGreen; pCurs->foreBlue = foreBlue; pCurs->backRed = backRed; pCurs->backGreen = backGreen; pCurs->backBlue = backBlue; pCurs->id = cid; /* security creation/labeling check */ rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCurs, RT_NONE, NULL, DixCreateAccess); if (rc != Success) goto error; rc = RealizeCursorAllScreens(pCurs); if (rc != Success) goto error; *ppCurs = pCurs; return Success; error: FreeCursorBits(bits); dixFiniPrivates(pCurs, PRIVATE_CURSOR); free(pCurs); return rc; } /** CreateRootCursor * * look up the name of a font * open the font * add the font to the resource table * make a cursor from the glyphs * add the cursor to the resource table *************************************************************/ CursorPtr CreateRootCursor(char *unused1, unsigned int unused2) { CursorPtr curs; FontPtr cursorfont; int err; XID fontID; fontID = FakeClientID(0); err = OpenFont(serverClient, fontID, FontLoadAll | FontOpenSync, (unsigned) strlen(defaultCursorFont), defaultCursorFont); if (err != Success) return NullCursor; err = dixLookupResourceByType((void **) &cursorfont, fontID, RT_FONT, serverClient, DixReadAccess); if (err != Success) return NullCursor; if (AllocGlyphCursor(fontID, 0, fontID, 1, 0, 0, 0, ~0, ~0, ~0, &curs, serverClient, (XID) 0) != Success) return NullCursor; if (!AddResource(FakeClientID(0), RT_CURSOR, (void *) curs)) return NullCursor; return curs; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/dixfonts.c�������������������������������������������������������������������0000664�0001751�0001751�00000175674�12456571574�013643� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************************ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ************************************************************************/ /* The panoramix components contained the following notice */ /* Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xmd.h> #include <X11/Xproto.h> #include "scrnintstr.h" #include "resource.h" #include "dixstruct.h" #include "cursorstr.h" #include "misc.h" #include "opaque.h" #include "dixfontstr.h" #include "closestr.h" #include "dixfont.h" #include "xace.h" #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" #endif extern void *fosNaturalParams; extern FontPtr defaultFont; static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; static int num_fpes = 0; static FPEFunctions *fpe_functions = (FPEFunctions *) 0; static int num_fpe_types = 0; static unsigned char *font_path_string; static int num_slept_fpes = 0; static int size_slept_fpes = 0; static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; static FontPatternCachePtr patternCache; static int FontToXError(int err) { switch (err) { case Successful: return Success; case AllocError: return BadAlloc; case BadFontName: return BadName; case BadFontPath: case BadFontFormat: /* is there something better? */ case BadCharRange: return BadValue; default: return err; } } static int LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) { if (fpe_functions[pfont->fpe->type].load_glyphs) return (*fpe_functions[pfont->fpe->type].load_glyphs) (client, pfont, 0, nchars, item_size, data); else 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 */ Bool SetDefaultFont(const char *defaultfontname) { int err; FontPtr pf; XID fid; fid = FakeClientID(0); err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync, (unsigned) strlen(defaultfontname), defaultfontname); if (err != Success) return FALSE; err = dixLookupResourceByType((void **) &pf, fid, RT_FONT, serverClient, DixReadAccess); if (err != Success) return FALSE; defaultFont = pf; return TRUE; } /* * note that the font wakeup queue is not refcounted. this is because * an fpe needs to be added when it's inited, and removed when it's finally * freed, in order to handle any data that isn't requested, like FS events. * * since the only thing that should call these routines is the renderer's * init_fpe() and free_fpe(), there shouldn't be any problem in using * freed data. */ void QueueFontWakeup(FontPathElementPtr fpe) { int i; FontPathElementPtr *new; for (i = 0; i < num_slept_fpes; i++) { if (slept_fpes[i] == fpe) { return; } } if (num_slept_fpes == size_slept_fpes) { new = (FontPathElementPtr *) realloc(slept_fpes, sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); if (!new) return; slept_fpes = new; size_slept_fpes += 4; } slept_fpes[num_slept_fpes] = fpe; num_slept_fpes++; } void RemoveFontWakeup(FontPathElementPtr fpe) { int i, j; for (i = 0; i < num_slept_fpes; i++) { if (slept_fpes[i] == fpe) { for (j = i; j < num_slept_fpes; j++) { slept_fpes[j] = slept_fpes[j + 1]; } num_slept_fpes--; return; } } } void FontWakeup(void *data, int count, void *LastSelectMask) { int i; FontPathElementPtr fpe; if (count < 0) return; /* wake up any fpe's that may be waiting for information */ for (i = 0; i < num_slept_fpes; i++) { fpe = slept_fpes[i]; (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); } } /* XXX -- these two funcs may want to be broken into macros */ static void UseFPE(FontPathElementPtr fpe) { fpe->refcount++; } static void FreeFPE(FontPathElementPtr fpe) { fpe->refcount--; if (fpe->refcount == 0) { (*fpe_functions[fpe->type].free_fpe) (fpe); free((void *) fpe->name); free(fpe); } } static Bool doOpenFont(ClientPtr client, OFclosurePtr c) { FontPtr pfont = NullFont; FontPathElementPtr fpe = NULL; ScreenPtr pScr; int err = Successful; int i; char *alias, *newname; int newlen; int aliascount = 20; /* * Decide at runtime what FontFormat to use. */ Mask FontFormat = ((screenInfo.imageByteOrder == LSBFirst) ? BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) | ((screenInfo.bitmapBitOrder == LSBFirst) ? BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) | BitmapFormatImageRectMin | #if GLYPHPADBYTES == 1 BitmapFormatScanlinePad8 | #endif #if GLYPHPADBYTES == 2 BitmapFormatScanlinePad16 | #endif #if GLYPHPADBYTES == 4 BitmapFormatScanlinePad32 | #endif #if GLYPHPADBYTES == 8 BitmapFormatScanlinePad64 | #endif BitmapFormatScanlineUnit8; if (client->clientGone) { if (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; } while (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; err = (*fpe_functions[fpe->type].open_font) ((void *) client, fpe, c->flags, c->fontname, c->fnamelen, FontFormat, BitmapFormatMaskByte | BitmapFormatMaskBit | BitmapFormatMaskImageRectangle | BitmapFormatMaskScanLinePad | BitmapFormatMaskScanLineUnit, c->fontid, &pfont, &alias, c->non_cachable_font && c->non_cachable_font->fpe == fpe ? c->non_cachable_font : (FontPtr) 0); if (err == FontNameAlias && alias) { newlen = strlen(alias); newname = (char *) realloc((char *) c->fontname, newlen); if (!newname) { err = AllocError; break; } memmove(newname, alias, newlen); c->fontname = newname; c->fnamelen = newlen; c->current_fpe = 0; if (--aliascount <= 0) { /* We've tried resolving this alias 20 times, we're * probably stuck in an infinite loop of aliases pointing * to each other - time to take emergency exit! */ err = BadImplementation; break; } continue; } if (err == BadFontName) { c->current_fpe++; continue; } if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doOpenFont, c); else goto xinerama_sleep; return TRUE; } break; } if (err != Successful) goto bail; if (!pfont) { err = BadFontName; goto bail; } /* check values for firstCol, lastCol, firstRow, and lastRow */ if (pfont->info.firstCol > pfont->info.lastCol || pfont->info.firstRow > pfont->info.lastRow || pfont->info.lastCol - pfont->info.firstCol > 255) { err = AllocError; goto bail; } if (!pfont->fpe) pfont->fpe = fpe; pfont->refcnt++; if (pfont->refcnt == 1) { UseFPE(pfont->fpe); for (i = 0; i < screenInfo.numScreens; i++) { pScr = screenInfo.screens[i]; if (pScr->RealizeFont) { if (!(*pScr->RealizeFont) (pScr, pfont)) { CloseFont(pfont, (Font) 0); err = AllocError; goto bail; } } } } if (!AddResource(c->fontid, RT_FONT, (void *) pfont)) { err = AllocError; goto bail; } if (patternCache && pfont != c->non_cachable_font) CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, pfont); bail: if (err != Successful && c->client != serverClient) { SendErrorToClient(c->client, X_OpenFont, 0, c->fontid, FontToXError(err)); } ClientWakeup(c->client); xinerama_sleep: for (i = 0; i < c->num_fpes; i++) { FreeFPE(c->fpe_list[i]); } free(c->fpe_list); free((void *) c->fontname); free(c); return TRUE; } int OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, const char *pfontname) { OFclosurePtr c; int i; FontPtr cached = (FontPtr) 0; if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) return BadName; if (patternCache) { /* ** Check name cache. If we find a cached version of this font that ** is cachable, immediately satisfy the request with it. If we find ** a cached version of this font that is non-cachable, we do not ** satisfy the request with it. Instead, we pass the FontPtr to the ** FPE's open_font code (the fontfile FPE in turn passes the ** information to the rasterizer; the fserve FPE ignores it). ** ** Presumably, the font is marked non-cachable because the FPE has ** put some licensing restrictions on it. If the FPE, using ** whatever logic it relies on, determines that it is willing to ** share this existing font with the client, then it has the option ** to return the FontPtr we passed it as the newly-opened font. ** This allows the FPE to exercise its licensing logic without ** having to create another instance of a font that already exists. */ cached = FindCachedFontPattern(patternCache, pfontname, lenfname); if (cached && cached->info.cachable) { if (!AddResource(fid, RT_FONT, (void *) cached)) return BadAlloc; cached->refcnt++; return Success; } } c = malloc(sizeof(OFclosureRec)); if (!c) return BadAlloc; c->fontname = malloc(lenfname); c->origFontName = pfontname; c->origFontNameLen = lenfname; if (!c->fontname) { free(c); return BadAlloc; } /* * copy the current FPE list, so that if it gets changed by another client * while we're blocking, the request still appears atomic */ c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free((void *) c->fontname); free(c); return BadAlloc; } memmove(c->fontname, pfontname, lenfname); for (i = 0; i < num_fpes; i++) { c->fpe_list[i] = font_path_elements[i]; UseFPE(c->fpe_list[i]); } c->client = client; c->fontid = fid; c->current_fpe = 0; c->num_fpes = num_fpes; c->fnamelen = lenfname; c->flags = flags; c->non_cachable_font = cached; (void) doOpenFont(client, c); return Success; } /** * Decrement font's ref count, and free storage if ref count equals zero * * \param value must conform to DeleteType */ int CloseFont(void *value, XID fid) { int nscr; ScreenPtr pscr; FontPathElementPtr fpe; FontPtr pfont = (FontPtr) value; if (pfont == NullFont) return Success; if (--pfont->refcnt == 0) { if (patternCache) RemoveCachedFontPattern(patternCache, pfont); /* * since the last reference is gone, ask each screen to free any * storage it may have allocated locally for it. */ for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { pscr = screenInfo.screens[nscr]; if (pscr->UnrealizeFont) (*pscr->UnrealizeFont) (pscr, pfont); } if (pfont == defaultFont) defaultFont = NULL; #ifdef XF86BIGFONT XF86BigfontFreeFontShm(pfont); #endif fpe = pfont->fpe; (*fpe_functions[fpe->type].close_font) (fpe, pfont); FreeFPE(fpe); } return Success; } /***====================================================================***/ /** * Sets up pReply as the correct QueryFontReply for pFont with the first * nProtoCCIStructs char infos. * * \param pReply caller must allocate this storage */ void QueryFont(FontPtr pFont, xQueryFontReply * pReply, int nProtoCCIStructs) { FontPropPtr pFP; int r, c, i; xFontProp *prFP; xCharInfo *prCI; xCharInfo *charInfos[256]; unsigned char chars[512]; int ninfos; unsigned long ncols; unsigned long count; /* pr->length set in dispatch */ pReply->minCharOrByte2 = pFont->info.firstCol; pReply->defaultChar = pFont->info.defaultCh; pReply->maxCharOrByte2 = pFont->info.lastCol; pReply->drawDirection = pFont->info.drawDirection; pReply->allCharsExist = pFont->info.allExist; pReply->minByte1 = pFont->info.firstRow; pReply->maxByte1 = pFont->info.lastRow; pReply->fontAscent = pFont->info.fontAscent; pReply->fontDescent = pFont->info.fontDescent; pReply->minBounds = pFont->info.ink_minbounds; pReply->maxBounds = pFont->info.ink_maxbounds; pReply->nFontProps = pFont->info.nprops; pReply->nCharInfos = nProtoCCIStructs; for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]); i < pFont->info.nprops; i++, pFP++, prFP++) { prFP->name = pFP->name; prFP->value = pFP->value; } ninfos = 0; ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1); prCI = (xCharInfo *) (prFP); for (r = pFont->info.firstRow; ninfos < nProtoCCIStructs && r <= (int) pFont->info.lastRow; r++) { i = 0; for (c = pFont->info.firstCol; c <= (int) pFont->info.lastCol; c++) { chars[i++] = r; chars[i++] = c; } (*pFont->get_metrics) (pFont, ncols, chars, TwoD16Bit, &count, charInfos); i = 0; for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) { *prCI = *charInfos[i]; prCI++; ninfos++; } } return; } static Bool doListFontsAndAliases(ClientPtr client, LFclosurePtr c) { FontPathElementPtr fpe; int err = Successful; FontNamesPtr names = NULL; char *name, *resolved = NULL; int namelen, resolvedlen; int nnames; int stringLens; int i; xListFontsReply reply; char *bufptr; char *bufferStart; int aliascount = 0; if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; } if (!c->current.patlen) goto finish; while (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; err = Successful; if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) { /* This FPE doesn't support/require list_fonts_and_aliases */ err = (*fpe_functions[fpe->type].list_fonts) ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, c->names); if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); else goto xinerama_sleep; return TRUE; } err = BadFontName; } else { /* Start of list_fonts_and_aliases functionality. Modeled after list_fonts_with_info in that it resolves aliases, except that the information collected from FPEs is just names, not font info. Each list_next_font_or_alias() returns either a name into name/namelen or an alias into name/namelen and its target name into resolved/resolvedlen. The code at this level then resolves the alias by polling the FPEs. */ if (!c->current.list_started) { err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, &c->current.private); if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); else goto xinerama_sleep; return TRUE; } if (err == Successful) c->current.list_started = TRUE; } if (err == Successful) { char *tmpname; name = 0; err = (*fpe_functions[fpe->type].list_next_font_or_alias) ((void *) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); else goto xinerama_sleep; return TRUE; } if (err == FontNameAlias) { free(resolved); resolved = malloc(resolvedlen + 1); if (resolved) memmove(resolved, tmpname, resolvedlen + 1); } } if (err == Successful) { if (c->haveSaved) { if (c->savedName) (void) AddFontNamesName(c->names, c->savedName, c->savedNameLen); } else (void) AddFontNamesName(c->names, name, namelen); } /* * When we get an alias back, save our state and reset back to * the start of the FPE looking for the specified name. As * soon as a real font is found for the alias, pop back to the * old state */ else if (err == FontNameAlias) { char tmp_pattern[XLFDMAXFONTNAMELEN]; /* * when an alias recurses, we need to give * the last FPE a chance to clean up; so we call * it again, and assume that the error returned * is BadFontName, indicating the alias resolution * is complete. */ memmove(tmp_pattern, resolved, resolvedlen); if (c->haveSaved) { char *tmpname; int tmpnamelen; tmpname = 0; (void) (*fpe_functions[fpe->type].list_next_font_or_alias) ((void *) c->client, fpe, &tmpname, &tmpnamelen, &tmpname, &tmpnamelen, c->current.private); if (--aliascount <= 0) { err = BadFontName; goto ContBadFontName; } } else { c->saved = c->current; c->haveSaved = TRUE; free(c->savedName); c->savedName = malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); c->savedNameLen = namelen; aliascount = 20; } memmove(c->current.pattern, tmp_pattern, resolvedlen); c->current.patlen = resolvedlen; c->current.max_names = c->names->nnames + 1; c->current.current_fpe = -1; c->current.private = 0; err = BadFontName; } } /* * At the end of this FPE, step to the next. If we've finished * processing an alias, pop state back. If we've collected enough * font names, quit. */ if (err == BadFontName) { ContBadFontName:; c->current.list_started = FALSE; c->current.current_fpe++; err = Successful; if (c->haveSaved) { if (c->names->nnames == c->current.max_names || c->current.current_fpe == c->num_fpes) { c->haveSaved = FALSE; c->current = c->saved; /* Give the saved namelist a chance to clean itself up */ continue; } } if (c->names->nnames == c->current.max_names) break; } } /* * send the reply */ if (err != Successful) { SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err)); goto bail; } finish: names = c->names; nnames = names->nnames; client = c->client; stringLens = 0; for (i = 0; i < nnames; i++) stringLens += (names->length[i] <= 255) ? names->length[i] : 0; reply = (xListFontsReply) { .type = X_Reply, .length = bytes_to_int32(stringLens + nnames), .nFonts = nnames, .sequenceNumber = client->sequence }; bufptr = bufferStart = malloc(reply.length << 2); if (!bufptr && reply.length) { SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); goto bail; } /* * since WriteToClient long word aligns things, copy to temp buffer and * write all at once */ for (i = 0; i < nnames; i++) { if (names->length[i] > 255) reply.nFonts--; else { *bufptr++ = names->length[i]; memmove(bufptr, names->names[i], names->length[i]); bufptr += names->length[i]; } } nnames = reply.nFonts; reply.length = bytes_to_int32(stringLens + nnames); client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); WriteToClient(client, stringLens + nnames, bufferStart); free(bufferStart); bail: ClientWakeup(client); xinerama_sleep: for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); free(c->fpe_list); free(c->savedName); FreeFontNames(names); free(c); free(resolved); return TRUE; } int ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, unsigned max_names) { int i; LFclosurePtr c; /* * The right error to return here would be BadName, however the * specification does not allow for a Name error on this request. * Perhaps a better solution would be to return a nil list, i.e. * a list containing zero fontnames. */ if (length > XLFDMAXFONTNAMELEN) return BadAlloc; i = XaceHook(XACE_SERVER_ACCESS, client, DixGetAttrAccess); if (i != Success) return i; if (!(c = malloc(sizeof *c))) return BadAlloc; c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); return BadAlloc; } c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); if (!c->names) { free(c->fpe_list); free(c); return BadAlloc; } memmove(c->current.pattern, pattern, length); for (i = 0; i < num_fpes; i++) { c->fpe_list[i] = font_path_elements[i]; UseFPE(c->fpe_list[i]); } c->client = client; c->num_fpes = num_fpes; c->current.patlen = length; c->current.current_fpe = 0; c->current.max_names = max_names; c->current.list_started = FALSE; c->current.private = 0; c->haveSaved = FALSE; c->savedName = 0; doListFontsAndAliases(client, c); return Success; } int doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) { FontPathElementPtr fpe; int err = Successful; char *name; int namelen; int numFonts; FontInfoRec fontInfo, *pFontInfo; xListFontsWithInfoReply *reply; int length; xFontProp *pFP; int i; int aliascount = 0; xListFontsWithInfoReply finalReply; if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; } client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo]; if (!c->current.patlen) goto finish; while (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; err = Successful; if (!c->current.list_started) { err = (*fpe_functions[fpe->type].start_list_fonts_with_info) (client, fpe, c->current.pattern, c->current.patlen, c->current.max_names, &c->current.private); if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsWithInfo, c); else goto xinerama_sleep; return TRUE; } if (err == Successful) c->current.list_started = TRUE; } if (err == Successful) { name = 0; pFontInfo = &fontInfo; err = (*fpe_functions[fpe->type].list_next_font_with_info) (client, fpe, &name, &namelen, &pFontInfo, &numFonts, c->current.private); if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsWithInfo, c); else goto xinerama_sleep; return TRUE; } } /* * When we get an alias back, save our state and reset back to the * start of the FPE looking for the specified name. As soon as a real * font is found for the alias, pop back to the old state */ if (err == FontNameAlias) { /* * when an alias recurses, we need to give * the last FPE a chance to clean up; so we call * it again, and assume that the error returned * is BadFontName, indicating the alias resolution * is complete. */ if (c->haveSaved) { char *tmpname; int tmpnamelen; FontInfoPtr tmpFontInfo; tmpname = 0; tmpFontInfo = &fontInfo; (void) (*fpe_functions[fpe->type].list_next_font_with_info) (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, &numFonts, c->current.private); if (--aliascount <= 0) { err = BadFontName; goto ContBadFontName; } } else { c->saved = c->current; c->haveSaved = TRUE; c->savedNumFonts = numFonts; free(c->savedName); c->savedName = malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); aliascount = 20; } memmove(c->current.pattern, name, namelen); c->current.patlen = namelen; c->current.max_names = 1; c->current.current_fpe = 0; c->current.private = 0; c->current.list_started = FALSE; } /* * At the end of this FPE, step to the next. If we've finished * processing an alias, pop state back. If we've sent enough font * names, quit. Always wait for BadFontName to let the FPE * have a chance to clean up. */ else if (err == BadFontName) { ContBadFontName:; c->current.list_started = FALSE; c->current.current_fpe++; err = Successful; if (c->haveSaved) { if (c->current.max_names == 0 || c->current.current_fpe == c->num_fpes) { c->haveSaved = FALSE; c->saved.max_names -= (1 - c->current.max_names); c->current = c->saved; } } else if (c->current.max_names == 0) break; } else if (err == Successful) { length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp); reply = c->reply; if (c->length < length) { reply = (xListFontsWithInfoReply *) realloc(c->reply, length); if (!reply) { err = AllocError; break; } memset((char *) reply + c->length, 0, length - c->length); c->reply = reply; c->length = length; } if (c->haveSaved) { numFonts = c->savedNumFonts; name = c->savedName; namelen = strlen(name); } reply->type = X_Reply; reply->length = bytes_to_int32(sizeof *reply - sizeof(xGenericReply) + pFontInfo->nprops * sizeof(xFontProp) + namelen); reply->sequenceNumber = client->sequence; reply->nameLength = namelen; reply->minBounds = pFontInfo->ink_minbounds; reply->maxBounds = pFontInfo->ink_maxbounds; reply->minCharOrByte2 = pFontInfo->firstCol; reply->maxCharOrByte2 = pFontInfo->lastCol; reply->defaultChar = pFontInfo->defaultCh; reply->nFontProps = pFontInfo->nprops; reply->drawDirection = pFontInfo->drawDirection; reply->minByte1 = pFontInfo->firstRow; reply->maxByte1 = pFontInfo->lastRow; reply->allCharsExist = pFontInfo->allExist; reply->fontAscent = pFontInfo->fontAscent; reply->fontDescent = pFontInfo->fontDescent; reply->nReplies = numFonts; pFP = (xFontProp *) (reply + 1); for (i = 0; i < pFontInfo->nprops; i++) { pFP->name = pFontInfo->props[i].name; pFP->value = pFontInfo->props[i].value; pFP++; } WriteSwappedDataToClient(client, length, reply); WriteToClient(client, namelen, name); if (pFontInfo == &fontInfo) { free(fontInfo.props); free(fontInfo.isStringProp); } --c->current.max_names; } } finish: length = sizeof(xListFontsWithInfoReply); finalReply = (xListFontsWithInfoReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = bytes_to_int32(sizeof(xListFontsWithInfoReply) - sizeof(xGenericReply)) }; WriteSwappedDataToClient(client, length, &finalReply); bail: ClientWakeup(client); xinerama_sleep: for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); free(c->reply); free(c->fpe_list); free(c->savedName); free(c); return TRUE; } int StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, int max_names) { int i; LFWIclosurePtr c; /* * The right error to return here would be BadName, however the * specification does not allow for a Name error on this request. * Perhaps a better solution would be to return a nil list, i.e. * a list containing zero fontnames. */ if (length > XLFDMAXFONTNAMELEN) return BadAlloc; i = XaceHook(XACE_SERVER_ACCESS, client, DixGetAttrAccess); if (i != Success) return i; if (!(c = malloc(sizeof *c))) goto badAlloc; c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); goto badAlloc; } memmove(c->current.pattern, pattern, length); for (i = 0; i < num_fpes; i++) { c->fpe_list[i] = font_path_elements[i]; UseFPE(c->fpe_list[i]); } c->client = client; c->num_fpes = num_fpes; c->reply = 0; c->length = 0; c->current.patlen = length; c->current.current_fpe = 0; c->current.max_names = max_names; c->current.list_started = FALSE; c->current.private = 0; c->savedNumFonts = 0; c->haveSaved = FALSE; c->savedName = 0; doListFontsWithInfo(client, c); return Success; badAlloc: return BadAlloc; } #define TextEltHeader 2 #define FontShiftSize 5 static ChangeGCVal clearGC[] = { {.ptr = NullPixmap} }; #define clearGCmask (GCClipMask) int doPolyText(ClientPtr client, PTclosurePtr c) { FontPtr pFont = c->pGC->font, oldpFont; int err = Success, lgerr; /* err is in X error, not font error, space */ enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; FontPathElementPtr fpe; GC *origGC = NULL; int itemSize = c->reqType == X_PolyText8 ? 1 : 2; if (client->clientGone) { fpe = c->pGC->font->fpe; (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); if (ClientIsAsleep(client)) { /* Client has died, but we cannot bail out right now. We need to clean up after the work we did when going to sleep. Setting the drawable poiner to 0 makes this happen without any attempts to render or perform other unnecessary activities. */ c->pDraw = (DrawablePtr) 0; } else { err = Success; goto bail; } } /* Make sure our drawable hasn't disappeared while we slept. */ if (ClientIsAsleep(client) && c->pDraw) { DrawablePtr pDraw; dixLookupDrawable(&pDraw, c->did, client, 0, DixWriteAccess); if (c->pDraw != pDraw) { /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client and avoid further rendering while we clean up after ourself. */ fpe = c->pGC->font->fpe; (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); c->pDraw = (DrawablePtr) 0; } } client_state = ClientIsAsleep(client) ? SLEEPING : NEVER_SLEPT; while (c->endReq - c->pElt > TextEltHeader) { if (*c->pElt == FontChange) { Font fid; if (c->endReq - c->pElt < FontShiftSize) { err = BadLength; goto bail; } oldpFont = pFont; fid = ((Font) *(c->pElt + 4)) /* big-endian */ |((Font) *(c->pElt + 3)) << 8 | ((Font) *(c->pElt + 2)) << 16 | ((Font) *(c->pElt + 1)) << 24; err = dixLookupResourceByType((void **) &pFont, fid, RT_FONT, client, DixUseAccess); if (err != Success) { /* restore pFont for step 4 (described below) */ pFont = oldpFont; /* If we're in START_SLEEP mode, the following step shortens the request... in the unlikely event that the fid somehow becomes valid before we come through again to actually execute the polytext, which would then mess up our refcounting scheme badly. */ c->err = err; c->endReq = c->pElt; goto bail; } /* Step 3 (described below) on our new font */ if (client_state == START_SLEEP) pFont->refcnt++; else { if (pFont != c->pGC->font && c->pDraw) { ChangeGCVal val; val.ptr = pFont; ChangeGC(NullClient, c->pGC, GCFont, &val); ValidateGC(c->pDraw, c->pGC); } /* Undo the refcnt++ we performed when going to sleep */ if (client_state == SLEEPING) (void) CloseFont(c->pGC->font, (Font) 0); } c->pElt += FontShiftSize; } else { /* print a string */ unsigned char *pNextElt; pNextElt = c->pElt + TextEltHeader + (*c->pElt) * itemSize; if (pNextElt > c->endReq) { err = BadLength; goto bail; } if (client_state == START_SLEEP) { c->pElt = pNextElt; continue; } if (c->pDraw) { lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, itemSize, c->pElt + TextEltHeader); } else lgerr = Successful; if (lgerr == Suspended) { if (!ClientIsAsleep(client)) { int len; GC *pGC; PTclosurePtr new_closure; /* We're putting the client to sleep. We need to do a few things to ensure successful and atomic-appearing execution of the remainder of the request. First, copy the remainder of the request into a safe malloc'd area. Second, create a scratch GC to use for the remainder of the request. Third, mark all fonts referenced in the remainder of the request to prevent their deallocation. Fourth, make the original GC look like the request has completed... set its font to the final font value from this request. These GC manipulations are for the unlikely (but possible) event that some other client is using the GC. Steps 3 and 4 are performed by running this procedure through the remainder of the request in a special no-render mode indicated by client_state = START_SLEEP. */ /* Step 1 */ /* Allocate a malloc'd closure structure to replace the local one we were passed */ new_closure = malloc(sizeof(PTclosureRec)); if (!new_closure) { err = BadAlloc; goto bail; } *new_closure = *c; len = new_closure->endReq - new_closure->pElt; new_closure->data = malloc(len); if (!new_closure->data) { free(new_closure); err = BadAlloc; goto bail; } memmove(new_closure->data, new_closure->pElt, len); new_closure->pElt = new_closure->data; new_closure->endReq = new_closure->pElt + len; /* Step 2 */ pGC = GetScratchGC(new_closure->pGC->depth, new_closure->pGC->pScreen); if (!pGC) { free(new_closure->data); free(new_closure); err = BadAlloc; goto bail; } if ((err = CopyGC(new_closure->pGC, pGC, GCFunction | GCPlaneMask | GCForeground | GCBackground | GCFillStyle | GCTile | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin | GCFont | GCSubwindowMode | GCClipXOrigin | GCClipYOrigin | GCClipMask)) != Success) { FreeScratchGC(pGC); free(new_closure->data); free(new_closure); err = BadAlloc; goto bail; } c = new_closure; origGC = c->pGC; c->pGC = pGC; ValidateGC(c->pDraw, c->pGC); ClientSleep(client, (ClientSleepProcPtr) doPolyText, c); /* Set up to perform steps 3 and 4 */ client_state = START_SLEEP; continue; /* on to steps 3 and 4 */ } else goto xinerama_sleep; return TRUE; } else if (lgerr != Successful) { err = FontToXError(lgerr); goto bail; } if (c->pDraw) { c->xorg += *((INT8 *) (c->pElt + 1)); /* must be signed */ if (c->reqType == X_PolyText8) c->xorg = (*c->pGC->ops->PolyText8) (c->pDraw, c->pGC, c->xorg, c->yorg, *c->pElt, (char *) (c->pElt + TextEltHeader)); else c->xorg = (*c->pGC->ops->PolyText16) (c->pDraw, c->pGC, c->xorg, c->yorg, *c->pElt, (unsigned short *) (c-> pElt + TextEltHeader)); } c->pElt = pNextElt; } } bail: if (client_state == START_SLEEP) { /* Step 4 */ if (pFont != origGC->font) { ChangeGCVal val; val.ptr = pFont; ChangeGC(NullClient, origGC, GCFont, &val); ValidateGC(c->pDraw, origGC); } /* restore pElt pointer for execution of remainder of the request */ c->pElt = c->data; return TRUE; } if (c->err != Success) err = c->err; if (err != Success && c->client != serverClient) { #ifdef PANORAMIX if (noPanoramiXExtension || !c->pGC->pScreen->myNum) #endif SendErrorToClient(c->client, c->reqType, 0, 0, err); } if (ClientIsAsleep(client)) { ClientWakeup(c->client); xinerama_sleep: ChangeGC(NullClient, c->pGC, clearGCmask, clearGC); /* Unreference the font from the scratch GC */ CloseFont(c->pGC->font, (Font) 0); c->pGC->font = NullFont; FreeScratchGC(c->pGC); free(c->data); free(c); } return TRUE; } int PolyText(ClientPtr client, DrawablePtr pDraw, GC * pGC, unsigned char *pElt, unsigned char *endReq, int xorg, int yorg, int reqType, XID did) { PTclosureRec local_closure; local_closure.pElt = pElt; local_closure.endReq = endReq; local_closure.client = client; local_closure.pDraw = pDraw; local_closure.xorg = xorg; local_closure.yorg = yorg; local_closure.reqType = reqType; local_closure.pGC = pGC; local_closure.did = did; local_closure.err = Success; (void) doPolyText(client, &local_closure); return Success; } #undef TextEltHeader #undef FontShiftSize int doImageText(ClientPtr client, ITclosurePtr c) { int err = Success, lgerr; /* err is in X error, not font error, space */ FontPathElementPtr fpe; int itemSize = c->reqType == X_ImageText8 ? 1 : 2; if (client->clientGone) { fpe = c->pGC->font->fpe; (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } /* Make sure our drawable hasn't disappeared while we slept. */ if (ClientIsAsleep(client) && c->pDraw) { DrawablePtr pDraw; dixLookupDrawable(&pDraw, c->did, client, 0, DixWriteAccess); if (c->pDraw != pDraw) { /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ fpe = c->pGC->font->fpe; (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } } lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, itemSize, c->data); if (lgerr == Suspended) { if (!ClientIsAsleep(client)) { GC *pGC; unsigned char *data; ITclosurePtr new_closure; ITclosurePtr old_closure; /* We're putting the client to sleep. We need to save some state. Similar problem to that handled in doPolyText, but much simpler because the request structure is much simpler. */ new_closure = malloc(sizeof(ITclosureRec)); if (!new_closure) { err = BadAlloc; goto bail; } old_closure = c; *new_closure = *c; c = new_closure; data = malloc(c->nChars * itemSize); if (!data) { free(c); c = old_closure; err = BadAlloc; goto bail; } memmove(data, c->data, c->nChars * itemSize); c->data = data; pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); if (!pGC) { free(c->data); free(c); c = old_closure; err = BadAlloc; goto bail; } if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask | GCForeground | GCBackground | GCFillStyle | GCTile | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin | GCFont | GCSubwindowMode | GCClipXOrigin | GCClipYOrigin | GCClipMask)) != Success) { FreeScratchGC(pGC); free(c->data); free(c); c = old_closure; err = BadAlloc; goto bail; } c->pGC = pGC; ValidateGC(c->pDraw, c->pGC); ClientSleep(client, (ClientSleepProcPtr) doImageText, c); } else goto xinerama_sleep; return TRUE; } else if (lgerr != Successful) { err = FontToXError(lgerr); goto bail; } if (c->pDraw) { if (c->reqType == X_ImageText8) (*c->pGC->ops->ImageText8) (c->pDraw, c->pGC, c->xorg, c->yorg, c->nChars, (char *) c->data); else (*c->pGC->ops->ImageText16) (c->pDraw, c->pGC, c->xorg, c->yorg, c->nChars, (unsigned short *) c->data); } bail: if (err != Success && c->client != serverClient) { SendErrorToClient(c->client, c->reqType, 0, 0, err); } if (ClientIsAsleep(client)) { ClientWakeup(c->client); xinerama_sleep: ChangeGC(NullClient, c->pGC, clearGCmask, clearGC); /* Unreference the font from the scratch GC */ CloseFont(c->pGC->font, (Font) 0); c->pGC->font = NullFont; FreeScratchGC(c->pGC); free(c->data); free(c); } return TRUE; } int ImageText(ClientPtr client, DrawablePtr pDraw, GC * pGC, int nChars, unsigned char *data, int xorg, int yorg, int reqType, XID did) { ITclosureRec local_closure; local_closure.client = client; local_closure.pDraw = pDraw; local_closure.pGC = pGC; local_closure.nChars = nChars; local_closure.data = data; local_closure.xorg = xorg; local_closure.yorg = yorg; local_closure.reqType = reqType; local_closure.did = did; (void) doImageText(client, &local_closure); return Success; } /* does the necessary magic to figure out the fpe type */ static int DetermineFPEType(const char *pathname) { int i; for (i = 0; i < num_fpe_types; i++) { if ((*fpe_functions[i].name_check) (pathname)) return i; } return -1; } static void FreeFontPath(FontPathElementPtr * list, int n, Bool force) { int i; for (i = 0; i < n; i++) { if (force) { /* Sanity check that all refcounts will be 0 by the time we get to the end of the list. */ int found = 1; /* the first reference is us */ int j; for (j = i + 1; j < n; j++) { if (list[j] == list[i]) found++; } if (list[i]->refcount != found) { list[i]->refcount = found; /* ensure it will get freed */ } } FreeFPE(list[i]); } free(list); } static FontPathElementPtr find_existing_fpe(FontPathElementPtr * list, int num, unsigned char *name, int len) { FontPathElementPtr fpe; int i; for (i = 0; i < num; i++) { fpe = list[i]; if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0) return fpe; } return (FontPathElementPtr) 0; } static int SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) { int i, err = 0; int valid_paths = 0; unsigned int len; unsigned char *cp = paths; FontPathElementPtr fpe = NULL, *fplist; fplist = malloc(sizeof(FontPathElementPtr) * npaths); if (!fplist) { *bad = 0; return BadAlloc; } for (i = 0; i < num_fpe_types; i++) { if (fpe_functions[i].set_path_hook) (*fpe_functions[i].set_path_hook) (); } for (i = 0; i < npaths; i++) { len = (unsigned int) (*cp++); if (len == 0) { if (persist) ErrorF ("[dix] Removing empty element from the valid list of fontpaths\n"); err = BadValue; } else { /* if it's already in our active list, just reset it */ /* * note that this can miss FPE's in limbo -- may be worth catching * them, though it'd muck up refcounting */ fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); if (fpe) { err = (*fpe_functions[fpe->type].reset_fpe) (fpe); if (err == Successful) { UseFPE(fpe); /* since it'll be decref'd later when freed * from the old list */ } else fpe = 0; } /* if error or can't do it, act like it's a new one */ if (!fpe) { char *name; fpe = malloc(sizeof(FontPathElementRec)); if (!fpe) { err = BadAlloc; goto bail; } name = malloc(len + 1); if (!name) { free(fpe); err = BadAlloc; goto bail; } fpe->refcount = 1; strncpy(name, (char *) cp, (int) len); name[len] = '\0'; fpe->name = name; fpe->name_length = len; fpe->type = DetermineFPEType(fpe->name); if (fpe->type == -1) err = BadValue; else err = (*fpe_functions[fpe->type].init_fpe) (fpe); if (err != Successful) { if (persist) { DebugF ("[dix] Could not init font path element %s, removing from list!\n", fpe->name); } free((void *) fpe->name); free(fpe); } } } if (err != Successful) { if (!persist) goto bail; } else { fplist[valid_paths++] = fpe; } cp += len; } FreeFontPath(font_path_elements, num_fpes, FALSE); font_path_elements = fplist; if (patternCache) EmptyFontPatternCache(patternCache); num_fpes = valid_paths; return Success; bail: *bad = i; while (--valid_paths >= 0) FreeFPE(fplist[valid_paths]); free(fplist); return FontToXError(err); } int SetFontPath(ClientPtr client, int npaths, unsigned char *paths) { int err = XaceHook(XACE_SERVER_ACCESS, client, DixManageAccess); if (err != Success) return err; if (npaths == 0) { if (SetDefaultFontPath(defaultFontPath) != Success) return BadValue; } else { int bad; err = SetFontPathElements(npaths, paths, &bad, FALSE); client->errorValue = bad; } return err; } int SetDefaultFontPath(const char *path) { const char *start, *end; char *temp_path; unsigned char *cp, *pp, *nump, *newpath; int num = 1, len, err, size = 0, bad; /* ensure temp_path contains "built-ins" */ start = path; while (1) { start = strstr(start, "built-ins"); if (start == NULL) break; end = start + strlen("built-ins"); if ((start == path || start[-1] == ',') && (!*end || *end == ',')) break; start = end; } if (!start) { if (asprintf(&temp_path, "%s%sbuilt-ins", path, *path ? "," : "") == -1) temp_path = NULL; } else { temp_path = strdup(path); } if (!temp_path) return BadAlloc; /* get enough for string, plus values -- use up commas */ len = strlen(temp_path) + 1; nump = cp = newpath = malloc(len); if (!newpath) { free(temp_path); return BadAlloc; } pp = (unsigned char *) temp_path; cp++; while (*pp) { if (*pp == ',') { *nump = (unsigned char) size; nump = cp++; pp++; num++; size = 0; } else { *cp++ = *pp++; size++; } } *nump = (unsigned char) size; err = SetFontPathElements(num, newpath, &bad, TRUE); free(newpath); free(temp_path); return err; } int GetFontPath(ClientPtr client, int *count, int *length, unsigned char **result) { int i; unsigned char *c; int len; FontPathElementPtr fpe; i = XaceHook(XACE_SERVER_ACCESS, client, DixGetAttrAccess); if (i != Success) return i; len = 0; for (i = 0; i < num_fpes; i++) { fpe = font_path_elements[i]; len += fpe->name_length + 1; } c = realloc(font_path_string, len); if (c == NULL) { free(font_path_string); font_path_string = NULL; return BadAlloc; } font_path_string = c; *length = 0; for (i = 0; i < num_fpes; i++) { fpe = font_path_elements[i]; *c = fpe->name_length; *length += *c++; memmove(c, fpe->name, fpe->name_length); c += fpe->name_length; } *count = num_fpes; *result = font_path_string; return Success; } void DeleteClientFontStuff(ClientPtr client) { int i; FontPathElementPtr fpe; for (i = 0; i < num_fpes; i++) { fpe = font_path_elements[i]; if (fpe_functions[fpe->type].client_died) (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } } void InitFonts(void) { patternCache = MakeFontPatternCache(); register_fpe_functions(); } _X_EXPORT int GetDefaultPointSize(void) { return 120; } _X_EXPORT FontResolutionPtr GetClientResolutions(int *num) { static struct _FontResolution res; ScreenPtr pScreen; pScreen = screenInfo.screens[0]; res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; /* * XXX - we'll want this as long as bitmap instances are prevalent so that we can match them from scalable fonts */ if (res.x_resolution < 88) res.x_resolution = 75; else res.x_resolution = 100; res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight; if (res.y_resolution < 88) res.y_resolution = 75; else res.y_resolution = 100; res.point_size = 120; *num = 1; return &res; } /* * returns the type index of the new fpe * * should be called (only once!) by each type of fpe when initialized */ _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) { FPEFunctions *new; /* grow the list */ new = (FPEFunctions *) realloc(fpe_functions, (num_fpe_types + 1) * sizeof(FPEFunctions)); if (!new) return -1; fpe_functions = new; fpe_functions[num_fpe_types].name_check = name_func; fpe_functions[num_fpe_types].open_font = open_func; fpe_functions[num_fpe_types].close_font = close_func; fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; fpe_functions[num_fpe_types].list_fonts = list_func; fpe_functions[num_fpe_types].start_list_fonts_with_info = start_lfwi_func; fpe_functions[num_fpe_types].list_next_font_with_info = next_lfwi_func; fpe_functions[num_fpe_types].init_fpe = init_func; fpe_functions[num_fpe_types].free_fpe = free_func; fpe_functions[num_fpe_types].reset_fpe = reset_func; fpe_functions[num_fpe_types].client_died = client_died; fpe_functions[num_fpe_types].load_glyphs = load_glyphs; fpe_functions[num_fpe_types].start_list_fonts_and_aliases = start_list_alias_func; fpe_functions[num_fpe_types].list_next_font_or_alias = next_list_alias_func; fpe_functions[num_fpe_types].set_path_hook = set_path_func; return num_fpe_types++; } void FreeFonts(void) { if (patternCache) { FreeFontPatternCache(patternCache); patternCache = 0; } FreeFontPath(font_path_elements, num_fpes, TRUE); font_path_elements = 0; num_fpes = 0; free(fpe_functions); num_fpe_types = 0; fpe_functions = (FPEFunctions *) 0; } /* convenience functions for FS interface */ FontPtr find_old_font(XID id) { void *pFont; dixLookupResourceByType(&pFont, id, RT_NONE, serverClient, DixReadAccess); return (FontPtr) pFont; } _X_EXPORT Font GetNewFontClientID(void) { return FakeClientID(0); } _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id) { return AddResource(id, RT_NONE, (void *) pfont); } _X_EXPORT void DeleteFontClientID(Font id) { FreeResource(id, RT_NONE); } _X_EXPORT int client_auth_generation(ClientPtr client) { return 0; } static int fs_handlers_installed = 0; static unsigned int last_server_gen; _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) { /* if server has reset, make sure the b&w handlers are reinstalled */ if (last_server_gen < serverGeneration) { last_server_gen = serverGeneration; fs_handlers_installed = 0; } if (fs_handlers_installed == 0) { if (!RegisterBlockAndWakeupHandlers(block_handler, FontWakeup, (void *) 0)) return AllocError; fs_handlers_installed++; } QueueFontWakeup(fpe); return Successful; } _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bool all) { if (all) { /* remove the handlers if no one else is using them */ if (--fs_handlers_installed == 0) { RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, (void *) 0); } } RemoveFontWakeup(fpe); } ��������������������������������������������������������������������xorg-server-1.17.1/dix/initatoms.c������������������������������������������������������������������0000664�0001751�0001751�00000012612�12274325511�013754� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* THIS IS A GENERATED FILE * * Do not change! Changing this file implies a protocol change! */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xatom.h> #include "misc.h" #include "dix.h" void MakePredeclaredAtoms(void) { if (MakeAtom("PRIMARY", 7, 1) != XA_PRIMARY) AtomError(); if (MakeAtom("SECONDARY", 9, 1) != XA_SECONDARY) AtomError(); if (MakeAtom("ARC", 3, 1) != XA_ARC) AtomError(); if (MakeAtom("ATOM", 4, 1) != XA_ATOM) AtomError(); if (MakeAtom("BITMAP", 6, 1) != XA_BITMAP) AtomError(); if (MakeAtom("CARDINAL", 8, 1) != XA_CARDINAL) AtomError(); if (MakeAtom("COLORMAP", 8, 1) != XA_COLORMAP) AtomError(); if (MakeAtom("CURSOR", 6, 1) != XA_CURSOR) AtomError(); if (MakeAtom("CUT_BUFFER0", 11, 1) != XA_CUT_BUFFER0) AtomError(); if (MakeAtom("CUT_BUFFER1", 11, 1) != XA_CUT_BUFFER1) AtomError(); if (MakeAtom("CUT_BUFFER2", 11, 1) != XA_CUT_BUFFER2) AtomError(); if (MakeAtom("CUT_BUFFER3", 11, 1) != XA_CUT_BUFFER3) AtomError(); if (MakeAtom("CUT_BUFFER4", 11, 1) != XA_CUT_BUFFER4) AtomError(); if (MakeAtom("CUT_BUFFER5", 11, 1) != XA_CUT_BUFFER5) AtomError(); if (MakeAtom("CUT_BUFFER6", 11, 1) != XA_CUT_BUFFER6) AtomError(); if (MakeAtom("CUT_BUFFER7", 11, 1) != XA_CUT_BUFFER7) AtomError(); if (MakeAtom("DRAWABLE", 8, 1) != XA_DRAWABLE) AtomError(); if (MakeAtom("FONT", 4, 1) != XA_FONT) AtomError(); if (MakeAtom("INTEGER", 7, 1) != XA_INTEGER) AtomError(); if (MakeAtom("PIXMAP", 6, 1) != XA_PIXMAP) AtomError(); if (MakeAtom("POINT", 5, 1) != XA_POINT) AtomError(); if (MakeAtom("RECTANGLE", 9, 1) != XA_RECTANGLE) AtomError(); if (MakeAtom("RESOURCE_MANAGER", 16, 1) != XA_RESOURCE_MANAGER) AtomError(); if (MakeAtom("RGB_COLOR_MAP", 13, 1) != XA_RGB_COLOR_MAP) AtomError(); if (MakeAtom("RGB_BEST_MAP", 12, 1) != XA_RGB_BEST_MAP) AtomError(); if (MakeAtom("RGB_BLUE_MAP", 12, 1) != XA_RGB_BLUE_MAP) AtomError(); if (MakeAtom("RGB_DEFAULT_MAP", 15, 1) != XA_RGB_DEFAULT_MAP) AtomError(); if (MakeAtom("RGB_GRAY_MAP", 12, 1) != XA_RGB_GRAY_MAP) AtomError(); if (MakeAtom("RGB_GREEN_MAP", 13, 1) != XA_RGB_GREEN_MAP) AtomError(); if (MakeAtom("RGB_RED_MAP", 11, 1) != XA_RGB_RED_MAP) AtomError(); if (MakeAtom("STRING", 6, 1) != XA_STRING) AtomError(); if (MakeAtom("VISUALID", 8, 1) != XA_VISUALID) AtomError(); if (MakeAtom("WINDOW", 6, 1) != XA_WINDOW) AtomError(); if (MakeAtom("WM_COMMAND", 10, 1) != XA_WM_COMMAND) AtomError(); if (MakeAtom("WM_HINTS", 8, 1) != XA_WM_HINTS) AtomError(); if (MakeAtom("WM_CLIENT_MACHINE", 17, 1) != XA_WM_CLIENT_MACHINE) AtomError(); if (MakeAtom("WM_ICON_NAME", 12, 1) != XA_WM_ICON_NAME) AtomError(); if (MakeAtom("WM_ICON_SIZE", 12, 1) != XA_WM_ICON_SIZE) AtomError(); if (MakeAtom("WM_NAME", 7, 1) != XA_WM_NAME) AtomError(); if (MakeAtom("WM_NORMAL_HINTS", 15, 1) != XA_WM_NORMAL_HINTS) AtomError(); if (MakeAtom("WM_SIZE_HINTS", 13, 1) != XA_WM_SIZE_HINTS) AtomError(); if (MakeAtom("WM_ZOOM_HINTS", 13, 1) != XA_WM_ZOOM_HINTS) AtomError(); if (MakeAtom("MIN_SPACE", 9, 1) != XA_MIN_SPACE) AtomError(); if (MakeAtom("NORM_SPACE", 10, 1) != XA_NORM_SPACE) AtomError(); if (MakeAtom("MAX_SPACE", 9, 1) != XA_MAX_SPACE) AtomError(); if (MakeAtom("END_SPACE", 9, 1) != XA_END_SPACE) AtomError(); if (MakeAtom("SUPERSCRIPT_X", 13, 1) != XA_SUPERSCRIPT_X) AtomError(); if (MakeAtom("SUPERSCRIPT_Y", 13, 1) != XA_SUPERSCRIPT_Y) AtomError(); if (MakeAtom("SUBSCRIPT_X", 11, 1) != XA_SUBSCRIPT_X) AtomError(); if (MakeAtom("SUBSCRIPT_Y", 11, 1) != XA_SUBSCRIPT_Y) AtomError(); if (MakeAtom("UNDERLINE_POSITION", 18, 1) != XA_UNDERLINE_POSITION) AtomError(); if (MakeAtom("UNDERLINE_THICKNESS", 19, 1) != XA_UNDERLINE_THICKNESS) AtomError(); if (MakeAtom("STRIKEOUT_ASCENT", 16, 1) != XA_STRIKEOUT_ASCENT) AtomError(); if (MakeAtom("STRIKEOUT_DESCENT", 17, 1) != XA_STRIKEOUT_DESCENT) AtomError(); if (MakeAtom("ITALIC_ANGLE", 12, 1) != XA_ITALIC_ANGLE) AtomError(); if (MakeAtom("X_HEIGHT", 8, 1) != XA_X_HEIGHT) AtomError(); if (MakeAtom("QUAD_WIDTH", 10, 1) != XA_QUAD_WIDTH) AtomError(); if (MakeAtom("WEIGHT", 6, 1) != XA_WEIGHT) AtomError(); if (MakeAtom("POINT_SIZE", 10, 1) != XA_POINT_SIZE) AtomError(); if (MakeAtom("RESOLUTION", 10, 1) != XA_RESOLUTION) AtomError(); if (MakeAtom("COPYRIGHT", 9, 1) != XA_COPYRIGHT) AtomError(); if (MakeAtom("NOTICE", 6, 1) != XA_NOTICE) AtomError(); if (MakeAtom("FONT_NAME", 9, 1) != XA_FONT_NAME) AtomError(); if (MakeAtom("FAMILY_NAME", 11, 1) != XA_FAMILY_NAME) AtomError(); if (MakeAtom("FULL_NAME", 9, 1) != XA_FULL_NAME) AtomError(); if (MakeAtom("CAP_HEIGHT", 10, 1) != XA_CAP_HEIGHT) AtomError(); if (MakeAtom("WM_CLASS", 8, 1) != XA_WM_CLASS) AtomError(); if (MakeAtom("WM_TRANSIENT_FOR", 16, 1) != XA_WM_TRANSIENT_FOR) AtomError(); } ����������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/privates.c�������������������������������������������������������������������0000664�0001751�0001751�00000054054�12316443615�013613� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * Copyright © 2010, Keith Packard * Copyright © 2010, Jamey Sharp * * 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. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stddef.h> #include "windowstr.h" #include "resource.h" #include "privates.h" #include "gcstruct.h" #include "cursorstr.h" #include "colormapst.h" #include "inputstr.h" #include "scrnintstr.h" #include "extnsionst.h" #include "inputstr.h" static DevPrivateSetRec global_keys[PRIVATE_LAST]; static const Bool xselinux_private[PRIVATE_LAST] = { [PRIVATE_SCREEN] = TRUE, [PRIVATE_CLIENT] = TRUE, [PRIVATE_WINDOW] = TRUE, [PRIVATE_PIXMAP] = TRUE, [PRIVATE_GC] = TRUE, [PRIVATE_CURSOR] = TRUE, [PRIVATE_COLORMAP] = TRUE, [PRIVATE_DEVICE] = TRUE, [PRIVATE_EXTENSION] = TRUE, [PRIVATE_SELECTION] = TRUE, [PRIVATE_PROPERTY] = TRUE, [PRIVATE_PICTURE] = TRUE, [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_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) { void *new_privates; new_privates = realloc(*privates, old_offset + bytes); if (!new_privates) return FALSE; memset((char *) new_privates + old_offset, '\0', bytes); *privates = new_privates; return TRUE; } static Bool dixMovePrivates(PrivatePtr *privates, int new_offset, unsigned bytes) { memmove((char *) *privates + bytes, *privates, new_offset - bytes); memset(*privates, '\0', 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 (!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; } static Bool fixupServerClient(FixupFunc fixup, unsigned bytes) { if (serverClient) return fixup(&serverClient->devPrivates, global_keys[PRIVATE_CLIENT].offset, bytes); return TRUE; } static Bool fixupExtensions(FixupFunc fixup, unsigned bytes) { unsigned char major; ExtensionEntry *extension; for (major = EXTENSION_BASE; (extension = GetExtensionEntry(major)); major++) if (!fixup (&extension->devPrivates, global_keys[PRIVATE_EXTENSION].offset, bytes)) return FALSE; return TRUE; } static Bool fixupDefaultColormaps(FixupFunc fixup, unsigned bytes) { int s; for (s = 0; s < screenInfo.numScreens; s++) { ColormapPtr cmap; dixLookupResourceByType((void **) &cmap, screenInfo.screens[s]->defColormap, RT_COLORMAP, serverClient, DixCreateAccess); if (cmap && !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_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 * be used with, which may be PRIVATE_ALL indicating that this key * will be used with all of the private objects. If 'size' is * non-zero, then the specified amount of space will be allocated in * the private storage. Otherwise, space for a single pointer will * be allocated which can be set with dixSetPrivate */ Bool dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size) { DevPrivateType t; int offset; unsigned bytes; if (key->initialized) { assert(size == key->size); return TRUE; } /* Compute required space */ bytes = size; if (size == 0) bytes = sizeof(void *); /* align to pointer size */ bytes = (bytes + sizeof(void *) - 1) & ~(sizeof(void *) - 1); /* Update offsets for all affected keys */ if (type == PRIVATE_XSELINUX) { /* 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(!global_keys[t].created); else if (!allocated_early[t] (dixReallocPrivates, bytes)) return FALSE; } /* Move all existing keys up in the privates space to make * room for this new global key */ for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) { if (xselinux_private[t]) { grow_private_set(&global_keys[t], bytes); grow_screen_specific_set(t, bytes); if (allocated_early[t]) allocated_early[t] (dixMovePrivates, bytes); } } offset = 0; } else { /* Resize if we can, or make sure nothing's allocated if we can't */ if (!allocated_early[type]) assert(!global_keys[type].created); else if (!allocated_early[type] (dixReallocPrivates, bytes)) return FALSE; offset = global_keys[type].offset; global_keys[type].offset += bytes; grow_screen_specific_set(type, bytes); } /* Setup this key */ key->offset = offset; key->size = size; key->initialized = TRUE; key->type = type; key->allocated = FALSE; key->next = global_keys[type].key; global_keys[type].key = key; return TRUE; } Bool dixRegisterScreenPrivateKey(DevScreenPrivateKey screenKey, ScreenPtr pScreen, DevPrivateType type, unsigned size) { DevPrivateKey key; if (!dixRegisterPrivateKey(&screenKey->screenKey, PRIVATE_SCREEN, 0)) return FALSE; key = dixGetPrivate(&pScreen->devPrivates, &screenKey->screenKey); if (key != NULL) { assert(key->size == size); assert(key->type == type); return TRUE; } key = calloc(sizeof(DevPrivateKeyRec), 1); if (!key) return FALSE; if (!dixRegisterPrivateKey(key, type, size)) { free(key); return FALSE; } key->allocated = TRUE; dixSetPrivate(&pScreen->devPrivates, &screenKey->screenKey, key); return TRUE; } DevPrivateKey _dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen) { return dixGetPrivate(&pScreen->devPrivates, &key->screenKey); } /* * Initialize privates by zeroing them */ void _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type) { assert (!screen_specific_private[type]); global_keys[type].created++; if (xselinux_private[type]) global_keys[PRIVATE_XSELINUX].created++; if (global_keys[type].offset == 0) addr = 0; *privates = addr; memset(addr, '\0', global_keys[type].offset); } /* * Clean up privates */ void _dixFiniPrivates(PrivatePtr privates, DevPrivateType type) { global_keys[type].created--; if (xselinux_private[type]) global_keys[PRIVATE_XSELINUX].created--; } /* * Allocate new object with privates. * * This is expected to be invoked from the * dixAllocateObjectWithPrivates macro */ void * _dixAllocateObjectWithPrivates(unsigned baseSize, unsigned clear, unsigned offset, DevPrivateType type) { unsigned totalSize; void *object; PrivatePtr privates; 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 + global_keys[type].offset; object = malloc(totalSize); if (!object) return NULL; memset(object, '\0', clear); privates = (PrivatePtr) (((char *) object) + baseSize); devPrivates = (PrivatePtr *) ((char *) object + offset); _dixInitPrivates(devPrivates, privates, type); return object; } /* * Allocate privates separately from containing object. * Used for clients and screens. */ Bool dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type) { unsigned size; PrivatePtr p; assert(type > PRIVATE_XSELINUX && type < PRIVATE_LAST); assert(!screen_specific_private[type]); size = global_keys[type].offset; if (!size) { p = NULL; } else { if (!(p = malloc(size))) return FALSE; } _dixInitPrivates(privates, p, type); ++global_keys[type].allocated; return TRUE; } /* * Free an object that has privates * * This is expected to be invoked from the * dixFreeObjectWithPrivates macro */ void _dixFreeObjectWithPrivates(void *object, PrivatePtr privates, DevPrivateType type) { _dixFiniPrivates(privates, type); free(object); } /* * Called to free screen or client privates */ void dixFreePrivates(PrivatePtr privates, DevPrivateType type) { _dixFiniPrivates(privates, type); --global_keys[type].allocated; free(privates); } /* * Return size of privates for the specified type */ extern _X_EXPORT int dixPrivatesSize(DevPrivateType type) { assert(type >= PRIVATE_SCREEN && type < PRIVATE_LAST); assert (!screen_specific_private[type]); return global_keys[type].offset; } /* Table of devPrivates offsets */ static const int offsets[] = { -1, /* RT_NONE */ offsetof(WindowRec, devPrivates), /* RT_WINDOW */ offsetof(PixmapRec, devPrivates), /* RT_PIXMAP */ offsetof(GC, devPrivates), /* RT_GC */ -1, /* RT_FONT */ offsetof(CursorRec, devPrivates), /* RT_CURSOR */ offsetof(ColormapRec, devPrivates), /* RT_COLORMAP */ }; #define NUM_OFFSETS (sizeof (offsets) / sizeof (offsets[0])) int dixLookupPrivateOffset(RESTYPE type) { /* * Special kludge for DBE which registers a new resource type that * points at pixmaps (thanks, DBE) */ if (type & RC_DRAWABLE) { if (type == RT_WINDOW) return offsets[RT_WINDOW & TypeMask]; else return offsets[RT_PIXMAP & TypeMask]; } type = type & TypeMask; if (type < NUM_OFFSETS) return offsets[type]; return -1; } /* * Screen-specific privates */ extern _X_EXPORT Bool dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key, DevPrivateType type, unsigned size) { int offset; unsigned bytes; if (!screen_specific_private[type]) FatalError("Attempt to allocate screen-specific private storage for type %s\n", key_names[type]); 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 pointer 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) { int objects = 0; int bytes = 0; int alloc = 0; DevPrivateType t; for (t = PRIVATE_XSELINUX + 1; t < PRIVATE_LAST; t++) { if (global_keys[t].offset) { ErrorF ("%s: %d objects of %d bytes = %d total bytes %d private allocs\n", 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); } void dixResetPrivates(void) { DevPrivateType t; for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) { DevPrivateKey key, next; for (key = global_keys[t].key; key; key = next) { next = key->next; key->offset = 0; key->initialized = FALSE; key->size = 0; key->type = 0; if (key->allocated) free(key); } if (global_keys[t].created) { ErrorF("%d %ss still allocated at reset\n", global_keys[t].created, key_names[t]); dixPrivateUsage(); } global_keys[t].key = NULL; global_keys[t].offset = 0; global_keys[t].created = 0; global_keys[t].allocated = 0; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/Makefile.in������������������������������������������������������������������0000664�0001751�0001751�00000100426�12466505430�013652� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @SPECIAL_DTRACE_OBJECTS_TRUE@noinst_PROGRAMS = dix.O$(EXEEXT) subdir = dix DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(dist_miscconfig_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libdix_la_LIBADD = am_libdix_la_OBJECTS = atom.lo colormap.lo cursor.lo devices.lo \ dispatch.lo dixfonts.lo main.lo dixutils.lo enterleave.lo \ events.lo eventconvert.lo extension.lo ffs.lo gc.lo \ getevents.lo globals.lo glyphcurs.lo grabs.lo initatoms.lo \ inpututils.lo pixmap.lo privates.lo property.lo ptrveloc.lo \ region.lo registry.lo resource.lo selection.lo swaprep.lo \ swapreq.lo tables.lo touch.lo window.lo libdix_la_OBJECTS = $(am_libdix_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 = libmain_la_LIBADD = am_libmain_la_OBJECTS = stubmain.lo libmain_la_OBJECTS = $(am_libmain_la_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) am_dix_O_OBJECTS = dix_O_OBJECTS = $(am_dix_O_OBJECTS) dix_O_LDADD = $(LDADD) 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 = $(libdix_la_SOURCES) $(libmain_la_SOURCES) $(dix_O_SOURCES) DIST_SOURCES = $(libdix_la_SOURCES) $(libmain_la_SOURCES) \ $(dix_O_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(miscconfigdir)" DATA = $(dist_miscconfig_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libdix.la libmain.la AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = $(DIX_CFLAGS) libmain_la_SOURCES = \ stubmain.c libdix_la_SOURCES = \ atom.c \ colormap.c \ cursor.c \ devices.c \ dispatch.c \ dispatch.h \ dixfonts.c \ main.c \ dixutils.c \ enterleave.c \ enterleave.h \ events.c \ eventconvert.c \ extension.c \ ffs.c \ gc.c \ getevents.c \ globals.c \ glyphcurs.c \ grabs.c \ initatoms.c \ inpututils.c \ pixmap.c \ privates.c \ property.c \ ptrveloc.c \ region.c \ registry.c \ resource.c \ selection.c \ swaprep.c \ swapreq.c \ tables.c \ touch.c \ window.c EXTRA_DIST = buildatoms BuiltInAtoms Xserver.d Xserver-dtrace.h.in # Install list of protocol names miscconfigdir = $(SERVER_MISC_CONFIG_PATH) dist_miscconfig_DATA = protocol.txt # Generate dtrace header file for C sources to include @XSERVER_DTRACE_TRUE@BUILT_SOURCES = Xserver-dtrace.h @SPECIAL_DTRACE_OBJECTS_TRUE@dix_O_SOURCES = CLEANFILES = Xserver-dtrace.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 dix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dix/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libdix.la: $(libdix_la_OBJECTS) $(libdix_la_DEPENDENCIES) $(EXTRA_libdix_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdix_la_OBJECTS) $(libdix_la_LIBADD) $(LIBS) libmain.la: $(libmain_la_OBJECTS) $(libmain_la_DEPENDENCIES) $(EXTRA_libmain_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libmain_la_OBJECTS) $(libmain_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list @SPECIAL_DTRACE_OBJECTS_FALSE@dix.O$(EXEEXT): $(dix_O_OBJECTS) $(dix_O_DEPENDENCIES) $(EXTRA_dix_O_DEPENDENCIES) @SPECIAL_DTRACE_OBJECTS_FALSE@ @rm -f dix.O$(EXEEXT) @SPECIAL_DTRACE_OBJECTS_FALSE@ $(AM_V_CCLD)$(LINK) $(dix_O_OBJECTS) $(dix_O_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colormap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devices.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dixfonts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dixutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enterleave.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventconvert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/events.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extension.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getevents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glyphcurs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grabs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initatoms.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inpututils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privates.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrveloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/region.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/registry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubmain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swaprep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swapreq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/window.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 -o $@ $< .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 -o $@ `$(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-dist_miscconfigDATA: $(dist_miscconfig_DATA) @$(NORMAL_INSTALL) @list='$(dist_miscconfig_DATA)'; test -n "$(miscconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(miscconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(miscconfigdir)" || 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_DATA) $$files '$(DESTDIR)$(miscconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(miscconfigdir)" || exit $$?; \ done uninstall-dist_miscconfigDATA: @$(NORMAL_UNINSTALL) @list='$(dist_miscconfig_DATA)'; test -n "$(miscconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(miscconfigdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(miscconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS 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-dist_miscconfigDATA 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-dist_miscconfigDATA .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am 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-dist_miscconfigDATA \ 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 tags-am uninstall \ uninstall-am uninstall-dist_miscconfigDATA @XSERVER_DTRACE_TRUE@Xserver-dtrace.h: $(srcdir)/Xserver.d @XSERVER_DTRACE_TRUE@ $(AM_V_GEN)$(DTRACE) -C -h -o $@ -s $(srcdir)/Xserver.d \ @XSERVER_DTRACE_TRUE@ || cp Xserver-dtrace.h.in $@ # Generate dtrace object code for probes in libdix @SPECIAL_DTRACE_OBJECTS_TRUE@dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) @SPECIAL_DTRACE_OBJECTS_TRUE@dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) # 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: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/devices.c��������������������������������������������������������������������0000664�0001751�0001751�00000235200�12456571574�013405� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include "misc.h" #include "resource.h" #include <X11/Xproto.h> #include <X11/Xatom.h> #include "windowstr.h" #include "inputstr.h" #include "scrnintstr.h" #include "cursorstr.h" #include "dixstruct.h" #include "ptrveloc.h" #include "site.h" #include "xkbsrv.h" #include "privates.h" #include "xace.h" #include "mi.h" #include "dispatch.h" #include "swaprep.h" #include "dixevents.h" #include "mipointer.h" #include "eventstr.h" #include "dixgrabs.h" #include <X11/extensions/XI.h> #include <X11/extensions/XI2.h> #include <X11/extensions/XIproto.h> #include <math.h> #include <pixman.h> #include "exglobals.h" #include "exevents.h" #include "xiquerydevice.h" /* for SizeDeviceClasses */ #include "xiproperty.h" #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. */ static void RecalculateMasterButtons(DeviceIntPtr slave); static void DeviceSetTransform(DeviceIntPtr dev, float *transform_data) { struct pixman_f_transform scale; struct pixman_f_transform transform; double sx, sy; int x, y; /** * calculate combined transformation matrix: * * M = InvScale * Transform * Scale * * So we can later transform points using M * p * * Where: * Scale scales coordinates into 0..1 range * Transform is the user supplied (affine) transform * InvScale scales coordinates back up into their native range */ sx = dev->valuator->axes[0].max_value - dev->valuator->axes[0].min_value + 1; sy = dev->valuator->axes[1].max_value - dev->valuator->axes[1].min_value + 1; /* invscale */ pixman_f_transform_init_scale(&scale, sx, sy); scale.m[0][2] = dev->valuator->axes[0].min_value; scale.m[1][2] = dev->valuator->axes[1].min_value; /* transform */ for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) transform.m[y][x] = *transform_data++; 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->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; } /** * DIX property handler. */ static int DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, BOOL checkonly) { if (property == XIGetKnownProperty(XI_PROP_ENABLED)) { if (prop->format != 8 || prop->type != XA_INTEGER || prop->size != 1) return BadValue; /* 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) { if ((*((CARD8 *) prop->data)) && !dev->enabled) EnableDevice(dev, TRUE); else if (!(*((CARD8 *) prop->data)) && dev->enabled) DisableDevice(dev, TRUE); } } else if (property == XIGetKnownProperty(XI_PROP_TRANSFORM)) { float *f = (float *) prop->data; int i; if (prop->format != 32 || prop->size != 9 || prop->type != XIGetKnownProperty(XATOM_FLOAT)) return BadValue; for (i = 0; i < 9; i++) if (!isfinite(f[i])) return BadValue; if (!checkonly) DeviceSetTransform(dev, f); } return Success; } /* Pair the keyboard to the pointer device. Keyboard events will follow the * pointer sprite. Only applicable for master devices. */ static int PairDevices(DeviceIntPtr ptr, DeviceIntPtr kbd) { if (!ptr) return BadDevice; /* Don't allow pairing for slave devices */ if (!IsMaster(ptr) || !IsMaster(kbd)) return BadDevice; if (ptr->spriteInfo->paired) return BadDevice; if (kbd->spriteInfo->spriteOwner) { free(kbd->spriteInfo->sprite); kbd->spriteInfo->sprite = NULL; kbd->spriteInfo->spriteOwner = FALSE; } kbd->spriteInfo->sprite = ptr->spriteInfo->sprite; kbd->spriteInfo->paired = ptr; ptr->spriteInfo->paired = kbd; return Success; } /** * Find and return the next unpaired MD pointer device. */ static DeviceIntPtr NextFreePointerDevice(void) { DeviceIntPtr dev; for (dev = inputInfo.devices; dev; dev = dev->next) if (IsMaster(dev) && dev->spriteInfo->spriteOwner && !dev->spriteInfo->paired) return dev; return NULL; } /** * Create a new input device and init it to sane values. The device is added * to the server's off_devices list. * * @param deviceProc Callback for device control function (switch dev on/off). * @return The newly created device. */ DeviceIntPtr AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) { DeviceIntPtr dev, *prev; /* not a typo */ DeviceIntPtr devtmp; int devid; char devind[MAXDEVICES]; BOOL enabled; float transform[9]; /* Find next available id, 0 and 1 are reserved */ memset(devind, 0, sizeof(char) * MAXDEVICES); for (devtmp = inputInfo.devices; devtmp; devtmp = devtmp->next) devind[devtmp->id]++; for (devtmp = inputInfo.off_devices; devtmp; devtmp = devtmp->next) devind[devtmp->id]++; for (devid = 2; devid < MAXDEVICES && devind[devid]; devid++); if (devid >= MAXDEVICES) return (DeviceIntPtr) NULL; 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; dev->last.scroll = NULL; dev->last.touches = NULL; dev->id = devid; dev->public.processInputProc = ProcessOtherEvent; dev->public.realInputProc = ProcessOtherEvent; dev->public.enqueueInputProc = EnqueueEvent; dev->deviceProc = deviceProc; dev->startup = autoStart; /* device grab defaults */ dev->deviceGrab.grabTime = currentTime; dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; dev->deviceGrab.sync.event = calloc(1, sizeof(DeviceEvent)); XkbSetExtension(dev, ProcessKeyboardEvent); dev->coreEvents = TRUE; /* sprite defaults */ 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; } inputInfo.numDevices++; for (prev = &inputInfo.off_devices; *prev; prev = &(*prev)->next); *prev = dev; dev->next = NULL; enabled = FALSE; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), XA_INTEGER, 8, PropModeReplace, 1, &enabled, FALSE); XISetDevicePropertyDeletable(dev, XIGetKnownProperty(XI_PROP_ENABLED), FALSE); /* 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, PropModeReplace, 9, transform, FALSE); XISetDevicePropertyDeletable(dev, XIGetKnownProperty(XI_PROP_TRANSFORM), FALSE); XIRegisterPropertyHandler(dev, DeviceSetProperty, NULL, NULL); return dev; } void SendDevicePresenceEvent(int deviceid, int type) { DeviceIntRec dummyDev = { .id = XIAllDevices }; devicePresenceNotify ev = { .type = DevicePresenceNotify, .time = currentTime.milliseconds, .devchange = type, .deviceid = deviceid }; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); } /** * Enable the device through the driver, add the device to the device list. * Switch device ON through the driver and push it onto the global device * list. Initialize the DIX sprite or pair the device. All clients are * notified about the device being enabled. * * A master pointer device needs to be enabled before a master keyboard * device. * * @param The device to be enabled. * @param sendevent True if an XI2 event should be sent. * @return TRUE on success or FALSE otherwise. */ Bool EnableDevice(DeviceIntPtr dev, BOOL sendevent) { DeviceIntPtr *prev; int ret; DeviceIntPtr other; BOOL enabled; int flags[MAXDEVICES] = { 0 }; for (prev = &inputInfo.off_devices; *prev && (*prev != dev); prev = &(*prev)->next); if (!dev->spriteInfo->sprite) { if (IsMaster(dev)) { /* Sprites appear on first root window, so we can hardcode it */ if (dev->spriteInfo->spriteOwner) { InitializeSprite(dev, screenInfo.screens[0]->root); /* mode doesn't matter */ EnterWindow(dev, screenInfo.screens[0]->root, NotifyAncestor); } else { other = NextFreePointerDevice(); BUG_RETURN_VAL_MSG(other == NULL, FALSE, "[dix] cannot find pointer to pair with.\n"); PairDevices(other, dev); } } else { if (dev->coreEvents) other = (IsPointerDevice(dev)) ? inputInfo.pointer: inputInfo.keyboard; else other = NULL; /* auto-float non-core devices */ AttachDevice(NULL, dev, other); } } if ((*prev != dev) || !dev->inited || ((ret = (*dev->deviceProc) (dev, DEVICE_ON)) != Success)) { ErrorF("[dix] couldn't enable device %d\n", dev->id); return FALSE; } dev->enabled = TRUE; *prev = dev->next; for (prev = &inputInfo.devices; *prev; prev = &(*prev)->next); *prev = dev; dev->next = NULL; enabled = TRUE; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), XA_INTEGER, 8, PropModeReplace, 1, &enabled, TRUE); SendDevicePresenceEvent(dev->id, DeviceEnabled); if (sendevent) { flags[dev->id] |= XIDeviceEnabled; XISendDeviceHierarchyEvent(flags); } if (!IsMaster(dev) && !IsFloating(dev)) XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0); 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 * notified about the device being disabled. * * Master keyboard devices have to be disabled before master pointer devices * otherwise things turn bad. * * @param sendevent True if an XI2 event should be sent. * @return TRUE on success or FALSE otherwise. */ Bool DisableDevice(DeviceIntPtr dev, BOOL sendevent) { DeviceIntPtr *prev, other; 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) { if (!IsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) { AttachDevice(NULL, other, NULL); flags[other->id] |= XISlaveDetached; } } } else { for (other = inputInfo.devices; other; other = other->next) { if (IsMaster(other) && other->lastSlave == dev) other->lastSlave = NULL; } } if (IsMaster(dev) && dev->spriteInfo->sprite) { 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(); for (other = inputInfo.devices; other; other = other->next) { if (other->last.slave == dev) other->last.slave = NULL; } OsReleaseSignals(); LeaveWindow(dev); SetFocusOut(dev); *prev = dev->next; dev->next = inputInfo.off_devices; inputInfo.off_devices = dev; enabled = FALSE; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), XA_INTEGER, 8, PropModeReplace, 1, &enabled, TRUE); SendDevicePresenceEvent(dev->id, DeviceDisabled); if (sendevent) { flags[dev->id] = XIDeviceDisabled; XISendDeviceHierarchyEvent(flags); } RecalculateMasterButtons(dev); 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. * * Must be called before EnableDevice. * The device will NOT send events until it is enabled! * * @param sendevent True if an XI2 event should be sent. * @return Success or an error code on failure. */ int ActivateDevice(DeviceIntPtr dev, BOOL sendevent) { int ret = Success; ScreenPtr pScreen = screenInfo.screens[0]; if (!dev || !dev->deviceProc) return BadImplementation; ret = (*dev->deviceProc) (dev, DEVICE_INIT); dev->inited = (ret == Success); if (!dev->inited) return ret; /* Initialize memory for sprites. */ if (IsMaster(dev) && dev->spriteInfo->spriteOwner) if (!pScreen->DeviceCursorInitialize(dev, pScreen)) ret = BadAlloc; SendDevicePresenceEvent(dev->id, DeviceAdded); if (sendevent) { int flags[MAXDEVICES] = { 0 }; flags[dev->id] = XISlaveAdded; XISendDeviceHierarchyEvent(flags); } return ret; } /** * Ring the bell. * The actual task of ringing the bell is the job of the DDX. */ static void CoreKeyboardBell(int volume, DeviceIntPtr pDev, void *arg, int something) { KeybdCtrl *ctrl = arg; DDXRingBell(volume, ctrl->bell_pitch, ctrl->bell_duration); } static void CoreKeyboardCtl(DeviceIntPtr pDev, KeybdCtrl * ctrl) { return; } /** * Device control function for the Virtual Core Keyboard. */ int CoreKeyboardProc(DeviceIntPtr pDev, int what) { switch (what) { case DEVICE_INIT: if (!InitKeyboardDeviceStruct(pDev, NULL, CoreKeyboardBell, CoreKeyboardCtl)) { ErrorF("Keyboard initialization failed. This could be a missing " "or incorrect setup of xkeyboard-config.\n"); return BadValue; } return Success; case DEVICE_ON: case DEVICE_OFF: return Success; case DEVICE_CLOSE: return Success; } return BadMatch; } /** * Device control function for the Virtual Core Pointer. */ int CorePointerProc(DeviceIntPtr pDev, int what) { #define NBUTTONS 10 #define NAXES 2 BYTE map[NBUTTONS + 1]; int i = 0; Atom btn_labels[NBUTTONS] = { 0 }; Atom axes_labels[NAXES] = { 0 }; ScreenPtr scr = screenInfo.screens[0]; switch (what) { case DEVICE_INIT: for (i = 1; i <= NBUTTONS; i++) map[i] = i; btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); /* don't know about the rest */ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); if (!InitPointerDeviceStruct ((DevicePtr) pDev, map, NBUTTONS, btn_labels, (PtrCtrlProcPtr) NoopDDA, GetMotionHistorySize(), NAXES, axes_labels)) { ErrorF("Could not initialize device '%s'. Out of memory.\n", pDev->name); return BadAlloc; /* IPDS only fails on allocs */ } /* axisVal is per-screen, last.valuators is desktop-wide */ pDev->valuator->axisVal[0] = scr->width / 2; pDev->last.valuators[0] = pDev->valuator->axisVal[0] + scr->x; pDev->valuator->axisVal[1] = scr->height / 2; pDev->last.valuators[1] = pDev->valuator->axisVal[1] + scr->y; break; case DEVICE_CLOSE: break; default: break; } return Success; #undef NBUTTONS #undef NAXES } /** * Initialise the two core devices, VCP and VCK (see events.c). * Both devices are not tied to physical devices, but guarantee that there is * always a keyboard and a pointer present and keep the protocol semantics. * * Note that the server MUST have two core devices at all times, even if there * is no physical device connected. */ void InitCoreDevices(void) { if (AllocDevicePair(serverClient, "Virtual core", &inputInfo.pointer, &inputInfo.keyboard, CorePointerProc, CoreKeyboardProc, TRUE) != Success) FatalError("Failed to allocate core devices"); if (ActivateDevice(inputInfo.pointer, TRUE) != Success || ActivateDevice(inputInfo.keyboard, TRUE) != Success) FatalError("Failed to activate core devices."); if (!EnableDevice(inputInfo.pointer, TRUE) || !EnableDevice(inputInfo.keyboard, TRUE)) FatalError("Failed to enable core devices."); InitXTestDevices(); } /** * Activate all switched-off devices and then enable all those devices. * * Will return an error if no core keyboard or core pointer is present. * In theory this should never happen if you call InitCoreDevices() first. * * InitAndStartDevices needs to be called AFTER the windows are initialized. * Devices will start sending events after InitAndStartDevices() has * completed. * * @return Success or error code on failure. */ int InitAndStartDevices(void) { DeviceIntPtr dev, next; for (dev = inputInfo.off_devices; dev; dev = dev->next) { DebugF("(dix) initialising device %d\n", dev->id); if (!dev->inited) ActivateDevice(dev, TRUE); } /* enable real devices */ for (dev = inputInfo.off_devices; dev; dev = next) { DebugF("(dix) enabling device %d\n", dev->id); next = dev->next; if (dev->inited && dev->startup) EnableDevice(dev, TRUE); } return Success; } /** * Free the given device class and reset the pointer to NULL. */ static void FreeDeviceClass(int type, void **class) { if (!(*class)) return; switch (type) { case KeyClass: { KeyClassPtr *k = (KeyClassPtr *) class; if ((*k)->xkbInfo) { XkbFreeInfo((*k)->xkbInfo); (*k)->xkbInfo = NULL; } free((*k)); break; } case ButtonClass: { ButtonClassPtr *b = (ButtonClassPtr *) class; free((*b)->xkb_acts); free((*b)); break; } case ValuatorClass: { ValuatorClassPtr *v = (ValuatorClassPtr *) class; free((*v)->motion); free((*v)); break; } case XITouchClass: { TouchClassPtr *t = (TouchClassPtr *) class; int i; for (i = 0; i < (*t)->num_touches; i++) { free((*t)->touches[i].sprite.spriteTrace); free((*t)->touches[i].listeners); free((*t)->touches[i].valuators); } free((*t)->touches); free((*t)); break; } case FocusClass: { FocusClassPtr *f = (FocusClassPtr *) class; free((*f)->trace); free((*f)); break; } case ProximityClass: { ProximityClassPtr *p = (ProximityClassPtr *) class; free((*p)); break; } } *class = NULL; } static void FreeFeedbackClass(int type, void **class) { if (!(*class)) return; switch (type) { case KbdFeedbackClass: { KbdFeedbackPtr *kbdfeed = (KbdFeedbackPtr *) class; KbdFeedbackPtr k, knext; for (k = (*kbdfeed); k; k = knext) { knext = k->next; if (k->xkb_sli) XkbFreeSrvLedInfo(k->xkb_sli); free(k); } break; } case PtrFeedbackClass: { PtrFeedbackPtr *ptrfeed = (PtrFeedbackPtr *) class; PtrFeedbackPtr p, pnext; for (p = (*ptrfeed); p; p = pnext) { pnext = p->next; free(p); } break; } case IntegerFeedbackClass: { IntegerFeedbackPtr *intfeed = (IntegerFeedbackPtr *) class; IntegerFeedbackPtr i, inext; for (i = (*intfeed); i; i = inext) { inext = i->next; free(i); } break; } case StringFeedbackClass: { StringFeedbackPtr *stringfeed = (StringFeedbackPtr *) class; StringFeedbackPtr s, snext; for (s = (*stringfeed); s; s = snext) { snext = s->next; free(s->ctrl.symbols_supported); free(s->ctrl.symbols_displayed); free(s); } break; } case BellFeedbackClass: { BellFeedbackPtr *bell = (BellFeedbackPtr *) class; BellFeedbackPtr b, bnext; for (b = (*bell); b; b = bnext) { bnext = b->next; free(b); } break; } case LedFeedbackClass: { LedFeedbackPtr *leds = (LedFeedbackPtr *) class; LedFeedbackPtr l, lnext; for (l = (*leds); l; l = lnext) { lnext = l->next; if (l->xkb_sli) XkbFreeSrvLedInfo(l->xkb_sli); free(l); } break; } } *class = NULL; } static void FreeAllDeviceClasses(ClassesPtr classes) { if (!classes) return; FreeDeviceClass(KeyClass, (void *) &classes->key); FreeDeviceClass(ValuatorClass, (void *) &classes->valuator); FreeDeviceClass(XITouchClass, (void *) &classes->touch); FreeDeviceClass(ButtonClass, (void *) &classes->button); FreeDeviceClass(FocusClass, (void *) &classes->focus); FreeDeviceClass(ProximityClass, (void *) &classes->proximity); FreeFeedbackClass(KbdFeedbackClass, (void *) &classes->kbdfeed); FreeFeedbackClass(PtrFeedbackClass, (void *) &classes->ptrfeed); FreeFeedbackClass(IntegerFeedbackClass, (void *) &classes->intfeed); FreeFeedbackClass(StringFeedbackClass, (void *) &classes->stringfeed); FreeFeedbackClass(BellFeedbackClass, (void *) &classes->bell); FreeFeedbackClass(LedFeedbackClass, (void *) &classes->leds); } /** * Close down a device and free all resources. * Once closed down, the driver will probably not expect you that you'll ever * enable it again and free associated structs. If you want the device to just * be disabled, DisableDevice(). * Don't call this function directly, use RemoveDevice() instead. */ static void CloseDevice(DeviceIntPtr dev) { ScreenPtr screen = screenInfo.screens[0]; ClassesPtr classes; int j; if (!dev) return; XIDeleteAllDeviceProperties(dev); if (dev->inited) (void) (*dev->deviceProc) (dev, DEVICE_CLOSE); FreeSprite(dev); if (IsMaster(dev)) screen->DeviceCursorCleanup(dev, screen); /* free acceleration info */ if (dev->valuator && dev->valuator->accelScheme.AccelCleanupProc) dev->valuator->accelScheme.AccelCleanupProc(dev); while (dev->xkb_interest) XkbRemoveResourceClient((DevicePtr) dev, dev->xkb_interest->resource); free(dev->name); classes = (ClassesPtr) &dev->key; FreeAllDeviceClasses(classes); if (IsMaster(dev)) { classes = dev->unused_classes; FreeAllDeviceClasses(classes); free(classes); } /* a client may have the device set as client pointer */ for (j = 0; j < currentMaxClients; j++) { if (clients[j] && clients[j]->clientPtr == dev) { clients[j]->clientPtr = NULL; clients[j]->clientPtr = PickPointer(clients[j]); } } if (dev->deviceGrab.grab) FreeGrab(dev->deviceGrab.grab); free(dev->deviceGrab.sync.event); free(dev->config_info); /* Allocated in xf86ActivateDevice. */ free(dev->last.scroll); for (j = 0; j < dev->last.num_touches; j++) free(dev->last.touches[j].valuators); free(dev->last.touches); dev->config_info = NULL; dixFreePrivates(dev->devPrivates, PRIVATE_DEVICE); free(dev); } /** * Shut down all devices of one list and free all resources. */ static void CloseDeviceList(DeviceIntPtr *listHead) { /* Used to mark devices that we tried to free */ Bool freedIds[MAXDEVICES]; DeviceIntPtr dev; int i; if (listHead == NULL) return; for (i = 0; i < MAXDEVICES; i++) freedIds[i] = FALSE; dev = *listHead; while (dev != NULL) { freedIds[dev->id] = TRUE; DeleteInputDeviceRequest(dev); dev = *listHead; while (dev != NULL && freedIds[dev->id]) dev = dev->next; } } /** * Shut down all devices, free all resources, etc. * Only useful if you're shutting down the server! */ void CloseDownDevices(void) { DeviceIntPtr dev; OsBlockSignals(); /* Float all SDs before closing them. Note that at this point resources * (e.g. cursors) have been freed already, so we can't just call * AttachDevice(NULL, dev, NULL). Instead, we have to forcibly set master * to NULL and pretend nothing happened. */ for (dev = inputInfo.devices; dev; dev = dev->next) { if (!IsMaster(dev) && !IsFloating(dev)) dev->master = NULL; } CloseDeviceList(&inputInfo.devices); CloseDeviceList(&inputInfo.off_devices); CloseDevice(inputInfo.pointer); CloseDevice(inputInfo.keyboard); inputInfo.devices = NULL; inputInfo.off_devices = NULL; inputInfo.keyboard = NULL; inputInfo.pointer = NULL; XkbDeleteRulesDflts(); XkbDeleteRulesUsed(); 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. */ void UndisplayDevices(void) { DeviceIntPtr dev; ScreenPtr screen = screenInfo.screens[0]; for (dev = inputInfo.devices; dev; dev = dev->next) screen->DisplayCursor(dev, screen, NullCursor); } /** * Remove a device from the device list, closes it and thus frees all * resources. * Removes both enabled and disabled devices and notifies all devices about * the removal of the device. * * No PresenceNotify is sent for device that the client never saw. This can * happen if a malloc fails during the addition of master devices. If * dev->init is FALSE it means the client never received a DeviceAdded event, * so let's not send a DeviceRemoved event either. * * @param sendevent True if an XI2 event should be sent. */ int RemoveDevice(DeviceIntPtr dev, BOOL sendevent) { DeviceIntPtr prev, tmp, next; int ret = BadMatch; ScreenPtr screen = screenInfo.screens[0]; int deviceid; int initialized; int flags[MAXDEVICES] = { 0 }; DebugF("(dix) removing device %d\n", dev->id); if (!dev || dev == inputInfo.keyboard || dev == inputInfo.pointer) return BadImplementation; initialized = dev->inited; deviceid = dev->id; if (initialized) { if (DevHasCursor(dev)) screen->DisplayCursor(dev, screen, NullCursor); DisableDevice(dev, sendevent); flags[dev->id] = XIDeviceDisabled; } prev = NULL; for (tmp = inputInfo.devices; tmp; (prev = tmp), (tmp = next)) { next = tmp->next; if (tmp == dev) { if (prev == NULL) inputInfo.devices = next; else prev->next = next; flags[tmp->id] = IsMaster(tmp) ? XIMasterRemoved : XISlaveRemoved; CloseDevice(tmp); ret = Success; } } prev = NULL; for (tmp = inputInfo.off_devices; tmp; (prev = tmp), (tmp = next)) { next = tmp->next; if (tmp == dev) { flags[tmp->id] = IsMaster(tmp) ? XIMasterRemoved : XISlaveRemoved; CloseDevice(tmp); if (prev == NULL) inputInfo.off_devices = next; else prev->next = next; ret = Success; } } if (ret == Success && initialized) { inputInfo.numDevices--; SendDevicePresenceEvent(deviceid, DeviceRemoved); if (sendevent) XISendDeviceHierarchyEvent(flags); } return ret; } int NumMotionEvents(void) { /* only called to fill data in initial connection reply. * VCP is ok here, it is the only fixed device we have. */ return inputInfo.pointer->valuator->numMotionEvents; } int dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode) { DeviceIntPtr dev; int rc; *pDev = NULL; for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev->id == id) goto found; } for (dev = inputInfo.off_devices; dev; dev = dev->next) { if (dev->id == id) goto found; } return BadDevice; found: rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); if (rc == Success) *pDev = dev; return rc; } void QueryMinMaxKeyCodes(KeyCode *minCode, KeyCode *maxCode) { if (inputInfo.keyboard) { *minCode = inputInfo.keyboard->key->xkbInfo->desc->min_key_code; *maxCode = inputInfo.keyboard->key->xkbInfo->desc->max_key_code; } } Bool InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom *labels, CARD8 *map) { ButtonClassPtr butc; int i; BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->button != NULL, FALSE); BUG_RETURN_VAL(numButtons >= MAX_BUTTONS, FALSE); butc = calloc(1, sizeof(ButtonClassRec)); if (!butc) return FALSE; butc->numButtons = numButtons; butc->sourceid = dev->id; for (i = 1; i <= numButtons; i++) butc->map[i] = map[i]; for (i = numButtons + 1; i < MAP_LENGTH; i++) butc->map[i] = i; memcpy(butc->labels, labels, numButtons * sizeof(Atom)); dev->button = butc; return TRUE; } /** * Allocate a valuator class and set up the pointers for the axis values * appropriately. * * @param src If non-NULL, the memory is reallocated from src. If NULL, the * memory is calloc'd. * @parma numAxes Number of axes to allocate. * @return The allocated valuator struct. */ ValuatorClassPtr AllocValuatorClass(ValuatorClassPtr src, int numAxes) { ValuatorClassPtr v; /* force alignment with double */ union align_u { ValuatorClassRec valc; double d; } *align; int size; size = sizeof(union align_u) + numAxes * (sizeof(double) + sizeof(AxisInfo)); align = (union align_u *) realloc(src, size); if (!align) return NULL; if (!src) memset(align, 0, size); v = &align->valc; v->numAxes = numAxes; v->axisVal = (double *) (align + 1); v->axes = (AxisInfoPtr) (v->axisVal + numAxes); return v; } Bool InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, int numMotionEvents, int mode) { int i; ValuatorClassPtr valc; BUG_RETURN_VAL(dev == NULL, FALSE); if (numAxes > MAX_VALUATORS) { LogMessage(X_WARNING, "Device '%s' has %d axes, only using first %d.\n", dev->name, numAxes, MAX_VALUATORS); numAxes = MAX_VALUATORS; } valc = AllocValuatorClass(NULL, numAxes); if (!valc) return FALSE; dev->last.scroll = valuator_mask_new(numAxes); if (!dev->last.scroll) { free(valc); return FALSE; } valc->sourceid = dev->id; valc->motion = NULL; valc->first_motion = 0; valc->last_motion = 0; valc->h_scroll_axis = -1; valc->v_scroll_axis = -1; valc->numMotionEvents = numMotionEvents; valc->motionHintWindow = NullWindow; if ((mode & OutOfProximity) && !dev->proximity) InitProximityClassDeviceStruct(dev); dev->valuator = valc; AllocateMotionHistory(dev); for (i = 0; i < numAxes; i++) { InitValuatorAxisStruct(dev, i, labels[i], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, mode); valc->axisVal[i] = 0; } dev->last.numValuators = numAxes; if (IsMaster(dev) || /* do not accelerate master or xtest devices */ IsXTestDevice(dev, NULL)) InitPointerAccelerationScheme(dev, PtrAccelNoOp); else InitPointerAccelerationScheme(dev, PtrAccelDefault); return TRUE; } /* global list of acceleration schemes */ ValuatorAccelerationRec pointerAccelerationScheme[] = { {PtrAccelNoOp, NULL, NULL, NULL, NULL}, {PtrAccelPredictable, acceleratePointerPredictable, NULL, InitPredictableAccelerationScheme, AccelerationDefaultCleanup}, {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL}, {-1, NULL, NULL, NULL, NULL} /* terminator */ }; /** * install an acceleration scheme. returns TRUE on success, and should not * change anything if unsuccessful. */ Bool InitPointerAccelerationScheme(DeviceIntPtr dev, int scheme) { int x, i = -1; ValuatorClassPtr val; val = dev->valuator; if (!val) return FALSE; if (IsMaster(dev) && scheme != PtrAccelNoOp) return FALSE; for (x = 0; pointerAccelerationScheme[x].number >= 0; x++) { if (pointerAccelerationScheme[x].number == scheme) { i = x; break; } } if (-1 == i) return FALSE; if (val->accelScheme.AccelCleanupProc) val->accelScheme.AccelCleanupProc(dev); if (pointerAccelerationScheme[i].AccelInitProc) { if (!pointerAccelerationScheme[i].AccelInitProc(dev, &pointerAccelerationScheme[i])) { return FALSE; } } else { val->accelScheme = pointerAccelerationScheme[i]; } return TRUE; } Bool InitFocusClassDeviceStruct(DeviceIntPtr dev) { FocusClassPtr focc; BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->focus != NULL, FALSE); focc = malloc(sizeof(FocusClassRec)); if (!focc) return FALSE; focc->win = PointerRootWin; focc->revert = None; focc->time = currentTime; focc->trace = (WindowPtr *) NULL; focc->traceSize = 0; focc->traceGood = 0; focc->sourceid = dev->id; dev->focus = focc; return TRUE; } Bool InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc) { PtrFeedbackPtr feedc; BUG_RETURN_VAL(dev == NULL, FALSE); feedc = malloc(sizeof(PtrFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; feedc->ctrl = defaultPointerControl; feedc->ctrl.id = 0; if ((feedc->next = dev->ptrfeed)) feedc->ctrl.id = dev->ptrfeed->ctrl.id + 1; dev->ptrfeed = feedc; (*controlProc) (dev, &feedc->ctrl); return TRUE; } static LedCtrl defaultLedControl = { DEFAULT_LEDS, DEFAULT_LEDS_MASK, 0 }; static BellCtrl defaultBellControl = { DEFAULT_BELL, DEFAULT_BELL_PITCH, DEFAULT_BELL_DURATION, 0 }; static IntegerCtrl defaultIntegerControl = { DEFAULT_INT_RESOLUTION, DEFAULT_INT_MIN_VALUE, DEFAULT_INT_MAX_VALUE, DEFAULT_INT_DISPLAYED, 0 }; Bool InitStringFeedbackClassDeviceStruct(DeviceIntPtr dev, StringCtrlProcPtr controlProc, int max_symbols, int num_symbols_supported, KeySym * symbols) { int i; StringFeedbackPtr feedc; BUG_RETURN_VAL(dev == NULL, FALSE); feedc = malloc(sizeof(StringFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; feedc->ctrl.num_symbols_supported = num_symbols_supported; feedc->ctrl.num_symbols_displayed = 0; feedc->ctrl.max_symbols = max_symbols; feedc->ctrl.symbols_supported = malloc(sizeof(KeySym) * num_symbols_supported); feedc->ctrl.symbols_displayed = malloc(sizeof(KeySym) * max_symbols); if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed) { free(feedc->ctrl.symbols_supported); free(feedc->ctrl.symbols_displayed); free(feedc); return FALSE; } for (i = 0; i < num_symbols_supported; i++) *(feedc->ctrl.symbols_supported + i) = *symbols++; for (i = 0; i < max_symbols; i++) *(feedc->ctrl.symbols_displayed + i) = (KeySym) 0; feedc->ctrl.id = 0; if ((feedc->next = dev->stringfeed)) feedc->ctrl.id = dev->stringfeed->ctrl.id + 1; dev->stringfeed = feedc; (*controlProc) (dev, &feedc->ctrl); return TRUE; } Bool InitBellFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, BellCtrlProcPtr controlProc) { BellFeedbackPtr feedc; BUG_RETURN_VAL(dev == NULL, FALSE); feedc = malloc(sizeof(BellFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; feedc->BellProc = bellProc; feedc->ctrl = defaultBellControl; feedc->ctrl.id = 0; if ((feedc->next = dev->bell)) feedc->ctrl.id = dev->bell->ctrl.id + 1; dev->bell = feedc; (*controlProc) (dev, &feedc->ctrl); return TRUE; } Bool InitLedFeedbackClassDeviceStruct(DeviceIntPtr dev, LedCtrlProcPtr controlProc) { LedFeedbackPtr feedc; BUG_RETURN_VAL(dev == NULL, FALSE); feedc = malloc(sizeof(LedFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; feedc->ctrl = defaultLedControl; feedc->ctrl.id = 0; if ((feedc->next = dev->leds)) feedc->ctrl.id = dev->leds->ctrl.id + 1; feedc->xkb_sli = NULL; dev->leds = feedc; (*controlProc) (dev, &feedc->ctrl); return TRUE; } Bool InitIntegerFeedbackClassDeviceStruct(DeviceIntPtr dev, IntegerCtrlProcPtr controlProc) { IntegerFeedbackPtr feedc; BUG_RETURN_VAL(dev == NULL, FALSE); feedc = malloc(sizeof(IntegerFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; feedc->ctrl = defaultIntegerControl; feedc->ctrl.id = 0; if ((feedc->next = dev->intfeed)) feedc->ctrl.id = dev->intfeed->ctrl.id + 1; dev->intfeed = feedc; (*controlProc) (dev, &feedc->ctrl); return TRUE; } Bool InitPointerDeviceStruct(DevicePtr device, CARD8 *map, int numButtons, Atom *btn_labels, PtrCtrlProcPtr controlProc, int numMotionEvents, int numAxes, Atom *axes_labels) { DeviceIntPtr dev = (DeviceIntPtr) device; BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->button != NULL, FALSE); BUG_RETURN_VAL(dev->valuator != NULL, FALSE); BUG_RETURN_VAL(dev->ptrfeed != NULL, FALSE); return (InitButtonClassDeviceStruct(dev, numButtons, btn_labels, map) && InitValuatorClassDeviceStruct(dev, numAxes, axes_labels, numMotionEvents, Relative) && InitPtrFeedbackClassDeviceStruct(dev, controlProc)); } /** * Sets up multitouch capabilities on @device. * * @max_touches The maximum number of simultaneous touches, or 0 for unlimited. * @mode The mode of the touch device (XIDirectTouch or XIDependentTouch). * @num_axes The number of touch valuator axes. */ Bool InitTouchClassDeviceStruct(DeviceIntPtr device, unsigned int max_touches, unsigned int mode, unsigned int num_axes) { TouchClassPtr touch; int i; BUG_RETURN_VAL(device == NULL, FALSE); BUG_RETURN_VAL(device->touch != NULL, FALSE); BUG_RETURN_VAL(device->valuator == NULL, FALSE); /* Check the mode is valid, and at least X and Y axes. */ BUG_RETURN_VAL(mode != XIDirectTouch && mode != XIDependentTouch, FALSE); BUG_RETURN_VAL(num_axes < 2, FALSE); if (num_axes > MAX_VALUATORS) { LogMessage(X_WARNING, "Device '%s' has %d touch axes, only using first %d.\n", device->name, num_axes, MAX_VALUATORS); num_axes = MAX_VALUATORS; } touch = calloc(1, sizeof(*touch)); if (!touch) return FALSE; touch->max_touches = max_touches; if (max_touches == 0) max_touches = 5; /* arbitrary number plucked out of the air */ touch->touches = calloc(max_touches, sizeof(*touch->touches)); if (!touch->touches) goto err; touch->num_touches = max_touches; for (i = 0; i < max_touches; i++) TouchInitTouchPoint(touch, device->valuator, i); touch->mode = mode; touch->sourceid = device->id; device->touch = touch; device->last.touches = calloc(max_touches, sizeof(*device->last.touches)); device->last.num_touches = touch->num_touches; for (i = 0; i < touch->num_touches; i++) TouchInitDDXTouchPoint(device, &device->last.touches[i]); return TRUE; err: for (i = 0; i < touch->num_touches; i++) TouchFreeTouchPoint(device, i); free(touch->touches); free(touch); return FALSE; } /* * Check if the given buffer contains elements between low (inclusive) and * high (inclusive) only. * * @return TRUE if the device map is invalid, FALSE otherwise. */ Bool BadDeviceMap(BYTE * buff, int length, unsigned low, unsigned high, XID *errval) { int i; for (i = 0; i < length; i++) if (buff[i]) { /* only check non-zero elements */ if ((low > buff[i]) || (high < buff[i])) { *errval = buff[i]; return TRUE; } } return FALSE; } int ProcSetModifierMapping(ClientPtr client) { xSetModifierMappingReply rep; int rc; REQUEST(xSetModifierMappingReq); REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq); if (client->req_len != ((stuff->numKeyPerModifier << 1) + bytes_to_int32(sizeof(xSetModifierMappingReq)))) return BadLength; rep = (xSetModifierMappingReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1], stuff->numKeyPerModifier); if (rc == MappingFailed || rc == -1) return BadValue; if (rc != Success && rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy) return rc; rep.success = rc; WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep); return Success; } int ProcGetModifierMapping(ClientPtr client) { xGetModifierMappingReply rep; int max_keys_per_mod = 0; KeyCode *modkeymap = NULL; REQUEST_SIZE_MATCH(xReq); generate_modkeymap(client, PickKeyboard(client), &modkeymap, &max_keys_per_mod); 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 */ .length = max_keys_per_mod << 1 }; WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep); WriteToClient(client, max_keys_per_mod * 8, modkeymap); free(modkeymap); return Success; } int ProcChangeKeyboardMapping(ClientPtr client) { REQUEST(xChangeKeyboardMappingReq); unsigned len; KeySymsRec keysyms; DeviceIntPtr pDev, tmp; int rc; REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); len = client->req_len - bytes_to_int32(sizeof(xChangeKeyboardMappingReq)); if (len != (stuff->keyCodes * stuff->keySymsPerKeyCode)) return BadLength; pDev = PickKeyboard(client); if ((stuff->firstKeyCode < pDev->key->xkbInfo->desc->min_key_code) || (stuff->firstKeyCode > pDev->key->xkbInfo->desc->max_key_code)) { client->errorValue = stuff->firstKeyCode; return BadValue; } if (((unsigned) (stuff->firstKeyCode + stuff->keyCodes - 1) > pDev->key->xkbInfo->desc->max_key_code) || (stuff->keySymsPerKeyCode == 0)) { client->errorValue = stuff->keySymsPerKeyCode; return BadValue; } keysyms.minKeyCode = stuff->firstKeyCode; keysyms.maxKeyCode = stuff->firstKeyCode + stuff->keyCodes - 1; keysyms.mapWidth = stuff->keySymsPerKeyCode; keysyms.map = (KeySym *) &stuff[1]; rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess); if (rc != Success) return rc; XkbApplyMappingChange(pDev, &keysyms, stuff->firstKeyCode, stuff->keyCodes, NULL, client); for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { if (IsMaster(tmp) || GetMaster(tmp, MASTER_KEYBOARD) != pDev) continue; if (!tmp->key) continue; rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess); if (rc != Success) continue; XkbApplyMappingChange(tmp, &keysyms, stuff->firstKeyCode, stuff->keyCodes, NULL, client); } return Success; } int ProcSetPointerMapping(ClientPtr client) { BYTE *map; int ret; int i, j; DeviceIntPtr ptr = PickPointer(client); xSetPointerMappingReply rep; REQUEST(xSetPointerMappingReq); REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq); if (client->req_len != bytes_to_int32(sizeof(xSetPointerMappingReq) + stuff->nElts)) return BadLength; 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 * probably wants disabling through XFixes. */ /* MPX: With ClientPointer, we can return the right number of buttons. * Let's just hope nobody changed ClientPointer between GetPointerMapping * and SetPointerMapping */ if (stuff->nElts != ptr->button->numButtons) { client->errorValue = stuff->nElts; return BadValue; } /* Core protocol specs don't allow for duplicate mappings; this check * almost certainly wants disabling through XFixes too. */ for (i = 0; i < stuff->nElts; i++) { for (j = i + 1; j < stuff->nElts; j++) { if (map[i] && map[i] == map[j]) { client->errorValue = map[i]; return BadValue; } } } ret = ApplyPointerMapping(ptr, map, stuff->nElts, client); if (ret == MappingBusy) rep.success = ret; else if (ret == -1) return BadValue; else if (ret != Success) return ret; WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep); return Success; } int ProcGetKeyboardMapping(ClientPtr client) { xGetKeyboardMappingReply rep; DeviceIntPtr kbd = PickKeyboard(client); XkbDescPtr xkb; KeySymsPtr syms; int rc; REQUEST(xGetKeyboardMappingReq); REQUEST_SIZE_MATCH(xGetKeyboardMappingReq); rc = XaceHook(XACE_DEVICE_ACCESS, client, kbd, DixGetAttrAccess); if (rc != Success) return rc; xkb = kbd->key->xkbInfo->desc; if ((stuff->firstKeyCode < xkb->min_key_code) || (stuff->firstKeyCode > xkb->max_key_code)) { client->errorValue = stuff->firstKeyCode; return BadValue; } if (stuff->firstKeyCode + stuff->count > xkb->max_key_code + 1) { client->errorValue = stuff->count; return BadValue; } syms = XkbGetCoreMap(kbd); if (!syms) return BadAlloc; 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, syms->mapWidth * stuff->count * sizeof(KeySym), &syms->map[syms->mapWidth * (stuff->firstKeyCode - syms->minKeyCode)]); free(syms->map); free(syms); return Success; } int ProcGetPointerMapping(ClientPtr client) { xGetPointerMappingReply rep; /* Apps may get different values each time they call GetPointerMapping as * the ClientPointer could change. */ DeviceIntPtr ptr = PickPointer(client); ButtonClassPtr butc = ptr->button; int nElts; int rc; REQUEST_SIZE_MATCH(xReq); rc = XaceHook(XACE_DEVICE_ACCESS, client, ptr, DixGetAttrAccess); if (rc != Success) return rc; 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, nElts, &butc->map[1]); return Success; } void NoteLedState(DeviceIntPtr keybd, int led, Bool on) { KeybdCtrl *ctrl = &keybd->kbdfeed->ctrl; if (on) ctrl->leds |= ((Leds) 1 << (led - 1)); else ctrl->leds &= ~((Leds) 1 << (led - 1)); } int Ones(unsigned long mask) { /* HACKMEM 169 */ unsigned long y; y = (mask >> 1) & 033333333333; y = mask - y - ((y >> 1) & 033333333333); return (((y + (y >> 3)) & 030707070707) % 077); } static int DoChangeKeyboardControl(ClientPtr client, DeviceIntPtr keybd, XID *vlist, BITS32 vmask) { #define DO_ALL (-1) KeybdCtrl ctrl; int t; int led = DO_ALL; int key = DO_ALL; BITS32 index2; int mask = vmask, i; XkbEventCauseRec cause; ctrl = keybd->kbdfeed->ctrl; while (vmask) { index2 = (BITS32) lowbit(vmask); vmask &= ~index2; switch (index2) { case KBKeyClickPercent: t = (INT8) *vlist; vlist++; if (t == -1) { t = defaultKeyboardControl.click; } else if (t < 0 || t > 100) { client->errorValue = t; return BadValue; } ctrl.click = t; break; case KBBellPercent: t = (INT8) *vlist; vlist++; if (t == -1) { t = defaultKeyboardControl.bell; } else if (t < 0 || t > 100) { client->errorValue = t; return BadValue; } ctrl.bell = t; break; case KBBellPitch: t = (INT16) *vlist; vlist++; if (t == -1) { t = defaultKeyboardControl.bell_pitch; } else if (t < 0) { client->errorValue = t; return BadValue; } ctrl.bell_pitch = t; break; case KBBellDuration: t = (INT16) *vlist; vlist++; if (t == -1) t = defaultKeyboardControl.bell_duration; else if (t < 0) { client->errorValue = t; return BadValue; } ctrl.bell_duration = t; break; case KBLed: led = (CARD8) *vlist; vlist++; if (led < 1 || led > 32) { client->errorValue = led; return BadValue; } if (!(mask & KBLedMode)) return BadMatch; break; case KBLedMode: t = (CARD8) *vlist; vlist++; if (t == LedModeOff) { if (led == DO_ALL) ctrl.leds = 0x0; else ctrl.leds &= ~(((Leds) (1)) << (led - 1)); } else if (t == LedModeOn) { if (led == DO_ALL) ctrl.leds = ~0L; else ctrl.leds |= (((Leds) (1)) << (led - 1)); } else { client->errorValue = t; return BadValue; } XkbSetCauseCoreReq(&cause, X_ChangeKeyboardControl, client); XkbSetIndicators(keybd, ((led == DO_ALL) ? ~0L : (1L << (led - 1))), ctrl.leds, &cause); ctrl.leds = keybd->kbdfeed->ctrl.leds; break; case KBKey: key = (KeyCode) *vlist; vlist++; if ((KeyCode) key < keybd->key->xkbInfo->desc->min_key_code || (KeyCode) key > keybd->key->xkbInfo->desc->max_key_code) { client->errorValue = key; return BadValue; } if (!(mask & KBAutoRepeatMode)) return BadMatch; break; case KBAutoRepeatMode: i = (key >> 3); mask = (1 << (key & 7)); t = (CARD8) *vlist; vlist++; if (key != DO_ALL) XkbDisableComputedAutoRepeats(keybd, key); if (t == AutoRepeatModeOff) { if (key == DO_ALL) ctrl.autoRepeat = FALSE; else ctrl.autoRepeats[i] &= ~mask; } else if (t == AutoRepeatModeOn) { if (key == DO_ALL) ctrl.autoRepeat = TRUE; else ctrl.autoRepeats[i] |= mask; } else if (t == AutoRepeatModeDefault) { if (key == DO_ALL) ctrl.autoRepeat = defaultKeyboardControl.autoRepeat; else ctrl.autoRepeats[i] = (ctrl.autoRepeats[i] & ~mask) | (defaultKeyboardControl.autoRepeats[i] & mask); } else { client->errorValue = t; return BadValue; } break; default: client->errorValue = mask; return BadValue; } } keybd->kbdfeed->ctrl = ctrl; /* The XKB RepeatKeys control and core protocol global autorepeat */ /* value are linked */ XkbSetRepeatKeys(keybd, key, keybd->kbdfeed->ctrl.autoRepeat); return Success; #undef DO_ALL } /** * Changes kbd control on the ClientPointer and all attached SDs. */ int ProcChangeKeyboardControl(ClientPtr client) { XID *vlist; BITS32 vmask; int ret = Success, error = Success; DeviceIntPtr pDev = NULL, keyboard; REQUEST(xChangeKeyboardControlReq); REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); vmask = stuff->mask; vlist = (XID *) &stuff[1]; if (client->req_len != (sizeof(xChangeKeyboardControlReq) >> 2) + Ones(vmask)) return BadLength; keyboard = PickKeyboard(client); for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if ((pDev == keyboard || (!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard)) && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) { ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess); if (ret != Success) return ret; } } for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if ((pDev == keyboard || (!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard)) && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) { ret = DoChangeKeyboardControl(client, pDev, vlist, vmask); if (ret != Success) error = ret; } } return error; } int ProcGetKeyboardControl(ClientPtr client) { int rc, i; DeviceIntPtr kbd = PickKeyboard(client); KeybdCtrl *ctrl = &kbd->kbdfeed->ctrl; xGetKeyboardControlReply rep; REQUEST_SIZE_MATCH(xReq); rc = XaceHook(XACE_DEVICE_ACCESS, client, kbd, DixGetAttrAccess); if (rc != Success) return rc; 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); return Success; } int ProcBell(ClientPtr client) { DeviceIntPtr dev, keybd = PickKeyboard(client); int base = keybd->kbdfeed->ctrl.bell; int newpercent; int rc; REQUEST(xBellReq); REQUEST_SIZE_MATCH(xBellReq); if (stuff->percent < -100 || stuff->percent > 100) { client->errorValue = stuff->percent; return BadValue; } newpercent = (base * stuff->percent) / 100; if (stuff->percent < 0) newpercent = base + newpercent; else newpercent = base - newpercent + stuff->percent; for (dev = inputInfo.devices; dev; dev = dev->next) { if ((dev == keybd || (!IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) && ((dev->kbdfeed && dev->kbdfeed->BellProc) || dev->xkb_interest)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess); if (rc != Success) return rc; XkbHandleBell(FALSE, FALSE, dev, newpercent, &dev->kbdfeed->ctrl, 0, None, NULL, client); } } return Success; } int ProcChangePointerControl(ClientPtr client) { DeviceIntPtr dev, mouse = PickPointer(client); PtrCtrl ctrl; /* might get BadValue part way through */ int rc; REQUEST(xChangePointerControlReq); REQUEST_SIZE_MATCH(xChangePointerControlReq); ctrl = mouse->ptrfeed->ctrl; if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse)) { client->errorValue = stuff->doAccel; return BadValue; } if ((stuff->doThresh != xTrue) && (stuff->doThresh != xFalse)) { client->errorValue = stuff->doThresh; return BadValue; } if (stuff->doAccel) { if (stuff->accelNum == -1) { ctrl.num = defaultPointerControl.num; } else if (stuff->accelNum < 0) { client->errorValue = stuff->accelNum; return BadValue; } else { ctrl.num = stuff->accelNum; } if (stuff->accelDenum == -1) { ctrl.den = defaultPointerControl.den; } else if (stuff->accelDenum <= 0) { client->errorValue = stuff->accelDenum; return BadValue; } else { ctrl.den = stuff->accelDenum; } } if (stuff->doThresh) { if (stuff->threshold == -1) { ctrl.threshold = defaultPointerControl.threshold; } else if (stuff->threshold < 0) { client->errorValue = stuff->threshold; return BadValue; } else { ctrl.threshold = stuff->threshold; } } for (dev = inputInfo.devices; dev; dev = dev->next) { if ((dev == mouse || (!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) && dev->ptrfeed) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess); if (rc != Success) return rc; } } for (dev = inputInfo.devices; dev; dev = dev->next) { if ((dev == mouse || (!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) && dev->ptrfeed) { dev->ptrfeed->ctrl = ctrl; } } return Success; } int ProcGetPointerControl(ClientPtr client) { DeviceIntPtr ptr = PickPointer(client); PtrCtrl *ctrl = &ptr->ptrfeed->ctrl; xGetPointerControlReply rep; int rc; REQUEST_SIZE_MATCH(xReq); rc = XaceHook(XACE_DEVICE_ACCESS, client, ptr, DixGetAttrAccess); if (rc != Success) return rc; 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; } void MaybeStopHint(DeviceIntPtr dev, ClientPtr client) { GrabPtr grab = dev->deviceGrab.grab; if ((grab && SameClient(grab, client) && ((grab->eventMask & PointerMotionHintMask) || (grab->ownerEvents && (EventMaskForClient(dev->valuator->motionHintWindow, client) & PointerMotionHintMask)))) || (!grab && (EventMaskForClient(dev->valuator->motionHintWindow, client) & PointerMotionHintMask))) dev->valuator->motionHintWindow = NullWindow; } int ProcGetMotionEvents(ClientPtr client) { WindowPtr pWin; xTimecoord *coords = (xTimecoord *) NULL; xGetMotionEventsReply rep; int i, count, xmin, xmax, ymin, ymax, rc; unsigned long nEvents; DeviceIntPtr mouse = PickPointer(client); TimeStamp start, stop; REQUEST(xGetMotionEventsReq); REQUEST_SIZE_MATCH(xGetMotionEventsReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rc = XaceHook(XACE_DEVICE_ACCESS, client, mouse, DixReadAccess); if (rc != Success) return rc; if (mouse->valuator->motionHintWindow) MaybeStopHint(mouse, client); rep = (xGetMotionEventsReply) { .type = X_Reply, .sequenceNumber = client->sequence }; nEvents = 0; start = ClientTimeToServerTime(stuff->start); stop = ClientTimeToServerTime(stuff->stop); if ((CompareTimeStamps(start, stop) != LATER) && (CompareTimeStamps(start, currentTime) != LATER) && mouse->valuator->numMotionEvents) { if (CompareTimeStamps(stop, currentTime) == LATER) stop = currentTime; count = GetMotionHistory(mouse, &coords, start.milliseconds, stop.milliseconds, pWin->drawable.pScreen, TRUE); xmin = pWin->drawable.x - wBorderWidth(pWin); xmax = pWin->drawable.x + (int) pWin->drawable.width + wBorderWidth(pWin); ymin = pWin->drawable.y - wBorderWidth(pWin); ymax = pWin->drawable.y + (int) pWin->drawable.height + wBorderWidth(pWin); for (i = 0; i < count; i++) if ((xmin <= coords[i].x) && (coords[i].x < xmax) && (ymin <= coords[i].y) && (coords[i].y < ymax)) { coords[nEvents].time = coords[i].time; coords[nEvents].x = coords[i].x - pWin->drawable.x; coords[nEvents].y = coords[i].y - pWin->drawable.y; nEvents++; } } rep.length = nEvents * bytes_to_int32(sizeof(xTimecoord)); rep.nEvents = nEvents; WriteReplyToClient(client, sizeof(xGetMotionEventsReply), &rep); if (nEvents) { client->pSwapReplyFunc = (ReplySwapPtr) SwapTimeCoordWrite; WriteSwappedDataToClient(client, nEvents * sizeof(xTimecoord), (char *) coords); } free(coords); return Success; } int ProcQueryKeymap(ClientPtr client) { xQueryKeymapReply rep; int rc, i; DeviceIntPtr keybd = PickKeyboard(client); CARD8 *down = keybd->key->down; REQUEST_SIZE_MATCH(xReq); rep = (xQueryKeymapReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 2 }; rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess); /* 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; WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep); return Success; } /** * Recalculate the number of buttons for the master device. The number of * buttons on the master device is equal to the number of buttons on the * slave device with the highest number of buttons. */ static void RecalculateMasterButtons(DeviceIntPtr slave) { DeviceIntPtr dev, master; int maxbuttons = 0; if (!slave->button || IsMaster(slave)) return; master = GetMaster(slave, MASTER_POINTER); if (!master) return; for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsMaster(dev) || GetMaster(dev, MASTER_ATTACHED) != master || !dev->button) continue; maxbuttons = max(maxbuttons, dev->button->numButtons); } if (master->button && master->button->numButtons != maxbuttons) { int i; 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; memcpy(&event.buttons.names, master->button->labels, maxbuttons * sizeof(Atom)); if (master->valuator) { event.num_valuators = master->valuator->numAxes; for (i = 0; i < event.num_valuators; i++) { event.valuators[i].min = master->valuator->axes[i].min_value; event.valuators[i].max = master->valuator->axes[i].max_value; event.valuators[i].resolution = master->valuator->axes[i].resolution; event.valuators[i].mode = master->valuator->axes[i].mode; event.valuators[i].name = master->valuator->axes[i].label; } } if (master->key) { event.keys.min_keycode = master->key->xkbInfo->desc->min_key_code; event.keys.max_keycode = master->key->xkbInfo->desc->max_key_code; } XISendDeviceChangedEvent(master, &event); } } /** * Generate release events for all keys/button currently down on this * device. */ void ReleaseButtonsAndKeys(DeviceIntPtr dev) { InternalEvent *eventlist = InitEventList(GetMaximumEventsNum()); ButtonClassPtr b = dev->button; KeyClassPtr k = dev->key; int i, j, nevents; if (!eventlist) /* no release events for you */ return; /* Release all buttons */ for (i = 0; b && i < b->numButtons; i++) { if (BitIsOn(b->down, i)) { nevents = GetPointerEvents(eventlist, dev, ButtonRelease, i, 0, NULL); for (j = 0; j < nevents; j++) mieqProcessDeviceEvent(dev, &eventlist[j], NULL); } } /* Release all keys */ for (i = 0; k && i < MAP_LENGTH; i++) { if (BitIsOn(k->down, i)) { nevents = GetKeyboardEvents(eventlist, dev, KeyRelease, i, NULL); for (j = 0; j < nevents; j++) mieqProcessDeviceEvent(dev, &eventlist[j], NULL); } } FreeEventList(eventlist, GetMaximumEventsNum()); } /** * Attach device 'dev' to device 'master'. * Client is set to the client that issued the request, or NULL if it comes * from some internal automatic pairing. * * Master may be NULL to set the device floating. * * We don't allow multi-layer hierarchies right now. You can't attach a slave * to another slave. */ int AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) { ScreenPtr screen; if (!dev || IsMaster(dev)) return BadDevice; if (master && !IsMaster(master)) /* can't attach to slaves */ return BadDevice; /* set from floating to floating? */ if (IsFloating(dev) && !master && dev->enabled) return Success; /* free the existing sprite. */ if (IsFloating(dev) && dev->spriteInfo->paired == dev) { screen = miPointerGetScreen(dev); screen->DeviceCursorCleanup(dev, screen); free(dev->spriteInfo->sprite); } dev->master = master; /* If device is set to floating, we need to create a sprite for it, * otherwise things go bad. However, we don't want to render the cursor, * so we reset spriteOwner. * Sprite has to be forced to NULL first, otherwise InitializeSprite won't * alloc new memory but overwrite the previous one. */ if (!master) { WindowPtr currentRoot; if (dev->spriteInfo->sprite) currentRoot = GetCurrentRootWindow(dev); else /* new device auto-set to floating */ currentRoot = screenInfo.screens[0]->root; /* we need to init a fake sprite */ screen = currentRoot->drawable.pScreen; screen->DeviceCursorInitialize(dev, screen); dev->spriteInfo->sprite = NULL; InitializeSprite(dev, currentRoot); dev->spriteInfo->spriteOwner = FALSE; dev->spriteInfo->paired = dev; } else { dev->spriteInfo->sprite = master->spriteInfo->sprite; dev->spriteInfo->paired = master; dev->spriteInfo->spriteOwner = FALSE; XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0); RecalculateMasterButtons(master); } /* XXX: in theory, the MD should change back to its old, original * classes when the last SD is detached. Thanks to the XTEST devices, * we'll always have an SD attached until the MD is removed. * So let's not worry about that. */ return Success; } /** * Return the device paired with the given device or NULL. * Returns the device paired with the parent master if the given device is a * slave device. */ DeviceIntPtr GetPairedDevice(DeviceIntPtr dev) { if (!IsMaster(dev) && !IsFloating(dev)) dev = GetMaster(dev, MASTER_ATTACHED); return dev->spriteInfo->paired; } /** * Returns the requested master for this device. * The return values are: * - MASTER_ATTACHED: the master for this device or NULL for a floating * slave. * - MASTER_KEYBOARD: the master keyboard for this device or NULL for a * floating slave * - MASTER_POINTER: the master pointer for this device or NULL for a * floating slave * - POINTER_OR_FLOAT: the master pointer for this device or the device for * a floating slave * - KEYBOARD_OR_FLOAT: the master keyboard for this device or the device for * a floating slave * * @param which ::MASTER_KEYBOARD or ::MASTER_POINTER, ::MASTER_ATTACHED, * ::POINTER_OR_FLOAT or ::KEYBOARD_OR_FLOAT. * @return The requested master device */ DeviceIntPtr GetMaster(DeviceIntPtr dev, int which) { DeviceIntPtr master; if (IsMaster(dev)) master = dev; else { master = dev->master; if (!master && (which == POINTER_OR_FLOAT || which == KEYBOARD_OR_FLOAT)) return dev; } if (master && which != MASTER_ATTACHED) { if (which == MASTER_KEYBOARD || which == KEYBOARD_OR_FLOAT) { if (master->type != MASTER_KEYBOARD) master = GetPairedDevice(master); } else { if (master->type != MASTER_POINTER) master = GetPairedDevice(master); } } return master; } /** * Create a new device pair (== one pointer, one keyboard device). * Only allocates the devices, you will need to call ActivateDevice() and * EnableDevice() manually. * Either a master or a slave device can be created depending on * the value for master. */ int AllocDevicePair(ClientPtr client, const char *name, DeviceIntPtr *ptr, DeviceIntPtr *keybd, DeviceProc ptr_proc, DeviceProc keybd_proc, Bool master) { DeviceIntPtr pointer; DeviceIntPtr keyboard; char *dev_name; *ptr = *keybd = NULL; XkbInitPrivates(); pointer = AddInputDevice(client, ptr_proc, TRUE); if (!pointer) return BadAlloc; if (asprintf(&dev_name, "%s pointer", name) == -1) { RemoveDevice(pointer, FALSE); return BadAlloc; } pointer->name = dev_name; pointer->public.processInputProc = ProcessOtherEvent; pointer->public.realInputProc = ProcessOtherEvent; XkbSetExtension(pointer, ProcessPointerEvent); pointer->deviceGrab.ActivateGrab = ActivatePointerGrab; pointer->deviceGrab.DeactivateGrab = DeactivatePointerGrab; pointer->coreEvents = TRUE; pointer->spriteInfo->spriteOwner = TRUE; pointer->lastSlave = NULL; pointer->last.slave = NULL; pointer->type = (master) ? MASTER_POINTER : SLAVE; keyboard = AddInputDevice(client, keybd_proc, TRUE); if (!keyboard) { RemoveDevice(pointer, FALSE); return BadAlloc; } if (asprintf(&dev_name, "%s keyboard", name) == -1) { RemoveDevice(keyboard, FALSE); RemoveDevice(pointer, FALSE); return BadAlloc; } keyboard->name = dev_name; keyboard->public.processInputProc = ProcessOtherEvent; keyboard->public.realInputProc = ProcessOtherEvent; XkbSetExtension(keyboard, ProcessKeyboardEvent); keyboard->deviceGrab.ActivateGrab = ActivateKeyboardGrab; keyboard->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; keyboard->coreEvents = TRUE; keyboard->spriteInfo->spriteOwner = FALSE; keyboard->lastSlave = NULL; keyboard->last.slave = NULL; keyboard->type = (master) ? MASTER_KEYBOARD : SLAVE; /* The ClassesRec stores the device classes currently not used. */ if (IsMaster(pointer)) { pointer->unused_classes = calloc(1, sizeof(ClassesRec)); keyboard->unused_classes = calloc(1, sizeof(ClassesRec)); } *ptr = pointer; *keybd = keyboard; return Success; } /** * Return Relative or Absolute for the device. */ int valuator_get_mode(DeviceIntPtr dev, int axis) { return (dev->valuator->axes[axis].mode & DeviceMode); } /** * Set the given mode for the axis. If axis is VALUATOR_MODE_ALL_AXES, then * set the mode for all axes. */ void valuator_set_mode(DeviceIntPtr dev, int axis, int mode) { if (axis != VALUATOR_MODE_ALL_AXES) dev->valuator->axes[axis].mode = mode; else { int i; for (i = 0; i < dev->valuator->numAxes; i++) dev->valuator->axes[i].mode = mode; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/dispatch.h�������������������������������������������������������������������0000664�0001751�0001751�00000014677�12456571574�013604� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ /* * This prototypes the dispatch.c module (except for functions declared in * global headers), plus related dispatch procedures from devices.c, events.c, * extension.c, property.c. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef DISPATCH_H #define DISPATCH_H 1 int ProcAllocColor(ClientPtr /* client */ ); int ProcAllocColorCells(ClientPtr /* client */ ); int ProcAllocColorPlanes(ClientPtr /* client */ ); int ProcAllocNamedColor(ClientPtr /* client */ ); int ProcBell(ClientPtr /* client */ ); int ProcChangeAccessControl(ClientPtr /* client */ ); int ProcChangeCloseDownMode(ClientPtr /* client */ ); int ProcChangeGC(ClientPtr /* client */ ); int ProcChangeHosts(ClientPtr /* client */ ); int ProcChangeKeyboardControl(ClientPtr /* client */ ); int ProcChangeKeyboardMapping(ClientPtr /* client */ ); int ProcChangePointerControl(ClientPtr /* client */ ); int ProcChangeProperty(ClientPtr /* client */ ); int ProcChangeSaveSet(ClientPtr /* client */ ); int ProcChangeWindowAttributes(ClientPtr /* client */ ); int ProcCirculateWindow(ClientPtr /* client */ ); int ProcClearToBackground(ClientPtr /* client */ ); int ProcCloseFont(ClientPtr /* client */ ); int ProcConfigureWindow(ClientPtr /* client */ ); int ProcConvertSelection(ClientPtr /* client */ ); int ProcCopyArea(ClientPtr /* client */ ); int ProcCopyColormapAndFree(ClientPtr /* client */ ); int ProcCopyGC(ClientPtr /* client */ ); int ProcCopyPlane(ClientPtr /* client */ ); int ProcCreateColormap(ClientPtr /* client */ ); int ProcCreateCursor(ClientPtr /* client */ ); int ProcCreateGC(ClientPtr /* client */ ); int ProcCreateGlyphCursor(ClientPtr /* client */ ); int ProcCreatePixmap(ClientPtr /* client */ ); int ProcCreateWindow(ClientPtr /* client */ ); int ProcDeleteProperty(ClientPtr /* client */ ); int ProcDestroySubwindows(ClientPtr /* client */ ); int ProcDestroyWindow(ClientPtr /* client */ ); int ProcEstablishConnection(ClientPtr /* client */ ); int ProcFillPoly(ClientPtr /* client */ ); int ProcForceScreenSaver(ClientPtr /* client */ ); int ProcFreeColormap(ClientPtr /* client */ ); int ProcFreeColors(ClientPtr /* client */ ); int ProcFreeCursor(ClientPtr /* client */ ); int ProcFreeGC(ClientPtr /* client */ ); int ProcFreePixmap(ClientPtr /* client */ ); int ProcGetAtomName(ClientPtr /* client */ ); int ProcGetFontPath(ClientPtr /* client */ ); int ProcGetGeometry(ClientPtr /* client */ ); int ProcGetImage(ClientPtr /* client */ ); int ProcGetKeyboardControl(ClientPtr /* client */ ); int ProcGetKeyboardMapping(ClientPtr /* client */ ); int ProcGetModifierMapping(ClientPtr /* client */ ); int ProcGetMotionEvents(ClientPtr /* client */ ); int ProcGetPointerControl(ClientPtr /* client */ ); int ProcGetPointerMapping(ClientPtr /* client */ ); int ProcGetProperty(ClientPtr /* client */ ); int ProcGetScreenSaver(ClientPtr /* client */ ); int ProcGetSelectionOwner(ClientPtr /* client */ ); int ProcGetWindowAttributes(ClientPtr /* client */ ); int ProcGrabServer(ClientPtr /* client */ ); int ProcImageText16(ClientPtr /* client */ ); int ProcImageText8(ClientPtr /* client */ ); int ProcInitialConnection(ClientPtr /* client */ ); int ProcInstallColormap(ClientPtr /* client */ ); int ProcInternAtom(ClientPtr /* client */ ); int ProcKillClient(ClientPtr /* client */ ); int ProcListExtensions(ClientPtr /* client */ ); int ProcListFonts(ClientPtr /* client */ ); int ProcListFontsWithInfo(ClientPtr /* client */ ); int ProcListHosts(ClientPtr /* client */ ); int ProcListInstalledColormaps(ClientPtr /* client */ ); int ProcListProperties(ClientPtr /* client */ ); int ProcLookupColor(ClientPtr /* client */ ); int ProcMapSubwindows(ClientPtr /* client */ ); int ProcMapWindow(ClientPtr /* client */ ); int ProcNoOperation(ClientPtr /* client */ ); int ProcOpenFont(ClientPtr /* client */ ); int ProcPolyArc(ClientPtr /* client */ ); int ProcPolyFillArc(ClientPtr /* client */ ); int ProcPolyFillRectangle(ClientPtr /* client */ ); int ProcPolyLine(ClientPtr /* client */ ); int ProcPolyPoint(ClientPtr /* client */ ); int ProcPolyRectangle(ClientPtr /* client */ ); int ProcPolySegment(ClientPtr /* client */ ); int ProcPolyText(ClientPtr /* client */ ); int ProcPutImage(ClientPtr /* client */ ); int ProcQueryBestSize(ClientPtr /* client */ ); int ProcQueryColors(ClientPtr /* client */ ); int ProcQueryExtension(ClientPtr /* client */ ); int ProcQueryFont(ClientPtr /* client */ ); int ProcQueryKeymap(ClientPtr /* client */ ); int ProcQueryTextExtents(ClientPtr /* client */ ); int ProcQueryTree(ClientPtr /* client */ ); int ProcReparentWindow(ClientPtr /* client */ ); int ProcRotateProperties(ClientPtr /* client */ ); int ProcSetClipRectangles(ClientPtr /* client */ ); int ProcSetDashes(ClientPtr /* client */ ); int ProcSetFontPath(ClientPtr /* client */ ); int ProcSetModifierMapping(ClientPtr /* client */ ); int ProcSetPointerMapping(ClientPtr /* client */ ); int ProcSetScreenSaver(ClientPtr /* client */ ); int ProcSetSelectionOwner(ClientPtr /* client */ ); int ProcStoreColors(ClientPtr /* client */ ); int ProcStoreNamedColor(ClientPtr /* client */ ); int ProcTranslateCoords(ClientPtr /* client */ ); int ProcUngrabServer(ClientPtr /* client */ ); int ProcUninstallColormap(ClientPtr /* client */ ); int ProcUnmapSubwindows(ClientPtr /* client */ ); int ProcUnmapWindow(ClientPtr /* client */ ); #endif /* DISPATCH_H */ �����������������������������������������������������������������xorg-server-1.17.1/dix/swapreq.c��������������������������������������������������������������������0000664�0001751�0001751�00000060553�12456571574�013454� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include <X11/Xprotostr.h> #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" /* for SendEvent */ #include "swapreq.h" /* Thanks to Jack Palevich for testing and subsequently rewriting all this */ /* Byte swap a list of longs */ void SwapLongs(CARD32 *list, unsigned long count) { while (count >= 8) { swapl(list + 0); swapl(list + 1); swapl(list + 2); swapl(list + 3); swapl(list + 4); swapl(list + 5); swapl(list + 6); swapl(list + 7); list += 8; count -= 8; } if (count != 0) { do { swapl(list); list++; } while (--count != 0); } } /* Byte swap a list of shorts */ void SwapShorts(short *list, unsigned long count) { while (count >= 16) { swaps(list + 0); swaps(list + 1); swaps(list + 2); swaps(list + 3); swaps(list + 4); swaps(list + 5); swaps(list + 6); swaps(list + 7); swaps(list + 8); swaps(list + 9); swaps(list + 10); swaps(list + 11); swaps(list + 12); swaps(list + 13); swaps(list + 14); swaps(list + 15); list += 16; count -= 16; } if (count != 0) { do { swaps(list); list++; } while (--count != 0); } } /* The following is used for all requests that have no fields to be swapped (except "length") */ int SProcSimpleReq(ClientPtr client) { REQUEST(xReq); swaps(&stuff->length); return (*ProcVector[stuff->reqType]) (client); } /* The following is used for all requests that have only a single 32-bit field to be swapped, coming right after the "length" field */ int SProcResourceReq(ClientPtr client) { REQUEST(xResourceReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */ swapl(&stuff->id); return (*ProcVector[stuff->reqType]) (client); } int SProcCreateWindow(ClientPtr client) { REQUEST(xCreateWindowReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xCreateWindowReq); swapl(&stuff->wid); swapl(&stuff->parent); swaps(&stuff->x); swaps(&stuff->y); swaps(&stuff->width); swaps(&stuff->height); swaps(&stuff->borderWidth); swaps(&stuff->class); swapl(&stuff->visual); swapl(&stuff->mask); SwapRestL(stuff); return ((*ProcVector[X_CreateWindow]) (client)); } int SProcChangeWindowAttributes(ClientPtr client) { REQUEST(xChangeWindowAttributesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); swapl(&stuff->window); swapl(&stuff->valueMask); SwapRestL(stuff); return ((*ProcVector[X_ChangeWindowAttributes]) (client)); } int SProcReparentWindow(ClientPtr client) { REQUEST(xReparentWindowReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xReparentWindowReq); swapl(&stuff->window); swapl(&stuff->parent); swaps(&stuff->x); swaps(&stuff->y); return ((*ProcVector[X_ReparentWindow]) (client)); } int SProcConfigureWindow(ClientPtr client) { REQUEST(xConfigureWindowReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); swapl(&stuff->window); swaps(&stuff->mask); SwapRestL(stuff); return ((*ProcVector[X_ConfigureWindow]) (client)); } int SProcInternAtom(ClientPtr client) { REQUEST(xInternAtomReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xInternAtomReq); swaps(&stuff->nbytes); return ((*ProcVector[X_InternAtom]) (client)); } int SProcChangeProperty(ClientPtr client) { REQUEST(xChangePropertyReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangePropertyReq); swapl(&stuff->window); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->nUnits); switch (stuff->format) { case 8: break; case 16: SwapRestS(stuff); break; case 32: SwapRestL(stuff); break; } return ((*ProcVector[X_ChangeProperty]) (client)); } int SProcDeleteProperty(ClientPtr client) { REQUEST(xDeletePropertyReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDeletePropertyReq); swapl(&stuff->window); swapl(&stuff->property); return ((*ProcVector[X_DeleteProperty]) (client)); } int SProcGetProperty(ClientPtr client) { REQUEST(xGetPropertyReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetPropertyReq); swapl(&stuff->window); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->longOffset); swapl(&stuff->longLength); return ((*ProcVector[X_GetProperty]) (client)); } int SProcSetSelectionOwner(ClientPtr client) { REQUEST(xSetSelectionOwnerReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); swapl(&stuff->window); swapl(&stuff->selection); swapl(&stuff->time); return ((*ProcVector[X_SetSelectionOwner]) (client)); } int SProcConvertSelection(ClientPtr client) { REQUEST(xConvertSelectionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xConvertSelectionReq); swapl(&stuff->requestor); swapl(&stuff->selection); swapl(&stuff->target); swapl(&stuff->property); swapl(&stuff->time); return ((*ProcVector[X_ConvertSelection]) (client)); } int SProcSendEvent(ClientPtr client) { xEvent eventT = { .u.u.type = 0 }; EventSwapPtr proc; REQUEST(xSendEventReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSendEventReq); swapl(&stuff->destination); swapl(&stuff->eventMask); /* Swap event */ proc = EventSwapVector[stuff->event.u.u.type & 0177]; if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */ return BadValue; (*proc) (&stuff->event, &eventT); stuff->event = eventT; return ((*ProcVector[X_SendEvent]) (client)); } int SProcGrabPointer(ClientPtr client) { REQUEST(xGrabPointerReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabPointerReq); swapl(&stuff->grabWindow); swaps(&stuff->eventMask); swapl(&stuff->confineTo); swapl(&stuff->cursor); swapl(&stuff->time); return ((*ProcVector[X_GrabPointer]) (client)); } int SProcGrabButton(ClientPtr client) { REQUEST(xGrabButtonReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabButtonReq); swapl(&stuff->grabWindow); swaps(&stuff->eventMask); swapl(&stuff->confineTo); swapl(&stuff->cursor); swaps(&stuff->modifiers); return ((*ProcVector[X_GrabButton]) (client)); } int SProcUngrabButton(ClientPtr client) { REQUEST(xUngrabButtonReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabButtonReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); return ((*ProcVector[X_UngrabButton]) (client)); } int SProcChangeActivePointerGrab(ClientPtr client) { REQUEST(xChangeActivePointerGrabReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); swapl(&stuff->cursor); swapl(&stuff->time); swaps(&stuff->eventMask); return ((*ProcVector[X_ChangeActivePointerGrab]) (client)); } int SProcGrabKeyboard(ClientPtr client) { REQUEST(xGrabKeyboardReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabKeyboardReq); swapl(&stuff->grabWindow); swapl(&stuff->time); return ((*ProcVector[X_GrabKeyboard]) (client)); } int SProcGrabKey(ClientPtr client) { REQUEST(xGrabKeyReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabKeyReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); return ((*ProcVector[X_GrabKey]) (client)); } int SProcUngrabKey(ClientPtr client) { REQUEST(xUngrabKeyReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabKeyReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); return ((*ProcVector[X_UngrabKey]) (client)); } int SProcGetMotionEvents(ClientPtr client) { REQUEST(xGetMotionEventsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetMotionEventsReq); swapl(&stuff->window); swapl(&stuff->start); swapl(&stuff->stop); return ((*ProcVector[X_GetMotionEvents]) (client)); } int SProcTranslateCoords(ClientPtr client) { REQUEST(xTranslateCoordsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xTranslateCoordsReq); swapl(&stuff->srcWid); swapl(&stuff->dstWid); swaps(&stuff->srcX); swaps(&stuff->srcY); return ((*ProcVector[X_TranslateCoords]) (client)); } int SProcWarpPointer(ClientPtr client) { REQUEST(xWarpPointerReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xWarpPointerReq); swapl(&stuff->srcWid); swapl(&stuff->dstWid); swaps(&stuff->srcX); swaps(&stuff->srcY); swaps(&stuff->srcWidth); swaps(&stuff->srcHeight); swaps(&stuff->dstX); swaps(&stuff->dstY); return ((*ProcVector[X_WarpPointer]) (client)); } int SProcSetInputFocus(ClientPtr client) { REQUEST(xSetInputFocusReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetInputFocusReq); swapl(&stuff->focus); swapl(&stuff->time); return ((*ProcVector[X_SetInputFocus]) (client)); } int SProcOpenFont(ClientPtr client) { REQUEST(xOpenFontReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xOpenFontReq); swapl(&stuff->fid); swaps(&stuff->nbytes); return ((*ProcVector[X_OpenFont]) (client)); } int SProcListFonts(ClientPtr client) { REQUEST(xListFontsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xListFontsReq); swaps(&stuff->maxNames); swaps(&stuff->nbytes); return ((*ProcVector[X_ListFonts]) (client)); } int SProcListFontsWithInfo(ClientPtr client) { REQUEST(xListFontsWithInfoReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq); swaps(&stuff->maxNames); swaps(&stuff->nbytes); return ((*ProcVector[X_ListFontsWithInfo]) (client)); } int SProcSetFontPath(ClientPtr client) { REQUEST(xSetFontPathReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSetFontPathReq); swaps(&stuff->nFonts); return ((*ProcVector[X_SetFontPath]) (client)); } int SProcCreatePixmap(ClientPtr client) { REQUEST(xCreatePixmapReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreatePixmapReq); swapl(&stuff->pid); swapl(&stuff->drawable); swaps(&stuff->width); swaps(&stuff->height); return ((*ProcVector[X_CreatePixmap]) (client)); } int SProcCreateGC(ClientPtr client) { REQUEST(xCreateGCReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xCreateGCReq); swapl(&stuff->gc); swapl(&stuff->drawable); swapl(&stuff->mask); SwapRestL(stuff); return ((*ProcVector[X_CreateGC]) (client)); } int SProcChangeGC(ClientPtr client) { REQUEST(xChangeGCReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeGCReq); swapl(&stuff->gc); swapl(&stuff->mask); SwapRestL(stuff); return ((*ProcVector[X_ChangeGC]) (client)); } int SProcCopyGC(ClientPtr client) { REQUEST(xCopyGCReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyGCReq); swapl(&stuff->srcGC); swapl(&stuff->dstGC); swapl(&stuff->mask); return ((*ProcVector[X_CopyGC]) (client)); } int SProcSetDashes(ClientPtr client) { REQUEST(xSetDashesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSetDashesReq); swapl(&stuff->gc); swaps(&stuff->dashOffset); swaps(&stuff->nDashes); return ((*ProcVector[X_SetDashes]) (client)); } int SProcSetClipRectangles(ClientPtr client) { REQUEST(xSetClipRectanglesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); swapl(&stuff->gc); swaps(&stuff->xOrigin); swaps(&stuff->yOrigin); SwapRestS(stuff); return ((*ProcVector[X_SetClipRectangles]) (client)); } int SProcClearToBackground(ClientPtr client) { REQUEST(xClearAreaReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xClearAreaReq); swapl(&stuff->window); swaps(&stuff->x); swaps(&stuff->y); swaps(&stuff->width); swaps(&stuff->height); return ((*ProcVector[X_ClearArea]) (client)); } int SProcCopyArea(ClientPtr client) { REQUEST(xCopyAreaReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyAreaReq); swapl(&stuff->srcDrawable); swapl(&stuff->dstDrawable); swapl(&stuff->gc); swaps(&stuff->srcX); swaps(&stuff->srcY); swaps(&stuff->dstX); swaps(&stuff->dstY); swaps(&stuff->width); swaps(&stuff->height); return ((*ProcVector[X_CopyArea]) (client)); } int SProcCopyPlane(ClientPtr client) { REQUEST(xCopyPlaneReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyPlaneReq); swapl(&stuff->srcDrawable); swapl(&stuff->dstDrawable); swapl(&stuff->gc); swaps(&stuff->srcX); swaps(&stuff->srcY); swaps(&stuff->dstX); swaps(&stuff->dstY); swaps(&stuff->width); swaps(&stuff->height); swapl(&stuff->bitPlane); return ((*ProcVector[X_CopyPlane]) (client)); } /* The following routine is used for all Poly drawing requests (except FillPoly, which uses a different request format) */ int SProcPoly(ClientPtr client) { REQUEST(xPolyPointReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xPolyPointReq); swapl(&stuff->drawable); swapl(&stuff->gc); SwapRestS(stuff); return ((*ProcVector[stuff->reqType]) (client)); } /* cannot use SProcPoly for this one, because xFillPolyReq is longer than xPolyPointReq, and we don't want to swap the difference as shorts! */ int SProcFillPoly(ClientPtr client) { REQUEST(xFillPolyReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xFillPolyReq); swapl(&stuff->drawable); swapl(&stuff->gc); SwapRestS(stuff); return ((*ProcVector[X_FillPoly]) (client)); } int SProcPutImage(ClientPtr client) { REQUEST(xPutImageReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xPutImageReq); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->width); swaps(&stuff->height); swaps(&stuff->dstX); swaps(&stuff->dstY); /* Image should already be swapped */ return ((*ProcVector[X_PutImage]) (client)); } int SProcGetImage(ClientPtr client) { REQUEST(xGetImageReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetImageReq); swapl(&stuff->drawable); swaps(&stuff->x); swaps(&stuff->y); swaps(&stuff->width); swaps(&stuff->height); swapl(&stuff->planeMask); return ((*ProcVector[X_GetImage]) (client)); } /* ProcPolyText used for both PolyText8 and PolyText16 */ int SProcPolyText(ClientPtr client) { REQUEST(xPolyTextReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xPolyTextReq); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->x); swaps(&stuff->y); return ((*ProcVector[stuff->reqType]) (client)); } /* ProcImageText used for both ImageText8 and ImageText16 */ int SProcImageText(ClientPtr client) { REQUEST(xImageTextReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xImageTextReq); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->x); swaps(&stuff->y); return ((*ProcVector[stuff->reqType]) (client)); } int SProcCreateColormap(ClientPtr client) { REQUEST(xCreateColormapReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreateColormapReq); swapl(&stuff->mid); swapl(&stuff->window); swapl(&stuff->visual); return ((*ProcVector[X_CreateColormap]) (client)); } int SProcCopyColormapAndFree(ClientPtr client) { REQUEST(xCopyColormapAndFreeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); swapl(&stuff->mid); swapl(&stuff->srcCmap); return ((*ProcVector[X_CopyColormapAndFree]) (client)); } int SProcAllocColor(ClientPtr client) { REQUEST(xAllocColorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllocColorReq); swapl(&stuff->cmap); swaps(&stuff->red); swaps(&stuff->green); swaps(&stuff->blue); return ((*ProcVector[X_AllocColor]) (client)); } int SProcAllocNamedColor(ClientPtr client) { REQUEST(xAllocNamedColorReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq); swapl(&stuff->cmap); swaps(&stuff->nbytes); return ((*ProcVector[X_AllocNamedColor]) (client)); } int SProcAllocColorCells(ClientPtr client) { REQUEST(xAllocColorCellsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllocColorCellsReq); swapl(&stuff->cmap); swaps(&stuff->colors); swaps(&stuff->planes); return ((*ProcVector[X_AllocColorCells]) (client)); } int SProcAllocColorPlanes(ClientPtr client) { REQUEST(xAllocColorPlanesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); swapl(&stuff->cmap); swaps(&stuff->colors); swaps(&stuff->red); swaps(&stuff->green); swaps(&stuff->blue); return ((*ProcVector[X_AllocColorPlanes]) (client)); } int SProcFreeColors(ClientPtr client) { REQUEST(xFreeColorsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); swapl(&stuff->cmap); swapl(&stuff->planeMask); SwapRestL(stuff); return ((*ProcVector[X_FreeColors]) (client)); } void SwapColorItem(xColorItem * pItem) { swapl(&pItem->pixel); swaps(&pItem->red); swaps(&pItem->green); swaps(&pItem->blue); } int SProcStoreColors(ClientPtr client) { long count; xColorItem *pItem; REQUEST(xStoreColorsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xStoreColorsReq); swapl(&stuff->cmap); pItem = (xColorItem *) &stuff[1]; for (count = LengthRestB(stuff) / sizeof(xColorItem); --count >= 0;) SwapColorItem(pItem++); return ((*ProcVector[X_StoreColors]) (client)); } int SProcStoreNamedColor(ClientPtr client) { REQUEST(xStoreNamedColorReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq); swapl(&stuff->cmap); swapl(&stuff->pixel); swaps(&stuff->nbytes); return ((*ProcVector[X_StoreNamedColor]) (client)); } int SProcQueryColors(ClientPtr client) { REQUEST(xQueryColorsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xQueryColorsReq); swapl(&stuff->cmap); SwapRestL(stuff); return ((*ProcVector[X_QueryColors]) (client)); } int SProcLookupColor(ClientPtr client) { REQUEST(xLookupColorReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xLookupColorReq); swapl(&stuff->cmap); swaps(&stuff->nbytes); return ((*ProcVector[X_LookupColor]) (client)); } int SProcCreateCursor(ClientPtr client) { REQUEST(xCreateCursorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreateCursorReq); swapl(&stuff->cid); swapl(&stuff->source); swapl(&stuff->mask); swaps(&stuff->foreRed); swaps(&stuff->foreGreen); swaps(&stuff->foreBlue); swaps(&stuff->backRed); swaps(&stuff->backGreen); swaps(&stuff->backBlue); swaps(&stuff->x); swaps(&stuff->y); return ((*ProcVector[X_CreateCursor]) (client)); } int SProcCreateGlyphCursor(ClientPtr client) { REQUEST(xCreateGlyphCursorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); swapl(&stuff->cid); swapl(&stuff->source); swapl(&stuff->mask); swaps(&stuff->sourceChar); swaps(&stuff->maskChar); swaps(&stuff->foreRed); swaps(&stuff->foreGreen); swaps(&stuff->foreBlue); swaps(&stuff->backRed); swaps(&stuff->backGreen); swaps(&stuff->backBlue); return ((*ProcVector[X_CreateGlyphCursor]) (client)); } int SProcRecolorCursor(ClientPtr client) { REQUEST(xRecolorCursorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecolorCursorReq); swapl(&stuff->cursor); swaps(&stuff->foreRed); swaps(&stuff->foreGreen); swaps(&stuff->foreBlue); swaps(&stuff->backRed); swaps(&stuff->backGreen); swaps(&stuff->backBlue); return ((*ProcVector[X_RecolorCursor]) (client)); } int SProcQueryBestSize(ClientPtr client) { REQUEST(xQueryBestSizeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xQueryBestSizeReq); swapl(&stuff->drawable); swaps(&stuff->width); swaps(&stuff->height); return ((*ProcVector[X_QueryBestSize]) (client)); } int SProcQueryExtension(ClientPtr client) { REQUEST(xQueryExtensionReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xQueryExtensionReq); swaps(&stuff->nbytes); return ((*ProcVector[X_QueryExtension]) (client)); } int SProcChangeKeyboardMapping(ClientPtr client) { REQUEST(xChangeKeyboardMappingReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); SwapRestL(stuff); return ((*ProcVector[X_ChangeKeyboardMapping]) (client)); } int SProcChangeKeyboardControl(ClientPtr client) { REQUEST(xChangeKeyboardControlReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); swapl(&stuff->mask); SwapRestL(stuff); return ((*ProcVector[X_ChangeKeyboardControl]) (client)); } int SProcChangePointerControl(ClientPtr client) { REQUEST(xChangePointerControlReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangePointerControlReq); swaps(&stuff->accelNum); swaps(&stuff->accelDenum); swaps(&stuff->threshold); return ((*ProcVector[X_ChangePointerControl]) (client)); } int SProcSetScreenSaver(ClientPtr client) { REQUEST(xSetScreenSaverReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetScreenSaverReq); swaps(&stuff->timeout); swaps(&stuff->interval); return ((*ProcVector[X_SetScreenSaver]) (client)); } int SProcChangeHosts(ClientPtr client) { REQUEST(xChangeHostsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeHostsReq); swaps(&stuff->hostLength); return ((*ProcVector[X_ChangeHosts]) (client)); } int SProcRotateProperties(ClientPtr client) { REQUEST(xRotatePropertiesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq); swapl(&stuff->window); swaps(&stuff->nAtoms); swaps(&stuff->nPositions); SwapRestL(stuff); return ((*ProcVector[X_RotateProperties]) (client)); } int SProcNoOperation(ClientPtr client) { REQUEST(xReq); swaps(&stuff->length); return ((*ProcVector[X_NoOperation]) (client)); } void SwapConnClientPrefix(xConnClientPrefix * pCCP) { swaps(&pCCP->majorVersion); swaps(&pCCP->minorVersion); swaps(&pCCP->nbytesAuthProto); swaps(&pCCP->nbytesAuthString); } �����������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/main.c�����������������������������������������������������������������������0000664�0001751�0001751�00000031170�12456571574�012707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #include <version-config.h> #endif #include <X11/X.h> #include <X11/Xos.h> /* for unistd.h */ #include <X11/Xproto.h> #include <pixman.h> #include "scrnintstr.h" #include "misc.h" #include "os.h" #include "windowstr.h" #include "resource.h" #include "dixstruct.h" #include "gcstruct.h" #include "extension.h" #include "colormap.h" #include "colormapst.h" #include "cursorstr.h" #include "selection.h" #include <X11/fonts/font.h> #include "opaque.h" #include "servermd.h" #include "hotplug.h" #include "site.h" #include "dixfont.h" #include "extnsionst.h" #include "privates.h" #include "registry.h" #include "client.h" #include "exevents.h" #ifdef PANORAMIX #include "panoramiXsrv.h" #else #include "dixevents.h" /* InitEvents() */ #endif #ifdef DPMSExtension #include <X11/extensions/dpmsconst.h> #include "dpmsproc.h" #endif extern void Dispatch(void); #ifdef XQUARTZ #include <pthread.h> BOOL serverRunning = FALSE; pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; #endif int dix_main(int argc, char *argv[], char *envp[]) { int i; HWEventQueueType alwaysCheckForInput[2]; display = "0"; InitRegions(); CheckUserParameters(argc, argv, envp); CheckUserAuthorization(); InitConnectionLimits(); ProcessCommandLine(argc, argv); alwaysCheckForInput[0] = 0; alwaysCheckForInput[1] = 1; while (1) { serverGeneration++; ScreenSaverTime = defaultScreenSaverTime; ScreenSaverInterval = defaultScreenSaverInterval; ScreenSaverBlanking = defaultScreenSaverBlanking; ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; #ifdef DPMSExtension DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime; DPMSEnabled = TRUE; DPMSPowerLevel = 0; #endif InitBlockAndWakeupHandlers(); /* Perform any operating system dependent initializations you'd like */ OsInit(); if (serverGeneration == 1) { CreateWellKnownSockets(); for (i = 1; i < MAXCLIENTS; i++) clients[i] = NullClient; serverClient = calloc(sizeof(ClientRec), 1); if (!serverClient) FatalError("couldn't create server client"); InitClient(serverClient, 0, (void *) NULL); } else ResetWellKnownSockets(); clients[0] = serverClient; currentMaxClients = 1; /* clear any existing selections */ InitSelections(); /* Initialize privates before first allocation */ dixResetPrivates(); /* Initialize server client devPrivates, to be reallocated as * more client privates are registered */ if (!dixAllocatePrivates(&serverClient->devPrivates, PRIVATE_CLIENT)) FatalError("failed to create server client privates"); if (!InitClientResources(serverClient)) /* for root resources */ FatalError("couldn't init server resources"); SetInputCheck(&alwaysCheckForInput[0], &alwaysCheckForInput[1]); screenInfo.numScreens = 0; InitAtoms(); InitEvents(); InitGlyphCaching(); dixResetRegistry(); ResetFontPrivateIndex(); InitCallbackManager(); InitOutput(&screenInfo, argc, argv); if (screenInfo.numScreens < 1) 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"); if (pScreen->CreateScreenResources && !(*pScreen->CreateScreenResources) (pScreen)) FatalError("failed to create screen resources"); } for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; if (!CreateScratchPixmapsForScreen(pScreen)) FatalError("failed to create scratch pixmaps"); if (pScreen->CreateScreenResources && !(*pScreen->CreateScreenResources) (pScreen)) FatalError("failed to create screen resources"); if (!CreateGCperDepth(i)) FatalError("failed to create scratch GCs"); if (!CreateDefaultStipple(i)) FatalError("failed to create default stipple"); if (!CreateRootWindow(pScreen)) FatalError("failed to create root window"); } InitFonts(); if (SetDefaultFontPath(defaultFontPath) != Success) { ErrorF("[dix] failed to set default font path '%s'", defaultFontPath); } if (!SetDefaultFont(defaultTextFont)) { FatalError("could not open default font '%s'", defaultTextFont); } if (!(rootCursor = CreateRootCursor(NULL, 0))) { FatalError("could not open default cursor font '%s'", defaultCursorFont); } #ifdef DPMSExtension /* check all screens, looking for DPMS Capabilities */ DPMSCapableFlag = DPMSSupported(); if (!DPMSCapableFlag) DPMSEnabled = FALSE; #endif #ifdef PANORAMIX /* * Consolidate window and colourmap information for each screen */ if (!noPanoramiXExtension) PanoramiXConsolidate(); #endif for (i = 0; i < screenInfo.numScreens; i++) InitRootWindow(screenInfo.screens[i]->root); InitCoreDevices(); InitInput(argc, argv); InitAndStartDevices(); ReserveClientIds(serverClient); dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); dixCloseRegistry(); #ifdef PANORAMIX if (!noPanoramiXExtension) { if (!PanoramiXCreateConnectionBlock()) { FatalError("could not create connection block info"); } } else #endif { if (!CreateConnectionBlock()) { FatalError("could not create connection block info"); } } #ifdef XQUARTZ /* Let the other threads know the server is done with its init */ pthread_mutex_lock(&serverRunningMutex); serverRunning = TRUE; pthread_cond_broadcast(&serverRunningCond); pthread_mutex_unlock(&serverRunningMutex); #endif NotifyParentProcess(); Dispatch(); #ifdef XQUARTZ /* Let the other threads know the server is no longer running */ pthread_mutex_lock(&serverRunningMutex); serverRunning = FALSE; pthread_mutex_unlock(&serverRunningMutex); #endif UndisplayDevices(); DisableAllDevices(); /* Now free up whatever must be freed */ if (screenIsSaved == SCREEN_SAVER_ON) dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); FreeScreenSaverTimer(); CloseDownExtensions(); #ifdef PANORAMIX { Bool remember_it = noPanoramiXExtension; noPanoramiXExtension = TRUE; FreeAllResources(); noPanoramiXExtension = remember_it; } #else FreeAllResources(); #endif CloseInput(); 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(screenInfo.screens[i]); FreeGCperDepth(i); FreeDefaultStipple(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; } ReleaseClientIds(serverClient); dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT); serverClient->devPrivates = NULL; dixFreeRegistry(); FreeFonts(); FreeAllAtoms(); FreeAuditTimer(); DeleteCallbackManager(); if (dispatchException & DE_TERMINATE) { CloseWellKnownConnections(); } OsCleanup((dispatchException & DE_TERMINATE) != 0); if (dispatchException & DE_TERMINATE) { ddxGiveUp(EXIT_NO_ERROR); break; } free(ConnectionInfo); ConnectionInfo = NULL; } return 0; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/dixutils.c�������������������������������������������������������������������0000664�0001751�0001751�00000061453�12456571574�013637� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* (c)Copyright 1988,1991 Adobe Systems Incorporated. All rights reserved. Permission to use, copy, modify, distribute, and sublicense this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notices appear in all copies and that both those copyright notices and this permission notice appear in supporting documentation and that the name of Adobe Systems Incorporated not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. No trademark license to use the Adobe trademarks is hereby granted. If the Adobe trademark "Display PostScript"(tm) is used to describe this software, its functionality or for any other purpose, such use shall be limited to a statement that this software works in conjunction with the Display PostScript system. Proper trademark attribution to reflect Adobe's ownership of the trademark shall be given whenever any such reference to the Display PostScript system is made. ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE. Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems Incorporated which may be registered in certain jurisdictions. Author: Adobe Systems Incorporated */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xmd.h> #include "misc.h" #include "windowstr.h" #include "dixstruct.h" #include "pixmapstr.h" #include "gcstruct.h" #include "scrnintstr.h" #define XK_LATIN1 #include <X11/keysymdef.h> #include "xace.h" /* * CompareTimeStamps returns -1, 0, or +1 depending on if the first * argument is less than, equal to or greater than the second argument. */ int CompareTimeStamps(TimeStamp a, TimeStamp b) { if (a.months < b.months) return EARLIER; if (a.months > b.months) return LATER; if (a.milliseconds < b.milliseconds) return EARLIER; if (a.milliseconds > b.milliseconds) return LATER; return SAMETIME; } /* * convert client times to server TimeStamps */ #define HALFMONTH ((unsigned long) 1<<31) TimeStamp ClientTimeToServerTime(CARD32 c) { TimeStamp ts; if (c == CurrentTime) return currentTime; ts.months = currentTime.months; ts.milliseconds = c; if (c > currentTime.milliseconds) { if (((unsigned long) c - currentTime.milliseconds) > HALFMONTH) ts.months -= 1; } else if (c < currentTime.milliseconds) { if (((unsigned long) currentTime.milliseconds - c) > HALFMONTH) ts.months += 1; } return ts; } /* * ISO Latin-1 case conversion routine * * this routine always null-terminates the result, so * beware of too-small buffers */ static unsigned char ISOLatin1ToLower(unsigned char source) { unsigned char dest; if ((source >= XK_A) && (source <= XK_Z)) dest = source + (XK_a - XK_A); else if ((source >= XK_Agrave) && (source <= XK_Odiaeresis)) dest = source + (XK_agrave - XK_Agrave); else if ((source >= XK_Ooblique) && (source <= XK_Thorn)) dest = source + (XK_oslash - XK_Ooblique); else dest = source; return dest; } int CompareISOLatin1Lowered(const unsigned char *s1, int s1len, const unsigned char *s2, int s2len) { unsigned char c1, c2; for (;;) { /* note -- compare against zero so that -1 ignores len */ c1 = s1len-- ? *s1++ : '\0'; c2 = s2len-- ? *s2++ : '\0'; if (!c1 || (c1 != c2 && (c1 = ISOLatin1ToLower(c1)) != (c2 = ISOLatin1ToLower(c2)))) break; } return (int) c1 - (int) c2; } /* * dixLookupWindow and dixLookupDrawable: * Look up the window/drawable taking into account the client doing the * lookup, the type of drawable desired, and the type of access desired. * Return Success with *pDraw set if the window/drawable exists and the client * is allowed access, else return an error code with *pDraw set to NULL. The * access mask values are defined in resource.h. The type mask values are * defined in pixmap.h, with zero equivalent to M_DRAWABLE. */ int dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, Mask type, Mask access) { DrawablePtr pTmp; int rc; *pDraw = NULL; rc = dixLookupResourceByClass((void **) &pTmp, id, RC_DRAWABLE, client, access); if (rc != Success) client->errorValue = id; if (rc == BadValue) return BadDrawable; if (rc != Success) return rc; if (!((1 << pTmp->type) & (type ? type : M_DRAWABLE))) return BadMatch; *pDraw = pTmp; return Success; } int dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access) { int rc; rc = dixLookupDrawable((DrawablePtr *) pWin, id, client, M_WINDOW, access); /* dixLookupDrawable returns BadMatch iff id is a valid Drawable but is not a Window. Users of dixLookupWindow expect a BadWindow error in this case; they don't care that it's a valid non-Window XID */ if (rc == BadMatch) rc = BadWindow; /* Similarly, users of dixLookupWindow don't want BadDrawable. */ if (rc == BadDrawable) rc = BadWindow; return rc; } int dixLookupGC(GCPtr *pGC, XID id, ClientPtr client, Mask access) { return dixLookupResourceByType((void **) pGC, id, RT_GC, client, access); } int dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access) { int rc; GC *pGC; client->errorValue = id; /* EITHER font or gc */ rc = dixLookupResourceByType((void **) pFont, id, RT_FONT, client, access); if (rc != BadFont) return rc; rc = dixLookupResourceByType((void **) &pGC, id, RT_GC, client, access); if (rc == BadGC) return BadFont; if (rc == Success) *pFont = pGC->font; return rc; } int dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access) { void *pRes; int rc = BadValue, clientIndex = CLIENT_ID(rid); if (!clientIndex || !clients[clientIndex] || (rid & SERVER_BIT)) goto bad; rc = dixLookupResourceByClass(&pRes, rid, RC_ANY, client, DixGetAttrAccess); if (rc != Success) goto bad; rc = XaceHook(XACE_CLIENT_ACCESS, client, clients[clientIndex], access); if (rc != Success) goto bad; *pClient = clients[clientIndex]; return Success; bad: if (client) client->errorValue = rid; *pClient = NULL; return rc; } int AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, Bool toRoot, Bool map) { int numnow; SaveSetElt *pTmp = NULL; int j; numnow = client->numSaved; j = 0; if (numnow) { pTmp = client->saveSet; while ((j < numnow) && (SaveSetWindow(pTmp[j]) != (void *) pWin)) j++; } if (mode == SetModeInsert) { if (j < numnow) /* duplicate */ return Success; numnow++; pTmp = (SaveSetElt *) realloc(client->saveSet, sizeof(*pTmp) * numnow); if (!pTmp) return BadAlloc; client->saveSet = pTmp; client->numSaved = numnow; SaveSetAssignWindow(client->saveSet[numnow - 1], pWin); SaveSetAssignToRoot(client->saveSet[numnow - 1], toRoot); SaveSetAssignMap(client->saveSet[numnow - 1], map); return Success; } else if ((mode == SetModeDelete) && (j < numnow)) { while (j < numnow - 1) { pTmp[j] = pTmp[j + 1]; j++; } numnow--; if (numnow) { pTmp = (SaveSetElt *) realloc(client->saveSet, sizeof(*pTmp) * numnow); if (pTmp) client->saveSet = pTmp; } else { free(client->saveSet); client->saveSet = (SaveSetElt *) NULL; } client->numSaved = numnow; return Success; } return Success; } void DeleteWindowFromAnySaveSet(WindowPtr pWin) { int i; ClientPtr client; for (i = 0; i < currentMaxClients; i++) { client = clients[i]; if (client && client->numSaved) (void) AlterSaveSetForClient(client, pWin, SetModeDelete, FALSE, TRUE); } } /* No-op Don't Do Anything : sometimes we need to be able to call a procedure * that doesn't do anything. For example, on screen with only static * colormaps, if someone calls install colormap, it's easier to have a dummy * procedure to call than to check if there's a procedure */ void NoopDDA(void) { } typedef struct _BlockHandler { BlockHandlerProcPtr BlockHandler; WakeupHandlerProcPtr WakeupHandler; void *blockData; Bool deleted; } BlockHandlerRec, *BlockHandlerPtr; static BlockHandlerPtr handlers; static int numHandlers; static int sizeHandlers; static Bool inHandler; static Bool handlerDeleted; /** * * \param pTimeout DIX doesn't want to know how OS represents time * \param pReadMask nor how it represents the det of descriptors */ void BlockHandler(void *pTimeout, void *pReadmask) { int i, j; ++inHandler; for (i = 0; i < screenInfo.numScreens; i++) (*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, pTimeout, pReadmask); if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { for (j = i; j < numHandlers - 1; j++) handlers[j] = handlers[j + 1]; numHandlers--; } else i++; handlerDeleted = FALSE; } --inHandler; } /** * * \param result 32 bits of undefined result from the wait * \param pReadmask the resulting descriptor mask */ void WakeupHandler(int result, void *pReadmask) { int i, j; ++inHandler; for (i = numHandlers - 1; i >= 0; i--) if (!handlers[i].deleted) (*handlers[i].WakeupHandler) (handlers[i].blockData, result, pReadmask); for (i = 0; i < screenInfo.numScreens; i++) (*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) { for (j = i; j < numHandlers - 1; j++) handlers[j] = handlers[j + 1]; numHandlers--; } else i++; handlerDeleted = FALSE; } --inHandler; } /** * Reentrant with BlockHandler and WakeupHandler, except wakeup won't * get called until next time */ Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, void *blockData) { BlockHandlerPtr new; if (numHandlers >= sizeHandlers) { new = (BlockHandlerPtr) realloc(handlers, (numHandlers + 1) * sizeof(BlockHandlerRec)); if (!new) return FALSE; handlers = new; sizeHandlers = numHandlers + 1; } handlers[numHandlers].BlockHandler = blockHandler; handlers[numHandlers].WakeupHandler = wakeupHandler; handlers[numHandlers].blockData = blockData; handlers[numHandlers].deleted = FALSE; numHandlers = numHandlers + 1; return TRUE; } void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, void *blockData) { int i; for (i = 0; i < numHandlers; i++) if (handlers[i].BlockHandler == blockHandler && handlers[i].WakeupHandler == wakeupHandler && handlers[i].blockData == blockData) { if (inHandler) { handlerDeleted = TRUE; handlers[i].deleted = TRUE; } else { for (; i < numHandlers - 1; i++) handlers[i] = handlers[i + 1]; numHandlers--; } break; } } void InitBlockAndWakeupHandlers(void) { free(handlers); handlers = (BlockHandlerPtr) 0; numHandlers = 0; sizeHandlers = 0; } /* * A general work queue. Perform some task before the server * sleeps for input. */ WorkQueuePtr workQueue; static WorkQueuePtr *workQueueLast = &workQueue; void ProcessWorkQueue(void) { WorkQueuePtr q, *p; p = &workQueue; /* * Scan the work queue once, calling each function. Those * which return TRUE are removed from the queue, otherwise * they will be called again. This must be reentrant with * QueueWorkProc. */ while ((q = *p)) { if ((*q->function) (q->client, q->closure)) { /* remove q from the list */ *p = q->next; /* don't fetch until after func called */ free(q); } else { p = &q->next; /* don't fetch until after func called */ } } workQueueLast = p; } void ProcessWorkQueueZombies(void) { WorkQueuePtr q, *p; p = &workQueue; while ((q = *p)) { if (q->client && q->client->clientGone) { (void) (*q->function) (q->client, q->closure); /* remove q from the list */ *p = q->next; /* don't fetch until after func called */ free(q); } else { p = &q->next; /* don't fetch until after func called */ } } workQueueLast = p; } Bool QueueWorkProc(Bool (*function) (ClientPtr pClient, void *closure), ClientPtr client, void *closure) { WorkQueuePtr q; q = malloc(sizeof *q); if (!q) return FALSE; q->function = function; q->client = client; q->closure = closure; q->next = NULL; *workQueueLast = q; workQueueLast = &q->next; return TRUE; } /* * Manage a queue of sleeping clients, awakening them * when requested, by using the OS functions IgnoreClient * and AttendClient. Note that this *ignores* the troubles * with request data interleaving itself with events, but * we'll leave that until a later time. */ typedef struct _SleepQueue { struct _SleepQueue *next; ClientPtr client; ClientSleepProcPtr function; void *closure; } SleepQueueRec, *SleepQueuePtr; static SleepQueuePtr sleepQueue = NULL; Bool ClientSleep(ClientPtr client, ClientSleepProcPtr function, void *closure) { SleepQueuePtr q; q = malloc(sizeof *q); if (!q) return FALSE; IgnoreClient(client); q->next = sleepQueue; q->client = client; q->function = function; q->closure = closure; sleepQueue = q; return TRUE; } Bool ClientSignal(ClientPtr client) { SleepQueuePtr q; for (q = sleepQueue; q; q = q->next) if (q->client == client) { return QueueWorkProc(q->function, q->client, q->closure); } return FALSE; } void ClientWakeup(ClientPtr client) { SleepQueuePtr q, *prev; prev = &sleepQueue; while ((q = *prev)) { if (q->client == client) { *prev = q->next; free(q); if (client->clientGone) /* Oops -- new zombie cleanup code ensures this only * happens from inside CloseDownClient; don't want to * recurse here... */ /* CloseDownClient(client) */ ; else AttendClient(client); break; } prev = &q->next; } } Bool ClientIsAsleep(ClientPtr client) { SleepQueuePtr q; for (q = sleepQueue; q; q = q->next) if (q->client == client) return TRUE; return FALSE; } /* * Generic Callback Manager */ /* ===== Private Procedures ===== */ static int numCallbackListsToCleanup = 0; static CallbackListPtr **listsToCleanup = NULL; static Bool _AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { CallbackPtr cbr; cbr = malloc(sizeof(CallbackRec)); if (!cbr) return FALSE; cbr->proc = callback; cbr->data = data; cbr->next = (*pcbl)->list; cbr->deleted = FALSE; (*pcbl)->list = cbr; return TRUE; } static Bool _DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; for (pcbr = NULL, cbr = cbl->list; cbr != NULL; pcbr = cbr, cbr = cbr->next) { if ((cbr->proc == callback) && (cbr->data == data)) break; } if (cbr != NULL) { if (cbl->inCallback) { ++(cbl->numDeleted); cbr->deleted = TRUE; } else { if (pcbr == NULL) cbl->list = cbr->next; else pcbr->next = cbr->next; free(cbr); } return TRUE; } return FALSE; } void _CallCallbacks(CallbackListPtr *pcbl, void *call_data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; ++(cbl->inCallback); for (cbr = cbl->list; cbr != NULL; cbr = cbr->next) { (*(cbr->proc)) (pcbl, cbr->data, call_data); } --(cbl->inCallback); if (cbl->inCallback) return; /* Was the entire list marked for deletion? */ if (cbl->deleted) { DeleteCallbackList(pcbl); return; } /* Were some individual callbacks on the list marked for deletion? * If so, do the deletions. */ if (cbl->numDeleted) { for (pcbr = NULL, cbr = cbl->list; (cbr != NULL) && cbl->numDeleted;) { if (cbr->deleted) { if (pcbr) { cbr = cbr->next; free(pcbr->next); pcbr->next = cbr; } else { cbr = cbr->next; free(cbl->list); cbl->list = cbr; } cbl->numDeleted--; } else { /* this one wasn't deleted */ pcbr = cbr; cbr = cbr->next; } } } } static void _DeleteCallbackList(CallbackListPtr *pcbl) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, nextcbr; int i; if (cbl->inCallback) { cbl->deleted = TRUE; return; } for (i = 0; i < numCallbackListsToCleanup; i++) { if (listsToCleanup[i] == pcbl) { listsToCleanup[i] = NULL; break; } } for (cbr = cbl->list; cbr != NULL; cbr = nextcbr) { nextcbr = cbr->next; free(cbr); } free(cbl); *pcbl = NULL; } static Bool CreateCallbackList(CallbackListPtr *pcbl) { CallbackListPtr cbl; int i; if (!pcbl) return FALSE; cbl = malloc(sizeof(CallbackListRec)); if (!cbl) return FALSE; cbl->inCallback = 0; cbl->deleted = FALSE; cbl->numDeleted = 0; cbl->list = NULL; *pcbl = cbl; for (i = 0; i < numCallbackListsToCleanup; i++) { if (!listsToCleanup[i]) { listsToCleanup[i] = pcbl; return TRUE; } } listsToCleanup = (CallbackListPtr **) xnfrealloc(listsToCleanup, sizeof(CallbackListPtr *) * (numCallbackListsToCleanup + 1)); listsToCleanup[numCallbackListsToCleanup] = pcbl; numCallbackListsToCleanup++; return TRUE; } /* ===== Public Procedures ===== */ Bool AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { if (!pcbl) return FALSE; if (!*pcbl) { /* list hasn't been created yet; go create it */ if (!CreateCallbackList(pcbl)) return FALSE; } return _AddCallback(pcbl, callback, data); } Bool DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { if (!pcbl || !*pcbl) return FALSE; return _DeleteCallback(pcbl, callback, data); } void DeleteCallbackList(CallbackListPtr *pcbl) { if (!pcbl || !*pcbl) return; _DeleteCallbackList(pcbl); } void DeleteCallbackManager(void) { int i; for (i = 0; i < numCallbackListsToCleanup; i++) { DeleteCallbackList(listsToCleanup[i]); } free(listsToCleanup); numCallbackListsToCleanup = 0; listsToCleanup = NULL; } void InitCallbackManager(void) { DeleteCallbackManager(); } /** * Coordinates the global GL context used by modules in the X Server * doing rendering with OpenGL. * * When setting a GL context (glXMakeCurrent() or eglMakeCurrent()), * there is an expensive implied glFlush() required by the GLX and EGL * APIs, so modules don't want to have to do it on every request. But * the individual modules using GL also don't know about each other, * so they have to coordinate who owns the current context. * * When you're about to do a MakeCurrent, you should set this variable * to your context's address, and you can skip MakeCurrent if it's * already set to yours. * * When you're about to do a DestroyContext, you should set this to * NULL if it's set to your context. * * When you're about to do an unbindContext on a DRI driver, you * should set this to NULL. Despite the unbindContext interface * sounding like it only unbinds the passed in context, it actually * unconditionally clears the dispatch table even if the given * context wasn't current. */ void *lastGLContext = NULL; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/extension.c������������������������������������������������������������������0000664�0001751�0001751�00000023704�12456571574�014003� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" #include "gcstruct.h" #include "scrnintstr.h" #include "dispatch.h" #include "privates.h" #include "registry.h" #include "xace.h" #define LAST_ERROR 255 static ExtensionEntry **extensions = (ExtensionEntry **) NULL; int lastEvent = EXTENSION_EVENT_BASE; static int lastError = FirstExtensionError; static unsigned int NumExtensions = 0; ExtensionEntry * AddExtension(const char *name, int NumEvents, int NumErrors, int (*MainProc) (ClientPtr c1), int (*SwappedMainProc) (ClientPtr c2), void (*CloseDownProc) (ExtensionEntry * e), unsigned short (*MinorOpcodeProc) (ClientPtr c3)) { int i; ExtensionEntry *ext, **newexts; if (!MainProc || !SwappedMainProc || !MinorOpcodeProc) return ((ExtensionEntry *) NULL); if ((lastEvent + NumEvents > MAXEVENTS) || (unsigned) (lastError + NumErrors > LAST_ERROR)) { LogMessage(X_ERROR, "Not enabling extension %s: maximum number of " "events or errors exceeded.\n", name); return ((ExtensionEntry *) NULL); } ext = calloc(sizeof(ExtensionEntry), 1); if (!ext) return NULL; if (!dixAllocatePrivates(&ext->devPrivates, PRIVATE_EXTENSION)) { free(ext); return NULL; } ext->name = strdup(name); ext->num_aliases = 0; ext->aliases = (const char **) NULL; if (!ext->name) { dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION); free(ext); return ((ExtensionEntry *) NULL); } i = NumExtensions; newexts = (ExtensionEntry **) realloc(extensions, (i + 1) * sizeof(ExtensionEntry *)); if (!newexts) { free((void *) ext->name); dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION); free(ext); return ((ExtensionEntry *) NULL); } NumExtensions++; extensions = newexts; extensions[i] = ext; ext->index = i; ext->base = i + EXTENSION_BASE; ext->CloseDown = CloseDownProc; ext->MinorOpcode = MinorOpcodeProc; ProcVector[i + EXTENSION_BASE] = MainProc; SwappedProcVector[i + EXTENSION_BASE] = SwappedMainProc; if (NumEvents) { ext->eventBase = lastEvent; ext->eventLast = lastEvent + NumEvents; lastEvent += NumEvents; } else { ext->eventBase = 0; ext->eventLast = 0; } if (NumErrors) { ext->errorBase = lastError; ext->errorLast = lastError + NumErrors; lastError += NumErrors; } else { ext->errorBase = 0; ext->errorLast = 0; } #ifdef X_REGISTRY_REQUEST RegisterExtensionNames(ext); #endif return ext; } Bool AddExtensionAlias(const char *alias, ExtensionEntry * ext) { char *name; const char **aliases; if (!ext) return FALSE; aliases = realloc(ext->aliases, (ext->num_aliases + 1) * sizeof(char *)); if (!aliases) return FALSE; ext->aliases = aliases; name = strdup(alias); if (!name) return FALSE; ext->aliases[ext->num_aliases] = name; ext->num_aliases++; return TRUE; } static int FindExtension(const char *extname, int len) { int i, j; for (i = 0; i < NumExtensions; i++) { if ((strlen(extensions[i]->name) == len) && !strncmp(extname, extensions[i]->name, len)) break; for (j = extensions[i]->num_aliases; --j >= 0;) { if ((strlen(extensions[i]->aliases[j]) == len) && !strncmp(extname, extensions[i]->aliases[j], len)) break; } if (j >= 0) break; } return ((i == NumExtensions) ? -1 : i); } /* * CheckExtension returns the extensions[] entry for the requested * extension name. Maybe this could just return a Bool instead? */ ExtensionEntry * CheckExtension(const char *extname) { int n; n = FindExtension(extname, strlen(extname)); if (n != -1) return extensions[n]; else return NULL; } /* * Added as part of Xace. */ ExtensionEntry * GetExtensionEntry(int major) { if (major < EXTENSION_BASE) return NULL; major -= EXTENSION_BASE; if (major >= NumExtensions) return NULL; return extensions[major]; } unsigned short StandardMinorOpcode(ClientPtr client) { return ((xReq *) client->requestBuffer)->data; } void CloseDownExtensions(void) { int i, j; for (i = NumExtensions - 1; i >= 0; i--) { if (extensions[i]->CloseDown) extensions[i]->CloseDown(extensions[i]); NumExtensions = i; free((void *) extensions[i]->name); for (j = extensions[i]->num_aliases; --j >= 0;) free((void *) extensions[i]->aliases[j]); free(extensions[i]->aliases); dixFreePrivates(extensions[i]->devPrivates, PRIVATE_EXTENSION); free(extensions[i]); } free(extensions); extensions = (ExtensionEntry **) NULL; lastEvent = EXTENSION_EVENT_BASE; lastError = FirstExtensionError; } int ProcQueryExtension(ClientPtr client) { xQueryExtensionReply reply; int i; REQUEST(xQueryExtensionReq); REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes); reply = (xQueryExtensionReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .major_opcode = 0 }; if (!NumExtensions) reply.present = xFalse; else { i = FindExtension((char *) &stuff[1], stuff->nbytes); if (i < 0 || XaceHook(XACE_EXT_ACCESS, client, extensions[i])) reply.present = xFalse; else { reply.present = xTrue; reply.major_opcode = extensions[i]->base; reply.first_event = extensions[i]->eventBase; reply.first_error = extensions[i]->errorBase; } } WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply); return Success; } int ProcListExtensions(ClientPtr client) { xListExtensionsReply reply; char *bufptr, *buffer; int total_length = 0; REQUEST_SIZE_MATCH(xReq); reply = (xListExtensionsReply) { .type = X_Reply, .nExtensions = 0, .sequenceNumber = client->sequence, .length = 0 }; buffer = NULL; if (NumExtensions) { int i, j; for (i = 0; i < NumExtensions; i++) { /* call callbacks to find out whether to show extension */ if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success) continue; total_length += strlen(extensions[i]->name) + 1; reply.nExtensions += 1 + extensions[i]->num_aliases; for (j = extensions[i]->num_aliases; --j >= 0;) total_length += strlen(extensions[i]->aliases[j]) + 1; } reply.length = bytes_to_int32(total_length); buffer = bufptr = malloc(total_length); if (!buffer) return BadAlloc; for (i = 0; i < NumExtensions; i++) { int len; if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success) continue; *bufptr++ = len = strlen(extensions[i]->name); memmove(bufptr, extensions[i]->name, len); bufptr += len; for (j = extensions[i]->num_aliases; --j >= 0;) { *bufptr++ = len = strlen(extensions[i]->aliases[j]); memmove(bufptr, extensions[i]->aliases[j], len); bufptr += len; } } } WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); if (reply.length) WriteToClient(client, total_length, buffer); free(buffer); return Success; } ������������������������������������������������������������xorg-server-1.17.1/dix/selection.c������������������������������������������������������������������0000664�0001751�0001751�00000022632�12456571574�013753� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "windowstr.h" #include "dixstruct.h" #include "dispatch.h" #include "selection.h" #include "xace.h" /***************************************************************** * Selection Stuff * * dixLookupSelection * * Selections are global to the server. The list of selections should * not be traversed directly. Instead, use the functions listed above. * *****************************************************************/ Selection *CurrentSelections; CallbackListPtr SelectionCallback; int dixLookupSelection(Selection ** result, Atom selectionName, ClientPtr client, Mask access_mode) { Selection *pSel; int rc = BadMatch; client->errorValue = selectionName; for (pSel = CurrentSelections; pSel; pSel = pSel->next) if (pSel->selection == selectionName) break; if (pSel) rc = XaceHookSelectionAccess(client, &pSel, access_mode); *result = pSel; return rc; } void InitSelections(void) { Selection *pSel, *pNextSel; pSel = CurrentSelections; while (pSel) { pNextSel = pSel->next; dixFreeObjectWithPrivates(pSel, PRIVATE_SELECTION); pSel = pNextSel; } CurrentSelections = NULL; } static _X_INLINE void CallSelectionCallback(Selection * pSel, ClientPtr client, SelectionCallbackKind kind) { SelectionInfoRec info = { pSel, client, kind }; CallCallbacks(&SelectionCallback, &info); } void DeleteWindowFromAnySelections(WindowPtr pWin) { Selection *pSel; for (pSel = CurrentSelections; pSel; pSel = pSel->next) if (pSel->pWin == pWin) { CallSelectionCallback(pSel, NULL, SelectionWindowDestroy); pSel->pWin = (WindowPtr) NULL; pSel->window = None; pSel->client = NullClient; } } void DeleteClientFromAnySelections(ClientPtr client) { Selection *pSel; for (pSel = CurrentSelections; pSel; pSel = pSel->next) if (pSel->client == client) { CallSelectionCallback(pSel, NULL, SelectionClientClose); pSel->pWin = (WindowPtr) NULL; pSel->window = None; pSel->client = NullClient; } } int ProcSetSelectionOwner(ClientPtr client) { WindowPtr pWin = NULL; TimeStamp time; Selection *pSel; int rc; REQUEST(xSetSelectionOwnerReq); REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); UpdateCurrentTime(); time = ClientTimeToServerTime(stuff->time); /* If the client's time stamp is in the future relative to the server's time stamp, do not set the selection, just return success. */ if (CompareTimeStamps(time, currentTime) == LATER) return Success; if (stuff->window != None) { rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess); if (rc != Success) return rc; } if (!ValidAtom(stuff->selection)) { client->errorValue = stuff->selection; return BadAtom; } /* * First, see if the selection is already set... */ rc = dixLookupSelection(&pSel, stuff->selection, client, DixSetAttrAccess); if (rc == Success) { /* 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 success. */ 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; WriteEventsToClient(pSel->client, 1, &event); } } else if (rc == BadMatch) { /* * It doesn't exist, so add it... */ pSel = dixAllocateObjectWithPrivates(Selection, PRIVATE_SELECTION); if (!pSel) return BadAlloc; pSel->selection = stuff->selection; /* security creation/labeling check */ rc = XaceHookSelectionAccess(client, &pSel, DixCreateAccess | DixSetAttrAccess); if (rc != Success) { free(pSel); return rc; } pSel->next = CurrentSelections; CurrentSelections = pSel; } else return rc; pSel->lastTimeChanged = time; pSel->window = stuff->window; pSel->pWin = pWin; pSel->client = (pWin ? client : NullClient); CallSelectionCallback(pSel, client, SelectionSetOwner); return Success; } int ProcGetSelectionOwner(ClientPtr client) { int rc; Selection *pSel; xGetSelectionOwnerReply reply; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); if (!ValidAtom(stuff->id)) { client->errorValue = stuff->id; return BadAtom; } reply = (xGetSelectionOwnerReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, }; rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess); if (rc == Success) reply.owner = pSel->window; else if (rc == BadMatch) reply.owner = None; else return rc; WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply); return Success; } int ProcConvertSelection(ClientPtr client) { Bool paramsOkay; xEvent event; WindowPtr pWin; Selection *pSel; int rc; REQUEST(xConvertSelectionReq); REQUEST_SIZE_MATCH(xConvertSelectionReq); rc = dixLookupWindow(&pWin, stuff->requestor, client, DixSetAttrAccess); if (rc != Success) return rc; paramsOkay = ValidAtom(stuff->selection) && ValidAtom(stuff->target); paramsOkay &= (stuff->property == None) || ValidAtom(stuff->property); if (!paramsOkay) { client->errorValue = stuff->property; return BadAtom; } rc = dixLookupSelection(&pSel, stuff->selection, client, DixReadAccess); memset(&event, 0, sizeof(xEvent)); if (rc != Success && rc != BadMatch) return rc; else if (rc == Success && pSel->window != None) { event.u.u.type = SelectionRequest; event.u.selectionRequest.owner = pSel->window; event.u.selectionRequest.time = stuff->time; event.u.selectionRequest.requestor = stuff->requestor; event.u.selectionRequest.selection = stuff->selection; event.u.selectionRequest.target = stuff->target; event.u.selectionRequest.property = stuff->property; if (pSel->client && pSel->client != serverClient && !pSel->client->clientGone) { WriteEventsToClient(pSel->client, 1, &event); return Success; } } event.u.u.type = SelectionNotify; event.u.selectionNotify.time = stuff->time; event.u.selectionNotify.requestor = stuff->requestor; event.u.selectionNotify.selection = stuff->selection; event.u.selectionNotify.target = stuff->target; event.u.selectionNotify.property = None; WriteEventsToClient(client, 1, &event); return Success; } ������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/ffs.c������������������������������������������������������������������������0000664�0001751�0001751�00000002544�12274325511�012526� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL- ITY, 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. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef HAVE_FFS #include "dix.h" int ffs(int i) { int j; if (i == 0) return 0; for (j = 1; (i & 1) == 0; j++) i >>= 1; return j; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/touch.c����������������������������������������������������������������������0000664�0001751�0001751�00000101126�12316460131�013061� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2011 Collabra Ltd. * Copyright © 2011 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. * * Author: Daniel Stone <daniel@fooishbar.org> */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" #include "scrnintstr.h" #include "dixgrabs.h" #include "eventstr.h" #include "exevents.h" #include "exglobals.h" #include "inpututils.h" #include "eventconvert.h" #include "windowstr.h" #include "mi.h" #define TOUCH_HISTORY_SIZE 100 /* If a touch queue resize is needed, the device id's bit is set. */ static unsigned char resize_waiting[(MAXDEVICES + 7) / 8]; /** * Some documentation about touch points: * The driver submits touch events with it's own (unique) touch point ID. * The driver may re-use those IDs, the DDX doesn't care. It just passes on * the data to the DIX. In the server, the driver's ID is referred to as the * DDX id anyway. * * On a TouchBegin, we create a DDXTouchPointInfo that contains the DDX id * and the client ID that this touchpoint will have. The client ID is the * one visible on the protocol. * * TouchUpdate and TouchEnd will only be processed if there is an active * touchpoint with the same DDX id. * * The DDXTouchPointInfo struct is stored dev->last.touches. When the event * being processed, it becomes a TouchPointInfo in dev->touch-touches which * contains amongst other things the sprite trace and delivery information. */ /** * Check which devices need a bigger touch event queue and grow their * last.touches by half it's current size. * * @param client Always the serverClient * @param closure Always NULL * * @return Always True. If we fail to grow we probably will topple over soon * anyway and re-executing this won't help. */ static Bool TouchResizeQueue(ClientPtr client, void *closure) { int i; OsBlockSignals(); /* first two ids are reserved */ for (i = 2; i < MAXDEVICES; i++) { DeviceIntPtr dev; DDXTouchPointInfoPtr tmp; size_t size; if (!BitIsOn(resize_waiting, i)) continue; ClearBit(resize_waiting, i); /* device may have disappeared by now */ dixLookupDevice(&dev, i, serverClient, DixWriteAccess); if (!dev) continue; /* Need to grow the queue means dropping events. Grow sufficiently so we * don't need to do it often */ size = dev->last.num_touches + dev->last.num_touches / 2 + 1; tmp = realloc(dev->last.touches, size * sizeof(*dev->last.touches)); if (tmp) { int j; dev->last.touches = tmp; for (j = dev->last.num_touches; j < size; j++) TouchInitDDXTouchPoint(dev, &dev->last.touches[j]); dev->last.num_touches = size; } } OsReleaseSignals(); return TRUE; } /** * Given the DDX-facing ID (which is _not_ DeviceEvent::detail.touch), find the * associated DDXTouchPointInfoRec. * * @param dev The device to create the touch point for * @param ddx_id Touch id assigned by the driver/ddx * @param create Create the touchpoint if it cannot be found */ DDXTouchPointInfoPtr TouchFindByDDXID(DeviceIntPtr dev, uint32_t ddx_id, Bool create) { DDXTouchPointInfoPtr ti; int i; if (!dev->touch) return NULL; for (i = 0; i < dev->last.num_touches; i++) { ti = &dev->last.touches[i]; if (ti->active && ti->ddx_id == ddx_id) return ti; } return create ? TouchBeginDDXTouch(dev, ddx_id) : NULL; } /** * Given a unique DDX ID for a touchpoint, create a touchpoint record and * return it. * * If no other touch points are active, mark new touchpoint for pointer * emulation. * * Returns NULL on failure (i.e. if another touch with that ID is already active, * allocation failure). */ DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id) { static int next_client_id = 1; int i; TouchClassPtr t = dev->touch; DDXTouchPointInfoPtr ti = NULL; 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)) return NULL; for (i = 0; i < dev->last.num_touches; i++) { /* Only emulate pointer events on the first touch */ if (dev->last.touches[i].active) emulate_pointer = FALSE; else if (!ti) /* ti is now first non-active touch rec */ ti = &dev->last.touches[i]; if (!emulate_pointer && ti) break; } if (ti) { int client_id; ti->active = TRUE; ti->ddx_id = ddx_id; client_id = next_client_id; next_client_id++; if (next_client_id == 0) next_client_id = 1; ti->client_id = client_id; ti->emulate_pointer = emulate_pointer; return ti; } /* 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. */ 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); } return NULL; } void TouchEndDDXTouch(DeviceIntPtr dev, DDXTouchPointInfoPtr ti) { TouchClassPtr t = dev->touch; if (!t) return; ti->active = FALSE; } void TouchInitDDXTouchPoint(DeviceIntPtr dev, DDXTouchPointInfoPtr ddxtouch) { memset(ddxtouch, 0, sizeof(*ddxtouch)); ddxtouch->valuators = valuator_mask_new(dev->valuator->numAxes); } Bool TouchInitTouchPoint(TouchClassPtr t, ValuatorClassPtr v, int index) { TouchPointInfoPtr ti; if (index >= t->num_touches) return FALSE; ti = &t->touches[index]; memset(ti, 0, sizeof(*ti)); ti->valuators = valuator_mask_new(v->numAxes); if (!ti->valuators) return FALSE; ti->sprite.spriteTrace = calloc(32, sizeof(*ti->sprite.spriteTrace)); if (!ti->sprite.spriteTrace) { valuator_mask_free(&ti->valuators); return FALSE; } ti->sprite.spriteTraceSize = 32; ti->sprite.spriteTrace[0] = screenInfo.screens[0]->root; ti->sprite.hot.pScreen = screenInfo.screens[0]; ti->sprite.hotPhys.pScreen = screenInfo.screens[0]; ti->client_id = -1; return TRUE; } void TouchFreeTouchPoint(DeviceIntPtr device, int index) { TouchPointInfoPtr ti; int i; if (!device->touch || index >= device->touch->num_touches) return; ti = &device->touch->touches[index]; if (ti->active) TouchEndTouch(device, ti); for (i = 0; i < ti->num_listeners; i++) TouchRemoveListener(ti, ti->listeners[0].listener); valuator_mask_free(&ti->valuators); free(ti->sprite.spriteTrace); ti->sprite.spriteTrace = NULL; free(ti->listeners); ti->listeners = NULL; free(ti->history); ti->history = NULL; ti->history_size = 0; ti->history_elements = 0; } /** * Given a client-facing ID (e.g. DeviceEvent::detail.touch), find the * associated TouchPointInfoRec. */ TouchPointInfoPtr TouchFindByClientID(DeviceIntPtr dev, uint32_t client_id) { TouchClassPtr t = dev->touch; TouchPointInfoPtr ti; int i; if (!t) return NULL; for (i = 0; i < t->num_touches; i++) { ti = &t->touches[i]; if (ti->active && ti->client_id == client_id) return ti; } return NULL; } /** * Given a unique ID for a touchpoint, create a touchpoint record in the * server. * * Returns NULL on failure (i.e. if another touch with that ID is already active, * allocation failure). */ TouchPointInfoPtr TouchBeginTouch(DeviceIntPtr dev, int sourceid, uint32_t touchid, Bool emulate_pointer) { int i; TouchClassPtr t = dev->touch; TouchPointInfoPtr ti; void *tmp; if (!t) return NULL; /* Look for another active touchpoint with the same client ID. It's * technically legitimate for a touchpoint to still exist with the same * ID but only once the 32 bits wrap over and you've used up 4 billion * touch ids without lifting that one finger off once. In which case * you deserve a medal or something, but not error handling code. */ if (TouchFindByClientID(dev, touchid)) return NULL; try_find_touch: for (i = 0; i < t->num_touches; i++) { ti = &t->touches[i]; if (!ti->active) { ti->active = TRUE; ti->client_id = touchid; ti->sourceid = sourceid; ti->emulate_pointer = emulate_pointer; return ti; } } /* If we get here, then we've run out of touches: enlarge dev->touch and * try again. */ tmp = realloc(t->touches, (t->num_touches + 1) * sizeof(*ti)); if (tmp) { t->touches = tmp; t->num_touches++; if (TouchInitTouchPoint(t, dev->valuator, t->num_touches - 1)) goto try_find_touch; } return NULL; } /** * Releases a touchpoint for use: this must only be called after all events * related to that touchpoint have been sent and finalised. Called from * ProcessTouchEvent and friends. Not by you. */ void TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti) { int i; if (ti->emulate_pointer) { GrabPtr grab; if ((grab = dev->deviceGrab.grab)) { if (dev->deviceGrab.fromPassiveGrab && !dev->button->buttonsDown && !dev->touch->buttonsDown && GrabIsPointerGrab(grab)) (*dev->deviceGrab.DeactivateGrab) (dev); } } for (i = 0; i < ti->num_listeners; i++) TouchRemoveListener(ti, ti->listeners[0].listener); ti->active = FALSE; ti->pending_finish = FALSE; ti->sprite.spriteTraceGood = 0; free(ti->listeners); ti->listeners = NULL; ti->num_listeners = 0; ti->num_grabs = 0; ti->client_id = 0; TouchEventHistoryFree(ti); valuator_mask_zero(ti->valuators); } /** * Allocate the event history for this touch pointer. Calling this on a * touchpoint that already has an event history does nothing but counts as * as success. * * @return TRUE on success, FALSE on allocation errors */ Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti) { if (ti->history) return TRUE; ti->history = calloc(TOUCH_HISTORY_SIZE, sizeof(*ti->history)); ti->history_elements = 0; if (ti->history) ti->history_size = TOUCH_HISTORY_SIZE; return ti->history != NULL; } void TouchEventHistoryFree(TouchPointInfoPtr ti) { free(ti->history); ti->history = NULL; ti->history_size = 0; ti->history_elements = 0; } /** * Store the given event on the event history (if one exists) * A touch event history consists of one TouchBegin and several TouchUpdate * events (if applicable) but no TouchEnd event. * If more than one TouchBegin is pushed onto the stack, the push is * ignored, calling this function multiple times for the TouchBegin is * valid. */ void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev) { if (!ti->history) return; switch (ev->type) { case ET_TouchBegin: /* don't store the same touchbegin twice */ if (ti->history_elements > 0) return; break; case ET_TouchUpdate: break; case ET_TouchEnd: return; /* no TouchEnd events in the history */ default: return; } /* We only store real events in the history */ if (ev->flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING)) return; ti->history[ti->history_elements++] = *ev; /* FIXME: proper overflow fixes */ if (ti->history_elements > ti->history_size - 1) { ti->history_elements = ti->history_size - 1; DebugF("source device %d: history size %d overflowing for touch %u\n", ti->sourceid, ti->history_size, ti->client_id); } } void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource) { int i; if (!ti->history) return; TouchDeliverDeviceClassesChangedEvent(ti, ti->history[0].time, resource); for (i = 0; i < ti->history_elements; i++) { DeviceEvent *ev = &ti->history[i]; ev->flags |= TOUCH_REPLAYING; ev->resource = resource; /* FIXME: We're replaying ti->history which contains the TouchBegin + all TouchUpdates for ti. This needs to be passed on to the next listener. If that is a touch listener, everything is dandy. If the TouchBegin however triggers a sync passive grab, the TouchUpdate events must be sent to EnqueueEvent so the events end up in syncEvents.pending to be forwarded correctly in a subsequent ComputeFreeze(). However, if we just send them to EnqueueEvent the sync'ing device prevents handling of touch events for ownership listeners who want the events right here, right now. */ dev->public.processInputProc((InternalEvent*)ev, dev); } } 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) { int i; TouchClassPtr t = dev->touch; WindowPtr *trace; SpritePtr srcsprite; /* All touches should have the same sprite trace, so find and reuse an * existing touch's sprite if possible, else use the device's sprite. */ for (i = 0; i < t->num_touches; i++) if (!t->touches[i].pending_finish && t->touches[i].sprite.spriteTraceGood > 0) break; if (i < t->num_touches) srcsprite = &t->touches[i].sprite; else if (dev->spriteInfo->sprite) srcsprite = dev->spriteInfo->sprite; else return FALSE; if (srcsprite->spriteTraceGood > sprite->spriteTraceSize) { trace = realloc(sprite->spriteTrace, srcsprite->spriteTraceSize * sizeof(*trace)); if (!trace) { sprite->spriteTraceGood = 0; return FALSE; } sprite->spriteTrace = trace; sprite->spriteTraceSize = srcsprite->spriteTraceGood; } memcpy(sprite->spriteTrace, srcsprite->spriteTrace, srcsprite->spriteTraceGood * sizeof(*trace)); sprite->spriteTraceGood = srcsprite->spriteTraceGood; return TRUE; } /** * Ensure a window trace is present in ti->sprite, constructing one for * TouchBegin events. */ Bool TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, InternalEvent *ev) { TouchClassPtr t = sourcedev->touch; SpritePtr sprite = &ti->sprite; if (t->mode == XIDirectTouch) { /* Focus immediately under the touchpoint in direct touch mode. * XXX: Do we need to handle crossing screens here? */ sprite->spriteTrace[0] = sourcedev->spriteInfo->sprite->hotPhys.pScreen->root; XYToWindow(sprite, ev->device_event.root_x, ev->device_event.root_y); } else if (!TouchBuildDependentSpriteTrace(sourcedev, sprite)) return FALSE; if (sprite->spriteTraceGood <= 0) return FALSE; /* Mark which grabs/event selections we're delivering to: max one grab per * 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; } ti->num_listeners = 0; return TRUE; } /** * Copy the touch event into the pointer_event, switching the required * fields to make it a correct pointer event. * * @param event The original touch event * @param[in] motion_event The respective motion event * @param[in] button_event The respective button event (if any) * * @returns The number of converted events. * @retval 0 An error occured * @retval 1 only the motion event is valid * @retval 2 motion and button event are valid */ int TouchConvertToPointerEvent(const InternalEvent *event, InternalEvent *motion_event, InternalEvent *button_event) { int ptrtype; int nevents = 0; BUG_RETURN_VAL(!event, 0); BUG_RETURN_VAL(!motion_event, 0); switch (event->any.type) { case ET_TouchUpdate: nevents = 1; break; case ET_TouchBegin: nevents = 2; /* motion + press */ ptrtype = ET_ButtonPress; break; case ET_TouchEnd: nevents = 2; /* motion + release */ ptrtype = ET_ButtonRelease; break; default: BUG_WARN_MSG(1, "Invalid event type %d\n", event->any.type); return 0; } BUG_WARN_MSG(!(event->device_event.flags & TOUCH_POINTER_EMULATED), "Non-emulating touch event\n"); motion_event->device_event = event->device_event; motion_event->any.type = ET_Motion; motion_event->device_event.detail.button = 0; motion_event->device_event.flags = XIPointerEmulated; if (nevents > 1) { BUG_RETURN_VAL(!button_event, 0); button_event->device_event = event->device_event; button_event->any.type = ptrtype; button_event->device_event.flags = XIPointerEmulated; /* detail is already correct */ } return nevents; } /** * Return the corresponding pointer emulation internal event type for the given * touch event or 0 if no such event type exists. */ int TouchGetPointerEventType(const InternalEvent *event) { int type = 0; switch (event->any.type) { case ET_TouchBegin: type = ET_ButtonPress; break; case ET_TouchUpdate: type = ET_Motion; break; case ET_TouchEnd: type = ET_ButtonRelease; break; default: break; } return type; } /** * @returns TRUE if the specified grab or selection is the current owner of * the touch sequence. */ Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource) { return (ti->listeners[0].listener == resource); } /** * Add the resource to this touch's listeners. */ void TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type, enum InputLevel level, enum TouchListenerType type, enum TouchListenerState state, WindowPtr window, const GrabPtr grab) { GrabPtr g = NULL; /* We need a copy of the grab, not the grab itself since that may be * deleted by a UngrabButton request and leaves us with a dangling * pointer */ if (grab) g = AllocGrab(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 = g; if (grab) ti->num_grabs++; ti->num_listeners++; } /** * Remove the resource from this touch's listeners. * * @return TRUE if the resource was removed, FALSE if the resource was not * in the list */ Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource) { int i; for (i = 0; i < ti->num_listeners; i++) { int j; TouchListener *listener = &ti->listeners[i]; if (listener->listener != resource) continue; if (listener->grab) { FreeGrab(listener->grab); listener->grab = NULL; ti->num_grabs--; } for (j = i; j < ti->num_listeners - 1; j++) ti->listeners[j] = ti->listeners[j + 1]; ti->num_listeners--; ti->listeners[ti->num_listeners].listener = 0; ti->listeners[ti->num_listeners].state = LISTENER_AWAITING_BEGIN; return TRUE; } return FALSE; } static void TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, GrabPtr grab) { enum TouchListenerType type = LISTENER_GRAB; /* FIXME: owner_events */ if (grab->grabtype == XI2) { if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchOwnership)) TouchEventHistoryAllocate(ti); if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin)) type = LISTENER_POINTER_GRAB; } else if (grab->grabtype == XI || grab->grabtype == CORE) { TouchEventHistoryAllocate(ti); type = LISTENER_POINTER_GRAB; } /* 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); } /** * Add one listener if there is a grab on the given window. */ static void TouchAddPassiveGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti, WindowPtr win, InternalEvent *ev) { GrabPtr grab; Bool check_core = IsMaster(dev) && ti->emulate_pointer; /* FIXME: make CheckPassiveGrabsOnWindow only trigger on TouchBegin */ grab = CheckPassiveGrabsOnWindow(win, dev, ev, check_core, FALSE); if (!grab) return; TouchAddGrabListener(dev, ti, ev, grab); } static Bool TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, WindowPtr win, InternalEvent *ev) { InputClients *iclients = NULL; OtherInputMasks *inputMasks = NULL; uint16_t evtype = 0; /* may be event type or emulated event type */ enum TouchListenerType type = LISTENER_REGULAR; int mask; evtype = GetXI2Type(ev->any.type); mask = EventIsDeliverable(dev, ev->any.type, win); if (!mask && !ti->emulate_pointer) return FALSE; else if (!mask) { /* now try for pointer event */ mask = EventIsDeliverable(dev, TouchGetPointerEventType(ev), win); if (mask) { evtype = GetXI2Type(TouchGetPointerEventType(ev)); type = LISTENER_POINTER_REGULAR; } } if (!mask) return FALSE; inputMasks = wOtherInputMasks(win); if (mask & EVENT_XI2_MASK) { nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { if (!xi2mask_isset(iclients->xi2mask, dev, evtype)) continue; if (!xi2mask_isset(iclients->xi2mask, dev, XI_TouchOwnership)) TouchEventHistoryAllocate(ti); TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI2, type, LISTENER_AWAITING_BEGIN, win, NULL); return TRUE; } } if (mask & EVENT_XI1_MASK) { int xitype = GetXIType(TouchGetPointerEventType(ev)); Mask xi_filter = event_get_filter_from_type(dev, xitype); nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { if (!(iclients->mask[dev->id] & xi_filter)) continue; TouchEventHistoryAllocate(ti); TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI, LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN, win, NULL); return TRUE; } } if (mask & EVENT_CORE_MASK) { int coretype = GetCoreType(TouchGetPointerEventType(ev)); Mask core_filter = event_get_filter_from_type(dev, coretype); OtherClients *oclients; /* window owner */ if (IsMaster(dev) && (win->eventMask & core_filter)) { TouchEventHistoryAllocate(ti); TouchAddListener(ti, win->drawable.id, RT_WINDOW, CORE, LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN, win, NULL); return TRUE; } /* all others */ nt_list_for_each_entry(oclients, wOtherClients(win), next) { if (!(oclients->mask & core_filter)) continue; TouchEventHistoryAllocate(ti); TouchAddListener(ti, oclients->resource, RT_OTHERCLIENT, CORE, type, LISTENER_AWAITING_BEGIN, win, NULL); return TRUE; } } return FALSE; } static void TouchAddActiveGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, GrabPtr grab) { if (!ti->emulate_pointer && (grab->grabtype == CORE || grab->grabtype == XI)) return; if (!ti->emulate_pointer && grab->grabtype == XI2 && !xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin)) return; TouchAddGrabListener(dev, ti, ev, grab); } void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev) { int i; SpritePtr sprite = &ti->sprite; WindowPtr win; if (dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab) TouchAddActiveGrabListener(dev, ti, ev, dev->deviceGrab.grab); /* We set up an active touch listener for existing touches, but not any * passive grab or regular listeners. */ if (ev->any.type != ET_TouchBegin) return; /* First, find all grabbing clients from the root window down * to the deepest child window. */ for (i = 0; i < sprite->spriteTraceGood; i++) { win = sprite->spriteTrace[i]; TouchAddPassiveGrabListener(dev, ti, win, ev); } /* Find the first client with an applicable event selection, * going from deepest child window back up to the root window. */ for (i = sprite->spriteTraceGood - 1; i >= 0; i--) { Bool delivered; win = sprite->spriteTrace[i]; delivered = TouchAddRegularListener(dev, ti, win, ev); if (delivered) return; } } /** * Remove the touch pointer grab from the device. Called from * DeactivatePointerGrab() */ void TouchRemovePointerGrab(DeviceIntPtr dev) { TouchPointInfoPtr ti; GrabPtr grab; DeviceEvent *ev; if (!dev->touch) return; grab = dev->deviceGrab.grab; if (!grab) return; ev = dev->deviceGrab.sync.event; if (!IsTouchEvent((InternalEvent *) ev)) return; 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 * need to walk all the touches and remove this grab from any delivery * lists. */ void TouchListenerGone(XID resource) { TouchPointInfoPtr ti; DeviceIntPtr dev; InternalEvent *events = InitEventList(GetMaximumEventsNum()); int i, j, k, nev; if (!events) FatalError("TouchListenerGone: couldn't allocate events\n"); for (dev = inputInfo.devices; dev; dev = dev->next) { if (!dev->touch) continue; for (i = 0; i < dev->touch->num_touches; i++) { ti = &dev->touch->touches[i]; if (!ti->active) continue; for (j = 0; j < ti->num_listeners; j++) { if (CLIENT_BITS(ti->listeners[j].listener) != resource) continue; nev = GetTouchOwnershipEvents(events, dev, ti, XIRejectTouch, ti->listeners[j].listener, 0); for (k = 0; k < nev; k++) mieqProcessDeviceEvent(dev, events + k, NULL); break; } } } FreeEventList(events, GetMaximumEventsNum()); } int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener, int mode) { InternalEvent *events; int nev; int i; BUG_RETURN_VAL(listener < 0, BadMatch); BUG_RETURN_VAL(listener >= ti->num_listeners, BadMatch); if (listener > 0) { if (mode == XIRejectTouch) TouchRejected(dev, ti, ti->listeners[listener].listener, NULL); else ti->listeners[listener].state = LISTENER_EARLY_ACCEPT; return Success; } events = InitEventList(GetMaximumEventsNum()); BUG_RETURN_VAL_MSG(!events, BadAlloc, "Failed to allocate touch ownership events\n"); nev = GetTouchOwnershipEvents(events, dev, ti, mode, ti->listeners[0].listener, 0); BUG_WARN_MSG(nev == 0, "Failed to get touch ownership events\n"); for (i = 0; i < nev; i++) mieqProcessDeviceEvent(dev, events + i, NULL); FreeEventList(events, GetMaximumEventsNum()); return nev ? Success : BadMatch; } int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode, uint32_t touchid, Window grab_window, XID *error) { TouchPointInfoPtr ti; int i; if (!dev->touch) { *error = dev->id; return BadDevice; } ti = TouchFindByClientID(dev, touchid); if (!ti) { *error = touchid; return BadValue; } for (i = 0; i < ti->num_listeners; i++) { if (CLIENT_ID(ti->listeners[i].listener) == client->index && ti->listeners[i].window->drawable.id == grab_window) break; } if (i == ti->num_listeners) return BadAccess; 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()); } /** * Generate and deliver a TouchEnd event. * * @param dev The device to deliver the event for. * @param ti The touch point record to deliver the event for. * @param flags Internal event flags. The called does not need to provide * TOUCH_CLIENT_ID and TOUCH_POINTER_EMULATED, this function will ensure * they are set appropriately. * @param resource The client resource to deliver to, or 0 for all clients. */ void TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource) { InternalEvent event; /* We're not processing a touch end for a frozen device */ if (dev->deviceGrab.sync.frozen) return; flags |= TOUCH_CLIENT_ID; if (ti->emulate_pointer) flags |= TOUCH_POINTER_EMULATED; TouchDeliverDeviceClassesChangedEvent(ti, GetTimeInMillis(), resource); GetDixTouchEnd(&event, dev, ti, flags); DeliverTouchEvents(dev, ti, &event, resource); if (ti->num_grabs == 0) UpdateDeviceState(dev, &event.device_event); } void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid) { TouchPointInfoPtr ti = TouchFindByClientID(dev, touchid); if (!ti) return; TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch); if (ti->pending_finish) TouchEmitTouchEnd(dev, ti, 0, 0); if (ti->num_listeners <= 1) TouchEndTouch(dev, ti); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/resource.c�������������������������������������������������������������������0000664�0001751�0001751�00000115262�12456571574�013617� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ********************************************************/ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ /* XSERVER_DTRACE additions: * Copyright (c) 2005-2006, Oracle and/or its affiliates. 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 (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. */ /* Routines to manage various kinds of resources: * * CreateNewResourceType, CreateNewResourceClass, InitClientResources, * FakeClientID, AddResource, FreeResource, FreeClientResources, * FreeAllResources, LookupIDByType, LookupIDByClass, GetXIDRange */ /* * A resource ID is a 32 bit quantity, the upper 2 bits of which are * off-limits for client-visible resources. The next 8 bits are * used as client ID, and the low 22 bits come from the client. * A resource ID is "hashed" by extracting and xoring subfields * (varying with the size of the hash table). * * It is sometimes necessary for the server to create an ID that looks * like it belongs to a client. This ID, however, must not be one * the client actually can create, or we have the potential for conflict. * The 31st bit of the ID is reserved for the server's use for this * purpose. By setting CLIENT_ID(id) to the client, the SERVER_BIT to * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a * resource "owned" by the client. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include "misc.h" #include "os.h" #include "resource.h" #include "dixstruct.h" #include "opaque.h" #include "windowstr.h" #include "dixfont.h" #include "colormap.h" #include "inputstr.h" #include "dixevents.h" #include "dixgrabs.h" #include "cursor.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #include "xace.h" #include <assert.h> #include "registry.h" #include "gcstruct.h" #ifdef XSERVER_DTRACE #include <sys/types.h> typedef const char *string; #include "Xserver-dtrace.h" #define TypeNameString(t) LookupResourceName(t) #endif static void RebuildTable(int /*client */ ); #define SERVER_MINID 32 #define INITBUCKETS 64 #define INITHASHSIZE 6 #define MAXHASHSIZE 11 typedef struct _Resource { struct _Resource *next; XID id; RESTYPE type; void *value; } ResourceRec, *ResourcePtr; typedef struct _ClientResource { ResourcePtr *resources; int elements; int buckets; int hashsize; /* log(2)(buckets) */ XID fakeID; XID endFakeID; } ClientResourceRec; RESTYPE lastResourceType; static RESTYPE lastResourceClass; 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(void *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(void *value, FindAllRes func, void *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(void *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(void *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(void *value, FindAllRes func, void *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(void *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(void *value, FindAllRes func, void *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, }, }; CallbackListPtr ResourceStateCallback; static _X_INLINE void CallResourceStateCallback(ResourceState state, ResourceRec * res) { if (ResourceStateCallback) { ResourceStateInfoRec rsi = { state, res->id, res->type, res->value }; CallCallbacks(&ResourceStateCallback, &rsi); } } RESTYPE CreateNewResourceType(DeleteType deleteFunc, const char *name) { RESTYPE next = lastResourceType + 1; struct ResourceType *types; if (next & lastResourceClass) return 0; types = realloc(resourceTypes, (next + 1) * sizeof(*resourceTypes)); if (!types) return 0; lastResourceType = next; resourceTypes = types; resourceTypes[next].deleteFunc = deleteFunc; resourceTypes[next].sizeFunc = GetDefaultBytes; resourceTypes[next].findSubResFunc = DefaultFindSubRes; resourceTypes[next].errorValue = BadValue; #if X_REGISTRY_RESOURCE /* Called even if name is NULL, to remove any previous entry */ RegisterResourceName(next, name); #endif 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) { resourceTypes[type & TypeMask].errorValue = errorValue; } RESTYPE CreateNewResourceClass(void) { RESTYPE next = lastResourceClass >> 1; if (next & lastResourceType) return 0; lastResourceClass = next; TypeMask = next - 1; return next; } static ClientResourceRec clientTable[MAXCLIENTS]; /***************** * InitClientResources * When a new client is created, call this to allocate space * in resource table *****************/ Bool InitClientResources(ClientPtr client) { int i, j; if (client == serverClient) { lastResourceType = RT_LASTPREDEF; lastResourceClass = RC_LASTPREDEF; TypeMask = RC_LASTPREDEF - 1; free(resourceTypes); resourceTypes = malloc(sizeof(predefTypes)); if (!resourceTypes) return FALSE; memcpy(resourceTypes, predefTypes, sizeof(predefTypes)); } clientTable[i = client->index].resources = malloc(INITBUCKETS * sizeof(ResourcePtr)); if (!clientTable[i].resources) return FALSE; clientTable[i].buckets = INITBUCKETS; clientTable[i].elements = 0; clientTable[i].hashsize = INITHASHSIZE; /* Many IDs allocated from the server client are visible to clients, * so we don't use the SERVER_BIT for them, but we have to start * past the magic value constants used in the protocol. For normal * clients, we can start from zero, with SERVER_BIT set. */ clientTable[i].fakeID = client->clientAsMask | (client->index ? SERVER_BIT : SERVER_MINID); clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1; for (j = 0; j < INITBUCKETS; j++) { clientTable[i].resources[j] = NULL; } return TRUE; } int HashResourceID(XID id, int numBits) { id &= RESOURCE_ID_MASK; switch (numBits) { case 6: return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12)))); case 7: return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); case 8: return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); case 9: return ((int)(0x1FF & (id ^ (id>>9)))); case 10: return ((int)(0x3FF & (id ^ (id>>10)))); case 11: return ((int)(0x7FF & (id ^ (id>>11)))); } if (numBits >= 11) return ((int)(0x7FF & (id ^ (id>>11)))); else { assert(numBits >= 0); return id & ~((~0) << numBits); } } static XID AvailableID(int client, XID id, XID maxid, XID goodid) { ResourcePtr res; if ((goodid >= id) && (goodid <= maxid)) return goodid; for (; id <= maxid; id++) { res = clientTable[client].resources[HashResourceID(id, clientTable[client].hashsize)]; while (res && (res->id != id)) res = res->next; if (!res) return id; } return 0; } void GetXIDRange(int client, Bool server, XID *minp, XID *maxp) { XID id, maxid; ResourcePtr *resp; ResourcePtr res; int i; XID goodid; id = (Mask) client << CLIENTOFFSET; if (server) id |= client ? SERVER_BIT : SERVER_MINID; maxid = id | RESOURCE_ID_MASK; goodid = 0; for (resp = clientTable[client].resources, i = clientTable[client].buckets; --i >= 0;) { for (res = *resp++; res; res = res->next) { if ((res->id < id) || (res->id > maxid)) continue; if (((res->id - id) >= (maxid - res->id)) ? (goodid = AvailableID(client, id, res->id - 1, goodid)) : !(goodid = AvailableID(client, res->id + 1, maxid, goodid))) maxid = res->id - 1; else id = res->id + 1; } } if (id > maxid) id = maxid = 0; *minp = id; *maxp = maxid; } /** * GetXIDList is called by the XC-MISC extension's MiscGetXIDList function. * This function tries to find count unused XIDs for the given client. It * puts the IDs in the array pids and returns the number found, which should * almost always be the number requested. * * The circumstances that lead to a call to this function are very rare. * Xlib must run out of IDs while trying to generate a request that wants * multiple ID's, like the Multi-buffering CreateImageBuffers request. * * No rocket science in the implementation; just iterate over all * possible IDs for the given client and pick the first count IDs * that aren't in use. A more efficient algorithm could probably be * invented, but this will be used so rarely that this should suffice. */ unsigned int GetXIDList(ClientPtr pClient, unsigned count, XID *pids) { unsigned int found = 0; XID rc, id = pClient->clientAsMask; XID maxid; void *val; maxid = id | RESOURCE_ID_MASK; while ((found < count) && (id <= maxid)) { rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient, DixGetAttrAccess); if (rc == BadValue) { pids[found++] = id; } id++; } return found; } /* * Return the next usable fake client ID. * * Normally this is just the next one in line, but if we've used the last * in the range, we need to find a new range of safe IDs to avoid * over-running another client. */ XID FakeClientID(int client) { XID id, maxid; id = clientTable[client].fakeID++; if (id != clientTable[client].endFakeID) return id; GetXIDRange(client, TRUE, &id, &maxid); if (!id) { if (!client) FatalError("FakeClientID: server internal ids exhausted\n"); MarkClientException(clients[client]); id = ((Mask) client << CLIENTOFFSET) | (SERVER_BIT * 3); maxid = id | RESOURCE_ID_MASK; } clientTable[client].fakeID = id + 1; clientTable[client].endFakeID = maxid + 1; return id; } Bool AddResource(XID id, RESTYPE type, void *value) { int client; ClientResourceRec *rrec; ResourcePtr res, *head; #ifdef XSERVER_DTRACE XSERVER_RESOURCE_ALLOC(id, type, value, TypeNameString(type)); #endif client = CLIENT_ID(id); rrec = &clientTable[client]; if (!rrec->buckets) { ErrorF("[dix] AddResource(%lx, %x, %lx), client=%d \n", (unsigned long) id, type, (unsigned long) value, client); FatalError("client not in use\n"); } if ((rrec->elements >= 4 * rrec->buckets) && (rrec->hashsize < MAXHASHSIZE)) RebuildTable(client); head = &rrec->resources[HashResourceID(id, clientTable[client].hashsize)]; res = malloc(sizeof(ResourceRec)); if (!res) { (*resourceTypes[type & TypeMask].deleteFunc) (value, id); return FALSE; } res->next = *head; res->id = id; res->type = type; res->value = value; *head = res; rrec->elements++; CallResourceStateCallback(ResourceStateAdding, res); return TRUE; } static void RebuildTable(int client) { int j; ResourcePtr res, next; ResourcePtr **tails, *resources; ResourcePtr **tptr, *rptr; /* * For now, preserve insertion order, since some ddx layers depend * on resources being free in the opposite order they are added. */ j = 2 * clientTable[client].buckets; tails = malloc(j * sizeof(ResourcePtr *)); if (!tails) return; resources = malloc(j * sizeof(ResourcePtr)); if (!resources) { free(tails); return; } for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) { *rptr = NULL; *tptr = rptr; } clientTable[client].hashsize++; for (j = clientTable[client].buckets, rptr = clientTable[client].resources; --j >= 0; rptr++) { for (res = *rptr; res; res = next) { next = res->next; res->next = NULL; tptr = &tails[HashResourceID(res->id, clientTable[client].hashsize)]; **tptr = res; *tptr = &res->next; } } free(tails); clientTable[client].buckets *= 2; free(clientTable[client].resources); clientTable[client].resources = resources; } static void doFreeResource(ResourcePtr res, Bool skip) { CallResourceStateCallback(ResourceStateFreeing, res); if (!skip) resourceTypes[res->type & TypeMask].deleteFunc(res->value, res->id); free(res); } void FreeResource(XID id, RESTYPE skipDeleteFuncType) { int cid; ResourcePtr res; ResourcePtr *prev, *head; int *eltptr; int elements; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; eltptr = &clientTable[cid].elements; prev = head; while ((res = *prev)) { if (res->id == id) { RESTYPE rtype = res->type; #ifdef XSERVER_DTRACE XSERVER_RESOURCE_FREE(res->id, res->type, res->value, TypeNameString(res->type)); #endif *prev = res->next; elements = --*eltptr; doFreeResource(res, rtype == skipDeleteFuncType); if (*eltptr != elements) prev = head; /* prev may no longer be valid */ } else prev = &res->next; } } } void FreeResourceByType(XID id, RESTYPE type, Bool skipFree) { int cid; ResourcePtr res; ResourcePtr *prev, *head; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; prev = head; while ((res = *prev)) { if (res->id == id && res->type == type) { #ifdef XSERVER_DTRACE XSERVER_RESOURCE_FREE(res->id, res->type, res->value, TypeNameString(res->type)); #endif *prev = res->next; clientTable[cid].elements--; doFreeResource(res, skipFree); break; } else prev = &res->next; } } } /* * Change the value associated with a resource id. Caller * is responsible for "doing the right thing" with the old * data */ Bool ChangeResourceValue(XID id, RESTYPE rtype, void *value) { int cid; ResourcePtr res; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; for (; res; res = res->next) if ((res->id == id) && (res->type == rtype)) { res->value = value; return TRUE; } } return FALSE; } /* Note: if func adds or deletes resources, then func can get called * more than once for some resources. If func adds new resources, * func might or might not get called for them. func cannot both * add and delete an equal number of resources! */ void FindClientResourcesByType(ClientPtr client, RESTYPE type, FindResType func, void *cdata) { ResourcePtr *resources; ResourcePtr this, next; int i, elements; int *eltptr; if (!client) client = serverClient; resources = clientTable[client->index].resources; eltptr = &clientTable[client->index].elements; for (i = 0; i < clientTable[client->index].buckets; i++) { for (this = resources[i]; this; this = next) { next = this->next; if (!type || this->type == type) { elements = *eltptr; (*func) (this->value, this->id, cdata); if (*eltptr != elements) next = resources[i]; /* start over */ } } } } void FindSubResources(void *resource, RESTYPE type, FindAllRes func, void *cdata) { struct ResourceType rtype = resourceTypes[type & TypeMask]; rtype.findSubResFunc(resource, func, cdata); } void FindAllClientResources(ClientPtr client, FindAllRes func, void *cdata) { ResourcePtr *resources; ResourcePtr this, next; int i, elements; int *eltptr; if (!client) client = serverClient; resources = clientTable[client->index].resources; eltptr = &clientTable[client->index].elements; for (i = 0; i < clientTable[client->index].buckets; i++) { for (this = resources[i]; this; this = next) { next = this->next; elements = *eltptr; (*func) (this->value, this->id, this->type, cdata); if (*eltptr != elements) next = resources[i]; /* start over */ } } } void * LookupClientResourceComplex(ClientPtr client, RESTYPE type, FindComplexResType func, void *cdata) { ResourcePtr *resources; ResourcePtr this, next; void *value; int i; if (!client) client = serverClient; resources = clientTable[client->index].resources; for (i = 0; i < clientTable[client->index].buckets; i++) { for (this = resources[i]; this; this = next) { next = this->next; if (!type || this->type == type) { /* workaround func freeing the type as DRI1 does */ value = this->value; if ((*func) (value, this->id, cdata)) return value; } } } return NULL; } void FreeClientNeverRetainResources(ClientPtr client) { ResourcePtr *resources; ResourcePtr this; ResourcePtr *prev; int j, elements; int *eltptr; if (!client) return; resources = clientTable[client->index].resources; eltptr = &clientTable[client->index].elements; for (j = 0; j < clientTable[client->index].buckets; j++) { prev = &resources[j]; while ((this = *prev)) { RESTYPE rtype = this->type; if (rtype & RC_NEVERRETAIN) { #ifdef XSERVER_DTRACE XSERVER_RESOURCE_FREE(this->id, this->type, this->value, TypeNameString(this->type)); #endif *prev = this->next; clientTable[client->index].elements--; elements = *eltptr; doFreeResource(this, FALSE); if (*eltptr != elements) prev = &resources[j]; /* prev may no longer be valid */ } else prev = &this->next; } } } void FreeClientResources(ClientPtr client) { ResourcePtr *resources; ResourcePtr this; int j; /* This routine shouldn't be called with a null client, but just in case ... */ if (!client) return; HandleSaveSet(client); resources = clientTable[client->index].resources; for (j = 0; j < clientTable[client->index].buckets; j++) { /* It may seem silly to update the head of this resource list as we delete the members, since the entire list will be deleted any way, but there are some resource deletion functions "FreeClientPixels" for one which do a LookupID on another resource id (a Colormap id in this case), so the resource list must be kept valid up to the point that it is deleted, so every time we delete a resource, we must update the head, just like in FreeResource. I hope that this doesn't slow down mass deletion appreciably. PRH */ ResourcePtr *head; head = &resources[j]; for (this = *head; this; this = *head) { #ifdef XSERVER_DTRACE XSERVER_RESOURCE_FREE(this->id, this->type, this->value, TypeNameString(this->type)); #endif *head = this->next; clientTable[client->index].elements--; doFreeResource(this, FALSE); } } free(clientTable[client->index].resources); clientTable[client->index].resources = NULL; clientTable[client->index].buckets = 0; } void FreeAllResources(void) { int i; for (i = currentMaxClients; --i >= 0;) { if (clientTable[i].buckets) FreeClientResources(clients[i]); } } Bool LegalNewID(XID id, ClientPtr client) { void *val; int rc; #ifdef PANORAMIX XID minid, maxid; if (!noPanoramiXExtension) { minid = client->clientAsMask | (client->index ? SERVER_BIT : SERVER_MINID); maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; if ((id >= minid) && (id <= maxid)) return TRUE; } #endif /* PANORAMIX */ if (client->clientAsMask == (id & ~RESOURCE_ID_MASK)) { rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient, DixGetAttrAccess); return rc == BadValue; } return FALSE; } int dixLookupResourceByType(void **result, XID id, RESTYPE rtype, ClientPtr client, Mask mode) { int cid = CLIENT_ID(id); ResourcePtr res = NULL; *result = NULL; if ((rtype & TypeMask) > lastResourceType) return BadImplementation; if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; for (; res; res = res->next) if (res->id == id && res->type == rtype) break; } if (!res) return resourceTypes[rtype & TypeMask].errorValue; if (client) { client->errorValue = id; cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, res->value, RT_NONE, NULL, mode); if (cid == BadValue) return resourceTypes[rtype & TypeMask].errorValue; if (cid != Success) return cid; } *result = res->value; return Success; } int dixLookupResourceByClass(void **result, XID id, RESTYPE rclass, ClientPtr client, Mask mode) { int cid = CLIENT_ID(id); ResourcePtr res = NULL; *result = NULL; if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; for (; res; res = res->next) if (res->id == id && (res->type & rclass)) break; } if (!res) return BadValue; if (client) { client->errorValue = id; cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, res->value, RT_NONE, NULL, mode); if (cid != Success) return cid; } *result = res->value; return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/inpututils.c�����������������������������������������������������������������0000664�0001751�0001751�00000070555�12456571574�014215� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2008 Daniel Stone * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Author: Daniel Stone <daniel@fooishbar.org> */ #ifdef HAVE_DIX_CONFIG_H #include "dix-config.h" #endif #include "exevents.h" #include "exglobals.h" #include "misc.h" #include "input.h" #include "inputstr.h" #include "xace.h" #include "xkbsrv.h" #include "xkbstr.h" #include "inpututils.h" #include "eventstr.h" #include "scrnintstr.h" #include "optionstr.h" /* Check if a button map change is okay with the device. * Returns -1 for BadValue, as it collides with MappingBusy. */ static int check_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, CARD32 *errval_out, ClientPtr client) { int i, ret; if (!dev || !dev->button) { client->errorValue = (dev) ? dev->id : 0; return BadDevice; } ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess); if (ret != Success) { client->errorValue = dev->id; return ret; } for (i = 0; i < len; i++) { if (dev->button->map[i + 1] != map[i] && button_is_down(dev, i + 1, BUTTON_PROCESSED)) return MappingBusy; } return Success; } static void do_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client) { int i; 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.mappingNotify.request = MappingPointer; /* 0 is the server client. */ for (i = 1; i < currentMaxClients; i++) { /* Don't send irrelevant events to naïve clients. */ if (!clients[i] || clients[i]->clientState != ClientStateRunning) continue; if (!XIShouldNotify(clients[i], dev)) continue; WriteEventsToClient(clients[i], 1, &core_mn); } xi_mn = (deviceMappingNotify) { .type = DeviceMappingNotify, .request = MappingPointer, .deviceid = dev->id, .time = GetTimeInMillis() }; SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1); } /* * Does what it says on the box, both for core and Xi. * * Faithfully reports any errors encountered while trying to apply the map * to the requested device, faithfully ignores any errors encountered while * trying to apply the map to its master/slaves. */ int ApplyPointerMapping(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client) { int ret; /* If we can't perform the change on the requested device, bail out. */ ret = check_butmap_change(dev, map, len, &client->errorValue, client); if (ret != Success) return ret; do_butmap_change(dev, map, len, client); return Success; } /* Check if a modifier map change is okay with the device. * Returns -1 for BadValue, as it collides with MappingBusy; this particular * caveat can be removed with LegalModifier, as we have no other reason to * set MappingFailed. Sigh. */ static int check_modmap_change(ClientPtr client, DeviceIntPtr dev, KeyCode *modmap) { int ret, i; XkbDescPtr xkb; ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess); if (ret != Success) return ret; if (!dev->key) return BadMatch; xkb = dev->key->xkbInfo->desc; for (i = 0; i < MAP_LENGTH; i++) { if (!modmap[i]) continue; /* Check that all the new modifiers fall within the advertised * keycode range. */ if (i < xkb->min_key_code || i > xkb->max_key_code) { client->errorValue = i; return -1; } /* Make sure the mapping is okay with the DDX. */ if (!LegalModifier(i, dev)) { client->errorValue = i; return MappingFailed; } /* None of the new modifiers may be down while we change the * map. */ if (key_is_down(dev, i, KEY_POSTED | KEY_PROCESSED)) { client->errorValue = i; return MappingBusy; } } /* None of the old modifiers may be down while we change the map, * either. */ for (i = xkb->min_key_code; i < xkb->max_key_code; i++) { if (!xkb->map->modmap[i]) continue; if (key_is_down(dev, i, KEY_POSTED | KEY_PROCESSED)) { client->errorValue = i; return MappingBusy; } } return Success; } static int check_modmap_change_slave(ClientPtr client, DeviceIntPtr master, DeviceIntPtr slave, CARD8 *modmap) { XkbDescPtr master_xkb, slave_xkb; int i, j; if (!slave->key || !master->key) return 0; master_xkb = master->key->xkbInfo->desc; slave_xkb = slave->key->xkbInfo->desc; /* Ignore devices with a clearly different keymap. */ if (slave_xkb->min_key_code != master_xkb->min_key_code || slave_xkb->max_key_code != master_xkb->max_key_code) return 0; for (i = 0; i < MAP_LENGTH; i++) { if (!modmap[i]) continue; /* If we have different symbols for any modifier on an * extended keyboard, ignore the whole remap request. */ for (j = 0; j < XkbKeyNumSyms(slave_xkb, i) && j < XkbKeyNumSyms(master_xkb, i); j++) if (XkbKeySymsPtr(slave_xkb, i)[j] != XkbKeySymsPtr(master_xkb, i)[j]) return 0; } if (check_modmap_change(client, slave, modmap) != Success) return 0; return 1; } /* Actually change the modifier map, and send notifications. Cannot fail. */ static void do_modmap_change(ClientPtr client, DeviceIntPtr dev, CARD8 *modmap) { XkbApplyMappingChange(dev, NULL, 0, 0, modmap, serverClient); } /* Rebuild modmap (key -> mod) from map (mod -> key). */ static int build_modmap_from_modkeymap(CARD8 *modmap, KeyCode *modkeymap, int max_keys_per_mod) { int i, len = max_keys_per_mod * 8; memset(modmap, 0, MAP_LENGTH); for (i = 0; i < len; i++) { if (!modkeymap[i]) continue; #if MAP_LENGTH < 256 if (modkeymap[i] >= MAP_LENGTH) return BadValue; #endif if (modmap[modkeymap[i]]) return BadValue; modmap[modkeymap[i]] = 1 << (i / max_keys_per_mod); } return Success; } int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap, int max_keys_per_mod) { int ret; CARD8 modmap[MAP_LENGTH]; DeviceIntPtr tmp; ret = build_modmap_from_modkeymap(modmap, modkeymap, max_keys_per_mod); if (ret != Success) return ret; /* If we can't perform the change on the requested device, bail out. */ ret = check_modmap_change(client, dev, modmap); if (ret != Success) return ret; do_modmap_change(client, dev, modmap); /* Change any attached masters/slaves. */ if (IsMaster(dev)) { for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { if (!IsMaster(tmp) && GetMaster(tmp, MASTER_KEYBOARD) == dev) if (check_modmap_change_slave(client, dev, tmp, modmap)) do_modmap_change(client, tmp, modmap); } } else if (!IsFloating(dev) && GetMaster(dev, MASTER_KEYBOARD)->lastSlave == dev) { /* If this fails, expect the results to be weird. */ if (check_modmap_change(client, dev->master, modmap)) do_modmap_change(client, dev->master, modmap); } return Success; } int generate_modkeymap(ClientPtr client, DeviceIntPtr dev, KeyCode **modkeymap_out, int *max_keys_per_mod_out) { CARD8 keys_per_mod[8]; int max_keys_per_mod; KeyCode *modkeymap = NULL; int i, j, ret; ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess); if (ret != Success) return ret; if (!dev->key) return BadMatch; /* Count the number of keys per modifier to determine how wide we * should make the map. */ max_keys_per_mod = 0; for (i = 0; i < 8; i++) keys_per_mod[i] = 0; for (i = 8; i < MAP_LENGTH; i++) { for (j = 0; j < 8; j++) { if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) { if (++keys_per_mod[j] > max_keys_per_mod) max_keys_per_mod = keys_per_mod[j]; } } } if (max_keys_per_mod != 0) { modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode)); if (!modkeymap) return BadAlloc; for (i = 0; i < 8; i++) keys_per_mod[i] = 0; for (i = 8; i < MAP_LENGTH; i++) { for (j = 0; j < 8; j++) { if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) { modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i; keys_per_mod[j]++; } } } } *max_keys_per_mod_out = max_keys_per_mod; *modkeymap_out = modkeymap; return Success; } /** * Duplicate the InputAttributes in the most obvious way. * No special memory handling is used to give drivers the maximum * flexibility with the data. Drivers should be able to call realloc on the * product string if needed and perform similar operations. */ InputAttributes * DuplicateInputAttributes(InputAttributes * attrs) { InputAttributes *new_attr; int ntags = 0; char **tags, **new_tags; if (!attrs) return NULL; if (!(new_attr = calloc(1, sizeof(InputAttributes)))) goto unwind; if (attrs->product && !(new_attr->product = strdup(attrs->product))) goto unwind; if (attrs->vendor && !(new_attr->vendor = strdup(attrs->vendor))) goto unwind; if (attrs->device && !(new_attr->device = strdup(attrs->device))) goto unwind; if (attrs->pnp_id && !(new_attr->pnp_id = strdup(attrs->pnp_id))) goto unwind; if (attrs->usb_id && !(new_attr->usb_id = strdup(attrs->usb_id))) goto unwind; new_attr->flags = attrs->flags; if ((tags = attrs->tags)) { while (*tags++) ntags++; new_attr->tags = calloc(ntags + 1, sizeof(char *)); if (!new_attr->tags) goto unwind; tags = attrs->tags; new_tags = new_attr->tags; while (*tags) { *new_tags = strdup(*tags); if (!*new_tags) goto unwind; tags++; new_tags++; } } return new_attr; unwind: FreeInputAttributes(new_attr); return NULL; } void FreeInputAttributes(InputAttributes * attrs) { char **tags; if (!attrs) return; free(attrs->product); free(attrs->vendor); free(attrs->device); free(attrs->pnp_id); free(attrs->usb_id); if ((tags = attrs->tags)) while (*tags) free(*tags++); free(attrs->tags); free(attrs); } /** * Alloc a valuator mask large enough for num_valuators. */ ValuatorMask * valuator_mask_new(int num_valuators) { /* alloc a fixed size mask for now and ignore num_valuators. in the * flying-car future, when we can dynamically alloc the masks and are * not constrained by signals, we can start using num_valuators */ ValuatorMask *mask = calloc(1, sizeof(ValuatorMask)); if (mask == NULL) return NULL; mask->last_bit = -1; return mask; } void valuator_mask_free(ValuatorMask **mask) { free(*mask); *mask = NULL; } /** * Sets a range of valuators between first_valuator and num_valuators with * the data in the valuators array. All other values are set to 0. */ void valuator_mask_set_range(ValuatorMask *mask, int first_valuator, int num_valuators, const int *valuators) { int i; valuator_mask_zero(mask); for (i = first_valuator; i < min(first_valuator + num_valuators, MAX_VALUATORS); i++) valuator_mask_set(mask, i, valuators[i - first_valuator]); } /** * Reset mask to zero. */ void valuator_mask_zero(ValuatorMask *mask) { memset(mask, 0, sizeof(*mask)); mask->last_bit = -1; } /** * Returns the current size of the mask (i.e. the highest number of * valuators currently set + 1). */ int valuator_mask_size(const ValuatorMask *mask) { return mask->last_bit + 1; } /** * Returns the number of valuators set in the given mask. */ int valuator_mask_num_valuators(const ValuatorMask *mask) { return CountBits(mask->mask, min(mask->last_bit + 1, MAX_VALUATORS)); } /** * Return true if the valuator is set in the mask, or false otherwise. */ int valuator_mask_isset(const ValuatorMask *mask, int valuator) { return mask->last_bit >= valuator && BitIsOn(mask->mask, valuator); } /** * Set the valuator to the given floating-point data. */ void valuator_mask_set_double(ValuatorMask *mask, int valuator, double data) { mask->last_bit = max(valuator, mask->last_bit); SetBit(mask->mask, valuator); mask->valuators[valuator] = data; } /** * Set the valuator to the given integer data. */ void valuator_mask_set(ValuatorMask *mask, int valuator, int data) { valuator_mask_set_double(mask, valuator, data); } /** * Return the requested valuator value as a double. If the mask bit is not * set for the given valuator, the returned value is undefined. */ double valuator_mask_get_double(const ValuatorMask *mask, int valuator) { return mask->valuators[valuator]; } /** * Return the requested valuator value as an integer, rounding towards zero. * If the mask bit is not set for the given valuator, the returned value is * undefined. */ int valuator_mask_get(const ValuatorMask *mask, int valuator) { return trunc(valuator_mask_get_double(mask, valuator)); } /** * Set value to the requested valuator. If the mask bit is set for this * valuator, value contains the requested valuator value and TRUE is * returned. * If the mask bit is not set for this valuator, value is unchanged and * FALSE is returned. */ Bool valuator_mask_fetch_double(const ValuatorMask *mask, int valuator, double *value) { if (valuator_mask_isset(mask, valuator)) { *value = valuator_mask_get_double(mask, valuator); return TRUE; } else return FALSE; } /** * Set value to the requested valuator. If the mask bit is set for this * valuator, value contains the requested valuator value and TRUE is * returned. * If the mask bit is not set for this valuator, value is unchanged and * FALSE is returned. */ Bool valuator_mask_fetch(const ValuatorMask *mask, int valuator, int *value) { if (valuator_mask_isset(mask, valuator)) { *value = valuator_mask_get(mask, valuator); return TRUE; } else return FALSE; } /** * Remove the valuator from the mask. */ void valuator_mask_unset(ValuatorMask *mask, int valuator) { if (mask->last_bit >= valuator) { int i, lastbit = -1; ClearBit(mask->mask, valuator); mask->valuators[valuator] = 0.0; for (i = 0; i <= mask->last_bit; i++) if (valuator_mask_isset(mask, i)) lastbit = max(lastbit, i); mask->last_bit = lastbit; } } void valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src) { if (src) memcpy(dest, src, sizeof(*dest)); else valuator_mask_zero(dest); } int CountBits(const uint8_t * mask, int len) { int i; int ret = 0; for (i = 0; i < len; i++) if (BitIsOn(mask, i)) ret++; return ret; } /** * Verifies sanity of the event. If the event is not an internal event, * memdumps the first 32 bytes of event to the log, a backtrace, then kill * the server. */ void verify_internal_event(const InternalEvent *ev) { if (ev && ev->any.header != ET_Internal) { int i; const unsigned char *data = (const unsigned char *) ev; ErrorF("dix: invalid event type %d\n", ev->any.header); for (i = 0; i < sizeof(xEvent); i++, data++) { ErrorF("%02hhx ", *data); if ((i % 8) == 7) ErrorF("\n"); } xorg_backtrace(); FatalError("Wrong event type %d. Aborting server\n", ev->any.header); } } /** * Initializes the given event to zero (or default values), for the given * device. */ void init_device_event(DeviceEvent *event, DeviceIntPtr dev, 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; } int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd) { int corestate; /* core state needs to be assembled BEFORE the device is updated. */ corestate = (kbd && kbd->key) ? XkbStateFieldFromRec(&kbd->key->xkbInfo-> state) : 0; corestate |= (mouse && mouse->button) ? (mouse->button->state) : 0; corestate |= (mouse && mouse->touch) ? (mouse->touch->state) : 0; return corestate; } void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event) { int i; for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) if (BitIsOn(mouse->button->down, i)) SetBit(event->buttons, mouse->button->map[i]); if (mouse && mouse->touch && mouse->touch->buttonsDown > 0) SetBit(event->buttons, mouse->button->map[1]); if (kbd && kbd->key) { XkbStatePtr state; /* we need the state before the event happens */ if (event->type == ET_KeyPress || event->type == ET_KeyRelease) state = &kbd->key->xkbInfo->prev_state; else state = &kbd->key->xkbInfo->state; event->mods.base = state->base_mods; event->mods.latched = state->latched_mods; event->mods.locked = state->locked_mods; event->mods.effective = state->mods; event->group.base = state->base_group; event->group.latched = state->latched_group; event->group.locked = state->locked_group; event->group.effective = state->group; } } /** * Return the event filter mask for the given device and the given core or * XI1 protocol type. */ Mask event_get_filter_from_type(DeviceIntPtr dev, int evtype) { return event_filters[dev ? dev->id : 0][evtype]; } /** * Return the event filter mask for the given device and the given core or * XI2 protocol type. */ Mask event_get_filter_from_xi2type(int evtype) { return (1 << (evtype % 8)); } Bool point_on_screen(ScreenPtr pScreen, int x, int y) { return x >= pScreen->x && x < pScreen->x + pScreen->width && y >= pScreen->y && y < pScreen->y + pScreen->height; } /** * Update desktop dimensions on the screenInfo struct. */ void update_desktop_dimensions(void) { int i; int x1 = INT_MAX, y1 = INT_MAX; /* top-left */ int x2 = INT_MIN, y2 = INT_MIN; /* bottom-right */ for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr screen = screenInfo.screens[i]; x1 = min(x1, screen->x); y1 = min(y1, screen->y); x2 = max(x2, screen->x + screen->width); y2 = max(y2, screen->y + screen->height); } screenInfo.x = x1; screenInfo.y = y1; screenInfo.width = x2 - x1; screenInfo.height = y2 - y1; } /* * Delete the element with the key from the list, freeing all memory * associated with the element.. */ static void input_option_free(InputOption *o) { free(o->opt_name); free(o->opt_val); free(o->opt_comment); free(o); } /* * Create a new InputOption with the key/value pair provided. * If a list is provided, the new options is added to the list and the list * is returned. * * If a new option is added to a list that already contains that option, the * previous option is overwritten. * * @param list The list to add to. * @param key Option key, will be copied. * @param value Option value, will be copied. * * @return If list is not NULL, the list with the new option added. If list * is NULL, a new option list with one element. On failure, NULL is * returned. */ InputOption * input_option_new(InputOption *list, const char *key, const char *value) { InputOption *opt = NULL; if (!key) return NULL; if (list) { nt_list_for_each_entry(opt, list, list.next) { if (strcmp(input_option_get_key(opt), key) == 0) { input_option_set_value(opt, value); return list; } } } opt = calloc(1, sizeof(InputOption)); if (!opt) return NULL; nt_list_init(opt, list.next); input_option_set_key(opt, key); input_option_set_value(opt, value); if (list) { nt_list_append(opt, list, InputOption, list.next); return list; } else return opt; } InputOption * input_option_free_element(InputOption *list, const char *key) { InputOption *element; nt_list_for_each_entry(element, list, list.next) { if (strcmp(input_option_get_key(element), key) == 0) { nt_list_del(element, list, InputOption, list.next); input_option_free(element); break; } } return list; } /** * Free the list pointed at by opt. */ void input_option_free_list(InputOption **opt) { InputOption *element, *tmp; nt_list_for_each_entry_safe(element, tmp, *opt, list.next) { nt_list_del(element, *opt, InputOption, list.next); input_option_free(element); } *opt = NULL; } /** * Find the InputOption with the given option name. * * @return The InputOption or NULL if not present. */ InputOption * input_option_find(InputOption *list, const char *key) { InputOption *element; nt_list_for_each_entry(element, list, list.next) { if (strcmp(input_option_get_key(element), key) == 0) return element; } return NULL; } const char * input_option_get_key(const InputOption *opt) { return opt->opt_name; } const char * input_option_get_value(const InputOption *opt) { return opt->opt_val; } void input_option_set_key(InputOption *opt, const char *key) { free(opt->opt_name); if (key) opt->opt_name = strdup(key); } void input_option_set_value(InputOption *opt, const char *value) { free(opt->opt_val); if (value) opt->opt_val = strdup(value); } /* FP1616/FP3232 conversion functions. * Fixed point types are encoded as signed integral and unsigned frac. So any * negative number -n.m is encoded as floor(n) + (1 - 0.m). */ double fp1616_to_double(FP1616 in) { return pixman_fixed_to_double(in); } double fp3232_to_double(FP3232 in) { double ret; ret = (double) in.integral; ret += (double) in.frac * (1.0 / (1ULL << 32)); /* Optimized: ldexp((double)in.frac, -32); */ return ret; } FP1616 double_to_fp1616(double in) { return pixman_double_to_fixed(in); } FP3232 double_to_fp3232(double in) { FP3232 ret; int32_t integral; double tmp; uint32_t frac_d; tmp = floor(in); integral = (int32_t) tmp; tmp = (in - integral) * (1ULL << 32); /* Optimized: ldexp(in - integral, 32) */ frac_d = (uint32_t) tmp; ret.integral = integral; ret.frac = frac_d; return ret; } /** * DO NOT USE THIS FUNCTION. It only exists for the test cases. Use * xi2mask_new() instead to get the standard sized masks. * * @param nmasks The number of masks (== number of devices) * @param size The size of the masks in bytes * @return The new mask or NULL on allocation error. */ XI2Mask * xi2mask_new_with_size(size_t nmasks, size_t size) { int i; int alloc_size; unsigned char *cursor; XI2Mask *mask; alloc_size = sizeof(struct _XI2Mask) + nmasks * sizeof(unsigned char *) + nmasks * size; mask = calloc(1, alloc_size); if (!mask) return NULL; mask->nmasks = nmasks; mask->mask_size = size; mask->masks = (unsigned char **)(mask + 1); cursor = (unsigned char *)(mask + 1) + nmasks * sizeof(unsigned char *); for (i = 0; i < nmasks; i++) { mask->masks[i] = cursor; cursor += size; } return mask; } /** * Create a new XI2 mask of the standard size, i.e. for all devices + fake * devices and for the highest supported XI2 event type. * * @return The new mask or NULL on allocation error. */ XI2Mask * xi2mask_new(void) { return xi2mask_new_with_size(EMASKSIZE, XI2MASKSIZE); } /** * Frees memory associated with mask and resets mask to NULL. */ void xi2mask_free(XI2Mask **mask) { if (!(*mask)) return; free((*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. * * @return TRUE if the bit is set, FALSE otherwise */ Bool xi2mask_isset(XI2Mask *mask, const DeviceIntPtr dev, int event_type) { int set = 0; 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; } /** * Set the mask bit for this event type for this device. */ void xi2mask_set(XI2Mask *mask, int deviceid, int event_type) { BUG_WARN(deviceid < 0); BUG_WARN(deviceid >= mask->nmasks); BUG_WARN(bits_to_bytes(event_type + 1) > mask->mask_size); SetBit(mask->masks[deviceid], event_type); } /** * Zero out the xi2mask, for the deviceid given. If the deviceid is < 0, all * masks are zeroed. */ void xi2mask_zero(XI2Mask *mask, int deviceid) { int i; BUG_WARN(deviceid > 0 && deviceid >= mask->nmasks); if (deviceid >= 0) memset(mask->masks[deviceid], 0, mask->mask_size); else for (i = 0; i < mask->nmasks; i++) memset(mask->masks[i], 0, mask->mask_size); } /** * Merge source into dest, i.e. dest |= source. * If the masks are of different size, only the overlapping section is merged. */ void xi2mask_merge(XI2Mask *dest, const XI2Mask *source) { int i, j; for (i = 0; i < min(dest->nmasks, source->nmasks); i++) for (j = 0; j < min(dest->mask_size, source->mask_size); j++) dest->masks[i][j] |= source->masks[i][j]; } /** * @return The number of masks in mask */ size_t xi2mask_num_masks(const XI2Mask *mask) { return mask->nmasks; } /** * @return The size of each mask in bytes */ size_t xi2mask_mask_size(const XI2Mask *mask) { return mask->mask_size; } /** * Set the mask for the given deviceid to the source mask. * If the mask given is larger than the target memory, only the overlapping * parts are copied. */ void xi2mask_set_one_mask(XI2Mask *xi2mask, int deviceid, const unsigned char *mask, size_t mask_size) { BUG_WARN(deviceid < 0); BUG_WARN(deviceid >= xi2mask->nmasks); memcpy(xi2mask->masks[deviceid], mask, min(xi2mask->mask_size, mask_size)); } /** * Get a reference to the XI2mask for this particular device. */ const unsigned char * xi2mask_get_one_mask(const XI2Mask *mask, int deviceid) { BUG_WARN(deviceid < 0); BUG_WARN(deviceid >= mask->nmasks); return mask->masks[deviceid]; } ���������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/Xserver-dtrace.h.in����������������������������������������������������������0000664�0001751�0001751�00000010235�12274325511�015254� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2006, Oracle and/or its affiliates. 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 (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. */ /* * Generated by dtrace(1M), and then modified for backwards compatibility * with older versions of dtrace. Used if dtrace -h fails. * (Since _ENABLED support was added after dtrace -h, this assumes if * dtrace -h fails, _ENABLED will too.) */ #ifndef _XSERVER_DTRACE_H #define _XSERVER_DTRACE_H #include <unistd.h> #ifdef __cplusplus extern "C" { #endif #if _DTRACE_VERSION #define XSERVER_CLIENT_AUTH(arg0, arg1, arg2, arg3) \ __dtrace_Xserver___client__auth(arg0, arg1, arg2, arg3) #define XSERVER_CLIENT_CONNECT(arg0, arg1) \ __dtrace_Xserver___client__connect(arg0, arg1) #define XSERVER_CLIENT_DISCONNECT(arg0) \ __dtrace_Xserver___client__disconnect(arg0) #define XSERVER_REQUEST_DONE(arg0, arg1, arg2, arg3, arg4) \ __dtrace_Xserver___request__done(arg0, arg1, arg2, arg3, arg4) #define XSERVER_REQUEST_START(arg0, arg1, arg2, arg3, arg4) \ __dtrace_Xserver___request__start(arg0, arg1, arg2, arg3, arg4) #define XSERVER_RESOURCE_ALLOC(arg0, arg1, arg2, arg3) \ __dtrace_Xserver___resource__alloc(arg0, arg1, arg2, arg3) #define XSERVER_RESOURCE_FREE(arg0, arg1, arg2, arg3) \ __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); extern void __dtrace_Xserver___client__disconnect(int); extern void __dtrace_Xserver___request__done(string, uint8_t, uint32_t, int, int); extern void __dtrace_Xserver___request__start(string, uint8_t, uint16_t, int, void *); 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 #define XSERVER_CLIENT_AUTH(arg0, arg1, arg2, arg3) #define XSERVER_CLIENT_CONNECT(arg0, arg1) #define XSERVER_CLIENT_DISCONNECT(arg0) #define XSERVER_REQUEST_DONE(arg0, arg1, arg2, arg3, arg4) #define XSERVER_REQUEST_START(arg0, arg1, arg2, arg3, arg4) #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 #define XSERVER_CLIENT_AUTH_ENABLED() (1) #define XSERVER_CLIENT_CONNECT_ENABLED() (1) #define XSERVER_CLIENT_DISCONNECT_ENABLED() (1) #define XSERVER_REQUEST_DONE_ENABLED() (1) #define XSERVER_REQUEST_START_ENABLED() (1) #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 } #endif #endif /* _XSERVER_DTRACE_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/dix/enterleave.c�����������������������������������������������������������������0000664�0001751�0001751�00000145022�12274325511�014101� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2008 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. * * Authors: Peter Hutterer * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/extensions/XI2.h> #include <X11/extensions/XIproto.h> #include <X11/extensions/XI2proto.h> #include "inputstr.h" #include "windowstr.h" #include "scrnintstr.h" #include "exglobals.h" #include "enterleave.h" #include "eventconvert.h" #include "xkbsrv.h" #include "inpututils.h" /** * @file * This file describes the model for sending core enter/leave events and * focus in/out in the case of multiple pointers/keyboard foci. * * Since we can't send more than one Enter or Leave/Focus in or out event per * window to a core client without confusing it, this is a rather complicated * approach. * * For a full description of the enter/leave model from a window's * perspective, see * http://lists.freedesktop.org/archives/xorg/2008-August/037606.html * * For a full description of the focus in/out model from a window's * perspective, see * http://lists.freedesktop.org/archives/xorg/2008-December/041740.html * * Additional notes: * - The core protocol spec says that "In a LeaveNotify event, if a child of the * event window contains the initial position of the pointer, then the child * component is set to that child. Otherwise, it is None. For an EnterNotify * event, if a child of the event window contains the final pointer position, * then the child component is set to that child. Otherwise, it is None." * * By inference, this means that only NotifyVirtual or NotifyNonlinearVirtual * events may have a subwindow set to other than None. * * - NotifyPointer events may be sent if the focus changes from window A to * B. The assumption used in this model is that NotifyPointer events are only * sent for the pointer paired with the keyboard that is involved in the focus * events. For example, if F(W) changes because of keyboard 2, then * NotifyPointer events are only sent for pointer 2. */ static WindowPtr PointerWindows[MAXDEVICES]; static WindowPtr FocusWindows[MAXDEVICES]; /** * Return TRUE if 'win' has a pointer within its boundaries, excluding child * window. */ static BOOL HasPointer(DeviceIntPtr dev, WindowPtr win) { int i; /* FIXME: The enter/leave model does not cater for grabbed devices. For * now, a quickfix: if the device about to send an enter/leave event to * a window is grabbed, assume there is no pointer in that window. * Fixes fdo 27804. * There isn't enough beer in my fridge to fix this properly. */ if (dev->deviceGrab.grab) return FALSE; for (i = 0; i < MAXDEVICES; i++) if (PointerWindows[i] == win) return TRUE; return FALSE; } /** * Return TRUE if at least one keyboard focus is set to 'win' (excluding * descendants of win). */ static BOOL HasFocus(WindowPtr win) { int i; for (i = 0; i < MAXDEVICES; i++) if (FocusWindows[i] == win) return TRUE; return FALSE; } /** * Return the window the device dev is currently on. */ static WindowPtr PointerWin(DeviceIntPtr dev) { return PointerWindows[dev->id]; } /** * Search for the first window below 'win' that has a pointer directly within * it's boundaries (excluding boundaries of its own descendants). * * @return The child window that has the pointer within its boundaries or * NULL. */ static WindowPtr FirstPointerChild(WindowPtr win) { int i; for (i = 0; i < MAXDEVICES; i++) { if (PointerWindows[i] && IsParent(win, PointerWindows[i])) return PointerWindows[i]; } return NULL; } /** * Search for the first window below 'win' that has a focus directly within * it's boundaries (excluding boundaries of its own descendants). * * @return The child window that has the pointer within its boundaries or * NULL. */ static WindowPtr FirstFocusChild(WindowPtr win) { int i; for (i = 0; i < MAXDEVICES; i++) { if (FocusWindows[i] && FocusWindows[i] != PointerRootWin && IsParent(win, FocusWindows[i])) return FocusWindows[i]; } return NULL; } /** * Set the presence flag for dev to mark that it is now in 'win'. */ void EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode) { PointerWindows[dev->id] = win; } /** * Unset the presence flag for dev to mark that it is not in 'win' anymore. */ void LeaveWindow(DeviceIntPtr dev) { PointerWindows[dev->id] = NULL; } /** * Set the presence flag for dev to mark that it is now in 'win'. */ void SetFocusIn(DeviceIntPtr dev, WindowPtr win) { FocusWindows[dev->id] = win; } /** * Unset the presence flag for dev to mark that it is not in 'win' anymore. */ void SetFocusOut(DeviceIntPtr dev) { FocusWindows[dev->id] = NULL; } /** * Return the common ancestor of 'a' and 'b' (if one exists). * @param a A window with the same ancestor as b. * @param b A window with the same ancestor as a. * @return The window that is the first ancestor of both 'a' and 'b', or the * NullWindow if they do not have a common ancestor. */ WindowPtr CommonAncestor(WindowPtr a, WindowPtr b) { for (b = b->parent; b; b = b->parent) if (IsParent(b, a)) return b; return NullWindow; } /** * Send enter notifies to all windows between 'ancestor' and 'child' (excluding * both). Events are sent running up the window hierarchy. This function * recurses. */ static void DeviceEnterNotifies(DeviceIntPtr dev, int sourceid, WindowPtr ancestor, WindowPtr child, int mode, int detail) { WindowPtr parent = child->parent; if (ancestor == parent) return; DeviceEnterNotifies(dev, sourceid, ancestor, parent, mode, detail); DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, detail, parent, child->drawable.id); } /** * Send enter notifies to all windows between 'ancestor' and 'child' (excluding * both). Events are sent running down the window hierarchy. This function * recurses. */ static void CoreEnterNotifies(DeviceIntPtr dev, WindowPtr ancestor, WindowPtr child, int mode, int detail) { WindowPtr parent = child->parent; if (ancestor == parent) return; CoreEnterNotifies(dev, ancestor, parent, mode, detail); /* Case 3: A is above W, B is a descendant Classically: The move generates an EnterNotify on W with a detail of Virtual or NonlinearVirtual MPX: Case 3A: There is at least one other pointer on W itself P(W) doesn't change, so the event should be suppressed Case 3B: Otherwise, if there is at least one other pointer in a descendant P(W) stays on the same descendant, or changes to a different descendant. The event should be suppressed. Case 3C: Otherwise: P(W) moves from a window above W to a descendant. The subwindow field is set to the child containing the descendant. The detail may need to be changed from Virtual to NonlinearVirtual depending on the previous P(W). */ if (!HasPointer(dev, parent) && !FirstPointerChild(parent)) CoreEnterLeaveEvent(dev, EnterNotify, mode, detail, parent, child->drawable.id); } static void CoreLeaveNotifies(DeviceIntPtr dev, WindowPtr child, WindowPtr ancestor, int mode, int detail) { WindowPtr win; if (ancestor == child) return; for (win = child->parent; win != ancestor; win = win->parent) { /*Case 7: A is a descendant of W, B is above W Classically: A LeaveNotify is generated on W with a detail of Virtual or NonlinearVirtual. MPX: Case 3A: There is at least one other pointer on W itself P(W) doesn't change, the event should be suppressed. Case 3B: Otherwise, if there is at least one other pointer in a descendant P(W) stays on the same descendant, or changes to a different descendant. The event should be suppressed. Case 3C: Otherwise: P(W) changes from the descendant of W to a window above W. The detail may need to be changed from Virtual to NonlinearVirtual or vice-versa depending on the new P(W). */ /* If one window has a pointer or a child with a pointer, skip some * work and exit. */ if (HasPointer(dev, win) || FirstPointerChild(win)) return; CoreEnterLeaveEvent(dev, LeaveNotify, mode, detail, win, child->drawable.id); child = win; } } /** * Send leave notifies to all windows between 'child' and 'ancestor'. * Events are sent running up the hierarchy. */ static void DeviceLeaveNotifies(DeviceIntPtr dev, int sourceid, WindowPtr child, WindowPtr ancestor, int mode, int detail) { WindowPtr win; if (ancestor == child) return; for (win = child->parent; win != ancestor; win = win->parent) { DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, detail, win, child->drawable.id); child = win; } } /** * Pointer dev moves from A to B and A neither a descendant of B nor is * B a descendant of A. */ static void CoreEnterLeaveNonLinear(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode) { WindowPtr X = CommonAncestor(A, B); /* Case 4: A is W, B is above W Classically: The move generates a LeaveNotify on W with a detail of Ancestor or Nonlinear MPX: Case 3A: There is at least one other pointer on W itself P(W) doesn't change, the event should be suppressed Case 3B: Otherwise, if there is at least one other pointer in a descendant of W P(W) changes from W to a descendant of W. The subwindow field is set to the child containing the new P(W), the detail field is set to Inferior Case 3C: Otherwise: The pointer window moves from W to a window above W. The detail may need to be changed from Ancestor to Nonlinear or vice versa depending on the the new P(W) */ if (!HasPointer(dev, A)) { WindowPtr child = FirstPointerChild(A); if (child) CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); else CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyNonlinear, A, None); } CoreLeaveNotifies(dev, A, X, mode, NotifyNonlinearVirtual); /* Case 9: A is a descendant of W, B is a descendant of W Classically: No events are generated on W MPX: The pointer window stays the same or moves to a different descendant of W. No events should be generated on W. Therefore, no event to X. */ CoreEnterNotifies(dev, X, B, mode, NotifyNonlinearVirtual); /* Case 2: A is above W, B=W Classically: The move generates an EnterNotify on W with a detail of Ancestor or Nonlinear MPX: Case 2A: There is at least one other pointer on W itself P(W) doesn't change, so the event should be suppressed Case 2B: Otherwise, if there is at least one other pointer in a descendant P(W) moves from a descendant to W. detail is changed to Inferior, subwindow is set to the child containing the previous P(W) Case 2C: Otherwise: P(W) changes from a window above W to W itself. The detail may need to be changed from Ancestor to Nonlinear or vice-versa depending on the previous P(W). */ if (!HasPointer(dev, B)) { WindowPtr child = FirstPointerChild(B); if (child) CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None); else CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyNonlinear, B, None); } } /** * Pointer dev moves from A to B and A is a descendant of B. */ static void CoreEnterLeaveToAncestor(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode) { /* Case 4: A is W, B is above W Classically: The move generates a LeaveNotify on W with a detail of Ancestor or Nonlinear MPX: Case 3A: There is at least one other pointer on W itself P(W) doesn't change, the event should be suppressed Case 3B: Otherwise, if there is at least one other pointer in a descendant of W P(W) changes from W to a descendant of W. The subwindow field is set to the child containing the new P(W), the detail field is set to Inferior Case 3C: Otherwise: The pointer window moves from W to a window above W. The detail may need to be changed from Ancestor to Nonlinear or vice versa depending on the the new P(W) */ if (!HasPointer(dev, A)) { WindowPtr child = FirstPointerChild(A); if (child) CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); else CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyAncestor, A, None); } CoreLeaveNotifies(dev, A, B, mode, NotifyVirtual); /* Case 8: A is a descendant of W, B is W Classically: A EnterNotify is generated on W with a detail of NotifyInferior MPX: Case 3A: There is at least one other pointer on W itself P(W) doesn't change, the event should be suppressed Case 3B: Otherwise: P(W) changes from a descendant to W itself. The subwindow field should be set to the child containing the old P(W) <<< WRONG */ if (!HasPointer(dev, B)) CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None); } /** * Pointer dev moves from A to B and B is a descendant of A. */ static void CoreEnterLeaveToDescendant(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode) { /* Case 6: A is W, B is a descendant of W Classically: A LeaveNotify is generated on W with a detail of NotifyInferior MPX: Case 3A: There is at least one other pointer on W itself P(W) doesn't change, the event should be suppressed Case 3B: Otherwise: P(W) changes from W to a descendant of W. The subwindow field is set to the child containing the new P(W) <<< THIS IS WRONG */ if (!HasPointer(dev, A)) CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); CoreEnterNotifies(dev, A, B, mode, NotifyVirtual); /* Case 2: A is above W, B=W Classically: The move generates an EnterNotify on W with a detail of Ancestor or Nonlinear MPX: Case 2A: There is at least one other pointer on W itself P(W) doesn't change, so the event should be suppressed Case 2B: Otherwise, if there is at least one other pointer in a descendant P(W) moves from a descendant to W. detail is changed to Inferior, subwindow is set to the child containing the previous P(W) Case 2C: Otherwise: P(W) changes from a window above W to W itself. The detail may need to be changed from Ancestor to Nonlinear or vice-versa depending on the previous P(W). */ if (!HasPointer(dev, B)) { WindowPtr child = FirstPointerChild(B); if (child) CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None); else CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyAncestor, B, None); } } static void CoreEnterLeaveEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode) { if (!IsMaster(dev)) return; LeaveWindow(dev); if (IsParent(from, to)) CoreEnterLeaveToDescendant(dev, from, to, mode); else if (IsParent(to, from)) CoreEnterLeaveToAncestor(dev, from, to, mode); else CoreEnterLeaveNonLinear(dev, from, to, mode); EnterWindow(dev, to, mode); } static void DeviceEnterLeaveEvents(DeviceIntPtr dev, int sourceid, WindowPtr from, WindowPtr to, int mode) { if (IsParent(from, to)) { DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyInferior, from, None); DeviceEnterNotifies(dev, sourceid, from, to, mode, NotifyVirtual); DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, NotifyAncestor, to, None); } else if (IsParent(to, from)) { DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyAncestor, from, None); DeviceLeaveNotifies(dev, sourceid, from, to, mode, NotifyVirtual); DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, NotifyInferior, to, None); } else { /* neither from nor to is descendent of the other */ WindowPtr common = CommonAncestor(to, from); /* common == NullWindow ==> different screens */ DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyNonlinear, from, None); DeviceLeaveNotifies(dev, sourceid, from, common, mode, NotifyNonlinearVirtual); DeviceEnterNotifies(dev, sourceid, common, to, mode, NotifyNonlinearVirtual); DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, NotifyNonlinear, to, None); } } /** * Figure out if enter/leave events are necessary and send them to the * appropriate windows. * * @param fromWin Window the sprite moved out of. * @param toWin Window the sprite moved into. */ void DoEnterLeaveEvents(DeviceIntPtr pDev, int sourceid, WindowPtr fromWin, WindowPtr toWin, int mode) { if (!IsPointerDevice(pDev)) return; if (fromWin == toWin) return; if (mode != XINotifyPassiveGrab && mode != XINotifyPassiveUngrab) CoreEnterLeaveEvents(pDev, fromWin, toWin, mode); 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. */ static void DeviceFocusOutEvents(DeviceIntPtr dev, WindowPtr child, WindowPtr ancestor, int mode, int detail) { WindowPtr win; if (ancestor == child) return; for (win = child->parent; win != ancestor; win = win->parent) DeviceFocusEvent(dev, XI_FocusOut, mode, detail, win); } /** * Send enter notifies to all windows between 'ancestor' and 'child' (excluding * both). Events are sent running up the window hierarchy. This function * recurses. */ static void DeviceFocusInEvents(DeviceIntPtr dev, WindowPtr ancestor, WindowPtr child, int mode, int detail) { WindowPtr parent = child->parent; if (ancestor == parent || !parent) return; DeviceFocusInEvents(dev, ancestor, parent, mode, detail); DeviceFocusEvent(dev, XI_FocusIn, mode, detail, parent); } /** * Send FocusIn events to all windows between 'ancestor' and 'child' (excluding * both). Events are sent running down the window hierarchy. This function * recurses. */ static void CoreFocusInEvents(DeviceIntPtr dev, WindowPtr ancestor, WindowPtr child, int mode, int detail) { WindowPtr parent = child->parent; if (ancestor == parent) return; CoreFocusInEvents(dev, ancestor, parent, mode, detail); /* Case 3: A is above W, B is a descendant Classically: The move generates an FocusIn on W with a detail of Virtual or NonlinearVirtual MPX: Case 3A: There is at least one other focus on W itself F(W) doesn't change, so the event should be suppressed Case 3B: Otherwise, if there is at least one other focus in a descendant F(W) stays on the same descendant, or changes to a different descendant. The event should be suppressed. Case 3C: Otherwise: F(W) moves from a window above W to a descendant. The detail may need to be changed from Virtual to NonlinearVirtual depending on the previous F(W). */ if (!HasFocus(parent) && !FirstFocusChild(parent)) CoreFocusEvent(dev, FocusIn, mode, detail, parent); } static void CoreFocusOutEvents(DeviceIntPtr dev, WindowPtr child, WindowPtr ancestor, int mode, int detail) { WindowPtr win; if (ancestor == child) return; for (win = child->parent; win != ancestor; win = win->parent) { /*Case 7: A is a descendant of W, B is above W Classically: A FocusOut is generated on W with a detail of Virtual or NonlinearVirtual. MPX: Case 3A: There is at least one other focus on W itself F(W) doesn't change, the event should be suppressed. Case 3B: Otherwise, if there is at least one other focus in a descendant F(W) stays on the same descendant, or changes to a different descendant. The event should be suppressed. Case 3C: Otherwise: F(W) changes from the descendant of W to a window above W. The detail may need to be changed from Virtual to NonlinearVirtual or vice-versa depending on the new P(W). */ /* If one window has a focus or a child with a focuspointer, skip some * work and exit. */ if (HasFocus(win) || FirstFocusChild(win)) return; CoreFocusEvent(dev, FocusOut, mode, detail, win); } } /** * Send FocusOut(NotifyPointer) events from the current pointer window (which * is a descendant of pwin_parent) up to (excluding) pwin_parent. * * NotifyPointer events are only sent for the device paired with dev. * * If the current pointer window is a descendant of 'exclude' or an ancestor of * 'exclude', no events are sent. If the current pointer IS 'exclude', events * are sent! */ static void CoreFocusOutNotifyPointerEvents(DeviceIntPtr dev, WindowPtr pwin_parent, WindowPtr exclude, int mode, int inclusive) { WindowPtr P, stopAt; P = PointerWin(GetMaster(dev, POINTER_OR_FLOAT)); if (!P) return; if (!IsParent(pwin_parent, P)) if (!(pwin_parent == P && inclusive)) return; if (exclude != None && exclude != PointerRootWin && (IsParent(exclude, P) || IsParent(P, exclude))) return; stopAt = (inclusive) ? pwin_parent->parent : pwin_parent; for (; P && P != stopAt; P = P->parent) CoreFocusEvent(dev, FocusOut, mode, NotifyPointer, P); } /** * DO NOT CALL DIRECTLY. * Recursion helper for CoreFocusInNotifyPointerEvents. */ static void CoreFocusInRecurse(DeviceIntPtr dev, WindowPtr win, WindowPtr stopAt, int mode, int inclusive) { if ((!inclusive && win == stopAt) || !win) return; CoreFocusInRecurse(dev, win->parent, stopAt, mode, inclusive); CoreFocusEvent(dev, FocusIn, mode, NotifyPointer, win); } /** * Send FocusIn(NotifyPointer) events from pwin_parent down to * including the current pointer window (which is a descendant of pwin_parent). * * @param pwin The pointer window. * @param exclude If the pointer window is a child of 'exclude', no events are * sent. * @param inclusive If TRUE, pwin_parent will receive the event too. */ static void CoreFocusInNotifyPointerEvents(DeviceIntPtr dev, WindowPtr pwin_parent, WindowPtr exclude, int mode, int inclusive) { WindowPtr P; P = PointerWin(GetMaster(dev, POINTER_OR_FLOAT)); if (!P || P == exclude || (pwin_parent != P && !IsParent(pwin_parent, P))) return; if (exclude != None && (IsParent(exclude, P) || IsParent(P, exclude))) return; CoreFocusInRecurse(dev, P, pwin_parent, mode, inclusive); } /** * Focus of dev moves from A to B and A neither a descendant of B nor is * B a descendant of A. */ static void CoreFocusNonLinear(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode) { WindowPtr X = CommonAncestor(A, B); /* Case 4: A is W, B is above W Classically: The change generates a FocusOut on W with a detail of Ancestor or Nonlinear MPX: Case 3A: There is at least one other focus on W itself F(W) doesn't change, the event should be suppressed Case 3B: Otherwise, if there is at least one other focus in a descendant of W F(W) changes from W to a descendant of W. The detail field is set to Inferior Case 3C: Otherwise: The focus window moves from W to a window above W. The detail may need to be changed from Ancestor to Nonlinear or vice versa depending on the the new F(W) */ if (!HasFocus(A)) { WindowPtr child = FirstFocusChild(A); if (child) { /* NotifyPointer P-A unless P is child or below */ CoreFocusOutNotifyPointerEvents(dev, A, child, mode, FALSE); CoreFocusEvent(dev, FocusOut, mode, NotifyInferior, A); } else { /* NotifyPointer P-A */ CoreFocusOutNotifyPointerEvents(dev, A, None, mode, FALSE); CoreFocusEvent(dev, FocusOut, mode, NotifyNonlinear, A); } } CoreFocusOutEvents(dev, A, X, mode, NotifyNonlinearVirtual); /* Case 9: A is a descendant of W, B is a descendant of W Classically: No events are generated on W MPX: The focus window stays the same or moves to a different descendant of W. No events should be generated on W. Therefore, no event to X. */ CoreFocusInEvents(dev, X, B, mode, NotifyNonlinearVirtual); /* Case 2: A is above W, B=W Classically: The move generates an EnterNotify on W with a detail of Ancestor or Nonlinear MPX: Case 2A: There is at least one other focus on W itself F(W) doesn't change, so the event should be suppressed Case 2B: Otherwise, if there is at least one other focus in a descendant F(W) moves from a descendant to W. detail is changed to Inferior. Case 2C: Otherwise: F(W) changes from a window above W to W itself. The detail may need to be changed from Ancestor to Nonlinear or vice-versa depending on the previous F(W). */ if (!HasFocus(B)) { WindowPtr child = FirstFocusChild(B); if (child) { CoreFocusEvent(dev, FocusIn, mode, NotifyInferior, B); /* NotifyPointer B-P unless P is child or below. */ CoreFocusInNotifyPointerEvents(dev, B, child, mode, FALSE); } else { CoreFocusEvent(dev, FocusIn, mode, NotifyNonlinear, B); /* NotifyPointer B-P unless P is child or below. */ CoreFocusInNotifyPointerEvents(dev, B, None, mode, FALSE); } } } /** * Focus of dev moves from A to B and A is a descendant of B. */ static void CoreFocusToAncestor(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode) { /* Case 4: A is W, B is above W Classically: The change generates a FocusOut on W with a detail of Ancestor or Nonlinear MPX: Case 3A: There is at least one other focus on W itself F(W) doesn't change, the event should be suppressed Case 3B: Otherwise, if there is at least one other focus in a descendant of W F(W) changes from W to a descendant of W. The detail field is set to Inferior Case 3C: Otherwise: The focus window moves from W to a window above W. The detail may need to be changed from Ancestor to Nonlinear or vice versa depending on the the new F(W) */ if (!HasFocus(A)) { WindowPtr child = FirstFocusChild(A); if (child) { /* NotifyPointer P-A unless P is child or below */ CoreFocusOutNotifyPointerEvents(dev, A, child, mode, FALSE); CoreFocusEvent(dev, FocusOut, mode, NotifyInferior, A); } else CoreFocusEvent(dev, FocusOut, mode, NotifyAncestor, A); } CoreFocusOutEvents(dev, A, B, mode, NotifyVirtual); /* Case 8: A is a descendant of W, B is W Classically: A FocusOut is generated on W with a detail of NotifyInferior MPX: Case 3A: There is at least one other focus on W itself F(W) doesn't change, the event should be suppressed Case 3B: Otherwise: F(W) changes from a descendant to W itself. */ if (!HasFocus(B)) { CoreFocusEvent(dev, FocusIn, mode, NotifyInferior, B); /* NotifyPointer B-P unless P is A or below. */ CoreFocusInNotifyPointerEvents(dev, B, A, mode, FALSE); } } /** * Focus of dev moves from A to B and B is a descendant of A. */ static void CoreFocusToDescendant(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode) { /* Case 6: A is W, B is a descendant of W Classically: A FocusOut is generated on W with a detail of NotifyInferior MPX: Case 3A: There is at least one other focus on W itself F(W) doesn't change, the event should be suppressed Case 3B: Otherwise: F(W) changes from W to a descendant of W. */ if (!HasFocus(A)) { /* NotifyPointer P-A unless P is B or below */ CoreFocusOutNotifyPointerEvents(dev, A, B, mode, FALSE); CoreFocusEvent(dev, FocusOut, mode, NotifyInferior, A); } CoreFocusInEvents(dev, A, B, mode, NotifyVirtual); /* Case 2: A is above W, B=W Classically: The move generates an FocusIn on W with a detail of Ancestor or Nonlinear MPX: Case 2A: There is at least one other focus on W itself F(W) doesn't change, so the event should be suppressed Case 2B: Otherwise, if there is at least one other focus in a descendant F(W) moves from a descendant to W. detail is changed to Inferior. Case 2C: Otherwise: F(W) changes from a window above W to W itself. The detail may need to be changed from Ancestor to Nonlinear or vice-versa depending on the previous F(W). */ if (!HasFocus(B)) { WindowPtr child = FirstFocusChild(B); if (child) { CoreFocusEvent(dev, FocusIn, mode, NotifyInferior, B); /* NotifyPointer B-P unless P is child or below. */ CoreFocusInNotifyPointerEvents(dev, B, child, mode, FALSE); } else CoreFocusEvent(dev, FocusIn, mode, NotifyAncestor, B); } } static BOOL HasOtherPointer(WindowPtr win, DeviceIntPtr exclude) { int i; for (i = 0; i < MAXDEVICES; i++) if (i != exclude->id && PointerWindows[i] == win) return TRUE; return FALSE; } /** * Focus moves from PointerRoot to None or from None to PointerRoot. * Assumption: Neither A nor B are valid windows. */ static void CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev, WindowPtr A, /* PointerRootWin or NoneWin */ WindowPtr B, /* NoneWin or PointerRootWin */ int mode) { WindowPtr root; int i; int nscreens = screenInfo.numScreens; #ifdef PANORAMIX if (!noPanoramiXExtension) nscreens = 1; #endif for (i = 0; i < nscreens; i++) { root = screenInfo.screens[i]->root; if (!HasOtherPointer(root, GetMaster(dev, POINTER_OR_FLOAT)) && !FirstFocusChild(root)) { /* If pointer was on PointerRootWin and changes to NoneWin, and * the pointer paired with dev is below the current root window, * do a NotifyPointer run. */ if (dev->focus && dev->focus->win == PointerRootWin && B != PointerRootWin) { WindowPtr ptrwin = PointerWin(GetMaster(dev, POINTER_OR_FLOAT)); if (ptrwin && IsParent(root, ptrwin)) CoreFocusOutNotifyPointerEvents(dev, root, None, mode, TRUE); } CoreFocusEvent(dev, FocusOut, mode, A ? NotifyPointerRoot : NotifyDetailNone, root); CoreFocusEvent(dev, FocusIn, mode, B ? NotifyPointerRoot : NotifyDetailNone, root); if (B == PointerRootWin) CoreFocusInNotifyPointerEvents(dev, root, None, mode, TRUE); } } } /** * Focus moves from window A to PointerRoot or to None. * Assumption: A is a valid window and not PointerRoot or None. */ static void CoreFocusToPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, WindowPtr B, /* PointerRootWin or NoneWin */ int mode) { WindowPtr root; int i; int nscreens = screenInfo.numScreens; #ifdef PANORAMIX if (!noPanoramiXExtension) nscreens = 1; #endif if (!HasFocus(A)) { WindowPtr child = FirstFocusChild(A); if (child) { /* NotifyPointer P-A unless P is B or below */ CoreFocusOutNotifyPointerEvents(dev, A, B, mode, FALSE); CoreFocusEvent(dev, FocusOut, mode, NotifyInferior, A); } else { /* NotifyPointer P-A */ CoreFocusOutNotifyPointerEvents(dev, A, None, mode, FALSE); CoreFocusEvent(dev, FocusOut, mode, NotifyNonlinear, A); } } /* NullWindow means we include the root window */ CoreFocusOutEvents(dev, A, NullWindow, mode, NotifyNonlinearVirtual); for (i = 0; i < nscreens; i++) { root = screenInfo.screens[i]->root; if (!HasFocus(root) && !FirstFocusChild(root)) { CoreFocusEvent(dev, FocusIn, mode, B ? NotifyPointerRoot : NotifyDetailNone, root); if (B == PointerRootWin) CoreFocusInNotifyPointerEvents(dev, root, None, mode, TRUE); } } } /** * Focus moves from PointerRoot or None to a window B. * Assumption: B is a valid window and not PointerRoot or None. */ static void CoreFocusFromPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, /* PointerRootWin or NoneWin */ WindowPtr B, int mode) { WindowPtr root; int i; int nscreens = screenInfo.numScreens; #ifdef PANORAMIX if (!noPanoramiXExtension) nscreens = 1; #endif for (i = 0; i < nscreens; i++) { root = screenInfo.screens[i]->root; if (!HasFocus(root) && !FirstFocusChild(root)) { /* If pointer was on PointerRootWin and changes to NoneWin, and * the pointer paired with dev is below the current root window, * do a NotifyPointer run. */ if (dev->focus && dev->focus->win == PointerRootWin && B != PointerRootWin) { WindowPtr ptrwin = PointerWin(GetMaster(dev, POINTER_OR_FLOAT)); if (ptrwin) CoreFocusOutNotifyPointerEvents(dev, root, None, mode, TRUE); } CoreFocusEvent(dev, FocusOut, mode, A ? NotifyPointerRoot : NotifyDetailNone, root); } } root = B; /* get B's root window */ while (root->parent) root = root->parent; if (B != root) { CoreFocusEvent(dev, FocusIn, mode, NotifyNonlinearVirtual, root); CoreFocusInEvents(dev, root, B, mode, NotifyNonlinearVirtual); } if (!HasFocus(B)) { WindowPtr child = FirstFocusChild(B); if (child) { CoreFocusEvent(dev, FocusIn, mode, NotifyInferior, B); /* NotifyPointer B-P unless P is child or below. */ CoreFocusInNotifyPointerEvents(dev, B, child, mode, FALSE); } else { CoreFocusEvent(dev, FocusIn, mode, NotifyNonlinear, B); /* NotifyPointer B-P unless P is child or below. */ CoreFocusInNotifyPointerEvents(dev, B, None, mode, FALSE); } } } static void CoreFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode) { if (!IsMaster(dev)) return; SetFocusOut(dev); if (((to == NullWindow) || (to == PointerRootWin)) && ((from == NullWindow) || (from == PointerRootWin))) CoreFocusPointerRootNoneSwitch(dev, from, to, mode); else if ((to == NullWindow) || (to == PointerRootWin)) CoreFocusToPointerRootOrNone(dev, from, to, mode); else if ((from == NullWindow) || (from == PointerRootWin)) CoreFocusFromPointerRootOrNone(dev, from, to, mode); else if (IsParent(from, to)) CoreFocusToDescendant(dev, from, to, mode); else if (IsParent(to, from)) CoreFocusToAncestor(dev, from, to, mode); else CoreFocusNonLinear(dev, from, to, mode); SetFocusIn(dev, to); } static void DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode) { int out, in; /* for holding details for to/from PointerRoot/None */ int i; int nscreens = screenInfo.numScreens; SpritePtr sprite = dev->spriteInfo->sprite; if (from == to) return; out = (from == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; in = (to == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; /* wrong values if neither, but then not referenced */ #ifdef PANORAMIX if (!noPanoramiXExtension) nscreens = 1; #endif if ((to == NullWindow) || (to == PointerRootWin)) { if ((from == NullWindow) || (from == PointerRootWin)) { if (from == PointerRootWin) DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode, NotifyPointer); /* Notify all the roots */ for (i = 0; i < nscreens; i++) DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root); } else { if (IsParent(from, sprite->win)) DeviceFocusOutEvents(dev, sprite->win, from, mode, NotifyPointer); DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from); /* next call catches the root too, if the screen changed */ DeviceFocusOutEvents(dev, from, NullWindow, mode, NotifyNonlinearVirtual); } /* Notify all the roots */ for (i = 0; i < nscreens; i++) DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root); if (to == PointerRootWin) { DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), sprite->win, mode, NotifyPointer); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyPointer, sprite->win); } } else { if ((from == NullWindow) || (from == PointerRootWin)) { if (from == PointerRootWin) DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode, NotifyPointer); for (i = 0; i < nscreens; i++) DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root); if (to->parent != NullWindow) DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), to, mode, NotifyNonlinearVirtual); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to); if (IsParent(to, sprite->win)) DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer); } else { if (IsParent(to, from)) { DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyAncestor, from); DeviceFocusOutEvents(dev, from, to, mode, NotifyVirtual); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyInferior, to); if ((IsParent(to, sprite->win)) && (sprite->win != from) && (!IsParent(from, sprite->win)) && (!IsParent(sprite->win, from))) DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer); } else if (IsParent(from, to)) { if ((IsParent(from, sprite->win)) && (sprite->win != from) && (!IsParent(to, sprite->win)) && (!IsParent(sprite->win, to))) DeviceFocusOutEvents(dev, sprite->win, from, mode, NotifyPointer); DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyInferior, from); DeviceFocusInEvents(dev, from, to, mode, NotifyVirtual); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyAncestor, to); } else { /* neither from or to is child of other */ WindowPtr common = CommonAncestor(to, from); /* common == NullWindow ==> different screens */ if (IsParent(from, sprite->win)) DeviceFocusOutEvents(dev, sprite->win, from, mode, NotifyPointer); DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from); if (from->parent != NullWindow) DeviceFocusOutEvents(dev, from, common, mode, NotifyNonlinearVirtual); if (to->parent != NullWindow) DeviceFocusInEvents(dev, common, to, mode, NotifyNonlinearVirtual); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to); if (IsParent(to, sprite->win)) DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer); } } } } /** * Figure out if focus events are necessary and send them to the * appropriate windows. * * @param from Window the focus moved out of. * @param to Window the focus moved into. */ void DoFocusEvents(DeviceIntPtr pDev, WindowPtr from, WindowPtr to, int mode) { if (!IsKeyboardDevice(pDev)) return; if (from == to) return; CoreFocusEvents(pDev, from, to, mode); DeviceFocusEvents(pDev, from, to, mode); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/������������������������������������������������������������������������������0000775�0001751�0001751�00000000000�12466505444�011463� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/Makefile.am�������������������������������������������������������������������0000664�0001751�0001751�00000003203�12323563340�013424� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������noinst_LTLIBRARIES = libXi.la libXistubs.la AM_CFLAGS = $(DIX_CFLAGS) libXi_la_SOURCES = \ allowev.c \ allowev.h \ chgdctl.c \ chgdctl.h \ chgfctl.c \ chgfctl.h \ chgkbd.c \ chgkbd.h \ chgkmap.c \ chgkmap.h \ chgprop.c \ chgprop.h \ chgptr.c \ chgptr.h \ closedev.c \ closedev.h \ devbell.c \ devbell.h \ exevents.c \ exglobals.h \ extinit.c \ getbmap.c \ getbmap.h \ getdctl.c \ getdctl.h \ getfctl.c \ getfctl.h \ getfocus.c \ getfocus.h \ getkmap.c \ getkmap.h \ getmmap.c \ getmmap.h \ getprop.c \ getprop.h \ getselev.c \ getselev.h \ getvers.c \ getvers.h \ grabdev.c \ grabdev.h \ grabdevb.c \ grabdevb.h \ grabdevk.c \ grabdevk.h \ gtmotion.c \ gtmotion.h \ listdev.c \ listdev.h \ opendev.c \ opendev.h \ queryst.c \ queryst.h \ selectev.c \ selectev.h \ sendexev.c \ sendexev.h \ setbmap.c \ setbmap.h \ setdval.c \ setdval.h \ setfocus.c \ setfocus.h \ setmmap.c \ setmmap.h \ setmode.c \ setmode.h \ ungrdev.c \ ungrdev.h \ ungrdevb.c \ ungrdevb.h \ ungrdevk.c \ ungrdevk.h \ xiallowev.c \ xiallowev.h \ xibarriers.c \ xibarriers.h \ xichangecursor.c \ xichangecursor.h \ xichangehierarchy.c \ xichangehierarchy.h \ xigetclientpointer.c \ xigetclientpointer.h \ xigrabdev.c \ xigrabdev.h \ xipassivegrab.h \ xipassivegrab.c \ xiproperty.c \ xiproperty.h \ xiquerydevice.c \ xiquerydevice.h \ xiquerypointer.c \ xiquerypointer.h \ xiqueryversion.c \ xiqueryversion.h \ xiselectev.c \ xiselectev.h \ xisetclientpointer.c \ xisetclientpointer.h \ xisetdevfocus.c \ xisetdevfocus.h \ xiwarppointer.c \ xiwarppointer.h libXistubs_la_SOURCES = \ stubs.c ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setmode.c���������������������������������������������������������������������0000664�0001751�0001751�00000011132�12274325511�013175� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to change the mode of an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "exglobals.h" #include "setmode.h" /*********************************************************************** * * Handle a request from a client with a different byte order. * */ int SProcXSetDeviceMode(ClientPtr client) { REQUEST(xSetDeviceModeReq); swaps(&stuff->length); return (ProcXSetDeviceMode(client)); } /*********************************************************************** * * This procedure sets the mode of a device. * */ int ProcXSetDeviceMode(ClientPtr client) { DeviceIntPtr dev; xSetDeviceModeReply rep; int rc; REQUEST(xSetDeviceModeReq); REQUEST_SIZE_MATCH(xSetDeviceModeReq); rep = (xSetDeviceModeReply) { .repType = X_Reply, .RepType = X_SetDeviceMode, .sequenceNumber = client->sequence, .length = 0 }; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) return rc; if (dev->valuator == NULL) return BadMatch; if (IsXTestDevice(dev, NULL)) return BadMatch; if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client)) rep.status = AlreadyGrabbed; else rep.status = SetDeviceMode(client, dev, stuff->mode); if (rep.status == Success) valuator_set_mode(dev, VALUATOR_MODE_ALL_AXES, stuff->mode); else if (rep.status != AlreadyGrabbed) { switch (rep.status) { case BadMatch: case BadImplementation: case BadAlloc: break; default: rep.status = BadMode; } return rep.status; } WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep); return Success; } /*********************************************************************** * * This procedure writes the reply for the XSetDeviceMode function, * if the client and server have a different byte ordering. * */ void SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiallowev.c�������������������������������������������������������������������0000664�0001751�0001751�00000007777�12456571574�013611� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Author: Peter Hutterer */ /*********************************************************************** * * Request to allow some device events. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "mi.h" #include "eventstr.h" #include <X11/extensions/XI2.h> #include <X11/extensions/XI2proto.h> #include "exglobals.h" /* BadDevice */ #include "exevents.h" #include "xiallowev.h" int SProcXIAllowEvents(ClientPtr client) { REQUEST(xXIAllowEventsReq); REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->time); if (stuff->length > 3) { xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff; REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); swapl(&req_xi22->touchid); swapl(&req_xi22->grab_window); } return ProcXIAllowEvents(client); } int ProcXIAllowEvents(ClientPtr client) { TimeStamp time; DeviceIntPtr dev; int ret = Success; XIClientPtr xi_client; Bool have_xi22 = FALSE; REQUEST(xXI2_2AllowEventsReq); xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); if (version_compare(xi_client->major_version, xi_client->minor_version, 2, 2) >= 0) { REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); have_xi22 = TRUE; } else { REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); } ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (ret != Success) return ret; time = ClientTimeToServerTime(stuff->time); switch (stuff->mode) { case XIReplayDevice: AllowSome(client, time, dev, NOT_GRABBED); break; case XISyncDevice: AllowSome(client, time, dev, FREEZE_NEXT_EVENT); break; case XIAsyncDevice: AllowSome(client, time, dev, THAWED); break; case XIAsyncPairedDevice: if (IsMaster(dev)) AllowSome(client, time, dev, THAW_OTHERS); break; case XISyncPair: if (IsMaster(dev)) AllowSome(client, time, dev, FREEZE_BOTH_NEXT_EVENT); break; case XIAsyncPair: if (IsMaster(dev)) AllowSome(client, time, dev, THAWED_BOTH); break; case XIRejectTouch: case XIAcceptTouch: { int rc; WindowPtr win; if (!have_xi22) return BadValue; rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess); if (rc != Success) return rc; ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid, stuff->grab_window, &client->errorValue); } break; default: client->errorValue = stuff->mode; ret = BadValue; } return ret; } �xorg-server-1.17.1/Xi/getfctl.h���������������������������������������������������������������������0000664�0001751�0001751�00000003145�12274325511�013177� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETFCTL_H #define GETFCTL_H 1 int SProcXGetFeedbackControl(ClientPtr /* client */ ); int ProcXGetFeedbackControl(ClientPtr /* client */ ); void SRepXGetFeedbackControl(ClientPtr /* client */ , int /* size */ , xGetFeedbackControlReply * /* rep */ ); #endif /* GETFCTL_H */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/extinit.c���������������������������������������������������������������������0000664�0001751�0001751�00000125112�12323563340�013224� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Dispatch routines and initialization routines for the X input extension. * */ #define NUMTYPES 15 #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" #include "gcstruct.h" /* pointer for extnsionst.h */ #include "extnsionst.h" /* extension entry */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include <X11/extensions/XI2proto.h> #include <X11/extensions/geproto.h> #include "geext.h" /* extension interfaces for ge */ #include "dixevents.h" #include "exevents.h" #include "extinit.h" #include "exglobals.h" #include "swaprep.h" #include "privates.h" #include "protocol-versions.h" /* modules local to Xi */ #include "allowev.h" #include "chgdctl.h" #include "chgfctl.h" #include "chgkbd.h" #include "chgprop.h" #include "chgptr.h" #include "closedev.h" #include "devbell.h" #include "getbmap.h" #include "getdctl.h" #include "getfctl.h" #include "getfocus.h" #include "getkmap.h" #include "getmmap.h" #include "getprop.h" #include "getselev.h" #include "getvers.h" #include "grabdev.h" #include "grabdevb.h" #include "grabdevk.h" #include "gtmotion.h" #include "listdev.h" #include "opendev.h" #include "queryst.h" #include "selectev.h" #include "sendexev.h" #include "chgkmap.h" #include "setbmap.h" #include "setdval.h" #include "setfocus.h" #include "setmmap.h" #include "setmode.h" #include "ungrdev.h" #include "ungrdevb.h" #include "ungrdevk.h" #include "xiallowev.h" #include "xiselectev.h" #include "xigrabdev.h" #include "xipassivegrab.h" #include "xisetdevfocus.h" #include "xiproperty.h" #include "xichangecursor.h" #include "xichangehierarchy.h" #include "xigetclientpointer.h" #include "xiquerydevice.h" #include "xiquerypointer.h" #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 * breaks down. The device needs the dev->button->motionMask. If DBMM is * the same as BMM, we can ensure that both core and device events can be * delivered, without the need for extra structures in the DeviceIntRec. */ const Mask DeviceKeyPressMask = KeyPressMask; const Mask DeviceKeyReleaseMask = KeyReleaseMask; const Mask DeviceButtonPressMask = ButtonPressMask; const Mask DeviceButtonReleaseMask = ButtonReleaseMask; const Mask DeviceProximityMask = (1L << 4); const Mask DeviceStateNotifyMask = (1L << 5); const Mask DevicePointerMotionMask = PointerMotionMask; const Mask DevicePointerMotionHintMask = PointerMotionHintMask; const Mask DeviceButton1MotionMask = Button1MotionMask; const Mask DeviceButton2MotionMask = Button2MotionMask; const Mask DeviceButton3MotionMask = Button3MotionMask; const Mask DeviceButton4MotionMask = Button4MotionMask; const Mask DeviceButton5MotionMask = Button5MotionMask; const Mask DeviceButtonMotionMask = ButtonMotionMask; const Mask DeviceFocusChangeMask = (1L << 14); const Mask DeviceMappingNotifyMask = (1L << 15); const Mask ChangeDeviceNotifyMask = (1L << 16); const Mask DeviceButtonGrabMask = (1L << 17); const Mask DeviceOwnerGrabButtonMask = (1L << 17); const Mask DevicePresenceNotifyMask = (1L << 18); const Mask DevicePropertyNotifyMask = (1L << 19); const Mask XIAllMasks = (1L << 20) - 1; int ExtEventIndex; Mask ExtExclusiveMasks[EMASKSIZE]; 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} }; CARD8 event_base[numInputClasses]; XExtEventInfo EventInfo[32]; static DeviceIntRec xi_all_devices; static DeviceIntRec xi_all_master_devices; /** * Dispatch vector. Functions defined in here will be called when the matching * request arrives. */ static int (*ProcIVector[]) (ClientPtr) = { NULL, /* 0 */ ProcXGetExtensionVersion, /* 1 */ ProcXListInputDevices, /* 2 */ ProcXOpenDevice, /* 3 */ ProcXCloseDevice, /* 4 */ ProcXSetDeviceMode, /* 5 */ ProcXSelectExtensionEvent, /* 6 */ ProcXGetSelectedExtensionEvents, /* 7 */ ProcXChangeDeviceDontPropagateList, /* 8 */ ProcXGetDeviceDontPropagateList, /* 9 */ ProcXGetDeviceMotionEvents, /* 10 */ ProcXChangeKeyboardDevice, /* 11 */ ProcXChangePointerDevice, /* 12 */ ProcXGrabDevice, /* 13 */ ProcXUngrabDevice, /* 14 */ ProcXGrabDeviceKey, /* 15 */ ProcXUngrabDeviceKey, /* 16 */ ProcXGrabDeviceButton, /* 17 */ ProcXUngrabDeviceButton, /* 18 */ ProcXAllowDeviceEvents, /* 19 */ ProcXGetDeviceFocus, /* 20 */ ProcXSetDeviceFocus, /* 21 */ ProcXGetFeedbackControl, /* 22 */ ProcXChangeFeedbackControl, /* 23 */ ProcXGetDeviceKeyMapping, /* 24 */ ProcXChangeDeviceKeyMapping, /* 25 */ ProcXGetDeviceModifierMapping, /* 26 */ ProcXSetDeviceModifierMapping, /* 27 */ ProcXGetDeviceButtonMapping, /* 28 */ ProcXSetDeviceButtonMapping, /* 29 */ ProcXQueryDeviceState, /* 30 */ ProcXSendExtensionEvent, /* 31 */ ProcXDeviceBell, /* 32 */ ProcXSetDeviceValuators, /* 33 */ ProcXGetDeviceControl, /* 34 */ ProcXChangeDeviceControl, /* 35 */ /* XI 1.5 */ ProcXListDeviceProperties, /* 36 */ ProcXChangeDeviceProperty, /* 37 */ ProcXDeleteDeviceProperty, /* 38 */ ProcXGetDeviceProperty, /* 39 */ /* XI 2 */ ProcXIQueryPointer, /* 40 */ ProcXIWarpPointer, /* 41 */ ProcXIChangeCursor, /* 42 */ ProcXIChangeHierarchy, /* 43 */ ProcXISetClientPointer, /* 44 */ ProcXIGetClientPointer, /* 45 */ ProcXISelectEvents, /* 46 */ ProcXIQueryVersion, /* 47 */ ProcXIQueryDevice, /* 48 */ ProcXISetFocus, /* 49 */ ProcXIGetFocus, /* 50 */ ProcXIGrabDevice, /* 51 */ ProcXIUngrabDevice, /* 52 */ ProcXIAllowEvents, /* 53 */ ProcXIPassiveGrabDevice, /* 54 */ ProcXIPassiveUngrabDevice, /* 55 */ ProcXIListProperties, /* 56 */ ProcXIChangeProperty, /* 57 */ ProcXIDeleteProperty, /* 58 */ ProcXIGetProperty, /* 59 */ ProcXIGetSelectedEvents, /* 60 */ ProcXIBarrierReleasePointer /* 61 */ }; /* For swapped clients */ static int (*SProcIVector[]) (ClientPtr) = { NULL, /* 0 */ SProcXGetExtensionVersion, /* 1 */ SProcXListInputDevices, /* 2 */ SProcXOpenDevice, /* 3 */ SProcXCloseDevice, /* 4 */ SProcXSetDeviceMode, /* 5 */ SProcXSelectExtensionEvent, /* 6 */ SProcXGetSelectedExtensionEvents, /* 7 */ SProcXChangeDeviceDontPropagateList, /* 8 */ SProcXGetDeviceDontPropagateList, /* 9 */ SProcXGetDeviceMotionEvents, /* 10 */ SProcXChangeKeyboardDevice, /* 11 */ SProcXChangePointerDevice, /* 12 */ SProcXGrabDevice, /* 13 */ SProcXUngrabDevice, /* 14 */ SProcXGrabDeviceKey, /* 15 */ SProcXUngrabDeviceKey, /* 16 */ SProcXGrabDeviceButton, /* 17 */ SProcXUngrabDeviceButton, /* 18 */ SProcXAllowDeviceEvents, /* 19 */ SProcXGetDeviceFocus, /* 20 */ SProcXSetDeviceFocus, /* 21 */ SProcXGetFeedbackControl, /* 22 */ SProcXChangeFeedbackControl, /* 23 */ SProcXGetDeviceKeyMapping, /* 24 */ SProcXChangeDeviceKeyMapping, /* 25 */ SProcXGetDeviceModifierMapping, /* 26 */ SProcXSetDeviceModifierMapping, /* 27 */ SProcXGetDeviceButtonMapping, /* 28 */ SProcXSetDeviceButtonMapping, /* 29 */ SProcXQueryDeviceState, /* 30 */ SProcXSendExtensionEvent, /* 31 */ SProcXDeviceBell, /* 32 */ SProcXSetDeviceValuators, /* 33 */ SProcXGetDeviceControl, /* 34 */ SProcXChangeDeviceControl, /* 35 */ SProcXListDeviceProperties, /* 36 */ SProcXChangeDeviceProperty, /* 37 */ SProcXDeleteDeviceProperty, /* 38 */ SProcXGetDeviceProperty, /* 39 */ SProcXIQueryPointer, /* 40 */ SProcXIWarpPointer, /* 41 */ SProcXIChangeCursor, /* 42 */ SProcXIChangeHierarchy, /* 43 */ SProcXISetClientPointer, /* 44 */ SProcXIGetClientPointer, /* 45 */ SProcXISelectEvents, /* 46 */ SProcXIQueryVersion, /* 47 */ SProcXIQueryDevice, /* 48 */ SProcXISetFocus, /* 49 */ SProcXIGetFocus, /* 50 */ SProcXIGrabDevice, /* 51 */ SProcXIUngrabDevice, /* 52 */ SProcXIAllowEvents, /* 53 */ SProcXIPassiveGrabDevice, /* 54 */ SProcXIPassiveUngrabDevice, /* 55 */ SProcXIListProperties, /* 56 */ SProcXIChangeProperty, /* 57 */ SProcXIDeleteProperty, /* 58 */ SProcXIGetProperty, /* 59 */ SProcXIGetSelectedEvents, /* 60 */ SProcXIBarrierReleasePointer /* 61 */ }; /***************************************************************** * * Globals referenced elsewhere in the server. * */ int IReqCode = 0; int IEventBase = 0; int BadDevice = 0; static int BadEvent = 1; int BadMode = 2; int DeviceBusy = 3; int BadClass = 4; int DeviceValuator; int DeviceKeyPress; int DeviceKeyRelease; int DeviceButtonPress; int DeviceButtonRelease; int DeviceMotionNotify; int DeviceFocusIn; int DeviceFocusOut; int ProximityIn; int ProximityOut; int DeviceStateNotify; int DeviceKeyStateNotify; int DeviceButtonStateNotify; int DeviceMappingNotify; int ChangeDeviceNotify; int DevicePresenceNotify; int DevicePropertyNotify; RESTYPE RT_INPUTCLIENT; /***************************************************************** * * Externs defined elsewhere in the X server. * */ extern XExtensionVersion XIVersion; Mask PropagateMask[EMASKSIZE]; /***************************************************************** * * Versioning support * */ DevPrivateKeyRec XIClientPrivateKeyRec; /***************************************************************** * * Declarations of local routines. * */ static void XIClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; XIClientPtr pXIClient; pXIClient = dixLookupPrivate(&pClient->devPrivates, XIClientPrivateKey); pXIClient->major_version = 0; pXIClient->minor_version = 0; } /************************************************************************* * * ProcIDispatch - main dispatch routine for requests to this extension. * This routine is used if server and client have the same byte ordering. * */ static int ProcIDispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data]) return BadRequest; return (*ProcIVector[stuff->data]) (client); } /******************************************************************************* * * SProcXDispatch * * Main swapped dispatch routine for requests to this extension. * This routine is used if server and client do not have the same byte ordering. * */ static int SProcIDispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data]) return BadRequest; return (*SProcIVector[stuff->data]) (client); } /********************************************************************** * * SReplyIDispatch * Swap any replies defined in this extension. * */ static void SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) { /* All we look at is the type field */ /* This is common to all replies */ if (rep->RepType == X_GetExtensionVersion) SRepXGetExtensionVersion(client, len, (xGetExtensionVersionReply *) rep); else if (rep->RepType == X_ListInputDevices) SRepXListInputDevices(client, len, (xListInputDevicesReply *) rep); else if (rep->RepType == X_OpenDevice) SRepXOpenDevice(client, len, (xOpenDeviceReply *) rep); else if (rep->RepType == X_SetDeviceMode) SRepXSetDeviceMode(client, len, (xSetDeviceModeReply *) rep); else if (rep->RepType == X_GetSelectedExtensionEvents) SRepXGetSelectedExtensionEvents(client, len, (xGetSelectedExtensionEventsReply *) rep); else if (rep->RepType == X_GetDeviceDontPropagateList) SRepXGetDeviceDontPropagateList(client, len, (xGetDeviceDontPropagateListReply *) rep); else if (rep->RepType == X_GetDeviceMotionEvents) SRepXGetDeviceMotionEvents(client, len, (xGetDeviceMotionEventsReply *) rep); else if (rep->RepType == X_GrabDevice) SRepXGrabDevice(client, len, (xGrabDeviceReply *) rep); else if (rep->RepType == X_GetDeviceFocus) SRepXGetDeviceFocus(client, len, (xGetDeviceFocusReply *) rep); else if (rep->RepType == X_GetFeedbackControl) SRepXGetFeedbackControl(client, len, (xGetFeedbackControlReply *) rep); else if (rep->RepType == X_GetDeviceKeyMapping) SRepXGetDeviceKeyMapping(client, len, (xGetDeviceKeyMappingReply *) rep); else if (rep->RepType == X_GetDeviceModifierMapping) SRepXGetDeviceModifierMapping(client, len, (xGetDeviceModifierMappingReply *) rep); else if (rep->RepType == X_SetDeviceModifierMapping) SRepXSetDeviceModifierMapping(client, len, (xSetDeviceModifierMappingReply *) rep); else if (rep->RepType == X_GetDeviceButtonMapping) SRepXGetDeviceButtonMapping(client, len, (xGetDeviceButtonMappingReply *) rep); else if (rep->RepType == X_SetDeviceButtonMapping) SRepXSetDeviceButtonMapping(client, len, (xSetDeviceButtonMappingReply *) rep); else if (rep->RepType == X_QueryDeviceState) SRepXQueryDeviceState(client, len, (xQueryDeviceStateReply *) rep); else if (rep->RepType == X_SetDeviceValuators) SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep); else if (rep->RepType == X_GetDeviceControl) SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep); else if (rep->RepType == X_ChangeDeviceControl) SRepXChangeDeviceControl(client, len, (xChangeDeviceControlReply *) rep); else if (rep->RepType == X_ListDeviceProperties) SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply *) rep); else if (rep->RepType == X_GetDeviceProperty) SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep); else if (rep->RepType == X_XIQueryPointer) SRepXIQueryPointer(client, len, (xXIQueryPointerReply *) rep); else if (rep->RepType == X_XIGetClientPointer) SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply *) rep); else if (rep->RepType == X_XIQueryVersion) SRepXIQueryVersion(client, len, (xXIQueryVersionReply *) rep); else if (rep->RepType == X_XIQueryDevice) SRepXIQueryDevice(client, len, (xXIQueryDeviceReply *) rep); else if (rep->RepType == X_XIGrabDevice) SRepXIGrabDevice(client, len, (xXIGrabDeviceReply *) rep); else if (rep->RepType == X_XIPassiveGrabDevice) SRepXIPassiveGrabDevice(client, len, (xXIPassiveGrabDeviceReply *) rep); else if (rep->RepType == X_XIListProperties) SRepXIListProperties(client, len, (xXIListPropertiesReply *) rep); else if (rep->RepType == X_XIGetProperty) SRepXIGetProperty(client, len, (xXIGetPropertyReply *) rep); else if (rep->RepType == X_XIGetSelectedEvents) SRepXIGetSelectedEvents(client, len, (xXIGetSelectedEventsReply *) rep); else if (rep->RepType == X_XIGetFocus) SRepXIGetFocus(client, len, (xXIGetFocusReply *) rep); else { FatalError("XINPUT confused sending swapped reply"); } } /************************************************************************ * * This function swaps the DeviceValuator event. * */ static void SEventDeviceValuator(deviceValuator * from, deviceValuator * to) { int i; INT32 *ip B32; *to = *from; swaps(&to->sequenceNumber); swaps(&to->device_state); ip = &to->valuator0; for (i = 0; i < 6; i++) { swapl(ip + i); } } static void SEventFocus(deviceFocus * from, deviceFocus * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->time); swapl(&to->window); } static void SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to) { int i; INT32 *ip B32; *to = *from; swaps(&to->sequenceNumber); swapl(&to->time); ip = &to->valuator0; for (i = 0; i < 3; i++) { swapl(ip + i); } } static void SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from, deviceKeyStateNotify * to) { *to = *from; swaps(&to->sequenceNumber); } static void SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from, deviceButtonStateNotify * to) { *to = *from; swaps(&to->sequenceNumber); } static void SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->time); } static void SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->time); } static void SDevicePresenceNotifyEvent(devicePresenceNotify * from, devicePresenceNotify * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->time); swaps(&to->control); } static void SDevicePropertyNotifyEvent(devicePropertyNotify * from, devicePropertyNotify * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->time); swapl(&to->atom); } static void SDeviceLeaveNotifyEvent(xXILeaveEvent * from, xXILeaveEvent * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swaps(&to->deviceid); swapl(&to->time); swapl(&to->root); swapl(&to->event); swapl(&to->child); swapl(&to->root_x); swapl(&to->root_y); swapl(&to->event_x); swapl(&to->event_y); swaps(&to->sourceid); swaps(&to->buttons_len); swapl(&to->mods.base_mods); swapl(&to->mods.latched_mods); swapl(&to->mods.locked_mods); } static void SDeviceChangedEvent(xXIDeviceChangedEvent * from, xXIDeviceChangedEvent * to) { int i, j; xXIAnyInfo *any; *to = *from; memcpy(&to[1], &from[1], from->length * 4); any = (xXIAnyInfo *) &to[1]; for (i = 0; i < to->num_classes; i++) { int length = any->length; switch (any->type) { case KeyClass: { xXIKeyInfo *ki = (xXIKeyInfo *) any; uint32_t *key = (uint32_t *) &ki[1]; for (j = 0; j < ki->num_keycodes; j++, key++) swapl(key); swaps(&ki->num_keycodes); } break; case ButtonClass: { xXIButtonInfo *bi = (xXIButtonInfo *) any; Atom *labels = (Atom *) ((char *) bi + sizeof(xXIButtonInfo) + pad_to_int32(bits_to_bytes (bi->num_buttons))); for (j = 0; j < bi->num_buttons; j++) swapl(&labels[j]); swaps(&bi->num_buttons); } break; case ValuatorClass: { xXIValuatorInfo *ai = (xXIValuatorInfo *) any; swapl(&ai->label); swapl(&ai->min.integral); swapl(&ai->min.frac); swapl(&ai->max.integral); swapl(&ai->max.frac); swapl(&ai->resolution); swaps(&ai->number); } break; } swaps(&any->type); swaps(&any->length); swaps(&any->sourceid); any = (xXIAnyInfo *) ((char *) any + length * 4); } swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swaps(&to->deviceid); swapl(&to->time); swaps(&to->num_classes); swaps(&to->sourceid); } static void SDeviceEvent(xXIDeviceEvent * from, xXIDeviceEvent * to) { int i; char *ptr; char *vmask; memcpy(to, from, sizeof(xEvent) + from->length * 4); swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swaps(&to->deviceid); swapl(&to->time); swapl(&to->detail); swapl(&to->root); swapl(&to->event); swapl(&to->child); swapl(&to->root_x); swapl(&to->root_y); swapl(&to->event_x); swapl(&to->event_y); swaps(&to->buttons_len); swaps(&to->valuators_len); swaps(&to->sourceid); swapl(&to->mods.base_mods); swapl(&to->mods.latched_mods); swapl(&to->mods.locked_mods); swapl(&to->mods.effective_mods); swapl(&to->flags); ptr = (char *) (&to[1]); ptr += from->buttons_len * 4; vmask = ptr; /* valuator mask */ ptr += from->valuators_len * 4; for (i = 0; i < from->valuators_len * 32; i++) { if (BitIsOn(vmask, i)) { swapl(((uint32_t *) ptr)); ptr += 4; swapl(((uint32_t *) ptr)); ptr += 4; } } } static void SDeviceHierarchyEvent(xXIHierarchyEvent * from, xXIHierarchyEvent * to) { int i; xXIHierarchyInfo *info; *to = *from; memcpy(&to[1], &from[1], from->length * 4); swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swaps(&to->deviceid); swapl(&to->time); swapl(&to->flags); swaps(&to->num_info); info = (xXIHierarchyInfo *) &to[1]; for (i = 0; i < from->num_info; i++) { swaps(&info->deviceid); swaps(&info->attachment); info++; } } static void SXIPropertyEvent(xXIPropertyEvent * from, xXIPropertyEvent * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swaps(&to->deviceid); swapl(&to->property); } static void SRawEvent(xXIRawEvent * from, xXIRawEvent * to) { int i; FP3232 *values; unsigned char *mask; memcpy(to, from, sizeof(xEvent) + from->length * 4); swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swaps(&to->deviceid); swapl(&to->time); swapl(&to->detail); mask = (unsigned char *) &to[1]; values = (FP3232 *) (mask + from->valuators_len * 4); for (i = 0; i < from->valuators_len * 4 * 8; i++) { if (BitIsOn(mask, i)) { /* for each bit set there are two FP3232 values on the wire, in * the order abcABC for data and data_raw. Here we swap as if * they were in aAbBcC order because it's easier and really * doesn't matter. */ swapl(&values->integral); swapl(&values->frac); values++; swapl(&values->integral); swapl(&values->frac); values++; } } swaps(&to->valuators_len); } static void STouchOwnershipEvent(xXITouchOwnershipEvent * from, xXITouchOwnershipEvent * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swaps(&to->deviceid); swapl(&to->time); swaps(&to->sourceid); swapl(&to->touchid); swapl(&to->flags); swapl(&to->root); swapl(&to->event); swapl(&to->child); } static void SBarrierEvent(xXIBarrierEvent * from, xXIBarrierEvent * to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); swapl(&to->time); swaps(&to->deviceid); swaps(&to->sourceid); swapl(&to->event); swapl(&to->root); swapl(&to->root_x); swapl(&to->root_y); swapl(&to->dx.integral); swapl(&to->dx.frac); swapl(&to->dy.integral); swapl(&to->dy.frac); swapl(&to->dtime); swapl(&to->barrier); swapl(&to->eventid); } /** Event swapping function for XI2 events. */ void XI2EventSwap(xGenericEvent *from, xGenericEvent *to) { switch (from->evtype) { case XI_Enter: case XI_Leave: case XI_FocusIn: case XI_FocusOut: SDeviceLeaveNotifyEvent((xXILeaveEvent *) from, (xXILeaveEvent *) to); break; case XI_DeviceChanged: SDeviceChangedEvent((xXIDeviceChangedEvent *) from, (xXIDeviceChangedEvent *) to); break; case XI_HierarchyChanged: SDeviceHierarchyEvent((xXIHierarchyEvent *) from, (xXIHierarchyEvent *) to); break; case XI_PropertyEvent: SXIPropertyEvent((xXIPropertyEvent *) from, (xXIPropertyEvent *) to); break; case XI_Motion: case XI_KeyPress: case XI_KeyRelease: case XI_ButtonPress: case XI_ButtonRelease: case XI_TouchBegin: case XI_TouchUpdate: case XI_TouchEnd: SDeviceEvent((xXIDeviceEvent *) from, (xXIDeviceEvent *) to); break; case XI_TouchOwnership: STouchOwnershipEvent((xXITouchOwnershipEvent *) from, (xXITouchOwnershipEvent *) to); break; case XI_RawMotion: case XI_RawKeyPress: case XI_RawKeyRelease: case XI_RawButtonPress: case XI_RawButtonRelease: case XI_RawTouchBegin: case XI_RawTouchUpdate: 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; } } /************************************************************************** * * Allow the specified event to have its propagation suppressed. * The default is to not allow suppression of propagation. * */ static void AllowPropagateSuppress(Mask mask) { int i; for (i = 0; i < MAXDEVICES; i++) PropagateMask[i] |= mask; } /************************************************************************** * * Record an event mask where there is no unique corresponding event type. * We can't call SetMaskForEvent, since that would clobber the existing * mask for that event. MotionHint and ButtonMotion are examples. * * Since extension event types will never be less than 64, we can use * 0-63 in the EventInfo array as the "type" to be used to look up this * mask. This means that the corresponding macros such as * DevicePointerMotionHint must have access to the same constants. * */ static void SetEventInfo(Mask mask, int constant) { EventInfo[ExtEventIndex].mask = mask; EventInfo[ExtEventIndex++].type = constant; } /************************************************************************** * * Allow the specified event to be restricted to being selected by one * client at a time. * The default is to allow more than one client to select the event. * */ static void SetExclusiveAccess(Mask mask) { int i; for (i = 0; i < MAXDEVICES; i++) ExtExclusiveMasks[i] |= mask; } /************************************************************************** * * Assign the specified mask to the specified event. * */ static void SetMaskForExtEvent(Mask mask, int event) { int i; EventInfo[ExtEventIndex].mask = mask; EventInfo[ExtEventIndex++].type = event; if ((event < LASTEvent) || (event >= 128)) FatalError("MaskForExtensionEvent: bogus event number"); for (i = 0; i < MAXDEVICES; i++) SetMaskForEvent(i, mask, event); } /************************************************************************ * * This function sets up extension event types and masks. * */ static void FixExtensionEvents(ExtensionEntry * extEntry) { DeviceValuator = extEntry->eventBase; DeviceKeyPress = DeviceValuator + 1; DeviceKeyRelease = DeviceKeyPress + 1; DeviceButtonPress = DeviceKeyRelease + 1; DeviceButtonRelease = DeviceButtonPress + 1; DeviceMotionNotify = DeviceButtonRelease + 1; DeviceFocusIn = DeviceMotionNotify + 1; DeviceFocusOut = DeviceFocusIn + 1; ProximityIn = DeviceFocusOut + 1; ProximityOut = ProximityIn + 1; DeviceStateNotify = ProximityOut + 1; DeviceMappingNotify = DeviceStateNotify + 1; ChangeDeviceNotify = DeviceMappingNotify + 1; DeviceKeyStateNotify = ChangeDeviceNotify + 1; DeviceButtonStateNotify = DeviceKeyStateNotify + 1; DevicePresenceNotify = DeviceButtonStateNotify + 1; DevicePropertyNotify = DevicePresenceNotify + 1; event_base[KeyClass] = DeviceKeyPress; event_base[ButtonClass] = DeviceButtonPress; event_base[ValuatorClass] = DeviceMotionNotify; event_base[ProximityClass] = ProximityIn; event_base[FocusClass] = DeviceFocusIn; event_base[OtherClass] = DeviceStateNotify; BadDevice += extEntry->errorBase; BadEvent += extEntry->errorBase; BadMode += extEntry->errorBase; DeviceBusy += extEntry->errorBase; BadClass += extEntry->errorBase; SetMaskForExtEvent(DeviceKeyPressMask, DeviceKeyPress); AllowPropagateSuppress(DeviceKeyPressMask); SetCriticalEvent(DeviceKeyPress); SetMaskForExtEvent(DeviceKeyReleaseMask, DeviceKeyRelease); AllowPropagateSuppress(DeviceKeyReleaseMask); SetCriticalEvent(DeviceKeyRelease); SetMaskForExtEvent(DeviceButtonPressMask, DeviceButtonPress); AllowPropagateSuppress(DeviceButtonPressMask); SetCriticalEvent(DeviceButtonPress); SetMaskForExtEvent(DeviceButtonReleaseMask, DeviceButtonRelease); AllowPropagateSuppress(DeviceButtonReleaseMask); SetCriticalEvent(DeviceButtonRelease); SetMaskForExtEvent(DeviceProximityMask, ProximityIn); SetMaskForExtEvent(DeviceProximityMask, ProximityOut); SetMaskForExtEvent(DeviceStateNotifyMask, DeviceStateNotify); SetMaskForExtEvent(DevicePointerMotionMask, DeviceMotionNotify); AllowPropagateSuppress(DevicePointerMotionMask); SetCriticalEvent(DeviceMotionNotify); SetEventInfo(DevicePointerMotionHintMask, _devicePointerMotionHint); SetEventInfo(DeviceButton1MotionMask, _deviceButton1Motion); SetEventInfo(DeviceButton2MotionMask, _deviceButton2Motion); SetEventInfo(DeviceButton3MotionMask, _deviceButton3Motion); SetEventInfo(DeviceButton4MotionMask, _deviceButton4Motion); SetEventInfo(DeviceButton5MotionMask, _deviceButton5Motion); SetEventInfo(DeviceButtonMotionMask, _deviceButtonMotion); SetMaskForExtEvent(DeviceFocusChangeMask, DeviceFocusIn); SetMaskForExtEvent(DeviceFocusChangeMask, DeviceFocusOut); SetMaskForExtEvent(DeviceMappingNotifyMask, DeviceMappingNotify); SetMaskForExtEvent(ChangeDeviceNotifyMask, ChangeDeviceNotify); SetEventInfo(DeviceButtonGrabMask, _deviceButtonGrab); SetExclusiveAccess(DeviceButtonGrabMask); SetEventInfo(DeviceOwnerGrabButtonMask, _deviceOwnerGrabButton); SetEventInfo(DevicePresenceNotifyMask, _devicePresence); SetMaskForExtEvent(DevicePropertyNotifyMask, DevicePropertyNotify); SetEventInfo(0, _noExtensionEvent); } /************************************************************************ * * This function restores extension event types and masks to their * initial state. * */ static void RestoreExtensionEvents(void) { int i, j; IReqCode = 0; IEventBase = 0; for (i = 0; i < ExtEventIndex - 1; i++) { if ((EventInfo[i].type >= LASTEvent) && (EventInfo[i].type < 128)) { for (j = 0; j < MAXDEVICES; j++) SetMaskForEvent(j, 0, EventInfo[i].type); } EventInfo[i].mask = 0; EventInfo[i].type = 0; } ExtEventIndex = 0; DeviceValuator = 0; DeviceKeyPress = 1; DeviceKeyRelease = 2; DeviceButtonPress = 3; DeviceButtonRelease = 4; DeviceMotionNotify = 5; DeviceFocusIn = 6; DeviceFocusOut = 7; ProximityIn = 8; ProximityOut = 9; DeviceStateNotify = 10; DeviceMappingNotify = 11; ChangeDeviceNotify = 12; DeviceKeyStateNotify = 13; DeviceButtonStateNotify = 13; DevicePresenceNotify = 14; DevicePropertyNotify = 15; BadDevice = 0; BadEvent = 1; BadMode = 2; DeviceBusy = 3; BadClass = 4; } /*********************************************************************** * * IResetProc. * Remove reply-swapping routine. * Remove event-swapping routine. * */ static void IResetProc(ExtensionEntry * unused) { ReplySwapVector[IReqCode] = ReplyNotSwappd; EventSwapVector[DeviceValuator] = NotImplemented; EventSwapVector[DeviceKeyPress] = NotImplemented; EventSwapVector[DeviceKeyRelease] = NotImplemented; EventSwapVector[DeviceButtonPress] = NotImplemented; EventSwapVector[DeviceButtonRelease] = NotImplemented; EventSwapVector[DeviceMotionNotify] = NotImplemented; EventSwapVector[DeviceFocusIn] = NotImplemented; EventSwapVector[DeviceFocusOut] = NotImplemented; EventSwapVector[ProximityIn] = NotImplemented; EventSwapVector[ProximityOut] = NotImplemented; EventSwapVector[DeviceStateNotify] = NotImplemented; EventSwapVector[DeviceKeyStateNotify] = NotImplemented; EventSwapVector[DeviceButtonStateNotify] = NotImplemented; EventSwapVector[DeviceMappingNotify] = NotImplemented; EventSwapVector[ChangeDeviceNotify] = NotImplemented; EventSwapVector[DevicePresenceNotify] = NotImplemented; EventSwapVector[DevicePropertyNotify] = NotImplemented; RestoreExtensionEvents(); free(xi_all_devices.name); free(xi_all_master_devices.name); XIBarrierReset(); } /*********************************************************************** * * Assign an id and type to an input device. * */ void AssignTypeAndName(DeviceIntPtr dev, Atom type, const char *name) { dev->xinput_type = type; dev->name = strdup(name); } /*********************************************************************** * * Make device type atoms. * */ static void MakeDeviceTypeAtoms(void) { int i; for (i = 0; i < NUMTYPES; i++) dev_type[i].type = MakeAtom(dev_type[i].name, strlen(dev_type[i].name), 1); } /***************************************************************************** * * SEventIDispatch * * Swap any events defined in this extension. */ #define DO_SWAP(func,type) func ((type *)from, (type *)to) static void SEventIDispatch(xEvent *from, xEvent *to) { int type = from->u.u.type & 0177; if (type == DeviceValuator) DO_SWAP(SEventDeviceValuator, deviceValuator); else if (type == DeviceKeyPress) { SKeyButtonPtrEvent(from, to); to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceKeyRelease) { SKeyButtonPtrEvent(from, to); to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceButtonPress) { SKeyButtonPtrEvent(from, to); to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceButtonRelease) { SKeyButtonPtrEvent(from, to); to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceMotionNotify) { SKeyButtonPtrEvent(from, to); to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceFocusIn) DO_SWAP(SEventFocus, deviceFocus); else if (type == DeviceFocusOut) DO_SWAP(SEventFocus, deviceFocus); else if (type == ProximityIn) { SKeyButtonPtrEvent(from, to); to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == ProximityOut) { SKeyButtonPtrEvent(from, to); to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceStateNotify) DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify); else if (type == DeviceKeyStateNotify) DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify); else if (type == DeviceButtonStateNotify) DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify); else if (type == DeviceMappingNotify) DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify); else if (type == ChangeDeviceNotify) DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify); else if (type == DevicePresenceNotify) DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify); else if (type == DevicePropertyNotify) DO_SWAP(SDevicePropertyNotifyEvent, devicePropertyNotify); else { FatalError("XInputExtension: Impossible event!\n"); } } /********************************************************************** * * IExtensionInit - initialize the input extension. * * Called from InitExtensions in main() or from QueryExtension() if the * extension is dynamically loaded. * * This extension has several events and errors. * * XI is mandatory nowadays, so if we fail to init XI, we die. */ void XInputExtensionInit(void) { ExtensionEntry *extEntry; XExtensionVersion thisversion = { XI_Present, SERVER_XI_MAJOR_VERSION, SERVER_XI_MINOR_VERSION, }; if (!dixRegisterPrivateKey (&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec))) FatalError("Cannot request private for XI.\n"); 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) { IReqCode = extEntry->base; IEventBase = extEntry->eventBase; XIVersion = thisversion; MakeDeviceTypeAtoms(); RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone, "INPUTCLIENT"); if (!RT_INPUTCLIENT) FatalError("Failed to add resource type for XI.\n"); FixExtensionEvents(extEntry); ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch; EventSwapVector[DeviceValuator] = SEventIDispatch; EventSwapVector[DeviceKeyPress] = SEventIDispatch; EventSwapVector[DeviceKeyRelease] = SEventIDispatch; EventSwapVector[DeviceButtonPress] = SEventIDispatch; EventSwapVector[DeviceButtonRelease] = SEventIDispatch; EventSwapVector[DeviceMotionNotify] = SEventIDispatch; EventSwapVector[DeviceFocusIn] = SEventIDispatch; EventSwapVector[DeviceFocusOut] = SEventIDispatch; EventSwapVector[ProximityIn] = SEventIDispatch; EventSwapVector[ProximityOut] = SEventIDispatch; EventSwapVector[DeviceStateNotify] = SEventIDispatch; EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch; EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch; EventSwapVector[DeviceMappingNotify] = SEventIDispatch; EventSwapVector[ChangeDeviceNotify] = SEventIDispatch; EventSwapVector[DevicePresenceNotify] = SEventIDispatch; GERegisterExtension(IReqCode, XI2EventSwap); 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 = strdup("XIAllDevices"); xi_all_master_devices.id = XIAllMasterDevices; xi_all_master_devices.name = strdup("XIAllMasterDevices"); inputInfo.all_devices = &xi_all_devices; inputInfo.all_master_devices = &xi_all_master_devices; XIResetProperties(); } else { FatalError("IExtensionInit: AddExtensions failed\n"); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getselev.c��������������������������������������������������������������������0000664�0001751�0001751�00000014142�12274325511�013357� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to get the current selected events for a given window. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window struct */ #include "exglobals.h" #include "swaprep.h" #include "getprop.h" #include "getselev.h" /*********************************************************************** * * This procedure gets the current selected extension events. * */ int SProcXGetSelectedExtensionEvents(ClientPtr client) { REQUEST(xGetSelectedExtensionEventsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); swapl(&stuff->window); return (ProcXGetSelectedExtensionEvents(client)); } /*********************************************************************** * * This procedure gets the current device select mask, * if the client and server have a different byte ordering. * */ int ProcXGetSelectedExtensionEvents(ClientPtr client) { int i, rc, total_length = 0; xGetSelectedExtensionEventsReply rep; WindowPtr pWin; XEventClass *buf = NULL; XEventClass *tclient; XEventClass *aclient; OtherInputMasks *pOthers; InputClientsPtr others; REQUEST(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); 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) return rc; if ((pOthers = wOtherInputMasks(pWin)) != 0) { for (others = pOthers->inputClients; others; others = others->next) for (i = 0; i < EMASKSIZE; i++) ClassFromMask(NULL, others->mask[i], i, &rep.all_clients_count, COUNT); for (others = pOthers->inputClients; others; others = others->next) if (SameClient(others, client)) { for (i = 0; i < EMASKSIZE; i++) ClassFromMask(NULL, others->mask[i], i, &rep.this_client_count, COUNT); break; } total_length = (rep.all_clients_count + rep.this_client_count) * sizeof(XEventClass); rep.length = bytes_to_int32(total_length); buf = (XEventClass *) malloc(total_length); tclient = buf; aclient = buf + rep.this_client_count; if (others) for (i = 0; i < EMASKSIZE; i++) tclient = ClassFromMask(tclient, others->mask[i], i, NULL, CREATE); for (others = pOthers->inputClients; others; others = others->next) for (i = 0; i < EMASKSIZE; i++) aclient = ClassFromMask(aclient, others->mask[i], i, NULL, CREATE); } WriteReplyToClient(client, sizeof(xGetSelectedExtensionEventsReply), &rep); if (total_length) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, total_length, buf); } free(buf); return Success; } /*********************************************************************** * * This procedure writes the reply for the XGetSelectedExtensionEvents function, * if the client and server have a different byte ordering. * */ void SRepXGetSelectedExtensionEvents(ClientPtr client, int size, xGetSelectedExtensionEventsReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->this_client_count); swaps(&rep->all_clients_count); WriteToClient(client, size, rep); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/grabdevb.c��������������������������������������������������������������������0000664�0001751�0001751�00000012125�12274325511�013314� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to grab a button on an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "xace.h" #include "grabdev.h" #include "grabdevb.h" /*********************************************************************** * * Handle requests from clients with a different byte order. * */ int SProcXGrabDeviceButton(ClientPtr client) { REQUEST(xGrabDeviceButtonReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); swaps(&stuff->event_count); REQUEST_FIXED_SIZE(xGrabDeviceButtonReq, stuff->event_count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); return (ProcXGrabDeviceButton(client)); } /*********************************************************************** * * Grab a button on an extension device. * */ int ProcXGrabDeviceButton(ClientPtr client) { int ret; DeviceIntPtr dev; DeviceIntPtr mdev; XEventClass *class; struct tmask tmp[EMASKSIZE]; GrabParameters param; GrabMask mask; REQUEST(xGrabDeviceButtonReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count) return BadLength; ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (ret != Success) return ret; if (stuff->modifier_device != UseXKeyboard) { ret = dixLookupDevice(&mdev, stuff->modifier_device, client, DixUseAccess); if (ret != Success) return ret; if (mdev->key == NULL) return BadMatch; } else { mdev = PickKeyboard(client); ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess); if (ret != Success) return ret; } class = (XEventClass *) (&stuff[1]); /* first word of values */ if ((ret = CreateMaskFromList(client, class, stuff->event_count, tmp, dev, X_GrabDeviceButton)) != Success) return ret; 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); return ret; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiproperty.h������������������������������������������������������������������0000664�0001751�0001751�00000005076�12274325511�014001� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2008 Peter Hutterer * * 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: Peter Hutterer */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef XIPROPERTY_H #define XIPROPERTY_H 1 int ProcXListDeviceProperties(ClientPtr client); int ProcXChangeDeviceProperty(ClientPtr client); int ProcXDeleteDeviceProperty(ClientPtr client); int ProcXGetDeviceProperty(ClientPtr client); /* request swapping */ int SProcXListDeviceProperties(ClientPtr client); int SProcXChangeDeviceProperty(ClientPtr client); int SProcXDeleteDeviceProperty(ClientPtr client); int SProcXGetDeviceProperty(ClientPtr client); /* reply swapping */ void SRepXListDeviceProperties(ClientPtr client, int size, xListDevicePropertiesReply * rep); void SRepXGetDeviceProperty(ClientPtr client, int size, xGetDevicePropertyReply * rep); /* XI2 request/reply handling */ int ProcXIListProperties(ClientPtr client); int ProcXIChangeProperty(ClientPtr client); int ProcXIDeleteProperty(ClientPtr client); int ProcXIGetProperty(ClientPtr client); int SProcXIListProperties(ClientPtr client); int SProcXIChangeProperty(ClientPtr client); int SProcXIDeleteProperty(ClientPtr client); int SProcXIGetProperty(ClientPtr client); void SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep); void SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply * rep); void XIResetProperties(void); #endif /* XIPROPERTY_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/stubs.c�����������������������������������������������������������������������0000664�0001751�0001751�00000011450�12274325511�012700� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* * stubs.c -- stub routines for the X server side of the XINPUT * extension. This file is mainly to be used only as documentation. * There is not much code here, and you can't get a working XINPUT * server just using this. * The Xvfb server uses this file so it will compile with the same * object files as the real X server for a platform that has XINPUT. * Xnest could do the same thing. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "inputstr.h" #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "xace.h" /**************************************************************************** * * Caller: ProcXSetDeviceMode * * Change the mode of an extension device. * This function is used to change the mode of a device from reporting * relative motion to reporting absolute positional information, and * vice versa. * The default implementation below is that no such devices are supported. * */ int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) { return BadMatch; } /**************************************************************************** * * Caller: ProcXSetDeviceValuators * * Set the value of valuators on an extension input device. * This function is used to set the initial value of valuators on * those input devices that are capable of reporting either relative * motion or an absolute position, and allow an initial position to be set. * The default implementation below is that no such devices are supported. * */ int SetDeviceValuators(ClientPtr client, DeviceIntPtr dev, int *valuators, int first_valuator, int num_valuators) { return BadMatch; } /**************************************************************************** * * Caller: ProcXChangeDeviceControl * * Change the specified device controls on an extension input device. * */ int ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, xDeviceCtl * control) { return BadMatch; } /**************************************************************************** * * Caller: configAddDevice (and others) * * Add a new device with the specified options. * */ int NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *pdev) { return BadValue; } /**************************************************************************** * * Caller: configRemoveDevice (and others) * * Remove the specified device previously added. * */ void DeleteInputDeviceRequest(DeviceIntPtr dev) { RemoveDevice(dev, TRUE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/listdev.h���������������������������������������������������������������������0000664�0001751�0001751�00000003236�12274325511�013222� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef LISTDEV_H #define LISTDEV_H 1 #define VPC 20 /* Max # valuators per chunk */ int SProcXListInputDevices(ClientPtr /* client */ ); int ProcXListInputDevices(ClientPtr /* client */ ); void SRepXListInputDevices(ClientPtr /* client */ , int /* size */ , xListInputDevicesReply * /* rep */ ); #endif /* LISTDEV_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgfctl.c���������������������������������������������������������������������0000664�0001751�0001751�00000035742�12456571574�013202� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Change feedback control attributes for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> /* control constants */ #include "exglobals.h" #include "chgfctl.h" #define DO_ALL (-1) /*********************************************************************** * * This procedure changes the control attributes for an extension device, * for clients on machines with a different byte ordering than the server. * */ int SProcXChangeFeedbackControl(ClientPtr client) { REQUEST(xChangeFeedbackControlReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); swapl(&stuff->mask); return (ProcXChangeFeedbackControl(client)); } /****************************************************************************** * * This procedure changes KbdFeedbackClass data. * */ static int ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, KbdFeedbackPtr k, xKbdFeedbackCtl * f) { KeybdCtrl kctrl; int t; int key = DO_ALL; if (client->swapped) { swaps(&f->length); swaps(&f->pitch); swaps(&f->duration); swapl(&f->led_mask); swapl(&f->led_values); } kctrl = k->ctrl; if (mask & DvKeyClickPercent) { t = f->click; if (t == -1) t = defaultKeyboardControl.click; else if (t < 0 || t > 100) { client->errorValue = t; return BadValue; } kctrl.click = t; } if (mask & DvPercent) { t = f->percent; if (t == -1) t = defaultKeyboardControl.bell; else if (t < 0 || t > 100) { client->errorValue = t; return BadValue; } kctrl.bell = t; } if (mask & DvPitch) { t = f->pitch; if (t == -1) t = defaultKeyboardControl.bell_pitch; else if (t < 0) { client->errorValue = t; return BadValue; } kctrl.bell_pitch = t; } if (mask & DvDuration) { t = f->duration; if (t == -1) t = defaultKeyboardControl.bell_duration; else if (t < 0) { client->errorValue = t; return BadValue; } kctrl.bell_duration = t; } if (mask & DvLed) { kctrl.leds &= ~(f->led_mask); kctrl.leds |= (f->led_mask & f->led_values); } if (mask & DvKey) { key = (KeyCode) f->key; if (key < 8 || key > 255) { client->errorValue = key; return BadValue; } if (!(mask & DvAutoRepeatMode)) return BadMatch; } if (mask & DvAutoRepeatMode) { int inx = (key >> 3); int kmask = (1 << (key & 7)); t = (CARD8) f->auto_repeat_mode; if (t == AutoRepeatModeOff) { if (key == DO_ALL) kctrl.autoRepeat = FALSE; else kctrl.autoRepeats[inx] &= ~kmask; } else if (t == AutoRepeatModeOn) { if (key == DO_ALL) kctrl.autoRepeat = TRUE; else kctrl.autoRepeats[inx] |= kmask; } else if (t == AutoRepeatModeDefault) { if (key == DO_ALL) kctrl.autoRepeat = defaultKeyboardControl.autoRepeat; else kctrl.autoRepeats[inx] &= ~kmask; kctrl.autoRepeats[inx] = (kctrl.autoRepeats[inx] & ~kmask) | (defaultKeyboardControl.autoRepeats[inx] & kmask); } else { client->errorValue = t; return BadValue; } } k->ctrl = kctrl; (*k->CtrlProc) (dev, &k->ctrl); return Success; } /****************************************************************************** * * This procedure changes PtrFeedbackClass data. * */ static int ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, PtrFeedbackPtr p, xPtrFeedbackCtl * f) { PtrCtrl pctrl; /* might get BadValue part way through */ if (client->swapped) { swaps(&f->length); swaps(&f->num); swaps(&f->denom); swaps(&f->thresh); } pctrl = p->ctrl; if (mask & DvAccelNum) { int accelNum; accelNum = f->num; if (accelNum == -1) pctrl.num = defaultPointerControl.num; else if (accelNum < 0) { client->errorValue = accelNum; return BadValue; } else pctrl.num = accelNum; } if (mask & DvAccelDenom) { int accelDenom; accelDenom = f->denom; if (accelDenom == -1) pctrl.den = defaultPointerControl.den; else if (accelDenom <= 0) { client->errorValue = accelDenom; return BadValue; } else pctrl.den = accelDenom; } if (mask & DvThreshold) { int threshold; threshold = f->thresh; if (threshold == -1) pctrl.threshold = defaultPointerControl.threshold; else if (threshold < 0) { client->errorValue = threshold; return BadValue; } else pctrl.threshold = threshold; } p->ctrl = pctrl; (*p->CtrlProc) (dev, &p->ctrl); return Success; } /****************************************************************************** * * This procedure changes IntegerFeedbackClass data. * */ static int ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, IntegerFeedbackPtr i, xIntegerFeedbackCtl * f) { if (client->swapped) { swaps(&f->length); swapl(&f->int_to_display); } i->ctrl.integer_displayed = f->int_to_display; (*i->CtrlProc) (dev, &i->ctrl); return Success; } /****************************************************************************** * * This procedure changes StringFeedbackClass data. * */ static int ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, StringFeedbackPtr s, xStringFeedbackCtl * f) { int i, j; KeySym *syms, *sup_syms; syms = (KeySym *) (f + 1); if (client->swapped) { swaps(&f->length); /* swapped num_keysyms in calling proc */ SwapLongs((CARD32 *) syms, f->num_keysyms); } if (f->num_keysyms > s->ctrl.max_symbols) return BadValue; sup_syms = s->ctrl.symbols_supported; for (i = 0; i < f->num_keysyms; i++) { for (j = 0; j < s->ctrl.num_symbols_supported; j++) if (*(syms + i) == *(sup_syms + j)) break; if (j == s->ctrl.num_symbols_supported) return BadMatch; } s->ctrl.num_symbols_displayed = f->num_keysyms; for (i = 0; i < f->num_keysyms; i++) *(s->ctrl.symbols_displayed + i) = *(syms + i); (*s->CtrlProc) (dev, &s->ctrl); return Success; } /****************************************************************************** * * This procedure changes BellFeedbackClass data. * */ static int ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, BellFeedbackPtr b, xBellFeedbackCtl * f) { int t; BellCtrl bctrl; /* might get BadValue part way through */ if (client->swapped) { swaps(&f->length); swaps(&f->pitch); swaps(&f->duration); } bctrl = b->ctrl; if (mask & DvPercent) { t = f->percent; if (t == -1) t = defaultKeyboardControl.bell; else if (t < 0 || t > 100) { client->errorValue = t; return BadValue; } bctrl.percent = t; } if (mask & DvPitch) { t = f->pitch; if (t == -1) t = defaultKeyboardControl.bell_pitch; else if (t < 0) { client->errorValue = t; return BadValue; } bctrl.pitch = t; } if (mask & DvDuration) { t = f->duration; if (t == -1) t = defaultKeyboardControl.bell_duration; else if (t < 0) { client->errorValue = t; return BadValue; } bctrl.duration = t; } b->ctrl = bctrl; (*b->CtrlProc) (dev, &b->ctrl); return Success; } /****************************************************************************** * * This procedure changes LedFeedbackClass data. * */ static int ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, LedFeedbackPtr l, xLedFeedbackCtl * f) { LedCtrl lctrl; /* might get BadValue part way through */ if (client->swapped) { swaps(&f->length); swapl(&f->led_values); swapl(&f->led_mask); } f->led_mask &= l->ctrl.led_mask; /* set only supported leds */ f->led_values &= l->ctrl.led_mask; /* set only supported leds */ if (mask & DvLed) { lctrl.led_mask = f->led_mask; lctrl.led_values = f->led_values; (*l->CtrlProc) (dev, &lctrl); l->ctrl.led_values &= ~(f->led_mask); /* zero changed leds */ l->ctrl.led_values |= (f->led_mask & f->led_values); /* OR in set leds */ } return Success; } /*********************************************************************** * * Change the control attributes. * */ int ProcXChangeFeedbackControl(ClientPtr client) { unsigned len; DeviceIntPtr dev; KbdFeedbackPtr k; PtrFeedbackPtr p; IntegerFeedbackPtr i; StringFeedbackPtr s; BellFeedbackPtr b; LedFeedbackPtr l; int rc; REQUEST(xChangeFeedbackControlReq); REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); len = stuff->length - bytes_to_int32(sizeof(xChangeFeedbackControlReq)); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (rc != Success) return rc; switch (stuff->feedbackid) { case KbdFeedbackClass: if (len != bytes_to_int32(sizeof(xKbdFeedbackCtl))) return BadLength; for (k = dev->kbdfeed; k; k = k->next) if (k->ctrl.id == ((xKbdFeedbackCtl *) &stuff[1])->id) return ChangeKbdFeedback(client, dev, stuff->mask, k, (xKbdFeedbackCtl *) &stuff[1]); break; case PtrFeedbackClass: if (len != bytes_to_int32(sizeof(xPtrFeedbackCtl))) return BadLength; for (p = dev->ptrfeed; p; p = p->next) if (p->ctrl.id == ((xPtrFeedbackCtl *) &stuff[1])->id) return ChangePtrFeedback(client, dev, stuff->mask, p, (xPtrFeedbackCtl *) &stuff[1]); break; case StringFeedbackClass: { xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]); if (client->swapped) { if (len < bytes_to_int32(sizeof(xStringFeedbackCtl))) return BadLength; swaps(&f->num_keysyms); } if (len != (bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms)) return BadLength; for (s = dev->stringfeed; s; s = s->next) if (s->ctrl.id == ((xStringFeedbackCtl *) &stuff[1])->id) return ChangeStringFeedback(client, dev, stuff->mask, s, (xStringFeedbackCtl *) &stuff[1]); break; } case IntegerFeedbackClass: if (len != bytes_to_int32(sizeof(xIntegerFeedbackCtl))) return BadLength; for (i = dev->intfeed; i; i = i->next) if (i->ctrl.id == ((xIntegerFeedbackCtl *) &stuff[1])->id) return ChangeIntegerFeedback(client, dev, stuff->mask, i, (xIntegerFeedbackCtl *) & stuff[1]); break; case LedFeedbackClass: if (len != bytes_to_int32(sizeof(xLedFeedbackCtl))) return BadLength; for (l = dev->leds; l; l = l->next) if (l->ctrl.id == ((xLedFeedbackCtl *) &stuff[1])->id) return ChangeLedFeedback(client, dev, stuff->mask, l, (xLedFeedbackCtl *) &stuff[1]); break; case BellFeedbackClass: if (len != bytes_to_int32(sizeof(xBellFeedbackCtl))) return BadLength; for (b = dev->bell; b; b = b->next) if (b->ctrl.id == ((xBellFeedbackCtl *) &stuff[1])->id) return ChangeBellFeedback(client, dev, stuff->mask, b, (xBellFeedbackCtl *) &stuff[1]); break; default: break; } return BadMatch; } ������������������������������xorg-server-1.17.1/Xi/grabdev.c���������������������������������������������������������������������0000664�0001751�0001751�00000015716�12274325511�013163� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to grab an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "dixevents.h" /* GrabDevice */ #include "grabdev.h" extern XExtEventInfo EventInfo[]; extern int ExtEventIndex; /*********************************************************************** * * Swap the request if the requestor has a different byte order than us. * */ int SProcXGrabDevice(ClientPtr client) { REQUEST(xGrabDeviceReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); swapl(&stuff->grabWindow); swapl(&stuff->time); swaps(&stuff->event_count); if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); return (ProcXGrabDevice(client)); } /*********************************************************************** * * Grab an extension device. * */ int ProcXGrabDevice(ClientPtr client) { int rc; xGrabDeviceReply rep; DeviceIntPtr dev; GrabMask mask; struct tmask tmp[EMASKSIZE]; REQUEST(xGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; rep = (xGrabDeviceReply) { .repType = X_Reply, .RepType = X_GrabDevice, .sequenceNumber = client->sequence, .length = 0, }; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); if (rc != Success) return rc; if ((rc = CreateMaskFromList(client, (XEventClass *) &stuff[1], stuff->event_count, tmp, dev, X_GrabDevice)) != Success) return rc; mask.xi = tmp[stuff->deviceid].mask; rc = GrabDevice(client, dev, stuff->other_devices_mode, stuff->this_device_mode, stuff->grabWindow, stuff->ownerEvents, stuff->time, &mask, XI, None, None, &rep.status); if (rc != Success) return rc; WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep); return Success; } /*********************************************************************** * * This procedure creates an event mask from a list of XEventClasses. * * Procedure is as follows: * An XEventClass is (deviceid << 8 | eventtype). For each entry in the list, * get the device. Then run through all available event indices (those are * set when XI starts up) and binary OR's the device's mask to whatever the * event mask for the given event type was. * If an error occurs, it is sent to the client. Errors are generated if * - if the device given in the event classs is invalid * - if the device in the class list is not the device given as parameter (no * error if parameter is NULL) * * mask has to be size EMASKSIZE and pre-allocated. * * @param client The client to send the error to (if one occurs) * @param list List of event classes as sent from the client. * @param count Number of elements in list. * @param mask Preallocated mask (size EMASKSIZE). * @param dev The device we're creating masks for. * @param req The request we're processing. Used to fill in error fields. */ int CreateMaskFromList(ClientPtr client, XEventClass * list, int count, struct tmask *mask, DeviceIntPtr dev, int req) { int rc, i, j; int device; DeviceIntPtr tdev; memset(mask, 0, EMASKSIZE * sizeof(struct tmask)); for (i = 0; i < count; i++, list++) { device = *list >> 8; if (device > 255) return BadClass; rc = dixLookupDevice(&tdev, device, client, DixUseAccess); if (rc != BadDevice && rc != Success) return rc; if (rc == BadDevice || (dev != NULL && tdev != dev)) return BadClass; for (j = 0; j < ExtEventIndex; j++) if (EventInfo[j].type == (*list & 0xff)) { mask[device].mask |= EventInfo[j].mask; mask[device].dev = (void *) tdev; break; } } return Success; } /*********************************************************************** * * This procedure writes the reply for the XGrabDevice function, * if the client and server have a different byte ordering. * */ void SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ��������������������������������������������������xorg-server-1.17.1/Xi/xipassivegrab.h���������������������������������������������������������������0000664�0001751�0001751�00000003173�12274325511�014417� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Author: Peter Hutterer */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef XIPASSIVEGRAB_H #define XIPASSIVEGRAB_H 1 int SProcXIPassiveUngrabDevice(ClientPtr client); int ProcXIPassiveUngrabDevice(ClientPtr client); void SRepXIPassiveGrabDevice(ClientPtr client, int size, xXIPassiveGrabDeviceReply * rep); int ProcXIPassiveGrabDevice(ClientPtr client); int SProcXIPassiveGrabDevice(ClientPtr client); #endif /* XIPASSIVEGRAB_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/allowev.h���������������������������������������������������������������������0000664�0001751�0001751�00000002667�12274325511�013230� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef ALLOWEV_H #define ALLOWEV_H 1 int SProcXAllowDeviceEvents(ClientPtr /* client */ ); int ProcXAllowDeviceEvents(ClientPtr /* client */ ); #endif /* ALLOWEV_H */ �������������������������������������������������������������������������xorg-server-1.17.1/Xi/getdctl.c���������������������������������������������������������������������0000664�0001751�0001751�00000015773�12274325511�013202� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Get Device control attributes for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "getdctl.h" /*********************************************************************** * * This procedure gets the control attributes for an extension device, * for clients on machines with a different byte ordering than the server. * */ int SProcXGetDeviceControl(ClientPtr client) { REQUEST(xGetDeviceControlReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceControlReq); swaps(&stuff->control); return (ProcXGetDeviceControl(client)); } /*********************************************************************** * * This procedure copies DeviceResolution data, swapping if necessary. * */ static void CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, int length) { AxisInfoPtr a; xDeviceResolutionState *r; int i, *iptr; r = (xDeviceResolutionState *) buf; r->control = DEVICE_RESOLUTION; r->length = length; r->num_valuators = v->numAxes; buf += sizeof(xDeviceResolutionState); iptr = (int *) buf; for (i = 0, a = v->axes; i < v->numAxes; i++, a++) *iptr++ = a->resolution; for (i = 0, a = v->axes; i < v->numAxes; i++, a++) *iptr++ = a->min_resolution; for (i = 0, a = v->axes; i < v->numAxes; i++, a++) *iptr++ = a->max_resolution; if (client->swapped) { swaps(&r->control); swaps(&r->length); swapl(&r->num_valuators); iptr = (int *) buf; for (i = 0; i < (3 * v->numAxes); i++, iptr++) { swapl(iptr); } } } static void CopySwapDeviceCore(ClientPtr client, DeviceIntPtr dev, char *buf) { xDeviceCoreState *c = (xDeviceCoreState *) buf; c->control = DEVICE_CORE; c->length = sizeof(xDeviceCoreState); c->status = dev->coreEvents; c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer); if (client->swapped) { swaps(&c->control); swaps(&c->length); } } static void CopySwapDeviceEnable(ClientPtr client, DeviceIntPtr dev, char *buf) { xDeviceEnableState *e = (xDeviceEnableState *) buf; e->control = DEVICE_ENABLE; e->length = sizeof(xDeviceEnableState); e->enable = dev->enabled; if (client->swapped) { swaps(&e->control); swaps(&e->length); } } /*********************************************************************** * * This procedure writes the reply for the xGetDeviceControl function, * if the client and server have a different byte ordering. * */ void SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } /*********************************************************************** * * Get the state of the specified device control. * */ int ProcXGetDeviceControl(ClientPtr client) { int rc, total_length = 0; char *buf, *savbuf; DeviceIntPtr dev; xGetDeviceControlReply rep; REQUEST(xGetDeviceControlReq); REQUEST_SIZE_MATCH(xGetDeviceControlReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) return rc; rep = (xGetDeviceControlReply) { .repType = X_Reply, .RepType = X_GetDeviceControl, .sequenceNumber = client->sequence, .length = 0 }; switch (stuff->control) { case DEVICE_RESOLUTION: if (!dev->valuator) return BadMatch; total_length = sizeof(xDeviceResolutionState) + (3 * sizeof(int) * dev->valuator->numAxes); break; case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: return BadMatch; case DEVICE_CORE: total_length = sizeof(xDeviceCoreState); break; case DEVICE_ENABLE: total_length = sizeof(xDeviceEnableState); break; default: return BadValue; } buf = (char *) malloc(total_length); if (!buf) return BadAlloc; savbuf = buf; switch (stuff->control) { case DEVICE_RESOLUTION: CopySwapDeviceResolution(client, dev->valuator, buf, total_length); break; case DEVICE_CORE: CopySwapDeviceCore(client, dev, buf); break; case DEVICE_ENABLE: CopySwapDeviceEnable(client, dev, buf); break; default: break; } rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep); WriteToClient(client, total_length, savbuf); free(savbuf); return Success; } �����xorg-server-1.17.1/Xi/ungrdev.c���������������������������������������������������������������������0000664�0001751�0001751�00000007322�12274325511�013215� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to release a grab of an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "ungrdev.h" /*********************************************************************** * * Handle requests from a client with a different byte order. * */ int SProcXUngrabDevice(ClientPtr client) { REQUEST(xUngrabDeviceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceReq); swapl(&stuff->time); return (ProcXUngrabDevice(client)); } /*********************************************************************** * * Release a grab of an extension device. * */ int ProcXUngrabDevice(ClientPtr client) { DeviceIntPtr dev; GrabPtr grab; TimeStamp time; int rc; REQUEST(xUngrabDeviceReq); REQUEST_SIZE_MATCH(xUngrabDeviceReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) return rc; grab = dev->deviceGrab.grab; time = ClientTimeToServerTime(stuff->time); if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, dev->deviceGrab.grabTime) != EARLIER) && (grab) && SameClient(grab, client) && grab->grabtype == XI) (*dev->deviceGrab.DeactivateGrab) (dev); return Success; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/ungrdevb.h��������������������������������������������������������������������0000664�0001751�0001751�00000002672�12274325511�013367� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef UNGRDEVB_H #define UNGRDEVB_H 1 int SProcXUngrabDeviceButton(ClientPtr /* client */ ); int ProcXUngrabDeviceButton(ClientPtr /* client */ ); #endif /* UNGRDEVB_H */ ����������������������������������������������������������������������xorg-server-1.17.1/Xi/chgdctl.h���������������������������������������������������������������������0000664�0001751�0001751�00000003157�12274325511�013162� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHGDCTL_H #define CHGDCTL_H 1 int SProcXChangeDeviceControl(ClientPtr /* client */ ); int ProcXChangeDeviceControl(ClientPtr /* client */ ); void SRepXChangeDeviceControl(ClientPtr /* client */ , int /* size */ , xChangeDeviceControlReply * /* rep */ ); #endif /* CHGDCTL_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/closedev.h��������������������������������������������������������������������0000664�0001751�0001751�00000002652�12274325511�013355� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CLOSEDEV_H #define CLOSEDEV_H 1 int SProcXCloseDevice(ClientPtr /* client */ ); int ProcXCloseDevice(ClientPtr /* client */ ); #endif /* CLOSEDEV_H */ ��������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgkmap.h���������������������������������������������������������������������0000664�0001751�0001751�00000002707�12274325511�013164� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHGKMAP_H #define CHGKMAP_H 1 int SProcXChangeDeviceKeyMapping(ClientPtr /* client */ ); int ProcXChangeDeviceKeyMapping(ClientPtr /* client */ ); #endif /* CHGKMAP_H */ ���������������������������������������������������������xorg-server-1.17.1/Xi/xichangehierarchy.c�����������������������������������������������������������0000664�0001751�0001751�00000034427�12456571574�015254� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * Copyright 2009 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. * * Author: Peter Hutterer, University of South Australia, NICTA */ /*********************************************************************** * * Request change in the device hierarchy. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> /* for inputstr.h */ #include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2proto.h> #include <X11/extensions/geproto.h> #include "extnsionst.h" #include "exevents.h" #include "exglobals.h" #include "geext.h" #include "xace.h" #include "xiquerydevice.h" /* for GetDeviceUse */ #include "xkbsrv.h" #include "xichangehierarchy.h" #include "xibarriers.h" /** * Send the current state of the device hierarchy to all clients. */ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) { xXIHierarchyEvent *ev; xXIHierarchyInfo *info; DeviceIntRec dummyDev; DeviceIntPtr dev; int i; if (!flags) return; ev = calloc(1, sizeof(xXIHierarchyEvent) + MAXDEVICES * sizeof(xXIHierarchyInfo)); if (!ev) return; ev->type = GenericEvent; ev->extension = IReqCode; ev->evtype = XI_HierarchyChanged; ev->time = GetTimeInMillis(); ev->flags = 0; ev->num_info = inputInfo.numDevices; info = (xXIHierarchyInfo *) &ev[1]; for (dev = inputInfo.devices; dev; dev = dev->next) { info->deviceid = dev->id; info->enabled = dev->enabled; info->use = GetDeviceUse(dev, &info->attachment); info->flags = flags[dev->id]; ev->flags |= info->flags; info++; } for (dev = inputInfo.off_devices; dev; dev = dev->next) { info->deviceid = dev->id; info->enabled = dev->enabled; info->use = GetDeviceUse(dev, &info->attachment); info->flags = flags[dev->id]; ev->flags |= info->flags; info++; } for (i = 0; i < MAXDEVICES; i++) { if (flags[i] & (XIMasterRemoved | XISlaveRemoved)) { info->deviceid = i; info->enabled = FALSE; info->flags = flags[i]; info->use = 0; ev->flags |= info->flags; ev->num_info++; info++; } } ev->length = bytes_to_int32(ev->num_info * sizeof(xXIHierarchyInfo)); memset(&dummyDev, 0, sizeof(dummyDev)); dummyDev.id = XIAllDevices; dummyDev.type = SLAVE; SendEventToAllWindows(&dummyDev, (XI_HierarchyChangedMask >> 8), (xEvent *) ev, 1); free(ev); } /*********************************************************************** * * This procedure allows a client to change the device hierarchy through * adding new master devices, removing them, etc. * */ int SProcXIChangeHierarchy(ClientPtr client) { REQUEST(xXIChangeHierarchyReq); swaps(&stuff->length); return (ProcXIChangeHierarchy(client)); } static int add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES]) { DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; char *name; int rc; name = calloc(c->name_len + 1, sizeof(char)); if (name == NULL) { rc = BadAlloc; goto unwind; } strncpy(name, (char *) &c[1], c->name_len); rc = AllocDevicePair(client, name, &ptr, &keybd, CorePointerProc, CoreKeyboardProc, TRUE); if (rc != Success) goto unwind; if (!c->send_core) ptr->coreEvents = keybd->coreEvents = FALSE; /* Allocate virtual slave devices for xtest events */ rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd); if (rc != Success) { DeleteInputDeviceRequest(ptr); DeleteInputDeviceRequest(keybd); goto unwind; } ActivateDevice(ptr, FALSE); ActivateDevice(keybd, FALSE); flags[ptr->id] |= XIMasterAdded; flags[keybd->id] |= XIMasterAdded; ActivateDevice(XTestptr, FALSE); ActivateDevice(XTestkeybd, FALSE); flags[XTestptr->id] |= XISlaveAdded; flags[XTestkeybd->id] |= XISlaveAdded; if (c->enable) { EnableDevice(ptr, FALSE); EnableDevice(keybd, FALSE); flags[ptr->id] |= XIDeviceEnabled; flags[keybd->id] |= XIDeviceEnabled; EnableDevice(XTestptr, FALSE); EnableDevice(XTestkeybd, FALSE); flags[XTestptr->id] |= XIDeviceEnabled; flags[XTestkeybd->id] |= XIDeviceEnabled; } /* Attach the XTest virtual devices to the newly created master device */ AttachDevice(NULL, XTestptr, ptr); AttachDevice(NULL, XTestkeybd, keybd); flags[XTestptr->id] |= XISlaveAttached; flags[XTestkeybd->id] |= XISlaveAttached; XIBarrierNewMasterDevice(client, ptr->id); unwind: free(name); return rc; } static void disable_clientpointer(DeviceIntPtr dev) { int i; for (i = 0; i < currentMaxClients; i++) { ClientPtr client = clients[i]; if (client && client->clientPtr == dev) client->clientPtr = NULL; } } static int remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES]) { DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; int rc = Success; if (r->return_mode != XIAttachToMaster && r->return_mode != XIFloating) return BadValue; rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroyAccess); if (rc != Success) goto unwind; if (!IsMaster(ptr)) { client->errorValue = r->deviceid; rc = BadDevice; goto unwind; } /* XXX: For now, don't allow removal of VCP, VCK */ if (ptr == inputInfo.pointer ||ptr == inputInfo.keyboard) { rc = BadDevice; goto unwind; } ptr = GetMaster(ptr, MASTER_POINTER); rc = dixLookupDevice(&ptr, ptr->id, client, DixDestroyAccess); if (rc != Success) goto unwind; keybd = GetMaster(ptr, MASTER_KEYBOARD); rc = dixLookupDevice(&keybd, keybd->id, client, DixDestroyAccess); if (rc != Success) goto unwind; XTestptr = GetXTestDevice(ptr); rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess); if (rc != Success) goto unwind; XTestkeybd = GetXTestDevice(keybd); rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, DixDestroyAccess); if (rc != Success) goto unwind; disable_clientpointer(ptr); /* Disabling sends the devices floating, reattach them if * desired. */ if (r->return_mode == XIAttachToMaster) { DeviceIntPtr attached, newptr, newkeybd; rc = dixLookupDevice(&newptr, r->return_pointer, client, DixAddAccess); if (rc != Success) goto unwind; if (!IsMaster(newptr)) { client->errorValue = r->return_pointer; rc = BadDevice; goto unwind; } rc = dixLookupDevice(&newkeybd, r->return_keyboard, client, DixAddAccess); if (rc != Success) goto unwind; if (!IsMaster(newkeybd)) { client->errorValue = r->return_keyboard; rc = BadDevice; goto unwind; } for (attached = inputInfo.devices; attached; attached = attached->next) { if (!IsMaster(attached)) { if (GetMaster(attached, MASTER_ATTACHED) == ptr) { AttachDevice(client, attached, newptr); flags[attached->id] |= XISlaveAttached; } if (GetMaster(attached, MASTER_ATTACHED) == keybd) { AttachDevice(client, attached, newkeybd); flags[attached->id] |= XISlaveAttached; } } } } XIBarrierRemoveMasterDevice(client, ptr->id); /* disable the remove the devices, XTest devices must be done first else the sprites they rely on will be destroyed */ DisableDevice(XTestptr, FALSE); DisableDevice(XTestkeybd, FALSE); DisableDevice(keybd, FALSE); DisableDevice(ptr, FALSE); flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached; flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached; flags[keybd->id] |= XIDeviceDisabled; flags[ptr->id] |= XIDeviceDisabled; 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; } static int detach_slave(ClientPtr client, xXIDetachSlaveInfo * c, int flags[MAXDEVICES]) { DeviceIntPtr dev; int rc; rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); if (rc != Success) goto unwind; if (IsMaster(dev)) { client->errorValue = c->deviceid; rc = BadDevice; goto unwind; } /* Don't allow changes to XTest Devices, these are fixed */ if (IsXTestDevice(dev, NULL)) { client->errorValue = c->deviceid; rc = BadDevice; goto unwind; } ReleaseButtonsAndKeys(dev); AttachDevice(client, dev, NULL); flags[dev->id] |= XISlaveDetached; unwind: return rc; } static int attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES]) { DeviceIntPtr dev; DeviceIntPtr newmaster; int rc; rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); if (rc != Success) goto unwind; if (IsMaster(dev)) { client->errorValue = c->deviceid; rc = BadDevice; goto unwind; } /* Don't allow changes to XTest Devices, these are fixed */ if (IsXTestDevice(dev, NULL)) { client->errorValue = c->deviceid; rc = BadDevice; goto unwind; } rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess); if (rc != Success) goto unwind; if (!IsMaster(newmaster)) { client->errorValue = c->new_master; rc = BadDevice; goto unwind; } if (!((IsPointerDevice(newmaster) && IsPointerDevice(dev)) || (IsKeyboardDevice(newmaster) && IsKeyboardDevice(dev)))) { rc = BadDevice; goto unwind; } ReleaseButtonsAndKeys(dev); AttachDevice(client, dev, newmaster); flags[dev->id] |= XISlaveAttached; unwind: return rc; } #define SWAPIF(cmd) if (client->swapped) { cmd; } int ProcXIChangeHierarchy(ClientPtr client) { xXIAnyHierarchyChangeInfo *any; size_t len; /* length of data remaining in request */ int rc = Success; int flags[MAXDEVICES] = { 0 }; REQUEST(xXIChangeHierarchyReq); REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq); if (!stuff->num_changes) return rc; if (stuff->length > (INT_MAX >> 2)) return BadAlloc; len = (stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo); any = (xXIAnyHierarchyChangeInfo *) &stuff[1]; while (stuff->num_changes--) { if (len < sizeof(xXIAnyHierarchyChangeInfo)) { rc = BadLength; goto unwind; } SWAPIF(swaps(&any->type)); SWAPIF(swaps(&any->length)); if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2))) return BadLength; #define CHANGE_SIZE_MATCH(type) \ do { \ if ((len < sizeof(type)) || (any->length != (sizeof(type) >> 2))) { \ rc = BadLength; \ goto unwind; \ } \ } while(0) switch (any->type) { case XIAddMaster: { xXIAddMasterInfo *c = (xXIAddMasterInfo *) any; /* Variable length, due to appended name string */ if (len < sizeof(xXIAddMasterInfo)) { rc = BadLength; goto unwind; } SWAPIF(swaps(&c->name_len)); if (c->name_len > (len - sizeof(xXIAddMasterInfo))) { rc = BadLength; goto unwind; } rc = add_master(client, c, flags); if (rc != Success) goto unwind; } break; case XIRemoveMaster: { xXIRemoveMasterInfo *r = (xXIRemoveMasterInfo *) any; CHANGE_SIZE_MATCH(xXIRemoveMasterInfo); rc = remove_master(client, r, flags); if (rc != Success) goto unwind; } break; case XIDetachSlave: { xXIDetachSlaveInfo *c = (xXIDetachSlaveInfo *) any; CHANGE_SIZE_MATCH(xXIDetachSlaveInfo); rc = detach_slave(client, c, flags); if (rc != Success) goto unwind; } break; case XIAttachSlave: { xXIAttachSlaveInfo *c = (xXIAttachSlaveInfo *) any; CHANGE_SIZE_MATCH(xXIAttachSlaveInfo); rc = attach_slave(client, c, flags); if (rc != Success) goto unwind; } break; } len -= any->length * 4; any = (xXIAnyHierarchyChangeInfo *) ((char *) any + any->length * 4); } unwind: XISendDeviceHierarchyEvent(flags); return rc; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgkbd.h����������������������������������������������������������������������0000664�0001751�0001751�00000002674�12274325511�012777� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHGKBD_H #define CHGKBD_H 1 int SProcXChangeKeyboardDevice(ClientPtr /* client */ ); int ProcXChangeKeyboardDevice(ClientPtr /* client */ ); #endif /* CHGKBD_H */ ��������������������������������������������������������������������xorg-server-1.17.1/Xi/chgprop.c���������������������������������������������������������������������0000664�0001751�0001751�00000011510�12274325511�013177� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Function to modify the dont-propagate-list for an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "chgprop.h" #include "grabdev.h" /*********************************************************************** * * This procedure returns the extension version. * */ int SProcXChangeDeviceDontPropagateList(ClientPtr client) { REQUEST(xChangeDeviceDontPropagateListReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); swapl(&stuff->window); swaps(&stuff->count); REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq, stuff->count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->count); return (ProcXChangeDeviceDontPropagateList(client)); } /*********************************************************************** * * This procedure changes the dont-propagate list for the specified window. * */ int ProcXChangeDeviceDontPropagateList(ClientPtr client) { int i, rc; WindowPtr pWin; struct tmask tmp[EMASKSIZE]; OtherInputMasks *others; REQUEST(xChangeDeviceDontPropagateListReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); if (stuff->length != bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) + stuff->count) return BadLength; rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess); if (rc != Success) return rc; if (stuff->mode != AddToList && stuff->mode != DeleteFromList) { client->errorValue = stuff->window; return BadMode; } if ((rc = CreateMaskFromList(client, (XEventClass *) &stuff[1], stuff->count, tmp, NULL, X_ChangeDeviceDontPropagateList)) != Success) return rc; others = wOtherInputMasks(pWin); if (!others && stuff->mode == DeleteFromList) return Success; for (i = 0; i < EMASKSIZE; i++) { if (tmp[i].mask == 0) continue; if (stuff->mode == DeleteFromList) tmp[i].mask = (others->dontPropagateMask[i] & ~tmp[i].mask); else if (others) tmp[i].mask |= others->dontPropagateMask[i]; if (DeviceEventSuppressForWindow(pWin, client, tmp[i].mask, i) != Success) return BadClass; } return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getkmap.h���������������������������������������������������������������������0000664�0001751�0001751�00000003157�12274325511�013202� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETKMAP_H #define GETKMAP_H 1 int SProcXGetDeviceKeyMapping(ClientPtr /* client */ ); int ProcXGetDeviceKeyMapping(ClientPtr /* client */ ); void SRepXGetDeviceKeyMapping(ClientPtr /* client */ , int /* size */ , xGetDeviceKeyMappingReply * /* rep */ ); #endif /* GETKMAP_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/closedev.c��������������������������������������������������������������������0000664�0001751�0001751�00000012356�12274325511�013352� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to close an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "exglobals.h" #include "closedev.h" /*********************************************************************** * * This procedure closes an input device. * */ int SProcXCloseDevice(ClientPtr client) { REQUEST(xCloseDeviceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCloseDeviceReq); return (ProcXCloseDevice(client)); } /*********************************************************************** * * Clear out event selections and passive grabs from a window for the * specified device. * */ static void DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client) { InputClientsPtr others; OtherInputMasks *pOthers; GrabPtr grab, next; if ((pOthers = wOtherInputMasks(pWin)) != 0) for (others = pOthers->inputClients; others; others = others->next) if (SameClient(others, client)) others->mask[dev->id] = NoEventMask; for (grab = wPassiveGrabs(pWin); grab; grab = next) { next = grab->next; if ((grab->device == dev) && (client->clientAsMask == CLIENT_BITS(grab->resource))) FreeResource(grab->resource, RT_NONE); } } /*********************************************************************** * * Walk througth the window tree, deleting event selections for this client * from this device from all windows. * */ static void DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client) { WindowPtr p2; while (p1) { p2 = p1->firstChild; DeleteDeviceEvents(dev, p1, client); DeleteEventsFromChildren(dev, p2, client); p1 = p1->nextSib; } } /*********************************************************************** * * This procedure closes an input device. * */ int ProcXCloseDevice(ClientPtr client) { int rc, i; WindowPtr pWin, p1; DeviceIntPtr d; REQUEST(xCloseDeviceReq); REQUEST_SIZE_MATCH(xCloseDeviceReq); rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess); if (rc != Success) return rc; if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client)) (*d->deviceGrab.DeactivateGrab) (d); /* release active grab */ /* Remove event selections from all windows for events from this device * and selected by this client. * Delete passive grabs from all windows for this device. */ for (i = 0; i < screenInfo.numScreens; i++) { pWin = screenInfo.screens[i]->root; DeleteDeviceEvents(d, pWin, client); p1 = pWin->firstChild; DeleteEventsFromChildren(d, p1, client); } return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/grabdevk.h��������������������������������������������������������������������0000664�0001751�0001751�00000002672�12274325511�013340� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GRABDEVK_H #define GRABDEVK_H 1 int SProcXGrabDeviceKey(ClientPtr /* client */ ); int ProcXGrabDeviceKey(ClientPtr /* client */ ); #endif /* GRABDEVK_H */ ����������������������������������������������������������������������xorg-server-1.17.1/Xi/xigrabdev.c�������������������������������������������������������������������0000664�0001751�0001751�00000012063�12456571574�013532� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Author: Peter Hutterer */ /*********************************************************************** * * Request to grab or ungrab input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI2.h> #include <X11/extensions/XI2proto.h> #include "exglobals.h" /* BadDevice */ #include "exevents.h" #include "xigrabdev.h" #include "inpututils.h" int SProcXIGrabDevice(ClientPtr client) { REQUEST(xXIGrabDeviceReq); /* * Check here for at least the length of the struct we swap, then * let ProcXIGrabDevice check the full size after we swap mask_len. */ REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->grab_window); swapl(&stuff->cursor); swapl(&stuff->time); swaps(&stuff->mask_len); return ProcXIGrabDevice(client); } int ProcXIGrabDevice(ClientPtr client) { DeviceIntPtr dev; xXIGrabDeviceReply rep; int ret = Success; uint8_t status; GrabMask mask = { 0 }; int mask_len; unsigned int keyboard_mode; unsigned int pointer_mode; REQUEST(xXIGrabDeviceReq); REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); if (ret != Success) return ret; if (!IsMaster(dev)) stuff->paired_device_mode = GrabModeAsync; if (IsKeyboardDevice(dev)) { keyboard_mode = stuff->grab_mode; pointer_mode = stuff->paired_device_mode; } else { keyboard_mode = stuff->paired_device_mode; pointer_mode = stuff->grab_mode; } if (XICheckInvalidMaskBits(client, (unsigned char *) &stuff[1], stuff->mask_len * 4) != Success) return BadValue; mask.xi2mask = xi2mask_new(); if (!mask.xi2mask) return BadAlloc; mask_len = min(xi2mask_mask_size(mask.xi2mask), stuff->mask_len * 4); /* FIXME: I think the old code was broken here */ xi2mask_set_one_mask(mask.xi2mask, dev->id, (unsigned char *) &stuff[1], mask_len); ret = GrabDevice(client, dev, pointer_mode, keyboard_mode, stuff->grab_window, stuff->owner_events, stuff->time, &mask, XI2, stuff->cursor, None /* confineTo */ , &status); xi2mask_free(&mask.xi2mask); if (ret != Success) return ret; rep = (xXIGrabDeviceReply) { .repType = X_Reply, .RepType = X_XIGrabDevice, .sequenceNumber = client->sequence, .length = 0, .status = status }; WriteReplyToClient(client, sizeof(rep), &rep); return ret; } int SProcXIUngrabDevice(ClientPtr client) { REQUEST(xXIUngrabDeviceReq); REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->time); return ProcXIUngrabDevice(client); } int ProcXIUngrabDevice(ClientPtr client) { DeviceIntPtr dev; GrabPtr grab; int ret = Success; TimeStamp time; REQUEST(xXIUngrabDeviceReq); REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (ret != Success) return ret; grab = dev->deviceGrab.grab; time = ClientTimeToServerTime(stuff->time); if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, dev->deviceGrab.grabTime) != EARLIER) && (grab) && SameClient(grab, client) && grab->grabtype == XI2) (*dev->deviceGrab.DeactivateGrab) (dev); return Success; } void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/opendev.c���������������������������������������������������������������������0000664�0001751�0001751�00000013164�12274325511�013204� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to open an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "windowstr.h" /* window structure */ #include "exglobals.h" #include "exevents.h" #include "opendev.h" extern CARD8 event_base[]; /*********************************************************************** * * This procedure swaps the request if the server and client have different * byte orderings. * */ int SProcXOpenDevice(ClientPtr client) { REQUEST(xOpenDeviceReq); swaps(&stuff->length); return (ProcXOpenDevice(client)); } /*********************************************************************** * * This procedure causes the server to open an input device. * */ int ProcXOpenDevice(ClientPtr client) { xInputClassInfo evbase[numInputClasses]; int j = 0; int status = Success; xOpenDeviceReply rep; DeviceIntPtr dev; REQUEST(xOpenDeviceReq); REQUEST_SIZE_MATCH(xOpenDeviceReq); status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess); if (status == BadDevice) { /* not open */ for (dev = inputInfo.off_devices; dev; dev = dev->next) if (dev->id == stuff->deviceid) break; if (dev == NULL) return BadDevice; } else if (status != Success) return status; if (IsMaster(dev)) return BadDevice; if (status != Success) return status; if (dev->key != NULL) { evbase[j].class = KeyClass; evbase[j++].event_type_base = event_base[KeyClass]; } if (dev->button != NULL) { evbase[j].class = ButtonClass; evbase[j++].event_type_base = event_base[ButtonClass]; } if (dev->valuator != NULL) { evbase[j].class = ValuatorClass; evbase[j++].event_type_base = event_base[ValuatorClass]; } if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL || dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) { evbase[j].class = FeedbackClass; evbase[j++].event_type_base = event_base[FeedbackClass]; } if (dev->focus != NULL) { evbase[j].class = FocusClass; evbase[j++].event_type_base = event_base[FocusClass]; } if (dev->proximity != NULL) { evbase[j].class = ProximityClass; evbase[j++].event_type_base = event_base[ProximityClass]; } evbase[j].class = OtherClass; evbase[j++].event_type_base = event_base[OtherClass]; 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), evbase); return Success; } /*********************************************************************** * * This procedure writes the reply for the XOpenDevice function, * if the client and server have a different byte ordering. * */ void SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getfocus.h��������������������������������������������������������������������0000664�0001751�0001751�00000003130�12274325511�013360� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETFOCUS_H #define GETFOCUS_H 1 int SProcXGetDeviceFocus(ClientPtr /* client */ ); int ProcXGetDeviceFocus(ClientPtr /* client */ ); void SRepXGetDeviceFocus(ClientPtr /* client */ , int /* size */ , xGetDeviceFocusReply * /* rep */ ); #endif /* GETFOCUS_H */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiallowev.h�������������������������������������������������������������������0000664�0001751�0001751�00000002610�12274325511�013555� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Author: Peter Hutterer */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef XIALLOWEV_H #define XIALLOWEV_H 1 int ProcXIAllowEvents(ClientPtr client); int SProcXIAllowEvents(ClientPtr client); #endif /* XIALLOWEV_H */ ������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/exevents.c��������������������������������������������������������������������0000664�0001751�0001751�00000277331�12456571574�013433� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* * Copyright © 2010 Collabora Ltd. * Copyright © 2011 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. * * Author: Daniel Stone <daniel@fooishbar.org> */ /******************************************************************** * * Routines to register and initialize extension input devices. * This also contains ProcessOtherEvent, the routine called from DDX * to route extension events. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" #include <X11/X.h> #include <X11/Xproto.h> #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include <X11/extensions/XI2proto.h> #include <X11/extensions/geproto.h> #include "windowstr.h" #include "miscstruct.h" #include "region.h" #include "exevents.h" #include "extnsionst.h" #include "exglobals.h" #include "dixevents.h" /* DeliverFocusedEvent */ #include "dixgrabs.h" /* CreateGrab() */ #include "scrnintstr.h" #include "listdev.h" /* for CopySwapXXXClass */ #include "xace.h" #include "xiquerydevice.h" /* For List*Info */ #include "eventconvert.h" #include "eventstr.h" #include "inpututils.h" #include "mi.h" #include <X11/extensions/XKBproto.h> #include "xkbsrv.h" #define WID(w) ((w) ? ((w)->drawable.id) : 0) #define AllModifiersMask ( \ ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) #define AllButtonsMask ( \ Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) Bool ShouldFreeInputMasks(WindowPtr /* pWin */ , Bool /* ignoreSelectedEvents */ ); static Bool MakeInputMasks(WindowPtr /* pWin */ ); /* * Only let the given client know of core events which will affect its * interpretation of input events, if the client's ClientPointer (or the * paired keyboard) is the current device. */ int XIShouldNotify(ClientPtr client, DeviceIntPtr dev) { DeviceIntPtr current_ptr = PickPointer(client); DeviceIntPtr current_kbd = GetMaster(current_ptr, KEYBOARD_OR_FLOAT); if (dev == current_kbd || dev == current_ptr) return 1; return 0; } Bool IsPointerEvent(InternalEvent *event) { switch (event->any.type) { case ET_ButtonPress: case ET_ButtonRelease: case ET_Motion: /* XXX: enter/leave ?? */ return TRUE; default: break; } return FALSE; } Bool IsTouchEvent(InternalEvent *event) { switch (event->any.type) { case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: return TRUE; default: break; } return FALSE; } /** * @return the device matching the deviceid of the device set in the event, or * NULL if the event is not an XInput event. */ DeviceIntPtr XIGetDevice(xEvent *xE) { DeviceIntPtr pDev = NULL; if (xE->u.u.type == DeviceButtonPress || xE->u.u.type == DeviceButtonRelease || xE->u.u.type == DeviceMotionNotify || xE->u.u.type == ProximityIn || xE->u.u.type == ProximityOut || xE->u.u.type == DevicePropertyNotify) { int rc; int id; id = ((deviceKeyButtonPointer *) xE)->deviceid & ~MORE_EVENTS; rc = dixLookupDevice(&pDev, id, serverClient, DixUnknownAccess); if (rc != Success) ErrorF("[dix] XIGetDevice failed on XACE restrictions (%d)\n", rc); } return pDev; } /** * Copy the device->key into master->key and send a mapping notify to the * clients if appropriate. * master->key needs to be allocated by the caller. * * Device is the slave device. If it is attached to a master device, we may * need to send a mapping notify to the client because it causes the MD * to change state. * * Mapping notify needs to be sent in the following cases: * - different slave device on same master * - different master * * XXX: They way how the code is we also send a map notify if the slave device * stays the same, but the master changes. This isn't really necessary though. * * XXX: this gives you funny behaviour with the ClientPointer. When a * MappingNotify is sent to the client, the client usually responds with a * GetKeyboardMapping. This will retrieve the ClientPointer's keyboard * mapping, regardless of which keyboard sent the last mapping notify request. * So depending on the CP setting, your keyboard may change layout in each * app... * * This code is basically the old SwitchCoreKeyboard. */ void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master) { KeyClassPtr mk = master->key; if (device == master) return; mk->sourceid = device->id; if (!XkbDeviceApplyKeymap(master, device->key->xkbInfo->desc)) FatalError("Couldn't pivot keymap from device to core!\n"); } /** * Copies the feedback classes from device "from" into device "to". Classes * are duplicated (not just flipping the pointers). All feedback classes are * linked lists, the full list is duplicated. */ static void DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { ClassesPtr classes; if (from->intfeed) { IntegerFeedbackPtr *i, it; if (!to->intfeed) { classes = to->unused_classes; to->intfeed = classes->intfeed; classes->intfeed = NULL; } i = &to->intfeed; for (it = from->intfeed; it; it = it->next) { if (!(*i)) { *i = calloc(1, sizeof(IntegerFeedbackClassRec)); if (!(*i)) { ErrorF("[Xi] Cannot alloc memory for class copy."); return; } } (*i)->CtrlProc = it->CtrlProc; (*i)->ctrl = it->ctrl; i = &(*i)->next; } } else if (to->intfeed && !from->intfeed) { classes = to->unused_classes; classes->intfeed = to->intfeed; to->intfeed = NULL; } if (from->stringfeed) { StringFeedbackPtr *s, it; if (!to->stringfeed) { classes = to->unused_classes; to->stringfeed = classes->stringfeed; classes->stringfeed = NULL; } s = &to->stringfeed; for (it = from->stringfeed; it; it = it->next) { if (!(*s)) { *s = calloc(1, sizeof(StringFeedbackClassRec)); if (!(*s)) { ErrorF("[Xi] Cannot alloc memory for class copy."); return; } } (*s)->CtrlProc = it->CtrlProc; (*s)->ctrl = it->ctrl; s = &(*s)->next; } } else if (to->stringfeed && !from->stringfeed) { classes = to->unused_classes; classes->stringfeed = to->stringfeed; to->stringfeed = NULL; } if (from->bell) { BellFeedbackPtr *b, it; if (!to->bell) { classes = to->unused_classes; to->bell = classes->bell; classes->bell = NULL; } b = &to->bell; for (it = from->bell; it; it = it->next) { if (!(*b)) { *b = calloc(1, sizeof(BellFeedbackClassRec)); if (!(*b)) { ErrorF("[Xi] Cannot alloc memory for class copy."); return; } } (*b)->BellProc = it->BellProc; (*b)->CtrlProc = it->CtrlProc; (*b)->ctrl = it->ctrl; b = &(*b)->next; } } else if (to->bell && !from->bell) { classes = to->unused_classes; classes->bell = to->bell; to->bell = NULL; } if (from->leds) { LedFeedbackPtr *l, it; if (!to->leds) { classes = to->unused_classes; to->leds = classes->leds; classes->leds = NULL; } l = &to->leds; for (it = from->leds; it; it = it->next) { if (!(*l)) { *l = calloc(1, sizeof(LedFeedbackClassRec)); if (!(*l)) { ErrorF("[Xi] Cannot alloc memory for class copy."); return; } } (*l)->CtrlProc = it->CtrlProc; (*l)->ctrl = it->ctrl; if ((*l)->xkb_sli) XkbFreeSrvLedInfo((*l)->xkb_sli); (*l)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, NULL, *l); l = &(*l)->next; } } else if (to->leds && !from->leds) { classes = to->unused_classes; classes->leds = to->leds; to->leds = NULL; } } static void DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) { ClassesPtr classes; /* XkbInitDevice (->XkbInitIndicatorMap->XkbFindSrvLedInfo) relies on the * kbdfeed to be set up properly, so let's do the feedback classes first. */ if (from->kbdfeed) { KbdFeedbackPtr *k, it; if (!to->kbdfeed) { classes = to->unused_classes; to->kbdfeed = classes->kbdfeed; if (!to->kbdfeed) InitKeyboardDeviceStruct(to, NULL, NULL, NULL); classes->kbdfeed = NULL; } k = &to->kbdfeed; for (it = from->kbdfeed; it; it = it->next) { if (!(*k)) { *k = calloc(1, sizeof(KbdFeedbackClassRec)); if (!*k) { ErrorF("[Xi] Cannot alloc memory for class copy."); return; } } (*k)->BellProc = it->BellProc; (*k)->CtrlProc = it->CtrlProc; (*k)->ctrl = it->ctrl; if ((*k)->xkb_sli) XkbFreeSrvLedInfo((*k)->xkb_sli); (*k)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, *k, NULL); k = &(*k)->next; } } else if (to->kbdfeed && !from->kbdfeed) { classes = to->unused_classes; classes->kbdfeed = to->kbdfeed; to->kbdfeed = NULL; } if (from->key) { if (!to->key) { classes = to->unused_classes; to->key = classes->key; if (!to->key) InitKeyboardDeviceStruct(to, NULL, NULL, NULL); else classes->key = NULL; } CopyKeyClass(from, to); } else if (to->key && !from->key) { classes = to->unused_classes; classes->key = to->key; to->key = NULL; } /* If a SrvLedInfoPtr's flags are XkbSLI_IsDefault, the names and maps * pointer point into the xkbInfo->desc struct. XkbCopySrvLedInfo * didn't update the pointers so we need to do it manually here. */ if (to->kbdfeed) { KbdFeedbackPtr k; for (k = to->kbdfeed; k; k = k->next) { if (!k->xkb_sli) continue; if (k->xkb_sli->flags & XkbSLI_IsDefault) { k->xkb_sli->names = to->key->xkbInfo->desc->names->indicators; k->xkb_sli->maps = to->key->xkbInfo->desc->indicators->maps; } } } /* We can't just copy over the focus class. When an app sets the focus, * it'll do so on the master device. Copying the SDs focus means losing * the focus. * So we only copy the focus class if the device didn't have one, * otherwise we leave it as it is. */ if (from->focus) { if (!to->focus) { WindowPtr *oldTrace; classes = to->unused_classes; to->focus = classes->focus; if (!to->focus) { to->focus = calloc(1, sizeof(FocusClassRec)); if (!to->focus) FatalError("[Xi] no memory for class shift.\n"); } else classes->focus = NULL; oldTrace = to->focus->trace; memcpy(to->focus, from->focus, sizeof(FocusClassRec)); to->focus->trace = realloc(oldTrace, to->focus->traceSize * sizeof(WindowPtr)); if (!to->focus->trace && to->focus->traceSize) FatalError("[Xi] no memory for trace.\n"); memcpy(to->focus->trace, from->focus->trace, from->focus->traceSize * sizeof(WindowPtr)); to->focus->sourceid = from->id; } } else if (to->focus) { classes = to->unused_classes; classes->focus = to->focus; to->focus = NULL; } } /* FIXME: this should really be shared with the InitValuatorAxisClassRec and * similar */ static void DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { ClassesPtr classes; /* Feedback classes must be copied first */ if (from->ptrfeed) { PtrFeedbackPtr *p, it; if (!to->ptrfeed) { classes = to->unused_classes; to->ptrfeed = classes->ptrfeed; classes->ptrfeed = NULL; } p = &to->ptrfeed; for (it = from->ptrfeed; it; it = it->next) { if (!(*p)) { *p = calloc(1, sizeof(PtrFeedbackClassRec)); if (!*p) { ErrorF("[Xi] Cannot alloc memory for class copy."); return; } } (*p)->CtrlProc = it->CtrlProc; (*p)->ctrl = it->ctrl; p = &(*p)->next; } } else if (to->ptrfeed && !from->ptrfeed) { classes = to->unused_classes; classes->ptrfeed = to->ptrfeed; to->ptrfeed = NULL; } if (from->valuator) { ValuatorClassPtr v; if (!to->valuator) { classes = to->unused_classes; to->valuator = classes->valuator; if (to->valuator) classes->valuator = NULL; } v = AllocValuatorClass(to->valuator, from->valuator->numAxes); if (!v) FatalError("[Xi] no memory for class shift.\n"); to->valuator = v; memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo)); v->sourceid = from->id; } else if (to->valuator && !from->valuator) { classes = to->unused_classes; classes->valuator = to->valuator; to->valuator = NULL; } if (from->button) { if (!to->button) { classes = to->unused_classes; to->button = classes->button; if (!to->button) { to->button = calloc(1, sizeof(ButtonClassRec)); if (!to->button) FatalError("[Xi] no memory for class shift.\n"); } else classes->button = NULL; } if (from->button->xkb_acts) { if (!to->button->xkb_acts) { to->button->xkb_acts = calloc(1, sizeof(XkbAction)); if (!to->button->xkb_acts) FatalError("[Xi] not enough memory for xkb_acts.\n"); } memcpy(to->button->xkb_acts, from->button->xkb_acts, sizeof(XkbAction)); } else free(to->button->xkb_acts); memcpy(to->button->labels, from->button->labels, from->button->numButtons * sizeof(Atom)); to->button->sourceid = from->id; } else if (to->button && !from->button) { classes = to->unused_classes; classes->button = to->button; to->button = NULL; } if (from->proximity) { if (!to->proximity) { classes = to->unused_classes; to->proximity = classes->proximity; if (!to->proximity) { to->proximity = calloc(1, sizeof(ProximityClassRec)); if (!to->proximity) FatalError("[Xi] no memory for class shift.\n"); } else classes->proximity = NULL; } memcpy(to->proximity, from->proximity, sizeof(ProximityClassRec)); to->proximity->sourceid = from->id; } else if (to->proximity) { classes = to->unused_classes; classes->proximity = to->proximity; to->proximity = NULL; } if (from->touch) { TouchClassPtr t, f; if (!to->touch) { classes = to->unused_classes; to->touch = classes->touch; if (!to->touch) { int i; to->touch = calloc(1, sizeof(TouchClassRec)); if (!to->touch) FatalError("[Xi] no memory for class shift.\n"); to->touch->num_touches = from->touch->num_touches; to->touch->touches = calloc(to->touch->num_touches, sizeof(TouchPointInfoRec)); for (i = 0; i < to->touch->num_touches; i++) TouchInitTouchPoint(to->touch, to->valuator, i); if (!to->touch) FatalError("[Xi] no memory for class shift.\n"); } else classes->touch = NULL; } t = to->touch; f = from->touch; t->sourceid = f->sourceid; t->max_touches = f->max_touches; t->mode = f->mode; t->buttonsDown = f->buttonsDown; t->state = f->state; t->motionMask = f->motionMask; /* to->touches and to->num_touches are separate on the master, * don't copy */ } /* Don't remove touch class if from->touch is non-existent. The to device * may have an active touch grab, so we need to keep the touch class record * around. */ } /** * Copies the CONTENT of the classes of device from into the classes in device * to. From and to are identical after finishing. * * If to does not have classes from currenly has, the classes are stored in * to's devPrivates system. Later, we recover it again from there if needed. * Saves a few memory allocations. */ void DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to, DeviceChangedEvent *dce) { OsBlockSIGIO(); /* generic feedback classes, not tied to pointer and/or keyboard */ DeepCopyFeedbackClasses(from, to); if ((dce->flags & DEVCHANGE_KEYBOARD_EVENT)) DeepCopyKeyboardClasses(from, to); if ((dce->flags & DEVCHANGE_POINTER_EVENT)) DeepCopyPointerClasses(from, to); OsReleaseSIGIO(); } /** * Send an XI2 DeviceChangedEvent to all interested clients. */ void XISendDeviceChangedEvent(DeviceIntPtr device, DeviceChangedEvent *dce) { xXIDeviceChangedEvent *dcce; int rc; rc = EventToXI2((InternalEvent *) dce, (xEvent **) &dcce); if (rc != Success) { ErrorF("[Xi] event conversion from DCE failed with code %d\n", rc); return; } /* we don't actually swap if there's a NullClient, swapping is done * later when event is delivered. */ SendEventToAllWindows(device, XI_DeviceChangedMask, (xEvent *) dcce, 1); free(dcce); } static void ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce) { DeviceIntPtr slave; int rc; /* For now, we don't have devices that change physically. */ if (!IsMaster(device)) return; rc = dixLookupDevice(&slave, dce->sourceid, serverClient, DixReadAccess); if (rc != Success) return; /* Device has disappeared */ if (IsMaster(slave)) return; if (IsFloating(slave)) return; /* set floating since the event */ if (GetMaster(slave, MASTER_ATTACHED)->id != dce->masterid) return; /* not our slave anymore, don't care */ /* FIXME: we probably need to send a DCE for the new slave now */ device->public.devicePrivate = slave->public.devicePrivate; /* FIXME: the classes may have changed since we generated the event. */ DeepCopyDeviceClasses(slave, device, dce); dce->deviceid = device->id; XISendDeviceChangedEvent(device, dce); } /** * Add state and motionMask to the filter for this event. The protocol * supports some extra masks for motion when a button is down: * ButtonXMotionMask and the DeviceButtonMotionMask to trigger only when at * least one button (or that specific button is down). These masks need to * be added to the filters for core/XI motion events. * * @param device The device to update the mask for * @param state The current button state mask * @param motion_mask The motion mask (DeviceButtonMotionMask or 0) */ static void UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state, Mask motion_mask) { Mask mask; mask = DevicePointerMotionMask | state | motion_mask; SetMaskForEvent(device->id, mask, DeviceMotionNotify); mask = PointerMotionMask | state | motion_mask; SetMaskForEvent(device->id, mask, MotionNotify); } static void IncreaseButtonCount(DeviceIntPtr dev, int key, CARD8 *buttons_down, Mask *motion_mask, unsigned short *state) { if (dev->valuator) dev->valuator->motionHintWindow = NullWindow; (*buttons_down)++; *motion_mask = DeviceButtonMotionMask; if (dev->button->map[key] <= 5) *state |= (Button1Mask >> 1) << dev->button->map[key]; } static void DecreaseButtonCount(DeviceIntPtr dev, int key, CARD8 *buttons_down, Mask *motion_mask, unsigned short *state) { if (dev->valuator) dev->valuator->motionHintWindow = NullWindow; if (*buttons_down >= 1 && !--(*buttons_down)) *motion_mask = 0; if (dev->button->map[key] <= 5) *state &= ~((Button1Mask >> 1) << dev->button->map[key]); } /** * Update the device state according to the data in the event. * * return values are * DEFAULT ... process as normal * DONT_PROCESS ... return immediately from caller */ #define DEFAULT 0 #define DONT_PROCESS 1 int UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event) { int i; int key = 0, last_valuator; KeyClassPtr k = NULL; ButtonClassPtr b = NULL; ValuatorClassPtr v = NULL; TouchClassPtr t = NULL; /* This event is always the first we get, before the actual events with * the data. However, the way how the DDX is set up, "device" will * actually be the slave device that caused the event. */ switch (event->type) { case ET_DeviceChanged: ChangeMasterDeviceClasses(device, (DeviceChangedEvent *) event); return DONT_PROCESS; /* event has been sent already */ case ET_Motion: case ET_ButtonPress: case ET_ButtonRelease: case ET_KeyPress: case ET_KeyRelease: case ET_ProximityIn: case ET_ProximityOut: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: break; default: /* other events don't update the device */ return DEFAULT; } k = device->key; v = device->valuator; b = device->button; t = device->touch; key = event->detail.key; /* Update device axis */ /* Check valuators first */ last_valuator = -1; for (i = 0; i < MAX_VALUATORS; i++) { if (BitIsOn(&event->valuators.mask, i)) { if (!v) { ErrorF("[Xi] Valuators reported for non-valuator device '%s'. " "Ignoring event.\n", device->name); return DONT_PROCESS; } else if (v->numAxes < i) { ErrorF("[Xi] Too many valuators reported for device '%s'. " "Ignoring event.\n", device->name); return DONT_PROCESS; } last_valuator = i; } } for (i = 0; i <= last_valuator && i < v->numAxes; i++) { /* XXX: Relative/Absolute mode */ if (BitIsOn(&event->valuators.mask, i)) v->axisVal[i] = event->valuators.data[i]; } if (event->type == ET_KeyPress) { if (!k) return DONT_PROCESS; /* don't allow ddx to generate multiple downs, but repeats are okay */ if (key_is_down(device, key, KEY_PROCESSED) && !event->key_repeat) return DONT_PROCESS; if (device->valuator) device->valuator->motionHintWindow = NullWindow; set_key_down(device, key, KEY_PROCESSED); } else if (event->type == ET_KeyRelease) { if (!k) return DONT_PROCESS; if (!key_is_down(device, key, KEY_PROCESSED)) /* guard against duplicates */ return DONT_PROCESS; if (device->valuator) device->valuator->motionHintWindow = NullWindow; set_key_up(device, key, KEY_PROCESSED); } else if (event->type == ET_ButtonPress) { if (!b) return DONT_PROCESS; if (button_is_down(device, key, BUTTON_PROCESSED)) return DONT_PROCESS; set_button_down(device, key, BUTTON_PROCESSED); if (!b->map[key]) return DONT_PROCESS; IncreaseButtonCount(device, key, &b->buttonsDown, &b->motionMask, &b->state); UpdateDeviceMotionMask(device, b->state, b->motionMask); } else if (event->type == ET_ButtonRelease) { if (!b) return DONT_PROCESS; if (!button_is_down(device, key, BUTTON_PROCESSED)) return DONT_PROCESS; if (IsMaster(device)) { DeviceIntPtr sd; /* * Leave the button down if any slave has the * button still down. Note that this depends on the * event being delivered through the slave first */ for (sd = inputInfo.devices; sd; sd = sd->next) { if (IsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device) continue; if (!sd->button) continue; for (i = 1; i <= sd->button->numButtons; i++) if (sd->button->map[i] == key && button_is_down(sd, i, BUTTON_PROCESSED)) return DONT_PROCESS; } } set_button_up(device, key, BUTTON_PROCESSED); if (!b->map[key]) return DONT_PROCESS; DecreaseButtonCount(device, key, &b->buttonsDown, &b->motionMask, &b->state); UpdateDeviceMotionMask(device, b->state, b->motionMask); } else if (event->type == ET_ProximityIn) device->proximity->in_proximity = TRUE; else if (event->type == ET_ProximityOut) device->proximity->in_proximity = FALSE; else if (event->type == ET_TouchBegin) { BUG_RETURN_VAL(!b || !v, DONT_PROCESS); BUG_RETURN_VAL(!t, DONT_PROCESS); if (!b->map[key]) return DONT_PROCESS; if (!(event->flags & TOUCH_POINTER_EMULATED) || (event->flags & TOUCH_REPLAYING)) return DONT_PROCESS; IncreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask, &t->state); UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask); } else if (event->type == ET_TouchEnd) { BUG_RETURN_VAL(!b || !v, DONT_PROCESS); BUG_RETURN_VAL(!t, DONT_PROCESS); if (t->buttonsDown <= 0 || !b->map[key]) return DONT_PROCESS; if (!(event->flags & TOUCH_POINTER_EMULATED)) return DONT_PROCESS; DecreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask, &t->state); UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask); } return DEFAULT; } /** * A client that does not have the TouchOwnership mask set may not receive a * TouchBegin event if there is at least one grab active. * * @return TRUE if the client selected for ownership events on the given * window for this device, FALSE otherwise */ static inline Bool TouchClientWantsOwnershipEvents(ClientPtr client, DeviceIntPtr dev, WindowPtr win) { InputClients *iclient; nt_list_for_each_entry(iclient, wOtherInputMasks(win)->inputClients, next) { if (rClient(iclient) != client) continue; return xi2mask_isset(iclient->xi2mask, dev, XI_TouchOwnership); } return FALSE; } static void TouchSendOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, int reason, XID resource) { int nev, i; InternalEvent *tel = InitEventList(GetMaximumEventsNum()); nev = GetTouchOwnershipEvents(tel, dev, ti, reason, resource, 0); for (i = 0; i < nev; i++) mieqProcessDeviceEvent(dev, tel + i, NULL); FreeEventList(tel, GetMaximumEventsNum()); } /** * Attempts to deliver a touch event to the given client. */ static Bool DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti, GrabPtr grab, WindowPtr win, InternalEvent *ev) { int err; xEvent *xi2; Mask filter; Window child = DeepestSpriteWin(&ti->sprite)->drawable.id; /* FIXME: owner event handling */ /* If the client does not have the ownership mask set and is not * the current owner of the touch, only pretend we delivered */ if (!grab && ti->num_grabs != 0 && !TouchClientWantsOwnershipEvents(client, dev, win)) return TRUE; /* If we fail here, we're going to leave a client hanging. */ err = EventToXI2(ev, &xi2); if (err != Success) FatalError("[Xi] %s: XI2 conversion failed in %s" " (%d)\n", dev->name, __func__, err); FixUpEventFromWindow(&ti->sprite, xi2, win, child, FALSE); filter = GetEventFilter(dev, xi2); if (XaceHook(XACE_RECEIVE_ACCESS, client, win, xi2, 1) != Success) return FALSE; err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab); free(xi2); /* Returning the value from TryClientEvents isn't useful, since all our * resource-gone cleanups will update the delivery list anyway. */ return TRUE; } static void ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti) { ClientPtr client; XID error; GrabPtr grab = ti->listeners[0].grab; BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB && ti->listeners[0].type != LISTENER_POINTER_GRAB); BUG_RETURN(!grab); client = rClient(grab); if (TouchAcceptReject(client, dev, XIAcceptTouch, ti->client_id, ti->listeners[0].window->drawable.id, &error) != Success) ErrorF("[Xi] Failed to accept touch grab after early acceptance.\n"); } /** * Find the oldest touch that still has a pointer emulation client. * * Pointer emulation can only be performed for the oldest touch. Otherwise, the * order of events seen by the client will be wrong. This function helps us find * the next touch to be emulated. * * @param dev The device to find touches for. */ static TouchPointInfoPtr FindOldestPointerEmulatedTouch(DeviceIntPtr dev) { TouchPointInfoPtr oldest = NULL; int i; for (i = 0; i < dev->touch->num_touches; i++) { TouchPointInfoPtr ti = dev->touch->touches + i; int j; if (!ti->active || !ti->emulate_pointer) continue; for (j = 0; j < ti->num_listeners; j++) { if (ti->listeners[j].type == LISTENER_POINTER_GRAB || ti->listeners[j].type == LISTENER_POINTER_REGULAR) break; } if (j == ti->num_listeners) continue; if (!oldest) { oldest = ti; continue; } if (oldest->client_id - ti->client_id < UINT_MAX / 2) oldest = ti; } return oldest; } /** * If the current owner has rejected the event, deliver the * TouchOwnership/TouchBegin to the next item in the sprite stack. */ static void TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti, TouchOwnershipEvent *ev) { TouchListener *listener = &ti->listeners[0]; /* new owner */ int accepted_early = listener->state == LISTENER_EARLY_ACCEPT; /* Deliver the ownership */ if (listener->state == LISTENER_AWAITING_OWNER || accepted_early) DeliverTouchEvents(dev, ti, (InternalEvent *) ev, listener->listener); else if (listener->state == LISTENER_AWAITING_BEGIN) { /* We can't punt to a pointer listener unless all older pointer * emulated touches have been seen already. */ if ((listener->type == LISTENER_POINTER_GRAB || listener->type == LISTENER_POINTER_REGULAR) && ti != FindOldestPointerEmulatedTouch(dev)) return; TouchEventHistoryReplay(ti, dev, listener->listener); } /* New owner has Begin/Update but not end. If touch is pending_finish, * emulate the TouchEnd now */ if (ti->pending_finish) { TouchEmitTouchEnd(dev, ti, 0, 0); /* If the last owner is not a touch grab, finalise the touch, we won't get more correspondence on this. */ if (ti->num_listeners == 1 && (ti->num_grabs == 0 || listener->grab->grabtype != XI2 || !xi2mask_isset(listener->grab->xi2mask, dev, XI_TouchBegin))) { TouchEndTouch(dev, ti); return; } } if (accepted_early) ActivateEarlyAccept(dev, ti); } /** * Check the oldest touch to see if it needs to be replayed to its pointer * owner. * * Touch event propagation is paused if it hits a pointer listener while an * older touch with a pointer listener is waiting on accept or reject. This * function will restart propagation of a paused touch if needed. * * @param dev The device to check touches for. */ static void CheckOldestTouch(DeviceIntPtr dev) { TouchPointInfoPtr oldest = FindOldestPointerEmulatedTouch(dev); if (oldest && oldest->listeners[0].state == LISTENER_AWAITING_BEGIN) TouchPuntToNextOwner(dev, oldest, NULL); } /** * Process a touch rejection. * * @param sourcedev The source device of the touch sequence. * @param ti The touchpoint info record. * @param resource The resource of the client rejecting the touch. * @param ev TouchOwnership event to send. Set to NULL if no event should be * sent. */ void TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource, TouchOwnershipEvent *ev) { Bool was_owner = (resource == ti->listeners[0].listener); int i; /* Send a TouchEnd event to the resource being removed, but only if they * haven't received one yet already */ for (i = 0; i < ti->num_listeners; i++) { if (ti->listeners[i].listener == resource) { if (ti->listeners[i].state != LISTENER_HAS_END) TouchEmitTouchEnd(sourcedev, ti, TOUCH_REJECT, resource); break; } } /* Remove the resource from the listener list, updating * ti->num_listeners, as well as ti->num_grabs if it was a grab. */ TouchRemoveListener(ti, resource); /* If the current owner was removed and there are further listeners, deliver * the TouchOwnership or TouchBegin event to the new owner. */ if (ev && ti->num_listeners > 0 && was_owner) TouchPuntToNextOwner(sourcedev, ti, ev); else if (ti->num_listeners == 0) TouchEndTouch(sourcedev, ti); CheckOldestTouch(sourcedev); } /** * Processes a TouchOwnership event, indicating a grab has accepted the touch * it currently owns, or a grab or selection has been removed. Will generate * and send TouchEnd events to all clients removed from the delivery list, as * well as possibly sending the new TouchOwnership event. May end the * touchpoint if it is pending finish. */ static void ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev, DeviceIntPtr dev) { TouchPointInfoPtr ti = TouchFindByClientID(dev, ev->touchid); if (!ti) { DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n", dev->name, ev->type, ev->touchid); return; } if (ev->reason == XIRejectTouch) TouchRejected(dev, ti, ev->resource, ev); else if (ev->reason == XIAcceptTouch) { int i; /* For pointer-emulated listeners that ungrabbed the active grab, * the state was forced to LISTENER_HAS_END. Still go * through the motions of ending the touch if the listener has * already seen the end. This ensures that the touch record is ended in * the server. */ if (ti->listeners[0].state == LISTENER_HAS_END) TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener); /* The touch owner has accepted the touch. Send TouchEnd events to * everyone else, and truncate the list of listeners. */ for (i = 1; i < ti->num_listeners; i++) TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[i].listener); while (ti->num_listeners > 1) TouchRemoveListener(ti, ti->listeners[1].listener); /* Owner accepted after receiving end */ if (ti->listeners[0].state == LISTENER_HAS_END) TouchEndTouch(dev, ti); else ti->listeners[0].state = LISTENER_HAS_ACCEPTED; } else { /* this is the very first ownership event for a grab */ DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource); } } /** * Copy the event's valuator information into the touchpoint, we may need * this for emulated TouchEnd events. */ static void TouchCopyValuatorData(DeviceEvent *ev, TouchPointInfoPtr ti) { int 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]); } /** * Given a touch event and a potential listener, retrieve info needed for * processing the event. * * @param dev The device generating the touch event. * @param ti The touch point info record for the touch event. * @param ev The touch event to process. * @param listener The touch event listener that may receive the touch event. * @param[out] client The client that should receive the touch event. * @param[out] win The window to deliver the event on. * @param[out] grab The grab to deliver the event through, if any. * @param[out] mask The XI 2.x event mask of the grab or selection, if any. * @return TRUE if an event should be delivered to the listener, FALSE * otherwise. */ static Bool RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, TouchListener * listener, ClientPtr *client, WindowPtr *win, GrabPtr *grab, XI2Mask **mask) { int rc; InputClients *iclients = NULL; *mask = NULL; if (listener->type == LISTENER_GRAB || listener->type == LISTENER_POINTER_GRAB) { *grab = listener->grab; BUG_RETURN_VAL(!*grab, FALSE); *client = rClient(*grab); *win = (*grab)->window; *mask = (*grab)->xi2mask; } else { rc = dixLookupResourceByType((void **) win, listener->listener, listener->resource_type, serverClient, DixSendAccess); if (rc != Success) return FALSE; if (listener->level == XI2) { int evtype; if (ti->emulate_pointer && listener->type == LISTENER_POINTER_REGULAR) evtype = GetXI2Type(TouchGetPointerEventType(ev)); else evtype = GetXI2Type(ev->any.type); nt_list_for_each_entry(iclients, wOtherInputMasks(*win)->inputClients, next) if (xi2mask_isset(iclients->xi2mask, dev, evtype)) break; BUG_RETURN_VAL(!iclients, FALSE); *mask = iclients->xi2mask; *client = rClient(iclients); } else if (listener->level == XI) { int xi_type = GetXIType(TouchGetPointerEventType(ev)); Mask xi_filter = event_get_filter_from_type(dev, xi_type); nt_list_for_each_entry(iclients, wOtherInputMasks(*win)->inputClients, next) if (iclients->mask[dev->id] & xi_filter) break; BUG_RETURN_VAL(!iclients, FALSE); *client = rClient(iclients); } else { int coretype = GetCoreType(TouchGetPointerEventType(ev)); Mask core_filter = event_get_filter_from_type(dev, coretype); OtherClients *oclients; /* all others */ nt_list_for_each_entry(oclients, (OtherClients *) wOtherClients(*win), next) if (oclients->mask & core_filter) break; /* if owner selected, oclients is NULL */ *client = oclients ? rClient(oclients) : wClient(*win); } *grab = NULL; } return TRUE; } static int DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, TouchListener * listener, ClientPtr client, WindowPtr win, GrabPtr grab, XI2Mask *xi2mask) { InternalEvent motion, button; InternalEvent *ptrev = &motion; int nevents; DeviceIntPtr kbd; /* We don't deliver pointer events to non-owners */ if (!TouchResourceIsOwner(ti, listener->listener)) return !Success; nevents = TouchConvertToPointerEvent(ev, &motion, &button); BUG_RETURN_VAL(nevents == 0, BadValue); if (nevents > 1) ptrev = &button; kbd = GetMaster(dev, KEYBOARD_OR_FLOAT); event_set_state(dev, kbd, &ptrev->device_event); ptrev->device_event.corestate = event_get_corestate(dev, kbd); if (grab) { /* 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 { int deliveries = 0; /* 'grab' is the passive grab, but if the grab isn't active, * don't deliver */ if (!dev->deviceGrab.grab) return !Success; if (grab->ownerEvents) { WindowPtr focus = NullWindow; WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite); deliveries = DeliverDeviceEvents(sprite_win, ptrev, grab, focus, dev); } if (!deliveries) deliveries = DeliverOneGrabbedEvent(ptrev, dev, grab->grabtype); /* We must accept the touch sequence once a pointer listener has * received one event past ButtonPress. */ if (deliveries && ev->any.type != ET_TouchBegin && !(ev->device_event.flags & TOUCH_CLIENT_ID)) TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch); if (ev->any.type == ET_TouchEnd && ti->num_listeners == 1 && !dev->button->buttonsDown && dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) { (*dev->deviceGrab.DeactivateGrab) (dev); CheckOldestTouch(dev); return Success; } } } else { GrabPtr devgrab = dev->deviceGrab.grab; WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite); DeliverDeviceEvents(sprite_win, ptrev, grab, win, dev); /* FIXME: bad hack * Implicit passive grab activated in response to this event. Store * the event. */ if (!devgrab && dev->deviceGrab.grab && dev->deviceGrab.implicitGrab) { TouchListener *l; GrabPtr g; devgrab = dev->deviceGrab.grab; g = AllocGrab(devgrab); BUG_WARN(!g); *dev->deviceGrab.sync.event = ev->device_event; /* The listener array has a sequence of grabs and then one event * selection. Implicit grab activation occurs through delivering an * event selection. Thus, we update the last listener in the array. */ l = &ti->listeners[ti->num_listeners - 1]; l->listener = g->resource; l->grab = g; //l->resource_type = RT_NONE; if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin) l->type = LISTENER_POINTER_GRAB; else l->type = LISTENER_GRAB; } } if (ev->any.type == ET_TouchBegin) listener->state = LISTENER_IS_OWNER; else if (ev->any.type == ET_TouchEnd) listener->state = LISTENER_HAS_END; return Success; } static void DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev) { DeviceEvent motion; if (ti->num_listeners) { ClientPtr client; WindowPtr win; GrabPtr grab; XI2Mask *mask; if (ti->listeners[0].type != LISTENER_POINTER_REGULAR && ti->listeners[0].type != LISTENER_POINTER_GRAB) return; motion = ev->device_event; motion.type = ET_TouchUpdate; motion.detail.button = 0; if (!RetrieveTouchDeliveryData(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], &client, &win, &grab, &mask)) return; /* There may be a pointer grab on the device */ if (!grab) { grab = dev->deviceGrab.grab; if (grab) { win = grab->window; mask = grab->xi2mask; client = rClient(grab); } } DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client, win, grab, mask); } else { InternalEvent button; int converted; converted = TouchConvertToPointerEvent(ev, (InternalEvent*)&motion, &button); BUG_WARN(converted == 0); if (converted) ProcessOtherEvent((InternalEvent*)&motion, dev); } } /** * Processes and delivers a TouchBegin, TouchUpdate, or a * TouchEnd event. * * Due to having rather different delivery semantics (see the Xi 2.2 protocol * spec for more information), this implements its own grab and event-selection * delivery logic. */ static void ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) { TouchClassPtr t = dev->touch; TouchPointInfoPtr ti; uint32_t touchid; int type = ev->any.type; int emulate_pointer = ! !(ev->device_event.flags & TOUCH_POINTER_EMULATED); DeviceIntPtr kbd; if (!t) return; touchid = ev->device_event.touchid; if (type == ET_TouchBegin && !(ev->device_event.flags & TOUCH_REPLAYING)) { ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid, emulate_pointer); } else ti = TouchFindByClientID(dev, touchid); /* 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))) { /* 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); } } if (!ti) { DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n", dev->name, type, touchid); return; } /* if emulate_pointer is set, emulate the motion event right * here, so we can ignore it for button event emulation. TouchUpdate * 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. */ /* FIXME: check this */ if ((type == ET_TouchBegin && !(ev->device_event.flags & TOUCH_REPLAYING) && !TouchBuildSprite(dev, ti, ev)) || (type != ET_TouchEnd && ti->sprite.spriteTraceGood == 0)) return; TouchCopyValuatorData(&ev->device_event, ti); /* WARNING: the event type may change to TouchUpdate in * DeliverTouchEvents if a TouchEnd was delivered to a grabbing * owner */ DeliverTouchEvents(dev, ti, ev, ev->device_event.resource); 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); } /** * Process DeviceEvents and DeviceChangedEvents. */ static void ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) { GrabPtr grab; Bool deactivateDeviceGrab = FALSE; int key = 0, rootX, rootY; ButtonClassPtr b; int ret = 0; int corestate; DeviceIntPtr mouse = NULL, kbd = NULL; DeviceEvent *event = &ev->device_event; if (IsPointerDevice(device)) { kbd = GetMaster(device, KEYBOARD_OR_FLOAT); mouse = device; if (!kbd->key) /* can happen with floating SDs */ kbd = NULL; } else { mouse = GetMaster(device, POINTER_OR_FLOAT); kbd = device; if (!mouse->valuator || !mouse->button) /* may be float. SDs */ mouse = NULL; } corestate = event_get_corestate(mouse, kbd); event_set_state(mouse, kbd, event); ret = UpdateDeviceState(device, event); if (ret == DONT_PROCESS) return; b = device->button; if (IsMaster(device) || IsFloating(device)) CheckMotion(event, device); switch (event->type) { case ET_Motion: case ET_ButtonPress: case ET_ButtonRelease: case ET_KeyPress: case ET_KeyRelease: case ET_ProximityIn: case ET_ProximityOut: GetSpritePosition(device, &rootX, &rootY); event->root_x = rootX; event->root_y = rootY; NoticeEventTime((InternalEvent *) event, device); event->corestate = corestate; key = event->detail.key; break; default: break; } if (DeviceEventCallback && !syncEvents.playingEvents) { DeviceEventInfoRec eventinfo; SpritePtr pSprite = device->spriteInfo->sprite; /* see comment in EnqueueEvents regarding the next three lines */ if (ev->any.type == ET_Motion) ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id; eventinfo.device = device; eventinfo.event = ev; CallCallbacks(&DeviceEventCallback, (void *) &eventinfo); } grab = device->deviceGrab.grab; switch (event->type) { case ET_KeyPress: if (!grab && CheckDeviceGrabs(device, event, 0)) return; break; case ET_KeyRelease: if (grab && device->deviceGrab.fromPassiveGrab && (key == device->deviceGrab.activatingKey) && GrabIsKeyboardGrab(device->deviceGrab.grab)) deactivateDeviceGrab = TRUE; break; case ET_ButtonPress: if (b->map[key] == 0) /* there's no button 0 */ return; event->detail.button = b->map[key]; if (!grab && CheckDeviceGrabs(device, event, 0)) { /* if a passive grab was activated, the event has been sent * already */ return; } break; case ET_ButtonRelease: if (b->map[key] == 0) /* there's no button 0 */ return; event->detail.button = b->map[key]; if (grab && !b->buttonsDown && device->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(device->deviceGrab.grab)) deactivateDeviceGrab = TRUE; default: break; } if (grab) DeliverGrabbedEvent((InternalEvent *) event, device, deactivateDeviceGrab); else if (device->focus && !IsPointerEvent(ev)) DeliverFocusedEvent(device, (InternalEvent *) event, GetSpriteWindow(device)); else DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event, NullGrab, NullWindow, device); if (deactivateDeviceGrab == TRUE) { (*device->deviceGrab.DeactivateGrab) (device); if (!IsMaster (device) && !IsFloating (device)) { int flags, num_events = 0; InternalEvent dce; flags = (IsPointerDevice (device)) ? DEVCHANGE_POINTER_EVENT : DEVCHANGE_KEYBOARD_EVENT; UpdateFromMaster (&dce, device, flags, &num_events); BUG_WARN(num_events > 1); if (num_events == 1) ChangeMasterDeviceClasses(GetMaster (device, MASTER_ATTACHED), &dce.changed_event); } } event->detail.key = key; } /** * Main device event processing function. * Called from when processing the events from the event queue. * */ void ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) { verify_internal_event(ev); switch (ev->any.type) { case ET_RawKeyPress: case ET_RawKeyRelease: case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: case ET_RawTouchBegin: case ET_RawTouchUpdate: case ET_RawTouchEnd: DeliverRawEvent(&ev->raw_event, device); break; case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: ProcessTouchEvent(ev, device); break; case ET_TouchOwnership: /* TouchOwnership events are handled separately from the rest, as they * have more complex semantics. */ ProcessTouchOwnershipEvent(&ev->touch_ownership_event, device); break; case ET_BarrierHit: case ET_BarrierLeave: ProcessBarrierEvent(ev, device); break; default: ProcessDeviceEvent(ev, device); break; } } static int DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, TouchListener * listener, ClientPtr client, WindowPtr win, GrabPtr grab, XI2Mask *xi2mask) { enum TouchListenerState state; int rc = Success; Bool has_ownershipmask; if (listener->type == LISTENER_POINTER_REGULAR || listener->type == LISTENER_POINTER_GRAB) { rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab, xi2mask); if (rc == Success) { listener->state = LISTENER_IS_OWNER; /* async grabs cannot replay, so automatically accept this touch */ if (listener->type == LISTENER_POINTER_GRAB && dev->deviceGrab.grab && dev->deviceGrab.fromPassiveGrab && dev->deviceGrab.grab->pointerMode == GrabModeAsync) ActivateEarlyAccept(dev, ti); } goto out; } has_ownershipmask = xi2mask_isset(xi2mask, dev, XI_TouchOwnership); if (TouchResourceIsOwner(ti, listener->listener) || has_ownershipmask) rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); if (!TouchResourceIsOwner(ti, listener->listener)) { if (has_ownershipmask) state = LISTENER_AWAITING_OWNER; else state = LISTENER_AWAITING_BEGIN; } else { if (has_ownershipmask) TouchSendOwnershipEvent(dev, ti, 0, listener->listener); if (listener->type == LISTENER_REGULAR) state = LISTENER_HAS_ACCEPTED; else state = LISTENER_IS_OWNER; } listener->state = state; out: return rc; } static int DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, TouchListener * listener, ClientPtr client, WindowPtr win, GrabPtr grab, XI2Mask *xi2mask) { int rc = Success; if (listener->type == LISTENER_POINTER_REGULAR || listener->type == LISTENER_POINTER_GRAB) { /* Note: If the active grab was ungrabbed, we already changed the * state to LISTENER_HAS_END but still get here. So we mustn't * actually send the event. * This is part two of the hack in DeactivatePointerGrab */ if (listener->state != LISTENER_HAS_END) { rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab, xi2mask); /* Once we send a TouchEnd to a legacy listener, we're already well * past the accepting/rejecting stage (can only happen on * GrabModeSync + replay. This listener now gets the end event, * and we can continue. */ if (rc == Success) listener->state = LISTENER_HAS_END; } 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 || (ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) { /* Touch has been rejected, or 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; } else if (TouchResourceIsOwner(ti, listener->listener)) { Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT); /* FIXME: what about early acceptance */ if (normal_end && listener->state != LISTENER_HAS_END) rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); if ((ti->num_listeners > 1 || (ti->num_grabs > 0 && listener->state != LISTENER_HAS_ACCEPTED)) && (ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) { ev->any.type = ET_TouchUpdate; ev->device_event.flags |= TOUCH_PENDING_END; ti->pending_finish = TRUE; } if (normal_end) listener->state = LISTENER_HAS_END; } out: return rc; } static int DeliverTouchEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, TouchListener * listener, ClientPtr client, WindowPtr win, GrabPtr grab, XI2Mask *xi2mask) { Bool has_ownershipmask = FALSE; int rc = Success; if (xi2mask) has_ownershipmask = xi2mask_isset(xi2mask, dev, XI_TouchOwnership); if (ev->any.type == ET_TouchOwnership) { ev->touch_ownership_event.deviceid = dev->id; if (!TouchResourceIsOwner(ti, listener->listener)) goto out; rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); listener->state = LISTENER_IS_OWNER; } else ev->device_event.deviceid = dev->id; if (ev->any.type == ET_TouchBegin) { rc = DeliverTouchBeginEvent(dev, ti, ev, listener, client, win, grab, xi2mask); } else if (ev->any.type == ET_TouchUpdate) { if (listener->type == LISTENER_POINTER_REGULAR || listener->type == LISTENER_POINTER_GRAB) DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab, xi2mask); else if (TouchResourceIsOwner(ti, listener->listener) || has_ownershipmask) rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); } else if (ev->any.type == ET_TouchEnd) rc = DeliverTouchEndEvent(dev, ti, ev, listener, client, win, grab, xi2mask); out: return rc; } /** * Delivers a touch events to all interested clients. For TouchBegin events, * will update ti->listeners, ti->num_listeners, and ti->num_grabs. * May also mutate ev (type and flags) upon successful delivery. If * @resource is non-zero, will only attempt delivery to the owner of that * resource. * * @return TRUE if the event was delivered at least once, FALSE otherwise */ void DeliverTouchEvents(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, XID resource) { int i; if (ev->any.type == ET_TouchBegin && !(ev->device_event.flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING))) TouchSetupListeners(dev, ti, ev); TouchEventHistoryPush(ti, &ev->device_event); for (i = 0; i < ti->num_listeners; i++) { GrabPtr grab = NULL; ClientPtr client; WindowPtr win; XI2Mask *mask; TouchListener *listener = &ti->listeners[i]; if (resource && listener->listener != resource) continue; if (!RetrieveTouchDeliveryData(dev, ti, ev, listener, &client, &win, &grab, &mask)) continue; DeliverTouchEvent(dev, ti, ev, listener, client, win, grab, mask); } } int InitProximityClassDeviceStruct(DeviceIntPtr dev) { ProximityClassPtr proxc; BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->proximity != NULL, FALSE); proxc = (ProximityClassPtr) malloc(sizeof(ProximityClassRec)); if (!proxc) return FALSE; proxc->sourceid = dev->id; proxc->in_proximity = TRUE; dev->proximity = proxc; return TRUE; } /** * Initialise the device's valuators. The memory must already be allocated, * this function merely inits the matching axis (specified through axnum) to * sane values. * * It is a condition that (minval < maxval). * * @see InitValuatorClassDeviceStruct */ Bool InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval, int resolution, int min_res, int max_res, int mode) { AxisInfoPtr ax; BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->valuator == NULL, FALSE); BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE); BUG_RETURN_VAL(minval > maxval && mode == Absolute, FALSE); ax = dev->valuator->axes + axnum; ax->min_value = minval; ax->max_value = maxval; ax->resolution = resolution; ax->min_resolution = min_res; ax->max_resolution = max_res; ax->label = label; ax->mode = mode; if (mode & OutOfProximity) dev->proximity->in_proximity = FALSE; return SetScrollValuator(dev, axnum, SCROLL_TYPE_NONE, 0, SCROLL_FLAG_NONE); } /** * Set the given axis number as a scrolling valuator. */ Bool SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type, double increment, int flags) { AxisInfoPtr ax; int *current_ax; InternalEvent dce; DeviceIntPtr master; BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->valuator == NULL, FALSE); BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE); switch (type) { case SCROLL_TYPE_VERTICAL: current_ax = &dev->valuator->v_scroll_axis; break; case SCROLL_TYPE_HORIZONTAL: current_ax = &dev->valuator->h_scroll_axis; break; case SCROLL_TYPE_NONE: ax = &dev->valuator->axes[axnum]; ax->scroll.type = type; return TRUE; default: return FALSE; } if (increment == 0.0) return FALSE; if (*current_ax != -1 && axnum != *current_ax) { ax = &dev->valuator->axes[*current_ax]; if (ax->scroll.type == type && (flags & SCROLL_FLAG_PREFERRED) && (ax->scroll.flags & SCROLL_FLAG_PREFERRED)) return FALSE; } *current_ax = axnum; ax = &dev->valuator->axes[axnum]; ax->scroll.type = type; ax->scroll.increment = increment; ax->scroll.flags = flags; master = GetMaster(dev, MASTER_ATTACHED); CreateClassesChangedEvent(&dce, master, dev, DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE); XISendDeviceChangedEvent(dev, &dce.changed_event); /* if the current slave is us, update the master. If not, we'll update * whenever the next slave switch happens anyway. CMDC sends the event * for us */ if (master && master->lastSlave == dev) ChangeMasterDeviceClasses(master, &dce.changed_event); return TRUE; } int CheckGrabValues(ClientPtr client, GrabParameters *param) { if (param->grabtype != CORE && param->grabtype != XI && param->grabtype != XI2) { ErrorF("[Xi] grabtype is invalid. This is a bug.\n"); return BadImplementation; } if ((param->this_device_mode != GrabModeSync) && (param->this_device_mode != GrabModeAsync) && (param->this_device_mode != XIGrabModeTouch)) { client->errorValue = param->this_device_mode; return BadValue; } if ((param->other_devices_mode != GrabModeSync) && (param->other_devices_mode != GrabModeAsync) && (param->other_devices_mode != XIGrabModeTouch)) { client->errorValue = param->other_devices_mode; return BadValue; } if (param->modifiers != AnyModifier && param->modifiers != XIAnyModifier && (param->modifiers & ~AllModifiersMask)) { client->errorValue = param->modifiers; return BadValue; } if ((param->ownerEvents != xFalse) && (param->ownerEvents != xTrue)) { client->errorValue = param->ownerEvents; return BadValue; } return Success; } int GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, int button, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { WindowPtr pWin, confineTo; CursorPtr cursor; GrabPtr grab; int rc, type = -1; Mask access_mode = DixGrabAccess; rc = CheckGrabValues(client, param); if (rc != Success) return rc; if (param->confineTo == None) confineTo = NullWindow; else { rc = dixLookupWindow(&confineTo, param->confineTo, client, DixSetAttrAccess); if (rc != Success) return rc; } if (param->cursor == None) cursor = NullCursor; else { rc = dixLookupResourceByType((void **) &cursor, param->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = param->cursor; return rc; } access_mode |= DixForceAccess; } if (param->this_device_mode == GrabModeSync || param->other_devices_mode == GrabModeSync) access_mode |= DixFreezeAccess; rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); if (rc != Success) return rc; rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; if (grabtype == XI) type = DeviceButtonPress; else if (grabtype == XI2) type = XI_ButtonPress; grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype, mask, param, type, button, confineTo, cursor); if (!grab) return BadAlloc; return AddPassiveGrabToList(client, grab); } /** * Grab the given key. */ int GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, int key, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { WindowPtr pWin; GrabPtr grab; KeyClassPtr k = dev->key; Mask access_mode = DixGrabAccess; int rc, type = -1; rc = CheckGrabValues(client, param); if (rc != Success) return rc; if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL) return BadMatch; if (grabtype == XI) { if ((key > k->xkbInfo->desc->max_key_code || key < k->xkbInfo->desc->min_key_code) && (key != AnyKey)) { client->errorValue = key; return BadValue; } type = DeviceKeyPress; } else if (grabtype == XI2) type = XI_KeyPress; rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; if (param->this_device_mode == GrabModeSync || param->other_devices_mode == GrabModeSync) access_mode |= DixFreezeAccess; rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); if (rc != Success) return rc; grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype, mask, param, type, key, NULL, NULL); if (!grab) return BadAlloc; return AddPassiveGrabToList(client, grab); } /* Enter/FocusIn grab */ int GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, GrabParameters *param, GrabMask *mask) { WindowPtr pWin; CursorPtr cursor; GrabPtr grab; Mask access_mode = DixGrabAccess; int rc; rc = CheckGrabValues(client, param); if (rc != Success) return rc; rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; if (param->cursor == None) cursor = NullCursor; else { rc = dixLookupResourceByType((void **) &cursor, param->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = param->cursor; return rc; } access_mode |= DixForceAccess; } if (param->this_device_mode == GrabModeSync || param->other_devices_mode == GrabModeSync) access_mode |= DixFreezeAccess; rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); if (rc != Success) return rc; grab = CreateGrab(client->index, dev, dev, pWin, XI2, mask, param, (type == XIGrabtypeEnter) ? XI_Enter : XI_FocusIn, 0, NULL, cursor); if (!grab) return BadAlloc; return AddPassiveGrabToList(client, grab); } /* Touch grab */ int GrabTouch(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev, GrabParameters *param, GrabMask *mask) { WindowPtr pWin; GrabPtr grab; int rc; rc = CheckGrabValues(client, param); if (rc != Success) return rc; rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGrabAccess); if (rc != Success) return rc; grab = CreateGrab(client->index, dev, mod_dev, pWin, XI2, mask, param, XI_TouchBegin, 0, NullWindow, NullCursor); if (!grab) return BadAlloc; return AddPassiveGrabToList(client, grab); } int SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client, Mask mask, Mask exclusivemasks) { int mskidx = dev->id; int i, ret; Mask check; InputClientsPtr others; 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. */ for (others = wOtherInputMasks(pWin)->inputClients; others; others = others->next) { if (!SameClient(others, client) && (check & others->mask[mskidx])) return BadAccess; } } for (others = wOtherInputMasks(pWin)->inputClients; others; others = others->next) { if (SameClient(others, client)) { check = others->mask[mskidx]; others->mask[mskidx] = mask; if (mask == 0) { for (i = 0; i < EMASKSIZE; i++) if (i != mskidx && others->mask[i] != 0) break; if (i == EMASKSIZE) { RecalculateDeviceDeliverableEvents(pWin); if (ShouldFreeInputMasks(pWin, FALSE)) FreeResource(others->resource, RT_NONE); return Success; } } goto maskSet; } } } check = 0; if ((ret = AddExtensionClient(pWin, client, mask, mskidx)) != Success) return ret; maskSet: if (dev->valuator) if ((dev->valuator->motionHintWindow == pWin) && (mask & DevicePointerMotionHintMask) && !(check & DevicePointerMotionHintMask) && !dev->deviceGrab.grab) dev->valuator->motionHintWindow = NullWindow; RecalculateDeviceDeliverableEvents(pWin); return Success; } static void FreeInputClient(InputClientsPtr * other) { xi2mask_free(&(*other)->xi2mask); free(*other); *other = NULL; } static InputClientsPtr AllocInputClient(void) { return calloc(1, sizeof(InputClients)); } int AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx) { InputClientsPtr others; if (!pWin->optional && !MakeWindowOptional(pWin)) return BadAlloc; others = AllocInputClient(); if (!others) return BadAlloc; if (!pWin->optional->inputMasks && !MakeInputMasks(pWin)) goto bail; others->xi2mask = xi2mask_new(); if (!others->xi2mask) goto bail; others->mask[mskidx] = mask; others->resource = FakeClientID(client->index); others->next = pWin->optional->inputMasks->inputClients; pWin->optional->inputMasks->inputClients = others; if (!AddResource(others->resource, RT_INPUTCLIENT, (void *) pWin)) goto bail; return Success; bail: FreeInputClient(&others); return BadAlloc; } static Bool MakeInputMasks(WindowPtr pWin) { struct _OtherInputMasks *imasks; imasks = calloc(1, sizeof(struct _OtherInputMasks)); if (!imasks) return FALSE; imasks->xi2mask = xi2mask_new(); if (!imasks->xi2mask) { free(imasks); return FALSE; } pWin->optional->inputMasks = imasks; return TRUE; } static void FreeInputMask(OtherInputMasks ** imask) { xi2mask_free(&(*imask)->xi2mask); free(*imask); *imask = NULL; } void RecalculateDeviceDeliverableEvents(WindowPtr pWin) { InputClientsPtr others; struct _OtherInputMasks *inputMasks; /* default: NULL */ WindowPtr pChild, tmp; int i; pChild = pWin; while (1) { if ((inputMasks = wOtherInputMasks(pChild)) != 0) { xi2mask_zero(inputMasks->xi2mask, -1); for (others = inputMasks->inputClients; others; others = others->next) { for (i = 0; i < EMASKSIZE; i++) inputMasks->inputEvents[i] |= others->mask[i]; xi2mask_merge(inputMasks->xi2mask, others->xi2mask); } for (i = 0; i < EMASKSIZE; i++) inputMasks->deliverableEvents[i] = inputMasks->inputEvents[i]; for (tmp = pChild->parent; tmp; tmp = tmp->parent) if (wOtherInputMasks(tmp)) for (i = 0; i < EMASKSIZE; i++) inputMasks->deliverableEvents[i] |= (wOtherInputMasks(tmp)->deliverableEvents[i] & ~inputMasks->dontPropagateMask[i] & PropagateMask[i]); } if (pChild->firstChild) { pChild = pChild->firstChild; continue; } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } } int InputClientGone(WindowPtr pWin, XID id) { InputClientsPtr other, prev; if (!wOtherInputMasks(pWin)) return Success; prev = 0; for (other = wOtherInputMasks(pWin)->inputClients; other; other = other->next) { if (other->resource == id) { if (prev) { prev->next = other->next; FreeInputClient(&other); } else if (!(other->next)) { if (ShouldFreeInputMasks(pWin, TRUE)) { OtherInputMasks *mask = wOtherInputMasks(pWin); mask->inputClients = other->next; FreeInputMask(&mask); pWin->optional->inputMasks = (OtherInputMasks *) NULL; CheckWindowOptionalNeed(pWin); FreeInputClient(&other); } else { other->resource = FakeClientID(0); if (!AddResource(other->resource, RT_INPUTCLIENT, (void *) pWin)) return BadAlloc; } } else { wOtherInputMasks(pWin)->inputClients = other->next; FreeInputClient(&other); } RecalculateDeviceDeliverableEvents(pWin); return Success; } prev = other; } FatalError("client not on device event list"); } /** * Search for window in each touch trace for each device. Remove the window * and all its subwindows from the trace when found. The initial window * order is preserved. */ void WindowGone(WindowPtr win) { DeviceIntPtr dev; for (dev = inputInfo.devices; dev; dev = dev->next) { TouchClassPtr t = dev->touch; int i; if (!t) continue; for (i = 0; i < t->num_touches; i++) { SpritePtr sprite = &t->touches[i].sprite; int j; for (j = 0; j < sprite->spriteTraceGood; j++) { if (sprite->spriteTrace[j] == win) { sprite->spriteTraceGood = j; break; } } } } } int SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate, xEvent *ev, Mask mask, int count) { WindowPtr pWin; WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ WindowPtr spriteWin = GetSpriteWindow(d); if (dest == PointerWindow) pWin = spriteWin; else if (dest == InputFocus) { WindowPtr inputFocus; if (!d->focus) inputFocus = spriteWin; else inputFocus = d->focus->win; if (inputFocus == FollowKeyboardWin) inputFocus = inputInfo.keyboard->focus->win; if (inputFocus == NoneWin) return Success; /* If the input focus is PointerRootWin, send the event to where * the pointer is if possible, then perhaps propogate up to root. */ if (inputFocus == PointerRootWin) inputFocus = GetCurrentRootWindow(d); if (IsParent(inputFocus, spriteWin)) { effectiveFocus = inputFocus; pWin = spriteWin; } else effectiveFocus = pWin = inputFocus; } else dixLookupWindow(&pWin, dest, client, DixSendAccess); if (!pWin) return BadWindow; if ((propagate != xFalse) && (propagate != xTrue)) { client->errorValue = propagate; return BadValue; } ev->u.u.type |= 0x80; if (propagate) { for (; pWin; pWin = pWin->parent) { if (DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab)) return Success; if (pWin == effectiveFocus) return Success; if (wOtherInputMasks(pWin)) mask &= ~wOtherInputMasks(pWin)->dontPropagateMask[d->id]; if (!mask) break; } } else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, ev, count)) DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab); return Success; } int SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map) { int i; ButtonClassPtr b = dev->button; if (b == NULL) return BadMatch; if (nElts != b->numButtons) { client->errorValue = nElts; return BadValue; } if (BadDeviceMap(&map[0], nElts, 1, 255, &client->errorValue)) return BadValue; for (i = 0; i < nElts; i++) if ((b->map[i + 1] != map[i]) && BitIsOn(b->down, i + 1)) return MappingBusy; for (i = 0; i < nElts; i++) b->map[i + 1] = map[i]; return Success; } int ChangeKeyMapping(ClientPtr client, DeviceIntPtr dev, unsigned len, int type, KeyCode firstKeyCode, CARD8 keyCodes, CARD8 keySymsPerKeyCode, KeySym * map) { KeySymsRec keysyms; KeyClassPtr k = dev->key; if (k == NULL) return BadMatch; if (len != (keyCodes * keySymsPerKeyCode)) return BadLength; if ((firstKeyCode < k->xkbInfo->desc->min_key_code) || (firstKeyCode + keyCodes - 1 > k->xkbInfo->desc->max_key_code)) { client->errorValue = firstKeyCode; return BadValue; } if (keySymsPerKeyCode == 0) { client->errorValue = 0; return BadValue; } keysyms.minKeyCode = firstKeyCode; keysyms.maxKeyCode = firstKeyCode + keyCodes - 1; keysyms.mapWidth = keySymsPerKeyCode; keysyms.map = map; XkbApplyMappingChange(dev, &keysyms, firstKeyCode, keyCodes, NULL, serverClient); return Success; } static void DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev) { WindowPtr parent; /* Deactivate any grabs performed on this window, before making * any input focus changes. * Deactivating a device grab should cause focus events. */ if (dev->deviceGrab.grab && (dev->deviceGrab.grab->window == pWin)) (*dev->deviceGrab.DeactivateGrab) (dev); /* If the focus window is a root window (ie. has no parent) * then don't delete the focus from it. */ if (dev->focus && (pWin == dev->focus->win) && (pWin->parent != NullWindow)) { int focusEventMode = NotifyNormal; /* If a grab is in progress, then alter the mode of focus events. */ if (dev->deviceGrab.grab) focusEventMode = NotifyWhileGrabbed; switch (dev->focus->revert) { case RevertToNone: if (!ActivateFocusInGrab(dev, pWin, NoneWin)) DoFocusEvents(dev, pWin, NoneWin, focusEventMode); dev->focus->win = NoneWin; dev->focus->traceGood = 0; break; case RevertToParent: parent = pWin; do { parent = parent->parent; dev->focus->traceGood--; } while (!parent->realized); if (!ActivateFocusInGrab(dev, pWin, parent)) DoFocusEvents(dev, pWin, parent, focusEventMode); dev->focus->win = parent; dev->focus->revert = RevertToNone; break; case RevertToPointerRoot: if (!ActivateFocusInGrab(dev, pWin, PointerRootWin)) DoFocusEvents(dev, pWin, PointerRootWin, focusEventMode); dev->focus->win = PointerRootWin; dev->focus->traceGood = 0; break; case RevertToFollowKeyboard: { DeviceIntPtr kbd = GetMaster(dev, MASTER_KEYBOARD); if (!kbd || (kbd == dev && kbd != inputInfo.keyboard)) kbd = inputInfo.keyboard; if (kbd->focus->win) { if (!ActivateFocusInGrab(dev, pWin, kbd->focus->win)) DoFocusEvents(dev, pWin, kbd->focus->win, focusEventMode); dev->focus->win = FollowKeyboardWin; dev->focus->traceGood = 0; } else { if (!ActivateFocusInGrab(dev, pWin, NoneWin)) DoFocusEvents(dev, pWin, NoneWin, focusEventMode); dev->focus->win = NoneWin; dev->focus->traceGood = 0; } } break; } } if (dev->valuator) if (dev->valuator->motionHintWindow == pWin) dev->valuator->motionHintWindow = NullWindow; } void DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources) { int i; DeviceIntPtr dev; InputClientsPtr ic; struct _OtherInputMasks *inputMasks; for (dev = inputInfo.devices; dev; dev = dev->next) { DeleteDeviceFromAnyExtEvents(pWin, dev); } for (dev = inputInfo.off_devices; dev; dev = dev->next) DeleteDeviceFromAnyExtEvents(pWin, dev); if (freeResources) while ((inputMasks = wOtherInputMasks(pWin)) != 0) { ic = inputMasks->inputClients; for (i = 0; i < EMASKSIZE; i++) inputMasks->dontPropagateMask[i] = 0; FreeResource(ic->resource, RT_NONE); } } int MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer *pEvents, Mask mask) { DeviceIntPtr dev; dixLookupDevice(&dev, pEvents->deviceid & DEVICE_BITS, serverClient, DixReadAccess); if (!dev) return 0; if (pEvents->type == DeviceMotionNotify) { if (mask & DevicePointerMotionHintMask) { if (WID(dev->valuator->motionHintWindow) == pEvents->event) { return 1; /* don't send, but pretend we did */ } pEvents->detail = NotifyHint; } else { pEvents->detail = NotifyNormal; } } return 0; } void CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type, deviceKeyButtonPointer *xE, GrabPtr grab, ClientPtr client, Mask deliveryMask) { DeviceIntPtr dev; dixLookupDevice(&dev, xE->deviceid & DEVICE_BITS, serverClient, DixGrabAccess); if (!dev) return; if (type == DeviceMotionNotify) dev->valuator->motionHintWindow = pWin; else if ((type == DeviceButtonPress) && (!grab) && (deliveryMask & DeviceButtonGrabMask)) { GrabPtr tempGrab; tempGrab = AllocGrab(NULL); if (!tempGrab) return; tempGrab->device = dev; tempGrab->resource = client->clientAsMask; tempGrab->window = pWin; tempGrab->ownerEvents = (deliveryMask & DeviceOwnerGrabButtonMask) ? TRUE : FALSE; tempGrab->eventMask = deliveryMask; tempGrab->keyboardMode = GrabModeAsync; tempGrab->pointerMode = GrabModeAsync; tempGrab->confineTo = NullWindow; tempGrab->cursor = NullCursor; tempGrab->next = NULL; (*dev->deviceGrab.ActivateGrab) (dev, tempGrab, currentTime, TRUE); FreeGrab(tempGrab); } } static Mask DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client) { InputClientsPtr other; if (!wOtherInputMasks(pWin)) return 0; for (other = wOtherInputMasks(pWin)->inputClients; other; other = other->next) { if (SameClient(other, client)) return other->mask[dev->id]; } return 0; } void MaybeStopDeviceHint(DeviceIntPtr dev, ClientPtr client) { WindowPtr pWin; GrabPtr grab = dev->deviceGrab.grab; pWin = dev->valuator->motionHintWindow; if ((grab && SameClient(grab, client) && ((grab->eventMask & DevicePointerMotionHintMask) || (grab->ownerEvents && (DeviceEventMaskForClient(dev, pWin, client) & DevicePointerMotionHintMask)))) || (!grab && (DeviceEventMaskForClient(dev, pWin, client) & DevicePointerMotionHintMask))) dev->valuator->motionHintWindow = NullWindow; } int DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask, int maskndx) { struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin); if (mask & ~PropagateMask[maskndx]) { client->errorValue = mask; return BadValue; } if (mask == 0) { if (inputMasks) inputMasks->dontPropagateMask[maskndx] = mask; } else { if (!inputMasks) AddExtensionClient(pWin, client, 0, 0); inputMasks = wOtherInputMasks(pWin); inputMasks->dontPropagateMask[maskndx] = mask; } RecalculateDeviceDeliverableEvents(pWin); if (ShouldFreeInputMasks(pWin, FALSE)) FreeResource(inputMasks->inputClients->resource, RT_NONE); return Success; } Bool ShouldFreeInputMasks(WindowPtr pWin, Bool ignoreSelectedEvents) { int i; Mask allInputEventMasks = 0; struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin); for (i = 0; i < EMASKSIZE; i++) allInputEventMasks |= inputMasks->dontPropagateMask[i]; if (!ignoreSelectedEvents) for (i = 0; i < EMASKSIZE; i++) allInputEventMasks |= inputMasks->inputEvents[i]; if (allInputEventMasks == 0) return TRUE; else return FALSE; } /*********************************************************************** * * Walk through the window tree, finding all clients that want to know * about the Event. * */ static void FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask, xEvent *ev, int count) { WindowPtr p2; while (p1) { p2 = p1->firstChild; DeliverEventsToWindow(dev, p1, ev, count, mask, NullGrab); FindInterestedChildren(dev, p2, mask, ev, count); p1 = p1->nextSib; } } /*********************************************************************** * * Send an event to interested clients in all windows on all screens. * */ void SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent *ev, int count) { int i; WindowPtr pWin, p1; for (i = 0; i < screenInfo.numScreens; i++) { pWin = screenInfo.screens[i]->root; if (!pWin) continue; DeliverEventsToWindow(dev, pWin, ev, count, mask, NullGrab); p1 = pWin->firstChild; FindInterestedChildren(dev, p1, mask, ev, count); } } /** * Set the XI2 mask for the given client on the given window. * @param dev The device to set the mask for. * @param win The window to set the mask on. * @param client The client setting the mask. * @param len Number of bytes in mask. * @param mask Event mask in the form of (1 << eventtype) */ int XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, unsigned int len, unsigned char *mask) { OtherInputMasks *masks; InputClientsPtr others = NULL; masks = wOtherInputMasks(win); if (masks) { for (others = wOtherInputMasks(win)->inputClients; others; others = others->next) { if (SameClient(others, client)) { xi2mask_zero(others->xi2mask, dev->id); break; } } } if (len && !others) { if (AddExtensionClient(win, client, 0, 0) != Success) return BadAlloc; others = wOtherInputMasks(win)->inputClients; } if (others) { xi2mask_zero(others->xi2mask, dev->id); len = min(len, xi2mask_mask_size(others->xi2mask)); } if (len) { xi2mask_set_one_mask(others->xi2mask, dev->id, mask, len); } RecalculateDeviceDeliverableEvents(win); return Success; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiproperty.c������������������������������������������������������������������0000664�0001751�0001751�00000110765�12456571574�014014� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2006 Keith Packard * Copyright © 2008 Peter Hutterer * * 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 WAXIANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WAXIANTIES 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. * */ /* This code is a modified version of randr/rrproperty.c */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "dix.h" #include "inputstr.h" #include <X11/extensions/XI.h> #include <X11/Xatom.h> #include <X11/extensions/XIproto.h> #include <X11/extensions/XI2proto.h> #include "exglobals.h" #include "exevents.h" #include "swaprep.h" #include "xiproperty.h" #include "xserver-properties.h" /** * Properties used or alloced from inside the server. */ 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_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; static void send_property_event(DeviceIntPtr dev, Atom property, int what) { 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 }; SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1); SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2), (xEvent *) &xi2, 1); } static int list_atoms(DeviceIntPtr dev, int *natoms, Atom **atoms_return) { XIPropertyPtr prop; Atom *atoms = NULL; int nprops = 0; for (prop = dev->properties.properties; prop; prop = prop->next) nprops++; if (nprops) { Atom *a; atoms = malloc(nprops * sizeof(Atom)); if (!atoms) return BadAlloc; a = atoms; for (prop = dev->properties.properties; prop; prop = prop->next, a++) *a = prop->propertyName; } *natoms = nprops; *atoms_return = atoms; return Success; } static int get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type, BOOL delete, int offset, int length, int *bytes_after, Atom *type_return, int *format, int *nitems, int *length_return, char **data) { unsigned long n, len, ind; int rc; XIPropertyPtr prop; XIPropertyValuePtr prop_value; if (!ValidAtom(property)) { client->errorValue = property; return BadAtom; } if ((delete != xTrue) && (delete != xFalse)) { client->errorValue = delete; return BadValue; } if ((type != AnyPropertyType) && !ValidAtom(type)) { client->errorValue = type; return BadAtom; } for (prop = dev->properties.properties; prop; prop = prop->next) if (prop->propertyName == property) break; if (!prop) { *bytes_after = 0; *type_return = None; *format = 0; *nitems = 0; *length_return = 0; return Success; } rc = XIGetDeviceProperty(dev, property, &prop_value); if (rc != Success) { client->errorValue = property; return rc; } /* If the request type and actual type don't match. Return the property information, but not the data. */ if (((type != prop_value->type) && (type != AnyPropertyType))) { *bytes_after = prop_value->size; *format = prop_value->format; *length_return = 0; *nitems = 0; *type_return = prop_value->type; return Success; } /* Return type, format, value to client */ n = (prop_value->format / 8) * prop_value->size; /* size (bytes) of prop */ ind = offset << 2; /* If offset is invalid such that it causes "len" to be negative, it's a value error. */ if (n < ind) { client->errorValue = offset; return BadValue; } len = min(n - ind, 4 * length); *bytes_after = n - (ind + len); *format = prop_value->format; *length_return = len; if (prop_value->format) *nitems = len / (prop_value->format / 8); else *nitems = 0; *type_return = prop_value->type; *data = (char *) prop_value->data + ind; return Success; } static int check_change_property(ClientPtr client, Atom property, Atom type, int format, int mode, int nitems) { if ((mode != PropModeReplace) && (mode != PropModeAppend) && (mode != PropModePrepend)) { client->errorValue = mode; return BadValue; } if ((format != 8) && (format != 16) && (format != 32)) { client->errorValue = format; return BadValue; } if (!ValidAtom(property)) { client->errorValue = property; return BadAtom; } if (!ValidAtom(type)) { client->errorValue = type; return BadAtom; } return Success; } static int change_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type, int format, int mode, int len, void *data) { int rc = Success; rc = XIChangeDeviceProperty(dev, property, type, format, mode, len, data, TRUE); if (rc != Success) client->errorValue = property; return rc; } /** * Return the atom assigned to the specified string or 0 if the atom isn't known * to the DIX. * * If name is NULL, None is returned. */ Atom XIGetKnownProperty(const char *name) { int i; if (!name) return None; for (i = 0; i < (sizeof(dev_properties) / sizeof(struct dev_properties)); i++) { if (strcmp(name, dev_properties[i].name) == 0) { if (dev_properties[i].type == None) { dev_properties[i].type = MakeAtom(dev_properties[i].name, strlen(dev_properties[i].name), TRUE); } return dev_properties[i].type; } } return 0; } void XIResetProperties(void) { int i; for (i = 0; i < (sizeof(dev_properties) / sizeof(struct dev_properties)); i++) dev_properties[i].type = None; } /** * Convert the given property's value(s) into @nelem_return integer values and * store them in @buf_return. If @nelem_return is larger than the number of * values in the property, @nelem_return is set to the number of values in the * property. * * If *@buf_return is NULL and @nelem_return is 0, memory is allocated * automatically and must be freed by the caller. * * Possible return codes. * Success ... No error. * BadMatch ... Wrong atom type, atom is not XA_INTEGER * BadAlloc ... NULL passed as buffer and allocation failed. * BadLength ... @buff is NULL but @nelem_return is non-zero. * * @param val The property value * @param nelem_return The maximum number of elements to return. * @param buf_return Pointer to an array of at least @nelem_return values. * @return Success or the error code if an error occured. */ _X_EXPORT int XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return) { int i; int *buf; if (val->type != XA_INTEGER) return BadMatch; if (!*buf_return && *nelem_return) return BadLength; switch (val->format) { case 8: case 16: case 32: break; default: return BadValue; } buf = *buf_return; if (!buf && !(*nelem_return)) { buf = calloc(val->size, sizeof(int)); if (!buf) return BadAlloc; *buf_return = buf; *nelem_return = val->size; } else if (val->size < *nelem_return) *nelem_return = val->size; for (i = 0; i < val->size && i < *nelem_return; i++) { switch (val->format) { case 8: buf[i] = ((CARD8 *) val->data)[i]; break; case 16: buf[i] = ((CARD16 *) val->data)[i]; break; case 32: buf[i] = ((CARD32 *) val->data)[i]; break; } } return Success; } /** * Convert the given property's value(s) into @nelem_return float values and * store them in @buf_return. If @nelem_return is larger than the number of * values in the property, @nelem_return is set to the number of values in the * property. * * If *@buf_return is NULL and @nelem_return is 0, memory is allocated * automatically and must be freed by the caller. * * Possible errors returned: * Success * BadMatch ... Wrong atom type, atom is not XA_FLOAT * BadValue ... Wrong format, format is not 32 * BadAlloc ... NULL passed as buffer and allocation failed. * BadLength ... @buff is NULL but @nelem_return is non-zero. * * @param val The property value * @param nelem_return The maximum number of elements to return. * @param buf_return Pointer to an array of at least @nelem_return values. * @return Success or the error code if an error occured. */ _X_EXPORT int XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return) { int i; float *buf; if (!val->type || val->type != XIGetKnownProperty(XATOM_FLOAT)) return BadMatch; if (val->format != 32) return BadValue; if (!*buf_return && *nelem_return) return BadLength; buf = *buf_return; if (!buf && !(*nelem_return)) { buf = calloc(val->size, sizeof(float)); if (!buf) return BadAlloc; *buf_return = buf; *nelem_return = val->size; } else if (val->size < *nelem_return) *nelem_return = val->size; for (i = 0; i < val->size && i < *nelem_return; i++) buf[i] = ((float *) val->data)[i]; return Success; } /* Registers a new property handler on the given device and returns a unique * identifier for this handler. This identifier is required to unregister the * property handler again. * @return The handler's identifier or 0 if an error occured. */ long XIRegisterPropertyHandler(DeviceIntPtr dev, int (*SetProperty) (DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, BOOL checkonly), int (*GetProperty) (DeviceIntPtr dev, Atom property), int (*DeleteProperty) (DeviceIntPtr dev, Atom property)) { XIPropertyHandlerPtr new_handler; new_handler = calloc(1, sizeof(XIPropertyHandler)); if (!new_handler) return 0; new_handler->id = XIPropHandlerID++; new_handler->SetProperty = SetProperty; new_handler->GetProperty = GetProperty; new_handler->DeleteProperty = DeleteProperty; new_handler->next = dev->properties.handlers; dev->properties.handlers = new_handler; return new_handler->id; } void XIUnregisterPropertyHandler(DeviceIntPtr dev, long id) { XIPropertyHandlerPtr curr, prev = NULL; curr = dev->properties.handlers; while (curr && curr->id != id) { prev = curr; curr = curr->next; } if (!curr) return; if (!prev) /* first one */ dev->properties.handlers = curr->next; else prev->next = curr->next; free(curr); } static XIPropertyPtr XICreateDeviceProperty(Atom property) { XIPropertyPtr prop; prop = (XIPropertyPtr) malloc(sizeof(XIPropertyRec)); if (!prop) return NULL; prop->next = NULL; prop->propertyName = property; prop->value.type = None; prop->value.format = 0; prop->value.size = 0; prop->value.data = NULL; prop->deletable = TRUE; return prop; } static XIPropertyPtr XIFetchDeviceProperty(DeviceIntPtr dev, Atom property) { XIPropertyPtr prop; for (prop = dev->properties.properties; prop; prop = prop->next) if (prop->propertyName == property) return prop; return NULL; } static void XIDestroyDeviceProperty(XIPropertyPtr prop) { free(prop->value.data); free(prop); } /* This function destroys all of the device's property-related stuff, * including removing all device handlers. * DO NOT CALL FROM THE DRIVER. */ void XIDeleteAllDeviceProperties(DeviceIntPtr device) { XIPropertyPtr prop, next; XIPropertyHandlerPtr curr_handler, next_handler; for (prop = device->properties.properties; prop; prop = next) { next = prop->next; send_property_event(device, prop->propertyName, XIPropertyDeleted); XIDestroyDeviceProperty(prop); } device->properties.properties = NULL; /* Now free all handlers */ curr_handler = device->properties.handlers; while (curr_handler) { next_handler = curr_handler->next; free(curr_handler); curr_handler = next_handler; } device->properties.handlers = NULL; } int XIDeleteDeviceProperty(DeviceIntPtr device, Atom property, Bool fromClient) { XIPropertyPtr prop, *prev; int rc = Success; for (prev = &device->properties.properties; (prop = *prev); prev = &(prop->next)) if (prop->propertyName == property) break; if (!prop) return Success; if (fromClient && !prop->deletable) return BadAccess; /* Ask handlers if we may delete the property */ if (device->properties.handlers) { XIPropertyHandlerPtr handler = device->properties.handlers; while (handler) { if (handler->DeleteProperty) rc = handler->DeleteProperty(device, prop->propertyName); if (rc != Success) return rc; handler = handler->next; } } if (prop) { *prev = prop->next; send_property_event(device, prop->propertyName, XIPropertyDeleted); XIDestroyDeviceProperty(prop); } return Success; } int XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, int format, int mode, unsigned long len, const void *value, Bool sendevent) { XIPropertyPtr prop; int size_in_bytes; int total_size; unsigned long total_len; XIPropertyValuePtr prop_value; XIPropertyValueRec new_value; Bool add = FALSE; int rc; size_in_bytes = format >> 3; /* first see if property already exists */ prop = XIFetchDeviceProperty(dev, property); if (!prop) { /* just add to list */ prop = XICreateDeviceProperty(property); if (!prop) return BadAlloc; add = TRUE; mode = PropModeReplace; } prop_value = &prop->value; /* 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) { void *new_data = NULL, *old_data = NULL; total_size = total_len * size_in_bytes; new_value.data = (void *) malloc(total_size); if (!new_value.data && total_size) { if (add) XIDestroyDeviceProperty(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 = (void *) (((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 = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); break; } if (new_data) 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); if (dev->properties.handlers) { XIPropertyHandlerPtr handler; BOOL checkonly = TRUE; /* run through all handlers with checkonly TRUE, then again with * checkonly FALSE. Handlers MUST return error codes on the * checkonly run, errors on the second run are ignored */ do { handler = dev->properties.handlers; while (handler) { if (handler->SetProperty) { rc = handler->SetProperty(dev, prop->propertyName, &new_value, checkonly); if (checkonly && rc != Success) { free(new_value.data); if (add) XIDestroyDeviceProperty(prop); return rc; } } handler = handler->next; } checkonly = !checkonly; } while (!checkonly); } free(prop_value->data); *prop_value = new_value; } else if (len == 0) { /* do nothing */ } if (add) { prop->next = dev->properties.properties; dev->properties.properties = prop; } if (sendevent) send_property_event(dev, prop->propertyName, (add) ? XIPropertyCreated : XIPropertyModified); return Success; } int XIGetDeviceProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value) { XIPropertyPtr prop = XIFetchDeviceProperty(dev, property); int rc; if (!prop) { *value = NULL; return BadAtom; } /* If we can, try to update the property value first */ if (dev->properties.handlers) { XIPropertyHandlerPtr handler = dev->properties.handlers; while (handler) { if (handler->GetProperty) { rc = handler->GetProperty(dev, prop->propertyName); if (rc != Success) { *value = NULL; return rc; } } handler = handler->next; } } *value = &prop->value; return Success; } int XISetDevicePropertyDeletable(DeviceIntPtr dev, Atom property, Bool deletable) { XIPropertyPtr prop = XIFetchDeviceProperty(dev, property); if (!prop) return BadAtom; prop->deletable = deletable; return Success; } int ProcXListDeviceProperties(ClientPtr client) { Atom *atoms; xListDevicePropertiesReply rep; int natoms; DeviceIntPtr dev; int rc = Success; REQUEST(xListDevicePropertiesReq); REQUEST_SIZE_MATCH(xListDevicePropertiesReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess); if (rc != Success) return rc; rc = list_atoms(dev, &natoms, &atoms); if (rc != Success) return rc; rep = (xListDevicePropertiesReply) { .repType = X_Reply, .RepType = X_ListDeviceProperties, .sequenceNumber = client->sequence, .length = natoms, .nAtoms = natoms }; WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep); if (natoms) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms); free(atoms); } return rc; } int ProcXChangeDeviceProperty(ClientPtr client) { REQUEST(xChangeDevicePropertyReq); DeviceIntPtr dev; unsigned long len; int totalSize; int rc; REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); if (rc != Success) return rc; rc = check_change_property(client, stuff->property, stuff->type, stuff->format, stuff->mode, stuff->nUnits); len = stuff->nUnits; if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq)))) return BadLength; totalSize = len * (stuff->format / 8); REQUEST_FIXED_SIZE(xChangeDevicePropertyReq, totalSize); rc = change_property(client, dev, stuff->property, stuff->type, stuff->format, stuff->mode, len, (void *) &stuff[1]); return rc; } int ProcXDeleteDeviceProperty(ClientPtr client) { REQUEST(xDeleteDevicePropertyReq); DeviceIntPtr dev; int rc; REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); if (rc != Success) return rc; if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; return BadAtom; } rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE); return rc; } int ProcXGetDeviceProperty(ClientPtr client) { REQUEST(xGetDevicePropertyReq); DeviceIntPtr dev; int length; int rc, format, nitems, bytes_after; char *data; Atom type; xGetDevicePropertyReply reply; REQUEST_SIZE_MATCH(xGetDevicePropertyReq); if (stuff->delete) UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, stuff->delete ? DixSetPropAccess : DixGetPropAccess); if (rc != Success) return rc; rc = get_property(client, dev, stuff->property, stuff->type, stuff->delete, stuff->longOffset, stuff->longLength, &bytes_after, &type, &format, &nitems, &length, &data); if (rc != Success) return rc; 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); WriteReplyToClient(client, sizeof(xGenericReply), &reply); if (length) { 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, length, data); } /* delete the Property */ if (stuff->delete && (reply.bytesAfter == 0)) { XIPropertyPtr prop, *prev; for (prev = &dev->properties.properties; (prop = *prev); prev = &prop->next) { if (prop->propertyName == stuff->property) { *prev = prop->next; XIDestroyDeviceProperty(prop); break; } } } return Success; } int SProcXListDeviceProperties(ClientPtr client) { REQUEST(xListDevicePropertiesReq); REQUEST_SIZE_MATCH(xListDevicePropertiesReq); swaps(&stuff->length); return (ProcXListDeviceProperties(client)); } int SProcXChangeDeviceProperty(ClientPtr client) { REQUEST(xChangeDevicePropertyReq); REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); swaps(&stuff->length); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->nUnits); return (ProcXChangeDeviceProperty(client)); } int SProcXDeleteDeviceProperty(ClientPtr client) { REQUEST(xDeleteDevicePropertyReq); REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); swaps(&stuff->length); swapl(&stuff->property); return (ProcXDeleteDeviceProperty(client)); } int SProcXGetDeviceProperty(ClientPtr client) { REQUEST(xGetDevicePropertyReq); REQUEST_SIZE_MATCH(xGetDevicePropertyReq); swaps(&stuff->length); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->longOffset); swapl(&stuff->longLength); return (ProcXGetDeviceProperty(client)); } /* Reply swapping */ void SRepXListDeviceProperties(ClientPtr client, int size, xListDevicePropertiesReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->nAtoms); /* properties will be swapped later, see ProcXListDeviceProperties */ WriteToClient(client, size, rep); } void SRepXGetDeviceProperty(ClientPtr client, int size, xGetDevicePropertyReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->propertyType); swapl(&rep->bytesAfter); swapl(&rep->nItems); /* data will be swapped, see ProcXGetDeviceProperty */ WriteToClient(client, size, rep); } /* XI2 Request/reply handling */ int ProcXIListProperties(ClientPtr client) { Atom *atoms; xXIListPropertiesReply rep; int natoms; DeviceIntPtr dev; int rc = Success; REQUEST(xXIListPropertiesReq); REQUEST_SIZE_MATCH(xXIListPropertiesReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess); if (rc != Success) return rc; rc = list_atoms(dev, &natoms, &atoms); if (rc != Success) return rc; rep = (xXIListPropertiesReply) { .repType = X_Reply, .RepType = X_XIListProperties, .sequenceNumber = client->sequence, .length = natoms, .num_properties = natoms }; WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep); if (natoms) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms); free(atoms); } return rc; } int ProcXIChangeProperty(ClientPtr client) { int rc; DeviceIntPtr dev; int totalSize; unsigned long len; REQUEST(xXIChangePropertyReq); REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); if (rc != Success) return rc; rc = check_change_property(client, stuff->property, stuff->type, stuff->format, stuff->mode, stuff->num_items); len = stuff->num_items; if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq))) return BadLength; totalSize = len * (stuff->format / 8); REQUEST_FIXED_SIZE(xXIChangePropertyReq, totalSize); rc = change_property(client, dev, stuff->property, stuff->type, stuff->format, stuff->mode, len, (void *) &stuff[1]); return rc; } int ProcXIDeleteProperty(ClientPtr client) { DeviceIntPtr dev; int rc; REQUEST(xXIDeletePropertyReq); REQUEST_SIZE_MATCH(xXIDeletePropertyReq); UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess); if (rc != Success) return rc; if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; return BadAtom; } rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE); return rc; } int ProcXIGetProperty(ClientPtr client) { REQUEST(xXIGetPropertyReq); DeviceIntPtr dev; xXIGetPropertyReply reply; int length; int rc, format, nitems, bytes_after; char *data; Atom type; REQUEST_SIZE_MATCH(xXIGetPropertyReq); if (stuff->delete) UpdateCurrentTime(); rc = dixLookupDevice(&dev, stuff->deviceid, client, stuff->delete ? DixSetPropAccess : DixGetPropAccess); if (rc != Success) return rc; rc = get_property(client, dev, stuff->property, stuff->type, stuff->delete, stuff->offset, stuff->len, &bytes_after, &type, &format, &nitems, &length, &data); if (rc != Success) return rc; 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); WriteReplyToClient(client, sizeof(xXIGetPropertyReply), &reply); if (length) { 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, length, data); } /* delete the Property */ if (stuff->delete && (reply.bytes_after == 0)) { XIPropertyPtr prop, *prev; for (prev = &dev->properties.properties; (prop = *prev); prev = &prop->next) { if (prop->propertyName == stuff->property) { *prev = prop->next; XIDestroyDeviceProperty(prop); break; } } } return Success; } int SProcXIListProperties(ClientPtr client) { REQUEST(xXIListPropertiesReq); REQUEST_SIZE_MATCH(xXIListPropertiesReq); swaps(&stuff->length); swaps(&stuff->deviceid); return (ProcXIListProperties(client)); } int SProcXIChangeProperty(ClientPtr client) { REQUEST(xXIChangePropertyReq); REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->num_items); return (ProcXIChangeProperty(client)); } int SProcXIDeleteProperty(ClientPtr client) { REQUEST(xXIDeletePropertyReq); REQUEST_SIZE_MATCH(xXIDeletePropertyReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->property); return (ProcXIDeleteProperty(client)); } int SProcXIGetProperty(ClientPtr client) { REQUEST(xXIGetPropertyReq); REQUEST_SIZE_MATCH(xXIGetPropertyReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->offset); swapl(&stuff->len); return (ProcXIGetProperty(client)); } void SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_properties); /* properties will be swapped later, see ProcXIListProperties */ WriteToClient(client, size, rep); } void SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->type); swapl(&rep->bytes_after); swapl(&rep->num_items); /* data will be swapped, see ProcXIGetProperty */ WriteToClient(client, size, rep); } �����������xorg-server-1.17.1/Xi/allowev.c���������������������������������������������������������������������0000664�0001751�0001751�00000010232�12274325511�013206� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Function to allow frozen events to be routed from extension input devices. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "allowev.h" #include "dixevents.h" /*********************************************************************** * * This procedure allows frozen events to be routed. * */ int SProcXAllowDeviceEvents(ClientPtr client) { REQUEST(xAllowDeviceEventsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); swapl(&stuff->time); return (ProcXAllowDeviceEvents(client)); } /*********************************************************************** * * This procedure allows frozen events to be routed. * */ int ProcXAllowDeviceEvents(ClientPtr client) { TimeStamp time; DeviceIntPtr thisdev; int rc; REQUEST(xAllowDeviceEventsReq); REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) return rc; time = ClientTimeToServerTime(stuff->time); switch (stuff->mode) { case ReplayThisDevice: AllowSome(client, time, thisdev, NOT_GRABBED); break; case SyncThisDevice: AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT); break; case AsyncThisDevice: AllowSome(client, time, thisdev, THAWED); break; case AsyncOtherDevices: AllowSome(client, time, thisdev, THAW_OTHERS); break; case SyncAll: AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT); break; case AsyncAll: AllowSome(client, time, thisdev, THAWED_BOTH); break; default: client->errorValue = stuff->mode; return BadValue; } return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/opendev.h���������������������������������������������������������������������0000664�0001751�0001751�00000003065�12274325511�013210� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef OPENDEV_H #define OPENDEV_H 1 int SProcXOpenDevice(ClientPtr /* client */ ); int ProcXOpenDevice(ClientPtr /* client */ ); void SRepXOpenDevice(ClientPtr /* client */ , int /* size */ , xOpenDeviceReply * /* rep */ ); #endif /* OPENDEV_H */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/grabdevb.h��������������������������������������������������������������������0000664�0001751�0001751�00000002672�12274325511�013327� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GRABDEVB_H #define GRABDEVB_H 1 int SProcXGrabDeviceButton(ClientPtr /* client */ ); int ProcXGrabDeviceButton(ClientPtr /* client */ ); #endif /* GRABDEVB_H */ ����������������������������������������������������������������������xorg-server-1.17.1/Xi/ungrdev.h���������������������������������������������������������������������0000664�0001751�0001751�00000002657�12274325511�013230� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef UNGRDEV_H #define UNGRDEV_H 1 int SProcXUngrabDevice(ClientPtr /* client */ ); int ProcXUngrabDevice(ClientPtr /* client */ ); #endif /* UNGRDEV_H */ ���������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgptr.c����������������������������������������������������������������������0000664�0001751�0001751�00000006704�12274325511�013035� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to change the pointer device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ #include "dixevents.h" #include "exevents.h" #include "exglobals.h" #include "chgptr.h" /*********************************************************************** * * This procedure is invoked to swap the request bytes if the server and * client have a different byte order. * */ int SProcXChangePointerDevice(ClientPtr client) { REQUEST(xChangePointerDeviceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangePointerDeviceReq); return (ProcXChangePointerDevice(client)); } /*********************************************************************** * * This procedure changes the device used as the X pointer. * */ int ProcXChangePointerDevice(ClientPtr client) { /* REQUEST(xChangePointerDeviceReq); */ REQUEST_SIZE_MATCH(xChangePointerDeviceReq); return BadDevice; } ������������������������������������������������������������xorg-server-1.17.1/Xi/setmmap.c���������������������������������������������������������������������0000664�0001751�0001751�00000011364�12274325511�013212� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Set modifier mapping for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "setmmap.h" /*********************************************************************** * * This procedure sets the modifier mapping for an extension device, * for clients on machines with a different byte ordering than the server. * */ int SProcXSetDeviceModifierMapping(ClientPtr client) { REQUEST(xSetDeviceModifierMappingReq); swaps(&stuff->length); return (ProcXSetDeviceModifierMapping(client)); } /*********************************************************************** * * Set the device Modifier mapping. * */ int ProcXSetDeviceModifierMapping(ClientPtr client) { int ret; xSetDeviceModifierMappingReply rep; DeviceIntPtr dev; REQUEST(xSetDeviceModifierMappingReq); REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq); if (stuff->length != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) + (stuff->numKeyPerModifier << 1)) return BadLength; rep = (xSetDeviceModifierMappingReply) { .repType = X_Reply, .RepType = X_SetDeviceModifierMapping, .sequenceNumber = client->sequence, .length = 0 }; ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) return ret; ret = change_modmap(client, dev, (KeyCode *) &stuff[1], stuff->numKeyPerModifier); if (ret == Success) ret = MappingSuccess; if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) { rep.success = ret; WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply), &rep); } else if (ret == -1) { return BadValue; } else { return ret; } return Success; } /*********************************************************************** * * This procedure writes the reply for the XSetDeviceModifierMapping function, * if the client and server have a different byte ordering. * */ void SRepXSetDeviceModifierMapping(ClientPtr client, int size, xSetDeviceModifierMappingReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiquerydevice.c���������������������������������������������������������������0000664�0001751�0001751�00000036325�12456571574�014454� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Authors: Peter Hutterer * */ /** * @file Protocol handling for the XIQueryDevice request/reply. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" #include <X11/X.h> #include <X11/Xatom.h> #include <X11/extensions/XI2proto.h> #include "xkbstr.h" #include "xkbsrv.h" #include "xserver-properties.h" #include "exevents.h" #include "xace.h" #include "inpututils.h" #include "xiquerydevice.h" static Bool ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr d); static int ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info); static int SizeDeviceInfo(DeviceIntPtr dev); static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info); int SProcXIQueryDevice(ClientPtr client) { REQUEST(xXIQueryDeviceReq); REQUEST_SIZE_MATCH(xXIQueryDeviceReq); swaps(&stuff->length); swaps(&stuff->deviceid); return ProcXIQueryDevice(client); } int ProcXIQueryDevice(ClientPtr client) { xXIQueryDeviceReply rep; DeviceIntPtr dev = NULL; int rc = Success; int i = 0, len = 0; char *info, *ptr; Bool *skip = NULL; REQUEST(xXIQueryDeviceReq); REQUEST_SIZE_MATCH(xXIQueryDeviceReq); if (stuff->deviceid != XIAllDevices && stuff->deviceid != XIAllMasterDevices) { rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->deviceid; return rc; } len += SizeDeviceInfo(dev); } else { skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) return BadAlloc; for (dev = inputInfo.devices; dev; dev = dev->next, i++) { skip[i] = ShouldSkipDevice(client, stuff->deviceid, dev); if (!skip[i]) len += SizeDeviceInfo(dev); } for (dev = inputInfo.off_devices; dev; dev = dev->next, i++) { skip[i] = ShouldSkipDevice(client, stuff->deviceid, dev); if (!skip[i]) len += SizeDeviceInfo(dev); } } info = calloc(1, len); if (!info) { free(skip); return BadAlloc; } rep = (xXIQueryDeviceReply) { .repType = X_Reply, .RepType = X_XIQueryDevice, .sequenceNumber = client->sequence, .length = len / 4, .num_devices = 0 }; ptr = info; if (dev) { len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info); if (client->swapped) SwapDeviceInfo(dev, (xXIDeviceInfo *) info); info += len; rep.num_devices = 1; } else { i = 0; for (dev = inputInfo.devices; dev; dev = dev->next, i++) { if (!skip[i]) { len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info); if (client->swapped) SwapDeviceInfo(dev, (xXIDeviceInfo *) info); info += len; rep.num_devices++; } } for (dev = inputInfo.off_devices; dev; dev = dev->next, i++) { if (!skip[i]) { len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info); if (client->swapped) SwapDeviceInfo(dev, (xXIDeviceInfo *) info); info += len; rep.num_devices++; } } } len = rep.length * 4; WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); WriteToClient(client, len, ptr); free(ptr); free(skip); return rc; } void SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_devices); /* Device info is already swapped, see ProcXIQueryDevice */ WriteToClient(client, size, rep); } /** * @return Whether the device should be included in the returned list. */ static Bool ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr dev) { /* if all devices are not being queried, only master devices are */ if (deviceid == XIAllDevices || IsMaster(dev)) { int rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess); if (rc == Success) return FALSE; } return TRUE; } /** * @return The number of bytes needed to store this device's xXIDeviceInfo * (and its classes). */ static int SizeDeviceInfo(DeviceIntPtr dev) { int len = sizeof(xXIDeviceInfo); /* 4-padded name */ len += pad_to_int32(strlen(dev->name)); return len + SizeDeviceClasses(dev); } /* * @return The number of bytes needed to store this device's classes. */ int SizeDeviceClasses(DeviceIntPtr dev) { int len = 0; if (dev->button) { len += sizeof(xXIButtonInfo); len += dev->button->numButtons * sizeof(Atom); len += pad_to_int32(bits_to_bytes(dev->button->numButtons)); } if (dev->key) { XkbDescPtr xkb = dev->key->xkbInfo->desc; len += sizeof(xXIKeyInfo); len += (xkb->max_key_code - xkb->min_key_code + 1) * sizeof(uint32_t); } if (dev->valuator) { int i; len += (sizeof(xXIValuatorInfo)) * dev->valuator->numAxes; for (i = 0; i < dev->valuator->numAxes; i++) { if (dev->valuator->axes[i].scroll.type != SCROLL_TYPE_NONE) len += sizeof(xXIScrollInfo); } } if (dev->touch) len += sizeof(xXITouchInfo); return len; } /** * Write button information into info. * @return Number of bytes written into info. */ int ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info, Bool reportState) { unsigned char *bits; int mask_len; int i; if (!dev || !dev->button) return 0; mask_len = bytes_to_int32(bits_to_bytes(dev->button->numButtons)); info->type = ButtonClass; info->num_buttons = dev->button->numButtons; info->length = bytes_to_int32(sizeof(xXIButtonInfo)) + info->num_buttons + mask_len; info->sourceid = dev->button->sourceid; bits = (unsigned char *) &info[1]; memset(bits, 0, mask_len * 4); if (reportState) for (i = 0; i < dev->button->numButtons; i++) if (BitIsOn(dev->button->down, i)) SetBit(bits, i); bits += mask_len * 4; memcpy(bits, dev->button->labels, dev->button->numButtons * sizeof(Atom)); return info->length * 4; } static void SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info) { Atom *btn; int i; swaps(&info->type); swaps(&info->length); swaps(&info->sourceid); for (i = 0, btn = (Atom *) &info[1]; i < info->num_buttons; i++, btn++) swapl(btn); swaps(&info->num_buttons); } /** * Write key information into info. * @return Number of bytes written into info. */ int ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo * info) { int i; XkbDescPtr xkb = dev->key->xkbInfo->desc; uint32_t *kc; info->type = KeyClass; info->num_keycodes = xkb->max_key_code - xkb->min_key_code + 1; info->length = sizeof(xXIKeyInfo) / 4 + info->num_keycodes; info->sourceid = dev->key->sourceid; kc = (uint32_t *) &info[1]; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++, kc++) *kc = i; return info->length * 4; } static void SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo * info) { uint32_t *key; int i; swaps(&info->type); swaps(&info->length); swaps(&info->sourceid); for (i = 0, key = (uint32_t *) &info[1]; i < info->num_keycodes; i++, key++) swapl(key); swaps(&info->num_keycodes); } /** * List axis information for the given axis. * * @return The number of bytes written into info. */ int ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo * info, int axisnumber, Bool reportState) { ValuatorClassPtr v = dev->valuator; info->type = ValuatorClass; info->length = sizeof(xXIValuatorInfo) / 4; info->label = v->axes[axisnumber].label; info->min.integral = v->axes[axisnumber].min_value; info->min.frac = 0; info->max.integral = v->axes[axisnumber].max_value; info->max.frac = 0; info->value = double_to_fp3232(v->axisVal[axisnumber]); info->resolution = v->axes[axisnumber].resolution; info->number = axisnumber; info->mode = valuator_get_mode(dev, axisnumber); info->sourceid = v->sourceid; if (!reportState) info->value = info->min; return info->length * 4; } static void SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo * info) { swaps(&info->type); swaps(&info->length); swapl(&info->label); swapl(&info->min.integral); swapl(&info->min.frac); swapl(&info->max.integral); swapl(&info->max.frac); swaps(&info->number); swaps(&info->sourceid); } int ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo * info, int axisnumber) { ValuatorClassPtr v = dev->valuator; AxisInfoPtr axis = &v->axes[axisnumber]; if (axis->scroll.type == SCROLL_TYPE_NONE) return 0; info->type = XIScrollClass; info->length = sizeof(xXIScrollInfo) / 4; info->number = axisnumber; switch (axis->scroll.type) { case SCROLL_TYPE_VERTICAL: info->scroll_type = XIScrollTypeVertical; break; case SCROLL_TYPE_HORIZONTAL: info->scroll_type = XIScrollTypeHorizontal; break; default: ErrorF("[Xi] Unknown scroll type %d. This is a bug.\n", axis->scroll.type); break; } info->increment = double_to_fp3232(axis->scroll.increment); info->sourceid = v->sourceid; info->flags = 0; if (axis->scroll.flags & SCROLL_FLAG_DONT_EMULATE) info->flags |= XIScrollFlagNoEmulation; if (axis->scroll.flags & SCROLL_FLAG_PREFERRED) info->flags |= XIScrollFlagPreferred; return info->length * 4; } static void SwapScrollInfo(DeviceIntPtr dev, xXIScrollInfo * info) { swaps(&info->type); swaps(&info->length); swaps(&info->number); swaps(&info->sourceid); swaps(&info->scroll_type); swapl(&info->increment.integral); swapl(&info->increment.frac); } /** * List multitouch information * * @return The number of bytes written into info. */ int ListTouchInfo(DeviceIntPtr dev, xXITouchInfo * touch) { touch->type = XITouchClass; touch->length = sizeof(xXITouchInfo) >> 2; touch->sourceid = dev->touch->sourceid; touch->mode = dev->touch->mode; touch->num_touches = dev->touch->num_touches; return touch->length << 2; } static void SwapTouchInfo(DeviceIntPtr dev, xXITouchInfo * touch) { swaps(&touch->type); swaps(&touch->length); swaps(&touch->sourceid); } int GetDeviceUse(DeviceIntPtr dev, uint16_t * attachment) { DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED); int use; if (IsMaster(dev)) { DeviceIntPtr paired = GetPairedDevice(dev); use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard; *attachment = (paired ? paired->id : 0); } else if (!IsFloating(dev)) { use = IsPointerDevice(master) ? XISlavePointer : XISlaveKeyboard; *attachment = master->id; } else use = XIFloatingSlave; return use; } /** * Write the info for device dev into the buffer pointed to by info. * * @return The number of bytes used. */ static int ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info) { char *any = (char *) &info[1]; int len = 0, total_len = 0; info->deviceid = dev->id; info->use = GetDeviceUse(dev, &info->attachment); info->num_classes = 0; info->name_len = strlen(dev->name); info->enabled = dev->enabled; total_len = sizeof(xXIDeviceInfo); len = pad_to_int32(info->name_len); memset(any, 0, len); strncpy(any, dev->name, info->name_len); any += len; total_len += len; total_len += ListDeviceClasses(client, dev, any, &info->num_classes); return total_len; } /** * Write the class info of the device into the memory pointed to by any, set * nclasses to the number of classes in total and return the number of bytes * written. */ int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev, char *any, uint16_t * nclasses) { int total_len = 0; int len; int i; int rc; /* Check if the current device state should be suppressed */ rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess); if (dev->button) { (*nclasses)++; len = ListButtonInfo(dev, (xXIButtonInfo *) any, rc == Success); any += len; total_len += len; } if (dev->key) { (*nclasses)++; len = ListKeyInfo(dev, (xXIKeyInfo *) any); any += len; total_len += len; } for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++) { (*nclasses)++; len = ListValuatorInfo(dev, (xXIValuatorInfo *) any, i, rc == Success); any += len; total_len += len; } for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++) { len = ListScrollInfo(dev, (xXIScrollInfo *) any, i); if (len) (*nclasses)++; any += len; total_len += len; } if (dev->touch) { (*nclasses)++; len = ListTouchInfo(dev, (xXITouchInfo *) any); any += len; total_len += len; } return total_len; } static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info) { char *any = (char *) &info[1]; int i; /* Skip over name */ any += pad_to_int32(info->name_len); for (i = 0; i < info->num_classes; i++) { int len = ((xXIAnyInfo *) any)->length; switch (((xXIAnyInfo *) any)->type) { case XIButtonClass: SwapButtonInfo(dev, (xXIButtonInfo *) any); break; case XIKeyClass: SwapKeyInfo(dev, (xXIKeyInfo *) any); break; case XIValuatorClass: SwapValuatorInfo(dev, (xXIValuatorInfo *) any); break; case XIScrollClass: SwapScrollInfo(dev, (xXIScrollInfo *) any); break; case XITouchClass: SwapTouchInfo(dev, (xXITouchInfo *) any); break; } any += len * 4; } swaps(&info->deviceid); swaps(&info->use); swaps(&info->attachment); swaps(&info->num_classes); swaps(&info->name_len); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getprop.c���������������������������������������������������������������������0000664�0001751�0001751�00000013771�12274325511�013230� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Function to return the dont-propagate-list for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structs */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "swaprep.h" #include "getprop.h" extern XExtEventInfo EventInfo[]; extern int ExtEventIndex; /*********************************************************************** * * Handle a request from a client with a different byte order. * */ int SProcXGetDeviceDontPropagateList(ClientPtr client) { REQUEST(xGetDeviceDontPropagateListReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); swapl(&stuff->window); return (ProcXGetDeviceDontPropagateList(client)); } /*********************************************************************** * * This procedure lists the input devices available to the server. * */ int ProcXGetDeviceDontPropagateList(ClientPtr client) { CARD16 count = 0; int i, rc; XEventClass *buf = NULL, *tbuf; WindowPtr pWin; xGetDeviceDontPropagateListReply rep; OtherInputMasks *others; REQUEST(xGetDeviceDontPropagateListReq); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); 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) return rc; if ((others = wOtherInputMasks(pWin)) != 0) { for (i = 0; i < EMASKSIZE; i++) ClassFromMask(NULL, others->dontPropagateMask[i], i, &count, COUNT); if (count) { rep.count = count; buf = (XEventClass *) malloc(rep.count * sizeof(XEventClass)); rep.length = bytes_to_int32(rep.count * sizeof(XEventClass)); tbuf = buf; for (i = 0; i < EMASKSIZE; i++) tbuf = ClassFromMask(tbuf, others->dontPropagateMask[i], i, NULL, CREATE); } } WriteReplyToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep); if (count) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf); free(buf); } return Success; } /*********************************************************************** * * This procedure gets a list of event classes from a mask word. * A single mask may translate to more than one event class. * */ XEventClass * ClassFromMask(XEventClass * buf, Mask mask, int maskndx, CARD16 *count, int mode) { int i, j; int id = maskndx; Mask tmask = 0x80000000; for (i = 0; i < 32; i++, tmask >>= 1) if (tmask & mask) { for (j = 0; j < ExtEventIndex; j++) if (EventInfo[j].mask == tmask) { if (mode == COUNT) (*count)++; else *buf++ = (id << 8) | EventInfo[j].type; } } return buf; } /*********************************************************************** * * This procedure writes the reply for the XGetDeviceDontPropagateList function, * if the client and server have a different byte ordering. * */ void SRepXGetDeviceDontPropagateList(ClientPtr client, int size, xGetDeviceDontPropagateListReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->count); WriteToClient(client, size, rep); } �������xorg-server-1.17.1/Xi/xiqueryversion.h��������������������������������������������������������������0000664�0001751�0001751�00000003016�12274325511�014660� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Authors: Peter Hutterer * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/extensions/XI2proto.h> #ifndef QUERYVERSION_H #define QUERYVERSION_H 1 int SProcXIQueryVersion(ClientPtr client); int ProcXIQueryVersion(ClientPtr client); void SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep); #endif /* QUERYVERSION_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgfctl.h���������������������������������������������������������������������0000664�0001751�0001751�00000002707�12274325511�013164� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHGFCTL_H #define CHGFCTL_H 1 int SProcXChangeFeedbackControl(ClientPtr /* client */ ); int ProcXChangeFeedbackControl(ClientPtr /* client */ ); #endif /* CHGFCTL_H */ ���������������������������������������������������������xorg-server-1.17.1/Xi/xiwarppointer.c���������������������������������������������������������������0000664�0001751�0001751�00000013373�12456571574�014477� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ /*********************************************************************** * * Request to Warp the pointer location of an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> /* for inputstr.h */ #include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2proto.h> #include "extnsionst.h" #include "exevents.h" #include "exglobals.h" #include "mipointer.h" /* for miPointerUpdateSprite */ #include "xiwarppointer.h" /*********************************************************************** * * This procedure allows a client to warp the pointer of a device. * */ int SProcXIWarpPointer(ClientPtr client) { REQUEST(xXIWarpPointerReq); REQUEST_SIZE_MATCH(xXIWarpPointerReq); swaps(&stuff->length); swapl(&stuff->src_win); swapl(&stuff->dst_win); swapl(&stuff->src_x); swapl(&stuff->src_y); swaps(&stuff->src_width); swaps(&stuff->src_height); swapl(&stuff->dst_x); swapl(&stuff->dst_y); swaps(&stuff->deviceid); return (ProcXIWarpPointer(client)); } int ProcXIWarpPointer(ClientPtr client) { int rc; int x, y; WindowPtr dest = NULL; DeviceIntPtr pDev; SpritePtr pSprite; ScreenPtr newScreen; int src_x, src_y; int dst_x, dst_y; REQUEST(xXIWarpPointerReq); REQUEST_SIZE_MATCH(xXIWarpPointerReq); /* FIXME: panoramix stuff is missing, look at ProcWarpPointer */ rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess); if (rc != Success) { client->errorValue = stuff->deviceid; return rc; } if ((!IsMaster(pDev) && !IsFloating(pDev)) || (IsMaster(pDev) && !IsPointerDevice(pDev))) { client->errorValue = stuff->deviceid; return BadDevice; } if (stuff->dst_win != None) { rc = dixLookupWindow(&dest, stuff->dst_win, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->dst_win; return rc; } } pSprite = pDev->spriteInfo->sprite; x = pSprite->hotPhys.x; y = pSprite->hotPhys.y; src_x = stuff->src_x / (double) (1 << 16); src_y = stuff->src_y / (double) (1 << 16); dst_x = stuff->dst_x / (double) (1 << 16); dst_y = stuff->dst_y / (double) (1 << 16); if (stuff->src_win != None) { int winX, winY; WindowPtr src; rc = dixLookupWindow(&src, stuff->src_win, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->src_win; return rc; } winX = src->drawable.x; winY = src->drawable.y; if (src->drawable.pScreen != pSprite->hotPhys.pScreen || x < winX + src_x || y < winY + src_y || (stuff->src_width != 0 && winX + src_x + (int) stuff->src_width < 0) || (stuff->src_height != 0 && winY + src_y + (int) stuff->src_height < y) || !PointInWindowIsVisible(src, x, y)) return Success; } if (dest) { x = dest->drawable.x; y = dest->drawable.y; newScreen = dest->drawable.pScreen; } else newScreen = pSprite->hotPhys.pScreen; x += dst_x; y += dst_y; if (x < 0) x = 0; else if (x > newScreen->width) x = newScreen->width - 1; if (y < 0) y = 0; else if (y > newScreen->height) y = newScreen->height - 1; if (newScreen == pSprite->hotPhys.pScreen) { if (x < pSprite->physLimits.x1) x = pSprite->physLimits.x1; else if (x >= pSprite->physLimits.x2) x = pSprite->physLimits.x2 - 1; if (y < pSprite->physLimits.y1) y = pSprite->physLimits.y1; else if (y >= pSprite->physLimits.y2) y = pSprite->physLimits.y2 - 1; if (pSprite->hotShape) ConfineToShape(pDev, pSprite->hotShape, &x, &y); (*newScreen->SetCursorPosition) (pDev, newScreen, x, y, TRUE); } else if (!PointerConfinedToScreen(pDev)) { NewCurrentScreen(pDev, newScreen, x, y); } /* if we don't update the device, we get a jump next time it moves */ pDev->last.valuators[0] = x; pDev->last.valuators[1] = y; miPointerUpdateSprite(pDev); /* FIXME: XWarpPointer is supposed to generate an event. It doesn't do it here though. */ return Success; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getkmap.c���������������������������������������������������������������������0000664�0001751�0001751�00000012145�12274325511�013172� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Get the key mapping for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "swaprep.h" #include "xkbsrv.h" #include "xkbstr.h" #include "getkmap.h" /*********************************************************************** * * This procedure gets the key mapping for an extension device, * for clients on machines with a different byte ordering than the server. * */ int SProcXGetDeviceKeyMapping(ClientPtr client) { REQUEST(xGetDeviceKeyMappingReq); swaps(&stuff->length); return (ProcXGetDeviceKeyMapping(client)); } /*********************************************************************** * * Get the device key mapping. * */ int ProcXGetDeviceKeyMapping(ClientPtr client) { xGetDeviceKeyMappingReply rep; DeviceIntPtr dev; XkbDescPtr xkb; KeySymsPtr syms; int rc; REQUEST(xGetDeviceKeyMappingReq); REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) return rc; if (dev->key == NULL) return BadMatch; xkb = dev->key->xkbInfo->desc; if (stuff->firstKeyCode < xkb->min_key_code || stuff->firstKeyCode > xkb->max_key_code) { client->errorValue = stuff->firstKeyCode; return BadValue; } if (stuff->firstKeyCode + stuff->count > xkb->max_key_code + 1) { client->errorValue = stuff->count; return BadValue; } syms = XkbGetCoreMap(dev); if (!syms) return BadAlloc; 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; WriteSwappedDataToClient(client, syms->mapWidth * stuff->count * sizeof(KeySym), &syms->map[syms->mapWidth * (stuff->firstKeyCode - syms->minKeyCode)]); free(syms->map); free(syms); return Success; } /*********************************************************************** * * This procedure writes the reply for the XGetDeviceKeyMapping function, * if the client and server have a different byte ordering. * */ void SRepXGetDeviceKeyMapping(ClientPtr client, int size, xGetDeviceKeyMappingReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/queryst.h���������������������������������������������������������������������0000664�0001751�0001751�00000003141�12274325511�013257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef QUERYST_H #define QUERYST_H 1 int SProcXQueryDeviceState(ClientPtr /* client */ ); int ProcXQueryDeviceState(ClientPtr /* client */ ); void SRepXQueryDeviceState(ClientPtr /* client */ , int /* size */ , xQueryDeviceStateReply * /* rep */ ); #endif /* QUERYST_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getfctl.c���������������������������������������������������������������������0000664�0001751�0001751�00000025271�12274325511�013176� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Get feedback control attributes for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "getfctl.h" /*********************************************************************** * * This procedure gets the control attributes for an extension device, * for clients on machines with a different byte ordering than the server. * */ int SProcXGetFeedbackControl(ClientPtr client) { REQUEST(xGetFeedbackControlReq); swaps(&stuff->length); return (ProcXGetFeedbackControl(client)); } /*********************************************************************** * * This procedure copies KbdFeedbackClass data, swapping if necessary. * */ static void CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf) { int i; xKbdFeedbackState *k2; k2 = (xKbdFeedbackState *) * buf; k2->class = KbdFeedbackClass; k2->length = sizeof(xKbdFeedbackState); k2->id = k->ctrl.id; k2->click = k->ctrl.click; k2->percent = k->ctrl.bell; k2->pitch = k->ctrl.bell_pitch; k2->duration = k->ctrl.bell_duration; k2->led_mask = k->ctrl.leds; k2->global_auto_repeat = k->ctrl.autoRepeat; for (i = 0; i < 32; i++) k2->auto_repeats[i] = k->ctrl.autoRepeats[i]; if (client->swapped) { swaps(&k2->length); swaps(&k2->pitch); swaps(&k2->duration); swapl(&k2->led_mask); swapl(&k2->led_values); } *buf += sizeof(xKbdFeedbackState); } /*********************************************************************** * * This procedure copies PtrFeedbackClass data, swapping if necessary. * */ static void CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf) { xPtrFeedbackState *p2; p2 = (xPtrFeedbackState *) * buf; p2->class = PtrFeedbackClass; p2->length = sizeof(xPtrFeedbackState); p2->id = p->ctrl.id; p2->accelNum = p->ctrl.num; p2->accelDenom = p->ctrl.den; p2->threshold = p->ctrl.threshold; if (client->swapped) { swaps(&p2->length); swaps(&p2->accelNum); swaps(&p2->accelDenom); swaps(&p2->threshold); } *buf += sizeof(xPtrFeedbackState); } /*********************************************************************** * * This procedure copies IntegerFeedbackClass data, swapping if necessary. * */ static void CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf) { xIntegerFeedbackState *i2; i2 = (xIntegerFeedbackState *) * buf; i2->class = IntegerFeedbackClass; i2->length = sizeof(xIntegerFeedbackState); i2->id = i->ctrl.id; i2->resolution = i->ctrl.resolution; i2->min_value = i->ctrl.min_value; i2->max_value = i->ctrl.max_value; if (client->swapped) { swaps(&i2->length); swapl(&i2->resolution); swapl(&i2->min_value); swapl(&i2->max_value); } *buf += sizeof(xIntegerFeedbackState); } /*********************************************************************** * * This procedure copies StringFeedbackClass data, swapping if necessary. * */ static void CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf) { int i; xStringFeedbackState *s2; KeySym *kptr; s2 = (xStringFeedbackState *) * buf; s2->class = StringFeedbackClass; s2->length = sizeof(xStringFeedbackState) + s->ctrl.num_symbols_supported * sizeof(KeySym); s2->id = s->ctrl.id; s2->max_symbols = s->ctrl.max_symbols; s2->num_syms_supported = s->ctrl.num_symbols_supported; *buf += sizeof(xStringFeedbackState); kptr = (KeySym *) (*buf); for (i = 0; i < s->ctrl.num_symbols_supported; i++) *kptr++ = *(s->ctrl.symbols_supported + i); if (client->swapped) { swaps(&s2->length); swaps(&s2->max_symbols); swaps(&s2->num_syms_supported); kptr = (KeySym *) (*buf); for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) { swapl(kptr); } } *buf += (s->ctrl.num_symbols_supported * sizeof(KeySym)); } /*********************************************************************** * * This procedure copies LedFeedbackClass data, swapping if necessary. * */ static void CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf) { xLedFeedbackState *l2; l2 = (xLedFeedbackState *) * buf; l2->class = LedFeedbackClass; l2->length = sizeof(xLedFeedbackState); l2->id = l->ctrl.id; l2->led_values = l->ctrl.led_values; l2->led_mask = l->ctrl.led_mask; if (client->swapped) { swaps(&l2->length); swapl(&l2->led_values); swapl(&l2->led_mask); } *buf += sizeof(xLedFeedbackState); } /*********************************************************************** * * This procedure copies BellFeedbackClass data, swapping if necessary. * */ static void CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf) { xBellFeedbackState *b2; b2 = (xBellFeedbackState *) * buf; b2->class = BellFeedbackClass; b2->length = sizeof(xBellFeedbackState); b2->id = b->ctrl.id; b2->percent = b->ctrl.percent; b2->pitch = b->ctrl.pitch; b2->duration = b->ctrl.duration; if (client->swapped) { swaps(&b2->length); swaps(&b2->pitch); swaps(&b2->duration); } *buf += sizeof(xBellFeedbackState); } /*********************************************************************** * * This procedure writes the reply for the xGetFeedbackControl function, * if the client and server have a different byte ordering. * */ void SRepXGetFeedbackControl(ClientPtr client, int size, xGetFeedbackControlReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_feedbacks); WriteToClient(client, size, rep); } /*********************************************************************** * * Get the feedback control state. * */ int ProcXGetFeedbackControl(ClientPtr client) { int rc, total_length = 0; char *buf, *savbuf; DeviceIntPtr dev; KbdFeedbackPtr k; PtrFeedbackPtr p; IntegerFeedbackPtr i; StringFeedbackPtr s; BellFeedbackPtr b; LedFeedbackPtr l; xGetFeedbackControlReply rep; REQUEST(xGetFeedbackControlReq); REQUEST_SIZE_MATCH(xGetFeedbackControlReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) return rc; 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++; total_length += sizeof(xKbdFeedbackState); } for (p = dev->ptrfeed; p; p = p->next) { rep.num_feedbacks++; total_length += sizeof(xPtrFeedbackState); } for (s = dev->stringfeed; s; s = s->next) { rep.num_feedbacks++; total_length += sizeof(xStringFeedbackState) + (s->ctrl.num_symbols_supported * sizeof(KeySym)); } for (i = dev->intfeed; i; i = i->next) { rep.num_feedbacks++; total_length += sizeof(xIntegerFeedbackState); } for (l = dev->leds; l; l = l->next) { rep.num_feedbacks++; total_length += sizeof(xLedFeedbackState); } for (b = dev->bell; b; b = b->next) { rep.num_feedbacks++; total_length += sizeof(xBellFeedbackState); } if (total_length == 0) return BadMatch; buf = (char *) malloc(total_length); if (!buf) return BadAlloc; savbuf = buf; for (k = dev->kbdfeed; k; k = k->next) CopySwapKbdFeedback(client, k, &buf); for (p = dev->ptrfeed; p; p = p->next) CopySwapPtrFeedback(client, p, &buf); for (s = dev->stringfeed; s; s = s->next) CopySwapStringFeedback(client, s, &buf); for (i = dev->intfeed; i; i = i->next) CopySwapIntegerFeedback(client, i, &buf); for (l = dev->leds; l; l = l->next) CopySwapLedFeedback(client, l, &buf); for (b = dev->bell; b; b = b->next) CopySwapBellFeedback(client, b, &buf); rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep); WriteToClient(client, total_length, savbuf); free(savbuf); return Success; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgprop.h���������������������������������������������������������������������0000664�0001751�0001751�00000002727�12274325511�013216� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHGPROP_H #define CHGPROP_H 1 int SProcXChangeDeviceDontPropagateList(ClientPtr /* client */ ); int ProcXChangeDeviceDontPropagateList(ClientPtr /* client */ ); #endif /* CHGPROP_H */ �����������������������������������������xorg-server-1.17.1/Xi/xichangehierarchy.h�����������������������������������������������������������0000664�0001751�0001751�00000003165�12274325511�015236� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ /*********************************************************************** * * Request change in the device hierarchy. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHDEVHIER_H #define CHDEVHIER_H 1 int SProcXIChangeHierarchy(ClientPtr /* client */ ); int ProcXIChangeHierarchy(ClientPtr /* client */ ); void XISendDeviceHierarchyEvent(int flags[]); #endif /* CHDEVHIER_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getvers.c���������������������������������������������������������������������0000664�0001751�0001751�00000010601�12274325511�013214� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to return the version of the extension. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "getvers.h" XExtensionVersion XIVersion; /*********************************************************************** * * Handle a request from a client with a different byte order than us. * */ int SProcXGetExtensionVersion(ClientPtr client) { REQUEST(xGetExtensionVersionReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); swaps(&stuff->nbytes); return (ProcXGetExtensionVersion(client)); } /*********************************************************************** * * This procedure returns the major/minor version of the X Input extension. * */ int ProcXGetExtensionVersion(ClientPtr client) { xGetExtensionVersionReply rep; REQUEST(xGetExtensionVersionReq); REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); if (stuff->length != bytes_to_int32(sizeof(xGetExtensionVersionReq) + stuff->nbytes)) return BadLength; 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); return Success; } /*********************************************************************** * * This procedure writes the reply for the XGetExtensionVersion function, * if the client and server have a different byte ordering. * */ void SRepXGetExtensionVersion(ClientPtr client, int size, xGetExtensionVersionReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->major_version); swaps(&rep->minor_version); WriteToClient(client, size, rep); } �������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getbmap.h���������������������������������������������������������������������0000664�0001751�0001751�00000003205�12274325511�013163� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETBMAP_H #define GETBMAP_H 1 int SProcXGetDeviceButtonMapping(ClientPtr /* client */ ); int ProcXGetDeviceButtonMapping(ClientPtr /* client */ ); void SRepXGetDeviceButtonMapping(ClientPtr /* client */ , int /* size */ , xGetDeviceButtonMappingReply * /* rep */ ); #endif /* GETBMAP_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/gtmotion.c��������������������������������������������������������������������0000664�0001751�0001751�00000013544�12274325511�013406� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to get the motion history from an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "gtmotion.h" /*********************************************************************** * * Swap the request if server and client have different byte ordering. * */ int SProcXGetDeviceMotionEvents(ClientPtr client) { REQUEST(xGetDeviceMotionEventsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); swapl(&stuff->start); swapl(&stuff->stop); return (ProcXGetDeviceMotionEvents(client)); } /**************************************************************************** * * Get the motion history for an extension pointer devices. * */ int ProcXGetDeviceMotionEvents(ClientPtr client) { INT32 *coords = NULL, *bufptr; xGetDeviceMotionEventsReply rep; unsigned long i; int rc, num_events, axes, size = 0; unsigned long nEvents; DeviceIntPtr dev; TimeStamp start, stop; int length = 0; ValuatorClassPtr v; REQUEST(xGetDeviceMotionEventsReq); REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess); if (rc != Success) return rc; v = dev->valuator; if (v == NULL || v->numAxes == 0) return BadMatch; if (dev->valuator->motionHintWindow) MaybeStopDeviceHint(dev, client); axes = v->numAxes; 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 || CompareTimeStamps(start, currentTime) == LATER) { WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep); return Success; } if (CompareTimeStamps(stop, currentTime) == LATER) stop = currentTime; num_events = v->numMotionEvents; if (num_events) { size = sizeof(Time) + (axes * sizeof(INT32)); rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords, /* XXX */ start.milliseconds, stop.milliseconds, (ScreenPtr) NULL, FALSE); } if (rep.nEvents > 0) { length = bytes_to_int32(rep.nEvents * size); rep.length = length; } nEvents = rep.nEvents; WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep); if (nEvents) { if (client->swapped) { bufptr = coords; for (i = 0; i < nEvents * (axes + 1); i++) { swapl(bufptr); bufptr++; } } WriteToClient(client, length * 4, coords); } free(coords); return Success; } /*********************************************************************** * * This procedure writes the reply for the XGetDeviceMotionEvents function, * if the client and server have a different byte ordering. * */ void SRepXGetDeviceMotionEvents(ClientPtr client, int size, xGetDeviceMotionEventsReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->nEvents); WriteToClient(client, size, rep); } ������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xisetdevfocus.h���������������������������������������������������������������0000664�0001751�0001751�00000003041�12274325511�014435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2008 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. * * Author: Peter Hutterer */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef XISETDEVFOCUS_H #define XISETDEVFOCUS_H 1 int SProcXISetFocus(ClientPtr client); int ProcXISetFocus(ClientPtr client); int SProcXIGetFocus(ClientPtr client); int ProcXIGetFocus(ClientPtr client); void SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply * rep); #endif /* XISETDEVFOCUS_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getprop.h���������������������������������������������������������������������0000664�0001751�0001751�00000003613�12274325511�013227� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETPROP_H #define GETPROP_H 1 int SProcXGetDeviceDontPropagateList(ClientPtr /* client */ ); int ProcXGetDeviceDontPropagateList(ClientPtr /* client */ ); XEventClass *ClassFromMask(XEventClass * /* buf */ , Mask /* mask */ , int /* maskndx */ , CARD16 * /* count */ , int /* mode */ ); void SRepXGetDeviceDontPropagateList(ClientPtr /* client */ , int /* size */ , xGetDeviceDontPropagateListReply * /* rep */ ); #endif /* GETPROP_H */ ���������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setbmap.c���������������������������������������������������������������������0000664�0001751�0001751�00000011026�12274325511�013172� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to change the button mapping of an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "setbmap.h" /*********************************************************************** * * This procedure changes the button mapping. * */ int SProcXSetDeviceButtonMapping(ClientPtr client) { REQUEST(xSetDeviceButtonMappingReq); swaps(&stuff->length); return (ProcXSetDeviceButtonMapping(client)); } /*********************************************************************** * * This procedure lists the input devices available to the server. * */ int ProcXSetDeviceButtonMapping(ClientPtr client) { int ret; xSetDeviceButtonMappingReply rep; DeviceIntPtr dev; REQUEST(xSetDeviceButtonMappingReq); REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq); if (stuff->length != bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length)) return BadLength; ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) return ret; rep = (xSetDeviceButtonMappingReply) { .repType = X_Reply, .RepType = X_SetDeviceButtonMapping, .sequenceNumber = client->sequence, .length = 0, .status = MappingSuccess }; ret = ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length, client); if (ret == -1) return BadValue; else if (ret == MappingBusy) rep.status = ret; else if (ret != Success) return ret; WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep); return Success; } /*********************************************************************** * * This procedure writes the reply for the XSetDeviceButtonMapping function, * if the client and server have a different byte ordering. * */ void SRepXSetDeviceButtonMapping(ClientPtr client, int size, xSetDeviceButtonMappingReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getselev.h��������������������������������������������������������������������0000664�0001751�0001751�00000003230�12274325511�013360� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETSELEV_H #define GETSELEV_H 1 int SProcXGetSelectedExtensionEvents(ClientPtr /* client */ ); int ProcXGetSelectedExtensionEvents(ClientPtr /* client */ ); void SRepXGetSelectedExtensionEvents(ClientPtr /* client */ , int /* size */ , xGetSelectedExtensionEventsReply * /* rep */ ); #endif /* GETSELEV_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setmmap.h���������������������������������������������������������������������0000664�0001751�0001751�00000003221�12274325511�013210� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SETMMAP_H #define SETMMAP_H 1 int SProcXSetDeviceModifierMapping(ClientPtr /* client */ ); int ProcXSetDeviceModifierMapping(ClientPtr /* client */ ); void SRepXSetDeviceModifierMapping(ClientPtr /* client */ , int /* size */ , xSetDeviceModifierMappingReply * /* rep */ ); #endif /* SETMMAP_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiquerypointer.h��������������������������������������������������������������0000664�0001751�0001751�00000003121�12274325511�014650� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef QUERYDP_H #define QUERYDP_H 1 int SProcXIQueryPointer(ClientPtr /* client */ ); int ProcXIQueryPointer(ClientPtr /* client */ ); void SRepXIQueryPointer(ClientPtr /* client */ , int /* size */ , xXIQueryPointerReply * /* rep */ ); #endif /* QUERYDP_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xisetclientpointer.c����������������������������������������������������������0000664�0001751�0001751�00000006146�12456571574�015520� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ /*********************************************************************** * * Request to set the client pointer for the owner of the given window. * All subsequent calls that are ambiguous will choose the client pointer as * default value. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> /* for inputstr.h */ #include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2proto.h> #include "extnsionst.h" #include "exevents.h" #include "exglobals.h" #include "xisetclientpointer.h" int SProcXISetClientPointer(ClientPtr client) { REQUEST(xXISetClientPointerReq); REQUEST_SIZE_MATCH(xXISetClientPointerReq); swaps(&stuff->length); swapl(&stuff->win); swaps(&stuff->deviceid); return (ProcXISetClientPointer(client)); } int ProcXISetClientPointer(ClientPtr client) { DeviceIntPtr pDev; ClientPtr targetClient; int rc; REQUEST(xXISetClientPointerReq); REQUEST_SIZE_MATCH(xXISetClientPointerReq); rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixManageAccess); if (rc != Success) { client->errorValue = stuff->deviceid; return rc; } if (!IsMaster(pDev)) { client->errorValue = stuff->deviceid; return BadDevice; } pDev = GetMaster(pDev, MASTER_POINTER); if (stuff->win != None) { rc = dixLookupClient(&targetClient, stuff->win, client, DixManageAccess); if (rc != Success) return BadWindow; } else targetClient = client; rc = SetClientPointer(targetClient, pDev); if (rc != Success) { client->errorValue = stuff->deviceid; return rc; } return Success; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiqueryversion.c��������������������������������������������������������������0000664�0001751�0001751�00000011067�12274325511�014660� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Authors: Peter Hutterer * */ /** * @file xiqueryversion.c * Protocol handling for the XIQueryVersion request/reply. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" #include <X11/Xmd.h> #include <X11/X.h> #include <X11/extensions/XI2proto.h> #include "exglobals.h" #include "exevents.h" #include "xiqueryversion.h" #include "misc.h" extern XExtensionVersion XIVersion; /* defined in getvers.c */ /** * Return the supported XI version. * * Saves the version the client claims to support as well, for future * reference. */ int ProcXIQueryVersion(ClientPtr client) { xXIQueryVersionReply rep; XIClientPtr pXIClient; int major, minor; REQUEST(xXIQueryVersionReq); REQUEST_SIZE_MATCH(xXIQueryVersionReq); /* This request only exists after XI2 */ if (stuff->major_version < 2) { client->errorValue = stuff->major_version; return BadValue; } 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) { /* Check to see if the client has only ever asked * for version 2.2 or higher */ if (version_compare(major, minor, 2, 2) >= 0 && version_compare(pXIClient->major_version, pXIClient->minor_version, 2, 2) >= 0) { /* As of version 2.2, Peter promises to never again break * backward compatibility, so we'll return the requested * version to the client but leave the server internal * version set to the highest requested value */ if (version_compare(major, minor, pXIClient->major_version, pXIClient->minor_version) > 0) { pXIClient->major_version = major; pXIClient->minor_version = minor; } } else { if (version_compare(major, minor, pXIClient->major_version, pXIClient->minor_version) < 0) { client->errorValue = stuff->major_version; return BadValue; } major = pXIClient->major_version; minor = pXIClient->minor_version; } } else { pXIClient->major_version = major; pXIClient->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); return Success; } /* Swapping routines */ int SProcXIQueryVersion(ClientPtr client) { REQUEST(xXIQueryVersionReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq); swaps(&stuff->major_version); swaps(&stuff->minor_version); return (ProcXIQueryVersion(client)); } void SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->major_version); swaps(&rep->minor_version); WriteToClient(client, size, rep); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getvers.h���������������������������������������������������������������������0000664�0001751�0001751�00000003157�12274325511�013231� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETVERS_H #define GETVERS_H 1 int SProcXGetExtensionVersion(ClientPtr /* client */ ); int ProcXGetExtensionVersion(ClientPtr /* client */ ); void SRepXGetExtensionVersion(ClientPtr /* client */ , int /* size */ , xGetExtensionVersionReply * /* rep */ ); #endif /* GETVERS_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiquerydevice.h���������������������������������������������������������������0000664�0001751�0001751�00000004123�12274325511�014432� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Authors: Peter Hutterer * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef QUERYDEV_H #define QUERYDEV_H 1 #include <X11/extensions/XI2proto.h> int SProcXIQueryDevice(ClientPtr client); int ProcXIQueryDevice(ClientPtr client); void SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep); int SizeDeviceClasses(DeviceIntPtr dev); int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev, char *any, uint16_t * nclasses); int GetDeviceUse(DeviceIntPtr dev, uint16_t * attachment); int ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info, Bool reportState); int ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo * info); int ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo * info, int axisnumber, Bool reportState); int ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo * info, int axisnumber); int ListTouchInfo(DeviceIntPtr dev, xXITouchInfo * info); #endif /* QUERYDEV_H */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setmode.h���������������������������������������������������������������������0000664�0001751�0001751�00000003123�12274325511�013203� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SETMODE_H #define SETMODE_H 1 int SProcXSetDeviceMode(ClientPtr /* client */ ); int ProcXSetDeviceMode(ClientPtr /* client */ ); void SRepXSetDeviceMode(ClientPtr /* client */ , int /* size */ , xSetDeviceModeReply * /* rep */ ); #endif /* SETMODE_H */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setfocus.c��������������������������������������������������������������������0000664�0001751�0001751�00000007127�12274325511�013401� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to set the focus for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "windowstr.h" /* focus struct */ #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "dixevents.h" #include "exglobals.h" #include "setfocus.h" /*********************************************************************** * * This procedure sets the focus for a device. * */ int SProcXSetDeviceFocus(ClientPtr client) { REQUEST(xSetDeviceFocusReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetDeviceFocusReq); swapl(&stuff->focus); swapl(&stuff->time); return (ProcXSetDeviceFocus(client)); } /*********************************************************************** * * This procedure sets the focus for a device. * */ int ProcXSetDeviceFocus(ClientPtr client) { int ret; DeviceIntPtr dev; REQUEST(xSetDeviceFocusReq); REQUEST_SIZE_MATCH(xSetDeviceFocusReq); ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess); if (ret != Success) return ret; if (!dev->focus) return BadDevice; ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo, stuff->time, TRUE); return ret; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xichangecursor.h��������������������������������������������������������������0000664�0001751�0001751�00000002676�12274325511�014603� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHDEVCUR_H #define CHDEVCUR_H 1 int SProcXIChangeCursor(ClientPtr /* client */ ); int ProcXIChangeCursor(ClientPtr /* client */ ); #endif /* CHDEVCUR_H */ ������������������������������������������������������������������xorg-server-1.17.1/Xi/Makefile.in�������������������������������������������������������������������0000664�0001751�0001751�00000075331�12466505427�013462� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = Xi DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libXi_la_LIBADD = am_libXi_la_OBJECTS = allowev.lo chgdctl.lo chgfctl.lo chgkbd.lo \ chgkmap.lo chgprop.lo chgptr.lo closedev.lo devbell.lo \ exevents.lo extinit.lo getbmap.lo getdctl.lo getfctl.lo \ getfocus.lo getkmap.lo getmmap.lo getprop.lo getselev.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 xibarriers.lo \ xichangecursor.lo xichangehierarchy.lo xigetclientpointer.lo \ xigrabdev.lo xipassivegrab.lo xiproperty.lo xiquerydevice.lo \ xiquerypointer.lo xiqueryversion.lo xiselectev.lo \ xisetclientpointer.lo xisetdevfocus.lo xiwarppointer.lo libXi_la_OBJECTS = $(am_libXi_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 = libXistubs_la_LIBADD = am_libXistubs_la_OBJECTS = stubs.lo libXistubs_la_OBJECTS = $(am_libXistubs_la_OBJECTS) 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 = $(libXi_la_SOURCES) $(libXistubs_la_SOURCES) DIST_SOURCES = $(libXi_la_SOURCES) $(libXistubs_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libXi.la libXistubs.la AM_CFLAGS = $(DIX_CFLAGS) libXi_la_SOURCES = \ allowev.c \ allowev.h \ chgdctl.c \ chgdctl.h \ chgfctl.c \ chgfctl.h \ chgkbd.c \ chgkbd.h \ chgkmap.c \ chgkmap.h \ chgprop.c \ chgprop.h \ chgptr.c \ chgptr.h \ closedev.c \ closedev.h \ devbell.c \ devbell.h \ exevents.c \ exglobals.h \ extinit.c \ getbmap.c \ getbmap.h \ getdctl.c \ getdctl.h \ getfctl.c \ getfctl.h \ getfocus.c \ getfocus.h \ getkmap.c \ getkmap.h \ getmmap.c \ getmmap.h \ getprop.c \ getprop.h \ getselev.c \ getselev.h \ getvers.c \ getvers.h \ grabdev.c \ grabdev.h \ grabdevb.c \ grabdevb.h \ grabdevk.c \ grabdevk.h \ gtmotion.c \ gtmotion.h \ listdev.c \ listdev.h \ opendev.c \ opendev.h \ queryst.c \ queryst.h \ selectev.c \ selectev.h \ sendexev.c \ sendexev.h \ setbmap.c \ setbmap.h \ setdval.c \ setdval.h \ setfocus.c \ setfocus.h \ setmmap.c \ setmmap.h \ setmode.c \ setmode.h \ ungrdev.c \ ungrdev.h \ ungrdevb.c \ ungrdevb.h \ ungrdevk.c \ ungrdevk.h \ xiallowev.c \ xiallowev.h \ xibarriers.c \ xibarriers.h \ xichangecursor.c \ xichangecursor.h \ xichangehierarchy.c \ xichangehierarchy.h \ xigetclientpointer.c \ xigetclientpointer.h \ xigrabdev.c \ xigrabdev.h \ xipassivegrab.h \ xipassivegrab.c \ xiproperty.c \ xiproperty.h \ xiquerydevice.c \ xiquerydevice.h \ xiquerypointer.c \ xiquerypointer.h \ xiqueryversion.c \ xiqueryversion.h \ xiselectev.c \ xiselectev.h \ xisetclientpointer.c \ xisetclientpointer.h \ xisetdevfocus.c \ xisetdevfocus.h \ xiwarppointer.c \ xiwarppointer.h libXistubs_la_SOURCES = \ stubs.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 Xi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Xi/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libXi.la: $(libXi_la_OBJECTS) $(libXi_la_DEPENDENCIES) $(EXTRA_libXi_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libXi_la_OBJECTS) $(libXi_la_LIBADD) $(LIBS) libXistubs.la: $(libXistubs_la_OBJECTS) $(libXistubs_la_DEPENDENCIES) $(EXTRA_libXistubs_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libXistubs_la_OBJECTS) $(libXistubs_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allowev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgdctl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgfctl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgkbd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgkmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgprop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgptr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closedev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devbell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exevents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getbmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdctl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfctl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfocus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getkmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getmmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getprop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getselev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getvers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grabdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grabdevb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grabdevk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtmotion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queryst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selectev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendexev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setbmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdval.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfocus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setmmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ungrdev.Plo@am__quote@ @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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xigrabdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xipassivegrab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiproperty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiquerydevice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiquerypointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiqueryversion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiselectev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xisetclientpointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xisetdevfocus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiwarppointer.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgptr.h����������������������������������������������������������������������0000664�0001751�0001751�00000002766�12274325511�013046� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef CHGPTR_H #define CHGPTR_H 1 int SProcXChangePointerDevice(ClientPtr /* client */ ); int ProcXChangePointerDevice(ClientPtr /* client */ ); void DeleteFocusClassDeviceStruct(DeviceIntPtr /* dev */ ); #endif /* CHGPTR_H */ ����������xorg-server-1.17.1/Xi/setdval.c���������������������������������������������������������������������0000664�0001751�0001751�00000011520�12274325511�013200� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to change the mode of an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "exglobals.h" #include "setdval.h" /*********************************************************************** * * Handle a request from a client with a different byte order. * */ int SProcXSetDeviceValuators(ClientPtr client) { REQUEST(xSetDeviceValuatorsReq); swaps(&stuff->length); return (ProcXSetDeviceValuators(client)); } /*********************************************************************** * * This procedure sets the value of valuators on an extension input device. * */ int ProcXSetDeviceValuators(ClientPtr client) { DeviceIntPtr dev; xSetDeviceValuatorsReply rep; int rc; REQUEST(xSetDeviceValuatorsReq); REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq); 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) return BadLength; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) return rc; if (dev->valuator == NULL) return BadMatch; if (IsXTestDevice(dev, NULL)) return BadMatch; if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) return BadValue; if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client)) rep.status = AlreadyGrabbed; else rep.status = SetDeviceValuators(client, dev, (int *) &stuff[1], stuff->first_valuator, stuff->num_valuators); if (rep.status != Success && rep.status != AlreadyGrabbed) return rep.status; WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep); return Success; } /*********************************************************************** * * This procedure writes the reply for the XSetDeviceValuators function, * if the client and server have a different byte ordering. * */ void SRepXSetDeviceValuators(ClientPtr client, int size, xSetDeviceValuatorsReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getdctl.h���������������������������������������������������������������������0000664�0001751�0001751�00000003141�12274325511�013171� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETDCTL_H #define GETDCTL_H 1 int SProcXGetDeviceControl(ClientPtr /* client */ ); int ProcXGetDeviceControl(ClientPtr /* client */ ); void SRepXGetDeviceControl(ClientPtr /* client */ , int /* size */ , xGetDeviceControlReply * /* rep */ ); #endif /* GETDCTL_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/queryst.c���������������������������������������������������������������������0000664�0001751�0001751�00000012436�12274325511�013261� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1998, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /*********************************************************************** * * Request to query the state of an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "xkbsrv.h" #include "xkbstr.h" #include "queryst.h" /*********************************************************************** * * This procedure allows a client to query the state of a device. * */ int SProcXQueryDeviceState(ClientPtr client) { REQUEST(xQueryDeviceStateReq); swaps(&stuff->length); return (ProcXQueryDeviceState(client)); } /*********************************************************************** * * This procedure allows frozen events to be routed. * */ int ProcXQueryDeviceState(ClientPtr client) { int rc, i; int num_classes = 0; int total_length = 0; char *buf, *savbuf; KeyClassPtr k; xKeyState *tk; ButtonClassPtr b; xButtonState *tb; ValuatorClassPtr v; xValuatorState *tv; xQueryDeviceStateReply rep; DeviceIntPtr dev; double *values; REQUEST(xQueryDeviceStateReq); REQUEST_SIZE_MATCH(xQueryDeviceStateReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess); if (rc != Success && rc != BadAccess) return rc; v = dev->valuator; if (v != NULL && v->motionHintWindow != NULL) MaybeStopDeviceHint(dev, client); k = dev->key; if (k != NULL) { total_length += sizeof(xKeyState); num_classes++; } b = dev->button; if (b != NULL) { total_length += sizeof(xButtonState); num_classes++; } if (v != NULL) { total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int))); num_classes++; } buf = (char *) calloc(total_length, 1); if (!buf) return BadAlloc; savbuf = buf; if (k != NULL) { tk = (xKeyState *) buf; tk->class = KeyClass; tk->length = sizeof(xKeyState); tk->num_keys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code + 1; if (rc != BadAccess) for (i = 0; i < 32; i++) tk->keys[i] = k->down[i]; buf += sizeof(xKeyState); } if (b != NULL) { tb = (xButtonState *) buf; tb->class = ButtonClass; tb->length = sizeof(xButtonState); tb->num_buttons = b->numButtons; if (rc != BadAccess) memcpy(tb->buttons, b->down, sizeof(b->down)); buf += sizeof(xButtonState); } if (v != NULL) { tv = (xValuatorState *) buf; tv->class = ValuatorClass; tv->length = sizeof(xValuatorState) + v->numAxes * 4; tv->num_valuators = v->numAxes; tv->mode = valuator_get_mode(dev, 0); tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0; buf += sizeof(xValuatorState); for (i = 0, values = v->axisVal; i < v->numAxes; i++) { if (rc != BadAccess) *((int *) buf) = *values; values++; if (client->swapped) { swapl((int *) buf); } buf += sizeof(int); } } 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); free(savbuf); return Success; } /*********************************************************************** * * This procedure writes the reply for the XQueryDeviceState function, * if the client and server have a different byte ordering. * */ void SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/devbell.h���������������������������������������������������������������������0000664�0001751�0001751�00000002647�12274325511�013172� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef DEVBELL_H #define DEVBELL_H 1 int SProcXDeviceBell(ClientPtr /* client */ ); int ProcXDeviceBell(ClientPtr /* client */ ); #endif /* DEVBELL_H */ �����������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgkmap.c���������������������������������������������������������������������0000664�0001751�0001751�00000010073�12274325511�013152� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Change key mapping for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "chgkmap.h" /*********************************************************************** * * This procedure swaps the request when the client and * server have different byte orderings. * */ int SProcXChangeDeviceKeyMapping(ClientPtr client) { unsigned int count; REQUEST(xChangeDeviceKeyMappingReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq); count = stuff->keyCodes * stuff->keySymsPerKeyCode; REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), count); return (ProcXChangeDeviceKeyMapping(client)); } /*********************************************************************** * * Change the device key mapping. * */ int ProcXChangeDeviceKeyMapping(ClientPtr client) { int ret; unsigned len; DeviceIntPtr dev; unsigned int count; REQUEST(xChangeDeviceKeyMappingReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq); count = stuff->keyCodes * stuff->keySymsPerKeyCode; REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32)); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) return ret; len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceKeyMappingReq)); ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify, stuff->firstKeyCode, stuff->keyCodes, stuff->keySymsPerKeyCode, (KeySym *) &stuff[1]); return ret; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xichangecursor.c��������������������������������������������������������������0000664�0001751�0001751�00000006420�12456571574�014603� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ /*********************************************************************** * * Request to change a given device pointer's cursor. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> /* for inputstr.h */ #include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2proto.h> #include "extnsionst.h" #include "exevents.h" #include "exglobals.h" #include "input.h" #include "xichangecursor.h" /*********************************************************************** * * This procedure allows a client to set one pointer's cursor. * */ int SProcXIChangeCursor(ClientPtr client) { REQUEST(xXIChangeCursorReq); REQUEST_SIZE_MATCH(xXIChangeCursorReq); swaps(&stuff->length); swapl(&stuff->win); swapl(&stuff->cursor); swaps(&stuff->deviceid); return (ProcXIChangeCursor(client)); } int ProcXIChangeCursor(ClientPtr client) { int rc; WindowPtr pWin = NULL; DeviceIntPtr pDev = NULL; CursorPtr pCursor = NULL; REQUEST(xXIChangeCursorReq); REQUEST_SIZE_MATCH(xXIChangeCursorReq); rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) return rc; if (!IsMaster(pDev) || !IsPointerDevice(pDev)) return BadDevice; if (stuff->win != None) { rc = dixLookupWindow(&pWin, stuff->win, client, DixSetAttrAccess); if (rc != Success) return rc; } if (stuff->cursor == None) { if (pWin == pWin->drawable.pScreen->root) pCursor = rootCursor; else pCursor = (CursorPtr) None; } else { rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) return rc; } ChangeWindowDeviceCursor(pWin, pDev, pCursor); return Success; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiselectev.h������������������������������������������������������������������0000664�0001751�0001751�00000003156�12274325511�013724� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2008 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. * * Author: Peter Hutterer */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef XISELECTEVENTS_H #define XISELECTEVENTS_H 1 int SProcXISelectEvents(ClientPtr client); int ProcXISelectEvents(ClientPtr client); int SProcXIGetSelectedEvents(ClientPtr client); int ProcXIGetSelectedEvents(ClientPtr client); void SRepXIGetSelectedEvents(ClientPtr client, int len, xXIGetSelectedEventsReply * rep); #endif /* _XISELECTEVENTS_H_ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getbmap.c���������������������������������������������������������������������0000664�0001751�0001751�00000010500�12274325511�013152� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to return the version of the extension. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "getbmap.h" /*********************************************************************** * * This procedure gets the button mapping for the specified device. * */ int SProcXGetDeviceButtonMapping(ClientPtr client) { REQUEST(xGetDeviceButtonMappingReq); swaps(&stuff->length); return (ProcXGetDeviceButtonMapping(client)); } /*********************************************************************** * * This procedure gets the button mapping for the specified device. * */ int ProcXGetDeviceButtonMapping(ClientPtr client) { DeviceIntPtr dev; xGetDeviceButtonMappingReply rep; ButtonClassPtr b; int rc; REQUEST(xGetDeviceButtonMappingReq); REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq); 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) return rc; b = dev->button; if (b == NULL) return BadMatch; rep.nElts = b->numButtons; rep.length = bytes_to_int32(rep.nElts); WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep); WriteToClient(client, rep.nElts, &b->map[1]); return Success; } /*********************************************************************** * * This procedure writes the reply for the XGetDeviceButtonMapping function, * if the client and server have a different byte ordering. * */ void SRepXGetDeviceButtonMapping(ClientPtr client, int size, xGetDeviceButtonMappingReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiquerypointer.c��������������������������������������������������������������0000664�0001751�0001751�00000015700�12456571574�014667� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ /*********************************************************************** * * Request to query the pointer location of an extension input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> /* for inputstr.h */ #include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2proto.h> #include "extnsionst.h" #include "exevents.h" #include "exglobals.h" #include "eventconvert.h" #include "scrnintstr.h" #include "xkbsrv.h" #ifdef PANORAMIX #include "panoramiXsrv.h" #endif #include "inpututils.h" #include "xiquerypointer.h" /*********************************************************************** * * This procedure allows a client to query the pointer of a device. * */ int SProcXIQueryPointer(ClientPtr client) { REQUEST(xXIQueryPointerReq); REQUEST_SIZE_MATCH(xXIQueryPointerReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->win); return (ProcXIQueryPointer(client)); } int ProcXIQueryPointer(ClientPtr client) { int rc; xXIQueryPointerReply rep; DeviceIntPtr pDev, kbd; WindowPtr pWin, t; SpritePtr pSprite; XkbStatePtr state; char *buttons = NULL; int buttons_size = 0; /* size of buttons array */ XIClientPtr xi_client; Bool have_xi22 = FALSE; REQUEST(xXIQueryPointerReq); REQUEST_SIZE_MATCH(xXIQueryPointerReq); /* Check if client is compliant with XInput 2.2 or later. Earlier clients * do not know about touches, so we must report emulated button presses. 2.2 * and later clients are aware of touches, so we don't include emulated * button presses in the reply. */ xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); if (version_compare(xi_client->major_version, xi_client->minor_version, 2, 2) >= 0) have_xi22 = TRUE; rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->deviceid; return rc; } if (pDev->valuator == NULL || IsKeyboardDevice(pDev) || (!IsMaster(pDev) && !IsFloating(pDev))) { /* no attached devices */ client->errorValue = stuff->deviceid; return BadDevice; } rc = dixLookupWindow(&pWin, stuff->win, client, DixGetAttrAccess); if (rc != Success) { SendErrorToClient(client, IReqCode, X_XIQueryPointer, stuff->win, rc); return Success; } if (pDev->valuator->motionHintWindow) MaybeStopHint(pDev, client); if (IsMaster(pDev)) kbd = GetMaster(pDev, MASTER_KEYBOARD); else kbd = (pDev->key) ? pDev : NULL; pSprite = pDev->spriteInfo->sprite; 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; rep.mods.base_mods = state->base_mods; rep.mods.latched_mods = state->latched_mods; rep.mods.locked_mods = state->locked_mods; rep.group.base_group = state->base_group; rep.group.latched_group = state->latched_group; rep.group.locked_group = state->locked_group; } if (pDev->button) { int i; rep.buttons_len = bytes_to_int32(bits_to_bytes(pDev->button->numButtons)); rep.length += rep.buttons_len; buttons_size = rep.buttons_len * 4; buttons = calloc(1, buttons_size); if (!buttons) return BadAlloc; for (i = 1; i < pDev->button->numButtons; i++) if (BitIsOn(pDev->button->down, i)) SetBit(buttons, pDev->button->map[i]); if (!have_xi22 && pDev->touch && pDev->touch->buttonsDown > 0) SetBit(buttons, pDev->button->map[1]); } else rep.buttons_len = 0; if (pSprite->hot.pScreen == pWin->drawable.pScreen) { rep.same_screen = xTrue; 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; break; } } else { rep.same_screen = xFalse; rep.win_x = 0; rep.win_y = 0; } #ifdef PANORAMIX if (!noPanoramiXExtension) { 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 += double_to_fp1616(screenInfo.screens[0]->x); rep.win_y += double_to_fp1616(screenInfo.screens[0]->y); } } #endif WriteReplyToClient(client, sizeof(xXIQueryPointerReply), &rep); if (buttons) WriteToClient(client, buttons_size, buttons); free(buttons); return Success; } /*********************************************************************** * * This procedure writes the reply for the XIQueryPointer function, * if the client and server have a different byte ordering. * */ void SRepXIQueryPointer(ClientPtr client, int size, xXIQueryPointerReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->root); swapl(&rep->child); swapl(&rep->root_x); swapl(&rep->root_y); swapl(&rep->win_x); swapl(&rep->win_y); swaps(&rep->buttons_len); WriteToClient(client, size, rep); } ����������������������������������������������������������������xorg-server-1.17.1/Xi/grabdevk.c��������������������������������������������������������������������0000664�0001751�0001751�00000012023�12274325511�013322� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to grab a key on an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "xace.h" #include "grabdev.h" #include "grabdevk.h" /*********************************************************************** * * Handle requests from clients with a different byte order. * */ int SProcXGrabDeviceKey(ClientPtr client) { REQUEST(xGrabDeviceKeyReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); swaps(&stuff->event_count); REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); return (ProcXGrabDeviceKey(client)); } /*********************************************************************** * * Grab a key on an extension device. * */ int ProcXGrabDeviceKey(ClientPtr client) { int ret; DeviceIntPtr dev; DeviceIntPtr mdev; XEventClass *class; struct tmask tmp[EMASKSIZE]; GrabParameters param; GrabMask mask; REQUEST(xGrabDeviceKeyReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count) return BadLength; ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (ret != Success) return ret; if (stuff->modifier_device != UseXKeyboard) { ret = dixLookupDevice(&mdev, stuff->modifier_device, client, DixUseAccess); if (ret != Success) return ret; if (mdev->key == NULL) return BadMatch; } else { mdev = PickKeyboard(client); ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess); if (ret != Success) return ret; } class = (XEventClass *) (&stuff[1]); /* first word of values */ if ((ret = CreateMaskFromList(client, class, stuff->event_count, tmp, dev, X_GrabDeviceKey)) != Success) return ret; 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); return ret; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/chgkbd.c����������������������������������������������������������������������0000664�0001751�0001751�00000006541�12274325511�012767� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to change the keyboard device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "globals.h" #include "exevents.h" #include "exglobals.h" #include "chgkbd.h" #include "chgptr.h" /*********************************************************************** * * This procedure changes the keyboard device. * */ int SProcXChangeKeyboardDevice(ClientPtr client) { REQUEST(xChangeKeyboardDeviceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); return (ProcXChangeKeyboardDevice(client)); } /*********************************************************************** * * This procedure is invoked to swap the request bytes if the server and * client have a different byte order. * */ int ProcXChangeKeyboardDevice(ClientPtr client) { /* REQUEST(xChangeKeyboardDeviceReq); */ REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); return BadDevice; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/listdev.c���������������������������������������������������������������������0000664�0001751�0001751�00000030631�12323563340�013213� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to list the available input devices. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> /* for inputstr.h */ #include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "extnsionst.h" #include "exevents.h" #include "xace.h" #include "xkbsrv.h" #include "xkbstr.h" #include "listdev.h" /*********************************************************************** * * This procedure lists the input devices available to the server. * */ int SProcXListInputDevices(ClientPtr client) { REQUEST(xListInputDevicesReq); swaps(&stuff->length); return (ProcXListInputDevices(client)); } /*********************************************************************** * * This procedure calculates the size of the information to be returned * for an input device. * */ static void SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size) { int chunks; *namesize += 1; if (d->name) *namesize += strlen(d->name); if (d->key != NULL) *size += sizeof(xKeyInfo); if (d->button != NULL) *size += sizeof(xButtonInfo); if (d->valuator != NULL) { chunks = ((int) d->valuator->numAxes + 19) / VPC; *size += (chunks * sizeof(xValuatorInfo) + d->valuator->numAxes * sizeof(xAxisInfo)); } } /*********************************************************************** * * This procedure copies data to the DeviceInfo struct, swapping if necessary. * * We need the extra byte in the allocated buffer, because the trailing null * hammers one extra byte, which is overwritten by the next name except for * the last name copied. * */ static void CopyDeviceName(char **namebuf, const char *name) { char *nameptr = *namebuf; if (name) { *nameptr++ = strlen(name); strcpy(nameptr, name); *namebuf += (strlen(name) + 1); } else { *nameptr++ = 0; *namebuf += 1; } } /*********************************************************************** * * This procedure copies ButtonClass information, swapping if necessary. * */ static void CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf) { xButtonInfoPtr b2; b2 = (xButtonInfoPtr) * buf; b2->class = ButtonClass; b2->length = sizeof(xButtonInfo); b2->num_buttons = b->numButtons; if (client && client->swapped) { swaps(&b2->num_buttons); } *buf += sizeof(xButtonInfo); } /*********************************************************************** * * This procedure copies data to the DeviceInfo struct, swapping if necessary. * */ static void CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, char **buf) { xDeviceInfoPtr dev; dev = (xDeviceInfoPtr) * buf; dev->id = d->id; dev->type = d->xinput_type; dev->num_classes = num_classes; if (IsMaster(d) && IsKeyboardDevice(d)) dev->use = IsXKeyboard; else if (IsMaster(d) && IsPointerDevice(d)) dev->use = IsXPointer; else if (d->valuator && d->button) dev->use = IsXExtensionPointer; else if (d->key && d->kbdfeed) dev->use = IsXExtensionKeyboard; else dev->use = IsXExtensionDevice; if (client->swapped) { swapl(&dev->type); } *buf += sizeof(xDeviceInfo); } /*********************************************************************** * * This procedure copies KeyClass information, swapping if necessary. * */ static void CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf) { xKeyInfoPtr k2; k2 = (xKeyInfoPtr) * buf; k2->class = KeyClass; k2->length = sizeof(xKeyInfo); k2->min_keycode = k->xkbInfo->desc->min_key_code; k2->max_keycode = k->xkbInfo->desc->max_key_code; k2->num_keys = k2->max_keycode - k2->min_keycode + 1; if (client && client->swapped) { swaps(&k2->num_keys); } *buf += sizeof(xKeyInfo); } /*********************************************************************** * * This procedure copies ValuatorClass information, swapping if necessary. * * Devices may have up to 255 valuators. The length of a ValuatorClass is * defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo). * The maximum length is therefore (8 + 255 * 12) = 3068. However, the * length field is one byte. If a device has more than 20 valuators, we * must therefore return multiple valuator classes to the client. * */ static int CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf) { int i, j, axes, t_axes; ValuatorClassPtr v = dev->valuator; xValuatorInfoPtr v2; AxisInfo *a; xAxisInfoPtr a2; for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC); i++, axes -= VPC) { t_axes = axes < VPC ? axes : VPC; if (t_axes < 0) t_axes = v->numAxes % VPC; v2 = (xValuatorInfoPtr) * buf; v2->class = ValuatorClass; v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo); v2->num_axes = t_axes; v2->mode = valuator_get_mode(dev, 0); v2->motion_buffer_size = v->numMotionEvents; if (client && client->swapped) { swapl(&v2->motion_buffer_size); } *buf += sizeof(xValuatorInfo); a = v->axes + (VPC * i); a2 = (xAxisInfoPtr) * buf; for (j = 0; j < t_axes; j++) { a2->min_value = a->min_value; a2->max_value = a->max_value; a2->resolution = a->resolution; if (client && client->swapped) { swapl(&a2->min_value); swapl(&a2->max_value); swapl(&a2->resolution); } a2++; a++; *buf += sizeof(xAxisInfo); } } return i; } static void CopySwapClasses(ClientPtr client, DeviceIntPtr dev, CARD8 *num_classes, char **classbuf) { if (dev->key != NULL) { CopySwapKeyClass(client, dev->key, classbuf); (*num_classes)++; } if (dev->button != NULL) { CopySwapButtonClass(client, dev->button, classbuf); (*num_classes)++; } if (dev->valuator != NULL) { (*num_classes) += CopySwapValuatorClass(client, dev, classbuf); } } /*********************************************************************** * * This procedure lists information to be returned for an input device. * */ static void ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev, char **devbuf, char **classbuf, char **namebuf) { CopyDeviceName(namebuf, d->name); CopySwapDevice(client, d, 0, devbuf); CopySwapClasses(client, d, &dev->num_classes, classbuf); } /*********************************************************************** * * This procedure checks if a device should be left off the list. * */ static Bool ShouldSkipDevice(ClientPtr client, DeviceIntPtr d) { /* don't send master devices other than VCP/VCK */ if (!IsMaster(d) || d == inputInfo.pointer ||d == inputInfo.keyboard) { int rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess); if (rc == Success) return FALSE; } return TRUE; } /*********************************************************************** * * This procedure lists the input devices available to the server. * * If this request is called by a client that has not issued a * GetExtensionVersion request with major/minor version set, we don't send the * complete device list. Instead, we only send the VCP, the VCK and floating * SDs. This resembles the setup found on XI 1.x machines. */ int ProcXListInputDevices(ClientPtr client) { xListInputDevicesReply rep; int numdevs = 0; int namesize = 1; /* need 1 extra byte for strcpy */ int i = 0, size = 0; int total_length; char *devbuf, *classbuf, *namebuf, *savbuf; Bool *skip; xDeviceInfo *dev; DeviceIntPtr d; REQUEST_SIZE_MATCH(xListInputDevicesReq); 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); if (!skip) return BadAlloc; /* figure out which devices to skip */ numdevs = 0; for (d = inputInfo.devices; d; d = d->next, i++) { skip[i] = ShouldSkipDevice(client, d); if (skip[i]) continue; SizeDeviceInfo(d, &namesize, &size); numdevs++; } for (d = inputInfo.off_devices; d; d = d->next, i++) { skip[i] = ShouldSkipDevice(client, d); if (skip[i]) continue; SizeDeviceInfo(d, &namesize, &size); numdevs++; } /* allocate space for reply */ total_length = numdevs * sizeof(xDeviceInfo) + size + namesize; devbuf = (char *) calloc(1, total_length); classbuf = devbuf + (numdevs * sizeof(xDeviceInfo)); namebuf = classbuf + size; savbuf = devbuf; /* fill in and send reply */ i = 0; dev = (xDeviceInfoPtr) devbuf; for (d = inputInfo.devices; d; d = d->next, i++) { if (skip[i]) continue; ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf); } for (d = inputInfo.off_devices; d; d = d->next, i++) { if (skip[i]) continue; ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf); } rep.ndevices = numdevs; rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep); WriteToClient(client, total_length, savbuf); free(savbuf); free(skip); return Success; } /*********************************************************************** * * This procedure writes the reply for the XListInputDevices function, * if the client and server have a different byte ordering. * */ void SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } �������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/selectev.c��������������������������������������������������������������������0000664�0001751�0001751�00000013474�12274325511�013362� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to select input from an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "grabdev.h" #include "selectev.h" extern Mask ExtExclusiveMasks[]; static int HandleDevicePresenceMask(ClientPtr client, WindowPtr win, XEventClass * cls, CARD16 *count) { int i, j; Mask mask; /* We use the device ID 256 to select events that aren't bound to * any device. For now we only handle the device presence event, * but this could be extended to other events that aren't bound to * a device. * * In order not to break in CreateMaskFromList() we remove the * entries with device ID 256 from the XEventClass array. */ mask = 0; for (i = 0, j = 0; i < *count; i++) { if (cls[i] >> 8 != 256) { cls[j] = cls[i]; j++; continue; } switch (cls[i] & 0xff) { case _devicePresence: mask |= DevicePresenceNotifyMask; break; } } *count = j; if (mask == 0) return Success; /* We always only use mksidx = AllDevices for events not bound to * devices */ if (AddExtensionClient(win, client, mask, XIAllDevices) != Success) return BadAlloc; RecalculateDeviceDeliverableEvents(win); return Success; } /*********************************************************************** * * Handle requests from clients with a different byte order. * */ int SProcXSelectExtensionEvent(ClientPtr client) { REQUEST(xSelectExtensionEventReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); swapl(&stuff->window); swaps(&stuff->count); REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->count); return (ProcXSelectExtensionEvent(client)); } /*********************************************************************** * * This procedure selects input from an extension device. * */ int ProcXSelectExtensionEvent(ClientPtr client) { int ret; int i; WindowPtr pWin; struct tmask tmp[EMASKSIZE]; REQUEST(xSelectExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); if (stuff->length != bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count) return BadLength; ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); if (ret != Success) return ret; if (HandleDevicePresenceMask(client, pWin, (XEventClass *) &stuff[1], &stuff->count) != Success) return BadAlloc; if ((ret = CreateMaskFromList(client, (XEventClass *) &stuff[1], stuff->count, tmp, NULL, X_SelectExtensionEvent)) != Success) return ret; for (i = 0; i < EMASKSIZE; i++) if (tmp[i].dev != NULL) { if (tmp[i].mask & ~XIAllMasks) { client->errorValue = tmp[i].mask; return BadValue; } if ((ret = SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client, tmp[i].mask, ExtExclusiveMasks[i])) != Success) return ret; } return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xisetclientpointer.h����������������������������������������������������������0000664�0001751�0001751�00000002703�12274325511�015502� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SETCPTR_H #define SETCPTR_H 1 int SProcXISetClientPointer(ClientPtr /* client */ ); int ProcXISetClientPointer(ClientPtr /* client */ ); #endif /* SETCPTR_H */ �������������������������������������������������������������xorg-server-1.17.1/Xi/xisetdevfocus.c���������������������������������������������������������������0000664�0001751�0001751�00000007026�12456571574�014455� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2008 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. * * Author: Peter Hutterer */ /*********************************************************************** * * Request to set and get an input device's focus. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI2.h> #include <X11/extensions/XI2proto.h> #include "exglobals.h" /* BadDevice */ #include "xisetdevfocus.h" int SProcXISetFocus(ClientPtr client) { REQUEST(xXISetFocusReq); REQUEST_AT_LEAST_SIZE(xXISetFocusReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->focus); swapl(&stuff->time); return ProcXISetFocus(client); } int SProcXIGetFocus(ClientPtr client) { REQUEST(xXIGetFocusReq); REQUEST_AT_LEAST_SIZE(xXIGetFocusReq); swaps(&stuff->length); swaps(&stuff->deviceid); return ProcXIGetFocus(client); } int ProcXISetFocus(ClientPtr client) { DeviceIntPtr dev; int ret; REQUEST(xXISetFocusReq); REQUEST_AT_LEAST_SIZE(xXISetFocusReq); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetFocusAccess); if (ret != Success) return ret; if (!dev->focus) return BadDevice; return SetInputFocus(client, dev, stuff->focus, RevertToParent, stuff->time, TRUE); } int ProcXIGetFocus(ClientPtr client) { xXIGetFocusReply rep; DeviceIntPtr dev; int ret; REQUEST(xXIGetFocusReq); REQUEST_AT_LEAST_SIZE(xXIGetFocusReq); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess); if (ret != Success) return ret; if (!dev->focus) return BadDevice; rep = (xXIGetFocusReply) { .repType = X_Reply, .RepType = X_XIGetFocus, .sequenceNumber = client->sequence, .length = 0 }; if (dev->focus->win == NoneWin) rep.focus = None; else if (dev->focus->win == PointerRootWin) rep.focus = PointerRoot; else if (dev->focus->win == FollowKeyboardWin) rep.focus = FollowKeyboard; else rep.focus = dev->focus->win->drawable.id; WriteReplyToClient(client, sizeof(xXIGetFocusReply), &rep); return Success; } void SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->focus); WriteToClient(client, len, rep); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setbmap.h���������������������������������������������������������������������0000664�0001751�0001751�00000003205�12274325511�013177� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SETBMAP_H #define SETBMAP_H 1 int SProcXSetDeviceButtonMapping(ClientPtr /* client */ ); int ProcXSetDeviceButtonMapping(ClientPtr /* client */ ); void SRepXSetDeviceButtonMapping(ClientPtr /* client */ , int /* size */ , xSetDeviceButtonMappingReply * /* rep */ ); #endif /* SETBMAP_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setdval.h���������������������������������������������������������������������0000664�0001751�0001751�00000003145�12274325511�013211� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SETDVAL_H #define SETDVAL_H 1 int SProcXSetDeviceValuators(ClientPtr /* client */ ); int ProcXSetDeviceValuators(ClientPtr /* client */ ); void SRepXSetDeviceValuators(ClientPtr /* client */ , int /* size */ , xSetDeviceValuatorsReply * /* rep */ ); #endif /* SETDVAL_H */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/grabdev.h���������������������������������������������������������������������0000664�0001751�0001751�00000003525�12274325511�013163� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GRABDEV_H #define GRABDEV_H 1 int SProcXGrabDevice(ClientPtr /* client */ ); int ProcXGrabDevice(ClientPtr /* client */ ); int CreateMaskFromList(ClientPtr /* client */ , XEventClass * /* list */ , int /* count */ , struct tmask /* mask */ [], DeviceIntPtr /* dev */ , int /* req */ ); void SRepXGrabDevice(ClientPtr /* client */ , int /* size */ , xGrabDeviceReply * /* rep */ ); #endif /* GRABDEV_H */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/selectev.h��������������������������������������������������������������������0000664�0001751�0001751�00000002702�12274325511�013357� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SELECTEV_H #define SELECTEV_H 1 int SProcXSelectExtensionEvent(ClientPtr /* client */ ); int ProcXSelectExtensionEvent(ClientPtr /* client */ ); #endif /* SELECTEV_H */ ��������������������������������������������������������������xorg-server-1.17.1/Xi/xigetclientpointer.h����������������������������������������������������������0000664�0001751�0001751�00000003150�12274325511�015463� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETCPTR_H #define GETCPTR_H 1 int SProcXIGetClientPointer(ClientPtr /* client */ ); int ProcXIGetClientPointer(ClientPtr /* client */ ); void SRepXIGetClientPointer(ClientPtr /* client */ , int /* size */ , xXIGetClientPointerReply * /* rep */ ); #endif /* GETCPTR_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/sendexev.h��������������������������������������������������������������������0000664�0001751�0001751�00000002672�12274325511�013374� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SENDEXEV_H #define SENDEXEV_H 1 int SProcXSendExtensionEvent(ClientPtr /* client */ ); int ProcXSendExtensionEvent(ClientPtr /* client */ ); #endif /* SENDEXEV_H */ ����������������������������������������������������������������������xorg-server-1.17.1/Xi/devbell.c���������������������������������������������������������������������0000664�0001751�0001751�00000011435�12274325511�013160� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to change the keyboard device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "devbell.h" /*********************************************************************** * * This procedure is invoked to swap the request bytes if the server and * client have a different byte order. * */ int SProcXDeviceBell(ClientPtr client) { REQUEST(xDeviceBellReq); swaps(&stuff->length); return (ProcXDeviceBell(client)); } /*********************************************************************** * * This procedure rings a bell on an extension device. * */ int ProcXDeviceBell(ClientPtr client) { DeviceIntPtr dev; KbdFeedbackPtr k; BellFeedbackPtr b; int rc, base; int newpercent; CARD8 class; void *ctrl; BellProcPtr proc; REQUEST(xDeviceBellReq); REQUEST_SIZE_MATCH(xDeviceBellReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess); if (rc != Success) { client->errorValue = stuff->deviceid; return rc; } if (stuff->percent < -100 || stuff->percent > 100) { client->errorValue = stuff->percent; return BadValue; } if (stuff->feedbackclass == KbdFeedbackClass) { for (k = dev->kbdfeed; k; k = k->next) if (k->ctrl.id == stuff->feedbackid) break; if (!k) { client->errorValue = stuff->feedbackid; return BadValue; } base = k->ctrl.bell; proc = k->BellProc; ctrl = (void *) &(k->ctrl); class = KbdFeedbackClass; } else if (stuff->feedbackclass == BellFeedbackClass) { for (b = dev->bell; b; b = b->next) if (b->ctrl.id == stuff->feedbackid) break; if (!b) { client->errorValue = stuff->feedbackid; return BadValue; } base = b->ctrl.percent; proc = b->BellProc; ctrl = (void *) &(b->ctrl); class = BellFeedbackClass; } else { client->errorValue = stuff->feedbackclass; return BadValue; } newpercent = (base * stuff->percent) / 100; if (stuff->percent < 0) newpercent = base + newpercent; else newpercent = base - newpercent + stuff->percent; if (proc == NULL) return BadValue; (*proc) (newpercent, dev, ctrl, class); return Success; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/getmmap.c���������������������������������������������������������������������0000664�0001751�0001751�00000011077�12274325511�013177� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Get the modifier mapping for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> /* Request macro */ #include "exglobals.h" #include "getmmap.h" /*********************************************************************** * * This procedure gets the modifier mapping for an extension device, * for clients on machines with a different byte ordering than the server. * */ int SProcXGetDeviceModifierMapping(ClientPtr client) { REQUEST(xGetDeviceModifierMappingReq); swaps(&stuff->length); return (ProcXGetDeviceModifierMapping(client)); } /*********************************************************************** * * Get the device Modifier mapping. * */ int ProcXGetDeviceModifierMapping(ClientPtr client) { DeviceIntPtr dev; xGetDeviceModifierMappingReply rep; KeyCode *modkeymap = NULL; int ret, max_keys_per_mod; REQUEST(xGetDeviceModifierMappingReq); REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (ret != Success) return ret; ret = generate_modkeymap(client, dev, &modkeymap, &max_keys_per_mod); if (ret != Success) return ret; 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 */ .length = max_keys_per_mod << 1 }; WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep); WriteToClient(client, max_keys_per_mod * 8, modkeymap); free(modkeymap); return Success; } /*********************************************************************** * * This procedure writes the reply for the XGetDeviceModifierMapping function, * if the client and server have a different byte ordering. * */ void SRepXGetDeviceModifierMapping(ClientPtr client, int size, xGetDeviceModifierMappingReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/sendexev.c��������������������������������������������������������������������0000664�0001751�0001751�00000012474�12456571574�013406� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to send an extension event. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* Window */ #include "extnsionst.h" /* EventSwapPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exevents.h" #include "exglobals.h" #include "grabdev.h" #include "sendexev.h" extern int lastEvent; /* Defined in extension.c */ /*********************************************************************** * * Handle requests from clients with a different byte order than us. * */ int SProcXSendExtensionEvent(ClientPtr client) { CARD32 *p; int i; xEvent eventT; xEvent *eventP; EventSwapPtr proc; REQUEST(xSendExtensionEventReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); swapl(&stuff->destination); swaps(&stuff->count); if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count + bytes_to_int32(stuff->num_events * sizeof(xEvent))) return BadLength; eventP = (xEvent *) &stuff[1]; for (i = 0; i < stuff->num_events; i++, eventP++) { proc = EventSwapVector[eventP->u.u.type & 0177]; if (proc == NotImplemented) /* no swapping proc; invalid event type? */ return BadValue; (*proc) (eventP, &eventT); *eventP = eventT; } p = (CARD32 *) (((xEvent *) &stuff[1]) + stuff->num_events); SwapLongs(p, stuff->count); return (ProcXSendExtensionEvent(client)); } /*********************************************************************** * * Send an event to some client, as if it had come from an extension input * device. * */ int ProcXSendExtensionEvent(ClientPtr client) { int ret; DeviceIntPtr dev; xEvent *first; XEventClass *list; struct tmask tmp[EMASKSIZE]; REQUEST(xSendExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count + (stuff->num_events * bytes_to_int32(sizeof(xEvent)))) return BadLength; ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess); if (ret != Success) return ret; if (stuff->num_events == 0) return ret; /* The client's event type must be one defined by an extension. */ first = ((xEvent *) &stuff[1]); if (!((EXTENSION_EVENT_BASE <= first->u.u.type) && (first->u.u.type < lastEvent))) { client->errorValue = first->u.u.type; return BadValue; } list = (XEventClass *) (first + stuff->num_events); if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev, X_SendExtensionEvent)) != Success) return ret; ret = (SendEvent(client, dev, stuff->destination, stuff->propagate, (xEvent *) &stuff[1], tmp[stuff->deviceid].mask, stuff->num_events)); return ret; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/exglobals.h�������������������������������������������������������������������0000664�0001751�0001751�00000005417�12274325511�013533� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ /***************************************************************** * * Globals referenced elsewhere in the server. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "privates.h" #ifndef EXGLOBALS_H #define EXGLOBALS_H 1 extern int IReqCode; extern int IEventBase; extern int BadDevice; extern int BadMode; extern int DeviceBusy; extern int BadClass; /* Note: only the ones needed in files other than extinit.c are declared */ extern const Mask DevicePointerMotionMask; extern const Mask DevicePointerMotionHintMask; extern const Mask DeviceFocusChangeMask; extern const Mask DeviceStateNotifyMask; extern const Mask DeviceMappingNotifyMask; extern const Mask DeviceOwnerGrabButtonMask; extern const Mask DeviceButtonGrabMask; extern const Mask DeviceButtonMotionMask; extern const Mask DevicePresenceNotifyMask; extern const Mask DevicePropertyNotifyMask; extern const Mask XIAllMasks; extern Mask PropagateMask[]; extern int DeviceValuator; extern int DeviceKeyPress; extern int DeviceKeyRelease; extern int DeviceButtonPress; extern int DeviceButtonRelease; extern int DeviceMotionNotify; extern int DeviceFocusIn; extern int DeviceFocusOut; extern int ProximityIn; extern int ProximityOut; extern int DeviceStateNotify; extern int DeviceKeyStateNotify; extern int DeviceButtonStateNotify; extern int DeviceMappingNotify; extern int ChangeDeviceNotify; extern int DevicePresenceNotify; extern int DevicePropertyNotify; extern RESTYPE RT_INPUTCLIENT; extern DevPrivateKeyRec XIClientPrivateKeyRec; #define XIClientPrivateKey (&XIClientPrivateKeyRec) #endif /* EXGLOBALS_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/setfocus.h��������������������������������������������������������������������0000664�0001751�0001751�00000002672�12274325511�013406� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef SETFOCUS_H #define SETFOCUS_H 1 int SProcXSetDeviceFocus(ClientPtr /* client */ ); int ProcXSetDeviceFocus(ClientPtr /* client */ ); #endif /* SETFOCUS_H */ ����������������������������������������������������������������������xorg-server-1.17.1/Xi/getfocus.c��������������������������������������������������������������������0000664�0001751�0001751�00000010715�12274325511�013362� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Extension function to get the focus for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "windowstr.h" /* focus struct */ #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "getfocus.h" /*********************************************************************** * * This procedure gets the focus for a device. * */ int SProcXGetDeviceFocus(ClientPtr client) { REQUEST(xGetDeviceFocusReq); swaps(&stuff->length); return (ProcXGetDeviceFocus(client)); } /*********************************************************************** * * This procedure gets the focus for a device. * */ int ProcXGetDeviceFocus(ClientPtr client) { DeviceIntPtr dev; FocusClassPtr focus; xGetDeviceFocusReply rep; int rc; REQUEST(xGetDeviceFocusReq); REQUEST_SIZE_MATCH(xGetDeviceFocusReq); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess); if (rc != Success) return rc; if (!dev->focus) return BadDevice; rep = (xGetDeviceFocusReply) { .repType = X_Reply, .RepType = X_GetDeviceFocus, .sequenceNumber = client->sequence, .length = 0 }; focus = dev->focus; if (focus->win == NoneWin) rep.focus = None; else if (focus->win == PointerRootWin) rep.focus = PointerRoot; else if (focus->win == FollowKeyboardWin) rep.focus = FollowKeyboard; else rep.focus = focus->win->drawable.id; rep.time = focus->time.milliseconds; rep.revertTo = focus->revert; WriteReplyToClient(client, sizeof(xGetDeviceFocusReply), &rep); return Success; } /*********************************************************************** * * This procedure writes the reply for the GetDeviceFocus function, * if the client and server have a different byte ordering. * */ void SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->focus); swapl(&rep->time); WriteToClient(client, size, rep); } ���������������������������������������������������xorg-server-1.17.1/Xi/ungrdevk.h��������������������������������������������������������������������0000664�0001751�0001751�00000002672�12274325511�013400� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef UNGRDEVK_H #define UNGRDEVK_H 1 int SProcXUngrabDeviceKey(ClientPtr /* client */ ); int ProcXUngrabDeviceKey(ClientPtr /* client */ ); #endif /* UNGRDEVK_H */ ����������������������������������������������������������������������xorg-server-1.17.1/Xi/getmmap.h���������������������������������������������������������������������0000664�0001751�0001751�00000003221�12274325511�013174� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GETMMAP_H #define GETMMAP_H 1 int SProcXGetDeviceModifierMapping(ClientPtr /* client */ ); int ProcXGetDeviceModifierMapping(ClientPtr /* client */ ); void SRepXGetDeviceModifierMapping(ClientPtr /* client */ , int /* size */ , xGetDeviceModifierMappingReply * /* rep */ ); #endif /* GETMMAP_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xigrabdev.h�������������������������������������������������������������������0000664�0001751�0001751�00000003052�12274325511�013517� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Author: Peter Hutterer */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef XIGRABDEV_H #define XIGRABDEV_H 1 int ProcXIGrabDevice(ClientPtr client); int SProcXIGrabDevice(ClientPtr client); int ProcXIUngrabDevice(ClientPtr client); int SProcXIUngrabDevice(ClientPtr client); void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep); #endif /* XIGRABDEV_H */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xigetclientpointer.c����������������������������������������������������������0000664�0001751�0001751�00000006573�12456571574�015510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> /* for inputstr.h */ #include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XI2proto.h> #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" #include "exglobals.h" #include "xigetclientpointer.h" /*********************************************************************** * This procedure allows a client to query another client's client pointer * setting. */ int SProcXIGetClientPointer(ClientPtr client) { REQUEST(xXIGetClientPointerReq); REQUEST_SIZE_MATCH(xXIGetClientPointerReq); swaps(&stuff->length); swapl(&stuff->win); return ProcXIGetClientPointer(client); } int ProcXIGetClientPointer(ClientPtr client) { int rc; ClientPtr winclient; xXIGetClientPointerReply rep; REQUEST(xXIGetClientPointerReq); REQUEST_SIZE_MATCH(xXIGetClientPointerReq); if (stuff->win != None) { rc = dixLookupClient(&winclient, stuff->win, client, DixGetAttrAccess); if (rc != Success) return BadWindow; } else winclient = client; 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; } /*********************************************************************** * * This procedure writes the reply for the XGetClientPointer function, * if the client and server have a different byte ordering. * */ void SRepXIGetClientPointer(ClientPtr client, int size, xXIGetClientPointerReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->deviceid); WriteToClient(client, size, rep); } �������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xibarriers.c������������������������������������������������������������������0000664�0001751�0001751�00000062747�12274325511�013731� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * 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 <dix-config.h> #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(void *res, XID id, void *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(void *res, XID id, void *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; } void XIBarrierReset(void) { int i; for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; BarrierScreenPtr cs = GetBarrierScreen(pScreen); free(cs); SetBarrierScreen(pScreen, NULL); } } �������������������������xorg-server-1.17.1/Xi/xiwarppointer.h���������������������������������������������������������������0000664�0001751�0001751�00000002674�12274325511�014470� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef WARPDEVP_H #define WARPDEVP_H 1 int SProcXIWarpPointer(ClientPtr /* client */ ); int ProcXIWarpPointer(ClientPtr /* client */ ); #endif /* WARPDEVP_H */ ��������������������������������������������������������������������xorg-server-1.17.1/Xi/chgdctl.c���������������������������������������������������������������������0000664�0001751�0001751�00000020043�12456571574�013164� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /******************************************************************** * * Change Device control attributes for an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> /* control constants */ #include "XIstubs.h" #include "exglobals.h" #include "exevents.h" #include "chgdctl.h" /*********************************************************************** * * This procedure changes the control attributes for an extension device, * for clients on machines with a different byte ordering than the server. * */ int SProcXChangeDeviceControl(ClientPtr client) { xDeviceCtl *ctl; REQUEST(xChangeDeviceControlReq); swaps(&stuff->length); REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); swaps(&stuff->control); ctl = (xDeviceCtl *) &stuff[1]; swaps(&ctl->control); swaps(&ctl->length); switch (stuff->control) { case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: case DEVICE_CORE: case DEVICE_ENABLE: case DEVICE_RESOLUTION: /* hmm. beer. *drool* */ break; } return (ProcXChangeDeviceControl(client)); } /*********************************************************************** * * Change the control attributes. * */ int ProcXChangeDeviceControl(ClientPtr client) { unsigned len; int i, status, ret = BadValue; DeviceIntPtr dev; xDeviceResolutionCtl *r; xChangeDeviceControlReply rep; AxisInfoPtr a; CARD32 *resolution; xDeviceEnableCtl *e; REQUEST(xChangeDeviceControlReq); REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceControlReq)); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) goto out; /* XTest devices are special, none of the below apply to them anyway */ if (IsXTestDevice(dev, NULL)) { ret = BadMatch; goto out; } rep = (xChangeDeviceControlReply) { .repType = X_Reply, .RepType = X_ChangeDeviceControl, .sequenceNumber = client->sequence, .length = 0, .status = Success, }; switch (stuff->control) { case DEVICE_RESOLUTION: r = (xDeviceResolutionCtl *) &stuff[1]; if ((len < bytes_to_int32(sizeof(xDeviceResolutionCtl))) || (len != bytes_to_int32(sizeof(xDeviceResolutionCtl)) + r->num_valuators)) { ret = BadLength; goto out; } if (!dev->valuator) { ret = BadMatch; goto out; } if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client)) { rep.status = AlreadyGrabbed; ret = Success; goto out; } resolution = (CARD32 *) (r + 1); if (r->first_valuator + r->num_valuators > dev->valuator->numAxes) { ret = BadValue; goto out; } status = ChangeDeviceControl(client, dev, (xDeviceCtl *) r); if (status == Success) { a = &dev->valuator->axes[r->first_valuator]; for (i = 0; i < r->num_valuators; i++) if (*(resolution + i) < (a + i)->min_resolution || *(resolution + i) > (a + i)->max_resolution) return BadValue; for (i = 0; i < r->num_valuators; i++) (a++)->resolution = *resolution++; ret = Success; } else if (status == DeviceBusy) { rep.status = DeviceBusy; ret = Success; } else { ret = BadMatch; } break; case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: /* Calibration is now done through properties, and never had any effect * on anything (in the open-source world). Thus, be honest. */ ret = BadMatch; break; case DEVICE_CORE: /* Sorry, no device core switching no more. If you want a device to * send core events, attach it to a master device */ ret = BadMatch; break; case DEVICE_ENABLE: e = (xDeviceEnableCtl *) &stuff[1]; if ((len != bytes_to_int32(sizeof(xDeviceEnableCtl)))) { ret = BadLength; goto out; } if (IsXTestDevice(dev, NULL)) status = !Success; else status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); if (status == Success) { if (e->enable) EnableDevice(dev, TRUE); else DisableDevice(dev, TRUE); ret = Success; } else if (status == DeviceBusy) { rep.status = DeviceBusy; ret = Success; } else { ret = BadMatch; } break; default: ret = BadValue; } out: if (ret == Success) { devicePresenceNotify dpn = { .type = DevicePresenceNotify, .time = currentTime.milliseconds, .devchange = DeviceControlChanged, .deviceid = dev->id, .control = stuff->control }; SendEventToAllWindows(dev, DevicePresenceNotifyMask, (xEvent *) &dpn, 1); WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep); } return ret; } /*********************************************************************** * * This procedure writes the reply for the xChangeDeviceControl function, * if the client and server have a different byte ordering. * */ void SRepXChangeDeviceControl(ClientPtr client, int size, xChangeDeviceControlReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, size, rep); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/ungrdevk.c��������������������������������������������������������������������0000664�0001751�0001751�00000012122�12274325511�013362� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to release a grab of a key on an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "dixgrabs.h" #include "xkbsrv.h" #include "xkbstr.h" #include "ungrdevk.h" #define AllModifiersMask ( \ ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) /*********************************************************************** * * Handle requests from a client with a different byte order. * */ int SProcXUngrabDeviceKey(ClientPtr client) { REQUEST(xUngrabDeviceKeyReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); return (ProcXUngrabDeviceKey(client)); } /*********************************************************************** * * Release a grab of a key on an extension device. * */ int ProcXUngrabDeviceKey(ClientPtr client) { DeviceIntPtr dev; DeviceIntPtr mdev; WindowPtr pWin; GrabPtr temporaryGrab; int rc; REQUEST(xUngrabDeviceKeyReq); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (rc != Success) return rc; if (dev->key == NULL) return BadMatch; if (stuff->modifier_device != UseXKeyboard) { rc = dixLookupDevice(&mdev, stuff->modifier_device, client, DixReadAccess); if (rc != Success) return BadDevice; if (mdev->key == NULL) return BadMatch; } else mdev = PickKeyboard(client); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; if (((stuff->key > dev->key->xkbInfo->desc->max_key_code) || (stuff->key < dev->key->xkbInfo->desc->min_key_code)) && (stuff->key != AnyKey)) return BadValue; if ((stuff->modifiers != AnyModifier) && (stuff->modifiers & ~AllModifiersMask)) return BadValue; temporaryGrab = AllocGrab(NULL); if (!temporaryGrab) return BadAlloc; temporaryGrab->resource = client->clientAsMask; temporaryGrab->device = dev; temporaryGrab->window = pWin; temporaryGrab->type = DeviceKeyPress; temporaryGrab->grabtype = XI; temporaryGrab->modifierDevice = mdev; temporaryGrab->modifiersDetail.exact = stuff->modifiers; temporaryGrab->modifiersDetail.pMask = NULL; temporaryGrab->detail.exact = stuff->key; temporaryGrab->detail.pMask = NULL; DeletePassiveGrabFromList(temporaryGrab); FreeGrab(temporaryGrab); return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xiselectev.c������������������������������������������������������������������0000664�0001751�0001751�00000027255�12456571574�013743� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2008 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. * * Author: Peter Hutterer */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "dixstruct.h" #include "windowstr.h" #include "exglobals.h" #include "exevents.h" #include <X11/extensions/XI2proto.h> #include "inpututils.h" #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. * * @return BadValue if at least one invalid bit is set or Success otherwise. */ int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len) { if (len >= XIMaskLen(XI2LASTEVENT)) { int i; for (i = XI2LASTEVENT + 1; i < len * 8; i++) { if (BitIsOn(mask, i)) { client->errorValue = i; return BadValue; } } } return Success; } int SProcXISelectEvents(ClientPtr client) { int i; int len; xXIEventMask *evmask; REQUEST(xXISelectEventsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXISelectEventsReq); swapl(&stuff->win); swaps(&stuff->num_masks); len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq)); evmask = (xXIEventMask *) &stuff[1]; for (i = 0; i < stuff->num_masks; i++) { if (len < bytes_to_int32(sizeof(xXIEventMask))) return BadLength; len -= bytes_to_int32(sizeof(xXIEventMask)); swaps(&evmask->deviceid); swaps(&evmask->mask_len); if (len < evmask->mask_len) return BadLength; len -= evmask->mask_len; evmask = (xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4); } return (ProcXISelectEvents(client)); } int ProcXISelectEvents(ClientPtr client) { int rc, num_masks; WindowPtr win; DeviceIntPtr dev; DeviceIntRec dummy; xXIEventMask *evmask; int *types = NULL; int len; REQUEST(xXISelectEventsReq); REQUEST_AT_LEAST_SIZE(xXISelectEventsReq); if (stuff->num_masks == 0) return BadValue; rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess); if (rc != Success) return rc; len = sz_xXISelectEventsReq; /* check request validity */ evmask = (xXIEventMask *) &stuff[1]; num_masks = stuff->num_masks; while (num_masks--) { len += sizeof(xXIEventMask) + evmask->mask_len * 4; if (bytes_to_int32(len) > stuff->length) return BadLength; if (evmask->deviceid != XIAllDevices && evmask->deviceid != XIAllMasterDevices) rc = dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess); else { /* XXX: XACE here? */ } if (rc != Success) return rc; /* hierarchy event mask is not allowed on devices */ if (evmask->deviceid != XIAllDevices && evmask->mask_len >= 1) { unsigned char *bits = (unsigned char *) &evmask[1]; if (BitIsOn(bits, XI_HierarchyChanged)) { client->errorValue = XI_HierarchyChanged; return BadValue; } } /* Raw events may only be selected on root windows */ if (win->parent && evmask->mask_len >= 1) { unsigned char *bits = (unsigned char *) &evmask[1]; if (BitIsOn(bits, XI_RawKeyPress) || BitIsOn(bits, XI_RawKeyRelease) || BitIsOn(bits, XI_RawButtonPress) || BitIsOn(bits, XI_RawButtonRelease) || BitIsOn(bits, XI_RawMotion) || BitIsOn(bits, XI_RawTouchBegin) || BitIsOn(bits, XI_RawTouchUpdate) || BitIsOn(bits, XI_RawTouchEnd)) { client->errorValue = XI_RawKeyPress; return BadValue; } } if (evmask->mask_len >= 1) { unsigned char *bits = (unsigned char *) &evmask[1]; /* All three touch events must be selected at once */ if ((BitIsOn(bits, XI_TouchBegin) || BitIsOn(bits, XI_TouchUpdate) || BitIsOn(bits, XI_TouchOwnership) || BitIsOn(bits, XI_TouchEnd)) && (!BitIsOn(bits, XI_TouchBegin) || !BitIsOn(bits, XI_TouchUpdate) || !BitIsOn(bits, XI_TouchEnd))) { client->errorValue = XI_TouchBegin; return BadValue; } /* Only one client per window may select for touch events on the * same devices, including master devices. * XXX: This breaks if a device goes from floating to attached. */ if (BitIsOn(bits, XI_TouchBegin)) { rc = check_for_touch_selection_conflicts(client, win, evmask->deviceid); if (rc != Success) return rc; } } if (XICheckInvalidMaskBits(client, (unsigned char *) &evmask[1], evmask->mask_len * 4) != Success) return BadValue; evmask = (xXIEventMask *) (((unsigned char *) evmask) + evmask->mask_len * 4); evmask++; } if (bytes_to_int32(len) != stuff->length) return BadLength; /* Set masks on window */ evmask = (xXIEventMask *) &stuff[1]; num_masks = stuff->num_masks; while (num_masks--) { if (evmask->deviceid == XIAllDevices || evmask->deviceid == XIAllMasterDevices) { dummy.id = evmask->deviceid; dev = &dummy; } else dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess); if (XISetEventMask(dev, win, client, evmask->mask_len * 4, (unsigned char *) &evmask[1]) != Success) return BadAlloc; evmask = (xXIEventMask *) (((unsigned char *) evmask) + evmask->mask_len * 4); evmask++; } RecalculateDeliverableEvents(win); free(types); return Success; } int SProcXIGetSelectedEvents(ClientPtr client) { REQUEST(xXIGetSelectedEventsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); swapl(&stuff->win); return (ProcXIGetSelectedEvents(client)); } int ProcXIGetSelectedEvents(ClientPtr client) { int rc, i; WindowPtr win; char *buffer = NULL; xXIGetSelectedEventsReply reply; OtherInputMasks *masks; InputClientsPtr others = NULL; xXIEventMask *evmask = NULL; DeviceIntPtr dev; REQUEST(xXIGetSelectedEventsReq); REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess); if (rc != Success) return rc; reply = (xXIGetSelectedEventsReply) { .repType = X_Reply, .RepType = X_XIGetSelectedEvents, .sequenceNumber = client->sequence, .length = 0, .num_masks = 0 }; masks = wOtherInputMasks(win); if (masks) { for (others = wOtherInputMasks(win)->inputClients; others; others = others->next) { if (SameClient(others, client)) { break; } } } if (!others) { WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply); return Success; } buffer = calloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE)); if (!buffer) return BadAlloc; evmask = (xXIEventMask *) buffer; for (i = 0; i < MAXDEVICES; i++) { int j; const unsigned char *devmask = xi2mask_get_one_mask(others->xi2mask, i); if (i > 2) { rc = dixLookupDevice(&dev, i, client, DixGetAttrAccess); if (rc != Success) continue; } for (j = xi2mask_mask_size(others->xi2mask) - 1; j >= 0; j--) { if (devmask[j] != 0) { int mask_len = (j + 4) / 4; /* j is an index, hence + 4, not + 3 */ evmask->deviceid = i; evmask->mask_len = mask_len; reply.num_masks++; reply.length += sizeof(xXIEventMask) / 4 + evmask->mask_len; if (client->swapped) { swaps(&evmask->deviceid); swaps(&evmask->mask_len); } memcpy(&evmask[1], devmask, j + 1); evmask = (xXIEventMask *) ((char *) evmask + sizeof(xXIEventMask) + mask_len * 4); break; } } } WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply); if (reply.num_masks) WriteToClient(client, reply.length * 4, buffer); free(buffer); return Success; } void SRepXIGetSelectedEvents(ClientPtr client, int len, xXIGetSelectedEventsReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_masks); WriteToClient(client, len, rep); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xipassivegrab.c���������������������������������������������������������������0000664�0001751�0001751�00000025157�12456571574�014436� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 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. * * Author: Peter Hutterer */ /*********************************************************************** * * Request to grab or ungrab input device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI2.h> #include <X11/extensions/XI2proto.h> #include "swaprep.h" #include "exglobals.h" /* BadDevice */ #include "exevents.h" #include "xipassivegrab.h" #include "dixgrabs.h" #include "misc.h" #include "inpututils.h" int SProcXIPassiveGrabDevice(ClientPtr client) { int i; uint32_t *mods; REQUEST(xXIPassiveGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->grab_window); swapl(&stuff->cursor); swapl(&stuff->time); swapl(&stuff->detail); swaps(&stuff->mask_len); swaps(&stuff->num_modifiers); REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, ((uint32_t) stuff->mask_len + stuff->num_modifiers) *4); mods = (uint32_t *) &stuff[1] + stuff->mask_len; for (i = 0; i < stuff->num_modifiers; i++, mods++) { swapl(mods); } return ProcXIPassiveGrabDevice(client); } int ProcXIPassiveGrabDevice(ClientPtr client) { DeviceIntPtr dev, mod_dev; 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; GrabMask mask = { 0 }; GrabParameters param; void *tmp; int mask_len; REQUEST(xXIPassiveGrabDeviceReq); REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, ((uint32_t) stuff->mask_len + stuff->num_modifiers) * 4); if (stuff->deviceid == XIAllDevices) dev = inputInfo.all_devices; else if (stuff->deviceid == XIAllMasterDevices) dev = inputInfo.all_master_devices; else { ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); if (ret != Success) { client->errorValue = stuff->deviceid; return ret; } } if (stuff->grab_type != XIGrabtypeButton && stuff->grab_type != XIGrabtypeKeycode && stuff->grab_type != XIGrabtypeEnter && stuff->grab_type != XIGrabtypeFocusIn && stuff->grab_type != XIGrabtypeTouchBegin) { client->errorValue = stuff->grab_type; return BadValue; } if ((stuff->grab_type == XIGrabtypeEnter || stuff->grab_type == XIGrabtypeFocusIn || stuff->grab_type == XIGrabtypeTouchBegin) && stuff->detail != 0) { client->errorValue = stuff->detail; return BadValue; } if (stuff->grab_type == XIGrabtypeTouchBegin && (stuff->grab_mode != XIGrabModeTouch || stuff->paired_device_mode != GrabModeAsync)) { client->errorValue = stuff->grab_mode; return BadValue; } if (XICheckInvalidMaskBits(client, (unsigned char *) &stuff[1], stuff->mask_len * 4) != Success) return BadValue; mask.xi2mask = xi2mask_new(); if (!mask.xi2mask) return BadAlloc; mask_len = min(xi2mask_mask_size(mask.xi2mask), stuff->mask_len * 4); xi2mask_set_one_mask(mask.xi2mask, stuff->deviceid, (unsigned char *) &stuff[1], mask_len * 4); memset(¶m, 0, sizeof(param)); param.grabtype = XI2; param.ownerEvents = stuff->owner_events; param.grabWindow = stuff->grab_window; param.cursor = stuff->cursor; if (IsKeyboardDevice(dev)) { param.this_device_mode = stuff->grab_mode; param.other_devices_mode = stuff->paired_device_mode; } else { param.this_device_mode = stuff->paired_device_mode; param.other_devices_mode = stuff->grab_mode; } if (stuff->cursor != None) { ret = dixLookupResourceByType(&tmp, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (ret != Success) { client->errorValue = stuff->cursor; goto out; } } ret = dixLookupWindow((WindowPtr *) &tmp, stuff->grab_window, client, DixSetAttrAccess); if (ret != Success) goto out; ret = CheckGrabValues(client, ¶m); if (ret != Success) goto out; modifiers = (uint32_t *) &stuff[1] + stuff->mask_len; modifiers_failed = calloc(stuff->num_modifiers, sizeof(xXIGrabModifierInfo)); if (!modifiers_failed) { ret = BadAlloc; goto out; } mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD); for (i = 0; i < stuff->num_modifiers; i++, modifiers++) { uint8_t status = Success; param.modifiers = *modifiers; ret = CheckGrabValues(client, ¶m); if (ret != Success) goto out; switch (stuff->grab_type) { case XIGrabtypeButton: status = GrabButton(client, dev, mod_dev, stuff->detail, ¶m, XI2, &mask); break; case XIGrabtypeKeycode: status = GrabKey(client, dev, mod_dev, stuff->detail, ¶m, XI2, &mask); break; case XIGrabtypeEnter: case XIGrabtypeFocusIn: status = GrabWindow(client, dev, stuff->grab_type, ¶m, &mask); break; case XIGrabtypeTouchBegin: status = GrabTouch(client, dev, mod_dev, ¶m, &mask); break; } if (status != GrabSuccess) { xXIGrabModifierInfo *info = modifiers_failed + rep.num_modifiers; info->status = status; info->modifiers = *modifiers; if (client->swapped) swapl(&info->modifiers); rep.num_modifiers++; rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo)); } } WriteReplyToClient(client, sizeof(rep), &rep); if (rep.num_modifiers) WriteToClient(client, rep.length * 4, modifiers_failed); free(modifiers_failed); out: xi2mask_free(&mask.xi2mask); return ret; } void SRepXIPassiveGrabDevice(ClientPtr client, int size, xXIPassiveGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_modifiers); WriteToClient(client, size, rep); } int SProcXIPassiveUngrabDevice(ClientPtr client) { int i; uint32_t *modifiers; REQUEST(xXIPassiveUngrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); swaps(&stuff->length); swapl(&stuff->grab_window); swaps(&stuff->deviceid); swapl(&stuff->detail); swaps(&stuff->num_modifiers); REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq, ((uint32_t) stuff->num_modifiers) << 2); modifiers = (uint32_t *) &stuff[1]; for (i = 0; i < stuff->num_modifiers; i++, modifiers++) swapl(modifiers); return ProcXIPassiveUngrabDevice(client); } int ProcXIPassiveUngrabDevice(ClientPtr client) { DeviceIntPtr dev, mod_dev; WindowPtr win; GrabPtr tempGrab; uint32_t *modifiers; int i, rc; REQUEST(xXIPassiveUngrabDeviceReq); REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq, ((uint32_t) stuff->num_modifiers) << 2); if (stuff->deviceid == XIAllDevices) dev = inputInfo.all_devices; else if (stuff->deviceid == XIAllMasterDevices) dev = inputInfo.all_master_devices; else { rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); if (rc != Success) return rc; } if (stuff->grab_type != XIGrabtypeButton && stuff->grab_type != XIGrabtypeKeycode && stuff->grab_type != XIGrabtypeEnter && stuff->grab_type != XIGrabtypeFocusIn && stuff->grab_type != XIGrabtypeTouchBegin) { client->errorValue = stuff->grab_type; return BadValue; } if ((stuff->grab_type == XIGrabtypeEnter || stuff->grab_type == XIGrabtypeFocusIn || stuff->grab_type == XIGrabtypeTouchBegin) && stuff->detail != 0) { client->errorValue = stuff->detail; return BadValue; } rc = dixLookupWindow(&win, stuff->grab_window, client, DixSetAttrAccess); if (rc != Success) return rc; mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD); tempGrab = AllocGrab(NULL); if (!tempGrab) return BadAlloc; tempGrab->resource = client->clientAsMask; tempGrab->device = dev; tempGrab->window = win; switch (stuff->grab_type) { case XIGrabtypeButton: tempGrab->type = XI_ButtonPress; break; case XIGrabtypeKeycode: tempGrab->type = XI_KeyPress; break; case XIGrabtypeEnter: tempGrab->type = XI_Enter; break; case XIGrabtypeFocusIn: tempGrab->type = XI_FocusIn; break; case XIGrabtypeTouchBegin: tempGrab->type = XI_TouchBegin; break; } tempGrab->grabtype = XI2; tempGrab->modifierDevice = mod_dev; tempGrab->modifiersDetail.pMask = NULL; tempGrab->detail.exact = stuff->detail; tempGrab->detail.pMask = NULL; modifiers = (uint32_t *) &stuff[1]; for (i = 0; i < stuff->num_modifiers; i++, modifiers++) { tempGrab->modifiersDetail.exact = *modifiers; DeletePassiveGrabFromList(tempGrab); } FreeGrab(tempGrab); return Success; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/gtmotion.h��������������������������������������������������������������������0000664�0001751�0001751�00000003206�12274325511�013405� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef GTMOTION_H #define GTMOTION_H 1 int SProcXGetDeviceMotionEvents(ClientPtr /* client */ ); int ProcXGetDeviceMotionEvents(ClientPtr /* client */ ); void SRepXGetDeviceMotionEvents(ClientPtr /* client */ , int /* size */ , xGetDeviceMotionEventsReply * /* rep */ ); #endif /* GTMOTION_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/xibarriers.h������������������������������������������������������������������0000664�0001751�0001751�00000002212�12274325511�013713� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #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 <xfixesint.h> int XICreatePointerBarrier(ClientPtr client, xXFixesCreatePointerBarrierReq * stuff); int XIDestroyPointerBarrier(ClientPtr client, xXFixesDestroyPointerBarrierReq * stuff); Bool XIBarrierInit(void); void XIBarrierReset(void); int SProcXIBarrierReleasePointer(ClientPtr client); int ProcXIBarrierReleasePointer(ClientPtr client); void XIBarrierNewMasterDevice(ClientPtr client, int deviceid); void XIBarrierRemoveMasterDevice(ClientPtr client, int deviceid); #endif /* _XIBARRIERS_H_ */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xi/ungrdevb.c��������������������������������������������������������������������0000664�0001751�0001751�00000011622�12274325511�013355� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /*********************************************************************** * * Request to release a grab of a button on an extension device. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "dixgrabs.h" #include "ungrdevb.h" #define AllModifiersMask ( \ ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) /*********************************************************************** * * Handle requests from a client with a different byte order. * */ int SProcXUngrabDeviceButton(ClientPtr client) { REQUEST(xUngrabDeviceButtonReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); return (ProcXUngrabDeviceButton(client)); } /*********************************************************************** * * Release a grab of a button on an extension device. * */ int ProcXUngrabDeviceButton(ClientPtr client) { DeviceIntPtr dev; DeviceIntPtr mdev; WindowPtr pWin; GrabPtr temporaryGrab; int rc; REQUEST(xUngrabDeviceButtonReq); REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess); if (rc != Success) return rc; if (dev->button == NULL) return BadMatch; if (stuff->modifier_device != UseXKeyboard) { rc = dixLookupDevice(&mdev, stuff->modifier_device, client, DixReadAccess); if (rc != Success) return BadDevice; if (mdev->key == NULL) return BadMatch; } else mdev = PickKeyboard(client); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; if ((stuff->modifiers != AnyModifier) && (stuff->modifiers & ~AllModifiersMask)) return BadValue; temporaryGrab = AllocGrab(NULL); if (!temporaryGrab) return BadAlloc; temporaryGrab->resource = client->clientAsMask; temporaryGrab->device = dev; temporaryGrab->window = pWin; temporaryGrab->type = DeviceButtonPress; temporaryGrab->grabtype = XI; temporaryGrab->modifierDevice = mdev; temporaryGrab->modifiersDetail.exact = stuff->modifiers; temporaryGrab->modifiersDetail.pMask = NULL; temporaryGrab->detail.exact = stuff->button; temporaryGrab->detail.pMask = NULL; DeletePassiveGrabFromList(temporaryGrab); FreeGrab(temporaryGrab); return Success; } ��������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/����������������������������������������������������������������������������0000775�0001751�0001751�00000000000�12466505443�012032� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/Makefile.am�����������������������������������������������������������������0000664�0001751�0001751�00000005041�12323563340�013776� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la AM_CFLAGS = $(DIX_CFLAGS) if XORG sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h syncsdk.h endif # 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 BUILTIN_LIBS = # Optional sources included if extension enabled by configure.ac rules # MIT Shared Memory extension MITSHM_SRCS = shm.c shmint.h if MITSHM BUILTIN_SRCS += $(MITSHM_SRCS) endif # XVideo extension XV_SRCS = xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h if XV BUILTIN_SRCS += $(XV_SRCS) endif # XResource extension: lets clients get data about per-client resource usage RES_SRCS = hashtable.c hashtable.h xres.c if RES BUILTIN_SRCS += $(RES_SRCS) endif # MIT ScreenSaver extension SCREENSAVER_SRCS = saver.c if SCREENSAVER BUILTIN_SRCS += $(SCREENSAVER_SRCS) endif # Xinerama extension: making multiple video devices act as one virtual screen XINERAMA_SRCS = panoramiX.c panoramiX.h panoramiXh.h panoramiXsrv.h panoramiXprocs.c panoramiXSwap.c if XINERAMA BUILTIN_SRCS += $(XINERAMA_SRCS) if XORG sdk_HEADERS += panoramiXsrv.h panoramiX.h endif endif # X-ACE extension: provides hooks for building security policy extensions # like XC-Security, X-SELinux & XTSol XACE_SRCS = xace.c xace.h xacestr.h if XACE BUILTIN_SRCS += $(XACE_SRCS) if XORG sdk_HEADERS += xace.h xacestr.h endif endif # SELinux extension: provides SELinux policy support for X objects # requires X-ACE extension XSELINUX_SRCS = xselinux_ext.c xselinux_hooks.c xselinux_label.c xselinux.h xselinuxint.h if XSELINUX BUILTIN_SRCS += $(XSELINUX_SRCS) BUILTIN_LIBS += $(SELINUX_LIBS) endif # Security extension: multi-level security to protect clients from each other XCSECURITY_SRCS = security.c securitysrv.h if XCSECURITY BUILTIN_SRCS += $(XCSECURITY_SRCS) endif # XF86 Big Font extension BIGFONT_SRCS = xf86bigfont.c xf86bigfontsrv.h if XF86BIGFONT BUILTIN_SRCS += $(BIGFONT_SRCS) endif # DPMS extension DPMS_SRCS = dpms.c dpmsproc.h if DPMSExtension 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) libXext_la_LIBADD = $(BUILTIN_LIBS) libXextdpmsstubs_la_SOURCES = dpmsstubs.c EXTRA_DIST = \ $(MITSHM_SRCS) \ $(XV_SRCS) \ $(RES_SRCS) \ $(SCREENSAVER_SRCS) \ $(XACE_SRCS) \ $(XCSECURITY_SRCS) \ $(XSELINUX_SRCS) \ $(XINERAMA_SRCS) \ $(BIGFONT_SRCS) \ $(DPMS_SRCS) \ $(GE_SRCS) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xvdisp.c��������������������������������������������������������������������0000664�0001751�0001751�00000136157�12456571574�013457� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, and the Massachusetts Institute of Technology, Cambridge, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "scrnintstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "gcstruct.h" #include "dixstruct.h" #include "resource.h" #include "opaque.h" #include <X11/extensions/Xv.h> #include <X11/extensions/Xvproto.h> #include "xvdix.h" #ifdef MITSHM #include <X11/extensions/shmproto.h> #include "shmint.h" #endif #include "xvdisp.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" unsigned long XvXRTPort; #endif static int SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->version); swaps(&rep->revision); WriteToClient(client, sz_xvQueryExtensionReply, rep); return Success; } static int SWriteQueryAdaptorsReply(ClientPtr client, xvQueryAdaptorsReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_adaptors); WriteToClient(client, sz_xvQueryAdaptorsReply, rep); return Success; } static int SWriteQueryEncodingsReply(ClientPtr client, xvQueryEncodingsReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_encodings); WriteToClient(client, sz_xvQueryEncodingsReply, rep); return Success; } static int SWriteAdaptorInfo(ClientPtr client, xvAdaptorInfo * pAdaptor) { swapl(&pAdaptor->base_id); swaps(&pAdaptor->name_size); swaps(&pAdaptor->num_ports); swaps(&pAdaptor->num_formats); WriteToClient(client, sz_xvAdaptorInfo, pAdaptor); return Success; } static int SWriteEncodingInfo(ClientPtr client, xvEncodingInfo * pEncoding) { swapl(&pEncoding->encoding); swaps(&pEncoding->name_size); swaps(&pEncoding->width); swaps(&pEncoding->height); swapl(&pEncoding->rate.numerator); swapl(&pEncoding->rate.denominator); WriteToClient(client, sz_xvEncodingInfo, pEncoding); return Success; } static int SWriteFormat(ClientPtr client, xvFormat * pFormat) { swapl(&pFormat->visual); WriteToClient(client, sz_xvFormat, pFormat); return Success; } static int SWriteAttributeInfo(ClientPtr client, xvAttributeInfo * pAtt) { swapl(&pAtt->flags); swapl(&pAtt->size); swapl(&pAtt->min); swapl(&pAtt->max); WriteToClient(client, sz_xvAttributeInfo, pAtt); return Success; } static int SWriteImageFormatInfo(ClientPtr client, xvImageFormatInfo * pImage) { swapl(&pImage->id); swapl(&pImage->red_mask); swapl(&pImage->green_mask); swapl(&pImage->blue_mask); swapl(&pImage->y_sample_bits); swapl(&pImage->u_sample_bits); swapl(&pImage->v_sample_bits); swapl(&pImage->horz_y_period); swapl(&pImage->horz_u_period); swapl(&pImage->horz_v_period); swapl(&pImage->vert_y_period); swapl(&pImage->vert_u_period); swapl(&pImage->vert_v_period); WriteToClient(client, sz_xvImageFormatInfo, pImage); return Success; } static int SWriteGrabPortReply(ClientPtr client, xvGrabPortReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); WriteToClient(client, sz_xvGrabPortReply, rep); return Success; } static int SWriteGetPortAttributeReply(ClientPtr client, xvGetPortAttributeReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->value); WriteToClient(client, sz_xvGetPortAttributeReply, rep); return Success; } static int SWriteQueryBestSizeReply(ClientPtr client, xvQueryBestSizeReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->actual_width); swaps(&rep->actual_height); WriteToClient(client, sz_xvQueryBestSizeReply, rep); return Success; } static int SWriteQueryPortAttributesReply(ClientPtr client, xvQueryPortAttributesReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->num_attributes); swapl(&rep->text_size); WriteToClient(client, sz_xvQueryPortAttributesReply, rep); return Success; } static int SWriteQueryImageAttributesReply(ClientPtr client, xvQueryImageAttributesReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->num_planes); swapl(&rep->data_size); swaps(&rep->width); swaps(&rep->height); WriteToClient(client, sz_xvQueryImageAttributesReply, rep); return Success; } static int SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->num_formats); WriteToClient(client, sz_xvListImageFormatsReply, rep); return Success; } #define _WriteQueryAdaptorsReply(_c,_d) \ if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \ else WriteToClient(_c, sz_xvQueryAdaptorsReply, _d) #define _WriteQueryExtensionReply(_c,_d) \ if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \ else WriteToClient(_c, sz_xvQueryExtensionReply, _d) #define _WriteQueryEncodingsReply(_c,_d) \ if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \ else WriteToClient(_c, sz_xvQueryEncodingsReply, _d) #define _WriteAdaptorInfo(_c,_d) \ if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \ else WriteToClient(_c, sz_xvAdaptorInfo, _d) #define _WriteAttributeInfo(_c,_d) \ if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \ else WriteToClient(_c, sz_xvAttributeInfo, _d) #define _WriteEncodingInfo(_c,_d) \ if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \ else WriteToClient(_c, sz_xvEncodingInfo, _d) #define _WriteFormat(_c,_d) \ if ((_c)->swapped) SWriteFormat(_c, _d); \ else WriteToClient(_c, sz_xvFormat, _d) #define _WriteGrabPortReply(_c,_d) \ if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \ else WriteToClient(_c, sz_xvGrabPortReply, _d) #define _WriteGetPortAttributeReply(_c,_d) \ if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \ else WriteToClient(_c, sz_xvGetPortAttributeReply, _d) #define _WriteQueryBestSizeReply(_c,_d) \ if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \ else WriteToClient(_c, sz_xvQueryBestSizeReply, _d) #define _WriteQueryPortAttributesReply(_c,_d) \ if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \ else WriteToClient(_c, sz_xvQueryPortAttributesReply, _d) #define _WriteQueryImageAttributesReply(_c,_d) \ if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \ else WriteToClient(_c, sz_xvQueryImageAttributesReply, _d) #define _WriteListImageFormatsReply(_c,_d) \ if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \ else WriteToClient(_c, sz_xvListImageFormatsReply, _d) #define _WriteImageFormatInfo(_c,_d) \ if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ else WriteToClient(_c, sz_xvImageFormatInfo, _d) static int ProcXvQueryExtension(ClientPtr client) { xvQueryExtensionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .version = XvVersion, .revision = XvRevision }; /* REQUEST(xvQueryExtensionReq); */ REQUEST_SIZE_MATCH(xvQueryExtensionReq); _WriteQueryExtensionReply(client, &rep); return Success; } static int ProcXvQueryAdaptors(ClientPtr client) { xvFormat format; xvAdaptorInfo ainfo; xvQueryAdaptorsReply rep; int totalSize, na, nf, rc; int nameSize; XvAdaptorPtr pa; XvFormatPtr pf; WindowPtr pWin; ScreenPtr pScreen; XvScreenPtr pxvs; REQUEST(xvQueryAdaptorsReq); REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; pScreen = pWin->drawable.pScreen; pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvGetScreenKey()); if (!pxvs) { rep = (xvQueryAdaptorsReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .num_adaptors = 0 }; _WriteQueryAdaptorsReply(client, &rep); return Success; } rep = (xvQueryAdaptorsReply) { .type = X_Reply, .sequenceNumber = client->sequence, .num_adaptors = pxvs->nAdaptors }; /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */ totalSize = pxvs->nAdaptors * sz_xvAdaptorInfo; /* FOR EACH ADPATOR ADD UP THE BYTES FOR ENCODINGS AND FORMATS */ na = pxvs->nAdaptors; pa = pxvs->pAdaptors; while (na--) { totalSize += pad_to_int32(strlen(pa->name)); totalSize += pa->nFormats * sz_xvFormat; pa++; } rep.length = bytes_to_int32(totalSize); _WriteQueryAdaptorsReply(client, &rep); na = pxvs->nAdaptors; pa = pxvs->pAdaptors; while (na--) { ainfo.base_id = pa->base_id; ainfo.num_ports = pa->nPorts; ainfo.type = pa->type; ainfo.name_size = nameSize = strlen(pa->name); ainfo.num_formats = pa->nFormats; _WriteAdaptorInfo(client, &ainfo); WriteToClient(client, nameSize, pa->name); nf = pa->nFormats; pf = pa->pFormats; while (nf--) { format.depth = pf->depth; format.visual = pf->visual; _WriteFormat(client, &format); pf++; } pa++; } return Success; } static int ProcXvQueryEncodings(ClientPtr client) { xvEncodingInfo einfo; xvQueryEncodingsReply rep; int totalSize; int nameSize; XvPortPtr pPort; int ne; XvEncodingPtr pe; REQUEST(xvQueryEncodingsReq); REQUEST_SIZE_MATCH(xvQueryEncodingsReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); rep = (xvQueryEncodingsReply) { .type = X_Reply, .sequenceNumber = client->sequence, .num_encodings = pPort->pAdaptor->nEncodings }; /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */ ne = pPort->pAdaptor->nEncodings; pe = pPort->pAdaptor->pEncodings; totalSize = ne * sz_xvEncodingInfo; while (ne--) { totalSize += pad_to_int32(strlen(pe->name)); pe++; } rep.length = bytes_to_int32(totalSize); _WriteQueryEncodingsReply(client, &rep); ne = pPort->pAdaptor->nEncodings; pe = pPort->pAdaptor->pEncodings; while (ne--) { einfo.encoding = pe->id; einfo.name_size = nameSize = strlen(pe->name); einfo.width = pe->width; einfo.height = pe->height; einfo.rate.numerator = pe->rate.numerator; einfo.rate.denominator = pe->rate.denominator; _WriteEncodingInfo(client, &einfo); WriteToClient(client, nameSize, pe->name); pe++; } return Success; } static int ProcXvPutVideo(ClientPtr client) { DrawablePtr pDraw; XvPortPtr pPort; GCPtr pGC; int status; REQUEST(xvPutVideoReq); REQUEST_SIZE_MATCH(xvPutVideoReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if (!(pPort->pAdaptor->type & XvInputMask) || !(pPort->pAdaptor->type & XvVideoMask)) { client->errorValue = stuff->port; return BadMatch; } status = XvdiMatchPort(pPort, pDraw); if (status != Success) { return status; } return XvdiPutVideo(client, pDraw, pPort, pGC, stuff->vid_x, stuff->vid_y, stuff->vid_w, stuff->vid_h, stuff->drw_x, stuff->drw_y, stuff->drw_w, stuff->drw_h); } static int ProcXvPutStill(ClientPtr client) { DrawablePtr pDraw; XvPortPtr pPort; GCPtr pGC; int status; REQUEST(xvPutStillReq); REQUEST_SIZE_MATCH(xvPutStillReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if (!(pPort->pAdaptor->type & XvInputMask) || !(pPort->pAdaptor->type & XvStillMask)) { client->errorValue = stuff->port; return BadMatch; } status = XvdiMatchPort(pPort, pDraw); if (status != Success) { return status; } return XvdiPutStill(client, pDraw, pPort, pGC, stuff->vid_x, stuff->vid_y, stuff->vid_w, stuff->vid_h, stuff->drw_x, stuff->drw_y, stuff->drw_w, stuff->drw_h); } static int ProcXvGetVideo(ClientPtr client) { DrawablePtr pDraw; XvPortPtr pPort; GCPtr pGC; int status; REQUEST(xvGetVideoReq); REQUEST_SIZE_MATCH(xvGetVideoReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if (!(pPort->pAdaptor->type & XvOutputMask) || !(pPort->pAdaptor->type & XvVideoMask)) { client->errorValue = stuff->port; return BadMatch; } status = XvdiMatchPort(pPort, pDraw); if (status != Success) { return status; } return XvdiGetVideo(client, pDraw, pPort, pGC, stuff->vid_x, stuff->vid_y, stuff->vid_w, stuff->vid_h, stuff->drw_x, stuff->drw_y, stuff->drw_w, stuff->drw_h); } static int ProcXvGetStill(ClientPtr client) { DrawablePtr pDraw; XvPortPtr pPort; GCPtr pGC; int status; REQUEST(xvGetStillReq); REQUEST_SIZE_MATCH(xvGetStillReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if (!(pPort->pAdaptor->type & XvOutputMask) || !(pPort->pAdaptor->type & XvStillMask)) { client->errorValue = stuff->port; return BadMatch; } status = XvdiMatchPort(pPort, pDraw); if (status != Success) { return status; } return XvdiGetStill(client, pDraw, pPort, pGC, stuff->vid_x, stuff->vid_y, stuff->vid_w, stuff->vid_h, stuff->drw_x, stuff->drw_y, stuff->drw_w, stuff->drw_h); } static int ProcXvSelectVideoNotify(ClientPtr client) { DrawablePtr pDraw; int rc; REQUEST(xvSelectVideoNotifyReq); REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReceiveAccess); if (rc != Success) return rc; return XvdiSelectVideoNotify(client, pDraw, stuff->onoff); } static int ProcXvSelectPortNotify(ClientPtr client) { XvPortPtr pPort; REQUEST(xvSelectPortNotifyReq); REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); return XvdiSelectPortNotify(client, pPort, stuff->onoff); } static int ProcXvGrabPort(ClientPtr client) { int result, status; XvPortPtr pPort; xvGrabPortReply rep; REQUEST(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); status = XvdiGrabPort(client, pPort, stuff->time, &result); if (status != Success) { return status; } rep = (xvGrabPortReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .result = result }; _WriteGrabPortReply(client, &rep); return Success; } static int ProcXvUngrabPort(ClientPtr client) { XvPortPtr pPort; REQUEST(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); return XvdiUngrabPort(client, pPort, stuff->time); } static int ProcXvStopVideo(ClientPtr client) { int ret; DrawablePtr pDraw; XvPortPtr pPort; REQUEST(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); if (ret != Success) return ret; return XvdiStopVideo(client, pPort, pDraw); } static int ProcXvSetPortAttribute(ClientPtr client) { int status; XvPortPtr pPort; REQUEST(xvSetPortAttributeReq); REQUEST_SIZE_MATCH(xvSetPortAttributeReq); VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess); if (!ValidAtom(stuff->attribute)) { client->errorValue = stuff->attribute; return BadAtom; } status = XvdiSetPortAttribute(client, pPort, stuff->attribute, stuff->value); if (status == BadMatch) client->errorValue = stuff->attribute; else client->errorValue = stuff->value; return status; } static int ProcXvGetPortAttribute(ClientPtr client) { INT32 value; int status; XvPortPtr pPort; xvGetPortAttributeReply rep; REQUEST(xvGetPortAttributeReq); REQUEST_SIZE_MATCH(xvGetPortAttributeReq); VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess); if (!ValidAtom(stuff->attribute)) { client->errorValue = stuff->attribute; return BadAtom; } status = XvdiGetPortAttribute(client, pPort, stuff->attribute, &value); if (status != Success) { client->errorValue = stuff->attribute; return status; } rep = (xvGetPortAttributeReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .value = value }; _WriteGetPortAttributeReply(client, &rep); return Success; } static int ProcXvQueryBestSize(ClientPtr client) { unsigned int actual_width, actual_height; XvPortPtr pPort; xvQueryBestSizeReply rep; REQUEST(xvQueryBestSizeReq); REQUEST_SIZE_MATCH(xvQueryBestSizeReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); (*pPort->pAdaptor->ddQueryBestSize) (pPort, stuff->motion, stuff->vid_w, stuff->vid_h, stuff->drw_w, stuff->drw_h, &actual_width, &actual_height); rep = (xvQueryBestSizeReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .actual_width = actual_width, .actual_height = actual_height }; _WriteQueryBestSizeReply(client, &rep); return Success; } static int ProcXvQueryPortAttributes(ClientPtr client) { int size, i; XvPortPtr pPort; XvAttributePtr pAtt; xvQueryPortAttributesReply rep; xvAttributeInfo Info; REQUEST(xvQueryPortAttributesReq); REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess); 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++) { rep.text_size += pad_to_int32(strlen(pAtt->name) + 1); } rep.length = (pPort->pAdaptor->nAttributes * sz_xvAttributeInfo) + rep.text_size; rep.length >>= 2; _WriteQueryPortAttributesReply(client, &rep); for (i = 0, pAtt = pPort->pAdaptor->pAttributes; i < pPort->pAdaptor->nAttributes; i++, pAtt++) { size = strlen(pAtt->name) + 1; /* pass the NULL */ Info.flags = pAtt->flags; Info.min = pAtt->min_value; Info.max = pAtt->max_value; Info.size = pad_to_int32(size); _WriteAttributeInfo(client, &Info); WriteToClient(client, size, pAtt->name); } return Success; } static int ProcXvPutImage(ClientPtr client) { DrawablePtr pDraw; XvPortPtr pPort; XvImagePtr pImage = NULL; GCPtr pGC; int status, i, size; CARD16 width, height; REQUEST(xvPutImageReq); REQUEST_AT_LEAST_SIZE(xvPutImageReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if (!(pPort->pAdaptor->type & XvImageMask) || !(pPort->pAdaptor->type & XvInputMask)) { client->errorValue = stuff->port; return BadMatch; } status = XvdiMatchPort(pPort, pDraw); if (status != Success) { return status; } for (i = 0; i < pPort->pAdaptor->nImages; i++) { if (pPort->pAdaptor->pImages[i].id == stuff->id) { pImage = &(pPort->pAdaptor->pImages[i]); break; } } if (!pImage) return BadMatch; width = stuff->width; height = stuff->height; size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); size += sizeof(xvPutImageReq); size = bytes_to_int32(size); if ((width < stuff->width) || (height < stuff->height)) return BadValue; if (client->req_len < size) return BadLength; return XvdiPutImage(client, pDraw, pPort, pGC, stuff->src_x, stuff->src_y, stuff->src_w, stuff->src_h, stuff->drw_x, stuff->drw_y, stuff->drw_w, stuff->drw_h, pImage, (unsigned char *) (&stuff[1]), FALSE, stuff->width, stuff->height); } #ifdef MITSHM static int ProcXvShmPutImage(ClientPtr client) { ShmDescPtr shmdesc; DrawablePtr pDraw; XvPortPtr pPort; XvImagePtr pImage = NULL; GCPtr pGC; int status, size_needed, i; CARD16 width, height; REQUEST(xvShmPutImageReq); REQUEST_SIZE_MATCH(xvShmPutImageReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if (!(pPort->pAdaptor->type & XvImageMask) || !(pPort->pAdaptor->type & XvInputMask)) { client->errorValue = stuff->port; return BadMatch; } status = XvdiMatchPort(pPort, pDraw); if (status != Success) { return status; } for (i = 0; i < pPort->pAdaptor->nImages; i++) { if (pPort->pAdaptor->pImages[i].id == stuff->id) { pImage = &(pPort->pAdaptor->pImages[i]); break; } } if (!pImage) return BadMatch; status = dixLookupResourceByType((void **) &shmdesc, stuff->shmseg, ShmSegType, serverClient, DixReadAccess); if (status != Success) return status; width = stuff->width; height = stuff->height; size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); if ((size_needed + stuff->offset) > shmdesc->size) return BadAccess; if ((width < stuff->width) || (height < stuff->height)) return BadValue; status = XvdiPutImage(client, pDraw, pPort, pGC, stuff->src_x, stuff->src_y, stuff->src_w, stuff->src_h, stuff->drw_x, stuff->drw_y, stuff->drw_w, stuff->drw_h, pImage, (unsigned char *) shmdesc->addr + stuff->offset, stuff->send_event, stuff->width, stuff->height); if ((status == Success) && stuff->send_event) { xShmCompletionEvent ev = { .type = ShmCompletionCode, .drawable = stuff->drawable, .minorEvent = xv_ShmPutImage, .majorEvent = XvReqCode, .shmseg = stuff->shmseg, .offset = stuff->offset }; WriteEventsToClient(client, 1, (xEvent *) &ev); } return status; } #else /* !MITSHM */ static int ProcXvShmPutImage(ClientPtr client) { SendErrorToClient(client, XvReqCode, xv_ShmPutImage, 0, BadImplementation); return BadImplementation; } #endif #ifdef XvMCExtension #include "xvmcext.h" #endif static int ProcXvQueryImageAttributes(ClientPtr client) { xvQueryImageAttributesReply rep; int size, num_planes, i; CARD16 width, height; XvImagePtr pImage = NULL; XvPortPtr pPort; int *offsets; int *pitches; int planeLength; REQUEST(xvQueryImageAttributesReq); REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); for (i = 0; i < pPort->pAdaptor->nImages; i++) { if (pPort->pAdaptor->pImages[i].id == stuff->id) { pImage = &(pPort->pAdaptor->pImages[i]); break; } } #ifdef XvMCExtension if (!pImage) pImage = XvMCFindXvImage(pPort, stuff->id); #endif if (!pImage) return BadMatch; num_planes = pImage->num_planes; if (!(offsets = malloc(num_planes << 3))) return BadAlloc; pitches = offsets + num_planes; width = stuff->width; height = stuff->height; size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, offsets, pitches); 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, offsets); free(offsets); return Success; } static int ProcXvListImageFormats(ClientPtr client) { XvPortPtr pPort; XvImagePtr pImage; int i; xvListImageFormatsReply rep; xvImageFormatInfo info; REQUEST(xvListImageFormatsReq); REQUEST_SIZE_MATCH(xvListImageFormatsReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); 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); pImage = pPort->pAdaptor->pImages; for (i = 0; i < pPort->pAdaptor->nImages; i++, pImage++) { info.id = pImage->id; info.type = pImage->type; info.byte_order = pImage->byte_order; memcpy(&info.guid, pImage->guid, 16); info.bpp = pImage->bits_per_pixel; info.num_planes = pImage->num_planes; info.depth = pImage->depth; info.red_mask = pImage->red_mask; info.green_mask = pImage->green_mask; info.blue_mask = pImage->blue_mask; info.format = pImage->format; info.y_sample_bits = pImage->y_sample_bits; info.u_sample_bits = pImage->u_sample_bits; info.v_sample_bits = pImage->v_sample_bits; info.horz_y_period = pImage->horz_y_period; info.horz_u_period = pImage->horz_u_period; info.horz_v_period = pImage->horz_v_period; info.vert_y_period = pImage->vert_y_period; info.vert_u_period = pImage->vert_u_period; info.vert_v_period = pImage->vert_v_period; memcpy(&info.comp_order, pImage->component_order, 32); info.scanline_order = pImage->scanline_order; _WriteImageFormatInfo(client, &info); } return Success; } static int (*XvProcVector[xvNumRequests]) (ClientPtr) = { ProcXvQueryExtension, ProcXvQueryAdaptors, ProcXvQueryEncodings, ProcXvGrabPort, ProcXvUngrabPort, ProcXvPutVideo, ProcXvPutStill, ProcXvGetVideo, ProcXvGetStill, ProcXvStopVideo, ProcXvSelectVideoNotify, ProcXvSelectPortNotify, ProcXvQueryBestSize, ProcXvSetPortAttribute, ProcXvGetPortAttribute, ProcXvQueryPortAttributes, ProcXvListImageFormats, ProcXvQueryImageAttributes, ProcXvPutImage, ProcXvShmPutImage,}; int ProcXvDispatch(ClientPtr client) { REQUEST(xReq); UpdateCurrentTime(); if (stuff->data >= xvNumRequests) { SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); return BadRequest; } return XvProcVector[stuff->data] (client); } /* Swapped Procs */ static int SProcXvQueryExtension(ClientPtr client) { REQUEST(xvQueryExtensionReq); REQUEST_SIZE_MATCH(xvQueryExtensionReq); swaps(&stuff->length); return XvProcVector[xv_QueryExtension] (client); } static int SProcXvQueryAdaptors(ClientPtr client) { REQUEST(xvQueryAdaptorsReq); REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); swaps(&stuff->length); swapl(&stuff->window); return XvProcVector[xv_QueryAdaptors] (client); } static int SProcXvQueryEncodings(ClientPtr client) { REQUEST(xvQueryEncodingsReq); REQUEST_SIZE_MATCH(xvQueryEncodingsReq); swaps(&stuff->length); swapl(&stuff->port); return XvProcVector[xv_QueryEncodings] (client); } static int SProcXvGrabPort(ClientPtr client) { REQUEST(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->time); return XvProcVector[xv_GrabPort] (client); } static int SProcXvUngrabPort(ClientPtr client) { REQUEST(xvUngrabPortReq); REQUEST_SIZE_MATCH(xvUngrabPortReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->time); return XvProcVector[xv_UngrabPort] (client); } static int SProcXvPutVideo(ClientPtr client) { REQUEST(xvPutVideoReq); REQUEST_SIZE_MATCH(xvPutVideoReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->vid_x); swaps(&stuff->vid_y); swaps(&stuff->vid_w); swaps(&stuff->vid_h); swaps(&stuff->drw_x); swaps(&stuff->drw_y); swaps(&stuff->drw_w); swaps(&stuff->drw_h); return XvProcVector[xv_PutVideo] (client); } static int SProcXvPutStill(ClientPtr client) { REQUEST(xvPutStillReq); REQUEST_SIZE_MATCH(xvPutStillReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->vid_x); swaps(&stuff->vid_y); swaps(&stuff->vid_w); swaps(&stuff->vid_h); swaps(&stuff->drw_x); swaps(&stuff->drw_y); swaps(&stuff->drw_w); swaps(&stuff->drw_h); return XvProcVector[xv_PutStill] (client); } static int SProcXvGetVideo(ClientPtr client) { REQUEST(xvGetVideoReq); REQUEST_SIZE_MATCH(xvGetVideoReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->vid_x); swaps(&stuff->vid_y); swaps(&stuff->vid_w); swaps(&stuff->vid_h); swaps(&stuff->drw_x); swaps(&stuff->drw_y); swaps(&stuff->drw_w); swaps(&stuff->drw_h); return XvProcVector[xv_GetVideo] (client); } static int SProcXvGetStill(ClientPtr client) { REQUEST(xvGetStillReq); REQUEST_SIZE_MATCH(xvGetStillReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->vid_x); swaps(&stuff->vid_y); swaps(&stuff->vid_w); swaps(&stuff->vid_h); swaps(&stuff->drw_x); swaps(&stuff->drw_y); swaps(&stuff->drw_w); swaps(&stuff->drw_h); return XvProcVector[xv_GetStill] (client); } static int SProcXvPutImage(ClientPtr client) { REQUEST(xvPutImageReq); REQUEST_AT_LEAST_SIZE(xvPutImageReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->drawable); swapl(&stuff->gc); swapl(&stuff->id); swaps(&stuff->src_x); swaps(&stuff->src_y); swaps(&stuff->src_w); swaps(&stuff->src_h); swaps(&stuff->drw_x); swaps(&stuff->drw_y); swaps(&stuff->drw_w); swaps(&stuff->drw_h); swaps(&stuff->width); swaps(&stuff->height); return XvProcVector[xv_PutImage] (client); } #ifdef MITSHM static int SProcXvShmPutImage(ClientPtr client) { REQUEST(xvShmPutImageReq); REQUEST_SIZE_MATCH(xvShmPutImageReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->drawable); swapl(&stuff->gc); swapl(&stuff->shmseg); swapl(&stuff->id); swapl(&stuff->offset); swaps(&stuff->src_x); swaps(&stuff->src_y); swaps(&stuff->src_w); swaps(&stuff->src_h); swaps(&stuff->drw_x); swaps(&stuff->drw_y); swaps(&stuff->drw_w); swaps(&stuff->drw_h); swaps(&stuff->width); swaps(&stuff->height); return XvProcVector[xv_ShmPutImage] (client); } #else /* MITSHM */ #define SProcXvShmPutImage ProcXvShmPutImage #endif static int SProcXvSelectVideoNotify(ClientPtr client) { REQUEST(xvSelectVideoNotifyReq); REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); swaps(&stuff->length); swapl(&stuff->drawable); return XvProcVector[xv_SelectVideoNotify] (client); } static int SProcXvSelectPortNotify(ClientPtr client) { REQUEST(xvSelectPortNotifyReq); REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); swaps(&stuff->length); swapl(&stuff->port); return XvProcVector[xv_SelectPortNotify] (client); } static int SProcXvStopVideo(ClientPtr client) { REQUEST(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->drawable); return XvProcVector[xv_StopVideo] (client); } static int SProcXvSetPortAttribute(ClientPtr client) { REQUEST(xvSetPortAttributeReq); REQUEST_SIZE_MATCH(xvSetPortAttributeReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->attribute); swapl(&stuff->value); return XvProcVector[xv_SetPortAttribute] (client); } static int SProcXvGetPortAttribute(ClientPtr client) { REQUEST(xvGetPortAttributeReq); REQUEST_SIZE_MATCH(xvGetPortAttributeReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->attribute); return XvProcVector[xv_GetPortAttribute] (client); } static int SProcXvQueryBestSize(ClientPtr client) { REQUEST(xvQueryBestSizeReq); REQUEST_SIZE_MATCH(xvQueryBestSizeReq); swaps(&stuff->length); swapl(&stuff->port); swaps(&stuff->vid_w); swaps(&stuff->vid_h); swaps(&stuff->drw_w); swaps(&stuff->drw_h); return XvProcVector[xv_QueryBestSize] (client); } static int SProcXvQueryPortAttributes(ClientPtr client) { REQUEST(xvQueryPortAttributesReq); REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); swaps(&stuff->length); swapl(&stuff->port); return XvProcVector[xv_QueryPortAttributes] (client); } static int SProcXvQueryImageAttributes(ClientPtr client) { REQUEST(xvQueryImageAttributesReq); REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); swaps(&stuff->length); swapl(&stuff->port); swapl(&stuff->id); swaps(&stuff->width); swaps(&stuff->height); return XvProcVector[xv_QueryImageAttributes] (client); } static int SProcXvListImageFormats(ClientPtr client) { REQUEST(xvListImageFormatsReq); REQUEST_SIZE_MATCH(xvListImageFormatsReq); swaps(&stuff->length); swapl(&stuff->port); return XvProcVector[xv_ListImageFormats] (client); } static int (*SXvProcVector[xvNumRequests]) (ClientPtr) = { SProcXvQueryExtension, SProcXvQueryAdaptors, SProcXvQueryEncodings, SProcXvGrabPort, SProcXvUngrabPort, SProcXvPutVideo, SProcXvPutStill, SProcXvGetVideo, SProcXvGetStill, SProcXvStopVideo, SProcXvSelectVideoNotify, SProcXvSelectPortNotify, SProcXvQueryBestSize, SProcXvSetPortAttribute, SProcXvGetPortAttribute, SProcXvQueryPortAttributes, SProcXvListImageFormats, SProcXvQueryImageAttributes, SProcXvPutImage, SProcXvShmPutImage,}; int SProcXvDispatch(ClientPtr client) { REQUEST(xReq); UpdateCurrentTime(); if (stuff->data >= xvNumRequests) { SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); return BadRequest; } return SXvProcVector[stuff->data] (client); } #ifdef PANORAMIX static int XineramaXvStopVideo(ClientPtr client) { int result, i; PanoramiXRes *draw, *port; REQUEST(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(i) { if (port->info[i].id) { stuff->drawable = draw->info[i].id; stuff->port = port->info[i].id; result = ProcXvStopVideo(client); } } return result; } static int XineramaXvSetPortAttribute(ClientPtr client) { REQUEST(xvSetPortAttributeReq); PanoramiXRes *port; int result, i; REQUEST_SIZE_MATCH(xvSetPortAttributeReq); result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(i) { if (port->info[i].id) { stuff->port = port->info[i].id; result = ProcXvSetPortAttribute(client); } } return result; } #ifdef MITSHM static int XineramaXvShmPutImage(ClientPtr client) { REQUEST(xvShmPutImageReq); PanoramiXRes *draw, *gc, *port; Bool send_event = stuff->send_event; Bool isRoot; int result, i, x, y; REQUEST_SIZE_MATCH(xvShmPutImageReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; FOR_NSCREENS_BACKWARD(i) { if (port->info[i].id) { stuff->drawable = draw->info[i].id; stuff->port = port->info[i].id; stuff->gc = gc->info[i].id; stuff->drw_x = x; stuff->drw_y = y; if (isRoot) { stuff->drw_x -= screenInfo.screens[i]->x; stuff->drw_y -= screenInfo.screens[i]->y; } stuff->send_event = (send_event && !i) ? 1 : 0; result = ProcXvShmPutImage(client); } } return result; } #else #define XineramaXvShmPutImage ProcXvShmPutImage #endif static int XineramaXvPutImage(ClientPtr client) { REQUEST(xvPutImageReq); PanoramiXRes *draw, *gc, *port; Bool isRoot; int result, i, x, y; REQUEST_AT_LEAST_SIZE(xvPutImageReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; FOR_NSCREENS_BACKWARD(i) { if (port->info[i].id) { stuff->drawable = draw->info[i].id; stuff->port = port->info[i].id; stuff->gc = gc->info[i].id; stuff->drw_x = x; stuff->drw_y = y; if (isRoot) { stuff->drw_x -= screenInfo.screens[i]->x; stuff->drw_y -= screenInfo.screens[i]->y; } result = ProcXvPutImage(client); } } return result; } static int XineramaXvPutVideo(ClientPtr client) { REQUEST(xvPutImageReq); PanoramiXRes *draw, *gc, *port; Bool isRoot; int result, i, x, y; REQUEST_AT_LEAST_SIZE(xvPutVideoReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; FOR_NSCREENS_BACKWARD(i) { if (port->info[i].id) { stuff->drawable = draw->info[i].id; stuff->port = port->info[i].id; stuff->gc = gc->info[i].id; stuff->drw_x = x; stuff->drw_y = y; if (isRoot) { stuff->drw_x -= screenInfo.screens[i]->x; stuff->drw_y -= screenInfo.screens[i]->y; } result = ProcXvPutVideo(client); } } return result; } static int XineramaXvPutStill(ClientPtr client) { REQUEST(xvPutImageReq); PanoramiXRes *draw, *gc, *port; Bool isRoot; int result, i, x, y; REQUEST_AT_LEAST_SIZE(xvPutImageReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; x = stuff->drw_x; y = stuff->drw_y; FOR_NSCREENS_BACKWARD(i) { if (port->info[i].id) { stuff->drawable = draw->info[i].id; stuff->port = port->info[i].id; stuff->gc = gc->info[i].id; stuff->drw_x = x; stuff->drw_y = y; if (isRoot) { stuff->drw_x -= screenInfo.screens[i]->x; stuff->drw_y -= screenInfo.screens[i]->y; } result = ProcXvPutStill(client); } } return result; } static Bool isImageAdaptor(XvAdaptorPtr pAdapt) { return (pAdapt->type & XvImageMask) && (pAdapt->nImages > 0); } static Bool hasOverlay(XvAdaptorPtr pAdapt) { int i; for (i = 0; i < pAdapt->nAttributes; i++) if (!strcmp(pAdapt->pAttributes[i].name, "XV_COLORKEY")) return TRUE; return FALSE; } static XvAdaptorPtr matchAdaptor(ScreenPtr pScreen, XvAdaptorPtr refAdapt, Bool isOverlay) { int i; XvScreenPtr xvsp = dixLookupPrivate(&pScreen->devPrivates, XvGetScreenKey()); /* Do not try to go on if xv is not supported on this screen */ if (xvsp == NULL) return NULL; /* if the adaptor has the same name it's a perfect match */ for (i = 0; i < xvsp->nAdaptors; i++) { XvAdaptorPtr pAdapt = xvsp->pAdaptors + i; if (!strcmp(refAdapt->name, pAdapt->name)) return pAdapt; } /* otherwise we only look for XvImage adaptors */ if (!isImageAdaptor(refAdapt)) return NULL; /* prefer overlay/overlay non-overlay/non-overlay pairing */ for (i = 0; i < xvsp->nAdaptors; i++) { XvAdaptorPtr pAdapt = xvsp->pAdaptors + i; if (isImageAdaptor(pAdapt) && isOverlay == hasOverlay(pAdapt)) return pAdapt; } /* but we'll take any XvImage pairing if we can get it */ for (i = 0; i < xvsp->nAdaptors; i++) { XvAdaptorPtr pAdapt = xvsp->pAdaptors + i; if (isImageAdaptor(pAdapt)) return pAdapt; } return NULL; } void XineramifyXv(void) { XvScreenPtr xvsp0 = dixLookupPrivate(&screenInfo.screens[0]->devPrivates, XvGetScreenKey()); XvAdaptorPtr MatchingAdaptors[MAXSCREENS]; int i, j, k; XvXRTPort = CreateNewResourceType(XineramaDeleteResource, "XvXRTPort"); if (!xvsp0 || !XvXRTPort) return; SetResourceTypeErrorValue(XvXRTPort, _XvBadPort); for (i = 0; i < xvsp0->nAdaptors; i++) { Bool isOverlay; XvAdaptorPtr refAdapt = xvsp0->pAdaptors + i; if (!(refAdapt->type & XvInputMask)) continue; MatchingAdaptors[0] = refAdapt; isOverlay = hasOverlay(refAdapt); FOR_NSCREENS_FORWARD_SKIP(j) MatchingAdaptors[j] = matchAdaptor(screenInfo.screens[j], refAdapt, isOverlay); /* now create a resource for each port */ for (j = 0; j < refAdapt->nPorts; j++) { PanoramiXRes *port = malloc(sizeof(PanoramiXRes)); if (!port) break; FOR_NSCREENS(k) { if (MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) port->info[k].id = MatchingAdaptors[k]->base_id + j; else port->info[k].id = 0; } AddResource(port->info[0].id, XvXRTPort, port); } } /* munge the dispatch vector */ XvProcVector[xv_PutVideo] = XineramaXvPutVideo; XvProcVector[xv_PutStill] = XineramaXvPutStill; XvProcVector[xv_StopVideo] = XineramaXvStopVideo; XvProcVector[xv_SetPortAttribute] = XineramaXvSetPortAttribute; XvProcVector[xv_PutImage] = XineramaXvPutImage; XvProcVector[xv_ShmPutImage] = XineramaXvShmPutImage; } #endif /* PANORAMIX */ void XvResetProcVector(void) { #ifdef PANORAMIX XvProcVector[xv_PutVideo] = ProcXvPutVideo; XvProcVector[xv_PutStill] = ProcXvPutStill; XvProcVector[xv_StopVideo] = ProcXvStopVideo; XvProcVector[xv_SetPortAttribute] = ProcXvSetPortAttribute; XvProcVector[xv_PutImage] = ProcXvPutImage; XvProcVector[xv_ShmPutImage] = ProcXvShmPutImage; #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/syncsdk.h�������������������������������������������������������������������0000664�0001751�0001751�00000003406�12274325511�013575� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2010 NVIDIA Corporation * * 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 _SYNCSDK_H_ #define _SYNCSDK_H_ #include "misync.h" extern _X_EXPORT int SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode); #define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \ do { \ int rc; \ rc = SyncVerifyFence(&(pFence), (fid), (client), (mode)); \ if (Success != rc) return rc; \ } while (0) #define VERIFY_SYNC_FENCE_OR_NONE(pFence, fid, client, mode) \ do { \ pFence = 0; \ if (None != fid) \ VERIFY_SYNC_FENCE((pFence), (fid), (client), (mode)); \ } while (0) #endif /* _SYNCSDK_H_ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/panoramiXh.h����������������������������������������������������������������0000664�0001751�0001751�00000006163�12274325511�014230� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ /* * Server dispatcher function replacements */ extern int PanoramiXCreateWindow(ClientPtr client); extern int PanoramiXChangeWindowAttributes(ClientPtr client); extern int PanoramiXDestroyWindow(ClientPtr client); extern int PanoramiXDestroySubwindows(ClientPtr client); extern int PanoramiXChangeSaveSet(ClientPtr client); extern int PanoramiXReparentWindow(ClientPtr client); extern int PanoramiXMapWindow(ClientPtr client); extern int PanoramiXMapSubwindows(ClientPtr client); extern int PanoramiXUnmapWindow(ClientPtr client); extern int PanoramiXUnmapSubwindows(ClientPtr client); extern int PanoramiXConfigureWindow(ClientPtr client); extern int PanoramiXCirculateWindow(ClientPtr client); extern int PanoramiXGetGeometry(ClientPtr client); extern int PanoramiXTranslateCoords(ClientPtr client); extern int PanoramiXCreatePixmap(ClientPtr client); extern int PanoramiXFreePixmap(ClientPtr client); extern int PanoramiXChangeGC(ClientPtr client); extern int PanoramiXCopyGC(ClientPtr client); extern int PanoramiXCopyColormapAndFree(ClientPtr client); extern int PanoramiXCreateGC(ClientPtr client); extern int PanoramiXSetDashes(ClientPtr client); extern int PanoramiXSetClipRectangles(ClientPtr client); extern int PanoramiXFreeGC(ClientPtr client); extern int PanoramiXClearToBackground(ClientPtr client); extern int PanoramiXCopyArea(ClientPtr client); extern int PanoramiXCopyPlane(ClientPtr client); extern int PanoramiXPolyPoint(ClientPtr client); extern int PanoramiXPolyLine(ClientPtr client); extern int PanoramiXPolySegment(ClientPtr client); extern int PanoramiXPolyRectangle(ClientPtr client); extern int PanoramiXPolyArc(ClientPtr client); extern int PanoramiXFillPoly(ClientPtr client); extern int PanoramiXPolyFillArc(ClientPtr client); extern int PanoramiXPolyFillRectangle(ClientPtr client); extern int PanoramiXPutImage(ClientPtr client); extern int PanoramiXGetImage(ClientPtr client); extern int PanoramiXPolyText8(ClientPtr client); extern int PanoramiXPolyText16(ClientPtr client); extern int PanoramiXImageText8(ClientPtr client); extern int PanoramiXImageText16(ClientPtr client); extern int PanoramiXCreateColormap(ClientPtr client); extern int PanoramiXFreeColormap(ClientPtr client); extern int PanoramiXInstallColormap(ClientPtr client); extern int PanoramiXUninstallColormap(ClientPtr client); extern int PanoramiXAllocColor(ClientPtr client); extern int PanoramiXAllocNamedColor(ClientPtr client); extern int PanoramiXAllocColorCells(ClientPtr client); extern int PanoramiXStoreNamedColor(ClientPtr client); extern int PanoramiXFreeColors(ClientPtr client); extern int PanoramiXStoreColors(ClientPtr client); extern int PanoramiXAllocColorPlanes(ClientPtr client); #define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr) PROC_EXTERN(ProcPanoramiXQueryVersion); PROC_EXTERN(ProcPanoramiXGetState); PROC_EXTERN(ProcPanoramiXGetScreenCount); PROC_EXTERN(ProcPanoramiXGetScreenSize); PROC_EXTERN(ProcXineramaQueryScreens); PROC_EXTERN(ProcXineramaIsActive); extern int SProcPanoramiXDispatch(ClientPtr client); extern int connBlockScreenStart; extern xConnSetupPrefix connSetupPrefix; extern int (*SavedProcVector[256]) (ClientPtr client); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/panoramiXsrv.h��������������������������������������������������������������0000664�0001751�0001751�00000004341�12274325511�014607� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef _PANORAMIXSRV_H_ #define _PANORAMIXSRV_H_ #include "panoramiX.h" extern _X_EXPORT int PanoramiXNumScreens; extern _X_EXPORT int PanoramiXPixWidth; extern _X_EXPORT int PanoramiXPixHeight; extern _X_EXPORT RegionRec PanoramiXScreenRegion; extern _X_EXPORT VisualID PanoramiXTranslateVisualID(int screen, VisualID orig); extern _X_EXPORT void PanoramiXConsolidate(void); extern _X_EXPORT Bool PanoramiXCreateConnectionBlock(void); extern _X_EXPORT PanoramiXRes *PanoramiXFindIDByScrnum(RESTYPE, XID, int); extern _X_EXPORT Bool XineramaRegisterConnectionBlockCallback(void (*func) (void)); extern _X_EXPORT int XineramaDeleteResource(void *, XID); extern _X_EXPORT void XineramaReinitData(void); extern _X_EXPORT RESTYPE XRC_DRAWABLE; extern _X_EXPORT RESTYPE XRT_WINDOW; extern _X_EXPORT RESTYPE XRT_PIXMAP; extern _X_EXPORT RESTYPE XRT_GC; extern _X_EXPORT RESTYPE XRT_COLORMAP; extern _X_EXPORT RESTYPE XRT_PICTURE; /* * Drivers are allowed to wrap this function. Each wrapper can decide that the * two visuals are unequal, but if they are deemed equal, the wrapper must call * down and return FALSE if the wrapped function does. This ensures that all * layers agree that the visuals are equal. The first visual is always from * screen 0. */ typedef Bool (*XineramaVisualsEqualProcPtr) (VisualPtr, ScreenPtr, VisualPtr); extern _X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr; extern _X_EXPORT void XineramaGetImageData(DrawablePtr *pDrawables, int left, int top, int width, int height, unsigned int format, unsigned long planemask, char *data, int pitch, Bool isRoot); static inline void panoramix_setup_ids(PanoramiXRes * resource, ClientPtr client, XID base_id) { int j; resource->info[0].id = base_id; FOR_NSCREENS_FORWARD_SKIP(j) { resource->info[j].id = FakeClientID(client->index); } } #endif /* _PANORAMIXSRV_H_ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/hashtable.c�����������������������������������������������������������������0000664�0001751�0001751�00000015517�12274325511�014053� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdlib.h> #include "misc.h" #include "hashtable.h" /* HashResourceID */ #include "resource.h" #define INITHASHSIZE 6 #define MAXHASHSIZE 11 struct HashTableRec { int keySize; int dataSize; int elements; /* number of elements inserted */ int bucketBits; /* number of buckets is 1 << bucketBits */ struct xorg_list *buckets; /* array of bucket list heads */ HashFunc hash; HashCompareFunc compare; void *cdata; }; typedef struct { struct xorg_list l; void *key; void *data; } BucketRec, *BucketPtr; HashTable ht_create(int keySize, int dataSize, HashFunc hash, HashCompareFunc compare, void *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; } } void * ht_add(HashTable ht, const void *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, const void *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; } } } void * ht_find(HashTable ht, const void *key) { unsigned index = ht->hash(ht->cdata, key, ht->bucketBits); struct xorg_list *bucket = &ht->buckets[index]; BucketPtr it; xorg_list_for_each_entry(it, bucket, l) { if (ht->compare(ht->cdata, key, it->key) == 0) { return it->data ? it->data : ((char*) it->key + ht->keySize); } } return NULL; } void ht_dump_distribution(HashTable ht) { int c; int numBuckets = 1 << ht->bucketBits; for (c = 0; c < numBuckets; ++c) { BucketPtr it; int n = 0; xorg_list_for_each_entry(it, &ht->buckets[c], l) { ++n; } printf("%d: %d\n", c, n); } } /* Picked the function from http://burtleburtle.net/bob/hash/doobs.html by Bob Jenkins, which is released in public domain */ static CARD32 one_at_a_time_hash(const void *data, int len) { CARD32 hash; int i; const char *key = data; for (hash=0, i=0; i<len; ++i) { hash += key[i]; hash += (hash << 10); hash ^= (hash >> 6); } hash += (hash << 3); hash ^= (hash >> 11); hash += (hash << 15); return hash; } unsigned ht_generic_hash(void *cdata, const void *ptr, int numBits) { HtGenericHashSetupPtr setup = cdata; return one_at_a_time_hash(ptr, setup->keySize) & ~((~0) << numBits); } int ht_generic_compare(void *cdata, const void *l, const void *r) { HtGenericHashSetupPtr setup = cdata; return memcmp(l, r, setup->keySize); } unsigned ht_resourceid_hash(void * cdata, const void * data, int numBits) { const XID* idPtr = data; XID id = *idPtr & RESOURCE_ID_MASK; (void) cdata; return HashResourceID(id, numBits); } int ht_resourceid_compare(void* cdata, const void* a, const void* b) { const XID* xa = a; const XID* xb = b; (void) cdata; return *xa < *xb ? -1 : *xa > *xb ? 1 : 0; } void ht_dump_contents(HashTable ht, void (*print_key)(void *opaque, void *key), void (*print_value)(void *opaque, void *value), void* opaque) { int c; int numBuckets = 1 << ht->bucketBits; for (c = 0; c < numBuckets; ++c) { BucketPtr it; int n = 0; printf("%d: ", c); xorg_list_for_each_entry(it, &ht->buckets[c], l) { if (n > 0) { printf(", "); } print_key(opaque, it->key); printf("->"); print_value(opaque, it->data); ++n; } printf("\n"); } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/syncsrv.h�������������������������������������������������������������������0000664�0001751�0001751�00000012024�12456571574�013640� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1991, 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /*********************************************************** Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts, and Olivetti Research Limited, Cambridge, England. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or Olivetti not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THEY 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. ******************************************************************/ #ifndef _SYNCSRV_H_ #define _SYNCSRV_H_ #include "list.h" #include "misync.h" #include "misyncstr.h" /* * The System Counter interface */ typedef enum { XSyncCounterNeverChanges, XSyncCounterNeverIncreases, XSyncCounterNeverDecreases, XSyncCounterUnrestricted } SyncCounterType; typedef void (*SyncSystemCounterQueryValue)(void *counter, CARD64 *value_return ); typedef void (*SyncSystemCounterBracketValues)(void *counter, CARD64 *pbracket_less, CARD64 *pbracket_greater ); typedef struct _SysCounterInfo { SyncCounter *pCounter; char *name; CARD64 resolution; CARD64 bracket_greater; CARD64 bracket_less; SyncCounterType counterType; /* how can this counter change */ SyncSystemCounterQueryValue QueryValue; SyncSystemCounterBracketValues BracketValues; void *private; struct xorg_list entry; } SysCounterInfo; typedef struct _SyncAlarmClientList { ClientPtr client; XID delete_id; struct _SyncAlarmClientList *next; } SyncAlarmClientList; typedef struct _SyncAlarm { SyncTrigger trigger; ClientPtr client; XSyncAlarm alarm_id; CARD64 delta; int events; int state; SyncAlarmClientList *pEventClients; } SyncAlarm; typedef struct { ClientPtr client; CARD32 delete_id; int num_waitconditions; } SyncAwaitHeader; typedef struct { SyncTrigger trigger; CARD64 event_threshold; SyncAwaitHeader *pHeader; } SyncAwait; typedef union { SyncAwaitHeader header; SyncAwait await; } SyncAwaitUnion; 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 SyncDestroySystemCounter(void *pCounter); extern SyncCounter *SyncInitDeviceIdleTime(DeviceIntPtr dev); extern void SyncRemoveDeviceIdleTime(SyncCounter *counter); int SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL initially_triggered); int SyncFDFromFence(ClientPtr client, DrawablePtr pDraw, SyncFence *fence); void SyncDeleteTriggerFromSyncObject(SyncTrigger * pTrigger); int SyncAddTriggerToSyncObject(SyncTrigger * pTrigger); #endif /* _SYNCSRV_H_ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/sleepuntil.c����������������������������������������������������������������0000664�0001751�0001751�00000014601�12274325511�014275� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 1992, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ /* dixsleep.c - implement millisecond timeouts for X clients */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "sleepuntil.h" #include <X11/X.h> #include <X11/Xmd.h> #include "misc.h" #include "windowstr.h" #include "dixstruct.h" #include "pixmapstr.h" #include "scrnintstr.h" typedef struct _Sertafied { struct _Sertafied *next; TimeStamp revive; ClientPtr pClient; XID id; void (*notifyFunc) (ClientPtr /* client */ , void * /* closure */ ); void *closure; } SertafiedRec, *SertafiedPtr; static SertafiedPtr pPending; static RESTYPE SertafiedResType; static Bool BlockHandlerRegistered; static int SertafiedGeneration; static void ClientAwaken(ClientPtr /* client */ , void * /* closure */ ); static int SertafiedDelete(void * /* value */ , XID /* id */ ); static void SertafiedBlockHandler(void * /* data */ , OSTimePtr /* wt */ , void * /* LastSelectMask */ ); static void SertafiedWakeupHandler(void * /* data */ , int /* i */ , void * /* LastSelectMask */ ); int ClientSleepUntil(ClientPtr client, TimeStamp *revive, void (*notifyFunc) (ClientPtr, void *), void *closure) { SertafiedPtr pRequest, pReq, pPrev; if (SertafiedGeneration != serverGeneration) { SertafiedResType = CreateNewResourceType(SertafiedDelete, "ClientSleep"); if (!SertafiedResType) return FALSE; SertafiedGeneration = serverGeneration; BlockHandlerRegistered = FALSE; } pRequest = malloc(sizeof(SertafiedRec)); if (!pRequest) return FALSE; pRequest->pClient = client; pRequest->revive = *revive; pRequest->id = FakeClientID(client->index); pRequest->closure = closure; if (!BlockHandlerRegistered) { if (!RegisterBlockAndWakeupHandlers(SertafiedBlockHandler, SertafiedWakeupHandler, (void *) 0)) { free(pRequest); return FALSE; } BlockHandlerRegistered = TRUE; } pRequest->notifyFunc = 0; if (!AddResource(pRequest->id, SertafiedResType, (void *) pRequest)) return FALSE; if (!notifyFunc) notifyFunc = ClientAwaken; pRequest->notifyFunc = notifyFunc; /* Insert into time-ordered queue, with earliest activation time coming first. */ pPrev = 0; for (pReq = pPending; pReq; pReq = pReq->next) { if (CompareTimeStamps(pReq->revive, *revive) == LATER) break; pPrev = pReq; } if (pPrev) pPrev->next = pRequest; else pPending = pRequest; pRequest->next = pReq; IgnoreClient(client); return TRUE; } static void ClientAwaken(ClientPtr client, void *closure) { if (!client->clientGone) AttendClient(client); } static int SertafiedDelete(void *value, XID id) { SertafiedPtr pRequest = (SertafiedPtr) value; SertafiedPtr pReq, pPrev; pPrev = 0; for (pReq = pPending; pReq; pPrev = pReq, pReq = pReq->next) if (pReq == pRequest) { if (pPrev) pPrev->next = pReq->next; else pPending = pReq->next; break; } if (pRequest->notifyFunc) (*pRequest->notifyFunc) (pRequest->pClient, pRequest->closure); free(pRequest); return TRUE; } static void SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask) { SertafiedPtr pReq, pNext; unsigned long delay; TimeStamp now; if (!pPending) return; now.milliseconds = GetTimeInMillis(); now.months = currentTime.months; if ((int) (now.milliseconds - currentTime.milliseconds) < 0) now.months++; for (pReq = pPending; pReq; pReq = pNext) { pNext = pReq->next; if (CompareTimeStamps(pReq->revive, now) == LATER) break; FreeResource(pReq->id, RT_NONE); /* AttendClient() may have been called via the resource delete * function so a client may have input to be processed and so * set delay to 0 to prevent blocking in WaitForSomething(). */ AdjustWaitForDelay(wt, 0); } pReq = pPending; if (!pReq) return; delay = pReq->revive.milliseconds - now.milliseconds; AdjustWaitForDelay(wt, delay); } static void SertafiedWakeupHandler(void *data, int i, void *LastSelectMask) { SertafiedPtr pReq, pNext; TimeStamp now; now.milliseconds = GetTimeInMillis(); now.months = currentTime.months; if ((int) (now.milliseconds - currentTime.milliseconds) < 0) now.months++; for (pReq = pPending; pReq; pReq = pNext) { pNext = pReq->next; if (CompareTimeStamps(pReq->revive, now) == LATER) break; FreeResource(pReq->id, RT_NONE); } if (!pPending) { RemoveBlockAndWakeupHandlers(SertafiedBlockHandler, SertafiedWakeupHandler, (void *) 0); BlockHandlerRegistered = FALSE; } } �������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xvdix.h���������������������������������������������������������������������0000664�0001751�0001751�00000021550�12456571574�013277� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, and the Massachusetts Institute of Technology, Cambridge, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef XVDIX_H #define XVDIX_H /* ** File: ** ** xvdix.h --- Xv device independent header file ** ** Author: ** ** David Carver (Digital Workstation Engineering/Project Athena) ** ** Revisions: ** ** 29.08.91 Carver ** - removed UnrealizeWindow wrapper unrealizing windows no longer ** preempts video ** ** 11.06.91 Carver ** - changed SetPortControl to SetPortAttribute ** - changed GetPortControl to GetPortAttribute ** - changed QueryBestSize ** ** 15.05.91 Carver ** - version 2.0 upgrade ** ** 24.01.91 Carver ** - version 1.4 upgrade ** */ #include "scrnintstr.h" #include <X11/extensions/Xvproto.h> extern _X_EXPORT unsigned long XvExtensionGeneration; extern _X_EXPORT unsigned long XvScreenGeneration; extern _X_EXPORT unsigned long XvResourceGeneration; extern _X_EXPORT int XvReqCode; extern _X_EXPORT int XvEventBase; extern _X_EXPORT int XvErrorBase; extern _X_EXPORT RESTYPE XvRTPort; extern _X_EXPORT RESTYPE XvRTEncoding; extern _X_EXPORT RESTYPE XvRTGrab; extern _X_EXPORT RESTYPE XvRTVideoNotify; extern _X_EXPORT RESTYPE XvRTVideoNotifyList; extern _X_EXPORT RESTYPE XvRTPortNotify; typedef struct { int numerator; int denominator; } XvRationalRec, *XvRationalPtr; typedef struct { char depth; unsigned long visual; } XvFormatRec, *XvFormatPtr; typedef struct { unsigned long id; ClientPtr client; } XvGrabRec, *XvGrabPtr; typedef struct _XvVideoNotifyRec { struct _XvVideoNotifyRec *next; ClientPtr client; unsigned long id; unsigned long mask; } XvVideoNotifyRec, *XvVideoNotifyPtr; typedef struct _XvPortNotifyRec { struct _XvPortNotifyRec *next; ClientPtr client; unsigned long id; } XvPortNotifyRec, *XvPortNotifyPtr; typedef struct { int id; ScreenPtr pScreen; char *name; unsigned short width, height; XvRationalRec rate; } XvEncodingRec, *XvEncodingPtr; typedef struct _XvAttributeRec { int flags; int min_value; int max_value; char *name; } XvAttributeRec, *XvAttributePtr; typedef struct { int id; int type; int byte_order; char guid[16]; int bits_per_pixel; int format; int num_planes; /* for RGB formats only */ int depth; unsigned int red_mask; unsigned int green_mask; unsigned int blue_mask; /* for YUV formats only */ unsigned int y_sample_bits; unsigned int u_sample_bits; unsigned int v_sample_bits; unsigned int horz_y_period; unsigned int horz_u_period; unsigned int horz_v_period; unsigned int vert_y_period; unsigned int vert_u_period; unsigned int vert_v_period; char component_order[32]; int scanline_order; } XvImageRec, *XvImagePtr; typedef struct { unsigned long base_id; unsigned char type; char *name; int nEncodings; XvEncodingPtr pEncodings; int nFormats; XvFormatPtr pFormats; int nAttributes; XvAttributePtr pAttributes; int nImages; XvImagePtr pImages; int nPorts; struct _XvPortRec *pPorts; ScreenPtr pScreen; int (*ddPutVideo) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); int (*ddPutStill) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); int (*ddGetVideo) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); int (*ddGetStill) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); int (*ddStopVideo) (struct _XvPortRec *, DrawablePtr); int (*ddSetPortAttribute) (struct _XvPortRec *, Atom, INT32); int (*ddGetPortAttribute) (struct _XvPortRec *, Atom, INT32 *); int (*ddQueryBestSize) (struct _XvPortRec *, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); int (*ddPutImage) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); int (*ddQueryImageAttributes) (struct _XvPortRec *, XvImagePtr, CARD16 *, CARD16 *, int *, int *); DevUnion devPriv; } XvAdaptorRec, *XvAdaptorPtr; typedef struct _XvPortRec { unsigned long id; XvAdaptorPtr pAdaptor; XvPortNotifyPtr pNotify; DrawablePtr pDraw; ClientPtr client; XvGrabRec grab; TimeStamp time; DevUnion devPriv; } XvPortRec, *XvPortPtr; #define VALIDATE_XV_PORT(portID, pPort, mode)\ {\ int rc = dixLookupResourceByType((void **)&(pPort), portID,\ XvRTPort, client, mode);\ if (rc != Success)\ return rc;\ } typedef struct { int version, revision; int nAdaptors; XvAdaptorPtr pAdaptors; DestroyWindowProcPtr DestroyWindow; DestroyPixmapProcPtr DestroyPixmap; CloseScreenProcPtr CloseScreen; } XvScreenRec, *XvScreenPtr; #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, XvScreenKey))->field) #define SCREEN_EPILOGUE(pScreen, field, wrapper)\ ((pScreen)->field = wrapper) /* Errors */ #define _XvBadPort (XvBadPort+XvErrorBase) #define _XvBadEncoding (XvBadEncoding+XvErrorBase) extern _X_EXPORT int ProcXvDispatch(ClientPtr); extern _X_EXPORT int SProcXvDispatch(ClientPtr); extern _X_EXPORT int XvScreenInit(ScreenPtr); extern _X_EXPORT DevPrivateKey XvGetScreenKey(void); extern _X_EXPORT unsigned long XvGetRTPort(void); extern _X_EXPORT void XvFreeAdaptor(XvAdaptorPtr pAdaptor); extern void _X_EXPORT XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region); extern _X_EXPORT int XvdiSendPortNotify(XvPortPtr, Atom, INT32); extern _X_EXPORT int XvdiPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); extern _X_EXPORT int XvdiPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); extern _X_EXPORT int XvdiGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); extern _X_EXPORT int XvdiGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); extern _X_EXPORT int XvdiPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); extern _X_EXPORT int XvdiSelectVideoNotify(ClientPtr, DrawablePtr, BOOL); extern _X_EXPORT int XvdiSelectPortNotify(ClientPtr, XvPortPtr, BOOL); extern _X_EXPORT int XvdiSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32); extern _X_EXPORT int XvdiGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *); extern _X_EXPORT int XvdiStopVideo(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 /* XVDIX_H */ ��������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/shape.c���������������������������������������������������������������������0000664�0001751�0001751�00000103437�12274746514�013231� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdlib.h> #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "windowstr.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "extnsionst.h" #include "dixstruct.h" #include "resource.h" #include "opaque.h" #include <X11/extensions/shapeproto.h> #include "regionstr.h" #include "gcstruct.h" #include "extinit.h" #include "protocol-versions.h" typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */ ); static int ShapeFreeClient(void * /* data */ , XID /* id */ ); static int ShapeFreeEvents(void * /* data */ , XID /* id */ ); static void SShapeNotifyEvent(xShapeNotifyEvent * /* from */ , xShapeNotifyEvent * /* to */ ); /* SendShapeNotify, CreateBoundingShape and CreateClipShape are used * externally by the Xfixes extension and are now defined in window.h */ #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif static int ShapeEventBase = 0; static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */ /* * each window has a list of clients requesting * ShapeNotify events. Each client has a resource * for each window it selects ShapeNotify input for, * this resource is used to delete the ShapeNotifyRec * entry from the per-window queue. */ typedef struct _ShapeEvent *ShapeEventPtr; typedef struct _ShapeEvent { ShapeEventPtr next; ClientPtr client; WindowPtr window; XID clientResource; } ShapeEventRec; /**************** * ShapeExtensionInit * * Called from InitExtensions in main() or from QueryExtension() if the * extension is dynamically loaded. * ****************/ static int RegionOperate(ClientPtr client, WindowPtr pWin, int kind, RegionPtr *destRgnp, RegionPtr srcRgn, int op, int xoff, int yoff, CreateDftPtr create) { if (srcRgn && (xoff || yoff)) RegionTranslate(srcRgn, xoff, yoff); if (!pWin->parent) { if (srcRgn) RegionDestroy(srcRgn); return Success; } /* May/30/2001: * The shape.PS specs say if src is None, existing shape is to be * removed (and so the op-code has no meaning in such removal); * see shape.PS, page 3, ShapeMask. */ if (srcRgn == NULL) { if (*destRgnp != NULL) { RegionDestroy(*destRgnp); *destRgnp = 0; /* go on to remove shape and generate ShapeNotify */ } else { /* May/30/2001: * The target currently has no shape in effect, so nothing to * do here. The specs say that ShapeNotify is generated whenever * the client region is "modified"; since no modification is done * here, we do not generate that event. The specs does not say * "it is an error to request removal when there is no shape in * effect", so we return good status. */ return Success; } } else switch (op) { case ShapeSet: if (*destRgnp) RegionDestroy(*destRgnp); *destRgnp = srcRgn; srcRgn = 0; break; case ShapeUnion: if (*destRgnp) RegionUnion(*destRgnp, *destRgnp, srcRgn); break; case ShapeIntersect: if (*destRgnp) RegionIntersect(*destRgnp, *destRgnp, srcRgn); else { *destRgnp = srcRgn; srcRgn = 0; } break; case ShapeSubtract: if (!*destRgnp) *destRgnp = (*create) (pWin); RegionSubtract(*destRgnp, *destRgnp, srcRgn); break; case ShapeInvert: if (!*destRgnp) *destRgnp = RegionCreate((BoxPtr) 0, 0); else RegionSubtract(*destRgnp, srcRgn, *destRgnp); break; default: client->errorValue = op; return BadValue; } if (srcRgn) RegionDestroy(srcRgn); (*pWin->drawable.pScreen->SetShape) (pWin, kind); SendShapeNotify(pWin, kind); return Success; } RegionPtr CreateBoundingShape(WindowPtr pWin) { BoxRec extents; extents.x1 = -wBorderWidth(pWin); extents.y1 = -wBorderWidth(pWin); extents.x2 = pWin->drawable.width + wBorderWidth(pWin); extents.y2 = pWin->drawable.height + wBorderWidth(pWin); return RegionCreate(&extents, 1); } RegionPtr CreateClipShape(WindowPtr pWin) { BoxRec extents; extents.x1 = 0; extents.y1 = 0; extents.x2 = pWin->drawable.width; extents.y2 = pWin->drawable.height; return RegionCreate(&extents, 1); } static int ProcShapeQueryVersion(ClientPtr client) { xShapeQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_SHAPE_MAJOR_VERSION, .minorVersion = SERVER_SHAPE_MINOR_VERSION }; REQUEST_SIZE_MATCH(xShapeQueryVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xShapeQueryVersionReply), &rep); return Success; } /***************** * ProcShapeRectangles * *****************/ static int ProcShapeRectangles(ClientPtr client) { WindowPtr pWin; REQUEST(xShapeRectanglesReq); xRectangle *prects; int nrects, ctype, rc; RegionPtr srcRgn; RegionPtr *destRgn; CreateDftPtr createDefault; REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq); UpdateCurrentTime(); rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess); if (rc != Success) return rc; switch (stuff->destKind) { case ShapeBounding: createDefault = CreateBoundingShape; break; case ShapeClip: createDefault = CreateClipShape; break; case ShapeInput: createDefault = CreateBoundingShape; break; default: client->errorValue = stuff->destKind; return BadValue; } if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) && (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded)) { client->errorValue = stuff->ordering; return BadValue; } nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq)); if (nrects & 4) return BadLength; nrects >>= 3; prects = (xRectangle *) &stuff[1]; ctype = VerifyRectOrder(nrects, prects, (int) stuff->ordering); if (ctype < 0) return BadMatch; srcRgn = RegionFromRects(nrects, prects, ctype); if (!pWin->optional) MakeWindowOptional(pWin); switch (stuff->destKind) { case ShapeBounding: destRgn = &pWin->optional->boundingShape; break; case ShapeClip: destRgn = &pWin->optional->clipShape; break; case ShapeInput: destRgn = &pWin->optional->inputShape; break; default: return BadValue; } return RegionOperate(client, pWin, (int) stuff->destKind, destRgn, srcRgn, (int) stuff->op, stuff->xOff, stuff->yOff, createDefault); } #ifdef PANORAMIX static int ProcPanoramiXShapeRectangles(ClientPtr client) { REQUEST(xShapeRectanglesReq); PanoramiXRes *win; int j, result; REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq); result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS(j) { stuff->dest = win->info[j].id; result = ProcShapeRectangles(client); if (result != Success) break; } return result; } #endif /************** * ProcShapeMask **************/ static int ProcShapeMask(ClientPtr client) { WindowPtr pWin; ScreenPtr pScreen; REQUEST(xShapeMaskReq); RegionPtr srcRgn; RegionPtr *destRgn; PixmapPtr pPixmap; CreateDftPtr createDefault; int rc; REQUEST_SIZE_MATCH(xShapeMaskReq); UpdateCurrentTime(); rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess); if (rc != Success) return rc; switch (stuff->destKind) { case ShapeBounding: createDefault = CreateBoundingShape; break; case ShapeClip: createDefault = CreateClipShape; break; case ShapeInput: createDefault = CreateBoundingShape; break; default: client->errorValue = stuff->destKind; return BadValue; } pScreen = pWin->drawable.pScreen; if (stuff->src == None) srcRgn = 0; else { rc = dixLookupResourceByType((void **) &pPixmap, stuff->src, RT_PIXMAP, client, DixReadAccess); if (rc != Success) return rc; if (pPixmap->drawable.pScreen != pScreen || pPixmap->drawable.depth != 1) return BadMatch; srcRgn = BitmapToRegion(pScreen, pPixmap); if (!srcRgn) return BadAlloc; } if (!pWin->optional) MakeWindowOptional(pWin); switch (stuff->destKind) { case ShapeBounding: destRgn = &pWin->optional->boundingShape; break; case ShapeClip: destRgn = &pWin->optional->clipShape; break; case ShapeInput: destRgn = &pWin->optional->inputShape; break; default: return BadValue; } return RegionOperate(client, pWin, (int) stuff->destKind, destRgn, srcRgn, (int) stuff->op, stuff->xOff, stuff->yOff, createDefault); } #ifdef PANORAMIX static int ProcPanoramiXShapeMask(ClientPtr client) { REQUEST(xShapeMaskReq); PanoramiXRes *win, *pmap; int j, result; REQUEST_SIZE_MATCH(xShapeMaskReq); result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; if (stuff->src != None) { result = dixLookupResourceByType((void **) &pmap, stuff->src, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } else pmap = NULL; FOR_NSCREENS(j) { stuff->dest = win->info[j].id; if (pmap) stuff->src = pmap->info[j].id; result = ProcShapeMask(client); if (result != Success) break; } return result; } #endif /************ * ProcShapeCombine ************/ static int ProcShapeCombine(ClientPtr client) { WindowPtr pSrcWin, pDestWin; REQUEST(xShapeCombineReq); RegionPtr srcRgn; RegionPtr *destRgn; CreateDftPtr createDefault; CreateDftPtr createSrc; RegionPtr tmp; int rc; REQUEST_SIZE_MATCH(xShapeCombineReq); UpdateCurrentTime(); rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixSetAttrAccess); if (rc != Success) return rc; if (!pDestWin->optional) MakeWindowOptional(pDestWin); switch (stuff->destKind) { case ShapeBounding: createDefault = CreateBoundingShape; break; case ShapeClip: createDefault = CreateClipShape; break; case ShapeInput: createDefault = CreateBoundingShape; break; default: client->errorValue = stuff->destKind; return BadValue; } rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess); if (rc != Success) return rc; switch (stuff->srcKind) { case ShapeBounding: srcRgn = wBoundingShape(pSrcWin); createSrc = CreateBoundingShape; break; case ShapeClip: srcRgn = wClipShape(pSrcWin); createSrc = CreateClipShape; break; case ShapeInput: srcRgn = wInputShape(pSrcWin); createSrc = CreateBoundingShape; break; default: client->errorValue = stuff->srcKind; return BadValue; } if (pSrcWin->drawable.pScreen != pDestWin->drawable.pScreen) { return BadMatch; } if (srcRgn) { tmp = RegionCreate((BoxPtr) 0, 0); RegionCopy(tmp, srcRgn); srcRgn = tmp; } else srcRgn = (*createSrc) (pSrcWin); if (!pDestWin->optional) MakeWindowOptional(pDestWin); switch (stuff->destKind) { case ShapeBounding: destRgn = &pDestWin->optional->boundingShape; break; case ShapeClip: destRgn = &pDestWin->optional->clipShape; break; case ShapeInput: destRgn = &pDestWin->optional->inputShape; break; default: return BadValue; } return RegionOperate(client, pDestWin, (int) stuff->destKind, destRgn, srcRgn, (int) stuff->op, stuff->xOff, stuff->yOff, createDefault); } #ifdef PANORAMIX static int ProcPanoramiXShapeCombine(ClientPtr client) { REQUEST(xShapeCombineReq); PanoramiXRes *win, *win2; int j, result; REQUEST_AT_LEAST_SIZE(xShapeCombineReq); result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &win2, stuff->src, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS(j) { stuff->dest = win->info[j].id; stuff->src = win2->info[j].id; result = ProcShapeCombine(client); if (result != Success) break; } return result; } #endif /************* * ProcShapeOffset *************/ static int ProcShapeOffset(ClientPtr client) { WindowPtr pWin; REQUEST(xShapeOffsetReq); RegionPtr srcRgn; int rc; REQUEST_SIZE_MATCH(xShapeOffsetReq); UpdateCurrentTime(); rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess); if (rc != Success) return rc; switch (stuff->destKind) { case ShapeBounding: srcRgn = wBoundingShape(pWin); break; case ShapeClip: srcRgn = wClipShape(pWin); break; case ShapeInput: srcRgn = wInputShape(pWin); break; default: client->errorValue = stuff->destKind; return BadValue; } if (srcRgn) { RegionTranslate(srcRgn, stuff->xOff, stuff->yOff); (*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind); } SendShapeNotify(pWin, (int) stuff->destKind); return Success; } #ifdef PANORAMIX static int ProcPanoramiXShapeOffset(ClientPtr client) { REQUEST(xShapeOffsetReq); PanoramiXRes *win; int j, result; REQUEST_AT_LEAST_SIZE(xShapeOffsetReq); result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS(j) { stuff->dest = win->info[j].id; result = ProcShapeOffset(client); if (result != Success) break; } return result; } #endif static int ProcShapeQueryExtents(ClientPtr client) { REQUEST(xShapeQueryExtentsReq); WindowPtr pWin; xShapeQueryExtentsReply rep; BoxRec extents, *pExtents; int rc; RegionPtr region; REQUEST_SIZE_MATCH(xShapeQueryExtentsReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; 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); extents = *pExtents; } else { extents.x1 = -wBorderWidth(pWin); extents.y1 = -wBorderWidth(pWin); extents.x2 = pWin->drawable.width + wBorderWidth(pWin); extents.y2 = pWin->drawable.height + wBorderWidth(pWin); } rep.xBoundingShape = extents.x1; rep.yBoundingShape = extents.y1; rep.widthBoundingShape = extents.x2 - extents.x1; rep.heightBoundingShape = extents.y2 - extents.y1; if ((region = wClipShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = 0; extents.y1 = 0; extents.x2 = pWin->drawable.width; extents.y2 = pWin->drawable.height; } rep.xClipShape = extents.x1; rep.yClipShape = extents.y1; rep.widthClipShape = extents.x2 - extents.x1; rep.heightClipShape = extents.y2 - extents.y1; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.xBoundingShape); swaps(&rep.yBoundingShape); swaps(&rep.widthBoundingShape); swaps(&rep.heightBoundingShape); swaps(&rep.xClipShape); swaps(&rep.yClipShape); swaps(&rep.widthClipShape); swaps(&rep.heightClipShape); } WriteToClient(client, sizeof(xShapeQueryExtentsReply), &rep); return Success; } /*ARGSUSED*/ static int ShapeFreeClient(void *data, XID id) { ShapeEventPtr pShapeEvent; WindowPtr pWin; ShapeEventPtr *pHead, pCur, pPrev; int rc; pShapeEvent = (ShapeEventPtr) data; pWin = pShapeEvent->window; rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, serverClient, DixReadAccess); if (rc == Success) { pPrev = 0; for (pCur = *pHead; pCur && pCur != pShapeEvent; pCur = pCur->next) pPrev = pCur; if (pCur) { if (pPrev) pPrev->next = pShapeEvent->next; else *pHead = pShapeEvent->next; } } free((void *) pShapeEvent); return 1; } /*ARGSUSED*/ static int ShapeFreeEvents(void *data, XID id) { ShapeEventPtr *pHead, pCur, pNext; pHead = (ShapeEventPtr *) data; for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource(pCur->clientResource, ClientType); free((void *) pCur); } free((void *) pHead); return 1; } static int ProcShapeSelectInput(ClientPtr client) { REQUEST(xShapeSelectInputReq); WindowPtr pWin; ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead; XID clientResource; int rc; REQUEST_SIZE_MATCH(xShapeSelectInputReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); if (rc != Success) return rc; rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, client, DixWriteAccess); if (rc != Success && rc != BadValue) return rc; switch (stuff->enable) { case xTrue: if (pHead) { /* check for existing entry. */ for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { if (pShapeEvent->client == client) return Success; } } /* build the entry */ pNewShapeEvent = malloc(sizeof(ShapeEventRec)); if (!pNewShapeEvent) return BadAlloc; pNewShapeEvent->next = 0; pNewShapeEvent->client = client; pNewShapeEvent->window = pWin; /* * add a resource that will be deleted when * the client goes away */ clientResource = FakeClientID(client->index); pNewShapeEvent->clientResource = clientResource; if (!AddResource(clientResource, ClientType, (void *) pNewShapeEvent)) return BadAlloc; /* * create a resource to contain a void *to the list * of clients selecting input. This must be indirect as * the list may be arbitrarily rearranged which cannot be * done through the resource database. */ if (!pHead) { pHead = malloc(sizeof(ShapeEventPtr)); if (!pHead || !AddResource(pWin->drawable.id, ShapeEventType, (void *) pHead)) { FreeResource(clientResource, RT_NONE); return BadAlloc; } *pHead = 0; } pNewShapeEvent->next = *pHead; *pHead = pNewShapeEvent; break; case xFalse: /* delete the interest */ if (pHead) { pNewShapeEvent = 0; for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { if (pShapeEvent->client == client) break; pNewShapeEvent = pShapeEvent; } if (pShapeEvent) { FreeResource(pShapeEvent->clientResource, ClientType); if (pNewShapeEvent) pNewShapeEvent->next = pShapeEvent->next; else *pHead = pShapeEvent->next; free(pShapeEvent); } } break; default: client->errorValue = stuff->enable; return BadValue; } return Success; } /* * deliver the event */ void SendShapeNotify(WindowPtr pWin, int which) { ShapeEventPtr *pHead, pShapeEvent; BoxRec extents; RegionPtr region; BYTE shaped; int rc; rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, serverClient, DixReadAccess); if (rc != Success) return; switch (which) { case ShapeBounding: region = wBoundingShape(pWin); if (region) { extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth(pWin); extents.y1 = -wBorderWidth(pWin); extents.x2 = pWin->drawable.width + wBorderWidth(pWin); extents.y2 = pWin->drawable.height + wBorderWidth(pWin); shaped = xFalse; } break; case ShapeClip: region = wClipShape(pWin); if (region) { extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = 0; extents.y1 = 0; extents.x2 = pWin->drawable.width; extents.y2 = pWin->drawable.height; shaped = xFalse; } break; case ShapeInput: region = wInputShape(pWin); if (region) { extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth(pWin); extents.y1 = -wBorderWidth(pWin); extents.x2 = pWin->drawable.width + wBorderWidth(pWin); extents.y2 = pWin->drawable.height + wBorderWidth(pWin); shaped = xFalse; } break; default: return; } for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { 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); } } static int ProcShapeInputSelected(ClientPtr client) { REQUEST(xShapeInputSelectedReq); WindowPtr pWin; ShapeEventPtr pShapeEvent, *pHead; int enabled, rc; xShapeInputSelectedReply rep; REQUEST_SIZE_MATCH(xShapeInputSelectedReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, client, DixReadAccess); if (rc != Success && rc != BadValue) return rc; enabled = xFalse; if (pHead) { for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { if (pShapeEvent->client == client) { enabled = xTrue; break; } } } 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), &rep); return Success; } static int ProcShapeGetRectangles(ClientPtr client) { REQUEST(xShapeGetRectanglesReq); WindowPtr pWin; xShapeGetRectanglesReply rep; xRectangle *rects; int nrects, i, rc; RegionPtr region; REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; switch (stuff->kind) { case ShapeBounding: region = wBoundingShape(pWin); break; case ShapeClip: region = wClipShape(pWin); break; case ShapeInput: region = wInputShape(pWin); break; default: client->errorValue = stuff->kind; return BadValue; } if (!region) { nrects = 1; rects = malloc(sizeof(xRectangle)); if (!rects) return BadAlloc; switch (stuff->kind) { case ShapeBounding: rects->x = -(int) wBorderWidth(pWin); rects->y = -(int) wBorderWidth(pWin); rects->width = pWin->drawable.width + wBorderWidth(pWin); rects->height = pWin->drawable.height + wBorderWidth(pWin); break; case ShapeClip: rects->x = 0; rects->y = 0; rects->width = pWin->drawable.width; rects->height = pWin->drawable.height; break; case ShapeInput: rects->x = -(int) wBorderWidth(pWin); rects->y = -(int) wBorderWidth(pWin); rects->width = pWin->drawable.width + wBorderWidth(pWin); rects->height = pWin->drawable.height + wBorderWidth(pWin); break; } } else { BoxPtr box; nrects = RegionNumRects(region); box = RegionRects(region); rects = malloc(nrects * sizeof(xRectangle)); if (!rects && nrects) return BadAlloc; for (i = 0; i < nrects; i++, box++) { rects[i].x = box->x1; rects[i].y = box->y1; rects[i].width = box->x2 - box->x1; rects[i].height = box->y2 - box->y1; } } 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), &rep); WriteToClient(client, nrects * sizeof(xRectangle), rects); free(rects); return Success; } static int ProcShapeDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_ShapeQueryVersion: return ProcShapeQueryVersion(client); case X_ShapeRectangles: #ifdef PANORAMIX if (!noPanoramiXExtension) return ProcPanoramiXShapeRectangles(client); else #endif return ProcShapeRectangles(client); case X_ShapeMask: #ifdef PANORAMIX if (!noPanoramiXExtension) return ProcPanoramiXShapeMask(client); else #endif return ProcShapeMask(client); case X_ShapeCombine: #ifdef PANORAMIX if (!noPanoramiXExtension) return ProcPanoramiXShapeCombine(client); else #endif return ProcShapeCombine(client); case X_ShapeOffset: #ifdef PANORAMIX if (!noPanoramiXExtension) return ProcPanoramiXShapeOffset(client); else #endif return ProcShapeOffset(client); case X_ShapeQueryExtents: return ProcShapeQueryExtents(client); case X_ShapeSelectInput: return ProcShapeSelectInput(client); case X_ShapeInputSelected: return ProcShapeInputSelected(client); case X_ShapeGetRectangles: return ProcShapeGetRectangles(client); default: return BadRequest; } } static void SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to) { to->type = from->type; to->kind = from->kind; cpswapl(from->window, to->window); cpswaps(from->sequenceNumber, to->sequenceNumber); cpswaps(from->x, to->x); cpswaps(from->y, to->y); cpswaps(from->width, to->width); cpswaps(from->height, to->height); cpswapl(from->time, to->time); to->shaped = from->shaped; } static int SProcShapeQueryVersion(ClientPtr client) { REQUEST(xShapeQueryVersionReq); swaps(&stuff->length); return ProcShapeQueryVersion(client); } static int SProcShapeRectangles(ClientPtr client) { REQUEST(xShapeRectanglesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq); swapl(&stuff->dest); swaps(&stuff->xOff); swaps(&stuff->yOff); SwapRestS(stuff); return ProcShapeRectangles(client); } static int SProcShapeMask(ClientPtr client) { REQUEST(xShapeMaskReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeMaskReq); swapl(&stuff->dest); swaps(&stuff->xOff); swaps(&stuff->yOff); swapl(&stuff->src); return ProcShapeMask(client); } static int SProcShapeCombine(ClientPtr client) { REQUEST(xShapeCombineReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeCombineReq); swapl(&stuff->dest); swaps(&stuff->xOff); swaps(&stuff->yOff); swapl(&stuff->src); return ProcShapeCombine(client); } static int SProcShapeOffset(ClientPtr client) { REQUEST(xShapeOffsetReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeOffsetReq); swapl(&stuff->dest); swaps(&stuff->xOff); swaps(&stuff->yOff); return ProcShapeOffset(client); } static int SProcShapeQueryExtents(ClientPtr client) { REQUEST(xShapeQueryExtentsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeQueryExtentsReq); swapl(&stuff->window); return ProcShapeQueryExtents(client); } static int SProcShapeSelectInput(ClientPtr client) { REQUEST(xShapeSelectInputReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeSelectInputReq); swapl(&stuff->window); return ProcShapeSelectInput(client); } static int SProcShapeInputSelected(ClientPtr client) { REQUEST(xShapeInputSelectedReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeInputSelectedReq); swapl(&stuff->window); return ProcShapeInputSelected(client); } static int SProcShapeGetRectangles(ClientPtr client) { REQUEST(xShapeGetRectanglesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); swapl(&stuff->window); return ProcShapeGetRectangles(client); } static int SProcShapeDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_ShapeQueryVersion: return SProcShapeQueryVersion(client); case X_ShapeRectangles: return SProcShapeRectangles(client); case X_ShapeMask: return SProcShapeMask(client); case X_ShapeCombine: return SProcShapeCombine(client); case X_ShapeOffset: return SProcShapeOffset(client); case X_ShapeQueryExtents: return SProcShapeQueryExtents(client); case X_ShapeSelectInput: return SProcShapeSelectInput(client); case X_ShapeInputSelected: return SProcShapeInputSelected(client); case X_ShapeGetRectangles: return SProcShapeGetRectangles(client); default: return BadRequest; } } void ShapeExtensionInit(void) { ExtensionEntry *extEntry; ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient"); ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent"); if (ClientType && ShapeEventType && (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0, ProcShapeDispatch, SProcShapeDispatch, NULL, StandardMinorOpcode))) { ShapeEventBase = extEntry->eventBase; EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/shmint.h��������������������������������������������������������������������0000664�0001751�0001751�00000005267�12274325511�013430� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2003 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. */ #ifndef _SHMINT_H_ #define _SHMINT_H_ #include <X11/extensions/shmproto.h> #include "screenint.h" #include "pixmap.h" #include "gc.h" #define XSHM_PUT_IMAGE_ARGS \ DrawablePtr /* dst */, \ GCPtr /* pGC */, \ int /* depth */, \ unsigned int /* format */, \ int /* w */, \ int /* h */, \ int /* sx */, \ int /* sy */, \ int /* sw */, \ int /* sh */, \ int /* dx */, \ int /* dy */, \ char * /* data */ #define XSHM_CREATE_PIXMAP_ARGS \ ScreenPtr /* pScreen */, \ int /* width */, \ int /* height */, \ int /* depth */, \ char * /* addr */ typedef struct _ShmFuncs { PixmapPtr (*CreatePixmap) (XSHM_CREATE_PIXMAP_ARGS); void (*PutImage) (XSHM_PUT_IMAGE_ARGS); } ShmFuncs, *ShmFuncsPtr; #if XTRANS_SEND_FDS #define SHM_FD_PASSING 1 #endif typedef struct _ShmDesc { struct _ShmDesc *next; int shmid; int refcnt; char *addr; Bool writable; unsigned long size; #ifdef SHM_FD_PASSING Bool is_fd; struct busfault *busfault; XID resource; #endif } ShmDescRec, *ShmDescPtr; #ifdef SHM_FD_PASSING #define SHMDESC_IS_FD(shmdesc) ((shmdesc)->is_fd) #else #define SHMDESC_IS_FD(shmdesc) (0) #endif extern _X_EXPORT void ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs); extern _X_EXPORT void ShmRegisterFbFuncs(ScreenPtr pScreen); extern _X_EXPORT RESTYPE ShmSegType; extern _X_EXPORT int ShmCompletionCode; extern _X_EXPORT int BadShmSegCode; #endif /* _SHMINT_H_ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/panoramiX.h�����������������������������������������������������������������0000664�0001751�0001751�00000005202�12456571574�014067� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ /* * PanoramiX definitions */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef _PANORAMIX_H_ #define _PANORAMIX_H_ #define _PANORAMIX_SERVER #include <X11/extensions/panoramiXproto.h> #undef _PANORAMIX_SERVER #include "gcstruct.h" #include "dixstruct.h" typedef struct _PanoramiXInfo { XID id; } PanoramiXInfo; typedef struct { PanoramiXInfo info[MAXSCREENS]; RESTYPE type; union { struct { char visibility; char class; char root; } win; struct { Bool shared; } pix; struct { Bool root; } pict; char raw_data[4]; } u; } PanoramiXRes; #define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++) #define FOR_NSCREENS_FORWARD_SKIP(j) for(j = 1; j < PanoramiXNumScreens; j++) #define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--) #define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j) #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared) #define IS_ROOT_DRAWABLE(d) (((d)->type == XRT_WINDOW) && (d)->u.win.root) #endif /* _PANORAMIX_H_ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/shm.c�����������������������������������������������������������������������0000664�0001751�0001751�00000125630�12456571574�012723� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. ********************************************************/ /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ #define SHM #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> #include <unistd.h> #include <sys/stat.h> #include <fcntl.h> #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "resource.h" #include "scrnintstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "gcstruct.h" #include "extnsionst.h" #include "servermd.h" #include "shmint.h" #include "xace.h" #include <X11/extensions/shmproto.h> #include <X11/Xfuncproto.h> #include <sys/mman.h> #include "protocol-versions.h" #include "busfault.h" /* Needed for Solaris cross-zone shared memory extension */ #ifdef HAVE_SHMCTL64 #include <sys/ipc_impl.h> #define SHMSTAT(id, buf) shmctl64(id, IPC_STAT64, buf) #define SHMSTAT_TYPE struct shmid_ds64 #define SHMPERM_TYPE struct ipc_perm64 #define SHM_PERM(buf) buf.shmx_perm #define SHM_SEGSZ(buf) buf.shmx_segsz #define SHMPERM_UID(p) p->ipcx_uid #define SHMPERM_CUID(p) p->ipcx_cuid #define SHMPERM_GID(p) p->ipcx_gid #define SHMPERM_CGID(p) p->ipcx_cgid #define SHMPERM_MODE(p) p->ipcx_mode #define SHMPERM_ZONEID(p) p->ipcx_zoneid #else #define SHMSTAT(id, buf) shmctl(id, IPC_STAT, buf) #define SHMSTAT_TYPE struct shmid_ds #define SHMPERM_TYPE struct ipc_perm #define SHM_PERM(buf) buf.shm_perm #define SHM_SEGSZ(buf) buf.shm_segsz #define SHMPERM_UID(p) p->uid #define SHMPERM_CUID(p) p->cuid #define SHMPERM_GID(p) p->gid #define SHMPERM_CGID(p) p->cgid #define SHMPERM_MODE(p) p->mode #endif #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #include "extinit.h" typedef struct _ShmScrPrivateRec { CloseScreenProcPtr CloseScreen; ShmFuncsPtr shmFuncs; DestroyPixmapProcPtr destroyPixmap; } ShmScrPrivateRec; static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); static int ShmDetachSegment(void *value, XID shmseg); static void ShmResetProc(ExtensionEntry *extEntry); static void SShmCompletionEvent(xShmCompletionEvent *from, xShmCompletionEvent *to); static Bool ShmDestroyPixmap(PixmapPtr pPixmap); static unsigned char ShmReqCode; int ShmCompletionCode; int BadShmSegCode; RESTYPE ShmSegType; static ShmDescPtr Shmsegs; static Bool sharedPixmaps; static DevPrivateKeyRec shmScrPrivateKeyRec; #define shmScrPrivateKey (&shmScrPrivateKeyRec) static DevPrivateKeyRec shmPixmapPrivateKeyRec; #define shmPixmapPrivateKey (&shmPixmapPrivateKeyRec) static ShmFuncs miFuncs = { NULL, NULL }; static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL }; #define ShmGetScreenPriv(s) ((ShmScrPrivateRec *)dixLookupPrivate(&(s)->devPrivates, shmScrPrivateKey)) #define VERIFY_SHMSEG(shmseg,shmdesc,client) \ { \ int tmprc; \ tmprc = dixLookupResourceByType((void **)&(shmdesc), shmseg, ShmSegType, \ client, DixReadAccess); \ if (tmprc != Success) \ return tmprc; \ } #define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \ { \ VERIFY_SHMSEG(shmseg, shmdesc, client); \ if ((offset & 3) || (offset > shmdesc->size)) \ { \ client->errorValue = offset; \ return BadValue; \ } \ if (needwrite && !shmdesc->writable) \ return BadAccess; \ } #define VERIFY_SHMSIZE(shmdesc,offset,len,client) \ { \ if ((offset + len) > shmdesc->size) \ { \ return BadAccess; \ } \ } #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__) #include <sys/signal.h> static Bool badSysCall = FALSE; static void SigSysHandler(int signo) { badSysCall = TRUE; } static Bool CheckForShmSyscall(void) { void (*oldHandler) (int); int shmid = -1; /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ oldHandler = signal(SIGSYS, SigSysHandler); badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); if (shmid != -1) { /* Successful allocation - clean up */ shmctl(shmid, IPC_RMID, NULL); } else { /* Allocation failed */ badSysCall = TRUE; } signal(SIGSYS, oldHandler); return !badSysCall; } #define MUST_CHECK_FOR_SHM_SYSCALL #endif static Bool ShmCloseScreen(ScreenPtr pScreen) { ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); pScreen->CloseScreen = screen_priv->CloseScreen; dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL); free(screen_priv); return (*pScreen->CloseScreen) (pScreen); } static ShmScrPrivateRec * ShmInitScreenPriv(ScreenPtr pScreen) { ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); if (!screen_priv) { screen_priv = calloc(1, sizeof(ShmScrPrivateRec)); screen_priv->CloseScreen = pScreen->CloseScreen; dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv); pScreen->CloseScreen = ShmCloseScreen; } return screen_priv; } static Bool ShmRegisterPrivates(void) { if (!dixRegisterPrivateKey(&shmScrPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&shmPixmapPrivateKeyRec, PRIVATE_PIXMAP, 0)) return FALSE; return TRUE; } /*ARGSUSED*/ static void ShmResetProc(ExtensionEntry * extEntry) { int i; for (i = 0; i < screenInfo.numScreens; i++) ShmRegisterFuncs(screenInfo.screens[i], NULL); } void ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs) { if (!ShmRegisterPrivates()) return; ShmInitScreenPriv(pScreen)->shmFuncs = funcs; } static Bool ShmDestroyPixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); void *shmdesc = NULL; Bool ret; if (pPixmap->refcnt == 1) shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey); pScreen->DestroyPixmap = screen_priv->destroyPixmap; ret = (*pScreen->DestroyPixmap) (pPixmap); screen_priv->destroyPixmap = pScreen->DestroyPixmap; pScreen->DestroyPixmap = ShmDestroyPixmap; if (shmdesc) ShmDetachSegment(shmdesc, pPixmap->drawable.id); return ret; } void ShmRegisterFbFuncs(ScreenPtr pScreen) { ShmRegisterFuncs(pScreen, &fbFuncs); } static int ProcShmQueryVersion(ClientPtr client) { 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); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); swaps(&rep.uid); swaps(&rep.gid); } WriteToClient(client, sizeof(xShmQueryVersionReply), &rep); return Success; } /* * Simulate the access() system call for a shared memory segement, * using the credentials from the client if available */ static int shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly) { int uid, gid; mode_t mask; int uidset = 0, gidset = 0; LocalClientCredRec *lcc; if (GetLocalClientCreds(client, &lcc) != -1) { if (lcc->fieldsSet & LCC_UID_SET) { uid = lcc->euid; uidset = 1; } if (lcc->fieldsSet & LCC_GID_SET) { gid = lcc->egid; gidset = 1; } #if defined(HAVE_GETZONEID) && defined(SHMPERM_ZONEID) if (((lcc->fieldsSet & LCC_ZID_SET) == 0) || (lcc->zoneid == -1) || (lcc->zoneid != SHMPERM_ZONEID(perm))) { uidset = 0; gidset = 0; } #endif FreeLocalClientCreds(lcc); if (uidset) { /* User id 0 always gets access */ if (uid == 0) { return 0; } /* Check the owner */ if (SHMPERM_UID(perm) == uid || SHMPERM_CUID(perm) == uid) { mask = S_IRUSR; if (!readonly) { mask |= S_IWUSR; } return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1; } } if (gidset) { /* Check the group */ if (SHMPERM_GID(perm) == gid || SHMPERM_CGID(perm) == gid) { mask = S_IRGRP; if (!readonly) { mask |= S_IWGRP; } return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1; } } } /* Otherwise, check everyone else */ mask = S_IROTH; if (!readonly) { mask |= S_IWOTH; } return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1; } static int ProcShmAttach(ClientPtr client) { SHMSTAT_TYPE buf; ShmDescPtr shmdesc; REQUEST(xShmAttachReq); REQUEST_SIZE_MATCH(xShmAttachReq); LEGAL_NEW_RESOURCE(stuff->shmseg, client); if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { client->errorValue = stuff->readOnly; return BadValue; } for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) { if (!SHMDESC_IS_FD(shmdesc) && shmdesc->shmid == stuff->shmid) break; } if (shmdesc) { if (!stuff->readOnly && !shmdesc->writable) return BadAccess; shmdesc->refcnt++; } else { shmdesc = malloc(sizeof(ShmDescRec)); if (!shmdesc) return BadAlloc; #ifdef SHM_FD_PASSING shmdesc->is_fd = FALSE; #endif shmdesc->addr = shmat(stuff->shmid, 0, stuff->readOnly ? SHM_RDONLY : 0); if ((shmdesc->addr == ((char *) -1)) || SHMSTAT(stuff->shmid, &buf)) { free(shmdesc); return BadAccess; } /* The attach was performed with root privs. We must * do manual checking of access rights for the credentials * of the client */ if (shm_access(client, &(SHM_PERM(buf)), stuff->readOnly) == -1) { shmdt(shmdesc->addr); free(shmdesc); return BadAccess; } shmdesc->shmid = stuff->shmid; shmdesc->refcnt = 1; shmdesc->writable = !stuff->readOnly; shmdesc->size = SHM_SEGSZ(buf); shmdesc->next = Shmsegs; Shmsegs = shmdesc; } if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) return BadAlloc; return Success; } /*ARGSUSED*/ static int ShmDetachSegment(void *value, /* must conform to DeleteType */ XID shmseg) { ShmDescPtr shmdesc = (ShmDescPtr) value; ShmDescPtr *prev; if (--shmdesc->refcnt) return TRUE; #if SHM_FD_PASSING if (shmdesc->is_fd) { if (shmdesc->busfault) busfault_unregister(shmdesc->busfault); munmap(shmdesc->addr, shmdesc->size); } else #endif shmdt(shmdesc->addr); for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next); *prev = shmdesc->next; free(shmdesc); return Success; } static int ProcShmDetach(ClientPtr client) { ShmDescPtr shmdesc; REQUEST(xShmDetachReq); REQUEST_SIZE_MATCH(xShmDetachReq); VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); FreeResource(stuff->shmseg, RT_NONE); return Success; } /* * If the given request doesn't exactly match PutImage's constraints, * wrap the image in a scratch pixmap header and let CopyArea sort it out. */ static void doShmPutImage(DrawablePtr dst, GCPtr pGC, int depth, unsigned int format, int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, char *data) { PixmapPtr pPixmap; if (format == ZPixmap || (format == XYPixmap && depth == 1)) { pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, BitsPerPixel(depth), PixmapBytePad(w, depth), data); if (!pPixmap) return; pGC->ops->CopyArea((DrawablePtr) pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy); FreeScratchPixmapHeader(pPixmap); } else { GCPtr putGC = GetScratchGC(depth, dst->pScreen); if (!putGC) return; pPixmap = (*dst->pScreen->CreatePixmap) (dst->pScreen, sw, sh, depth, CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { FreeScratchGC(putGC); return; } ValidateGC(&pPixmap->drawable, putGC); (*putGC->ops->PutImage) (&pPixmap->drawable, putGC, depth, -sx, -sy, w, h, 0, (format == XYPixmap) ? XYPixmap : ZPixmap, data); FreeScratchGC(putGC); if (format == XYBitmap) (void) (*pGC->ops->CopyPlane) (&pPixmap->drawable, dst, pGC, 0, 0, sw, sh, dx, dy, 1L); else (void) (*pGC->ops->CopyArea) (&pPixmap->drawable, dst, pGC, 0, 0, sw, sh, dx, dy); (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap); } } static int ProcShmPutImage(ClientPtr client) { GCPtr pGC; DrawablePtr pDraw; long length; ShmDescPtr shmdesc; REQUEST(xShmPutImageReq); REQUEST_SIZE_MATCH(xShmPutImageReq); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client); if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse)) return BadValue; if (stuff->format == XYBitmap) { if (stuff->depth != 1) return BadMatch; length = PixmapBytePad(stuff->totalWidth, 1); } else if (stuff->format == XYPixmap) { if (pDraw->depth != stuff->depth) return BadMatch; length = PixmapBytePad(stuff->totalWidth, 1); length *= stuff->depth; } else if (stuff->format == ZPixmap) { if (pDraw->depth != stuff->depth) return BadMatch; length = PixmapBytePad(stuff->totalWidth, stuff->depth); } else { client->errorValue = stuff->format; return BadValue; } /* * There's a potential integer overflow in this check: * VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight, * client); * the version below ought to avoid it */ if (stuff->totalHeight != 0 && length > (shmdesc->size - stuff->offset) / stuff->totalHeight) { client->errorValue = stuff->totalWidth; return BadValue; } if (stuff->srcX > stuff->totalWidth) { client->errorValue = stuff->srcX; return BadValue; } if (stuff->srcY > stuff->totalHeight) { client->errorValue = stuff->srcY; return BadValue; } if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth) { client->errorValue = stuff->srcWidth; return BadValue; } if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight) { client->errorValue = stuff->srcHeight; return BadValue; } if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) || ((stuff->format != ZPixmap) && (stuff->srcX < screenInfo.bitmapScanlinePad) && ((stuff->format == XYBitmap) || ((stuff->srcY == 0) && (stuff->srcHeight == stuff->totalHeight))))) && ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth)) (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY, stuff->totalWidth, stuff->srcHeight, stuff->srcX, stuff->format, shmdesc->addr + stuff->offset + (stuff->srcY * length)); else doShmPutImage(pDraw, pGC, stuff->depth, stuff->format, stuff->totalWidth, stuff->totalHeight, stuff->srcX, stuff->srcY, stuff->srcWidth, stuff->srcHeight, stuff->dstX, stuff->dstY, shmdesc->addr + stuff->offset); if (stuff->sendEvent) { xShmCompletionEvent ev = { .type = ShmCompletionCode, .drawable = stuff->drawable, .minorEvent = X_ShmPutImage, .majorEvent = ShmReqCode, .shmseg = stuff->shmseg, .offset = stuff->offset }; WriteEventsToClient(client, 1, (xEvent *) &ev); } return Success; } static int ProcShmGetImage(ClientPtr client) { DrawablePtr pDraw; long lenPer = 0, length; Mask plane = 0; xShmGetImageReply xgi; ShmDescPtr shmdesc; VisualID visual = None; int rc; REQUEST(xShmGetImageReq); REQUEST_SIZE_MATCH(xShmGetImageReq); if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { client->errorValue = stuff->format; return BadValue; } rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); if (pDraw->type == DRAWABLE_WINDOW) { if ( /* check for being viewable */ !((WindowPtr) pDraw)->realized || /* check for being on screen */ pDraw->x + stuff->x < 0 || pDraw->x + stuff->x + (int) stuff->width > pDraw->pScreen->width || pDraw->y + stuff->y < 0 || pDraw->y + stuff->y + (int) stuff->height > pDraw->pScreen->height || /* check for being inside of border */ stuff->x < -wBorderWidth((WindowPtr) pDraw) || stuff->x + (int) stuff->width > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->width || stuff->y < -wBorderWidth((WindowPtr) pDraw) || stuff->y + (int) stuff->height > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height) return BadMatch; 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; visual = None; } 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; } else { lenPer = PixmapBytePad(stuff->width, 1) * stuff->height; plane = ((Mask) 1) << (pDraw->depth - 1); /* only planes asked for */ length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1))); } VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); xgi.size = length; if (length == 0) { /* nothing to do */ } else if (stuff->format == ZPixmap) { (*pDraw->pScreen->GetImage) (pDraw, stuff->x, stuff->y, stuff->width, stuff->height, stuff->format, stuff->planeMask, shmdesc->addr + stuff->offset); } else { length = stuff->offset; for (; plane; plane >>= 1) { if (stuff->planeMask & plane) { (*pDraw->pScreen->GetImage) (pDraw, stuff->x, stuff->y, stuff->width, stuff->height, stuff->format, plane, shmdesc->addr + length); length += lenPer; } } } if (client->swapped) { swaps(&xgi.sequenceNumber); swapl(&xgi.length); swapl(&xgi.visual); swapl(&xgi.size); } WriteToClient(client, sizeof(xShmGetImageReply), &xgi); return Success; } #ifdef PANORAMIX static int ProcPanoramiXShmPutImage(ClientPtr client) { int j, result, orig_x, orig_y; PanoramiXRes *draw, *gc; Bool sendEvent, isRoot; REQUEST(xShmPutImageReq); REQUEST_SIZE_MATCH(xShmPutImageReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; orig_x = stuff->dstX; orig_y = stuff->dstY; sendEvent = stuff->sendEvent; stuff->sendEvent = 0; FOR_NSCREENS(j) { if (!j) stuff->sendEvent = sendEvent; stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; if (isRoot) { stuff->dstX = orig_x - screenInfo.screens[j]->x; stuff->dstY = orig_y - screenInfo.screens[j]->y; } result = ProcShmPutImage(client); if (result != Success) break; } return result; } static int ProcPanoramiXShmGetImage(ClientPtr client) { PanoramiXRes *draw; DrawablePtr *drawables; DrawablePtr pDraw; xShmGetImageReply xgi; ShmDescPtr shmdesc; int i, x, y, w, h, format, rc; Mask plane = 0, planemask; long lenPer = 0, length, widthBytesLine; Bool isRoot; REQUEST(xShmGetImageReq); REQUEST_SIZE_MATCH(xShmGetImageReq); if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { client->errorValue = stuff->format; return BadValue; } rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; if (draw->type == XRT_PIXMAP) return ProcShmGetImage(client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); x = stuff->x; y = stuff->y; w = stuff->width; h = stuff->height; format = stuff->format; planemask = stuff->planeMask; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; if (isRoot) { if ( /* check for being onscreen */ x < 0 || x + w > PanoramiXPixWidth || y < 0 || y + h > PanoramiXPixHeight) return BadMatch; } else { if ( /* check for being onscreen */ screenInfo.screens[0]->x + pDraw->x + x < 0 || screenInfo.screens[0]->x + pDraw->x + x + w > PanoramiXPixWidth || screenInfo.screens[0]->y + pDraw->y + y < 0 || screenInfo.screens[0]->y + pDraw->y + y + h > PanoramiXPixHeight || /* check for being inside of border */ x < -wBorderWidth((WindowPtr) pDraw) || x + w > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->width || y < -wBorderWidth((WindowPtr) pDraw) || y + h > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height) return BadMatch; } drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr)); if (!drawables) return BadAlloc; drawables[0] = pDraw; FOR_NSCREENS_FORWARD_SKIP(i) { rc = dixLookupDrawable(drawables + i, draw->info[i].id, client, 0, DixReadAccess); if (rc != Success) { free(drawables); return rc; } } 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); length = widthBytesLine * h; } else { widthBytesLine = PixmapBytePad(w, 1); lenPer = widthBytesLine * h; plane = ((Mask) 1) << (pDraw->depth - 1); length = lenPer * Ones(planemask & (plane | (plane - 1))); } VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); xgi.size = length; if (length == 0) { /* nothing to do */ } else if (format == ZPixmap) { XineramaGetImageData(drawables, x, y, w, h, format, planemask, shmdesc->addr + stuff->offset, widthBytesLine, isRoot); } else { length = stuff->offset; for (; plane; plane >>= 1) { if (planemask & plane) { XineramaGetImageData(drawables, x, y, w, h, format, plane, shmdesc->addr + length, widthBytesLine, isRoot); length += lenPer; } } } free(drawables); if (client->swapped) { swaps(&xgi.sequenceNumber); swapl(&xgi.length); swapl(&xgi.visual); swapl(&xgi.size); } WriteToClient(client, sizeof(xShmGetImageReply), &xgi); return Success; } static int ProcPanoramiXShmCreatePixmap(ClientPtr client) { ScreenPtr pScreen = NULL; PixmapPtr pMap = NULL; DrawablePtr pDraw; DepthPtr pDepth; int i, j, result, rc; ShmDescPtr shmdesc; REQUEST(xShmCreatePixmapReq); unsigned int width, height, depth; unsigned long size; PanoramiXRes *newPix; REQUEST_SIZE_MATCH(xShmCreatePixmapReq); client->errorValue = stuff->pid; if (!sharedPixmaps) return BadImplementation; LEGAL_NEW_RESOURCE(stuff->pid, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, DixGetAttrAccess); if (rc != Success) return rc; VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); width = stuff->width; height = stuff->height; depth = stuff->depth; if (!width || !height || !depth) { client->errorValue = 0; return BadValue; } if (width > 32767 || height > 32767) return BadAlloc; if (stuff->depth != 1) { pDepth = pDraw->pScreen->allowedDepths; for (i = 0; i < pDraw->pScreen->numDepths; i++, pDepth++) if (pDepth->depth == stuff->depth) goto CreatePmap; client->errorValue = stuff->depth; return BadValue; } CreatePmap: size = PixmapBytePad(width, depth) * height; if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) { if (size < width * height) return BadAlloc; } /* thankfully, offset is unsigned */ if (stuff->offset + size < size) return BadAlloc; VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); if (!(newPix = malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPix->type = XRT_PIXMAP; newPix->u.pix.shared = TRUE; panoramix_setup_ids(newPix, client, stuff->pid); result = Success; FOR_NSCREENS(j) { ShmScrPrivateRec *screen_priv; pScreen = screenInfo.screens[j]; screen_priv = ShmGetScreenPriv(pScreen); pMap = (*screen_priv->shmFuncs->CreatePixmap) (pScreen, stuff->width, stuff->height, stuff->depth, shmdesc->addr + stuff->offset); if (pMap) { dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = newPix->info[j].id; if (!AddResource(newPix->info[j].id, RT_PIXMAP, (void *) pMap)) { result = BadAlloc; break; } } else { result = BadAlloc; break; } } if (result == BadAlloc) { while (j--) FreeResource(newPix->info[j].id, RT_NONE); free(newPix); } else AddResource(stuff->pid, XRT_PIXMAP, newPix); return result; } #endif static PixmapPtr fbShmCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, char *addr) { PixmapPtr pPixmap; pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, pScreen->rootDepth, 0); if (!pPixmap) return NullPixmap; if (!(*pScreen->ModifyPixmapHeader) (pPixmap, width, height, depth, BitsPerPixel(depth), PixmapBytePad(width, depth), (void *) addr)) { (*pScreen->DestroyPixmap) (pPixmap); return NullPixmap; } return pPixmap; } static int ProcShmCreatePixmap(ClientPtr client) { PixmapPtr pMap; DrawablePtr pDraw; DepthPtr pDepth; int i, rc; ShmDescPtr shmdesc; ShmScrPrivateRec *screen_priv; REQUEST(xShmCreatePixmapReq); unsigned int width, height, depth; unsigned long size; REQUEST_SIZE_MATCH(xShmCreatePixmapReq); client->errorValue = stuff->pid; if (!sharedPixmaps) return BadImplementation; LEGAL_NEW_RESOURCE(stuff->pid, client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, DixGetAttrAccess); if (rc != Success) return rc; VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); width = stuff->width; height = stuff->height; depth = stuff->depth; if (!width || !height || !depth) { client->errorValue = 0; return BadValue; } if (width > 32767 || height > 32767) return BadAlloc; if (stuff->depth != 1) { pDepth = pDraw->pScreen->allowedDepths; for (i = 0; i < pDraw->pScreen->numDepths; i++, pDepth++) if (pDepth->depth == stuff->depth) goto CreatePmap; client->errorValue = stuff->depth; return BadValue; } CreatePmap: size = PixmapBytePad(width, depth) * height; if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) { if (size < width * height) return BadAlloc; } /* thankfully, offset is unsigned */ if (stuff->offset + size < size) return BadAlloc; VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); screen_priv = ShmGetScreenPriv(pDraw->pScreen); pMap = (*screen_priv->shmFuncs->CreatePixmap) (pDraw->pScreen, stuff->width, stuff->height, stuff->depth, shmdesc->addr + stuff->offset); if (pMap) { rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess); if (rc != Success) { pDraw->pScreen->DestroyPixmap(pMap); return rc; } dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; if (AddResource(stuff->pid, RT_PIXMAP, (void *) pMap)) { return Success; } } return BadAlloc; } #ifdef SHM_FD_PASSING static void ShmBusfaultNotify(void *context) { ShmDescPtr shmdesc = context; ErrorF("shared memory 0x%x truncated by client\n", (unsigned int) shmdesc->resource); busfault_unregister(shmdesc->busfault); shmdesc->busfault = NULL; FreeResource (shmdesc->resource, RT_NONE); } static int ProcShmAttachFd(ClientPtr client) { int fd; ShmDescPtr shmdesc; REQUEST(xShmAttachFdReq); struct stat statb; SetReqFds(client, 1); REQUEST_SIZE_MATCH(xShmAttachFdReq); LEGAL_NEW_RESOURCE(stuff->shmseg, client); if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { client->errorValue = stuff->readOnly; return BadValue; } fd = ReadFdFromClient(client); if (fd < 0) return BadMatch; if (fstat(fd, &statb) < 0 || statb.st_size == 0) { close(fd); return BadMatch; } shmdesc = malloc(sizeof(ShmDescRec)); if (!shmdesc) { close(fd); return BadAlloc; } shmdesc->is_fd = TRUE; shmdesc->addr = mmap(NULL, statb.st_size, stuff->readOnly ? PROT_READ : PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); close(fd); if (shmdesc->addr == ((char *) -1)) { free(shmdesc); return BadAccess; } shmdesc->refcnt = 1; shmdesc->writable = !stuff->readOnly; shmdesc->size = statb.st_size; shmdesc->resource = stuff->shmseg; shmdesc->busfault = busfault_register_mmap(shmdesc->addr, shmdesc->size, ShmBusfaultNotify, shmdesc); if (!shmdesc->busfault) { munmap(shmdesc->addr, shmdesc->size); free(shmdesc); return BadAlloc; } shmdesc->next = Shmsegs; Shmsegs = shmdesc; if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) return BadAlloc; return Success; } static int shm_tmpfile(void) { #ifdef SHMDIR int fd; int flags; char template[] = SHMDIR "/shmfd-XXXXXX"; #ifdef O_TMPFILE fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); if (fd >= 0) { ErrorF ("Using O_TMPFILE\n"); return fd; } ErrorF ("Not using O_TMPFILE\n"); #endif fd = mkstemp(template); if (fd < 0) return -1; unlink(template); if (fcntl(fd, F_GETFD, &flags) >= 0) { flags |= FD_CLOEXEC; (void) fcntl(fd, F_SETFD, &flags); } return fd; #else return -1; #endif } static int ProcShmCreateSegment(ClientPtr client) { int fd; ShmDescPtr shmdesc; REQUEST(xShmCreateSegmentReq); xShmCreateSegmentReply rep = { .type = X_Reply, .nfd = 1, .sequenceNumber = client->sequence, .length = 0, }; REQUEST_SIZE_MATCH(xShmCreateSegmentReq); if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { client->errorValue = stuff->readOnly; return BadValue; } fd = shm_tmpfile(); if (fd < 0) return BadAlloc; if (ftruncate(fd, stuff->size) < 0) { close(fd); return BadAlloc; } shmdesc = malloc(sizeof(ShmDescRec)); if (!shmdesc) { close(fd); return BadAlloc; } shmdesc->is_fd = TRUE; shmdesc->addr = mmap(NULL, stuff->size, stuff->readOnly ? PROT_READ : PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (shmdesc->addr == ((char *) -1)) { close(fd); free(shmdesc); return BadAccess; } shmdesc->refcnt = 1; shmdesc->writable = !stuff->readOnly; shmdesc->size = stuff->size; shmdesc->busfault = busfault_register_mmap(shmdesc->addr, shmdesc->size, ShmBusfaultNotify, shmdesc); if (!shmdesc->busfault) { close(fd); munmap(shmdesc->addr, shmdesc->size); free(shmdesc); return BadAlloc; } shmdesc->next = Shmsegs; Shmsegs = shmdesc; if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) { close(fd); return BadAlloc; } if (WriteFdToClient(client, fd, TRUE) < 0) { FreeResource(stuff->shmseg, RT_NONE); close(fd); return BadAlloc; } WriteToClient(client, sizeof (xShmCreateSegmentReply), &rep); return Success; } #endif /* SHM_FD_PASSING */ static int ProcShmDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_ShmQueryVersion: return ProcShmQueryVersion(client); case X_ShmAttach: return ProcShmAttach(client); case X_ShmDetach: return ProcShmDetach(client); case X_ShmPutImage: #ifdef PANORAMIX if (!noPanoramiXExtension) return ProcPanoramiXShmPutImage(client); #endif return ProcShmPutImage(client); case X_ShmGetImage: #ifdef PANORAMIX if (!noPanoramiXExtension) return ProcPanoramiXShmGetImage(client); #endif return ProcShmGetImage(client); case X_ShmCreatePixmap: #ifdef PANORAMIX if (!noPanoramiXExtension) return ProcPanoramiXShmCreatePixmap(client); #endif return ProcShmCreatePixmap(client); #ifdef SHM_FD_PASSING case X_ShmAttachFd: return ProcShmAttachFd(client); case X_ShmCreateSegment: return ProcShmCreateSegment(client); #endif default: return BadRequest; } } static void SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to) { to->type = from->type; cpswaps(from->sequenceNumber, to->sequenceNumber); cpswapl(from->drawable, to->drawable); cpswaps(from->minorEvent, to->minorEvent); to->majorEvent = from->majorEvent; cpswapl(from->shmseg, to->shmseg); cpswapl(from->offset, to->offset); } static int SProcShmQueryVersion(ClientPtr client) { REQUEST(xShmQueryVersionReq); swaps(&stuff->length); return ProcShmQueryVersion(client); } static int SProcShmAttach(ClientPtr client) { REQUEST(xShmAttachReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmAttachReq); swapl(&stuff->shmseg); swapl(&stuff->shmid); return ProcShmAttach(client); } static int SProcShmDetach(ClientPtr client) { REQUEST(xShmDetachReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmDetachReq); swapl(&stuff->shmseg); return ProcShmDetach(client); } static int SProcShmPutImage(ClientPtr client) { REQUEST(xShmPutImageReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmPutImageReq); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->totalWidth); swaps(&stuff->totalHeight); swaps(&stuff->srcX); swaps(&stuff->srcY); swaps(&stuff->srcWidth); swaps(&stuff->srcHeight); swaps(&stuff->dstX); swaps(&stuff->dstY); swapl(&stuff->shmseg); swapl(&stuff->offset); return ProcShmPutImage(client); } static int SProcShmGetImage(ClientPtr client) { REQUEST(xShmGetImageReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmGetImageReq); swapl(&stuff->drawable); swaps(&stuff->x); swaps(&stuff->y); swaps(&stuff->width); swaps(&stuff->height); swapl(&stuff->planeMask); swapl(&stuff->shmseg); swapl(&stuff->offset); return ProcShmGetImage(client); } static int SProcShmCreatePixmap(ClientPtr client) { REQUEST(xShmCreatePixmapReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmCreatePixmapReq); swapl(&stuff->pid); swapl(&stuff->drawable); swaps(&stuff->width); swaps(&stuff->height); swapl(&stuff->shmseg); swapl(&stuff->offset); return ProcShmCreatePixmap(client); } #ifdef SHM_FD_PASSING static int SProcShmAttachFd(ClientPtr client) { REQUEST(xShmAttachFdReq); SetReqFds(client, 1); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmAttachFdReq); swapl(&stuff->shmseg); return ProcShmAttachFd(client); } static int SProcShmCreateSegment(ClientPtr client) { REQUEST(xShmCreateSegmentReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmCreateSegmentReq); swapl(&stuff->shmseg); swapl(&stuff->size); return ProcShmCreateSegment(client); } #endif /* SHM_FD_PASSING */ static int SProcShmDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_ShmQueryVersion: return SProcShmQueryVersion(client); case X_ShmAttach: return SProcShmAttach(client); case X_ShmDetach: return SProcShmDetach(client); case X_ShmPutImage: return SProcShmPutImage(client); case X_ShmGetImage: return SProcShmGetImage(client); case X_ShmCreatePixmap: return SProcShmCreatePixmap(client); #ifdef SHM_FD_PASSING case X_ShmAttachFd: return SProcShmAttachFd(client); case X_ShmCreateSegment: return SProcShmCreateSegment(client); #endif default: return BadRequest; } } void ShmExtensionInit(void) { ExtensionEntry *extEntry; int i; #ifdef MUST_CHECK_FOR_SHM_SYSCALL if (!CheckForShmSyscall()) { ErrorF("MIT-SHM extension disabled due to lack of kernel support\n"); return; } #endif if (!ShmRegisterPrivates()) return; sharedPixmaps = xFalse; { sharedPixmaps = xTrue; for (i = 0; i < screenInfo.numScreens; i++) { ShmScrPrivateRec *screen_priv = ShmInitScreenPriv(screenInfo.screens[i]); if (!screen_priv->shmFuncs) screen_priv->shmFuncs = &miFuncs; if (!screen_priv->shmFuncs->CreatePixmap) sharedPixmaps = xFalse; } if (sharedPixmaps) for (i = 0; i < screenInfo.numScreens; i++) { ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(screenInfo.screens[i]); screen_priv->destroyPixmap = screenInfo.screens[i]->DestroyPixmap; screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap; } } ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg"); if (ShmSegType && (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors, ProcShmDispatch, SProcShmDispatch, ShmResetProc, StandardMinorOpcode))) { ShmReqCode = (unsigned char) extEntry->base; ShmCompletionCode = extEntry->eventBase; BadShmSegCode = extEntry->errorBase; SetResourceTypeErrorValue(ShmSegType, BadShmSegCode); EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent; } } ��������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xace.c����������������������������������������������������������������������0000664�0001751�0001751�00000025037�12274325511�013036� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdarg.h> #include "scrnintstr.h" #include "extnsionst.h" #include "pixmapstr.h" #include "regionstr.h" #include "gcstruct.h" #include "xacestr.h" #define XSERV_t #define TRANS_SERVER #include <X11/Xtrans/Xtrans.h> #include "../os/osdep.h" _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 }; /* Special-cased hook functions. Called by Xserver. */ int XaceHookDispatch(ClientPtr client, int major) { /* Call the audit begin callback, there is no return value. */ XaceAuditRec rec = { client, 0 }; CallCallbacks(&XaceHooks[XACE_AUDIT_BEGIN], &rec); if (major < 128) { /* Call the core dispatch hook */ 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 erec = { client, ext, DixUseAccess, Success }; if (ext) CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec); /* On error, pretend extension doesn't exist */ return (erec.status == Success) ? Success : BadRequest; } } int XaceHookPropertyAccess(ClientPtr client, WindowPtr pWin, PropertyPtr *ppProp, Mask access_mode) { XacePropertyAccessRec rec = { client, pWin, ppProp, access_mode, Success }; CallCallbacks(&XaceHooks[XACE_PROPERTY_ACCESS], &rec); return rec.status; } int XaceHookSelectionAccess(ClientPtr client, Selection ** ppSel, Mask access_mode) { XaceSelectionAccessRec rec = { client, ppSel, access_mode, Success }; CallCallbacks(&XaceHooks[XACE_SELECTION_ACCESS], &rec); return rec.status; } void XaceHookAuditEnd(ClientPtr ptr, int result) { XaceAuditRec rec = { ptr, result }; /* call callbacks, there is no return value. */ CallCallbacks(&XaceHooks[XACE_AUDIT_END], &rec); } /* Entry point for hook functions. Called by Xserver. */ int XaceHook(int hook, ...) { union { XaceResourceAccessRec res; XaceDeviceAccessRec dev; XaceSendAccessRec send; XaceReceiveAccessRec recv; XaceClientAccessRec client; XaceExtAccessRec ext; XaceServerAccessRec server; XaceScreenAccessRec screen; XaceAuthAvailRec auth; XaceKeyAvailRec key; } u; int *prv = NULL; /* points to return value from callback */ va_list ap; /* argument list */ if (!XaceHooks[hook]) return Success; va_start(ap, hook); /* Marshal arguments for passing to callback. * Each callback has its own case, which sets up a structure to hold * the arguments and integer return parameter, or in some cases just * sets calldata directly to a single argument (with no return result) */ switch (hook) { case XACE_RESOURCE_ACCESS: u.res.client = va_arg(ap, ClientPtr); u.res.id = va_arg(ap, XID); u.res.rtype = va_arg(ap, RESTYPE); u.res.res = va_arg(ap, void *); u.res.ptype = va_arg(ap, RESTYPE); u.res.parent = va_arg(ap, void *); u.res.access_mode = va_arg(ap, Mask); u.res.status = Success; /* default allow */ prv = &u.res.status; break; case XACE_DEVICE_ACCESS: u.dev.client = va_arg(ap, ClientPtr); u.dev.dev = va_arg(ap, DeviceIntPtr); u.dev.access_mode = va_arg(ap, Mask); u.dev.status = Success; /* default allow */ prv = &u.dev.status; break; case XACE_SEND_ACCESS: u.send.client = va_arg(ap, ClientPtr); u.send.dev = va_arg(ap, DeviceIntPtr); u.send.pWin = va_arg(ap, WindowPtr); u.send.events = va_arg(ap, xEventPtr); u.send.count = va_arg(ap, int); u.send.status = Success; /* default allow */ prv = &u.send.status; break; case XACE_RECEIVE_ACCESS: u.recv.client = va_arg(ap, ClientPtr); u.recv.pWin = va_arg(ap, WindowPtr); u.recv.events = va_arg(ap, xEventPtr); u.recv.count = va_arg(ap, int); u.recv.status = Success; /* default allow */ prv = &u.recv.status; break; case XACE_CLIENT_ACCESS: u.client.client = va_arg(ap, ClientPtr); u.client.target = va_arg(ap, ClientPtr); u.client.access_mode = va_arg(ap, Mask); u.client.status = Success; /* default allow */ prv = &u.client.status; break; case XACE_EXT_ACCESS: u.ext.client = va_arg(ap, ClientPtr); u.ext.ext = va_arg(ap, ExtensionEntry *); u.ext.access_mode = DixGetAttrAccess; u.ext.status = Success; /* default allow */ prv = &u.ext.status; break; case XACE_SERVER_ACCESS: u.server.client = va_arg(ap, ClientPtr); u.server.access_mode = va_arg(ap, Mask); u.server.status = Success; /* default allow */ prv = &u.server.status; break; case XACE_SCREEN_ACCESS: case XACE_SCREENSAVER_ACCESS: u.screen.client = va_arg(ap, ClientPtr); u.screen.screen = va_arg(ap, ScreenPtr); u.screen.access_mode = va_arg(ap, Mask); u.screen.status = Success; /* default allow */ prv = &u.screen.status; break; case XACE_AUTH_AVAIL: u.auth.client = va_arg(ap, ClientPtr); u.auth.authId = va_arg(ap, XID); break; case XACE_KEY_AVAIL: u.key.event = va_arg(ap, xEventPtr); u.key.keybd = va_arg(ap, DeviceIntPtr); u.key.count = va_arg(ap, int); break; default: va_end(ap); return 0; /* unimplemented hook number */ } va_end(ap); /* call callbacks and return result, if any. */ CallCallbacks(&XaceHooks[hook], &u); return prv ? *prv : Success; } /* XaceCensorImage * * Called after pScreen->GetImage to prevent pieces or trusted windows from * being returned in image data from an untrusted window. * * Arguments: * client is the client doing the GetImage. * pVisibleRegion is the visible region of the window. * widthBytesLine is the width in bytes of one horizontal line in pBuf. * pDraw is the source window. * x, y, w, h is the rectangle of image data from pDraw in pBuf. * format is the format of the image data in pBuf: ZPixmap or XYPixmap. * pBuf is the image data. * * Returns: nothing. * * Side Effects: * Any part of the rectangle (x, y, w, h) that is outside the visible * region of the window will be destroyed (overwritten) in pBuf. */ void XaceCensorImage(ClientPtr client, RegionPtr pVisibleRegion, long widthBytesLine, DrawablePtr pDraw, int x, int y, int w, int h, unsigned int format, char *pBuf) { RegionRec imageRegion; /* region representing x,y,w,h */ RegionRec censorRegion; /* region to obliterate */ BoxRec imageBox; int nRects; imageBox.x1 = x; imageBox.y1 = y; imageBox.x2 = x + w; imageBox.y2 = y + h; RegionInit(&imageRegion, &imageBox, 1); RegionNull(&censorRegion); /* censorRegion = imageRegion - visibleRegion */ RegionSubtract(&censorRegion, &imageRegion, pVisibleRegion); nRects = RegionNumRects(&censorRegion); if (nRects > 0) { /* we have something to censor */ GCPtr pScratchGC = NULL; PixmapPtr pPix = NULL; xRectangle *pRects = NULL; Bool failed = FALSE; int depth = 1; int bitsPerPixel = 1; int i; BoxPtr pBox; /* convert region to list-of-rectangles for PolyFillRect */ pRects = malloc(nRects * sizeof(xRectangle)); if (!pRects) { failed = TRUE; goto failSafe; } for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) { pRects[i].x = pBox->x1; pRects[i].y = pBox->y1 - imageBox.y1; pRects[i].width = pBox->x2 - pBox->x1; pRects[i].height = pBox->y2 - pBox->y1; } /* use pBuf as a fake pixmap */ if (format == ZPixmap) { depth = pDraw->depth; bitsPerPixel = pDraw->bitsPerPixel; } pPix = GetScratchPixmapHeader(pDraw->pScreen, w, h, depth, bitsPerPixel, widthBytesLine, (void *) pBuf); if (!pPix) { failed = TRUE; goto failSafe; } pScratchGC = GetScratchGC(depth, pPix->drawable.pScreen); if (!pScratchGC) { failed = TRUE; goto failSafe; } ValidateGC(&pPix->drawable, pScratchGC); (*pScratchGC->ops->PolyFillRect) (&pPix->drawable, pScratchGC, nRects, pRects); failSafe: if (failed) { /* Censoring was not completed above. To be safe, wipe out * all the image data so that nothing trusted gets out. */ memset(pBuf, 0, (int) (widthBytesLine * h)); } free(pRects); if (pScratchGC) FreeScratchGC(pScratchGC); if (pPix) FreeScratchPixmapHeader(pPix); } RegionUninit(&imageRegion); RegionUninit(&censorRegion); } /* XaceCensorImage */ /* * Xtrans wrappers for use by modules */ int XaceGetConnectionNumber(ClientPtr client) { XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn; return _XSERVTransGetConnectionNumber(ci); } int XaceIsLocal(ClientPtr client) { XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn; return _XSERVTransIsLocal(ci); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xvmain.c��������������������������������������������������������������������0000664�0001751�0001751�00000070062�12456571574�013434� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*********************************************************** Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, and the Massachusetts Institute of Technology, Cambridge, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* ** File: ** ** xvmain.c --- Xv server extension main device independent module. ** ** Author: ** ** David Carver (Digital Workstation Engineering/Project Athena) ** ** Revisions: ** ** 04.09.91 Carver ** - change: stop video always generates an event even when video ** wasn't active ** ** 29.08.91 Carver ** - change: unrealizing windows no longer preempts video ** ** 11.06.91 Carver ** - changed SetPortControl to SetPortAttribute ** - changed GetPortControl to GetPortAttribute ** - changed QueryBestSize ** ** 28.05.91 Carver ** - fixed Put and Get requests to not preempt operations to same drawable ** ** 15.05.91 Carver ** - version 2.0 upgrade ** ** 19.03.91 Carver ** - fixed Put and Get requests to honor grabbed ports. ** - fixed Video requests to update di structure with new drawable, and ** client after calling ddx. ** ** 24.01.91 Carver ** - version 1.4 upgrade ** ** Notes: ** ** Port structures reference client structures in a two different ** ways: when grabs, or video is active. Each reference is encoded ** as fake client resources and thus when the client is goes away so ** does the reference (it is zeroed). No other action is taken, so ** video doesn't necessarily stop. It probably will as a result of ** other resources going away, but if a client starts video using ** none of its own resources, then the video will continue to play ** after the client disappears. ** ** */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "scrnintstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "gcstruct.h" #include "extnsionst.h" #include "extinit.h" #include "dixstruct.h" #include "resource.h" #include "opaque.h" #include "input.h" #define GLOBAL #include <X11/extensions/Xv.h> #include <X11/extensions/Xvproto.h> #include "xvdix.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #include "xvdisp.h" static DevPrivateKeyRec XvScreenKeyRec; #define XvScreenKey (&XvScreenKeyRec) unsigned long XvExtensionGeneration = 0; unsigned long XvScreenGeneration = 0; unsigned long XvResourceGeneration = 0; int XvReqCode; int XvEventBase; int XvErrorBase; RESTYPE XvRTPort; RESTYPE XvRTEncoding; RESTYPE XvRTGrab; RESTYPE XvRTVideoNotify; RESTYPE XvRTVideoNotifyList; RESTYPE XvRTPortNotify; /* EXTERNAL */ static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *); static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *); static Bool CreateResourceTypes(void); static Bool XvCloseScreen(ScreenPtr); static Bool XvDestroyPixmap(PixmapPtr); static Bool XvDestroyWindow(WindowPtr); static void XvResetProc(ExtensionEntry *); static int XvdiDestroyGrab(void *, XID); static int XvdiDestroyEncoding(void *, XID); static int XvdiDestroyVideoNotify(void *, XID); static int XvdiDestroyPortNotify(void *, XID); static int XvdiDestroyVideoNotifyList(void *, XID); static int XvdiDestroyPort(void *, XID); static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int); /* ** XvExtensionInit ** ** */ void XvExtensionInit(void) { ExtensionEntry *extEntry; if (!dixRegisterPrivateKey(&XvScreenKeyRec, PRIVATE_SCREEN, 0)) return; /* Look to see if any screens were initialized; if not then init global variables so the extension can function */ if (XvScreenGeneration != serverGeneration) { if (!CreateResourceTypes()) { ErrorF("XvExtensionInit: Unable to allocate resource types\n"); return; } #ifdef PANORAMIX XineramaRegisterConnectionBlockCallback(XineramifyXv); #endif XvScreenGeneration = serverGeneration; } if (XvExtensionGeneration != serverGeneration) { XvExtensionGeneration = serverGeneration; extEntry = AddExtension(XvName, XvNumEvents, XvNumErrors, ProcXvDispatch, SProcXvDispatch, XvResetProc, StandardMinorOpcode); if (!extEntry) { FatalError("XvExtensionInit: AddExtensions failed\n"); } XvReqCode = extEntry->base; XvEventBase = extEntry->eventBase; XvErrorBase = extEntry->errorBase; EventSwapVector[XvEventBase + XvVideoNotify] = (EventSwapPtr) WriteSwappedVideoNotifyEvent; EventSwapVector[XvEventBase + XvPortNotify] = (EventSwapPtr) WriteSwappedPortNotifyEvent; SetResourceTypeErrorValue(XvRTPort, _XvBadPort); (void) MakeAtom(XvName, strlen(XvName), xTrue); } } static Bool CreateResourceTypes(void) { if (XvResourceGeneration == serverGeneration) return TRUE; XvResourceGeneration = serverGeneration; if (!(XvRTPort = CreateNewResourceType(XvdiDestroyPort, "XvRTPort"))) { ErrorF("CreateResourceTypes: failed to allocate port resource.\n"); return FALSE; } if (!(XvRTGrab = CreateNewResourceType(XvdiDestroyGrab, "XvRTGrab"))) { ErrorF("CreateResourceTypes: failed to allocate grab resource.\n"); return FALSE; } if (!(XvRTEncoding = CreateNewResourceType(XvdiDestroyEncoding, "XvRTEncoding"))) { ErrorF("CreateResourceTypes: failed to allocate encoding resource.\n"); return FALSE; } if (!(XvRTVideoNotify = CreateNewResourceType(XvdiDestroyVideoNotify, "XvRTVideoNotify"))) { ErrorF ("CreateResourceTypes: failed to allocate video notify resource.\n"); return FALSE; } if (! (XvRTVideoNotifyList = CreateNewResourceType(XvdiDestroyVideoNotifyList, "XvRTVideoNotifyList"))) { ErrorF ("CreateResourceTypes: failed to allocate video notify list resource.\n"); return FALSE; } if (!(XvRTPortNotify = CreateNewResourceType(XvdiDestroyPortNotify, "XvRTPortNotify"))) { ErrorF ("CreateResourceTypes: failed to allocate port notify resource.\n"); return FALSE; } return TRUE; } int XvScreenInit(ScreenPtr pScreen) { XvScreenPtr pxvs; if (XvScreenGeneration != serverGeneration) { if (!CreateResourceTypes()) { ErrorF("XvScreenInit: Unable to allocate resource types\n"); return BadAlloc; } #ifdef PANORAMIX XineramaRegisterConnectionBlockCallback(XineramifyXv); #endif XvScreenGeneration = serverGeneration; } if (!dixRegisterPrivateKey(&XvScreenKeyRec, PRIVATE_SCREEN, 0)) return BadAlloc; if (dixLookupPrivate(&pScreen->devPrivates, XvScreenKey)) { ErrorF("XvScreenInit: screen devPrivates ptr non-NULL before init\n"); } /* ALLOCATE SCREEN PRIVATE RECORD */ pxvs = malloc(sizeof(XvScreenRec)); if (!pxvs) { ErrorF("XvScreenInit: Unable to allocate screen private structure\n"); return BadAlloc; } dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs); pxvs->DestroyPixmap = pScreen->DestroyPixmap; pxvs->DestroyWindow = pScreen->DestroyWindow; pxvs->CloseScreen = pScreen->CloseScreen; pScreen->DestroyPixmap = XvDestroyPixmap; pScreen->DestroyWindow = XvDestroyWindow; pScreen->CloseScreen = XvCloseScreen; return Success; } static Bool XvCloseScreen(ScreenPtr pScreen) { XvScreenPtr pxvs; pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey); pScreen->DestroyPixmap = pxvs->DestroyPixmap; pScreen->DestroyWindow = pxvs->DestroyWindow; pScreen->CloseScreen = pxvs->CloseScreen; free(pxvs); dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL); return (*pScreen->CloseScreen) (pScreen); } static void XvResetProc(ExtensionEntry * extEntry) { XvResetProcVector(); } DevPrivateKey XvGetScreenKey(void) { return XvScreenKey; } unsigned long XvGetRTPort(void) { return XvRTPort; } static Bool XvDestroyPixmap(PixmapPtr pPix) { Bool status; ScreenPtr pScreen; XvScreenPtr pxvs; XvAdaptorPtr pa; int na; XvPortPtr pp; int np; pScreen = pPix->drawable.pScreen; SCREEN_PROLOGUE(pScreen, DestroyPixmap); pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey); /* CHECK TO SEE IF THIS PORT IS IN USE */ pa = pxvs->pAdaptors; na = pxvs->nAdaptors; while (na--) { np = pa->nPorts; pp = pa->pPorts; while (np--) { if (pp->pDraw == (DrawablePtr) pPix) { XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted); (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw); pp->pDraw = NULL; pp->client = NULL; pp->time = currentTime; } pp++; } pa++; } status = (*pScreen->DestroyPixmap) (pPix); SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap); return status; } static Bool XvDestroyWindow(WindowPtr pWin) { Bool status; ScreenPtr pScreen; XvScreenPtr pxvs; XvAdaptorPtr pa; int na; XvPortPtr pp; int np; pScreen = pWin->drawable.pScreen; SCREEN_PROLOGUE(pScreen, DestroyWindow); pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey); /* CHECK TO SEE IF THIS PORT IS IN USE */ pa = pxvs->pAdaptors; na = pxvs->nAdaptors; while (na--) { np = pa->nPorts; pp = pa->pPorts; while (np--) { if (pp->pDraw == (DrawablePtr) pWin) { XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted); (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw); pp->pDraw = NULL; pp->client = NULL; pp->time = currentTime; } pp++; } pa++; } status = (*pScreen->DestroyWindow) (pWin); SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow); return status; } static int XvdiDestroyPort(void *pPort, XID id) { return Success; } static int XvdiDestroyGrab(void *pGrab, XID id) { ((XvGrabPtr) pGrab)->client = NULL; return Success; } static int XvdiDestroyVideoNotify(void *pn, XID id) { /* JUST CLEAR OUT THE client POINTER FIELD */ ((XvVideoNotifyPtr) pn)->client = NULL; return Success; } static int XvdiDestroyPortNotify(void *pn, XID id) { /* JUST CLEAR OUT THE client POINTER FIELD */ ((XvPortNotifyPtr) pn)->client = NULL; return Success; } static int XvdiDestroyVideoNotifyList(void *pn, XID id) { XvVideoNotifyPtr npn, cpn; /* ACTUALLY DESTROY THE NOTITY LIST */ cpn = (XvVideoNotifyPtr) pn; while (cpn) { npn = cpn->next; if (cpn->client) FreeResource(cpn->id, XvRTVideoNotify); free(cpn); cpn = npn; } return Success; } static int XvdiDestroyEncoding(void *value, XID id) { return Success; } static int XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason) { XvVideoNotifyPtr pn; dixLookupResourceByType((void **) &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; WriteEventsToClient(pn->client, 1, (xEventPtr) &event); pn = pn->next; } return Success; } int XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value) { 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; WriteEventsToClient(pn->client, 1, (xEventPtr) &event); pn = pn->next; } return Success; } #define CHECK_SIZE(dw, dh, sw, sh) { \ if(!dw || !dh || !sw || !sh) return Success; \ /* The region code will break these if they are too large */ \ if((dw > 32767) || (dh > 32767) || (sw > 32767) || (sh > 32767)) \ return BadValue; \ } int XvdiPutVideo(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { DrawablePtr pOldDraw; CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ UpdateCurrentTime(); /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN INFORM CLIENT OF ITS FAILURE */ if (pPort->grab.client && (pPort->grab.client != client)) { XvdiSendVideoNotify(pPort, pDraw, XvBusy); return Success; } /* CHECK TO SEE IF PORT IS IN USE; IF SO THEN WE MUST DELIVER INTERRUPTED EVENTS TO ANY CLIENTS WHO WANT THEM */ pOldDraw = pPort->pDraw; if ((pOldDraw) && (pOldDraw != pDraw)) { XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } (void) (*pPort->pAdaptor->ddPutVideo) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); if ((pPort->pDraw) && (pOldDraw != pDraw)) { pPort->client = client; XvdiSendVideoNotify(pPort, pPort->pDraw, XvStarted); } pPort->time = currentTime; return Success; } int XvdiPutStill(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { int status; CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ UpdateCurrentTime(); /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN INFORM CLIENT OF ITS FAILURE */ if (pPort->grab.client && (pPort->grab.client != client)) { XvdiSendVideoNotify(pPort, pDraw, XvBusy); return Success; } pPort->time = currentTime; status = (*pPort->pAdaptor->ddPutStill) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); return status; } int XvdiPutImage(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 src_x, INT16 src_y, CARD16 src_w, CARD16 src_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h, XvImagePtr image, unsigned char *data, Bool sync, CARD16 width, CARD16 height) { CHECK_SIZE(drw_w, drw_h, src_w, src_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ UpdateCurrentTime(); /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN INFORM CLIENT OF ITS FAILURE */ if (pPort->grab.client && (pPort->grab.client != client)) { XvdiSendVideoNotify(pPort, pDraw, XvBusy); return Success; } pPort->time = currentTime; return (*pPort->pAdaptor->ddPutImage) (pDraw, pPort, pGC, src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h, image, data, sync, width, height); } int XvdiGetVideo(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { DrawablePtr pOldDraw; CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ UpdateCurrentTime(); /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN INFORM CLIENT OF ITS FAILURE */ if (pPort->grab.client && (pPort->grab.client != client)) { XvdiSendVideoNotify(pPort, pDraw, XvBusy); return Success; } /* CHECK TO SEE IF PORT IS IN USE; IF SO THEN WE MUST DELIVER INTERRUPTED EVENTS TO ANY CLIENTS WHO WANT THEM */ pOldDraw = pPort->pDraw; if ((pOldDraw) && (pOldDraw != pDraw)) { XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } (void) (*pPort->pAdaptor->ddGetVideo) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); if ((pPort->pDraw) && (pOldDraw != pDraw)) { pPort->client = client; XvdiSendVideoNotify(pPort, pPort->pDraw, XvStarted); } pPort->time = currentTime; return Success; } int XvdiGetStill(ClientPtr client, DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { int status; CHECK_SIZE(drw_w, drw_h, vid_w, vid_h); /* UPDATE TIME VARIABLES FOR USE IN EVENTS */ UpdateCurrentTime(); /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN INFORM CLIENT OF ITS FAILURE */ if (pPort->grab.client && (pPort->grab.client != client)) { XvdiSendVideoNotify(pPort, pDraw, XvBusy); return Success; } status = (*pPort->pAdaptor->ddGetStill) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); pPort->time = currentTime; return status; } int XvdiGrabPort(ClientPtr client, XvPortPtr pPort, Time ctime, int *p_result) { unsigned long id; TimeStamp time; UpdateCurrentTime(); time = ClientTimeToServerTime(ctime); if (pPort->grab.client && (client != pPort->grab.client)) { *p_result = XvAlreadyGrabbed; return Success; } if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, pPort->time) == EARLIER)) { *p_result = XvInvalidTime; return Success; } if (client == pPort->grab.client) { *p_result = Success; return Success; } id = FakeClientID(client->index); if (!AddResource(id, XvRTGrab, &pPort->grab)) { return BadAlloc; } /* IF THERE IS ACTIVE VIDEO THEN STOP IT */ if ((pPort->pDraw) && (client != pPort->client)) { XvdiStopVideo(NULL, pPort, pPort->pDraw); } pPort->grab.client = client; pPort->grab.id = id; pPort->time = currentTime; *p_result = Success; return Success; } int XvdiUngrabPort(ClientPtr client, XvPortPtr pPort, Time ctime) { TimeStamp time; UpdateCurrentTime(); time = ClientTimeToServerTime(ctime); if ((!pPort->grab.client) || (client != pPort->grab.client)) { return Success; } if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, pPort->time) == EARLIER)) { return Success; } /* FREE THE GRAB RESOURCE; AND SET THE GRAB CLIENT TO NULL */ FreeResource(pPort->grab.id, XvRTGrab); pPort->grab.client = NULL; pPort->time = currentTime; return Success; } int XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff) { XvVideoNotifyPtr pn, tpn, fpn; int rc; /* FIND VideoNotify LIST */ rc = dixLookupResourceByType((void **) &pn, pDraw->id, XvRTVideoNotifyList, client, DixWriteAccess); if (rc != Success && rc != BadValue) return rc; /* IF ONE DONES'T EXIST AND NO MASK, THEN JUST RETURN */ if (!onoff && !pn) return Success; /* IF ONE DOESN'T EXIST CREATE IT AND ADD A RESOURCE SO THAT THE LIST WILL BE DELETED WHEN THE DRAWABLE IS DESTROYED */ if (!pn) { if (!(tpn = malloc(sizeof(XvVideoNotifyRec)))) return BadAlloc; tpn->next = NULL; if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn)) { free(tpn); return BadAlloc; } } else { /* LOOK TO SEE IF ENTRY ALREADY EXISTS */ fpn = NULL; tpn = pn; while (tpn) { if (tpn->client == client) { if (!onoff) tpn->client = NULL; return Success; } if (!tpn->client) fpn = tpn; /* TAKE NOTE OF FREE ENTRY */ tpn = tpn->next; } /* IF TUNNING OFF, THEN JUST RETURN */ if (!onoff) return Success; /* IF ONE ISN'T FOUND THEN ALLOCATE ONE AND LINK IT INTO THE LIST */ if (fpn) { tpn = fpn; } else { if (!(tpn = malloc(sizeof(XvVideoNotifyRec)))) return BadAlloc; tpn->next = pn->next; pn->next = tpn; } } /* INIT CLIENT PTR IN CASE WE CAN'T ADD RESOURCE */ /* ADD RESOURCE SO THAT IF CLIENT EXITS THE CLIENT PTR WILL BE CLEARED */ tpn->client = NULL; tpn->id = FakeClientID(client->index); AddResource(tpn->id, XvRTVideoNotify, tpn); tpn->client = client; return Success; } int XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff) { XvPortNotifyPtr pn, tpn; /* SEE IF CLIENT IS ALREADY IN LIST */ tpn = NULL; pn = pPort->pNotify; while (pn) { if (!pn->client) tpn = pn; /* TAKE NOTE OF FREE ENTRY */ if (pn->client == client) break; pn = pn->next; } /* IS THE CLIENT ALREADY ON THE LIST? */ if (pn) { /* REMOVE IT? */ if (!onoff) { pn->client = NULL; FreeResource(pn->id, XvRTPortNotify); } return Success; } /* DIDN'T FIND IT; SO REUSE LIST ELEMENT IF ONE IS FREE OTHERWISE CREATE A NEW ONE AND ADD IT TO THE BEGINNING OF THE LIST */ if (!tpn) { if (!(tpn = malloc(sizeof(XvPortNotifyRec)))) return BadAlloc; tpn->next = pPort->pNotify; pPort->pNotify = tpn; } tpn->client = client; tpn->id = FakeClientID(client->index); AddResource(tpn->id, XvRTPortNotify, tpn); return Success; } int XvdiStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) { int status; /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */ if (!pPort->pDraw || (pPort->pDraw != pDraw)) { XvdiSendVideoNotify(pPort, pDraw, XvStopped); return Success; } /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN INFORM CLIENT OF ITS FAILURE */ if ((client) && (pPort->grab.client) && (pPort->grab.client != client)) { XvdiSendVideoNotify(pPort, pDraw, XvBusy); return Success; } XvdiSendVideoNotify(pPort, pDraw, XvStopped); status = (*pPort->pAdaptor->ddStopVideo) (pPort, pDraw); pPort->pDraw = NULL; pPort->client = (ClientPtr) client; pPort->time = currentTime; return status; } int XvdiMatchPort(XvPortPtr pPort, DrawablePtr pDraw) { XvAdaptorPtr pa; XvFormatPtr pf; int nf; pa = pPort->pAdaptor; if (pa->pScreen != pDraw->pScreen) return BadMatch; nf = pa->nFormats; pf = pa->pFormats; while (nf--) { if (pf->depth == pDraw->depth) return Success; pf++; } return BadMatch; } int XvdiSetPortAttribute(ClientPtr client, XvPortPtr pPort, Atom attribute, INT32 value) { int status; status = (*pPort->pAdaptor->ddSetPortAttribute) (pPort, attribute, value); if (status == Success) XvdiSendPortNotify(pPort, attribute, value); return status; } int XvdiGetPortAttribute(ClientPtr client, XvPortPtr pPort, Atom attribute, INT32 *p_value) { return (*pPort->pAdaptor->ddGetPortAttribute) (pPort, attribute, p_value); } static void WriteSwappedVideoNotifyEvent(xvEvent * from, xvEvent * to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; cpswaps(from->u.videoNotify.sequenceNumber, to->u.videoNotify.sequenceNumber); cpswapl(from->u.videoNotify.time, to->u.videoNotify.time); cpswapl(from->u.videoNotify.drawable, to->u.videoNotify.drawable); cpswapl(from->u.videoNotify.port, to->u.videoNotify.port); } static void WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; cpswaps(from->u.portNotify.sequenceNumber, to->u.portNotify.sequenceNumber); cpswapl(from->u.portNotify.time, to->u.portNotify.time); cpswapl(from->u.portNotify.port, to->u.portNotify.port); cpswapl(from->u.portNotify.value, to->u.portNotify.value); } void XvFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; free(pAdaptor->name); pAdaptor->name = NULL; if (pAdaptor->pEncodings) { XvEncodingPtr pEncode = pAdaptor->pEncodings; for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++) free(pEncode->name); free(pAdaptor->pEncodings); pAdaptor->pEncodings = NULL; } free(pAdaptor->pFormats); pAdaptor->pFormats = NULL; free(pAdaptor->pPorts); pAdaptor->pPorts = NULL; if (pAdaptor->pAttributes) { XvAttributePtr pAttribute = pAdaptor->pAttributes; for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) free(pAttribute->name); free(pAdaptor->pAttributes); pAdaptor->pAttributes = NULL; } free(pAdaptor->pImages); pAdaptor->pImages = NULL; free(pAdaptor->devPriv.ptr); pAdaptor->devPriv.ptr = NULL; } void XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region) { ScreenPtr pScreen = pDraw->pScreen; ChangeGCVal pval[2]; BoxPtr pbox = RegionRects(region); int i, nbox = RegionNumRects(region); xRectangle *rects; GCPtr gc; gc = GetScratchGC(pDraw->depth, pScreen); if (!gc) return; pval[0].val = key; pval[1].val = IncludeInferiors; (void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval); ValidateGC(pDraw, gc); rects = malloc(nbox * sizeof(xRectangle)); if (rects) { for (i = 0; i < nbox; i++, pbox++) { rects[i].x = pbox->x1 - pDraw->x; rects[i].y = pbox->y1 - pDraw->y; rects[i].width = pbox->x2 - pbox->x1; rects[i].height = pbox->y2 - pbox->y1; } (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); free(rects); } FreeScratchGC(gc); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xres.c����������������������������������������������������������������������0000664�0001751�0001751�00000105503�12456571574�013112� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2002 XFree86 Inc */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdio.h> #include <string.h> #include <X11/X.h> #include <X11/Xproto.h> #include <assert.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "swaprep.h" #include "registry.h" #include <X11/extensions/XResproto.h> #include "pixmapstr.h" #include "windowstr.h" #include "gcstruct.h" #include "extinit.h" #include "protocol-versions.h" #include "client.h" #include "list.h" #include "misc.h" #include <string.h> #include "hashtable.h" #include "picturestr.h" #ifdef COMPOSITE #include "compint.h" #endif /** @brief Holds fragments of responses for ConstructClientIds. * * note: there is no consideration for data alignment */ typedef struct { struct xorg_list l; int bytes; /* data follows */ } FragmentList; #define FRAGMENT_DATA(ptr) ((void*) ((char*) (ptr) + sizeof(FragmentList))) /** @brief Holds structure for the generated response to ProcXResQueryClientIds; used by ConstructClientId* -functions */ typedef struct { int numIds; int resultBytes; struct xorg_list response; int sentClientMasks[MAXCLIENTS]; } ConstructClientIdCtx; /** @brief Holds the structure for information required to generate the response to XResQueryResourceBytes. In addition to response it contains information on the query as well, as well as some volatile information required by a few functions that cannot take that information directly via a parameter, as they are called via already-existing higher order functions. */ typedef struct { ClientPtr sendClient; int numSizes; int resultBytes; struct xorg_list response; int status; long numSpecs; xXResResourceIdSpec *specs; HashTable visitedResources; /* Used by AddSubResourceSizeSpec when AddResourceSizeValue is handling crossreferences */ HashTable visitedSubResources; /* used when ConstructResourceBytesCtx is passed to AddResourceSizeValue2 via FindClientResourcesByType */ RESTYPE resType; /* used when ConstructResourceBytesCtx is passed to AddResourceSizeValueByResource from ConstructResourceBytesByResource */ xXResResourceIdSpec *curSpec; /** Used when iterating through a single resource's subresources @see AddSubResourceSizeSpec */ xXResResourceSizeValue *sizeValue; } ConstructResourceBytesCtx; /** @brief Allocate and add a sequence of bytes at the end of a fragment list. Call DestroyFragments to release the list. @param frags A pointer to head of an initialized linked list @param bytes Number of bytes to allocate @return Returns a pointer to the allocated non-zeroed region that is to be filled by the caller. On error (out of memory) returns NULL and makes no changes to the list. */ static void * AddFragment(struct xorg_list *frags, int bytes) { FragmentList *f = malloc(sizeof(FragmentList) + bytes); if (!f) { return NULL; } else { f->bytes = bytes; xorg_list_add(&f->l, frags->prev); return (char*) f + sizeof(*f); } } /** @brief Sends all fragments in the list to the client. Does not free anything. @param client The client to send the fragments to @param frags The head of the list of fragments */ static void WriteFragmentsToClient(ClientPtr client, struct xorg_list *frags) { FragmentList *it; xorg_list_for_each_entry(it, frags, l) { WriteToClient(client, it->bytes, (char*) it + sizeof(*it)); } } /** @brief Frees a list of fragments. Does not free() root node. @param frags The head of the list of fragments */ static void DestroyFragments(struct xorg_list *frags) { FragmentList *it, *tmp; xorg_list_for_each_entry_safe(it, tmp, frags, l) { xorg_list_del(&it->l); free(it); } } /** @brief Constructs a context record for ConstructClientId* functions to use */ static void InitConstructClientIdCtx(ConstructClientIdCtx *ctx) { ctx->numIds = 0; ctx->resultBytes = 0; xorg_list_init(&ctx->response); memset(ctx->sentClientMasks, 0, sizeof(ctx->sentClientMasks)); } /** @brief Destroys a context record, releases all memory (except the storage for *ctx itself) */ static void DestroyConstructClientIdCtx(ConstructClientIdCtx *ctx) { DestroyFragments(&ctx->response); } static Bool InitConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx, ClientPtr sendClient, long numSpecs, xXResResourceIdSpec *specs) { ctx->sendClient = sendClient; ctx->numSizes = 0; ctx->resultBytes = 0; xorg_list_init(&ctx->response); ctx->status = Success; ctx->numSpecs = numSpecs; ctx->specs = specs; ctx->visitedResources = ht_create(sizeof(XID), 0, ht_resourceid_hash, ht_resourceid_compare, NULL); if (!ctx->visitedResources) { return FALSE; } else { return TRUE; } } static void DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx) { DestroyFragments(&ctx->response); ht_destroy(ctx->visitedResources); } static int ProcXResQueryVersion(ClientPtr client) { 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); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.server_major); swaps(&rep.server_minor); } WriteToClient(client, sizeof(xXResQueryVersionReply), &rep); return Success; } static int ProcXResQueryClients(ClientPtr client) { /* REQUEST(xXResQueryClientsReq); */ xXResQueryClientsReply rep; int *current_clients; int i, num_clients; REQUEST_SIZE_MATCH(xXResQueryClientsReq); current_clients = malloc(currentMaxClients * sizeof(int)); num_clients = 0; for (i = 0; i < currentMaxClients; i++) { if (clients[i]) { current_clients[num_clients] = i; num_clients++; } } 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), &rep); if (num_clients) { xXResClient scratch; for (i = 0; i < num_clients; i++) { scratch.resource_base = clients[current_clients[i]]->clientAsMask; scratch.resource_mask = RESOURCE_ID_MASK; if (client->swapped) { swapl(&scratch.resource_base); swapl(&scratch.resource_mask); } WriteToClient(client, sz_xXResClient, &scratch); } } free(current_clients); return Success; } static void ResFindAllRes(void *value, XID id, RESTYPE type, void *cdata) { int *counts = (int *) cdata; counts[(type & TypeMask) - 1]++; } static int ProcXResQueryClientResources(ClientPtr client) { REQUEST(xXResQueryClientResourcesReq); xXResQueryClientResourcesReply rep; int i, clientID, num_types; int *counts; REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq); clientID = CLIENT_ID(stuff->xid); if ((clientID >= currentMaxClients) || !clients[clientID]) { client->errorValue = stuff->xid; return BadValue; } counts = calloc(lastResourceType + 1, sizeof(int)); FindAllClientResources(clients[clientID], ResFindAllRes, counts); num_types = 0; for (i = 0; i <= lastResourceType; i++) { if (counts[i]) num_types++; } 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), &rep); if (num_types) { xXResType scratch; const char *name; for (i = 0; i < lastResourceType; i++) { if (!counts[i]) continue; name = LookupResourceName(i + 1); if (strcmp(name, XREGISTRY_UNKNOWN)) scratch.resource_type = MakeAtom(name, strlen(name), TRUE); else { char buf[40]; snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1); scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE); } scratch.count = counts[i]; if (client->swapped) { swapl(&scratch.resource_type); swapl(&scratch.count); } WriteToClient(client, sz_xXResType, &scratch); } } free(counts); return Success; } static unsigned long ResGetApproxPixmapBytes(PixmapPtr pix) { unsigned long nPixels; float bytesPerPixel; bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0; nPixels = pix->drawable.width * pix->drawable.height; /* Divide by refcnt as pixmap could be shared between clients, * so total pixmap mem is shared between these. */ return (nPixels * bytesPerPixel) / pix->refcnt; } static void ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata) { SizeType sizeFunc = GetResourceTypeSizeFunc(type); ResourceSizeRec size = { 0, 0, 0 }; unsigned long *bytes = cdata; sizeFunc(value, id, &size); *bytes += size.pixmapRefSize; } static void ResFindPixmaps(void *value, XID id, void *cdata) { unsigned long *bytes = (unsigned long *) cdata; PixmapPtr pix = (PixmapPtr) value; *bytes += ResGetApproxPixmapBytes(pix); } static void ResFindWindowPixmaps(void *value, XID id, void *cdata) { unsigned long *bytes = (unsigned long *) cdata; WindowPtr pWin = (WindowPtr) value; if (pWin->backgroundState == BackgroundPixmap) *bytes += ResGetApproxPixmapBytes(pWin->background.pixmap); if (pWin->border.pixmap != NULL && !pWin->borderIsPixel) *bytes += ResGetApproxPixmapBytes(pWin->border.pixmap); } static void ResFindGCPixmaps(void *value, XID id, void *cdata) { unsigned long *bytes = (unsigned long *) cdata; GCPtr pGC = (GCPtr) value; if (pGC->stipple != NULL) *bytes += ResGetApproxPixmapBytes(pGC->stipple); if (pGC->tile.pixmap != NULL && !pGC->tileIsPixel) *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap); } static void ResFindPicturePixmaps(void *value, XID id, void *cdata) { #ifdef RENDER ResFindResourcePixmaps(value, id, PictureType, cdata); #endif } static void ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata) { #ifdef COMPOSITE ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata); #endif } static int ProcXResQueryClientPixmapBytes(ClientPtr client) { REQUEST(xXResQueryClientPixmapBytesReq); xXResQueryClientPixmapBytesReply rep; int clientID; unsigned long bytes; REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq); clientID = CLIENT_ID(stuff->xid); if ((clientID >= currentMaxClients) || !clients[clientID]) { client->errorValue = stuff->xid; return BadValue; } bytes = 0; FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps, (void *) (&bytes)); /* * Make sure win background pixmaps also held to account. */ FindClientResourcesByType(clients[clientID], RT_WINDOW, ResFindWindowPixmaps, (void *) (&bytes)); /* * GC Tile & Stipple pixmaps too. */ FindClientResourcesByType(clients[clientID], RT_GC, ResFindGCPixmaps, (void *) (&bytes)); #ifdef RENDER /* Render extension picture pixmaps. */ FindClientResourcesByType(clients[clientID], PictureType, ResFindPicturePixmaps, (void *)(&bytes)); #endif #ifdef COMPOSITE /* Composite extension client window pixmaps. */ FindClientResourcesByType(clients[clientID], CompositeClientWindowType, ResFindCompositeClientWindowPixmaps, (void *)(&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), &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(void *value, XID id, RESTYPE type, void *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(void *ptr, XID id, RESTYPE type, void *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(void *ptr, XID id, void *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(void *ptr, XID id, RESTYPE type, void *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) { REQUEST(xReq); switch (stuff->data) { case X_XResQueryVersion: return ProcXResQueryVersion(client); case X_XResQueryClients: return ProcXResQueryClients(client); case X_XResQueryClientResources: return ProcXResQueryClientResources(client); case X_XResQueryClientPixmapBytes: return ProcXResQueryClientPixmapBytes(client); case X_XResQueryClientIds: return ProcXResQueryClientIds(client); case X_XResQueryResourceBytes: return ProcXResQueryResourceBytes(client); default: break; } return BadRequest; } static int SProcXResQueryVersion(ClientPtr client) { REQUEST_SIZE_MATCH(xXResQueryVersionReq); return ProcXResQueryVersion(client); } static int SProcXResQueryClientResources(ClientPtr client) { REQUEST(xXResQueryClientResourcesReq); REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq); swapl(&stuff->xid); return ProcXResQueryClientResources(client); } static int SProcXResQueryClientPixmapBytes(ClientPtr client) { REQUEST(xXResQueryClientPixmapBytesReq); REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq); swapl(&stuff->xid); return ProcXResQueryClientPixmapBytes(client); } static int 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); switch (stuff->data) { case X_XResQueryVersion: return SProcXResQueryVersion(client); case X_XResQueryClients: /* nothing to swap */ return ProcXResQueryClients(client); case X_XResQueryClientResources: return SProcXResQueryClientResources(client); case X_XResQueryClientPixmapBytes: return SProcXResQueryClientPixmapBytes(client); case X_XResQueryClientIds: return SProcXResQueryClientIds(client); case X_XResQueryResourceBytes: return SProcXResQueryResourceBytes(client); default: break; } return BadRequest; } void ResExtensionInit(void) { (void) AddExtension(XRES_NAME, 0, 0, ProcResDispatch, SProcResDispatch, NULL, StandardMinorOpcode); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xace.h����������������������������������������������������������������������0000664�0001751�0001751�00000010347�12274325511�013041� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR 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 _XACE_H #define _XACE_H #ifdef XACE #define XACE_MAJOR_VERSION 2 #define XACE_MINOR_VERSION 0 #include "pixmap.h" #include "region.h" #include "window.h" #include "property.h" #include "selection.h" /* Default window background */ #define XaceBackgroundNoneState(w) ((w)->forcedBG ? BackgroundPixel : None) /* security hooks */ /* Constants used to identify the available security hooks */ #define XACE_CORE_DISPATCH 0 #define XACE_EXT_DISPATCH 1 #define XACE_RESOURCE_ACCESS 2 #define XACE_DEVICE_ACCESS 3 #define XACE_PROPERTY_ACCESS 4 #define XACE_SEND_ACCESS 5 #define XACE_RECEIVE_ACCESS 6 #define XACE_CLIENT_ACCESS 7 #define XACE_EXT_ACCESS 8 #define XACE_SERVER_ACCESS 9 #define XACE_SELECTION_ACCESS 10 #define XACE_SCREEN_ACCESS 11 #define XACE_SCREENSAVER_ACCESS 12 #define XACE_AUTH_AVAIL 13 #define XACE_KEY_AVAIL 14 #define XACE_AUDIT_BEGIN 15 #define XACE_AUDIT_END 16 #define XACE_NUM_HOOKS 17 extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS]; /* Entry point for hook functions. Called by Xserver. * Required by libdbe and libextmod */ extern _X_EXPORT int XaceHook(int /*hook */ , ... /*appropriate args for hook */ ); /* Special-cased hook functions */ extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major); extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin, PropertyPtr *ppProp, Mask access_mode); extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel, Mask access_mode); extern _X_EXPORT void XaceHookAuditEnd(ClientPtr ptr, int result); /* Register a callback for a given hook. */ #define XaceRegisterCallback(hook,callback,data) \ AddCallback(XaceHooks+(hook), callback, data) /* Unregister an existing callback for a given hook. */ #define XaceDeleteCallback(hook,callback,data) \ DeleteCallback(XaceHooks+(hook), callback, data) /* XTrans wrappers for use by security modules */ extern _X_EXPORT int XaceGetConnectionNumber(ClientPtr ptr); extern _X_EXPORT int XaceIsLocal(ClientPtr ptr); /* From the original Security extension... */ extern _X_EXPORT void XaceCensorImage(ClientPtr client, RegionPtr pVisibleRegion, long widthBytesLine, DrawablePtr pDraw, int x, int y, int w, int h, unsigned int format, char *pBuf); #else /* XACE */ /* Default window background */ #define XaceBackgroundNoneState(w) None /* Define calls away when XACE is not being built. */ #ifdef __GNUC__ #define XaceHook(args...) Success #define XaceHookDispatch(args...) Success #define XaceHookPropertyAccess(args...) Success #define XaceHookSelectionAccess(args...) Success #define XaceHookAuditEnd(args...) { ; } #define XaceCensorImage(args...) { ; } #else #define XaceHook(...) Success #define XaceHookDispatch(...) Success #define XaceHookPropertyAccess(...) Success #define XaceHookSelectionAccess(...) Success #define XaceHookAuditEnd(...) { ; } #define XaceCensorImage(...) { ; } #endif #endif /* XACE */ #endif /* _XACE_H */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xacestr.h�������������������������������������������������������������������0000664�0001751�0001751�00000006302�12274325511�013566� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR 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 _XACESTR_H #define _XACESTR_H #include "dix.h" #include "resource.h" #include "extnsionst.h" #include "window.h" #include "input.h" #include "property.h" #include "selection.h" #include "xace.h" /* XACE_CORE_DISPATCH */ typedef struct { ClientPtr client; int status; } XaceCoreDispatchRec; /* XACE_RESOURCE_ACCESS */ typedef struct { ClientPtr client; XID id; RESTYPE rtype; void *res; RESTYPE ptype; void *parent; Mask access_mode; int status; } XaceResourceAccessRec; /* XACE_DEVICE_ACCESS */ typedef struct { ClientPtr client; DeviceIntPtr dev; Mask access_mode; int status; } XaceDeviceAccessRec; /* XACE_PROPERTY_ACCESS */ typedef struct { ClientPtr client; WindowPtr pWin; PropertyPtr *ppProp; Mask access_mode; int status; } XacePropertyAccessRec; /* XACE_SEND_ACCESS */ typedef struct { ClientPtr client; DeviceIntPtr dev; WindowPtr pWin; xEventPtr events; int count; int status; } XaceSendAccessRec; /* XACE_RECEIVE_ACCESS */ typedef struct { ClientPtr client; WindowPtr pWin; xEventPtr events; int count; int status; } XaceReceiveAccessRec; /* XACE_CLIENT_ACCESS */ typedef struct { ClientPtr client; ClientPtr target; Mask access_mode; int status; } XaceClientAccessRec; /* XACE_EXT_DISPATCH */ /* XACE_EXT_ACCESS */ typedef struct { ClientPtr client; ExtensionEntry *ext; Mask access_mode; int status; } XaceExtAccessRec; /* XACE_SERVER_ACCESS */ typedef struct { ClientPtr client; Mask access_mode; int status; } XaceServerAccessRec; /* XACE_SELECTION_ACCESS */ typedef struct { ClientPtr client; Selection **ppSel; Mask access_mode; int status; } XaceSelectionAccessRec; /* XACE_SCREEN_ACCESS */ /* XACE_SCREENSAVER_ACCESS */ typedef struct { ClientPtr client; ScreenPtr screen; Mask access_mode; int status; } XaceScreenAccessRec; /* XACE_AUTH_AVAIL */ typedef struct { ClientPtr client; XID authId; } XaceAuthAvailRec; /* XACE_KEY_AVAIL */ typedef struct { xEventPtr event; DeviceIntPtr keybd; int count; } XaceKeyAvailRec; /* XACE_AUDIT_BEGIN */ /* XACE_AUDIT_END */ typedef struct { ClientPtr client; int requestResult; } XaceAuditRec; #endif /* _XACESTR_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/dpms.c����������������������������������������������������������������������0000664�0001751�0001751�00000021017�12456571574�013071� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************** Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "opaque.h" #include <X11/extensions/dpmsproto.h> #include "dpmsproc.h" #include "extinit.h" static int ProcDPMSGetVersion(ClientPtr client) { /* REQUEST(xDPMSGetVersionReq); */ xDPMSGetVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = DPMSMajorVersion, .minorVersion = DPMSMinorVersion }; REQUEST_SIZE_MATCH(xDPMSGetVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xDPMSGetVersionReply), &rep); return Success; } static int ProcDPMSCapable(ClientPtr client) { /* REQUEST(xDPMSCapableReq); */ xDPMSCapableReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .capable = DPMSCapableFlag }; REQUEST_SIZE_MATCH(xDPMSCapableReq); if (client->swapped) { swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(xDPMSCapableReply), &rep); return Success; } static int ProcDPMSGetTimeouts(ClientPtr client) { /* REQUEST(xDPMSGetTimeoutsReq); */ 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); if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.standby); swaps(&rep.suspend); swaps(&rep.off); } WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), &rep); return Success; } static int ProcDPMSSetTimeouts(ClientPtr client) { REQUEST(xDPMSSetTimeoutsReq); REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq); if ((stuff->off != 0) && (stuff->off < stuff->suspend)) { client->errorValue = stuff->off; return BadValue; } if ((stuff->suspend != 0) && (stuff->suspend < stuff->standby)) { client->errorValue = stuff->suspend; return BadValue; } DPMSStandbyTime = stuff->standby * MILLI_PER_SECOND; DPMSSuspendTime = stuff->suspend * MILLI_PER_SECOND; DPMSOffTime = stuff->off * MILLI_PER_SECOND; SetScreenSaverTimer(); return Success; } static int ProcDPMSEnable(ClientPtr client) { Bool was_enabled = DPMSEnabled; REQUEST_SIZE_MATCH(xDPMSEnableReq); if (DPMSCapableFlag) { DPMSEnabled = TRUE; if (!was_enabled) SetScreenSaverTimer(); } return Success; } static int ProcDPMSDisable(ClientPtr client) { /* REQUEST(xDPMSDisableReq); */ REQUEST_SIZE_MATCH(xDPMSDisableReq); DPMSSet(client, DPMSModeOn); DPMSEnabled = FALSE; return Success; } static int ProcDPMSForceLevel(ClientPtr client) { REQUEST(xDPMSForceLevelReq); REQUEST_SIZE_MATCH(xDPMSForceLevelReq); if (!DPMSEnabled) return BadMatch; if (stuff->level != DPMSModeOn && stuff->level != DPMSModeStandby && stuff->level != DPMSModeSuspend && stuff->level != DPMSModeOff) { client->errorValue = stuff->level; return BadValue; } DPMSSet(client, stuff->level); return Success; } static int ProcDPMSInfo(ClientPtr client) { /* REQUEST(xDPMSInfoReq); */ xDPMSInfoReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .power_level = DPMSPowerLevel, .state = DPMSEnabled }; REQUEST_SIZE_MATCH(xDPMSInfoReq); if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.power_level); } WriteToClient(client, sizeof(xDPMSInfoReply), &rep); return Success; } static int ProcDPMSDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_DPMSGetVersion: return ProcDPMSGetVersion(client); case X_DPMSCapable: return ProcDPMSCapable(client); case X_DPMSGetTimeouts: return ProcDPMSGetTimeouts(client); case X_DPMSSetTimeouts: return ProcDPMSSetTimeouts(client); case X_DPMSEnable: return ProcDPMSEnable(client); case X_DPMSDisable: return ProcDPMSDisable(client); case X_DPMSForceLevel: return ProcDPMSForceLevel(client); case X_DPMSInfo: return ProcDPMSInfo(client); default: return BadRequest; } } static int SProcDPMSGetVersion(ClientPtr client) { REQUEST(xDPMSGetVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSGetVersionReq); swaps(&stuff->majorVersion); swaps(&stuff->minorVersion); return ProcDPMSGetVersion(client); } static int SProcDPMSCapable(ClientPtr client) { REQUEST(xDPMSCapableReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSCapableReq); return ProcDPMSCapable(client); } static int SProcDPMSGetTimeouts(ClientPtr client) { REQUEST(xDPMSGetTimeoutsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); return ProcDPMSGetTimeouts(client); } static int SProcDPMSSetTimeouts(ClientPtr client) { REQUEST(xDPMSSetTimeoutsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq); swaps(&stuff->standby); swaps(&stuff->suspend); swaps(&stuff->off); return ProcDPMSSetTimeouts(client); } static int SProcDPMSEnable(ClientPtr client) { REQUEST(xDPMSEnableReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSEnableReq); return ProcDPMSEnable(client); } static int SProcDPMSDisable(ClientPtr client) { REQUEST(xDPMSDisableReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSDisableReq); return ProcDPMSDisable(client); } static int SProcDPMSForceLevel(ClientPtr client) { REQUEST(xDPMSForceLevelReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSForceLevelReq); swaps(&stuff->level); return ProcDPMSForceLevel(client); } static int SProcDPMSInfo(ClientPtr client) { REQUEST(xDPMSInfoReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSInfoReq); return ProcDPMSInfo(client); } static int SProcDPMSDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_DPMSGetVersion: return SProcDPMSGetVersion(client); case X_DPMSCapable: return SProcDPMSCapable(client); case X_DPMSGetTimeouts: return SProcDPMSGetTimeouts(client); case X_DPMSSetTimeouts: return SProcDPMSSetTimeouts(client); case X_DPMSEnable: return SProcDPMSEnable(client); case X_DPMSDisable: return SProcDPMSDisable(client); case X_DPMSForceLevel: return SProcDPMSForceLevel(client); case X_DPMSInfo: return SProcDPMSInfo(client); default: return BadRequest; } } void DPMSExtensionInit(void) { AddExtension(DPMSExtensionName, 0, 0, ProcDPMSDispatch, SProcDPMSDispatch, NULL, StandardMinorOpcode); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/panoramiXprocs.c������������������������������������������������������������0000664�0001751�0001751�00000221670�12456571574�015142� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ /* Massively rewritten by Mark Vojkovich <markv@valinux.com> */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdio.h> #include <X11/X.h> #include <X11/Xproto.h> #include "windowstr.h" #include "dixfontstr.h" #include "gcstruct.h" #include "colormapst.h" #include "scrnintstr.h" #include "opaque.h" #include "inputstr.h" #include "migc.h" #include "misc.h" #include "dixstruct.h" #include "panoramiX.h" #include "panoramiXsrv.h" #include "resource.h" #include "panoramiXh.h" #define XINERAMA_IMAGE_BUFSIZE (256*1024) #define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ CWDontPropagate | CWOverrideRedirect | CWCursor ) int PanoramiXCreateWindow(ClientPtr client) { PanoramiXRes *parent, *newWin; PanoramiXRes *backPix = NULL; PanoramiXRes *bordPix = NULL; PanoramiXRes *cmap = NULL; REQUEST(xCreateWindowReq); int pback_offset = 0, pbord_offset = 0, cmap_offset = 0; int result, len, j; int orig_x, orig_y; XID orig_visual, tmp; Bool parentIsRoot; REQUEST_AT_LEAST_SIZE(xCreateWindowReq); len = client->req_len - bytes_to_int32(sizeof(xCreateWindowReq)); if (Ones(stuff->mask) != len) return BadLength; result = dixLookupResourceByType((void **) &parent, stuff->parent, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; if (stuff->class == CopyFromParent) stuff->class = parent->u.win.class; if ((stuff->class == InputOnly) && (stuff->mask & (~INPUTONLY_LEGAL_MASK))) return BadMatch; if ((Mask) stuff->mask & CWBackPixmap) { pback_offset = Ones((Mask) stuff->mask & (CWBackPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { result = dixLookupResourceByType((void **) &backPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->mask & CWBorderPixmap) { pbord_offset = Ones((Mask) stuff->mask & (CWBorderPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { result = dixLookupResourceByType((void **) &bordPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->mask & CWColormap) { cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1)); tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { result = dixLookupResourceByType((void **) &cmap, tmp, XRT_COLORMAP, client, DixReadAccess); if (result != Success) return result; } } if (!(newWin = malloc(sizeof(PanoramiXRes)))) return BadAlloc; newWin->type = XRT_WINDOW; newWin->u.win.visibility = VisibilityNotViewable; newWin->u.win.class = stuff->class; newWin->u.win.root = FALSE; panoramix_setup_ids(newWin, client, stuff->wid); if (stuff->class == InputOnly) stuff->visual = CopyFromParent; orig_visual = stuff->visual; orig_x = stuff->x; orig_y = stuff->y; parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) || (stuff->parent == screenInfo.screens[0]->screensaver.wid); FOR_NSCREENS_BACKWARD(j) { stuff->wid = newWin->info[j].id; stuff->parent = parent->info[j].id; if (parentIsRoot) { stuff->x = orig_x - screenInfo.screens[j]->x; stuff->y = orig_y - screenInfo.screens[j]->y; } if (backPix) *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id; if (bordPix) *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id; if (cmap) *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id; if (orig_visual != CopyFromParent) stuff->visual = PanoramiXTranslateVisualID(j, orig_visual); result = (*SavedProcVector[X_CreateWindow]) (client); if (result != Success) break; } if (result == Success) AddResource(newWin->info[0].id, XRT_WINDOW, newWin); else free(newWin); return result; } int PanoramiXChangeWindowAttributes(ClientPtr client) { PanoramiXRes *win; PanoramiXRes *backPix = NULL; PanoramiXRes *bordPix = NULL; PanoramiXRes *cmap = NULL; REQUEST(xChangeWindowAttributesReq); int pback_offset = 0, pbord_offset = 0, cmap_offset = 0; int result, len, j; XID tmp; REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq)); if (Ones(stuff->valueMask) != len) return BadLength; result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; if ((win->u.win.class == InputOnly) && (stuff->valueMask & (~INPUTONLY_LEGAL_MASK))) return BadMatch; if ((Mask) stuff->valueMask & CWBackPixmap) { pback_offset = Ones((Mask) stuff->valueMask & (CWBackPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { result = dixLookupResourceByType((void **) &backPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->valueMask & CWBorderPixmap) { pbord_offset = Ones((Mask) stuff->valueMask & (CWBorderPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { result = dixLookupResourceByType((void **) &bordPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->valueMask & CWColormap) { cmap_offset = Ones((Mask) stuff->valueMask & (CWColormap - 1)); tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { result = dixLookupResourceByType((void **) &cmap, tmp, XRT_COLORMAP, client, DixReadAccess); if (result != Success) return result; } } FOR_NSCREENS_BACKWARD(j) { stuff->window = win->info[j].id; if (backPix) *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id; if (bordPix) *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id; if (cmap) *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id; result = (*SavedProcVector[X_ChangeWindowAttributes]) (client); } return result; } int PanoramiXDestroyWindow(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixDestroyAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->id = win->info[j].id; result = (*SavedProcVector[X_DestroyWindow]) (client); if (result != Success) break; } /* Since ProcDestroyWindow is using FreeResource, it will free our resource for us on the last pass through the loop above */ return result; } int PanoramiXDestroySubwindows(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixDestroyAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->id = win->info[j].id; result = (*SavedProcVector[X_DestroySubwindows]) (client); if (result != Success) break; } /* DestroySubwindows is using FreeResource which will free our resources for us on the last pass through the loop above */ return result; } int PanoramiXChangeSaveSet(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xChangeSaveSetReq); REQUEST_SIZE_MATCH(xChangeSaveSetReq); result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->window = win->info[j].id; result = (*SavedProcVector[X_ChangeSaveSet]) (client); if (result != Success) break; } return result; } int PanoramiXReparentWindow(ClientPtr client) { PanoramiXRes *win, *parent; int result, j; int x, y; Bool parentIsRoot; REQUEST(xReparentWindowReq); REQUEST_SIZE_MATCH(xReparentWindowReq); result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &parent, stuff->parent, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; x = stuff->x; y = stuff->y; parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) || (stuff->parent == screenInfo.screens[0]->screensaver.wid); FOR_NSCREENS_BACKWARD(j) { stuff->window = win->info[j].id; stuff->parent = parent->info[j].id; if (parentIsRoot) { stuff->x = x - screenInfo.screens[j]->x; stuff->y = y - screenInfo.screens[j]->y; } result = (*SavedProcVector[X_ReparentWindow]) (client); if (result != Success) break; } return result; } int PanoramiXMapWindow(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_FORWARD(j) { stuff->id = win->info[j].id; result = (*SavedProcVector[X_MapWindow]) (client); if (result != Success) break; } return result; } int PanoramiXMapSubwindows(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_FORWARD(j) { stuff->id = win->info[j].id; result = (*SavedProcVector[X_MapSubwindows]) (client); if (result != Success) break; } return result; } int PanoramiXUnmapWindow(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_FORWARD(j) { stuff->id = win->info[j].id; result = (*SavedProcVector[X_UnmapWindow]) (client); if (result != Success) break; } return result; } int PanoramiXUnmapSubwindows(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_FORWARD(j) { stuff->id = win->info[j].id; result = (*SavedProcVector[X_UnmapSubwindows]) (client); if (result != Success) break; } return result; } int PanoramiXConfigureWindow(ClientPtr client) { PanoramiXRes *win; PanoramiXRes *sib = NULL; WindowPtr pWin; int result, j, len, sib_offset = 0, x = 0, y = 0; int x_offset = -1; int y_offset = -1; REQUEST(xConfigureWindowReq); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq)); if (Ones(stuff->mask) != len) return BadLength; /* because we need the parent */ result = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixWriteAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; if ((Mask) stuff->mask & CWSibling) { XID tmp; sib_offset = Ones((Mask) stuff->mask & (CWSibling - 1)); if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) { result = dixLookupResourceByType((void **) &sib, tmp, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; } } if (pWin->parent && ((pWin->parent == screenInfo.screens[0]->root) || (pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid))) { if ((Mask) stuff->mask & CWX) { x_offset = 0; x = *((CARD32 *) &stuff[1]); } if ((Mask) stuff->mask & CWY) { y_offset = (x_offset == -1) ? 0 : 1; y = *((CARD32 *) &stuff[1] + y_offset); } } /* have to go forward or you get expose events before ConfigureNotify events */ FOR_NSCREENS_FORWARD(j) { stuff->window = win->info[j].id; if (sib) *((CARD32 *) &stuff[1] + sib_offset) = sib->info[j].id; if (x_offset >= 0) *((CARD32 *) &stuff[1] + x_offset) = x - screenInfo.screens[j]->x; if (y_offset >= 0) *((CARD32 *) &stuff[1] + y_offset) = y - screenInfo.screens[j]->y; result = (*SavedProcVector[X_ConfigureWindow]) (client); if (result != Success) break; } return result; } int PanoramiXCirculateWindow(ClientPtr client) { PanoramiXRes *win; int result, j; REQUEST(xCirculateWindowReq); REQUEST_SIZE_MATCH(xCirculateWindowReq); result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_FORWARD(j) { stuff->window = win->info[j].id; result = (*SavedProcVector[X_CirculateWindow]) (client); if (result != Success) break; } return result; } int PanoramiXGetGeometry(ClientPtr client) { xGetGeometryReply rep; DrawablePtr pDraw; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixGetAttrAccess); if (rc != Success) return rc; 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 *) (ConnectionInfo + connBlockScreenStart); rep.width = root->pixWidth; rep.height = root->pixHeight; } else if (WindowDrawable(pDraw->type)) { WindowPtr pWin = (WindowPtr) pDraw; rep.x = pWin->origin.x - wBorderWidth(pWin); rep.y = pWin->origin.y - wBorderWidth(pWin); if ((pWin->parent == screenInfo.screens[0]->root) || (pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid)) { rep.x += screenInfo.screens[0]->x; rep.y += screenInfo.screens[0]->y; } rep.borderWidth = pWin->borderWidth; } WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); return Success; } int PanoramiXTranslateCoords(ClientPtr client) { INT16 x, y; REQUEST(xTranslateCoordsReq); int rc; WindowPtr pWin, pDst; xTranslateCoordsReply rep; REQUEST_SIZE_MATCH(xTranslateCoordsReq); rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess); if (rc != Success) return rc; rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess); if (rc != Success) return rc; 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)) { x = stuff->srcX - screenInfo.screens[0]->x; y = stuff->srcY - screenInfo.screens[0]->y; } else { x = pWin->drawable.x + stuff->srcX; y = pWin->drawable.y + stuff->srcY; } pWin = pDst->firstChild; while (pWin) { BoxRec box; if ((pWin->mapped) && (x >= pWin->drawable.x - wBorderWidth(pWin)) && (x < pWin->drawable.x + (int) pWin->drawable.width + wBorderWidth(pWin)) && (y >= pWin->drawable.y - wBorderWidth(pWin)) && (y < pWin->drawable.y + (int) pWin->drawable.height + wBorderWidth(pWin)) /* When a window is shaped, a further check * is made to see if the point is inside * borderSize */ && (!wBoundingShape(pWin) || RegionContainsPoint(wBoundingShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) ) { rep.child = pWin->drawable.id; pWin = (WindowPtr) NULL; } else pWin = pWin->nextSib; } rep.dstX = x - pDst->drawable.x; rep.dstY = y - pDst->drawable.y; if ((pDst == screenInfo.screens[0]->root) || (pDst->drawable.id == screenInfo.screens[0]->screensaver.wid)) { rep.dstX += screenInfo.screens[0]->x; rep.dstY += screenInfo.screens[0]->y; } WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); return Success; } int PanoramiXCreatePixmap(ClientPtr client) { PanoramiXRes *refDraw, *newPix; int result, j; REQUEST(xCreatePixmapReq); REQUEST_SIZE_MATCH(xCreatePixmapReq); client->errorValue = stuff->pid; result = dixLookupResourceByClass((void **) &refDraw, stuff->drawable, XRC_DRAWABLE, client, DixReadAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (!(newPix = malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPix->type = XRT_PIXMAP; newPix->u.pix.shared = FALSE; panoramix_setup_ids(newPix, client, stuff->pid); FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPix->info[j].id; stuff->drawable = refDraw->info[j].id; result = (*SavedProcVector[X_CreatePixmap]) (client); if (result != Success) break; } if (result == Success) AddResource(newPix->info[0].id, XRT_PIXMAP, newPix); else free(newPix); return result; } int PanoramiXFreePixmap(ClientPtr client) { PanoramiXRes *pix; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); client->errorValue = stuff->id; result = dixLookupResourceByType((void **) &pix, stuff->id, XRT_PIXMAP, client, DixDestroyAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->id = pix->info[j].id; result = (*SavedProcVector[X_FreePixmap]) (client); if (result != Success) break; } /* Since ProcFreePixmap is using FreeResource, it will free our resource for us on the last pass through the loop above */ return result; } int PanoramiXCreateGC(ClientPtr client) { PanoramiXRes *refDraw; PanoramiXRes *newGC; PanoramiXRes *stip = NULL; PanoramiXRes *tile = NULL; PanoramiXRes *clip = NULL; REQUEST(xCreateGCReq); int tile_offset = 0, stip_offset = 0, clip_offset = 0; int result, len, j; XID tmp; REQUEST_AT_LEAST_SIZE(xCreateGCReq); client->errorValue = stuff->gc; len = client->req_len - bytes_to_int32(sizeof(xCreateGCReq)); if (Ones(stuff->mask) != len) return BadLength; result = dixLookupResourceByClass((void **) &refDraw, stuff->drawable, XRC_DRAWABLE, client, DixReadAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if ((Mask) stuff->mask & GCTile) { tile_offset = Ones((Mask) stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { result = dixLookupResourceByType((void **) &tile, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->mask & GCStipple) { stip_offset = Ones((Mask) stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { result = dixLookupResourceByType((void **) &stip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->mask & GCClipMask) { clip_offset = Ones((Mask) stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { result = dixLookupResourceByType((void **) &clip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if (!(newGC = malloc(sizeof(PanoramiXRes)))) return BadAlloc; newGC->type = XRT_GC; panoramix_setup_ids(newGC, client, stuff->gc); FOR_NSCREENS_BACKWARD(j) { stuff->gc = newGC->info[j].id; stuff->drawable = refDraw->info[j].id; if (tile) *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id; if (stip) *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id; if (clip) *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id; result = (*SavedProcVector[X_CreateGC]) (client); if (result != Success) break; } if (result == Success) AddResource(newGC->info[0].id, XRT_GC, newGC); else free(newGC); return result; } int PanoramiXChangeGC(ClientPtr client) { PanoramiXRes *gc; PanoramiXRes *stip = NULL; PanoramiXRes *tile = NULL; PanoramiXRes *clip = NULL; REQUEST(xChangeGCReq); int tile_offset = 0, stip_offset = 0, clip_offset = 0; int result, len, j; XID tmp; REQUEST_AT_LEAST_SIZE(xChangeGCReq); len = client->req_len - bytes_to_int32(sizeof(xChangeGCReq)); if (Ones(stuff->mask) != len) return BadLength; result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; if ((Mask) stuff->mask & GCTile) { tile_offset = Ones((Mask) stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { result = dixLookupResourceByType((void **) &tile, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->mask & GCStipple) { stip_offset = Ones((Mask) stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { result = dixLookupResourceByType((void **) &stip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } if ((Mask) stuff->mask & GCClipMask) { clip_offset = Ones((Mask) stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { result = dixLookupResourceByType((void **) &clip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; } } FOR_NSCREENS_BACKWARD(j) { stuff->gc = gc->info[j].id; if (tile) *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id; if (stip) *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id; if (clip) *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id; result = (*SavedProcVector[X_ChangeGC]) (client); if (result != Success) break; } return result; } int PanoramiXCopyGC(ClientPtr client) { PanoramiXRes *srcGC, *dstGC; int result, j; REQUEST(xCopyGCReq); REQUEST_SIZE_MATCH(xCopyGCReq); result = dixLookupResourceByType((void **) &srcGC, stuff->srcGC, XRT_GC, client, DixReadAccess); if (result != Success) return result; result = dixLookupResourceByType((void **) &dstGC, stuff->dstGC, XRT_GC, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS(j) { stuff->srcGC = srcGC->info[j].id; stuff->dstGC = dstGC->info[j].id; result = (*SavedProcVector[X_CopyGC]) (client); if (result != Success) break; } return result; } int PanoramiXSetDashes(ClientPtr client) { PanoramiXRes *gc; int result, j; REQUEST(xSetDashesReq); REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_SetDashes]) (client); if (result != Success) break; } return result; } int PanoramiXSetClipRectangles(ClientPtr client) { PanoramiXRes *gc; int result, j; REQUEST(xSetClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_SetClipRectangles]) (client); if (result != Success) break; } return result; } int PanoramiXFreeGC(ClientPtr client) { PanoramiXRes *gc; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); result = dixLookupResourceByType((void **) &gc, stuff->id, XRT_GC, client, DixDestroyAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->id = gc->info[j].id; result = (*SavedProcVector[X_FreeGC]) (client); if (result != Success) break; } /* Since ProcFreeGC is using FreeResource, it will free our resource for us on the last pass through the loop above */ return result; } int PanoramiXClearToBackground(ClientPtr client) { PanoramiXRes *win; int result, j, x, y; Bool isRoot; REQUEST(xClearAreaReq); REQUEST_SIZE_MATCH(xClearAreaReq); result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; x = stuff->x; y = stuff->y; isRoot = win->u.win.root; FOR_NSCREENS_BACKWARD(j) { stuff->window = win->info[j].id; if (isRoot) { stuff->x = x - screenInfo.screens[j]->x; stuff->y = y - screenInfo.screens[j]->y; } result = (*SavedProcVector[X_ClearArea]) (client); if (result != Success) break; } return result; } /* For Window to Pixmap copies you're screwed since each screen's pixmap will look like what it sees on its screen. Unless the screens overlap and the window lies on each, the two copies will be out of sync. To remedy this we do a GetImage and PutImage in place of the copy. Doing this as a single Image isn't quite correct since it will include the obscured areas but we will have to fix this later. (MArk). */ int PanoramiXCopyArea(ClientPtr client) { int j, result, srcx, srcy, dstx, dsty; PanoramiXRes *gc, *src, *dst; Bool srcIsRoot = FALSE; Bool dstIsRoot = FALSE; Bool srcShared, dstShared; REQUEST(xCopyAreaReq); REQUEST_SIZE_MATCH(xCopyAreaReq); result = dixLookupResourceByClass((void **) &src, stuff->srcDrawable, XRC_DRAWABLE, client, DixReadAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; srcShared = IS_SHARED_PIXMAP(src); result = dixLookupResourceByClass((void **) &dst, stuff->dstDrawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; dstShared = IS_SHARED_PIXMAP(dst); if (dstShared && srcShared) return (*SavedProcVector[X_CopyArea]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; if ((dst->type == XRT_WINDOW) && dst->u.win.root) dstIsRoot = TRUE; if ((src->type == XRT_WINDOW) && src->u.win.root) srcIsRoot = TRUE; srcx = stuff->srcX; srcy = stuff->srcY; dstx = stuff->dstX; dsty = stuff->dstY; if ((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) { DrawablePtr drawables[MAXSCREENS]; DrawablePtr pDst; GCPtr pGC; char *data; int pitch, rc; FOR_NSCREENS(j) { rc = dixLookupDrawable(drawables + j, src->info[j].id, client, 0, DixGetAttrAccess); if (rc != Success) return rc; } pitch = PixmapBytePad(stuff->width, drawables[0]->depth); if (!(data = calloc(1, stuff->height * pitch))) return BadAlloc; XineramaGetImageData(drawables, srcx, srcy, stuff->width, stuff->height, ZPixmap, ~0, data, pitch, srcIsRoot); FOR_NSCREENS_BACKWARD(j) { stuff->gc = gc->info[j].id; VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, DixWriteAccess); if (drawables[0]->depth != pDst->depth) { client->errorValue = stuff->dstDrawable; free(data); return BadMatch; } (*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty, stuff->width, stuff->height, 0, ZPixmap, data); if (dstShared) break; } free(data); } else { DrawablePtr pDst = NULL, pSrc = NULL; GCPtr pGC = NULL; RegionRec totalReg; int rc; RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { RegionPtr pRgn; stuff->dstDrawable = dst->info[j].id; stuff->srcDrawable = src->info[j].id; stuff->gc = gc->info[j].id; if (srcIsRoot) { stuff->srcX = srcx - screenInfo.screens[j]->x; stuff->srcY = srcy - screenInfo.screens[j]->y; } if (dstIsRoot) { stuff->dstX = dstx - screenInfo.screens[j]->x; stuff->dstY = dsty - screenInfo.screens[j]->y; } VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess); if (stuff->dstDrawable != stuff->srcDrawable) { rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0, DixReadAccess); if (rc != Success) return rc; if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) { client->errorValue = stuff->dstDrawable; return BadMatch; } } else pSrc = pDst; pRgn = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, stuff->srcX, stuff->srcY, stuff->width, stuff->height, stuff->dstX, stuff->dstY); if (pGC->graphicsExposures && pRgn) { if (srcIsRoot) { RegionTranslate(pRgn, screenInfo.screens[j]->x, screenInfo.screens[j]->y); } RegionAppend(&totalReg, pRgn); RegionDestroy(pRgn); } if (dstShared) break; } if (pGC->graphicsExposures) { Bool overlap; RegionValidate(&totalReg, &overlap); SendGraphicsExpose(client, &totalReg, stuff->dstDrawable, X_CopyArea, 0); RegionUninit(&totalReg); } } return Success; } int PanoramiXCopyPlane(ClientPtr client) { int j, srcx, srcy, dstx, dsty, rc; PanoramiXRes *gc, *src, *dst; Bool srcIsRoot = FALSE; Bool dstIsRoot = FALSE; Bool srcShared, dstShared; DrawablePtr psrcDraw, pdstDraw = NULL; GCPtr pGC = NULL; RegionRec totalReg; REQUEST(xCopyPlaneReq); REQUEST_SIZE_MATCH(xCopyPlaneReq); rc = dixLookupResourceByClass((void **) &src, stuff->srcDrawable, XRC_DRAWABLE, client, DixReadAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; srcShared = IS_SHARED_PIXMAP(src); rc = dixLookupResourceByClass((void **) &dst, stuff->dstDrawable, XRC_DRAWABLE, client, DixWriteAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; dstShared = IS_SHARED_PIXMAP(dst); if (dstShared && srcShared) return (*SavedProcVector[X_CopyPlane]) (client); rc = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (rc != Success) return rc; if ((dst->type == XRT_WINDOW) && dst->u.win.root) dstIsRoot = TRUE; if ((src->type == XRT_WINDOW) && src->u.win.root) srcIsRoot = TRUE; srcx = stuff->srcX; srcy = stuff->srcY; dstx = stuff->dstX; dsty = stuff->dstY; RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { RegionPtr pRgn; stuff->dstDrawable = dst->info[j].id; stuff->srcDrawable = src->info[j].id; stuff->gc = gc->info[j].id; if (srcIsRoot) { stuff->srcX = srcx - screenInfo.screens[j]->x; stuff->srcY = srcy - screenInfo.screens[j]->y; } if (dstIsRoot) { stuff->dstX = dstx - screenInfo.screens[j]->x; stuff->dstY = dsty - screenInfo.screens[j]->y; } VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess); if (stuff->dstDrawable != stuff->srcDrawable) { rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (pdstDraw->pScreen != psrcDraw->pScreen) { client->errorValue = stuff->dstDrawable; return BadMatch; } } else psrcDraw = pdstDraw; if (stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) || (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) { client->errorValue = stuff->bitPlane; return BadValue; } pRgn = (*pGC->ops->CopyPlane) (psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY, stuff->width, stuff->height, stuff->dstX, stuff->dstY, stuff->bitPlane); if (pGC->graphicsExposures && pRgn) { RegionAppend(&totalReg, pRgn); RegionDestroy(pRgn); } if (dstShared) break; } if (pGC->graphicsExposures) { Bool overlap; RegionValidate(&totalReg, &overlap); SendGraphicsExpose(client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0); RegionUninit(&totalReg); } return Success; } int PanoramiXPolyPoint(ClientPtr client) { PanoramiXRes *gc, *draw; int result, npoint, j; xPoint *origPts; Bool isRoot; REQUEST(xPolyPointReq); REQUEST_AT_LEAST_SIZE(xPolyPointReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyPoint]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq)); if (npoint > 0) { origPts = malloc(npoint * sizeof(xPoint)); memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xPoint *pnts = (xPoint *) &stuff[1]; int i = (stuff->coordMode == CoordModePrevious) ? 1 : npoint; while (i--) { pnts->x -= x_off; pnts->y -= y_off; pnts++; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PolyPoint]) (client); if (result != Success) break; } free(origPts); return result; } else return Success; } int PanoramiXPolyLine(ClientPtr client) { PanoramiXRes *gc, *draw; int result, npoint, j; xPoint *origPts; Bool isRoot; REQUEST(xPolyLineReq); REQUEST_AT_LEAST_SIZE(xPolyLineReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyLine]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq)); if (npoint > 0) { origPts = malloc(npoint * sizeof(xPoint)); memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xPoint *pnts = (xPoint *) &stuff[1]; int i = (stuff->coordMode == CoordModePrevious) ? 1 : npoint; while (i--) { pnts->x -= x_off; pnts->y -= y_off; pnts++; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PolyLine]) (client); if (result != Success) break; } free(origPts); return result; } else return Success; } int PanoramiXPolySegment(ClientPtr client) { int result, nsegs, i, j; PanoramiXRes *gc, *draw; xSegment *origSegs; Bool isRoot; REQUEST(xPolySegmentReq); REQUEST_AT_LEAST_SIZE(xPolySegmentReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolySegment]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); if (nsegs & 4) return BadLength; nsegs >>= 3; if (nsegs > 0) { origSegs = malloc(nsegs * sizeof(xSegment)); memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], origSegs, nsegs * sizeof(xSegment)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xSegment *segs = (xSegment *) &stuff[1]; for (i = nsegs; i--; segs++) { segs->x1 -= x_off; segs->x2 -= x_off; segs->y1 -= y_off; segs->y2 -= y_off; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PolySegment]) (client); if (result != Success) break; } free(origSegs); return result; } else return Success; } int PanoramiXPolyRectangle(ClientPtr client) { int result, nrects, i, j; PanoramiXRes *gc, *draw; Bool isRoot; xRectangle *origRecs; REQUEST(xPolyRectangleReq); REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyRectangle]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); if (nrects & 4) return BadLength; nrects >>= 3; if (nrects > 0) { origRecs = malloc(nrects * sizeof(xRectangle)); memcpy((char *) origRecs, (char *) &stuff[1], nrects * sizeof(xRectangle)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], origRecs, nrects * sizeof(xRectangle)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xRectangle *rects = (xRectangle *) &stuff[1]; for (i = nrects; i--; rects++) { rects->x -= x_off; rects->y -= y_off; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PolyRectangle]) (client); if (result != Success) break; } free(origRecs); return result; } else return Success; } int PanoramiXPolyArc(ClientPtr client) { int result, narcs, i, j; PanoramiXRes *gc, *draw; Bool isRoot; xArc *origArcs; REQUEST(xPolyArcReq); REQUEST_AT_LEAST_SIZE(xPolyArcReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyArc]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); narcs = (client->req_len << 2) - sizeof(xPolyArcReq); if (narcs % sizeof(xArc)) return BadLength; narcs /= sizeof(xArc); if (narcs > 0) { origArcs = malloc(narcs * sizeof(xArc)); memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xArc *arcs = (xArc *) &stuff[1]; for (i = narcs; i--; arcs++) { arcs->x -= x_off; arcs->y -= y_off; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PolyArc]) (client); if (result != Success) break; } free(origArcs); return result; } else return Success; } int PanoramiXFillPoly(ClientPtr client) { int result, count, j; PanoramiXRes *gc, *draw; Bool isRoot; DDXPointPtr locPts; REQUEST(xFillPolyReq); REQUEST_AT_LEAST_SIZE(xFillPolyReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_FillPoly]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq)); if (count > 0) { locPts = malloc(count * sizeof(DDXPointRec)); memcpy((char *) locPts, (char *) &stuff[1], count * sizeof(DDXPointRec)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], locPts, count * sizeof(DDXPointRec)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { DDXPointPtr pnts = (DDXPointPtr) &stuff[1]; int i = (stuff->coordMode == CoordModePrevious) ? 1 : count; while (i--) { pnts->x -= x_off; pnts->y -= y_off; pnts++; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_FillPoly]) (client); if (result != Success) break; } free(locPts); return result; } else return Success; } int PanoramiXPolyFillRectangle(ClientPtr client) { int result, things, i, j; PanoramiXRes *gc, *draw; Bool isRoot; xRectangle *origRects; REQUEST(xPolyFillRectangleReq); REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillRectangle]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); if (things & 4) return BadLength; things >>= 3; if (things > 0) { origRects = malloc(things * sizeof(xRectangle)); memcpy((char *) origRects, (char *) &stuff[1], things * sizeof(xRectangle)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], origRects, things * sizeof(xRectangle)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xRectangle *rects = (xRectangle *) &stuff[1]; for (i = things; i--; rects++) { rects->x -= x_off; rects->y -= y_off; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PolyFillRectangle]) (client); if (result != Success) break; } free(origRects); return result; } else return Success; } int PanoramiXPolyFillArc(ClientPtr client) { PanoramiXRes *gc, *draw; Bool isRoot; int result, narcs, i, j; xArc *origArcs; REQUEST(xPolyFillArcReq); REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillArc]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); if (narcs % sizeof(xArc)) return BadLength; narcs /= sizeof(xArc); if (narcs > 0) { origArcs = malloc(narcs * sizeof(xArc)); memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc)); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc)); if (isRoot) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xArc *arcs = (xArc *) &stuff[1]; for (i = narcs; i--; arcs++) { arcs->x -= x_off; arcs->y -= y_off; } } } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PolyFillArc]) (client); if (result != Success) break; } free(origArcs); return result; } else return Success; } int PanoramiXPutImage(ClientPtr client) { PanoramiXRes *gc, *draw; Bool isRoot; int j, result, orig_x, orig_y; REQUEST(xPutImageReq); REQUEST_AT_LEAST_SIZE(xPutImageReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PutImage]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->dstX; orig_y = stuff->dstY; FOR_NSCREENS_BACKWARD(j) { if (isRoot) { stuff->dstX = orig_x - screenInfo.screens[j]->x; stuff->dstY = orig_y - screenInfo.screens[j]->y; } stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; result = (*SavedProcVector[X_PutImage]) (client); if (result != Success) break; } return result; } int PanoramiXGetImage(ClientPtr client) { DrawablePtr drawables[MAXSCREENS]; DrawablePtr pDraw; PanoramiXRes *draw; xGetImageReply xgi; Bool isRoot; char *pBuf; int i, x, y, w, h, format, rc; Mask plane = 0, planemask; int linesDone, nlines, linesPerBuf; long widthBytesLine, length; REQUEST(xGetImageReq); REQUEST_SIZE_MATCH(xGetImageReq); if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { client->errorValue = stuff->format; return BadValue; } rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixReadAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; if (draw->type == XRT_PIXMAP) return (*SavedProcVector[X_GetImage]) (client); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (!((WindowPtr) pDraw)->realized) return BadMatch; x = stuff->x; y = stuff->y; w = stuff->width; h = stuff->height; format = stuff->format; planemask = stuff->planeMask; isRoot = IS_ROOT_DRAWABLE(draw); if (isRoot) { /* check for being onscreen */ if (x < 0 || x + w > PanoramiXPixWidth || y < 0 || y + h > PanoramiXPixHeight) return BadMatch; } else { /* check for being onscreen and inside of border */ if (screenInfo.screens[0]->x + pDraw->x + x < 0 || screenInfo.screens[0]->x + pDraw->x + x + w > PanoramiXPixWidth || screenInfo.screens[0]->y + pDraw->y + y < 0 || screenInfo.screens[0]->y + pDraw->y + y + h > PanoramiXPixHeight || x < -wBorderWidth((WindowPtr) pDraw) || x + w > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->width || y < -wBorderWidth((WindowPtr) pDraw) || y + h > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height) return BadMatch; } drawables[0] = pDraw; FOR_NSCREENS_FORWARD_SKIP(i) { rc = dixLookupDrawable(drawables + i, draw->info[i].id, client, 0, DixGetAttrAccess); if (rc != Success) return rc; } 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; } else { widthBytesLine = BitmapBytePad(w); plane = ((Mask) 1) << (pDraw->depth - 1); /* only planes asked for */ length = widthBytesLine * h * Ones(planemask & (plane | (plane - 1))); } xgi.length = bytes_to_int32(length); if (widthBytesLine == 0 || h == 0) linesPerBuf = 0; else if (widthBytesLine >= XINERAMA_IMAGE_BUFSIZE) linesPerBuf = 1; else { linesPerBuf = XINERAMA_IMAGE_BUFSIZE / widthBytesLine; if (linesPerBuf > h) linesPerBuf = h; } length = linesPerBuf * widthBytesLine; if (!(pBuf = malloc(length))) return BadAlloc; WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); if (linesPerBuf == 0) { /* nothing to do */ } else if (format == ZPixmap) { linesDone = 0; while (h - linesDone > 0) { nlines = min(linesPerBuf, h - linesDone); if (pDraw->depth == 1) memset(pBuf, 0, nlines * widthBytesLine); XineramaGetImageData(drawables, x, y + linesDone, w, nlines, format, planemask, pBuf, widthBytesLine, isRoot); WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); linesDone += nlines; } } else { /* XYPixmap */ for (; plane; plane >>= 1) { if (planemask & plane) { linesDone = 0; while (h - linesDone > 0) { nlines = min(linesPerBuf, h - linesDone); memset(pBuf, 0, nlines * widthBytesLine); XineramaGetImageData(drawables, x, y + linesDone, w, nlines, format, plane, pBuf, widthBytesLine, isRoot); WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); linesDone += nlines; } } } } free(pBuf); return Success; } /* The text stuff should be rewritten so that duplication happens at the GlyphBlt level. That is, loading the font and getting the glyphs should only happen once */ int PanoramiXPolyText8(ClientPtr client) { PanoramiXRes *gc, *draw; Bool isRoot; int result, j; int orig_x, orig_y; REQUEST(xPolyTextReq); REQUEST_AT_LEAST_SIZE(xPolyTextReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText8]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; FOR_NSCREENS_BACKWARD(j) { stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; if (isRoot) { stuff->x = orig_x - screenInfo.screens[j]->x; stuff->y = orig_y - screenInfo.screens[j]->y; } result = (*SavedProcVector[X_PolyText8]) (client); if (result != Success) break; } return result; } int PanoramiXPolyText16(ClientPtr client) { PanoramiXRes *gc, *draw; Bool isRoot; int result, j; int orig_x, orig_y; REQUEST(xPolyTextReq); REQUEST_AT_LEAST_SIZE(xPolyTextReq); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText16]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; FOR_NSCREENS_BACKWARD(j) { stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; if (isRoot) { stuff->x = orig_x - screenInfo.screens[j]->x; stuff->y = orig_y - screenInfo.screens[j]->y; } result = (*SavedProcVector[X_PolyText16]) (client); if (result != Success) break; } return result; } int PanoramiXImageText8(ClientPtr client) { int result, j; PanoramiXRes *gc, *draw; Bool isRoot; int orig_x, orig_y; REQUEST(xImageTextReq); REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText8]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; FOR_NSCREENS_BACKWARD(j) { stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; if (isRoot) { stuff->x = orig_x - screenInfo.screens[j]->x; stuff->y = orig_y - screenInfo.screens[j]->y; } result = (*SavedProcVector[X_ImageText8]) (client); if (result != Success) break; } return result; } int PanoramiXImageText16(ClientPtr client) { int result, j; PanoramiXRes *gc, *draw; Bool isRoot; int orig_x, orig_y; REQUEST(xImageTextReq); REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText16]) (client); result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; FOR_NSCREENS_BACKWARD(j) { stuff->drawable = draw->info[j].id; stuff->gc = gc->info[j].id; if (isRoot) { stuff->x = orig_x - screenInfo.screens[j]->x; stuff->y = orig_y - screenInfo.screens[j]->y; } result = (*SavedProcVector[X_ImageText16]) (client); if (result != Success) break; } return result; } int PanoramiXCreateColormap(ClientPtr client) { PanoramiXRes *win, *newCmap; int result, j, orig_visual; REQUEST(xCreateColormapReq); REQUEST_SIZE_MATCH(xCreateColormapReq); result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; if (!(newCmap = malloc(sizeof(PanoramiXRes)))) return BadAlloc; newCmap->type = XRT_COLORMAP; panoramix_setup_ids(newCmap, client, stuff->mid); orig_visual = stuff->visual; FOR_NSCREENS_BACKWARD(j) { stuff->mid = newCmap->info[j].id; stuff->window = win->info[j].id; stuff->visual = PanoramiXTranslateVisualID(j, orig_visual); result = (*SavedProcVector[X_CreateColormap]) (client); if (result != Success) break; } if (result == Success) AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap); else free(newCmap); return result; } int PanoramiXFreeColormap(ClientPtr client) { PanoramiXRes *cmap; int result, j; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); client->errorValue = stuff->id; result = dixLookupResourceByType((void **) &cmap, stuff->id, XRT_COLORMAP, client, DixDestroyAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->id = cmap->info[j].id; result = (*SavedProcVector[X_FreeColormap]) (client); if (result != Success) break; } /* Since ProcFreeColormap is using FreeResource, it will free our resource for us on the last pass through the loop above */ return result; } int PanoramiXCopyColormapAndFree(ClientPtr client) { PanoramiXRes *cmap, *newCmap; int result, j; REQUEST(xCopyColormapAndFreeReq); REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); client->errorValue = stuff->srcCmap; result = dixLookupResourceByType((void **) &cmap, stuff->srcCmap, XRT_COLORMAP, client, DixReadAccess | DixWriteAccess); if (result != Success) return result; if (!(newCmap = malloc(sizeof(PanoramiXRes)))) return BadAlloc; newCmap->type = XRT_COLORMAP; panoramix_setup_ids(newCmap, client, stuff->mid); FOR_NSCREENS_BACKWARD(j) { stuff->srcCmap = cmap->info[j].id; stuff->mid = newCmap->info[j].id; result = (*SavedProcVector[X_CopyColormapAndFree]) (client); if (result != Success) break; } if (result == Success) AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap); else free(newCmap); return result; } int PanoramiXInstallColormap(ClientPtr client) { REQUEST(xResourceReq); int result, j; PanoramiXRes *cmap; REQUEST_SIZE_MATCH(xResourceReq); client->errorValue = stuff->id; result = dixLookupResourceByType((void **) &cmap, stuff->id, XRT_COLORMAP, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->id = cmap->info[j].id; result = (*SavedProcVector[X_InstallColormap]) (client); if (result != Success) break; } return result; } int PanoramiXUninstallColormap(ClientPtr client) { REQUEST(xResourceReq); int result, j; PanoramiXRes *cmap; REQUEST_SIZE_MATCH(xResourceReq); client->errorValue = stuff->id; result = dixLookupResourceByType((void **) &cmap, stuff->id, XRT_COLORMAP, client, DixReadAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->id = cmap->info[j].id; result = (*SavedProcVector[X_UninstallColormap]) (client); if (result != Success) break; } return result; } int PanoramiXAllocColor(ClientPtr client) { int result, j; PanoramiXRes *cmap; REQUEST(xAllocColorReq); REQUEST_SIZE_MATCH(xAllocColorReq); client->errorValue = stuff->cmap; result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->cmap = cmap->info[j].id; result = (*SavedProcVector[X_AllocColor]) (client); if (result != Success) break; } return result; } int PanoramiXAllocNamedColor(ClientPtr client) { int result, j; PanoramiXRes *cmap; REQUEST(xAllocNamedColorReq); REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); client->errorValue = stuff->cmap; result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->cmap = cmap->info[j].id; result = (*SavedProcVector[X_AllocNamedColor]) (client); if (result != Success) break; } return result; } int PanoramiXAllocColorCells(ClientPtr client) { int result, j; PanoramiXRes *cmap; REQUEST(xAllocColorCellsReq); REQUEST_SIZE_MATCH(xAllocColorCellsReq); client->errorValue = stuff->cmap; result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->cmap = cmap->info[j].id; result = (*SavedProcVector[X_AllocColorCells]) (client); if (result != Success) break; } return result; } int PanoramiXAllocColorPlanes(ClientPtr client) { int result, j; PanoramiXRes *cmap; REQUEST(xAllocColorPlanesReq); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); client->errorValue = stuff->cmap; result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->cmap = cmap->info[j].id; result = (*SavedProcVector[X_AllocColorPlanes]) (client); if (result != Success) break; } return result; } int PanoramiXFreeColors(ClientPtr client) { int result, j; PanoramiXRes *cmap; REQUEST(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); client->errorValue = stuff->cmap; result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->cmap = cmap->info[j].id; result = (*SavedProcVector[X_FreeColors]) (client); } return result; } int PanoramiXStoreColors(ClientPtr client) { int result, j; PanoramiXRes *cmap; REQUEST(xStoreColorsReq); REQUEST_AT_LEAST_SIZE(xStoreColorsReq); client->errorValue = stuff->cmap; result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->cmap = cmap->info[j].id; result = (*SavedProcVector[X_StoreColors]) (client); if (result != Success) break; } return result; } int PanoramiXStoreNamedColor(ClientPtr client) { int result, j; PanoramiXRes *cmap; REQUEST(xStoreNamedColorReq); REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); client->errorValue = stuff->cmap; result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; FOR_NSCREENS_BACKWARD(j) { stuff->cmap = cmap->info[j].id; result = (*SavedProcVector[X_StoreNamedColor]) (client); if (result != Success) break; } return result; } ������������������������������������������������������������������������xorg-server-1.17.1/Xext/xselinux_label.c������������������������������������������������������������0000664�0001751�0001751�00000023404�12274325511�015130� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <selinux/label.h> #include "registry.h" #include "xselinuxint.h" /* selection and property atom cache */ typedef struct { SELinuxObjectRec prp; SELinuxObjectRec sel; } SELinuxAtomRec; /* dynamic array */ typedef struct { unsigned size; void **array; } SELinuxArrayRec; /* labeling handle */ static struct selabel_handle *label_hnd; /* Array of object classes indexed by resource type */ SELinuxArrayRec arr_types; /* Array of event SIDs indexed by event type */ SELinuxArrayRec arr_events; /* Array of property and selection SID structures */ SELinuxArrayRec arr_atoms; /* * Dynamic array helpers */ static void * SELinuxArrayGet(SELinuxArrayRec * rec, unsigned key) { return (rec->size > key) ? rec->array[key] : 0; } static int SELinuxArraySet(SELinuxArrayRec * rec, unsigned key, void *val) { if (key >= rec->size) { /* Need to increase size of array */ rec->array = realloc(rec->array, (key + 1) * sizeof(val)); if (!rec->array) return FALSE; memset(rec->array + rec->size, 0, (key - rec->size + 1) * sizeof(val)); rec->size = key + 1; } rec->array[key] = val; return TRUE; } static void SELinuxArrayFree(SELinuxArrayRec * rec, int free_elements) { if (free_elements) { unsigned i = rec->size; while (i) free(rec->array[--i]); } free(rec->array); rec->size = 0; rec->array = NULL; } /* * Looks up a name in the selection or property mappings */ static int SELinuxAtomToSIDLookup(Atom atom, SELinuxObjectRec * obj, int map, int polymap) { const char *name = NameForAtom(atom); security_context_t ctx; int rc = Success; obj->poly = 1; /* Look in the mappings of names to contexts */ if (selabel_lookup_raw(label_hnd, &ctx, name, map) == 0) { obj->poly = 0; } else if (errno != ENOENT) { ErrorF("SELinux: a property label lookup failed!\n"); return BadValue; } else if (selabel_lookup_raw(label_hnd, &ctx, name, polymap) < 0) { ErrorF("SELinux: a property label lookup failed!\n"); return BadValue; } /* Get a SID for context */ if (avc_context_to_sid_raw(ctx, &obj->sid) < 0) { ErrorF("SELinux: a context_to_SID_raw call failed!\n"); rc = BadAlloc; } freecon(ctx); return rc; } /* * Looks up the SID corresponding to the given property or selection atom */ int SELinuxAtomToSID(Atom atom, int prop, SELinuxObjectRec ** obj_rtn) { SELinuxAtomRec *rec; SELinuxObjectRec *obj; int rc, map, polymap; rec = SELinuxArrayGet(&arr_atoms, atom); if (!rec) { rec = calloc(1, sizeof(SELinuxAtomRec)); if (!rec || !SELinuxArraySet(&arr_atoms, atom, rec)) return BadAlloc; } if (prop) { obj = &rec->prp; map = SELABEL_X_PROP; polymap = SELABEL_X_POLYPROP; } else { obj = &rec->sel; map = SELABEL_X_SELN; polymap = SELABEL_X_POLYSELN; } if (!obj->sid) { rc = SELinuxAtomToSIDLookup(atom, obj, map, polymap); if (rc != Success) goto out; } *obj_rtn = obj; rc = Success; out: return rc; } /* * Looks up a SID for a selection/subject pair */ int SELinuxSelectionToSID(Atom selection, SELinuxSubjectRec * subj, security_id_t * sid_rtn, int *poly_rtn) { int rc; SELinuxObjectRec *obj; security_id_t tsid; /* Get the default context and polyinstantiation bit */ rc = SELinuxAtomToSID(selection, 0, &obj); if (rc != Success) return rc; /* Check for an override context next */ if (subj->sel_use_sid) { tsid = subj->sel_use_sid; goto out; } tsid = obj->sid; /* Polyinstantiate if necessary to obtain the final SID */ if (obj->poly && avc_compute_member(subj->sid, obj->sid, SECCLASS_X_SELECTION, &tsid) < 0) { ErrorF("SELinux: a compute_member call failed!\n"); return BadValue; } out: *sid_rtn = tsid; if (poly_rtn) *poly_rtn = obj->poly; return Success; } /* * Looks up a SID for a property/subject pair */ int SELinuxPropertyToSID(Atom property, SELinuxSubjectRec * subj, security_id_t * sid_rtn, int *poly_rtn) { int rc; SELinuxObjectRec *obj; security_id_t tsid, tsid2; /* Get the default context and polyinstantiation bit */ rc = SELinuxAtomToSID(property, 1, &obj); if (rc != Success) return rc; /* Check for an override context next */ if (subj->prp_use_sid) { tsid = subj->prp_use_sid; goto out; } /* Perform a transition */ if (avc_compute_create(subj->sid, obj->sid, SECCLASS_X_PROPERTY, &tsid) < 0) { ErrorF("SELinux: a compute_create call failed!\n"); return BadValue; } /* Polyinstantiate if necessary to obtain the final SID */ if (obj->poly) { tsid2 = tsid; if (avc_compute_member(subj->sid, tsid2, SECCLASS_X_PROPERTY, &tsid) < 0) { ErrorF("SELinux: a compute_member call failed!\n"); return BadValue; } } out: *sid_rtn = tsid; if (poly_rtn) *poly_rtn = obj->poly; return Success; } /* * Looks up the SID corresponding to the given event type */ int SELinuxEventToSID(unsigned type, security_id_t sid_of_window, SELinuxObjectRec * sid_return) { const char *name = LookupEventName(type); security_id_t sid; security_context_t ctx; type &= 127; sid = SELinuxArrayGet(&arr_events, type); if (!sid) { /* Look in the mappings of event names to contexts */ if (selabel_lookup_raw(label_hnd, &ctx, name, SELABEL_X_EVENT) < 0) { ErrorF("SELinux: an event label lookup failed!\n"); return BadValue; } /* Get a SID for context */ if (avc_context_to_sid_raw(ctx, &sid) < 0) { ErrorF("SELinux: a context_to_SID_raw call failed!\n"); freecon(ctx); return BadAlloc; } freecon(ctx); /* Cache the SID value */ if (!SELinuxArraySet(&arr_events, type, sid)) return BadAlloc; } /* Perform a transition to obtain the final SID */ if (avc_compute_create(sid_of_window, sid, SECCLASS_X_EVENT, &sid_return->sid) < 0) { ErrorF("SELinux: a compute_create call failed!\n"); return BadValue; } return Success; } int SELinuxExtensionToSID(const char *name, security_id_t * sid_rtn) { security_context_t ctx; /* Look in the mappings of extension names to contexts */ if (selabel_lookup_raw(label_hnd, &ctx, name, SELABEL_X_EXT) < 0) { ErrorF("SELinux: a property label lookup failed!\n"); return BadValue; } /* Get a SID for context */ if (avc_context_to_sid_raw(ctx, sid_rtn) < 0) { ErrorF("SELinux: a context_to_SID_raw call failed!\n"); freecon(ctx); return BadAlloc; } freecon(ctx); return Success; } /* * Returns the object class corresponding to the given resource type. */ security_class_t SELinuxTypeToClass(RESTYPE type) { void *tmp; tmp = SELinuxArrayGet(&arr_types, type & TypeMask); if (!tmp) { unsigned long class = SECCLASS_X_RESOURCE; if (type & RC_DRAWABLE) class = SECCLASS_X_DRAWABLE; else if (type == RT_GC) class = SECCLASS_X_GC; else if (type == RT_FONT) class = SECCLASS_X_FONT; else if (type == RT_CURSOR) class = SECCLASS_X_CURSOR; else if (type == RT_COLORMAP) class = SECCLASS_X_COLORMAP; else { /* Need to do a string lookup */ const char *str = LookupResourceName(type); if (!strcmp(str, "PICTURE")) class = SECCLASS_X_DRAWABLE; else if (!strcmp(str, "GLYPHSET")) class = SECCLASS_X_FONT; } tmp = (void *) class; SELinuxArraySet(&arr_types, type & TypeMask, tmp); } return (security_class_t) (unsigned long) tmp; } security_context_t SELinuxDefaultClientLabel(void) { security_context_t ctx; if (selabel_lookup_raw(label_hnd, &ctx, "remote", SELABEL_X_CLIENT) < 0) FatalError("SELinux: failed to look up remote-client context\n"); return ctx; } void SELinuxLabelInit(void) { struct selinux_opt selabel_option = { SELABEL_OPT_VALIDATE, (char *) 1 }; label_hnd = selabel_open(SELABEL_CTX_X, &selabel_option, 1); if (!label_hnd) FatalError("SELinux: Failed to open x_contexts mapping in policy\n"); } void SELinuxLabelReset(void) { selabel_close(label_hnd); label_hnd = NULL; /* Free local state */ SELinuxArrayFree(&arr_types, 0); SELinuxArrayFree(&arr_events, 0); SELinuxArrayFree(&arr_atoms, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xselinux_hooks.c������������������������������������������������������������0000664�0001751�0001751�00000073042�12362011423�015167� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR 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. ********************************************************/ /* * Portions of this code copyright (c) 2005 by Trusted Computer Solutions, Inc. * All rights reserved. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <sys/socket.h> #include <stdio.h> #include <stdarg.h> #include <libaudit.h> #include <X11/Xatom.h> #include "selection.h" #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include "propertyst.h" #include "extnsionst.h" #include "xacestr.h" #include "client.h" #include "../os/osdep.h" #define _XSELINUX_NEED_FLASK_MAP #include "xselinuxint.h" /* structure passed to auditing callback */ typedef struct { ClientPtr client; /* client */ DeviceIntPtr dev; /* device */ char *command; /* client's executable path */ unsigned id; /* resource id, if any */ int restype; /* resource type, if any */ int event; /* event type, if any */ Atom property; /* property name, if any */ Atom selection; /* selection name, if any */ char *extension; /* extension name, if any */ } SELinuxAuditRec; /* private state keys */ DevPrivateKeyRec subjectKeyRec; DevPrivateKeyRec objectKeyRec; DevPrivateKeyRec dataKeyRec; /* audit file descriptor */ static int audit_fd; /* atoms for window label properties */ static Atom atom_ctx; static Atom atom_client_ctx; /* The unlabeled SID */ static security_id_t unlabeled_sid; /* forward declarations */ static void SELinuxScreen(CallbackListPtr *, void *, void *); /* "true" pointer value for use as callback data */ static void *truep = (void *) 1; /* * Performs an SELinux permission check. */ static int SELinuxDoCheck(SELinuxSubjectRec * subj, SELinuxObjectRec * obj, security_class_t class, Mask mode, SELinuxAuditRec * auditdata) { /* serverClient requests OK */ if (subj->privileged) return Success; auditdata->command = subj->command; errno = 0; if (avc_has_perm(subj->sid, obj->sid, class, mode, &subj->aeref, auditdata) < 0) { if (mode == DixUnknownAccess) return Success; /* DixUnknownAccess requests OK ... for now */ if (errno == EACCES) return BadAccess; ErrorF("SELinux: avc_has_perm: unexpected error %d\n", errno); return BadValue; } return Success; } /* * Labels a newly connected client. */ static void SELinuxLabelClient(ClientPtr client) { int fd = XaceGetConnectionNumber(client); SELinuxSubjectRec *subj; SELinuxObjectRec *obj; security_context_t ctx; subj = dixLookupPrivate(&client->devPrivates, subjectKey); obj = dixLookupPrivate(&client->devPrivates, objectKey); /* Try to get a context from the socket */ if (fd < 0 || getpeercon_raw(fd, &ctx) < 0) { /* Otherwise, fall back to a default context */ ctx = SELinuxDefaultClientLabel(); } /* For local clients, try and determine the executable name */ if (XaceIsLocal(client)) { /* Get cached command name if CLIENTIDS is enabled. */ const char *cmdname = GetClientCmdName(client); Bool cached = (cmdname != NULL); /* If CLIENTIDS is disabled, figure out the command name from * scratch. */ if (!cmdname) { pid_t pid = DetermineClientPid(client); if (pid != -1) DetermineClientCmd(pid, &cmdname, NULL); } if (!cmdname) goto finish; strncpy(subj->command, cmdname, COMMAND_LEN - 1); if (!cached) free(cmdname); /* const char * */ } finish: /* Get a SID from the context */ if (avc_context_to_sid_raw(ctx, &subj->sid) < 0) FatalError("SELinux: client %d: context_to_sid_raw(%s) failed\n", client->index, ctx); obj->sid = subj->sid; freecon(ctx); } /* * Labels initial server objects. */ static void SELinuxLabelInitial(void) { int i; XaceScreenAccessRec srec; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; security_context_t ctx; void *unused; /* Do the serverClient */ subj = dixLookupPrivate(&serverClient->devPrivates, subjectKey); obj = dixLookupPrivate(&serverClient->devPrivates, objectKey); subj->privileged = 1; /* Use the context of the X server process for the serverClient */ if (getcon_raw(&ctx) < 0) FatalError("SELinux: couldn't get context of X server process\n"); /* Get a SID from the context */ if (avc_context_to_sid_raw(ctx, &subj->sid) < 0) FatalError("SELinux: serverClient: context_to_sid(%s) failed\n", ctx); obj->sid = subj->sid; freecon(ctx); srec.client = serverClient; srec.access_mode = DixCreateAccess; srec.status = Success; for (i = 0; i < screenInfo.numScreens; i++) { /* Do the screen object */ srec.screen = screenInfo.screens[i]; SELinuxScreen(NULL, NULL, &srec); /* Do the default colormap */ dixLookupResourceByType(&unused, screenInfo.screens[i]->defColormap, RT_COLORMAP, serverClient, DixCreateAccess); } } /* * Labels new resource objects. */ static int SELinuxLabelResource(XaceResourceAccessRec * rec, SELinuxSubjectRec * subj, SELinuxObjectRec * obj, security_class_t class) { int offset; security_id_t tsid; /* Check for a create context */ if (rec->rtype & RC_DRAWABLE && subj->win_create_sid) { obj->sid = subj->win_create_sid; return Success; } if (rec->parent) offset = dixLookupPrivateOffset(rec->ptype); if (rec->parent && offset >= 0) { /* Use the SID of the parent object in the labeling operation */ PrivateRec **privatePtr = DEVPRIV_AT(rec->parent, offset); SELinuxObjectRec *pobj = dixLookupPrivate(privatePtr, objectKey); tsid = pobj->sid; } else { /* Use the SID of the subject */ tsid = subj->sid; } /* Perform a transition to obtain the final SID */ if (avc_compute_create(subj->sid, tsid, class, &obj->sid) < 0) { ErrorF("SELinux: a compute_create call failed!\n"); return BadValue; } return Success; } /* * Libselinux Callbacks */ static int SELinuxAudit(void *auditdata, security_class_t class, char *msgbuf, size_t msgbufsize) { SELinuxAuditRec *audit = auditdata; ClientPtr client = audit->client; char idNum[16]; const char *propertyName, *selectionName; int major = -1, minor = -1; if (client) { REQUEST(xReq); if (stuff) { major = client->majorOp; minor = client->minorOp; } } if (audit->id) snprintf(idNum, 16, "%x", audit->id); propertyName = audit->property ? NameForAtom(audit->property) : NULL; selectionName = audit->selection ? NameForAtom(audit->selection) : NULL; return snprintf(msgbuf, msgbufsize, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", (major >= 0) ? "request=" : "", (major >= 0) ? LookupRequestName(major, minor) : "", audit->command ? " comm=" : "", audit->command ? audit->command : "", audit->dev ? " xdevice=\"" : "", audit->dev ? audit->dev->name : "", audit->dev ? "\"" : "", audit->id ? " resid=" : "", audit->id ? idNum : "", audit->restype ? " restype=" : "", audit->restype ? LookupResourceName(audit->restype) : "", audit->event ? " event=" : "", audit->event ? LookupEventName(audit->event & 127) : "", audit->property ? " property=" : "", audit->property ? propertyName : "", audit->selection ? " selection=" : "", audit->selection ? selectionName : "", audit->extension ? " extension=" : "", audit->extension ? audit->extension : ""); } static int SELinuxLog(int type, const char *fmt, ...) { va_list ap; char buf[MAX_AUDIT_MESSAGE_LENGTH]; int rc, aut; switch (type) { case SELINUX_INFO: aut = AUDIT_USER_MAC_POLICY_LOAD; break; case SELINUX_AVC: aut = AUDIT_USER_AVC; break; default: aut = AUDIT_USER_SELINUX_ERR; break; } va_start(ap, fmt); vsnprintf(buf, MAX_AUDIT_MESSAGE_LENGTH, fmt, ap); rc = audit_log_user_avc_message(audit_fd, aut, buf, NULL, NULL, NULL, 0); va_end(ap); LogMessageVerb(X_WARNING, 0, "%s", buf); return 0; } /* * XACE Callbacks */ static void SELinuxDevice(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceDeviceAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; SELinuxAuditRec auditdata = {.client = rec->client,.dev = rec->dev }; security_class_t cls; int rc; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&rec->dev->devPrivates, objectKey); /* If this is a new object that needs labeling, do it now */ if (rec->access_mode & DixCreateAccess) { SELinuxSubjectRec *dsubj; dsubj = dixLookupPrivate(&rec->dev->devPrivates, subjectKey); if (subj->dev_create_sid) { /* Label the device with the create context */ obj->sid = subj->dev_create_sid; dsubj->sid = subj->dev_create_sid; } else { /* Label the device directly with the process SID */ obj->sid = subj->sid; dsubj->sid = subj->sid; } } cls = IsPointerDevice(rec->dev) ? SECCLASS_X_POINTER : SECCLASS_X_KEYBOARD; rc = SELinuxDoCheck(subj, obj, cls, rec->access_mode, &auditdata); if (rc != Success) rec->status = rc; } static void SELinuxSend(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceSendAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj, ev_sid; SELinuxAuditRec auditdata = {.client = rec->client,.dev = rec->dev }; security_class_t class; int rc, i, type; if (rec->dev) subj = dixLookupPrivate(&rec->dev->devPrivates, subjectKey); else subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&rec->pWin->devPrivates, objectKey); /* Check send permission on window */ rc = SELinuxDoCheck(subj, obj, SECCLASS_X_DRAWABLE, DixSendAccess, &auditdata); if (rc != Success) goto err; /* Check send permission on specific event types */ for (i = 0; i < rec->count; i++) { type = rec->events[i].u.u.type; class = (type & 128) ? SECCLASS_X_FAKEEVENT : SECCLASS_X_EVENT; rc = SELinuxEventToSID(type, obj->sid, &ev_sid); if (rc != Success) goto err; auditdata.event = type; rc = SELinuxDoCheck(subj, &ev_sid, class, DixSendAccess, &auditdata); if (rc != Success) goto err; } return; err: rec->status = rc; } static void SELinuxReceive(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceReceiveAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj, ev_sid; SELinuxAuditRec auditdata = {.client = NULL }; security_class_t class; int rc, i, type; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&rec->pWin->devPrivates, objectKey); /* Check receive permission on window */ rc = SELinuxDoCheck(subj, obj, SECCLASS_X_DRAWABLE, DixReceiveAccess, &auditdata); if (rc != Success) goto err; /* Check receive permission on specific event types */ for (i = 0; i < rec->count; i++) { type = rec->events[i].u.u.type; class = (type & 128) ? SECCLASS_X_FAKEEVENT : SECCLASS_X_EVENT; rc = SELinuxEventToSID(type, obj->sid, &ev_sid); if (rc != Success) goto err; auditdata.event = type; rc = SELinuxDoCheck(subj, &ev_sid, class, DixReceiveAccess, &auditdata); if (rc != Success) goto err; } return; err: rec->status = rc; } static void SELinuxExtension(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceExtAccessRec *rec = calldata; SELinuxSubjectRec *subj, *serv; SELinuxObjectRec *obj; SELinuxAuditRec auditdata = {.client = rec->client }; int rc; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&rec->ext->devPrivates, objectKey); /* If this is a new object that needs labeling, do it now */ /* XXX there should be a separate callback for this */ if (obj->sid == NULL) { security_id_t sid; serv = dixLookupPrivate(&serverClient->devPrivates, subjectKey); rc = SELinuxExtensionToSID(rec->ext->name, &sid); if (rc != Success) { rec->status = rc; return; } /* Perform a transition to obtain the final SID */ if (avc_compute_create(serv->sid, sid, SECCLASS_X_EXTENSION, &obj->sid) < 0) { ErrorF("SELinux: a SID transition call failed!\n"); rec->status = BadValue; return; } } /* Perform the security check */ auditdata.extension = rec->ext->name; rc = SELinuxDoCheck(subj, obj, SECCLASS_X_EXTENSION, rec->access_mode, &auditdata); if (rc != Success) rec->status = rc; } static void SELinuxSelection(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceSelectionAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj, *data; Selection *pSel = *rec->ppSel; Atom name = pSel->selection; Mask access_mode = rec->access_mode; SELinuxAuditRec auditdata = {.client = rec->client,.selection = name }; security_id_t tsid; int rc; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&pSel->devPrivates, objectKey); /* If this is a new object that needs labeling, do it now */ if (access_mode & DixCreateAccess) { rc = SELinuxSelectionToSID(name, subj, &obj->sid, &obj->poly); if (rc != Success) obj->sid = unlabeled_sid; access_mode = DixSetAttrAccess; } /* If this is a polyinstantiated object, find the right instance */ else if (obj->poly) { rc = SELinuxSelectionToSID(name, subj, &tsid, NULL); if (rc != Success) { rec->status = rc; return; } while (pSel->selection != name || obj->sid != tsid) { if ((pSel = pSel->next) == NULL) break; obj = dixLookupPrivate(&pSel->devPrivates, objectKey); } if (pSel) *rec->ppSel = pSel; else { rec->status = BadMatch; return; } } /* Perform the security check */ rc = SELinuxDoCheck(subj, obj, SECCLASS_X_SELECTION, access_mode, &auditdata); if (rc != Success) rec->status = rc; /* Label the content (advisory only) */ if (access_mode & DixSetAttrAccess) { data = dixLookupPrivate(&pSel->devPrivates, dataKey); if (subj->sel_create_sid) data->sid = subj->sel_create_sid; else data->sid = obj->sid; } } static void SELinuxProperty(CallbackListPtr *pcbl, void *unused, void *calldata) { XacePropertyAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj, *data; PropertyPtr pProp = *rec->ppProp; Atom name = pProp->propertyName; SELinuxAuditRec auditdata = {.client = rec->client,.property = name }; security_id_t tsid; int rc; /* Don't care about the new content check */ if (rec->access_mode & DixPostAccess) return; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&pProp->devPrivates, objectKey); /* If this is a new object that needs labeling, do it now */ if (rec->access_mode & DixCreateAccess) { rc = SELinuxPropertyToSID(name, subj, &obj->sid, &obj->poly); if (rc != Success) { rec->status = rc; return; } } /* If this is a polyinstantiated object, find the right instance */ else if (obj->poly) { rc = SELinuxPropertyToSID(name, subj, &tsid, NULL); if (rc != Success) { rec->status = rc; return; } while (pProp->propertyName != name || obj->sid != tsid) { if ((pProp = pProp->next) == NULL) break; obj = dixLookupPrivate(&pProp->devPrivates, objectKey); } if (pProp) *rec->ppProp = pProp; else { rec->status = BadMatch; return; } } /* Perform the security check */ rc = SELinuxDoCheck(subj, obj, SECCLASS_X_PROPERTY, rec->access_mode, &auditdata); if (rc != Success) rec->status = rc; /* Label the content (advisory only) */ if (rec->access_mode & DixWriteAccess) { data = dixLookupPrivate(&pProp->devPrivates, dataKey); if (subj->prp_create_sid) data->sid = subj->prp_create_sid; else data->sid = obj->sid; } } static void SELinuxResource(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceResourceAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; SELinuxAuditRec auditdata = {.client = rec->client }; Mask access_mode = rec->access_mode; PrivateRec **privatePtr; security_class_t class; int rc, offset; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); /* Determine if the resource object has a devPrivates field */ offset = dixLookupPrivateOffset(rec->rtype); if (offset < 0) { /* No: use the SID of the owning client */ class = SECCLASS_X_RESOURCE; privatePtr = &clients[CLIENT_ID(rec->id)]->devPrivates; obj = dixLookupPrivate(privatePtr, objectKey); } else { /* Yes: use the SID from the resource object itself */ class = SELinuxTypeToClass(rec->rtype); privatePtr = DEVPRIV_AT(rec->res, offset); obj = dixLookupPrivate(privatePtr, objectKey); } /* If this is a new object that needs labeling, do it now */ if (access_mode & DixCreateAccess && offset >= 0) { rc = SELinuxLabelResource(rec, subj, obj, class); if (rc != Success) { rec->status = rc; return; } } /* Collapse generic resource permissions down to read/write */ if (class == SECCLASS_X_RESOURCE) { access_mode = ! !(rec->access_mode & SELinuxReadMask); /* rd */ access_mode |= ! !(rec->access_mode & ~SELinuxReadMask) << 1; /* wr */ } /* Perform the security check */ auditdata.restype = rec->rtype; auditdata.id = rec->id; rc = SELinuxDoCheck(subj, obj, class, access_mode, &auditdata); if (rc != Success) rec->status = rc; /* Perform the background none check on windows */ if (access_mode & DixCreateAccess && rec->rtype == RT_WINDOW) { rc = SELinuxDoCheck(subj, obj, class, DixBlendAccess, &auditdata); if (rc != Success) ((WindowPtr) rec->res)->forcedBG = TRUE; } } static void SELinuxScreen(CallbackListPtr *pcbl, void *is_saver, void *calldata) { XaceScreenAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; SELinuxAuditRec auditdata = {.client = rec->client }; Mask access_mode = rec->access_mode; int rc; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&rec->screen->devPrivates, objectKey); /* If this is a new object that needs labeling, do it now */ if (access_mode & DixCreateAccess) { /* Perform a transition to obtain the final SID */ if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SCREEN, &obj->sid) < 0) { ErrorF("SELinux: a compute_create call failed!\n"); rec->status = BadValue; return; } } if (is_saver) access_mode <<= 2; rc = SELinuxDoCheck(subj, obj, SECCLASS_X_SCREEN, access_mode, &auditdata); if (rc != Success) rec->status = rc; } static void SELinuxClient(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceClientAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; SELinuxAuditRec auditdata = {.client = rec->client }; int rc; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&rec->target->devPrivates, objectKey); rc = SELinuxDoCheck(subj, obj, SECCLASS_X_CLIENT, rec->access_mode, &auditdata); if (rc != Success) rec->status = rc; } static void SELinuxServer(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceServerAccessRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; SELinuxAuditRec auditdata = {.client = rec->client }; int rc; subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey); obj = dixLookupPrivate(&serverClient->devPrivates, objectKey); rc = SELinuxDoCheck(subj, obj, SECCLASS_X_SERVER, rec->access_mode, &auditdata); if (rc != Success) rec->status = rc; } /* * DIX Callbacks */ static void SELinuxClientState(CallbackListPtr *pcbl, void *unused, void *calldata) { NewClientInfoRec *pci = calldata; switch (pci->client->clientState) { case ClientStateInitial: SELinuxLabelClient(pci->client); break; default: break; } } static void SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata) { ResourceStateInfoRec *rec = calldata; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; WindowPtr pWin; if (rec->type != RT_WINDOW) return; if (rec->state != ResourceStateAdding) return; pWin = (WindowPtr) rec->value; subj = dixLookupPrivate(&wClient(pWin)->devPrivates, subjectKey); if (subj->sid) { security_context_t ctx; int rc = avc_sid_to_context_raw(subj->sid, &ctx); if (rc < 0) FatalError("SELinux: Failed to get security context!\n"); rc = dixChangeWindowProperty(serverClient, pWin, atom_client_ctx, XA_STRING, 8, PropModeReplace, strlen(ctx), ctx, FALSE); if (rc != Success) FatalError("SELinux: Failed to set label property on window!\n"); freecon(ctx); } else FatalError("SELinux: Unexpected unlabeled client found\n"); obj = dixLookupPrivate(&pWin->devPrivates, objectKey); if (obj->sid) { security_context_t ctx; int rc = avc_sid_to_context_raw(obj->sid, &ctx); if (rc < 0) FatalError("SELinux: Failed to get security context!\n"); rc = dixChangeWindowProperty(serverClient, pWin, atom_ctx, XA_STRING, 8, PropModeReplace, strlen(ctx), ctx, FALSE); if (rc != Success) FatalError("SELinux: Failed to set label property on window!\n"); freecon(ctx); } else FatalError("SELinux: Unexpected unlabeled window found\n"); } static int netlink_fd; static void SELinuxBlockHandler(void *data, struct timeval **tv, void *read_mask) { } static void SELinuxWakeupHandler(void *data, int num_fds, void *read_mask) { if (num_fds > 0 && FD_ISSET(netlink_fd, (fd_set *) read_mask)) avc_netlink_check_nb(); } void SELinuxFlaskReset(void) { /* Unregister callbacks */ DeleteCallback(&ClientStateCallback, SELinuxClientState, NULL); DeleteCallback(&ResourceStateCallback, SELinuxResourceState, NULL); XaceDeleteCallback(XACE_EXT_DISPATCH, SELinuxExtension, NULL); XaceDeleteCallback(XACE_RESOURCE_ACCESS, SELinuxResource, NULL); XaceDeleteCallback(XACE_DEVICE_ACCESS, SELinuxDevice, NULL); XaceDeleteCallback(XACE_PROPERTY_ACCESS, SELinuxProperty, NULL); XaceDeleteCallback(XACE_SEND_ACCESS, SELinuxSend, NULL); XaceDeleteCallback(XACE_RECEIVE_ACCESS, SELinuxReceive, NULL); XaceDeleteCallback(XACE_CLIENT_ACCESS, SELinuxClient, NULL); XaceDeleteCallback(XACE_EXT_ACCESS, SELinuxExtension, NULL); XaceDeleteCallback(XACE_SERVER_ACCESS, SELinuxServer, NULL); XaceDeleteCallback(XACE_SELECTION_ACCESS, SELinuxSelection, NULL); XaceDeleteCallback(XACE_SCREEN_ACCESS, SELinuxScreen, NULL); XaceDeleteCallback(XACE_SCREENSAVER_ACCESS, SELinuxScreen, truep); /* Tear down SELinux stuff */ audit_close(audit_fd); avc_netlink_release_fd(); RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, NULL); RemoveGeneralSocket(netlink_fd); avc_destroy(); } void SELinuxFlaskInit(void) { struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *) 0 }; security_context_t ctx; int ret = TRUE; switch (selinuxEnforcingState) { case SELINUX_MODE_ENFORCING: LogMessage(X_INFO, "SELinux: Configured in enforcing mode\n"); avc_option.value = (char *) 1; break; case SELINUX_MODE_PERMISSIVE: LogMessage(X_INFO, "SELinux: Configured in permissive mode\n"); avc_option.value = (char *) 0; break; default: avc_option.type = AVC_OPT_UNUSED; break; } /* Set up SELinux stuff */ selinux_set_callback(SELINUX_CB_LOG, (union selinux_callback) SELinuxLog); selinux_set_callback(SELINUX_CB_AUDIT, (union selinux_callback) SELinuxAudit); if (selinux_set_mapping(map) < 0) { if (errno == EINVAL) { ErrorF ("SELinux: Invalid object class mapping, disabling SELinux support.\n"); return; } FatalError("SELinux: Failed to set up security class mapping\n"); } if (avc_open(&avc_option, 1) < 0) FatalError("SELinux: Couldn't initialize SELinux userspace AVC\n"); if (security_get_initial_context_raw("unlabeled", &ctx) < 0) FatalError("SELinux: Failed to look up unlabeled context\n"); if (avc_context_to_sid_raw(ctx, &unlabeled_sid) < 0) FatalError("SELinux: a context_to_SID call failed!\n"); freecon(ctx); /* Prepare for auditing */ audit_fd = audit_open(); if (audit_fd < 0) FatalError("SELinux: Failed to open the system audit log\n"); /* Allocate private storage */ if (!dixRegisterPrivateKey (subjectKey, PRIVATE_XSELINUX, sizeof(SELinuxSubjectRec)) || !dixRegisterPrivateKey(objectKey, PRIVATE_XSELINUX, sizeof(SELinuxObjectRec)) || !dixRegisterPrivateKey(dataKey, PRIVATE_XSELINUX, sizeof(SELinuxObjectRec))) FatalError("SELinux: Failed to allocate private storage.\n"); /* Create atoms for doing window labeling */ atom_ctx = MakeAtom("_SELINUX_CONTEXT", 16, TRUE); if (atom_ctx == BAD_RESOURCE) FatalError("SELinux: Failed to create atom\n"); atom_client_ctx = MakeAtom("_SELINUX_CLIENT_CONTEXT", 23, TRUE); if (atom_client_ctx == BAD_RESOURCE) FatalError("SELinux: Failed to create atom\n"); netlink_fd = avc_netlink_acquire_fd(); AddGeneralSocket(netlink_fd); RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, NULL); /* Register callbacks */ ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL); ret &= AddCallback(&ResourceStateCallback, SELinuxResourceState, NULL); ret &= XaceRegisterCallback(XACE_EXT_DISPATCH, SELinuxExtension, NULL); ret &= XaceRegisterCallback(XACE_RESOURCE_ACCESS, SELinuxResource, NULL); ret &= XaceRegisterCallback(XACE_DEVICE_ACCESS, SELinuxDevice, NULL); ret &= XaceRegisterCallback(XACE_PROPERTY_ACCESS, SELinuxProperty, NULL); ret &= XaceRegisterCallback(XACE_SEND_ACCESS, SELinuxSend, NULL); ret &= XaceRegisterCallback(XACE_RECEIVE_ACCESS, SELinuxReceive, NULL); ret &= XaceRegisterCallback(XACE_CLIENT_ACCESS, SELinuxClient, NULL); ret &= XaceRegisterCallback(XACE_EXT_ACCESS, SELinuxExtension, NULL); ret &= XaceRegisterCallback(XACE_SERVER_ACCESS, SELinuxServer, NULL); ret &= XaceRegisterCallback(XACE_SELECTION_ACCESS, SELinuxSelection, NULL); ret &= XaceRegisterCallback(XACE_SCREEN_ACCESS, SELinuxScreen, NULL); ret &= XaceRegisterCallback(XACE_SCREENSAVER_ACCESS, SELinuxScreen, truep); if (!ret) FatalError("SELinux: Failed to register one or more callbacks\n"); /* Label objects that were created before we could register ourself */ SELinuxLabelInitial(); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/sync.c����������������������������������������������������������������������0000664�0001751�0001751�00000246660�12456571574�013117� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1991, 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1991, 1993 by Digital Equipment Corporation, Maynard, Massachusetts, and Olivetti Research Limited, Cambridge, England. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or Olivetti not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Digital and Olivetti make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include <X11/X.h> #include <X11/Xproto.h> #include <X11/Xmd.h> #include "scrnintstr.h" #include "os.h" #include "extnsionst.h" #include "dixstruct.h" #include "pixmapstr.h" #include "resource.h" #include "opaque.h" #include <X11/extensions/syncproto.h> #include "syncsrv.h" #include "syncsdk.h" #include "protocol-versions.h" #include "inputstr.h" #include <stdio.h> #if !defined(WIN32) #include <sys/time.h> #endif #include "extinit.h" /* * Local Global Variables */ static int SyncEventBase; static int SyncErrorBase; static RESTYPE RTCounter = 0; static RESTYPE RTAwait; static RESTYPE RTAlarm; static RESTYPE RTAlarmClient; static RESTYPE RTFence; static struct xorg_list SysCounterList; static int SyncNumInvalidCounterWarnings = 0; #define MAX_INVALID_COUNTER_WARNINGS 5 static const char *WARN_INVALID_COUNTER_COMPARE = "Warning: Non-counter XSync object using Counter-only\n" " comparison. Result will never be true.\n"; static const char *WARN_INVALID_COUNTER_ALARM = "Warning: Non-counter XSync object used in alarm. This is\n" " the result of a programming error in the X server.\n"; #define IsSystemCounter(pCounter) \ (pCounter && (pCounter->sync.client == NULL)) /* these are all the alarm attributes that pertain to the alarm's trigger */ #define XSyncCAAllTrigger \ (XSyncCACounter | XSyncCAValueType | XSyncCAValue | XSyncCATestType) static void SyncComputeBracketValues(SyncCounter *); 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) { if (pSync && (SYNC_COUNTER != pSync->type)) { if (SyncNumInvalidCounterWarnings++ < MAX_INVALID_COUNTER_WARNINGS) { ErrorF("%s", warning); ErrorF(" Counter type: %d\n", pSync->type); } return FALSE; } return TRUE; } /* Each counter maintains a simple linked list of triggers that are * interested in the counter. The two functions below are used to * delete and add triggers on this list. */ void SyncDeleteTriggerFromSyncObject(SyncTrigger * pTrigger) { SyncTriggerList *pCur; SyncTriggerList *pPrev; SyncCounter *pCounter; /* pSync needs to be stored in pTrigger before calling here. */ if (!pTrigger->pSync) return; pPrev = NULL; pCur = pTrigger->pSync->pTriglist; while (pCur) { if (pCur->pTrigger == pTrigger) { if (pPrev) pPrev->next = pCur->next; else pTrigger->pSync->pTriglist = pCur->next; free(pCur); break; } pPrev = pCur; pCur = pCur->next; } if (SYNC_COUNTER == pTrigger->pSync->type) { pCounter = (SyncCounter *) pTrigger->pSync; if (IsSystemCounter(pCounter)) SyncComputeBracketValues(pCounter); } else if (SYNC_FENCE == pTrigger->pSync->type) { SyncFence *pFence = (SyncFence *) pTrigger->pSync; pFence->funcs.DeleteTrigger(pTrigger); } } int SyncAddTriggerToSyncObject(SyncTrigger * pTrigger) { SyncTriggerList *pCur; SyncCounter *pCounter; if (!pTrigger->pSync) return Success; /* don't do anything if it's already there */ for (pCur = pTrigger->pSync->pTriglist; pCur; pCur = pCur->next) { if (pCur->pTrigger == pTrigger) return Success; } if (!(pCur = malloc(sizeof(SyncTriggerList)))) return BadAlloc; pCur->pTrigger = pTrigger; pCur->next = pTrigger->pSync->pTriglist; pTrigger->pSync->pTriglist = pCur; if (SYNC_COUNTER == pTrigger->pSync->type) { pCounter = (SyncCounter *) pTrigger->pSync; if (IsSystemCounter(pCounter)) SyncComputeBracketValues(pCounter); } else if (SYNC_FENCE == pTrigger->pSync->type) { SyncFence *pFence = (SyncFence *) pTrigger->pSync; pFence->funcs.AddTrigger(pTrigger); } return Success; } /* Below are five possible functions that can be plugged into * pTrigger->CheckTrigger for counter sync objects, corresponding to * the four possible test-types, and the one possible function that * can be plugged into pTrigger->CheckTrigger for fence sync objects. * These functions are called after the sync object's state changes * but are also passed the old state so they can inspect both the old * and new values. (PositiveTransition and NegativeTransition need to * see both pieces of information.) These functions return the truth * value of the trigger. * * All of them include the condition pTrigger->pSync == NULL. * This is because the spec says that a trigger with a sync value * of None is always TRUE. */ static Bool SyncCheckTriggerPositiveComparison(SyncTrigger * pTrigger, CARD64 oldval) { SyncCounter *pCounter; /* Non-counter sync objects should never get here because they * never trigger this comparison. */ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) return FALSE; pCounter = (SyncCounter *) pTrigger->pSync; return (pCounter == NULL || XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value)); } static Bool SyncCheckTriggerNegativeComparison(SyncTrigger * pTrigger, CARD64 oldval) { SyncCounter *pCounter; /* Non-counter sync objects should never get here because they * never trigger this comparison. */ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) return FALSE; pCounter = (SyncCounter *) pTrigger->pSync; return (pCounter == NULL || XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value)); } static Bool SyncCheckTriggerPositiveTransition(SyncTrigger * pTrigger, CARD64 oldval) { SyncCounter *pCounter; /* Non-counter sync objects should never get here because they * never trigger this comparison. */ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) return FALSE; pCounter = (SyncCounter *) pTrigger->pSync; return (pCounter == NULL || (XSyncValueLessThan(oldval, pTrigger->test_value) && XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value))); } static Bool SyncCheckTriggerNegativeTransition(SyncTrigger * pTrigger, CARD64 oldval) { SyncCounter *pCounter; /* Non-counter sync objects should never get here because they * never trigger this comparison. */ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) return FALSE; pCounter = (SyncCounter *) pTrigger->pSync; return (pCounter == NULL || (XSyncValueGreaterThan(oldval, pTrigger->test_value) && XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value))); } static Bool SyncCheckTriggerFence(SyncTrigger * pTrigger, CARD64 unused) { SyncFence *pFence = (SyncFence *) pTrigger->pSync; (void) unused; return (pFence == NULL || pFence->funcs.CheckTriggered(pFence)); } static int SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject, RESTYPE resType, Mask changes) { SyncObject *pSync = pTrigger->pSync; SyncCounter *pCounter = NULL; int rc; Bool newSyncObject = FALSE; if (changes & XSyncCACounter) { if (syncObject == None) pSync = NULL; else if (Success != (rc = dixLookupResourceByType((void **) &pSync, syncObject, resType, client, DixReadAccess))) { client->errorValue = syncObject; return rc; } if (pSync != pTrigger->pSync) { /* new counter for trigger */ SyncDeleteTriggerFromSyncObject(pTrigger); pTrigger->pSync = pSync; newSyncObject = TRUE; } } /* if system counter, ask it what the current value is */ if (pSync && SYNC_COUNTER == pSync->type) { pCounter = (SyncCounter *) pSync; if (IsSystemCounter(pCounter)) { (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &pCounter->value); } } if (changes & XSyncCAValueType) { if (pTrigger->value_type != XSyncRelative && pTrigger->value_type != XSyncAbsolute) { client->errorValue = pTrigger->value_type; return BadValue; } } if (changes & XSyncCATestType) { if (pSync && SYNC_FENCE == pSync->type) { pTrigger->CheckTrigger = SyncCheckTriggerFence; } else { /* select appropriate CheckTrigger function */ switch (pTrigger->test_type) { case XSyncPositiveTransition: pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition; break; case XSyncNegativeTransition: pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition; break; case XSyncPositiveComparison: pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison; break; case XSyncNegativeComparison: pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison; break; default: client->errorValue = pTrigger->test_type; return BadValue; } } } if (changes & (XSyncCAValueType | XSyncCAValue)) { if (pTrigger->value_type == XSyncAbsolute) pTrigger->test_value = pTrigger->wait_value; else { /* relative */ Bool overflow; if (pCounter == NULL) return BadMatch; XSyncValueAdd(&pTrigger->test_value, pCounter->value, pTrigger->wait_value, &overflow); if (overflow) { client->errorValue = XSyncValueHigh32(pTrigger->wait_value); return BadValue; } } } /* we wait until we're sure there are no errors before registering * a new counter on a trigger */ if (newSyncObject) { if ((rc = SyncAddTriggerToSyncObject(pTrigger)) != Success) return rc; } else if (pCounter && IsSystemCounter(pCounter)) { SyncComputeBracketValues(pCounter); } return Success; } /* AlarmNotify events happen in response to actions taken on an Alarm or * the counter used by the alarm. AlarmNotify may be sent to multiple * clients. The alarm maintains a list of clients interested in events. */ static void SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm) { SyncAlarmClientList *pcl; xSyncAlarmNotifyEvent ane; SyncTrigger *pTrigger = &pAlarm->trigger; SyncCounter *pCounter; if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM)) return; pCounter = (SyncCounter *) pTrigger->pSync; UpdateCurrentTime(); 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? */ ane.counter_value_hi = ane.counter_value_lo = 0; } /* send to owner */ if (pAlarm->events) WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane); /* send to other interested clients */ for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next) WriteEventsToClient(pcl->client, 1, (xEvent *) &ane); } /* CounterNotify events only occur in response to an Await. The events * go only to the Awaiting client. */ static void SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait ** ppAwait, int num_events) { xSyncCounterNotifyEvent *pEvents, *pev; int i; if (client->clientGone) return; pev = pEvents = calloc(num_events, sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); for (i = 0; i < num_events; i++, ppAwait++, pev++) { SyncTrigger *pTrigger = &(*ppAwait)->trigger; pev->type = SyncEventBase + XSyncCounterNotify; pev->kind = XSyncCounterNotify; pev->counter = pTrigger->pSync->id; pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value); pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value); if (SYNC_COUNTER == pTrigger->pSync->type) { SyncCounter *pCounter = (SyncCounter *) pTrigger->pSync; pev->counter_value_lo = XSyncValueLow32(pCounter->value); pev->counter_value_hi = XSyncValueHigh32(pCounter->value); } else { pev->counter_value_lo = 0; pev->counter_value_hi = 0; } pev->time = currentTime.milliseconds; pev->count = num_events - i - 1; /* events remaining */ pev->destroyed = pTrigger->pSync->beingDestroyed; } /* swapping will be taken care of by this */ WriteEventsToClient(client, num_events, (xEvent *) pEvents); free(pEvents); } /* This function is called when an alarm's counter is destroyed. * It is plugged into pTrigger->CounterDestroyed (for alarm triggers). */ static void SyncAlarmCounterDestroyed(SyncTrigger * pTrigger) { SyncAlarm *pAlarm = (SyncAlarm *) pTrigger; pAlarm->state = XSyncAlarmInactive; SyncSendAlarmNotifyEvents(pAlarm); pTrigger->pSync = NULL; } /* This function is called when an alarm "goes off." * It is plugged into pTrigger->TriggerFired (for alarm triggers). */ static void SyncAlarmTriggerFired(SyncTrigger * pTrigger) { SyncAlarm *pAlarm = (SyncAlarm *) pTrigger; SyncCounter *pCounter; CARD64 new_test_value; if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM)) return; pCounter = (SyncCounter *) pTrigger->pSync; /* no need to check alarm unless it's active */ if (pAlarm->state != XSyncAlarmActive) return; /* " if the counter value is None, or if the delta is 0 and * the test-type is PositiveComparison or NegativeComparison, * no change is made to value (test-value) and the alarm * state is changed to Inactive before the event is generated." */ if (pCounter == NULL || (XSyncValueIsZero(pAlarm->delta) && (pAlarm->trigger.test_type == XSyncPositiveComparison || pAlarm->trigger.test_type == XSyncNegativeComparison))) pAlarm->state = XSyncAlarmInactive; new_test_value = pAlarm->trigger.test_value; if (pAlarm->state == XSyncAlarmActive) { Bool overflow; CARD64 oldvalue; SyncTrigger *paTrigger = &pAlarm->trigger; SyncCounter *paCounter; if (!SyncCheckWarnIsCounter(paTrigger->pSync, WARN_INVALID_COUNTER_ALARM)) return; paCounter = (SyncCounter *) pTrigger->pSync; /* "The alarm is updated by repeatedly adding delta to the * value of the trigger and re-initializing it until it * becomes FALSE." */ oldvalue = paTrigger->test_value; /* XXX really should do something smarter here */ do { XSyncValueAdd(&paTrigger->test_value, paTrigger->test_value, pAlarm->delta, &overflow); } while (!overflow && (*paTrigger->CheckTrigger) (paTrigger, paCounter->value)); new_test_value = paTrigger->test_value; paTrigger->test_value = oldvalue; /* "If this update would cause value to fall outside the range * for an INT64...no change is made to value (test-value) and * the alarm state is changed to Inactive before the event is * generated." */ if (overflow) { new_test_value = oldvalue; pAlarm->state = XSyncAlarmInactive; } } /* The AlarmNotify event has to have the "new state of the alarm" * which we can't be sure of until this point. However, it has * to have the "old" trigger test value. That's the reason for * all the newvalue/oldvalue shuffling above. After we send the * events, give the trigger its new test value. */ SyncSendAlarmNotifyEvents(pAlarm); pTrigger->test_value = new_test_value; } /* This function is called when an Await unblocks, either as a result * of the trigger firing OR the counter being destroyed. * It goes into pTrigger->TriggerFired AND pTrigger->CounterDestroyed * (for Await triggers). */ static void SyncAwaitTriggerFired(SyncTrigger * pTrigger) { SyncAwait *pAwait = (SyncAwait *) pTrigger; int numwaits; SyncAwaitUnion *pAwaitUnion; SyncAwait **ppAwait; int num_events = 0; pAwaitUnion = (SyncAwaitUnion *) pAwait->pHeader; numwaits = pAwaitUnion->header.num_waitconditions; ppAwait = malloc(numwaits * sizeof(SyncAwait *)); if (!ppAwait) goto bail; pAwait = &(pAwaitUnion + 1)->await; /* "When a client is unblocked, all the CounterNotify events for * the Await request are generated contiguously. If count is 0 * there are no more events to follow for this request. If * count is n, there are at least n more events to follow." * * Thus, it is best to find all the counters for which events * need to be sent first, so that an accurate count field can * be stored in the events. */ for (; numwaits; numwaits--, pAwait++) { CARD64 diff; Bool overflow, diffgreater, diffequal; /* "A CounterNotify event with the destroyed flag set to TRUE is * always generated if the counter for one of the triggers is * destroyed." */ if (pAwait->trigger.pSync->beingDestroyed) { ppAwait[num_events++] = pAwait; continue; } if (SYNC_COUNTER == pAwait->trigger.pSync->type) { SyncCounter *pCounter = (SyncCounter *) pAwait->trigger.pSync; /* "The difference between the counter and the test value is * calculated by subtracting the test value from the value of * the counter." */ XSyncValueSubtract(&diff, pCounter->value, pAwait->trigger.test_value, &overflow); /* "If the difference lies outside the range for an INT64, an * event is not generated." */ if (overflow) continue; diffgreater = XSyncValueGreaterThan(diff, pAwait->event_threshold); diffequal = XSyncValueEqual(diff, pAwait->event_threshold); /* "If the test-type is PositiveTransition or * PositiveComparison, a CounterNotify event is generated if * the difference is at least event-threshold. If the test-type * is NegativeTransition or NegativeComparison, a CounterNotify * event is generated if the difference is at most * event-threshold." */ if (((pAwait->trigger.test_type == XSyncPositiveComparison || pAwait->trigger.test_type == XSyncPositiveTransition) && (diffgreater || diffequal)) || ((pAwait->trigger.test_type == XSyncNegativeComparison || pAwait->trigger.test_type == XSyncNegativeTransition) && (!diffgreater) /* less or equal */ ) ) { ppAwait[num_events++] = pAwait; } } } if (num_events) SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait, num_events); free(ppAwait); bail: /* unblock the client */ AttendClient(pAwaitUnion->header.client); /* delete the await */ FreeResource(pAwaitUnion->header.delete_id, RT_NONE); } static CARD64 SyncUpdateCounter(SyncCounter *pCounter, CARD64 newval) { CARD64 oldval = pCounter->value; pCounter->value = newval; return oldval; } /* This function should always be used to change a counter's value so that * any triggers depending on the counter will be checked. */ void SyncChangeCounter(SyncCounter * pCounter, CARD64 newval) { SyncTriggerList *ptl, *pnext; CARD64 oldval; oldval = SyncUpdateCounter(pCounter, newval); /* run through triggers to see if any become true */ for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { pnext = ptl->next; if ((*ptl->pTrigger->CheckTrigger) (ptl->pTrigger, oldval)) (*ptl->pTrigger->TriggerFired) (ptl->pTrigger); } if (IsSystemCounter(pCounter)) { SyncComputeBracketValues(pCounter); } } /* loosely based on dix/events.c/EventSelectForWindow */ static Bool SyncEventSelectForAlarm(SyncAlarm * pAlarm, ClientPtr client, Bool wantevents) { SyncAlarmClientList *pClients; if (client == pAlarm->client) { /* alarm owner */ pAlarm->events = wantevents; return Success; } /* see if the client is already on the list (has events selected) */ for (pClients = pAlarm->pEventClients; pClients; pClients = pClients->next) { if (pClients->client == client) { /* client's presence on the list indicates desire for * events. If the client doesn't want events, remove it * from the list. If the client does want events, do * nothing, since it's already got them. */ if (!wantevents) { FreeResource(pClients->delete_id, RT_NONE); } return Success; } } /* if we get here, this client does not currently have * events selected on the alarm */ if (!wantevents) /* client doesn't want events, and we just discovered that it * doesn't have them, so there's nothing to do. */ return Success; /* add new client to pAlarm->pEventClients */ pClients = malloc(sizeof(SyncAlarmClientList)); if (!pClients) return BadAlloc; /* register it as a resource so it will be cleaned up * if the client dies */ pClients->delete_id = FakeClientID(client->index); /* link it into list after we know all the allocations succeed */ pClients->next = pAlarm->pEventClients; pAlarm->pEventClients = pClients; pClients->client = client; if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm)) return BadAlloc; return Success; } /* * ** SyncChangeAlarmAttributes ** This is used by CreateAlarm and ChangeAlarm */ static int SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask, CARD32 *values) { int status; XSyncCounter counter; Mask origmask = mask; counter = pAlarm->trigger.pSync ? pAlarm->trigger.pSync->id : None; while (mask) { int index2 = lowbit(mask); mask &= ~index2; switch (index2) { case XSyncCACounter: mask &= ~XSyncCACounter; /* sanity check in SyncInitTrigger */ counter = *values++; break; case XSyncCAValueType: mask &= ~XSyncCAValueType; /* sanity check in SyncInitTrigger */ pAlarm->trigger.value_type = *values++; break; case XSyncCAValue: mask &= ~XSyncCAValue; XSyncIntsToValue(&pAlarm->trigger.wait_value, values[1], values[0]); values += 2; break; case XSyncCATestType: mask &= ~XSyncCATestType; /* sanity check in SyncInitTrigger */ pAlarm->trigger.test_type = *values++; break; case XSyncCADelta: mask &= ~XSyncCADelta; XSyncIntsToValue(&pAlarm->delta, values[1], values[0]); values += 2; break; case XSyncCAEvents: mask &= ~XSyncCAEvents; if ((*values != xTrue) && (*values != xFalse)) { client->errorValue = *values; return BadValue; } status = SyncEventSelectForAlarm(pAlarm, client, (Bool) (*values++)); if (status != Success) return status; break; default: client->errorValue = mask; return BadValue; } } /* "If the test-type is PositiveComparison or PositiveTransition * and delta is less than zero, or if the test-type is * NegativeComparison or NegativeTransition and delta is * greater than zero, a Match error is generated." */ if (origmask & (XSyncCADelta | XSyncCATestType)) { CARD64 zero; XSyncIntToValue(&zero, 0); if ((((pAlarm->trigger.test_type == XSyncPositiveComparison) || (pAlarm->trigger.test_type == XSyncPositiveTransition)) && XSyncValueLessThan(pAlarm->delta, zero)) || (((pAlarm->trigger.test_type == XSyncNegativeComparison) || (pAlarm->trigger.test_type == XSyncNegativeTransition)) && XSyncValueGreaterThan(pAlarm->delta, zero)) ) { return BadMatch; } } /* postpone this until now, when we're sure nothing else can go wrong */ if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, RTCounter, origmask & XSyncCAAllTrigger)) != Success) return status; /* XXX spec does not really say to do this - needs clarification */ pAlarm->state = XSyncAlarmActive; return Success; } static SyncObject * SyncCreate(ClientPtr client, XID id, unsigned char type) { SyncObject *pSync; switch (type) { case SYNC_COUNTER: pSync = malloc(sizeof(SyncCounter)); break; case SYNC_FENCE: pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence, PRIVATE_SYNC_FENCE); break; default: return NULL; } if (!pSync) return NULL; pSync->client = client; pSync->id = id; pSync->pTriglist = NULL; pSync->beingDestroyed = FALSE; pSync->type = type; return pSync; } int SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL initially_triggered) { #if HAVE_XSHMFENCE SyncFence *pFence; int status; pFence = (SyncFence *) SyncCreate(client, id, SYNC_FENCE); if (!pFence) return BadAlloc; status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered); if (status != Success) { dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE); return status; } if (!AddResource(id, RTFence, (void *) pFence)) return BadAlloc; return Success; #else return BadImplementation; #endif } int SyncFDFromFence(ClientPtr client, DrawablePtr pDraw, SyncFence *pFence) { #if HAVE_XSHMFENCE return miSyncFDFromFence(pDraw, pFence); #else return BadImplementation; #endif } static SyncCounter * SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue) { SyncCounter *pCounter; if (!(pCounter = (SyncCounter *) SyncCreate(client, id, SYNC_COUNTER))) return NULL; pCounter->value = initialvalue; pCounter->pSysCounterInfo = NULL; if (!AddResource(id, RTCounter, (void *) pCounter)) return NULL; return pCounter; } static int FreeCounter(void *, XID); /* * ***** System Counter utilities */ SyncCounter* SyncCreateSystemCounter(const char *name, CARD64 initial, CARD64 resolution, SyncCounterType counterType, SyncSystemCounterQueryValue QueryValue, SyncSystemCounterBracketValues BracketValues ) { SyncCounter *pCounter; /* this function may be called before SYNC has been initialized, so we * have to make sure RTCounter is created. */ if (RTCounter == 0) { RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); if (RTCounter == 0) { return NULL; } xorg_list_init(&SysCounterList); } pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); if (pCounter) { SysCounterInfo *psci; psci = malloc(sizeof(SysCounterInfo)); if (!psci) { FreeResource(pCounter->sync.id, RT_NONE); return pCounter; } pCounter->pSysCounterInfo = psci; 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); xorg_list_add(&psci->entry, &SysCounterList); } return pCounter; } void SyncDestroySystemCounter(void *pSysCounter) { SyncCounter *pCounter = (SyncCounter *) pSysCounter; FreeResource(pCounter->sync.id, RT_NONE); } static void SyncComputeBracketValues(SyncCounter * pCounter) { SyncTriggerList *pCur; SyncTrigger *pTrigger; SysCounterInfo *psci; CARD64 *pnewgtval = NULL; CARD64 *pnewltval = NULL; SyncCounterType ct; if (!pCounter) return; psci = pCounter->pSysCounterInfo; ct = pCounter->pSysCounterInfo->counterType; if (ct == XSyncCounterNeverChanges) return; XSyncMaxValue(&psci->bracket_greater); XSyncMinValue(&psci->bracket_less); for (pCur = pCounter->sync.pTriglist; pCur; pCur = pCur->next) { pTrigger = pCur->pTrigger; if (pTrigger->test_type == XSyncPositiveComparison && ct != XSyncCounterNeverIncreases) { if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) && XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } else if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) && XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) { psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } } else if (pTrigger->test_type == XSyncNegativeComparison && ct != XSyncCounterNeverDecreases) { if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) && XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) { psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } else if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) && XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } } else if (pTrigger->test_type == XSyncNegativeTransition && ct != XSyncCounterNeverIncreases) { if (XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value) && XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) { /* * If the value is exactly equal to our threshold, we want one * more event in the negative direction to ensure we pick up * when the value is less than this threshold. */ psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } else if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) && XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } } else if (pTrigger->test_type == XSyncPositiveTransition && ct != XSyncCounterNeverDecreases) { if (XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value) && XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { /* * If the value is exactly equal to our threshold, we * want one more event in the positive direction to * ensure we pick up when the value *exceeds* this * threshold. */ psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; } else if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) && XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) { psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; } } } /* end for each trigger */ (*psci->BracketValues) ((void *) pCounter, pnewltval, pnewgtval); } /* * ***** Resource delete functions */ /* ARGSUSED */ static int FreeAlarm(void *addr, XID id) { SyncAlarm *pAlarm = (SyncAlarm *) addr; pAlarm->state = XSyncAlarmDestroyed; SyncSendAlarmNotifyEvents(pAlarm); /* delete event selections */ while (pAlarm->pEventClients) FreeResource(pAlarm->pEventClients->delete_id, RT_NONE); SyncDeleteTriggerFromSyncObject(&pAlarm->trigger); free(pAlarm); return Success; } /* * ** Cleanup after the destruction of a Counter */ /* ARGSUSED */ static int FreeCounter(void *env, XID id) { SyncCounter *pCounter = (SyncCounter *) env; SyncTriggerList *ptl, *pnext; pCounter->sync.beingDestroyed = TRUE; /* tell all the counter's triggers that the counter has been destroyed */ for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); pnext = ptl->next; free(ptl); /* destroy the trigger list as we go */ } if (IsSystemCounter(pCounter)) { xorg_list_del(&pCounter->pSysCounterInfo->entry); free(pCounter->pSysCounterInfo->name); free(pCounter->pSysCounterInfo->private); free(pCounter->pSysCounterInfo); } free(pCounter); return Success; } /* * ** Cleanup after Await */ /* ARGSUSED */ static int FreeAwait(void *addr, XID id) { SyncAwaitUnion *pAwaitUnion = (SyncAwaitUnion *) addr; SyncAwait *pAwait; int numwaits; pAwait = &(pAwaitUnion + 1)->await; /* first await on list */ /* remove triggers from counters */ for (numwaits = pAwaitUnion->header.num_waitconditions; numwaits; numwaits--, pAwait++) { /* If the counter is being destroyed, FreeCounter will delete * the trigger list itself, so don't do it here. */ SyncObject *pSync = pAwait->trigger.pSync; if (pSync && !pSync->beingDestroyed) SyncDeleteTriggerFromSyncObject(&pAwait->trigger); } free(pAwaitUnion); return Success; } /* loosely based on dix/events.c/OtherClientGone */ static int FreeAlarmClient(void *value, XID id) { SyncAlarm *pAlarm = (SyncAlarm *) value; SyncAlarmClientList *pCur, *pPrev; for (pPrev = NULL, pCur = pAlarm->pEventClients; pCur; pPrev = pCur, pCur = pCur->next) { if (pCur->delete_id == id) { if (pPrev) pPrev->next = pCur->next; else pAlarm->pEventClients = pCur->next; free(pCur); return Success; } } FatalError("alarm client not on event list"); /*NOTREACHED*/} /* * ***** Proc functions */ /* * ** Initialize the extension */ static int ProcSyncInitialize(ClientPtr client) { xSyncInitializeReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_SYNC_MAJOR_VERSION, .minorVersion = SERVER_SYNC_MINOR_VERSION, }; REQUEST_SIZE_MATCH(xSyncInitializeReq); if (client->swapped) { swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(rep), &rep); return Success; } /* * ** Get list of system counters available through the extension */ static int ProcSyncListSystemCounters(ClientPtr client) { xSyncListSystemCountersReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .nCounters = 0, }; SysCounterInfo *psci; int len = 0; xSyncSystemCounter *list = NULL, *walklist = NULL; REQUEST_SIZE_MATCH(xSyncListSystemCountersReq); xorg_list_for_each_entry(psci, &SysCounterList, entry) { /* pad to 4 byte boundary */ len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name)); ++rep.nCounters; } if (len) { walklist = list = malloc(len); if (!list) return BadAlloc; } rep.length = bytes_to_int32(len); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.nCounters); } xorg_list_for_each_entry(psci, &SysCounterList, entry) { int namelen; char *pname_in_reply; walklist->counter = psci->pCounter->sync.id; walklist->resolution_hi = XSyncValueHigh32(psci->resolution); walklist->resolution_lo = XSyncValueLow32(psci->resolution); namelen = strlen(psci->name); walklist->name_length = namelen; if (client->swapped) { swapl(&walklist->counter); swapl(&walklist->resolution_hi); swapl(&walklist->resolution_lo); swaps(&walklist->name_length); } pname_in_reply = ((char *) walklist) + sz_xSyncSystemCounter; strncpy(pname_in_reply, psci->name, namelen); walklist = (xSyncSystemCounter *) (((char *) walklist) + pad_to_int32(sz_xSyncSystemCounter + namelen)); } WriteToClient(client, sizeof(rep), &rep); if (len) { WriteToClient(client, len, list); free(list); } return Success; } /* * ** Set client Priority */ static int ProcSyncSetPriority(ClientPtr client) { REQUEST(xSyncSetPriorityReq); ClientPtr priorityclient; int rc; REQUEST_SIZE_MATCH(xSyncSetPriorityReq); if (stuff->id == None) priorityclient = client; else { rc = dixLookupClient(&priorityclient, stuff->id, client, DixSetAttrAccess); if (rc != Success) return rc; } if (priorityclient->priority != stuff->priority) { priorityclient->priority = stuff->priority; /* The following will force the server back into WaitForSomething * so that the change in this client's priority is immediately * reflected. */ isItTimeToYield = TRUE; dispatchException |= DE_PRIORITYCHANGE; } return Success; } /* * ** Get client Priority */ static int ProcSyncGetPriority(ClientPtr client) { REQUEST(xSyncGetPriorityReq); xSyncGetPriorityReply rep; ClientPtr priorityclient; int rc; REQUEST_SIZE_MATCH(xSyncGetPriorityReq); if (stuff->id == None) priorityclient = client; else { rc = dixLookupClient(&priorityclient, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; } 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), &rep); return Success; } /* * ** Create a new counter */ static int ProcSyncCreateCounter(ClientPtr client) { REQUEST(xSyncCreateCounterReq); CARD64 initial; REQUEST_SIZE_MATCH(xSyncCreateCounterReq); LEGAL_NEW_RESOURCE(stuff->cid, client); XSyncIntsToValue(&initial, stuff->initial_value_lo, stuff->initial_value_hi); if (!SyncCreateCounter(client, stuff->cid, initial)) return BadAlloc; return Success; } /* * ** Set Counter value */ static int ProcSyncSetCounter(ClientPtr client) { REQUEST(xSyncSetCounterReq); SyncCounter *pCounter; CARD64 newvalue; int rc; REQUEST_SIZE_MATCH(xSyncSetCounterReq); rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter, client, DixWriteAccess); if (rc != Success) return rc; if (IsSystemCounter(pCounter)) { client->errorValue = stuff->cid; return BadAccess; } XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi); SyncChangeCounter(pCounter, newvalue); return Success; } /* * ** Change Counter value */ static int ProcSyncChangeCounter(ClientPtr client) { REQUEST(xSyncChangeCounterReq); SyncCounter *pCounter; CARD64 newvalue; Bool overflow; int rc; REQUEST_SIZE_MATCH(xSyncChangeCounterReq); rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter, client, DixWriteAccess); if (rc != Success) return rc; if (IsSystemCounter(pCounter)) { client->errorValue = stuff->cid; return BadAccess; } XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi); XSyncValueAdd(&newvalue, pCounter->value, newvalue, &overflow); if (overflow) { /* XXX 64 bit value can't fit in 32 bits; do the best we can */ client->errorValue = stuff->value_hi; return BadValue; } SyncChangeCounter(pCounter, newvalue); return Success; } /* * ** Destroy a counter */ static int ProcSyncDestroyCounter(ClientPtr client) { REQUEST(xSyncDestroyCounterReq); SyncCounter *pCounter; int rc; REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); rc = dixLookupResourceByType((void **) &pCounter, stuff->counter, RTCounter, client, DixDestroyAccess); if (rc != Success) return rc; if (IsSystemCounter(pCounter)) { client->errorValue = stuff->counter; return BadAccess; } FreeResource(pCounter->sync.id, RT_NONE); return Success; } static SyncAwaitUnion * SyncAwaitPrologue(ClientPtr client, int items) { SyncAwaitUnion *pAwaitUnion; /* all the memory for the entire await list is allocated * here in one chunk */ pAwaitUnion = malloc((items + 1) * sizeof(SyncAwaitUnion)); if (!pAwaitUnion) return NULL; /* first item is the header, remainder are real wait conditions */ pAwaitUnion->header.delete_id = FakeClientID(client->index); pAwaitUnion->header.client = client; pAwaitUnion->header.num_waitconditions = 0; if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion)) return NULL; return pAwaitUnion; } static void SyncAwaitEpilogue(ClientPtr client, int items, SyncAwaitUnion * pAwaitUnion) { SyncAwait *pAwait; int i; IgnoreClient(client); /* see if any of the triggers are already true */ pAwait = &(pAwaitUnion + 1)->await; /* skip over header */ for (i = 0; i < items; i++, pAwait++) { CARD64 value; /* don't have to worry about NULL counters because the request * errors before we get here out if they occur */ switch (pAwait->trigger.pSync->type) { case SYNC_COUNTER: value = ((SyncCounter *) pAwait->trigger.pSync)->value; break; default: XSyncIntToValue(&value, 0); } if ((*pAwait->trigger.CheckTrigger) (&pAwait->trigger, value)) { (*pAwait->trigger.TriggerFired) (&pAwait->trigger); break; /* once is enough */ } } } /* * ** Await */ static int ProcSyncAwait(ClientPtr client) { REQUEST(xSyncAwaitReq); int len, items; int i; xSyncWaitCondition *pProtocolWaitConds; SyncAwaitUnion *pAwaitUnion; SyncAwait *pAwait; int status; REQUEST_AT_LEAST_SIZE(xSyncAwaitReq); len = client->req_len << 2; len -= sz_xSyncAwaitReq; items = len / sz_xSyncWaitCondition; if (items * sz_xSyncWaitCondition != len) { return BadLength; } if (items == 0) { client->errorValue = items; /* XXX protocol change */ return BadValue; } if (!(pAwaitUnion = SyncAwaitPrologue(client, items))) return BadAlloc; /* don't need to do any more memory allocation for this request! */ pProtocolWaitConds = (xSyncWaitCondition *) &stuff[1]; pAwait = &(pAwaitUnion + 1)->await; /* skip over header */ for (i = 0; i < items; i++, pProtocolWaitConds++, pAwait++) { if (pProtocolWaitConds->counter == None) { /* XXX protocol change */ /* this should take care of removing any triggers created by * this request that have already been registered on sync objects */ FreeResource(pAwaitUnion->header.delete_id, RT_NONE); client->errorValue = pProtocolWaitConds->counter; return SyncErrorBase + XSyncBadCounter; } /* sanity checks are in SyncInitTrigger */ pAwait->trigger.pSync = NULL; pAwait->trigger.value_type = pProtocolWaitConds->value_type; XSyncIntsToValue(&pAwait->trigger.wait_value, pProtocolWaitConds->wait_value_lo, pProtocolWaitConds->wait_value_hi); pAwait->trigger.test_type = pProtocolWaitConds->test_type; status = SyncInitTrigger(client, &pAwait->trigger, pProtocolWaitConds->counter, RTCounter, XSyncCAAllTrigger); if (status != Success) { /* this should take care of removing any triggers created by * this request that have already been registered on sync objects */ FreeResource(pAwaitUnion->header.delete_id, RT_NONE); return status; } /* this is not a mistake -- same function works for both cases */ pAwait->trigger.TriggerFired = SyncAwaitTriggerFired; pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired; XSyncIntsToValue(&pAwait->event_threshold, pProtocolWaitConds->event_threshold_lo, pProtocolWaitConds->event_threshold_hi); pAwait->pHeader = &pAwaitUnion->header; pAwaitUnion->header.num_waitconditions++; } SyncAwaitEpilogue(client, items, pAwaitUnion); return Success; } /* * ** Query a counter */ static int ProcSyncQueryCounter(ClientPtr client) { REQUEST(xSyncQueryCounterReq); xSyncQueryCounterReply rep; SyncCounter *pCounter; int rc; REQUEST_SIZE_MATCH(xSyncQueryCounterReq); rc = dixLookupResourceByType((void **) &pCounter, stuff->counter, RTCounter, client, DixReadAccess); if (rc != Success) return rc; /* if system counter, ask it what the current value is */ if (IsSystemCounter(pCounter)) { (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &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), &rep); return Success; } /* * ** Create Alarm */ static int ProcSyncCreateAlarm(ClientPtr client) { REQUEST(xSyncCreateAlarmReq); SyncAlarm *pAlarm; int status; unsigned long len, vmask; SyncTrigger *pTrigger; REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq); LEGAL_NEW_RESOURCE(stuff->id, client); vmask = stuff->valueMask; len = client->req_len - bytes_to_int32(sizeof(xSyncCreateAlarmReq)); /* the "extra" call to Ones accounts for the presence of 64 bit values */ if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue | XSyncCADelta)))) return BadLength; if (!(pAlarm = malloc(sizeof(SyncAlarm)))) { return BadAlloc; } /* set up defaults */ pTrigger = &pAlarm->trigger; pTrigger->pSync = NULL; pTrigger->value_type = XSyncAbsolute; XSyncIntToValue(&pTrigger->wait_value, 0L); pTrigger->test_type = XSyncPositiveComparison; pTrigger->TriggerFired = SyncAlarmTriggerFired; pTrigger->CounterDestroyed = SyncAlarmCounterDestroyed; status = SyncInitTrigger(client, pTrigger, None, RTCounter, XSyncCAAllTrigger); if (status != Success) { free(pAlarm); return status; } pAlarm->client = client; pAlarm->alarm_id = stuff->id; XSyncIntToValue(&pAlarm->delta, 1L); pAlarm->events = TRUE; pAlarm->state = XSyncAlarmInactive; pAlarm->pEventClients = NULL; status = SyncChangeAlarmAttributes(client, pAlarm, vmask, (CARD32 *) &stuff[1]); if (status != Success) { free(pAlarm); return status; } if (!AddResource(stuff->id, RTAlarm, pAlarm)) return BadAlloc; /* see if alarm already triggered. NULL counter will not trigger * in CreateAlarm and sets alarm state to Inactive. */ if (!pTrigger->pSync) { pAlarm->state = XSyncAlarmInactive; /* XXX protocol change */ } else { SyncCounter *pCounter; if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM)) { FreeResource(stuff->id, RT_NONE); return BadAlloc; } pCounter = (SyncCounter *) pTrigger->pSync; if ((*pTrigger->CheckTrigger) (pTrigger, pCounter->value)) (*pTrigger->TriggerFired) (pTrigger); } return Success; } /* * ** Change Alarm */ static int ProcSyncChangeAlarm(ClientPtr client) { REQUEST(xSyncChangeAlarmReq); SyncAlarm *pAlarm; SyncCounter *pCounter = NULL; long vmask; int len, status; REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); status = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm, client, DixWriteAccess); if (status != Success) return status; vmask = stuff->valueMask; len = client->req_len - bytes_to_int32(sizeof(xSyncChangeAlarmReq)); /* the "extra" call to Ones accounts for the presence of 64 bit values */ if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue | XSyncCADelta)))) return BadLength; if ((status = SyncChangeAlarmAttributes(client, pAlarm, vmask, (CARD32 *) &stuff[1])) != Success) return status; if (SyncCheckWarnIsCounter(pAlarm->trigger.pSync, WARN_INVALID_COUNTER_ALARM)) pCounter = (SyncCounter *) pAlarm->trigger.pSync; /* see if alarm already triggered. NULL counter WILL trigger * in ChangeAlarm. */ if (!pCounter || (*pAlarm->trigger.CheckTrigger) (&pAlarm->trigger, pCounter->value)) { (*pAlarm->trigger.TriggerFired) (&pAlarm->trigger); } return Success; } static int ProcSyncQueryAlarm(ClientPtr client) { REQUEST(xSyncQueryAlarmReq); SyncAlarm *pAlarm; xSyncQueryAlarmReply rep; SyncTrigger *pTrigger; int rc; REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm, client, DixReadAccess); if (rc != Success) return rc; pTrigger = &pAlarm->trigger; rep = (xSyncQueryAlarmReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)), .counter = (pTrigger->pSync) ? pTrigger->pSync->id : None, #if 0 /* XXX unclear what to do, depends on whether relative value-types * are "consumed" immediately and are considered absolute from then * on. */ .value_type = pTrigger->value_type, .wait_value_hi = XSyncValueHigh32(pTrigger->wait_value), .wait_value_lo = XSyncValueLow32(pTrigger->wait_value), #else .value_type = XSyncAbsolute, .wait_value_hi = XSyncValueHigh32(pTrigger->test_value), .wait_value_lo = XSyncValueLow32(pTrigger->test_value), #endif .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); swapl(&rep.length); swapl(&rep.counter); swapl(&rep.wait_value_hi); swapl(&rep.wait_value_lo); swapl(&rep.test_type); swapl(&rep.delta_hi); swapl(&rep.delta_lo); } WriteToClient(client, sizeof(xSyncQueryAlarmReply), &rep); return Success; } static int ProcSyncDestroyAlarm(ClientPtr client) { SyncAlarm *pAlarm; int rc; REQUEST(xSyncDestroyAlarmReq); REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->alarm, RT_NONE); return Success; } static int ProcSyncCreateFence(ClientPtr client) { REQUEST(xSyncCreateFenceReq); DrawablePtr pDraw; SyncFence *pFence; int rc; REQUEST_SIZE_MATCH(xSyncCreateFenceReq); rc = dixLookupDrawable(&pDraw, stuff->d, client, M_ANY, DixGetAttrAccess); if (rc != Success) return rc; LEGAL_NEW_RESOURCE(stuff->fid, client); if (!(pFence = (SyncFence *) SyncCreate(client, stuff->fid, SYNC_FENCE))) return BadAlloc; miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered); if (!AddResource(stuff->fid, RTFence, (void *) pFence)) return BadAlloc; return client->noClientException; } static int FreeFence(void *obj, XID id) { SyncFence *pFence = (SyncFence *) obj; miSyncDestroyFence(pFence); return Success; } int SyncVerifyFence(SyncFence ** ppSyncFence, XID fid, ClientPtr client, Mask mode) { int rc = dixLookupResourceByType((void **) ppSyncFence, fid, RTFence, client, mode); if (rc != Success) client->errorValue = fid; return rc; } static int ProcSyncTriggerFence(ClientPtr client) { REQUEST(xSyncTriggerFenceReq); SyncFence *pFence; int rc; REQUEST_SIZE_MATCH(xSyncTriggerFenceReq); rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixWriteAccess); if (rc != Success) return rc; miSyncTriggerFence(pFence); return client->noClientException; } static int ProcSyncResetFence(ClientPtr client) { REQUEST(xSyncResetFenceReq); SyncFence *pFence; int rc; REQUEST_SIZE_MATCH(xSyncResetFenceReq); rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixWriteAccess); if (rc != Success) return rc; if (pFence->funcs.CheckTriggered(pFence) != TRUE) return BadMatch; pFence->funcs.Reset(pFence); return client->noClientException; } static int ProcSyncDestroyFence(ClientPtr client) { REQUEST(xSyncDestroyFenceReq); SyncFence *pFence; int rc; REQUEST_SIZE_MATCH(xSyncDestroyFenceReq); rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->fid, RT_NONE); return client->noClientException; } static int ProcSyncQueryFence(ClientPtr client) { REQUEST(xSyncQueryFenceReq); xSyncQueryFenceReply rep; SyncFence *pFence; int rc; REQUEST_SIZE_MATCH(xSyncQueryFenceReq); rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixReadAccess); if (rc != Success) return rc; rep = (xSyncQueryFenceReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .triggered = pFence->funcs.CheckTriggered(pFence) }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } WriteToClient(client, sizeof(xSyncQueryFenceReply), &rep); return client->noClientException; } static int ProcSyncAwaitFence(ClientPtr client) { REQUEST(xSyncAwaitFenceReq); SyncAwaitUnion *pAwaitUnion; SyncAwait *pAwait; /* Use CARD32 rather than XSyncFence because XIDs are hard-coded to * CARD32 in protocol definitions */ CARD32 *pProtocolFences; int status; int len; int items; int i; REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq); len = client->req_len << 2; len -= sz_xSyncAwaitFenceReq; items = len / sizeof(CARD32); if (items * sizeof(CARD32) != len) { return BadLength; } if (items == 0) { client->errorValue = items; return BadValue; } if (!(pAwaitUnion = SyncAwaitPrologue(client, items))) return BadAlloc; /* don't need to do any more memory allocation for this request! */ pProtocolFences = (CARD32 *) &stuff[1]; pAwait = &(pAwaitUnion + 1)->await; /* skip over header */ for (i = 0; i < items; i++, pProtocolFences++, pAwait++) { if (*pProtocolFences == None) { /* this should take care of removing any triggers created by * this request that have already been registered on sync objects */ FreeResource(pAwaitUnion->header.delete_id, RT_NONE); client->errorValue = *pProtocolFences; return SyncErrorBase + XSyncBadFence; } pAwait->trigger.pSync = NULL; /* Provide acceptable values for these unused fields to * satisfy SyncInitTrigger's validation logic */ pAwait->trigger.value_type = XSyncAbsolute; XSyncIntToValue(&pAwait->trigger.wait_value, 0); pAwait->trigger.test_type = 0; status = SyncInitTrigger(client, &pAwait->trigger, *pProtocolFences, RTFence, XSyncCAAllTrigger); if (status != Success) { /* this should take care of removing any triggers created by * this request that have already been registered on sync objects */ FreeResource(pAwaitUnion->header.delete_id, RT_NONE); return status; } /* this is not a mistake -- same function works for both cases */ pAwait->trigger.TriggerFired = SyncAwaitTriggerFired; pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired; /* event_threshold is unused for fence syncs */ XSyncIntToValue(&pAwait->event_threshold, 0); pAwait->pHeader = &pAwaitUnion->header; pAwaitUnion->header.num_waitconditions++; } SyncAwaitEpilogue(client, items, pAwaitUnion); return client->noClientException; } /* * ** Given an extension request, call the appropriate request procedure */ static int ProcSyncDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_SyncInitialize: return ProcSyncInitialize(client); case X_SyncListSystemCounters: return ProcSyncListSystemCounters(client); case X_SyncCreateCounter: return ProcSyncCreateCounter(client); case X_SyncSetCounter: return ProcSyncSetCounter(client); case X_SyncChangeCounter: return ProcSyncChangeCounter(client); case X_SyncQueryCounter: return ProcSyncQueryCounter(client); case X_SyncDestroyCounter: return ProcSyncDestroyCounter(client); case X_SyncAwait: return ProcSyncAwait(client); case X_SyncCreateAlarm: return ProcSyncCreateAlarm(client); case X_SyncChangeAlarm: return ProcSyncChangeAlarm(client); case X_SyncQueryAlarm: return ProcSyncQueryAlarm(client); case X_SyncDestroyAlarm: return ProcSyncDestroyAlarm(client); case X_SyncSetPriority: return ProcSyncSetPriority(client); case X_SyncGetPriority: return ProcSyncGetPriority(client); case X_SyncCreateFence: return ProcSyncCreateFence(client); case X_SyncTriggerFence: return ProcSyncTriggerFence(client); case X_SyncResetFence: return ProcSyncResetFence(client); case X_SyncDestroyFence: return ProcSyncDestroyFence(client); case X_SyncQueryFence: return ProcSyncQueryFence(client); case X_SyncAwaitFence: return ProcSyncAwaitFence(client); default: return BadRequest; } } /* * Boring Swapping stuff ... */ static int SProcSyncInitialize(ClientPtr client) { REQUEST(xSyncInitializeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncInitializeReq); return ProcSyncInitialize(client); } static int SProcSyncListSystemCounters(ClientPtr client) { REQUEST(xSyncListSystemCountersReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncListSystemCountersReq); return ProcSyncListSystemCounters(client); } static int SProcSyncCreateCounter(ClientPtr client) { REQUEST(xSyncCreateCounterReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncCreateCounterReq); swapl(&stuff->cid); swapl(&stuff->initial_value_lo); swapl(&stuff->initial_value_hi); return ProcSyncCreateCounter(client); } static int SProcSyncSetCounter(ClientPtr client) { REQUEST(xSyncSetCounterReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncSetCounterReq); swapl(&stuff->cid); swapl(&stuff->value_lo); swapl(&stuff->value_hi); return ProcSyncSetCounter(client); } static int SProcSyncChangeCounter(ClientPtr client) { REQUEST(xSyncChangeCounterReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncChangeCounterReq); swapl(&stuff->cid); swapl(&stuff->value_lo); swapl(&stuff->value_hi); return ProcSyncChangeCounter(client); } static int SProcSyncQueryCounter(ClientPtr client) { REQUEST(xSyncQueryCounterReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncQueryCounterReq); swapl(&stuff->counter); return ProcSyncQueryCounter(client); } static int SProcSyncDestroyCounter(ClientPtr client) { REQUEST(xSyncDestroyCounterReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); swapl(&stuff->counter); return ProcSyncDestroyCounter(client); } static int SProcSyncAwait(ClientPtr client) { REQUEST(xSyncAwaitReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncAwaitReq); SwapRestL(stuff); return ProcSyncAwait(client); } static int SProcSyncCreateAlarm(ClientPtr client) { REQUEST(xSyncCreateAlarmReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq); swapl(&stuff->id); swapl(&stuff->valueMask); SwapRestL(stuff); return ProcSyncCreateAlarm(client); } static int SProcSyncChangeAlarm(ClientPtr client) { REQUEST(xSyncChangeAlarmReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); swapl(&stuff->alarm); swapl(&stuff->valueMask); SwapRestL(stuff); return ProcSyncChangeAlarm(client); } static int SProcSyncQueryAlarm(ClientPtr client) { REQUEST(xSyncQueryAlarmReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); swapl(&stuff->alarm); return ProcSyncQueryAlarm(client); } static int SProcSyncDestroyAlarm(ClientPtr client) { REQUEST(xSyncDestroyAlarmReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); swapl(&stuff->alarm); return ProcSyncDestroyAlarm(client); } static int SProcSyncSetPriority(ClientPtr client) { REQUEST(xSyncSetPriorityReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncSetPriorityReq); swapl(&stuff->id); swapl(&stuff->priority); return ProcSyncSetPriority(client); } static int SProcSyncGetPriority(ClientPtr client) { REQUEST(xSyncGetPriorityReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncGetPriorityReq); swapl(&stuff->id); return ProcSyncGetPriority(client); } static int SProcSyncCreateFence(ClientPtr client) { REQUEST(xSyncCreateFenceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncCreateFenceReq); swapl(&stuff->fid); return ProcSyncCreateFence(client); } static int SProcSyncTriggerFence(ClientPtr client) { REQUEST(xSyncTriggerFenceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncTriggerFenceReq); swapl(&stuff->fid); return ProcSyncTriggerFence(client); } static int SProcSyncResetFence(ClientPtr client) { REQUEST(xSyncResetFenceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncResetFenceReq); swapl(&stuff->fid); return ProcSyncResetFence(client); } static int SProcSyncDestroyFence(ClientPtr client) { REQUEST(xSyncDestroyFenceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncDestroyFenceReq); swapl(&stuff->fid); return ProcSyncDestroyFence(client); } static int SProcSyncQueryFence(ClientPtr client) { REQUEST(xSyncQueryFenceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncQueryFenceReq); swapl(&stuff->fid); return ProcSyncQueryFence(client); } static int SProcSyncAwaitFence(ClientPtr client) { REQUEST(xSyncAwaitFenceReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq); SwapRestL(stuff); return ProcSyncAwaitFence(client); } static int SProcSyncDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_SyncInitialize: return SProcSyncInitialize(client); case X_SyncListSystemCounters: return SProcSyncListSystemCounters(client); case X_SyncCreateCounter: return SProcSyncCreateCounter(client); case X_SyncSetCounter: return SProcSyncSetCounter(client); case X_SyncChangeCounter: return SProcSyncChangeCounter(client); case X_SyncQueryCounter: return SProcSyncQueryCounter(client); case X_SyncDestroyCounter: return SProcSyncDestroyCounter(client); case X_SyncAwait: return SProcSyncAwait(client); case X_SyncCreateAlarm: return SProcSyncCreateAlarm(client); case X_SyncChangeAlarm: return SProcSyncChangeAlarm(client); case X_SyncQueryAlarm: return SProcSyncQueryAlarm(client); case X_SyncDestroyAlarm: return SProcSyncDestroyAlarm(client); case X_SyncSetPriority: return SProcSyncSetPriority(client); case X_SyncGetPriority: return SProcSyncGetPriority(client); case X_SyncCreateFence: return SProcSyncCreateFence(client); case X_SyncTriggerFence: return SProcSyncTriggerFence(client); case X_SyncResetFence: return SProcSyncResetFence(client); case X_SyncDestroyFence: return SProcSyncDestroyFence(client); case X_SyncQueryFence: return SProcSyncQueryFence(client); case X_SyncAwaitFence: return SProcSyncAwaitFence(client); default: return BadRequest; } } /* * Event Swapping */ static void SCounterNotifyEvent(xSyncCounterNotifyEvent * from, xSyncCounterNotifyEvent * to) { to->type = from->type; to->kind = from->kind; cpswaps(from->sequenceNumber, to->sequenceNumber); cpswapl(from->counter, to->counter); cpswapl(from->wait_value_lo, to->wait_value_lo); cpswapl(from->wait_value_hi, to->wait_value_hi); cpswapl(from->counter_value_lo, to->counter_value_lo); cpswapl(from->counter_value_hi, to->counter_value_hi); cpswapl(from->time, to->time); cpswaps(from->count, to->count); to->destroyed = from->destroyed; } static void SAlarmNotifyEvent(xSyncAlarmNotifyEvent * from, xSyncAlarmNotifyEvent * to) { to->type = from->type; to->kind = from->kind; cpswaps(from->sequenceNumber, to->sequenceNumber); cpswapl(from->alarm, to->alarm); cpswapl(from->counter_value_lo, to->counter_value_lo); cpswapl(from->counter_value_hi, to->counter_value_hi); cpswapl(from->alarm_value_lo, to->alarm_value_lo); cpswapl(from->alarm_value_hi, to->alarm_value_hi); cpswapl(from->time, to->time); to->state = from->state; } /* * ** Close everything down. ** This is fairly simple for now. */ /* ARGSUSED */ static void SyncResetProc(ExtensionEntry * extEntry) { RTCounter = 0; } /* * ** Initialise the extension. */ void SyncExtensionInit(void) { ExtensionEntry *extEntry; int s; for (s = 0; s < screenInfo.numScreens; s++) miSyncSetup(screenInfo.screens[s]); if (RTCounter == 0) { RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); xorg_list_init(&SysCounterList); } RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm"); RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait"); RTFence = CreateNewResourceType(FreeFence, "SyncFence"); if (RTAwait) RTAwait |= RC_NEVERRETAIN; RTAlarmClient = CreateNewResourceType(FreeAlarmClient, "SyncAlarmClient"); if (RTAlarmClient) RTAlarmClient |= RC_NEVERRETAIN; if (RTCounter == 0 || RTAwait == 0 || RTAlarm == 0 || RTAlarmClient == 0 || (extEntry = AddExtension(SYNC_NAME, XSyncNumberEvents, XSyncNumberErrors, ProcSyncDispatch, SProcSyncDispatch, SyncResetProc, StandardMinorOpcode)) == NULL) { ErrorF("Sync Extension %d.%d failed to Initialise\n", SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION); return; } SyncEventBase = extEntry->eventBase; SyncErrorBase = extEntry->errorBase; EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent; EventSwapVector[SyncEventBase + XSyncAlarmNotify] = (EventSwapPtr) SAlarmNotifyEvent; SetResourceTypeErrorValue(RTCounter, SyncErrorBase + XSyncBadCounter); SetResourceTypeErrorValue(RTAlarm, SyncErrorBase + XSyncBadAlarm); SetResourceTypeErrorValue(RTFence, SyncErrorBase + XSyncBadFence); /* * Although SERVERTIME is implemented by the OS layer, we initialise it * here because doing it in OsInit() is too early. The resource database * is not initialised when OsInit() is called. This is just about OK * because there is always a servertime counter. */ SyncInitServerTime(); SyncInitIdleTime(); #ifdef DEBUG fprintf(stderr, "Sync Extension %d.%d\n", SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION); #endif } /* * ***** SERVERTIME implementation - should go in its own file in OS directory? */ static void *ServertimeCounter; static XSyncValue Now; static XSyncValue *pnext_time; #define GetTime()\ {\ unsigned long millis = GetTimeInMillis();\ unsigned long maxis = XSyncValueHigh32(Now);\ if (millis < XSyncValueLow32(Now)) maxis++;\ XSyncIntsToValue(&Now, millis, maxis);\ } /* *** Server Block Handler *** code inspired by multibuffer extension (now deprecated) */ /*ARGSUSED*/ static void ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask) { XSyncValue delay; unsigned long timeout; if (pnext_time) { GetTime(); if (XSyncValueGreaterOrEqual(Now, *pnext_time)) { timeout = 0; } else { Bool overflow; XSyncValueSubtract(&delay, *pnext_time, Now, &overflow); (void) overflow; timeout = XSyncValueLow32(delay); } AdjustWaitForDelay(wt, timeout); /* os/utils.c */ } } /* *** Wakeup Handler */ /*ARGSUSED*/ static void ServertimeWakeupHandler(void *env, int rc, void *LastSelectMask) { if (pnext_time) { GetTime(); if (XSyncValueGreaterOrEqual(Now, *pnext_time)) { SyncChangeCounter(ServertimeCounter, Now); } } } static void ServertimeQueryValue(void *pCounter, CARD64 * pValue_return) { GetTime(); *pValue_return = Now; } static void ServertimeBracketValues(void *pCounter, CARD64 * pbracket_less, CARD64 * pbracket_greater) { if (!pnext_time && pbracket_greater) { RegisterBlockAndWakeupHandlers(ServertimeBlockHandler, ServertimeWakeupHandler, NULL); } else if (pnext_time && !pbracket_greater) { RemoveBlockAndWakeupHandlers(ServertimeBlockHandler, ServertimeWakeupHandler, NULL); } pnext_time = pbracket_greater; } static void SyncInitServerTime(void) { CARD64 resolution; XSyncIntsToValue(&Now, GetTimeInMillis(), 0); XSyncIntToValue(&resolution, 4); ServertimeCounter = SyncCreateSystemCounter("SERVERTIME", Now, resolution, XSyncCounterNeverDecreases, ServertimeQueryValue, ServertimeBracketValues); pnext_time = NULL; } /* * IDLETIME implementation */ typedef struct { XSyncValue *value_less; XSyncValue *value_greater; int deviceid; } IdleCounterPriv; static void IdleTimeQueryValue(void *pCounter, CARD64 * pValue_return) { int deviceid; CARD32 idle; if (pCounter) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); deviceid = priv->deviceid; } else deviceid = XIAllDevices; idle = GetTimeInMillis() - LastEventTime(deviceid).milliseconds; XSyncIntsToValue(pValue_return, idle, 0); } static void IdleTimeBlockHandler(void *pCounter, struct timeval **wt, void *LastSelectMask) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); XSyncValue *less = priv->value_less, *greater = priv->value_greater; XSyncValue idle, old_idle; SyncTriggerList *list = counter->sync.pTriglist; SyncTrigger *trig; if (!less && !greater) return; old_idle = counter->value; IdleTimeQueryValue(counter, &idle); counter->value = idle; /* push, so CheckTrigger works */ /** * There's an indefinite amount of time between ProcessInputEvents() * where the idle time is reset and the time we actually get here. idle * may be past the lower bracket if we dawdled with the events, so * check for whether we did reset and bomb out of select immediately. */ if (less && XSyncValueGreaterThan(idle, *less) && LastEventTimeWasReset(priv->deviceid)) { AdjustWaitForDelay(wt, 0); } else 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 * want level or edge trigger. Check the trigger list against the * current idle time, and if any succeed, bomb out of select() * immediately so we can reschedule. */ for (list = counter->sync.pTriglist; list; list = list->next) { trig = list->pTrigger; if (trig->CheckTrigger(trig, old_idle)) { AdjustWaitForDelay(wt, 0); break; } } /* * We've been called exactly on the idle time, but we have a * NegativeTransition trigger which requires a transition from an * idle time greater than this. Schedule a wakeup for the next * millisecond so we won't miss a transition. */ if (XSyncValueEqual(idle, *less)) AdjustWaitForDelay(wt, 1); } 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. * If we've been idle more than it, and someone wants to know about * that level-triggered, schedule an immediate wakeup. */ if (XSyncValueLessThan(idle, *greater)) { XSyncValue value; Bool overflow; XSyncValueSubtract(&value, *greater, idle, &overflow); AdjustWaitForDelay(wt, XSyncValueLow32(value)); } else { for (list = counter->sync.pTriglist; list; list = list->next) { trig = list->pTrigger; if (trig->CheckTrigger(trig, old_idle)) { AdjustWaitForDelay(wt, 0); break; } } } } counter->value = old_idle; /* pop */ } static void IdleTimeCheckBrackets(SyncCounter *counter, XSyncValue idle, XSyncValue *less, XSyncValue *greater) { if ((greater && XSyncValueGreaterOrEqual(idle, *greater)) || (less && XSyncValueLessOrEqual(idle, *less))) { SyncChangeCounter(counter, idle); } else SyncUpdateCounter(counter, idle); } static void IdleTimeWakeupHandler(void *pCounter, int rc, void *LastSelectMask) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); XSyncValue *less = priv->value_less, *greater = priv->value_greater; XSyncValue idle; if (!less && !greater) return; IdleTimeQueryValue(pCounter, &idle); /* There is no guarantee for the WakeupHandler to be called within a specific timeframe. Idletime may go to 0, but by the time we get here, it may be non-zero and alarms for a pos. transition on 0 won't get triggered. https://bugs.freedesktop.org/show_bug.cgi?id=70476 */ if (LastEventTimeWasReset(priv->deviceid)) { LastEventTimeToggleResetFlag(priv->deviceid, FALSE); if (!XSyncValueIsZero(idle)) { XSyncValue zero; XSyncIntsToValue(&zero, 0, 0); IdleTimeCheckBrackets(counter, zero, less, greater); less = priv->value_less; greater = priv->value_greater; } } IdleTimeCheckBrackets(counter, idle, less, greater); } static void IdleTimeBracketValues(void *pCounter, CARD64 * pbracket_less, CARD64 * pbracket_greater) { 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, pCounter); } else if (!registered && (pbracket_less || pbracket_greater)) { /* Reset flag must be zero so we don't force a idle timer reset on the first wakeup */ LastEventTimeToggleResetAll(FALSE); RegisterBlockAndWakeupHandlers(IdleTimeBlockHandler, IdleTimeWakeupHandler, pCounter); } 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; SyncCounter *idle_time_counter; IdleTimeQueryValue(NULL, &idle); XSyncIntToValue(&resolution, 4); idle_time_counter = SyncCreateSystemCounter(name, idle, resolution, XSyncCounterUnrestricted, IdleTimeQueryValue, IdleTimeBracketValues); if (idle_time_counter != NULL) { IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv)); priv->value_less = priv->value_greater = NULL; priv->deviceid = deviceid; idle_time_counter->pSysCounterInfo->private = priv; } return idle_time_counter; } static void SyncInitIdleTime(void) { init_system_idle_counter("IDLETIME", XIAllDevices); } SyncCounter* SyncInitDeviceIdleTime(DeviceIntPtr dev) { char timer_name[64]; sprintf(timer_name, "DEVICEIDLETIME %d", dev->id); return init_system_idle_counter(timer_name, dev->id); } void SyncRemoveDeviceIdleTime(SyncCounter *counter) { /* FreeAllResources() frees all system counters before the devices are shut down, check if there are any left before freeing the device's counter */ if (counter && !xorg_list_is_empty(&SysCounterList)) xorg_list_del(&counter->pSysCounterInfo->entry); } ��������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xselinux.h������������������������������������������������������������������0000664�0001751�0001751�00000007206�12274325511�014000� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR 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 _XSELINUX_H #define _XSELINUX_H /* Extension info */ #define SELINUX_EXTENSION_NAME "SELinux" #define SELINUX_MAJOR_VERSION 1 #define SELINUX_MINOR_VERSION 1 #define SELinuxNumberEvents 0 #define SELinuxNumberErrors 0 /* Extension protocol */ #define X_SELinuxQueryVersion 0 #define X_SELinuxSetDeviceCreateContext 1 #define X_SELinuxGetDeviceCreateContext 2 #define X_SELinuxSetDeviceContext 3 #define X_SELinuxGetDeviceContext 4 #define X_SELinuxSetDrawableCreateContext 5 #define X_SELinuxGetDrawableCreateContext 6 #define X_SELinuxGetDrawableContext 7 #define X_SELinuxSetPropertyCreateContext 8 #define X_SELinuxGetPropertyCreateContext 9 #define X_SELinuxSetPropertyUseContext 10 #define X_SELinuxGetPropertyUseContext 11 #define X_SELinuxGetPropertyContext 12 #define X_SELinuxGetPropertyDataContext 13 #define X_SELinuxListProperties 14 #define X_SELinuxSetSelectionCreateContext 15 #define X_SELinuxGetSelectionCreateContext 16 #define X_SELinuxSetSelectionUseContext 17 #define X_SELinuxGetSelectionUseContext 18 #define X_SELinuxGetSelectionContext 19 #define X_SELinuxGetSelectionDataContext 20 #define X_SELinuxListSelections 21 #define X_SELinuxGetClientContext 22 typedef struct { CARD8 reqType; CARD8 SELinuxReqType; CARD16 length; CARD8 client_major; CARD8 client_minor; } SELinuxQueryVersionReq; typedef struct { CARD8 type; CARD8 pad1; CARD16 sequenceNumber; CARD32 length; CARD16 server_major; CARD16 server_minor; CARD32 pad2; CARD32 pad3; CARD32 pad4; CARD32 pad5; CARD32 pad6; } SELinuxQueryVersionReply; typedef struct { CARD8 reqType; CARD8 SELinuxReqType; CARD16 length; CARD32 context_len; } SELinuxSetCreateContextReq; typedef struct { CARD8 reqType; CARD8 SELinuxReqType; CARD16 length; } SELinuxGetCreateContextReq; typedef struct { CARD8 reqType; CARD8 SELinuxReqType; CARD16 length; CARD32 id; CARD32 context_len; } SELinuxSetContextReq; typedef struct { CARD8 reqType; CARD8 SELinuxReqType; CARD16 length; CARD32 id; } SELinuxGetContextReq; typedef struct { CARD8 reqType; CARD8 SELinuxReqType; CARD16 length; CARD32 window; CARD32 property; } SELinuxGetPropertyContextReq; typedef struct { CARD8 type; CARD8 pad1; CARD16 sequenceNumber; CARD32 length; CARD32 context_len; CARD32 pad2; CARD32 pad3; CARD32 pad4; CARD32 pad5; CARD32 pad6; } SELinuxGetContextReply; typedef struct { CARD8 type; CARD8 pad1; CARD16 sequenceNumber; CARD32 length; CARD32 count; CARD32 pad2; CARD32 pad3; CARD32 pad4; CARD32 pad5; CARD32 pad6; } SELinuxListItemsReply; #endif /* _XSELINUX_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/security.c������������������������������������������������������������������0000664�0001751�0001751�00000105103�12456571574�013774� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "scrnintstr.h" #include "inputstr.h" #include "windowstr.h" #include "propertyst.h" #include "colormapst.h" #include "privates.h" #include "registry.h" #include "xacestr.h" #include "securitysrv.h" #include <X11/extensions/securproto.h> #include "extinit.h" #include "protocol-versions.h" /* Extension stuff */ static int SecurityErrorBase; /* first Security error number */ static int SecurityEventBase; /* first Security event number */ RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */ static RESTYPE RTEventClient; static CallbackListPtr SecurityValidateGroupCallback = NULL; /* Private state record */ static DevPrivateKeyRec stateKeyRec; #define stateKey (&stateKeyRec) /* This is what we store as client security state */ typedef struct { unsigned int haveState :1; unsigned int live :1; unsigned int trustLevel :2; XID authId; } SecurityStateRec; /* Extensions that untrusted clients shouldn't have access to */ static const char *SecurityTrustedExtensions[] = { "XC-MISC", "BIG-REQUESTS", NULL }; /* * Access modes that untrusted clients are allowed on trusted objects. */ static const Mask SecurityResourceMask = DixGetAttrAccess | DixReceiveAccess | DixListPropAccess | DixGetPropAccess | DixListAccess; static const Mask SecurityWindowExtraMask = DixRemoveAccess; static const Mask SecurityRootWindowExtraMask = DixReceiveAccess | DixSendAccess | DixAddAccess | DixRemoveAccess; static const Mask SecurityDeviceMask = DixGetAttrAccess | DixReceiveAccess | DixGetFocusAccess | DixGrabAccess | DixSetAttrAccess | DixUseAccess; static const Mask SecurityServerMask = DixGetAttrAccess | DixGrabAccess; static const Mask SecurityClientMask = DixGetAttrAccess; /* SecurityAudit * * Arguments: * format is the formatting string to be used to interpret the * remaining arguments. * * Returns: nothing. * * Side Effects: * Writes the message to the log file if security logging is on. */ static void _X_ATTRIBUTE_PRINTF(1, 2) SecurityAudit(const char *format, ...) { va_list args; if (auditTrailLevel < SECURITY_AUDIT_LEVEL) return; va_start(args, format); VAuditF(format, args); va_end(args); } /* SecurityAudit */ /* * Performs a Security permission check. */ static int SecurityDoCheck(SecurityStateRec * subj, SecurityStateRec * obj, Mask requested, Mask allowed) { if (!subj->haveState || !obj->haveState) return Success; if (subj->trustLevel == XSecurityClientTrusted) return Success; if (obj->trustLevel != XSecurityClientTrusted) return Success; if ((requested | allowed) == allowed) return Success; return BadAccess; } /* * Labels initial server objects. */ static void SecurityLabelInitial(void) { SecurityStateRec *state; /* Do the serverClient */ state = dixLookupPrivate(&serverClient->devPrivates, stateKey); state->trustLevel = XSecurityClientTrusted; state->haveState = TRUE; state->live = FALSE; } /* * Looks up a request name */ static _X_INLINE const char * SecurityLookupRequestName(ClientPtr client) { return LookupRequestName(client->majorOp, client->minorOp); } /* SecurityDeleteAuthorization * * Arguments: * value is the authorization to delete. * id is its resource ID. * * Returns: Success. * * Side Effects: * Frees everything associated with the authorization. */ static int SecurityDeleteAuthorization(void *value, XID id) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) value; unsigned short name_len, data_len; const char *name; char *data; int status; int i; OtherClientsPtr pEventClient; /* Remove the auth using the os layer auth manager */ status = AuthorizationFromID(pAuth->id, &name_len, &name, &data_len, &data); assert(status); status = RemoveAuthorization(name_len, name, data_len, data); assert(status); (void) status; /* free the auth timer if there is one */ if (pAuth->timer) TimerFree(pAuth->timer); /* send revoke events */ while ((pEventClient = pAuth->eventClients)) { /* send revocation event event */ xSecurityAuthorizationRevokedEvent are = { .type = SecurityEventBase + XSecurityAuthorizationRevoked, .authId = pAuth->id }; WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are); FreeResource(pEventClient->resource, RT_NONE); } /* kill all clients using this auth */ for (i = 1; i < currentMaxClients; i++) if (clients[i]) { SecurityStateRec *state; state = dixLookupPrivate(&clients[i]->devPrivates, stateKey); if (state->haveState && state->authId == pAuth->id) CloseDownClient(clients[i]); } SecurityAudit("revoked authorization ID %d\n", pAuth->id); free(pAuth); return Success; } /* SecurityDeleteAuthorization */ /* resource delete function for RTEventClient */ static int SecurityDeleteAuthorizationEventClient(void *value, XID id) { OtherClientsPtr pEventClient, prev = NULL; SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) value; for (pEventClient = pAuth->eventClients; pEventClient; pEventClient = pEventClient->next) { if (pEventClient->resource == id) { if (prev) prev->next = pEventClient->next; else pAuth->eventClients = pEventClient->next; free(pEventClient); return Success; } prev = pEventClient; } /*NOTREACHED*/ return -1; /* make compiler happy */ } /* SecurityDeleteAuthorizationEventClient */ /* SecurityComputeAuthorizationTimeout * * Arguments: * pAuth is the authorization for which we are computing the timeout * seconds is the number of seconds we want to wait * * Returns: * the number of milliseconds that the auth timer should be set to * * Side Effects: * Sets pAuth->secondsRemaining to any "overflow" amount of time * that didn't fit in 32 bits worth of milliseconds */ static CARD32 SecurityComputeAuthorizationTimeout(SecurityAuthorizationPtr pAuth, unsigned int seconds) { /* maxSecs is the number of full seconds that can be expressed in * 32 bits worth of milliseconds */ CARD32 maxSecs = (CARD32) (~0) / (CARD32) MILLI_PER_SECOND; if (seconds > maxSecs) { /* only come here if we want to wait more than 49 days */ pAuth->secondsRemaining = seconds - maxSecs; return maxSecs * MILLI_PER_SECOND; } else { /* by far the common case */ pAuth->secondsRemaining = 0; return seconds * MILLI_PER_SECOND; } } /* SecurityStartAuthorizationTimer */ /* SecurityAuthorizationExpired * * This function is passed as an argument to TimerSet and gets called from * the timer manager in the os layer when its time is up. * * Arguments: * timer is the timer for this authorization. * time is the current time. * pval is the authorization whose time is up. * * Returns: * A new time delay in milliseconds if the timer should wait some * more, else zero. * * Side Effects: * Frees the authorization resource if the timeout period is really * over, otherwise recomputes pAuth->secondsRemaining. */ static CARD32 SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, void *pval) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) pval; assert(pAuth->timer == timer); if (pAuth->secondsRemaining) { return SecurityComputeAuthorizationTimeout(pAuth, pAuth->secondsRemaining); } else { FreeResource(pAuth->id, RT_NONE); return 0; } } /* SecurityAuthorizationExpired */ /* SecurityStartAuthorizationTimer * * Arguments: * pAuth is the authorization whose timer should be started. * * Returns: nothing. * * Side Effects: * A timer is started, set to expire after the timeout period for * this authorization. When it expires, the function * SecurityAuthorizationExpired will be called. */ static void SecurityStartAuthorizationTimer(SecurityAuthorizationPtr pAuth) { pAuth->timer = TimerSet(pAuth->timer, 0, SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout), SecurityAuthorizationExpired, pAuth); } /* SecurityStartAuthorizationTimer */ /* Proc functions all take a client argument, execute the request in * client->requestBuffer, and return a protocol error status. */ static int ProcSecurityQueryVersion(ClientPtr client) { /* REQUEST(xSecurityQueryVersionReq); */ xSecurityQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_SECURITY_MAJOR_VERSION, .minorVersion = SERVER_SECURITY_MINOR_VERSION }; REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), &rep); return Success; } /* ProcSecurityQueryVersion */ static int SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth, ClientPtr client, Mask mask) { OtherClients *pEventClient; for (pEventClient = pAuth->eventClients; pEventClient; pEventClient = pEventClient->next) { if (SameClient(pEventClient, client)) { if (mask == 0) FreeResource(pEventClient->resource, RT_NONE); else pEventClient->mask = mask; return Success; } } pEventClient = malloc(sizeof(OtherClients)); if (!pEventClient) return BadAlloc; pEventClient->mask = mask; pEventClient->resource = FakeClientID(client->index); pEventClient->next = pAuth->eventClients; if (!AddResource(pEventClient->resource, RTEventClient, (void *) pAuth)) { free(pEventClient); return BadAlloc; } pAuth->eventClients = pEventClient; return Success; } /* SecurityEventSelectForAuthorization */ static int ProcSecurityGenerateAuthorization(ClientPtr client) { REQUEST(xSecurityGenerateAuthorizationReq); int len; /* request length in CARD32s */ Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */ SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */ int err; /* error to return from this function */ XID authId; /* authorization ID assigned by os layer */ xSecurityGenerateAuthorizationReply rep; /* reply struct */ unsigned int trustLevel; /* trust level of new auth */ XID group; /* group of new auth */ CARD32 timeout; /* timeout of new auth */ CARD32 *values; /* list of supplied attributes */ char *protoname; /* auth proto name sent in request */ char *protodata; /* auth proto data sent in request */ unsigned int authdata_len; /* # bytes of generated auth data */ char *pAuthdata; /* generated auth data */ Mask eventMask; /* what events on this auth does client want */ /* check request length */ REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); len = bytes_to_int32(SIZEOF(xSecurityGenerateAuthorizationReq)); len += bytes_to_int32(stuff->nbytesAuthProto); len += bytes_to_int32(stuff->nbytesAuthData); values = ((CARD32 *) stuff) + len; len += Ones(stuff->valueMask); if (client->req_len != len) return BadLength; /* check valuemask */ if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes) { client->errorValue = stuff->valueMask; return BadValue; } /* check timeout */ timeout = 60; if (stuff->valueMask & XSecurityTimeout) { timeout = *values++; } /* check trustLevel */ trustLevel = XSecurityClientUntrusted; if (stuff->valueMask & XSecurityTrustLevel) { trustLevel = *values++; if (trustLevel != XSecurityClientTrusted && trustLevel != XSecurityClientUntrusted) { client->errorValue = trustLevel; return BadValue; } } /* check group */ group = None; if (stuff->valueMask & XSecurityGroup) { group = *values++; if (SecurityValidateGroupCallback) { SecurityValidateGroupInfoRec vgi; vgi.group = group; vgi.valid = FALSE; CallCallbacks(&SecurityValidateGroupCallback, (void *) &vgi); /* if nobody said they recognized it, it's an error */ if (!vgi.valid) { client->errorValue = group; return BadValue; } } } /* check event mask */ eventMask = 0; if (stuff->valueMask & XSecurityEventMask) { eventMask = *values++; if (eventMask & ~XSecurityAllEventMasks) { client->errorValue = eventMask; return BadValue; } } protoname = (char *) &stuff[1]; protodata = protoname + bytes_to_int32(stuff->nbytesAuthProto); /* call os layer to generate the authorization */ authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname, stuff->nbytesAuthData, protodata, &authdata_len, &pAuthdata); if ((XID) ~0L == authId) { err = SecurityErrorBase + XSecurityBadAuthorizationProtocol; goto bailout; } /* now that we've added the auth, remember to remove it if we have to * abort the request for some reason (like allocation failure) */ removeAuth = TRUE; /* associate additional information with this auth ID */ pAuth = malloc(sizeof(SecurityAuthorizationRec)); if (!pAuth) { err = BadAlloc; goto bailout; } /* fill in the auth fields */ pAuth->id = authId; pAuth->timeout = timeout; pAuth->group = group; pAuth->trustLevel = trustLevel; pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */ pAuth->secondsRemaining = 0; pAuth->timer = NULL; pAuth->eventClients = NULL; /* handle event selection */ if (eventMask) { err = SecurityEventSelectForAuthorization(pAuth, client, eventMask); if (err != Success) goto bailout; } if (!AddResource(authId, SecurityAuthorizationResType, pAuth)) { err = BadAlloc; goto bailout; } /* start the timer ticking */ if (pAuth->timeout != 0) SecurityStartAuthorizationTimer(pAuth); /* tell client the auth id and data */ 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); swaps(&rep.sequenceNumber); swapl(&rep.authId); swaps(&rep.dataLength); } WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), &rep); WriteToClient(client, authdata_len, pAuthdata); SecurityAudit ("client %d generated authorization %d trust %d timeout %d group %d events %d\n", client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout, pAuth->group, eventMask); /* the request succeeded; don't call RemoveAuthorization or free pAuth */ return Success; bailout: if (removeAuth) RemoveAuthorization(stuff->nbytesAuthProto, protoname, authdata_len, pAuthdata); free(pAuth); return err; } /* ProcSecurityGenerateAuthorization */ static int ProcSecurityRevokeAuthorization(ClientPtr client) { REQUEST(xSecurityRevokeAuthorizationReq); SecurityAuthorizationPtr pAuth; int rc; REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); rc = dixLookupResourceByType((void **) &pAuth, stuff->authId, SecurityAuthorizationResType, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->authId, RT_NONE); return Success; } /* ProcSecurityRevokeAuthorization */ static int ProcSecurityDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_SecurityQueryVersion: return ProcSecurityQueryVersion(client); case X_SecurityGenerateAuthorization: return ProcSecurityGenerateAuthorization(client); case X_SecurityRevokeAuthorization: return ProcSecurityRevokeAuthorization(client); default: return BadRequest; } } /* ProcSecurityDispatch */ static int SProcSecurityQueryVersion(ClientPtr client) { REQUEST(xSecurityQueryVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); swaps(&stuff->majorVersion); swaps(&stuff->minorVersion); return ProcSecurityQueryVersion(client); } /* SProcSecurityQueryVersion */ static int SProcSecurityGenerateAuthorization(ClientPtr client) { REQUEST(xSecurityGenerateAuthorizationReq); CARD32 *values; unsigned long nvalues; int values_offset; swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); swaps(&stuff->nbytesAuthProto); swaps(&stuff->nbytesAuthData); swapl(&stuff->valueMask); values_offset = bytes_to_int32(stuff->nbytesAuthProto) + bytes_to_int32(stuff->nbytesAuthData); if (values_offset > stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq)) return BadLength; values = (CARD32 *) (&stuff[1]) + values_offset; nvalues = (((CARD32 *) stuff) + stuff->length) - values; SwapLongs(values, nvalues); return ProcSecurityGenerateAuthorization(client); } /* SProcSecurityGenerateAuthorization */ static int SProcSecurityRevokeAuthorization(ClientPtr client) { REQUEST(xSecurityRevokeAuthorizationReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); swapl(&stuff->authId); return ProcSecurityRevokeAuthorization(client); } /* SProcSecurityRevokeAuthorization */ static int SProcSecurityDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_SecurityQueryVersion: return SProcSecurityQueryVersion(client); case X_SecurityGenerateAuthorization: return SProcSecurityGenerateAuthorization(client); case X_SecurityRevokeAuthorization: return SProcSecurityRevokeAuthorization(client); default: return BadRequest; } } /* SProcSecurityDispatch */ static void SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from, xSecurityAuthorizationRevokedEvent * to) { to->type = from->type; to->detail = from->detail; cpswaps(from->sequenceNumber, to->sequenceNumber); cpswapl(from->authId, to->authId); } /* SecurityCheckDeviceAccess * * Arguments: * client is the client attempting to access a device. * dev is the device being accessed. * fromRequest is TRUE if the device access is a direct result of * the client executing some request and FALSE if it is a * result of the server trying to send an event (e.g. KeymapNotify) * to the client. * Returns: * TRUE if the device access should be allowed, else FALSE. * * Side Effects: * An audit message is generated if access is denied. */ static void SecurityDevice(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceDeviceAccessRec *rec = calldata; SecurityStateRec *subj, *obj; Mask requested = rec->access_mode; Mask allowed = SecurityDeviceMask; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); obj = dixLookupPrivate(&serverClient->devPrivates, stateKey); if (rec->dev != inputInfo.keyboard) /* this extension only supports the core keyboard */ allowed = requested; if (SecurityDoCheck(subj, obj, requested, allowed) != Success) { SecurityAudit("Security denied client %d keyboard access on request " "%s\n", rec->client->index, SecurityLookupRequestName(rec->client)); rec->status = BadAccess; } } /* SecurityResource * * This function gets plugged into client->CheckAccess and is called from * SecurityLookupIDByType/Class to determine if the client can access the * resource. * * Arguments: * client is the client doing the resource access. * id is the resource id. * rtype is its type or class. * access_mode represents the intended use of the resource; see * resource.h. * res is a pointer to the resource structure for this resource. * * Returns: * If access is granted, the value of rval that was passed in, else FALSE. * * Side Effects: * Disallowed resource accesses are audited. */ static void SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceResourceAccessRec *rec = calldata; SecurityStateRec *subj, *obj; int cid = CLIENT_ID(rec->id); Mask requested = rec->access_mode; Mask allowed = SecurityResourceMask; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); /* disable background None for untrusted windows */ if ((requested & DixCreateAccess) && (rec->rtype == RT_WINDOW)) if (subj->haveState && subj->trustLevel != XSecurityClientTrusted) ((WindowPtr) rec->res)->forcedBG = TRUE; /* additional permissions for specific resource types */ if (rec->rtype == RT_WINDOW) allowed |= SecurityWindowExtraMask; /* special checks for server-owned resources */ if (cid == 0) { if (rec->rtype & RC_DRAWABLE) /* additional operations allowed on root windows */ allowed |= SecurityRootWindowExtraMask; else if (rec->rtype == RT_COLORMAP) /* allow access to default colormaps */ allowed = requested; else /* allow read access to other server-owned resources */ allowed |= DixReadAccess; } if (clients[cid] != NULL) { obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey); if (SecurityDoCheck(subj, obj, requested, allowed) == Success) return; } SecurityAudit("Security: denied client %d access %x to resource 0x%x " "of client %d on request %s\n", rec->client->index, requested, rec->id, cid, SecurityLookupRequestName(rec->client)); rec->status = BadAccess; /* deny access */ } static void SecurityExtension(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceExtAccessRec *rec = calldata; SecurityStateRec *subj; int i = 0; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); if (subj->haveState && subj->trustLevel == XSecurityClientTrusted) return; while (SecurityTrustedExtensions[i]) if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name)) return; SecurityAudit("Security: denied client %d access to extension " "%s on request %s\n", rec->client->index, rec->ext->name, SecurityLookupRequestName(rec->client)); rec->status = BadAccess; } static void SecurityServer(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceServerAccessRec *rec = calldata; SecurityStateRec *subj, *obj; Mask requested = rec->access_mode; Mask allowed = SecurityServerMask; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); obj = dixLookupPrivate(&serverClient->devPrivates, stateKey); if (SecurityDoCheck(subj, obj, requested, allowed) != Success) { SecurityAudit("Security: denied client %d access to server " "configuration request %s\n", rec->client->index, SecurityLookupRequestName(rec->client)); rec->status = BadAccess; } } static void SecurityClient(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceClientAccessRec *rec = calldata; SecurityStateRec *subj, *obj; Mask requested = rec->access_mode; Mask allowed = SecurityClientMask; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); obj = dixLookupPrivate(&rec->target->devPrivates, stateKey); if (SecurityDoCheck(subj, obj, requested, allowed) != Success) { SecurityAudit("Security: denied client %d access to client %d on " "request %s\n", rec->client->index, rec->target->index, SecurityLookupRequestName(rec->client)); rec->status = BadAccess; } } static void SecurityProperty(CallbackListPtr *pcbl, void *unused, void *calldata) { XacePropertyAccessRec *rec = calldata; SecurityStateRec *subj, *obj; ATOM name = (*rec->ppProp)->propertyName; Mask requested = rec->access_mode; Mask allowed = SecurityResourceMask | DixReadAccess; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey); if (SecurityDoCheck(subj, obj, requested, allowed) != Success) { SecurityAudit("Security: denied client %d access to property %s " "(atom 0x%x) window 0x%x of client %d on request %s\n", rec->client->index, NameForAtom(name), name, rec->pWin->drawable.id, wClient(rec->pWin)->index, SecurityLookupRequestName(rec->client)); rec->status = BadAccess; } } static void SecuritySend(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceSendAccessRec *rec = calldata; SecurityStateRec *subj, *obj; if (rec->client) { int i; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey); if (SecurityDoCheck(subj, obj, DixSendAccess, 0) == Success) return; for (i = 0; i < rec->count; i++) if (rec->events[i].u.u.type != UnmapNotify && rec->events[i].u.u.type != ConfigureRequest && rec->events[i].u.u.type != ClientMessage) { SecurityAudit("Security: denied client %d from sending event " "of type %s to window 0x%x of client %d\n", rec->client->index, LookupEventName(rec->events[i].u.u.type), rec->pWin->drawable.id, wClient(rec->pWin)->index); rec->status = BadAccess; return; } } } static void SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceReceiveAccessRec *rec = calldata; SecurityStateRec *subj, *obj; subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey); if (SecurityDoCheck(subj, obj, DixReceiveAccess, 0) == Success) return; SecurityAudit("Security: denied client %d from receiving an event " "sent to window 0x%x of client %d\n", rec->client->index, rec->pWin->drawable.id, wClient(rec->pWin)->index); rec->status = BadAccess; } /* SecurityClientStateCallback * * Arguments: * pcbl is &ClientStateCallback. * nullata is NULL. * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h) * which contains information about client state changes. * * Returns: nothing. * * Side Effects: * * If a new client is connecting, its authorization ID is copied to * client->authID. If this is a generated authorization, its reference * count is bumped, its timer is cancelled if it was running, and its * trustlevel is copied to TRUSTLEVEL(client). * * If a client is disconnecting and the client was using a generated * authorization, the authorization's reference count is decremented, and * if it is now zero, the timer for this authorization is started. */ static void SecurityClientState(CallbackListPtr *pcbl, void *unused, void *calldata) { NewClientInfoRec *pci = calldata; SecurityStateRec *state; SecurityAuthorizationPtr pAuth; int rc; state = dixLookupPrivate(&pci->client->devPrivates, stateKey); switch (pci->client->clientState) { case ClientStateInitial: state->trustLevel = XSecurityClientTrusted; state->authId = None; state->haveState = TRUE; state->live = FALSE; break; case ClientStateRunning: state->authId = AuthorizationIDOfClient(pci->client); rc = dixLookupResourceByType((void **) &pAuth, state->authId, SecurityAuthorizationResType, serverClient, DixGetAttrAccess); if (rc == Success) { /* it is a generated authorization */ pAuth->refcnt++; state->live = TRUE; if (pAuth->refcnt == 1 && pAuth->timer) TimerCancel(pAuth->timer); state->trustLevel = pAuth->trustLevel; } break; case ClientStateGone: case ClientStateRetained: rc = dixLookupResourceByType((void **) &pAuth, state->authId, SecurityAuthorizationResType, serverClient, DixGetAttrAccess); if (rc == Success && state->live) { /* it is a generated authorization */ pAuth->refcnt--; state->live = FALSE; if (pAuth->refcnt == 0) SecurityStartAuthorizationTimer(pAuth); } break; default: break; } } /* SecurityResetProc * * Arguments: * extEntry is the extension information for the security extension. * * Returns: nothing. * * Side Effects: * Performs any cleanup needed by Security at server shutdown time. */ static void SecurityResetProc(ExtensionEntry * extEntry) { /* Unregister callbacks */ DeleteCallback(&ClientStateCallback, SecurityClientState, NULL); XaceDeleteCallback(XACE_EXT_DISPATCH, SecurityExtension, NULL); XaceDeleteCallback(XACE_RESOURCE_ACCESS, SecurityResource, NULL); XaceDeleteCallback(XACE_DEVICE_ACCESS, SecurityDevice, NULL); XaceDeleteCallback(XACE_PROPERTY_ACCESS, SecurityProperty, NULL); XaceDeleteCallback(XACE_SEND_ACCESS, SecuritySend, NULL); XaceDeleteCallback(XACE_RECEIVE_ACCESS, SecurityReceive, NULL); XaceDeleteCallback(XACE_CLIENT_ACCESS, SecurityClient, NULL); XaceDeleteCallback(XACE_EXT_ACCESS, SecurityExtension, NULL); XaceDeleteCallback(XACE_SERVER_ACCESS, SecurityServer, NULL); } /* SecurityExtensionInit * * Arguments: none. * * Returns: nothing. * * Side Effects: * Enables the Security extension if possible. */ void SecurityExtensionInit(void) { ExtensionEntry *extEntry; int ret = TRUE; SecurityAuthorizationResType = CreateNewResourceType(SecurityDeleteAuthorization, "SecurityAuthorization"); RTEventClient = CreateNewResourceType(SecurityDeleteAuthorizationEventClient, "SecurityEventClient"); if (!SecurityAuthorizationResType || !RTEventClient) return; RTEventClient |= RC_NEVERRETAIN; /* Allocate the private storage */ if (!dixRegisterPrivateKey (stateKey, PRIVATE_CLIENT, sizeof(SecurityStateRec))) FatalError("SecurityExtensionSetup: Can't allocate client private.\n"); /* Register callbacks */ ret &= AddCallback(&ClientStateCallback, SecurityClientState, NULL); ret &= XaceRegisterCallback(XACE_EXT_DISPATCH, SecurityExtension, NULL); ret &= XaceRegisterCallback(XACE_RESOURCE_ACCESS, SecurityResource, NULL); ret &= XaceRegisterCallback(XACE_DEVICE_ACCESS, SecurityDevice, NULL); ret &= XaceRegisterCallback(XACE_PROPERTY_ACCESS, SecurityProperty, NULL); ret &= XaceRegisterCallback(XACE_SEND_ACCESS, SecuritySend, NULL); ret &= XaceRegisterCallback(XACE_RECEIVE_ACCESS, SecurityReceive, NULL); ret &= XaceRegisterCallback(XACE_CLIENT_ACCESS, SecurityClient, NULL); ret &= XaceRegisterCallback(XACE_EXT_ACCESS, SecurityExtension, NULL); ret &= XaceRegisterCallback(XACE_SERVER_ACCESS, SecurityServer, NULL); if (!ret) FatalError("SecurityExtensionSetup: Failed to register callbacks\n"); /* Add extension to server */ extEntry = AddExtension(SECURITY_EXTENSION_NAME, XSecurityNumberEvents, XSecurityNumberErrors, ProcSecurityDispatch, SProcSecurityDispatch, SecurityResetProc, StandardMinorOpcode); SecurityErrorBase = extEntry->errorBase; SecurityEventBase = extEntry->eventBase; EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] = (EventSwapPtr) SwapSecurityAuthorizationRevokedEvent; SetResourceTypeErrorValue(SecurityAuthorizationResType, SecurityErrorBase + XSecurityBadAuthorization); /* Label objects that were created before we could register ourself */ SecurityLabelInitial(); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xselinuxint.h���������������������������������������������������������������0000664�0001751�0001751�00000060131�12274325511�014507� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR 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 _XSELINUXINT_H #define _XSELINUXINT_H #include <selinux/selinux.h> #include <selinux/avc.h> #include "globals.h" #include "dixaccess.h" #include "dixstruct.h" #include "privates.h" #include "resource.h" #include "registry.h" #include "inputstr.h" #include "xselinux.h" /* * Types */ #define COMMAND_LEN 64 /* subject state (clients and devices only) */ typedef struct { security_id_t sid; security_id_t dev_create_sid; security_id_t win_create_sid; security_id_t sel_create_sid; security_id_t prp_create_sid; security_id_t sel_use_sid; security_id_t prp_use_sid; struct avc_entry_ref aeref; char command[COMMAND_LEN]; int privileged; } SELinuxSubjectRec; /* object state */ typedef struct { security_id_t sid; int poly; } SELinuxObjectRec; /* * Globals */ extern DevPrivateKeyRec subjectKeyRec; #define subjectKey (&subjectKeyRec) extern DevPrivateKeyRec objectKeyRec; #define objectKey (&objectKeyRec) extern DevPrivateKeyRec dataKeyRec; #define dataKey (&dataKeyRec) /* * Label functions */ int SELinuxAtomToSID(Atom atom, int prop, SELinuxObjectRec ** obj_rtn); int SELinuxSelectionToSID(Atom selection, SELinuxSubjectRec * subj, security_id_t * sid_rtn, int *poly_rtn); int SELinuxPropertyToSID(Atom property, SELinuxSubjectRec * subj, security_id_t * sid_rtn, int *poly_rtn); int SELinuxEventToSID(unsigned type, security_id_t sid_of_window, SELinuxObjectRec * sid_return); int SELinuxExtensionToSID(const char *name, security_id_t * sid_rtn); security_class_t SELinuxTypeToClass(RESTYPE type); security_context_t SELinuxDefaultClientLabel(void); void SELinuxLabelInit(void); void SELinuxLabelReset(void); /* * Security module functions */ void SELinuxFlaskInit(void); void SELinuxFlaskReset(void); /* * Private Flask definitions */ /* Security class constants */ #define SECCLASS_X_DRAWABLE 1 #define SECCLASS_X_SCREEN 2 #define SECCLASS_X_GC 3 #define SECCLASS_X_FONT 4 #define SECCLASS_X_COLORMAP 5 #define SECCLASS_X_PROPERTY 6 #define SECCLASS_X_SELECTION 7 #define SECCLASS_X_CURSOR 8 #define SECCLASS_X_CLIENT 9 #define SECCLASS_X_POINTER 10 #define SECCLASS_X_KEYBOARD 11 #define SECCLASS_X_SERVER 12 #define SECCLASS_X_EXTENSION 13 #define SECCLASS_X_EVENT 14 #define SECCLASS_X_FAKEEVENT 15 #define SECCLASS_X_RESOURCE 16 #ifdef _XSELINUX_NEED_FLASK_MAP /* Mapping from DixAccess bits to Flask permissions */ static struct security_class_mapping map[] = { {"x_drawable", {"read", /* DixReadAccess */ "write", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "list_property", /* DixListPropAccess */ "get_property", /* DixGetPropAccess */ "set_property", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "list_child", /* DixListAccess */ "add_child", /* DixAddAccess */ "remove_child", /* DixRemoveAccess */ "hide", /* DixHideAccess */ "show", /* DixShowAccess */ "blend", /* DixBlendAccess */ "override", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "send", /* DixSendAccess */ "receive", /* DixReceiveAccess */ "", /* DixUseAccess */ "manage", /* DixManageAccess */ NULL}}, {"x_screen", {"", /* DixReadAccess */ "", /* DixWriteAccess */ "", /* DixDestroyAccess */ "", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "saver_getattr", /* DixListPropAccess */ "saver_setattr", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "hide_cursor", /* DixHideAccess */ "show_cursor", /* DixShowAccess */ "saver_hide", /* DixBlendAccess */ "saver_show", /* DixGrabAccess */ NULL}}, {"x_gc", {"", /* DixReadAccess */ "", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "use", /* DixUseAccess */ NULL}}, {"x_font", {"", /* DixReadAccess */ "", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "add_glyph", /* DixAddAccess */ "remove_glyph", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "use", /* DixUseAccess */ NULL}}, {"x_colormap", {"read", /* DixReadAccess */ "write", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "add_color", /* DixAddAccess */ "remove_color", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "install", /* DixInstallAccess */ "uninstall", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "use", /* DixUseAccess */ NULL}}, {"x_property", {"read", /* DixReadAccess */ "write", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "write", /* DixBlendAccess */ NULL}}, {"x_selection", {"read", /* DixReadAccess */ "", /* DixWriteAccess */ "", /* DixDestroyAccess */ "setattr", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ NULL}}, {"x_cursor", {"read", /* DixReadAccess */ "write", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "use", /* DixUseAccess */ NULL}}, {"x_client", {"", /* DixReadAccess */ "", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "", /* DixUseAccess */ "manage", /* DixManageAccess */ NULL}}, {"x_pointer", {"read", /* DixReadAccess */ "write", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "list_property", /* DixListPropAccess */ "get_property", /* DixGetPropAccess */ "set_property", /* DixSetPropAccess */ "getfocus", /* DixGetFocusAccess */ "setfocus", /* DixSetFocusAccess */ "", /* DixListAccess */ "add", /* DixAddAccess */ "remove", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "grab", /* DixGrabAccess */ "freeze", /* DixFreezeAccess */ "force_cursor", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "use", /* DixUseAccess */ "manage", /* DixManageAccess */ "", /* DixDebugAccess */ "bell", /* DixBellAccess */ NULL}}, {"x_keyboard", {"read", /* DixReadAccess */ "write", /* DixWriteAccess */ "destroy", /* DixDestroyAccess */ "create", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "list_property", /* DixListPropAccess */ "get_property", /* DixGetPropAccess */ "set_property", /* DixSetPropAccess */ "getfocus", /* DixGetFocusAccess */ "setfocus", /* DixSetFocusAccess */ "", /* DixListAccess */ "add", /* DixAddAccess */ "remove", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "grab", /* DixGrabAccess */ "freeze", /* DixFreezeAccess */ "force_cursor", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "use", /* DixUseAccess */ "manage", /* DixManageAccess */ "", /* DixDebugAccess */ "bell", /* DixBellAccess */ NULL}}, {"x_server", {"record", /* DixReadAccess */ "", /* DixWriteAccess */ "", /* DixDestroyAccess */ "", /* DixCreateAccess */ "getattr", /* DixGetAttrAccess */ "setattr", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "grab", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "", /* DixUseAccess */ "manage", /* DixManageAccess */ "debug", /* DixDebugAccess */ NULL}}, {"x_extension", {"", /* DixReadAccess */ "", /* DixWriteAccess */ "", /* DixDestroyAccess */ "", /* DixCreateAccess */ "query", /* DixGetAttrAccess */ "", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "", /* DixSendAccess */ "", /* DixReceiveAccess */ "use", /* DixUseAccess */ NULL}}, {"x_event", {"", /* DixReadAccess */ "", /* DixWriteAccess */ "", /* DixDestroyAccess */ "", /* DixCreateAccess */ "", /* DixGetAttrAccess */ "", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "send", /* DixSendAccess */ "receive", /* DixReceiveAccess */ NULL}}, {"x_synthetic_event", {"", /* DixReadAccess */ "", /* DixWriteAccess */ "", /* DixDestroyAccess */ "", /* DixCreateAccess */ "", /* DixGetAttrAccess */ "", /* DixSetAttrAccess */ "", /* DixListPropAccess */ "", /* DixGetPropAccess */ "", /* DixSetPropAccess */ "", /* DixGetFocusAccess */ "", /* DixSetFocusAccess */ "", /* DixListAccess */ "", /* DixAddAccess */ "", /* DixRemoveAccess */ "", /* DixHideAccess */ "", /* DixShowAccess */ "", /* DixBlendAccess */ "", /* DixGrabAccess */ "", /* DixFreezeAccess */ "", /* DixForceAccess */ "", /* DixInstallAccess */ "", /* DixUninstallAccess */ "send", /* DixSendAccess */ "receive", /* DixReceiveAccess */ NULL}}, {"x_resource", {"read", /* DixReadAccess */ "write", /* DixWriteAccess */ "write", /* DixDestroyAccess */ "write", /* DixCreateAccess */ "read", /* DixGetAttrAccess */ "write", /* DixSetAttrAccess */ "read", /* DixListPropAccess */ "read", /* DixGetPropAccess */ "write", /* DixSetPropAccess */ "read", /* DixGetFocusAccess */ "write", /* DixSetFocusAccess */ "read", /* DixListAccess */ "write", /* DixAddAccess */ "write", /* DixRemoveAccess */ "write", /* DixHideAccess */ "read", /* DixShowAccess */ "read", /* DixBlendAccess */ "write", /* DixGrabAccess */ "write", /* DixFreezeAccess */ "write", /* DixForceAccess */ "write", /* DixInstallAccess */ "write", /* DixUninstallAccess */ "write", /* DixSendAccess */ "read", /* DixReceiveAccess */ "read", /* DixUseAccess */ "write", /* DixManageAccess */ "read", /* DixDebugAccess */ "write", /* DixBellAccess */ NULL}}, {NULL} }; /* x_resource "read" bits from the list above */ #define SELinuxReadMask (DixReadAccess|DixGetAttrAccess|DixListPropAccess| \ DixGetPropAccess|DixGetFocusAccess|DixListAccess| \ DixShowAccess|DixBlendAccess|DixReceiveAccess| \ DixUseAccess|DixDebugAccess) #endif /* _XSELINUX_NEED_FLASK_MAP */ #endif /* _XSELINUXINT_H */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xf86bigfont.c���������������������������������������������������������������0000664�0001751�0001751�00000055733�12274325511�014270� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * BIGFONT extension for sharing font metrics between clients (if possible) * and for transmitting font metrics to clients in a compressed form. * * Copyright (c) 1999-2000 Bruno Haible * Copyright (c) 1999-2000 The XFree86 Project, Inc. */ /* THIS IS NOT AN X CONSORTIUM STANDARD */ /* * Big fonts suffer from the following: All clients that have opened a * font can access the complete glyph metrics array (the XFontStruct member * `per_char') directly, without going through a macro. Moreover these * glyph metrics are ink metrics, i.e. are not redundant even for a * fixed-width font. For a Unicode font, the size of this array is 768 KB. * * Problems: 1. It eats a lot of memory in each client. 2. All this glyph * metrics data is piped through the socket when the font is opened. * * This extension addresses these two problems for local clients, by using * shared memory. It also addresses the second problem for non-local clients, * by compressing the data before transmit by a factor of nearly 6. * * If you use this extension, your OS ought to nicely support shared memory. * This means: Shared memory should be swappable to the swap, and the limits * should be high enough (SHMMNI at least 64, SHMMAX at least 768 KB, * SHMALL at least 48 MB). It is a plus if your OS allows shmat() calls * on segments that have already been marked "removed", because it permits * these segments to be cleaned up by the OS if the X server is killed with * signal SIGKILL. * * This extension is transparently exploited by Xlib (functions XQueryFont, * XLoadQueryFont). */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <sys/types.h> #ifdef HAS_SHM #if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2) /* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */ /* Linux libc4 and libc5 only (because glibc doesn't include kernel headers): Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define PAGE_SIZE. It is defined in <asm/page.h>. */ #include <asm/page.h> #endif #ifdef SVR4 #include <sys/sysmacros.h> #endif #if defined(__CYGWIN__) #include <sys/param.h> #include <sys/sysmacros.h> #endif #include <sys/ipc.h> #include <sys/shm.h> #include <sys/stat.h> #include <stdlib.h> #include <unistd.h> #include <time.h> #include <errno.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "gcstruct.h" #include "dixfontstr.h" #include "extnsionst.h" #include "extinit.h" #include "protocol-versions.h" #include <X11/extensions/xf86bigfproto.h> #include "xf86bigfontsrv.h" static void XF86BigfontResetProc(ExtensionEntry * /* extEntry */ ); #ifdef HAS_SHM /* A random signature, transmitted to the clients so they can verify that the shared memory segment they are attaching to was really established by the X server they are talking to. */ static CARD32 signature; /* Index for additional information stored in a FontRec's devPrivates array. */ static int FontShmdescIndex; static unsigned int pagesize; static Bool badSysCall = FALSE; #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__) #include <sys/signal.h> static void SigSysHandler(int signo) { badSysCall = TRUE; } static Bool CheckForShmSyscall(void) { void (*oldHandler) (int); int shmid = -1; /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ oldHandler = signal(SIGSYS, SigSysHandler); badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); if (shmid != -1) { /* Successful allocation - clean up */ shmctl(shmid, IPC_RMID, NULL); } else { /* Allocation failed */ badSysCall = TRUE; } signal(SIGSYS, oldHandler); return !badSysCall; } #define MUST_CHECK_FOR_SHM_SYSCALL #endif #endif /* ========== Management of shared memory segments ========== */ #ifdef HAS_SHM #ifdef __linux__ /* On Linux, shared memory marked as "removed" can still be attached. Nice feature, because the kernel will automatically free the associated storage when the server and all clients are gone. */ #define EARLY_REMOVE #endif typedef struct _ShmDesc { struct _ShmDesc *next; struct _ShmDesc **prev; int shmid; char *attach_addr; } ShmDescRec, *ShmDescPtr; static ShmDescPtr ShmList = (ShmDescPtr) NULL; static ShmDescPtr shmalloc(unsigned int size) { ShmDescPtr pDesc; int shmid; char *addr; #ifdef MUST_CHECK_FOR_SHM_SYSCALL if (pagesize == 0) return (ShmDescPtr) NULL; #endif /* On some older Linux systems, the number of shared memory segments system-wide is 127. In Linux 2.4, it is 4095. Therefore there is a tradeoff to be made between allocating a shared memory segment on one hand, and allocating memory and piping the glyph metrics on the other hand. If the glyph metrics size is small, we prefer the traditional way. */ if (size < 3500) return (ShmDescPtr) NULL; pDesc = malloc(sizeof(ShmDescRec)); if (!pDesc) return (ShmDescPtr) NULL; size = (size + pagesize - 1) & -pagesize; shmid = shmget(IPC_PRIVATE, size, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); if (shmid == -1) { ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, %s\n", size, strerror(errno)); free(pDesc); return (ShmDescPtr) NULL; } if ((addr = shmat(shmid, 0, 0)) == (char *) -1) { ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, %s\n", size, strerror(errno)); shmctl(shmid, IPC_RMID, (void *) 0); free(pDesc); return (ShmDescPtr) NULL; } #ifdef EARLY_REMOVE shmctl(shmid, IPC_RMID, (void *) 0); #endif pDesc->shmid = shmid; pDesc->attach_addr = addr; if (ShmList) ShmList->prev = &pDesc->next; pDesc->next = ShmList; pDesc->prev = &ShmList; ShmList = pDesc; return pDesc; } static void shmdealloc(ShmDescPtr pDesc) { #ifndef EARLY_REMOVE shmctl(pDesc->shmid, IPC_RMID, (void *) 0); #endif shmdt(pDesc->attach_addr); if (pDesc->next) pDesc->next->prev = pDesc->prev; *pDesc->prev = pDesc->next; free(pDesc); } #endif /* Called when a font is closed. */ void XF86BigfontFreeFontShm(FontPtr pFont) { #ifdef HAS_SHM ShmDescPtr pDesc; /* If during shutdown of the server, XF86BigfontCleanup() has already * called shmdealloc() for all segments, we don't need to do it here. */ if (!ShmList) return; pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); if (pDesc) shmdealloc(pDesc); #endif } /* Called upon fatal signal. */ void XF86BigfontCleanup(void) { #ifdef HAS_SHM while (ShmList) shmdealloc(ShmList); #endif } /* Called when a server generation dies. */ static void XF86BigfontResetProc(ExtensionEntry * extEntry) { /* This function is normally called from CloseDownExtensions(), called * from main(). It will be followed by a call to FreeAllResources(), * which will call XF86BigfontFreeFontShm() for each font. Thus it * appears that we do not need to do anything in this function. -- * But I prefer to write robust code, and not keep shared memory lying * around when it's not needed any more. (Someone might close down the * extension without calling FreeAllResources()...) */ XF86BigfontCleanup(); } /* ========== Handling of extension specific requests ========== */ static int ProcXF86BigfontQueryVersion(ClientPtr client) { xXF86BigfontQueryVersionReply reply; REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq); 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 .signature = signature, .capabilities = (client->local && !client->swapped) ? XF86Bigfont_CAP_LocalShm : 0 #else .signature = 0, .capabilities = 0 #endif }; if (client->swapped) { swaps(&reply.sequenceNumber); swapl(&reply.length); swaps(&reply.majorVersion); swaps(&reply.minorVersion); swapl(&reply.uid); swapl(&reply.gid); swapl(&reply.signature); } WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), &reply); return Success; } static void swapCharInfo(xCharInfo * pCI) { swaps(&pCI->leftSideBearing); swaps(&pCI->rightSideBearing); swaps(&pCI->characterWidth); swaps(&pCI->ascent); swaps(&pCI->descent); swaps(&pCI->attributes); } /* static CARD32 hashCI (xCharInfo *p); */ #define hashCI(p) \ (CARD32)(((p->leftSideBearing << 27) + (p->leftSideBearing >> 5) + \ (p->rightSideBearing << 23) + (p->rightSideBearing >> 9) + \ (p->characterWidth << 16) + \ (p->ascent << 11) + (p->descent << 6)) ^ p->attributes) static int ProcXF86BigfontQueryFont(ClientPtr client) { FontPtr pFont; REQUEST(xXF86BigfontQueryFontReq); CARD32 stuff_flags; xCharInfo *pmax; xCharInfo *pmin; int nCharInfos; int shmid; #ifdef HAS_SHM ShmDescPtr pDesc = NULL; #else #define pDesc 0 #endif xCharInfo *pCI; CARD16 *pIndex2UniqIndex; CARD16 *pUniqIndex2Index; CARD32 nUniqCharInfos; #if 0 REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq); #else switch (client->req_len) { case 2: /* client with version 1.0 libX11 */ stuff_flags = (client->local && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0); break; case 3: /* client with version 1.1 libX11 */ stuff_flags = stuff->flags; break; default: return BadLength; } #endif if (dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess) != Success) return BadFont; /* procotol spec says only error is BadFont */ pmax = FONTINKMAX(pFont); pmin = FONTINKMIN(pFont); nCharInfos = (pmax->rightSideBearing == pmin->rightSideBearing && pmax->leftSideBearing == pmin->leftSideBearing && pmax->descent == pmin->descent && pmax->ascent == pmin->ascent && pmax->characterWidth == pmin->characterWidth) ? 0 : N2dChars(pFont); shmid = -1; pCI = NULL; pIndex2UniqIndex = NULL; pUniqIndex2Index = NULL; nUniqCharInfos = 0; if (nCharInfos > 0) { #ifdef HAS_SHM if (!badSysCall) pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); if (pDesc) { pCI = (xCharInfo *) pDesc->attach_addr; if (stuff_flags & XF86Bigfont_FLAGS_Shm) shmid = pDesc->shmid; } else { if (stuff_flags & XF86Bigfont_FLAGS_Shm && !badSysCall) pDesc = shmalloc(nCharInfos * sizeof(xCharInfo) + sizeof(CARD32)); if (pDesc) { pCI = (xCharInfo *) pDesc->attach_addr; shmid = pDesc->shmid; } else { #endif pCI = malloc(nCharInfos * sizeof(xCharInfo)); if (!pCI) return BadAlloc; #ifdef HAS_SHM } #endif /* Fill nCharInfos starting at pCI. */ { xCharInfo *prCI = pCI; int ninfos = 0; int ncols = pFont->info.lastCol - pFont->info.firstCol + 1; int row; for (row = pFont->info.firstRow; row <= pFont->info.lastRow && ninfos < nCharInfos; row++) { unsigned char chars[512]; xCharInfo *tmpCharInfos[256]; unsigned long count; int col; unsigned long i; i = 0; for (col = pFont->info.firstCol; col <= pFont->info.lastCol; col++) { chars[i++] = row; chars[i++] = col; } (*pFont->get_metrics) (pFont, ncols, chars, TwoD16Bit, &count, tmpCharInfos); for (i = 0; i < count && ninfos < nCharInfos; i++) { *prCI++ = *tmpCharInfos[i]; ninfos++; } } } #ifdef HAS_SHM if (pDesc && !badSysCall) { *(CARD32 *) (pCI + nCharInfos) = signature; if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) { shmdealloc(pDesc); return BadAlloc; } } } #endif if (shmid == -1) { /* Cannot use shared memory, so remove-duplicates the xCharInfos using a temporary hash table. */ /* Note that CARD16 is suitable as index type, because nCharInfos <= 0x10000. */ CARD32 hashModulus; CARD16 *pHash2UniqIndex; CARD16 *pUniqIndex2NextUniqIndex; CARD32 NextIndex; CARD32 NextUniqIndex; CARD16 *tmp; CARD32 i, j; hashModulus = 67; if (hashModulus > nCharInfos + 1) hashModulus = nCharInfos + 1; tmp = malloc((4 * nCharInfos + 1) * sizeof(CARD16)); if (!tmp) { if (!pDesc) free(pCI); return BadAlloc; } pIndex2UniqIndex = tmp; /* nCharInfos elements */ pUniqIndex2Index = tmp + nCharInfos; /* max. nCharInfos elements */ pUniqIndex2NextUniqIndex = tmp + 2 * nCharInfos; /* max. nCharInfos elements */ pHash2UniqIndex = tmp + 3 * nCharInfos; /* hashModulus (<= nCharInfos+1) elements */ /* Note that we can use 0xffff as end-of-list indicator, because even if nCharInfos = 0x10000, 0xffff can not occur as valid entry before the last element has been inserted. And once the last element has been inserted, we don't need the hash table any more. */ for (j = 0; j < hashModulus; j++) pHash2UniqIndex[j] = (CARD16) (-1); NextUniqIndex = 0; for (NextIndex = 0; NextIndex < nCharInfos; NextIndex++) { xCharInfo *p = &pCI[NextIndex]; CARD32 hashCode = hashCI(p) % hashModulus; for (i = pHash2UniqIndex[hashCode]; i != (CARD16) (-1); i = pUniqIndex2NextUniqIndex[i]) { j = pUniqIndex2Index[i]; if (pCI[j].leftSideBearing == p->leftSideBearing && pCI[j].rightSideBearing == p->rightSideBearing && pCI[j].characterWidth == p->characterWidth && pCI[j].ascent == p->ascent && pCI[j].descent == p->descent && pCI[j].attributes == p->attributes) break; } if (i != (CARD16) (-1)) { /* Found *p at Index j, UniqIndex i */ pIndex2UniqIndex[NextIndex] = i; } else { /* Allocate a new entry in the Uniq table */ if (hashModulus <= 2 * NextUniqIndex && hashModulus < nCharInfos + 1) { /* Time to increate hash table size */ hashModulus = 2 * hashModulus + 1; if (hashModulus > nCharInfos + 1) hashModulus = nCharInfos + 1; for (j = 0; j < hashModulus; j++) pHash2UniqIndex[j] = (CARD16) (-1); for (i = 0; i < NextUniqIndex; i++) pUniqIndex2NextUniqIndex[i] = (CARD16) (-1); for (i = 0; i < NextUniqIndex; i++) { j = pUniqIndex2Index[i]; p = &pCI[j]; hashCode = hashCI(p) % hashModulus; pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode]; pHash2UniqIndex[hashCode] = i; } p = &pCI[NextIndex]; hashCode = hashCI(p) % hashModulus; } i = NextUniqIndex++; pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode]; pHash2UniqIndex[hashCode] = i; pUniqIndex2Index[i] = NextIndex; pIndex2UniqIndex[NextIndex] = i; } } nUniqCharInfos = NextUniqIndex; /* fprintf(stderr, "font metrics: nCharInfos = %d, nUniqCharInfos = %d, hashModulus = %d\n", nCharInfos, nUniqCharInfos, hashModulus); */ } } { int nfontprops = pFont->info.nprops; int rlength = sizeof(xXF86BigfontQueryFontReply) + nfontprops * sizeof(xFontProp) + (nCharInfos > 0 && shmid == -1 ? nUniqCharInfos * sizeof(xCharInfo) + (nCharInfos + 1) / 2 * 2 * sizeof(CARD16) : 0); xXF86BigfontQueryFontReply *reply = calloc(1, rlength); char *p; if (!reply) { if (nCharInfos > 0) { if (shmid == -1) free(pIndex2UniqIndex); if (!pDesc) free(pCI); } return BadAlloc; } reply->type = X_Reply; reply->length = bytes_to_int32(rlength - sizeof(xGenericReply)); reply->sequenceNumber = client->sequence; reply->minBounds = pFont->info.ink_minbounds; reply->maxBounds = pFont->info.ink_maxbounds; reply->minCharOrByte2 = pFont->info.firstCol; reply->maxCharOrByte2 = pFont->info.lastCol; reply->defaultChar = pFont->info.defaultCh; reply->nFontProps = pFont->info.nprops; reply->drawDirection = pFont->info.drawDirection; reply->minByte1 = pFont->info.firstRow; reply->maxByte1 = pFont->info.lastRow; reply->allCharsExist = pFont->info.allExist; reply->fontAscent = pFont->info.fontAscent; reply->fontDescent = pFont->info.fontDescent; reply->nCharInfos = nCharInfos; reply->nUniqCharInfos = nUniqCharInfos; reply->shmid = shmid; reply->shmsegoffset = 0; if (client->swapped) { swaps(&reply->sequenceNumber); swapl(&reply->length); swapCharInfo(&reply->minBounds); swapCharInfo(&reply->maxBounds); swaps(&reply->minCharOrByte2); swaps(&reply->maxCharOrByte2); swaps(&reply->defaultChar); swaps(&reply->nFontProps); swaps(&reply->fontAscent); swaps(&reply->fontDescent); swapl(&reply->nCharInfos); swapl(&reply->nUniqCharInfos); swapl(&reply->shmid); swapl(&reply->shmsegoffset); } p = (char *) &reply[1]; { FontPropPtr pFP; xFontProp *prFP; int i; for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) p; i < nfontprops; i++, pFP++, prFP++) { prFP->name = pFP->name; prFP->value = pFP->value; if (client->swapped) { swapl(&prFP->name); swapl(&prFP->value); } } p = (char *) prFP; } if (nCharInfos > 0 && shmid == -1) { xCharInfo *pci; CARD16 *ps; int i, j; pci = (xCharInfo *) p; for (i = 0; i < nUniqCharInfos; i++, pci++) { *pci = pCI[pUniqIndex2Index[i]]; if (client->swapped) swapCharInfo(pci); } ps = (CARD16 *) pci; for (j = 0; j < nCharInfos; j++, ps++) { *ps = pIndex2UniqIndex[j]; if (client->swapped) { swaps(ps); } } } WriteToClient(client, rlength, reply); free(reply); if (nCharInfos > 0) { if (shmid == -1) free(pIndex2UniqIndex); if (!pDesc) free(pCI); } return Success; } } static int ProcXF86BigfontDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XF86BigfontQueryVersion: return ProcXF86BigfontQueryVersion(client); case X_XF86BigfontQueryFont: return ProcXF86BigfontQueryFont(client); default: return BadRequest; } } static int SProcXF86BigfontQueryVersion(ClientPtr client) { REQUEST(xXF86BigfontQueryVersionReq); swaps(&stuff->length); return ProcXF86BigfontQueryVersion(client); } static int SProcXF86BigfontQueryFont(ClientPtr client) { REQUEST(xXF86BigfontQueryFontReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq); swapl(&stuff->id); return ProcXF86BigfontQueryFont(client); } static int SProcXF86BigfontDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XF86BigfontQueryVersion: return SProcXF86BigfontQueryVersion(client); case X_XF86BigfontQueryFont: return SProcXF86BigfontQueryFont(client); default: return BadRequest; } } void XFree86BigfontExtensionInit(void) { if (AddExtension(XF86BIGFONTNAME, XF86BigfontNumberEvents, XF86BigfontNumberErrors, ProcXF86BigfontDispatch, SProcXF86BigfontDispatch, XF86BigfontResetProc, StandardMinorOpcode)) { #ifdef HAS_SHM #ifdef MUST_CHECK_FOR_SHM_SYSCALL /* * Note: Local-clients will not be optimized without shared memory * support. Remote-client optimization does not depend on shared * memory support. Thus, the extension is still registered even * when shared memory support is not functional. */ if (!CheckForShmSyscall()) { ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n"); return; } #endif srand((unsigned int) time(NULL)); signature = ((unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand()) << 16) + (unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand()); /* fprintf(stderr, "signature = 0x%08X\n", signature); */ FontShmdescIndex = AllocateFontPrivateIndex(); #if !defined(CSRG_BASED) && !defined(__CYGWIN__) pagesize = SHMLBA; #else #ifdef _SC_PAGESIZE pagesize = sysconf(_SC_PAGESIZE); #else pagesize = getpagesize(); #endif #endif #endif } } �������������������������������������xorg-server-1.17.1/Xext/dpmsstubs.c�����������������������������������������������������������������0000664�0001751�0001751�00000003202�12456571574�014146� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************** Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "dpmsproc.h" #define FALSE 0 Bool DPMSSupported(void) { return FALSE; } int DPMSSet(ClientPtr client, int level) { return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/panoramiX.c�����������������������������������������������������������������0000664�0001751�0001751�00000113346�12456571574�014073� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifdef HAVE_DMX_CONFIG_H #include <dmx-config.h> #endif #include <stdio.h> #include <X11/X.h> #include <X11/Xproto.h> #include <X11/Xarch.h> #include "misc.h" #include "cursor.h" #include "cursorstr.h" #include "extnsionst.h" #include "dixstruct.h" #include "gc.h" #include "gcstruct.h" #include "scrnintstr.h" #include "window.h" #include "windowstr.h" #include "pixmapstr.h" #include "panoramiX.h" #include <X11/extensions/panoramiXproto.h> #include "panoramiXsrv.h" #include "globals.h" #include "servermd.h" #include "resource.h" #include "picturestr.h" #include "xfixesint.h" #include "damageextint.h" #ifdef COMPOSITE #include "compint.h" #endif #include "extinit.h" #include "protocol-versions.h" #ifdef GLXPROXY extern VisualPtr glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen); #endif /* * PanoramiX data declarations */ int PanoramiXPixWidth = 0; int PanoramiXPixHeight = 0; int PanoramiXNumScreens = 0; _X_EXPORT RegionRec PanoramiXScreenRegion = { {0, 0, 0, 0}, NULL }; static int PanoramiXNumDepths; static DepthPtr PanoramiXDepths; static int PanoramiXNumVisuals; static VisualPtr PanoramiXVisuals; RESTYPE XRC_DRAWABLE; RESTYPE XRT_WINDOW; RESTYPE XRT_PIXMAP; RESTYPE XRT_GC; RESTYPE XRT_COLORMAP; static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr); XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual; /* * Function prototypes */ static int panoramiXGeneration; static int ProcPanoramiXDispatch(ClientPtr client); static void PanoramiXResetProc(ExtensionEntry *); /* * External references for functions and data variables */ #include "panoramiXh.h" int (*SavedProcVector[256]) (ClientPtr client) = { NULL,}; static DevPrivateKeyRec PanoramiXGCKeyRec; #define PanoramiXGCKey (&PanoramiXGCKeyRec) static DevPrivateKeyRec PanoramiXScreenKeyRec; #define PanoramiXScreenKey (&PanoramiXScreenKeyRec) typedef struct { DDXPointRec clipOrg; DDXPointRec patOrg; const GCFuncs *wrapFuncs; } PanoramiXGCRec, *PanoramiXGCPtr; typedef struct { CreateGCProcPtr CreateGC; CloseScreenProcPtr CloseScreen; } PanoramiXScreenRec, *PanoramiXScreenPtr; static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr); static void XineramaChangeGC(GCPtr, unsigned long); static void XineramaCopyGC(GCPtr, unsigned long, GCPtr); static void XineramaDestroyGC(GCPtr); static void XineramaChangeClip(GCPtr, int, void *, int); static void XineramaDestroyClip(GCPtr); static void XineramaCopyClip(GCPtr, GCPtr); static const GCFuncs XineramaGCFuncs = { XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC, XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip }; #define Xinerama_GC_FUNC_PROLOGUE(pGC)\ PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr) \ dixLookupPrivate(&(pGC)->devPrivates, PanoramiXGCKey); \ (pGC)->funcs = pGCPriv->wrapFuncs; #define Xinerama_GC_FUNC_EPILOGUE(pGC)\ pGCPriv->wrapFuncs = (pGC)->funcs;\ (pGC)->funcs = &XineramaGCFuncs; static Bool XineramaCloseScreen(ScreenPtr pScreen) { PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr) dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->CreateGC = pScreenPriv->CreateGC; if (pScreen->myNum == 0) RegionUninit(&PanoramiXScreenRegion); free(pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } static Bool XineramaCreateGC(GCPtr pGC) { ScreenPtr pScreen = pGC->pScreen; PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr) dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey); Bool ret; pScreen->CreateGC = pScreenPriv->CreateGC; if ((ret = (*pScreen->CreateGC) (pGC))) { PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr) dixLookupPrivate(&pGC->devPrivates, PanoramiXGCKey); pGCPriv->wrapFuncs = pGC->funcs; pGC->funcs = &XineramaGCFuncs; pGCPriv->clipOrg.x = pGC->clipOrg.x; pGCPriv->clipOrg.y = pGC->clipOrg.y; pGCPriv->patOrg.x = pGC->patOrg.x; pGCPriv->patOrg.y = pGC->patOrg.y; } pScreen->CreateGC = XineramaCreateGC; return ret; } static void XineramaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) { Xinerama_GC_FUNC_PROLOGUE(pGC); if ((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr) pDraw)->parent)) { /* the root window */ int x_off = pGC->pScreen->x; int y_off = pGC->pScreen->y; int new_val; new_val = pGCPriv->clipOrg.x - x_off; if (pGC->clipOrg.x != new_val) { pGC->clipOrg.x = new_val; changes |= GCClipXOrigin; } new_val = pGCPriv->clipOrg.y - y_off; if (pGC->clipOrg.y != new_val) { pGC->clipOrg.y = new_val; changes |= GCClipYOrigin; } new_val = pGCPriv->patOrg.x - x_off; if (pGC->patOrg.x != new_val) { pGC->patOrg.x = new_val; changes |= GCTileStipXOrigin; } new_val = pGCPriv->patOrg.y - y_off; if (pGC->patOrg.y != new_val) { pGC->patOrg.y = new_val; changes |= GCTileStipYOrigin; } } else { if (pGC->clipOrg.x != pGCPriv->clipOrg.x) { pGC->clipOrg.x = pGCPriv->clipOrg.x; changes |= GCClipXOrigin; } if (pGC->clipOrg.y != pGCPriv->clipOrg.y) { pGC->clipOrg.y = pGCPriv->clipOrg.y; changes |= GCClipYOrigin; } if (pGC->patOrg.x != pGCPriv->patOrg.x) { pGC->patOrg.x = pGCPriv->patOrg.x; changes |= GCTileStipXOrigin; } if (pGC->patOrg.y != pGCPriv->patOrg.y) { pGC->patOrg.y = pGCPriv->patOrg.y; changes |= GCTileStipYOrigin; } } (*pGC->funcs->ValidateGC) (pGC, changes, pDraw); Xinerama_GC_FUNC_EPILOGUE(pGC); } static void XineramaDestroyGC(GCPtr pGC) { Xinerama_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->DestroyGC) (pGC); Xinerama_GC_FUNC_EPILOGUE(pGC); } static void XineramaChangeGC(GCPtr pGC, unsigned long mask) { Xinerama_GC_FUNC_PROLOGUE(pGC); if (mask & GCTileStipXOrigin) pGCPriv->patOrg.x = pGC->patOrg.x; if (mask & GCTileStipYOrigin) pGCPriv->patOrg.y = pGC->patOrg.y; if (mask & GCClipXOrigin) pGCPriv->clipOrg.x = pGC->clipOrg.x; if (mask & GCClipYOrigin) pGCPriv->clipOrg.y = pGC->clipOrg.y; (*pGC->funcs->ChangeGC) (pGC, mask); Xinerama_GC_FUNC_EPILOGUE(pGC); } static void XineramaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) { PanoramiXGCPtr pSrcPriv = (PanoramiXGCPtr) dixLookupPrivate(&pGCSrc->devPrivates, PanoramiXGCKey); Xinerama_GC_FUNC_PROLOGUE(pGCDst); if (mask & GCTileStipXOrigin) pGCPriv->patOrg.x = pSrcPriv->patOrg.x; if (mask & GCTileStipYOrigin) pGCPriv->patOrg.y = pSrcPriv->patOrg.y; if (mask & GCClipXOrigin) pGCPriv->clipOrg.x = pSrcPriv->clipOrg.x; if (mask & GCClipYOrigin) pGCPriv->clipOrg.y = pSrcPriv->clipOrg.y; (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); Xinerama_GC_FUNC_EPILOGUE(pGCDst); } static void XineramaChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { Xinerama_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); Xinerama_GC_FUNC_EPILOGUE(pGC); } static void XineramaCopyClip(GCPtr pgcDst, GCPtr pgcSrc) { Xinerama_GC_FUNC_PROLOGUE(pgcDst); (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); Xinerama_GC_FUNC_EPILOGUE(pgcDst); } static void XineramaDestroyClip(GCPtr pGC) { Xinerama_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->DestroyClip) (pGC); Xinerama_GC_FUNC_EPILOGUE(pGC); } int XineramaDeleteResource(void *data, XID id) { free(data); return 1; } typedef struct { int screen; int id; } PanoramiXSearchData; static Bool XineramaFindIDByScrnum(void *resource, XID id, void *privdata) { PanoramiXRes *res = (PanoramiXRes *) resource; PanoramiXSearchData *data = (PanoramiXSearchData *) privdata; return res->info[data->screen].id == data->id; } PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen) { PanoramiXSearchData data; void *val; if (!screen) { dixLookupResourceByType(&val, id, type, serverClient, DixReadAccess); return val; } data.screen = screen; data.id = id; return LookupClientResourceComplex(clients[CLIENT_ID(id)], type, XineramaFindIDByScrnum, &data); } typedef struct _connect_callback_list { void (*func) (void); struct _connect_callback_list *next; } XineramaConnectionCallbackList; static XineramaConnectionCallbackList *ConnectionCallbackList = NULL; Bool XineramaRegisterConnectionBlockCallback(void (*func) (void)) { XineramaConnectionCallbackList *newlist; if (!(newlist = malloc(sizeof(XineramaConnectionCallbackList)))) return FALSE; newlist->next = ConnectionCallbackList; newlist->func = func; ConnectionCallbackList = newlist; return TRUE; } static void XineramaInitData(void) { int i, w, h; RegionNull(&PanoramiXScreenRegion); FOR_NSCREENS(i) { BoxRec TheBox; RegionRec ScreenRegion; ScreenPtr pScreen = screenInfo.screens[i]; TheBox.x1 = pScreen->x; TheBox.x2 = TheBox.x1 + pScreen->width; TheBox.y1 = pScreen->y; TheBox.y2 = TheBox.y1 + pScreen->height; RegionInit(&ScreenRegion, &TheBox, 1); RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion, &ScreenRegion); RegionUninit(&ScreenRegion); } PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width; PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height; FOR_NSCREENS_FORWARD_SKIP(i) { ScreenPtr pScreen = screenInfo.screens[i]; w = pScreen->x + pScreen->width; h = pScreen->y + pScreen->height; if (PanoramiXPixWidth < w) PanoramiXPixWidth = w; if (PanoramiXPixHeight < h) PanoramiXPixHeight = h; } } void XineramaReinitData(void) { RegionUninit(&PanoramiXScreenRegion); XineramaInitData(); } /* * PanoramiXExtensionInit(): * Called from InitExtensions in main(). * Register PanoramiXeen Extension * Initialize global variables. */ void PanoramiXExtensionInit(void) { int i; Bool success = FALSE; ExtensionEntry *extEntry; ScreenPtr pScreen = screenInfo.screens[0]; PanoramiXScreenPtr pScreenPriv; if (noPanoramiXExtension) return; if (!dixRegisterPrivateKey(&PanoramiXScreenKeyRec, PRIVATE_SCREEN, 0)) { noPanoramiXExtension = TRUE; return; } if (!dixRegisterPrivateKey (&PanoramiXGCKeyRec, PRIVATE_GC, sizeof(PanoramiXGCRec))) { noPanoramiXExtension = TRUE; return; } PanoramiXNumScreens = screenInfo.numScreens; if (PanoramiXNumScreens == 1) { /* Only 1 screen */ noPanoramiXExtension = TRUE; return; } while (panoramiXGeneration != serverGeneration) { extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0, ProcPanoramiXDispatch, SProcPanoramiXDispatch, PanoramiXResetProc, StandardMinorOpcode); if (!extEntry) break; /* * First make sure all the basic allocations succeed. If not, * run in non-PanoramiXeen mode. */ FOR_NSCREENS(i) { pScreen = screenInfo.screens[i]; pScreenPriv = malloc(sizeof(PanoramiXScreenRec)); dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey, pScreenPriv); if (!pScreenPriv) { noPanoramiXExtension = TRUE; return; } pScreenPriv->CreateGC = pScreen->CreateGC; pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CreateGC = XineramaCreateGC; pScreen->CloseScreen = XineramaCloseScreen; } XRC_DRAWABLE = CreateNewResourceClass(); XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource, "XineramaWindow"); if (XRT_WINDOW) XRT_WINDOW |= XRC_DRAWABLE; XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource, "XineramaPixmap"); if (XRT_PIXMAP) XRT_PIXMAP |= XRC_DRAWABLE; XRT_GC = CreateNewResourceType(XineramaDeleteResource, "XineramaGC"); XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource, "XineramaColormap"); if (XRT_WINDOW && XRT_PIXMAP && XRT_GC && XRT_COLORMAP) { panoramiXGeneration = serverGeneration; success = TRUE; } SetResourceTypeErrorValue(XRT_WINDOW, BadWindow); SetResourceTypeErrorValue(XRT_PIXMAP, BadPixmap); SetResourceTypeErrorValue(XRT_GC, BadGC); SetResourceTypeErrorValue(XRT_COLORMAP, BadColor); } if (!success) { noPanoramiXExtension = TRUE; ErrorF(PANORAMIX_PROTOCOL_NAME " extension failed to initialize\n"); return; } XineramaInitData(); /* * Put our processes into the ProcVector */ for (i = 256; i--;) SavedProcVector[i] = ProcVector[i]; ProcVector[X_CreateWindow] = PanoramiXCreateWindow; ProcVector[X_ChangeWindowAttributes] = PanoramiXChangeWindowAttributes; ProcVector[X_DestroyWindow] = PanoramiXDestroyWindow; ProcVector[X_DestroySubwindows] = PanoramiXDestroySubwindows; ProcVector[X_ChangeSaveSet] = PanoramiXChangeSaveSet; ProcVector[X_ReparentWindow] = PanoramiXReparentWindow; ProcVector[X_MapWindow] = PanoramiXMapWindow; ProcVector[X_MapSubwindows] = PanoramiXMapSubwindows; ProcVector[X_UnmapWindow] = PanoramiXUnmapWindow; ProcVector[X_UnmapSubwindows] = PanoramiXUnmapSubwindows; ProcVector[X_ConfigureWindow] = PanoramiXConfigureWindow; ProcVector[X_CirculateWindow] = PanoramiXCirculateWindow; ProcVector[X_GetGeometry] = PanoramiXGetGeometry; ProcVector[X_TranslateCoords] = PanoramiXTranslateCoords; ProcVector[X_CreatePixmap] = PanoramiXCreatePixmap; ProcVector[X_FreePixmap] = PanoramiXFreePixmap; ProcVector[X_CreateGC] = PanoramiXCreateGC; ProcVector[X_ChangeGC] = PanoramiXChangeGC; ProcVector[X_CopyGC] = PanoramiXCopyGC; ProcVector[X_SetDashes] = PanoramiXSetDashes; ProcVector[X_SetClipRectangles] = PanoramiXSetClipRectangles; ProcVector[X_FreeGC] = PanoramiXFreeGC; ProcVector[X_ClearArea] = PanoramiXClearToBackground; ProcVector[X_CopyArea] = PanoramiXCopyArea; ProcVector[X_CopyPlane] = PanoramiXCopyPlane; ProcVector[X_PolyPoint] = PanoramiXPolyPoint; ProcVector[X_PolyLine] = PanoramiXPolyLine; ProcVector[X_PolySegment] = PanoramiXPolySegment; ProcVector[X_PolyRectangle] = PanoramiXPolyRectangle; ProcVector[X_PolyArc] = PanoramiXPolyArc; ProcVector[X_FillPoly] = PanoramiXFillPoly; ProcVector[X_PolyFillRectangle] = PanoramiXPolyFillRectangle; ProcVector[X_PolyFillArc] = PanoramiXPolyFillArc; ProcVector[X_PutImage] = PanoramiXPutImage; ProcVector[X_GetImage] = PanoramiXGetImage; ProcVector[X_PolyText8] = PanoramiXPolyText8; ProcVector[X_PolyText16] = PanoramiXPolyText16; ProcVector[X_ImageText8] = PanoramiXImageText8; ProcVector[X_ImageText16] = PanoramiXImageText16; ProcVector[X_CreateColormap] = PanoramiXCreateColormap; ProcVector[X_FreeColormap] = PanoramiXFreeColormap; ProcVector[X_CopyColormapAndFree] = PanoramiXCopyColormapAndFree; ProcVector[X_InstallColormap] = PanoramiXInstallColormap; ProcVector[X_UninstallColormap] = PanoramiXUninstallColormap; ProcVector[X_AllocColor] = PanoramiXAllocColor; ProcVector[X_AllocNamedColor] = PanoramiXAllocNamedColor; ProcVector[X_AllocColorCells] = PanoramiXAllocColorCells; ProcVector[X_AllocColorPlanes] = PanoramiXAllocColorPlanes; ProcVector[X_FreeColors] = PanoramiXFreeColors; ProcVector[X_StoreColors] = PanoramiXStoreColors; ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor; PanoramiXRenderInit(); PanoramiXFixesInit(); PanoramiXDamageInit(); #ifdef COMPOSITE PanoramiXCompositeInit(); #endif } Bool PanoramiXCreateConnectionBlock(void) { int i, j, length; Bool disable_backing_store = FALSE; int old_width, old_height; float width_mult, height_mult; xWindowRoot *root; xVisualType *visual; xDepth *depth; VisualPtr pVisual; ScreenPtr pScreen; /* * Do normal CreateConnectionBlock but faking it for only one screen */ if (!PanoramiXNumDepths) { ErrorF("Xinerama error: No common visuals\n"); return FALSE; } for (i = 1; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; if (pScreen->rootDepth != screenInfo.screens[0]->rootDepth) { ErrorF("Xinerama error: Root window depths differ\n"); return FALSE; } if (pScreen->backingStoreSupport != screenInfo.screens[0]->backingStoreSupport) disable_backing_store = TRUE; } if (disable_backing_store) { for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; pScreen->backingStoreSupport = NotUseful; } } i = screenInfo.numScreens; screenInfo.numScreens = 1; if (!CreateConnectionBlock()) { screenInfo.numScreens = i; return FALSE; } screenInfo.numScreens = i; root = (xWindowRoot *) (ConnectionInfo + connBlockScreenStart); length = connBlockScreenStart + sizeof(xWindowRoot); /* overwrite the connection block */ root->nDepths = PanoramiXNumDepths; for (i = 0; i < PanoramiXNumDepths; i++) { depth = (xDepth *) (ConnectionInfo + length); depth->depth = PanoramiXDepths[i].depth; depth->nVisuals = PanoramiXDepths[i].numVids; length += sizeof(xDepth); visual = (xVisualType *) (ConnectionInfo + length); for (j = 0; j < depth->nVisuals; j++, visual++) { visual->visualID = PanoramiXDepths[i].vids[j]; for (pVisual = PanoramiXVisuals; pVisual->vid != visual->visualID; pVisual++); visual->class = pVisual->class; visual->bitsPerRGB = pVisual->bitsPerRGBValue; visual->colormapEntries = pVisual->ColormapEntries; visual->redMask = pVisual->redMask; visual->greenMask = pVisual->greenMask; visual->blueMask = pVisual->blueMask; } length += (depth->nVisuals * sizeof(xVisualType)); } connSetupPrefix.length = bytes_to_int32(length); for (i = 0; i < PanoramiXNumDepths; i++) free(PanoramiXDepths[i].vids); free(PanoramiXDepths); PanoramiXDepths = NULL; /* * OK, change some dimensions so it looks as if it were one big screen */ old_width = root->pixWidth; old_height = root->pixHeight; root->pixWidth = PanoramiXPixWidth; root->pixHeight = PanoramiXPixHeight; width_mult = (1.0 * root->pixWidth) / old_width; height_mult = (1.0 * root->pixHeight) / old_height; root->mmWidth *= width_mult; root->mmHeight *= height_mult; while (ConnectionCallbackList) { void *tmp; tmp = (void *) ConnectionCallbackList; (*ConnectionCallbackList->func) (); ConnectionCallbackList = ConnectionCallbackList->next; free(tmp); } return TRUE; } /* * This isn't just memcmp(), bitsPerRGBValue is skipped. markv made that * change way back before xf86 4.0, but the comment for _why_ is a bit * opaque, so I'm not going to question it for now. * * This is probably better done as a screen hook so DBE/EVI/GLX can add * their own tests, and adding privates to VisualRec so they don't have to * do their own back-mapping. */ static Bool VisualsEqual(VisualPtr a, ScreenPtr pScreenB, VisualPtr b) { return ((a->class == b->class) && (a->ColormapEntries == b->ColormapEntries) && (a->nplanes == b->nplanes) && (a->redMask == b->redMask) && (a->greenMask == b->greenMask) && (a->blueMask == b->blueMask) && (a->offsetRed == b->offsetRed) && (a->offsetGreen == b->offsetGreen) && (a->offsetBlue == b->offsetBlue)); } static void PanoramiXMaybeAddDepth(DepthPtr pDepth) { ScreenPtr pScreen; int j, k; Bool found = FALSE; FOR_NSCREENS_FORWARD_SKIP(j) { pScreen = screenInfo.screens[j]; for (k = 0; k < pScreen->numDepths; k++) { if (pScreen->allowedDepths[k].depth == pDepth->depth) { found = TRUE; break; } } } if (!found) return; j = PanoramiXNumDepths; PanoramiXNumDepths++; PanoramiXDepths = realloc(PanoramiXDepths, PanoramiXNumDepths * sizeof(DepthRec)); PanoramiXDepths[j].depth = pDepth->depth; PanoramiXDepths[j].numVids = 0; /* XXX suboptimal, should grow these dynamically */ if (pDepth->numVids) PanoramiXDepths[j].vids = malloc(sizeof(VisualID) * pDepth->numVids); else PanoramiXDepths[j].vids = NULL; } static void PanoramiXMaybeAddVisual(VisualPtr pVisual) { ScreenPtr pScreen; int j, k; Bool found = FALSE; FOR_NSCREENS_FORWARD_SKIP(j) { pScreen = screenInfo.screens[j]; found = FALSE; for (k = 0; k < pScreen->numVisuals; k++) { VisualPtr candidate = &pScreen->visuals[k]; if ((*XineramaVisualsEqualPtr) (pVisual, pScreen, candidate) #ifdef GLXPROXY && glxMatchVisual(screenInfo.screens[0], pVisual, pScreen) #endif ) { found = TRUE; break; } } if (!found) return; } /* found a matching visual on all screens, add it to the subset list */ j = PanoramiXNumVisuals; PanoramiXNumVisuals++; PanoramiXVisuals = realloc(PanoramiXVisuals, PanoramiXNumVisuals * sizeof(VisualRec)); memcpy(&PanoramiXVisuals[j], pVisual, sizeof(VisualRec)); for (k = 0; k < PanoramiXNumDepths; k++) { if (PanoramiXDepths[k].depth == pVisual->nplanes) { PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid; PanoramiXDepths[k].numVids++; break; } } } extern void PanoramiXConsolidate(void) { int i; PanoramiXRes *root, *defmap, *saver; ScreenPtr pScreen = screenInfo.screens[0]; DepthPtr pDepth = pScreen->allowedDepths; VisualPtr pVisual = pScreen->visuals; PanoramiXNumDepths = 0; PanoramiXNumVisuals = 0; for (i = 0; i < pScreen->numDepths; i++) PanoramiXMaybeAddDepth(pDepth++); for (i = 0; i < pScreen->numVisuals; i++) PanoramiXMaybeAddVisual(pVisual++); root = malloc(sizeof(PanoramiXRes)); root->type = XRT_WINDOW; defmap = malloc(sizeof(PanoramiXRes)); defmap->type = XRT_COLORMAP; saver = malloc(sizeof(PanoramiXRes)); saver->type = XRT_WINDOW; FOR_NSCREENS(i) { ScreenPtr scr = screenInfo.screens[i]; root->info[i].id = scr->root->drawable.id; root->u.win.class = InputOutput; root->u.win.root = TRUE; saver->info[i].id = scr->screensaver.wid; saver->u.win.class = InputOutput; saver->u.win.root = TRUE; defmap->info[i].id = scr->defColormap; } AddResource(root->info[0].id, XRT_WINDOW, root); AddResource(saver->info[0].id, XRT_WINDOW, saver); AddResource(defmap->info[0].id, XRT_COLORMAP, defmap); } VisualID PanoramiXTranslateVisualID(int screen, VisualID orig) { ScreenPtr pOtherScreen = screenInfo.screens[screen]; VisualPtr pVisual = NULL; int i; for (i = 0; i < PanoramiXNumVisuals; i++) { if (orig == PanoramiXVisuals[i].vid) { pVisual = &PanoramiXVisuals[i]; break; } } if (!pVisual) return 0; /* if screen is 0, orig is already the correct visual ID */ if (screen == 0) return orig; /* found the original, now translate it relative to the backend screen */ for (i = 0; i < pOtherScreen->numVisuals; i++) { VisualPtr pOtherVisual = &pOtherScreen->visuals[i]; if ((*XineramaVisualsEqualPtr) (pVisual, pOtherScreen, pOtherVisual)) return pOtherVisual->vid; } return 0; } /* * PanoramiXResetProc() * Exit, deallocating as needed. */ static void PanoramiXResetProc(ExtensionEntry * extEntry) { int i; PanoramiXRenderReset(); PanoramiXFixesReset(); PanoramiXDamageReset(); #ifdef COMPOSITE PanoramiXCompositeReset (); #endif screenInfo.numScreens = PanoramiXNumScreens; for (i = 256; i--;) ProcVector[i] = SavedProcVector[i]; } int ProcPanoramiXQueryVersion(ClientPtr client) { /* REQUEST(xPanoramiXQueryVersionReq); */ xPanoramiXQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_PANORAMIX_MAJOR_VERSION, .minorVersion = SERVER_PANORAMIX_MINOR_VERSION }; REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep); return Success; } int ProcPanoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); WindowPtr pWin; xPanoramiXGetStateReply rep; int rc; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; 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), &rep); return Success; } int ProcPanoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); WindowPtr pWin; xPanoramiXGetScreenCountReply rep; int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; 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), &rep); return Success; } int ProcPanoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; int rc; if (stuff->screen >= PanoramiXNumScreens) return BadMatch; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rep = (xPanoramiXGetScreenSizeReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, /* screen dimensions */ .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); swapl(&rep.width); swapl(&rep.height); swapl(&rep.window); swapl(&rep.screen); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep); return Success; } int ProcXineramaIsActive(ClientPtr client) { /* REQUEST(xXineramaIsActiveReq); */ xXineramaIsActiveReply rep; REQUEST_SIZE_MATCH(xXineramaIsActiveReq); 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. */ .state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack #else .state = !noPanoramiXExtension; #endif }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.state); } WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep); return Success; } int ProcXineramaQueryScreens(ClientPtr client) { /* REQUEST(xXineramaQueryScreensReq); */ 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); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.number); } WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep); if (!noPanoramiXExtension) { xXineramaScreenInfo scratch; int i; FOR_NSCREENS(i) { scratch.x_org = screenInfo.screens[i]->x; scratch.y_org = screenInfo.screens[i]->y; scratch.width = screenInfo.screens[i]->width; scratch.height = screenInfo.screens[i]->height; if (client->swapped) { swaps(&scratch.x_org); swaps(&scratch.y_org); swaps(&scratch.width); swaps(&scratch.height); } WriteToClient(client, sz_XineramaScreenInfo, &scratch); } } return Success; } static int ProcPanoramiXDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_PanoramiXQueryVersion: return ProcPanoramiXQueryVersion(client); case X_PanoramiXGetState: return ProcPanoramiXGetState(client); case X_PanoramiXGetScreenCount: return ProcPanoramiXGetScreenCount(client); case X_PanoramiXGetScreenSize: return ProcPanoramiXGetScreenSize(client); case X_XineramaIsActive: return ProcXineramaIsActive(client); case X_XineramaQueryScreens: return ProcXineramaQueryScreens(client); } return BadRequest; } #if X_BYTE_ORDER == X_LITTLE_ENDIAN #define SHIFT_L(v,s) (v) << (s) #define SHIFT_R(v,s) (v) >> (s) #else #define SHIFT_L(v,s) (v) >> (s) #define SHIFT_R(v,s) (v) << (s) #endif static void CopyBits(char *dst, int shiftL, char *src, int bytes) { /* Just get it to work. Worry about speed later */ int shiftR = 8 - shiftL; while (bytes--) { *dst |= SHIFT_L(*src, shiftL); *(dst + 1) |= SHIFT_R(*src, shiftR); dst++; src++; } } /* Caution. This doesn't support 2 and 4 bpp formats. We expect 1 bpp and planar data to be already cleared when presented to this function */ void XineramaGetImageData(DrawablePtr *pDrawables, int left, int top, int width, int height, unsigned int format, unsigned long planemask, char *data, int pitch, Bool isRoot) { RegionRec SrcRegion, ScreenRegion, GrabRegion; BoxRec SrcBox, *pbox; int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth; DrawablePtr pDraw = pDrawables[0]; char *ScratchMem = NULL; size = 0; /* find box in logical screen space */ SrcBox.x1 = left; SrcBox.y1 = top; if (!isRoot) { SrcBox.x1 += pDraw->x + screenInfo.screens[0]->x; SrcBox.y1 += pDraw->y + screenInfo.screens[0]->y; } SrcBox.x2 = SrcBox.x1 + width; SrcBox.y2 = SrcBox.y1 + height; RegionInit(&SrcRegion, &SrcBox, 1); RegionNull(&GrabRegion); depth = (format == XYPixmap) ? 1 : pDraw->depth; FOR_NSCREENS(i) { BoxRec TheBox; ScreenPtr pScreen; pDraw = pDrawables[i]; pScreen = pDraw->pScreen; TheBox.x1 = pScreen->x; TheBox.x2 = TheBox.x1 + pScreen->width; TheBox.y1 = pScreen->y; TheBox.y2 = TheBox.y1 + pScreen->height; RegionInit(&ScreenRegion, &TheBox, 1); inOut = RegionContainsRect(&ScreenRegion, &SrcBox); if (inOut == rgnPART) RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion); RegionUninit(&ScreenRegion); if (inOut == rgnIN) { (*pScreen->GetImage) (pDraw, SrcBox.x1 - pDraw->x - screenInfo.screens[i]->x, SrcBox.y1 - pDraw->y - screenInfo.screens[i]->y, width, height, format, planemask, data); break; } else if (inOut == rgnOUT) continue; nbox = RegionNumRects(&GrabRegion); if (nbox) { pbox = RegionRects(&GrabRegion); while (nbox--) { w = pbox->x2 - pbox->x1; h = pbox->y2 - pbox->y1; ScratchPitch = PixmapBytePad(w, depth); sizeNeeded = ScratchPitch * h; if (sizeNeeded > size) { char *tmpdata = ScratchMem; ScratchMem = realloc(ScratchMem, sizeNeeded); if (ScratchMem) size = sizeNeeded; else { ScratchMem = tmpdata; break; } } x = pbox->x1 - pDraw->x - screenInfo.screens[i]->x; y = pbox->y1 - pDraw->y - screenInfo.screens[i]->y; (*pScreen->GetImage) (pDraw, x, y, w, h, format, planemask, ScratchMem); /* copy the memory over */ if (depth == 1) { int k, shift, leftover, index, index2; x = pbox->x1 - SrcBox.x1; y = pbox->y1 - SrcBox.y1; shift = x & 7; x >>= 3; leftover = w & 7; w >>= 3; /* clean up the edge */ if (leftover) { int mask = (1 << leftover) - 1; for (j = h, k = w; j--; k += ScratchPitch) ScratchMem[k] &= mask; } for (j = 0, index = (pitch * y) + x, index2 = 0; j < h; j++, index += pitch, index2 += ScratchPitch) { if (w) { if (!shift) memcpy(data + index, ScratchMem + index2, w); else CopyBits(data + index, shift, ScratchMem + index2, w); } if (leftover) { data[index + w] |= SHIFT_L(ScratchMem[index2 + w], shift); if ((shift + leftover) > 8) data[index + w + 1] |= SHIFT_R(ScratchMem[index2 + w], (8 - shift)); } } } else { j = BitsPerPixel(depth) >> 3; x = (pbox->x1 - SrcBox.x1) * j; y = pbox->y1 - SrcBox.y1; w *= j; for (j = 0; j < h; j++) { memcpy(data + (pitch * (y + j)) + x, ScratchMem + (ScratchPitch * j), w); } } pbox++; } RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion); if (!RegionNotEmpty(&SrcRegion)) break; } } free(ScratchMem); RegionUninit(&SrcRegion); RegionUninit(&GrabRegion); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xf86bigfontsrv.h������������������������������������������������������������0000664�0001751�0001751�00000002465�12274325511�015022� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2010 Yaakov Selkowitz * * 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 _XF86BIGFONTSRV_H_ #define _XF86BIGFONTSRV_H_ #include <X11/fonts/font.h> extern void XF86BigfontFreeFontShm(FontPtr); extern void XF86BigfontCleanup(void); #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xvmc.c����������������������������������������������������������������������0000664�0001751�0001751�00000054270�12274325511�013074� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "resource.h" #include "scrnintstr.h" #include "extnsionst.h" #include "extinit.h" #include "servermd.h" #include <X11/Xfuncproto.h> #include "xvdix.h" #include <X11/extensions/XvMC.h> #include <X11/extensions/Xvproto.h> #include <X11/extensions/XvMCproto.h> #include "xvmcext.h" #include "protocol-versions.h" #ifdef HAS_XVMCSHM #include <sys/ipc.h> #include <sys/types.h> #include <sys/shm.h> #endif /* HAS_XVMCSHM */ #define DR_CLIENT_DRIVER_NAME_SIZE 48 #define DR_BUSID_SIZE 48 static DevPrivateKeyRec XvMCScreenKeyRec; #define XvMCScreenKey (&XvMCScreenKeyRec) static Bool XvMCInUse; int XvMCReqCode; int XvMCEventBase; static RESTYPE XvMCRTContext; static RESTYPE XvMCRTSurface; static RESTYPE XvMCRTSubpicture; int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL; typedef struct { int num_adaptors; XvMCAdaptorPtr adaptors; CloseScreenProcPtr CloseScreen; char clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE]; char busID[DR_BUSID_SIZE]; int major; int minor; int patchLevel; } XvMCScreenRec, *XvMCScreenPtr; #define XVMC_GET_PRIVATE(pScreen) \ (XvMCScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, XvMCScreenKey)) static int XvMCDestroyContextRes(void *data, XID id) { XvMCContextPtr pContext = (XvMCContextPtr) data; pContext->refcnt--; if (!pContext->refcnt) { XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num].DestroyContext) (pContext); free(pContext); } return Success; } static int XvMCDestroySurfaceRes(void *data, XID id) { XvMCSurfacePtr pSurface = (XvMCSurfacePtr) data; XvMCContextPtr pContext = pSurface->context; XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface) (pSurface); free(pSurface); XvMCDestroyContextRes((void *) pContext, pContext->context_id); return Success; } static int XvMCDestroySubpictureRes(void *data, XID id) { XvMCSubpicturePtr pSubpict = (XvMCSubpicturePtr) data; XvMCContextPtr pContext = pSubpict->context; XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture) (pSubpict); free(pSubpict); XvMCDestroyContextRes((void *) pContext, pContext->context_id); return Success; } static int ProcXvMCQueryVersion(ClientPtr client) { 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); WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep); return Success; } static int ProcXvMCListSurfaceTypes(ClientPtr client) { XvPortPtr pPort; int i; XvMCScreenPtr pScreenPriv; xvmcListSurfaceTypesReply rep; xvmcSurfaceInfo info; XvMCAdaptorPtr adaptor = NULL; XvMCSurfaceInfoPtr surface; int num_surfaces; REQUEST(xvmcListSurfaceTypesReq); REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); if (XvMCInUse) { /* any adaptors at all */ ScreenPtr pScreen = pPort->pAdaptor->pScreen; if ((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */ for (i = 0; i < pScreenPriv->num_adaptors; i++) { if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) { adaptor = &(pScreenPriv->adaptors[i]); break; } } } } 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), &rep); 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; info.max_width = surface->max_width; info.max_height = surface->max_height; info.subpicture_max_width = surface->subpicture_max_width; info.subpicture_max_height = surface->subpicture_max_height; info.mc_type = surface->mc_type; info.flags = surface->flags; WriteToClient(client, sizeof(xvmcSurfaceInfo), &info); } return Success; } static int ProcXvMCCreateContext(ClientPtr client) { XvPortPtr pPort; CARD32 *data = NULL; int dwords = 0; int i, result, adapt_num = -1; ScreenPtr pScreen; XvMCContextPtr pContext; XvMCScreenPtr pScreenPriv; XvMCAdaptorPtr adaptor = NULL; XvMCSurfaceInfoPtr surface = NULL; xvmcCreateContextReply rep; REQUEST(xvmcCreateContextReq); REQUEST_SIZE_MATCH(xvmcCreateContextReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); pScreen = pPort->pAdaptor->pScreen; if (!XvMCInUse) /* no XvMC adaptors */ return BadMatch; if (!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */ return BadMatch; for (i = 0; i < pScreenPriv->num_adaptors; i++) { if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) { adaptor = &(pScreenPriv->adaptors[i]); adapt_num = i; break; } } if (adapt_num < 0) /* none this port */ return BadMatch; for (i = 0; i < adaptor->num_surfaces; i++) { if (adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) { surface = adaptor->surfaces[i]; break; } } /* adaptor doesn't support this suface_type_id */ if (!surface) return BadMatch; if ((stuff->width > surface->max_width) || (stuff->height > surface->max_height)) return BadValue; if (!(pContext = malloc(sizeof(XvMCContextRec)))) { return BadAlloc; } pContext->pScreen = pScreen; pContext->adapt_num = adapt_num; pContext->context_id = stuff->context_id; pContext->surface_type_id = stuff->surface_type_id; pContext->width = stuff->width; pContext->height = stuff->height; pContext->flags = stuff->flags; pContext->refcnt = 1; result = (*adaptor->CreateContext) (pPort, pContext, &dwords, &data); if (result != Success) { free(pContext); return result; } 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), &rep); if (dwords) WriteToClient(client, dwords << 2, data); AddResource(pContext->context_id, XvMCRTContext, pContext); free(data); return Success; } static int ProcXvMCDestroyContext(ClientPtr client) { void *val; int rc; REQUEST(xvmcDestroyContextReq); REQUEST_SIZE_MATCH(xvmcDestroyContextReq); rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->context_id, RT_NONE); return Success; } static int ProcXvMCCreateSurface(ClientPtr client) { CARD32 *data = NULL; int dwords = 0; int result; XvMCContextPtr pContext; XvMCSurfacePtr pSurface; XvMCScreenPtr pScreenPriv; xvmcCreateSurfaceReply rep; REQUEST(xvmcCreateSurfaceReq); REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq); result = dixLookupResourceByType((void **) &pContext, stuff->context_id, XvMCRTContext, client, DixUseAccess); if (result != Success) return result; pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); if (!(pSurface = malloc(sizeof(XvMCSurfaceRec)))) return BadAlloc; pSurface->surface_id = stuff->surface_id; pSurface->surface_type_id = pContext->surface_type_id; pSurface->context = pContext; result = (*pScreenPriv->adaptors[pContext->adapt_num].CreateSurface) (pSurface, &dwords, &data); if (result != Success) { free(pSurface); return result; } rep = (xvmcCreateSurfaceReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = dwords }; WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep); if (dwords) WriteToClient(client, dwords << 2, data); AddResource(pSurface->surface_id, XvMCRTSurface, pSurface); free(data); pContext->refcnt++; return Success; } static int ProcXvMCDestroySurface(ClientPtr client) { void *val; int rc; REQUEST(xvmcDestroySurfaceReq); REQUEST_SIZE_MATCH(xvmcDestroySurfaceReq); rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->surface_id, RT_NONE); return Success; } static int ProcXvMCCreateSubpicture(ClientPtr client) { Bool image_supported = FALSE; CARD32 *data = NULL; int i, result, dwords = 0; XvMCContextPtr pContext; XvMCSubpicturePtr pSubpicture; XvMCScreenPtr pScreenPriv; xvmcCreateSubpictureReply rep; XvMCAdaptorPtr adaptor; XvMCSurfaceInfoPtr surface = NULL; REQUEST(xvmcCreateSubpictureReq); REQUEST_SIZE_MATCH(xvmcCreateSubpictureReq); result = dixLookupResourceByType((void **) &pContext, stuff->context_id, XvMCRTContext, client, DixUseAccess); if (result != Success) return result; pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); adaptor = &(pScreenPriv->adaptors[pContext->adapt_num]); /* find which surface this context supports */ for (i = 0; i < adaptor->num_surfaces; i++) { if (adaptor->surfaces[i]->surface_type_id == pContext->surface_type_id) { surface = adaptor->surfaces[i]; break; } } if (!surface) return BadMatch; /* make sure this surface supports that xvimage format */ if (!surface->compatible_subpictures) return BadMatch; for (i = 0; i < surface->compatible_subpictures->num_xvimages; i++) { if (surface->compatible_subpictures->xvimage_ids[i] == stuff->xvimage_id) { image_supported = TRUE; break; } } if (!image_supported) return BadMatch; /* make sure the size is OK */ if ((stuff->width > surface->subpicture_max_width) || (stuff->height > surface->subpicture_max_height)) return BadValue; if (!(pSubpicture = malloc(sizeof(XvMCSubpictureRec)))) return BadAlloc; pSubpicture->subpicture_id = stuff->subpicture_id; pSubpicture->xvimage_id = stuff->xvimage_id; pSubpicture->width = stuff->width; pSubpicture->height = stuff->height; pSubpicture->num_palette_entries = 0; /* overwritten by DDX */ pSubpicture->entry_bytes = 0; /* overwritten by DDX */ pSubpicture->component_order[0] = 0; /* overwritten by DDX */ pSubpicture->component_order[1] = 0; pSubpicture->component_order[2] = 0; pSubpicture->component_order[3] = 0; pSubpicture->context = pContext; result = (*pScreenPriv->adaptors[pContext->adapt_num]. CreateSubpicture) (pSubpicture, &dwords, &data); if (result != Success) { 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] }; WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep); if (dwords) WriteToClient(client, dwords << 2, data); AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture); free(data); pContext->refcnt++; return Success; } static int ProcXvMCDestroySubpicture(ClientPtr client) { void *val; int rc; REQUEST(xvmcDestroySubpictureReq); REQUEST_SIZE_MATCH(xvmcDestroySubpictureReq); rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture, client, DixDestroyAccess); if (rc != Success) return rc; FreeResource(stuff->subpicture_id, RT_NONE); return Success; } static int ProcXvMCListSubpictureTypes(ClientPtr client) { XvPortPtr pPort; xvmcListSubpictureTypesReply rep; XvMCScreenPtr pScreenPriv; ScreenPtr pScreen; XvMCAdaptorPtr adaptor = NULL; XvMCSurfaceInfoPtr surface = NULL; xvImageFormatInfo info; XvImagePtr pImage; int i, j; REQUEST(xvmcListSubpictureTypesReq); REQUEST_SIZE_MATCH(xvmcListSubpictureTypesReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); pScreen = pPort->pAdaptor->pScreen; if (!dixPrivateKeyRegistered(XvMCScreenKey)) return BadMatch; /* No XvMC adaptors */ if (!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) return BadMatch; /* None this screen */ for (i = 0; i < pScreenPriv->num_adaptors; i++) { if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) { adaptor = &(pScreenPriv->adaptors[i]); break; } } if (!adaptor) return BadMatch; for (i = 0; i < adaptor->num_surfaces; i++) { if (adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) { surface = adaptor->surfaces[i]; break; } } if (!surface) return BadMatch; 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), &rep); for (i = 0; i < rep.num; i++) { pImage = NULL; for (j = 0; j < adaptor->num_subpictures; j++) { if (surface->compatible_subpictures->xvimage_ids[i] == adaptor->subpictures[j]->id) { pImage = adaptor->subpictures[j]; break; } } if (!pImage) return BadImplementation; info.id = pImage->id; info.type = pImage->type; info.byte_order = pImage->byte_order; memcpy(&info.guid, pImage->guid, 16); info.bpp = pImage->bits_per_pixel; info.num_planes = pImage->num_planes; info.depth = pImage->depth; info.red_mask = pImage->red_mask; info.green_mask = pImage->green_mask; info.blue_mask = pImage->blue_mask; info.format = pImage->format; info.y_sample_bits = pImage->y_sample_bits; info.u_sample_bits = pImage->u_sample_bits; info.v_sample_bits = pImage->v_sample_bits; info.horz_y_period = pImage->horz_y_period; info.horz_u_period = pImage->horz_u_period; info.horz_v_period = pImage->horz_v_period; info.vert_y_period = pImage->vert_y_period; info.vert_u_period = pImage->vert_u_period; 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), &info); } return Success; } static int ProcXvMCGetDRInfo(ClientPtr client) { xvmcGetDRInfoReply rep; XvPortPtr pPort; ScreenPtr pScreen; XvMCScreenPtr pScreenPriv; #ifdef HAS_XVMCSHM volatile CARD32 *patternP; #endif REQUEST(xvmcGetDRInfoReq); REQUEST_SIZE_MATCH(xvmcGetDRInfoReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); pScreen = pPort->pAdaptor->pScreen; pScreenPriv = XVMC_GET_PRIVATE(pScreen); 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; rep.busIDLen <<= 2; /* * Read back to the client what she has put in the shared memory * segment she prepared for us. */ #ifdef HAS_XVMCSHM patternP = (CARD32 *) shmat(stuff->shmKey, NULL, SHM_RDONLY); if (-1 != (long) patternP) { volatile CARD32 *patternC = patternP; int i; CARD32 magic = stuff->magic; rep.isLocal = 1; i = 1024 / sizeof(CARD32); while (i--) { if (*patternC++ != magic) { rep.isLocal = 0; break; } magic = ~magic; } shmdt((char *) patternP); } #endif /* HAS_XVMCSHM */ WriteToClient(client, sizeof(xvmcGetDRInfoReply), &rep); if (rep.length) { WriteToClient(client, rep.nameLen, pScreenPriv->clientDriverName); WriteToClient(client, rep.busIDLen, pScreenPriv->busID); } return Success; } int (*ProcXvMCVector[xvmcNumRequest]) (ClientPtr) = { ProcXvMCQueryVersion, ProcXvMCListSurfaceTypes, ProcXvMCCreateContext, ProcXvMCDestroyContext, ProcXvMCCreateSurface, ProcXvMCDestroySurface, ProcXvMCCreateSubpicture, ProcXvMCDestroySubpicture, ProcXvMCListSubpictureTypes, ProcXvMCGetDRInfo}; static int ProcXvMCDispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data < xvmcNumRequest) return (*ProcXvMCVector[stuff->data]) (client); else return BadRequest; } static int SProcXvMCDispatch(ClientPtr client) { /* We only support local */ return BadImplementation; } void XvMCExtensionInit(void) { ExtensionEntry *extEntry; if (!dixPrivateKeyRegistered(XvMCScreenKey)) return; if (!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes, "XvMCRTContext"))) return; if (!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes, "XvMCRTSurface"))) return; if (!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes, "XvMCRTSubpicture"))) return; extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors, ProcXvMCDispatch, SProcXvMCDispatch, NULL, StandardMinorOpcode); if (!extEntry) return; XvMCReqCode = extEntry->base; XvMCEventBase = extEntry->eventBase; SetResourceTypeErrorValue(XvMCRTContext, extEntry->errorBase + XvMCBadContext); SetResourceTypeErrorValue(XvMCRTSurface, extEntry->errorBase + XvMCBadSurface); SetResourceTypeErrorValue(XvMCRTSubpicture, extEntry->errorBase + XvMCBadSubpicture); } static Bool XvMCCloseScreen(ScreenPtr pScreen) { XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; free(pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } int XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt) { XvMCScreenPtr pScreenPriv; if (!dixRegisterPrivateKey(&XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) return BadAlloc; if (!(pScreenPriv = malloc(sizeof(XvMCScreenRec)))) return BadAlloc; dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv); pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = XvMCCloseScreen; pScreenPriv->num_adaptors = num; pScreenPriv->adaptors = pAdapt; pScreenPriv->clientDriverName[0] = 0; pScreenPriv->busID[0] = 0; pScreenPriv->major = 0; pScreenPriv->minor = 0; pScreenPriv->patchLevel = 0; XvMCInUse = TRUE; return Success; } XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id) { XvImagePtr pImage = NULL; ScreenPtr pScreen = pPort->pAdaptor->pScreen; XvMCScreenPtr pScreenPriv; XvMCAdaptorPtr adaptor = NULL; int i; if (!dixPrivateKeyRegistered(XvMCScreenKey)) return NULL; if (!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) return NULL; for (i = 0; i < pScreenPriv->num_adaptors; i++) { if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) { adaptor = &(pScreenPriv->adaptors[i]); break; } } if (!adaptor) return NULL; for (i = 0; i < adaptor->num_subpictures; i++) { if (adaptor->subpictures[i]->id == id) { pImage = adaptor->subpictures[i]; break; } } return pImage; } int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name, const char *busID, int major, int minor, int patchLevel) { XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen); strlcpy(pScreenPriv->clientDriverName, name, DR_CLIENT_DRIVER_NAME_SIZE); strlcpy(pScreenPriv->busID, busID, DR_BUSID_SIZE); pScreenPriv->major = major; pScreenPriv->minor = minor; pScreenPriv->patchLevel = patchLevel; return Success; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/securitysrv.h���������������������������������������������������������������0000664�0001751�0001751�00000006010�12274325511�014513� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* Xserver internals for Security extension - moved here from _SECURITY_SERVER section of <X11/extensions/security.h> */ #ifndef _SECURITY_SRV_H #define _SECURITY_SRV_H /* Allow client side portions of <X11/extensions/security.h> to compile */ #ifndef Status #define Status int #define NEED_UNDEF_Status #endif #ifndef Display #define Display void #define NEED_UNDEF_Display #endif #include <X11/extensions/secur.h> #ifdef NEED_UNDEF_Status #undef Status #undef NEED_UNDEF_Status #endif #ifdef NEED_UNDEF_Display #undef Display #undef NEED_UNDEF_Display #endif #include "input.h" /* for DeviceIntPtr */ #include "property.h" /* for PropertyPtr */ #include "pixmap.h" /* for DrawablePtr */ #include "resource.h" /* for RESTYPE */ /* resource type to pass in LookupIDByType for authorizations */ extern RESTYPE SecurityAuthorizationResType; /* this is what we store for an authorization */ typedef struct { XID id; /* resource ID */ CARD32 timeout; /* how long to live in seconds after refcnt == 0 */ unsigned int trustLevel; /* trusted/untrusted */ XID group; /* see embedding extension */ unsigned int refcnt; /* how many clients connected with this auth */ unsigned int secondsRemaining; /* overflow time amount for >49 days */ OsTimerPtr timer; /* timer for this auth */ struct _OtherClients *eventClients; /* clients wanting events */ } SecurityAuthorizationRec, *SecurityAuthorizationPtr; typedef struct { XID group; /* the group that was sent in GenerateAuthorization */ Bool valid; /* did anyone recognize it? if so, set to TRUE */ } SecurityValidateGroupInfoRec; /* Give this value or higher to the -audit option to get security messages */ #define SECURITY_AUDIT_LEVEL 4 #endif /* _SECURITY_SRV_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/Makefile.in�����������������������������������������������������������������0000664�0001751�0001751�00000102344�12466505427�014025� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @MITSHM_TRUE@am__append_1 = $(MITSHM_SRCS) @XV_TRUE@am__append_2 = $(XV_SRCS) @RES_TRUE@am__append_3 = $(RES_SRCS) @SCREENSAVER_TRUE@am__append_4 = $(SCREENSAVER_SRCS) @XINERAMA_TRUE@am__append_5 = $(XINERAMA_SRCS) @XINERAMA_TRUE@@XORG_TRUE@am__append_6 = panoramiXsrv.h panoramiX.h @XACE_TRUE@am__append_7 = $(XACE_SRCS) @XACE_TRUE@@XORG_TRUE@am__append_8 = xace.h xacestr.h @XSELINUX_TRUE@am__append_9 = $(XSELINUX_SRCS) @XSELINUX_TRUE@am__append_10 = $(SELINUX_LIBS) @XCSECURITY_TRUE@am__append_11 = $(XCSECURITY_SRCS) @XF86BIGFONT_TRUE@am__append_12 = $(BIGFONT_SRCS) @DPMSExtension_TRUE@am__append_13 = $(DPMS_SRCS) subdir = Xext DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = @XSELINUX_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) 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 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 = 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) $(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 = libXextdpmsstubs_la_LIBADD = am_libXextdpmsstubs_la_OBJECTS = dpmsstubs.lo libXextdpmsstubs_la_OBJECTS = $(am_libXextdpmsstubs_la_OBJECTS) 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 = $(libXext_la_SOURCES) $(libXextdpmsstubs_la_SOURCES) DIST_SOURCES = $(am__libXext_la_SOURCES_DIST) \ $(libXextdpmsstubs_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = xvdix.h xvmcext.h geext.h geint.h shmint.h \ syncsdk.h panoramiXsrv.h panoramiX.h xace.h xacestr.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libXext.la libXextdpmsstubs.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) # 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_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 # MIT Shared Memory extension MITSHM_SRCS = shm.c shmint.h # XVideo extension 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 = hashtable.c hashtable.h xres.c # MIT ScreenSaver extension SCREENSAVER_SRCS = saver.c # Xinerama extension: making multiple video devices act as one virtual screen XINERAMA_SRCS = panoramiX.c panoramiX.h panoramiXh.h panoramiXsrv.h panoramiXprocs.c panoramiXSwap.c # X-ACE extension: provides hooks for building security policy extensions # like XC-Security, X-SELinux & XTSol XACE_SRCS = xace.c xace.h xacestr.h # SELinux extension: provides SELinux policy support for X objects # requires X-ACE extension XSELINUX_SRCS = xselinux_ext.c xselinux_hooks.c xselinux_label.c xselinux.h xselinuxint.h # Security extension: multi-level security to protect clients from each other XCSECURITY_SRCS = security.c securitysrv.h # XF86 Big Font extension BIGFONT_SRCS = xf86bigfont.c xf86bigfontsrv.h # DPMS extension 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) libXext_la_LIBADD = $(BUILTIN_LIBS) libXextdpmsstubs_la_SOURCES = dpmsstubs.c EXTRA_DIST = \ $(MITSHM_SRCS) \ $(XV_SRCS) \ $(RES_SRCS) \ $(SCREENSAVER_SRCS) \ $(XACE_SRCS) \ $(XCSECURITY_SRCS) \ $(XSELINUX_SRCS) \ $(XINERAMA_SRCS) \ $(BIGFONT_SRCS) \ $(DPMS_SRCS) \ $(GE_SRCS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 Xext/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Xext/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libXext.la: $(libXext_la_OBJECTS) $(libXext_la_DEPENDENCIES) $(EXTRA_libXext_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libXext_la_OBJECTS) $(libXext_la_LIBADD) $(LIBS) libXextdpmsstubs.la: $(libXextdpmsstubs_la_OBJECTS) $(libXextdpmsstubs_la_DEPENDENCIES) $(EXTRA_libXextdpmsstubs_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libXextdpmsstubs_la_OBJECTS) $(libXextdpmsstubs_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @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)/dpmsstubs.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleepuntil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcmisc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86bigfont.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xres.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xselinux_ext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xselinux_hooks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xselinux_label.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvdisp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvmain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvmc.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/panoramiXSwap.c�������������������������������������������������������������0000664�0001751�0001751�00000007650�12274325511�014710� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdio.h> #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "cursor.h" #include "cursorstr.h" #include "extnsionst.h" #include "dixstruct.h" #include "gc.h" #include "gcstruct.h" #include "scrnintstr.h" #include "window.h" #include "windowstr.h" #include "pixmapstr.h" #include "panoramiX.h" #include <X11/extensions/panoramiXproto.h> #include "panoramiXsrv.h" #include "globals.h" #include "panoramiXh.h" static int SProcPanoramiXQueryVersion(ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); return ProcPanoramiXQueryVersion(client); } static int SProcPanoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); swapl(&stuff->window); return ProcPanoramiXGetState(client); } static int SProcPanoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); swapl(&stuff->window); return ProcPanoramiXGetScreenCount(client); } static int SProcPanoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); swapl(&stuff->window); swapl(&stuff->screen); return ProcPanoramiXGetScreenSize(client); } static int SProcXineramaIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return ProcXineramaIsActive(client); } static int SProcXineramaQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return ProcXineramaQueryScreens(client); } int SProcPanoramiXDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_PanoramiXQueryVersion: return SProcPanoramiXQueryVersion(client); case X_PanoramiXGetState: return SProcPanoramiXGetState(client); case X_PanoramiXGetScreenCount: return SProcPanoramiXGetScreenCount(client); case X_PanoramiXGetScreenSize: return SProcPanoramiXGetScreenSize(client); case X_XineramaIsActive: return SProcXineramaIsActive(client); case X_XineramaQueryScreens: return SProcXineramaQueryScreens(client); } return BadRequest; } ����������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/sleepuntil.h����������������������������������������������������������������0000664�0001751�0001751�00000003416�12274325511�014304� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project shall * not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from the * XFree86 Project. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef _SLEEPUNTIL_H_ #define _SLEEPUNTIL_H_ 1 #include "dix.h" extern int ClientSleepUntil(ClientPtr client, TimeStamp *revive, void (*notifyFunc) (ClientPtr /* client */ , void * /* closure */ ), void *Closure); #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xtest.c���������������������������������������������������������������������0000664�0001751�0001751�00000047214�12274325511�013266� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1992, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include <X11/Xatom.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "windowstr.h" #include "inputstr.h" #include "scrnintstr.h" #include "dixevents.h" #include "sleepuntil.h" #include "mi.h" #include "xkbsrv.h" #include "xkbstr.h" #include <X11/extensions/xtestproto.h> #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "mipointer.h" #include "xserver-properties.h" #include "exevents.h" #include "eventstr.h" #include "inpututils.h" #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 * other's memory */ static InternalEvent *xtest_evlist; /** * xtestpointer * is the virtual pointer for XTest. It is the first slave * device of the VCP. * xtestkeyboard * is the virtual keyboard for XTest. It is the first slave * device of the VCK * * Neither of these devices can be deleted. */ DeviceIntPtr xtestpointer, xtestkeyboard; #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif static int XTestSwapFakeInput(ClientPtr /* client */ , xReq * /* req */ ); static int ProcXTestGetVersion(ClientPtr client) { xXTestGetVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = XTestMajorVersion, .minorVersion = XTestMinorVersion }; REQUEST_SIZE_MATCH(xXTestGetVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xXTestGetVersionReply), &rep); return Success; } static int ProcXTestCompareCursor(ClientPtr client) { REQUEST(xXTestCompareCursorReq); xXTestCompareCursorReply rep; WindowPtr pWin; CursorPtr pCursor; int rc; DeviceIntPtr ptr = PickPointer(client); REQUEST_SIZE_MATCH(xXTestCompareCursorReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; if (!ptr) return BadAccess; if (stuff->cursor == None) pCursor = NullCursor; else if (stuff->cursor == XTestCurrentCursor) pCursor = GetSpriteCursor(ptr); else { rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, RT_CURSOR, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->cursor; return rc; } } rep = (xXTestCompareCursorReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .same = (wCursor(pWin) == pCursor) }; if (client->swapped) { swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(xXTestCompareCursorReply), &rep); return Success; } static int ProcXTestFakeInput(ClientPtr client) { REQUEST(xXTestFakeInputReq); int nev, n, type, rc; xEvent *ev; DeviceIntPtr dev = NULL; WindowPtr root; Bool extension = FALSE; ValuatorMask mask; int valuators[MAX_VALUATORS] = { 0 }; int numValuators = 0; int firstValuator = 0; int nevents = 0; int i; int base = 0; int flags = 0; int need_ptr_update = 1; nev = (stuff->length << 2) - sizeof(xReq); if ((nev % sizeof(xEvent)) || !nev) return BadLength; nev /= sizeof(xEvent); UpdateCurrentTime(); ev = (xEvent *) &((xReq *) stuff)[1]; type = ev->u.u.type & 0177; if (type >= EXTENSION_EVENT_BASE) { extension = TRUE; /* check device */ rc = dixLookupDevice(&dev, stuff->deviceid & 0177, client, DixWriteAccess); if (rc != Success) { client->errorValue = stuff->deviceid & 0177; return rc; } /* check type */ type -= DeviceValuator; switch (type) { case XI_DeviceKeyPress: case XI_DeviceKeyRelease: if (!dev->key) { client->errorValue = ev->u.u.type; return BadValue; } break; case XI_DeviceButtonPress: case XI_DeviceButtonRelease: if (!dev->button) { client->errorValue = ev->u.u.type; return BadValue; } break; case XI_DeviceMotionNotify: if (!dev->valuator) { client->errorValue = ev->u.u.type; return BadValue; } break; case XI_ProximityIn: case XI_ProximityOut: if (!dev->proximity) { client->errorValue = ev->u.u.type; return BadValue; } break; default: client->errorValue = ev->u.u.type; return BadValue; } /* check validity */ if (nev == 1 && type == XI_DeviceMotionNotify) return BadLength; /* DevMotion must be followed by DevValuator */ if (type == XI_DeviceMotionNotify) { firstValuator = ((deviceValuator *) (ev + 1))->first_valuator; if (firstValuator > dev->valuator->numAxes) { client->errorValue = ev->u.u.type; return BadValue; } if (ev->u.u.detail == xFalse) flags |= POINTER_ABSOLUTE; } else { firstValuator = 0; flags |= POINTER_ABSOLUTE; } if (nev > 1 && !dev->valuator) { client->errorValue = firstValuator; return BadValue; } /* check validity of valuator events */ base = firstValuator; for (n = 1; n < nev; n++) { deviceValuator *dv = (deviceValuator *) (ev + n); if (dv->type != DeviceValuator) { client->errorValue = dv->type; return BadValue; } if (dv->first_valuator != base) { client->errorValue = dv->first_valuator; return BadValue; } switch (dv->num_valuators) { case 6: valuators[base + 5] = dv->valuator5; case 5: valuators[base + 4] = dv->valuator4; case 4: valuators[base + 3] = dv->valuator3; case 3: valuators[base + 2] = dv->valuator2; case 2: valuators[base + 1] = dv->valuator1; case 1: valuators[base] = dv->valuator0; break; default: client->errorValue = dv->num_valuators; return BadValue; } base += dv->num_valuators; numValuators += dv->num_valuators; if (firstValuator + numValuators > dev->valuator->numAxes) { client->errorValue = dv->num_valuators; return BadValue; } } type = type - XI_DeviceKeyPress + KeyPress; } else { if (nev != 1) return BadLength; switch (type) { case KeyPress: case KeyRelease: dev = PickKeyboard(client); break; case ButtonPress: case ButtonRelease: dev = PickPointer(client); break; case MotionNotify: dev = PickPointer(client); valuators[0] = ev->u.keyButtonPointer.rootX; valuators[1] = ev->u.keyButtonPointer.rootY; numValuators = 2; firstValuator = 0; if (ev->u.u.detail == xFalse) flags = POINTER_ABSOLUTE | POINTER_DESKTOP; break; default: client->errorValue = ev->u.u.type; return BadValue; } /* Technically the protocol doesn't allow for BadAccess here but * this can only happen when all MDs are disabled. */ if (!dev) return BadAccess; dev = GetXTestDevice(dev); } /* If the event has a time set, wait for it to pass */ if (ev->u.keyButtonPointer.time) { TimeStamp activateTime; CARD32 ms; activateTime = currentTime; ms = activateTime.milliseconds + ev->u.keyButtonPointer.time; if (ms < activateTime.milliseconds) activateTime.months++; activateTime.milliseconds = ms; ev->u.keyButtonPointer.time = 0; /* see mbuf.c:QueueDisplayRequest (from the deprecated Multibuffer * extension) for code similar to this */ if (!ClientSleepUntil(client, &activateTime, NULL, NULL)) { return BadAlloc; } /* swap the request back so we can simply re-execute it */ if (client->swapped) { (void) XTestSwapFakeInput(client, (xReq *) stuff); swaps(&stuff->length); } ResetCurrentRequest(client); client->sequence--; return Success; } switch (type) { case KeyPress: case KeyRelease: if (!dev->key) return BadDevice; if (ev->u.u.detail < dev->key->xkbInfo->desc->min_key_code || ev->u.u.detail > dev->key->xkbInfo->desc->max_key_code) { client->errorValue = ev->u.u.detail; return BadValue; } need_ptr_update = 0; break; case MotionNotify: if (!dev->valuator) return BadDevice; if (!(extension || ev->u.keyButtonPointer.root == None)) { rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client, DixGetAttrAccess); if (rc != Success) return rc; if (root->parent) { 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; return BadValue; } /* FIXME: Xinerama! */ break; case ButtonPress: case ButtonRelease: if (!dev->button) return BadDevice; if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons) { client->errorValue = ev->u.u.detail; return BadValue; } break; } if (screenIsSaved == SCREEN_SAVER_ON) dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); switch (type) { case MotionNotify: valuator_mask_set_range(&mask, firstValuator, numValuators, valuators); nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags, &mask); break; case ButtonPress: case ButtonRelease: valuator_mask_set_range(&mask, firstValuator, numValuators, valuators); nevents = GetPointerEvents(xtest_evlist, dev, type, ev->u.u.detail, flags, &mask); break; case KeyPress: case KeyRelease: nevents = GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail, NULL); break; } for (i = 0; i < nevents; i++) mieqProcessDeviceEvent(dev, &xtest_evlist[i], miPointerGetScreen(inputInfo.pointer)); if (need_ptr_update) miPointerUpdateSprite(dev); return Success; } static int ProcXTestGrabControl(ClientPtr client) { REQUEST(xXTestGrabControlReq); REQUEST_SIZE_MATCH(xXTestGrabControlReq); if ((stuff->impervious != xTrue) && (stuff->impervious != xFalse)) { client->errorValue = stuff->impervious; return BadValue; } if (stuff->impervious) MakeClientGrabImpervious(client); else MakeClientGrabPervious(client); return Success; } static int ProcXTestDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XTestGetVersion: return ProcXTestGetVersion(client); case X_XTestCompareCursor: return ProcXTestCompareCursor(client); case X_XTestFakeInput: return ProcXTestFakeInput(client); case X_XTestGrabControl: return ProcXTestGrabControl(client); default: return BadRequest; } } static int SProcXTestGetVersion(ClientPtr client) { REQUEST(xXTestGetVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXTestGetVersionReq); swaps(&stuff->minorVersion); return ProcXTestGetVersion(client); } static int SProcXTestCompareCursor(ClientPtr client) { REQUEST(xXTestCompareCursorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXTestCompareCursorReq); swapl(&stuff->window); swapl(&stuff->cursor); return ProcXTestCompareCursor(client); } static int XTestSwapFakeInput(ClientPtr client, xReq * req) { int nev; xEvent *ev; xEvent sev; EventSwapPtr proc; nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent); for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) { /* Swap event */ proc = EventSwapVector[ev->u.u.type & 0177]; /* no swapping proc; invalid event type? */ if (!proc || proc == NotImplemented) { client->errorValue = ev->u.u.type; return BadValue; } (*proc) (ev, &sev); *ev = sev; } return Success; } static int SProcXTestFakeInput(ClientPtr client) { int n; REQUEST(xReq); swaps(&stuff->length); n = XTestSwapFakeInput(client, stuff); if (n != Success) return n; return ProcXTestFakeInput(client); } static int SProcXTestGrabControl(ClientPtr client) { REQUEST(xXTestGrabControlReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXTestGrabControlReq); return ProcXTestGrabControl(client); } static int SProcXTestDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XTestGetVersion: return SProcXTestGetVersion(client); case X_XTestCompareCursor: return SProcXTestCompareCursor(client); case X_XTestFakeInput: return SProcXTestFakeInput(client); case X_XTestGrabControl: return SProcXTestGrabControl(client); default: return BadRequest; } } /** * Allocate an virtual slave device for xtest events, this * is a slave device to inputInfo master devices */ void InitXTestDevices(void) { if (AllocXTestDevice(serverClient, "Virtual core", &xtestpointer, &xtestkeyboard, inputInfo.pointer, inputInfo.keyboard) != Success) FatalError("Failed to allocate XTest devices"); if (ActivateDevice(xtestpointer, TRUE) != Success || ActivateDevice(xtestkeyboard, TRUE) != Success) FatalError("Failed to activate XTest core devices."); if (!EnableDevice(xtestpointer, TRUE) || !EnableDevice(xtestkeyboard, TRUE)) FatalError("Failed to enable XTest core devices."); AttachDevice(NULL, xtestpointer, inputInfo.pointer); AttachDevice(NULL, xtestkeyboard, inputInfo.keyboard); } /** * Don't allow changing the XTest property. */ static int DeviceSetXTestProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, BOOL checkonly) { if (property == XIGetKnownProperty(XI_PROP_XTEST_DEVICE)) return BadAccess; return Success; } /** * Allocate a device pair that is initialised as a slave * device with properties that identify the devices as belonging * to XTest subsystem. * This only creates the pair, Activate/Enable Device * still need to be called. */ int AllocXTestDevice(ClientPtr client, const char *name, DeviceIntPtr *ptr, DeviceIntPtr *keybd, DeviceIntPtr master_ptr, DeviceIntPtr master_keybd) { int retval; char *xtestname; char dummy = 1; if (asprintf(&xtestname, "%s XTEST", name) == -1) return BadAlloc; retval = AllocDevicePair(client, xtestname, ptr, keybd, CorePointerProc, CoreKeyboardProc, FALSE); if (retval == Success) { (*ptr)->xtest_master_id = master_ptr->id; (*keybd)->xtest_master_id = master_keybd->id; XIChangeDeviceProperty(*ptr, XIGetKnownProperty(XI_PROP_XTEST_DEVICE), XA_INTEGER, 8, PropModeReplace, 1, &dummy, FALSE); XISetDevicePropertyDeletable(*ptr, XIGetKnownProperty(XI_PROP_XTEST_DEVICE), FALSE); XIRegisterPropertyHandler(*ptr, DeviceSetXTestProperty, NULL, NULL); XIChangeDeviceProperty(*keybd, XIGetKnownProperty(XI_PROP_XTEST_DEVICE), XA_INTEGER, 8, PropModeReplace, 1, &dummy, FALSE); XISetDevicePropertyDeletable(*keybd, XIGetKnownProperty(XI_PROP_XTEST_DEVICE), FALSE); XIRegisterPropertyHandler(*keybd, DeviceSetXTestProperty, NULL, NULL); } free(xtestname); return retval; } /** * If master is NULL, return TRUE if the given device is an xtest device or * FALSE otherwise. * If master is not NULL, return TRUE if the given device is this master's * xtest device. */ BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master) { if (IsMaster(dev)) return FALSE; /* deviceid 0 is reserved for XIAllDevices, non-zero mid means XTest * device */ if (master) return dev->xtest_master_id == master->id; return dev->xtest_master_id != 0; } /** * @return The X Test virtual device for the given master. */ DeviceIntPtr GetXTestDevice(DeviceIntPtr master) { DeviceIntPtr it; for (it = inputInfo.devices; it; it = it->next) { if (IsXTestDevice(it, master)) return it; } /* This only happens if master is a slave device. don't do that */ return NULL; } static void XTestExtensionTearDown(ExtensionEntry * e) { FreeEventList(xtest_evlist, GetMaximumEventsNum()); xtest_evlist = NULL; } void XTestExtensionInit(void) { AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, XTestExtensionTearDown, StandardMinorOpcode); xtest_evlist = InitEventList(GetMaximumEventsNum()); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xvdisp.h��������������������������������������������������������������������0000664�0001751�0001751�00000000105�12274325511�013425� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extern void XineramifyXv(void); extern void XvResetProcVector(void); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/dpmsproc.h������������������������������������������������������������������0000664�0001751�0001751�00000000426�12274325511�013745� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Prototypes for functions that the DDX must provide */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef _DPMSPROC_H_ #define _DPMSPROC_H_ #include "dixstruct.h" int _X_EXPORT DPMSSet(ClientPtr client, int level); Bool _X_EXPORT DPMSSupported(void); #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/saver.c���������������������������������������������������������������������0000664�0001751�0001751�00000120266�12366751547�013254� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 1992 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. * * Author: Keith Packard, MIT X Consortium */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "windowstr.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "extnsionst.h" #include "dixstruct.h" #include "resource.h" #include "opaque.h" #include <X11/extensions/saverproto.h> #include "gcstruct.h" #include "cursorstr.h" #include "colormapst.h" #include "xace.h" #include "inputstr.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #ifdef DPMSExtension #include <X11/extensions/dpmsconst.h> #endif #include "protocol-versions.h" #include <stdio.h> #include "extinit.h" static int ScreenSaverEventBase = 0; static Bool ScreenSaverHandle(ScreenPtr /* pScreen */ , int /* xstate */ , Bool /* force */ ); static Bool CreateSaverWindow(ScreenPtr /* pScreen */ ); static Bool DestroySaverWindow(ScreenPtr /* pScreen */ ); static void UninstallSaverColormap(ScreenPtr /* pScreen */ ); static void CheckScreenPrivate(ScreenPtr /* pScreen */ ); static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * /* from */ , xScreenSaverNotifyEvent * /* to */ ); static RESTYPE SuspendType; /* resource type for suspension records */ typedef struct _ScreenSaverSuspension *ScreenSaverSuspensionPtr; /* List of clients that are suspending the screensaver. */ static ScreenSaverSuspensionPtr suspendingClients = NULL; /* * clientResource is a resource ID that's added when the record is * allocated, so the record is freed and the screensaver resumed when * the client disconnects. count is the number of times the client has * requested the screensaver be suspended. */ typedef struct _ScreenSaverSuspension { ScreenSaverSuspensionPtr next; ClientPtr pClient; XID clientResource; int count; } ScreenSaverSuspensionRec; static int ScreenSaverFreeSuspend(void *value, XID id); /* * each screen has a list of clients requesting * ScreenSaverNotify events. Each client has a resource * for each screen it selects ScreenSaverNotify input for, * this resource is used to delete the ScreenSaverNotifyRec * entry from the per-screen queue. */ static RESTYPE SaverEventType; /* resource type for event masks */ typedef struct _ScreenSaverEvent *ScreenSaverEventPtr; typedef struct _ScreenSaverEvent { ScreenSaverEventPtr next; ClientPtr client; ScreenPtr screen; XID resource; CARD32 mask; } ScreenSaverEventRec; static int ScreenSaverFreeEvents(void * value, XID id); static Bool setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask); static unsigned long getEventMask(ScreenPtr pScreen, ClientPtr client); /* * when a client sets the screen saver attributes, a resource is * kept to be freed when the client exits */ static RESTYPE AttrType; /* resource type for attributes */ typedef struct _ScreenSaverAttr { ScreenPtr screen; ClientPtr client; XID resource; short x, y; unsigned short width, height, borderWidth; unsigned char class; unsigned char depth; VisualID visual; CursorPtr pCursor; PixmapPtr pBackgroundPixmap; PixmapPtr pBorderPixmap; Colormap colormap; unsigned long mask; /* no pixmaps or cursors */ unsigned long *values; } ScreenSaverAttrRec, *ScreenSaverAttrPtr; static int ScreenSaverFreeAttr(void *value, XID id); static void FreeAttrs(ScreenSaverAttrPtr pAttr); static void FreeScreenAttr(ScreenSaverAttrPtr pAttr); static void SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced); typedef struct _ScreenSaverScreenPrivate { ScreenSaverEventPtr events; ScreenSaverAttrPtr attr; Bool hasWindow; Colormap installedMap; } ScreenSaverScreenPrivateRec, *ScreenSaverScreenPrivatePtr; static ScreenSaverScreenPrivatePtr MakeScreenPrivate(ScreenPtr pScreen); static DevPrivateKeyRec ScreenPrivateKeyRec; #define ScreenPrivateKey (&ScreenPrivateKeyRec) #define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \ dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey)) #define SetScreenPrivate(s,v) \ dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v); #define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL) #define New(t) (malloc(sizeof (t))) static void CheckScreenPrivate(ScreenPtr pScreen) { SetupScreen(pScreen); if (!pPriv) return; if (!pPriv->attr && !pPriv->events && !pPriv->hasWindow && pPriv->installedMap == None) { free(pPriv); SetScreenPrivate(pScreen, NULL); pScreen->screensaver.ExternalScreenSaver = NULL; } } static ScreenSaverScreenPrivatePtr MakeScreenPrivate(ScreenPtr pScreen) { SetupScreen(pScreen); if (pPriv) return pPriv; pPriv = New(ScreenSaverScreenPrivateRec); if (!pPriv) return 0; pPriv->events = 0; pPriv->attr = 0; pPriv->hasWindow = FALSE; pPriv->installedMap = None; SetScreenPrivate(pScreen, pPriv); pScreen->screensaver.ExternalScreenSaver = ScreenSaverHandle; return pPriv; } static unsigned long getEventMask(ScreenPtr pScreen, ClientPtr client) { SetupScreen(pScreen); ScreenSaverEventPtr pEv; if (!pPriv) return 0; for (pEv = pPriv->events; pEv; pEv = pEv->next) if (pEv->client == client) return pEv->mask; return 0; } static Bool setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask) { SetupScreen(pScreen); ScreenSaverEventPtr pEv, *pPrev; if (getEventMask(pScreen, client) == mask) return TRUE; if (!pPriv) { pPriv = MakeScreenPrivate(pScreen); if (!pPriv) return FALSE; } for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next) if (pEv->client == client) break; if (mask == 0) { FreeResource(pEv->resource, SaverEventType); *pPrev = pEv->next; free(pEv); CheckScreenPrivate(pScreen); } else { if (!pEv) { pEv = New(ScreenSaverEventRec); if (!pEv) { CheckScreenPrivate(pScreen); return FALSE; } *pPrev = pEv; pEv->next = NULL; pEv->client = client; pEv->screen = pScreen; pEv->resource = FakeClientID(client->index); if (!AddResource(pEv->resource, SaverEventType, (void *) pEv)) return FALSE; } pEv->mask = mask; } return TRUE; } static void FreeAttrs(ScreenSaverAttrPtr pAttr) { PixmapPtr pPixmap; CursorPtr pCursor; if ((pPixmap = pAttr->pBackgroundPixmap) != 0) (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap); if ((pPixmap = pAttr->pBorderPixmap) != 0) (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap); if ((pCursor = pAttr->pCursor) != 0) FreeCursor(pCursor, (Cursor) 0); } static void FreeScreenAttr(ScreenSaverAttrPtr pAttr) { FreeAttrs(pAttr); free(pAttr->values); free(pAttr); } static int ScreenSaverFreeEvents(void *value, XID id) { ScreenSaverEventPtr pOld = (ScreenSaverEventPtr) value; ScreenPtr pScreen = pOld->screen; SetupScreen(pScreen); ScreenSaverEventPtr pEv, *pPrev; if (!pPriv) return TRUE; for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next) if (pEv == pOld) break; if (!pEv) return TRUE; *pPrev = pEv->next; free(pEv); CheckScreenPrivate(pScreen); return TRUE; } static int ScreenSaverFreeAttr(void *value, XID id) { ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr) value; ScreenPtr pScreen = pOldAttr->screen; SetupScreen(pScreen); if (!pPriv) return TRUE; if (pPriv->attr != pOldAttr) return TRUE; FreeScreenAttr(pOldAttr); pPriv->attr = NULL; if (pPriv->hasWindow) { dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverActive); } CheckScreenPrivate(pScreen); return TRUE; } static int ScreenSaverFreeSuspend(void *value, XID id) { ScreenSaverSuspensionPtr data = (ScreenSaverSuspensionPtr) value; ScreenSaverSuspensionPtr *prev, this; /* Unlink and free the suspension record for the client */ for (prev = &suspendingClients; (this = *prev); prev = &this->next) { if (this == data) { *prev = this->next; free(this); break; } } /* Reenable the screensaver if this was the last client suspending it. */ if (screenSaverSuspended && suspendingClients == NULL) { screenSaverSuspended = FALSE; /* The screensaver could be active, since suspending it (by design) doesn't prevent it from being forceably activated */ #ifdef DPMSExtension if (screenIsSaved != SCREEN_SAVER_ON && DPMSPowerLevel == DPMSModeOn) #else if (screenIsSaved != SCREEN_SAVER_ON) #endif { DeviceIntPtr dev; UpdateCurrentTimeIf(); nt_list_for_each_entry(dev, inputInfo.devices, next) NoticeTime(dev, currentTime); SetScreenSaverTimer(); } } return Success; } static void SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced) { ScreenSaverScreenPrivatePtr pPriv; ScreenSaverEventPtr pEv; unsigned long mask; int kind; UpdateCurrentTimeIf(); mask = ScreenSaverNotifyMask; if (state == ScreenSaverCycle) mask = ScreenSaverCycleMask; pScreen = screenInfo.screens[pScreen->myNum]; pPriv = GetScreenPrivate(pScreen); if (!pPriv) return; if (pPriv->attr) kind = ScreenSaverExternal; else if (ScreenSaverBlanking != DontPreferBlanking) kind = ScreenSaverBlanked; else kind = ScreenSaverInternal; for (pEv = pPriv->events; pEv; pEv = pEv->next) { 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); } } } static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * from, xScreenSaverNotifyEvent * to) { to->type = from->type; to->state = from->state; cpswaps(from->sequenceNumber, to->sequenceNumber); cpswapl(from->timestamp, to->timestamp); cpswapl(from->root, to->root); cpswapl(from->window, to->window); to->kind = from->kind; to->forced = from->forced; } static void UninstallSaverColormap(ScreenPtr pScreen) { SetupScreen(pScreen); ColormapPtr pCmap; int rc; if (pPriv && pPriv->installedMap != None) { rc = dixLookupResourceByType((void **) &pCmap, pPriv->installedMap, RT_COLORMAP, serverClient, DixUninstallAccess); if (rc == Success) (*pCmap->pScreen->UninstallColormap) (pCmap); pPriv->installedMap = None; CheckScreenPrivate(pScreen); } } static Bool CreateSaverWindow(ScreenPtr pScreen) { SetupScreen(pScreen); ScreenSaverStuffPtr pSaver; ScreenSaverAttrPtr pAttr; WindowPtr pWin; int result; unsigned long mask; Colormap wantMap; ColormapPtr pCmap; pSaver = &pScreen->screensaver; if (pSaver->pWindow) { pSaver->pWindow = NullWindow; FreeResource(pSaver->wid, RT_NONE); if (pPriv) { UninstallSaverColormap(pScreen); pPriv->hasWindow = FALSE; CheckScreenPrivate(pScreen); } } if (!pPriv || !(pAttr = pPriv->attr)) return FALSE; pPriv->installedMap = None; if (GrabInProgress && GrabInProgress != pAttr->client->index) return FALSE; pWin = CreateWindow(pSaver->wid, pScreen->root, pAttr->x, pAttr->y, pAttr->width, pAttr->height, pAttr->borderWidth, pAttr->class, pAttr->mask, (XID *) pAttr->values, pAttr->depth, serverClient, pAttr->visual, &result); if (!pWin) return FALSE; if (!AddResource(pWin->drawable.id, RT_WINDOW, pWin)) return FALSE; mask = 0; if (pAttr->pBackgroundPixmap) { pWin->backgroundState = BackgroundPixmap; pWin->background.pixmap = pAttr->pBackgroundPixmap; pAttr->pBackgroundPixmap->refcnt++; mask |= CWBackPixmap; } if (pAttr->pBorderPixmap) { pWin->borderIsPixel = FALSE; pWin->border.pixmap = pAttr->pBorderPixmap; pAttr->pBorderPixmap->refcnt++; mask |= CWBorderPixmap; } if (pAttr->pCursor) { CursorPtr cursor; if (!pWin->optional) if (!MakeWindowOptional(pWin)) { FreeResource(pWin->drawable.id, RT_NONE); return FALSE; } cursor = RefCursor(pAttr->pCursor); if (pWin->optional->cursor) FreeCursor(pWin->optional->cursor, (Cursor) 0); pWin->optional->cursor = cursor; pWin->cursorIsNone = FALSE; CheckWindowOptionalNeed(pWin); mask |= CWCursor; } if (mask) (*pScreen->ChangeWindowAttributes) (pWin, mask); if (pAttr->colormap != None) (void) ChangeWindowAttributes(pWin, CWColormap, &pAttr->colormap, serverClient); MapWindow(pWin, serverClient); pPriv->hasWindow = TRUE; pSaver->pWindow = pWin; /* check and install our own colormap if it isn't installed now */ wantMap = wColormap(pWin); if (wantMap == None || IsMapInstalled(wantMap, pWin)) return TRUE; result = dixLookupResourceByType((void **) &pCmap, wantMap, RT_COLORMAP, serverClient, DixInstallAccess); if (result != Success) return TRUE; pPriv->installedMap = wantMap; (*pCmap->pScreen->InstallColormap) (pCmap); return TRUE; } static Bool DestroySaverWindow(ScreenPtr pScreen) { SetupScreen(pScreen); ScreenSaverStuffPtr pSaver; if (!pPriv || !pPriv->hasWindow) return FALSE; pSaver = &pScreen->screensaver; if (pSaver->pWindow) { pSaver->pWindow = NullWindow; FreeResource(pSaver->wid, RT_NONE); } pPriv->hasWindow = FALSE; CheckScreenPrivate(pScreen); UninstallSaverColormap(pScreen); return TRUE; } static Bool ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force) { int state = 0; Bool ret = FALSE; ScreenSaverScreenPrivatePtr pPriv; switch (xstate) { case SCREEN_SAVER_ON: state = ScreenSaverOn; ret = CreateSaverWindow(pScreen); break; case SCREEN_SAVER_OFF: state = ScreenSaverOff; ret = DestroySaverWindow(pScreen); break; case SCREEN_SAVER_CYCLE: state = ScreenSaverCycle; pPriv = GetScreenPrivate(pScreen); if (pPriv && pPriv->hasWindow) ret = TRUE; } #ifdef PANORAMIX if (noPanoramiXExtension || !pScreen->myNum) #endif SendScreenSaverNotify(pScreen, state, force); return ret; } static int ProcScreenSaverQueryVersion(ClientPtr client) { xScreenSaverQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_SAVER_MAJOR_VERSION, .minorVersion = SERVER_SAVER_MINOR_VERSION }; REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep); return Success; } static int ProcScreenSaverQueryInfo(ClientPtr client) { REQUEST(xScreenSaverQueryInfoReq); xScreenSaverQueryInfoReply rep; int rc; ScreenSaverStuffPtr pSaver; DrawablePtr pDraw; CARD32 lastInput; ScreenSaverScreenPrivatePtr pPriv; REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixGetAttrAccess); if (rc != Success) return rc; rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen, DixGetAttrAccess); if (rc != Success) return rc; pSaver = &pDraw->pScreen->screensaver; pPriv = GetScreenPrivate(pDraw->pScreen); UpdateCurrentTime(); lastInput = GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds; rep = (xScreenSaverQueryInfoReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .window = pSaver->wid }; if (screenIsSaved != SCREEN_SAVER_OFF) { rep.state = ScreenSaverOn; if (ScreenSaverTime) rep.tilOrSince = lastInput - ScreenSaverTime; else rep.tilOrSince = 0; } else { if (ScreenSaverTime) { rep.state = ScreenSaverOff; if (ScreenSaverTime < lastInput) rep.tilOrSince = 0; else rep.tilOrSince = ScreenSaverTime - lastInput; } else { rep.state = ScreenSaverDisabled; rep.tilOrSince = 0; } } rep.idle = lastInput; rep.eventMask = getEventMask(pDraw->pScreen, client); if (pPriv && pPriv->attr) rep.kind = ScreenSaverExternal; else if (ScreenSaverBlanking != DontPreferBlanking) rep.kind = ScreenSaverBlanked; else rep.kind = ScreenSaverInternal; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.window); swapl(&rep.tilOrSince); swapl(&rep.idle); swapl(&rep.eventMask); } WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), &rep); return Success; } static int ProcScreenSaverSelectInput(ClientPtr client) { REQUEST(xScreenSaverSelectInputReq); DrawablePtr pDraw; int rc; REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixGetAttrAccess); if (rc != Success) return rc; rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen, DixSetAttrAccess); if (rc != Success) return rc; if (!setEventMask(pDraw->pScreen, client, stuff->eventMask)) return BadAlloc; return Success; } static int ScreenSaverSetAttributes(ClientPtr client) { REQUEST(xScreenSaverSetAttributesReq); DrawablePtr pDraw; WindowPtr pParent; ScreenPtr pScreen; ScreenSaverScreenPrivatePtr pPriv = 0; ScreenSaverAttrPtr pAttr = 0; int ret, len, class, bw, depth; unsigned long visual; int idepth, ivisual; Bool fOK; DepthPtr pDepth; WindowOptPtr ancwopt; unsigned int *pVlist; unsigned long *values = 0; unsigned long tmask, imask; unsigned long val; Pixmap pixID; PixmapPtr pPixmap; Cursor cursorID; CursorPtr pCursor; Colormap cmap; ColormapPtr pCmap; REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixGetAttrAccess); if (ret != Success) return ret; pScreen = pDraw->pScreen; pParent = pScreen->root; ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess); if (ret != Success) return ret; len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq)); if (Ones(stuff->mask) != len) return BadLength; if (!stuff->width || !stuff->height) { client->errorValue = 0; return BadValue; } switch (class = stuff->c_class) { case CopyFromParent: case InputOnly: case InputOutput: break; default: client->errorValue = class; return BadValue; } bw = stuff->borderWidth; depth = stuff->depth; visual = stuff->visualID; /* copied directly from CreateWindow */ if (class == CopyFromParent) class = pParent->drawable.class; if ((class != InputOutput) && (class != InputOnly)) { client->errorValue = class; return BadValue; } if ((class != InputOnly) && (pParent->drawable.class == InputOnly)) return BadMatch; if ((class == InputOnly) && ((bw != 0) || (depth != 0))) return BadMatch; if ((class == InputOutput) && (depth == 0)) depth = pParent->drawable.depth; ancwopt = pParent->optional; if (!ancwopt) ancwopt = FindWindowWithOptional(pParent)->optional; if (visual == CopyFromParent) visual = ancwopt->visual; /* Find out if the depth and visual are acceptable for this Screen */ if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) { fOK = FALSE; for (idepth = 0; idepth < pScreen->numDepths; idepth++) { pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; if ((depth == pDepth->depth) || (depth == 0)) { for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) { if (visual == pDepth->vids[ivisual]) { fOK = TRUE; break; } } } } if (fOK == FALSE) return BadMatch; } if (((stuff->mask & (CWBorderPixmap | CWBorderPixel)) == 0) && (class != InputOnly) && (depth != pParent->drawable.depth)) { return BadMatch; } if (((stuff->mask & CWColormap) == 0) && (class != InputOnly) && ((visual != ancwopt->visual) || (ancwopt->colormap == None))) { return BadMatch; } /* end of errors from CreateWindow */ pPriv = GetScreenPrivate(pScreen); if (pPriv && pPriv->attr) { if (pPriv->attr->client != client) return BadAccess; } if (!pPriv) { pPriv = MakeScreenPrivate(pScreen); if (!pPriv) return FALSE; } pAttr = New(ScreenSaverAttrRec); if (!pAttr) { ret = BadAlloc; goto bail; } /* over allocate for override redirect */ pAttr->values = values = malloc((len + 1) * sizeof(unsigned long)); if (!values) { ret = BadAlloc; goto bail; } pAttr->screen = pScreen; pAttr->client = client; pAttr->x = stuff->x; pAttr->y = stuff->y; pAttr->width = stuff->width; pAttr->height = stuff->height; pAttr->borderWidth = stuff->borderWidth; pAttr->class = stuff->c_class; pAttr->depth = depth; pAttr->visual = visual; pAttr->colormap = None; pAttr->pCursor = NullCursor; pAttr->pBackgroundPixmap = NullPixmap; pAttr->pBorderPixmap = NullPixmap; /* * go through the mask, checking the values, * looking up pixmaps and cursors and hold a reference * to them. */ pAttr->mask = tmask = stuff->mask | CWOverrideRedirect; pVlist = (unsigned int *) (stuff + 1); while (tmask) { imask = lowbit(tmask); tmask &= ~imask; switch (imask) { case CWBackPixmap: pixID = (Pixmap) * pVlist; if (pixID == None) { *values++ = None; } else if (pixID == ParentRelative) { if (depth != pParent->drawable.depth) { ret = BadMatch; goto PatchUp; } *values++ = ParentRelative; } else { ret = dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (ret == Success) { if ((pPixmap->drawable.depth != depth) || (pPixmap->drawable.pScreen != pScreen)) { ret = BadMatch; goto PatchUp; } pAttr->pBackgroundPixmap = pPixmap; pPixmap->refcnt++; pAttr->mask &= ~CWBackPixmap; } else { client->errorValue = pixID; goto PatchUp; } } break; case CWBackPixel: *values++ = (CARD32) *pVlist; break; case CWBorderPixmap: pixID = (Pixmap) * pVlist; if (pixID == CopyFromParent) { if (depth != pParent->drawable.depth) { ret = BadMatch; goto PatchUp; } *values++ = CopyFromParent; } else { ret = dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (ret == Success) { if ((pPixmap->drawable.depth != depth) || (pPixmap->drawable.pScreen != pScreen)) { ret = BadMatch; goto PatchUp; } pAttr->pBorderPixmap = pPixmap; pPixmap->refcnt++; pAttr->mask &= ~CWBorderPixmap; } else { client->errorValue = pixID; goto PatchUp; } } break; case CWBorderPixel: *values++ = (CARD32) *pVlist; break; case CWBitGravity: val = (CARD8) *pVlist; if (val > StaticGravity) { ret = BadValue; client->errorValue = val; goto PatchUp; } *values++ = val; break; case CWWinGravity: val = (CARD8) *pVlist; if (val > StaticGravity) { ret = BadValue; client->errorValue = val; goto PatchUp; } *values++ = val; break; case CWBackingStore: val = (CARD8) *pVlist; if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) { ret = BadValue; client->errorValue = val; goto PatchUp; } *values++ = val; break; case CWBackingPlanes: *values++ = (CARD32) *pVlist; break; case CWBackingPixel: *values++ = (CARD32) *pVlist; break; case CWSaveUnder: val = (BOOL) * pVlist; if ((val != xTrue) && (val != xFalse)) { ret = BadValue; client->errorValue = val; goto PatchUp; } *values++ = val; break; case CWEventMask: *values++ = (CARD32) *pVlist; break; case CWDontPropagate: *values++ = (CARD32) *pVlist; break; case CWOverrideRedirect: if (!(stuff->mask & CWOverrideRedirect)) pVlist--; else { val = (BOOL) * pVlist; if ((val != xTrue) && (val != xFalse)) { ret = BadValue; client->errorValue = val; goto PatchUp; } } *values++ = xTrue; break; case CWColormap: cmap = (Colormap) * pVlist; ret = dixLookupResourceByType((void **) &pCmap, cmap, RT_COLORMAP, client, DixUseAccess); if (ret != Success) { client->errorValue = cmap; goto PatchUp; } if (pCmap->pVisual->vid != visual || pCmap->pScreen != pScreen) { ret = BadMatch; goto PatchUp; } pAttr->colormap = cmap; pAttr->mask &= ~CWColormap; break; case CWCursor: cursorID = (Cursor) * pVlist; if (cursorID == None) { *values++ = None; } else { ret = dixLookupResourceByType((void **) &pCursor, cursorID, RT_CURSOR, client, DixUseAccess); if (ret != Success) { client->errorValue = cursorID; goto PatchUp; } pAttr->pCursor = RefCursor(pCursor); pAttr->mask &= ~CWCursor; } break; default: ret = BadValue; client->errorValue = stuff->mask; goto PatchUp; } pVlist++; } if (pPriv->attr) FreeScreenAttr(pPriv->attr); pPriv->attr = pAttr; pAttr->resource = FakeClientID(client->index); if (!AddResource(pAttr->resource, AttrType, (void *) pAttr)) return BadAlloc; return Success; PatchUp: FreeAttrs(pAttr); bail: CheckScreenPrivate(pScreen); if (pAttr) free(pAttr->values); free(pAttr); return ret; } static int ScreenSaverUnsetAttributes(ClientPtr client) { REQUEST(xScreenSaverSetAttributesReq); DrawablePtr pDraw; ScreenSaverScreenPrivatePtr pPriv; int rc; REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixGetAttrAccess); if (rc != Success) return rc; pPriv = GetScreenPrivate(pDraw->pScreen); if (pPriv && pPriv->attr && pPriv->attr->client == client) { FreeResource(pPriv->attr->resource, AttrType); FreeScreenAttr(pPriv->attr); pPriv->attr = NULL; CheckScreenPrivate(pDraw->pScreen); } return Success; } static int ProcScreenSaverSetAttributes(ClientPtr client) { #ifdef PANORAMIX if (!noPanoramiXExtension) { REQUEST(xScreenSaverSetAttributesReq); PanoramiXRes *draw; PanoramiXRes *backPix = NULL; PanoramiXRes *bordPix = NULL; PanoramiXRes *cmap = NULL; int i, status, len; int pback_offset = 0, pbord_offset = 0, cmap_offset = 0; XID orig_visual, tmp; REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); status = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (status != Success) return (status == BadValue) ? BadDrawable : status; len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq)); if (Ones(stuff->mask) != len) return BadLength; if ((Mask) stuff->mask & CWBackPixmap) { pback_offset = Ones((Mask) stuff->mask & (CWBackPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { status = dixLookupResourceByType((void **) &backPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (status != Success) return status; } } if ((Mask) stuff->mask & CWBorderPixmap) { pbord_offset = Ones((Mask) stuff->mask & (CWBorderPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { status = dixLookupResourceByType((void **) &bordPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (status != Success) return status; } } if ((Mask) stuff->mask & CWColormap) { cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1)); tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { status = dixLookupResourceByType((void **) &cmap, tmp, XRT_COLORMAP, client, DixReadAccess); if (status != Success) return status; } } orig_visual = stuff->visualID; FOR_NSCREENS_BACKWARD(i) { stuff->drawable = draw->info[i].id; if (backPix) *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id; if (bordPix) *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id; if (cmap) *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id; if (orig_visual != CopyFromParent) stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual); status = ScreenSaverSetAttributes(client); } return status; } #endif return ScreenSaverSetAttributes(client); } static int ProcScreenSaverUnsetAttributes(ClientPtr client) { #ifdef PANORAMIX if (!noPanoramiXExtension) { REQUEST(xScreenSaverUnsetAttributesReq); PanoramiXRes *draw; int rc, i; rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; for (i = PanoramiXNumScreens - 1; i > 0; i--) { stuff->drawable = draw->info[i].id; ScreenSaverUnsetAttributes(client); } stuff->drawable = draw->info[0].id; } #endif return ScreenSaverUnsetAttributes(client); } static int ProcScreenSaverSuspend(ClientPtr client) { ScreenSaverSuspensionPtr *prev, this; REQUEST(xScreenSaverSuspendReq); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); /* Check if this client is suspending the screensaver */ for (prev = &suspendingClients; (this = *prev); prev = &this->next) if (this->pClient == client) break; if (this) { if (stuff->suspend == TRUE) this->count++; else if (--this->count == 0) FreeResource(this->clientResource, RT_NONE); return Success; } /* If we get to this point, this client isn't suspending the screensaver */ if (stuff->suspend == FALSE) return Success; /* * Allocate a suspension record for the client, and stop the screensaver * if it isn't already suspended by another client. We attach a resource ID * to the record, so the screensaver will be reenabled and the record freed * if the client disconnects without reenabling it first. */ this = malloc(sizeof(ScreenSaverSuspensionRec)); if (!this) return BadAlloc; this->next = NULL; this->pClient = client; this->count = 1; this->clientResource = FakeClientID(client->index); if (!AddResource(this->clientResource, SuspendType, (void *) this)) { free(this); return BadAlloc; } *prev = this; if (!screenSaverSuspended) { screenSaverSuspended = TRUE; FreeScreenSaverTimer(); } return Success; } static int (*NormalVector[]) (ClientPtr /* client */ ) = { ProcScreenSaverQueryVersion, ProcScreenSaverQueryInfo, ProcScreenSaverSelectInput, ProcScreenSaverSetAttributes, ProcScreenSaverUnsetAttributes, ProcScreenSaverSuspend,}; #define NUM_REQUESTS ((sizeof NormalVector) / (sizeof NormalVector[0])) static int ProcScreenSaverDispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data < NUM_REQUESTS) return (*NormalVector[stuff->data]) (client); return BadRequest; } static int SProcScreenSaverQueryVersion(ClientPtr client) { REQUEST(xScreenSaverQueryVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq); return ProcScreenSaverQueryVersion(client); } static int SProcScreenSaverQueryInfo(ClientPtr client) { REQUEST(xScreenSaverQueryInfoReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq); swapl(&stuff->drawable); return ProcScreenSaverQueryInfo(client); } static int SProcScreenSaverSelectInput(ClientPtr client) { REQUEST(xScreenSaverSelectInputReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq); swapl(&stuff->drawable); swapl(&stuff->eventMask); return ProcScreenSaverSelectInput(client); } static int SProcScreenSaverSetAttributes(ClientPtr client) { REQUEST(xScreenSaverSetAttributesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); swapl(&stuff->drawable); swaps(&stuff->x); swaps(&stuff->y); swaps(&stuff->width); swaps(&stuff->height); swaps(&stuff->borderWidth); swapl(&stuff->visualID); swapl(&stuff->mask); SwapRestL(stuff); return ProcScreenSaverSetAttributes(client); } static int SProcScreenSaverUnsetAttributes(ClientPtr client) { REQUEST(xScreenSaverUnsetAttributesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); swapl(&stuff->drawable); return ProcScreenSaverUnsetAttributes(client); } static int SProcScreenSaverSuspend(ClientPtr client) { REQUEST(xScreenSaverSuspendReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); return ProcScreenSaverSuspend(client); } static int (*SwappedVector[]) (ClientPtr /* client */ ) = { SProcScreenSaverQueryVersion, SProcScreenSaverQueryInfo, SProcScreenSaverSelectInput, SProcScreenSaverSetAttributes, SProcScreenSaverUnsetAttributes, SProcScreenSaverSuspend,}; static int SProcScreenSaverDispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data < NUM_REQUESTS) return (*SwappedVector[stuff->data]) (client); return BadRequest; } void ScreenSaverExtensionInit(void) { ExtensionEntry *extEntry; int i; ScreenPtr pScreen; if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return; AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr"); SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents, "SaverEvent"); SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend, "SaverSuspend"); for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; SetScreenPrivate(pScreen, NULL); } if (AttrType && SaverEventType && SuspendType && (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0, ProcScreenSaverDispatch, SProcScreenSaverDispatch, NULL, StandardMinorOpcode))) { ScreenSaverEventBase = extEntry->eventBase; EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xvmcext.h�������������������������������������������������������������������0000664�0001751�0001751�00000005573�12274325511�013624� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ #ifndef _XVMC_H #define _XVMC_H #include <X11/extensions/Xv.h> #include "xvdix.h" typedef struct { int num_xvimages; int *xvimage_ids; } XvMCImageIDList; typedef struct { int surface_type_id; int chroma_format; int color_description; unsigned short max_width; unsigned short max_height; unsigned short subpicture_max_width; unsigned short subpicture_max_height; int mc_type; int flags; XvMCImageIDList *compatible_subpictures; } XvMCSurfaceInfoRec, *XvMCSurfaceInfoPtr; typedef struct { XID context_id; ScreenPtr pScreen; int adapt_num; int surface_type_id; unsigned short width; unsigned short height; CARD32 flags; int refcnt; void *port_priv; void *driver_priv; } XvMCContextRec, *XvMCContextPtr; typedef struct { XID surface_id; int surface_type_id; XvMCContextPtr context; void *driver_priv; } XvMCSurfaceRec, *XvMCSurfacePtr; typedef struct { XID subpicture_id; int xvimage_id; unsigned short width; unsigned short height; int num_palette_entries; int entry_bytes; char component_order[4]; XvMCContextPtr context; void *driver_priv; } XvMCSubpictureRec, *XvMCSubpicturePtr; typedef int (*XvMCCreateContextProcPtr) (XvPortPtr port, XvMCContextPtr context, int *num_priv, CARD32 **priv); typedef void (*XvMCDestroyContextProcPtr) (XvMCContextPtr context); typedef int (*XvMCCreateSurfaceProcPtr) (XvMCSurfacePtr surface, int *num_priv, CARD32 **priv); typedef void (*XvMCDestroySurfaceProcPtr) (XvMCSurfacePtr surface); typedef int (*XvMCCreateSubpictureProcPtr) (XvMCSubpicturePtr subpicture, int *num_priv, CARD32 **priv); typedef void (*XvMCDestroySubpictureProcPtr) (XvMCSubpicturePtr subpicture); typedef struct { XvAdaptorPtr xv_adaptor; int num_surfaces; XvMCSurfaceInfoPtr *surfaces; int num_subpictures; XvImagePtr *subpictures; XvMCCreateContextProcPtr CreateContext; XvMCDestroyContextProcPtr DestroyContext; XvMCCreateSurfaceProcPtr CreateSurface; XvMCDestroySurfaceProcPtr DestroySurface; XvMCCreateSubpictureProcPtr CreateSubpicture; XvMCDestroySubpictureProcPtr DestroySubpicture; } XvMCAdaptorRec, *XvMCAdaptorPtr; extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr); extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr adapt); extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id); extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name, const char *busID, int major, int minor, int patchLevel); #endif /* _XVMC_H */ �������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/geext.c���������������������������������������������������������������������0000664�0001751�0001751�00000020056�12274325511�013226� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "windowstr.h" #include <X11/extensions/ge.h> #include "geint.h" #include "geext.h" #include "protocol-versions.h" #include "extinit.h" DevPrivateKeyRec GEClientPrivateKeyRec; GEExtension GEExtensions[MAXEXTENSIONS]; /* Major available requests */ static const int version_requests[] = { X_GEQueryVersion, /* before client sends QueryVersion */ X_GEQueryVersion, /* must be set to last request in version 1 */ }; /* Forward declarations */ static void SGEGenericEvent(xEvent *from, xEvent *to); #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) #define EXT_MASK(ext) ((ext) & 0x7F) /************************************************************/ /* request handlers */ /************************************************************/ static int ProcGEQueryVersion(ClientPtr client) { GEClientInfoPtr pGEClient = GEGetClient(client); xGEQueryVersionReply rep; REQUEST(xGEQueryVersionReq); REQUEST_SIZE_MATCH(xGEQueryVersionReq); rep = (xGEQueryVersionReply) { .repType = X_Reply, .RepType = X_GEQueryVersion, .sequenceNumber = client->sequence, .length = 0, /* 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; pGEClient->minor_version = stuff->minorVersion; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xGEQueryVersionReply), &rep); return Success; } int (*ProcGEVector[GENumberRequests]) (ClientPtr) = { /* Version 1.0 */ ProcGEQueryVersion}; /************************************************************/ /* swapped request handlers */ /************************************************************/ static int SProcGEQueryVersion(ClientPtr client) { REQUEST(xGEQueryVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGEQueryVersionReq); swaps(&stuff->majorVersion); swaps(&stuff->minorVersion); return (*ProcGEVector[stuff->ReqType]) (client); } int (*SProcGEVector[GENumberRequests]) (ClientPtr) = { /* Version 1.0 */ SProcGEQueryVersion}; /************************************************************/ /* callbacks */ /************************************************************/ /* dispatch requests */ static int ProcGEDispatch(ClientPtr client) { GEClientInfoPtr pGEClient = GEGetClient(client); REQUEST(xGEReq); if (pGEClient->major_version >= NUM_VERSION_REQUESTS) return BadRequest; if (stuff->ReqType > version_requests[pGEClient->major_version]) return BadRequest; return (ProcGEVector[stuff->ReqType]) (client); } /* dispatch swapped requests */ static int SProcGEDispatch(ClientPtr client) { REQUEST(xGEReq); if (stuff->ReqType >= GENumberRequests) return BadRequest; return (*SProcGEVector[stuff->ReqType]) (client); } /** * Called when a new client inits a connection to the X server. * * We alloc a simple struct to store the client's major/minor version. Can be * used in the furture for versioning support. */ static void GEClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; GEClientInfoPtr pGEClient = GEGetClient(pClient); pGEClient->major_version = 0; pGEClient->minor_version = 0; } /* Reset extension. Called on server shutdown. */ static void GEResetProc(ExtensionEntry * extEntry) { DeleteCallback(&ClientStateCallback, GEClientCallback, 0); EventSwapVector[GenericEvent] = NotImplemented; } /* Calls the registered event swap function for the extension. * * Each extension can register a swap function to handle GenericEvents being * swapped properly. The server calls SGEGenericEvent() before the event is * written on the wire, this one calls the registered swap function to do the * work. */ static void SGEGenericEvent(xEvent *from, xEvent *to) { xGenericEvent *gefrom = (xGenericEvent *) from; xGenericEvent *geto = (xGenericEvent *) to; if ((gefrom->extension & 0x7f) > MAXEXTENSIONS) { ErrorF("GE: Invalid extension offset for event.\n"); return; } if (GEExtensions[EXT_MASK(gefrom->extension)].evswap) GEExtensions[EXT_MASK(gefrom->extension)].evswap(gefrom, geto); } /* Init extension, register at server. * Since other extensions may rely on XGE (XInput does already), it is a good * idea to init XGE first, before any other extension. */ void GEExtensionInit(void) { ExtensionEntry *extEntry; if (!dixRegisterPrivateKey (&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec))) FatalError("GEExtensionInit: GE private request failed.\n"); if (!AddCallback(&ClientStateCallback, GEClientCallback, 0)) { FatalError("GEExtensionInit: register client callback failed.\n"); } if ((extEntry = AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch, GEResetProc, StandardMinorOpcode)) != 0) { memset(GEExtensions, 0, sizeof(GEExtensions)); EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent; } else { FatalError("GEInit: AddExtensions failed.\n"); } } /************************************************************/ /* interface for extensions */ /************************************************************/ /* Register an extension with GE. The given swap function will be called each * time an event is sent to a client with different byte order. * @param extension The extensions major opcode * @param ev_swap The event swap function. * @param ev_fill Called for an event before delivery. The extension now has * the chance to fill in necessary fields for the event. */ void GERegisterExtension(int extension, void (*ev_swap) (xGenericEvent *from, xGenericEvent *to)) { if (EXT_MASK(extension) >= MAXEXTENSIONS) FatalError("GE: extension > MAXEXTENSIONS. This should not happen.\n"); /* extension opcodes are > 128, might as well save some space here */ GEExtensions[EXT_MASK(extension)].evswap = ev_swap; } /* Sets type and extension field for a generic event. This is just an * auxiliary function, extensions could do it manually too. */ void GEInitEvent(xGenericEvent *ev, int extension) { ev->type = GenericEvent; ev->extension = extension; ev->length = 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/geint.h���������������������������������������������������������������������0000664�0001751�0001751�00000003745�12274325511�013233� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2007-2008 Peter Hutterer * * 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: Peter Hutterer, University of South Australia, NICTA */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef _GEINT_H_ #define _GEINT_H_ #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include <X11/extensions/geproto.h> extern _X_EXPORT DevPrivateKeyRec GEClientPrivateKeyRec; #define GEClientPrivateKey (&GEClientPrivateKeyRec) typedef struct _GEClientInfo { CARD32 major_version; CARD32 minor_version; } GEClientInfoRec, *GEClientInfoPtr; #define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey))) extern _X_EXPORT int (*ProcGEVector[ /*GENumRequests */ ]) (ClientPtr); extern _X_EXPORT int (*SProcGEVector[ /*GENumRequests */ ]) (ClientPtr); #endif /* _GEINT_H_ */ ���������������������������xorg-server-1.17.1/Xext/bigreq.c��������������������������������������������������������������������0000664�0001751�0001751�00000004345�12274325511�013366� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1992, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include <X11/extensions/bigreqsproto.h> #include "opaque.h" #include "extinit.h" static int ProcBigReqDispatch(ClientPtr client) { REQUEST(xBigReqEnableReq); xBigReqEnableReply rep; if (client->swapped) { swaps(&stuff->length); } if (stuff->brReqType != X_BigReqEnable) return BadRequest; REQUEST_SIZE_MATCH(xBigReqEnableReq); client->big_requests = TRUE; 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), &rep); return Success; } void BigReqExtensionInit(void) { AddExtension(XBigReqExtensionName, 0, 0, ProcBigReqDispatch, ProcBigReqDispatch, NULL, StandardMinorOpcode); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/geext.h���������������������������������������������������������������������0000664�0001751�0001751�00000005735�12274325511�013242� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 2007 Peter Hutterer <peter@cs.unisa.edu.au> 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 AUTHOR 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 author 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 author. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef _GEEXT_H_ #define _GEEXT_H_ #include <X11/extensions/geproto.h> /** Struct to keep information about registered extensions */ typedef struct _GEExtension { /** Event swapping routine */ void (*evswap) (xGenericEvent *from, xGenericEvent *to); } GEExtension, *GEExtensionPtr; /* All registered extensions and their handling functions. */ extern _X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS]; /* Typecast to generic event */ #define GEV(ev) ((xGenericEvent*)(ev)) /* Returns the extension offset from the event */ #define GEEXT(ev) (GEV(ev)->extension) /* Return zero-based extension offset (offset - 128). Only for use in arrays */ #define GEEXTIDX(ev) (GEEXT(ev) & 0x7F) /* True if mask is set for extension on window */ #define GEMaskIsSet(pWin, extension, mask) \ ((pWin)->optional && \ (pWin)->optional->geMasks && \ ((pWin)->optional->geMasks->eventMasks[(extension) & 0x7F] & (mask))) /* Returns first client */ #define GECLIENT(pWin) \ (((pWin)->optional) ? (pWin)->optional->geMasks->geClients : NULL) /* Returns the event_fill for the given event */ #define GEEventFill(ev) \ GEExtensions[GEEXTIDX(ev)].evfill #define GEIsType(ev, ext, ev_type) \ ((GEV(ev)->type == GenericEvent) && \ GEEXT(ev) == (ext) && \ GEV(ev)->evtype == (ev_type)) /* Interface for other extensions */ extern _X_EXPORT void GERegisterExtension(int extension, void (*ev_dispatch) (xGenericEvent *from, xGenericEvent *to)); extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension); #endif /* _GEEXT_H_ */ �����������������������������������xorg-server-1.17.1/Xext/xcmisc.c��������������������������������������������������������������������0000664�0001751�0001751�00000012043�12456571574�013413� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "swaprep.h" #include <X11/extensions/xcmiscproto.h> #include "extinit.h" #include <stdint.h> static int ProcXCMiscGetVersion(ClientPtr client) { xXCMiscGetVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = XCMiscMajorVersion, .minorVersion = XCMiscMinorVersion }; REQUEST_SIZE_MATCH(xXCMiscGetVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xXCMiscGetVersionReply), &rep); return Success; } static int ProcXCMiscGetXIDRange(ClientPtr client) { xXCMiscGetXIDRangeReply rep; XID min_id, max_id; REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq); GetXIDRange(client->index, FALSE, &min_id, &max_id); 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), &rep); return Success; } static int ProcXCMiscGetXIDList(ClientPtr client) { REQUEST(xXCMiscGetXIDListReq); xXCMiscGetXIDListReply rep; XID *pids; unsigned int count; REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq); if (stuff->count > UINT32_MAX / sizeof(XID)) return BadAlloc; pids = (XID *) malloc(stuff->count * sizeof(XID)); if (!pids) { return BadAlloc; } count = GetXIDList(client, stuff->count, pids); 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), &rep); if (count) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, count * sizeof(XID), pids); } free(pids); return Success; } static int ProcXCMiscDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XCMiscGetVersion: return ProcXCMiscGetVersion(client); case X_XCMiscGetXIDRange: return ProcXCMiscGetXIDRange(client); case X_XCMiscGetXIDList: return ProcXCMiscGetXIDList(client); default: return BadRequest; } } static int SProcXCMiscGetVersion(ClientPtr client) { REQUEST(xXCMiscGetVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXCMiscGetVersionReq); swaps(&stuff->majorVersion); swaps(&stuff->minorVersion); return ProcXCMiscGetVersion(client); } static int SProcXCMiscGetXIDRange(ClientPtr client) { REQUEST(xReq); swaps(&stuff->length); return ProcXCMiscGetXIDRange(client); } static int SProcXCMiscGetXIDList(ClientPtr client) { REQUEST(xXCMiscGetXIDListReq); REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq); swaps(&stuff->length); swapl(&stuff->count); return ProcXCMiscGetXIDList(client); } static int SProcXCMiscDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XCMiscGetVersion: return SProcXCMiscGetVersion(client); case X_XCMiscGetXIDRange: return SProcXCMiscGetXIDRange(client); case X_XCMiscGetXIDList: return SProcXCMiscGetXIDList(client); default: return BadRequest; } } void XCMiscExtensionInit(void) { AddExtension(XCMiscExtensionName, 0, 0, ProcXCMiscDispatch, SProcXCMiscDispatch, NULL, StandardMinorOpcode); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/xselinux_ext.c��������������������������������������������������������������0000664�0001751�0001751�00000047502�12274325511�014656� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/************************************************************ Author: Eamon Walsh <ewalsh@tycho.nsa.gov> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "selection.h" #include "inputstr.h" #include "windowstr.h" #include "propertyst.h" #include "extnsionst.h" #include "extinit.h" #include "xselinuxint.h" #define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid) #define CTX_WIN offsetof(SELinuxSubjectRec, win_create_sid) #define CTX_PRP offsetof(SELinuxSubjectRec, prp_create_sid) #define CTX_SEL offsetof(SELinuxSubjectRec, sel_create_sid) #define USE_PRP offsetof(SELinuxSubjectRec, prp_use_sid) #define USE_SEL offsetof(SELinuxSubjectRec, sel_use_sid) typedef struct { security_context_t octx; security_context_t dctx; CARD32 octx_len; CARD32 dctx_len; CARD32 id; } SELinuxListItemRec; /* * Extension Dispatch */ static security_context_t SELinuxCopyContext(char *ptr, unsigned len) { security_context_t copy = malloc(len + 1); if (!copy) return NULL; strncpy(copy, ptr, len); copy[len] = '\0'; return copy; } static int ProcSELinuxQueryVersion(ClientPtr client) { 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), &rep); return Success; } static int SELinuxSendContextReply(ClientPtr client, security_id_t sid) { SELinuxGetContextReply rep; security_context_t ctx = NULL; int len = 0; if (sid) { if (avc_sid_to_context_raw(sid, &ctx) < 0) return BadValue; len = strlen(ctx) + 1; } rep = (SELinuxGetContextReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = bytes_to_int32(len), .context_len = len }; if (client->swapped) { swapl(&rep.length); swaps(&rep.sequenceNumber); swapl(&rep.context_len); } WriteToClient(client, sizeof(SELinuxGetContextReply), &rep); WriteToClient(client, len, ctx); freecon(ctx); return Success; } static int ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset) { PrivateRec **privPtr = &client->devPrivates; security_id_t *pSid; security_context_t ctx = NULL; char *ptr; int rc; REQUEST(SELinuxSetCreateContextReq); REQUEST_FIXED_SIZE(SELinuxSetCreateContextReq, stuff->context_len); if (stuff->context_len > 0) { ctx = SELinuxCopyContext((char *) (stuff + 1), stuff->context_len); if (!ctx) return BadAlloc; } ptr = dixLookupPrivate(privPtr, subjectKey); pSid = (security_id_t *) (ptr + offset); *pSid = NULL; rc = Success; if (stuff->context_len > 0) { if (security_check_context_raw(ctx) < 0 || avc_context_to_sid_raw(ctx, pSid) < 0) rc = BadValue; } free(ctx); return rc; } static int ProcSELinuxGetCreateContext(ClientPtr client, unsigned offset) { security_id_t *pSid; char *ptr; REQUEST_SIZE_MATCH(SELinuxGetCreateContextReq); if (offset == CTX_DEV) ptr = dixLookupPrivate(&serverClient->devPrivates, subjectKey); else ptr = dixLookupPrivate(&client->devPrivates, subjectKey); pSid = (security_id_t *) (ptr + offset); return SELinuxSendContextReply(client, *pSid); } static int ProcSELinuxSetDeviceContext(ClientPtr client) { security_context_t ctx; security_id_t sid; DeviceIntPtr dev; SELinuxSubjectRec *subj; SELinuxObjectRec *obj; int rc; REQUEST(SELinuxSetContextReq); REQUEST_FIXED_SIZE(SELinuxSetContextReq, stuff->context_len); if (stuff->context_len < 1) return BadLength; ctx = SELinuxCopyContext((char *) (stuff + 1), stuff->context_len); if (!ctx) return BadAlloc; rc = dixLookupDevice(&dev, stuff->id, client, DixManageAccess); if (rc != Success) goto out; if (security_check_context_raw(ctx) < 0 || avc_context_to_sid_raw(ctx, &sid) < 0) { rc = BadValue; goto out; } subj = dixLookupPrivate(&dev->devPrivates, subjectKey); subj->sid = sid; obj = dixLookupPrivate(&dev->devPrivates, objectKey); obj->sid = sid; rc = Success; out: free(ctx); return rc; } static int ProcSELinuxGetDeviceContext(ClientPtr client) { DeviceIntPtr dev; SELinuxSubjectRec *subj; int rc; REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); rc = dixLookupDevice(&dev, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; subj = dixLookupPrivate(&dev->devPrivates, subjectKey); return SELinuxSendContextReply(client, subj->sid); } static int ProcSELinuxGetDrawableContext(ClientPtr client) { DrawablePtr pDraw; PrivateRec **privatePtr; SELinuxObjectRec *obj; int rc; REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); rc = dixLookupDrawable(&pDraw, stuff->id, client, 0, DixGetAttrAccess); if (rc != Success) return rc; if (pDraw->type == DRAWABLE_PIXMAP) privatePtr = &((PixmapPtr) pDraw)->devPrivates; else privatePtr = &((WindowPtr) pDraw)->devPrivates; obj = dixLookupPrivate(privatePtr, objectKey); return SELinuxSendContextReply(client, obj->sid); } static int ProcSELinuxGetPropertyContext(ClientPtr client, void *privKey) { WindowPtr pWin; PropertyPtr pProp; SELinuxObjectRec *obj; int rc; REQUEST(SELinuxGetPropertyContextReq); REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetPropAccess); if (rc != Success) return rc; rc = dixLookupProperty(&pProp, pWin, stuff->property, client, DixGetAttrAccess); if (rc != Success) return rc; obj = dixLookupPrivate(&pProp->devPrivates, privKey); return SELinuxSendContextReply(client, obj->sid); } static int ProcSELinuxGetSelectionContext(ClientPtr client, void *privKey) { Selection *pSel; SELinuxObjectRec *obj; int rc; REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; obj = dixLookupPrivate(&pSel->devPrivates, privKey); return SELinuxSendContextReply(client, obj->sid); } static int ProcSELinuxGetClientContext(ClientPtr client) { ClientPtr target; SELinuxSubjectRec *subj; int rc; REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); rc = dixLookupClient(&target, stuff->id, client, DixGetAttrAccess); if (rc != Success) return rc; subj = dixLookupPrivate(&target->devPrivates, subjectKey); return SELinuxSendContextReply(client, subj->sid); } static int SELinuxPopulateItem(SELinuxListItemRec * i, PrivateRec ** privPtr, CARD32 id, int *size) { SELinuxObjectRec *obj = dixLookupPrivate(privPtr, objectKey); SELinuxObjectRec *data = dixLookupPrivate(privPtr, dataKey); if (avc_sid_to_context_raw(obj->sid, &i->octx) < 0) return BadValue; if (avc_sid_to_context_raw(data->sid, &i->dctx) < 0) return BadValue; i->id = id; i->octx_len = bytes_to_int32(strlen(i->octx) + 1); i->dctx_len = bytes_to_int32(strlen(i->dctx) + 1); *size += i->octx_len + i->dctx_len + 3; return Success; } static void SELinuxFreeItems(SELinuxListItemRec * items, int count) { int k; for (k = 0; k < count; k++) { freecon(items[k].octx); freecon(items[k].dctx); } free(items); } static int SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items, int size, int count) { int rc, k, pos = 0; SELinuxListItemsReply rep; CARD32 *buf; buf = calloc(size, sizeof(CARD32)); if (size && !buf) { rc = BadAlloc; goto out; } /* Fill in the buffer */ for (k = 0; k < count; k++) { buf[pos] = items[k].id; if (client->swapped) swapl(buf + pos); pos++; buf[pos] = items[k].octx_len * 4; if (client->swapped) swapl(buf + pos); pos++; buf[pos] = items[k].dctx_len * 4; if (client->swapped) swapl(buf + pos); pos++; memcpy((char *) (buf + pos), items[k].octx, strlen(items[k].octx) + 1); pos += items[k].octx_len; memcpy((char *) (buf + pos), items[k].dctx, strlen(items[k].dctx) + 1); pos += items[k].dctx_len; } /* Send reply to client */ rep = (SELinuxListItemsReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = size, .count = count }; if (client->swapped) { swapl(&rep.length); swaps(&rep.sequenceNumber); swapl(&rep.count); } WriteToClient(client, sizeof(SELinuxListItemsReply), &rep); WriteToClient(client, size * 4, buf); /* Free stuff and return */ rc = Success; free(buf); out: SELinuxFreeItems(items, count); return rc; } static int ProcSELinuxListProperties(ClientPtr client) { WindowPtr pWin; PropertyPtr pProp; SELinuxListItemRec *items; int rc, count, size, i; CARD32 id; REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); rc = dixLookupWindow(&pWin, stuff->id, client, DixListPropAccess); if (rc != Success) return rc; /* Count the number of properties and allocate items */ count = 0; for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) count++; items = calloc(count, sizeof(SELinuxListItemRec)); if (count && !items) return BadAlloc; /* Fill in the items and calculate size */ i = 0; size = 0; for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) { id = pProp->propertyName; rc = SELinuxPopulateItem(items + i, &pProp->devPrivates, id, &size); if (rc != Success) { SELinuxFreeItems(items, count); return rc; } i++; } return SELinuxSendItemsToClient(client, items, size, count); } static int ProcSELinuxListSelections(ClientPtr client) { Selection *pSel; SELinuxListItemRec *items; int rc, count, size, i; CARD32 id; REQUEST_SIZE_MATCH(SELinuxGetCreateContextReq); /* Count the number of selections and allocate items */ count = 0; for (pSel = CurrentSelections; pSel; pSel = pSel->next) count++; items = calloc(count, sizeof(SELinuxListItemRec)); if (count && !items) return BadAlloc; /* Fill in the items and calculate size */ i = 0; size = 0; for (pSel = CurrentSelections; pSel; pSel = pSel->next) { id = pSel->selection; rc = SELinuxPopulateItem(items + i, &pSel->devPrivates, id, &size); if (rc != Success) { SELinuxFreeItems(items, count); return rc; } i++; } return SELinuxSendItemsToClient(client, items, size, count); } static int ProcSELinuxDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_SELinuxQueryVersion: return ProcSELinuxQueryVersion(client); case X_SELinuxSetDeviceCreateContext: return ProcSELinuxSetCreateContext(client, CTX_DEV); case X_SELinuxGetDeviceCreateContext: return ProcSELinuxGetCreateContext(client, CTX_DEV); case X_SELinuxSetDeviceContext: return ProcSELinuxSetDeviceContext(client); case X_SELinuxGetDeviceContext: return ProcSELinuxGetDeviceContext(client); case X_SELinuxSetDrawableCreateContext: return ProcSELinuxSetCreateContext(client, CTX_WIN); case X_SELinuxGetDrawableCreateContext: return ProcSELinuxGetCreateContext(client, CTX_WIN); case X_SELinuxGetDrawableContext: return ProcSELinuxGetDrawableContext(client); case X_SELinuxSetPropertyCreateContext: return ProcSELinuxSetCreateContext(client, CTX_PRP); case X_SELinuxGetPropertyCreateContext: return ProcSELinuxGetCreateContext(client, CTX_PRP); case X_SELinuxSetPropertyUseContext: return ProcSELinuxSetCreateContext(client, USE_PRP); case X_SELinuxGetPropertyUseContext: return ProcSELinuxGetCreateContext(client, USE_PRP); case X_SELinuxGetPropertyContext: return ProcSELinuxGetPropertyContext(client, objectKey); case X_SELinuxGetPropertyDataContext: return ProcSELinuxGetPropertyContext(client, dataKey); case X_SELinuxListProperties: return ProcSELinuxListProperties(client); case X_SELinuxSetSelectionCreateContext: return ProcSELinuxSetCreateContext(client, CTX_SEL); case X_SELinuxGetSelectionCreateContext: return ProcSELinuxGetCreateContext(client, CTX_SEL); case X_SELinuxSetSelectionUseContext: return ProcSELinuxSetCreateContext(client, USE_SEL); case X_SELinuxGetSelectionUseContext: return ProcSELinuxGetCreateContext(client, USE_SEL); case X_SELinuxGetSelectionContext: return ProcSELinuxGetSelectionContext(client, objectKey); case X_SELinuxGetSelectionDataContext: return ProcSELinuxGetSelectionContext(client, dataKey); case X_SELinuxListSelections: return ProcSELinuxListSelections(client); case X_SELinuxGetClientContext: return ProcSELinuxGetClientContext(client); default: return BadRequest; } } static int SProcSELinuxQueryVersion(ClientPtr client) { return ProcSELinuxQueryVersion(client); } static int SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset) { REQUEST(SELinuxSetCreateContextReq); REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq); swapl(&stuff->context_len); return ProcSELinuxSetCreateContext(client, offset); } static int SProcSELinuxSetDeviceContext(ClientPtr client) { REQUEST(SELinuxSetContextReq); REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq); swapl(&stuff->id); swapl(&stuff->context_len); return ProcSELinuxSetDeviceContext(client); } static int SProcSELinuxGetDeviceContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); swapl(&stuff->id); return ProcSELinuxGetDeviceContext(client); } static int SProcSELinuxGetDrawableContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); swapl(&stuff->id); return ProcSELinuxGetDrawableContext(client); } static int SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey) { REQUEST(SELinuxGetPropertyContextReq); REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq); swapl(&stuff->window); swapl(&stuff->property); return ProcSELinuxGetPropertyContext(client, privKey); } static int SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey) { REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); swapl(&stuff->id); return ProcSELinuxGetSelectionContext(client, privKey); } static int SProcSELinuxListProperties(ClientPtr client) { REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); swapl(&stuff->id); return ProcSELinuxListProperties(client); } static int SProcSELinuxGetClientContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); swapl(&stuff->id); return ProcSELinuxGetClientContext(client); } static int SProcSELinuxDispatch(ClientPtr client) { REQUEST(xReq); swaps(&stuff->length); switch (stuff->data) { case X_SELinuxQueryVersion: return SProcSELinuxQueryVersion(client); case X_SELinuxSetDeviceCreateContext: return SProcSELinuxSetCreateContext(client, CTX_DEV); case X_SELinuxGetDeviceCreateContext: return ProcSELinuxGetCreateContext(client, CTX_DEV); case X_SELinuxSetDeviceContext: return SProcSELinuxSetDeviceContext(client); case X_SELinuxGetDeviceContext: return SProcSELinuxGetDeviceContext(client); case X_SELinuxSetDrawableCreateContext: return SProcSELinuxSetCreateContext(client, CTX_WIN); case X_SELinuxGetDrawableCreateContext: return ProcSELinuxGetCreateContext(client, CTX_WIN); case X_SELinuxGetDrawableContext: return SProcSELinuxGetDrawableContext(client); case X_SELinuxSetPropertyCreateContext: return SProcSELinuxSetCreateContext(client, CTX_PRP); case X_SELinuxGetPropertyCreateContext: return ProcSELinuxGetCreateContext(client, CTX_PRP); case X_SELinuxSetPropertyUseContext: return SProcSELinuxSetCreateContext(client, USE_PRP); case X_SELinuxGetPropertyUseContext: return ProcSELinuxGetCreateContext(client, USE_PRP); case X_SELinuxGetPropertyContext: return SProcSELinuxGetPropertyContext(client, objectKey); case X_SELinuxGetPropertyDataContext: return SProcSELinuxGetPropertyContext(client, dataKey); case X_SELinuxListProperties: return SProcSELinuxListProperties(client); case X_SELinuxSetSelectionCreateContext: return SProcSELinuxSetCreateContext(client, CTX_SEL); case X_SELinuxGetSelectionCreateContext: return ProcSELinuxGetCreateContext(client, CTX_SEL); case X_SELinuxSetSelectionUseContext: return SProcSELinuxSetCreateContext(client, USE_SEL); case X_SELinuxGetSelectionUseContext: return ProcSELinuxGetCreateContext(client, USE_SEL); case X_SELinuxGetSelectionContext: return SProcSELinuxGetSelectionContext(client, objectKey); case X_SELinuxGetSelectionDataContext: return SProcSELinuxGetSelectionContext(client, dataKey); case X_SELinuxListSelections: return ProcSELinuxListSelections(client); case X_SELinuxGetClientContext: return SProcSELinuxGetClientContext(client); default: return BadRequest; } } /* * Extension Setup / Teardown */ static void SELinuxResetProc(ExtensionEntry * extEntry) { SELinuxFlaskReset(); SELinuxLabelReset(); } void SELinuxExtensionInit(void) { ExtensionEntry *extEntry; /* Check SELinux mode on system, configuration file, and boolean */ if (!is_selinux_enabled()) { LogMessage(X_INFO, "SELinux: Disabled on system\n"); return; } if (selinuxEnforcingState == SELINUX_MODE_DISABLED) { LogMessage(X_INFO, "SELinux: Disabled in configuration file\n"); return; } if (!security_get_boolean_active("xserver_object_manager")) { LogMessage(X_INFO, "SELinux: Disabled by boolean\n"); return; } /* Set up XACE hooks */ SELinuxLabelInit(); SELinuxFlaskInit(); /* Add extension to server */ extEntry = AddExtension(SELINUX_EXTENSION_NAME, SELinuxNumberEvents, SELinuxNumberErrors, ProcSELinuxDispatch, SProcSELinuxDispatch, SELinuxResetProc, StandardMinorOpcode); AddExtensionAlias("Flask", extEntry); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/Xext/hashtable.h�����������������������������������������������������������������0000664�0001751�0001751�00000013036�12274325511�014052� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef HASHTABLE_H #define HASHTABLE_H 1 #include <dix-config.h> #include <X11/Xfuncproto.h> #include <X11/Xdefs.h> #include "list.h" /** @brief A hashing function. @param[in/out] cdata Opaque data that can be passed to HtInit that will eventually end up here @param[in] ptr The data to be hashed. The size of the data, if needed, can be configured via a record that can be passed via cdata. @param[in] numBits The number of bits this hash needs to have in the resulting hash @return A numBits-bit hash of the data */ typedef unsigned (*HashFunc)(void * cdata, const void * ptr, int numBits); /** @brief A comparison function for hashed keys. @param[in/out] cdata Opaque data that ca be passed to Htinit that will eventually end up here @param[in] l The left side data to be compared @param[in] r The right side data to be compared @return -1 if l < r, 0 if l == r, 1 if l > r */ typedef int (*HashCompareFunc)(void * cdata, const void * l, const void * r); struct HashTableRec; typedef struct HashTableRec *HashTable; /** @brief A configuration for HtGenericHash */ typedef struct { int keySize; } HtGenericHashSetupRec, *HtGenericHashSetupPtr; /** @brief ht_create initalizes a hash table for a certain hash table configuration @param[out] ht The hash table structure to initialize @param[in] keySize The key size in bytes @param[in] dataSize The data size in bytes @param[in] hash The hash function to use for hashing keys @param[in] compare The comparison function for hashing keys @param[in] cdata Opaque data that will be passed to hash and comparison functions */ extern _X_EXPORT HashTable ht_create(int keySize, int dataSize, HashFunc hash, HashCompareFunc compare, void *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 void *ht_add(HashTable ht, const void *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, const void *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 void *ht_find(HashTable ht, const void *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 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/�����������������������������������������������������������������������������0000775�0001751�0001751�00000000000�12466505444�011660� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/Makefile.am������������������������������������������������������������������0000664�0001751�0001751�00000000622�12272307253�013625� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������noinst_LTLIBRARIES = libexa.la if XORG sdk_HEADERS = exa.h endif AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(srcdir)/../miext/cw AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) libexa_la_SOURCES = \ exa.c \ exa.h \ exa_classic.c \ exa_migration_classic.c \ exa_driver.c \ exa_mixed.c \ exa_migration_mixed.c \ exa_accel.c \ exa_glyphs.c \ exa_offscreen.c \ exa_render.c \ exa_priv.h \ exa_unaccel.c ��������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_mixed.c������������������������������������������������������������������0000664�0001751�0001751�00000023003�12274325511�013675� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 Maarten Maathuis * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include "exa_priv.h" #include "exa.h" /* This file holds the driver allocated pixmaps + better initial placement code. */ static _X_INLINE void * ExaGetPixmapAddress(PixmapPtr p) { ExaPixmapPriv(p); return pExaPixmap->sys_ptr; } /** * exaCreatePixmap() creates a new pixmap. */ PixmapPtr exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; int bpp; size_t paddedWidth; ExaScreenPriv(pScreen); if (w > 32767 || h > 32767) return NullPixmap; swap(pExaScr, pScreen, CreatePixmap); pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint); swap(pExaScr, pScreen, CreatePixmap); if (!pPixmap) return NULL; pExaPixmap = ExaGetPixmapPriv(pPixmap); pExaPixmap->driverPriv = NULL; bpp = pPixmap->drawable.bitsPerPixel; paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); if (paddedWidth / 4 > 32767 || h > 32767) return NullPixmap; /* We will allocate the system pixmap later if needed. */ pPixmap->devPrivate.ptr = NULL; pExaPixmap->sys_ptr = NULL; pExaPixmap->sys_pitch = paddedWidth; pExaPixmap->area = NULL; pExaPixmap->fb_ptr = NULL; pExaPixmap->pDamage = NULL; exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp); exaSetAccelBlock(pExaScr, pExaPixmap, w, h, bpp); (*pScreen->ModifyPixmapHeader) (pPixmap, w, h, 0, 0, paddedWidth, NULL); /* A scratch pixmap will become a driver pixmap right away. */ if (!w || !h) { exaCreateDriverPixmap_mixed(pPixmap); pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap); } else { pExaPixmap->use_gpu_copy = FALSE; if (w == 1 && h == 1) { pExaPixmap->sys_ptr = malloc(paddedWidth); /* Set up damage tracking */ pExaPixmap->pDamage = DamageCreate(exaDamageReport_mixed, NULL, DamageReportNonEmpty, TRUE, pPixmap->drawable.pScreen, pPixmap); if (pExaPixmap->pDamage) { DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage); /* This ensures that pending damage reflects the current * operation. This is used by exa to optimize migration. */ DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE); } } } /* During a fallback we must prepare access. */ if (pExaScr->fallback_counter) exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST); return pPixmap; } Bool exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData) { ScreenPtr pScreen; ExaScreenPrivPtr pExaScr; ExaPixmapPrivPtr pExaPixmap; Bool ret, has_gpu_copy; if (!pPixmap) return FALSE; pScreen = pPixmap->drawable.pScreen; pExaScr = ExaGetScreenPriv(pScreen); pExaPixmap = ExaGetPixmapPriv(pPixmap); if (pPixData) { if (pExaPixmap->driverPriv) { if (pExaPixmap->pDamage) { DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; } pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv); pExaPixmap->driverPriv = NULL; } pExaPixmap->use_gpu_copy = FALSE; pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED; } has_gpu_copy = exaPixmapHasGpuCopy(pPixmap); if (width <= 0) width = pPixmap->drawable.width; if (height <= 0) height = pPixmap->drawable.height; if (bitsPerPixel <= 0) { if (depth <= 0) bitsPerPixel = pPixmap->drawable.bitsPerPixel; else bitsPerPixel = BitsPerPixel(depth); } if (depth <= 0) depth = pPixmap->drawable.depth; if (width != pPixmap->drawable.width || height != pPixmap->drawable.height || depth != pPixmap->drawable.depth || bitsPerPixel != pPixmap->drawable.bitsPerPixel) { if (pExaPixmap->driverPriv) { if (devKind > 0) pExaPixmap->fb_pitch = devKind; else exaSetFbPitch(pExaScr, pExaPixmap, width, height, bitsPerPixel); exaSetAccelBlock(pExaScr, pExaPixmap, width, height, bitsPerPixel); RegionEmpty(&pExaPixmap->validFB); } /* Need to re-create system copy if there's also a GPU copy */ if (has_gpu_copy) { if (pExaPixmap->sys_ptr) { free(pExaPixmap->sys_ptr); pExaPixmap->sys_ptr = NULL; DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; RegionEmpty(&pExaPixmap->validSys); if (pExaScr->deferred_mixed_pixmap == pPixmap) pExaScr->deferred_mixed_pixmap = NULL; } pExaPixmap->sys_pitch = PixmapBytePad(width, depth); } } if (has_gpu_copy) { pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; pPixmap->devKind = pExaPixmap->fb_pitch; } else { pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; } /* Only pass driver pixmaps to the driver. */ if (pExaScr->info->ModifyPixmapHeader && pExaPixmap->driverPriv) { ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); if (ret == TRUE) goto out; } swap(pExaScr, pScreen, ModifyPixmapHeader); ret = pScreen->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); swap(pExaScr, pScreen, ModifyPixmapHeader); out: if (has_gpu_copy) { pExaPixmap->fb_ptr = pPixmap->devPrivate.ptr; pExaPixmap->fb_pitch = pPixmap->devKind; } else { pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr; pExaPixmap->sys_pitch = pPixmap->devKind; } /* Always NULL this, we don't want lingering pointers. */ pPixmap->devPrivate.ptr = NULL; return ret; } Bool exaDestroyPixmap_mixed(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); Bool ret; if (pPixmap->refcnt == 1) { ExaPixmapPriv(pPixmap); exaDestroyPixmap(pPixmap); if (pExaScr->deferred_mixed_pixmap == pPixmap) pExaScr->deferred_mixed_pixmap = NULL; if (pExaPixmap->driverPriv) pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv); pExaPixmap->driverPriv = NULL; if (pExaPixmap->pDamage) { free(pExaPixmap->sys_ptr); pExaPixmap->sys_ptr = NULL; pExaPixmap->pDamage = NULL; } } swap(pExaScr, pScreen, DestroyPixmap); ret = pScreen->DestroyPixmap(pPixmap); swap(pExaScr, pScreen, DestroyPixmap); return ret; } Bool exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); ExaPixmapPriv(pPixmap); void *saved_ptr; Bool ret; if (!pExaPixmap->driverPriv) return FALSE; saved_ptr = pPixmap->devPrivate.ptr; pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap); ret = pExaScr->info->PixmapIsOffscreen(pPixmap); pPixmap->devPrivate.ptr = saved_ptr; 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; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_glyphs.c�����������������������������������������������������������������0000664�0001751�0001751�00000064443�12456571574�014130� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2008 Red Hat, Inc. * Partly based on code Copyright © 2000 SuSE, 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 Red Hat not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Red Hat makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * Red Hat DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Red Hat * 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. * * 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Owen Taylor <otaylor@fishsoup.net> * Based on code by: Keith Packard */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdlib.h> #include "exa_priv.h" #include "mipict.h" #if DEBUG_GLYPH_CACHE #define DBG_GLYPH_CACHE(a) ErrorF a #else #define DBG_GLYPH_CACHE(a) #endif /* Width of the pixmaps we use for the caches; this should be less than * max texture size of the driver; this may need to actually come from * the driver. */ #define CACHE_PICTURE_WIDTH 1024 /* Maximum number of glyphs we buffer on the stack before flushing * rendering to the mask or destination surface. */ #define GLYPH_BUFFER_SIZE 256 typedef struct { PicturePtr mask; ExaCompositeRectRec rects[GLYPH_BUFFER_SIZE]; int count; } ExaGlyphBuffer, *ExaGlyphBufferPtr; typedef enum { ExaGlyphSuccess, /* Glyph added to render buffer */ ExaGlyphFail, /* out of memory, etc */ ExaGlyphNeedFlush, /* would evict a glyph already in the buffer */ } ExaGlyphCacheResult; void exaGlyphsInit(ScreenPtr pScreen) { ExaScreenPriv(pScreen); int i = 0; memset(pExaScr->glyphCaches, 0, sizeof(pExaScr->glyphCaches)); pExaScr->glyphCaches[i].format = PICT_a8; pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 16; i++; pExaScr->glyphCaches[i].format = PICT_a8; pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 32; i++; pExaScr->glyphCaches[i].format = PICT_a8r8g8b8; pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 16; i++; pExaScr->glyphCaches[i].format = PICT_a8r8g8b8; pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 32; i++; assert(i == EXA_NUM_GLYPH_CACHES); for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) { pExaScr->glyphCaches[i].columns = CACHE_PICTURE_WIDTH / pExaScr->glyphCaches[i].glyphWidth; pExaScr->glyphCaches[i].size = 256; pExaScr->glyphCaches[i].hashSize = 557; } } static void exaUnrealizeGlyphCaches(ScreenPtr pScreen, unsigned int format) { ExaScreenPriv(pScreen); int i; for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) { ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i]; if (cache->format != format) continue; if (cache->picture) { FreePicture((void *) cache->picture, (XID) 0); cache->picture = NULL; } free(cache->hashEntries); cache->hashEntries = NULL; free(cache->glyphs); cache->glyphs = NULL; cache->glyphCount = 0; } } #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) /* All caches for a single format share a single pixmap for glyph storage, * allowing mixing glyphs of different sizes without paying a penalty * for switching between mask pixmaps. (Note that for a size of font * right at the border between two sizes, we might be switching for almost * every glyph.) * * This function allocates the storage pixmap, and then fills in the * rest of the allocated structures for all caches with the given format. */ static Bool exaRealizeGlyphCaches(ScreenPtr pScreen, unsigned int format) { ExaScreenPriv(pScreen); int depth = PIXMAN_FORMAT_DEPTH(format); PictFormatPtr pPictFormat; PixmapPtr pPixmap; PicturePtr pPicture; CARD32 component_alpha; int height; int i; int error; pPictFormat = PictureMatchFormat(pScreen, depth, format); if (!pPictFormat) return FALSE; /* Compute the total vertical size needed for the format */ height = 0; for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) { ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i]; int rows; if (cache->format != format) continue; cache->yOffset = height; rows = (cache->size + cache->columns - 1) / cache->columns; height += rows * cache->glyphHeight; } /* Now allocate the pixmap and picture */ pPixmap = (*pScreen->CreatePixmap) (pScreen, CACHE_PICTURE_WIDTH, height, depth, 0); if (!pPixmap) return FALSE; component_alpha = NeedsComponent(pPictFormat->format); pPicture = CreatePicture(0, &pPixmap->drawable, pPictFormat, CPComponentAlpha, &component_alpha, serverClient, &error); (*pScreen->DestroyPixmap) (pPixmap); /* picture holds a refcount */ if (!pPicture) return FALSE; /* And store the picture in all the caches for the format */ for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) { ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i]; int j; if (cache->format != format) continue; cache->picture = pPicture; cache->picture->refcnt++; cache->hashEntries = malloc(sizeof(int) * cache->hashSize); cache->glyphs = malloc(sizeof(ExaCachedGlyphRec) * cache->size); cache->glyphCount = 0; if (!cache->hashEntries || !cache->glyphs) goto bail; for (j = 0; j < cache->hashSize; j++) cache->hashEntries[j] = -1; cache->evictionPosition = rand() % cache->size; } /* Each cache references the picture individually */ FreePicture((void *) pPicture, (XID) 0); return TRUE; bail: exaUnrealizeGlyphCaches(pScreen, format); return FALSE; } void exaGlyphsFini(ScreenPtr pScreen) { ExaScreenPriv(pScreen); int i; for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) { ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i]; if (cache->picture) exaUnrealizeGlyphCaches(pScreen, cache->format); } } static int exaGlyphCacheHashLookup(ExaGlyphCachePtr cache, GlyphPtr pGlyph) { int slot; slot = (*(CARD32 *) pGlyph->sha1) % cache->hashSize; while (TRUE) { /* hash table can never be full */ int entryPos = cache->hashEntries[slot]; if (entryPos == -1) return -1; if (memcmp (pGlyph->sha1, cache->glyphs[entryPos].sha1, sizeof(pGlyph->sha1)) == 0) { return entryPos; } slot--; if (slot < 0) slot = cache->hashSize - 1; } } static void exaGlyphCacheHashInsert(ExaGlyphCachePtr cache, GlyphPtr pGlyph, int pos) { int slot; memcpy(cache->glyphs[pos].sha1, pGlyph->sha1, sizeof(pGlyph->sha1)); slot = (*(CARD32 *) pGlyph->sha1) % cache->hashSize; while (TRUE) { /* hash table can never be full */ if (cache->hashEntries[slot] == -1) { cache->hashEntries[slot] = pos; return; } slot--; if (slot < 0) slot = cache->hashSize - 1; } } static void exaGlyphCacheHashRemove(ExaGlyphCachePtr cache, int pos) { int slot; int emptiedSlot = -1; slot = (*(CARD32 *) cache->glyphs[pos].sha1) % cache->hashSize; while (TRUE) { /* hash table can never be full */ int entryPos = cache->hashEntries[slot]; if (entryPos == -1) return; if (entryPos == pos) { cache->hashEntries[slot] = -1; emptiedSlot = slot; } else if (emptiedSlot != -1) { /* See if we can move this entry into the emptied slot, we can't * do that if if entry would have hashed between the current position * and the emptied slot. (taking wrapping into account). Bad positions * are: * * | XXXXXXXXXX | * i j * * |XXX XXXX| * j i * * i - slot, j - emptiedSlot * * (Knuth 6.4R) */ int entrySlot = (*(CARD32 *) cache->glyphs[entryPos].sha1) % cache->hashSize; if (!((entrySlot >= slot && entrySlot < emptiedSlot) || (emptiedSlot < slot && (entrySlot < emptiedSlot || entrySlot >= slot)))) { cache->hashEntries[emptiedSlot] = entryPos; cache->hashEntries[slot] = -1; emptiedSlot = slot; } } slot--; if (slot < 0) slot = cache->hashSize - 1; } } #define CACHE_X(pos) (((pos) % cache->columns) * cache->glyphWidth) #define CACHE_Y(pos) (cache->yOffset + ((pos) / cache->columns) * cache->glyphHeight) /* The most efficient thing to way to upload the glyph to the screen * is to use the UploadToScreen() driver hook; this allows us to * pipeline glyph uploads and to avoid creating gpu backed pixmaps for * glyphs that we'll never use again. * * If we can't do it with UploadToScreen (because the glyph has a gpu copy, * etc), we fall back to CompositePicture. * * We need to damage the cache pixmap manually in either case because the damage * layer unwrapped the picture screen before calling exaGlyphs. */ static void exaGlyphCacheUploadGlyph(ScreenPtr pScreen, ExaGlyphCachePtr cache, int x, int y, GlyphPtr pGlyph) { ExaScreenPriv(pScreen); PicturePtr pGlyphPicture = GetGlyphPicture(pGlyph, pScreen); PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable; ExaPixmapPriv(pGlyphPixmap); PixmapPtr pCachePixmap = (PixmapPtr) cache->picture->pDrawable; if (!pExaScr->info->UploadToScreen || pExaScr->swappedOut || pExaPixmap->accel_blocked) goto composite; /* If the glyph pixmap is already uploaded, no point in doing * things this way */ if (exaPixmapHasGpuCopy(pGlyphPixmap)) goto composite; /* UploadToScreen only works if bpp match */ if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel) goto composite; if (pExaScr->do_migration) { ExaMigrationRec pixmaps[1]; /* cache pixmap must have a gpu copy. */ pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pCachePixmap; pixmaps[0].pReg = NULL; exaDoMigration(pixmaps, 1, TRUE); } if (!exaPixmapHasGpuCopy(pCachePixmap)) goto composite; /* x,y are in pixmap coordinates, no need for cache{X,Y}off */ if (pExaScr->info->UploadToScreen(pCachePixmap, x, y, pGlyph->info.width, pGlyph->info.height, (char *) pExaPixmap->sys_ptr, pExaPixmap->sys_pitch)) goto damage; composite: CompositePicture(PictOpSrc, pGlyphPicture, None, cache->picture, 0, 0, 0, 0, x, y, pGlyph->info.width, pGlyph->info.height); damage: /* The cache pixmap isn't a window, so no need to offset coordinates. */ exaPixmapDirty(pCachePixmap, x, y, x + cache->glyphWidth, y + cache->glyphHeight); } static ExaGlyphCacheResult exaGlyphCacheBufferGlyph(ScreenPtr pScreen, ExaGlyphCachePtr cache, ExaGlyphBufferPtr buffer, GlyphPtr pGlyph, PicturePtr pSrc, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst) { ExaCompositeRectPtr rect; int pos; int x, y; if (buffer->mask && buffer->mask != cache->picture) return ExaGlyphNeedFlush; if (!cache->picture) { if (!exaRealizeGlyphCaches(pScreen, cache->format)) return ExaGlyphFail; } DBG_GLYPH_CACHE(("(%d,%d,%s): buffering glyph %lx\n", cache->glyphWidth, cache->glyphHeight, cache->format == PICT_a8 ? "A" : "ARGB", (long) *(CARD32 *) pGlyph->sha1)); pos = exaGlyphCacheHashLookup(cache, pGlyph); if (pos != -1) { DBG_GLYPH_CACHE((" found existing glyph at %d\n", pos)); x = CACHE_X(pos); y = CACHE_Y(pos); } else { if (cache->glyphCount < cache->size) { /* Space remaining; we fill from the start */ pos = cache->glyphCount; x = CACHE_X(pos); y = CACHE_Y(pos); cache->glyphCount++; DBG_GLYPH_CACHE((" storing glyph in free space at %d\n", pos)); exaGlyphCacheHashInsert(cache, pGlyph, pos); } else { /* Need to evict an entry. We have to see if any glyphs * already in the output buffer were at this position in * the cache */ pos = cache->evictionPosition; x = CACHE_X(pos); y = CACHE_Y(pos); DBG_GLYPH_CACHE((" evicting glyph at %d\n", pos)); if (buffer->count) { int i; for (i = 0; i < buffer->count; i++) { if (pSrc ? (buffer->rects[i].xMask == x && buffer->rects[i].yMask == y) : (buffer->rects[i].xSrc == x && buffer->rects[i].ySrc == y)) { DBG_GLYPH_CACHE((" must flush buffer\n")); return ExaGlyphNeedFlush; } } } /* OK, we're all set, swap in the new glyph */ exaGlyphCacheHashRemove(cache, pos); exaGlyphCacheHashInsert(cache, pGlyph, pos); /* And pick a new eviction position */ cache->evictionPosition = rand() % cache->size; } exaGlyphCacheUploadGlyph(pScreen, cache, x, y, pGlyph); } buffer->mask = cache->picture; rect = &buffer->rects[buffer->count]; if (pSrc) { rect->xSrc = xSrc; rect->ySrc = ySrc; rect->xMask = x; rect->yMask = y; } else { rect->xSrc = x; rect->ySrc = y; rect->xMask = 0; rect->yMask = 0; } rect->pDst = pDst; rect->xDst = xDst; rect->yDst = yDst; rect->width = pGlyph->info.width; rect->height = pGlyph->info.height; buffer->count++; return ExaGlyphSuccess; } #undef CACHE_X #undef CACHE_Y static ExaGlyphCacheResult exaBufferGlyph(ScreenPtr pScreen, ExaGlyphBufferPtr buffer, GlyphPtr pGlyph, PicturePtr pSrc, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst) { ExaScreenPriv(pScreen); unsigned int format = (GetGlyphPicture(pGlyph, pScreen))->format; int width = pGlyph->info.width; int height = pGlyph->info.height; ExaCompositeRectPtr rect; PicturePtr mask; int i; if (buffer->count == GLYPH_BUFFER_SIZE) return ExaGlyphNeedFlush; if (PICT_FORMAT_BPP(format) == 1) format = PICT_a8; for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) { ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i]; if (format == cache->format && width <= cache->glyphWidth && height <= cache->glyphHeight) { ExaGlyphCacheResult result = exaGlyphCacheBufferGlyph(pScreen, &pExaScr-> glyphCaches [i], buffer, pGlyph, pSrc, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst); switch (result) { case ExaGlyphFail: break; case ExaGlyphSuccess: case ExaGlyphNeedFlush: return result; } } } /* Couldn't find the glyph in the cache, use the glyph picture directly */ mask = GetGlyphPicture(pGlyph, pScreen); if (buffer->mask && buffer->mask != mask) return ExaGlyphNeedFlush; buffer->mask = mask; rect = &buffer->rects[buffer->count]; rect->xSrc = xSrc; rect->ySrc = ySrc; rect->xMask = xMask; rect->yMask = yMask; rect->xDst = xDst; rect->yDst = yDst; rect->width = width; rect->height = height; buffer->count++; return ExaGlyphSuccess; } static void exaGlyphsToMask(PicturePtr pMask, ExaGlyphBufferPtr buffer) { exaCompositeRects(PictOpAdd, buffer->mask, NULL, pMask, buffer->count, buffer->rects); buffer->count = 0; buffer->mask = NULL; } static void exaGlyphsToDst(PicturePtr pSrc, PicturePtr pDst, ExaGlyphBufferPtr buffer) { exaCompositeRects(PictOpOver, pSrc, buffer->mask, pDst, buffer->count, buffer->rects); buffer->count = 0; buffer->mask = NULL; } /* Cut and paste from render/glyph.c - probably should export it instead */ static void GlyphExtents(int nlist, GlyphListPtr list, GlyphPtr * glyphs, BoxPtr extents) { int x1, x2, y1, y2; int n; GlyphPtr glyph; int x, y; x = 0; y = 0; extents->x1 = MAXSHORT; extents->x2 = MINSHORT; extents->y1 = MAXSHORT; extents->y2 = MINSHORT; while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; list++; while (n--) { glyph = *glyphs++; x1 = x - glyph->info.x; if (x1 < MINSHORT) x1 = MINSHORT; y1 = y - glyph->info.y; if (y1 < MINSHORT) y1 = MINSHORT; x2 = x1 + glyph->info.width; if (x2 > MAXSHORT) x2 = MAXSHORT; y2 = y1 + glyph->info.height; if (y2 > MAXSHORT) y2 = MAXSHORT; if (x1 < extents->x1) extents->x1 = x1; if (x2 > extents->x2) extents->x2 = x2; if (y1 < extents->y1) extents->y1 = y1; if (y2 > extents->y2) extents->y2 = y2; x += glyph->info.xOff; y += glyph->info.yOff; } } } void exaGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) { PixmapPtr pMaskPixmap = 0; PicturePtr pMask = NULL; ScreenPtr pScreen = pDst->pDrawable->pScreen; int width = 0, height = 0; int x, y; int first_xOff = list->xOff, first_yOff = list->yOff; int n; GlyphPtr glyph; int error; BoxRec extents = { 0, 0, 0, 0 }; CARD32 component_alpha; ExaGlyphBuffer buffer; if (maskFormat) { ExaScreenPriv(pScreen); GCPtr pGC; xRectangle rect; GlyphExtents(nlist, list, glyphs, &extents); if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) return; width = extents.x2 - extents.x1; height = extents.y2 - extents.y1; if (maskFormat->depth == 1) { PictFormatPtr a8Format = PictureMatchFormat(pScreen, 8, PICT_a8); if (a8Format) maskFormat = a8Format; } pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth, CREATE_PIXMAP_USAGE_SCRATCH); if (!pMaskPixmap) return; component_alpha = NeedsComponent(maskFormat->format); pMask = CreatePicture(0, &pMaskPixmap->drawable, maskFormat, CPComponentAlpha, &component_alpha, serverClient, &error); if (!pMask || (!component_alpha && pExaScr->info->CheckComposite && !(*pExaScr->info->CheckComposite) (PictOpAdd, pSrc, NULL, pMask))) { PictFormatPtr argbFormat; (*pScreen->DestroyPixmap) (pMaskPixmap); if (!pMask) return; /* The driver can't seem to composite to a8, let's try argb (but * without component-alpha) */ FreePicture((void *) pMask, (XID) 0); argbFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); if (argbFormat) maskFormat = argbFormat; pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth, CREATE_PIXMAP_USAGE_SCRATCH); if (!pMaskPixmap) return; pMask = CreatePicture(0, &pMaskPixmap->drawable, maskFormat, 0, 0, serverClient, &error); if (!pMask) { (*pScreen->DestroyPixmap) (pMaskPixmap); return; } } pGC = GetScratchGC(pMaskPixmap->drawable.depth, pScreen); ValidateGC(&pMaskPixmap->drawable, pGC); rect.x = 0; rect.y = 0; rect.width = width; rect.height = height; (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); FreeScratchGC(pGC); x = -extents.x1; y = -extents.y1; } else { x = 0; y = 0; } buffer.count = 0; buffer.mask = NULL; while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; while (n--) { glyph = *glyphs++; if (glyph->info.width > 0 && glyph->info.height > 0) { /* pGlyph->info.{x,y} compensate for empty space in the glyph. */ if (maskFormat) { if (exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask, 0, 0, 0, 0, x - glyph->info.x, y - glyph->info.y) == ExaGlyphNeedFlush) { exaGlyphsToMask(pMask, &buffer); exaBufferGlyph(pScreen, &buffer, glyph, NULL, pMask, 0, 0, 0, 0, x - glyph->info.x, y - glyph->info.y); } } else { if (exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst, xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff, 0, 0, x - glyph->info.x, y - glyph->info.y) == ExaGlyphNeedFlush) { exaGlyphsToDst(pSrc, pDst, &buffer); exaBufferGlyph(pScreen, &buffer, glyph, pSrc, pDst, xSrc + (x - glyph->info.x) - first_xOff, ySrc + (y - glyph->info.y) - first_yOff, 0, 0, x - glyph->info.x, y - glyph->info.y); } } } x += glyph->info.xOff; y += glyph->info.yOff; } list++; } if (buffer.count) { if (maskFormat) exaGlyphsToMask(pMask, &buffer); else exaGlyphsToDst(pSrc, pDst, &buffer); } if (maskFormat) { x = extents.x1; y = extents.y1; CompositePicture(op, pSrc, pMask, pDst, xSrc + x - first_xOff, ySrc + y - first_yOff, 0, 0, x, y, width, height); FreePicture((void *) pMask, (XID) 0); (*pScreen->DestroyPixmap) (pMaskPixmap); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa.c������������������������������������������������������������������������0000664�0001751�0001751�00000106220�12456571574�012530� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2001 Keith Packard * * Partly based on code that is Copyright © 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. */ /** @file * This file covers the initialization and teardown of EXA, and has various * functions not responsible for performing rendering, pixmap migration, or * memory management. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdlib.h> #include "exa_priv.h" #include "exa.h" DevPrivateKeyRec exaScreenPrivateKeyRec; #ifdef MITSHM static ShmFuncs exaShmFuncs = { NULL, NULL }; #endif /** * exaGetPixmapOffset() returns the offset (in bytes) within the framebuffer of * the beginning of the given pixmap. * * Note that drivers are free to, and often do, munge this offset as necessary * for handing to the hardware -- for example, translating it into a different * aperture. This function may need to be extended in the future if we grow * support for having multiple card-accessible offscreen, such as an AGP memory * pool alongside the framebuffer pool. */ unsigned long exaGetPixmapOffset(PixmapPtr pPix) { ExaScreenPriv(pPix->drawable.pScreen); ExaPixmapPriv(pPix); return (CARD8 *) pExaPixmap->fb_ptr - pExaScr->info->memoryBase; } void * exaGetPixmapDriverPrivate(PixmapPtr pPix) { ExaPixmapPriv(pPix); return pExaPixmap->driverPriv; } /** * exaGetPixmapPitch() returns the pitch (in bytes) of the given pixmap. * * This is a helper to make driver code more obvious, due to the rather obscure * naming of the pitch field in the pixmap. */ unsigned long exaGetPixmapPitch(PixmapPtr pPix) { return pPix->devKind; } /** * exaGetPixmapSize() returns the size in bytes of the given pixmap in video * memory. Only valid when the pixmap is currently in framebuffer. */ unsigned long exaGetPixmapSize(PixmapPtr pPix) { ExaPixmapPrivPtr pExaPixmap; pExaPixmap = ExaGetPixmapPriv(pPix); if (pExaPixmap != NULL) return pExaPixmap->fb_size; return 0; } /** * exaGetDrawablePixmap() returns a backing pixmap for a given drawable. * * @param pDrawable the drawable being requested. * * This function returns the backing pixmap for a drawable, whether it is a * redirected window, unredirected window, or already a pixmap. Note that * coordinate translation is needed when drawing to the backing pixmap of a * redirected window, and the translation coordinates are provided by calling * exaGetOffscreenPixmap() on the drawable. */ PixmapPtr exaGetDrawablePixmap(DrawablePtr pDrawable) { if (pDrawable->type == DRAWABLE_WINDOW) return pDrawable->pScreen->GetWindowPixmap((WindowPtr) pDrawable); else return (PixmapPtr) pDrawable; } /** * Sets the offsets to add to coordinates to make them address the same bits in * the backing drawable. These coordinates are nonzero only for redirected * windows. */ void exaGetDrawableDeltas(DrawablePtr pDrawable, PixmapPtr pPixmap, int *xp, int *yp) { #ifdef COMPOSITE if (pDrawable->type == DRAWABLE_WINDOW) { *xp = -pPixmap->screen_x; *yp = -pPixmap->screen_y; return; } #endif *xp = 0; *yp = 0; } /** * exaPixmapDirty() marks a pixmap as dirty, allowing for * optimizations in pixmap migration when no changes have occurred. */ void exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2) { BoxRec box; RegionRec region; box.x1 = max(x1, 0); box.y1 = max(y1, 0); box.x2 = min(x2, pPix->drawable.width); box.y2 = min(y2, pPix->drawable.height); if (box.x1 >= box.x2 || box.y1 >= box.y2) return; RegionInit(®ion, &box, 1); DamageDamageRegion(&pPix->drawable, ®ion); RegionUninit(®ion); } static int exaLog2(int val) { int bits; if (val <= 0) return 0; for (bits = 0; val != 0; bits++) val >>= 1; return bits - 1; } void exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap, int w, int h, int bpp) { pExaPixmap->accel_blocked = 0; if (pExaScr->info->maxPitchPixels) { int max_pitch = pExaScr->info->maxPitchPixels * bits_to_bytes(bpp); if (pExaPixmap->fb_pitch > max_pitch) pExaPixmap->accel_blocked |= EXA_RANGE_PITCH; } if (pExaScr->info->maxPitchBytes && pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes) pExaPixmap->accel_blocked |= EXA_RANGE_PITCH; if (w > pExaScr->info->maxX) pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH; if (h > pExaScr->info->maxY) pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT; } void exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap, int w, int h, int bpp) { if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) pExaPixmap->fb_pitch = bits_to_bytes((1 << (exaLog2(w - 1) + 1)) * bpp); else pExaPixmap->fb_pitch = bits_to_bytes(w * bpp); pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch, pExaScr->info->pixmapPitchAlign); } /** * Returns TRUE if the pixmap is not movable. This is the case where it's a * pixmap which has no private (almost always bad) or it's a scratch pixmap created by * some X Server internal component (the score says it's pinned). */ Bool exaPixmapIsPinned(PixmapPtr pPix) { ExaPixmapPriv(pPix); if (pExaPixmap == NULL) EXA_FatalErrorDebugWithRet(("EXA bug: exaPixmapIsPinned was called on a non-exa pixmap.\n"), TRUE); return pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED; } /** * exaPixmapHasGpuCopy() is used to determine if a pixmap is in offscreen * memory, meaning that acceleration could probably be done to it, and that it * will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it * with the CPU. * * Note that except for UploadToScreen()/DownloadFromScreen() (which explicitly * deal with moving pixmaps in and out of system memory), EXA will give drivers * pixmaps as arguments for which exaPixmapHasGpuCopy() is TRUE. * * @return TRUE if the given drawable is in framebuffer memory. */ Bool exaPixmapHasGpuCopy(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS)) return FALSE; return (*pExaScr->pixmap_has_gpu_copy) (pPixmap); } /** * exaDrawableIsOffscreen() is a convenience wrapper for exaPixmapHasGpuCopy(). */ Bool exaDrawableIsOffscreen(DrawablePtr pDrawable) { return exaPixmapHasGpuCopy(exaGetDrawablePixmap(pDrawable)); } /** * Returns the pixmap which backs a drawable, and the offsets to add to * coordinates to make them address the same bits in the backing drawable. */ PixmapPtr exaGetOffscreenPixmap(DrawablePtr pDrawable, int *xp, int *yp) { PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); exaGetDrawableDeltas(pDrawable, pPixmap, xp, yp); if (exaPixmapHasGpuCopy(pPixmap)) return pPixmap; else return NULL; } /** * Returns TRUE if the pixmap GPU copy is being accessed. */ Bool ExaDoPrepareAccess(PixmapPtr pPixmap, int index) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); ExaPixmapPriv(pPixmap); Bool has_gpu_copy, ret; int i; if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS)) return FALSE; if (pExaPixmap == NULL) EXA_FatalErrorDebugWithRet(("EXA bug: ExaDoPrepareAccess was called on a non-exa pixmap.\n"), FALSE); /* Handle repeated / nested calls. */ for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) { if (pExaScr->access[i].pixmap == pPixmap) { pExaScr->access[i].count++; return pExaScr->access[i].retval; } } /* If slot for this index is taken, find an empty slot */ if (pExaScr->access[index].pixmap) { for (index = EXA_NUM_PREPARE_INDICES - 1; index >= 0; index--) if (!pExaScr->access[index].pixmap) break; } /* Access to this pixmap hasn't been prepared yet, so data pointer should be NULL. */ if (pPixmap->devPrivate.ptr != NULL) { EXA_FatalErrorDebug(("EXA bug: pPixmap->devPrivate.ptr was %p, but should have been NULL.\n", pPixmap->devPrivate.ptr)); } has_gpu_copy = exaPixmapHasGpuCopy(pPixmap); if (has_gpu_copy && pExaPixmap->fb_ptr) { pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; ret = TRUE; } else { pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; ret = FALSE; } /* Store so we can handle repeated / nested calls. */ pExaScr->access[index].pixmap = pPixmap; pExaScr->access[index].count = 1; if (!has_gpu_copy) goto out; exaWaitSync(pScreen); if (pExaScr->info->PrepareAccess == NULL) goto out; if (index >= EXA_PREPARE_AUX_DEST && !(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) FatalError("Unsupported AUX indices used on a pinned pixmap.\n"); exaMoveOutPixmap(pPixmap); ret = FALSE; goto out; } if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) { if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED && !(pExaScr->info->flags & EXA_MIXED_PIXMAPS)) FatalError("Driver failed PrepareAccess on a pinned pixmap.\n"); exaMoveOutPixmap(pPixmap); ret = FALSE; goto out; } ret = TRUE; out: pExaScr->access[index].retval = ret; return ret; } /** * exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler. * * It deals with waiting for synchronization with the card, determining if * PrepareAccess() is necessary, and working around PrepareAccess() failure. */ void exaPrepareAccess(DrawablePtr pDrawable, int index) { PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); ExaScreenPriv(pDrawable->pScreen); if (pExaScr->prepare_access_reg) pExaScr->prepare_access_reg(pPixmap, index, NULL); else (void) ExaDoPrepareAccess(pPixmap, index); } /** * exaFinishAccess() is EXA's wrapper for the driver's FinishAccess() handler. * * It deals with calling the driver's FinishAccess() only if necessary. */ void exaFinishAccess(DrawablePtr pDrawable, int index) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv(pScreen); PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPixmap); int i; if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS)) return; if (pExaPixmap == NULL) EXA_FatalErrorDebugWithRet(("EXA bug: exaFinishAccesss was called on a non-exa pixmap.\n"),); /* Handle repeated / nested calls. */ for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) { if (pExaScr->access[i].pixmap == pPixmap) { if (--pExaScr->access[i].count > 0) return; break; } } /* Catch unbalanced Prepare/FinishAccess calls. */ if (i == EXA_NUM_PREPARE_INDICES) EXA_FatalErrorDebugWithRet(("EXA bug: FinishAccess called without PrepareAccess for pixmap 0x%p.\n", pPixmap),); pExaScr->access[i].pixmap = NULL; /* We always hide the devPrivate.ptr. */ pPixmap->devPrivate.ptr = NULL; /* Only call FinishAccess if PrepareAccess was called and succeeded. */ if (!pExaScr->info->FinishAccess || !pExaScr->access[i].retval) return; if (i >= EXA_PREPARE_AUX_DEST && !(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) { ErrorF("EXA bug: Trying to call driver FinishAccess hook with " "unsupported index EXA_PREPARE_AUX*\n"); return; } (*pExaScr->info->FinishAccess) (pPixmap, i); } /** * Helper for things common to all schemes when a pixmap is destroyed */ void exaDestroyPixmap(PixmapPtr pPixmap) { ExaScreenPriv(pPixmap->drawable.pScreen); int i; /* Finish access if it was prepared (e.g. pixmap created during * software fallback) */ for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) { if (pExaScr->access[i].pixmap == pPixmap) { exaFinishAccess(&pPixmap->drawable, i); pExaScr->access[i].pixmap = NULL; break; } } } /** * Here begins EXA's GC code. * Do not ever access the fb/mi layer directly. */ static void exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); static void exaDestroyGC(GCPtr pGC); static void exaChangeGC(GCPtr pGC, unsigned long mask); static void exaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void exaChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); static void exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc); static void exaDestroyClip(GCPtr pGC); const GCFuncs exaGCFuncs = { exaValidateGC, exaChangeGC, exaCopyGC, exaDestroyGC, exaChangeClip, exaDestroyClip, exaCopyClip }; static void exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { /* fbValidateGC will do direct access to pixmaps if the tiling has changed. * Do a few smart things so fbValidateGC can do it's work. */ ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv(pScreen); ExaGCPriv(pGC); PixmapPtr pTile = NULL; Bool finish_current_tile = FALSE; /* Either of these conditions is enough to trigger access to a tile pixmap. */ /* With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid tile pixmap pointer. */ if (pGC->fillStyle == FillTiled || ((changes & GCTile) && !pGC->tileIsPixel)) { pTile = pGC->tile.pixmap; /* Sometimes tile pixmaps are swapped, you need access to: * - The current tile if it depth matches. * - Or the rotated tile if that one matches depth and !(changes & GCTile). * - Or the current tile pixmap and a newly created one. */ if (pTile && pTile->drawable.depth != pDrawable->depth && !(changes & GCTile)) { PixmapPtr pRotatedTile = fbGetRotatedPixmap(pGC); if (pRotatedTile && pRotatedTile->drawable.depth == pDrawable->depth) pTile = pRotatedTile; else finish_current_tile = TRUE; /* CreatePixmap will be called. */ } } if (pGC->stipple) exaPrepareAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); if (pTile) exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC); /* Calls to Create/DestroyPixmap have to be identified as special. */ pExaScr->fallback_counter++; swap(pExaGC, pGC, funcs); (*pGC->funcs->ValidateGC) (pGC, changes, pDrawable); swap(pExaGC, pGC, funcs); pExaScr->fallback_counter--; if (pTile) exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC); if (finish_current_tile && pGC->tile.pixmap) exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_AUX_DEST); if (pGC->stipple) exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); } /* Is exaPrepareAccessGC() needed? */ static void exaDestroyGC(GCPtr pGC) { ExaGCPriv(pGC); swap(pExaGC, pGC, funcs); (*pGC->funcs->DestroyGC) (pGC); swap(pExaGC, pGC, funcs); } static void exaChangeGC(GCPtr pGC, unsigned long mask) { ExaGCPriv(pGC); swap(pExaGC, pGC, funcs); (*pGC->funcs->ChangeGC) (pGC, mask); swap(pExaGC, pGC, funcs); } static void exaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) { ExaGCPriv(pGCDst); swap(pExaGC, pGCDst, funcs); (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); swap(pExaGC, pGCDst, funcs); } static void exaChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { ExaGCPriv(pGC); swap(pExaGC, pGC, funcs); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); swap(pExaGC, pGC, funcs); } static void exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc) { ExaGCPriv(pGCDst); swap(pExaGC, pGCDst, funcs); (*pGCDst->funcs->CopyClip) (pGCDst, pGCSrc); swap(pExaGC, pGCDst, funcs); } static void exaDestroyClip(GCPtr pGC) { ExaGCPriv(pGC); swap(pExaGC, pGC, funcs); (*pGC->funcs->DestroyClip) (pGC); swap(pExaGC, pGC, funcs); } /** * exaCreateGC makes a new GC and hooks up its funcs handler, so that * exaValidateGC() will get called. */ static int exaCreateGC(GCPtr pGC) { ScreenPtr pScreen = pGC->pScreen; ExaScreenPriv(pScreen); ExaGCPriv(pGC); Bool ret; swap(pExaScr, pScreen, CreateGC); if ((ret = (*pScreen->CreateGC) (pGC))) { wrap(pExaGC, pGC, funcs, &exaGCFuncs); wrap(pExaGC, pGC, ops, &exaOps); } swap(pExaScr, pScreen, CreateGC); return ret; } static Bool exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { Bool ret; ScreenPtr pScreen = pWin->drawable.pScreen; ExaScreenPriv(pScreen); if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); pExaScr->fallback_counter++; swap(pExaScr, pScreen, ChangeWindowAttributes); ret = pScreen->ChangeWindowAttributes(pWin, mask); swap(pExaScr, pScreen, ChangeWindowAttributes); pExaScr->fallback_counter--; if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); return ret; } static RegionPtr exaBitmapToRegion(PixmapPtr pPix) { RegionPtr ret; ScreenPtr pScreen = pPix->drawable.pScreen; ExaScreenPriv(pScreen); exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC); swap(pExaScr, pScreen, BitmapToRegion); ret = (*pScreen->BitmapToRegion) (pPix); swap(pExaScr, pScreen, BitmapToRegion); exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC); return ret; } static Bool exaCreateScreenResources(ScreenPtr pScreen) { ExaScreenPriv(pScreen); PixmapPtr pScreenPixmap; Bool b; swap(pExaScr, pScreen, CreateScreenResources); b = pScreen->CreateScreenResources(pScreen); swap(pExaScr, pScreen, CreateScreenResources); if (!b) return FALSE; pScreenPixmap = pScreen->GetScreenPixmap(pScreen); if (pScreenPixmap) { ExaPixmapPriv(pScreenPixmap); exaSetAccelBlock(pExaScr, pExaPixmap, pScreenPixmap->drawable.width, pScreenPixmap->drawable.height, pScreenPixmap->drawable.bitsPerPixel); } return TRUE; } static void ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { ExaScreenPriv(pScreen); /* Move any deferred results from a software fallback to the driver pixmap */ if (pExaScr->deferred_mixed_pixmap) exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); unwrap(pExaScr, pScreen, BlockHandler); (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); /* The rest only applies to classic EXA */ if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) return; /* Try and keep the offscreen memory area tidy every now and then (at most * once per second) when the server has been idle for at least 100ms. */ if (pExaScr->numOffscreenAvailable > 1) { CARD32 now = GetTimeInMillis(); pExaScr->nextDefragment = now + max(100, (INT32) (pExaScr->lastDefragment + 1000 - now)); AdjustWaitForDelay(pTimeout, pExaScr->nextDefragment - now); } } static void ExaWakeupHandler(ScreenPtr pScreen, unsigned long result, void *pReadmask) { ExaScreenPriv(pScreen); unwrap(pExaScr, pScreen, WakeupHandler); (*pScreen->WakeupHandler) (pScreen, result, pReadmask); wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); if (result == 0 && pExaScr->numOffscreenAvailable > 1) { CARD32 now = GetTimeInMillis(); if ((int) (now - pExaScr->nextDefragment) > 0) { ExaOffscreenDefragment(pScreen); pExaScr->lastDefragment = now; } } } /** * exaCloseScreen() unwraps its wrapped screen functions and tears down EXA's * screen private, before calling down to the next CloseSccreen. */ static Bool exaCloseScreen(ScreenPtr pScreen) { ExaScreenPriv(pScreen); PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); if (ps->Glyphs == exaGlyphs) exaGlyphsFini(pScreen); if (pScreen->BlockHandler == ExaBlockHandler) unwrap(pExaScr, pScreen, BlockHandler); if (pScreen->WakeupHandler == ExaWakeupHandler) unwrap(pExaScr, pScreen, WakeupHandler); unwrap(pExaScr, pScreen, CreateGC); unwrap(pExaScr, pScreen, CloseScreen); unwrap(pExaScr, pScreen, GetImage); unwrap(pExaScr, pScreen, GetSpans); if (pExaScr->SavedCreatePixmap) unwrap(pExaScr, pScreen, CreatePixmap); if (pExaScr->SavedDestroyPixmap) unwrap(pExaScr, pScreen, DestroyPixmap); if (pExaScr->SavedModifyPixmapHeader) unwrap(pExaScr, pScreen, ModifyPixmapHeader); unwrap(pExaScr, pScreen, CopyWindow); 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); unwrap(pExaScr, ps, Trapezoids); unwrap(pExaScr, ps, Triangles); unwrap(pExaScr, ps, AddTraps); free(pExaScr); return (*pScreen->CloseScreen) (pScreen); } /** * This function allocates a driver structure for EXA drivers to fill in. By * having EXA allocate the structure, the driver structure can be extended * without breaking ABI between EXA and the drivers. The driver's * responsibility is to check beforehand that the EXA module has a matching * major number and sufficient minor. Drivers are responsible for freeing the * driver structure using free(). * * @return a newly allocated, zero-filled driver structure */ ExaDriverPtr exaDriverAlloc(void) { return calloc(1, sizeof(ExaDriverRec)); } /** * @param pScreen screen being initialized * @param pScreenInfo EXA driver record * * exaDriverInit sets up EXA given a driver record filled in by the driver. * pScreenInfo should have been allocated by exaDriverAlloc(). See the * comments in _ExaDriver for what must be filled in and what is optional. * * @return TRUE if EXA was successfully initialized. */ Bool exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo) { ExaScreenPrivPtr pExaScr; PictureScreenPtr ps; if (!pScreenInfo) return FALSE; if (pScreenInfo->exa_major != EXA_VERSION_MAJOR || pScreenInfo->exa_minor > EXA_VERSION_MINOR) { LogMessage(X_ERROR, "EXA(%d): driver's EXA version requirements " "(%d.%d) are incompatible with EXA version (%d.%d)\n", pScreen->myNum, pScreenInfo->exa_major, pScreenInfo->exa_minor, EXA_VERSION_MAJOR, EXA_VERSION_MINOR); return FALSE; } if (!pScreenInfo->CreatePixmap && !pScreenInfo->CreatePixmap2) { if (!pScreenInfo->memoryBase) { LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::memoryBase " "must be non-zero\n", pScreen->myNum); return FALSE; } if (!pScreenInfo->memorySize) { LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::memorySize must be " "non-zero\n", pScreen->myNum); return FALSE; } if (pScreenInfo->offScreenBase > pScreenInfo->memorySize) { LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::offScreenBase must " "be <= ExaDriverRec::memorySize\n", pScreen->myNum); return FALSE; } } if (!pScreenInfo->PrepareSolid) { LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::PrepareSolid must be " "non-NULL\n", pScreen->myNum); return FALSE; } if (!pScreenInfo->PrepareCopy) { LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::PrepareCopy must be " "non-NULL\n", pScreen->myNum); return FALSE; } if (!pScreenInfo->WaitMarker) { LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::WaitMarker must be " "non-NULL\n", pScreen->myNum); return FALSE; } /* If the driver doesn't set any max pitch values, we'll just assume * that there's a limitation by pixels, and that it's the same as * maxX. * * We want maxPitchPixels or maxPitchBytes to be set so we can check * pixmaps against the max pitch in exaCreatePixmap() -- it matters * whether a pixmap is rejected because of its pitch or * because of its width. */ if (!pScreenInfo->maxPitchPixels && !pScreenInfo->maxPitchBytes) { pScreenInfo->maxPitchPixels = pScreenInfo->maxX; } ps = GetPictureScreenIfSet(pScreen); if (!dixRegisterPrivateKey(&exaScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) { LogMessage(X_WARNING, "EXA(%d): Failed to register screen private\n", pScreen->myNum); return FALSE; } pExaScr = calloc(sizeof(ExaScreenPrivRec), 1); if (!pExaScr) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate screen private\n", pScreen->myNum); return FALSE; } pExaScr->info = pScreenInfo; dixSetPrivate(&pScreen->devPrivates, exaScreenPrivateKey, pExaScr); pExaScr->migration = ExaMigrationAlways; exaDDXDriverInit(pScreen); if (!dixRegisterScreenSpecificPrivateKey (pScreen, &pExaScr->gcPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate GC private\n", pScreen->myNum); return FALSE; } /* * Replace various fb screen functions */ if ((pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) && (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS) || (pExaScr->info->flags & EXA_MIXED_PIXMAPS))) wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); if ((pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); wrap(pExaScr, pScreen, CreateGC, exaCreateGC); wrap(pExaScr, pScreen, CloseScreen, exaCloseScreen); wrap(pExaScr, pScreen, GetImage, exaGetImage); wrap(pExaScr, pScreen, GetSpans, ExaCheckGetSpans); wrap(pExaScr, pScreen, CopyWindow, exaCopyWindow); wrap(pExaScr, pScreen, ChangeWindowAttributes, exaChangeWindowAttributes); wrap(pExaScr, pScreen, BitmapToRegion, exaBitmapToRegion); wrap(pExaScr, pScreen, CreateScreenResources, exaCreateScreenResources); if (ps) { wrap(pExaScr, ps, Composite, exaComposite); if (pScreenInfo->PrepareComposite) { wrap(pExaScr, ps, Glyphs, exaGlyphs); } else { wrap(pExaScr, ps, Glyphs, ExaCheckGlyphs); } wrap(pExaScr, ps, Trapezoids, exaTrapezoids); wrap(pExaScr, ps, Triangles, exaTriangles); wrap(pExaScr, ps, AddTraps, ExaCheckAddTraps); } #ifdef MITSHM /* * Don't allow shared pixmaps. */ ShmRegisterFuncs(pScreen, &exaShmFuncs); #endif /* * Hookup offscreen pixmaps */ if (pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) { if (!dixRegisterScreenSpecificPrivateKey (pScreen, &pExaScr->pixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof(ExaPixmapPrivRec))) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate pixmap private\n", pScreen->myNum); return FALSE; } if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) { if (pExaScr->info->flags & EXA_MIXED_PIXMAPS) { wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_mixed); 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; pExaScr->do_move_out_pixmap = NULL; pExaScr->prepare_access_reg = exaPrepareAccessReg_mixed; } else { wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver); wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver); wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_driver); pExaScr->do_migration = NULL; pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_driver; pExaScr->do_move_in_pixmap = NULL; pExaScr->do_move_out_pixmap = NULL; pExaScr->prepare_access_reg = NULL; } } else { wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_classic); wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_classic); wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_classic); pExaScr->do_migration = exaDoMigration_classic; pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_classic; pExaScr->do_move_in_pixmap = exaMoveInPixmap_classic; pExaScr->do_move_out_pixmap = exaMoveOutPixmap_classic; pExaScr->prepare_access_reg = exaPrepareAccessReg_classic; } if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) { LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %lu bytes\n", pScreen->myNum, pExaScr->info->memorySize - pExaScr->info->offScreenBase); } else { LogMessage(X_INFO, "EXA(%d): Driver allocated offscreen pixmaps\n", pScreen->myNum); } } else LogMessage(X_INFO, "EXA(%d): No offscreen pixmaps\n", pScreen->myNum); if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) { DBG_PIXMAP(("============== %ld < %ld\n", pExaScr->info->offScreenBase, pExaScr->info->memorySize)); if (pExaScr->info->offScreenBase < pExaScr->info->memorySize) { if (!exaOffscreenInit(pScreen)) { LogMessage(X_WARNING, "EXA(%d): Offscreen pixmap setup failed\n", pScreen->myNum); return FALSE; } } } if (ps->Glyphs == exaGlyphs) exaGlyphsInit(pScreen); LogMessage(X_INFO, "EXA(%d): Driver registered support for the following" " operations:\n", pScreen->myNum); assert(pScreenInfo->PrepareSolid != NULL); LogMessage(X_INFO, " Solid\n"); assert(pScreenInfo->PrepareCopy != NULL); LogMessage(X_INFO, " Copy\n"); if (pScreenInfo->PrepareComposite != NULL) { LogMessage(X_INFO, " Composite (RENDER acceleration)\n"); } if (pScreenInfo->UploadToScreen != NULL) { LogMessage(X_INFO, " UploadToScreen\n"); } if (pScreenInfo->DownloadFromScreen != NULL) { LogMessage(X_INFO, " DownloadFromScreen\n"); } return TRUE; } /** * exaDriverFini tears down EXA on a given screen. * * @param pScreen screen being torn down. */ void exaDriverFini(ScreenPtr pScreen) { /*right now does nothing */ } /** * exaMarkSync() should be called after any asynchronous drawing by the hardware. * * @param pScreen screen which drawing occurred on * * exaMarkSync() sets a flag to indicate that some asynchronous drawing has * happened and a WaitSync() will be necessary before relying on the contents of * offscreen memory from the CPU's perspective. It also calls an optional * driver MarkSync() callback, the return value of which may be used to do partial * synchronization with the hardware in the future. */ void exaMarkSync(ScreenPtr pScreen) { ExaScreenPriv(pScreen); pExaScr->info->needsSync = TRUE; if (pExaScr->info->MarkSync != NULL) { pExaScr->info->lastMarker = (*pExaScr->info->MarkSync) (pScreen); } } /** * exaWaitSync() ensures that all drawing has been completed. * * @param pScreen screen being synchronized. * * Calls down into the driver to ensure that all previous drawing has completed. * It should always be called before relying on the framebuffer contents * reflecting previous drawing, from a CPU perspective. */ void exaWaitSync(ScreenPtr pScreen) { ExaScreenPriv(pScreen); if (pExaScr->info->needsSync && !pExaScr->swappedOut) { (*pExaScr->info->WaitMarker) (pScreen, pExaScr->info->lastMarker); pExaScr->info->needsSync = FALSE; } } /** * Performs migration of the pixmaps according to the operation information * provided in pixmaps and can_accel and the migration scheme chosen in the * config file. */ void exaDoMigration(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) { ScreenPtr pScreen = pixmaps[0].pPix->drawable.pScreen; ExaScreenPriv(pScreen); if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS)) return; if (pExaScr->do_migration) (*pExaScr->do_migration) (pixmaps, npixmaps, can_accel); } void exaMoveInPixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS)) return; if (pExaScr->do_move_in_pixmap) (*pExaScr->do_move_in_pixmap) (pPixmap); } void exaMoveOutPixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS)) return; if (pExaScr->do_move_out_pixmap) (*pExaScr->do_move_out_pixmap) (pPixmap); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_accel.c������������������������������������������������������������������0000664�0001751�0001751�00000123264�12432306326�013647� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2001 Keith Packard * * Partly based on code that is Copyright © 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. * * Authors: * Eric Anholt <eric@anholt.net> * Michel Dänzer <michel@tungstengraphics.com> * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "exa_priv.h" #include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #include "exa.h" static void exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, DDXPointPtr ppt, int *pwidth, int fSorted) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv(pScreen); RegionPtr pClip = fbGetCompositeClip(pGC); PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPixmap); BoxPtr pextent, pbox; int nbox; int extentX1, extentX2, extentY1, extentY2; int fullX1, fullX2, fullY1; int partX1, partX2; int off_x, off_y; if (pExaScr->fallback_counter || pExaScr->swappedOut || pGC->fillStyle != FillSolid || pExaPixmap->accel_blocked) { ExaCheckFillSpans(pDrawable, pGC, n, ppt, pwidth, fSorted); return; } if (pExaScr->do_migration) { ExaMigrationRec pixmaps[1]; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = NULL; exaDoMigration(pixmaps, 1, TRUE); } if (!(pPixmap = exaGetOffscreenPixmap(pDrawable, &off_x, &off_y)) || !(*pExaScr->info->PrepareSolid) (pPixmap, pGC->alu, pGC->planemask, pGC->fgPixel)) { ExaCheckFillSpans(pDrawable, pGC, n, ppt, pwidth, fSorted); return; } pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; extentY2 = pextent->y2; while (n--) { fullX1 = ppt->x; fullY1 = ppt->y; fullX2 = fullX1 + (int) *pwidth; ppt++; pwidth++; if (fullY1 < extentY1 || extentY2 <= fullY1) continue; if (fullX1 < extentX1) fullX1 = extentX1; if (fullX2 > extentX2) fullX2 = extentX2; if (fullX1 >= fullX2) continue; nbox = RegionNumRects(pClip); if (nbox == 1) { (*pExaScr->info->Solid) (pPixmap, fullX1 + off_x, fullY1 + off_y, fullX2 + off_x, fullY1 + 1 + off_y); } else { pbox = RegionRects(pClip); while (nbox--) { if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) { partX1 = pbox->x1; if (partX1 < fullX1) partX1 = fullX1; partX2 = pbox->x2; if (partX2 > fullX2) partX2 = fullX2; if (partX2 > partX1) { (*pExaScr->info->Solid) (pPixmap, partX1 + off_x, fullY1 + off_y, partX2 + off_x, fullY1 + 1 + off_y); } } pbox++; } } } (*pExaScr->info->DoneSolid) (pPixmap); exaMarkSync(pScreen); } static Bool exaDoPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int format, char *bits, int src_stride) { ExaScreenPriv(pDrawable->pScreen); PixmapPtr pPix = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPix); RegionPtr pClip; BoxPtr pbox; int nbox; int xoff, yoff; int bpp = pDrawable->bitsPerPixel; Bool ret = TRUE; if (pExaScr->fallback_counter || pExaPixmap->accel_blocked || !pExaScr->info->UploadToScreen) return FALSE; /* If there's a system copy, we want to save the result there */ if (pExaPixmap->pDamage) return FALSE; /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) return FALSE; /* Only accelerate copies: no rop or planemask. */ if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy) return FALSE; if (pExaScr->swappedOut) return FALSE; if (pExaScr->do_migration) { ExaMigrationRec pixmaps[1]; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPix; pixmaps[0].pReg = DamagePendingRegion(pExaPixmap->pDamage); exaDoMigration(pixmaps, 1, TRUE); } pPix = exaGetOffscreenPixmap(pDrawable, &xoff, &yoff); if (!pPix) return FALSE; x += pDrawable->x; y += pDrawable->y; pClip = fbGetCompositeClip(pGC); for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { int x1 = x; int y1 = y; int x2 = x + w; int y2 = y + h; char *src; Bool ok; if (x1 < pbox->x1) x1 = pbox->x1; if (y1 < pbox->y1) y1 = pbox->y1; if (x2 > pbox->x2) x2 = pbox->x2; if (y2 > pbox->y2) y2 = pbox->y2; if (x1 >= x2 || y1 >= y2) continue; src = bits + (y1 - y) * src_stride + (x1 - x) * (bpp / 8); ok = pExaScr->info->UploadToScreen(pPix, x1 + xoff, y1 + yoff, x2 - x1, y2 - y1, src, src_stride); /* We have to fall back completely, and ignore what has already been completed. * Messing with the fb layer directly like we used to is completely unacceptable. */ if (!ok) { ret = FALSE; break; } } if (ret) exaMarkSync(pDrawable->pScreen); return ret; } static void exaPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { if (!exaDoPutImage(pDrawable, pGC, depth, x, y, w, h, format, bits, PixmapBytePad(w, pDrawable->depth))) ExaCheckPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); } static Bool inline exaCopyNtoNTwoDir(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy) { ExaScreenPriv(pDstDrawable->pScreen); PixmapPtr pSrcPixmap, pDstPixmap; int src_off_x, src_off_y, dst_off_x, dst_off_y; int dirsetup; /* Need to get both pixmaps to call the driver routines */ pSrcPixmap = exaGetOffscreenPixmap(pSrcDrawable, &src_off_x, &src_off_y); pDstPixmap = exaGetOffscreenPixmap(pDstDrawable, &dst_off_x, &dst_off_y); if (!pSrcPixmap || !pDstPixmap) return FALSE; /* * 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++, nbox--) { if (dx >= 0 && (src_off_y + pbox->y1 + dy) != pbox->y1) { /* Do a xdir = ydir = -1 blit instead. */ if (dirsetup != -1) { if (dirsetup != 0) pExaScr->info->DoneCopy(pDstPixmap); dirsetup = -1; if (!(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, -1, -1, pGC ? pGC->alu : GXcopy, pGC ? pGC->planemask : FB_ALLONES)) return FALSE; } (*pExaScr->info->Copy) (pDstPixmap, src_off_x + pbox->x1 + dx, src_off_y + pbox->y1 + dy, dst_off_x + pbox->x1, dst_off_y + pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); } else if (dx < 0 && (src_off_y + pbox->y1 + dy) != pbox->y1) { /* Do a xdir = ydir = 1 blit instead. */ if (dirsetup != 1) { if (dirsetup != 0) pExaScr->info->DoneCopy(pDstPixmap); dirsetup = 1; if (!(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, 1, 1, pGC ? pGC->alu : GXcopy, pGC ? pGC->planemask : FB_ALLONES)) return FALSE; } (*pExaScr->info->Copy) (pDstPixmap, src_off_x + pbox->x1 + dx, src_off_y + pbox->y1 + dy, dst_off_x + pbox->x1, dst_off_y + pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); } else if (dx >= 0) { /* * xdir = 1, ydir = -1. * Perform line-by-line xdir = ydir = 1 blits, going up. */ int i; if (dirsetup != 1) { if (dirsetup != 0) pExaScr->info->DoneCopy(pDstPixmap); dirsetup = 1; if (!(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, 1, 1, pGC ? pGC->alu : GXcopy, pGC ? pGC->planemask : FB_ALLONES)) return FALSE; } for (i = pbox->y2 - pbox->y1 - 1; i >= 0; i--) (*pExaScr->info->Copy) (pDstPixmap, src_off_x + pbox->x1 + dx, src_off_y + pbox->y1 + dy + i, dst_off_x + pbox->x1, dst_off_y + 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) { if (dirsetup != 0) pExaScr->info->DoneCopy(pDstPixmap); dirsetup = -1; if (!(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, -1, -1, pGC ? pGC->alu : GXcopy, pGC ? pGC->planemask : FB_ALLONES)) return FALSE; } for (i = 0; i < pbox->y2 - pbox->y1; i++) (*pExaScr->info->Copy) (pDstPixmap, src_off_x + pbox->x1 + dx, src_off_y + pbox->y1 + dy + i, dst_off_x + pbox->x1, dst_off_y + pbox->y1 + i, pbox->x2 - pbox->x1, 1); } } if (dirsetup != 0) pExaScr->info->DoneCopy(pDstPixmap); exaMarkSync(pDstDrawable->pScreen); return TRUE; } Bool exaHWCopyNtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown) { ExaScreenPriv(pDstDrawable->pScreen); PixmapPtr pSrcPixmap, pDstPixmap; ExaPixmapPrivPtr pSrcExaPixmap, pDstExaPixmap; int src_off_x, src_off_y; int dst_off_x, dst_off_y; RegionPtr srcregion = NULL, dstregion = NULL; xRectangle *rects; Bool ret = TRUE; /* avoid doing copy operations if no boxes */ if (nbox == 0) return TRUE; pSrcPixmap = exaGetDrawablePixmap(pSrcDrawable); pDstPixmap = exaGetDrawablePixmap(pDstDrawable); exaGetDrawableDeltas(pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y); exaGetDrawableDeltas(pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y); rects = malloc(nbox * sizeof(xRectangle)); if (rects) { int i; int ordering; for (i = 0; i < nbox; i++) { rects[i].x = pbox[i].x1 + dx + src_off_x; rects[i].y = pbox[i].y1 + dy + src_off_y; rects[i].width = pbox[i].x2 - pbox[i].x1; rects[i].height = pbox[i].y2 - pbox[i].y1; } /* This must match the RegionCopy() logic for reversing rect order */ if (nbox == 1 || (dx > 0 && dy > 0) || (pDstDrawable != pSrcDrawable && (pDstDrawable->type != DRAWABLE_WINDOW || pSrcDrawable->type != DRAWABLE_WINDOW))) ordering = CT_YXBANDED; else ordering = CT_UNSORTED; srcregion = RegionFromRects(nbox, rects, ordering); free(rects); if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask, pGC->fillStyle, pGC->alu, pGC->clientClip != NULL)) { dstregion = RegionCreate(NullBox, 0); RegionCopy(dstregion, srcregion); RegionTranslate(dstregion, dst_off_x - dx - src_off_x, dst_off_y - dy - src_off_y); } } pSrcExaPixmap = ExaGetPixmapPriv(pSrcPixmap); pDstExaPixmap = ExaGetPixmapPriv(pDstPixmap); /* Check whether the accelerator can use this pixmap. * If the pitch of the pixmaps is out of range, there's nothing * we can do but fall back to software rendering. */ if (pSrcExaPixmap->accel_blocked & EXA_RANGE_PITCH || pDstExaPixmap->accel_blocked & EXA_RANGE_PITCH) goto fallback; /* If the width or the height of either of the pixmaps * is out of range, check whether the boxes are actually out of the * addressable range as well. If they aren't, we can still do * the copying in hardware. */ if (pSrcExaPixmap->accel_blocked || pDstExaPixmap->accel_blocked) { int i; for (i = 0; i < nbox; i++) { /* src */ if ((pbox[i].x2 + dx + src_off_x) >= pExaScr->info->maxX || (pbox[i].y2 + dy + src_off_y) >= pExaScr->info->maxY) goto fallback; /* dst */ if ((pbox[i].x2 + dst_off_x) >= pExaScr->info->maxX || (pbox[i].y2 + dst_off_y) >= pExaScr->info->maxY) goto fallback; } } if (pExaScr->do_migration) { ExaMigrationRec pixmaps[2]; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pDstPixmap; pixmaps[0].pReg = dstregion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pSrcPixmap; pixmaps[1].pReg = srcregion; exaDoMigration(pixmaps, 2, TRUE); } /* Mixed directions must be handled specially if the card is lame */ if ((pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) && reverse != upsidedown) { if (exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy)) goto out; goto fallback; } if (exaPixmapHasGpuCopy(pDstPixmap)) { /* Normal blitting. */ if (exaPixmapHasGpuCopy(pSrcPixmap)) { if (!(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, reverse ? -1 : 1, upsidedown ? -1 : 1, pGC ? pGC->alu : GXcopy, pGC ? pGC->planemask : FB_ALLONES)) { goto fallback; } while (nbox--) { (*pExaScr->info->Copy) (pDstPixmap, pbox->x1 + dx + src_off_x, pbox->y1 + dy + src_off_y, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; } (*pExaScr->info->DoneCopy) (pDstPixmap); exaMarkSync(pDstDrawable->pScreen); /* UTS: mainly for SHM PutImage's secondary path. * * Only taking this path for directly accessible pixmaps. */ } else if (!pDstExaPixmap->pDamage && pSrcExaPixmap->sys_ptr) { int bpp = pSrcDrawable->bitsPerPixel; int src_stride = exaGetPixmapPitch(pSrcPixmap); CARD8 *src = NULL; if (!pExaScr->info->UploadToScreen) goto fallback; if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel) goto fallback; if (pSrcDrawable->bitsPerPixel < 8) goto fallback; if (pGC && !(pGC->alu == GXcopy && EXA_PM_IS_SOLID(pSrcDrawable, pGC->planemask))) goto fallback; while (nbox--) { src = pSrcExaPixmap->sys_ptr + (pbox->y1 + dy + src_off_y) * src_stride + (pbox->x1 + dx + src_off_x) * (bpp / 8); if (!pExaScr->info-> UploadToScreen(pDstPixmap, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, (char *) src, src_stride)) goto fallback; pbox++; } } else goto fallback; } else goto fallback; goto out; fallback: ret = FALSE; out: if (dstregion) { RegionUninit(dstregion); RegionDestroy(dstregion); } if (srcregion) { RegionUninit(srcregion); RegionDestroy(srcregion); } return ret; } void exaCopyNtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { ExaScreenPriv(pDstDrawable->pScreen); if (pExaScr->fallback_counter || (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW)) return; if (exaHWCopyNtoN (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, upsidedown)) return; /* This is a CopyWindow, it's cleaner to fallback at the original call. */ if (pExaScr->fallback_flags & EXA_ACCEL_COPYWINDOW) { pExaScr->fallback_flags |= EXA_FALLBACK_COPYWINDOW; return; } /* fallback */ ExaCheckCopyNtoN(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } RegionPtr exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { ExaScreenPriv(pDstDrawable->pScreen); if (pExaScr->fallback_counter || pExaScr->swappedOut) { return ExaCheckCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty); } return miDoCopy(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, exaCopyNtoN, 0, NULL); } static void exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { ExaScreenPriv(pDrawable->pScreen); int i; xRectangle *prect; /* If we can't reuse the current GC as is, don't bother accelerating the * points. */ if (pExaScr->fallback_counter || pGC->fillStyle != FillSolid) { ExaCheckPolyPoint(pDrawable, pGC, mode, npt, ppt); return; } prect = malloc(sizeof(xRectangle) * npt); for (i = 0; i < npt; i++) { prect[i].x = ppt[i].x; prect[i].y = ppt[i].y; if (i > 0 && mode == CoordModePrevious) { prect[i].x += prect[i - 1].x; prect[i].y += prect[i - 1].y; } prect[i].width = 1; prect[i].height = 1; } pGC->ops->PolyFillRect(pDrawable, pGC, npt, prect); free(prect); } /** * exaPolylines() checks if it can accelerate the lines as a group of * horizontal or vertical lines (rectangles), and uses existing rectangle fill * acceleration if so. */ static void exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { ExaScreenPriv(pDrawable->pScreen); xRectangle *prect; int x1, x2, y1, y2; int i; if (pExaScr->fallback_counter) { ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt); return; } /* Don't try to do wide lines or non-solid fill style. */ if (pGC->lineWidth != 0 || pGC->lineStyle != LineSolid || pGC->fillStyle != FillSolid) { ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt); return; } prect = malloc(sizeof(xRectangle) * (npt - 1)); x1 = ppt[0].x; y1 = ppt[0].y; /* If we have any non-horizontal/vertical, fall back. */ for (i = 0; i < npt - 1; i++) { if (mode == CoordModePrevious) { x2 = x1 + ppt[i + 1].x; y2 = y1 + ppt[i + 1].y; } else { x2 = ppt[i + 1].x; y2 = ppt[i + 1].y; } if (x1 != x2 && y1 != y2) { free(prect); ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt); return; } if (x1 < x2) { prect[i].x = x1; prect[i].width = x2 - x1 + 1; } else { prect[i].x = x2; prect[i].width = x1 - x2 + 1; } if (y1 < y2) { prect[i].y = y1; prect[i].height = y2 - y1 + 1; } else { prect[i].y = y2; prect[i].height = y1 - y2 + 1; } x1 = x2; y1 = y2; } pGC->ops->PolyFillRect(pDrawable, pGC, npt - 1, prect); free(prect); } /** * exaPolySegment() checks if it can accelerate the lines as a group of * horizontal or vertical lines (rectangles), and uses existing rectangle fill * acceleration if so. */ static void exaPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg) { ExaScreenPriv(pDrawable->pScreen); xRectangle *prect; int i; /* Don't try to do wide lines or non-solid fill style. */ if (pExaScr->fallback_counter || pGC->lineWidth != 0 || pGC->lineStyle != LineSolid || pGC->fillStyle != FillSolid) { ExaCheckPolySegment(pDrawable, pGC, nseg, pSeg); return; } /* If we have any non-horizontal/vertical, fall back. */ for (i = 0; i < nseg; i++) { if (pSeg[i].x1 != pSeg[i].x2 && pSeg[i].y1 != pSeg[i].y2) { ExaCheckPolySegment(pDrawable, pGC, nseg, pSeg); return; } } prect = malloc(sizeof(xRectangle) * nseg); for (i = 0; i < nseg; i++) { if (pSeg[i].x1 < pSeg[i].x2) { prect[i].x = pSeg[i].x1; prect[i].width = pSeg[i].x2 - pSeg[i].x1 + 1; } else { prect[i].x = pSeg[i].x2; prect[i].width = pSeg[i].x1 - pSeg[i].x2 + 1; } if (pSeg[i].y1 < pSeg[i].y2) { prect[i].y = pSeg[i].y1; prect[i].height = pSeg[i].y2 - pSeg[i].y1 + 1; } else { prect[i].y = pSeg[i].y2; prect[i].height = pSeg[i].y1 - pSeg[i].y2 + 1; } /* don't paint last pixel */ if (pGC->capStyle == CapNotLast) { if (prect[i].width == 1) prect[i].height--; else prect[i].width--; } } pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect); free(prect); } static Bool exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, CARD32 planemask, CARD32 alu, Bool hasClientClip); static void exaPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect) { ExaScreenPriv(pDrawable->pScreen); RegionPtr pClip = fbGetCompositeClip(pGC); PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPixmap); register BoxPtr pbox; BoxPtr pextent; int extentX1, extentX2, extentY1, extentY2; int fullX1, fullX2, fullY1, fullY2; int partX1, partX2, partY1, partY2; int xoff, yoff; int xorg, yorg; int n; RegionPtr pReg = RegionFromRects(nrect, prect, CT_UNSORTED); /* Compute intersection of rects and clip region */ RegionTranslate(pReg, pDrawable->x, pDrawable->y); RegionIntersect(pReg, pClip, pReg); if (!RegionNumRects(pReg)) { goto out; } exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); if (pExaScr->fallback_counter || pExaScr->swappedOut || pExaPixmap->accel_blocked) { goto fallback; } /* For ROPs where overlaps don't matter, convert rectangles to region and * call exaFillRegion{Solid,Tiled}. */ if ((pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled) && (nrect == 1 || pGC->alu == GXcopy || pGC->alu == GXclear || pGC->alu == GXnoop || pGC->alu == GXcopyInverted || pGC->alu == GXset)) { if (((pGC->fillStyle == FillSolid || pGC->tileIsPixel) && exaFillRegionSolid(pDrawable, pReg, pGC->fillStyle == FillSolid ? pGC->fgPixel : pGC->tile.pixel, pGC->planemask, pGC->alu, pGC->clientClip != NULL)) || (pGC->fillStyle == FillTiled && !pGC->tileIsPixel && exaFillRegionTiled(pDrawable, pReg, pGC->tile.pixmap, &pGC->patOrg, pGC->planemask, pGC->alu, pGC->clientClip != NULL))) { goto out; } } if (pGC->fillStyle != FillSolid && !(pGC->tileIsPixel && pGC->fillStyle == FillTiled)) { goto fallback; } if (pExaScr->do_migration) { ExaMigrationRec pixmaps[1]; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = NULL; exaDoMigration(pixmaps, 1, TRUE); } if (!exaPixmapHasGpuCopy(pPixmap) || !(*pExaScr->info->PrepareSolid) (pPixmap, pGC->alu, pGC->planemask, pGC->fgPixel)) { fallback: ExaCheckPolyFillRect(pDrawable, pGC, nrect, prect); goto out; } xorg = pDrawable->x; yorg = pDrawable->y; pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; extentY2 = pextent->y2; while (nrect--) { fullX1 = prect->x + xorg; fullY1 = prect->y + yorg; fullX2 = fullX1 + (int) prect->width; fullY2 = fullY1 + (int) prect->height; prect++; if (fullX1 < extentX1) fullX1 = extentX1; if (fullY1 < extentY1) fullY1 = extentY1; if (fullX2 > extentX2) fullX2 = extentX2; if (fullY2 > extentY2) fullY2 = extentY2; if ((fullX1 >= fullX2) || (fullY1 >= fullY2)) continue; n = RegionNumRects(pClip); if (n == 1) { (*pExaScr->info->Solid) (pPixmap, fullX1 + xoff, fullY1 + yoff, fullX2 + xoff, fullY2 + yoff); } else { pbox = RegionRects(pClip); /* * clip the rectangle to each box in the clip region * this is logically equivalent to calling Intersect(), * but rectangles may overlap each other here. */ while (n--) { partX1 = pbox->x1; if (partX1 < fullX1) partX1 = fullX1; partY1 = pbox->y1; if (partY1 < fullY1) partY1 = fullY1; partX2 = pbox->x2; if (partX2 > fullX2) partX2 = fullX2; partY2 = pbox->y2; if (partY2 > fullY2) partY2 = fullY2; pbox++; if (partX1 < partX2 && partY1 < partY2) { (*pExaScr->info->Solid) (pPixmap, partX1 + xoff, partY1 + yoff, partX2 + xoff, partY2 + yoff); } } } } (*pExaScr->info->DoneSolid) (pPixmap); exaMarkSync(pDrawable->pScreen); out: RegionUninit(pReg); RegionDestroy(pReg); } const GCOps exaOps = { exaFillSpans, ExaCheckSetSpans, exaPutImage, exaCopyArea, ExaCheckCopyPlane, exaPolyPoint, exaPolylines, exaPolySegment, miPolyRectangle, ExaCheckPolyArc, miFillPolygon, exaPolyFillRect, miPolyFillArc, miPolyText8, miPolyText16, miImageText8, miImageText16, ExaCheckImageGlyphBlt, ExaCheckPolyGlyphBlt, ExaCheckPushPixels, }; void exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { RegionRec rgnDst; int dx, dy; PixmapPtr pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin); ExaScreenPriv(pWin->drawable.pScreen); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; RegionTranslate(prgnSrc, -dx, -dy); RegionInit(&rgnDst, NullBox, 0); RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); #ifdef COMPOSITE if (pPixmap->screen_x || pPixmap->screen_y) RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); #endif if (pExaScr->fallback_counter) { pExaScr->fallback_flags |= EXA_FALLBACK_COPYWINDOW; goto fallback; } pExaScr->fallback_flags |= EXA_ACCEL_COPYWINDOW; miCopyRegion(&pPixmap->drawable, &pPixmap->drawable, NULL, &rgnDst, dx, dy, exaCopyNtoN, 0, NULL); pExaScr->fallback_flags &= ~EXA_ACCEL_COPYWINDOW; fallback: RegionUninit(&rgnDst); if (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW) { pExaScr->fallback_flags &= ~EXA_FALLBACK_COPYWINDOW; RegionTranslate(prgnSrc, dx, dy); ExaCheckCopyWindow(pWin, ptOldOrg, prgnSrc); } } static Bool exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, CARD32 planemask, CARD32 alu, Bool hasClientClip) { ExaScreenPriv(pDrawable->pScreen); PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPixmap); int xoff, yoff; Bool ret = FALSE; exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); RegionTranslate(pRegion, xoff, yoff); if (pExaScr->fallback_counter || pExaPixmap->accel_blocked) goto out; if (pExaScr->do_migration) { ExaMigrationRec pixmaps[1]; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillSolid, alu, hasClientClip) ? NULL : pRegion; exaDoMigration(pixmaps, 1, TRUE); } if (exaPixmapHasGpuCopy(pPixmap) && (*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel)) { int nbox; BoxPtr pBox; nbox = RegionNumRects(pRegion); pBox = RegionRects(pRegion); while (nbox--) { (*pExaScr->info->Solid) (pPixmap, pBox->x1, pBox->y1, pBox->x2, pBox->y2); pBox++; } (*pExaScr->info->DoneSolid) (pPixmap); exaMarkSync(pDrawable->pScreen); if (pExaPixmap->pDamage && pExaPixmap->sys_ptr && pDrawable->type == DRAWABLE_PIXMAP && pDrawable->width == 1 && pDrawable->height == 1 && pDrawable->bitsPerPixel != 24) { RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); switch (pDrawable->bitsPerPixel) { case 32: *(CARD32 *) pExaPixmap->sys_ptr = pixel; break; case 16: *(CARD16 *) pExaPixmap->sys_ptr = pixel; break; case 8: case 4: case 1: *(CARD8 *) pExaPixmap->sys_ptr = pixel; } RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys, pRegion); RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB, pRegion); RegionSubtract(pending_damage, pending_damage, pRegion); } ret = TRUE; } out: RegionTranslate(pRegion, -xoff, -yoff); return ret; } /* Try to do an accelerated tile of the pTile into pRegion of pDrawable. * Based on fbFillRegionTiled(), fbTile(). */ Bool exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu, Bool hasClientClip) { ExaScreenPriv(pDrawable->pScreen); PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile); int xoff, yoff; int tileWidth, tileHeight; int nbox = RegionNumRects(pRegion); BoxPtr pBox = RegionRects(pRegion); Bool ret = FALSE; int i; tileWidth = pTile->drawable.width; tileHeight = pTile->drawable.height; /* If we're filling with a solid color, grab it out and go to * FillRegionSolid, saving numerous copies. */ if (tileWidth == 1 && tileHeight == 1) return exaFillRegionSolid(pDrawable, pRegion, exaGetPixmapFirstPixel(pTile), planemask, alu, hasClientClip); pPixmap = exaGetDrawablePixmap(pDrawable); pExaPixmap = ExaGetPixmapPriv(pPixmap); if (pExaScr->fallback_counter || pExaPixmap->accel_blocked || pTileExaPixmap->accel_blocked) return FALSE; if (pExaScr->do_migration) { ExaMigrationRec pixmaps[2]; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillTiled, alu, hasClientClip) ? NULL : pRegion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pTile; pixmaps[1].pReg = NULL; exaDoMigration(pixmaps, 2, TRUE); } pPixmap = exaGetOffscreenPixmap(pDrawable, &xoff, &yoff); if (!pPixmap || !exaPixmapHasGpuCopy(pTile)) return FALSE; if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask)) { if (xoff || yoff) RegionTranslate(pRegion, xoff, yoff); for (i = 0; i < nbox; i++) { int height = pBox[i].y2 - pBox[i].y1; int dstY = pBox[i].y1; int tileY; if (alu == GXcopy) height = min(height, tileHeight); modulus(dstY - yoff - pDrawable->y - pPatOrg->y, tileHeight, tileY); while (height > 0) { int width = pBox[i].x2 - pBox[i].x1; int dstX = pBox[i].x1; int tileX; int h = tileHeight - tileY; if (alu == GXcopy) width = min(width, tileWidth); if (h > height) h = height; height -= h; modulus(dstX - xoff - pDrawable->x - pPatOrg->x, tileWidth, tileX); while (width > 0) { int w = tileWidth - tileX; if (w > width) w = width; width -= w; (*pExaScr->info->Copy) (pPixmap, tileX, tileY, dstX, dstY, w, h); dstX += w; tileX = 0; } dstY += h; tileY = 0; } } (*pExaScr->info->DoneCopy) (pPixmap); /* With GXcopy, we only need to do the basic algorithm up to the tile * size; then, we can just keep doubling the destination in each * direction until it fills the box. This way, the number of copy * operations is O(log(rx)) + O(log(ry)) instead of O(rx * ry), where * rx/ry is the ratio between box and tile width/height. This can make * a big difference if each driver copy incurs a significant constant * overhead. */ if (alu != GXcopy) ret = TRUE; else { Bool more_copy = FALSE; for (i = 0; i < nbox; i++) { int dstX = pBox[i].x1 + tileWidth; int dstY = pBox[i].y1 + tileHeight; if ((dstX < pBox[i].x2) || (dstY < pBox[i].y2)) { more_copy = TRUE; break; } } if (more_copy == FALSE) ret = TRUE; if (more_copy && (*pExaScr->info->PrepareCopy) (pPixmap, pPixmap, 1, 1, alu, planemask)) { for (i = 0; i < nbox; i++) { int dstX = pBox[i].x1 + tileWidth; int dstY = pBox[i].y1 + tileHeight; int width = min(pBox[i].x2 - dstX, tileWidth); int height = min(pBox[i].y2 - pBox[i].y1, tileHeight); while (dstX < pBox[i].x2) { (*pExaScr->info->Copy) (pPixmap, pBox[i].x1, pBox[i].y1, dstX, pBox[i].y1, width, height); dstX += width; width = min(pBox[i].x2 - dstX, width * 2); } width = pBox[i].x2 - pBox[i].x1; height = min(pBox[i].y2 - dstY, tileHeight); while (dstY < pBox[i].y2) { (*pExaScr->info->Copy) (pPixmap, pBox[i].x1, pBox[i].y1, pBox[i].x1, dstY, width, height); dstY += height; height = min(pBox[i].y2 - dstY, height * 2); } } (*pExaScr->info->DoneCopy) (pPixmap); ret = TRUE; } } exaMarkSync(pDrawable->pScreen); if (xoff || yoff) RegionTranslate(pRegion, -xoff, -yoff); } return ret; } /** * Accelerates GetImage for solid ZPixmap downloads from framebuffer memory. * * This is probably the only case we actually care about. The rest fall through * to migration and fbGetImage, which hopefully will result in migration pushing * the pixmap out of framebuffer. */ void exaGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d) { ExaScreenPriv(pDrawable->pScreen); PixmapPtr pPix = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPix); int xoff, yoff; Bool ok; if (pExaScr->fallback_counter || pExaScr->swappedOut) goto fallback; /* If there's a system copy, we want to save the result there */ if (pExaPixmap->pDamage) goto fallback; pPix = exaGetOffscreenPixmap(pDrawable, &xoff, &yoff); if (pPix == NULL || pExaScr->info->DownloadFromScreen == NULL) goto fallback; /* Only cover the ZPixmap, solid copy case. */ if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask)) goto fallback; /* Only try to handle the 8bpp and up cases, since we don't want to think * about <8bpp. */ if (pDrawable->bitsPerPixel < 8) goto fallback; ok = pExaScr->info->DownloadFromScreen(pPix, pDrawable->x + x + xoff, pDrawable->y + y + yoff, w, h, d, PixmapBytePad(w, pDrawable->depth)); if (ok) { exaWaitSync(pDrawable->pScreen); return; } fallback: ExaCheckGetImage(pDrawable, x, y, w, h, format, planeMask, d); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_migration_classic.c������������������������������������������������������0000664�0001751�0001751�00000057516�12352615641�016304� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2006 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt <eric@anholt.net> * Michel Dänzer <michel@tungstengraphics.com> * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include "exa_priv.h" #include "exa.h" #if DEBUG_MIGRATE #define DBG_MIGRATE(a) ErrorF a #else #define DBG_MIGRATE(a) #endif /** * The fallback path for UTS/DFS failing is to just memcpy. exaCopyDirtyToSys * and exaCopyDirtyToFb both needed to do this loop. */ static void exaMemcpyBox(PixmapPtr pPixmap, BoxPtr pbox, CARD8 *src, int src_pitch, CARD8 *dst, int dst_pitch) { int i, cpp = pPixmap->drawable.bitsPerPixel / 8; int bytes = (pbox->x2 - pbox->x1) * cpp; src += pbox->y1 * src_pitch + pbox->x1 * cpp; dst += pbox->y1 * dst_pitch + pbox->x1 * cpp; for (i = pbox->y2 - pbox->y1; i; i--) { memcpy(dst, src, bytes); src += src_pitch; dst += dst_pitch; } } /** * Returns TRUE if the pixmap is dirty (has been modified in its current * location compared to the other), or lacks a private for tracking * dirtiness. */ static Bool exaPixmapIsDirty(PixmapPtr pPix) { ExaPixmapPriv(pPix); if (pExaPixmap == NULL) EXA_FatalErrorDebugWithRet(("EXA bug: exaPixmapIsDirty was called on a non-exa pixmap.\n"), TRUE); if (!pExaPixmap->pDamage) return FALSE; return RegionNotEmpty(DamageRegion(pExaPixmap->pDamage)) || !RegionEqual(&pExaPixmap->validSys, &pExaPixmap->validFB); } /** * Returns TRUE if the pixmap is either pinned in FB, or has a sufficient score * to be considered "should be in framebuffer". That's just anything that has * had more acceleration than fallbacks, or has no score yet. * * Only valid if using a migration scheme that tracks score. */ static Bool exaPixmapShouldBeInFB(PixmapPtr pPix) { ExaPixmapPriv(pPix); if (exaPixmapIsPinned(pPix)) return TRUE; return pExaPixmap->score >= 0; } /** * If the pixmap is currently dirty, this copies at least the dirty area from * FB to system or vice versa. Both areas must be allocated. */ static void exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h, char *sys, int sys_pitch), int fallback_index, void (*sync) (ScreenPtr pScreen)) { PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv(pPixmap); RegionPtr damage = DamageRegion(pExaPixmap->pDamage); RegionRec CopyReg; Bool save_use_gpu_copy; int save_pitch; BoxPtr pBox; int nbox; Bool access_prepared = FALSE; Bool need_sync = FALSE; /* Damaged bits are valid in current copy but invalid in other one */ if (pExaPixmap->use_gpu_copy) { RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB, damage); RegionSubtract(&pExaPixmap->validSys, &pExaPixmap->validSys, damage); } else { RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys, damage); RegionSubtract(&pExaPixmap->validFB, &pExaPixmap->validFB, damage); } RegionEmpty(damage); /* Copy bits valid in source but not in destination */ RegionNull(&CopyReg); RegionSubtract(&CopyReg, pValidSrc, pValidDst); if (migrate->as_dst) { ExaScreenPriv(pPixmap->drawable.pScreen); /* XXX: The pending damage region will be marked as damaged after the * operation, so it should serve as an upper bound for the region that * needs to be synchronized for the operation. Unfortunately, this * causes corruption in some cases, e.g. when starting compiz. See * https://bugs.freedesktop.org/show_bug.cgi?id=12916 . */ if (pExaScr->optimize_migration) { RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); #if DEBUG_MIGRATE if (RegionNil(pending_damage)) { static Bool firsttime = TRUE; if (firsttime) { ErrorF("%s: Pending damage region empty!\n", __func__); firsttime = FALSE; } } #endif /* Try to prevent destination valid region from growing too many * rects by filling it up to the extents of the union of the * destination valid region and the pending damage region. */ if (RegionNumRects(pValidDst) > 10) { BoxRec box; BoxPtr pValidExt, pDamageExt; RegionRec closure; pValidExt = RegionExtents(pValidDst); pDamageExt = RegionExtents(pending_damage); box.x1 = min(pValidExt->x1, pDamageExt->x1); box.y1 = min(pValidExt->y1, pDamageExt->y1); box.x2 = max(pValidExt->x2, pDamageExt->x2); box.y2 = max(pValidExt->y2, pDamageExt->y2); RegionInit(&closure, &box, 0); RegionIntersect(&CopyReg, &CopyReg, &closure); } else RegionIntersect(&CopyReg, &CopyReg, pending_damage); } /* The caller may provide a region to be subtracted from the calculated * dirty region. This is to avoid migration of bits that don't * contribute to the result of the operation. */ if (migrate->pReg) RegionSubtract(&CopyReg, &CopyReg, migrate->pReg); } else { /* The caller may restrict the region to be migrated for source pixmaps * to what's relevant for the operation. */ if (migrate->pReg) RegionIntersect(&CopyReg, &CopyReg, migrate->pReg); } pBox = RegionRects(&CopyReg); nbox = RegionNumRects(&CopyReg); save_use_gpu_copy = pExaPixmap->use_gpu_copy; save_pitch = pPixmap->devKind; pExaPixmap->use_gpu_copy = TRUE; pPixmap->devKind = pExaPixmap->fb_pitch; while (nbox--) { pBox->x1 = max(pBox->x1, 0); pBox->y1 = max(pBox->y1, 0); pBox->x2 = min(pBox->x2, pPixmap->drawable.width); pBox->y2 = min(pBox->y2, pPixmap->drawable.height); if (pBox->x1 >= pBox->x2 || pBox->y1 >= pBox->y2) continue; if (!transfer || !transfer(pPixmap, pBox->x1, pBox->y1, pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, (char *) (pExaPixmap->sys_ptr + pBox->y1 * pExaPixmap->sys_pitch + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8), pExaPixmap->sys_pitch)) { if (!access_prepared) { ExaDoPrepareAccess(pPixmap, fallback_index); access_prepared = TRUE; } if (fallback_index == EXA_PREPARE_DEST) { exaMemcpyBox(pPixmap, pBox, pExaPixmap->sys_ptr, pExaPixmap->sys_pitch, pPixmap->devPrivate.ptr, pPixmap->devKind); } else { exaMemcpyBox(pPixmap, pBox, pPixmap->devPrivate.ptr, pPixmap->devKind, pExaPixmap->sys_ptr, pExaPixmap->sys_pitch); } } else need_sync = TRUE; pBox++; } pExaPixmap->use_gpu_copy = save_use_gpu_copy; pPixmap->devKind = save_pitch; /* Try to prevent source valid region from growing too many rects by * removing parts of it which are also in the destination valid region. * Removing anything beyond that would lead to data loss. */ if (RegionNumRects(pValidSrc) > 20) RegionSubtract(pValidSrc, pValidSrc, pValidDst); /* The copied bits are now valid in destination */ RegionUnion(pValidDst, pValidDst, &CopyReg); RegionUninit(&CopyReg); if (access_prepared) exaFinishAccess(&pPixmap->drawable, fallback_index); else if (need_sync && sync) sync(pPixmap->drawable.pScreen); } /** * If the pixmap is currently dirty, this copies at least the dirty area from * the framebuffer memory copy to the system memory copy. Both areas must be * allocated. */ void exaCopyDirtyToSys(ExaMigrationPtr migrate) { PixmapPtr pPixmap = migrate->pPix; ExaScreenPriv(pPixmap->drawable.pScreen); ExaPixmapPriv(pPixmap); exaCopyDirty(migrate, &pExaPixmap->validSys, &pExaPixmap->validFB, pExaScr->info->DownloadFromScreen, EXA_PREPARE_SRC, exaWaitSync); } /** * If the pixmap is currently dirty, this copies at least the dirty area from * the system memory copy to the framebuffer memory copy. Both areas must be * allocated. */ void exaCopyDirtyToFb(ExaMigrationPtr migrate) { PixmapPtr pPixmap = migrate->pPix; ExaScreenPriv(pPixmap->drawable.pScreen); ExaPixmapPriv(pPixmap); exaCopyDirty(migrate, &pExaPixmap->validFB, &pExaPixmap->validSys, pExaScr->info->UploadToScreen, EXA_PREPARE_DEST, NULL); } /** * Allocates a framebuffer copy of the pixmap if necessary, and then copies * any necessary pixmap data into the framebuffer copy and points the pixmap at * it. * * Note that when first allocated, a pixmap will have FALSE dirty flag. * This is intentional because pixmap data starts out undefined. So if we move * it in due to the first operation against it being accelerated, it will have * undefined framebuffer contents that we didn't have to upload. If we do * moveouts (and moveins) after the first movein, then we will only have to copy * back and forth if the pixmap was written to after the last synchronization of * the two copies. Then, at exaPixmapSave (when the framebuffer copy goes away) * we mark the pixmap dirty, so that the next exaMoveInPixmap will actually move * all the data, since it's almost surely all valid now. */ static void exaDoMoveInPixmap(ExaMigrationPtr migrate) { PixmapPtr pPixmap = migrate->pPix; ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); ExaPixmapPriv(pPixmap); /* If we're VT-switched away, no touching card memory allowed. */ if (pExaScr->swappedOut) return; /* If we're not allowed to move, then fail. */ if (exaPixmapIsPinned(pPixmap)) return; /* Don't migrate in pixmaps which are less than 8bpp. This avoids a lot of * fragility in EXA, and <8bpp is probably not used enough any more to care * (at least, not in acceleratd paths). */ if (pPixmap->drawable.bitsPerPixel < 8) return; if (pExaPixmap->accel_blocked) return; if (pExaPixmap->area == NULL) { pExaPixmap->area = exaOffscreenAlloc(pScreen, pExaPixmap->fb_size, pExaScr->info->pixmapOffsetAlign, FALSE, exaPixmapSave, (void *) pPixmap); if (pExaPixmap->area == NULL) return; pExaPixmap->fb_ptr = (CARD8 *) pExaScr->info->memoryBase + pExaPixmap->area->offset; } exaCopyDirtyToFb(migrate); if (exaPixmapHasGpuCopy(pPixmap)) return; DBG_MIGRATE(("-> %p (0x%x) (%dx%d) (%c)\n", pPixmap, (ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width, pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); pExaPixmap->use_gpu_copy = TRUE; pPixmap->devKind = pExaPixmap->fb_pitch; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } void exaMoveInPixmap_classic(PixmapPtr pPixmap) { static ExaMigrationRec migrate = {.as_dst = FALSE,.as_src = TRUE, .pReg = NULL }; migrate.pPix = pPixmap; exaDoMoveInPixmap(&migrate); } /** * Switches the current active location of the pixmap to system memory, copying * updated data out if necessary. */ static void exaDoMoveOutPixmap(ExaMigrationPtr migrate) { PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv(pPixmap); if (!pExaPixmap->area || exaPixmapIsPinned(pPixmap)) return; exaCopyDirtyToSys(migrate); if (exaPixmapHasGpuCopy(pPixmap)) { DBG_MIGRATE(("<- %p (%p) (%dx%d) (%c)\n", pPixmap, (void *) (ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0), pPixmap->drawable.width, pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); pExaPixmap->use_gpu_copy = FALSE; pPixmap->devKind = pExaPixmap->sys_pitch; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } } void exaMoveOutPixmap_classic(PixmapPtr pPixmap) { static ExaMigrationRec migrate = {.as_dst = FALSE,.as_src = TRUE, .pReg = NULL }; migrate.pPix = pPixmap; exaDoMoveOutPixmap(&migrate); } /** * Copies out important pixmap data and removes references to framebuffer area. * Called when the memory manager decides it's time to kick the pixmap out of * framebuffer entirely. */ void exaPixmapSave(ScreenPtr pScreen, ExaOffscreenArea * area) { PixmapPtr pPixmap = area->privData; ExaPixmapPriv(pPixmap); exaMoveOutPixmap(pPixmap); pExaPixmap->fb_ptr = NULL; pExaPixmap->area = NULL; /* Mark all FB bits as invalid, so all valid system bits get copied to FB * next time */ RegionEmpty(&pExaPixmap->validFB); } /** * For the "greedy" migration scheme, pushes the pixmap toward being located in * framebuffer memory. */ static void exaMigrateTowardFb(ExaMigrationPtr migrate) { PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv(pPixmap); if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) { DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n", (void *) pPixmap)); return; } DBG_MIGRATE(("UseScreen %p score %d\n", (void *) pPixmap, pExaPixmap->score)); if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) { exaDoMoveInPixmap(migrate); pExaPixmap->score = 0; } if (pExaPixmap->score < EXA_PIXMAP_SCORE_MAX) pExaPixmap->score++; if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN && !exaPixmapHasGpuCopy(pPixmap)) { exaDoMoveInPixmap(migrate); } if (exaPixmapHasGpuCopy(pPixmap)) { exaCopyDirtyToFb(migrate); ExaOffscreenMarkUsed(pPixmap); } else exaCopyDirtyToSys(migrate); } /** * For the "greedy" migration scheme, pushes the pixmap toward being located in * system memory. */ static void exaMigrateTowardSys(ExaMigrationPtr migrate) { PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv(pPixmap); DBG_MIGRATE(("UseMem: %p score %d\n", (void *) pPixmap, pExaPixmap->score)); if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) return; if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) pExaPixmap->score = 0; if (pExaPixmap->score > EXA_PIXMAP_SCORE_MIN) pExaPixmap->score--; if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area) exaDoMoveOutPixmap(migrate); if (exaPixmapHasGpuCopy(pPixmap)) { exaCopyDirtyToFb(migrate); ExaOffscreenMarkUsed(pPixmap); } else exaCopyDirtyToSys(migrate); } /** * If the pixmap has both a framebuffer and system memory copy, this function * asserts that both of them are the same. */ static Bool exaAssertNotDirty(PixmapPtr pPixmap) { ExaPixmapPriv(pPixmap); CARD8 *dst, *src; RegionRec ValidReg; int dst_pitch, src_pitch, cpp, y, nbox, save_pitch; BoxPtr pBox; Bool ret = TRUE, save_use_gpu_copy; if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL) return ret; RegionNull(&ValidReg); RegionIntersect(&ValidReg, &pExaPixmap->validFB, &pExaPixmap->validSys); nbox = RegionNumRects(&ValidReg); if (!nbox) goto out; pBox = RegionRects(&ValidReg); dst_pitch = pExaPixmap->sys_pitch; src_pitch = pExaPixmap->fb_pitch; cpp = pPixmap->drawable.bitsPerPixel / 8; save_use_gpu_copy = pExaPixmap->use_gpu_copy; save_pitch = pPixmap->devKind; pExaPixmap->use_gpu_copy = TRUE; pPixmap->devKind = pExaPixmap->fb_pitch; if (!ExaDoPrepareAccess(pPixmap, EXA_PREPARE_SRC)) goto skip; while (nbox--) { int rowbytes; pBox->x1 = max(pBox->x1, 0); pBox->y1 = max(pBox->y1, 0); pBox->x2 = min(pBox->x2, pPixmap->drawable.width); pBox->y2 = min(pBox->y2, pPixmap->drawable.height); if (pBox->x1 >= pBox->x2 || pBox->y1 >= pBox->y2) continue; rowbytes = (pBox->x2 - pBox->x1) * cpp; src = (CARD8 *) pPixmap->devPrivate.ptr + pBox->y1 * src_pitch + pBox->x1 * cpp; dst = pExaPixmap->sys_ptr + pBox->y1 * dst_pitch + pBox->x1 * cpp; for (y = pBox->y1; y < pBox->y2; y++, src += src_pitch, dst += dst_pitch) { if (memcmp(dst, src, rowbytes) != 0) { ret = FALSE; exaPixmapDirty(pPixmap, pBox->x1, pBox->y1, pBox->x2, pBox->y2); break; } } } skip: exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); pExaPixmap->use_gpu_copy = save_use_gpu_copy; pPixmap->devKind = save_pitch; out: RegionUninit(&ValidReg); return ret; } /** * Performs migration of the pixmaps according to the operation information * provided in pixmaps and can_accel and the migration scheme chosen in the * config file. */ void exaDoMigration_classic(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) { ScreenPtr pScreen = pixmaps[0].pPix->drawable.pScreen; ExaScreenPriv(pScreen); int i, j; /* If this debugging flag is set, check each pixmap for whether it is marked * as clean, and if so, actually check if that's the case. This should help * catch issues with failing to mark a drawable as dirty. While it will * catch them late (after the operation happened), it at least explains what * went wrong, and instrumenting the code to find what operation happened * to the pixmap last shouldn't be hard. */ if (pExaScr->checkDirtyCorrectness) { for (i = 0; i < npixmaps; i++) { if (!exaPixmapIsDirty(pixmaps[i].pPix) && !exaAssertNotDirty(pixmaps[i].pPix)) ErrorF("%s: Pixmap %d dirty but not marked as such!\n", __func__, i); } } /* If anything is pinned in system memory, we won't be able to * accelerate. */ for (i = 0; i < npixmaps; i++) { if (exaPixmapIsPinned(pixmaps[i].pPix) && !exaPixmapHasGpuCopy(pixmaps[i].pPix)) { EXA_FALLBACK(("Pixmap %p (%dx%d) pinned in sys\n", pixmaps[i].pPix, pixmaps[i].pPix->drawable.width, pixmaps[i].pPix->drawable.height)); can_accel = FALSE; break; } } if (pExaScr->migration == ExaMigrationSmart) { /* If we've got something as a destination that we shouldn't cause to * become newly dirtied, take the unaccelerated route. */ for (i = 0; i < npixmaps; i++) { if (pixmaps[i].as_dst && !exaPixmapShouldBeInFB(pixmaps[i].pPix) && !exaPixmapIsDirty(pixmaps[i].pPix)) { for (i = 0; i < npixmaps; i++) { if (!exaPixmapIsDirty(pixmaps[i].pPix)) exaDoMoveOutPixmap(pixmaps + i); } return; } } /* If we aren't going to accelerate, then we migrate everybody toward * system memory, and kick out if it's free. */ if (!can_accel) { for (i = 0; i < npixmaps; i++) { exaMigrateTowardSys(pixmaps + i); if (!exaPixmapIsDirty(pixmaps[i].pPix)) exaDoMoveOutPixmap(pixmaps + i); } return; } /* Finally, the acceleration path. Move them all in. */ for (i = 0; i < npixmaps; i++) { exaMigrateTowardFb(pixmaps + i); exaDoMoveInPixmap(pixmaps + i); } } else if (pExaScr->migration == ExaMigrationGreedy) { /* If we can't accelerate, either because the driver can't or because one of * the pixmaps is pinned in system memory, then we migrate everybody toward * system memory. * * We also migrate toward system if all pixmaps involved are currently in * system memory -- this can mitigate thrashing when there are significantly * more pixmaps active than would fit in memory. * * If not, then we migrate toward FB so that hopefully acceleration can * happen. */ if (!can_accel) { for (i = 0; i < npixmaps; i++) exaMigrateTowardSys(pixmaps + i); return; } for (i = 0; i < npixmaps; i++) { if (exaPixmapHasGpuCopy(pixmaps[i].pPix)) { /* Found one in FB, so move all to FB. */ for (j = 0; j < npixmaps; j++) exaMigrateTowardFb(pixmaps + i); return; } } /* Nobody's in FB, so move all away from FB. */ for (i = 0; i < npixmaps; i++) exaMigrateTowardSys(pixmaps + i); } else if (pExaScr->migration == ExaMigrationAlways) { /* Always move the pixmaps out if we can't accelerate. If we can * accelerate, try to move them all in. If that fails, then move them * back out. */ if (!can_accel) { for (i = 0; i < npixmaps; i++) exaDoMoveOutPixmap(pixmaps + i); return; } /* Now, try to move them all into FB */ for (i = 0; i < npixmaps; i++) { exaDoMoveInPixmap(pixmaps + i); } /* If we couldn't fit everything in, abort */ for (i = 0; i < npixmaps; i++) { if (!exaPixmapHasGpuCopy(pixmaps[i].pPix)) { return; } } /* Yay, everything has a gpu copy, mark memory as used */ for (i = 0; i < npixmaps; i++) { ExaOffscreenMarkUsed(pixmaps[i].pPix); } } } void exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg) { ExaMigrationRec pixmaps[1]; if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) { pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; } else { pixmaps[0].as_dst = FALSE; pixmaps[0].as_src = TRUE; } pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = pReg; exaDoMigration(pixmaps, 1, FALSE); (void) ExaDoPrepareAccess(pPixmap, index); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_unaccel.c����������������������������������������������������������������0000664�0001751�0001751�00000061150�12432306326�014205� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * Copyright © 1999 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. */ #include "exa_priv.h" #include "mipict.h" /* * These functions wrap the low-level fb rendering functions and * synchronize framebuffer/accelerated drawing by stalling until * the accelerator is idle */ /** * Calls exaPrepareAccess with EXA_PREPARE_SRC for the tile, if that is the * current fill style. * * Solid doesn't use an extra pixmap source, and Stippled/OpaqueStippled are * 1bpp and never in fb, so we don't worry about them. * We should worry about them for completeness sake and going forward. */ void exaPrepareAccessGC(GCPtr pGC) { if (pGC->stipple) exaPrepareAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); if (pGC->fillStyle == FillTiled) exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); } /** * Finishes access to the tile in the GC, if used. */ void exaFinishAccessGC(GCPtr pGC) { if (pGC->fillStyle == FillTiled) exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); if (pGC->stipple) exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); } #if DEBUG_TRACE_FALL char exaDrawableLocation(DrawablePtr pDrawable) { return exaDrawableIsOffscreen(pDrawable) ? 's' : 'm'; } #endif /* DEBUG_TRACE_FALL */ void ExaCheckFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nspans, DDXPointPtr ppt, int *pwidth, int fSorted) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC(pGC); pGC->ops->FillSpans(pDrawable, pGC, nspans, ppt, pwidth, fSorted); exaFinishAccessGC(pGC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); pGC->ops->SetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPixmap); EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); if (!pExaScr->prepare_access_reg || !pExaPixmap->pDamage || exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, pGC->alu, pGC->clientClip != NULL)) exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); else pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, DamagePendingRegion(pExaPixmap->pDamage)); pGC->ops->PutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckCopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { RegionRec reg; int xoff, yoff; EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst, exaDrawableLocation(pSrc), exaDrawableLocation(pDst))); if (pExaScr->prepare_access_reg && RegionInitBoxes(®, pbox, nbox)) { PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc); exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff); RegionTranslate(®, xoff + dx, yoff + dy); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, ®); RegionUninit(®); } else exaPrepareAccess(pSrc, EXA_PREPARE_SRC); if (pExaScr->prepare_access_reg && !exaGCReadsDestination(pDst, pGC->planemask, pGC->fillStyle, pGC->alu, pGC->clientClip != NULL) && RegionInitBoxes(®, pbox, nbox)) { PixmapPtr pPixmap = exaGetDrawablePixmap(pDst); exaGetDrawableDeltas(pDst, pPixmap, &xoff, &yoff); RegionTranslate(®, xoff, yoff); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, ®); RegionUninit(®); } else exaPrepareAccess(pDst, EXA_PREPARE_DEST); /* This will eventually call fbCopyNtoN, with some calculation overhead. */ while (nbox--) { pGC->ops->CopyArea(pSrc, pDst, pGC, pbox->x1 - pSrc->x + dx, pbox->y1 - pSrc->y + dy, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, pbox->x1 - pDst->x, pbox->y1 - pDst->y); pbox++; } exaFinishAccess(pSrc, EXA_PREPARE_SRC); exaFinishAccess(pDst, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } static void ExaFallbackPrepareReg(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height, int index, Bool checkReads) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv(pScreen); if (pExaScr->prepare_access_reg && !(checkReads && exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, pGC->alu, pGC->clientClip != NULL))) { BoxRec box; RegionRec reg; int xoff, yoff; PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); box.x1 = pDrawable->x + x + xoff; box.y1 = pDrawable->y + y + yoff; box.x2 = box.x1 + width; box.y2 = box.y1 + height; RegionInit(®, &box, 1); pExaScr->prepare_access_reg(pPixmap, index, ®); RegionUninit(®); } else exaPrepareAccess(pDrawable, index); } RegionPtr ExaCheckCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty) { RegionPtr ret; EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst, exaDrawableLocation(pSrc), exaDrawableLocation(pDst))); ExaFallbackPrepareReg(pSrc, pGC, srcx, srcy, w, h, EXA_PREPARE_SRC, FALSE); ExaFallbackPrepareReg(pDst, pGC, dstx, dsty, w, h, EXA_PREPARE_DEST, TRUE); ret = pGC->ops->CopyArea(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); exaFinishAccess(pSrc, EXA_PREPARE_SRC); exaFinishAccess(pDst, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); return ret; } RegionPtr ExaCheckCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long bitPlane) { RegionPtr ret; EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst, exaDrawableLocation(pSrc), exaDrawableLocation(pDst))); ExaFallbackPrepareReg(pSrc, pGC, srcx, srcy, w, h, EXA_PREPARE_SRC, FALSE); ExaFallbackPrepareReg(pDst, pGC, dstx, dsty, w, h, EXA_PREPARE_DEST, TRUE); ret = pGC->ops->CopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, bitPlane); exaFinishAccess(pSrc, EXA_PREPARE_SRC); exaFinishAccess(pDst, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); return ret; } void ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); pGC->ops->PolyPoint(pDrawable, pGC, mode, npt, pptInit); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c), width %d, mode %d, count %d\n", pDrawable, exaDrawableLocation(pDrawable), pGC->lineWidth, mode, npt)); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC(pGC); pGC->ops->Polylines(pDrawable, pGC, mode, npt, ppt); exaFinishAccessGC(pGC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nsegInit, xSegment * pSegInit) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c) width %d, count %d\n", pDrawable, exaDrawableLocation(pDrawable), pGC->lineWidth, nsegInit)); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC(pGC); pGC->ops->PolySegment(pDrawable, pGC, nsegInit, pSegInit); exaFinishAccessGC(pGC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC(pGC); pGC->ops->PolyArc(pDrawable, pGC, narcs, pArcs); exaFinishAccessGC(pGC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC(pGC); pGC->ops->PolyFillRect(pDrawable, pGC, nrect, prect); exaFinishAccessGC(pGC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC(pGC); pGC->ops->ImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); exaFinishAccessGC(pGC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable, exaDrawableLocation(pDrawable), pGC->fillStyle, pGC->alu)); exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC(pGC); pGC->ops->PolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); exaFinishAccessGC(pGC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("from %p to %p (%c,%c)\n", pBitmap, pDrawable, exaDrawableLocation(&pBitmap->drawable), exaDrawableLocation(pDrawable))); ExaFallbackPrepareReg(pDrawable, pGC, x, y, w, h, EXA_PREPARE_DEST, TRUE); ExaFallbackPrepareReg(&pBitmap->drawable, pGC, 0, 0, w, h, EXA_PREPARE_SRC, FALSE); exaPrepareAccessGC(pGC); pGC->ops->PushPixels(pGC, pBitmap, pDrawable, w, h, x, y); exaFinishAccessGC(pGC); exaFinishAccess(&pBitmap->drawable, EXA_PREPARE_SRC); exaFinishAccess(pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK_GC(pGC); } void ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { DrawablePtr pDrawable = &pWin->drawable; ScreenPtr pScreen = pDrawable->pScreen; EXA_PRE_FALLBACK(pScreen); EXA_FALLBACK(("from %p\n", pWin)); /* Only need the source bits, the destination region will be overwritten */ if (pExaScr->prepare_access_reg) { PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin); int xoff, yoff; exaGetDrawableDeltas(&pWin->drawable, pPixmap, &xoff, &yoff); RegionTranslate(prgnSrc, xoff, yoff); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, prgnSrc); RegionTranslate(prgnSrc, -xoff, -yoff); } else exaPrepareAccess(pDrawable, EXA_PREPARE_SRC); swap(pExaScr, pScreen, CopyWindow); pScreen->CopyWindow(pWin, ptOldOrg, prgnSrc); swap(pExaScr, pScreen, CopyWindow); exaFinishAccess(pDrawable, EXA_PREPARE_SRC); EXA_POST_FALLBACK(pScreen); } void ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d) { ScreenPtr pScreen = pDrawable->pScreen; EXA_PRE_FALLBACK(pScreen); EXA_FALLBACK(("from %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); ExaFallbackPrepareReg(pDrawable, NULL, x, y, w, h, EXA_PREPARE_SRC, FALSE); swap(pExaScr, pScreen, GetImage); pScreen->GetImage(pDrawable, x, y, w, h, format, planeMask, d); swap(pExaScr, pScreen, GetImage); exaFinishAccess(pDrawable, EXA_PREPARE_SRC); EXA_POST_FALLBACK(pScreen); } void ExaCheckGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart) { ScreenPtr pScreen = pDrawable->pScreen; EXA_PRE_FALLBACK(pScreen); EXA_FALLBACK(("from %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess(pDrawable, EXA_PREPARE_SRC); swap(pExaScr, pScreen, GetSpans); pScreen->GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); swap(pExaScr, pScreen, GetSpans); exaFinishAccess(pDrawable, EXA_PREPARE_SRC); EXA_POST_FALLBACK(pScreen); } static void ExaSrcValidate(DrawablePtr pDrawable, int x, int y, int width, int height, unsigned int subWindowMode) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv(pScreen); PixmapPtr pPix = exaGetDrawablePixmap(pDrawable); BoxRec box; RegionRec reg; 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; box.y1 = y + yoff; box.x2 = box.x1 + width; box.y2 = box.y1 + height; RegionInit(®, &box, 1); RegionUnion(dst, dst, ®); RegionUninit(®); if (pExaScr->SavedSourceValidate) { swap(pExaScr, pScreen, SourceValidate); pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode); swap(pExaScr, pScreen, SourceValidate); } } static Bool ExaPrepareCompositeReg(ScreenPtr pScreen, CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { RegionRec region; RegionPtr dstReg = NULL; RegionPtr srcReg = NULL; RegionPtr maskReg = NULL; PixmapPtr pSrcPix = NULL; PixmapPtr pMaskPix = NULL; PixmapPtr pDstPix; ExaScreenPriv(pScreen); Bool ret; RegionNull(®ion); if (pSrc->pDrawable) { pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); RegionNull(&pExaScr->srcReg); srcReg = &pExaScr->srcReg; pExaScr->srcPix = pSrcPix; 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); pExaScr->SavedSourceValidate = ExaSrcValidate; swap(pExaScr, pScreen, SourceValidate); ret = miComputeCompositeRegion(®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); swap(pExaScr, pScreen, SourceValidate); RegionTranslate(pDst->pCompositeClip, pDst->pDrawable->x, pDst->pDrawable->y); if (pSrc->pDrawable && pSrc != pDst) RegionTranslate(pSrc->pCompositeClip, pSrc->pDrawable->x, pSrc->pDrawable->y); if (pMask && pMask->pDrawable && pMask != pDst && pMask != pSrc) RegionTranslate(pMask->pCompositeClip, pMask->pDrawable->x, pMask->pDrawable->y); if (!ret) { if (srcReg) RegionUninit(srcReg); if (maskReg) RegionUninit(maskReg); return FALSE; } /** * Don't limit alphamaps readbacks for now until we've figured out how that * should be done. */ if (pSrc->alphaMap && pSrc->alphaMap->pDrawable) pExaScr-> prepare_access_reg(exaGetDrawablePixmap(pSrc->alphaMap->pDrawable), EXA_PREPARE_AUX_SRC, NULL); if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable) pExaScr-> prepare_access_reg(exaGetDrawablePixmap(pMask->alphaMap->pDrawable), EXA_PREPARE_AUX_MASK, NULL); if (pSrcPix) pExaScr->prepare_access_reg(pSrcPix, EXA_PREPARE_SRC, srcReg); if (pMaskPix) pExaScr->prepare_access_reg(pMaskPix, EXA_PREPARE_MASK, maskReg); if (srcReg) RegionUninit(srcReg); if (maskReg) RegionUninit(maskReg); pDstPix = exaGetDrawablePixmap(pDst->pDrawable); if (!exaOpReadsDestination(op)) { int xoff; int yoff; exaGetDrawableDeltas(pDst->pDrawable, pDstPix, &xoff, &yoff); RegionTranslate(®ion, pDst->pDrawable->x + xoff, pDst->pDrawable->y + yoff); dstReg = ®ion; } if (pDst->alphaMap && pDst->alphaMap->pDrawable) pExaScr-> prepare_access_reg(exaGetDrawablePixmap(pDst->alphaMap->pDrawable), EXA_PREPARE_AUX_DEST, dstReg); pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, dstReg); RegionUninit(®ion); return TRUE; } void ExaCheckComposite(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; PictureScreenPtr ps = GetPictureScreen(pScreen); EXA_PRE_FALLBACK(pScreen); if (pExaScr->prepare_access_reg) { if (!ExaPrepareCompositeReg(pScreen, op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) goto out_no_clip; } else { /* We need to prepare access to any separate alpha maps first, * in case the driver doesn't support EXA_PREPARE_AUX*, * in which case EXA_PREPARE_SRC may be used for moving them out. */ if (pSrc->alphaMap && pSrc->alphaMap->pDrawable) exaPrepareAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX_SRC); if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable) exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK); if (pDst->alphaMap && pDst->alphaMap->pDrawable) exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST); exaPrepareAccess(pDst->pDrawable, EXA_PREPARE_DEST); EXA_FALLBACK(("from picts %p/%p to pict %p\n", pSrc, pMask, pDst)); if (pSrc->pDrawable != NULL) exaPrepareAccess(pSrc->pDrawable, EXA_PREPARE_SRC); if (pMask && pMask->pDrawable != NULL) exaPrepareAccess(pMask->pDrawable, EXA_PREPARE_MASK); } swap(pExaScr, ps, Composite); ps->Composite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); swap(pExaScr, ps, Composite); if (pMask && pMask->pDrawable != NULL) exaFinishAccess(pMask->pDrawable, EXA_PREPARE_MASK); if (pSrc->pDrawable != NULL) exaFinishAccess(pSrc->pDrawable, EXA_PREPARE_SRC); exaFinishAccess(pDst->pDrawable, EXA_PREPARE_DEST); if (pDst->alphaMap && pDst->alphaMap->pDrawable) exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST); if (pSrc->alphaMap && pSrc->alphaMap->pDrawable) exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX_SRC); if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable) exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK); out_no_clip: EXA_POST_FALLBACK(pScreen); } /** * Avoid migration ping-pong when using a mask. */ void ExaCheckGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) { ScreenPtr pScreen = pDst->pDrawable->pScreen; EXA_PRE_FALLBACK(pScreen); miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); EXA_POST_FALLBACK(pScreen); } void ExaCheckAddTraps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap * traps) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); EXA_PRE_FALLBACK(pScreen); EXA_FALLBACK(("to pict %p (%c)\n", pPicture, exaDrawableLocation(pPicture->pDrawable))); exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); swap(pExaScr, ps, AddTraps); ps->AddTraps(pPicture, x_off, y_off, ntrap, traps); swap(pExaScr, ps, AddTraps); exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); EXA_POST_FALLBACK(pScreen); } /** * Gets the 0,0 pixel of a pixmap. Used for doing solid fills of tiled pixmaps * that happen to be 1x1. Pixmap must be at least 8bpp. */ CARD32 exaGetPixmapFirstPixel(PixmapPtr pPixmap) { switch (pPixmap->drawable.bitsPerPixel) { case 32: { CARD32 pixel; pPixmap->drawable.pScreen->GetImage(&pPixmap->drawable, 0, 0, 1, 1, ZPixmap, ~0, (char *) &pixel); return pixel; } case 16: { CARD16 pixel; pPixmap->drawable.pScreen->GetImage(&pPixmap->drawable, 0, 0, 1, 1, ZPixmap, ~0, (char *) &pixel); return pixel; } case 8: case 4: case 1: { CARD8 pixel; pPixmap->drawable.pScreen->GetImage(&pPixmap->drawable, 0, 0, 1, 1, ZPixmap, ~0, (char *) &pixel); return pixel; } default: FatalError("%s called for invalid bpp %d\n", __func__, pPixmap->drawable.bitsPerPixel); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_offscreen.c��������������������������������������������������������������0000664�0001751�0001751�00000050255�12366220413�014547� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2003 Anders Carlsson * * 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 Anders Carlsson not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Anders Carlsson makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * ANDERS CARLSSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL ANDERS CARLSSON 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. */ /** @file * This allocator allocates blocks of memory by maintaining a list of areas. * When allocating, the contiguous block of areas with the minimum eviction * cost is found and evicted in order to make room for the new allocation. */ #include "exa_priv.h" #include <limits.h> #include <assert.h> #include <stdlib.h> #if DEBUG_OFFSCREEN #define DBG_OFFSCREEN(a) ErrorF a #else #define DBG_OFFSCREEN(a) #endif #if DEBUG_OFFSCREEN static void ExaOffscreenValidate(ScreenPtr pScreen) { ExaScreenPriv(pScreen); ExaOffscreenArea *prev = 0, *area; assert(pExaScr->info->offScreenAreas->base_offset == pExaScr->info->offScreenBase); for (area = pExaScr->info->offScreenAreas; area; area = area->next) { assert(area->offset >= area->base_offset && area->offset < (area->base_offset + area->size)); if (prev) assert(prev->base_offset + prev->size == area->base_offset); prev = area; } assert(prev->base_offset + prev->size == pExaScr->info->memorySize); } #else #define ExaOffscreenValidate(s) #endif static ExaOffscreenArea * ExaOffscreenKickOut(ScreenPtr pScreen, ExaOffscreenArea * area) { if (area->save) (*area->save) (pScreen, area); return exaOffscreenFree(pScreen, area); } static void exaUpdateEvictionCost(ExaOffscreenArea * area, unsigned offScreenCounter) { unsigned age; if (area->state == ExaOffscreenAvail) return; age = offScreenCounter - area->last_use; /* This is unlikely to happen, but could result in a division by zero... */ if (age > (UINT_MAX / 2)) { age = UINT_MAX / 2; area->last_use = offScreenCounter - age; } area->eviction_cost = area->size / age; } static ExaOffscreenArea * exaFindAreaToEvict(ExaScreenPrivPtr pExaScr, int size, int align) { ExaOffscreenArea *begin, *end, *best; unsigned cost, best_cost; int avail, real_size; best_cost = UINT_MAX; begin = end = pExaScr->info->offScreenAreas; avail = 0; cost = 0; best = 0; while (end != NULL) { restart: while (begin != NULL && begin->state == ExaOffscreenLocked) begin = end = begin->next; if (begin == NULL) break; /* adjust size needed to account for alignment loss for this area */ real_size = size + (begin->base_offset + begin->size - size) % align; while (avail < real_size && end != NULL) { if (end->state == ExaOffscreenLocked) { /* Can't more room here, restart after this locked area */ avail = 0; cost = 0; begin = end; goto restart; } avail += end->size; exaUpdateEvictionCost(end, pExaScr->offScreenCounter); cost += end->eviction_cost; end = end->next; } /* Check the cost, update best */ if (avail >= real_size && cost < best_cost) { best = begin; best_cost = cost; } avail -= begin->size; cost -= begin->eviction_cost; begin = begin->next; } return best; } /** * exaOffscreenAlloc allocates offscreen memory * * @param pScreen current screen * @param size size in bytes of the allocation * @param align byte alignment requirement for the offset of the allocated area * @param locked whether the allocated area is locked and can't be kicked out * @param save callback for when the area is evicted from memory * @param privdata private data for the save callback. * * Allocates offscreen memory from the device associated with pScreen. size * and align deteremine where and how large the allocated area is, and locked * will mark whether it should be held in card memory. privdata may be any * pointer for the save callback when the area is removed. * * Note that locked areas do get evicted on VT switch unless the driver * requested version 2.1 or newer behavior. In that case, the save callback is * still called. */ ExaOffscreenArea * exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, Bool locked, ExaOffscreenSaveProc save, void *privData) { ExaOffscreenArea *area; ExaScreenPriv(pScreen); int real_size = 0, largest_avail = 0; #if DEBUG_OFFSCREEN static int number = 0; ErrorF("================= ============ allocating a new pixmap %d\n", ++number); #endif ExaOffscreenValidate(pScreen); if (!align) align = 1; if (!size) { DBG_OFFSCREEN(("Alloc 0x%x -> EMPTY\n", size)); return NULL; } /* throw out requests that cannot fit */ if (size > (pExaScr->info->memorySize - pExaScr->info->offScreenBase)) { DBG_OFFSCREEN(("Alloc 0x%x vs (0x%lx) -> TOBIG\n", size, pExaScr->info->memorySize - pExaScr->info->offScreenBase)); return NULL; } /* Try to find a free space that'll fit. */ for (area = pExaScr->info->offScreenAreas; area; area = area->next) { /* skip allocated areas */ if (area->state != ExaOffscreenAvail) continue; /* adjust size to match alignment requirement */ real_size = size + (area->base_offset + area->size - size) % align; /* does it fit? */ if (real_size <= area->size) break; if (area->size > largest_avail) largest_avail = area->size; } if (!area) { area = exaFindAreaToEvict(pExaScr, size, align); if (!area) { DBG_OFFSCREEN(("Alloc 0x%x -> NOSPACE\n", size)); /* Could not allocate memory */ ExaOffscreenValidate(pScreen); return NULL; } /* adjust size needed to account for alignment loss for this area */ real_size = size + (area->base_offset + area->size - size) % align; /* * Kick out first area if in use */ if (area->state != ExaOffscreenAvail) area = ExaOffscreenKickOut(pScreen, area); /* * Now get the system to merge the other needed areas together */ while (area->size < real_size) { assert(area->next && area->next->state == ExaOffscreenRemovable); (void) ExaOffscreenKickOut(pScreen, area->next); } } /* save extra space in new area */ if (real_size < area->size) { ExaOffscreenArea *new_area = malloc(sizeof(ExaOffscreenArea)); if (!new_area) return NULL; new_area->base_offset = area->base_offset; new_area->offset = new_area->base_offset; new_area->align = 0; new_area->size = area->size - real_size; new_area->state = ExaOffscreenAvail; new_area->save = NULL; new_area->last_use = 0; new_area->eviction_cost = 0; new_area->next = area; new_area->prev = area->prev; if (area->prev->next) area->prev->next = new_area; else pExaScr->info->offScreenAreas = new_area; area->prev = new_area; area->base_offset = new_area->base_offset + new_area->size; area->size = real_size; } else pExaScr->numOffscreenAvailable--; /* * Mark this area as in use */ if (locked) area->state = ExaOffscreenLocked; else area->state = ExaOffscreenRemovable; area->privData = privData; area->save = save; area->last_use = pExaScr->offScreenCounter++; area->offset = (area->base_offset + align - 1); area->offset -= area->offset % align; area->align = align; ExaOffscreenValidate(pScreen); DBG_OFFSCREEN(("Alloc 0x%x -> 0x%x (0x%x)\n", size, area->base_offset, area->offset)); return area; } /** * Ejects all offscreen areas, and uninitializes the offscreen memory manager. */ void ExaOffscreenSwapOut(ScreenPtr pScreen) { ExaScreenPriv(pScreen); ExaOffscreenValidate(pScreen); /* loop until a single free area spans the space */ for (;;) { ExaOffscreenArea *area = pExaScr->info->offScreenAreas; if (!area) break; if (area->state == ExaOffscreenAvail) { area = area->next; if (!area) break; } assert(area->state != ExaOffscreenAvail); (void) ExaOffscreenKickOut(pScreen, area); ExaOffscreenValidate(pScreen); } ExaOffscreenValidate(pScreen); ExaOffscreenFini(pScreen); } /** Ejects all pixmaps managed by EXA. */ static void ExaOffscreenEjectPixmaps(ScreenPtr pScreen) { ExaScreenPriv(pScreen); ExaOffscreenValidate(pScreen); /* loop until a single free area spans the space */ for (;;) { ExaOffscreenArea *area; for (area = pExaScr->info->offScreenAreas; area != NULL; area = area->next) { if (area->state == ExaOffscreenRemovable && area->save == exaPixmapSave) { (void) ExaOffscreenKickOut(pScreen, area); ExaOffscreenValidate(pScreen); break; } } if (area == NULL) break; } ExaOffscreenValidate(pScreen); } void ExaOffscreenSwapIn(ScreenPtr pScreen) { exaOffscreenInit(pScreen); } /** * Prepares EXA for disabling of FB access, or restoring it. * * In version 2.1, the disabling results in pixmaps being ejected, while other * allocations remain. With this plus the prevention of migration while * swappedOut is set, EXA by itself should not cause any access of the * framebuffer to occur while swapped out. Any remaining issues are the * responsibility of the driver. * * Prior to version 2.1, all allocations, including locked ones, are ejected * when access is disabled, and the allocator is torn down while swappedOut * is set. This is more drastic, and caused implementation difficulties for * many drivers that could otherwise handle the lack of FB access while * swapped out. */ void exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable) { ExaScreenPriv(pScreen); if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) return; if (!enable && pExaScr->disableFbCount++ == 0) { if (pExaScr->info->exa_minor < 1) ExaOffscreenSwapOut(pScreen); else ExaOffscreenEjectPixmaps(pScreen); pExaScr->swappedOut = TRUE; } if (enable && --pExaScr->disableFbCount == 0) { if (pExaScr->info->exa_minor < 1) ExaOffscreenSwapIn(pScreen); pExaScr->swappedOut = FALSE; } } /* merge the next free area into this one */ static void ExaOffscreenMerge(ExaScreenPrivPtr pExaScr, ExaOffscreenArea * area) { ExaOffscreenArea *next = area->next; /* account for space */ area->size += next->size; /* frob pointer */ area->next = next->next; if (area->next) area->next->prev = area; else pExaScr->info->offScreenAreas->prev = area; free(next); pExaScr->numOffscreenAvailable--; } /** * exaOffscreenFree frees an allocation. * * @param pScreen current screen * @param area offscreen area to free * * exaOffscreenFree frees an allocation created by exaOffscreenAlloc. Note that * the save callback of the area is not called, and it is up to the driver to * do any cleanup necessary as a result. * * @return pointer to the newly freed area. This behavior should not be relied * on. */ ExaOffscreenArea * exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea * area) { ExaScreenPriv(pScreen); ExaOffscreenArea *next = area->next; ExaOffscreenArea *prev; DBG_OFFSCREEN(("Free 0x%x -> 0x%x (0x%x)\n", area->size, area->base_offset, area->offset)); ExaOffscreenValidate(pScreen); area->state = ExaOffscreenAvail; area->save = NULL; area->last_use = 0; area->eviction_cost = 0; /* * Find previous area */ if (area == pExaScr->info->offScreenAreas) prev = NULL; else prev = area->prev; pExaScr->numOffscreenAvailable++; /* link with next area if free */ if (next && next->state == ExaOffscreenAvail) ExaOffscreenMerge(pExaScr, area); /* link with prev area if free */ if (prev && prev->state == ExaOffscreenAvail) { area = prev; ExaOffscreenMerge(pExaScr, area); } ExaOffscreenValidate(pScreen); DBG_OFFSCREEN(("\tdone freeing\n")); return area; } void ExaOffscreenMarkUsed(PixmapPtr pPixmap) { ExaPixmapPriv(pPixmap); ExaScreenPriv(pPixmap->drawable.pScreen); if (!pExaPixmap || !pExaPixmap->area) return; pExaPixmap->area->last_use = pExaScr->offScreenCounter++; } /** * Defragment offscreen memory by compacting allocated areas at the end of it, * leaving the total amount of memory available as a single area at the * beginning (when there are no pinned allocations). */ _X_HIDDEN ExaOffscreenArea * ExaOffscreenDefragment(ScreenPtr pScreen) { ExaScreenPriv(pScreen); ExaOffscreenArea *area, *largest_available = NULL; int largest_size = 0; PixmapPtr pDstPix; ExaPixmapPrivPtr pExaDstPix; pDstPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, 0, 0); if (!pDstPix) return NULL; pExaDstPix = ExaGetPixmapPriv(pDstPix); pExaDstPix->use_gpu_copy = TRUE; for (area = pExaScr->info->offScreenAreas->prev; area != pExaScr->info->offScreenAreas;) { ExaOffscreenArea *prev = area->prev; PixmapPtr pSrcPix; ExaPixmapPrivPtr pExaSrcPix; Bool save_use_gpu_copy; int save_pitch; if (area->state != ExaOffscreenAvail || prev->state == ExaOffscreenLocked || (prev->state == ExaOffscreenRemovable && prev->save != exaPixmapSave)) { area = prev; continue; } if (prev->state == ExaOffscreenAvail) { if (area == largest_available) { largest_available = prev; largest_size += prev->size; } area = prev; ExaOffscreenMerge(pExaScr, area); continue; } if (area->size > largest_size) { largest_available = area; largest_size = area->size; } pSrcPix = prev->privData; pExaSrcPix = ExaGetPixmapPriv(pSrcPix); pExaDstPix->fb_ptr = pExaScr->info->memoryBase + area->base_offset + area->size - prev->size + prev->base_offset - prev->offset; pExaDstPix->fb_ptr -= (unsigned long) pExaDstPix->fb_ptr % prev->align; if (pExaDstPix->fb_ptr <= pExaSrcPix->fb_ptr) { area = prev; continue; } if (!(pExaScr->info->flags & EXA_SUPPORTS_OFFSCREEN_OVERLAPS) && (pExaSrcPix->fb_ptr + prev->size) > pExaDstPix->fb_ptr) { area = prev; continue; } save_use_gpu_copy = pExaSrcPix->use_gpu_copy; save_pitch = pSrcPix->devKind; pExaSrcPix->use_gpu_copy = TRUE; pSrcPix->devKind = pExaSrcPix->fb_pitch; pDstPix->drawable.width = pSrcPix->drawable.width; pDstPix->devKind = pSrcPix->devKind; pDstPix->drawable.height = pSrcPix->drawable.height; pDstPix->drawable.depth = pSrcPix->drawable.depth; pDstPix->drawable.bitsPerPixel = pSrcPix->drawable.bitsPerPixel; if (!pExaScr->info->PrepareCopy(pSrcPix, pDstPix, -1, -1, GXcopy, ~0)) { pExaSrcPix->use_gpu_copy = save_use_gpu_copy; pSrcPix->devKind = save_pitch; area = prev; continue; } pExaScr->info->Copy(pDstPix, 0, 0, 0, 0, pDstPix->drawable.width, pDstPix->drawable.height); pExaScr->info->DoneCopy(pDstPix); exaMarkSync(pScreen); DBG_OFFSCREEN(("Before swap: prev=0x%08x-0x%08x-0x%08x area=0x%08x-0x%08x-0x%08x\n", prev->base_offset, prev->offset, prev->base_offset + prev->size, area->base_offset, area->offset, area->base_offset + area->size)); /* Calculate swapped area offsets and sizes */ area->base_offset = prev->base_offset; area->offset = area->base_offset; prev->offset += pExaDstPix->fb_ptr - pExaSrcPix->fb_ptr; assert(prev->offset >= pExaScr->info->offScreenBase && prev->offset < pExaScr->info->memorySize); prev->base_offset = prev->offset; if (area->next) prev->size = area->next->base_offset - prev->base_offset; else prev->size = pExaScr->info->memorySize - prev->base_offset; area->size = prev->base_offset - area->base_offset; DBG_OFFSCREEN(("After swap: area=0x%08x-0x%08x-0x%08x prev=0x%08x-0x%08x-0x%08x\n", area->base_offset, area->offset, area->base_offset + area->size, prev->base_offset, prev->offset, prev->base_offset + prev->size)); /* Swap areas in list */ if (area->next) area->next->prev = prev; else pExaScr->info->offScreenAreas->prev = prev; if (prev->prev->next) prev->prev->next = area; else pExaScr->info->offScreenAreas = area; prev->next = area->next; area->next = prev; area->prev = prev->prev; prev->prev = area; if (!area->prev->next) pExaScr->info->offScreenAreas = area; #if DEBUG_OFFSCREEN if (prev->prev == prev || prev->next == prev) ErrorF("Whoops, prev points to itself!\n"); if (area->prev == area || area->next == area) ErrorF("Whoops, area points to itself!\n"); #endif pExaSrcPix->fb_ptr = pExaDstPix->fb_ptr; pExaSrcPix->use_gpu_copy = save_use_gpu_copy; pSrcPix->devKind = save_pitch; } pDstPix->drawable.width = 0; pDstPix->drawable.height = 0; pDstPix->drawable.depth = 0; pDstPix->drawable.bitsPerPixel = 0; (*pScreen->DestroyPixmap) (pDstPix); if (area->state == ExaOffscreenAvail && area->size > largest_size) return area; return largest_available; } /** * exaOffscreenInit initializes the offscreen memory manager. * * @param pScreen current screen * * exaOffscreenInit is called by exaDriverInit to set up the memory manager for * the screen, if any offscreen memory is available. */ Bool exaOffscreenInit(ScreenPtr pScreen) { ExaScreenPriv(pScreen); ExaOffscreenArea *area; /* Allocate a big free area */ area = malloc(sizeof(ExaOffscreenArea)); if (!area) return FALSE; area->state = ExaOffscreenAvail; area->base_offset = pExaScr->info->offScreenBase; area->offset = area->base_offset; area->align = 0; area->size = pExaScr->info->memorySize - area->base_offset; area->save = NULL; area->next = NULL; area->prev = area; area->last_use = 0; area->eviction_cost = 0; /* Add it to the free areas */ pExaScr->info->offScreenAreas = area; pExaScr->offScreenCounter = 1; pExaScr->numOffscreenAvailable = 1; ExaOffscreenValidate(pScreen); return TRUE; } void ExaOffscreenFini(ScreenPtr pScreen) { ExaScreenPriv(pScreen); ExaOffscreenArea *area; /* just free all of the area records */ while ((area = pExaScr->info->offScreenAreas)) { pExaScr->info->offScreenAreas = area->next; free(area); } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_migration_mixed.c��������������������������������������������������������0000664�0001751�0001751�00000021776�12274325511�015765� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 Maarten Maathuis * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include "exa_priv.h" #include "exa.h" void exaCreateDriverPixmap_mixed(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); ExaPixmapPriv(pPixmap); int w = pPixmap->drawable.width, h = pPixmap->drawable.height; int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel; int usage_hint = pPixmap->usage_hint; int paddedWidth = pExaPixmap->sys_pitch; /* Already done. */ if (pExaPixmap->driverPriv) return; if (exaPixmapIsPinned(pPixmap)) return; /* Can't accel 1/4 bpp. */ if (pExaPixmap->accel_blocked || bpp < 8) return; if (pExaScr->info->CreatePixmap2) { int new_pitch = 0; pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch); paddedWidth = pExaPixmap->fb_pitch = new_pitch; } else { if (paddedWidth < pExaPixmap->fb_pitch) paddedWidth = pExaPixmap->fb_pitch; pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, paddedWidth * h, 0); } if (!pExaPixmap->driverPriv) return; (*pScreen->ModifyPixmapHeader) (pPixmap, w, h, 0, 0, paddedWidth, NULL); } void exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) { int i; /* If anything is pinned in system memory, we won't be able to * accelerate. */ for (i = 0; i < npixmaps; i++) { if (exaPixmapIsPinned(pixmaps[i].pPix) && !exaPixmapHasGpuCopy(pixmaps[i].pPix)) { can_accel = FALSE; break; } } /* We can do nothing. */ if (!can_accel) return; for (i = 0; i < npixmaps; i++) { PixmapPtr pPixmap = pixmaps[i].pPix; ExaPixmapPriv(pPixmap); if (!pExaPixmap->driverPriv) exaCreateDriverPixmap_mixed(pPixmap); if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) { ExaScreenPriv(pPixmap->drawable.pScreen); /* This pitch is needed for proper acceleration. For some reason * there are pixmaps without pDamage and a bad fb_pitch value. * So setting devKind when only exaPixmapHasGpuCopy() is true * causes corruption. Pixmaps without pDamage are not migrated * and should have a valid devKind at all times, so that's why this * isn't causing problems. Pixmaps have their gpu pitch set the * first time in the MPH call from exaCreateDriverPixmap_mixed(). */ pPixmap->devKind = pExaPixmap->fb_pitch; exaCopyDirtyToFb(pixmaps + i); if (pExaScr->deferred_mixed_pixmap == pPixmap && !pixmaps[i].as_dst && !pixmaps[i].pReg) pExaScr->deferred_mixed_pixmap = NULL; } pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap); } } void exaMoveInPixmap_mixed(PixmapPtr pPixmap) { ExaMigrationRec pixmaps[1]; pixmaps[0].as_dst = FALSE; pixmaps[0].as_src = TRUE; pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = NULL; exaDoMigration(pixmaps, 1, TRUE); } void exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure) { PixmapPtr pPixmap = closure; ExaPixmapPriv(pPixmap); /* Move back results of software rendering on system memory copy of mixed driver * pixmap (see exaPrepareAccessReg_mixed). * * Defer moving the destination back into the driver pixmap, to try and save * overhead on multiple subsequent software fallbacks. */ if (!pExaPixmap->use_gpu_copy && exaPixmapHasGpuCopy(pPixmap)) { ExaScreenPriv(pPixmap->drawable.pScreen); if (pExaScr->deferred_mixed_pixmap && pExaScr->deferred_mixed_pixmap != pPixmap) exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); pExaScr->deferred_mixed_pixmap = pPixmap; } } /* With mixed pixmaps, if we fail to get direct access to the driver pixmap, we * use the DownloadFromScreen hook to retrieve contents to a copy in system * memory, perform software rendering on that and move back the results with the * UploadToScreen hook (see exaDamageReport_mixed). */ void exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg) { ExaPixmapPriv(pPixmap); Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap); Bool success; success = ExaDoPrepareAccess(pPixmap, index); if (success && has_gpu_copy && pExaPixmap->pDamage) { /* You cannot do accelerated operations while a buffer is mapped. */ exaFinishAccess(&pPixmap->drawable, index); /* Update the gpu view of both deferred destination pixmaps and of * source pixmaps that were migrated with a bounding region. */ exaMoveInPixmap_mixed(pPixmap); success = ExaDoPrepareAccess(pPixmap, index); if (success) { /* We have a gpu pixmap that can be accessed, we don't need the cpu * copy anymore. Drivers that prefer DFS, should fail prepare * access. */ DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; free(pExaPixmap->sys_ptr); pExaPixmap->sys_ptr = NULL; return; } } if (!success) { ExaMigrationRec pixmaps[1]; /* Do we need to allocate our system buffer? */ if (!pExaPixmap->sys_ptr) { pExaPixmap->sys_ptr = malloc(pExaPixmap->sys_pitch * pPixmap->drawable.height); if (!pExaPixmap->sys_ptr) FatalError("EXA: malloc failed for size %d bytes\n", pExaPixmap->sys_pitch * pPixmap->drawable.height); } if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) { pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; } else { pixmaps[0].as_dst = FALSE; pixmaps[0].as_src = TRUE; } pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = pReg; if (!pExaPixmap->pDamage && (has_gpu_copy || !exaPixmapIsPinned(pPixmap))) { Bool as_dst = pixmaps[0].as_dst; /* Set up damage tracking */ pExaPixmap->pDamage = DamageCreate(exaDamageReport_mixed, NULL, DamageReportNonEmpty, TRUE, pPixmap->drawable.pScreen, pPixmap); if (pExaPixmap->pDamage) { DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage); /* This ensures that pending damage reflects the current * operation. This is used by exa to optimize migration. */ DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE); } if (has_gpu_copy) { exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width, pPixmap->drawable.height); /* We don't know which region of the destination will be damaged, * have to assume all of it */ if (as_dst) { pixmaps[0].as_dst = FALSE; pixmaps[0].as_src = TRUE; pixmaps[0].pReg = NULL; } exaCopyDirtyToSys(pixmaps); } if (as_dst) exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width, pPixmap->drawable.height); } else if (has_gpu_copy) exaCopyDirtyToSys(pixmaps); pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; pExaPixmap->use_gpu_copy = FALSE; } } ��xorg-server-1.17.1/exa/exa_classic.c����������������������������������������������������������������0000664�0001751�0001751�00000020057�12352615641�014221� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 Maarten Maathuis * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include "exa_priv.h" #include "exa.h" /* This file holds the classic exa specific implementation. */ static _X_INLINE void * ExaGetPixmapAddress(PixmapPtr p) { ExaPixmapPriv(p); if (pExaPixmap->use_gpu_copy && pExaPixmap->fb_ptr) return pExaPixmap->fb_ptr; else return pExaPixmap->sys_ptr; } /** * exaCreatePixmap() creates a new pixmap. * * If width and height are 0, this won't be a full-fledged pixmap and it will * get ModifyPixmapHeader() called on it later. So, we mark it as pinned, because * ModifyPixmapHeader() would break migration. These types of pixmaps are used * for scratch pixmaps, or to represent the visible screen. */ PixmapPtr exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; BoxRec box; int bpp; ExaScreenPriv(pScreen); if (w > 32767 || h > 32767) return NullPixmap; swap(pExaScr, pScreen, CreatePixmap); pPixmap = pScreen->CreatePixmap(pScreen, w, h, depth, usage_hint); swap(pExaScr, pScreen, CreatePixmap); if (!pPixmap) return NULL; pExaPixmap = ExaGetPixmapPriv(pPixmap); pExaPixmap->driverPriv = NULL; bpp = pPixmap->drawable.bitsPerPixel; pExaPixmap->driverPriv = NULL; /* Scratch pixmaps may have w/h equal to zero, and may not be * migrated. */ if (!w || !h) pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED; else pExaPixmap->score = EXA_PIXMAP_SCORE_INIT; pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr; pExaPixmap->sys_pitch = pPixmap->devKind; pPixmap->devPrivate.ptr = NULL; pExaPixmap->use_gpu_copy = FALSE; pExaPixmap->fb_ptr = NULL; exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp); pExaPixmap->fb_size = pExaPixmap->fb_pitch * h; if (pExaPixmap->fb_pitch > 131071) { swap(pExaScr, pScreen, DestroyPixmap); pScreen->DestroyPixmap(pPixmap); swap(pExaScr, pScreen, DestroyPixmap); return NULL; } /* Set up damage tracking */ pExaPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone, TRUE, pScreen, pPixmap); if (pExaPixmap->pDamage == NULL) { swap(pExaScr, pScreen, DestroyPixmap); pScreen->DestroyPixmap(pPixmap); swap(pExaScr, pScreen, DestroyPixmap); return NULL; } DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage); /* This ensures that pending damage reflects the current operation. */ /* This is used by exa to optimize migration. */ DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE); pExaPixmap->area = NULL; /* We set the initial pixmap as completely valid for a simple reason. * Imagine a 1000x1000 pixmap, it has 1 million pixels, 250000 of which * could form single pixel rects as part of a region. Setting the complete region * as valid is a natural defragmentation of the region. */ box.x1 = 0; box.y1 = 0; box.x2 = w; box.y2 = h; RegionInit(&pExaPixmap->validSys, &box, 0); RegionInit(&pExaPixmap->validFB, &box, 0); exaSetAccelBlock(pExaScr, pExaPixmap, w, h, bpp); /* During a fallback we must prepare access. */ if (pExaScr->fallback_counter) exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST); return pPixmap; } Bool exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData) { ScreenPtr pScreen; ExaScreenPrivPtr pExaScr; ExaPixmapPrivPtr pExaPixmap; Bool ret; if (!pPixmap) return FALSE; pScreen = pPixmap->drawable.pScreen; pExaScr = ExaGetScreenPriv(pScreen); pExaPixmap = ExaGetPixmapPriv(pPixmap); if (pExaPixmap) { if (pPixData) pExaPixmap->sys_ptr = pPixData; if (devKind > 0) pExaPixmap->sys_pitch = devKind; /* Classic EXA: * - Framebuffer. * - Scratch pixmap with gpu memory. */ if (pExaScr->info->memoryBase && pPixData) { if ((CARD8 *) pPixData >= pExaScr->info->memoryBase && ((CARD8 *) pPixData - pExaScr->info->memoryBase) < pExaScr->info->memorySize) { pExaPixmap->fb_ptr = pPixData; pExaPixmap->fb_pitch = devKind; pExaPixmap->use_gpu_copy = TRUE; } } if (width > 0 && height > 0 && bitsPerPixel > 0) { exaSetFbPitch(pExaScr, pExaPixmap, width, height, bitsPerPixel); exaSetAccelBlock(pExaScr, pExaPixmap, width, height, bitsPerPixel); } /* Pixmaps subject to ModifyPixmapHeader will be pinned to system or * gpu memory, so there's no need to track damage. */ if (pExaPixmap->pDamage) { DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; } } swap(pExaScr, pScreen, ModifyPixmapHeader); ret = pScreen->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); swap(pExaScr, pScreen, ModifyPixmapHeader); /* Always NULL this, we don't want lingering pointers. */ pPixmap->devPrivate.ptr = NULL; return ret; } Bool exaDestroyPixmap_classic(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); Bool ret; if (pPixmap->refcnt == 1) { ExaPixmapPriv(pPixmap); exaDestroyPixmap(pPixmap); if (pExaPixmap->area) { DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n", (void *) pPixmap->drawable.id, ExaGetPixmapPriv(pPixmap)->area->offset, pPixmap->drawable.width, pPixmap->drawable.height)); /* Free the offscreen area */ exaOffscreenFree(pPixmap->drawable.pScreen, pExaPixmap->area); pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; } RegionUninit(&pExaPixmap->validSys); RegionUninit(&pExaPixmap->validFB); } swap(pExaScr, pScreen, DestroyPixmap); ret = pScreen->DestroyPixmap(pPixmap); swap(pExaScr, pScreen, DestroyPixmap); return ret; } Bool exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); ExaPixmapPriv(pPixmap); Bool ret; if (pExaScr->info->PixmapIsOffscreen) { void *old_ptr = pPixmap->devPrivate.ptr; pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap); ret = pExaScr->info->PixmapIsOffscreen(pPixmap); pPixmap->devPrivate.ptr = old_ptr; } else ret = (pExaPixmap->use_gpu_copy && pExaPixmap->fb_ptr); return ret; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/Makefile.in������������������������������������������������������������������0000664�0001751�0001751�00000067525�12466505430�013657� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = exa DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libexa_la_LIBADD = am_libexa_la_OBJECTS = exa.lo exa_classic.lo exa_migration_classic.lo \ exa_driver.lo exa_mixed.lo exa_migration_mixed.lo exa_accel.lo \ exa_glyphs.lo exa_offscreen.lo exa_render.lo exa_unaccel.lo libexa_la_OBJECTS = $(am_libexa_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 = $(libexa_la_SOURCES) DIST_SOURCES = $(libexa_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = exa.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libexa.la @XORG_TRUE@sdk_HEADERS = exa.h AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(srcdir)/../miext/cw AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) libexa_la_SOURCES = \ exa.c \ exa.h \ exa_classic.c \ exa_migration_classic.c \ exa_driver.c \ exa_mixed.c \ exa_migration_mixed.c \ exa_accel.c \ exa_glyphs.c \ exa_offscreen.c \ exa_render.c \ exa_priv.h \ exa_unaccel.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 exa/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign exa/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libexa.la: $(libexa_la_OBJECTS) $(libexa_la_DEPENDENCIES) $(EXTRA_libexa_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libexa_la_OBJECTS) $(libexa_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_accel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_classic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_glyphs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_migration_classic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_migration_mixed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_mixed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_offscreen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_render.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exa_unaccel.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_priv.h�������������������������������������������������������������������0000664�0001751�0001751�00000050014�12432306326�013555� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * Copyright (C) 2000 Keith Packard, member of The XFree86 Project, Inc. * 2005 Zack Rusin, Trolltech * * 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. * * 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. */ #ifndef EXAPRIV_H #define EXAPRIV_H #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "exa.h" #include <X11/X.h> #include <X11/Xproto.h> #ifdef MITSHM #include "shmint.h" #endif #include "scrnintstr.h" #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" #include "mipointer.h" #include "mi.h" #include "dix.h" #include "fb.h" #include "fboverlay.h" #include "fbpict.h" #include "glyphstr.h" #include "damage.h" #define DEBUG_TRACE_FALL 0 #define DEBUG_MIGRATE 0 #define DEBUG_PIXMAP 0 #define DEBUG_OFFSCREEN 0 #define DEBUG_GLYPH_CACHE 0 #if DEBUG_TRACE_FALL #define EXA_FALLBACK(x) \ do { \ ErrorF("EXA fallback at %s: ", __FUNCTION__); \ ErrorF x; \ } while (0) char exaDrawableLocation(DrawablePtr pDrawable); #else #define EXA_FALLBACK(x) #endif #if DEBUG_PIXMAP #define DBG_PIXMAP(a) ErrorF a #else #define DBG_PIXMAP(a) #endif #ifndef EXA_MAX_FB #define EXA_MAX_FB FB_OVERLAY_MAX #endif #ifdef DEBUG #define EXA_FatalErrorDebug(x) FatalError x #define EXA_FatalErrorDebugWithRet(x, ret) FatalError x #else #define EXA_FatalErrorDebug(x) ErrorF x #define EXA_FatalErrorDebugWithRet(x, ret) \ do { \ ErrorF x; \ return ret; \ } while (0) #endif /** * This is the list of migration heuristics supported by EXA. See * exaDoMigration() for what their implementations do. */ enum ExaMigrationHeuristic { ExaMigrationGreedy, ExaMigrationAlways, ExaMigrationSmart }; typedef struct { unsigned char sha1[20]; } ExaCachedGlyphRec, *ExaCachedGlyphPtr; typedef struct { /* The identity of the cache, statically configured at initialization */ unsigned int format; int glyphWidth; int glyphHeight; int size; /* Size of cache; eventually this should be dynamically determined */ /* Hash table mapping from glyph sha1 to position in the glyph; we use * open addressing with a hash table size determined based on size and large * enough so that we always have a good amount of free space, so we can * use linear probing. (Linear probing is preferrable to double hashing * here because it allows us to easily remove entries.) */ int *hashEntries; int hashSize; ExaCachedGlyphPtr glyphs; int glyphCount; /* Current number of glyphs */ PicturePtr picture; /* Where the glyphs of the cache are stored */ int yOffset; /* y location within the picture where the cache starts */ int columns; /* Number of columns the glyphs are layed out in */ int evictionPosition; /* Next random position to evict a glyph */ } ExaGlyphCacheRec, *ExaGlyphCachePtr; #define EXA_NUM_GLYPH_CACHES 4 #define EXA_FALLBACK_COPYWINDOW (1 << 0) #define EXA_ACCEL_COPYWINDOW (1 << 1) typedef struct _ExaMigrationRec { Bool as_dst; Bool as_src; PixmapPtr pPix; RegionPtr pReg; } ExaMigrationRec, *ExaMigrationPtr; typedef void (*EnableDisableFBAccessProcPtr) (ScreenPtr, Bool); typedef struct { ExaDriverPtr info; ScreenBlockHandlerProcPtr SavedBlockHandler; ScreenWakeupHandlerProcPtr SavedWakeupHandler; CreateGCProcPtr SavedCreateGC; CloseScreenProcPtr SavedCloseScreen; GetImageProcPtr SavedGetImage; GetSpansProcPtr SavedGetSpans; CreatePixmapProcPtr SavedCreatePixmap; DestroyPixmapProcPtr SavedDestroyPixmap; CopyWindowProcPtr SavedCopyWindow; ChangeWindowAttributesProcPtr SavedChangeWindowAttributes; BitmapToRegionProcPtr SavedBitmapToRegion; CreateScreenResourcesProcPtr SavedCreateScreenResources; ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader; SharePixmapBackingProcPtr SavedSharePixmapBacking; SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking; SourceValidateProcPtr SavedSourceValidate; CompositeProcPtr SavedComposite; TrianglesProcPtr SavedTriangles; GlyphsProcPtr SavedGlyphs; TrapezoidsProcPtr SavedTrapezoids; AddTrapsProcPtr SavedAddTraps; void (*do_migration) (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); Bool (*pixmap_has_gpu_copy) (PixmapPtr pPixmap); void (*do_move_in_pixmap) (PixmapPtr pPixmap); void (*do_move_out_pixmap) (PixmapPtr pPixmap); void (*prepare_access_reg) (PixmapPtr pPixmap, int index, RegionPtr pReg); Bool swappedOut; enum ExaMigrationHeuristic migration; Bool checkDirtyCorrectness; unsigned disableFbCount; Bool optimize_migration; unsigned offScreenCounter; unsigned numOffscreenAvailable; CARD32 lastDefragment; CARD32 nextDefragment; PixmapPtr deferred_mixed_pixmap; /* Reference counting for accessed pixmaps */ struct { PixmapPtr pixmap; int count; Bool retval; } access[EXA_NUM_PREPARE_INDICES]; /* Holds information on fallbacks that cannot be relayed otherwise. */ unsigned int fallback_flags; unsigned int fallback_counter; ExaGlyphCacheRec glyphCaches[EXA_NUM_GLYPH_CACHES]; /** * Regions affected by fallback composite source / mask operations. */ RegionRec srcReg; RegionRec maskReg; PixmapPtr srcPix; PixmapPtr maskPix; DevPrivateKeyRec pixmapPrivateKeyRec; DevPrivateKeyRec gcPrivateKeyRec; } ExaScreenPrivRec, *ExaScreenPrivPtr; extern DevPrivateKeyRec exaScreenPrivateKeyRec; #define exaScreenPrivateKey (&exaScreenPrivateKeyRec) #define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey)) #define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s) #define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, &ExaGetScreenPriv(gc->pScreen)->gcPrivateKeyRec)) #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc) /* * Some macros to deal with function wrapping. */ #define wrap(priv, real, mem, func) {\ priv->Saved##mem = real->mem; \ real->mem = func; \ } #define unwrap(priv, real, mem) {\ real->mem = priv->Saved##mem; \ } #ifdef HAVE_TYPEOF #define swap(priv, real, mem) {\ typeof(real->mem) tmp = priv->Saved##mem; \ priv->Saved##mem = real->mem; \ real->mem = tmp; \ } #else #define swap(priv, real, mem) {\ void *tmp = priv->Saved##mem; \ priv->Saved##mem = real->mem; \ real->mem = tmp; \ } #endif #define EXA_PRE_FALLBACK(_screen_) \ ExaScreenPriv(_screen_); \ pExaScr->fallback_counter++; #define EXA_POST_FALLBACK(_screen_) \ pExaScr->fallback_counter--; #define EXA_PRE_FALLBACK_GC(_gc_) \ ExaScreenPriv(_gc_->pScreen); \ ExaGCPriv(_gc_); \ pExaScr->fallback_counter++; \ swap(pExaGC, _gc_, ops); #define EXA_POST_FALLBACK_GC(_gc_) \ pExaScr->fallback_counter--; \ swap(pExaGC, _gc_, ops); /** Align an offset to an arbitrary alignment */ #define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \ (((offset) + (align) - 1) % (align))) /** Align an offset to a power-of-two alignment */ #define EXA_ALIGN2(offset, align) (((offset) + (align) - 1) & ~((align) - 1)) #define EXA_PIXMAP_SCORE_MOVE_IN 10 #define EXA_PIXMAP_SCORE_MAX 20 #define EXA_PIXMAP_SCORE_MOVE_OUT -10 #define EXA_PIXMAP_SCORE_MIN -20 #define EXA_PIXMAP_SCORE_PINNED 1000 #define EXA_PIXMAP_SCORE_INIT 1001 #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) #define EXA_RANGE_WIDTH (1 << 1) #define EXA_RANGE_HEIGHT (1 << 2) typedef struct { ExaOffscreenArea *area; int score; /**< score for the move-in vs move-out heuristic */ Bool use_gpu_copy; CARD8 *sys_ptr; /**< pointer to pixmap data in system memory */ int sys_pitch; /**< pitch of pixmap in system memory */ CARD8 *fb_ptr; /**< pointer to pixmap data in framebuffer memory */ int fb_pitch; /**< pitch of pixmap in framebuffer memory */ unsigned int fb_size; /**< size of pixmap in framebuffer memory */ /** * Holds information about whether this pixmap can be used for * acceleration (== 0) or not (> 0). * * Contains a OR'ed combination of the following values: * EXA_RANGE_PITCH - set if the pixmap's pitch is out of range * EXA_RANGE_WIDTH - set if the pixmap's width is out of range * EXA_RANGE_HEIGHT - set if the pixmap's height is out of range */ unsigned int accel_blocked; /** * The damage record contains the areas of the pixmap's current location * (framebuffer or system) that have been damaged compared to the other * location. */ DamagePtr pDamage; /** * The valid regions mark the valid bits (at least, as they're derived from * damage, which may be overreported) of a pixmap's system and FB copies. */ RegionRec validSys, validFB; /** * Driver private storage per EXA pixmap */ void *driverPriv; } ExaPixmapPrivRec, *ExaPixmapPrivPtr; typedef struct { /* GC values from the layer below. */ const GCOps *Savedops; const GCFuncs *Savedfuncs; } ExaGCPrivRec, *ExaGCPrivPtr; typedef struct { PicturePtr pDst; INT16 xSrc; INT16 ySrc; INT16 xMask; INT16 yMask; INT16 xDst; INT16 yDst; INT16 width; INT16 height; } ExaCompositeRectRec, *ExaCompositeRectPtr; /** * exaDDXDriverInit must be implemented by the DDX using EXA, and is the place * to set EXA options or hook in screen functions to handle using EXA as the AA. */ void exaDDXDriverInit(ScreenPtr pScreen); /* exa_unaccel.c */ void exaPrepareAccessGC(GCPtr pGC); void exaFinishAccessGC(GCPtr pGC); void ExaCheckFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nspans, DDXPointPtr ppt, int *pwidth, int fSorted); void ExaCheckSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); void ExaCheckPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits); void ExaCheckCopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); RegionPtr ExaCheckCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty); RegionPtr ExaCheckCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long bitPlane); void ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit); void ExaCheckPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt); void ExaCheckPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nsegInit, xSegment * pSegInit); void ExaCheckPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs); void ExaCheckPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect); void ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); void ExaCheckPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); void ExaCheckPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y); void ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); void ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); void ExaCheckGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); void ExaCheckAddTraps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap * traps); /* exa_accel.c */ static _X_INLINE Bool exaGCReadsDestination(DrawablePtr pDrawable, unsigned long planemask, unsigned int fillStyle, unsigned char alu, Bool clientClip) { return ((alu != GXcopy && alu != GXclear && alu != GXset && alu != GXcopyInverted) || fillStyle == FillStippled || clientClip != FALSE || !EXA_PM_IS_SOLID(pDrawable, planemask)); } void exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); Bool exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu, Bool clientClip); void exaGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); RegionPtr exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty); Bool exaHWCopyNtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown); void exaCopyNtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern const GCOps exaOps; void ExaCheckComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); void ExaCheckGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); /* exa_offscreen.c */ void ExaOffscreenSwapOut(ScreenPtr pScreen); void ExaOffscreenSwapIn(ScreenPtr pScreen); ExaOffscreenArea *ExaOffscreenDefragment(ScreenPtr pScreen); Bool exaOffscreenInit(ScreenPtr pScreen); void ExaOffscreenFini(ScreenPtr pScreen); /* exa.c */ Bool ExaDoPrepareAccess(PixmapPtr pPixmap, int index); void exaPrepareAccess(DrawablePtr pDrawable, int index); void exaFinishAccess(DrawablePtr pDrawable, int index); void exaDestroyPixmap(PixmapPtr pPixmap); void exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2); void exaGetDrawableDeltas(DrawablePtr pDrawable, PixmapPtr pPixmap, int *xp, int *yp); Bool exaPixmapHasGpuCopy(PixmapPtr p); PixmapPtr exaGetOffscreenPixmap(DrawablePtr pDrawable, int *xp, int *yp); PixmapPtr exaGetDrawablePixmap(DrawablePtr pDrawable); void exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap, int w, int h, int bpp); void exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap, int w, int h, int bpp); void exaDoMigration(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); Bool exaPixmapIsPinned(PixmapPtr pPix); extern const GCFuncs exaGCFuncs; /* exa_classic.c */ PixmapPtr exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint); Bool exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); Bool exaDestroyPixmap_classic(PixmapPtr pPixmap); Bool exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap); /* exa_driver.c */ PixmapPtr exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint); Bool exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); Bool exaDestroyPixmap_driver(PixmapPtr pPixmap); Bool exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap); /* exa_mixed.c */ PixmapPtr exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint); Bool exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); Bool exaDestroyPixmap_mixed(PixmapPtr pPixmap); Bool exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap); /* exa_migration_mixed.c */ void exaCreateDriverPixmap_mixed(PixmapPtr pPixmap); void exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); void exaMoveInPixmap_mixed(PixmapPtr pPixmap); void exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure); 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); void exaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); void exaCompositeRects(CARD8 op, PicturePtr Src, PicturePtr pMask, PicturePtr pDst, int nrect, ExaCompositeRectPtr rects); void exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps); void exaTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris); /* exa_glyph.c */ void exaGlyphsInit(ScreenPtr pScreen); void exaGlyphsFini(ScreenPtr pScreen); void exaGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); /* exa_migration_classic.c */ void exaCopyDirtyToSys(ExaMigrationPtr migrate); void exaCopyDirtyToFb(ExaMigrationPtr migrate); void exaDoMigration_classic(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); void exaPixmapSave(ScreenPtr pScreen, ExaOffscreenArea * area); void exaMoveOutPixmap_classic(PixmapPtr pPixmap); void exaMoveInPixmap_classic(PixmapPtr pPixmap); void exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg); #endif /* EXAPRIV_H */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa.h������������������������������������������������������������������������0000664�0001751�0001751�00000100425�12456571574�012536� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * * Copyright (C) 2000 Keith Packard * 2004 Eric Anholt * 2005 Zack Rusin * * 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 copyright holders not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. 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. */ /** @file * This is the header containing the public API of EXA for exa drivers. */ #ifndef EXA_H #define EXA_H #include "scrnintstr.h" #include "pixmapstr.h" #include "windowstr.h" #include "gcstruct.h" #include "picturestr.h" #include "fb.h" #define EXA_VERSION_MAJOR 2 #define EXA_VERSION_MINOR 6 #define EXA_VERSION_RELEASE 0 typedef struct _ExaOffscreenArea ExaOffscreenArea; typedef void (*ExaOffscreenSaveProc) (ScreenPtr pScreen, ExaOffscreenArea * area); typedef enum _ExaOffscreenState { ExaOffscreenAvail, ExaOffscreenRemovable, ExaOffscreenLocked } ExaOffscreenState; struct _ExaOffscreenArea { int base_offset; /* allocation base */ int offset; /* aligned offset */ int size; /* total allocation size */ unsigned last_use; void *privData; ExaOffscreenSaveProc save; ExaOffscreenState state; ExaOffscreenArea *next; unsigned eviction_cost; ExaOffscreenArea *prev; /* Double-linked list for defragmentation */ int align; /* required alignment */ }; /** * The ExaDriver structure is allocated through exaDriverAlloc(), and then * fllled in by drivers. */ typedef struct _ExaDriver { /** * exa_major and exa_minor should be set by the driver to the version of * EXA which the driver was compiled for (or configures itself at runtime * to support). This allows EXA to extend the structure for new features * without breaking ABI for drivers compiled against older versions. */ int exa_major, exa_minor; /** * memoryBase is the address of the beginning of framebuffer memory. * The visible screen should be within memoryBase to memoryBase + * memorySize. */ CARD8 *memoryBase; /** * offScreenBase is the offset from memoryBase of the beginning of the area * to be managed by EXA's linear offscreen memory manager. * * In XFree86 DDX drivers, this is probably: * (pScrn->displayWidth * cpp * pScrn->virtualY) */ unsigned long offScreenBase; /** * memorySize is the length (in bytes) of framebuffer memory beginning * from memoryBase. * * The offscreen memory manager will manage the area beginning at * (memoryBase + offScreenBase), with a length of (memorySize - * offScreenBase) * * In XFree86 DDX drivers, this is probably (pScrn->videoRam * 1024) */ unsigned long memorySize; /** * pixmapOffsetAlign is the byte alignment necessary for pixmap offsets * within framebuffer. * * Hardware typically has a required alignment of offsets, which may or may * not be a power of two. EXA will ensure that pixmaps managed by the * offscreen memory manager meet this alignment requirement. */ int pixmapOffsetAlign; /** * pixmapPitchAlign is the byte alignment necessary for pixmap pitches * within the framebuffer. * * Hardware typically has a required alignment of pitches for acceleration. * For 3D hardware, Composite acceleration often requires that source and * mask pixmaps (textures) have a power-of-two pitch, which can be demanded * using EXA_OFFSCREEN_ALIGN_POT. These pitch requirements only apply to * pixmaps managed by the offscreen memory manager. Thus, it is up to the * driver to ensure that the visible screen has an appropriate pitch for * acceleration. */ int pixmapPitchAlign; /** * The flags field is bitfield of boolean values controlling EXA's behavior. * * The flags in clude EXA_OFFSCREEN_PIXMAPS, EXA_OFFSCREEN_ALIGN_POT, and * EXA_TWO_BITBLT_DIRECTIONS. */ int flags; /** @{ */ /** * maxX controls the X coordinate limitation for rendering from the card. * The driver should never receive a request for rendering beyond maxX * in the X direction from the origin of a pixmap. */ int maxX; /** * maxY controls the Y coordinate limitation for rendering from the card. * The driver should never receive a request for rendering beyond maxY * in the Y direction from the origin of a pixmap. */ int maxY; /** @} */ /* private */ ExaOffscreenArea *offScreenAreas; Bool needsSync; int lastMarker; /** @name Solid * @{ */ /** * PrepareSolid() sets up the driver for doing a solid fill. * @param pPixmap Destination pixmap * @param alu raster operation * @param planemask write mask for the fill * @param fg "foreground" color for the fill * * This call should set up the driver for doing a series of solid fills * through the Solid() call. The alu raster op is one of the GX* * graphics functions listed in X.h, and typically maps to a similar * single-byte "ROP" setting in all hardware. The planemask controls * which bits of the destination should be affected, and will only represent * the bits up to the depth of pPixmap. The fg is the pixel value of the * foreground color referred to in ROP descriptions. * * Note that many drivers will need to store some of the data in the driver * private record, for sending to the hardware with each drawing command. * * The PrepareSolid() call is required of all drivers, but it may fail for any * reason. Failure results in a fallback to software rendering. */ Bool (*PrepareSolid) (PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg); /** * Solid() performs a solid fill set up in the last PrepareSolid() call. * * @param pPixmap destination pixmap * @param x1 left coordinate * @param y1 top coordinate * @param x2 right coordinate * @param y2 bottom coordinate * * Performs the fill set up by the last PrepareSolid() call, covering the * area from (x1,y1) to (x2,y2) in pPixmap. Note that the coordinates are * in the coordinate space of the destination pixmap, so the driver will * need to set up the hardware's offset and pitch for the destination * coordinates according to the pixmap's offset and pitch within * framebuffer. This likely means using exaGetPixmapOffset() and * exaGetPixmapPitch(). * * This call is required if PrepareSolid() ever succeeds. */ void (*Solid) (PixmapPtr pPixmap, int x1, int y1, int x2, int y2); /** * DoneSolid() finishes a set of solid fills. * * @param pPixmap destination pixmap. * * The DoneSolid() call is called at the end of a series of consecutive * Solid() calls following a successful PrepareSolid(). This allows drivers * to finish up emitting drawing commands that were buffered, or clean up * state from PrepareSolid(). * * This call is required if PrepareSolid() ever succeeds. */ void (*DoneSolid) (PixmapPtr pPixmap); /** @} */ /** @name Copy * @{ */ /** * PrepareCopy() sets up the driver for doing a copy within video * memory. * * @param pSrcPixmap source pixmap * @param pDstPixmap destination pixmap * @param dx X copy direction * @param dy Y copy direction * @param alu raster operation * @param planemask write mask for the fill * * This call should set up the driver for doing a series of copies from the * the pSrcPixmap to the pDstPixmap. The dx flag will be positive if the * hardware should do the copy from the left to the right, and dy will be * positive if the copy should be done from the top to the bottom. This * is to deal with self-overlapping copies when pSrcPixmap == pDstPixmap. * If your hardware can only support blits that are (left to right, top to * bottom) or (right to left, bottom to top), then you should set * #EXA_TWO_BITBLT_DIRECTIONS, and EXA will break down Copy operations to * ones that meet those requirements. The alu raster op is one of the GX* * graphics functions listed in X.h, and typically maps to a similar * single-byte "ROP" setting in all hardware. The planemask controls which * bits of the destination should be affected, and will only represent the * bits up to the depth of pPixmap. * * Note that many drivers will need to store some of the data in the driver * private record, for sending to the hardware with each drawing command. * * The PrepareCopy() call is required of all drivers, but it may fail for any * reason. Failure results in a fallback to software rendering. */ Bool (*PrepareCopy) (PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy, int alu, Pixel planemask); /** * Copy() performs a copy set up in the last PrepareCopy call. * * @param pDstPixmap destination pixmap * @param srcX source X coordinate * @param srcY source Y coordinate * @param dstX destination X coordinate * @param dstY destination Y coordinate * @param width width of the rectangle to be copied * @param height height of the rectangle to be copied. * * Performs the copy set up by the last PrepareCopy() call, copying the * rectangle from (srcX, srcY) to (srcX + width, srcY + width) in the source * pixmap to the same-sized rectangle at (dstX, dstY) in the destination * pixmap. Those rectangles may overlap in memory, if * pSrcPixmap == pDstPixmap. Note that this call does not receive the * pSrcPixmap as an argument -- if it's needed in this function, it should * be stored in the driver private during PrepareCopy(). As with Solid(), * the coordinates are in the coordinate space of each pixmap, so the driver * will need to set up source and destination pitches and offsets from those * pixmaps, probably using exaGetPixmapOffset() and exaGetPixmapPitch(). * * This call is required if PrepareCopy ever succeeds. */ void (*Copy) (PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height); /** * DoneCopy() finishes a set of copies. * * @param pPixmap destination pixmap. * * The DoneCopy() call is called at the end of a series of consecutive * Copy() calls following a successful PrepareCopy(). This allows drivers * to finish up emitting drawing commands that were buffered, or clean up * state from PrepareCopy(). * * This call is required if PrepareCopy() ever succeeds. */ void (*DoneCopy) (PixmapPtr pDstPixmap); /** @} */ /** @name Composite * @{ */ /** * CheckComposite() checks to see if a composite operation could be * accelerated. * * @param op Render operation * @param pSrcPicture source Picture * @param pMaskPicture mask picture * @param pDstPicture destination Picture * * The CheckComposite() call checks if the driver could handle acceleration * of op with the given source, mask, and destination pictures. This allows * drivers to check source and destination formats, supported operations, * transformations, and component alpha state, and send operations it can't * support to software rendering early on. This avoids costly pixmap * migration to the wrong places when the driver can't accelerate * operations. Note that because migration hasn't happened, the driver * can't know during CheckComposite() what the offsets and pitches of the * pixmaps are going to be. * * See PrepareComposite() for more details on likely issues that drivers * will have in accelerating Composite operations. * * The CheckComposite() call is recommended if PrepareComposite() is * implemented, but is not required. */ Bool (*CheckComposite) (int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture); /** * PrepareComposite() sets up the driver for doing a Composite operation * described in the Render extension protocol spec. * * @param op Render operation * @param pSrcPicture source Picture * @param pMaskPicture mask picture * @param pDstPicture destination Picture * @param pSrc source pixmap * @param pMask mask pixmap * @param pDst destination pixmap * * This call should set up the driver for doing a series of Composite * operations, as described in the Render protocol spec, with the given * pSrcPicture, pMaskPicture, and pDstPicture. The pSrc, pMask, and * pDst are the pixmaps containing the pixel data, and should be used for * setting the offset and pitch used for the coordinate spaces for each of * the Pictures. * * Notes on interpreting Picture structures: * - The Picture structures will always have a valid pDrawable. * - The Picture structures will never have alphaMap set. * - The mask Picture (and therefore pMask) may be NULL, in which case the * operation is simply src OP dst instead of src IN mask OP dst, and * mask coordinates should be ignored. * - pMarkPicture may have componentAlpha set, which greatly changes * the behavior of the Composite operation. componentAlpha has no effect * when set on pSrcPicture or pDstPicture. * - The source and mask Pictures may have a transformation set * (Picture->transform != NULL), which means that the source coordinates * should be transformed by that transformation, resulting in scaling, * rotation, etc. The PictureTransformPoint() call can transform * coordinates for you. Transforms have no effect on Pictures when used * as a destination. * - The source and mask pictures may have a filter set. PictFilterNearest * and PictFilterBilinear are defined in the Render protocol, but others * may be encountered, and must be handled correctly (usually by * PrepareComposite failing, and falling back to software). Filters have * no effect on Pictures when used as a destination. * - The source and mask Pictures may have repeating set, which must be * respected. Many chipsets will be unable to support repeating on * pixmaps that have a width or height that is not a power of two. * * If your hardware can't support source pictures (textures) with * non-power-of-two pitches, you should set #EXA_OFFSCREEN_ALIGN_POT. * * Note that many drivers will need to store some of the data in the driver * private record, for sending to the hardware with each drawing command. * * The PrepareComposite() call is not required. However, it is highly * recommended for performance of antialiased font rendering and performance * of cairo applications. Failure results in a fallback to software * rendering. */ Bool (*PrepareComposite) (int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst); /** * Composite() performs a Composite operation set up in the last * PrepareComposite() call. * * @param pDstPixmap destination pixmap * @param srcX source X coordinate * @param srcY source Y coordinate * @param maskX source X coordinate * @param maskY source Y coordinate * @param dstX destination X coordinate * @param dstY destination Y coordinate * @param width destination rectangle width * @param height destination rectangle height * * Performs the Composite operation set up by the last PrepareComposite() * call, to the rectangle from (dstX, dstY) to (dstX + width, dstY + height) * in the destination Pixmap. Note that if a transformation was set on * the source or mask Pictures, the source rectangles may not be the same * size as the destination rectangles and filtering. Getting the coordinate * transformation right at the subpixel level can be tricky, and rendercheck * can test this for you. * * This call is required if PrepareComposite() ever succeeds. */ void (*Composite) (PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height); /** * DoneComposite() finishes a set of Composite operations. * * @param pPixmap destination pixmap. * * The DoneComposite() call is called at the end of a series of consecutive * Composite() calls following a successful PrepareComposite(). This allows * drivers to finish up emitting drawing commands that were buffered, or * clean up state from PrepareComposite(). * * This call is required if PrepareComposite() ever succeeds. */ void (*DoneComposite) (PixmapPtr pDst); /** @} */ /** * UploadToScreen() loads a rectangle of data from src into pDst. * * @param pDst destination pixmap * @param x destination X coordinate. * @param y destination Y coordinate * @param width width of the rectangle to be copied * @param height height of the rectangle to be copied * @param src pointer to the beginning of the source data * @param src_pitch pitch (in bytes) of the lines of source data. * * UploadToScreen() copies data in system memory beginning at src (with * pitch src_pitch) into the destination pixmap from (x, y) to * (x + width, y + height). This is typically done with hostdata uploads, * where the CPU sets up a blit command on the hardware with instructions * that the blit data will be fed through some sort of aperture on the card. * * If UploadToScreen() is performed asynchronously, it is up to the driver * to call exaMarkSync(). This is in contrast to most other acceleration * calls in EXA. * * UploadToScreen() can aid in pixmap migration, but is most important for * the performance of exaGlyphs() (antialiased font drawing) by allowing * pipelining of data uploads, avoiding a sync of the card after each glyph. * * @return TRUE if the driver successfully uploaded the data. FALSE * indicates that EXA should fall back to doing the upload in software. * * UploadToScreen() is not required, but is recommended if Composite * acceleration is supported. */ Bool (*UploadToScreen) (PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch); /** * UploadToScratch() is no longer used and will be removed next time the EXA * major version needs to be bumped. */ Bool (*UploadToScratch) (PixmapPtr pSrc, PixmapPtr pDst); /** * DownloadFromScreen() loads a rectangle of data from pSrc into dst * * @param pSrc source pixmap * @param x source X coordinate. * @param y source Y coordinate * @param width width of the rectangle to be copied * @param height height of the rectangle to be copied * @param dst pointer to the beginning of the destination data * @param dst_pitch pitch (in bytes) of the lines of destination data. * * DownloadFromScreen() copies data from offscreen memory in pSrc from * (x, y) to (x + width, y + height), to system memory starting at * dst (with pitch dst_pitch). This would usually be done * using scatter-gather DMA, supported by a DRM call, or by blitting to AGP * and then synchronously reading from AGP. Because the implementation * might be synchronous, EXA leaves it up to the driver to call * exaMarkSync() if DownloadFromScreen() was asynchronous. This is in * contrast to most other acceleration calls in EXA. * * DownloadFromScreen() can aid in the largest bottleneck in pixmap * migration, which is the read from framebuffer when evicting pixmaps from * framebuffer memory. Thus, it is highly recommended, even though * implementations are typically complicated. * * @return TRUE if the driver successfully downloaded the data. FALSE * indicates that EXA should fall back to doing the download in software. * * DownloadFromScreen() is not required, but is highly recommended. */ Bool (*DownloadFromScreen) (PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch); /** * MarkSync() requests that the driver mark a synchronization point, * returning an driver-defined integer marker which could be requested for * synchronization to later in WaitMarker(). This might be used in the * future to avoid waiting for full hardware stalls before accessing pixmap * data with the CPU, but is not important in the current incarnation of * EXA. * * Note that drivers should call exaMarkSync() when they have done some * acceleration, rather than their own MarkSync() handler, as otherwise EXA * will be unaware of the driver's acceleration and not sync to it during * fallbacks. * * MarkSync() is optional. */ int (*MarkSync) (ScreenPtr pScreen); /** * WaitMarker() waits for all rendering before the given marker to have * completed. If the driver does not implement MarkSync(), marker is * meaningless, and all rendering by the hardware should be completed before * WaitMarker() returns. * * Note that drivers should call exaWaitSync() to wait for all acceleration * to finish, as otherwise EXA will be unaware of the driver having * synchronized, resulting in excessive WaitMarker() calls. * * WaitMarker() is required of all drivers. */ void (*WaitMarker) (ScreenPtr pScreen, int marker); /** @{ */ /** * PrepareAccess() is called before CPU access to an offscreen pixmap. * * @param pPix the pixmap being accessed * @param index the index of the pixmap being accessed. * * PrepareAccess() will be called before CPU access to an offscreen pixmap. * This can be used to set up hardware surfaces for byteswapping or * untiling, or to adjust the pixmap's devPrivate.ptr for the purpose of * making CPU access use a different aperture. * * The index is one of #EXA_PREPARE_DEST, #EXA_PREPARE_SRC, * #EXA_PREPARE_MASK, #EXA_PREPARE_AUX_DEST, #EXA_PREPARE_AUX_SRC, or * #EXA_PREPARE_AUX_MASK. Since only up to #EXA_NUM_PREPARE_INDICES pixmaps * will have PrepareAccess() called on them per operation, drivers can have * a small, statically-allocated space to maintain state for PrepareAccess() * and FinishAccess() in. Note that PrepareAccess() is only called once per * pixmap and operation, regardless of whether the pixmap is used as a * destination and/or source, and the index may not reflect the usage. * * PrepareAccess() may fail. An example might be the case of hardware that * can set up 1 or 2 surfaces for CPU access, but not 3. If PrepareAccess() * fails, EXA will migrate the pixmap to system memory. * DownloadFromScreen() must be implemented and must not fail if a driver * wishes to fail in PrepareAccess(). PrepareAccess() must not fail when * pPix is the visible screen, because the visible screen can not be * migrated. * * @return TRUE if PrepareAccess() successfully prepared the pixmap for CPU * drawing. * @return FALSE if PrepareAccess() is unsuccessful and EXA should use * DownloadFromScreen() to migate the pixmap out. */ Bool (*PrepareAccess) (PixmapPtr pPix, int index); /** * FinishAccess() is called after CPU access to an offscreen pixmap. * * @param pPix the pixmap being accessed * @param index the index of the pixmap being accessed. * * FinishAccess() will be called after finishing CPU access of an offscreen * pixmap set up by PrepareAccess(). Note that the FinishAccess() will not be * called if PrepareAccess() failed and the pixmap was migrated out. */ void (*FinishAccess) (PixmapPtr pPix, int index); /** * PixmapIsOffscreen() is an optional driver replacement to * exaPixmapHasGpuCopy(). Set to NULL if you want the standard behaviour * of exaPixmapHasGpuCopy(). * * @param pPix the pixmap * @return TRUE if the given drawable is in framebuffer memory. * * exaPixmapHasGpuCopy() is used to determine if a pixmap is in offscreen * memory, meaning that acceleration could probably be done to it, and that it * will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it * with the CPU. * * */ Bool (*PixmapIsOffscreen) (PixmapPtr pPix); /** @name PrepareAccess() and FinishAccess() indices * @{ */ /** * EXA_PREPARE_DEST is the index for a pixmap that may be drawn to or * read from. */ #define EXA_PREPARE_DEST 0 /** * EXA_PREPARE_SRC is the index for a pixmap that may be read from */ #define EXA_PREPARE_SRC 1 /** * EXA_PREPARE_SRC is the index for a second pixmap that may be read * from. */ #define EXA_PREPARE_MASK 2 /** * EXA_PREPARE_AUX* are additional indices for other purposes, e.g. * separate alpha maps with Composite operations. */ #define EXA_PREPARE_AUX_DEST 3 #define EXA_PREPARE_AUX_SRC 4 #define EXA_PREPARE_AUX_MASK 5 #define EXA_NUM_PREPARE_INDICES 6 /** @} */ /** * maxPitchPixels controls the pitch limitation for rendering from * the card. * The driver should never receive a request for rendering a pixmap * that has a pitch (in pixels) beyond maxPitchPixels. * * Setting this field is optional -- if your hardware doesn't have * a pitch limitation in pixels, don't set this. If neither this value * nor maxPitchBytes is set, then maxPitchPixels is set to maxX. * If set, it must not be smaller than maxX. * * @sa maxPitchBytes */ int maxPitchPixels; /** * maxPitchBytes controls the pitch limitation for rendering from * the card. * The driver should never receive a request for rendering a pixmap * that has a pitch (in bytes) beyond maxPitchBytes. * * Setting this field is optional -- if your hardware doesn't have * a pitch limitation in bytes, don't set this. * If set, it must not be smaller than maxX * 4. * There's no default value for maxPitchBytes. * * @sa maxPitchPixels */ int maxPitchBytes; /* Hooks to allow driver to its own pixmap memory management */ void *(*CreatePixmap) (ScreenPtr pScreen, int size, int align); void (*DestroyPixmap) (ScreenPtr pScreen, void *driverPriv); /** * Returning a pixmap with non-NULL devPrivate.ptr implies a pixmap which is * not offscreen, which will never be accelerated and Prepare/FinishAccess won't * be called. */ Bool (*ModifyPixmapHeader) (PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); /* hooks for drivers with tiling support: * driver MUST fill out new_fb_pitch with valid pitch of pixmap */ void *(*CreatePixmap2) (ScreenPtr pScreen, int width, int height, 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 * @{ */ /** * EXA_OFFSCREEN_PIXMAPS indicates to EXA that the driver can support * offscreen pixmaps. */ #define EXA_OFFSCREEN_PIXMAPS (1 << 0) /** * EXA_OFFSCREEN_ALIGN_POT indicates to EXA that the driver needs pixmaps * to have a power-of-two pitch. */ #define EXA_OFFSCREEN_ALIGN_POT (1 << 1) /** * EXA_TWO_BITBLT_DIRECTIONS indicates to EXA that the driver can only * support copies that are (left-to-right, top-to-bottom) or * (right-to-left, bottom-to-top). */ #define EXA_TWO_BITBLT_DIRECTIONS (1 << 2) /** * EXA_HANDLES_PIXMAPS indicates to EXA that the driver can handle * all pixmap addressing and migration. */ #define EXA_HANDLES_PIXMAPS (1 << 3) /** * EXA_SUPPORTS_PREPARE_AUX indicates to EXA that the driver can handle the * EXA_PREPARE_AUX* indices in the Prepare/FinishAccess hooks. If there are no * such hooks, this flag has no effect. */ #define EXA_SUPPORTS_PREPARE_AUX (1 << 4) /** * EXA_SUPPORTS_OFFSCREEN_OVERLAPS indicates to EXA that the driver Copy hooks * can handle the source and destination occupying overlapping offscreen memory * areas. This allows the offscreen memory defragmentation code to defragment * areas where the defragmented position overlaps the fragmented position. * * Typically this is supported by traditional 2D engines but not by 3D engines. */ #define EXA_SUPPORTS_OFFSCREEN_OVERLAPS (1 << 5) /** * EXA_MIXED_PIXMAPS will hide unacceleratable pixmaps from drivers and manage the * problem known software fallbacks like trapezoids. This only migrates pixmaps one way * into a driver pixmap and then pins it. */ #define EXA_MIXED_PIXMAPS (1 << 6) /** @} */ /* in exa.c */ extern _X_EXPORT ExaDriverPtr exaDriverAlloc(void); extern _X_EXPORT Bool exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo); extern _X_EXPORT void exaDriverFini(ScreenPtr pScreen); extern _X_EXPORT void exaMarkSync(ScreenPtr pScreen); extern _X_EXPORT void exaWaitSync(ScreenPtr pScreen); extern _X_EXPORT unsigned long exaGetPixmapOffset(PixmapPtr pPix); extern _X_EXPORT unsigned long exaGetPixmapPitch(PixmapPtr pPix); extern _X_EXPORT unsigned long exaGetPixmapSize(PixmapPtr pPix); extern _X_EXPORT void *exaGetPixmapDriverPrivate(PixmapPtr p); /* in exa_offscreen.c */ extern _X_EXPORT ExaOffscreenArea *exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, Bool locked, ExaOffscreenSaveProc save, void *privData); extern _X_EXPORT ExaOffscreenArea *exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea * area); extern _X_EXPORT void ExaOffscreenMarkUsed(PixmapPtr pPixmap); extern _X_EXPORT void exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable); extern _X_EXPORT Bool exaDrawableIsOffscreen(DrawablePtr pDrawable); /* in exa.c */ extern _X_EXPORT void exaMoveInPixmap(PixmapPtr pPixmap); extern _X_EXPORT void exaMoveOutPixmap(PixmapPtr pPixmap); /* in exa_unaccel.c */ extern _X_EXPORT CARD32 exaGetPixmapFirstPixel(PixmapPtr pPixmap); /** * Returns TRUE if the given planemask covers all the significant bits in the * pixel values for pDrawable. */ #define EXA_PM_IS_SOLID(_pDrawable, _pm) \ (((_pm) & FbFullMask((_pDrawable)->depth)) == \ FbFullMask((_pDrawable)->depth)) #endif /* EXA_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_driver.c�����������������������������������������������������������������0000664�0001751�0001751�00000015401�12274325511�014065� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2009 Maarten Maathuis * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <string.h> #include "exa_priv.h" #include "exa.h" /* This file holds the driver allocated pixmaps specific implementation. */ static _X_INLINE void * ExaGetPixmapAddress(PixmapPtr p) { ExaPixmapPriv(p); return pExaPixmap->sys_ptr; } /** * exaCreatePixmap() creates a new pixmap. * * Pixmaps are always marked as pinned, because exa has no control over them. */ PixmapPtr exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; int bpp; size_t paddedWidth, datasize; ExaScreenPriv(pScreen); if (w > 32767 || h > 32767) return NullPixmap; swap(pExaScr, pScreen, CreatePixmap); pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint); swap(pExaScr, pScreen, CreatePixmap); if (!pPixmap) return NULL; pExaPixmap = ExaGetPixmapPriv(pPixmap); pExaPixmap->driverPriv = NULL; bpp = pPixmap->drawable.bitsPerPixel; /* Set this before driver hooks, to allow for driver pixmaps without gpu * memory to back it. These pixmaps have a valid pointer at all times. */ pPixmap->devPrivate.ptr = NULL; if (pExaScr->info->CreatePixmap2) { int new_pitch = 0; pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch); paddedWidth = pExaPixmap->fb_pitch = new_pitch; } else { paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); if (paddedWidth / 4 > 32767 || h > 32767) return NullPixmap; exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp); if (paddedWidth < pExaPixmap->fb_pitch) paddedWidth = pExaPixmap->fb_pitch; datasize = h * paddedWidth; pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0); } if (!pExaPixmap->driverPriv) { swap(pExaScr, pScreen, DestroyPixmap); pScreen->DestroyPixmap(pPixmap); swap(pExaScr, pScreen, DestroyPixmap); return NULL; } /* Allow ModifyPixmapHeader to set sys_ptr appropriately. */ pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED; pExaPixmap->fb_ptr = NULL; pExaPixmap->pDamage = NULL; pExaPixmap->sys_ptr = NULL; (*pScreen->ModifyPixmapHeader) (pPixmap, w, h, 0, 0, paddedWidth, NULL); pExaPixmap->area = NULL; exaSetAccelBlock(pExaScr, pExaPixmap, w, h, bpp); pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap); /* During a fallback we must prepare access. */ if (pExaScr->fallback_counter) exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST); return pPixmap; } Bool exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData) { ScreenPtr pScreen; ExaScreenPrivPtr pExaScr; ExaPixmapPrivPtr pExaPixmap; Bool ret; if (!pPixmap) return FALSE; pScreen = pPixmap->drawable.pScreen; pExaScr = ExaGetScreenPriv(pScreen); pExaPixmap = ExaGetPixmapPriv(pPixmap); if (pExaPixmap) { if (pPixData) pExaPixmap->sys_ptr = pPixData; if (devKind > 0) pExaPixmap->sys_pitch = devKind; if (width > 0 && height > 0 && bitsPerPixel > 0) { exaSetFbPitch(pExaScr, pExaPixmap, width, height, bitsPerPixel); exaSetAccelBlock(pExaScr, pExaPixmap, width, height, bitsPerPixel); } } if (pExaScr->info->ModifyPixmapHeader) { ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); /* For EXA_HANDLES_PIXMAPS, we set pPixData to NULL. * If pPixmap->devPrivate.ptr is non-NULL, then we've got a * !has_gpu_copy pixmap. We need to store the pointer, * because PrepareAccess won't be called. */ if (!pPixData && pPixmap->devPrivate.ptr && pPixmap->devKind) { pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr; pExaPixmap->sys_pitch = pPixmap->devKind; } if (ret == TRUE) goto out; } swap(pExaScr, pScreen, ModifyPixmapHeader); ret = pScreen->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); swap(pExaScr, pScreen, ModifyPixmapHeader); out: /* Always NULL this, we don't want lingering pointers. */ pPixmap->devPrivate.ptr = NULL; return ret; } Bool exaDestroyPixmap_driver(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); Bool ret; if (pPixmap->refcnt == 1) { ExaPixmapPriv(pPixmap); exaDestroyPixmap(pPixmap); if (pExaPixmap->driverPriv) pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv); pExaPixmap->driverPriv = NULL; } swap(pExaScr, pScreen, DestroyPixmap); ret = pScreen->DestroyPixmap(pPixmap); swap(pExaScr, pScreen, DestroyPixmap); return ret; } Bool exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); void *saved_ptr; Bool ret; saved_ptr = pPixmap->devPrivate.ptr; pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap); ret = pExaScr->info->PixmapIsOffscreen(pPixmap); pPixmap->devPrivate.ptr = saved_ptr; return ret; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/exa/exa_render.c�����������������������������������������������������������������0000664�0001751�0001751�00000116244�12456571574�014076� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright © 2001 Keith Packard * * Partly based on code that is Copyright © 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_DIX_CONFIG_H #include <dix-config.h> #endif #include <stdlib.h> #include "exa_priv.h" #include "mipict.h" #if DEBUG_TRACE_FALL static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n) { char format[20]; char size[20]; char loc; int temp; if (!pict) { snprintf(string, n, "None"); return; } switch (pict->format) { case PICT_a8r8g8b8: snprintf(format, 20, "ARGB8888"); break; case PICT_x8r8g8b8: snprintf(format, 20, "XRGB8888"); break; case PICT_b8g8r8a8: snprintf(format, 20, "BGRA8888"); break; case PICT_b8g8r8x8: snprintf(format, 20, "BGRX8888"); break; case PICT_r5g6b5: snprintf(format, 20, "RGB565 "); break; case PICT_x1r5g5b5: snprintf(format, 20, "RGB555 "); break; case PICT_a8: snprintf(format, 20, "A8 "); break; case PICT_a1: snprintf(format, 20, "A1 "); break; default: snprintf(format, 20, "0x%x", (int) pict->format); break; } if (pict->pDrawable) { loc = exaGetOffscreenPixmap(pict->pDrawable, &temp, &temp) ? 's' : 'm'; snprintf(size, 20, "%dx%d%s", pict->pDrawable->width, pict->pDrawable->height, pict->repeat ? " R" : ""); } else { loc = '-'; snprintf(size, 20, "%s", pict->repeat ? " R" : ""); } snprintf(string, n, "%p:%c fmt %s (%s)", pict->pDrawable, loc, format, size); } static void exaPrintCompositeFallback(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst) { char sop[20]; char srcdesc[40], maskdesc[40], dstdesc[40]; switch (op) { case PictOpSrc: snprintf(sop, sizeof(sop), "Src"); break; case PictOpOver: snprintf(sop, sizeof(sop), "Over"); break; default: snprintf(sop, sizeof(sop), "0x%x", (int) op); break; } exaCompositeFallbackPictDesc(pSrc, srcdesc, 40); exaCompositeFallbackPictDesc(pMask, maskdesc, 40); exaCompositeFallbackPictDesc(pDst, dstdesc, 40); ErrorF("Composite fallback: op %s, \n" " src %s, \n" " mask %s, \n" " dst %s, \n", sop, srcdesc, maskdesc, dstdesc); } #endif /* DEBUG_TRACE_FALL */ Bool exaOpReadsDestination(CARD8 op) { /* FALSE (does not read destination) is the list of ops in the protocol * document with "0" in the "Fb" column and no "Ab" in the "Fa" column. * That's just Clear and Src. ReduceCompositeOp() will already have * converted con/disjoint clear/src to Clear or Src. */ switch (op) { case PictOpClear: case PictOpSrc: return FALSE; default: return TRUE; } } static Bool exaGetPixelFromRGBA(CARD32 *pixel, CARD16 red, CARD16 green, CARD16 blue, CARD16 alpha, PictFormatPtr pFormat) { int rbits, bbits, gbits, abits; int rshift, bshift, gshift, ashift; *pixel = 0; if (!PICT_FORMAT_COLOR(pFormat->format) && PICT_FORMAT_TYPE(pFormat->format) != PICT_TYPE_A) return FALSE; rbits = PICT_FORMAT_R(pFormat->format); gbits = PICT_FORMAT_G(pFormat->format); bbits = PICT_FORMAT_B(pFormat->format); abits = PICT_FORMAT_A(pFormat->format); rshift = pFormat->direct.red; gshift = pFormat->direct.green; bshift = pFormat->direct.blue; ashift = pFormat->direct.alpha; *pixel |= (blue >> (16 - bbits)) << bshift; *pixel |= (red >> (16 - rbits)) << rshift; *pixel |= (green >> (16 - gbits)) << gshift; *pixel |= (alpha >> (16 - abits)) << ashift; return TRUE; } static Bool exaGetRGBAFromPixel(CARD32 pixel, CARD16 *red, CARD16 *green, CARD16 *blue, CARD16 *alpha, PictFormatPtr pFormat, PictFormatShort format) { int rbits, bbits, gbits, abits; int rshift, bshift, gshift, ashift; if (!PICT_FORMAT_COLOR(format) && PICT_FORMAT_TYPE(format) != PICT_TYPE_A) return FALSE; rbits = PICT_FORMAT_R(format); gbits = PICT_FORMAT_G(format); bbits = PICT_FORMAT_B(format); abits = PICT_FORMAT_A(format); if (pFormat) { rshift = pFormat->direct.red; gshift = pFormat->direct.green; bshift = pFormat->direct.blue; ashift = pFormat->direct.alpha; } else if (format == PICT_a8r8g8b8) { rshift = 16; gshift = 8; bshift = 0; ashift = 24; } else FatalError("EXA bug: exaGetRGBAFromPixel() doesn't match " "createSourcePicture()\n"); if (rbits) { *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; } } else { *red = 0x0000; *green = 0x0000; *blue = 0x0000; } if (abits) { *alpha = ((pixel >> ashift) & ((1 << abits) - 1)) << (16 - abits); while (abits < 16) { *alpha |= *alpha >> abits; abits <<= 1; } } else *alpha = 0xffff; return TRUE; } static int exaTryDriverSolidFill(PicturePtr pSrc, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { ExaScreenPriv(pDst->pDrawable->pScreen); RegionRec region; BoxPtr pbox; int nbox; int dst_off_x, dst_off_y; PixmapPtr pSrcPix, pDstPix; ExaPixmapPrivPtr pDstExaPix; CARD32 pixel; CARD16 red, green, blue, alpha; pDstPix = exaGetDrawablePixmap(pDst->pDrawable); pDstExaPix = ExaGetPixmapPriv(pDstPix); /* Check whether the accelerator can use the destination pixmap. */ if (pDstExaPix->accel_blocked) { return -1; } xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; if (pSrc->pDrawable) { xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; } if (!miComputeCompositeRegion(®ion, pSrc, NULL, pDst, xSrc, ySrc, 0, 0, xDst, yDst, width, height)) return 1; exaGetDrawableDeltas(pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); RegionTranslate(®ion, dst_off_x, dst_off_y); if (pSrc->pDrawable) { pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); pixel = exaGetPixmapFirstPixel(pSrcPix); } else pixel = pSrc->pSourcePict->solidFill.color; if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha, pSrc->pFormat, pSrc->format) || !exaGetPixelFromRGBA(&pixel, red, green, blue, alpha, pDst->pFormat)) { RegionUninit(®ion); return -1; } if (pExaScr->do_migration) { ExaMigrationRec pixmaps[1]; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pDstPix; pixmaps[0].pReg = ®ion; exaDoMigration(pixmaps, 1, TRUE); } if (!exaPixmapHasGpuCopy(pDstPix)) { RegionUninit(®ion); return 0; } if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel)) { RegionUninit(®ion); return -1; } nbox = RegionNumRects(®ion); pbox = RegionRects(®ion); while (nbox--) { (*pExaScr->info->Solid) (pDstPix, pbox->x1, pbox->y1, pbox->x2, pbox->y2); pbox++; } (*pExaScr->info->DoneSolid) (pDstPix); exaMarkSync(pDst->pDrawable->pScreen); RegionUninit(®ion); return 1; } static int exaTryDriverCompositeRects(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, int nrect, ExaCompositeRectPtr rects) { ExaScreenPriv(pDst->pDrawable->pScreen); int src_off_x = 0, src_off_y = 0, mask_off_x = 0, mask_off_y = 0; int dst_off_x, dst_off_y; PixmapPtr pSrcPix = NULL, pMaskPix = NULL, pDstPix; ExaPixmapPrivPtr pSrcExaPix = NULL, pMaskExaPix = NULL, pDstExaPix; if (!pExaScr->info->PrepareComposite) return -1; if (pSrc->pDrawable) { pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); pSrcExaPix = ExaGetPixmapPriv(pSrcPix); } if (pMask && pMask->pDrawable) { pMaskPix = exaGetDrawablePixmap(pMask->pDrawable); pMaskExaPix = ExaGetPixmapPriv(pMaskPix); } pDstPix = exaGetDrawablePixmap(pDst->pDrawable); pDstExaPix = ExaGetPixmapPriv(pDstPix); /* Check whether the accelerator can use these pixmaps. * FIXME: If it cannot, use temporary pixmaps so that the drawing * happens within limits. */ if (pDstExaPix->accel_blocked || (pSrcExaPix && pSrcExaPix->accel_blocked) || (pMaskExaPix && pMaskExaPix->accel_blocked)) { return -1; } if (pExaScr->info->CheckComposite && !(*pExaScr->info->CheckComposite) (op, pSrc, pMask, pDst)) { return -1; } if (pExaScr->do_migration) { ExaMigrationRec pixmaps[3]; int i = 0; pixmaps[i].as_dst = TRUE; pixmaps[i].as_src = exaOpReadsDestination(op); pixmaps[i].pPix = pDstPix; pixmaps[i].pReg = NULL; i++; if (pSrcPix) { pixmaps[i].as_dst = FALSE; pixmaps[i].as_src = TRUE; pixmaps[i].pPix = pSrcPix; pixmaps[i].pReg = NULL; i++; } if (pMaskPix) { pixmaps[i].as_dst = FALSE; pixmaps[i].as_src = TRUE; pixmaps[i].pPix = pMaskPix; pixmaps[i].pReg = NULL; i++; } exaDoMigration(pixmaps, i, TRUE); } pDstPix = exaGetOffscreenPixmap(pDst->pDrawable, &dst_off_x, &dst_off_y); if (!pDstPix) return 0; if (pSrcPix) { pSrcPix = exaGetOffscreenPixmap(pSrc->pDrawable, &src_off_x, &src_off_y); if (!pSrcPix) return 0; } if (pMaskPix) { pMaskPix = exaGetOffscreenPixmap(pMask->pDrawable, &mask_off_x, &mask_off_y); if (!pMaskPix) return 0; } if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix, pMaskPix, pDstPix)) return -1; while (nrect--) { INT16 xDst = rects->xDst + pDst->pDrawable->x; INT16 yDst = rects->yDst + pDst->pDrawable->y; INT16 xMask = rects->xMask; INT16 yMask = rects->yMask; INT16 xSrc = rects->xSrc; INT16 ySrc = rects->ySrc; RegionRec region; BoxPtr pbox; int nbox; if (pMaskPix) { xMask += pMask->pDrawable->x; yMask += pMask->pDrawable->y; } if (pSrcPix) { xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; } if (!miComputeCompositeRegion(®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, rects->width, rects->height)) goto next_rect; RegionTranslate(®ion, dst_off_x, dst_off_y); nbox = RegionNumRects(®ion); pbox = RegionRects(®ion); xMask = xMask + mask_off_x - xDst - dst_off_x; yMask = yMask + mask_off_y - yDst - dst_off_y; xSrc = xSrc + src_off_x - xDst - dst_off_x; ySrc = ySrc + src_off_y - yDst - dst_off_y; while (nbox--) { (*pExaScr->info->Composite) (pDstPix, pbox->x1 + xSrc, pbox->y1 + ySrc, pbox->x1 + xMask, pbox->y1 + yMask, pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; } next_rect: RegionUninit(®ion); rects++; } (*pExaScr->info->DoneComposite) (pDstPix); exaMarkSync(pDst->pDrawable->pScreen); return 1; } /** * Copy a number of rectangles from source to destination in a single * operation. This is specialized for glyph rendering: we don't have the * special-case fallbacks found in exaComposite() - if the driver can support * it, we use the driver functionality, otherwise we fall back straight to * software. */ void exaCompositeRects(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, int nrect, ExaCompositeRectPtr rects) { ExaScreenPriv(pDst->pDrawable->pScreen); int n; ExaCompositeRectPtr r; int ret; /* If we get a mask, that means we're rendering to the exaGlyphs * destination directly, so the damage layer takes care of this. */ if (!pMask) { RegionRec region; int x1 = MAXSHORT; int y1 = MAXSHORT; int x2 = MINSHORT; int y2 = MINSHORT; BoxRec box; /* We have to manage the damage ourselves, since CompositeRects isn't * something in the screen that can be managed by the damage extension, * and EXA depends on damage to track what needs to be migrated between * the gpu and the cpu. */ /* Compute the overall extents of the composited region - we're making * the assumption here that we are compositing a bunch of glyphs that * cluster closely together and damaging each glyph individually would * be a loss compared to damaging the bounding box. */ n = nrect; r = rects; while (n--) { int rect_x2 = r->xDst + r->width; int rect_y2 = r->yDst + r->height; if (r->xDst < x1) x1 = r->xDst; if (r->yDst < y1) y1 = r->yDst; if (rect_x2 > x2) x2 = rect_x2; if (rect_y2 > y2) y2 = rect_y2; r++; } if (x2 <= x1 || y2 <= y1) return; box.x1 = x1; box.x2 = x2 < MAXSHORT ? x2 : MAXSHORT; box.y1 = y1; box.y2 = y2 < MAXSHORT ? y2 : MAXSHORT; /* The pixmap migration code relies on pendingDamage indicating * the bounds of the current rendering, so we need to force * the actual damage into that region before we do anything, and * (see use of DamagePendingRegion in exaCopyDirty) */ RegionInit(®ion, &box, 1); DamageRegionAppend(pDst->pDrawable, ®ion); RegionUninit(®ion); } /************************************************************/ ValidatePicture(pSrc); if (pMask) ValidatePicture(pMask); ValidatePicture(pDst); ret = exaTryDriverCompositeRects(op, pSrc, pMask, pDst, nrect, rects); if (ret != 1) { if (ret == -1 && op == PictOpOver && pMask && pMask->componentAlpha && (!pExaScr->info->CheckComposite || ((*pExaScr->info->CheckComposite) (PictOpOutReverse, pSrc, pMask, pDst) && (*pExaScr->info->CheckComposite) (PictOpAdd, pSrc, pMask, pDst)))) { ret = exaTryDriverCompositeRects(PictOpOutReverse, pSrc, pMask, pDst, nrect, rects); if (ret == 1) { op = PictOpAdd; ret = exaTryDriverCompositeRects(op, pSrc, pMask, pDst, nrect, rects); } } if (ret != 1) { n = nrect; r = rects; while (n--) { ExaCheckComposite(op, pSrc, pMask, pDst, r->xSrc, r->ySrc, r->xMask, r->yMask, r->xDst, r->yDst, r->width, r->height); r++; } } } /************************************************************/ if (!pMask) { /* Now we have to flush the damage out from pendingDamage => damage * Calling DamageRegionProcessPending has that effect. */ DamageRegionProcessPending(pDst->pDrawable); } } static int exaTryDriverComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { ExaScreenPriv(pDst->pDrawable->pScreen); RegionRec region; BoxPtr pbox; int nbox; int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y; PixmapPtr pSrcPix = NULL, pMaskPix = NULL, pDstPix; ExaPixmapPrivPtr pSrcExaPix = NULL, pMaskExaPix = NULL, pDstExaPix; if (pSrc->pDrawable) { pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); pSrcExaPix = ExaGetPixmapPriv(pSrcPix); } pDstPix = exaGetDrawablePixmap(pDst->pDrawable); pDstExaPix = ExaGetPixmapPriv(pDstPix); if (pMask && pMask->pDrawable) { pMaskPix = exaGetDrawablePixmap(pMask->pDrawable); pMaskExaPix = ExaGetPixmapPriv(pMaskPix); } /* Check whether the accelerator can use these pixmaps. * FIXME: If it cannot, use temporary pixmaps so that the drawing * happens within limits. */ if (pDstExaPix->accel_blocked || (pSrcExaPix && pSrcExaPix->accel_blocked) || (pMaskExaPix && (pMaskExaPix->accel_blocked))) { return -1; } xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; if (pMaskPix) { xMask += pMask->pDrawable->x; yMask += pMask->pDrawable->y; } if (pSrcPix) { xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; } if (pExaScr->info->CheckComposite && !(*pExaScr->info->CheckComposite) (op, pSrc, pMask, pDst)) { return -1; } if (!miComputeCompositeRegion(®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) return 1; exaGetDrawableDeltas(pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); RegionTranslate(®ion, dst_off_x, dst_off_y); if (pExaScr->do_migration) { ExaMigrationRec pixmaps[3]; int i = 0; pixmaps[i].as_dst = TRUE; pixmaps[i].as_src = exaOpReadsDestination(op); pixmaps[i].pPix = pDstPix; pixmaps[i].pReg = pixmaps[0].as_src ? NULL : ®ion; i++; if (pSrcPix) { pixmaps[i].as_dst = FALSE; pixmaps[i].as_src = TRUE; pixmaps[i].pPix = pSrcPix; pixmaps[i].pReg = NULL; i++; } if (pMaskPix) { pixmaps[i].as_dst = FALSE; pixmaps[i].as_src = TRUE; pixmaps[i].pPix = pMaskPix; pixmaps[i].pReg = NULL; i++; } exaDoMigration(pixmaps, i, TRUE); } if (pSrcPix) { pSrcPix = exaGetOffscreenPixmap(pSrc->pDrawable, &src_off_x, &src_off_y); if (!pSrcPix) { RegionUninit(®ion); return 0; } } if (pMaskPix) { pMaskPix = exaGetOffscreenPixmap(pMask->pDrawable, &mask_off_x, &mask_off_y); if (!pMaskPix) { RegionUninit(®ion); return 0; } } if (!exaPixmapHasGpuCopy(pDstPix)) { RegionUninit(®ion); return 0; } if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix, pMaskPix, pDstPix)) { RegionUninit(®ion); return -1; } nbox = RegionNumRects(®ion); pbox = RegionRects(®ion); xMask = xMask + mask_off_x - xDst - dst_off_x; yMask = yMask + mask_off_y - yDst - dst_off_y; xSrc = xSrc + src_off_x - xDst - dst_off_x; ySrc = ySrc + src_off_y - yDst - dst_off_y; while (nbox--) { (*pExaScr->info->Composite) (pDstPix, pbox->x1 + xSrc, pbox->y1 + ySrc, pbox->x1 + xMask, pbox->y1 + yMask, pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; } (*pExaScr->info->DoneComposite) (pDstPix); exaMarkSync(pDst->pDrawable->pScreen); RegionUninit(®ion); return 1; } /** * exaTryMagicTwoPassCompositeHelper implements PictOpOver using two passes of * simpler operations PictOpOutReverse and PictOpAdd. Mainly used for component * alpha and limited 1-tmu cards. * * From http://anholt.livejournal.com/32058.html: * * The trouble is that component-alpha rendering requires two different sources * for blending: one for the source value to the blender, which is the * per-channel multiplication of source and mask, and one for the source alpha * for multiplying with the destination channels, which is the multiplication * of the source channels by the mask alpha. So the equation for Over is: * * dst.A = src.A * mask.A + (1 - (src.A * mask.A)) * dst.A * dst.R = src.R * mask.R + (1 - (src.A * mask.R)) * dst.R * dst.G = src.G * mask.G + (1 - (src.A * mask.G)) * dst.G * dst.B = src.B * mask.B + (1 - (src.A * mask.B)) * dst.B * * But we can do some simpler operations, right? How about PictOpOutReverse, * which has a source factor of 0 and dest factor of (1 - source alpha). We * can get the source alpha value (srca.X = src.A * mask.X) out of the texture * blenders pretty easily. So we can do a component-alpha OutReverse, which * gets us: * * dst.A = 0 + (1 - (src.A * mask.A)) * dst.A * dst.R = 0 + (1 - (src.A * mask.R)) * dst.R * dst.G = 0 + (1 - (src.A * mask.G)) * dst.G * dst.B = 0 + (1 - (src.A * mask.B)) * dst.B * * OK. And if an op doesn't use the source alpha value for the destination * factor, then we can do the channel multiplication in the texture blenders * to get the source value, and ignore the source alpha that we wouldn't use. * We've supported this in the Radeon driver for a long time. An example would * be PictOpAdd, which does: * * dst.A = src.A * mask.A + dst.A * dst.R = src.R * mask.R + dst.R * dst.G = src.G * mask.G + dst.G * dst.B = src.B * mask.B + dst.B * * Hey, this looks good! If we do a PictOpOutReverse and then a PictOpAdd right * after it, we get: * * dst.A = src.A * mask.A + ((1 - (src.A * mask.A)) * dst.A) * dst.R = src.R * mask.R + ((1 - (src.A * mask.R)) * dst.R) * dst.G = src.G * mask.G + ((1 - (src.A * mask.G)) * dst.G) * dst.B = src.B * mask.B + ((1 - (src.A * mask.B)) * dst.B) */ static int exaTryMagicTwoPassCompositeHelper(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { ExaScreenPriv(pDst->pDrawable->pScreen); assert(op == PictOpOver); if (pExaScr->info->CheckComposite && (!(*pExaScr->info->CheckComposite) (PictOpOutReverse, pSrc, pMask, pDst) || !(*pExaScr->info->CheckComposite) (PictOpAdd, pSrc, pMask, pDst))) { return -1; } /* Now, we think we should be able to accelerate this operation. First, * composite the destination to be the destination times the source alpha * factors. */ exaComposite(PictOpOutReverse, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); /* Then, add in the source value times the destination alpha factors (1.0). */ exaComposite(PictOpAdd, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); return 1; } void exaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { ExaScreenPriv(pDst->pDrawable->pScreen); int ret = -1; Bool saveSrcRepeat = pSrc->repeat; Bool saveMaskRepeat = pMask ? pMask->repeat : 0; RegionRec region; if (pExaScr->swappedOut) goto fallback; /* Remove repeat in source if useless */ if (pSrc->pDrawable && pSrc->repeat && !pSrc->transform && xSrc >= 0 && (xSrc + width) <= pSrc->pDrawable->width && ySrc >= 0 && (ySrc + height) <= pSrc->pDrawable->height) pSrc->repeat = 0; if (!pMask && !pSrc->alphaMap && !pDst->alphaMap && (op == PictOpSrc || (op == PictOpOver && !PICT_FORMAT_A(pSrc->format)))) { if (pSrc->pDrawable ? (pSrc->pDrawable->width == 1 && pSrc->pDrawable->height == 1 && pSrc->repeat) : (pSrc->pSourcePict->type == SourcePictTypeSolidFill)) { ret = exaTryDriverSolidFill(pSrc, pDst, xSrc, ySrc, xDst, yDst, width, height); if (ret == 1) goto done; } else if (pSrc->pDrawable && !pSrc->transform && ((op == PictOpSrc && (pSrc->format == pDst->format || (PICT_FORMAT_COLOR(pDst->format) && PICT_FORMAT_COLOR(pSrc->format) && pDst->format == PICT_FORMAT(PICT_FORMAT_BPP(pSrc->format), PICT_FORMAT_TYPE(pSrc->format), 0, PICT_FORMAT_R(pSrc->format), PICT_FORMAT_G(pSrc->format), PICT_FORMAT_B(pSrc->format))))) || (op == PictOpOver && pSrc->format == pDst->format && !PICT_FORMAT_A(pSrc->format)))) { if (!pSrc->repeat && xSrc >= 0 && ySrc >= 0 && (xSrc + width <= pSrc->pDrawable->width) && (ySrc + height <= pSrc->pDrawable->height)) { Bool suc; xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; if (!miComputeCompositeRegion(®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) goto done; suc = exaHWCopyNtoN(pSrc->pDrawable, pDst->pDrawable, NULL, RegionRects(®ion), RegionNumRects(®ion), xSrc - xDst, ySrc - yDst, FALSE, FALSE); RegionUninit(®ion); /* Reset values to their original values. */ xDst -= pDst->pDrawable->x; yDst -= pDst->pDrawable->y; xSrc -= pSrc->pDrawable->x; ySrc -= pSrc->pDrawable->y; if (!suc) goto fallback; goto done; } if (pSrc->repeat && pSrc->repeatType == RepeatNormal && pSrc->pDrawable->type == DRAWABLE_PIXMAP) { DDXPointRec patOrg; /* Let's see if the driver can do the repeat in one go */ if (pExaScr->info->PrepareComposite && !pSrc->alphaMap && !pDst->alphaMap) { ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); if (ret == 1) goto done; } /* Now see if we can use exaFillRegionTiled() */ xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; if (!miComputeCompositeRegion(®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) goto done; /* pattern origin is the point in the destination drawable * corresponding to (0,0) in the source */ patOrg.x = xDst - xSrc; patOrg.y = yDst - ySrc; ret = exaFillRegionTiled(pDst->pDrawable, ®ion, (PixmapPtr) pSrc->pDrawable, &patOrg, FB_ALLONES, GXcopy, CT_NONE); RegionUninit(®ion); if (ret) goto done; /* Let's be correct and restore the variables to their original state. */ xDst -= pDst->pDrawable->x; yDst -= pDst->pDrawable->y; xSrc -= pSrc->pDrawable->x; ySrc -= pSrc->pDrawable->y; } } } /* Remove repeat in mask if useless */ if (pMask && pMask->pDrawable && pMask->repeat && !pMask->transform && xMask >= 0 && (xMask + width) <= pMask->pDrawable->width && yMask >= 0 && (yMask + height) <= pMask->pDrawable->height) pMask->repeat = 0; if (pExaScr->info->PrepareComposite && !pSrc->alphaMap && (!pMask || !pMask->alphaMap) && !pDst->alphaMap) { Bool isSrcSolid; ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); if (ret == 1) goto done; /* For generic masks and solid src pictures, mach64 can do Over in two * passes, similar to the component-alpha case. */ isSrcSolid = pSrc->pDrawable ? (pSrc->pDrawable->width == 1 && pSrc->pDrawable->height == 1 && pSrc->repeat) : (pSrc->pSourcePict->type == SourcePictTypeSolidFill); /* If we couldn't do the Composite in a single pass, and it was a * component-alpha Over, see if we can do it in two passes with * an OutReverse and then an Add. */ if (ret == -1 && op == PictOpOver && pMask && (pMask->componentAlpha || isSrcSolid)) { ret = exaTryMagicTwoPassCompositeHelper(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); if (ret == 1) goto done; } } fallback: #if DEBUG_TRACE_FALL exaPrintCompositeFallback(op, pSrc, pMask, pDst); #endif ExaCheckComposite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); done: pSrc->repeat = saveSrcRepeat; if (pMask) pMask->repeat = saveMaskRepeat; } /** * Same as miCreateAlphaPicture, except it uses ExaCheckPolyFillRect instead * of PolyFillRect to initialize the pixmap after creating it, to prevent * the pixmap from being migrated. * * See the comments about exaTrapezoids and exaTriangles. */ static PicturePtr exaCreateAlphaPicture(ScreenPtr pScreen, PicturePtr pDst, PictFormatPtr pPictFormat, CARD16 width, CARD16 height) { PixmapPtr pPixmap; PicturePtr pPicture; GCPtr pGC; int error; xRectangle rect; if (width > 32767 || height > 32767) return 0; if (!pPictFormat) { if (pDst->polyEdge == PolyEdgeSharp) pPictFormat = PictureMatchFormat(pScreen, 1, PICT_a1); else pPictFormat = PictureMatchFormat(pScreen, 8, PICT_a8); if (!pPictFormat) return 0; } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPictFormat->depth, 0); if (!pPixmap) return 0; pGC = GetScratchGC(pPixmap->drawable.depth, pScreen); if (!pGC) { (*pScreen->DestroyPixmap) (pPixmap); return 0; } ValidateGC(&pPixmap->drawable, pGC); rect.x = 0; rect.y = 0; rect.width = width; rect.height = height; ExaCheckPolyFillRect(&pPixmap->drawable, pGC, 1, &rect); exaPixmapDirty(pPixmap, 0, 0, width, height); FreeScratchGC(pGC); pPicture = CreatePicture(0, &pPixmap->drawable, pPictFormat, 0, 0, serverClient, &error); (*pScreen->DestroyPixmap) (pPixmap); return pPicture; } /** * exaTrapezoids is essentially a copy of miTrapezoids that uses * exaCreateAlphaPicture instead of miCreateAlphaPicture. * * The problem with miCreateAlphaPicture is that it calls PolyFillRect * to initialize the contents after creating the pixmap, which * causes the pixmap to be moved in for acceleration. The subsequent * call to RasterizeTrapezoid won't be accelerated however, which * forces the pixmap to be moved out again. * * exaCreateAlphaPicture avoids this roundtrip by using ExaCheckPolyFillRect * to initialize the contents. */ void exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps) { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); BoxRec bounds; if (maskFormat) { PicturePtr pPicture; INT16 xDst, yDst; INT16 xRel, yRel; miTrapezoidBounds(ntrap, traps, &bounds); if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) return; xDst = traps[0].left.p1.x >> 16; yDst = traps[0].left.p1.y >> 16; pPicture = exaCreateAlphaPicture(pScreen, pDst, maskFormat, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); if (!pPicture) return; exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); for (; ntrap; ntrap--, traps++) (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1); exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); xRel = bounds.x1 + xSrc - xDst; yRel = bounds.y1 + ySrc - yDst; CompositePicture(op, pSrc, pPicture, pDst, xRel, yRel, 0, 0, bounds.x1, bounds.y1, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); FreePicture(pPicture, 0); } else { if (pDst->polyEdge == PolyEdgeSharp) maskFormat = PictureMatchFormat(pScreen, 1, PICT_a1); else maskFormat = PictureMatchFormat(pScreen, 8, PICT_a8); for (; ntrap; ntrap--, traps++) exaTrapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps); } } /** * exaTriangles is essentially a copy of miTriangles that uses * exaCreateAlphaPicture instead of miCreateAlphaPicture. * * The problem with miCreateAlphaPicture is that it calls PolyFillRect * to initialize the contents after creating the pixmap, which * causes the pixmap to be moved in for acceleration. The subsequent * call to AddTriangles won't be accelerated however, which forces the pixmap * to be moved out again. * * exaCreateAlphaPicture avoids this roundtrip by using ExaCheckPolyFillRect * to initialize the contents. */ void exaTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris) { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); BoxRec bounds; if (maskFormat) { PicturePtr pPicture; INT16 xDst, yDst; INT16 xRel, yRel; miTriangleBounds(ntri, tris, &bounds); if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) return; xDst = tris[0].p1.x >> 16; yDst = tris[0].p1.y >> 16; pPicture = exaCreateAlphaPicture(pScreen, pDst, maskFormat, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); if (!pPicture) return; exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); (*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris); exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); xRel = bounds.x1 + xSrc - xDst; yRel = bounds.y1 + ySrc - yDst; CompositePicture(op, pSrc, pPicture, pDst, xRel, yRel, 0, 0, bounds.x1, bounds.y1, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); FreePicture(pPicture, 0); } else { if (pDst->polyEdge == PolyEdgeSharp) maskFormat = PictureMatchFormat(pScreen, 1, PICT_a1); else maskFormat = PictureMatchFormat(pScreen, 8, PICT_a8); for (; ntri; ntri--, tris++) exaTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/aclocal.m4�����������������������������������������������������������������������0000664�0001751�0001751�00001551032�12466505417�012672� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 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. # 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 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_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' 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.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_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.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- # Copyright (C) 2001-2013 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_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 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_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 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_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 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. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: <http://www.gnu.org/software/coreutils/>. If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 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_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 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_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 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_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 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_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 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_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 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_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 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_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 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_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 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_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar <conftest.tar]) AM_RUN_LOG([cat conftest.dir/file]) grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ac_define_dir.m4]) m4_include([m4/xorg-tls.m4]) dnl fontutil.m4. Generated from fontutil.m4.in by configure. dnl dnl This file comes from X.Org's font-util 1.1.1 dnl dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl dnl -------------------------------------------------------------------- dnl dnl Copyright 2009 Sun Microsystems, Inc. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the dnl "Software"), to deal in the Software without restriction, including dnl without limitation the rights to use, copy, modify, merge, publish, dnl distribute, and/or sell copies of the Software, and to permit persons dnl to whom the Software is furnished to do so, provided that the above dnl copyright notice(s) and this permission notice appear in all copies of dnl the Software and that both the above copyright notice(s) and this dnl permission notice appear in supporting documentation. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl dnl Except as contained in this notice, the name of a copyright holder dnl shall not be used in advertising or otherwise to promote the sale, use dnl or other dealings in this Software without prior written authorization dnl of the copyright holder. # XORG_FONT_MACROS_VERSION(required-version) # ------------------------------------------ # Minimum version: 1.1.0 # # If you're using a macro added in Version 1.1 or newer, include this in # your configure.ac with the minimum required version, such as: # XORG_FONT_MACROS_VERSION(1.1) # # To ensure that this macro is defined, also add: # m4_ifndef([XORG_FONT_MACROS_VERSION], # [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])]) # # # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_FONT_MACROS_VERSION],[ m4_define([vers_have], [1.1.1]) 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,, [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])]) m4_if(m4_version_compare(vers_have, [$1]), -1, [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])]) m4_undefine([vers_have]) m4_undefine([maj_have]) m4_undefine([maj_needed]) ]) # XORG_FONT_MACROS_VERSION # XORG_FONT_CHECK_{maps}() # ------------------------ # Minimum version: 1.0.0 # These macros add --enable/disable-{maps} where {maps} are ISO8859-*, # JISX0201 or KOI8_R. By default, they are all enabled. AC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)]) AC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)]) AC_DEFUN([XORG_FONT_CHECK_JISX0201], [XORG_FONT_CHECK_ENCODING(JISX0201)]) AC_DEFUN([XORG_FONT_CHECK_KOI8_R], [XORG_FONT_CHECK_ENCODING(KOI8-R)]) # XORG_FONT_CHECK_ENCODING(encoding) # ---------------------------------- # Minimum version: 1.1.0 # This macro adds --enable/disable-<encoding>, enabled by default. # It replaced individual copies of this code in the above macros in 1.1. # Currently assumes encoding names will be all upper-case - add m4_toupper # calls if this is not true in the future. AC_DEFUN([XORG_FONT_CHECK_ENCODING],[ AC_ARG_ENABLE(m4_tolower($1), AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)), [Build $1 fonts (default: yes)]), [AS_TR_SH($1)=$enableval], [AS_TR_SH($1)=yes]) AC_MSG_CHECKING([whether to build $1 fonts]) AC_MSG_RESULT($[AS_TR_SH($1)]) AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes]) ]) # XORG_FONT_CHECK_ENCODING # XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....) # ----------------------------------------------------- # Minimum version: 1.1.0 # Call XORG_FONT_CHECK_ENCODING for multiple encodings at once AC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[ m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)]) ]) # XORG_FONT_CHECK_ENCODING_LIST # XORG_FONT_REQUIRED_PROG(VARNAME, progname) # ------------------------------------------ # Minimum version: 1.1.0 # # Simple wrapper around AC_PATH_PROG that errors if not found # AC_DEFUN([XORG_FONT_REQUIRED_PROG],[ AC_PATH_PROG($1, $2) if test x"$1" = x; then AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.]) fi ]) # XORG_FONT_FCCACHE() # ------------------- # Minimum version: 1.1.0 # # Set FCCACHE to path to fc-cache (fontconfig cache builder) if found # Set RUN_FCCACHE to a rule suitable for substituting into a makefile # to run fc-cache if found and not installing to $DESTDIR # # fc-cache is optional, not required, and should be skipped when making # packages (installing to $DESTDIR). # AC_DEFUN([XORG_FONT_FCCACHE],[ AC_PATH_PROG(FCCACHE, fc-cache) FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"' if test x"$FCCACHE" = x ; then RUN_FCCACHE="${FCCACHE_WARN}" else RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else' RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)" fi AC_SUBST([RUN_FCCACHE]) ]) # XORG_FONT_COMMON_UTILS() # ------------------------ # Minimum version: 1.1.0 # # Call XORG_FONT_REQUIRED_PROG for programs needed for all font types AC_DEFUN([XORG_FONT_COMMON_UTILS],[ XORG_FONT_FCCACHE XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir) ]) # XORG_FONT_SCALED_UTILS() # ------------------------ # Minimum version: 1.1.0 # # Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts # (TrueType, OpenType, Type1) AC_DEFUN([XORG_FONT_SCALED_UTILS],[ XORG_FONT_COMMON_UTILS XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale) ]) # XORG_FONT_BDF_UTILS() # --------------------- # Minimum version: 1.1.0 # # Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts # Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the # PCF output files created by bdftopcf AC_DEFUN([XORG_FONT_BDF_UTILS],[ XORG_FONT_COMMON_UTILS XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf) XORG_FONT_CHECK_COMPRESSION ]) # XORG_FONT_CHECK_COMPRESSION() # ----------------------------- # Minimum version: 1.1.0 # # Offer a --with-compression flag to control what compression method is # used for pcf font files. Offers all the methods currently supported # by libXfont, including no compression. AC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[ AC_MSG_CHECKING([font compression method]) AC_ARG_WITH(compression, [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>], [compression method to use on pcf fonts])], [compression="$withval"], [compression="yes"]) if test x"$compression" = "xyes" ; then compression="gzip" fi AC_MSG_RESULT([${compression}]) case ${compression} in *compress) COMPRESS_SUFFIX=".Z" ;; *gzip) COMPRESS_SUFFIX=".gz" ;; *bzip2) COMPRESS_SUFFIX=".bz2" ;; no|none) COMPRESS_SUFFIX="" ; COMPRESS="cat" ;; *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;; esac if test x"$COMPRESS_SUFFIX" != "x" ; then XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression}) fi AC_SUBST([COMPRESS_SUFFIX]) ]) # XORG_FONT_UCS2ANY() # ------------------- # Minimum version: 1.1.0 # # Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting # Unicode-encoded BDF format bitmap fonts into subsets for older encodings. # Also call pkg-config to find the directory with the encoding files needed # by ucs2any, and export it as MAPFILES_PATH to the Makefiles AC_DEFUN([XORG_FONT_UCS2ANY],[ XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any) PKG_CHECK_MODULES(MAPS, [fontutil]) AC_MSG_CHECKING([for ucs2any encoding data files]) MAPFILES_PATH=`pkg-config --variable=mapdir fontutil` AC_SUBST(MAPFILES_PATH) AC_MSG_RESULT([${MAPFILES_PATH}]) ]) # XORG_FONTROOTDIR() # -------------------- # Minimum version: 1.1.0 # # Sets FONTROOTDIR to the root directory for font files. Uses the first # found from: # --with-fontrootdir # pkg-config --variable=fontrootdir fontutil # ${datadir}/fonts/X11 AC_DEFUN([XORG_FONTROOTDIR],[ dnl Ensure $PKG_CONFIG is set first AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_MSG_CHECKING([for root directory for font files]) AC_ARG_WITH(fontrootdir, AS_HELP_STRING([--with-fontrootdir=DIR], [Path to root directory for font files]), [FONTROOTDIR="$withval"]) # if --with-fontrootdir not specified... if test "x${FONTROOTDIR}" = "x"; then FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil` fi # ...and if pkg-config didn't find fontdir in fontutil.pc... if test "x${FONTROOTDIR}" = "x"; then FONTROOTDIR="${datadir}/fonts/X11" fi AC_SUBST(FONTROOTDIR) AC_MSG_RESULT([${FONTROOTDIR}]) ]) # XORG_FONTSUBDIR(variable, flag, subdir) # --------------------------------------- # Minimum version: 1.1.0 # # Offer a --with-<flag> flag to control directory for font installation # Default is the specified <subdir> of the font root directory. # Sets <variable> to the selected directory AC_DEFUN([XORG_FONTSUBDIR],[ AC_REQUIRE([XORG_FONTROOTDIR]) AC_MSG_CHECKING([for directory for $3 files]) AC_ARG_WITH($2, [AS_HELP_STRING([--with-$2=DIR], [Path to $3 files [FONTROOTDIR/$3]])], [$1="${withval}"], [$1='${FONTROOTDIR}/$3']) AC_SUBST($1) AC_MSG_RESULT([${$1}]) ]) # XORG_FONTSUBDIR # XORG_FONTDIR(subdir) # -------------------- # Minimum version: 1.1.0 # # Offer a --with-fontdir flag to control directory for font installation # Default is the specified subdir of the font root directory. # Sets FONTDIR to the selected directory AC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) _LT_PATH_LD_GNU AC_SUBST([LD]) _LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) ])# LT_PATH_LD # Old names: AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_LD], []) dnl AC_DEFUN([AC_PROG_LD], []) # _LT_PATH_LD_GNU #- -------------- m4_defun([_LT_PATH_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac]) with_gnu_ld=$lt_cv_prog_gnu_ld ])# _LT_PATH_LD_GNU # _LT_CMD_RELOAD # -------------- # find reload flag for linker # -- PORTME Some linkers may need a different reload flag. m4_defun([_LT_CMD_RELOAD], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl _LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [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. _PKG_TEXT To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, dnl and/or sell copies of the Software, and to permit persons to whom the dnl Software is furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice (including the next dnl paragraph) shall be included in all copies or substantial portions of the dnl Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER dnl DEALINGS IN THE SOFTWARE. # XORG_MACROS_VERSION(required-version) # ------------------------------------- # Minimum version: 1.1.0 # # If you're using a macro added in Version 1.1 or newer, include this in # your configure.ac with the minimum required version, such as: # XORG_MACROS_VERSION(1.1) # # To ensure that this macro is defined, also add: # m4_ifndef([XORG_MACROS_VERSION], # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) # # # 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.19.0]) 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,, [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) m4_if(m4_version_compare(vers_have, [$1]), -1, [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) m4_undefine([vers_have]) m4_undefine([maj_have]) m4_undefine([maj_needed]) ]) # XORG_MACROS_VERSION # XORG_PROG_RAWCPP() # ------------------ # Minimum version: 1.0.0 # # Find cpp program and necessary flags for use in pre-processing text files # such as man pages and config files AC_DEFUN([XORG_PROG_RAWCPP],[ AC_REQUIRE([AC_PROG_CPP]) AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) # Check for flag to avoid builtin definitions - assumes unix is predefined, # which is not the best choice for supporting other OS'es, but covers most # of the ones we need for now. AC_MSG_CHECKING([if $RAWCPP requires -undef]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS=-undef AC_MSG_RESULT([yes]) # under Cygwin unix is still defined even with -undef elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS="-undef -ansi" AC_MSG_RESULT([yes, with -ansi]) else AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_MSG_CHECKING([if $RAWCPP requires -traditional]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then TRADITIONALCPPFLAGS="-traditional" RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" AC_MSG_RESULT([yes]) else AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_SUBST(RAWCPPFLAGS) AC_SUBST(TRADITIONALCPPFLAGS) ]) # XORG_PROG_RAWCPP # XORG_MANPAGE_SECTIONS() # ----------------------- # Minimum version: 1.0.0 # # Determine which sections man pages go in for the different man page types # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. # Not sure if there's any better way than just hardcoding by OS name. # Override default settings by setting environment variables # Added MAN_SUBSTS in version 1.8 # Added AC_PROG_SED in version 1.8 AC_DEFUN([XORG_MANPAGE_SECTIONS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_SED]) if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi AC_SUBST([APP_MAN_SUFFIX]) AC_SUBST([LIB_MAN_SUFFIX]) AC_SUBST([FILE_MAN_SUFFIX]) AC_SUBST([MISC_MAN_SUFFIX]) AC_SUBST([DRIVER_MAN_SUFFIX]) AC_SUBST([ADMIN_MAN_SUFFIX]) AC_SUBST([APP_MAN_DIR]) AC_SUBST([LIB_MAN_DIR]) AC_SUBST([FILE_MAN_DIR]) AC_SUBST([MISC_MAN_DIR]) AC_SUBST([DRIVER_MAN_DIR]) AC_SUBST([ADMIN_MAN_DIR]) XORG_MAN_PAGE="X Version 11" AC_SUBST([XORG_MAN_PAGE]) MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" AC_SUBST([MAN_SUBSTS]) ]) # XORG_MANPAGE_SECTIONS # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) # ------------------------ # Minimum version: 1.7.0 # # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent # provided by xorg-sgml-doctools, if installed. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) XORG_SGML_PATH= PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], [m4_ifval([$1],[:], [if test x"$cross_compiling" != x"yes" ; then AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], [XORG_SGML_PATH=$prefix/share/sgml]) fi]) ]) # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing # the path and the name of the doc stylesheet if test "x$XORG_SGML_PATH" != "x" ; then AC_MSG_RESULT([$XORG_SGML_PATH]) STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl else AC_MSG_RESULT([no]) fi AC_SUBST(XORG_SGML_PATH) AC_SUBST(STYLESHEET_SRCDIR) AC_SUBST(XSL_STYLESHEET) AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) ]) # XORG_CHECK_SGML_DOCTOOLS # XORG_CHECK_LINUXDOC # ------------------- # Minimum version: 1.0.0 # # Defines the variable MAKE_TEXT if the necessary tools and # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. # Whether or not the necessary tools and files are found can be checked # with the AM_CONDITIONAL "BUILD_LINUXDOC" AC_DEFUN([XORG_CHECK_LINUXDOC],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) AC_REQUIRE([XORG_WITH_PS2PDF]) AC_PATH_PROG(LINUXDOC, linuxdoc) AC_MSG_CHECKING([whether to build documentation]) if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then BUILDDOC=yes else BUILDDOC=no fi AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) AC_MSG_RESULT([$BUILDDOC]) AC_MSG_CHECKING([whether to build pdf documentation]) if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes else BUILDPDFDOC=no fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" MAKE_PDF="$PS2PDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_LINUXDOC # XORG_CHECK_DOCBOOK # ------------------- # Minimum version: 1.0.0 # # Checks for the ability to build output formats from SGML DocBook source. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" # indicates whether the necessary tools and files are found and, if set, # $(MAKE_XXX) blah.sgml will produce blah.xxx. AC_DEFUN([XORG_CHECK_DOCBOOK],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) BUILDTXTDOC=no BUILDPDFDOC=no BUILDPSDOC=no BUILDHTMLDOC=no AC_PATH_PROG(DOCBOOKPS, docbook2ps) AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) AC_PATH_PROG(DOCBOOKHTML, docbook2html) AC_PATH_PROG(DOCBOOKTXT, docbook2txt) AC_MSG_CHECKING([whether to build text documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && test x$BUILD_TXTDOC != xno; then BUILDTXTDOC=yes fi AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) AC_MSG_RESULT([$BUILDTXTDOC]) AC_MSG_CHECKING([whether to build PDF documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) AC_MSG_CHECKING([whether to build PostScript documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && test x$BUILD_PSDOC != xno; then BUILDPSDOC=yes fi AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) AC_MSG_RESULT([$BUILDPSDOC]) AC_MSG_CHECKING([whether to build HTML documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && test x$BUILD_HTMLDOC != xno; then BUILDHTMLDOC=yes fi AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) AC_MSG_RESULT([$BUILDHTMLDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_DOCBOOK # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-xmlto option, it allows maximum flexibilty in making decisions # as whether or not to use the xmlto package. When DEFAULT is not specified, # --with-xmlto assumes 'auto'. # # Interface to module: # HAVE_XMLTO: used in makefiles to conditionally generate documentation # XMLTO: returns the path of the xmlto program found # returns the path set by the user in the environment # --with-xmlto: 'yes' user instructs the module to use xmlto # 'no' user instructs the module not to use xmlto # # Added in version 1.10.0 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation # xmlto for text output requires either lynx, links, or w3m browsers # # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XMLTO],[ AC_ARG_VAR([XMLTO], [Path to xmlto command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xmlto, AS_HELP_STRING([--with-xmlto], [Use xmlto to regenerate documentation (default: ]_defopt[)]), [use_xmlto=$withval], [use_xmlto=]_defopt) m4_undefine([_defopt]) if test "x$use_xmlto" = x"auto"; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) have_xmlto=no else have_xmlto=yes fi elif test "x$use_xmlto" = x"yes" ; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) fi have_xmlto=yes elif test "x$use_xmlto" = x"no" ; then if test "x$XMLTO" != "x"; then AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) fi have_xmlto=no else AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) fi # Test for a minimum version of xmlto, if provided. m4_ifval([$1], [if test "$have_xmlto" = yes; then # scrape the xmlto version AC_MSG_CHECKING([the xmlto version]) xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$xmlto_version]) AS_VERSION_COMPARE([$xmlto_version], [$1], [if test "x$use_xmlto" = xauto; then AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) have_xmlto=no else AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) fi]) fi]) # Test for the ability of xmlto to generate a text target have_xmlto_text=no cat > conftest.xml << "EOF" EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) ]) # XORG_WITH_XMLTO # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) # -------------------------------------------- # Minimum version: 1.12.0 # Minimum version for optional DEFAULT argument: 1.12.0 # # XSLT (Extensible Stylesheet Language Transformations) is a declarative, # XML-based language used for the transformation of XML documents. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents. # It is used under the cover by xmlto to generate html files from DocBook/XML. # The XSLT processor is often used as a standalone tool for transformations. # It should not be assumed that this tool is used only to work with documnetation. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'. # # Interface to module: # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation # XSLTPROC: returns the path of the xsltproc program found # returns the path set by the user in the environment # --with-xsltproc: 'yes' user instructs the module to use xsltproc # 'no' user instructs the module not to use xsltproc # have_xsltproc: returns yes if xsltproc found in PATH or no # # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XSLTPROC],[ AC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xsltproc, AS_HELP_STRING([--with-xsltproc], [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), [use_xsltproc=$withval], [use_xsltproc=]_defopt) m4_undefine([_defopt]) if test "x$use_xsltproc" = x"auto"; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) have_xsltproc=no else have_xsltproc=yes fi elif test "x$use_xsltproc" = x"yes" ; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) fi have_xsltproc=yes elif test "x$use_xsltproc" = x"no" ; then if test "x$XSLTPROC" != "x"; then AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) fi have_xsltproc=no else AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) ]) # XORG_WITH_XSLTPROC # XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.15.0 # # PERL (Practical Extraction and Report Language) is a language optimized for # scanning arbitrary text files, extracting information from those text files, # and printing reports based on that information. # # When DEFAULT is not specified, --with-perl assumes 'auto'. # # Interface to module: # HAVE_PERL: used in makefiles to conditionally scan text files # PERL: returns the path of the perl program found # returns the path set by the user in the environment # --with-perl: 'yes' user instructs the module to use perl # 'no' user instructs the module not to use perl # have_perl: returns yes if perl found in PATH or no # # If the user sets the value of PERL, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PERL],[ AC_ARG_VAR([PERL], [Path to perl command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(perl, AS_HELP_STRING([--with-perl], [Use perl for extracting information from files (default: ]_defopt[)]), [use_perl=$withval], [use_perl=]_defopt) m4_undefine([_defopt]) if test "x$use_perl" = x"auto"; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_WARN([perl not found - cannot extract information and report]) have_perl=no else have_perl=yes fi elif test "x$use_perl" = x"yes" ; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) fi have_perl=yes elif test "x$use_perl" = x"no" ; then if test "x$PERL" != "x"; then AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) fi have_perl=no else AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) ]) # XORG_WITH_PERL # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-asciidoc option, it allows maximum flexibilty in making decisions # as whether or not to use the asciidoc package. When DEFAULT is not specified, # --with-asciidoc assumes 'auto'. # # Interface to module: # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation # ASCIIDOC: returns the path of the asciidoc program found # returns the path set by the user in the environment # --with-asciidoc: 'yes' user instructs the module to use asciidoc # 'no' user instructs the module not to use asciidoc # # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_ASCIIDOC],[ AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(asciidoc, AS_HELP_STRING([--with-asciidoc], [Use asciidoc to regenerate documentation (default: ]_defopt[)]), [use_asciidoc=$withval], [use_asciidoc=]_defopt) m4_undefine([_defopt]) if test "x$use_asciidoc" = x"auto"; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) have_asciidoc=no else have_asciidoc=yes fi elif test "x$use_asciidoc" = x"yes" ; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) fi have_asciidoc=yes elif test "x$use_asciidoc" = x"no" ; then if test "x$ASCIIDOC" != "x"; then AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) fi have_asciidoc=no else AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_asciidoc" = yes; then # scrape the asciidoc version AC_MSG_CHECKING([the asciidoc version]) asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` AC_MSG_RESULT([$asciidoc_version]) AS_VERSION_COMPARE([$asciidoc_version], [$1], [if test "x$use_asciidoc" = xauto; then AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) have_asciidoc=no else AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) ]) # XORG_WITH_ASCIIDOC # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) # ------------------------------------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # Minimum version for optional DOT checking: 1.18.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-doxygen option, it allows maximum flexibilty in making decisions # as whether or not to use the doxygen package. When DEFAULT is not specified, # --with-doxygen assumes 'auto'. # # Interface to module: # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation # DOXYGEN: returns the path of the doxygen program found # returns the path set by the user in the environment # --with-doxygen: 'yes' user instructs the module to use doxygen # 'no' user instructs the module not to use doxygen # # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) AC_ARG_VAR([DOT], [Path to the dot graphics utility]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(doxygen, AS_HELP_STRING([--with-doxygen], [Use doxygen to regenerate documentation (default: ]_defopt[)]), [use_doxygen=$withval], [use_doxygen=]_defopt) m4_undefine([_defopt]) if test "x$use_doxygen" = x"auto"; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) have_doxygen=no else have_doxygen=yes fi elif test "x$use_doxygen" = x"yes" ; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) fi have_doxygen=yes elif test "x$use_doxygen" = x"no" ; then if test "x$DOXYGEN" != "x"; then AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) fi have_doxygen=no else AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_doxygen" = yes; then # scrape the doxygen version AC_MSG_CHECKING([the doxygen version]) doxygen_version=`$DOXYGEN --version 2>/dev/null` AC_MSG_RESULT([$doxygen_version]) AS_VERSION_COMPARE([$doxygen_version], [$1], [if test "x$use_doxygen" = xauto; then AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) have_doxygen=no else AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) fi]) fi]) dnl Check for DOT if we have doxygen. The caller decides if it is mandatory dnl HAVE_DOT is a variable that can be used in your doxygen.in config file: dnl HAVE_DOT = @HAVE_DOT@ HAVE_DOT=no if test "x$have_doxygen" = "xyes"; then AC_PATH_PROG([DOT], [dot]) if test "x$DOT" != "x"; then HAVE_DOT=yes fi fi AC_SUBST([HAVE_DOT]) AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) ]) # XORG_WITH_DOXYGEN # XORG_WITH_GROFF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-groff option, it allows maximum flexibilty in making decisions # as whether or not to use the groff package. When DEFAULT is not specified, # --with-groff assumes 'auto'. # # Interface to module: # HAVE_GROFF: used in makefiles to conditionally generate documentation # HAVE_GROFF_MM: the memorandum macros (-mm) package # HAVE_GROFF_MS: the -ms macros package # GROFF: returns the path of the groff program found # returns the path set by the user in the environment # --with-groff: 'yes' user instructs the module to use groff # 'no' user instructs the module not to use groff # # Added in version 1.9.0: # HAVE_GROFF_HTML: groff has dependencies to output HTML format: # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. # psselect from the psutils package. # the ghostcript package. Refer to the grohtml man pages # # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. # # OS and distros often splits groff in a basic and full package, the former # having the groff program and the later having devices, fonts and macros # Checking for the groff executable is not enough. # # If macros are missing, we cannot assume that groff is useless, so we don't # unset HAVE_GROFF or GROFF env variables. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false. # AC_DEFUN([XORG_WITH_GROFF],[ AC_ARG_VAR([GROFF], [Path to groff command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(groff, AS_HELP_STRING([--with-groff], [Use groff to regenerate documentation (default: ]_defopt[)]), [use_groff=$withval], [use_groff=]_defopt) m4_undefine([_defopt]) if test "x$use_groff" = x"auto"; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_WARN([groff not found - documentation targets will be skipped]) have_groff=no else have_groff=yes fi elif test "x$use_groff" = x"yes" ; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) fi have_groff=yes elif test "x$use_groff" = x"no" ; then if test "x$GROFF" != "x"; then AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) fi have_groff=no else AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) fi # We have groff, test for the presence of the macro packages if test "x$have_groff" = x"yes"; then AC_MSG_CHECKING([for ${GROFF} -ms macros]) if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then groff_ms_works=yes else groff_ms_works=no fi AC_MSG_RESULT([$groff_ms_works]) AC_MSG_CHECKING([for ${GROFF} -mm macros]) if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then groff_mm_works=yes else groff_mm_works=no fi AC_MSG_RESULT([$groff_mm_works]) fi # We have groff, test for HTML dependencies, one command per package if test "x$have_groff" = x"yes"; then AC_PATH_PROGS(GS_PATH, [gs gswin32c]) AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) AC_PATH_PROG(PSSELECT_PATH, [psselect]) if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then have_groff_html=yes else have_groff_html=no AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) fi fi # Set Automake conditionals for Makefiles AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) ]) # XORG_WITH_GROFF # XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) # --------------------------------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # Minimum version for optional MIN-VERSION argument: 1.15.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-fop option, it allows maximum flexibilty in making decisions # as whether or not to use the fop package. When DEFAULT is not specified, # --with-fop assumes 'auto'. # # Interface to module: # HAVE_FOP: used in makefiles to conditionally generate documentation # FOP: returns the path of the fop program found # returns the path set by the user in the environment # --with-fop: 'yes' user instructs the module to use fop # 'no' user instructs the module not to use fop # # If the user sets the value of FOP, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_FOP],[ AC_ARG_VAR([FOP], [Path to fop command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(fop, AS_HELP_STRING([--with-fop], [Use fop to regenerate documentation (default: ]_defopt[)]), [use_fop=$withval], [use_fop=]_defopt) m4_undefine([_defopt]) if test "x$use_fop" = x"auto"; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_WARN([fop not found - documentation targets will be skipped]) have_fop=no else have_fop=yes fi elif test "x$use_fop" = x"yes" ; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) fi have_fop=yes elif test "x$use_fop" = x"no" ; then if test "x$FOP" != "x"; then AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) fi have_fop=no else AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) fi # Test for a minimum version of fop, if provided. m4_ifval([$1], [if test "$have_fop" = yes; then # scrape the fop version AC_MSG_CHECKING([for fop minimum version]) fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$fop_version]) AS_VERSION_COMPARE([$fop_version], [$1], [if test "x$use_fop" = xauto; then AC_MSG_WARN([fop version $fop_version found, but $1 needed]) have_fop=no else AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) ]) # XORG_WITH_FOP # XORG_WITH_M4([MIN-VERSION]) # --------------------------- # Minimum version: 1.19.0 # # This macro attempts to locate an m4 macro processor which supports # -I option and is only useful for modules relying on M4 in order to # expand macros in source code files. # # Interface to module: # M4: returns the path of the m4 program found # returns the path set by the user in the environment # AC_DEFUN([XORG_WITH_M4], [ AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], [AC_MSG_ERROR([could not find m4 that supports -I option])], [$PATH:/usr/gnu/bin])]) AC_SUBST([M4], [$ac_cv_path_M4]) ]) # XORG_WITH_M4 # XORG_WITH_PS2PDF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-ps2pdf option, it allows maximum flexibilty in making decisions # as whether or not to use the ps2pdf package. When DEFAULT is not specified, # --with-ps2pdf assumes 'auto'. # # Interface to module: # HAVE_PS2PDF: used in makefiles to conditionally generate documentation # PS2PDF: returns the path of the ps2pdf program found # returns the path set by the user in the environment # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf # 'no' user instructs the module not to use ps2pdf # # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PS2PDF],[ AC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(ps2pdf, AS_HELP_STRING([--with-ps2pdf], [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) m4_undefine([_defopt]) if test "x$use_ps2pdf" = x"auto"; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) have_ps2pdf=no else have_ps2pdf=yes fi elif test "x$use_ps2pdf" = x"yes" ; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) fi have_ps2pdf=yes elif test "x$use_ps2pdf" = x"no" ; then if test "x$PS2PDF" != "x"; then AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) fi have_ps2pdf=no else AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) ]) # XORG_WITH_PS2PDF # XORG_ENABLE_DOCS (enable_docs=yes) # ---------------- # Minimum version: 1.6.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a builder to skip all # documentation targets except traditional man pages. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DOCS: used in makefiles to conditionally generate documentation # --enable-docs: 'yes' user instructs the module to generate docs # 'no' user instructs the module not to generate docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DOCS],[ m4_define([docs_default], m4_default([$1], [yes])) AC_ARG_ENABLE(docs, AS_HELP_STRING([--enable-docs], [Enable building the documentation (default: ]docs_default[)]), [build_docs=$enableval], [build_docs=]docs_default) m4_undefine([docs_default]) AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) AC_MSG_CHECKING([whether to build documentation]) AC_MSG_RESULT([$build_docs]) ]) # XORG_ENABLE_DOCS # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all developer documentation. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs # --enable-devel-docs: 'yes' user instructs the module to generate developer docs # 'no' user instructs the module not to generate developer docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ m4_define([devel_default], m4_default([$1], [yes])) AC_ARG_ENABLE(devel-docs, AS_HELP_STRING([--enable-devel-docs], [Enable building the developer documentation (default: ]devel_default[)]), [build_devel_docs=$enableval], [build_devel_docs=]devel_default) m4_undefine([devel_default]) AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) AC_MSG_CHECKING([whether to build developer documentation]) AC_MSG_RESULT([$build_devel_docs]) ]) # XORG_ENABLE_DEVEL_DOCS # XORG_ENABLE_SPECS (enable_specs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all functional specification targets. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_SPECS: used in makefiles to conditionally generate specs # --enable-specs: 'yes' user instructs the module to generate specs # 'no' user instructs the module not to generate specs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_SPECS],[ m4_define([spec_default], m4_default([$1], [yes])) AC_ARG_ENABLE(specs, AS_HELP_STRING([--enable-specs], [Enable building the specs (default: ]spec_default[)]), [build_specs=$enableval], [build_specs=]spec_default) m4_undefine([spec_default]) AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) AC_MSG_CHECKING([whether to build functional specifications]) AC_MSG_RESULT([$build_specs]) ]) # XORG_ENABLE_SPECS # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) # ---------------------------------------------- # Minimum version: 1.13.0 # # This macro enables a builder to enable/disable unit testing # It makes no assumption about the test cases implementation # Test cases may or may not use Automake "Support for test suites" # They may or may not use the software utility library GLib # # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. # The variable enable_unit_tests is used by other macros in this file. # # Interface to module: # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests # enable_unit_tests: used in configure.ac for additional configuration # --enable-unit-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ AC_BEFORE([$0], [XORG_WITH_GLIB]) AC_BEFORE([$0], [XORG_LD_WRAP]) AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], [Enable building unit test cases (default: ]_defopt[)]), [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_unit_tests]) ]) # XORG_ENABLE_UNIT_TESTS # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) # ------------------------------------------------------ # Minimum version: 1.17.0 # # This macro enables a builder to enable/disable integration testing # It makes no assumption about the test cases' implementation # Test cases may or may not use Automake "Support for test suites" # # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support # usually requires less dependencies and may be built and run under less # stringent environments than integration tests. # # Interface to module: # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests # enable_integration_tests: used in configure.ac for additional configuration # --enable-integration-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], [Enable building integration test cases (default: ]_defopt[)]), [enable_integration_tests=$enableval], [enable_integration_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$enable_integration_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_integration_tests]) ]) # XORG_ENABLE_INTEGRATION_TESTS # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.13.0 # # GLib is a library which provides advanced data structures and functions. # This macro enables a module to test for the presence of Glib. # # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit # test support usually requires less dependencies and may be built and run under # less stringent environments than integration tests. # # Interface to module: # HAVE_GLIB: used in makefiles to conditionally build targets # with_glib: used in configure.ac to know if GLib has been found # --with-glib: 'yes' user instructs the module to use glib # 'no' user instructs the module not to use glib # AC_DEFUN([XORG_WITH_GLIB],[ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], [Use GLib library for unit testing (default: ]_defopt[)]), [with_glib=$withval], [with_glib=]_defopt) m4_undefine([_defopt]) have_glib=no # Do not probe GLib if user explicitly disabled unit testing if test "x$enable_unit_tests" != x"no"; then # Do not probe GLib if user explicitly disabled it if test "x$with_glib" != x"no"; then m4_ifval( [$1], [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] ) fi fi # Not having GLib when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Having unit testing disabled when GLib has been explicitly requested is an error if test "x$enable_unit_tests" = x"no"; then if test "x$with_glib" = x"yes"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Not having GLib when it has been explicitly requested is an error if test "x$with_glib" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) fi fi AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) ]) # XORG_WITH_GLIB # XORG_LD_WRAP([required|optional]) # --------------------------------- # Minimum version: 1.13.0 # # Check if linker supports -wrap, passed via compiler flags # # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Argument added in 1.16.0 - default is "required", to match existing behavior # of returning an error if enable_unit_tests is yes, and ld -wrap is not # available, an argument of "optional" allows use when some unit tests require # ld -wrap and others do not. # AC_DEFUN([XORG_LD_WRAP],[ XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], [AC_LANG_PROGRAM([#include <stdlib.h> void __wrap_exit(int status) { return; }], [exit(0);])]) # Not having ld wrap when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then if test "x$have_ld_wrap" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) fi fi AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) # ]) # XORG_LD_WRAP # XORG_CHECK_LINKER_FLAGS # ----------------------- # SYNOPSIS # # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) # # DESCRIPTION # # Check whether the given linker FLAGS work with the current language's # linker, or whether they give an error. # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # PROGRAM-SOURCE is the program source to link with, if needed # # NOTE: Based on AX_CHECK_COMPILER_FLAGS. # # LICENSE # # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> # Copyright (c) 2009 Matteo Frigo # # 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 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well.# AC_DEFUN([XORG_CHECK_LINKER_FLAGS], [AC_MSG_CHECKING([whether the linker accepts $1]) dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: AS_LITERAL_IF([$1], [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS])], [ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([AC_LANG_PROGRAM()], eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS]) eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) AC_MSG_RESULT($xorg_check_linker_flags) if test "x$xorg_check_linker_flags" = xyes; then m4_default([$2], :) else m4_default([$3], :) fi ]) # XORG_CHECK_LINKER_FLAGS # XORG_MEMORY_CHECK_FLAGS # ----------------------- # Minimum version: 1.16.0 # # This macro attempts to find appropriate memory checking functionality # for various platforms which unit testing code may use to catch various # forms of memory allocation and access errors in testing. # # Interface to module: # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging # Usually added to TESTS_ENVIRONMENT in Makefile.am # # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. # AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], [Environment variables to enable memory checking in tests]) # Check for different types of support on different platforms case $host_os in solaris*) AC_CHECK_LIB([umem], [umem_alloc], [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) ;; *-gnu*) # GNU libc - Value is used as a single byte bit pattern, # both directly and inverted, so should not be 0 or 255. malloc_debug_env='MALLOC_PERTURB_=15' ;; darwin*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' ;; *bsd*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1' ;; esac # User supplied flags override default flags if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" fi AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) ]) # XORG_WITH_LINT # XORG_CHECK_MALLOC_ZERO # ---------------------- # Minimum version: 1.0.0 # # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if # malloc(0) returns NULL. Packages should add one of these cflags to # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ AC_ARG_ENABLE(malloc0returnsnull, AS_HELP_STRING([--enable-malloc0returnsnull], [malloc(0) returns NULL (default: auto)]), [MALLOC_ZERO_RETURNS_NULL=$enableval], [MALLOC_ZERO_RETURNS_NULL=auto]) AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then AC_CACHE_VAL([xorg_cv_malloc0_returns_null], [AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include <stdlib.h> ],[ char *m0, *r0, *c0, *p; m0 = malloc(0); p = malloc(10); r0 = realloc(p,0); c0 = calloc(0,10); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); ])], [xorg_cv_malloc0_returns_null=yes], [xorg_cv_malloc0_returns_null=no])]) MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null fi AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" else MALLOC_ZERO_CFLAGS="" XMALLOC_ZERO_CFLAGS="" XTMALLOC_ZERO_CFLAGS="" fi AC_SUBST([MALLOC_ZERO_CFLAGS]) AC_SUBST([XMALLOC_ZERO_CFLAGS]) AC_SUBST([XTMALLOC_ZERO_CFLAGS]) ]) # XORG_CHECK_MALLOC_ZERO # XORG_WITH_LINT() # ---------------- # Minimum version: 1.1.0 # # This macro enables the use of a tool that flags some suspicious and # non-portable constructs (likely to be bugs) in C language source code. # It will attempt to locate the tool and use appropriate options. # There are various lint type tools on different platforms. # # Interface to module: # LINT: returns the path to the tool found on the platform # or the value set to LINT on the configure cmd line # also an Automake conditional # LINT_FLAGS: an Automake variable with appropriate flags # # --with-lint: 'yes' user instructs the module to use lint # 'no' user instructs the module not to use lint (default) # # If the user sets the value of LINT, AC_PATH_PROG skips testing the path. # If the user sets the value of LINT_FLAGS, they are used verbatim. # AC_DEFUN([XORG_WITH_LINT],[ AC_ARG_VAR([LINT], [Path to a lint-style command]) AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], [Use a lint-style source code checker (default: disabled)])], [use_lint=$withval], [use_lint=no]) # Obtain platform specific info like program name and options # The lint program on FreeBSD and NetBSD is different from the one on Solaris case $host_os in *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) lint_name=splint lint_options="-badflag" ;; *freebsd* | *netbsd*) lint_name=lint lint_options="-u -b" ;; *solaris*) lint_name=lint lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" ;; esac # Test for the presence of the program (either guessed by the code or spelled out by the user) if test "x$use_lint" = x"yes" ; then AC_PATH_PROG([LINT], [$lint_name]) if test "x$LINT" = "x"; then AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) fi elif test "x$use_lint" = x"no" ; then if test "x$LINT" != "x"; then AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) fi else AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) fi # User supplied flags override default flags if test "x$LINT_FLAGS" != "x"; then lint_options=$LINT_FLAGS fi AC_SUBST([LINT_FLAGS],[$lint_options]) AM_CONDITIONAL(LINT, [test "x$LINT" != x]) ]) # XORG_WITH_LINT # XORG_LINT_LIBRARY(LIBNAME) # -------------------------- # Minimum version: 1.1.0 # # Sets up flags for building lint libraries for checking programs that call # functions in the library. # # Interface to module: # LINTLIB - Automake variable with the name of lint library file to make # MAKE_LINT_LIB - Automake conditional # # --enable-lint-library: - 'yes' user instructs the module to created a lint library # - 'no' user instructs the module not to create a lint library (default) AC_DEFUN([XORG_LINT_LIBRARY],[ AC_REQUIRE([XORG_WITH_LINT]) AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], [Create lint library (default: disabled)])], [make_lint_lib=$enableval], [make_lint_lib=no]) if test "x$make_lint_lib" = x"yes" ; then LINTLIB=llib-l$1.ln if test "x$LINT" = "x"; then AC_MSG_ERROR([Cannot make lint library without --with-lint]) fi elif test "x$make_lint_lib" != x"no" ; then AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) fi AC_SUBST(LINTLIB) AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) ]) # XORG_LINT_LIBRARY # XORG_COMPILER_BRAND # ------------------- # Minimum version: 1.14.0 # # Checks for various brands of compilers and sets flags as appropriate: # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" # clang compiler - sets CLANGCC to "yes" # Intel compiler - sets INTELCC to "yes" # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" # AC_DEFUN([XORG_COMPILER_BRAND], [ AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) ], [C++], [ AC_REQUIRE([AC_PROG_CXX]) ] ) AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) ]) # XORG_COMPILER_BRAND # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...]) # --------------- # Minimum version: 1.16.0 # # Test if the compiler works when passed the given flag as a command line argument. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the # next flag in the list until there are no more options. # # Note that this does not guarantee that the compiler supports the flag as some # compilers will simply ignore arguments that they do not understand, but we do # attempt to weed out false positives by using -Werror=unknown-warning-option and # -Werror=unused-command-line-argument # AC_DEFUN([XORG_TESTSET_CFLAG], [ m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) AC_LANG_COMPILER_REQUIRE AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) define([PREFIX], [C]) define([CACHE_PREFIX], [cc]) define([COMPILER], [$CC]) ], [C++], [ define([PREFIX], [CXX]) define([CACHE_PREFIX], [cxx]) define([COMPILER], [$CXX]) ] ) [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi found="no" m4_foreach([flag], m4_cdr($@), [ if test $found = "no" ; then if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" fi PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) AC_CACHE_VAL($cacheid, [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], [eval $cacheid=yes], [eval $cacheid=no])]) PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" eval supported=\$$cacheid AC_MSG_RESULT([$supported]) if test "$supported" = "yes" ; then $1="$$1 ]flag[" found="yes" fi fi ]) ]) # XORG_TESTSET_CFLAG # XORG_COMPILER_FLAGS # --------------- # Minimum version: 1.16.0 # # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line # arguments supported by the selected compiler which do NOT alter the generated # code. These arguments will cause the compiler to print various warnings # during compilation AND turn a conservative set of warnings into errors. # # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in # future versions of util-macros as options are added to new compilers. # AC_DEFUN([XORG_COMPILER_FLAGS], [ AC_REQUIRE([XORG_COMPILER_BRAND]) AC_ARG_ENABLE(selective-werror, AS_HELP_STRING([--disable-selective-werror], [Turn off selective compiler errors. (default: enabled)]), [SELECTIVE_WERROR=$enableval], [SELECTIVE_WERROR=yes]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then [BASE_]PREFIX[FLAGS]="-v" else [BASE_]PREFIX[FLAGS]="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) AC_LANG_CASE( [C], [ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) ] ) # This chunk adds additional warnings that could catch undesired effects. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION else AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) fi AC_SUBST([BASE_]PREFIX[FLAGS]) ]) # XORG_COMPILER_FLAGS # XORG_CWARNFLAGS # --------------- # Minimum version: 1.2.0 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) # # Defines CWARNFLAGS to enable C compiler warnings. # # This function is deprecated because it defines -fno-strict-aliasing # which alters the code generated by the compiler. If -fno-strict-aliasing # is needed, then it should be added explicitly in the module when # it is updated to use BASE_CFLAGS. # AC_DEFUN([XORG_CWARNFLAGS], [ AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_REQUIRE([XORG_COMPILER_BRAND]) AC_LANG_CASE( [C], [ CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi AC_SUBST(CWARNFLAGS) ] ) ]) # XORG_CWARNFLAGS # XORG_STRICT_OPTION # ----------------------- # Minimum version: 1.3.0 # # Add configure option to enable strict compilation flags, such as treating # warnings as fatal errors. # If --enable-strict-compilation is passed to configure, adds strict flags to # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. # # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or # when strict compilation is unconditionally desired. AC_DEFUN([XORG_STRICT_OPTION], [ AC_REQUIRE([XORG_CWARNFLAGS]) AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_ARG_ENABLE(strict-compilation, AS_HELP_STRING([--enable-strict-compilation], [Enable all warnings from compiler and make them errors (default: disabled)]), [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) [STRICT_]PREFIX[FLAGS]="" XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) if test "x$STRICT_COMPILE" = "xyes"; then [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) fi AC_SUBST([STRICT_]PREFIX[FLAGS]) AC_SUBST([BASE_]PREFIX[FLAGS]) AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) ]) # XORG_STRICT_OPTION # XORG_DEFAULT_OPTIONS # -------------------- # Minimum version: 1.3.0 # # Defines default options for X.Org modules. # AC_DEFUN([XORG_DEFAULT_OPTIONS], [ AC_REQUIRE([AC_PROG_INSTALL]) XORG_COMPILER_FLAGS XORG_CWARNFLAGS XORG_STRICT_OPTION XORG_RELEASE_VERSION XORG_CHANGELOG XORG_INSTALL XORG_MANPAGE_SECTIONS m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) ]) # XORG_DEFAULT_OPTIONS # XORG_INSTALL() # ---------------- # Minimum version: 1.4.0 # # Defines the variable INSTALL_CMD as the command to copy # INSTALL from $prefix/share/util-macros. # AC_DEFUN([XORG_INSTALL], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" AC_SUBST([INSTALL_CMD]) ]) # XORG_INSTALL dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl # XORG_RELEASE_VERSION # -------------------- # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. AC_DEFUN([XORG_RELEASE_VERSION],[ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], [Major version of this package]) PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], [$PVM], [Minor version of this package]) PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], [$PVP], [Patch version of this package]) ]) # XORG_CHANGELOG() # ---------------- # Minimum version: 1.2.0 # # Defines the variable CHANGELOG_CMD as the command to generate # ChangeLog from git. # # AC_DEFUN([XORG_CHANGELOG], [ CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG dnl dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, dnl and/or sell copies of the Software, and to permit persons to whom the dnl Software is furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice (including the next dnl paragraph) shall be included in all copies or substantial portions of the dnl Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER dnl DEALINGS IN THE SOFTWARE. dnl # XTRANS_TCP_FLAGS() # ------------------ # Find needed libraries for TCP sockets, and check for IPv6 support AC_DEFUN([XTRANS_TCP_FLAGS],[ # SVR4 hides these in libraries other than libc AC_SEARCH_LIBS(socket, [socket]) AC_SEARCH_LIBS(gethostbyname, [nsl]) if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then AC_CHECK_LIB([ws2_32],[main]) fi # Needs to come after above checks for libsocket & libnsl for SVR4 systems AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), [IPV6CONN=$enableval], [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])]) AC_MSG_CHECKING([if IPv6 support should be built]) if test "$IPV6CONN" = "yes"; then AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections]) fi AC_MSG_RESULT($IPV6CONN) # 4.3BSD-Reno added a new member to struct sockaddr_in AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE([BSD44SOCKETS],1, [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> ]) # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc. AC_CHECK_TYPES([socklen_t], [], [], [ AC_INCLUDES_DEFAULT #include <sys/socket.h>]) # XPG4v2/UNIX95 added msg_control - check to see if we need to define # _XOPEN_SOURCE to get it (such as on Solaris) AC_CHECK_MEMBER([struct msghdr.msg_control], [], [], [ AC_INCLUDES_DEFAULT #include <sys/socket.h> ]) # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then unset ac_cv_member_struct_msghdr_msg_control AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600]) AC_CHECK_MEMBER([struct msghdr.msg_control], [AC_DEFINE([_XOPEN_SOURCE], [600], [Defined if needed to expose struct msghdr.msg_control]) ], [], [ #define _XOPEN_SOURCE 600 AC_INCLUDES_DEFAULT #include <sys/socket.h> ]) fi # If that didn't work, fall back to XPG5/UNIX98 with C89 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then unset ac_cv_member_struct_msghdr_msg_control AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500]) AC_CHECK_MEMBER([struct msghdr.msg_control], [AC_DEFINE([_XOPEN_SOURCE], [500], [Defined if needed to expose struct msghdr.msg_control]) ], [], [ #define _XOPEN_SOURCE 500 AC_INCLUDES_DEFAULT #include <sys/socket.h> ]) fi ]) # XTRANS_TCP_FLAGS # XTRANS_CONNECTION_FLAGS() # ------------------------- # Standard checks for which Xtrans transports to use by the Xorg packages # that use Xtrans functions AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) [case $host_os in mingw*) unixdef="no" ;; *) unixdef="yes" ;; esac] AC_ARG_ENABLE(unix-transport, AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), [UNIXCONN=$enableval], [UNIXCONN=$unixdef]) AC_MSG_CHECKING([if Xtrans should support UNIX socket connections]) if test "$UNIXCONN" = "yes"; then AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections]) fi AC_MSG_RESULT($UNIXCONN) AC_ARG_ENABLE(tcp-transport, AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), [TCPCONN=$enableval], [TCPCONN=yes]) AC_MSG_CHECKING([if Xtrans should support TCP socket connections]) AC_MSG_RESULT($TCPCONN) if test "$TCPCONN" = "yes"; then AC_DEFINE(TCPCONN,1,[Support TCP socket connections]) XTRANS_TCP_FLAGS fi [case $host_os in solaris*|sco*|sysv4*) localdef="yes" ;; *) localdef="no" ;; esac] AC_ARG_ENABLE(local-transport, AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), [LOCALCONN=$enableval], [LOCALCONN=$localdef]) AC_MSG_CHECKING([if Xtrans should support os-specific local connections]) AC_MSG_RESULT($LOCALCONN) if test "$LOCALCONN" = "yes"; then AC_DEFINE(LOCALCONN,1,[Support os-specific local connections]) fi ]) # XTRANS_CONNECTION_FLAGS # XTRANS_SECURE_RPC_FLAGS() # ------------------------- # Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS # so that any necessary networking libraries are already found AC_DEFUN([XTRANS_SECURE_RPC_FLAGS], [AC_REQUIRE([XTRANS_TCP_FLAGS]) AC_ARG_ENABLE(secure-rpc, AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), [SECURE_RPC=$enableval], [SECURE_RPC="try"]) if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then FOUND_SECURE_RPC="no" AC_CHECK_FUNCS([authdes_seccreate authdes_create], [FOUND_SECURE_RPC="yes"]) if test "x$FOUND_SECURE_RPC" = "xno" ; then if test "x$SECURE_RPC" = "xyes" ; then AC_MSG_ERROR([Secure RPC requested, but required functions not found]) fi SECURE_RPC="no" else dnl FreeBSD keeps getsecretkey in librpcsvc AC_SEARCH_LIBS(getsecretkey, [rpcsvc]) SECURE_RPC="yes" fi fi AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported]) if test "x$SECURE_RPC" = "xyes" ; then AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients]) fi AC_MSG_RESULT($SECURE_RPC) ]) # XTRANS_SECURE_RPC_FLAGS ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/doc/�����������������������������������������������������������������������������0000775�0001751�0001751�00000000000�12466505443�011647� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/doc/filter-xmlto.sh��������������������������������������������������������������0000775�0001751�0001751�00000001250�12456571574�014561� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # # Run the xmlto command, filtering its output to # reduce the amount of useless warnings in the build log. # # Exit with the status of the xmlto process, not the status of the # output filtering commands # # This is a bit twisty, but avoids any temp files by using pipes for # everything. It routes the command output through file # descriptor 4 while sending the (numeric) exit status through # standard output. # (((("$@" 2>&1; echo $? >&3) | grep -v overflows | grep -v 'Making' | grep -v 'hyphenation' | grep -v 'Font.*not found' | grep -v '/tmp/xml' | grep -v Rendered >&4) 3>&1) | (read status; exit $status)) 4>&1 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/doc/Makefile.am������������������������������������������������������������������0000664�0001751�0001751�00000000473�12456571574�013636� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBDIRS = dtrace if ENABLE_DEVEL_DOCS if HAVE_XMLTO # Main DocBook/XML files (DOCTYPE book) docbook = Xserver-spec.xml Xinput.xml # Generate DocBook/XML output formats with or without stylesheets include $(top_srcdir)/devbook.am endif HAVE_XMLTO endif ENABLE_DEVEL_DOCS EXTRA_DIST = smartsched filter-xmlto.sh �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/doc/smartsched�������������������������������������������������������������������0000664�0001751�0001751�00000016026�12160102336�013635� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Client Scheduling in X Keith Packard SuSE 10/28/99 History: Since the original X server was written at Digital in 1987, the OS and DIX layers shared responsibility for scheduling the order to service client requests. The original design was simplistic; under the maximum first make it work, then make it work well, this was a good idea. Now that we have a bit more experience with X applications, it's time to rethink the design. The basic dispatch loop in DIX looks like: for (;;) { nready = WaitForSomething (...); while (nready--) { isItTimeToYield = FALSE; while (!isItTimeToYield) { if (!ReadRequestFromClient (...)) break; (execute request); } } } WaitForSomething looks like: for (;;) if (ANYSET (ClientsWithInput)) return popcount (ClientsWithInput); select (...) compute clientsReadable from select result; return popcount (clientsReadable) } ReadRequestFromClient looks like: if (!fullRequestQueued) { read (); if (!fullRequestQueued) { remove from ClientsWithInput; timesThisConnection = 0; return 0; } } if (twoFullRequestsQueued) add to ClientsWithInput; if (++timesThisConnection >= 10) { isItTimeToYield = TRUE; timesThisConnection = 0; } return 1; Here's what happens in this code: With a single client executing a stream of requests: A client sends a packet of requests to the server. WaitForSomething wakes up from select and returns that client to Dispatch Dispatch calls ReadRequestFromClient which reads a buffer (4K) full of requests from the client The server executes requests from this buffer until it emptys, in two stages -- 10 requests at a time are executed in the inner Dispatch loop, a buffer full of requests are executed because WaitForSomething immediately returns if any clients have complete requests pending in their input queues. When the buffer finally emptys, the next call to ReadRequest FromClient will return zero and Dispatch will go back to WaitForSomething; now that the client has no requests pending, WaitForSomething will block in select again. If the client is active, this select will immediately return that client as ready to read. With multiple clients sending streams of requests, the sequence of operations is similar, except that ReadRequestFromClient will set isItTimeToYield after each 10 requests executed causing the server to round-robin among the clients with available requests. It's important to realize here that any complete requests which have been read from clients will be executed before the server will use select again to discover input from other clients. A single busy client can easily monopolize the X server. So, the X server doesn't share well with clients which are more interactive in nature. The X server executes at most a buffer full of requests before again heading into select; ReadRequestFromClient causes the server to yield when the client request buffer doesn't contain a complete request. When that buffer is executed quickly, the server spends a lot of time in select discovering that the same client again has input ready. Thus the server also runs busy clients less efficiently than is would be possible. What to do. There are several things evident from the above discussion: 1 The server has a poor metric for deciding how much work it should do at one time on behalf of a particular client. 2 The server doesn't call select often enough to detect less aggressive clients in the face of busy clients, especially when those clients are executing slow requests. 3 The server calls select too often when executing fast requests. 4 Some priority scheme is needed to keep interactive clients responding to the user. And, there are some assumptions about how X applications work: 1 Each X request is executed relatively quickly; a request-granularity is good enough for interactive response almost all of the time. 2 X applications receiving mouse/keyboard events are likely to warrant additional attention from the X server. Instead of a request-count metric for work, a time-based metric should be used. The server should select a reasonable time slice for each client and execute requests for the entire timeslice before yielding to another client. Instead of returning immediately from WaitForSomething if clients have complete requests queued, the server should go through select each time and gather as many ready clients as possible. This involves polling instead of blocking and adding the ClientsWithInput to clientsReadable after the select returns. Instead of yielding when the request buffer is empty for a particular client, leave the yielding to the upper level scheduling and allow the server to try and read again from the socket. If the client is busy, another buffer full of requests will already be waiting to be delivered thus avoiding the call through select and the additional overhead in WaitForSomething. Finally, the dispatch loop should not simply execute requests from the first available client, instead each client should be prioritized with busy clients penalized and clients receiving user events praised. How it's done: Polling the current time of day from the OS is too expensive to be done at each request boundary, so instead an interval timer is set allowing the server to track time changes by counting invocations of the related signal handler. Instead of using the wall time for this purpose, the process CPU time is used instead. This serves two purposes -- first, it allows the server to consume no CPU cycles when idle, second it avoids conflicts with SIGALRM usage in other parts of the server code. It's not without problems though; other CPU intensive processes on the same machine can reduce interactive response time within the X server. The dispatch loop can now calculate an approximate time value using the number of signals received. The granularity of the timer sets the scheduling jitter, at 20ms it's only occasionally noticeable. The changes to WaitForSomething and ReadRequestFromClient are straightforward, adjusting when select is called and avoiding setting isItTimeToYield too often. The dispatch loop changes are more extensive, now instead of executing requests from all available clients, a single client is chosen after each call to WaitForSomething, requests are executed for that client and WaitForSomething is called again. Each client is assigned a priority, the dispatch loop chooses the client with the highest priority to execute. Priorities are updated in three ways: 1. Clients which consume their entire slice are penalized by having their priority reduced by one until they reach some minimum value. 2. Clients which have executed no requests for some time are praised by having their priority raised until they return to normal priority. 3. Clients which receive user input are praised by having their priority rased until they reach some maximal value, above normal priority. The effect of these changes is to both improve interactive application response and benchmark numbers at the same time. $XFree86: $ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xorg-server-1.17.1/doc/Xinput.xml�������������������������������������������������������������������0000664�0001751�0001751�00000135017�12160102336�013570� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"[ <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs; ]> <!-- lifted from troff+ms+XMan by doclifter --> <book id="porting"> <bookinfo> <title>X11 Input Extension Porting Document GeorgeSachs Hewlett-Packard X Server Version &xserver.version; 198919901991 Hewlett-Packard Company Permission to use, copy, modify, and distribute this documentation for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Hewlett-Packard makes no representations about the suitability for any purpose of the information in this document. It is provided "as is" without express or implied warranty. This document is only a draft stan- dard of the X Consortium and is therefore subject to change. Copyright © 1989, 1990, 1991 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. X Window System is a trademark of The Open Group. X11 Input Extension Porting Document This document is intended to aid the process of integrating the X11 Input Extension into an X server. Most of the functionality provided by the input extension is device- and implementation-independent, and should require no changes. The functionality is implemented by routines that typically reside in the server source tree directory extensions/server/xinput. This extension includes functions to enable and disable input extension devices, select input, grab and focus those device, query and change key and button mappings, and others. The only input extension requirements for the device-dependent part of X are that the input devices be correctly initialized and input events from those devices be correctly generated. Device-dependent X is responsible for reading input data from the input device hardware and if necessary, reformatting it into X events. The process of initializing input extension devices is similar to that used for the core devices, and is described in the following sections. When multiple input devices are attached to X server, the choice of which devices to initially use as the core X pointer and keyboard is left implementation-dependent. It is also up to each implementation to decide whether all input devices will be opened by the server during its initialization and kept open for the life of the server. The alternative is to open only the X keyboard and X pointer during server initialization, and open other input devices only when requested by a client to do so. Either type of implementation is supported by the input extension. Input extension events generated by the X server use the same 32-byte xEvent wire event as do core input events. However, additional information must be sent for input extension devices, requiring that multiple xEvents be generated each time data is received from an input extension device. These xEvents are combined into a single client XEvent by the input extension library. A later section of this document describes the format and generation of input extension events. Initializing Extension Devices Extension input devices are initialized in the same manner as the core X input devices. Device-Independent X provides functions that can be called from DDX to initialize these devices. Which functions are called and when will vary by implementation, and will depend on whether the implementation opens all the input devices available to X when X is initialized, or waits until a client requests that a device be opened. In the simplest case, DDX will open all input devices as part of its initialization, when the InitInput routine is called. Summary of Calling Sequence Device-Independent X | Device-Dependent X -------------------- | ------------------- | InitInput --------------> | - do device-specific initialization | | - call AddInputDevice (deviceProc,AutoStart) AddInputDevice | - creates DeviceIntRec | - records deviceProc | - adds new device to | list of off_devices. | sets dev->startup=AutoStart| | - call one of: | - RegisterPointerDevice (X pointer) | - processInputProc = ProcessPointerEvents | - RegisterKeyboardDevice (X keyboard) | - processInputProc = ProcessKeyboardEvents | - RegisterOtherDevice (extension device) | - processInputProc = ProcessOtherEvents | | InitAndStartDevices -----> | - calls deviceProc with parameters | (DEVICE_INIT, AutoStart) sets dev->inited = return | value from deviceProc | | | - in deviceProc, do one of: | - call InitPointerDeviceStruct (X pointer) | - call InitKeyboardDeviceStruct (X keybd) | - init extension device by calling some of: | - InitKeyClassDeviceStruct | - InitButtonClassDeviceStruct | - InitValuatorClassDeviceStruct | - InitValuatorAxisStruct | - InitFocusClassDeviceStruct | - InitProximityClassDeviceStruct | - InitKbdFeedbackClassDeviceStruct | - InitPtrFeedbackClassDeviceStruct | - InitLedFeedbackClassDeviceStruct | - InitStringFeedbackClassDeviceStruct | - InitIntegerFeedbackClassDeviceStruct | - InitBellFeedbackClassDeviceStruct | - init device name and type by: | - calling MakeAtom with one of the | predefined names | - calling AssignTypeAndName | | for each device added | by AddInputDevice, | InitAndStartDevices | calls EnableDevice if | - EnableDevice calls deviceProc with dev->startup & | (DEVICE_ON, AutoStart) dev->inited | | If deviceProc returns | - core devices are now enabled, extension Success, EnableDevice | devices are now available to be accessed move the device from | through the input extension protocol inputInfo.off_devices | requests. to inputInfo.devices | Initialization Called From InitInput InitInput is the first DDX input entry point called during X server startup. This routine is responsible for device- and implementation- specific initialization, and for calling AddInputDevice to create and initialize the DeviceIntRec structure for each input device. AddInputDevice is passed the address of a procedure to be called by the DIX routine InitAndStartDevices when input devices are enabled. This procedure is expected to perform X initialization for the input device. If the device is to be used as the X pointer, DDX should then call RegisterPointerDevice, passing the DeviceIntRec pointer, to initialize the device as the X pointer. If the device is to be used as the X keyboard, DDX should instead call RegisterKeyboardDevice to initialize the device as the X keyboard. If the device is to be used as an extension device, DDX should instead call RegisterOtherDevice, passing the DeviceIntPtr returned by AddInputDevice. A sample InitInput implementation is shown below. InitInput(argc,argv) { int i, numdevs, ReadInput(); DeviceIntPtr dev; LocalDevice localdevs[LOCAL_MAX_DEVS]; DeviceProc kbdproc, ptrproc, extproc; /************************************************************** * Open the appropriate input devices, determine which are * available, and choose an X pointer and X keyboard device * in some implementation-dependent manner. ***************************************************************/ open_input_devices (&numdevs, localdevs); /************************************************************** * Register a WakeupHandler to handle input when it is generated. ***************************************************************/ RegisterBlockAndWakeupHandlers (NoopDDA, ReadInput, NULL); /************************************************************** * Register the input devices with DIX. ***************************************************************/ for (i=0; i<numdevs; i++) { if (localdevs[i].use == IsXKeyboard) { dev = AddInputDevice (kbdproc, TRUE); RegisterKeyboardDevice (dev); } else if (localdevs[i].use == IsXPointer) { dev = AddInputDevice (ptrproc, TRUE); RegisterPointerDevice (dev); } else { dev = AddInputDevice (extproc, FALSE); RegisterOtherDevice (dev); } if (dev == NULL) FatalError ("Too many input devices."); dev->devicePrivate = (pointer) &localdevs[i]; } Initialization Called From InitAndStartDevices After InitInput has returned, InitAndStartDevices is the DIX routine that is called to enable input devices. It calls the device control routine that was passed to AddInputDevice, with a mode value of DEVICE_INIT. The action taken by the device control routine depends on how the device is to be used. If the device is to be the X pointer, the device control routine should call InitPointerDeviceStruct to initialize it. If the device is to be the X keyboard, the device control routine should call InitKeyboardDeviceStruct. Since input extension devices may support various combinations of keys, buttons, valuators, and feedbacks, each class of input that it supports must be initialized. Entry points are defined by DIX to initialize each of the supported classes of input, and are described in the following sections. A sample device control routine called from InitAndStartDevices is shown below. Bool extproc (dev, mode) DeviceIntPtr dev; int mode; { LocalDevice *localdev = (LocalDevice *) dev->devicePrivate; switch (mode) { case DEVICE_INIT: if (strcmp(localdev->name, XI_TABLET) == 0) { /**************************************************** * This device reports proximity, has buttons, * reports two axes of motion, and can be focused. * It also supports the same feedbacks as the X pointer * (acceleration and threshold can be set). ****************************************************/ InitButtonClassDeviceStruct (dev, button_count, button_map); InitValuatorClassDeviceStruct (dev, localdev->n_axes,); motionproc, MOTION_BUF_SIZE, Absolute); for (i=0; i<localdev->n_axes; i++) InitValuatorAxisStruct (dev, i, min_val, max_val, resolution); InitFocusClassDeviceStruct (dev); InitProximityClassDeviceStruct (dev); InitPtrFeedbackClassDeviceStruct (dev, p_controlproc); } else if (strcmp(localdev->name, XI_BUTTONBOX) == 0) { /**************************************************** * This device has keys and LEDs, and can be focused. ****************************************************/ InitKeyClassDeviceStruct (dev, syms, modmap); InitFocusClassDeviceStruct (dev); InitLedFeedbackClassDeviceStruct (dev, ledcontrol); } else if (strcmp(localdev->name, XI_KNOBBOX) == 0) { /**************************************************** * This device reports motion. * It can be focused. ****************************************************/ InitValuatorClassDeviceStruct (dev, localdev->n_axes,); motionproc, MOTION_BUF_SIZE, Absolute); for (i=0; i<localdev->n_axes; i++) InitValuatorAxisStruct (dev, i, min_val, max_val, resolution); InitFocusClassDeviceStruct (dev); } localdev->atom = MakeAtom(localdev->name, strlen(localdev->name), FALSE); AssignTypeAndName (dev, localdev->atom, localdev->name); break; case DEVICE_ON: AddEnabledDevice (localdev->file_ds); dev->on = TRUE; break; case DEVICE_OFF: dev->on = FALSE; RemoveEnabledDevice (localdev->file_ds); break; case DEVICE_CLOSE: break; } } The device control routine is called with a mode value of DEVICE_ON by the DIX routine EnableDevice, which is called from InitAndStartDevices. When called with this mode, it should call AddEnabledDevice to cause the server to begin checking for available input from this device. >From InitAndStartDevices, EnableDevice is called for all devices that have the "inited" and "startup" fields in the DeviceIntRec set to TRUE. The "inited" field is set by InitAndStartDevices to the value returned by the deviceproc when called with a mode value of DEVICE_INIT. The "startup" field is set by AddInputDevice to value of the second parameter (autoStart). When the server is first initialized, it should only be checking for input from the core X keyboard and pointer. One way to accomplish this is to call AddInputDevice for the core X keyboard and pointer with an autoStart value equal to TRUE, while calling AddInputDevice for input extension devices with an autoStart value equal to FALSE. If this is done, EnableDevice will skip all input extension devices during server initialization. In this case, the OpenInputDevice routine should set the "startup" field to TRUE when called for input extension devices. This will cause ProcXOpenInputDevice to call EnableDevice for those devices when a client first does an XOpenDevice request. DIX Input Class Initialization Routines DIX routines are defined to initialize each of the defined input classes. The defined classes are: KeyClass - the device has keys. ButtonClass - the device has buttons. ValuatorClass - the device reports motion data or positional data. Proximitylass - the device reports proximity information. FocusClass - the device can be focused. FeedbackClass - the device supports some kind of feedback DIX routines are provided to initialize the X pointer and keyboard, as in previous releases of X. During X initialization, InitPointerDeviceStruct is called to initialize the X pointer, and InitKeyboardDeviceStruct is called to initialize the X keyboard. There is no corresponding routine for extension input devices, since they do not all support the same classes of input. Instead, DDX is responsible for the initialization of the input classes supported by extension devices. A description of the routines provided by DIX to perform that initialization follows. InitKeyClassDeviceStruct This function is provided to allocate and initialize a KeyClassRec, and should be called for extension devices that have keys. It is passed a pointer to the device, and pointers to arrays of keysyms and modifiers reported by the device. It returns FALSE if the KeyClassRec could not be allocated, or if the maps for the keysyms and and modifiers could not be allocated. Its parameters are: Bool InitKeyClassDeviceStruct(dev, pKeySyms, pModifiers) DeviceIntPtr dev; KeySymsPtr pKeySyms; CARD8 pModifiers[]; The DIX entry point InitKeyboardDeviceStruct calls this routine for the core X keyboard. It must be called explicitly for extension devices that have keys. InitButtonClassDeviceStruct This function is provided to allocate and initialize a ButtonClassRec, and should be called for extension devices that have buttons. It is passed a pointer to the device, the number of buttons supported, and a map of the reported button codes. It returns FALSE if the ButtonClassRec could not be allocated. Its parameters are: Bool InitButtonClassDeviceStruct(dev, numButtons, map) register DeviceIntPtr dev; int numButtons; CARD8 *map; The DIX entry point InitPointerDeviceStruct calls this routine for the core X pointer. It must be called explicitly for extension devices that have buttons. InitValuatorClassDeviceStruct This function is provided to allocate and initialize a ValuatorClassRec, and should be called for extension devices that have valuators. It is passed the number of axes of motion reported by the device, the address of the motion history procedure for the device, the size of the motion history buffer, and the mode (Absolute or Relative) of the device. It returns FALSE if the ValuatorClassRec could not be allocated. Its parameters are: Bool InitValuatorClassDeviceStruct(dev, numAxes, motionProc, numMotionEvents, mode) DeviceIntPtr dev; int (*motionProc)(); int numAxes; int numMotionEvents; int mode; The DIX entry point InitPointerDeviceStruct calls this routine for the core X pointer. It must be called explicitly for extension devices that report motion. InitValuatorAxisStruct This function is provided to initialize an XAxisInfoRec, and should be called for core and extension devices that have valuators. The space for the XAxisInfoRec is allocated by the InitValuatorClassDeviceStruct function, but is not initialized. InitValuatorAxisStruct should be called once for each axis of motion reported by the device. Each invocation should be passed the axis number (starting with 0), the minimum value for that axis, the maximum value for that axis, and the resolution of the device in counts per meter. If the device reports relative motion, 0 should be reported as the minimum and maximum values. InitValuatorAxisStruct has the following parameters: InitValuatorAxisStruct(dev, axnum, minval, maxval, resolution) DeviceIntPtr dev; int axnum; int minval; int maxval; int resolution; This routine is not called by InitPointerDeviceStruct for the core X pointer. It must be called explicitly for core and extension devices that report motion. InitFocusClassDeviceStruct This function is provided to allocate and initialize a FocusClassRec, and should be called for extension devices that can be focused. It is passed a pointer to the device, and returns FALSE if the allocation fails. It has the following parameter: Bool InitFocusClassDeviceStruct(dev) DeviceIntPtr dev; The DIX entry point InitKeyboardDeviceStruct calls this routine for the core X keyboard. It must be called explicitly for extension devices that can be focused. Whether or not a particular device can be focused is left implementation-dependent. InitProximityClassDeviceStruct This function is provided to allocate and initialize a ProximityClassRec, and should be called for extension absolute pointing devices that report proximity. It is passed a pointer to the device, and returns FALSE if the allocation fails. It has the following parameter: Bool InitProximityClassDeviceStruct(dev) DeviceIntPtr dev; Initializing Feedbacks InitKbdFeedbackClassDeviceStruct This function is provided to allocate and initialize a KbdFeedbackClassRec, and may be called for extension devices that support some or all of the feedbacks that the core keyboard supports. It is passed a pointer to the device, a pointer to the procedure that sounds the bell, and a pointer to the device control procedure. It returns FALSE if the allocation fails, and has the following parameters: Bool InitKbdFeedbackClassDeviceStruct(dev, bellProc, controlProc) DeviceIntPtr dev; void (*bellProc)(); void (*controlProc)(); The DIX entry point InitKeyboardDeviceStruct calls this routine for the core X keyboard. It must be called explicitly for extension devices that have the same feedbacks as a keyboard. Some feedbacks, such as LEDs and bell, can be supported either with a KbdFeedbackClass or with BellFeedbackClass and LedFeedbackClass feedbacks. InitPtrFeedbackClassDeviceStruct This function is provided to allocate and initialize a PtrFeedbackClassRec, and should be called for extension devices that allow the setting of acceleration and threshold. It is passed a pointer to the device, and a pointer to the device control procedure. It returns FALSE if the allocation fails, and has the following parameters: Bool InitPtrFeedbackClassDeviceStruct(dev, controlProc) DeviceIntPtr dev; void (*controlProc)(); The DIX entry point InitPointerDeviceStruct calls this routine for the core X pointer. It must be called explicitly for extension devices that support the setting of acceleration and threshold. InitLedFeedbackClassDeviceStruct This function is provided to allocate and initialize a LedFeedbackClassRec, and should be called for extension devices that have LEDs. It is passed a pointer to the device, and a pointer to the device control procedure. It returns FALSE if the allocation fails, and has the following parameters: Bool InitLedFeedbackClassDeviceStruct(dev, controlProc) DeviceIntPtr dev; void (*controlProc)(); Up to 32 LEDs per feedback can be supported, and a device may have multiple feedbacks of the same type. InitBellFeedbackClassDeviceStruct This function is provided to allocate and initialize a BellFeedbackClassRec, and should be called for extension devices that have a bell. It is passed a pointer to the device, and a pointer to the device control procedure. It returns FALSE if the allocation fails, and has the following parameters: Bool InitBellFeedbackClassDeviceStruct(dev, bellProc, controlProc) DeviceIntPtr dev; void (*bellProc)(); void (*controlProc)(); InitStringFeedbackClassDeviceStruct This function is provided to allocate and initialize a StringFeedbackClassRec, and should be called for extension devices that have a display upon which a string can be displayed. It is passed a pointer to the device, and a pointer to the device control procedure. It returns FALSE if the allocation fails, and has the following parameters: Bool InitStringFeedbackClassDeviceStruct(dev, controlProc, max_symbols, num_symbols_supported, symbols) DeviceIntPtr dev; void (*controlProc)(); int max_symbols: int num_symbols_supported; KeySym *symbols; InitIntegerFeedbackClassDeviceStruct This function is provided to allocate and initialize an IntegerFeedbackClassRec, and should be called for extension devices that have a display upon which an integer can be displayed. It is passed a pointer to the device, and a pointer to the device control procedure. It returns FALSE if the allocation fails, and has the following parameters: Bool InitIntegerFeedbackClassDeviceStruct(dev, controlProc) DeviceIntPtr dev; void (*controlProc)(); Initializing The Device Name And Type The device name and type can be initialized by calling AssignTypeAndName with the following parameters: void AssignTypeAndName(dev, type, name) DeviceIntPtr dev; Atom type; char *name; This will allocate space for the device name and copy the name that was passed. The device type can be obtained by calling MakeAtom with one of the names defined for input devices. MakeAtom has the following parameters: Atom MakeAtom(name, len, makeit) char *name; int len; Bool makeit; Since the atom was already made when the input extension was initialized, the value of makeit should be FALSE; Closing Extension Devices The DisableDevice entry point is provided by DIX to disable input devices. It calls the device control routine for the specified device with a mode value of DEVICE_OFF. The device control routine should call RemoveEnabledDevice to stop the server from checking for input from that device. DisableDevice is not called by any input extension routines. It can be called from the CloseInputDevice routine, which is called by ProcXCloseDevice when a client makes an XCloseDevice request. If DisableDevice is called, it should only be called when the last client using the extension device has terminated or called XCloseDevice. Implementation-Dependent Routines Several input extension protocol requests have implementation-dependent entry points. Default routines are defined for these entry points and contained in the source file extensions/server/xinput/xstubs.c. Some implementations may be able to use the default routines without change. The following sections describe each of these routines. AddOtherInputDevices AddOtherInputDevice is called from ProcXListInputDevices as a result of an XListInputDevices protocol request. It may be needed by implementations that do not open extension input devices until requested to do so by some client. These implementations may not initialize all devices when the X server starts up, because some of those devices may be in use. Since the XListInputDevices function only lists those devices that have been initialized, AddOtherInputDevices is called to give DDX a chance to initialize any previously unavailable input devices. A sample AddOtherInputDevices routine might look like the following: void AddOtherInputDevices () { DeviceIntPtr dev; int i; for (i=0; i<MAX_DEVICES; i++) { if (!local_dev[i].initialized && available(local_dev[i])) { dev = (DeviceIntPtr) AddInputDevice (local_dev[i].deviceProc, TRUE); dev->public.devicePrivate = local_dev[i]; RegisterOtherDevice (dev); dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); } } } The default AddOtherInputDevices routine in xstubs.c does nothing. If all input extension devices are initialized when the server starts up, it can be left as a null routine. OpenInputDevice Some X server implementations open all input devices when the server is initialized and never close them. Other implementations may open only the X pointer and keyboard devices during server initialization, and open other input devices only when some client makes an XOpenDevice request. This entry point is for the latter type of implementation. If the physical device is not already open, it can be done in this routine. In this case, the server must keep track of the fact that one or more clients have the device open, and physically close it when the last client that has it open makes an XCloseDevice request. The default implementation is to do nothing (assume all input devices are opened during X server initialization and kept open). CloseInputDevice Some implementations may close an input device when the last client using that device requests that it be closed, or terminates. CloseInputDevice is called from ProcXCloseDevice when a client makes an XCloseDevice protocol request. The default implementation is to do nothing (assume all input devices are opened during X server initialization and kept open). SetDeviceMode Some implementations support input devices that can report either absolute positional data or relative motion. The XSetDeviceMode protocol request is provided to allow DDX to change the current mode of such a device. The default implementation is to always return a BadMatch error. If the implementation does not support any input devices that are capable of reporting both relative motion and absolute position information, the default implementation may be left unchanged. SetDeviceValuators Some implementations support input devices that allow their valuators to be set to an initial value. The XSetDeviceValuators protocol request is provided to allow DDX to set the valuators of such a device. The default implementation is to always return a BadMatch error. If the implementation does not support any input devices that are allow their valuators to be set, the default implementation may be left unchanged. ChangePointerDevice The XChangePointerDevice protocol request is provided to change which device is used as the X pointer. Some implementations may maintain information specific to the X pointer in the private data structure pointed to by the DeviceIntRec. ChangePointerDevice is called to allow such implementations to move that information to the new pointer device. The current location of the X cursor is an example of the type of information that might be affected. The DeviceIntRec structure that describes the X pointer device does not contain a FocusRec. If the device that has been made into the new X pointer was previously a device that could be focused, ProcXChangePointerDevice will free the FocusRec associated with that device. If the server implementation desires to allow clients to focus the old pointer device (which is now accessible through the input extension), it should call InitFocusClassDeviceStruct for the old pointer device. The XChangePointerDevice protocol request also allows the client to choose which axes of the new pointer device are used to move the X cursor in the X- and Y- directions. If the axes are different than the default ones, the server implementation should record that fact. If the server implementation supports input devices with valuators that are not allowed to be used as the X pointer, they should be screened out by this routine and a BadDevice error returned. The default implementation is to do nothing. ChangeKeyboardDevice The XChangeKeyboardDevice protocol request is provided to change which device is used as the X keyboard. Some implementations may maintain information specific to the X keyboard in the private data structure pointed to by the DeviceIntRec. ChangeKeyboardDevice is called to allow such implementations to move that information to the new keyboard device. The X keyboard device can be focused, and the DeviceIntRec that describes that device has a FocusRec. If the device that has been made into the new X keyboard did not previously have a FocusRec, ProcXChangeKeyboardDevice will allocate one for it. If the implementation does not want clients to be able to focus the old X keyboard (which has now become available as an input extension device) it should call DeleteFocusClassDeviceStruct to free the FocusRec. If the implementation supports input devices with keys that are not allowed to be used as the X keyboard, they should be checked for here, and a BadDevice error returned. The default implementation is to do nothing. Input Extension Events Events accessed through the input extension are analogous to the core input events, but have different event types. They are of types DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, DeviceButtonRelease, DeviceDeviceMotionNotify, DeviceProximityIn, DeviceProximityOut, and DeviceValuator. These event types are not constants. Instead, they are external integers defined by the input extension. Their actual values will depend on which extensions are supported by a server, and the order in which they are initialized. The data structures that define these events are defined in the file extensions/include/XIproto.h. Other input extension constants needed by DDX are defined in the file extensions/include/XI.h. Some events defined by the input extension contain more information than can be contained in the 32-byte xEvent data structure. To send this information to clients, DDX must generate two or more 32-byte wire events. The following sections describe the contents of these events. Device Key Events DeviceKeyPresss events contain all the information that is contained in a core KeyPress event, and also the following additional information: deviceid - the identifier of the device that generated the event. device_state - the state of any modifiers on the device that generated the event num_valuators - the number of valuators reported in this event. first_valuator - the first valuator reported in this event. valuator0 through valuator5 - the values of the valuators. In order to pass this information to the input extension library, two 32-byte wire events must be generated by DDX. The first has an event type of DeviceKeyPress, and the second has an event type of \fPDeviceValuator\fP. The following code fragment shows how the two wire events could be initialized: extern int DeviceKeyPress; DeviceIntPtr dev; xEvent xE[2]; CARD8 id, num_valuators; INT16 x, y, pointerx, pointery; Time timestamp; deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE; deviceValuator *xv; xev->type = DeviceKeyPress; /* defined by input extension */ xev->detail = keycode; /* key pressed on this device */ xev->time = timestamp; /* same as for core events */ xev->rootX = pointerx; /* x location of core pointer */ xev->rootY = pointery; /* y location of core pointer */ /******************************************************************/ /* */ /* The following field does not exist for core input events. */ /* It contains the device id for the device that generated the */ /* event, and also indicates whether more than one 32-byte wire */ /* event is being sent. */ /* */ /******************************************************************/ xev->deviceid = dev->id | MORE_EVENTS; /* sending more than 1*/ /******************************************************************/ /* Fields in the second 32-byte wire event: */ /******************************************************************/ xv = (deviceValuator *) ++xev; xv->type = DeviceValuator; /* event type of second event */ xv->deviceid = dev->id; /* id of this device */ xv->num_valuators = 0; /* no valuators being sent */ xv->device_state = 0; /* will be filled in by DIX */ Device Button Events DeviceButton events contain all the information that is contained in a core button event, and also the same additional information that a DeviceKey event contains. Device Motion Events DeviceMotion events contain all the information that is contained in a core motion event, and also additional valuator information. At least two wire events are required to contain this information. The following code fragment shows how the two wire events could be initialized: extern int DeviceMotionNotify; DeviceIntPtr dev; xEvent xE[2]; CARD8 id, num_valuators; INT16 x, y, pointerx, pointery; Time timestamp; deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE; deviceValuator *xv; xev->type = DeviceMotionNotify; /* defined by input extension */ xev->detail = keycode; /* key pressed on this device */ xev->time = timestamp; /* same as for core events */ xev->rootX = pointerx; /* x location of core pointer */ xev->rootY = pointery; /* y location of core pointer */ /******************************************************************/ /* */ /* The following field does not exist for core input events. */ /* It contains the device id for the device that generated the */ /* event, and also indicates whether more than one 32-byte wire */ /* event is being sent. */ /* */ /******************************************************************/ xev->deviceid = dev->id | MORE_EVENTS; /* sending more than 1*/ /******************************************************************/ /* Fields in the second 32-byte wire event: */ /******************************************************************/ xv = (deviceValuator *) ++xev; xv->type = DeviceValuator; /* event type of second event */ xv->deviceid = dev->id; /* id of this device */ xv->num_valuators = 2; /* 2 valuators being sent */ xv->first_valuator = 0; /* first valuator being sent */ xv->device_state = 0; /* will be filled in by DIX */ xv->valuator0 = x; /* first axis of this device */ xv->valuator1 = y; /* second axis of this device */ Up to six axes can be reported in the deviceValuator event. If the device is reporting more than 6 axes, additional pairs of DeviceMotionNotify and DeviceValuator events should be sent, with the first_valuator field set correctly. Device Proximity Events Some input devices that report absolute positional information, such as graphics tablets and touchscreens, may report proximity events. ProximityIn events are generated when a pointing device like a stylus, or in the case of a touchscreen, the user's finger, comes into close proximity with the surface of the input device. ProximityOut events are generated when the stylus or finger leaves the proximity of the input devices surface. Proximity events contain almost the same information as button events. The event type is ProximityIn or ProximityOut, and there is no detail information. xorg-server-1.17.1/doc/Xserver-spec.xml0000664000175100017510000065500412441644010014674 00000000000000 %xorg-defs; %defs; ]>
Definition of the Porting Layer for the X v11 Sample Server X Porting Layer SusanAngebranndt Digital Equipment Corporation RaymondDrewry Digital Equipment Corporation PhilipKarlton Digital Equipment Corporation ToddNewman Digital Equipment Corporation BobScheifler Massachusetts Institute of Technology KeithPackard MIT X Consortium DavidP.Wiggins X Consortium JimGettys X.org Foundation and Hewlett Packard The X.Org Foundation X Version 11, Release &fullrelvers; X Server Version &xserver.version; 1994X Consortium, Inc. 2004X.org Foundation, 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. LK201 and DEC are trademarks of Digital Equipment Corporation. Macintosh and Apple are trademarks of Apple Computer, Inc. PostScript is a trademark of Adobe Systems, Inc. Ethernet is a trademark of Xerox Corporation. X Window System is a trademark of the X.org Foundation, Inc. Cray is a trademark of Cray Research, Inc. &xserver.reldate; 1.0 27 Oct 2004 sa Initial Version 1.1 27 Oct 2004 bs Minor Revisions 2.0 27 Oct 2004 kp Revised for Release 4 and 5 3.0 27 Oct 2004 dpw Revised for Release 6 3.1 27 Oct 2004 jg Revised for Release 6.8.2 3.2 17 Dec 2006 efw DocBook conversion 3.3 17 Feb 2008 aj Revised for backing store changes 3.4 31 Mar 2008 efw Revised for devPrivates changes 3.5 July 2010 ac 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: Read the first section of the "Strategies for Porting" document (Overview of Porting Process). Skim over this document (the Definition document). Skim over the remainder of the Strategies document. Start planning and working, referring to the Strategies and Definition documents. You may also want to look at the following documents: "The X Window System" for an overview of X. "Xlib - C Language X Interface" for a view of what the client programmer sees. "X Window System Protocol" for a terse description of the byte stream protocol between the client and server. To understand this document and the accompanying source code, you should know the C language. You should be familiar with 2D graphics and windowing concepts such as clipping, bitmaps, fonts, etc. You should have a general knowledge of the X Window System. To implement the server code on your hardware, you need to know a lot about your hardware, its graphic display device(s), and (possibly) its networking and multitasking facilities. This document depends a lot on the source code, so you should have a listing of the code handy. Some source in the distribution is directly compilable on your machine. Some of it will require modification. Other parts may have to be completely written from scratch. The distribution also includes source for a sample implementation of a display server which runs on a very wide variety of color and monochrome displays on Linux and *BSD which you will find useful for implementing any type of X server. Note to the 2008 edition: at this time this document must be considered incomplete, though improved over the 2004 edition. In particular, the new Render extension is still lacking good documentation, and has become vital to high performance X implementations. Modern applications and desktop environments are now much more sensitive to good implementation of the Render extension than in most operations of the old X graphics model. The shadow frame buffer implementation is also very useful in many circumstances, and also needs documentation. We hope to rectify these shortcomings in our documentation in the future. Help would be greatly appreciated.
The X Window System The X Window System, or simply "X," is a windowing system that provides high-performance, high-level, device-independent graphics. X is a windowing system designed for bitmapped graphic displays. The display can have a simple, monochrome display or it can have a color display with up to 32 bits per pixel with a special graphics processor doing the work. (In this document, monochrome means a black and white display with one bit per pixel. Even though the usual meaning of monochrome is more general, this special case is so common that we decided to reserve the word for this purpose.) In practice, monochrome displays are now almost unheard of, with 4 bit gray scale displays being the low end. X is designed for a networking environment where users can run applications on machines other than their own workstations. Sometimes, the connection is over an Ethernet network with a protocol such as TCP/IP; but, any "reliable" byte stream is allowable. A high-bandwidth byte stream is preferable; RS-232 at 9600 baud would be slow without compression techniques. X by itself allows great freedom of design. For instance, it does not include any user interface standard. Its intent is to "provide mechanism, not policy." By making it general, it can be the foundation for a wide variety of interactive software. For a more detailed overview, see the document "The X Window System." For details on the byte stream protocol, see "X Window System protocol."
Overview of the Server The display server manages windows and simple graphics requests for the user on behalf of different client applications. The client applications can be running on any machine on the network. The server mainly does three things: Responds to protocol requests from existing clients (mostly graphic and text drawing commands) Sends device input (keystrokes and mouse actions) and other events to existing clients Maintains client connections The server code is organized into four major pieces: Device Independent (DIX) layer - code shared among all implementations Operating System (OS) layer - code that is different for each operating system but is shared among all graphic devices for this operating system Device Dependent (DDX) layer - code that is (potentially) different for each combination of operating system and graphic device Extension Interface - a standard way to add features to the X server The "porting layer" consists of the OS and DDX layers; these are actually parallel and neither one is on top of the other. The DIX layer is intended to be portable without change to target systems and is not detailed here, although several routines in DIX that are called by DDX are documented. Extensions incorporate new functionality into the server; and require additional functionality over a simple DDX. The following sections outline the functions of the layers. Section 3 briefly tells what you need to know about the DIX layer. The OS layer is explained in Section 4. Section 5 gives the theory of operation and procedural interface for the DDX layer. Section 6 describes the functions which exist for the extension writer.
DIX Layer The DIX layer is the machine and device independent part of X. The source should be common to all operating systems and devices. The port process should not include changes to this part, therefore internal interfaces to DIX modules are not discussed, except for public interfaces to the DDX and the OS layers. The functions described in this section are available for extension writers to use. In the process of getting your server to work, if you think that DIX must be modified for purposes other than bug fixes, you may be doing something wrong. Keep looking for a more compatible solution. When the next release of the X server code is available, you should be able to just drop in the new DIX code and compile it. If you change DIX, you will have to remember what changes you made and will have to change the new sources before you can update to the new version. The heart of the DIX code is a loop called the dispatch loop. Each time the processor goes around the loop, it sends off accumulated input events from the input devices to the clients, and it processes requests from the clients. This loop is the most organized way for the server to process the asynchronous requests that it needs to process. Most of these operations are performed by OS and DDX routines that you must supply.
Server Resource System X resources are C structs inside the server. Client applications create and manipulate these objects according to the rules of the X byte stream protocol. Client applications refer to resources with resource IDs, which are 32-bit integers that are sent over the network. Within the server, of course, they are just C structs, and we refer to them by pointers.
Pre-Defined Resource Types The DDX layer has several kinds of resources: Window Pixmap Screen Device Colormap Font Cursor Graphics Contexts The type names of the more important server structs usually end in "Rec," such as "DeviceRec;" the pointer types usually end in "Ptr," such as "DevicePtr." The structs and important defined constants are declared in .h files that have names that suggest the name of the object. For instance, there are two .h files for windows, window.h and windowstr.h. window.h defines only what needs to be defined in order to use windows without peeking inside of them; windowstr.h defines the structs with all of their components in great detail for those who need it. Three kinds of fields are in these structs: Attribute fields - struct fields that contain values like normal structs Pointers to procedures, or structures of procedures, that operate on the object A single private field or a devPrivates list (see ) used by your DDX code to store private data. DIX calls through the struct's procedure pointers to do its tasks. These procedures are set either directly or indirectly by DDX procedures. Most of the procedures described in the remainder of this document are accessed through one of these structs. For example, the procedure to create a pixmap is attached to a ScreenRec and might be called by using the expression
(* pScreen->CreatePixmap)(pScreen, width, height, depth).
All procedure pointers must be set to some routine unless noted otherwise; a null pointer will have unfortunate consequences. Procedure routines will be indicated in the documentation by this convention:
void pScreen->MyScreenRoutine(arg, arg, ...)
as opposed to a free routine, not in a data structure:
void MyFreeRoutine(arg, arg, ...)
The attribute fields are mostly set by DIX; DDX should not modify them unless noted otherwise.
Creating Resources and Resource Types These functions should also be called from your extensionInitProc to allocate all of the various resource classes and types required for the extension. Each time the server resets, these types must be reallocated as the old allocations will have been discarded. Resource types are integer values starting at 1. Get a resource type by calling
RESTYPE CreateNewResourceType(deleteFunc, char *name)
deleteFunc will be called to destroy all resources with this type. name will be used to identify this type of resource to clients using the X-Resource extension, to security extensions such as SELinux, and to tracing frameworks such as DTrace. [The name argument was added in xorg-server 1.8.]
Resource classes are masks starting at 1 << 31 which can be or'ed with any resource type to provide attributes for the type. To allocate a new class bit, call
RESTYPE CreateNewResourceClass()
There are two ways of looking up resources, by type or by class. Classes are non-exclusive subsets of the space of all resources, so you can lookup the union of multiple classes. (RC_ANY is the union of all classes). Note that the appropriate class bits must be or'ed into the value returned by CreateNewResourceType when calling resource lookup functions. If you need to create a ``private'' resource ID for internal use, you can call FakeClientID.
XID FakeClientID(client) int client;
This allocates from ID space reserved for the server.
To associate a resource value with an ID, use AddResource.
Bool AddResource(id, type, value) XID id; RESTYPE type; pointer value;
The type should be the full type of the resource, including any class bits. If AddResource fails to allocate memory to store the resource, it will call the deleteFunc for the type, and then return False.
To free a resource, use one of the following.
void FreeResource(id, skipDeleteFuncType) XID id; RESTYPE skipDeleteFuncType; void FreeResourceByType(id, type, skipFree) XID id; RESTYPE type; Bool skipFree;
FreeResource frees all resources matching the given id, regardless of type; the type's deleteFunc will be called on each matching resource, except that skipDeleteFuncType can be set to a single type for which the deleteFunc should not be called (otherwise pass RT_NONE). FreeResourceByType frees a specific resource matching a given id and type; if skipFree is true, then the deleteFunc is not called.
Looking Up Resources To look up a resource, use one of the following.
int dixLookupResourceByType( pointer *result, XID id, RESTYPE rtype, ClientPtr client, Mask access_mode); int dixLookupResourceByClass( pointer *result, XID id, RESTYPE rclass, ClientPtr client, Mask access_mode);
dixLookupResourceByType finds a resource with the given id and exact type. dixLookupResourceByClass finds a resource with the given id whose type is included in any one of the specified classes. The client and access_mode must be provided to allow security extensions to check if the client has the right privileges for the requested access. The bitmask values defined in the dixaccess.h header are or'ed together to define the requested access_mode.
Callback Manager To satisfy a growing number of requests for the introduction of ad hoc notification style hooks in the server, a generic callback manager was introduced in R6. A callback list object can be introduced for each new hook that is desired, and other modules in the server can register interest in the new callback list. The following functions support these operations. Before getting bogged down in the interface details, an typical usage example should establish the framework. Let's look at the ClientStateCallback in dix/dispatch.c. The purpose of this particular callback is to notify interested parties when a client's state (initial, running, gone) changes. The callback is "created" in this case by simply declaring a variable:
CallbackListPtr ClientStateCallback;
Whenever the client's state changes, the following code appears, which notifies all interested parties of the change:
if (ClientStateCallback) CallCallbacks(&ClientStateCallback, (pointer)client);
Interested parties subscribe to the ClientStateCallback list by saying:
AddCallback(&ClientStateCallback, func, data);
When CallCallbacks is invoked on the list, func will be called thusly:
(*func)(&ClientStateCallback, data, client)
Now for the details.
Bool AddCallback(pcbl, callback, subscriber_data) CallbackListPtr *pcbl; CallbackProcPtr callback; pointer subscriber_data;
Adds the (callback, subscriber_data) pair to the given callback list. Creates the callback list if it doesn't exist. Returns TRUE if successful.
Bool DeleteCallback(pcbl, callback, subscriber_data) CallbackListPtr *pcbl; CallbackProcPtr callback; pointer subscriber_data;
Removes the (callback, data) pair to the given callback list if present. Returns TRUE if (callback, data) was found.
void CallCallbacks(pcbl, call_data) CallbackListPtr *pcbl; pointer call_data;
For each callback currently registered on the given callback list, call it as follows:
(*callback)(pcbl, subscriber_data, call_data);
void DeleteCallbackList(pcbl) CallbackListPtr *pcbl;
Destroys the given callback list.
Extension Interfaces This function should be called from your extensionInitProc which should be called by InitExtensions.
ExtensionEntry *AddExtension(name, NumEvents,NumErrors, MainProc, SwappedMainProc, CloseDownProc, MinorOpcodeProc) const char *name; /*Null terminate string; case matters*/ int NumEvents; int NumErrors; int (* MainProc)(ClientPtr);/*Called if client matches server order*/ int (* SwappedMainProc)(ClientPtr);/*Called if client differs from server*/ void (* CloseDownProc)(ExtensionEntry *); unsigned short (*MinorOpcodeProc)(ClientPtr);
name is the name used by clients to refer to the extension. NumEvents is the number of event types used by the extension, NumErrors is the number of error codes needed by the extension. MainProc is called whenever a client accesses the major opcode assigned to the extension. SwappedMainProc is identical, except the client using the extension has reversed byte-sex. CloseDownProc is called at server reset time to deallocate any private storage used by the extension. MinorOpcodeProc is used by DIX to place the appropriate value into errors. The DIX routine StandardMinorOpcode can be used here which takes the minor opcode from the normal place in the request (i.e. just after the major opcode).
Macros and Other Helpers There are a number of macros in Xserver/include/dix.h which are useful to the extension writer. Ones of particular interest are: REQUEST, REQUEST_SIZE_MATCH, REQUEST_AT_LEAST_SIZE, REQUEST_FIXED_SIZE, LEGAL_NEW_RESOURCE, and VALIDATE_DRAWABLE_AND_GC. Useful byte swapping macros can be found in Xserver/include/dix.h: WriteReplyToClient and WriteSwappedDataToClient; and in Xserver/include/misc.h: lswapl, lswaps, LengthRestB, LengthRestS, LengthRestL, SwapRestS, SwapRestL, swapl, swaps, cpswapl, and cpswaps.
OS Layer This part of the source consists of a few routines that you have to rewrite for each operating system. These OS functions maintain the client connections and schedule work to be done for clients. They also provide an interface to font files, font name to file name translation, and low level memory management.
void OsInit()
OsInit initializes your OS code, performing whatever tasks need to be done. Frequently there is not much to be done. The sample server implementation is in Xserver/os/osinit.c.
Scheduling and Request Delivery The main dispatch loop in DIX creates the illusion of multitasking between different windows, while the server is itself but a single process. The dispatch loop breaks up the work for each client into small digestible parts. Some parts are requests from a client, such as individual graphic commands. Some parts are events delivered to the client, such as keystrokes from the user. The processing of events and requests for different clients can be interleaved with one another so true multitasking is not needed in the server. You must supply some of the pieces for proper scheduling between clients.
int WaitForSomething(pClientReady) int *pClientReady;
WaitForSomething is the scheduler procedure you must write that will suspend your server process until something needs to be done. This call should make the server suspend until one or more of the following occurs: There is an input event from the user or hardware (see SetInputCheck()) There are requests waiting from known clients, in which case you should return a count of clients stored in pClientReady A new client tries to connect, in which case you should create the client and then continue waiting Before WaitForSomething() computes the masks to pass to select, poll or similar operating system interface, it needs to see if there is anything to do on the work queue; if so, it must call a DIX routine called ProcessWorkQueue.
extern WorkQueuePtr workQueue; if (workQueue) ProcessWorkQueue ();
If WaitForSomething() decides it is about to do something that might block (in the sample server, before it calls select() or poll) it must call a DIX routine called BlockHandler().
void BlockHandler(pTimeout, pReadmask) pointer pTimeout; pointer pReadmask;
The types of the arguments are for agreement between the OS and DDX implementations, but the pTimeout is a pointer to the information determining how long the block is allowed to last, and the pReadmask is a pointer to the information describing the descriptors that will be waited on.
In the sample server, pTimeout is a pointer, and pReadmask is the address of the select() mask for reading. The DIX BlockHandler() iterates through the Screens, for each one calling its BlockHandler. A BlockHandler is declared thus:
void xxxBlockHandler(pScreen, pTimeout, pReadmask) ScreenPtr pScreen; pointer pTimeout; pointer pReadmask;
The arguments are a pointer to the Screen, and the arguments to the DIX BlockHandler().
Immediately after WaitForSomething returns from the block, even if it didn't actually block, it must call the DIX routine WakeupHandler().
void WakeupHandler(result, pReadmask) int result; pointer pReadmask;
Once again, the types are not specified by DIX. The result is the success indicator for the thing that (may have) blocked, and the pReadmask is a mask of the descriptors that came active. In the sample server, result is the result from select() (or equivalent operating system function), and pReadmask is the address of the select() mask for reading.
The DIX WakeupHandler() calls each Screen's WakeupHandler. A WakeupHandler is declared thus:
void xxxWakeupHandler(pScreen, result, pReadmask) ScreenPtr pScreen; unsigned long result; pointer pReadmask;
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 block and wakeup handlers (only together) using:
Bool RegisterBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) BlockHandlerProcPtr blockHandler; WakeupHandlerProcPtr wakeupHandler; pointer blockData;
A FALSE return code indicates that the registration failed for lack of memory. To remove a registered Block handler at other than server reset time (when they are all removed automatically), use:
RemoveBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) BlockHandlerProcPtr blockHandler; WakeupHandlerProcPtr wakeupHandler; pointer blockData;
All three arguments must match the values passed to RegisterBlockAndWakeupHandlers.
These registered block handlers are called after the per-screen handlers:
void (*BlockHandler) (blockData, pptv, pReadmask) pointer blockData; OsTimerPtr pptv; pointer pReadmask;
Sometimes block handlers need to adjust the time in a OSTimePtr structure, which on UNIX family systems is generally represented by a struct timeval consisting of seconds and microseconds in 32 bit values. As a convenience to reduce error prone struct timeval computations which require modulus arithmetic and correct overflow behavior in the face of millisecond wrapping through 32 bits,
void AdjustWaitForDelay(pointer /*waitTime*, unsigned long /* newdelay */)
has been provided.
Any wakeup handlers registered with RegisterBlockAndWakeupHandlers will be called before the Screen handlers:
void (*WakeupHandler) (blockData, err, pReadmask) pointer blockData; int err; pointer pReadmask;
The WaitForSomething on the sample server also has a built in screen saver that darkens the screen if no input happens for a period of time. The sample server implementation is in Xserver/os/WaitFor.c. Note that WaitForSomething() may be called when you already have several outstanding things (events, requests, or new clients) queued up. For instance, your server may have just done a large graphics request, and it may have been a long time since WaitForSomething() was last called. If many clients have lots of requests queued up, DIX will only service some of them for a given client before going on to the next client (see isItTimeToYield, below). Therefore, WaitForSomething() will have to report that these same clients still have requests queued up the next time around. An implementation should return information on as many outstanding things as it can. For instance, if your implementation always checks for client data first and does not report any input events until there is no client data left, your mouse and keyboard might get locked out by an application that constantly barrages the server with graphics drawing requests. Therefore, as a general rule, input devices should always have priority over graphics devices. A list of indexes (client->index) for clients with data ready to be read or processed should be returned in pClientReady, and the count of indexes returned as the result value of the call. These are not clients that have full requests ready, but any clients who have any data ready to be read or processed. The DIX dispatcher will process requests from each client in turn by calling ReadRequestFromClient(), below. WaitForSomething() must create new clients as they are requested (by whatever mechanism at the transport level). A new client is created by calling the DIX routine:
ClientPtr NextAvailableClient(ospriv) pointer ospriv;
This routine returns NULL if a new client cannot be allocated (e.g. maximum number of clients reached). The ospriv argument will be stored into the OS private field (pClient->osPrivate), to store OS private information about the client. In the sample server, the osPrivate field contains the number of the socket for this client. See also "New Client Connections." NextAvailableClient() will call InsertFakeRequest(), so you must be prepared for this.
If there are outstanding input events, you should make sure that the two SetInputCheck() locations are unequal. The DIX dispatcher will call your implementation of ProcessInputEvents() until the SetInputCheck() locations are equal. The sample server contains an implementation of WaitForSomething(). The following two routines indicate to WaitForSomething() what devices should be waited for. fd is an OS dependent type; in the sample server it is an open file descriptor.
int AddEnabledDevice(fd) int fd; int RemoveEnabledDevice(fd) int fd;
These two routines are usually called by DDX from the initialize cases of the Input Procedures that are stored in the DeviceRec (the routine passed to AddInputDevice()). The sample server implementation of AddEnabledDevice and RemoveEnabledDevice are in Xserver/os/connection.c.
Timer Facilities Similarly, the X server or an extension may need to wait for some timeout. Early X releases implemented this functionality using block and wakeup handlers, but this has been rewritten to use a general timer facilty, and the internal screen saver facilities reimplemented to use Timers. These functions are TimerInit, TimerForce, TimerSet, TimerCheck, TimerCancel, and TimerFree, as defined in Xserver/include/os.h. A callback function will be called when the timer fires, along with the current time, and a user provided argument.
typedef struct _OsTimerRec *OsTimerPtr; typedef CARD32 (*OsTimerCallback)( OsTimerPtr /* timer */, CARD32 /* time */, pointer /* arg */); OsTimerPtr TimerSet( OsTimerPtr /* timer */, int /* flags */, CARD32 /* millis */, OsTimerCallback /* func */, pointer /* arg */);
TimerSet returns a pointer to a timer structure and sets a timer to the specified time with the specified argument. The flags can be TimerAbsolute and TimerForceOld. The TimerSetOld flag controls whether if the timer is reset and the timer is pending, the whether the callback function will get called. The TimerAbsolute flag sets the callback time to an absolute time in the future rather than a time relative to when TimerSet is called. TimerFree should be called to free the memory allocated for the timer entry.
void TimerInit(void) Bool TimerForce(OsTimerPtr /* pTimer */) void TimerCheck(void); void TimerCancel(OsTimerPtr /* pTimer */) void TimerFree(OsTimerPtr /* pTimer */)
TimerInit frees any existing timer entries. TimerForce forces a call to the timer's callback function and returns true if the timer entry existed, else it returns false and does not call the callback function. TimerCancel will cancel the specified timer. TimerFree calls TimerCancel and frees the specified timer. Calling TimerCheck will force the server to see if any timer callbacks should be called.
New Client Connections The process whereby a new client-server connection starts up is very dependent upon what your byte stream mechanism. This section describes byte stream initiation using examples from the TCP/IP implementation on the sample server. The first thing that happens is a client initiates a connection with the server. How a client knows to do this depends upon your network facilities and the Xlib implementation. In a typical scenario, a user named Fred on his X workstation is logged onto a Cray supercomputer running a command shell in an X window. Fred can type shell commands and have the Cray respond as though the X server were a dumb terminal. Fred types in a command to run an X client application that was linked with Xlib. Xlib looks at the shell environment variable DISPLAY, which has the value "fredsbittube:0.0." The host name of Fred's workstation is "fredsbittube," and the 0s are for multiple screens and multiple X server processes. (Precisely what happens on your system depends upon how X and Xlib are implemented.) The client application calls a TCP routine on the Cray to open a TCP connection for X to communicate with the network node "fredsbittube." The TCP software on the Cray does this by looking up the TCP address of "fredsbittube" and sending an open request to TCP port 6000 on fredsbittube. All X servers on TCP listen for new clients on port 6000 by default; this is known as a "well-known port" in IP terminology. The server receives this request from its port 6000 and checks where it came from to see if it is on the server's list of "trustworthy" hosts to talk to. Then, it opens another port for communications with the client. This is the byte stream that all X communications will go over. Actually, it is a bit more complicated than that. Each X server process running on the host machine is called a "display." Each display can have more than one screen that it manages. "corporatehydra:3.2" represents screen 2 on display 3 on the multi-screened network node corporatehydra. The open request would be sent on well-known port number 6003. Once the byte stream is set up, what goes on does not depend very much upon whether or not it is TCP. The client sends an xConnClientPrefix struct (see Xproto.h) that has the version numbers for the version of Xlib it is running, some byte-ordering information, and two character strings used for authorization. If the server does not like the authorization strings or the version numbers do not match within the rules, or if anything else is wrong, it sends a failure response with a reason string. If the information never comes, or comes much too slowly, the connection should be broken off. You must implement the connection timeout. The sample server implements this by keeping a timestamp for each still-connecting client and, each time just before it attempts to accept new connections, it closes any connection that are too old. The connection timeout can be set from the command line. You must implement whatever authorization schemes you want to support. The sample server on the distribution tape supports a simple authorization scheme. The only interface seen by DIX is:
char * ClientAuthorized(client, proto_n, auth_proto, string_n, auth_string) ClientPtr client; unsigned int proto_n; char *auth_proto; unsigned int string_n; char *auth_string;
DIX will only call this once per client, once it has read the full initial connection data from the client. If the connection should be accepted ClientAuthorized() should return NULL, and otherwise should return an error message string.
Accepting new connections happens internally to WaitForSomething(). WaitForSomething() must call the DIX routine NextAvailableClient() to create a client object. Processing of the initial connection data will be handled by DIX. Your OS layer must be able to map from a client to whatever information your OS code needs to communicate on the given byte stream to the client. DIX uses this ClientPtr to refer to the client from now on. The sample server uses the osPrivate field in the ClientPtr to store the file descriptor for the socket, the input and output buffers, and authorization information. To initialize the methods you choose to allow clients to connect to your server, main() calls the routine
void CreateWellKnownSockets()
This routine is called only once, and not called when the server is reset. To recreate any sockets during server resets, the following routine is called from the main loop:
void ResetWellKnownSockets()
Sample implementations of both of these routines are found in Xserver/os/connection.c.
For more details, see the section called "Connection Setup" in the X protocol specification.
Reading Data from Clients Requests from the client are read in as a byte stream by the OS layer. They may be in the form of several blocks of bytes delivered in sequence; requests may be broken up over block boundaries or there may be many requests per block. Each request carries with it length information. It is the responsibility of the following routine to break it up into request blocks.
int ReadRequestFromClient(who) ClientPtr who;
You must write the routine ReadRequestFromClient() to get one request from the byte stream belonging to client "who." You must swap the third and fourth bytes (the second 16-bit word) according to the byte-swap rules of the protocol to determine the length of the request. This length is measured in 32-bit words, not in bytes. Therefore, the theoretical maximum request is 256K. (However, the maximum length allowed is dependent upon the server's input buffer. This size is sent to the client upon connection. The maximum size is the constant MAX_REQUEST_SIZE in Xserver/include/os.h) The rest of the request you return is assumed NOT to be correctly swapped for internal use, because that is the responsibility of DIX. The 'who' argument is the ClientPtr returned from WaitForSomething. The return value indicating status should be set to the (positive) byte count if the read is successful, 0 if the read was blocked, or a negative error code if an error happened. You must then store a pointer to the bytes of the request in the client request buffer field; who->requestBuffer. This can simply be a pointer into your buffer; DIX may modify it in place but will not otherwise cause damage. Of course, the request must be contiguous; you must shuffle it around in your buffers if not. The sample server implementation is in Xserver/os/io.c.
Inserting Data for Clients DIX can insert data into the client stream, and can cause a "replay" of the current request.
Bool InsertFakeRequest(client, data, count) ClientPtr client; char *data; int count; int ResetCurrentRequest(client) ClientPtr client;
InsertFakeRequest() must insert the specified number of bytes of data into the head of the input buffer for the client. This may be a complete request, or it might be a partial request. For example, NextAvailableCient() will insert a partial request in order to read the initial connection data sent by the client. The routine returns FALSE if memory could not be allocated. ResetCurrentRequest() should "back up" the input buffer so that the currently executing request will be reexecuted. DIX may have altered some values (e.g. the overall request length), so you must recheck to see if you still have a complete request. ResetCurrentRequest() should always cause a yield (isItTimeToYield).
Sending Events, Errors And Replies To Clients
int WriteToClient(who, n, buf) ClientPtr who; int n; char *buf;
WriteToClient should write n bytes starting at buf to the ClientPtr "who". It returns the number of bytes written, but for simplicity, the number returned must be either the same value as the number requested, or -1, signaling an error. The sample server implementation is in Xserver/os/io.c.
void SendErrorToClient(client, majorCode, minorCode, resId, errorCode) ClientPtr client; unsigned int majorCode; unsigned int minorCode; XID resId; int errorCode;
SendErrorToClient can be used to send errors back to clients, although in most cases your request function should simply return the error code, having set client->errorValue to the appropriate error value to return to the client, and DIX will call this function with the correct opcodes for you.
void FlushAllOutput() void FlushIfCriticalOutputPending() void SetCriticalOutputPending()
These three routines may be implemented to support buffered or delayed writes to clients, but at the very least, the stubs must exist. FlushAllOutput() unconditionally flushes all output to clients; FlushIfCriticalOutputPending() flushes output only if SetCriticalOutputPending() has be called since the last time output was flushed. The sample server implementation is in Xserver/os/io.c and actually ignores requests to flush output on a per-client basis if it knows that there are requests in that client's input queue.
Font Support In the sample server, fonts are encoded in disk files or fetched from the font server. The two fonts required by the server, fixed and cursor are commonly compiled into the font library. For disk fonts, there is one file per font, with a file name like "fixed.pcf". Font server fonts are read over the network using the X Font Server Protocol. The disk directories containing disk fonts and the names of the font servers are listed together in the current "font path." In principle, you can put all your fonts in ROM or in RAM in your server. You can put them all in one library file on disk. You could generate them on the fly from stroke descriptions. By placing the appropriate code in the Font Library, you will automatically export fonts in that format both through the X server and the Font server. The code for processing fonts in different formats, as well as handling the metadata files for them on disk (such as fonts.dir) is located in the libXfont library, which is provided as a separately compiled module. These routines are shared between the X server and the Font server, so instead of this document specifying what you must implement, simply refer to the font library interface specification for the details. All of the interface code to the Font library is contained in dix/dixfonts.c
Memory Management Memory management is based on functions in the C runtime library, malloc(), realloc(), and free(), and you should simply call the C library functions directly. Consult a C runtime library reference manual for more details. Treat memory allocation carefully in your implementation. Memory leaks can be very hard to find and are frustrating to a user. An X server could be running for days or weeks without being reset, just like a regular terminal. If you leak a few dozen k per day, that will add up and will cause problems for users that leave their workstations on.
Client Scheduling The X server has the ability to schedule clients much like an operating system would, suspending and restarting them without regard for the state of their input buffers. This functionality allows the X server to suspend one client and continue processing requests from other clients while waiting for a long-term network activity (like loading a font) before continuing with the first client.
Bool isItTimeToYield;
isItTimeToYield is a global variable you can set if you want to tell DIX to end the client's "time slice" and start paying attention to the next client. After the current request is finished, DIX will move to the next client.
In the sample server, ReadRequestFromClient() sets isItTimeToYield after 10 requests packets in a row are read from the same client. This scheduling algorithm can have a serious effect upon performance when two clients are drawing into their windows simultaneously. If it allows one client to run until its request queue is empty by ignoring isItTimeToYield, the client's queue may in fact never empty and other clients will be blocked out. On the other hand, if it switchs between different clients too quickly, performance may suffer due to too much switching between contexts. For example, if a graphics processor needs to be set up with drawing modes before drawing, and two different clients are drawing with different modes into two different windows, you may switch your graphics processor modes so often that performance is impacted. See the Strategies document for heuristics on setting isItTimeToYield. The following functions provide the ability to suspend request processing on a particular client, resuming it at some later time:
int IgnoreClient (who) ClientPtr who; int AttendClient (who) ClientPtr who;
Ignore client is responsible for pretending that the given client doesn't exist. WaitForSomething should not return this client as ready for reading and should not return if only this client is ready. AttendClient undoes whatever IgnoreClient did, setting it up for input again.
Three functions support "process control" for X clients:
Bool ClientSleep (client, function, closure) ClientPtr client; Bool (*function)(); pointer closure;
This suspends the current client (the calling routine is responsible for making its way back to Dispatch()). No more X requests will be processed for this client until ClientWakeup is called.
Bool ClientSignal (client) ClientPtr client;
This function causes a call to the (*function) parameter passed to ClientSleep to be queued on the work queue. This does not automatically "wakeup" the client, but the function called is free to do so by calling:
ClientWakeup (client) ClientPtr client;
This re-enables X request processing for the specified client.
Other OS Functions
void ErrorF(char *f, ...) void FatalError(char *f, ...)
You should write these three routines to provide for diagnostic output from the dix and ddx layers, although implementing them to produce no output will not affect the correctness of your server. ErrorF() and FatalError() take a printf() type of format specification in the first argument and an implementation-dependent number of arguments following that. Normally, the formats passed to ErrorF() and FatalError() should be terminated with a newline.
After printing the message arguments, FatalError() must be implemented such that the server will call AbortDDX() to give the ddx layer a chance to reset the hardware, and then terminate the server; it must not return. The sample server implementation for these routines is in Xserver/os/log.c along with other routines for logging messages.
DDX Layer This section describes the interface between DIX and DDX. While there may be an OS-dependent driver interface between DDX and the physical device, that interface is left to the DDX implementor and is not specified here. The DDX layer does most of its work through procedures that are pointed to by different structs. As previously described, the behavior of these resources is largely determined by these procedure pointers. Most of these routines are for graphic display on the screen or support functions thereof. The rest are for user input from input devices.
Input In this document "input" refers to input from the user, such as mouse, keyboard, and bar code readers. X input devices are of several types: keyboard, pointing device, and many others. The core server has support for extension devices as described by the X Input Extension document; the interfaces used by that extension are described elsewhere. The core devices are actually implemented as two collections of devices, the mouse is a ButtonDevice, a ValuatorDevice and a PtrFeedbackDevice while the keyboard is a KeyDevice, a FocusDevice and a KbdFeedbackDevice. Each part implements a portion of the functionality of the device. This abstraction is hidden from view for core devices by DIX. You, the DDX programmer, are responsible for some of the routines in this section. Others are DIX routines that you should call to do the things you need to do in these DDX routines. Pay attention to which is which.
Input Device Data Structures DIX keeps a global directory of devices in a central data structure called InputInfo. For each device there is a device structure called a DeviceRec. DIX can locate any DeviceRec through InputInfo. In addition, it has a special pointer to identify the main pointing device and a special pointer to identify the main keyboard. The DeviceRec (Xserver/include/input.h) is a device-independent structure that contains the state of an input device. A DevicePtr is simply a pointer to a DeviceRec. An xEvent describes an event the server reports to a client. Defined in Xproto.h, it is a huge struct of union of structs that have fields for all kinds of events. All of the variants overlap, so that the struct is actually very small in memory.
Processing Events The main DDX input interface is the following routine:
void ProcessInputEvents()
You must write this routine to deliver input events from the user. DIX calls it when input is pending (see next section), and possibly even when it is not. You should write it to get events from each device and deliver the events to DIX. To deliver the events to DIX, DDX should call the following routine:
void DevicePtr->processInputProc(pEvent, device, count) xEventPtr events; DeviceIntPtr device; int count;
This is the "input proc" for the device, a DIX procedure. DIX will fill in this procedure pointer to one of its own routines by the time ProcessInputEvents() is called the first time. Call this input proc routine as many times as needed to deliver as many events as should be delivered. DIX will buffer them up and send them out as needed. Count is set to the number of event records which make up one atomic device event and is always 1 for the core devices (see the X Input Extension for descriptions of devices which may use count > 1).
For example, your ProcessInputEvents() routine might check the mouse and the keyboard. If the keyboard had several keystrokes queued up, it could just call the keyboard's processInputProc as many times as needed to flush its internal queue. event is an xEvent struct you pass to the input proc. When the input proc returns, it is finished with the event rec, and you can fill in new values and call the input proc again with it. You should deliver the events in the same order that they were generated. For keyboard and pointing devices the xEvent variant should be keyButtonPointer. Fill in the following fields in the xEvent record: type - is one of the following: KeyPress, KeyRelease, ButtonPress, ButtonRelease, or MotionNotify detail - for KeyPress or KeyRelease fields, this should be the key number (not the ASCII code); otherwise unused time - is the time that the event happened (32-bits, in milliseconds, arbitrary origin) rootX - is the x coordinate of cursor rootY - is the y coordinate of cursor The rest of the fields are filled in by DIX. The time stamp is maintained by your code in the DDX layer, and it is your responsibility to stamp all events correctly. The x and y coordinates of the pointing device and the time must be filled in for all event types including keyboard events. The pointing device must report all button press and release events. In addition, it should report a MotionNotify event every time it gets called if the pointing device has moved since the last notify. Intermediate pointing device moves are stored in a special GetMotionEvents buffer, because most client programs are not interested in them. There are quite a collection of sample implementations of this routine, one for each supported device.
Telling DIX When Input is Pending In the server's dispatch loop, DIX checks to see if there is any device input pending whenever WaitForSomething() returns. If the check says that input is pending, DIX calls the DDX routine ProcessInputEvents(). This check for pending input must be very quick; a procedure call is too slow. The code that does the check is a hardwired IF statement in DIX code that simply compares the values pointed to by two pointers. If the values are different, then it assumes that input is pending and ProcessInputEvents() is called by DIX. You must pass pointers to DIX to tell it what values to compare. The following procedure is used to set these pointers:
void SetInputCheck(p1, p2) long *p1, *p2;
You should call it sometime during initialization to indicate to DIX the correct locations to check. You should pay special attention to the size of what they actually point to, because the locations are assumed to be longs.
These two pointers are initialized by DIX to point to arbitrary values that are different. In other words, if you forget to call this routine during initialization, the worst thing that will happen is that ProcessInputEvents will be called when there are no events to process. p1 and p2 might point at the head and tail of some shared memory queue. Another use would be to have one point at a constant 0, with the other pointing at some mask containing 1s for each input device that has something pending. The DDX layer of the sample server calls SetInputCheck() once when the server's private internal queue is initialized. It passes pointers to the queue's head and tail. See Xserver/mi/mieq.c.
int TimeSinceLastInputEvent()
DDX must time stamp all hardware input events. But DIX sometimes needs to know the time and the OS layer needs to know the time since the last hardware input event in order for the screen saver to work. TimeSinceLastInputEvent() returns the this time in milliseconds.
Controlling Input Devices You must write four routines to do various device-specific things with the keyboard and pointing device. They can have any name you wish because you pass the procedure pointers to DIX routines.
int pInternalDevice->valuator->GetMotionProc(pdevice, coords, start, stop, pScreen) DeviceIntPtr pdevice; xTimecoord * coords; unsigned long start; unsigned long stop; ScreenPtr pScreen;
You write this DDX routine to fill in coords with all the motion events that have times (32-bit count of milliseconds) between time start and time stop. It should return the number of motion events returned. If there is no motion events support, this routine should do nothing and return zero. The maximum number of coords to return is set in InitPointerDeviceStruct(), below.
When the user drags the pointing device, the cursor position theoretically sweeps through an infinite number of points. Normally, a client that is concerned with points other than the starting and ending points will receive a pointer-move event only as often as the server generates them. (Move events do not queue up; each new one replaces the last in the queue.) A server, if desired, can implement a scheme to save these intermediate events in a motion buffer. A client application, like a paint program, may then request that these events be delivered to it through the GetMotionProc routine.
void pInternalDevice->bell->BellProc(percent, pDevice, ctrl, unknown) int percent; DeviceIntPtr pDevice; pointer ctrl; int class;
You need to write this routine to ring the bell on the keyboard. loud is a number from 0 to 100, with 100 being the loudest. Class is either BellFeedbackClass or KbdFeedbackClass (from XI.h).
void pInternalDevice->somedevice->CtrlProc(device, ctrl) DevicePtr device; SomethingCtrl *ctrl;
You write two versions of this procedure, one for the keyboard and one for the pointing device. DIX calls it to inform DDX when a client has requested changes in the current settings for the particular device. For a keyboard, this might be the repeat threshold and rate. For a pointing device, this might be a scaling factor (coarse or fine) for position reporting. See input.h for the ctrl structures.
Input Initialization Input initialization is a bit complicated. It all starts with InitInput(), a routine that you write to call AddInputDevice() twice (once for pointing device and once for keyboard.) When you Add the devices, a routine you supply for each device gets called to initialize them. Your individual initialize routines must call InitKeyboardDeviceStruct() or InitPointerDeviceStruct(), depending upon which it is. In other words, you indicate twice that the keyboard is the keyboard and the pointer is the pointer.
void InitInput(argc, argv) int argc; char **argv;
InitInput is a DDX routine you must write to initialize the input subsystem in DDX. It must call AddInputDevice() for each device that might generate events.
DevicePtr AddInputDevice(deviceProc, autoStart) DeviceProc deviceProc; Bool autoStart;
AddInputDevice is a DIX routine you call to create a device object. deviceProc is a DDX routine that is called by DIX to do various operations. AutoStart should be TRUE for devices that need to be turned on at initialization time with a special call, as opposed to waiting for some client application to turn them on. This routine returns NULL if sufficient memory cannot be allocated to install the device.
Note also that except for the main keyboard and pointing device, an extension is needed to provide for a client interface to a device. The following DIX procedures return the specified DevicePtr. They may or may not be useful to DDX implementors.
DevicePtr LookupKeyboardDevice()
LookupKeyboardDevice returns pointer for current main keyboard device.
DevicePtr LookupPointerDevice()
LookupPointerDevice returns pointer for current main pointing device.
A DeviceProc (the kind passed to AddInputDevice()) in the following form:
Bool pInternalDevice->DeviceProc(device, action); DeviceIntPtr device; int action;
You must write a DeviceProc for each device. device points to the device record. action tells what action to take; it will be one of these defined constants (defined in input.h): DEVICE_INIT - At DEVICE_INIT time, the device should initialize itself by calling InitPointerDeviceStruct(), InitKeyboardDeviceStruct(), or a similar routine (see below) and "opening" the device if necessary. If you return a non-zero (i.e., != Success) value from the DEVICE_INIT call, that device will be considered unavailable. If either the main keyboard or main pointing device cannot be initialized, the DIX code will refuse to continue booting up. DEVICE_ON - If the DeviceProc is called with DEVICE_ON, then it is allowed to start putting events into the client stream by calling through the ProcessInputProc in the device. DEVICE_OFF - If the DeviceProc is called with DEVICE_OFF, no further events from that device should be given to the DIX layer. The device will appear to be dead to the user. DEVICE_CLOSE - At DEVICE_CLOSE (terminate or reset) time, the device should be totally closed down.
void InitPointerDeviceStruct(device, map, mapLength, GetMotionEvents, ControlProc, numMotionEvents) DevicePtr device; CARD8 *map; int mapLength; ValuatorMotionProcPtr ControlProc; PtrCtrlProcPtr GetMotionEvents; int numMotionEvents;
InitPointerDeviceStruct is a DIX routine you call at DEVICE_INIT time to declare some operating routines and data structures for a pointing device. map and mapLength are as described in the X Window System protocol specification. ControlProc and GetMotionEvents are DDX routines, see above.
numMotionEvents is for the motion-buffer-size for the GetMotionEvents request. A typical length for a motion buffer would be 100 events. A server that does not implement this capability should set numMotionEvents to zero.
void InitKeyboardDeviceStruct(device, pKeySyms, pModifiers, Bell, ControlProc) DevicePtr device; KeySymsPtr pKeySyms; CARD8 *pModifiers; BellProcPtr Bell; KbdCtrlProcPtr ControlProc;
You call this DIX routine when a keyboard device is initialized and its device procedure is called with DEVICE_INIT. The formats of the keysyms and modifier maps are defined in Xserver/include/input.h. They describe the layout of keys on the keyboards, and the glyphs associated with them. ( See the next section for information on setting up the modifier map and the keysym map.) ControlProc and Bell are DDX routines, see above.
Keyboard Mapping and Keycodes When you send a keyboard event, you send a report that a given key has either been pressed or has been released. There must be a keycode for each key that identifies the key; the keycode-to-key mapping can be any mapping you desire, because you specify the mapping in a table you set up for DIX. However, you are restricted by the protocol specification to keycode values in the range 8 to 255 inclusive. The keycode mapping information that you set up consists of the following: A minimum and maximum keycode number An array of sets of keysyms for each key, that is of length maxkeycode - minkeycode + 1. Each element of this array is a list of codes for symbols that are on that key. There is no limit to the number of symbols that can be on a key. Once the map is set up, DIX keeps and maintains the client's changes to it. The X protocol defines standard names to indicate the symbol(s) printed on each keycap. (See X11/keysym.h) Legal modifier keys must generate both up and down transitions. When a client tries to change a modifier key (for instance, to make "A" the "Control" key), DIX calls the following routine, which should return TRUE if the key can be used as a modifier on the given device:
Bool LegalModifier(key, pDev) unsigned int key; DevicePtr pDev;
Screens Different computer graphics displays have different capabilities. Some are simple monochrome frame buffers that are just lying there in memory, waiting to be written into. Others are color displays with many bits per pixel using some color lookup table. Still others have high-speed graphic processors that prefer to do all of the work themselves, including maintaining their own high-level, graphic data structures.
Screen Hardware Requirements The only requirement on screens is that you be able to both read and write locations in the frame buffer. All screens must have a depth of 32 or less (unless you use an X extension to allow a greater depth). All screens must fit into one of the classes listed in the section in this document on Visuals and Depths. X uses the pixel as its fundamental unit of distance on the screen. Therefore, most programs will measure everything in pixels. The sample server assumes square pixels. Serious WYSIWYG (what you see is what you get) applications for publishing and drawing programs will adjust for different screen resolutions automatically. Considerable work is involved in compensating for non-square pixels (a bit in the DDX code for the sample server but quite a bit in the client applications).
Data Structures X supports multiple screens that are connected to the same server. Therefore, all the per-screen information is bundled into one data structure of attributes and procedures, which is the ScreenRec (see Xserver/include/scrnintstr.h). The procedure entry points in a ScreenRec operate on regions, colormaps, cursors, and fonts, because these resources can differ in format from one screen to another. Windows are areas on the screen that can be drawn into by graphic routines. "Pixmaps" are off-screen graphic areas that can be drawn into. They are both considered drawables and are described in the section on Drawables. All graphic operations work on drawables, and operations are available to copy patches from one drawable to another. The pixel image data in all drawables is in a format that is private to DDX. In fact, each instance of a drawable is associated with a given screen. Presumably, the pixel image data for pixmaps is chosen to be conveniently understood by the hardware. All screens in a single server must be able to handle all pixmaps depths declared in the connection setup information. Pixmap images are transferred to the server in one of two ways: XYPixmap or ZPimap. XYPixmaps are a series of bitmaps, one for each bit plane of the image, using the bitmap padding rules from the connection setup. ZPixmaps are a series of bits, nibbles, bytes or words, one for each pixel, using the format rules (padding and so on) for the appropriate depth. All screens in a given server must agree on a set of pixmap image formats (PixmapFormat) to support (depth, number of bits per pixel, etc.). There is no color interpretation of bits in the pixmap. Pixmaps do not contain pixel values. The interpretation is made only when the bits are transferred onto the screen. The screenInfo structure (in scrnintstr.h) is a global data structure that has a pointer to an array of ScreenRecs, one for each screen on the server. (These constitute the one and only description of each screen in the server.) Each screen has an identifying index (0, 1, 2, ...). In addition, the screenInfo struct contains global server-wide details, such as the bit- and byte- order in all bit images, and the list of pixmap image formats that are supported. The X protocol insists that these must be the same for all screens on the server.
Output Initialization
InitOutput(pScreenInfo, argc, argv) ScreenInfo *pScreenInfo; int argc; char **argv;
Upon initialization, your DDX routine InitOutput() is called by DIX. It is passed a pointer to screenInfo to initialize. It is also passed the argc and argv from main() for your server for the command-line arguments. These arguments may indicate what or how many screen device(s) to use or in what way to use them. For instance, your server command line may allow a "-D" flag followed by the name of the screen device to use.
Your InitOutput() routine should initialize each screen you wish to use by calling AddScreen(), and then it should initialize the pixmap formats that you support by storing values directly into the screenInfo data structure. You should also set certain implementation-dependent numbers and procedures in your screenInfo, which determines the pixmap and scanline padding rules for all screens in the server.
int AddScreen(scrInitProc, argc, argv) Bool (*scrInitProc)(); int argc; char **argv;
You should call AddScreen(), a DIX procedure, in InitOutput() once for each screen to add it to the screenInfo database. The first argument is an initialization procedure for the screen that you supply. The second and third are the argc and argv from main(). It returns the screen number of the screen installed, or -1 if there is either insufficient memory to add the screen, or (*scrInitProc) returned FALSE.
The scrInitProc should be of the following form:
Bool scrInitProc(pScreen, argc, argv) ScreenPtr pScreen; int argc; char **argv;
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. If you have the same procedure for multiple screens, it may have trouble figuring out which screen to initialize each time around, especially if InitOutput() does not initialize all of the screens. It is probably easiest to have one procedure for each screen. The initialization procedure should fill in all the screen procedures for that screen (windowing functions, region functions, etc.) and certain screen attributes for that screen.
Region Routines in the ScreenRec A region is a dynamically allocated data structure that describes an irregularly shaped piece of real estate in XY pixel space. You can think of it as a set of pixels on the screen to be operated upon with set operations such as AND and OR. A region is frequently implemented as a list of rectangles or bitmaps that enclose the selected pixels. Region operators control the "clipping policy," or the operations that work on regions. (The sample server uses YX-banded rectangles. Unless you have something already implemented for your graphics system, you should keep that implementation.) The procedure pointers to the region operators are located in the ScreenRec data structure. The definition of a region can be found in the file Xserver/include/regionstr.h. The region code is found in Xserver/mi/miregion.c. DDX implementations using other region formats will need to supply different versions of the region operators. Since the list of rectangles is unbounded in size, part of the region data structure is usually a large, dynamically allocated chunk of memory. As your region operators calculate logical combinations of regions, these blocks may need to be reallocated by your region software. For instance, in the sample server, a RegionRec has some header information and a pointer to a dynamically allocated rectangle list. Periodically, the rectangle list needs to be expanded with Xrealloc(), whereupon the new pointer is remembered in the RegionRec. Most of the region operations come in two forms: a function pointer in the Screen structure, and a macro. The server can be compiled so that the macros make direct calls to the appropriate functions (instead of indirecting through a screen function pointer), or it can be compiled so that the macros are identical to the function pointer forms. Making direct calls is faster on many architectures.
RegionPtr pScreen->RegionCreate( rect, size) BoxPtr rect; int size; macro: RegionPtr RegionCreate(rect, size)
RegionCreate creates a region that describes ONE rectangle. The caller can avoid unnecessary reallocation and copying by declaring the probable maximum number of rectangles that this region will need to describe itself. Your region routines, though, cannot fail just because the region grows beyond this size. The caller of this routine can pass almost anything as the size; the value is merely a good guess as to the maximum size until it is proven wrong by subsequent use. Your region procedures are then on their own in estimating how big the region will get. Your implementation might ignore size, if applicable.
void pScreen->RegionInit (pRegion, rect, size) RegionPtr pRegion; BoxPtr rect; int size; macro: RegionInit(pRegion, rect, size)
Given an existing raw region structure (such as an local variable), this routine fills in the appropriate fields to make this region as usable as one returned from RegionCreate. This avoids the additional dynamic memory allocation overhead for the region structure itself.
Bool pScreen->RegionCopy(dstrgn, srcrgn) RegionPtr dstrgn, srcrgn; macro: Bool RegionCopy(dstrgn, srcrgn)
RegionCopy copies the description of one region, srcrgn, to another already-created region, dstrgn; returning TRUE if the copy succeeded, and FALSE otherwise.
void pScreen->RegionDestroy( pRegion) RegionPtr pRegion; macro: RegionDestroy(pRegion)
RegionDestroy destroys a region and frees all allocated memory.
void pScreen->RegionUninit (pRegion) RegionPtr pRegion; macro: RegionUninit(pRegion)
Frees everything except the region structure itself, useful when the region was originally passed to RegionInit instead of received from RegionCreate. When this call returns, pRegion must not be reused until it has been RegionInit'ed again.
Bool pScreen->Intersect(newReg, reg1, reg2) RegionPtr newReg, reg1, reg2; macro: Bool RegionIntersect(newReg, reg1, reg2) Bool pScreen->Union(newReg, reg1, reg2) RegionPtr newReg, reg1, reg2; macro: Bool RegionUnion(newReg, reg1, reg2) Bool pScreen->Subtract(newReg, regMinuend, regSubtrahend) RegionPtr newReg, regMinuend, regSubtrahend; macro: Bool RegionUnion(newReg, regMinuend, regSubtrahend) Bool pScreen->Inverse(newReg, pReg, pBox) RegionPtr newReg, pReg; BoxPtr pBox; macro: Bool RegionInverse(newReg, pReg, pBox)
The above four calls all do basic logical operations on regions. They set the new region (which already exists) to describe the logical intersection, union, set difference, or inverse of the region(s) that were passed in. Your routines must be able to handle a situation where the newReg is the same region as one of the other region arguments.
The subtract function removes the Subtrahend from the Minuend and puts the result in newReg. The inverse function returns a region that is the pBox minus the region passed in. (A true "inverse" would make a region that extends to infinity in all directions but has holes in the middle.) It is undefined for situations where the region extends beyond the box. Each routine must return the value TRUE for success.
void pScreen->RegionReset(pRegion, pBox) RegionPtr pRegion; BoxPtr pBox; macro: RegionReset(pRegion, pBox)
RegionReset sets the region to describe one rectangle and reallocates it to a size of one rectangle, if applicable.
void pScreen->TranslateRegion(pRegion, x, y) RegionPtr pRegion; int x, y; macro: RegionTranslate(pRegion, x, y)
TranslateRegion simply moves a region +x in the x direction and +y in the y direction.
int pScreen->RectIn(pRegion, pBox) RegionPtr pRegion; BoxPtr pBox; macro: int RegionContainsRect(pRegion, pBox)
RectIn returns one of the defined constants rgnIN, rgnOUT, or rgnPART, depending upon whether the box is entirely inside the region, entirely outside of the region, or partly in and partly out of the region. These constants are defined in Xserver/include/region.h.
Bool pScreen->PointInRegion(pRegion, x, y, pBox) RegionPtr pRegion; int x, y; BoxPtr pBox; macro: Bool RegionContainsPoint(pRegion, x, y, pBox)
PointInRegion returns true if the point x, y is in the region. In addition, it fills the rectangle pBox with coordinates of a rectangle that is entirely inside of pRegion and encloses the point. In the mi implementation, it is the largest such rectangle. (Due to the sample server implementation, this comes cheaply.)
This routine used by DIX when tracking the pointing device and deciding whether to report mouse events or change the cursor. For instance, DIX needs to change the cursor when it moves from one window to another. Due to overlapping windows, the shape to check may be irregular. A PointInRegion() call for every pointing device movement may be too expensive. The pBox is a kind of wake-up box; DIX need not call PointInRegion() again until the cursor wanders outside of the returned box.
Bool pScreen->RegionNotEmpty(pRegion) RegionPtr pRegion; macro: Bool RegionNotEmpty(pRegion)
RegionNotEmpty is a boolean function that returns true or false depending upon whether the region encloses any pixels.
void pScreen->RegionEmpty(pRegion) RegionPtr pRegion; macro: RegionEmpty(pRegion)
RegionEmpty sets the region to be empty.
BoxPtr pScreen->RegionExtents(pRegion) RegionPtr pRegion; macro: RegionExtents(pRegion)
RegionExtents returns a rectangle that is the smallest possible superset of the entire region. The caller will not modify this rectangle, so it can be the one in your region struct.
Bool pScreen->RegionAppend (pDstRgn, pRegion) RegionPtr pDstRgn; RegionPtr pRegion; macro: Bool RegionAppend(pDstRgn, pRegion) Bool pScreen->RegionValidate (pRegion, pOverlap) RegionPtr pRegion; Bool *pOverlap; macro: Bool RegionValidate(pRegion, pOverlap)
These functions provide an optimization for clip list generation and must be used in conjunction. The combined effect is to produce the union of a collection of regions, by using RegionAppend several times, and finally calling RegionValidate which takes the intermediate representation (which needn't be a valid region) and produces the desired union. pOverlap is set to TRUE if any of the original regions overlap; FALSE otherwise.
RegionPtr pScreen->BitmapToRegion (pPixmap) PixmapPtr pPixmap; macro: RegionPtr BitmapToRegion(pScreen, pPixmap)
Given a depth-1 pixmap, this routine must create a valid region which includes all the areas of the pixmap filled with 1's and excludes the areas filled with 0's. This routine returns NULL if out of memory.
RegionPtr pScreen->RectsToRegion (nrects, pRects, ordering) int nrects; xRectangle *pRects; int ordering; macro: RegionPtr RegionFromRects(nrects, pRects, ordering)
Given a client-supplied list of rectangles, produces a region which includes the union of all the rectangles. Ordering may be used as a hint which describes how the rectangles are sorted. As the hint is provided by a client, it must not be required to be correct, but the results when it is not correct are not defined (core dump is not an option here).
void pScreen->SendGraphicsExpose(client,pRegion,drawable,major,minor) ClientPtr client; RegionPtr pRegion; XID drawable; int major; int minor;
SendGraphicsExpose dispatches a list of GraphicsExposure events which span the region to the specified client. If the region is empty, or a NULL pointer, a NoExpose event is sent instead.
Cursor Routines for a Screen A cursor is the visual form tied to the pointing device. The default cursor is an "X" shape, but the cursor can have any shape. When a client creates a window, it declares what shape the cursor will be when it strays into that window on the screen. For each possible shape the cursor assumes, there is a CursorRec data structure. This data structure contains a pointer to a CursorBits data structure which contains a bitmap for the image of the cursor and a bitmap for a mask behind the cursor, in addition, the CursorRec data structure contains foreground and background colors for the cursor. The CursorBits data structure is shared among multiple CursorRec structures which use the same font and glyph to describe both source and mask. The cursor image is applied to the screen by applying the mask first, clearing 1 bits in its form to the background color, and then overwriting on the source image, in the foreground color. (One bits of the source image that fall on top of zero bits of the mask image are undefined.) This way, a cursor can have transparent parts, and opaque parts in two colors. X allows any cursor size, but some hardware cursor schemes allow a maximum of N pixels by M pixels. Therefore, you are allowed to transform the cursor to a smaller size, but be sure to include the hot-spot. CursorBits in Xserver/include/cursorstr.h is a device-independent structure containing a device-independent representation of the bits for the source and mask. (This is possible because the bitmap representation is the same for all screens.) When a cursor is created, it is "realized" for each screen. At realization time, each screen has the chance to convert the bits into some other representation that may be more convenient (for instance, putting the cursor into off-screen memory) and set up its device-private area in either the CursorRec data structure or CursorBits data structure as appropriate to possibly point to whatever data structures are needed. It is more memory-conservative to share realizations by using the CursorBits private field, but this makes the assumption that the realization is independent of the colors used (which is typically true). For instance, the following are the device private entries for a particular screen and cursor:
pCursor->devPriv[pScreen->myNum] pCursor->bits->devPriv[pScreen->myNum]
This is done because the change from one cursor shape to another must be fast and responsive; the cursor image should be able to flutter as fast as the user moves it across the screen.
You must implement the following routines for your hardware:
Bool pScreen->RealizeCursor( pScr, pCurs) ScreenPtr pScr; CursorPtr pCurs; Bool pScreen->UnrealizeCursor( pScr, pCurs) ScreenPtr pScr; CursorPtr pCurs;
RealizeCursor and UnrealizeCursor should realize (allocate and calculate all data needed) and unrealize (free the dynamically allocated data) a given cursor when DIX needs them. They are called whenever a device-independent cursor is created or destroyed. The source and mask bits pointed to by fields in pCurs are undefined for bits beyond the right edge of the cursor. This is so because the bits are in Bitmap format, which may have pad bits on the right edge. You should inhibit UnrealizeCursor() if the cursor is currently in use; this happens when the system is reset.
Bool pScreen->DisplayCursor( pScr, pCurs) ScreenPtr pScr; CursorPtr pCurs;
DisplayCursor should change the cursor on the given screen to the one passed in. It is called by DIX when the user moves the pointing device into a different window with a different cursor. The hotspot in the cursor should be aligned with the current cursor position.
void pScreen->RecolorCursor( pScr, pCurs, displayed) ScreenPtr pScr; CursorPtr pCurs; Bool displayed;
RecolorCursor notifies DDX that the colors in pCurs have changed and indicates whether this is the cursor currently being displayed. If it is, the cursor hardware state may have to be updated. Whether displayed or not, state created at RealizeCursor time may have to be updated. A generic version, miRecolorCursor, may be used that does an unrealize, a realize, and possibly a display (in micursor.c); however this constrains UnrealizeCursor and RealizeCursor to always return TRUE as no error indication is returned here.
void pScreen->ConstrainCursor( pScr, pBox) ScreenPtr pScr; BoxPtr pBox;
ConstrainCursor should cause the cursor to restrict its motion to the rectangle pBox. DIX code is capable of enforcing this constraint by forcefully moving the cursor if it strays out of the rectangle, but ConstrainCursor offers a way to send a hint to the driver or hardware if such support is available. This can prevent the cursor from wandering out of the box, then jumping back, as DIX forces it back.
void pScreen->PointerNonInterestBox( pScr, pBox) ScreenPtr pScr; BoxPtr pBox;
PointerNonInterestBox is DIX's way of telling the pointing device code not to report motion events while the cursor is inside a given rectangle on the given screen. It is optional and, if not implemented, it should do nothing. This routine is called only when the client has declared that it is not interested in motion events in a given window. The rectangle you get may be a subset of that window. It saves DIX code the time required to discard uninteresting mouse motion events. This is only a hint, which may speed performance. Nothing in DIX currently calls PointerNonInterestBox.
void pScreen->CursorLimits( pScr, pCurs, pHotBox, pTopLeftBox) ScreenPtr pScr; CursorPtr pCurs; BoxPtr pHotBox; BoxPtr pTopLeftBox; /* return value */
CursorLimits should calculate the box that the cursor hot spot is physically capable of moving within, as a function of the screen pScr, the device-independent cursor pCurs, and a box that DIX hypothetically would want the hot spot confined within, pHotBox. This routine is for informing DIX only; it alters no state within DDX.
Bool pScreen->SetCursorPosition( pScr, newx, newy, generateEvent) ScreenPtr pScr; int newx; int newy; Bool generateEvent;
SetCursorPosition should artificially move the cursor as though the user had jerked the pointing device very quickly. This is called in response to the WarpPointer request from the client, and at other times. If generateEvent is True, the device should decide whether or not to call ProcessInputEvents() and then it must call DevicePtr->processInputProc. Its effects are, of course, limited in value for absolute pointing devices such as a tablet.
void NewCurrentScreen(newScreen, x, y) ScreenPtr newScreen; int x,y;
If your ddx provides some mechanism for the user to magically move the pointer between multiple screens, you need to inform DIX when this occurs. You should call NewCurrentScreen to accomplish this, specifying the new screen and the new x and y coordinates of the pointer on that screen.
Visuals, Depths and Pixmap Formats for Screens The "depth" of a image is the number of bits that are used per pixel to display it. The "bits per pixel" of a pixmap image that is sent over the client byte stream is a number that is either 4, 8, 16, 24 or 32. It is the number of bits used per pixel in Z format. For instance, a pixmap image that has a depth of six is best sent in Z format as 8 bits per pixel. A "pixmap image format" or a "pixmap format" is a description of the format of a pixmap image as it is sent over the byte stream. For each depth available on a server, there is one and only one pixmap format. This pixmap image format gives the bits per pixel and the scanline padding unit. (For instance, are pixel rows padded to bytes, 16-bit words, or 32-bit words?) For each screen, you must decide upon what depth(s) it supports. You should only count the number of bits used for the actual image. Some displays store additional bits to indicate what window this pixel is in, how close this object is to a viewer, transparency, and other data; do not count these bits. A "display class" tells whether the display is monochrome or color, whether there is a lookup table, and how the lookup table works. A "visual" is a combination of depth, display class, and a description of how the pixel values result in a color on the screen. Each visual has a set of masks and offsets that are used to separate a pixel value into its red, green, and blue components and a count of the number of colormap entries. Some of these fields are only meaningful when the class dictates so. Each visual also has a screen ID telling which screen it is usable on. Note that the depth does not imply the number of map_entries; for instance, a display can have 8 bits per pixel but only 254 colormap entries for use by applications (the other two being reserved by hardware for the cursor). Each visual is identified by a 32-bit visual ID which the client uses to choose what visual is desired on a given window. Clients can be using more than one visual on the same screen at the same time. The class of a display describes how this translation takes place. There are three ways to do the translation. Pseudo - The pixel value, as a whole, is looked up in a table of length map_entries to determine the color to display. True - The pixel value is broken up into red, green, and blue fields, each of which are looked up in separate red, green, and blue lookup tables, each of length map_entries. Gray - The pixel value is looked up in a table of length map_entries to determine a gray level to display. In addition, the lookup table can be static (resulting colors are fixed for each pixel value) or dynamic (lookup entries are under control of the client program). This leads to a total of six classes: Static Gray - The pixel value (of however many bits) determines directly the level of gray that the pixel assumes. Gray Scale - The pixel value is fed through a lookup table to arrive at the level of gray to display for the given pixel. Static Color - The pixel value is fed through a fixed lookup table that yields the color to display for that pixel. PseudoColor - The whole pixel value is fed through a programmable lookup table that has one color (including red, green, and blue intensities) for each possible pixel value, and that color is displayed. True Color - Each pixel value consists of one or more bits that directly determine each primary color intensity after being fed through a fixed table. Direct Color - Each pixel value consists of one or more bits for each primary color. Each primary color value is individually looked up in a table for that primary color, yielding an intensity for that primary color. For each pixel, the red value is looked up in the red table, the green value in the green table, and the blue value in the blue table. Here are some examples: A simple monochrome 1 bit per pixel display is Static Gray. A display that has 2 bits per pixel for a choice between the colors of black, white, green and violet is Static Color. A display that has three bits per pixel, where each bit turns on or off one of the red, green or blue guns, is in the True Color class. If you take the last example and scramble the correspondence between pixel values and colors it becomes a Static Color display. A display has 8 bits per pixel. The 8 bits select one entry out of 256 entries in a lookup table, each entry consisting of 24 bits (8bits each for red, green, and blue). The display can show any 256 of 16 million colors on the screen at once. This is a pseudocolor display. The client application gets to fill the lookup table in this class of display. Imagine the same hardware from the last example. Your server software allows the user, on the command line that starts up the server program, to fill the lookup table to his liking once and for all. From then on, the server software would not change the lookup table until it exits. For instance, the default might be a lookup table with a reasonable sample of colors from throughout the color space. But the user could specify that the table be filled with 256 steps of gray scale because he knew ahead of time he would be manipulating a lot of black-and-white scanned photographs and not very many color things. Clients would be presented with this unchangeable lookup table. Although the hardware qualifies as a PseudoColor display, the facade presented to the X client is that this is a Static Color display. You have to decide what kind of display you have or want to pretend you have. When you initialize the screen(s), this class value must be set in the VisualRec data structure along with other display characteristics like the depth and other numbers. The allowable DepthRec's and VisualRec's are pointed to by fields in the ScreenRec. These are set up when InitOutput() is called; you should Xalloc() appropriate blocks or use static variables initialized to the correct values.
Colormaps for Screens A colormap is a device-independent mapping between pixel values and colors displayed on the screen. Different windows on the same screen can have different colormaps at the same time. At any given time, the most recently installed colormap(s) will be in use in the server so that its (their) windows' colors will be guaranteed to be correct. Other windows may be off-color. Although this may seem to be chaotic, in practice most clients use the default colormap for the screen. The default colormap for a screen is initialized when the screen is initialized. It always remains in existence and is not owned by any regular client. It is owned by client 0 (the server itself). Many clients will simply use this default colormap for their drawing. Depending upon the class of the screen, the entries in this colormap may be modifiable by client applications.
Colormap Routines You need to implement the following routines to handle the device-dependent aspects of color maps. You will end up placing pointers to these procedures in your ScreenRec data structure(s). The sample server implementations of many of these routines are in fbcmap.c.
Bool pScreen->CreateColormap(pColormap) ColormapPtr pColormap;
This routine is called by the DIX CreateColormap routine after it has allocated all the data for the new colormap and just before it returns to the dispatcher. It is the DDX layer's chance to initialize the colormap, particularly if it is a static map. See the following section for more details on initializing colormaps. The routine returns FALSE if creation failed, such as due to memory limitations. Notice that the colormap has a devPriv field from which you can hang any colormap specific storage you need. Since each colormap might need special information, we attached the field to the colormap and not the visual.
void pScreen->DestroyColormap(pColormap) ColormapPtr pColormap;
This routine is called by the DIX FreeColormap routine after it has uninstalled the colormap and notified all interested parties, and before it has freed any of the colormap storage. It is the DDX layer's chance to free any data it added to the colormap.
void pScreen->InstallColormap(pColormap) ColormapPtr pColormap;
InstallColormap should fill a lookup table on the screen with which the colormap is associated with the colors in pColormap. If there is only one hardware lookup table for the screen, then all colors on the screen may change simultaneously.
In the more general case of multiple hardware lookup tables, this may cause some other colormap to be uninstalled, meaning that windows that subscribed to the colormap that was uninstalled may end up being off-color. See the note, below, about uninstalling maps.
void pScreen->UninstallColormap(pColormap) ColormapPtr pColormap;
UninstallColormap should remove pColormap from screen pColormap->pScreen. Some other map, such as the default map if possible, should be installed in place of pColormap if applicable. If pColormap is the default map, do nothing. If any client has requested ColormapNotify events, the DDX layer must notify the client. (The routine WalkTree() is be used to find such windows. The DIX routines TellNoMap(), TellNewMap() and TellGainedMap() are provided to be used as the procedure parameter to WalkTree. These procedures are in Xserver/dix/colormap.c.)
int pScreen->ListInstalledColormaps(pScreen, pCmapList) ScreenPtr pScreen; XID *pCmapList;
ListInstalledColormaps fills the pCmapList in with the resource ids of the installed maps and returns a count of installed maps. pCmapList will point to an array of size MaxInstalledMaps that was allocated by the caller.
void pScreen->StoreColors (pmap, ndef, pdefs) ColormapPtr pmap; int ndef; xColorItem *pdefs;
StoreColors changes some of the entries in the colormap pmap. The number of entries to change are ndef, and pdefs points to the information describing what to change. Note that partial changes of entries in the colormap are allowed. Only the colors indicated in the flags field of each xColorItem need to be changed. However, all three color fields will be sent with the proper value for the benefit of screens that may not be able to set part of a colormap value. If the screen is a static class, this routine does nothing. The structure of colormap entries is nontrivial; see colormapst.h and the definition of xColorItem in Xproto.h for more details.
void pScreen->ResolveColor(pRed, pGreen, pBlue, pVisual) unsigned short *pRed, *pGreen, *pBlue; VisualPtr pVisual;
Given a requested color, ResolveColor returns the nearest color that this hardware is capable of displaying on this visual. In other words, this rounds off each value, in place, to the number of bits per primary color that your screen can use. Remember that each screen has one of these routines. The level of roundoff should be what you would expect from the value you put in the bits_per_rgb field of the pVisual.
Each value is an unsigned value ranging from 0 to 65535. The bits least likely to be used are the lowest ones. For example, if you had a pseudocolor display with any number of bits per pixel that had a lookup table supplying 6 bits for each color gun (a total of 256K different colors), you would round off each value to 6 bits. Please don't simply truncate these values to the upper 6 bits, scale the result so that the maximum value seen by the client will be 65535 for each primary. This makes color values more portable between different depth displays (a 6-bit truncated white will not look white on an 8-bit display).
Initializing a Colormap When a client requests a new colormap and when the server creates the default colormap, the procedure CreateColormap in the DIX layer is invoked. That procedure allocates memory for the colormap and related storage such as the lists of which client owns which pixels. It then sets a bit, BeingCreated, in the flags field of the ColormapRec and calls the DDX layer's CreateColormap routine. This is your chance to initialize the colormap. If the colormap is static, which you can tell by looking at the class field, you will want to fill in each color cell to match the hardwares notion of the color for that pixel. If the colormap is the default for the screen, which you can tell by looking at the IsDefault bit in the flags field, you should allocate BlackPixel and WhitePixel to match the values you set in the pScreen structure. (Of course, you picked those values to begin with.) You can also wait and use AllocColor() to allocate blackPixel and whitePixel after the default colormap has been created. If the default colormap is static and you initialized it in pScreen->CreateColormap, then use can use AllocColor afterwards to choose pixel values with the closest rgb values to those desired for blackPixel and whitePixel. If the default colormap is dynamic and uninitialized, then the rgb values you request will be obeyed, and AllocColor will again choose pixel values for you. These pixel values can then be stored into the screen. There are two ways to fill in the colormap. The simplest way is to use the DIX function AllocColor.
int AllocColor (pmap, pred, pgreen, pblue, pPix, client) ColormapPtr pmap; unsigned short *pred, *pgreen, *pblue; Pixel *pPix; int client;
This takes three pointers to 16 bit color values and a pointer to a suggested pixel value. The pixel value is either an index into one colormap or a combination of three indices depending on the type of pmap. If your colormap starts out empty, and you don't deliberately pick the same value twice, you will always get your suggested pixel. The truly nervous could check that the value returned in *pPix is the one AllocColor was called with. If you don't care which pixel is used, or would like them sequentially allocated from entry 0, set *pPix to 0. This will find the first free pixel and use that.
AllocColor will take care of all the bookkeeping and will call StoreColors to get the colormap rgb values initialized. The hardware colormap will be changed whenever this colormap is installed. If for some reason AllocColor doesn't do what you want, you can do your own bookkeeping and call StoreColors yourself. This is much more difficult and shouldn't be necessary for most devices.
Fonts for Screens A font is a set of bitmaps that depict the symbols in a character set. Each font is for only one typeface in a given size, in other words, just one bitmap for each character. Parallel fonts may be available in a variety of sizes and variations, including "bold" and "italic." X supports fonts for 8-bit and 16-bit character codes (for oriental languages that have more than 256 characters in the font). Glyphs are bitmaps for individual characters. The source comes with some useful font files in an ASCII, plain-text format that should be comprehensible on a wide variety of operating systems. The text format, referred to as BDF, is a slight extension of the current Adobe 2.1 Bitmap Distribution Format (Adobe Systems, Inc.). A short paper in PostScript format is included with the sample server that defines BDF. It includes helpful pictures, which is why it is done in PostScript and is not included in this document. Your implementation should include some sort of font compiler to read these files and generate binary files that are directly usable by your server implementation. The sample server comes with the source for a font compiler. It is important the font properties contained in the BDF files are preserved across any font compilation. In particular, copyright information cannot be casually tossed aside without legal ramifications. Other properties will be important to some sophisticated applications. All clients get font information from the server. Therefore, your server can support any fonts it wants to. It should probably support at least the fonts supplied with the X11 tape. In principle, you can convert fonts from other sources or dream up your own fonts for use on your server.
Portable Compiled Format A font compiler is supplied with the sample server. It has compile-time switches to convert the BDF files into a portable binary form, called Portable Compiled Format or PCF. This allows for an arbitrary data format inside the file, and by describing the details of the format in the header of the file, any PCF file can be read by any PCF reading client. By selecting the format which matches the required internal format for your renderer, the PCF reader can avoid reformatting the data each time it is read in. The font compiler should be quite portable. The fonts included with the tape are stored in fonts/bdf. The font compiler is found in fonts/tools/bdftopcf.
Font Realization Each screen configured into the server has an opportunity at font-load time to "realize" a font into some internal format if necessary. This happens every time the font is loaded into memory. A font (FontRec in Xserver/include/dixfontstr.h) is a device-independent structure containing a device-independent representation of the font. When a font is created, it is "realized" for each screen. At this point, the screen has the chance to convert the font into some other format. The DDX layer can also put information in the devPrivate storage.
Bool pScreen->RealizeFont(pScr, pFont) ScreenPtr pScr; FontPtr pFont; Bool pScreen->UnrealizeFont(pScr, pFont) ScreenPtr pScr; FontPtr pFont;
RealizeFont and UnrealizeFont should calculate and allocate these extra data structures and dispose of them when no longer needed. These are called in response to OpenFont and CloseFont requests from the client. The sample server implementation is in fbscreen.c (which does very little).
Other Screen Routines You must supply several other screen-specific routines for your X server implementation. Some of these are described in other sections: GetImage() is described in the Drawing Primitives section. GetSpans() is described in the Pixblit routine section. Several window and pixmap manipulation procedures are described in the Window section under Drawables. The CreateGC() routine is described under Graphics Contexts.
void pScreen->QueryBestSize(kind, pWidth, pHeight) int kind; unsigned short *pWidth, *pHeight; ScreenPtr pScreen;
QueryBestSize() returns the best sizes for cursors, tiles, and stipples in response to client requests. kind is one of the defined constants CursorShape, TileShape, or StippleShape (defined in X.h). For CursorShape, return the maximum width and height for cursors that you can handle. For TileShape and StippleShape, start with the suggested values in pWidth and pHeight and modify them in place to be optimal values that are greater than or equal to the suggested values. The sample server implementation is in Xserver/fb/fbscreen.c.
pScreen->SourceValidate(pDrawable, x, y, width, height) DrawablePtr pDrawable; int x, y, width, height; unsigned int subWindowMode;
SourceValidate should be called by CopyArea/CopyPlane primitives when the SourceValidate function pointer in the screen is non-null. If you know that you will never need SourceValidate, you can avoid this check. Currently, SourceValidate is used by the mi software cursor code to remove the cursor from the screen when the source rectangle overlaps the cursor position. x,y,width,height describe the source rectangle (source relative, that is) for the copy operation. subWindowMode comes from the GC or source Picture.
Bool pScreen->SaveScreen(pScreen, on) ScreenPtr pScreen; int on;
SaveScreen() is used for Screen Saver support (see WaitForSomething()). pScreen is the screen to save.
Bool pScreen->CloseScreen(pScreen) ScreenPtr pScreen;
When the server is reset, it calls this routine for each screen.
Bool pScreen->CreateScreenResources(pScreen) ScreenPtr pScreen;
If this routine is not NULL, it will be called once per screen per server initialization/reset after all modules have had a chance to request private space on all structures that support them (see below). You may create resources in this function instead of in the screen init function passed to AddScreen in order to guarantee that all pre-allocated space requests have been registered first. With the new devPrivates mechanism, this is not strictly necessary, however. This routine returns TRUE if successful.
Drawables A drawable is a descriptor of a surface that graphics are drawn into, either a window on the screen or a pixmap in memory. Each drawable has a type, class, ScreenPtr for the screen it is associated with, depth, position, size, and serial number. The type is one of the defined constants DRAWABLE_PIXMAP, DRAWABLE_WINDOW and UNDRAWABLE_WINDOW. (An undrawable window is used for window class InputOnly.) The serial number is guaranteed to be unique across drawables, and is used in determining the validity of the clipping information in a GC. The screen selects the set of procedures used to manipulate and draw into the drawable. Position is used (currently) only by windows; pixmaps must set these fields to 0,0 as this reduces the amount of conditional code executed throughout the mi code. Size indicates the actual client-specified size of the drawable. There are, in fact, no other fields that a window drawable and pixmap drawable have in common besides those mentioned here. Both PixmapRecs and WindowRecs are structs that start with a drawable and continue on with more fields. Pixmaps have a single pointer field named devPrivate which usually points to the pixmap data but could conceivably be used for anything that DDX wants. Both windows and pixmaps also have a devPrivates field which can be used for DDX specific data (see below). This is done because different graphics hardware has different requirements for management; if the graphics is always handled by a processor with an independent address space, there is no point having a pointer to the bit image itself. The definition of a drawable and a pixmap can be found in the file Xserver/include/pixmapstr.h. The definition of a window can be found in the file Xserver/include/windowstr.h.
Pixmaps A pixmap is a three-dimensional array of bits stored somewhere offscreen, rather than in the visible portion of the screen's display frame buffer. It can be used as a source or destination in graphics operations. There is no implied interpretation of the pixel values in a pixmap, because it has no associated visual or colormap. There is only a depth that indicates the number of significant bits per pixel. Also, there is no implied physical size for each pixel; all graphic units are in numbers of pixels. Therefore, a pixmap alone does not constitute a complete image; it represents only a rectangular array of pixel values. Note that the pixmap data structure is reference-counted. The server implementation is free to put the pixmap data anywhere it sees fit, according to its graphics hardware setup. Many implementations will simply have the data dynamically allocated in the server's address space. More sophisticated implementations may put the data in undisplayed framebuffer storage. In addition to dynamic devPrivates (see below), the pixmap data structure has two fields that are private to the device. Although you can use them for anything you want, they have intended purposes. devKind is intended to be a device specific indication of the pixmap location (host memory, off-screen, etc.). In the sample server, since all pixmaps are in memory, devKind stores the width of the pixmap in bitmap scanline units. devPrivate is usually a pointer to the bits in the pixmap. A bitmap is a pixmap that is one bit deep.
PixmapPtr pScreen->CreatePixmap(pScreen, width, height, depth) ScreenPtr pScreen; int width, height, depth;
This ScreenRec procedure must create a pixmap of the size requested. It must allocate a PixmapRec and fill in all of the fields. The reference count field must be set to 1. If width or height are zero, no space should be allocated for the pixmap data, and if the implementation is using the devPrivate field as a pointer to the pixmap data, it should be set to NULL. If successful, it returns a pointer to the new pixmap; if not, it returns NULL. See Xserver/fb/fbpixmap.c for the sample server implementation.
Bool pScreen->DestroyPixmap(pPixmap) PixmapPtr pPixmap;
This ScreenRec procedure must "destroy" a pixmap. It should decrement the reference count and, if zero, it must deallocate the PixmapRec and all attached devPrivate blocks. If successful, it returns TRUE. See Xserver/fb/fbpixmap.c for the sample server implementation.
Bool pScreen->ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData) PixmapPtr pPixmap; int width; int height; int depth; int bitsPerPixel; int devKind; pointer pPixData;
This routine takes a pixmap header and initializes the fields of the PixmapRec to the parameters of the same name. pPixmap must have been created via pScreen->CreatePixmap with a zero width or height to avoid allocating space for the pixmap data. pPixData is assumed to be the pixmap data; it will be stored in an implementation-dependent place (usually pPixmap->devPrivate.ptr). This routine returns TRUE if successful. See Xserver/mi/miscrinit.c for the sample server implementation.
PixmapPtr GetScratchPixmapHeader(pScreen, width, height, depth, bitsPerPixel, devKind, pPixData) ScreenPtr pScreen; int width; int height; int depth; int bitsPerPixel; int devKind; pointer pPixData; void FreeScratchPixmapHeader(pPixmap) PixmapPtr pPixmap;
DDX should use these two DIX routines when it has a buffer of raw image data that it wants to manipulate as a pixmap temporarily, usually so that some other part of the server can be leveraged to perform some operation on the data. The data should be passed in pPixData, and will be stored in an implementation-dependent place (usually pPixmap->devPrivate.ptr). The other fields go into the corresponding PixmapRec fields. If successful, GetScratchPixmapHeader returns a valid PixmapPtr which can be used anywhere the server expects a pixmap, else it returns NULL. The pixmap should be released when no longer needed (usually within the same function that allocated it) with FreeScratchPixmapHeader.
Windows A window is a visible, or potentially visible, rectangle on the screen. DIX windowing functions maintain an internal n-ary tree data structure, which represents the current relationships of the mapped windows. Windows that are contained in another window are children of that window and are clipped to the boundaries of the parent. The root window in the tree is the window for the entire screen. Sibling windows constitute a doubly-linked list; the parent window has a pointer to the head and tail of this list. Each child also has a pointer to its parent. The border of a window is drawn by a DDX procedure when DIX requests that it be drawn. The contents of the window is drawn by the client through requests to the server. Window painting is orchestrated through an expose event system. When a region is exposed, DIX generates an expose event, telling the client to repaint the window and passing the region that is the minimal area needed to be repainted. As a favor to clients, the server may retain the output to the hidden parts of windows in off-screen memory; this is called "backing store". When a part of such a window becomes exposed, it can quickly move pixels into place instead of triggering an expose event and waiting for a client on the other end of the network to respond. Even if the network response is insignificant, the time to intelligently paint a section of a window is usually more than the time to just copy already-painted sections. At best, the repainting involves blanking out the area to a background color, which will take about the same amount of time. In this way, backing store can dramatically increase the performance of window moves. On the other hand, backing store can be quite complex, because all graphics drawn to hidden areas must be intercepted and redirected to the off-screen window sections. Not only can this be complicated for the server programmer, but it can also impact window painting performance. The backing store implementation can choose, at any time, to forget pieces of backing that are written into, relying instead upon expose events to repaint for simplicity. In X, the decision to use the backing-store scheme is made by you, the server implementor. The sample server implements backing store "for free" by reusing the infrastructure for the Composite extension. As a side effect, it treats the WhenMapped and Always hints as equivalent. However, it will never forget pixel contents when the window is mapped. When a window operation is requested by the client, such as a window being created or moved, a new state is computed. During this transition, DIX informs DDX what rectangles in what windows are about to become obscured and what rectangles in what windows have become exposed. This provides a hook for the implementation of backing store. If DDX is unable to restore exposed regions, DIX generates expose events to the client. It is then the client's responsibility to paint the window parts that were exposed but not restored. If a window is resized, pixels sometimes need to be moved, depending upon the application. The client can request "Gravity" so that certain blocks of the window are moved as a result of a resize. For instance, if the window has controls or other items that always hang on the edge of the window, and that edge is moved as a result of the resize, then those pixels should be moved to avoid having the client repaint it. If the client needs to repaint it anyway, such an operation takes time, so it is desirable for the server to approximate the appearance of the window as best it can while waiting for the client to do it perfectly. Gravity is used for that, also. The window has several fields used in drawing operations: clipList - This region, in conjunction with the client clip region in the gc, is used to clip output. clipList has the window's children subtracted from it, in addition to pieces of sibling windows that overlap this window. To get the list with the children included (subwindow-mode is IncludeInferiors), the routine NotClippedByChildren(pWin) returns the unclipped region. borderClip is the region used by CopyWindow and includes the area of the window, its children, and the border, but with the overlapping areas of sibling children removed. Most of the other fields are for DIX use only.
Window Procedures in the ScreenRec You should implement all of the following procedures and store pointers to them in the screen record. The device-independent portion of the server "owns" the window tree. However, clever hardware might want to know the relationship of mapped windows. There are pointers to procedures in the ScreenRec data structure that are called to give the hardware a chance to update its internal state. These are helpers and hints to DDX only; they do not change the window tree, which is only changed by DIX.
Bool pScreen->CreateWindow(pWin) WindowPtr pWin;
This routine is a hook for when DIX creates a window. It should fill in the "Window Procedures in the WindowRec" below and also allocate the devPrivate block for it.
See Xserver/fb/fbwindow.c for the sample server implementation.
Bool pScreen->DestroyWindow(pWin); WindowPtr pWin;
This routine is a hook for when DIX destroys a window. It should deallocate the devPrivate block for it and any other blocks that need to be freed, besides doing other cleanup actions.
See Xserver/fb/fbwindow.c for the sample server implementation.
Bool pScreen->PositionWindow(pWin, x, y); WindowPtr pWin; int x, y;
This routine is a hook for when DIX moves or resizes a window. It should do whatever private operations need to be done when a window is moved or resized. For instance, if DDX keeps a pixmap tile used for drawing the background or border, and it keeps the tile rotated such that it is longword aligned to longword locations in the frame buffer, then you should rotate your tiles here. The actual graphics involved in moving the pixels on the screen and drawing the border are handled by CopyWindow(), below.
See Xserver/fb/fbwindow.c for the sample server implementation.
Bool pScreen->RealizeWindow(pWin); WindowPtr pWin; Bool pScreen->UnrealizeWindow(pWin); WindowPtr pWin;
These routines are hooks for when DIX maps (makes visible) and unmaps (makes invisible) a window. It should do whatever private operations need to be done when these happen, such as allocating or deallocating structures that are only needed for visible windows. RealizeWindow does NOT draw the window border, background or contents; UnrealizeWindow does NOT erase the window or generate exposure events for underlying windows; this is taken care of by DIX. DIX does, however, call PaintWindowBackground() and PaintWindowBorder() to perform some of these.
Bool pScreen->ChangeWindowAttributes(pWin, vmask) WindowPtr pWin; unsigned long vmask;
ChangeWindowAttributes is called whenever DIX changes window attributes, such as the size, front-to-back ordering, title, or anything of lesser severity that affects the window itself. The sample server implements this routine. It computes accelerators for quickly putting up background and border tiles. (See description of the set of routines stored in the WindowRec.)
int pScreen->ValidateTree(pParent, pChild, kind) WindowPtr pParent, pChild; VTKind kind;
ValidateTree calculates the clipping region for the parent window and all of its children. This routine must be provided. The sample server has a machine-independent version in Xserver/mi/mivaltree.c. This is a very difficult routine to replace.
void pScreen->PostValidateTree(pParent, pChild, kind) WindowPtr pParent, pChild; VTKind kind;
If this routine is not NULL, DIX calls it shortly after calling ValidateTree, passing it the same arguments. This is useful for managing multi-layered framebuffers. The sample server sets this to NULL.
void pScreen->WindowExposures(pWin, pRegion, pBSRegion) WindowPtr pWin; RegionPtr pRegion; RegionPtr pBSRegion;
The WindowExposures() routine paints the border and generates exposure events for the window. pRegion is an unoccluded region of the window, and pBSRegion is an occluded region that has backing store. Since exposure events include a rectangle describing what was exposed, this routine may have to send back a series of exposure events, one for each rectangle of the region. The count field in the expose event is a hint to the client as to the number of regions that are after this one. This routine must be provided. The sample server has a machine-independent version in Xserver/mi/miexpose.c.
void pScreen->ClipNotify (pWin, dx, dy) WindowPtr pWin; int dx, dy;
Whenever the cliplist for a window is changed, this function is called to perform whatever hardware manipulations might be necessary. When called, the clip list and border clip regions in the window are set to the new values. dx,dy are the distance that the window has been moved (if at all).
Window Painting Procedures In addition to the procedures listed above, there are two routines which manipulate the actual window image directly. In the sample server, mi implementations will work for most purposes and fb routines speed up situations, such as solid backgrounds/borders or tiles that are 8, 16 or 32 pixels square.
void pScreen->ClearToBackground(pWin, x, y, w, h, generateExposures); WindowPtr pWin; int x, y, w, h; Bool generateExposures;
This routine is called on a window in response to a ClearToBackground request from the client. This request has two different but related functions, depending upon generateExposures.
If generateExposures is true, the client is declaring that the given rectangle on the window is incorrectly painted and needs to be repainted. The sample server implementation calculates the exposure region and hands it to the DIX procedure HandleExposures(), which calls the WindowExposures() routine, below, for the window and all of its child windows. If generateExposures is false, the client is trying to simply erase part of the window to the background fill style. ClearToBackground should write the background color or tile to the rectangle in question (probably using PaintWindowBackground). If w or h is zero, it clears all the way to the right or lower edge of the window. The sample server implementation is in Xserver/mi/miwindow.c.
void pScreen->CopyWindow(pWin, oldpt, oldRegion); WindowPtr pWin; DDXPointRec oldpt; RegionPtr oldRegion;
CopyWindow is called when a window is moved, and graphically moves to pixels of a window on the screen. It should not change any other state within DDX (see PositionWindow(), above).
oldpt is the old location of the upper-left corner. oldRegion is the old region it is coming from. The new location and new region is stored in the WindowRec. oldRegion might modified in place by this routine (the sample implementation does this). CopyArea could be used, except that this operation has more complications. First of all, you do not want to copy a rectangle onto a rectangle. The original window may be obscured by other windows, and the new window location may be similarly obscured. Second, some hardware supports multiple windows with multiple depths, and your routine needs to take care of that. The pixels in oldRegion (with reference point oldpt) are copied to the window's new region (pWin->borderClip). pWin->borderClip is gotten directly from the window, rather than passing it as a parameter. The sample server implementation is in Xserver/fb/fbwindow.c.
Screen Operations for Multi-Layered Framebuffers The following screen functions are useful if you have a framebuffer with multiple sets of independent bit planes, e.g. overlays or underlays in addition to the "main" planes. If you have a simple single-layer framebuffer, you should probably use the mi versions of these routines in mi/miwindow.c. This can be easily accomplished by calling miScreenInit.
void pScreen->MarkWindow(pWin) WindowPtr pWin;
This formerly dix function MarkWindow has moved to ddx and is accessed via this screen function. This function should store something, usually a pointer to a device-dependent structure, in pWin->valdata so that ValidateTree has the information it needs to validate the window.
Bool pScreen->MarkOverlappedWindows(parent, firstChild, ppLayerWin) WindowPtr parent; WindowPtr firstChild; WindowPtr * ppLayerWin;
This formerly dix function MarkWindow has moved to ddx and is accessed via this screen function. In the process, it has grown another parameter: ppLayerWin, which is filled in with a pointer to the window at which save under marking and ValidateTree should begin. In the single-layered framebuffer case, pLayerWin == pWin.
Bool pScreen->ChangeSaveUnder(pLayerWin, firstChild) WindowPtr pLayerWin; WindowPtr firstChild;
The dix functions ChangeSaveUnder and CheckSaveUnder have moved to ddx and are accessed via this screen function. pLayerWin should be the window returned in the ppLayerWin parameter of MarkOverlappedWindows. The function may turn on backing store for windows that might be covered, and may partially turn off backing store for windows. It returns TRUE if PostChangeSaveUnder needs to be called to finish turning off backing store.
void pScreen->PostChangeSaveUnder(pLayerWin, firstChild) WindowPtr pLayerWin; WindowPtr firstChild;
The dix function DoChangeSaveUnder has moved to ddx and is accessed via this screen function. This function completes the job of turning off backing store that was started by ChangeSaveUnder.
void pScreen->MoveWindow(pWin, x, y, pSib, kind) WindowPtr pWin; int x; int y; WindowPtr pSib; VTKind kind;
The formerly dix function MoveWindow has moved to ddx and is accessed via this screen function. The new position of the window is given by x,y. kind is VTMove if the window is only moving, or VTOther if the border is also changing.
void pScreen->ResizeWindow(pWin, x, y, w, h, pSib) WindowPtr pWin; int x; int y; unsigned int w; unsigned int h; WindowPtr pSib;
The formerly dix function SlideAndSizeWindow has moved to ddx and is accessed via this screen function. The new position is given by x,y. The new size is given by w,h.
WindowPtr pScreen->GetLayerWindow(pWin) WindowPtr pWin
This is a new function which returns a child of the layer parent of pWin.
void pScreen->HandleExposures(pWin) WindowPtr pWin;
The formerly dix function HandleExposures has moved to ddx and is accessed via this screen function. This function is called after ValidateTree and uses the information contained in valdata to send exposures to windows.
void pScreen->ReparentWindow(pWin, pPriorParent) WindowPtr pWin; WindowPtr pPriorParent;
This function will be called when a window is reparented. At the time of the call, pWin will already be spliced into its new position in the window tree, and pPriorParent is its previous parent. This function can be NULL.
void pScreen->SetShape(pWin) WindowPtr pWin;
The formerly dix function SetShape has moved to ddx and is accessed via this screen function. The window's new shape will have already been stored in the window when this function is called.
void pScreen->ChangeBorderWidth(pWin, width) WindowPtr pWin; unsigned int width;
The formerly dix function ChangeBorderWidth has moved to ddx and is accessed via this screen function. The new border width is given by width.
void pScreen->MarkUnrealizedWindow(pChild, pWin, fromConfigure) WindowPtr pChild; WindowPtr pWin; Bool fromConfigure;
This function is called for windows that are being unrealized as part of an UnrealizeTree. pChild is the window being unrealized, pWin is an ancestor, and the fromConfigure value is simply propagated from UnrealizeTree.
Graphics Contexts and Validation This graphics context (GC) contains state variables such as foreground and background pixel value (color), the current line style and width, the current tile or stipple for pattern generation, the current font for text generation, and other similar attributes. In many graphics systems, the equivalent of the graphics context and the drawable are combined as one entity. The main distinction between the two kinds of status is that a drawable describes a writing surface and the writings that may have already been done on it, whereas a graphics context describes the drawing process. A drawable is like a chalkboard. A GC is like a piece of chalk. Unlike many similar systems, there is no "current pen location." Every graphic operation is accompanied by the coordinates where it is to happen. The GC also includes two vectors of procedure pointers, the first operate on the GC itself and are called GC funcs. The second, called GC ops, contains the functions that carry out the fundamental graphic operations such as drawing lines, polygons, arcs, text, and copying bitmaps. The DDX graphic software can, if it wants to be smart, change these two vectors of procedure pointers to take advantage of hardware/firmware in the server machine, which can do a better job under certain circumstances. To reduce the amount of memory consumed by each GC, it is wise to create a few "boilerplate" GC ops vectors which can be shared by every GC which matches the constraints for that set. Also, it is usually reasonable to have every GC created by a particular module to share a common set of GC funcs. Samples of this sort of sharing can be seen in fb/fbgc.c. The DDX software is notified any time the client (or DIX) uses a changed GC. For instance, if the hardware has special support for drawing fixed-width fonts, DDX can intercept changes to the current font in a GC just before drawing is done. It can plug into either a fixed-width procedure that makes the hardware draw characters, or a variable-width procedure that carefully lays out glyphs by hand in software, depending upon the new font that is selected. A definition of these structures can be found in the file Xserver/include/gcstruct.h. Also included in each GC is support for dynamic devPrivates, which the DDX can use for any purpose (see below). The DIX routines available for manipulating GCs are CreateGC, ChangeGC, ChangeGCXIDs, CopyGC, SetClipRects, SetDashes, and FreeGC.
GCPtr CreateGC(pDrawable, mask, pval, pStatus) DrawablePtr pDrawable; BITS32 mask; XID *pval; int *pStatus; int ChangeGC(client, pGC, mask, pUnion) ClientPtr client; GCPtr pGC; BITS32 mask; ChangeGCValPtr pUnion; int ChangeGCXIDs(client, pGC, mask, pC32) ClientPtr client; GCPtr pGC; BITS32 mask; CARD32 *pC32; int CopyGC(pgcSrc, pgcDst, mask) GCPtr pgcSrc; GCPtr pgcDst; BITS32 mask; int SetClipRects(pGC, xOrigin, yOrigin, nrects, prects, ordering) GCPtr pGC; int xOrigin, yOrigin; int nrects; xRectangle *prects; int ordering; SetDashes(pGC, offset, ndash, pdash) GCPtr pGC; unsigned offset; unsigned ndash; unsigned char *pdash; int FreeGC(pGC, gid) GCPtr pGC; GContext gid;
As a convenience, each Screen structure contains an array of GCs that are preallocated, one at each depth the screen supports. These are particularly useful in the mi code. Two DIX routines must be used to get these GCs:
GCPtr GetScratchGC(depth, pScreen) int depth; ScreenPtr pScreen; FreeScratchGC(pGC) GCPtr pGC;
Always use these two routines, don't try to extract the scratch GC yourself -- someone else might be using it, so a new one must be created on the fly.
If you need a GC for a very long time, say until the server is restarted, you should not take one from the pool used by GetScratchGC, but should get your own using CreateGC or CreateScratchGC. This leaves the ones in the pool free for routines that only need it for a little while and don't want to pay a heavy cost to get it.
GCPtr CreateScratchGC(pScreen, depth) ScreenPtr pScreen; int depth;
NULL is returned if the GC cannot be created. The GC returned can be freed with FreeScratchGC.
Details of Operation At screen initialization, a screen must supply a GC creation procedure. At GC creation, the screen must fill in GC funcs and GC ops vectors (Xserver/include/gcstruct.h). For any particular GC, the func vector must remain constant, while the op vector may vary. This invariant is to ensure that Wrappers work correctly. When a client request is processed that results in a change to the GC, the device-independent state of the GC is updated. This includes a record of the state that changed. Then the ChangeGC GC func is called. This is useful for graphics subsystems that are able to process state changes in parallel with the server CPU. DDX may opt not to take any action at GC-modify time. This is more efficient if multiple GC-modify requests occur between draws using a given GC. Validation occurs at the first draw operation that specifies the GC after that GC was modified. DIX calls then the ValidateGC GC func. DDX should then update its internal state. DDX internal state may be stored as one or more of the following: 1) device private block on the GC; 2) hardware state; 3) changes to the GC ops. The GC contains a serial number, which is loaded with a number fetched from the window that was drawn into the last time the GC was used. The serial number in the drawable is changed when the drawable's clipList or absCorner changes. Thus, by comparing the GC serial number with the drawable serial number, DIX can force a validate if the drawable has been changed since the last time it was used with this GC. In addition, the drawable serial number is always guaranteed to have the most significant bit set to 0. Thus, the DDX layer can set the most significant bit of the serial number to 1 in a GC to force a validate the next time the GC is used. DIX also uses this technique to indicate that a change has been made to the GC by way of a SetGC, a SetDashes or a SetClip request.
GC Handling Routines The ScreenRec data structure has a pointer for CreateGC().
Bool pScreen->CreateGC(pGC) GCPtr pGC;
This routine must fill in the fields of a dynamically allocated GC that is passed in. It does NOT allocate the GC record itself or fill in the defaults; DIX does that.
This must fill in both the GC funcs and ops; none of the drawing functions will be called before the GC has been validated, but the others (dealing with allocating of clip regions, changing and destroying the GC, etc.) might be. The GC funcs vector contains pointers to 7 routines and a devPrivate field:
pGC->funcs->ChangeGC(pGC, changes) GCPtr pGC; unsigned long changes;
This GC func is called immediately after a field in the GC is changed. changes is a bit mask indicating the changed fields of the GC in this request.
The ChangeGC routine is useful if you have a system where state-changes to the GC can be swallowed immediately by your graphics system, and a validate is not necessary.
pGC->funcs->ValidateGC(pGC, changes, pDraw) GCPtr pGC; unsigned long changes; DrawablePtr pDraw;
ValidateGC is called by DIX just before the GC will be used when one of many possible changes to the GC or the graphics system has happened. It can modify devPrivates data attached to the GC, change the op vector, or change hardware according to the values in the GC. It may not change the device-independent portion of the GC itself.
In almost all cases, your ValidateGC() procedure should take the regions that drawing needs to be clipped to and combine them into a composite clip region, which you keep a pointer to in the private part of the GC. In this way, your drawing primitive routines (and whatever is below them) can easily determine what to clip and where. You should combine the regions clientClip (the region that the client desires to clip output to) and the region returned by NotClippedByChildren(), in DIX. An example is in Xserver/fb/fbgc.c. Some kinds of extension software may cause this routine to be called more than originally intended; you should not rely on algorithms that will break under such circumstances. See the Strategies document for more information on creatively using this routine.
pGC->funcs->CopyGC(pGCSrc, mask, pGCDst) GCPtr pGCSrc; unsigned long mask; GCPtr pGCDst;
This routine is called by DIX when a GC is being copied to another GC. This is for situations where dynamically allocated chunks of memory are stored in the GC's dynamic devPrivates and need to be transferred to the destination GC.
pGC->funcs->DestroyGC(pGC) GCPtr pGC;
This routine is called before the GC is destroyed for the entity interested in this GC to clean up after itself. This routine is responsible for freeing any auxiliary storage allocated.
GC Clip Region Routines The GC clientClip field requires three procedures to manage it. These procedures are in the GC funcs vector. The underlying principle is that dix knows nothing about the internals of the clipping information, (except when it has come from the client), and so calls ddX whenever it needs to copy, set, or destroy such information. It could have been possible for dix not to allow ddX to touch the field in the GC, and require it to keep its own copy in devPriv, but since clip masks can be very large, this seems like a bad idea. Thus, the server allows ddX to do whatever it wants to the clientClip field of the GC, but requires it to do all manipulation itself.
void pGC->funcs->ChangeClip(pGC, type, pValue, nrects) GCPtr pGC; int type; char *pValue; int nrects;
This routine is called whenever the client changes the client clip region. The pGC points to the GC involved, the type tells what form the region has been sent in. If type is CT_NONE, then there is no client clip. If type is CT_UNSORTED, CT_YBANDED or CT_YXBANDED, then pValue pointer to a list of rectangles, nrects long. If type is CT_REGION, then pValue pointer to a RegionRec from the mi region code. If type is CT_PIXMAP pValue is a pointer to a pixmap. (The defines for CT_NONE, etc. are in Xserver/include/gc.h.) This routine is responsible for incrementing any necessary reference counts (e.g. for a pixmap clip mask) for the new clipmask and freeing anything that used to be in the GC's clipMask field. The lists of rectangles passed in can be freed with Xfree(), the regions can be destroyed with the RegionDestroy field in the screen, and pixmaps can be destroyed by calling the screen's DestroyPixmap function. DIX and MI code expect what they pass in to this to be freed or otherwise inaccessible, and will never look inside what's been put in the GC. This is a good place to be wary of storage leaks.
In the sample server, this routine transforms either the bitmap or the rectangle list into a region, so that future routines will have a more predictable starting point to work from. (The validate routine must take this client clip region and merge it with other regions to arrive at a composite clip region before any drawing is done.)
void pGC->funcs->DestroyClip(pGC) GCPtr pGC;
This routine is called whenever the client clip region must be destroyed. The pGC points to the GC involved. This call should set the clipType field of the GC to CT_NONE. In the sample server, the pointer to the client clip region is set to NULL by this routine after destroying the region, so that other software (including ChangeClip() above) will recognize that there is no client clip region.
void pGC->funcs->CopyClip(pgcDst, pgcSrc) GCPtr pgcDst, pgcSrc;
This routine makes a copy of the clipMask and clipType from pgcSrc into pgcDst. It is responsible for destroying any previous clipMask in pgcDst. The clip mask in the source can be the same as the clip mask in the dst (clients do the strangest things), so care must be taken when destroying things. This call is required because dix does not know how to copy the clip mask from pgcSrc.
Drawing Primitives The X protocol (rules for the byte stream that goes between client and server) does all graphics using primitive operations, which are called Drawing Primitives. These include line drawing, area filling, arcs, and text drawing. Your implementation must supply 16 routines to perform these on your hardware. (The number 16 is arbitrary.) More specifically, 16 procedure pointers are in each GC op vector. At any given time, ALL of them MUST point to a valid procedure that attempts to do the operation assigned, although the procedure pointers may change and may point to different procedures to carry out the same operation. A simple server will leave them all pointing to the same 16 routines, while a more optimized implementation will switch each from one procedure to another, depending upon what is most optimal for the current GC and drawable. The sample server contains a considerable chunk of code called the mi (machine independent) routines, which serve as drawing primitive routines. Many server implementations will be able to use these as-is, because they work for arbitrary depths. They make no assumptions about the formats of pixmaps and frame buffers, since they call a set of routines known as the "Pixblit Routines" (see next section). They do assume that the way to draw is through these low-level routines that apply pixel values rows at a time. If your hardware or firmware gives more performance when things are done differently, you will want to take this fact into account and rewrite some or all of the drawing primitives to fit your needs.
GC Components This section describes the fields in the GC that affect each drawing primitive. The only primitive that is not affected is GetImage, which does not use a GC because its destination is a protocol-style bit image. Since each drawing primitive mirrors exactly the X protocol request of the same name, you should refer to the X protocol specification document for more details. ALL of these routines MUST CLIP to the appropriate regions in the drawable. Since there are many regions to clip to simultaneously, your ValidateGC routine should combine these into a unified clip region to which your drawing routines can quickly refer. This is exactly what the fb routines supplied with the sample server do. The mi implementation passes responsibility for clipping while drawing down to the Pixblit routines. Also, all of them must adhere to the current plane mask. The plane mask has one bit for every bit plane in the drawable; only planes with 1 bits in the mask are affected by any drawing operation. All functions except for ImageText calls must obey the alu function. This is usually Copy, but could be any of the allowable 16 raster-ops. All of the functions, except for CopyArea, might use the current foreground and background pixel values. Each pixel value is 32 bits. These correspond to foreground and background colors, but you have to run them through the colormap to find out what color the pixel values represent. Do not worry about the color, just apply the pixel value. The routines that draw lines (PolyLine, PolySegment, PolyRect, and PolyArc) use the line width, line style, cap style, and join style. Line width is in pixels. The line style specifies whether it is solid or dashed, and what kind of dash. The cap style specifies whether Rounded, Butt, etc. The join style specifies whether joins between joined lines are Miter, Round or Beveled. When lines cross as part of the same polyline, they are assumed to be drawn once. (See the X protocol specification for more details.) Zero-width lines are NOT meant to be really zero width; this is the client's way of telling you that you can optimize line drawing with little regard to the end caps and joins. They are called "thin" lines and are meant to be one pixel wide. These are frequently done in hardware or in a streamlined assembly language routine. Lines with widths greater than zero, though, must all be drawn with the same algorithm, because client software assumes that every jag on every line at an angle will come at the same place. Two lines that should have one pixel in the space between them (because of their distance apart and their widths) should have such a one-pixel line of space between them if drawn, regardless of angle. The solid area fill routines (FillPolygon, PolyFillRect, PolyFillArc) all use the fill rule, which specifies subtle interpretations of what points are inside and what are outside of a given polygon. The PolyFillArc routine also uses the arc mode, which specifies whether to fill pie segments or single-edge slices of an ellipse. The line drawing, area fill, and PolyText routines must all apply the correct "fill style." This can be either a solid foreground color, a transparent stipple, an opaque stipple, or a tile. Stipples are bitmaps where the 1 bits represent that the foreground color is written, and 0 bits represent that either the pixel is left alone (transparent) or that the background color is written (opaque). A tile is a pixmap of the full depth of the GC that is applied in its full glory to all areas. The stipple and tile patterns can be any rectangular size, although some implementations will be faster for certain sizes such as 8x8 or 32x32. The mi implementation passes this responsibility down to the Pixblit routines. See the X protocol document for full details. The description of the CreateGC request has a very good, detailed description of these attributes.
The Primitives The Drawing Primitives are as follows:
RegionPtr pGC->ops->CopyArea(src, dst, pGC, srcx, srcy, w, h, dstx, dsty) DrawablePtr dst, src; GCPtr pGC; int srcx, srcy, w, h, dstx, dsty;
CopyArea copies a rectangle of pixels from one drawable to another of the same depth. To effect scrolling, this must be able to copy from any drawable to itself, overlapped. No squeezing or stretching is done because the source and destination are the same size. However, everything is still clipped to the clip regions of the destination drawable.
If pGC->graphicsExposures is True, any portions of the destination which were not valid in the source (either occluded by covering windows, or outside the bounds of the drawable) should be collected together and returned as a region (if this resultant region is empty, NULL can be returned instead). Furthermore, the invalid bits of the source are not copied to the destination and (when the destination is a window) are filled with the background tile. The sample routine miHandleExposures generates the appropriate return value and fills the invalid area using pScreen->PaintWindowBackground. For instance, imagine a window that is partially obscured by other windows in front of it. As text is scrolled on your window, the pixels that are scrolled out from under obscuring windows will not be available on the screen to copy to the right places, and so an exposure event must be sent for the client to correctly repaint them. Of course, if you implement backing store, you could do this without resorting to exposure events. An example implementation is fbCopyArea() in Xserver/fb/fbcopy.c.
RegionPtr pGC->ops->CopyPlane(src, dst, pGC, srcx, srcy, w, h, dstx, dsty, plane) DrawablePtr dst, src; GCPtr pGC; int srcx, srcy, w, h, dstx, dsty; unsigned long plane;
CopyPlane must copy one plane of a rectangle from the source drawable onto the destination drawable. Because this routine only copies one bit out of each pixel, it can copy between drawables of different depths. This is the only way of copying between drawables of different depths, except for copying bitmaps to pixmaps and applying foreground and background colors to it. All other conditions of CopyArea apply to CopyPlane too.
An example implementation is fbCopyPlane() in Xserver/fb/fbcopy.c.
void pGC->ops->PolyPoint(dst, pGC, mode, n, pPoint) DrawablePtr dst; GCPtr pGC; int mode; int n; DDXPointPtr pPoint;
PolyPoint draws a set of one-pixel dots (foreground color) at the locations given in the array. mode is one of the defined constants Origin (absolute coordinates) or Previous (each coordinate is relative to the last). Note that this does not use the background color or any tiles or stipples.
Example implementations are fbPolyPoint() in Xserver/fb/fbpoint.c and miPolyPoint in Xserver/mi/mipolypnt.c.
void pGC->ops->Polylines(dst, pGC, mode, n, pPoint) DrawablePtr dst; GCPtr pGC; int mode; int n; DDXPointPtr pPoint;
Similar to PolyPoint, Polylines draws lines between the locations given in the array. Zero-width lines are NOT meant to be really zero width; this is the client's way of telling you that you can maximally optimize line drawing with little regard to the end caps and joins. mode is one of the defined constants Previous or Origin, depending upon whether the points are each relative to the last or are absolute.
Example implementations are miWideLine() and miWideDash() in mi/miwideline.c and miZeroLine() in mi/mizerline.c.
void pGC->ops->PolySegment(dst, pGC, n, pPoint) DrawablePtr dst; GCPtr pGC; int n; xSegment *pSegments;
PolySegments draws unconnected lines between pairs of points in the array; the array must be of even size; no interconnecting lines are drawn.
An example implementation is miPolySegment() in mipolyseg.c.
void pGC->ops->PolyRectangle(dst, pGC, n, pRect) DrawablePtr dst; GCPtr pGC; int n; xRectangle *pRect;
PolyRectangle draws outlines of rectangles for each rectangle in the array.
An example implementation is miPolyRectangle() in Xserver/mi/mipolyrect.c.
void pGC->ops->PolyArc(dst, pGC, n, pArc) DrawablePtr dst; GCPtr pGC; int n; xArc*pArc;
PolyArc draws connected conic arcs according to the descriptions in the array. See the protocol specification for more details.
Example implementations are miZeroPolyArc in Xserver/mi/mizerarc. and miPolyArc() in Xserver/mi/miarc.c.
void pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pPoint) DrawablePtr dst; GCPtr pGC; int shape; int mode; int count; DDXPointPtr pPoint;
FillPolygon fills a polygon specified by the points in the array with the appropriate fill style. If necessary, an extra border line is assumed between the starting and ending lines. The shape can be used as a hint to optimize filling; it indicates whether it is convex (all interior angles less than 180), nonconvex (some interior angles greater than 180 but border does not cross itself), or complex (border crosses itself). You can choose appropriate algorithms or hardware based upon mode. mode is one of the defined constants Previous or Origin, depending upon whether the points are each relative to the last or are absolute.
An example implementation is miFillPolygon() in Xserver/mi/mipoly.c.
void pGC->ops->PolyFillRect(dst, pGC, n, pRect) DrawablePtr dst; GCPtr pGC; int n; xRectangle *pRect;
PolyFillRect fills multiple rectangles.
Example implementations are fbPolyFillRect() in Xserver/fb/fbfillrect.c and miPolyFillRect() in Xserver/mi/mifillrct.c.
void pGC->ops->PolyFillArc(dst, pGC, n, pArc) DrawablePtr dst; GCPtr pGC; int n; xArc *pArc;
PolyFillArc fills a shape for each arc in the list that is bounded by the arc and one or two line segments with the current fill style.
An example implementation is miPolyFillArc() in Xserver/mi/mifillarc.c.
void pGC->ops->PutImage(dst, pGC, depth, x, y, w, h, leftPad, format, pBinImage) DrawablePtr dst; GCPtr pGC; int x, y, w, h; int format; char *pBinImage;
PutImage copies a pixmap image into the drawable. The pixmap image must be in X protocol format (either Bitmap, XYPixmap, or ZPixmap), and format tells the format. (See the X protocol specification for details on these formats). You must be able to accept all three formats, because the client gets to decide which format to send. Either the drawable and the pixmap image have the same depth, or the source pixmap image must be a Bitmap. If a Bitmap, the foreground and background colors will be applied to the destination.
An example implementation is fbPutImage() in Xserver/fb/fbimage.c.
void pScreen->GetImage(src, x, y, w, h, format, planeMask, pBinImage) DrawablePtr src; int x, y, w, h; unsigned int format; unsigned long planeMask; char *pBinImage;
GetImage copies the bits from the source drawable into the destination pointer. The bits are written into the buffer according to the server-defined pixmap padding rules. pBinImage is guaranteed to be big enough to hold all the bits that must be written.
This routine does not correspond exactly to the X protocol GetImage request, since DIX has to break the reply up into buffers of a size requested by the transport layer. If format is ZPixmap, the bits are written in the ZFormat for the depth of the drawable; if there is a 0 bit in the planeMask for a particular plane, all pixels must have the bit in that plane equal to 0. If format is XYPixmap, planemask is guaranteed to have a single bit set; the bits should be written in Bitmap format, which is the format for a single plane of an XYPixmap. An example implementation is miGetImage() in Xserver/mi/mibitblt.c.
void pGC->ops->ImageText8(pDraw, pGC, x, y, count, chars) DrawablePtr pDraw; GCPtr pGC; int x, y; int count; char *chars;
ImageText8 draws text. The text is drawn in the foreground color; the background color fills the remainder of the character rectangles. The coordinates specify the baseline and start of the text.
An example implementation is miImageText8() in Xserver/mi/mipolytext.c.
int pGC->ops->PolyText8(pDraw, pGC, x, y, count, chars) DrawablePtr pDraw; GCPtr pGC; int x, y; int count; char *chars;
PolyText8 works like ImageText8, except it draws with the current fill style for special effects such as shaded text. See the X protocol specification for more details.
An example implementation is miPolyText8() in Xserver/mi/mipolytext.c.
int pGC->ops->PolyText16(pDraw, pGC, x, y, count, chars) DrawablePtr pDraw; GCPtr pGC; int x, y; int count; unsigned short *chars; void pGC->ops->ImageText16(pDraw, pGC, x, y, count, chars) DrawablePtr pDraw; GCPtr pGC; int x, y; int count; unsigned short *chars;
These two routines are the same as the "8" versions, except that they are for 16-bit character codes (useful for oriental writing systems).
The primary difference is in the way the character information is looked up. The 8-bit and the 16-bit versions obviously have different kinds of character values to look up; the main goal of the lookup is to provide a pointer to the CharInfo structs for the characters to draw and to pass these pointers to the Glyph routines. Given a CharInfo struct, lower-level software can draw the glyph desired with little concern for other characteristics of the font. 16-bit character fonts have a row-and-column scheme, where the 2bytes of the character code constitute the row and column in a square matrix of CharInfo structs. Each font has row and column minimum and maximum values; the CharInfo structures form a two-dimensional matrix. Example implementations are miPolyText16() and miImageText16() in Xserver/mi/mipolytext.c. See the X protocol specification for more details on these graphic operations. There is a hook in the GC ops, called LineHelper, that used to be used in the sample implementation by the code for wide lines. It no longer servers any purpose in the sample servers, but still exists, #ifdef'ed by NEED_LINEHELPER, in case someone needs it.
Pixblit Procedures The Drawing Primitive functions must be defined for your server. One possible way to do this is to use the mi routines from the sample server. If you choose to use the mi routines (even part of them!) you must implement these Pixblit routines. These routines read and write pixel values and deal directly with the image data. The Pixblit routines for the sample server are part of the "fb" routines. As with the mi routines, the fb routines are portable but are not as portable as the mi routines. The fb subsystem is a depth-independent framebuffer core, capable of operating at any depth from 1 to 32, based on the depth of the window or pixmap it is currently operating on. In particular, this means it can support pixmaps of multiple depths on the same screen. It supplies both Pixblit routines and higher-level optimized implementations of the Drawing Primitive routines. It does make the assumption that the pixel data it touches is available in the server's address space. In other words, if you have a "normal" frame buffer type display, you can probably use the fb code, and the mi code. If you have a stranger hardware, you will have to supply your own Pixblit routines, but you can use the mi routines on top of them. If you have better ways of doing some of the Drawing Primitive functions, then you may want to supply some of your own Drawing Primitive routines. (Even people who write their own Drawing Primitives save at least some of the mi code for certain special cases that their hardware or library or fancy algorithm does not handle.) The client, DIX, and the machine-independent routines do not carry the final responsibility of clipping. They all depend upon the Pixblit routines to do their clipping for them. The rule is, if you touch the frame buffer, you clip. (The higher level routines may decide to clip at a high level, but this is only for increased performance and cannot substitute for bottom-level clipping. For instance, the mi routines, DIX, or the client may decide to check all character strings to be drawn and chop off all characters that would not be displayed. If so, it must retain the character on the edge that is partly displayed so that the Pixblit routines can clip off precisely at the right place.) To make this easier, all of the reasons to clip can be combined into one region in your ValidateGC procedure. You take this composite clip region with you into the Pixblit routines. (The sample server does this.) Also, FillSpans() has to apply tile and stipple patterns. The patterns are all aligned to the window origin so that when two people write patches that are contiguous, they will merge nicely. (Really, they are aligned to the patOrg point in the GC. This defaults to (0, 0) but can be set by the client to anything.) However, the mi routines can translate (relocate) the points from window-relative to screen-relative if desired. If you set the miTranslate field in the GC (set it in the CreateGC or ValidateGC routine), then the mi output routines will translate all coordinates. If it is false, then the coordinates will be passed window-relative. Screens with no hardware translation will probably set miTranslate to TRUE, so that geometry (e.g. polygons, rectangles) can be translated, rather than having the resulting list of scanlines translated; this is good because the list vertices in a drawing request will generally be much smaller than the list of scanlines it produces. Similarly, hardware that does translation can set miTranslate to FALSE, and avoid the extra addition per vertex, which can be (but is not always) important for getting the highest possible performance. (Contrast the behavior of GetSpans, which is not expected to be called as often, and so has different constraints.) The miTranslate field is settable in each GC, if , for example, you are mixing several kinds of destinations (offscreen pixmaps, main memory pixmaps, backing store, and windows), all of which have different requirements, on one screen. As with other drawing routines, there are fields in the GC to direct higher code to the correct routine to execute for each function. In this way, you can optimize for special cases, for example, drawing solids versus drawing stipples. The Pixblit routines are broken up into three sets. The Span routines simply fill in rows of pixels. The Glyph routines fill in character glyphs. The PushPixels routine is a three-input bitblt for more sophisticated image creation. It turns out that the Glyph and PushPixels routines actually have a machine-independent implementation that depends upon the Span routines. If you are really pressed for time, you can use these versions, although they are quite slow.
Span Routines For these routines, all graphic operations have been reduced to "spans." A span is a horizontal row of pixels. If you can design these routines which write into and read from rows of pixels at a time, you can use the mi routines. Each routine takes a destination drawable to draw into, a GC to use while drawing, the number of spans to do, and two pointers to arrays that indicate the list of starting points and the list of widths of spans.
void pGC->ops->FillSpans(dst, pGC, nSpans, pPoints, pWidths, sorted) DrawablePtr dst; GCPtr pGC; int nSpans; DDXPointPtr pPoints; int *pWidths; int sorted;
FillSpans should fill horizontal rows of pixels with the appropriate patterns, stipples, etc., based on the values in the GC. The starting points are in the array at pPoints; the widths are in pWidths. If sorted is true, the scan lines are in increasing y order, in which case you may be able to make assumptions and optimizations.
GC components: alu, clipOrg, clientClip, and fillStyle. GC mode-dependent components: fgPixel (for fillStyle Solid); tile, patOrg (for fillStyle Tile); stipple, patOrg, fgPixel (for fillStyle Stipple); and stipple, patOrg, fgPixel and bgPixel (for fillStyle OpaqueStipple).
void pGC->ops->SetSpans(pDrawable, pGC, pSrc, ppt, pWidths, nSpans, sorted) DrawablePtr pDrawable; GCPtr pGC; char *pSrc; DDXPointPtr pPoints; int *pWidths; int nSpans; int sorted;
For each span, this routine should copy pWidths bits from pSrc to pDrawable at pPoints using the raster-op from the GC. If sorted is true, the scan lines are in increasing y order. The pixels in pSrc are padded according to the screen's padding rules. These can be used to support interesting extension libraries, for example, shaded primitives. It does not use the tile and stipple.
GC components: alu, clipOrg, and clientClip The above functions are expected to handle all modifiers in the current GC. Therefore, it is expedient to have different routines to quickly handle common special cases and reload the procedure pointers at validate time, as with the other output functions.
void pScreen->GetSpans(pDrawable, wMax, pPoints, pWidths, nSpans) DrawablePtr pDrawable; int wMax; DDXPointPtr pPoints; int *pWidths; int nSpans; char *pDst;
For each span, GetSpans gets bits from the drawable starting at pPoints and continuing for pWidths bits. Each scanline returned will be server-scanline padded. The routine can return NULL if memory cannot be allocated to hold the result.
GetSpans never translates -- for a window, the coordinates are already screen-relative. Consider the case of hardware that doesn't do translation: the mi code that calls ddX will translate each shape (rectangle, polygon,. etc.) before scan-converting it, which requires many fewer additions that having GetSpans translate each span does. Conversely, consider hardware that does translate: it can set its translation point to (0, 0) and get each span, and the only penalty is the small number of additions required to translate each shape being scan-converted by the calling code. Contrast the behavior of FillSpans and SetSpans (discussed above under miTranslate), which are expected to be used more often. Thus, the penalty to hardware that does hardware translation is negligible, and code that wants to call GetSpans() is greatly simplified, both for extensions and the machine-independent core implementation.
Glyph Routines The Glyph routines draw individual character glyphs for text drawing requests. You have a choice in implementing these routines. You can use the mi versions; they depend ultimately upon the span routines. Although text drawing will work, it will be very slow.
void pGC->ops->PolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) DrawablePtr pDrawable; GCPtr pGC; int x , y; unsigned int nglyph; CharInfoRec **ppci; /* array of character info */ pointer unused; /* unused since R5 */
GC components: alu, clipOrg, clientClip, font, and fillStyle.
GC mode-dependent components: fgPixel (for fillStyle Solid); tile, patOrg (for fillStyle Tile); stipple, patOrg, fgPixel (for fillStyle Stipple); and stipple, patOrg, fgPixel and bgPixel (for fillStyle OpaqueStipple).
void pGC->ops->ImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) DrawablePtr pDrawable; GCPtr pGC; int x , y; unsigned int nglyph; CharInfoRec **ppci; /* array of character info */ pointer unused; /* unused since R5 */
GC components: clipOrg, clientClip, font, fgPixel, bgPixel
These routines must copy the glyphs defined by the bitmaps in pglyphBase and the font metrics in ppci to the DrawablePtr, pDrawable. The poly routine follows all fill, stipple, and tile rules. The image routine simply blasts the glyph onto the glyph's rectangle, in foreground and background colors. More precisely, the Image routine fills the character rectangle with the background color, and then the glyph is applied in the foreground color. The glyph can extend outside of the character rectangle. ImageGlyph() is used for terminal emulators and informal text purposes such as button labels. The exact specification for the Poly routine is that the glyph is painted with the current fill style. The character rectangle is irrelevant for this operation. PolyText, at a higher level, includes facilities for font changes within strings and such; it is to be used for WYSIWYG word processing and similar systems. Both of these routines must clip themselves to the overall clipping region. Example implementations in mi are miPolyGlyphBlt() and miImageGlyphBlt() in Xserver/mi/miglblt.c.
PushPixels routine The PushPixels routine writes the current fill style onto the drawable in a certain shape defined by a bitmap. PushPixels is equivalent to using a second stipple. You can thing of it as pushing the fillStyle through a stencil. PushPixels is not used by any of the mi rendering code, but is used by the mi software cursor code.
Suppose the stencil is: 00111100 and the stipple is: 10101010 PushPixels result: 00101000
You have a choice in implementing this routine. You can use the mi version which depends ultimately upon FillSpans(). Although it will work, it will be slow.
void pGC->ops->PushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) GCPtr pGC; PixmapPtr pBitMap; DrawablePtr pDrawable; int dx, dy, xOrg, yOrg;
GC components: alu, clipOrg, clientClip, and fillStyle.
GC mode-dependent components: fgPixel (for fillStyle Solid); tile, patOrg (for fillStyle Tile); stipple, patOrg, fgPixel (for fillStyle Stipple); and stipple, patOrg, fgPixel and bgPixel (for fillStyle OpaqueStipple). PushPixels applys the foreground color, tile, or stipple from the pGC through a stencil onto pDrawable. pBitMap points to a stencil (of which we use an area dx wide by dy high), which is oriented over the drawable at xOrg, yOrg. Where there is a 1 bit in the bitmap, the destination is set according to the current fill style. Where there is a 0 bit in the bitmap, the destination is left the way it is. This routine must clip to the overall clipping region. An Example implementation is miPushPixels() in Xserver/mi/mipushpxl.c.
Shutdown Procedures
void AbortDDX(enum ExitCode error) void ddxGiveUp(enum ExitCode error)
Some hardware may require special work to be done before the server exits so that it is not left in an intermediate state. As explained in the OS layer, FatalError() will call AbortDDX() just before terminating the server. In addition, ddxGiveUp() will be called just before terminating the server on a "clean" death. What AbortDDX() and ddxGiveUP do is left unspecified, only that stubs must exist in the ddx layer. It is up to local implementors as to what they should accomplish before termination.
Command Line Procedures
int ddxProcessArgument(argc, argv, i) int argc; char *argv[]; int i; void ddxUseMsg()
You should write these routines to deal with device-dependent command line arguments. The routine ddxProcessArgument() is called with the command line, and the current index into argv; you should return zero if the argument is not a device-dependent one, and otherwise return a count of the number of elements of argv that are part of this one argument. For a typical option (e.g., "-realtime"), you should return the value one. This routine gets called before checks are made against device-independent arguments, so it is possible to peek at all arguments or to override device-independent argument processing. You can document the device-dependent arguments in ddxUseMsg(), which will be called from UseMsg() after printing out the device-independent arguments.
Wrappers and Privates 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, updated again for the 1.9 release and extended again for the 1.13 relealse.
devPrivates devPrivates provides a way to attach arbitrary private data to various server structures. Any structure which contains a devPrivates field of type PrivateRec supports this mechanism. Some structures allow allocating space for private data after some objects have been created, others require all space allocations be registered before any objects of that type are created. Xserver/include/privates.h lists which of these cases applies to each structure containing devPrivates. To request private space, use
Bool dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size);
The first argument is a pointer to a DevPrivateKeyRec which will serve as the unique identifier for the private data. Typically this is the address of a static DevPrivateKeyRec in your code. The second argument is the class of objects for which this key will apply. The third argument is the size of the space being requested, or 0 to only allocate a pointer that the caller will manage. If space is requested, this space will be automatically freed when the object is destroyed. Note that a call to dixSetPrivate that changes the pointer value may cause the space to be unreachable by the caller, however it will still be automatically freed. The function returns TRUE unless memory allocation fails. If the function is called more than once on the same key, all calls must use the same value for size or the server will abort.
To request per-screen private space in an object, use
Bool dixRegisterScreenPrivateKey(DevScreenPrivateKey key, ScreenPtr pScreen, DevPrivateType type, unsigned size);
The type and size arguments are the same as those to dixRegisterPrivateKey but this function ensures the given key exists on objects of 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:
void dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val)
The first argument is the address of the devPrivates field in the target structure. This field is managed privately by the DIX layer and should not be directly modified. The second argument is a pointer to the DevPrivateKeyRec which you registered with dixRegisterPrivateKey or allocated with dixCreatePrivateKey. Only one piece of data with a given key can be attached to an object, and in most cases each key is specific to the type of object it was registered for. (An exception is the PRIVATE_XSELINUX class which applies to multiple object types.) The third argument is the value to store.
If private data with the given key is already associated with the object, dixSetPrivate will overwrite the old value with the new one. To look up a piece of private data, use one of:
pointer dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key) pointer *dixLookupPrivateAddr(PrivateRec **privates, const DevPrivateKey key)
The first argument is the address of the devPrivates field in the target structure. The second argument is the key to look up. If a non-zero size was given when the key was registered, or if private data with the given key is already associated with the object, then dixLookupPrivate will return the pointer value while dixLookupPrivateAddr will return the address of the pointer.
When implementing new server resource objects that support devPrivates, there are four steps to perform: Add a type value to the DevPrivateType enum in Xserver/include/privates.h, declare a field of type PrivateRec * in your structure; initialize this field to NULL when creating any objects; and when freeing any objects call the dixFreePrivates or dixFreeObjectWithPrivates function.
Wrappers Wrappers are not a body of code, nor an interface spec. They are, instead, a technique for hooking a new module into an existing calling sequence. There are limitations on other portions of the server implementation which make using wrappers possible; limits on when specific fields of data structures may be modified. They are intended as a replacement for GCInterest queues, which were not general enough to support existing modules; in particular software cursors needed more control over the activity. The general mechanism for using wrappers is:
privateWrapperFunction (object, ...) ObjectPtr object; { pre-wrapped-function-stuff ... object->functionVector = dixLookupPrivate(&object->devPrivates, privateKey); (*object->functionVector) (object, ...); /* * this next line is occasionally required by the rules governing * wrapper functions. Always using it will not cause problems. * Not using it when necessary can cause severe troubles. */ dixSetPrivate(&object->devPrivates, privateKey, object->functionVector); object->functionVector = privateWrapperFunction; post-wrapped-function-stuff ... } privateInitialize (object) ObjectPtr object; { dixSetPrivate(&object->devPrivates, privateKey, object->functionVector); object->functionVector = privateWrapperFunction; }
Thus the privateWrapperFunction provides hooks for performing work both before and after the wrapped function has been called; the process of resetting the functionVector is called "unwrapping" while the process of fetching the wrapped function and replacing it with the wrapping function is called "wrapping". It should be clear that GCInterest queues could be emulated using wrappers. In general, any function vectors contained in objects can be wrapped, but only vectors in GCs and Screens have been tested. Wrapping screen functions is quite easy; each vector is individually wrapped. Screen functions are not supposed to change after initialization, so rewrapping is technically not necessary, but causes no problems. Wrapping GC functions is a bit more complicated. GC's have two tables of function vectors, one hanging from gc->ops and the other from gc->funcs, which should be initially wrapped from a CreateGC wrapper. Wrappers should modify only table pointers, not the contents of the tables, as they may be shared by more than one GC (and, in the case of funcs, are probably shared by all gcs). Your func wrappers may change the GC funcs or ops pointers, and op wrappers may change the GC op pointers but not the funcs. Thus, the rule for GC wrappings is: wrap the funcs from CreateGC and, in each func wrapper, unwrap the ops and funcs, call down, and re-wrap. In each op wrapper, unwrap the ops, call down, and rewrap afterwards. Note that in re-wrapping you must save out the pointer you're replacing again. This way the chain will be maintained when wrappers adjust the funcs/ops tables they use.
Work Queue To queue work for execution when all clients are in a stable state (i.e. just before calling select() in WaitForSomething), call:
Bool QueueWorkProc(function,client,closure) Bool (*function)(); ClientPtr client; pointer closure;
When the server is about to suspend itself, the given function will be executed:
(*function) (client, closure)
Neither client nor closure are actually used inside the work queue routines.
Summary of Routines This is a summary of the routines discussed in this document. The procedure names are in alphabetical order. The Struct is the structure it is attached to; if blank, this procedure is not attached to a struct and must be named as shown. The sample server provides implementations in the following categories. Notice that many of the graphics routines have both mi and fb implementations. dix portable to all systems; do not attempt to rewrite (Xserver/dix) os routine provided in Xserver/os or Xserver/include/os.h ddx frame buffer dependent (examples in Xserver/fb) mi routine provided in Xserver/mi hd hardware dependent (examples in many Xserver/hw directories) none not implemented in sample implementation Server Routines (Page 1) Procedure Port Struct ALLOCATE_LOCALosAbortDDXhdAddCallbackdixAddEnabledDeviceosAddInputDevicedixAddScreendixAdjustWaitForDelayosBellhdDeviceChangeClipmiGC funcChangeGCGC funcChangeWindowAttributesddxScreenClearToBackgroundddxWindowClientAuthorizedosClientSignaldixClientSleepdixClientWakeupdixClipNotifyddxScreenCloseScreenhdConstrainCursorhdScreenCopyAreamiGC opCopyGCDestddxGC funcCopyGCSourcenoneGC funcCopyPlanemiGC opCopyWindowddxWindowCreateGCddxScreenCreateCallbackListdixCreatePixmapddxScreenCreateScreenResourcesddxScreenCreateWellKnowSocketsosCreateWindowddxScreenCursorLimitshdScreenDEALLOCATE_LOCALosDeleteCallbackdixDeleteCallbackListdixDestroyClipddxGC funcDestroyGCddxGC funcDestroyPixmapddxScreenDestroyWindowddxScreenDisplayCursorhdScreenErrorosErrorFosFatalErrorosFillPolygonmiGC opFillSpansddxGC opFlushAllOutputosFlushIfCriticalOutputPendingosFreeScratchPixmapHeaderdixGetImagemiScreenGetMotionEventshdDeviceGetScratchPixmapHeaderdixGetSpansddxScreenGetStaticColormapddxScreen
Server Routines (Page 2) Procedure Port Struct ImageGlyphBltmiGC opImageText16miGC opImageText8miGC opInitInputhdInitKeyboardDeviceStructdixInitOutputhdInitPointerDeviceStructdixInsertFakeRequestosInstallColormapddxScreenIntersectmiScreenInversemiScreenLegalModifierhdLineHelpermiGC opListInstalledColormapsddxScreenLookupKeyboardDevicedixLookupPointerDevicedixModifyPixmapHeadermiScreenNextAvailableClientdixOsInitosPaintWindowBackgroundmiWindowPaintWindowBordermiWindowPointerNonInterestBoxhdScreenPointInRegionmiScreenPolyArcmiGC opPolyFillArcmiGC opPolyFillRectmiGC opPolyGlyphBltmiGC opPolylinesmiGC opPolyPointmiGC opPolyRectanglemiGC opPolySegmentmiGC opPolyText16miGC opPolyText8miGC opPositionWindowddxScreenProcessInputEventshdPushPixelsmiGC opPutImagemiGC opQueryBestSizehdScreenReadRequestFromClientosRealizeCursorhdScreenRealizeFontddxScreenRealizeWindowddxScreenRecolorCursorhdScreenRectInmiScreenRegionCopymiScreenRegionCreatemiScreenRegionDestroymiScreenRegionEmptymiScreenRegionExtentsmiScreenRegionNotEmptymiScreenRegionResetmiScreenResolveColorddxScreen
Server Routines (Page 3) Procedure Port Struct RemoveEnabledDeviceosResetCurrentRequestosSaveScreenddxScreenSetCriticalOutputPendingosSetCursorPositionhdScreenSetInputCheckdixSetSpansddxGC opStoreColorsddxScreenSubtractmiScreenTimerCancelosTimerCheckosTimerForceosTimerFreeosTimerInitosTimerSetosTimeSinceLastInputEventhdTranslateRegionmiScreenUninstallColormapddxScreenUnionmiScreenUnrealizeCursorhdScreenUnrealizeFontddxScreenUnrealizeWindowddxScreenValidateGCddxGC funcValidateTreemiScreenWaitForSomethingosWindowExposuresmiWindowWriteToClientosXallocosXfreeosXreallocos
xorg-server-1.17.1/doc/Makefile.in0000664000175100017510000007235412466505430013643 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # # Generate output formats for a single DocBook/XML with/without chapters # # Variables set by the calling Makefile: # noinst_DATA: developers docs are not installed # docbook: the main DocBook/XML file, no chapters, appendix or image files # chapters: all files pulled in by an XInclude statement and images. # # # This makefile is intended for Developers Documentation and is not installed. # Do not use for Users docs or Specs which need to be installed and require olink support # Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 # for an explanation on documents classification. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/devbook.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(am__dist_noinst_DATA_DIST) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_1 = $(docbook:.xml=.html) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@am__append_2 = $(docbook:.xml=.txt) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_3 = $(docbook:.xml=.pdf) $(docbook:.xml=.ps) subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 am__dist_noinst_DATA_DIST = Xserver-spec.xml Xinput.xml DATA = $(dist_noinst_DATA) $(noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = dtrace # Main DocBook/XML files (DOCTYPE book) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@docbook = Xserver-spec.xml Xinput.xml # Developers documnetation is not installed @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@noinst_DATA = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_1) \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_2) \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_3) # DocBook/XML file with chapters, appendix and images it includes @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@dist_noinst_DATA = $(docbook) $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@FILTER_XMLTO = $(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_HTML_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_FO_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --stringparam img.src.path=$(abs_builddir)/ \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@CLEANFILES = $(noinst_DATA) # Generate DocBook/XML output formats with or without stylesheets EXTRA_DIST = smartsched filter-xmlto.sh all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/devbook.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 doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/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_srcdir)/devbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< # 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: xorg-server-1.17.1/doc/dtrace/0000775000175100017510000000000012466505443013111 500000000000000xorg-server-1.17.1/doc/dtrace/Makefile.am0000664000175100017510000000053712160102336015053 00000000000000 if ENABLE_DOCS if XSERVER_DTRACE # Main DocBook/XML files (DOCTYPE book) docbook = Xserver-DTrace.xml # The location where the DocBook/XML files and their generated formats are installed shelfdir = $(docdir) # Generate DocBook/XML output formats with or without stylesheets include $(top_srcdir)/docbook.am endif XSERVER_DTRACE endif ENABLE_DOCS xorg-server-1.17.1/doc/dtrace/Xserver-DTrace.xml0000664000175100017510000006110612160102336016336 00000000000000 %defs; ]>
Xserver Provider for DTrace AlanCoopersmith Oracle Corporation Solaris Engineering X Server Version &xserver.version; 2005200620072010 Oracle and/or its affiliates. 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 (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. Introduction This page provides details on a statically defined user application tracing provider for the DTrace 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. DTrace probes may be used with SystemTap on GNU/Linux systems. The provider was integrated into the X.Org git master repository with Solaris 10 & OpenSolaris support for the Xserver 1.4 release, released in 2007 with X11R7.3. Support for DTrace on MacOS X was added in Xserver 1.7. These probes expose the request and reply structure of the X protocol between clients and the X server, so an understanding of that basic nature will aid in learning how to use these probes. Available probes Due to the way User-Defined DTrace probes work, arguments to these probes all bear undistinguished names of arg0, arg1, arg2, etc. These tables should help you determine what the real data is for each of the probe arguments. Probes and their arguments Probe name Description arg0 arg1 arg2 arg3 arg4 arg5 arg6 Request Probes request-start Called just before processing each client request. requestName requestCode requestLength clientId requestBuffer request-done Called just after processing each client request. requestName requestCode sequenceNumber clientId resultCode Event Probes send-event Called just before send each event to a client. clientId eventCode eventBuffer Client Connection Probes client-connect Called when a new connection is opened from a client clientId clientFD client-auth Called when client authenticates (normally just after connection opened) clientId clientAddr clientPid clientZoneId client-disconnect Called when a client connection is closed clientId Resource Allocation Probes resource-alloc Called when a new resource (pixmap, gc, colormap, etc.) is allocated resourceId resourceTypeId resourceValue resourceTypeName resource-free Called when a resource is freed resourceId resourceTypeId 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
Data Available in Probe Arguments To access data in arguments of type string, you will need to use copyinstr(). To access data buffers referenced via uintptr_t's, you will need to use copyin(). Probe Arguments Argument name Type Description clientAddr string String representing address client connected from clientFD int X server's file descriptor for server side of each connection clientId int Unique integer identifier for each connection to the X server clientPid pid_t Process id of client, if connection is local (from getpeerucred()) clientZoneId zoneid_t Solaris: Zone id of client, if connection is local (from getpeerucred()) eventBuffer uintptr_t Pointer to buffer containing X event - decode using structures in <X11/Xproto.h> and similar headers for each extension eventCode uint8_t Event number of X event resourceId uint32_t X resource id (XID) resourceTypeId uint32_t Resource type id resourceTypeName string String representing X resource type ("PIXMAP", etc.) resourceValue uintptr_t Pointer to data for X resource resultCode int Integer code representing result status of request requestBuffer uintptr_t Pointer to buffer containing X request - decode using structures in <X11/Xproto.h> and similar headers for each extension requestCode uint8_t Request number of X request or Extension requestName string Name of X request or Extension requestLength uint16_t Length of X request sequenceNumber uint32_t Number 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
Examples Counting requests by request name This script simply increments a counter for each different request made, and when you exit the script (such as by hitting ControlC ) prints the counts. #!/usr/sbin/dtrace -s Xserver*:::request-start { @counts[copyinstr(arg0)] = count(); } The output from a short run may appear as: QueryPointer 1 CreatePixmap 2 FreePixmap 2 PutImage 2 ChangeGC 10 CopyArea 10 CreateGC 14 FreeGC 14 RENDER 28 SetClipRectangles 40 This can be rewritten slightly to cache the string containing the name of the request since it will be reused many times, instead of copying it over and over from the kernel: #!/usr/sbin/dtrace -s string Xrequest[uintptr_t]; Xserver*:::request-start /Xrequest[arg0] == ""/ { Xrequest[arg0] = copyinstr(arg0); } Xserver*:::request-start { @counts[Xrequest[arg0]] = count(); } Get average CPU time per request This script records the CPU time used between the probes at the start and end of each request and aggregates it per request type. #!/usr/sbin/dtrace -s Xserver*:::request-start { reqstart = vtimestamp; } Xserver*:::request-done { @times[copyinstr(arg0)] = avg(vtimestamp - reqstart); } The output from a sample run might look like: ChangeGC 889 MapWindow 907 SetClipRectangles 1319 PolyPoint 1413 PolySegment 1434 PolyRectangle 1828 FreeCursor 1895 FreeGC 1950 CreateGC 2244 FreePixmap 2246 GetInputFocus 2249 TranslateCoords 8508 QueryTree 8846 GetGeometry 9948 CreatePixmap 12111 AllowEvents 14090 GrabServer 14791 MIT-SCREEN-SAVER 16747 ConfigureWindow 22917 SetInputFocus 28521 PutImage 240841 Monitoring clients that connect and disconnect This script simply prints information about each client that connects or disconnects from the server while it is running. Since the provider is specified as Xserver$1 instead of Xserver* like previous examples, it won't monitor all Xserver processes running on the machine, but instead expects the process id of the X server to monitor to be specified as the argument to the script. #!/usr/sbin/dtrace -s Xserver$1:::client-connect { printf("** Client Connect: id %d\n", arg0); } Xserver$1:::client-auth { printf("** Client auth'ed: id %d => %s pid %d\n", arg0, copyinstr(arg1), arg2); } Xserver$1:::client-disconnect { printf("** Client Disconnect: id %d\n", arg0); } A sample run: # ./foo.d 5790 dtrace: script './foo.d' matched 4 probes CPU ID FUNCTION:NAME 0 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 65 2 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64 0 15773 EstablishNewConnections:client-connect ** Client Connect: id 64 0 15772 AuthAudit:client-auth ** Client auth'ed: id 64 => local host pid 2034 0 15773 EstablishNewConnections:client-connect ** Client Connect: id 65 0 15772 AuthAudit:client-auth ** Client auth'ed: id 65 => local host pid 2034 0 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64 Monitoring clients creating Pixmaps This script can be used to determine which clients are creating pixmaps in the X server, printing information about each client as it connects to help trace it back to the program on the other end of the X connection. #!/usr/sbin/dtrace -qs string Xrequest[uintptr_t]; string Xrestype[uintptr_t]; Xserver$1:::request-start /Xrequest[arg0] == ""/ { Xrequest[arg0] = copyinstr(arg0); } Xserver$1:::resource-alloc /arg3 != 0 && Xrestype[arg3] == ""/ { Xrestype[arg3] = copyinstr(arg3); } Xserver$1:::request-start /Xrequest[arg0] == "X_CreatePixmap"/ { printf("-> %s: client %d\n", Xrequest[arg0], arg3); } Xserver$1:::request-done /Xrequest[arg0] == "X_CreatePixmap"/ { printf("<- %s: client %d\n", Xrequest[arg0], arg3); } Xserver$1:::resource-alloc /Xrestype[arg3] == "PIXMAP"/ { printf("** Pixmap alloc: %08x\n", arg0); } Xserver$1:::resource-free /Xrestype[arg3] == "PIXMAP"/ { printf("** Pixmap free: %08x\n", arg0); } Xserver$1:::client-connect { printf("** Client Connect: id %d\n", arg0); } Xserver$1:::client-auth { printf("** Client auth'ed: id %d => %s pid %d\n", arg0, copyinstr(arg1), arg2); } Xserver$1:::client-disconnect { printf("** Client Disconnect: id %d\n", arg0); } Sample output from a run of this script: ** Client Connect: id 17 ** Client auth'ed: id 17 => local host pid 20273 -> X_CreatePixmap: client 17 ** Pixmap alloc: 02200009 <- X_CreatePixmap: client 17 -> X_CreatePixmap: client 15 ** Pixmap alloc: 01e00180 <- X_CreatePixmap: client 15 -> X_CreatePixmap: client 15 ** Pixmap alloc: 01e00181 <- X_CreatePixmap: client 15 -> X_CreatePixmap: client 14 ** Pixmap alloc: 01c004c8 <- X_CreatePixmap: client 14 ** Pixmap free: 02200009 ** Client Disconnect: id 17 ** Pixmap free: 01e00180 ** Pixmap free: 01e00181 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 ::
xorg-server-1.17.1/doc/dtrace/Makefile.in0000664000175100017510000007572112466505430015106 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # # Generate output formats for a single DocBook/XML with/without chapters # # Variables set by the calling Makefile: # shelfdir: the location where the docs/specs are installed. Typically $(docdir) # docbook: the main DocBook/XML file, no chapters, appendix or image files # chapters: all files pulled in by an XInclude statement and images. # # # This makefile is intended for Users Documentation and Functional Specifications. # Do not use for Developer Documentation which is not installed and does not require olink. # Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 # for an explanation on documents classification. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/docbook.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(am__dist_shelf_DATA_DIST) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@am__append_1 = $(docbook:.xml=.html) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@am__append_2 = $(docbook:.xml=.txt) @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@am__append_3 = $(docbook:.xml=.pdf) \ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(docbook:.xml=.ps) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@am__append_4 = $(docbook:.xml=.html.db) \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(docbook:.xml=.pdf.db) subdir = doc/dtrace ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_shelf_DATA_DIST = Xserver-DTrace.xml 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)$(shelfdir)" "$(DESTDIR)$(shelfdir)" DATA = $(dist_shelf_DATA) $(shelf_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ # Main DocBook/XML files (DOCTYPE book) @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@docbook = Xserver-DTrace.xml # The location where the DocBook/XML files and their generated formats are installed @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@shelfdir = $(docdir) # DocBook/XML generated output formats to be installed @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@shelf_DATA = $(am__append_1) \ @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@ $(am__append_2) \ @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@ $(am__append_3) \ @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@ $(am__append_4) # DocBook/XML file with chapters, appendix and images it includes @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@dist_shelf_DATA = $(docbook) $(chapters) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_SEARCHPATH_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ --searchpath "$(abs_top_builddir)" @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_HTML_OLINK_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ --stringparam current.docid="$(<:.xml=)" @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_HTML_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(XMLTO_SEARCHPATH_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(XMLTO_HTML_STYLESHEET_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(XMLTO_HTML_OLINK_FLAGS) @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_PDF_OLINK_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ --stringparam current.docid="$(<:.xml=)" @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@XMLTO_FO_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(XMLTO_SEARCHPATH_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(XMLTO_FO_STYLESHEET_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(XMLTO_FO_IMAGEPATH_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(XMLTO_PDF_OLINK_FLAGS) # Generate documents cross-reference target databases @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@XSLT_SEARCHPATH_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ --path "$(XORG_SGML_PATH)/X11" \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ --path "$(abs_top_builddir)" @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@XSLT_OLINK_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ --stringparam targets.filename "$@" \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ --stringparam collect.xref.targets "only" \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ --stringparam olink.base.uri "$(@:.db=)" @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@XSLT_HTML_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(XSLT_SEARCHPATH_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(XSLT_OLINK_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ --nonet --xinclude \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@XSLT_PDF_FLAGS = \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(XSLT_SEARCHPATH_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(XSLT_OLINK_FLAGS) \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ --nonet --xinclude \ @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(STYLESHEET_SRCDIR)/xorg-fo.xsl @ENABLE_DOCS_TRUE@@XSERVER_DTRACE_TRUE@CLEANFILES = $(shelf_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/docbook.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 doc/dtrace/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/dtrace/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_srcdir)/docbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_shelfDATA: $(dist_shelf_DATA) @$(NORMAL_INSTALL) @list='$(dist_shelf_DATA)'; test -n "$(shelfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(shelfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(shelfdir)" || 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_DATA) $$files '$(DESTDIR)$(shelfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(shelfdir)" || exit $$?; \ done uninstall-dist_shelfDATA: @$(NORMAL_UNINSTALL) @list='$(dist_shelf_DATA)'; test -n "$(shelfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(shelfdir)'; $(am__uninstall_files_from_dir) install-shelfDATA: $(shelf_DATA) @$(NORMAL_INSTALL) @list='$(shelf_DATA)'; test -n "$(shelfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(shelfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(shelfdir)" || 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_DATA) $$files '$(DESTDIR)$(shelfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(shelfdir)" || exit $$?; \ done uninstall-shelfDATA: @$(NORMAL_UNINSTALL) @list='$(shelf_DATA)'; test -n "$(shelfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(shelfdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(shelfdir)" "$(DESTDIR)$(shelfdir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_shelfDATA install-shelfDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_shelfDATA uninstall-shelfDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_shelfDATA 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-shelfDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_shelfDATA uninstall-shelfDATA @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@%.html: %.xml $(chapters) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@%.txt: %.xml $(chapters) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@%.pdf: %.xml $(chapters) @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@%.ps: %.xml $(chapters) @ENABLE_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@XSERVER_DTRACE_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@%.html.db: %.xml $(chapters) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $< @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@%.pdf.db: %.xml $(chapters) @ENABLE_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@@XSERVER_DTRACE_TRUE@ $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $< # Generate DocBook/XML output formats with or without stylesheets # 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: xorg-server-1.17.1/compile0000755000175100017510000001624512460514302012372 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 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, see . # 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 # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= 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'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= 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 $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= 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 's|^.*[\\/]||; s|^[a-zA-Z]:||; 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 test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xorg-server-1.17.1/ltmain.sh0000644000175100017510000105203012460514275012636 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.11" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 xorg-server-1.17.1/docbook.am0000664000175100017510000000623112160102336012744 00000000000000# # Generate output formats for a single DocBook/XML with/without chapters # # Variables set by the calling Makefile: # shelfdir: the location where the docs/specs are installed. Typically $(docdir) # docbook: the main DocBook/XML file, no chapters, appendix or image files # chapters: all files pulled in by an XInclude statement and images. # # # This makefile is intended for Users Documentation and Functional Specifications. # Do not use for Developer Documentation which is not installed and does not require olink. # Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 # for an explanation on documents classification. # # DocBook/XML generated output formats to be installed shelf_DATA = # DocBook/XML file with chapters, appendix and images it includes dist_shelf_DATA = $(docbook) $(chapters) if HAVE_XMLTO if HAVE_STYLESHEETS XMLTO_SEARCHPATH_FLAGS = \ --searchpath "$(XORG_SGML_PATH)/X11" \ --searchpath "$(abs_top_builddir)" XMLTO_HTML_OLINK_FLAGS = \ --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \ --stringparam current.docid="$(<:.xml=)" XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl XMLTO_HTML_FLAGS = \ $(XMLTO_SEARCHPATH_FLAGS) \ $(XMLTO_HTML_STYLESHEET_FLAGS) \ $(XMLTO_HTML_OLINK_FLAGS) shelf_DATA += $(docbook:.xml=.html) %.html: %.xml $(chapters) $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< if HAVE_XMLTO_TEXT shelf_DATA += $(docbook:.xml=.txt) %.txt: %.xml $(chapters) $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< endif HAVE_XMLTO_TEXT if HAVE_FOP XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/ XMLTO_PDF_OLINK_FLAGS = \ --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \ --stringparam current.docid="$(<:.xml=)" XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl XMLTO_FO_FLAGS = \ $(XMLTO_SEARCHPATH_FLAGS) \ $(XMLTO_FO_STYLESHEET_FLAGS) \ $(XMLTO_FO_IMAGEPATH_FLAGS) \ $(XMLTO_PDF_OLINK_FLAGS) shelf_DATA += $(docbook:.xml=.pdf) %.pdf: %.xml $(chapters) $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< shelf_DATA += $(docbook:.xml=.ps) %.ps: %.xml $(chapters) $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< endif HAVE_FOP # Generate documents cross-reference target databases if HAVE_XSLTPROC XSLT_SEARCHPATH_FLAGS = \ --path "$(XORG_SGML_PATH)/X11" \ --path "$(abs_top_builddir)" XSLT_OLINK_FLAGS = \ --stringparam targets.filename "$@" \ --stringparam collect.xref.targets "only" \ --stringparam olink.base.uri "$(@:.db=)" XSLT_HTML_FLAGS = \ $(XSLT_SEARCHPATH_FLAGS) \ $(XSLT_OLINK_FLAGS) \ --nonet --xinclude \ $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl XSLT_PDF_FLAGS = \ $(XSLT_SEARCHPATH_FLAGS) \ $(XSLT_OLINK_FLAGS) \ --nonet --xinclude \ $(STYLESHEET_SRCDIR)/xorg-fo.xsl shelf_DATA += $(docbook:.xml=.html.db) %.html.db: %.xml $(chapters) $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $< shelf_DATA += $(docbook:.xml=.pdf.db) %.pdf.db: %.xml $(chapters) $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $< endif HAVE_XSLTPROC endif HAVE_STYLESHEETS endif HAVE_XMLTO CLEANFILES = $(shelf_DATA) xorg-server-1.17.1/miext/0000775000175100017510000000000012466505443012230 500000000000000xorg-server-1.17.1/miext/Makefile.am0000664000175100017510000000024012160102336014161 00000000000000SUBDIRS = sync damage shadow if XQUARTZ SUBDIRS += rootless endif if XWIN_MULTIWINDOWEXTWM SUBDIRS += rootless endif DIST_SUBDIRS = sync damage shadow rootless xorg-server-1.17.1/miext/damage/0000775000175100017510000000000012466505443013446 500000000000000xorg-server-1.17.1/miext/damage/Makefile.am0000664000175100017510000000031712200102654015402 00000000000000noinst_LTLIBRARIES = libdamage.la AM_CFLAGS = $(DIX_CFLAGS) AM_CPPFLAGS = -I$(srcdir)/../cw if XORG sdk_HEADERS = damage.h damagestr.h endif libdamage_la_SOURCES = \ damage.c \ damage.h \ damagestr.h xorg-server-1.17.1/miext/damage/damage.c0000664000175100017510000016015112456571574014763 00000000000000/* * Copyright © 2003 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 #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "damage.h" #include "damagestr.h" #define wrap(priv, real, mem, func) {\ priv->mem = real->mem; \ real->mem = func; \ } #define unwrap(priv, real, mem) {\ real->mem = priv->mem; \ } #define BOX_SAME(a,b) \ ((a)->x1 == (b)->x1 && \ (a)->y1 == (b)->y1 && \ (a)->x2 == (b)->x2 && \ (a)->y2 == (b)->y2) #define DAMAGE_VALIDATE_ENABLE 0 #define DAMAGE_DEBUG_ENABLE 0 #if DAMAGE_DEBUG_ENABLE #define DAMAGE_DEBUG(x) ErrorF x #else #define DAMAGE_DEBUG(x) #endif #define getPixmapDamageRef(pPixmap) ((DamagePtr *) \ dixLookupPrivateAddr(&(pPixmap)->devPrivates, damagePixPrivateKey)) #define pixmapDamage(pPixmap) damagePixPriv(pPixmap) static DevPrivateKeyRec damageScrPrivateKeyRec; #define damageScrPrivateKey (&damageScrPrivateKeyRec) static DevPrivateKeyRec damagePixPrivateKeyRec; #define damagePixPrivateKey (&damagePixPrivateKeyRec) static DevPrivateKeyRec damageGCPrivateKeyRec; #define damageGCPrivateKey (&damageGCPrivateKeyRec) static DevPrivateKeyRec damageWinPrivateKeyRec; #define damageWinPrivateKey (&damageWinPrivateKeyRec) static DamagePtr * getDrawableDamageRef(DrawablePtr pDrawable) { PixmapPtr pPixmap; if (WindowDrawable(pDrawable->type)) { ScreenPtr pScreen = pDrawable->pScreen; pPixmap = 0; if (pScreen->GetWindowPixmap #ifdef ROOTLESS_WORKAROUND && ((WindowPtr) pDrawable)->viewable #endif ) pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) pDrawable); if (!pPixmap) { damageScrPriv(pScreen); return &pScrPriv->pScreenDamage; } } else pPixmap = (PixmapPtr) pDrawable; return getPixmapDamageRef(pPixmap); } #define getDrawableDamage(pDrawable) (*getDrawableDamageRef (pDrawable)) #define getWindowDamage(pWin) getDrawableDamage(&(pWin)->drawable) #define drawableDamage(pDrawable) \ DamagePtr pDamage = getDrawableDamage(pDrawable) #define windowDamage(pWin) drawableDamage(&(pWin)->drawable) #define winDamageRef(pWindow) \ DamagePtr *pPrev = (DamagePtr *) \ dixLookupPrivateAddr(&(pWindow)->devPrivates, damageWinPrivateKey) #if DAMAGE_DEBUG_ENABLE static void _damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, int subWindowMode, const char *where) #define damageRegionAppend(d,r,c,m) _damageRegionAppend(d,r,c,m,__FUNCTION__) #else static void damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, int subWindowMode) #endif { ScreenPtr pScreen = pDrawable->pScreen; damageScrPriv(pScreen); drawableDamage(pDrawable); DamagePtr pNext; RegionRec clippedRec; RegionPtr pDamageRegion; RegionRec pixClip; int draw_x, draw_y; #ifdef COMPOSITE int screen_x = 0, screen_y = 0; #endif /* short circuit for empty regions */ if (!RegionNotEmpty(pRegion)) return; #ifdef COMPOSITE /* * When drawing to a pixmap which is storing window contents, * the region presented is in pixmap relative coordinates which * need to be converted to screen relative coordinates */ if (pDrawable->type != DRAWABLE_WINDOW) { screen_x = ((PixmapPtr) pDrawable)->screen_x - pDrawable->x; screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y; } if (screen_x || screen_y) RegionTranslate(pRegion, screen_x, screen_y); #endif if (pDrawable->type == DRAWABLE_WINDOW && ((WindowPtr) (pDrawable))->backingStore == NotUseful) { if (subWindowMode == ClipByChildren) { RegionIntersect(pRegion, pRegion, &((WindowPtr) (pDrawable))->clipList); } else if (subWindowMode == IncludeInferiors) { RegionPtr pTempRegion = NotClippedByChildren((WindowPtr) (pDrawable)); RegionIntersect(pRegion, pRegion, pTempRegion); RegionDestroy(pTempRegion); } /* If subWindowMode is set to an invalid value, don't perform * any drawable-based clipping. */ } RegionNull(&clippedRec); for (; pDamage; pDamage = pNext) { pNext = pDamage->pNext; /* * Check for internal damage and don't send events */ if (pScrPriv->internalLevel > 0 && !pDamage->isInternal) { DAMAGE_DEBUG(("non internal damage, skipping at %d\n", pScrPriv->internalLevel)); continue; } /* * Check for unrealized windows */ if (pDamage->pDrawable->type == DRAWABLE_WINDOW && !((WindowPtr) (pDamage->pDrawable))->realized) { continue; } draw_x = pDamage->pDrawable->x; draw_y = pDamage->pDrawable->y; #ifdef COMPOSITE /* * Need to move everyone to screen coordinates * XXX what about off-screen pixmaps with non-zero x/y? */ if (!WindowDrawable(pDamage->pDrawable->type)) { draw_x += ((PixmapPtr) pDamage->pDrawable)->screen_x; draw_y += ((PixmapPtr) pDamage->pDrawable)->screen_y; } #endif /* * Clip against border or pixmap bounds */ pDamageRegion = pRegion; if (clip || pDamage->pDrawable != pDrawable) { pDamageRegion = &clippedRec; if (pDamage->pDrawable->type == DRAWABLE_WINDOW) { RegionIntersect(pDamageRegion, pRegion, &((WindowPtr) (pDamage->pDrawable))-> borderClip); } else { BoxRec box; box.x1 = draw_x; box.y1 = draw_y; box.x2 = draw_x + pDamage->pDrawable->width; box.y2 = draw_y + pDamage->pDrawable->height; RegionInit(&pixClip, &box, 1); RegionIntersect(pDamageRegion, pRegion, &pixClip); RegionUninit(&pixClip); } /* * Short circuit empty results */ if (!RegionNotEmpty(pDamageRegion)) continue; } DAMAGE_DEBUG(("%s %d x %d +%d +%d (target 0x%lx monitor 0x%lx)\n", where, pDamageRegion->extents.x2 - pDamageRegion->extents.x1, pDamageRegion->extents.y2 - pDamageRegion->extents.y1, pDamageRegion->extents.x1, pDamageRegion->extents.y1, pDrawable->id, pDamage->pDrawable->id)); /* * Move region to target coordinate space */ if (draw_x || draw_y) RegionTranslate(pDamageRegion, -draw_x, -draw_y); /* Store damage region if needed after submission. */ if (pDamage->reportAfter) RegionUnion(&pDamage->pendingDamage, &pDamage->pendingDamage, pDamageRegion); /* Report damage now, if desired. */ if (!pDamage->reportAfter) { if (pDamage->damageReport) DamageReportDamage(pDamage, pDamageRegion); else RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); } /* * translate original region back */ if (pDamageRegion == pRegion && (draw_x || draw_y)) RegionTranslate(pDamageRegion, draw_x, draw_y); } #ifdef COMPOSITE if (screen_x || screen_y) RegionTranslate(pRegion, -screen_x, -screen_y); #endif RegionUninit(&clippedRec); } static void damageRegionProcessPending(DrawablePtr pDrawable) { drawableDamage(pDrawable); for (; pDamage != NULL; pDamage = pDamage->pNext) { if (pDamage->reportAfter) { /* It's possible that there is only interest in postRendering reporting. */ if (pDamage->damageReport) DamageReportDamage(pDamage, &pDamage->pendingDamage); else RegionUnion(&pDamage->damage, &pDamage->damage, &pDamage->pendingDamage); } if (pDamage->reportAfter) RegionEmpty(&pDamage->pendingDamage); } } #if DAMAGE_DEBUG_ENABLE #define damageDamageBox(d,b,m) _damageDamageBox(d,b,m,__FUNCTION__) static void _damageDamageBox(DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode, const char *where) #else static void damageDamageBox(DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) #endif { RegionRec region; RegionInit(®ion, pBox, 1); #if DAMAGE_DEBUG_ENABLE _damageRegionAppend(pDrawable, ®ion, TRUE, subWindowMode, where); #else damageRegionAppend(pDrawable, ®ion, TRUE, subWindowMode); #endif RegionUninit(®ion); } static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); static void damageChangeGC(GCPtr, unsigned long); static void damageCopyGC(GCPtr, unsigned long, GCPtr); static void damageDestroyGC(GCPtr); static void damageChangeClip(GCPtr, int, void *, int); static void damageDestroyClip(GCPtr); static void damageCopyClip(GCPtr, GCPtr); static GCFuncs damageGCFuncs = { damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC, damageChangeClip, damageDestroyClip, damageCopyClip }; static GCOps damageGCOps; static Bool damageCreateGC(GCPtr pGC) { ScreenPtr pScreen = pGC->pScreen; damageScrPriv(pScreen); damageGCPriv(pGC); Bool ret; unwrap(pScrPriv, pScreen, CreateGC); if ((ret = (*pScreen->CreateGC) (pGC))) { pGCPriv->ops = NULL; pGCPriv->funcs = pGC->funcs; pGC->funcs = &damageGCFuncs; } wrap(pScrPriv, pScreen, CreateGC, damageCreateGC); return ret; } #define DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable) \ damageGCPriv(pGC); \ const GCFuncs *oldFuncs = pGC->funcs; \ unwrap(pGCPriv, pGC, funcs); \ unwrap(pGCPriv, pGC, ops); \ #define DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable) \ wrap(pGCPriv, pGC, funcs, oldFuncs); \ wrap(pGCPriv, pGC, ops, &damageGCOps) #define DAMAGE_GC_FUNC_PROLOGUE(pGC) \ damageGCPriv(pGC); \ unwrap(pGCPriv, pGC, funcs); \ if (pGCPriv->ops) unwrap(pGCPriv, pGC, ops) #define DAMAGE_GC_FUNC_EPILOGUE(pGC) \ wrap(pGCPriv, pGC, funcs, &damageGCFuncs); \ if (pGCPriv->ops) wrap(pGCPriv, pGC, ops, &damageGCOps) static void damageValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ValidateGC) (pGC, changes, pDrawable); pGCPriv->ops = pGC->ops; /* just so it's not NULL */ DAMAGE_GC_FUNC_EPILOGUE(pGC); } static void damageDestroyGC(GCPtr pGC) { DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->DestroyGC) (pGC); DAMAGE_GC_FUNC_EPILOGUE(pGC); } static void damageChangeGC(GCPtr pGC, unsigned long mask) { DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ChangeGC) (pGC, mask); DAMAGE_GC_FUNC_EPILOGUE(pGC); } static void damageCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) { DAMAGE_GC_FUNC_PROLOGUE(pGCDst); (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); DAMAGE_GC_FUNC_EPILOGUE(pGCDst); } static void damageChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); DAMAGE_GC_FUNC_EPILOGUE(pGC); } static void damageCopyClip(GCPtr pgcDst, GCPtr pgcSrc) { DAMAGE_GC_FUNC_PROLOGUE(pgcDst); (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); DAMAGE_GC_FUNC_EPILOGUE(pgcDst); } static void damageDestroyClip(GCPtr pGC) { DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->DestroyClip) (pGC); DAMAGE_GC_FUNC_EPILOGUE(pGC); } #define TRIM_BOX(box, pGC) if (pGC->pCompositeClip) { \ BoxPtr extents = &pGC->pCompositeClip->extents;\ if(box.x1 < extents->x1) box.x1 = extents->x1; \ if(box.x2 > extents->x2) box.x2 = extents->x2; \ if(box.y1 < extents->y1) box.y1 = extents->y1; \ if(box.y2 > extents->y2) box.y2 = extents->y2; \ } #define TRANSLATE_BOX(box, pDrawable) { \ box.x1 += pDrawable->x; \ box.x2 += pDrawable->x; \ box.y1 += pDrawable->y; \ box.y2 += pDrawable->y; \ } #define TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC) { \ TRANSLATE_BOX(box, pDrawable); \ TRIM_BOX(box, pGC); \ } #define BOX_NOT_EMPTY(box) \ (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) #define checkGCDamage(d,g) (getDrawableDamage(d) && \ (!g->pCompositeClip ||\ RegionNotEmpty(g->pCompositeClip))) #define TRIM_PICTURE_BOX(box, pDst) { \ BoxPtr extents = &pDst->pCompositeClip->extents;\ if(box.x1 < extents->x1) box.x1 = extents->x1; \ if(box.x2 > extents->x2) box.x2 = extents->x2; \ if(box.y1 < extents->y1) box.y1 = extents->y1; \ if(box.y2 > extents->y2) box.y2 = extents->y2; \ } #define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ RegionNotEmpty(p->pCompositeClip)) static void damageComposite(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; PictureScreenPtr ps = GetPictureScreen(pScreen); damageScrPriv(pScreen); if (checkPictureDamage(pDst)) { BoxRec box; box.x1 = xDst + pDst->pDrawable->x; box.y1 = yDst + pDst->pDrawable->y; box.x2 = box.x1 + width; box.y2 = box.y1 + height; TRIM_PICTURE_BOX(box, pDst); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDst->pDrawable, &box, pDst->subWindowMode); } unwrap(pScrPriv, ps, Composite); (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); damageRegionProcessPending(pDst->pDrawable); wrap(pScrPriv, ps, Composite, damageComposite); } static void damageGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); damageScrPriv(pScreen); if (checkPictureDamage(pDst)) { int nlistTmp = nlist; GlyphListPtr listTmp = list; GlyphPtr *glyphsTmp = glyphs; int x, y; int n; GlyphPtr glyph; BoxRec box; int x1, y1, x2, y2; box.x1 = 32767; box.y1 = 32767; box.x2 = -32767; box.y2 = -32767; x = pDst->pDrawable->x; y = pDst->pDrawable->y; while (nlistTmp--) { x += listTmp->xOff; y += listTmp->yOff; n = listTmp->len; while (n--) { glyph = *glyphsTmp++; x1 = x - glyph->info.x; y1 = y - glyph->info.y; x2 = x1 + glyph->info.width; y2 = y1 + glyph->info.height; if (x1 < box.x1) box.x1 = x1; if (y1 < box.y1) box.y1 = y1; if (x2 > box.x2) box.x2 = x2; if (y2 > box.y2) box.y2 = y2; x += glyph->info.xOff; y += glyph->info.yOff; } listTmp++; } TRIM_PICTURE_BOX(box, pDst); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDst->pDrawable, &box, pDst->subWindowMode); } unwrap(pScrPriv, ps, Glyphs); (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); damageRegionProcessPending(pDst->pDrawable); wrap(pScrPriv, ps, Glyphs, damageGlyphs); } static void damageAddTraps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap * traps) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); damageScrPriv(pScreen); if (checkPictureDamage(pPicture)) { BoxRec box; int i; int x, y; xTrap *t = traps; box.x1 = 32767; box.y1 = 32767; box.x2 = -32767; box.y2 = -32767; x = pPicture->pDrawable->x + x_off; y = pPicture->pDrawable->y + y_off; for (i = 0; i < ntrap; i++) { pixman_fixed_t l = min(t->top.l, t->bot.l); pixman_fixed_t r = max(t->top.r, t->bot.r); int x1 = x + pixman_fixed_to_int(l); int x2 = x + pixman_fixed_to_int(pixman_fixed_ceil(r)); int y1 = y + pixman_fixed_to_int(t->top.y); int y2 = y + pixman_fixed_to_int(pixman_fixed_ceil(t->bot.y)); if (x1 < box.x1) box.x1 = x1; if (x2 > box.x2) box.x2 = x2; if (y1 < box.y1) box.y1 = y1; if (y2 > box.y2) box.y2 = y2; } TRIM_PICTURE_BOX(box, pPicture); if (BOX_NOT_EMPTY(box)) damageDamageBox(pPicture->pDrawable, &box, pPicture->subWindowMode); } unwrap(pScrPriv, ps, AddTraps); (*ps->AddTraps) (pPicture, x_off, y_off, ntrap, traps); damageRegionProcessPending(pPicture->pDrawable); wrap(pScrPriv, ps, AddTraps, damageAddTraps); } /**********************************************************/ static void damageFillSpans(DrawablePtr pDrawable, GC * pGC, int npt, DDXPointPtr ppt, int *pwidth, int fSorted) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (npt && checkGCDamage(pDrawable, pGC)) { int nptTmp = npt; DDXPointPtr pptTmp = ppt; int *pwidthTmp = pwidth; BoxRec box; box.x1 = pptTmp->x; box.x2 = box.x1 + *pwidthTmp; box.y2 = box.y1 = pptTmp->y; while (--nptTmp) { pptTmp++; pwidthTmp++; if (box.x1 > pptTmp->x) box.x1 = pptTmp->x; if (box.x2 < (pptTmp->x + *pwidthTmp)) box.x2 = pptTmp->x + *pwidthTmp; if (box.y1 > pptTmp->y) box.y1 = pptTmp->y; else if (box.y2 < pptTmp->y) box.y2 = pptTmp->y; } box.y2++; if (!pGC->miTranslate) { TRANSLATE_BOX(box, pDrawable); } TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->FillSpans) (pDrawable, pGC, npt, ppt, pwidth, fSorted); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damageSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pcharsrc, DDXPointPtr ppt, int *pwidth, int npt, int fSorted) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (npt && checkGCDamage(pDrawable, pGC)) { DDXPointPtr pptTmp = ppt; int *pwidthTmp = pwidth; int nptTmp = npt; BoxRec box; box.x1 = pptTmp->x; box.x2 = box.x1 + *pwidthTmp; box.y2 = box.y1 = pptTmp->y; while (--nptTmp) { pptTmp++; pwidthTmp++; if (box.x1 > pptTmp->x) box.x1 = pptTmp->x; if (box.x2 < (pptTmp->x + *pwidthTmp)) box.x2 = pptTmp->x + *pwidthTmp; if (box.y1 > pptTmp->y) box.y1 = pptTmp->y; else if (box.y2 < pptTmp->y) box.y2 = pptTmp->y; } box.y2++; if (!pGC->miTranslate) { TRANSLATE_BOX(box, pDrawable); } TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->SetSpans) (pDrawable, pGC, pcharsrc, ppt, pwidth, npt, fSorted); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (checkGCDamage(pDrawable, pGC)) { BoxRec box; box.x1 = x + pDrawable->x; box.x2 = box.x1 + w; box.y1 = y + pDrawable->y; box.y2 = box.y1 + h; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PutImage) (pDrawable, pGC, depth, x, y, w, h, leftPad, format, pImage); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static RegionPtr damageCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GC * pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { RegionPtr ret; DAMAGE_GC_OP_PROLOGUE(pGC, pDst); if (checkGCDamage(pDst, pGC)) { BoxRec box; box.x1 = dstx + pDst->x; box.x2 = box.x1 + width; box.y1 = dsty + pDst->y; box.y2 = box.y1 + height; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDst, &box, pGC->subWindowMode); } ret = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, width, height, dstx, dsty); damageRegionProcessPending(pDst); DAMAGE_GC_OP_EPILOGUE(pGC, pDst); return ret; } static RegionPtr damageCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bitPlane) { RegionPtr ret; DAMAGE_GC_OP_PROLOGUE(pGC, pDst); if (checkGCDamage(pDst, pGC)) { BoxRec box; box.x1 = dstx + pDst->x; box.x2 = box.x1 + width; box.y1 = dsty + pDst->y; box.y2 = box.y1 + height; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDst, &box, pGC->subWindowMode); } ret = (*pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); damageRegionProcessPending(pDst); DAMAGE_GC_OP_EPILOGUE(pGC, pDst); return ret; } static void damagePolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, xPoint * ppt) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (npt && checkGCDamage(pDrawable, pGC)) { BoxRec box; int nptTmp = npt; xPoint *pptTmp = ppt; box.x2 = box.x1 = pptTmp->x; box.y2 = box.y1 = pptTmp->y; /* this could be slow if the points were spread out */ while (--nptTmp) { pptTmp++; if (box.x1 > pptTmp->x) box.x1 = pptTmp->x; else if (box.x2 < pptTmp->x) box.x2 = pptTmp->x; if (box.y1 > pptTmp->y) box.y1 = pptTmp->y; else if (box.y2 < pptTmp->y) box.y2 = pptTmp->y; } box.x2++; box.y2++; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, ppt); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (npt && checkGCDamage(pDrawable, pGC)) { int nptTmp = npt; DDXPointPtr pptTmp = ppt; BoxRec box; int extra = pGC->lineWidth >> 1; box.x2 = box.x1 = pptTmp->x; box.y2 = box.y1 = pptTmp->y; if (nptTmp > 1) { if (pGC->joinStyle == JoinMiter) extra = 6 * pGC->lineWidth; else if (pGC->capStyle == CapProjecting) extra = pGC->lineWidth; } if (mode == CoordModePrevious) { int x = box.x1; int y = box.y1; while (--nptTmp) { pptTmp++; x += pptTmp->x; y += pptTmp->y; if (box.x1 > x) box.x1 = x; else if (box.x2 < x) box.x2 = x; if (box.y1 > y) box.y1 = y; else if (box.y2 < y) box.y2 = y; } } else { while (--nptTmp) { pptTmp++; if (box.x1 > pptTmp->x) box.x1 = pptTmp->x; else if (box.x2 < pptTmp->x) box.x2 = pptTmp->x; if (box.y1 > pptTmp->y) box.y1 = pptTmp->y; else if (box.y2 < pptTmp->y) box.y2 = pptTmp->y; } } box.x2++; box.y2++; if (extra) { box.x1 -= extra; box.x2 += extra; box.y1 -= extra; box.y2 += extra; } TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, ppt); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSeg, xSegment * pSeg) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (nSeg && checkGCDamage(pDrawable, pGC)) { BoxRec box; int extra = pGC->lineWidth; int nsegTmp = nSeg; xSegment *pSegTmp = pSeg; if (pGC->capStyle != CapProjecting) extra >>= 1; if (pSegTmp->x2 > pSegTmp->x1) { box.x1 = pSegTmp->x1; box.x2 = pSegTmp->x2; } else { box.x2 = pSegTmp->x1; box.x1 = pSegTmp->x2; } if (pSegTmp->y2 > pSegTmp->y1) { box.y1 = pSegTmp->y1; box.y2 = pSegTmp->y2; } else { box.y2 = pSegTmp->y1; box.y1 = pSegTmp->y2; } while (--nsegTmp) { pSegTmp++; if (pSegTmp->x2 > pSegTmp->x1) { if (pSegTmp->x1 < box.x1) box.x1 = pSegTmp->x1; if (pSegTmp->x2 > box.x2) box.x2 = pSegTmp->x2; } else { if (pSegTmp->x2 < box.x1) box.x1 = pSegTmp->x2; if (pSegTmp->x1 > box.x2) box.x2 = pSegTmp->x1; } if (pSegTmp->y2 > pSegTmp->y1) { if (pSegTmp->y1 < box.y1) box.y1 = pSegTmp->y1; if (pSegTmp->y2 > box.y2) box.y2 = pSegTmp->y2; } else { if (pSegTmp->y2 < box.y1) box.y1 = pSegTmp->y2; if (pSegTmp->y1 > box.y2) box.y2 = pSegTmp->y1; } } box.x2++; box.y2++; if (extra) { box.x1 -= extra; box.x2 += extra; box.y1 -= extra; box.y2 += extra; } TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolySegment) (pDrawable, pGC, nSeg, pSeg); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRects, xRectangle *pRects) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (nRects && checkGCDamage(pDrawable, pGC)) { BoxRec box; int offset1, offset2, offset3; int nRectsTmp = nRects; xRectangle *pRectsTmp = pRects; offset2 = pGC->lineWidth; if (!offset2) offset2 = 1; offset1 = offset2 >> 1; offset3 = offset2 - offset1; while (nRectsTmp--) { box.x1 = pRectsTmp->x - offset1; box.y1 = pRectsTmp->y - offset1; box.x2 = box.x1 + pRectsTmp->width + offset2; box.y2 = box.y1 + offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); box.x1 = pRectsTmp->x - offset1; box.y1 = pRectsTmp->y + offset3; box.x2 = box.x1 + offset2; box.y2 = box.y1 + pRectsTmp->height - offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); box.x1 = pRectsTmp->x + pRectsTmp->width - offset1; box.y1 = pRectsTmp->y + offset3; box.x2 = box.x1 + offset2; box.y2 = box.y1 + pRectsTmp->height - offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); box.x1 = pRectsTmp->x - offset1; box.y1 = pRectsTmp->y + pRectsTmp->height - offset1; box.x2 = box.x1 + pRectsTmp->width + offset2; box.y2 = box.y1 + offset2; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); pRectsTmp++; } } (*pGC->ops->PolyRectangle) (pDrawable, pGC, nRects, pRects); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (nArcs && checkGCDamage(pDrawable, pGC)) { int extra = pGC->lineWidth >> 1; BoxRec box; int nArcsTmp = nArcs; xArc *pArcsTmp = pArcs; box.x1 = pArcsTmp->x; box.x2 = box.x1 + pArcsTmp->width; box.y1 = pArcsTmp->y; box.y2 = box.y1 + pArcsTmp->height; while (--nArcsTmp) { pArcsTmp++; if (box.x1 > pArcsTmp->x) box.x1 = pArcsTmp->x; if (box.x2 < (pArcsTmp->x + pArcsTmp->width)) box.x2 = pArcsTmp->x + pArcsTmp->width; if (box.y1 > pArcsTmp->y) box.y1 = pArcsTmp->y; if (box.y2 < (pArcsTmp->y + pArcsTmp->height)) box.y2 = pArcsTmp->y + pArcsTmp->height; } if (extra) { box.x1 -= extra; box.x2 += extra; box.y1 -= extra; box.y2 += extra; } box.x2++; box.y2++; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyArc) (pDrawable, pGC, nArcs, pArcs); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damageFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode, int npt, DDXPointPtr ppt) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (npt > 2 && checkGCDamage(pDrawable, pGC)) { DDXPointPtr pptTmp = ppt; int nptTmp = npt; BoxRec box; box.x2 = box.x1 = pptTmp->x; box.y2 = box.y1 = pptTmp->y; if (mode != CoordModeOrigin) { int x = box.x1; int y = box.y1; while (--nptTmp) { pptTmp++; x += pptTmp->x; y += pptTmp->y; if (box.x1 > x) box.x1 = x; else if (box.x2 < x) box.x2 = x; if (box.y1 > y) box.y1 = y; else if (box.y2 < y) box.y2 = y; } } else { while (--nptTmp) { pptTmp++; if (box.x1 > pptTmp->x) box.x1 = pptTmp->x; else if (box.x2 < pptTmp->x) box.x2 = pptTmp->x; if (box.y1 > pptTmp->y) box.y1 = pptTmp->y; else if (box.y2 < pptTmp->y) box.y2 = pptTmp->y; } } box.x2++; box.y2++; TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, npt, ppt); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRects, xRectangle *pRects) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (nRects && checkGCDamage(pDrawable, pGC)) { BoxRec box; xRectangle *pRectsTmp = pRects; int nRectsTmp = nRects; box.x1 = pRectsTmp->x; box.x2 = box.x1 + pRectsTmp->width; box.y1 = pRectsTmp->y; box.y2 = box.y1 + pRectsTmp->height; while (--nRectsTmp) { pRectsTmp++; if (box.x1 > pRectsTmp->x) box.x1 = pRectsTmp->x; if (box.x2 < (pRectsTmp->x + pRectsTmp->width)) box.x2 = pRectsTmp->x + pRectsTmp->width; if (box.y1 > pRectsTmp->y) box.y1 = pRectsTmp->y; if (box.y2 < (pRectsTmp->y + pRectsTmp->height)) box.y2 = pRectsTmp->y + pRectsTmp->height; } TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyFillRect) (pDrawable, pGC, nRects, pRects); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (nArcs && checkGCDamage(pDrawable, pGC)) { BoxRec box; int nArcsTmp = nArcs; xArc *pArcsTmp = pArcs; box.x1 = pArcsTmp->x; box.x2 = box.x1 + pArcsTmp->width; box.y1 = pArcsTmp->y; box.y2 = box.y1 + pArcsTmp->height; while (--nArcsTmp) { pArcsTmp++; if (box.x1 > pArcsTmp->x) box.x1 = pArcsTmp->x; if (box.x2 < (pArcsTmp->x + pArcsTmp->width)) box.x2 = pArcsTmp->x + pArcsTmp->width; if (box.y1 > pArcsTmp->y) box.y1 = pArcsTmp->y; if (box.y2 < (pArcsTmp->y + pArcsTmp->height)) box.y2 = pArcsTmp->y + pArcsTmp->height; } TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PolyFillArc) (pDrawable, pGC, nArcs, pArcs); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } /* * general Poly/Image text function. Extract glyph information, * compute bounding box and remove cursor if it is overlapped. */ static void damageDamageChars(DrawablePtr pDrawable, FontPtr font, int x, int y, unsigned int n, CharInfoPtr * charinfo, Bool imageblt, int subWindowMode) { ExtentInfoRec extents; BoxRec box; QueryGlyphExtents(font, charinfo, n, &extents); if (imageblt) { if (extents.overallWidth > extents.overallRight) extents.overallRight = extents.overallWidth; if (extents.overallWidth < extents.overallLeft) extents.overallLeft = extents.overallWidth; if (extents.overallLeft > 0) extents.overallLeft = 0; if (extents.fontAscent > extents.overallAscent) extents.overallAscent = extents.fontAscent; if (extents.fontDescent > extents.overallDescent) extents.overallDescent = extents.fontDescent; } box.x1 = x + extents.overallLeft; box.y1 = y - extents.overallAscent; box.x2 = x + extents.overallRight; box.y2 = y + extents.overallDescent; damageDamageBox(pDrawable, &box, subWindowMode); } /* * values for textType: */ #define TT_POLY8 0 #define TT_IMAGE8 1 #define TT_POLY16 2 #define TT_IMAGE16 3 static void damageText(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned long count, char *chars, FontEncoding fontEncoding, Bool textType) { CharInfoPtr *charinfo; unsigned long i; unsigned int n; Bool imageblt; imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); if (!checkGCDamage(pDrawable, pGC)) return; charinfo = malloc(count * sizeof(CharInfoPtr)); if (!charinfo) return; GetGlyphs(pGC->font, count, (unsigned char *) chars, fontEncoding, &i, charinfo); n = (unsigned int) i; if (n != 0) { damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, n, charinfo, imageblt, pGC->subWindowMode); } free(charinfo); } static int damagePolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit, TT_POLY8); x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; } static int damagePolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, TT_POLY16); x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; } static void damageImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit, TT_IMAGE8); (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damageImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, TT_IMAGE16); (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damageImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, nglyph, ppci, TRUE, pGC->subWindowMode); (*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, nglyph, ppci, FALSE, pGC->subWindowMode); (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damagePushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); if (checkGCDamage(pDrawable, pGC)) { BoxRec box; box.x1 = xOrg; box.y1 = yOrg; if (!pGC->miTranslate) { box.x1 += pDrawable->x; box.y1 += pDrawable->y; } box.x2 = box.x1 + dx; box.y2 = box.y1 + dy; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) damageDamageBox(pDrawable, &box, pGC->subWindowMode); } (*pGC->ops->PushPixels) (pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } static void damageRemoveDamage(DamagePtr * pPrev, DamagePtr pDamage) { while (*pPrev) { if (*pPrev == pDamage) { *pPrev = pDamage->pNext; return; } pPrev = &(*pPrev)->pNext; } #if DAMAGE_VALIDATE_ENABLE ErrorF("Damage not on list\n"); OsAbort(); #endif } static void damageInsertDamage(DamagePtr * pPrev, DamagePtr pDamage) { #if DAMAGE_VALIDATE_ENABLE DamagePtr pOld; for (pOld = *pPrev; pOld; pOld = pOld->pNext) if (pOld == pDamage) { ErrorF("Damage already on list\n"); OsAbort(); } #endif pDamage->pNext = *pPrev; *pPrev = pDamage; } static Bool damageDestroyPixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; damageScrPriv(pScreen); if (pPixmap->refcnt == 1) { DamagePtr *pPrev = getPixmapDamageRef(pPixmap); DamagePtr pDamage; while ((pDamage = *pPrev)) { damageRemoveDamage(pPrev, pDamage); if (!pDamage->isWindow) DamageDestroy(pDamage); } } unwrap(pScrPriv, pScreen, DestroyPixmap); (*pScreen->DestroyPixmap) (pPixmap); wrap(pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); return TRUE; } static void damageCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWindow->drawable.pScreen; damageScrPriv(pScreen); if (getWindowDamage(pWindow)) { int dx = pWindow->drawable.x - ptOldOrg.x; int dy = pWindow->drawable.y - ptOldOrg.y; /* * The region comes in source relative, but the damage occurs * at the destination location. Translate back and forth. */ RegionTranslate(prgnSrc, dx, dy); damageRegionAppend(&pWindow->drawable, prgnSrc, FALSE, -1); RegionTranslate(prgnSrc, -dx, -dy); } unwrap(pScrPriv, pScreen, CopyWindow); (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); damageRegionProcessPending(&pWindow->drawable); wrap(pScrPriv, pScreen, CopyWindow, damageCopyWindow); } static GCOps damageGCOps = { damageFillSpans, damageSetSpans, damagePutImage, damageCopyArea, damageCopyPlane, damagePolyPoint, damagePolylines, damagePolySegment, damagePolyRectangle, damagePolyArc, damageFillPolygon, damagePolyFillRect, damagePolyFillArc, damagePolyText8, damagePolyText16, damageImageText8, damageImageText16, damageImageGlyphBlt, damagePolyGlyphBlt, damagePushPixels, }; static void damageSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap) { DamagePtr pDamage; ScreenPtr pScreen = pWindow->drawable.pScreen; damageScrPriv(pScreen); if ((pDamage = damageGetWinPriv(pWindow))) { PixmapPtr pOldPixmap = (*pScreen->GetWindowPixmap) (pWindow); DamagePtr *pPrev = getPixmapDamageRef(pOldPixmap); while (pDamage) { damageRemoveDamage(pPrev, pDamage); pDamage = pDamage->pNextWin; } } unwrap(pScrPriv, pScreen, SetWindowPixmap); (*pScreen->SetWindowPixmap) (pWindow, pPixmap); wrap(pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); if ((pDamage = damageGetWinPriv(pWindow))) { DamagePtr *pPrev = getPixmapDamageRef(pPixmap); while (pDamage) { damageInsertDamage(pPrev, pDamage); pDamage = pDamage->pNextWin; } } } static Bool damageDestroyWindow(WindowPtr pWindow) { DamagePtr pDamage; ScreenPtr pScreen = pWindow->drawable.pScreen; Bool ret; damageScrPriv(pScreen); while ((pDamage = damageGetWinPriv(pWindow))) { DamageDestroy(pDamage); } unwrap(pScrPriv, pScreen, DestroyWindow); ret = (*pScreen->DestroyWindow) (pWindow); wrap(pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); return ret; } static Bool damageCloseScreen(ScreenPtr pScreen) { damageScrPriv(pScreen); unwrap(pScrPriv, pScreen, DestroyPixmap); unwrap(pScrPriv, pScreen, CreateGC); unwrap(pScrPriv, pScreen, CopyWindow); unwrap(pScrPriv, pScreen, CloseScreen); free(pScrPriv); return (*pScreen->CloseScreen) (pScreen); } /** * Default implementations of the damage management functions. */ void 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 miDamageDestroy(DamagePtr pDamage) { } /** * Public functions for consumption outside this file. */ Bool DamageSetup(ScreenPtr pScreen) { DamageScrPrivPtr pScrPriv; PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); const DamageScreenFuncsRec miFuncs = { miDamageCreate, miDamageRegister, miDamageUnregister, miDamageDestroy }; if (!dixRegisterPrivateKey(&damageScrPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (dixLookupPrivate(&pScreen->devPrivates, damageScrPrivateKey)) return TRUE; if (!dixRegisterPrivateKey (&damageGCPrivateKeyRec, PRIVATE_GC, sizeof(DamageGCPrivRec))) return FALSE; if (!dixRegisterPrivateKey(&damagePixPrivateKeyRec, PRIVATE_PIXMAP, 0)) return FALSE; if (!dixRegisterPrivateKey(&damageWinPrivateKeyRec, PRIVATE_WINDOW, 0)) return FALSE; pScrPriv = malloc(sizeof(DamageScrPrivRec)); if (!pScrPriv) return FALSE; pScrPriv->internalLevel = 0; pScrPriv->pScreenDamage = 0; wrap(pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); wrap(pScrPriv, pScreen, CreateGC, damageCreateGC); wrap(pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); wrap(pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); wrap(pScrPriv, pScreen, CopyWindow, damageCopyWindow); wrap(pScrPriv, pScreen, CloseScreen, damageCloseScreen); if (ps) { wrap(pScrPriv, ps, Glyphs, damageGlyphs); wrap(pScrPriv, ps, Composite, damageComposite); wrap(pScrPriv, ps, AddTraps, damageAddTraps); } pScrPriv->funcs = miFuncs; dixSetPrivate(&pScreen->devPrivates, damageScrPrivateKey, pScrPriv); return TRUE; } DamagePtr DamageCreate(DamageReportFunc damageReport, DamageDestroyFunc damageDestroy, DamageReportLevel damageLevel, Bool isInternal, ScreenPtr pScreen, void *closure) { damageScrPriv(pScreen); DamagePtr pDamage; pDamage = dixAllocateObjectWithPrivates(DamageRec, PRIVATE_DAMAGE); if (!pDamage) return 0; pDamage->pNext = 0; pDamage->pNextWin = 0; RegionNull(&pDamage->damage); RegionNull(&pDamage->pendingDamage); pDamage->damageLevel = damageLevel; pDamage->isInternal = isInternal; pDamage->closure = closure; pDamage->isWindow = FALSE; pDamage->pDrawable = 0; pDamage->reportAfter = FALSE; pDamage->damageReport = damageReport; pDamage->damageDestroy = damageDestroy; pDamage->pScreen = pScreen; (*pScrPriv->funcs.Create) (pDamage); return pDamage; } void DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage) { ScreenPtr pScreen = pDrawable->pScreen; damageScrPriv(pScreen); #if DAMAGE_VALIDATE_ENABLE if (pDrawable->pScreen != pDamage->pScreen) { ErrorF("DamageRegister called with mismatched screens\n"); OsAbort(); } #endif if (pDrawable->type == DRAWABLE_WINDOW) { WindowPtr pWindow = (WindowPtr) pDrawable; winDamageRef(pWindow); #if DAMAGE_VALIDATE_ENABLE DamagePtr pOld; for (pOld = *pPrev; pOld; pOld = pOld->pNextWin) if (pOld == pDamage) { ErrorF("Damage already on window list\n"); OsAbort(); } #endif pDamage->pNextWin = *pPrev; *pPrev = pDamage; pDamage->isWindow = TRUE; } else pDamage->isWindow = FALSE; pDamage->pDrawable = pDrawable; damageInsertDamage(getDrawableDamageRef(pDrawable), pDamage); (*pScrPriv->funcs.Register) (pDrawable, pDamage); } void DamageDrawInternal(ScreenPtr pScreen, Bool enable) { damageScrPriv(pScreen); pScrPriv->internalLevel += enable ? 1 : -1; } void DamageUnregister(DamagePtr pDamage) { DrawablePtr pDrawable = pDamage->pDrawable; ScreenPtr pScreen = pDrawable->pScreen; damageScrPriv(pScreen); (*pScrPriv->funcs.Unregister) (pDrawable, pDamage); if (pDrawable->type == DRAWABLE_WINDOW) { WindowPtr pWindow = (WindowPtr) pDrawable; winDamageRef(pWindow); #if DAMAGE_VALIDATE_ENABLE int found = 0; #endif while (*pPrev) { if (*pPrev == pDamage) { *pPrev = pDamage->pNextWin; #if DAMAGE_VALIDATE_ENABLE found = 1; #endif break; } pPrev = &(*pPrev)->pNextWin; } #if DAMAGE_VALIDATE_ENABLE if (!found) { ErrorF("Damage not on window list\n"); OsAbort(); } #endif } pDamage->pDrawable = 0; damageRemoveDamage(getDrawableDamageRef(pDrawable), pDamage); } void DamageDestroy(DamagePtr pDamage) { ScreenPtr pScreen = pDamage->pScreen; damageScrPriv(pScreen); if (pDamage->pDrawable) DamageUnregister(pDamage); if (pDamage->damageDestroy) (*pDamage->damageDestroy) (pDamage, pDamage->closure); (*pScrPriv->funcs.Destroy) (pDamage); RegionUninit(&pDamage->damage); RegionUninit(&pDamage->pendingDamage); dixFreeObjectWithPrivates(pDamage, PRIVATE_DAMAGE); } Bool DamageSubtract(DamagePtr pDamage, const RegionPtr pRegion) { RegionPtr pClip; RegionRec pixmapClip; DrawablePtr pDrawable = pDamage->pDrawable; RegionSubtract(&pDamage->damage, &pDamage->damage, pRegion); if (pDrawable) { if (pDrawable->type == DRAWABLE_WINDOW) pClip = &((WindowPtr) pDrawable)->borderClip; else { BoxRec box; box.x1 = pDrawable->x; box.y1 = pDrawable->y; box.x2 = pDrawable->x + pDrawable->width; box.y2 = pDrawable->y + pDrawable->height; RegionInit(&pixmapClip, &box, 1); pClip = &pixmapClip; } RegionTranslate(&pDamage->damage, pDrawable->x, pDrawable->y); RegionIntersect(&pDamage->damage, &pDamage->damage, pClip); RegionTranslate(&pDamage->damage, -pDrawable->x, -pDrawable->y); if (pDrawable->type != DRAWABLE_WINDOW) RegionUninit(&pixmapClip); } return RegionNotEmpty(&pDamage->damage); } void DamageEmpty(DamagePtr pDamage) { RegionEmpty(&pDamage->damage); } RegionPtr DamageRegion(DamagePtr pDamage) { return &pDamage->damage; } RegionPtr DamagePendingRegion(DamagePtr pDamage) { return &pDamage->pendingDamage; } void DamageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion) { damageRegionAppend(pDrawable, pRegion, FALSE, -1); } void DamageRegionProcessPending(DrawablePtr pDrawable) { damageRegionProcessPending(pDrawable); } /* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */ void DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion) { damageRegionAppend(pDrawable, pRegion, FALSE, -1); /* Go back and report this damage for DamagePtrs with reportAfter set, since * this call isn't part of an in-progress drawing op in the call chain and * the DDX probably just wants to know about it right away. */ damageRegionProcessPending(pDrawable); } void DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter) { pDamage->reportAfter = reportAfter; } DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr pScreen) { damageScrPriv(pScreen); return &pScrPriv->funcs; } void DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion) { BoxRec tmpBox; RegionRec tmpRegion; Bool was_empty; switch (pDamage->damageLevel) { case DamageReportRawRegion: RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); break; case DamageReportDeltaRegion: RegionNull(&tmpRegion); RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage); if (RegionNotEmpty(&tmpRegion)) { RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); } RegionUninit(&tmpRegion); break; case DamageReportBoundingBox: tmpBox = *RegionExtents(&pDamage->damage); RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); if (!BOX_SAME(&tmpBox, RegionExtents(&pDamage->damage))) { (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); } break; case DamageReportNonEmpty: was_empty = !RegionNotEmpty(&pDamage->damage); RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); if (was_empty && RegionNotEmpty(&pDamage->damage)) { (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); } break; case DamageReportNone: RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); break; } } xorg-server-1.17.1/miext/damage/damage.h0000664000175100017510000000775712274325511014766 00000000000000/* * Copyright © 2003 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 #ifndef _DAMAGE_H_ #define _DAMAGE_H_ typedef struct _damage *DamagePtr; typedef enum _damageReportLevel { DamageReportRawRegion, DamageReportDeltaRegion, DamageReportBoundingBox, DamageReportNonEmpty, DamageReportNone } DamageReportLevel; typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion, void *closure); typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure); typedef void (*DamageScreenCreateFunc) (DamagePtr); typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr); typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr); typedef void (*DamageScreenDestroyFunc) (DamagePtr); typedef struct _damageScreenFuncs { DamageScreenCreateFunc Create; DamageScreenRegisterFunc Register; DamageScreenUnregisterFunc Unregister; DamageScreenDestroyFunc Destroy; } DamageScreenFuncsRec, *DamageScreenFuncsPtr; extern _X_EXPORT void miDamageCreate(DamagePtr); extern _X_EXPORT void miDamageRegister(DrawablePtr, DamagePtr); extern _X_EXPORT void miDamageUnregister(DrawablePtr, DamagePtr); extern _X_EXPORT void miDamageDestroy(DamagePtr); extern _X_EXPORT Bool DamageSetup(ScreenPtr pScreen); extern _X_EXPORT DamagePtr DamageCreate(DamageReportFunc damageReport, DamageDestroyFunc damageDestroy, DamageReportLevel damageLevel, Bool isInternal, ScreenPtr pScreen, void *closure); extern _X_EXPORT void DamageDrawInternal(ScreenPtr pScreen, Bool enable); extern _X_EXPORT void DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage); extern _X_EXPORT void DamageUnregister(DamagePtr pDamage); extern _X_EXPORT void DamageDestroy(DamagePtr pDamage); extern _X_EXPORT Bool DamageSubtract(DamagePtr pDamage, const RegionPtr pRegion); extern _X_EXPORT void DamageEmpty(DamagePtr pDamage); extern _X_EXPORT RegionPtr DamageRegion(DamagePtr pDamage); extern _X_EXPORT RegionPtr DamagePendingRegion(DamagePtr pDamage); /* In case of rendering, call this before the submitting the commands. */ extern _X_EXPORT void DamageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion); /* Call this directly after the rendering operation has been submitted. */ extern _X_EXPORT void DamageRegionProcessPending(DrawablePtr pDrawable); /* Call this when you create a new Damage and you wish to send an initial damage message (to it). */ extern _X_EXPORT void DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion); /* Avoid using this call, it only exists for API compatibility. */ extern _X_EXPORT void DamageDamageRegion(DrawablePtr pDrawable, const RegionPtr pRegion); extern _X_EXPORT void DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter); extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr); #endif /* _DAMAGE_H_ */ xorg-server-1.17.1/miext/damage/damagestr.h0000664000175100017510000000700212417557033015503 00000000000000/* * Copyright © 2003 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 #ifndef _DAMAGESTR_H_ #define _DAMAGESTR_H_ #include "damage.h" #include "gcstruct.h" #include "privates.h" #include "picturestr.h" typedef struct _damage { DamagePtr pNext; DamagePtr pNextWin; RegionRec damage; DamageReportLevel damageLevel; Bool isInternal; void *closure; Bool isWindow; DrawablePtr pDrawable; DamageReportFunc damageReport; DamageDestroyFunc damageDestroy; Bool reportAfter; RegionRec pendingDamage; /* will be flushed post submission at the latest */ ScreenPtr pScreen; PrivateRec *devPrivates; } DamageRec; typedef struct _damageScrPriv { int internalLevel; /* * For DDXen which don't provide GetScreenPixmap, this provides * a place to hook damage for windows on the screen */ DamagePtr pScreenDamage; CopyWindowProcPtr CopyWindow; CloseScreenProcPtr CloseScreen; CreateGCProcPtr CreateGC; DestroyPixmapProcPtr DestroyPixmap; SetWindowPixmapProcPtr SetWindowPixmap; DestroyWindowProcPtr DestroyWindow; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; AddTrapsProcPtr AddTraps; /* Table of wrappable function pointers */ DamageScreenFuncsRec funcs; } DamageScrPrivRec, *DamageScrPrivPtr; typedef struct _damageGCPriv { const GCOps *ops; const GCFuncs *funcs; } DamageGCPrivRec, *DamageGCPrivPtr; /* XXX should move these into damage.c, damageScrPrivateIndex is static */ #define damageGetScrPriv(pScr) ((DamageScrPrivPtr) \ dixLookupPrivate(&(pScr)->devPrivates, damageScrPrivateKey)) #define damageScrPriv(pScr) \ DamageScrPrivPtr pScrPriv = damageGetScrPriv(pScr) #define damageGetPixPriv(pPix) \ dixLookupPrivate(&(pPix)->devPrivates, damagePixPrivateKey) #define damgeSetPixPriv(pPix,v) \ dixSetPrivate(&(pPix)->devPrivates, damagePixPrivateKey, v) #define damagePixPriv(pPix) \ DamagePtr pDamage = damageGetPixPriv(pPix) #define damageGetGCPriv(pGC) \ dixLookupPrivate(&(pGC)->devPrivates, damageGCPrivateKey) #define damageGCPriv(pGC) \ DamageGCPrivPtr pGCPriv = damageGetGCPriv(pGC) #define damageGetWinPriv(pWin) \ ((DamagePtr)dixLookupPrivate(&(pWin)->devPrivates, damageWinPrivateKey)) #define damageSetWinPriv(pWin,d) \ dixSetPrivate(&(pWin)->devPrivates, damageWinPrivateKey, d) #endif /* _DAMAGESTR_H_ */ xorg-server-1.17.1/miext/damage/Makefile.in0000664000175100017510000006546712466505435015456 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/damage DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libdamage_la_LIBADD = am_libdamage_la_OBJECTS = damage.lo libdamage_la_OBJECTS = $(am_libdamage_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 = $(libdamage_la_SOURCES) DIST_SOURCES = $(libdamage_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = damage.h damagestr.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libdamage.la AM_CFLAGS = $(DIX_CFLAGS) AM_CPPFLAGS = -I$(srcdir)/../cw @XORG_TRUE@sdk_HEADERS = damage.h damagestr.h libdamage_la_SOURCES = \ damage.c \ damage.h \ damagestr.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/damage/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign miext/damage/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libdamage.la: $(libdamage_la_OBJECTS) $(libdamage_la_DEPENDENCIES) $(EXTRA_libdamage_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdamage_la_OBJECTS) $(libdamage_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/damage.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/miext/rootless/0000775000175100017510000000000012466505443014102 500000000000000xorg-server-1.17.1/miext/rootless/rootlessWindow.h0000664000175100017510000000507312274325511017233 00000000000000/* * Rootless window management */ /* * Copyright (c) 2001 Greg Parker. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _ROOTLESSWINDOW_H #define _ROOTLESSWINDOW_H #include "rootlessCommon.h" Bool RootlessCreateWindow(WindowPtr pWin); Bool RootlessDestroyWindow(WindowPtr pWin); void RootlessSetShape(WindowPtr pWin, int kind); Bool RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask); Bool RootlessPositionWindow(WindowPtr pWin, int x, int y); Bool RootlessRealizeWindow(WindowPtr pWin); Bool RootlessUnrealizeWindow(WindowPtr pWin); void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib); void RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); void RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind); void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib); void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent); void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width); #ifdef __APPLE__ void RootlessNativeWindowMoved(WindowPtr pWin); void RootlessNativeWindowStateChanged(WindowPtr pWin, unsigned int state); #endif #endif xorg-server-1.17.1/miext/rootless/Makefile.am0000664000175100017510000000046212160102336016041 00000000000000AM_CFLAGS = $(DIX_CFLAGS) $(XSERVER_CFLAGS) noinst_LTLIBRARIES = librootless.la librootless_la_SOURCES = \ rootlessCommon.c \ rootlessGC.c \ rootlessScreen.c \ rootlessValTree.c \ rootlessWindow.c EXTRA_DIST = \ README.txt \ rootless.h \ rootlessCommon.h \ rootlessConfig.h \ rootlessWindow.h xorg-server-1.17.1/miext/rootless/rootlessScreen.c0000664000175100017510000005177512274325511017210 00000000000000/* * Screen routines for generic rootless X server */ /* * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "mi.h" #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "propertyst.h" #include "mivalidate.h" #include "picturestr.h" #include "colormapst.h" #include #include #include #include #include "rootlessCommon.h" #include "rootlessWindow.h" /* In milliseconds */ #ifndef ROOTLESS_REDISPLAY_DELAY #define ROOTLESS_REDISPLAY_DELAY 10 #endif extern int RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild, VTKind kind); extern Bool RootlessCreateGC(GCPtr pGC); // Initialize globals DevPrivateKeyRec rootlessGCPrivateKeyRec; DevPrivateKeyRec rootlessScreenPrivateKeyRec; DevPrivateKeyRec rootlessWindowPrivateKeyRec; DevPrivateKeyRec rootlessWindowOldPixmapPrivateKeyRec; /* * RootlessUpdateScreenPixmap * miCreateScreenResources does not like a null framebuffer pointer, * it leaves the screen pixmap with an uninitialized data pointer. * Thus, rootless implementations typically set the framebuffer width * to zero so that miCreateScreenResources does not allocate a screen * pixmap for us. We allocate our own screen pixmap here since we need * the screen pixmap to be valid (e.g. CopyArea from the root window). */ void RootlessUpdateScreenPixmap(ScreenPtr pScreen) { RootlessScreenRec *s = SCREENREC(pScreen); PixmapPtr pPix; unsigned int rowbytes; pPix = (*pScreen->GetScreenPixmap) (pScreen); if (pPix == NULL) { pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, pScreen->rootDepth, 0); (*pScreen->SetScreenPixmap) (pPix); } rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth); if (s->pixmap_data_size < rowbytes) { free(s->pixmap_data); s->pixmap_data_size = rowbytes; s->pixmap_data = malloc(s->pixmap_data_size); if (s->pixmap_data == NULL) return; memset(s->pixmap_data, 0xFF, s->pixmap_data_size); pScreen->ModifyPixmapHeader(pPix, pScreen->width, pScreen->height, pScreen->rootDepth, BitsPerPixel(pScreen->rootDepth), 0, s->pixmap_data); /* ModifyPixmapHeader ignores zero arguments, so install rowbytes by hand. */ pPix->devKind = 0; } } /* * RootlessCreateScreenResources * Rootless implementations typically set a null framebuffer pointer, which * causes problems with miCreateScreenResources. We fix things up here. */ static Bool RootlessCreateScreenResources(ScreenPtr pScreen) { Bool ret = TRUE; SCREEN_UNWRAP(pScreen, CreateScreenResources); if (pScreen->CreateScreenResources != NULL) ret = (*pScreen->CreateScreenResources) (pScreen); SCREEN_WRAP(pScreen, CreateScreenResources); if (!ret) return ret; /* Make sure we have a valid screen pixmap. */ RootlessUpdateScreenPixmap(pScreen); return ret; } static Bool RootlessCloseScreen(ScreenPtr pScreen) { RootlessScreenRec *s; s = SCREENREC(pScreen); // fixme unwrap everything that was wrapped? pScreen->CloseScreen = s->CloseScreen; if (s->pixmap_data != NULL) { free(s->pixmap_data); s->pixmap_data = NULL; s->pixmap_data_size = 0; } free(s); return pScreen->CloseScreen(pScreen); } static void RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planeMask, char *pdstLine) { ScreenPtr pScreen = pDrawable->pScreen; SCREEN_UNWRAP(pScreen, GetImage); if (pDrawable->type == DRAWABLE_WINDOW) { int x0, y0, x1, y1; RootlessWindowRec *winRec; // Many apps use GetImage to sync with the visible frame buffer // FIXME: entire screen or just window or all screens? RootlessRedisplayScreen(pScreen); // RedisplayScreen stops drawing, so we need to start it again RootlessStartDrawing((WindowPtr) pDrawable); /* Check that we have some place to read from. */ winRec = WINREC(TopLevelParent((WindowPtr) pDrawable)); if (winRec == NULL) goto out; /* Clip to top-level window bounds. */ /* FIXME: fbGetImage uses the width parameter to calculate the stride of the destination pixmap. If w is clipped, the data returned will be garbage, although we will not crash. */ x0 = pDrawable->x + sx; y0 = pDrawable->y + sy; x1 = x0 + w; y1 = y0 + h; x0 = max(x0, winRec->x); y0 = max(y0, winRec->y); x1 = min(x1, winRec->x + winRec->width); y1 = min(y1, winRec->y + winRec->height); sx = x0 - pDrawable->x; sy = y0 - pDrawable->y; w = x1 - x0; h = y1 - y0; if (w <= 0 || h <= 0) goto out; } pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); out: SCREEN_WRAP(pScreen, GetImage); } /* * RootlessSourceValidate * CopyArea and CopyPlane use a GC tied to the destination drawable. * StartDrawing/StopDrawing wrappers won't be called if source is * a visible window but the destination isn't. So, we call StartDrawing * here and leave StopDrawing for the block handler. */ static void RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int subWindowMode) { SCREEN_UNWRAP(pDrawable->pScreen, SourceValidate); if (pDrawable->type == DRAWABLE_WINDOW) { WindowPtr pWin = (WindowPtr) pDrawable; RootlessStartDrawing(pWin); } if (pDrawable->pScreen->SourceValidate) { pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h, subWindowMode); } SCREEN_WRAP(pDrawable->pScreen, SourceValidate); } static void RootlessComposite(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; PictureScreenPtr ps = GetPictureScreen(pScreen); WindowPtr srcWin, dstWin, maskWin = NULL; if (pMask) { // pMask can be NULL maskWin = (pMask->pDrawable && pMask->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr) pMask->pDrawable : NULL; } srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr) pSrc->pDrawable : NULL; dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr) pDst->pDrawable : NULL; // SCREEN_UNWRAP(ps, Composite); ps->Composite = SCREENREC(pScreen)->Composite; if (srcWin && IsFramedWindow(srcWin)) RootlessStartDrawing(srcWin); if (maskWin && IsFramedWindow(maskWin)) RootlessStartDrawing(maskWin); if (dstWin && IsFramedWindow(dstWin)) RootlessStartDrawing(dstWin); ps->Composite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); if (dstWin && IsFramedWindow(dstWin)) { RootlessDamageRect(dstWin, xDst, yDst, width, height); } ps->Composite = RootlessComposite; // SCREEN_WRAP(ps, Composite); } static void RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); int x, y; int n; GlyphPtr glyph; WindowPtr srcWin, dstWin; srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr) pSrc->pDrawable : NULL; dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr) pDst->pDrawable : NULL; if (srcWin && IsFramedWindow(srcWin)) RootlessStartDrawing(srcWin); if (dstWin && IsFramedWindow(dstWin)) RootlessStartDrawing(dstWin); //SCREEN_UNWRAP(ps, Glyphs); ps->Glyphs = SCREENREC(pScreen)->Glyphs; ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); ps->Glyphs = RootlessGlyphs; //SCREEN_WRAP(ps, Glyphs); if (dstWin && IsFramedWindow(dstWin)) { x = xSrc; y = ySrc; while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; /* Calling DamageRect for the bounding box of each glyph is inefficient. So compute the union of all glyphs in a list and damage that. */ if (n > 0) { BoxRec box; glyph = *glyphs++; box.x1 = x - glyph->info.x; box.y1 = y - glyph->info.y; box.x2 = box.x1 + glyph->info.width; box.y2 = box.y1 + glyph->info.height; x += glyph->info.xOff; y += glyph->info.yOff; while (--n > 0) { short x1, y1, x2, y2; glyph = *glyphs++; x1 = x - glyph->info.x; y1 = y - glyph->info.y; x2 = x1 + glyph->info.width; y2 = y1 + glyph->info.height; box.x1 = max(box.x1, x1); box.y1 = max(box.y1, y1); box.x2 = max(box.x2, x2); box.y2 = max(box.y2, y2); x += glyph->info.xOff; y += glyph->info.yOff; } RootlessDamageBox(dstWin, &box); } list++; } } } /* * RootlessValidateTree * ValidateTree is modified in two ways: * - top-level windows don't clip each other * - windows aren't clipped against root. * These only matter when validating from the root. */ static int RootlessValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) { int result; RegionRec saveRoot; ScreenPtr pScreen = pParent->drawable.pScreen; SCREEN_UNWRAP(pScreen, ValidateTree); RL_DEBUG_MSG("VALIDATETREE start "); // Use our custom version to validate from root if (IsRoot(pParent)) { RL_DEBUG_MSG("custom "); result = RootlessMiValidateTree(pParent, pChild, kind); } else { HUGE_ROOT(pParent); result = pScreen->ValidateTree(pParent, pChild, kind); NORMAL_ROOT(pParent); } SCREEN_WRAP(pScreen, ValidateTree); RL_DEBUG_MSG("VALIDATETREE end\n"); return result; } /* * RootlessMarkOverlappedWindows * MarkOverlappedWindows is modified to ignore overlapping * top-level windows. */ static Bool RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin) { RegionRec saveRoot; Bool result; ScreenPtr pScreen = pWin->drawable.pScreen; SCREEN_UNWRAP(pScreen, MarkOverlappedWindows); RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS start "); HUGE_ROOT(pWin); if (IsRoot(pWin)) { // root - mark nothing RL_DEBUG_MSG("is root not marking "); result = FALSE; } else if (!IsTopLevel(pWin)) { // not top-level window - mark normally result = pScreen->MarkOverlappedWindows(pWin, pFirst, ppLayerWin); } else { //top-level window - mark children ONLY - NO overlaps with sibs (?) // This code copied from miMarkOverlappedWindows() register WindowPtr pChild; Bool anyMarked = FALSE; MarkWindowProcPtr MarkWindow = pScreen->MarkWindow; RL_DEBUG_MSG("is top level! "); /* single layered systems are easy */ if (ppLayerWin) *ppLayerWin = pWin; if (pWin == pFirst) { /* Blindly mark pWin and all of its inferiors. This is a slight * overkill if there are mapped windows that outside pWin's border, * but it's better than wasting time on RectIn checks. */ pChild = pWin; while (1) { if (pChild->viewable) { if (RegionBroken(&pChild->winSize)) SetWinSize(pChild); if (RegionBroken(&pChild->borderSize)) SetBorderSize(pChild); (*MarkWindow) (pChild); if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } anyMarked = TRUE; } if (anyMarked) (*MarkWindow) (pWin->parent); result = anyMarked; } NORMAL_ROOT(pWin); SCREEN_WRAP(pScreen, MarkOverlappedWindows); RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS end\n"); return result; } static void expose_1(WindowPtr pWin) { WindowPtr pChild; if (!pWin->realized) return; miPaintWindow(pWin, &pWin->borderClip, PW_BACKGROUND); /* FIXME: comments in windowstr.h indicate that borderClip doesn't include subwindow visibility. But I'm not so sure.. so we may be exposing too much.. */ miSendExposures(pWin, &pWin->borderClip, pWin->drawable.x, pWin->drawable.y); for (pChild = pWin->firstChild; pChild != NULL; pChild = pChild->nextSib) expose_1(pChild); } void RootlessScreenExpose(ScreenPtr pScreen) { expose_1(pScreen->root); } ColormapPtr RootlessGetColormap(ScreenPtr pScreen) { RootlessScreenRec *s = SCREENREC(pScreen); return s->colormap; } static void RootlessInstallColormap(ColormapPtr pMap) { ScreenPtr pScreen = pMap->pScreen; RootlessScreenRec *s = SCREENREC(pScreen); SCREEN_UNWRAP(pScreen, InstallColormap); if (s->colormap != pMap) { s->colormap = pMap; s->colormap_changed = TRUE; RootlessQueueRedisplay(pScreen); } pScreen->InstallColormap(pMap); SCREEN_WRAP(pScreen, InstallColormap); } static void RootlessUninstallColormap(ColormapPtr pMap) { ScreenPtr pScreen = pMap->pScreen; RootlessScreenRec *s = SCREENREC(pScreen); SCREEN_UNWRAP(pScreen, UninstallColormap); if (s->colormap == pMap) s->colormap = NULL; pScreen->UninstallColormap(pMap); SCREEN_WRAP(pScreen, UninstallColormap); } static void RootlessStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef) { ScreenPtr pScreen = pMap->pScreen; RootlessScreenRec *s = SCREENREC(pScreen); SCREEN_UNWRAP(pScreen, StoreColors); if (s->colormap == pMap && ndef > 0) { s->colormap_changed = TRUE; RootlessQueueRedisplay(pScreen); } pScreen->StoreColors(pMap, ndef, pdef); SCREEN_WRAP(pScreen, StoreColors); } static CARD32 RootlessRedisplayCallback(OsTimerPtr timer, CARD32 time, void *arg) { RootlessScreenRec *screenRec = arg; if (!screenRec->redisplay_queued) { /* No update needed. Stop the timer. */ screenRec->redisplay_timer_set = FALSE; return 0; } screenRec->redisplay_queued = FALSE; /* Mark that we should redisplay before waiting for I/O next time */ screenRec->redisplay_expired = TRUE; /* Reinstall the timer immediately, so we get as close to our redisplay interval as possible. */ return ROOTLESS_REDISPLAY_DELAY; } /* * RootlessQueueRedisplay * Queue a redisplay after a timer delay to ensure we do not redisplay * too frequently. */ void RootlessQueueRedisplay(ScreenPtr pScreen) { RootlessScreenRec *screenRec = SCREENREC(pScreen); screenRec->redisplay_queued = TRUE; if (screenRec->redisplay_timer_set) return; screenRec->redisplay_timer = TimerSet(screenRec->redisplay_timer, 0, ROOTLESS_REDISPLAY_DELAY, RootlessRedisplayCallback, screenRec); screenRec->redisplay_timer_set = TRUE; } /* * RootlessBlockHandler * If the redisplay timer has expired, flush drawing before blocking * on select(). */ static void RootlessBlockHandler(void *pbdata, OSTimePtr pTimeout, void *pReadmask) { ScreenPtr pScreen = pbdata; RootlessScreenRec *screenRec = SCREENREC(pScreen); if (screenRec->redisplay_expired) { screenRec->redisplay_expired = FALSE; RootlessRedisplayScreen(pScreen); } } static void RootlessWakeupHandler(void *data, int i, void *LastSelectMask) { // nothing here } static Bool RootlessAllocatePrivates(ScreenPtr pScreen) { RootlessScreenRec *s; if (!dixRegisterPrivateKey (&rootlessGCPrivateKeyRec, PRIVATE_GC, sizeof(RootlessGCRec))) return FALSE; if (!dixRegisterPrivateKey(&rootlessScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&rootlessWindowPrivateKeyRec, PRIVATE_WINDOW, 0)) return FALSE; if (!dixRegisterPrivateKey (&rootlessWindowOldPixmapPrivateKeyRec, PRIVATE_WINDOW, 0)) return FALSE; s = malloc(sizeof(RootlessScreenRec)); if (!s) return FALSE; SETSCREENREC(pScreen, s); s->pixmap_data = NULL; s->pixmap_data_size = 0; s->redisplay_timer = NULL; s->redisplay_timer_set = FALSE; return TRUE; } static void RootlessWrap(ScreenPtr pScreen) { RootlessScreenRec *s = SCREENREC(pScreen); #define WRAP(a) \ if (pScreen->a) { \ s->a = pScreen->a; \ } else { \ RL_DEBUG_MSG("null screen fn " #a "\n"); \ s->a = NULL; \ } \ pScreen->a = Rootless##a WRAP(CreateScreenResources); WRAP(CloseScreen); WRAP(CreateGC); WRAP(CopyWindow); WRAP(GetImage); WRAP(SourceValidate); WRAP(CreateWindow); WRAP(DestroyWindow); WRAP(RealizeWindow); WRAP(UnrealizeWindow); WRAP(MoveWindow); WRAP(PositionWindow); WRAP(ResizeWindow); WRAP(RestackWindow); WRAP(ReparentWindow); WRAP(ChangeBorderWidth); WRAP(MarkOverlappedWindows); WRAP(ValidateTree); WRAP(ChangeWindowAttributes); WRAP(InstallColormap); WRAP(UninstallColormap); WRAP(StoreColors); WRAP(SetShape); { // Composite and Glyphs don't use normal screen wrapping PictureScreenPtr ps = GetPictureScreen(pScreen); s->Composite = ps->Composite; ps->Composite = RootlessComposite; s->Glyphs = ps->Glyphs; ps->Glyphs = RootlessGlyphs; } // WRAP(ClearToBackground); fixme put this back? useful for shaped wins? #undef WRAP } /* * RootlessInit * Called by the rootless implementation to initialize the rootless layer. * Rootless wraps lots of stuff and needs a bunch of devPrivates. */ Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs) { RootlessScreenRec *s; if (!RootlessAllocatePrivates(pScreen)) return FALSE; s = SCREENREC(pScreen); s->imp = procs; s->colormap = NULL; s->redisplay_expired = FALSE; RootlessWrap(pScreen); if (!RegisterBlockAndWakeupHandlers(RootlessBlockHandler, RootlessWakeupHandler, (void *) pScreen)) { return FALSE; } return TRUE; } void RootlessUpdateRooted(Bool state) { int i; if (!state) { for (i = 0; i < screenInfo.numScreens; i++) RootlessDisableRoot(screenInfo.screens[i]); } else { for (i = 0; i < screenInfo.numScreens; i++) RootlessEnableRoot(screenInfo.screens[i]); } } xorg-server-1.17.1/miext/rootless/rootlessGC.c0000664000175100017510000012367512456571574016277 00000000000000/* * Graphics Context support for generic rootless X server */ /* * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include /* For NULL */ #include "mi.h" #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "dixfontstr.h" #include "mivalidate.h" #include "fb.h" #include #include #include #include "rootlessCommon.h" // GC functions static void RootlessValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); static void RootlessChangeGC(GCPtr pGC, unsigned long mask); static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void RootlessDestroyGC(GCPtr pGC); static void RootlessChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); static void RootlessDestroyClip(GCPtr pGC); static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc); Bool RootlessCreateGC(GCPtr pGC); GCFuncs rootlessGCFuncs = { RootlessValidateGC, RootlessChangeGC, RootlessCopyGC, RootlessDestroyGC, RootlessChangeClip, RootlessDestroyClip, RootlessCopyClip, }; // GC operations static void RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit, DDXPointPtr pptInit, int *pwidthInit, int sorted); static void RootlessSetSpans(DrawablePtr dst, GCPtr pGC, char *pSrc, DDXPointPtr pptInit, int *pwidthInit, int nspans, int sorted); static void RootlessPutImage(DrawablePtr dst, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pBits); static RegionPtr RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty); static RegionPtr RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long plane); static void RootlessPolyPoint(DrawablePtr dst, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit); static void RootlessPolylines(DrawablePtr dst, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit); static void RootlessPolySegment(DrawablePtr dst, GCPtr pGC, int nseg, xSegment * pSeg); static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC, int nRects, xRectangle *pRects); static void RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc * parcs); static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC, int shape, int mode, int count, DDXPointPtr pptInit); static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC, int nRectsInit, xRectangle *pRectsInit); static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC, int narcsInit, xArc * parcsInit); static int RootlessPolyText8(DrawablePtr dst, GCPtr pGC, int x, int y, int count, char *chars); static int RootlessPolyText16(DrawablePtr dst, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void RootlessImageText8(DrawablePtr dst, GCPtr pGC, int x, int y, int count, char *chars); static void RootlessImageText16(DrawablePtr dst, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyphInit, CharInfoPtr * ppciInit, void *unused); static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); static void RootlessPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst, int dx, int dy, int xOrg, int yOrg); static GCOps rootlessGCOps = { RootlessFillSpans, RootlessSetSpans, RootlessPutImage, RootlessCopyArea, RootlessCopyPlane, RootlessPolyPoint, RootlessPolylines, RootlessPolySegment, RootlessPolyRectangle, RootlessPolyArc, RootlessFillPolygon, RootlessPolyFillRect, RootlessPolyFillArc, RootlessPolyText8, RootlessPolyText16, RootlessImageText8, RootlessImageText16, RootlessImageGlyphBlt, RootlessPolyGlyphBlt, RootlessPushPixels }; /* If ROOTLESS_PROTECT_ALPHA is set, we have to make sure that the alpha channel of the on screen windows is always opaque. fb makes this harder than it would otherwise be by noticing that a planemask of 0x00ffffff includes all bits when depth==24, and so it "optimizes" the planemask to 0xffffffff. We work around this by temporarily setting depth=bpp while changing the GC. So the normal situation (in 32 bit mode) is that the planemask is 0x00ffffff and thus fb leaves the alpha channel alone. The rootless implementation is responsible for setting the alpha channel opaque initially. Unfortunately drawing with a planemask that doesn't have all bits set normally causes fb to fall off its fastest paths when blitting and filling. So we try to recognize when we can relax the planemask back to 0xffffffff, and do that for the duration of the drawing operation, setting the alpha channel in fg/bg pixels to opaque at the same time. We can do this when drawing op is GXcopy. We can also do this when copying from another window since its alpha channel must also be opaque. The three macros below are used to implement this. Drawing ops that can potentially have their planemask relaxed look like: OP { GC_SAVE(gc); GCOP_UNWRAP(gc); ... if (canAccelxxx(..) && otherwise-suitable) GC_UNSET_PM(gc, dst); gc->funcs->OP(gc, ...); GC_RESTORE(gc, dst); GCOP_WRAP(gc); } */ #define GC_SAVE(pGC) \ unsigned long _save_fg = (pGC)->fgPixel; \ unsigned long _save_bg = (pGC)->bgPixel; \ unsigned long _save_pm = (pGC)->planemask; \ Bool _changed = FALSE #define GC_RESTORE(pGC, pDraw) \ do { \ if (_changed) { \ unsigned int depth = (pDraw)->depth; \ (pGC)->fgPixel = _save_fg; \ (pGC)->bgPixel = _save_bg; \ (pGC)->planemask = _save_pm; \ (pDraw)->depth = (pDraw)->bitsPerPixel; \ VALIDATE_GC(pGC, GCForeground | GCBackground | \ GCPlaneMask, pDraw); \ (pDraw)->depth = depth; \ } \ } while (0) #define GC_UNSET_PM(pGC, pDraw) \ do { \ unsigned int mask = RootlessAlphaMask ((pDraw)->bitsPerPixel); \ if (((pGC)->planemask & mask) != mask) { \ unsigned int depth = (pDraw)->depth; \ (pGC)->fgPixel |= mask; \ (pGC)->bgPixel |= mask; \ (pGC)->planemask |= mask; \ (pDraw)->depth = (pDraw)->bitsPerPixel; \ VALIDATE_GC(pGC, GCForeground | \ GCBackground | GCPlaneMask, pDraw); \ (pDraw)->depth = depth; \ _changed = TRUE; \ } \ } while (0) #define VALIDATE_GC(pGC, changes, pDrawable) \ do { \ pGC->funcs->ValidateGC(pGC, changes, pDrawable); \ if (((WindowPtr) pDrawable)->viewable) { \ gcrec->originalOps = pGC->ops; \ } \ } while(0) static RootlessWindowRec * canAccelBlit(DrawablePtr pDraw, GCPtr pGC) { WindowPtr pTop; RootlessWindowRec *winRec; unsigned int pm; if (pGC->alu != GXcopy) return NULL; if (pDraw->type != DRAWABLE_WINDOW) return NULL; pm = ~RootlessAlphaMask(pDraw->bitsPerPixel); if ((pGC->planemask & pm) != pm) return NULL; pTop = TopLevelParent((WindowPtr) pDraw); if (pTop == NULL) return NULL; winRec = WINREC(pTop); if (winRec == NULL) return NULL; return winRec; } static inline RootlessWindowRec * canAccelFill(DrawablePtr pDraw, GCPtr pGC) { if (pGC->fillStyle != FillSolid) return NULL; return canAccelBlit(pDraw, pGC); } /* * Screen function to create a graphics context */ Bool RootlessCreateGC(GCPtr pGC) { RootlessGCRec *gcrec; RootlessScreenRec *s; Bool result; SCREEN_UNWRAP(pGC->pScreen, CreateGC); s = SCREENREC(pGC->pScreen); result = s->CreateGC(pGC); gcrec = (RootlessGCRec *) dixLookupPrivate(&pGC->devPrivates, rootlessGCPrivateKey); gcrec->originalOps = NULL; // don't wrap ops yet gcrec->originalFuncs = pGC->funcs; pGC->funcs = &rootlessGCFuncs; SCREEN_WRAP(pGC->pScreen, CreateGC); return result; } /* * GC funcs * * These wrap lower level GC funcs. * ValidateGC wraps the GC ops iff dest is viewable. * All the others just unwrap and call. */ // GCFUNC_UNRAP assumes funcs have been wrapped and // does not assume ops have been wrapped #define GCFUNC_UNWRAP(pGC) \ RootlessGCRec *gcrec = (RootlessGCRec *) \ dixLookupPrivate(&(pGC)->devPrivates, rootlessGCPrivateKey); \ (pGC)->funcs = gcrec->originalFuncs; \ if (gcrec->originalOps) { \ (pGC)->ops = gcrec->originalOps; \ } #define GCFUNC_WRAP(pGC) \ gcrec->originalFuncs = (pGC)->funcs; \ (pGC)->funcs = &rootlessGCFuncs; \ if (gcrec->originalOps) { \ gcrec->originalOps = (pGC)->ops; \ (pGC)->ops = &rootlessGCOps; \ } static void RootlessValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { GCFUNC_UNWRAP(pGC); gcrec->originalOps = NULL; if (pDrawable->type == DRAWABLE_WINDOW) { #ifdef ROOTLESS_PROTECT_ALPHA unsigned int depth = pDrawable->depth; // We force a planemask so fb doesn't overwrite the alpha channel. // Left to its own devices, fb will optimize away the planemask. pDrawable->depth = pDrawable->bitsPerPixel; pGC->planemask &= ~RootlessAlphaMask(pDrawable->bitsPerPixel); VALIDATE_GC(pGC, changes | GCPlaneMask, pDrawable); pDrawable->depth = depth; #else VALIDATE_GC(pGC, changes, pDrawable); #endif } else { pGC->funcs->ValidateGC(pGC, changes, pDrawable); } GCFUNC_WRAP(pGC); } static void RootlessChangeGC(GCPtr pGC, unsigned long mask) { GCFUNC_UNWRAP(pGC); pGC->funcs->ChangeGC(pGC, mask); GCFUNC_WRAP(pGC); } static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) { GCFUNC_UNWRAP(pGCDst); pGCDst->funcs->CopyGC(pGCSrc, mask, pGCDst); GCFUNC_WRAP(pGCDst); } static void RootlessDestroyGC(GCPtr pGC) { GCFUNC_UNWRAP(pGC); pGC->funcs->DestroyGC(pGC); GCFUNC_WRAP(pGC); } static void RootlessChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { GCFUNC_UNWRAP(pGC); pGC->funcs->ChangeClip(pGC, type, pvalue, nrects); GCFUNC_WRAP(pGC); } static void RootlessDestroyClip(GCPtr pGC) { GCFUNC_UNWRAP(pGC); pGC->funcs->DestroyClip(pGC); GCFUNC_WRAP(pGC); } static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc) { GCFUNC_UNWRAP(pgcDst); pgcDst->funcs->CopyClip(pgcDst, pgcSrc); GCFUNC_WRAP(pgcDst); } /* * GC ops * * We can't use shadowfb because shadowfb assumes one pixmap * and our root window is a special case. * However, much of this code is copied from shadowfb. */ // assumes both funcs and ops are wrapped #define GCOP_UNWRAP(pGC) \ RootlessGCRec *gcrec = (RootlessGCRec *) \ dixLookupPrivate(&(pGC)->devPrivates, rootlessGCPrivateKey); \ GCFuncs *saveFuncs = pGC->funcs; \ (pGC)->funcs = gcrec->originalFuncs; \ (pGC)->ops = gcrec->originalOps; #define GCOP_WRAP(pGC) \ gcrec->originalOps = (pGC)->ops; \ (pGC)->funcs = saveFuncs; \ (pGC)->ops = &rootlessGCOps; static void RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit, DDXPointPtr pptInit, int *pwidthInit, int sorted) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("fill spans start "); if (nInit <= 0) { pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted); } else { DDXPointPtr ppt = pptInit; int *pwidth = pwidthInit; int i = nInit; BoxRec box; box.x1 = ppt->x; box.x2 = box.x1 + *pwidth; box.y2 = box.y1 = ppt->y; while (--i) { ppt++; pwidth++; if (box.x1 > ppt->x) box.x1 = ppt->x; if (box.x2 < (ppt->x + *pwidth)) box.x2 = ppt->x + *pwidth; if (box.y1 > ppt->y) box.y1 = ppt->y; else if (box.y2 < ppt->y) box.y2 = ppt->y; } box.y2++; RootlessStartDrawing((WindowPtr) dst); if (canAccelFill(dst, pGC)) { GC_UNSET_PM(pGC, dst); } pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted); TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("fill spans end\n"); } static void RootlessSetSpans(DrawablePtr dst, GCPtr pGC, char *pSrc, DDXPointPtr pptInit, int *pwidthInit, int nspans, int sorted) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("set spans start "); if (nspans <= 0) { pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit, nspans, sorted); } else { DDXPointPtr ppt = pptInit; int *pwidth = pwidthInit; int i = nspans; BoxRec box; box.x1 = ppt->x; box.x2 = box.x1 + *pwidth; box.y2 = box.y1 = ppt->y; while (--i) { ppt++; pwidth++; if (box.x1 > ppt->x) box.x1 = ppt->x; if (box.x2 < (ppt->x + *pwidth)) box.x2 = ppt->x + *pwidth; if (box.y1 > ppt->y) box.y1 = ppt->y; else if (box.y2 < ppt->y) box.y2 = ppt->y; } box.y2++; RootlessStartDrawing((WindowPtr) dst); pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit, nspans, sorted); TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GCOP_WRAP(pGC); RL_DEBUG_MSG("set spans end\n"); } static void RootlessPutImage(DrawablePtr dst, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pBits) { BoxRec box; GCOP_UNWRAP(pGC); RL_DEBUG_MSG("put image start "); RootlessStartDrawing((WindowPtr) dst); pGC->ops->PutImage(dst, pGC, depth, x, y, w, h, leftPad, format, pBits); box.x1 = x + dst->x; box.x2 = box.x1 + w; box.y1 = y + dst->y; box.y2 = box.y1 + h; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); GCOP_WRAP(pGC); RL_DEBUG_MSG("put image end\n"); } /* changed area is *dest* rect */ static RegionPtr RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty) { RegionPtr result; BoxRec box; GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst); if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr) pSrc)) { /* If both source and dest are windows, and we're doing a simple copy operation, we can remove the alpha-protecting planemask (since source has opaque alpha as well) */ if (canAccelBlit(pSrc, pGC)) { GC_UNSET_PM(pGC, dst); } RootlessStartDrawing((WindowPtr) pSrc); } RootlessStartDrawing((WindowPtr) dst); result = pGC->ops->CopyArea(pSrc, dst, pGC, srcx, srcy, w, h, dstx, dsty); box.x1 = dstx + dst->x; box.x2 = box.x1 + w; box.y1 = dsty + dst->y; box.y2 = box.y1 + h; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("copy area end\n"); return result; } /* changed area is *dest* rect */ static RegionPtr RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long plane) { RegionPtr result; BoxRec box; GCOP_UNWRAP(pGC); RL_DEBUG_MSG("copy plane start "); if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr) pSrc)) { RootlessStartDrawing((WindowPtr) pSrc); } RootlessStartDrawing((WindowPtr) dst); result = pGC->ops->CopyPlane(pSrc, dst, pGC, srcx, srcy, w, h, dstx, dsty, plane); box.x1 = dstx + dst->x; box.x2 = box.x1 + w; box.y1 = dsty + dst->y; box.y2 = box.y1 + h; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); GCOP_WRAP(pGC); RL_DEBUG_MSG("copy plane end\n"); return result; } // Options for size of changed area: // 0 = box per point // 1 = big box around all points // 2 = accumulate point in 20 pixel radius #define ROOTLESS_CHANGED_AREA 1 #define abs(a) ((a) > 0 ? (a) : -(a)) /* changed area is box around all points */ static void RootlessPolyPoint(DrawablePtr dst, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("polypoint start "); RootlessStartDrawing((WindowPtr) dst); pGC->ops->PolyPoint(dst, pGC, mode, npt, pptInit); if (npt > 0) { #if ROOTLESS_CHANGED_AREA==0 // box per point BoxRec box; while (npt) { box.x1 = pptInit->x; box.y1 = pptInit->y; box.x2 = box.x1 + 1; box.y2 = box.y1 + 1; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); npt--; pptInit++; } #elif ROOTLESS_CHANGED_AREA==1 // one big box BoxRec box; box.x2 = box.x1 = pptInit->x; box.y2 = box.y1 = pptInit->y; while (--npt) { pptInit++; if (box.x1 > pptInit->x) box.x1 = pptInit->x; else if (box.x2 < pptInit->x) box.x2 = pptInit->x; if (box.y1 > pptInit->y) box.y1 = pptInit->y; else if (box.y2 < pptInit->y) box.y2 = pptInit->y; } box.x2++; box.y2++; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); #elif ROOTLESS_CHANGED_AREA==2 // clever(?) method: accumulate point in 20-pixel radius BoxRec box; int firstx, firsty; box.x2 = box.x1 = firstx = pptInit->x; box.y2 = box.y1 = firsty = pptInit->y; while (--npt) { pptInit++; if (abs(pptInit->x - firstx) > 20 || abs(pptInit->y - firsty) > 20) { box.x2++; box.y2++; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); box.x2 = box.x1 = firstx = pptInit->x; box.y2 = box.y1 = firsty = pptInit->y; } else { if (box.x1 > pptInit->x) box.x1 = pptInit->x; else if (box.x2 < pptInit->x) box.x2 = pptInit->x; if (box.y1 > pptInit->y) box.y1 = pptInit->y; else if (box.y2 < pptInit->y) box.y2 = pptInit->y; } } box.x2++; box.y2++; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); #endif /* ROOTLESS_CHANGED_AREA */ } GCOP_WRAP(pGC); RL_DEBUG_MSG("polypoint end\n"); } #undef ROOTLESS_CHANGED_AREA /* changed area is box around each line */ static void RootlessPolylines(DrawablePtr dst, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("poly lines start "); RootlessStartDrawing((WindowPtr) dst); pGC->ops->Polylines(dst, pGC, mode, npt, pptInit); if (npt > 0) { BoxRec box; int extra = pGC->lineWidth >> 1; box.x2 = box.x1 = pptInit->x; box.y2 = box.y1 = pptInit->y; if (npt > 1) { if (pGC->joinStyle == JoinMiter) extra = 6 * pGC->lineWidth; else if (pGC->capStyle == CapProjecting) extra = pGC->lineWidth; } if (mode == CoordModePrevious) { int x = box.x1; int y = box.y1; while (--npt) { pptInit++; x += pptInit->x; y += pptInit->y; if (box.x1 > x) box.x1 = x; else if (box.x2 < x) box.x2 = x; if (box.y1 > y) box.y1 = y; else if (box.y2 < y) box.y2 = y; } } else { while (--npt) { pptInit++; if (box.x1 > pptInit->x) box.x1 = pptInit->x; else if (box.x2 < pptInit->x) box.x2 = pptInit->x; if (box.y1 > pptInit->y) box.y1 = pptInit->y; else if (box.y2 < pptInit->y) box.y2 = pptInit->y; } } box.x2++; box.y2++; if (extra) { box.x1 -= extra; box.x2 += extra; box.y1 -= extra; box.y2 += extra; } TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GCOP_WRAP(pGC); RL_DEBUG_MSG("poly lines end\n"); } /* changed area is box around each line segment */ static void RootlessPolySegment(DrawablePtr dst, GCPtr pGC, int nseg, xSegment * pSeg) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("poly segment start (win 0x%x)", dst); RootlessStartDrawing((WindowPtr) dst); pGC->ops->PolySegment(dst, pGC, nseg, pSeg); if (nseg > 0) { BoxRec box; int extra = pGC->lineWidth; if (pGC->capStyle != CapProjecting) extra >>= 1; if (pSeg->x2 > pSeg->x1) { box.x1 = pSeg->x1; box.x2 = pSeg->x2; } else { box.x2 = pSeg->x1; box.x1 = pSeg->x2; } if (pSeg->y2 > pSeg->y1) { box.y1 = pSeg->y1; box.y2 = pSeg->y2; } else { box.y2 = pSeg->y1; box.y1 = pSeg->y2; } while (--nseg) { pSeg++; if (pSeg->x2 > pSeg->x1) { if (pSeg->x1 < box.x1) box.x1 = pSeg->x1; if (pSeg->x2 > box.x2) box.x2 = pSeg->x2; } else { if (pSeg->x2 < box.x1) box.x1 = pSeg->x2; if (pSeg->x1 > box.x2) box.x2 = pSeg->x1; } if (pSeg->y2 > pSeg->y1) { if (pSeg->y1 < box.y1) box.y1 = pSeg->y1; if (pSeg->y2 > box.y2) box.y2 = pSeg->y2; } else { if (pSeg->y2 < box.y1) box.y1 = pSeg->y2; if (pSeg->y1 > box.y2) box.y2 = pSeg->y1; } } box.x2++; box.y2++; if (extra) { box.x1 -= extra; box.x2 += extra; box.y1 -= extra; box.y2 += extra; } TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GCOP_WRAP(pGC); RL_DEBUG_MSG("poly segment end\n"); } /* changed area is box around each line (not entire rects) */ static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC, int nRects, xRectangle *pRects) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("poly rectangle start "); RootlessStartDrawing((WindowPtr) dst); pGC->ops->PolyRectangle(dst, pGC, nRects, pRects); if (nRects > 0) { BoxRec box; int offset1, offset2, offset3; offset2 = pGC->lineWidth; if (!offset2) offset2 = 1; offset1 = offset2 >> 1; offset3 = offset2 - offset1; while (nRects--) { box.x1 = pRects->x - offset1; box.y1 = pRects->y - offset1; box.x2 = box.x1 + pRects->width + offset2; box.y2 = box.y1 + offset2; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); box.x1 = pRects->x - offset1; box.y1 = pRects->y + offset3; box.x2 = box.x1 + offset2; box.y2 = box.y1 + pRects->height - offset2; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); box.x1 = pRects->x + pRects->width - offset1; box.y1 = pRects->y + offset3; box.x2 = box.x1 + offset2; box.y2 = box.y1 + pRects->height - offset2; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); box.x1 = pRects->x - offset1; box.y1 = pRects->y + pRects->height - offset1; box.x2 = box.x1 + pRects->width + offset2; box.y2 = box.y1 + offset2; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); pRects++; } } GCOP_WRAP(pGC); RL_DEBUG_MSG("poly rectangle end\n"); } /* changed area is box around each arc (assumes all arcs are 360 degrees) */ static void RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc * parcs) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("poly arc start "); RootlessStartDrawing((WindowPtr) dst); pGC->ops->PolyArc(dst, pGC, narcs, parcs); if (narcs > 0) { int extra = pGC->lineWidth >> 1; BoxRec box; box.x1 = parcs->x; box.x2 = box.x1 + parcs->width; box.y1 = parcs->y; box.y2 = box.y1 + parcs->height; /* should I break these up instead ? */ while (--narcs) { parcs++; if (box.x1 > parcs->x) box.x1 = parcs->x; if (box.x2 < (parcs->x + parcs->width)) box.x2 = parcs->x + parcs->width; if (box.y1 > parcs->y) box.y1 = parcs->y; if (box.y2 < (parcs->y + parcs->height)) box.y2 = parcs->y + parcs->height; } if (extra) { box.x1 -= extra; box.x2 += extra; box.y1 -= extra; box.y2 += extra; } box.x2++; box.y2++; TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GCOP_WRAP(pGC); RL_DEBUG_MSG("poly arc end\n"); } /* changed area is box around each poly */ static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC, int shape, int mode, int count, DDXPointPtr pptInit) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("fill poly start (win 0x%x, fillStyle 0x%x)", dst, pGC->fillStyle); if (count <= 2) { pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit); } else { DDXPointPtr ppt = pptInit; int i = count; BoxRec box; box.x2 = box.x1 = ppt->x; box.y2 = box.y1 = ppt->y; if (mode != CoordModeOrigin) { int x = box.x1; int y = box.y1; while (--i) { ppt++; x += ppt->x; y += ppt->y; if (box.x1 > x) box.x1 = x; else if (box.x2 < x) box.x2 = x; if (box.y1 > y) box.y1 = y; else if (box.y2 < y) box.y2 = y; } } else { while (--i) { ppt++; if (box.x1 > ppt->x) box.x1 = ppt->x; else if (box.x2 < ppt->x) box.x2 = ppt->x; if (box.y1 > ppt->y) box.y1 = ppt->y; else if (box.y2 < ppt->y) box.y2 = ppt->y; } } box.x2++; box.y2++; RootlessStartDrawing((WindowPtr) dst); if (canAccelFill(dst, pGC)) { GC_UNSET_PM(pGC, dst); } pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit); TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("fill poly end\n"); } /* changed area is the rects */ static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("fill rect start (win 0x%x, fillStyle 0x%x)", dst, pGC->fillStyle); if (nRectsInit <= 0) { pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit); } else { BoxRec box; xRectangle *pRects = pRectsInit; int nRects = nRectsInit; box.x1 = pRects->x; box.x2 = box.x1 + pRects->width; box.y1 = pRects->y; box.y2 = box.y1 + pRects->height; while (--nRects) { pRects++; if (box.x1 > pRects->x) box.x1 = pRects->x; if (box.x2 < (pRects->x + pRects->width)) box.x2 = pRects->x + pRects->width; if (box.y1 > pRects->y) box.y1 = pRects->y; if (box.y2 < (pRects->y + pRects->height)) box.y2 = pRects->y + pRects->height; } RootlessStartDrawing((WindowPtr) dst); if (canAccelFill(dst, pGC)) { GC_UNSET_PM(pGC, dst); } pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit); TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("fill rect end\n"); } /* changed area is box around each arc (assuming arcs are all 360 degrees) */ static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC, int narcsInit, xArc * parcsInit) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("fill arc start "); if (narcsInit > 0) { BoxRec box; int narcs = narcsInit; xArc *parcs = parcsInit; box.x1 = parcs->x; box.x2 = box.x1 + parcs->width; box.y1 = parcs->y; box.y2 = box.y1 + parcs->height; /* should I break these up instead ? */ while (--narcs) { parcs++; if (box.x1 > parcs->x) box.x1 = parcs->x; if (box.x2 < (parcs->x + parcs->width)) box.x2 = parcs->x + parcs->width; if (box.y1 > parcs->y) box.y1 = parcs->y; if (box.y2 < (parcs->y + parcs->height)) box.y2 = parcs->y + parcs->height; } RootlessStartDrawing((WindowPtr) dst); if (canAccelFill(dst, pGC)) { GC_UNSET_PM(pGC, dst); } pGC->ops->PolyFillArc(dst, pGC, narcsInit, parcsInit); TRIM_AND_TRANSLATE_BOX(box, dst, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } else { pGC->ops->PolyFillArc(dst, pGC, narcsInit, parcsInit); } GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("fill arc end\n"); } static void RootlessImageText8(DrawablePtr dst, GCPtr pGC, int x, int y, int count, char *chars) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("imagetext8 start "); if (count > 0) { int top, bot, Min, Max; BoxRec box; top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); Min = count * FONTMINBOUNDS(pGC->font, characterWidth); if (Min > 0) Min = 0; Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); if (Max < 0) Max = 0; /* ugh */ box.x1 = dst->x + x + Min + FONTMINBOUNDS(pGC->font, leftSideBearing); box.x2 = dst->x + x + Max + FONTMAXBOUNDS(pGC->font, rightSideBearing); box.y1 = dst->y + y - top; box.y2 = dst->y + y + bot; RootlessStartDrawing((WindowPtr) dst); if (canAccelFill(dst, pGC)) { GC_UNSET_PM(pGC, dst); } pGC->ops->ImageText8(dst, pGC, x, y, count, chars); TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } else { pGC->ops->ImageText8(dst, pGC, x, y, count, chars); } GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("imagetext8 end\n"); } static int RootlessPolyText8(DrawablePtr dst, GCPtr pGC, int x, int y, int count, char *chars) { int width; // the result, sorta GCOP_UNWRAP(pGC); RL_DEBUG_MSG("polytext8 start "); RootlessStartDrawing((WindowPtr) dst); width = pGC->ops->PolyText8(dst, pGC, x, y, count, chars); width -= x; if (width > 0) { BoxRec box; /* ugh */ box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing); box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing); if (count > 1) { if (width > 0) box.x2 += width; else box.x1 += width; } box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent); box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent); TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GCOP_WRAP(pGC); RL_DEBUG_MSG("polytext8 end\n"); return width + x; } static void RootlessImageText16(DrawablePtr dst, GCPtr pGC, int x, int y, int count, unsigned short *chars) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("imagetext16 start "); if (count > 0) { int top, bot, Min, Max; BoxRec box; top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); Min = count * FONTMINBOUNDS(pGC->font, characterWidth); if (Min > 0) Min = 0; Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); if (Max < 0) Max = 0; /* ugh */ box.x1 = dst->x + x + Min + FONTMINBOUNDS(pGC->font, leftSideBearing); box.x2 = dst->x + x + Max + FONTMAXBOUNDS(pGC->font, rightSideBearing); box.y1 = dst->y + y - top; box.y2 = dst->y + y + bot; RootlessStartDrawing((WindowPtr) dst); if (canAccelFill(dst, pGC)) { GC_UNSET_PM(pGC, dst); } pGC->ops->ImageText16(dst, pGC, x, y, count, chars); TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } else { pGC->ops->ImageText16(dst, pGC, x, y, count, chars); } GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("imagetext16 end\n"); } static int RootlessPolyText16(DrawablePtr dst, GCPtr pGC, int x, int y, int count, unsigned short *chars) { int width; // the result, sorta GCOP_UNWRAP(pGC); RL_DEBUG_MSG("polytext16 start "); RootlessStartDrawing((WindowPtr) dst); width = pGC->ops->PolyText16(dst, pGC, x, y, count, chars); width -= x; if (width > 0) { BoxRec box; /* ugh */ box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing); box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing); if (count > 1) { if (width > 0) box.x2 += width; else box.x1 += width; } box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent); box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent); TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GCOP_WRAP(pGC); RL_DEBUG_MSG("polytext16 end\n"); return width + x; } static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyphInit, CharInfoPtr * ppciInit, void *unused) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); RL_DEBUG_MSG("imageglyph start "); if (nglyphInit > 0) { int top, bot, width = 0; BoxRec box; unsigned int nglyph = nglyphInit; CharInfoPtr *ppci = ppciInit; top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); box.x1 = ppci[0]->metrics.leftSideBearing; if (box.x1 > 0) box.x1 = 0; box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing - ppci[nglyph - 1]->metrics.characterWidth; if (box.x2 < 0) box.x2 = 0; box.x2 += dst->x + x; box.x1 += dst->x + x; while (nglyph--) { width += (*ppci)->metrics.characterWidth; ppci++; } if (width > 0) box.x2 += width; else box.x1 += width; box.y1 = dst->y + y - top; box.y2 = dst->y + y + bot; RootlessStartDrawing((WindowPtr) dst); if (canAccelFill(dst, pGC)) { GC_UNSET_PM(pGC, dst); } pGC->ops->ImageGlyphBlt(dst, pGC, x, y, nglyphInit, ppciInit, unused); TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } else { pGC->ops->ImageGlyphBlt(dst, pGC, x, y, nglyphInit, ppciInit, unused); } GC_RESTORE(pGC, dst); GCOP_WRAP(pGC); RL_DEBUG_MSG("imageglyph end\n"); } static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("polyglyph start "); RootlessStartDrawing((WindowPtr) dst); pGC->ops->PolyGlyphBlt(dst, pGC, x, y, nglyph, ppci, pglyphBase); if (nglyph > 0) { BoxRec box; /* ugh */ box.x1 = dst->x + x + ppci[0]->metrics.leftSideBearing; box.x2 = dst->x + x + ppci[nglyph - 1]->metrics.rightSideBearing; if (nglyph > 1) { int width = 0; while (--nglyph) { width += (*ppci)->metrics.characterWidth; ppci++; } if (width > 0) box.x2 += width; else box.x1 += width; } box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent); box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent); TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); } GCOP_WRAP(pGC); RL_DEBUG_MSG("polyglyph end\n"); } /* changed area is in dest */ static void RootlessPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst, int dx, int dy, int xOrg, int yOrg) { BoxRec box; GCOP_UNWRAP(pGC); RL_DEBUG_MSG("push pixels start "); RootlessStartDrawing((WindowPtr) dst); pGC->ops->PushPixels(pGC, pBitMap, dst, dx, dy, xOrg, yOrg); box.x1 = xOrg + dst->x; box.x2 = box.x1 + dx; box.y1 = yOrg + dst->y; box.y2 = box.y1 + dy; TRIM_BOX(box, pGC); if (BOX_NOT_EMPTY(box)) RootlessDamageBox((WindowPtr) dst, &box); GCOP_WRAP(pGC); RL_DEBUG_MSG("push pixels end\n"); } xorg-server-1.17.1/miext/rootless/README.txt0000664000175100017510000003265712160102336015516 00000000000000 Generic Rootless Layer Version 1.0 July 13, 2004 Torrey T. Lyons torrey@xfree86.org Introduction The generic rootless layer allows an X server to be implemented on top of another window server in a cooperative manner. This allows the X11 windows and native windows of the underlying window server to coexist on the same screen. The layer is called "rootless" because the root window of the X server is generally not drawn. Instead, each top-level child of the root window is represented as a separate on-screen window by the underlying window server. The layer is referred to as "generic" because it abstracts away the details of the underlying window system and contains code that is useful for any rootless X server. The code for the generic rootless layer is located in xc/programs/Xserver/miext/rootless. To build a complete rootless X server requires a specific rootless implementation, which provides functions that allow the generic rootless layer to interact with the underlying window system. Concepts In the context of a rootless X server the term window is used to mean many fundamentally different things. For X11 a window is a DDX resource that describes a visible, or potentially visible, rectangle on the screen. A top-level window is a direct child of the root window. To avoid confusion, an on-screen native window of the underlying window system is referred to as a "frame". The generic rootless layer associates each mapped top-level X11 window with a frame. An X11 window may be said to be "framed" if it or its top-level parent is represented by a frame. The generic rootless layer models each frame as being backed at all times by a backing buffer, which is periodically flushed to the screen. If the underlying window system does not provide a backing buffer for frames, this must be done by the rootless implementation. The generic rootless layer model does not assume it always has access to the frames' backing buffers. Any drawing to the buffer will be proceeded by a call to the rootless implementation's StartDrawing() function and StopDrawing() will be called when the drawing is concluded. The address of the frame's backing buffer is returned by the StartDrawing() function and it can change between successive calls. Because each frame is assumed to have a backing buffer, the generic rootless layer will stop Expose events being generated when the regions of visibility of a frame change on screen. This is similar to backing store, but backing buffers are different in that they always store a copy of the entire window contents, not just the obscured portions. The price paid in increased memory consumption is made up by the greatly decreased complexity in not having to track and record regions as they are obscured. Rootless Implementation The specifics of the underlying window system are provided to the generic rootless layer through rootless implementation functions, compile- time options, and runtime parameters. The rootless implementation functions are a list of functions that allow the generic rootless layer to perform operations such as creating, destroying, moving, and resizing frames. Some of the implementation functions are optional. A detailed description of the rootless implementation functions is provided in Appendix A. By design, a rootless implementation should only have to include the rootless.h header file. The rootlessCommon.h file contains definitions internal to the generic rootless layer. (If you find you need to use rootlessCommon.h in your implementation, let the generic rootless layer maintainers know. This could be an area where the generic rootless layer should be generalized.) A rootless implementation should also modify rootlessConfig.h to specify compile time options for its platform. The following compile-time options are defined in rootlessConfig.h: o ROOTLESS_PROTECT_ALPHA: By default for a color bit depth of 24 and 32 bits per pixel, fb will overwrite the "unused" 8 bits to optimize drawing speed. If this is true, the alpha channel of frames is protected and is not modified when drawing to them. The bits containing the alpha channel are defined by the macro RootlessAlphaMask(bpp), which should return a bit mask for various bits per pixel. o ROOTLESS_REDISPLAY_DELAY: Time in milliseconds between updates to the underlying window server. Most operations will be buffered until this time has expired. o ROOTLESS_RESIZE_GRAVITY: If the underlying window system supports it, some frame resizes can be optimized by relying on the frame contents maintaining a particular gravity during the resize. In this way less of the frame contents need to be preserved by the generic rootless layer. If true, the generic rootless layer will pass gravity hints during resizing and rely on the frame contents being preserved accordingly. The following runtime options are defined in rootless.h: o rootlessGlobalOffsetX, rootlessGlobalOffsetY: These specify the global offset that is applied to all screens when converting from screen-local to global coordinates. o rootless_CopyBytes_threshold, rootless_CopyWindow_threshold: The minimum number of bytes or pixels for which to use the rootless implementation's respective acceleration function. The rootless acceleration functions are all optional so these will only be used if the respective acceleration function pointer is not NULL. Accelerated Drawing The rootless implementation typically does not have direct access to the hardware. Its access to the graphics hardware is generally through the API of the underlying window system. This underlying API may not overlap well with the X11 drawing primitives. The generic rootless layer falls back to using fb for all its 2-D drawing. Providing optional rootless implementation acceleration functions can accelerate some graphics primitives and some window functions. Typically calling through to the underlying window systems API will not speed up these operations for small enough areas. The rootless_*_threshold runtime options allow the rootless implementation to provide hints for when the acceleration functions should be used instead of fb. Alpha Channel Protection If the bits per pixel is greater then the color bit depth, the contents of the extra bits are undefined by the X11 protocol. Some window systems will use these extra bits as an alpha channel. The generic rootless layer can be configured to protect these bits and make sure they are not modified by other parts of the X server. To protect the alpha channel ROOTLESS_PROTECT_ALPHA and RootlessAlphaMask(bpp) must be set appropriately as described under the compile time options. This ensures that the X11 graphics primitives do not overwrite the alpha channel in an attempt to optimize drawing. In addition, the window functions PaintWindow() and Composite() must be replaced by alpha channel safe variants. These are provided in rootless/safeAlpha. Credits The generic rootless layer was originally conceived and developed by Greg Parker as part of the XDarwin X server on Mac OS X. John Harper made later optimizations to this code but removed its generic independence of the underlying window system. Torrey T. Lyons reintroduced the generic abstractions and made the rootless code suitable for use by other X servers. Appendix A: Rootless Implementation Functions The rootless implementation functions are defined in rootless.h. It is intended that rootless.h contains the complete interface that is needed by rootless implementations. The definitions contained in rootlessCommon.h are intended for internal use by the generic rootless layer and are more likely to change. Most of these functions take a RootlessFrameID as a parameter. The RootlessFrameID is an opaque object that is returned by the implementation's CreateFrame() function. The generic rootless layer does not use this frame id other than to pass it back to the rootless implementation to indicate the frame to operate on. /* * Create a new frame. * The frame is created unmapped. * * pFrame RootlessWindowPtr for this frame should be completely * initialized before calling except for pFrame->wid, which * is set by this function. * pScreen Screen on which to place the new frame * newX, newY Position of the frame. * pNewShape Shape for the frame (in frame-local coordinates). NULL for * unshaped frames. */ typedef Bool (*RootlessCreateFrameProc) (RootlessWindowPtr pFrame, ScreenPtr pScreen, int newX, int newY, RegionPtr pNewShape); /* * Destroy a frame. * Drawing is stopped and all updates are flushed before this is called. * * wid Frame id */ typedef void (*RootlessDestroyFrameProc) (RootlessFrameID wid); /* * Move a frame on screen. * Drawing is stopped and all updates are flushed before this is called. * * wid Frame id * pScreen Screen to move the new frame to * newX, newY New position of the frame */ typedef void (*RootlessMoveFrameProc) (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY); /* * Resize and move a frame. * Drawing is stopped and all updates are flushed before this is called. * * wid Frame id * pScreen Screen to move the new frame to * newX, newY New position of the frame * newW, newH New size of the frame * gravity Gravity for window contents (rl_gravity_enum). This is always * RL_GRAVITY_NONE unless ROOTLESS_RESIZE_GRAVITY is set. */ typedef void (*RootlessResizeFrameProc) (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY, unsigned int newW, unsigned int newH, unsigned int gravity); /* * Change frame ordering (AKA stacking, layering). * Drawing is stopped before this is called. Unmapped frames are mapped by * setting their ordering. * * wid Frame id * nextWid Frame id of frame that is now above this one or NULL if this * frame is at the top. */ typedef void (*RootlessRestackFrameProc) (RootlessFrameID wid, RootlessFrameID nextWid); /* * Change frame's shape. * Drawing is stopped before this is called. * * wid Frame id * pNewShape New shape for the frame (in frame-local coordinates) * or NULL if now unshaped. */ typedef void (*RootlessReshapeFrameProc) (RootlessFrameID wid, RegionPtr pNewShape); /* * Unmap a frame. * * wid Frame id */ typedef void (*RootlessUnmapFrameProc) (RootlessFrameID wid); /* * Start drawing to a frame. * Prepare a frame for direct access to its backing buffer. * * wid Frame id * pixelData Address of the backing buffer (returned) * bytesPerRow Width in bytes of the backing buffer (returned) */ typedef void (*RootlessStartDrawingProc) (RootlessFrameID wid, char **pixelData, int *bytesPerRow); /* * Stop drawing to a frame. * No drawing to the frame's backing buffer will occur until drawing * is started again. * * wid Frame id * flush Flush drawing updates for this frame to the screen. */ typedef void (*RootlessStopDrawingProc) (RootlessFrameID wid, Bool flush); /* * Flush drawing updates to the screen. * Drawing is stopped before this is called. * * wid Frame id * pDamage Region containing all the changed pixels in frame-local * coordinates. This is clipped to the window's clip. */ typedef void (*RootlessUpdateRegionProc) (RootlessFrameID wid, RegionPtr pDamage); /* * Mark damaged rectangles as requiring redisplay to screen. * * wid Frame id * nrects Number of damaged rectangles * rects Array of damaged rectangles in frame-local coordinates * shift_x, Vector to shift rectangles by * shift_y */ typedef void (*RootlessDamageRectsProc) (RootlessFrameID wid, int nrects, const BoxRec *rects, int shift_x, int shift_y); /* * Switch the window associated with a frame. (Optional) * When a framed window is reparented, the frame is resized and set to * use the new top-level parent. If defined this function will be called * afterwards for implementation specific bookkeeping. * * pFrame Frame whose window has switched * oldWin Previous window wrapped by this frame */ typedef void (*RootlessSwitchWindowProc) (RootlessWindowPtr pFrame, WindowPtr oldWin); /* * Copy bytes. (Optional) * Source and destinate may overlap and the right thing should happen. * * width Bytes to copy per row * height Number of rows * src Source data * srcRowBytes Width of source in bytes * dst Destination data * dstRowBytes Width of destination in bytes */ typedef void (*RootlessCopyBytesProc) (unsigned int width, unsigned int height, const void *src, unsigned int srcRowBytes, void *dst, unsigned int dstRowBytes); /* * Copy area in frame to another part of frame. (Optional) * * wid Frame id * dstNrects Number of rectangles to copy * dstRects Array of rectangles to copy * dx, dy Number of pixels away to copy area */ typedef void (*RootlessCopyWindowProc) (RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, int dx, int dy); xorg-server-1.17.1/miext/rootless/rootless.h0000664000175100017510000002701212456571574016056 00000000000000/* * External interface to generic rootless mode */ /* * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _ROOTLESS_H #define _ROOTLESS_H #include "rootlessConfig.h" #include "mi.h" #include "gcstruct.h" /* Each top-level rootless window has a one-to-one correspondence to a physical on-screen window. The physical window is refered to as a "frame". */ typedef void *RootlessFrameID; /* * RootlessWindowRec * This structure stores the per-frame data used by the rootless code. * Each top-level X window has one RootlessWindowRec associated with it. */ typedef struct _RootlessWindowRec { // Position and size includes the window border // Position is in per-screen coordinates int x, y; unsigned int width, height; unsigned int borderWidth; int level; RootlessFrameID wid; // implementation specific frame id WindowPtr win; // underlying X window // Valid only when drawing (ie. is_drawing is set) char *pixelData; int bytesPerRow; PixmapPtr pixmap; unsigned int is_drawing:1; // Currently drawing? unsigned int is_reorder_pending:1; unsigned int is_offscreen:1; unsigned int is_obscured:1; } RootlessWindowRec, *RootlessWindowPtr; /* Offset for screen-local to global coordinate transforms */ extern int rootlessGlobalOffsetX; extern int rootlessGlobalOffsetY; /* The minimum number of bytes or pixels for which to use the implementation's accelerated functions. */ extern unsigned int rootless_CopyBytes_threshold; extern unsigned int rootless_CopyWindow_threshold; /* Gravity for window contents during resizing */ enum rl_gravity_enum { RL_GRAVITY_NONE = 0, /* no gravity, fill everything */ RL_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */ RL_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */ RL_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */ RL_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */ }; /*------------------------------------------ Rootless Implementation Functions ------------------------------------------*/ /* * Create a new frame. * The frame is created unmapped. * * pFrame RootlessWindowPtr for this frame should be completely * initialized before calling except for pFrame->wid, which * is set by this function. * pScreen Screen on which to place the new frame * newX, newY Position of the frame. * pNewShape Shape for the frame (in frame-local coordinates). NULL for * unshaped frames. */ typedef Bool (*RootlessCreateFrameProc) (RootlessWindowPtr pFrame, ScreenPtr pScreen, int newX, int newY, RegionPtr pNewShape); /* * Destroy a frame. * Drawing is stopped and all updates are flushed before this is called. * * wid Frame id */ typedef void (*RootlessDestroyFrameProc) (RootlessFrameID wid); /* * Move a frame on screen. * Drawing is stopped and all updates are flushed before this is called. * * wid Frame id * pScreen Screen to move the new frame to * newX, newY New position of the frame */ typedef void (*RootlessMoveFrameProc) (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY); /* * Resize and move a frame. * Drawing is stopped and all updates are flushed before this is called. * * wid Frame id * pScreen Screen to move the new frame to * newX, newY New position of the frame * newW, newH New size of the frame * gravity Gravity for window contents (rl_gravity_enum). This is always * RL_GRAVITY_NONE unless ROOTLESS_RESIZE_GRAVITY is set. */ typedef void (*RootlessResizeFrameProc) (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY, unsigned int newW, unsigned int newH, unsigned int gravity); /* * Change frame ordering (AKA stacking, layering). * Drawing is stopped before this is called. Unmapped frames are mapped by * setting their ordering. * * wid Frame id * nextWid Frame id of frame that is now above this one or NULL if this * frame is at the top. */ typedef void (*RootlessRestackFrameProc) (RootlessFrameID wid, RootlessFrameID nextWid); /* * Change frame's shape. * Drawing is stopped before this is called. * * wid Frame id * pNewShape New shape for the frame (in frame-local coordinates) * or NULL if now unshaped. */ typedef void (*RootlessReshapeFrameProc) (RootlessFrameID wid, RegionPtr pNewShape); /* * Unmap a frame. * * wid Frame id */ typedef void (*RootlessUnmapFrameProc) (RootlessFrameID wid); /* * Start drawing to a frame. * Prepare a frame for direct access to its backing buffer. * * wid Frame id * pixelData Address of the backing buffer (returned) * bytesPerRow Width in bytes of the backing buffer (returned) */ typedef void (*RootlessStartDrawingProc) (RootlessFrameID wid, char **pixelData, int *bytesPerRow); /* * Stop drawing to a frame. * No drawing to the frame's backing buffer will occur until drawing * is started again. * * wid Frame id * flush Flush drawing updates for this frame to the screen. */ typedef void (*RootlessStopDrawingProc) (RootlessFrameID wid, Bool flush); /* * Flush drawing updates to the screen. * Drawing is stopped before this is called. * * wid Frame id * pDamage Region containing all the changed pixels in frame-lcoal * coordinates. This is clipped to the window's clip. */ typedef void (*RootlessUpdateRegionProc) (RootlessFrameID wid, RegionPtr pDamage); /* * Mark damaged rectangles as requiring redisplay to screen. * * wid Frame id * nrects Number of damaged rectangles * rects Array of damaged rectangles in frame-local coordinates * shift_x, Vector to shift rectangles by * shift_y */ typedef void (*RootlessDamageRectsProc) (RootlessFrameID wid, int nrects, const BoxRec * rects, int shift_x, int shift_y); /* * Switch the window associated with a frame. (Optional) * When a framed window is reparented, the frame is resized and set to * use the new top-level parent. If defined this function will be called * afterwards for implementation specific bookkeeping. * * pFrame Frame whose window has switched * oldWin Previous window wrapped by this frame */ typedef void (*RootlessSwitchWindowProc) (RootlessWindowPtr pFrame, WindowPtr oldWin); /* * Check if window should be reordered. (Optional) * The underlying window system may animate windows being ordered in. * We want them to be mapped but remain ordered out until the animation * completes. If defined this function will be called to check if a * framed window should be reordered now. If this function returns * FALSE, the window will still be mapped from the X11 perspective, but * the RestackFrame function will not be called for its frame. * * pFrame Frame to reorder */ typedef Bool (*RootlessDoReorderWindowProc) (RootlessWindowPtr pFrame); /* * Copy bytes. (Optional) * Source and destinate may overlap and the right thing should happen. * * width Bytes to copy per row * height Number of rows * src Source data * srcRowBytes Width of source in bytes * dst Destination data * dstRowBytes Width of destination in bytes */ typedef void (*RootlessCopyBytesProc) (unsigned int width, unsigned int height, const void *src, unsigned int srcRowBytes, void *dst, unsigned int dstRowBytes); /* * Copy area in frame to another part of frame. (Optional) * * wid Frame id * dstNrects Number of rectangles to copy * dstRects Array of rectangles to copy * dx, dy Number of pixels away to copy area */ typedef void (*RootlessCopyWindowProc) (RootlessFrameID wid, int dstNrects, const BoxRec * dstRects, int dx, int dy); typedef void (*RootlessHideWindowProc) (RootlessFrameID wid); typedef void (*RootlessUpdateColormapProc) (RootlessFrameID wid, ScreenPtr pScreen); /* * Rootless implementation function list */ typedef struct _RootlessFrameProcs { RootlessCreateFrameProc CreateFrame; RootlessDestroyFrameProc DestroyFrame; RootlessMoveFrameProc MoveFrame; RootlessResizeFrameProc ResizeFrame; RootlessRestackFrameProc RestackFrame; RootlessReshapeFrameProc ReshapeFrame; RootlessUnmapFrameProc UnmapFrame; RootlessStartDrawingProc StartDrawing; RootlessStopDrawingProc StopDrawing; RootlessUpdateRegionProc UpdateRegion; RootlessDamageRectsProc DamageRects; /* Optional frame functions */ RootlessSwitchWindowProc SwitchWindow; RootlessDoReorderWindowProc DoReorderWindow; RootlessHideWindowProc HideWindow; RootlessUpdateColormapProc UpdateColormap; /* Optional acceleration functions */ RootlessCopyBytesProc CopyBytes; RootlessCopyWindowProc CopyWindow; } RootlessFrameProcsRec, *RootlessFrameProcsPtr; /* * Initialize rootless mode on the given screen. */ Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs); /* * Return the frame ID for the physical window displaying the given window. * * create If true and the window has no frame, attempt to create one */ RootlessFrameID RootlessFrameForWindow(WindowPtr pWin, Bool create); /* * Return the top-level parent of a window. * The root is the top-level parent of itself, even though the root is * not otherwise considered to be a top-level window. */ WindowPtr TopLevelParent(WindowPtr pWindow); /* * Prepare a window for direct access to its backing buffer. */ void RootlessStartDrawing(WindowPtr pWindow); /* * Finish drawing to a window's backing buffer. * * flush If true, damaged areas are flushed to the screen. */ void RootlessStopDrawing(WindowPtr pWindow, Bool flush); /* * Alocate a new screen pixmap. * miCreateScreenResources does not do this properly with a null * framebuffer pointer. */ void RootlessUpdateScreenPixmap(ScreenPtr pScreen); /* * Reposition all windows on a screen to their correct positions. */ void RootlessRepositionWindows(ScreenPtr pScreen); /* * Bring all windows to the front of the native stack */ void RootlessOrderAllWindows(Bool include_unhitable); #endif /* _ROOTLESS_H */ xorg-server-1.17.1/miext/rootless/rootlessCommon.c0000664000175100017510000003340112274325511017203 00000000000000/* * Common rootless definitions and code */ /* * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include /* For NULL */ #include /* For CHAR_BIT */ #include "rootlessCommon.h" #include "colormapst.h" unsigned int rootless_CopyBytes_threshold = 0; unsigned int rootless_CopyWindow_threshold = 0; int rootlessGlobalOffsetX = 0; int rootlessGlobalOffsetY = 0; RegionRec rootlessHugeRoot = { {-32767, -32767, 32767, 32767}, NULL }; /* Following macro from miregion.c */ /* true iff two Boxes overlap */ #define EXTENTCHECK(r1,r2) \ (!( ((r1)->x2 <= (r2)->x1) || \ ((r1)->x1 >= (r2)->x2) || \ ((r1)->y2 <= (r2)->y1) || \ ((r1)->y1 >= (r2)->y2) ) ) /* * TopLevelParent * Returns the top-level parent of pWindow. * The root is the top-level parent of itself, even though the root is * not otherwise considered to be a top-level window. */ WindowPtr TopLevelParent(WindowPtr pWindow) { WindowPtr top; if (IsRoot(pWindow)) return pWindow; top = pWindow; while (top && !IsTopLevel(top)) top = top->parent; return top; } /* * IsFramedWindow * Returns TRUE if this window is visible inside a frame * (e.g. it is visible and has a top-level or root parent) */ Bool IsFramedWindow(WindowPtr pWin) { WindowPtr top; if (!dixPrivateKeyRegistered(&rootlessWindowPrivateKeyRec)) return FALSE; if (!pWin->realized) return FALSE; top = TopLevelParent(pWin); return (top && WINREC(top)); } Bool RootlessResolveColormap(ScreenPtr pScreen, int first_color, int n_colors, uint32_t * colors) { int last, i; ColormapPtr map; map = RootlessGetColormap(pScreen); if (map == NULL || map->class != PseudoColor) return FALSE; last = min(map->pVisual->ColormapEntries, first_color + n_colors); for (i = max(0, first_color); i < last; i++) { Entry *ent = map->red + i; uint16_t red, green, blue; if (!ent->refcnt) continue; if (ent->fShared) { red = ent->co.shco.red->color; green = ent->co.shco.green->color; blue = ent->co.shco.blue->color; } else { red = ent->co.local.red; green = ent->co.local.green; blue = ent->co.local.blue; } colors[i - first_color] = (0xFF000000UL | ((uint32_t) red & 0xff00) << 8 | (green & 0xff00) | (blue >> 8)); } return TRUE; } /* * RootlessStartDrawing * Prepare a window for direct access to its backing buffer. * Each top-level parent has a Pixmap representing its backing buffer, * which all of its children inherit. */ void RootlessStartDrawing(WindowPtr pWindow) { ScreenPtr pScreen = pWindow->drawable.pScreen; WindowPtr top = TopLevelParent(pWindow); RootlessWindowRec *winRec; PixmapPtr curPixmap; if (top == NULL) return; winRec = WINREC(top); if (winRec == NULL) return; // Make sure the window's top-level parent is prepared for drawing. if (!winRec->is_drawing) { int bw = wBorderWidth(top); SCREENREC(pScreen)->imp->StartDrawing(winRec->wid, &winRec->pixelData, &winRec->bytesPerRow); winRec->pixmap = GetScratchPixmapHeader(pScreen, winRec->width, winRec->height, top->drawable.depth, top->drawable.bitsPerPixel, winRec->bytesPerRow, winRec->pixelData); SetPixmapBaseToScreen(winRec->pixmap, top->drawable.x - bw, top->drawable.y - bw); winRec->is_drawing = TRUE; } curPixmap = pScreen->GetWindowPixmap(pWindow); if (curPixmap == winRec->pixmap) { RL_DEBUG_MSG("Window %p already has winRec->pixmap %p; not pushing\n", pWindow, winRec->pixmap); } else { PixmapPtr oldPixmap = dixLookupPrivate(&pWindow->devPrivates, rootlessWindowOldPixmapPrivateKey); if (oldPixmap != NULL) { if (oldPixmap == curPixmap) RL_DEBUG_MSG ("Window %p's curPixmap %p is the same as its oldPixmap; strange\n", pWindow, curPixmap); else RL_DEBUG_MSG("Window %p's existing oldPixmap %p being lost!\n", pWindow, oldPixmap); } dixSetPrivate(&pWindow->devPrivates, rootlessWindowOldPixmapPrivateKey, curPixmap); pScreen->SetWindowPixmap(pWindow, winRec->pixmap); } } /* * RootlessStopDrawing * Stop drawing to a window's backing buffer. If flush is true, * damaged regions are flushed to the screen. */ static int RestorePreDrawingPixmapVisitor(WindowPtr pWindow, void *data) { RootlessWindowRec *winRec = (RootlessWindowRec *) data; ScreenPtr pScreen = pWindow->drawable.pScreen; PixmapPtr exPixmap = pScreen->GetWindowPixmap(pWindow); PixmapPtr oldPixmap = dixLookupPrivate(&pWindow->devPrivates, rootlessWindowOldPixmapPrivateKey); if (oldPixmap == NULL) { if (exPixmap == winRec->pixmap) RL_DEBUG_MSG ("Window %p appears to be in drawing mode (ex-pixmap %p equals winRec->pixmap, which is being freed) but has no oldPixmap!\n", pWindow, exPixmap); } else { if (exPixmap != winRec->pixmap) RL_DEBUG_MSG ("Window %p appears to be in drawing mode (oldPixmap %p) but ex-pixmap %p not winRec->pixmap %p!\n", pWindow, oldPixmap, exPixmap, winRec->pixmap); if (oldPixmap == winRec->pixmap) RL_DEBUG_MSG ("Window %p's oldPixmap %p is winRec->pixmap, which has just been freed!\n", pWindow, oldPixmap); pScreen->SetWindowPixmap(pWindow, oldPixmap); dixSetPrivate(&pWindow->devPrivates, rootlessWindowOldPixmapPrivateKey, NULL); } return WT_WALKCHILDREN; } void RootlessStopDrawing(WindowPtr pWindow, Bool flush) { ScreenPtr pScreen = pWindow->drawable.pScreen; WindowPtr top = TopLevelParent(pWindow); RootlessWindowRec *winRec; if (top == NULL) return; winRec = WINREC(top); if (winRec == NULL) return; if (winRec->is_drawing) { SCREENREC(pScreen)->imp->StopDrawing(winRec->wid, flush); FreeScratchPixmapHeader(winRec->pixmap); TraverseTree(top, RestorePreDrawingPixmapVisitor, (void *) winRec); winRec->pixmap = NULL; winRec->is_drawing = FALSE; } else if (flush) { SCREENREC(pScreen)->imp->UpdateRegion(winRec->wid, NULL); } if (flush && winRec->is_reorder_pending) { winRec->is_reorder_pending = FALSE; RootlessReorderWindow(pWindow); } } /* * RootlessDamageRegion * Mark a damaged region as requiring redisplay to screen. * pRegion is in GLOBAL coordinates. */ void RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion) { RootlessWindowRec *winRec; RegionRec clipped; WindowPtr pTop; BoxPtr b1, b2; RL_DEBUG_MSG("Damaged win 0x%x ", pWindow); pTop = TopLevelParent(pWindow); if (pTop == NULL) return; winRec = WINREC(pTop); if (winRec == NULL) return; /* We need to intersect the drawn region with the clip of the window to avoid marking places we didn't actually draw (which can cause problems when the window has an extra client-side backing store) But this is a costly operation and since we'll normally just be drawing inside the clip, go to some lengths to avoid the general case intersection. */ b1 = RegionExtents(&pWindow->borderClip); b2 = RegionExtents(pRegion); if (EXTENTCHECK(b1, b2)) { /* Regions may overlap. */ if (RegionNumRects(pRegion) == 1) { int in; /* Damaged region only has a single rect, so we can just compare that against the region */ in = RegionContainsRect(&pWindow->borderClip, RegionRects(pRegion)); if (in == rgnIN) { /* clip totally contains pRegion */ SCREENREC(pWindow->drawable.pScreen)->imp->DamageRects(winRec-> wid, RegionNumRects (pRegion), RegionRects (pRegion), -winRec-> x, -winRec-> y); RootlessQueueRedisplay(pTop->drawable.pScreen); goto out; } else if (in == rgnOUT) { /* clip doesn't contain pRegion */ goto out; } } /* clip overlaps pRegion, need to intersect */ RegionNull(&clipped); RegionIntersect(&clipped, &pWindow->borderClip, pRegion); SCREENREC(pWindow->drawable.pScreen)->imp->DamageRects(winRec->wid, RegionNumRects (&clipped), RegionRects (&clipped), -winRec->x, -winRec->y); RegionUninit(&clipped); RootlessQueueRedisplay(pTop->drawable.pScreen); } out: #ifdef ROOTLESSDEBUG { BoxRec *box = RegionRects(pRegion), *end; int numBox = RegionNumRects(pRegion); for (end = box + numBox; box < end; box++) { RL_DEBUG_MSG("Damage rect: %i, %i, %i, %i\n", box->x1, box->x2, box->y1, box->y2); } } #endif return; } /* * RootlessDamageBox * Mark a damaged box as requiring redisplay to screen. * pRegion is in GLOBAL coordinates. */ void RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox) { RegionRec region; RegionInit(®ion, pBox, 1); RootlessDamageRegion(pWindow, ®ion); RegionUninit(®ion); /* no-op */ } /* * RootlessDamageRect * Mark a damaged rectangle as requiring redisplay to screen. * (x, y, w, h) is in window-local coordinates. */ void RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h) { BoxRec box; RegionRec region; x += pWindow->drawable.x; y += pWindow->drawable.y; box.x1 = x; box.x2 = x + w; box.y1 = y; box.y2 = y + h; RegionInit(®ion, &box, 1); RootlessDamageRegion(pWindow, ®ion); RegionUninit(®ion); /* no-op */ } /* * RootlessRedisplay * Stop drawing and redisplay the damaged region of a window. */ void RootlessRedisplay(WindowPtr pWindow) { RootlessStopDrawing(pWindow, TRUE); } /* * RootlessRepositionWindows * Reposition all windows on a screen to their correct positions. */ void RootlessRepositionWindows(ScreenPtr pScreen) { WindowPtr root = pScreen->root; WindowPtr win; if (root != NULL) { RootlessRepositionWindow(root); for (win = root->firstChild; win; win = win->nextSib) { if (WINREC(win) != NULL) RootlessRepositionWindow(win); } } } /* * RootlessRedisplayScreen * Walk every window on a screen and redisplay the damaged regions. */ void RootlessRedisplayScreen(ScreenPtr pScreen) { WindowPtr root = pScreen->root; if (root != NULL) { WindowPtr win; RootlessRedisplay(root); for (win = root->firstChild; win; win = win->nextSib) { if (WINREC(win) != NULL) { RootlessRedisplay(win); } } } } xorg-server-1.17.1/miext/rootless/Makefile.in0000664000175100017510000006216012466505435016075 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/rootless DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) librootless_la_LIBADD = am_librootless_la_OBJECTS = rootlessCommon.lo rootlessGC.lo \ rootlessScreen.lo rootlessValTree.lo rootlessWindow.lo librootless_la_OBJECTS = $(am_librootless_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 = $(librootless_la_SOURCES) DIST_SOURCES = $(librootless_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CFLAGS = $(DIX_CFLAGS) $(XSERVER_CFLAGS) noinst_LTLIBRARIES = librootless.la librootless_la_SOURCES = \ rootlessCommon.c \ rootlessGC.c \ rootlessScreen.c \ rootlessValTree.c \ rootlessWindow.c EXTRA_DIST = \ README.txt \ rootless.h \ rootlessCommon.h \ rootlessConfig.h \ rootlessWindow.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/rootless/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign miext/rootless/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } librootless.la: $(librootless_la_OBJECTS) $(librootless_la_DEPENDENCIES) $(EXTRA_librootless_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(librootless_la_OBJECTS) $(librootless_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rootlessCommon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rootlessGC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rootlessScreen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rootlessValTree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rootlessWindow.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/miext/rootless/rootlessConfig.h0000664000175100017510000000440712274325511017171 00000000000000/* * Platform specific rootless configuration */ /* * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _ROOTLESSCONFIG_H #define _ROOTLESSCONFIG_H #ifdef __APPLE__ #define ROOTLESS_PROTECT_ALPHA TRUE #define ROOTLESS_REDISPLAY_DELAY 10 #define ROOTLESS_RESIZE_GRAVITY TRUE /*# define ROOTLESSDEBUG*/ /* Bit mask for alpha channel with a particular number of bits per pixel. Note that we only care for 32bpp data. Mac OS X uses planar alpha for 16bpp. */ #define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0) #endif /* __APPLE__ */ #if defined(__CYGWIN__) || defined(WIN32) #define ROOTLESS_PROTECT_ALPHA NO #define ROOTLESS_REDISPLAY_DELAY 10 #undef ROOTLESS_RESIZE_GRAVITY /*# define ROOTLESSDEBUG*/ #define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0) #endif /* __CYGWIN__ */ #endif /* _ROOTLESSCONFIG_H */ xorg-server-1.17.1/miext/rootless/rootlessCommon.h0000664000175100017510000002367012274325511017217 00000000000000/* * Common internal rootless definitions and code */ /* * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #ifndef _ROOTLESSCOMMON_H #define _ROOTLESSCOMMON_H #include "misc.h" #include "rootless.h" #include "fb.h" #include "scrnintstr.h" #include "picturestr.h" // Debug output, or not. #ifdef ROOTLESSDEBUG #define RL_DEBUG_MSG ErrorF #else #define RL_DEBUG_MSG(a, ...) #endif // Global variables extern DevPrivateKeyRec rootlessGCPrivateKeyRec; #define rootlessGCPrivateKey (&rootlessGCPrivateKeyRec) extern DevPrivateKeyRec rootlessScreenPrivateKeyRec; #define rootlessScreenPrivateKey (&rootlessScreenPrivateKeyRec) extern DevPrivateKeyRec rootlessWindowPrivateKeyRec; #define rootlessWindowPrivateKey (&rootlessWindowPrivateKeyRec) extern DevPrivateKeyRec rootlessWindowOldPixmapPrivateKeyRec; #define rootlessWindowOldPixmapPrivateKey (&rootlessWindowOldPixmapPrivateKeyRec) // RootlessGCRec: private per-gc data typedef struct { GCFuncs *originalFuncs; GCOps *originalOps; } RootlessGCRec; // RootlessScreenRec: per-screen private data typedef struct _RootlessScreenRec { // Rootless implementation functions RootlessFrameProcsPtr imp; // Wrapped screen functions CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; MoveWindowProcPtr MoveWindow; ResizeWindowProcPtr ResizeWindow; RestackWindowProcPtr RestackWindow; ReparentWindowProcPtr ReparentWindow; ChangeBorderWidthProcPtr ChangeBorderWidth; PositionWindowProcPtr PositionWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; CreateGCProcPtr CreateGC; CopyWindowProcPtr CopyWindow; GetImageProcPtr GetImage; SourceValidateProcPtr SourceValidate; MarkOverlappedWindowsProcPtr MarkOverlappedWindows; ValidateTreeProcPtr ValidateTree; SetShapeProcPtr SetShape; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; InstallColormapProcPtr InstallColormap; UninstallColormapProcPtr UninstallColormap; StoreColorsProcPtr StoreColors; void *pixmap_data; unsigned int pixmap_data_size; ColormapPtr colormap; void *redisplay_timer; unsigned int redisplay_timer_set:1; unsigned int redisplay_queued:1; unsigned int redisplay_expired:1; unsigned int colormap_changed:1; } RootlessScreenRec, *RootlessScreenPtr; // "Definition of the Porting Layer for the X11 Sample Server" says // unwrap and rewrap of screen functions is unnecessary, but // screen->CreateGC changes after a call to cfbCreateGC. #define SCREEN_UNWRAP(screen, fn) \ screen->fn = SCREENREC(screen)->fn; #define SCREEN_WRAP(screen, fn) \ SCREENREC(screen)->fn = screen->fn; \ screen->fn = Rootless##fn // Accessors for screen and window privates #define SCREENREC(pScreen) ((RootlessScreenRec *) \ dixLookupPrivate(&(pScreen)->devPrivates, rootlessScreenPrivateKey)) #define SETSCREENREC(pScreen, v) \ dixSetPrivate(&(pScreen)->devPrivates, rootlessScreenPrivateKey, v) #define WINREC(pWin) ((RootlessWindowRec *) \ dixLookupPrivate(&(pWin)->devPrivates, rootlessWindowPrivateKey)) #define SETWINREC(pWin, v) \ dixSetPrivate(&(pWin)->devPrivates, rootlessWindowPrivateKey, v) // Call a rootless implementation function. // Many rootless implementation functions are allowed to be NULL. #define CallFrameProc(pScreen, proc, params) \ if (SCREENREC(pScreen)->frameProcs.proc) { \ RL_DEBUG_MSG("calling frame proc " #proc " "); \ SCREENREC(pScreen)->frameProcs.proc params; \ } // BoxRec manipulators // Copied from shadowfb #define TRIM_BOX(box, pGC) { \ BoxPtr extents = &pGC->pCompositeClip->extents;\ if(box.x1 < extents->x1) box.x1 = extents->x1; \ if(box.x2 > extents->x2) box.x2 = extents->x2; \ if(box.y1 < extents->y1) box.y1 = extents->y1; \ if(box.y2 > extents->y2) box.y2 = extents->y2; \ } #define TRANSLATE_BOX(box, pDraw) { \ box.x1 += pDraw->x; \ box.x2 += pDraw->x; \ box.y1 += pDraw->y; \ box.y2 += pDraw->y; \ } #define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \ TRANSLATE_BOX(box, pDraw); \ TRIM_BOX(box, pGC); \ } #define BOX_NOT_EMPTY(box) \ (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) // HUGE_ROOT and NORMAL_ROOT // We don't want to clip windows to the edge of the screen. // HUGE_ROOT temporarily makes the root window really big. // This is needed as a wrapper around any function that calls // SetWinSize or SetBorderSize which clip a window against its // parents, including the root. extern RegionRec rootlessHugeRoot; #define HUGE_ROOT(pWin) \ do { \ WindowPtr w = pWin; \ while (w->parent) \ w = w->parent; \ saveRoot = w->winSize; \ w->winSize = rootlessHugeRoot; \ } while (0) #define NORMAL_ROOT(pWin) \ do { \ WindowPtr w = pWin; \ while (w->parent) \ w = w->parent; \ w->winSize = saveRoot; \ } while (0) // Returns TRUE if this window is a top-level window (i.e. child of the root) // The root is not a top-level window. #define IsTopLevel(pWin) \ ((pWin) && (pWin)->parent && !(pWin)->parent->parent) // Returns TRUE if this window is a root window #define IsRoot(pWin) \ ((pWin) == (pWin)->drawable.pScreen->root) /* * SetPixmapBaseToScreen * Move the given pixmap's base address to where pixel (0, 0) * would be if the pixmap's actual data started at (x, y). * Can't access the bits before the first word of the drawable's data in * rootless mode, so make sure our base address is always 32-bit aligned. */ #define SetPixmapBaseToScreen(pix, _x, _y) { \ PixmapPtr _pPix = (PixmapPtr) (pix); \ _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \ ((int)(_x) * _pPix->drawable.bitsPerPixel/8 + \ (int)(_y) * _pPix->devKind); \ if (_pPix->drawable.bitsPerPixel != FB_UNIT) { \ size_t _diff = ((size_t) _pPix->devPrivate.ptr) & \ (FB_UNIT / CHAR_BIT - 1); \ _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \ _diff; \ _pPix->drawable.x = _diff / \ (_pPix->drawable.bitsPerPixel / CHAR_BIT); \ } \ } // Returns TRUE if this window is visible inside a frame // (e.g. it is visible and has a top-level or root parent) Bool IsFramedWindow(WindowPtr pWin); // Routines that cause regions to get redrawn. // DamageRegion and DamageRect are in global coordinates. // DamageBox is in window-local coordinates. void RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion); void RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h); void RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox); void RootlessRedisplay(WindowPtr pWindow); void RootlessRedisplayScreen(ScreenPtr pScreen); void RootlessQueueRedisplay(ScreenPtr pScreen); /* Return the colormap currently installed on the given screen. */ ColormapPtr RootlessGetColormap(ScreenPtr pScreen); /* Convert colormap to ARGB. */ Bool RootlessResolveColormap(ScreenPtr pScreen, int first_color, int n_colors, uint32_t * colors); void RootlessFlushWindowColormap(WindowPtr pWin); void RootlessFlushScreenColormaps(ScreenPtr pScreen); // Move a window to its proper location on the screen. void RootlessRepositionWindow(WindowPtr pWin); // Move the window to it's correct place in the physical stacking order. void RootlessReorderWindow(WindowPtr pWin); void RootlessScreenExpose(ScreenPtr pScreen); void RootlessHideAllWindows(void); void RootlessShowAllWindows(void); void RootlessUpdateRooted(Bool state); void RootlessEnableRoot(ScreenPtr pScreen); void RootlessDisableRoot(ScreenPtr pScreen); void RootlessSetPixmapOfAncestors(WindowPtr pWin); #endif /* _ROOTLESSCOMMON_H */ xorg-server-1.17.1/miext/rootless/rootlessValTree.c0000664000175100017510000004612512456571574017342 00000000000000/* * Calculate window clip lists for rootless mode * * This file is very closely based on mivaltree.c. */ /* * mivaltree.c -- * Functions for recalculating window clip lists. Main function * is miValidateTree. * Copyright 1987, 1988, 1989, 1998 The Open Group All Rights Reserved. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * * Copyright 1987, 1988, 1989 by * Digital Equipment Corporation, Maynard, Massachusetts, * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital not be * used in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL 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. * ******************************************************************/ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ /* * Aug '86: Susan Angebranndt -- original code * July '87: Adam de Boor -- substantially modified and commented * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible. * In particular, much improved code for window mapping and * circulating. * Bob Scheifler -- avoid miComputeClips for unmapped windows, * valdata changes */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include /* For NULL */ #include #include "scrnintstr.h" #include "validate.h" #include "windowstr.h" #include "mi.h" #include "regionstr.h" #include "mivalidate.h" #include "globals.h" int RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild, VTKind kind); #define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \ HasBorder(w) && \ (w)->backgroundState == ParentRelative) /* *----------------------------------------------------------------------- * RootlessComputeClips -- * Recompute the clipList, borderClip, exposed and borderExposed * regions for pParent and its children. Only viewable windows are * taken into account. * * Results: * None. * * Side Effects: * clipList, borderClip, exposed and borderExposed are altered. * A VisibilityNotify event may be generated on the parent window. * *----------------------------------------------------------------------- */ static void RootlessComputeClips(WindowPtr pParent, ScreenPtr pScreen, RegionPtr universe, VTKind kind, RegionPtr exposed) { int dx, dy; RegionRec childUniverse; register WindowPtr pChild; int oldVis, newVis; BoxRec borderSize; RegionRec childUnion; Bool overlap; RegionPtr borderVisible; /* * Figure out the new visibility of this window. * The extent of the universe should be the same as the extent of * the borderSize region. If the window is unobscured, this rectangle * will be completely inside the universe (the universe will cover it * completely). If the window is completely obscured, none of the * universe will cover the rectangle. */ borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent); borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent); dx = (int) pParent->drawable.x + (int) pParent->drawable.width + wBorderWidth(pParent); if (dx > 32767) dx = 32767; borderSize.x2 = dx; dy = (int) pParent->drawable.y + (int) pParent->drawable.height + wBorderWidth(pParent); if (dy > 32767) dy = 32767; borderSize.y2 = dy; oldVis = pParent->visibility; switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; break; case rgnPART: newVis = VisibilityPartiallyObscured; { RegionPtr pBounding; if ((pBounding = wBoundingShape(pParent))) { switch (miShapedWindowIn(universe, pBounding, &borderSize, pParent->drawable.x, pParent->drawable.y)) { case rgnIN: newVis = VisibilityUnobscured; break; case rgnOUT: newVis = VisibilityFullyObscured; break; } } } break; default: newVis = VisibilityFullyObscured; break; } pParent->visibility = newVis; if (oldVis != newVis && ((pParent-> eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask)) SendVisibilityNotify(pParent); dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y; /* * avoid computations when dealing with simple operations */ switch (kind) { case VTMap: case VTStack: case VTUnmap: break; case VTMove: if ((oldVis == newVis) && ((oldVis == VisibilityFullyObscured) || (oldVis == VisibilityUnobscured))) { pChild = pParent; while (1) { if (pChild->viewable) { if (pChild->visibility != VisibilityFullyObscured) { RegionTranslate(&pChild->borderClip, dx, dy); RegionTranslate(&pChild->clipList, dx, dy); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pChild, dx, dy); } if (pChild->valdata) { RegionNull(&pChild->valdata->after.borderExposed); if (HasParentRelativeBorder(pChild)) { RegionSubtract(&pChild->valdata->after. borderExposed, &pChild->borderClip, &pChild->winSize); } RegionNull(&pChild->valdata->after.exposed); } if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pParent)) pChild = pChild->parent; if (pChild == pParent) break; pChild = pChild->nextSib; } return; } /* fall through */ default: /* * To calculate exposures correctly, we have to translate the old * borderClip and clipList regions to the window's new location so there * is a correspondence between pieces of the new and old clipping regions. */ if (dx || dy) { /* * We translate the old clipList because that will be exposed or copied * if gravity is right. */ RegionTranslate(&pParent->borderClip, dx, dy); RegionTranslate(&pParent->clipList, dx, dy); } break; case VTBroken: RegionEmpty(&pParent->borderClip); RegionEmpty(&pParent->clipList); break; } borderVisible = pParent->valdata->before.borderVisible; RegionNull(&pParent->valdata->after.borderExposed); RegionNull(&pParent->valdata->after.exposed); /* * Since the borderClip must not be clipped by the children, we do * the border exposure first... * * 'universe' is the window's borderClip. To figure the exposures, remove * the area that used to be exposed from the new. * This leaves a region of pieces that weren't exposed before. */ if (HasBorder(pParent)) { if (borderVisible) { /* * when the border changes shape, the old visible portions * of the border will be saved by DIX in borderVisible -- * use that region and destroy it */ RegionSubtract(exposed, universe, borderVisible); RegionDestroy(borderVisible); } else { RegionSubtract(exposed, universe, &pParent->borderClip); } if (HasParentRelativeBorder(pParent) && (dx || dy)) { RegionSubtract(&pParent->valdata->after.borderExposed, universe, &pParent->winSize); } else { RegionSubtract(&pParent->valdata->after.borderExposed, exposed, &pParent->winSize); } RegionCopy(&pParent->borderClip, universe); /* * To get the right clipList for the parent, and to make doubly sure * that no child overlaps the parent's border, we remove the parent's * border from the universe before proceeding. */ RegionIntersect(universe, universe, &pParent->winSize); } else RegionCopy(&pParent->borderClip, universe); if ((pChild = pParent->firstChild) && pParent->mapped) { RegionNull(&childUniverse); RegionNull(&childUnion); if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) { for (; pChild; pChild = pChild->nextSib) { if (pChild->viewable) RegionAppend(&childUnion, &pChild->borderSize); } } else { for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) { if (pChild->viewable) RegionAppend(&childUnion, &pChild->borderSize); } } RegionValidate(&childUnion, &overlap); for (pChild = pParent->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->viewable) { /* * If the child is viewable, we want to remove its extents * from the current universe, but we only re-clip it if * it's been marked. */ if (pChild->valdata) { /* * Figure out the new universe from the child's * perspective and recurse. */ RegionIntersect(&childUniverse, universe, &pChild->borderSize); RootlessComputeClips(pChild, pScreen, &childUniverse, kind, exposed); } /* * Once the child has been processed, we remove its extents * from the current universe, thus denying its space to any * other sibling. */ if (overlap) RegionSubtract(universe, universe, &pChild->borderSize); } } if (!overlap) RegionSubtract(universe, universe, &childUnion); RegionUninit(&childUnion); RegionUninit(&childUniverse); } /* if any children */ /* * 'universe' now contains the new clipList for the parent window. * * To figure the exposure of the window we subtract the old clip from the * new, just as for the border. */ if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { RegionCopy(&pParent->valdata->after.exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { RegionSubtract(&pParent->valdata->after.exposed, universe, &pParent->clipList); } /* HACK ALERT - copying contents of regions, instead of regions */ { RegionRec tmp; tmp = pParent->clipList; pParent->clipList = *universe; *universe = tmp; } #ifdef NOTDEF RegionCopy(&pParent->clipList, universe); #endif pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pParent, dx, dy); } static void RootlessTreeObscured(WindowPtr pParent) { register WindowPtr pChild; register int oldVis; pChild = pParent; while (1) { if (pChild->viewable) { oldVis = pChild->visibility; if (oldVis != (pChild->visibility = VisibilityFullyObscured) && ((pChild-> eventMask | wOtherEventMasks(pChild)) & VisibilityChangeMask)) SendVisibilityNotify(pChild); if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pParent)) pChild = pChild->parent; if (pChild == pParent) break; pChild = pChild->nextSib; } } /* *----------------------------------------------------------------------- * RootlessMiValidateTree -- * Recomputes the clip list for pParent and all its inferiors. * * Results: * Always returns 1. * * Side Effects: * The clipList, borderClip, exposed, and borderExposed regions for * each marked window are altered. * * Notes: * This routine assumes that all affected windows have been marked * (valdata created) and their winSize and borderSize regions * adjusted to correspond to their new positions. The borderClip and * clipList regions should not have been touched. * * The top-most level is treated differently from all lower levels * because pParent is unchanged. For the top level, we merge the * regions taken up by the marked children back into the clipList * for pParent, thus forming a region from which the marked children * can claim their areas. For lower levels, where the old clipList * and borderClip are invalid, we can't do this and have to do the * extra operations done in miComputeClips, but this is much faster * e.g. when only one child has moved... * *----------------------------------------------------------------------- */ /* Quartz version: used for validate from root in rootless mode. We need to make sure top-level windows don't clip each other, and that top-level windows aren't clipped to the root window. */ /*ARGSUSED*/ // fixme this is ugly // Xprint/ValTree.c doesn't work, but maybe that method can? int RootlessMiValidateTree(WindowPtr pRoot, /* Parent to validate */ WindowPtr pChild, /* First child of pRoot that was * affected */ VTKind kind /* What kind of configuration caused call */ ) { RegionRec childClip; /* The new borderClip for the current * child */ RegionRec exposed; /* For intermediate calculations */ register ScreenPtr pScreen; register WindowPtr pWin; pScreen = pRoot->drawable.pScreen; if (pChild == NullWindow) pChild = pRoot->firstChild; RegionNull(&childClip); RegionNull(&exposed); if (RegionBroken(&pRoot->clipList) && !RegionBroken(&pRoot->borderClip)) { // fixme this might not work, but hopefully doesn't happen anyway. kind = VTBroken; RegionEmpty(&pRoot->clipList); ErrorF("ValidateTree: BUSTED!\n"); } /* * Recursively compute the clips for all children of the root. * They don't clip against each other or the root itself, so * childClip is always reset to that child's size. */ for (pWin = pChild; pWin != NullWindow; pWin = pWin->nextSib) { if (pWin->viewable) { if (pWin->valdata) { RegionCopy(&childClip, &pWin->borderSize); RootlessComputeClips(pWin, pScreen, &childClip, kind, &exposed); } else if (pWin->visibility == VisibilityNotViewable) { RootlessTreeObscured(pWin); } } else { if (pWin->valdata) { RegionEmpty(&pWin->clipList); if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pWin, 0, 0); RegionEmpty(&pWin->borderClip); pWin->valdata = NULL; } } } RegionUninit(&childClip); /* The root is never clipped by its children, so nothing on the root is ever exposed by moving or mapping its children. */ RegionNull(&pRoot->valdata->after.exposed); RegionNull(&pRoot->valdata->after.borderExposed); return 1; } xorg-server-1.17.1/miext/rootless/rootlessWindow.c0000664000175100017510000014202712456571574017245 00000000000000/* * Rootless window management */ /* * Copyright (c) 2001 Greg Parker. All Rights Reserved. * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include /* For NULL */ #include /* For CHAR_BIT */ #include #include #ifdef __APPLE__ #include #include "mi.h" #include "pixmapstr.h" #include "windowstr.h" //#include extern int darwinMainScreenX, darwinMainScreenY; extern Bool no_configure_window; #endif #include "fb.h" #include "rootlessCommon.h" #include "rootlessWindow.h" #define SCREEN_TO_GLOBAL_X \ (pScreen->x + rootlessGlobalOffsetX) #define SCREEN_TO_GLOBAL_Y \ (pScreen->y + rootlessGlobalOffsetY) #define DEFINE_ATOM_HELPER(func,atom_name) \ static Atom func (void) { \ static unsigned int generation = 0; \ static Atom atom; \ if (generation != serverGeneration) { \ generation = serverGeneration; \ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \ } \ return atom; \ } DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID") static Bool windows_hidden; // TODO - abstract xp functions #ifdef __APPLE__ // XXX: identical to x_cvt_vptr_to_uint ? #define MAKE_WINDOW_ID(x) ((xp_window_id)((size_t)(x))) void RootlessNativeWindowStateChanged(WindowPtr pWin, unsigned int state) { RootlessWindowRec *winRec; if (pWin == NULL) return; winRec = WINREC(pWin); if (winRec == NULL) return; winRec->is_offscreen = ((state & XP_WINDOW_STATE_OFFSCREEN) != 0); winRec->is_obscured = ((state & XP_WINDOW_STATE_OBSCURED) != 0); pWin->rootlessUnhittable = winRec->is_offscreen; } void RootlessNativeWindowMoved(WindowPtr pWin) { xp_box bounds; int sx, sy, err; XID vlist[2]; Mask mask; ClientPtr pClient; RootlessWindowRec *winRec; winRec = WINREC(pWin); if (xp_get_window_bounds(MAKE_WINDOW_ID(winRec->wid), &bounds) != Success) return; sx = pWin->drawable.pScreen->x + darwinMainScreenX; sy = pWin->drawable.pScreen->y + darwinMainScreenY; /* Fake up a ConfigureWindow packet to resize the window to the current bounds. */ vlist[0] = (INT16) bounds.x1 - sx; vlist[1] = (INT16) bounds.y1 - sy; mask = CWX | CWY; /* pretend we're the owner of the window! */ err = dixLookupClient(&pClient, pWin->drawable.id, serverClient, DixUnknownAccess); if (err != Success) { ErrorF("RootlessNativeWindowMoved(): Failed to lookup window: 0x%x\n", (unsigned int) pWin->drawable.id); return; } /* Don't want to do anything to the physical window (avoids notification-response feedback loops) */ no_configure_window = TRUE; ConfigureWindow(pWin, mask, vlist, pClient); no_configure_window = FALSE; } #endif /* __APPLE__ */ /* * RootlessCreateWindow * For now, don't create a physical window until either the window is * realized, or we really need it (e.g. to attach VRAM surfaces to). * Do reset the window size so it's not clipped by the root window. */ Bool RootlessCreateWindow(WindowPtr pWin) { Bool result; RegionRec saveRoot; SETWINREC(pWin, NULL); dixSetPrivate(&pWin->devPrivates, rootlessWindowOldPixmapPrivateKey, NULL); SCREEN_UNWRAP(pWin->drawable.pScreen, CreateWindow); if (!IsRoot(pWin)) { /* win/border size set by DIX, not by wrapped CreateWindow, so correct it here. Don't HUGE_ROOT when pWin is the root! */ HUGE_ROOT(pWin); SetWinSize(pWin); SetBorderSize(pWin); } result = pWin->drawable.pScreen->CreateWindow(pWin); if (pWin->parent) { NORMAL_ROOT(pWin); } SCREEN_WRAP(pWin->drawable.pScreen, CreateWindow); return result; } /* * RootlessDestroyFrame * Destroy the physical window associated with the given window. */ static void RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec) { SCREENREC(pWin->drawable.pScreen)->imp->DestroyFrame(winRec->wid); free(winRec); SETWINREC(pWin, NULL); } /* * RootlessDestroyWindow * Destroy the physical window associated with the given window. */ Bool RootlessDestroyWindow(WindowPtr pWin) { RootlessWindowRec *winRec = WINREC(pWin); Bool result; if (winRec != NULL) { RootlessDestroyFrame(pWin, winRec); } SCREEN_UNWRAP(pWin->drawable.pScreen, DestroyWindow); result = pWin->drawable.pScreen->DestroyWindow(pWin); SCREEN_WRAP(pWin->drawable.pScreen, DestroyWindow); return result; } static Bool RootlessGetShape(WindowPtr pWin, RegionPtr pShape) { if (wBoundingShape(pWin) == NULL) return FALSE; /* wBoundingShape is relative to *inner* origin of window. Translate by borderWidth to get the outside-relative position. */ RegionNull(pShape); RegionCopy(pShape, wBoundingShape(pWin)); RegionTranslate(pShape, pWin->borderWidth, pWin->borderWidth); return TRUE; } /* * RootlessReshapeFrame * Set the frame shape. */ static void RootlessReshapeFrame(WindowPtr pWin) { RootlessWindowRec *winRec = WINREC(pWin); RegionRec newShape; RegionPtr pShape; // If the window is not yet framed, do nothing if (winRec == NULL) return; if (IsRoot(pWin)) return; RootlessStopDrawing(pWin, FALSE); pShape = RootlessGetShape(pWin, &newShape) ? &newShape : NULL; #ifdef ROOTLESSDEBUG RL_DEBUG_MSG("reshaping..."); if (pShape != NULL) { RL_DEBUG_MSG("numrects %d, extents %d %d %d %d ", RegionNumRects(&newShape), newShape.extents.x1, newShape.extents.y1, newShape.extents.x2, newShape.extents.y2); } else { RL_DEBUG_MSG("no shape "); } #endif SCREENREC(pWin->drawable.pScreen)->imp->ReshapeFrame(winRec->wid, pShape); if (pShape != NULL) RegionUninit(&newShape); } /* * RootlessSetShape * Shape is usually set before a window is mapped and the window will * not have a frame associated with it. In this case, the frame will be * shaped when the window is framed. */ void RootlessSetShape(WindowPtr pWin, int kind) { ScreenPtr pScreen = pWin->drawable.pScreen; SCREEN_UNWRAP(pScreen, SetShape); pScreen->SetShape(pWin, kind); SCREEN_WRAP(pScreen, SetShape); RootlessReshapeFrame(pWin); } /* Disallow ParentRelative background on top-level windows because the root window doesn't really have the right background. */ Bool RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask) { Bool result; ScreenPtr pScreen = pWin->drawable.pScreen; RL_DEBUG_MSG("change window attributes start "); SCREEN_UNWRAP(pScreen, ChangeWindowAttributes); result = pScreen->ChangeWindowAttributes(pWin, vmask); SCREEN_WRAP(pScreen, ChangeWindowAttributes); if (WINREC(pWin)) { // disallow ParentRelative background state if (pWin->backgroundState == ParentRelative) { XID pixel = 0; ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); } } RL_DEBUG_MSG("change window attributes end\n"); return result; } /* * RootlessPositionWindow * This is a hook for when DIX moves or resizes a window. * Update the frame position now although the physical window is moved * in RootlessMoveWindow. (x, y) are *inside* position. After this, * mi and fb are expecting the pixmap to be at the new location. */ Bool RootlessPositionWindow(WindowPtr pWin, int x, int y) { ScreenPtr pScreen = pWin->drawable.pScreen; RootlessWindowRec *winRec = WINREC(pWin); Bool result; RL_DEBUG_MSG("positionwindow start (win 0x%x @ %i, %i)\n", pWin, x, y); if (winRec) { if (winRec->is_drawing) { // Reset frame's pixmap and move it to the new position. int bw = wBorderWidth(pWin); winRec->pixmap->devPrivate.ptr = winRec->pixelData; SetPixmapBaseToScreen(winRec->pixmap, x - bw, y - bw); } } SCREEN_UNWRAP(pScreen, PositionWindow); result = pScreen->PositionWindow(pWin, x, y); SCREEN_WRAP(pScreen, PositionWindow); RL_DEBUG_MSG("positionwindow end\n"); return result; } /* * RootlessInitializeFrame * Initialize some basic attributes of the frame. Note that winRec * may already have valid data in it, so don't overwrite anything * valuable. */ static void RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec * winRec) { DrawablePtr d = &pWin->drawable; int bw = wBorderWidth(pWin); winRec->win = pWin; winRec->x = d->x - bw; winRec->y = d->y - bw; winRec->width = d->width + 2 * bw; winRec->height = d->height + 2 * bw; winRec->borderWidth = bw; } /* * RootlessEnsureFrame * Make sure the given window is framed. If the window doesn't have a * physical window associated with it, attempt to create one. If that * is unsuccessful, return NULL. */ static RootlessWindowRec * RootlessEnsureFrame(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; RootlessWindowRec *winRec; RegionRec shape; RegionPtr pShape = NULL; if (WINREC(pWin) != NULL) return WINREC(pWin); if (!IsTopLevel(pWin) && !IsRoot(pWin)) return NULL; if (pWin->drawable.class != InputOutput) return NULL; winRec = malloc(sizeof(RootlessWindowRec)); if (!winRec) return NULL; RootlessInitializeFrame(pWin, winRec); winRec->is_drawing = FALSE; winRec->is_reorder_pending = FALSE; winRec->pixmap = NULL; winRec->wid = NULL; winRec->level = 0; SETWINREC(pWin, winRec); // Set the frame's shape if the window is shaped if (RootlessGetShape(pWin, &shape)) pShape = &shape; RL_DEBUG_MSG("creating frame "); if (!SCREENREC(pScreen)->imp->CreateFrame(winRec, pScreen, winRec->x + SCREEN_TO_GLOBAL_X, winRec->y + SCREEN_TO_GLOBAL_Y, pShape)) { RL_DEBUG_MSG("implementation failed to create frame!\n"); free(winRec); SETWINREC(pWin, NULL); return NULL; } if (pWin->drawable.depth == 8) RootlessFlushWindowColormap(pWin); if (pShape != NULL) RegionUninit(&shape); return winRec; } /* * RootlessRealizeWindow * The frame is usually created here and not in CreateWindow so that * windows do not eat memory until they are realized. */ Bool RootlessRealizeWindow(WindowPtr pWin) { Bool result; RegionRec saveRoot; ScreenPtr pScreen = pWin->drawable.pScreen; RL_DEBUG_MSG("realizewindow start (win 0x%x) ", pWin); if ((IsTopLevel(pWin) && pWin->drawable.class == InputOutput)) { RootlessWindowRec *winRec; winRec = RootlessEnsureFrame(pWin); if (winRec == NULL) return FALSE; winRec->is_reorder_pending = TRUE; RL_DEBUG_MSG("Top level window "); // Disallow ParentRelative background state on top-level windows. // This might have been set before the window was mapped. if (pWin->backgroundState == ParentRelative) { XID pixel = 0; ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); } } if (!IsRoot(pWin)) HUGE_ROOT(pWin); SCREEN_UNWRAP(pScreen, RealizeWindow); result = pScreen->RealizeWindow(pWin); SCREEN_WRAP(pScreen, RealizeWindow); if (!IsRoot(pWin)) NORMAL_ROOT(pWin); RL_DEBUG_MSG("realizewindow end\n"); return result; } /* * RootlessFrameForWindow * Returns the frame ID for the physical window displaying the given window. * If CREATE is true and the window has no frame, attempt to create one. */ RootlessFrameID RootlessFrameForWindow(WindowPtr pWin, Bool create) { WindowPtr pTopWin; RootlessWindowRec *winRec; pTopWin = TopLevelParent(pWin); if (pTopWin == NULL) return NULL; winRec = WINREC(pTopWin); if (winRec == NULL && create && pWin->drawable.class == InputOutput) { winRec = RootlessEnsureFrame(pTopWin); } if (winRec == NULL) return NULL; return winRec->wid; } /* * RootlessUnrealizeWindow * Unmap the physical window. */ Bool RootlessUnrealizeWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; RootlessWindowRec *winRec = WINREC(pWin); Bool result; RL_DEBUG_MSG("unrealizewindow start "); if (winRec) { RootlessStopDrawing(pWin, FALSE); SCREENREC(pScreen)->imp->UnmapFrame(winRec->wid); winRec->is_reorder_pending = FALSE; } SCREEN_UNWRAP(pScreen, UnrealizeWindow); result = pScreen->UnrealizeWindow(pWin); SCREEN_WRAP(pScreen, UnrealizeWindow); RL_DEBUG_MSG("unrealizewindow end\n"); return result; } /* * RootlessReorderWindow * Reorder the frame associated with the given window so that it's * physically above the window below it in the X stacking order. */ void RootlessReorderWindow(WindowPtr pWin) { RootlessWindowRec *winRec = WINREC(pWin); if (pWin->realized && winRec != NULL && !winRec->is_reorder_pending && !windows_hidden) { WindowPtr newPrevW; RootlessWindowRec *newPrev; RootlessFrameID newPrevID; ScreenPtr pScreen = pWin->drawable.pScreen; /* Check if the implementation wants the frame to not be reordered even though the X11 window is restacked. This can be useful if frames are ordered-in with animation so that the reordering is not done until the animation is complete. */ if (SCREENREC(pScreen)->imp->DoReorderWindow) { if (!SCREENREC(pScreen)->imp->DoReorderWindow(winRec)) return; } RootlessStopDrawing(pWin, FALSE); /* Find the next window above this one that has a mapped frame. * Only include cases where the windows are in the same category of * hittability to ensure offscreen windows dont get restacked * relative to onscreen ones (but that the offscreen ones maintain * their stacking order if they are explicitly asked to Reorder */ newPrevW = pWin->prevSib; while (newPrevW && (WINREC(newPrevW) == NULL || !newPrevW->realized || newPrevW->rootlessUnhittable != pWin->rootlessUnhittable)) newPrevW = newPrevW->prevSib; newPrev = newPrevW != NULL ? WINREC(newPrevW) : NULL; newPrevID = newPrev != NULL ? newPrev->wid : 0; /* If it exists, reorder the frame above us first. */ if (newPrev && newPrev->is_reorder_pending) { newPrev->is_reorder_pending = FALSE; RootlessReorderWindow(newPrevW); } SCREENREC(pScreen)->imp->RestackFrame(winRec->wid, newPrevID); } } /* * RootlessRestackWindow * This is a hook for when DIX changes the window stacking order. * The window has already been inserted into its new position in the * DIX window stack. We need to change the order of the physical * window to match. */ void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) { RegionRec saveRoot; RootlessWindowRec *winRec = WINREC(pWin); ScreenPtr pScreen = pWin->drawable.pScreen; RL_DEBUG_MSG("restackwindow start "); if (winRec) RL_DEBUG_MSG("restack top level \n"); HUGE_ROOT(pWin); SCREEN_UNWRAP(pScreen, RestackWindow); if (pScreen->RestackWindow) pScreen->RestackWindow(pWin, pOldNextSib); SCREEN_WRAP(pScreen, RestackWindow); NORMAL_ROOT(pWin); if (winRec && pWin->viewable) { RootlessReorderWindow(pWin); } RL_DEBUG_MSG("restackwindow end\n"); } /* * Specialized window copy procedures */ // Globals needed during window resize and move. static void *gResizeDeathBits = NULL; static int gResizeDeathCount = 0; static PixmapPtr gResizeDeathPix[2] = { NULL, NULL }; static BoxRec gResizeDeathBounds[2]; static CopyWindowProcPtr gResizeOldCopyWindowProc = NULL; /* * RootlessNoCopyWindow * CopyWindow() that doesn't do anything. For MoveWindow() of * top-level windows. */ static void RootlessNoCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { // some code expects the region to be translated int dx = ptOldOrg.x - pWin->drawable.x; int dy = ptOldOrg.y - pWin->drawable.y; RL_DEBUG_MSG("ROOTLESSNOCOPYWINDOW "); RegionTranslate(prgnSrc, -dx, -dy); } /* * RootlessResizeCopyWindow * CopyWindow used during ResizeWindow for gravity moves. Based on * fbCopyWindow. The original always draws on the root pixmap, which * we don't have. Instead, draw on the parent window's pixmap. * Resize version: the old location's pixels are in gResizeCopyWindowSource. */ static void RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWin->drawable.pScreen; RegionRec rgnDst; int dx, dy; RL_DEBUG_MSG("resizecopywindowFB start (win 0x%x) ", pWin); /* Don't unwrap pScreen->CopyWindow. The bogus rewrap with RootlessCopyWindow causes a crash if CopyWindow is called again during the same resize. */ if (gResizeDeathCount == 0) return; RootlessStartDrawing(pWin); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; RegionTranslate(prgnSrc, -dx, -dy); RegionNull(&rgnDst); RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); if (gResizeDeathCount == 1) { /* Simple case, we only have a single source pixmap. */ miCopyRegion(&gResizeDeathPix[0]->drawable, &pScreen->GetWindowPixmap(pWin)->drawable, 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); } else { int i; RegionRec clip, clipped; /* More complex case, N source pixmaps (usually two). So we intersect the destination with each source and copy those bits. */ for (i = 0; i < gResizeDeathCount; i++) { RegionInit(&clip, gResizeDeathBounds + 0, 1); RegionNull(&clipped); RegionIntersect(&rgnDst, &clip, &clipped); miCopyRegion(&gResizeDeathPix[i]->drawable, &pScreen->GetWindowPixmap(pWin)->drawable, 0, &clipped, dx, dy, fbCopyWindowProc, 0, 0); RegionUninit(&clipped); RegionUninit(&clip); } } /* Don't update - resize will update everything */ RegionUninit(&rgnDst); fbValidateDrawable(&pWin->drawable); RL_DEBUG_MSG("resizecopywindowFB end\n"); } /* * RootlessCopyWindow * Update *new* location of window. Old location is redrawn with * miPaintWindow. Cloned from fbCopyWindow. * The original always draws on the root pixmap, which we don't have. * Instead, draw on the parent window's pixmap. */ void RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWin->drawable.pScreen; RegionRec rgnDst; int dx, dy; BoxPtr extents; int area; RL_DEBUG_MSG("copywindowFB start (win 0x%x) ", pWin); SCREEN_UNWRAP(pScreen, CopyWindow); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; RegionTranslate(prgnSrc, -dx, -dy); RegionNull(&rgnDst); RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); extents = RegionExtents(&rgnDst); area = (extents->x2 - extents->x1) * (extents->y2 - extents->y1); /* If the area exceeds threshold, use the implementation's accelerated version. */ if (area > rootless_CopyWindow_threshold && SCREENREC(pScreen)->imp->CopyWindow) { RootlessWindowRec *winRec; WindowPtr top; top = TopLevelParent(pWin); if (top == NULL) { RL_DEBUG_MSG("no parent\n"); goto out; } winRec = WINREC(top); if (winRec == NULL) { RL_DEBUG_MSG("not framed\n"); goto out; } /* Move region to window local coords */ RegionTranslate(&rgnDst, -winRec->x, -winRec->y); RootlessStopDrawing(pWin, FALSE); SCREENREC(pScreen)->imp->CopyWindow(winRec->wid, RegionNumRects(&rgnDst), RegionRects(&rgnDst), dx, dy); } else { RootlessStartDrawing(pWin); miCopyRegion((DrawablePtr) pWin, (DrawablePtr) pWin, 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); /* prgnSrc has been translated to dst position */ RootlessDamageRegion(pWin, prgnSrc); } out: RegionUninit(&rgnDst); fbValidateDrawable(&pWin->drawable); SCREEN_WRAP(pScreen, CopyWindow); RL_DEBUG_MSG("copywindowFB end\n"); } /* * Window resize procedures */ enum { WIDTH_SMALLER = 1, HEIGHT_SMALLER = 2, }; /* * ResizeWeighting * Choose gravity to avoid local copies. Do that by looking for * a corner that doesn't move _relative to the screen_. */ static inline unsigned int ResizeWeighting(int oldX1, int oldY1, int oldX2, int oldY2, int oldBW, int newX1, int newY1, int newX2, int newY2, int newBW) { #ifdef ROOTLESS_RESIZE_GRAVITY if (newBW != oldBW) return RL_GRAVITY_NONE; if (newX1 == oldX1 && newY1 == oldY1) return RL_GRAVITY_NORTH_WEST; else if (newX1 == oldX1 && newY2 == oldY2) return RL_GRAVITY_SOUTH_WEST; else if (newX2 == oldX2 && newY2 == oldY2) return RL_GRAVITY_SOUTH_EAST; else if (newX2 == oldX2 && newY1 == oldY1) return RL_GRAVITY_NORTH_EAST; else return RL_GRAVITY_NONE; #else return RL_GRAVITY_NONE; #endif } /* * StartFrameResize * Prepare to resize a top-level window. The old window's pixels are * saved and the implementation is told to change the window size. * (x,y,w,h) is outer frame of window (outside border) */ static Bool StartFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, int oldW, int oldH, int oldBW, int newX, int newY, int newW, int newH, int newBW) { ScreenPtr pScreen = pWin->drawable.pScreen; RootlessWindowRec *winRec = WINREC(pWin); Bool need_window_source = FALSE, resize_after = FALSE; BoxRec rect; int oldX2, newX2; int oldY2, newY2; unsigned int weight; oldX2 = oldX + oldW, newX2 = newX + newW; oldY2 = oldY + oldH, newY2 = newY + newH; /* Decide which resize weighting to use */ weight = ResizeWeighting(oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW); /* Compute intersection between old and new rects */ rect.x1 = max(oldX, newX); rect.y1 = max(oldY, newY); rect.x2 = min(oldX2, newX2); rect.y2 = min(oldY2, newY2); RL_DEBUG_MSG("RESIZE TOPLEVEL WINDOW with gravity %i ", gravity); RL_DEBUG_MSG("%d %d %d %d %d %d %d %d %d %d\n", oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW); RootlessRedisplay(pWin); /* If gravity is true, then we need to have a way of recovering all the original bits in the window for when X rearranges the contents based on the various gravity settings. The obvious way is to just snapshot the entire backing store before resizing it, but that it slow on large windows. So the optimization here is to use the implementation's resize weighting options (if available) to allow us to reason about what is left in the backing store after the resize. We can then only copy what won't be there after the resize, and do a two-stage copy operation. Most of these optimizations are only applied when the top-left corner of the window is fixed, since that's the common case. They could probably be extended with some thought. */ gResizeDeathCount = 0; if (gravity && weight == RL_GRAVITY_NORTH_WEST) { unsigned int code = 0; /* Top left corner is anchored. We never need to copy the entire window. */ need_window_source = TRUE; /* These comparisons were chosen to avoid setting bits when the sizes are the same. (So the fastest case automatically gets taken when dimensions are unchanging.) */ if (newW < oldW) code |= WIDTH_SMALLER; if (newH < oldH) code |= HEIGHT_SMALLER; if (((code ^ (code >> 1)) & 1) == 0) { /* Both dimensions are either getting larger, or both are getting smaller. No need to copy anything. */ if (code == (WIDTH_SMALLER | HEIGHT_SMALLER)) { /* Since the window is getting smaller, we can do gravity repair on it with it's current size, then resize it afterwards. */ resize_after = TRUE; } gResizeDeathCount = 1; } else { unsigned int copy_rowbytes, Bpp; unsigned int copy_rect_width, copy_rect_height; BoxRec copy_rect; /* We can get away with a partial copy. 'rect' is the intersection between old and new bounds, so copy everything to the right of or below the intersection. */ RootlessStartDrawing(pWin); if (code == WIDTH_SMALLER) { copy_rect.x1 = rect.x2; copy_rect.y1 = rect.y1; copy_rect.x2 = oldX2; copy_rect.y2 = oldY2; } else if (code == HEIGHT_SMALLER) { copy_rect.x1 = rect.x1; copy_rect.y1 = rect.y2; copy_rect.x2 = oldX2; copy_rect.y2 = oldY2; } else OsAbort(); Bpp = winRec->win->drawable.bitsPerPixel / 8; copy_rect_width = copy_rect.x2 - copy_rect.x1; copy_rect_height = copy_rect.y2 - copy_rect.y1; copy_rowbytes = ((copy_rect_width * Bpp) + 31) & ~31; gResizeDeathBits = malloc(copy_rowbytes * copy_rect_height); if (copy_rect_width * copy_rect_height > rootless_CopyBytes_threshold && SCREENREC(pScreen)->imp->CopyBytes) { SCREENREC(pScreen)->imp->CopyBytes(copy_rect_width * Bpp, copy_rect_height, ((char *) winRec->pixelData) + ((copy_rect.y1 - oldY) * winRec->bytesPerRow) + (copy_rect.x1 - oldX) * Bpp, winRec->bytesPerRow, gResizeDeathBits, copy_rowbytes); } else { fbBlt((FbBits *) (winRec->pixelData + ((copy_rect.y1 - oldY) * winRec->bytesPerRow) + (copy_rect.x1 - oldX) * Bpp), winRec->bytesPerRow / sizeof(FbBits), 0, (FbBits *) gResizeDeathBits, copy_rowbytes / sizeof(FbBits), 0, copy_rect_width * Bpp, copy_rect_height, GXcopy, FB_ALLONES, Bpp, 0, 0); } gResizeDeathBounds[1] = copy_rect; gResizeDeathPix[1] = GetScratchPixmapHeader(pScreen, copy_rect_width, copy_rect_height, winRec->win->drawable.depth, winRec->win->drawable.bitsPerPixel, winRec->bytesPerRow, (void *) gResizeDeathBits); SetPixmapBaseToScreen(gResizeDeathPix[1], copy_rect.x1, copy_rect.y1); gResizeDeathCount = 2; } } else if (gravity) { /* The general case. Just copy everything. */ RootlessStartDrawing(pWin); gResizeDeathBits = malloc(winRec->bytesPerRow * winRec->height); memcpy(gResizeDeathBits, winRec->pixelData, winRec->bytesPerRow * winRec->height); gResizeDeathBounds[0] = (BoxRec) { oldX, oldY, oldX2, oldY2}; gResizeDeathPix[0] = GetScratchPixmapHeader(pScreen, winRec->width, winRec->height, winRec->win->drawable.depth, winRec->win->drawable.bitsPerPixel, winRec->bytesPerRow, (void *) gResizeDeathBits); SetPixmapBaseToScreen(gResizeDeathPix[0], oldX, oldY); gResizeDeathCount = 1; } RootlessStopDrawing(pWin, FALSE); winRec->x = newX; winRec->y = newY; winRec->width = newW; winRec->height = newH; winRec->borderWidth = newBW; /* Unless both dimensions are getting smaller, Resize the frame before doing gravity repair */ if (!resize_after) { SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen, newX + SCREEN_TO_GLOBAL_X, newY + SCREEN_TO_GLOBAL_Y, newW, newH, weight); } RootlessStartDrawing(pWin); /* If necessary, create a source pixmap pointing at the current window bits. */ if (need_window_source) { gResizeDeathBounds[0] = (BoxRec) { oldX, oldY, oldX2, oldY2}; gResizeDeathPix[0] = GetScratchPixmapHeader(pScreen, oldW, oldH, winRec->win->drawable.depth, winRec->win->drawable.bitsPerPixel, winRec->bytesPerRow, winRec->pixelData); SetPixmapBaseToScreen(gResizeDeathPix[0], oldX, oldY); } /* Use custom CopyWindow when moving gravity bits around ResizeWindow assumes the old window contents are in the same pixmap, but here they're in deathPix instead. */ if (gravity) { gResizeOldCopyWindowProc = pScreen->CopyWindow; pScreen->CopyWindow = RootlessResizeCopyWindow; } /* If we can't rely on the window server preserving the bits we need in the position we need, copy the pixels in the intersection from src to dst. ResizeWindow assumes these pixels are already present when making gravity adjustments. pWin currently has new-sized pixmap but is in old position. FIXME: border width change! (?) */ if (gravity && weight == RL_GRAVITY_NONE) { PixmapPtr src, dst; assert(gResizeDeathCount == 1); src = gResizeDeathPix[0]; dst = pScreen->GetWindowPixmap(pWin); RL_DEBUG_MSG("Resize copy rect %d %d %d %d\n", rect.x1, rect.y1, rect.x2, rect.y2); /* rect is the intersection of the old location and new location */ if (BOX_NOT_EMPTY(rect) && src != NULL && dst != NULL) { /* The window drawable still has the old frame position, which means that DST doesn't actually point at the origin of our physical backing store when adjusted by the drawable.x,y position. So sneakily adjust it temporarily while copying.. */ ((PixmapPtr) dst)->devPrivate.ptr = winRec->pixelData; SetPixmapBaseToScreen(dst, newX, newY); fbCopyWindowProc(&src->drawable, &dst->drawable, NULL, &rect, 1, 0, 0, FALSE, FALSE, 0, 0); ((PixmapPtr) dst)->devPrivate.ptr = winRec->pixelData; SetPixmapBaseToScreen(dst, oldX, oldY); } } return resize_after; } static void FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, unsigned int oldW, unsigned int oldH, unsigned int oldBW, int newX, int newY, unsigned int newW, unsigned int newH, unsigned int newBW, Bool resize_now) { ScreenPtr pScreen = pWin->drawable.pScreen; RootlessWindowRec *winRec = WINREC(pWin); int i; RootlessStopDrawing(pWin, FALSE); if (resize_now) { unsigned int weight; /* We didn't resize anything earlier, so do it now, now that we've finished gravitating the bits. */ weight = ResizeWeighting(oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW); SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen, newX + SCREEN_TO_GLOBAL_X, newY + SCREEN_TO_GLOBAL_Y, newW, newH, weight); } /* Redraw everything. FIXME: there must be times when we don't need to do this. Perhaps when top-left weighting and no gravity? */ RootlessDamageRect(pWin, -newBW, -newBW, newW, newH); for (i = 0; i < 2; i++) { if (gResizeDeathPix[i] != NULL) { FreeScratchPixmapHeader(gResizeDeathPix[i]); gResizeDeathPix[i] = NULL; } } free(gResizeDeathBits); gResizeDeathBits = NULL; if (gravity) { pScreen->CopyWindow = gResizeOldCopyWindowProc; } } /* * RootlessMoveWindow * If kind==VTOther, window border is resizing (and borderWidth is * already changed!!@#$) This case works like window resize, not move. */ void RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind) { RootlessWindowRec *winRec = WINREC(pWin); ScreenPtr pScreen = pWin->drawable.pScreen; CopyWindowProcPtr oldCopyWindowProc = NULL; int oldX = 0, oldY = 0, newX = 0, newY = 0; unsigned int oldW = 0, oldH = 0, oldBW = 0; unsigned int newW = 0, newH = 0, newBW = 0; Bool resize_after = FALSE; RegionRec saveRoot; RL_DEBUG_MSG("movewindow start \n"); if (winRec) { if (kind == VTMove) { oldX = winRec->x; oldY = winRec->y; RootlessRedisplay(pWin); RootlessStartDrawing(pWin); } else { RL_DEBUG_MSG("movewindow border resizing "); oldBW = winRec->borderWidth; oldX = winRec->x; oldY = winRec->y; oldW = winRec->width; oldH = winRec->height; newBW = wBorderWidth(pWin); newX = x; newY = y; newW = pWin->drawable.width + 2 * newBW; newH = pWin->drawable.height + 2 * newBW; resize_after = StartFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW); } } HUGE_ROOT(pWin); SCREEN_UNWRAP(pScreen, MoveWindow); if (winRec) { oldCopyWindowProc = pScreen->CopyWindow; pScreen->CopyWindow = RootlessNoCopyWindow; } pScreen->MoveWindow(pWin, x, y, pSib, kind); if (winRec) { pScreen->CopyWindow = oldCopyWindowProc; } NORMAL_ROOT(pWin); SCREEN_WRAP(pScreen, MoveWindow); if (winRec) { if (kind == VTMove) { winRec->x = x; winRec->y = y; RootlessStopDrawing(pWin, FALSE); SCREENREC(pScreen)->imp->MoveFrame(winRec->wid, pScreen, x + SCREEN_TO_GLOBAL_X, y + SCREEN_TO_GLOBAL_Y); } else { FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW, resize_after); } } RL_DEBUG_MSG("movewindow end\n"); } /* * RootlessResizeWindow * Note: (x, y, w, h) as passed to this procedure don't match the frame * definition. (x,y) is corner of very outer edge, *outside* border. * w,h is width and height *inside* border, *ignoring* border width. * The rect (x, y, w, h) doesn't mean anything. (x, y, w+2*bw, h+2*bw) * is total rect and (x+bw, y+bw, w, h) is inner rect. */ void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib) { RootlessWindowRec *winRec = WINREC(pWin); ScreenPtr pScreen = pWin->drawable.pScreen; int oldX = 0, oldY = 0, newX = 0, newY = 0; unsigned int oldW = 0, oldH = 0, oldBW = 0, newW = 0, newH = 0, newBW = 0; Bool resize_after = FALSE; RegionRec saveRoot; RL_DEBUG_MSG("resizewindow start (win 0x%x) ", pWin); if (pWin->parent) { if (winRec) { oldBW = winRec->borderWidth; oldX = winRec->x; oldY = winRec->y; oldW = winRec->width; oldH = winRec->height; newBW = oldBW; newX = x; newY = y; newW = w + 2 * newBW; newH = h + 2 * newBW; resize_after = StartFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW); } HUGE_ROOT(pWin); SCREEN_UNWRAP(pScreen, ResizeWindow); pScreen->ResizeWindow(pWin, x, y, w, h, pSib); SCREEN_WRAP(pScreen, ResizeWindow); NORMAL_ROOT(pWin); if (winRec) { FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW, resize_after); } } else { /* Special case for resizing the root window */ BoxRec box; pWin->drawable.x = x; pWin->drawable.y = y; pWin->drawable.width = w; pWin->drawable.height = h; box.x1 = x; box.y1 = y; box.x2 = x + w; box.y2 = y + h; RegionUninit(&pWin->winSize); RegionInit(&pWin->winSize, &box, 1); RegionCopy(&pWin->borderSize, &pWin->winSize); RegionCopy(&pWin->clipList, &pWin->winSize); RegionCopy(&pWin->borderClip, &pWin->winSize); if (winRec) { SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen, x + SCREEN_TO_GLOBAL_X, y + SCREEN_TO_GLOBAL_Y, w, h, RL_GRAVITY_NONE); } miSendExposures(pWin, &pWin->borderClip, pWin->drawable.x, pWin->drawable.y); } RL_DEBUG_MSG("resizewindow end\n"); } /* * RootlessRepositionWindow * Called by the implementation when a window needs to be repositioned to * its correct location on the screen. This routine is typically needed * due to changes in the underlying window system, such as a screen layout * change. */ void RootlessRepositionWindow(WindowPtr pWin) { RootlessWindowRec *winRec = WINREC(pWin); ScreenPtr pScreen = pWin->drawable.pScreen; if (winRec == NULL) return; RootlessStopDrawing(pWin, FALSE); SCREENREC(pScreen)->imp->MoveFrame(winRec->wid, pScreen, winRec->x + SCREEN_TO_GLOBAL_X, winRec->y + SCREEN_TO_GLOBAL_Y); RootlessReorderWindow(pWin); } /* * RootlessReparentWindow * Called after a window has been reparented. Generally windows are not * framed until they are mapped. However, a window may be framed early by the * implementation calling RootlessFrameForWindow. (e.g. this could be needed * to attach a VRAM surface to it.) If the window is subsequently reparented * by the window manager before being mapped, we need to give the frame to * the new top-level window. */ void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent) { ScreenPtr pScreen = pWin->drawable.pScreen; RootlessWindowRec *winRec = WINREC(pWin); WindowPtr pTopWin; /* Check that window is not top-level now, but used to be. */ if (IsRoot(pWin) || IsRoot(pWin->parent) || IsTopLevel(pWin) || winRec == NULL) { goto out; } /* If the formerly top-level window has a frame, we want to give the frame to its new top-level parent. If we can't do that, we'll just have to jettison it... */ pTopWin = TopLevelParent(pWin); assert(pTopWin != pWin); pWin->rootlessUnhittable = FALSE; DeleteProperty(serverClient, pWin, xa_native_window_id()); if (WINREC(pTopWin) != NULL) { /* We're screwed. */ RootlessDestroyFrame(pWin, winRec); } else { if (!pTopWin->realized && pWin->realized) { SCREENREC(pScreen)->imp->UnmapFrame(winRec->wid); } /* Switch the frame record from one to the other. */ SETWINREC(pWin, NULL); SETWINREC(pTopWin, winRec); RootlessInitializeFrame(pTopWin, winRec); RootlessReshapeFrame(pTopWin); SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen, winRec->x + SCREEN_TO_GLOBAL_X, winRec->y + SCREEN_TO_GLOBAL_Y, winRec->width, winRec->height, RL_GRAVITY_NONE); if (SCREENREC(pScreen)->imp->SwitchWindow) { SCREENREC(pScreen)->imp->SwitchWindow(winRec, pWin); } if (pTopWin->realized && !pWin->realized) winRec->is_reorder_pending = TRUE; } out: if (SCREENREC(pScreen)->ReparentWindow) { SCREEN_UNWRAP(pScreen, ReparentWindow); pScreen->ReparentWindow(pWin, pPriorParent); SCREEN_WRAP(pScreen, ReparentWindow); } } void RootlessFlushWindowColormap(WindowPtr pWin) { RootlessWindowRec *winRec = WINREC(pWin); ScreenPtr pScreen = pWin->drawable.pScreen; if (winRec == NULL) return; RootlessStopDrawing(pWin, FALSE); if (SCREENREC(pScreen)->imp->UpdateColormap) SCREENREC(pScreen)->imp->UpdateColormap(winRec->wid, pScreen); } /* * RootlessChangeBorderWidth * FIXME: untested! * pWin inside corner stays the same; pWin->drawable.[xy] stays the same * Frame moves and resizes. */ void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width) { RegionRec saveRoot; Bool resize_after = FALSE; RL_DEBUG_MSG("change border width "); if (width != wBorderWidth(pWin)) { RootlessWindowRec *winRec = WINREC(pWin); int oldX = 0, oldY = 0, newX = 0, newY = 0; unsigned int oldW = 0, oldH = 0, oldBW = 0; unsigned int newW = 0, newH = 0, newBW = 0; if (winRec) { oldBW = winRec->borderWidth; oldX = winRec->x; oldY = winRec->y; oldW = winRec->width; oldH = winRec->height; newBW = width; newX = pWin->drawable.x - newBW; newY = pWin->drawable.y - newBW; newW = pWin->drawable.width + 2 * newBW; newH = pWin->drawable.height + 2 * newBW; resize_after = StartFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW); } HUGE_ROOT(pWin); SCREEN_UNWRAP(pWin->drawable.pScreen, ChangeBorderWidth); pWin->drawable.pScreen->ChangeBorderWidth(pWin, width); SCREEN_WRAP(pWin->drawable.pScreen, ChangeBorderWidth); NORMAL_ROOT(pWin); if (winRec) { FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW, newX, newY, newW, newH, newBW, resize_after); } } RL_DEBUG_MSG("change border width end\n"); } /* * RootlessOrderAllWindows * Brings all X11 windows to the top of the window stack * (i.e in front of Aqua windows) -- called when X11.app is given focus */ void RootlessOrderAllWindows(Bool include_unhitable) { int i; WindowPtr pWin; if (windows_hidden) return; RL_DEBUG_MSG("RootlessOrderAllWindows() "); for (i = 0; i < screenInfo.numScreens; i++) { if (screenInfo.screens[i] == NULL) continue; pWin = screenInfo.screens[i]->root; if (pWin == NULL) continue; for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) { if (!pWin->realized) continue; if (RootlessEnsureFrame(pWin) == NULL) continue; if (!include_unhitable && pWin->rootlessUnhittable) continue; RootlessReorderWindow(pWin); } } RL_DEBUG_MSG("RootlessOrderAllWindows() done"); } void RootlessEnableRoot(ScreenPtr pScreen) { WindowPtr pRoot; pRoot = pScreen->root; RootlessEnsureFrame(pRoot); (*pScreen->ClearToBackground) (pRoot, 0, 0, 0, 0, TRUE); RootlessReorderWindow(pRoot); } void RootlessDisableRoot(ScreenPtr pScreen) { WindowPtr pRoot; RootlessWindowRec *winRec; pRoot = pScreen->root; winRec = WINREC(pRoot); if (NULL == winRec) return; RootlessDestroyFrame(pRoot, winRec); DeleteProperty(serverClient, pRoot, xa_native_window_id()); } void RootlessHideAllWindows(void) { int i; ScreenPtr pScreen; WindowPtr pWin; RootlessWindowRec *winRec; if (windows_hidden) return; windows_hidden = TRUE; for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; if (pScreen == NULL) continue; pWin = pScreen->root; if (pWin == NULL) continue; for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) { if (!pWin->realized) continue; RootlessStopDrawing(pWin, FALSE); winRec = WINREC(pWin); if (winRec != NULL) { if (SCREENREC(pScreen)->imp->HideWindow) SCREENREC(pScreen)->imp->HideWindow(winRec->wid); } } } } void RootlessShowAllWindows(void) { int i; ScreenPtr pScreen; WindowPtr pWin; RootlessWindowRec *winRec; if (!windows_hidden) return; windows_hidden = FALSE; for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; if (pScreen == NULL) continue; pWin = pScreen->root; if (pWin == NULL) continue; for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) { if (!pWin->realized) continue; winRec = RootlessEnsureFrame(pWin); if (winRec == NULL) continue; RootlessReorderWindow(pWin); } RootlessScreenExpose(pScreen); } } /* * SetPixmapOfAncestors * Set the Pixmaps on all ParentRelative windows up the ancestor chain. */ void RootlessSetPixmapOfAncestors(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr topWin = TopLevelParent(pWin); RootlessWindowRec *topWinRec = WINREC(topWin); while (pWin->backgroundState == ParentRelative) { if (pWin == topWin) { // disallow ParentRelative background state on top level XID pixel = 0; ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin); break; } pWin = pWin->parent; pScreen->SetWindowPixmap(pWin, topWinRec->pixmap); } } xorg-server-1.17.1/miext/sync/0000775000175100017510000000000012466505443013204 500000000000000xorg-server-1.17.1/miext/sync/Makefile.am0000664000175100017510000000047112272307253015154 00000000000000noinst_LTLIBRARIES = libsync.la AM_CFLAGS = $(DIX_CFLAGS) AM_CPPFLAGS = if XORG sdk_HEADERS = misync.h misyncstr.h misyncshm.h misyncfd.h endif XSHMFENCE_SRCS = misyncshm.c libsync_la_SOURCES = \ misync.c \ misync.h \ misyncfd.c \ misyncstr.h if XSHMFENCE libsync_la_SOURCES += $(XSHMFENCE_SRCS) endif xorg-server-1.17.1/miext/sync/misyncstr.h0000664000175100017510000000702312323563340015322 00000000000000/* * Copyright © 2010 NVIDIA Corporation * * 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 #ifndef _MISYNCSTR_H_ #define _MISYNCSTR_H_ #include "dix.h" #include "misync.h" #include "scrnintstr.h" #include #define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */ /* Sync object types */ #define SYNC_COUNTER 0 #define SYNC_FENCE 1 typedef struct _SyncObject { ClientPtr client; /* Owning client. 0 for system counters */ struct _SyncTriggerList *pTriglist; /* list of triggers */ XID id; /* resource ID */ unsigned char type; /* SYNC_* */ Bool beingDestroyed; /* in process of going away */ } SyncObject; typedef struct _SyncCounter { SyncObject sync; /* Common sync object data */ CARD64 value; /* counter value */ struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */ } SyncCounter; struct _SyncFence { SyncObject sync; /* Common sync object data */ ScreenPtr pScreen; /* Screen of this fence object */ SyncFenceFuncsRec funcs; /* Funcs for performing ops on fence */ Bool triggered; /* fence state */ PrivateRec *devPrivates; /* driver-specific per-fence data */ }; struct _SyncTrigger { SyncObject *pSync; CARD64 wait_value; /* wait value */ unsigned int value_type; /* Absolute or Relative */ unsigned int test_type; /* transition or Comparision type */ CARD64 test_value; /* trigger event threshold value */ Bool (*CheckTrigger) (struct _SyncTrigger * /*pTrigger */ , CARD64 /*newval */ ); void (*TriggerFired) (struct _SyncTrigger * /*pTrigger */ ); void (*CounterDestroyed) (struct _SyncTrigger * /*pTrigger */ ); }; typedef struct _SyncTriggerList { SyncTrigger *pTrigger; struct _SyncTriggerList *next; } SyncTriggerList; extern DevPrivateKeyRec miSyncScreenPrivateKey; #define SYNC_SCREEN_PRIV(pScreen) \ (SyncScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, \ &miSyncScreenPrivateKey) typedef struct _syncScreenPriv { /* Wrappable sync-specific screen functions */ SyncScreenFuncsRec funcs; /* Wrapped screen functions */ CloseScreenProcPtr CloseScreen; } SyncScreenPrivRec, *SyncScreenPrivPtr; #endif /* _MISYNCSTR_H_ */ xorg-server-1.17.1/miext/sync/misyncfd.h0000664000175100017510000000402212274325511015100 00000000000000/* * Copyright © 2013 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. */ #ifndef _MISYNCFD_H_ #define _MISYNCFD_H_ typedef int (*SyncScreenCreateFenceFromFdFunc) (ScreenPtr screen, SyncFence *fence, int fd, Bool initially_triggered); typedef int (*SyncScreenGetFenceFdFunc) (ScreenPtr screen, SyncFence *fence); #define SYNC_FD_SCREEN_FUNCS_VERSION 1 typedef struct _syncFdScreenFuncs { int version; SyncScreenCreateFenceFromFdFunc CreateFenceFromFd; SyncScreenGetFenceFdFunc GetFenceFd; } SyncFdScreenFuncsRec, *SyncFdScreenFuncsPtr; extern _X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen, const SyncFdScreenFuncsRec *funcs); #endif /* _MISYNCFD_H_ */ xorg-server-1.17.1/miext/sync/misyncfd.c0000664000175100017510000000614012456571574015114 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "scrnintstr.h" #include "misync.h" #include "misyncstr.h" #include "misyncfd.h" #include "pixmapstr.h" static DevPrivateKeyRec syncFdScreenPrivateKey; typedef struct _SyncFdScreenPrivate { SyncFdScreenFuncsRec funcs; } SyncFdScreenPrivateRec, *SyncFdScreenPrivatePtr; static inline SyncFdScreenPrivatePtr sync_fd_screen_priv(ScreenPtr pScreen) { if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey)) return NULL; return dixLookupPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey); } int miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initially_triggered) { SyncFdScreenPrivatePtr priv = sync_fd_screen_priv(pDraw->pScreen); if (!priv) return BadMatch; return (*priv->funcs.CreateFenceFromFd)(pDraw->pScreen, pFence, fd, initially_triggered); } int miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence) { SyncFdScreenPrivatePtr priv = sync_fd_screen_priv(pDraw->pScreen); if (!priv) return -1; return (*priv->funcs.GetFenceFd)(pDraw->pScreen, pFence); } _X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen, const SyncFdScreenFuncsRec *funcs) { SyncFdScreenPrivatePtr priv; /* Check to see if we've already been initialized */ if (sync_fd_screen_priv(pScreen) != NULL) return FALSE; if (!miSyncSetup(pScreen)) return FALSE; if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey)) { if (!dixRegisterPrivateKey(&syncFdScreenPrivateKey, PRIVATE_SCREEN, 0)) return FALSE; } priv = calloc(1, sizeof (SyncFdScreenPrivateRec)); if (!priv) return FALSE; /* Will require version checks when there are multiple versions * of the funcs structure */ priv->funcs = *funcs; dixSetPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey, priv); return TRUE; } xorg-server-1.17.1/miext/sync/misyncshm.h0000664000175100017510000000245612274325511015307 00000000000000/* * Copyright © 2013 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. */ #ifndef _MISYNCSHM_H_ #define _MISYNCSHM_H_ extern _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen); #endif /* _MISYNCSHM_H_ */ xorg-server-1.17.1/miext/sync/misyncshm.c0000664000175100017510000001226012274325511015274 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "scrnintstr.h" #include "misync.h" #include "misyncstr.h" #include "misyncshm.h" #include "misyncfd.h" #include "pixmapstr.h" #include #include #include #include static DevPrivateKeyRec syncShmFencePrivateKey; typedef struct _SyncShmFencePrivate { struct xshmfence *fence; int fd; } SyncShmFencePrivateRec, *SyncShmFencePrivatePtr; #define SYNC_FENCE_PRIV(pFence) \ (SyncShmFencePrivatePtr) dixLookupPrivate(&pFence->devPrivates, &syncShmFencePrivateKey) static void miSyncShmFenceSetTriggered(SyncFence * pFence) { SyncShmFencePrivatePtr pPriv = SYNC_FENCE_PRIV(pFence); if (pPriv->fence) xshmfence_trigger(pPriv->fence); miSyncFenceSetTriggered(pFence); } static void miSyncShmFenceReset(SyncFence * pFence) { SyncShmFencePrivatePtr pPriv = SYNC_FENCE_PRIV(pFence); if (pPriv->fence) xshmfence_reset(pPriv->fence); miSyncFenceReset(pFence); } static Bool miSyncShmFenceCheckTriggered(SyncFence * pFence) { SyncShmFencePrivatePtr pPriv = SYNC_FENCE_PRIV(pFence); if (pPriv->fence) return xshmfence_query(pPriv->fence); else return miSyncFenceCheckTriggered(pFence); } static void miSyncShmFenceAddTrigger(SyncTrigger * pTrigger) { miSyncFenceAddTrigger(pTrigger); } static void miSyncShmFenceDeleteTrigger(SyncTrigger * pTrigger) { miSyncFenceDeleteTrigger(pTrigger); } static const SyncFenceFuncsRec miSyncShmFenceFuncs = { &miSyncShmFenceSetTriggered, &miSyncShmFenceReset, &miSyncShmFenceCheckTriggered, &miSyncShmFenceAddTrigger, &miSyncShmFenceDeleteTrigger }; static void miSyncShmScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered) { SyncShmFencePrivatePtr pPriv = SYNC_FENCE_PRIV(pFence); pPriv->fence = NULL; miSyncScreenCreateFence(pScreen, pFence, initially_triggered); pFence->funcs = miSyncShmFenceFuncs; } static void miSyncShmScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence) { SyncShmFencePrivatePtr pPriv = SYNC_FENCE_PRIV(pFence); if (pPriv->fence) { xshmfence_trigger(pPriv->fence); xshmfence_unmap_shm(pPriv->fence); close(pPriv->fd); } miSyncScreenDestroyFence(pScreen, pFence); } static int miSyncShmCreateFenceFromFd(ScreenPtr pScreen, SyncFence *pFence, int fd, Bool initially_triggered) { SyncShmFencePrivatePtr pPriv = SYNC_FENCE_PRIV(pFence); miSyncInitFence(pScreen, pFence, initially_triggered); fd = os_move_fd(fd); pPriv->fence = xshmfence_map_shm(fd); if (pPriv->fence) { pPriv->fd = fd; return Success; } else close(fd); return BadValue; } static int miSyncShmGetFenceFd(ScreenPtr pScreen, SyncFence *pFence) { SyncShmFencePrivatePtr pPriv = SYNC_FENCE_PRIV(pFence); if (!pPriv->fence) { pPriv->fd = xshmfence_alloc_shm(); if (pPriv->fd < 0) return -1; pPriv->fd = os_move_fd(pPriv->fd); pPriv->fence = xshmfence_map_shm(pPriv->fd); if (!pPriv->fence) { close (pPriv->fd); return -1; } } return pPriv->fd; } static const SyncFdScreenFuncsRec miSyncShmScreenFuncs = { .version = SYNC_FD_SCREEN_FUNCS_VERSION, .CreateFenceFromFd = miSyncShmCreateFenceFromFd, .GetFenceFd = miSyncShmGetFenceFd }; _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen) { SyncScreenFuncsPtr funcs; if (!miSyncFdScreenInit(pScreen, &miSyncShmScreenFuncs)) return FALSE; if (!dixPrivateKeyRegistered(&syncShmFencePrivateKey)) { if (!dixRegisterPrivateKey(&syncShmFencePrivateKey, PRIVATE_SYNC_FENCE, sizeof(SyncShmFencePrivateRec))) return FALSE; } funcs = miSyncGetScreenFuncs(pScreen); funcs->CreateFence = miSyncShmScreenCreateFence; funcs->DestroyFence = miSyncShmScreenDestroyFence; return TRUE; } xorg-server-1.17.1/miext/sync/misync.c0000664000175100017510000001160512274325511014566 00000000000000/* * Copyright © 2010 NVIDIA Corporation * * 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 "scrnintstr.h" #include "misync.h" #include "misyncstr.h" DevPrivateKeyRec miSyncScreenPrivateKey; /* Default implementations of the sync screen functions */ void miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered) { (void) pScreen; pFence->triggered = initially_triggered; } void miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence) { (void) pScreen; (void) pFence; } /* Default implementations of the per-object functions */ void miSyncFenceSetTriggered(SyncFence * pFence) { pFence->triggered = TRUE; } void miSyncFenceReset(SyncFence * pFence) { pFence->triggered = FALSE; } Bool miSyncFenceCheckTriggered(SyncFence * pFence) { return pFence->triggered; } void miSyncFenceAddTrigger(SyncTrigger * pTrigger) { (void) pTrigger; return; } void miSyncFenceDeleteTrigger(SyncTrigger * pTrigger) { (void) pTrigger; return; } /* Machine independent portion of the fence sync object implementation */ void miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered) { SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); static const SyncFenceFuncsRec miSyncFenceFuncs = { &miSyncFenceSetTriggered, &miSyncFenceReset, &miSyncFenceCheckTriggered, &miSyncFenceAddTrigger, &miSyncFenceDeleteTrigger }; pFence->pScreen = pScreen; pFence->funcs = miSyncFenceFuncs; pScreenPriv->funcs.CreateFence(pScreen, pFence, initially_triggered); } void miSyncDestroyFence(SyncFence * pFence) { ScreenPtr pScreen = pFence->pScreen; SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); SyncTriggerList *ptl, *pNext; pFence->sync.beingDestroyed = TRUE; /* tell all the fence's triggers that the counter has been destroyed */ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) { (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger); pNext = ptl->next; free(ptl); /* destroy the trigger list as we go */ } pScreenPriv->funcs.DestroyFence(pScreen, pFence); dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE); } void miSyncTriggerFence(SyncFence * pFence) { SyncTriggerList *ptl, *pNext; CARD64 unused; pFence->funcs.SetTriggered(pFence); XSyncIntToValue(&unused, 0L); /* run through triggers to see if any fired */ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) { pNext = ptl->next; if ((*ptl->pTrigger->CheckTrigger) (ptl->pTrigger, unused)) (*ptl->pTrigger->TriggerFired) (ptl->pTrigger); } } SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen) { SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); return &pScreenPriv->funcs; } static Bool SyncCloseScreen(ScreenPtr pScreen) { SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; return (*pScreen->CloseScreen) (pScreen); } Bool miSyncSetup(ScreenPtr pScreen) { SyncScreenPrivPtr pScreenPriv; static const SyncScreenFuncsRec miSyncScreenFuncs = { &miSyncScreenCreateFence, &miSyncScreenDestroyFence }; if (!dixPrivateKeyRegistered(&miSyncScreenPrivateKey)) { if (!dixRegisterPrivateKey(&miSyncScreenPrivateKey, PRIVATE_SCREEN, sizeof(SyncScreenPrivRec))) return FALSE; } pScreenPriv = SYNC_SCREEN_PRIV(pScreen); if (!pScreenPriv->funcs.CreateFence) { pScreenPriv->funcs = miSyncScreenFuncs; /* Wrap CloseScreen to clean up */ pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = SyncCloseScreen; } return TRUE; } xorg-server-1.17.1/miext/sync/Makefile.in0000664000175100017510000006636112466505435015206 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @XSHMFENCE_TRUE@am__append_1 = $(XSHMFENCE_SRCS) subdir = miext/sync DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libsync_la_LIBADD = am__libsync_la_SOURCES_DIST = misync.c misync.h misyncfd.c misyncstr.h \ misyncshm.c am__objects_1 = misyncshm.lo @XSHMFENCE_TRUE@am__objects_2 = $(am__objects_1) am_libsync_la_OBJECTS = misync.lo misyncfd.lo $(am__objects_2) libsync_la_OBJECTS = $(am_libsync_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 = $(libsync_la_SOURCES) DIST_SOURCES = $(am__libsync_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 am__sdk_HEADERS_DIST = misync.h misyncstr.h misyncshm.h misyncfd.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libsync.la AM_CFLAGS = $(DIX_CFLAGS) AM_CPPFLAGS = @XORG_TRUE@sdk_HEADERS = misync.h misyncstr.h misyncshm.h misyncfd.h XSHMFENCE_SRCS = misyncshm.c libsync_la_SOURCES = misync.c misync.h misyncfd.c misyncstr.h \ $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/sync/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign miext/sync/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libsync.la: $(libsync_la_OBJECTS) $(libsync_la_DEPENDENCIES) $(EXTRA_libsync_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libsync_la_OBJECTS) $(libsync_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misyncfd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misyncshm.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/miext/sync/misync.h0000664000175100017510000000666012274325511014600 00000000000000/* * Copyright © 2010 NVIDIA Corporation * * 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 #ifndef _MISYNC_H_ #define _MISYNC_H_ typedef struct _SyncFence SyncFence; typedef struct _SyncTrigger SyncTrigger; typedef void (*SyncScreenCreateFenceFunc) (ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered); typedef void (*SyncScreenDestroyFenceFunc) (ScreenPtr pScreen, SyncFence * pFence); typedef struct _syncScreenFuncs { SyncScreenCreateFenceFunc CreateFence; SyncScreenDestroyFenceFunc DestroyFence; } SyncScreenFuncsRec, *SyncScreenFuncsPtr; extern _X_EXPORT void miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered); extern _X_EXPORT void miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence); typedef void (*SyncFenceSetTriggeredFunc) (SyncFence * pFence); typedef void (*SyncFenceResetFunc) (SyncFence * pFence); typedef Bool (*SyncFenceCheckTriggeredFunc) (SyncFence * pFence); typedef void (*SyncFenceAddTriggerFunc) (SyncTrigger * pTrigger); typedef void (*SyncFenceDeleteTriggerFunc) (SyncTrigger * pTrigger); typedef struct _syncFenceFuncs { SyncFenceSetTriggeredFunc SetTriggered; SyncFenceResetFunc Reset; SyncFenceCheckTriggeredFunc CheckTriggered; SyncFenceAddTriggerFunc AddTrigger; SyncFenceDeleteTriggerFunc DeleteTrigger; } SyncFenceFuncsRec, *SyncFenceFuncsPtr; extern _X_EXPORT void miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered); extern _X_EXPORT void miSyncDestroyFence(SyncFence * pFence); extern _X_EXPORT void miSyncTriggerFence(SyncFence * pFence); extern _X_EXPORT SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen); extern _X_EXPORT Bool miSyncSetup(ScreenPtr pScreen); Bool miSyncFenceCheckTriggered(SyncFence * pFence); void miSyncFenceSetTriggered(SyncFence * pFence); void miSyncFenceReset(SyncFence * pFence); void miSyncFenceAddTrigger(SyncTrigger * pTrigger); void miSyncFenceDeleteTrigger(SyncTrigger * pTrigger); int miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initially_triggered); int miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence); #endif /* _MISYNC_H_ */ xorg-server-1.17.1/miext/Makefile.in0000664000175100017510000006271712466505435014233 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @XQUARTZ_TRUE@am__append_1 = rootless @XWIN_MULTIWINDOWEXTWM_TRUE@am__append_2 = rootless subdir = miext DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = sync damage shadow $(am__append_1) $(am__append_2) DIST_SUBDIRS = sync damage shadow rootless all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(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/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign miext/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am 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: xorg-server-1.17.1/miext/shadow/0000775000175100017510000000000012466505443013515 500000000000000xorg-server-1.17.1/miext/shadow/Makefile.am0000664000175100017510000000114712223625541015465 00000000000000noinst_LTLIBRARIES = libshadow.la AM_CFLAGS = $(DIX_CFLAGS) if XORG sdk_HEADERS = shadow.h endif libshadow_la_SOURCES = \ c2p_core.h \ shadow.c \ shadow.h \ shafb4.c \ shafb8.c \ shalloc.c \ shiplan2p4.c \ shiplan2p8.c \ shpacked.c \ shplanar8.c \ shplanar.c \ shrot16pack_180.c \ shrot16pack_270.c \ shrot16pack_270YX.c \ shrot16pack_90.c \ shrot16pack_90YX.c \ shrot16pack.c \ shrot32pack_180.c \ shrot32pack_270.c \ shrot32pack_90.c \ shrot32pack.c \ shrot8pack_180.c \ shrot8pack_270.c \ shrot8pack_90.c \ shrot8pack.c \ shrotate.c \ shrotpack.h \ shrotpackYX.h xorg-server-1.17.1/miext/shadow/shrotpackYX.h0000664000175100017510000001133212274325511016056 00000000000000/* * Copyright © 2004 Philip Blundell * * 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 Philip Blundell not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Philip Blundell makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL PHILIP BLUNDELL 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 #include "scrnintstr.h" #include "windowstr.h" #include "dixfontstr.h" #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" #if ROTATE == 270 #define WINSTEPX(stride) (stride) #define WINSTART(x,y) (((pScreen->height - 1) - y) + (x * winStride)) #define WINSTEPY() -1 #elif ROTATE == 90 #define WINSTEPX(stride) (-stride) #define WINSTEPY() 1 #define WINSTART(x,y) (((pScreen->width - 1 - x) * winStride) + y) #else #error This rotation is not supported here #endif #ifdef __arm__ #define PREFETCH #endif void FUNC(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBits; Data *shaBase, *shaLine, *sha; FbStride shaStride, winStride; int shaBpp; _X_UNUSED int shaXoff, shaYoff; int x, y, w, h; Data *winBase, *win, *winLine; CARD32 winSize; fbGetDrawable(&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); shaBase = (Data *) shaBits; shaStride = shaStride * sizeof(FbBits) / sizeof(Data); winBase = (Data *) (*pBuf->window) (pScreen, 0, 0, SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); winStride = (Data *) (*pBuf->window) (pScreen, 1, 0, SHADOW_WINDOW_WRITE, &winSize, pBuf->closure) - winBase; while (nbox--) { x = pbox->x1; y = pbox->y1; w = (pbox->x2 - pbox->x1); h = pbox->y2 - pbox->y1; shaLine = shaBase + (y * shaStride) + x; #ifdef PREFETCH __builtin_prefetch(shaLine); #endif winLine = winBase + WINSTART(x, y); while (h--) { sha = shaLine; win = winLine; while (sha < (shaLine + w - 16)) { #ifdef PREFETCH __builtin_prefetch(sha + shaStride); #endif *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); *win = *sha++; win += WINSTEPX(winStride); } while (sha < (shaLine + w)) { *win = *sha++; win += WINSTEPX(winStride); } y++; shaLine += shaStride; winLine += WINSTEPY(); } pbox++; } /* nbox */ } xorg-server-1.17.1/miext/shadow/shrot16pack_90YX.c0000664000175100017510000000244712274325511016537 00000000000000/* * Copyright 2000 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. */ #define FUNC shadowUpdateRotate16_90YX #define Data CARD16 #define ROTATE 90 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpackYX.h" xorg-server-1.17.1/miext/shadow/shrot16pack_90.c0000664000175100017510000000244512274325511016254 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate16_90 #define Data CARD16 #define ROTATE 90 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shrot8pack_180.c0000664000175100017510000000244512274325511016255 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate8_180 #define Data CARD8 #define ROTATE 180 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shrot32pack_270.c0000664000175100017510000000244712274325511016334 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate32_270 #define Data CARD32 #define ROTATE 270 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shalloc.c0000664000175100017510000000334412274325511015223 00000000000000/* * Copyright © 2000 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 #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" void * shadowAlloc(int width, int height, int bpp) { int stride; void *fb; /* Cant use PixmapBytePad -- the structure is probably not initialized yet */ stride = BitmapBytePad(width * bpp); fb = malloc(stride * height); return fb; } xorg-server-1.17.1/miext/shadow/shrotpack.h0000664000175100017510000001517512274325511015606 00000000000000/* * * Copyright © 2000 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. */ /* * Thanks to Daniel Chemko for making the 90 and 180 * orientations work. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" #define DANDEBUG 0 #if ROTATE == 270 #define SCRLEFT(x,y,w,h) (pScreen->height - ((y) + (h))) #define SCRY(x,y,w,h) (x) #define SCRWIDTH(x,y,w,h) (h) #define FIRSTSHA(x,y,w,h) (((y) + (h) - 1) * shaStride + (x)) #define STEPDOWN(x,y,w,h) ((w)--) #define NEXTY(x,y,w,h) ((x)++) #define SHASTEPX(stride) -(stride) #define SHASTEPY(stride) (1) #elif ROTATE == 90 #define SCRLEFT(x,y,w,h) (y) #define SCRY(x,y,w,h) (pScreen->width - ((x) + (w)) - 1) #define SCRWIDTH(x,y,w,h) (h) #define FIRSTSHA(x,y,w,h) ((y) * shaStride + (x + w - 1)) #define STEPDOWN(x,y,w,h) ((w)--) #define NEXTY(x,y,w,h) ((void)(x)) #define SHASTEPX(stride) (stride) #define SHASTEPY(stride) (-1) #elif ROTATE == 180 #define SCRLEFT(x,y,w,h) (pScreen->width - ((x) + (w))) #define SCRY(x,y,w,h) (pScreen->height - ((y) + (h)) - 1) #define SCRWIDTH(x,y,w,h) (w) #define FIRSTSHA(x,y,w,h) ((y + h - 1) * shaStride + (x + w - 1)) #define STEPDOWN(x,y,w,h) ((h)--) #define NEXTY(x,y,w,h) ((void)(y)) #define SHASTEPX(stride) (-1) #define SHASTEPY(stride) -(stride) #else #define SCRLEFT(x,y,w,h) (x) #define SCRY(x,y,w,h) (y) #define SCRWIDTH(x,y,w,h) (w) #define FIRSTSHA(x,y,w,h) ((y) * shaStride + (x)) #define STEPDOWN(x,y,w,h) ((h)--) #define NEXTY(x,y,w,h) ((y)++) #define SHASTEPX(stride) (1) #define SHASTEPY(stride) (stride) #endif void FUNC(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBits; Data *shaBase, *shaLine, *sha; FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; Data *winBase = NULL, *win; CARD32 winSize; fbGetDrawable(&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); shaBase = (Data *) shaBits; shaStride = shaStride * sizeof(FbBits) / sizeof(Data); #if (DANDEBUG > 1) ErrorF ("-> Entering Shadow Update:\r\n |- Origins: pShadow=%x, pScreen=%x, damage=%x\r\n |- Metrics: shaStride=%d, shaBase=%x, shaBpp=%d\r\n | \n", pShadow, pScreen, damage, shaStride, shaBase, shaBpp); #endif while (nbox--) { x = pbox->x1; y = pbox->y1; w = (pbox->x2 - pbox->x1); h = pbox->y2 - pbox->y1; #if (DANDEBUG > 2) ErrorF (" |-> Redrawing box - Metrics: X=%d, Y=%d, Width=%d, Height=%d\n", x, y, w, h); #endif scrLine = SCRLEFT(x, y, w, h); shaLine = shaBase + FIRSTSHA(x, y, w, h); while (STEPDOWN(x, y, w, h)) { winSize = 0; scrBase = 0; width = SCRWIDTH(x, y, w, h); scr = scrLine; sha = shaLine; #if (DANDEBUG > 3) ErrorF(" | |-> StepDown - Metrics: width=%d, scr=%x, sha=%x\n", width, scr, sha); #endif while (width) { /* how much remains in this window */ i = scrBase + winSize - scr; if (i <= 0 || scr < scrBase) { winBase = (Data *) (*pBuf->window) (pScreen, SCRY(x, y, w, h), scr * sizeof(Data), SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); if (!winBase) return; scrBase = scr; winSize /= sizeof(Data); i = winSize; #if(DANDEBUG > 4) ErrorF (" | | |-> Starting New Line - Metrics: winBase=%x, scrBase=%x, winSize=%d\r\n | | | Xstride=%d, Ystride=%d, w=%d h=%d\n", winBase, scrBase, winSize, SHASTEPX(shaStride), SHASTEPY(shaStride), w, h); #endif } win = winBase + (scr - scrBase); if (i > width) i = width; width -= i; scr += i; #if(DANDEBUG > 5) ErrorF (" | | |-> Writing Line - Metrics: win=%x, sha=%x\n", win, sha); #endif while (i--) { #if(DANDEBUG > 6) ErrorF (" | | |-> Writing Pixel - Metrics: win=%x, sha=%d, remaining=%d\n", win, sha, i); #endif *win++ = *sha; sha += SHASTEPX(shaStride); } /* i */ } /* width */ shaLine += SHASTEPY(shaStride); NEXTY(x, y, w, h); } /* STEPDOWN */ pbox++; } /* nbox */ } xorg-server-1.17.1/miext/shadow/shafb4.c0000664000175100017510000001031612274325511014742 00000000000000/* * Copyright © 2013 Geert Uytterhoeven * * 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. * * Based on shpacked.c, which is Copyright © 2000 Keith Packard */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" #include "c2p_core.h" /* * Perform a full C2P step on 32 4-bit pixels, stored in 4 32-bit words * containing * - 32 4-bit chunky pixels on input * - permutated planar data (1 plane per 32-bit word) on output */ static void c2p_32x4(CARD32 d[4]) { transp4(d, 16, 2); transp4(d, 8, 1); transp4(d, 4, 2); transp4(d, 2, 1); transp4(d, 1, 2); } /* * Store a full block of permutated planar data after c2p conversion */ static inline void store_afb4(void *dst, unsigned int stride, const CARD32 d[4]) { CARD8 *p = dst; *(CARD32 *)p = d[3]; p += stride; *(CARD32 *)p = d[1]; p += stride; *(CARD32 *)p = d[2]; p += stride; *(CARD32 *)p = d[0]; p += stride; } void shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBase; CARD32 *shaLine, *sha; FbStride shaStride; int scrLine; _X_UNUSED int shaBpp, shaXoff, shaYoff; int x, y, w, h; int i, n; CARD32 *win; CARD32 off, winStride; union { CARD8 bytes[16]; CARD32 words[4]; } d; fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); if (sizeof(FbBits) != sizeof(CARD32)) shaStride = shaStride * sizeof(FbBits) / sizeof(CARD32); while (nbox--) { x = pbox->x1; y = pbox->y1; w = pbox->x2 - pbox->x1; h = pbox->y2 - pbox->y1; scrLine = (x & -32) / 2; shaLine = (CARD32 *)shaBase + y * shaStride + scrLine / sizeof(CARD32); off = scrLine / 4; /* byte offset in bitplane scanline */ n = ((x & 31) + w + 31) / 32; /* number of c2p units in scanline */ while (h--) { sha = shaLine; win = (CARD32 *) (*pBuf->window) (pScreen, y, off, SHADOW_WINDOW_WRITE, &winStride, pBuf->closure); if (!win) return; for (i = 0; i < n; i++) { memcpy(d.bytes, sha, sizeof(d.bytes)); c2p_32x4(d.words); store_afb4(win++, winStride, d.words); sha += sizeof(d.bytes) / sizeof(*sha); } shaLine += shaStride; y++; } pbox++; } } xorg-server-1.17.1/miext/shadow/shrot16pack_270.c0000664000175100017510000000244712274325511016336 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate16_270 #define Data CARD16 #define ROTATE 270 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shiplan2p4.c0000664000175100017510000000773212274325511015567 00000000000000/* * Copyright © 2013 Geert Uytterhoeven * * 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. * * Based on shpacked.c, which is Copyright © 2000 Keith Packard */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" #include "c2p_core.h" /* * Perform a full C2P step on 16 4-bit pixels, stored in 2 32-bit words * containing * - 16 4-bit chunky pixels on input * - permutated planar data (2 planes per 32-bit word) on output */ static void c2p_16x4(CARD32 d[2]) { transp2(d, 8); transp2(d, 2); transp2x(d, 1); transp2(d, 16); transp2(d, 4); transp2(d, 1); } /* * Store a full block of iplan2p4 data after c2p conversion */ static inline void store_iplan2p4(void *dst, const CARD32 d[2]) { CARD32 *p = dst; *p++ = d[0]; *p++ = d[1]; } void shadowUpdateIplan2p4(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBase; CARD16 *shaLine, *sha; FbStride shaStride; int scrLine; _X_UNUSED int shaBpp, shaXoff, shaYoff; int x, y, w, h; int i, n; CARD16 *win; _X_UNUSED CARD32 winSize; union { CARD8 bytes[8]; CARD32 words[2]; } d; fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); shaStride *= sizeof(FbBits) / sizeof(CARD16); while (nbox--) { x = pbox->x1; y = pbox->y1; w = pbox->x2 - pbox->x1; h = pbox->y2 - pbox->y1; scrLine = (x & -16) / 2; shaLine = (CARD16 *)shaBase + y * shaStride + scrLine / sizeof(CARD16); n = ((x & 15) + w + 15) / 16; /* number of c2p units in scanline */ while (h--) { sha = shaLine; win = (CARD16 *) (*pBuf->window) (pScreen, y, scrLine, SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); if (!win) return; for (i = 0; i < n; i++) { memcpy(d.bytes, sha, sizeof(d.bytes)); c2p_16x4(d.words); store_iplan2p4(win, d.words); sha += sizeof(d.bytes) / sizeof(*sha); win += sizeof(d.bytes) / sizeof(*win); } shaLine += shaStride; y++; } pbox++; } } xorg-server-1.17.1/miext/shadow/shpacked.c0000664000175100017510000000733512274325511015364 00000000000000/* * * Copyright © 2000 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 #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" void shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBase, *shaLine, *sha; FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; FbBits *winBase = NULL, *win; CARD32 winSize; fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); while (nbox--) { x = pbox->x1 * shaBpp; y = pbox->y1; w = (pbox->x2 - pbox->x1) * shaBpp; h = pbox->y2 - pbox->y1; scrLine = (x >> FB_SHIFT); shaLine = shaBase + y * shaStride + (x >> FB_SHIFT); x &= FB_MASK; w = (w + x + FB_MASK) >> FB_SHIFT; while (h--) { winSize = 0; scrBase = 0; width = w; scr = scrLine; sha = shaLine; while (width) { /* how much remains in this window */ i = scrBase + winSize - scr; if (i <= 0 || scr < scrBase) { winBase = (FbBits *) (*pBuf->window) (pScreen, y, scr * sizeof(FbBits), SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); if (!winBase) return; scrBase = scr; winSize /= sizeof(FbBits); i = winSize; } win = winBase + (scr - scrBase); if (i > width) i = width; width -= i; scr += i; memcpy(win, sha, i * sizeof(FbBits)); sha += i; } shaLine += shaStride; y++; } pbox++; } } shadowUpdateProc shadowUpdatePackedWeak(void) { return shadowUpdatePacked; } xorg-server-1.17.1/miext/shadow/shrotate.c0000664000175100017510000002232712456571574015447 00000000000000/* * * Copyright © 2001 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_DIX_CONFIG_H #include #endif #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" /* * These indicate which way the source (shadow) is scanned when * walking the screen in a particular direction */ #define LEFT_TO_RIGHT 1 #define RIGHT_TO_LEFT -1 #define TOP_TO_BOTTOM 2 #define BOTTOM_TO_TOP -2 void shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBits; FbStride shaStride; int shaBpp; _X_UNUSED int shaXoff, shaYoff; int box_x1, box_x2, box_y1, box_y2; int sha_x1 = 0, sha_y1 = 0; int scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h; int scr_x, scr_y; int w; int pixelsPerBits; int pixelsMask; FbStride shaStepOverY = 0, shaStepDownY = 0; FbStride shaStepOverX = 0, shaStepDownX = 0; FbBits *shaLine, *sha; int shaHeight = pShadow->drawable.height; int shaWidth = pShadow->drawable.width; FbBits shaMask; int shaFirstShift, shaShift; int o_x_dir; int o_y_dir; int x_dir; int y_dir; fbGetDrawable(&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); pixelsPerBits = (sizeof(FbBits) * 8) / shaBpp; pixelsMask = ~(pixelsPerBits - 1); shaMask = FbBitsMask(FB_UNIT - shaBpp, shaBpp); /* * Compute rotation related constants to walk the shadow */ o_x_dir = LEFT_TO_RIGHT; o_y_dir = TOP_TO_BOTTOM; if (pBuf->randr & SHADOW_REFLECT_X) o_x_dir = -o_x_dir; if (pBuf->randr & SHADOW_REFLECT_Y) o_y_dir = -o_y_dir; switch (pBuf->randr & (SHADOW_ROTATE_ALL)) { case SHADOW_ROTATE_0: /* upper left shadow -> upper left screen */ default: x_dir = o_x_dir; y_dir = o_y_dir; break; case SHADOW_ROTATE_90: /* upper right shadow -> upper left screen */ x_dir = o_y_dir; y_dir = -o_x_dir; break; case SHADOW_ROTATE_180: /* lower right shadow -> upper left screen */ x_dir = -o_x_dir; y_dir = -o_y_dir; break; case SHADOW_ROTATE_270: /* lower left shadow -> upper left screen */ x_dir = -o_y_dir; y_dir = o_x_dir; break; } switch (x_dir) { case LEFT_TO_RIGHT: shaStepOverX = shaBpp; shaStepOverY = 0; break; case TOP_TO_BOTTOM: shaStepOverX = 0; shaStepOverY = shaStride; break; case RIGHT_TO_LEFT: shaStepOverX = -shaBpp; shaStepOverY = 0; break; case BOTTOM_TO_TOP: shaStepOverX = 0; shaStepOverY = -shaStride; break; } switch (y_dir) { case TOP_TO_BOTTOM: shaStepDownX = 0; shaStepDownY = shaStride; break; case RIGHT_TO_LEFT: shaStepDownX = -shaBpp; shaStepDownY = 0; break; case BOTTOM_TO_TOP: shaStepDownX = 0; shaStepDownY = -shaStride; break; case LEFT_TO_RIGHT: shaStepDownX = shaBpp; shaStepDownY = 0; break; } while (nbox--) { box_x1 = pbox->x1; box_y1 = pbox->y1; box_x2 = pbox->x2; box_y2 = pbox->y2; pbox++; /* * Compute screen and shadow locations for this box */ switch (x_dir) { case LEFT_TO_RIGHT: scr_x1 = box_x1 & pixelsMask; scr_x2 = (box_x2 + pixelsPerBits - 1) & pixelsMask; sha_x1 = scr_x1; break; case TOP_TO_BOTTOM: scr_x1 = box_y1 & pixelsMask; scr_x2 = (box_y2 + pixelsPerBits - 1) & pixelsMask; sha_y1 = scr_x1; break; case RIGHT_TO_LEFT: scr_x1 = (shaWidth - box_x2) & pixelsMask; scr_x2 = (shaWidth - box_x1 + pixelsPerBits - 1) & pixelsMask; sha_x1 = (shaWidth - scr_x1 - 1); break; case BOTTOM_TO_TOP: scr_x1 = (shaHeight - box_y2) & pixelsMask; scr_x2 = (shaHeight - box_y1 + pixelsPerBits - 1) & pixelsMask; sha_y1 = (shaHeight - scr_x1 - 1); break; } switch (y_dir) { case TOP_TO_BOTTOM: scr_y1 = box_y1; scr_y2 = box_y2; sha_y1 = scr_y1; break; case RIGHT_TO_LEFT: scr_y1 = (shaWidth - box_x2); scr_y2 = (shaWidth - box_x1); sha_x1 = box_x2 - 1; break; case BOTTOM_TO_TOP: scr_y1 = shaHeight - box_y2; scr_y2 = shaHeight - box_y1; sha_y1 = box_y2 - 1; break; case LEFT_TO_RIGHT: scr_y1 = box_x1; scr_y2 = box_x2; sha_x1 = box_x1; break; } scr_w = ((scr_x2 - scr_x1) * shaBpp) >> FB_SHIFT; scr_h = scr_y2 - scr_y1; scr_y = scr_y1; /* shift amount for first pixel on screen */ shaFirstShift = FB_UNIT - ((sha_x1 * shaBpp) & FB_MASK) - shaBpp; /* pointer to shadow data first placed on screen */ shaLine = (shaBits + sha_y1 * shaStride + ((sha_x1 * shaBpp) >> FB_SHIFT)); /* * Copy the bits, always write across the physical frame buffer * to take advantage of write combining. */ while (scr_h--) { int p; FbBits bits; FbBits *win; int i; CARD32 winSize; sha = shaLine; shaShift = shaFirstShift; w = scr_w; scr_x = scr_x1 * shaBpp >> FB_SHIFT; while (w) { /* * Map some of this line */ win = (FbBits *) (*pBuf->window) (pScreen, scr_y, scr_x << 2, SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); i = (winSize >> 2); if (i > w) i = w; w -= i; scr_x += i; /* * Copy the portion of the line mapped */ while (i--) { bits = 0; p = pixelsPerBits; /* * Build one word of output from multiple inputs * * Note that for 90/270 rotations, this will walk * down the shadow hitting each scanline once. * This is probably not very efficient. */ while (p--) { bits = FbScrLeft(bits, shaBpp); bits |= FbScrRight(*sha, shaShift) & shaMask; shaShift -= shaStepOverX; if (shaShift >= FB_UNIT) { shaShift -= FB_UNIT; sha--; } else if (shaShift < 0) { shaShift += FB_UNIT; sha++; } sha += shaStepOverY; } *win++ = bits; } } scr_y++; shaFirstShift -= shaStepDownX; if (shaFirstShift >= FB_UNIT) { shaFirstShift -= FB_UNIT; shaLine--; } else if (shaFirstShift < 0) { shaFirstShift += FB_UNIT; shaLine++; } shaLine += shaStepDownY; } } } shadowUpdateProc shadowUpdateRotatePackedWeak(void) { return shadowUpdateRotatePacked; } xorg-server-1.17.1/miext/shadow/shrot32pack_90.c0000664000175100017510000000244512274325511016252 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate32_90 #define Data CARD32 #define ROTATE 90 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shrot32pack_180.c0000664000175100017510000000244712274325511016334 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate32_180 #define Data CARD32 #define ROTATE 180 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shrot8pack.c0000664000175100017510000000241612274325511015663 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate8 #define Data CARD8 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shrot16pack.c0000664000175100017510000000242012274325511015735 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate16 #define Data CARD16 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shplanar8.c0000664000175100017510000001342512274325511015477 00000000000000/* * * Copyright © 2000 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 #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" /* * Expose 8bpp depth 4 */ /* * 32->8 conversion: * * 7 6 5 4 3 2 1 0 * A B C D E F G H * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * m1 D x x x x x x x C x x x x x x x B x x x x x x x A x x x x x x x sha[0] << (7-(p)) * m2 x x x x H x x x x x x x G x x x x x x x F x x x x x x x E x x x sha[1] << (3-(p)) * m3 D C B A m1 & 0x80808080 * m4 H G F E m2 & 0x08080808 * m5 D H C G B F A E m3 | m4 * m6 D H C G B F m5 >> 9 * m7 D H C D G H B C F G A B E F m5 | m6 * m8 D H C D G H m7 >> 18 * m9 D H C D G H B C D F G H A B C D E F G H m7 | m8 */ #define PL_SHIFT 8 #define PL_UNIT (1 << PL_SHIFT) #define PL_MASK (PL_UNIT - 1) #if 0 #define GetBits(p,o,d) { \ CARD32 m1,m2,m3,m4,m5,m6,m7,m8; \ m1 = sha[o] << (7 - (p)); \ m2 = sha[(o)+1] << (3 - (p)); \ m3 = m1 & 0x80808080; \ m4 = m2 & 0x08080808; \ m5 = m3 | m4; \ m6 = m5 >> 9; \ m7 = m5 | m6; \ m8 = m7 >> 18; \ d = m7 | m8; \ } #else #define GetBits(p,o,d) { \ CARD32 m5,m7; \ m5 = ((sha[o] << (7 - (p))) & 0x80808080) | ((sha[(o)+1] << (3 - (p))) & 0x08080808); \ m7 = m5 | (m5 >> 9); \ d = m7 | (m7 >> 18); \ } #endif void shadowUpdatePlanar4x8(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); CARD32 *shaBase, *shaLine, *sha; CARD8 s1, s2, s3, s4; FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; CARD32 *winBase = NULL, *win; CARD32 winSize; int plane; fbGetStipDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); while (nbox--) { x = pbox->x1 * shaBpp; y = pbox->y1; w = (pbox->x2 - pbox->x1) * shaBpp; h = pbox->y2 - pbox->y1; w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT; x &= ~PL_MASK; scrLine = (x >> PL_SHIFT); shaLine = shaBase + y * shaStride + (x >> FB_SHIFT); while (h--) { for (plane = 0; plane < 4; plane++) { width = w; scr = scrLine; sha = shaLine; winSize = 0; scrBase = 0; while (width) { /* how much remains in this window */ i = scrBase + winSize - scr; if (i <= 0 || scr < scrBase) { winBase = (CARD32 *) (*pBuf->window) (pScreen, y, (scr << 4) | (plane), SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); if (!winBase) return; winSize >>= 2; scrBase = scr; i = winSize; } win = winBase + (scr - scrBase); if (i > width) i = width; width -= i; scr += i; while (i--) { GetBits(plane, 0, s1); GetBits(plane, 2, s2); GetBits(plane, 4, s3); GetBits(plane, 6, s4); *win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24); sha += 8; } } } shaLine += shaStride; y++; } pbox++; } } xorg-server-1.17.1/miext/shadow/Makefile.in0000664000175100017510000007243412466505435015515 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/shadow DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libshadow_la_LIBADD = am_libshadow_la_OBJECTS = shadow.lo shafb4.lo shafb8.lo shalloc.lo \ shiplan2p4.lo shiplan2p8.lo shpacked.lo shplanar8.lo \ shplanar.lo shrot16pack_180.lo shrot16pack_270.lo \ shrot16pack_270YX.lo shrot16pack_90.lo shrot16pack_90YX.lo \ shrot16pack.lo shrot32pack_180.lo shrot32pack_270.lo \ shrot32pack_90.lo shrot32pack.lo shrot8pack_180.lo \ shrot8pack_270.lo shrot8pack_90.lo shrot8pack.lo shrotate.lo libshadow_la_OBJECTS = $(am_libshadow_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 = $(libshadow_la_SOURCES) DIST_SOURCES = $(libshadow_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = shadow.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libshadow.la AM_CFLAGS = $(DIX_CFLAGS) @XORG_TRUE@sdk_HEADERS = shadow.h libshadow_la_SOURCES = \ c2p_core.h \ shadow.c \ shadow.h \ shafb4.c \ shafb8.c \ shalloc.c \ shiplan2p4.c \ shiplan2p8.c \ shpacked.c \ shplanar8.c \ shplanar.c \ shrot16pack_180.c \ shrot16pack_270.c \ shrot16pack_270YX.c \ shrot16pack_90.c \ shrot16pack_90YX.c \ shrot16pack.c \ shrot32pack_180.c \ shrot32pack_270.c \ shrot32pack_90.c \ shrot32pack.c \ shrot8pack_180.c \ shrot8pack_270.c \ shrot8pack_90.c \ shrot8pack.c \ shrotate.c \ shrotpack.h \ shrotpackYX.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/shadow/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign miext/shadow/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libshadow.la: $(libshadow_la_OBJECTS) $(libshadow_la_DEPENDENCIES) $(EXTRA_libshadow_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libshadow_la_OBJECTS) $(libshadow_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shafb4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shafb8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shiplan2p4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shiplan2p8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shpacked.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shplanar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shplanar8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_180.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_270.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_270YX.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_90.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_90YX.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack_180.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack_270.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack_90.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack_180.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack_270.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack_90.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrotate.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/miext/shadow/shrot8pack_90.c0000664000175100017510000000244312274325511016173 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate8_90 #define Data CARD8 #define ROTATE 90 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shadow.c0000664000175100017510000001234212366751547015077 00000000000000/* * Copyright © 2000 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 #include #include "scrnintstr.h" #include "windowstr.h" #include "dixfontstr.h" #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" static DevPrivateKeyRec shadowScrPrivateKeyRec; #define shadowScrPrivateKey (&shadowScrPrivateKeyRec) #define wrap(priv, real, mem) {\ priv->mem = real->mem; \ real->mem = shadow##mem; \ } #define unwrap(priv, real, mem) {\ real->mem = priv->mem; \ } static void shadowRedisplay(ScreenPtr pScreen) { shadowBuf(pScreen); RegionPtr pRegion; if (!pBuf || !pBuf->pDamage || !pBuf->update) return; pRegion = DamageRegion(pBuf->pDamage); if (RegionNotEmpty(pRegion)) { (*pBuf->update) (pScreen, pBuf); DamageEmpty(pBuf->pDamage); } } static void shadowBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) { ScreenPtr pScreen = (ScreenPtr) data; shadowRedisplay(pScreen); } static void shadowWakeupHandler(void *data, int i, void *LastSelectMask) { } static void shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planeMask, char *pdstLine) { ScreenPtr pScreen = pDrawable->pScreen; shadowBuf(pScreen); /* Many apps use GetImage to sync with the visable frame buffer */ if (pDrawable->type == DRAWABLE_WINDOW) shadowRedisplay(pScreen); unwrap(pBuf, pScreen, GetImage); pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); wrap(pBuf, pScreen, GetImage); } static Bool shadowCloseScreen(ScreenPtr pScreen) { shadowBuf(pScreen); unwrap(pBuf, pScreen, GetImage); unwrap(pBuf, pScreen, CloseScreen); shadowRemove(pScreen, pBuf->pPixmap); DamageDestroy(pBuf->pDamage); if (pBuf->pPixmap) pScreen->DestroyPixmap(pBuf->pPixmap); free(pBuf); return pScreen->CloseScreen(pScreen); } Bool shadowSetup(ScreenPtr pScreen) { shadowBufPtr pBuf; if (!dixRegisterPrivateKey(&shadowScrPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!DamageSetup(pScreen)) return FALSE; pBuf = malloc(sizeof(shadowBufRec)); if (!pBuf) return FALSE; pBuf->pDamage = DamageCreate((DamageReportFunc) NULL, (DamageDestroyFunc) NULL, DamageReportNone, TRUE, pScreen, pScreen); if (!pBuf->pDamage) { free(pBuf); return FALSE; } wrap(pBuf, pScreen, CloseScreen); wrap(pBuf, pScreen, GetImage); pBuf->update = 0; pBuf->window = 0; pBuf->pPixmap = 0; pBuf->closure = 0; pBuf->randr = 0; dixSetPrivate(&pScreen->devPrivates, shadowScrPrivateKey, pBuf); return TRUE; } Bool shadowAdd(ScreenPtr pScreen, PixmapPtr pPixmap, ShadowUpdateProc update, ShadowWindowProc window, int randr, void *closure) { shadowBuf(pScreen); if (!RegisterBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, (void *) pScreen)) return FALSE; /* * Map simple rotation values to bitmasks; fortunately, * these are all unique */ switch (randr) { case 0: randr = SHADOW_ROTATE_0; break; case 90: randr = SHADOW_ROTATE_90; break; case 180: randr = SHADOW_ROTATE_180; break; case 270: randr = SHADOW_ROTATE_270; break; } pBuf->update = update; pBuf->window = window; pBuf->randr = randr; pBuf->closure = closure; pBuf->pPixmap = pPixmap; DamageRegister(&pPixmap->drawable, pBuf->pDamage); return TRUE; } void shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap) { shadowBuf(pScreen); if (pBuf->pPixmap) { DamageUnregister(pBuf->pDamage); pBuf->update = 0; pBuf->window = 0; pBuf->randr = 0; pBuf->closure = 0; pBuf->pPixmap = 0; } RemoveBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, (void *) pScreen); } xorg-server-1.17.1/miext/shadow/shplanar.c0000664000175100017510000001350512274325511015406 00000000000000/* * * Copyright © 2000 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 #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" /* * 32 4-bit pixels per write */ #define PL_SHIFT 7 #define PL_UNIT (1 << PL_SHIFT) #define PL_MASK (PL_UNIT - 1) /* * 32->8 conversion: * * 7 6 5 4 3 2 1 0 * A B C D E F G H * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * m . . . H . . . G . . . F . . . E . . . D . . . C . . . B . . . A * m1 G . . . F . . . E . . . D . . . C . . . B . . . A . . . . . . . m << (7 - (p)) * m2 . H . . . G . . . F . . . E . . . D . . . C . . . B . . . A . . (m >> (p)) << 2 * m3 G E C A m1 & 0x80808080 * m4 H F D B m2 & 0x40404040 * m5 G H E F C D A B m3 | m4 * m6 G H E F C D G H A B E F m5 | (m5 >> 20) * m7 G H E F C D G H A B C D E F G H m6 | (m6 >> 10) */ #if 0 #define GetBits(p,o,d) {\ m = sha[o]; \ m1 = m << (7 - (p)); \ m2 = (m >> (p)) << 2; \ m3 = m1 & 0x80808080; \ m4 = m2 & 0x40404040; \ m5 = m3 | m4; \ m6 = m5 | (m5 >> 20); \ d = m6 | (m6 >> 10); \ } #else #define GetBits(p,o,d) {\ m = sha[o]; \ m5 = ((m << (7 - (p))) & 0x80808080) | (((m >> (p)) << 2) & 0x40404040); \ m6 = m5 | (m5 >> 20); \ d = m6 | (m6 >> 10); \ } #endif void shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); CARD32 *shaBase, *shaLine, *sha; FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; CARD32 *winBase = NULL, *win; CARD32 winSize; int plane; CARD32 m, m5, m6; CARD8 s1, s2, s3, s4; fbGetStipDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); while (nbox--) { x = (pbox->x1) * shaBpp; y = (pbox->y1); w = (pbox->x2 - pbox->x1) * shaBpp; h = pbox->y2 - pbox->y1; w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT; x &= ~PL_MASK; scrLine = (x >> PL_SHIFT); shaLine = shaBase + y * shaStride + (x >> FB_SHIFT); while (h--) { for (plane = 0; plane < 4; plane++) { width = w; scr = scrLine; sha = shaLine; winSize = 0; scrBase = 0; while (width) { /* how much remains in this window */ i = scrBase + winSize - scr; if (i <= 0 || scr < scrBase) { winBase = (CARD32 *) (*pBuf->window) (pScreen, y, (scr << 4) | (plane), SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); if (!winBase) return; winSize >>= 2; scrBase = scr; i = winSize; } win = winBase + (scr - scrBase); if (i > width) i = width; width -= i; scr += i; while (i--) { GetBits(plane, 0, s1); GetBits(plane, 1, s2); GetBits(plane, 2, s3); GetBits(plane, 3, s4); *win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24); sha += 4; } } } shaLine += shaStride; y++; } pbox++; } } shadowUpdateProc shadowUpdatePlanar4Weak(void) { return shadowUpdatePlanar4; } shadowUpdateProc shadowUpdatePlanar4x8Weak(void) { return shadowUpdatePlanar4x8; } xorg-server-1.17.1/miext/shadow/shrot16pack_270YX.c0000664000175100017510000000245112274325511016612 00000000000000/* * Copyright 2000 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. */ #define FUNC shadowUpdateRotate16_270YX #define Data CARD16 #define ROTATE 270 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpackYX.h" xorg-server-1.17.1/miext/shadow/shrot16pack_180.c0000664000175100017510000000244712274325511016336 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate16_180 #define Data CARD16 #define ROTATE 180 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shadow.h0000664000175100017510000001233212366751547015103 00000000000000/* * * Copyright © 2000 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. */ #ifndef _SHADOW_H_ #define _SHADOW_H_ #include "scrnintstr.h" #include "picturestr.h" #include "damage.h" #include "damagestr.h" typedef struct _shadowBuf *shadowBufPtr; typedef void (*ShadowUpdateProc) (ScreenPtr pScreen, shadowBufPtr pBuf); #define SHADOW_WINDOW_RELOCATE 1 #define SHADOW_WINDOW_READ 2 #define SHADOW_WINDOW_WRITE 4 typedef void *(*ShadowWindowProc) (ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure); typedef struct _shadowBuf { DamagePtr pDamage; ShadowUpdateProc update; ShadowWindowProc window; PixmapPtr pPixmap; void *closure; int randr; /* screen wrappers */ GetImageProcPtr GetImage; CloseScreenProcPtr CloseScreen; } shadowBufRec; /* Match defines from randr extension */ #define SHADOW_ROTATE_0 1 #define SHADOW_ROTATE_90 2 #define SHADOW_ROTATE_180 4 #define SHADOW_ROTATE_270 8 #define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\ SHADOW_ROTATE_180|SHADOW_ROTATE_270) #define SHADOW_REFLECT_X 16 #define SHADOW_REFLECT_Y 32 #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y) extern _X_EXPORT DevPrivateKey shadowScrPrivateKey; #define shadowGetBuf(pScr) ((shadowBufPtr) \ dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey)) #define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr) #define shadowDamage(pBuf) DamageRegion(pBuf->pDamage) extern _X_EXPORT Bool shadowSetup(ScreenPtr pScreen); extern _X_EXPORT Bool shadowAdd(ScreenPtr pScreen, PixmapPtr pPixmap, ShadowUpdateProc update, ShadowWindowProc window, int randr, void *closure); extern _X_EXPORT void shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap); extern _X_EXPORT void *shadowAlloc(int width, int height, int bpp); extern _X_EXPORT void shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateAfb8(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateIplan2p4(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateIplan2p8(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdatePlanar4x8(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate8_90(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate16_90(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate16_90YX(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate32_90(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate8_180(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate16_180(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate32_180(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate8_270(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate16_270(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate16_270YX(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate32_270(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate8(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate16(ScreenPtr pScreen, shadowBufPtr pBuf); extern _X_EXPORT void shadowUpdateRotate32(ScreenPtr pScreen, shadowBufPtr pBuf); typedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr); extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void); extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4Weak(void); extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4x8Weak(void); extern _X_EXPORT shadowUpdateProc shadowUpdateRotatePackedWeak(void); #endif /* _SHADOW_H_ */ xorg-server-1.17.1/miext/shadow/shiplan2p8.c0000664000175100017510000000777712274325511015604 00000000000000/* * Copyright © 2013 Geert Uytterhoeven * * 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. * * Based on shpacked.c, which is Copyright © 2000 Keith Packard */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" #include "c2p_core.h" /* * Perform a full C2P step on 16 8-bit pixels, stored in 4 32-bit words * containing * - 16 8-bit chunky pixels on input * - permutated planar data (2 planes per 32-bit word) on output */ static void c2p_16x8(CARD32 d[4]) { transp4(d, 8, 2); transp4(d, 1, 2); transp4x(d, 16, 2); transp4x(d, 2, 2); transp4(d, 4, 1); } /* * Store a full block of permutated iplan2p8 data after c2p conversion */ static inline void store_iplan2p8(void *dst, const CARD32 d[4]) { CARD32 *p = dst; *p++ = d[1]; *p++ = d[3]; *p++ = d[0]; *p++ = d[2]; } void shadowUpdateIplan2p8(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBase; CARD16 *shaLine, *sha; FbStride shaStride; int scrLine; _X_UNUSED int shaBpp, shaXoff, shaYoff; int x, y, w, h; int i, n; CARD16 *win; _X_UNUSED CARD32 winSize; union { CARD8 bytes[16]; CARD32 words[4]; } d; fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); shaStride *= sizeof(FbBits) / sizeof(CARD16); while (nbox--) { x = pbox->x1; y = pbox->y1; w = pbox->x2 - pbox->x1; h = pbox->y2 - pbox->y1; scrLine = x & -16; shaLine = (CARD16 *)shaBase + y * shaStride + scrLine / sizeof(CARD16); n = ((x & 15) + w + 15) / 16; /* number of c2p units in scanline */ while (h--) { sha = shaLine; win = (CARD16 *) (*pBuf->window) (pScreen, y, scrLine, SHADOW_WINDOW_WRITE, &winSize, pBuf->closure); if (!win) return; for (i = 0; i < n; i++) { memcpy(d.bytes, sha, sizeof(d.bytes)); c2p_16x8(d.words); store_iplan2p8(win, d.words); sha += sizeof(d.bytes) / sizeof(*sha); win += sizeof(d.bytes) / sizeof(*win); } shaLine += shaStride; y++; } pbox++; } } xorg-server-1.17.1/miext/shadow/shafb8.c0000664000175100017510000001054512274325511014752 00000000000000/* * Copyright © 2013 Geert Uytterhoeven * * 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. * * Based on shpacked.c, which is Copyright © 2000 Keith Packard */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" #include "fb.h" #include "c2p_core.h" /* * Perform a full C2P step on 32 8-bit pixels, stored in 8 32-bit words * containing * - 32 8-bit chunky pixels on input * - permutated planar data (1 plane per 32-bit word) on output */ static void c2p_32x8(CARD32 d[8]) { transp8(d, 16, 4); transp8(d, 8, 2); transp8(d, 4, 1); transp8(d, 2, 4); transp8(d, 1, 2); } /* * Store a full block of permutated planar data after c2p conversion */ static inline void store_afb8(void *dst, unsigned int stride, const CARD32 d[8]) { CARD8 *p = dst; *(CARD32 *)p = d[7]; p += stride; *(CARD32 *)p = d[5]; p += stride; *(CARD32 *)p = d[3]; p += stride; *(CARD32 *)p = d[1]; p += stride; *(CARD32 *)p = d[6]; p += stride; *(CARD32 *)p = d[4]; p += stride; *(CARD32 *)p = d[2]; p += stride; *(CARD32 *)p = d[0]; p += stride; } void shadowUpdateAfb8(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; int nbox = RegionNumRects(damage); BoxPtr pbox = RegionRects(damage); FbBits *shaBase; CARD32 *shaLine, *sha; FbStride shaStride; int scrLine; _X_UNUSED int shaBpp, shaXoff, shaYoff; int x, y, w, h; int i, n; CARD32 *win; CARD32 off, winStride; union { CARD8 bytes[32]; CARD32 words[8]; } d; fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); if (sizeof(FbBits) != sizeof(CARD32)) shaStride = shaStride * sizeof(FbBits) / sizeof(CARD32); while (nbox--) { x = pbox->x1; y = pbox->y1; w = pbox->x2 - pbox->x1; h = pbox->y2 - pbox->y1; scrLine = x & -32; shaLine = (CARD32 *)shaBase + y * shaStride + scrLine / sizeof(CARD32); off = scrLine / 8; /* byte offset in bitplane scanline */ n = ((x & 31) + w + 31) / 32; /* number of c2p units in scanline */ while (h--) { sha = shaLine; win = (CARD32 *) (*pBuf->window) (pScreen, y, off, SHADOW_WINDOW_WRITE, &winStride, pBuf->closure); if (!win) return; for (i = 0; i < n; i++) { memcpy(d.bytes, sha, sizeof(d.bytes)); c2p_32x8(d.words); store_afb8(win++, winStride, d.words); sha += sizeof(d.bytes) / sizeof(*sha); } shaLine += shaStride; y++; } pbox++; } } xorg-server-1.17.1/miext/shadow/c2p_core.h0000664000175100017510000001031612274325511015274 00000000000000/* * Fast C2P (Chunky-to-Planar) Conversion * * NOTES: * - This code was inspired by Scout's C2P tutorial * - It assumes to run on a big endian system * * Copyright © 2003-2008 Geert Uytterhoeven * * 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. */ /* * Basic transpose step */ static inline void _transp(CARD32 d[], unsigned int i1, unsigned int i2, unsigned int shift, CARD32 mask) { CARD32 t = (d[i1] ^ (d[i2] >> shift)) & mask; d[i1] ^= t; d[i2] ^= t << shift; } static inline void c2p_unsupported(void) { BUG_WARN(1); } static inline CARD32 get_mask(unsigned int n) { switch (n) { case 1: return 0x55555555; case 2: return 0x33333333; case 4: return 0x0f0f0f0f; case 8: return 0x00ff00ff; case 16: return 0x0000ffff; } c2p_unsupported(); return 0; } /* * Transpose operations on 8 32-bit words */ static inline void transp8(CARD32 d[], unsigned int n, unsigned int m) { CARD32 mask = get_mask(n); switch (m) { case 1: /* First n x 1 block */ _transp(d, 0, 1, n, mask); /* Second n x 1 block */ _transp(d, 2, 3, n, mask); /* Third n x 1 block */ _transp(d, 4, 5, n, mask); /* Fourth n x 1 block */ _transp(d, 6, 7, n, mask); return; case 2: /* First n x 2 block */ _transp(d, 0, 2, n, mask); _transp(d, 1, 3, n, mask); /* Second n x 2 block */ _transp(d, 4, 6, n, mask); _transp(d, 5, 7, n, mask); return; case 4: /* Single n x 4 block */ _transp(d, 0, 4, n, mask); _transp(d, 1, 5, n, mask); _transp(d, 2, 6, n, mask); _transp(d, 3, 7, n, mask); return; } c2p_unsupported(); } /* * Transpose operations on 4 32-bit words */ static inline void transp4(CARD32 d[], unsigned int n, unsigned int m) { CARD32 mask = get_mask(n); switch (m) { case 1: /* First n x 1 block */ _transp(d, 0, 1, n, mask); /* Second n x 1 block */ _transp(d, 2, 3, n, mask); return; case 2: /* Single n x 2 block */ _transp(d, 0, 2, n, mask); _transp(d, 1, 3, n, mask); return; } c2p_unsupported(); } /* * Transpose operations on 4 32-bit words (reverse order) */ static inline void transp4x(CARD32 d[], unsigned int n, unsigned int m) { CARD32 mask = get_mask(n); switch (m) { case 2: /* Single n x 2 block */ _transp(d, 2, 0, n, mask); _transp(d, 3, 1, n, mask); return; } c2p_unsupported(); } /* * Transpose operations on 2 32-bit words */ static inline void transp2(CARD32 d[], unsigned int n) { CARD32 mask = get_mask(n); /* Single n x 1 block */ _transp(d, 0, 1, n, mask); return; } /* * Transpose operations on 2 32-bit words (reverse order) */ static inline void transp2x(CARD32 d[], unsigned int n) { CARD32 mask = get_mask(n); /* Single n x 1 block */ _transp(d, 1, 0, n, mask); return; } xorg-server-1.17.1/miext/shadow/shrot8pack_270.c0000664000175100017510000000244512274325511016255 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate8_270 #define Data CARD8 #define ROTATE 270 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/miext/shadow/shrot32pack.c0000664000175100017510000000242012274325511015733 00000000000000/* * Copyright © 2000 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. */ #define FUNC shadowUpdateRotate32 #define Data CARD32 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "shrotpack.h" xorg-server-1.17.1/render/0000775000175100017510000000000012466505443012361 500000000000000xorg-server-1.17.1/render/Makefile.am0000664000175100017510000000044412160102336014320 00000000000000noinst_LTLIBRARIES = librender.la AM_CFLAGS = $(DIX_CFLAGS) librender_la_SOURCES = \ animcur.c \ filter.c \ glyph.c \ matrix.c \ miindex.c \ mipict.c \ mirect.c \ mitrap.c \ mitri.c \ picture.c \ render.c if XORG sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h endif xorg-server-1.17.1/render/mitrap.c0000664000175100017510000000520012276566766013754 00000000000000/* * * Copyright © 2002 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_DIX_CONFIG_H #include #endif #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" #include "mi.h" #include "picturestr.h" #include "mipict.h" static xFixed miLineFixedX(xLineFixed * l, xFixed y, Bool ceil) { xFixed dx = l->p2.x - l->p1.x; xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; xFixed dy = l->p2.y - l->p1.y; if (ceil) ex += (dy - 1); return l->p1.x + (xFixed) (ex / dy); } void miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box) { box->y1 = MAXSHORT; box->y2 = MINSHORT; box->x1 = MAXSHORT; box->x2 = MINSHORT; for (; ntrap; ntrap--, traps++) { INT16 x1, y1, x2, y2; if (!xTrapezoidValid(traps)) continue; y1 = xFixedToInt(traps->top); if (y1 < box->y1) box->y1 = y1; y2 = xFixedToInt(xFixedCeil(traps->bottom)); if (y2 > box->y2) box->y2 = y2; x1 = xFixedToInt(min(miLineFixedX(&traps->left, traps->top, FALSE), miLineFixedX(&traps->left, traps->bottom, FALSE))); if (x1 < box->x1) box->x1 = x1; x2 = xFixedToInt(xFixedCeil (max (miLineFixedX(&traps->right, traps->top, TRUE), miLineFixedX(&traps->right, traps->bottom, TRUE)))); if (x2 > box->x2) box->x2 = x2; } } xorg-server-1.17.1/render/mipict.h0000664000175100017510000001140312456571574013745 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifndef _MIPICT_H_ #define _MIPICT_H_ #include "picturestr.h" #define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */ #if MI_MAX_INDEXED <= 256 typedef CARD8 miIndexType; #endif typedef struct _miIndexed { Bool color; CARD32 rgba[MI_MAX_INDEXED]; miIndexType ent[32768]; } miIndexedRec, *miIndexedPtr; #define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \ (((s) >> 6) & 0x03e0) | \ (((s) >> 9) & 0x7c00)) #define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15]) #define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24)) #define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)]) extern _X_EXPORT int miCreatePicture(PicturePtr pPicture); extern _X_EXPORT void miDestroyPicture(PicturePtr pPicture); extern _X_EXPORT void miDestroyPictureClip(PicturePtr pPicture); extern _X_EXPORT int miChangePictureClip(PicturePtr pPicture, int type, void *value, int n); extern _X_EXPORT void miChangePicture(PicturePtr pPicture, Mask mask); extern _X_EXPORT void miValidatePicture(PicturePtr pPicture, Mask mask); extern _X_EXPORT int miChangePictureTransform(PicturePtr pPicture, PictTransform * transform); extern _X_EXPORT int miChangePictureFilter(PicturePtr pPicture, int filter, xFixed * params, int nparams); extern _X_EXPORT void miCompositeSourceValidate(PicturePtr pPicture); extern _X_EXPORT Bool miComputeCompositeRegion(RegionPtr pRegion, 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 miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats); extern _X_EXPORT Bool miRealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph); extern _X_EXPORT void miUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph); extern _X_EXPORT void miGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); extern _X_EXPORT void miRenderColorToPixel(PictFormatPtr pPict, xRenderColor * color, CARD32 *pixel); extern _X_EXPORT void miRenderPixelToColor(PictFormatPtr pPict, CARD32 pixel, xRenderColor * color); extern _X_EXPORT Bool miIsSolidAlpha(PicturePtr pSrc); extern _X_EXPORT void miCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects); extern _X_EXPORT void miTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); extern _X_EXPORT void miTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); extern _X_EXPORT void miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box); extern _X_EXPORT void miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds); extern _X_EXPORT void miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds); extern _X_EXPORT Bool miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat); extern _X_EXPORT void miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat); extern _X_EXPORT void miUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat, int ndef, xColorItem * pdef); #endif /* _MIPICT_H_ */ xorg-server-1.17.1/render/mipict.c0000664000175100017510000004530512432306326013731 00000000000000/* * * Copyright © 1999 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 "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "mi.h" #include "picturestr.h" #include "mipict.h" int miCreatePicture(PicturePtr pPicture) { return Success; } void miDestroyPicture(PicturePtr pPicture) { if (pPicture->freeCompClip) RegionDestroy(pPicture->pCompositeClip); } void miDestroyPictureClip(PicturePtr pPicture) { if (pPicture->clientClip) RegionDestroy(pPicture->clientClip); pPicture->clientClip = NULL; } int miChangePictureClip(PicturePtr pPicture, int type, void *value, int n) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); RegionPtr clientClip; switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ clientClip = BitmapToRegion(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; (*pScreen->DestroyPixmap) ((PixmapPtr) value); break; case CT_REGION: clientClip = value; break; case CT_NONE: clientClip = 0; break; default: clientClip = RegionFromRects(n, (xRectangle *) value, type); if (!clientClip) return BadAlloc; free(value); break; } (*ps->DestroyPictureClip) (pPicture); pPicture->clientClip = clientClip; pPicture->stateChanges |= CPClipMask; return Success; } void miChangePicture(PicturePtr pPicture, Mask mask) { return; } void miValidatePicture(PicturePtr pPicture, Mask mask) { DrawablePtr pDrawable = pPicture->pDrawable; if ((mask & (CPClipXOrigin | CPClipYOrigin | CPClipMask | CPSubwindowMode)) || (pDrawable->serialNumber != (pPicture->serialNumber & DRAWABLE_SERIAL_BITS))) { if (pDrawable->type == DRAWABLE_WINDOW) { WindowPtr pWin = (WindowPtr) pDrawable; RegionPtr pregWin; Bool freeTmpClip, freeCompClip; if (pPicture->subWindowMode == IncludeInferiors) { pregWin = NotClippedByChildren(pWin); freeTmpClip = TRUE; } else { pregWin = &pWin->clipList; freeTmpClip = FALSE; } freeCompClip = pPicture->freeCompClip; /* * if there is no client clip, we can get by with just keeping the * pointer we got, and remembering whether or not should destroy * (or maybe re-use) it later. this way, we avoid unnecessary * copying of regions. (this wins especially if many clients clip * by children and have no client clip.) */ if (!pPicture->clientClip) { if (freeCompClip) RegionDestroy(pPicture->pCompositeClip); pPicture->pCompositeClip = pregWin; pPicture->freeCompClip = freeTmpClip; } else { /* * we need one 'real' region to put into the composite clip. if * pregWin the current composite clip are real, we can get rid of * one. if pregWin is real and the current composite clip isn't, * use pregWin for the composite clip. if the current composite * clip is real and pregWin isn't, use the current composite * clip. if neither is real, create a new region. */ RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); if (freeCompClip) { RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); if (freeTmpClip) RegionDestroy(pregWin); } else if (freeTmpClip) { RegionIntersect(pregWin, pregWin, pPicture->clientClip); pPicture->pCompositeClip = pregWin; } else { pPicture->pCompositeClip = RegionCreate(NullBox, 0); RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); } pPicture->freeCompClip = TRUE; RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } } /* end of composite clip for a window */ else { BoxRec pixbounds; /* XXX should we translate by drawable.x/y here ? */ /* If you want pixmaps in offscreen memory, yes */ pixbounds.x1 = pDrawable->x; pixbounds.y1 = pDrawable->y; pixbounds.x2 = pDrawable->x + pDrawable->width; pixbounds.y2 = pDrawable->y + pDrawable->height; if (pPicture->freeCompClip) { RegionReset(pPicture->pCompositeClip, &pixbounds); } else { pPicture->freeCompClip = TRUE; pPicture->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pPicture->clientClip) { if (pDrawable->x || pDrawable->y) { RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } else { RegionTranslate(pPicture->pCompositeClip, -pPicture->clipOrigin.x, -pPicture->clipOrigin.y); RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); RegionTranslate(pPicture->pCompositeClip, pPicture->clipOrigin.x, pPicture->clipOrigin.y); } } } /* end of composite clip for pixmap */ } } int miChangePictureTransform(PicturePtr pPicture, PictTransform * transform) { return Success; } int miChangePictureFilter(PicturePtr pPicture, int filter, xFixed * params, int nparams) { return Success; } #define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v)) static inline pixman_bool_t miClipPictureReg(pixman_region16_t * pRegion, pixman_region16_t * pClip, int dx, int dy) { if (pixman_region_n_rects(pRegion) == 1 && pixman_region_n_rects(pClip) == 1) { pixman_box16_t *pRbox = pixman_region_rectangles(pRegion, NULL); pixman_box16_t *pCbox = pixman_region_rectangles(pClip, NULL); int v; if (pRbox->x1 < (v = pCbox->x1 + dx)) pRbox->x1 = BOUND(v); if (pRbox->x2 > (v = pCbox->x2 + dx)) pRbox->x2 = BOUND(v); if (pRbox->y1 < (v = pCbox->y1 + dy)) pRbox->y1 = BOUND(v); if (pRbox->y2 > (v = pCbox->y2 + dy)) pRbox->y2 = BOUND(v); if (pRbox->x1 >= pRbox->x2 || pRbox->y1 >= pRbox->y2) { pixman_region_init(pRegion); } } else if (!pixman_region_not_empty(pClip)) return FALSE; else { if (dx || dy) pixman_region_translate(pRegion, -dx, -dy); if (!pixman_region_intersect(pRegion, pRegion, pClip)) return FALSE; if (dx || dy) pixman_region_translate(pRegion, dx, dy); } return pixman_region_not_empty(pRegion); } static inline Bool miClipPictureSrc(RegionPtr pRegion, PicturePtr pPicture, int dx, int dy) { if (pPicture->clientClip) { Bool result; pixman_region_translate(pPicture->clientClip, pPicture->clipOrigin.x + dx, pPicture->clipOrigin.y + dy); result = RegionIntersect(pRegion, pRegion, pPicture->clientClip); pixman_region_translate(pPicture->clientClip, -(pPicture->clipOrigin.x + dx), -(pPicture->clipOrigin.y + dy)); if (!result) return FALSE; } return TRUE; } static void SourceValidateOnePicture(PicturePtr pPicture) { DrawablePtr pDrawable = pPicture->pDrawable; ScreenPtr pScreen; if (!pDrawable) return; pScreen = pDrawable->pScreen; if (pScreen->SourceValidate) { pScreen->SourceValidate(pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode); } } void miCompositeSourceValidate(PicturePtr pPicture) { SourceValidateOnePicture(pPicture); if (pPicture->alphaMap) SourceValidateOnePicture(pPicture->alphaMap); } /* * returns FALSE if the final region is empty. Indistinguishable from * an allocation failure, but rendering ignores those anyways. */ Bool miComputeCompositeRegion(RegionPtr pRegion, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { int v; pRegion->extents.x1 = xDst; v = xDst + width; pRegion->extents.x2 = BOUND(v); pRegion->extents.y1 = yDst; v = yDst + height; pRegion->extents.y2 = BOUND(v); pRegion->data = 0; /* Check for empty operation */ if (pRegion->extents.x1 >= pRegion->extents.x2 || pRegion->extents.y1 >= pRegion->extents.y2) { pixman_region_init(pRegion); return FALSE; } /* clip against dst */ if (!miClipPictureReg(pRegion, pDst->pCompositeClip, 0, 0)) { pixman_region_fini(pRegion); return FALSE; } if (pDst->alphaMap) { if (!miClipPictureReg(pRegion, pDst->alphaMap->pCompositeClip, -pDst->alphaOrigin.x, -pDst->alphaOrigin.y)) { pixman_region_fini(pRegion); return FALSE; } } /* clip against src */ if (!miClipPictureSrc(pRegion, pSrc, xDst - xSrc, yDst - ySrc)) { pixman_region_fini(pRegion); return FALSE; } if (pSrc->alphaMap) { if (!miClipPictureSrc(pRegion, pSrc->alphaMap, xDst - (xSrc - pSrc->alphaOrigin.x), yDst - (ySrc - pSrc->alphaOrigin.y))) { pixman_region_fini(pRegion); return FALSE; } } /* clip against mask */ if (pMask) { if (!miClipPictureSrc(pRegion, pMask, xDst - xMask, yDst - yMask)) { pixman_region_fini(pRegion); return FALSE; } if (pMask->alphaMap) { if (!miClipPictureSrc(pRegion, pMask->alphaMap, xDst - (xMask - pMask->alphaOrigin.x), yDst - (yMask - pMask->alphaOrigin.y))) { pixman_region_fini(pRegion); return FALSE; } } } miCompositeSourceValidate(pSrc); if (pMask) miCompositeSourceValidate(pMask); return TRUE; } void miRenderColorToPixel(PictFormatPtr format, xRenderColor * color, CARD32 *pixel) { CARD32 r, g, b, a; miIndexedPtr pIndexed; switch (format->type) { case PictTypeDirect: r = color->red >> (16 - Ones(format->direct.redMask)); g = color->green >> (16 - Ones(format->direct.greenMask)); b = color->blue >> (16 - Ones(format->direct.blueMask)); a = color->alpha >> (16 - Ones(format->direct.alphaMask)); r = r << format->direct.red; g = g << format->direct.green; b = b << format->direct.blue; a = a << format->direct.alpha; *pixel = r | g | b | a; break; case PictTypeIndexed: pIndexed = (miIndexedPtr) (format->index.devPrivate); if (pIndexed->color) { r = color->red >> 11; g = color->green >> 11; b = color->blue >> 11; *pixel = miIndexToEnt15(pIndexed, (r << 10) | (g << 5) | b); } else { r = color->red >> 8; g = color->green >> 8; b = color->blue >> 8; *pixel = miIndexToEntY24(pIndexed, (r << 16) | (g << 8) | b); } break; } } static CARD16 miFillColor(CARD32 pixel, int bits) { while (bits < 16) { pixel |= pixel << bits; bits <<= 1; } return (CARD16) pixel; } Bool miIsSolidAlpha(PicturePtr pSrc) { ScreenPtr pScreen; char line[1]; if (!pSrc->pDrawable) return FALSE; pScreen = pSrc->pDrawable->pScreen; /* Alpha-only */ if (PICT_FORMAT_TYPE(pSrc->format) != PICT_TYPE_A) return FALSE; /* repeat */ if (!pSrc->repeat) return FALSE; /* 1x1 */ if (pSrc->pDrawable->width != 1 || pSrc->pDrawable->height != 1) return FALSE; line[0] = 1; (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, 1, 1, ZPixmap, ~0L, line); switch (pSrc->pDrawable->bitsPerPixel) { case 1: return (CARD8) line[0] == 1 || (CARD8) line[0] == 0x80; case 4: return (CARD8) line[0] == 0xf || (CARD8) line[0] == 0xf0; case 8: return (CARD8) line[0] == 0xff; default: return FALSE; } } void miRenderPixelToColor(PictFormatPtr format, CARD32 pixel, xRenderColor * color) { CARD32 r, g, b, a; miIndexedPtr pIndexed; switch (format->type) { case PictTypeDirect: r = (pixel >> format->direct.red) & format->direct.redMask; g = (pixel >> format->direct.green) & format->direct.greenMask; b = (pixel >> format->direct.blue) & format->direct.blueMask; a = (pixel >> format->direct.alpha) & format->direct.alphaMask; color->red = miFillColor(r, Ones(format->direct.redMask)); color->green = miFillColor(g, Ones(format->direct.greenMask)); color->blue = miFillColor(b, Ones(format->direct.blueMask)); color->alpha = miFillColor(a, Ones(format->direct.alphaMask)); break; case PictTypeIndexed: pIndexed = (miIndexedPtr) (format->index.devPrivate); pixel = pIndexed->rgba[pixel & (MI_MAX_INDEXED - 1)]; r = (pixel >> 16) & 0xff; g = (pixel >> 8) & 0xff; b = (pixel) & 0xff; color->red = miFillColor(r, 8); color->green = miFillColor(g, 8); color->blue = miFillColor(b, 8); color->alpha = 0xffff; break; } } void miTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points) { xTriangle *tris, *tri; int ntri; ntri = npoints - 2; tris = malloc(ntri * sizeof(xTriangle)); if (!tris) return; for (tri = tris; npoints >= 3; npoints--, points++, tri++) { tri->p1 = points[0]; tri->p2 = points[1]; tri->p3 = points[2]; } CompositeTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); free(tris); } void miTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points) { xTriangle *tris, *tri; xPointFixed *first; int ntri; ntri = npoints - 2; tris = malloc(ntri * sizeof(xTriangle)); if (!tris) return; first = points++; for (tri = tris; npoints >= 3; npoints--, points++, tri++) { tri->p1 = *first; tri->p2 = points[0]; tri->p3 = points[1]; } CompositeTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); free(tris); } Bool miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) { PictureScreenPtr ps; if (!PictureInit(pScreen, formats, nformats)) return FALSE; ps = GetPictureScreen(pScreen); ps->CreatePicture = miCreatePicture; ps->DestroyPicture = miDestroyPicture; ps->ChangePictureClip = miChangePictureClip; ps->DestroyPictureClip = miDestroyPictureClip; ps->ChangePicture = miChangePicture; ps->ValidatePicture = miValidatePicture; ps->InitIndexed = miInitIndexed; ps->CloseIndexed = miCloseIndexed; ps->UpdateIndexed = miUpdateIndexed; ps->ChangePictureTransform = miChangePictureTransform; ps->ChangePictureFilter = miChangePictureFilter; ps->RealizeGlyph = miRealizeGlyph; ps->UnrealizeGlyph = miUnrealizeGlyph; /* MI rendering routines */ ps->Composite = 0; /* requires DDX support */ ps->Glyphs = miGlyphs; ps->CompositeRects = miCompositeRects; ps->Trapezoids = 0; ps->Triangles = 0; ps->RasterizeTrapezoid = 0; /* requires DDX support */ ps->AddTraps = 0; /* requires DDX support */ ps->AddTriangles = 0; /* requires DDX support */ ps->TriStrip = miTriStrip; /* converts call to CompositeTriangles */ ps->TriFan = miTriFan; return TRUE; } xorg-server-1.17.1/render/render.c0000664000175100017510000027666012456571574013754 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "resource.h" #include "scrnintstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "colormapst.h" #include "extnsionst.h" #include "extinit.h" #include "servermd.h" #include #include #include "picturestr.h" #include "glyphstr.h" #include #include "cursorstr.h" #include "xace.h" #include "protocol-versions.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif #include static int ProcRenderQueryVersion(ClientPtr pClient); static int ProcRenderQueryPictFormats(ClientPtr pClient); static int ProcRenderQueryPictIndexValues(ClientPtr pClient); static int ProcRenderQueryDithers(ClientPtr pClient); static int ProcRenderCreatePicture(ClientPtr pClient); static int ProcRenderChangePicture(ClientPtr pClient); static int ProcRenderSetPictureClipRectangles(ClientPtr pClient); static int ProcRenderFreePicture(ClientPtr pClient); static int ProcRenderComposite(ClientPtr pClient); static int ProcRenderScale(ClientPtr pClient); static int ProcRenderTrapezoids(ClientPtr pClient); static int ProcRenderTriangles(ClientPtr pClient); static int ProcRenderTriStrip(ClientPtr pClient); static int ProcRenderTriFan(ClientPtr pClient); static int ProcRenderColorTrapezoids(ClientPtr pClient); static int ProcRenderColorTriangles(ClientPtr pClient); static int ProcRenderTransform(ClientPtr pClient); static int ProcRenderCreateGlyphSet(ClientPtr pClient); static int ProcRenderReferenceGlyphSet(ClientPtr pClient); static int ProcRenderFreeGlyphSet(ClientPtr pClient); static int ProcRenderAddGlyphs(ClientPtr pClient); static int ProcRenderAddGlyphsFromPicture(ClientPtr pClient); static int ProcRenderFreeGlyphs(ClientPtr pClient); static int ProcRenderCompositeGlyphs(ClientPtr pClient); static int ProcRenderFillRectangles(ClientPtr pClient); static int ProcRenderCreateCursor(ClientPtr pClient); static int ProcRenderSetPictureTransform(ClientPtr pClient); static int ProcRenderQueryFilters(ClientPtr pClient); static int ProcRenderSetPictureFilter(ClientPtr pClient); static int ProcRenderCreateAnimCursor(ClientPtr pClient); static int ProcRenderAddTraps(ClientPtr pClient); static int ProcRenderCreateSolidFill(ClientPtr pClient); static int ProcRenderCreateLinearGradient(ClientPtr pClient); static int ProcRenderCreateRadialGradient(ClientPtr pClient); static int ProcRenderCreateConicalGradient(ClientPtr pClient); static int ProcRenderDispatch(ClientPtr pClient); static int SProcRenderQueryVersion(ClientPtr pClient); static int SProcRenderQueryPictFormats(ClientPtr pClient); static int SProcRenderQueryPictIndexValues(ClientPtr pClient); static int SProcRenderQueryDithers(ClientPtr pClient); static int SProcRenderCreatePicture(ClientPtr pClient); static int SProcRenderChangePicture(ClientPtr pClient); static int SProcRenderSetPictureClipRectangles(ClientPtr pClient); static int SProcRenderFreePicture(ClientPtr pClient); static int SProcRenderComposite(ClientPtr pClient); static int SProcRenderScale(ClientPtr pClient); static int SProcRenderTrapezoids(ClientPtr pClient); static int SProcRenderTriangles(ClientPtr pClient); static int SProcRenderTriStrip(ClientPtr pClient); static int SProcRenderTriFan(ClientPtr pClient); static int SProcRenderColorTrapezoids(ClientPtr pClient); static int SProcRenderColorTriangles(ClientPtr pClient); static int SProcRenderTransform(ClientPtr pClient); static int SProcRenderCreateGlyphSet(ClientPtr pClient); static int SProcRenderReferenceGlyphSet(ClientPtr pClient); static int SProcRenderFreeGlyphSet(ClientPtr pClient); static int SProcRenderAddGlyphs(ClientPtr pClient); static int SProcRenderAddGlyphsFromPicture(ClientPtr pClient); static int SProcRenderFreeGlyphs(ClientPtr pClient); static int SProcRenderCompositeGlyphs(ClientPtr pClient); static int SProcRenderFillRectangles(ClientPtr pClient); static int SProcRenderCreateCursor(ClientPtr pClient); static int SProcRenderSetPictureTransform(ClientPtr pClient); static int SProcRenderQueryFilters(ClientPtr pClient); static int SProcRenderSetPictureFilter(ClientPtr pClient); static int SProcRenderCreateAnimCursor(ClientPtr pClient); static int SProcRenderAddTraps(ClientPtr pClient); static int SProcRenderCreateSolidFill(ClientPtr pClient); static int SProcRenderCreateLinearGradient(ClientPtr pClient); static int SProcRenderCreateRadialGradient(ClientPtr pClient); static int SProcRenderCreateConicalGradient(ClientPtr pClient); static int SProcRenderDispatch(ClientPtr pClient); int (*ProcRenderVector[RenderNumberRequests]) (ClientPtr) = { ProcRenderQueryVersion, ProcRenderQueryPictFormats, ProcRenderQueryPictIndexValues, ProcRenderQueryDithers, ProcRenderCreatePicture, ProcRenderChangePicture, ProcRenderSetPictureClipRectangles, ProcRenderFreePicture, ProcRenderComposite, ProcRenderScale, ProcRenderTrapezoids, ProcRenderTriangles, ProcRenderTriStrip, ProcRenderTriFan, ProcRenderColorTrapezoids, ProcRenderColorTriangles, ProcRenderTransform, ProcRenderCreateGlyphSet, ProcRenderReferenceGlyphSet, ProcRenderFreeGlyphSet, ProcRenderAddGlyphs, ProcRenderAddGlyphsFromPicture, ProcRenderFreeGlyphs, ProcRenderCompositeGlyphs, ProcRenderCompositeGlyphs, ProcRenderCompositeGlyphs, ProcRenderFillRectangles, ProcRenderCreateCursor, ProcRenderSetPictureTransform, ProcRenderQueryFilters, ProcRenderSetPictureFilter, ProcRenderCreateAnimCursor, ProcRenderAddTraps, ProcRenderCreateSolidFill, ProcRenderCreateLinearGradient, ProcRenderCreateRadialGradient, ProcRenderCreateConicalGradient}; int (*SProcRenderVector[RenderNumberRequests]) (ClientPtr) = { SProcRenderQueryVersion, SProcRenderQueryPictFormats, SProcRenderQueryPictIndexValues, SProcRenderQueryDithers, SProcRenderCreatePicture, SProcRenderChangePicture, SProcRenderSetPictureClipRectangles, SProcRenderFreePicture, SProcRenderComposite, SProcRenderScale, SProcRenderTrapezoids, SProcRenderTriangles, SProcRenderTriStrip, SProcRenderTriFan, SProcRenderColorTrapezoids, SProcRenderColorTriangles, SProcRenderTransform, SProcRenderCreateGlyphSet, SProcRenderReferenceGlyphSet, SProcRenderFreeGlyphSet, SProcRenderAddGlyphs, SProcRenderAddGlyphsFromPicture, SProcRenderFreeGlyphs, SProcRenderCompositeGlyphs, SProcRenderCompositeGlyphs, SProcRenderCompositeGlyphs, SProcRenderFillRectangles, SProcRenderCreateCursor, SProcRenderSetPictureTransform, SProcRenderQueryFilters, SProcRenderSetPictureFilter, SProcRenderCreateAnimCursor, SProcRenderAddTraps, SProcRenderCreateSolidFill, SProcRenderCreateLinearGradient, SProcRenderCreateRadialGradient, SProcRenderCreateConicalGradient}; int RenderErrBase; static DevPrivateKeyRec RenderClientPrivateKeyRec; #define RenderClientPrivateKey (&RenderClientPrivateKeyRec ) typedef struct _RenderClient { int major_version; int minor_version; } RenderClientRec, *RenderClientPtr; #define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey)) static void RenderClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; RenderClientPtr pRenderClient = GetRenderClient(pClient); pRenderClient->major_version = 0; pRenderClient->minor_version = 0; } #ifdef PANORAMIX RESTYPE XRT_PICTURE; #endif void RenderExtensionInit(void) { ExtensionEntry *extEntry; if (!PictureType) return; if (!PictureFinishInit()) return; if (!dixRegisterPrivateKey (&RenderClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(RenderClientRec))) return; if (!AddCallback(&ClientStateCallback, RenderClientCallback, 0)) return; extEntry = AddExtension(RENDER_NAME, 0, RenderNumberErrors, ProcRenderDispatch, SProcRenderDispatch, NULL, StandardMinorOpcode); if (!extEntry) return; RenderErrBase = extEntry->errorBase; #ifdef PANORAMIX if (XRT_PICTURE) SetResourceTypeErrorValue(XRT_PICTURE, RenderErrBase + BadPicture); #endif SetResourceTypeErrorValue(PictureType, RenderErrBase + BadPicture); SetResourceTypeErrorValue(PictFormatType, RenderErrBase + BadPictFormat); SetResourceTypeErrorValue(GlyphSetType, RenderErrBase + BadGlyphSet); } static int ProcRenderQueryVersion(ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient(client); xRenderQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; REQUEST(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq); pRenderClient->major_version = stuff->majorVersion; pRenderClient->minor_version = stuff->minorVersion; if ((stuff->majorVersion * 1000 + stuff->minorVersion) < (SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } else { rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; rep.minorVersion = SERVER_RENDER_MINOR_VERSION; } if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.majorVersion); swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xRenderQueryVersionReply), &rep); return Success; } static VisualPtr findVisual(ScreenPtr pScreen, VisualID vid) { VisualPtr pVisual; int v; for (v = 0; v < pScreen->numVisuals; v++) { pVisual = pScreen->visuals + v; if (pVisual->vid == vid) return pVisual; } return 0; } static int ProcRenderQueryPictFormats(ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient(client); xRenderQueryPictFormatsReply *reply; xPictScreen *pictScreen; xPictDepth *pictDepth; xPictVisual *pictVisual; xPictFormInfo *pictForm; CARD32 *pictSubpixel; ScreenPtr pScreen; VisualPtr pVisual; DepthPtr pDepth; int v, d; PictureScreenPtr ps; PictFormatPtr pFormat; int nformat; int ndepth; int nvisual; int rlength; int s; int numScreens; int numSubpixel; /* REQUEST(xRenderQueryPictFormatsReq); */ REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); #ifdef PANORAMIX if (noPanoramiXExtension) numScreens = screenInfo.numScreens; else numScreens = ((xConnSetup *) ConnectionInfo)->numRoots; #else numScreens = screenInfo.numScreens; #endif ndepth = nformat = nvisual = 0; for (s = 0; s < numScreens; s++) { pScreen = screenInfo.screens[s]; for (d = 0; d < pScreen->numDepths; d++) { pDepth = pScreen->allowedDepths + d; ++ndepth; for (v = 0; v < pDepth->numVids; v++) { pVisual = findVisual(pScreen, pDepth->vids[v]); if (pVisual && PictureMatchVisual(pScreen, pDepth->depth, pVisual)) ++nvisual; } } ps = GetPictureScreenIfSet(pScreen); if (ps) nformat += ps->nformats; } if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6) numSubpixel = 0; else numSubpixel = numScreens; rlength = (sizeof(xRenderQueryPictFormatsReply) + nformat * sizeof(xPictFormInfo) + numScreens * sizeof(xPictScreen) + ndepth * sizeof(xPictDepth) + nvisual * sizeof(xPictVisual) + numSubpixel * sizeof(CARD32)); reply = (xRenderQueryPictFormatsReply *) calloc(1, rlength); if (!reply) return BadAlloc; reply->type = X_Reply; reply->sequenceNumber = client->sequence; reply->length = bytes_to_int32(rlength - sizeof(xGenericReply)); reply->numFormats = nformat; reply->numScreens = numScreens; reply->numDepths = ndepth; reply->numVisuals = nvisual; reply->numSubpixel = numSubpixel; pictForm = (xPictFormInfo *) (reply + 1); for (s = 0; s < numScreens; s++) { pScreen = screenInfo.screens[s]; ps = GetPictureScreenIfSet(pScreen); if (ps) { for (nformat = 0, pFormat = ps->formats; nformat < ps->nformats; nformat++, pFormat++) { pictForm->id = pFormat->id; pictForm->type = pFormat->type; pictForm->depth = pFormat->depth; pictForm->direct.red = pFormat->direct.red; pictForm->direct.redMask = pFormat->direct.redMask; pictForm->direct.green = pFormat->direct.green; pictForm->direct.greenMask = pFormat->direct.greenMask; pictForm->direct.blue = pFormat->direct.blue; pictForm->direct.blueMask = pFormat->direct.blueMask; pictForm->direct.alpha = pFormat->direct.alpha; pictForm->direct.alphaMask = pFormat->direct.alphaMask; if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap) pictForm->colormap = pFormat->index.pColormap->mid; else pictForm->colormap = None; if (client->swapped) { swapl(&pictForm->id); swaps(&pictForm->direct.red); swaps(&pictForm->direct.redMask); swaps(&pictForm->direct.green); swaps(&pictForm->direct.greenMask); swaps(&pictForm->direct.blue); swaps(&pictForm->direct.blueMask); swaps(&pictForm->direct.alpha); swaps(&pictForm->direct.alphaMask); swapl(&pictForm->colormap); } pictForm++; } } } pictScreen = (xPictScreen *) pictForm; for (s = 0; s < numScreens; s++) { pScreen = screenInfo.screens[s]; pictDepth = (xPictDepth *) (pictScreen + 1); ndepth = 0; for (d = 0; d < pScreen->numDepths; d++) { pictVisual = (xPictVisual *) (pictDepth + 1); pDepth = pScreen->allowedDepths + d; nvisual = 0; for (v = 0; v < pDepth->numVids; v++) { pVisual = findVisual(pScreen, pDepth->vids[v]); if (pVisual && (pFormat = PictureMatchVisual(pScreen, pDepth->depth, pVisual))) { pictVisual->visual = pVisual->vid; pictVisual->format = pFormat->id; if (client->swapped) { swapl(&pictVisual->visual); swapl(&pictVisual->format); } pictVisual++; nvisual++; } } pictDepth->depth = pDepth->depth; pictDepth->nPictVisuals = nvisual; if (client->swapped) { swaps(&pictDepth->nPictVisuals); } ndepth++; pictDepth = (xPictDepth *) pictVisual; } pictScreen->nDepth = ndepth; ps = GetPictureScreenIfSet(pScreen); if (ps) pictScreen->fallback = ps->fallback->id; else pictScreen->fallback = 0; if (client->swapped) { swapl(&pictScreen->nDepth); swapl(&pictScreen->fallback); } pictScreen = (xPictScreen *) pictDepth; } pictSubpixel = (CARD32 *) pictScreen; for (s = 0; s < numSubpixel; s++) { pScreen = screenInfo.screens[s]; ps = GetPictureScreenIfSet(pScreen); if (ps) *pictSubpixel = ps->subpixel; else *pictSubpixel = SubPixelUnknown; if (client->swapped) { swapl(pictSubpixel); } ++pictSubpixel; } if (client->swapped) { swaps(&reply->sequenceNumber); swapl(&reply->length); swapl(&reply->numFormats); swapl(&reply->numScreens); swapl(&reply->numDepths); swapl(&reply->numVisuals); swapl(&reply->numSubpixel); } WriteToClient(client, rlength, reply); free(reply); return Success; } static int ProcRenderQueryPictIndexValues(ClientPtr client) { PictFormatPtr pFormat; int rc, num; int rlength; int i; REQUEST(xRenderQueryPictIndexValuesReq); xRenderQueryPictIndexValuesReply *reply; xIndexValue *values; REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); rc = dixLookupResourceByType((void **) &pFormat, stuff->format, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; if (pFormat->type != PictTypeIndexed) { client->errorValue = stuff->format; return BadMatch; } num = pFormat->index.nvalues; rlength = (sizeof(xRenderQueryPictIndexValuesReply) + num * sizeof(xIndexValue)); reply = (xRenderQueryPictIndexValuesReply *) calloc(1, rlength); if (!reply) return BadAlloc; reply->type = X_Reply; reply->sequenceNumber = client->sequence; reply->length = bytes_to_int32(rlength - sizeof(xGenericReply)); reply->numIndexValues = num; values = (xIndexValue *) (reply + 1); memcpy(reply + 1, pFormat->index.pValues, num * sizeof(xIndexValue)); if (client->swapped) { for (i = 0; i < num; i++) { swapl(&values[i].pixel); swaps(&values[i].red); swaps(&values[i].green); swaps(&values[i].blue); swaps(&values[i].alpha); } swaps(&reply->sequenceNumber); swapl(&reply->length); swapl(&reply->numIndexValues); } WriteToClient(client, rlength, reply); free(reply); return Success; } static int ProcRenderQueryDithers(ClientPtr client) { return BadImplementation; } static int ProcRenderCreatePicture(ClientPtr client) { PicturePtr pPicture; DrawablePtr pDrawable; PictFormatPtr pFormat; int len, error, rc; REQUEST(xRenderCreatePictureReq); REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); LEGAL_NEW_RESOURCE(stuff->pid, client); rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, DixReadAccess | DixAddAccess); if (rc != Success) return rc; rc = dixLookupResourceByType((void **) &pFormat, stuff->format, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; if (pFormat->depth != pDrawable->depth) return BadMatch; len = client->req_len - bytes_to_int32(sizeof(xRenderCreatePictureReq)); if (Ones(stuff->mask) != len) return BadLength; pPicture = CreatePicture(stuff->pid, pDrawable, pFormat, stuff->mask, (XID *) (stuff + 1), client, &error); if (!pPicture) return error; if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } static int ProcRenderChangePicture(ClientPtr client) { PicturePtr pPicture; REQUEST(xRenderChangePictureReq); int len; REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); len = client->req_len - bytes_to_int32(sizeof(xRenderChangePictureReq)); if (Ones(stuff->mask) != len) return BadLength; return ChangePicture(pPicture, stuff->mask, (XID *) (stuff + 1), (DevUnion *) 0, client); } static int ProcRenderSetPictureClipRectangles(ClientPtr client) { REQUEST(xRenderSetPictureClipRectanglesReq); PicturePtr pPicture; int nr; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); if (!pPicture->pDrawable) return RenderErrBase + BadPicture; nr = (client->req_len << 2) - sizeof(xRenderSetPictureClipRectanglesReq); if (nr & 4) return BadLength; nr >>= 3; return SetPictureClipRects(pPicture, stuff->xOrigin, stuff->yOrigin, nr, (xRectangle *) &stuff[1]); } static int ProcRenderFreePicture(ClientPtr client) { PicturePtr pPicture; REQUEST(xRenderFreePictureReq); REQUEST_SIZE_MATCH(xRenderFreePictureReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixDestroyAccess); FreeResource(stuff->picture, RT_NONE); return Success; } static Bool PictOpValid(CARD8 op) { if ( /*PictOpMinimum <= op && */ op <= PictOpMaximum) return TRUE; if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum) return TRUE; if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum) return TRUE; if (PictOpBlendMinimum <= op && op <= PictOpBlendMaximum) return TRUE; return FALSE; } static int ProcRenderComposite(ClientPtr client) { PicturePtr pSrc, pMask, pDst; REQUEST(xRenderCompositeReq); REQUEST_SIZE_MATCH(xRenderCompositeReq); if (!PictOpValid(stuff->op)) { client->errorValue = stuff->op; return BadValue; } VERIFY_PICTURE(pDst, stuff->dst, client, DixWriteAccess); if (!pDst->pDrawable) return BadDrawable; VERIFY_PICTURE(pSrc, stuff->src, client, DixReadAccess); VERIFY_ALPHA(pMask, stuff->mask, client, DixReadAccess); if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask-> pDrawable && pDst-> pDrawable-> pScreen != pMask-> pDrawable-> pScreen)) return BadMatch; CompositePicture(stuff->op, pSrc, pMask, pDst, stuff->xSrc, stuff->ySrc, stuff->xMask, stuff->yMask, stuff->xDst, stuff->yDst, stuff->width, stuff->height); return Success; } static int ProcRenderScale(ClientPtr client) { return BadImplementation; } static int ProcRenderTrapezoids(ClientPtr client) { int rc, ntraps; PicturePtr pSrc, pDst; PictFormatPtr pFormat; REQUEST(xRenderTrapezoidsReq); REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); if (!PictOpValid(stuff->op)) { client->errorValue = stuff->op; return BadValue; } VERIFY_PICTURE(pSrc, stuff->src, client, DixReadAccess); VERIFY_PICTURE(pDst, stuff->dst, client, DixWriteAccess); if (!pDst->pDrawable) return BadDrawable; if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; } else pFormat = 0; ntraps = (client->req_len << 2) - sizeof(xRenderTrapezoidsReq); if (ntraps % sizeof(xTrapezoid)) return BadLength; ntraps /= sizeof(xTrapezoid); if (ntraps) CompositeTrapezoids(stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, ntraps, (xTrapezoid *) &stuff[1]); return Success; } static int ProcRenderTriangles(ClientPtr client) { int rc, ntris; PicturePtr pSrc, pDst; PictFormatPtr pFormat; REQUEST(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); if (!PictOpValid(stuff->op)) { client->errorValue = stuff->op; return BadValue; } VERIFY_PICTURE(pSrc, stuff->src, client, DixReadAccess); VERIFY_PICTURE(pDst, stuff->dst, client, DixWriteAccess); if (!pDst->pDrawable) return BadDrawable; if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; } else pFormat = 0; ntris = (client->req_len << 2) - sizeof(xRenderTrianglesReq); if (ntris % sizeof(xTriangle)) return BadLength; ntris /= sizeof(xTriangle); if (ntris) CompositeTriangles(stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, ntris, (xTriangle *) &stuff[1]); return Success; } static int ProcRenderTriStrip(ClientPtr client) { int rc, npoints; PicturePtr pSrc, pDst; PictFormatPtr pFormat; REQUEST(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); if (!PictOpValid(stuff->op)) { client->errorValue = stuff->op; return BadValue; } VERIFY_PICTURE(pSrc, stuff->src, client, DixReadAccess); VERIFY_PICTURE(pDst, stuff->dst, client, DixWriteAccess); if (!pDst->pDrawable) return BadDrawable; if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; } else pFormat = 0; npoints = ((client->req_len << 2) - sizeof(xRenderTriStripReq)); if (npoints & 4) return BadLength; npoints >>= 3; if (npoints >= 3) CompositeTriStrip(stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, npoints, (xPointFixed *) &stuff[1]); return Success; } static int ProcRenderTriFan(ClientPtr client) { int rc, npoints; PicturePtr pSrc, pDst; PictFormatPtr pFormat; REQUEST(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); if (!PictOpValid(stuff->op)) { client->errorValue = stuff->op; return BadValue; } VERIFY_PICTURE(pSrc, stuff->src, client, DixReadAccess); VERIFY_PICTURE(pDst, stuff->dst, client, DixWriteAccess); if (!pDst->pDrawable) return BadDrawable; if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; } else pFormat = 0; npoints = ((client->req_len << 2) - sizeof(xRenderTriStripReq)); if (npoints & 4) return BadLength; npoints >>= 3; if (npoints >= 3) CompositeTriFan(stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, npoints, (xPointFixed *) &stuff[1]); return Success; } static int ProcRenderColorTrapezoids(ClientPtr client) { return BadImplementation; } static int ProcRenderColorTriangles(ClientPtr client) { return BadImplementation; } static int ProcRenderTransform(ClientPtr client) { return BadImplementation; } static int ProcRenderCreateGlyphSet(ClientPtr client) { GlyphSetPtr glyphSet; PictFormatPtr format; int rc, f; REQUEST(xRenderCreateGlyphSetReq); REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); LEGAL_NEW_RESOURCE(stuff->gsid, client); rc = dixLookupResourceByType((void **) &format, stuff->format, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; switch (format->depth) { case 1: f = GlyphFormat1; break; case 4: f = GlyphFormat4; break; case 8: f = GlyphFormat8; break; case 16: f = GlyphFormat16; break; case 32: f = GlyphFormat32; break; default: return BadMatch; } if (format->type != PictTypeDirect) return BadMatch; glyphSet = AllocateGlyphSet(f, format); if (!glyphSet) return BadAlloc; /* security creation/labeling check */ rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->gsid, GlyphSetType, glyphSet, RT_NONE, NULL, DixCreateAccess); if (rc != Success) return rc; if (!AddResource(stuff->gsid, GlyphSetType, (void *) glyphSet)) return BadAlloc; return Success; } static int ProcRenderReferenceGlyphSet(ClientPtr client) { GlyphSetPtr glyphSet; int rc; REQUEST(xRenderReferenceGlyphSetReq); REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); LEGAL_NEW_RESOURCE(stuff->gsid, client); rc = dixLookupResourceByType((void **) &glyphSet, stuff->existing, GlyphSetType, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->existing; return rc; } glyphSet->refcnt++; if (!AddResource(stuff->gsid, GlyphSetType, (void *) glyphSet)) return BadAlloc; return Success; } #define NLOCALDELTA 64 #define NLOCALGLYPH 256 static int ProcRenderFreeGlyphSet(ClientPtr client) { GlyphSetPtr glyphSet; int rc; REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); rc = dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixDestroyAccess); if (rc != Success) { client->errorValue = stuff->glyphset; return rc; } FreeResource(stuff->glyphset, RT_NONE); return Success; } typedef struct _GlyphNew { Glyph id; GlyphPtr glyph; Bool found; unsigned char sha1[20]; } GlyphNewRec, *GlyphNewPtr; #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) static int ProcRenderAddGlyphs(ClientPtr client) { GlyphSetPtr glyphSet; REQUEST(xRenderAddGlyphsReq); GlyphNewRec glyphsLocal[NLOCALGLYPH]; GlyphNewPtr glyphsBase, glyphs, glyph_new; int remain, nglyphs; CARD32 *gids; xGlyphInfo *gi; CARD8 *bits; unsigned int size; int err; int i, screen; PicturePtr pSrc = NULL, pDst = NULL; PixmapPtr pSrcPix = NULL, pDstPix = NULL; CARD32 component_alpha; REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); err = dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixAddAccess); if (err != Success) { client->errorValue = stuff->glyphset; return err; } err = BadAlloc; nglyphs = stuff->nglyphs; if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec)) return BadAlloc; component_alpha = NeedsComponent(glyphSet->format->format); if (nglyphs <= NLOCALGLYPH) { memset(glyphsLocal, 0, sizeof(glyphsLocal)); glyphsBase = glyphsLocal; } else { glyphsBase = (GlyphNewPtr) calloc(nglyphs, sizeof(GlyphNewRec)); if (!glyphsBase) return BadAlloc; } remain = (client->req_len << 2) - sizeof(xRenderAddGlyphsReq); glyphs = glyphsBase; gids = (CARD32 *) (stuff + 1); gi = (xGlyphInfo *) (gids + nglyphs); bits = (CARD8 *) (gi + nglyphs); remain -= (sizeof(CARD32) + sizeof(xGlyphInfo)) * nglyphs; /* protect against bad nglyphs */ if (gi < ((xGlyphInfo *) stuff) || gi > ((xGlyphInfo *) ((CARD32 *) stuff + client->req_len)) || bits < ((CARD8 *) stuff) || bits > ((CARD8 *) ((CARD32 *) stuff + client->req_len))) { err = BadLength; goto bail; } for (i = 0; i < nglyphs; i++) { size_t padded_width; glyph_new = &glyphs[i]; padded_width = PixmapBytePad(gi[i].width, glyphSet->format->depth); if (gi[i].height && padded_width > (UINT32_MAX - sizeof(GlyphRec)) / gi[i].height) break; size = gi[i].height * padded_width; if (remain < size) break; err = HashGlyph(&gi[i], bits, size, glyph_new->sha1); if (err) goto bail; glyph_new->glyph = FindGlyphByHash(glyph_new->sha1, glyphSet->fdepth); if (glyph_new->glyph && glyph_new->glyph != DeletedGlyph) { glyph_new->found = TRUE; } else { GlyphPtr glyph; glyph_new->found = FALSE; glyph_new->glyph = glyph = AllocateGlyph(&gi[i], glyphSet->fdepth); if (!glyph) { err = BadAlloc; goto bail; } for (screen = 0; screen < screenInfo.numScreens; screen++) { int width = gi[i].width; int height = gi[i].height; int depth = glyphSet->format->depth; ScreenPtr pScreen; int error; /* Skip work if it's invisibly small anyway */ if (!width || !height) break; pScreen = screenInfo.screens[screen]; pSrcPix = GetScratchPixmapHeader(pScreen, width, height, depth, depth, -1, bits); if (!pSrcPix) { err = BadAlloc; goto bail; } pSrc = CreatePicture(0, &pSrcPix->drawable, glyphSet->format, 0, NULL, serverClient, &error); if (!pSrc) { err = BadAlloc; goto bail; } pDstPix = (pScreen->CreatePixmap) (pScreen, width, height, depth, CREATE_PIXMAP_USAGE_GLYPH_PICTURE); if (!pDstPix) { err = BadAlloc; goto bail; } 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. */ (pScreen->DestroyPixmap) (pDstPix); pDstPix = NULL; if (!pDst) { err = BadAlloc; goto bail; } CompositePicture(PictOpSrc, pSrc, None, pDst, 0, 0, 0, 0, 0, 0, width, height); FreePicture((void *) pSrc, 0); pSrc = NULL; FreeScratchPixmapHeader(pSrcPix); pSrcPix = NULL; } memcpy(glyph_new->glyph->sha1, glyph_new->sha1, 20); } glyph_new->id = gids[i]; if (size & 3) size += 4 - (size & 3); bits += size; remain -= size; } if (remain || i < nglyphs) { err = BadLength; goto bail; } if (!ResizeGlyphSet(glyphSet, nglyphs)) { err = BadAlloc; goto bail; } for (i = 0; i < nglyphs; i++) AddGlyph(glyphSet, glyphs[i].glyph, glyphs[i].id); if (glyphsBase != glyphsLocal) free(glyphsBase); return Success; bail: if (pSrc) FreePicture((void *) pSrc, 0); if (pSrcPix) FreeScratchPixmapHeader(pSrcPix); for (i = 0; i < nglyphs; i++) if (glyphs[i].glyph && !glyphs[i].found) free(glyphs[i].glyph); if (glyphsBase != glyphsLocal) free(glyphsBase); return err; } static int ProcRenderAddGlyphsFromPicture(ClientPtr client) { return BadImplementation; } static int ProcRenderFreeGlyphs(ClientPtr client) { REQUEST(xRenderFreeGlyphsReq); GlyphSetPtr glyphSet; int rc, nglyph; CARD32 *gids; CARD32 glyph; REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); rc = dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixRemoveAccess); if (rc != Success) { client->errorValue = stuff->glyphset; return rc; } nglyph = bytes_to_int32((client->req_len << 2) - sizeof(xRenderFreeGlyphsReq)); gids = (CARD32 *) (stuff + 1); while (nglyph-- > 0) { glyph = *gids++; if (!DeleteGlyph(glyphSet, glyph)) { client->errorValue = glyph; return RenderErrBase + BadGlyph; } } return Success; } static int ProcRenderCompositeGlyphs(ClientPtr client) { GlyphSetPtr glyphSet; GlyphSet gs; PicturePtr pSrc, pDst; PictFormatPtr pFormat; GlyphListRec listsLocal[NLOCALDELTA]; GlyphListPtr lists, listsBase; GlyphPtr glyphsLocal[NLOCALGLYPH]; Glyph glyph; GlyphPtr *glyphs, *glyphsBase; xGlyphElt *elt; CARD8 *buffer, *end; int nglyph; int nlist; int space; int size; int rc, n; REQUEST(xRenderCompositeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); switch (stuff->renderReqType) { default: size = 1; break; case X_RenderCompositeGlyphs16: size = 2; break; case X_RenderCompositeGlyphs32: size = 4; break; } if (!PictOpValid(stuff->op)) { client->errorValue = stuff->op; return BadValue; } VERIFY_PICTURE(pSrc, stuff->src, client, DixReadAccess); VERIFY_PICTURE(pDst, stuff->dst, client, DixWriteAccess); if (!pDst->pDrawable) return BadDrawable; if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; } else pFormat = 0; rc = dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixUseAccess); if (rc != Success) return rc; buffer = (CARD8 *) (stuff + 1); end = (CARD8 *) stuff + (client->req_len << 2); nglyph = 0; nlist = 0; while (buffer + sizeof(xGlyphElt) < end) { elt = (xGlyphElt *) buffer; buffer += sizeof(xGlyphElt); if (elt->len == 0xff) { buffer += 4; } else { nlist++; nglyph += elt->len; space = size * elt->len; if (space & 3) space += 4 - (space & 3); buffer += space; } } if (nglyph <= NLOCALGLYPH) glyphsBase = glyphsLocal; else { glyphsBase = (GlyphPtr *) malloc(nglyph * sizeof(GlyphPtr)); if (!glyphsBase) return BadAlloc; } if (nlist <= NLOCALDELTA) listsBase = listsLocal; else { listsBase = (GlyphListPtr) malloc(nlist * sizeof(GlyphListRec)); if (!listsBase) { rc = BadAlloc; goto bail; } } buffer = (CARD8 *) (stuff + 1); glyphs = glyphsBase; lists = listsBase; while (buffer + sizeof(xGlyphElt) < end) { elt = (xGlyphElt *) buffer; buffer += sizeof(xGlyphElt); if (elt->len == 0xff) { if (buffer + sizeof(GlyphSet) < end) { memcpy(&gs, buffer, sizeof(GlyphSet)); rc = dixLookupResourceByType((void **) &glyphSet, gs, GlyphSetType, client, DixUseAccess); if (rc != Success) goto bail; } buffer += 4; } else { lists->xOff = elt->deltax; lists->yOff = elt->deltay; lists->format = glyphSet->format; lists->len = 0; n = elt->len; while (n--) { if (buffer + size <= end) { switch (size) { case 1: glyph = *((CARD8 *) buffer); break; case 2: glyph = *((CARD16 *) buffer); break; case 4: default: glyph = *((CARD32 *) buffer); break; } if ((*glyphs = FindGlyph(glyphSet, glyph))) { lists->len++; glyphs++; } } buffer += size; } space = size * elt->len; if (space & 3) buffer += 4 - (space & 3); lists++; } } if (buffer > end) { rc = BadLength; goto bail; } CompositeGlyphs(stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, nlist, listsBase, glyphsBase); rc = Success; bail: if (glyphsBase != glyphsLocal) free(glyphsBase); if (listsBase != listsLocal) free(listsBase); return rc; } static int ProcRenderFillRectangles(ClientPtr client) { PicturePtr pDst; int things; REQUEST(xRenderFillRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderFillRectanglesReq); if (!PictOpValid(stuff->op)) { client->errorValue = stuff->op; return BadValue; } VERIFY_PICTURE(pDst, stuff->dst, client, DixWriteAccess); if (!pDst->pDrawable) return BadDrawable; things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq); if (things & 4) return BadLength; things >>= 3; CompositeRects(stuff->op, pDst, &stuff->color, things, (xRectangle *) &stuff[1]); return Success; } static void RenderSetBit(unsigned char *line, int x, int bit) { unsigned char mask; if (screenInfo.bitmapBitOrder == LSBFirst) mask = (1 << (x & 7)); else mask = (0x80 >> (x & 7)); /* XXX assumes byte order is host byte order */ line += (x >> 3); if (bit) *line |= mask; else *line &= ~mask; } #define DITHER_DIM 2 static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = { {1, 3,}, {4, 2,}, }; #define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1) static int ProcRenderCreateCursor(ClientPtr client) { REQUEST(xRenderCreateCursorReq); PicturePtr pSrc; ScreenPtr pScreen; unsigned short width, height; CARD32 *argbbits, *argb; unsigned char *srcbits, *srcline; unsigned char *mskbits, *mskline; int stride; int x, y; int nbytes_mono; CursorMetricRec cm; CursorPtr pCursor; CARD32 twocolor[3]; int rc, ncolor; REQUEST_SIZE_MATCH(xRenderCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); VERIFY_PICTURE(pSrc, stuff->src, client, DixReadAccess); if (!pSrc->pDrawable) return BadDrawable; pScreen = pSrc->pDrawable->pScreen; width = pSrc->pDrawable->width; height = pSrc->pDrawable->height; if (height && width > UINT32_MAX / (height * sizeof(CARD32))) return BadAlloc; if (stuff->x > width || stuff->y > height) return BadMatch; argbbits = malloc(width * height * sizeof(CARD32)); if (!argbbits) return BadAlloc; stride = BitmapBytePad(width); nbytes_mono = stride * height; srcbits = calloc(1, nbytes_mono); if (!srcbits) { free(argbbits); return BadAlloc; } mskbits = calloc(1, nbytes_mono); if (!mskbits) { free(argbbits); free(srcbits); return BadAlloc; } if (pSrc->format == PICT_a8r8g8b8) { (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, width, height, ZPixmap, 0xffffffff, (void *) argbbits); } else { PixmapPtr pPixmap; PicturePtr pPicture; PictFormatPtr pFormat; int error; pFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); if (!pFormat) { free(argbbits); free(srcbits); free(mskbits); return BadImplementation; } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32, CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { free(argbbits); free(srcbits); free(mskbits); return BadAlloc; } pPicture = CreatePicture(0, &pPixmap->drawable, pFormat, 0, 0, client, &error); if (!pPicture) { free(argbbits); free(srcbits); free(mskbits); return error; } (*pScreen->DestroyPixmap) (pPixmap); CompositePicture(PictOpSrc, pSrc, 0, pPicture, 0, 0, 0, 0, 0, 0, width, height); (*pScreen->GetImage) (pPicture->pDrawable, 0, 0, width, height, ZPixmap, 0xffffffff, (void *) argbbits); FreePicture(pPicture, 0); } /* * Check whether the cursor can be directly supported by * the core cursor code */ ncolor = 0; argb = argbbits; for (y = 0; ncolor <= 2 && y < height; y++) { for (x = 0; ncolor <= 2 && x < width; x++) { CARD32 p = *argb++; CARD32 a = (p >> 24); if (a == 0) /* transparent */ continue; if (a == 0xff) { /* opaque */ int n; for (n = 0; n < ncolor; n++) if (p == twocolor[n]) break; if (n == ncolor) twocolor[ncolor++] = p; } else ncolor = 3; } } /* * Convert argb image to two plane cursor */ srcline = srcbits; mskline = mskbits; argb = argbbits; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { CARD32 p = *argb++; if (ncolor <= 2) { CARD32 a = ((p >> 24)); RenderSetBit(mskline, x, a != 0); RenderSetBit(srcline, x, a != 0 && p == twocolor[0]); } else { CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255; CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255; CARD32 d = orderedDither[y & (DITHER_DIM - 1)][x & (DITHER_DIM - 1)]; /* Set mask from dithered alpha value */ RenderSetBit(mskline, x, a > d); /* Set src from dithered intensity value */ RenderSetBit(srcline, x, a > d && i <= d); } } srcline += stride; mskline += stride; } /* * Dither to white and black if the cursor has more than two colors */ if (ncolor > 2) { twocolor[0] = 0xff000000; twocolor[1] = 0xffffffff; } else { free(argbbits); argbbits = 0; } #define GetByte(p,s) (((p) >> (s)) & 0xff) #define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8)) cm.width = width; cm.height = height; cm.xhot = stuff->x; cm.yhot = stuff->y; rc = AllocARGBCursor(srcbits, mskbits, argbbits, &cm, GetColor(twocolor[0], 16), GetColor(twocolor[0], 8), GetColor(twocolor[0], 0), GetColor(twocolor[1], 16), GetColor(twocolor[1], 8), GetColor(twocolor[1], 0), &pCursor, client, stuff->cid); if (rc != Success) goto bail; if (!AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) { rc = BadAlloc; goto bail; } return Success; bail: free(srcbits); free(mskbits); return rc; } static int ProcRenderSetPictureTransform(ClientPtr client) { REQUEST(xRenderSetPictureTransformReq); PicturePtr pPicture; REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); return SetPictureTransform(pPicture, (PictTransform *) &stuff->transform); } static int ProcRenderQueryFilters(ClientPtr client) { REQUEST(xRenderQueryFiltersReq); DrawablePtr pDrawable; xRenderQueryFiltersReply *reply; int nbytesName; int nnames; ScreenPtr pScreen; PictureScreenPtr ps; int i, j, len, total_bytes, rc; INT16 *aliases; char *names; REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, DixGetAttrAccess); if (rc != Success) return rc; pScreen = pDrawable->pScreen; nbytesName = 0; nnames = 0; ps = GetPictureScreenIfSet(pScreen); if (ps) { for (i = 0; i < ps->nfilters; i++) nbytesName += 1 + strlen(ps->filters[i].name); for (i = 0; i < ps->nfilterAliases; i++) nbytesName += 1 + strlen(ps->filterAliases[i].alias); nnames = ps->nfilters + ps->nfilterAliases; } len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName); total_bytes = sizeof(xRenderQueryFiltersReply) + (len << 2); reply = (xRenderQueryFiltersReply *) calloc(1, total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); names = (char *) (aliases + ((nnames + 1) & ~1)); reply->type = X_Reply; reply->sequenceNumber = client->sequence; reply->length = len; reply->numAliases = nnames; reply->numFilters = nnames; if (ps) { /* fill in alias values */ for (i = 0; i < ps->nfilters; i++) aliases[i] = FilterAliasNone; for (i = 0; i < ps->nfilterAliases; i++) { for (j = 0; j < ps->nfilters; j++) if (ps->filterAliases[i].filter_id == ps->filters[j].id) break; if (j == ps->nfilters) { for (j = 0; j < ps->nfilterAliases; j++) if (ps->filterAliases[i].filter_id == ps->filterAliases[j].alias_id) { break; } if (j == ps->nfilterAliases) j = FilterAliasNone; else j = j + ps->nfilters; } aliases[i + ps->nfilters] = j; } /* fill in filter names */ for (i = 0; i < ps->nfilters; i++) { j = strlen(ps->filters[i].name); *names++ = j; memcpy(names, ps->filters[i].name, j); names += j; } /* fill in filter alias names */ for (i = 0; i < ps->nfilterAliases; i++) { j = strlen(ps->filterAliases[i].alias); *names++ = j; memcpy(names, ps->filterAliases[i].alias, j); names += j; } } if (client->swapped) { for (i = 0; i < reply->numAliases; i++) { swaps(&aliases[i]); } swaps(&reply->sequenceNumber); swapl(&reply->length); swapl(&reply->numAliases); swapl(&reply->numFilters); } WriteToClient(client, total_bytes, reply); free(reply); return Success; } static int ProcRenderSetPictureFilter(ClientPtr client) { REQUEST(xRenderSetPictureFilterReq); PicturePtr pPicture; int result; xFixed *params; int nparams; char *name; REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); name = (char *) (stuff + 1); params = (xFixed *) (name + pad_to_int32(stuff->nbytes)); nparams = ((xFixed *) stuff + client->req_len) - params; result = SetPictureFilter(pPicture, name, stuff->nbytes, params, nparams); return result; } static int ProcRenderCreateAnimCursor(ClientPtr client) { REQUEST(xRenderCreateAnimCursorReq); CursorPtr *cursors; CARD32 *deltas; CursorPtr pCursor; int ncursor; xAnimCursorElt *elt; int i; int ret; REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); if (client->req_len & 1) return BadLength; ncursor = (client->req_len - (bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1; cursors = malloc(ncursor * (sizeof(CursorPtr) + sizeof(CARD32))); if (!cursors) return BadAlloc; deltas = (CARD32 *) (cursors + ncursor); elt = (xAnimCursorElt *) (stuff + 1); for (i = 0; i < ncursor; i++) { ret = dixLookupResourceByType((void **) (cursors + i), elt->cursor, RT_CURSOR, client, DixReadAccess); if (ret != Success) { free(cursors); return ret; } deltas[i] = elt->delay; elt++; } ret = AnimCursorCreate(cursors, deltas, ncursor, &pCursor, client, stuff->cid); free(cursors); if (ret != Success) return ret; if (AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) return Success; return BadAlloc; } static int ProcRenderAddTraps(ClientPtr client) { int ntraps; PicturePtr pPicture; REQUEST(xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess); if (!pPicture->pDrawable) return BadDrawable; ntraps = (client->req_len << 2) - sizeof(xRenderAddTrapsReq); if (ntraps % sizeof(xTrap)) return BadLength; ntraps /= sizeof(xTrap); if (ntraps) AddTraps(pPicture, stuff->xOff, stuff->yOff, ntraps, (xTrap *) &stuff[1]); return Success; } static int ProcRenderCreateSolidFill(ClientPtr client) { PicturePtr pPicture; int error = 0; REQUEST(xRenderCreateSolidFillReq); REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq); LEGAL_NEW_RESOURCE(stuff->pid, client); pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; /* security creation/labeling check */ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } static int ProcRenderCreateLinearGradient(ClientPtr client) { PicturePtr pPicture; int len; int error = 0; xFixed *stops; xRenderColor *colors; REQUEST(xRenderCreateLinearGradientReq); REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq); LEGAL_NEW_RESOURCE(stuff->pid, client); len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; stops = (xFixed *) (stuff + 1); colors = (xRenderColor *) (stops + stuff->nStops); pPicture = CreateLinearGradientPicture(stuff->pid, &stuff->p1, &stuff->p2, stuff->nStops, stops, colors, &error); if (!pPicture) return error; /* security creation/labeling check */ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } static int ProcRenderCreateRadialGradient(ClientPtr client) { PicturePtr pPicture; int len; int error = 0; xFixed *stops; xRenderColor *colors; REQUEST(xRenderCreateRadialGradientReq); REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq); LEGAL_NEW_RESOURCE(stuff->pid, client); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; stops = (xFixed *) (stuff + 1); colors = (xRenderColor *) (stops + stuff->nStops); pPicture = CreateRadialGradientPicture(stuff->pid, &stuff->inner, &stuff->outer, stuff->inner_radius, stuff->outer_radius, stuff->nStops, stops, colors, &error); if (!pPicture) return error; /* security creation/labeling check */ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } static int ProcRenderCreateConicalGradient(ClientPtr client) { PicturePtr pPicture; int len; int error = 0; xFixed *stops; xRenderColor *colors; REQUEST(xRenderCreateConicalGradientReq); REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq); LEGAL_NEW_RESOURCE(stuff->pid, client); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; stops = (xFixed *) (stuff + 1); colors = (xRenderColor *) (stops + stuff->nStops); pPicture = CreateConicalGradientPicture(stuff->pid, &stuff->center, stuff->angle, stuff->nStops, stops, colors, &error); if (!pPicture) return error; /* security creation/labeling check */ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } static int ProcRenderDispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data < RenderNumberRequests) return (*ProcRenderVector[stuff->data]) (client); else return BadRequest; } static int SProcRenderQueryVersion(ClientPtr client) { REQUEST(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq); swaps(&stuff->length); swapl(&stuff->majorVersion); swapl(&stuff->minorVersion); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryPictFormats(ClientPtr client) { REQUEST(xRenderQueryPictFormatsReq); REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); swaps(&stuff->length); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryPictIndexValues(ClientPtr client) { REQUEST(xRenderQueryPictIndexValuesReq); REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); swaps(&stuff->length); swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryDithers(ClientPtr client) { return BadImplementation; } static int SProcRenderCreatePicture(ClientPtr client) { REQUEST(xRenderCreatePictureReq); REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); swaps(&stuff->length); swapl(&stuff->pid); swapl(&stuff->drawable); swapl(&stuff->format); swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderChangePicture(ClientPtr client) { REQUEST(xRenderChangePictureReq); REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); swaps(&stuff->length); swapl(&stuff->picture); swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureClipRectangles(ClientPtr client) { REQUEST(xRenderSetPictureClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); swaps(&stuff->length); swapl(&stuff->picture); swaps(&stuff->xOrigin); swaps(&stuff->yOrigin); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderFreePicture(ClientPtr client) { REQUEST(xRenderFreePictureReq); REQUEST_SIZE_MATCH(xRenderFreePictureReq); swaps(&stuff->length); swapl(&stuff->picture); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderComposite(ClientPtr client) { REQUEST(xRenderCompositeReq); REQUEST_SIZE_MATCH(xRenderCompositeReq); swaps(&stuff->length); swapl(&stuff->src); swapl(&stuff->mask); swapl(&stuff->dst); swaps(&stuff->xSrc); swaps(&stuff->ySrc); swaps(&stuff->xMask); swaps(&stuff->yMask); swaps(&stuff->xDst); swaps(&stuff->yDst); swaps(&stuff->width); swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderScale(ClientPtr client) { REQUEST(xRenderScaleReq); REQUEST_SIZE_MATCH(xRenderScaleReq); swaps(&stuff->length); swapl(&stuff->src); swapl(&stuff->dst); swapl(&stuff->colorScale); swapl(&stuff->alphaScale); swaps(&stuff->xSrc); swaps(&stuff->ySrc); swaps(&stuff->xDst); swaps(&stuff->yDst); swaps(&stuff->width); swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderTrapezoids(ClientPtr client) { REQUEST(xRenderTrapezoidsReq); REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); swaps(&stuff->length); swapl(&stuff->src); swapl(&stuff->dst); swapl(&stuff->maskFormat); swaps(&stuff->xSrc); swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderTriangles(ClientPtr client) { REQUEST(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); swaps(&stuff->length); swapl(&stuff->src); swapl(&stuff->dst); swapl(&stuff->maskFormat); swaps(&stuff->xSrc); swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderTriStrip(ClientPtr client) { REQUEST(xRenderTriStripReq); REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); swaps(&stuff->length); swapl(&stuff->src); swapl(&stuff->dst); swapl(&stuff->maskFormat); swaps(&stuff->xSrc); swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderTriFan(ClientPtr client) { REQUEST(xRenderTriFanReq); REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); swaps(&stuff->length); swapl(&stuff->src); swapl(&stuff->dst); swapl(&stuff->maskFormat); swaps(&stuff->xSrc); swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderColorTrapezoids(ClientPtr client) { return BadImplementation; } static int SProcRenderColorTriangles(ClientPtr client) { return BadImplementation; } static int SProcRenderTransform(ClientPtr client) { return BadImplementation; } static int SProcRenderCreateGlyphSet(ClientPtr client) { REQUEST(xRenderCreateGlyphSetReq); REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); swaps(&stuff->length); swapl(&stuff->gsid); swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderReferenceGlyphSet(ClientPtr client) { REQUEST(xRenderReferenceGlyphSetReq); REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); swaps(&stuff->length); swapl(&stuff->gsid); swapl(&stuff->existing); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderFreeGlyphSet(ClientPtr client) { REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); swaps(&stuff->length); swapl(&stuff->glyphset); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderAddGlyphs(ClientPtr client) { register int i; CARD32 *gids; void *end; xGlyphInfo *gi; REQUEST(xRenderAddGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); swaps(&stuff->length); swapl(&stuff->glyphset); swapl(&stuff->nglyphs); if (stuff->nglyphs & 0xe0000000) return BadLength; end = (CARD8 *) stuff + (client->req_len << 2); gids = (CARD32 *) (stuff + 1); gi = (xGlyphInfo *) (gids + stuff->nglyphs); if ((char *) end - (char *) (gids + stuff->nglyphs) < 0) return BadLength; if ((char *) end - (char *) (gi + stuff->nglyphs) < 0) return BadLength; for (i = 0; i < stuff->nglyphs; i++) { swapl(&gids[i]); swaps(&gi[i].width); swaps(&gi[i].height); swaps(&gi[i].x); swaps(&gi[i].y); swaps(&gi[i].xOff); swaps(&gi[i].yOff); } return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderAddGlyphsFromPicture(ClientPtr client) { return BadImplementation; } static int SProcRenderFreeGlyphs(ClientPtr client) { REQUEST(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); swaps(&stuff->length); swapl(&stuff->glyphset); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCompositeGlyphs(ClientPtr client) { xGlyphElt *elt; CARD8 *buffer; CARD8 *end; int space; int i; int size; REQUEST(xRenderCompositeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); switch (stuff->renderReqType) { default: size = 1; break; case X_RenderCompositeGlyphs16: size = 2; break; case X_RenderCompositeGlyphs32: size = 4; break; } swaps(&stuff->length); swapl(&stuff->src); swapl(&stuff->dst); swapl(&stuff->maskFormat); swapl(&stuff->glyphset); swaps(&stuff->xSrc); swaps(&stuff->ySrc); buffer = (CARD8 *) (stuff + 1); end = (CARD8 *) stuff + (client->req_len << 2); while (buffer + sizeof(xGlyphElt) < end) { elt = (xGlyphElt *) buffer; buffer += sizeof(xGlyphElt); swaps(&elt->deltax); swaps(&elt->deltay); i = elt->len; if (i == 0xff) { swapl((int *) buffer); buffer += 4; } else { space = size * i; switch (size) { case 1: buffer += i; break; case 2: while (i--) { swaps((short *) buffer); buffer += 2; } break; case 4: while (i--) { swapl((int *) buffer); buffer += 4; } break; } if (space & 3) buffer += 4 - (space & 3); } } return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderFillRectangles(ClientPtr client) { REQUEST(xRenderFillRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderFillRectanglesReq); swaps(&stuff->length); swapl(&stuff->dst); swaps(&stuff->color.red); swaps(&stuff->color.green); swaps(&stuff->color.blue); swaps(&stuff->color.alpha); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateCursor(ClientPtr client) { REQUEST(xRenderCreateCursorReq); REQUEST_SIZE_MATCH(xRenderCreateCursorReq); swaps(&stuff->length); swapl(&stuff->cid); swapl(&stuff->src); swaps(&stuff->x); swaps(&stuff->y); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureTransform(ClientPtr client) { REQUEST(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); swaps(&stuff->length); swapl(&stuff->picture); swapl(&stuff->transform.matrix11); swapl(&stuff->transform.matrix12); swapl(&stuff->transform.matrix13); swapl(&stuff->transform.matrix21); swapl(&stuff->transform.matrix22); swapl(&stuff->transform.matrix23); swapl(&stuff->transform.matrix31); swapl(&stuff->transform.matrix32); swapl(&stuff->transform.matrix33); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryFilters(ClientPtr client) { REQUEST(xRenderQueryFiltersReq); REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); swaps(&stuff->length); swapl(&stuff->drawable); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureFilter(ClientPtr client) { REQUEST(xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); swaps(&stuff->length); swapl(&stuff->picture); swaps(&stuff->nbytes); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateAnimCursor(ClientPtr client) { REQUEST(xRenderCreateAnimCursorReq); REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq); swaps(&stuff->length); swapl(&stuff->cid); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderAddTraps(ClientPtr client) { REQUEST(xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); swaps(&stuff->length); swapl(&stuff->picture); swaps(&stuff->xOff); swaps(&stuff->yOff); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateSolidFill(ClientPtr client) { REQUEST(xRenderCreateSolidFillReq); REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq); swaps(&stuff->length); swapl(&stuff->pid); swaps(&stuff->color.alpha); swaps(&stuff->color.red); swaps(&stuff->color.green); swaps(&stuff->color.blue); return (*ProcRenderVector[stuff->renderReqType]) (client); } static void swapStops(void *stuff, int num) { int i; CARD32 *stops; CARD16 *colors; stops = (CARD32 *) (stuff); for (i = 0; i < num; ++i) { swapl(stops); ++stops; } colors = (CARD16 *) (stops); for (i = 0; i < 4 * num; ++i) { swaps(colors); ++colors; } } static int SProcRenderCreateLinearGradient(ClientPtr client) { int len; REQUEST(xRenderCreateLinearGradientReq); REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq); swaps(&stuff->length); swapl(&stuff->pid); swapl(&stuff->p1.x); swapl(&stuff->p1.y); swapl(&stuff->p2.x); swapl(&stuff->p2.y); swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; swapStops(stuff + 1, stuff->nStops); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateRadialGradient(ClientPtr client) { int len; REQUEST(xRenderCreateRadialGradientReq); REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq); swaps(&stuff->length); swapl(&stuff->pid); swapl(&stuff->inner.x); swapl(&stuff->inner.y); swapl(&stuff->outer.x); swapl(&stuff->outer.y); swapl(&stuff->inner_radius); swapl(&stuff->outer_radius); swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; swapStops(stuff + 1, stuff->nStops); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateConicalGradient(ClientPtr client) { int len; REQUEST(xRenderCreateConicalGradientReq); REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq); swaps(&stuff->length); swapl(&stuff->pid); swapl(&stuff->center.x); swapl(&stuff->center.y); swapl(&stuff->angle); swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; swapStops(stuff + 1, stuff->nStops); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderDispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data < RenderNumberRequests) return (*SProcRenderVector[stuff->data]) (client); else return BadRequest; } #ifdef PANORAMIX #define VERIFY_XIN_PICTURE(pPicture, pid, client, mode) {\ int rc = dixLookupResourceByType((void **)&(pPicture), pid,\ XRT_PICTURE, client, mode);\ if (rc != Success)\ return rc;\ } #define VERIFY_XIN_ALPHA(pPicture, pid, client, mode) {\ if (pid == None) \ pPicture = 0; \ else { \ VERIFY_XIN_PICTURE(pPicture, pid, client, mode); \ } \ } \ int (*PanoramiXSaveRenderVector[RenderNumberRequests]) (ClientPtr); static int PanoramiXRenderCreatePicture(ClientPtr client) { REQUEST(xRenderCreatePictureReq); PanoramiXRes *refDraw, *newPict; int result, j; REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); result = dixLookupResourceByClass((void **) &refDraw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; if (!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; panoramix_setup_ids(newPict, client, stuff->pid); if (refDraw->type == XRT_WINDOW && stuff->drawable == screenInfo.screens[0]->root->drawable.id) { newPict->u.pict.root = TRUE; } else newPict->u.pict.root = FALSE; FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; stuff->drawable = refDraw->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client); if (result != Success) break; } if (result == Success) AddResource(newPict->info[0].id, XRT_PICTURE, newPict); else free(newPict); return result; } static int PanoramiXRenderChangePicture(ClientPtr client) { PanoramiXRes *pict; int result = Success, j; REQUEST(xRenderChangePictureReq); REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess); FOR_NSCREENS_BACKWARD(j) { stuff->picture = pict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client); if (result != Success) break; } return result; } static int PanoramiXRenderSetPictureClipRectangles(ClientPtr client) { REQUEST(xRenderSetPictureClipRectanglesReq); int result = Success, j; PanoramiXRes *pict; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess); FOR_NSCREENS_BACKWARD(j) { stuff->picture = pict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client); if (result != Success) break; } return result; } static int PanoramiXRenderSetPictureTransform(ClientPtr client) { REQUEST(xRenderSetPictureTransformReq); int result = Success, j; PanoramiXRes *pict; REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess); FOR_NSCREENS_BACKWARD(j) { stuff->picture = pict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderSetPictureTransform]) (client); if (result != Success) break; } return result; } static int PanoramiXRenderSetPictureFilter(ClientPtr client) { REQUEST(xRenderSetPictureFilterReq); int result = Success, j; PanoramiXRes *pict; REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess); FOR_NSCREENS_BACKWARD(j) { stuff->picture = pict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderSetPictureFilter]) (client); if (result != Success) break; } return result; } static int PanoramiXRenderFreePicture(ClientPtr client) { PanoramiXRes *pict; int result = Success, j; REQUEST(xRenderFreePictureReq); REQUEST_SIZE_MATCH(xRenderFreePictureReq); client->errorValue = stuff->picture; VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess); FOR_NSCREENS_BACKWARD(j) { stuff->picture = pict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client); if (result != Success) break; } /* Since ProcRenderFreePicture is using FreeResource, it will free our resource for us on the last pass through the loop above */ return result; } static int PanoramiXRenderComposite(ClientPtr client) { PanoramiXRes *src, *msk, *dst; int result = Success, j; xRenderCompositeReq orig; REQUEST(xRenderCompositeReq); REQUEST_SIZE_MATCH(xRenderCompositeReq); VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess); VERIFY_XIN_ALPHA(msk, stuff->mask, client, DixReadAccess); VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess); orig = *stuff; FOR_NSCREENS_FORWARD(j) { stuff->src = src->info[j].id; if (src->u.pict.root) { stuff->xSrc = orig.xSrc - screenInfo.screens[j]->x; stuff->ySrc = orig.ySrc - screenInfo.screens[j]->y; } stuff->dst = dst->info[j].id; if (dst->u.pict.root) { stuff->xDst = orig.xDst - screenInfo.screens[j]->x; stuff->yDst = orig.yDst - screenInfo.screens[j]->y; } if (msk) { stuff->mask = msk->info[j].id; if (msk->u.pict.root) { stuff->xMask = orig.xMask - screenInfo.screens[j]->x; stuff->yMask = orig.yMask - screenInfo.screens[j]->y; } } result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client); if (result != Success) break; } return result; } static int PanoramiXRenderCompositeGlyphs(ClientPtr client) { PanoramiXRes *src, *dst; int result = Success, j; REQUEST(xRenderCompositeGlyphsReq); xGlyphElt origElt, *elt; INT16 xSrc, ySrc; REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess); VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess); if (client->req_len << 2 >= (sizeof(xRenderCompositeGlyphsReq) + sizeof(xGlyphElt))) { elt = (xGlyphElt *) (stuff + 1); origElt = *elt; xSrc = stuff->xSrc; ySrc = stuff->ySrc; FOR_NSCREENS_FORWARD(j) { stuff->src = src->info[j].id; if (src->u.pict.root) { stuff->xSrc = xSrc - screenInfo.screens[j]->x; stuff->ySrc = ySrc - screenInfo.screens[j]->y; } stuff->dst = dst->info[j].id; if (dst->u.pict.root) { elt->deltax = origElt.deltax - screenInfo.screens[j]->x; elt->deltay = origElt.deltay - screenInfo.screens[j]->y; } result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client); if (result != Success) break; } } return result; } static int PanoramiXRenderFillRectangles(ClientPtr client) { PanoramiXRes *dst; int result = Success, j; REQUEST(xRenderFillRectanglesReq); char *extra; int extra_len; REQUEST_AT_LEAST_SIZE(xRenderFillRectanglesReq); VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess); extra_len = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq); if (extra_len && (extra = (char *) malloc(extra_len))) { memcpy(extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(stuff + 1, extra, extra_len); if (dst->u.pict.root) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xRectangle *rects = (xRectangle *) (stuff + 1); int i = extra_len / sizeof(xRectangle); while (i--) { rects->x -= x_off; rects->y -= y_off; rects++; } } } stuff->dst = dst->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); if (result != Success) break; } free(extra); } return result; } static int PanoramiXRenderTrapezoids(ClientPtr client) { PanoramiXRes *src, *dst; int result = Success, j; REQUEST(xRenderTrapezoidsReq); char *extra; int extra_len; REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess); VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess); extra_len = (client->req_len << 2) - sizeof(xRenderTrapezoidsReq); if (extra_len && (extra = (char *) malloc(extra_len))) { memcpy(extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(stuff + 1, extra, extra_len); if (dst->u.pict.root) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xTrapezoid *trap = (xTrapezoid *) (stuff + 1); int i = extra_len / sizeof(xTrapezoid); while (i--) { trap->top -= y_off; trap->bottom -= y_off; trap->left.p1.x -= x_off; trap->left.p1.y -= y_off; trap->left.p2.x -= x_off; trap->left.p2.y -= y_off; trap->right.p1.x -= x_off; trap->right.p1.y -= y_off; trap->right.p2.x -= x_off; trap->right.p2.y -= y_off; trap++; } } } stuff->src = src->info[j].id; stuff->dst = dst->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderTrapezoids]) (client); if (result != Success) break; } free(extra); } return result; } static int PanoramiXRenderTriangles(ClientPtr client) { PanoramiXRes *src, *dst; int result = Success, j; REQUEST(xRenderTrianglesReq); char *extra; int extra_len; REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess); VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess); extra_len = (client->req_len << 2) - sizeof(xRenderTrianglesReq); if (extra_len && (extra = (char *) malloc(extra_len))) { memcpy(extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(stuff + 1, extra, extra_len); if (dst->u.pict.root) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xTriangle *tri = (xTriangle *) (stuff + 1); int i = extra_len / sizeof(xTriangle); while (i--) { tri->p1.x -= x_off; tri->p1.y -= y_off; tri->p2.x -= x_off; tri->p2.y -= y_off; tri->p3.x -= x_off; tri->p3.y -= y_off; tri++; } } } stuff->src = src->info[j].id; stuff->dst = dst->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderTriangles]) (client); if (result != Success) break; } free(extra); } return result; } static int PanoramiXRenderTriStrip(ClientPtr client) { PanoramiXRes *src, *dst; int result = Success, j; REQUEST(xRenderTriStripReq); char *extra; int extra_len; REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess); VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess); extra_len = (client->req_len << 2) - sizeof(xRenderTriStripReq); if (extra_len && (extra = (char *) malloc(extra_len))) { memcpy(extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(stuff + 1, extra, extra_len); if (dst->u.pict.root) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xPointFixed *fixed = (xPointFixed *) (stuff + 1); int i = extra_len / sizeof(xPointFixed); while (i--) { fixed->x -= x_off; fixed->y -= y_off; fixed++; } } } stuff->src = src->info[j].id; stuff->dst = dst->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderTriStrip]) (client); if (result != Success) break; } free(extra); } return result; } static int PanoramiXRenderTriFan(ClientPtr client) { PanoramiXRes *src, *dst; int result = Success, j; REQUEST(xRenderTriFanReq); char *extra; int extra_len; REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess); VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess); extra_len = (client->req_len << 2) - sizeof(xRenderTriFanReq); if (extra_len && (extra = (char *) malloc(extra_len))) { memcpy(extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { if (j) memcpy(stuff + 1, extra, extra_len); if (dst->u.pict.root) { int x_off = screenInfo.screens[j]->x; int y_off = screenInfo.screens[j]->y; if (x_off || y_off) { xPointFixed *fixed = (xPointFixed *) (stuff + 1); int i = extra_len / sizeof(xPointFixed); while (i--) { fixed->x -= x_off; fixed->y -= y_off; fixed++; } } } stuff->src = src->info[j].id; stuff->dst = dst->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderTriFan]) (client); if (result != Success) break; } free(extra); } return result; } static int PanoramiXRenderAddTraps(ClientPtr client) { PanoramiXRes *picture; int result = Success, j; REQUEST(xRenderAddTrapsReq); char *extra; int extra_len; INT16 x_off, y_off; REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); VERIFY_XIN_PICTURE(picture, stuff->picture, client, DixWriteAccess); extra_len = (client->req_len << 2) - sizeof(xRenderAddTrapsReq); if (extra_len && (extra = (char *) malloc(extra_len))) { memcpy(extra, stuff + 1, extra_len); x_off = stuff->xOff; y_off = stuff->yOff; FOR_NSCREENS_FORWARD(j) { if (j) memcpy(stuff + 1, extra, extra_len); stuff->picture = picture->info[j].id; if (picture->u.pict.root) { stuff->xOff = x_off + screenInfo.screens[j]->x; stuff->yOff = y_off + screenInfo.screens[j]->y; } result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); if (result != Success) break; } free(extra); } return result; } static int PanoramiXRenderCreateSolidFill(ClientPtr client) { REQUEST(xRenderCreateSolidFillReq); PanoramiXRes *newPict; int result = Success, j; REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq); if (!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateSolidFill]) (client); if (result != Success) break; } if (result == Success) AddResource(newPict->info[0].id, XRT_PICTURE, newPict); else free(newPict); return result; } static int PanoramiXRenderCreateLinearGradient(ClientPtr client) { REQUEST(xRenderCreateLinearGradientReq); PanoramiXRes *newPict; int result = Success, j; REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq); if (!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateLinearGradient]) (client); if (result != Success) break; } if (result == Success) AddResource(newPict->info[0].id, XRT_PICTURE, newPict); else free(newPict); return result; } static int PanoramiXRenderCreateRadialGradient(ClientPtr client) { REQUEST(xRenderCreateRadialGradientReq); PanoramiXRes *newPict; int result = Success, j; REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq); if (!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateRadialGradient]) (client); if (result != Success) break; } if (result == Success) AddResource(newPict->info[0].id, XRT_PICTURE, newPict); else free(newPict); return result; } static int PanoramiXRenderCreateConicalGradient(ClientPtr client) { REQUEST(xRenderCreateConicalGradientReq); PanoramiXRes *newPict; int result = Success, j; REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq); if (!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateConicalGradient]) (client); if (result != Success) break; } if (result == Success) AddResource(newPict->info[0].id, XRT_PICTURE, newPict); else free(newPict); return result; } void PanoramiXRenderInit(void) { int i; XRT_PICTURE = CreateNewResourceType(XineramaDeleteResource, "XineramaPicture"); if (RenderErrBase) SetResourceTypeErrorValue(XRT_PICTURE, RenderErrBase + BadPicture); for (i = 0; i < RenderNumberRequests; i++) PanoramiXSaveRenderVector[i] = ProcRenderVector[i]; /* * Stuff in Xinerama aware request processing hooks */ ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture; ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture; ProcRenderVector[X_RenderSetPictureTransform] = PanoramiXRenderSetPictureTransform; ProcRenderVector[X_RenderSetPictureFilter] = PanoramiXRenderSetPictureFilter; ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles; ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture; ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite; ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs; ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs; ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs; ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles; ProcRenderVector[X_RenderTrapezoids] = PanoramiXRenderTrapezoids; ProcRenderVector[X_RenderTriangles] = PanoramiXRenderTriangles; ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip; ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan; ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps; ProcRenderVector[X_RenderCreateSolidFill] = PanoramiXRenderCreateSolidFill; ProcRenderVector[X_RenderCreateLinearGradient] = PanoramiXRenderCreateLinearGradient; ProcRenderVector[X_RenderCreateRadialGradient] = PanoramiXRenderCreateRadialGradient; ProcRenderVector[X_RenderCreateConicalGradient] = PanoramiXRenderCreateConicalGradient; } void PanoramiXRenderReset(void) { int i; for (i = 0; i < RenderNumberRequests; i++) ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; RenderErrBase = 0; } #endif /* PANORAMIX */ xorg-server-1.17.1/render/mitri.c0000664000175100017510000000443012274325512013564 00000000000000/* * * Copyright © 2002 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_DIX_CONFIG_H #include #endif #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "mi.h" #include "picturestr.h" #include "mipict.h" void miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds) { bounds->x1 = xFixedToInt(points->x); bounds->x2 = xFixedToInt(xFixedCeil(points->x)); bounds->y1 = xFixedToInt(points->y); bounds->y2 = xFixedToInt(xFixedCeil(points->y)); points++; npoint--; while (npoint-- > 0) { INT16 x1 = xFixedToInt(points->x); INT16 x2 = xFixedToInt(xFixedCeil(points->x)); INT16 y1 = xFixedToInt(points->y); INT16 y2 = xFixedToInt(xFixedCeil(points->y)); if (x1 < bounds->x1) bounds->x1 = x1; else if (x2 > bounds->x2) bounds->x2 = x2; if (y1 < bounds->y1) bounds->y1 = y1; else if (y2 > bounds->y2) bounds->y2 = y2; points++; } } void miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds) { miPointFixedBounds(ntri * 3, (xPointFixed *) tris, bounds); } xorg-server-1.17.1/render/picturestr.h0000664000175100017510000004536112432306326014657 00000000000000/* * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifndef _PICTURESTR_H_ #define _PICTURESTR_H_ #include "scrnintstr.h" #include "glyphstr.h" #include "resource.h" #include "privates.h" typedef struct _DirectFormat { CARD16 red, redMask; CARD16 green, greenMask; CARD16 blue, blueMask; CARD16 alpha, alphaMask; } DirectFormatRec; typedef struct _IndexFormat { VisualID vid; ColormapPtr pColormap; int nvalues; xIndexValue *pValues; void *devPrivate; } IndexFormatRec; typedef struct _PictFormat { CARD32 id; CARD32 format; /* except bpp */ unsigned char type; unsigned char depth; DirectFormatRec direct; IndexFormatRec index; } PictFormatRec; typedef struct pixman_vector PictVector, *PictVectorPtr; typedef struct pixman_transform PictTransform, *PictTransformPtr; #define pict_f_vector pixman_f_vector #define pict_f_transform pixman_f_transform #define PICT_GRADIENT_STOPTABLE_SIZE 1024 #define SourcePictTypeSolidFill 0 #define SourcePictTypeLinear 1 #define SourcePictTypeRadial 2 #define SourcePictTypeConical 3 typedef struct _PictSolidFill { unsigned int type; CARD32 color; } PictSolidFill, *PictSolidFillPtr; typedef struct _PictGradientStop { xFixed x; xRenderColor color; } PictGradientStop, *PictGradientStopPtr; typedef struct _PictGradient { unsigned int type; int nstops; PictGradientStopPtr stops; } PictGradient, *PictGradientPtr; typedef struct _PictLinearGradient { unsigned int type; int nstops; PictGradientStopPtr stops; xPointFixed p1; xPointFixed p2; } PictLinearGradient, *PictLinearGradientPtr; typedef struct _PictCircle { xFixed x; xFixed y; xFixed radius; } PictCircle, *PictCirclePtr; typedef struct _PictRadialGradient { unsigned int type; int nstops; PictGradientStopPtr stops; PictCircle c1; PictCircle c2; } PictRadialGradient, *PictRadialGradientPtr; typedef struct _PictConicalGradient { unsigned int type; int nstops; PictGradientStopPtr stops; xPointFixed center; xFixed angle; } PictConicalGradient, *PictConicalGradientPtr; typedef union _SourcePict { unsigned int type; PictSolidFill solidFill; PictGradient gradient; PictLinearGradient linear; PictRadialGradient radial; PictConicalGradient conical; } SourcePict, *SourcePictPtr; typedef struct _Picture { DrawablePtr pDrawable; PictFormatPtr pFormat; PictFormatShort format; /* PICT_FORMAT */ int refcnt; CARD32 id; unsigned int repeat:1; unsigned int graphicsExposures:1; unsigned int subWindowMode:1; unsigned int polyEdge:1; unsigned int polyMode:1; unsigned int freeCompClip:1; unsigned int componentAlpha:1; unsigned int repeatType:2; unsigned int filter:3; unsigned int stateChanges:CPLastBit; unsigned int unused:18 - CPLastBit; PicturePtr pNext; /* chain on same drawable */ PicturePtr alphaMap; DDXPointRec alphaOrigin; DDXPointRec clipOrigin; RegionPtr clientClip; unsigned long serialNumber; RegionPtr pCompositeClip; PrivateRec *devPrivates; PictTransform *transform; SourcePictPtr pSourcePict; xFixed *filter_params; int filter_nparams; } PictureRec; typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id, xFixed * params, int nparams, int *width, int *height); typedef struct { char *name; int id; PictFilterValidateParamsProcPtr ValidateParams; int width, height; } PictFilterRec, *PictFilterPtr; #define PictFilterNearest 0 #define PictFilterBilinear 1 #define PictFilterFast 2 #define PictFilterGood 3 #define PictFilterBest 4 #define PictFilterConvolution 5 /* if you add an 8th filter, expand the filter bitfield above */ typedef struct { char *alias; int alias_id; int filter_id; } PictFilterAliasRec, *PictFilterAliasPtr; typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, int clipType, void *value, int n); typedef void (*DestroyPictureClipProcPtr) (PicturePtr pPicture); typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture, PictTransform * transform); typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture, int filter, xFixed * params, int nparams); typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture); typedef void (*ChangePictureProcPtr) (PicturePtr pPicture, Mask mask); typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture, Mask mask); typedef void (*CompositeProcPtr) (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); typedef void (*GlyphsProcPtr) (CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlists, GlyphListPtr lists, GlyphPtr * glyphs); typedef void (*CompositeRectsProcPtr) (CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects); typedef void (*RasterizeTrapezoidProcPtr) (PicturePtr pMask, xTrapezoid * trap, int x_off, int y_off); typedef void (*TrapezoidsProcPtr) (CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps); typedef void (*TrianglesProcPtr) (CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris); typedef void (*TriStripProcPtr) (CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoint, xPointFixed * points); typedef void (*TriFanProcPtr) (CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoint, xPointFixed * points); typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat); typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat); typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat, int ndef, xColorItem * pdef); typedef void (*AddTrapsProcPtr) (PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntrap, xTrap * traps); typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntri, xTriangle * tris); typedef Bool (*RealizeGlyphProcPtr) (ScreenPtr pScreen, GlyphPtr glyph); typedef void (*UnrealizeGlyphProcPtr) (ScreenPtr pScreen, GlyphPtr glyph); typedef struct _PictureScreen { PictFormatPtr formats; PictFormatPtr fallback; int nformats; CreatePictureProcPtr CreatePicture; DestroyPictureProcPtr DestroyPicture; ChangePictureClipProcPtr ChangePictureClip; DestroyPictureClipProcPtr DestroyPictureClip; ChangePictureProcPtr ChangePicture; ValidatePictureProcPtr ValidatePicture; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; /* unused */ CompositeRectsProcPtr CompositeRects; DestroyWindowProcPtr DestroyWindow; CloseScreenProcPtr CloseScreen; StoreColorsProcPtr StoreColors; InitIndexedProcPtr InitIndexed; CloseIndexedProcPtr CloseIndexed; UpdateIndexedProcPtr UpdateIndexed; int subpixel; PictFilterPtr filters; int nfilters; PictFilterAliasPtr filterAliases; int nfilterAliases; /** * Called immediately after a picture's transform is changed through the * SetPictureTransform request. Not called for source-only pictures. */ ChangePictureTransformProcPtr ChangePictureTransform; /** * Called immediately after a picture's transform is changed through the * SetPictureFilter request. Not called for source-only pictures. */ ChangePictureFilterProcPtr ChangePictureFilter; DestroyPictureFilterProcPtr DestroyPictureFilter; TrapezoidsProcPtr Trapezoids; TrianglesProcPtr Triangles; RasterizeTrapezoidProcPtr RasterizeTrapezoid; AddTrianglesProcPtr AddTriangles; AddTrapsProcPtr AddTraps; RealizeGlyphProcPtr RealizeGlyph; UnrealizeGlyphProcPtr UnrealizeGlyph; #define PICTURE_SCREEN_VERSION 2 TriStripProcPtr TriStrip; TriFanProcPtr TriFan; } PictureScreenRec, *PictureScreenPtr; extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec; #define PictureScreenPrivateKey (&PictureScreenPrivateKeyRec) extern _X_EXPORT DevPrivateKeyRec PictureWindowPrivateKeyRec; #define PictureWindowPrivateKey (&PictureWindowPrivateKeyRec) extern _X_EXPORT RESTYPE PictureType; extern _X_EXPORT RESTYPE PictFormatType; extern _X_EXPORT RESTYPE GlyphSetType; #define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey)) #define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL) #define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, PictureScreenPrivateKey, p) #define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey)) #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p) #define VERIFY_PICTURE(pPicture, pid, client, mode) {\ int tmprc = dixLookupResourceByType((void *)&(pPicture), pid,\ PictureType, client, mode);\ if (tmprc != Success)\ return tmprc;\ } #define VERIFY_ALPHA(pPicture, pid, client, mode) {\ if (pid == None) \ pPicture = 0; \ else { \ VERIFY_PICTURE(pPicture, pid, client, mode); \ } \ } \ extern _X_EXPORT PictFormatPtr PictureWindowFormat(WindowPtr pWindow); extern _X_EXPORT Bool PictureDestroyWindow(WindowPtr pWindow); extern _X_EXPORT Bool PictureCloseScreen(ScreenPtr pScreen); extern _X_EXPORT void PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef); extern _X_EXPORT Bool PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format); extern _X_EXPORT Bool PictureSetSubpixelOrder(ScreenPtr pScreen, int subpixel); extern _X_EXPORT int PictureGetSubpixelOrder(ScreenPtr pScreen); extern _X_EXPORT PictFormatPtr PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp); extern _X_EXPORT PictFormatPtr PictureMatchVisual(ScreenPtr pScreen, int depth, VisualPtr pVisual); extern _X_EXPORT PictFormatPtr PictureMatchFormat(ScreenPtr pScreen, int depth, CARD32 format); extern _X_EXPORT Bool PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats); extern _X_EXPORT int PictureGetFilterId(const char *filter, int len, Bool makeit); extern _X_EXPORT char *PictureGetFilterName(int id); extern _X_EXPORT int PictureAddFilter(ScreenPtr pScreen, const char *filter, PictFilterValidateParamsProcPtr ValidateParams, int width, int height); extern _X_EXPORT Bool PictureSetFilterAlias(ScreenPtr pScreen, const char *filter, const char *alias); extern _X_EXPORT Bool PictureSetDefaultFilters(ScreenPtr pScreen); extern _X_EXPORT void PictureResetFilters(ScreenPtr pScreen); extern _X_EXPORT PictFilterPtr PictureFindFilter(ScreenPtr pScreen, char *name, int len); extern _X_EXPORT int SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter, xFixed * params, int nparams); extern _X_EXPORT int SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params, int nparams); extern _X_EXPORT Bool PictureFinishInit(void); extern _X_EXPORT void SetPictureToDefaults(PicturePtr pPicture); extern _X_EXPORT PicturePtr CreatePicture(Picture pid, DrawablePtr pDrawable, PictFormatPtr pFormat, Mask mask, XID *list, ClientPtr client, int *error); extern _X_EXPORT int ChangePicture(PicturePtr pPicture, Mask vmask, XID *vlist, DevUnion *ulist, ClientPtr client); extern _X_EXPORT int SetPictureClipRects(PicturePtr pPicture, int xOrigin, int yOrigin, int nRect, xRectangle *rects); extern _X_EXPORT int SetPictureClipRegion(PicturePtr pPicture, int xOrigin, int yOrigin, RegionPtr pRegion); extern _X_EXPORT int SetPictureTransform(PicturePtr pPicture, PictTransform * transform); extern _X_EXPORT void ValidatePicture(PicturePtr pPicture); extern _X_EXPORT int FreePicture(void *pPicture, XID pid); extern _X_EXPORT int FreePictFormat(void *pPictFormat, XID pid); extern _X_EXPORT void CompositePicture(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 CompositeGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr lists, GlyphPtr * glyphs); extern _X_EXPORT void CompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects); extern _X_EXPORT void CompositeTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps); extern _X_EXPORT void CompositeTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntriangles, xTriangle * triangles); extern _X_EXPORT void CompositeTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); extern _X_EXPORT void CompositeTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); Bool AnimCurInit(ScreenPtr pScreen); int AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid); extern _X_EXPORT void AddTraps(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntraps, xTrap * traps); extern _X_EXPORT PicturePtr CreateSolidPicture(Picture pid, xRenderColor * color, int *error); extern _X_EXPORT PicturePtr CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, int nStops, xFixed * stops, xRenderColor * colors, int *error); extern _X_EXPORT PicturePtr CreateRadialGradientPicture(Picture pid, xPointFixed * inner, xPointFixed * outer, xFixed innerRadius, xFixed outerRadius, int nStops, xFixed * stops, xRenderColor * colors, int *error); extern _X_EXPORT PicturePtr CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, int nStops, xFixed * stops, xRenderColor * colors, int *error); #ifdef PANORAMIX extern _X_EXPORT void PanoramiXRenderInit(void); extern _X_EXPORT void PanoramiXRenderReset(void); #endif /* * matrix.c */ extern _X_EXPORT void PictTransform_from_xRenderTransform(PictTransformPtr pict, xRenderTransform * render); extern _X_EXPORT void xRenderTransform_from_PictTransform(xRenderTransform * render, PictTransformPtr pict); extern _X_EXPORT Bool PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector); extern _X_EXPORT Bool PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector); #endif /* _PICTURESTR_H_ */ xorg-server-1.17.1/render/Makefile.in0000664000175100017510000006730312466505436014361 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = render DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) librender_la_LIBADD = am_librender_la_OBJECTS = animcur.lo filter.lo glyph.lo matrix.lo \ miindex.lo mipict.lo mirect.lo mitrap.lo mitri.lo picture.lo \ render.lo librender_la_OBJECTS = $(am_librender_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 = $(librender_la_SOURCES) DIST_SOURCES = $(librender_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = picture.h mipict.h glyphstr.h picturestr.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = librender.la AM_CFLAGS = $(DIX_CFLAGS) librender_la_SOURCES = \ animcur.c \ filter.c \ glyph.c \ matrix.c \ miindex.c \ mipict.c \ mirect.c \ mitrap.c \ mitri.c \ picture.c \ render.c @XORG_TRUE@sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 render/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign render/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } librender.la: $(librender_la_OBJECTS) $(librender_la_DEPENDENCIES) $(EXTRA_librender_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(librender_la_OBJECTS) $(librender_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animcur.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glyph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miindex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mitrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mitri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/picture.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/render/glyph.c0000664000175100017510000004555512456571574013615 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "xsha1.h" #include "misc.h" #include "scrnintstr.h" #include "os.h" #include "regionstr.h" #include "validate.h" #include "windowstr.h" #include "input.h" #include "resource.h" #include "colormapst.h" #include "cursorstr.h" #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" #include "picturestr.h" #include "glyphstr.h" #include "mipict.h" /* * From Knuth -- a good choice for hash/rehash values is p, p-2 where * p and p-2 are both prime. These tables are sized to have an extra 10% * free to avoid exponential performance degradation as the hash table fills */ static GlyphHashSetRec glyphHashSets[] = { {32, 43, 41}, {64, 73, 71}, {128, 151, 149}, {256, 283, 281}, {512, 571, 569}, {1024, 1153, 1151}, {2048, 2269, 2267}, {4096, 4519, 4517}, {8192, 9013, 9011}, {16384, 18043, 18041}, {32768, 36109, 36107}, {65536, 72091, 72089}, {131072, 144409, 144407}, {262144, 288361, 288359}, {524288, 576883, 576881}, {1048576, 1153459, 1153457}, {2097152, 2307163, 2307161}, {4194304, 4613893, 4613891}, {8388608, 9227641, 9227639}, {16777216, 18455029, 18455027}, {33554432, 36911011, 36911009}, {67108864, 73819861, 73819859}, {134217728, 147639589, 147639587}, {268435456, 295279081, 295279079}, {536870912, 590559793, 590559791} }; #define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0])) static GlyphHashRec globalGlyphs[GlyphFormatNum]; void GlyphUninit(ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); GlyphPtr glyph; int fdepth, i; for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++) { if (!globalGlyphs[fdepth].hashSet) continue; for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++) { glyph = globalGlyphs[fdepth].table[i].glyph; if (glyph && glyph != DeletedGlyph) { if (GetGlyphPicture(glyph, pScreen)) { FreePicture((void *) GetGlyphPicture(glyph, pScreen), 0); SetGlyphPicture(glyph, pScreen, NULL); } (*ps->UnrealizeGlyph) (pScreen, glyph); } } } } GlyphHashSetPtr FindGlyphHashSet(CARD32 filled) { int i; for (i = 0; i < NGLYPHHASHSETS; i++) if (glyphHashSets[i].entries >= filled) return &glyphHashSets[i]; return 0; } GlyphRefPtr FindGlyphRef(GlyphHashPtr hash, CARD32 signature, Bool match, unsigned char sha1[20]) { CARD32 elt, step, s; GlyphPtr glyph; GlyphRefPtr table, gr, del; CARD32 tableSize = hash->hashSet->size; table = hash->table; elt = signature % tableSize; step = 0; del = 0; for (;;) { gr = &table[elt]; s = gr->signature; glyph = gr->glyph; if (!glyph) { if (del) gr = del; break; } if (glyph == DeletedGlyph) { if (!del) del = gr; else if (gr == del) break; } else if (s == signature && (!match || memcmp(glyph->sha1, sha1, 20) == 0)) { break; } if (!step) { step = signature % hash->hashSet->rehash; if (!step) step = 1; } elt += step; if (elt >= tableSize) elt -= tableSize; } return gr; } int HashGlyph(xGlyphInfo * gi, CARD8 *bits, unsigned long size, unsigned char sha1[20]) { void *ctx = x_sha1_init(); int success; if (!ctx) return BadAlloc; success = x_sha1_update(ctx, gi, sizeof(xGlyphInfo)); if (!success) return BadAlloc; success = x_sha1_update(ctx, bits, size); if (!success) return BadAlloc; success = x_sha1_final(ctx, sha1); if (!success) return BadAlloc; return Success; } GlyphPtr FindGlyphByHash(unsigned char sha1[20], int format) { GlyphRefPtr gr; CARD32 signature = *(CARD32 *) sha1; if (!globalGlyphs[format].hashSet) return NULL; gr = FindGlyphRef(&globalGlyphs[format], signature, TRUE, sha1); if (gr->glyph && gr->glyph != DeletedGlyph) return gr->glyph; else return NULL; } #ifdef CHECK_DUPLICATES void DuplicateRef(GlyphPtr glyph, char *where) { ErrorF("Duplicate Glyph 0x%x from %s\n", glyph, where); } void CheckDuplicates(GlyphHashPtr hash, char *where) { GlyphPtr g; int i, j; for (i = 0; i < hash->hashSet->size; i++) { g = hash->table[i].glyph; if (!g || g == DeletedGlyph) continue; for (j = i + 1; j < hash->hashSet->size; j++) if (hash->table[j].glyph == g) DuplicateRef(g, where); } } #else #define CheckDuplicates(a,b) #define DuplicateRef(a,b) #endif static void FreeGlyphPicture(GlyphPtr glyph) { PictureScreenPtr ps; int i; for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; if (GetGlyphPicture(glyph, pScreen)) FreePicture((void *) GetGlyphPicture(glyph, pScreen), 0); ps = GetPictureScreenIfSet(pScreen); if (ps) (*ps->UnrealizeGlyph) (pScreen, glyph); } } void FreeGlyph(GlyphPtr glyph, int format) { CheckDuplicates(&globalGlyphs[format], "FreeGlyph"); if (--glyph->refcnt == 0) { GlyphRefPtr gr; int i; int first; CARD32 signature; first = -1; for (i = 0; i < globalGlyphs[format].hashSet->size; i++) if (globalGlyphs[format].table[i].glyph == glyph) { if (first != -1) DuplicateRef(glyph, "FreeGlyph check"); first = i; } signature = *(CARD32 *) glyph->sha1; gr = FindGlyphRef(&globalGlyphs[format], signature, TRUE, glyph->sha1); if (gr - globalGlyphs[format].table != first) DuplicateRef(glyph, "Found wrong one"); if (gr->glyph && gr->glyph != DeletedGlyph) { gr->glyph = DeletedGlyph; gr->signature = 0; globalGlyphs[format].tableEntries--; } FreeGlyphPicture(glyph); dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH); } } void AddGlyph(GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) { GlyphRefPtr gr; CARD32 signature; CheckDuplicates(&globalGlyphs[glyphSet->fdepth], "AddGlyph top global"); /* Locate existing matching glyph */ signature = *(CARD32 *) glyph->sha1; gr = FindGlyphRef(&globalGlyphs[glyphSet->fdepth], signature, TRUE, glyph->sha1); if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph) { FreeGlyphPicture(glyph); dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH); glyph = gr->glyph; } else if (gr->glyph != glyph) { gr->glyph = glyph; gr->signature = signature; globalGlyphs[glyphSet->fdepth].tableEntries++; } /* Insert/replace glyphset value */ gr = FindGlyphRef(&glyphSet->hash, id, FALSE, 0); ++glyph->refcnt; if (gr->glyph && gr->glyph != DeletedGlyph) FreeGlyph(gr->glyph, glyphSet->fdepth); else glyphSet->hash.tableEntries++; gr->glyph = glyph; gr->signature = id; CheckDuplicates(&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); } Bool DeleteGlyph(GlyphSetPtr glyphSet, Glyph id) { GlyphRefPtr gr; GlyphPtr glyph; gr = FindGlyphRef(&glyphSet->hash, id, FALSE, 0); glyph = gr->glyph; if (glyph && glyph != DeletedGlyph) { gr->glyph = DeletedGlyph; glyphSet->hash.tableEntries--; FreeGlyph(glyph, glyphSet->fdepth); return TRUE; } return FALSE; } GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id) { GlyphPtr glyph; glyph = FindGlyphRef(&glyphSet->hash, id, FALSE, 0)->glyph; if (glyph == DeletedGlyph) glyph = 0; return glyph; } GlyphPtr AllocateGlyph(xGlyphInfo * gi, int fdepth) { PictureScreenPtr ps; int size; GlyphPtr glyph; int i; int head_size; head_size = sizeof(GlyphRec) + screenInfo.numScreens * sizeof(PicturePtr); size = (head_size + dixPrivatesSize(PRIVATE_GLYPH)); glyph = (GlyphPtr) malloc(size); if (!glyph) return 0; glyph->refcnt = 0; glyph->size = size + sizeof(xGlyphInfo); glyph->info = *gi; dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH); for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; SetGlyphPicture(glyph, pScreen, NULL); ps = GetPictureScreenIfSet(pScreen); if (ps) { if (!(*ps->RealizeGlyph) (pScreen, glyph)) goto bail; } } return glyph; bail: while (i--) { ps = GetPictureScreenIfSet(screenInfo.screens[i]); if (ps) (*ps->UnrealizeGlyph) (screenInfo.screens[i], glyph); } dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH); return 0; } Bool AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet) { hash->table = calloc(hashSet->size, sizeof(GlyphRefRec)); if (!hash->table) return FALSE; hash->hashSet = hashSet; hash->tableEntries = 0; return TRUE; } Bool ResizeGlyphHash(GlyphHashPtr hash, CARD32 change, Bool global) { CARD32 tableEntries; GlyphHashSetPtr hashSet; GlyphHashRec newHash; GlyphRefPtr gr; GlyphPtr glyph; int i; int oldSize; CARD32 s; tableEntries = hash->tableEntries + change; hashSet = FindGlyphHashSet(tableEntries); if (hashSet == hash->hashSet) return TRUE; if (global) CheckDuplicates(hash, "ResizeGlyphHash top"); if (!AllocateGlyphHash(&newHash, hashSet)) return FALSE; if (hash->table) { oldSize = hash->hashSet->size; for (i = 0; i < oldSize; i++) { glyph = hash->table[i].glyph; if (glyph && glyph != DeletedGlyph) { s = hash->table[i].signature; gr = FindGlyphRef(&newHash, s, global, glyph->sha1); gr->signature = s; gr->glyph = glyph; ++newHash.tableEntries; } } free(hash->table); } *hash = newHash; if (global) CheckDuplicates(hash, "ResizeGlyphHash bottom"); return TRUE; } Bool ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change) { return (ResizeGlyphHash(&glyphSet->hash, change, FALSE) && ResizeGlyphHash(&globalGlyphs[glyphSet->fdepth], change, TRUE)); } GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format) { GlyphSetPtr glyphSet; if (!globalGlyphs[fdepth].hashSet) { if (!AllocateGlyphHash(&globalGlyphs[fdepth], &glyphHashSets[0])) return FALSE; } glyphSet = dixAllocateObjectWithPrivates(GlyphSetRec, PRIVATE_GLYPHSET); if (!glyphSet) return FALSE; if (!AllocateGlyphHash(&glyphSet->hash, &glyphHashSets[0])) { free(glyphSet); return FALSE; } glyphSet->refcnt = 1; glyphSet->fdepth = fdepth; glyphSet->format = format; return glyphSet; } int FreeGlyphSet(void *value, XID gid) { GlyphSetPtr glyphSet = (GlyphSetPtr) value; if (--glyphSet->refcnt == 0) { CARD32 i, tableSize = glyphSet->hash.hashSet->size; GlyphRefPtr table = glyphSet->hash.table; GlyphPtr glyph; for (i = 0; i < tableSize; i++) { glyph = table[i].glyph; if (glyph && glyph != DeletedGlyph) FreeGlyph(glyph, glyphSet->fdepth); } if (!globalGlyphs[glyphSet->fdepth].tableEntries) { free(globalGlyphs[glyphSet->fdepth].table); globalGlyphs[glyphSet->fdepth].table = 0; globalGlyphs[glyphSet->fdepth].hashSet = 0; } else ResizeGlyphHash(&globalGlyphs[glyphSet->fdepth], 0, TRUE); free(table); dixFreeObjectWithPrivates(glyphSet, PRIVATE_GLYPHSET); } return Success; } static void GlyphExtents(int nlist, GlyphListPtr list, GlyphPtr * glyphs, BoxPtr extents) { int x1, x2, y1, y2; int n; GlyphPtr glyph; int x, y; x = 0; y = 0; extents->x1 = MAXSHORT; extents->x2 = MINSHORT; extents->y1 = MAXSHORT; extents->y2 = MINSHORT; while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; list++; while (n--) { glyph = *glyphs++; x1 = x - glyph->info.x; if (x1 < MINSHORT) x1 = MINSHORT; y1 = y - glyph->info.y; if (y1 < MINSHORT) y1 = MINSHORT; x2 = x1 + glyph->info.width; if (x2 > MAXSHORT) x2 = MAXSHORT; y2 = y1 + glyph->info.height; if (y2 > MAXSHORT) y2 = MAXSHORT; if (x1 < extents->x1) extents->x1 = x1; if (x2 > extents->x2) extents->x2 = x2; if (y1 < extents->y1) extents->y1 = y1; if (y2 > extents->y2) extents->y2 = y2; x += glyph->info.xOff; y += glyph->info.yOff; } } } #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) void CompositeGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr lists, GlyphPtr * glyphs) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); ValidatePicture(pSrc); ValidatePicture(pDst); (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs); } Bool miRealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph) { return TRUE; } void miUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph) { } void miGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) { PicturePtr pPicture; PixmapPtr pMaskPixmap = 0; PicturePtr pMask; ScreenPtr pScreen = pDst->pDrawable->pScreen; int width = 0, height = 0; int x, y; int xDst = list->xOff, yDst = list->yOff; int n; GlyphPtr glyph; int error; BoxRec extents = { 0, 0, 0, 0 }; CARD32 component_alpha; if (maskFormat) { GCPtr pGC; xRectangle rect; GlyphExtents(nlist, list, glyphs, &extents); if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) return; width = extents.x2 - extents.x1; height = extents.y2 - extents.y1; pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth, CREATE_PIXMAP_USAGE_SCRATCH); if (!pMaskPixmap) return; component_alpha = NeedsComponent(maskFormat->format); pMask = CreatePicture(0, &pMaskPixmap->drawable, maskFormat, CPComponentAlpha, &component_alpha, serverClient, &error); if (!pMask) { (*pScreen->DestroyPixmap) (pMaskPixmap); return; } pGC = GetScratchGC(pMaskPixmap->drawable.depth, pScreen); ValidateGC(&pMaskPixmap->drawable, pGC); rect.x = 0; rect.y = 0; rect.width = width; rect.height = height; (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); FreeScratchGC(pGC); x = -extents.x1; y = -extents.y1; } else { pMask = pDst; x = 0; y = 0; } while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; while (n--) { glyph = *glyphs++; pPicture = GetGlyphPicture(glyph, pScreen); if (pPicture) { if (maskFormat) { CompositePicture(PictOpAdd, pPicture, None, pMask, 0, 0, 0, 0, x - glyph->info.x, y - glyph->info.y, glyph->info.width, glyph->info.height); } else { CompositePicture(op, pSrc, pPicture, pDst, xSrc + (x - glyph->info.x) - xDst, ySrc + (y - glyph->info.y) - yDst, 0, 0, x - glyph->info.x, y - glyph->info.y, glyph->info.width, glyph->info.height); } } x += glyph->info.xOff; y += glyph->info.yOff; } list++; } if (maskFormat) { x = extents.x1; y = extents.y1; CompositePicture(op, pSrc, pMask, pDst, xSrc + x - xDst, ySrc + y - yDst, 0, 0, x, y, width, height); FreePicture((void *) pMask, (XID) 0); (*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; } xorg-server-1.17.1/render/animcur.c0000664000175100017510000003060212456571574014113 00000000000000/* * * Copyright © 2002 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. */ /* * Animated cursors for X. Not specific to Render in any way, but * stuck there because Render has the other cool cursor extension. * Besides, everyone has Render. * * Implemented as a simple layer over the core cursor code; it * creates composite cursors out of a set of static cursors and * delta times between each image. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "servermd.h" #include "scrnintstr.h" #include "dixstruct.h" #include "cursorstr.h" #include "dixfontstr.h" #include "opaque.h" #include "picturestr.h" #include "inputstr.h" #include "xace.h" typedef struct _AnimCurElt { CursorPtr pCursor; /* cursor to show */ CARD32 delay; /* in ms */ } AnimCurElt; typedef struct _AnimCur { int nelt; /* number of elements in the elts array */ AnimCurElt *elts; /* actually allocated right after the structure */ } AnimCurRec, *AnimCurPtr; typedef struct _AnimScrPriv { CloseScreenProcPtr CloseScreen; ScreenBlockHandlerProcPtr BlockHandler; CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; SetCursorPositionProcPtr SetCursorPosition; RealizeCursorProcPtr RealizeCursor; UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; } AnimCurScreenRec, *AnimCurScreenPtr; static unsigned char empty[4]; static CursorBits animCursorBits = { empty, empty, 2, 1, 1, 0, 0, 1 }; static DevPrivateKeyRec AnimCurScreenPrivateKeyRec; #define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec) #define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits)) #define GetAnimCur(c) ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE)))) #define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey)) #define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) static Bool AnimCurCloseScreen(ScreenPtr pScreen) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; Unwrap(as, pScreen, CloseScreen); Unwrap(as, pScreen, CursorLimits); Unwrap(as, pScreen, DisplayCursor); Unwrap(as, pScreen, SetCursorPosition); Unwrap(as, pScreen, RealizeCursor); Unwrap(as, pScreen, UnrealizeCursor); Unwrap(as, pScreen, RecolorCursor); SetAnimCurScreen(pScreen, 0); ret = (*pScreen->CloseScreen) (pScreen); free(as); return ret; } static void AnimCurCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, BoxPtr pTopLeftBox) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Unwrap(as, pScreen, CursorLimits); if (IsAnimCur(pCursor)) { AnimCurPtr ac = GetAnimCur(pCursor); (*pScreen->CursorLimits) (pDev, pScreen, ac->elts[0].pCursor, pHotBox, pTopLeftBox); } else { (*pScreen->CursorLimits) (pDev, pScreen, pCursor, pHotBox, pTopLeftBox); } Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits); } /* * This has to be a screen block handler instead of a generic * block handler so that it is well ordered with respect to the DRI * block handler responsible for releasing the hardware to DRI clients */ static void AnimCurScreenBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { 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) { now = GetTimeInMillis(); activeDevice = TRUE; } if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) { AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt; DisplayCursorProcPtr DisplayCursor; /* * Not a simple Unwrap/Wrap as this * isn't called along the DisplayCursor * wrapper chain. */ DisplayCursor = pScreen->DisplayCursor; pScreen->DisplayCursor = as->DisplayCursor; (void) (*pScreen->DisplayCursor) (dev, pScreen, ac->elts[elt].pCursor); as->DisplayCursor = pScreen->DisplayCursor; pScreen->DisplayCursor = DisplayCursor; dev->spriteInfo->anim.elt = elt; dev->spriteInfo->anim.time = now + ac->elts[elt].delay; } if (soonest > dev->spriteInfo->anim.time) soonest = dev->spriteInfo->anim.time; } } if (activeDevice) AdjustWaitForDelay(pTimeout, soonest - now); (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (activeDevice) Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); else as->BlockHandler = NULL; } static Bool AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; if (IsFloating(pDev)) return FALSE; Unwrap(as, pScreen, DisplayCursor); if (IsAnimCur(pCursor)) { if (pCursor != pDev->spriteInfo->anim.pCursor) { AnimCurPtr ac = GetAnimCur(pCursor); ret = (*pScreen->DisplayCursor) (pDev, pScreen, ac->elts[0].pCursor); if (ret) { pDev->spriteInfo->anim.elt = 0; pDev->spriteInfo->anim.time = GetTimeInMillis() + ac->elts[0].delay; pDev->spriteInfo->anim.pCursor = pCursor; pDev->spriteInfo->anim.pScreen = pScreen; if (!as->BlockHandler) Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); } } else ret = TRUE; } else { pDev->spriteInfo->anim.pCursor = 0; pDev->spriteInfo->anim.pScreen = 0; ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); } Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor); return ret; } static Bool AnimCurSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; Unwrap(as, pScreen, SetCursorPosition); if (pDev->spriteInfo->anim.pCursor) { pDev->spriteInfo->anim.pScreen = pScreen; if (!as->BlockHandler) Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); } ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); return ret; } static Bool AnimCurRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; Unwrap(as, pScreen, RealizeCursor); if (IsAnimCur(pCursor)) ret = TRUE; else ret = (*pScreen->RealizeCursor) (pDev, pScreen, pCursor); Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor); return ret; } static Bool AnimCurUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; Unwrap(as, pScreen, UnrealizeCursor); if (IsAnimCur(pCursor)) { AnimCurPtr ac = GetAnimCur(pCursor); int i; if (pScreen->myNum == 0) for (i = 0; i < ac->nelt; i++) FreeCursor(ac->elts[i].pCursor, 0); ret = TRUE; } else ret = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor); Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor); return ret; } static void AnimCurRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, Bool displayed) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Unwrap(as, pScreen, RecolorCursor); if (IsAnimCur(pCursor)) { AnimCurPtr ac = GetAnimCur(pCursor); int i; for (i = 0; i < ac->nelt; i++) (*pScreen->RecolorCursor) (pDev, pScreen, ac->elts[i].pCursor, displayed && pDev->spriteInfo->anim.elt == i); } else (*pScreen->RecolorCursor) (pDev, pScreen, pCursor, displayed); Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor); } Bool AnimCurInit(ScreenPtr pScreen) { AnimCurScreenPtr as; if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec)); if (!as) return FALSE; Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); as->BlockHandler = NULL; Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits); Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor); Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor); Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor); Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor); SetAnimCurScreen(pScreen, as); return TRUE; } int AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid) { CursorPtr pCursor; int rc, i; AnimCurPtr ac; for (i = 0; i < screenInfo.numScreens; i++) if (!GetAnimCurScreen(screenInfo.screens[i])) return BadImplementation; for (i = 0; i < ncursor; i++) if (IsAnimCur(cursors[i])) return BadMatch; pCursor = (CursorPtr) calloc(CURSOR_REC_SIZE + sizeof(AnimCurRec) + ncursor * sizeof(AnimCurElt), 1); if (!pCursor) return BadAlloc; dixInitPrivates(pCursor, pCursor + 1, PRIVATE_CURSOR); pCursor->bits = &animCursorBits; pCursor->refcnt = 1; pCursor->foreRed = cursors[0]->foreRed; pCursor->foreGreen = cursors[0]->foreGreen; pCursor->foreBlue = cursors[0]->foreBlue; pCursor->backRed = cursors[0]->backRed; pCursor->backGreen = cursors[0]->backGreen; pCursor->backBlue = cursors[0]->backBlue; pCursor->id = cid; /* security creation/labeling check */ rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor, RT_NONE, NULL, DixCreateAccess); if (rc != Success) { dixFiniPrivates(pCursor, PRIVATE_CURSOR); free(pCursor); return rc; } /* * Fill in the AnimCurRec */ animCursorBits.refcnt++; ac = GetAnimCur(pCursor); ac->nelt = ncursor; ac->elts = (AnimCurElt *) (ac + 1); for (i = 0; i < ncursor; i++) { ac->elts[i].pCursor = RefCursor(cursors[i]); ac->elts[i].delay = deltas[i]; } *ppCursor = pCursor; return Success; } xorg-server-1.17.1/render/filter.c0000664000175100017510000002345612274325512013736 00000000000000/* * 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 "misc.h" #include "scrnintstr.h" #include "os.h" #include "regionstr.h" #include "validate.h" #include "windowstr.h" #include "input.h" #include "resource.h" #include "colormapst.h" #include "cursorstr.h" #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" #include "picturestr.h" static char **filterNames; static int nfilterNames; /* * standard but not required filters don't have constant indices */ int PictureGetFilterId(const char *filter, int len, Bool makeit) { int i; char *name; char **names; if (len < 0) len = strlen(filter); for (i = 0; i < nfilterNames; i++) if (!CompareISOLatin1Lowered((const unsigned char *) filterNames[i], -1, (const unsigned char *) filter, len)) return i; if (!makeit) return -1; name = malloc(len + 1); if (!name) return -1; memcpy(name, filter, len); name[len] = '\0'; if (filterNames) names = realloc(filterNames, (nfilterNames + 1) * sizeof(char *)); else names = malloc(sizeof(char *)); if (!names) { free(name); return -1; } filterNames = names; i = nfilterNames++; filterNames[i] = name; return i; } static Bool PictureSetDefaultIds(void) { /* careful here -- this list must match the #define values */ if (PictureGetFilterId(FilterNearest, -1, TRUE) != PictFilterNearest) return FALSE; if (PictureGetFilterId(FilterBilinear, -1, TRUE) != PictFilterBilinear) return FALSE; if (PictureGetFilterId(FilterFast, -1, TRUE) != PictFilterFast) return FALSE; if (PictureGetFilterId(FilterGood, -1, TRUE) != PictFilterGood) return FALSE; if (PictureGetFilterId(FilterBest, -1, TRUE) != PictFilterBest) return FALSE; if (PictureGetFilterId(FilterConvolution, -1, TRUE) != PictFilterConvolution) return FALSE; return TRUE; } char * PictureGetFilterName(int id) { if (0 <= id && id < nfilterNames) return filterNames[id]; else return 0; } static void PictureFreeFilterIds(void) { int i; for (i = 0; i < nfilterNames; i++) free(filterNames[i]); free(filterNames); nfilterNames = 0; filterNames = 0; } int PictureAddFilter(ScreenPtr pScreen, const char *filter, PictFilterValidateParamsProcPtr ValidateParams, int width, int height) { PictureScreenPtr ps = GetPictureScreen(pScreen); int id = PictureGetFilterId(filter, -1, TRUE); int i; PictFilterPtr filters; if (id < 0) return -1; /* * It's an error to attempt to reregister a filter */ for (i = 0; i < ps->nfilters; i++) if (ps->filters[i].id == id) return -1; if (ps->filters) filters = realloc(ps->filters, (ps->nfilters + 1) * sizeof(PictFilterRec)); else filters = malloc(sizeof(PictFilterRec)); if (!filters) return -1; ps->filters = filters; i = ps->nfilters++; ps->filters[i].name = PictureGetFilterName(id); ps->filters[i].id = id; ps->filters[i].ValidateParams = ValidateParams; ps->filters[i].width = width; ps->filters[i].height = height; return id; } Bool PictureSetFilterAlias(ScreenPtr pScreen, const char *filter, const char *alias) { PictureScreenPtr ps = GetPictureScreen(pScreen); int filter_id = PictureGetFilterId(filter, -1, FALSE); int alias_id = PictureGetFilterId(alias, -1, TRUE); int i; if (filter_id < 0 || alias_id < 0) return FALSE; for (i = 0; i < ps->nfilterAliases; i++) if (ps->filterAliases[i].alias_id == alias_id) break; if (i == ps->nfilterAliases) { PictFilterAliasPtr aliases; if (ps->filterAliases) aliases = realloc(ps->filterAliases, (ps->nfilterAliases + 1) * sizeof(PictFilterAliasRec)); else aliases = malloc(sizeof(PictFilterAliasRec)); if (!aliases) return FALSE; ps->filterAliases = aliases; ps->filterAliases[i].alias = PictureGetFilterName(alias_id); ps->filterAliases[i].alias_id = alias_id; ps->nfilterAliases++; } ps->filterAliases[i].filter_id = filter_id; return TRUE; } PictFilterPtr PictureFindFilter(ScreenPtr pScreen, char *name, int len) { PictureScreenPtr ps = GetPictureScreen(pScreen); int id = PictureGetFilterId(name, len, FALSE); int i; if (id < 0) return 0; /* Check for an alias, allow them to recurse */ for (i = 0; i < ps->nfilterAliases; i++) if (ps->filterAliases[i].alias_id == id) { id = ps->filterAliases[i].filter_id; i = 0; } /* find the filter */ for (i = 0; i < ps->nfilters; i++) if (ps->filters[i].id == id) return &ps->filters[i]; return 0; } static Bool convolutionFilterValidateParams(ScreenPtr pScreen, int filter, xFixed * params, int nparams, int *width, int *height) { int w, h; if (nparams < 3) return FALSE; if (xFixedFrac(params[0]) || xFixedFrac(params[1])) return FALSE; w = xFixedToInt(params[0]); h = xFixedToInt(params[1]); nparams -= 2; if (w * h > nparams) return FALSE; *width = w; *height = h; return TRUE; } Bool PictureSetDefaultFilters(ScreenPtr pScreen) { if (!filterNames) if (!PictureSetDefaultIds()) return FALSE; if (PictureAddFilter(pScreen, FilterNearest, 0, 1, 1) < 0) return FALSE; if (PictureAddFilter(pScreen, FilterBilinear, 0, 2, 2) < 0) return FALSE; if (!PictureSetFilterAlias(pScreen, FilterNearest, FilterFast)) return FALSE; if (!PictureSetFilterAlias(pScreen, FilterBilinear, FilterGood)) return FALSE; if (!PictureSetFilterAlias(pScreen, FilterBilinear, FilterBest)) return FALSE; if (PictureAddFilter (pScreen, FilterConvolution, convolutionFilterValidateParams, 0, 0) < 0) return FALSE; return TRUE; } void PictureResetFilters(ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); free(ps->filters); free(ps->filterAliases); /* Free the filters when the last screen is closed */ if (pScreen->myNum == 0) PictureFreeFilterIds(); } int SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params, int nparams) { PictFilterPtr pFilter; ScreenPtr pScreen; if (pPicture->pDrawable != NULL) pScreen = pPicture->pDrawable->pScreen; else pScreen = screenInfo.screens[0]; pFilter = PictureFindFilter(pScreen, name, len); if (!pFilter) return BadName; if (pPicture->pDrawable == NULL) { int s; /* For source pictures, the picture isn't tied to a screen. So, ensure * that all screens can handle a filter we set for the picture. */ for (s = 1; s < screenInfo.numScreens; s++) { PictFilterPtr pScreenFilter; pScreenFilter = PictureFindFilter(screenInfo.screens[s], name, len); if (!pScreenFilter || pScreenFilter->id != pFilter->id) return BadMatch; } } return SetPicturePictFilter(pPicture, pFilter, params, nparams); } int SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter, xFixed * params, int nparams) { ScreenPtr pScreen; int i; if (pPicture->pDrawable) pScreen = pPicture->pDrawable->pScreen; else pScreen = screenInfo.screens[0]; if (pFilter->ValidateParams) { int width, height; if (!(*pFilter->ValidateParams) (pScreen, pFilter->id, params, nparams, &width, &height)) return BadMatch; } else if (nparams) return BadMatch; if (nparams != pPicture->filter_nparams) { xFixed *new_params = malloc(nparams * sizeof(xFixed)); if (!new_params && nparams) return BadAlloc; free(pPicture->filter_params); pPicture->filter_params = new_params; pPicture->filter_nparams = nparams; } for (i = 0; i < nparams; i++) pPicture->filter_params[i] = params[i]; pPicture->filter = pFilter->id; if (pPicture->pDrawable) { PictureScreenPtr ps = GetPictureScreen(pScreen); int result; result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter, params, nparams); return result; } return Success; } xorg-server-1.17.1/render/miindex.c0000664000175100017510000002247312274325512014104 00000000000000/* * * Copyright © 2001 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_DIX_CONFIG_H #include #endif #ifndef _MIINDEX_H_ #define _MIINDEX_H_ #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "mi.h" #include "picturestr.h" #include "mipict.h" #include "colormapst.h" #define NUM_CUBE_LEVELS 4 #define NUM_GRAY_LEVELS 13 static Bool miBuildRenderColormap(ColormapPtr pColormap, Pixel * pixels, int *nump) { int r, g, b; unsigned short red, green, blue; Pixel pixel; Bool used[MI_MAX_INDEXED]; int needed; int policy; int cube, gray; int i, n; if (pColormap->mid != pColormap->pScreen->defColormap) { policy = PictureCmapPolicyAll; } else { int avail = pColormap->pVisual->ColormapEntries; policy = PictureCmapPolicy; if (policy == PictureCmapPolicyDefault) { if (avail >= 256 && (pColormap->pVisual->class | DynamicClass) == PseudoColor) policy = PictureCmapPolicyColor; else if (avail >= 64) policy = PictureCmapPolicyGray; else policy = PictureCmapPolicyMono; } } /* * Make sure enough cells are free for the chosen policy */ for (;;) { switch (policy) { case PictureCmapPolicyAll: needed = 0; break; case PictureCmapPolicyColor: needed = 71; break; case PictureCmapPolicyGray: needed = 11; break; case PictureCmapPolicyMono: default: needed = 0; break; } if (needed <= pColormap->freeRed) break; policy--; } /* * Compute size of cube and gray ramps */ cube = gray = 0; switch (policy) { case PictureCmapPolicyAll: /* * Allocate as big a cube as possible */ if ((pColormap->pVisual->class | DynamicClass) == PseudoColor) { for (cube = 1; cube * cube * cube < pColormap->pVisual->ColormapEntries; cube++); cube--; if (cube == 1) cube = 0; } else cube = 0; /* * Figure out how many gray levels to use so that they * line up neatly with the cube */ if (cube) { needed = pColormap->pVisual->ColormapEntries - (cube * cube * cube); /* levels to fill in with */ gray = needed / (cube - 1); /* total levels */ gray = (gray + 1) * (cube - 1) + 1; } else gray = pColormap->pVisual->ColormapEntries; break; case PictureCmapPolicyColor: cube = NUM_CUBE_LEVELS; /* fall through ... */ case PictureCmapPolicyGray: gray = NUM_GRAY_LEVELS; break; case PictureCmapPolicyMono: default: gray = 2; break; } memset(used, '\0', pColormap->pVisual->ColormapEntries * sizeof(Bool)); for (r = 0; r < cube; r++) for (g = 0; g < cube; g++) for (b = 0; b < cube; b++) { pixel = 0; red = (r * 65535 + (cube - 1) / 2) / (cube - 1); green = (g * 65535 + (cube - 1) / 2) / (cube - 1); blue = (b * 65535 + (cube - 1) / 2) / (cube - 1); if (AllocColor(pColormap, &red, &green, &blue, &pixel, 0) != Success) return FALSE; used[pixel] = TRUE; } for (g = 0; g < gray; g++) { pixel = 0; red = green = blue = (g * 65535 + (gray - 1) / 2) / (gray - 1); if (AllocColor(pColormap, &red, &green, &blue, &pixel, 0) != Success) return FALSE; used[pixel] = TRUE; } n = 0; for (i = 0; i < pColormap->pVisual->ColormapEntries; i++) if (used[i]) pixels[n++] = i; *nump = n; return TRUE; } /* 0 <= red, green, blue < 32 */ static Pixel FindBestColor(miIndexedPtr pIndexed, Pixel * pixels, int num, int red, int green, int blue) { Pixel best = pixels[0]; int bestDist = 1 << 30; int dist; int dr, dg, db; while (num--) { Pixel pixel = *pixels++; CARD32 v = pIndexed->rgba[pixel]; dr = ((v >> 19) & 0x1f); dg = ((v >> 11) & 0x1f); db = ((v >> 3) & 0x1f); dr = dr - red; dg = dg - green; db = db - blue; dist = dr * dr + dg * dg + db * db; if (dist < bestDist) { bestDist = dist; best = pixel; } } return best; } /* 0 <= gray < 32768 */ static Pixel FindBestGray(miIndexedPtr pIndexed, Pixel * pixels, int num, int gray) { Pixel best = pixels[0]; int bestDist = 1 << 30; int dist; int dr; int r; while (num--) { Pixel pixel = *pixels++; CARD32 v = pIndexed->rgba[pixel]; r = v & 0xff; r = r | (r << 8); dr = gray - (r >> 1); dist = dr * dr; if (dist < bestDist) { bestDist = dist; best = pixel; } } return best; } Bool miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat) { ColormapPtr pColormap = pFormat->index.pColormap; VisualPtr pVisual = pColormap->pVisual; miIndexedPtr pIndexed; Pixel pixels[MI_MAX_INDEXED]; xrgb rgb[MI_MAX_INDEXED]; int num; int i; Pixel p, r, g, b; if (pVisual->ColormapEntries > MI_MAX_INDEXED) return FALSE; if (pVisual->class & DynamicClass) { if (!miBuildRenderColormap(pColormap, pixels, &num)) return FALSE; } else { num = pVisual->ColormapEntries; for (p = 0; p < num; p++) pixels[p] = p; } pIndexed = malloc(sizeof(miIndexedRec)); if (!pIndexed) return FALSE; pFormat->index.nvalues = num; pFormat->index.pValues = malloc(num * sizeof(xIndexValue)); if (!pFormat->index.pValues) { free(pIndexed); return FALSE; } /* * Build mapping from pixel value to ARGB */ QueryColors(pColormap, num, pixels, rgb, serverClient); for (i = 0; i < num; i++) { p = pixels[i]; pFormat->index.pValues[i].pixel = p; pFormat->index.pValues[i].red = rgb[i].red; pFormat->index.pValues[i].green = rgb[i].green; pFormat->index.pValues[i].blue = rgb[i].blue; pFormat->index.pValues[i].alpha = 0xffff; pIndexed->rgba[p] = (0xff000000 | ((rgb[i].red & 0xff00) << 8) | ((rgb[i].green & 0xff00)) | ((rgb[i].blue & 0xff00) >> 8)); } /* * Build mapping from RGB to pixel value. This could probably be * done a bit quicker... */ switch (pVisual->class | DynamicClass) { case GrayScale: pIndexed->color = FALSE; for (r = 0; r < 32768; r++) pIndexed->ent[r] = FindBestGray(pIndexed, pixels, num, r); break; case PseudoColor: pIndexed->color = TRUE; p = 0; for (r = 0; r < 32; r++) for (g = 0; g < 32; g++) for (b = 0; b < 32; b++) { pIndexed->ent[p] = FindBestColor(pIndexed, pixels, num, r, g, b); p++; } break; } pFormat->index.devPrivate = pIndexed; return TRUE; } void miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat) { free(pFormat->index.devPrivate); pFormat->index.devPrivate = NULL; free(pFormat->index.pValues); pFormat->index.pValues = NULL; } void miUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat, int ndef, xColorItem * pdef) { miIndexedPtr pIndexed = pFormat->index.devPrivate; if (pIndexed) { while (ndef--) { pIndexed->rgba[pdef->pixel] = (0xff000000 | ((pdef->red & 0xff00) << 8) | ((pdef->green & 0xff00)) | ((pdef->blue & 0xff00) >> 8)); pdef++; } } } #endif /* _MIINDEX_H_ */ xorg-server-1.17.1/render/picture.c0000664000175100017510000013726312456571574014143 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "misc.h" #include "scrnintstr.h" #include "os.h" #include "regionstr.h" #include "validate.h" #include "windowstr.h" #include "input.h" #include "resource.h" #include "colormapst.h" #include "cursorstr.h" #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" #include "picturestr.h" #include "xace.h" #ifdef PANORAMIX #include "panoramiXsrv.h" #endif DevPrivateKeyRec PictureScreenPrivateKeyRec; DevPrivateKeyRec PictureWindowPrivateKeyRec; static int PictureGeneration; RESTYPE PictureType; 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) { ScreenPtr pScreen = pWindow->drawable.pScreen; PicturePtr pPicture; PictureScreenPtr ps = GetPictureScreen(pScreen); Bool ret; while ((pPicture = GetPictureWindow(pWindow))) { SetPictureWindow(pWindow, pPicture->pNext); if (pPicture->id) FreeResource(pPicture->id, PictureType); FreePicture((void *) pPicture, pPicture->id); } pScreen->DestroyWindow = ps->DestroyWindow; ret = (*pScreen->DestroyWindow) (pWindow); ps->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = PictureDestroyWindow; return ret; } Bool PictureCloseScreen(ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); Bool ret; int n; pScreen->CloseScreen = ps->CloseScreen; ret = (*pScreen->CloseScreen) (pScreen); PictureResetFilters(pScreen); for (n = 0; n < ps->nformats; n++) if (ps->formats[n].type == PictTypeIndexed) (*ps->CloseIndexed) (pScreen, &ps->formats[n]); GlyphUninit(pScreen); SetPictureScreen(pScreen, 0); free(ps->formats); free(ps); return ret; } void PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef) { ScreenPtr pScreen = pColormap->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); pScreen->StoreColors = ps->StoreColors; (*pScreen->StoreColors) (pColormap, ndef, pdef); ps->StoreColors = pScreen->StoreColors; pScreen->StoreColors = PictureStoreColors; if (pColormap->class == PseudoColor || pColormap->class == GrayScale) { PictFormatPtr format = ps->formats; int nformats = ps->nformats; while (nformats--) { if (format->type == PictTypeIndexed && format->index.pColormap == pColormap) { (*ps->UpdateIndexed) (pScreen, format, ndef, pdef); break; } format++; } } } static int visualDepth(ScreenPtr pScreen, VisualPtr pVisual) { int d, v; DepthPtr pDepth; for (d = 0; d < pScreen->numDepths; d++) { pDepth = &pScreen->allowedDepths[d]; for (v = 0; v < pDepth->numVids; v++) if (pDepth->vids[v] == pVisual->vid) return pDepth->depth; } return 0; } typedef struct _formatInit { CARD32 format; CARD8 depth; } FormatInitRec, *FormatInitPtr; static int addFormat(FormatInitRec formats[256], int nformat, CARD32 format, CARD8 depth) { int n; for (n = 0; n < nformat; n++) if (formats[n].format == format && formats[n].depth == depth) return nformat; formats[nformat].format = format; formats[nformat].depth = depth; return ++nformat; } #define Mask(n) ((1 << (n)) - 1) PictFormatPtr PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp) { int nformats, f; PictFormatPtr pFormats; FormatInitRec formats[1024]; CARD32 format; CARD8 depth; VisualPtr pVisual; int v; int bpp; int type; int r, g, b; int d; DepthPtr pDepth; nformats = 0; /* formats required by protocol */ formats[nformats].format = PICT_a1; formats[nformats].depth = 1; nformats++; formats[nformats].format = PICT_FORMAT(BitsPerPixel(8), PICT_TYPE_A, 8, 0, 0, 0); formats[nformats].depth = 8; nformats++; formats[nformats].format = PICT_FORMAT(BitsPerPixel(4), PICT_TYPE_A, 4, 0, 0, 0); formats[nformats].depth = 4; nformats++; formats[nformats].format = PICT_a8r8g8b8; formats[nformats].depth = 32; nformats++; formats[nformats].format = PICT_x8r8g8b8; formats[nformats].depth = 32; nformats++; formats[nformats].format = PICT_b8g8r8a8; formats[nformats].depth = 32; nformats++; formats[nformats].format = PICT_b8g8r8x8; formats[nformats].depth = 32; nformats++; /* now look through the depths and visuals adding other formats */ for (v = 0; v < pScreen->numVisuals; v++) { pVisual = &pScreen->visuals[v]; depth = visualDepth(pScreen, pVisual); if (!depth) continue; bpp = BitsPerPixel(depth); switch (pVisual->class) { case DirectColor: case TrueColor: r = Ones(pVisual->redMask); g = Ones(pVisual->greenMask); b = Ones(pVisual->blueMask); type = PICT_TYPE_OTHER; /* * Current rendering code supports only three direct formats, * fields must be packed together at the bottom of the pixel */ if (pVisual->offsetBlue == 0 && pVisual->offsetGreen == b && pVisual->offsetRed == b + g) { type = PICT_TYPE_ARGB; } else if (pVisual->offsetRed == 0 && pVisual->offsetGreen == r && pVisual->offsetBlue == r + g) { type = PICT_TYPE_ABGR; } else if (pVisual->offsetRed == pVisual->offsetGreen - r && pVisual->offsetGreen == pVisual->offsetBlue - g && pVisual->offsetBlue == bpp - b) { type = PICT_TYPE_BGRA; } if (type != PICT_TYPE_OTHER) { format = PICT_FORMAT(bpp, type, 0, r, g, b); nformats = addFormat(formats, nformats, format, depth); } break; case StaticColor: case PseudoColor: format = PICT_VISFORMAT(bpp, PICT_TYPE_COLOR, v); nformats = addFormat(formats, nformats, format, depth); break; case StaticGray: case GrayScale: format = PICT_VISFORMAT(bpp, PICT_TYPE_GRAY, v); nformats = addFormat(formats, nformats, format, depth); break; } } /* * Walk supported depths and add useful Direct formats */ for (d = 0; d < pScreen->numDepths; d++) { pDepth = &pScreen->allowedDepths[d]; bpp = BitsPerPixel(pDepth->depth); format = 0; switch (bpp) { case 16: /* depth 12 formats */ if (pDepth->depth >= 12) { nformats = addFormat(formats, nformats, PICT_x4r4g4b4, pDepth->depth); nformats = addFormat(formats, nformats, PICT_x4b4g4r4, pDepth->depth); } /* depth 15 formats */ if (pDepth->depth >= 15) { nformats = addFormat(formats, nformats, PICT_x1r5g5b5, pDepth->depth); nformats = addFormat(formats, nformats, PICT_x1b5g5r5, pDepth->depth); } /* depth 16 formats */ if (pDepth->depth >= 16) { nformats = addFormat(formats, nformats, PICT_a1r5g5b5, pDepth->depth); nformats = addFormat(formats, nformats, PICT_a1b5g5r5, pDepth->depth); nformats = addFormat(formats, nformats, PICT_r5g6b5, pDepth->depth); nformats = addFormat(formats, nformats, PICT_b5g6r5, pDepth->depth); nformats = addFormat(formats, nformats, PICT_a4r4g4b4, pDepth->depth); nformats = addFormat(formats, nformats, PICT_a4b4g4r4, pDepth->depth); } break; case 24: if (pDepth->depth >= 24) { nformats = addFormat(formats, nformats, PICT_r8g8b8, pDepth->depth); nformats = addFormat(formats, nformats, PICT_b8g8r8, pDepth->depth); } break; case 32: if (pDepth->depth >= 24) { nformats = addFormat(formats, nformats, PICT_x8r8g8b8, pDepth->depth); nformats = addFormat(formats, nformats, PICT_x8b8g8r8, pDepth->depth); } if (pDepth->depth >= 30) { nformats = addFormat(formats, nformats, PICT_a2r10g10b10, pDepth->depth); nformats = addFormat(formats, nformats, PICT_x2r10g10b10, pDepth->depth); nformats = addFormat(formats, nformats, PICT_a2b10g10r10, pDepth->depth); nformats = addFormat(formats, nformats, PICT_x2b10g10r10, pDepth->depth); } break; } } pFormats = calloc(nformats, sizeof(PictFormatRec)); if (!pFormats) return 0; for (f = 0; f < nformats; f++) { pFormats[f].id = FakeClientID(0); pFormats[f].depth = formats[f].depth; format = formats[f].format; pFormats[f].format = format; switch (PICT_FORMAT_TYPE(format)) { case PICT_TYPE_ARGB: pFormats[f].type = PictTypeDirect; pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); if (pFormats[f].direct.alphaMask) pFormats[f].direct.alpha = (PICT_FORMAT_R(format) + PICT_FORMAT_G(format) + PICT_FORMAT_B(format)); pFormats[f].direct.redMask = Mask (PICT_FORMAT_R(format)); pFormats[f].direct.red = (PICT_FORMAT_G(format) + PICT_FORMAT_B(format)); pFormats[f].direct.greenMask = Mask (PICT_FORMAT_G(format)); pFormats[f].direct.green = PICT_FORMAT_B(format); pFormats[f].direct.blueMask = Mask (PICT_FORMAT_B(format)); pFormats[f].direct.blue = 0; break; case PICT_TYPE_ABGR: pFormats[f].type = PictTypeDirect; pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); if (pFormats[f].direct.alphaMask) pFormats[f].direct.alpha = (PICT_FORMAT_B(format) + PICT_FORMAT_G(format) + PICT_FORMAT_R(format)); pFormats[f].direct.blueMask = Mask (PICT_FORMAT_B(format)); pFormats[f].direct.blue = (PICT_FORMAT_G(format) + PICT_FORMAT_R(format)); pFormats[f].direct.greenMask = Mask (PICT_FORMAT_G(format)); pFormats[f].direct.green = PICT_FORMAT_R(format); pFormats[f].direct.redMask = Mask (PICT_FORMAT_R(format)); pFormats[f].direct.red = 0; break; case PICT_TYPE_BGRA: pFormats[f].type = PictTypeDirect; pFormats[f].direct.blueMask = Mask (PICT_FORMAT_B(format)); pFormats[f].direct.blue = (PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format)); pFormats[f].direct.greenMask = Mask (PICT_FORMAT_G(format)); pFormats[f].direct.green = (PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format) - PICT_FORMAT_G(format)); pFormats[f].direct.redMask = Mask (PICT_FORMAT_R(format)); pFormats[f].direct.red = (PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format) - PICT_FORMAT_G(format) - PICT_FORMAT_R(format)); pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); pFormats[f].direct.alpha = 0; break; case PICT_TYPE_A: pFormats[f].type = PictTypeDirect; pFormats[f].direct.alpha = 0; pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); /* remaining fields already set to zero */ break; case PICT_TYPE_COLOR: case PICT_TYPE_GRAY: pFormats[f].type = PictTypeIndexed; pFormats[f].index.vid = pScreen->visuals[PICT_FORMAT_VIS(format)].vid; break; } } *nformatp = nformats; return pFormats; } static VisualPtr PictureFindVisual(ScreenPtr pScreen, VisualID visual) { int i; VisualPtr pVisual; for (i = 0, pVisual = pScreen->visuals; i < pScreen->numVisuals; i++, pVisual++) { if (pVisual->vid == visual) return pVisual; } return 0; } Bool PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format) { PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); if (format->type != PictTypeIndexed || format->index.pColormap) return TRUE; if (format->index.vid == pScreen->rootVisual) { dixLookupResourceByType((void **) &format->index.pColormap, pScreen->defColormap, RT_COLORMAP, serverClient, DixGetAttrAccess); } else { VisualPtr pVisual = PictureFindVisual(pScreen, format->index.vid); if (CreateColormap(FakeClientID(0), pScreen, pVisual, &format->index.pColormap, AllocNone, 0) != Success) return FALSE; } if (!ps->InitIndexed(pScreen, format)) return FALSE; return TRUE; } static Bool PictureInitIndexedFormats(ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); PictFormatPtr format; int nformat; if (!ps) return FALSE; format = ps->formats; nformat = ps->nformats; while (nformat--) if (!PictureInitIndexedFormat(pScreen, format++)) return FALSE; return TRUE; } Bool PictureFinishInit(void) { int s; for (s = 0; s < screenInfo.numScreens; s++) { if (!PictureInitIndexedFormats(screenInfo.screens[s])) return FALSE; (void) AnimCurInit(screenInfo.screens[s]); } return TRUE; } Bool PictureSetSubpixelOrder(ScreenPtr pScreen, int subpixel) { PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); if (!ps) return FALSE; ps->subpixel = subpixel; return TRUE; } int PictureGetSubpixelOrder(ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); if (!ps) return SubPixelUnknown; return ps->subpixel; } PictFormatPtr PictureMatchVisual(ScreenPtr pScreen, int depth, VisualPtr pVisual) { PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); PictFormatPtr format; int nformat; int type; if (!ps) return 0; format = ps->formats; nformat = ps->nformats; switch (pVisual->class) { case StaticGray: case GrayScale: case StaticColor: case PseudoColor: type = PictTypeIndexed; break; case TrueColor: case DirectColor: type = PictTypeDirect; break; default: return 0; } while (nformat--) { if (format->depth == depth && format->type == type) { if (type == PictTypeIndexed) { if (format->index.vid == pVisual->vid) return format; } else { if (format->direct.redMask << format->direct.red == pVisual->redMask && format->direct.greenMask << format->direct.green == pVisual->greenMask && format->direct.blueMask << format->direct.blue == pVisual->blueMask) { return format; } } } format++; } return 0; } PictFormatPtr PictureMatchFormat(ScreenPtr pScreen, int depth, CARD32 f) { PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); PictFormatPtr format; int nformat; if (!ps) return 0; format = ps->formats; nformat = ps->nformats; while (nformat--) { if (format->depth == depth && format->format == (f & 0xffffff)) return format; format++; } return 0; } int PictureParseCmapPolicy(const char *name) { if (strcmp(name, "default") == 0) return PictureCmapPolicyDefault; else if (strcmp(name, "mono") == 0) return PictureCmapPolicyMono; else if (strcmp(name, "gray") == 0) return PictureCmapPolicyGray; else if (strcmp(name, "color") == 0) return PictureCmapPolicyColor; else if (strcmp(name, "all") == 0) return PictureCmapPolicyAll; else return PictureCmapPolicyInvalid; } /** @see GetDefaultBytes */ static void GetPictureBytes(void *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) { PictureScreenPtr ps; int n; CARD32 type, a, r, g, b; if (PictureGeneration != serverGeneration) { PictureType = CreateNewResourceType(FreePicture, "PICTURE"); if (!PictureType) return FALSE; SetResourceTypeSizeFunc(PictureType, GetPictureBytes); PictFormatType = CreateNewResourceType(FreePictFormat, "PICTFORMAT"); if (!PictFormatType) return FALSE; GlyphSetType = CreateNewResourceType(FreeGlyphSet, "GLYPHSET"); if (!GlyphSetType) return FALSE; PictureGeneration = serverGeneration; } if (!dixRegisterPrivateKey(&PictureScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&PictureWindowPrivateKeyRec, PRIVATE_WINDOW, 0)) return FALSE; if (!formats) { formats = PictureCreateDefaultFormats(pScreen, &nformats); if (!formats) return FALSE; } for (n = 0; n < nformats; n++) { if (!AddResource (formats[n].id, PictFormatType, (void *) (formats + n))) { free(formats); return FALSE; } if (formats[n].type == PictTypeIndexed) { VisualPtr pVisual = PictureFindVisual(pScreen, formats[n].index.vid); if ((pVisual->class | DynamicClass) == PseudoColor) type = PICT_TYPE_COLOR; else type = PICT_TYPE_GRAY; a = r = g = b = 0; } else { if ((formats[n].direct.redMask | formats[n].direct.blueMask | formats[n].direct.greenMask) == 0) type = PICT_TYPE_A; else if (formats[n].direct.red > formats[n].direct.blue) type = PICT_TYPE_ARGB; else if (formats[n].direct.red == 0) type = PICT_TYPE_ABGR; else type = PICT_TYPE_BGRA; a = Ones(formats[n].direct.alphaMask); r = Ones(formats[n].direct.redMask); g = Ones(formats[n].direct.greenMask); b = Ones(formats[n].direct.blueMask); } formats[n].format = PICT_FORMAT(0, type, a, r, g, b); } ps = (PictureScreenPtr) malloc(sizeof(PictureScreenRec)); if (!ps) { free(formats); return FALSE; } SetPictureScreen(pScreen, ps); ps->formats = formats; ps->fallback = formats; ps->nformats = nformats; ps->filters = 0; ps->nfilters = 0; ps->filterAliases = 0; ps->nfilterAliases = 0; ps->subpixel = SubPixelUnknown; ps->CloseScreen = pScreen->CloseScreen; ps->DestroyWindow = pScreen->DestroyWindow; ps->StoreColors = pScreen->StoreColors; pScreen->DestroyWindow = PictureDestroyWindow; pScreen->CloseScreen = PictureCloseScreen; pScreen->StoreColors = PictureStoreColors; if (!PictureSetDefaultFilters(pScreen)) { PictureResetFilters(pScreen); SetPictureScreen(pScreen, 0); free(formats); free(ps); return FALSE; } return TRUE; } void SetPictureToDefaults(PicturePtr pPicture) { pPicture->refcnt = 1; pPicture->repeat = 0; pPicture->graphicsExposures = FALSE; pPicture->subWindowMode = ClipByChildren; pPicture->polyEdge = PolyEdgeSharp; pPicture->polyMode = PolyModePrecise; pPicture->freeCompClip = FALSE; pPicture->componentAlpha = FALSE; pPicture->repeatType = RepeatNone; pPicture->alphaMap = 0; pPicture->alphaOrigin.x = 0; pPicture->alphaOrigin.y = 0; pPicture->clipOrigin.x = 0; pPicture->clipOrigin.y = 0; pPicture->clientClip = 0; pPicture->transform = 0; pPicture->filter = PictureGetFilterId(FilterNearest, -1, TRUE); pPicture->filter_params = 0; pPicture->filter_nparams = 0; pPicture->serialNumber = GC_CHANGE_SERIAL_BIT; pPicture->stateChanges = -1; pPicture->pSourcePict = 0; } PicturePtr CreatePicture(Picture pid, DrawablePtr pDrawable, PictFormatPtr pFormat, Mask vmask, XID *vlist, ClientPtr client, int *error) { PicturePtr pPicture; PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen); pPicture = dixAllocateScreenObjectWithPrivates(pDrawable->pScreen, PictureRec, PRIVATE_PICTURE); if (!pPicture) { *error = BadAlloc; return 0; } pPicture->id = pid; pPicture->pDrawable = pDrawable; pPicture->pFormat = pFormat; pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24); /* security creation/labeling check */ *error = XaceHook(XACE_RESOURCE_ACCESS, client, pid, PictureType, pPicture, RT_PIXMAP, pDrawable, DixCreateAccess | DixSetAttrAccess); if (*error != Success) goto out; if (pDrawable->type == DRAWABLE_PIXMAP) { ++((PixmapPtr) pDrawable)->refcnt; pPicture->pNext = 0; } else { pPicture->pNext = GetPictureWindow(((WindowPtr) pDrawable)); SetPictureWindow(((WindowPtr) pDrawable), pPicture); } SetPictureToDefaults(pPicture); if (vmask) *error = ChangePicture(pPicture, vmask, vlist, 0, client); else *error = Success; if (*error == Success) *error = (*ps->CreatePicture) (pPicture); out: if (*error != Success) { FreePicture(pPicture, (XID) 0); pPicture = 0; } return pPicture; } static CARD32 xRenderColorToCard32(xRenderColor c) { return (c.alpha >> 8 << 24) | (c.red >> 8 << 16) | (c.green & 0xff00) | (c.blue >> 8); } static void initGradient(SourcePictPtr pGradient, int stopCount, xFixed * stopPoints, xRenderColor * stopColors, int *error) { int i; xFixed dpos; if (stopCount <= 0) { *error = BadValue; return; } dpos = -1; for (i = 0; i < stopCount; ++i) { if (stopPoints[i] < dpos || stopPoints[i] > (1 << 16)) { *error = BadValue; return; } dpos = stopPoints[i]; } pGradient->gradient.stops = malloc(stopCount * sizeof(PictGradientStop)); if (!pGradient->gradient.stops) { *error = BadAlloc; return; } pGradient->gradient.nstops = stopCount; for (i = 0; i < stopCount; ++i) { pGradient->gradient.stops[i].x = stopPoints[i]; pGradient->gradient.stops[i].color = stopColors[i]; } } static PicturePtr createSourcePicture(void) { PicturePtr pPicture; pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, PRIVATE_PICTURE); pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; pPicture->format = PICT_a8r8g8b8; SetPictureToDefaults(pPicture); return pPicture; } PicturePtr CreateSolidPicture(Picture pid, xRenderColor * color, int *error) { PicturePtr pPicture; pPicture = createSourcePicture(); if (!pPicture) { *error = BadAlloc; return 0; } pPicture->id = pid; pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); return 0; } pPicture->pSourcePict->type = SourcePictTypeSolidFill; pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color); return pPicture; } PicturePtr CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, int nStops, xFixed * stops, xRenderColor * colors, int *error) { PicturePtr pPicture; if (nStops < 2) { *error = BadValue; return 0; } pPicture = createSourcePicture(); if (!pPicture) { *error = BadAlloc; return 0; } pPicture->id = pid; pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); return 0; } pPicture->pSourcePict->linear.type = SourcePictTypeLinear; pPicture->pSourcePict->linear.p1 = *p1; pPicture->pSourcePict->linear.p2 = *p2; initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { free(pPicture); return 0; } return pPicture; } PicturePtr CreateRadialGradientPicture(Picture pid, xPointFixed * inner, xPointFixed * outer, xFixed innerRadius, xFixed outerRadius, int nStops, xFixed * stops, xRenderColor * colors, int *error) { PicturePtr pPicture; PictRadialGradient *radial; if (nStops < 2) { *error = BadValue; return 0; } pPicture = createSourcePicture(); if (!pPicture) { *error = BadAlloc; return 0; } pPicture->id = pid; pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); return 0; } radial = &pPicture->pSourcePict->radial; radial->type = SourcePictTypeRadial; radial->c1.x = inner->x; radial->c1.y = inner->y; radial->c1.radius = innerRadius; radial->c2.x = outer->x; radial->c2.y = outer->y; radial->c2.radius = outerRadius; initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { free(pPicture); return 0; } return pPicture; } PicturePtr CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, int nStops, xFixed * stops, xRenderColor * colors, int *error) { PicturePtr pPicture; if (nStops < 2) { *error = BadValue; return 0; } pPicture = createSourcePicture(); if (!pPicture) { *error = BadAlloc; return 0; } pPicture->id = pid; pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); return 0; } pPicture->pSourcePict->conical.type = SourcePictTypeConical; pPicture->pSourcePict->conical.center = *center; pPicture->pSourcePict->conical.angle = angle; initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { free(pPicture); return 0; } return pPicture; } static int cpAlphaMap(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode) { #ifdef PANORAMIX if (!noPanoramiXExtension) { PanoramiXRes *res; int err = dixLookupResourceByType((void **)&res, id, XRT_PICTURE, client, mode); if (err != Success) return err; id = res->info[screen->myNum].id; } #endif return dixLookupResourceByType(result, id, PictureType, client, mode); } static int cpClipMask(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode) { #ifdef PANORAMIX if (!noPanoramiXExtension) { PanoramiXRes *res; int err = dixLookupResourceByType((void **)&res, id, XRT_PIXMAP, client, mode); if (err != Success) return err; id = res->info[screen->myNum].id; } #endif return dixLookupResourceByType(result, id, RT_PIXMAP, client, mode); } #define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val) #define NEXT_PTR(_type) ((_type) ulist++->ptr) int ChangePicture(PicturePtr pPicture, Mask vmask, XID *vlist, DevUnion *ulist, ClientPtr client) { ScreenPtr pScreen = pPicture->pDrawable ? pPicture->pDrawable->pScreen : 0; PictureScreenPtr ps = pScreen ? GetPictureScreen(pScreen) : 0; BITS32 index2; int error = 0; BITS32 maskQ; pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; maskQ = vmask; while (vmask && !error) { index2 = (BITS32) lowbit(vmask); vmask &= ~index2; pPicture->stateChanges |= index2; switch (index2) { case CPRepeat: { unsigned int newr; newr = NEXT_VAL(unsigned int); if (newr <= RepeatReflect) { pPicture->repeat = (newr != RepeatNone); pPicture->repeatType = newr; } else { client->errorValue = newr; error = BadValue; } } break; case CPAlphaMap: { PicturePtr pAlpha; if (vlist) { Picture pid = NEXT_VAL(Picture); if (pid == None) pAlpha = 0; else { error = cpAlphaMap((void **) &pAlpha, pid, pScreen, client, DixReadAccess); if (error != Success) { client->errorValue = pid; break; } if (pAlpha->pDrawable == NULL || pAlpha->pDrawable->type != DRAWABLE_PIXMAP) { client->errorValue = pid; error = BadMatch; break; } } } else pAlpha = NEXT_PTR(PicturePtr); if (!error) { if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) pAlpha->refcnt++; if (pPicture->alphaMap) FreePicture((void *) pPicture->alphaMap, (XID) 0); pPicture->alphaMap = pAlpha; } } break; case CPAlphaXOrigin: pPicture->alphaOrigin.x = NEXT_VAL(INT16); break; case CPAlphaYOrigin: pPicture->alphaOrigin.y = NEXT_VAL(INT16); break; case CPClipXOrigin: pPicture->clipOrigin.x = NEXT_VAL(INT16); break; case CPClipYOrigin: pPicture->clipOrigin.y = NEXT_VAL(INT16); break; case CPClipMask: { Pixmap pid; PixmapPtr pPixmap; int clipType; if (!pScreen) return BadDrawable; if (vlist) { pid = NEXT_VAL(Pixmap); if (pid == None) { clipType = CT_NONE; pPixmap = NullPixmap; } else { clipType = CT_PIXMAP; error = cpClipMask((void **) &pPixmap, pid, pScreen, client, DixReadAccess); if (error != Success) { client->errorValue = pid; break; } } } else { pPixmap = NEXT_PTR(PixmapPtr); if (pPixmap) clipType = CT_PIXMAP; else clipType = CT_NONE; } if (pPixmap) { if ((pPixmap->drawable.depth != 1) || (pPixmap->drawable.pScreen != pScreen)) { error = BadMatch; break; } else { clipType = CT_PIXMAP; pPixmap->refcnt++; } } error = (*ps->ChangePictureClip) (pPicture, clipType, (void *) pPixmap, 0); break; } case CPGraphicsExposure: { unsigned int newe; newe = NEXT_VAL(unsigned int); if (newe <= xTrue) pPicture->graphicsExposures = newe; else { client->errorValue = newe; error = BadValue; } } break; case CPSubwindowMode: { unsigned int news; news = NEXT_VAL(unsigned int); if (news == ClipByChildren || news == IncludeInferiors) pPicture->subWindowMode = news; else { client->errorValue = news; error = BadValue; } } break; case CPPolyEdge: { unsigned int newe; newe = NEXT_VAL(unsigned int); if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth) pPicture->polyEdge = newe; else { client->errorValue = newe; error = BadValue; } } break; case CPPolyMode: { unsigned int newm; newm = NEXT_VAL(unsigned int); if (newm == PolyModePrecise || newm == PolyModeImprecise) pPicture->polyMode = newm; else { client->errorValue = newm; error = BadValue; } } break; case CPDither: (void) NEXT_VAL(Atom); /* unimplemented */ break; case CPComponentAlpha: { unsigned int newca; newca = NEXT_VAL(unsigned int); if (newca <= xTrue) pPicture->componentAlpha = newca; else { client->errorValue = newca; error = BadValue; } } break; default: client->errorValue = maskQ; error = BadValue; break; } } if (ps) (*ps->ChangePicture) (pPicture, maskQ); return error; } int SetPictureClipRects(PicturePtr pPicture, int xOrigin, int yOrigin, int nRect, xRectangle *rects) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); RegionPtr clientClip; int result; clientClip = RegionFromRects(nRect, rects, CT_UNSORTED); if (!clientClip) return BadAlloc; result = (*ps->ChangePictureClip) (pPicture, CT_REGION, (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; pPicture->clipOrigin.y = yOrigin; pPicture->stateChanges |= CPClipXOrigin | CPClipYOrigin | CPClipMask; pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; } return result; } int SetPictureClipRegion(PicturePtr pPicture, int xOrigin, int yOrigin, RegionPtr pRegion) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); RegionPtr clientClip; int result; int type; if (pRegion) { type = CT_REGION; clientClip = RegionCreate(RegionExtents(pRegion), RegionNumRects(pRegion)); if (!clientClip) return BadAlloc; if (!RegionCopy(clientClip, pRegion)) { RegionDestroy(clientClip); return BadAlloc; } } else { type = CT_NONE; clientClip = 0; } result = (*ps->ChangePictureClip) (pPicture, type, (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; pPicture->clipOrigin.y = yOrigin; pPicture->stateChanges |= CPClipXOrigin | CPClipYOrigin | CPClipMask; pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; } return result; } static Bool transformIsIdentity(PictTransform * t) { return ((t->matrix[0][0] == t->matrix[1][1]) && (t->matrix[0][0] == t->matrix[2][2]) && (t->matrix[0][0] != 0) && (t->matrix[0][1] == 0) && (t->matrix[0][2] == 0) && (t->matrix[1][0] == 0) && (t->matrix[1][2] == 0) && (t->matrix[2][0] == 0) && (t->matrix[2][1] == 0)); } int SetPictureTransform(PicturePtr pPicture, PictTransform * transform) { if (transform && transformIsIdentity(transform)) transform = 0; if (transform) { if (!pPicture->transform) { pPicture->transform = (PictTransform *) malloc(sizeof(PictTransform)); if (!pPicture->transform) return BadAlloc; } *pPicture->transform = *transform; } else { free(pPicture->transform); pPicture->transform = NULL; } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; if (pPicture->pDrawable != NULL) { int result; PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); result = (*ps->ChangePictureTransform) (pPicture, transform); return result; } return Success; } static void ValidateOnePicture(PicturePtr pPicture) { if (pPicture->pDrawable && pPicture->serialNumber != pPicture->pDrawable->serialNumber) { PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); (*ps->ValidatePicture) (pPicture, pPicture->stateChanges); pPicture->stateChanges = 0; pPicture->serialNumber = pPicture->pDrawable->serialNumber; } } void ValidatePicture(PicturePtr pPicture) { ValidateOnePicture(pPicture); if (pPicture->alphaMap) ValidateOnePicture(pPicture->alphaMap); } int FreePicture(void *value, XID pid) { PicturePtr pPicture = (PicturePtr) value; if (--pPicture->refcnt == 0) { free(pPicture->transform); if (pPicture->pSourcePict) { if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) free(pPicture->pSourcePict->linear.stops); free(pPicture->pSourcePict); } if (pPicture->pDrawable) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); if (pPicture->alphaMap) FreePicture((void *) pPicture->alphaMap, (XID) 0); (*ps->DestroyPicture) (pPicture); (*ps->DestroyPictureClip) (pPicture); if (pPicture->pDrawable->type == DRAWABLE_WINDOW) { WindowPtr pWindow = (WindowPtr) pPicture->pDrawable; PicturePtr *pPrev; for (pPrev = (PicturePtr *) dixLookupPrivateAddr (&pWindow->devPrivates, PictureWindowPrivateKey); *pPrev; pPrev = &(*pPrev)->pNext) { if (*pPrev == pPicture) { *pPrev = pPicture->pNext; break; } } } else if (pPicture->pDrawable->type == DRAWABLE_PIXMAP) { (*pScreen->DestroyPixmap) ((PixmapPtr) pPicture->pDrawable); } } dixFreeObjectWithPrivates(pPicture, PRIVATE_PICTURE); } return Success; } int FreePictFormat(void *pPictFormat, XID pid) { return Success; } /** * ReduceCompositeOp is used to choose simpler ops for cases where alpha * channels are always one and so math on the alpha channel per pixel becomes * unnecessary. It may also avoid destination reads sometimes if apps aren't * being careful to avoid these cases. */ static CARD8 ReduceCompositeOp(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, CARD16 width, CARD16 height) { Bool no_src_alpha, no_dst_alpha; /* Sampling off the edge of a RepeatNone picture introduces alpha * even if the picture itself doesn't have alpha. We don't try to * detect every case where we don't sample off the edge, just the * simplest case where there is no transform on the source * picture. */ no_src_alpha = PICT_FORMAT_COLOR(pSrc->format) && PICT_FORMAT_A(pSrc->format) == 0 && (pSrc->repeatType != RepeatNone || (!pSrc->transform && xSrc >= 0 && ySrc >= 0 && xSrc + width <= pSrc->pDrawable->width && ySrc + height <= pSrc->pDrawable->height)) && pSrc->alphaMap == NULL && pMask == NULL; no_dst_alpha = PICT_FORMAT_COLOR(pDst->format) && PICT_FORMAT_A(pDst->format) == 0 && pDst->alphaMap == NULL; /* TODO, maybe: Conjoint and Disjoint op reductions? */ /* Deal with simplifications where the source alpha is always 1. */ if (no_src_alpha) { switch (op) { case PictOpOver: op = PictOpSrc; break; case PictOpInReverse: op = PictOpDst; break; case PictOpOutReverse: op = PictOpClear; break; case PictOpAtop: op = PictOpIn; break; case PictOpAtopReverse: op = PictOpOverReverse; break; case PictOpXor: op = PictOpOut; break; default: break; } } /* Deal with simplifications when the destination alpha is always 1 */ if (no_dst_alpha) { switch (op) { case PictOpOverReverse: op = PictOpDst; break; case PictOpIn: op = PictOpSrc; break; case PictOpOut: op = PictOpClear; break; case PictOpAtop: op = PictOpOver; break; case PictOpXor: op = PictOpOutReverse; break; default: break; } } /* Reduce some con/disjoint ops to the basic names. */ switch (op) { case PictOpDisjointClear: case PictOpConjointClear: op = PictOpClear; break; case PictOpDisjointSrc: case PictOpConjointSrc: op = PictOpSrc; break; case PictOpDisjointDst: case PictOpConjointDst: op = PictOpDst; break; default: break; } return op; } void CompositePicture(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); ValidatePicture(pSrc); if (pMask) ValidatePicture(pMask); ValidatePicture(pDst); op = ReduceCompositeOp(op, pSrc, pMask, pDst, xSrc, ySrc, width, height); if (op == PictOpDst) return; (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); } void CompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); ValidatePicture(pDst); (*ps->CompositeRects) (op, pDst, color, nRect, rects); } void CompositeTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); ValidatePicture(pSrc); ValidatePicture(pDst); (*ps->Trapezoids) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); } void CompositeTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntriangles, xTriangle * triangles) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); ValidatePicture(pSrc); ValidatePicture(pDst); (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntriangles, triangles); } void CompositeTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); if (npoints < 3) return; ValidatePicture(pSrc); ValidatePicture(pDst); (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); } void CompositeTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); if (npoints < 3) return; ValidatePicture(pSrc); ValidatePicture(pDst); (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); } void AddTraps(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntrap, xTrap * traps) { PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); ValidatePicture(pPicture); (*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps); } xorg-server-1.17.1/render/glyphstr.h0000664000175100017510000001014212456571574014333 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifndef _GLYPHSTR_H_ #define _GLYPHSTR_H_ #include #include "picture.h" #include "screenint.h" #include "regionstr.h" #include "miscstruct.h" #include "privates.h" #define GlyphFormat1 0 #define GlyphFormat4 1 #define GlyphFormat8 2 #define GlyphFormat16 3 #define GlyphFormat32 4 #define GlyphFormatNum 5 typedef struct _Glyph { CARD32 refcnt; PrivateRec *devPrivates; unsigned char sha1[20]; CARD32 size; /* info + bitmap */ xGlyphInfo info; /* per-screen pixmaps follow */ } GlyphRec, *GlyphPtr; #define GlyphPicture(glyph) ((PicturePtr *) ((glyph) + 1)) typedef struct _GlyphRef { CARD32 signature; GlyphPtr glyph; } GlyphRefRec, *GlyphRefPtr; #define DeletedGlyph ((GlyphPtr) 1) typedef struct _GlyphHashSet { CARD32 entries; CARD32 size; CARD32 rehash; } GlyphHashSetRec, *GlyphHashSetPtr; typedef struct _GlyphHash { GlyphRefPtr table; GlyphHashSetPtr hashSet; CARD32 tableEntries; } GlyphHashRec, *GlyphHashPtr; typedef struct _GlyphSet { CARD32 refcnt; int fdepth; PictFormatPtr format; GlyphHashRec hash; PrivateRec *devPrivates; } GlyphSetRec, *GlyphSetPtr; #define GlyphSetGetPrivate(pGlyphSet,k) \ dixLookupPrivate(&(pGlyphSet)->devPrivates, k) #define GlyphSetSetPrivate(pGlyphSet,k,ptr) \ dixSetPrivate(&(pGlyphSet)->devPrivates, k, ptr) typedef struct _GlyphList { INT16 xOff; INT16 yOff; CARD8 len; PictFormatPtr format; } GlyphListRec, *GlyphListPtr; extern _X_EXPORT void GlyphUninit(ScreenPtr pScreen); extern _X_EXPORT GlyphHashSetPtr FindGlyphHashSet(CARD32 filled); extern _X_EXPORT GlyphRefPtr FindGlyphRef(GlyphHashPtr hash, CARD32 signature, Bool match, unsigned char sha1[20]); extern _X_EXPORT GlyphPtr FindGlyphByHash(unsigned char sha1[20], int format); extern _X_EXPORT int HashGlyph(xGlyphInfo * gi, CARD8 *bits, unsigned long size, unsigned char sha1[20]); extern _X_EXPORT void FreeGlyph(GlyphPtr glyph, int format); extern _X_EXPORT void AddGlyph(GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id); extern _X_EXPORT Bool DeleteGlyph(GlyphSetPtr glyphSet, Glyph id); extern _X_EXPORT GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id); extern _X_EXPORT GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format); extern _X_EXPORT Bool AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet); extern _X_EXPORT Bool ResizeGlyphHash(GlyphHashPtr hash, CARD32 change, Bool global); extern _X_EXPORT Bool ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change); extern _X_EXPORT GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format); extern _X_EXPORT int FreeGlyphSet(void *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_ */ xorg-server-1.17.1/render/matrix.c0000664000175100017510000000547012274325512013751 00000000000000/* * Copyright © 2007 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "misc.h" #include "scrnintstr.h" #include "os.h" #include "regionstr.h" #include "validate.h" #include "windowstr.h" #include "input.h" #include "resource.h" #include "colormapst.h" #include "cursorstr.h" #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" #include "picturestr.h" void PictTransform_from_xRenderTransform(PictTransformPtr pict, xRenderTransform * render) { pict->matrix[0][0] = render->matrix11; pict->matrix[0][1] = render->matrix12; pict->matrix[0][2] = render->matrix13; pict->matrix[1][0] = render->matrix21; pict->matrix[1][1] = render->matrix22; pict->matrix[1][2] = render->matrix23; pict->matrix[2][0] = render->matrix31; pict->matrix[2][1] = render->matrix32; pict->matrix[2][2] = render->matrix33; } void xRenderTransform_from_PictTransform(xRenderTransform * render, PictTransformPtr pict) { render->matrix11 = pict->matrix[0][0]; render->matrix12 = pict->matrix[0][1]; render->matrix13 = pict->matrix[0][2]; render->matrix21 = pict->matrix[1][0]; render->matrix22 = pict->matrix[1][1]; render->matrix23 = pict->matrix[1][2]; render->matrix31 = pict->matrix[2][0]; render->matrix32 = pict->matrix[2][1]; render->matrix33 = pict->matrix[2][2]; } Bool PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector) { return pixman_transform_point(transform, vector); } Bool PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector) { return pixman_transform_point_3d(transform, vector); } xorg-server-1.17.1/render/picture.h0000664000175100017510000001647212456571574014146 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifndef _PICTURE_H_ #define _PICTURE_H_ #include "privates.h" #include typedef struct _DirectFormat *DirectFormatPtr; typedef struct _PictFormat *PictFormatPtr; typedef struct _Picture *PicturePtr; /* * While the protocol is generous in format support, the * sample implementation allows only packed RGB and GBR * representations for data to simplify software rendering, */ #define PICT_FORMAT(bpp,type,a,r,g,b) PIXMAN_FORMAT(bpp, type, a, r, g, b) /* * gray/color formats use a visual index instead of argb */ #define PICT_VISFORMAT(bpp,type,vi) (((bpp) << 24) | \ ((type) << 16) | \ ((vi))) #define PICT_FORMAT_BPP(f) PIXMAN_FORMAT_BPP(f) #define PICT_FORMAT_TYPE(f) PIXMAN_FORMAT_TYPE(f) #define PICT_FORMAT_A(f) PIXMAN_FORMAT_A(f) #define PICT_FORMAT_R(f) PIXMAN_FORMAT_R(f) #define PICT_FORMAT_G(f) PIXMAN_FORMAT_G(f) #define PICT_FORMAT_B(f) PIXMAN_FORMAT_B(f) #define PICT_FORMAT_RGB(f) PIXMAN_FORMAT_RGB(f) #define PICT_FORMAT_VIS(f) PIXMAN_FORMAT_VIS(f) #define PICT_TYPE_OTHER PIXMAN_TYPE_OTHER #define PICT_TYPE_A PIXMAN_TYPE_A #define PICT_TYPE_ARGB PIXMAN_TYPE_ARGB #define PICT_TYPE_ABGR PIXMAN_TYPE_ABGR #define PICT_TYPE_COLOR PIXMAN_TYPE_COLOR #define PICT_TYPE_GRAY PIXMAN_TYPE_GRAY #define PICT_TYPE_BGRA PIXMAN_TYPE_BGRA #define PICT_FORMAT_COLOR(f) PIXMAN_FORMAT_COLOR(f) /* 32bpp formats */ typedef enum _PictFormatShort { PICT_a2r10g10b10 = PIXMAN_a2r10g10b10, PICT_x2r10g10b10 = PIXMAN_x2r10g10b10, PICT_a2b10g10r10 = PIXMAN_a2b10g10r10, PICT_x2b10g10r10 = PIXMAN_x2b10g10r10, PICT_a8r8g8b8 = PIXMAN_a8r8g8b8, PICT_x8r8g8b8 = PIXMAN_x8r8g8b8, PICT_a8b8g8r8 = PIXMAN_a8b8g8r8, PICT_x8b8g8r8 = PIXMAN_x8b8g8r8, PICT_b8g8r8a8 = PIXMAN_b8g8r8a8, PICT_b8g8r8x8 = PIXMAN_b8g8r8x8, /* 24bpp formats */ PICT_r8g8b8 = PIXMAN_r8g8b8, PICT_b8g8r8 = PIXMAN_b8g8r8, /* 16bpp formats */ PICT_r5g6b5 = PIXMAN_r5g6b5, PICT_b5g6r5 = PIXMAN_b5g6r5, PICT_a1r5g5b5 = PIXMAN_a1r5g5b5, PICT_x1r5g5b5 = PIXMAN_x1r5g5b5, PICT_a1b5g5r5 = PIXMAN_a1b5g5r5, PICT_x1b5g5r5 = PIXMAN_x1b5g5r5, PICT_a4r4g4b4 = PIXMAN_a4r4g4b4, PICT_x4r4g4b4 = PIXMAN_x4r4g4b4, PICT_a4b4g4r4 = PIXMAN_a4b4g4r4, PICT_x4b4g4r4 = PIXMAN_x4b4g4r4, /* 8bpp formats */ PICT_a8 = PIXMAN_a8, PICT_r3g3b2 = PIXMAN_r3g3b2, PICT_b2g3r3 = PIXMAN_b2g3r3, PICT_a2r2g2b2 = PIXMAN_a2r2g2b2, PICT_a2b2g2r2 = PIXMAN_a2b2g2r2, PICT_c8 = PIXMAN_c8, PICT_g8 = PIXMAN_g8, PICT_x4a4 = PIXMAN_x4a4, PICT_x4c4 = PIXMAN_x4c4, PICT_x4g4 = PIXMAN_x4g4, /* 4bpp formats */ PICT_a4 = PIXMAN_a4, PICT_r1g2b1 = PIXMAN_r1g2b1, PICT_b1g2r1 = PIXMAN_b1g2r1, PICT_a1r1g1b1 = PIXMAN_a1r1g1b1, PICT_a1b1g1r1 = PIXMAN_a1b1g1r1, PICT_c4 = PIXMAN_c4, PICT_g4 = PIXMAN_g4, /* 1bpp formats */ PICT_a1 = PIXMAN_a1, PICT_g1 = PIXMAN_g1 } PictFormatShort; /* * For dynamic indexed visuals (GrayScale and PseudoColor), these control the * selection of colors allocated for drawing to Pictures. The default * policy depends on the size of the colormap: * * Size Default Policy * ---------------------------- * < 64 PolicyMono * < 256 PolicyGray * 256 PolicyColor (only on PseudoColor) * * The actual allocation code lives in miindex.c, and so is * austensibly server dependent, but that code does: * * PolicyMono Allocate no additional colors, use black and white * PolicyGray Allocate 13 gray levels (11 cells used) * PolicyColor Allocate a 4x4x4 cube and 13 gray levels (71 cells used) * PolicyAll Allocate as big a cube as possible, fill with gray (all) * * Here's a picture to help understand how many colors are * actually allocated (this is just the gray ramp): * * gray level * all 0000 1555 2aaa 4000 5555 6aaa 8000 9555 aaaa bfff d555 eaaa ffff * b/w 0000 ffff * 4x4x4 5555 aaaa * extra 1555 2aaa 4000 6aaa 8000 9555 bfff d555 eaaa * * The default colormap supplies two gray levels (black/white), the * 4x4x4 cube allocates another two and nine more are allocated to fill * in the 13 levels. When the 4x4x4 cube is not allocated, a total of * 11 cells are allocated. */ #define PictureCmapPolicyInvalid -1 #define PictureCmapPolicyDefault 0 #define PictureCmapPolicyMono 1 #define PictureCmapPolicyGray 2 #define PictureCmapPolicyColor 3 #define PictureCmapPolicyAll 4 extern _X_EXPORT int PictureCmapPolicy; extern _X_EXPORT int PictureParseCmapPolicy(const char *name); extern _X_EXPORT int RenderErrBase; /* Fixed point updates from Carl Worth, USC, Information Sciences Institute */ typedef pixman_fixed_32_32_t xFixed_32_32; typedef pixman_fixed_48_16_t xFixed_48_16; #define MAX_FIXED_48_16 pixman_max_fixed_48_16 #define MIN_FIXED_48_16 pixman_min_fixed_48_16 typedef pixman_fixed_1_31_t xFixed_1_31; typedef pixman_fixed_1_16_t xFixed_1_16; typedef pixman_fixed_16_16_t xFixed_16_16; /* * An unadorned "xFixed" is the same as xFixed_16_16, * (since it's quite common in the code) */ typedef pixman_fixed_t xFixed; #define XFIXED_BITS 16 #define xFixedToInt(f) pixman_fixed_to_int(f) #define IntToxFixed(i) pixman_int_to_fixed(i) #define xFixedE pixman_fixed_e #define xFixed1 pixman_fixed_1 #define xFixed1MinusE pixman_fixed_1_minus_e #define xFixedFrac(f) pixman_fixed_frac(f) #define xFixedFloor(f) pixman_fixed_floor(f) #define xFixedCeil(f) pixman_fixed_ceil(f) #define xFixedFraction(f) pixman_fixed_fraction(f) #define xFixedMod2(f) pixman_fixed_mod2(f) /* whether 't' is a well defined not obviously empty trapezoid */ #define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \ (t)->right.p1.y != (t)->right.p2.y && \ (int) ((t)->bottom - (t)->top) > 0) /* * Standard NTSC luminance conversions: * * y = r * 0.299 + g * 0.587 + b * 0.114 * * Approximate this for a bit more speed: * * y = (r * 153 + g * 301 + b * 58) / 512 * * This gives 17 bits of luminance; to get 15 bits, lop the low two */ #define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \ (((s) >> 8) & 0xff) * 301 + \ (((s) ) & 0xff) * 58) >> 2) #endif /* _PICTURE_H_ */ xorg-server-1.17.1/render/mirect.c0000664000175100017510000001203512432306326013721 00000000000000/* * * 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_DIX_CONFIG_H #include #endif #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "mi.h" #include "picturestr.h" #include "mipict.h" static void miColorRects(PicturePtr pDst, PicturePtr pClipPict, xRenderColor * color, int nRect, xRectangle *rects, int xoff, int yoff) { CARD32 pixel; GCPtr pGC; ChangeGCVal tmpval[5]; RegionPtr pClip; unsigned long mask; miRenderColorToPixel(pDst->pFormat, color, &pixel); pGC = GetScratchGC(pDst->pDrawable->depth, pDst->pDrawable->pScreen); if (!pGC) return; tmpval[0].val = GXcopy; tmpval[1].val = pixel; tmpval[2].val = pDst->subWindowMode; mask = GCFunction | GCForeground | GCSubwindowMode; if (pClipPict->clientClip) { tmpval[3].val = pDst->clipOrigin.x - xoff; tmpval[4].val = pDst->clipOrigin.y - yoff; mask |= GCClipXOrigin | GCClipYOrigin; pClip = RegionCreate(NULL, 1); RegionCopy(pClip, (RegionPtr) pClipPict->clientClip); (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0); } ChangeGC(NullClient, pGC, mask, tmpval); ValidateGC(pDst->pDrawable, pGC); if (xoff || yoff) { int i; for (i = 0; i < nRect; i++) { rects[i].x -= xoff; rects[i].y -= yoff; } } (*pGC->ops->PolyFillRect) (pDst->pDrawable, pGC, nRect, rects); if (xoff || yoff) { int i; for (i = 0; i < nRect; i++) { rects[i].x += xoff; rects[i].y += yoff; } } FreeScratchGC(pGC); } void miCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects) { ScreenPtr pScreen = pDst->pDrawable->pScreen; if (color->alpha == 0xffff) { if (op == PictOpOver) op = PictOpSrc; } if (op == PictOpClear) color->red = color->green = color->blue = color->alpha = 0; if (op == PictOpSrc || op == PictOpClear) { miColorRects(pDst, pDst, color, nRect, rects, 0, 0); if (pDst->alphaMap) miColorRects(pDst->alphaMap, pDst, color, nRect, rects, pDst->alphaOrigin.x, pDst->alphaOrigin.y); } else { PictFormatPtr rgbaFormat; PixmapPtr pPixmap; PicturePtr pSrc; xRectangle one; int error; Pixel pixel; GCPtr pGC; ChangeGCVal gcvals[2]; XID tmpval[1]; rgbaFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); if (!rgbaFormat) goto bail1; pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth, CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) goto bail2; miRenderColorToPixel(rgbaFormat, color, &pixel); pGC = GetScratchGC(rgbaFormat->depth, pScreen); if (!pGC) goto bail3; gcvals[0].val = GXcopy; gcvals[1].val = pixel; ChangeGC(NullClient, pGC, GCFunction | GCForeground, gcvals); ValidateGC(&pPixmap->drawable, pGC); one.x = 0; one.y = 0; one.width = 1; one.height = 1; (*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one); tmpval[0] = xTrue; pSrc = CreatePicture(0, &pPixmap->drawable, rgbaFormat, CPRepeat, tmpval, serverClient, &error); if (!pSrc) goto bail4; while (nRect--) { CompositePicture(op, pSrc, 0, pDst, 0, 0, 0, 0, rects->x, rects->y, rects->width, rects->height); rects++; } FreePicture((void *) pSrc, 0); bail4: FreeScratchGC(pGC); bail3: (*pScreen->DestroyPixmap) (pPixmap); bail2: bail1: ; } } xorg-server-1.17.1/m4/0000775000175100017510000000000012466505443011422 500000000000000xorg-server-1.17.1/m4/xorg-tls.m40000664000175100017510000000461712272307253013365 00000000000000dnl Copyright © 2011 Apple Inc. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, dnl and/or sell copies of the Software, and to permit persons to whom the dnl Software is furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice (including the next dnl paragraph) shall be included in all copies or substantial portions of the dnl Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER dnl DEALINGS IN THE SOFTWARE. dnl dnl Authors: Jeremy Huddleston AC_DEFUN([XORG_TLS], [ AC_REQUIRE([XORG_STRICT_OPTION]) AC_MSG_CHECKING(for thread local storage (TLS) support) AC_CACHE_VAL(ac_cv_tls, [ ac_cv_tls=none keywords="__thread __declspec(thread)" for kw in $keywords ; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int $kw test;]], [])], ac_cv_tls=$kw ; break ;) done ]) AC_MSG_RESULT($ac_cv_tls) if test "$ac_cv_tls" != "none"; then AC_MSG_CHECKING(for tls_model attribute support) AC_CACHE_VAL(ac_cv_tls_model, [ save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $STRICT_CFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int $ac_cv_tls __attribute__((tls_model("initial-exec"))) test;]], [])], ac_cv_tls_model=yes, ac_cv_tls_model=no) CFLAGS="$save_CFLAGS" ]) AC_MSG_RESULT($ac_cv_tls_model) if test "x$ac_cv_tls_model" = "xyes" ; then xorg_tls=$ac_cv_tls' __attribute__((tls_model("initial-exec")))' else xorg_tls=$ac_cv_tls fi AC_DEFINE_UNQUOTED([TLS], $xorg_tls, [The compiler supported TLS storage class, prefering initial-exec if tls_model is supported]) fi ]) xorg-server-1.17.1/m4/ac_define_dir.m40000664000175100017510000000314012160102336014316 00000000000000# =========================================================================== # http://autoconf-archive.cryp.to/ac_define_dir.html # =========================================================================== # # SYNOPSIS # # AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) # # DESCRIPTION # # This macro sets VARNAME to the expansion of the DIR variable, taking # care of fixing up ${prefix} and such. # # VARNAME is then offered as both an output variable and a C preprocessor # symbol. # # Example: # # AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) # # LAST MODIFICATION # # 2008-04-12 # # COPYLEFT # # Copyright (c) 2008 Stepan Kasal # Copyright (c) 2008 Andreas Schwab # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2008 Alexandre Oliva # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AC_DEFINE_DIR], [ prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn dnl refers to ${prefix}. Thus we have to use `eval' twice. eval ac_define_dir="\"[$]$2\"" eval ac_define_dir="\"$ac_define_dir\"" AC_SUBST($1, "$ac_define_dir") AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ]) xorg-server-1.17.1/mi/0000775000175100017510000000000012466505444011510 500000000000000xorg-server-1.17.1/mi/Makefile.am0000664000175100017510000000154012432306326013453 00000000000000noinst_LTLIBRARIES = libmi.la if XORG sdk_HEADERS = micmap.h miline.h mipointer.h mi.h \ migc.h mipointrst.h mizerarc.h micoord.h \ mistruct.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) libmi_la_SOURCES = \ mi.h \ miarc.c \ mibitblt.c \ micmap.c \ micmap.h \ micoord.h \ micopy.c \ midash.c \ midispcur.c \ mieq.c \ miexpose.c \ mifillarc.c \ mifillarc.h \ mifillrct.c \ mifpoly.h \ migc.c \ migc.h \ miglblt.c \ miline.h \ mioverlay.c \ mioverlay.h \ mipointer.c \ mipointer.h \ mipointrst.h \ mipoly.c \ mipoly.h \ mipolypnt.c \ mipolyrect.c \ mipolyseg.c \ mipolytext.c \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ misprite.c \ misprite.h \ mistruct.h \ mivaltree.c \ mivalidate.h \ miwideline.c \ miwideline.h \ miwindow.c \ mizerarc.c \ mizerarc.h \ mizerclip.c \ mizerline.c xorg-server-1.17.1/mi/mioverlay.h0000664000175100017510000000156412274325511013606 00000000000000 #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef __MIOVERLAY_H #define __MIOVERLAY_H typedef void (*miOverlayTransFunc) (ScreenPtr, int, BoxPtr); typedef Bool (*miOverlayInOverlayFunc) (WindowPtr); extern _X_EXPORT Bool miInitOverlay(ScreenPtr pScreen, miOverlayInOverlayFunc inOverlay, miOverlayTransFunc trans); extern _X_EXPORT Bool miOverlayGetPrivateClips(WindowPtr pWin, RegionPtr *borderClip, RegionPtr *clipList); extern _X_EXPORT Bool miOverlayCollectUnderlayRegions(WindowPtr, RegionPtr *); extern _X_EXPORT void miOverlayComputeCompositeClip(GCPtr, WindowPtr); extern _X_EXPORT Bool miOverlayCopyUnderlay(ScreenPtr); extern _X_EXPORT void miOverlaySetTransFunction(ScreenPtr, miOverlayTransFunc); extern _X_EXPORT void miOverlaySetRootClip(ScreenPtr, Bool); #endif /* __MIOVERLAY_H */ xorg-server-1.17.1/mi/mivaltree.c0000664000175100017510000006316512456571574013605 00000000000000/* * mivaltree.c -- * Functions for recalculating window clip lists. Main function * is miValidateTree. * Copyright 1987, 1988, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * * Copyright 1987, 1988, 1989 by * Digital Equipment Corporation, Maynard, Massachusetts, * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital not be * used in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL 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. * ******************************************************************/ /* The panoramix components contained the following notice */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ /* * Aug '86: Susan Angebranndt -- original code * July '87: Adam de Boor -- substantially modified and commented * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible. * In particular, much improved code for window mapping and * circulating. * Bob Scheifler -- avoid miComputeClips for unmapped windows, * valdata changes */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "scrnintstr.h" #include "validate.h" #include "windowstr.h" #include "mi.h" #include "regionstr.h" #include "mivalidate.h" #include "globals.h" #ifdef COMPOSITE #include "compint.h" #endif /* * Compute the visibility of a shaped window */ int miShapedWindowIn(RegionPtr universe, RegionPtr bounding, BoxPtr rect, int x, int y) { BoxRec box; BoxPtr boundBox; int nbox; Bool someIn, someOut; int t, x1, y1, x2, y2; nbox = RegionNumRects(bounding); boundBox = RegionRects(bounding); someIn = someOut = FALSE; x1 = rect->x1; y1 = rect->y1; x2 = rect->x2; y2 = rect->y2; while (nbox--) { if ((t = boundBox->x1 + x) < x1) t = x1; box.x1 = t; if ((t = boundBox->y1 + y) < y1) t = y1; box.y1 = t; if ((t = boundBox->x2 + x) > x2) t = x2; box.x2 = t; if ((t = boundBox->y2 + y) > y2) t = y2; box.y2 = t; if (box.x1 > box.x2) box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; switch (RegionContainsRect(universe, &box)) { case rgnIN: if (someOut) return rgnPART; someIn = TRUE; break; case rgnOUT: if (someIn) return rgnPART; someOut = TRUE; break; default: return rgnPART; } boundBox++; } if (someIn) return rgnIN; return rgnOUT; } /* * Manual redirected windows are treated as transparent; they do not obscure * siblings or parent windows */ #ifdef COMPOSITE #define TreatAsTransparent(w) ((w)->redirectDraw == RedirectDrawManual) #else #define TreatAsTransparent(w) FALSE #endif #define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \ HasBorder(w) && \ (w)->backgroundState == ParentRelative) /* *----------------------------------------------------------------------- * miComputeClips -- * Recompute the clipList, borderClip, exposed and borderExposed * regions for pParent and its children. Only viewable windows are * taken into account. * * Results: * None. * * Side Effects: * clipList, borderClip, exposed and borderExposed are altered. * A VisibilityNotify event may be generated on the parent window. * *----------------------------------------------------------------------- */ static void miComputeClips(WindowPtr pParent, ScreenPtr pScreen, RegionPtr universe, VTKind kind, RegionPtr exposed) { /* for intermediate calculations */ int dx, dy; RegionRec childUniverse; WindowPtr pChild; int oldVis, newVis; BoxRec borderSize; RegionRec childUnion; Bool overlap; RegionPtr borderVisible; /* * Figure out the new visibility of this window. * The extent of the universe should be the same as the extent of * the borderSize region. If the window is unobscured, this rectangle * will be completely inside the universe (the universe will cover it * completely). If the window is completely obscured, none of the * universe will cover the rectangle. */ borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent); borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent); dx = (int) pParent->drawable.x + (int) pParent->drawable.width + wBorderWidth(pParent); if (dx > 32767) dx = 32767; borderSize.x2 = dx; dy = (int) pParent->drawable.y + (int) pParent->drawable.height + wBorderWidth(pParent); if (dy > 32767) dy = 32767; borderSize.y2 = dy; #ifdef COMPOSITE /* * In redirected drawing case, reset universe to borderSize */ if (pParent->redirectDraw != RedirectDrawNone) { if (TreatAsTransparent(pParent)) RegionEmpty(universe); compSetRedirectBorderClip (pParent, universe); RegionCopy(universe, &pParent->borderSize); } #endif oldVis = pParent->visibility; switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; break; case rgnPART: newVis = VisibilityPartiallyObscured; { RegionPtr pBounding; if ((pBounding = wBoundingShape(pParent))) { switch (miShapedWindowIn(universe, pBounding, &borderSize, pParent->drawable.x, pParent->drawable.y)) { case rgnIN: newVis = VisibilityUnobscured; break; case rgnOUT: newVis = VisibilityFullyObscured; break; } } } break; default: newVis = VisibilityFullyObscured; break; } pParent->visibility = newVis; if (oldVis != newVis && ((pParent-> eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask)) SendVisibilityNotify(pParent); dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y; /* * avoid computations when dealing with simple operations */ switch (kind) { case VTMap: case VTStack: case VTUnmap: break; case VTMove: if ((oldVis == newVis) && ((oldVis == VisibilityFullyObscured) || (oldVis == VisibilityUnobscured))) { pChild = pParent; while (1) { if (pChild->viewable) { if (pChild->visibility != VisibilityFullyObscured) { RegionTranslate(&pChild->borderClip, dx, dy); RegionTranslate(&pChild->clipList, dx, dy); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pChild, dx, dy); } if (pChild->valdata) { RegionNull(&pChild->valdata->after.borderExposed); if (HasParentRelativeBorder(pChild)) { RegionSubtract(&pChild->valdata->after. borderExposed, &pChild->borderClip, &pChild->winSize); } RegionNull(&pChild->valdata->after.exposed); } if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pParent)) pChild = pChild->parent; if (pChild == pParent) break; pChild = pChild->nextSib; } return; } /* fall through */ default: /* * To calculate exposures correctly, we have to translate the old * borderClip and clipList regions to the window's new location so there * is a correspondence between pieces of the new and old clipping regions. */ if (dx || dy) { /* * We translate the old clipList because that will be exposed or copied * if gravity is right. */ RegionTranslate(&pParent->borderClip, dx, dy); RegionTranslate(&pParent->clipList, dx, dy); } break; case VTBroken: RegionEmpty(&pParent->borderClip); RegionEmpty(&pParent->clipList); break; } borderVisible = pParent->valdata->before.borderVisible; RegionNull(&pParent->valdata->after.borderExposed); RegionNull(&pParent->valdata->after.exposed); /* * Since the borderClip must not be clipped by the children, we do * the border exposure first... * * 'universe' is the window's borderClip. To figure the exposures, remove * the area that used to be exposed from the new. * This leaves a region of pieces that weren't exposed before. */ if (HasBorder(pParent)) { if (borderVisible) { /* * when the border changes shape, the old visible portions * of the border will be saved by DIX in borderVisible -- * use that region and destroy it */ RegionSubtract(exposed, universe, borderVisible); RegionDestroy(borderVisible); } else { RegionSubtract(exposed, universe, &pParent->borderClip); } if (HasParentRelativeBorder(pParent) && (dx || dy)) RegionSubtract(&pParent->valdata->after.borderExposed, universe, &pParent->winSize); else RegionSubtract(&pParent->valdata->after.borderExposed, exposed, &pParent->winSize); RegionCopy(&pParent->borderClip, universe); /* * To get the right clipList for the parent, and to make doubly sure * that no child overlaps the parent's border, we remove the parent's * border from the universe before proceeding. */ RegionIntersect(universe, universe, &pParent->winSize); } else RegionCopy(&pParent->borderClip, universe); if ((pChild = pParent->firstChild) && pParent->mapped) { RegionNull(&childUniverse); RegionNull(&childUnion); if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) { for (; pChild; pChild = pChild->nextSib) { if (pChild->viewable && !TreatAsTransparent(pChild)) RegionAppend(&childUnion, &pChild->borderSize); } } else { for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) { if (pChild->viewable && !TreatAsTransparent(pChild)) RegionAppend(&childUnion, &pChild->borderSize); } } RegionValidate(&childUnion, &overlap); for (pChild = pParent->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->viewable) { /* * If the child is viewable, we want to remove its extents * from the current universe, but we only re-clip it if * it's been marked. */ if (pChild->valdata) { /* * Figure out the new universe from the child's * perspective and recurse. */ RegionIntersect(&childUniverse, universe, &pChild->borderSize); miComputeClips(pChild, pScreen, &childUniverse, kind, exposed); } /* * Once the child has been processed, we remove its extents * from the current universe, thus denying its space to any * other sibling. */ if (overlap && !TreatAsTransparent(pChild)) RegionSubtract(universe, universe, &pChild->borderSize); } } if (!overlap) RegionSubtract(universe, universe, &childUnion); RegionUninit(&childUnion); RegionUninit(&childUniverse); } /* if any children */ /* * 'universe' now contains the new clipList for the parent window. * * To figure the exposure of the window we subtract the old clip from the * new, just as for the border. */ if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { RegionCopy(&pParent->valdata->after.exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { RegionSubtract(&pParent->valdata->after.exposed, universe, &pParent->clipList); } /* HACK ALERT - copying contents of regions, instead of regions */ { RegionRec tmp; tmp = pParent->clipList; pParent->clipList = *universe; *universe = tmp; } #ifdef NOTDEF RegionCopy(&pParent->clipList, universe); #endif pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pParent, dx, dy); } static void miTreeObscured(WindowPtr pParent) { WindowPtr pChild; int oldVis; pChild = pParent; while (1) { if (pChild->viewable) { oldVis = pChild->visibility; if (oldVis != (pChild->visibility = VisibilityFullyObscured) && ((pChild-> eventMask | wOtherEventMasks(pChild)) & VisibilityChangeMask)) SendVisibilityNotify(pChild); if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pParent)) pChild = pChild->parent; if (pChild == pParent) break; pChild = pChild->nextSib; } } static RegionPtr getBorderClip(WindowPtr pWin) { #ifdef COMPOSITE if (pWin->redirectDraw != RedirectDrawNone) return compGetRedirectBorderClip(pWin); else #endif return &pWin->borderClip; } /* *----------------------------------------------------------------------- * miValidateTree -- * Recomputes the clip list for pParent and all its inferiors. * * Results: * Always returns 1. * * Side Effects: * The clipList, borderClip, exposed, and borderExposed regions for * each marked window are altered. * * Notes: * This routine assumes that all affected windows have been marked * (valdata created) and their winSize and borderSize regions * adjusted to correspond to their new positions. The borderClip and * clipList regions should not have been touched. * * The top-most level is treated differently from all lower levels * because pParent is unchanged. For the top level, we merge the * regions taken up by the marked children back into the clipList * for pParent, thus forming a region from which the marked children * can claim their areas. For lower levels, where the old clipList * and borderClip are invalid, we can't do this and have to do the * extra operations done in miComputeClips, but this is much faster * e.g. when only one child has moved... * *----------------------------------------------------------------------- */ /*ARGSUSED*/ int miValidateTree(WindowPtr pParent, /* Parent to validate */ WindowPtr pChild, /* First child of pParent that was * affected */ VTKind kind /* What kind of configuration caused call */ ) { RegionRec totalClip; /* Total clipping region available to * the marked children. pParent's clipList * merged with the borderClips of all * the marked children. */ RegionRec childClip; /* The new borderClip for the current * child */ RegionRec childUnion; /* the space covered by borderSize for * all marked children */ RegionRec exposed; /* For intermediate calculations */ ScreenPtr pScreen; WindowPtr pWin; Bool overlap; int viewvals; Bool forward; pScreen = pParent->drawable.pScreen; if (pChild == NullWindow) pChild = pParent->firstChild; RegionNull(&childClip); RegionNull(&exposed); /* * compute the area of the parent window occupied * by the marked children + the parent itself. This * is the area which can be divied up among the marked * children in their new configuration. */ RegionNull(&totalClip); viewvals = 0; if (RegionBroken(&pParent->clipList) && !RegionBroken(&pParent->borderClip)) { kind = VTBroken; /* * When rebuilding clip lists after out of memory, * assume everything is busted. */ forward = TRUE; RegionCopy(&totalClip, &pParent->borderClip); RegionIntersect(&totalClip, &totalClip, &pParent->winSize); for (pWin = pParent->firstChild; pWin != pChild; pWin = pWin->nextSib) { if (pWin->viewable && !TreatAsTransparent(pWin)) RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable) viewvals++; RegionEmpty(&pParent->clipList); } else { if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) { forward = TRUE; for (pWin = pChild; pWin; pWin = pWin->nextSib) { if (pWin->valdata) { RegionAppend(&totalClip, getBorderClip(pWin)); if (pWin->viewable) viewvals++; } } } else { forward = FALSE; pWin = pParent->lastChild; while (1) { if (pWin->valdata) { RegionAppend(&totalClip, getBorderClip(pWin)); if (pWin->viewable) viewvals++; } if (pWin == pChild) break; pWin = pWin->prevSib; } } RegionValidate(&totalClip, &overlap); } /* * Now go through the children of the root and figure their new * borderClips from the totalClip, passing that off to miComputeClips * to handle recursively. Once that's done, we remove the child * from the totalClip to clip any siblings below it. */ overlap = TRUE; if (kind != VTStack) { RegionUnion(&totalClip, &totalClip, &pParent->clipList); if (viewvals > 1) { /* * precompute childUnion to discover whether any of them * overlap. This seems redundant, but performance studies * have demonstrated that the cost of this loop is * lower than the cost of multiple Subtracts in the * loop below. */ RegionNull(&childUnion); if (forward) { for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable && !TreatAsTransparent(pWin)) RegionAppend(&childUnion, &pWin->borderSize); } else { pWin = pParent->lastChild; while (1) { if (pWin->valdata && pWin->viewable && !TreatAsTransparent(pWin)) RegionAppend(&childUnion, &pWin->borderSize); if (pWin == pChild) break; pWin = pWin->prevSib; } } RegionValidate(&childUnion, &overlap); if (overlap) RegionUninit(&childUnion); } } for (pWin = pChild; pWin != NullWindow; pWin = pWin->nextSib) { if (pWin->viewable) { if (pWin->valdata) { RegionIntersect(&childClip, &totalClip, &pWin->borderSize); miComputeClips(pWin, pScreen, &childClip, kind, &exposed); if (overlap && !TreatAsTransparent(pWin)) { RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } } else if (pWin->visibility == VisibilityNotViewable) { miTreeObscured(pWin); } } else { if (pWin->valdata) { RegionEmpty(&pWin->clipList); if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pWin, 0, 0); RegionEmpty(&pWin->borderClip); pWin->valdata = NULL; } } } RegionUninit(&childClip); if (!overlap) { RegionSubtract(&totalClip, &totalClip, &childUnion); RegionUninit(&childUnion); } RegionNull(&pParent->valdata->after.exposed); RegionNull(&pParent->valdata->after.borderExposed); /* * each case below is responsible for updating the * clipList and serial number for the parent window */ switch (kind) { case VTStack: break; default: /* * totalClip contains the new clipList for the parent. Figure out * exposures and obscures as per miComputeClips and reset the parent's * clipList. */ RegionSubtract(&pParent->valdata->after.exposed, &totalClip, &pParent->clipList); /* fall through */ case VTMap: RegionCopy(&pParent->clipList, &totalClip); pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } RegionUninit(&totalClip); RegionUninit(&exposed); if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pParent, 0, 0); return 1; } xorg-server-1.17.1/mi/miwideline.h0000664000175100017510000000525212432306326013722 00000000000000/* Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* Author: Keith Packard, MIT X Consortium */ #include "mifpoly.h" /* for ICEIL */ /* * Polygon edge description for integer wide-line routines */ typedef struct _PolyEdge { int height; /* number of scanlines to process */ int x; /* starting x coordinate */ int stepx; /* fixed integral dx */ int signdx; /* variable dx sign */ int e; /* initial error term */ int dy; int dx; } PolyEdgeRec, *PolyEdgePtr; #define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - miter limit constant */ /* * types for general polygon routines */ typedef struct _PolyVertex { double x, y; } PolyVertexRec, *PolyVertexPtr; typedef struct _PolySlope { int dx, dy; double k; /* x0 * dy - y0 * dx */ } PolySlopeRec, *PolySlopePtr; /* * Line face description for caps/joins */ typedef struct _LineFace { double xa, ya; int dx, dy; int x, y; double k; } LineFaceRec, *LineFacePtr; /* * macros for polygon fillers */ #define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \ oldPixel = pGC->fgPixel; \ if (pixel != oldPixel) { \ ChangeGCVal gcval; \ gcval.val = pixel; \ ChangeGC (NullClient, pGC, GCForeground, &gcval); \ ValidateGC (pDrawable, pGC); \ } \ } #define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \ if (pixel != oldPixel) { \ ChangeGCVal gcval; \ gcval.val = oldPixel; \ ChangeGC (NullClient, pGC, GCForeground, &gcval); \ ValidateGC (pDrawable, pGC); \ } \ } xorg-server-1.17.1/mi/mioverlay.c0000664000175100017510000016277712432306326013616 00000000000000 #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "scrnintstr.h" #include #include "validate.h" #include "windowstr.h" #include "mi.h" #include "gcstruct.h" #include "regionstr.h" #include "privates.h" #include "mivalidate.h" #include "mioverlay.h" #include "migc.h" #include "globals.h" typedef struct { RegionRec exposed; RegionRec borderExposed; RegionPtr borderVisible; DDXPointRec oldAbsCorner; } miOverlayValDataRec, *miOverlayValDataPtr; typedef struct _TreeRec { WindowPtr pWin; struct _TreeRec *parent; struct _TreeRec *firstChild; struct _TreeRec *lastChild; struct _TreeRec *prevSib; struct _TreeRec *nextSib; RegionRec borderClip; RegionRec clipList; unsigned visibility; miOverlayValDataPtr valdata; } miOverlayTreeRec, *miOverlayTreePtr; typedef struct { miOverlayTreePtr tree; } miOverlayWindowRec, *miOverlayWindowPtr; typedef struct { CloseScreenProcPtr CloseScreen; CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; UnrealizeWindowProcPtr UnrealizeWindow; RealizeWindowProcPtr RealizeWindow; miOverlayTransFunc MakeTransparent; miOverlayInOverlayFunc InOverlay; Bool underlayMarked; Bool copyUnderlay; } miOverlayScreenRec, *miOverlayScreenPtr; static DevPrivateKeyRec miOverlayWindowKeyRec; #define miOverlayWindowKey (&miOverlayWindowKeyRec) static DevPrivateKeyRec miOverlayScreenKeyRec; #define miOverlayScreenKey (&miOverlayScreenKeyRec) static void RebuildTree(WindowPtr); static Bool HasUnderlayChildren(WindowPtr); static void MarkUnderlayWindow(WindowPtr); static Bool CollectUnderlayChildrenRegions(WindowPtr, RegionPtr); static Bool miOverlayCloseScreen(ScreenPtr); static Bool miOverlayCreateWindow(WindowPtr); static Bool miOverlayDestroyWindow(WindowPtr); static Bool miOverlayUnrealizeWindow(WindowPtr); static Bool miOverlayRealizeWindow(WindowPtr); static void miOverlayMarkWindow(WindowPtr); static void miOverlayReparentWindow(WindowPtr, WindowPtr); static void miOverlayRestackWindow(WindowPtr, WindowPtr); static Bool miOverlayMarkOverlappedWindows(WindowPtr, WindowPtr, WindowPtr *); static void miOverlayMarkUnrealizedWindow(WindowPtr, WindowPtr, Bool); static int miOverlayValidateTree(WindowPtr, WindowPtr, VTKind); static void miOverlayHandleExposures(WindowPtr); static void miOverlayMoveWindow(WindowPtr, int, int, WindowPtr, VTKind); static void miOverlayWindowExposures(WindowPtr, RegionPtr); static void miOverlayResizeWindow(WindowPtr, int, int, unsigned int, unsigned int, WindowPtr); static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool); static void miOverlaySetShape(WindowPtr, int); static void miOverlayChangeBorderWidth(WindowPtr, unsigned int); #define MIOVERLAY_GET_SCREEN_PRIVATE(pScreen) ((miOverlayScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, miOverlayScreenKey)) #define MIOVERLAY_GET_WINDOW_PRIVATE(pWin) ((miOverlayWindowPtr) \ dixLookupPrivate(&(pWin)->devPrivates, miOverlayWindowKey)) #define MIOVERLAY_GET_WINDOW_TREE(pWin) \ (MIOVERLAY_GET_WINDOW_PRIVATE(pWin)->tree) #define IN_UNDERLAY(w) MIOVERLAY_GET_WINDOW_TREE(w) #define IN_OVERLAY(w) !MIOVERLAY_GET_WINDOW_TREE(w) #define MARK_OVERLAY(w) miMarkWindow(w) #define MARK_UNDERLAY(w) MarkUnderlayWindow(w) #define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \ HasBorder(w) && \ (w)->backgroundState == ParentRelative) Bool miInitOverlay(ScreenPtr pScreen, miOverlayInOverlayFunc inOverlayFunc, miOverlayTransFunc transFunc) { miOverlayScreenPtr pScreenPriv; if (!inOverlayFunc || !transFunc) return FALSE; if (!dixRegisterPrivateKey (&miOverlayWindowKeyRec, PRIVATE_WINDOW, sizeof(miOverlayWindowRec))) return FALSE; if (!dixRegisterPrivateKey(&miOverlayScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!(pScreenPriv = malloc(sizeof(miOverlayScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, miOverlayScreenKey, pScreenPriv); pScreenPriv->InOverlay = inOverlayFunc; pScreenPriv->MakeTransparent = transFunc; pScreenPriv->underlayMarked = FALSE; pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreenPriv->CreateWindow = pScreen->CreateWindow; pScreenPriv->DestroyWindow = pScreen->DestroyWindow; pScreenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; pScreenPriv->RealizeWindow = pScreen->RealizeWindow; pScreen->CloseScreen = miOverlayCloseScreen; pScreen->CreateWindow = miOverlayCreateWindow; pScreen->DestroyWindow = miOverlayDestroyWindow; pScreen->UnrealizeWindow = miOverlayUnrealizeWindow; pScreen->RealizeWindow = miOverlayRealizeWindow; pScreen->ReparentWindow = miOverlayReparentWindow; pScreen->RestackWindow = miOverlayRestackWindow; pScreen->MarkOverlappedWindows = miOverlayMarkOverlappedWindows; pScreen->MarkUnrealizedWindow = miOverlayMarkUnrealizedWindow; pScreen->ValidateTree = miOverlayValidateTree; pScreen->HandleExposures = miOverlayHandleExposures; pScreen->MoveWindow = miOverlayMoveWindow; pScreen->WindowExposures = miOverlayWindowExposures; pScreen->ResizeWindow = miOverlayResizeWindow; pScreen->MarkWindow = miOverlayMarkWindow; pScreen->ClearToBackground = miOverlayClearToBackground; pScreen->SetShape = miOverlaySetShape; pScreen->ChangeBorderWidth = miOverlayChangeBorderWidth; return TRUE; } static Bool miOverlayCloseScreen(ScreenPtr pScreen) { miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->CreateWindow = pScreenPriv->CreateWindow; pScreen->DestroyWindow = pScreenPriv->DestroyWindow; pScreen->UnrealizeWindow = pScreenPriv->UnrealizeWindow; pScreen->RealizeWindow = pScreenPriv->RealizeWindow; free(pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } static Bool miOverlayCreateWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); miOverlayWindowPtr pWinPriv = MIOVERLAY_GET_WINDOW_PRIVATE(pWin); miOverlayTreePtr pTree = NULL; Bool result = TRUE; pWinPriv->tree = NULL; if (!pWin->parent || !((*pScreenPriv->InOverlay) (pWin))) { if (!(pTree = (miOverlayTreePtr) calloc(1, sizeof(miOverlayTreeRec)))) return FALSE; } if (pScreenPriv->CreateWindow) { pScreen->CreateWindow = pScreenPriv->CreateWindow; result = (*pScreen->CreateWindow) (pWin); pScreen->CreateWindow = miOverlayCreateWindow; } if (pTree) { if (result) { pTree->pWin = pWin; pTree->visibility = VisibilityNotViewable; pWinPriv->tree = pTree; if (pWin->parent) { RegionNull(&(pTree->borderClip)); RegionNull(&(pTree->clipList)); RebuildTree(pWin); } else { BoxRec fullBox; fullBox.x1 = 0; fullBox.y1 = 0; fullBox.x2 = pScreen->width; fullBox.y2 = pScreen->height; RegionInit(&(pTree->borderClip), &fullBox, 1); RegionInit(&(pTree->clipList), &fullBox, 1); } } else free(pTree); } return TRUE; } static Bool miOverlayDestroyWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); Bool result = TRUE; if (pTree) { if (pTree->prevSib) pTree->prevSib->nextSib = pTree->nextSib; else if (pTree->parent) pTree->parent->firstChild = pTree->nextSib; if (pTree->nextSib) pTree->nextSib->prevSib = pTree->prevSib; else if (pTree->parent) pTree->parent->lastChild = pTree->prevSib; RegionUninit(&(pTree->borderClip)); RegionUninit(&(pTree->clipList)); free(pTree); } if (pScreenPriv->DestroyWindow) { pScreen->DestroyWindow = pScreenPriv->DestroyWindow; result = (*pScreen->DestroyWindow) (pWin); pScreen->DestroyWindow = miOverlayDestroyWindow; } return result; } static Bool miOverlayUnrealizeWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); Bool result = TRUE; if (pTree) pTree->visibility = VisibilityNotViewable; if (pScreenPriv->UnrealizeWindow) { pScreen->UnrealizeWindow = pScreenPriv->UnrealizeWindow; result = (*pScreen->UnrealizeWindow) (pWin); pScreen->UnrealizeWindow = miOverlayUnrealizeWindow; } return result; } static Bool miOverlayRealizeWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); Bool result = TRUE; if (pScreenPriv->RealizeWindow) { pScreen->RealizeWindow = pScreenPriv->RealizeWindow; result = (*pScreen->RealizeWindow) (pWin); pScreen->RealizeWindow = miOverlayRealizeWindow; } /* we only need to catch the root window realization */ if (result && !pWin->parent && !((*pScreenPriv->InOverlay) (pWin))) { BoxRec box; box.x1 = box.y1 = 0; box.x2 = pWin->drawable.width; box.y2 = pWin->drawable.height; (*pScreenPriv->MakeTransparent) (pScreen, 1, &box); } return result; } static void miOverlayReparentWindow(WindowPtr pWin, WindowPtr pPriorParent) { if (IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)) { /* This could probably be more optimal */ RebuildTree(pWin->drawable.pScreen->root->firstChild); } } static void miOverlayRestackWindow(WindowPtr pWin, WindowPtr oldNextSib) { if (IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)) { /* This could probably be more optimal */ RebuildTree(pWin); } } static Bool miOverlayMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *pLayerWin) { WindowPtr pChild, pLast; Bool overMarked, underMarked, doUnderlay, markAll; miOverlayTreePtr pTree = NULL, tLast, tChild; BoxPtr box; overMarked = underMarked = markAll = FALSE; if (pLayerWin) *pLayerWin = pWin; /* hah! */ doUnderlay = (IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)); box = RegionExtents(&pWin->borderSize); if ((pChild = pFirst)) { pLast = pChild->parent->lastChild; while (1) { if (pChild == pWin) markAll = TRUE; if (doUnderlay && IN_UNDERLAY(pChild)) pTree = MIOVERLAY_GET_WINDOW_TREE(pChild); if (pChild->viewable) { if (RegionBroken(&pChild->winSize)) SetWinSize(pChild); if (RegionBroken(&pChild->borderSize)) SetBorderSize(pChild); if (markAll || RegionContainsRect(&pChild->borderSize, box)) { MARK_OVERLAY(pChild); overMarked = TRUE; if (doUnderlay && IN_UNDERLAY(pChild)) { MARK_UNDERLAY(pChild); underMarked = TRUE; } if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } } while (!pChild->nextSib && (pChild != pLast)) { pChild = pChild->parent; if (doUnderlay && IN_UNDERLAY(pChild)) pTree = MIOVERLAY_GET_WINDOW_TREE(pChild); } if (pChild == pWin) markAll = FALSE; if (pChild == pLast) break; pChild = pChild->nextSib; } if (overMarked) MARK_OVERLAY(pWin->parent); } if (doUnderlay && !pTree) { if (!(pTree = MIOVERLAY_GET_WINDOW_TREE(pWin))) { pChild = pWin->lastChild; while (1) { if ((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) break; if (pChild->lastChild) { pChild = pChild->lastChild; continue; } while (!pChild->prevSib) pChild = pChild->parent; pChild = pChild->prevSib; } } } if (pTree && pTree->nextSib) { tChild = pTree->parent->lastChild; tLast = pTree->nextSib; while (1) { if (tChild->pWin->viewable) { if (RegionBroken(&tChild->pWin->winSize)) SetWinSize(tChild->pWin); if (RegionBroken(&tChild->pWin->borderSize)) SetBorderSize(tChild->pWin); if (RegionContainsRect(&(tChild->pWin->borderSize), box)) { MARK_UNDERLAY(tChild->pWin); underMarked = TRUE; } } if (tChild->lastChild) { tChild = tChild->lastChild; continue; } while (!tChild->prevSib && (tChild != tLast)) tChild = tChild->parent; if (tChild == tLast) break; tChild = tChild->prevSib; } } if (underMarked) { ScreenPtr pScreen = pWin->drawable.pScreen; MARK_UNDERLAY(pTree->parent->pWin); MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->underlayMarked = TRUE; } return underMarked || overMarked; } static void miOverlayComputeClips(WindowPtr pParent, RegionPtr universe, VTKind kind, RegionPtr exposed) { ScreenPtr pScreen = pParent->drawable.pScreen; int oldVis, newVis, dx, dy; BoxRec borderSize; RegionPtr borderVisible; RegionRec childUniverse, childUnion; miOverlayTreePtr tParent = MIOVERLAY_GET_WINDOW_TREE(pParent); miOverlayTreePtr tChild; Bool overlap; borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent); borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent); dx = (int) pParent->drawable.x + (int) pParent->drawable.width + wBorderWidth(pParent); if (dx > 32767) dx = 32767; borderSize.x2 = dx; dy = (int) pParent->drawable.y + (int) pParent->drawable.height + wBorderWidth(pParent); if (dy > 32767) dy = 32767; borderSize.y2 = dy; oldVis = tParent->visibility; switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; break; case rgnPART: newVis = VisibilityPartiallyObscured; { RegionPtr pBounding; if ((pBounding = wBoundingShape(pParent))) { switch (miShapedWindowIn(universe, pBounding, &borderSize, pParent->drawable.x, pParent->drawable.y)) { case rgnIN: newVis = VisibilityUnobscured; break; case rgnOUT: newVis = VisibilityFullyObscured; break; } } } break; default: newVis = VisibilityFullyObscured; break; } tParent->visibility = newVis; dx = pParent->drawable.x - tParent->valdata->oldAbsCorner.x; dy = pParent->drawable.y - tParent->valdata->oldAbsCorner.y; switch (kind) { case VTMap: case VTStack: case VTUnmap: break; case VTMove: if ((oldVis == newVis) && ((oldVis == VisibilityFullyObscured) || (oldVis == VisibilityUnobscured))) { tChild = tParent; while (1) { if (tChild->pWin->viewable) { if (tChild->visibility != VisibilityFullyObscured) { RegionTranslate(&tChild->borderClip, dx, dy); RegionTranslate(&tChild->clipList, dx, dy); tChild->pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) (*pScreen->ClipNotify) (tChild->pWin, dx, dy); } if (tChild->valdata) { RegionNull(&tChild->valdata->borderExposed); if (HasParentRelativeBorder(tChild->pWin)) { RegionSubtract(&tChild->valdata->borderExposed, &tChild->borderClip, &tChild->pWin->winSize); } RegionNull(&tChild->valdata->exposed); } if (tChild->firstChild) { tChild = tChild->firstChild; continue; } } while (!tChild->nextSib && (tChild != tParent)) tChild = tChild->parent; if (tChild == tParent) break; tChild = tChild->nextSib; } return; } /* fall through */ default: if (dx || dy) { RegionTranslate(&tParent->borderClip, dx, dy); RegionTranslate(&tParent->clipList, dx, dy); } break; case VTBroken: RegionEmpty(&tParent->borderClip); RegionEmpty(&tParent->clipList); break; } borderVisible = tParent->valdata->borderVisible; RegionNull(&tParent->valdata->borderExposed); RegionNull(&tParent->valdata->exposed); if (HasBorder(pParent)) { if (borderVisible) { RegionSubtract(exposed, universe, borderVisible); RegionDestroy(borderVisible); } else RegionSubtract(exposed, universe, &tParent->borderClip); if (HasParentRelativeBorder(pParent) && (dx || dy)) RegionSubtract(&tParent->valdata->borderExposed, universe, &pParent->winSize); else RegionSubtract(&tParent->valdata->borderExposed, exposed, &pParent->winSize); RegionCopy(&tParent->borderClip, universe); RegionIntersect(universe, universe, &pParent->winSize); } else RegionCopy(&tParent->borderClip, universe); if ((tChild = tParent->firstChild) && pParent->mapped) { RegionNull(&childUniverse); RegionNull(&childUnion); for (; tChild; tChild = tChild->nextSib) { if (tChild->pWin->viewable) RegionAppend(&childUnion, &tChild->pWin->borderSize); } RegionValidate(&childUnion, &overlap); for (tChild = tParent->firstChild; tChild; tChild = tChild->nextSib) { if (tChild->pWin->viewable) { if (tChild->valdata) { RegionIntersect(&childUniverse, universe, &tChild->pWin->borderSize); miOverlayComputeClips(tChild->pWin, &childUniverse, kind, exposed); } if (overlap) RegionSubtract(universe, universe, &tChild->pWin->borderSize); } } if (!overlap) RegionSubtract(universe, universe, &childUnion); RegionUninit(&childUnion); RegionUninit(&childUniverse); } if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { RegionCopy(&tParent->valdata->exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { RegionSubtract(&tParent->valdata->exposed, universe, &tParent->clipList); } /* HACK ALERT - copying contents of regions, instead of regions */ { RegionRec tmp; tmp = tParent->clipList; tParent->clipList = *universe; *universe = tmp; } pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pParent, dx, dy); } static void miOverlayMarkWindow(WindowPtr pWin) { miOverlayTreePtr pTree = NULL; WindowPtr pChild, pGrandChild; miMarkWindow(pWin); /* look for UnmapValdata among immediate children */ if (!(pChild = pWin->firstChild)) return; for (; pChild; pChild = pChild->nextSib) { if (pChild->valdata == UnmapValData) { if (IN_UNDERLAY(pChild)) { pTree = MIOVERLAY_GET_WINDOW_TREE(pChild); pTree->valdata = (miOverlayValDataPtr) UnmapValData; continue; } else { if (!(pGrandChild = pChild->firstChild)) continue; while (1) { if (IN_UNDERLAY(pGrandChild)) { pTree = MIOVERLAY_GET_WINDOW_TREE(pGrandChild); pTree->valdata = (miOverlayValDataPtr) UnmapValData; } else if (pGrandChild->firstChild) { pGrandChild = pGrandChild->firstChild; continue; } while (!pGrandChild->nextSib && (pGrandChild != pChild)) pGrandChild = pGrandChild->parent; if (pChild == pGrandChild) break; pGrandChild = pGrandChild->nextSib; } } } } if (pTree) { MARK_UNDERLAY(pTree->parent->pWin); MIOVERLAY_GET_SCREEN_PRIVATE(pWin->drawable.pScreen)->underlayMarked = TRUE; } } static void miOverlayMarkUnrealizedWindow(WindowPtr pChild, WindowPtr pWin, Bool fromConfigure) { if ((pChild != pWin) || fromConfigure) { miOverlayTreePtr pTree; RegionEmpty(&pChild->clipList); if (pChild->drawable.pScreen->ClipNotify) (*pChild->drawable.pScreen->ClipNotify) (pChild, 0, 0); RegionEmpty(&pChild->borderClip); if ((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { if (pTree->valdata != (miOverlayValDataPtr) UnmapValData) { RegionEmpty(&pTree->clipList); RegionEmpty(&pTree->borderClip); } } } } static int miOverlayValidateTree(WindowPtr pParent, WindowPtr pChild, /* first child effected */ VTKind kind) { ScreenPtr pScreen = pParent->drawable.pScreen; miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); RegionRec totalClip, childClip, exposed; miOverlayTreePtr tParent, tChild, tWin; Bool overlap; WindowPtr newParent; if (!pPriv->underlayMarked) goto SKIP_UNDERLAY; if (!pChild) pChild = pParent->firstChild; RegionNull(&totalClip); RegionNull(&childClip); RegionNull(&exposed); newParent = pParent; while (IN_OVERLAY(newParent)) newParent = newParent->parent; tParent = MIOVERLAY_GET_WINDOW_TREE(newParent); if (IN_UNDERLAY(pChild)) tChild = MIOVERLAY_GET_WINDOW_TREE(pChild); else tChild = tParent->firstChild; if (RegionBroken(&tParent->clipList) && !RegionBroken(&tParent->borderClip)) { kind = VTBroken; RegionCopy(&totalClip, &tParent->borderClip); RegionIntersect(&totalClip, &totalClip, &tParent->pWin->winSize); for (tWin = tParent->firstChild; tWin != tChild; tWin = tWin->nextSib) { if (tWin->pWin->viewable) RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } RegionEmpty(&tParent->clipList); } else { for (tWin = tChild; tWin; tWin = tWin->nextSib) { if (tWin->valdata) RegionAppend(&totalClip, &tWin->borderClip); } RegionValidate(&totalClip, &overlap); } if (kind != VTStack) RegionUnion(&totalClip, &totalClip, &tParent->clipList); for (tWin = tChild; tWin; tWin = tWin->nextSib) { if (tWin->valdata) { if (tWin->pWin->viewable) { RegionIntersect(&childClip, &totalClip, &tWin->pWin->borderSize); miOverlayComputeClips(tWin->pWin, &childClip, kind, &exposed); RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } else { /* Means we are unmapping */ RegionEmpty(&tWin->clipList); RegionEmpty(&tWin->borderClip); tWin->valdata = NULL; } } } RegionUninit(&childClip); if (!((*pPriv->InOverlay) (newParent))) { RegionNull(&tParent->valdata->exposed); RegionNull(&tParent->valdata->borderExposed); } switch (kind) { case VTStack: break; default: if (!((*pPriv->InOverlay) (newParent))) RegionSubtract(&tParent->valdata->exposed, &totalClip, &tParent->clipList); /* fall through */ case VTMap: RegionCopy(&tParent->clipList, &totalClip); if (!((*pPriv->InOverlay) (newParent))) newParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } RegionUninit(&totalClip); RegionUninit(&exposed); SKIP_UNDERLAY: miValidateTree(pParent, pChild, kind); return 1; } static void miOverlayHandleExposures(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); WindowPtr pChild; ValidatePtr val; WindowExposuresProcPtr WindowExposures; WindowExposures = pWin->drawable.pScreen->WindowExposures; if (pPriv->underlayMarked) { miOverlayTreePtr pTree; miOverlayValDataPtr mival; pChild = pWin; while (IN_OVERLAY(pChild)) pChild = pChild->parent; pTree = MIOVERLAY_GET_WINDOW_TREE(pChild); while (1) { if ((mival = pTree->valdata)) { if (!((*pPriv->InOverlay) (pTree->pWin))) { if (RegionNotEmpty(&mival->borderExposed)) { miPaintWindow(pTree->pWin, &mival->borderExposed, PW_BORDER); } RegionUninit(&mival->borderExposed); (*WindowExposures) (pTree->pWin, &mival->exposed); RegionUninit(&mival->exposed); } free(mival); pTree->valdata = NULL; if (pTree->firstChild) { pTree = pTree->firstChild; continue; } } while (!pTree->nextSib && (pTree->pWin != pChild)) pTree = pTree->parent; if (pTree->pWin == pChild) break; pTree = pTree->nextSib; } pPriv->underlayMarked = FALSE; } pChild = pWin; while (1) { if ((val = pChild->valdata)) { if (!((*pPriv->InOverlay) (pChild))) { RegionUnion(&val->after.exposed, &val->after.exposed, &val->after.borderExposed); if (RegionNotEmpty(&val->after.exposed)) { (*(MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent)) (pScreen, RegionNumRects(&val->after.exposed), RegionRects(&val->after.exposed)); } } else { if (RegionNotEmpty(&val->after.borderExposed)) { miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); } (*WindowExposures) (pChild, &val->after.exposed); } RegionUninit(&val->after.borderExposed); RegionUninit(&val->after.exposed); free(val); pChild->valdata = NULL; if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } } static void miOverlayMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) { ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); WindowPtr pParent, windowToValidate; Bool WasViewable = (Bool) (pWin->viewable); short bw; RegionRec overReg, underReg; DDXPointRec oldpt; if (!(pParent = pWin->parent)) return; bw = wBorderWidth(pWin); oldpt.x = pWin->drawable.x; oldpt.y = pWin->drawable.y; if (WasViewable) { RegionNull(&overReg); RegionNull(&underReg); if (pTree) { RegionCopy(&overReg, &pWin->borderClip); RegionCopy(&underReg, &pTree->borderClip); } else { RegionCopy(&overReg, &pWin->borderClip); CollectUnderlayChildrenRegions(pWin, &underReg); } (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); } pWin->origin.x = x + (int) bw; pWin->origin.y = y + (int) bw; x = pWin->drawable.x = pParent->drawable.x + x + (int) bw; y = pWin->drawable.y = pParent->drawable.y + y + (int) bw; SetWinSize(pWin); SetBorderSize(pWin); (*pScreen->PositionWindow) (pWin, x, y); windowToValidate = MoveWindowInStack(pWin, pNextSib); ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0); if (WasViewable) { miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); (*pScreen->MarkOverlappedWindows) (pWin, windowToValidate, NULL); (*pScreen->ValidateTree) (pWin->parent, NullWindow, kind); if (RegionNotEmpty(&underReg)) { pPriv->copyUnderlay = TRUE; (*pWin->drawable.pScreen->CopyWindow) (pWin, oldpt, &underReg); } RegionUninit(&underReg); if (RegionNotEmpty(&overReg)) { pPriv->copyUnderlay = FALSE; (*pWin->drawable.pScreen->CopyWindow) (pWin, oldpt, &overReg); } RegionUninit(&overReg); (*pScreen->HandleExposures) (pWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pWin->parent, NullWindow, kind); } if (pWin->realized) WindowsRestructured(); } #ifndef RECTLIMIT #define RECTLIMIT 25 #endif static void miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn) { RegionPtr exposures = prgn; if (prgn && !RegionNil(prgn)) { RegionRec expRec; int clientInterested = (pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask; if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) { ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); BoxRec box; box = *RegionExtents(prgn); exposures = &expRec; RegionInit(exposures, &box, 1); RegionReset(prgn, &box); /* This is the only reason why we are replacing mi's version of this file */ if (!((*pPriv->InOverlay) (pWin))) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionIntersect(prgn, prgn, &pTree->clipList); } else RegionIntersect(prgn, prgn, &pWin->clipList); } miPaintWindow(pWin, prgn, PW_BACKGROUND); if (clientInterested) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); if (exposures == &expRec) RegionUninit(exposures); RegionEmpty(prgn); } } typedef struct { RegionPtr over; RegionPtr under; } miOverlayTwoRegions; static int miOverlayRecomputeExposures(WindowPtr pWin, void *value) { miOverlayTwoRegions *pValid = (miOverlayTwoRegions *) value; miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); if (pWin->valdata) { /* * compute exposed regions of this window */ RegionSubtract(&pWin->valdata->after.exposed, &pWin->clipList, pValid->over); /* * compute exposed regions of the border */ RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->borderClip, &pWin->winSize); RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->valdata->after.borderExposed, pValid->over); } if (pTree && pTree->valdata) { RegionSubtract(&pTree->valdata->exposed, &pTree->clipList, pValid->under); RegionSubtract(&pTree->valdata->borderExposed, &pTree->borderClip, &pWin->winSize); RegionSubtract(&pTree->valdata->borderExposed, &pTree->valdata->borderExposed, pValid->under); } else if (!pWin->valdata) return WT_NOMATCH; return WT_WALKCHILDREN; } static void miOverlayResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib) { ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent; miOverlayTreePtr tChild, pTree; Bool WasViewable = (Bool) (pWin->viewable); unsigned short width = pWin->drawable.width; unsigned short height = pWin->drawable.height; short oldx = pWin->drawable.x; short oldy = pWin->drawable.y; int bw = wBorderWidth(pWin); short dw, dh; DDXPointRec oldpt; RegionPtr oldRegion = NULL, oldRegion2 = NULL; WindowPtr pFirstChange; WindowPtr pChild; RegionPtr gravitate[StaticGravity + 1]; RegionPtr gravitate2[StaticGravity + 1]; unsigned g; int nx, ny; /* destination x,y */ int newx, newy; /* new inner window position */ RegionPtr pRegion = NULL; RegionPtr destClip, destClip2; RegionPtr oldWinClip = NULL, oldWinClip2 = NULL; RegionPtr borderVisible = NullRegion; RegionPtr borderVisible2 = NullRegion; Bool shrunk = FALSE; /* shrunk in an inner dimension */ Bool moved = FALSE; /* window position changed */ Bool doUnderlay; /* if this is a root window, can't be resized */ if (!(pParent = pWin->parent)) return; pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); doUnderlay = ((pTree) || HasUnderlayChildren(pWin)); newx = pParent->drawable.x + x + bw; newy = pParent->drawable.y + y + bw; if (WasViewable) { /* * save the visible region of the window */ oldRegion = RegionCreate(NullBox, 1); RegionCopy(oldRegion, &pWin->winSize); if (doUnderlay) { oldRegion2 = RegionCreate(NullBox, 1); RegionCopy(oldRegion2, &pWin->winSize); } /* * categorize child windows into regions to be moved */ for (g = 0; g <= StaticGravity; g++) gravitate[g] = gravitate2[g] = NULL; for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { g = pChild->winGravity; if (g != UnmapGravity) { if (!gravitate[g]) gravitate[g] = RegionCreate(NullBox, 1); RegionUnion(gravitate[g], gravitate[g], &pChild->borderClip); if (doUnderlay) { if (!gravitate2[g]) gravitate2[g] = RegionCreate(NullBox, 0); if ((tChild = MIOVERLAY_GET_WINDOW_TREE(pChild))) { RegionUnion(gravitate2[g], gravitate2[g], &tChild->borderClip); } else CollectUnderlayChildrenRegions(pChild, gravitate2[g]); } } else { UnmapWindow(pChild, TRUE); } } (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); oldWinClip = oldWinClip2 = NULL; if (pWin->bitGravity != ForgetGravity) { oldWinClip = RegionCreate(NullBox, 1); RegionCopy(oldWinClip, &pWin->clipList); if (pTree) { oldWinClip2 = RegionCreate(NullBox, 1); RegionCopy(oldWinClip2, &pTree->clipList); } } /* * if the window is changing size, borderExposed * can't be computed correctly without some help. */ if (pWin->drawable.height > h || pWin->drawable.width > w) shrunk = TRUE; if (newx != oldx || newy != oldy) moved = TRUE; if ((pWin->drawable.height != h || pWin->drawable.width != w) && HasBorder(pWin)) { borderVisible = RegionCreate(NullBox, 1); if (pTree) borderVisible2 = RegionCreate(NullBox, 1); /* for tiled borders, we punt and draw the whole thing */ if (pWin->borderIsPixel || !moved) { if (shrunk || moved) RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); else RegionCopy(borderVisible, &pWin->borderClip); if (pTree) { if (shrunk || moved) RegionSubtract(borderVisible, &pTree->borderClip, &pWin->winSize); else RegionCopy(borderVisible, &pTree->borderClip); } } } } pWin->origin.x = x + bw; pWin->origin.y = y + bw; pWin->drawable.height = h; pWin->drawable.width = w; x = pWin->drawable.x = newx; y = pWin->drawable.y = newy; SetWinSize(pWin); SetBorderSize(pWin); dw = (int) w - (int) width; dh = (int) h - (int) height; ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh); /* let the hardware adjust background and border pixmaps, if any */ (*pScreen->PositionWindow) (pWin, x, y); pFirstChange = MoveWindowInStack(pWin, pSib); if (WasViewable) { pRegion = RegionCreate(NullBox, 1); (*pScreen->MarkOverlappedWindows) (pWin, pFirstChange, NULL); pWin->valdata->before.resized = TRUE; pWin->valdata->before.borderVisible = borderVisible; if (pTree) pTree->valdata->borderVisible = borderVisible2; (*pScreen->ValidateTree) (pWin->parent, pFirstChange, VTOther); /* * the entire window is trashed unless bitGravity * recovers portions of it */ RegionCopy(&pWin->valdata->after.exposed, &pWin->clipList); if (pTree) RegionCopy(&pTree->valdata->exposed, &pTree->clipList); } GravityTranslate(x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); if (WasViewable) { miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); miOverlayTwoRegions TwoRegions; /* avoid the border */ if (HasBorder(pWin)) { int offx, offy, dx, dy; /* kruft to avoid double translates for each gravity */ offx = 0; offy = 0; for (g = 0; g <= StaticGravity; g++) { if (!gravitate[g] && !gravitate2[g]) continue; /* align winSize to gravitate[g]. * winSize is in new coordinates, * gravitate[g] is still in old coordinates */ GravityTranslate(x, y, oldx, oldy, dw, dh, g, &nx, &ny); dx = (oldx - nx) - offx; dy = (oldy - ny) - offy; if (dx || dy) { RegionTranslate(&pWin->winSize, dx, dy); offx += dx; offy += dy; } if (gravitate[g]) RegionIntersect(gravitate[g], gravitate[g], &pWin->winSize); if (gravitate2[g]) RegionIntersect(gravitate2[g], gravitate2[g], &pWin->winSize); } /* get winSize back where it belongs */ if (offx || offy) RegionTranslate(&pWin->winSize, -offx, -offy); } /* * add screen bits to the appropriate bucket */ if (oldWinClip2) { RegionCopy(pRegion, oldWinClip2); RegionTranslate(pRegion, nx - oldx, ny - oldy); RegionIntersect(oldWinClip2, pRegion, &pTree->clipList); for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate2[g]) RegionSubtract(oldWinClip2, oldWinClip2, gravitate2[g]); } RegionTranslate(oldWinClip2, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate2[g]) gravitate2[g] = oldWinClip2; else { RegionUnion(gravitate2[g], gravitate2[g], oldWinClip2); RegionDestroy(oldWinClip2); } } if (oldWinClip) { /* * clip to new clipList */ RegionCopy(pRegion, oldWinClip); RegionTranslate(pRegion, nx - oldx, ny - oldy); RegionIntersect(oldWinClip, pRegion, &pWin->clipList); /* * don't step on any gravity bits which will be copied after this * region. Note -- this assumes that the regions will be copied * in gravity order. */ for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate[g]) RegionSubtract(oldWinClip, oldWinClip, gravitate[g]); } RegionTranslate(oldWinClip, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate[g]) gravitate[g] = oldWinClip; else { RegionUnion(gravitate[g], gravitate[g], oldWinClip); RegionDestroy(oldWinClip); } } /* * move the bits on the screen */ destClip = destClip2 = NULL; for (g = 0; g <= StaticGravity; g++) { if (!gravitate[g] && !gravitate2[g]) continue; GravityTranslate(x, y, oldx, oldy, dw, dh, g, &nx, &ny); oldpt.x = oldx + (x - nx); oldpt.y = oldy + (y - ny); /* Note that gravitate[g] is *translated* by CopyWindow */ /* only copy the remaining useful bits */ if (gravitate[g]) RegionIntersect(gravitate[g], gravitate[g], oldRegion); if (gravitate2[g]) RegionIntersect(gravitate2[g], gravitate2[g], oldRegion2); /* clip to not overwrite already copied areas */ if (destClip && gravitate[g]) { RegionTranslate(destClip, oldpt.x - x, oldpt.y - y); RegionSubtract(gravitate[g], gravitate[g], destClip); RegionTranslate(destClip, x - oldpt.x, y - oldpt.y); } if (destClip2 && gravitate2[g]) { RegionTranslate(destClip2, oldpt.x - x, oldpt.y - y); RegionSubtract(gravitate2[g], gravitate2[g], destClip2); RegionTranslate(destClip2, x - oldpt.x, y - oldpt.y); } /* and move those bits */ if (oldpt.x != x || oldpt.y != y) { if (gravitate2[g]) { pPriv->copyUnderlay = TRUE; (*pScreen->CopyWindow) (pWin, oldpt, gravitate2[g]); } if (gravitate[g]) { pPriv->copyUnderlay = FALSE; (*pScreen->CopyWindow) (pWin, oldpt, gravitate[g]); } } /* remove any overwritten bits from the remaining useful bits */ if (gravitate[g]) RegionSubtract(oldRegion, oldRegion, gravitate[g]); if (gravitate2[g]) RegionSubtract(oldRegion2, oldRegion2, gravitate2[g]); /* * recompute exposed regions of child windows */ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->winGravity != g) continue; TwoRegions.over = gravitate[g]; TwoRegions.under = gravitate2[g]; TraverseTree(pChild, miOverlayRecomputeExposures, (void *) (&TwoRegions)); } /* * remove the successfully copied regions of the * window from its exposed region */ if (g == pWin->bitGravity) { if (gravitate[g]) RegionSubtract(&pWin->valdata->after.exposed, &pWin->valdata->after.exposed, gravitate[g]); if (gravitate2[g] && pTree) RegionSubtract(&pTree->valdata->exposed, &pTree->valdata->exposed, gravitate2[g]); } if (gravitate[g]) { if (!destClip) destClip = gravitate[g]; else { RegionUnion(destClip, destClip, gravitate[g]); RegionDestroy(gravitate[g]); } } if (gravitate2[g]) { if (!destClip2) destClip2 = gravitate2[g]; else { RegionUnion(destClip2, destClip2, gravitate2[g]); RegionDestroy(gravitate2[g]); } } } RegionDestroy(pRegion); RegionDestroy(oldRegion); if (doUnderlay) RegionDestroy(oldRegion2); if (destClip) RegionDestroy(destClip); if (destClip2) RegionDestroy(destClip2); (*pScreen->HandleExposures) (pWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pWin->parent, pFirstChange, VTOther); } if (pWin->realized) WindowsRestructured(); } static void miOverlaySetShape(WindowPtr pWin, int kind) { Bool WasViewable = (Bool) (pWin->viewable); ScreenPtr pScreen = pWin->drawable.pScreen; if (kind != ShapeInput) { if (WasViewable) { (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); if (HasBorder(pWin)) { RegionPtr borderVisible; borderVisible = RegionCreate(NullBox, 1); RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; pWin->valdata->before.resized = TRUE; if (IN_UNDERLAY(pWin)) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; borderVisible2 = RegionCreate(NULL, 1); RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } } } SetWinSize(pWin); SetBorderSize(pWin); ResizeChildrenWinSize(pWin, 0, 0, 0, 0); if (WasViewable) { (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); (*pScreen->ValidateTree) (pWin->parent, NullWindow, VTOther); (*pScreen->HandleExposures) (pWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pWin->parent, NullWindow, VTOther); } } if (pWin->realized) WindowsRestructured(); CheckCursorConfinement(pWin); } static void miOverlayChangeBorderWidth(WindowPtr pWin, unsigned int width) { int oldwidth; ScreenPtr pScreen; Bool WasViewable = (Bool) (pWin->viewable); Bool HadBorder; oldwidth = wBorderWidth(pWin); if (oldwidth == width) return; HadBorder = HasBorder(pWin); pScreen = pWin->drawable.pScreen; if (WasViewable && (width < oldwidth)) (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); pWin->borderWidth = width; SetBorderSize(pWin); if (WasViewable) { if (width > oldwidth) { (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); if (HadBorder) { RegionPtr borderVisible; borderVisible = RegionCreate(NULL, 1); RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; if (IN_UNDERLAY(pWin)) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; borderVisible2 = RegionCreate(NULL, 1); RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } } } (*pScreen->ValidateTree) (pWin->parent, pWin, VTOther); (*pScreen->HandleExposures) (pWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pWin->parent, pWin, VTOther); } if (pWin->realized) WindowsRestructured(); } /* We need this as an addition since the xf86 common code doesn't know about the second tree which is static to this file. */ void miOverlaySetRootClip(ScreenPtr pScreen, Bool enable) { WindowPtr pRoot = pScreen->root; miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pRoot); MARK_UNDERLAY(pRoot); if (enable) { BoxRec box; box.x1 = 0; box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; RegionReset(&pTree->borderClip, &box); } else RegionEmpty(&pTree->borderClip); RegionBreak(&pTree->clipList); } static void miOverlayClearToBackground(WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); BoxRec box; RegionRec reg; ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); RegionPtr clipList; BoxPtr extents; int x1, y1, x2, y2; x1 = pWin->drawable.x + x; y1 = pWin->drawable.y + y; if (w) x2 = x1 + (int) w; else x2 = x1 + (int) pWin->drawable.width - (int) x; if (h) y2 = y1 + h; else y2 = y1 + (int) pWin->drawable.height - (int) y; clipList = ((*pScreenPriv->InOverlay) (pWin)) ? &pWin->clipList : &pTree->clipList; extents = RegionExtents(clipList); if (x1 < extents->x1) x1 = extents->x1; if (x2 > extents->x2) x2 = extents->x2; if (y1 < extents->y1) y1 = extents->y1; if (y2 > extents->y2) y2 = extents->y2; if (x2 <= x1 || y2 <= y1) x2 = x1 = y2 = y1 = 0; box.x1 = x1; box.x2 = x2; box.y1 = y1; box.y2 = y2; RegionInit(®, &box, 1); RegionIntersect(®, ®, clipList); if (generateExposures) (*pScreen->WindowExposures) (pWin, ®); else if (pWin->backgroundState != None) miPaintWindow(pWin, ®, PW_BACKGROUND); RegionUninit(®); } /****************************************************************/ /* not used */ Bool miOverlayGetPrivateClips(WindowPtr pWin, RegionPtr *borderClip, RegionPtr *clipList) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); if (pTree) { *borderClip = &(pTree->borderClip); *clipList = &(pTree->clipList); return TRUE; } *borderClip = *clipList = NULL; return FALSE; } void miOverlaySetTransFunction(ScreenPtr pScreen, miOverlayTransFunc transFunc) { MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent = transFunc; } Bool miOverlayCopyUnderlay(ScreenPtr pScreen) { return MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->copyUnderlay; } void miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr pregWin; Bool freeTmpClip, freeCompClip; if (!pTree) { miComputeCompositeClip(pGC, &pWin->drawable); return; } if (pGC->subWindowMode == IncludeInferiors) { pregWin = RegionCreate(NullBox, 1); freeTmpClip = TRUE; if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) || !HasSaverWindow(pGC->pScreen)) { RegionIntersect(pregWin, &pTree->borderClip, &pWin->winSize); } } else { pregWin = &pTree->clipList; freeTmpClip = FALSE; } freeCompClip = pGC->freeCompClip; if (!pGC->clientClip) { if (freeCompClip) RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } else { RegionTranslate(pGC->clientClip, pWin->drawable.x + pGC->clipOrg.x, pWin->drawable.y + pGC->clipOrg.y); if (freeCompClip) { RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) RegionDestroy(pregWin); } else if (freeTmpClip) { RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { pGC->pCompositeClip = RegionCreate(NullBox, 0); RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; RegionTranslate(pGC->clientClip, -(pWin->drawable.x + pGC->clipOrg.x), -(pWin->drawable.y + pGC->clipOrg.y)); } } Bool miOverlayCollectUnderlayRegions(WindowPtr pWin, RegionPtr *region) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); if (pTree) { *region = &pTree->borderClip; return FALSE; } *region = RegionCreate(NullBox, 0); CollectUnderlayChildrenRegions(pWin, *region); return TRUE; } static miOverlayTreePtr DoLeaf(WindowPtr pWin, miOverlayTreePtr parent, miOverlayTreePtr prevSib) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); pTree->parent = parent; pTree->firstChild = NULL; pTree->lastChild = NULL; pTree->prevSib = prevSib; pTree->nextSib = NULL; if (prevSib) prevSib->nextSib = pTree; if (!parent->firstChild) parent->firstChild = parent->lastChild = pTree; else if (parent->lastChild == prevSib) parent->lastChild = pTree; return pTree; } static void RebuildTree(WindowPtr pWin) { miOverlayTreePtr parent, prevSib, tChild; WindowPtr pChild; prevSib = tChild = NULL; pWin = pWin->parent; while (IN_OVERLAY(pWin)) pWin = pWin->parent; parent = MIOVERLAY_GET_WINDOW_TREE(pWin); pChild = pWin->firstChild; parent->firstChild = parent->lastChild = NULL; while (1) { if (IN_UNDERLAY(pChild)) prevSib = tChild = DoLeaf(pChild, parent, prevSib); if (pChild->firstChild) { if (IN_UNDERLAY(pChild)) { parent = tChild; prevSib = NULL; } pChild = pChild->firstChild; continue; } while (!pChild->nextSib) { pChild = pChild->parent; if (pChild == pWin) return; if (IN_UNDERLAY(pChild)) { prevSib = tChild = MIOVERLAY_GET_WINDOW_TREE(pChild); parent = tChild->parent; } } pChild = pChild->nextSib; } } static Bool HasUnderlayChildren(WindowPtr pWin) { WindowPtr pChild; if (!(pChild = pWin->firstChild)) return FALSE; while (1) { if (IN_UNDERLAY(pChild)) return TRUE; if (pChild->firstChild) { pChild = pChild->firstChild; continue; } while (!pChild->nextSib && (pWin != pChild)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } return FALSE; } static Bool CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) { WindowPtr pChild; miOverlayTreePtr pTree; Bool hasUnderlay; if (!(pChild = pWin->firstChild)) return FALSE; hasUnderlay = FALSE; while (1) { if ((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { RegionAppend(pReg, &pTree->borderClip); hasUnderlay = TRUE; } else if (pChild->firstChild) { pChild = pChild->firstChild; continue; } while (!pChild->nextSib && (pWin != pChild)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } if (hasUnderlay) { Bool overlap; RegionValidate(pReg, &overlap); } return hasUnderlay; } static void MarkUnderlayWindow(WindowPtr pWin) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); if (pTree->valdata) return; pTree->valdata = (miOverlayValDataPtr) xnfalloc(sizeof(miOverlayValDataRec)); pTree->valdata->oldAbsCorner.x = pWin->drawable.x; pTree->valdata->oldAbsCorner.y = pWin->drawable.y; pTree->valdata->borderVisible = NullRegion; } xorg-server-1.17.1/mi/micoord.h0000664000175100017510000000404212366751547013243 00000000000000/* * Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project shall * not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from the * XFree86 Project. * */ #ifndef _MICOORD_H_ #define _MICOORD_H_ 1 #include "servermd.h" /* Macros which handle a coordinate in a single register */ #define GetHighWord(x) (((int) (x)) >> 16) #if IMAGE_BYTE_ORDER == MSBFirst #define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i)))) #define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff)) #define intToX(i) (GetHighWord(i)) #define intToY(i) ((int) ((short) i)) #else #define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i))) #define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff)) #define intToX(i) ((int) ((short) (i))) #define intToY(i) (GetHighWord(i)) #endif #endif /* _MICOORD_H_ */ xorg-server-1.17.1/mi/mipointer.c0000664000175100017510000005556512456571574013630 00000000000000/* Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /** * @file * This file contains functions to move the pointer on the screen and/or * restrict its movement. These functions are divided into two sets: * Screen-specific functions that are used as function pointers from other * parts of the server (and end up heavily wrapped by e.g. animcur and * xfixes): * miPointerConstrainCursor * miPointerCursorLimits * miPointerDisplayCursor * miPointerRealizeCursor * miPointerUnrealizeCursor * miPointerSetCursorPosition * miRecolorCursor * miPointerDeviceInitialize * miPointerDeviceCleanup * If wrapped, these are the last element in the wrapping chain. They may * call into sprite-specific code through further function pointers though. * * The second type of functions are those that are directly called by the * DIX, DDX and some drivers. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "misc.h" #include "windowstr.h" #include "pixmapstr.h" #include "mi.h" #include "scrnintstr.h" #include "mipointrst.h" #include "cursorstr.h" #include "dixstruct.h" #include "inputstr.h" #include "inpututils.h" #include "eventstr.h" DevPrivateKeyRec miPointerScreenKeyRec; #define GetScreenPrivate(s) ((miPointerScreenPtr) \ dixLookupPrivate(&(s)->devPrivates, miPointerScreenKey)) #define SetupScreen(s) miPointerScreenPtr pScreenPriv = GetScreenPrivate(s) DevPrivateKeyRec miPointerPrivKeyRec; #define MIPOINTER(dev) \ (IsFloating(dev) ? \ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey)) static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static Bool miPointerUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static Bool miPointerDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox); static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, BoxPtr pTopLeftBox); static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent); 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 *mipointermove_events; /* for WarpPointer MotionNotifies */ Bool miPointerInitialize(ScreenPtr pScreen, miPointerSpriteFuncPtr spriteFuncs, miPointerScreenFuncPtr screenFuncs, Bool waitForUpdate) { miPointerScreenPtr pScreenPriv; if (!dixRegisterPrivateKey(&miPointerScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&miPointerPrivKeyRec, PRIVATE_DEVICE, 0)) return FALSE; pScreenPriv = malloc(sizeof(miPointerScreenRec)); if (!pScreenPriv) return FALSE; pScreenPriv->spriteFuncs = spriteFuncs; pScreenPriv->screenFuncs = screenFuncs; pScreenPriv->waitForUpdate = waitForUpdate; pScreenPriv->showTransparent = FALSE; pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = miPointerCloseScreen; dixSetPrivate(&pScreen->devPrivates, miPointerScreenKey, pScreenPriv); /* * set up screen cursor method table */ pScreen->ConstrainCursor = miPointerConstrainCursor; pScreen->CursorLimits = miPointerCursorLimits; pScreen->DisplayCursor = miPointerDisplayCursor; pScreen->RealizeCursor = miPointerRealizeCursor; pScreen->UnrealizeCursor = miPointerUnrealizeCursor; pScreen->SetCursorPosition = miPointerSetCursorPosition; pScreen->RecolorCursor = miRecolorCursor; pScreen->DeviceCursorInitialize = miPointerDeviceInitialize; pScreen->DeviceCursorCleanup = miPointerDeviceCleanup; mipointermove_events = NULL; return TRUE; } /** * Destroy screen-specific information. * * @param index Screen index of the screen in screenInfo.screens[] * @param pScreen The actual screen pointer */ static Bool miPointerCloseScreen(ScreenPtr pScreen) { SetupScreen(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; free((void *) pScreenPriv); FreeEventList(mipointermove_events, GetMaximumEventsNum()); mipointermove_events = NULL; return (*pScreen->CloseScreen) (pScreen); } /* * DIX/DDX interface routines */ static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { SetupScreen(pScreen); return (*pScreenPriv->spriteFuncs->RealizeCursor) (pDev, pScreen, pCursor); } static Bool miPointerUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { SetupScreen(pScreen); return (*pScreenPriv->spriteFuncs->UnrealizeCursor) (pDev, pScreen, pCursor); } static Bool miPointerDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { miPointerPtr pPointer; /* return for keyboards */ if (!IsPointerDevice(pDev)) return FALSE; pPointer = MIPOINTER(pDev); pPointer->pCursor = pCursor; pPointer->pScreen = pScreen; miPointerUpdateSprite(pDev); return TRUE; } /** * Set up the constraints for the given device. This function does not * actually constrain the cursor but merely copies the given box to the * internal constraint storage. * * @param pDev The device to constrain to the box * @param pBox The rectangle to constrain the cursor to * @param pScreen Used for copying screen confinement */ static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox) { miPointerPtr pPointer; pPointer = MIPOINTER(pDev); pPointer->limits = *pBox; pPointer->confined = PointerConfinedToScreen(pDev); } /** * Should calculate the box for the given cursor, based on screen and the * confinement given. But we assume that whatever box is passed in is valid * anyway. * * @param pDev The device to calculate the cursor limits for * @param pScreen The screen the confinement happens on * @param pCursor The screen the confinement happens on * @param pHotBox The confinement box for the cursor * @param[out] pTopLeftBox The new confinement box, always *pHotBox. */ static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, BoxPtr pTopLeftBox) { *pTopLeftBox = *pHotBox; } /** * Set the device's cursor position to the x/y position on the given screen. * Generates and event if required. * * This function is called from: * - sprite init code to place onto initial position * - the various WarpPointer implementations (core, XI, Xinerama, dmx,…) * - during the cursor update path in CheckMotion * - in the Xinerama part of NewCurrentScreen * - when a RandR/RandR1.2 mode was applied (it may have moved the pointer, so * it's set back to the original pos) * * @param pDev The device to move * @param pScreen The screen the device is on * @param x The x coordinate in per-screen coordinates * @param y The y coordinate in per-screen coordinates * @param generateEvent True if the pointer movement should generate an * event. * * @return TRUE in all cases */ static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent) { SetupScreen(pScreen); miPointerPtr pPointer = MIPOINTER(pDev); pPointer->generateEvent = generateEvent; if (pScreen->ConstrainCursorHarder) pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y); /* device dependent - must pend signal and call miPointerWarpCursor */ (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y); if (!generateEvent) miPointerUpdateSprite(pDev); return TRUE; } void miRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs, Bool displayed) { /* * This is guaranteed to correct any color-dependent state which may have * been bound up in private state created by RealizeCursor */ pScr->UnrealizeCursor(pDev, pScr, pCurs); pScr->RealizeCursor(pDev, pScr, pCurs); if (displayed) pScr->DisplayCursor(pDev, pScr, pCurs); } /** * Set up sprite information for the device. * This function will be called once for each device after it is initialized * in the DIX. * * @param pDev The newly created device * @param pScreen The initial sprite scree. */ static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) { miPointerPtr pPointer; SetupScreen(pScreen); pPointer = malloc(sizeof(miPointerRec)); if (!pPointer) return FALSE; pPointer->pScreen = NULL; pPointer->pSpriteScreen = NULL; pPointer->pCursor = NULL; pPointer->pSpriteCursor = NULL; pPointer->limits.x1 = 0; pPointer->limits.x2 = 32767; pPointer->limits.y1 = 0; pPointer->limits.y2 = 32767; pPointer->confined = FALSE; pPointer->x = 0; pPointer->y = 0; pPointer->generateEvent = FALSE; if (!((*pScreenPriv->spriteFuncs->DeviceCursorInitialize) (pDev, pScreen))) { free(pPointer); return FALSE; } dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, pPointer); return TRUE; } /** * Clean up after device. * This function will be called once before the device is freed in the DIX * * @param pDev The device to be removed from the server * @param pScreen Current screen of the device */ static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { SetupScreen(pScreen); if (!IsMaster(pDev) && !IsFloating(pDev)) return; (*pScreenPriv->spriteFuncs->DeviceCursorCleanup) (pDev, pScreen); free(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey)); dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL); } /** * Warp the pointer to the given position on the given screen. May generate * an event, depending on whether we're coming from miPointerSetPosition. * * Once signals are ignored, the WarpCursor function can call this * * @param pDev The device to warp * @param pScreen Screen to warp on * @param x The x coordinate in per-screen coordinates * @param y The y coordinate in per-screen coordinates */ void miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { miPointerPtr pPointer; BOOL changedScreen = FALSE; pPointer = MIPOINTER(pDev); if (pPointer->pScreen != pScreen) { mieqSwitchScreen(pDev, pScreen, TRUE); changedScreen = TRUE; } if (pPointer->generateEvent) miPointerMove(pDev, pScreen, x, y); else miPointerMoveNoEvent(pDev, pScreen, x, y); /* Don't call USFS if we use Xinerama, otherwise the root window is * updated to the second screen, and we never receive any events. * (FDO bug #18668) */ if (changedScreen #ifdef PANORAMIX && noPanoramiXExtension #endif ) UpdateSpriteForScreen(pDev, pScreen); } /** * Syncronize the sprite with the cursor. * * @param pDev The device to sync */ void miPointerUpdateSprite(DeviceIntPtr pDev) { ScreenPtr pScreen; miPointerScreenPtr pScreenPriv; CursorPtr pCursor; int x, y, devx, devy; miPointerPtr pPointer; if (!pDev || !pDev->coreEvents) return; pPointer = MIPOINTER(pDev); if (!pPointer) return; pScreen = pPointer->pScreen; if (!pScreen) return; x = pPointer->x; y = pPointer->y; devx = pPointer->devx; devy = pPointer->devy; pScreenPriv = GetScreenPrivate(pScreen); /* * if the cursor has switched screens, disable the sprite * on the old screen */ if (pScreen != pPointer->pSpriteScreen) { if (pPointer->pSpriteScreen) { miPointerScreenPtr pOldPriv; pOldPriv = GetScreenPrivate(pPointer->pSpriteScreen); if (pPointer->pCursor) { (*pOldPriv->spriteFuncs->SetCursor) (pDev, pPointer->pSpriteScreen, NullCursor, 0, 0); } (*pOldPriv->screenFuncs->CrossScreen) (pPointer->pSpriteScreen, FALSE); } (*pScreenPriv->screenFuncs->CrossScreen) (pScreen, TRUE); (*pScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pPointer->pCursor, x, y); pPointer->devx = x; pPointer->devy = y; pPointer->pSpriteCursor = pPointer->pCursor; pPointer->pSpriteScreen = pScreen; } /* * if the cursor has changed, display the new one */ else if (pPointer->pCursor != pPointer->pSpriteCursor) { pCursor = pPointer->pCursor; if (!pCursor || (pCursor->bits->emptyMask && !pScreenPriv->showTransparent)) pCursor = NullCursor; (*pScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCursor, x, y); pPointer->devx = x; pPointer->devy = y; pPointer->pSpriteCursor = pPointer->pCursor; } else if (x != devx || y != devy) { pPointer->devx = x; pPointer->devy = y; if (pPointer->pCursor && !pPointer->pCursor->bits->emptyMask) (*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y); } } /** * Set the device to the coordinates on the given screen. * * @param pDev The device to move * @param screen_no Index of the screen to move to * @param x The x coordinate in per-screen coordinates * @param y The y coordinate in per-screen coordinates */ void miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) { ScreenPtr pScreen; miPointerPtr pPointer; pPointer = MIPOINTER(pDev); pScreen = screenInfo.screens[screen_no]; mieqSwitchScreen(pDev, pScreen, FALSE); NewCurrentScreen(pDev, pScreen, x, y); pPointer->limits.x2 = pScreen->width; pPointer->limits.y2 = pScreen->height; } /** * @return The current screen of the given device or NULL. */ ScreenPtr miPointerGetScreen(DeviceIntPtr pDev) { miPointerPtr pPointer = MIPOINTER(pDev); return (pPointer) ? pPointer->pScreen : NULL; } /* Controls whether the cursor image should be updated immediately when moved (FALSE) or if something else will be responsible for updating it later (TRUE). Returns current setting. Caller is responsible for calling OsBlockSignal first. */ Bool miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait) { SetupScreen(pScreen); Bool prevWait = pScreenPriv->waitForUpdate; pScreenPriv->waitForUpdate = wait; return prevWait; } /* Move the pointer on the current screen, and update the sprite. */ static void miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { miPointerPtr pPointer; SetupScreen(pScreen); pPointer = MIPOINTER(pDev); /* Hack: We mustn't call into ->MoveCursor for anything but the * VCP, as this may cause a non-HW rendered cursor to be rendered during * SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT. */ if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer &&!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) { pPointer->devx = x; pPointer->devy = y; if (pPointer->pCursor && !pPointer->pCursor->bits->emptyMask) (*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y); } pPointer->x = x; pPointer->y = y; pPointer->pScreen = pScreen; } /** * Set the devices' cursor position to the given x/y position. * * This function is called during the pointer update path in * GetPointerEvents and friends (and the same in the xwin DDX). * * The coordinates provided are always absolute. The parameter mode whether * it was relative or absolute movement that landed us at those coordinates. * * If the cursor was constrained by a barrier, ET_Barrier* events may be * generated and appended to the InternalEvent list provided. * * @param pDev The device to move * @param mode Movement mode (Absolute or Relative) * @param[in,out] screenx The x coordinate in desktop coordinates * @param[in,out] screeny The y coordinate in desktop coordinates * @param[in,out] nevents The number of events in events (before/after) * @param[in,out] events The list of events before/after being constrained */ ScreenPtr miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, 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; pPointer = MIPOINTER(pDev); pScreen = pPointer->pScreen; x = trunc(*screenx); y = trunc(*screeny); switch_screen = !point_on_screen(pScreen, x, y); /* Switch to per-screen coordinates for CursorOffScreen and * Pointer->limits */ 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->x; current_y = MIPOINTER(pDev)->y - pScreen->y; 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) { newScreen = pScreen; (*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, &x, &y); if (newScreen != pScreen) { pScreen = newScreen; mieqSwitchScreen(pDev, pScreen, FALSE); /* Smash the confine to the new screen */ pPointer->limits.x2 = pScreen->width; pPointer->limits.y2 = pScreen->height; } } } /* Constrain the sprite to the current limits. */ if (x < pPointer->limits.x1) x = pPointer->limits.x1; if (x >= pPointer->limits.x2) x = pPointer->limits.x2 - 1; if (y < pPointer->limits.y1) y = pPointer->limits.y1; if (y >= pPointer->limits.y2) y = pPointer->limits.y2 - 1; if (pScreen->ConstrainCursorHarder) pScreen->ConstrainCursorHarder(pDev, pScreen, mode, &x, &y); 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; /* In the event we actually change screen or we get confined, we just * drop the float component on the floor * FIXME: only drop remainder for ConstrainCursorHarder, not for screen * crossings */ if (x != trunc(*screenx)) *screenx = x; if (y != trunc(*screeny)) *screeny = y; return pScreen; } /** * Get the current position of the device in desktop coordinates. * * @param x Return value for the current x coordinate in desktop coordiates. * @param y Return value for the current y coordinate in desktop coordiates. */ void miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y) { *x = MIPOINTER(pDev)->x; *y = MIPOINTER(pDev)->y; } #ifdef XQUARTZ #include void darwinEvents_lock(void); void darwinEvents_unlock(void); #endif /** * Move the device's pointer to the x/y coordinates on the given screen. * This function generates and enqueues pointer events. * * @param pDev The device to move * @param pScreen The screen the device is on * @param x The x coordinate in per-screen coordinates * @param y The y coordinate in per-screen coordinates */ void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { int i, nevents; int valuators[2]; ValuatorMask mask; miPointerMoveNoEvent(pDev, pScreen, x, y); /* generate motion notify */ valuators[0] = x; valuators[1] = y; if (!mipointermove_events) { mipointermove_events = InitEventList(GetMaximumEventsNum()); if (!mipointermove_events) { FatalError("Could not allocate event store.\n"); return; } } valuator_mask_set_range(&mask, 0, 2, valuators); nevents = GetPointerEvents(mipointermove_events, pDev, MotionNotify, 0, POINTER_SCREEN | POINTER_ABSOLUTE | POINTER_NORAW, &mask); OsBlockSignals(); #ifdef XQUARTZ darwinEvents_lock(); #endif for (i = 0; i < nevents; i++) mieqEnqueue(pDev, &mipointermove_events[i]); #ifdef XQUARTZ darwinEvents_unlock(); #endif OsReleaseSignals(); } xorg-server-1.17.1/mi/mizerclip.c0000664000175100017510000005257312456571574013614 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "misc.h" #include "scrnintstr.h" #include "gcstruct.h" #include "windowstr.h" #include "pixmap.h" #include "mi.h" #include "miline.h" /* The bresenham error equation used in the mi/mfb/cfb line routines is: e = error dx = difference in raw X coordinates dy = difference in raw Y coordinates M = # of steps in X direction N = # of steps in Y direction B = 0 to prefer diagonal steps in a given octant, 1 to prefer axial steps in a given octant For X major lines: e = 2Mdy - 2Ndx - dx - B -2dx <= e < 0 For Y major lines: e = 2Ndx - 2Mdy - dy - B -2dy <= e < 0 At the start of the line, we have taken 0 X steps and 0 Y steps, so M = 0 and N = 0: X major e = 2Mdy - 2Ndx - dx - B = -dx - B Y major e = 2Ndx - 2Mdy - dy - B = -dy - B At the end of the line, we have taken dx X steps and dy Y steps, so M = dx and N = dy: X major e = 2Mdy - 2Ndx - dx - B = 2dxdy - 2dydx - dx - B = -dx - B Y major e = 2Ndx - 2Mdy - dy - B = 2dydx - 2dxdy - dy - B = -dy - B Thus, the error term is the same at the start and end of the line. Let us consider clipping an X coordinate. There are 4 cases which represent the two independent cases of clipping the start vs. the end of the line and an X major vs. a Y major line. In any of these cases, we know the number of X steps (M) and we wish to find the number of Y steps (N). Thus, we will solve our error term equation. If we are clipping the start of the line, we will find the smallest N that satisfies our error term inequality. If we are clipping the end of the line, we will find the largest number of Y steps that satisfies the inequality. In that case, since we are representing the Y steps as (dy - N), we will actually want to solve for the smallest N in that equation. Case 1: X major, starting X coordinate moved by M steps -2dx <= 2Mdy - 2Ndx - dx - B < 0 2Ndx <= 2Mdy - dx - B + 2dx 2Ndx > 2Mdy - dx - B 2Ndx <= 2Mdy + dx - B N > (2Mdy - dx - B) / 2dx N <= (2Mdy + dx - B) / 2dx Since we are trying to find the smallest N that satisfies these equations, we should use the > inequality to find the smallest: N = floor((2Mdy - dx - B) / 2dx) + 1 = floor((2Mdy - dx - B + 2dx) / 2dx) = floor((2Mdy + dx - B) / 2dx) Case 1b: X major, ending X coordinate moved to M steps Same derivations as Case 1, but we want the largest N that satisfies the equations, so we use the <= inequality: N = floor((2Mdy + dx - B) / 2dx) Case 2: X major, ending X coordinate moved by M steps -2dx <= 2(dx - M)dy - 2(dy - N)dx - dx - B < 0 -2dx <= 2dxdy - 2Mdy - 2dxdy + 2Ndx - dx - B < 0 -2dx <= 2Ndx - 2Mdy - dx - B < 0 2Ndx >= 2Mdy + dx + B - 2dx 2Ndx < 2Mdy + dx + B 2Ndx >= 2Mdy - dx + B N < (2Mdy + dx + B) / 2dx N >= (2Mdy - dx + B) / 2dx Since we are trying to find the highest number of Y steps that satisfies these equations, we need to find the smallest N, so we should use the >= inequality to find the smallest: N = ceiling((2Mdy - dx + B) / 2dx) = floor((2Mdy - dx + B + 2dx - 1) / 2dx) = floor((2Mdy + dx + B - 1) / 2dx) Case 2b: X major, starting X coordinate moved to M steps from end Same derivations as Case 2, but we want the smallest number of Y steps, so we want the highest N, so we use the < inequality: N = ceiling((2Mdy + dx + B) / 2dx) - 1 = floor((2Mdy + dx + B + 2dx - 1) / 2dx) - 1 = floor((2Mdy + dx + B + 2dx - 1 - 2dx) / 2dx) = floor((2Mdy + dx + B - 1) / 2dx) Case 3: Y major, starting X coordinate moved by M steps -2dy <= 2Ndx - 2Mdy - dy - B < 0 2Ndx >= 2Mdy + dy + B - 2dy 2Ndx < 2Mdy + dy + B 2Ndx >= 2Mdy - dy + B N < (2Mdy + dy + B) / 2dx N >= (2Mdy - dy + B) / 2dx Since we are trying to find the smallest N that satisfies these equations, we should use the >= inequality to find the smallest: N = ceiling((2Mdy - dy + B) / 2dx) = floor((2Mdy - dy + B + 2dx - 1) / 2dx) = floor((2Mdy - dy + B - 1) / 2dx) + 1 Case 3b: Y major, ending X coordinate moved to M steps Same derivations as Case 3, but we want the largest N that satisfies the equations, so we use the < inequality: N = ceiling((2Mdy + dy + B) / 2dx) - 1 = floor((2Mdy + dy + B + 2dx - 1) / 2dx) - 1 = floor((2Mdy + dy + B + 2dx - 1 - 2dx) / 2dx) = floor((2Mdy + dy + B - 1) / 2dx) Case 4: Y major, ending X coordinate moved by M steps -2dy <= 2(dy - N)dx - 2(dx - M)dy - dy - B < 0 -2dy <= 2dxdy - 2Ndx - 2dxdy + 2Mdy - dy - B < 0 -2dy <= 2Mdy - 2Ndx - dy - B < 0 2Ndx <= 2Mdy - dy - B + 2dy 2Ndx > 2Mdy - dy - B 2Ndx <= 2Mdy + dy - B N > (2Mdy - dy - B) / 2dx N <= (2Mdy + dy - B) / 2dx Since we are trying to find the highest number of Y steps that satisfies these equations, we need to find the smallest N, so we should use the > inequality to find the smallest: N = floor((2Mdy - dy - B) / 2dx) + 1 Case 4b: Y major, starting X coordinate moved to M steps from end Same analysis as Case 4, but we want the smallest number of Y steps which means the largest N, so we use the <= inequality: N = floor((2Mdy + dy - B) / 2dx) Now let's try the Y coordinates, we have the same 4 cases. Case 5: X major, starting Y coordinate moved by N steps -2dx <= 2Mdy - 2Ndx - dx - B < 0 2Mdy >= 2Ndx + dx + B - 2dx 2Mdy < 2Ndx + dx + B 2Mdy >= 2Ndx - dx + B M < (2Ndx + dx + B) / 2dy M >= (2Ndx - dx + B) / 2dy Since we are trying to find the smallest M, we use the >= inequality: M = ceiling((2Ndx - dx + B) / 2dy) = floor((2Ndx - dx + B + 2dy - 1) / 2dy) = floor((2Ndx - dx + B - 1) / 2dy) + 1 Case 5b: X major, ending Y coordinate moved to N steps Same derivations as Case 5, but we want the largest M that satisfies the equations, so we use the < inequality: M = ceiling((2Ndx + dx + B) / 2dy) - 1 = floor((2Ndx + dx + B + 2dy - 1) / 2dy) - 1 = floor((2Ndx + dx + B + 2dy - 1 - 2dy) / 2dy) = floor((2Ndx + dx + B - 1) / 2dy) Case 6: X major, ending Y coordinate moved by N steps -2dx <= 2(dx - M)dy - 2(dy - N)dx - dx - B < 0 -2dx <= 2dxdy - 2Mdy - 2dxdy + 2Ndx - dx - B < 0 -2dx <= 2Ndx - 2Mdy - dx - B < 0 2Mdy <= 2Ndx - dx - B + 2dx 2Mdy > 2Ndx - dx - B 2Mdy <= 2Ndx + dx - B M > (2Ndx - dx - B) / 2dy M <= (2Ndx + dx - B) / 2dy Largest # of X steps means smallest M, so use the > inequality: M = floor((2Ndx - dx - B) / 2dy) + 1 Case 6b: X major, starting Y coordinate moved to N steps from end Same derivations as Case 6, but we want the smallest # of X steps which means the largest M, so use the <= inequality: M = floor((2Ndx + dx - B) / 2dy) Case 7: Y major, starting Y coordinate moved by N steps -2dy <= 2Ndx - 2Mdy - dy - B < 0 2Mdy <= 2Ndx - dy - B + 2dy 2Mdy > 2Ndx - dy - B 2Mdy <= 2Ndx + dy - B M > (2Ndx - dy - B) / 2dy M <= (2Ndx + dy - B) / 2dy To find the smallest M, use the > inequality: M = floor((2Ndx - dy - B) / 2dy) + 1 = floor((2Ndx - dy - B + 2dy) / 2dy) = floor((2Ndx + dy - B) / 2dy) Case 7b: Y major, ending Y coordinate moved to N steps Same derivations as Case 7, but we want the largest M that satisfies the equations, so use the <= inequality: M = floor((2Ndx + dy - B) / 2dy) Case 8: Y major, ending Y coordinate moved by N steps -2dy <= 2(dy - N)dx - 2(dx - M)dy - dy - B < 0 -2dy <= 2dxdy - 2Ndx - 2dxdy + 2Mdy - dy - B < 0 -2dy <= 2Mdy - 2Ndx - dy - B < 0 2Mdy >= 2Ndx + dy + B - 2dy 2Mdy < 2Ndx + dy + B 2Mdy >= 2Ndx - dy + B M < (2Ndx + dy + B) / 2dy M >= (2Ndx - dy + B) / 2dy To find the highest X steps, find the smallest M, use the >= inequality: M = ceiling((2Ndx - dy + B) / 2dy) = floor((2Ndx - dy + B + 2dy - 1) / 2dy) = floor((2Ndx + dy + B - 1) / 2dy) Case 8b: Y major, starting Y coordinate moved to N steps from the end Same derivations as Case 8, but we want to find the smallest # of X steps which means the largest M, so we use the < inequality: M = ceiling((2Ndx + dy + B) / 2dy) - 1 = floor((2Ndx + dy + B + 2dy - 1) / 2dy) - 1 = floor((2Ndx + dy + B + 2dy - 1 - 2dy) / 2dy) = floor((2Ndx + dy + B - 1) / 2dy) So, our equations are: 1: X major move x1 to x1+M floor((2Mdy + dx - B) / 2dx) 1b: X major move x2 to x1+M floor((2Mdy + dx - B) / 2dx) 2: X major move x2 to x2-M floor((2Mdy + dx + B - 1) / 2dx) 2b: X major move x1 to x2-M floor((2Mdy + dx + B - 1) / 2dx) 3: Y major move x1 to x1+M floor((2Mdy - dy + B - 1) / 2dx) + 1 3b: Y major move x2 to x1+M floor((2Mdy + dy + B - 1) / 2dx) 4: Y major move x2 to x2-M floor((2Mdy - dy - B) / 2dx) + 1 4b: Y major move x1 to x2-M floor((2Mdy + dy - B) / 2dx) 5: X major move y1 to y1+N floor((2Ndx - dx + B - 1) / 2dy) + 1 5b: X major move y2 to y1+N floor((2Ndx + dx + B - 1) / 2dy) 6: X major move y2 to y2-N floor((2Ndx - dx - B) / 2dy) + 1 6b: X major move y1 to y2-N floor((2Ndx + dx - B) / 2dy) 7: Y major move y1 to y1+N floor((2Ndx + dy - B) / 2dy) 7b: Y major move y2 to y1+N floor((2Ndx + dy - B) / 2dy) 8: Y major move y2 to y2-N floor((2Ndx + dy + B - 1) / 2dy) 8b: Y major move y1 to y2-N floor((2Ndx + dy + B - 1) / 2dy) We have the following constraints on all of the above terms: 0 < M,N <= 2^15 2^15 can be imposed by miZeroClipLine 0 <= dx/dy <= 2^16 - 1 0 <= B <= 1 The floor in all of the above equations can be accomplished with a simple C divide operation provided that both numerator and denominator are positive. Since dx,dy >= 0 and since moving an X coordinate implies that dx != 0 and moving a Y coordinate implies dy != 0, we know that the denominators are all > 0. For all lines, (-B) and (B-1) are both either 0 or -1, depending on the bias. Thus, we have to show that the 2MNdxy +/- dxy terms are all >= 1 or > 0 to prove that the numerators are positive (or zero). For X Major lines we know that dx > 0 and since 2Mdy is >= 0 due to the constraints, the first four equations all have numerators >= 0. For the second four equations, M > 0, so 2Mdy >= 2dy so (2Mdy - dy) >= dy So (2Mdy - dy) > 0, since they are Y major lines. Also, (2Mdy + dy) >= 3dy or (2Mdy + dy) > 0. So all of their numerators are >= 0. For the third set of four equations, N > 0, so 2Ndx >= 2dx so (2Ndx - dx) >= dx > 0. Similarly (2Ndx + dx) >= 3dx > 0. So all numerators >= 0. For the fourth set of equations, dy > 0 and 2Ndx >= 0, so all numerators are > 0. To consider overflow, consider the case of 2 * M,N * dx,dy + dx,dy. This is bounded <= 2 * 2^15 * (2^16 - 1) + (2^16 - 1) <= 2^16 * (2^16 - 1) + (2^16 - 1) <= 2^32 - 2^16 + 2^16 - 1 <= 2^32 - 1 Since the (-B) and (B-1) terms are all 0 or -1, the maximum value of the numerator is therefore (2^32 - 1), which does not overflow an unsigned 32 bit variable. */ /* Bit codes for the terms of the 16 clipping equations defined below. */ #define T_2NDX (1 << 0) #define T_2MDY (0) /* implicit term */ #define T_DXNOTY (1 << 1) #define T_DYNOTX (0) /* implicit term */ #define T_SUBDXORY (1 << 2) #define T_ADDDX (T_DXNOTY) /* composite term */ #define T_SUBDX (T_DXNOTY | T_SUBDXORY) /* composite term */ #define T_ADDDY (T_DYNOTX) /* composite term */ #define T_SUBDY (T_DYNOTX | T_SUBDXORY) /* composite term */ #define T_BIASSUBONE (1 << 3) #define T_SUBBIAS (0) /* implicit term */ #define T_DIV2DX (1 << 4) #define T_DIV2DY (0) /* implicit term */ #define T_ADDONE (1 << 5) /* Bit masks defining the 16 equations used in miZeroClipLine. */ #define EQN1 (T_2MDY | T_ADDDX | T_SUBBIAS | T_DIV2DX) #define EQN1B (T_2MDY | T_ADDDX | T_SUBBIAS | T_DIV2DX) #define EQN2 (T_2MDY | T_ADDDX | T_BIASSUBONE | T_DIV2DX) #define EQN2B (T_2MDY | T_ADDDX | T_BIASSUBONE | T_DIV2DX) #define EQN3 (T_2MDY | T_SUBDY | T_BIASSUBONE | T_DIV2DX | T_ADDONE) #define EQN3B (T_2MDY | T_ADDDY | T_BIASSUBONE | T_DIV2DX) #define EQN4 (T_2MDY | T_SUBDY | T_SUBBIAS | T_DIV2DX | T_ADDONE) #define EQN4B (T_2MDY | T_ADDDY | T_SUBBIAS | T_DIV2DX) #define EQN5 (T_2NDX | T_SUBDX | T_BIASSUBONE | T_DIV2DY | T_ADDONE) #define EQN5B (T_2NDX | T_ADDDX | T_BIASSUBONE | T_DIV2DY) #define EQN6 (T_2NDX | T_SUBDX | T_SUBBIAS | T_DIV2DY | T_ADDONE) #define EQN6B (T_2NDX | T_ADDDX | T_SUBBIAS | T_DIV2DY) #define EQN7 (T_2NDX | T_ADDDY | T_SUBBIAS | T_DIV2DY) #define EQN7B (T_2NDX | T_ADDDY | T_SUBBIAS | T_DIV2DY) #define EQN8 (T_2NDX | T_ADDDY | T_BIASSUBONE | T_DIV2DY) #define EQN8B (T_2NDX | T_ADDDY | T_BIASSUBONE | T_DIV2DY) /* miZeroClipLine * * returns: 1 for partially clipped line * -1 for completely clipped line * */ int miZeroClipLine(int xmin, int ymin, int xmax, int ymax, int *new_x1, int *new_y1, int *new_x2, int *new_y2, unsigned int adx, unsigned int ady, int *pt1_clipped, int *pt2_clipped, int octant, unsigned int bias, int oc1, int oc2) { int swapped = 0; int clipDone = 0; CARD32 utmp = 0; int clip1, clip2; int x1, y1, x2, y2; int x1_orig, y1_orig, x2_orig, y2_orig; int xmajor; int negslope = 0, anchorval = 0; unsigned int eqn = 0; x1 = x1_orig = *new_x1; y1 = y1_orig = *new_y1; x2 = x2_orig = *new_x2; y2 = y2_orig = *new_y2; clip1 = 0; clip2 = 0; xmajor = IsXMajorOctant(octant); bias = ((bias >> octant) & 1); while (1) { if ((oc1 & oc2) != 0) { /* trivial reject */ clipDone = -1; clip1 = oc1; clip2 = oc2; break; } else if ((oc1 | oc2) == 0) { /* trivial accept */ clipDone = 1; if (swapped) { SWAPINT_PAIR(x1, y1, x2, y2); SWAPINT(clip1, clip2); } break; } else { /* have to clip */ /* only clip one point at a time */ if (oc1 == 0) { SWAPINT_PAIR(x1, y1, x2, y2); SWAPINT_PAIR(x1_orig, y1_orig, x2_orig, y2_orig); SWAPINT(oc1, oc2); SWAPINT(clip1, clip2); swapped = !swapped; } clip1 |= oc1; if (oc1 & OUT_LEFT) { negslope = IsYDecreasingOctant(octant); utmp = xmin - x1_orig; if (utmp <= 32767) { /* clip based on near endpt */ if (xmajor) eqn = (swapped) ? EQN2 : EQN1; else eqn = (swapped) ? EQN4 : EQN3; anchorval = y1_orig; } else { /* clip based on far endpt */ utmp = x2_orig - xmin; if (xmajor) eqn = (swapped) ? EQN1B : EQN2B; else eqn = (swapped) ? EQN3B : EQN4B; anchorval = y2_orig; negslope = !negslope; } x1 = xmin; } else if (oc1 & OUT_ABOVE) { negslope = IsXDecreasingOctant(octant); utmp = ymin - y1_orig; if (utmp <= 32767) { /* clip based on near endpt */ if (xmajor) eqn = (swapped) ? EQN6 : EQN5; else eqn = (swapped) ? EQN8 : EQN7; anchorval = x1_orig; } else { /* clip based on far endpt */ utmp = y2_orig - ymin; if (xmajor) eqn = (swapped) ? EQN5B : EQN6B; else eqn = (swapped) ? EQN7B : EQN8B; anchorval = x2_orig; negslope = !negslope; } y1 = ymin; } else if (oc1 & OUT_RIGHT) { negslope = IsYDecreasingOctant(octant); utmp = x1_orig - xmax; if (utmp <= 32767) { /* clip based on near endpt */ if (xmajor) eqn = (swapped) ? EQN2 : EQN1; else eqn = (swapped) ? EQN4 : EQN3; anchorval = y1_orig; } else { /* clip based on far endpt */ /* * Technically since the equations can handle * utmp == 32768, this overflow code isn't * needed since X11 protocol can't generate * a line which goes more than 32768 pixels * to the right of a clip rectangle. */ utmp = xmax - x2_orig; if (xmajor) eqn = (swapped) ? EQN1B : EQN2B; else eqn = (swapped) ? EQN3B : EQN4B; anchorval = y2_orig; negslope = !negslope; } x1 = xmax; } else if (oc1 & OUT_BELOW) { negslope = IsXDecreasingOctant(octant); utmp = y1_orig - ymax; if (utmp <= 32767) { /* clip based on near endpt */ if (xmajor) eqn = (swapped) ? EQN6 : EQN5; else eqn = (swapped) ? EQN8 : EQN7; anchorval = x1_orig; } else { /* clip based on far endpt */ /* * Technically since the equations can handle * utmp == 32768, this overflow code isn't * needed since X11 protocol can't generate * a line which goes more than 32768 pixels * below the bottom of a clip rectangle. */ utmp = ymax - y2_orig; if (xmajor) eqn = (swapped) ? EQN5B : EQN6B; else eqn = (swapped) ? EQN7B : EQN8B; anchorval = x2_orig; negslope = !negslope; } y1 = ymax; } if (swapped) negslope = !negslope; utmp <<= 1; /* utmp = 2N or 2M */ if (eqn & T_2NDX) utmp = (utmp * adx); else /* (eqn & T_2MDY) */ utmp = (utmp * ady); if (eqn & T_DXNOTY) if (eqn & T_SUBDXORY) utmp -= adx; else utmp += adx; else /* (eqn & T_DYNOTX) */ if (eqn & T_SUBDXORY) utmp -= ady; else utmp += ady; if (eqn & T_BIASSUBONE) utmp += bias - 1; else /* (eqn & T_SUBBIAS) */ utmp -= bias; if (eqn & T_DIV2DX) utmp /= (adx << 1); else /* (eqn & T_DIV2DY) */ utmp /= (ady << 1); if (eqn & T_ADDONE) utmp++; if (negslope) utmp = -utmp; if (eqn & T_2NDX) /* We are calculating X steps */ x1 = anchorval + utmp; else /* else, Y steps */ y1 = anchorval + utmp; oc1 = 0; MIOUTCODES(oc1, x1, y1, xmin, ymin, xmax, ymax); } } *new_x1 = x1; *new_y1 = y1; *new_x2 = x2; *new_y2 = y2; *pt1_clipped = clip1; *pt2_clipped = clip2; return clipDone; } xorg-server-1.17.1/mi/mipolytext.c0000664000175100017510000001143312456571574014022 00000000000000/******************************************************************* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ************************************************************************/ /* * mipolytext.c - text routines * * Author: haynes * Digital Equipment Corporation * Western Software Laboratory * Date: Thu Feb 5 1987 */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "misc.h" #include "gcstruct.h" #include #include "dixfontstr.h" #include "mi.h" int miPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) { unsigned long n, i; int w; CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ GetGlyphs(pGC->font, (unsigned long) count, (unsigned char *) chars, Linear8Bit, &n, charinfo); w = 0; for (i = 0; i < n; i++) w += charinfo[i]->metrics.characterWidth; if (n != 0) (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font)); return x + w; } int miPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars) { unsigned long n, i; int w; CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ GetGlyphs(pGC->font, (unsigned long) count, (unsigned char *) chars, (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit, &n, charinfo); w = 0; for (i = 0; i < n; i++) w += charinfo[i]->metrics.characterWidth; if (n != 0) (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font)); return x + w; } void miImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) { unsigned long n; FontPtr font = pGC->font; CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ GetGlyphs(font, (unsigned long) count, (unsigned char *) chars, Linear8Bit, &n, charinfo); if (n != 0) (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font)); } void miImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars) { unsigned long n; FontPtr font = pGC->font; CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ GetGlyphs(font, (unsigned long) count, (unsigned char *) chars, (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit, &n, charinfo); if (n != 0) (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font)); } xorg-server-1.17.1/mi/migc.h0000664000175100017510000000373712274325511012522 00000000000000/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ extern _X_EXPORT void miChangeGC(GCPtr pGC, unsigned long mask); extern _X_EXPORT void miDestroyGC(GCPtr pGC); extern _X_EXPORT void miDestroyClip(GCPtr pGC); extern _X_EXPORT void miChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); extern _X_EXPORT void miCopyClip(GCPtr pgcDst, GCPtr pgcSrc); extern _X_EXPORT void miCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst); extern _X_EXPORT void miComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable); xorg-server-1.17.1/mi/mipointrst.h0000664000175100017510000000432312274325511014003 00000000000000/* * mipointrst.h * */ /* Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef MIPOINTRST_H #define MIPOINTRST_H #include "mipointer.h" #include "scrnintstr.h" typedef struct { ScreenPtr pScreen; /* current screen */ ScreenPtr pSpriteScreen; /* screen containing current sprite */ CursorPtr pCursor; /* current cursor */ CursorPtr pSpriteCursor; /* cursor on screen */ BoxRec limits; /* current constraints */ Bool confined; /* pointer can't change screens */ int x, y; /* hot spot location */ int devx, devy; /* sprite position */ Bool generateEvent; /* generate an event during warping? */ } miPointerRec, *miPointerPtr; typedef struct { miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */ miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */ CloseScreenProcPtr CloseScreen; Bool waitForUpdate; /* don't move cursor in SIGIO */ Bool showTransparent; /* show empty cursors */ } miPointerScreenRec, *miPointerScreenPtr; #endif /* MIPOINTRST_H */ xorg-server-1.17.1/mi/mipoly.c0000664000175100017510000005150112456571574013115 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* * mipoly.c * * Written by Brian Kelleher; June 1986 */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "windowstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "mi.h" #include "miscanfill.h" #include "mipoly.h" #include "regionstr.h" /* * Insert the given edge into the edge table. First we must find the correct * bucket in the Edge table, then find the right slot in the bucket. Finally, * we can insert it. */ static Bool miInsertEdgeInET(EdgeTable * ET, EdgeTableEntry * ETE, int scanline, ScanLineListBlock ** SLLBlock, int *iSLLBlock) { EdgeTableEntry *start, *prev; ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; /* * find the right bucket to put the edge into */ pPrevSLL = &ET->scanlines; pSLL = pPrevSLL->next; while (pSLL && (pSLL->scanline < scanline)) { pPrevSLL = pSLL; pSLL = pSLL->next; } /* * reassign pSLL (pointer to ScanLineList) if necessary */ if ((!pSLL) || (pSLL->scanline > scanline)) { if (*iSLLBlock > SLLSPERBLOCK - 1) { tmpSLLBlock = malloc(sizeof(ScanLineListBlock)); if (!tmpSLLBlock) return FALSE; (*SLLBlock)->next = tmpSLLBlock; tmpSLLBlock->next = NULL; *SLLBlock = tmpSLLBlock; *iSLLBlock = 0; } pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]); pSLL->next = pPrevSLL->next; pSLL->edgelist = NULL; pPrevSLL->next = pSLL; } pSLL->scanline = scanline; /* * now insert the edge in the right bucket */ prev = NULL; start = pSLL->edgelist; while (start && (start->bres.minor < ETE->bres.minor)) { prev = start; start = start->next; } ETE->next = start; if (prev) prev->next = ETE; else pSLL->edgelist = ETE; return TRUE; } static void miFreeStorage(ScanLineListBlock * pSLLBlock) { ScanLineListBlock *tmpSLLBlock; while (pSLLBlock) { tmpSLLBlock = pSLLBlock->next; free(pSLLBlock); pSLLBlock = tmpSLLBlock; } } /* * CreateEdgeTable * * This routine creates the edge table for scan converting polygons. * The Edge Table (ET) looks like: * * EdgeTable * -------- * | ymax | ScanLineLists * |scanline|-->------------>-------------->... * -------- |scanline| |scanline| * |edgelist| |edgelist| * --------- --------- * | | * | | * V V * list of ETEs list of ETEs * * where ETE is an EdgeTableEntry data structure, and there is one ScanLineList * per scanline at which an edge is initially entered. */ static Bool miCreateETandAET(int count, DDXPointPtr pts, EdgeTable * ET, EdgeTableEntry * AET, EdgeTableEntry * pETEs, ScanLineListBlock * pSLLBlock) { DDXPointPtr top, bottom; DDXPointPtr PrevPt, CurrPt; int iSLLBlock = 0; int dy; if (count < 2) return TRUE; /* * initialize the Active Edge Table */ AET->next = NULL; AET->back = NULL; AET->nextWETE = NULL; AET->bres.minor = MININT; /* * initialize the Edge Table. */ ET->scanlines.next = NULL; ET->ymax = MININT; ET->ymin = MAXINT; pSLLBlock->next = NULL; PrevPt = &pts[count - 1]; /* * for each vertex in the array of points. * In this loop we are dealing with two vertices at * a time -- these make up one edge of the polygon. */ while (count--) { CurrPt = pts++; /* * find out which point is above and which is below. */ if (PrevPt->y > CurrPt->y) { bottom = PrevPt, top = CurrPt; pETEs->ClockWise = 0; } else { bottom = CurrPt, top = PrevPt; pETEs->ClockWise = 1; } /* * don't add horizontal edges to the Edge table. */ if (bottom->y != top->y) { pETEs->ymax = bottom->y - 1; /* -1 so we don't get last scanline */ /* * initialize integer edge algorithm */ dy = bottom->y - top->y; BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres); if (!miInsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock)) { miFreeStorage(pSLLBlock->next); return FALSE; } ET->ymax = max(ET->ymax, PrevPt->y); ET->ymin = min(ET->ymin, PrevPt->y); pETEs++; } PrevPt = CurrPt; } return TRUE; } /* * This routine moves EdgeTableEntries from the EdgeTable into the Active Edge * Table, leaving them sorted by smaller x coordinate. */ static void miloadAET(EdgeTableEntry * AET, EdgeTableEntry * ETEs) { EdgeTableEntry *pPrevAET; EdgeTableEntry *tmp; pPrevAET = AET; AET = AET->next; while (ETEs) { while (AET && (AET->bres.minor < ETEs->bres.minor)) { pPrevAET = AET; AET = AET->next; } tmp = ETEs->next; ETEs->next = AET; if (AET) AET->back = ETEs; ETEs->back = pPrevAET; pPrevAET->next = ETEs; pPrevAET = ETEs; ETEs = tmp; } } /* * computeWAET * * This routine links the AET by the nextWETE (winding EdgeTableEntry) link for * use by the winding number rule. The final Active Edge Table (AET) might * look something like: * * AET * ---------- --------- --------- * |ymax | |ymax | |ymax | * | ... | |... | |... | * |next |->|next |->|next |->... * |nextWETE| |nextWETE| |nextWETE| * --------- --------- ^-------- * | | | * V-------------------> V---> ... * */ static void micomputeWAET(EdgeTableEntry * AET) { EdgeTableEntry *pWETE; int inside = 1; int isInside = 0; AET->nextWETE = NULL; pWETE = AET; AET = AET->next; while (AET) { if (AET->ClockWise) isInside++; else isInside--; if ((!inside && !isInside) || (inside && isInside)) { pWETE->nextWETE = AET; pWETE = AET; inside = !inside; } AET = AET->next; } pWETE->nextWETE = NULL; } /* * Just a simple insertion sort using pointers and back pointers to sort the * Active Edge Table. */ static int miInsertionSort(EdgeTableEntry * AET) { EdgeTableEntry *pETEchase; EdgeTableEntry *pETEinsert; EdgeTableEntry *pETEchaseBackTMP; int changed = 0; AET = AET->next; while (AET) { pETEinsert = AET; pETEchase = AET; while (pETEchase->back->bres.minor > AET->bres.minor) pETEchase = pETEchase->back; AET = AET->next; if (pETEchase != pETEinsert) { pETEchaseBackTMP = pETEchase->back; pETEinsert->back->next = AET; if (AET) AET->back = pETEinsert->back; pETEinsert->next = pETEchase; pETEchase->back->next = pETEinsert; pETEchase->back = pETEinsert; pETEinsert->back = pETEchaseBackTMP; changed = 1; } } return changed; } /* Find the index of the point with the smallest y */ static int getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty) { DDXPointPtr ptMin; int ymin, ymax; DDXPointPtr ptsStart = pts; ptMin = pts; ymin = ymax = (pts++)->y; while (--n > 0) { if (pts->y < ymin) { ptMin = pts; ymin = pts->y; } if (pts->y > ymax) ymax = pts->y; pts++; } *by = ymin; *ty = ymax; return ptMin - ptsStart; } /* * Written by Brian Kelleher; Dec. 1985. * * Fill a convex polygon. If the given polygon is not convex, then the result * is undefined. The algorithm is to order the edges from smallest y to * largest by partitioning the array into a left edge list and a right edge * list. The algorithm used to traverse each edge is an extension of * Bresenham's line algorithm with y as the major axis. For a derivation of * the algorithm, see the author of this code. */ static Bool miFillConvexPoly(DrawablePtr dst, GCPtr pgc, int count, DDXPointPtr ptsIn) { int xl = 0, xr = 0; /* x vals of left and right edges */ int dl = 0, dr = 0; /* decision variables */ int ml = 0, m1l = 0; /* left edge slope and slope+1 */ int mr = 0, m1r = 0; /* right edge slope and slope+1 */ int incr1l = 0, incr2l = 0; /* left edge error increments */ int incr1r = 0, incr2r = 0; /* right edge error increments */ int dy; /* delta y */ int y; /* current scanline */ int left, right; /* indices to first endpoints */ int i; /* loop counter */ int nextleft, nextright; /* indices to second endpoints */ DDXPointPtr ptsOut, FirstPoint; /* output buffer */ int *width, *FirstWidth; /* output buffer */ int imin; /* index of smallest vertex (in y) */ int ymin; /* y-extents of polygon */ int ymax; /* * find leftx, bottomy, rightx, topy, and the index * of bottomy. Also translate the points. */ imin = getPolyYBounds(ptsIn, count, &ymin, &ymax); dy = ymax - ymin + 1; if ((count < 3) || (dy < 0)) return TRUE; ptsOut = FirstPoint = malloc(sizeof(DDXPointRec) * dy); width = FirstWidth = malloc(sizeof(int) * dy); if (!FirstPoint || !FirstWidth) { free(FirstWidth); free(FirstPoint); return FALSE; } nextleft = nextright = imin; y = ptsIn[nextleft].y; /* * loop through all edges of the polygon */ do { /* * add a left edge if we need to */ if (ptsIn[nextleft].y == y) { left = nextleft; /* * find the next edge, considering the end * conditions of the array. */ nextleft++; if (nextleft >= count) nextleft = 0; /* * now compute all of the random information * needed to run the iterative algorithm. */ BRESINITPGON(ptsIn[nextleft].y - ptsIn[left].y, ptsIn[left].x, ptsIn[nextleft].x, xl, dl, ml, m1l, incr1l, incr2l); } /* * add a right edge if we need to */ if (ptsIn[nextright].y == y) { right = nextright; /* * find the next edge, considering the end * conditions of the array. */ nextright--; if (nextright < 0) nextright = count - 1; /* * now compute all of the random information * needed to run the iterative algorithm. */ BRESINITPGON(ptsIn[nextright].y - ptsIn[right].y, ptsIn[right].x, ptsIn[nextright].x, xr, dr, mr, m1r, incr1r, incr2r); } /* * generate scans to fill while we still have * a right edge as well as a left edge. */ i = min(ptsIn[nextleft].y, ptsIn[nextright].y) - y; /* in case we're called with non-convex polygon */ if (i < 0) { free(FirstWidth); free(FirstPoint); return TRUE; } while (i-- > 0) { ptsOut->y = y; /* * reverse the edges if necessary */ if (xl < xr) { *(width++) = xr - xl; (ptsOut++)->x = xl; } else { *(width++) = xl - xr; (ptsOut++)->x = xr; } y++; /* increment down the edges */ BRESINCRPGON(dl, xl, ml, m1l, incr1l, incr2l); BRESINCRPGON(dr, xr, mr, m1r, incr1r, incr2r); } } while (y != ymax); /* * Finally, fill the spans */ (*pgc->ops->FillSpans) (dst, pgc, ptsOut - FirstPoint, FirstPoint, FirstWidth, 1); free(FirstWidth); free(FirstPoint); return TRUE; } /* * Written by Brian Kelleher; Oct. 1985 * * Routine to fill a polygon. Two fill rules are supported: frWINDING and * frEVENODD. */ static Bool miFillGeneralPoly(DrawablePtr dst, GCPtr pgc, int count, DDXPointPtr ptsIn) { EdgeTableEntry *pAET; /* the Active Edge Table */ int y; /* the current scanline */ int nPts = 0; /* number of pts in buffer */ EdgeTableEntry *pWETE; /* Winding Edge Table */ ScanLineList *pSLL; /* Current ScanLineList */ DDXPointPtr ptsOut; /* ptr to output buffers */ int *width; DDXPointRec FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */ int FirstWidth[NUMPTSTOBUFFER]; EdgeTableEntry *pPrevAET; /* previous AET entry */ EdgeTable ET; /* Edge Table header node */ EdgeTableEntry AET; /* Active ET header node */ EdgeTableEntry *pETEs; /* Edge Table Entries buff */ ScanLineListBlock SLLBlock; /* header for ScanLineList */ int fixWAET = 0; if (count < 3) return TRUE; if (!(pETEs = malloc(sizeof(EdgeTableEntry) * count))) return FALSE; ptsOut = FirstPoint; width = FirstWidth; if (!miCreateETandAET(count, ptsIn, &ET, &AET, pETEs, &SLLBlock)) { free(pETEs); return FALSE; } pSLL = ET.scanlines.next; if (pgc->fillRule == EvenOddRule) { /* * for each scanline */ for (y = ET.ymin; y < ET.ymax; y++) { /* * Add a new edge to the active edge table when we * get to the next edge. */ if (pSLL && y == pSLL->scanline) { miloadAET(&AET, pSLL->edgelist); pSLL = pSLL->next; } pPrevAET = &AET; pAET = AET.next; /* * for each active edge */ while (pAET) { ptsOut->x = pAET->bres.minor; ptsOut++->y = y; *width++ = pAET->next->bres.minor - pAET->bres.minor; nPts++; /* * send out the buffer when its full */ if (nPts == NUMPTSTOBUFFER) { (*pgc->ops->FillSpans) (dst, pgc, nPts, FirstPoint, FirstWidth, 1); ptsOut = FirstPoint; width = FirstWidth; nPts = 0; } EVALUATEEDGEEVENODD(pAET, pPrevAET, y); EVALUATEEDGEEVENODD(pAET, pPrevAET, y); } miInsertionSort(&AET); } } else { /* default to WindingNumber */ /* * for each scanline */ for (y = ET.ymin; y < ET.ymax; y++) { /* * Add a new edge to the active edge table when we * get to the next edge. */ if (pSLL && y == pSLL->scanline) { miloadAET(&AET, pSLL->edgelist); micomputeWAET(&AET); pSLL = pSLL->next; } pPrevAET = &AET; pAET = AET.next; pWETE = pAET; /* * for each active edge */ while (pAET) { /* * if the next edge in the active edge table is * also the next edge in the winding active edge * table. */ if (pWETE == pAET) { ptsOut->x = pAET->bres.minor; ptsOut++->y = y; *width++ = pAET->nextWETE->bres.minor - pAET->bres.minor; nPts++; /* * send out the buffer */ if (nPts == NUMPTSTOBUFFER) { (*pgc->ops->FillSpans) (dst, pgc, nPts, FirstPoint, FirstWidth, 1); ptsOut = FirstPoint; width = FirstWidth; nPts = 0; } pWETE = pWETE->nextWETE; while (pWETE != pAET) EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); pWETE = pWETE->nextWETE; } EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); } /* * reevaluate the Winding active edge table if we * just had to resort it or if we just exited an edge. */ if (miInsertionSort(&AET) || fixWAET) { micomputeWAET(&AET); fixWAET = 0; } } } /* * Get any spans that we missed by buffering */ (*pgc->ops->FillSpans) (dst, pgc, nPts, FirstPoint, FirstWidth, 1); free(pETEs); miFreeStorage(SLLBlock.next); return TRUE; } /* * Draw polygons. This routine translates the point by the origin if * pGC->miTranslate is non-zero, and calls to the appropriate routine to * actually scan convert the polygon. */ void miFillPolygon(DrawablePtr dst, GCPtr pgc, int shape, int mode, int count, DDXPointPtr pPts) { int i; int xorg, yorg; DDXPointPtr ppt; if (count == 0) return; ppt = pPts; if (pgc->miTranslate) { xorg = dst->x; yorg = dst->y; if (mode == CoordModeOrigin) { for (i = 0; i < count; i++) { ppt->x += xorg; ppt++->y += yorg; } } else { ppt->x += xorg; ppt++->y += yorg; for (i = 1; i < count; i++) { ppt->x += (ppt - 1)->x; ppt->y += (ppt - 1)->y; ppt++; } } } else { if (mode == CoordModePrevious) { ppt++; for (i = 1; i < count; i++) { ppt->x += (ppt - 1)->x; ppt->y += (ppt - 1)->y; ppt++; } } } if (shape == Convex) miFillConvexPoly(dst, pgc, count, pPts); else miFillGeneralPoly(dst, pgc, count, pPts); } xorg-server-1.17.1/mi/mifillrct.c0000664000175100017510000001050012456571574013563 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "gcstruct.h" #include "windowstr.h" #include "pixmap.h" #include "mi.h" #include "misc.h" /* mi rectangles written by newman, with debts to all and sundry */ /* MIPOLYFILLRECT -- public entry for PolyFillRect request * very straight forward: translate rectangles if necessary * then call FillSpans to fill each rectangle. We let FillSpans worry about * clipping to the destination */ _X_COLD void miPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, /* number of rectangles to fill */ xRectangle *prectInit /* Pointer to first rectangle to fill */ ) { int i; int height; int width; xRectangle *prect; int xorg; int yorg; int maxheight; DDXPointPtr pptFirst; DDXPointPtr ppt; int *pwFirst; int *pw; if (pGC->miTranslate) { xorg = pDrawable->x; yorg = pDrawable->y; prect = prectInit; maxheight = 0; for (i = 0; i < nrectFill; i++, prect++) { prect->x += xorg; prect->y += yorg; maxheight = max(maxheight, prect->height); } } else { prect = prectInit; maxheight = 0; for (i = 0; i < nrectFill; i++, prect++) maxheight = max(maxheight, prect->height); } pptFirst = malloc(maxheight * sizeof(DDXPointRec)); pwFirst = malloc(maxheight * sizeof(int)); if (!pptFirst || !pwFirst) { free(pwFirst); free(pptFirst); return; } prect = prectInit; while (nrectFill--) { ppt = pptFirst; pw = pwFirst; height = prect->height; width = prect->width; xorg = prect->x; yorg = prect->y; while (height--) { *pw++ = width; ppt->x = xorg; ppt->y = yorg; ppt++; yorg++; } (*pGC->ops->FillSpans) (pDrawable, pGC, prect->height, pptFirst, pwFirst, 1); prect++; } free(pwFirst); free(pptFirst); } xorg-server-1.17.1/mi/mipolypnt.c0000664000175100017510000000734212456571574013643 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "pixmapstr.h" #include "gcstruct.h" #include "windowstr.h" #include "mi.h" void miPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, /* Origin or Previous */ int npt, xPoint * pptInit) { int xorg; int yorg; int nptTmp; ChangeGCVal fsOld, fsNew; int *pwidthInit, *pwidth; int i; xPoint *ppt; if (!(pwidthInit = malloc(npt * sizeof(int)))) return; /* make pointlist origin relative */ if (mode == CoordModePrevious) { ppt = pptInit; nptTmp = npt; nptTmp--; while (nptTmp--) { ppt++; ppt->x += (ppt - 1)->x; ppt->y += (ppt - 1)->y; } } if (pGC->miTranslate) { ppt = pptInit; nptTmp = npt; xorg = pDrawable->x; yorg = pDrawable->y; while (nptTmp--) { ppt->x += xorg; ppt++->y += yorg; } } fsOld.val = pGC->fillStyle; fsNew.val = FillSolid; if (pGC->fillStyle != FillSolid) { ChangeGC(NullClient, pGC, GCFillStyle, &fsNew); ValidateGC(pDrawable, pGC); } pwidth = pwidthInit; for (i = 0; i < npt; i++) *pwidth++ = 1; (*pGC->ops->FillSpans) (pDrawable, pGC, npt, pptInit, pwidthInit, FALSE); if (fsOld.val != FillSolid) { ChangeGC(NullClient, pGC, GCFillStyle, &fsOld); ValidateGC(pDrawable, pGC); } free(pwidthInit); } xorg-server-1.17.1/mi/mistruct.h0000664000175100017510000000531012456571574013460 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef MISTRUCT_H #define MISTRUCT_H #include "mi.h" #include "regionstr.h" /* information about dashes */ typedef struct _miDash { DDXPointRec pt; int e1, e2; /* keep these, so we don't have to do it again */ int e; /* bresenham error term for this point on line */ int which; int newLine; /* 0 if part of same original line as previous dash */ } miDashRec; #endif /* MISTRUCT_H */ xorg-server-1.17.1/mi/mifillarc.c0000664000175100017510000004603112432306326013531 00000000000000/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Author: Bob Scheifler, MIT X Consortium ********************************************************/ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "mi.h" #include "mifillarc.h" #define QUADRANT (90 * 64) #define HALFCIRCLE (180 * 64) #define QUADRANT3 (270 * 64) #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #define Dsin(d) sin((double)d*(M_PI/11520.0)) #define Dcos(d) cos((double)d*(M_PI/11520.0)) static void miFillArcSetup(xArc * arc, miFillArcRec * info) { info->y = arc->height >> 1; info->dy = arc->height & 1; info->yorg = arc->y + info->y; info->dx = arc->width & 1; info->xorg = arc->x + (arc->width >> 1) + info->dx; info->dx = 1 - info->dx; if (arc->width == arc->height) { /* (2x - 2xorg)^2 = d^2 - (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ info->ym = 8; info->xm = 8; info->yk = info->y << 3; if (!info->dx) { info->xk = 0; info->e = -1; } else { info->y++; info->yk += 4; info->xk = -4; info->e = -(info->y << 3); } } else { /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ info->ym = (arc->width * arc->width) << 3; info->xm = (arc->height * arc->height) << 3; info->yk = info->y * info->ym; if (!info->dy) info->yk -= info->ym >> 1; if (!info->dx) { info->xk = 0; info->e = -(info->xm >> 3); } else { info->y++; info->yk += info->ym; info->xk = -(info->xm >> 1); info->e = info->xk - info->yk; } } } static void miFillArcDSetup(xArc * arc, miFillArcDRec * info) { /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ info->y = arc->height >> 1; info->dy = arc->height & 1; info->yorg = arc->y + info->y; info->dx = arc->width & 1; info->xorg = arc->x + (arc->width >> 1) + info->dx; info->dx = 1 - info->dx; info->ym = ((double) arc->width) * (arc->width * 8); info->xm = ((double) arc->height) * (arc->height * 8); info->yk = info->y * info->ym; if (!info->dy) info->yk -= info->ym / 2.0; if (!info->dx) { info->xk = 0; info->e = -(info->xm / 8.0); } else { info->y++; info->yk += info->ym; info->xk = -info->xm / 2.0; info->e = info->xk - info->yk; } } static void miGetArcEdge(xArc * arc, miSliceEdgePtr edge, int k, Bool top, Bool left) { int xady, y; y = arc->height >> 1; if (!(arc->width & 1)) y++; if (!top) { y = -y; if (arc->height & 1) y--; } xady = k + y * edge->dx; if (xady <= 0) edge->x = -((-xady) / edge->dy + 1); else edge->x = (xady - 1) / edge->dy; edge->e = xady - edge->x * edge->dy; if ((top && (edge->dx < 0)) || (!top && (edge->dx > 0))) edge->e = edge->dy - edge->e + 1; if (left) edge->x++; edge->x += arc->x + (arc->width >> 1); if (edge->dx > 0) { edge->deltax = 1; edge->stepx = edge->dx / edge->dy; edge->dx = edge->dx % edge->dy; } else { edge->deltax = -1; edge->stepx = -((-edge->dx) / edge->dy); edge->dx = (-edge->dx) % edge->dy; } if (!top) { edge->deltax = -edge->deltax; edge->stepx = -edge->stepx; } } static void miEllipseAngleToSlope(int angle, int width, int height, int *dxp, int *dyp, double *d_dxp, double *d_dyp) { int dx, dy; double d_dx, d_dy, scale; Bool negative_dx, negative_dy; switch (angle) { case 0: *dxp = -1; *dyp = 0; if (d_dxp) { *d_dxp = width / 2.0; *d_dyp = 0; } break; case QUADRANT: *dxp = 0; *dyp = 1; if (d_dxp) { *d_dxp = 0; *d_dyp = -height / 2.0; } break; case HALFCIRCLE: *dxp = 1; *dyp = 0; if (d_dxp) { *d_dxp = -width / 2.0; *d_dyp = 0; } break; case QUADRANT3: *dxp = 0; *dyp = -1; if (d_dxp) { *d_dxp = 0; *d_dyp = height / 2.0; } break; default: d_dx = Dcos(angle) * width; d_dy = Dsin(angle) * height; if (d_dxp) { *d_dxp = d_dx / 2.0; *d_dyp = -d_dy / 2.0; } negative_dx = FALSE; if (d_dx < 0.0) { d_dx = -d_dx; negative_dx = TRUE; } negative_dy = FALSE; if (d_dy < 0.0) { d_dy = -d_dy; negative_dy = TRUE; } scale = d_dx; if (d_dy > d_dx) scale = d_dy; dx = floor((d_dx * 32768) / scale + 0.5); if (negative_dx) dx = -dx; *dxp = dx; dy = floor((d_dy * 32768) / scale + 0.5); if (negative_dy) dy = -dy; *dyp = dy; break; } } static void miGetPieEdge(xArc * arc, int angle, miSliceEdgePtr edge, Bool top, Bool left) { int k; int dx, dy; miEllipseAngleToSlope(angle, arc->width, arc->height, &dx, &dy, 0, 0); if (dy == 0) { edge->x = left ? -65536 : 65536; edge->stepx = 0; edge->e = 0; edge->dx = -1; return; } if (dx == 0) { edge->x = arc->x + (arc->width >> 1); if (left && (arc->width & 1)) edge->x++; else if (!left && !(arc->width & 1)) edge->x--; edge->stepx = 0; edge->e = 0; edge->dx = -1; return; } if (dy < 0) { dx = -dx; dy = -dy; } k = (arc->height & 1) ? dx : 0; if (arc->width & 1) k += dy; edge->dx = dx << 1; edge->dy = dy << 1; miGetArcEdge(arc, edge, k, top, left); } static void miFillArcSliceSetup(xArc * arc, miArcSliceRec * slice, GCPtr pGC) { int angle1, angle2; angle1 = arc->angle1; if (arc->angle2 < 0) { angle2 = angle1; angle1 += arc->angle2; } else angle2 = angle1 + arc->angle2; while (angle1 < 0) angle1 += FULLCIRCLE; while (angle1 >= FULLCIRCLE) angle1 -= FULLCIRCLE; while (angle2 < 0) angle2 += FULLCIRCLE; while (angle2 >= FULLCIRCLE) angle2 -= FULLCIRCLE; slice->min_top_y = 0; slice->max_top_y = arc->height >> 1; slice->min_bot_y = 1 - (arc->height & 1); slice->max_bot_y = slice->max_top_y - 1; slice->flip_top = FALSE; slice->flip_bot = FALSE; if (pGC->arcMode == ArcPieSlice) { slice->edge1_top = (angle1 < HALFCIRCLE); slice->edge2_top = (angle2 <= HALFCIRCLE); if ((angle2 == 0) || (angle1 == HALFCIRCLE)) { if (angle2 ? slice->edge2_top : slice->edge1_top) slice->min_top_y = slice->min_bot_y; else slice->min_top_y = arc->height; slice->min_bot_y = 0; } else if ((angle1 == 0) || (angle2 == HALFCIRCLE)) { slice->min_top_y = slice->min_bot_y; if (angle1 ? slice->edge1_top : slice->edge2_top) slice->min_bot_y = arc->height; else slice->min_bot_y = 0; } else if (slice->edge1_top == slice->edge2_top) { if (angle2 < angle1) { slice->flip_top = slice->edge1_top; slice->flip_bot = !slice->edge1_top; } else if (slice->edge1_top) { slice->min_top_y = 1; slice->min_bot_y = arc->height; } else { slice->min_bot_y = 0; slice->min_top_y = arc->height; } } miGetPieEdge(arc, angle1, &slice->edge1, slice->edge1_top, !slice->edge1_top); miGetPieEdge(arc, angle2, &slice->edge2, slice->edge2_top, slice->edge2_top); } else { double w2, h2, x1, y1, x2, y2, dx, dy, scale; int signdx, signdy, y, k; Bool isInt1 = TRUE, isInt2 = TRUE; w2 = (double) arc->width / 2.0; h2 = (double) arc->height / 2.0; if ((angle1 == 0) || (angle1 == HALFCIRCLE)) { x1 = angle1 ? -w2 : w2; y1 = 0.0; } else if ((angle1 == QUADRANT) || (angle1 == QUADRANT3)) { x1 = 0.0; y1 = (angle1 == QUADRANT) ? h2 : -h2; } else { isInt1 = FALSE; x1 = Dcos(angle1) * w2; y1 = Dsin(angle1) * h2; } if ((angle2 == 0) || (angle2 == HALFCIRCLE)) { x2 = angle2 ? -w2 : w2; y2 = 0.0; } else if ((angle2 == QUADRANT) || (angle2 == QUADRANT3)) { x2 = 0.0; y2 = (angle2 == QUADRANT) ? h2 : -h2; } else { isInt2 = FALSE; x2 = Dcos(angle2) * w2; y2 = Dsin(angle2) * h2; } dx = x2 - x1; dy = y2 - y1; if (arc->height & 1) { y1 -= 0.5; y2 -= 0.5; } if (arc->width & 1) { x1 += 0.5; x2 += 0.5; } if (dy < 0.0) { dy = -dy; signdy = -1; } else signdy = 1; if (dx < 0.0) { dx = -dx; signdx = -1; } else signdx = 1; if (isInt1 && isInt2) { slice->edge1.dx = dx * 2; slice->edge1.dy = dy * 2; } else { scale = (dx > dy) ? dx : dy; slice->edge1.dx = floor((dx * 32768) / scale + .5); slice->edge1.dy = floor((dy * 32768) / scale + .5); } if (!slice->edge1.dy) { if (signdx < 0) { y = floor(y1 + 1.0); if (y >= 0) { slice->min_top_y = y; slice->min_bot_y = arc->height; } else { slice->max_bot_y = -y - (arc->height & 1); } } else { y = floor(y1); if (y >= 0) slice->max_top_y = y; else { slice->min_top_y = arc->height; slice->min_bot_y = -y - (arc->height & 1); } } slice->edge1_top = TRUE; slice->edge1.x = 65536; slice->edge1.stepx = 0; slice->edge1.e = 0; slice->edge1.dx = -1; slice->edge2 = slice->edge1; slice->edge2_top = FALSE; } else if (!slice->edge1.dx) { if (signdy < 0) x1 -= 1.0; slice->edge1.x = ceil(x1); slice->edge1_top = signdy < 0; slice->edge1.x += arc->x + (arc->width >> 1); slice->edge1.stepx = 0; slice->edge1.e = 0; slice->edge1.dx = -1; slice->edge2_top = !slice->edge1_top; slice->edge2 = slice->edge1; } else { if (signdx < 0) slice->edge1.dx = -slice->edge1.dx; if (signdy < 0) slice->edge1.dx = -slice->edge1.dx; k = ceil(((x1 + x2) * slice->edge1.dy - (y1 + y2) * slice->edge1.dx) / 2.0); slice->edge2.dx = slice->edge1.dx; slice->edge2.dy = slice->edge1.dy; slice->edge1_top = signdy < 0; slice->edge2_top = !slice->edge1_top; miGetArcEdge(arc, &slice->edge1, k, slice->edge1_top, !slice->edge1_top); miGetArcEdge(arc, &slice->edge2, k, slice->edge2_top, slice->edge2_top); } } } #define ADDSPANS() \ pts->x = xorg - x; \ pts->y = yorg - y; \ *wids = slw; \ pts++; \ wids++; \ if (miFillArcLower(slw)) \ { \ pts->x = xorg - x; \ pts->y = yorg + y + dy; \ pts++; \ *wids++ = slw; \ } static int miFillEllipseI(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int x, y, e; int yk, xk, ym, xm, dx, dy, xorg, yorg; int slw; miFillArcRec info; DDXPointPtr pts; int *wids; miFillArcSetup(arc, &info); MIFILLARCSETUP(); if (pGC->miTranslate) { xorg += pDraw->x; yorg += pDraw->y; } pts = points; wids = widths; while (y > 0) { MIFILLARCSTEP(slw); ADDSPANS(); } return pts - points; } static int miFillEllipseD(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int x, y; int xorg, yorg, dx, dy, slw; double e, yk, xk, ym, xm; miFillArcDRec info; DDXPointPtr pts; int *wids; miFillArcDSetup(arc, &info); MIFILLARCSETUP(); if (pGC->miTranslate) { xorg += pDraw->x; yorg += pDraw->y; } pts = points; wids = widths; while (y > 0) { MIFILLARCSTEP(slw); ADDSPANS(); } return pts - points; } #define ADDSPAN(l,r) \ if (r >= l) \ { \ pts->x = l; \ pts->y = ya; \ pts++; \ *wids++ = r - l + 1; \ } #define ADDSLICESPANS(flip) \ if (!flip) \ { \ ADDSPAN(xl, xr); \ } \ else \ { \ xc = xorg - x; \ ADDSPAN(xc, xr); \ xc += slw - 1; \ ADDSPAN(xl, xc); \ } static int miFillArcSliceI(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; int x, y, e; miFillArcRec info; miArcSliceRec slice; int ya, xl, xr, xc; DDXPointPtr pts; int *wids; 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; } pts = points; wids = widths; 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); } } return pts - points; } static int miFillArcSliceD(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int x, y; int dx, dy, xorg, yorg, slw; double e, yk, xk, ym, xm; miFillArcDRec info; miArcSliceRec slice; int ya, xl, xr, xc; DDXPointPtr pts; int *wids; miFillArcDSetup(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; } pts = points; wids = widths; 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); } } return pts - points; } /* MIPOLYFILLARC -- The public entry for the PolyFillArc request. * Since we don't have to worry about overlapping segments, we can just * fill each arc as it comes. */ /* Limit the number of spans in a single draw request to avoid integer * overflow in the computation of the span buffer size. */ #define MAX_SPANS_PER_LOOP (4 * 1024 * 1024) void miPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs_all, xArc * parcs) { while (narcs_all > 0) { int narcs; int i; xArc *arc; int nspans = 0; DDXPointPtr pts, points; int *wids, *widths; int n; for (narcs = 0, arc = parcs; narcs < narcs_all; narcs++, arc++) { if (narcs && nspans + arc->height > MAX_SPANS_PER_LOOP) break; nspans += arc->height; } pts = points = malloc (sizeof (DDXPointRec) * nspans + sizeof(int) * nspans); if (points) { wids = widths = (int *) (points + nspans); for (i = 0, arc = parcs; i < narcs; arc++, i++) { if (miFillArcEmpty(arc)) continue; if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE)) { if (miCanFillArc(arc)) n = miFillEllipseI(pDraw, pGC, arc, pts, wids); else n = miFillEllipseD(pDraw, pGC, arc, pts, wids); } else { if (miCanFillArc(arc)) n = miFillArcSliceI(pDraw, pGC, arc, pts, wids); else n = miFillArcSliceD(pDraw, pGC, arc, pts, wids); } pts += n; wids += n; } nspans = pts - points; if (nspans) (*pGC->ops->FillSpans) (pDraw, pGC, nspans, points, widths, FALSE); free (points); } parcs += narcs; narcs_all -= narcs; } } xorg-server-1.17.1/mi/mieq.c0000664000175100017510000004640012366751547012541 00000000000000/* * Copyright 1990, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ /* * mieq.c * * Machine independent event queue * */ #if HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "misc.h" #include "windowstr.h" #include "pixmapstr.h" #include "inputstr.h" #include "inpututils.h" #include "mi.h" #include "mipointer.h" #include "scrnintstr.h" #include #include #include #include "extinit.h" #include "exglobals.h" #include "eventstr.h" #ifdef DPMSExtension #include "dpmsproc.h" #include #endif /* Maximum size should be initial size multiplied by a power of 2 */ #define QUEUE_INITIAL_SIZE 512 #define QUEUE_RESERVED_SIZE 64 #define QUEUE_MAXIMUM_SIZE 4096 #define QUEUE_DROP_BACKTRACE_FREQUENCY 100 #define QUEUE_DROP_BACKTRACE_MAX 10 #define EnqueueScreen(dev) dev->spriteInfo->sprite->pEnqueueScreen #define DequeueScreen(dev) dev->spriteInfo->sprite->pDequeueScreen typedef struct _Event { InternalEvent *events; ScreenPtr pScreen; DeviceIntPtr pDev; /* device this event _originated_ from */ } EventRec, *EventPtr; typedef struct _EventQueue { HWEventQueueType head, tail; /* long for SetInputCheck */ CARD32 lastEventTime; /* to avoid time running backwards */ int lastMotion; /* device ID if last event motion? */ EventRec *events; /* our queue as an array */ size_t nevents; /* the number of buckets in our queue */ size_t dropped; /* counter for number of consecutive dropped events */ mieqHandler handlers[128]; /* custom event handler */ } EventQueueRec, *EventQueuePtr; static EventQueueRec miEventQueue; #ifdef XQUARTZ #include static pthread_mutex_t miEventQueueMutex = PTHREAD_MUTEX_INITIALIZER; extern BOOL serverRunning; extern pthread_mutex_t serverRunningMutex; extern pthread_cond_t serverRunningCond; static inline void wait_for_server_init(void) { /* If the server hasn't finished initializing, wait for it... */ if (!serverRunning) { pthread_mutex_lock(&serverRunningMutex); while (!serverRunning) pthread_cond_wait(&serverRunningCond, &serverRunningMutex); pthread_mutex_unlock(&serverRunningMutex); } } #endif static size_t mieqNumEnqueued(EventQueuePtr eventQueue) { size_t n_enqueued = 0; if (eventQueue->nevents) { /* % is not well-defined with negative numbers... sigh */ n_enqueued = eventQueue->tail - eventQueue->head + eventQueue->nevents; if (n_enqueued >= eventQueue->nevents) n_enqueued -= eventQueue->nevents; } return n_enqueued; } /* Pre-condition: Called with miEventQueueMutex held */ static Bool mieqGrowQueue(EventQueuePtr eventQueue, size_t new_nevents) { size_t i, n_enqueued, first_hunk; EventRec *new_events; if (!eventQueue) { ErrorF("[mi] mieqGrowQueue called with a NULL eventQueue\n"); return FALSE; } if (new_nevents <= eventQueue->nevents) return FALSE; new_events = calloc(new_nevents, sizeof(EventRec)); if (new_events == NULL) { ErrorF("[mi] mieqGrowQueue memory allocation error.\n"); return FALSE; } n_enqueued = mieqNumEnqueued(eventQueue); /* We block signals, so an mieqEnqueue triggered by SIGIO does not * write to our queue as we are modifying it. */ OsBlockSignals(); /* First copy the existing events */ first_hunk = eventQueue->nevents - eventQueue->head; memcpy(new_events, &eventQueue->events[eventQueue->head], first_hunk * sizeof(EventRec)); memcpy(&new_events[first_hunk], eventQueue->events, eventQueue->head * sizeof(EventRec)); /* Initialize the new portion */ for (i = eventQueue->nevents; i < new_nevents; i++) { InternalEvent *evlist = InitEventList(1); if (!evlist) { size_t j; for (j = 0; j < i; j++) FreeEventList(new_events[j].events, 1); free(new_events); OsReleaseSignals(); return FALSE; } new_events[i].events = evlist; } /* And update our record */ eventQueue->tail = n_enqueued; eventQueue->head = 0; eventQueue->nevents = new_nevents; free(eventQueue->events); eventQueue->events = new_events; OsReleaseSignals(); return TRUE; } Bool mieqInit(void) { memset(&miEventQueue, 0, sizeof(miEventQueue)); miEventQueue.lastEventTime = GetTimeInMillis(); if (!mieqGrowQueue(&miEventQueue, QUEUE_INITIAL_SIZE)) FatalError("Could not allocate event queue.\n"); SetInputCheck(&miEventQueue.head, &miEventQueue.tail); return TRUE; } void mieqFini(void) { int i; for (i = 0; i < miEventQueue.nevents; i++) { if (miEventQueue.events[i].events != NULL) { FreeEventList(miEventQueue.events[i].events, 1); miEventQueue.events[i].events = NULL; } } free(miEventQueue.events); } /* This function will determine if the given event is allowed to used the reserved * queue space. */ static Bool mieqReservedCandidate(InternalEvent *e) { switch (e->any.type) { case ET_KeyRelease: case ET_ButtonRelease: #if XFreeXDGA case ET_DGAEvent: #endif case ET_RawKeyRelease: case ET_RawButtonRelease: case ET_XQuartz: return TRUE; default: return FALSE; } } /* * Must be reentrant with ProcessInputEvents. Assumption: mieqEnqueue * will never be interrupted. If this is called from both signal * handlers and regular code, make sure the signal is suspended when * called from regular code. */ void mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) { unsigned int oldtail = miEventQueue.tail; InternalEvent *evt; int isMotion = 0; int evlen; Time time; size_t n_enqueued; #ifdef XQUARTZ wait_for_server_init(); pthread_mutex_lock(&miEventQueueMutex); #endif verify_internal_event(e); n_enqueued = mieqNumEnqueued(&miEventQueue); /* avoid merging events from different devices */ if (e->any.type == ET_Motion) isMotion = pDev->id; if (isMotion && isMotion == miEventQueue.lastMotion && oldtail != miEventQueue.head) { oldtail = (oldtail - 1) % miEventQueue.nevents; } else if ((n_enqueued + 1 == miEventQueue.nevents) || ((n_enqueued + 1 >= miEventQueue.nevents - QUEUE_RESERVED_SIZE) && !mieqReservedCandidate(e))) { /* Toss events which come in late. Usually this means your server's * stuck in an infinite loop somewhere, but SIGIO is still getting * handled. */ miEventQueue.dropped++; if (miEventQueue.dropped == 1) { ErrorFSigSafe("[mi] EQ overflowing. Additional events will be " "discarded until existing events are processed.\n"); xorg_backtrace(); 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) { ErrorFSigSafe("[mi] EQ overflow continuing. %zu events have been " "dropped.\n", miEventQueue.dropped); if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY == QUEUE_DROP_BACKTRACE_MAX) { ErrorFSigSafe("[mi] No further overflow reports will be " "reported until the clog is cleared.\n"); } xorg_backtrace(); } #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif return; } evlen = e->any.length; evt = miEventQueue.events[oldtail].events; memcpy(evt, e, evlen); time = e->any.time; /* Make sure that event times don't go backwards - this * is "unnecessary", but very useful. */ if (time < miEventQueue.lastEventTime && miEventQueue.lastEventTime - time < 10000) e->any.time = miEventQueue.lastEventTime; miEventQueue.lastEventTime = evt->any.time; miEventQueue.events[oldtail].pScreen = pDev ? EnqueueScreen(pDev) : NULL; miEventQueue.events[oldtail].pDev = pDev; miEventQueue.lastMotion = isMotion; miEventQueue.tail = (oldtail + 1) % miEventQueue.nevents; #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif } /** * Changes the screen reference events are being enqueued from. * Input events are enqueued with a screen reference and dequeued and * processed with a (potentially different) screen reference. * This function is called whenever a new event has changed screen but is * still logically on the previous screen as seen by the client. * This usually happens whenever the visible cursor moves across screen * boundaries during event generation, before the same event is processed * and sent down the wire. * * @param pDev The device that triggered a screen change. * @param pScreen The new screen events are being enqueued for. * @param set_dequeue_screen If TRUE, pScreen is set as both enqueue screen * and dequeue screen. */ void mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool set_dequeue_screen) { #ifdef XQUARTZ pthread_mutex_lock(&miEventQueueMutex); #endif EnqueueScreen(pDev) = pScreen; if (set_dequeue_screen) DequeueScreen(pDev) = pScreen; #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif } void mieqSetHandler(int event, mieqHandler handler) { #ifdef XQUARTZ pthread_mutex_lock(&miEventQueueMutex); #endif if (handler && miEventQueue.handlers[event]) ErrorF("[mi] mieq: warning: overriding existing handler %p with %p for " "event %d\n", miEventQueue.handlers[event], handler, event); miEventQueue.handlers[event] = handler; #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif } /** * Change the device id of the given event to the given device's id. */ static void ChangeDeviceID(DeviceIntPtr dev, InternalEvent *event) { switch (event->any.type) { case ET_Motion: case ET_KeyPress: case ET_KeyRelease: case ET_ButtonPress: case ET_ButtonRelease: case ET_ProximityIn: case ET_ProximityOut: case ET_Hierarchy: case ET_DeviceChanged: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: event->device_event.deviceid = dev->id; break; case ET_TouchOwnership: event->touch_ownership_event.deviceid = dev->id; break; #if XFreeXDGA case ET_DGAEvent: break; #endif case ET_RawKeyPress: case ET_RawKeyRelease: case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: case ET_RawTouchBegin: case ET_RawTouchEnd: 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); } } static void FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, InternalEvent *original, InternalEvent *master) { verify_internal_event(original); verify_internal_event(master); /* Ensure chained button mappings, i.e. that the detail field is the * value of the mapped button on the SD, not the physical button */ if (original->any.type == ET_ButtonPress || original->any.type == ET_ButtonRelease) { int btn = original->device_event.detail.button; if (!sdev->button) return; /* Should never happen */ master->device_event.detail.button = sdev->button->map[btn]; } } /** * Copy the given event into master. * @param sdev The slave device the original event comes from * @param original The event as it came from the EQ * @param copy The event after being copied * @return The master device or NULL if the device is a floating slave. */ DeviceIntPtr CopyGetMasterEvent(DeviceIntPtr sdev, InternalEvent *original, InternalEvent *copy) { DeviceIntPtr mdev; int len = original->any.length; int type = original->any.type; int mtype; /* which master type? */ verify_internal_event(original); /* ET_XQuartz has sdev == NULL */ if (!sdev || IsMaster(sdev) || IsFloating(sdev)) return NULL; #if XFreeXDGA if (type == ET_DGAEvent) type = original->dga_event.subtype; #endif switch (type) { case ET_KeyPress: case ET_KeyRelease: mtype = MASTER_KEYBOARD; break; case ET_ButtonPress: case ET_ButtonRelease: case ET_Motion: case ET_ProximityIn: case ET_ProximityOut: mtype = MASTER_POINTER; break; default: mtype = MASTER_ATTACHED; break; } mdev = GetMaster(sdev, mtype); memcpy(copy, original, len); ChangeDeviceID(mdev, copy); FixUpEventForMaster(mdev, sdev, original, copy); return mdev; } static void mieqMoveToNewScreen(DeviceIntPtr dev, ScreenPtr screen, DeviceEvent *event) { if (dev && screen && screen != DequeueScreen(dev)) { int x = 0, y = 0; DequeueScreen(dev) = screen; x = event->root_x; y = event->root_y; NewCurrentScreen(dev, DequeueScreen(dev), x, y); } } /** * Post the given @event through the device hierarchy, as appropriate. * Use this function if an event must be posted for a given device during the * usual event processing cycle. */ void mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen) { mieqHandler handler; DeviceIntPtr master; InternalEvent mevent; /* master event */ verify_internal_event(event); /* refuse events from disabled devices */ if (dev && !dev->enabled) return; /* Custom event handler */ handler = miEventQueue.handlers[event->any.type]; switch (event->any.type) { /* Catch events that include valuator information and check if they * are changing the screen */ case ET_Motion: case ET_KeyPress: case ET_KeyRelease: case ET_ButtonPress: case ET_ButtonRelease: if (!handler) mieqMoveToNewScreen(dev, screen, &event->device_event); break; case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: if (!handler && (event->device_event.flags & TOUCH_POINTER_EMULATED)) mieqMoveToNewScreen(dev, screen, &event->device_event); break; default: break; } master = CopyGetMasterEvent(dev, event, &mevent); if (master) master->lastSlave = dev; /* If someone's registered a custom event handler, let them * steal it. */ if (handler) { int screenNum = dev && DequeueScreen(dev) ? DequeueScreen(dev)->myNum : (screen ? screen-> myNum : 0); handler(screenNum, event, dev); /* Check for the SD's master in case the device got detached * during event processing */ if (master && !IsFloating(dev)) handler(screenNum, &mevent, master); } else { /* process slave first, then master */ dev->public.processInputProc(event, dev); /* Check for the SD's master in case the device got detached * during event processing */ if (master && !IsFloating(dev)) master->public.processInputProc(&mevent, master); } } /* Call this from ProcessInputEvents(). */ void mieqProcessInputEvents(void) { EventRec *e = NULL; ScreenPtr screen; static InternalEvent event; DeviceIntPtr dev = NULL, master = NULL; size_t n_enqueued; #ifdef XQUARTZ pthread_mutex_lock(&miEventQueueMutex); #endif /* Grow our queue if we are reaching capacity: < 2 * QUEUE_RESERVED_SIZE remaining */ n_enqueued = mieqNumEnqueued(&miEventQueue); if (n_enqueued >= (miEventQueue.nevents - (2 * QUEUE_RESERVED_SIZE)) && miEventQueue.nevents < QUEUE_MAXIMUM_SIZE) { ErrorF("[mi] Increasing EQ size to %lu to prevent dropped events.\n", (unsigned long) (miEventQueue.nevents << 1)); if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) { ErrorF("[mi] Increasing the size of EQ failed.\n"); } } if (miEventQueue.dropped) { ErrorF("[mi] EQ processing has resumed after %lu dropped events.\n", (unsigned long) miEventQueue.dropped); ErrorF ("[mi] This may be caused my a misbehaving driver monopolizing the server's resources.\n"); miEventQueue.dropped = 0; } while (miEventQueue.head != miEventQueue.tail) { e = &miEventQueue.events[miEventQueue.head]; event = *e->events; dev = e->pDev; screen = e->pScreen; miEventQueue.head = (miEventQueue.head + 1) % miEventQueue.nevents; #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif master = (dev) ? GetMaster(dev, MASTER_ATTACHED) : NULL; if (screenIsSaved == SCREEN_SAVER_ON) dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); #ifdef DPMSExtension else if (DPMSPowerLevel != DPMSModeOn) SetScreenSaverTimer(); if (DPMSPowerLevel != DPMSModeOn) DPMSSet(serverClient, DPMSModeOn); #endif mieqProcessDeviceEvent(dev, &event, screen); /* Update the sprite now. Next event may be from different device. */ 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 pthread_mutex_lock(&miEventQueueMutex); #endif } #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif } xorg-server-1.17.1/mi/miarc.c0000664000175100017510000031773712456571574012717 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* Author: Keith Packard and Bob Scheifler */ /* Warning: this code is toxic, do not dally very long here. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "misc.h" #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "windowstr.h" #include "mifpoly.h" #include "mi.h" #include "mifillarc.h" #include #define EPSILON 0.000001 #define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON) #define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON) #define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y)) #define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - for 11o miter cutoff */ /* Point with sub-pixel positioning. */ typedef struct _SppPoint { double x, y; } SppPointRec, *SppPointPtr; typedef struct _SppArc { double x, y, width, height; double angle1, angle2; } SppArcRec, *SppArcPtr; static double miDsin(double a); static double miDcos(double a); static double miDasin(double v); static double miDatan2(double dy, double dx); #ifndef HAVE_CBRT static double cbrt(double x) { if (x > 0.0) return pow(x, 1.0 / 3.0); else return -pow(-x, 1.0 / 3.0); } #endif /* * some interesting sematic interpretation of the protocol: * * Self intersecting arcs (i.e. those spanning 360 degrees) * never join with other arcs, and are drawn without caps * (unless on/off dashed, in which case each dash segment * is capped, except when the last segment meets the * first segment, when no caps are drawn) * * double dash arcs are drawn in two parts, first the * odd dashes (drawn in background) then the even dashes * (drawn in foreground). This means that overlapping * sections of foreground/background are drawn twice, * first in background then in foreground. The double-draw * occurs even when the function uses the destination values * (e.g. xor mode). This is the same way the wide-line * code works and should be "fixed". * */ struct bound { double min, max; }; struct ibound { int min, max; }; #define boundedLe(value, bounds)\ ((bounds).min <= (value) && (value) <= (bounds).max) struct line { double m, b; int valid; }; #define intersectLine(y,line) (line.m * (y) + line.b) /* * these are all y value bounds */ struct arc_bound { struct bound ellipse; struct bound inner; struct bound outer; struct bound right; struct bound left; struct ibound inneri; struct ibound outeri; }; struct accelerators { double tail_y; double h2; double w2; double h4; double w4; double h2mw2; double h2l; double w2l; double fromIntX; double fromIntY; struct line left, right; int yorgu; int yorgl; int xorg; }; struct arc_def { double w, h, l; double a0, a1; }; #define todeg(xAngle) (((double) (xAngle)) / 64.0) #define RIGHT_END 0 #define LEFT_END 1 typedef struct _miArcJoin { int arcIndex0, arcIndex1; int phase0, phase1; int end0, end1; } miArcJoinRec, *miArcJoinPtr; typedef struct _miArcCap { int arcIndex; int end; } miArcCapRec, *miArcCapPtr; typedef struct _miArcFace { SppPointRec clock; SppPointRec center; SppPointRec counterClock; } miArcFaceRec, *miArcFacePtr; typedef struct _miArcData { xArc arc; int render; /* non-zero means render after drawing */ int join; /* related join */ int cap; /* related cap */ int selfJoin; /* final dash meets first dash */ miArcFaceRec bounds[2]; double x0, y0, x1, y1; } miArcDataRec, *miArcDataPtr; /* * This is an entire sequence of arcs, computed and categorized according * to operation. miDashArcs generates either one or two of these. */ typedef struct _miPolyArc { int narcs; miArcDataPtr arcs; int ncaps; miArcCapPtr caps; int njoins; miArcJoinPtr joins; } miPolyArcRec, *miPolyArcPtr; static void fillSpans(DrawablePtr pDrawable, GCPtr pGC); static void newFinalSpan(int y, int xmin, int xmax); static void drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr left); static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc * tarc, int lw, miArcFacePtr left, miArcFacePtr right); static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft, miArcFacePtr pRight, int xOrgLeft, int yOrgLeft, double xFtransLeft, double yFtransLeft, int xOrgRight, int yOrgRight, double xFtransRight, double yFtransRight); static void miArcCap(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pFace, int end, int xOrg, int yOrg, double xFtrans, double yFtrans); static void miRoundCap(DrawablePtr pDraw, GCPtr pGC, SppPointRec pCenter, SppPointRec pEnd, SppPointRec pCorner, SppPointRec pOtherCorner, int fLineEnd, int xOrg, int yOrg, double xFtrans, double yFtrans); static void miFreeArcs(miPolyArcPtr arcs, GCPtr pGC); static miPolyArcPtr miComputeArcs(xArc * parcs, int narcs, GCPtr pGC); static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr * ppPts); #define CUBED_ROOT_2 1.2599210498948732038115849718451499938964 #define CUBED_ROOT_4 1.5874010519681993173435330390930175781250 /* * draw one segment of the arc using the arc spans generation routines */ static void miArcSegment(DrawablePtr pDraw, GCPtr pGC, xArc tarc, miArcFacePtr right, miArcFacePtr left) { int l = pGC->lineWidth; int a0, a1, startAngle, endAngle; miArcFacePtr temp; if (!l) l = 1; if (tarc.width == 0 || tarc.height == 0) { drawZeroArc(pDraw, pGC, &tarc, l, left, right); return; } if (pGC->miTranslate) { tarc.x += pDraw->x; tarc.y += pDraw->y; } a0 = tarc.angle1; a1 = tarc.angle2; if (a1 > FULLCIRCLE) a1 = FULLCIRCLE; else if (a1 < -FULLCIRCLE) a1 = -FULLCIRCLE; if (a1 < 0) { startAngle = a0 + a1; endAngle = a0; temp = right; right = left; left = temp; } else { startAngle = a0; endAngle = a0 + a1; } /* * bounds check the two angles */ if (startAngle < 0) startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE; if (startAngle >= FULLCIRCLE) startAngle = startAngle % FULLCIRCLE; if (endAngle < 0) endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE; if (endAngle > FULLCIRCLE) endAngle = (endAngle - 1) % FULLCIRCLE + 1; if ((startAngle == endAngle) && a1) { startAngle = 0; endAngle = FULLCIRCLE; } drawArc(&tarc, l, startAngle, endAngle, right, left); } /* Three equations combine to describe the boundaries of the arc x^2/w^2 + y^2/h^2 = 1 ellipse itself (X-x)^2 + (Y-y)^2 = r^2 circle at (x, y) on the ellipse (Y-y) = (X-x)*w^2*y/(h^2*x) normal at (x, y) on the ellipse These lead to a quartic relating Y and y y^4 - (2Y)y^3 + (Y^2 + (h^4 - w^2*r^2)/(w^2 - h^2))y^2 - (2Y*h^4/(w^2 - h^2))y + (Y^2*h^4)/(w^2 - h^2) = 0 The reducible cubic obtained from this quartic is z^3 - (3N)z^2 - 2V = 0 where N = (Y^2 + (h^4 - w^2*r^2/(w^2 - h^2)))/6 V = w^2*r^2*Y^2*h^4/(4 *(w^2 - h^2)^2) Let t = z - N p = -N^2 q = -N^3 - V Then we get t^3 + 3pt + 2q = 0 The discriminant of this cubic is D = q^2 + p^3 When D > 0, a real root is obtained as z = N + cbrt(-q+sqrt(D)) + cbrt(-q-sqrt(D)) When D < 0, a real root is obtained as z = N - 2m*cos(acos(-q/m^3)/3) where m = sqrt(|p|) * sign(q) Given a real root Z of the cubic, the roots of the quartic are the roots of the two quadratics y^2 + ((b+A)/2)y + (Z + (bZ - d)/A) = 0 where A = +/- sqrt(8Z + b^2 - 4c) b, c, d are the cubic, quadratic, and linear coefficients of the quartic Some experimentation is then required to determine which solutions correspond to the inner and outer boundaries. */ typedef struct { short lx, lw, rx, rw; } miArcSpan; typedef struct { miArcSpan *spans; int count1, count2, k; char top, bot, hole; } miArcSpanData; static void drawQuadrant(struct arc_def *def, struct accelerators *acc, int a0, int a1, int mask, miArcFacePtr right, miArcFacePtr left, miArcSpanData * spdata); static void miComputeCircleSpans(int lw, xArc * parc, miArcSpanData * spdata) { miArcSpan *span; int doinner; int x, y, e; int xk, yk, xm, ym, dx, dy; int slw, inslw; int inx = 0, iny, ine = 0; int inxk = 0, inyk = 0, inxm = 0, inym = 0; doinner = -lw; slw = parc->width - doinner; y = parc->height >> 1; dy = parc->height & 1; dx = 1 - dy; MIWIDEARCSETUP(x, y, dy, slw, e, xk, xm, yk, ym); inslw = parc->width + doinner; if (inslw > 0) { spdata->hole = spdata->top; MIWIDEARCSETUP(inx, iny, dy, inslw, ine, inxk, inxm, inyk, inym); } else { spdata->hole = FALSE; doinner = -y; } spdata->count1 = -doinner - spdata->top; spdata->count2 = y + doinner; span = spdata->spans; while (y) { MIFILLARCSTEP(slw); span->lx = dy - x; if (++doinner <= 0) { span->lw = slw; span->rx = 0; span->rw = span->lx + slw; } else { MIFILLINARCSTEP(inslw); span->lw = x - inx; span->rx = dy - inx + inslw; span->rw = inx - x + slw - inslw; } span++; } if (spdata->bot) { if (spdata->count2) spdata->count2--; else { if (lw > (int) parc->height) span[-1].rx = span[-1].rw = -((lw - (int) parc->height) >> 1); else span[-1].rw = 0; spdata->count1--; } } } static void miComputeEllipseSpans(int lw, xArc * parc, miArcSpanData * spdata) { miArcSpan *span; double w, h, r, xorg; double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs; double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm; int flip, solution; w = (double) parc->width / 2.0; h = (double) parc->height / 2.0; r = lw / 2.0; rs = r * r; Hs = h * h; WH = w * w - Hs; Nk = w * r; Vk = (Nk * Hs) / (WH + WH); Hf = Hs * Hs; Nk = (Hf - Nk * Nk) / WH; Fk = Hf / WH; hepp = h + EPSILON; hepm = h - EPSILON; K = h + ((lw - 1) >> 1); span = spdata->spans; if (parc->width & 1) xorg = .5; else xorg = 0.0; if (spdata->top) { span->lx = 0; span->lw = 1; span++; } spdata->count1 = 0; spdata->count2 = 0; spdata->hole = (spdata->top && (int) parc->height * lw <= (int) (parc->width * parc->width) && lw < (int) parc->height); for (; K > 0.0; K -= 1.0) { N = (K * K + Nk) / 6.0; Nc = N * N * N; Vr = Vk * K; t = Nc + Vr * Vr; d = Nc + t; if (d < 0.0) { d = Nc; b = N; if ((b < 0.0) == (t < 0.0)) { b = -b; d = -d; } Z = N - 2.0 * b * cos(acos(-t / d) / 3.0); if ((Z < 0.0) == (Vr < 0.0)) flip = 2; else flip = 1; } else { d = Vr * sqrt(d); Z = N + cbrt(t + d) + cbrt(t - d); flip = 0; } A = sqrt((Z + Z) - Nk); T = (Fk - Z) * K / A; inx = 0.0; solution = FALSE; b = -A + K; d = b * b - 4 * (Z + T); if (d >= 0) { d = sqrt(d); y = (b + d) / 2; if ((y >= 0.0) && (y < hepp)) { solution = TRUE; if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; if (rs - (t * t) >= 0) t = sqrt(rs - (t * t)); else t = 0; if (flip == 2) inx = x - t; else outx = x + t; } } b = A + K; d = b * b - 4 * (Z - T); /* Because of the large magnitudes involved, we lose enough precision * that sometimes we end up with a negative value near the axis, when * it should be positive. This is a workaround. */ if (d < 0 && !solution) d = 0.0; if (d >= 0) { d = sqrt(d); y = (b + d) / 2; if (y < hepp) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; if (rs - (t * t) >= 0) inx = x - sqrt(rs - (t * t)); else inx = x; } y = (b - d) / 2; if (y >= 0.0) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; if (rs - (t * t) >= 0) t = sqrt(rs - (t * t)); else t = 0; if (flip == 1) inx = x - t; else outx = x + t; } } span->lx = ICEIL(xorg - outx); if (inx <= 0.0) { spdata->count1++; span->lw = ICEIL(xorg + outx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = -ICEIL(xorg - inx); } else { spdata->count2++; span->lw = ICEIL(xorg - inx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = ICEIL(xorg + outx) - span->rx; } span++; } if (spdata->bot) { outx = w + r; if (r >= h && r <= w) inx = 0.0; else if (Nk < 0.0 && -Nk < Hs) { inx = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk); if (inx > w - r) inx = w - r; } else inx = w - r; span->lx = ICEIL(xorg - outx); if (inx <= 0.0) { span->lw = ICEIL(xorg + outx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = -ICEIL(xorg - inx); } else { span->lw = ICEIL(xorg - inx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = ICEIL(xorg + outx) - span->rx; } } if (spdata->hole) { span = &spdata->spans[spdata->count1]; span->lw = -span->lx; span->rx = 1; span->rw = span->lw; spdata->count1--; spdata->count2++; } } static double tailX(double K, struct arc_def *def, struct arc_bound *bounds, struct accelerators *acc) { double w, h, r; double Hs, Hf, WH, Vk, Nk, Fk, Vr, N, Nc, Z, rs; double A, T, b, d, x, y, t, hepp, hepm; int flip, solution; double xs[2]; double *xp; w = def->w; h = def->h; r = def->l; rs = r * r; Hs = acc->h2; WH = -acc->h2mw2; Nk = def->w * r; Vk = (Nk * Hs) / (WH + WH); Hf = acc->h4; Nk = (Hf - Nk * Nk) / WH; if (K == 0.0) { if (Nk < 0.0 && -Nk < Hs) { xs[0] = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk); xs[1] = w - r; if (acc->left.valid && boundedLe(K, bounds->left) && !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0) return xs[1]; if (acc->right.valid && boundedLe(K, bounds->right) && !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0) return xs[1]; return xs[0]; } return w - r; } Fk = Hf / WH; hepp = h + EPSILON; hepm = h - EPSILON; N = (K * K + Nk) / 6.0; Nc = N * N * N; Vr = Vk * K; xp = xs; xs[0] = 0.0; t = Nc + Vr * Vr; d = Nc + t; if (d < 0.0) { d = Nc; b = N; if ((b < 0.0) == (t < 0.0)) { b = -b; d = -d; } Z = N - 2.0 * b * cos(acos(-t / d) / 3.0); if ((Z < 0.0) == (Vr < 0.0)) flip = 2; else flip = 1; } else { d = Vr * sqrt(d); Z = N + cbrt(t + d) + cbrt(t - d); flip = 0; } A = sqrt((Z + Z) - Nk); T = (Fk - Z) * K / A; solution = FALSE; b = -A + K; d = b * b - 4 * (Z + T); if (d >= 0 && flip == 2) { d = sqrt(d); y = (b + d) / 2; if ((y >= 0.0) && (y < hepp)) { solution = TRUE; if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; if (rs - (t * t) >= 0) t = sqrt(rs - (t * t)); else t = 0; *xp++ = x - t; } } b = A + K; d = b * b - 4 * (Z - T); /* Because of the large magnitudes involved, we lose enough precision * that sometimes we end up with a negative value near the axis, when * it should be positive. This is a workaround. */ if (d < 0 && !solution) d = 0.0; if (d >= 0) { d = sqrt(d); y = (b + d) / 2; if (y < hepp) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; if (rs - (t * t) >= 0) *xp++ = x - sqrt(rs - (t * t)); else *xp++ = x; } y = (b - d) / 2; if (y >= 0.0 && flip == 1) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; if (rs - (t * t) >= 0) t = sqrt(rs - (t * t)); else t = 0; *xp++ = x - t; } } if (xp > &xs[1]) { if (acc->left.valid && boundedLe(K, bounds->left) && !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0) return xs[1]; if (acc->right.valid && boundedLe(K, bounds->right) && !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0) return xs[1]; } return xs[0]; } static miArcSpanData * miComputeWideEllipse(int lw, xArc * parc) { miArcSpanData *spdata = NULL; int k; if (!lw) lw = 1; k = (parc->height >> 1) + ((lw - 1) >> 1); spdata = malloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2)); if (!spdata) return NULL; spdata->spans = (miArcSpan *) (spdata + 1); spdata->k = k; spdata->top = !(lw & 1) && !(parc->width & 1); spdata->bot = !(parc->height & 1); if (parc->width == parc->height) miComputeCircleSpans(lw, parc, spdata); else miComputeEllipseSpans(lw, parc, spdata); return spdata; } static void miFillWideEllipse(DrawablePtr pDraw, GCPtr pGC, xArc * parc) { DDXPointPtr points; DDXPointPtr pts; int *widths; int *wids; miArcSpanData *spdata; miArcSpan *span; int xorg, yorgu, yorgl; int n; yorgu = parc->height + pGC->lineWidth; n = (sizeof(int) * 2) * yorgu; widths = malloc(n + (sizeof(DDXPointRec) * 2) * yorgu); if (!widths) return; points = (DDXPointPtr) ((char *) widths + n); spdata = miComputeWideEllipse((int) pGC->lineWidth, parc); if (!spdata) { free(widths); return; } pts = points; wids = widths; span = spdata->spans; xorg = parc->x + (parc->width >> 1); yorgu = parc->y + (parc->height >> 1); yorgl = yorgu + (parc->height & 1); if (pGC->miTranslate) { xorg += pDraw->x; yorgu += pDraw->y; yorgl += pDraw->y; } yorgu -= spdata->k; yorgl += spdata->k; if (spdata->top) { pts->x = xorg; pts->y = yorgu - 1; pts++; *wids++ = 1; span++; } for (n = spdata->count1; --n >= 0;) { pts[0].x = xorg + span->lx; pts[0].y = yorgu; wids[0] = span->lw; pts[1].x = pts[0].x; pts[1].y = yorgl; wids[1] = wids[0]; yorgu++; yorgl--; pts += 2; wids += 2; span++; } if (spdata->hole) { pts[0].x = xorg; pts[0].y = yorgl; wids[0] = 1; pts++; wids++; } for (n = spdata->count2; --n >= 0;) { pts[0].x = xorg + span->lx; pts[0].y = yorgu; wids[0] = span->lw; pts[1].x = xorg + span->rx; pts[1].y = pts[0].y; wids[1] = span->rw; pts[2].x = pts[0].x; pts[2].y = yorgl; wids[2] = wids[0]; pts[3].x = pts[1].x; pts[3].y = pts[2].y; wids[3] = wids[1]; yorgu++; yorgl--; pts += 4; wids += 4; span++; } if (spdata->bot) { if (span->rw <= 0) { pts[0].x = xorg + span->lx; pts[0].y = yorgu; wids[0] = span->lw; pts++; wids++; } else { pts[0].x = xorg + span->lx; pts[0].y = yorgu; wids[0] = span->lw; pts[1].x = xorg + span->rx; pts[1].y = pts[0].y; wids[1] = span->rw; pts += 2; wids += 2; } } free(spdata); (*pGC->ops->FillSpans) (pDraw, pGC, pts - points, points, widths, FALSE); free(widths); } /* * miPolyArc strategy: * * If arc is zero width and solid, we don't have to worry about the rasterop * or join styles. For wide solid circles, we use a fast integer algorithm. * For wide solid ellipses, we use special case floating point code. * Otherwise, we set up pDrawTo and pGCTo according to the rasterop, then * draw using pGCTo and pDrawTo. If the raster-op was "tricky," that is, * if it involves the destination, then we use PushPixels to move the bits * from the scratch drawable to pDraw. (See the wide line code for a * fuller explanation of this.) */ void miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) { int i; xArc *parc; int xMin, xMax, yMin, yMax; int pixmapWidth = 0, pixmapHeight = 0; int xOrg = 0, yOrg = 0; int width; Bool fTricky; DrawablePtr pDrawTo; CARD32 fg, bg; GCPtr pGCTo; miPolyArcPtr polyArcs; int cap[2], join[2]; int iphase; int halfWidth; width = pGC->lineWidth; if (width == 0 && pGC->lineStyle == LineSolid) { for (i = narcs, parc = parcs; --i >= 0; parc++) miArcSegment(pDraw, pGC, *parc, (miArcFacePtr) 0, (miArcFacePtr) 0); fillSpans(pDraw, pGC); } else { if ((pGC->lineStyle == LineSolid) && narcs) { while (parcs->width && parcs->height && (parcs->angle2 >= FULLCIRCLE || parcs->angle2 <= -FULLCIRCLE)) { miFillWideEllipse(pDraw, pGC, parcs); if (!--narcs) return; parcs++; } } /* Set up pDrawTo and pGCTo based on the rasterop */ switch (pGC->alu) { case GXclear: /* 0 */ case GXcopy: /* src */ case GXcopyInverted: /* NOT src */ case GXset: /* 1 */ fTricky = FALSE; pDrawTo = pDraw; pGCTo = pGC; break; default: fTricky = TRUE; /* find bounding box around arcs */ xMin = yMin = MAXSHORT; xMax = yMax = MINSHORT; for (i = narcs, parc = parcs; --i >= 0; parc++) { xMin = min(xMin, parc->x); yMin = min(yMin, parc->y); xMax = max(xMax, (parc->x + (int) parc->width)); yMax = max(yMax, (parc->y + (int) parc->height)); } /* expand box to deal with line widths */ halfWidth = (width + 1) / 2; xMin -= halfWidth; yMin -= halfWidth; xMax += halfWidth; yMax += halfWidth; /* compute pixmap size; limit it to size of drawable */ xOrg = max(xMin, 0); yOrg = max(yMin, 0); pixmapWidth = min(xMax, pDraw->width) - xOrg; pixmapHeight = min(yMax, pDraw->height) - yOrg; /* if nothing left, return */ if ((pixmapWidth <= 0) || (pixmapHeight <= 0)) return; for (i = narcs, parc = parcs; --i >= 0; parc++) { parc->x -= xOrg; parc->y -= yOrg; } if (pGC->miTranslate) { xOrg += pDraw->x; yOrg += pDraw->y; } /* set up scratch GC */ pGCTo = GetScratchGC(1, pDraw->pScreen); if (!pGCTo) return; { ChangeGCVal gcvals[6]; gcvals[0].val = GXcopy; gcvals[1].val = 1; gcvals[2].val = 0; gcvals[3].val = pGC->lineWidth; gcvals[4].val = pGC->capStyle; gcvals[5].val = pGC->joinStyle; ChangeGC(NullClient, pGCTo, GCFunction | GCForeground | GCBackground | GCLineWidth | GCCapStyle | GCJoinStyle, gcvals); } /* allocate a 1 bit deep pixmap of the appropriate size, and * validate it */ pDrawTo = (DrawablePtr) (*pDraw->pScreen->CreatePixmap) (pDraw->pScreen, pixmapWidth, pixmapHeight, 1, CREATE_PIXMAP_USAGE_SCRATCH); if (!pDrawTo) { FreeScratchGC(pGCTo); return; } ValidateGC(pDrawTo, pGCTo); miClearDrawable(pDrawTo, pGCTo); } fg = pGC->fgPixel; bg = pGC->bgPixel; if ((pGC->fillStyle == FillTiled) || (pGC->fillStyle == FillOpaqueStippled)) bg = fg; /* the protocol sez these don't cause color changes */ polyArcs = miComputeArcs(parcs, narcs, pGC); if (!polyArcs) { if (fTricky) { (*pDraw->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); FreeScratchGC(pGCTo); } return; } cap[0] = cap[1] = 0; join[0] = join[1] = 0; for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0); iphase >= 0; iphase--) { ChangeGCVal gcval; if (iphase == 1) { gcval.val = bg; ChangeGC(NullClient, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } else if (pGC->lineStyle == LineDoubleDash) { gcval.val = fg; ChangeGC(NullClient, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } for (i = 0; i < polyArcs[iphase].narcs; i++) { miArcDataPtr arcData; arcData = &polyArcs[iphase].arcs[i]; miArcSegment(pDrawTo, pGCTo, arcData->arc, &arcData->bounds[RIGHT_END], &arcData->bounds[LEFT_END]); if (polyArcs[iphase].arcs[i].render) { fillSpans(pDrawTo, pGCTo); /* * don't cap self-joining arcs */ if (polyArcs[iphase].arcs[i].selfJoin && cap[iphase] < polyArcs[iphase].arcs[i].cap) cap[iphase]++; while (cap[iphase] < polyArcs[iphase].arcs[i].cap) { int arcIndex, end; miArcDataPtr arcData0; arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex; end = polyArcs[iphase].caps[cap[iphase]].end; arcData0 = &polyArcs[iphase].arcs[arcIndex]; miArcCap(pDrawTo, pGCTo, &arcData0->bounds[end], end, arcData0->arc.x, arcData0->arc.y, (double) arcData0->arc.width / 2.0, (double) arcData0->arc.height / 2.0); ++cap[iphase]; } while (join[iphase] < polyArcs[iphase].arcs[i].join) { int arcIndex0, arcIndex1, end0, end1; int phase0, phase1; miArcDataPtr arcData0, arcData1; miArcJoinPtr joinp; joinp = &polyArcs[iphase].joins[join[iphase]]; arcIndex0 = joinp->arcIndex0; end0 = joinp->end0; arcIndex1 = joinp->arcIndex1; end1 = joinp->end1; phase0 = joinp->phase0; phase1 = joinp->phase1; arcData0 = &polyArcs[phase0].arcs[arcIndex0]; arcData1 = &polyArcs[phase1].arcs[arcIndex1]; miArcJoin(pDrawTo, pGCTo, &arcData0->bounds[end0], &arcData1->bounds[end1], arcData0->arc.x, arcData0->arc.y, (double) arcData0->arc.width / 2.0, (double) arcData0->arc.height / 2.0, arcData1->arc.x, arcData1->arc.y, (double) arcData1->arc.width / 2.0, (double) arcData1->arc.height / 2.0); ++join[iphase]; } if (fTricky) { if (pGC->serialNumber != pDraw->serialNumber) ValidateGC(pDraw, pGC); (*pGC->ops->PushPixels) (pGC, (PixmapPtr) pDrawTo, pDraw, pixmapWidth, pixmapHeight, xOrg, yOrg); miClearDrawable((DrawablePtr) pDrawTo, pGCTo); } } } } miFreeArcs(polyArcs, pGC); if (fTricky) { (*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); FreeScratchGC(pGCTo); } } } /* Find the index of the point with the smallest y.also return the * smallest and largest y */ static int GetFPolyYBounds(SppPointPtr pts, int n, double yFtrans, int *by, int *ty) { SppPointPtr ptMin; double ymin, ymax; SppPointPtr ptsStart = pts; ptMin = pts; ymin = ymax = (pts++)->y; while (--n > 0) { if (pts->y < ymin) { ptMin = pts; ymin = pts->y; } if (pts->y > ymax) ymax = pts->y; pts++; } *by = ICEIL(ymin + yFtrans); *ty = ICEIL(ymax + yFtrans - 1); return ptMin - ptsStart; } /* * miFillSppPoly written by Todd Newman; April. 1987. * * Fill a convex polygon. If the given polygon * is not convex, then the result is undefined. * The algorithm is to order the edges from smallest * y to largest by partitioning the array into a left * edge list and a right edge list. The algorithm used * to traverse each edge is digital differencing analyzer * line algorithm with y as the major axis. There's some funny linear * interpolation involved because of the subpixel postioning. */ static void miFillSppPoly(DrawablePtr dst, GCPtr pgc, int count, /* number of points */ SppPointPtr ptsIn, /* the points */ int xTrans, int yTrans, /* Translate each point by this */ double xFtrans, double yFtrans /* translate before conversion by this amount. This provides a mechanism to match rounding errors with any shape that must meet the polygon exactly. */ ) { double xl = 0.0, xr = 0.0, /* x vals of left and right edges */ ml = 0.0, /* left edge slope */ mr = 0.0, /* right edge slope */ dy, /* delta y */ i; /* loop counter */ int y, /* current scanline */ j, imin, /* index of vertex with smallest y */ ymin, /* y-extents of polygon */ ymax, *width, *FirstWidth, /* output buffer */ *Marked; /* set if this vertex has been used */ int left, right, /* indices to first endpoints */ nextleft, nextright; /* indices to second endpoints */ DDXPointPtr ptsOut, FirstPoint; /* output buffer */ if (pgc->miTranslate) { xTrans += dst->x; yTrans += dst->y; } imin = GetFPolyYBounds(ptsIn, count, yFtrans, &ymin, &ymax); y = ymax - ymin + 1; if ((count < 3) || (y <= 0)) return; ptsOut = FirstPoint = malloc(sizeof(DDXPointRec) * y); width = FirstWidth = malloc(sizeof(int) * y); Marked = malloc(sizeof(int) * count); if (!ptsOut || !width || !Marked) { free(Marked); free(width); free(ptsOut); return; } for (j = 0; j < count; j++) Marked[j] = 0; nextleft = nextright = imin; Marked[imin] = -1; y = ICEIL(ptsIn[nextleft].y + yFtrans); /* * loop through all edges of the polygon */ do { /* add a left edge if we need to */ if ((y > (ptsIn[nextleft].y + yFtrans) || ISEQUAL(y, ptsIn[nextleft].y + yFtrans)) && Marked[nextleft] != 1) { Marked[nextleft]++; left = nextleft++; /* find the next edge, considering the end conditions */ if (nextleft >= count) nextleft = 0; /* now compute the starting point and slope */ dy = ptsIn[nextleft].y - ptsIn[left].y; if (dy != 0.0) { ml = (ptsIn[nextleft].x - ptsIn[left].x) / dy; dy = y - (ptsIn[left].y + yFtrans); xl = (ptsIn[left].x + xFtrans) + ml * max(dy, 0); } } /* add a right edge if we need to */ if ((y > ptsIn[nextright].y + yFtrans) || (ISEQUAL(y, ptsIn[nextright].y + yFtrans) && Marked[nextright] != 1)) { Marked[nextright]++; right = nextright--; /* find the next edge, considering the end conditions */ if (nextright < 0) nextright = count - 1; /* now compute the starting point and slope */ dy = ptsIn[nextright].y - ptsIn[right].y; if (dy != 0.0) { mr = (ptsIn[nextright].x - ptsIn[right].x) / dy; dy = y - (ptsIn[right].y + yFtrans); xr = (ptsIn[right].x + xFtrans) + mr * max(dy, 0); } } /* * generate scans to fill while we still have * a right edge as well as a left edge. */ i = (min(ptsIn[nextleft].y, ptsIn[nextright].y) + yFtrans) - y; if (i < EPSILON) { if (Marked[nextleft] && Marked[nextright]) { /* Arrgh, we're trapped! (no more points) * Out, we've got to get out of here before this decadence saps * our will completely! */ break; } continue; } else { j = (int) i; if (!j) j++; } while (j > 0) { int cxl, cxr; ptsOut->y = (y) + yTrans; cxl = ICEIL(xl); cxr = ICEIL(xr); /* reverse the edges if necessary */ if (xl < xr) { *(width++) = cxr - cxl; (ptsOut++)->x = cxl + xTrans; } else { *(width++) = cxl - cxr; (ptsOut++)->x = cxr + xTrans; } y++; /* increment down the edges */ xl += ml; xr += mr; j--; } } while (y <= ymax); /* Finally, fill the spans we've collected */ (*pgc->ops->FillSpans) (dst, pgc, ptsOut - FirstPoint, FirstPoint, FirstWidth, 1); free(Marked); free(FirstWidth); free(FirstPoint); } static double angleBetween(SppPointRec center, SppPointRec point1, SppPointRec point2) { double a1, a2, a; /* * reflect from X coordinates back to ellipse * coordinates -- y increasing upwards */ a1 = miDatan2(-(point1.y - center.y), point1.x - center.x); a2 = miDatan2(-(point2.y - center.y), point2.x - center.x); a = a2 - a1; if (a <= -180.0) a += 360.0; else if (a > 180.0) a -= 360.0; return a; } static void translateBounds(miArcFacePtr b, int x, int y, double fx, double fy) { fx += x; fy += y; b->clock.x -= fx; b->clock.y -= fy; b->center.x -= fx; b->center.y -= fy; b->counterClock.x -= fx; b->counterClock.y -= fy; } static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft, miArcFacePtr pRight, int xOrgLeft, int yOrgLeft, double xFtransLeft, double yFtransLeft, int xOrgRight, int yOrgRight, double xFtransRight, double yFtransRight) { SppPointRec center, corner, otherCorner; SppPointRec poly[5], e; SppPointPtr pArcPts; int cpt; SppArcRec arc; miArcFaceRec Right, Left; int polyLen = 0; int xOrg, yOrg; double xFtrans, yFtrans; double a; double ae, ac2, ec2, bc2, de; double width; xOrg = (xOrgRight + xOrgLeft) / 2; yOrg = (yOrgRight + yOrgLeft) / 2; xFtrans = (xFtransLeft + xFtransRight) / 2; yFtrans = (yFtransLeft + yFtransRight) / 2; Right = *pRight; translateBounds(&Right, xOrg - xOrgRight, yOrg - yOrgRight, xFtrans - xFtransRight, yFtrans - yFtransRight); Left = *pLeft; translateBounds(&Left, xOrg - xOrgLeft, yOrg - yOrgLeft, xFtrans - xFtransLeft, yFtrans - yFtransLeft); pRight = &Right; pLeft = &Left; if (pRight->clock.x == pLeft->counterClock.x && pRight->clock.y == pLeft->counterClock.y) return; center = pRight->center; if (0 <= (a = angleBetween(center, pRight->clock, pLeft->counterClock)) && a <= 180.0) { corner = pRight->clock; otherCorner = pLeft->counterClock; } else { a = angleBetween(center, pLeft->clock, pRight->counterClock); corner = pLeft->clock; otherCorner = pRight->counterClock; } switch (pGC->joinStyle) { case JoinRound: width = (pGC->lineWidth ? (double) pGC->lineWidth : (double) 1); arc.x = center.x - width / 2; arc.y = center.y - width / 2; arc.width = width; arc.height = width; arc.angle1 = -miDatan2(corner.y - center.y, corner.x - center.x); arc.angle2 = a; pArcPts = malloc(3 * sizeof(SppPointRec)); if (!pArcPts) return; pArcPts[0].x = otherCorner.x; pArcPts[0].y = otherCorner.y; pArcPts[1].x = center.x; pArcPts[1].y = center.y; pArcPts[2].x = corner.x; pArcPts[2].y = corner.y; if ((cpt = miGetArcPts(&arc, 3, &pArcPts))) { /* by drawing with miFillSppPoly and setting the endpoints of the arc * to be the corners, we assure that the cap will meet up with the * rest of the line */ miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans); } free(pArcPts); return; case JoinMiter: /* * don't miter arcs with less than 11 degrees between them */ if (a < 169.0) { poly[0] = corner; poly[1] = center; poly[2] = otherCorner; bc2 = (corner.x - otherCorner.x) * (corner.x - otherCorner.x) + (corner.y - otherCorner.y) * (corner.y - otherCorner.y); ec2 = bc2 / 4; ac2 = (corner.x - center.x) * (corner.x - center.x) + (corner.y - center.y) * (corner.y - center.y); ae = sqrt(ac2 - ec2); de = ec2 / ae; e.x = (corner.x + otherCorner.x) / 2; e.y = (corner.y + otherCorner.y) / 2; poly[3].x = e.x + de * (e.x - center.x) / ae; poly[3].y = e.y + de * (e.y - center.y) / ae; poly[4] = corner; polyLen = 5; break; } case JoinBevel: poly[0] = corner; poly[1] = center; poly[2] = otherCorner; poly[3] = corner; polyLen = 4; break; } miFillSppPoly(pDraw, pGC, polyLen, poly, xOrg, yOrg, xFtrans, yFtrans); } /*ARGSUSED*/ static void miArcCap(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pFace, int end, int xOrg, int yOrg, double xFtrans, double yFtrans) { SppPointRec corner, otherCorner, center, endPoint, poly[5]; corner = pFace->clock; otherCorner = pFace->counterClock; center = pFace->center; switch (pGC->capStyle) { case CapProjecting: poly[0].x = otherCorner.x; poly[0].y = otherCorner.y; poly[1].x = corner.x; poly[1].y = corner.y; poly[2].x = corner.x - (center.y - corner.y); poly[2].y = corner.y + (center.x - corner.x); poly[3].x = otherCorner.x - (otherCorner.y - center.y); poly[3].y = otherCorner.y + (otherCorner.x - center.x); poly[4].x = otherCorner.x; poly[4].y = otherCorner.y; miFillSppPoly(pDraw, pGC, 5, poly, xOrg, yOrg, xFtrans, yFtrans); break; case CapRound: /* * miRoundCap just needs these to be unequal. */ endPoint = center; endPoint.x = endPoint.x + 100; miRoundCap(pDraw, pGC, center, endPoint, corner, otherCorner, 0, -xOrg, -yOrg, xFtrans, yFtrans); break; } } /* MIROUNDCAP -- a private helper function * Put Rounded cap on end. pCenter is the center of this end of the line * pEnd is the center of the other end of the line. pCorner is one of the * two corners at this end of the line. * NOTE: pOtherCorner must be counter-clockwise from pCorner. */ /*ARGSUSED*/ static void miRoundCap(DrawablePtr pDraw, GCPtr pGC, SppPointRec pCenter, SppPointRec pEnd, SppPointRec pCorner, SppPointRec pOtherCorner, int fLineEnd, int xOrg, int yOrg, double xFtrans, double yFtrans) { int cpt; double width; SppArcRec arc; SppPointPtr pArcPts; width = (pGC->lineWidth ? (double) pGC->lineWidth : (double) 1); arc.x = pCenter.x - width / 2; arc.y = pCenter.y - width / 2; arc.width = width; arc.height = width; arc.angle1 = -miDatan2(pCorner.y - pCenter.y, pCorner.x - pCenter.x); if (PTISEQUAL(pCenter, pEnd)) arc.angle2 = -180.0; else { arc.angle2 = -miDatan2(pOtherCorner.y - pCenter.y, pOtherCorner.x - pCenter.x) - arc.angle1; if (arc.angle2 < 0) arc.angle2 += 360.0; } pArcPts = (SppPointPtr) NULL; if ((cpt = miGetArcPts(&arc, 0, &pArcPts))) { /* by drawing with miFillSppPoly and setting the endpoints of the arc * to be the corners, we assure that the cap will meet up with the * rest of the line */ miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans); } free(pArcPts); } /* * To avoid inaccuracy at the cardinal points, use trig functions * which are exact for those angles */ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 #endif #define Dsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0))) #define Dcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0))) #define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-(a)) % (b)) static double miDcos(double a) { int i; if (floor(a / 90) == a / 90) { i = (int) (a / 90.0); switch (mod(i, 4)) { case 0: return 1; case 1: return 0; case 2: return -1; case 3: return 0; } } return cos(a * M_PI / 180.0); } static double miDsin(double a) { int i; if (floor(a / 90) == a / 90) { i = (int) (a / 90.0); switch (mod(i, 4)) { case 0: return 0; case 1: return 1; case 2: return 0; case 3: return -1; } } return sin(a * M_PI / 180.0); } static double miDasin(double v) { if (v == 0) return 0.0; if (v == 1.0) return 90.0; if (v == -1.0) return -90.0; return asin(v) * (180.0 / M_PI); } static double miDatan2(double dy, double dx) { if (dy == 0) { if (dx >= 0) return 0.0; return 180.0; } else if (dx == 0) { if (dy > 0) return 90.0; return -90.0; } else if (fabs(dy) == fabs(dx)) { if (dy > 0) { if (dx > 0) return 45.0; return 135.0; } else { if (dx > 0) return 315.0; return 225.0; } } else { return atan2(dy, dx) * (180.0 / M_PI); } } /* MIGETARCPTS -- Converts an arc into a set of line segments -- a helper * routine for filled arc and line (round cap) code. * Returns the number of points in the arc. Note that it takes a pointer * to a pointer to where it should put the points and an index (cpt). * This procedure allocates the space necessary to fit the arc points. * Sometimes it's convenient for those points to be at the end of an existing * array. (For example, if we want to leave a spare point to make sectors * instead of segments.) So we pass in the malloc()ed chunk that contains the * array and an index saying where we should start stashing the points. * If there isn't an array already, we just pass in a null pointer and * count on realloc() to handle the null pointer correctly. */ static int miGetArcPts(SppArcPtr parc, /* points to an arc */ int cpt, /* number of points already in arc list */ SppPointPtr * ppPts) { /* pointer to pointer to arc-list -- modified */ double st, /* Start Theta, start angle */ et, /* End Theta, offset from start theta */ dt, /* Delta Theta, angle to sweep ellipse */ cdt, /* Cos Delta Theta, actually 2 cos(dt) */ x0, y0, /* the recurrence formula needs two points to start */ x1, y1, x2, y2, /* this will be the new point generated */ xc, yc; /* the center point */ int count, i; SppPointPtr poly; /* The spec says that positive angles indicate counterclockwise motion. * Given our coordinate system (with 0,0 in the upper left corner), * the screen appears flipped in Y. The easiest fix is to negate the * angles given */ st = -parc->angle1; et = -parc->angle2; /* Try to get a delta theta that is within 1/2 pixel. Then adjust it * so that it divides evenly into the total. * I'm just using cdt 'cause I'm lazy. */ cdt = parc->width; if (parc->height > cdt) cdt = parc->height; cdt /= 2.0; if (cdt <= 0) return 0; if (cdt < 1.0) cdt = 1.0; dt = miDasin(1.0 / cdt); /* minimum step necessary */ count = et / dt; count = abs(count) + 1; dt = et / count; count++; cdt = 2 * miDcos(dt); if (!(poly = (SppPointPtr) realloc((void *) *ppPts, (cpt + count) * sizeof(SppPointRec)))) return 0; *ppPts = poly; xc = parc->width / 2.0; /* store half width and half height */ yc = parc->height / 2.0; x0 = xc * miDcos(st); y0 = yc * miDsin(st); x1 = xc * miDcos(st + dt); y1 = yc * miDsin(st + dt); xc += parc->x; /* by adding initial point, these become */ yc += parc->y; /* the center point */ poly[cpt].x = (xc + x0); poly[cpt].y = (yc + y0); poly[cpt + 1].x = (xc + x1); poly[cpt + 1].y = (yc + y1); for (i = 2; i < count; i++) { x2 = cdt * x1 - x0; y2 = cdt * y1 - y0; poly[cpt + i].x = (xc + x2); poly[cpt + i].y = (yc + y2); x0 = x1; y0 = y1; x1 = x2; y1 = y2; } /* adjust the last point */ if (abs(parc->angle2) >= 360.0) poly[cpt + i - 1] = poly[0]; else { poly[cpt + i - 1].x = (miDcos(st + et) * parc->width / 2.0 + xc); poly[cpt + i - 1].y = (miDsin(st + et) * parc->height / 2.0 + yc); } return count; } struct arcData { double x0, y0, x1, y1; int selfJoin; }; #define ADD_REALLOC_STEP 20 static void addCap(miArcCapPtr * capsp, int *ncapsp, int *sizep, int end, int arcIndex) { int newsize; miArcCapPtr cap; if (*ncapsp == *sizep) { newsize = *sizep + ADD_REALLOC_STEP; cap = (miArcCapPtr) realloc(*capsp, newsize * sizeof(**capsp)); if (!cap) return; *sizep = newsize; *capsp = cap; } cap = &(*capsp)[*ncapsp]; cap->end = end; cap->arcIndex = arcIndex; ++*ncapsp; } static void addJoin(miArcJoinPtr * joinsp, int *njoinsp, int *sizep, int end0, int index0, int phase0, int end1, int index1, int phase1) { int newsize; miArcJoinPtr join; if (*njoinsp == *sizep) { newsize = *sizep + ADD_REALLOC_STEP; join = (miArcJoinPtr) realloc(*joinsp, newsize * sizeof(**joinsp)); if (!join) return; *sizep = newsize; *joinsp = join; } join = &(*joinsp)[*njoinsp]; join->end0 = end0; join->arcIndex0 = index0; join->phase0 = phase0; join->end1 = end1; join->arcIndex1 = index1; join->phase1 = phase1; ++*njoinsp; } static miArcDataPtr addArc(miArcDataPtr * arcsp, int *narcsp, int *sizep, xArc * xarc) { int newsize; miArcDataPtr arc; if (*narcsp == *sizep) { newsize = *sizep + ADD_REALLOC_STEP; arc = (miArcDataPtr) realloc(*arcsp, newsize * sizeof(**arcsp)); if (!arc) return NULL; *sizep = newsize; *arcsp = arc; } arc = &(*arcsp)[*narcsp]; arc->arc = *xarc; ++*narcsp; return arc; } static void miFreeArcs(miPolyArcPtr arcs, GCPtr pGC) { int iphase; for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0); iphase >= 0; iphase--) { if (arcs[iphase].narcs > 0) free(arcs[iphase].arcs); if (arcs[iphase].njoins > 0) free(arcs[iphase].joins); if (arcs[iphase].ncaps > 0) free(arcs[iphase].caps); } free(arcs); } /* * map angles to radial distance. This only deals with the first quadrant */ /* * a polygonal approximation to the arc for computing arc lengths */ #define DASH_MAP_SIZE 91 #define dashIndexToAngle(di) ((((double) (di)) * 90.0) / ((double) DASH_MAP_SIZE - 1)) #define xAngleToDashIndex(xa) ((((long) (xa)) * (DASH_MAP_SIZE - 1)) / (90 * 64)) #define dashIndexToXAngle(di) ((((long) (di)) * (90 * 64)) / (DASH_MAP_SIZE - 1)) #define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1))) typedef struct { double map[DASH_MAP_SIZE]; } dashMap; static int computeAngleFromPath(int startAngle, int endAngle, dashMap * map, int *lenp, int backwards); static void computeDashMap(xArc * arcp, dashMap * map) { int di; double a, x, y, prevx = 0.0, prevy = 0.0, dist; for (di = 0; di < DASH_MAP_SIZE; di++) { a = dashIndexToAngle(di); x = ((double) arcp->width / 2.0) * miDcos(a); y = ((double) arcp->height / 2.0) * miDsin(a); if (di == 0) { map->map[di] = 0.0; } else { dist = hypot(x - prevx, y - prevy); map->map[di] = map->map[di - 1] + dist; } prevx = x; prevy = y; } } typedef enum { HORIZONTAL, VERTICAL, OTHER } arcTypes; /* this routine is a bit gory */ static miPolyArcPtr miComputeArcs(xArc * parcs, int narcs, GCPtr pGC) { int isDashed, isDoubleDash; int dashOffset; miPolyArcPtr arcs; int start, i, j, k = 0, nexti, nextk = 0; int joinSize[2]; int capSize[2]; int arcSize[2]; int angle2; double a0, a1; struct arcData *data; miArcDataPtr arc; xArc xarc; int iphase, prevphase = 0, joinphase; int arcsJoin; int selfJoin; int iDash = 0, dashRemaining = 0; int iDashStart = 0, dashRemainingStart = 0, iphaseStart; int startAngle, spanAngle, endAngle, backwards = 0; int prevDashAngle, dashAngle; dashMap map; isDashed = !(pGC->lineStyle == LineSolid); isDoubleDash = (pGC->lineStyle == LineDoubleDash); dashOffset = pGC->dashOffset; data = malloc(narcs * sizeof(struct arcData)); if (!data) return NULL; arcs = malloc(sizeof(*arcs) * (isDoubleDash ? 2 : 1)); if (!arcs) { free(data); return NULL; } for (i = 0; i < narcs; i++) { a0 = todeg(parcs[i].angle1); angle2 = parcs[i].angle2; if (angle2 > FULLCIRCLE) angle2 = FULLCIRCLE; else if (angle2 < -FULLCIRCLE) angle2 = -FULLCIRCLE; data[i].selfJoin = angle2 == FULLCIRCLE || angle2 == -FULLCIRCLE; a1 = todeg(parcs[i].angle1 + angle2); data[i].x0 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos(a0)); data[i].y0 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin(a0)); data[i].x1 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos(a1)); data[i].y1 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin(a1)); } for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) { arcs[iphase].njoins = 0; arcs[iphase].joins = 0; joinSize[iphase] = 0; arcs[iphase].ncaps = 0; arcs[iphase].caps = 0; capSize[iphase] = 0; arcs[iphase].narcs = 0; arcs[iphase].arcs = 0; arcSize[iphase] = 0; } iphase = 0; if (isDashed) { iDash = 0; dashRemaining = pGC->dash[0]; while (dashOffset > 0) { if (dashOffset >= dashRemaining) { dashOffset -= dashRemaining; iphase = iphase ? 0 : 1; iDash++; if (iDash == pGC->numInDashList) iDash = 0; dashRemaining = pGC->dash[iDash]; } else { dashRemaining -= dashOffset; dashOffset = 0; } } iDashStart = iDash; dashRemainingStart = dashRemaining; } iphaseStart = iphase; for (i = narcs - 1; i >= 0; i--) { j = i + 1; if (j == narcs) j = 0; if (data[i].selfJoin || i == j || (UNEQUAL(data[i].x1, data[j].x0) || UNEQUAL(data[i].y1, data[j].y0))) { if (iphase == 0 || isDoubleDash) addCap(&arcs[iphase].caps, &arcs[iphase].ncaps, &capSize[iphase], RIGHT_END, 0); break; } } start = i + 1; if (start == narcs) start = 0; i = start; for (;;) { j = i + 1; if (j == narcs) j = 0; nexti = i + 1; if (nexti == narcs) nexti = 0; if (isDashed) { /* ** deal with dashed arcs. Use special rules for certain 0 area arcs. ** Presumably, the other 0 area arcs still aren't done right. */ arcTypes arcType = OTHER; CARD16 thisLength; if (parcs[i].height == 0 && (parcs[i].angle1 % FULLCIRCLE) == 0x2d00 && parcs[i].angle2 == 0x2d00) arcType = HORIZONTAL; else if (parcs[i].width == 0 && (parcs[i].angle1 % FULLCIRCLE) == 0x1680 && parcs[i].angle2 == 0x2d00) arcType = VERTICAL; if (arcType == OTHER) { /* * precompute an approximation map */ computeDashMap(&parcs[i], &map); /* * compute each individual dash segment using the path * length function */ startAngle = parcs[i].angle1; spanAngle = parcs[i].angle2; if (spanAngle > FULLCIRCLE) spanAngle = FULLCIRCLE; else if (spanAngle < -FULLCIRCLE) spanAngle = -FULLCIRCLE; if (startAngle < 0) startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE; if (startAngle >= FULLCIRCLE) startAngle = startAngle % FULLCIRCLE; endAngle = startAngle + spanAngle; backwards = spanAngle < 0; } else { xarc = parcs[i]; if (arcType == VERTICAL) { xarc.angle1 = 0x1680; startAngle = parcs[i].y; endAngle = startAngle + parcs[i].height; } else { xarc.angle1 = 0x2d00; startAngle = parcs[i].x; endAngle = startAngle + parcs[i].width; } } dashAngle = startAngle; selfJoin = data[i].selfJoin && (iphase == 0 || isDoubleDash); /* * add dashed arcs to each bucket */ arc = 0; while (dashAngle != endAngle) { prevDashAngle = dashAngle; if (arcType == OTHER) { dashAngle = computeAngleFromPath(prevDashAngle, endAngle, &map, &dashRemaining, backwards); /* avoid troubles with huge arcs and small dashes */ if (dashAngle == prevDashAngle) { if (backwards) dashAngle--; else dashAngle++; } } else { thisLength = (dashAngle + dashRemaining <= endAngle) ? dashRemaining : endAngle - dashAngle; if (arcType == VERTICAL) { xarc.y = dashAngle; xarc.height = thisLength; } else { xarc.x = dashAngle; xarc.width = thisLength; } dashAngle += thisLength; dashRemaining -= thisLength; } if (iphase == 0 || isDoubleDash) { if (arcType == OTHER) { xarc = parcs[i]; spanAngle = prevDashAngle; if (spanAngle < 0) spanAngle = FULLCIRCLE - (-spanAngle) % FULLCIRCLE; if (spanAngle >= FULLCIRCLE) spanAngle = spanAngle % FULLCIRCLE; xarc.angle1 = spanAngle; spanAngle = dashAngle - prevDashAngle; if (backwards) { if (dashAngle > prevDashAngle) spanAngle = -FULLCIRCLE + spanAngle; } else { if (dashAngle < prevDashAngle) spanAngle = FULLCIRCLE + spanAngle; } if (spanAngle > FULLCIRCLE) spanAngle = FULLCIRCLE; if (spanAngle < -FULLCIRCLE) spanAngle = -FULLCIRCLE; xarc.angle2 = spanAngle; } arc = addArc(&arcs[iphase].arcs, &arcs[iphase].narcs, &arcSize[iphase], &xarc); if (!arc) goto arcfail; /* * cap each end of an on/off dash */ if (!isDoubleDash) { if (prevDashAngle != startAngle) { addCap(&arcs[iphase].caps, &arcs[iphase].ncaps, &capSize[iphase], RIGHT_END, arc - arcs[iphase].arcs); } if (dashAngle != endAngle) { addCap(&arcs[iphase].caps, &arcs[iphase].ncaps, &capSize[iphase], LEFT_END, arc - arcs[iphase].arcs); } } arc->cap = arcs[iphase].ncaps; arc->join = arcs[iphase].njoins; arc->render = 0; arc->selfJoin = 0; if (dashAngle == endAngle) arc->selfJoin = selfJoin; } prevphase = iphase; if (dashRemaining <= 0) { ++iDash; if (iDash == pGC->numInDashList) iDash = 0; iphase = iphase ? 0 : 1; dashRemaining = pGC->dash[iDash]; } } /* * make sure a place exists for the position data when * drawing a zero-length arc */ if (startAngle == endAngle) { prevphase = iphase; if (!isDoubleDash && iphase == 1) prevphase = 0; arc = addArc(&arcs[prevphase].arcs, &arcs[prevphase].narcs, &arcSize[prevphase], &parcs[i]); if (!arc) goto arcfail; arc->join = arcs[prevphase].njoins; arc->cap = arcs[prevphase].ncaps; arc->selfJoin = data[i].selfJoin; } } else { arc = addArc(&arcs[iphase].arcs, &arcs[iphase].narcs, &arcSize[iphase], &parcs[i]); if (!arc) goto arcfail; arc->join = arcs[iphase].njoins; arc->cap = arcs[iphase].ncaps; arc->selfJoin = data[i].selfJoin; prevphase = iphase; } if (prevphase == 0 || isDoubleDash) k = arcs[prevphase].narcs - 1; if (iphase == 0 || isDoubleDash) nextk = arcs[iphase].narcs; if (nexti == start) { nextk = 0; if (isDashed) { iDash = iDashStart; iphase = iphaseStart; dashRemaining = dashRemainingStart; } } arcsJoin = narcs > 1 && i != j && ISEQUAL(data[i].x1, data[j].x0) && ISEQUAL(data[i].y1, data[j].y0) && !data[i].selfJoin && !data[j].selfJoin; if (arc) { if (arcsJoin) arc->render = 0; else arc->render = 1; } if (arcsJoin && (prevphase == 0 || isDoubleDash) && (iphase == 0 || isDoubleDash)) { joinphase = iphase; if (isDoubleDash) { if (nexti == start) joinphase = iphaseStart; /* * if the join is right at the dash, * draw the join in foreground * This is because the foreground * arcs are computed second, the results * of which are needed to draw the join */ if (joinphase != prevphase) joinphase = 0; } if (joinphase == 0 || isDoubleDash) { addJoin(&arcs[joinphase].joins, &arcs[joinphase].njoins, &joinSize[joinphase], LEFT_END, k, prevphase, RIGHT_END, nextk, iphase); arc->join = arcs[prevphase].njoins; } } else { /* * cap the left end of this arc * unless it joins itself */ if ((prevphase == 0 || isDoubleDash) && !arc->selfJoin) { addCap(&arcs[prevphase].caps, &arcs[prevphase].ncaps, &capSize[prevphase], LEFT_END, k); arc->cap = arcs[prevphase].ncaps; } if (isDashed && !arcsJoin) { iDash = iDashStart; iphase = iphaseStart; dashRemaining = dashRemainingStart; } nextk = arcs[iphase].narcs; if (nexti == start) { nextk = 0; iDash = iDashStart; iphase = iphaseStart; dashRemaining = dashRemainingStart; } /* * cap the right end of the next arc. If the * next arc is actually the first arc, only * cap it if it joins with this arc. This * case will occur when the final dash segment * of an on/off dash is off. Of course, this * cap will be drawn at a strange time, but that * hardly matters... */ if ((iphase == 0 || isDoubleDash) && (nexti != start || (arcsJoin && isDashed))) addCap(&arcs[iphase].caps, &arcs[iphase].ncaps, &capSize[iphase], RIGHT_END, nextk); } i = nexti; if (i == start) break; } /* * make sure the last section is rendered */ for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) if (arcs[iphase].narcs > 0) { arcs[iphase].arcs[arcs[iphase].narcs - 1].render = 1; arcs[iphase].arcs[arcs[iphase].narcs - 1].join = arcs[iphase].njoins; arcs[iphase].arcs[arcs[iphase].narcs - 1].cap = arcs[iphase].ncaps; } free(data); return arcs; arcfail: miFreeArcs(arcs, pGC); free(data); return NULL; } static double angleToLength(int angle, dashMap * map) { double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen; int di; int excess; Bool oddSide = FALSE; totallen = 0; if (angle >= 0) { while (angle >= 90 * 64) { angle -= 90 * 64; totallen += sidelen; oddSide = !oddSide; } } else { while (angle < 0) { angle += 90 * 64; totallen -= sidelen; oddSide = !oddSide; } } if (oddSide) angle = 90 * 64 - angle; di = xAngleToDashIndex(angle); excess = angle - dashIndexToXAngle(di); len = map->map[di]; /* * linearly interpolate between this point and the next */ if (excess > 0) { excesslen = (map->map[di + 1] - map->map[di]) * ((double) excess) / dashXAngleStep; len += excesslen; } if (oddSide) totallen += (sidelen - len); else totallen += len; return totallen; } /* * len is along the arc, but may be more than one rotation */ static int lengthToAngle(double len, dashMap * map) { double sidelen = map->map[DASH_MAP_SIZE - 1]; int angle, angleexcess; Bool oddSide = FALSE; int a0, a1, a; angle = 0; /* * step around the ellipse, subtracting sidelens and * adding 90 degrees. oddSide will tell if the * map should be interpolated in reverse */ if (len >= 0) { if (sidelen == 0) return 2 * FULLCIRCLE; /* infinity */ while (len >= sidelen) { angle += 90 * 64; len -= sidelen; oddSide = !oddSide; } } else { if (sidelen == 0) return -2 * FULLCIRCLE; /* infinity */ while (len < 0) { angle -= 90 * 64; len += sidelen; oddSide = !oddSide; } } if (oddSide) len = sidelen - len; a0 = 0; a1 = DASH_MAP_SIZE - 1; /* * binary search for the closest pre-computed length */ while (a1 - a0 > 1) { a = (a0 + a1) / 2; if (len > map->map[a]) a0 = a; else a1 = a; } angleexcess = dashIndexToXAngle(a0); /* * linearly interpolate to the next point */ angleexcess += (len - map->map[a0]) / (map->map[a0 + 1] - map->map[a0]) * dashXAngleStep; if (oddSide) angle += (90 * 64) - angleexcess; else angle += angleexcess; return angle; } /* * compute the angle of an ellipse which cooresponds to * the given path length. Note that the correct solution * to this problem is an eliptic integral, we'll punt and * approximate (it's only for dashes anyway). This * approximation uses a polygon. * * The remaining portion of len is stored in *lenp - * this will be negative if the arc extends beyond * len and positive if len extends beyond the arc. */ static int computeAngleFromPath(int startAngle, int endAngle, /* normalized absolute angles in *64 degrees */ dashMap * map, int *lenp, int backwards) { int a0, a1, a; double len0; int len; a0 = startAngle; a1 = endAngle; len = *lenp; if (backwards) { /* * flip the problem around to always be * forwards */ a0 = FULLCIRCLE - a0; a1 = FULLCIRCLE - a1; } if (a1 < a0) a1 += FULLCIRCLE; len0 = angleToLength(a0, map); a = lengthToAngle(len0 + len, map); if (a > a1) { a = a1; len -= angleToLength(a1, map) - len0; } else len = 0; if (backwards) a = FULLCIRCLE - a; *lenp = len; return a; } /* * scan convert wide arcs. */ /* * draw zero width/height arcs */ static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc * tarc, int lw, miArcFacePtr left, miArcFacePtr right) { double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y; double xmax, ymax, xmin, ymin; int a0, a1; double a, startAngle, endAngle; double l, lx, ly; l = lw / 2.0; a0 = tarc->angle1; a1 = tarc->angle2; if (a1 > FULLCIRCLE) a1 = FULLCIRCLE; else if (a1 < -FULLCIRCLE) a1 = -FULLCIRCLE; w = (double) tarc->width / 2.0; h = (double) tarc->height / 2.0; /* * play in X coordinates right away */ startAngle = -((double) a0 / 64.0); endAngle = -((double) (a0 + a1) / 64.0); xmax = -w; xmin = w; ymax = -h; ymin = h; a = startAngle; for (;;) { x = w * miDcos(a); y = h * miDsin(a); if (a == startAngle) { x0 = x; y0 = y; } if (a == endAngle) { x1 = x; y1 = y; } if (x > xmax) xmax = x; if (x < xmin) xmin = x; if (y > ymax) ymax = y; if (y < ymin) ymin = y; if (a == endAngle) break; if (a1 < 0) { /* clockwise */ if (floor(a / 90.0) == floor(endAngle / 90.0)) a = endAngle; else a = 90 * (floor(a / 90.0) + 1); } else { if (ceil(a / 90.0) == ceil(endAngle / 90.0)) a = endAngle; else a = 90 * (ceil(a / 90.0) - 1); } } lx = ly = l; if ((x1 - x0) + (y1 - y0) < 0) lx = ly = -l; if (h) { ly = 0.0; lx = -lx; } else lx = 0.0; if (right) { right->center.x = x0; right->center.y = y0; right->clock.x = x0 - lx; right->clock.y = y0 - ly; right->counterClock.x = x0 + lx; right->counterClock.y = y0 + ly; } if (left) { left->center.x = x1; left->center.y = y1; left->clock.x = x1 + lx; left->clock.y = y1 + ly; left->counterClock.x = x1 - lx; left->counterClock.y = y1 - ly; } x0 = xmin; x1 = xmax; y0 = ymin; y1 = ymax; if (ymin != y1) { xmin = -l; xmax = l; } else { ymin = -l; ymax = l; } if (xmax != xmin && ymax != ymin) { int minx, maxx, miny, maxy; xRectangle rect; minx = ICEIL(xmin + w) + tarc->x; maxx = ICEIL(xmax + w) + tarc->x; miny = ICEIL(ymin + h) + tarc->y; maxy = ICEIL(ymax + h) + tarc->y; rect.x = minx; rect.y = miny; rect.width = maxx - minx; rect.height = maxy - miny; (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect); } } /* * this computes the ellipse y value associated with the * bottom of the tail. */ static void tailEllipseY(struct arc_def *def, struct accelerators *acc) { double t; acc->tail_y = 0.0; if (def->w == def->h) return; t = def->l * def->w; if (def->w > def->h) { if (t < acc->h2) return; } else { if (t > acc->h2) return; } t = 2.0 * def->h * t; t = (CUBED_ROOT_4 * acc->h2 - cbrt(t * t)) / acc->h2mw2; if (t > 0.0) acc->tail_y = def->h / CUBED_ROOT_2 * sqrt(t); } /* * inverse functions -- compute edge coordinates * from the ellipse */ static double outerXfromXY(double x, double y, struct arc_def *def, struct accelerators *acc) { return x + (x * acc->h2l) / sqrt(x * x * acc->h4 + y * y * acc->w4); } static double outerYfromXY(double x, double y, struct arc_def *def, struct accelerators *acc) { return y + (y * acc->w2l) / sqrt(x * x * acc->h4 + y * y * acc->w4); } static double innerXfromXY(double x, double y, struct arc_def *def, struct accelerators *acc) { return x - (x * acc->h2l) / sqrt(x * x * acc->h4 + y * y * acc->w4); } static double innerYfromXY(double x, double y, struct arc_def *def, struct accelerators *acc) { return y - (y * acc->w2l) / sqrt(x * x * acc->h4 + y * y * acc->w4); } static double innerYfromY(double y, struct arc_def *def, struct accelerators *acc) { double x; x = (def->w / def->h) * sqrt(acc->h2 - y * y); return y - (y * acc->w2l) / sqrt(x * x * acc->h4 + y * y * acc->w4); } static void computeLine(double x1, double y1, double x2, double y2, struct line *line) { if (y1 == y2) line->valid = 0; else { line->m = (x1 - x2) / (y1 - y2); line->b = x1 - y1 * line->m; line->valid = 1; } } /* * compute various accelerators for an ellipse. These * are simply values that are used repeatedly in * the computations */ static void computeAcc(xArc * tarc, int lw, struct arc_def *def, struct accelerators *acc) { def->w = ((double) tarc->width) / 2.0; def->h = ((double) tarc->height) / 2.0; def->l = ((double) lw) / 2.0; acc->h2 = def->h * def->h; acc->w2 = def->w * def->w; acc->h4 = acc->h2 * acc->h2; acc->w4 = acc->w2 * acc->w2; acc->h2l = acc->h2 * def->l; acc->w2l = acc->w2 * def->l; acc->h2mw2 = acc->h2 - acc->w2; acc->fromIntX = (tarc->width & 1) ? 0.5 : 0.0; acc->fromIntY = (tarc->height & 1) ? 0.5 : 0.0; acc->xorg = tarc->x + (tarc->width >> 1); acc->yorgu = tarc->y + (tarc->height >> 1); acc->yorgl = acc->yorgu + (tarc->height & 1); tailEllipseY(def, acc); } /* * compute y value bounds of various portions of the arc, * the outer edge, the ellipse and the inner edge. */ static void computeBound(struct arc_def *def, struct arc_bound *bound, struct accelerators *acc, miArcFacePtr right, miArcFacePtr left) { double t; double innerTaily; double tail_y; struct bound innerx, outerx; struct bound ellipsex; bound->ellipse.min = Dsin(def->a0) * def->h; bound->ellipse.max = Dsin(def->a1) * def->h; if (def->a0 == 45 && def->w == def->h) ellipsex.min = bound->ellipse.min; else ellipsex.min = Dcos(def->a0) * def->w; if (def->a1 == 45 && def->w == def->h) ellipsex.max = bound->ellipse.max; else ellipsex.max = Dcos(def->a1) * def->w; bound->outer.min = outerYfromXY(ellipsex.min, bound->ellipse.min, def, acc); bound->outer.max = outerYfromXY(ellipsex.max, bound->ellipse.max, def, acc); bound->inner.min = innerYfromXY(ellipsex.min, bound->ellipse.min, def, acc); bound->inner.max = innerYfromXY(ellipsex.max, bound->ellipse.max, def, acc); outerx.min = outerXfromXY(ellipsex.min, bound->ellipse.min, def, acc); outerx.max = outerXfromXY(ellipsex.max, bound->ellipse.max, def, acc); innerx.min = innerXfromXY(ellipsex.min, bound->ellipse.min, def, acc); innerx.max = innerXfromXY(ellipsex.max, bound->ellipse.max, def, acc); /* * save the line end points for the * cap code to use. Careful here, these are * in cartesean coordinates (y increasing upwards) * while the cap code uses inverted coordinates * (y increasing downwards) */ if (right) { right->counterClock.y = bound->outer.min; right->counterClock.x = outerx.min; right->center.y = bound->ellipse.min; right->center.x = ellipsex.min; right->clock.y = bound->inner.min; right->clock.x = innerx.min; } if (left) { left->clock.y = bound->outer.max; left->clock.x = outerx.max; left->center.y = bound->ellipse.max; left->center.x = ellipsex.max; left->counterClock.y = bound->inner.max; left->counterClock.x = innerx.max; } bound->left.min = bound->inner.max; bound->left.max = bound->outer.max; bound->right.min = bound->inner.min; bound->right.max = bound->outer.min; computeLine(innerx.min, bound->inner.min, outerx.min, bound->outer.min, &acc->right); computeLine(innerx.max, bound->inner.max, outerx.max, bound->outer.max, &acc->left); if (bound->inner.min > bound->inner.max) { t = bound->inner.min; bound->inner.min = bound->inner.max; bound->inner.max = t; } tail_y = acc->tail_y; if (tail_y > bound->ellipse.max) tail_y = bound->ellipse.max; else if (tail_y < bound->ellipse.min) tail_y = bound->ellipse.min; innerTaily = innerYfromY(tail_y, def, acc); if (bound->inner.min > innerTaily) bound->inner.min = innerTaily; if (bound->inner.max < innerTaily) bound->inner.max = innerTaily; bound->inneri.min = ICEIL(bound->inner.min - acc->fromIntY); bound->inneri.max = floor(bound->inner.max - acc->fromIntY); bound->outeri.min = ICEIL(bound->outer.min - acc->fromIntY); bound->outeri.max = floor(bound->outer.max - acc->fromIntY); } /* * this section computes the x value of the span at y * intersected with the specified face of the ellipse. * * this is the min/max X value over the set of normal * lines to the entire ellipse, the equation of the * normal lines is: * * ellipse_x h^2 h^2 * x = ------------ y + ellipse_x (1 - --- ) * ellipse_y w^2 w^2 * * compute the derivative with-respect-to ellipse_y and solve * for zero: * * (w^2 - h^2) ellipse_y^3 + h^4 y * 0 = - ---------------------------------- * h w ellipse_y^2 sqrt (h^2 - ellipse_y^2) * * ( h^4 y ) * ellipse_y = ( ---------- ) ^ (1/3) * ( (h^2 - w^2) ) * * The other two solutions to the equation are imaginary. * * This gives the position on the ellipse which generates * the normal with the largest/smallest x intersection point. * * Now compute the second derivative to check whether * the intersection is a minimum or maximum: * * h (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2)) * - ------------------------------------------- * w y0^3 (sqrt (h^2 - y^2)) ^ 3 * * as we only care about the sign, * * - (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2)) * * or (to use accelerators), * * y0^3 (h^2 - w^2) - h^2 y (3y0^2 - 2h^2) * */ /* * computes the position on the ellipse whose normal line * intersects the given scan line maximally */ static double hookEllipseY(double scan_y, struct arc_bound *bound, struct accelerators *acc, int left) { double ret; if (acc->h2mw2 == 0) { if ((scan_y > 0 && !left) || (scan_y < 0 && left)) return bound->ellipse.min; return bound->ellipse.max; } ret = (acc->h4 * scan_y) / (acc->h2mw2); if (ret >= 0) return cbrt(ret); else return -cbrt(-ret); } /* * computes the X value of the intersection of the * given scan line with the right side of the lower hook */ static double hookX(double scan_y, struct arc_def *def, struct arc_bound *bound, struct accelerators *acc, int left) { double ellipse_y, x; double maxMin; if (def->w != def->h) { ellipse_y = hookEllipseY(scan_y, bound, acc, left); if (boundedLe(ellipse_y, bound->ellipse)) { /* * compute the value of the second * derivative */ maxMin = ellipse_y * ellipse_y * ellipse_y * acc->h2mw2 - acc->h2 * scan_y * (3 * ellipse_y * ellipse_y - 2 * acc->h2); if ((left && maxMin > 0) || (!left && maxMin < 0)) { if (ellipse_y == 0) return def->w + left ? -def->l : def->l; x = (acc->h2 * scan_y - ellipse_y * acc->h2mw2) * sqrt(acc->h2 - ellipse_y * ellipse_y) / (def->h * def->w * ellipse_y); return x; } } } if (left) { if (acc->left.valid && boundedLe(scan_y, bound->left)) { x = intersectLine(scan_y, acc->left); } else { if (acc->right.valid) x = intersectLine(scan_y, acc->right); else x = def->w - def->l; } } else { if (acc->right.valid && boundedLe(scan_y, bound->right)) { x = intersectLine(scan_y, acc->right); } else { if (acc->left.valid) x = intersectLine(scan_y, acc->left); else x = def->w - def->l; } } return x; } /* * generate the set of spans with * the given y coordinate */ static void arcSpan(int y, int lx, int lw, int rx, int rw, struct arc_def *def, struct arc_bound *bounds, struct accelerators *acc, int mask) { int linx, loutx, rinx, routx; double x, altx; if (boundedLe(y, bounds->inneri)) { linx = -(lx + lw); rinx = rx; } else { /* * intersection with left face */ x = hookX(y + acc->fromIntY, def, bounds, acc, 1); if (acc->right.valid && boundedLe(y + acc->fromIntY, bounds->right)) { altx = intersectLine(y + acc->fromIntY, acc->right); if (altx < x) x = altx; } linx = -ICEIL(acc->fromIntX - x); rinx = ICEIL(acc->fromIntX + x); } if (boundedLe(y, bounds->outeri)) { loutx = -lx; routx = rx + rw; } else { /* * intersection with right face */ x = hookX(y + acc->fromIntY, def, bounds, acc, 0); if (acc->left.valid && boundedLe(y + acc->fromIntY, bounds->left)) { altx = x; x = intersectLine(y + acc->fromIntY, acc->left); if (x < altx) x = altx; } loutx = -ICEIL(acc->fromIntX - x); routx = ICEIL(acc->fromIntX + x); } if (routx > rinx) { if (mask & 1) newFinalSpan(acc->yorgu - y, acc->xorg + rinx, acc->xorg + routx); if (mask & 8) newFinalSpan(acc->yorgl + y, acc->xorg + rinx, acc->xorg + routx); } if (loutx > linx) { if (mask & 2) newFinalSpan(acc->yorgu - y, acc->xorg - loutx, acc->xorg - linx); if (mask & 4) newFinalSpan(acc->yorgl + y, acc->xorg - loutx, acc->xorg - linx); } } static void arcSpan0(int lx, int lw, int rx, int rw, struct arc_def *def, struct arc_bound *bounds, struct accelerators *acc, int mask) { double x; if (boundedLe(0, bounds->inneri) && acc->left.valid && boundedLe(0, bounds->left) && acc->left.b > 0) { x = def->w - def->l; if (acc->left.b < x) x = acc->left.b; lw = ICEIL(acc->fromIntX - x) - lx; rw += rx; rx = ICEIL(acc->fromIntX + x); rw -= rx; } arcSpan(0, lx, lw, rx, rw, def, bounds, acc, mask); } static void tailSpan(int y, int lw, int rw, struct arc_def *def, struct arc_bound *bounds, struct accelerators *acc, int mask) { double yy, xalt, x, lx, rx; int n; if (boundedLe(y, bounds->outeri)) arcSpan(y, 0, lw, -rw, rw, def, bounds, acc, mask); else if (def->w != def->h) { yy = y + acc->fromIntY; x = tailX(yy, def, bounds, acc); if (yy == 0.0 && x == -rw - acc->fromIntX) return; if (acc->right.valid && boundedLe(yy, bounds->right)) { rx = x; lx = -x; xalt = intersectLine(yy, acc->right); if (xalt >= -rw - acc->fromIntX && xalt <= rx) rx = xalt; n = ICEIL(acc->fromIntX + lx); if (lw > n) { if (mask & 2) newFinalSpan(acc->yorgu - y, acc->xorg + n, acc->xorg + lw); if (mask & 4) newFinalSpan(acc->yorgl + y, acc->xorg + n, acc->xorg + lw); } n = ICEIL(acc->fromIntX + rx); if (n > -rw) { if (mask & 1) newFinalSpan(acc->yorgu - y, acc->xorg - rw, acc->xorg + n); if (mask & 8) newFinalSpan(acc->yorgl + y, acc->xorg - rw, acc->xorg + n); } } arcSpan(y, ICEIL(acc->fromIntX - x), 0, ICEIL(acc->fromIntX + x), 0, def, bounds, acc, mask); } } /* * create whole arcs out of pieces. This code is * very bad. */ static struct finalSpan **finalSpans = NULL; static int finalMiny = 0, finalMaxy = -1; static int finalSize = 0; static int nspans = 0; /* total spans, not just y coords */ struct finalSpan { struct finalSpan *next; int min, max; /* x values */ }; static struct finalSpan *freeFinalSpans, *tmpFinalSpan; #define allocFinalSpan() (freeFinalSpans ?\ ((tmpFinalSpan = freeFinalSpans), \ (freeFinalSpans = freeFinalSpans->next), \ (tmpFinalSpan->next = 0), \ tmpFinalSpan) : \ realAllocSpan ()) #define SPAN_CHUNK_SIZE 128 struct finalSpanChunk { struct finalSpan data[SPAN_CHUNK_SIZE]; struct finalSpanChunk *next; }; static struct finalSpanChunk *chunks; static struct finalSpan * realAllocSpan(void) { struct finalSpanChunk *newChunk; struct finalSpan *span; int i; newChunk = malloc(sizeof(struct finalSpanChunk)); if (!newChunk) return (struct finalSpan *) NULL; newChunk->next = chunks; chunks = newChunk; freeFinalSpans = span = newChunk->data + 1; for (i = 1; i < SPAN_CHUNK_SIZE - 1; i++) { span->next = span + 1; span++; } span->next = 0; span = newChunk->data; span->next = 0; return span; } static void disposeFinalSpans(void) { struct finalSpanChunk *chunk, *next; for (chunk = chunks; chunk; chunk = next) { next = chunk->next; free(chunk); } chunks = 0; freeFinalSpans = 0; free(finalSpans); finalSpans = 0; } static void fillSpans(DrawablePtr pDrawable, GCPtr pGC) { struct finalSpan *span; DDXPointPtr xSpan; int *xWidth; int i; struct finalSpan **f; int spany; DDXPointPtr xSpans; int *xWidths; if (nspans == 0) return; xSpan = xSpans = malloc(nspans * sizeof(DDXPointRec)); xWidth = xWidths = malloc(nspans * sizeof(int)); if (xSpans && xWidths) { i = 0; f = finalSpans; for (spany = finalMiny; spany <= finalMaxy; spany++, f++) { for (span = *f; span; span = span->next) { if (span->max <= span->min) continue; xSpan->x = span->min; xSpan->y = spany; ++xSpan; *xWidth++ = span->max - span->min; ++i; } } (*pGC->ops->FillSpans) (pDrawable, pGC, i, xSpans, xWidths, TRUE); } disposeFinalSpans(); free(xSpans); free(xWidths); finalMiny = 0; finalMaxy = -1; finalSize = 0; nspans = 0; } #define SPAN_REALLOC 100 #define findSpan(y) ((finalMiny <= (y) && (y) <= finalMaxy) ? \ &finalSpans[(y) - finalMiny] : \ realFindSpan (y)) static struct finalSpan ** realFindSpan(int y) { struct finalSpan **newSpans; int newSize, newMiny, newMaxy; int change; int i; if (y < finalMiny || y > finalMaxy) { if (!finalSize) { finalMiny = y; finalMaxy = y - 1; } if (y < finalMiny) change = finalMiny - y; else change = y - finalMaxy; if (change >= SPAN_REALLOC) change += SPAN_REALLOC; else change = SPAN_REALLOC; newSize = finalSize + change; newSpans = malloc(newSize * sizeof(struct finalSpan *)); if (!newSpans) return NULL; newMiny = finalMiny; newMaxy = finalMaxy; if (y < finalMiny) newMiny = finalMiny - change; else newMaxy = finalMaxy + change; if (finalSpans) { memmove(((char *) newSpans) + (finalMiny - newMiny) * sizeof(struct finalSpan *), (char *) finalSpans, finalSize * sizeof(struct finalSpan *)); free(finalSpans); } if ((i = finalMiny - newMiny) > 0) memset((char *) newSpans, 0, i * sizeof(struct finalSpan *)); if ((i = newMaxy - finalMaxy) > 0) memset((char *) (newSpans + newSize - i), 0, i * sizeof(struct finalSpan *)); finalSpans = newSpans; finalMaxy = newMaxy; finalMiny = newMiny; finalSize = newSize; } return &finalSpans[y - finalMiny]; } static void newFinalSpan(int y, int xmin, int xmax) { struct finalSpan *x; struct finalSpan **f; struct finalSpan *oldx; struct finalSpan *prev; f = findSpan(y); if (!f) return; oldx = 0; for (;;) { prev = 0; for (x = *f; x; x = x->next) { if (x == oldx) { prev = x; continue; } if (x->min <= xmax && xmin <= x->max) { if (oldx) { oldx->min = min(x->min, xmin); oldx->max = max(x->max, xmax); if (prev) prev->next = x->next; else *f = x->next; --nspans; } else { x->min = min(x->min, xmin); x->max = max(x->max, xmax); oldx = x; } xmin = oldx->min; xmax = oldx->max; break; } prev = x; } if (!x) break; } if (!oldx) { x = allocFinalSpan(); if (x) { x->min = xmin; x->max = xmax; x->next = *f; *f = x; ++nspans; } } } static void mirrorSppPoint(int quadrant, SppPointPtr sppPoint) { switch (quadrant) { case 0: break; case 1: sppPoint->x = -sppPoint->x; break; case 2: sppPoint->x = -sppPoint->x; sppPoint->y = -sppPoint->y; break; case 3: sppPoint->y = -sppPoint->y; break; } /* * and translate to X coordinate system */ sppPoint->y = -sppPoint->y; } /* * split an arc into pieces which are scan-converted * in the first-quadrant and mirrored into position. * This is necessary as the scan-conversion code can * only deal with arcs completely contained in the * first quadrant. */ static void drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr left) { /* save end line points */ struct arc_def def; struct accelerators acc; int startq, endq, curq; int rightq, leftq = 0, righta = 0, lefta = 0; miArcFacePtr passRight, passLeft; int q0 = 0, q1 = 0, mask; struct band { int a0, a1; int mask; } band[5], sweep[20]; int bandno, sweepno; int i, j; int flipRight = 0, flipLeft = 0; int copyEnd = 0; miArcSpanData *spdata; spdata = miComputeWideEllipse(l, tarc); if (!spdata) return; if (a1 < a0) a1 += 360 * 64; startq = a0 / (90 * 64); if (a0 == a1) endq = startq; else endq = (a1 - 1) / (90 * 64); bandno = 0; curq = startq; rightq = -1; for (;;) { switch (curq) { case 0: if (a0 > 90 * 64) q0 = 0; else q0 = a0; if (a1 < 360 * 64) q1 = min(a1, 90 * 64); else q1 = 90 * 64; if (curq == startq && a0 == q0 && rightq < 0) { righta = q0; rightq = curq; } if (curq == endq && a1 == q1) { lefta = q1; leftq = curq; } break; case 1: if (a1 < 90 * 64) q0 = 0; else q0 = 180 * 64 - min(a1, 180 * 64); if (a0 > 180 * 64) q1 = 90 * 64; else q1 = 180 * 64 - max(a0, 90 * 64); if (curq == startq && 180 * 64 - a0 == q1) { righta = q1; rightq = curq; } if (curq == endq && 180 * 64 - a1 == q0) { lefta = q0; leftq = curq; } break; case 2: if (a0 > 270 * 64) q0 = 0; else q0 = max(a0, 180 * 64) - 180 * 64; if (a1 < 180 * 64) q1 = 90 * 64; else q1 = min(a1, 270 * 64) - 180 * 64; if (curq == startq && a0 - 180 * 64 == q0) { righta = q0; rightq = curq; } if (curq == endq && a1 - 180 * 64 == q1) { lefta = q1; leftq = curq; } break; case 3: if (a1 < 270 * 64) q0 = 0; else q0 = 360 * 64 - min(a1, 360 * 64); q1 = 360 * 64 - max(a0, 270 * 64); if (curq == startq && 360 * 64 - a0 == q1) { righta = q1; rightq = curq; } if (curq == endq && 360 * 64 - a1 == q0) { lefta = q0; leftq = curq; } break; } band[bandno].a0 = q0; band[bandno].a1 = q1; band[bandno].mask = 1 << curq; bandno++; if (curq == endq) break; curq++; if (curq == 4) { a0 = 0; a1 -= 360 * 64; curq = 0; endq -= 4; } } sweepno = 0; for (;;) { q0 = 90 * 64; mask = 0; /* * find left-most point */ for (i = 0; i < bandno; i++) if (band[i].a0 <= q0) { q0 = band[i].a0; q1 = band[i].a1; mask = band[i].mask; } if (!mask) break; /* * locate next point of change */ for (i = 0; i < bandno; i++) if (!(mask & band[i].mask)) { if (band[i].a0 == q0) { if (band[i].a1 < q1) q1 = band[i].a1; mask |= band[i].mask; } else if (band[i].a0 < q1) q1 = band[i].a0; } /* * create a new sweep */ sweep[sweepno].a0 = q0; sweep[sweepno].a1 = q1; sweep[sweepno].mask = mask; sweepno++; /* * subtract the sweep from the affected bands */ for (i = 0; i < bandno; i++) if (band[i].a0 == q0) { band[i].a0 = q1; /* * check if this band is empty */ if (band[i].a0 == band[i].a1) band[i].a1 = band[i].a0 = 90 * 64 + 1; } } computeAcc(tarc, l, &def, &acc); for (j = 0; j < sweepno; j++) { mask = sweep[j].mask; passRight = passLeft = 0; if (mask & (1 << rightq)) { if (sweep[j].a0 == righta) passRight = right; else if (sweep[j].a1 == righta) { passLeft = right; flipRight = 1; } } if (mask & (1 << leftq)) { if (sweep[j].a1 == lefta) { if (passLeft) copyEnd = 1; passLeft = left; } else if (sweep[j].a0 == lefta) { if (passRight) copyEnd = 1; passRight = left; flipLeft = 1; } } drawQuadrant(&def, &acc, sweep[j].a0, sweep[j].a1, mask, passRight, passLeft, spdata); } /* * when copyEnd is set, both ends of the arc were computed * at the same time; drawQuadrant only takes one end though, * so the left end will be the only one holding the data. Copy * it from there. */ if (copyEnd) *right = *left; /* * mirror the coordinates generated for the * faces of the arc */ if (right) { mirrorSppPoint(rightq, &right->clock); mirrorSppPoint(rightq, &right->center); mirrorSppPoint(rightq, &right->counterClock); if (flipRight) { SppPointRec temp; temp = right->clock; right->clock = right->counterClock; right->counterClock = temp; } } if (left) { mirrorSppPoint(leftq, &left->counterClock); mirrorSppPoint(leftq, &left->center); mirrorSppPoint(leftq, &left->clock); if (flipLeft) { SppPointRec temp; temp = left->clock; left->clock = left->counterClock; left->counterClock = temp; } } free(spdata); } static void drawQuadrant(struct arc_def *def, struct accelerators *acc, int a0, int a1, int mask, miArcFacePtr right, miArcFacePtr left, miArcSpanData * spdata) { struct arc_bound bound; double yy, x, xalt; int y, miny, maxy; int n; miArcSpan *span; def->a0 = ((double) a0) / 64.0; def->a1 = ((double) a1) / 64.0; computeBound(def, &bound, acc, right, left); yy = bound.inner.min; if (bound.outer.min < yy) yy = bound.outer.min; miny = ICEIL(yy - acc->fromIntY); yy = bound.inner.max; if (bound.outer.max > yy) yy = bound.outer.max; maxy = floor(yy - acc->fromIntY); y = spdata->k; span = spdata->spans; if (spdata->top) { if (a1 == 90 * 64 && (mask & 1)) newFinalSpan(acc->yorgu - y - 1, acc->xorg, acc->xorg + 1); span++; } for (n = spdata->count1; --n >= 0;) { if (y < miny) return; if (y <= maxy) { arcSpan(y, span->lx, -span->lx, 0, span->lx + span->lw, def, &bound, acc, mask); if (span->rw + span->rx) tailSpan(y, -span->rw, -span->rx, def, &bound, acc, mask); } y--; span++; } if (y < miny) return; if (spdata->hole) { if (y <= maxy) arcSpan(y, 0, 0, 0, 1, def, &bound, acc, mask & 0xc); } for (n = spdata->count2; --n >= 0;) { if (y < miny) return; if (y <= maxy) arcSpan(y, span->lx, span->lw, span->rx, span->rw, def, &bound, acc, mask); y--; span++; } if (spdata->bot && miny <= y && y <= maxy) { n = mask; if (y == miny) n &= 0xc; if (span->rw <= 0) { arcSpan0(span->lx, -span->lx, 0, span->lx + span->lw, def, &bound, acc, n); if (span->rw + span->rx) tailSpan(y, -span->rw, -span->rx, def, &bound, acc, n); } else arcSpan0(span->lx, span->lw, span->rx, span->rw, def, &bound, acc, n); y--; } while (y >= miny) { yy = y + acc->fromIntY; if (def->w == def->h) { xalt = def->w - def->l; x = -sqrt(xalt * xalt - yy * yy); } else { x = tailX(yy, def, &bound, acc); if (acc->left.valid && boundedLe(yy, bound.left)) { xalt = intersectLine(yy, acc->left); if (xalt < x) x = xalt; } if (acc->right.valid && boundedLe(yy, bound.right)) { xalt = intersectLine(yy, acc->right); if (xalt < x) x = xalt; } } arcSpan(y, ICEIL(acc->fromIntX - x), 0, ICEIL(acc->fromIntX + x), 0, def, &bound, acc, mask); y--; } } void miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) { if (pGC->lineWidth == 0) miZeroPolyArc(pDraw, pGC, narcs, parcs); else miWideArc(pDraw, pGC, narcs, parcs); } xorg-server-1.17.1/mi/midash.c0000664000175100017510000000644712456571574013062 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "regionstr.h" #include "mistruct.h" void miStepDash(int dist, /* distance to step */ int *pDashIndex, /* current dash */ unsigned char *pDash, /* dash list */ int numInDashList, /* total length of dash list */ int *pDashOffset /* offset into current dash */ ) { int dashIndex, dashOffset; int totallen; int i; dashIndex = *pDashIndex; dashOffset = *pDashOffset; if (dist < pDash[dashIndex] - dashOffset) { *pDashOffset = dashOffset + dist; return; } dist -= pDash[dashIndex] - dashOffset; if (++dashIndex == numInDashList) dashIndex = 0; totallen = 0; for (i = 0; i < numInDashList; i++) totallen += pDash[i]; if (totallen <= dist) dist = dist % totallen; while (dist >= pDash[dashIndex]) { dist -= pDash[dashIndex]; if (++dashIndex == numInDashList) dashIndex = 0; } *pDashIndex = dashIndex; *pDashOffset = dist; } xorg-server-1.17.1/mi/mizerarc.c0000664000175100017510000005554512362107455013421 00000000000000/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Author: Bob Scheifler, MIT X Consortium ********************************************************/ /* Derived from: * "Algorithm for drawing ellipses or hyperbolae with a digital plotter" * by M. L. V. Pitteway * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289 */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "mi.h" #include "mizerarc.h" #define FULLCIRCLE (360 * 64) #define OCTANT (45 * 64) #define QUADRANT (90 * 64) #define HALFCIRCLE (180 * 64) #define QUADRANT3 (270 * 64) #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #define Dsin(d) ((d) == 0 ? 0.0 : ((d) == QUADRANT ? 1.0 : \ ((d) == HALFCIRCLE ? 0.0 : \ ((d) == QUADRANT3 ? -1.0 : sin((double)d*(M_PI/11520.0)))))) #define Dcos(d) ((d) == 0 ? 1.0 : ((d) == QUADRANT ? 0.0 : \ ((d) == HALFCIRCLE ? -1.0 : \ ((d) == QUADRANT3 ? 0.0 : cos((double)d*(M_PI/11520.0)))))) #define EPSILON45 64 typedef struct { int skipStart; int haveStart; DDXPointRec startPt; int haveLast; int skipLast; DDXPointRec endPt; int dashIndex; int dashOffset; int dashIndexInit; int dashOffsetInit; } DashInfo; static miZeroArcPtRec oob = { 65536, 65536, 0 }; /* * (x - l)^2 / (W/2)^2 + (y + H/2)^2 / (H/2)^2 = 1 * * where l is either 0 or .5 * * alpha = 4(W^2) * beta = 4(H^2) * gamma = 0 * u = 2(W^2)H * v = 4(H^2)l * k = -4(H^2)(l^2) * */ Bool miZeroArcSetup(xArc * arc, miZeroArcRec * info, Bool ok360) { int l; int angle1, angle2; int startseg, endseg; int startAngle, endAngle; int i, overlap; miZeroArcPtRec start, end; l = arc->width & 1; if (arc->width == arc->height) { info->alpha = 4; info->beta = 4; info->k1 = -8; info->k3 = -16; info->b = 12; info->a = (arc->width << 2) - 12; info->d = 17 - (arc->width << 1); if (l) { info->b -= 4; info->a += 4; info->d -= 7; } } else if (!arc->width || !arc->height) { info->alpha = 0; info->beta = 0; info->k1 = 0; info->k3 = 0; info->a = -(int) arc->height; info->b = 0; info->d = -1; } else { /* initial conditions */ info->alpha = (arc->width * arc->width) << 2; info->beta = (arc->height * arc->height) << 2; info->k1 = info->beta << 1; info->k3 = info->k1 + (info->alpha << 1); info->b = l ? 0 : -info->beta; info->a = info->alpha * arc->height; info->d = info->b - (info->a >> 1) - (info->alpha >> 2); if (l) info->d -= info->beta >> 2; info->a -= info->b; /* take first step, d < 0 always */ info->b -= info->k1; info->a += info->k1; info->d += info->b; /* octant change, b < 0 always */ info->k1 = -info->k1; info->k3 = -info->k3; info->b = -info->b; info->d = info->b - info->a - info->d; info->a = info->a - (info->b << 1); } info->dx = 1; info->dy = 0; info->w = (arc->width + 1) >> 1; info->h = arc->height >> 1; info->xorg = arc->x + (arc->width >> 1); info->yorg = arc->y; info->xorgo = info->xorg + l; info->yorgo = info->yorg + arc->height; if (!arc->width) { if (!arc->height) { info->x = 0; info->y = 0; info->initialMask = 0; info->startAngle = 0; info->endAngle = 0; info->start = oob; info->end = oob; return FALSE; } info->x = 0; info->y = 1; } else { info->x = 1; info->y = 0; } angle1 = arc->angle1; angle2 = arc->angle2; if ((angle1 == 0) && (angle2 >= FULLCIRCLE)) { startAngle = 0; endAngle = 0; } else { if (angle2 > FULLCIRCLE) angle2 = FULLCIRCLE; else if (angle2 < -FULLCIRCLE) angle2 = -FULLCIRCLE; if (angle2 < 0) { startAngle = angle1 + angle2; endAngle = angle1; } else { startAngle = angle1; endAngle = angle1 + angle2; } if (startAngle < 0) startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE; if (startAngle >= FULLCIRCLE) startAngle = startAngle % FULLCIRCLE; if (endAngle < 0) endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE; if (endAngle >= FULLCIRCLE) endAngle = endAngle % FULLCIRCLE; } info->startAngle = startAngle; info->endAngle = endAngle; if (ok360 && (startAngle == endAngle) && arc->angle2 && arc->width && arc->height) { info->initialMask = 0xf; info->start = oob; info->end = oob; return TRUE; } startseg = startAngle / OCTANT; if (!arc->height || (((startseg + 1) & 2) && arc->width)) { start.x = Dcos(startAngle) * ((arc->width + 1) / 2.0); if (start.x < 0) start.x = -start.x; start.y = -1; } else { start.y = Dsin(startAngle) * (arc->height / 2.0); if (start.y < 0) start.y = -start.y; start.y = info->h - start.y; start.x = 65536; } endseg = endAngle / OCTANT; if (!arc->height || (((endseg + 1) & 2) && arc->width)) { end.x = Dcos(endAngle) * ((arc->width + 1) / 2.0); if (end.x < 0) end.x = -end.x; end.y = -1; } else { end.y = Dsin(endAngle) * (arc->height / 2.0); if (end.y < 0) end.y = -end.y; end.y = info->h - end.y; end.x = 65536; } info->firstx = start.x; info->firsty = start.y; info->initialMask = 0; overlap = arc->angle2 && (endAngle <= startAngle); for (i = 0; i < 4; i++) { if (overlap ? ((i * QUADRANT <= endAngle) || ((i + 1) * QUADRANT > startAngle)) : ((i * QUADRANT <= endAngle) && ((i + 1) * QUADRANT > startAngle))) info->initialMask |= (1 << i); } start.mask = info->initialMask; end.mask = info->initialMask; startseg >>= 1; endseg >>= 1; overlap = overlap && (endseg == startseg); if (start.x != end.x || start.y != end.y || !overlap) { if (startseg & 1) { if (!overlap) info->initialMask &= ~(1 << startseg); if (start.x > end.x || start.y > end.y) end.mask &= ~(1 << startseg); } else { start.mask &= ~(1 << startseg); if (((start.x < end.x || start.y < end.y) || (start.x == end.x && start.y == end.y && (endseg & 1))) && !overlap) end.mask &= ~(1 << startseg); } if (endseg & 1) { end.mask &= ~(1 << endseg); if (((start.x > end.x || start.y > end.y) || (start.x == end.x && start.y == end.y && !(startseg & 1))) && !overlap) start.mask &= ~(1 << endseg); } else { if (!overlap) info->initialMask &= ~(1 << endseg); if (start.x < end.x || start.y < end.y) start.mask &= ~(1 << endseg); } } /* take care of case when start and stop are both near 45 */ /* handle here rather than adding extra code to pixelization loops */ if (startAngle && ((start.y < 0 && end.y >= 0) || (start.y >= 0 && end.y < 0))) { i = (startAngle + OCTANT) % OCTANT; if (i < EPSILON45 || i > OCTANT - EPSILON45) { i = (endAngle + OCTANT) % OCTANT; if (i < EPSILON45 || i > OCTANT - EPSILON45) { if (start.y < 0) { i = Dsin(startAngle) * (arc->height / 2.0); if (i < 0) i = -i; if (info->h - i == end.y) start.mask = end.mask; } else { i = Dsin(endAngle) * (arc->height / 2.0); if (i < 0) i = -i; if (info->h - i == start.y) end.mask = start.mask; } } } } if (startseg & 1) { info->start = start; info->end = oob; } else { info->end = start; info->start = oob; } if (endseg & 1) { info->altend = end; if (info->altend.x < info->end.x || info->altend.y < info->end.y) { miZeroArcPtRec tmp; tmp = info->altend; info->altend = info->end; info->end = tmp; } info->altstart = oob; } else { info->altstart = end; if (info->altstart.x < info->start.x || info->altstart.y < info->start.y) { miZeroArcPtRec tmp; tmp = info->altstart; info->altstart = info->start; info->start = tmp; } info->altend = oob; } if (!info->start.x || !info->start.y) { info->initialMask = info->start.mask; info->start = info->altstart; } if (!arc->width && (arc->height == 1)) { /* kludge! */ info->initialMask |= info->end.mask; info->initialMask |= info->initialMask << 1; info->end.x = 0; info->end.mask = 0; } return FALSE; } #define Pixelate(xval,yval) \ { \ pts->x = xval; \ pts->y = yval; \ pts++; \ } #define DoPix(idx,xval,yval) if (mask & (1 << idx)) Pixelate(xval, yval); static DDXPointPtr miZeroArcPts(xArc * arc, DDXPointPtr pts) { miZeroArcRec info; int x, y, a, b, d, mask; int k1, k3, dx, dy; Bool do360; do360 = miZeroArcSetup(arc, &info, TRUE); MIARCSETUP(); mask = info.initialMask; if (!(arc->width & 1)) { DoPix(1, info.xorgo, info.yorg); DoPix(3, info.xorgo, info.yorgo); } if (!info.end.x || !info.end.y) { mask = info.end.mask; info.end = info.altend; } if (do360 && (arc->width == arc->height) && !(arc->width & 1)) { int yorgh = info.yorg + info.h; int xorghp = info.xorg + info.h; int xorghn = info.xorg - info.h; while (1) { Pixelate(info.xorg + x, info.yorg + y); Pixelate(info.xorg - x, info.yorg + y); Pixelate(info.xorg - x, info.yorgo - y); Pixelate(info.xorg + x, info.yorgo - y); if (a < 0) break; Pixelate(xorghp - y, yorgh - x); Pixelate(xorghn + y, yorgh - x); Pixelate(xorghn + y, yorgh + x); Pixelate(xorghp - y, yorgh + x); MIARCCIRCLESTEP(; ); } if (x > 1 && pts[-1].x == pts[-5].x && pts[-1].y == pts[-5].y) pts -= 4; x = info.w; y = info.h; } else if (do360) { while (y < info.h || x < info.w) { MIARCOCTANTSHIFT(; ); Pixelate(info.xorg + x, info.yorg + y); Pixelate(info.xorgo - x, info.yorg + y); Pixelate(info.xorgo - x, info.yorgo - y); Pixelate(info.xorg + x, info.yorgo - y); MIARCSTEP(; ,; ); } } else { while (y < info.h || x < info.w) { MIARCOCTANTSHIFT(; ); if ((x == info.start.x) || (y == info.start.y)) { mask = info.start.mask; info.start = info.altstart; } DoPix(0, info.xorg + x, info.yorg + y); DoPix(1, info.xorgo - x, info.yorg + y); DoPix(2, info.xorgo - x, info.yorgo - y); DoPix(3, info.xorg + x, info.yorgo - y); if ((x == info.end.x) || (y == info.end.y)) { mask = info.end.mask; info.end = info.altend; } MIARCSTEP(; ,; ); } } if ((x == info.start.x) || (y == info.start.y)) mask = info.start.mask; DoPix(0, info.xorg + x, info.yorg + y); DoPix(2, info.xorgo - x, info.yorgo - y); if (arc->height & 1) { DoPix(1, info.xorgo - x, info.yorg + y); DoPix(3, info.xorg + x, info.yorgo - y); } return pts; } #undef DoPix #define DoPix(idx,xval,yval) \ if (mask & (1 << idx)) \ { \ arcPts[idx]->x = xval; \ arcPts[idx]->y = yval; \ arcPts[idx]++; \ } static void miZeroArcDashPts(GCPtr pGC, xArc * arc, DashInfo * dinfo, DDXPointPtr points, int maxPts, DDXPointPtr * evenPts, DDXPointPtr * oddPts) { miZeroArcRec info; int x, y, a, b, d, mask; int k1, k3, dx, dy; int dashRemaining; DDXPointPtr arcPts[4]; DDXPointPtr startPts[5], endPts[5]; int deltas[5]; DDXPointPtr startPt, pt, lastPt, pts; int i, j, delta, ptsdelta, seg, startseg; for (i = 0; i < 4; i++) arcPts[i] = points + (i * maxPts); (void) miZeroArcSetup(arc, &info, FALSE); MIARCSETUP(); mask = info.initialMask; startseg = info.startAngle / QUADRANT; startPt = arcPts[startseg]; if (!(arc->width & 1)) { DoPix(1, info.xorgo, info.yorg); DoPix(3, info.xorgo, info.yorgo); } if (!info.end.x || !info.end.y) { mask = info.end.mask; info.end = info.altend; } while (y < info.h || x < info.w) { MIARCOCTANTSHIFT(; ); if ((x == info.firstx) || (y == info.firsty)) startPt = arcPts[startseg]; if ((x == info.start.x) || (y == info.start.y)) { mask = info.start.mask; info.start = info.altstart; } DoPix(0, info.xorg + x, info.yorg + y); DoPix(1, info.xorgo - x, info.yorg + y); DoPix(2, info.xorgo - x, info.yorgo - y); DoPix(3, info.xorg + x, info.yorgo - y); if ((x == info.end.x) || (y == info.end.y)) { mask = info.end.mask; info.end = info.altend; } MIARCSTEP(; ,; ); } if ((x == info.firstx) || (y == info.firsty)) startPt = arcPts[startseg]; if ((x == info.start.x) || (y == info.start.y)) mask = info.start.mask; DoPix(0, info.xorg + x, info.yorg + y); DoPix(2, info.xorgo - x, info.yorgo - y); if (arc->height & 1) { DoPix(1, info.xorgo - x, info.yorg + y); DoPix(3, info.xorg + x, info.yorgo - y); } for (i = 0; i < 4; i++) { seg = (startseg + i) & 3; pt = points + (seg * maxPts); if (seg & 1) { startPts[i] = pt; endPts[i] = arcPts[seg]; deltas[i] = 1; } else { startPts[i] = arcPts[seg] - 1; endPts[i] = pt - 1; deltas[i] = -1; } } startPts[4] = startPts[0]; endPts[4] = startPt; startPts[0] = startPt; if (startseg & 1) { if (startPts[4] != endPts[4]) endPts[4]--; deltas[4] = 1; } else { if (startPts[0] > startPts[4]) startPts[0]--; if (startPts[4] < endPts[4]) endPts[4]--; deltas[4] = -1; } if (arc->angle2 < 0) { DDXPointPtr tmps, tmpe; int tmpd; tmpd = deltas[0]; tmps = startPts[0] - tmpd; tmpe = endPts[0] - tmpd; startPts[0] = endPts[4] - deltas[4]; endPts[0] = startPts[4] - deltas[4]; deltas[0] = -deltas[4]; startPts[4] = tmpe; endPts[4] = tmps; deltas[4] = -tmpd; tmpd = deltas[1]; tmps = startPts[1] - tmpd; tmpe = endPts[1] - tmpd; startPts[1] = endPts[3] - deltas[3]; endPts[1] = startPts[3] - deltas[3]; deltas[1] = -deltas[3]; startPts[3] = tmpe; endPts[3] = tmps; deltas[3] = -tmpd; tmps = startPts[2] - deltas[2]; startPts[2] = endPts[2] - deltas[2]; endPts[2] = tmps; deltas[2] = -deltas[2]; } for (i = 0; i < 5 && startPts[i] == endPts[i]; i++); if (i == 5) return; pt = startPts[i]; for (j = 4; startPts[j] == endPts[j]; j--); lastPt = endPts[j] - deltas[j]; if (dinfo->haveLast && (pt->x == dinfo->endPt.x) && (pt->y == dinfo->endPt.y)) { startPts[i] += deltas[i]; } else { dinfo->dashIndex = dinfo->dashIndexInit; dinfo->dashOffset = dinfo->dashOffsetInit; } if (!dinfo->skipStart && (info.startAngle != info.endAngle)) { dinfo->startPt = *pt; dinfo->haveStart = TRUE; } else if (!dinfo->skipLast && dinfo->haveStart && (lastPt->x == dinfo->startPt.x) && (lastPt->y == dinfo->startPt.y) && (lastPt != startPts[i])) endPts[j] = lastPt; if (info.startAngle != info.endAngle) { dinfo->haveLast = TRUE; dinfo->endPt = *lastPt; } dashRemaining = pGC->dash[dinfo->dashIndex] - dinfo->dashOffset; for (i = 0; i < 5; i++) { pt = startPts[i]; lastPt = endPts[i]; delta = deltas[i]; while (pt != lastPt) { if (dinfo->dashIndex & 1) { pts = *oddPts; ptsdelta = -1; } else { pts = *evenPts; ptsdelta = 1; } while ((pt != lastPt) && --dashRemaining >= 0) { *pts = *pt; pts += ptsdelta; pt += delta; } if (dinfo->dashIndex & 1) *oddPts = pts; else *evenPts = pts; if (dashRemaining <= 0) { if (++(dinfo->dashIndex) == pGC->numInDashList) dinfo->dashIndex = 0; dashRemaining = pGC->dash[dinfo->dashIndex]; } } } dinfo->dashOffset = pGC->dash[dinfo->dashIndex] - dashRemaining; } void miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) { int maxPts = 0; int n, maxw = 0; xArc *arc; int i; DDXPointPtr points, pts, oddPts = NULL; DDXPointPtr pt; int numPts; Bool dospans; int *widths = NULL; XID fgPixel = pGC->fgPixel; DashInfo dinfo; for (arc = parcs, i = narcs; --i >= 0; arc++) { if (!miCanZeroArc(arc)) miWideArc(pDraw, pGC, 1, arc); else { if (arc->width > arc->height) n = arc->width + (arc->height >> 1); else n = arc->height + (arc->width >> 1); if (n > maxPts) maxPts = n; } } if (!maxPts) return; numPts = maxPts << 2; dospans = (pGC->fillStyle != FillSolid); if (dospans) { widths = malloc(sizeof(int) * numPts); if (!widths) return; maxw = 0; } if (pGC->lineStyle != LineSolid) { numPts <<= 1; dinfo.haveStart = FALSE; dinfo.skipStart = FALSE; dinfo.haveLast = FALSE; dinfo.dashIndexInit = 0; dinfo.dashOffsetInit = 0; miStepDash((int) pGC->dashOffset, &dinfo.dashIndexInit, (unsigned char *) pGC->dash, (int) pGC->numInDashList, &dinfo.dashOffsetInit); } points = malloc(sizeof(DDXPointRec) * numPts); if (!points) { if (dospans) { free(widths); } return; } for (arc = parcs, i = narcs; --i >= 0; arc++) { if (miCanZeroArc(arc)) { if (pGC->lineStyle == LineSolid) pts = miZeroArcPts(arc, points); else { pts = points; oddPts = &points[(numPts >> 1) - 1]; dinfo.skipLast = i; miZeroArcDashPts(pGC, arc, &dinfo, oddPts + 1, maxPts, &pts, &oddPts); dinfo.skipStart = TRUE; } n = pts - points; if (!dospans) (*pGC->ops->PolyPoint) (pDraw, pGC, CoordModeOrigin, n, points); else { if (n > maxw) { while (maxw < n) widths[maxw++] = 1; } if (pGC->miTranslate) { for (pt = points; pt != pts; pt++) { pt->x += pDraw->x; pt->y += pDraw->y; } } (*pGC->ops->FillSpans) (pDraw, pGC, n, points, widths, FALSE); } if (pGC->lineStyle != LineDoubleDash) continue; if ((pGC->fillStyle == FillSolid) || (pGC->fillStyle == FillStippled)) { ChangeGCVal gcval; gcval.val = pGC->bgPixel; ChangeGC(NullClient, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } pts = &points[numPts >> 1]; oddPts++; n = pts - oddPts; if (!dospans) (*pGC->ops->PolyPoint) (pDraw, pGC, CoordModeOrigin, n, oddPts); else { if (n > maxw) { while (maxw < n) widths[maxw++] = 1; } if (pGC->miTranslate) { for (pt = oddPts; pt != pts; pt++) { pt->x += pDraw->x; pt->y += pDraw->y; } } (*pGC->ops->FillSpans) (pDraw, pGC, n, oddPts, widths, FALSE); } if ((pGC->fillStyle == FillSolid) || (pGC->fillStyle == FillStippled)) { ChangeGCVal gcval; gcval.val = fgPixel; ChangeGC(NullClient, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } } } free(points); if (dospans) { free(widths); } } xorg-server-1.17.1/mi/miwindow.c0000664000175100017510000006452512456571574013453 00000000000000 /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "regionstr.h" #include "region.h" #include "mi.h" #include "windowstr.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "mivalidate.h" #include "inputstr.h" void miClearToBackground(WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures) { BoxRec box; RegionRec reg; BoxPtr extents; int x1, y1, x2, y2; /* compute everything using ints to avoid overflow */ x1 = pWin->drawable.x + x; y1 = pWin->drawable.y + y; if (w) x2 = x1 + (int) w; else x2 = x1 + (int) pWin->drawable.width - (int) x; if (h) y2 = y1 + h; else y2 = y1 + (int) pWin->drawable.height - (int) y; extents = &pWin->clipList.extents; /* clip the resulting rectangle to the window clipList extents. This * makes sure that the result will fit in a box, given that the * screen is < 32768 on a side. */ if (x1 < extents->x1) x1 = extents->x1; if (x2 > extents->x2) x2 = extents->x2; if (y1 < extents->y1) y1 = extents->y1; if (y2 > extents->y2) y2 = extents->y2; if (x2 <= x1 || y2 <= y1) { x2 = x1 = 0; y2 = y1 = 0; } box.x1 = x1; box.x2 = x2; box.y1 = y1; box.y2 = y2; RegionInit(®, &box, 1); RegionIntersect(®, ®, &pWin->clipList); if (generateExposures) (*pWin->drawable.pScreen->WindowExposures) (pWin, ®); else if (pWin->backgroundState != None) miPaintWindow(pWin, ®, PW_BACKGROUND); RegionUninit(®); } void miMarkWindow(WindowPtr pWin) { ValidatePtr val; if (pWin->valdata) return; val = (ValidatePtr) xnfalloc(sizeof(ValidateRec)); val->before.oldAbsCorner.x = pWin->drawable.x; val->before.oldAbsCorner.y = pWin->drawable.y; val->before.borderVisible = NullRegion; val->before.resized = FALSE; pWin->valdata = val; } Bool miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin) { BoxPtr box; WindowPtr pChild, pLast; Bool anyMarked = FALSE; MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow; /* single layered systems are easy */ if (ppLayerWin) *ppLayerWin = pWin; if (pWin == pFirst) { /* Blindly mark pWin and all of its inferiors. This is a slight * overkill if there are mapped windows that outside pWin's border, * but it's better than wasting time on RectIn checks. */ pChild = pWin; while (1) { if (pChild->viewable) { if (RegionBroken(&pChild->winSize)) SetWinSize(pChild); if (RegionBroken(&pChild->borderSize)) SetBorderSize(pChild); (*MarkWindow) (pChild); if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } anyMarked = TRUE; pFirst = pFirst->nextSib; } if ((pChild = pFirst)) { box = RegionExtents(&pWin->borderSize); pLast = pChild->parent->lastChild; while (1) { if (pChild->viewable) { if (RegionBroken(&pChild->winSize)) SetWinSize(pChild); if (RegionBroken(&pChild->borderSize)) SetBorderSize(pChild); if (RegionContainsRect(&pChild->borderSize, box)) { (*MarkWindow) (pChild); anyMarked = TRUE; if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } } while (!pChild->nextSib && (pChild != pLast)) pChild = pChild->parent; if (pChild == pLast) break; pChild = pChild->nextSib; } } if (anyMarked) (*MarkWindow) (pWin->parent); return anyMarked; } /***** * miHandleValidateExposures(pWin) * starting at pWin, draw background in any windows that have exposure * regions, translate the regions, restore any backing store, * and then send any regions still exposed to the client *****/ void miHandleValidateExposures(WindowPtr pWin) { WindowPtr pChild; ValidatePtr val; WindowExposuresProcPtr WindowExposures; pChild = pWin; WindowExposures = pChild->drawable.pScreen->WindowExposures; while (1) { if ((val = pChild->valdata)) { if (RegionNotEmpty(&val->after.borderExposed)) miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); RegionUninit(&val->after.borderExposed); (*WindowExposures) (pChild, &val->after.exposed); RegionUninit(&val->after.exposed); free(val); pChild->valdata = NULL; if (pChild->firstChild) { pChild = pChild->firstChild; continue; } } while (!pChild->nextSib && (pChild != pWin)) pChild = pChild->parent; if (pChild == pWin) break; pChild = pChild->nextSib; } } void miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) { WindowPtr pParent; Bool WasViewable = (Bool) (pWin->viewable); short bw; RegionPtr oldRegion = NULL; DDXPointRec oldpt; Bool anyMarked = FALSE; ScreenPtr pScreen; WindowPtr windowToValidate; WindowPtr pLayerWin; /* if this is a root window, can't be moved */ if (!(pParent = pWin->parent)) return; pScreen = pWin->drawable.pScreen; bw = wBorderWidth(pWin); oldpt.x = pWin->drawable.x; oldpt.y = pWin->drawable.y; if (WasViewable) { oldRegion = RegionCreate(NullBox, 1); RegionCopy(oldRegion, &pWin->borderClip); anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); } pWin->origin.x = x + (int) bw; pWin->origin.y = y + (int) bw; x = pWin->drawable.x = pParent->drawable.x + x + (int) bw; y = pWin->drawable.y = pParent->drawable.y + y + (int) bw; SetWinSize(pWin); SetBorderSize(pWin); (*pScreen->PositionWindow) (pWin, x, y); windowToValidate = MoveWindowInStack(pWin, pNextSib); ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0); if (WasViewable) { if (pLayerWin == pWin) anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, windowToValidate, NULL); else anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, NullWindow, kind); (*pWin->drawable.pScreen->CopyWindow) (pWin, oldpt, oldRegion); RegionDestroy(oldRegion); /* XXX need to retile border if ParentRelative origin */ (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, NULL, kind); } } if (pWin->realized) WindowsRestructured(); } /* * pValid is a region of the screen which has been * successfully copied -- recomputed exposed regions for affected windows */ static int miRecomputeExposures(WindowPtr pWin, void *value) { /* must conform to VisitWindowProcPtr */ RegionPtr pValid = (RegionPtr) value; if (pWin->valdata) { #ifdef COMPOSITE /* * Redirected windows are not affected by parent window * gravity manipulations, so don't recompute their * exposed areas here. */ if (pWin->redirectDraw != RedirectDrawNone) return WT_DONTWALKCHILDREN; #endif /* * compute exposed regions of this window */ RegionSubtract(&pWin->valdata->after.exposed, &pWin->clipList, pValid); /* * compute exposed regions of the border */ RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->borderClip, &pWin->winSize); RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->valdata->after.borderExposed, pValid); return WT_WALKCHILDREN; } return WT_NOMATCH; } void miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib) { WindowPtr pParent; Bool WasViewable = (Bool) (pWin->viewable); unsigned short width = pWin->drawable.width, height = pWin->drawable.height; short oldx = pWin->drawable.x, oldy = pWin->drawable.y; int bw = wBorderWidth(pWin); short dw, dh; DDXPointRec oldpt; RegionPtr oldRegion = NULL; Bool anyMarked = FALSE; ScreenPtr pScreen; WindowPtr pFirstChange; WindowPtr pChild; RegionPtr gravitate[StaticGravity + 1]; unsigned g; int nx, ny; /* destination x,y */ int newx, newy; /* new inner window position */ RegionPtr pRegion = NULL; RegionPtr destClip; /* portions of destination already written */ RegionPtr oldWinClip = NULL; /* old clip list for window */ RegionPtr borderVisible = NullRegion; /* visible area of the border */ Bool shrunk = FALSE; /* shrunk in an inner dimension */ Bool moved = FALSE; /* window position changed */ WindowPtr pLayerWin; /* if this is a root window, can't be resized */ if (!(pParent = pWin->parent)) return; pScreen = pWin->drawable.pScreen; newx = pParent->drawable.x + x + bw; newy = pParent->drawable.y + y + bw; if (WasViewable) { anyMarked = FALSE; /* * save the visible region of the window */ oldRegion = RegionCreate(NullBox, 1); RegionCopy(oldRegion, &pWin->winSize); /* * categorize child windows into regions to be moved */ for (g = 0; g <= StaticGravity; g++) gravitate[g] = (RegionPtr) NULL; for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { g = pChild->winGravity; if (g != UnmapGravity) { if (!gravitate[g]) gravitate[g] = RegionCreate(NullBox, 1); RegionUnion(gravitate[g], gravitate[g], &pChild->borderClip); } else { UnmapWindow(pChild, TRUE); anyMarked = TRUE; } } anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); oldWinClip = NULL; if (pWin->bitGravity != ForgetGravity) { oldWinClip = RegionCreate(NullBox, 1); RegionCopy(oldWinClip, &pWin->clipList); } /* * if the window is changing size, borderExposed * can't be computed correctly without some help. */ if (pWin->drawable.height > h || pWin->drawable.width > w) shrunk = TRUE; if (newx != oldx || newy != oldy) moved = TRUE; if ((pWin->drawable.height != h || pWin->drawable.width != w) && HasBorder(pWin)) { borderVisible = RegionCreate(NullBox, 1); /* for tiled borders, we punt and draw the whole thing */ if (pWin->borderIsPixel || !moved) { if (shrunk || moved) RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); else RegionCopy(borderVisible, &pWin->borderClip); } } } pWin->origin.x = x + bw; pWin->origin.y = y + bw; pWin->drawable.height = h; pWin->drawable.width = w; x = pWin->drawable.x = newx; y = pWin->drawable.y = newy; SetWinSize(pWin); SetBorderSize(pWin); dw = (int) w - (int) width; dh = (int) h - (int) height; ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh); /* let the hardware adjust background and border pixmaps, if any */ (*pScreen->PositionWindow) (pWin, x, y); pFirstChange = MoveWindowInStack(pWin, pSib); if (WasViewable) { pRegion = RegionCreate(NullBox, 1); if (pLayerWin == pWin) anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pFirstChange, NULL); else anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); if (pWin->valdata) { pWin->valdata->before.resized = TRUE; pWin->valdata->before.borderVisible = borderVisible; } if (anyMarked) (*pScreen->ValidateTree) (pLayerWin->parent, pFirstChange, VTOther); /* * the entire window is trashed unless bitGravity * recovers portions of it */ RegionCopy(&pWin->valdata->after.exposed, &pWin->clipList); } GravityTranslate(x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); if (WasViewable) { /* avoid the border */ if (HasBorder(pWin)) { int offx, offy, dx, dy; /* kruft to avoid double translates for each gravity */ offx = 0; offy = 0; for (g = 0; g <= StaticGravity; g++) { if (!gravitate[g]) continue; /* align winSize to gravitate[g]. * winSize is in new coordinates, * gravitate[g] is still in old coordinates */ GravityTranslate(x, y, oldx, oldy, dw, dh, g, &nx, &ny); dx = (oldx - nx) - offx; dy = (oldy - ny) - offy; if (dx || dy) { RegionTranslate(&pWin->winSize, dx, dy); offx += dx; offy += dy; } RegionIntersect(gravitate[g], gravitate[g], &pWin->winSize); } /* get winSize back where it belongs */ if (offx || offy) RegionTranslate(&pWin->winSize, -offx, -offy); } /* * add screen bits to the appropriate bucket */ if (oldWinClip) { /* * clip to new clipList */ RegionCopy(pRegion, oldWinClip); RegionTranslate(pRegion, nx - oldx, ny - oldy); RegionIntersect(oldWinClip, pRegion, &pWin->clipList); /* * don't step on any gravity bits which will be copied after this * region. Note -- this assumes that the regions will be copied * in gravity order. */ for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate[g]) RegionSubtract(oldWinClip, oldWinClip, gravitate[g]); } RegionTranslate(oldWinClip, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate[g]) gravitate[g] = oldWinClip; else { RegionUnion(gravitate[g], gravitate[g], oldWinClip); RegionDestroy(oldWinClip); } } /* * move the bits on the screen */ destClip = NULL; for (g = 0; g <= StaticGravity; g++) { if (!gravitate[g]) continue; GravityTranslate(x, y, oldx, oldy, dw, dh, g, &nx, &ny); oldpt.x = oldx + (x - nx); oldpt.y = oldy + (y - ny); /* Note that gravitate[g] is *translated* by CopyWindow */ /* only copy the remaining useful bits */ RegionIntersect(gravitate[g], gravitate[g], oldRegion); /* clip to not overwrite already copied areas */ if (destClip) { RegionTranslate(destClip, oldpt.x - x, oldpt.y - y); RegionSubtract(gravitate[g], gravitate[g], destClip); RegionTranslate(destClip, x - oldpt.x, y - oldpt.y); } /* and move those bits */ if (oldpt.x != x || oldpt.y != y #ifdef COMPOSITE || pWin->redirectDraw #endif ) { (*pWin->drawable.pScreen->CopyWindow) (pWin, oldpt, gravitate[g]); } /* remove any overwritten bits from the remaining useful bits */ RegionSubtract(oldRegion, oldRegion, gravitate[g]); /* * recompute exposed regions of child windows */ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->winGravity != g) continue; RegionIntersect(pRegion, &pChild->borderClip, gravitate[g]); TraverseTree(pChild, miRecomputeExposures, (void *) pRegion); } /* * remove the successfully copied regions of the * window from its exposed region */ if (g == pWin->bitGravity) RegionSubtract(&pWin->valdata->after.exposed, &pWin->valdata->after.exposed, gravitate[g]); if (!destClip) destClip = gravitate[g]; else { RegionUnion(destClip, destClip, gravitate[g]); RegionDestroy(gravitate[g]); } } RegionDestroy(oldRegion); RegionDestroy(pRegion); if (destClip) RegionDestroy(destClip); if (anyMarked) { (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, VTOther); } } if (pWin->realized) WindowsRestructured(); } WindowPtr miGetLayerWindow(WindowPtr pWin) { return pWin->firstChild; } /****** * * miSetShape * The border/window shape has changed. Recompute winSize/borderSize * and send appropriate exposure events */ void miSetShape(WindowPtr pWin, int kind) { Bool WasViewable = (Bool) (pWin->viewable); ScreenPtr pScreen = pWin->drawable.pScreen; Bool anyMarked = FALSE; WindowPtr pLayerWin; if (kind != ShapeInput) { if (WasViewable) { anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); if (pWin->valdata) { if (HasBorder(pWin)) { RegionPtr borderVisible; borderVisible = RegionCreate(NullBox, 1); RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } pWin->valdata->before.resized = TRUE; } } SetWinSize(pWin); SetBorderSize(pWin); ResizeChildrenWinSize(pWin, 0, 0, 0, 0); if (WasViewable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, NullWindow, VTOther); (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, NULL, VTOther); } } } if (pWin->realized) WindowsRestructured(); CheckCursorConfinement(pWin); } /* Keeps the same inside(!) origin */ void miChangeBorderWidth(WindowPtr pWin, unsigned int width) { int oldwidth; Bool anyMarked = FALSE; ScreenPtr pScreen; Bool WasViewable = (Bool) (pWin->viewable); Bool HadBorder; WindowPtr pLayerWin; oldwidth = wBorderWidth(pWin); if (oldwidth == width) return; HadBorder = HasBorder(pWin); pScreen = pWin->drawable.pScreen; if (WasViewable && width < oldwidth) anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); pWin->borderWidth = width; SetBorderSize(pWin); if (WasViewable) { if (width > oldwidth) { anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); /* * save the old border visible region to correctly compute * borderExposed. */ if (pWin->valdata && HadBorder) { RegionPtr borderVisible; borderVisible = RegionCreate(NULL, 1); RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } } if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTOther); (*pScreen->HandleExposures) (pLayerWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, VTOther); } } if (pWin->realized) WindowsRestructured(); } void miMarkUnrealizedWindow(WindowPtr pChild, WindowPtr pWin, Bool fromConfigure) { if ((pChild != pWin) || fromConfigure) { RegionEmpty(&pChild->clipList); if (pChild->drawable.pScreen->ClipNotify) (*pChild->drawable.pScreen->ClipNotify) (pChild, 0, 0); RegionEmpty(&pChild->borderClip); } } WindowPtr miSpriteTrace(SpritePtr pSprite, int x, int y) { WindowPtr pWin; BoxRec box; pWin = DeepestSpriteWin(pSprite)->firstChild; while (pWin) { if ((pWin->mapped) && (x >= pWin->drawable.x - wBorderWidth(pWin)) && (x < pWin->drawable.x + (int) pWin->drawable.width + wBorderWidth(pWin)) && (y >= pWin->drawable.y - wBorderWidth(pWin)) && (y < pWin->drawable.y + (int) pWin->drawable.height + wBorderWidth(pWin)) /* When a window is shaped, a further check * is made to see if the point is inside * borderSize */ && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) && (!wInputShape(pWin) || RegionContainsPoint(wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) #ifdef ROOTLESS /* In rootless mode windows may be offscreen, even when * they're in X's stack. (E.g. if the native window system * implements some form of virtual desktop system). */ && !pWin->rootlessUnhittable #endif ) { if (pSprite->spriteTraceGood >= pSprite->spriteTraceSize) { pSprite->spriteTraceSize += 10; pSprite->spriteTrace = realloc(pSprite->spriteTrace, pSprite->spriteTraceSize * sizeof(WindowPtr)); } pSprite->spriteTrace[pSprite->spriteTraceGood++] = pWin; pWin = pWin->firstChild; } else pWin = pWin->nextSib; } return DeepestSpriteWin(pSprite); } /** * Traversed from the root window to the window at the position x/y. While * traversing, it sets up the traversal history in the spriteTrace array. * After completing, the spriteTrace history is set in the following way: * spriteTrace[0] ... root window * spriteTrace[1] ... top level window that encloses x/y * ... * spriteTrace[spriteTraceGood - 1] ... window at x/y * * @returns the window at the given coordinates. */ WindowPtr miXYToWindow(ScreenPtr pScreen, SpritePtr pSprite, int x, int y) { pSprite->spriteTraceGood = 1; /* root window still there */ return miSpriteTrace(pSprite, x, y); } xorg-server-1.17.1/mi/migc.c0000664000175100017510000001557112432306326012513 00000000000000/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "migc.h" /* ARGSUSED */ void miChangeGC(GCPtr pGC, unsigned long mask) { return; } void miDestroyGC(GCPtr pGC) { if (pGC->pRotatedPixmap) (*pGC->pScreen->DestroyPixmap) (pGC->pRotatedPixmap); if (pGC->freeCompClip) RegionDestroy(pGC->pCompositeClip); } void miDestroyClip(GCPtr pGC) { if (pGC->clientClip) RegionDestroy(pGC->clientClip); pGC->clientClip = NULL; } void miChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { (*pGC->funcs->DestroyClip) (pGC); if (type == CT_PIXMAP) { /* convert the pixmap to a region */ pGC->clientClip = BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue); (*pGC->pScreen->DestroyPixmap) (pvalue); } else if (type == CT_REGION) { /* stuff the region in the GC */ pGC->clientClip = pvalue; } else if (type != CT_NONE) { pGC->clientClip = RegionFromRects(nrects, (xRectangle *) pvalue, type); free(pvalue); } pGC->stateChanges |= GCClipMask; } void miCopyClip(GCPtr pgcDst, GCPtr pgcSrc) { if (pgcSrc->clientClip) { RegionPtr prgnNew = RegionCreate(NULL, 1); RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip)); (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, prgnNew, 0); } else { (*pgcDst->funcs->ChangeClip) (pgcDst, CT_NONE, NULL, 0); } } /* ARGSUSED */ void miCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst) { return; } void miComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable) { if (pDrawable->type == DRAWABLE_WINDOW) { WindowPtr pWin = (WindowPtr) pDrawable; RegionPtr pregWin; Bool freeTmpClip, freeCompClip; if (pGC->subWindowMode == IncludeInferiors) { pregWin = NotClippedByChildren(pWin); freeTmpClip = TRUE; } else { pregWin = &pWin->clipList; freeTmpClip = FALSE; } freeCompClip = pGC->freeCompClip; /* * if there is no client clip, we can get by with just keeping the * pointer we got, and remembering whether or not should destroy (or * maybe re-use) it later. this way, we avoid unnecessary copying of * regions. (this wins especially if many clients clip by children * and have no client clip.) */ if (!pGC->clientClip) { if (freeCompClip) RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } else { /* * we need one 'real' region to put into the composite clip. if * pregWin the current composite clip are real, we can get rid of * one. if pregWin is real and the current composite clip isn't, * use pregWin for the composite clip. if the current composite * clip is real and pregWin isn't, use the current composite * clip. if neither is real, create a new region. */ RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); if (freeCompClip) { RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) RegionDestroy(pregWin); } else if (freeTmpClip) { RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { pGC->pCompositeClip = RegionCreate(NullBox, 0); RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } } /* end of composite clip for a window */ else { BoxRec pixbounds; /* XXX should we translate by drawable.x/y here ? */ /* If you want pixmaps in offscreen memory, yes */ pixbounds.x1 = pDrawable->x; pixbounds.y1 = pDrawable->y; pixbounds.x2 = pDrawable->x + pDrawable->width; pixbounds.y2 = pDrawable->y + pDrawable->height; if (pGC->freeCompClip) { RegionReset(pGC->pCompositeClip, &pixbounds); } else { pGC->freeCompClip = TRUE; pGC->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pGC->clientClip) { if (pDrawable->x || pDrawable->y) { RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } else { RegionTranslate(pGC->pCompositeClip, -pGC->clipOrg.x, -pGC->clipOrg.y); RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); RegionTranslate(pGC->pCompositeClip, pGC->clipOrg.x, pGC->clipOrg.y); } } } /* end of composite clip for pixmap */ } /* end miComputeCompositeClip */ xorg-server-1.17.1/mi/mipushpxl.c0000664000175100017510000002252012456571574013634 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mi.h" #include "servermd.h" #define NPT 128 /* These were stolen from mfb. They don't really belong here. */ #define LONG2CHARSSAMEORDER(x) ((MiBits)(x)) #define LONG2CHARSDIFFORDER( x ) ( ( ( ( x ) & (MiBits)0x000000FF ) << 0x18 ) \ | ( ( ( x ) & (MiBits)0x0000FF00 ) << 0x08 ) \ | ( ( ( x ) & (MiBits)0x00FF0000 ) >> 0x08 ) \ | ( ( ( x ) & (MiBits)0xFF000000 ) >> 0x18 ) ) #define PGSZB 4 #define PPW (PGSZB<<3) /* assuming 8 bits per byte */ #define PGSZ PPW #define PLST (PPW-1) #define PIM PLST #define PWSH 5 /* miPushPixels -- squeegees the fill style of pGC through pBitMap * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit * is set in the bitmap, the fill style is put onto the drawable using * the GC's logical function. The drawable is not changed where the bitmap * has a zero bit or outside the area covered by the stencil. WARNING: this code works if the 1-bit deep pixmap format returned by GetSpans is the same as the format defined by the mfb code (i.e. 32-bit padding per scanline, scanline unit = 32 bits; later, this might mean bitsizeof(int) padding and sacnline unit == bitsizeof(int).) */ /* * in order to have both (MSB_FIRST and LSB_FIRST) versions of this * in the server, we need to rename one of them */ void miPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg) { int h, dxDivPPW, ibEnd; MiBits *pwLineStart; MiBits *pw, *pwEnd; MiBits msk; int ib, w; int ipt; /* index into above arrays */ Bool fInBox; DDXPointRec pt[NPT], ptThisLine; int width[NPT]; #if 1 MiBits startmask; if (screenInfo.bitmapBitOrder == IMAGE_BYTE_ORDER) if (screenInfo.bitmapBitOrder == LSBFirst) startmask = (MiBits) (-1) ^ LONG2CHARSSAMEORDER((MiBits) (-1) << 1); else startmask = (MiBits) (-1) ^ LONG2CHARSSAMEORDER((MiBits) (-1) >> 1); else if (screenInfo.bitmapBitOrder == LSBFirst) startmask = (MiBits) (-1) ^ LONG2CHARSDIFFORDER((MiBits) (-1) << 1); else startmask = (MiBits) (-1) ^ LONG2CHARSDIFFORDER((MiBits) (-1) >> 1); #endif pwLineStart = malloc(BitmapBytePad(dx)); if (!pwLineStart) return; ipt = 0; dxDivPPW = dx / PPW; for (h = 0, ptThisLine.x = 0, ptThisLine.y = 0; h < dy; h++, ptThisLine.y++) { (*pBitMap->drawable.pScreen->GetSpans) ((DrawablePtr) pBitMap, dx, &ptThisLine, &dx, 1, (char *) pwLineStart); pw = pwLineStart; /* Process all words which are fully in the pixmap */ fInBox = FALSE; pwEnd = pwLineStart + dxDivPPW; while (pw < pwEnd) { w = *pw; #if 1 msk = startmask; #else msk = (MiBits) (-1) ^ SCRRIGHT((MiBits) (-1), 1); #endif for (ib = 0; ib < PPW; ib++) { if (w & msk) { if (!fInBox) { pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg; pt[ipt].y = h + yOrg; /* start new box */ fInBox = TRUE; } } else { if (fInBox) { width[ipt] = ((pw - pwLineStart) << PWSH) + ib + xOrg - pt[ipt].x; if (++ipt >= NPT) { (*pGC->ops->FillSpans) (pDrawable, pGC, NPT, pt, width, TRUE); ipt = 0; } /* end box */ fInBox = FALSE; } } #if 1 /* This is not quite right, but it'll do for now */ if (screenInfo.bitmapBitOrder == IMAGE_BYTE_ORDER) if (screenInfo.bitmapBitOrder == LSBFirst) msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) << 1); else msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) >> 1); else if (screenInfo.bitmapBitOrder == LSBFirst) msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) << 1); else msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1); #else msk = SCRRIGHT(msk, 1); #endif } pw++; } ibEnd = dx & PIM; if (ibEnd) { /* Process final partial word on line */ w = *pw; #if 1 msk = startmask; #else msk = (MiBits) (-1) ^ SCRRIGHT((MiBits) (-1), 1); #endif for (ib = 0; ib < ibEnd; ib++) { if (w & msk) { if (!fInBox) { /* start new box */ pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg; pt[ipt].y = h + yOrg; fInBox = TRUE; } } else { if (fInBox) { /* end box */ width[ipt] = ((pw - pwLineStart) << PWSH) + ib + xOrg - pt[ipt].x; if (++ipt >= NPT) { (*pGC->ops->FillSpans) (pDrawable, pGC, NPT, pt, width, TRUE); ipt = 0; } fInBox = FALSE; } } #if 1 /* This is not quite right, but it'll do for now */ if (screenInfo.bitmapBitOrder == IMAGE_BYTE_ORDER) if (screenInfo.bitmapBitOrder == LSBFirst) msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) << 1); else msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) >> 1); else if (screenInfo.bitmapBitOrder == LSBFirst) msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) << 1); else msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1); #else msk = SCRRIGHT(msk, 1); #endif } } /* If scanline ended with last bit set, end the box */ if (fInBox) { width[ipt] = dx + xOrg - pt[ipt].x; if (++ipt >= NPT) { (*pGC->ops->FillSpans) (pDrawable, pGC, NPT, pt, width, TRUE); ipt = 0; } } } free(pwLineStart); /* Flush any remaining spans */ if (ipt) { (*pGC->ops->FillSpans) (pDrawable, pGC, ipt, pt, width, TRUE); } } xorg-server-1.17.1/mi/miwideline.c0000664000175100017510000022222712432306326013720 00000000000000/* Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. */ /* Author: Keith Packard, MIT X Consortium */ /* * Mostly integer wideline code. Uses a technique similar to * bresenham zero-width lines, except walks an X edge */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #ifdef _XOPEN_SOURCE #include #else #define _XOPEN_SOURCE /* to get prototype for hypot on some systems */ #include #undef _XOPEN_SOURCE #endif #include #include "windowstr.h" #include "gcstruct.h" #include "regionstr.h" #include "miwideline.h" #include "mi.h" #if 0 #ifdef HAVE_DIX_CONFIG_H #include #endif #include "misc.h" #include "pixmapstr.h" #include "gcstruct.h" #endif typedef struct { int count; /* number of spans */ DDXPointPtr points; /* pointer to list of start points */ int *widths; /* pointer to list of widths */ } Spans; typedef struct { int size; /* Total number of *Spans allocated */ int count; /* Number of *Spans actually in group */ Spans *group; /* List of Spans */ int ymin, ymax; /* Min, max y values encountered */ } SpanGroup; /* Rops which must use span groups */ #define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) #define miSpansEasyRop(rop) (!miSpansCarefulRop(rop)) /* These routines maintain lists of Spans, in order to implement the ``touch-each-pixel-once'' rules of wide lines and arcs. Written by Joel McCormack, Summer 1989. */ static void miInitSpanGroup(SpanGroup * spanGroup) { spanGroup->size = 0; spanGroup->count = 0; spanGroup->group = NULL; spanGroup->ymin = MAXSHORT; spanGroup->ymax = MINSHORT; } /* InitSpanGroup */ #define YMIN(spans) (spans->points[0].y) #define YMAX(spans) (spans->points[spans->count-1].y) static void miSubtractSpans(SpanGroup * spanGroup, Spans * sub) { int i, subCount, spansCount; int ymin, ymax, xmin, xmax; Spans *spans; DDXPointPtr subPt, spansPt; int *subWid, *spansWid; int extra; ymin = YMIN(sub); ymax = YMAX(sub); spans = spanGroup->group; for (i = spanGroup->count; i; i--, spans++) { if (YMIN(spans) <= ymax && ymin <= YMAX(spans)) { subCount = sub->count; subPt = sub->points; subWid = sub->widths; spansCount = spans->count; spansPt = spans->points; spansWid = spans->widths; extra = 0; for (;;) { while (spansCount && spansPt->y < subPt->y) { spansPt++; spansWid++; spansCount--; } if (!spansCount) break; while (subCount && subPt->y < spansPt->y) { subPt++; subWid++; subCount--; } if (!subCount) break; if (subPt->y == spansPt->y) { xmin = subPt->x; xmax = xmin + *subWid; if (xmin >= spansPt->x + *spansWid || spansPt->x >= xmax) { ; } else if (xmin <= spansPt->x) { if (xmax >= spansPt->x + *spansWid) { memmove(spansPt, spansPt + 1, sizeof *spansPt * (spansCount - 1)); memmove(spansWid, spansWid + 1, sizeof *spansWid * (spansCount - 1)); spansPt--; spansWid--; spans->count--; extra++; } else { *spansWid = *spansWid - (xmax - spansPt->x); spansPt->x = xmax; } } else { if (xmax >= spansPt->x + *spansWid) { *spansWid = xmin - spansPt->x; } else { if (!extra) { DDXPointPtr newPt; int *newwid; #define EXTRA 8 newPt = (DDXPointPtr) realloc(spans->points, (spans->count + EXTRA) * sizeof(DDXPointRec)); if (!newPt) break; spansPt = newPt + (spansPt - spans->points); spans->points = newPt; newwid = (int *) realloc(spans->widths, (spans->count + EXTRA) * sizeof(int)); if (!newwid) break; spansWid = newwid + (spansWid - spans->widths); spans->widths = newwid; extra = EXTRA; } memmove(spansPt + 1, spansPt, sizeof *spansPt * (spansCount)); memmove(spansWid + 1, spansWid, sizeof *spansWid * (spansCount)); spans->count++; extra--; *spansWid = xmin - spansPt->x; spansWid++; spansPt++; *spansWid = *spansWid - (xmax - spansPt->x); spansPt->x = xmax; } } } spansPt++; spansWid++; spansCount--; } } } } static void miAppendSpans(SpanGroup * spanGroup, SpanGroup * otherGroup, Spans * spans) { int ymin, ymax; int spansCount; spansCount = spans->count; if (spansCount > 0) { if (spanGroup->size == spanGroup->count) { spanGroup->size = (spanGroup->size + 8) * 2; spanGroup->group = (Spans *) realloc(spanGroup->group, sizeof(Spans) * spanGroup->size); } spanGroup->group[spanGroup->count] = *spans; (spanGroup->count)++; ymin = spans->points[0].y; if (ymin < spanGroup->ymin) spanGroup->ymin = ymin; ymax = spans->points[spansCount - 1].y; if (ymax > spanGroup->ymax) spanGroup->ymax = ymax; if (otherGroup && otherGroup->ymin < ymax && ymin < otherGroup->ymax) { miSubtractSpans(otherGroup, spans); } } else { free(spans->points); free(spans->widths); } } /* AppendSpans */ static void miFreeSpanGroup(SpanGroup * spanGroup) { free(spanGroup->group); } static void QuickSortSpansX(DDXPointRec points[], int widths[], int numSpans) { int x; int i, j, m; DDXPointPtr r; /* Always called with numSpans > 1 */ /* Sorts only by x, as all y should be the same */ #define ExchangeSpans(a, b) \ { \ DDXPointRec tpt; \ int tw; \ \ tpt = points[a]; points[a] = points[b]; points[b] = tpt; \ tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ } do { if (numSpans < 9) { /* Do insertion sort */ int xprev; xprev = points[0].x; i = 1; do { /* while i != numSpans */ x = points[i].x; if (xprev > x) { /* points[i] is out of order. Move into proper location. */ DDXPointRec tpt; int tw, k; for (j = 0; x >= points[j].x; j++) { } tpt = points[i]; tw = widths[i]; for (k = i; k != j; k--) { points[k] = points[k - 1]; widths[k] = widths[k - 1]; } points[j] = tpt; widths[j] = tw; x = points[i].x; } /* if out of order */ xprev = x; i++; } while (i != numSpans); return; } /* Choose partition element, stick in location 0 */ m = numSpans / 2; if (points[m].x > points[0].x) ExchangeSpans(m, 0); if (points[m].x > points[numSpans - 1].x) ExchangeSpans(m, numSpans - 1); if (points[m].x > points[0].x) ExchangeSpans(m, 0); x = points[0].x; /* Partition array */ i = 0; j = numSpans; do { r = &(points[i]); do { r++; i++; } while (i != numSpans && r->x < x); r = &(points[j]); do { r--; j--; } while (x < r->x); if (i < j) ExchangeSpans(i, j); } while (i < j); /* Move partition element back to middle */ ExchangeSpans(0, j); /* Recurse */ if (numSpans - j - 1 > 1) QuickSortSpansX(&points[j + 1], &widths[j + 1], numSpans - j - 1); numSpans = j; } while (numSpans > 1); } /* QuickSortSpans */ static int UniquifySpansX(Spans * spans, DDXPointRec * newPoints, int *newWidths) { int newx1, newx2, oldpt, i, y; DDXPointRec *oldPoints; int *oldWidths; int *startNewWidths; /* Always called with numSpans > 1 */ /* Uniquify the spans, and stash them into newPoints and newWidths. Return the number of unique spans. */ startNewWidths = newWidths; oldPoints = spans->points; oldWidths = spans->widths; y = oldPoints->y; newx1 = oldPoints->x; newx2 = newx1 + *oldWidths; for (i = spans->count - 1; i != 0; i--) { oldPoints++; oldWidths++; oldpt = oldPoints->x; if (oldpt > newx2) { /* Write current span, start a new one */ newPoints->x = newx1; newPoints->y = y; *newWidths = newx2 - newx1; newPoints++; newWidths++; newx1 = oldpt; newx2 = oldpt + *oldWidths; } else { /* extend current span, if old extends beyond new */ oldpt = oldpt + *oldWidths; if (oldpt > newx2) newx2 = oldpt; } } /* for */ /* Write final span */ newPoints->x = newx1; *newWidths = newx2 - newx1; newPoints->y = y; return (newWidths - startNewWidths) + 1; } /* UniquifySpansX */ static void miDisposeSpanGroup(SpanGroup * spanGroup) { int i; Spans *spans; for (i = 0; i < spanGroup->count; i++) { spans = spanGroup->group + i; free(spans->points); free(spans->widths); } } static void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup) { int i; Spans *spans; Spans *yspans; int *ysizes; int ymin, ylength; /* Outgoing spans for one big call to FillSpans */ DDXPointPtr points; int *widths; int count; if (spanGroup->count == 0) return; if (spanGroup->count == 1) { /* Already should be sorted, unique */ spans = spanGroup->group; (*pGC->ops->FillSpans) (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE); free(spans->points); free(spans->widths); } else { /* Yuck. Gross. Radix sort into y buckets, then sort x and uniquify */ /* This seems to be the fastest thing to do. I've tried sorting on both x and y at the same time rather than creating into all those y buckets, but it was somewhat slower. */ ymin = spanGroup->ymin; ylength = spanGroup->ymax - ymin + 1; /* Allocate Spans for y buckets */ yspans = malloc(ylength * sizeof(Spans)); ysizes = malloc(ylength * sizeof(int)); if (!yspans || !ysizes) { free(yspans); free(ysizes); miDisposeSpanGroup(spanGroup); return; } for (i = 0; i != ylength; i++) { ysizes[i] = 0; yspans[i].count = 0; yspans[i].points = NULL; yspans[i].widths = NULL; } /* Go through every single span and put it into the correct bucket */ count = 0; for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) { int index; int j; for (j = 0, points = spans->points, widths = spans->widths; j != spans->count; j++, points++, widths++) { index = points->y - ymin; if (index >= 0 && index < ylength) { Spans *newspans = &(yspans[index]); if (newspans->count == ysizes[index]) { DDXPointPtr newpoints; int *newwidths; ysizes[index] = (ysizes[index] + 8) * 2; newpoints = (DDXPointPtr) realloc(newspans->points, ysizes[index] * sizeof(DDXPointRec)); newwidths = (int *) realloc(newspans->widths, ysizes[index] * sizeof(int)); if (!newpoints || !newwidths) { for (i = 0; i < ylength; i++) { free(yspans[i].points); free(yspans[i].widths); } free(yspans); free(ysizes); free(newpoints); free(newwidths); miDisposeSpanGroup(spanGroup); return; } newspans->points = newpoints; newspans->widths = newwidths; } newspans->points[newspans->count] = *points; newspans->widths[newspans->count] = *widths; (newspans->count)++; } /* if y value of span in range */ } /* for j through spans */ count += spans->count; free(spans->points); spans->points = NULL; free(spans->widths); spans->widths = NULL; } /* for i thorough Spans */ /* Now sort by x and uniquify each bucket into the final array */ points = malloc(count * sizeof(DDXPointRec)); widths = malloc(count * sizeof(int)); if (!points || !widths) { for (i = 0; i < ylength; i++) { free(yspans[i].points); free(yspans[i].widths); } free(yspans); free(ysizes); free(points); free(widths); return; } count = 0; for (i = 0; i != ylength; i++) { int ycount = yspans[i].count; if (ycount > 0) { if (ycount > 1) { QuickSortSpansX(yspans[i].points, yspans[i].widths, ycount); count += UniquifySpansX (&(yspans[i]), &(points[count]), &(widths[count])); } else { points[count] = yspans[i].points[0]; widths[count] = yspans[i].widths[0]; count++; } free(yspans[i].points); free(yspans[i].widths); } } (*pGC->ops->FillSpans) (pDraw, pGC, count, points, widths, TRUE); free(points); free(widths); free(yspans); free(ysizes); /* use (DE)xalloc for these? */ } spanGroup->count = 0; spanGroup->ymin = MAXSHORT; spanGroup->ymax = MINSHORT; } static Bool InitSpans(Spans * spans, size_t nspans) { spans->points = malloc(nspans * sizeof(*spans->points)); if (!spans->points) return FALSE; spans->widths = malloc(nspans * sizeof(*spans->widths)); if (!spans->widths) { free(spans->points); return FALSE; } return TRUE; } /* * interface data to span-merging polygon filler */ typedef struct _SpanData { SpanGroup fgGroup, bgGroup; } SpanDataRec, *SpanDataPtr; static void AppendSpanGroup(GCPtr pGC, unsigned long pixel, Spans * spanPtr, SpanDataPtr spanData) { SpanGroup *group, *othergroup = NULL; if (pixel == pGC->fgPixel) { group = &spanData->fgGroup; if (pGC->lineStyle == LineDoubleDash) othergroup = &spanData->bgGroup; } else { group = &spanData->bgGroup; othergroup = &spanData->fgGroup; } miAppendSpans(group, othergroup, spanPtr); } static void miLineArc(DrawablePtr pDraw, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, LineFacePtr leftFace, LineFacePtr rightFace, double xorg, double yorg, Bool isInt); /* * spans-based polygon filler */ static void fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans * spans, SpanDataPtr spanData) { if (!spanData) { ChangeGCVal oldPixel, tmpPixel; oldPixel.val = pGC->fgPixel; if (pixel != oldPixel.val) { tmpPixel.val = (XID) pixel; ChangeGC(NullClient, pGC, GCForeground, &tmpPixel); ValidateGC(pDrawable, pGC); } (*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE); free(spans->widths); free(spans->points); if (pixel != oldPixel.val) { ChangeGC(NullClient, pGC, GCForeground, &oldPixel); ValidateGC(pDrawable, pGC); } } else AppendSpanGroup(pGC, pixel, spans, spanData); } static void miFillPolyHelper(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, int y, int overall_height, PolyEdgePtr left, PolyEdgePtr right, int left_count, int right_count) { int left_x = 0, left_e = 0; int left_stepx = 0; int left_signdx = 0; int left_dy = 0, left_dx = 0; int right_x = 0, right_e = 0; int right_stepx = 0; int right_signdx = 0; int right_dy = 0, right_dx = 0; int height = 0; int left_height = 0, right_height = 0; DDXPointPtr ppt; int *pwidth; int xorg; Spans spanRec; if (!InitSpans(&spanRec, overall_height)) return; ppt = spanRec.points; pwidth = spanRec.widths; xorg = 0; if (pGC->miTranslate) { y += pDrawable->y; xorg = pDrawable->x; } while ((left_count || left_height) && (right_count || right_height)) { if (!left_height && left_count) { left_height = left->height; left_x = left->x; 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; 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; if (height > right_height) height = right_height; left_height -= height; right_height -= height; while (--height >= 0) { if (right_x >= left_x) { ppt->y = y; ppt->x = left_x + xorg; ppt++; *pwidth++ = right_x - left_x + 1; } 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; } } } spanRec.count = ppt - spanRec.points; fillSpans(pDrawable, pGC, pixel, &spanRec, spanData); } static void miFillRectPolyHelper(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, int x, int y, int w, int h) { DDXPointPtr ppt; int *pwidth; ChangeGCVal oldPixel, tmpPixel; Spans spanRec; xRectangle rect; if (!spanData) { rect.x = x; rect.y = y; rect.width = w; rect.height = h; oldPixel.val = pGC->fgPixel; if (pixel != oldPixel.val) { tmpPixel.val = (XID) pixel; ChangeGC(NullClient, pGC, GCForeground, &tmpPixel); ValidateGC(pDrawable, pGC); } (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect); if (pixel != oldPixel.val) { ChangeGC(NullClient, pGC, GCForeground, &oldPixel); ValidateGC(pDrawable, pGC); } } else { if (!InitSpans(&spanRec, h)) return; ppt = spanRec.points; pwidth = spanRec.widths; if (pGC->miTranslate) { y += pDrawable->y; x += pDrawable->x; } while (h--) { ppt->x = x; ppt->y = y; ppt++; *pwidth++ = w; y++; } spanRec.count = ppt - spanRec.points; AppendSpanGroup(pGC, pixel, &spanRec, spanData); } } static int miPolyBuildEdge(double x0, double y0, double k, /* x0 * dy - y0 * dx */ int dx, int dy, int xi, int yi, int left, PolyEdgePtr edge) { int x, y, e; int xady; if (dy < 0) { dy = -dy; dx = -dx; k = -k; } #ifdef NOTDEF { double realk, kerror; realk = x0 * dy - y0 * dx; kerror = fabs(realk - k); if (kerror > .1) printf("realk: %g k: %g\n", realk, k); } #endif y = ICEIL(y0); xady = ICEIL(k) + y * dx; if (xady <= 0) x = -(-xady / dy) - 1; else x = (xady - 1) / dy; e = xady - x * dy; if (dx >= 0) { edge->signdx = 1; edge->stepx = dx / dy; edge->dx = dx % dy; } else { edge->signdx = -1; edge->stepx = -(-dx / dy); edge->dx = -dx % dy; e = dy - e + 1; } edge->dy = dy; edge->x = x + left + xi; edge->e = e - dy; /* bias to compare against 0 instead of dy */ return y + yi; } #define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr))) static int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes, int count, int xi, int yi, PolyEdgePtr left, PolyEdgePtr right, int *pnleft, int *pnright, int *h) { int top, bottom; double miny, maxy; int i; int j; int clockwise; int slopeoff; int s; int nright, nleft; int y, lasty = 0, bottomy, topy = 0; /* find the top of the polygon */ maxy = miny = vertices[0].y; bottom = top = 0; for (i = 1; i < count; i++) { if (vertices[i].y < miny) { top = i; miny = vertices[i].y; } if (vertices[i].y >= maxy) { bottom = i; maxy = vertices[i].y; } } clockwise = 1; slopeoff = 0; i = top; j = StepAround(top, -1, count); if ((int64_t) slopes[j].dy * slopes[i].dx > (int64_t) slopes[i].dy * slopes[j].dx) { clockwise = -1; slopeoff = -1; } bottomy = ICEIL(maxy) + yi; nright = 0; s = StepAround(top, slopeoff, count); i = top; while (i != bottom) { if (slopes[s].dy != 0) { y = miPolyBuildEdge(vertices[i].x, vertices[i].y, slopes[s].k, slopes[s].dx, slopes[s].dy, xi, yi, 0, &right[nright]); if (nright != 0) right[nright - 1].height = y - lasty; else topy = y; nright++; lasty = y; } i = StepAround(i, clockwise, count); s = StepAround(s, clockwise, count); } if (nright != 0) right[nright - 1].height = bottomy - lasty; if (slopeoff == 0) slopeoff = -1; else slopeoff = 0; nleft = 0; s = StepAround(top, slopeoff, count); i = top; while (i != bottom) { if (slopes[s].dy != 0) { y = miPolyBuildEdge(vertices[i].x, vertices[i].y, slopes[s].k, slopes[s].dx, slopes[s].dy, xi, yi, 1, &left[nleft]); if (nleft != 0) left[nleft - 1].height = y - lasty; nleft++; lasty = y; } i = StepAround(i, -clockwise, count); s = StepAround(s, -clockwise, count); } if (nleft != 0) left[nleft - 1].height = bottomy - lasty; *pnleft = nleft; *pnright = nright; *h = bottomy - topy; return topy; } static void miLineOnePoint(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, int x, int y) { DDXPointRec pt; int wid; unsigned long oldPixel; MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel); if (pGC->fillStyle == FillSolid) { pt.x = x; pt.y = y; (*pGC->ops->PolyPoint) (pDrawable, pGC, CoordModeOrigin, 1, &pt); } else { wid = 1; if (pGC->miTranslate) { x += pDrawable->x; y += pDrawable->y; } pt.x = x; pt.y = y; (*pGC->ops->FillSpans) (pDrawable, pGC, 1, &pt, &wid, TRUE); } MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel); } static void miLineJoin(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, LineFacePtr pLeft, LineFacePtr pRight) { double mx = 0, my = 0; double denom = 0.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 && !spanData) { /* See if one of the lines will draw the joining pixel */ if (pLeft->dx > 0 || (pLeft->dx == 0 && pLeft->dy > 0)) return; if (pRight->dx > 0 || (pRight->dx == 0 && pRight->dy > 0)) return; if (joinStyle != JoinRound) { denom = -pLeft->dx * (double) pRight->dy + pRight->dx * (double) pLeft->dy; if (denom == 0) return; /* no join to draw */ } if (joinStyle != JoinMiter) { miLineOnePoint(pDrawable, pGC, pixel, spanData, pLeft->x, pLeft->y); return; } } else { if (joinStyle == JoinRound) { miLineArc(pDrawable, pGC, pixel, spanData, 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); miFillPolyHelper(pDrawable, pGC, pixel, spanData, y, height, left, right, nleft, nright); } static int miLineArcI(DrawablePtr pDraw, GCPtr pGC, int xorg, int yorg, DDXPointPtr points, int *widths) { DDXPointPtr tpts, bpts; int *twids, *bwids; int x, y, e, ex, slw; tpts = points; twids = widths; if (pGC->miTranslate) { xorg += pDraw->x; yorg += pDraw->y; } slw = pGC->lineWidth; if (slw == 1) { tpts->x = xorg; tpts->y = yorg; *twids = 1; return 1; } bpts = tpts + slw; bwids = twids + slw; 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--; tpts->x = xorg - x; tpts->y = yorg - y; tpts++; *twids++ = slw; if ((y != 0) && ((slw > 1) || (e != ex))) { bpts--; bpts->x = xorg - x; bpts->y = yorg + y; *--bwids = slw; } } return pGC->lineWidth; } #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 int miLineArcD(DrawablePtr pDraw, GCPtr pGC, double xorg, double yorg, DDXPointPtr points, int *widths, PolyEdgePtr edge1, int edgey1, Bool edgeleft1, PolyEdgePtr edge2, int edgey2, Bool edgeleft2) { DDXPointPtr pts; int *wids; 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; pts = points; wids = widths; xbase = floor(xorg); x0 = xorg - xbase; ybase = ICEIL(yorg); y0 = yorg - ybase; if (pGC->miTranslate) { xbase += pDraw->x; ybase += pDraw->y; edge1->x += pDraw->x; edge2->x += pDraw->x; edgey1 += pDraw->y; edgey2 += pDraw->y; } 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) { pts->x = xcl; pts->y = ybase; pts++; *wids++ = 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) { pts->x = xcl; pts->y = ybase; pts++; *wids++ = xcr - xcl + 1; } } return pts - points; } static int miRoundJoinFace(LineFacePtr face, PolyEdgePtr edge, Bool *leftEdge) { int y; int dx, dy; double xa, ya; Bool left; dx = -face->dy; dy = face->dx; xa = face->xa; ya = face->ya; left = 1; if (ya > 0) { ya = 0.0; xa = 0.0; } if (dy < 0 || (dy == 0 && dx > 0)) { dx = -dx; dy = -dy; left = !left; } if (dx == 0 && dy == 0) dy = 1; if (dy == 0) { y = ICEIL(face->ya) + face->y; edge->x = -32767; edge->stepx = 0; edge->signdx = 0; edge->e = -1; edge->dy = 0; edge->dx = 0; edge->height = 0; } else { y = miPolyBuildEdge(xa, ya, 0.0, dx, dy, face->x, face->y, !left, edge); edge->height = 32767; } *leftEdge = !left; return y; } static void miRoundJoinClip(LineFacePtr pLeft, LineFacePtr pRight, PolyEdgePtr edge1, PolyEdgePtr edge2, int *y1, int *y2, Bool *left1, Bool *left2) { double denom; denom = -pLeft->dx * (double) pRight->dy + pRight->dx * (double) pLeft->dy; if (denom >= 0) { pLeft->xa = -pLeft->xa; pLeft->ya = -pLeft->ya; } else { pRight->xa = -pRight->xa; pRight->ya = -pRight->ya; } *y1 = miRoundJoinFace(pLeft, edge1, left1); *y2 = miRoundJoinFace(pRight, edge2, left2); } static int miRoundCapClip(LineFacePtr face, Bool isInt, PolyEdgePtr edge, Bool *leftEdge) { int y; int dx, dy; double xa, ya, k; Bool left; dx = -face->dy; dy = face->dx; xa = face->xa; ya = face->ya; k = 0.0; if (!isInt) k = face->k; left = 1; if (dy < 0 || (dy == 0 && dx > 0)) { dx = -dx; dy = -dy; xa = -xa; ya = -ya; left = !left; } if (dx == 0 && dy == 0) dy = 1; if (dy == 0) { y = ICEIL(face->ya) + face->y; edge->x = -32767; edge->stepx = 0; edge->signdx = 0; edge->e = -1; edge->dy = 0; edge->dx = 0; edge->height = 0; } else { y = miPolyBuildEdge(xa, ya, k, dx, dy, face->x, face->y, !left, edge); edge->height = 32767; } *leftEdge = !left; return y; } static void miLineArc(DrawablePtr pDraw, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, LineFacePtr leftFace, LineFacePtr rightFace, double xorg, double yorg, Bool isInt) { int xorgi = 0, yorgi = 0; Spans spanRec; int n; PolyEdgeRec edge1, edge2; int edgey1, edgey2; Bool edgeleft1, edgeleft2; if (isInt) { xorgi = leftFace ? leftFace->x : rightFace->x; yorgi = leftFace ? leftFace->y : rightFace->y; } 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->lineStyle != LineSolid || 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 (!InitSpans(&spanRec, pGC->lineWidth)) return; if (isInt) n = miLineArcI(pDraw, pGC, xorgi, yorgi, spanRec.points, spanRec.widths); else n = miLineArcD(pDraw, pGC, xorg, yorg, spanRec.points, spanRec.widths, &edge1, edgey1, edgeleft1, &edge2, edgey2, edgeleft2); spanRec.count = n; fillSpans(pDraw, pGC, pixel, &spanRec, spanData); } static void miLineProjectingCap(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, LineFacePtr face, Bool isLeft, double xorg, double yorg, Bool isInt) { int xorgi = 0, yorgi = 0; int lw; PolyEdgeRec lefts[4], rights[4]; int lefty, righty, topy, bottomy; PolyEdgePtr left, right; PolyEdgePtr top, bottom; double xa, ya; double k; double xap, yap; int dx, dy; double projectXoff, projectYoff; double maxy; int finaly; if (isInt) { xorgi = face->x; yorgi = face->y; } lw = pGC->lineWidth; dx = face->dx; dy = face->dy; k = face->k; if (dy == 0) { lefts[0].height = lw; lefts[0].x = xorgi; if (isLeft) lefts[0].x -= (lw >> 1); lefts[0].stepx = 0; lefts[0].signdx = 1; lefts[0].e = -lw; lefts[0].dx = 0; lefts[0].dy = lw; rights[0].height = lw; rights[0].x = xorgi; if (!isLeft) rights[0].x += ((lw + 1) >> 1); rights[0].stepx = 0; rights[0].signdx = 1; rights[0].e = -lw; rights[0].dx = 0; rights[0].dy = lw; miFillPolyHelper(pDrawable, pGC, pixel, spanData, yorgi - (lw >> 1), lw, lefts, rights, 1, 1); } else if (dx == 0) { if (dy < 0) { dy = -dy; isLeft = !isLeft; } topy = yorgi; bottomy = yorgi + dy; if (isLeft) topy -= (lw >> 1); else bottomy += (lw >> 1); lefts[0].height = bottomy - topy; lefts[0].x = xorgi - (lw >> 1); lefts[0].stepx = 0; lefts[0].signdx = 1; lefts[0].e = -dy; lefts[0].dx = dx; lefts[0].dy = dy; rights[0].height = bottomy - topy; rights[0].x = lefts[0].x + (lw - 1); rights[0].stepx = 0; rights[0].signdx = 1; rights[0].e = -dy; rights[0].dx = dx; rights[0].dy = dy; miFillPolyHelper(pDrawable, pGC, pixel, spanData, topy, bottomy - topy, lefts, rights, 1, 1); } else { xa = face->xa; ya = face->ya; projectXoff = -ya; projectYoff = xa; 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]; } if (isLeft) { righty = miPolyBuildEdge(xa, ya, k, dx, dy, xorgi, yorgi, 0, right); xa = -xa; ya = -ya; k = -k; lefty = miPolyBuildEdge(xa - projectXoff, ya - projectYoff, k, dx, dy, xorgi, yorgi, 1, left); if (dx > 0) { ya = -ya; xa = -xa; } xap = xa - projectXoff; yap = ya - projectYoff; topy = miPolyBuildEdge(xap, yap, xap * dx + yap * dy, -dy, dx, xorgi, yorgi, dx > 0, top); bottomy = miPolyBuildEdge(xa, ya, 0.0, -dy, dx, xorgi, yorgi, dx < 0, bottom); maxy = -ya; } else { righty = miPolyBuildEdge(xa - projectXoff, ya - projectYoff, k, dx, dy, xorgi, yorgi, 0, right); xa = -xa; ya = -ya; k = -k; lefty = miPolyBuildEdge(xa, ya, k, dx, dy, xorgi, yorgi, 1, left); if (dx > 0) { ya = -ya; xa = -xa; } xap = xa - projectXoff; yap = ya - projectYoff; topy = miPolyBuildEdge(xa, ya, 0.0, -dy, dx, xorgi, xorgi, dx > 0, top); bottomy = miPolyBuildEdge(xap, yap, xap * dx + yap * dy, -dy, dx, xorgi, xorgi, dx < 0, bottom); maxy = -ya + projectYoff; } finaly = ICEIL(maxy) + yorgi; 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; miFillPolyHelper(pDrawable, pGC, pixel, spanData, topy, bottom->height + bottomy - topy, lefts, rights, 2, 2); } } static void miWideSegment(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, int x1, int y1, int x2, int y2, Bool projectLeft, Bool projectRight, LineFacePtr leftFace, LineFacePtr rightFace) { double l, L, r; double xa, ya; double projectXoff = 0.0, projectYoff = 0.0; 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[4], rights[4]; LineFacePtr tface; int lw = pGC->lineWidth; /* 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 == 0) { 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; miFillRectPolyHelper(pDrawable, pGC, pixel, spanData, x, y, dx, dy); } else if (dx == 0) { 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; miFillRectPolyHelper(pDrawable, pGC, pixel, spanData, x, y, dx, dy); } else { l = ((double) lw) / 2.0; L = hypot((double) dx, (double) 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; if (projectLeft | projectRight) { 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; miFillPolyHelper(pDrawable, pGC, pixel, spanData, topy, bottom->height + bottomy - topy, lefts, rights, 2, 2); } } static SpanDataPtr miSetupSpanData(GCPtr pGC, SpanDataPtr spanData, int npt) { if ((npt < 3 && pGC->capStyle != CapRound) || miSpansEasyRop(pGC->alu)) return (SpanDataPtr) NULL; if (pGC->lineStyle == LineDoubleDash) miInitSpanGroup(&spanData->bgGroup); miInitSpanGroup(&spanData->fgGroup); return spanData; } static void miCleanupSpanData(DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData) { if (pGC->lineStyle == LineDoubleDash) { ChangeGCVal oldPixel, pixel; pixel.val = pGC->bgPixel; oldPixel.val = pGC->fgPixel; if (pixel.val != oldPixel.val) { ChangeGC(NullClient, pGC, GCForeground, &pixel); ValidateGC(pDrawable, pGC); } miFillUniqueSpanGroup(pDrawable, pGC, &spanData->bgGroup); miFreeSpanGroup(&spanData->bgGroup); if (pixel.val != oldPixel.val) { ChangeGC(NullClient, pGC, GCForeground, &oldPixel); ValidateGC(pDrawable, pGC); } } miFillUniqueSpanGroup(pDrawable, pGC, &spanData->fgGroup); miFreeSpanGroup(&spanData->fgGroup); } void miWideLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pPts) { int x1, y1, x2, y2; SpanDataRec spanDataRec; SpanDataPtr spanData; long pixel; Bool projectLeft, projectRight; LineFaceRec leftFace, rightFace, prevRightFace; LineFaceRec firstFace; int first; Bool somethingDrawn = FALSE; Bool selfJoin; spanData = miSetupSpanData(pGC, &spanDataRec, npt); pixel = pGC->fgPixel; x2 = pPts->x; y2 = pPts->y; first = TRUE; selfJoin = FALSE; if (npt > 1) { if (mode == CoordModePrevious) { int nptTmp; 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; while (--npt) { x1 = x2; y1 = y2; ++pPts; x2 = pPts->x; y2 = pPts->y; if (mode == CoordModePrevious) { x2 += x1; y2 += y1; } if (x1 != x2 || y1 != y2) { somethingDrawn = TRUE; if (npt == 1 && pGC->capStyle == CapProjecting && !selfJoin) projectRight = TRUE; miWideSegment(pDrawable, pGC, pixel, spanData, x1, y1, x2, y2, projectLeft, projectRight, &leftFace, &rightFace); if (first) { if (selfJoin) firstFace = leftFace; else if (pGC->capStyle == CapRound) { if (pGC->lineWidth == 1 && !spanData) miLineOnePoint(pDrawable, pGC, pixel, spanData, x1, y1); else miLineArc(pDrawable, pGC, pixel, spanData, &leftFace, (LineFacePtr) NULL, (double) 0.0, (double) 0.0, TRUE); } } else { miLineJoin(pDrawable, pGC, pixel, spanData, &leftFace, &prevRightFace); } prevRightFace = rightFace; first = FALSE; projectLeft = FALSE; } if (npt == 1 && somethingDrawn) { if (selfJoin) miLineJoin(pDrawable, pGC, pixel, spanData, &firstFace, &rightFace); else if (pGC->capStyle == CapRound) { if (pGC->lineWidth == 1 && !spanData) miLineOnePoint(pDrawable, pGC, pixel, spanData, x2, y2); else miLineArc(pDrawable, pGC, pixel, spanData, (LineFacePtr) NULL, &rightFace, (double) 0.0, (double) 0.0, TRUE); } } } /* handle crock where all points are coincedent */ if (!somethingDrawn) { projectLeft = pGC->capStyle == CapProjecting; miWideSegment(pDrawable, pGC, pixel, spanData, x2, y2, x2, y2, projectLeft, projectLeft, &leftFace, &rightFace); if (pGC->capStyle == CapRound) { miLineArc(pDrawable, pGC, pixel, spanData, &leftFace, (LineFacePtr) NULL, (double) 0.0, (double) 0.0, TRUE); rightFace.dx = -1; /* sleezy hack to make it work */ miLineArc(pDrawable, pGC, pixel, spanData, (LineFacePtr) NULL, &rightFace, (double) 0.0, (double) 0.0, TRUE); } } if (spanData) miCleanupSpanData(pDrawable, pGC, spanData); } #define V_TOP 0 #define V_RIGHT 1 #define V_BOTTOM 2 #define V_LEFT 3 static void miWideDashSegment(DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData, int *pDashOffset, int *pDashIndex, int x1, int y1, int x2, int y2, Bool projectLeft, Bool projectRight, LineFacePtr leftFace, LineFacePtr rightFace) { int dashIndex, dashRemain; unsigned char *pDash; double L, l; double k; PolyVertexRec vertices[4]; PolyVertexRec saveRight, saveBottom; PolySlopeRec slopes[4]; PolyEdgeRec left[4], right[4]; LineFaceRec lcapFace, rcapFace; int nleft, nright; int h; int y; int dy, dx; unsigned long pixel; double LRemain; double r; double rdx, rdy; double dashDx, dashDy; double saveK = 0.0; Bool first = TRUE; double lcenterx, lcentery, rcenterx = 0.0, rcentery = 0.0; unsigned long fgPixel, bgPixel; dx = x2 - x1; dy = y2 - y1; dashIndex = *pDashIndex; pDash = pGC->dash; dashRemain = pDash[dashIndex] - *pDashOffset; fgPixel = pGC->fgPixel; bgPixel = pGC->bgPixel; if (pGC->fillStyle == FillOpaqueStippled || pGC->fillStyle == FillTiled) { bgPixel = fgPixel; } l = ((double) pGC->lineWidth) / 2.0; if (dx == 0) { L = dy; rdx = 0; rdy = l; if (dy < 0) { L = -dy; rdy = -l; } } else if (dy == 0) { L = dx; rdx = l; rdy = 0; if (dx < 0) { L = -dx; rdx = -l; } } else { L = hypot((double) dx, (double) dy); r = l / L; rdx = r * dx; rdy = r * dy; } k = l * L; LRemain = L; /* All position comments are relative to a line with dx and dy > 0, * but the code does not depend on this */ /* top */ slopes[V_TOP].dx = dx; slopes[V_TOP].dy = dy; slopes[V_TOP].k = k; /* right */ slopes[V_RIGHT].dx = -dy; slopes[V_RIGHT].dy = dx; slopes[V_RIGHT].k = 0; /* bottom */ slopes[V_BOTTOM].dx = -dx; slopes[V_BOTTOM].dy = -dy; slopes[V_BOTTOM].k = k; /* left */ slopes[V_LEFT].dx = dy; slopes[V_LEFT].dy = -dx; slopes[V_LEFT].k = 0; /* preload the start coordinates */ vertices[V_RIGHT].x = vertices[V_TOP].x = rdy; vertices[V_RIGHT].y = vertices[V_TOP].y = -rdx; vertices[V_BOTTOM].x = vertices[V_LEFT].x = -rdy; vertices[V_BOTTOM].y = vertices[V_LEFT].y = rdx; if (projectLeft) { vertices[V_TOP].x -= rdx; vertices[V_TOP].y -= rdy; vertices[V_LEFT].x -= rdx; vertices[V_LEFT].y -= rdy; slopes[V_LEFT].k = rdx * dx + rdy * dy; } lcenterx = x1; lcentery = y1; if (pGC->capStyle == CapRound) { lcapFace.dx = dx; lcapFace.dy = dy; lcapFace.x = x1; lcapFace.y = y1; rcapFace.dx = -dx; rcapFace.dy = -dy; rcapFace.x = x1; rcapFace.y = y1; } while (LRemain > dashRemain) { dashDx = (dashRemain * dx) / L; dashDy = (dashRemain * dy) / L; rcenterx = lcenterx + dashDx; rcentery = lcentery + dashDy; vertices[V_RIGHT].x += dashDx; vertices[V_RIGHT].y += dashDy; vertices[V_BOTTOM].x += dashDx; vertices[V_BOTTOM].y += dashDy; slopes[V_RIGHT].k = vertices[V_RIGHT].x * dx + vertices[V_RIGHT].y * dy; if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1)) { if (pGC->lineStyle == LineOnOffDash && pGC->capStyle == CapProjecting) { saveRight = vertices[V_RIGHT]; saveBottom = vertices[V_BOTTOM]; saveK = slopes[V_RIGHT].k; if (!first) { vertices[V_TOP].x -= rdx; vertices[V_TOP].y -= rdy; vertices[V_LEFT].x -= rdx; vertices[V_LEFT].y -= rdy; slopes[V_LEFT].k = vertices[V_LEFT].x * slopes[V_LEFT].dy - vertices[V_LEFT].y * slopes[V_LEFT].dx; } vertices[V_RIGHT].x += rdx; vertices[V_RIGHT].y += rdy; vertices[V_BOTTOM].x += rdx; vertices[V_BOTTOM].y += rdy; slopes[V_RIGHT].k = vertices[V_RIGHT].x * slopes[V_RIGHT].dy - vertices[V_RIGHT].y * slopes[V_RIGHT].dx; } y = miPolyBuildPoly(vertices, slopes, 4, x1, y1, left, right, &nleft, &nright, &h); pixel = (dashIndex & 1) ? bgPixel : fgPixel; miFillPolyHelper(pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright); if (pGC->lineStyle == LineOnOffDash) { switch (pGC->capStyle) { case CapProjecting: vertices[V_BOTTOM] = saveBottom; vertices[V_RIGHT] = saveRight; slopes[V_RIGHT].k = saveK; break; case CapRound: if (!first) { if (dx < 0) { lcapFace.xa = -vertices[V_LEFT].x; lcapFace.ya = -vertices[V_LEFT].y; lcapFace.k = slopes[V_LEFT].k; } else { lcapFace.xa = vertices[V_TOP].x; lcapFace.ya = vertices[V_TOP].y; lcapFace.k = -slopes[V_LEFT].k; } miLineArc(pDrawable, pGC, pixel, spanData, &lcapFace, (LineFacePtr) NULL, lcenterx, lcentery, FALSE); } if (dx < 0) { rcapFace.xa = vertices[V_BOTTOM].x; rcapFace.ya = vertices[V_BOTTOM].y; rcapFace.k = slopes[V_RIGHT].k; } else { rcapFace.xa = -vertices[V_RIGHT].x; rcapFace.ya = -vertices[V_RIGHT].y; rcapFace.k = -slopes[V_RIGHT].k; } miLineArc(pDrawable, pGC, pixel, spanData, (LineFacePtr) NULL, &rcapFace, rcenterx, rcentery, FALSE); break; } } } LRemain -= dashRemain; ++dashIndex; if (dashIndex == pGC->numInDashList) dashIndex = 0; dashRemain = pDash[dashIndex]; lcenterx = rcenterx; lcentery = rcentery; vertices[V_TOP] = vertices[V_RIGHT]; vertices[V_LEFT] = vertices[V_BOTTOM]; slopes[V_LEFT].k = -slopes[V_RIGHT].k; first = FALSE; } if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1)) { vertices[V_TOP].x -= dx; vertices[V_TOP].y -= dy; vertices[V_LEFT].x -= dx; vertices[V_LEFT].y -= dy; vertices[V_RIGHT].x = rdy; vertices[V_RIGHT].y = -rdx; vertices[V_BOTTOM].x = -rdy; vertices[V_BOTTOM].y = rdx; if (projectRight) { vertices[V_RIGHT].x += rdx; vertices[V_RIGHT].y += rdy; vertices[V_BOTTOM].x += rdx; vertices[V_BOTTOM].y += rdy; slopes[V_RIGHT].k = vertices[V_RIGHT].x * slopes[V_RIGHT].dy - vertices[V_RIGHT].y * slopes[V_RIGHT].dx; } else slopes[V_RIGHT].k = 0; if (!first && pGC->lineStyle == LineOnOffDash && pGC->capStyle == CapProjecting) { vertices[V_TOP].x -= rdx; vertices[V_TOP].y -= rdy; vertices[V_LEFT].x -= rdx; vertices[V_LEFT].y -= rdy; slopes[V_LEFT].k = vertices[V_LEFT].x * slopes[V_LEFT].dy - vertices[V_LEFT].y * slopes[V_LEFT].dx; } else slopes[V_LEFT].k += dx * dx + dy * dy; y = miPolyBuildPoly(vertices, slopes, 4, x2, y2, left, right, &nleft, &nright, &h); pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel; miFillPolyHelper(pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright); if (!first && pGC->lineStyle == LineOnOffDash && pGC->capStyle == CapRound) { lcapFace.x = x2; lcapFace.y = y2; if (dx < 0) { lcapFace.xa = -vertices[V_LEFT].x; lcapFace.ya = -vertices[V_LEFT].y; lcapFace.k = slopes[V_LEFT].k; } else { lcapFace.xa = vertices[V_TOP].x; lcapFace.ya = vertices[V_TOP].y; lcapFace.k = -slopes[V_LEFT].k; } miLineArc(pDrawable, pGC, pixel, spanData, &lcapFace, (LineFacePtr) NULL, rcenterx, rcentery, FALSE); } } dashRemain = ((double) dashRemain) - LRemain; if (dashRemain == 0) { dashIndex++; if (dashIndex == pGC->numInDashList) dashIndex = 0; dashRemain = pDash[dashIndex]; } leftFace->x = x1; leftFace->y = y1; leftFace->dx = dx; leftFace->dy = dy; leftFace->xa = rdy; leftFace->ya = -rdx; leftFace->k = k; rightFace->x = x2; rightFace->y = y2; rightFace->dx = -dx; rightFace->dy = -dy; rightFace->xa = -rdy; rightFace->ya = rdx; rightFace->k = k; *pDashIndex = dashIndex; *pDashOffset = pDash[dashIndex] - dashRemain; } void miWideDash(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pPts) { int x1, y1, x2, y2; unsigned long pixel; Bool projectLeft, projectRight; LineFaceRec leftFace, rightFace, prevRightFace; LineFaceRec firstFace; int first; int dashIndex, dashOffset; int prevDashIndex; SpanDataRec spanDataRec; SpanDataPtr spanData; Bool somethingDrawn = FALSE; Bool selfJoin; Bool endIsFg = FALSE, startIsFg = FALSE; Bool firstIsFg = FALSE, prevIsFg = FALSE; #if 0 /* XXX backward compatibility */ if (pGC->lineWidth == 0) { miZeroDashLine(pDrawable, pGC, mode, npt, pPts); return; } #endif if (pGC->lineStyle == LineDoubleDash && (pGC->fillStyle == FillOpaqueStippled || pGC->fillStyle == FillTiled)) { miWideLine(pDrawable, pGC, mode, npt, pPts); return; } if (npt == 0) return; spanData = miSetupSpanData(pGC, &spanDataRec, npt); x2 = pPts->x; y2 = pPts->y; first = TRUE; selfJoin = FALSE; if (mode == CoordModePrevious) { int nptTmp; 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; dashIndex = 0; dashOffset = 0; miStepDash((int) pGC->dashOffset, &dashIndex, pGC->dash, (int) pGC->numInDashList, &dashOffset); while (--npt) { x1 = x2; y1 = y2; ++pPts; x2 = pPts->x; y2 = pPts->y; if (mode == CoordModePrevious) { x2 += x1; y2 += y1; } if (x1 != x2 || y1 != y2) { somethingDrawn = TRUE; if (npt == 1 && pGC->capStyle == CapProjecting && (!selfJoin || !firstIsFg)) projectRight = TRUE; prevDashIndex = dashIndex; miWideDashSegment(pDrawable, pGC, spanData, &dashOffset, &dashIndex, x1, y1, x2, y2, projectLeft, projectRight, &leftFace, &rightFace); startIsFg = !(prevDashIndex & 1); endIsFg = (dashIndex & 1) ^ (dashOffset != 0); if (pGC->lineStyle == LineDoubleDash || startIsFg) { pixel = startIsFg ? pGC->fgPixel : pGC->bgPixel; if (first || (pGC->lineStyle == LineOnOffDash && !prevIsFg)) { if (first && selfJoin) { firstFace = leftFace; firstIsFg = startIsFg; } else if (pGC->capStyle == CapRound) miLineArc(pDrawable, pGC, pixel, spanData, &leftFace, (LineFacePtr) NULL, (double) 0.0, (double) 0.0, TRUE); } else { miLineJoin(pDrawable, pGC, pixel, spanData, &leftFace, &prevRightFace); } } prevRightFace = rightFace; prevIsFg = endIsFg; first = FALSE; projectLeft = FALSE; } if (npt == 1 && somethingDrawn) { if (pGC->lineStyle == LineDoubleDash || endIsFg) { pixel = endIsFg ? pGC->fgPixel : pGC->bgPixel; if (selfJoin && (pGC->lineStyle == LineDoubleDash || firstIsFg)) { miLineJoin(pDrawable, pGC, pixel, spanData, &firstFace, &rightFace); } else { if (pGC->capStyle == CapRound) miLineArc(pDrawable, pGC, pixel, spanData, (LineFacePtr) NULL, &rightFace, (double) 0.0, (double) 0.0, TRUE); } } else { /* glue a cap to the start of the line if * we're OnOffDash and ended on odd dash */ if (selfJoin && firstIsFg) { pixel = pGC->fgPixel; if (pGC->capStyle == CapProjecting) miLineProjectingCap(pDrawable, pGC, pixel, spanData, &firstFace, TRUE, (double) 0.0, (double) 0.0, TRUE); else if (pGC->capStyle == CapRound) miLineArc(pDrawable, pGC, pixel, spanData, &firstFace, (LineFacePtr) NULL, (double) 0.0, (double) 0.0, TRUE); } } } } /* handle crock where all points are coincident */ if (!somethingDrawn && (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1))) { /* not the same as endIsFg computation above */ pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel; switch (pGC->capStyle) { case CapRound: miLineArc(pDrawable, pGC, pixel, spanData, (LineFacePtr) NULL, (LineFacePtr) NULL, (double) x2, (double) y2, FALSE); break; case CapProjecting: x1 = pGC->lineWidth; miFillRectPolyHelper(pDrawable, pGC, pixel, spanData, x2 - (x1 >> 1), y2 - (x1 >> 1), x1, x1); break; } } if (spanData) miCleanupSpanData(pDrawable, pGC, spanData); } void miPolylines(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { if (gc->lineWidth == 0) { if (gc->lineStyle == LineSolid) miZeroLine(drawable, gc, mode, n, points); else miZeroDashLine(drawable, gc, mode, n, points); } else { if (gc->lineStyle == LineSolid) miWideLine(drawable, gc, mode, n, points); else miWideDash(drawable, gc, mode, n, points); } } xorg-server-1.17.1/mi/micmap.c0000664000175100017510000004222712414702051013033 00000000000000/* * Copyright (c) 1987, Oracle and/or its affiliates. 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 (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. */ /* * This is based on cfbcmap.c. The functions here are useful independently * of cfb, which is the reason for including them here. How "mi" these * are may be debatable. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "scrnintstr.h" #include "colormapst.h" #include "resource.h" #include "globals.h" #include "micmap.h" DevPrivateKeyRec micmapScrPrivateKeyRec; int miListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps) { if (GetInstalledmiColormap(pScreen)) { *pmaps = GetInstalledmiColormap(pScreen)->mid; return 1; } return 0; } void miInstallColormap(ColormapPtr pmap) { ColormapPtr oldpmap = GetInstalledmiColormap(pmap->pScreen); if (pmap != oldpmap) { /* Uninstall pInstalledMap. No hardware changes required, just * notify all interested parties. */ if (oldpmap != (ColormapPtr) None) WalkTree(pmap->pScreen, TellLostMap, (char *) &oldpmap->mid); /* Install pmap */ SetInstalledmiColormap(pmap->pScreen, pmap); WalkTree(pmap->pScreen, TellGainedMap, (char *) &pmap->mid); } } void miUninstallColormap(ColormapPtr pmap) { ColormapPtr curpmap = GetInstalledmiColormap(pmap->pScreen); if (pmap == curpmap) { if (pmap->mid != pmap->pScreen->defColormap) { dixLookupResourceByType((void **) &curpmap, pmap->pScreen->defColormap, RT_COLORMAP, serverClient, DixUseAccess); (*pmap->pScreen->InstallColormap) (curpmap); } } } void miResolveColor(unsigned short *pred, unsigned short *pgreen, unsigned short *pblue, VisualPtr pVisual) { int shift = 16 - pVisual->bitsPerRGBValue; unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1; if ((pVisual->class | DynamicClass) == GrayScale) { /* rescale to gray then rgb bits */ *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100; *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim; } else { /* rescale to rgb bits */ *pred = ((*pred >> shift) * 65535) / lim; *pgreen = ((*pgreen >> shift) * 65535) / lim; *pblue = ((*pblue >> shift) * 65535) / lim; } } Bool miInitializeColormap(ColormapPtr pmap) { unsigned i; VisualPtr pVisual; unsigned lim, maxent, shift; pVisual = pmap->pVisual; lim = (1 << pVisual->bitsPerRGBValue) - 1; shift = 16 - pVisual->bitsPerRGBValue; maxent = pVisual->ColormapEntries - 1; if (pVisual->class == TrueColor) { unsigned limr, limg, limb; limr = pVisual->redMask >> pVisual->offsetRed; limg = pVisual->greenMask >> pVisual->offsetGreen; limb = pVisual->blueMask >> pVisual->offsetBlue; for (i = 0; i <= maxent; i++) { /* rescale to [0..65535] then rgb bits */ pmap->red[i].co.local.red = ((((i * 65535) / limr) >> shift) * 65535) / lim; pmap->green[i].co.local.green = ((((i * 65535) / limg) >> shift) * 65535) / lim; pmap->blue[i].co.local.blue = ((((i * 65535) / limb) >> shift) * 65535) / lim; } } else if (pVisual->class == StaticColor) { unsigned limr, limg, limb; limr = pVisual->redMask >> pVisual->offsetRed; limg = pVisual->greenMask >> pVisual->offsetGreen; limb = pVisual->blueMask >> pVisual->offsetBlue; for (i = 0; i <= maxent; i++) { /* rescale to [0..65535] then rgb bits */ pmap->red[i].co.local.red = ((((((i & pVisual->redMask) >> pVisual->offsetRed) * 65535) / limr) >> shift) * 65535) / lim; pmap->red[i].co.local.green = ((((((i & pVisual->greenMask) >> pVisual->offsetGreen) * 65535) / limg) >> shift) * 65535) / lim; pmap->red[i].co.local.blue = ((((((i & pVisual->blueMask) >> pVisual->offsetBlue) * 65535) / limb) >> shift) * 65535) / lim; } } else if (pVisual->class == StaticGray) { for (i = 0; i <= maxent; i++) { /* rescale to [0..65535] then rgb bits */ pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift) * 65535) / lim; pmap->red[i].co.local.green = pmap->red[i].co.local.red; pmap->red[i].co.local.blue = pmap->red[i].co.local.red; } } return TRUE; } /* When simulating DirectColor on PseudoColor hardware, multiple entries of the colormap must be updated */ #define AddElement(mask) { \ pixel = red | green | blue; \ for (i = 0; i < nresult; i++) \ if (outdefs[i].pixel == pixel) \ break; \ if (i == nresult) \ { \ nresult++; \ outdefs[i].pixel = pixel; \ outdefs[i].flags = 0; \ } \ outdefs[i].flags |= (mask); \ outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \ outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \ outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \ } int miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem * indefs, xColorItem * outdefs) { int red, green, blue; int maxred, maxgreen, maxblue; int stepred, stepgreen, stepblue; VisualPtr pVisual; int pixel; int nresult; int i; pVisual = pmap->pVisual; stepred = 1 << pVisual->offsetRed; stepgreen = 1 << pVisual->offsetGreen; stepblue = 1 << pVisual->offsetBlue; maxred = pVisual->redMask; maxgreen = pVisual->greenMask; maxblue = pVisual->blueMask; nresult = 0; for (; ndef--; indefs++) { if (indefs->flags & DoRed) { red = indefs->pixel & pVisual->redMask; for (green = 0; green <= maxgreen; green += stepgreen) { for (blue = 0; blue <= maxblue; blue += stepblue) { AddElement(DoRed) } } } if (indefs->flags & DoGreen) { green = indefs->pixel & pVisual->greenMask; for (red = 0; red <= maxred; red += stepred) { for (blue = 0; blue <= maxblue; blue += stepblue) { AddElement(DoGreen) } } } if (indefs->flags & DoBlue) { blue = indefs->pixel & pVisual->blueMask; for (red = 0; red <= maxred; red += stepred) { for (green = 0; green <= maxgreen; green += stepgreen) { AddElement(DoBlue) } } } } return nresult; } Bool miCreateDefColormap(ScreenPtr pScreen) { unsigned short zero = 0, ones = 0xFFFF; Pixel wp, bp; VisualPtr pVisual; ColormapPtr cmap; int alloctype; if (!dixRegisterPrivateKey(&micmapScrPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; for (pVisual = pScreen->visuals; pVisual->vid != pScreen->rootVisual; pVisual++); if (pScreen->rootDepth == 1 || (pVisual->class & DynamicClass)) alloctype = AllocNone; else alloctype = AllocAll; if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap, alloctype, 0) != Success) return FALSE; if (pScreen->rootDepth > 1) { wp = pScreen->whitePixel; bp = pScreen->blackPixel; if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) != Success) || (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) != Success)) return FALSE; pScreen->whitePixel = wp; pScreen->blackPixel = bp; } (*pScreen->InstallColormap) (cmap); return TRUE; } /* * Default true color bitmasks, should be overridden by * driver */ #define _RZ(d) ((d + 2) / 3) #define _RS(d) 0 #define _RM(d) ((1 << _RZ(d)) - 1) #define _GZ(d) ((d - _RZ(d) + 1) / 2) #define _GS(d) _RZ(d) #define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d)) #define _BZ(d) (d - _RZ(d) - _GZ(d)) #define _BS(d) (_RZ(d) + _GZ(d)) #define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d)) #define _CE(d) (1 << _RZ(d)) typedef struct _miVisuals { struct _miVisuals *next; int depth; int bitsPerRGB; int visuals; int count; int preferredCVC; Pixel redMask, greenMask, blueMask; } miVisualsRec, *miVisualsPtr; static int miVisualPriority[] = { PseudoColor, GrayScale, StaticColor, TrueColor, DirectColor, StaticGray }; #define NUM_PRIORITY 6 static miVisualsPtr miVisuals; void miClearVisualTypes(void) { miVisualsPtr v; while ((v = miVisuals)) { miVisuals = v->next; free(v); } } Bool miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, int preferredCVC, Pixel redMask, Pixel greenMask, Pixel blueMask) { miVisualsPtr new, *prev, v; int count; new = malloc(sizeof *new); if (!new) return FALSE; if (!redMask || !greenMask || !blueMask) { redMask = _RM(depth); greenMask = _GM(depth); blueMask = _BM(depth); } new->next = 0; new->depth = depth; new->visuals = visuals; new->bitsPerRGB = bitsPerRGB; new->preferredCVC = preferredCVC; new->redMask = redMask; new->greenMask = greenMask; new->blueMask = blueMask; count = (visuals >> 1) & 033333333333; count = visuals - count - ((count >> 1) & 033333333333); count = (((count + (count >> 3)) & 030707070707) % 077); /* HAKMEM 169 */ new->count = count; for (prev = &miVisuals; (v = *prev); prev = &v->next); *prev = new; return TRUE; } Bool miSetVisualTypes(int depth, int visuals, int bitsPerRGB, int preferredCVC) { return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, preferredCVC, 0, 0, 0); } int miGetDefaultVisualMask(int depth) { if (depth > MAX_PSEUDO_DEPTH) return LARGE_VISUALS; else if (depth >= MIN_TRUE_DEPTH) return ALL_VISUALS; else if (depth == 1) return StaticGrayMask; else return SMALL_VISUALS; } static Bool miVisualTypesSet(int depth) { miVisualsPtr visuals; for (visuals = miVisuals; visuals; visuals = visuals->next) if (visuals->depth == depth) return TRUE; return FALSE; } Bool miSetPixmapDepths(void) { int d, f; /* Add any unlisted depths from the pixmap formats */ for (f = 0; f < screenInfo.numPixmapFormats; f++) { d = screenInfo.formats[f].depth; if (!miVisualTypesSet(d)) { if (!miSetVisualTypes(d, 0, 0, -1)) return FALSE; } } return TRUE; } /* * Distance to least significant one bit */ static int maskShift(Pixel p) { int s; if (!p) return 0; s = 0; while (!(p & 1)) { s++; p >>= 1; } return s; } /* * Given a list of formats for a screen, create a list * of visuals and depths for the screen which corespond to * the set which can be used with this version of cfb. */ Bool miInitVisuals(VisualPtr * visualp, DepthPtr * depthp, int *nvisualp, int *ndepthp, int *rootDepthp, VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB, int preferredVis) { int i, j = 0, k; VisualPtr visual; DepthPtr depth; VisualID *vid; int d, b; int f; int ndepth, nvisual; int nvtype; int vtype; miVisualsPtr visuals, nextVisuals; int *preferredCVCs, *prefp; int first_depth; /* none specified, we'll guess from pixmap formats */ if (!miVisuals) { for (f = 0; f < screenInfo.numPixmapFormats; f++) { d = screenInfo.formats[f].depth; b = screenInfo.formats[f].bitsPerPixel; if (sizes & (1 << (b - 1))) vtype = miGetDefaultVisualMask(d); else vtype = 0; if (!miSetVisualTypes(d, vtype, bitsPerRGB, -1)) return FALSE; } } nvisual = 0; ndepth = 0; for (visuals = miVisuals; visuals; visuals = nextVisuals) { nextVisuals = visuals->next; ndepth++; nvisual += visuals->count; } depth = malloc(ndepth * sizeof(DepthRec)); visual = malloc(nvisual * sizeof(VisualRec)); preferredCVCs = malloc(ndepth * sizeof(int)); if (!depth || !visual || !preferredCVCs) { free(depth); free(visual); free(preferredCVCs); return FALSE; } *depthp = depth; *visualp = visual; *ndepthp = ndepth; *nvisualp = nvisual; prefp = preferredCVCs; for (visuals = miVisuals; visuals; visuals = nextVisuals) { nextVisuals = visuals->next; d = visuals->depth; vtype = visuals->visuals; nvtype = visuals->count; *prefp = visuals->preferredCVC; prefp++; vid = NULL; if (nvtype) { vid = malloc(nvtype * sizeof(VisualID)); if (!vid) { free(depth); free(visual); free(preferredCVCs); return FALSE; } } depth->depth = d; depth->numVids = nvtype; depth->vids = vid; depth++; for (i = 0; i < NUM_PRIORITY; i++) { if (!(vtype & (1 << miVisualPriority[i]))) continue; visual->class = miVisualPriority[i]; visual->bitsPerRGBValue = visuals->bitsPerRGB; visual->ColormapEntries = 1 << d; visual->nplanes = d; visual->vid = *vid = FakeClientID(0); switch (visual->class) { case PseudoColor: case GrayScale: case StaticGray: visual->redMask = 0; visual->greenMask = 0; visual->blueMask = 0; visual->offsetRed = 0; visual->offsetGreen = 0; visual->offsetBlue = 0; break; case DirectColor: case TrueColor: visual->ColormapEntries = _CE(d); /* fall through */ case StaticColor: visual->redMask = visuals->redMask; visual->greenMask = visuals->greenMask; visual->blueMask = visuals->blueMask; visual->offsetRed = maskShift(visuals->redMask); visual->offsetGreen = maskShift(visuals->greenMask); visual->offsetBlue = maskShift(visuals->blueMask); } vid++; visual++; } free(visuals); } miVisuals = NULL; visual = *visualp; depth = *depthp; /* * if we did not supplyied by a preferred visual class * check if there is a preferred class in one of the depth * structures - if there is, we want to start looking for the * default visual/depth from that depth. */ first_depth = 0; if (preferredVis < 0 && defaultColorVisualClass < 0) { for (i = 0; i < ndepth; i++) { if (preferredCVCs[i] >= 0) { first_depth = i; break; } } } for (i = first_depth; i < ndepth; i++) { int prefColorVisualClass = -1; if (defaultColorVisualClass >= 0) prefColorVisualClass = defaultColorVisualClass; else if (preferredVis >= 0) prefColorVisualClass = preferredVis; else if (preferredCVCs[i] >= 0) prefColorVisualClass = preferredCVCs[i]; if (*rootDepthp && *rootDepthp != depth[i].depth) continue; for (j = 0; j < depth[i].numVids; j++) { for (k = 0; k < nvisual; k++) if (visual[k].vid == depth[i].vids[j]) break; if (k == nvisual) continue; if (prefColorVisualClass < 0 || visual[k].class == prefColorVisualClass) break; } if (j != depth[i].numVids) break; } if (i == ndepth) { i = 0; j = 0; } *rootDepthp = depth[i].depth; *defaultVisp = depth[i].vids[j]; free(preferredCVCs); return TRUE; } xorg-server-1.17.1/mi/mi.h0000664000175100017510000004537712456571574012234 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef MI_H #define MI_H #include #include "region.h" #include "validate.h" #include "window.h" #include "gc.h" #include #include "input.h" #include "cursor.h" #include "privates.h" #include "colormap.h" #include "events.h" #define MiBits CARD32 typedef struct _miDash *miDashPtr; #define EVEN_DASH 0 #define ODD_DASH ~0 /* miarc.c */ extern _X_EXPORT void miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs); extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*narcs */ , xArc * /*parcs */ ); /* mibitblt.c */ extern _X_EXPORT RegionPtr miCopyArea(DrawablePtr /*pSrcDrawable */ , DrawablePtr /*pDstDrawable */ , GCPtr /*pGC */ , int /*xIn */ , int /*yIn */ , int /*widthSrc */ , int /*heightSrc */ , int /*xOut */ , int /*yOut */ ); extern _X_EXPORT RegionPtr miCopyPlane(DrawablePtr /*pSrcDrawable */ , DrawablePtr /*pDstDrawable */ , GCPtr /*pGC */ , int /*srcx */ , int /*srcy */ , int /*width */ , int /*height */ , int /*dstx */ , int /*dsty */ , unsigned long /*bitPlane */ ); extern _X_EXPORT void miGetImage(DrawablePtr /*pDraw */ , int /*sx */ , int /*sy */ , int /*w */ , int /*h */ , unsigned int /*format */ , unsigned long /*planeMask */ , char * /*pdstLine */ ); extern _X_EXPORT void miPutImage(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*depth */ , int /*x */ , int /*y */ , int /*w */ , int /*h */ , int /*leftPad */ , int /*format */ , char * /*pImage */ ); /* micopy.c */ #define miGetCompositeClip(pGC) ((pGC)->pCompositeClip) typedef void (*miCopyProc) (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pDstBox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT void miCopyRegion(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, RegionPtr pDstRegion, int dx, int dy, miCopyProc copyProc, Pixel bitPlane, void *closure); extern _X_EXPORT RegionPtr miDoCopy(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut, miCopyProc copyProc, Pixel bitplane, void *closure); /* micursor.c */ extern _X_EXPORT void miRecolorCursor(DeviceIntPtr /* pDev */ , ScreenPtr /*pScr */ , CursorPtr /*pCurs */ , Bool /*displayed */ ); /* midash.c */ extern _X_EXPORT void miStepDash(int /*dist */ , int * /*pDashIndex */ , unsigned char * /*pDash */ , int /*numInDashList */ , int * /*pDashOffset */ ); /* mieq.c */ #ifndef INPUT_H typedef struct _DeviceRec *DevicePtr; #endif extern _X_EXPORT Bool mieqInit(void ); extern _X_EXPORT void mieqFini(void); extern _X_EXPORT void mieqEnqueue(DeviceIntPtr /*pDev */ , InternalEvent * /*e */ ); extern _X_EXPORT void mieqSwitchScreen(DeviceIntPtr /* pDev */ , ScreenPtr /*pScreen */ , Bool /*set_dequeue_screen */ ); extern _X_EXPORT void mieqProcessDeviceEvent(DeviceIntPtr /* dev */ , InternalEvent * /* event */ , ScreenPtr /* screen */ ); extern _X_EXPORT void mieqProcessInputEvents(void ); extern DeviceIntPtr CopyGetMasterEvent(DeviceIntPtr /* sdev */ , InternalEvent * /* original */ , InternalEvent * /* copy */ ); /** * Custom input event handler. If you need to process input events in some * other way than the default path, register an input event handler for the * given internal event type. */ typedef void (*mieqHandler) (int screen, InternalEvent *event, DeviceIntPtr dev); void _X_EXPORT mieqSetHandler(int event, mieqHandler handler); /* miexpose.c */ extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ , DrawablePtr /*pDstDrawable */ , GCPtr /*pGC */ , int /*srcx */ , int /*srcy */ , int /*width */ , int /*height */ , int /*dstx */ , int /*dsty */ ); extern _X_EXPORT void miSendExposures(WindowPtr /*pWin */ , RegionPtr /*pRgn */ , int /*dx */ , int /*dy */ ); extern _X_EXPORT void miWindowExposures(WindowPtr /*pWin */ , RegionPtr /*prgn */); extern _X_EXPORT void miPaintWindow(WindowPtr /*pWin */ , RegionPtr /*prgn */ , int /*what */ ); extern _X_EXPORT void miClearDrawable(DrawablePtr /*pDraw */ , GCPtr /*pGC */ ); /* mifillrct.c */ extern _X_EXPORT void miPolyFillRect(DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*nrectFill */ , xRectangle * /*prectInit */ ); /* miglblt.c */ extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase ); extern _X_EXPORT void miImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase ); /* mipoly.c */ extern _X_EXPORT void miFillPolygon(DrawablePtr /*dst */ , GCPtr /*pgc */ , int /*shape */ , int /*mode */ , int /*count */ , DDXPointPtr /*pPts */ ); /* mipolypnt.c */ extern _X_EXPORT void miPolyPoint(DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*mode */ , int /*npt */ , xPoint * /*pptInit */ ); /* mipolyrect.c */ extern _X_EXPORT void miPolyRectangle(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*nrects */ , xRectangle * /*pRects */ ); /* mipolyseg.c */ extern _X_EXPORT void miPolySegment(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*nseg */ , xSegment * /*pSegs */ ); /* mipolytext.c */ extern _X_EXPORT int miPolyText8(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , char * /*chars */ ); extern _X_EXPORT int miPolyText16(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , unsigned short * /*chars */ ); extern _X_EXPORT void miImageText8(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , char * /*chars */ ); extern _X_EXPORT void miImageText16(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , unsigned short * /*chars */ ); /* mipushpxl.c */ extern _X_EXPORT void miPushPixels(GCPtr /*pGC */ , PixmapPtr /*pBitMap */ , DrawablePtr /*pDrawable */ , int /*dx */ , int /*dy */ , int /*xOrg */ , int /*yOrg */ ); /* miscrinit.c */ extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData ); extern _X_EXPORT Bool miCreateScreenResources(ScreenPtr /*pScreen */ ); extern _X_EXPORT Bool miScreenDevPrivateInit(ScreenPtr pScreen, int width, void *pbits ); extern _X_EXPORT Bool miScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int rootDepth, int numDepths, DepthPtr depths, VisualID rootVisual, int numVisuals, VisualPtr visuals ); /* mivaltree.c */ extern _X_EXPORT int miShapedWindowIn(RegionPtr /*universe */ , RegionPtr /*bounding */ , BoxPtr /*rect */ , int /*x */ , int /*y */ ); extern _X_EXPORT int miValidateTree(WindowPtr /*pParent */ , WindowPtr /*pChild */ , VTKind /*kind */ ); extern _X_EXPORT void miWideLine(DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*mode */ , int /*npt */ , DDXPointPtr /*pPts */ ); extern _X_EXPORT void miWideDash(DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*mode */ , int /*npt */ , DDXPointPtr /*pPts */ ); extern _X_EXPORT void miPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pPts); /* miwindow.c */ extern _X_EXPORT void miClearToBackground(WindowPtr /*pWin */ , int /*x */ , int /*y */ , int /*w */ , int /*h */ , Bool /*generateExposures */ ); extern _X_EXPORT void miMarkWindow(WindowPtr /*pWin */ ); extern _X_EXPORT Bool miMarkOverlappedWindows(WindowPtr /*pWin */ , WindowPtr /*pFirst */ , WindowPtr * /*ppLayerWin */ ); extern _X_EXPORT void miHandleValidateExposures(WindowPtr /*pWin */ ); extern _X_EXPORT void miMoveWindow(WindowPtr /*pWin */ , int /*x */ , int /*y */ , WindowPtr /*pNextSib */ , VTKind /*kind */ ); extern _X_EXPORT void miResizeWindow(WindowPtr /*pWin */ , int /*x */ , int /*y */ , unsigned int /*w */ , unsigned int /*h */ , WindowPtr /*pSib */ ); extern _X_EXPORT WindowPtr miGetLayerWindow(WindowPtr /*pWin */ ); extern _X_EXPORT void miSetShape(WindowPtr /*pWin */ , int /*kind */ ); extern _X_EXPORT void miChangeBorderWidth(WindowPtr /*pWin */ , unsigned int /*width */ ); extern _X_EXPORT void miMarkUnrealizedWindow(WindowPtr /*pChild */ , WindowPtr /*pWin */ , Bool /*fromConfigure */ ); extern _X_EXPORT WindowPtr miSpriteTrace(SpritePtr pSprite, int x, int y); extern _X_EXPORT WindowPtr miXYToWindow(ScreenPtr pScreen, SpritePtr pSprite, int x, int y); /* mizerarc.c */ extern _X_EXPORT void miZeroPolyArc(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*narcs */ , xArc * /*parcs */ ); /* mizerline.c */ extern _X_EXPORT void miZeroLine(DrawablePtr /*dst */ , GCPtr /*pgc */ , int /*mode */ , int /*nptInit */ , DDXPointRec * /*pptInit */ ); extern _X_EXPORT void miZeroDashLine(DrawablePtr /*dst */ , GCPtr /*pgc */ , int /*mode */ , int /*nptInit */ , DDXPointRec * /*pptInit */ ); extern _X_EXPORT void miPolyFillArc(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*narcs */ , xArc * /*parcs */ ); #endif /* MI_H */ xorg-server-1.17.1/mi/mizerline.c0000664000175100017510000002573312456571574013612 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "misc.h" #include "scrnintstr.h" #include "gcstruct.h" #include "windowstr.h" #include "pixmap.h" #include "mi.h" #include "miline.h" /* Draw lineSolid, fillStyle-independent zero width lines. * * Must keep X and Y coordinates in "ints" at least until after they're * translated and clipped to accomodate CoordModePrevious lines with very * large coordinates. * * Draws the same pixels regardless of sign(dx) or sign(dy). * * Ken Whaley * */ /* largest positive value that can fit into a component of a point. * Assumes that the point structure is {type x, y;} where type is * a signed type. */ #define MAX_COORDINATE ((1 << (((sizeof(DDXPointRec) >> 1) << 3) - 1)) - 1) #define MI_OUTPUT_POINT(xx, yy)\ {\ if ( !new_span && yy == current_y)\ {\ if (xx < spans->x)\ spans->x = xx;\ ++*widths;\ }\ else\ {\ ++Nspans;\ ++spans;\ ++widths;\ spans->x = xx;\ spans->y = yy;\ *widths = 1;\ current_y = yy;\ new_span = FALSE;\ }\ } void miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode, /* Origin or Previous */ int npt, /* number of points */ DDXPointPtr pptInit) { int Nspans, current_y = 0; DDXPointPtr ppt; DDXPointPtr pspanInit, spans; int *pwidthInit, *widths, list_len; int xleft, ytop, xright, ybottom; int new_x1, new_y1, new_x2, new_y2; int x = 0, y = 0, x1, y1, x2, y2, xstart, ystart; int oc1, oc2; int result; int pt1_clipped, pt2_clipped = 0; Bool new_span; int signdx, signdy; int clipdx, clipdy; int width, height; int adx, ady; int octant; unsigned int bias = miGetZeroLineBias(pDraw->pScreen); int e, e1, e2, e3; /* Bresenham error terms */ int length; /* length of lines == # of pixels on major axis */ xleft = pDraw->x; ytop = pDraw->y; xright = pDraw->x + pDraw->width - 1; ybottom = pDraw->y + pDraw->height - 1; if (!pGC->miTranslate) { /* do everything in drawable-relative coordinates */ xleft = 0; ytop = 0; xright -= pDraw->x; ybottom -= pDraw->y; } /* it doesn't matter whether we're in drawable or screen coordinates, * FillSpans simply cannot take starting coordinates outside of the * range of a DDXPointRec component. */ if (xright > MAX_COORDINATE) xright = MAX_COORDINATE; if (ybottom > MAX_COORDINATE) ybottom = MAX_COORDINATE; /* since we're clipping to the drawable's boundaries & coordinate * space boundaries, we're guaranteed that the larger of width/height * is the longest span we'll need to output */ width = xright - xleft + 1; height = ybottom - ytop + 1; list_len = (height >= width) ? height : width; pspanInit = malloc(list_len * sizeof(DDXPointRec)); pwidthInit = malloc(list_len * sizeof(int)); if (!pspanInit || !pwidthInit) { free(pspanInit); free(pwidthInit); return; } Nspans = 0; new_span = TRUE; spans = pspanInit - 1; widths = pwidthInit - 1; ppt = pptInit; xstart = ppt->x; ystart = ppt->y; if (pGC->miTranslate) { xstart += pDraw->x; ystart += pDraw->y; } /* x2, y2, oc2 copied to x1, y1, oc1 at top of loop to simplify * iteration logic */ x2 = xstart; y2 = ystart; oc2 = 0; MIOUTCODES(oc2, x2, y2, xleft, ytop, xright, ybottom); while (--npt > 0) { x1 = x2; y1 = y2; oc1 = oc2; ++ppt; x2 = ppt->x; y2 = ppt->y; if (pGC->miTranslate && (mode != CoordModePrevious)) { x2 += pDraw->x; y2 += pDraw->y; } else if (mode == CoordModePrevious) { x2 += x1; y2 += y1; } oc2 = 0; MIOUTCODES(oc2, x2, y2, xleft, ytop, xright, ybottom); CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant); if (ady + 1 > (list_len - Nspans)) { (*pGC->ops->FillSpans) (pDraw, pGC, Nspans, pspanInit, pwidthInit, FALSE); Nspans = 0; spans = pspanInit - 1; widths = pwidthInit - 1; } new_span = TRUE; if (adx > ady) { e1 = ady << 1; e2 = e1 - (adx << 1); e = e1 - adx; length = adx; /* don't draw endpoint in main loop */ FIXUP_ERROR(e, octant, bias); new_x1 = x1; new_y1 = y1; new_x2 = x2; new_y2 = y2; pt1_clipped = 0; pt2_clipped = 0; if ((oc1 | oc2) != 0) { result = miZeroClipLine(xleft, ytop, xright, ybottom, &new_x1, &new_y1, &new_x2, &new_y2, adx, ady, &pt1_clipped, &pt2_clipped, octant, bias, oc1, oc2); if (result == -1) continue; length = abs(new_x2 - new_x1); /* if we've clipped the endpoint, always draw the full length * of the segment, because then the capstyle doesn't matter */ if (pt2_clipped) length++; if (pt1_clipped) { /* must calculate new error terms */ clipdx = abs(new_x1 - x1); clipdy = abs(new_y1 - y1); e += (clipdy * e2) + ((clipdx - clipdy) * e1); } } /* draw the segment */ x = new_x1; y = new_y1; e3 = e2 - e1; e = e - e1; while (length--) { MI_OUTPUT_POINT(x, y); e += e1; if (e >= 0) { y += signdy; e += e3; } x += signdx; } } else { /* Y major line */ e1 = adx << 1; e2 = e1 - (ady << 1); e = e1 - ady; length = ady; /* don't draw endpoint in main loop */ SetYMajorOctant(octant); FIXUP_ERROR(e, octant, bias); new_x1 = x1; new_y1 = y1; new_x2 = x2; new_y2 = y2; pt1_clipped = 0; pt2_clipped = 0; if ((oc1 | oc2) != 0) { result = miZeroClipLine(xleft, ytop, xright, ybottom, &new_x1, &new_y1, &new_x2, &new_y2, adx, ady, &pt1_clipped, &pt2_clipped, octant, bias, oc1, oc2); if (result == -1) continue; length = abs(new_y2 - new_y1); /* if we've clipped the endpoint, always draw the full length * of the segment, because then the capstyle doesn't matter */ if (pt2_clipped) length++; if (pt1_clipped) { /* must calculate new error terms */ clipdx = abs(new_x1 - x1); clipdy = abs(new_y1 - y1); e += (clipdx * e2) + ((clipdy - clipdx) * e1); } } /* draw the segment */ x = new_x1; y = new_y1; e3 = e2 - e1; e = e - e1; while (length--) { MI_OUTPUT_POINT(x, y); e += e1; if (e >= 0) { x += signdx; e += e3; } y += signdy; } } } /* only do the capnotlast check on the last segment * and only if the endpoint wasn't clipped. And then, if the last * point is the same as the first point, do not draw it, unless the * line is degenerate */ if ((!pt2_clipped) && (pGC->capStyle != CapNotLast) && (((xstart != x2) || (ystart != y2)) || (ppt == pptInit + 1))) { MI_OUTPUT_POINT(x, y); } if (Nspans > 0) (*pGC->ops->FillSpans) (pDraw, pGC, Nspans, pspanInit, pwidthInit, FALSE); free(pwidthInit); free(pspanInit); } void miZeroDashLine(DrawablePtr dst, GCPtr pgc, int mode, int nptInit, /* number of points in polyline */ DDXPointRec * pptInit /* points in the polyline */ ) { /* XXX kludge until real zero-width dash code is written */ pgc->lineWidth = 1; miWideDash(dst, pgc, mode, nptInit, pptInit); pgc->lineWidth = 0; } xorg-server-1.17.1/mi/mifillarc.h0000664000175100017510000001053512432306326013536 00000000000000/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. ********************************************************/ #ifndef __MIFILLARC_H__ #define __MIFILLARC_H__ #define FULLCIRCLE (360 * 64) typedef struct _miFillArc { int xorg, yorg; int y; int dx, dy; int e; int ym, yk, xm, xk; } miFillArcRec; /* could use 64-bit integers */ typedef struct _miFillArcD { int xorg, yorg; int y; int dx, dy; double e; double ym, yk, xm, xk; } miFillArcDRec; #define miFillArcEmpty(arc) (!(arc)->angle2 || \ !(arc)->width || !(arc)->height || \ (((arc)->width == 1) && ((arc)->height & 1))) #define miCanFillArc(arc) (((arc)->width == (arc)->height) || \ (((arc)->width <= 800) && ((arc)->height <= 800))) #define MIFILLARCSETUP() \ x = 0; \ y = info.y; \ e = info.e; \ xk = info.xk; \ xm = info.xm; \ yk = info.yk; \ ym = info.ym; \ dx = info.dx; \ dy = info.dy; \ xorg = info.xorg; \ yorg = info.yorg #define MIFILLARCSTEP(slw) \ e += yk; \ while (e >= 0) \ { \ x++; \ xk -= xm; \ e += xk; \ } \ y--; \ yk -= ym; \ slw = (x << 1) + dx; \ if ((e == xk) && (slw > 1)) \ slw-- #define MIFILLCIRCSTEP(slw) MIFILLARCSTEP(slw) #define MIFILLELLSTEP(slw) MIFILLARCSTEP(slw) #define miFillArcLower(slw) (((y + dy) != 0) && ((slw > 1) || (e != xk))) typedef struct _miSliceEdge { int x; int stepx; int deltax; int e; int dy; int dx; } miSliceEdgeRec, *miSliceEdgePtr; typedef struct _miArcSlice { miSliceEdgeRec edge1, edge2; int min_top_y, max_top_y; int min_bot_y, max_bot_y; Bool edge1_top, edge2_top; Bool flip_top, flip_bot; } miArcSliceRec; #define MIARCSLICESTEP(edge) \ edge.x -= edge.stepx; \ edge.e -= edge.dx; \ if (edge.e <= 0) \ { \ edge.x -= edge.deltax; \ edge.e += edge.dy; \ } #define miFillSliceUpper(slice) \ ((y >= slice.min_top_y) && (y <= slice.max_top_y)) #define miFillSliceLower(slice) \ ((y >= slice.min_bot_y) && (y <= slice.max_bot_y)) #define MIARCSLICEUPPER(xl,xr,slice,slw) \ xl = xorg - x; \ xr = xl + slw - 1; \ if (slice.edge1_top && (slice.edge1.x < xr)) \ xr = slice.edge1.x; \ if (slice.edge2_top && (slice.edge2.x > xl)) \ xl = slice.edge2.x; #define MIARCSLICELOWER(xl,xr,slice,slw) \ xl = xorg - x; \ xr = xl + slw - 1; \ if (!slice.edge1_top && (slice.edge1.x > xl)) \ xl = slice.edge1.x; \ if (!slice.edge2_top && (slice.edge2.x < xr)) \ xr = slice.edge2.x; #define MIWIDEARCSETUP(x,y,dy,slw,e,xk,xm,yk,ym) \ x = 0; \ y = slw >> 1; \ yk = y << 3; \ xm = 8; \ ym = 8; \ if (dy) \ { \ xk = 0; \ if (slw & 1) \ e = -1; \ else \ e = -(y << 2) - 2; \ } \ else \ { \ y++; \ yk += 4; \ xk = -4; \ if (slw & 1) \ e = -(y << 2) - 3; \ else \ e = - (y << 3); \ } #define MIFILLINARCSTEP(slw) \ ine += inyk; \ while (ine >= 0) \ { \ inx++; \ inxk -= inxm; \ ine += inxk; \ } \ iny--; \ inyk -= inym; \ slw = (inx << 1) + dx; \ if ((ine == inxk) && (slw > 1)) \ slw-- #define miFillInArcLower(slw) (((iny + dy) != 0) && \ ((slw > 1) || (ine != inxk))) #endif /* __MIFILLARC_H__ */ xorg-server-1.17.1/mi/misprite.c0000664000175100017510000007225412362011460013423 00000000000000/* * misprite.c * * machine independent software sprite routines */ /* Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "misc.h" #include "pixmapstr.h" #include "input.h" #include "mi.h" #include "cursorstr.h" #include #include "scrnintstr.h" #include "colormapst.h" #include "windowstr.h" #include "gcstruct.h" #include "mipointer.h" #include "misprite.h" #include "dixfontstr.h" #include #include "inputstr.h" #include "damage.h" typedef struct { CursorPtr pCursor; int x; /* cursor hotspot */ int y; BoxRec saved; /* saved area from the screen */ Bool isUp; /* cursor in frame buffer */ Bool shouldBeUp; /* cursor should be displayed */ WindowPtr pCacheWin; /* window the cursor last seen in */ Bool isInCacheWin; Bool checkPixels; /* check colormap collision */ ScreenPtr pScreen; } miCursorInfoRec, *miCursorInfoPtr; /* * per screen information */ typedef struct { /* screen procedures */ CloseScreenProcPtr CloseScreen; GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; SourceValidateProcPtr SourceValidate; /* window procedures */ CopyWindowProcPtr CopyWindow; /* colormap procedures */ InstallColormapProcPtr InstallColormap; StoreColorsProcPtr StoreColors; /* os layer procedures */ ScreenBlockHandlerProcPtr BlockHandler; xColorItem colors[2]; ColormapPtr pInstalledMap; ColormapPtr pColormap; VisualPtr pVisual; DamagePtr pDamage; /* damage tracking structure */ Bool damageRegistered; int numberOfCursors; } miSpriteScreenRec, *miSpriteScreenPtr; #define SOURCE_COLOR 0 #define MASK_COLOR 1 /* * Overlap BoxPtr and Box elements */ #define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \ (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \ ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2)) /* * Overlap BoxPtr, origins, and rectangle */ #define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \ BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h)) /* * Overlap BoxPtr, origins and RectPtr */ #define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \ ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \ (int)((pRect)->width), (int)((pRect)->height)) /* * Overlap BoxPtr and horizontal span */ #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y)) #define LINE_SORT(x1,y1,x2,y2) \ { int _t; \ if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \ if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } } #define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \ BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2)) #define SPRITE_DEBUG_ENABLE 0 #if SPRITE_DEBUG_ENABLE #define SPRITE_DEBUG(x) ErrorF x #else #define SPRITE_DEBUG(x) #endif #define MISPRITE(dev) \ (IsFloating(dev) ? \ (miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \ (miCursorInfoPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miSpriteDevPrivatesKey)) static void miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) { if (pScreenPriv->damageRegistered) { DamageUnregister(pScreenPriv->pDamage); pScreenPriv->damageRegistered = 0; } } static void miSpriteEnableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) { if (!pScreenPriv->damageRegistered) { pScreenPriv->damageRegistered = 1; DamageRegister(&(pScreen->GetScreenPixmap(pScreen)->drawable), pScreenPriv->pDamage); } } static void miSpriteIsUp(miCursorInfoPtr pDevCursor) { pDevCursor->isUp = TRUE; } static void miSpriteIsDown(miCursorInfoPtr pDevCursor) { pDevCursor->isUp = FALSE; } /* * screen wrappers */ static DevPrivateKeyRec miSpriteScreenKeyRec; #define miSpriteScreenKey (&miSpriteScreenKeyRec) #define GetSpriteScreen(pScreen) \ (dixLookupPrivate(&(pScreen)->devPrivates, miSpriteScreenKey)) static DevPrivateKeyRec miSpriteDevPrivatesKeyRec; #define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec) 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); static void miSpriteGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width, int height, unsigned int subWindowMode); static void miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); static void miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadMask); static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef); static void miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen); static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen); static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); #define SCREEN_PROLOGUE(pPriv, pScreen, field) ((pScreen)->field = \ (pPriv)->field) #define SCREEN_EPILOGUE(pPriv, pScreen, field)\ ((pPriv)->field = (pScreen)->field, (pScreen)->field = miSprite##field) /* * pointer-sprite method table */ static Bool miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static Bool miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static void miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y); static void miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); miPointerSpriteFuncRec miSpritePointerFuncs = { miSpriteRealizeCursor, miSpriteUnrealizeCursor, miSpriteSetCursor, miSpriteMoveCursor, miSpriteDeviceCursorInitialize, miSpriteDeviceCursorCleanup, }; /* * other misc functions */ static void miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen); static void miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen); static void miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen); static void miSpriteRegisterBlockHandler(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) { if (!pScreenPriv->BlockHandler) { pScreenPriv->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = miSpriteBlockHandler; } } static void miSpriteReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure) { ScreenPtr pScreen = closure; miCursorInfoPtr pCursorInfo; DeviceIntPtr pDev; for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && RegionContainsRect(pRegion, &pCursorInfo->saved) != rgnOUT) { SPRITE_DEBUG(("Damage remove\n")); miSpriteRemoveCursor(pDev, pScreen); } } } } /* * miSpriteInitialize -- called from device-dependent screen * initialization proc after all of the function pointers have * been stored in the screen structure. */ Bool miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) { miSpriteScreenPtr pScreenPriv; VisualPtr pVisual; if (!DamageSetup(pScreen)) return FALSE; if (!dixRegisterPrivateKey(&miSpriteScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey (&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec))) return FALSE; pScreenPriv = malloc(sizeof(miSpriteScreenRec)); if (!pScreenPriv) return FALSE; pScreenPriv->pDamage = DamageCreate(miSpriteReportDamage, NULL, DamageReportRawRegion, TRUE, pScreen, pScreen); if (!miPointerInitialize(pScreen, &miSpritePointerFuncs, screenFuncs, TRUE)) { free(pScreenPriv); return FALSE; } for (pVisual = pScreen->visuals; pVisual->vid != pScreen->rootVisual; pVisual++); pScreenPriv->pVisual = pVisual; pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreenPriv->GetImage = pScreen->GetImage; pScreenPriv->GetSpans = pScreen->GetSpans; pScreenPriv->SourceValidate = pScreen->SourceValidate; pScreenPriv->CopyWindow = pScreen->CopyWindow; pScreenPriv->InstallColormap = pScreen->InstallColormap; pScreenPriv->StoreColors = pScreen->StoreColors; pScreenPriv->BlockHandler = NULL; pScreenPriv->pInstalledMap = NULL; pScreenPriv->pColormap = NULL; pScreenPriv->colors[SOURCE_COLOR].red = 0; pScreenPriv->colors[SOURCE_COLOR].green = 0; pScreenPriv->colors[SOURCE_COLOR].blue = 0; pScreenPriv->colors[MASK_COLOR].red = 0; pScreenPriv->colors[MASK_COLOR].green = 0; pScreenPriv->colors[MASK_COLOR].blue = 0; pScreenPriv->damageRegistered = 0; pScreenPriv->numberOfCursors = 0; dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv); pScreen->CloseScreen = miSpriteCloseScreen; pScreen->GetImage = miSpriteGetImage; pScreen->GetSpans = miSpriteGetSpans; pScreen->SourceValidate = miSpriteSourceValidate; pScreen->CopyWindow = miSpriteCopyWindow; pScreen->InstallColormap = miSpriteInstallColormap; pScreen->StoreColors = miSpriteStoreColors; return TRUE; } /* * Screen wrappers */ /* * CloseScreen wrapper -- unwrap everything, free the private data * and call the wrapped function */ static Bool miSpriteCloseScreen(ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->GetImage = pScreenPriv->GetImage; pScreen->GetSpans = pScreenPriv->GetSpans; pScreen->SourceValidate = pScreenPriv->SourceValidate; pScreen->InstallColormap = pScreenPriv->InstallColormap; pScreen->StoreColors = pScreenPriv->StoreColors; DamageDestroy(pScreenPriv->pDamage); free(pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine) { ScreenPtr pScreen = pDrawable->pScreen; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); SCREEN_PROLOGUE(pPriv, pScreen, GetImage); if (pDrawable->type == DRAWABLE_WINDOW) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, sx, sy, w, h)) { SPRITE_DEBUG(("GetImage remove\n")); miSpriteRemoveCursor(pDev, pScreen); } } } } (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); SCREEN_EPILOGUE(pPriv, pScreen, GetImage); } static void miSpriteGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart) { ScreenPtr pScreen = pDrawable->pScreen; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); SCREEN_PROLOGUE(pPriv, pScreen, GetSpans); if (pDrawable->type == DRAWABLE_WINDOW) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) { DDXPointPtr pts; int *widths; int nPts; int xorg, yorg; xorg = pDrawable->x; yorg = pDrawable->y; for (pts = ppt, widths = pwidth, nPts = nspans; nPts--; pts++, widths++) { if (SPN_OVERLAP(&pCursorInfo->saved, pts->y + yorg, pts->x + xorg, *widths)) { SPRITE_DEBUG(("GetSpans remove\n")); miSpriteRemoveCursor(pDev, pScreen); break; } } } } } } (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); SCREEN_EPILOGUE(pPriv, pScreen, GetSpans); } static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width, int height, unsigned int subWindowMode) { ScreenPtr pScreen = pDrawable->pScreen; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); SCREEN_PROLOGUE(pPriv, pScreen, SourceValidate); if (pDrawable->type == DRAWABLE_WINDOW) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, x, y, width, height)) { SPRITE_DEBUG(("SourceValidate remove\n")); miSpriteRemoveCursor(pDev, pScreen); } } } } if (pScreen->SourceValidate) (*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode); SCREEN_EPILOGUE(pPriv, pScreen, SourceValidate); } static void miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWindow->drawable.pScreen; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); SCREEN_PROLOGUE(pPriv, pScreen, CopyWindow); for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); /* * Damage will take care of destination check */ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && RegionContainsRect(prgnSrc, &pCursorInfo->saved) != rgnOUT) { SPRITE_DEBUG(("CopyWindow remove\n")); miSpriteRemoveCursor(pDev, pScreen); } } } (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); SCREEN_EPILOGUE(pPriv, pScreen, CopyWindow); } static void miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; Bool WorkToDo = FALSE; SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler); for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); if (pCursorInfo && !pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) { SPRITE_DEBUG(("BlockHandler save")); miSpriteSaveUnderCursor(pDev, pScreen); } } } for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); if (pCursorInfo && !pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) { SPRITE_DEBUG(("BlockHandler restore\n")); miSpriteRestoreCursor(pDev, pScreen); if (!pCursorInfo->isUp) WorkToDo = TRUE; } } } (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (WorkToDo) SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler); else pPriv->BlockHandler = NULL; } static void miSpriteInstallColormap(ColormapPtr pMap) { ScreenPtr pScreen = pMap->pScreen; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); SCREEN_PROLOGUE(pPriv, pScreen, InstallColormap); (*pScreen->InstallColormap) (pMap); SCREEN_EPILOGUE(pPriv, pScreen, InstallColormap); /* InstallColormap can be called before devices are initialized. */ pPriv->pInstalledMap = pMap; if (pPriv->pColormap != pMap) { DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); pCursorInfo->checkPixels = TRUE; if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) miSpriteRemoveCursor(pDev, pScreen); } } } } static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef) { ScreenPtr pScreen = pMap->pScreen; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); int i; int updated; VisualPtr pVisual; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; SCREEN_PROLOGUE(pPriv, pScreen, StoreColors); (*pScreen->StoreColors) (pMap, ndef, pdef); SCREEN_EPILOGUE(pPriv, pScreen, StoreColors); if (pPriv->pColormap == pMap) { updated = 0; pVisual = pMap->pVisual; if (pVisual->class == DirectColor) { /* Direct color - match on any of the subfields */ #define MaskMatch(a,b,mask) (((a) & (pVisual->mask)) == ((b) & (pVisual->mask))) #define UpdateDAC(dev, plane,dac,mask) {\ if (MaskMatch (dev->colors[plane].pixel,pdef[i].pixel,mask)) {\ dev->colors[plane].dac = pdef[i].dac; \ updated = 1; \ } \ } #define CheckDirect(dev, plane) \ UpdateDAC(dev, plane,red,redMask) \ UpdateDAC(dev, plane,green,greenMask) \ UpdateDAC(dev, plane,blue,blueMask) for (i = 0; i < ndef; i++) { CheckDirect(pPriv, SOURCE_COLOR) CheckDirect(pPriv, MASK_COLOR) } } else { /* PseudoColor/GrayScale - match on exact pixel */ for (i = 0; i < ndef; i++) { if (pdef[i].pixel == pPriv->colors[SOURCE_COLOR].pixel) { pPriv->colors[SOURCE_COLOR] = pdef[i]; if (++updated == 2) break; } if (pdef[i].pixel == pPriv->colors[MASK_COLOR].pixel) { pPriv->colors[MASK_COLOR] = pdef[i]; if (++updated == 2) break; } } } if (updated) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); pCursorInfo->checkPixels = TRUE; if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) miSpriteRemoveCursor(pDev, pScreen); } } } } } static void miSpriteFindColors(miCursorInfoPtr pDevCursor, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen); CursorPtr pCursor; xColorItem *sourceColor, *maskColor; pCursor = pDevCursor->pCursor; sourceColor = &pScreenPriv->colors[SOURCE_COLOR]; maskColor = &pScreenPriv->colors[MASK_COLOR]; if (pScreenPriv->pColormap != pScreenPriv->pInstalledMap || !(pCursor->foreRed == sourceColor->red && pCursor->foreGreen == sourceColor->green && pCursor->foreBlue == sourceColor->blue && pCursor->backRed == maskColor->red && pCursor->backGreen == maskColor->green && pCursor->backBlue == maskColor->blue)) { pScreenPriv->pColormap = pScreenPriv->pInstalledMap; sourceColor->red = pCursor->foreRed; sourceColor->green = pCursor->foreGreen; sourceColor->blue = pCursor->foreBlue; FakeAllocColor(pScreenPriv->pColormap, sourceColor); maskColor->red = pCursor->backRed; maskColor->green = pCursor->backGreen; maskColor->blue = pCursor->backBlue; FakeAllocColor(pScreenPriv->pColormap, maskColor); /* "free" the pixels right away, don't let this confuse you */ FakeFreeColor(pScreenPriv->pColormap, sourceColor->pixel); FakeFreeColor(pScreenPriv->pColormap, maskColor->pixel); } pDevCursor->checkPixels = FALSE; } /* * miPointer interface routines */ #define SPRITE_PAD 8 static Bool miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { miCursorInfoPtr pCursorInfo; if (IsFloating(pDev)) return FALSE; pCursorInfo = MISPRITE(pDev); if (pCursor == pCursorInfo->pCursor) pCursorInfo->checkPixels = TRUE; return miDCRealizeCursor(pScreen, pCursor); } static Bool miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { return miDCUnrealizeCursor(pScreen, pCursor); } static void miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y) { miCursorInfoPtr pPointer; miSpriteScreenPtr pScreenPriv; if (IsFloating(pDev)) return; pPointer = MISPRITE(pDev); pScreenPriv = GetSpriteScreen(pScreen); if (!pCursor) { if (pPointer->shouldBeUp) --pScreenPriv->numberOfCursors; pPointer->shouldBeUp = FALSE; if (pPointer->isUp) miSpriteRemoveCursor(pDev, pScreen); if (pScreenPriv->numberOfCursors == 0) miSpriteDisableDamage(pScreen, pScreenPriv); pPointer->pCursor = 0; return; } if (!pPointer->shouldBeUp) pScreenPriv->numberOfCursors++; pPointer->shouldBeUp = TRUE; if (!pPointer->isUp) miSpriteRegisterBlockHandler(pScreen, pScreenPriv); if (pPointer->x == x && pPointer->y == y && pPointer->pCursor == pCursor && !pPointer->checkPixels) { return; } pPointer->x = x; pPointer->y = y; pPointer->pCacheWin = NullWindow; if (pPointer->checkPixels || pPointer->pCursor != pCursor) { pPointer->pCursor = pCursor; miSpriteFindColors(pPointer, pScreen); } if (pPointer->isUp) { /* TODO: reimplement flicker-free MoveCursor */ SPRITE_DEBUG(("SetCursor remove %d\n", pDev->id)); miSpriteRemoveCursor(pDev, pScreen); } if (!pPointer->isUp && pPointer->pCursor) { SPRITE_DEBUG(("SetCursor restore %d\n", pDev->id)); miSpriteSaveUnderCursor(pDev, pScreen); miSpriteRestoreCursor(pDev, pScreen); } } static void miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { CursorPtr pCursor; if (IsFloating(pDev)) return; pCursor = MISPRITE(pDev)->pCursor; miSpriteSetCursor(pDev, pScreen, pCursor, x, y); } static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) { int ret = miDCDeviceInitialize(pDev, pScreen); if (ret) { miCursorInfoPtr pCursorInfo; pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey); pCursorInfo->pCursor = NULL; pCursorInfo->x = 0; pCursorInfo->y = 0; pCursorInfo->isUp = FALSE; pCursorInfo->shouldBeUp = FALSE; pCursorInfo->pCacheWin = NullWindow; pCursorInfo->isInCacheWin = FALSE; pCursorInfo->checkPixels = TRUE; pCursorInfo->pScreen = FALSE; } return ret; } static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { miCursorInfoPtr pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey); if (DevHasCursor(pDev)) miDCDeviceCleanup(pDev, pScreen); memset(pCursorInfo, 0, sizeof(miCursorInfoRec)); } /* * undraw/draw cursor */ static void miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv; miCursorInfoPtr pCursorInfo; if (IsFloating(pDev)) return; DamageDrawInternal(pScreen, TRUE); pScreenPriv = GetSpriteScreen(pScreen); pCursorInfo = MISPRITE(pDev); miSpriteIsDown(pCursorInfo); miSpriteRegisterBlockHandler(pScreen, pScreenPriv); pCursorInfo->pCacheWin = NullWindow; miSpriteDisableDamage(pScreen, pScreenPriv); if (!miDCRestoreUnderCursor(pDev, pScreen, pCursorInfo->saved.x1, pCursorInfo->saved.y1, pCursorInfo->saved.x2 - pCursorInfo->saved.x1, pCursorInfo->saved.y2 - pCursorInfo->saved.y1)) { miSpriteIsUp(pCursorInfo); } miSpriteEnableDamage(pScreen, pScreenPriv); DamageDrawInternal(pScreen, FALSE); } /* * Called from the block handler, saves area under cursor * before waiting for something to do. */ static void miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv; miCursorInfoPtr pCursorInfo; if (IsFloating(pDev)) return; DamageDrawInternal(pScreen, TRUE); pScreenPriv = GetSpriteScreen(pScreen); pCursorInfo = MISPRITE(pDev); miSpriteComputeSaved(pDev, pScreen); miSpriteDisableDamage(pScreen, pScreenPriv); miDCSaveUnderCursor(pDev, pScreen, pCursorInfo->saved.x1, pCursorInfo->saved.y1, pCursorInfo->saved.x2 - pCursorInfo->saved.x1, pCursorInfo->saved.y2 - pCursorInfo->saved.y1); SPRITE_DEBUG(("SaveUnderCursor %d\n", pDev->id)); miSpriteEnableDamage(pScreen, pScreenPriv); DamageDrawInternal(pScreen, FALSE); } /* * Called from the block handler, restores the cursor * before waiting for something to do. */ static void miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv; int x, y; CursorPtr pCursor; miCursorInfoPtr pCursorInfo; if (IsFloating(pDev)) return; DamageDrawInternal(pScreen, TRUE); pScreenPriv = GetSpriteScreen(pScreen); pCursorInfo = MISPRITE(pDev); miSpriteComputeSaved(pDev, pScreen); pCursor = pCursorInfo->pCursor; x = pCursorInfo->x - (int) pCursor->bits->xhot; y = pCursorInfo->y - (int) pCursor->bits->yhot; miSpriteDisableDamage(pScreen, pScreenPriv); SPRITE_DEBUG(("RestoreCursor %d\n", pDev->id)); if (pCursorInfo->checkPixels) miSpriteFindColors(pCursorInfo, pScreen); if (miDCPutUpCursor(pDev, pScreen, pCursor, x, y, pScreenPriv->colors[SOURCE_COLOR].pixel, pScreenPriv->colors[MASK_COLOR].pixel)) { miSpriteIsUp(pCursorInfo); pCursorInfo->pScreen = pScreen; } miSpriteEnableDamage(pScreen, pScreenPriv); DamageDrawInternal(pScreen, FALSE); } /* * compute the desired area of the screen to save */ static void miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen) { int x, y, w, h; int wpad, hpad; CursorPtr pCursor; miCursorInfoPtr pCursorInfo; if (IsFloating(pDev)) return; pCursorInfo = MISPRITE(pDev); pCursor = pCursorInfo->pCursor; x = pCursorInfo->x - (int) pCursor->bits->xhot; y = pCursorInfo->y - (int) pCursor->bits->yhot; w = pCursor->bits->width; h = pCursor->bits->height; wpad = SPRITE_PAD; hpad = SPRITE_PAD; pCursorInfo->saved.x1 = x - wpad; pCursorInfo->saved.y1 = y - hpad; pCursorInfo->saved.x2 = pCursorInfo->saved.x1 + w + wpad * 2; pCursorInfo->saved.y2 = pCursorInfo->saved.y1 + h + hpad * 2; } xorg-server-1.17.1/mi/mibitblt.c0000664000175100017510000006522012456571574013415 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* Author: Todd Newman (aided and abetted by Mr. Drewry) */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "misc.h" #include "gcstruct.h" #include "pixmapstr.h" #include "windowstr.h" #include "scrnintstr.h" #include "mi.h" #include "regionstr.h" #include #include "servermd.h" #ifndef HAVE_FFS extern int ffs(int); #endif /* MICOPYAREA -- public entry for the CopyArea request * For each rectangle in the source region * get the pixels with GetSpans * set them in the destination with SetSpans * We let SetSpans worry about clipping to the destination. */ _X_COLD RegionPtr miCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut) { DDXPointPtr ppt, pptFirst; unsigned int *pwidthFirst, *pwidth, *pbits; BoxRec srcBox, *prect; /* may be a new region, or just a copy */ RegionPtr prgnSrcClip; /* non-0 if we've created a src clip */ RegionPtr prgnExposed; int realSrcClip = 0; int srcx, srcy, dstx, dsty, i, j, y, width, height, xMin, xMax, yMin, yMax; unsigned int *ordering; int numRects; BoxPtr boxes; srcx = xIn + pSrcDrawable->x; srcy = yIn + pSrcDrawable->y; /* If the destination isn't realized, this is easy */ if (pDstDrawable->type == DRAWABLE_WINDOW && !((WindowPtr) pDstDrawable)->realized) return NULL; /* clip the source */ if (pSrcDrawable->type == DRAWABLE_PIXMAP) { BoxRec box; box.x1 = pSrcDrawable->x; box.y1 = pSrcDrawable->y; box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; prgnSrcClip = RegionCreate(&box, 1); realSrcClip = 1; } else { if (pGC->subWindowMode == IncludeInferiors) { prgnSrcClip = NotClippedByChildren((WindowPtr) pSrcDrawable); realSrcClip = 1; } else prgnSrcClip = &((WindowPtr) pSrcDrawable)->clipList; } /* If the src drawable is a window, we need to translate the srcBox so * that we can compare it with the window's clip region later on. */ srcBox.x1 = srcx; srcBox.y1 = srcy; srcBox.x2 = srcx + widthSrc; srcBox.y2 = srcy + heightSrc; dstx = xOut; dsty = yOut; if (pGC->miTranslate) { dstx += pDstDrawable->x; dsty += pDstDrawable->y; } pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec)); pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int)); numRects = RegionNumRects(prgnSrcClip); boxes = RegionRects(prgnSrcClip); ordering = malloc(numRects * sizeof(unsigned int)); if (!pptFirst || !pwidthFirst || !ordering) { free(ordering); free(pwidthFirst); free(pptFirst); return NULL; } /* If not the same drawable then order of move doesn't matter. Following assumes that boxes are sorted from top to bottom and left to right. */ if ((pSrcDrawable != pDstDrawable) && ((pGC->subWindowMode != IncludeInferiors) || (pSrcDrawable->type == DRAWABLE_PIXMAP) || (pDstDrawable->type == DRAWABLE_PIXMAP))) for (i = 0; i < numRects; i++) ordering[i] = i; else { /* within same drawable, must sequence moves carefully! */ if (dsty <= srcBox.y1) { /* Scroll up or stationary vertical. Vertical order OK */ if (dstx <= srcBox.x1) /* Scroll left or stationary horizontal. Horizontal order OK as well */ for (i = 0; i < numRects; i++) ordering[i] = i; else { /* scroll right. must reverse horizontal banding of rects. */ for (i = 0, j = 1, xMax = 0; i < numRects; j = i + 1, xMax = i) { /* find extent of current horizontal band */ y = boxes[i].y1; /* band has this y coordinate */ while ((j < numRects) && (boxes[j].y1 == y)) j++; /* reverse the horizontal band in the output ordering */ for (j--; j >= xMax; j--, i++) ordering[i] = j; } } } else { /* Scroll down. Must reverse vertical banding. */ if (dstx < srcBox.x1) { /* Scroll left. Horizontal order OK. */ for (i = numRects - 1, j = i - 1, yMin = i, yMax = 0; i >= 0; j = i - 1, yMin = i) { /* find extent of current horizontal band */ y = boxes[i].y1; /* band has this y coordinate */ while ((j >= 0) && (boxes[j].y1 == y)) j--; /* reverse the horizontal band in the output ordering */ for (j++; j <= yMin; j++, i--, yMax++) ordering[yMax] = j; } } else /* Scroll right or horizontal stationary. Reverse horizontal order as well (if stationary, horizontal order can be swapped without penalty and this is faster to compute). */ for (i = 0, j = numRects - 1; i < numRects; i++, j--) ordering[i] = j; } } for (i = 0; i < numRects; i++) { prect = &boxes[ordering[i]]; xMin = max(prect->x1, srcBox.x1); xMax = min(prect->x2, srcBox.x2); yMin = max(prect->y1, srcBox.y1); yMax = min(prect->y2, srcBox.y2); /* is there anything visible here? */ if (xMax <= xMin || yMax <= yMin) continue; ppt = pptFirst; pwidth = pwidthFirst; y = yMin; height = yMax - yMin; width = xMax - xMin; for (j = 0; j < height; j++) { /* We must untranslate before calling GetSpans */ ppt->x = xMin; ppt++->y = y++; *pwidth++ = width; } pbits = malloc(height * PixmapBytePad(width, pSrcDrawable->depth)); if (pbits) { (*pSrcDrawable->pScreen->GetSpans) (pSrcDrawable, width, pptFirst, (int *) pwidthFirst, height, (char *) pbits); ppt = pptFirst; pwidth = pwidthFirst; xMin -= (srcx - dstx); y = yMin - (srcy - dsty); for (j = 0; j < height; j++) { ppt->x = xMin; ppt++->y = y++; *pwidth++ = width; } (*pGC->ops->SetSpans) (pDstDrawable, pGC, (char *) pbits, pptFirst, (int *) pwidthFirst, height, TRUE); free(pbits); } } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut); if (realSrcClip) RegionDestroy(prgnSrcClip); free(ordering); free(pwidthFirst); free(pptFirst); return prgnExposed; } /* MIGETPLANE -- gets a bitmap representing one plane of pDraw * A helper used for CopyPlane and XY format GetImage * No clever strategy here, we grab a scanline at a time, pull out the * bits and then stuff them in a 1 bit deep map. */ /* * This should be replaced with something more general. mi shouldn't have to * care about such things as scanline padding et alia. */ _X_COLD static MiBits * miGetPlane(DrawablePtr pDraw, int planeNum, /* number of the bitPlane */ int sx, int sy, int w, int h, MiBits * result) { int i, j, k, width, bitsPerPixel, widthInBytes; DDXPointRec pt = { 0, 0 }; MiBits pixel; MiBits bit; unsigned char *pCharsOut = NULL; #if BITMAP_SCANLINE_UNIT == 8 #define OUT_TYPE unsigned char #endif #if BITMAP_SCANLINE_UNIT == 16 #define OUT_TYPE CARD16 #endif #if BITMAP_SCANLINE_UNIT == 32 #define OUT_TYPE CARD32 #endif #if BITMAP_SCANLINE_UNIT == 64 #define OUT_TYPE CARD64 #endif OUT_TYPE *pOut; int delta = 0; sx += pDraw->x; sy += pDraw->y; widthInBytes = BitmapBytePad(w); if (!result) result = calloc(h, widthInBytes); if (!result) return NULL; bitsPerPixel = pDraw->bitsPerPixel; pOut = (OUT_TYPE *) result; if (bitsPerPixel == 1) { pCharsOut = (unsigned char *) result; width = w; } else { delta = (widthInBytes / (BITMAP_SCANLINE_UNIT / 8)) - (w / BITMAP_SCANLINE_UNIT); width = 1; #if IMAGE_BYTE_ORDER == MSBFirst planeNum += (32 - bitsPerPixel); #endif } pt.y = sy; for (i = h; --i >= 0; pt.y++) { pt.x = sx; if (bitsPerPixel == 1) { (*pDraw->pScreen->GetSpans) (pDraw, width, &pt, &width, 1, (char *) pCharsOut); pCharsOut += widthInBytes; } else { k = 0; for (j = w; --j >= 0; pt.x++) { /* Fetch the next pixel */ (*pDraw->pScreen->GetSpans) (pDraw, width, &pt, &width, 1, (char *) &pixel); /* * Now get the bit and insert into a bitmap in XY format. */ bit = (pixel >> planeNum) & 1; #if 0 /* XXX assuming bit order == byte order */ #if BITMAP_BIT_ORDER == LSBFirst bit <<= k; #else bit <<= ((BITMAP_SCANLINE_UNIT - 1) - k); #endif #else /* XXX assuming byte order == LSBFirst */ if (screenInfo.bitmapBitOrder == LSBFirst) bit <<= k; else bit <<= ((screenInfo.bitmapScanlineUnit - 1) - (k % screenInfo.bitmapScanlineUnit)) + ((k / screenInfo.bitmapScanlineUnit) * screenInfo.bitmapScanlineUnit); #endif *pOut |= (OUT_TYPE) bit; k++; if (k == BITMAP_SCANLINE_UNIT) { pOut++; k = 0; } } pOut += delta; } } return result; } /* MIOPQSTIPDRAWABLE -- use pbits as an opaque stipple for pDraw. * Drawing through the clip mask we SetSpans() the bits into a * bitmap and stipple those bits onto the destination drawable by doing a * PolyFillRect over the whole drawable, * then we invert the bitmap by copying it onto itself with an alu of * GXinvert, invert the foreground/background colors of the gc, and draw * the background bits. * Note how the clipped out bits of the bitmap are always the background * color so that the stipple never causes FillRect to draw them. */ _X_COLD static void miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, MiBits * pbits, int srcx, int w, int h, int dstx, int dsty) { int oldfill, i; unsigned long oldfg; int *pwidth, *pwidthFirst; ChangeGCVal gcv[6]; PixmapPtr pStipple, pPixmap; DDXPointRec oldOrg; GCPtr pGCT; DDXPointPtr ppt, pptFirst; xRectangle rect; RegionPtr prgnSrcClip; pPixmap = (*pDraw->pScreen->CreatePixmap) (pDraw->pScreen, w + srcx, h, 1, CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return; /* Put the image into a 1 bit deep pixmap */ pGCT = GetScratchGC(1, pDraw->pScreen); if (!pGCT) { (*pDraw->pScreen->DestroyPixmap) (pPixmap); return; } /* First set the whole pixmap to 0 */ gcv[0].val = 0; ChangeGC(NullClient, pGCT, GCBackground, gcv); ValidateGC((DrawablePtr) pPixmap, pGCT); miClearDrawable((DrawablePtr) pPixmap, pGCT); ppt = pptFirst = malloc(h * sizeof(DDXPointRec)); pwidth = pwidthFirst = malloc(h * sizeof(int)); if (!pptFirst || !pwidthFirst) { free(pwidthFirst); free(pptFirst); FreeScratchGC(pGCT); return; } /* we need a temporary region because ChangeClip must be assumed to destroy what it's sent. note that this means we don't have to free prgnSrcClip ourselves. */ prgnSrcClip = RegionCreate(NULL, 0); RegionCopy(prgnSrcClip, prgnSrc); RegionTranslate(prgnSrcClip, srcx, 0); (*pGCT->funcs->ChangeClip) (pGCT, CT_REGION, prgnSrcClip, 0); ValidateGC((DrawablePtr) pPixmap, pGCT); /* Since we know pDraw is always a pixmap, we never need to think * about translation here */ for (i = 0; i < h; i++) { ppt->x = 0; ppt++->y = i; *pwidth++ = w + srcx; } (*pGCT->ops->SetSpans) ((DrawablePtr) pPixmap, pGCT, (char *) pbits, pptFirst, pwidthFirst, h, TRUE); free(pwidthFirst); free(pptFirst); /* Save current values from the client GC */ oldfill = pGC->fillStyle; pStipple = pGC->stipple; if (pStipple) pStipple->refcnt++; oldOrg = pGC->patOrg; /* Set a new stipple in the drawable */ gcv[0].val = FillStippled; gcv[1].ptr = pPixmap; gcv[2].val = dstx - srcx; gcv[3].val = dsty; ChangeGC(NullClient, pGC, GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin, gcv); ValidateGC(pDraw, pGC); /* Fill the drawable with the stipple. This will draw the * foreground color whereever 1 bits are set, leaving everything * with 0 bits untouched. Note that the part outside the clip * region is all 0s. */ rect.x = dstx; rect.y = dsty; rect.width = w; rect.height = h; (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect); /* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only * within the clipping region, the part outside is still all 0s */ gcv[0].val = GXinvert; ChangeGC(NullClient, pGCT, GCFunction, gcv); ValidateGC((DrawablePtr) pPixmap, pGCT); (*pGCT->ops->CopyArea) ((DrawablePtr) pPixmap, (DrawablePtr) pPixmap, pGCT, 0, 0, w + srcx, h, 0, 0); /* Swap foreground and background colors on the GC for the drawable. * Now when we fill the drawable, we will fill in the "Background" * values */ oldfg = pGC->fgPixel; gcv[0].val = pGC->bgPixel; gcv[1].val = oldfg; gcv[2].ptr = pPixmap; ChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple, gcv); ValidateGC(pDraw, pGC); /* PolyFillRect might have bashed the rectangle */ rect.x = dstx; rect.y = dsty; rect.width = w; rect.height = h; (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect); /* Now put things back */ if (pStipple) pStipple->refcnt--; gcv[0].val = oldfg; gcv[1].val = pGC->fgPixel; gcv[2].val = oldfill; gcv[3].ptr = pStipple; gcv[4].val = oldOrg.x; gcv[5].val = oldOrg.y; ChangeGC(NullClient, pGC, GCForeground | GCBackground | GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin, gcv); ValidateGC(pDraw, pGC); /* put what we hope is a smaller clip region back in the scratch gc */ (*pGCT->funcs->ChangeClip) (pGCT, CT_NONE, NULL, 0); FreeScratchGC(pGCT); (*pDraw->pScreen->DestroyPixmap) (pPixmap); } /* MICOPYPLANE -- public entry for the CopyPlane request. * strategy: * First build up a bitmap out of the bits requested * build a source clip * Use the bitmap we've built up as a Stipple for the destination */ _X_COLD RegionPtr miCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bitPlane) { MiBits *ptile; BoxRec box; RegionPtr prgnSrc, prgnExposed; /* incorporate the source clip */ box.x1 = srcx + pSrcDrawable->x; box.y1 = srcy + pSrcDrawable->y; box.x2 = box.x1 + width; box.y2 = box.y1 + height; /* clip to visible drawable */ if (box.x1 < pSrcDrawable->x) box.x1 = pSrcDrawable->x; if (box.y1 < pSrcDrawable->y) box.y1 = pSrcDrawable->y; if (box.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; if (box.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; if (box.x1 > box.x2) box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; prgnSrc = RegionCreate(&box, 1); if (pSrcDrawable->type != DRAWABLE_PIXMAP) { /* clip to visible drawable */ if (pGC->subWindowMode == IncludeInferiors) { RegionPtr clipList = NotClippedByChildren((WindowPtr) pSrcDrawable); RegionIntersect(prgnSrc, prgnSrc, clipList); RegionDestroy(clipList); } else RegionIntersect(prgnSrc, prgnSrc, &((WindowPtr) pSrcDrawable)->clipList); } box = *RegionExtents(prgnSrc); RegionTranslate(prgnSrc, -box.x1, -box.y1); if ((box.x2 > box.x1) && (box.y2 > box.y1)) { /* minimize the size of the data extracted */ /* note that we convert the plane mask bitPlane into a plane number */ box.x1 -= pSrcDrawable->x; box.x2 -= pSrcDrawable->x; box.y1 -= pSrcDrawable->y; box.y2 -= pSrcDrawable->y; ptile = miGetPlane(pSrcDrawable, ffs(bitPlane) - 1, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1, (MiBits *) NULL); if (ptile) { miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0, box.x2 - box.x1, box.y2 - box.y1, dstx + box.x1 - srcx, dsty + box.y1 - srcy); free(ptile); } } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty); RegionDestroy(prgnSrc); return prgnExposed; } /* MIGETIMAGE -- public entry for the GetImage Request * We're getting the image into a memory buffer. While we have to use GetSpans * to read a line from the device (since we don't know what that looks like), * we can just write into the destination buffer * * two different strategies are used, depending on whether we're getting the * image in Z format or XY format * Z format: * Line at a time, GetSpans a line into the destination buffer, then if the * planemask is not all ones, we do a SetSpans into a temporary buffer (to get * bits turned off) and then another GetSpans to get stuff back (because * pixmaps are opaque, and we are passed in the memory to write into). This is * pretty ugly and slow but works. Life is hard. * XY format: * get the single plane specified in planemask */ _X_COLD void miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, unsigned int format, unsigned long planeMask, char *pDst) { unsigned char depth; int i, linelength, width, srcx, srcy; DDXPointRec pt = { 0, 0 }; PixmapPtr pPixmap = NULL; GCPtr pGC = NULL; depth = pDraw->depth; if (format == ZPixmap) { if ((((1LL << depth) - 1) & planeMask) != (1LL << depth) - 1) { ChangeGCVal gcv; xPoint xpt; pGC = GetScratchGC(depth, pDraw->pScreen); if (!pGC) return; pPixmap = (*pDraw->pScreen->CreatePixmap) (pDraw->pScreen, w, 1, depth, CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { FreeScratchGC(pGC); return; } /* * Clear the pixmap before doing anything else */ ValidateGC((DrawablePtr) pPixmap, pGC); xpt.x = xpt.y = 0; width = w; (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &xpt, &width, TRUE); /* alu is already GXCopy */ gcv.val = (XID) planeMask; ChangeGC(NullClient, pGC, GCPlaneMask, &gcv); ValidateGC((DrawablePtr) pPixmap, pGC); } linelength = PixmapBytePad(w, depth); srcx = sx + pDraw->x; srcy = sy + pDraw->y; for (i = 0; i < h; i++) { pt.x = srcx; pt.y = srcy + i; width = w; (*pDraw->pScreen->GetSpans) (pDraw, w, &pt, &width, 1, pDst); if (pPixmap) { pt.x = 0; pt.y = 0; width = w; (*pGC->ops->SetSpans) ((DrawablePtr) pPixmap, pGC, pDst, &pt, &width, 1, TRUE); (*pDraw->pScreen->GetSpans) ((DrawablePtr) pPixmap, w, &pt, &width, 1, pDst); } pDst += linelength; } if (pPixmap) { (*pGC->pScreen->DestroyPixmap) (pPixmap); FreeScratchGC(pGC); } } else { (void) miGetPlane(pDraw, ffs(planeMask) - 1, sx, sy, w, h, (MiBits *) pDst); } } /* MIPUTIMAGE -- public entry for the PutImage request * Here we benefit from knowing the format of the bits pointed to by pImage, * even if we don't know how pDraw represents them. * Three different strategies are used depending on the format * XYBitmap Format: * we just use the Opaque Stipple helper function to cover the destination * Note that this covers all the planes of the drawable with the * foreground color (masked with the GC planemask) where there are 1 bits * and the background color (masked with the GC planemask) where there are * 0 bits * XYPixmap format: * what we're called with is a series of XYBitmaps, but we only want * each XYPixmap to update 1 plane, instead of updating all of them. * we set the foreground color to be all 1s and the background to all 0s * then for each plane, we set the plane mask to only effect that one * plane and recursive call ourself with the format set to XYBitmap * (This clever idea courtesy of RGD.) * ZPixmap format: * This part is simple, just call SetSpans */ _X_COLD void miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) { DDXPointPtr pptFirst, ppt; int *pwidthFirst, *pwidth; RegionPtr prgnSrc; BoxRec box; unsigned long oldFg, oldBg; ChangeGCVal gcv[3]; unsigned long oldPlanemask; unsigned long i; long bytesPer; if (!w || !h) return; switch (format) { case XYBitmap: box.x1 = 0; box.y1 = 0; box.x2 = w; box.y2 = h; prgnSrc = RegionCreate(&box, 1); miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage, leftPad, w, h, x, y); RegionDestroy(prgnSrc); break; case XYPixmap: depth = pGC->depth; oldPlanemask = pGC->planemask; oldFg = pGC->fgPixel; oldBg = pGC->bgPixel; gcv[0].val = (XID) ~0; gcv[1].val = (XID) 0; ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv); bytesPer = (long) h *BitmapBytePad(w + leftPad); for (i = (unsigned long) 1 << (depth - 1); i != 0; i >>= 1, pImage += bytesPer) { if (i & oldPlanemask) { gcv[0].val = (XID) i; ChangeGC(NullClient, pGC, GCPlaneMask, gcv); ValidateGC(pDraw, pGC); (*pGC->ops->PutImage) (pDraw, pGC, 1, x, y, w, h, leftPad, XYBitmap, (char *) pImage); } } gcv[0].val = (XID) oldPlanemask; gcv[1].val = (XID) oldFg; gcv[2].val = (XID) oldBg; ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv); ValidateGC(pDraw, pGC); break; case ZPixmap: ppt = pptFirst = malloc(h * sizeof(DDXPointRec)); pwidth = pwidthFirst = malloc(h * sizeof(int)); if (!pptFirst || !pwidthFirst) { free(pwidthFirst); free(pptFirst); return; } if (pGC->miTranslate) { x += pDraw->x; y += pDraw->y; } for (i = 0; i < h; i++) { ppt->x = x; ppt->y = y + i; ppt++; *pwidth++ = w; } (*pGC->ops->SetSpans) (pDraw, pGC, (char *) pImage, pptFirst, pwidthFirst, h, TRUE); free(pwidthFirst); free(pptFirst); break; } } xorg-server-1.17.1/mi/miexpose.c0000664000175100017510000004473312456571574013446 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "misc.h" #include "regionstr.h" #include "scrnintstr.h" #include "gcstruct.h" #include "windowstr.h" #include "pixmap.h" #include "input.h" #include "dixstruct.h" #include "mi.h" #include #include "globals.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif /* machine-independent graphics exposure code. any device that uses the region package can call this. */ #ifndef RECTLIMIT #define RECTLIMIT 25 /* pick a number, any number > 8 */ #endif /* miHandleExposures generate a region for exposures for areas that were copied from obscured or non-existent areas to non-obscured areas of the destination. Paint the background for the region, if the destination is a window. NOTE: this should generally be called, even if graphicsExposures is false, because this is where bits get recovered from backing store. */ RegionPtr miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { RegionPtr prgnSrcClip; /* drawable-relative source clip */ RegionRec rgnSrcRec; RegionPtr prgnDstClip; /* drawable-relative dest clip */ RegionRec rgnDstRec; BoxRec srcBox; /* unclipped source */ RegionRec rgnExposed; /* exposed region, calculated source- relative, made dst relative to intersect with visible parts of dest and send events to client, and then screen relative to paint the window background */ WindowPtr pSrcWin; BoxRec expBox; Bool extents; /* avoid work if we can */ if (!pGC->graphicsExposures && (pDstDrawable->type == DRAWABLE_PIXMAP) && ((pSrcDrawable->type == DRAWABLE_PIXMAP) || (((WindowPtr) pSrcDrawable)->backStorage == 0))) return NULL; srcBox.x1 = srcx; srcBox.y1 = srcy; srcBox.x2 = srcx + width; srcBox.y2 = srcy + height; if (pSrcDrawable->type != DRAWABLE_PIXMAP) { BoxRec TsrcBox; TsrcBox.x1 = srcx + pSrcDrawable->x; TsrcBox.y1 = srcy + pSrcDrawable->y; TsrcBox.x2 = TsrcBox.x1 + width; TsrcBox.y2 = TsrcBox.y1 + height; pSrcWin = (WindowPtr) pSrcDrawable; if (pGC->subWindowMode == IncludeInferiors) { prgnSrcClip = NotClippedByChildren(pSrcWin); if ((RegionContainsRect(prgnSrcClip, &TsrcBox)) == rgnIN) { RegionDestroy(prgnSrcClip); return NULL; } } else { if ((RegionContainsRect(&pSrcWin->clipList, &TsrcBox)) == rgnIN) return NULL; prgnSrcClip = &rgnSrcRec; RegionNull(prgnSrcClip); RegionCopy(prgnSrcClip, &pSrcWin->clipList); } RegionTranslate(prgnSrcClip, -pSrcDrawable->x, -pSrcDrawable->y); } else { BoxRec box; if ((srcBox.x1 >= 0) && (srcBox.y1 >= 0) && (srcBox.x2 <= pSrcDrawable->width) && (srcBox.y2 <= pSrcDrawable->height)) return NULL; box.x1 = 0; box.y1 = 0; box.x2 = pSrcDrawable->width; box.y2 = pSrcDrawable->height; prgnSrcClip = &rgnSrcRec; RegionInit(prgnSrcClip, &box, 1); pSrcWin = NULL; } if (pDstDrawable == pSrcDrawable) { prgnDstClip = prgnSrcClip; } else if (pDstDrawable->type != DRAWABLE_PIXMAP) { if (pGC->subWindowMode == IncludeInferiors) { prgnDstClip = NotClippedByChildren((WindowPtr) pDstDrawable); } else { prgnDstClip = &rgnDstRec; RegionNull(prgnDstClip); RegionCopy(prgnDstClip, &((WindowPtr) pDstDrawable)->clipList); } RegionTranslate(prgnDstClip, -pDstDrawable->x, -pDstDrawable->y); } else { BoxRec box; box.x1 = 0; box.y1 = 0; box.x2 = pDstDrawable->width; box.y2 = pDstDrawable->height; prgnDstClip = &rgnDstRec; RegionInit(prgnDstClip, &box, 1); } /* drawable-relative source region */ RegionInit(&rgnExposed, &srcBox, 1); /* now get the hidden parts of the source box */ RegionSubtract(&rgnExposed, &rgnExposed, prgnSrcClip); /* move them over the destination */ RegionTranslate(&rgnExposed, dstx - srcx, dsty - srcy); /* intersect with visible areas of dest */ RegionIntersect(&rgnExposed, &rgnExposed, prgnDstClip); /* intersect with client clip region. */ if (pGC->clientClip) RegionIntersect(&rgnExposed, &rgnExposed, pGC->clientClip); /* * If we have LOTS of rectangles, we decide to take the extents * and force an exposure on that. This should require much less * work overall, on both client and server. This is cheating, but * isn't prohibited by the protocol ("spontaneous combustion" :-) * for windows. */ extents = pGC->graphicsExposures && (RegionNumRects(&rgnExposed) > RECTLIMIT) && (pDstDrawable->type != DRAWABLE_PIXMAP); if (pSrcWin) { RegionPtr region; if (!(region = wClipShape(pSrcWin))) region = wBoundingShape(pSrcWin); /* * If you try to CopyArea the extents of a shaped window, compacting the * exposed region will undo all our work! */ if (extents && pSrcWin && region && (RegionContainsRect(region, &srcBox) != rgnIN)) extents = FALSE; } if (extents) { expBox = *RegionExtents(&rgnExposed); RegionReset(&rgnExposed, &expBox); } if ((pDstDrawable->type != DRAWABLE_PIXMAP) && (((WindowPtr) pDstDrawable)->backgroundState != None)) { WindowPtr pWin = (WindowPtr) pDstDrawable; /* make the exposed area screen-relative */ RegionTranslate(&rgnExposed, pDstDrawable->x, pDstDrawable->y); if (extents) { /* miPaintWindow doesn't clip, so we have to */ RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList); } miPaintWindow((WindowPtr) pDstDrawable, &rgnExposed, PW_BACKGROUND); if (extents) { RegionReset(&rgnExposed, &expBox); } else RegionTranslate(&rgnExposed, -pDstDrawable->x, -pDstDrawable->y); } if (prgnDstClip == &rgnDstRec) { RegionUninit(prgnDstClip); } else if (prgnDstClip != prgnSrcClip) { RegionDestroy(prgnDstClip); } if (prgnSrcClip == &rgnSrcRec) { RegionUninit(prgnSrcClip); } else { RegionDestroy(prgnSrcClip); } if (pGC->graphicsExposures) { /* don't look */ RegionPtr exposed = RegionCreate(NullBox, 0); *exposed = rgnExposed; return exposed; } else { RegionUninit(&rgnExposed); return NULL; } } void miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy) { BoxPtr pBox; int numRects; xEvent *pEvent, *pe; int i; pBox = RegionRects(pRgn); numRects = RegionNumRects(pRgn); if (!(pEvent = calloc(1, numRects * sizeof(xEvent)))) return; for (i = numRects, pe = pEvent; --i >= 0; pe++, pBox++) { pe->u.u.type = Expose; pe->u.expose.window = pWin->drawable.id; pe->u.expose.x = pBox->x1 - dx; pe->u.expose.y = pBox->y1 - dy; pe->u.expose.width = pBox->x2 - pBox->x1; pe->u.expose.height = pBox->y2 - pBox->y1; pe->u.expose.count = i; } #ifdef PANORAMIX if (!noPanoramiXExtension) { int scrnum = pWin->drawable.pScreen->myNum; int x = 0, y = 0; XID realWin = 0; if (!pWin->parent) { x = screenInfo.screens[scrnum]->x; y = screenInfo.screens[scrnum]->y; pWin = screenInfo.screens[0]->root; realWin = pWin->drawable.id; } else if (scrnum) { PanoramiXRes *win; win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, scrnum); if (!win) { free(pEvent); return; } realWin = win->info[0].id; dixLookupWindow(&pWin, realWin, serverClient, DixSendAccess); } if (x || y || scrnum) for (i = 0; i < numRects; i++) { pEvent[i].u.expose.window = realWin; pEvent[i].u.expose.x += x; pEvent[i].u.expose.y += y; } } #endif DeliverEvents(pWin, pEvent, numRects, NullWindow); free(pEvent); } void miWindowExposures(WindowPtr pWin, RegionPtr prgn) { RegionPtr exposures = prgn; if (prgn && !RegionNil(prgn)) { RegionRec expRec; int clientInterested = (pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask; if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) { /* * If we have LOTS of rectangles, we decide to take the extents * and force an exposure on that. This should require much less * work overall, on both client and server. This is cheating, but * isn't prohibited by the protocol ("spontaneous combustion" :-). */ BoxRec box; box = *RegionExtents(prgn); exposures = &expRec; RegionInit(exposures, &box, 1); RegionReset(prgn, &box); /* miPaintWindow doesn't clip, so we have to */ RegionIntersect(prgn, prgn, &pWin->clipList); } miPaintWindow(pWin, prgn, PW_BACKGROUND); if (clientInterested) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); if (exposures == &expRec) RegionUninit(exposures); RegionEmpty(prgn); } } #ifdef ROOTLESS /* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */ void RootlessSetPixmapOfAncestors(WindowPtr pWin); void RootlessStartDrawing(WindowPtr pWin); void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn); Bool IsFramedWindow(WindowPtr pWin); #endif void miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { ScreenPtr pScreen = pWin->drawable.pScreen; ChangeGCVal gcval[6]; BITS32 gcmask; GCPtr pGC; int i; BoxPtr pbox; xRectangle *prect; int numRects; /* * Distance from screen to destination drawable, use this * to adjust rendering coordinates which come in in screen space */ int draw_x_off, draw_y_off; /* * Tile offset for drawing; these need to align the tile * to the appropriate window origin */ int tile_x_off, tile_y_off; PixUnion fill; Bool solid = TRUE; DrawablePtr drawable = &pWin->drawable; #ifdef ROOTLESS if (!drawable || drawable->type == UNDRAWABLE_WINDOW) return; if (IsFramedWindow(pWin)) { RootlessStartDrawing(pWin); RootlessDamageRegion(pWin, prgn); if (pWin->backgroundState == ParentRelative) { if ((what == PW_BACKGROUND) || (what == PW_BORDER && !pWin->borderIsPixel)) RootlessSetPixmapOfAncestors(pWin); } } #endif if (what == PW_BACKGROUND) { while (pWin->backgroundState == ParentRelative) pWin = pWin->parent; draw_x_off = drawable->x; draw_y_off = drawable->y; tile_x_off = pWin->drawable.x - draw_x_off; tile_y_off = pWin->drawable.y - draw_y_off; fill = pWin->background; #ifdef COMPOSITE if (pWin->inhibitBGPaint) return; #endif switch (pWin->backgroundState) { case None: return; case BackgroundPixmap: solid = FALSE; break; } } else { PixmapPtr pixmap; tile_x_off = drawable->x; tile_y_off = drawable->y; /* servers without pixmaps draw their own borders */ if (!pScreen->GetWindowPixmap) return; pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable); drawable = &pixmap->drawable; #ifdef COMPOSITE draw_x_off = pixmap->screen_x; draw_y_off = pixmap->screen_y; tile_x_off -= draw_x_off; tile_y_off -= draw_y_off; #else draw_x_off = 0; draw_y_off = 0; #endif fill = pWin->border; solid = pWin->borderIsPixel; } gcval[0].val = GXcopy; gcmask = GCFunction; #ifdef ROOTLESS_SAFEALPHA /* Bit mask for alpha channel with a particular number of bits per * pixel. Note that we only care for 32bpp data. Mac OS X uses planar * alpha for 16bpp. */ #define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0) #endif if (solid) { #ifdef ROOTLESS_SAFEALPHA gcval[1].val = fill.pixel | RootlessAlphaMask(pWin->drawable.bitsPerPixel); #else gcval[1].val = fill.pixel; #endif gcval[2].val = FillSolid; gcmask |= GCForeground | GCFillStyle; } else { int c = 1; #ifdef ROOTLESS_SAFEALPHA gcval[c++].val = ((CARD32) -1) & ~RootlessAlphaMask(pWin->drawable.bitsPerPixel); gcmask |= GCPlaneMask; #endif gcval[c++].val = FillTiled; gcval[c++].ptr = (void *) fill.pixmap; gcval[c++].val = tile_x_off; gcval[c++].val = tile_y_off; gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } prect = malloc(RegionNumRects(prgn) * sizeof(xRectangle)); if (!prect) return; pGC = GetScratchGC(drawable->depth, drawable->pScreen); if (!pGC) { free(prect); return; } ChangeGC(NullClient, pGC, gcmask, gcval); ValidateGC(drawable, pGC); numRects = RegionNumRects(prgn); pbox = RegionRects(prgn); for (i = numRects; --i >= 0; pbox++, prect++) { prect->x = pbox->x1 - draw_x_off; prect->y = pbox->y1 - draw_y_off; prect->width = pbox->x2 - pbox->x1; prect->height = pbox->y2 - pbox->y1; } prect -= numRects; (*pGC->ops->PolyFillRect) (drawable, pGC, numRects, prect); free(prect); FreeScratchGC(pGC); } /* MICLEARDRAWABLE -- sets the entire drawable to the background color of * the GC. Useful when we have a scratch drawable and need to initialize * it. */ void miClearDrawable(DrawablePtr pDraw, GCPtr pGC) { ChangeGCVal fg, bg; xRectangle rect; fg.val = pGC->fgPixel; bg.val = pGC->bgPixel; rect.x = 0; rect.y = 0; rect.width = pDraw->width; rect.height = pDraw->height; ChangeGC(NullClient, pGC, GCForeground, &bg); ValidateGC(pDraw, pGC); (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect); ChangeGC(NullClient, pGC, GCForeground, &fg); ValidateGC(pDraw, pGC); } xorg-server-1.17.1/mi/Makefile.in0000664000175100017510000007335312466505435013510 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = mi DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libmi_la_LIBADD = am_libmi_la_OBJECTS = miarc.lo mibitblt.lo micmap.lo micopy.lo \ midash.lo midispcur.lo mieq.lo miexpose.lo mifillarc.lo \ mifillrct.lo migc.lo miglblt.lo mioverlay.lo mipointer.lo \ mipoly.lo mipolypnt.lo mipolyrect.lo mipolyseg.lo \ mipolytext.lo mipushpxl.lo miscrinit.lo misprite.lo \ mivaltree.lo miwideline.lo miwindow.lo mizerarc.lo \ mizerclip.lo mizerline.lo libmi_la_OBJECTS = $(am_libmi_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 = $(libmi_la_SOURCES) DIST_SOURCES = $(libmi_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = micmap.h miline.h mipointer.h mi.h migc.h \ mipointrst.h mizerarc.h micoord.h mistruct.h mioverlay.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libmi.la @XORG_TRUE@sdk_HEADERS = micmap.h miline.h mipointer.h mi.h \ @XORG_TRUE@ migc.h mipointrst.h mizerarc.h micoord.h \ @XORG_TRUE@ mistruct.h mioverlay.h AM_CFLAGS = $(DIX_CFLAGS) libmi_la_SOURCES = \ mi.h \ miarc.c \ mibitblt.c \ micmap.c \ micmap.h \ micoord.h \ micopy.c \ midash.c \ midispcur.c \ mieq.c \ miexpose.c \ mifillarc.c \ mifillarc.h \ mifillrct.c \ mifpoly.h \ migc.c \ migc.h \ miglblt.c \ miline.h \ mioverlay.c \ mioverlay.h \ mipointer.c \ mipointer.h \ mipointrst.h \ mipoly.c \ mipoly.h \ mipolypnt.c \ mipolyrect.c \ mipolyseg.c \ mipolytext.c \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ misprite.c \ misprite.h \ mistruct.h \ mivaltree.c \ mivalidate.h \ miwideline.c \ miwideline.h \ miwindow.c \ mizerarc.c \ mizerarc.h \ mizerclip.c \ mizerline.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 mi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mi/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libmi.la: $(libmi_la_OBJECTS) $(libmi_la_DEPENDENCIES) $(EXTRA_libmi_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libmi_la_OBJECTS) $(libmi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mibitblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micopy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midispcur.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mieq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miexpose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifillarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifillrct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miglblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mioverlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipoly.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolypnt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolyrect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolyseg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolytext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipushpxl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miscrinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misprite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mivaltree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miwideline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miwindow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mizerarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mizerclip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mizerline.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/mi/mivalidate.h0000664000175100017510000000337712274325511013722 00000000000000/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef MIVALIDATE_H #define MIVALIDATE_H #include "regionstr.h" typedef union _Validate { struct BeforeValidate { DDXPointRec oldAbsCorner; /* old window position */ RegionPtr borderVisible; /* visible region of border, */ /* non-null when size changes */ Bool resized; /* unclipped winSize has changed */ } before; struct AfterValidate { RegionRec exposed; /* exposed regions, absolute pos */ RegionRec borderExposed; } after; } ValidateRec; #endif /* MIVALIDATE_H */ xorg-server-1.17.1/mi/mizerarc.h0000664000175100017510000000556512274325511013420 00000000000000/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. ********************************************************/ typedef struct { int x; int y; int mask; } miZeroArcPtRec; typedef struct { int x, y, k1, k3, a, b, d, dx, dy; int alpha, beta; int xorg, yorg; int xorgo, yorgo; int w, h; int initialMask; miZeroArcPtRec start, altstart, end, altend; int firstx, firsty; int startAngle, endAngle; } miZeroArcRec; #define miCanZeroArc(arc) (((arc)->width == (arc)->height) || \ (((arc)->width <= 800) && ((arc)->height <= 800))) #define MIARCSETUP() \ x = info.x; \ y = info.y; \ k1 = info.k1; \ k3 = info.k3; \ a = info.a; \ b = info.b; \ d = info.d; \ dx = info.dx; \ dy = info.dy #define MIARCOCTANTSHIFT(clause) \ if (a < 0) \ { \ if (y == info.h) \ { \ d = -1; \ a = b = k1 = 0; \ } \ else \ { \ dx = (k1 << 1) - k3; \ k1 = dx - k1; \ k3 = -k3; \ b = b + a - (k1 >> 1); \ d = b + ((-a) >> 1) - d + (k3 >> 3); \ if (dx < 0) \ a = -((-dx) >> 1) - a; \ else \ a = (dx >> 1) - a; \ dx = 0; \ dy = 1; \ clause \ } \ } #define MIARCSTEP(move1,move2) \ b -= k1; \ if (d < 0) \ { \ x += dx; \ y += dy; \ a += k1; \ d += b; \ move1 \ } \ else \ { \ x++; \ y++; \ a += k3; \ d -= a; \ move2 \ } #define MIARCCIRCLESTEP(clause) \ b -= k1; \ x++; \ if (d < 0) \ { \ a += k1; \ d += b; \ } \ else \ { \ y++; \ a += k3; \ d -= a; \ clause \ } /* mizerarc.c */ extern _X_EXPORT Bool miZeroArcSetup(xArc * /*arc */ , miZeroArcRec * /*info */ , Bool /*ok360 */ ); xorg-server-1.17.1/mi/miinitext.c0000664000175100017510000002636512456571574013630 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* * 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 SCREENSAVER #undef RANDR #undef DAMAGE #undef COMPOSITE #undef MITSHM #endif #ifdef HAVE_XNEST_CONFIG_H #include #undef COMPOSITE #undef DPMSExtension #endif #ifdef HAVE_KDRIVE_CONFIG_H #include #endif #ifdef HAVE_XGL_CONFIG_H #include #endif #include "misc.h" #include "extension.h" #include "extinit.h" #include "micmap.h" #include "globals.h" /* The following is only a small first step towards run-time * configurable extensions. */ typedef struct { const char *name; Bool *disablePtr; } ExtensionToggle; static ExtensionToggle ExtensionToggleList[] = { /* sort order is extension name string as shown in xdpyinfo */ {"Generic Events", &noGEExtension}, #ifdef COMPOSITE {"Composite", &noCompositeExtension}, #endif #ifdef DAMAGE {"DAMAGE", &noDamageExtension}, #endif #ifdef DBE {"DOUBLE-BUFFER", &noDbeExtension}, #endif #ifdef DPMSExtension {"DPMS", &noDPMSExtension}, #endif #ifdef GLXEXT {"GLX", &noGlxExtension}, #endif #ifdef SCREENSAVER {"MIT-SCREEN-SAVER", &noScreenSaverExtension}, #endif #ifdef MITSHM {SHMNAME, &noMITShmExtension}, #endif #ifdef RANDR {"RANDR", &noRRExtension}, #endif {"RENDER", &noRenderExtension}, #ifdef XCSECURITY {"SECURITY", &noSecurityExtension}, #endif #ifdef RES {"X-Resource", &noResExtension}, #endif #ifdef XF86BIGFONT {"XFree86-Bigfont", &noXFree86BigfontExtension}, #endif #ifdef XORGSERVER #ifdef XFreeXDGA {"XFree86-DGA", &noXFree86DGAExtension}, #endif #ifdef XF86DRI {"XFree86-DRI", &noXFree86DRIExtension}, #endif #ifdef XF86VIDMODE {"XFree86-VidModeExtension", &noXFree86VidModeExtension}, #endif #endif {"XFIXES", &noXFixesExtension}, #ifdef PANORAMIX {"XINERAMA", &noPanoramiXExtension}, #endif {"XInputExtension", NULL}, {"XKEYBOARD", NULL}, #ifdef XSELINUX {"SELinux", &noSELinuxExtension}, #endif {"XTEST", &noTestExtensions}, #ifdef XV {"XVideo", &noXvExtension}, #endif }; Bool EnableDisableExtension(const char *name, Bool enable) { ExtensionToggle *ext; int i; for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { ext = &ExtensionToggleList[i]; if (strcmp(name, ext->name) == 0) { if (ext->disablePtr != NULL) { *ext->disablePtr = !enable; return TRUE; } else { /* Extension is always on, impossible to disable */ return enable; /* okay if they wanted to enable, fail if they tried to disable */ } } } return FALSE; } void EnableDisableExtensionError(const char *name, Bool enable) { ExtensionToggle *ext; int i; Bool found = FALSE; 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; break; } } if (found == FALSE) 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 (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { ext = &ExtensionToggleList[i]; if (ext->disablePtr != NULL) { ErrorF("[mi] %s\n", ext->name); } } } /* List of built-in (statically linked) extensions */ static const ExtensionModule staticExtensions[] = { {GEExtensionInit, "Generic Event Extension", &noGEExtension}, {ShapeExtensionInit, "SHAPE", NULL}, #ifdef MITSHM {ShmExtensionInit, SHMNAME, &noMITShmExtension}, #endif {XInputExtensionInit, "XInputExtension", NULL}, #ifdef XTEST {XTestExtensionInit, XTestExtensionName, &noTestExtensions}, #endif {BigReqExtensionInit, "BIG-REQUESTS", NULL}, {SyncExtensionInit, "SYNC", NULL}, {XkbExtensionInit, XkbName, NULL}, {XCMiscExtensionInit, "XC-MISC", NULL}, #ifdef XCSECURITY {SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension}, #endif #ifdef PANORAMIX {PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension}, #endif #ifdef INXQUARTZ /* PseudoramiXExtensionInit must be done before RRExtensionInit, or * XQuartz will render windows offscreen. */ {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension}, #endif /* must be before Render to layer DisplayCursor correctly */ {XFixesExtensionInit, "XFIXES", &noXFixesExtension}, #ifdef XF86BIGFONT {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension}, #endif {RenderExtensionInit, "RENDER", &noRenderExtension}, #ifdef RANDR {RRExtensionInit, "RANDR", &noRRExtension}, #endif #ifdef COMPOSITE {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension}, #endif #ifdef DAMAGE {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 PRESENT {present_extension_init, PRESENT_NAME, NULL}, #endif #ifdef DRI3 {dri3_extension_init, DRI3_NAME, NULL}, #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 }; static ExtensionModule *ExtensionModuleList = NULL; static int numExtensionModules = 0; static void AddStaticExtensions(void) { static Bool listInitialised = FALSE; if (listInitialised) return; listInitialised = TRUE; /* Add built-in extensions to the list. */ LoadExtensionList(staticExtensions, ARRAY_SIZE(staticExtensions), TRUE); } void InitExtensions(int argc, char *argv[]) { int i; ExtensionModule *ext; AddStaticExtensions(); for (i = 0; i < numExtensionModules; i++) { ext = &ExtensionModuleList[i]; if (ext->initFunc != NULL && (ext->disablePtr == NULL || !*ext->disablePtr)) { (ext->initFunc) (); } } } static ExtensionModule * NewExtensionModuleList(int size) { ExtensionModule *save = ExtensionModuleList; int n; /* Sanity check */ if (!ExtensionModuleList) numExtensionModules = 0; n = numExtensionModules + size; ExtensionModuleList = realloc(ExtensionModuleList, n * sizeof(ExtensionModule)); if (ExtensionModuleList == NULL) { ExtensionModuleList = save; return NULL; } else { numExtensionModules += size; return ExtensionModuleList + (numExtensionModules - size); } } void LoadExtensionList(const ExtensionModule ext[], int size, Bool builtin) { ExtensionModule *newext; int i; /* Make sure built-in extensions get added to the list before those * in modules. */ AddStaticExtensions(); if (!(newext = NewExtensionModuleList(size))) return; for (i = 0; i < size; i++, newext++) { newext->name = ext[i].name; newext->initFunc = ext[i].initFunc; newext->disablePtr = ext[i].disablePtr; } } xorg-server-1.17.1/mi/mipointer.h0000664000175100017510000001117712274325511013606 00000000000000/* Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef MIPOINTER_H #define MIPOINTER_H #include "cursor.h" #include "input.h" #include "privates.h" typedef struct _miPointerSpriteFuncRec { Bool (*RealizeCursor) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScr */ , CursorPtr /* pCurs */ ); Bool (*UnrealizeCursor) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScr */ , CursorPtr /* pCurs */ ); void (*SetCursor) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScr */ , CursorPtr /* pCurs */ , int /* x */ , int /* y */ ); void (*MoveCursor) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScr */ , int /* x */ , int /* y */ ); Bool (*DeviceCursorInitialize) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScr */ ); void (*DeviceCursorCleanup) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScr */ ); } miPointerSpriteFuncRec, *miPointerSpriteFuncPtr; typedef struct _miPointerScreenFuncRec { Bool (*CursorOffScreen) (ScreenPtr * /* ppScr */ , int * /* px */ , int * /* py */ ); void (*CrossScreen) (ScreenPtr /* pScr */ , int /* entering */ ); void (*WarpCursor) (DeviceIntPtr /*pDev */ , ScreenPtr /* pScr */ , int /* x */ , int /* y */ ); } miPointerScreenFuncRec, *miPointerScreenFuncPtr; extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ , miPointerScreenFuncPtr /*screenFuncs */ ); extern _X_EXPORT Bool miPointerInitialize(ScreenPtr /*pScreen */ , miPointerSpriteFuncPtr /*spriteFuncs */ , miPointerScreenFuncPtr /*screenFuncs */ , Bool /*waitForUpdate */ ); extern _X_EXPORT void miPointerWarpCursor(DeviceIntPtr /*pDev */ , ScreenPtr /*pScreen */ , int /*x */ , int /*y */ ); extern _X_EXPORT ScreenPtr miPointerGetScreen(DeviceIntPtr pDev); extern _X_EXPORT void miPointerSetScreen(DeviceIntPtr pDev, int screen_num, int x, int y); /* Returns the current cursor position. */ extern _X_EXPORT void 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, int *nevents, InternalEvent *events); extern _X_EXPORT void miPointerUpdateSprite(DeviceIntPtr pDev); /* Sets whether the sprite should be updated immediately on pointer moves */ extern _X_EXPORT Bool miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait); extern _X_EXPORT DevPrivateKeyRec miPointerPrivKeyRec; #define miPointerPrivKey (&miPointerPrivKeyRec) extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec; #define miPointerScreenKey (&miPointerScreenKeyRec) #endif /* MIPOINTER_H */ xorg-server-1.17.1/mi/mipolyrect.c0000664000175100017510000001366012456571574013777 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "regionstr.h" #include "gcstruct.h" #include "pixmap.h" #include "mi.h" void miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects) { int i; xRectangle *pR = pRects; DDXPointRec rect[5]; int bound_tmp; #define MINBOUND(dst,eqn) bound_tmp = eqn; \ if (bound_tmp < -32768) \ bound_tmp = -32768; \ dst = bound_tmp; #define MAXBOUND(dst,eqn) bound_tmp = eqn; \ if (bound_tmp > 32767) \ bound_tmp = 32767; \ dst = bound_tmp; #define MAXUBOUND(dst,eqn) bound_tmp = eqn; \ if (bound_tmp > 65535) \ bound_tmp = 65535; \ dst = bound_tmp; if (pGC->lineStyle == LineSolid && pGC->joinStyle == JoinMiter && pGC->lineWidth != 0) { xRectangle *tmp, *t; int ntmp; int offset1, offset2, offset3; int x, y, width, height; ntmp = (nrects << 2); offset2 = pGC->lineWidth; offset1 = offset2 >> 1; offset3 = offset2 - offset1; tmp = malloc(ntmp * sizeof(xRectangle)); if (!tmp) return; t = tmp; for (i = 0; i < nrects; i++) { x = pR->x; y = pR->y; width = pR->width; height = pR->height; pR++; if (width == 0 && height == 0) { rect[0].x = x; rect[0].y = y; rect[1].x = x; rect[1].y = y; (*pGC->ops->Polylines) (pDraw, pGC, CoordModeOrigin, 2, rect); } else if (height < offset2 || width < offset1) { if (height == 0) { t->x = x; t->width = width; } else { MINBOUND(t->x, x - offset1) MAXUBOUND(t->width, width + offset2) } if (width == 0) { t->y = y; t->height = height; } else { MINBOUND(t->y, y - offset1) MAXUBOUND(t->height, height + offset2) } t++; } else { MINBOUND(t->x, x - offset1) MINBOUND(t->y, y - offset1) MAXUBOUND(t->width, width + offset2) t->height = offset2; t++; MINBOUND(t->x, x - offset1) MAXBOUND(t->y, y + offset3); t->width = offset2; t->height = height - offset2; t++; MAXBOUND(t->x, x + width - offset1); MAXBOUND(t->y, y + offset3) t->width = offset2; t->height = height - offset2; t++; MINBOUND(t->x, x - offset1) MAXBOUND(t->y, y + height - offset1) MAXUBOUND(t->width, width + offset2) t->height = offset2; t++; } } (*pGC->ops->PolyFillRect) (pDraw, pGC, t - tmp, tmp); free((void *) tmp); } else { for (i = 0; i < nrects; i++) { rect[0].x = pR->x; rect[0].y = pR->y; MAXBOUND(rect[1].x, pR->x + (int) pR->width) rect[1].y = rect[0].y; rect[2].x = rect[1].x; MAXBOUND(rect[2].y, pR->y + (int) pR->height); rect[3].x = rect[0].x; rect[3].y = rect[2].y; rect[4].x = rect[0].x; rect[4].y = rect[0].y; (*pGC->ops->Polylines) (pDraw, pGC, CoordModeOrigin, 5, rect); pR++; } } } xorg-server-1.17.1/mi/mipolyseg.c0000664000175100017510000000600312456571574013611 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "regionstr.h" #include "gcstruct.h" #include "pixmap.h" #include "mi.h" /***************************************************************** * miPolySegment * * For each segment, draws a line between (x1, y1) and (x2, y2). The * lines are drawn in the order listed. * * Walks the segments, compressing them into format for PolyLines. * *****************************************************************/ void miPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSegs) { int i; for (i = 0; i < nseg; i++) { (*pGC->ops->Polylines) (pDraw, pGC, CoordModeOrigin, 2, (DDXPointPtr) pSegs); pSegs++; } } xorg-server-1.17.1/mi/micmap.h0000664000175100017510000000476112274325511013047 00000000000000 #include "colormapst.h" #ifndef _MICMAP_H_ #define _MICMAP_H_ #define GetInstalledmiColormap(s) \ ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, micmapScrPrivateKey)) #define SetInstalledmiColormap(s,c) \ (dixSetPrivate(&(s)->devPrivates, micmapScrPrivateKey, c)) extern _X_EXPORT DevPrivateKeyRec micmapScrPrivateKeyRec; #define micmapScrPrivateKey (&micmapScrPrivateKeyRec) typedef Bool (*miInitVisualsProcPtr) (VisualPtr *, DepthPtr *, int *, int *, int *, VisualID *, unsigned long, int, int); extern _X_EXPORT int miListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps); extern _X_EXPORT void miInstallColormap(ColormapPtr pmap); extern _X_EXPORT void miUninstallColormap(ColormapPtr pmap); extern _X_EXPORT void miResolveColor(unsigned short *, unsigned short *, unsigned short *, VisualPtr); extern _X_EXPORT Bool miInitializeColormap(ColormapPtr); extern _X_EXPORT int miExpandDirectColors(ColormapPtr, int, xColorItem *, xColorItem *); extern _X_EXPORT Bool miCreateDefColormap(ScreenPtr); extern _X_EXPORT void miClearVisualTypes(void); extern _X_EXPORT Bool miSetVisualTypes(int, int, int, int); extern _X_EXPORT Bool miSetPixmapDepths(void); extern _X_EXPORT Bool miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, int preferredCVC, Pixel redMask, Pixel greenMask, Pixel blueMask); extern _X_EXPORT int miGetDefaultVisualMask(int); extern _X_EXPORT Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *, int *, VisualID *, unsigned long, int, int); #define MAX_PSEUDO_DEPTH 10 #define MIN_TRUE_DEPTH 6 #define StaticGrayMask (1 << StaticGray) #define GrayScaleMask (1 << GrayScale) #define StaticColorMask (1 << StaticColor) #define PseudoColorMask (1 << PseudoColor) #define TrueColorMask (1 << TrueColor) #define DirectColorMask (1 << DirectColor) #define ALL_VISUALS (StaticGrayMask|\ GrayScaleMask|\ StaticColorMask|\ PseudoColorMask|\ TrueColorMask|\ DirectColorMask) #define LARGE_VISUALS (TrueColorMask|\ DirectColorMask) #define SMALL_VISUALS (StaticGrayMask|\ GrayScaleMask|\ StaticColorMask|\ PseudoColorMask) #endif /* _MICMAP_H_ */ xorg-server-1.17.1/mi/misprite.h0000664000175100017510000000414112274325511013425 00000000000000/* * misprite.h * * software-sprite/sprite drawing interface spec * * mi versions of these routines exist. */ /* Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ extern Bool miSpriteInitialize(ScreenPtr /*pScreen */ , miPointerScreenFuncPtr /*screenFuncs */ ); extern Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); extern Bool miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); extern Bool miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y, unsigned long source, unsigned long mask); extern Bool miDCSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, int w, int h); extern Bool miDCRestoreUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, int w, int h); extern Bool miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen); extern void miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); xorg-server-1.17.1/mi/mipoly.h0000664000175100017510000001452612456571574013130 00000000000000/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * fill.h * * Created by Brian Kelleher; Oct 1985 * * Include file for filled polygon routines. * * These are the data structures needed to scan * convert regions. Two different scan conversion * methods are available -- the even-odd method, and * the winding number method. * The even-odd rule states that a point is inside * the polygon if a ray drawn from that point in any * direction will pass through an odd number of * path segments. * By the winding number rule, a point is decided * to be inside the polygon if a ray drawn from that * point in any direction passes through a different * number of clockwise and counter-clockwise path * segments. * * These data structures are adapted somewhat from * the algorithm in (Foley/Van Dam) for scan converting * polygons. * The basic algorithm is to start at the top (smallest y) * of the polygon, stepping down to the bottom of * the polygon by incrementing the y coordinate. We * keep a list of edges which the current scanline crosses, * sorted by x. This list is called the Active Edge Table (AET) * As we change the y-coordinate, we update each entry in * in the active edge table to reflect the edges new xcoord. * This list must be sorted at each scanline in case * two edges intersect. * We also keep a data structure known as the Edge Table (ET), * which keeps track of all the edges which the current * scanline has not yet reached. The ET is basically a * list of ScanLineList structures containing a list of * edges which are entered at a given scanline. There is one * ScanLineList per scanline at which an edge is entered. * When we enter a new edge, we move it from the ET to the AET. * * From the AET, we can implement the even-odd rule as in * (Foley/Van Dam). * The winding number rule is a little trickier. We also * keep the EdgeTableEntries in the AET linked by the * nextWETE (winding EdgeTableEntry) link. This allows * the edges to be linked just as before for updating * purposes, but only uses the edges linked by the nextWETE * link as edges representing spans of the polygon to * drawn (as with the even-odd rule). */ /* * for the winding number rule */ #define CLOCKWISE 1 #define COUNTERCLOCKWISE -1 typedef struct _EdgeTableEntry { int ymax; /* ycoord at which we exit this edge. */ BRESINFO bres; /* Bresenham info to run the edge */ struct _EdgeTableEntry *next; /* next in the list */ struct _EdgeTableEntry *back; /* for insertion sort */ struct _EdgeTableEntry *nextWETE; /* for winding num rule */ int ClockWise; /* flag for winding number rule */ } EdgeTableEntry; typedef struct _ScanLineList { int scanline; /* the scanline represented */ EdgeTableEntry *edgelist; /* header node */ struct _ScanLineList *next; /* next in the list */ } ScanLineList; typedef struct { int ymax; /* ymax for the polygon */ int ymin; /* ymin for the polygon */ ScanLineList scanlines; /* header node */ } EdgeTable; /* * Here is a struct to help with storage allocation * so we can allocate a big chunk at a time, and then take * pieces from this heap when we need to. */ #define SLLSPERBLOCK 25 typedef struct _ScanLineListBlock { ScanLineList SLLs[SLLSPERBLOCK]; struct _ScanLineListBlock *next; } ScanLineListBlock; /* * number of points to buffer before sending them off * to scanlines() : Must be an even number */ #define NUMPTSTOBUFFER 200 /* * * a few macros for the inner loops of the fill code where * performance considerations don't allow a procedure call. * * Evaluate the given edge at the given scanline. * If the edge has expired, then we leave it and fix up * the active edge table; otherwise, we increment the * x value to be ready for the next scanline. * The winding number rule is in effect, so we must notify * the caller when the edge has been removed so he * can reorder the Winding Active Edge Table. */ #define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \ if (pAET->ymax == y) { /* leaving this edge */ \ pPrevAET->next = pAET->next; \ pAET = pPrevAET->next; \ fixWAET = 1; \ if (pAET) \ pAET->back = pPrevAET; \ } \ else { \ BRESINCRPGONSTRUCT(pAET->bres); \ pPrevAET = pAET; \ pAET = pAET->next; \ } \ } /* * Evaluate the given edge at the given scanline. * If the edge has expired, then we leave it and fix up * the active edge table; otherwise, we increment the * x value to be ready for the next scanline. * The even-odd rule is in effect. */ #define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \ if (pAET->ymax == y) { /* leaving this edge */ \ pPrevAET->next = pAET->next; \ pAET = pPrevAET->next; \ if (pAET) \ pAET->back = pPrevAET; \ } \ else { \ BRESINCRPGONSTRUCT(pAET->bres); \ pPrevAET = pAET; \ pAET = pAET->next; \ } \ } xorg-server-1.17.1/mi/miscanfill.h0000664000175100017510000001150012274325511013707 00000000000000/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef SCANFILLINCLUDED #define SCANFILLINCLUDED /* * scanfill.h * * Written by Brian Kelleher; Jan 1985 * * This file contains a few macros to help track * the edge of a filled object. The object is assumed * to be filled in scanline order, and thus the * algorithm used is an extension of Bresenham's line * drawing algorithm which assumes that y is always the * major axis. * Since these pieces of code are the same for any filled shape, * it is more convenient to gather the library in one * place, but since these pieces of code are also in * the inner loops of output primitives, procedure call * overhead is out of the question. * See the author for a derivation if needed. */ /* * In scan converting polygons, we want to choose those pixels * which are inside the polygon. Thus, we add .5 to the starting * x coordinate for both left and right edges. Now we choose the * first pixel which is inside the pgon for the left edge and the * first pixel which is outside the pgon for the right edge. * Draw the left pixel, but not the right. * * How to add .5 to the starting x coordinate: * If the edge is moving to the right, then subtract dy from the * error term from the general form of the algorithm. * If the edge is moving to the left, then add dy to the error term. * * The reason for the difference between edges moving to the left * and edges moving to the right is simple: If an edge is moving * to the right, then we want the algorithm to flip immediately. * If it is moving to the left, then we don't want it to flip until * we traverse an entire pixel. */ #define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \ int dx; /* local storage */ \ \ /* \ * if the edge is horizontal, then it is ignored \ * and assumed not to be processed. Otherwise, do this stuff. \ */ \ if ((dy) != 0) { \ xStart = (x1); \ dx = (x2) - xStart; \ if (dx < 0) { \ m = dx / (dy); \ m1 = m - 1; \ incr1 = -2 * dx + 2 * (dy) * m1; \ incr2 = -2 * dx + 2 * (dy) * m; \ d = 2 * m * (dy) - 2 * dx - 2 * (dy); \ } else { \ m = dx / (dy); \ m1 = m + 1; \ incr1 = 2 * dx - 2 * (dy) * m1; \ incr2 = 2 * dx - 2 * (dy) * m; \ d = -2 * m * (dy) + 2 * dx; \ } \ } \ } #define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \ if (m1 > 0) { \ if (d > 0) { \ minval += m1; \ d += incr1; \ } \ else { \ minval += m; \ d += incr2; \ } \ } else {\ if (d >= 0) { \ minval += m1; \ d += incr1; \ } \ else { \ minval += m; \ d += incr2; \ } \ } \ } /* * This structure contains all of the information needed * to run the bresenham algorithm. * The variables may be hardcoded into the declarations * instead of using this structure to make use of * register declarations. */ typedef struct { int minor; /* minor axis */ int d; /* decision variable */ int m, m1; /* slope and slope+1 */ int incr1, incr2; /* error increments */ } BRESINFO; #define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \ BRESINITPGON(dmaj, min1, min2, bres.minor, bres.d, \ bres.m, bres.m1, bres.incr1, bres.incr2) #define BRESINCRPGONSTRUCT(bres) \ BRESINCRPGON(bres.d, bres.minor, bres.m, bres.m1, bres.incr1, bres.incr2) #endif xorg-server-1.17.1/mi/miline.h0000664000175100017510000001320312274325511013045 00000000000000 /* Copyright 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef MILINE_H #include "screenint.h" #include "privates.h" /* * Public definitions used for configuring basic pixelization aspects * of the sample implementation line-drawing routines provided in * {mfb,mi,cfb*} at run-time. */ #define XDECREASING 4 #define YDECREASING 2 #define YMAJOR 1 #define OCTANT1 (1 << (YDECREASING)) #define OCTANT2 (1 << (YDECREASING|YMAJOR)) #define OCTANT3 (1 << (XDECREASING|YDECREASING|YMAJOR)) #define OCTANT4 (1 << (XDECREASING|YDECREASING)) #define OCTANT5 (1 << (XDECREASING)) #define OCTANT6 (1 << (XDECREASING|YMAJOR)) #define OCTANT7 (1 << (YMAJOR)) #define OCTANT8 (1 << (0)) #define XMAJOROCTANTS (OCTANT1 | OCTANT4 | OCTANT5 | OCTANT8) #define DEFAULTZEROLINEBIAS (OCTANT2 | OCTANT3 | OCTANT4 | OCTANT5) /* * Devices can configure the rendering of routines in mi, mfb, and cfb* * by specifying a thin line bias to be applied to a particular screen * using the following function. The bias parameter is an OR'ing of * the appropriate OCTANT constants defined above to indicate which * octants to bias a line to prefer an axial step when the Bresenham * error term is exactly zero. The octants are mapped as follows: * * \ | / * \ 3 | 2 / * \ | / * 4 \ | / 1 * \|/ * ----------- * /|\ * 5 / | \ 8 * / | \ * / 6 | 7 \ * / | \ * * For more information, see "Ambiguities in Incremental Line Rastering," * Jack E. Bresenham, IEEE CG&A, May 1987. */ extern _X_EXPORT void miSetZeroLineBias(ScreenPtr /* pScreen */ , unsigned int /* bias */ ); /* * Private definitions needed for drawing thin (zero width) lines * Used by the mi, mfb, and all cfb* components. */ #define X_AXIS 0 #define Y_AXIS 1 #define OUT_LEFT 0x08 #define OUT_RIGHT 0x04 #define OUT_ABOVE 0x02 #define OUT_BELOW 0x01 #define OUTCODES(_result, _x, _y, _pbox) \ if ( (_x) < (_pbox)->x1) (_result) |= OUT_LEFT; \ else if ( (_x) >= (_pbox)->x2) (_result) |= OUT_RIGHT; \ if ( (_y) < (_pbox)->y1) (_result) |= OUT_ABOVE; \ else if ( (_y) >= (_pbox)->y2) (_result) |= OUT_BELOW; #define MIOUTCODES(outcode, x, y, xmin, ymin, xmax, ymax) \ {\ if (x < xmin) outcode |= OUT_LEFT;\ if (x > xmax) outcode |= OUT_RIGHT;\ if (y < ymin) outcode |= OUT_ABOVE;\ if (y > ymax) outcode |= OUT_BELOW;\ } #define SWAPINT(i, j) \ { int _t = i; i = j; j = _t; } #define SWAPPT(i, j) \ { DDXPointRec _t; _t = i; i = j; j = _t; } #define SWAPINT_PAIR(x1, y1, x2, y2)\ { int t = x1; x1 = x2; x2 = t;\ t = y1; y1 = y2; y2 = t;\ } #define miGetZeroLineBias(_pScreen) ((unsigned long) (unsigned long*)\ dixLookupPrivate(&(_pScreen)->devPrivates, miZeroLineScreenKey)) #define CalcLineDeltas(_x1,_y1,_x2,_y2,_adx,_ady,_sx,_sy,_SX,_SY,_octant) \ (_octant) = 0; \ (_sx) = (_SX); \ if (((_adx) = (_x2) - (_x1)) < 0) { \ (_adx) = -(_adx); \ (_sx = -(_sx)); \ (_octant) |= XDECREASING; \ } \ (_sy) = (_SY); \ if (((_ady) = (_y2) - (_y1)) < 0) { \ (_ady) = -(_ady); \ (_sy = -(_sy)); \ (_octant) |= YDECREASING; \ } #define SetYMajorOctant(_octant) ((_octant) |= YMAJOR) #define FIXUP_ERROR(_e, _octant, _bias) \ (_e) -= (((_bias) >> (_octant)) & 1) #define IsXMajorOctant(_octant) (!((_octant) & YMAJOR)) #define IsYMajorOctant(_octant) ((_octant) & YMAJOR) #define IsXDecreasingOctant(_octant) ((_octant) & XDECREASING) #define IsYDecreasingOctant(_octant) ((_octant) & YDECREASING) extern _X_EXPORT DevPrivateKeyRec miZeroLineScreenKeyRec; #define miZeroLineScreenKey (&miZeroLineScreenKeyRec) extern _X_EXPORT int miZeroClipLine(int /*xmin */ , int /*ymin */ , int /*xmax */ , int /*ymax */ , int * /*new_x1 */ , int * /*new_y1 */ , int * /*new_x2 */ , int * /*new_y2 */ , unsigned int /*adx */ , unsigned int /*ady */ , int * /*pt1_clipped */ , int * /*pt2_clipped */ , int /*octant */ , unsigned int /*bias */ , int /*oc1 */ , int /*oc2 */ ); #endif /* MILINE_H */ xorg-server-1.17.1/mi/midispcur.c0000664000175100017510000003730212456571574013606 00000000000000/* * midispcur.c * * machine independent cursor display routines */ /* Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "misc.h" #include "input.h" #include "cursorstr.h" #include "windowstr.h" #include "regionstr.h" #include "dixstruct.h" #include "scrnintstr.h" #include "servermd.h" #include "mipointer.h" #include "misprite.h" #include "gcstruct.h" #ifdef ARGB_CURSOR #include "picturestr.h" #endif #include "inputstr.h" /* per-screen private data */ static DevPrivateKeyRec miDCScreenKeyRec; #define miDCScreenKey (&miDCScreenKeyRec) static DevScreenPrivateKeyRec miDCDeviceKeyRec; #define miDCDeviceKey (&miDCDeviceKeyRec) static Bool miDCCloseScreen(ScreenPtr pScreen); /* per device private data */ typedef struct { GCPtr pSourceGC, pMaskGC; GCPtr pSaveGC, pRestoreGC; PixmapPtr pSave; #ifdef ARGB_CURSOR PicturePtr pRootPicture; #endif } miDCBufferRec, *miDCBufferPtr; #define miGetDCDevice(dev, screen) \ ((DevHasCursor(dev)) ? \ (miDCBufferPtr)dixLookupScreenPrivate(&dev->devPrivates, miDCDeviceKey, screen) : \ (miDCBufferPtr)dixLookupScreenPrivate(&GetMaster(dev, MASTER_POINTER)->devPrivates, miDCDeviceKey, screen)) /* * The core pointer buffer will point to the index of the virtual pointer * in the pCursorBuffers array. */ typedef struct { CloseScreenProcPtr CloseScreen; PixmapPtr sourceBits; /* source bits */ PixmapPtr maskBits; /* mask bits */ #ifdef ARGB_CURSOR PicturePtr pPicture; #endif CursorPtr pCursor; } miDCScreenRec, *miDCScreenPtr; #define miGetDCScreen(s) ((miDCScreenPtr)(dixLookupPrivate(&(s)->devPrivates, miDCScreenKey))) Bool miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) { miDCScreenPtr pScreenPriv; if (!dixRegisterPrivateKey(&miDCScreenKeyRec, PRIVATE_SCREEN, 0) || !dixRegisterScreenPrivateKey(&miDCDeviceKeyRec, pScreen, PRIVATE_DEVICE, 0)) return FALSE; pScreenPriv = calloc(1, sizeof(miDCScreenRec)); if (!pScreenPriv) return FALSE; pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = miDCCloseScreen; dixSetPrivate(&pScreen->devPrivates, miDCScreenKey, pScreenPriv); if (!miSpriteInitialize(pScreen, screenFuncs)) { free((void *) pScreenPriv); return FALSE; } 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(ScreenPtr pScreen) { miDCScreenPtr pScreenPriv; pScreenPriv = (miDCScreenPtr) dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); pScreen->CloseScreen = pScreenPriv->CloseScreen; miDCSwitchScreenCursor(pScreen, NULL, NULL, NULL, NULL); free((void *) pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) { return TRUE; } #ifdef ARGB_CURSOR #define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win)) static PicturePtr miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin) { PictFormatPtr pFormat; XID subwindow_mode = IncludeInferiors; PicturePtr pPicture; int error; pFormat = PictureWindowFormat(pWin); if (!pFormat) return 0; pPicture = CreatePicture(0, pDraw, pFormat, CPSubwindowMode, &subwindow_mode, serverClient, &error); *ppPicture = pPicture; return pPicture; } #endif static Bool miDCRealize(ScreenPtr pScreen, CursorPtr pCursor) { miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); GCPtr pGC; ChangeGCVal gcvals; PixmapPtr sourceBits, maskBits; if (pScreenPriv->pCursor == pCursor) return TRUE; #ifdef ARGB_CURSOR if (pCursor->bits->argb) { PixmapPtr pPixmap; PictFormatPtr pFormat; int error; PicturePtr pPicture; pFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); if (!pFormat) return FALSE; pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 32, CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return FALSE; pGC = GetScratchGC(32, pScreen); if (!pGC) { (*pScreen->DestroyPixmap) (pPixmap); return FALSE; } ValidateGC(&pPixmap->drawable, pGC); (*pGC->ops->PutImage) (&pPixmap->drawable, pGC, 32, 0, 0, pCursor->bits->width, pCursor->bits->height, 0, ZPixmap, (char *) pCursor->bits->argb); FreeScratchGC(pGC); pPicture = CreatePicture(0, &pPixmap->drawable, pFormat, 0, 0, serverClient, &error); (*pScreen->DestroyPixmap) (pPixmap); if (!pPicture) return FALSE; miDCSwitchScreenCursor(pScreen, pCursor, NULL, NULL, pPicture); return TRUE; } #endif 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; } /* create the two sets of bits, clipping as appropriate */ pGC = GetScratchGC(1, pScreen); if (!pGC) { (*pScreen->DestroyPixmap) (sourceBits); (*pScreen->DestroyPixmap) (maskBits); return FALSE; } 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) 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) 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) 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); miDCSwitchScreenCursor(pScreen, pCursor, sourceBits, maskBits, NULL); return TRUE; } Bool miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) { miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); if (pCursor == pScreenPriv->pCursor) miDCSwitchScreenCursor(pScreen, NULL, NULL, NULL, NULL); return TRUE; } static void miDCPutBits(DrawablePtr pDrawable, 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; if (sourceGC->fgPixel != source) { gcval.val = source; ChangeGC(NullClient, sourceGC, GCForeground, &gcval); } if (sourceGC->serialNumber != pDrawable->serialNumber) ValidateGC(pDrawable, sourceGC); if (sourceGC->miTranslate) { x = pDrawable->x + x_org; y = pDrawable->y + y_org; } else { x = x_org; y = y_org; } (*sourceGC->ops->PushPixels) (sourceGC, pScreenPriv->sourceBits, pDrawable, w, h, x, y); if (maskGC->fgPixel != mask) { gcval.val = mask; ChangeGC(NullClient, maskGC, GCForeground, &gcval); } if (maskGC->serialNumber != pDrawable->serialNumber) ValidateGC(pDrawable, maskGC); if (maskGC->miTranslate) { x = pDrawable->x + x_org; y = pDrawable->y + y_org; } else { x = x_org; y = y_org; } (*maskGC->ops->PushPixels) (maskGC, pScreenPriv->maskBits, pDrawable, w, h, x, y); } static GCPtr miDCMakeGC(WindowPtr pWin) { GCPtr pGC; int status; XID gcvals[2]; gcvals[0] = IncludeInferiors; gcvals[1] = FALSE; pGC = CreateGC((DrawablePtr) pWin, GCSubwindowMode | GCGraphicsExposures, gcvals, &status, (XID) 0, serverClient); return pGC; } Bool miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y, unsigned long source, unsigned long mask) { miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); miDCBufferPtr pBuffer; WindowPtr pWin; if (!miDCRealize(pScreen, pCursor)) return FALSE; pWin = pScreen->root; pBuffer = miGetDCDevice(pDev, pScreen); #ifdef ARGB_CURSOR if (pScreenPriv->pPicture) { if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin)) return FALSE; CompositePicture(PictOpOver, pScreenPriv->pPicture, NULL, pBuffer->pRootPicture, 0, 0, 0, 0, x, y, pCursor->bits->width, pCursor->bits->height); } else #endif { miDCPutBits((DrawablePtr) pWin, pBuffer->pSourceGC, pBuffer->pMaskGC, x, y, pCursor->bits->width, pCursor->bits->height, source, mask); } return TRUE; } Bool miDCSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, int w, int h) { miDCBufferPtr pBuffer; PixmapPtr pSave; WindowPtr pWin; GCPtr pGC; pBuffer = miGetDCDevice(pDev, pScreen); pSave = pBuffer->pSave; pWin = pScreen->root; if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h) { if (pSave) (*pScreen->DestroyPixmap) (pSave); pBuffer->pSave = pSave = (*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth, 0); if (!pSave) return FALSE; } pGC = pBuffer->pSaveGC; if (pSave->drawable.serialNumber != pGC->serialNumber) ValidateGC((DrawablePtr) pSave, pGC); (*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC, x, y, w, h, 0, 0); return TRUE; } Bool miDCRestoreUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, int w, int h) { miDCBufferPtr pBuffer; PixmapPtr pSave; WindowPtr pWin; GCPtr pGC; pBuffer = miGetDCDevice(pDev, pScreen); pSave = pBuffer->pSave; pWin = pScreen->root; if (!pSave) return FALSE; pGC = pBuffer->pRestoreGC; if (pWin->drawable.serialNumber != pGC->serialNumber) ValidateGC((DrawablePtr) pWin, pGC); (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC, 0, 0, w, h, x, y); return TRUE; } Bool miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) { miDCBufferPtr pBuffer; WindowPtr pWin; int i; if (!DevHasCursor(pDev)) return TRUE; for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; pBuffer = calloc(1, sizeof(miDCBufferRec)); if (!pBuffer) goto failure; dixSetScreenPrivate(&pDev->devPrivates, miDCDeviceKey, pScreen, pBuffer); pWin = pScreen->root; pBuffer->pSourceGC = miDCMakeGC(pWin); if (!pBuffer->pSourceGC) goto failure; pBuffer->pMaskGC = miDCMakeGC(pWin); if (!pBuffer->pMaskGC) goto failure; pBuffer->pSaveGC = miDCMakeGC(pWin); if (!pBuffer->pSaveGC) goto failure; pBuffer->pRestoreGC = miDCMakeGC(pWin); if (!pBuffer->pRestoreGC) goto failure; #ifdef ARGB_CURSOR pBuffer->pRootPicture = NULL; #endif /* (re)allocated lazily depending on the cursor size */ pBuffer->pSave = NULL; } return TRUE; failure: miDCDeviceCleanup(pDev, pScreen); return FALSE; } void miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { miDCBufferPtr pBuffer; int i; if (DevHasCursor(pDev)) { for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; pBuffer = miGetDCDevice(pDev, pScreen); if (pBuffer) { if (pBuffer->pSourceGC) FreeGC(pBuffer->pSourceGC, (GContext) 0); if (pBuffer->pMaskGC) FreeGC(pBuffer->pMaskGC, (GContext) 0); if (pBuffer->pSaveGC) FreeGC(pBuffer->pSaveGC, (GContext) 0); if (pBuffer->pRestoreGC) FreeGC(pBuffer->pRestoreGC, (GContext) 0); #ifdef ARGB_CURSOR /* If a pRootPicture was allocated for a root window, it * is freed when that root window is destroyed, so don't * free it again here. */ #endif if (pBuffer->pSave) (*pScreen->DestroyPixmap) (pBuffer->pSave); free(pBuffer); dixSetScreenPrivate(&pDev->devPrivates, miDCDeviceKey, pScreen, NULL); } } } } xorg-server-1.17.1/mi/miscrinit.c0000664000175100017510000002404512456571574013610 00000000000000/* Copyright 1990, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "servermd.h" #include "misc.h" #include "mi.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "dix.h" #include "miline.h" #ifdef MITSHM #include #include "shmint.h" #endif /* We use this structure to propogate some information from miScreenInit to * miCreateScreenResources. miScreenInit allocates the structure, fills it * in, and puts it into pScreen->devPrivate. miCreateScreenResources * extracts the info and frees the structure. We could've accomplished the * same thing by adding fields to the screen structure, but they would have * ended up being redundant, and would have exposed this mi implementation * detail to the whole server. */ typedef struct { void *pbits; /* pointer to framebuffer */ int width; /* delta to add to a framebuffer addr to move one row down */ } miScreenInitParmsRec, *miScreenInitParmsPtr; /* this plugs into pScreen->ModifyPixmapHeader */ Bool miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData) { if (!pPixmap) return FALSE; /* * If all arguments are specified, reinitialize everything (including * validated state). */ if ((width > 0) && (height > 0) && (depth > 0) && (bitsPerPixel > 0) && (devKind > 0) && pPixData) { pPixmap->drawable.depth = depth; pPixmap->drawable.bitsPerPixel = bitsPerPixel; pPixmap->drawable.id = 0; pPixmap->drawable.x = 0; pPixmap->drawable.y = 0; pPixmap->drawable.width = width; pPixmap->drawable.height = height; pPixmap->devKind = devKind; pPixmap->refcnt = 1; pPixmap->devPrivate.ptr = pPixData; } else { /* * Only modify specified fields, keeping all others intact. */ if (width > 0) pPixmap->drawable.width = width; if (height > 0) pPixmap->drawable.height = height; if (depth > 0) pPixmap->drawable.depth = depth; if (bitsPerPixel > 0) pPixmap->drawable.bitsPerPixel = bitsPerPixel; else if ((bitsPerPixel < 0) && (depth > 0)) pPixmap->drawable.bitsPerPixel = BitsPerPixel(depth); /* * CAVEAT: Non-SI DDXen may use devKind and devPrivate fields for * other purposes. */ if (devKind > 0) pPixmap->devKind = devKind; else if ((devKind < 0) && ((width > 0) || (depth > 0))) pPixmap->devKind = PixmapBytePad(pPixmap->drawable.width, pPixmap->drawable.depth); if (pPixData) pPixmap->devPrivate.ptr = pPixData; } pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; return TRUE; } static Bool miCloseScreen(ScreenPtr pScreen) { return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate)); } /* With the introduction of pixmap privates, the "screen pixmap" can no * longer be created in miScreenInit, since all the modules that could * possibly ask for pixmap private space have not been initialized at * that time. pScreen->CreateScreenResources is called after all * possible private-requesting modules have been inited; we create the * screen pixmap here. */ Bool miCreateScreenResources(ScreenPtr pScreen) { miScreenInitParmsPtr pScrInitParms; void *value; pScrInitParms = (miScreenInitParmsPtr) pScreen->devPrivate; /* if width is non-zero, pScreen->devPrivate will be a pixmap * else it will just take the value pbits */ if (pScrInitParms->width) { PixmapPtr pPixmap; /* create a pixmap with no data, then redirect it to point to * the screen */ pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, pScreen->rootDepth, 0); if (!pPixmap) return FALSE; if (!(*pScreen->ModifyPixmapHeader) (pPixmap, pScreen->width, pScreen->height, pScreen->rootDepth, BitsPerPixel(pScreen->rootDepth), PixmapBytePad(pScrInitParms->width, pScreen->rootDepth), pScrInitParms->pbits)) return FALSE; value = (void *) pPixmap; } else { value = pScrInitParms->pbits; } free(pScreen->devPrivate); /* freeing miScreenInitParmsRec */ pScreen->devPrivate = value; /* pPixmap or pbits */ return TRUE; } Bool miScreenDevPrivateInit(ScreenPtr pScreen, int width, void *pbits) { miScreenInitParmsPtr pScrInitParms; /* Stash pbits and width in a short-lived miScreenInitParmsRec attached * to the screen, until CreateScreenResources can put them in the * screen pixmap. */ pScrInitParms = malloc(sizeof(miScreenInitParmsRec)); if (!pScrInitParms) return FALSE; pScrInitParms->pbits = pbits; pScrInitParms->width = width; pScreen->devPrivate = (void *) pScrInitParms; return TRUE; } static PixmapPtr miGetScreenPixmap(ScreenPtr pScreen) { return (PixmapPtr) (pScreen->devPrivate); } static void miSetScreenPixmap(PixmapPtr pPix) { if (pPix) pPix->drawable.pScreen->devPrivate = (void *) pPix; } Bool miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */ int xsize, int ysize, /* in pixels */ int dpix, int dpiy, /* dots per inch */ int width, /* pixel width of frame buffer */ int rootDepth, /* depth of root window */ int numDepths, /* number of depths supported */ DepthRec * depths, /* supported depths */ VisualID rootVisual, /* root visual */ int numVisuals, /* number of visuals supported */ VisualRec * visuals /* supported visuals */ ) { pScreen->width = xsize; pScreen->height = ysize; pScreen->mmWidth = (xsize * 254 + dpix * 5) / (dpix * 10); pScreen->mmHeight = (ysize * 254 + dpiy * 5) / (dpiy * 10); pScreen->numDepths = numDepths; pScreen->rootDepth = rootDepth; pScreen->allowedDepths = depths; pScreen->rootVisual = rootVisual; /* defColormap */ pScreen->minInstalledCmaps = 1; pScreen->maxInstalledCmaps = 1; pScreen->backingStoreSupport = NotUseful; pScreen->saveUnderSupport = NotUseful; /* whitePixel, blackPixel */ pScreen->ModifyPixmapHeader = miModifyPixmapHeader; pScreen->CreateScreenResources = miCreateScreenResources; pScreen->GetScreenPixmap = miGetScreenPixmap; pScreen->SetScreenPixmap = miSetScreenPixmap; pScreen->numVisuals = numVisuals; pScreen->visuals = visuals; if (width) { #ifdef MITSHM ShmRegisterFbFuncs(pScreen); #endif pScreen->CloseScreen = miCloseScreen; } /* else CloseScreen */ /* QueryBestSize, SaveScreen, GetImage, GetSpans */ pScreen->SourceValidate = (SourceValidateProcPtr) 0; /* CreateWindow, DestroyWindow, PositionWindow, ChangeWindowAttributes */ /* RealizeWindow, UnrealizeWindow */ pScreen->ValidateTree = miValidateTree; pScreen->PostValidateTree = (PostValidateTreeProcPtr) 0; pScreen->WindowExposures = miWindowExposures; /* CopyWindow */ pScreen->ClearToBackground = miClearToBackground; pScreen->ClipNotify = (ClipNotifyProcPtr) 0; pScreen->RestackWindow = (RestackWindowProcPtr) 0; /* CreatePixmap, DestroyPixmap */ /* RealizeFont, UnrealizeFont */ /* CreateGC */ /* CreateColormap, DestroyColormap, InstallColormap, UninstallColormap */ /* ListInstalledColormaps, StoreColors, ResolveColor */ /* BitmapToRegion */ pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA; pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA; pScreen->MarkWindow = miMarkWindow; pScreen->MarkOverlappedWindows = miMarkOverlappedWindows; pScreen->MoveWindow = miMoveWindow; pScreen->ResizeWindow = miResizeWindow; pScreen->GetLayerWindow = miGetLayerWindow; pScreen->HandleExposures = miHandleValidateExposures; pScreen->ReparentWindow = (ReparentWindowProcPtr) 0; pScreen->ChangeBorderWidth = miChangeBorderWidth; pScreen->SetShape = miSetShape; pScreen->MarkUnrealizedWindow = miMarkUnrealizedWindow; pScreen->XYToWindow = miXYToWindow; miSetZeroLineBias(pScreen, DEFAULTZEROLINEBIAS); return miScreenDevPrivateInit(pScreen, width, pbits); } DevPrivateKeyRec miZeroLineScreenKeyRec; void miSetZeroLineBias(ScreenPtr pScreen, unsigned int bias) { if (!dixRegisterPrivateKey(&miZeroLineScreenKeyRec, PRIVATE_SCREEN, 0)) return; dixSetPrivate(&pScreen->devPrivates, miZeroLineScreenKey, (unsigned long *) (unsigned long) bias); } xorg-server-1.17.1/mi/mifpoly.h0000664000175100017510000000473412456571574013276 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef __MIFPOLY_H__ #define __MIFPOLY_H__ #include static _X_INLINE int ICEIL(double x) { int _cTmp = x; return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp + 1; } #endif /* __MIFPOLY_H__ */ xorg-server-1.17.1/mi/micopy.c0000664000175100017510000002336412432306326013073 00000000000000/* * Copyright © 1998 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 "mi.h" #include "scrnintstr.h" #include "gcstruct.h" #include "pixmap.h" #include "pixmapstr.h" #include "windowstr.h" void miCopyRegion(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, RegionPtr pDstRegion, int dx, int dy, miCopyProc copyProc, Pixel bitPlane, void *closure) { int careful; Bool reverse; Bool upsidedown; BoxPtr pbox; int nbox; BoxPtr pboxNew1, pboxNew2, pboxBase, pboxNext, pboxTmp; pbox = RegionRects(pDstRegion); nbox = RegionNumRects(pDstRegion); /* 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 = ((pSrcDrawable == pDstDrawable) || ((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type == DRAWABLE_WINDOW))); pboxNew1 = NULL; pboxNew2 = NULL; if (careful && dy < 0) { upsidedown = TRUE; if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ pboxNew1 = (BoxPtr) malloc(sizeof(BoxRec) * nbox); if (!pboxNew1) return; pboxBase = pboxNext = pbox + nbox - 1; while (pboxBase >= pbox) { while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1)) pboxNext--; pboxTmp = pboxNext + 1; while (pboxTmp <= pboxBase) { *pboxNew1++ = *pboxTmp++; } pboxBase = pboxNext; } pboxNew1 -= nbox; pbox = pboxNew1; } } else { /* walk source top to bottom */ upsidedown = FALSE; } if (careful && dx < 0) { /* walk source right to left */ if (dy <= 0) reverse = TRUE; else reverse = FALSE; if (nbox > 1) { /* reverse order of rects in each band */ pboxNew2 = (BoxPtr) malloc(sizeof(BoxRec) * nbox); if (!pboxNew2) { free(pboxNew1); return; } pboxBase = pboxNext = pbox; while (pboxBase < pbox + nbox) { while ((pboxNext < pbox + nbox) && (pboxNext->y1 == pboxBase->y1)) pboxNext++; pboxTmp = pboxNext; while (pboxTmp != pboxBase) { *pboxNew2++ = *--pboxTmp; } pboxBase = pboxNext; } pboxNew2 -= nbox; pbox = pboxNew2; } } else { /* walk source left to right */ reverse = FALSE; } (*copyProc) (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, upsidedown, bitPlane, closure); free(pboxNew1); free(pboxNew2); } RegionPtr miDoCopy(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut, miCopyProc copyProc, Pixel bitPlane, void *closure) { RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ Bool freeSrcClip = FALSE; RegionPtr prgnExposed = NULL; RegionRec rgnDst; int dx; int dy; int numRects; int box_x1; int box_y1; int box_x2; int box_y2; Bool fastSrc = FALSE; /* for fast clipping with pixmap source */ Bool fastDst = FALSE; /* for fast clipping with one rect dest */ Bool fastExpose = FALSE; /* for fast exposures with pixmap source */ /* Short cut for unmapped windows */ if (pDstDrawable->type == DRAWABLE_WINDOW && !((WindowPtr) pDstDrawable)->realized) { return NULL; } if (pSrcDrawable->pScreen->SourceValidate) { (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc, pGC->subWindowMode); } /* Compute source clip region */ if (pSrcDrawable->type == DRAWABLE_PIXMAP) { if ((pSrcDrawable == pDstDrawable) && (!pGC->clientClip)) prgnSrcClip = miGetCompositeClip(pGC); else fastSrc = TRUE; } else { if (pGC->subWindowMode == IncludeInferiors) { /* * XFree86 DDX empties the border clip when the * VT is inactive, make sure the region isn't empty */ if (!((WindowPtr) pSrcDrawable)->parent && RegionNotEmpty(&((WindowPtr) pSrcDrawable)->borderClip)) { /* * special case bitblt from root window in * IncludeInferiors mode; just like from a pixmap */ fastSrc = TRUE; } else if ((pSrcDrawable == pDstDrawable) && (!pGC->clientClip)) { prgnSrcClip = miGetCompositeClip(pGC); } else { prgnSrcClip = NotClippedByChildren((WindowPtr) pSrcDrawable); freeSrcClip = TRUE; } } else { prgnSrcClip = &((WindowPtr) pSrcDrawable)->clipList; } } xIn += pSrcDrawable->x; yIn += pSrcDrawable->y; xOut += pDstDrawable->x; yOut += pDstDrawable->y; box_x1 = xIn; box_y1 = yIn; box_x2 = xIn + widthSrc; box_y2 = yIn + heightSrc; dx = xIn - xOut; dy = yIn - yOut; /* Don't create a source region if we are doing a fast clip */ if (fastSrc) { RegionPtr cclip; fastExpose = TRUE; /* * clip the source; if regions extend beyond the source size, * make sure exposure events get sent */ if (box_x1 < pSrcDrawable->x) { box_x1 = pSrcDrawable->x; fastExpose = FALSE; } if (box_y1 < pSrcDrawable->y) { box_y1 = pSrcDrawable->y; fastExpose = FALSE; } if (box_x2 > pSrcDrawable->x + (int) pSrcDrawable->width) { box_x2 = pSrcDrawable->x + (int) pSrcDrawable->width; fastExpose = FALSE; } if (box_y2 > pSrcDrawable->y + (int) pSrcDrawable->height) { box_y2 = pSrcDrawable->y + (int) pSrcDrawable->height; fastExpose = FALSE; } /* Translate and clip the dst to the destination composite clip */ box_x1 -= dx; box_x2 -= dx; box_y1 -= dy; box_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 = miGetCompositeClip(pGC); if (RegionNumRects(cclip) == 1) { BoxPtr pBox = RegionRects(cclip); if (box_x1 < pBox->x1) box_x1 = pBox->x1; if (box_x2 > pBox->x2) box_x2 = pBox->x2; if (box_y1 < pBox->y1) box_y1 = pBox->y1; if (box_y2 > pBox->y2) box_y2 = pBox->y2; fastDst = TRUE; } } /* Check to see if the region is empty */ if (box_x1 >= box_x2 || box_y1 >= box_y2) { RegionNull(&rgnDst); } else { BoxRec box; box.x1 = box_x1; box.y1 = box_y1; box.x2 = box_x2; box.y2 = box_y2; RegionInit(&rgnDst, &box, 1); } /* Clip against complex source if needed */ if (!fastSrc) { RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); RegionTranslate(&rgnDst, -dx, -dy); } /* Clip against complex dest if needed */ if (!fastDst) { RegionIntersect(&rgnDst, &rgnDst, miGetCompositeClip(pGC)); } /* Do bit blitting */ numRects = RegionNumRects(&rgnDst); if (numRects && widthSrc && heightSrc) miCopyRegion(pSrcDrawable, pDstDrawable, pGC, &rgnDst, dx, dy, copyProc, bitPlane, closure); /* Pixmap sources generate a NoExposed (we return NULL to do this) */ if (!fastExpose && pGC->fExpose) prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn - pSrcDrawable->x, yIn - pSrcDrawable->y, widthSrc, heightSrc, xOut - pDstDrawable->x, yOut - pDstDrawable->y); RegionUninit(&rgnDst); if (freeSrcClip) RegionDestroy(prgnSrcClip); return prgnExposed; } xorg-server-1.17.1/mi/miglblt.c0000664000175100017510000002027712456571574013244 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "misc.h" #include #include "dixfontstr.h" #include "gcstruct.h" #include "windowstr.h" #include "scrnintstr.h" #include "pixmap.h" #include "servermd.h" #include "mi.h" /* machine-independent glyph blt. assumes that glyph bits in snf are written in bytes, have same bit order as the server's bitmap format, and are byte padded. this corresponds to the snf distributed with the sample server. get a scratch GC. in the scratch GC set alu = GXcopy, fg = 1, bg = 0 allocate a bitmap big enough to hold the largest glyph in the font validate the scratch gc with the bitmap for each glyph carefully put the bits of the glyph in a buffer, padded to the server pixmap scanline padding rules fake a call to PutImage from the buffer into the bitmap use the bitmap in a call to PushPixels */ void miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */ void *pglyphBase /* start of array of glyphs */ ) { int width, height; PixmapPtr pPixmap; int nbyLine; /* bytes per line of padded pixmap */ FontPtr pfont; GCPtr pGCtmp; int i; int j; unsigned char *pbits; /* buffer for PutImage */ unsigned char *pb; /* temp pointer into buffer */ CharInfoPtr pci; /* currect char info */ unsigned char *pglyph; /* pointer bits in glyph */ int gWidth, gHeight; /* width and height of glyph */ int nbyGlyphWidth; /* bytes per scanline of glyph */ int nbyPadGlyph; /* server padded line of glyph */ ChangeGCVal gcvals[3]; if (pGC->miTranslate) { x += pDrawable->x; y += pDrawable->y; } pfont = pGC->font; width = FONTMAXBOUNDS(pfont, rightSideBearing) - FONTMINBOUNDS(pfont, leftSideBearing); height = FONTMAXBOUNDS(pfont, ascent) + FONTMAXBOUNDS(pfont, descent); pPixmap = (*pDrawable->pScreen->CreatePixmap) (pDrawable->pScreen, width, height, 1, CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) return; pGCtmp = GetScratchGC(1, pDrawable->pScreen); if (!pGCtmp) { (*pDrawable->pScreen->DestroyPixmap) (pPixmap); return; } gcvals[0].val = GXcopy; gcvals[1].val = 1; gcvals[2].val = 0; ChangeGC(NullClient, pGCtmp, GCFunction | GCForeground | GCBackground, gcvals); nbyLine = BitmapBytePad(width); pbits = malloc(height * nbyLine); if (!pbits) { (*pDrawable->pScreen->DestroyPixmap) (pPixmap); FreeScratchGC(pGCtmp); return; } while (nglyph--) { pci = *ppci++; pglyph = FONTGLYPHBITS(pglyphBase, pci); gWidth = GLYPHWIDTHPIXELS(pci); gHeight = GLYPHHEIGHTPIXELS(pci); if (gWidth && gHeight) { nbyGlyphWidth = GLYPHWIDTHBYTESPADDED(pci); nbyPadGlyph = BitmapBytePad(gWidth); if (nbyGlyphWidth == nbyPadGlyph #if GLYPHPADBYTES != 4 && (((int) pglyph) & 3) == 0 #endif ) { pb = pglyph; } else { for (i = 0, pb = pbits; i < gHeight; i++, pb = pbits + (i * nbyPadGlyph)) for (j = 0; j < nbyGlyphWidth; j++) *pb++ = *pglyph++; pb = pbits; } if ((pGCtmp->serialNumber) != (pPixmap->drawable.serialNumber)) ValidateGC((DrawablePtr) pPixmap, pGCtmp); (*pGCtmp->ops->PutImage) ((DrawablePtr) pPixmap, pGCtmp, pPixmap->drawable.depth, 0, 0, gWidth, gHeight, 0, XYBitmap, (char *) pb); (*pGC->ops->PushPixels) (pGC, pPixmap, pDrawable, gWidth, gHeight, x + pci->metrics.leftSideBearing, y - pci->metrics.ascent); } x += pci->metrics.characterWidth; } (*pDrawable->pScreen->DestroyPixmap) (pPixmap); free(pbits); FreeScratchGC(pGCtmp); } void miImageGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */ void *pglyphBase /* start of array of glyphs */ ) { ExtentInfoRec info; /* used by QueryGlyphExtents() */ ChangeGCVal gcvals[3]; int oldAlu, oldFS; unsigned long oldFG; xRectangle backrect; QueryGlyphExtents(pGC->font, ppci, (unsigned long) nglyph, &info); if (info.overallWidth >= 0) { backrect.x = x; backrect.width = info.overallWidth; } else { backrect.x = x + info.overallWidth; backrect.width = -info.overallWidth; } backrect.y = y - FONTASCENT(pGC->font); backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); oldAlu = pGC->alu; oldFG = pGC->fgPixel; oldFS = pGC->fillStyle; /* fill in the background */ gcvals[0].val = GXcopy; gcvals[1].val = pGC->bgPixel; gcvals[2].val = FillSolid; ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFillStyle, gcvals); ValidateGC(pDrawable, pGC); (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &backrect); /* put down the glyphs */ gcvals[0].val = oldFG; ChangeGC(NullClient, pGC, GCForeground, gcvals); ValidateGC(pDrawable, pGC); (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); /* put all the toys away when done playing */ gcvals[0].val = oldAlu; gcvals[1].val = oldFG; gcvals[2].val = oldFS; ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFillStyle, gcvals); ValidateGC(pDrawable, pGC); } xorg-server-1.17.1/install-sh0000755000175100017510000003325512460514302013020 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # 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 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xorg-server-1.17.1/config.sub0000755000175100017510000010577512460514302013006 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-09-11' # 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 # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xorg-server-1.17.1/missing0000755000175100017510000001533012460514302012405 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xorg-server-1.17.1/autogen.sh0000775000175100017510000000033612160102336013006 00000000000000#! /bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir autoreconf --force -v --install || exit 1 cd $ORIGDIR || exit $? if test -z "$NOCONFIGURE"; then exec $srcdir/configure "$@" fi xorg-server-1.17.1/include/0000775000175100017510000000000012466505443012525 500000000000000xorg-server-1.17.1/include/dix.h0000664000175100017510000004432412456571574013420 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef DIX_H #define DIX_H #include "callback.h" #include "gc.h" #include "window.h" #include "input.h" #include "cursor.h" #include "geext.h" #include "events.h" #include #define EARLIER -1 #define SAMETIME 0 #define LATER 1 #define NullClient ((ClientPtr) 0) #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) #define REQUEST_AT_LEAST_SIZE(req) \ if ((sizeof(req) >> 2) > client->req_len )\ return(BadLength) #define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \ if (((sizeof(req) + ((uint64_t) extra)) >> 2) > client->req_len ) \ return(BadLength) #define REQUEST_FIXED_SIZE(req, n)\ if (((sizeof(req) >> 2) > client->req_len) || \ (((n) >> 2) >= client->req_len) || \ ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \ return(BadLength) #define LEGAL_NEW_RESOURCE(id,client)\ if (!LegalNewID(id,client)) \ {\ client->errorValue = id;\ return BadIDChoice;\ } #define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, mode)\ {\ 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;\ }\ if (pGC->serialNumber != pDraw->serialNumber)\ ValidateGC(pDraw, pGC); #define WriteReplyToClient(pClient, size, pReply) { \ if ((pClient)->swapped) \ (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \ (pClient, (int)(size), pReply); \ else WriteToClient(pClient, (int)(size), (pReply)); } #define WriteSwappedDataToClient(pClient, size, pbuf) \ if ((pClient)->swapped) \ (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \ else WriteToClient(pClient, (int)(size), (pbuf)); typedef struct _TimeStamp *TimeStampPtr; #ifndef _XTYPEDEF_CLIENTPTR typedef struct _Client *ClientPtr; /* also in misc.h */ #define _XTYPEDEF_CLIENTPTR #endif typedef struct _WorkQueue *WorkQueuePtr; extern _X_EXPORT ClientPtr clients[MAXCLIENTS]; extern _X_EXPORT ClientPtr serverClient; extern _X_EXPORT int currentMaxClients; extern _X_EXPORT char dispatchExceptionAtReset; typedef int HWEventQueueType; typedef HWEventQueueType *HWEventQueuePtr; extern _X_EXPORT HWEventQueuePtr checkForInput[2]; typedef struct _TimeStamp { CARD32 months; /* really ~49.7 days */ CARD32 milliseconds; } TimeStamp; /* dispatch.c */ extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ , HWEventQueuePtr /*c1 */ ); extern _X_EXPORT void CloseDownClient(ClientPtr /*client */ ); extern _X_EXPORT void UpdateCurrentTime(void); extern _X_EXPORT void UpdateCurrentTimeIf(void); extern _X_EXPORT int dixDestroyPixmap(void *value, XID pid); extern _X_EXPORT void InitClient(ClientPtr client, int i, void *ospriv); extern _X_EXPORT ClientPtr NextAvailableClient(void *ospriv); extern _X_EXPORT void SendErrorToClient(ClientPtr /*client */ , unsigned int /*majorCode */ , unsigned int /*minorCode */ , XID /*resId */ , int /*errorCode */ ); extern _X_EXPORT void MarkClientException(ClientPtr /*client */ ); extern _X_HIDDEN Bool CreateConnectionBlock(void); /* dixutils.c */ extern _X_EXPORT int CompareISOLatin1Lowered(const unsigned char * /*a */ , int alen, const unsigned char * /*b */ , int blen); extern _X_EXPORT int dixLookupWindow(WindowPtr *result, XID id, ClientPtr client, Mask access_mode); extern _X_EXPORT int dixLookupDrawable(DrawablePtr *result, XID id, ClientPtr client, Mask type_mask, Mask access_mode); extern _X_EXPORT int dixLookupGC(GCPtr *result, XID id, ClientPtr client, Mask access_mode); extern _X_EXPORT int dixLookupFontable(FontPtr *result, XID id, ClientPtr client, Mask access_mode); extern _X_EXPORT int dixLookupClient(ClientPtr *result, XID id, ClientPtr client, Mask access_mode); extern _X_EXPORT void NoopDDA(void); extern _X_EXPORT int AlterSaveSetForClient(ClientPtr /*client */ , WindowPtr /*pWin */ , unsigned /*mode */ , Bool /*toRoot */ , Bool /*map */ ); extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ ); extern _X_EXPORT void BlockHandler(void *pTimeout, void *pReadmask); extern _X_EXPORT void WakeupHandler(int result, void *pReadmask); void EnableLimitedSchedulingLatency(void); void DisableLimitedSchedulingLatency(void); typedef void (*WakeupHandlerProcPtr) (void *blockData, int result, void *pReadmask); extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, void *blockData); extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, void *blockData); extern _X_EXPORT void InitBlockAndWakeupHandlers(void); extern _X_EXPORT void ProcessWorkQueue(void); extern _X_EXPORT void ProcessWorkQueueZombies(void); extern _X_EXPORT Bool QueueWorkProc(Bool (*function)(ClientPtr clientUnused, void *closure), ClientPtr client, void *closure); typedef Bool (*ClientSleepProcPtr) (ClientPtr client, void *closure); extern _X_EXPORT Bool ClientSleep(ClientPtr client, ClientSleepProcPtr function, void *closure); #ifndef ___CLIENTSIGNAL_DEFINED___ #define ___CLIENTSIGNAL_DEFINED___ extern _X_EXPORT Bool ClientSignal(ClientPtr /*client */ ); #endif /* ___CLIENTSIGNAL_DEFINED___ */ extern _X_EXPORT void ClientWakeup(ClientPtr /*client */ ); extern _X_EXPORT Bool ClientIsAsleep(ClientPtr /*client */ ); extern _X_EXPORT void SendGraphicsExpose(ClientPtr /*client */ , RegionPtr /*pRgn */ , XID /*drawable */ , int /*major */ , int /*minor */); /* atom.c */ extern _X_EXPORT Atom MakeAtom(const char * /*string */ , unsigned /*len */ , Bool /*makeit */ ); extern _X_EXPORT Bool ValidAtom(Atom /*atom */ ); extern _X_EXPORT const char *NameForAtom(Atom /*atom */ ); extern _X_EXPORT void AtomError(void) _X_NORETURN; extern _X_EXPORT void FreeAllAtoms(void); extern _X_EXPORT void InitAtoms(void); /* main.c */ extern _X_EXPORT void SetVendorRelease(int release); extern _X_EXPORT void SetVendorString(const char *string); int dix_main(int argc, char *argv[], char *envp[]); /* events.c */ extern void SetMaskForEvent(int /* deviceid */ , Mask /* mask */ , int /* event */ ); extern _X_EXPORT void ConfineToShape(DeviceIntPtr /* pDev */ , RegionPtr /* shape */ , int * /* px */ , int * /* py */ ); extern _X_EXPORT Bool IsParent(WindowPtr /* maybeparent */ , WindowPtr /* child */ ); extern _X_EXPORT WindowPtr GetCurrentRootWindow(DeviceIntPtr pDev); extern _X_EXPORT WindowPtr GetSpriteWindow(DeviceIntPtr pDev); extern _X_EXPORT void NoticeTime(const DeviceIntPtr dev, TimeStamp time); extern _X_EXPORT void NoticeEventTime(InternalEvent *ev, DeviceIntPtr dev); extern _X_EXPORT TimeStamp LastEventTime(int deviceid); extern _X_EXPORT Bool LastEventTimeWasReset(int deviceid); extern _X_EXPORT void LastEventTimeToggleResetFlag(int deviceid, Bool state); extern _X_EXPORT void LastEventTimeToggleResetAll(Bool state); extern void EnqueueEvent(InternalEvent * /* ev */ , DeviceIntPtr /* device */ ); extern void PlayReleasedEvents(void); extern void ActivatePointerGrab(DeviceIntPtr /* mouse */ , GrabPtr /* grab */ , TimeStamp /* time */ , Bool /* autoGrab */ ); extern void DeactivatePointerGrab(DeviceIntPtr /* mouse */ ); extern void ActivateKeyboardGrab(DeviceIntPtr /* keybd */ , GrabPtr /* grab */ , TimeStamp /* time */ , Bool /* passive */ ); extern void DeactivateKeyboardGrab(DeviceIntPtr /* keybd */ ); extern BOOL ActivateFocusInGrab(DeviceIntPtr /* dev */ , WindowPtr /* old */ , WindowPtr /* win */ ); extern void AllowSome(ClientPtr /* client */ , TimeStamp /* time */ , DeviceIntPtr /* thisDev */ , int /* newState */ ); extern void ReleaseActiveGrabs(ClientPtr client); extern GrabPtr CheckPassiveGrabsOnWindow(WindowPtr /* pWin */ , DeviceIntPtr /* device */ , InternalEvent * /* event */ , BOOL /* checkCore */ , BOOL /* activate */ ); extern _X_EXPORT int DeliverEventsToWindow(DeviceIntPtr /* pWin */ , WindowPtr /* pWin */ , xEventPtr /* pEvents */ , int /* count */ , Mask /* filter */ , GrabPtr /* grab */ ); extern _X_EXPORT void DeliverRawEvent(RawDeviceEvent * /* ev */ , DeviceIntPtr /* dev */ ); extern int DeliverDeviceEvents(WindowPtr /* pWin */ , InternalEvent * /* event */ , GrabPtr /* grab */ , WindowPtr /* stopAt */ , DeviceIntPtr /* dev */ ); extern int DeliverOneGrabbedEvent(InternalEvent * /* event */ , DeviceIntPtr /* dev */ , enum InputLevel /* level */ ); extern void DeliverTouchEvents(DeviceIntPtr /* dev */ , TouchPointInfoPtr /* ti */ , InternalEvent * /* ev */ , XID /* resource */ ); extern void InitializeSprite(DeviceIntPtr /* pDev */ , WindowPtr /* pWin */ ); extern void FreeSprite(DeviceIntPtr pDev); extern void UpdateSpriteForScreen(DeviceIntPtr /* pDev */ , ScreenPtr /* pScreen */ ); extern _X_EXPORT void WindowHasNewCursor(WindowPtr /* pWin */ ); extern Bool CheckDeviceGrabs(DeviceIntPtr /* device */ , DeviceEvent * /* event */ , WindowPtr /* ancestor */ ); extern void DeliverFocusedEvent(DeviceIntPtr /* keybd */ , InternalEvent * /* event */ , WindowPtr /* window */ ); extern int DeliverGrabbedEvent(InternalEvent * /* event */ , DeviceIntPtr /* thisDev */ , Bool /* deactivateGrab */ ); extern void FixKeyState(DeviceEvent * /* event */ , DeviceIntPtr /* keybd */ ); extern void RecalculateDeliverableEvents(WindowPtr /* pWin */ ); extern _X_EXPORT int OtherClientGone(void *value, XID id); extern void DoFocusEvents(DeviceIntPtr /* dev */ , WindowPtr /* fromWin */ , WindowPtr /* toWin */ , int /* mode */ ); extern int SetInputFocus(ClientPtr /* client */ , DeviceIntPtr /* dev */ , Window /* focusID */ , CARD8 /* revertTo */ , Time /* ctime */ , Bool /* followOK */ ); extern int GrabDevice(ClientPtr /* client */ , DeviceIntPtr /* dev */ , unsigned /* this_mode */ , unsigned /* other_mode */ , Window /* grabWindow */ , unsigned /* ownerEvents */ , Time /* ctime */ , GrabMask * /* mask */ , int /* grabtype */ , Cursor /* curs */ , Window /* confineToWin */ , CARD8 * /* status */ ); extern void InitEvents(void); extern void CloseDownEvents(void); extern void DeleteWindowFromAnyEvents(WindowPtr /* pWin */ , Bool /* freeResources */ ); extern Mask EventMaskForClient(WindowPtr /* pWin */ , ClientPtr /* client */ ); extern _X_EXPORT int DeliverEvents(WindowPtr /*pWin */ , xEventPtr /*xE */ , int /*count */ , WindowPtr /*otherParent */ ); extern Bool CheckMotion(DeviceEvent * /* ev */ , DeviceIntPtr /* pDev */ ); extern _X_EXPORT void WriteEventsToClient(ClientPtr /*pClient */ , int /*count */ , xEventPtr /*events */ ); extern _X_EXPORT int TryClientEvents(ClientPtr /*client */ , DeviceIntPtr /* device */ , xEventPtr /*pEvents */ , int /*count */ , Mask /*mask */ , Mask /*filter */ , GrabPtr /*grab */ ); extern _X_EXPORT void WindowsRestructured(void); extern int SetClientPointer(ClientPtr /* client */ , DeviceIntPtr /* device */ ); extern _X_EXPORT DeviceIntPtr PickPointer(ClientPtr /* client */ ); extern _X_EXPORT DeviceIntPtr PickKeyboard(ClientPtr /* client */ ); extern Bool IsInterferingGrab(ClientPtr /* client */ , DeviceIntPtr /* dev */ , xEvent * /* events */ ); #ifdef PANORAMIX extern _X_EXPORT void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff); #endif #ifdef RANDR extern _X_EXPORT void ScreenRestructured(ScreenPtr pScreen); #endif #ifndef HAVE_FFS extern _X_EXPORT int ffs(int i); #endif /* * ServerGrabCallback stuff */ extern _X_EXPORT CallbackListPtr ServerGrabCallback; typedef enum { SERVER_GRABBED, SERVER_UNGRABBED, CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState; typedef struct { ClientPtr client; ServerGrabState grabstate; } ServerGrabInfoRec; /* * EventCallback stuff */ extern _X_EXPORT CallbackListPtr EventCallback; typedef struct { ClientPtr client; xEventPtr events; int count; } EventInfoRec; /* * DeviceEventCallback stuff */ extern _X_EXPORT CallbackListPtr DeviceEventCallback; typedef struct { InternalEvent *event; DeviceIntPtr device; } DeviceEventInfoRec; extern int XItoCoreType(int xi_type); extern Bool DevHasCursor(DeviceIntPtr pDev); extern _X_EXPORT Bool IsPointerDevice(DeviceIntPtr dev); extern _X_EXPORT Bool IsKeyboardDevice(DeviceIntPtr dev); extern Bool IsPointerEvent(InternalEvent *event); extern Bool IsTouchEvent(InternalEvent *event); extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev); extern _X_EXPORT Bool IsFloating(DeviceIntPtr dev); extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master); extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what); extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what); extern _X_EXPORT void *lastGLContext; #endif /* DIX_H */ xorg-server-1.17.1/include/Makefile.am0000664000175100017510000000214112323563340014467 00000000000000if XORG sdk_HEADERS = \ XIstubs.h \ Xprintf.h \ callback.h \ client.h \ closestr.h \ closure.h \ colormap.h \ colormapst.h \ hotplug.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 \ 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 nodist_sdk_HEADERS = xorg-server.h endif AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ protocol-versions.h \ systemd-logind.h \ xsha1.h xorg-server-1.17.1/include/extension.h0000664000175100017510000001067412456571574014651 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* * 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 #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 */ ); extern _X_EXPORT Bool EnableDisableExtension(const char *name, Bool enable); extern _X_EXPORT void EnableDisableExtensionError(const char *name, Bool enable); extern _X_EXPORT void InitExtensions(int argc, char **argv); extern _X_EXPORT void CloseDownExtensions(void); extern _X_EXPORT void LoadExtensionList(const ExtensionModule ext[], int listSize, Bool external); #endif /* EXTENSION_H */ xorg-server-1.17.1/include/eventconvert.h0000664000175100017510000000325012274325511015331 00000000000000/* * Copyright © 2009 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. * */ #ifndef _EVENTCONVERT_H_ #include #include #include "input.h" #include "events.h" #include "eventstr.h" _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); _X_INTERNAL int GetCoreType(enum EventType type); _X_INTERNAL int GetXIType(enum EventType type); _X_INTERNAL int GetXI2Type(enum EventType type); #endif /* _EVENTCONVERT_H_ */ xorg-server-1.17.1/include/client.h0000664000175100017510000000500612274325511014066 00000000000000/* * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All * rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * 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: Rami Ylimäki */ #ifndef CLIENT_H #define CLIENT_H #ifdef HAVE_DIX_CONFIG_H #include #endif /* HAVE_DIX_CONFIG_H */ #include #include /* Client IDs. Use GetClientPid, GetClientCmdName and GetClientCmdArgs * instead of accessing the fields directly. */ typedef struct { pid_t pid; /* process ID, -1 if not available */ const char *cmdname; /* process name, NULL if not available */ const char *cmdargs; /* process arguments, NULL if not available */ } ClientIdRec, *ClientIdPtr; struct _Client; /* Initialize and clean up. */ void ReserveClientIds(struct _Client *client); void ReleaseClientIds(struct _Client *client); /* Determine client IDs for caching. Exported on purpose for * extensions such as SELinux. */ extern _X_EXPORT pid_t DetermineClientPid(struct _Client *client); extern _X_EXPORT void DetermineClientCmd(pid_t, const char **cmdname, const char **cmdargs); /* Query cached client IDs. Exported on purpose for drivers. */ extern _X_EXPORT pid_t GetClientPid(struct _Client *client); extern _X_EXPORT const char *GetClientCmdName(struct _Client *client); extern _X_EXPORT const char *GetClientCmdArgs(struct _Client *client); #endif /* CLIENT_H */ xorg-server-1.17.1/include/do-not-use-config.h.in0000664000175100017510000004322012466505443016461 00000000000000/* include/do-not-use-config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Build AIGLX loader */ #undef AIGLX /* Default base font path */ #undef BASE_FONT_PATH /* Support BigRequests extension */ #undef BIGREQS /* Define to 1 if `struct sockaddr_in' has a `sin_len' member */ #undef BSD44SOCKETS /* Builder address */ #undef BUILDERADDR /* Builder string */ #undef BUILDERSTRING /* Prefix to use for bundle identifiers */ #undef BUNDLE_ID_PREFIX /* Include busfault OS API */ #undef BUSFAULT /* Support client ID tracking */ #undef CLIENTIDS /* Default font path */ #undef COMPILEDDEFAULTFONTPATH /* Support Composite Extension */ #undef COMPOSITE /* Use the HAL hotplug API */ #undef CONFIG_HAL /* 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 /* System is BSD-like */ #undef CSRG_BASED /* Simple debug messages */ #undef CYGDEBUG /* Debug window manager */ #undef CYGMULTIWINDOW_DEBUG /* Debug messages for window handling */ #undef CYGWINDOWING_DEBUG /* Support Damage extension */ #undef DAMAGE /* Support DBE extension */ #undef DBE /* Use ddxBeforeReset */ #undef DDXBEFORERESET /* Use OsVendorVErrorF */ #undef DDXOSVERRORF /* Enable debugging code */ #undef DEBUG /* Default library install path */ #undef DEFAULT_LIBRARY_PATH /* Default log location */ #undef DEFAULT_LOGDIR /* Default logfile prefix */ #undef DEFAULT_LOGPREFIX /* Default module search path */ #undef DEFAULT_MODULE_PATH /* Default XDG_DATA dir under HOME */ #undef DEFAULT_XDG_DATA_HOME /* Default log dir under XDG_DATA_HOME */ #undef DEFAULT_XDG_DATA_HOME_LOGDIR /* Support DGA extension */ #undef DGA /* Support DPMS extension */ #undef DPMSExtension /* Build DRI2 extension */ #undef DRI2 /* Build DRI2 AIGLX loader */ #undef DRI2_AIGLX /* Build DRI3 extension */ #undef DRI3 /* Default DRI driver path */ #undef DRI_DRIVER_PATH /* Build glamor */ #undef GLAMOR /* Build glamor with GBM-based EGL support */ #undef GLAMOR_HAS_GBM /* Build GLX extension */ #undef GLXEXT /* Support XDM-AUTH*-1 */ #undef HASXDMAUTH /* System has /dev/xf86 aperture driver */ #undef HAS_APERTURE_DRV /* Cygwin has /dev/windows for signaling new win32 messages */ #undef HAS_DEVWINDOWS /* Support SHM */ #undef HAS_SHM /* Use Windows sockets */ #undef HAS_WINSOCK /* Define to 1 if you have the `authdes_create' function. */ #undef HAVE_AUTHDES_CREATE /* Define to 1 if you have the `authdes_seccreate' function. */ #undef HAVE_AUTHDES_SECCREATE /* Has backtrace support */ #undef HAVE_BACKTRACE /* Define to 1 if you have the header file. */ #undef HAVE_BYTESWAP_H /* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the header file. */ #undef HAVE_DBM_H /* Have D-Bus support */ #undef HAVE_DBUS /* Define to 1 if you have the declaration of `program_invocation_short_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Have execinfo.h */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `ffs' function. */ #undef HAVE_FFS /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Define to 1 if you have the `getdtablesize' function. */ #undef HAVE_GETDTABLESIZE /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the `getifaddrs' function. */ #undef HAVE_GETIFADDRS /* Define to 1 if you have the `getpeereid' function. */ #undef HAVE_GETPEEREID /* Define to 1 if you have the `getpeerucred' function. */ #undef HAVE_GETPEERUCRED /* Define to 1 if you have the `getprogname' function. */ #undef HAVE_GETPROGNAME /* Define to 1 if you have the `getresuid' function. */ #undef HAVE_GETRESUID /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define to 1 if you have the `getzoneid' function. */ #undef HAVE_GETZONEID /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `issetugid' function. */ #undef HAVE_ISSETUGID /* Define to 1 if you have the `audit' library (-laudit). */ #undef HAVE_LIBAUDIT /* Define to 1 if you have the header file. */ #undef HAVE_LIBAUDIT_H /* Define to 1 if you have the libdispatch (GCD) available */ #undef HAVE_LIBDISPATCH /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if libudev is available. */ #undef HAVE_LIBUDEV /* Have libunwind support */ #undef HAVE_LIBUNWIND /* Define to 1 if you have the `ws2_32' library (-lws2_32). */ #undef HAVE_LIBWS2_32 /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_AGPGART_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_APM_BIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FB_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_NDBM_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_RPCSVC_DBM_H /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID /* 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 /* Use libgcrypt SHA1 functions */ #undef HAVE_SHA1_IN_LIBGCRYPT /* 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 /* Define to 1 if you have the `shmctl64' function. */ #undef HAVE_SHMCTL64 /* Have sigaction function */ #undef HAVE_SIGACTION /* Define to 1 if the system has the type `socklen_t'. */ #undef HAVE_SOCKLEN_T /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H /* Define to 1 if libsystemd-daemon is available */ #undef HAVE_SYSTEMD_DAEMON /* Define to 1 if SYSV IPC is available */ #undef HAVE_SYSV_IPC /* Define to 1 if you have the header file. */ #undef HAVE_SYS_AGPGART_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_AGPIO_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_KD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LINKER_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MKDEV_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTSNAME_H /* 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 /* Define to 1 if you have the `udev_monitor_filter_add_match_tag' function. */ #undef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `walkcontext' function. */ #undef HAVE_WALKCONTEXT /* Have xshmfence support */ #undef HAVE_XSHMFENCE /* Support IPv6 for TCP connections */ #undef IPv6 /* Build kdrive ddx */ #undef KDRIVEDDXACTIONS /* Build fbdev-based kdrive server */ #undef KDRIVEFBDEV /* Build Kdrive X server */ #undef KDRIVESERVER /* Enable KDrive evdev driver */ #undef KDRIVE_EVDEV /* Enable KDrive kbd driver */ #undef KDRIVE_KBD /* Enable KDrive mouse driver */ #undef KDRIVE_MOUSE /* Listen on local socket */ #undef LISTEN_LOCAL /* Listen on TCP socket */ #undef LISTEN_TCP /* Listen on Unix socket */ #undef LISTEN_UNIX /* Support os-specific local connections */ #undef LOCALCONN /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Support MIT-SHM extension */ #undef MITSHM /* Have monotonic clock from clock_gettime() */ #undef MONOTONIC_CLOCK /* Enable D-Bus core */ #undef NEED_DBUS /* Need XFree86 helper functions */ #undef NEED_XF86_PROTOTYPES /* Need XFree86 typedefs */ #undef NEED_XF86_TYPES /* Define to 1 if modules should avoid the libcwrapper */ #undef NO_LIBCWRAPPER /* Operating System Name */ #undef OSNAME /* Operating System Vendor */ #undef OSVENDOR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Major version of this package */ #undef PACKAGE_VERSION_MAJOR /* Minor version of this package */ #undef PACKAGE_VERSION_MINOR /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL /* Internal define for Xinerama */ #undef PANORAMIX /* System has PC console */ #undef PCCONS_SUPPORT /* Default PCI text file ID path */ #undef PCI_TXT_IDS_PATH /* System has PC console */ #undef PCVT_SUPPORT /* Support Present extension */ #undef PRESENT /* Overall prefix */ #undef PROJECTROOT /* Support RANDR extension */ #undef RANDR /* Make PROJECT_ROOT relative to the xserver location */ #undef RELOCATE_PROJECTROOT /* Support RENDER extension */ #undef RENDER /* Support X resource extension */ #undef RES /* Build Rootless code */ #undef ROOTLESS /* Support MIT-SCREEN-SAVER extension */ #undef SCREENSAVER /* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */ #undef SECURE_RPC /* Server miscellaneous config path */ #undef SERVER_MISC_CONFIG_PATH /* Support SHAPE extension */ #undef SHAPE /* Directory for shared memory temp files */ #undef SHMDIR /* The size of `unsigned long', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG /* Build a standalone xpbproxy */ #undef STANDALONE_XPBPROXY /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Where to install the Xorg binary and Xorg.wrap */ #undef SUID_WRAPPER_DIR /* Define to 1 on systems derived from System V Release 4 */ #undef SVR4 /* sysconfdir */ #undef SYSCONFDIR /* System has syscons console */ #undef SYSCONS_SUPPORT /* Enable systemd-logind integration */ #undef SYSTEMD_LOGIND /* Support TCP socket connections */ #undef TCPCONN /* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */ #undef TLS /* Have tslib support */ #undef TSLIB /* Support UNIX socket connections */ #undef UNIXCONN /* NetBSD PIO alpha IO */ #undef USE_ALPHA_PIO /* BSD AMD64 iopl */ #undef USE_AMD64_IOPL /* BSD /dev/io */ #undef USE_DEV_IO /* BSD i386 iopl */ #undef USE_I386_IOPL /* Use SIGIO handlers for input device events by default */ #undef USE_SIGIO_BY_DEFAULT /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Define to use byteswap macros from */ #undef USE_SYS_ENDIAN_H /* Vendor man version */ #undef VENDOR_MAN_VERSION /* Vendor name */ #undef VENDOR_NAME /* Vendor name */ #undef VENDOR_NAME_SHORT /* Vendor release */ #undef VENDOR_RELEASE /* Version number of package */ #undef VERSION /* Building with libdrm support */ #undef WITH_LIBDRM /* Building vgahw module */ #undef WITH_VGAHW /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* System has wscons console */ #undef WSCONS_SUPPORT /* Build X-ACE extension */ #undef XACE /* Support XCMisc extension */ #undef XCMISC /* Build Security extension */ #undef XCSECURITY /* Support XDM Control Protocol */ #undef XDMCP /* Support XF86 Big font extension */ #undef XF86BIGFONT /* Name of configuration file */ #undef XF86CONFIGFILE /* Build DRI extension */ #undef XF86DRI /* Support APM/ACPI power management in the server */ #undef XF86PM /* Support XFree86 Video Mode extension */ #undef XF86VIDMODE /* Support XFixes extension */ #undef XFIXES /* Building XFree86 server */ #undef XFree86Server /* Build XDGA support */ #undef XFreeXDGA /* Support Xinerama extension */ #undef XINERAMA /* Support X Input extension */ #undef XINPUT /* Path to XKB data */ #undef XKB_BASE_DIRECTORY /* Path to XKB bin dir */ #undef XKB_BIN_DIRECTORY /* Default XKB layout */ #undef XKB_DFLT_LAYOUT /* Default XKB model */ #undef XKB_DFLT_MODEL /* Default XKB options */ #undef XKB_DFLT_OPTIONS /* Default XKB ruleset */ #undef XKB_DFLT_RULES /* Default XKB variant */ #undef XKB_DFLT_VARIANT /* Path to XKB output dir */ #undef XKM_OUTPUT_DIR /* Building Xorg server */ #undef XORGSERVER /* Vendor release */ #undef XORG_DATE /* Vendor man version */ #undef XORG_MAN_VERSION /* Building Xorg server */ #undef XORG_SERVER /* Current Xorg version */ #undef XORG_VERSION_CURRENT /* Have Quartz */ #undef XQUARTZ /* Support application updating through sparkle. */ #undef XQUARTZ_SPARKLE /* Support Record extension */ #undef XRECORD /* Build SELinux extension */ #undef XSELINUX /* Define to 1 if the DTrace Xserver provider probes should be built in. */ #undef XSERVER_DTRACE /* Use libpciaccess for all pci manipulation */ #undef XSERVER_LIBPCIACCESS /* X server supports platform device enumeration */ #undef XSERVER_PLATFORM_BUS /* Support XSync extension */ #undef XSYNC /* Support XTest extension */ #undef XTEST /* Enable xtrans fd passing support */ #undef XTRANS_SEND_FDS /* Support Xv extension */ #undef XV /* Vendor name */ #undef XVENDORNAME /* Short vendor name */ #undef XVENDORNAMESHORT /* byte order */ #undef X_BYTE_ORDER /* Build Xv extension */ #undef XvExtension /* Build XvMC extension */ #undef XvMCExtension /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Enable GNU and other extensions to the C environment for glibc */ #undef _GNU_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Defined if needed to expose struct msghdr.msg_control */ #undef _XOPEN_SOURCE /* Define to 1 if unsigned long is 64 bits. */ #undef _XSERVER64 /* Vendor web address for support */ #undef __VENDORDWEBSUPPORT__ /* Name of configuration directory */ #undef __XCONFIGDIR__ /* Name of configuration file */ #undef __XCONFIGFILE__ /* Name of X server */ #undef __XSERVERNAME__ /* Define to 16-bit byteswap macro */ #undef bswap_16 /* Define to 32-bit byteswap macro */ #undef bswap_32 /* Define to 64-bit byteswap macro */ #undef bswap_64 /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to __typeof__ if your compiler spells it that way. */ #undef typeof xorg-server-1.17.1/include/dixstruct.h0000664000175100017510000001305612274325511014645 00000000000000/*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef DIXSTRUCT_H #define DIXSTRUCT_H #include "client.h" #include "dix.h" #include "resource.h" #include "cursor.h" #include "gc.h" #include "pixmap.h" #include "privates.h" #include /* * direct-mapped hash table, used by resource manager to store * translation from client ids to server addresses. */ extern _X_EXPORT CallbackListPtr ClientStateCallback; typedef struct { ClientPtr client; xConnSetupPrefix *prefix; xConnSetup *setup; } NewClientInfoRec; typedef void (*ReplySwapPtr) (ClientPtr /* pClient */ , int /* size */ , void * /* pbuf */ ); extern _X_EXPORT void ReplyNotSwappd(ClientPtr /* pClient */ , int /* size */ , void * /* pbuf */ ) _X_NORETURN; typedef enum { ClientStateInitial, ClientStateRunning, ClientStateRetained, ClientStateGone } ClientState; typedef struct _saveSet { struct _Window *windowPtr; Bool toRoot; Bool map; } SaveSetElt; #define SaveSetWindow(ss) ((ss).windowPtr) #define SaveSetToRoot(ss) ((ss).toRoot) #define SaveSetShouldMap(ss) ((ss).map) #define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w)) #define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr)) #define SaveSetAssignMap(ss,m) ((ss).map = (m)) typedef struct _Client { void *requestBuffer; void *osPrivate; /* for OS layer, including scheduler */ 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 ignoreCount; /* count for Attend/IgnoreClient */ int numSaved; SaveSetElt *saveSet; int (**requestVector) (ClientPtr /* pClient */ ); CARD32 req_len; /* length of current request */ unsigned int replyBytesRemaining; PrivateRec *devPrivates; unsigned short xkbClientFlags; unsigned short mapNotifyMask; unsigned short newKeyboardNotifyMask; unsigned short vMajor, vMinor; KeyCode minKC, maxKC; int smart_start_tick; int smart_stop_tick; DeviceIntPtr clientPtr; ClientIdPtr clientIds; #if XTRANS_SEND_FDS int req_fds; #endif } ClientRec; #if XTRANS_SEND_FDS static inline void SetReqFds(ClientPtr client, int req_fds) { if (client->req_fds != 0 && req_fds != client->req_fds) LogMessage(X_ERROR, "Mismatching number of request fds %d != %d\n", req_fds, client->req_fds); client->req_fds = req_fds; } #endif /* * Scheduling interface */ extern _X_EXPORT long SmartScheduleTime; extern _X_EXPORT long SmartScheduleInterval; extern _X_EXPORT long SmartScheduleSlice; extern _X_EXPORT long SmartScheduleMaxSlice; extern _X_EXPORT Bool SmartScheduleDisable; extern _X_EXPORT void SmartScheduleStartTimer(void); extern _X_EXPORT void SmartScheduleStopTimer(void); #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) extern _X_EXPORT void SmartScheduleInit(void); /* This prototype is used pervasively in Xext, dix */ #define DISPATCH_PROC(func) int func(ClientPtr /* client */) typedef struct _WorkQueue { struct _WorkQueue *next; Bool (*function) (ClientPtr /* pClient */ , void * /* closure */ ); ClientPtr client; void *closure; } WorkQueueRec; extern _X_EXPORT TimeStamp currentTime; extern _X_EXPORT int CompareTimeStamps(TimeStamp /*a */ , TimeStamp /*b */ ); extern _X_EXPORT TimeStamp ClientTimeToServerTime(CARD32 /*c */ ); typedef struct _CallbackRec { CallbackProcPtr proc; void *data; Bool deleted; struct _CallbackRec *next; } CallbackRec, *CallbackPtr; typedef struct _CallbackList { int inCallback; Bool deleted; int numDeleted; CallbackPtr list; } CallbackListRec; /* proc vectors */ extern _X_EXPORT int (*InitialVector[3]) (ClientPtr /*client */ ); extern _X_EXPORT int (*ProcVector[256]) (ClientPtr /*client */ ); extern _X_EXPORT int (*SwappedProcVector[256]) (ClientPtr /*client */ ); extern _X_EXPORT ReplySwapPtr ReplySwapVector[256]; extern _X_EXPORT int ProcBadRequest(ClientPtr /*client */ ); #endif /* DIXSTRUCT_H */ xorg-server-1.17.1/include/swaprep.h0000664000175100017510000002775212274325511014305 00000000000000/************************************************************ Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ #ifndef SWAPREP_H #define SWAPREP_H 1 extern _X_EXPORT void Swap32Write(ClientPtr /* pClient */ , int /* size */ , CARD32 * /* pbuf */ ); extern _X_EXPORT void CopySwap32Write(ClientPtr /* pClient */ , int /* size */ , CARD32 * /* pbuf */ ); extern _X_EXPORT void CopySwap16Write(ClientPtr /* pClient */ , int /* size */ , short * /* pbuf */ ); extern _X_EXPORT void SGenericReply(ClientPtr /* pClient */ , int /* size */ , xGenericReply * /* pRep */ ); extern _X_EXPORT void SGetWindowAttributesReply(ClientPtr /* pClient */ , int /* size */ , xGetWindowAttributesReply * /* pRep */ ); extern _X_EXPORT void SGetGeometryReply(ClientPtr /* pClient */ , int /* size */ , xGetGeometryReply * /* pRep */ ); extern _X_EXPORT void SQueryTreeReply(ClientPtr /* pClient */ , int /* size */ , xQueryTreeReply * /* pRep */ ); extern _X_EXPORT void SInternAtomReply(ClientPtr /* pClient */ , int /* size */ , xInternAtomReply * /* pRep */ ); extern _X_EXPORT void SGetAtomNameReply(ClientPtr /* pClient */ , int /* size */ , xGetAtomNameReply * /* pRep */ ); extern _X_EXPORT void SGetPropertyReply(ClientPtr /* pClient */ , int /* size */ , xGetPropertyReply * /* pRep */ ); extern _X_EXPORT void SListPropertiesReply(ClientPtr /* pClient */ , int /* size */ , xListPropertiesReply * /* pRep */ ); extern _X_EXPORT void SGetSelectionOwnerReply(ClientPtr /* pClient */ , int /* size */ , xGetSelectionOwnerReply * /* pRep */ ); extern _X_EXPORT void SQueryPointerReply(ClientPtr /* pClient */ , int /* size */ , xQueryPointerReply * /* pRep */ ); extern _X_EXPORT void SwapTimeCoordWrite(ClientPtr /* pClient */ , int /* size */ , xTimecoord * /* pRep */ ); extern _X_EXPORT void SGetMotionEventsReply(ClientPtr /* pClient */ , int /* size */ , xGetMotionEventsReply * /* pRep */ ); extern _X_EXPORT void STranslateCoordsReply(ClientPtr /* pClient */ , int /* size */ , xTranslateCoordsReply * /* pRep */ ); extern _X_EXPORT void SGetInputFocusReply(ClientPtr /* pClient */ , int /* size */ , xGetInputFocusReply * /* pRep */ ); extern _X_EXPORT void SQueryKeymapReply(ClientPtr /* pClient */ , int /* size */ , xQueryKeymapReply * /* pRep */ ); extern _X_EXPORT void SQueryFontReply(ClientPtr /* pClient */ , int /* size */ , xQueryFontReply * /* pRep */ ); extern _X_EXPORT void SQueryTextExtentsReply(ClientPtr /* pClient */ , int /* size */ , xQueryTextExtentsReply * /* pRep */ ); extern _X_EXPORT void SListFontsReply(ClientPtr /* pClient */ , int /* size */ , xListFontsReply * /* pRep */ ); extern _X_EXPORT void SListFontsWithInfoReply(ClientPtr /* pClient */ , int /* size */ , xListFontsWithInfoReply * /* pRep */ ); extern _X_EXPORT void SGetFontPathReply(ClientPtr /* pClient */ , int /* size */ , xGetFontPathReply * /* pRep */ ); extern _X_EXPORT void SGetImageReply(ClientPtr /* pClient */ , int /* size */ , xGetImageReply * /* pRep */ ); extern _X_EXPORT void SListInstalledColormapsReply(ClientPtr /* pClient */ , int /* size */ , xListInstalledColormapsReply * /* pRep */ ); extern _X_EXPORT void SAllocColorReply(ClientPtr /* pClient */ , int /* size */ , xAllocColorReply * /* pRep */ ); extern _X_EXPORT void SAllocNamedColorReply(ClientPtr /* pClient */ , int /* size */ , xAllocNamedColorReply * /* pRep */ ); extern _X_EXPORT void SAllocColorCellsReply(ClientPtr /* pClient */ , int /* size */ , xAllocColorCellsReply * /* pRep */ ); extern _X_EXPORT void SAllocColorPlanesReply(ClientPtr /* pClient */ , int /* size */ , xAllocColorPlanesReply * /* pRep */ ); extern _X_EXPORT void SQColorsExtend(ClientPtr /* pClient */ , int /* size */ , xrgb * /* prgb */ ); extern _X_EXPORT void SQueryColorsReply(ClientPtr /* pClient */ , int /* size */ , xQueryColorsReply * /* pRep */ ); extern _X_EXPORT void SLookupColorReply(ClientPtr /* pClient */ , int /* size */ , xLookupColorReply * /* pRep */ ); extern _X_EXPORT void SQueryBestSizeReply(ClientPtr /* pClient */ , int /* size */ , xQueryBestSizeReply * /* pRep */ ); extern _X_EXPORT void SListExtensionsReply(ClientPtr /* pClient */ , int /* size */ , xListExtensionsReply * /* pRep */ ); extern _X_EXPORT void SGetKeyboardMappingReply(ClientPtr /* pClient */ , int /* size */ , xGetKeyboardMappingReply * /* pRep */ ); extern _X_EXPORT void SGetPointerMappingReply(ClientPtr /* pClient */ , int /* size */ , xGetPointerMappingReply * /* pRep */ ); extern _X_EXPORT void SGetModifierMappingReply(ClientPtr /* pClient */ , int /* size */ , xGetModifierMappingReply * /* pRep */ ); extern _X_EXPORT void SGetKeyboardControlReply(ClientPtr /* pClient */ , int /* size */ , xGetKeyboardControlReply * /* pRep */ ); extern _X_EXPORT void SGetPointerControlReply(ClientPtr /* pClient */ , int /* size */ , xGetPointerControlReply * /* pRep */ ); extern _X_EXPORT void SGetScreenSaverReply(ClientPtr /* pClient */ , int /* size */ , xGetScreenSaverReply * /* pRep */ ); extern _X_EXPORT void SLHostsExtend(ClientPtr /* pClient */ , int /* size */ , char * /* buf */ ); extern _X_EXPORT void SListHostsReply(ClientPtr /* pClient */ , int /* size */ , xListHostsReply * /* pRep */ ); extern _X_EXPORT void SErrorEvent(xError * /* from */ , xError * /* to */ ); extern _X_EXPORT void SwapConnSetupInfo(char * /* pInfo */ , char * /* pInfoTBase */ ); extern _X_EXPORT void WriteSConnectionInfo(ClientPtr /* pClient */ , unsigned long /* size */ , char * /* pInfo */ ); extern _X_EXPORT void SwapConnSetupPrefix(xConnSetupPrefix * /* pcspFrom */ , xConnSetupPrefix * /* pcspTo */ ); extern _X_EXPORT void WriteSConnSetupPrefix(ClientPtr /* pClient */ , xConnSetupPrefix * /* pcsp */ ); #undef SWAPREP_PROC #define SWAPREP_PROC(func) extern _X_EXPORT void func(xEvent * /* from */, xEvent * /* to */) SWAPREP_PROC(SCirculateEvent); SWAPREP_PROC(SClientMessageEvent); SWAPREP_PROC(SColormapEvent); SWAPREP_PROC(SConfigureNotifyEvent); SWAPREP_PROC(SConfigureRequestEvent); SWAPREP_PROC(SCreateNotifyEvent); SWAPREP_PROC(SDestroyNotifyEvent); SWAPREP_PROC(SEnterLeaveEvent); SWAPREP_PROC(SExposeEvent); SWAPREP_PROC(SFocusEvent); SWAPREP_PROC(SGraphicsExposureEvent); SWAPREP_PROC(SGravityEvent); SWAPREP_PROC(SKeyButtonPtrEvent); SWAPREP_PROC(SKeymapNotifyEvent); SWAPREP_PROC(SMapNotifyEvent); SWAPREP_PROC(SMapRequestEvent); SWAPREP_PROC(SMappingEvent); SWAPREP_PROC(SNoExposureEvent); SWAPREP_PROC(SPropertyEvent); SWAPREP_PROC(SReparentEvent); SWAPREP_PROC(SResizeRequestEvent); SWAPREP_PROC(SSelectionClearEvent); SWAPREP_PROC(SSelectionNotifyEvent); SWAPREP_PROC(SSelectionRequestEvent); SWAPREP_PROC(SUnmapNotifyEvent); SWAPREP_PROC(SVisibilityEvent); #undef SWAPREP_PROC #endif /* SWAPREP_H */ xorg-server-1.17.1/include/colormap.h0000664000175100017510000001562712456571574014454 00000000000000/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. */ #ifndef CMAP_H #define CMAP_H 1 #include #include "screenint.h" #include "window.h" /* these follow X.h's AllocNone and AllocAll */ #define CM_PSCREEN 2 #define CM_PWIN 3 /* Passed internally in colormap.c */ #define REDMAP 0 #define GREENMAP 1 #define BLUEMAP 2 #define PSEUDOMAP 3 #define AllocPrivate (-1) #define AllocTemporary (-2) #define DynamicClass 1 /* Values for the flags field of a colormap. These should have 1 bit set * and not overlap */ #define IsDefault 1 #define AllAllocated 2 #define BeingCreated 4 typedef CARD32 Pixel; typedef struct _CMEntry *EntryPtr; /* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */ typedef struct _colorResource *colorResourcePtr; extern _X_EXPORT int CreateColormap(Colormap /*mid */ , ScreenPtr /*pScreen */ , VisualPtr /*pVisual */ , ColormapPtr * /*ppcmap */ , int /*alloc */ , int /*client */ ); extern _X_EXPORT int FreeColormap(void *pmap, XID mid); extern _X_EXPORT int TellLostMap(WindowPtr pwin, void *value); extern _X_EXPORT int TellGainedMap(WindowPtr pwin, void *value); extern _X_EXPORT int CopyColormapAndFree(Colormap /*mid */ , ColormapPtr /*pSrc */ , int /*client */ ); extern _X_EXPORT int AllocColor(ColormapPtr /*pmap */ , unsigned short * /*pred */ , unsigned short * /*pgreen */ , unsigned short * /*pblue */ , Pixel * /*pPix */ , int /*client */ ); extern _X_EXPORT void FakeAllocColor(ColormapPtr /*pmap */ , xColorItem * /*item */ ); extern _X_EXPORT void FakeFreeColor(ColormapPtr /*pmap */ , Pixel /*pixel */ ); typedef int (*ColorCompareProcPtr) (EntryPtr /*pent */ , xrgb * /*prgb */ ); extern _X_EXPORT int FindColor(ColormapPtr /*pmap */ , EntryPtr /*pentFirst */ , int /*size */ , xrgb * /*prgb */ , Pixel * /*pPixel */ , int /*channel */ , int /*client */ , ColorCompareProcPtr /*comp */ ); extern _X_EXPORT int QueryColors(ColormapPtr /*pmap */ , int /*count */ , Pixel * /*ppixIn */ , xrgb * /*prgbList */ , ClientPtr client); extern _X_EXPORT int FreeClientPixels(void *pcr, XID fakeid); extern _X_EXPORT int AllocColorCells(int /*client */ , ColormapPtr /*pmap */ , int /*colors */ , int /*planes */ , Bool /*contig */ , Pixel * /*ppix */ , Pixel * /*masks */ ); extern _X_EXPORT int AllocColorPlanes(int /*client */ , ColormapPtr /*pmap */ , int /*colors */ , int /*r */ , int /*g */ , int /*b */ , Bool /*contig */ , Pixel * /*pixels */ , Pixel * /*prmask */ , Pixel * /*pgmask */ , Pixel * /*pbmask */ ); extern _X_EXPORT int FreeColors(ColormapPtr /*pmap */ , int /*client */ , int /*count */ , Pixel * /*pixels */ , Pixel /*mask */ ); extern _X_EXPORT int StoreColors(ColormapPtr /*pmap */ , int /*count */ , xColorItem * /*defs */ , ClientPtr client); extern _X_EXPORT int IsMapInstalled(Colormap /*map */ , WindowPtr /*pWin */ ); extern _X_EXPORT Bool ResizeVisualArray(ScreenPtr /* pScreen */ , int /* new_vis_count */ , DepthPtr /* depth */ ); #endif /* CMAP_H */ xorg-server-1.17.1/include/XIstubs.h0000664000175100017510000000345512274325511014217 00000000000000/************************************************************ Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ #ifndef XI_STUBS_H #define XI_STUBS_H 1 extern _X_EXPORT int SetDeviceMode(ClientPtr /* client */ , DeviceIntPtr /* dev */ , int /* mode */ ); extern _X_EXPORT int SetDeviceValuators(ClientPtr /* client */ , DeviceIntPtr /* dev */ , int * /* valuators */ , int /* first_valuator */ , int /* num_valuators */ ); extern _X_EXPORT int ChangeDeviceControl(ClientPtr /* client */ , DeviceIntPtr /* dev */ , xDeviceCtl * /* control */ ); #endif /* XI_STUBS_H */ xorg-server-1.17.1/include/dix-config-apple-verbatim.h0000664000175100017510000000042712274325511017547 00000000000000/* Do not include this file directly. It is included at the end of */ /* Correctly set _XSERVER64 for OSX fat binaries */ #if defined(__LP64__) && !defined(_XSERVER64) #define _XSERVER64 1 #elif !defined(__LP64__) && defined(_XSERVER64) #undef _XSERVER64 #endif xorg-server-1.17.1/include/windowstr.h0000664000175100017510000002135112456571574014667 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef WINDOWSTRUCT_H #define WINDOWSTRUCT_H #include "window.h" #include "pixmapstr.h" #include "regionstr.h" #include "cursor.h" #include "property.h" #include "resource.h" /* for ROOT_WINDOW_ID_BASE */ #include "dix.h" #include "privates.h" #include "miscstruct.h" #include #include "opaque.h" #define GuaranteeNothing 0 #define GuaranteeVisBack 1 #define SameBackground(as, a, bs, b) \ ((as) == (bs) && ((as) == None || \ (as) == ParentRelative || \ SamePixUnion(a,b,as == BackgroundPixel))) #define SameBorder(as, a, bs, b) \ EqualPixUnion(as, a, bs, b) /* used as NULL-terminated list */ typedef struct _DevCursorNode { CursorPtr cursor; DeviceIntPtr dev; struct _DevCursorNode *next; } DevCursNodeRec, *DevCursNodePtr, *DevCursorList; typedef struct _WindowOpt { CursorPtr cursor; /* default: window.cursorNone */ VisualID visual; /* default: same as parent */ Colormap colormap; /* default: same as parent */ Mask dontPropagateMask; /* default: window.dontPropagate */ Mask otherEventMasks; /* default: 0 */ struct _OtherClients *otherClients; /* default: NULL */ struct _GrabRec *passiveGrabs; /* default: NULL */ PropertyPtr userProps; /* default: NULL */ CARD32 backingBitPlanes; /* default: ~0L */ CARD32 backingPixel; /* default: 0 */ RegionPtr boundingShape; /* default: NULL */ RegionPtr clipShape; /* default: NULL */ RegionPtr inputShape; /* default: NULL */ struct _OtherInputMasks *inputMasks; /* default: NULL */ DevCursorList deviceCursors; /* default: NULL */ } WindowOptRec, *WindowOptPtr; #define BackgroundPixel 2L #define BackgroundPixmap 3L /* * The redirectDraw field can have one of three values: * * RedirectDrawNone * A normal window; painted into the same pixmap as the parent * and clipping parent and siblings to its geometry. These * windows get a clip list equal to the intersection of their * geometry with the parent geometry, minus the geometry * of overlapping None and Clipped siblings. * RedirectDrawAutomatic * A redirected window which clips parent and sibling drawing. * Contents for these windows are manage inside the server. * These windows get an internal clip list equal to their * geometry. * RedirectDrawManual * A redirected window which does not clip parent and sibling * drawing; the window must be represented within the parent * geometry by the client performing the redirection management. * Contents for these windows are managed outside the server. * These windows get an internal clip list equal to their * geometry. */ #define RedirectDrawNone 0 #define RedirectDrawAutomatic 1 #define RedirectDrawManual 2 typedef struct _Window { DrawableRec drawable; PrivateRec *devPrivates; WindowPtr parent; /* ancestor chain */ WindowPtr nextSib; /* next lower sibling */ WindowPtr prevSib; /* next higher sibling */ WindowPtr firstChild; /* top-most child */ WindowPtr lastChild; /* bottom-most child */ RegionRec clipList; /* clipping rectangle for output */ RegionRec borderClip; /* NotClippedByChildren + border */ union _Validate *valdata; RegionRec winSize; RegionRec borderSize; DDXPointRec origin; /* position relative to parent */ unsigned short borderWidth; unsigned short deliverableEvents; /* all masks from all clients */ Mask eventMask; /* mask from the creating client */ PixUnion background; PixUnion border; WindowOptPtr optional; unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */ unsigned borderIsPixel:1; unsigned cursorIsNone:1; /* else real cursor (might inherit) */ unsigned backingStore:2; unsigned backStorage:1; /* if bs is allocated */ unsigned saveUnder:1; unsigned bitGravity:4; unsigned winGravity:4; unsigned overrideRedirect:1; unsigned visibility:2; unsigned mapped:1; unsigned realized:1; /* ancestors are all mapped */ unsigned viewable:1; /* realized && InputOutput */ unsigned dontPropagate:3; /* index into DontPropagateMasks */ unsigned forcedBS:1; /* system-supplied backingStore */ unsigned redirectDraw:2; /* COMPOSITE rendering redirect */ unsigned forcedBG:1; /* must have an opaque background */ #ifdef ROOTLESS unsigned rootlessUnhittable:1; /* doesn't hit-test */ #endif #ifdef COMPOSITE unsigned damagedDescendants:1; /* some descendants are damaged */ unsigned inhibitBGPaint:1; /* paint the background? */ #endif } WindowRec; /* * Ok, a bunch of macros for accessing the optional record * fields (or filling the appropriate default value) */ extern _X_EXPORT Mask DontPropagateMasks[]; #define wTrackParent(w,field) ((w)->optional ? \ (w)->optional->field \ : FindWindowWithOptional(w)->optional->field) #define wUseDefault(w,field,def) ((w)->optional ? \ (w)->optional->field \ : def) #define wVisual(w) wTrackParent(w, visual) #define wCursor(w) ((w)->cursorIsNone ? None : wTrackParent(w, cursor)) #define wColormap(w) ((w)->drawable.class == InputOnly ? None : wTrackParent(w, colormap)) #define wDontPropagateMask(w) wUseDefault(w, dontPropagateMask, DontPropagateMasks[(w)->dontPropagate]) #define wOtherEventMasks(w) wUseDefault(w, otherEventMasks, 0) #define wOtherClients(w) wUseDefault(w, otherClients, NULL) #define wOtherInputMasks(w) wUseDefault(w, inputMasks, NULL) #define wPassiveGrabs(w) wUseDefault(w, passiveGrabs, NULL) #define wUserProps(w) wUseDefault(w, userProps, NULL) #define wBackingBitPlanes(w) wUseDefault(w, backingBitPlanes, ~0L) #define wBackingPixel(w) wUseDefault(w, backingPixel, 0) #define wBoundingShape(w) wUseDefault(w, boundingShape, NULL) #define wClipShape(w) wUseDefault(w, clipShape, NULL) #define wInputShape(w) wUseDefault(w, inputShape, NULL) #define wClient(w) (clients[CLIENT_ID((w)->drawable.id)]) #define wBorderWidth(w) ((int) (w)->borderWidth) /* true when w needs a border drawn. */ #define HasBorder(w) ((w)->borderWidth || wClipShape(w)) typedef struct _ScreenSaverStuff *ScreenSaverStuffPtr; #define SCREEN_IS_BLANKED 0 #define SCREEN_ISNT_SAVED 1 #define SCREEN_IS_TILED 2 #define SCREEN_IS_BLACK 3 #define HasSaverWindow(pScreen) (pScreen->screensaver.pWindow != NullWindow) extern _X_EXPORT int screenIsSaved; #endif /* WINDOWSTRUCT_H */ xorg-server-1.17.1/include/dixfontstr.h0000664000175100017510000000665612274325511015030 00000000000000/*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef DIXFONTSTRUCT_H #define DIXFONTSTRUCT_H #include "servermd.h" #include "dixfont.h" #include #include "closure.h" #include /* for xQueryFontReply */ #define FONTCHARSET(font) (font) #define FONTMAXBOUNDS(font,field) (font)->info.maxbounds.field #define FONTMINBOUNDS(font,field) (font)->info.minbounds.field #define TERMINALFONT(font) (font)->info.terminalFont #define FONTASCENT(font) (font)->info.fontAscent #define FONTDESCENT(font) (font)->info.fontDescent #define FONTGLYPHS(font) 0 #define FONTCONSTMETRICS(font) (font)->info.constantMetrics #define FONTCONSTWIDTH(font) (font)->info.constantWidth #define FONTALLEXIST(font) (font)->info.allExist #define FONTFIRSTCOL(font) (font)->info.firstCol #define FONTLASTCOL(font) (font)->info.lastCol #define FONTFIRSTROW(font) (font)->info.firstRow #define FONTLASTROW(font) (font)->info.lastRow #define FONTDEFAULTCH(font) (font)->info.defaultCh #define FONTINKMIN(font) (&((font)->info.ink_minbounds)) #define FONTINKMAX(font) (&((font)->info.ink_maxbounds)) #define FONTPROPS(font) (font)->info.props #define FONTGLYPHBITS(base,pci) ((unsigned char *) (pci)->bits) #define FONTINFONPROPS(font) (font)->info.nprops /* some things haven't changed names, but we'll be careful anyway */ #define FONTREFCNT(font) (font)->refcnt /* * for linear char sets */ #define N1dChars(pfont) (FONTLASTCOL(pfont) - FONTFIRSTCOL(pfont) + 1) /* * for 2D char sets */ #define N2dChars(pfont) (N1dChars(pfont) * \ (FONTLASTROW(pfont) - FONTFIRSTROW(pfont) + 1)) #ifndef GLYPHPADBYTES #define GLYPHPADBYTES -1 #endif #if GLYPHPADBYTES == 0 || GLYPHPADBYTES == 1 #define GLYPHWIDTHBYTESPADDED(pci) (GLYPHWIDTHBYTES(pci)) #define PADGLYPHWIDTHBYTES(w) (((w)+7)>>3) #endif #if GLYPHPADBYTES == 2 #define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+1) & ~0x1) #define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+1) & ~0x1) #endif #if GLYPHPADBYTES == 4 #define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+3) & ~0x3) #define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+3) & ~0x3) #endif #if GLYPHPADBYTES == 8 /* for a cray? */ #define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+7) & ~0x7) #define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+7) & ~0x7) #endif #endif /* DIXFONTSTRUCT_H */ xorg-server-1.17.1/include/scrnintstr.h0000664000175100017510000006024112456571574015041 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef SCREENINTSTRUCT_H #define SCREENINTSTRUCT_H #include "screenint.h" #include "regionstr.h" #include "colormap.h" #include "cursor.h" #include "validate.h" #include #include "dix.h" #include "privates.h" typedef struct _PixmapFormat { unsigned char depth; unsigned char bitsPerPixel; unsigned char scanlinePad; } PixmapFormatRec; typedef struct _Visual { VisualID vid; short class; short bitsPerRGBValue; short ColormapEntries; short nplanes; /* = log2 (ColormapEntries). This does not * imply that the screen has this many planes. * it may have more or fewer */ unsigned long redMask, greenMask, blueMask; int offsetRed, offsetGreen, offsetBlue; } VisualRec; typedef struct _Depth { unsigned char depth; short numVids; VisualID *vids; /* block of visual ids for this depth */ } DepthRec; typedef struct _ScreenSaverStuff { WindowPtr pWindow; XID wid; char blanked; Bool (*ExternalScreenSaver) (ScreenPtr /*pScreen */ , int /*xstate */ , Bool /*force */ ); } ScreenSaverStuffRec; /* * There is a typedef for each screen function pointer so that code that * needs to declare a screen function pointer (e.g. in a screen private * or as a local variable) can easily do so and retain full type checking. */ typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ ); typedef void (*QueryBestSizeProcPtr) (int /*class */ , unsigned short * /*pwidth */ , unsigned short * /*pheight */ , ScreenPtr /*pScreen */ ); typedef Bool (*SaveScreenProcPtr) (ScreenPtr /*pScreen */ , int /*on */ ); typedef void (*GetImageProcPtr) (DrawablePtr /*pDrawable */ , int /*sx */ , int /*sy */ , int /*w */ , int /*h */ , unsigned int /*format */ , unsigned long /*planeMask */ , char * /*pdstLine */ ); typedef void (*GetSpansProcPtr) (DrawablePtr /*pDrawable */ , int /*wMax */ , DDXPointPtr /*ppt */ , int * /*pwidth */ , int /*nspans */ , char * /*pdstStart */ ); typedef void (*SourceValidateProcPtr) (DrawablePtr /*pDrawable */ , int /*x */ , int /*y */ , int /*width */ , int /*height */ , unsigned int /*subWindowMode */ ); typedef Bool (*CreateWindowProcPtr) (WindowPtr /*pWindow */ ); typedef Bool (*DestroyWindowProcPtr) (WindowPtr /*pWindow */ ); typedef Bool (*PositionWindowProcPtr) (WindowPtr /*pWindow */ , int /*x */ , int /*y */ ); typedef Bool (*ChangeWindowAttributesProcPtr) (WindowPtr /*pWindow */ , unsigned long /*mask */ ); typedef Bool (*RealizeWindowProcPtr) (WindowPtr /*pWindow */ ); typedef Bool (*UnrealizeWindowProcPtr) (WindowPtr /*pWindow */ ); typedef void (*RestackWindowProcPtr) (WindowPtr /*pWindow */ , WindowPtr /*pOldNextSib */ ); typedef int (*ValidateTreeProcPtr) (WindowPtr /*pParent */ , WindowPtr /*pChild */ , VTKind /*kind */ ); typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ , WindowPtr /*pChild */ , VTKind /*kind */ ); typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ , RegionPtr /*prgn */); typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ , DDXPointRec /*ptOldOrg */ , RegionPtr /*prgnSrc */ ); typedef void (*ClearToBackgroundProcPtr) (WindowPtr /*pWindow */ , int /*x */ , int /*y */ , int /*w */ , int /*h */ , Bool /*generateExposures */ ); typedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ , int /*dx */ , int /*dy */ ); /* pixmap will exist only for the duration of the current rendering operation */ #define CREATE_PIXMAP_USAGE_SCRATCH 1 /* pixmap will be the backing pixmap for a redirected window */ #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 */ , int /*height */ , int /*depth */ , unsigned /*usage_hint */ ); typedef Bool (*DestroyPixmapProcPtr) (PixmapPtr /*pPixmap */ ); typedef Bool (*RealizeFontProcPtr) (ScreenPtr /*pScreen */ , FontPtr /*pFont */ ); typedef Bool (*UnrealizeFontProcPtr) (ScreenPtr /*pScreen */ , FontPtr /*pFont */ ); typedef void (*ConstrainCursorProcPtr) (DeviceIntPtr /*pDev */ , ScreenPtr /*pScreen */ , BoxPtr /*pBox */ ); typedef void (*CursorLimitsProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /*pScreen */ , CursorPtr /*pCursor */ , BoxPtr /*pHotBox */ , BoxPtr /*pTopLeftBox */ ); typedef Bool (*DisplayCursorProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /*pScreen */ , CursorPtr /*pCursor */ ); typedef Bool (*RealizeCursorProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /*pScreen */ , CursorPtr /*pCursor */ ); typedef Bool (*UnrealizeCursorProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /*pScreen */ , CursorPtr /*pCursor */ ); typedef void (*RecolorCursorProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /*pScreen */ , CursorPtr /*pCursor */ , Bool /*displayed */ ); typedef Bool (*SetCursorPositionProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /*pScreen */ , int /*x */ , int /*y */ , Bool /*generateEvent */ ); typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ ); typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ ); typedef void (*DestroyColormapProcPtr) (ColormapPtr /*pColormap */ ); typedef void (*InstallColormapProcPtr) (ColormapPtr /*pColormap */ ); typedef void (*UninstallColormapProcPtr) (ColormapPtr /*pColormap */ ); typedef int (*ListInstalledColormapsProcPtr) (ScreenPtr /*pScreen */ , XID * /*pmaps */ ); typedef void (*StoreColorsProcPtr) (ColormapPtr /*pColormap */ , int /*ndef */ , xColorItem * /*pdef */ ); typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ , unsigned short * /*pgreen */ , unsigned short * /*pblue */ , VisualPtr /*pVisual */ ); typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ ); typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen, void *pTimeout, void *pReadmask); typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen, unsigned long result, void *pReadMask); typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ ); typedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); typedef PixmapPtr (*GetWindowPixmapProcPtr) (WindowPtr /*pWin */ ); typedef void (*SetWindowPixmapProcPtr) (WindowPtr /*pWin */ , PixmapPtr /*pPix */ ); typedef PixmapPtr (*GetScreenPixmapProcPtr) (ScreenPtr /*pScreen */ ); typedef void (*SetScreenPixmapProcPtr) (PixmapPtr /*pPix */ ); typedef void (*MarkWindowProcPtr) (WindowPtr /*pWin */ ); typedef Bool (*MarkOverlappedWindowsProcPtr) (WindowPtr /*parent */ , WindowPtr /*firstChild */ , WindowPtr * /*pLayerWin */ ); typedef int (*ConfigNotifyProcPtr) (WindowPtr /*pWin */ , int /*x */ , int /*y */ , int /*w */ , int /*h */ , int /*bw */ , WindowPtr /*pSib */ ); typedef void (*MoveWindowProcPtr) (WindowPtr /*pWin */ , int /*x */ , int /*y */ , WindowPtr /*pSib */ , VTKind /*kind */ ); typedef void (*ResizeWindowProcPtr) (WindowPtr /*pWin */ , int /*x */ , int /*y */ , unsigned int /*w */ , unsigned int /*h */ , WindowPtr /*pSib */ ); typedef WindowPtr (*GetLayerWindowProcPtr) (WindowPtr /*pWin */ ); typedef void (*HandleExposuresProcPtr) (WindowPtr /*pWin */ ); typedef void (*ReparentWindowProcPtr) (WindowPtr /*pWin */ , WindowPtr /*pPriorParent */ ); typedef void (*SetShapeProcPtr) (WindowPtr /*pWin */ , int /* kind */ ); typedef void (*ChangeBorderWidthProcPtr) (WindowPtr /*pWin */ , unsigned int /*width */ ); typedef void (*MarkUnrealizedWindowProcPtr) (WindowPtr /*pChild */ , WindowPtr /*pWin */ , Bool /*fromConfigure */ ); typedef Bool (*DeviceCursorInitializeProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScreen */ ); typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ , ScreenPtr /* pScreen */ ); 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 WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen, SpritePtr pSprite, int x, int y); typedef int (*NameWindowPixmapProcPtr)(WindowPtr, PixmapPtr, CARD32); /* Wrapping Screen procedures There are a few modules in the X server which dynamically add and remove themselves from various screen procedure call chains. For example, the BlockHandler is dynamically modified by: * xf86Rotate * miSprite * composite * render (for animated cursors) Correctly manipulating this chain is complicated by the fact that the chain is constructed through a sequence of screen private structures, each holding the next screen->proc pointer. To add a module to a screen->proc chain is fairly simple; just save the current screen->proc value in the module screen private and store the module's function in the screen->proc location. Removing a screen proc is a bit trickier. It seems like all you need to do is set the screen->proc pointer back to the value saved in your screen private. However, if some other module has come along and wrapped on top of you, then the right place to store the previous screen->proc value is actually in the wrapping module's screen private structure(!). Of course, you have no idea what other module may have wrapped on top, nor could you poke inside its screen private in any case. To make this work, we restrict the unwrapping process to happen during the invocation of the screen proc itself, and then we require the screen proc to take some care when manipulating the screen proc functions pointers. The requirements are: 1) The screen proc must set the screen->proc pointer back to the value saved in its screen private before calling outside its module. 2a) If the screen proc wants to be remove itself from the chain, it must not manipulate screen->proc pointer again before returning. 2b) If the screen proc wants to remain in the chain, it must: 2b.1) Re-fetch the screen->proc pointer and store that in its screen private. This ensures that any changes to the chain will be preserved. 2b.2) Set screen->proc back to itself One key requirement here is that these steps must wrap not just any invocation of the nested screen->proc value, but must nest essentially any calls outside the current module. This ensures that other modules can reliably manipulate screen->proc wrapping using these same rules. For example, the animated cursor code in render has two macros, Wrap and Unwrap. #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) Unwrap takes the screen private (as), the screen (s) and the member name (elt), and restores screen->proc to that saved in the screen private. #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) Wrap takes the screen private (as), the screen (s), the member name (elt) and the wrapping function (func). It saves the current screen->proc value in the screen private, and then sets the screen->proc to the local wrapping function. Within each of these functions, there's a pretty simple pattern: Unwrap(as, pScreen, UnrealizeCursor); // Do local stuff, including possibly calling down through // pScreen->UnrealizeCursor Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor); The wrapping block handler is a bit different; it does the Unwrap, the local operations and then only re-Wraps if the hook is still required. Unwrap occurrs at the top of each function, just after entry, and Wrap occurrs at the bottom of each function, just before returning. */ typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; short x, y, width, height; short mmWidth, mmHeight; short numDepths; unsigned char rootDepth; DepthPtr allowedDepths; unsigned long rootVisual; unsigned long defColormap; short minInstalledCmaps, maxInstalledCmaps; char backingStoreSupport, saveUnderSupport; unsigned long whitePixel, blackPixel; GCPtr GCperDepth[MAXFORMATS + 1]; /* next field is a stipple to use as default in a GC. we don't build default tiles of all depths because they are likely to be of a color different from the default fg pixel, so we don't win anything by building a standard one. */ PixmapPtr PixmapPerDepth[1]; void *devPrivate; short numVisuals; VisualPtr visuals; WindowPtr root; ScreenSaverStuffRec screensaver; DevPrivateSetRec screenSpecificPrivates[PRIVATE_LAST]; /* Random screen procedures */ CloseScreenProcPtr CloseScreen; QueryBestSizeProcPtr QueryBestSize; SaveScreenProcPtr SaveScreen; GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; SourceValidateProcPtr SourceValidate; /* Window Procedures */ CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; PositionWindowProcPtr PositionWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; WindowExposuresProcPtr WindowExposures; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; RestackWindowProcPtr RestackWindow; /* Pixmap procedures */ CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; /* Font procedures */ RealizeFontProcPtr RealizeFont; UnrealizeFontProcPtr UnrealizeFont; /* Cursor Procedures */ ConstrainCursorProcPtr ConstrainCursor; ConstrainCursorHarderProcPtr ConstrainCursorHarder; CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; RealizeCursorProcPtr RealizeCursor; UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; SetCursorPositionProcPtr SetCursorPosition; /* GC procedures */ CreateGCProcPtr CreateGC; /* Colormap procedures */ CreateColormapProcPtr CreateColormap; DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; UninstallColormapProcPtr UninstallColormap; ListInstalledColormapsProcPtr ListInstalledColormaps; StoreColorsProcPtr StoreColors; ResolveColorProcPtr ResolveColor; /* Region procedures */ BitmapToRegionProcPtr BitmapToRegion; /* os layer procedures */ ScreenBlockHandlerProcPtr BlockHandler; ScreenWakeupHandlerProcPtr WakeupHandler; /* anybody can get a piece of this array */ PrivateRec *devPrivates; CreateScreenResourcesProcPtr CreateScreenResources; ModifyPixmapHeaderProcPtr ModifyPixmapHeader; GetWindowPixmapProcPtr GetWindowPixmap; SetWindowPixmapProcPtr SetWindowPixmap; GetScreenPixmapProcPtr GetScreenPixmap; SetScreenPixmapProcPtr SetScreenPixmap; NameWindowPixmapProcPtr NameWindowPixmap; PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */ unsigned int totalPixmapSize; MarkWindowProcPtr MarkWindow; MarkOverlappedWindowsProcPtr MarkOverlappedWindows; ConfigNotifyProcPtr ConfigNotify; MoveWindowProcPtr MoveWindow; ResizeWindowProcPtr ResizeWindow; GetLayerWindowProcPtr GetLayerWindow; HandleExposuresProcPtr HandleExposures; ReparentWindowProcPtr ReparentWindow; SetShapeProcPtr SetShape; ChangeBorderWidthProcPtr ChangeBorderWidth; MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; /* Device cursor procedures */ DeviceCursorInitializeProcPtr DeviceCursorInitialize; DeviceCursorCleanupProcPtr DeviceCursorCleanup; /* set it in driver side if X server can copy the framebuffer content. * Meant to be used together with '-background none' option, avoiding * 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; XYToWindowProcPtr XYToWindow; } ScreenRec; static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) { return (*(_pScreen)->BitmapToRegion) (pPix); /* no mi version?! */ } typedef struct _ScreenInfo { int imageByteOrder; int bitmapScanlineUnit; int bitmapScanlinePad; int bitmapBitOrder; int numPixmapFormats; 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 */ int height; /* total height of all screens together */ } ScreenInfo; extern _X_EXPORT ScreenInfo screenInfo; extern _X_EXPORT void InitOutput(ScreenInfo * /*pScreenInfo */ , int /*argc */ , char ** /*argv */ ); #endif /* SCREENINTSTRUCT_H */ xorg-server-1.17.1/include/swapreq.h0000664000175100017510000000726012274325511014276 00000000000000/************************************************************ Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ #ifndef SWAPREQ_H #define SWAPREQ_H 1 extern _X_EXPORT void SwapColorItem(xColorItem * /* pItem */ ); extern _X_EXPORT void SwapConnClientPrefix(xConnClientPrefix * /* pCCP */ ); #undef SWAPREQ_PROC #define SWAPREQ_PROC(func) extern _X_EXPORT int func(ClientPtr /* client */) SWAPREQ_PROC(SProcAllocColor); SWAPREQ_PROC(SProcAllocColorCells); SWAPREQ_PROC(SProcAllocColorPlanes); SWAPREQ_PROC(SProcAllocNamedColor); SWAPREQ_PROC(SProcChangeActivePointerGrab); SWAPREQ_PROC(SProcChangeGC); SWAPREQ_PROC(SProcChangeHosts); SWAPREQ_PROC(SProcChangeKeyboardControl); SWAPREQ_PROC(SProcChangeKeyboardMapping); SWAPREQ_PROC(SProcChangePointerControl); SWAPREQ_PROC(SProcChangeProperty); SWAPREQ_PROC(SProcChangeWindowAttributes); SWAPREQ_PROC(SProcClearToBackground); SWAPREQ_PROC(SProcConfigureWindow); SWAPREQ_PROC(SProcConvertSelection); SWAPREQ_PROC(SProcCopyArea); SWAPREQ_PROC(SProcCopyColormapAndFree); SWAPREQ_PROC(SProcCopyGC); SWAPREQ_PROC(SProcCopyPlane); SWAPREQ_PROC(SProcCreateColormap); SWAPREQ_PROC(SProcCreateCursor); SWAPREQ_PROC(SProcCreateGC); SWAPREQ_PROC(SProcCreateGlyphCursor); SWAPREQ_PROC(SProcCreatePixmap); SWAPREQ_PROC(SProcCreateWindow); SWAPREQ_PROC(SProcDeleteProperty); SWAPREQ_PROC(SProcFillPoly); SWAPREQ_PROC(SProcFreeColors); SWAPREQ_PROC(SProcGetImage); SWAPREQ_PROC(SProcGetMotionEvents); SWAPREQ_PROC(SProcGetProperty); SWAPREQ_PROC(SProcGrabButton); SWAPREQ_PROC(SProcGrabKey); SWAPREQ_PROC(SProcGrabKeyboard); SWAPREQ_PROC(SProcGrabPointer); SWAPREQ_PROC(SProcImageText); SWAPREQ_PROC(SProcInternAtom); SWAPREQ_PROC(SProcListFonts); SWAPREQ_PROC(SProcListFontsWithInfo); SWAPREQ_PROC(SProcLookupColor); SWAPREQ_PROC(SProcNoOperation); SWAPREQ_PROC(SProcOpenFont); SWAPREQ_PROC(SProcPoly); SWAPREQ_PROC(SProcPolyText); SWAPREQ_PROC(SProcPutImage); SWAPREQ_PROC(SProcQueryBestSize); SWAPREQ_PROC(SProcQueryColors); SWAPREQ_PROC(SProcQueryExtension); SWAPREQ_PROC(SProcRecolorCursor); SWAPREQ_PROC(SProcReparentWindow); SWAPREQ_PROC(SProcResourceReq); SWAPREQ_PROC(SProcRotateProperties); SWAPREQ_PROC(SProcSendEvent); SWAPREQ_PROC(SProcSetClipRectangles); SWAPREQ_PROC(SProcSetDashes); SWAPREQ_PROC(SProcSetFontPath); SWAPREQ_PROC(SProcSetInputFocus); SWAPREQ_PROC(SProcSetScreenSaver); SWAPREQ_PROC(SProcSetSelectionOwner); SWAPREQ_PROC(SProcSimpleReq); SWAPREQ_PROC(SProcStoreColors); SWAPREQ_PROC(SProcStoreNamedColor); SWAPREQ_PROC(SProcTranslateCoords); SWAPREQ_PROC(SProcUngrabButton); SWAPREQ_PROC(SProcUngrabKey); SWAPREQ_PROC(SProcWarpPointer); #undef SWAPREQ_PROC #endif /* SWAPREQ_H */ xorg-server-1.17.1/include/busfault.h0000664000175100017510000000311012274325511014427 00000000000000/* * Copyright © 2013 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. */ #ifndef _BUSFAULT_H_ #define _BUSFAULT_H_ #include #ifdef BUSFAULT #include typedef void (*busfault_notify_ptr) (void *context); struct busfault * busfault_register_mmap(void *addr, size_t size, busfault_notify_ptr notify, void *context); void busfault_unregister(struct busfault *busfault); void busfault_check(void); Bool busfault_init(void); #endif #endif /* _BUSFAULT_H_ */ xorg-server-1.17.1/include/xkbstr.h0000664000175100017510000005000012456571574014135 00000000000000/************************************************************ Copyright (c) 1993 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. ********************************************************/ #ifndef _XKBSTR_H_ #define _XKBSTR_H_ #include #define XkbCharToInt(v) ((int) ((v) & 0x80 ? ((v) | (~0xff)) : ((v) & 0x7f))) #define XkbIntTo2Chars(i, h, l) ((h) = (i >> 8) & 0xff, (l) = (i) & 0xff) #if defined(WORD64) && defined(UNSIGNEDBITFIELDS) #define Xkb2CharsToInt(h, l) ((int) ((h) & 0x80 ? \ (((h) << 8) | (l) | (~0xffff)) : \ (((h) << 8) | (l) & 0x7fff)) #else #define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l))) #endif /* * Common data structures and access macros */ typedef struct _XkbStateRec { unsigned char group; /* base + latched + locked */ /* FIXME: Why are base + latched short and not char?? */ unsigned short base_group; /* physically ... down? */ unsigned short latched_group; unsigned char locked_group; unsigned char mods; /* base + latched + locked */ unsigned char base_mods; /* physically down */ unsigned char latched_mods; unsigned char locked_mods; unsigned char compat_state; /* mods + group for core state */ /* grab mods = all depressed and latched mods, _not_ locked mods */ unsigned char grab_mods; /* grab mods minus internal mods */ unsigned char compat_grab_mods; /* grab mods + group for core state, but not locked groups if IgnoreGroupLocks set */ /* effective mods = all mods (depressed, latched, locked) */ unsigned char lookup_mods; /* effective mods minus internal mods */ unsigned char compat_lookup_mods; /* effective mods + group */ unsigned short ptr_buttons; /* core pointer buttons */ } XkbStateRec, *XkbStatePtr; #define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group) #define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group) typedef struct _XkbMods { unsigned char mask; /* effective mods */ unsigned char real_mods; unsigned short vmods; } XkbModsRec, *XkbModsPtr; typedef struct _XkbKTMapEntry { Bool active; unsigned char level; XkbModsRec mods; } XkbKTMapEntryRec, *XkbKTMapEntryPtr; typedef struct _XkbKeyType { XkbModsRec mods; unsigned char num_levels; unsigned char map_count; XkbKTMapEntryPtr map; XkbModsPtr preserve; Atom name; Atom *level_names; } XkbKeyTypeRec, *XkbKeyTypePtr; #define XkbNumGroups(g) ((g)&0x0f) #define XkbOutOfRangeGroupInfo(g) ((g)&0xf0) #define XkbOutOfRangeGroupAction(g) ((g)&0xc0) #define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4) #define XkbSetGroupInfo(g, w, n) (((w) & 0xc0) | (((n) & 3) << 4) | \ ((g) & 0x0f)) #define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f)) /* * Structures and access macros used primarily by the server */ typedef struct _XkbBehavior { unsigned char type; unsigned char data; } XkbBehavior; #define XkbAnyActionDataSize 7 typedef struct _XkbAnyAction { unsigned char type; unsigned char data[XkbAnyActionDataSize]; } XkbAnyAction; typedef struct _XkbModAction { unsigned char type; unsigned char flags; unsigned char mask; unsigned char real_mods; /* FIXME: Make this an int. */ unsigned char vmods1; unsigned char vmods2; } XkbModAction; #define XkbModActionVMods(a) ((short) (((a)->vmods1 << 8) | (a)->vmods2)) #define XkbSetModActionVMods(a,v) \ ((a)->vmods1 = (((v) >> 8) & 0xff), \ (a)->vmods2 = (v) & 0xff) typedef struct _XkbGroupAction { unsigned char type; unsigned char flags; /* FIXME: Make this an int. */ char group_XXX; } XkbGroupAction; #define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX)) #define XkbSASetGroup(a,g) ((a)->group_XXX=(g)) typedef struct _XkbISOAction { unsigned char type; unsigned char flags; unsigned char mask; unsigned char real_mods; /* FIXME: Make this an int. */ char group_XXX; unsigned char affect; unsigned char vmods1; unsigned char vmods2; } XkbISOAction; typedef struct _XkbPtrAction { unsigned char type; unsigned char flags; /* FIXME: Make this an int. */ unsigned char high_XXX; unsigned char low_XXX; unsigned char high_YYY; unsigned char low_YYY; } XkbPtrAction; #define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX)) #define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY)) #define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX)) #define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY)) typedef struct _XkbPtrBtnAction { unsigned char type; unsigned char flags; unsigned char count; unsigned char button; } XkbPtrBtnAction; typedef struct _XkbPtrDfltAction { unsigned char type; unsigned char flags; unsigned char affect; char valueXXX; } XkbPtrDfltAction; #define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX)) #define XkbSASetPtrDfltValue(a, c) ((a)->valueXXX = (c) & 0xff) typedef struct _XkbSwitchScreenAction { unsigned char type; unsigned char flags; char screenXXX; } XkbSwitchScreenAction; #define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX)) #define XkbSASetScreen(a, s) ((a)->screenXXX = (s) & 0xff) typedef struct _XkbCtrlsAction { unsigned char type; unsigned char flags; /* FIXME: Make this an int. */ unsigned char ctrls3; unsigned char ctrls2; unsigned char ctrls1; unsigned char ctrls0; } XkbCtrlsAction; #define XkbActionSetCtrls(a, c) ((a)->ctrls3 = ((c) >> 24) & 0xff, \ (a)->ctrls2 = ((c) >> 16) & 0xff, \ (a)->ctrls1 = ((c) >> 8) & 0xff, \ (a)->ctrls0 = (c) & 0xff) #define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\ (((unsigned int)(a)->ctrls2)<<16)|\ (((unsigned int)(a)->ctrls1)<<8)|\ ((unsigned int) (a)->ctrls0)) typedef struct _XkbMessageAction { unsigned char type; unsigned char flags; unsigned char message[6]; } XkbMessageAction; typedef struct _XkbRedirectKeyAction { unsigned char type; unsigned char new_key; unsigned char mods_mask; unsigned char mods; /* FIXME: Make this an int. */ unsigned char vmods_mask0; unsigned char vmods_mask1; unsigned char vmods0; unsigned char vmods1; } XkbRedirectKeyAction; #define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\ ((unsigned int)(a)->vmods0)) /* FIXME: This is blatantly not setting vmods. Yeesh. */ #define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ ((a)->vmods_mask0=((m)&0xff))) #define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\ ((unsigned int)(a)->vmods_mask0)) #define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ ((a)->vmods_mask0=((m)&0xff))) typedef struct _XkbDeviceBtnAction { unsigned char type; unsigned char flags; unsigned char count; unsigned char button; unsigned char device; } XkbDeviceBtnAction; typedef struct _XkbDeviceValuatorAction { unsigned char type; unsigned char device; unsigned char v1_what; unsigned char v1_ndx; unsigned char v1_value; unsigned char v2_what; unsigned char v2_ndx; unsigned char v2_value; } XkbDeviceValuatorAction; typedef union _XkbAction { XkbAnyAction any; XkbModAction mods; XkbGroupAction group; XkbISOAction iso; XkbPtrAction ptr; XkbPtrBtnAction btn; XkbPtrDfltAction dflt; XkbSwitchScreenAction screen; XkbCtrlsAction ctrls; XkbMessageAction msg; XkbRedirectKeyAction redirect; XkbDeviceBtnAction devbtn; XkbDeviceValuatorAction devval; unsigned char type; } XkbAction; typedef struct _XkbControls { unsigned char mk_dflt_btn; unsigned char num_groups; unsigned char groups_wrap; XkbModsRec internal; XkbModsRec ignore_lock; unsigned int enabled_ctrls; unsigned short repeat_delay; unsigned short repeat_interval; unsigned short slow_keys_delay; unsigned short debounce_delay; unsigned short mk_delay; unsigned short mk_interval; unsigned short mk_time_to_max; unsigned short mk_max_speed; short mk_curve; unsigned short ax_options; unsigned short ax_timeout; unsigned short axt_opts_mask; unsigned short axt_opts_values; unsigned int axt_ctrls_mask; unsigned int axt_ctrls_values; unsigned char per_key_repeat[XkbPerKeyBitArraySize]; } XkbControlsRec, *XkbControlsPtr; #define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask) #define XkbAX_NeedOption(c,w) ((c)->ax_options&(w)) #define XkbAX_NeedFeedback(c, w) (XkbAX_AnyFeedback((c)) && \ XkbAX_NeedOption((c), (w))) typedef struct _XkbServerMapRec { unsigned short num_acts; unsigned short size_acts; XkbAction *acts; XkbBehavior *behaviors; unsigned short *key_acts; #if defined(__cplusplus) || defined(c_plusplus) /* explicit is a C++ reserved word */ unsigned char *c_explicit; #else unsigned char *explicit; #endif unsigned char vmods[XkbNumVirtualMods]; unsigned short *vmodmap; } XkbServerMapRec, *XkbServerMapPtr; #define XkbSMKeyActionsPtr(m, k) (&(m)->acts[(m)->key_acts[(k)]]) /* * Structures and access macros used primarily by clients */ typedef struct _XkbSymMapRec { unsigned char kt_index[XkbNumKbdGroups]; unsigned char group_info; unsigned char width; unsigned short offset; } XkbSymMapRec, *XkbSymMapPtr; typedef struct _XkbClientMapRec { unsigned char size_types; unsigned char num_types; XkbKeyTypePtr types; unsigned short size_syms; unsigned short num_syms; KeySym *syms; XkbSymMapPtr key_sym_map; unsigned char *modmap; } XkbClientMapRec, *XkbClientMapPtr; #define XkbCMKeyGroupInfo(m, k) ((m)->key_sym_map[(k)].group_info) #define XkbCMKeyNumGroups(m, k) (XkbNumGroups((m)->key_sym_map[(k)].group_info)) #define XkbCMKeyGroupWidth(m, k, g) (XkbCMKeyType((m), (k), (g))->num_levels) #define XkbCMKeyGroupsWidth(m, k) ((m)->key_sym_map[(k)].width) #define XkbCMKeyTypeIndex(m, k, g) ((m)->key_sym_map[(k)].kt_index[(g) & 0x3]) #define XkbCMKeyType(m, k, g) (&(m)->types[XkbCMKeyTypeIndex((m), (k), (g))]) #define XkbCMKeyNumSyms(m, k) (XkbCMKeyGroupsWidth((m), (k)) * \ XkbCMKeyNumGroups((m), (k))) #define XkbCMKeySymsOffset(m, k) ((m)->key_sym_map[(k)].offset) #define XkbCMKeySymsPtr(m, k) (&(m)->syms[XkbCMKeySymsOffset((m), (k))]) /* * Compatibility structures and access macros */ typedef struct _XkbSymInterpretRec { KeySym sym; unsigned char flags; unsigned char match; unsigned char mods; unsigned char virtual_mod; XkbAnyAction act; } XkbSymInterpretRec, *XkbSymInterpretPtr; typedef struct _XkbCompatMapRec { XkbSymInterpretPtr sym_interpret; XkbModsRec groups[XkbNumKbdGroups]; unsigned short num_si; unsigned short size_si; } XkbCompatMapRec, *XkbCompatMapPtr; typedef struct _XkbIndicatorMapRec { unsigned char flags; /* FIXME: For some reason, interepretation of groups is wildly * different between which being base/latched/locked. */ unsigned char which_groups; unsigned char groups; unsigned char which_mods; XkbModsRec mods; unsigned int ctrls; } XkbIndicatorMapRec, *XkbIndicatorMapPtr; #define XkbIM_IsAuto(i) (!((i)->flags & XkbIM_NoAutomatic) && \ (((i)->which_groups&&(i)->groups)||\ ((i)->which_mods&&(i)->mods.mask)||\ (i)->ctrls)) #define XkbIM_InUse(i) ((i)->flags || (i)->which_groups || (i)->which_mods || \ (i)->ctrls) typedef struct _XkbIndicatorRec { unsigned long phys_indicators; XkbIndicatorMapRec maps[XkbNumIndicators]; } XkbIndicatorRec, *XkbIndicatorPtr; typedef struct _XkbKeyNameRec { char name[XkbKeyNameLength]; } XkbKeyNameRec, *XkbKeyNamePtr; typedef struct _XkbKeyAliasRec { char real[XkbKeyNameLength]; char alias[XkbKeyNameLength]; } XkbKeyAliasRec, *XkbKeyAliasPtr; /* * Names for everything */ typedef struct _XkbNamesRec { Atom keycodes; Atom geometry; Atom symbols; Atom types; Atom compat; Atom vmods[XkbNumVirtualMods]; Atom indicators[XkbNumIndicators]; Atom groups[XkbNumKbdGroups]; XkbKeyNamePtr keys; XkbKeyAliasPtr key_aliases; Atom *radio_groups; Atom phys_symbols; unsigned char num_keys; unsigned char num_key_aliases; unsigned short num_rg; } XkbNamesRec, *XkbNamesPtr; typedef struct _XkbGeometry *XkbGeometryPtr; /* * Tie it all together into one big keyboard description */ typedef struct _XkbDesc { unsigned int defined; unsigned short flags; unsigned short device_spec; KeyCode min_key_code; KeyCode max_key_code; XkbControlsPtr ctrls; XkbServerMapPtr server; XkbClientMapPtr map; XkbIndicatorPtr indicators; XkbNamesPtr names; XkbCompatMapPtr compat; XkbGeometryPtr geom; } XkbDescRec, *XkbDescPtr; #define XkbKeyKeyTypeIndex(d, k, g) (XkbCMKeyTypeIndex((d)->map, (k), (g))) #define XkbKeyKeyType(d, k, g) (XkbCMKeyType((d)->map, (k), (g))) #define XkbKeyGroupWidth(d, k, g) (XkbCMKeyGroupWidth((d)->map, (k), (g))) #define XkbKeyGroupsWidth(d, k) (XkbCMKeyGroupsWidth((d)->map, (k))) #define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k))) #define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k))) #define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k))) #define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k))) #define XkbKeySym(d, k, n) (XkbKeySymsPtr((d), (k))[(n)]) #define XkbKeySymEntry(d,k,sl,g) \ (XkbKeySym((d), (k), (XkbKeyGroupsWidth((d), (k)) * (g)) + (sl))) #define XkbKeyAction(d,k,n) \ (XkbKeyHasActions((d), (k)) ? & XkbKeyActionsPtr((d), (k))[(n)] : NULL) #define XkbKeyActionEntry(d,k,sl,g) \ (XkbKeyHasActions((d), (k)) ? \ XkbKeyAction((d), (k), ((XkbKeyGroupsWidth((d), (k)) * (g)) + (sl))) : \ NULL) #define XkbKeyHasActions(d, k) (!!(d)->server->key_acts[(k)]) #define XkbKeyNumActions(d, k) (XkbKeyHasActions((d), (k)) ? \ XkbKeyNumSyms((d), (k)) : 1) #define XkbKeyActionsPtr(d, k) (XkbSMKeyActionsPtr((d)->server, (k))) #define XkbKeycodeInRange(d, k) ((k) >= (d)->min_key_code && \ (k) <= (d)->max_key_code) #define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1) /* * The following structures can be used to track changes * to a keyboard device */ typedef struct _XkbMapChanges { unsigned short changed; KeyCode min_key_code; KeyCode max_key_code; unsigned char first_type; unsigned char num_types; KeyCode first_key_sym; unsigned char num_key_syms; KeyCode first_key_act; unsigned char num_key_acts; KeyCode first_key_behavior; unsigned char num_key_behaviors; KeyCode first_key_explicit; unsigned char num_key_explicit; KeyCode first_modmap_key; unsigned char num_modmap_keys; KeyCode first_vmodmap_key; unsigned char num_vmodmap_keys; unsigned char pad; unsigned short vmods; } XkbMapChangesRec, *XkbMapChangesPtr; typedef struct _XkbControlsChanges { unsigned int changed_ctrls; unsigned int enabled_ctrls_changes; Bool num_groups_changed; } XkbControlsChangesRec, *XkbControlsChangesPtr; typedef struct _XkbIndicatorChanges { unsigned int state_changes; unsigned int map_changes; } XkbIndicatorChangesRec, *XkbIndicatorChangesPtr; typedef struct _XkbNameChanges { unsigned int changed; unsigned char first_type; unsigned char num_types; unsigned char first_lvl; unsigned char num_lvls; unsigned char num_aliases; unsigned char num_rg; unsigned char first_key; unsigned char num_keys; unsigned short changed_vmods; unsigned long changed_indicators; unsigned char changed_groups; } XkbNameChangesRec, *XkbNameChangesPtr; typedef struct _XkbCompatChanges { unsigned char changed_groups; unsigned short first_si; unsigned short num_si; } XkbCompatChangesRec, *XkbCompatChangesPtr; typedef struct _XkbChanges { unsigned short device_spec; unsigned short state_changes; XkbMapChangesRec map; XkbControlsChangesRec ctrls; XkbIndicatorChangesRec indicators; XkbNameChangesRec names; XkbCompatChangesRec compat; } XkbChangesRec, *XkbChangesPtr; /* * These data structures are used to construct a keymap from * a set of components or to list components in the server * database. */ typedef struct _XkbComponentNames { char *keycodes; char *types; char *compat; char *symbols; char *geometry; } XkbComponentNamesRec, *XkbComponentNamesPtr; typedef struct _XkbComponentName { unsigned short flags; char *name; } XkbComponentNameRec, *XkbComponentNamePtr; typedef struct _XkbComponentList { int num_keymaps; int num_keycodes; int num_types; int num_compat; int num_symbols; int num_geometry; XkbComponentNamePtr keymaps; XkbComponentNamePtr keycodes; XkbComponentNamePtr types; XkbComponentNamePtr compat; XkbComponentNamePtr symbols; XkbComponentNamePtr geometry; } XkbComponentListRec, *XkbComponentListPtr; /* * The following data structures describe and track changes to a * non-keyboard extension device */ typedef struct _XkbDeviceLedInfo { unsigned short led_class; unsigned short led_id; unsigned int phys_indicators; unsigned int maps_present; unsigned int names_present; unsigned int state; Atom names[XkbNumIndicators]; XkbIndicatorMapRec maps[XkbNumIndicators]; } XkbDeviceLedInfoRec, *XkbDeviceLedInfoPtr; typedef struct _XkbDeviceInfo { char *name; Atom type; unsigned short device_spec; Bool has_own_state; unsigned short supported; unsigned short unsupported; unsigned short num_btns; XkbAction *btn_acts; unsigned short sz_leds; unsigned short num_leds; unsigned short dflt_kbd_fb; unsigned short dflt_led_fb; XkbDeviceLedInfoPtr leds; } XkbDeviceInfoRec, *XkbDeviceInfoPtr; #define XkbXI_DevHasBtnActs(d) ((d)->num_btns > 0 && (d)->btn_acts) #define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d) && (b) < (d)->num_btns) #define XkbXI_DevHasLeds(d) ((d)->num_leds > 0 && (d)->leds) typedef struct _XkbDeviceLedChanges { unsigned short led_class; unsigned short led_id; unsigned int defined; /* names or maps changed */ struct _XkbDeviceLedChanges *next; } XkbDeviceLedChangesRec, *XkbDeviceLedChangesPtr; typedef struct _XkbDeviceChanges { unsigned int changed; unsigned short first_btn; unsigned short num_btns; XkbDeviceLedChangesRec leds; } XkbDeviceChangesRec, *XkbDeviceChangesPtr; #endif /* _XKBSTR_H_ */ xorg-server-1.17.1/include/eventstr.h0000664000175100017510000002443112323563340014464 00000000000000/* * Copyright © 2009 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. * */ #ifndef EVENTSTR_H #define EVENTSTR_H #include /** * @file events.h * This file describes the event structures used internally by the X * server during event generation and event processing. * * When are internal events used? * Events from input devices are stored as internal events in the EQ and * processed as internal events until late in the processing cycle. Only then * do they switch to their respective wire events. */ /** * Event types. Used exclusively internal to the server, not visible on the * protocol. * * Note: Keep KeyPress to Motion aligned with the core events. * Keep ET_Raw* in the same order as KeyPress - Motion */ enum EventType { ET_KeyPress = 2, ET_KeyRelease, ET_ButtonPress, ET_ButtonRelease, ET_Motion, ET_TouchBegin, ET_TouchUpdate, ET_TouchEnd, ET_TouchOwnership, ET_Enter, ET_Leave, ET_FocusIn, ET_FocusOut, ET_ProximityIn, ET_ProximityOut, ET_DeviceChanged, ET_Hierarchy, ET_DGAEvent, ET_RawKeyPress, ET_RawKeyRelease, ET_RawButtonPress, ET_RawButtonRelease, ET_RawMotion, ET_RawTouchBegin, ET_RawTouchUpdate, ET_RawTouchEnd, ET_XQuartz, ET_BarrierHit, ET_BarrierLeave, ET_Internal = 0xFF /* First byte */ }; /** * Used for ALL input device events internal in the server until * copied into the matching protocol event. * * Note: We only use the device id because the DeviceIntPtr may become invalid while * the event is in the EQ. */ struct _DeviceEvent { unsigned char header; /**< Always ET_Internal */ enum EventType type; /**< One of EventType */ int length; /**< Length in bytes */ Time time; /**< Time in ms */ int deviceid; /**< Device to post this event for */ int sourceid; /**< The physical source device */ union { uint32_t button; /**< Button number (also used in pointer emulating touch events) */ uint32_t key; /**< Key code */ } detail; uint32_t touchid; /**< Touch ID (client_id) */ int16_t root_x; /**< Pos relative to root window in integral data */ float root_x_frac; /**< Pos relative to root window in frac part */ int16_t root_y; /**< Pos relative to root window in integral part */ float root_y_frac; /**< Pos relative to root window in frac part */ uint8_t buttons[(MAX_BUTTONS + 7) / 8]; /**< Button mask */ struct { uint8_t mask[(MAX_VALUATORS + 7) / 8];/**< Valuator mask */ uint8_t mode[(MAX_VALUATORS + 7) / 8];/**< Valuator mode (Abs or Rel)*/ double data[MAX_VALUATORS]; /**< Valuator data */ } valuators; struct { uint32_t base; /**< XKB base modifiers */ uint32_t latched; /**< XKB latched modifiers */ uint32_t locked; /**< XKB locked modifiers */ uint32_t effective;/**< XKB effective modifiers */ } mods; struct { uint8_t base; /**< XKB base group */ uint8_t latched; /**< XKB latched group */ uint8_t locked; /**< XKB locked group */ uint8_t effective;/**< XKB effective group */ } group; Window root; /**< Root window of the event */ int corestate; /**< Core key/button state BEFORE the event */ int key_repeat; /**< Internally-generated key repeat event */ uint32_t flags; /**< Flags to be copied into the generated event */ uint32_t resource; /**< Touch event resource, only for TOUCH_REPLAYING */ }; /** * Generated internally whenever a touch ownership chain changes - an owner * has accepted or rejected a touch, or a grab/event selection in the delivery * chain has been removed. */ struct _TouchOwnershipEvent { unsigned char header; /**< Always ET_Internal */ enum EventType type; /**< ET_TouchOwnership */ int length; /**< Length in bytes */ Time time; /**< Time in ms */ int deviceid; /**< Device to post this event for */ int sourceid; /**< The physical source device */ uint32_t touchid; /**< Touch ID (client_id) */ uint8_t reason; /**< ::XIAcceptTouch, ::XIRejectTouch */ uint32_t resource; /**< Provoking grab or event selection */ uint32_t flags; /**< Flags to be copied into the generated event */ }; /* Flags used in DeviceChangedEvent to signal if the slave has changed */ #define DEVCHANGE_SLAVE_SWITCH 0x2 /* Flags used in DeviceChangedEvent to signal whether the event was a * pointer event or a keyboard event */ #define DEVCHANGE_POINTER_EVENT 0x4 #define DEVCHANGE_KEYBOARD_EVENT 0x8 /* device capabilities changed */ #define DEVCHANGE_DEVICE_CHANGE 0x10 /** * Sent whenever a device's capabilities have changed. */ struct _DeviceChangedEvent { unsigned char header; /**< Always ET_Internal */ enum EventType type; /**< ET_DeviceChanged */ int length; /**< Length in bytes */ Time time; /**< Time in ms */ int deviceid; /**< Device whose capabilities have changed */ int flags; /**< Mask of ::HAS_NEW_SLAVE, ::POINTER_EVENT, ::KEYBOARD_EVENT */ int masterid; /**< MD when event was generated */ int sourceid; /**< The device that caused the change */ struct { int num_buttons; /**< Number of buttons */ Atom names[MAX_BUTTONS];/**< Button names */ } buttons; int num_valuators; /**< Number of axes */ struct { uint32_t min; /**< Minimum value */ uint32_t max; /**< Maximum value */ double value; /**< Current value */ /* FIXME: frac parts of min/max */ uint32_t resolution; /**< Resolution counts/m */ uint8_t mode; /**< Relative or Absolute */ Atom name; /**< Axis name */ ScrollInfo scroll; /**< Smooth scrolling info */ } valuators[MAX_VALUATORS]; struct { int min_keycode; int max_keycode; } keys; }; #if XFreeXDGA /** * DGAEvent, used by DGA to intercept and emulate input events. */ struct _DGAEvent { unsigned char header; /**< Always ET_Internal */ enum EventType type; /**< ET_DGAEvent */ int length; /**< Length in bytes */ Time time; /**< Time in ms */ int subtype; /**< KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify */ int detail; /**< Button number or key code */ int dx; /**< Relative x coordinate */ int dy; /**< Relative y coordinate */ int screen; /**< Screen number this event applies to */ uint16_t state; /**< Core modifier/button state */ }; #endif /** * Raw event, contains the data as posted by the device. */ struct _RawDeviceEvent { unsigned char header; /**< Always ET_Internal */ enum EventType type; /**< ET_Raw */ int length; /**< Length in bytes */ Time time; /**< Time in ms */ int deviceid; /**< Device to post this event for */ int sourceid; /**< The physical source device */ union { uint32_t button; /**< Button number */ uint32_t key; /**< Key code */ } detail; struct { uint8_t mask[(MAX_VALUATORS + 7) / 8];/**< Valuator mask */ double data[MAX_VALUATORS]; /**< Valuator data */ double data_raw[MAX_VALUATORS]; /**< Valuator data as posted */ } valuators; 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 { unsigned char header; /**< Always ET_Internal */ enum EventType type; /**< Always ET_XQuartz */ int length; /**< Length in bytes */ Time time; /**< Time in ms. */ int subtype; /**< Subtype defined by XQuartz DDX */ uint32_t data[XQUARTZ_EVENT_MAXARGS]; /**< Up to 5 32bit values passed to handler */ }; #endif /** * Event type used inside the X server for input event * processing. */ union _InternalEvent { struct { unsigned char header; /**< Always ET_Internal */ enum EventType type; /**< One of ET_* */ int length; /**< Length in bytes */ Time time; /**< Time in ms. */ } any; DeviceEvent device_event; DeviceChangedEvent changed_event; TouchOwnershipEvent touch_ownership_event; BarrierEvent barrier_event; #if XFreeXDGA DGAEvent dga_event; #endif RawDeviceEvent raw_event; #ifdef XQUARTZ XQuartzEvent xquartz_event; #endif }; #endif xorg-server-1.17.1/include/ptrveloc.h0000664000175100017510000001260212274325511014446 00000000000000/* * * Copyright © 2006-2011 Simon Thum simon dot thum at gmx dot de * * 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 POINTERVELOCITY_H #define POINTERVELOCITY_H #include /* constants for acceleration profiles */ #define AccelProfileNone -1 #define AccelProfileClassic 0 #define AccelProfileDeviceSpecific 1 #define AccelProfilePolynomial 2 #define AccelProfileSmoothLinear 3 #define AccelProfileSimple 4 #define AccelProfilePower 5 #define AccelProfileLinear 6 #define AccelProfileSmoothLimited 7 #define AccelProfileLAST AccelProfileSmoothLimited /* fwd */ struct _DeviceVelocityRec; /** * profile * returns actual acceleration depending on velocity, acceleration control,... */ typedef double (*PointerAccelerationProfileFunc) (DeviceIntPtr dev, struct _DeviceVelocityRec * vel, double velocity, double threshold, double accelCoeff); /** * a motion history, with just enough information to * calc mean velocity and decide which motion was along * a more or less straight line */ typedef struct _MotionTracker { double dx, dy; /* accumulated delta for each axis */ int time; /* time of creation */ int dir; /* initial direction bitfield */ } MotionTracker, *MotionTrackerPtr; /** * Contains all data needed to implement mouse ballistics */ typedef struct _DeviceVelocityRec { MotionTrackerPtr tracker; int num_tracker; int cur_tracker; /* current index */ double velocity; /* velocity as guessed by algorithm */ double last_velocity; /* previous velocity estimate */ double last_dx; /* last time-difference */ double last_dy; /* phase of last/current estimate */ double corr_mul; /* config: multiply this into velocity */ double const_acceleration; /* config: (recipr.) const deceleration */ double min_acceleration; /* config: minimum acceleration */ short reset_time; /* config: reset non-visible state after # ms */ short use_softening; /* config: use softening of mouse values */ double max_rel_diff; /* config: max. relative difference */ double max_diff; /* config: max. difference */ int initial_range; /* config: max. offset used as initial velocity */ Bool average_accel; /* config: average acceleration over velocity */ PointerAccelerationProfileFunc Profile; PointerAccelerationProfileFunc deviceSpecificProfile; void *profile_private; /* extended data, see SetAccelerationProfile() */ struct { /* to be able to query this information */ int profile_number; } statistics; } DeviceVelocityRec, *DeviceVelocityPtr; /** * contains the run-time data for the predictable scheme, that is, a * DeviceVelocityPtr and the property handlers. */ typedef struct _PredictableAccelSchemeRec { DeviceVelocityPtr vel; long *prop_handlers; int num_prop_handlers; } PredictableAccelSchemeRec, *PredictableAccelSchemePtr; extern _X_EXPORT void InitVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT void 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); extern _X_EXPORT int 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); 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); #endif /* POINTERVELOCITY_H */ xorg-server-1.17.1/include/validate.h0000664000175100017510000000275312274325511014407 00000000000000 /* Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef VALIDATE_H #define VALIDATE_H #include "miscstruct.h" #include "regionstr.h" typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap, VTBroken } VTKind; /* union _Validate is now device dependent; see mivalidate.h for an example */ typedef union _Validate *ValidatePtr; #define UnmapValData ((ValidatePtr)1) #endif /* VALIDATE_H */ xorg-server-1.17.1/include/xkbfile.h0000664000175100017510000002407112456571574014255 00000000000000/************************************************************ Copyright (c) 1994 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. ********************************************************/ #ifndef _XKBFILE_H_ #define _XKBFILE_H_ 1 #include "xkbstr.h" /***====================================================================***/ #define XkbXKMFile 0 #define XkbCFile 1 #define XkbXKBFile 2 #define XkbMessage 3 #define XkbMapDefined (1<<0) #define XkbStateDefined (1<<1) typedef void (*XkbFileAddOnFunc) (FILE * /* file */ , XkbDescPtr /* result */ , Bool /* topLevel */ , Bool /* showImplicit */ , int /* fileSection */ , void * /* priv */ ); /***====================================================================***/ #define _XkbSuccess 0 #define _XkbErrMissingNames 1 #define _XkbErrMissingTypes 2 #define _XkbErrMissingReqTypes 3 #define _XkbErrMissingSymbols 4 #define _XkbErrMissingVMods 5 #define _XkbErrMissingIndicators 6 #define _XkbErrMissingCompatMap 7 #define _XkbErrMissingSymInterps 8 #define _XkbErrMissingGeometry 9 #define _XkbErrIllegalDoodad 10 #define _XkbErrIllegalTOCType 11 #define _XkbErrIllegalContents 12 #define _XkbErrEmptyFile 13 #define _XkbErrFileNotFound 14 #define _XkbErrFileCannotOpen 15 #define _XkbErrBadValue 16 #define _XkbErrBadMatch 17 #define _XkbErrBadTypeName 18 #define _XkbErrBadTypeWidth 19 #define _XkbErrBadFileType 20 #define _XkbErrBadFileVersion 21 #define _XkbErrBadFileFormat 22 #define _XkbErrBadAlloc 23 #define _XkbErrBadLength 24 #define _XkbErrXReqFailure 25 #define _XkbErrBadImplementation 26 /***====================================================================***/ _XFUNCPROTOBEGIN extern _X_EXPORT char *XkbIndentText(unsigned /* size */ ); extern _X_EXPORT char *XkbAtomText(Atom /* atm */ , unsigned /* format */ ); extern _X_EXPORT char *XkbKeysymText(KeySym /* sym */ , unsigned /* format */ ); extern _X_EXPORT char *XkbStringText(char * /* str */ , unsigned /* format */ ); extern _X_EXPORT char *XkbKeyNameText(char * /* name */ , unsigned /* format */ ); extern _X_EXPORT char *XkbModIndexText(unsigned /* ndx */ , unsigned /* format */ ); extern _X_EXPORT char *XkbModMaskText(unsigned /* mask */ , unsigned /* format */ ); extern _X_EXPORT char *XkbVModIndexText(XkbDescPtr /* xkb */ , unsigned /* ndx */ , unsigned /* format */ ); extern _X_EXPORT char *XkbVModMaskText(XkbDescPtr /* xkb */ , unsigned /* modMask */ , unsigned /* mask */ , unsigned /* format */ ); extern _X_EXPORT char *XkbConfigText(unsigned /* config */ , unsigned /* format */ ); extern _X_EXPORT const char *XkbSIMatchText(unsigned /* type */ , unsigned /* format */ ); extern _X_EXPORT char *XkbIMWhichStateMaskText(unsigned /* use_which */ , unsigned /* format */ ); extern _X_EXPORT char *XkbControlsMaskText(unsigned /* ctrls */ , unsigned /* format */ ); extern _X_EXPORT char *XkbGeomFPText(int /* val */ , unsigned /* format */ ); extern _X_EXPORT char *XkbDoodadTypeText(unsigned /* type */ , unsigned /* format */ ); extern _X_EXPORT const char *XkbActionTypeText(unsigned /* type */ , unsigned /* format */ ); extern _X_EXPORT char *XkbActionText(XkbDescPtr /* xkb */ , XkbAction * /* action */ , unsigned /* format */ ); extern _X_EXPORT char *XkbBehaviorText(XkbDescPtr /* xkb */ , XkbBehavior * /* behavior */ , unsigned /* format */ ); /***====================================================================***/ #define _XkbKSLower (1<<0) #define _XkbKSUpper (1<<1) #define XkbKSIsLower(k) (_XkbKSCheckCase(k)&_XkbKSLower) #define XkbKSIsUpper(k) (_XkbKSCheckCase(k)&_XkbKSUpper) #define XkbKSIsKeypad(k) (((k)>=XK_KP_Space)&&((k)<=XK_KP_Equal)) #define XkbKSIsDeadKey(k) \ (((k)>=XK_dead_grave)&&((k)<=XK_dead_semivoiced_sound)) extern _X_EXPORT unsigned _XkbKSCheckCase(KeySym /* sym */ ); extern _X_EXPORT int XkbFindKeycodeByName(XkbDescPtr /* xkb */ , char * /* name */ , Bool /* use_aliases */ ); /***====================================================================***/ extern _X_EXPORT Atom XkbInternAtom(char * /* name */ , Bool /* onlyIfExists */ ); /***====================================================================***/ #ifdef _XKBGEOM_H_ #define XkbDW_Unknown 0 #define XkbDW_Doodad 1 #define XkbDW_Section 2 typedef struct _XkbDrawable { int type; int priority; union { XkbDoodadPtr doodad; XkbSectionPtr section; } u; struct _XkbDrawable *next; } XkbDrawableRec, *XkbDrawablePtr; #endif /***====================================================================***/ extern _X_EXPORT unsigned XkbConvertGetByNameComponents(Bool /* toXkm */ , unsigned /* orig */ ); extern _X_EXPORT Bool XkbNameMatchesPattern(char * /* name */ , char * /* pattern */ ); /***====================================================================***/ extern _X_EXPORT Bool XkbWriteXKBKeycodes(FILE * /* file */ , XkbDescPtr /* result */ , Bool /* topLevel */ , Bool /* showImplicit */ , XkbFileAddOnFunc /* addOn */ , void * /* priv */ ); extern _X_EXPORT Bool XkbWriteXKBKeyTypes(FILE * /* file */ , XkbDescPtr /* result */ , Bool /* topLevel */ , Bool /* showImplicit */ , XkbFileAddOnFunc /* addOn */ , void * /* priv */ ); extern _X_EXPORT Bool XkbWriteXKBCompatMap(FILE * /* file */ , XkbDescPtr /* result */ , Bool /* topLevel */ , Bool /* showImplicit */ , XkbFileAddOnFunc /* addOn */ , void * /* priv */ ); extern _X_EXPORT Bool XkbWriteXKBSymbols(FILE * /* file */ , XkbDescPtr /* result */ , Bool /* topLevel */ , Bool /* showImplicit */ , XkbFileAddOnFunc /* addOn */ , void * /* priv */ ); extern _X_EXPORT Bool XkbWriteXKBGeometry(FILE * /* file */ , XkbDescPtr /* result */ , Bool /* topLevel */ , Bool /* showImplicit */ , XkbFileAddOnFunc /* addOn */ , void * /* priv */ ); extern _X_EXPORT Bool XkbWriteXKBKeymapForNames(FILE * /* file */ , XkbComponentNamesPtr /* names */ , XkbDescPtr /* xkb */ , unsigned /* want */ , unsigned /* need */ ); /***====================================================================***/ extern _X_EXPORT Bool XkmProbe(FILE * /* file */ ); extern _X_EXPORT unsigned XkmReadFile(FILE * /* file */ , unsigned /* need */ , unsigned /* want */ , XkbDescPtr * /* result */ ); _XFUNCPROTOEND #endif /* _XKBFILE_H_ */ xorg-server-1.17.1/include/dix-config.h.in0000664000175100017510000002527312415476143015261 00000000000000/* dix-config.h.in: not at all generated. -*- c -*- */ #ifndef _DIX_CONFIG_H_ #define _DIX_CONFIG_H_ /* Support BigRequests extension */ #undef BIGREQS /* Builder address */ #undef BUILDERADDR /* Operating System Name */ #undef OSNAME /* Operating System Vendor */ #undef OSVENDOR /* Builder string */ #undef BUILDERSTRING /* Default font path */ #undef COMPILEDDEFAULTFONTPATH /* Miscellaneous server configuration files path */ #undef SERVER_MISC_CONFIG_PATH /* Support Composite Extension */ #undef COMPOSITE /* Support Damage extension */ #undef DAMAGE /* Use OsVendorVErrorF */ #undef DDXOSVERRORF /* Use ddxBeforeReset */ #undef DDXBEFORERESET /* Build DPMS extension */ #undef DPMSExtension /* Build DRI3 extension */ #undef DRI3 /* Build GLX extension */ #undef GLXEXT /* Build GLX DRI loader */ #undef GLX_DRI /* Path to DRI drivers */ #undef DRI_DRIVER_PATH /* Support XDM-AUTH*-1 */ #undef HASXDMAUTH /* Support SHM */ #undef HAS_SHM /* Has backtrace support */ #undef HAVE_BACKTRACE /* Has libunwind support */ #undef HAVE_LIBUNWIND /* Define to 1 if you have the header file. */ #undef HAVE_BYTESWAP_H /* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT /* Define to 1 if you have the header file. */ #undef HAVE_DBM_H /* Define to 1 if you have the declaration of `program_invocation_short_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Have execinfo.h */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `ffs' function. */ #undef HAVE_FFS /* Define to 1 if you have the `getdtablesize' function. */ #undef HAVE_GETDTABLESIZE /* Define to 1 if you have the `getifaddrs' function. */ #undef HAVE_GETIFADDRS /* Define to 1 if you have the `getpeereid' function. */ #undef HAVE_GETPEEREID /* Define to 1 if you have the `getpeerucred' function. */ #undef HAVE_GETPEERUCRED /* Define to 1 if you have the `getprogname' function. */ #undef HAVE_GETPROGNAME /* Define to 1 if you have the `getzoneid' function. */ #undef HAVE_GETZONEID /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Have Quartz */ #undef XQUARTZ /* Support application updating through sparkle. */ #undef XQUARTZ_SPARKLE /* Prefix to use for bundle identifiers */ #undef BUNDLE_ID_PREFIX /* Build a standalone xpbproxy */ #undef STANDALONE_XPBPROXY /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the libdispatch (GCD) available */ #undef HAVE_LIBDISPATCH /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_AGPGART_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_APM_BIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FB_H /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_NDBM_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_RPCSVC_DBM_H /* Define to use libc SHA1 functions */ #undef HAVE_SHA1_IN_LIBC /* 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 /* Define to 1 if you have the `shmctl64' function. */ #undef HAVE_SHMCTL64 /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if libsystemd-daemon is available */ #undef HAVE_SYSTEMD_DAEMON /* Define to 1 if SYSV IPC is available */ #undef HAVE_SYSV_IPC /* Define to 1 if you have the header file. */ #undef HAVE_SYS_AGPIO_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTSNAME_H /* Define to 1 if you have the header file. */ #undef HAVE_TSLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Have /dev/urandom */ #undef HAVE_URANDOM /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* Support IPv6 for TCP connections */ #undef IPv6 /* Support os-specific local connections */ #undef LOCALCONN /* Support MIT-SHM Extension */ #undef MITSHM /* Enable some debugging code */ #undef DEBUG /* Name of package */ #undef PACKAGE /* Internal define for Xinerama */ #undef PANORAMIX /* Support Present extension */ #undef PRESENT /* Overall prefix */ #undef PROJECTROOT /* Support RANDR extension */ #undef RANDR /* Support Record extension */ #undef XRECORD /* Support RENDER extension */ #undef RENDER /* Support X resource extension */ #undef RES /* Support client ID tracking in X resource extension */ #undef CLIENTIDS /* Support MIT-SCREEN-SAVER extension */ #undef SCREENSAVER /* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */ #undef SECURE_RPC /* Support SHAPE extension */ #undef SHAPE /* Where to install Xorg.bin and Xorg.wrap */ #undef SUID_WRAPPER_DIR /* Define to 1 on systems derived from System V Release 4 */ #undef SVR4 /* sysconfdir */ #undef SYSCONFDIR /* Support TCP socket connections */ #undef TCPCONN /* Enable touchscreen support */ #undef TOUCHSCREEN /* Support tslib touchscreen abstraction library */ #undef TSLIB /* Support UNIX socket connections */ #undef UNIXCONN /* Define to use byteswap macros from */ #undef USE_SYS_ENDIAN_H /* unaligned word accesses behave as expected */ #undef WORKING_UNALIGNED_INT /* Build X string registry */ #undef XREGISTRY /* Build X-ACE extension */ #undef XACE /* Build SELinux extension */ #undef XSELINUX /* Support XCMisc extension */ #undef XCMISC /* Build Security extension */ #undef XCSECURITY /* Support Xdmcp */ #undef XDMCP /* Build XFree86 BigFont extension */ #undef XF86BIGFONT /* Support XFree86 Video Mode extension */ #undef XF86VIDMODE /* Support XFixes extension */ #undef XFIXES /* Build XDGA support */ #undef XFreeXDGA /* Support Xinerama extension */ #undef XINERAMA /* Vendor release */ #undef XORG_RELEASE /* Current Xorg version */ #undef XORG_VERSION_CURRENT /* Xorg release date */ #undef XORG_DATE /* Build Xv Extension */ #undef XvExtension /* Build XvMC Extension */ #undef XvMCExtension /* Support XSync extension */ #undef XSYNC /* Support XTest extension */ #undef XTEST /* Support Xv extension */ #undef XV /* Support DRI extension */ #undef XF86DRI /* Build DRI2 extension */ #undef DRI2 /* Build DBE support */ #undef DBE /* Vendor name */ #undef XVENDORNAME /* Enable GNU and other extensions to the C environment for GLIBC */ #undef _GNU_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Build Rootless code */ #undef ROOTLESS /* Define to 1 if unsigned long is 64 bits. */ #undef _XSERVER64 /* System is BSD-like */ #undef CSRG_BASED /* Define to 1 if `struct sockaddr_in' has a `sin_len' member */ #undef BSD44SOCKETS /* Support D-Bus */ #undef HAVE_DBUS /* 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 /* Use udev_enumerate_add_match_tag() */ #undef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG /* Enable D-Bus core */ #undef NEED_DBUS /* Support HAL for hotplug */ #undef CONFIG_HAL /* Enable systemd-logind integration */ #undef SYSTEMD_LOGIND 1 /* Have a monotonic clock from clock_gettime() */ #undef MONOTONIC_CLOCK /* Define to 1 if the DTrace Xserver provider probes should be built in */ #undef XSERVER_DTRACE /* Define to 16-bit byteswap macro */ #undef bswap_16 /* Define to 32-bit byteswap macro */ #undef bswap_32 /* Define to 64-bit byteswap macro */ #undef bswap_64 /* Define to 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 /* Correctly set _XSERVER64 for OSX fat binaries */ #ifdef __APPLE__ #include "dix-config-apple-verbatim.h" #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Defined if needed to expose struct msghdr.msg_control */ #undef _XOPEN_SOURCE /* Have support for X shared memory fence library (xshmfence) */ #undef HAVE_XSHMFENCE /* Use XTrans FD passing support */ #undef XTRANS_SEND_FDS /* Wrap SIGBUS to catch MIT-SHM faults */ #undef BUSFAULT /* Directory for shared memory temp files */ #undef SHMDIR /* Don't let Xdefs.h define 'pointer' */ #define _XTYPEDEF_POINTER 1 /* Don't let XIproto define 'Pointer' */ #define _XITYPEDEF_POINTER 1 /* Ask fontsproto to make font path element names const */ #define FONT_PATH_ELEMENT_NAME_CONST 1 /* Build GLAMOR */ #undef GLAMOR /* Build glamor's GBM-based EGL support */ #undef GLAMOR_HAS_GBM /* byte order */ #undef X_BYTE_ORDER /* Listen on TCP socket */ #undef LISTEN_TCP /* Listen on Unix socket */ #undef LISTEN_UNIX /* Listen on local socket */ #undef LISTEN_LOCAL #endif /* _DIX_CONFIG_H_ */ xorg-server-1.17.1/include/colormapst.h0000664000175100017510000000774112456571574015021 00000000000000/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. */ #ifndef CMAPSTRUCT_H #define CMAPSTRUCT_H 1 #include "colormap.h" #include "screenint.h" #include "privates.h" /* Shared color -- the color is used by AllocColorPlanes */ typedef struct { unsigned short color; short refcnt; } SHAREDCOLOR; /* LOCO -- a local color for a PseudoColor cell. DirectColor maps always * use the first value (called red) in the structure. What channel they * are really talking about depends on which map they are in. */ typedef struct { unsigned short red, green, blue; } LOCO; /* SHCO -- a shared color for a PseudoColor cell. Used with AllocColorPlanes. * DirectColor maps always use the first value (called red) in the structure. * What channel they are really talking about depends on which map they * are in. */ typedef struct { SHAREDCOLOR *red, *green, *blue; } SHCO; /* color map entry */ typedef struct _CMEntry { union { LOCO local; SHCO shco; } co; short refcnt; Bool fShared; } Entry; /* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor * only needs one cell table, we arbitrarily pick red. We keep track * of that table with freeRed, numPixelsRed, and clientPixelsRed */ typedef struct _ColormapRec { VisualPtr pVisual; short class; /* PseudoColor or DirectColor */ XID mid; /* client's name for colormap */ ScreenPtr pScreen; /* screen map is associated with */ short flags; /* 1 = IsDefault * 2 = AllAllocated */ int freeRed; int freeGreen; int freeBlue; int *numPixelsRed; int *numPixelsGreen; int *numPixelsBlue; Pixel **clientPixelsRed; Pixel **clientPixelsGreen; Pixel **clientPixelsBlue; Entry *red; Entry *green; Entry *blue; PrivateRec *devPrivates; } ColormapRec; #endif /* COLORMAP_H */ xorg-server-1.17.1/include/misc.h0000664000175100017510000003212312456571574013561 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. Copyright 1992, 1993 Data General Corporation; Copyright 1992, 1993 OMRON Corporation 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 neither the name OMRON or DATA GENERAL be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission of the party whose name is to be used. Neither OMRON or DATA GENERAL make any representation about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OMRON OR DATA GENERAL 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. ******************************************************************/ #ifndef MISC_H #define MISC_H 1 /* * X internal definitions * */ #include #include #include #include #include #include #include #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 #define EXTENSION_EVENT_BASE 64 #define EXTENSION_BASE 128 typedef uint32_t ATOM; #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif #ifndef _XTYPEDEF_CALLBACKLISTPTR typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */ #define _XTYPEDEF_CALLBACKLISTPTR #endif typedef struct _xReq *xReqPtr; #include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */ #include /* for bcopy, bzero, and bcmp */ #define NullBox ((BoxPtr)0) #define MILLI_PER_MIN (1000 * 60) #define MILLI_PER_SECOND (1000) /* this next is used with None and ParentRelative to tell PaintWin() what to use to paint the background. Also used in the macro IS_VALID_PIXMAP */ #define USE_BACKGROUND_PIXEL 3 #define USE_BORDER_PIXEL 3 /* byte swap a 32-bit literal */ static inline uint32_t lswapl(uint32_t x) { return ((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | ((x >> 24) & 0xff); } /* byte swap a 16-bit literal */ static inline uint16_t lswaps(uint16_t x) { return (uint16_t)((x & 0xff) << 8) | ((x >> 8) & 0xff); } #undef min #undef max #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) /* abs() is a function, not a macro; include the file declaring * it in case we haven't done that yet. */ #include #define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0)) /* this assumes b > 0 */ #define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b) /* * return the least significant bit in x which is set * * This works on 1's complement and 2's complement machines. * If you care about the extra instruction on 2's complement * machines, change to ((x) & (-(x))) */ #define lowbit(x) ((x) & (~(x) + 1)) /* XXX Not for modules */ #include #if !defined(MAXSHORT) || !defined(MINSHORT) || \ !defined(MAXINT) || !defined(MININT) /* * Some implementations #define these through , so preclude * #include'ing it later. */ #include #undef MAXSHORT #define MAXSHORT SHRT_MAX #undef MINSHORT #define MINSHORT SHRT_MIN #undef MAXINT #define MAXINT INT_MAX #undef MININT #define MININT INT_MIN #include #include #include /* for fopen, etc... */ #endif #ifndef PATH_MAX #include #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else #define PATH_MAX 1024 #endif #endif #endif /** * Calculate the number of bytes needed to hold bits. * @param bits The minimum number of bits needed. * @return The number of bytes needed to hold bits. */ static inline int bits_to_bytes(const int bits) { return ((bits + 7) >> 3); } /** * Calculate the number of 4-byte units needed to hold the given number of * bytes. * @param bytes The minimum number of bytes needed. * @return The number of 4-byte units needed to hold bytes. */ static inline int bytes_to_int32(const int bytes) { return (((bytes) + 3) >> 2); } /** * Calculate the number of bytes (in multiples of 4) needed to hold bytes. * @param bytes The minimum number of bytes needed. * @return The closest multiple of 4 that is equal or higher than bytes. */ static inline int 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. * * @return A value less than 0 if a is less than b, 0 if a is equal to b, * or a value greater than 0 */ static inline int version_compare(uint32_t a_major, uint32_t a_minor, uint32_t b_major, uint32_t b_minor) { if (a_major > b_major) return 1; if (a_major < b_major) return -1; if (a_minor > b_minor) return 1; if (a_minor < b_minor) return -1; return 0; } /* some macros to help swap requests, replies, and events */ #define LengthRestB(stuff) \ ((client->req_len << 2) - sizeof(*stuff)) #define LengthRestS(stuff) \ ((client->req_len << 1) - (sizeof(*stuff) >> 1)) #define LengthRestL(stuff) \ (client->req_len - (sizeof(*stuff) >> 2)) #define SwapRestS(stuff) \ SwapShorts((short *)(stuff + 1), LengthRestS(stuff)) #define SwapRestL(stuff) \ SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) #if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) void __attribute__ ((error("wrong sized variable passed to swap"))) wrong_size(void); #else static inline void wrong_size(void) { } #endif #if !(defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) static inline int __builtin_constant_p(int x) { return 0; } #endif /* byte swap a 64-bit value */ static inline void swap_uint64(uint64_t *x) { char n; n = ((char *) x)[0]; ((char *) x)[0] = ((char *) x)[7]; ((char *) x)[7] = n; n = ((char *) x)[1]; ((char *) x)[1] = ((char *) x)[6]; ((char *) x)[6] = n; n = ((char *) x)[2]; ((char *) x)[2] = ((char *) x)[5]; ((char *) x)[5] = n; n = ((char *) x)[3]; ((char *) x)[3] = ((char *) x)[4]; ((char *) x)[4] = n; } #define swapll(x) do { \ if (sizeof(*(x)) != 8) \ wrong_size(); \ swap_uint64((uint64_t *)(x)); \ } while (0) /* byte swap a 32-bit value */ static inline void swap_uint32(uint32_t * x) { char n = ((char *) x)[0]; ((char *) x)[0] = ((char *) x)[3]; ((char *) x)[3] = n; n = ((char *) x)[1]; ((char *) x)[1] = ((char *) x)[2]; ((char *) x)[2] = n; } #define swapl(x) do { \ if (sizeof(*(x)) != 4) \ wrong_size(); \ if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \ *(x) = lswapl(*(x)); \ else \ swap_uint32((uint32_t *)(x)); \ } while (0) /* byte swap a 16-bit value */ static inline void swap_uint16(uint16_t * x) { char n = ((char *) x)[0]; ((char *) x)[0] = ((char *) x)[1]; ((char *) x)[1] = n; } #define swaps(x) do { \ if (sizeof(*(x)) != 2) \ wrong_size(); \ if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \ *(x) = lswaps(*(x)); \ else \ swap_uint16((uint16_t *)(x)); \ } while (0) /* copy 32-bit value from src to dst byteswapping on the way */ #define cpswapl(src, dst) do { \ if (sizeof((src)) != 4 || sizeof((dst)) != 4) \ wrong_size(); \ (dst) = lswapl((src)); \ } while (0) /* copy short from src to dst byteswapping on the way */ #define cpswaps(src, dst) do { \ if (sizeof((src)) != 2 || sizeof((dst)) != 2) \ wrong_size(); \ (dst) = lswaps((src)); \ } while (0) extern _X_EXPORT void SwapLongs(CARD32 *list, unsigned long count); extern _X_EXPORT void SwapShorts(short *list, unsigned long count); extern _X_EXPORT void MakePredeclaredAtoms(void); extern _X_EXPORT int Ones(unsigned long /*mask */ ); typedef struct _xPoint *DDXPointPtr; typedef struct pixman_box16 *BoxPtr; typedef struct _xEvent *xEventPtr; typedef struct _xRectangle *xRectanglePtr; typedef struct _GrabRec *GrabPtr; /* typedefs from other places - duplicated here to minimize the amount * of unnecessary junk that one would normally have to include to get * these symbols defined */ #ifndef _XTYPEDEF_CHARINFOPTR typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */ #define _XTYPEDEF_CHARINFOPTR #endif extern _X_EXPORT unsigned long globalSerialNumber; 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) { \ 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) #define BUG_WARN_MSG(cond, ...) \ __BUG_WARN_MSG(cond, 1, __VA_ARGS__) #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 */ xorg-server-1.17.1/include/closure.h0000664000175100017510000000501512456571574014302 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef CLOSURE_H #define CLOSURE_H 1 typedef struct _LFclosure *LFclosurePtr; typedef struct _LFWIclosure *LFWIclosurePtr; typedef struct _OFclosure *OFclosurePtr; typedef struct _PTclosure *PTclosurePtr; typedef struct _ITclosure *ITclosurePtr; #endif /* CLOSURE_H */ xorg-server-1.17.1/include/xkbrules.h0000664000175100017510000000745412323563340014457 00000000000000#ifndef _XKBRULES_H_ #define _XKBRULES_H_ 1 /************************************************************ Copyright (c) 1996 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. ********************************************************/ /***====================================================================***/ typedef struct _XkbRMLVOSet { char *rules; char *model; char *layout; char *variant; char *options; } XkbRMLVOSet; typedef struct _XkbRF_VarDefs { const char *model; const char *layout; const char *variant; const char *options; } XkbRF_VarDefsRec, *XkbRF_VarDefsPtr; typedef struct _XkbRF_Rule { int number; int layout_num; int variant_num; const char *model; const char *layout; const char *variant; const char *option; /* yields */ const char *keycodes; const char *symbols; const char *types; const char *compat; const char *geometry; unsigned flags; } XkbRF_RuleRec, *XkbRF_RulePtr; typedef struct _XkbRF_Group { int number; const char *name; char *words; } XkbRF_GroupRec, *XkbRF_GroupPtr; #define XkbRF_PendingMatch (1L<<1) #define XkbRF_Option (1L<<2) #define XkbRF_Append (1L<<3) #define XkbRF_Normal (1L<<4) #define XkbRF_Invalid (1L<<5) typedef struct _XkbRF_Rules { unsigned short sz_rules; unsigned short num_rules; XkbRF_RulePtr rules; unsigned short sz_groups; unsigned short num_groups; XkbRF_GroupPtr groups; } XkbRF_RulesRec, *XkbRF_RulesPtr; /***====================================================================***/ _XFUNCPROTOBEGIN /* Seems preferable to dragging xkbstr.h in. */ struct _XkbComponentNames; extern _X_EXPORT Bool XkbRF_GetComponents(XkbRF_RulesPtr /* rules */ , XkbRF_VarDefsPtr /* var_defs */ , struct _XkbComponentNames * /* names */ ); extern _X_EXPORT Bool XkbRF_LoadRules(FILE * /* file */ , XkbRF_RulesPtr /* rules */ ); extern _X_EXPORT Bool XkbRF_LoadRulesByName(char * /* base */ , char * /* locale */ , XkbRF_RulesPtr /* rules */ ); /***====================================================================***/ extern _X_EXPORT XkbRF_RulesPtr XkbRF_Create(void); extern _X_EXPORT void XkbRF_Free(XkbRF_RulesPtr /* rules */ , Bool /* freeRules */ ); /***====================================================================***/ #define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES" #define _XKB_RF_NAMES_PROP_MAXLEN 1024 _XFUNCPROTOEND #endif /* _XKBRULES_H_ */ xorg-server-1.17.1/include/os.h0000664000175100017510000004522112456571574013252 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef OS_H #define OS_H #include "misc.h" #include #include #include #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 #define SCREEN_SAVER_FORCER 2 #define SCREEN_SAVER_CYCLE 3 #ifndef MAX_REQUEST_SIZE #define MAX_REQUEST_SIZE 65535 #endif #ifndef MAX_BIG_REQUEST_SIZE #define MAX_BIG_REQUEST_SIZE 4194303 #endif typedef struct _FontPathRec *FontPathPtr; typedef struct _NewClientRec *NewClientPtr; #ifndef xnfalloc #define xnfalloc(size) XNFalloc((unsigned long)(size)) #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size)) #define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size)) #define xstrdup(s) Xstrdup(s) #define xnfstrdup(s) XNFstrdup(s) #endif #include #include #ifdef DDXBEFORERESET extern void ddxBeforeReset(void); #endif #ifdef DDXOSVERRORF extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *, va_list args) _X_ATTRIBUTE_PRINTF(1, 0); #endif extern _X_EXPORT int WaitForSomething(int * /*pClientsReady */ ); extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ ); #if XTRANS_SEND_FDS extern _X_EXPORT int ReadFdFromClient(ClientPtr client); extern _X_EXPORT int WriteFdToClient(ClientPtr client, int fd, Bool do_close); #endif extern _X_EXPORT Bool InsertFakeRequest(ClientPtr /*client */ , char * /*data */ , int /*count */ ); extern _X_EXPORT void ResetCurrentRequest(ClientPtr /*client */ ); extern _X_EXPORT void FlushAllOutput(void); extern _X_EXPORT void FlushIfCriticalOutputPending(void); extern _X_EXPORT void SetCriticalOutputPending(void); extern _X_EXPORT int WriteToClient(ClientPtr /*who */ , int /*count */ , const void * /*buf */ ); extern _X_EXPORT void ResetOsBuffers(void); extern _X_EXPORT void InitConnectionLimits(void); extern _X_EXPORT void NotifyParentProcess(void); extern _X_EXPORT void CreateWellKnownSockets(void); extern _X_EXPORT void ResetWellKnownSockets(void); extern _X_EXPORT void CloseWellKnownConnections(void); extern _X_EXPORT XID AuthorizationIDOfClient(ClientPtr /*client */ ); extern _X_EXPORT const char *ClientAuthorized(ClientPtr /*client */ , unsigned int /*proto_n */ , char * /*auth_proto */ , unsigned int /*string_n */ , char * /*auth_string */ ); extern _X_EXPORT Bool EstablishNewConnections(ClientPtr clientUnused, void *closure); extern _X_EXPORT void CheckConnections(void); extern _X_EXPORT void CloseDownConnection(ClientPtr /*client */ ); extern _X_EXPORT void AddGeneralSocket(int /*fd */ ); extern _X_EXPORT void RemoveGeneralSocket(int /*fd */ ); extern _X_EXPORT void AddEnabledDevice(int /*fd */ ); extern _X_EXPORT void RemoveEnabledDevice(int /*fd */ ); extern _X_EXPORT int OnlyListenToOneClient(ClientPtr /*client */ ); extern _X_EXPORT void ListenToAllClients(void); extern _X_EXPORT void IgnoreClient(ClientPtr /*client */ ); extern _X_EXPORT void AttendClient(ClientPtr /*client */ ); extern _X_EXPORT void MakeClientGrabImpervious(ClientPtr /*client */ ); extern _X_EXPORT void MakeClientGrabPervious(ClientPtr /*client */ ); extern _X_EXPORT void ListenOnOpenFD(int /* fd */ , int /* noxauth */ ); extern _X_EXPORT Bool AddClientOnOpenFD(int /* fd */ ); extern _X_EXPORT CARD32 GetTimeInMillis(void); extern _X_EXPORT CARD64 GetTimeInMicros(void); extern _X_EXPORT void AdjustWaitForDelay(void *waitTime, unsigned long newdelay); typedef struct _OsTimerRec *OsTimerPtr; typedef CARD32 (*OsTimerCallback) (OsTimerPtr timer, CARD32 time, void *arg); extern _X_EXPORT void TimerInit(void); extern _X_EXPORT Bool TimerForce(OsTimerPtr /* timer */ ); #define TimerAbsolute (1<<0) #define TimerForceOld (1<<1) extern _X_EXPORT OsTimerPtr TimerSet(OsTimerPtr timer, int flags, CARD32 millis, OsTimerCallback func, void *arg); extern _X_EXPORT void TimerCheck(void); extern _X_EXPORT void TimerCancel(OsTimerPtr /* pTimer */ ); extern _X_EXPORT void TimerFree(OsTimerPtr /* pTimer */ ); extern _X_EXPORT void SetScreenSaverTimer(void); extern _X_EXPORT void FreeScreenSaverTimer(void); extern _X_EXPORT void AutoResetServer(int /*sig */ ); extern _X_EXPORT void GiveUp(int /*sig */ ); extern _X_EXPORT void UseMsg(void); extern _X_EXPORT void ProcessCommandLine(int /*argc */ , char * /*argv */ []); extern _X_EXPORT int set_font_authorizations(char **authorizations, int *authlen, void *client); /* * This function malloc(3)s buffer, terminating the server if there is not * enough memory. */ extern _X_EXPORT void * XNFalloc(unsigned long /*amount */ ); /* * This function calloc(3)s buffer, terminating the server if there is not * enough memory. */ extern _X_EXPORT void * XNFcalloc(unsigned long /*amount */ ); /* * This function realloc(3)s passed buffer, terminating the server if there is * not enough memory. */ extern _X_EXPORT void * XNFrealloc(void * /*ptr */ , unsigned long /*amount */ ); /* * This function strdup(3)s passed string. The only difference from the library * function that it is safe to pass NULL, as NULL will be returned. */ extern _X_EXPORT char * Xstrdup(const char *s); /* * This function strdup(3)s passed string, terminating the server if there is * not enough memory. If NULL is passed to this function, NULL is returned. */ extern _X_EXPORT char * XNFstrdup(const char *s); /* Include new X*asprintf API */ #include "Xprintf.h" /* Older api deprecated in favor of the asprintf versions */ extern _X_EXPORT char * Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1, 2) _X_DEPRECATED; extern _X_EXPORT char * Xvprintf(const char *fmt, va_list va) _X_ATTRIBUTE_PRINTF(1, 0) _X_DEPRECATED; extern _X_EXPORT char * XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1, 2) _X_DEPRECATED; extern _X_EXPORT char * XNFvprintf(const char *fmt, va_list va) _X_ATTRIBUTE_PRINTF(1, 0) _X_DEPRECATED; typedef void (*OsSigHandlerPtr) (int /* sig */ ); typedef int (*OsSigWrapperPtr) (int /* sig */ ); extern _X_EXPORT OsSigHandlerPtr OsSignal(int /* sig */ , OsSigHandlerPtr /* handler */ ); extern _X_EXPORT OsSigWrapperPtr OsRegisterSigWrapper(OsSigWrapperPtr newWrap); extern _X_EXPORT int auditTrailLevel; extern _X_EXPORT void LockServer(void); extern _X_EXPORT void UnlockServer(void); extern _X_EXPORT int OsLookupColor(int /*screen */ , char * /*name */ , unsigned /*len */ , unsigned short * /*pred */ , unsigned short * /*pgreen */ , unsigned short * /*pblue */ ); extern _X_EXPORT void OsInit(void); extern _X_EXPORT void OsCleanup(Bool); extern _X_EXPORT void OsVendorFatalError(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1, 0); extern _X_EXPORT void OsVendorInit(void); extern _X_EXPORT void 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; #if !defined(WIN32) extern _X_EXPORT int System(const char *); extern _X_EXPORT void * Popen(const char *, const char *); extern _X_EXPORT int Pclose(void *); extern _X_EXPORT void * Fopen(const char *, const char *); extern _X_EXPORT int Fclose(void *); #else extern const char * Win32TempDir(void); extern int System(const char *cmdline); #define Fopen(a,b) fopen(a,b) #define Fclose(a) fclose(a) #endif extern _X_EXPORT void CheckUserParameters(int argc, char **argv, char **envp); extern _X_EXPORT void CheckUserAuthorization(void); extern _X_EXPORT int AddHost(ClientPtr /*client */ , int /*family */ , unsigned /*length */ , const void * /*pAddr */ ); extern _X_EXPORT Bool ForEachHostInFamily(int family, Bool (*func)( unsigned char *addr, short len, void *closure), void *closure); extern _X_EXPORT int RemoveHost(ClientPtr client, int family, unsigned length, void *pAddr); extern _X_EXPORT int GetHosts(void ** /*data */ , int * /*pnHosts */ , int * /*pLen */ , BOOL * /*pEnabled */ ); typedef struct sockaddr *sockaddrPtr; extern _X_EXPORT int InvalidHost(sockaddrPtr /*saddr */ , int /*len */ , ClientPtr client); #define LCC_UID_SET (1 << 0) #define LCC_GID_SET (1 << 1) #define LCC_PID_SET (1 << 2) #define LCC_ZID_SET (1 << 3) typedef struct { int fieldsSet; /* Bit mask of fields set */ int euid; /* Effective uid */ int egid; /* Primary effective group id */ int nSuppGids; /* Number of supplementary group ids */ int *pSuppGids; /* Array of supplementary group ids */ int pid; /* Process id */ int zoneid; /* Only set on Solaris 10 & later */ } LocalClientCredRec; extern _X_EXPORT int GetLocalClientCreds(ClientPtr, LocalClientCredRec **); extern _X_EXPORT void FreeLocalClientCreds(LocalClientCredRec *); extern _X_EXPORT int ChangeAccessControl(ClientPtr /*client */ , int /*fEnabled */ ); extern _X_EXPORT int GetAccessControl(void); extern _X_EXPORT void AddLocalHosts(void); extern _X_EXPORT void ResetHosts(const char *display); extern _X_EXPORT void EnableLocalHost(void); extern _X_EXPORT void DisableLocalHost(void); extern _X_EXPORT void AccessUsingXdmcp(void); extern _X_EXPORT void DefineSelf(int /*fd */ ); #if XDMCP extern _X_EXPORT void AugmentSelf(void *from, int len); extern _X_EXPORT void RegisterAuthorizations(void); #endif extern _X_EXPORT void InitAuthorization(const char * /*filename */ ); /* extern int LoadAuthorization(void); */ extern _X_EXPORT int AuthorizationFromID(XID id, unsigned short *name_lenp, const char **namep, unsigned short *data_lenp, char **datap); extern _X_EXPORT XID CheckAuthorization(unsigned int /*namelength */ , const char * /*name */ , unsigned int /*datalength */ , const char * /*data */ , ClientPtr /*client */ , const char ** /*reason */ ); extern _X_EXPORT void ResetAuthorization(void); extern _X_EXPORT int RemoveAuthorization(unsigned short name_length, const char *name, unsigned short data_length, const char *data); extern _X_EXPORT int AddAuthorization(unsigned int /*name_length */ , const char * /*name */ , unsigned int /*data_length */ , char * /*data */ ); #ifdef XCSECURITY extern _X_EXPORT XID GenerateAuthorization(unsigned int /* name_length */ , const char * /* name */ , unsigned int /* data_length */ , const char * /* data */ , unsigned int * /* data_length_return */ , char ** /* data_return */ ); #endif extern _X_EXPORT int ddxProcessArgument(int /*argc */ , char * /*argv */ [], int /*i */ ); extern _X_EXPORT void ddxUseMsg(void); /* stuff for ReplyCallback */ extern _X_EXPORT CallbackListPtr ReplyCallback; typedef struct { ClientPtr client; const void *replyData; unsigned long dataLenBytes; /* actual bytes from replyData + pad bytes */ unsigned long bytesRemaining; Bool startOfReply; unsigned long padBytes; /* pad bytes from zeroed array */ } ReplyInfoRec; /* stuff for FlushCallback */ extern _X_EXPORT CallbackListPtr FlushCallback; enum ExitCode { EXIT_NO_ERROR = 0, EXIT_ERR_ABORT = 1, EXIT_ERR_CONFIGURE = 2, EXIT_ERR_DRIVERS = 3, }; extern _X_EXPORT void AbortDDX(enum ExitCode error); extern _X_EXPORT void ddxGiveUp(enum ExitCode error); extern _X_EXPORT int TimeSinceLastInputEvent(void); /* strcasecmp.c */ #ifndef HAVE_STRCASECMP #define strcasecmp xstrcasecmp extern _X_EXPORT int xstrcasecmp(const char *s1, const char *s2); #endif #ifndef HAVE_STRNCASECMP #define strncasecmp xstrncasecmp extern _X_EXPORT int xstrncasecmp(const char *s1, const char *s2, size_t n); #endif #ifndef HAVE_STRCASESTR #define strcasestr xstrcasestr extern _X_EXPORT char * xstrcasestr(const char *s, const char *find); #endif #ifndef HAVE_STRLCPY extern _X_EXPORT size_t strlcpy(char *dst, const char *src, size_t siz); extern _X_EXPORT size_t strlcat(char *dst, const char *src, size_t siz); #endif #ifndef HAVE_STRNDUP extern _X_EXPORT char * strndup(const char *str, size_t n); #endif /* Logging. */ typedef enum _LogParameter { XLOG_FLUSH, XLOG_SYNC, XLOG_VERBOSITY, XLOG_FILE_VERBOSITY } LogParameter; /* Flags for log messages. */ typedef enum { X_PROBED, /* Value was probed */ X_CONFIG, /* Value was given in the config file */ X_DEFAULT, /* Value is a default */ X_CMDLINE, /* Value was given on the command line */ X_NOTICE, /* Notice */ X_ERROR, /* Error message */ X_WARNING, /* Warning message */ X_INFO, /* Informational message */ X_NONE, /* No prefix */ X_NOT_IMPLEMENTED, /* Not implemented */ X_DEBUG, /* Debug message */ X_UNKNOWN = -1 /* unknown -- this must always be last */ } MessageType; extern _X_EXPORT const char * LogInit(const char *fname, const char *backup); extern _X_EXPORT void LogClose(enum ExitCode error); extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value); extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args) _X_ATTRIBUTE_PRINTF(2, 0); extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) _X_ATTRIBUTE_PRINTF(3, 0); extern _X_EXPORT void LogMessageVerb(MessageType type, int verb, const char *format, ...) _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, const char *msg_format, va_list msg_args, const char *hdr_format, va_list hdr_args) _X_ATTRIBUTE_PRINTF(3, 0) _X_ATTRIBUTE_PRINTF(5, 0); extern _X_EXPORT void LogHdrMessageVerb(MessageType type, int verb, const char *msg_format, va_list msg_args, const char *hdr_format, ...) _X_ATTRIBUTE_PRINTF(3, 0) _X_ATTRIBUTE_PRINTF(5, 6); extern _X_EXPORT void LogHdrMessage(MessageType type, const char *msg_format, va_list msg_args, const char *hdr_format, ...) _X_ATTRIBUTE_PRINTF(2, 0) _X_ATTRIBUTE_PRINTF(4, 5); extern _X_EXPORT void FreeAuditTimer(void); extern _X_EXPORT void AuditF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2); extern _X_EXPORT void VAuditF(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1, 0); extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2) _X_NORETURN; #ifdef DEBUG #define DebugF ErrorF #else #define DebugF(...) /* */ #endif extern _X_EXPORT void VErrorF(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1, 0); 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 xorg_backtrace(void); extern _X_EXPORT int os_move_fd(int fd); #endif /* OS_H */ xorg-server-1.17.1/include/xsha1.h0000664000175100017510000000067012456571574013654 00000000000000#ifndef XSHA1_H #define XSHA1_H /* Initialize SHA1 computation. Returns NULL on error. */ void *x_sha1_init(void); /* * Add some data to be hashed. ctx is the value returned by x_sha1_init() * Returns 0 on error, 1 on success. */ int x_sha1_update(void *ctx, void *data, int size); /* * Place the hash in result, and free ctx. * Returns 0 on error, 1 on success. */ int x_sha1_final(void *ctx, unsigned char result[20]); #endif xorg-server-1.17.1/include/registry.h0000664000175100017510000000355412410106004014450 00000000000000/*********************************************************** 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 AUTHOR 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 DIX_REGISTRY_H #define DIX_REGISTRY_H /* * Result returned from any unsuccessful lookup */ #define XREGISTRY_UNKNOWN "" #include "resource.h" #include "extnsionst.h" #if defined(XSELINUX) || defined(RES) #define X_REGISTRY_RESOURCE 1 #endif #if defined(XSELINUX) || defined(XCSECURITY) || defined(XSERVER_DTRACE) #define X_REGISTRY_REQUEST 1 #endif /* Internal string registry - for auditing, debugging, security, etc. */ #ifdef X_REGISTRY_RESOURCE /* Functions used by the X-Resource extension */ extern _X_EXPORT void RegisterResourceName(RESTYPE type, const char *name); extern _X_EXPORT const char *LookupResourceName(RESTYPE rtype); #endif #ifdef X_REGISTRY_REQUEST extern _X_EXPORT void RegisterExtensionNames(ExtensionEntry * ext); /* * Lookup functions. The returned string must not be modified or freed. */ extern _X_EXPORT const char *LookupMajorName(int major); extern _X_EXPORT const char *LookupRequestName(int major, int minor); extern _X_EXPORT const char *LookupEventName(int event); extern _X_EXPORT const char *LookupErrorName(int error); #endif /* * Setup and teardown */ extern _X_EXPORT void dixResetRegistry(void); extern _X_EXPORT void dixFreeRegistry(void); extern _X_EXPORT void dixCloseRegistry(void); #endif /* DIX_REGISTRY_H */ xorg-server-1.17.1/include/cursor.h0000664000175100017510000001371412456571574014150 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef CURSOR_H #define CURSOR_H #include "misc.h" #include "screenint.h" #include "window.h" #include "privates.h" #define NullCursor ((CursorPtr)NULL) /* Provide support for alpha composited cursors */ #define ARGB_CURSOR struct _DeviceIntRec; typedef struct _Cursor *CursorPtr; typedef struct _CursorMetric *CursorMetricPtr; extern _X_EXPORT DevScreenPrivateKeyRec cursorScreenDevPriv; #define CursorScreenKey (&cursorScreenDevPriv) extern _X_EXPORT CursorPtr rootCursor; extern _X_EXPORT int FreeCursor(void *pCurs, XID cid); extern _X_EXPORT CursorPtr RefCursor(CursorPtr /* cursor */); extern _X_EXPORT CursorPtr UnrefCursor(CursorPtr /* cursor */); extern _X_EXPORT int CursorRefCount(const CursorPtr /* cursor */); extern _X_EXPORT int AllocARGBCursor(unsigned char * /*psrcbits */ , unsigned char * /*pmaskbits */ , CARD32 * /*argb */ , CursorMetricPtr /*cm */ , unsigned /*foreRed */ , unsigned /*foreGreen */ , unsigned /*foreBlue */ , unsigned /*backRed */ , unsigned /*backGreen */ , unsigned /*backBlue */ , CursorPtr * /*ppCurs */ , ClientPtr /*client */ , XID /*cid */ ); extern _X_EXPORT int AllocGlyphCursor(Font /*source */ , unsigned int /*sourceChar */ , Font /*mask */ , unsigned int /*maskChar */ , unsigned /*foreRed */ , unsigned /*foreGreen */ , unsigned /*foreBlue */ , unsigned /*backRed */ , unsigned /*backGreen */ , unsigned /*backBlue */ , CursorPtr * /*ppCurs */ , ClientPtr /*client */ , XID /*cid */ ); extern _X_EXPORT CursorPtr CreateRootCursor(char * /*pfilename */ , unsigned int /*glyph */ ); extern _X_EXPORT int ServerBitsFromGlyph(FontPtr /*pfont */ , unsigned int /*ch */ , CursorMetricPtr /*cm */ , unsigned char ** /*ppbits */ ); extern _X_EXPORT Bool CursorMetricsFromGlyph(FontPtr /*pfont */ , unsigned /*ch */ , CursorMetricPtr /*cm */ ); extern _X_EXPORT void CheckCursorConfinement(WindowPtr /*pWin */ ); extern _X_EXPORT void NewCurrentScreen(struct _DeviceIntRec * /*pDev */ , ScreenPtr /*newScreen */ , int /*x */ , int /*y */ ); extern _X_EXPORT Bool PointerConfinedToScreen(struct _DeviceIntRec * /* pDev */ ); extern _X_EXPORT void GetSpritePosition(struct _DeviceIntRec * /* pDev */ , int * /*px */ , int * /*py */ ); #ifdef PANORAMIX extern _X_EXPORT int XineramaGetCursorScreen(struct _DeviceIntRec *pDev); #endif /* PANORAMIX */ #endif /* CURSOR_H */ xorg-server-1.17.1/include/callback.h0000664000175100017510000000673612362011424014350 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef CALLBACK_H #define CALLBACK_H #include /* for GContext, Mask */ #include /* for Bool */ #include #include /* * callback manager stuff */ #ifndef _XTYPEDEF_CALLBACKLISTPTR typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */ #define _XTYPEDEF_CALLBACKLISTPTR #endif typedef void (*CallbackProcPtr) (CallbackListPtr *, void *, void *); extern _X_EXPORT Bool AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data); extern _X_EXPORT Bool DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data); extern _X_EXPORT void _CallCallbacks(CallbackListPtr *pcbl, void *call_data); static inline void CallCallbacks(CallbackListPtr *pcbl, void *call_data) { if (!pcbl || !*pcbl) return; _CallCallbacks(pcbl, call_data); } extern _X_EXPORT void DeleteCallbackList(CallbackListPtr *pcbl); extern _X_EXPORT void InitCallbackManager(void); extern _X_EXPORT void DeleteCallbackManager(void); #endif /* CALLBACK_H */ xorg-server-1.17.1/include/dixevents.h0000664000175100017510000000632212274325511014623 00000000000000/************************************************************ Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ #ifndef DIXEVENTS_H #define DIXEVENTS_H extern _X_EXPORT void SetCriticalEvent(int /* event */ ); extern _X_EXPORT CursorPtr GetSpriteCursor(DeviceIntPtr /*pDev */ ); extern _X_EXPORT int ProcAllowEvents(ClientPtr /* client */ ); extern _X_EXPORT int MaybeDeliverEventsToClient(WindowPtr /* pWin */ , xEvent * /* pEvents */ , int /* count */ , Mask /* filter */ , ClientPtr /* dontClient */ ); extern _X_EXPORT int ProcWarpPointer(ClientPtr /* client */ ); extern _X_EXPORT int EventSelectForWindow(WindowPtr /* pWin */ , ClientPtr /* client */ , Mask /* mask */ ); extern _X_EXPORT int EventSuppressForWindow(WindowPtr /* pWin */ , ClientPtr /* client */ , Mask /* mask */ , Bool * /* checkOptional */ ); extern _X_EXPORT int ProcSetInputFocus(ClientPtr /* client */ ); extern _X_EXPORT int ProcGetInputFocus(ClientPtr /* client */ ); extern _X_EXPORT int ProcGrabPointer(ClientPtr /* client */ ); extern _X_EXPORT int ProcChangeActivePointerGrab(ClientPtr /* client */ ); extern _X_EXPORT int ProcUngrabPointer(ClientPtr /* client */ ); extern _X_EXPORT int ProcGrabKeyboard(ClientPtr /* client */ ); extern _X_EXPORT int ProcUngrabKeyboard(ClientPtr /* client */ ); extern _X_EXPORT int ProcQueryPointer(ClientPtr /* client */ ); extern _X_EXPORT int ProcSendEvent(ClientPtr /* client */ ); extern _X_EXPORT int ProcUngrabKey(ClientPtr /* client */ ); extern _X_EXPORT int ProcGrabKey(ClientPtr /* client */ ); extern _X_EXPORT int ProcGrabButton(ClientPtr /* client */ ); extern _X_EXPORT int ProcUngrabButton(ClientPtr /* client */ ); extern _X_EXPORT int ProcRecolorCursor(ClientPtr /* client */ ); #endif /* DIXEVENTS_H */ xorg-server-1.17.1/include/xwin-config.h.in0000664000175100017510000000124212362011424015434 00000000000000/* * xwin-config.h.in * * This file has all defines used in the xwin ddx * */ #include /* Winsock networking */ #undef HAS_WINSOCK /* Cygwin has /dev/windows for signaling new win32 messages */ #undef HAS_DEVWINDOWS /* Switch on debug messages */ #undef CYGDEBUG #undef CYGWINDOWING_DEBUG #undef CYGMULTIWINDOW_DEBUG /* Define to 1 if unsigned long is 64 bits. */ #undef _XSERVER64 /* Short vendor name */ #undef XVENDORNAMESHORT /* Vendor web address for support */ #undef __VENDORDWEBSUPPORT__ /* Default log location */ #undef DEFAULT_LOGDIR /* Whether we should re-locate the root to where the executable lives */ #undef RELOCATE_PROJECTROOT xorg-server-1.17.1/include/inputstr.h0000664000175100017510000006032612456571574014524 00000000000000/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ********************************************************/ #ifndef INPUTSTRUCT_H #define INPUTSTRUCT_H #include #include #include "input.h" #include "window.h" #include "dixstruct.h" #include "cursorstr.h" #include "geext.h" #include "privates.h" #define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) #define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) extern _X_EXPORT int CountBits(const uint8_t * mask, int len); #define SameClient(obj,client) \ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) #define EMASKSIZE (MAXDEVICES + 2) /* This is the last XI2 event supported by the server. If you add * events to the protocol, the server will not support these events until * this number here is bumped. */ #define XI2LASTEVENT XI_BarrierLeave #define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */ /** * Scroll types for ::SetScrollValuator and the scroll type in the * ::ScrollInfoPtr. */ enum ScrollType { SCROLL_TYPE_NONE = 0, /**< Not a scrolling valuator */ SCROLL_TYPE_VERTICAL = 8, SCROLL_TYPE_HORIZONTAL = 9, }; /** * This struct stores the core event mask for each client except the client * that created the window. * * Each window that has events selected from other clients has at least one of * these masks. If multiple clients selected for events on the same window, * these masks are in a linked list. * * The event mask for the client that created the window is stored in * win->eventMask instead. * * The resource id is simply a fake client ID to associate this mask with a * client. * * Kludge: OtherClients and InputClients must be compatible, see code. */ typedef struct _OtherClients { OtherClientsPtr next; /**< Pointer to the next mask */ XID resource; /**< id for putting into resource manager */ Mask mask; /**< Core event mask */ } OtherClients; /** * This struct stores the XI event mask for each client. * * Each window that has events selected has at least one of these masks. If * multiple client selected for events on the same window, these masks are in * a linked list. */ typedef struct _InputClients { InputClientsPtr next; /**< Pointer to the next mask */ XID resource; /**< id for putting into resource manager */ Mask mask[EMASKSIZE]; /**< Actual XI event mask, deviceid is index */ /** XI2 event masks. One per device, each bit is a mask of (1 << type) */ struct _XI2Mask *xi2mask; } InputClients; /** * Combined XI event masks from all devices. * * This is the XI equivalent of the deliverableEvents, eventMask and * dontPropagate mask of the WindowRec (or WindowOptRec). * * A window that has an XI client selecting for events has exactly one * OtherInputMasks struct and exactly one InputClients struct hanging off * inputClients. Each further client appends to the inputClients list. * Each Mask field is per-device, with the device id as the index. * Exception: for non-device events (Presence events), the MAXDEVICES * deviceid is used. */ typedef struct _OtherInputMasks { /** * Bitwise OR of all masks by all clients and the window's parent's masks. */ Mask deliverableEvents[EMASKSIZE]; /** * Bitwise OR of all masks by all clients on this window. */ Mask inputEvents[EMASKSIZE]; /** The do-not-propagate masks for each device. */ Mask dontPropagateMask[EMASKSIZE]; /** The clients that selected for events */ InputClientsPtr inputClients; /* XI2 event masks. One per device, each bit is a mask of (1 << type) */ struct _XI2Mask *xi2mask; } OtherInputMasks; /* * The following structure gets used for both active and passive grabs. For * active grabs some of the fields (e.g. modifiers) are not used. However, * that is not much waste since there aren't many active grabs (one per * keyboard/pointer device) going at once in the server. */ #define MasksPerDetailMask 8 /* 256 keycodes and 256 possible modifier combinations, but only 3 buttons. */ typedef struct _DetailRec { /* Grab details may be bit masks */ unsigned int exact; Mask *pMask; } DetailRec; union _GrabMask { Mask core; Mask xi; struct _XI2Mask *xi2mask; }; /** * Central struct for device grabs. * The same struct is used for both core grabs and device grabs, with * different fields being set. * If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask * is a combination of standard event masks (i.e. PointerMotionMask | * ButtonPressMask). * If the grab is a device grab (GrabDevice), then the eventMask is a * combination of event masks for a given XI event type (see SetEventInfo). * * If the grab is a result of a ButtonPress, then eventMask is the core mask * and deviceMask is set to the XI event mask for the grab. */ typedef struct _GrabRec { GrabPtr next; /* for chain of passive grabs */ XID resource; DeviceIntPtr device; WindowPtr window; unsigned ownerEvents:1; unsigned keyboardMode:1; unsigned pointerMode:1; enum InputLevel grabtype; CARD8 type; /* event type for passive grabs, 0 for active grabs */ DetailRec modifiersDetail; DeviceIntPtr modifierDevice; DetailRec detail; /* key or button */ WindowPtr confineTo; /* always NULL for keyboards */ CursorPtr cursor; /* always NULL for keyboards */ Mask eventMask; Mask deviceMask; /* XI2 event masks. One per device, each bit is a mask of (1 << type) */ struct _XI2Mask *xi2mask; } GrabRec; /** * Sprite information for a device. */ typedef struct _SpriteRec { CursorPtr current; BoxRec hotLimits; /* logical constraints of hot spot */ Bool confined; /* confined to screen */ RegionPtr hotShape; /* additional logical shape constraint */ BoxRec physLimits; /* physical constraints of hot spot */ WindowPtr win; /* window of logical position */ HotSpot hot; /* logical pointer position */ HotSpot hotPhys; /* physical pointer position */ #ifdef PANORAMIX ScreenPtr screen; /* all others are in Screen 0 coordinates */ RegionRec Reg1; /* Region 1 for confining motion */ RegionRec Reg2; /* Region 2 for confining virtual motion */ WindowPtr windows[MAXSCREENS]; WindowPtr confineWin; /* confine window */ #endif /* The window trace information is used at dix/events.c to avoid having * to compute all the windows between the root and the current pointer * window each time a button or key goes down. The grabs on each of those * windows must be checked. * spriteTraces should only be used at dix/events.c! */ WindowPtr *spriteTrace; int spriteTraceSize; int spriteTraceGood; /* Due to delays between event generation and event processing, it is * possible that the pointer has crossed screen boundaries between the * time in which it begins generating events and the time when * those events are processed. * * pEnqueueScreen: screen the pointer was on when the event was generated * pDequeueScreen: screen the pointer was on when the event is processed */ ScreenPtr pEnqueueScreen; ScreenPtr pDequeueScreen; } SpriteRec; typedef struct _KeyClassRec { int sourceid; CARD8 down[DOWN_LENGTH]; CARD8 postdown[DOWN_LENGTH]; int modifierKeyCount[8]; struct _XkbSrvInfo *xkbInfo; } KeyClassRec, *KeyClassPtr; typedef struct _ScrollInfo { enum ScrollType type; double increment; int flags; } ScrollInfo, *ScrollInfoPtr; typedef struct _AxisInfo { int resolution; int min_resolution; int max_resolution; int min_value; int max_value; Atom label; CARD8 mode; ScrollInfo scroll; } AxisInfo, *AxisInfoPtr; typedef struct _ValuatorAccelerationRec { int number; PointerAccelSchemeProc AccelSchemeProc; void *accelData; /* at disposal of AccelScheme */ PointerAccelSchemeInitProc AccelInitProc; DeviceCallbackProc AccelCleanupProc; } ValuatorAccelerationRec, *ValuatorAccelerationPtr; typedef struct _ValuatorClassRec { int sourceid; int numMotionEvents; int first_motion; int last_motion; void *motion; /* motion history buffer. Different layout for MDs and SDs! */ WindowPtr motionHintWindow; AxisInfoPtr axes; unsigned short numAxes; double *axisVal; /* always absolute, but device-coord system */ ValuatorAccelerationRec accelScheme; int h_scroll_axis; /* horiz smooth-scrolling axis */ 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 */ Bool active; /* whether or not the touch is active */ Bool pending_finish; /* true if the touch is physically inactive * but still owned by a grab */ SpriteRec sprite; /* window trace for delivery */ ValuatorMask *valuators; /* last recorded axis values */ TouchListener *listeners; /* set of listeners */ int num_listeners; int num_grabs; /* number of open grabs on this touch * which have not accepted or rejected */ Bool emulate_pointer; DeviceEvent *history; /* History of events on this touchpoint */ size_t history_elements; /* Number of current elements in history */ size_t history_size; /* Size of history in elements */ } TouchPointInfoRec; 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 axis values as posted, pre-transform */ } DDXTouchPointInfoRec; typedef struct _TouchClassRec { int sourceid; TouchPointInfoPtr touches; unsigned short num_touches; /* number of allocated touches */ unsigned short max_touches; /* maximum number of touches, may be 0 */ CARD8 mode; /* ::XIDirectTouch, XIDependentTouch */ /* for pointer-emulation */ CARD8 buttonsDown; /* number of buttons down */ unsigned short state; /* logical button state */ Mask motionMask; } TouchClassRec; typedef struct _ButtonClassRec { int sourceid; CARD8 numButtons; CARD8 buttonsDown; /* number of buttons currently down This counts logical buttons, not physical ones, i.e if some buttons are mapped to 0, they're not counted here */ unsigned short state; Mask motionMask; CARD8 down[DOWN_LENGTH]; CARD8 postdown[DOWN_LENGTH]; CARD8 map[MAP_LENGTH]; union _XkbAction *xkb_acts; Atom labels[MAX_BUTTONS]; } ButtonClassRec, *ButtonClassPtr; typedef struct _FocusClassRec { int sourceid; WindowPtr win; /* May be set to a int constant (e.g. PointerRootWin)! */ int revert; TimeStamp time; WindowPtr *trace; int traceSize; int traceGood; } FocusClassRec, *FocusClassPtr; typedef struct _ProximityClassRec { int sourceid; char in_proximity; } ProximityClassRec, *ProximityClassPtr; typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr; typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr; typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr; typedef struct _StringFeedbackClassRec *StringFeedbackPtr; typedef struct _BellFeedbackClassRec *BellFeedbackPtr; typedef struct _LedFeedbackClassRec *LedFeedbackPtr; typedef struct _KbdFeedbackClassRec { BellProcPtr BellProc; KbdCtrlProcPtr CtrlProc; KeybdCtrl ctrl; KbdFeedbackPtr next; struct _XkbSrvLedInfo *xkb_sli; } KbdFeedbackClassRec; typedef struct _PtrFeedbackClassRec { PtrCtrlProcPtr CtrlProc; PtrCtrl ctrl; PtrFeedbackPtr next; } PtrFeedbackClassRec; typedef struct _IntegerFeedbackClassRec { IntegerCtrlProcPtr CtrlProc; IntegerCtrl ctrl; IntegerFeedbackPtr next; } IntegerFeedbackClassRec; typedef struct _StringFeedbackClassRec { StringCtrlProcPtr CtrlProc; StringCtrl ctrl; StringFeedbackPtr next; } StringFeedbackClassRec; typedef struct _BellFeedbackClassRec { BellProcPtr BellProc; BellCtrlProcPtr CtrlProc; BellCtrl ctrl; BellFeedbackPtr next; } BellFeedbackClassRec; typedef struct _LedFeedbackClassRec { LedCtrlProcPtr CtrlProc; LedCtrl ctrl; LedFeedbackPtr next; struct _XkbSrvLedInfo *xkb_sli; } LedFeedbackClassRec; typedef struct _ClassesRec { KeyClassPtr key; ValuatorClassPtr valuator; TouchClassPtr touch; ButtonClassPtr button; FocusClassPtr focus; ProximityClassPtr proximity; KbdFeedbackPtr kbdfeed; PtrFeedbackPtr ptrfeed; IntegerFeedbackPtr intfeed; StringFeedbackPtr stringfeed; BellFeedbackPtr bell; LedFeedbackPtr leds; } ClassesRec; /* Device properties */ typedef struct _XIPropertyValue { Atom type; /* ignored by server */ short format; /* format of data for swapping - 8,16,32 */ long size; /* size of data in (format/8) bytes */ void *data; /* private to client */ } XIPropertyValueRec; typedef struct _XIProperty { struct _XIProperty *next; Atom propertyName; BOOL deletable; /* clients can delete this prop? */ XIPropertyValueRec value; } XIPropertyRec; typedef XIPropertyRec *XIPropertyPtr; typedef XIPropertyValueRec *XIPropertyValuePtr; typedef struct _XIPropertyHandler { struct _XIPropertyHandler *next; long id; int (*SetProperty) (DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, BOOL checkonly); int (*GetProperty) (DeviceIntPtr dev, Atom property); int (*DeleteProperty) (DeviceIntPtr dev, Atom property); } XIPropertyHandler, *XIPropertyHandlerPtr; /* states for devices */ #define NOT_GRABBED 0 #define THAWED 1 #define THAWED_BOTH 2 /* not a real state */ #define FREEZE_NEXT_EVENT 3 #define FREEZE_BOTH_NEXT_EVENT 4 #define FROZEN 5 /* any state >= has device frozen */ #define FROZEN_NO_EVENT 5 #define FROZEN_WITH_EVENT 6 #define THAW_OTHERS 7 typedef struct _GrabInfoRec { TimeStamp grabTime; Bool fromPassiveGrab; /* true if from passive grab */ Bool implicitGrab; /* implicit from ButtonPress */ GrabPtr unused; /* Kept for ABI stability, remove soon */ GrabPtr grab; CARD8 activatingKey; void (*ActivateGrab) (DeviceIntPtr /*device */ , GrabPtr /*grab */ , TimeStamp /*time */ , Bool /*autoGrab */ ); void (*DeactivateGrab) (DeviceIntPtr /*device */ ); struct { Bool frozen; int state; GrabPtr other; /* if other grab has this frozen */ DeviceEvent *event; /* saved to be replayed */ } sync; } GrabInfoRec, *GrabInfoPtr; typedef struct _SpriteInfoRec { /* sprite must always point to a valid sprite. For devices sharing the * sprite, let sprite point to a paired spriteOwner's sprite. */ SpritePtr sprite; /* sprite information */ Bool spriteOwner; /* True if device owns the sprite */ DeviceIntPtr paired; /* The paired device. Keyboard if spriteOwner is TRUE, otherwise the pointer that owns the sprite. */ /* keep states for animated cursor */ struct { CursorPtr pCursor; ScreenPtr pScreen; int elt; CARD32 time; } anim; } SpriteInfoRec, *SpriteInfoPtr; /* device types */ #define MASTER_POINTER 1 #define MASTER_KEYBOARD 2 #define SLAVE 3 /* special types for GetMaster */ #define MASTER_ATTACHED 4 /* Master for this device */ #define KEYBOARD_OR_FLOAT 5 /* Keyboard master for this device or this device if floating */ #define POINTER_OR_FLOAT 6 /* Pointer master for this device or this device if floating */ typedef struct _DeviceIntRec { DeviceRec public; DeviceIntPtr next; Bool startup; /* true if needs to be turned on at server initialization time */ DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is used to initialize, turn on, or turn off the device */ Bool inited; /* TRUE if INIT returns Success */ Bool enabled; /* TRUE if ON returns Success */ Bool coreEvents; /* TRUE if device also sends core */ GrabInfoRec deviceGrab; /* grab on the device */ int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */ Atom xinput_type; char *name; int id; KeyClassPtr key; ValuatorClassPtr valuator; TouchClassPtr touch; ButtonClassPtr button; FocusClassPtr focus; ProximityClassPtr proximity; KbdFeedbackPtr kbdfeed; PtrFeedbackPtr ptrfeed; IntegerFeedbackPtr intfeed; StringFeedbackPtr stringfeed; BellFeedbackPtr bell; LedFeedbackPtr leds; struct _XkbInterest *xkb_interest; char *config_info; /* used by the hotplug layer */ ClassesPtr unused_classes; /* for master devices */ int saved_master_id; /* for slaves while grabbed */ PrivateRec *devPrivates; DeviceUnwrapProc unwrapProc; SpriteInfoPtr spriteInfo; DeviceIntPtr master; /* master device */ DeviceIntPtr lastSlave; /* last slave device used */ /* last valuator values recorded, not posted to client; * for slave devices, valuators is in device coordinates, mapped to the * desktop * for master devices, valuators is in desktop coordinates. * see dix/getevents.c * remainder supports acceleration */ struct { double valuators[MAX_VALUATORS]; int numValuators; DeviceIntPtr slave; ValuatorMask *scroll; int num_touches; /* size of the touches array */ DDXTouchPointInfoPtr touches; } last; /* Input device property handling. */ struct { XIPropertyPtr properties; XIPropertyHandlerPtr handlers; /* NULL-terminated */ } properties; /* 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 { int numDevices; /* total number of devices */ DeviceIntPtr devices; /* all devices turned on */ DeviceIntPtr off_devices; /* all devices turned off */ DeviceIntPtr keyboard; /* the main one for the server */ DeviceIntPtr pointer; DeviceIntPtr all_devices; DeviceIntPtr all_master_devices; } InputInfo; extern _X_EXPORT InputInfo inputInfo; /* for keeping the events for devices grabbed synchronously */ typedef struct _QdEvent *QdEventPtr; typedef struct _QdEvent { struct xorg_list next; DeviceIntPtr device; ScreenPtr pScreen; /* what screen the pointer was on */ unsigned long months; /* milliseconds is in the event */ InternalEvent *event; } QdEventRec; /** * syncEvents is the global structure for queued events. * * Devices can be frozen through GrabModeSync pointer grabs. If this is the * case, events from these devices are added to "pending" instead of being * processed normally. When the device is unfrozen, events in "pending" are * replayed and processed as if they would come from the device directly. */ typedef struct _EventSyncInfo { struct xorg_list pending; /** The device to replay events for. Only set in AllowEvents(), in which * case it is set to the device specified in the request. */ DeviceIntPtr replayDev; /* kludgy rock to put flag for */ /** * The window the events are supposed to be replayed on. * This window may be set to the grab's window (but only when * Replay{Pointer|Keyboard} is given in the XAllowEvents() * request. */ WindowPtr replayWin; /* ComputeFreezes */ /** * Flag to indicate whether we're in the process of * replaying events. Only set in ComputeFreezes(). */ Bool playingEvents; TimeStamp time; } EventSyncInfoRec, *EventSyncInfoPtr; extern EventSyncInfoRec syncEvents; /** * Given a sprite, returns the window at the bottom of the trace (i.e. the * furthest window from the root). */ static inline WindowPtr DeepestSpriteWin(SpritePtr sprite) { assert(sprite->spriteTraceGood > 0); return sprite->spriteTrace[sprite->spriteTraceGood - 1]; } struct _XI2Mask { unsigned char **masks; /* event mask in masks[deviceid][event type byte] */ size_t nmasks; /* number of masks */ size_t mask_size; /* size of each mask in bytes */ }; #endif /* INPUTSTRUCT_H */ xorg-server-1.17.1/include/exevents.h0000664000175100017510000002617412274325511014462 00000000000000/************************************************************ Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ /******************************************************************** * Interface of 'exevents.c' */ #ifndef EXEVENTS_H #define EXEVENTS_H #include #include "inputstr.h" /*************************************************************** * Interface available to drivers * ***************************************************************/ /** * Scroll flags for ::SetScrollValuator. */ enum ScrollFlags { SCROLL_FLAG_NONE = 0, /** * Do not emulate legacy button events for valuator events on this axis. */ SCROLL_FLAG_DONT_EMULATE = (1 << 1), /** * This axis is the preferred axis for valuator emulation for this axis' * scroll type. */ SCROLL_FLAG_PREFERRED = (1 << 2) }; extern _X_EXPORT int InitProximityClassDeviceStruct(DeviceIntPtr /* dev */ ); extern _X_EXPORT Bool InitValuatorAxisStruct(DeviceIntPtr /* dev */ , int /* axnum */ , Atom /* label */ , int /* minval */ , int /* maxval */ , int /* resolution */ , int /* min_res */ , int /* max_res */ , int /* mode */ ); extern _X_EXPORT Bool SetScrollValuator(DeviceIntPtr /* dev */ , int /* axnum */ , enum ScrollType /* type */ , double /* increment */ , int /* flags */ ); /* Input device properties */ extern _X_EXPORT void XIDeleteAllDeviceProperties(DeviceIntPtr /* device */ ); extern _X_EXPORT int XIDeleteDeviceProperty(DeviceIntPtr /* device */ , Atom /* property */ , Bool /* fromClient */ ); extern _X_EXPORT int XIChangeDeviceProperty(DeviceIntPtr /* dev */ , Atom /* property */ , Atom /* type */ , int /* format */ , int /* mode */ , unsigned long /* len */ , const void * /* value */ , Bool /* sendevent */ ); extern _X_EXPORT int XIGetDeviceProperty(DeviceIntPtr /* dev */ , Atom /* property */ , XIPropertyValuePtr * /* value */ ); extern _X_EXPORT int XISetDevicePropertyDeletable(DeviceIntPtr /* dev */ , Atom /* property */ , Bool /* deletable */ ); extern _X_EXPORT long XIRegisterPropertyHandler(DeviceIntPtr dev, int (*SetProperty) (DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, BOOL checkonly), int (*GetProperty) (DeviceIntPtr dev, Atom property), int (*DeleteProperty) (DeviceIntPtr dev, Atom property) ); extern _X_EXPORT void XIUnregisterPropertyHandler(DeviceIntPtr dev, long id); extern _X_EXPORT Atom XIGetKnownProperty(const char *name); extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev); extern _X_EXPORT int XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return); extern _X_EXPORT int XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return); /**************************************************************************** * End of driver interface * ****************************************************************************/ /** * Attached to the devPrivates of each client. Specifies the version number as * supported by the client. */ typedef struct _XIClientRec { int major_version; int minor_version; } XIClientRec, *XIClientPtr; typedef struct _GrabParameters { int grabtype; /* CORE, etc. */ unsigned int ownerEvents; unsigned int this_device_mode; unsigned int other_devices_mode; Window grabWindow; Window confineTo; Cursor cursor; unsigned int modifiers; } GrabParameters; extern int UpdateDeviceState(DeviceIntPtr /* device */ , DeviceEvent * /* xE */ ); extern void ProcessOtherEvent(InternalEvent * /* ev */ , DeviceIntPtr /* other */ ); extern int CheckGrabValues(ClientPtr /* client */ , GrabParameters * /* param */ ); extern int GrabButton(ClientPtr /* client */ , DeviceIntPtr /* dev */ , DeviceIntPtr /* modifier_device */ , int /* button */ , GrabParameters * /* param */ , enum InputLevel /* grabtype */ , GrabMask * /* eventMask */ ); extern int GrabKey(ClientPtr /* client */ , DeviceIntPtr /* dev */ , DeviceIntPtr /* modifier_device */ , int /* key */ , GrabParameters * /* param */ , enum InputLevel /* grabtype */ , GrabMask * /* eventMask */ ); extern int GrabWindow(ClientPtr /* client */ , DeviceIntPtr /* dev */ , int /* type */ , GrabParameters * /* param */ , GrabMask * /* eventMask */ ); extern int GrabTouch(ClientPtr /* client */ , DeviceIntPtr /* dev */ , DeviceIntPtr /* mod_dev */ , GrabParameters * /* param */ , GrabMask * /* eventMask */ ); extern int SelectForWindow(DeviceIntPtr /* dev */ , WindowPtr /* pWin */ , ClientPtr /* client */ , Mask /* mask */ , Mask /* exclusivemasks */ ); extern int AddExtensionClient(WindowPtr /* pWin */ , ClientPtr /* client */ , Mask /* mask */ , int /* mskidx */ ); extern void RecalculateDeviceDeliverableEvents(WindowPtr /* pWin */ ); extern int InputClientGone(WindowPtr /* pWin */ , XID /* id */ ); extern void WindowGone(WindowPtr /* win */ ); extern int SendEvent(ClientPtr /* client */ , DeviceIntPtr /* d */ , Window /* dest */ , Bool /* propagate */ , xEvent * /* ev */ , Mask /* mask */ , int /* count */ ); extern int SetButtonMapping(ClientPtr /* client */ , DeviceIntPtr /* dev */ , int /* nElts */ , BYTE * /* map */ ); extern int ChangeKeyMapping(ClientPtr /* client */ , DeviceIntPtr /* dev */ , unsigned /* len */ , int /* type */ , KeyCode /* firstKeyCode */ , CARD8 /* keyCodes */ , CARD8 /* keySymsPerKeyCode */ , KeySym * /* map */ ); extern void DeleteWindowFromAnyExtEvents(WindowPtr /* pWin */ , Bool /* freeResources */ ); extern int MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * /* pEvents */ , Mask /* mask */ ); extern void CheckDeviceGrabAndHintWindow(WindowPtr /* pWin */ , int /* type */ , deviceKeyButtonPointer * /* xE */ , GrabPtr /* grab */ , ClientPtr /* client */ , Mask /* deliveryMask */ ); extern void MaybeStopDeviceHint(DeviceIntPtr /* dev */ , ClientPtr /* client */ ); extern int DeviceEventSuppressForWindow(WindowPtr /* pWin */ , ClientPtr /* client */ , Mask /* mask */ , int /* maskndx */ ); extern void SendEventToAllWindows(DeviceIntPtr /* dev */ , Mask /* mask */ , xEvent * /* ev */ , int /* count */ ); extern void TouchRejected(DeviceIntPtr /* sourcedev */ , TouchPointInfoPtr /* ti */ , XID /* resource */ , TouchOwnershipEvent * /* ev */ ); extern _X_HIDDEN void XI2EventSwap(xGenericEvent * /* from */ , xGenericEvent * /* to */ ); /* For an event such as MappingNotify which affects client interpretation * of input events sent by device dev, should we notify the client, or * would it merely be irrelevant and confusing? */ extern int XIShouldNotify(ClientPtr client, DeviceIntPtr dev); extern void XISendDeviceChangedEvent(DeviceIntPtr device, DeviceChangedEvent *dce); extern int XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, unsigned int len, unsigned char *mask); extern int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len); #endif /* EXEVENTS_H */ xorg-server-1.17.1/include/dixfontstubs.h0000664000175100017510000000361512274325511015350 00000000000000#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 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 xorg-server-1.17.1/include/kdrive-config.h.in0000664000175100017510000000142512274325511015745 00000000000000/* kdrive-config.h.in: not at all generated. -*- c -*- */ #ifndef _KDRIVE_CONFIG_H_ #define _KDRIVE_CONFIG_H_ #include #include /* Building kdrive server. */ #undef KDRIVESERVER /* Include framebuffer support in X servers */ #undef KDRIVEFBDEV /* Enable touchscreen support */ #undef TOUCHSCREEN /* Support tslib touchscreen abstraction library */ #undef TSLIB /* Support KDrive kbd driver */ #undef KDRIVE_KBD /* Support KDrive mouse driver */ #undef KDRIVE_MOUSE /* Support KDrive evdev driver */ #undef KDRIVE_EVDEV /* Verbose debugging output hilarity */ #undef DEBUG /* Have the backtrace() function. */ #undef HAVE_BACKTRACE /* Have execinfo.h for backtrace(). */ #undef HAVE_EXECINFO_H #endif /* _KDRIVE_CONFIG_H_ */ xorg-server-1.17.1/include/opaque.h0000664000175100017510000000522012362011424014071 00000000000000/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef OPAQUE_H #define OPAQUE_H #include #include "globals.h" extern _X_EXPORT const char *defaultTextFont; extern _X_EXPORT const char *defaultCursorFont; extern _X_EXPORT int MaxClients; extern _X_EXPORT volatile char isItTimeToYield; extern _X_EXPORT volatile char dispatchException; /* bit values for dispatchException */ #define DE_RESET 1 #define DE_TERMINATE 2 #define DE_PRIORITYCHANGE 4 /* set when a client's priority changes */ extern _X_EXPORT CARD32 TimeOutValue; extern _X_EXPORT int ScreenSaverBlanking; extern _X_EXPORT int ScreenSaverAllowExposures; extern _X_EXPORT int defaultScreenSaverBlanking; extern _X_EXPORT int defaultScreenSaverAllowExposures; extern _X_EXPORT const char *display; extern _X_EXPORT int displayfd; extern _X_EXPORT Bool explicit_display; extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; extern _X_EXPORT Bool enableBackingStore; extern _X_EXPORT Bool enableIndirectGLX; extern _X_EXPORT Bool PartialNetwork; extern _X_EXPORT Bool RunFromSigStopParent; #ifdef RLIMIT_DATA extern _X_EXPORT int limitDataSpace; #endif #ifdef RLIMIT_STACK extern _X_EXPORT int limitStackSpace; #endif #ifdef RLIMIT_NOFILE extern _X_EXPORT int limitNoFile; #endif extern _X_EXPORT Bool defeatAccessControl; extern _X_EXPORT long maxBigRequestSize; extern _X_EXPORT Bool party_like_its_1989; extern _X_EXPORT Bool whiteRoot; extern _X_EXPORT Bool bgNoneRoot; extern _X_EXPORT Bool CoreDump; extern _X_EXPORT Bool NoListenAll; #endif /* OPAQUE_H */ xorg-server-1.17.1/include/Xprintf.h0000664000175100017510000000613512274325511014246 00000000000000/* * Copyright (c) 2010, Oracle and/or its affiliates. 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 (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 XPRINTF_H #define XPRINTF_H #include #include #include #ifndef _X_RESTRICT_KYWD #if defined(restrict) /* assume autoconf set it correctly */ || \ (defined(__STDC__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ #define _X_RESTRICT_KYWD restrict #elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ #define _X_RESTRICT_KYWD __restrict__ #else #define _X_RESTRICT_KYWD #endif #endif /* * These functions provide a portable implementation of the common (but not * yet universal) asprintf & vasprintf routines to allocate a buffer big * enough to sprintf the arguments to. The XNF variants terminate the server * if the allocation fails. * The buffer allocated is returned in the pointer provided in the first * argument. The return value is the size of the allocated buffer, or -1 * on failure. */ extern _X_EXPORT int Xasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern _X_EXPORT int Xvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va) _X_ATTRIBUTE_PRINTF(2, 0); extern _X_EXPORT int XNFasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern _X_EXPORT int XNFvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va) _X_ATTRIBUTE_PRINTF(2, 0); #if !defined(HAVE_ASPRINTF) && !defined(HAVE_VASPRINTF) #define asprintf Xasprintf #define vasprintf Xvasprintf #endif /* * These functions provide a portable implementation of the linux kernel * scnprintf & vscnprintf routines that return the number of bytes actually * copied during a snprintf, (excluding the final '\0'). */ extern _X_EXPORT int Xscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, ...) _X_ATTRIBUTE_PRINTF(3,4); extern _X_EXPORT int Xvscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, va_list va) _X_ATTRIBUTE_PRINTF(3,0); #endif /* XPRINTF_H */ xorg-server-1.17.1/include/xorg-server.h.in0000664000175100017510000001105312366751547015515 00000000000000/* xorg-server.h.in -*- c -*- * * This file is the template file for the xorg-server.h file which gets * installed as part of the SDK. The #defines in this file overlap * with those from config.h, but only for those options that we want * to export to external modules. Boilerplate autotool #defines such * as HAVE_STUFF and PACKAGE_NAME is kept in config.h * * It is still possible to update config.h.in using autoheader, since * autoheader only creates a .h.in file for the first * AM_CONFIG_HEADER() line, and thus does not overwrite this file. * * However, it should be kept in sync with this file. */ #ifndef _XORG_SERVER_H_ #define _XORG_SERVER_H_ #ifdef HAVE_XORG_CONFIG_H #error Include xorg-config.h when building the X server #endif /* Support BigRequests extension */ #undef BIGREQS /* Default font path */ #undef COMPILEDDEFAULTFONTPATH /* Support Composite Extension */ #undef COMPOSITE /* Build DPMS extension */ #undef DPMSExtension /* Build DRI3 extension */ #undef DRI3 /* Build GLX extension */ #undef GLXEXT /* Support XDM-AUTH*-1 */ #undef HASXDMAUTH /* Support SHM */ #undef HAS_SHM /* Define to 1 if you have the `ffs' function. */ #undef HAVE_FFS /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Support IPv6 for TCP connections */ #undef IPv6 /* Support MIT-SHM Extension */ #undef MITSHM /* Internal define for Xinerama */ #undef PANORAMIX /* Support Present extension */ #undef PRESENT /* Support RANDR extension */ #undef RANDR /* Support RENDER extension */ #undef RENDER /* Support X resource extension */ #undef RES /* Support MIT-SCREEN-SAVER extension */ #undef SCREENSAVER /* Support SHAPE extension */ #undef SHAPE /* Define to 1 on systems derived from System V Release 4 */ #undef SVR4 /* Support TCP socket connections */ #undef TCPCONN /* Enable touchscreen support */ #undef TOUCHSCREEN /* Support tslib touchscreen abstraction library */ #undef TSLIB /* Support UNIX socket connections */ #undef UNIXCONN /* unaligned word accesses behave as expected */ #undef WORKING_UNALIGNED_INT /* Support XCMisc extension */ #undef XCMISC /* Support Xdmcp */ #undef XDMCP /* Build XFree86 BigFont extension */ #undef XF86BIGFONT /* Support XFree86 Video Mode extension */ #undef XF86VIDMODE /* Build XDGA support */ #undef XFreeXDGA /* Support Xinerama extension */ #undef XINERAMA /* Support X Input extension */ #undef XINPUT /* XKB default rules */ #undef XKB_DFLT_RULES /* Support loadable input and output drivers */ #undef XLOADABLE /* Build DRI extension */ #undef XF86DRI /* Build DRI2 extension */ #undef DRI2 /* Build Xorg server */ #undef XORGSERVER /* Vendor release */ #undef XORG_RELEASE /* Current Xorg version */ #undef XORG_VERSION_CURRENT /* Build Xv Extension */ #undef XvExtension /* Build XvMC Extension */ #undef XvMCExtension /* Support XSync extension */ #undef XSYNC /* Support XTest extension */ #undef XTEST /* Support Xv Extension */ #undef XV /* Vendor name */ #undef XVENDORNAME /* BSD-compliant source */ #undef _BSD_SOURCE /* POSIX-compliant source */ #undef _POSIX_SOURCE /* X/Open-compliant source */ #undef _XOPEN_SOURCE /* Vendor web address for support */ #undef __VENDORDWEBSUPPORT__ /* Location of configuration file */ #undef __XCONFIGFILE__ /* Name of X server */ #undef __XSERVERNAME__ /* Building vgahw module */ #undef WITH_VGAHW /* System is BSD-like */ #undef CSRG_BASED /* System has PC console */ #undef PCCONS_SUPPORT /* System has PCVT console */ #undef PCVT_SUPPORT /* System has syscons console */ #undef SYSCONS_SUPPORT /* System has wscons console */ #undef WSCONS_SUPPORT /* Loadable XFree86 server awesomeness */ #define XFree86LOADER /* Use libpciaccess */ #undef XSERVER_LIBPCIACCESS /* X Access Control Extension */ #undef XACE /* Have X server platform bus support */ #undef XSERVER_PLATFORM_BUS #ifdef _LP64 #define _XSERVER64 1 #endif /* Have support for X shared memory fence library (xshmfence) */ #undef HAVE_XSHMFENCE /* Use XTrans FD passing support */ #undef XTRANS_SEND_FDS /* Ask fontsproto to make font path element names const */ #define FONT_PATH_ELEMENT_NAME_CONST 1 /* byte order */ #undef X_BYTE_ORDER #endif /* _XORG_SERVER_H_ */ xorg-server-1.17.1/include/extinit.h0000664000175100017510000001321112274325511014271 00000000000000/************************************************************ Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ /* * 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 #define EXTINIT_H #include "extnsionst.h" #ifdef COMPOSITE extern _X_EXPORT Bool noCompositeExtension; extern void CompositeExtensionInit(void); #endif #ifdef DAMAGE extern _X_EXPORT Bool noDamageExtension; extern void DamageExtensionInit(void); #endif #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); extern _X_EXPORT Bool noXFixesExtension; extern void XFixesExtensionInit(void); 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 #if defined(DRI3) #include extern void dri3_extension_init(void); #endif #if defined(PRESENT) #include #include "presentext.h" #endif #endif xorg-server-1.17.1/include/optionstr.h0000664000175100017510000000036412274325511014653 00000000000000#ifndef OPTIONSTR_H_ #define OPTIONSTR_H_ #include "list.h" struct _InputOption { GenericListRec list; char *opt_name; char *opt_val; int opt_used; char *opt_comment; }; #endif /* INPUTSTRUCT_H */ xorg-server-1.17.1/include/site.h0000664000175100017510000001126212456571574013573 00000000000000/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ********************************************************/ #ifndef SITE_H #define SITE_H /* * The vendor string identifies the vendor responsible for the * server executable. */ #ifndef VENDOR_STRING #define VENDOR_STRING "The X.Org Foundation" #endif /* * The vendor release number identifies, for the purpose of submitting * traceable bug reports, the release number of software produced * by the vendor. */ #ifndef VENDOR_RELEASE #define VENDOR_RELEASE 6600 #endif /* * The following constants are provided solely as a last line of defense. The * normal build ALWAYS overrides them using a special rule given in * server/dix/Imakefile. If you want to change either of these constants, * you should set the DefaultFontPath or DefaultRGBDatabase configuration * parameters. * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE! */ #ifndef COMPILEDDEFAULTFONTPATH #define COMPILEDDEFAULTFONTPATH "/usr/share/fonts/X11/misc/" #endif /* * The following constants contain default values for all of the variables * that can be initialized on the server command line or in the environment. */ #define COMPILEDDEFAULTFONT "fixed" #define COMPILEDCURSORFONT "cursor" #ifndef COMPILEDDISPLAYCLASS #define COMPILEDDISPLAYCLASS "MIT-unspecified" #endif #define DEFAULT_TIMEOUT 60 /* seconds */ #define DEFAULT_KEYBOARD_CLICK 0 #define DEFAULT_BELL 50 #define DEFAULT_BELL_PITCH 400 #define DEFAULT_BELL_DURATION 100 #define DEFAULT_AUTOREPEAT TRUE #define DEFAULT_AUTOREPEATS {\ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} #define DEFAULT_LEDS 0x0 /* all off */ #define DEFAULT_LEDS_MASK 0xffffffff /* 32 */ #define DEFAULT_INT_RESOLUTION 1000 #define DEFAULT_INT_MIN_VALUE 0 #define DEFAULT_INT_MAX_VALUE 100 #define DEFAULT_INT_DISPLAYED 0 #define DEFAULT_PTR_NUMERATOR 2 #define DEFAULT_PTR_DENOMINATOR 1 #define DEFAULT_PTR_THRESHOLD 4 #define DEFAULT_SCREEN_SAVER_TIME (10 * (60 * 1000)) #define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000)) #define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking #define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures #ifndef DEFAULT_ACCESS_CONTROL #define DEFAULT_ACCESS_CONTROL TRUE #endif /* Default logging parameters. */ #ifndef DEFAULT_LOG_VERBOSITY #define DEFAULT_LOG_VERBOSITY 0 #endif #ifndef DEFAULT_LOG_FILE_VERBOSITY #define DEFAULT_LOG_FILE_VERBOSITY 3 #endif #endif /* SITE_H */ xorg-server-1.17.1/include/xkb-config.h.in0000664000175100017510000000111312274325511015237 00000000000000/* xkb-config.h.in: not at all generated. -*- c -*- * */ #ifndef _XKB_CONFIG_H_ #define _XKB_CONFIG_H_ /* Default set of XKB rules. */ #undef XKB_DFLT_RULES /* Default XKB model. */ #undef XKB_DFLT_MODEL /* Default XKB layout. */ #undef XKB_DFLT_LAYOUT /* Default XKB variant. */ #undef XKB_DFLT_VARIANT /* Default XKB options. */ #undef XKB_DFLT_OPTIONS /* Path to XKB definitions. */ #undef XKB_BASE_DIRECTORY /* Path to xkbcomp. */ #undef XKB_BIN_DIRECTORY /* XKB output dir for compiled keymaps. */ #undef XKM_OUTPUT_DIR #endif /* _XKB_CONFIG_H_ */ xorg-server-1.17.1/include/version-config.h.in0000664000175100017510000000040212274325511016140 00000000000000/* version-config.h.in: not generated */ #ifndef VERSION_CONFIG_H #define VERSION_CONFIG_H /* Vendor man version */ #undef VENDOR_MAN_VERSION /* Vendor name */ #undef VENDOR_NAME /* Vendor release */ #undef VENDOR_RELEASE #endif /* VERSION_CONFIG_H */ xorg-server-1.17.1/include/regionstr.h0000664000175100017510000002517712460512177014642 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef REGIONSTRUCT_H #define REGIONSTRUCT_H typedef struct pixman_region16 RegionRec, *RegionPtr; #include "miscstruct.h" /* Return values from RectIn() */ #define rgnOUT 0 #define rgnIN 1 #define rgnPART 2 #define NullRegion ((RegionPtr)0) /* * clip region */ typedef struct pixman_region16_data RegDataRec, *RegDataPtr; extern _X_EXPORT BoxRec RegionEmptyBox; extern _X_EXPORT RegDataRec RegionEmptyData; extern _X_EXPORT RegDataRec RegionBrokenData; static inline Bool RegionNil(RegionPtr reg) { return ((reg)->data && !(reg)->data->numRects); } /* not a region */ static inline Bool RegionNar(RegionPtr reg) { return ((reg)->data == &RegionBrokenData); } static inline int RegionNumRects(RegionPtr reg) { return ((reg)->data ? (reg)->data->numRects : 1); } static inline int RegionSize(RegionPtr reg) { return ((reg)->data ? (reg)->data->size : 0); } static inline BoxPtr RegionRects(RegionPtr reg) { return ((reg)->data ? (BoxPtr) ((reg)->data + 1) : &(reg)->extents); } static inline BoxPtr RegionBoxptr(RegionPtr reg) { return ((BoxPtr) ((reg)->data + 1)); } static inline BoxPtr RegionBox(RegionPtr reg, int i) { return (&RegionBoxptr(reg)[i]); } static inline BoxPtr RegionTop(RegionPtr reg) { return RegionBox(reg, (reg)->data->numRects); } static inline BoxPtr RegionEnd(RegionPtr reg) { return RegionBox(reg, (reg)->data->numRects - 1); } static inline size_t RegionSizeof(size_t n) { if (n < ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec))) return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); else return 0; } static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size) { if ((_rect) != NULL) { (_pReg)->extents = *(_rect); (_pReg)->data = (RegDataPtr) NULL; } else { size_t rgnSize; (_pReg)->extents = RegionEmptyBox; if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) && (((_pReg)->data = (RegDataPtr) malloc(rgnSize)) != NULL)) { (_pReg)->data->size = (_size); (_pReg)->data->numRects = 0; } else (_pReg)->data = &RegionEmptyData; } } static inline Bool RegionInitBoxes(RegionPtr pReg, BoxPtr boxes, int nBoxes) { return pixman_region_init_rects(pReg, boxes, nBoxes); } static inline void RegionUninit(RegionPtr _pReg) { if ((_pReg)->data && (_pReg)->data->size) { free((_pReg)->data); (_pReg)->data = NULL; } } static inline void RegionReset(RegionPtr _pReg, BoxPtr _pBox) { (_pReg)->extents = *(_pBox); RegionUninit(_pReg); (_pReg)->data = (RegDataPtr) NULL; } static inline Bool RegionNotEmpty(RegionPtr _pReg) { return !RegionNil(_pReg); } static inline Bool RegionBroken(RegionPtr _pReg) { return RegionNar(_pReg); } static inline void RegionEmpty(RegionPtr _pReg) { RegionUninit(_pReg); (_pReg)->extents.x2 = (_pReg)->extents.x1; (_pReg)->extents.y2 = (_pReg)->extents.y1; (_pReg)->data = &RegionEmptyData; } static inline BoxPtr RegionExtents(RegionPtr _pReg) { return (&(_pReg)->extents); } static inline void RegionNull(RegionPtr _pReg) { (_pReg)->extents = RegionEmptyBox; (_pReg)->data = &RegionEmptyData; } extern _X_EXPORT void InitRegions(void); extern _X_EXPORT RegionPtr RegionCreate(BoxPtr /*rect */ , int /*size */ ); extern _X_EXPORT void RegionDestroy(RegionPtr /*pReg */ ); extern _X_EXPORT RegionPtr RegionDuplicate(RegionPtr /* pOld */); static inline Bool RegionCopy(RegionPtr dst, RegionPtr src) { return pixman_region_copy(dst, src); } static inline Bool RegionIntersect(RegionPtr newReg, /* destination Region */ RegionPtr reg1, RegionPtr reg2 /* source regions */ ) { return pixman_region_intersect(newReg, reg1, reg2); } static inline Bool RegionUnion(RegionPtr newReg, /* destination Region */ RegionPtr reg1, RegionPtr reg2 /* source regions */ ) { return pixman_region_union(newReg, reg1, reg2); } extern _X_EXPORT Bool RegionAppend(RegionPtr /*dstrgn */ , RegionPtr /*rgn */ ); extern _X_EXPORT Bool RegionValidate(RegionPtr /*badreg */ , Bool * /*pOverlap */ ); extern _X_EXPORT RegionPtr RegionFromRects(int /*nrects */ , xRectanglePtr /*prect */ , int /*ctype */ ); /*- *----------------------------------------------------------------------- * Subtract -- * Subtract regS from regM and leave the result in regD. * S stands for subtrahend, M for minuend and D for difference. * * Results: * TRUE if successful. * * Side Effects: * regD is overwritten. * *----------------------------------------------------------------------- */ static inline Bool RegionSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS) { return pixman_region_subtract(regD, regM, regS); } /*- *----------------------------------------------------------------------- * Inverse -- * Take a region and a box and return a region that is everything * in the box but not in the region. The careful reader will note * that this is the same as subtracting the region from the box... * * Results: * TRUE. * * Side Effects: * newReg is overwritten. * *----------------------------------------------------------------------- */ static inline Bool RegionInverse(RegionPtr newReg, /* Destination region */ RegionPtr reg1, /* Region to invert */ BoxPtr invRect /* Bounding box for inversion */ ) { return pixman_region_inverse(newReg, reg1, invRect); } static inline int RegionContainsRect(RegionPtr region, BoxPtr prect) { return pixman_region_contains_rectangle(region, prect); } /* TranslateRegion(pReg, x, y) translates in place */ static inline void RegionTranslate(RegionPtr pReg, int x, int y) { pixman_region_translate(pReg, x, y); } extern _X_EXPORT Bool RegionBreak(RegionPtr /*pReg */ ); static inline Bool RegionContainsPoint(RegionPtr pReg, int x, int y, BoxPtr box /* "return" value */ ) { return pixman_region_contains_point(pReg, x, y, box); } static inline Bool RegionEqual(RegionPtr reg1, RegionPtr reg2) { return pixman_region_equal(reg1, reg2); } extern _X_EXPORT Bool RegionRectAlloc(RegionPtr /*pRgn */ , int /*n */ ); #ifdef DEBUG extern _X_EXPORT Bool RegionIsValid(RegionPtr /*prgn */ ); #endif extern _X_EXPORT void RegionPrint(RegionPtr /*pReg */ ); #define INCLUDE_LEGACY_REGION_DEFINES #ifdef INCLUDE_LEGACY_REGION_DEFINES #define REGION_NIL RegionNil #define REGION_NAR RegionNar #define REGION_NUM_RECTS RegionNumRects #define REGION_SIZE RegionSize #define REGION_RECTS RegionRects #define REGION_BOXPTR RegionBoxptr #define REGION_BOX RegionBox #define REGION_TOP RegionTop #define REGION_END RegionEnd #define REGION_SZOF RegionSizeof #define BITMAP_TO_REGION BitmapToRegion #define REGION_CREATE(pScreen, r, s) RegionCreate(r,s) #define REGION_COPY(pScreen, d, r) RegionCopy(d, r) #define REGION_DESTROY(pScreen, r) RegionDestroy(r) #define REGION_INTERSECT(pScreen, res, r1, r2) RegionIntersect(res, r1, r2) #define REGION_UNION(pScreen, res, r1, r2) RegionUnion(res, r1, r2) #define REGION_SUBTRACT(pScreen, res, r1, r2) RegionSubtract(res, r1, r2) #define REGION_INVERSE(pScreen, n, r, b) RegionInverse(n, r, b) #define REGION_TRANSLATE(pScreen, r, x, y) RegionTranslate(r, x, y) #define RECT_IN_REGION(pScreen, r, b) RegionContainsRect(r, b) #define POINT_IN_REGION(pScreen, r, x, y, b) RegionContainsPoint(r, x, y, b) #define REGION_EQUAL(pScreen, r1, r2) RegionEqual(r1, r2) #define REGION_APPEND(pScreen, d, r) RegionAppend(d, r) #define REGION_VALIDATE(pScreen, r, o) RegionValidate(r, o) #define RECTS_TO_REGION(pScreen, n, r, c) RegionFromRects(n, r, c) #define REGION_BREAK(pScreen, r) RegionBreak(r) #define REGION_INIT(pScreen, r, b, s) RegionInit(r, b, s) #define REGION_UNINIT(pScreen, r) RegionUninit(r) #define REGION_RESET(pScreen, r, b) RegionReset(r, b) #define REGION_NOTEMPTY(pScreen, r) RegionNotEmpty(r) #define REGION_BROKEN(pScreen, r) RegionBroken(r) #define REGION_EMPTY(pScreen, r) RegionEmpty(r) #define REGION_EXTENTS(pScreen, r) RegionExtents(r) #define REGION_NULL(pScreen, r) RegionNull(r) #endif /* INCLUDE_LEGACY_REGION_DEFINES */ #endif /* REGIONSTRUCT_H */ xorg-server-1.17.1/include/pixmap.h0000664000175100017510000001173012456571574014125 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef PIXMAP_H #define PIXMAP_H #include "misc.h" #include "screenint.h" #include "regionstr.h" /* types for Drawable */ #define DRAWABLE_WINDOW 0 #define DRAWABLE_PIXMAP 1 #define UNDRAWABLE_WINDOW 2 /* corresponding type masks for dixLookupDrawable() */ #define M_DRAWABLE_WINDOW (1<<0) #define M_DRAWABLE_PIXMAP (1<<1) #define M_UNDRAWABLE_WINDOW (1<<2) #define M_ANY (-1) #define M_WINDOW (M_DRAWABLE_WINDOW|M_UNDRAWABLE_WINDOW) #define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP) #define M_UNDRAWABLE (M_UNDRAWABLE_WINDOW) /* flags to PaintWindow() */ #define PW_BACKGROUND 0 #define PW_BORDER 1 #define NullPixmap ((PixmapPtr)0) typedef struct _Drawable *DrawablePtr; typedef struct _Pixmap *PixmapPtr; typedef struct _PixmapDirtyUpdate *PixmapDirtyUpdatePtr; typedef union _PixUnion { PixmapPtr pixmap; unsigned long pixel; } PixUnion; #define SamePixUnion(a,b,isPixel)\ ((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap) #define EqualPixUnion(as, a, bs, b) \ ((as) == (bs) && (SamePixUnion (a, b, as))) #define OnScreenDrawable(type) \ (type == DRAWABLE_WINDOW) #define WindowDrawable(type) \ ((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW)) extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); extern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ ); extern _X_EXPORT Bool CreateScratchPixmapsForScreen(ScreenPtr /*pScreen */ ); 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); #define HAS_DIRTYTRACKING2 1 extern _X_EXPORT Bool PixmapStartDirtyTracking2(PixmapPtr src, PixmapPtr slave_dst, int x, int y, int dst_x, int dst_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 */ xorg-server-1.17.1/include/miscstruct.h0000664000175100017510000000507612456571574015035 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef MISCSTRUCT_H #define MISCSTRUCT_H 1 #include "misc.h" #include #include typedef xPoint DDXPointRec; typedef struct pixman_box16 BoxRec; typedef union _DevUnion { void *ptr; long val; unsigned long uval; void *(*fptr) (void); } DevUnion; #endif /* MISCSTRUCT_H */ xorg-server-1.17.1/include/servermd.h0000664000175100017510000001160412456571574014456 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef SERVERMD_H #define SERVERMD_H 1 #if !defined(_DIX_CONFIG_H_) && !defined(_XORG_SERVER_H_) #error Drivers must include xorg-server.h before any other xserver headers #error xserver code must include dix-config.h before any other headers #endif #if X_BYTE_ORDER == X_LITTLE_ENDIAN #define IMAGE_BYTE_ORDER LSBFirst #define BITMAP_BIT_ORDER LSBFirst #elif X_BYTE_ORDER == X_BIG_ENDIAN #define IMAGE_BYTE_ORDER MSBFirst #define BITMAP_BIT_ORDER MSBFirst #else #error "Too weird to live." #endif #ifndef GLYPHPADBYTES #define GLYPHPADBYTES 4 #endif /* size of buffer to use with GetImage, measured in bytes. There's obviously * a trade-off between the amount of heap used and the number of times the * ddx routine has to be called. */ #ifndef IMAGE_BUFSIZE #define IMAGE_BUFSIZE (64*1024) #endif /* pad scanline to a longword */ #ifndef BITMAP_SCANLINE_UNIT #define BITMAP_SCANLINE_UNIT 32 #endif #ifndef BITMAP_SCANLINE_PAD #define BITMAP_SCANLINE_PAD 32 #define LOG2_BITMAP_PAD 5 #define LOG2_BYTES_PER_SCANLINE_PAD 2 #endif #include /* * This returns the number of padding units, for depth d and width w. * For bitmaps this can be calculated with the macros above. * Other depths require either grovelling over the formats field of the * screenInfo or hardwired constants. */ typedef struct _PaddingInfo { int padRoundUp; /* pixels per pad unit - 1 */ int padPixelsLog2; /* log 2 (pixels per pad unit) */ int padBytesLog2; /* log 2 (bytes per pad unit) */ int notPower2; /* bitsPerPixel not a power of 2 */ int bytesPerPixel; /* only set when notPower2 is TRUE */ int bitsPerPixel; /* bits per pixel */ } PaddingInfo; extern _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[]; /* The only portable way to get the bpp from the depth is to look it up */ #define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel) #define PixmapWidthInPadUnits(w, d) \ (PixmapWidthPaddingInfo[d].notPower2 ? \ (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \ PixmapWidthPaddingInfo[d].bytesPerPixel) >> \ PixmapWidthPaddingInfo[d].padBytesLog2) : \ ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \ PixmapWidthPaddingInfo[d].padPixelsLog2)) /* * Return the number of bytes to which a scanline of the given * depth and width will be padded. */ #define PixmapBytePad(w, d) \ (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2) #define BitmapBytePad(w) \ (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD) #endif /* SERVERMD_H */ xorg-server-1.17.1/include/propertyst.h0000664000175100017510000000546312456571574015070 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef PROPERTYSTRUCT_H #define PROPERTYSTRUCT_H #include "misc.h" #include "property.h" #include "privates.h" /* * PROPERTY -- property element */ typedef struct _Property { struct _Property *next; ATOM propertyName; ATOM type; /* ignored by server */ uint32_t format; /* format of data for swapping - 8,16,32 */ uint32_t size; /* size of data in (format/8) bytes */ void *data; /* private to client */ PrivateRec *devPrivates; } PropertyRec; #endif /* PROPERTYSTRUCT_H */ xorg-server-1.17.1/include/extnsionst.h0000664000175100017510000001047312456571574015050 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef EXTENSIONSTRUCT_H #define EXTENSIONSTRUCT_H #include "dix.h" #include "misc.h" #include "screenint.h" #include "extension.h" #include "gc.h" #include "privates.h" typedef struct _ExtensionEntry { int index; void (*CloseDown) ( /* called at server shutdown */ struct _ExtensionEntry * /* extension */ ); const char *name; /* extension name */ int base; /* base request number */ int eventBase; int eventLast; int errorBase; int errorLast; int num_aliases; const char **aliases; void *extPrivate; unsigned short (*MinorOpcode) ( /* called for errors */ ClientPtr /* client */ ); PrivateRec *devPrivates; } ExtensionEntry; /* * The arguments may be different for extension event swapping functions. * Deal with this by casting when initializing the event's EventSwapVector[] * entries. */ typedef void (*EventSwapPtr) (xEvent *, xEvent *); extern _X_EXPORT EventSwapPtr EventSwapVector[128]; extern _X_EXPORT void NotImplemented( /* FIXME: this may move to another file... */ xEvent *, xEvent *) _X_NORETURN; #define SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom) \ pGC->VectorElement = NewRoutineAddress; #define GetGCValue(pGC, GCElement) (pGC->GCElement) extern _X_EXPORT ExtensionEntry * AddExtension(const char * /*name */ , int /*NumEvents */ , int /*NumErrors */ , int (* /*MainProc */ )(ClientPtr /*client */ ), int (* /*SwappedMainProc */ )(ClientPtr /*client */ ), void (* /*CloseDownProc */ )(ExtensionEntry * /*extension */ ), unsigned short (* /*MinorOpcodeProc */ )(ClientPtr /*client */ ) ); extern _X_EXPORT Bool AddExtensionAlias(const char * /*alias */ , ExtensionEntry * /*extension */ ); extern _X_EXPORT ExtensionEntry * CheckExtension(const char *extname); extern _X_EXPORT ExtensionEntry * GetExtensionEntry(int major); #endif /* EXTENSIONSTRUCT_H */ xorg-server-1.17.1/include/closestr.h0000664000175100017510000000573212274325511014454 00000000000000/* Copyright 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef CLOSESTR_H #define CLOSESTR_H #include #include "closure.h" #include "dix.h" #include "misc.h" #include "gcstruct.h" /* closure structures */ /* OpenFont */ typedef struct _OFclosure { ClientPtr client; short current_fpe; short num_fpes; FontPathElementPtr *fpe_list; Mask flags; /* XXX -- get these from request buffer instead? */ const char *origFontName; int origFontNameLen; XID fontid; char *fontname; int fnamelen; FontPtr non_cachable_font; } OFclosureRec; /* ListFontsWithInfo */ #define XLFDMAXFONTNAMELEN 256 typedef struct _LFWIstate { char pattern[XLFDMAXFONTNAMELEN]; int patlen; int current_fpe; int max_names; Bool list_started; void *private; } LFWIstateRec, *LFWIstatePtr; typedef struct _LFWIclosure { ClientPtr client; int num_fpes; FontPathElementPtr *fpe_list; xListFontsWithInfoReply *reply; int length; LFWIstateRec current; LFWIstateRec saved; int savedNumFonts; Bool haveSaved; char *savedName; } LFWIclosureRec; /* ListFonts */ typedef struct _LFclosure { ClientPtr client; int num_fpes; FontPathElementPtr *fpe_list; FontNamesPtr names; LFWIstateRec current; LFWIstateRec saved; Bool haveSaved; char *savedName; int savedNameLen; } LFclosureRec; /* PolyText */ typedef struct _PTclosure { ClientPtr client; DrawablePtr pDraw; GC *pGC; unsigned char *pElt; unsigned char *endReq; unsigned char *data; int xorg; int yorg; CARD8 reqType; XID did; int err; } PTclosureRec; /* ImageText */ typedef struct _ITclosure { ClientPtr client; DrawablePtr pDraw; GC *pGC; BYTE nChars; unsigned char *data; int xorg; int yorg; CARD8 reqType; XID did; } ITclosureRec; #endif /* CLOSESTR_H */ xorg-server-1.17.1/include/resource.h0000664000175100017510000002512512456571574014461 00000000000000/*********************************************************** Copyright 1987, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef RESOURCE_H #define RESOURCE_H 1 #include "misc.h" #include "dixaccess.h" /***************************************************************** * STUFF FOR RESOURCES *****************************************************************/ /* classes for Resource routines */ typedef uint32_t RESTYPE; #define RC_VANILLA ((RESTYPE)0) #define RC_CACHED ((RESTYPE)1<<31) #define RC_DRAWABLE ((RESTYPE)1<<30) /* Use class RC_NEVERRETAIN for resources that should not be retained * regardless of the close down mode when the client dies. (A client's * event selections on objects that it doesn't own are good candidates.) * Extensions can use this too! */ #define RC_NEVERRETAIN ((RESTYPE)1<<29) #define RC_LASTPREDEF RC_NEVERRETAIN #define RC_ANY (~(RESTYPE)0) /* types for Resource routines */ #define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE) #define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE) #define RT_GC ((RESTYPE)3) #undef RT_FONT #undef RT_CURSOR #define RT_FONT ((RESTYPE)4) #define RT_CURSOR ((RESTYPE)5) #define RT_COLORMAP ((RESTYPE)6) #define RT_CMAPENTRY ((RESTYPE)7) #define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN) #define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN) #define RT_LASTPREDEF ((RESTYPE)9) #define RT_NONE ((RESTYPE)0) /* bits and fields within a resource id */ #define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */ #if MAXCLIENTS == 64 #define RESOURCE_CLIENT_BITS 6 #endif #if MAXCLIENTS == 128 #define RESOURCE_CLIENT_BITS 7 #endif #if MAXCLIENTS == 256 #define RESOURCE_CLIENT_BITS 8 #endif #if MAXCLIENTS == 512 #define RESOURCE_CLIENT_BITS 9 #endif /* client field offset */ #define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS) /* resource field */ #define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1) /* client field */ #define RESOURCE_CLIENT_MASK (((1 << RESOURCE_CLIENT_BITS) - 1) << CLIENTOFFSET) /* extract the client mask from an XID */ #define CLIENT_BITS(id) ((id) & RESOURCE_CLIENT_MASK) /* extract the client id from an XID */ #define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET)) #define SERVER_BIT (Mask)0x40000000 /* use illegal bit */ #ifdef INVALID #undef INVALID /* needed on HP/UX */ #endif /* Invalid resource id */ #define INVALID (0) #define BAD_RESOURCE 0xe0000000 #define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) /* Resource state callback */ extern _X_EXPORT CallbackListPtr ResourceStateCallback; typedef enum { ResourceStateAdding, ResourceStateFreeing } ResourceState; typedef struct { ResourceState state; XID id; RESTYPE type; void *value; } ResourceStateInfoRec; typedef int (*DeleteType) (void *value, XID id); typedef void (*FindResType) (void *value, XID id, void *cdata); typedef void (*FindAllRes) (void *value, XID id, RESTYPE type, void *cdata); typedef Bool (*FindComplexResType) (void *value, XID id, void *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)(void *value, XID id, ResourceSizePtr size); extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType deleteFunc, const char *name); typedef void (*FindTypeSubResources)(void *value, FindAllRes func, void *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); extern _X_EXPORT Bool InitClientResources(ClientPtr /*client */ ); extern _X_EXPORT XID FakeClientID(int /*client */ ); /* Quartz support on Mac OS X uses the CarbonCore framework whose AddResource function conflicts here. */ #ifdef __APPLE__ #define AddResource Darwin_X_AddResource #endif extern _X_EXPORT Bool AddResource(XID id, RESTYPE type, void *value); extern _X_EXPORT void FreeResource(XID /*id */ , RESTYPE /*skipDeleteFuncType */ ); extern _X_EXPORT void FreeResourceByType(XID /*id */ , RESTYPE /*type */ , Bool /*skipFree */ ); extern _X_EXPORT Bool ChangeResourceValue(XID id, RESTYPE rtype, void *value); extern _X_EXPORT void FindClientResourcesByType(ClientPtr client, RESTYPE type, FindResType func, void *cdata); extern _X_EXPORT void FindAllClientResources(ClientPtr client, FindAllRes func, void *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(void *resource, RESTYPE type, FindAllRes func, void *cdata); extern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ ); extern _X_EXPORT void FreeClientResources(ClientPtr /*client */ ); extern _X_EXPORT void FreeAllResources(void); extern _X_EXPORT Bool LegalNewID(XID /*id */ , ClientPtr /*client */ ); extern _X_EXPORT void *LookupClientResourceComplex(ClientPtr client, RESTYPE type, FindComplexResType func, void *cdata); extern _X_EXPORT int dixLookupResourceByType(void **result, XID id, RESTYPE rtype, ClientPtr client, Mask access_mode); extern _X_EXPORT int dixLookupResourceByClass(void **result, XID id, RESTYPE rclass, ClientPtr client, Mask access_mode); extern _X_EXPORT void GetXIDRange(int /*client */ , Bool /*server */ , XID * /*minp */ , XID * /*maxp */ ); extern _X_EXPORT unsigned int GetXIDList(ClientPtr /*client */ , unsigned int /*count */ , XID * /*pids */ ); extern _X_EXPORT RESTYPE lastResourceType; extern _X_EXPORT RESTYPE TypeMask; /** @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 */ xorg-server-1.17.1/include/xkbsrv.h0000664000175100017510000010350512456571574014150 00000000000000/************************************************************ Copyright (c) 1993 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. ********************************************************/ #ifndef _XKBSRV_H_ #define _XKBSRV_H_ #define XkbAllocClientMap SrvXkbAllocClientMap #define XkbAllocServerMap SrvXkbAllocServerMap #define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey #define XkbCopyKeyTypes SrvXkbCopyKeyTypes #define XkbFreeClientMap SrvXkbFreeClientMap #define XkbFreeServerMap SrvXkbFreeServerMap #define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols #define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey #define XkbResizeKeyActions SrvXkbResizeKeyActions #define XkbResizeKeySyms SrvXkbResizeKeySyms #define XkbResizeKeyType SrvXkbResizeKeyType #define XkbAllocCompatMap SrvXkbAllocCompatMap #define XkbAllocControls SrvXkbAllocControls #define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps #define XkbAllocKeyboard SrvXkbAllocKeyboard #define XkbAllocNames SrvXkbAllocNames #define XkbFreeCompatMap SrvXkbFreeCompatMap #define XkbFreeKeyboard SrvXkbFreeKeyboard #define XkbFreeNames SrvXkbFreeNames #define XkbLatchModifiers SrvXkbLatchModifiers #define XkbLatchGroup SrvXkbLatchGroup #define XkbVirtualModsToReal SrvXkbVirtualModsToReal #define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange #define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges #include #include "xkbstr.h" #include "xkbrules.h" #include "inputstr.h" #include "events.h" typedef struct _XkbInterest { DeviceIntPtr dev; ClientPtr client; XID resource; struct _XkbInterest *next; CARD16 extDevNotifyMask; CARD16 stateNotifyMask; CARD16 namesNotifyMask; CARD32 ctrlsNotifyMask; CARD8 compatNotifyMask; BOOL bellNotifyMask; BOOL actionMessageMask; CARD16 accessXNotifyMask; CARD32 iStateNotifyMask; CARD32 iMapNotifyMask; CARD16 altSymsNotifyMask; CARD32 autoCtrls; CARD32 autoCtrlValues; } XkbInterestRec, *XkbInterestPtr; typedef struct _XkbRadioGroup { CARD8 flags; CARD8 nMembers; CARD8 dfltDown; CARD8 currentDown; CARD8 members[XkbRGMaxMembers]; } XkbRadioGroupRec, *XkbRadioGroupPtr; typedef struct _XkbEventCause { CARD8 kc; CARD8 event; CARD8 mjr; CARD8 mnr; ClientPtr client; } XkbEventCauseRec, *XkbEventCausePtr; #define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),\ (c)->mjr= (c)->mnr= 0; \ (c)->client= NULL; } #define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\ (c)->mjr= (j),(c)->mnr= (n);\ (c)->client= (cl); } #define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl) #define XkbSetCauseXkbReq(c,e,cl) XkbSetCauseReq(c,XkbReqCode,e,cl) #define XkbSetCauseUnknown(c) XkbSetCauseKey(c,0,0) #define _OFF_TIMER 0 #define _KRG_WARN_TIMER 1 #define _KRG_TIMER 2 #define _SK_TIMEOUT_TIMER 3 #define _ALL_TIMEOUT_TIMER 4 #define _BEEP_NONE 0 #define _BEEP_FEATURE_ON 1 #define _BEEP_FEATURE_OFF 2 #define _BEEP_FEATURE_CHANGE 3 #define _BEEP_SLOW_WARN 4 #define _BEEP_SLOW_PRESS 5 #define _BEEP_SLOW_ACCEPT 6 #define _BEEP_SLOW_REJECT 7 #define _BEEP_SLOW_RELEASE 8 #define _BEEP_STICKY_LATCH 9 #define _BEEP_STICKY_LOCK 10 #define _BEEP_STICKY_UNLOCK 11 #define _BEEP_LED_ON 12 #define _BEEP_LED_OFF 13 #define _BEEP_LED_CHANGE 14 #define _BEEP_BOUNCE_REJECT 15 typedef struct _XkbFilter { CARD16 keycode; CARD8 what; CARD8 active; CARD8 filterOthers; CARD32 priv; XkbAction upAction; int (*filter) (struct _XkbSrvInfo * /* xkbi */ , struct _XkbFilter * /* filter */ , unsigned /* keycode */ , XkbAction * /* action */ ); struct _XkbFilter *next; } XkbFilterRec, *XkbFilterPtr; typedef struct _XkbSrvInfo { XkbStateRec prev_state; XkbStateRec state; XkbDescPtr desc; DeviceIntPtr device; KbdCtrlProcPtr kbdProc; XkbRadioGroupPtr radioGroups; CARD8 nRadioGroups; CARD8 clearMods; CARD8 setMods; INT16 groupChange; CARD16 dfltPtrDelta; double mouseKeysCurve; double mouseKeysCurveFactor; INT16 mouseKeysDX; INT16 mouseKeysDY; CARD8 mouseKeysFlags; Bool mouseKeysAccel; CARD8 mouseKeysCounter; CARD8 lockedPtrButtons; CARD8 shiftKeyCount; KeyCode mouseKey; KeyCode inactiveKey; KeyCode slowKey; KeyCode slowKeyEnableKey; KeyCode repeatKey; CARD8 krgTimerActive; CARD8 beepType; CARD8 beepCount; CARD32 flags; CARD32 lastPtrEventTime; CARD32 lastShiftEventTime; OsTimerPtr beepTimer; OsTimerPtr mouseKeyTimer; OsTimerPtr slowKeysTimer; OsTimerPtr bounceKeysTimer; OsTimerPtr repeatKeyTimer; OsTimerPtr krgTimer; int szFilters; XkbFilterPtr filters; } XkbSrvInfoRec, *XkbSrvInfoPtr; #define XkbSLI_IsDefault (1L<<0) #define XkbSLI_HasOwnState (1L<<1) typedef struct _XkbSrvLedInfo { CARD16 flags; CARD16 class; CARD16 id; union { KbdFeedbackPtr kf; LedFeedbackPtr lf; } fb; CARD32 physIndicators; CARD32 autoState; CARD32 explicitState; CARD32 effectiveState; CARD32 mapsPresent; CARD32 namesPresent; XkbIndicatorMapPtr maps; Atom *names; CARD32 usesBase; CARD32 usesLatched; CARD32 usesLocked; CARD32 usesEffective; CARD32 usesCompat; CARD32 usesControls; CARD32 usedComponents; } XkbSrvLedInfoRec, *XkbSrvLedInfoPtr; /* * Settings for xkbClientFlags field (used by DIX) * These flags _must_ not overlap with XkbPCF_* */ #define _XkbClientInitialized (1<<15) #define _XkbWantsDetectableAutoRepeat(c)\ ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask) /* * Settings for flags field */ #define _XkbStateNotifyInProgress (1<<0) typedef struct { ProcessInputProc processInputProc; /* If processInputProc is set to something different than realInputProc, * UNWRAP and COND_WRAP will not touch processInputProc and update only * realInputProc. This ensures that * processInputProc == (frozen ? EnqueueEvent : realInputProc) * * WRAP_PROCESS_INPUT_PROC should only be called during initialization, * since it may destroy this invariant. */ ProcessInputProc realInputProc; DeviceUnwrapProc unwrapProc; } xkbDeviceInfoRec, *xkbDeviceInfoPtr; #define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \ device->public.processInputProc = proc; \ oldprocs->processInputProc = \ oldprocs->realInputProc = device->public.realInputProc; \ device->public.realInputProc = proc; \ oldprocs->unwrapProc = device->unwrapProc; \ device->unwrapProc = unwrapproc; #define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \ if (device->public.processInputProc == device->public.realInputProc)\ device->public.processInputProc = proc; \ oldprocs->processInputProc = \ oldprocs->realInputProc = device->public.realInputProc; \ device->public.realInputProc = proc; \ oldprocs->unwrapProc = device->unwrapProc; \ device->unwrapProc = unwrapproc; #define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs, backupproc) \ backupproc = device->public.realInputProc; \ if (device->public.processInputProc == device->public.realInputProc)\ device->public.processInputProc = oldprocs->realInputProc; \ device->public.realInputProc = oldprocs->realInputProc; \ device->unwrapProc = oldprocs->unwrapProc; extern _X_EXPORT DevPrivateKeyRec xkbDevicePrivateKeyRec; #define xkbDevicePrivateKey (&xkbDevicePrivateKeyRec) #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr)dixLookupPrivate(&(dev)->devPrivates, xkbDevicePrivateKey)) extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, void *); /***====================================================================***/ /***====================================================================***/ #define XkbAX_KRGMask (XkbSlowKeysMask|XkbBounceKeysMask) #define XkbAllFilteredEventsMask \ (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask) /***====================================================================***/ extern _X_EXPORT int XkbReqCode; extern _X_EXPORT int XkbEventBase; extern _X_EXPORT int XkbKeyboardErrorCode; extern _X_EXPORT const char *XkbBaseDirectory; 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))) #define Status int extern _X_EXPORT void XkbUseMsg(void ); extern _X_EXPORT int XkbProcessArguments(int /* argc */ , char ** /* argv */ , int /* i */ ); extern _X_EXPORT Bool XkbInitPrivates(void); extern _X_EXPORT void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc); extern _X_EXPORT void XkbFreeCompatMap(XkbDescPtr /* xkb */ , unsigned int /* which */ , Bool /* freeMap */ ); extern _X_EXPORT void XkbFreeNames(XkbDescPtr /* xkb */ , unsigned int /* which */ , Bool /* freeMap */ ); extern _X_EXPORT int _XkbLookupAnyDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err); extern _X_EXPORT int _XkbLookupKeyboard(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err); extern _X_EXPORT int _XkbLookupBellDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err); extern _X_EXPORT int _XkbLookupLedDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err); extern _X_EXPORT int _XkbLookupButtonDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err); extern _X_EXPORT XkbDescPtr XkbAllocKeyboard(void ); extern _X_EXPORT Status XkbAllocClientMap(XkbDescPtr /* xkb */ , unsigned int /* which */ , unsigned int /* nTypes */ ); extern _X_EXPORT Status XkbAllocServerMap(XkbDescPtr /* xkb */ , unsigned int /* which */ , unsigned int /* nNewActions */ ); extern _X_EXPORT void XkbFreeClientMap(XkbDescPtr /* xkb */ , unsigned int /* what */ , Bool /* freeMap */ ); extern _X_EXPORT void XkbFreeServerMap(XkbDescPtr /* xkb */ , unsigned int /* what */ , Bool /* freeMap */ ); extern _X_EXPORT Status XkbAllocIndicatorMaps(XkbDescPtr /* xkb */ ); extern _X_EXPORT Status XkbAllocCompatMap(XkbDescPtr /* xkb */ , unsigned int /* which */ , unsigned int /* nInterpret */ ); extern _X_EXPORT Status XkbAllocNames(XkbDescPtr /* xkb */ , unsigned int /* which */ , int /* nTotalRG */ , int /* nTotalAliases */ ); extern _X_EXPORT Status XkbAllocControls(XkbDescPtr /* xkb */ , unsigned int /* which */ ); extern _X_EXPORT Status XkbCopyKeyTypes(XkbKeyTypePtr /* from */ , XkbKeyTypePtr /* into */ , int /* num_types */ ); extern _X_EXPORT Status XkbResizeKeyType(XkbDescPtr /* xkb */ , int /* type_ndx */ , int /* map_count */ , Bool /* want_preserve */ , int /* new_num_lvls */ ); extern _X_EXPORT void XkbFreeKeyboard(XkbDescPtr /* xkb */ , unsigned int /* which */ , Bool /* freeDesc */ ); extern _X_EXPORT void XkbFreeComponentNames(XkbComponentNamesPtr /* names */ , Bool /* freeNames */ ); extern _X_EXPORT void XkbSetActionKeyMods(XkbDescPtr /* xkb */ , XkbAction * /* act */ , unsigned int /* mods */ ); extern _X_EXPORT unsigned int XkbMaskForVMask(XkbDescPtr /* xkb */ , unsigned int /* vmask */ ); extern _X_EXPORT Bool XkbVirtualModsToReal(XkbDescPtr /* xkb */ , unsigned int /* virtua_mask */ , unsigned int * /* mask_rtrn */ ); extern _X_EXPORT unsigned int XkbAdjustGroup(int /* group */ , XkbControlsPtr /* ctrls */ ); extern _X_EXPORT KeySym *XkbResizeKeySyms(XkbDescPtr /* xkb */ , int /* key */ , int /* needed */ ); extern _X_EXPORT XkbAction *XkbResizeKeyActions(XkbDescPtr /* xkb */ , int /* key */ , int /* needed */ ); extern _X_EXPORT void XkbUpdateKeyTypesFromCore(DeviceIntPtr /* pXDev */ , KeySymsPtr /* syms */ , KeyCode /* first */ , CARD8 /* num */ , XkbChangesPtr /* pChanges */ ); extern _X_EXPORT void XkbUpdateDescActions(XkbDescPtr /* xkb */ , KeyCode /* first */ , CARD8 /* num */ , XkbChangesPtr /* changes */ ); extern _X_EXPORT void XkbUpdateActions(DeviceIntPtr /* pXDev */ , KeyCode /* first */ , CARD8 /* num */ , XkbChangesPtr /* pChanges */ , unsigned int * /* needChecksRtrn */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT KeySymsPtr XkbGetCoreMap(DeviceIntPtr /* keybd */ ); extern _X_EXPORT void XkbApplyMappingChange(DeviceIntPtr /* pXDev */ , KeySymsPtr /* map */ , KeyCode /* firstKey */ , CARD8 /* num */ , CARD8 * /* modmap */ , ClientPtr /* client */ ); extern _X_EXPORT void XkbSetIndicators(DeviceIntPtr /* pXDev */ , CARD32 /* affect */ , CARD32 /* values */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void XkbUpdateIndicators(DeviceIntPtr /* keybd */ , CARD32 /* changed */ , Bool /* check_edevs */ , XkbChangesPtr /* pChanges */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT XkbSrvLedInfoPtr XkbAllocSrvLedInfo(DeviceIntPtr /* dev */ , KbdFeedbackPtr /* kf */ , LedFeedbackPtr /* lf */ , unsigned int /* needed_parts */ ); extern _X_EXPORT XkbSrvLedInfoPtr XkbCopySrvLedInfo(DeviceIntPtr /* dev */ , XkbSrvLedInfoPtr /* src */ , KbdFeedbackPtr /* kf */ , LedFeedbackPtr /* lf */ ); extern _X_EXPORT XkbSrvLedInfoPtr XkbFindSrvLedInfo(DeviceIntPtr /* dev */ , unsigned int /* class */ , unsigned int /* id */ , unsigned int /* needed_parts */ ); extern _X_EXPORT void XkbApplyLedNameChanges(DeviceIntPtr /* dev */ , XkbSrvLedInfoPtr /* sli */ , unsigned int /* changed_names */ , xkbExtensionDeviceNotify * /* ed */ , XkbChangesPtr /* changes */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void XkbApplyLedMapChanges(DeviceIntPtr /* dev */ , XkbSrvLedInfoPtr /* sli */ , unsigned int /* changed_maps */ , xkbExtensionDeviceNotify * /* ed */ , XkbChangesPtr /* changes */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void XkbApplyLedStateChanges(DeviceIntPtr /* dev */ , XkbSrvLedInfoPtr /* sli */ , unsigned int /* changed_leds */ , xkbExtensionDeviceNotify * /* ed */ , XkbChangesPtr /* changes */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void XkbFlushLedEvents(DeviceIntPtr /* dev */ , DeviceIntPtr /* kbd */ , XkbSrvLedInfoPtr /* sli */ , xkbExtensionDeviceNotify * /* ed */ , XkbChangesPtr /* changes */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT unsigned int XkbIndicatorsToUpdate(DeviceIntPtr /* dev */ , unsigned long /* state_changes */ , Bool /* enabled_ctrl_changes */ ); extern _X_EXPORT void XkbComputeDerivedState(XkbSrvInfoPtr /* xkbi */ ); extern _X_EXPORT void XkbCheckSecondaryEffects(XkbSrvInfoPtr /* xkbi */ , unsigned int /* which */ , XkbChangesPtr /* changes */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void XkbCheckIndicatorMaps(DeviceIntPtr /* dev */ , XkbSrvLedInfoPtr /* sli */ , unsigned int /* which */ ); extern _X_EXPORT unsigned int XkbStateChangedFlags(XkbStatePtr /* old */ , XkbStatePtr /* new */ ); extern _X_EXPORT void XkbSendStateNotify(DeviceIntPtr /* kbd */ , xkbStateNotify * /* pSN */ ); extern _X_EXPORT void XkbSendMapNotify(DeviceIntPtr /* kbd */ , xkbMapNotify * /* ev */ ); extern _X_EXPORT int XkbComputeControlsNotify(DeviceIntPtr /* kbd */ , XkbControlsPtr /* old */ , XkbControlsPtr /* new */ , xkbControlsNotify * /* pCN */ , Bool /* forceCtrlProc */ ); extern _X_EXPORT void XkbSendControlsNotify(DeviceIntPtr /* kbd */ , xkbControlsNotify * /* ev */ ); extern _X_EXPORT void XkbSendCompatMapNotify(DeviceIntPtr /* kbd */ , xkbCompatMapNotify * /* ev */ ); extern _X_EXPORT void XkbHandleBell(BOOL force, BOOL eventOnly, DeviceIntPtr kbd, CARD8 percent, void *ctrl, CARD8 class, Atom name, WindowPtr pWin, ClientPtr pClient ); extern _X_EXPORT void XkbSendAccessXNotify(DeviceIntPtr /* kbd */ , xkbAccessXNotify * /* pEv */ ); extern _X_EXPORT void XkbSendNamesNotify(DeviceIntPtr /* kbd */ , xkbNamesNotify * /* ev */ ); extern _X_EXPORT void XkbSendActionMessage(DeviceIntPtr /* kbd */ , xkbActionMessage * /* ev */ ); extern _X_EXPORT void XkbSendExtensionDeviceNotify(DeviceIntPtr /* kbd */ , ClientPtr /* client */ , xkbExtensionDeviceNotify * /* ev */ ); extern _X_EXPORT void XkbSendNotification(DeviceIntPtr /* kbd */ , XkbChangesPtr /* pChanges */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void XkbProcessKeyboardEvent(DeviceEvent * /* event */ , DeviceIntPtr /* keybd */ ); extern _X_EXPORT void XkbHandleActions(DeviceIntPtr /* dev */ , DeviceIntPtr /* kbd */ , DeviceEvent * /* event */ ); extern void XkbPushLockedStateToSlaves(DeviceIntPtr /* master */, int /* evtype */, int /* key */); extern _X_EXPORT Bool XkbEnableDisableControls(XkbSrvInfoPtr /* xkbi */ , unsigned long /* change */ , unsigned long /* newValues */ , XkbChangesPtr /* changes */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void AccessXInit(DeviceIntPtr /* dev */ ); extern _X_EXPORT Bool AccessXFilterPressEvent(DeviceEvent * /* event */ , DeviceIntPtr /* keybd */ ); extern _X_EXPORT Bool AccessXFilterReleaseEvent(DeviceEvent * /* event */ , DeviceIntPtr /* keybd */ ); extern _X_EXPORT void AccessXCancelRepeatKey(XkbSrvInfoPtr /* xkbi */ , KeyCode /* key */ ); extern _X_EXPORT void AccessXComputeCurveFactor(XkbSrvInfoPtr /* xkbi */ , XkbControlsPtr /* ctrls */ ); extern _X_EXPORT XkbInterestPtr XkbFindClientResource(DevicePtr /* inDev */ , ClientPtr /* client */ ); extern _X_EXPORT XkbInterestPtr XkbAddClientResource(DevicePtr /* inDev */ , ClientPtr /* client */ , XID /* id */ ); extern _X_EXPORT int XkbRemoveResourceClient(DevicePtr /* inDev */ , XID /* id */ ); extern _X_EXPORT int XkbDDXAccessXBeep(DeviceIntPtr /* dev */ , unsigned int /* what */ , unsigned int /* which */ ); extern _X_EXPORT int XkbDDXUsesSoftRepeat(DeviceIntPtr /* dev */ ); extern _X_EXPORT void XkbDDXKeybdCtrlProc(DeviceIntPtr /* dev */ , KeybdCtrl * /* ctrl */ ); extern _X_EXPORT void XkbDDXChangeControls(DeviceIntPtr /* dev */ , XkbControlsPtr /* old */ , XkbControlsPtr /* new */ ); extern _X_EXPORT void XkbDDXUpdateDeviceIndicators(DeviceIntPtr /* dev */ , XkbSrvLedInfoPtr /* sli */ , CARD32 /* newState */ ); extern _X_EXPORT int XkbDDXTerminateServer(DeviceIntPtr /* dev */ , KeyCode /* key */ , XkbAction * /* act */ ); extern _X_EXPORT int XkbDDXSwitchScreen(DeviceIntPtr /* dev */ , KeyCode /* key */ , XkbAction * /* act */ ); extern _X_EXPORT int XkbDDXPrivate(DeviceIntPtr /* dev */ , KeyCode /* key */ , XkbAction * /* act */ ); extern _X_EXPORT void XkbDisableComputedAutoRepeats(DeviceIntPtr /* pXDev */ , unsigned int /* key */ ); extern _X_EXPORT void XkbSetRepeatKeys(DeviceIntPtr /* pXDev */ , int /* key */ , int /* onoff */ ); extern _X_EXPORT int XkbLatchModifiers(DeviceIntPtr /* pXDev */ , CARD8 /* mask */ , CARD8 /* latches */ ); extern _X_EXPORT int XkbLatchGroup(DeviceIntPtr /* pXDev */ , int /* group */ ); extern _X_EXPORT void XkbClearAllLatchesAndLocks(DeviceIntPtr /* dev */ , XkbSrvInfoPtr /* xkbi */ , Bool /* genEv */ , XkbEventCausePtr /* cause */ ); extern _X_EXPORT void XkbInitRules(XkbRMLVOSet * /* rmlvo */, const char * /* rules */, const char * /* model */, const char * /* layout */, const char * /* variant */, const char * /* options */ ) ; extern _X_EXPORT void XkbGetRulesDflts(XkbRMLVOSet * /* rmlvo */ ); extern _X_EXPORT void XkbFreeRMLVOSet(XkbRMLVOSet * /* rmlvo */ , Bool /* freeRMLVO */ ); extern _X_EXPORT void XkbSetRulesDflts(XkbRMLVOSet * /* rmlvo */ ); extern _X_EXPORT void XkbDeleteRulesDflts(void ); extern _X_EXPORT void XkbDeleteRulesUsed(void ); extern _X_EXPORT int SProcXkbDispatch(ClientPtr /* client */ ); extern _X_EXPORT XkbGeometryPtr XkbLookupNamedGeometry(DeviceIntPtr /* dev */ , Atom /* name */ , Bool * /* shouldFree */ ); extern _X_EXPORT void XkbConvertCase(KeySym /* sym */ , KeySym * /* lower */ , KeySym * /* upper */ ); extern _X_EXPORT Status XkbChangeKeycodeRange(XkbDescPtr /* xkb */ , int /* minKC */ , int /* maxKC */ , XkbChangesPtr /* changes */ ); extern _X_EXPORT void XkbFreeSrvLedInfo(XkbSrvLedInfoPtr /* sli */ ); extern _X_EXPORT void XkbFreeInfo(XkbSrvInfoPtr /* xkbi */ ); extern _X_EXPORT Status XkbChangeTypesOfKey(XkbDescPtr /* xkb */ , int /* key */ , int /* nGroups */ , unsigned int /* groups */ , int * /* newTypesIn */ , XkbMapChangesPtr /* changes */ ); extern _X_EXPORT int XkbKeyTypesForCoreSymbols(XkbDescPtr /* xkb */ , int /* map_width */ , KeySym * /* core_syms */ , unsigned int /* protected */ , int * /* types_inout */ , KeySym * /* xkb_syms_rtrn */ ); extern _X_EXPORT Bool XkbApplyCompatMapToKey(XkbDescPtr /* xkb */ , KeyCode /* key */ , XkbChangesPtr /* changes */ ); extern _X_EXPORT Bool XkbApplyVirtualModChanges(XkbDescPtr /* xkb */ , unsigned int /* changed */ , XkbChangesPtr /* changes */ ); extern _X_EXPORT void XkbSendNewKeyboardNotify(DeviceIntPtr /* kbd */ , xkbNewKeyboardNotify * /* pNKN */ ); extern Bool XkbCopyKeymap(XkbDescPtr /* dst */ , XkbDescPtr /* src */ ); extern _X_EXPORT Bool XkbCopyDeviceKeymap(DeviceIntPtr /* dst */, DeviceIntPtr /* src */); extern _X_EXPORT Bool XkbDeviceApplyKeymap(DeviceIntPtr /* dst */ , XkbDescPtr /* src */ ); extern void XkbFilterEvents(ClientPtr /* pClient */ , int /* nEvents */ , xEvent * /* xE */ ); extern int XkbGetEffectiveGroup(XkbSrvInfoPtr /* xkbi */ , XkbStatePtr /* xkbstate */ , CARD8 /* keycode */ ); extern void XkbMergeLockedPtrBtns(DeviceIntPtr /* master */ ); extern void XkbFakeDeviceButton(DeviceIntPtr /* dev */ , int /* press */ , int /* button */ ); extern _X_EXPORT void XkbCopyControls(XkbDescPtr /* dst */ , XkbDescPtr /* src */ ); #include "xkbfile.h" #include "xkbrules.h" #define _XkbListKeycodes 0 #define _XkbListTypes 1 #define _XkbListCompat 2 #define _XkbListSymbols 3 #define _XkbListGeometry 4 #define _XkbListNumComponents 5 extern _X_EXPORT unsigned int XkbDDXLoadKeymapByNames(DeviceIntPtr /* keybd */ , XkbComponentNamesPtr /* names */ , unsigned int /* want */ , unsigned int /* need */ , XkbDescPtr * /* finfoRtrn */ , char * /* keymapNameRtrn */ , int /* keymapNameRtrnLen */ ); extern _X_EXPORT Bool XkbDDXNamesFromRules(DeviceIntPtr /* keybd */ , const char * /* rules */ , XkbRF_VarDefsPtr /* defs */ , XkbComponentNamesPtr /* names */ ); extern _X_EXPORT XkbDescPtr XkbCompileKeymap(DeviceIntPtr /* dev */ , XkbRMLVOSet * /* rmlvo */ ); extern _X_EXPORT XkbDescPtr XkbCompileKeymapFromString(DeviceIntPtr dev, const char *keymap, int keymap_length); #endif /* _XKBSRV_H_ */ xorg-server-1.17.1/include/xserver-properties.h0000664000175100017510000002245312274325511016505 00000000000000/* * Copyright 2008 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 * on the rights to use, copy, modify, merge, publish, distribute, sub * license, and/or sell copies of the Software, and to permit persons to whom * them 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 MERCHANTIBILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS 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. */ /* Properties managed by the server. */ #ifndef _XSERVER_PROPERTIES_H_ #define _XSERVER_PROPERTIES_H_ /* Type for a 4 byte float. Storage format IEEE 754 in client's default * byte-ordering. */ #define XATOM_FLOAT "FLOAT" /* STRING. Seat name of this display */ #define SEAT_ATOM_NAME "Xorg_Seat" /* BOOL. 0 - device disabled, 1 - device enabled */ #define XI_PROP_ENABLED "Device Enabled" /* BOOL. If present, device is a virtual XTEST device */ #define XI_PROP_XTEST_DEVICE "XTEST Device" /* CARD32, 2 values, vendor, product. * This property is set by the driver and may not be available for some * drivers. Read-Only */ #define XI_PROP_PRODUCT_ID "Device Product ID" /* Coordinate transformation matrix for absolute input devices * FLOAT, 9 values in row-major order, coordinates in 0..1 range: * [c0 c1 c2] [x] * [c3 c4 c5] * [y] * [c6 c7 c8] [1] */ #define XI_PROP_TRANSFORM "Coordinate Transformation Matrix" /* STRING. Device node path of device */ #define XI_PROP_DEVICE_NODE "Device Node" /* Pointer acceleration properties */ /* INTEGER of any format */ #define ACCEL_PROP_PROFILE_NUMBER "Device Accel Profile" /* FLOAT, format 32 */ #define ACCEL_PROP_CONSTANT_DECELERATION "Device Accel Constant Deceleration" /* FLOAT, format 32 */ #define ACCEL_PROP_ADAPTIVE_DECELERATION "Device Accel Adaptive Deceleration" /* FLOAT, format 32 */ #define ACCEL_PROP_VELOCITY_SCALING "Device Accel Velocity Scaling" /* Axis labels */ #define AXIS_LABEL_PROP "Axis Labels" #define AXIS_LABEL_PROP_REL_X "Rel X" #define AXIS_LABEL_PROP_REL_Y "Rel Y" #define AXIS_LABEL_PROP_REL_Z "Rel Z" #define AXIS_LABEL_PROP_REL_RX "Rel Rotary X" #define AXIS_LABEL_PROP_REL_RY "Rel Rotary Y" #define AXIS_LABEL_PROP_REL_RZ "Rel Rotary Z" #define AXIS_LABEL_PROP_REL_HWHEEL "Rel Horiz Wheel" #define AXIS_LABEL_PROP_REL_DIAL "Rel Dial" #define AXIS_LABEL_PROP_REL_WHEEL "Rel Vert Wheel" #define AXIS_LABEL_PROP_REL_MISC "Rel Misc" #define AXIS_LABEL_PROP_REL_VSCROLL "Rel Vert Scroll" #define AXIS_LABEL_PROP_REL_HSCROLL "Rel Horiz Scroll" /* * Absolute axes */ #define AXIS_LABEL_PROP_ABS_X "Abs X" #define AXIS_LABEL_PROP_ABS_Y "Abs Y" #define AXIS_LABEL_PROP_ABS_Z "Abs Z" #define AXIS_LABEL_PROP_ABS_RX "Abs Rotary X" #define AXIS_LABEL_PROP_ABS_RY "Abs Rotary Y" #define AXIS_LABEL_PROP_ABS_RZ "Abs Rotary Z" #define AXIS_LABEL_PROP_ABS_THROTTLE "Abs Throttle" #define AXIS_LABEL_PROP_ABS_RUDDER "Abs Rudder" #define AXIS_LABEL_PROP_ABS_WHEEL "Abs Wheel" #define AXIS_LABEL_PROP_ABS_GAS "Abs Gas" #define AXIS_LABEL_PROP_ABS_BRAKE "Abs Brake" #define AXIS_LABEL_PROP_ABS_HAT0X "Abs Hat 0 X" #define AXIS_LABEL_PROP_ABS_HAT0Y "Abs Hat 0 Y" #define AXIS_LABEL_PROP_ABS_HAT1X "Abs Hat 1 X" #define AXIS_LABEL_PROP_ABS_HAT1Y "Abs Hat 1 Y" #define AXIS_LABEL_PROP_ABS_HAT2X "Abs Hat 2 X" #define AXIS_LABEL_PROP_ABS_HAT2Y "Abs Hat 2 Y" #define AXIS_LABEL_PROP_ABS_HAT3X "Abs Hat 3 X" #define AXIS_LABEL_PROP_ABS_HAT3Y "Abs Hat 3 Y" #define AXIS_LABEL_PROP_ABS_PRESSURE "Abs Pressure" #define AXIS_LABEL_PROP_ABS_DISTANCE "Abs Distance" #define AXIS_LABEL_PROP_ABS_TILT_X "Abs Tilt X" #define AXIS_LABEL_PROP_ABS_TILT_Y "Abs Tilt Y" #define AXIS_LABEL_PROP_ABS_TOOL_WIDTH "Abs Tool Width" #define AXIS_LABEL_PROP_ABS_VOLUME "Abs Volume" #define AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR "Abs MT Touch Major" #define AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR "Abs MT Touch Minor" #define AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR "Abs MT Width Major" #define AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR "Abs MT Width Minor" #define AXIS_LABEL_PROP_ABS_MT_ORIENTATION "Abs MT Orientation" #define AXIS_LABEL_PROP_ABS_MT_POSITION_X "Abs MT Position X" #define AXIS_LABEL_PROP_ABS_MT_POSITION_Y "Abs MT Position Y" #define AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE "Abs MT Tool Type" #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 */ #define BTN_LABEL_PROP "Button Labels" /* Default label */ #define BTN_LABEL_PROP_BTN_UNKNOWN "Button Unknown" /* Wheel buttons */ #define BTN_LABEL_PROP_BTN_WHEEL_UP "Button Wheel Up" #define BTN_LABEL_PROP_BTN_WHEEL_DOWN "Button Wheel Down" #define BTN_LABEL_PROP_BTN_HWHEEL_LEFT "Button Horiz Wheel Left" #define BTN_LABEL_PROP_BTN_HWHEEL_RIGHT "Button Horiz Wheel Right" /* The following are from linux/input.h */ #define BTN_LABEL_PROP_BTN_0 "Button 0" #define BTN_LABEL_PROP_BTN_1 "Button 1" #define BTN_LABEL_PROP_BTN_2 "Button 2" #define BTN_LABEL_PROP_BTN_3 "Button 3" #define BTN_LABEL_PROP_BTN_4 "Button 4" #define BTN_LABEL_PROP_BTN_5 "Button 5" #define BTN_LABEL_PROP_BTN_6 "Button 6" #define BTN_LABEL_PROP_BTN_7 "Button 7" #define BTN_LABEL_PROP_BTN_8 "Button 8" #define BTN_LABEL_PROP_BTN_9 "Button 9" #define BTN_LABEL_PROP_BTN_LEFT "Button Left" #define BTN_LABEL_PROP_BTN_RIGHT "Button Right" #define BTN_LABEL_PROP_BTN_MIDDLE "Button Middle" #define BTN_LABEL_PROP_BTN_SIDE "Button Side" #define BTN_LABEL_PROP_BTN_EXTRA "Button Extra" #define BTN_LABEL_PROP_BTN_FORWARD "Button Forward" #define BTN_LABEL_PROP_BTN_BACK "Button Back" #define BTN_LABEL_PROP_BTN_TASK "Button Task" #define BTN_LABEL_PROP_BTN_TRIGGER "Button Trigger" #define BTN_LABEL_PROP_BTN_THUMB "Button Thumb" #define BTN_LABEL_PROP_BTN_THUMB2 "Button Thumb2" #define BTN_LABEL_PROP_BTN_TOP "Button Top" #define BTN_LABEL_PROP_BTN_TOP2 "Button Top2" #define BTN_LABEL_PROP_BTN_PINKIE "Button Pinkie" #define BTN_LABEL_PROP_BTN_BASE "Button Base" #define BTN_LABEL_PROP_BTN_BASE2 "Button Base2" #define BTN_LABEL_PROP_BTN_BASE3 "Button Base3" #define BTN_LABEL_PROP_BTN_BASE4 "Button Base4" #define BTN_LABEL_PROP_BTN_BASE5 "Button Base5" #define BTN_LABEL_PROP_BTN_BASE6 "Button Base6" #define BTN_LABEL_PROP_BTN_DEAD "Button Dead" #define BTN_LABEL_PROP_BTN_A "Button A" #define BTN_LABEL_PROP_BTN_B "Button B" #define BTN_LABEL_PROP_BTN_C "Button C" #define BTN_LABEL_PROP_BTN_X "Button X" #define BTN_LABEL_PROP_BTN_Y "Button Y" #define BTN_LABEL_PROP_BTN_Z "Button Z" #define BTN_LABEL_PROP_BTN_TL "Button T Left" #define BTN_LABEL_PROP_BTN_TR "Button T Right" #define BTN_LABEL_PROP_BTN_TL2 "Button T Left2" #define BTN_LABEL_PROP_BTN_TR2 "Button T Right2" #define BTN_LABEL_PROP_BTN_SELECT "Button Select" #define BTN_LABEL_PROP_BTN_START "Button Start" #define BTN_LABEL_PROP_BTN_MODE "Button Mode" #define BTN_LABEL_PROP_BTN_THUMBL "Button Thumb Left" #define BTN_LABEL_PROP_BTN_THUMBR "Button Thumb Right" #define BTN_LABEL_PROP_BTN_TOOL_PEN "Button Tool Pen" #define BTN_LABEL_PROP_BTN_TOOL_RUBBER "Button Tool Rubber" #define BTN_LABEL_PROP_BTN_TOOL_BRUSH "Button Tool Brush" #define BTN_LABEL_PROP_BTN_TOOL_PENCIL "Button Tool Pencil" #define BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH "Button Tool Airbrush" #define BTN_LABEL_PROP_BTN_TOOL_FINGER "Button Tool Finger" #define BTN_LABEL_PROP_BTN_TOOL_MOUSE "Button Tool Mouse" #define BTN_LABEL_PROP_BTN_TOOL_LENS "Button Tool Lens" #define BTN_LABEL_PROP_BTN_TOUCH "Button Touch" #define BTN_LABEL_PROP_BTN_STYLUS "Button Stylus" #define BTN_LABEL_PROP_BTN_STYLUS2 "Button Stylus2" #define BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP "Button Tool Doubletap" #define BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP "Button Tool Tripletap" #define BTN_LABEL_PROP_BTN_GEAR_DOWN "Button Gear down" #define BTN_LABEL_PROP_BTN_GEAR_UP "Button Gear up" #endif xorg-server-1.17.1/include/inpututils.h0000664000175100017510000000555212274325511015036 00000000000000/* * Copyright © 2010 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ #ifdef HAVE_DIX_CONFIG_H #include "dix-config.h" #endif #ifndef INPUTUTILS_H #define INPUTUTILS_H #include "input.h" #include extern Mask event_filters[MAXDEVICES][MAXEVENTS]; struct _ValuatorMask { int8_t last_bit; /* highest bit set in mask */ uint8_t mask[(MAX_VALUATORS + 7) / 8]; double valuators[MAX_VALUATORS]; /* valuator data */ }; extern void verify_internal_event(const InternalEvent *ev); extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms); extern int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd); extern void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event); extern Mask event_get_filter_from_type(DeviceIntPtr dev, int evtype); extern Mask event_get_filter_from_xi2type(int evtype); FP3232 double_to_fp3232(double in); FP1616 double_to_fp1616(double in); double fp1616_to_double(FP1616 in); double fp3232_to_double(FP3232 in); 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); size_t xi2mask_num_masks(const XI2Mask *mask); size_t xi2mask_mask_size(const XI2Mask *mask); void xi2mask_set_one_mask(XI2Mask *xi2mask, int deviceid, const unsigned char *mask, size_t mask_size); const unsigned char *xi2mask_get_one_mask(const XI2Mask *xi2mask, int deviceid); #endif xorg-server-1.17.1/include/pixmapstr.h0000664000175100017510000000773512456571574014670 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef PIXMAPSTRUCT_H #define PIXMAPSTRUCT_H #include "pixmap.h" #include "screenint.h" #include "regionstr.h" #include "privates.h" #include "damage.h" typedef struct _Drawable { unsigned char type; /* DRAWABLE_ */ unsigned char class; /* specific to type */ unsigned char depth; unsigned char bitsPerPixel; XID id; /* resource id */ short x; /* window: screen absolute, pixmap: 0 */ short y; /* window: screen absolute, pixmap: 0 */ unsigned short width; unsigned short height; ScreenPtr pScreen; unsigned long serialNumber; } DrawableRec; /* * PIXMAP -- device dependent */ typedef struct _Pixmap { DrawableRec drawable; PrivateRec *devPrivates; int refcnt; int devKind; /* This is the pitch of the pixmap, typically width*bpp/8. */ DevUnion devPrivate; /* When !NULL, devPrivate.ptr points to the raw pixel data. */ #ifdef COMPOSITE short screen_x; 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; int dst_x, dst_y; } 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 */ xorg-server-1.17.1/include/selection.h0000664000175100017510000000652312456571574014620 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef SELECTION_H #define SELECTION_H 1 #include "dixstruct.h" #include "privates.h" /* * Selection data structures */ typedef struct _Selection { Atom selection; TimeStamp lastTimeChanged; Window window; WindowPtr pWin; ClientPtr client; struct _Selection *next; PrivateRec *devPrivates; } Selection; /* * Selection API */ extern _X_EXPORT int dixLookupSelection(Selection ** result, Atom name, ClientPtr client, Mask access_mode); extern _X_EXPORT Selection *CurrentSelections; extern _X_EXPORT CallbackListPtr SelectionCallback; typedef enum { SelectionSetOwner, SelectionWindowDestroy, SelectionClientClose } SelectionCallbackKind; typedef struct { struct _Selection *selection; ClientPtr client; SelectionCallbackKind kind; } SelectionInfoRec; /* * Selection server internals */ extern _X_EXPORT void InitSelections(void); extern _X_EXPORT void DeleteWindowFromAnySelections(WindowPtr pWin); extern _X_EXPORT void DeleteClientFromAnySelections(ClientPtr client); #endif /* SELECTION_H */ xorg-server-1.17.1/include/gc.h0000664000175100017510000001303512456571574013220 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef GC_H #define GC_H #include /* for GContext, Mask */ #include /* for Bool */ #include #include "screenint.h" /* for ScreenPtr */ #include "pixmap.h" /* for DrawablePtr */ /* clientClipType field in GC */ #define CT_NONE 0 #define CT_PIXMAP 1 #define CT_REGION 2 #define CT_UNSORTED 6 #define CT_YSORTED 10 #define CT_YXSORTED 14 #define CT_YXBANDED 18 #define GCQREASON_VALIDATE 1 #define GCQREASON_CHANGE 2 #define GCQREASON_COPY_SRC 3 #define GCQREASON_COPY_DST 4 #define GCQREASON_DESTROY 5 #define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31) #define GC_CALL_VALIDATE_BIT (1L<<30) #define GCExtensionInterest (1L<<29) #define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT)) #define MAX_SERIAL_NUM (1L<<28) #define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \ (globalSerialNumber = 1): globalSerialNumber) typedef struct _GCInterest *GCInterestPtr; typedef struct _GC *GCPtr; typedef struct _GCOps *GCOpsPtr; extern _X_EXPORT void ValidateGC(DrawablePtr /*pDraw */ , GCPtr /*pGC */ ); typedef union { CARD32 val; void *ptr; } ChangeGCVal, *ChangeGCValPtr; extern int ChangeGCXIDs(ClientPtr /*client */ , GCPtr /*pGC */ , BITS32 /*mask */ , CARD32 * /*pval */ ); extern _X_EXPORT int ChangeGC(ClientPtr /*client */ , GCPtr /*pGC */ , BITS32 /*mask */ , ChangeGCValPtr /*pCGCV */ ); extern _X_EXPORT GCPtr CreateGC(DrawablePtr /*pDrawable */ , BITS32 /*mask */ , XID * /*pval */ , int * /*pStatus */ , XID /*gcid */ , ClientPtr /*client */ ); extern _X_EXPORT int CopyGC(GCPtr /*pgcSrc */ , GCPtr /*pgcDst */ , BITS32 /*mask */ ); extern _X_EXPORT int FreeGC(void *pGC, XID gid); extern _X_EXPORT void FreeGCperDepth(int /*screenNum */ ); extern _X_EXPORT Bool CreateGCperDepth(int /*screenNum */ ); extern _X_EXPORT Bool CreateDefaultStipple(int /*screenNum */ ); extern _X_EXPORT void FreeDefaultStipple(int /*screenNum */ ); extern _X_EXPORT int SetDashes(GCPtr /*pGC */ , unsigned /*offset */ , unsigned /*ndash */ , unsigned char * /*pdash */ ); extern _X_EXPORT int VerifyRectOrder(int /*nrects */ , xRectangle * /*prects */ , int /*ordering */ ); extern _X_EXPORT int SetClipRects(GCPtr /*pGC */ , int /*xOrigin */ , int /*yOrigin */ , int /*nrects */ , xRectangle * /*prects */ , int /*ordering */ ); extern _X_EXPORT GCPtr GetScratchGC(unsigned /*depth */ , ScreenPtr /*pScreen */ ); extern _X_EXPORT void FreeScratchGC(GCPtr /*pGC */ ); #endif /* GC_H */ xorg-server-1.17.1/include/Makefile.in0000664000175100017510000007300412466505435014517 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = include DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/do-not-use-config.h.in $(srcdir)/xorg-server.h.in \ $(srcdir)/dix-config.h.in $(srcdir)/xorg-config.h.in \ $(srcdir)/xkb-config.h.in $(srcdir)/xwin-config.h.in \ $(srcdir)/kdrive-config.h.in $(srcdir)/version-config.h.in \ $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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 = do-not-use-config.h xorg-server.h dix-config.h \ xorg-config.h xkb-config.h xwin-config.h kdrive-config.h \ version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)" "$(DESTDIR)$(sdkdir)" am__sdk_HEADERS_DIST = XIstubs.h Xprintf.h callback.h client.h \ closestr.h closure.h colormap.h colormapst.h hotplug.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 \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)do-not-use-config.h.in xorg-server.h.in dix-config.h.in \ xorg-config.h.in xkb-config.h.in xwin-config.h.in \ kdrive-config.h.in version-config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @XORG_TRUE@sdk_HEADERS = \ @XORG_TRUE@ XIstubs.h \ @XORG_TRUE@ Xprintf.h \ @XORG_TRUE@ callback.h \ @XORG_TRUE@ client.h \ @XORG_TRUE@ closestr.h \ @XORG_TRUE@ closure.h \ @XORG_TRUE@ colormap.h \ @XORG_TRUE@ colormapst.h \ @XORG_TRUE@ hotplug.h \ @XORG_TRUE@ cursor.h \ @XORG_TRUE@ cursorstr.h \ @XORG_TRUE@ dix.h \ @XORG_TRUE@ dixaccess.h \ @XORG_TRUE@ dixevents.h \ @XORG_TRUE@ dixfont.h \ @XORG_TRUE@ dixfontstr.h \ @XORG_TRUE@ dixgrabs.h \ @XORG_TRUE@ dixstruct.h \ @XORG_TRUE@ events.h \ @XORG_TRUE@ exevents.h \ @XORG_TRUE@ extension.h \ @XORG_TRUE@ extinit.h \ @XORG_TRUE@ extnsionst.h \ @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 \ @XORG_TRUE@ misc.h \ @XORG_TRUE@ miscstruct.h \ @XORG_TRUE@ opaque.h \ @XORG_TRUE@ optionstr.h \ @XORG_TRUE@ os.h \ @XORG_TRUE@ pixmap.h \ @XORG_TRUE@ pixmapstr.h \ @XORG_TRUE@ privates.h \ @XORG_TRUE@ property.h \ @XORG_TRUE@ propertyst.h \ @XORG_TRUE@ ptrveloc.h \ @XORG_TRUE@ region.h \ @XORG_TRUE@ regionstr.h \ @XORG_TRUE@ registry.h \ @XORG_TRUE@ resource.h \ @XORG_TRUE@ rgb.h \ @XORG_TRUE@ screenint.h \ @XORG_TRUE@ scrnintstr.h \ @XORG_TRUE@ selection.h \ @XORG_TRUE@ servermd.h \ @XORG_TRUE@ site.h \ @XORG_TRUE@ swaprep.h \ @XORG_TRUE@ swapreq.h \ @XORG_TRUE@ validate.h \ @XORG_TRUE@ window.h \ @XORG_TRUE@ windowstr.h \ @XORG_TRUE@ xkbfile.h \ @XORG_TRUE@ xkbsrv.h \ @XORG_TRUE@ xkbstr.h \ @XORG_TRUE@ xkbrules.h \ @XORG_TRUE@ xserver-properties.h @XORG_TRUE@nodist_sdk_HEADERS = xorg-server.h AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ protocol-versions.h \ systemd-logind.h \ xsha1.h all: do-not-use-config.h xorg-server.h dix-config.h xorg-config.h xkb-config.h xwin-config.h kdrive-config.h version-config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(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 include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): do-not-use-config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) 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: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ xorg-server.h: stamp-h2 @test -f $@ || rm -f stamp-h2 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2 stamp-h2: $(srcdir)/xorg-server.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status include/xorg-server.h dix-config.h: stamp-h3 @test -f $@ || rm -f stamp-h3 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h3 stamp-h3: $(srcdir)/dix-config.h.in $(top_builddir)/config.status @rm -f stamp-h3 cd $(top_builddir) && $(SHELL) ./config.status include/dix-config.h xorg-config.h: stamp-h4 @test -f $@ || rm -f stamp-h4 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h4 stamp-h4: $(srcdir)/xorg-config.h.in $(top_builddir)/config.status @rm -f stamp-h4 cd $(top_builddir) && $(SHELL) ./config.status include/xorg-config.h xkb-config.h: stamp-h5 @test -f $@ || rm -f stamp-h5 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h5 stamp-h5: $(srcdir)/xkb-config.h.in $(top_builddir)/config.status @rm -f stamp-h5 cd $(top_builddir) && $(SHELL) ./config.status include/xkb-config.h xwin-config.h: stamp-h6 @test -f $@ || rm -f stamp-h6 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h6 stamp-h6: $(srcdir)/xwin-config.h.in $(top_builddir)/config.status @rm -f stamp-h6 cd $(top_builddir) && $(SHELL) ./config.status include/xwin-config.h kdrive-config.h: stamp-h7 @test -f $@ || rm -f stamp-h7 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h7 stamp-h7: $(srcdir)/kdrive-config.h.in $(top_builddir)/config.status @rm -f stamp-h7 cd $(top_builddir) && $(SHELL) ./config.status include/kdrive-config.h version-config.h: stamp-h8 @test -f $@ || rm -f stamp-h8 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h8 stamp-h8: $(srcdir)/version-config.h.in $(top_builddir)/config.status @rm -f stamp-h8 cd $(top_builddir) && $(SHELL) ./config.status include/version-config.h distclean-hdr: -rm -f do-not-use-config.h stamp-h1 xorg-server.h stamp-h2 dix-config.h stamp-h3 xorg-config.h stamp-h4 xkb-config.h stamp-h5 xwin-config.h stamp-h6 kdrive-config.h stamp-h7 version-config.h stamp-h8 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_sdkHEADERS: $(nodist_sdk_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_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-nodist_sdkHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_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) 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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 $(HEADERS) do-not-use-config.h xorg-server.h \ dix-config.h xorg-config.h xkb-config.h xwin-config.h \ kdrive-config.h version-config.h installdirs: for dir in "$(DESTDIR)$(sdkdir)" "$(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-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_sdkHEADERS 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nodist_sdkHEADERS uninstall-sdkHEADERS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-hdr 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-nodist_sdkHEADERS 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-nodist_sdkHEADERS 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: xorg-server-1.17.1/include/protocol-versions.h0000664000175100017510000001037012444227027016321 00000000000000/* * Copyright © 2009 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. * */ /** * This file specifies the server-supported protocol versions. */ #ifndef _PROTOCOL_VERSIONS_ #define _PROTOCOL_VERSIONS_ /* Apple DRI */ #define SERVER_APPLEDRI_MAJOR_VERSION 1 #define SERVER_APPLEDRI_MINOR_VERSION 0 #define SERVER_APPLEDRI_PATCH_VERSION 0 /* AppleWM */ #define SERVER_APPLEWM_MAJOR_VERSION 1 #define SERVER_APPLEWM_MINOR_VERSION 3 #define SERVER_APPLEWM_PATCH_VERSION 0 /* Composite */ #define SERVER_COMPOSITE_MAJOR_VERSION 0 #define SERVER_COMPOSITE_MINOR_VERSION 4 /* Damage */ #define SERVER_DAMAGE_MAJOR_VERSION 1 #define SERVER_DAMAGE_MINOR_VERSION 1 /* DRI3 */ #define SERVER_DRI3_MAJOR_VERSION 1 #define SERVER_DRI3_MINOR_VERSION 0 /* DMX */ #define SERVER_DMX_MAJOR_VERSION 2 #define SERVER_DMX_MINOR_VERSION 2 #define SERVER_DMX_PATCH_VERSION 20040604 /* Generic event extension */ #define SERVER_GE_MAJOR_VERSION 1 #define SERVER_GE_MINOR_VERSION 0 /* GLX */ #define SERVER_GLX_MAJOR_VERSION 1 #define SERVER_GLX_MINOR_VERSION 4 /* Xinerama */ #define SERVER_PANORAMIX_MAJOR_VERSION 1 #define SERVER_PANORAMIX_MINOR_VERSION 1 /* Present */ #define SERVER_PRESENT_MAJOR_VERSION 1 #define SERVER_PRESENT_MINOR_VERSION 0 /* RandR */ #define SERVER_RANDR_MAJOR_VERSION 1 #define SERVER_RANDR_MINOR_VERSION 4 /* Record */ #define SERVER_RECORD_MAJOR_VERSION 1 #define SERVER_RECORD_MINOR_VERSION 13 /* Render */ #define SERVER_RENDER_MAJOR_VERSION 0 #define SERVER_RENDER_MINOR_VERSION 11 /* RandR Xinerama */ #define SERVER_RRXINERAMA_MAJOR_VERSION 1 #define SERVER_RRXINERAMA_MINOR_VERSION 1 /* Screensaver */ #define SERVER_SAVER_MAJOR_VERSION 1 #define SERVER_SAVER_MINOR_VERSION 1 /* Security */ #define SERVER_SECURITY_MAJOR_VERSION 1 #define SERVER_SECURITY_MINOR_VERSION 0 /* Shape */ #define SERVER_SHAPE_MAJOR_VERSION 1 #define SERVER_SHAPE_MINOR_VERSION 1 /* SHM */ #define SERVER_SHM_MAJOR_VERSION 1 #if XTRANS_SEND_FDS #define SERVER_SHM_MINOR_VERSION 2 #else #define SERVER_SHM_MINOR_VERSION 1 #endif /* Sync */ #define SERVER_SYNC_MAJOR_VERSION 3 #define SERVER_SYNC_MINOR_VERSION 1 /* Windows WM */ #define SERVER_WINDOWSWM_MAJOR_VERSION 1 #define SERVER_WINDOWSWM_MINOR_VERSION 0 #define SERVER_WINDOWSWM_PATCH_VERSION 0 /* DGA */ #define SERVER_XDGA_MAJOR_VERSION 2 #define SERVER_XDGA_MINOR_VERSION 0 /* Big Font */ #define SERVER_XF86BIGFONT_MAJOR_VERSION 1 #define SERVER_XF86BIGFONT_MINOR_VERSION 1 /* DRI */ #define SERVER_XF86DRI_MAJOR_VERSION 4 #define SERVER_XF86DRI_MINOR_VERSION 1 #define SERVER_XF86DRI_PATCH_VERSION 20040604 /* Vidmode */ #define SERVER_XF86VIDMODE_MAJOR_VERSION 2 #define SERVER_XF86VIDMODE_MINOR_VERSION 2 /* Fixes */ #define SERVER_XFIXES_MAJOR_VERSION 5 #define SERVER_XFIXES_MINOR_VERSION 0 /* X Input */ #define SERVER_XI_MAJOR_VERSION 2 #define SERVER_XI_MINOR_VERSION 3 /* XKB */ #define SERVER_XKB_MAJOR_VERSION 1 #define SERVER_XKB_MINOR_VERSION 0 /* Resource */ #define SERVER_XRES_MAJOR_VERSION 1 #define SERVER_XRES_MINOR_VERSION 2 /* XvMC */ #define SERVER_XVMC_MAJOR_VERSION 1 #define SERVER_XVMC_MINOR_VERSION 1 #endif xorg-server-1.17.1/include/hotplug.h0000664000175100017510000000542012362063004014264 00000000000000/* * Copyright © 2006-2007 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 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); /* Bump this each time you add something to the struct * so that drivers can easily tell what is available */ #define ODEV_ATTRIBUTES_VERSION 1 struct OdevAttributes { /* path to kernel device node - Linux e.g. /dev/dri/card0 */ char *path; /* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */ char *syspath; /* DRI-style bus id */ char *busid; /* Server managed FD */ int fd; /* Major number of the device node pointed to by ODEV_ATTRIB_PATH */ int major; /* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */ int minor; /* kernel driver name */ char *driver; }; /* Note starting with xserver 1.16 this function never fails */ struct OdevAttributes * config_odev_allocate_attributes(void); void config_odev_free_attributes(struct OdevAttributes *attribs); 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")) struct xf86_platform_device * xf86_find_platform_device_by_devnum(int major, int minor); #endif /* HOTPLUG_H */ xorg-server-1.17.1/include/dixfont.h0000664000175100017510000001333412362011424014257 00000000000000/*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef DIXFONT_H #define DIXFONT_H 1 #include "dix.h" #include #include "closure.h" #include #include #define NullDIXFontProp ((DIXFontPropPtr)0) typedef struct _DIXFontProp *DIXFontPropPtr; extern _X_EXPORT Bool SetDefaultFont(const char * /*defaultfontname */ ); extern _X_EXPORT void QueueFontWakeup(FontPathElementPtr /*fpe */ ); extern _X_EXPORT void RemoveFontWakeup(FontPathElementPtr /*fpe */ ); extern _X_EXPORT void FontWakeup(void *data, int count, void *LastSelectMask); extern _X_EXPORT int OpenFont(ClientPtr /*client */ , XID /*fid */ , Mask /*flags */ , unsigned /*lenfname */ , const char * /*pfontname */ ); extern _X_EXPORT int CloseFont(void *pfont, XID fid); typedef struct _xQueryFontReply *xQueryFontReplyPtr; extern _X_EXPORT void QueryFont(FontPtr /*pFont */ , xQueryFontReplyPtr /*pReply */ , int /*nProtoCCIStructs */ ); extern _X_EXPORT int ListFonts(ClientPtr /*client */ , unsigned char * /*pattern */ , unsigned int /*length */ , unsigned int /*max_names */ ); extern _X_EXPORT int doListFontsWithInfo(ClientPtr /*client */ , LFWIclosurePtr /*c */ ); extern _X_EXPORT int doPolyText(ClientPtr /*client */ , PTclosurePtr /*c */ ); extern _X_EXPORT int PolyText(ClientPtr /*client */ , DrawablePtr /*pDraw */ , GCPtr /*pGC */ , unsigned char * /*pElt */ , unsigned char * /*endReq */ , int /*xorg */ , int /*yorg */ , int /*reqType */ , XID /*did */ ); extern _X_EXPORT int doImageText(ClientPtr /*client */ , ITclosurePtr /*c */ ); extern _X_EXPORT int ImageText(ClientPtr /*client */ , DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*nChars */ , unsigned char * /*data */ , int /*xorg */ , int /*yorg */ , int /*reqType */ , XID /*did */ ); extern _X_EXPORT int SetFontPath(ClientPtr /*client */ , int /*npaths */ , unsigned char * /*paths */ ); extern _X_EXPORT int SetDefaultFontPath(const char * /*path */ ); extern _X_EXPORT int GetFontPath(ClientPtr client, int *count, int *length, unsigned char **result); extern _X_EXPORT void DeleteClientFontStuff(ClientPtr /*client */ ); /* Quartz support on Mac OS X pulls in the QuickDraw framework whose InitFonts function conflicts here. */ #ifdef __APPLE__ #define InitFonts Darwin_X_InitFonts #endif extern _X_EXPORT void InitFonts(void); extern _X_EXPORT void FreeFonts(void); extern _X_EXPORT FontPtr find_old_font(XID /*id */ ); #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 */ , unsigned long /*count */ , ExtentInfoPtr /*info */ ); extern _X_EXPORT Bool QueryTextExtents(FontPtr /*pFont */ , unsigned long /*count */ , unsigned char * /*chars */ , ExtentInfoPtr /*info */ ); extern _X_EXPORT Bool ParseGlyphCachingMode(char * /*str */ ); extern _X_EXPORT void InitGlyphCaching(void); extern _X_EXPORT void SetGlyphCachingMode(int /*newmode */ ); extern _X_EXPORT void register_fpe_functions(void); #endif /* DIXFONT_H */ xorg-server-1.17.1/include/property.h0000664000175100017510000000761212456571574014517 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef PROPERTY_H #define PROPERTY_H #include "window.h" typedef struct _Property *PropertyPtr; extern _X_EXPORT int dixLookupProperty(PropertyPtr * /*result */ , WindowPtr /*pWin */ , Atom /*proprty */ , ClientPtr /*pClient */ , Mask /*access_mode */ ); extern _X_EXPORT int dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, Atom type, int format, int mode, unsigned long len, void *value, Bool sendevent); extern _X_EXPORT int ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, int mode, unsigned long len, void *value, Bool sendevent); extern _X_EXPORT int DeleteProperty(ClientPtr /*client */ , WindowPtr /*pWin */ , Atom /*propName */ ); extern _X_EXPORT void DeleteAllWindowProperties(WindowPtr /*pWin */ ); #endif /* PROPERTY_H */ xorg-server-1.17.1/include/window.h0000664000175100017510000002245212456571574014141 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef WINDOW_H #define WINDOW_H #include "misc.h" #include "region.h" #include "screenint.h" #include #define TOTALLY_OBSCURED 0 #define UNOBSCURED 1 #define OBSCURED 2 #define VisibilityNotViewable 3 /* return values for tree-walking callback procedures */ #define WT_STOPWALKING 0 #define WT_WALKCHILDREN 1 #define WT_DONTWALKCHILDREN 2 #define WT_NOMATCH 3 #define NullWindow ((WindowPtr) 0) /* Forward declaration, we can't include input.h here */ struct _DeviceIntRec; struct _Cursor; typedef struct _BackingStore *BackingStorePtr; typedef struct _Window *WindowPtr; typedef int (*VisitWindowProcPtr) (WindowPtr pWin, void *data); extern _X_EXPORT int TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, void *data); extern _X_EXPORT int WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, void *data); extern _X_EXPORT Bool CreateRootWindow(ScreenPtr /*pScreen */ ); extern _X_EXPORT void InitRootWindow(WindowPtr /*pWin */ ); typedef WindowPtr (*RealChildHeadProc) (WindowPtr pWin); extern _X_EXPORT void RegisterRealChildHeadProc(RealChildHeadProc proc); extern _X_EXPORT WindowPtr RealChildHead(WindowPtr /*pWin */ ); extern _X_EXPORT WindowPtr CreateWindow(Window /*wid */ , WindowPtr /*pParent */ , int /*x */ , int /*y */ , unsigned int /*w */ , unsigned int /*h */ , unsigned int /*bw */ , unsigned int /*class */ , Mask /*vmask */ , XID * /*vlist */ , int /*depth */ , ClientPtr /*client */ , VisualID /*visual */ , int * /*error */ ); extern _X_EXPORT int DeleteWindow(void *pWin, XID wid); extern _X_EXPORT int DestroySubwindows(WindowPtr /*pWin */ , ClientPtr /*client */ ); /* Quartz support on Mac OS X uses the HIToolbox framework whose ChangeWindowAttributes function conflicts here. */ #ifdef __APPLE__ #define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes #endif extern _X_EXPORT int ChangeWindowAttributes(WindowPtr /*pWin */ , Mask /*vmask */ , XID * /*vlist */ , ClientPtr /*client */ ); extern _X_EXPORT int ChangeWindowDeviceCursor(WindowPtr /*pWin */ , struct _DeviceIntRec * /*pDev */ , struct _Cursor * /*pCursor */ ); extern _X_EXPORT struct _Cursor *WindowGetDeviceCursor(WindowPtr /*pWin */ , struct _DeviceIntRec * /*pDev */ ); /* Quartz support on Mac OS X uses the HIToolbox framework whose GetWindowAttributes function conflicts here. */ #ifdef __APPLE__ #define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x) extern void Darwin_X_GetWindowAttributes( #else extern _X_EXPORT void GetWindowAttributes( #endif WindowPtr /*pWin */ , ClientPtr /*client */ , xGetWindowAttributesReply * /* wa */ ); extern _X_EXPORT void GravityTranslate(int /*x */ , int /*y */ , int /*oldx */ , int /*oldy */ , int /*dw */ , int /*dh */ , unsigned /*gravity */ , int * /*destx */ , int * /*desty */ ); extern _X_EXPORT int ConfigureWindow(WindowPtr /*pWin */ , Mask /*mask */ , XID * /*vlist */ , ClientPtr /*client */ ); extern _X_EXPORT int CirculateWindow(WindowPtr /*pParent */ , int /*direction */ , ClientPtr /*client */ ); extern _X_EXPORT int ReparentWindow(WindowPtr /*pWin */ , WindowPtr /*pParent */ , int /*x */ , int /*y */ , ClientPtr /*client */ ); extern _X_EXPORT int MapWindow(WindowPtr /*pWin */ , ClientPtr /*client */ ); extern _X_EXPORT void MapSubwindows(WindowPtr /*pParent */ , ClientPtr /*client */ ); extern _X_EXPORT int UnmapWindow(WindowPtr /*pWin */ , Bool /*fromConfigure */ ); extern _X_EXPORT void UnmapSubwindows(WindowPtr /*pWin */ ); extern _X_EXPORT void HandleSaveSet(ClientPtr /*client */ ); extern _X_EXPORT Bool PointInWindowIsVisible(WindowPtr /*pWin */ , int /*x */ , int /*y */ ); extern _X_EXPORT RegionPtr NotClippedByChildren(WindowPtr /*pWin */ ); extern _X_EXPORT void SendVisibilityNotify(WindowPtr /*pWin */ ); extern _X_EXPORT int dixSaveScreens(ClientPtr client, int on, int mode); extern _X_EXPORT int SaveScreens(int on, int mode); extern _X_EXPORT WindowPtr FindWindowWithOptional(WindowPtr /*w */ ); extern _X_EXPORT void CheckWindowOptionalNeed(WindowPtr /*w */ ); extern _X_EXPORT Bool MakeWindowOptional(WindowPtr /*pWin */ ); extern _X_EXPORT WindowPtr MoveWindowInStack(WindowPtr /*pWin */ , WindowPtr /*pNextSib */ ); extern _X_EXPORT void SetWinSize(WindowPtr /*pWin */ ); extern _X_EXPORT void SetBorderSize(WindowPtr /*pWin */ ); extern _X_EXPORT void ResizeChildrenWinSize(WindowPtr /*pWin */ , int /*dx */ , int /*dy */ , int /*dw */ , int /*dh */ ); extern _X_EXPORT void SendShapeNotify(WindowPtr /* pWin */ , int /* which */); extern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ ); extern _X_EXPORT RegionPtr CreateClipShape(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 */ xorg-server-1.17.1/include/xorg-config.h.in0000664000175100017510000000620112406661137015441 00000000000000/* xorg-config.h.in: not at all generated. -*- c -*- * * This file differs from xorg-server.h.in in that -server is installed * with the rest of the SDK for external drivers/modules to use, whereas * -config is for internal use only (i.e. building the DDX). * */ #ifndef _XORG_CONFIG_H_ #define _XORG_CONFIG_H_ #include #include /* Building Xorg server. */ #undef XORGSERVER /* Current X.Org version. */ #undef XORG_VERSION_CURRENT /* Name of X server. */ #undef __XSERVERNAME__ /* URL to go to for support. */ #undef __VENDORDWEBSUPPORT__ /* Built-in output drivers. */ #undef DRIVERS /* Built-in input drivers. */ #undef IDRIVERS /* Path to configuration file. */ #undef XF86CONFIGFILE /* Path to configuration file. */ #undef __XCONFIGFILE__ /* Name of configuration directory. */ #undef __XCONFIGDIR__ /* Path to loadable modules. */ #undef DEFAULT_MODULE_PATH /* Path to installed libraries. */ #undef DEFAULT_LIBRARY_PATH /* Default log location */ #undef DEFAULT_LOGDIR /* Default logfile prefix */ #undef DEFAULT_LOGPREFIX /* Default XDG_DATA dir under HOME */ #undef DEFAULT_XDG_DATA_HOME /* Default log dir under XDG_DATA_HOME */ #undef DEFAULT_XDG_DATA_HOME_LOGDIR /* Building DRI-capable DDX. */ #undef XF86DRI /* Build DRI2 extension */ #undef DRI2 /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_KD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VT_H /* Define to 1 if you have the `walkcontext' function (used on Solaris for xorg_backtrace in hw/xfree86/common/xf86Events.c */ #undef HAVE_WALKCONTEXT /* Define to 1 if unsigned long is 64 bits. */ #undef _XSERVER64 /* Building vgahw module */ #undef WITH_VGAHW /* NetBSD PIO alpha IO */ #undef USE_ALPHA_PIO /* BSD AMD64 iopl */ #undef USE_AMD64_IOPL /* BSD /dev/io */ #undef USE_DEV_IO /* BSD i386 iopl */ #undef USE_I386_IOPL /* System is BSD-like */ #undef CSRG_BASED /* System has PC console */ #undef PCCONS_SUPPORT /* System has PCVT console */ #undef PCVT_SUPPORT /* System has syscons console */ #undef SYSCONS_SUPPORT /* System has wscons console */ #undef WSCONS_SUPPORT /* System has /dev/xf86 aperture driver */ #undef HAS_APERTURE_DRV /* Has backtrace support */ #undef HAVE_BACKTRACE /* Name of the period field in struct kbd_repeat */ #undef LNX_KBD_PERIOD_NAME /* Have execinfo.h */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MKDEV_H /* Path to text files containing PCI IDs */ #undef PCI_TXT_IDS_PATH /* Use SIGIO handlers for input device events by default */ #undef USE_SIGIO_BY_DEFAULT /* Build with libdrm support */ #undef WITH_LIBDRM /* Use libpciaccess */ #undef XSERVER_LIBPCIACCESS /* Have setugid */ #undef HAVE_ISSETUGID /* Have getresuid */ #undef HAVE_GETRESUID /* Have X server platform bus support */ #undef XSERVER_PLATFORM_BUS /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID /* Support APM/ACPI power management in the server */ #undef XF86PM #endif /* _XORG_CONFIG_H_ */ xorg-server-1.17.1/include/input.h0000664000175100017510000007477012456571574014003 00000000000000/************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ********************************************************/ #ifndef INPUT_H #define INPUT_H #include "misc.h" #include "screenint.h" #include #include #include #include "window.h" /* for WindowPtr */ #include "xkbrules.h" #include "events.h" #include "list.h" #include #define DEVICE_INIT 0 #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) #define POINTER_ACCELERATE (1 << 3) #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) #define TOUCH_REJECT (1 << 1) #define TOUCH_PENDING_END (1 << 2) #define TOUCH_CLIENT_ID (1 << 3) /* touch ID is the client-visible id */ #define TOUCH_REPLAYING (1 << 4) /* event is being replayed */ #define TOUCH_POINTER_EMULATED (1 << 5) /* touch event may be pointer emulated */ #define TOUCH_END (1 << 6) /* really end this touch now */ /*int constants for pointer acceleration schemes*/ #define PtrAccelNoOp 0 #define PtrAccelPredictable 1 #define PtrAccelLightweight 2 #define PtrAccelDefault PtrAccelPredictable #define MAX_VALUATORS 36 /* Maximum number of valuators, divided by six, rounded up, to get number * of events. */ #define MAX_VALUATOR_EVENTS 6 #define MAX_BUTTONS 256 /* completely arbitrarily chosen */ #define NO_AXIS_LIMITS -1 #define MAP_LENGTH MAX_BUTTONS #define DOWN_LENGTH (MAX_BUTTONS/8) /* 256/8 => number of bytes to hold 256 bits */ #define NullGrab ((GrabPtr)NULL) #define PointerRootWin ((WindowPtr)PointerRoot) #define NoneWin ((WindowPtr)None) #define NullDevice ((DevicePtr)NULL) #ifndef FollowKeyboard #define FollowKeyboard 3 #endif #ifndef FollowKeyboardWin #define FollowKeyboardWin ((WindowPtr) FollowKeyboard) #endif #ifndef RevertToFollowKeyboard #define RevertToFollowKeyboard 3 #endif enum InputLevel { CORE = 1, XI = 2, XI2 = 3, }; typedef unsigned long Leds; typedef struct _OtherClients *OtherClientsPtr; typedef struct _InputClients *InputClientsPtr; typedef struct _DeviceIntRec *DeviceIntPtr; typedef struct _ValuatorClassRec *ValuatorClassPtr; typedef struct _ClassesRec *ClassesPtr; typedef struct _SpriteRec *SpritePtr; typedef struct _TouchClassRec *TouchClassPtr; typedef struct _TouchPointInfo *TouchPointInfoPtr; typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr; typedef union _GrabMask GrabMask; typedef struct _ValuatorMask ValuatorMask; /* The DIX stores incoming input events in this list */ extern InternalEvent *InputEventList; typedef int (*DeviceProc) (DeviceIntPtr /*device */ , int /*what */ ); typedef void (*ProcessInputProc) (InternalEvent * /*event */ , DeviceIntPtr /*device */ ); typedef Bool (*DeviceHandleProc) (DeviceIntPtr /*device */ , void * /*data */ ); typedef void (*DeviceUnwrapProc) (DeviceIntPtr /*device */ , DeviceHandleProc /*proc */ , void * /*data */ ); /* pointer acceleration handling */ typedef void (*PointerAccelSchemeProc) (DeviceIntPtr /*device */ , ValuatorMask * /*valuators */ , CARD32 /*evtime */ ); typedef void (*DeviceCallbackProc) (DeviceIntPtr /*pDev */ ); struct _ValuatorAccelerationRec; typedef Bool (*PointerAccelSchemeInitProc) (DeviceIntPtr /*dev */ , struct _ValuatorAccelerationRec * /*protoScheme */ ); typedef struct _DeviceRec { void *devicePrivate; ProcessInputProc processInputProc; /* current */ ProcessInputProc realInputProc; /* deliver */ ProcessInputProc enqueueInputProc; /* enqueue */ Bool on; /* used by DDX to keep state */ } DeviceRec, *DevicePtr; typedef struct { int click, bell, bell_pitch, bell_duration; Bool autoRepeat; unsigned char autoRepeats[32]; Leds leds; unsigned char id; } KeybdCtrl; typedef struct { KeySym *map; KeyCode minKeyCode, maxKeyCode; int mapWidth; } KeySymsRec, *KeySymsPtr; typedef struct { int num, den, threshold; unsigned char id; } PtrCtrl; typedef struct { int resolution, min_value, max_value; int integer_displayed; unsigned char id; } IntegerCtrl; typedef struct { int max_symbols, num_symbols_supported; int num_symbols_displayed; KeySym *symbols_supported; KeySym *symbols_displayed; unsigned char id; } StringCtrl; typedef struct { int percent, pitch, duration; unsigned char id; } BellCtrl; typedef struct { Leds led_values; Mask led_mask; unsigned char id; } LedCtrl; extern _X_EXPORT KeybdCtrl defaultKeyboardControl; extern _X_EXPORT PtrCtrl defaultPointerControl; typedef struct _InputOption InputOption; typedef struct _XI2Mask XI2Mask; typedef struct _InputAttributes { char *product; char *vendor; char *device; char *pnp_id; char *usb_id; char **tags; /* null-terminated */ uint32_t flags; } InputAttributes; #define ATTR_KEYBOARD (1<<0) #define ATTR_POINTER (1<<1) #define ATTR_JOYSTICK (1<<2) #define ATTR_TABLET (1<<3) #define ATTR_TOUCHPAD (1<<4) #define ATTR_TOUCHSCREEN (1<<5) /* Key/Button has been run through all input processing and events sent to clients. */ #define KEY_PROCESSED 1 #define BUTTON_PROCESSED 1 /* Key/Button has not been fully processed, no events have been sent. */ #define KEY_POSTED 2 #define BUTTON_POSTED 2 extern _X_EXPORT void set_key_down(DeviceIntPtr pDev, int key_code, int type); extern _X_EXPORT void set_key_up(DeviceIntPtr pDev, int key_code, int type); extern _X_EXPORT int key_is_down(DeviceIntPtr pDev, int key_code, int type); extern _X_EXPORT void set_button_down(DeviceIntPtr pDev, int button, int type); extern _X_EXPORT void set_button_up(DeviceIntPtr pDev, int button, int type); extern _X_EXPORT int button_is_down(DeviceIntPtr pDev, int button, int type); extern void InitCoreDevices(void); extern void InitXTestDevices(void); extern _X_EXPORT DeviceIntPtr AddInputDevice(ClientPtr /*client */ , DeviceProc /*deviceProc */ , Bool /*autoStart */ ); extern _X_EXPORT Bool EnableDevice(DeviceIntPtr /*device */ , BOOL /* sendevent */ ); extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ , BOOL /* sendevent */ ); 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); extern _X_EXPORT int RemoveDevice(DeviceIntPtr /*dev */ , BOOL /* sendevent */ ); extern _X_EXPORT int NumMotionEvents(void); extern _X_EXPORT int dixLookupDevice(DeviceIntPtr * /* dev */ , int /* id */ , ClientPtr /* client */ , Mask /* access_mode */ ); extern _X_EXPORT void QueryMinMaxKeyCodes(KeyCode * /*minCode */ , KeyCode * /*maxCode */ ); extern _X_EXPORT Bool InitButtonClassDeviceStruct(DeviceIntPtr /*device */ , int /*numButtons */ , Atom * /* labels */ , CARD8 * /*map */ ); extern _X_INTERNAL ValuatorClassPtr AllocValuatorClass(ValuatorClassPtr src, int numAxes); extern _X_EXPORT Bool InitValuatorClassDeviceStruct(DeviceIntPtr /*device */ , int /*numAxes */ , Atom * /* labels */ , int /*numMotionEvents */ , int /*mode */ ); extern _X_EXPORT Bool InitPointerAccelerationScheme(DeviceIntPtr /*dev */ , int /*scheme */ ); extern _X_EXPORT Bool InitFocusClassDeviceStruct(DeviceIntPtr /*device */ ); extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ , unsigned int /*max_touches */ , unsigned int /*mode */ , unsigned int /*numAxes */ ); typedef void (*BellProcPtr) (int percent, DeviceIntPtr device, void *ctrl, int feedbackClass); typedef void (*KbdCtrlProcPtr) (DeviceIntPtr /*device */ , KeybdCtrl * /*ctrl */ ); typedef void (*PtrCtrlProcPtr) (DeviceIntPtr /*device */ , PtrCtrl * /*ctrl */ ); extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(DeviceIntPtr /*device */ , PtrCtrlProcPtr /*controlProc */ ); typedef void (*StringCtrlProcPtr) (DeviceIntPtr /*device */ , StringCtrl * /*ctrl */ ); extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(DeviceIntPtr /*device */ , StringCtrlProcPtr /*controlProc */ , int /*max_symbols */ , int /*num_symbols_supported */ , KeySym * /*symbols */ ); typedef void (*BellCtrlProcPtr) (DeviceIntPtr /*device */ , BellCtrl * /*ctrl */ ); extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(DeviceIntPtr /*device */ , BellProcPtr /*bellProc */ , BellCtrlProcPtr /*controlProc */ ); typedef void (*LedCtrlProcPtr) (DeviceIntPtr /*device */ , LedCtrl * /*ctrl */ ); extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(DeviceIntPtr /*device */ , LedCtrlProcPtr /*controlProc */ ); typedef void (*IntegerCtrlProcPtr) (DeviceIntPtr /*device */ , IntegerCtrl * /*ctrl */ ); extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(DeviceIntPtr /*device */ , IntegerCtrlProcPtr /*controlProc */ ); extern _X_EXPORT Bool InitPointerDeviceStruct(DevicePtr /*device */ , CARD8 * /*map */ , int /*numButtons */ , Atom * /* btn_labels */ , PtrCtrlProcPtr /*controlProc */ , int /*numMotionEvents */ , int /*numAxes */ , Atom * /* axes_labels */ ); extern _X_EXPORT Bool InitKeyboardDeviceStruct(DeviceIntPtr /*device */ , XkbRMLVOSet * /*rmlvo */ , BellProcPtr /*bellProc */ , KbdCtrlProcPtr /*controlProc */ ); extern _X_EXPORT Bool InitKeyboardDeviceStructFromString(DeviceIntPtr dev, const char *keymap, int keymap_length, BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func); extern int ApplyPointerMapping(DeviceIntPtr /* pDev */ , CARD8 * /* map */ , int /* len */ , ClientPtr /* client */ ); extern Bool BadDeviceMap(BYTE * /*buff */ , int /*length */ , unsigned /*low */ , unsigned /*high */ , XID * /*errval */ ); extern void NoteLedState(DeviceIntPtr /*keybd */ , int /*led */ , Bool /*on */ ); extern void MaybeStopHint(DeviceIntPtr /*device */ , ClientPtr /*client */ ); extern void ProcessPointerEvent(InternalEvent * /* ev */ , DeviceIntPtr /*mouse */ ); extern void ProcessKeyboardEvent(InternalEvent * /*ev */ , DeviceIntPtr /*keybd */ ); extern Bool LegalModifier(unsigned int /*key */ , DeviceIntPtr /*pDev */ ); extern _X_EXPORT void ProcessInputEvents(void); extern _X_EXPORT void InitInput(int /*argc */ , char ** /*argv */ ); extern _X_EXPORT void CloseInput(void); extern _X_EXPORT int GetMaximumEventsNum(void); extern _X_EXPORT InternalEvent *InitEventList(int num_events); extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events); extern void CreateClassesChangedEvent(InternalEvent *event, DeviceIntPtr master, DeviceIntPtr slave, int flags); extern InternalEvent *UpdateFromMaster(InternalEvent *events, DeviceIntPtr pDev, int type, int *num_events); extern _X_EXPORT int GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, int flags, const ValuatorMask *mask); extern _X_EXPORT void QueuePointerEvents(DeviceIntPtr pDev, int type, int buttons, int flags, const ValuatorMask *mask); extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int key_code, const ValuatorMask *mask); extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev, int type, int key_code, const ValuatorMask *mask); extern int GetTouchEvents(InternalEvent *events, DeviceIntPtr pDev, uint32_t ddx_touchid, uint16_t type, uint32_t flags, const ValuatorMask *mask); void QueueTouchEvents(DeviceIntPtr device, int type, uint32_t ddx_touchid, int flags, const ValuatorMask *mask); extern int GetTouchOwnershipEvents(InternalEvent *events, DeviceIntPtr pDev, 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); 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); extern _X_EXPORT int GetMotionHistorySize(void); extern _X_EXPORT void AllocateMotionHistory(DeviceIntPtr pDev); extern _X_EXPORT int GetMotionHistory(DeviceIntPtr pDev, xTimecoord ** buff, unsigned long start, unsigned long stop, ScreenPtr pScreen, BOOL core); extern void ReleaseButtonsAndKeys(DeviceIntPtr dev); extern int AttachDevice(ClientPtr client, DeviceIntPtr slave, DeviceIntPtr master); extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd); extern DeviceIntPtr GetMaster(DeviceIntPtr dev, int type); extern _X_EXPORT int AllocDevicePair(ClientPtr client, const char *name, DeviceIntPtr *ptr, DeviceIntPtr *keybd, DeviceProc ptr_proc, DeviceProc keybd_proc, Bool master); extern void DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to, DeviceChangedEvent *dce); /* Helper functions. */ extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev, KeyCode **modkeymap, int *max_keys_per_mod); extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map, int max_keys_per_mod); extern int AllocXTestDevice(ClientPtr client, const char *name, DeviceIntPtr *ptr, DeviceIntPtr *keybd, DeviceIntPtr master_ptr, DeviceIntPtr master_keybd); extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master); extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master); extern void SendDevicePresenceEvent(int deviceid, int type); extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes * attrs); extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs); enum TouchListenerState { LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */ LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */ LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already accepted */ LISTENER_IS_OWNER, /**< Is the current owner, hasn't accepted */ LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */ LISTENER_HAS_END, /**< Has already received the end event */ }; enum TouchListenerType { LISTENER_GRAB, LISTENER_POINTER_GRAB, LISTENER_REGULAR, LISTENER_POINTER_REGULAR, }; extern void TouchInitDDXTouchPoint(DeviceIntPtr dev, DDXTouchPointInfoPtr ddxtouch); extern DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id); extern void TouchEndDDXTouch(DeviceIntPtr dev, DDXTouchPointInfoPtr ti); extern DDXTouchPointInfoPtr TouchFindByDDXID(DeviceIntPtr dev, uint32_t ddx_id, Bool create); extern Bool TouchInitTouchPoint(TouchClassPtr touch, ValuatorClassPtr v, int index); extern void TouchFreeTouchPoint(DeviceIntPtr dev, int index); extern TouchPointInfoPtr TouchBeginTouch(DeviceIntPtr dev, int sourceid, uint32_t touchid, Bool emulate_pointer); extern TouchPointInfoPtr TouchFindByClientID(DeviceIntPtr dev, uint32_t client_id); extern void TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti); extern Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti); extern void TouchEventHistoryFree(TouchPointInfoPtr ti); 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, int resource_type, enum InputLevel level, enum TouchListenerType type, enum TouchListenerState state, WindowPtr window, GrabPtr grab); extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource); extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev); extern Bool TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, InternalEvent *ev); extern Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite); extern int TouchConvertToPointerEvent(const InternalEvent *ev, InternalEvent *motion, InternalEvent *button); extern int TouchGetPointerEventType(const InternalEvent *ev); extern void TouchRemovePointerGrab(DeviceIntPtr dev); extern void TouchListenerGone(XID resource); 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); extern void TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource); extern void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid); /* misc event helpers */ extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients); extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event); extern Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent *ev); extern int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type); void FixUpEventFromWindow(SpritePtr pSprite, xEvent *xE, WindowPtr pWin, Window child, Bool calcChild); extern Bool PointInBorderSize(WindowPtr pWin, int x, int y); extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y); extern int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win); extern Bool ActivatePassiveGrab(DeviceIntPtr dev, GrabPtr grab, InternalEvent *ev, InternalEvent *real_event); /** * Masks specifying the type of event to deliver for an InternalEvent; used * by EventIsDeliverable. * @defgroup EventIsDeliverable return flags * @{ */ #define EVENT_XI1_MASK (1 << 0) /**< XI1.x event */ #define EVENT_CORE_MASK (1 << 1) /**< Core event */ #define EVENT_DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set */ #define EVENT_XI2_MASK (1 << 3) /**< XI2 mask set on window */ /* @} */ enum EventDeliveryState { EVENT_DELIVERED, /**< Event has been delivered to a client */ EVENT_NOT_DELIVERED, /**< Event was not delivered to any client */ EVENT_SKIP, /**< Event can be discarded by the caller */ EVENT_REJECTED, /**< Event was rejected for delivery to the client */ }; /* Implemented by the DDX. */ extern _X_EXPORT int NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *dev); extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev); extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration); #define VALUATOR_MODE_ALL_AXES -1 extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis); extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode); /* Set to TRUE by default - os/utils.c sets it to FALSE on user request, xfixes/cursor.c uses it to determine if the cursor is enabled */ extern Bool EnableCursor; /* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on * CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled */ extern Bool CursorVisible; extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators); extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask); extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask, int first_valuator, int num_valuators, const int *valuators); extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask, int valuator, int data); extern _X_EXPORT void valuator_mask_set_double(ValuatorMask *mask, int valuator, double data); extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask); extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask); extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit); extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit); extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask); extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src); extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum); extern _X_EXPORT double valuator_mask_get_double(const ValuatorMask *mask, int valnum); extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask, int valnum, int *val); extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask, int valnum, double *val); /* InputOption handling interface */ extern _X_EXPORT InputOption *input_option_new(InputOption *list, const char *key, const char *value); extern _X_EXPORT void input_option_free_list(InputOption **opt); extern _X_EXPORT InputOption *input_option_free_element(InputOption *opt, const char *key); extern _X_EXPORT InputOption *input_option_find(InputOption *list, const char *key); extern _X_EXPORT const char *input_option_get_key(const InputOption *opt); extern _X_EXPORT const char *input_option_get_value(const InputOption *opt); extern _X_EXPORT void input_option_set_key(InputOption *opt, const char *key); extern _X_EXPORT void input_option_set_value(InputOption *opt, const char *value); 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 */ xorg-server-1.17.1/include/gcstruct.h0000664000175100017510000002474612456571574014500 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef GCSTRUCT_H #define GCSTRUCT_H #include "gc.h" #include "regionstr.h" #include "region.h" #include "pixmap.h" #include "screenint.h" #include "privates.h" #include #define GCAllBits ((1 << (GCLastBit + 1)) - 1) /* * functions which modify the state of the GC */ typedef struct _GCFuncs { void (*ValidateGC) (GCPtr /*pGC */ , unsigned long /*stateChanges */ , DrawablePtr /*pDrawable */ ); void (*ChangeGC) (GCPtr /*pGC */ , unsigned long /*mask */ ); void (*CopyGC) (GCPtr /*pGCSrc */ , unsigned long /*mask */ , GCPtr /*pGCDst */ ); void (*DestroyGC) (GCPtr /*pGC */ ); void (*ChangeClip) (GCPtr pGC, int type, void *pvalue, int nrects); void (*DestroyClip) (GCPtr /*pGC */ ); void (*CopyClip) (GCPtr /*pgcDst */ , GCPtr /*pgcSrc */ ); } GCFuncs; /* * graphics operations invoked through a GC */ typedef struct _GCOps { void (*FillSpans) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*nInit */ , DDXPointPtr /*pptInit */ , int * /*pwidthInit */ , int /*fSorted */ ); void (*SetSpans) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , char * /*psrc */ , DDXPointPtr /*ppt */ , int * /*pwidth */ , int /*nspans */ , int /*fSorted */ ); void (*PutImage) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*depth */ , int /*x */ , int /*y */ , int /*w */ , int /*h */ , int /*leftPad */ , int /*format */ , char * /*pBits */ ); RegionPtr (*CopyArea) (DrawablePtr /*pSrc */ , DrawablePtr /*pDst */ , GCPtr /*pGC */ , int /*srcx */ , int /*srcy */ , int /*w */ , int /*h */ , int /*dstx */ , int /*dsty */ ); RegionPtr (*CopyPlane) (DrawablePtr /*pSrcDrawable */ , DrawablePtr /*pDstDrawable */ , GCPtr /*pGC */ , int /*srcx */ , int /*srcy */ , int /*width */ , int /*height */ , int /*dstx */ , int /*dsty */ , unsigned long /*bitPlane */ ); void (*PolyPoint) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*mode */ , int /*npt */ , DDXPointPtr /*pptInit */ ); void (*Polylines) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*mode */ , int /*npt */ , DDXPointPtr /*pptInit */ ); void (*PolySegment) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*nseg */ , xSegment * /*pSegs */ ); void (*PolyRectangle) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*nrects */ , xRectangle * /*pRects */ ); void (*PolyArc) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*narcs */ , xArc * /*parcs */ ); void (*FillPolygon) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*shape */ , int /*mode */ , int /*count */ , DDXPointPtr /*pPts */ ); void (*PolyFillRect) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*nrectFill */ , xRectangle * /*prectInit */ ); void (*PolyFillArc) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*narcs */ , xArc * /*parcs */ ); int (*PolyText8) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , char * /*chars */ ); int (*PolyText16) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , unsigned short * /*chars */ ); void (*ImageText8) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , char * /*chars */ ); void (*ImageText16) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , int /*x */ , int /*y */ , int /*count */ , unsigned short * /*chars */ ); void (*ImageGlyphBlt) (DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase); void (*PolyGlyphBlt) (DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase); void (*PushPixels) (GCPtr /*pGC */ , PixmapPtr /*pBitMap */ , DrawablePtr /*pDst */ , int /*w */ , int /*h */ , int /*x */ , int /*y */ ); } GCOps; /* there is padding in the bit fields because the Sun compiler doesn't * force alignment to 32-bit boundaries. losers. */ typedef struct _GC { ScreenPtr pScreen; unsigned char depth; unsigned char alu; unsigned short lineWidth; unsigned short dashOffset; unsigned short numInDashList; unsigned char *dash; unsigned int lineStyle:2; unsigned int capStyle:2; unsigned int joinStyle:2; unsigned int fillStyle:2; unsigned int fillRule:1; unsigned int arcMode:1; unsigned int subWindowMode:1; unsigned int graphicsExposures:1; unsigned int miTranslate:1; /* should mi things translate? */ unsigned int tileIsPixel:1; /* tile is solid pixel */ unsigned int fExpose:1; /* Call exposure handling */ unsigned int freeCompClip:1; /* Free composite clip */ unsigned int scratch_inuse:1; /* is this GC in a pool for reuse? */ unsigned int unused:15; /* see comment above */ unsigned int planemask; unsigned int fgPixel; unsigned int bgPixel; /* * alas -- both tile and stipple must be here as they * are independently specifiable */ PixUnion tile; PixmapPtr stipple; DDXPointRec patOrg; /* origin for (tile, stipple) */ DDXPointRec clipOrg; struct _Font *font; RegionPtr clientClip; unsigned int stateChanges; /* masked with GC_ */ unsigned int serialNumber; const GCFuncs *funcs; const GCOps *ops; PrivateRec *devPrivates; /* * The following were moved here from private storage to allow device- * independent access to them from screen wrappers. * --- 1997.11.03 Marc Aurele La France (tsi@xfree86.org) */ PixmapPtr pRotatedPixmap; /* tile/stipple rotated for alignment */ RegionPtr pCompositeClip; /* fExpose & freeCompClip defined above */ } GC; #endif /* GCSTRUCT_H */ xorg-server-1.17.1/include/dixaccess.h0000664000175100017510000000515312274325511014561 00000000000000/*********************************************************** 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. ******************************************************************/ #ifndef DIX_ACCESS_H #define DIX_ACCESS_H /* These are the access modes that can be passed in the last parameter * to several of the dix lookup functions. They were originally part * of the Security extension, now used by XACE. * * You can or these values together to indicate multiple modes * simultaneously. */ #define DixUnknownAccess 0 /* don't know intentions */ #define DixReadAccess (1<<0) /* inspecting the object */ #define DixWriteAccess (1<<1) /* changing the object */ #define DixDestroyAccess (1<<2) /* destroying the object */ #define DixCreateAccess (1<<3) /* creating the object */ #define DixGetAttrAccess (1<<4) /* get object attributes */ #define DixSetAttrAccess (1<<5) /* set object attributes */ #define DixListPropAccess (1<<6) /* list properties of object */ #define DixGetPropAccess (1<<7) /* get properties of object */ #define DixSetPropAccess (1<<8) /* set properties of object */ #define DixGetFocusAccess (1<<9) /* get focus of object */ #define DixSetFocusAccess (1<<10) /* set focus of object */ #define DixListAccess (1<<11) /* list objects */ #define DixAddAccess (1<<12) /* add object */ #define DixRemoveAccess (1<<13) /* remove object */ #define DixHideAccess (1<<14) /* hide object */ #define DixShowAccess (1<<15) /* show object */ #define DixBlendAccess (1<<16) /* mix contents of objects */ #define DixGrabAccess (1<<17) /* exclusive access to object */ #define DixFreezeAccess (1<<18) /* freeze status of object */ #define DixForceAccess (1<<19) /* force status of object */ #define DixInstallAccess (1<<20) /* install object */ #define DixUninstallAccess (1<<21) /* uninstall object */ #define DixSendAccess (1<<22) /* send to object */ #define DixReceiveAccess (1<<23) /* receive from object */ #define DixUseAccess (1<<24) /* use object */ #define DixManageAccess (1<<25) /* manage object */ #define DixDebugAccess (1<<26) /* debug object */ #define DixBellAccess (1<<27) /* audible sound */ #define DixPostAccess (1<<28) /* post or follow-up call */ #endif /* DIX_ACCESS_H */ xorg-server-1.17.1/include/globals.h0000664000175100017510000000265212274325511014237 00000000000000 #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 */ extern _X_EXPORT CARD32 defaultScreenSaverTime; extern _X_EXPORT CARD32 defaultScreenSaverInterval; extern _X_EXPORT CARD32 ScreenSaverTime; extern _X_EXPORT CARD32 ScreenSaverInterval; #ifdef SCREENSAVER extern _X_EXPORT Bool screenSaverSuspended; #endif extern _X_EXPORT const char *defaultFontPath; extern _X_EXPORT int monitorResolution; extern _X_EXPORT int defaultColorVisualClass; 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; extern _X_EXPORT CARD32 DPMSSuspendTime; extern _X_EXPORT CARD32 DPMSOffTime; extern _X_EXPORT CARD16 DPMSPowerLevel; extern _X_EXPORT Bool DPMSEnabled; extern _X_EXPORT Bool DPMSDisabledSwitch; extern _X_EXPORT Bool DPMSCapableFlag; #endif #ifdef PANORAMIX extern _X_EXPORT Bool PanoramiXExtensionDisabledHack; #endif #ifdef XSELINUX #define SELINUX_MODE_DEFAULT 0 #define SELINUX_MODE_DISABLED 1 #define SELINUX_MODE_PERMISSIVE 2 #define SELINUX_MODE_ENFORCING 3 extern _X_EXPORT int selinuxEnforcingState; #endif #endif /* !_XSERV_GLOBAL_H_ */ xorg-server-1.17.1/include/events.h0000664000175100017510000000311012274325511014106 00000000000000/* * Copyright © 2009 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. * */ #ifndef EVENTS_H #define EVENTS_H typedef struct _DeviceEvent DeviceEvent; typedef struct _DeviceChangedEvent DeviceChangedEvent; typedef struct _TouchOwnershipEvent TouchOwnershipEvent; typedef struct _BarrierEvent BarrierEvent; #if XFreeXDGA typedef struct _DGAEvent DGAEvent; #endif typedef struct _RawDeviceEvent RawDeviceEvent; #ifdef XQUARTZ typedef struct _XQuartzEvent XQuartzEvent; #endif typedef union _InternalEvent InternalEvent; #endif xorg-server-1.17.1/include/dbus-core.h0000664000175100017510000000351012456571574014507 00000000000000/* * Copyright © 2013 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. * * Author: Hans de Goede */ #ifndef DBUS_CORE_H #define DBUS_CORE_H #ifdef NEED_DBUS #include typedef void (*dbus_core_connect_hook) (DBusConnection * connection, void *data); typedef void (*dbus_core_disconnect_hook) (void *data); struct dbus_core_hook { dbus_core_connect_hook connect; dbus_core_disconnect_hook disconnect; void *data; struct dbus_core_hook *next; }; int dbus_core_init(void); void dbus_core_fini(void); int dbus_core_add_hook(struct dbus_core_hook *hook); void dbus_core_remove_hook(struct dbus_core_hook *hook); #else #define dbus_core_init() #define dbus_core_fini() #endif #endif xorg-server-1.17.1/include/glx_extinit.h0000664000175100017510000000303412274325511015145 00000000000000/* * 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 xorg-server-1.17.1/include/region.h0000664000175100017510000000451612456571574014116 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef REGION_H #define REGION_H #include "regionstr.h" #endif /* REGION_H */ xorg-server-1.17.1/include/rgb.h0000664000175100017510000000455612456571574013411 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef RGB_H #define RGB_H typedef struct _RGB { unsigned short red, green, blue; } RGB; #endif /* RGB_H */ xorg-server-1.17.1/include/privates.h0000664000175100017510000002547212316443615014461 00000000000000/*********************************************************** 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 AUTHOR 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 PRIVATES_H #define PRIVATES_H 1 #include #include #include #include "misc.h" /***************************************************************** * STUFF FOR PRIVATES *****************************************************************/ typedef struct _Private PrivateRec, *PrivatePtr; typedef enum { /* XSELinux uses the same private keys for numerous objects */ PRIVATE_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, PRIVATE_EXTENSION, PRIVATE_COLORMAP, PRIVATE_DEVICE, /* These cannot have any objects before all relevant keys are registered */ PRIVATE_CLIENT, PRIVATE_PROPERTY, PRIVATE_SELECTION, PRIVATE_WINDOW, PRIVATE_PIXMAP, PRIVATE_GC, PRIVATE_CURSOR, PRIVATE_CURSOR_BITS, /* extension privates */ PRIVATE_DAMAGE, PRIVATE_GLYPH, PRIVATE_GLYPHSET, PRIVATE_PICTURE, PRIVATE_SYNC_FENCE, /* last private type */ PRIVATE_LAST, } DevPrivateType; typedef struct _DevPrivateKeyRec { int offset; int size; Bool initialized; Bool allocated; DevPrivateType type; 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; /* * Let drivers know how to initialize private keys */ #define HAS_DEVPRIVATEKEYREC 1 #define HAS_DIXREGISTERPRIVATEKEY 1 /* * Register a new private index for the private type. * * This initializes the specified key and optionally requests pre-allocated * private space for your driver/module. If you request no extra space, you * may set and get a single pointer value using this private key. Otherwise, * you can get the address of the extra space and store whatever data you like * there. * * You may call dixRegisterPrivateKey more than once on the same key, but the * size and type must match or the server will abort. * * dixRegisterPrivateKey returns FALSE if it fails to allocate memory * during its operation. */ extern _X_EXPORT Bool dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size); /* * Check whether a private key has been registered */ static inline Bool dixPrivateKeyRegistered(DevPrivateKey key) { return key->initialized; } /* * Get the address of the private storage. * * For keys with pre-defined storage, this gets the base of that storage * Otherwise, it returns the place where the private pointer is stored. */ static inline void * dixGetPrivateAddr(PrivatePtr *privates, const DevPrivateKey key) { assert(key->initialized); return (char *) (*privates) + key->offset; } /* * Fetch a private pointer stored in the object * * Returns the pointer stored with dixSetPrivate. * This must only be used with keys that have * no pre-defined storage */ static inline void * dixGetPrivate(PrivatePtr *privates, const DevPrivateKey key) { assert(key->size == 0); return *(void **) dixGetPrivateAddr(privates, key); } /* * Associate 'val' with 'key' in 'privates' so that later calls to * dixLookupPrivate(privates, key) will return 'val'. */ static inline void dixSetPrivate(PrivatePtr *privates, const DevPrivateKey key, void *val) { assert(key->size == 0); *(void **) dixGetPrivateAddr(privates, key) = val; } #include "dix.h" #include "resource.h" /* * Lookup a pointer to the private record. * * For privates with defined storage, return the address of the * storage. For privates without defined storage, return the pointer * contents */ static inline void * dixLookupPrivate(PrivatePtr *privates, const DevPrivateKey key) { if (key->size) return dixGetPrivateAddr(privates, key); else return dixGetPrivate(privates, key); } /* * Look up the address of the pointer to the storage * * This returns the place where the private pointer is stored, * which is only valid for privates without predefined storage. */ static inline void ** dixLookupPrivateAddr(PrivatePtr *privates, const DevPrivateKey key) { assert(key->size == 0); return (void **) dixGetPrivateAddr(privates, key); } extern _X_EXPORT Bool dixRegisterScreenPrivateKey(DevScreenPrivateKey key, ScreenPtr pScreen, DevPrivateType type, unsigned size); extern _X_EXPORT DevPrivateKey _dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen); static inline void * dixGetScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) { return dixGetPrivateAddr(privates, _dixGetScreenPrivateKey(key, pScreen)); } static inline void * dixGetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) { return dixGetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen)); } static inline void dixSetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen, void *val) { dixSetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen), val); } static inline void * dixLookupScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) { return dixLookupPrivate(privates, _dixGetScreenPrivateKey(key, pScreen)); } static inline void ** dixLookupScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) { return dixLookupPrivateAddr(privates, _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. * * For objects created during server initialization, this allows those * privates to be re-allocated as new private keys are registered. * * This includes screens, the serverClient, default colormaps and * extensions entries. */ extern _X_EXPORT Bool dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type); /* * Frees separately allocated private data */ extern _X_EXPORT void dixFreePrivates(PrivatePtr privates, DevPrivateType type); /* * Initialize privates by zeroing them */ extern _X_EXPORT void _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type); #define dixInitPrivates(o, v, type) _dixInitPrivates(&(o)->devPrivates, (v), type); /* * Clean up privates */ extern _X_EXPORT void _dixFiniPrivates(PrivatePtr privates, DevPrivateType type); #define dixFiniPrivates(o,t) _dixFiniPrivates((o)->devPrivates,t) /* * Allocates private data at object creation time. Required * for almost all objects, except for the list described * above for dixAllocatePrivates. */ extern _X_EXPORT void *_dixAllocateObjectWithPrivates(unsigned size, unsigned clear, unsigned offset, DevPrivateType type); #define dixAllocateObjectWithPrivates(t, type) (t *) _dixAllocateObjectWithPrivates(sizeof(t), sizeof(t), offsetof(t, devPrivates), type) extern _X_EXPORT void _dixFreeObjectWithPrivates(void *object, PrivatePtr privates, DevPrivateType type); #define dixFreeObjectWithPrivates(o,t) _dixFreeObjectWithPrivates(o, (o)->devPrivates, t) /* * Return size of privates for the specified type */ extern _X_EXPORT int dixPrivatesSize(DevPrivateType type); /* * Dump out private stats to ErrorF */ extern void dixPrivateUsage(void); /* * Resets the privates subsystem. dixResetPrivates is called from the main loop * before each server generation. This function must only be called by main(). */ extern _X_EXPORT void dixResetPrivates(void); /* * Looks up the offset where the devPrivates field is located. * * Returns -1 if the specified resource has no dev privates. * The position of the devPrivates field varies by structure * and calling code might only know the resource type, not the * structure definition. */ extern _X_EXPORT int dixLookupPrivateOffset(RESTYPE type); /* * Convenience macro for adding an offset to an object pointer * when making a call to one of the devPrivates functions */ #define DEVPRIV_AT(ptr, offset) ((PrivatePtr *)((char *)(ptr) + offset)) #endif /* PRIVATES_H */ xorg-server-1.17.1/include/list.h0000664000175100017510000003524112460362577013601 00000000000000/* * Copyright © 2010 Intel Corporation * Copyright © 2010 Francisco Jerez * * 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 _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 * * Example: * We need to keep a list of struct foo in the parent struct bar, i.e. what * we want is something like this. * * struct bar { * ... * struct foo *list_of_foos; -----> struct foo {}, struct foo {}, struct foo{} * ... * } * * We need one list head in bar and a list element in all list_of_foos (both are of * data type 'struct xorg_list'). * * struct bar { * ... * struct xorg_list list_of_foos; * ... * } * * struct foo { * ... * struct xorg_list entry; * ... * } * * Now we initialize the list head: * * struct bar bar; * ... * xorg_list_init(&bar.list_of_foos); * * Then we create the first element and add it to this list: * * struct foo *foo = malloc(...); * .... * xorg_list_add(&foo->entry, &bar.list_of_foos); * * Repeat the above for each element you want to add to the list. Deleting * works with the element itself. * xorg_list_del(&foo->entry); * free(foo); * * Note: calling xorg_list_del(&bar.list_of_foos) will set bar.list_of_foos to an empty * list again. * * Looping through the list requires a 'struct foo' as iterator and the * name of the field the subnodes use. * * struct foo *iterator; * xorg_list_for_each_entry(iterator, &bar.list_of_foos, entry) { * if (iterator->something == ...) * ... * } * * Note: You must not call xorg_list_del() on the iterator if you continue the * loop. You need to run the safe for-each loop instead: * * struct foo *iterator, *next; * xorg_list_for_each_entry_safe(iterator, next, &bar.list_of_foos, entry) { * if (...) * xorg_list_del(&iterator->entry); * } * */ /** * The linkage struct for list nodes. This struct must be part of your * to-be-linked struct. struct xorg_list is required for both the head of the * list and for each list node. * * Position and name of the struct xorg_list field is irrelevant. * There are no requirements that elements of a list are of the same type. * There are no requirements for a list head, any struct xorg_list can be a list * head. */ struct xorg_list { struct xorg_list *next, *prev; }; /** * Initialize the list as an empty list. * * Example: * xorg_list_init(&bar->list_of_foos); * * @param list The list to initialize */ static inline void xorg_list_init(struct xorg_list *list) { list->next = list->prev = list; } static inline void __xorg_list_add(struct xorg_list *entry, struct xorg_list *prev, struct xorg_list *next) { next->prev = entry; entry->next = next; entry->prev = prev; prev->next = entry; } /** * Insert a new element after the given list head. The new element does not * need to be initialised as empty list. * The list changes from: * head → some element → ... * to * head → new element → older element → ... * * Example: * struct foo *newfoo = malloc(...); * xorg_list_add(&newfoo->entry, &bar->list_of_foos); * * @param entry The new element to prepend to the list. * @param head The existing list. */ static inline void xorg_list_add(struct xorg_list *entry, struct xorg_list *head) { __xorg_list_add(entry, head, head->next); } /** * Append a new element to the end of the list given with this list head. * * The list changes from: * head → some element → ... → lastelement * to * head → some element → ... → lastelement → new element * * Example: * struct foo *newfoo = malloc(...); * xorg_list_append(&newfoo->entry, &bar->list_of_foos); * * @param entry The new element to prepend to the list. * @param head The existing list. */ static inline void xorg_list_append(struct xorg_list *entry, struct xorg_list *head) { __xorg_list_add(entry, head->prev, head); } static inline void __xorg_list_del(struct xorg_list *prev, struct xorg_list *next) { next->prev = prev; prev->next = next; } /** * Remove the element from the list it is in. Using this function will reset * the pointers to/from this element so it is removed from the list. It does * NOT free the element itself or manipulate it otherwise. * * Using xorg_list_del on a pure list head (like in the example at the top of * this file) will NOT remove the first element from * the list but rather reset the list as empty list. * * Example: * xorg_list_del(&foo->entry); * * @param entry The element to remove. */ static inline void xorg_list_del(struct xorg_list *entry) { __xorg_list_del(entry->prev, entry->next); xorg_list_init(entry); } /** * Check if the list is empty. * * Example: * xorg_list_is_empty(&bar->list_of_foos); * * @return True if the list contains one or more elements or False otherwise. */ static inline int xorg_list_is_empty(struct xorg_list *head) { return head->next == head; } /** * Returns a pointer to the container of this list element. * * Example: * struct foo* f; * f = container_of(&foo->entry, struct foo, entry); * assert(f == foo); * * @param ptr Pointer to the struct xorg_list. * @param type Data type of the list element. * @param member Member name of the struct xorg_list field in the list element. * @return A pointer to the data struct containing the list head. */ #ifndef container_of #define container_of(ptr, type, member) \ (type *)((char *)(ptr) - offsetof(type, member)) #endif /** * Alias of container_of */ #define xorg_list_entry(ptr, type, member) \ container_of(ptr, type, member) /** * Retrieve the first list entry for the given list pointer. * * Example: * struct foo *first; * first = xorg_list_first_entry(&bar->list_of_foos, struct foo, list_of_foos); * * @param ptr The list head * @param type Data type of the list element to retrieve * @param member Member name of the struct xorg_list field in the list element. * @return A pointer to the first list element. */ #define xorg_list_first_entry(ptr, type, member) \ xorg_list_entry((ptr)->next, type, member) /** * Retrieve the last list entry for the given listpointer. * * Example: * struct foo *first; * first = xorg_list_last_entry(&bar->list_of_foos, struct foo, list_of_foos); * * @param ptr The list head * @param type Data type of the list element to retrieve * @param member Member name of the struct xorg_list field in the list element. * @return A pointer to the last list element. */ #define xorg_list_last_entry(ptr, type, member) \ xorg_list_entry((ptr)->prev, type, member) #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. * * Example: * struct foo *iterator; * xorg_list_for_each_entry(iterator, &bar->list_of_foos, entry) { * [modify iterator] * } * * This macro is not safe for node deletion. Use xorg_list_for_each_entry_safe * instead. * * @param pos Iterator variable of the type of the list elements. * @param head List head * @param member Member name of the struct xorg_list in the list elements. * */ #define xorg_list_for_each_entry(pos, head, member) \ for (pos = __container_of((head)->next, pos, member); \ &pos->member != (head); \ pos = __container_of(pos->member.next, pos, member)) /** * Loop through the list, keeping a backup pointer to the element. This * macro allows for the deletion of a list element while looping through the * list. * * See xorg_list_for_each_entry for more details. */ #define xorg_list_for_each_entry_safe(pos, tmp, head, member) \ for (pos = __container_of((head)->next, pos, member), \ tmp = __container_of(pos->member.next, pos, member); \ &pos->member != (head); \ pos = tmp, tmp = __container_of(pos->member.next, tmp, member)) /* NULL-Terminated List Interface * * The interface below does _not_ use the struct xorg_list as described above. * It is mainly for legacy structures that cannot easily be switched to * struct xorg_list. * * This interface is for structs like * struct foo { * [...] * struct foo *next; * [...] * }; * * The position and field name of "next" are arbitrary. */ /** * Init the element as null-terminated list. * * Example: * struct foo *list = malloc(); * nt_list_init(list, next); * * @param list The list element that will be the start of the list * @param member Member name of the field pointing to next struct */ #define nt_list_init(_list, _member) \ (_list)->_member = NULL /** * Returns the next element in the list or NULL on termination. * * Example: * struct foo *element = list; * while ((element = nt_list_next(element, next)) { } * * This macro is not safe for node deletion. Use nt_list_for_each_entry_safe * instead. * * @param list The list or current element. * @param member Member name of the field pointing to next struct. */ #define nt_list_next(_list, _member) \ (_list)->_member /** * Iterate through each element in the list. * * Example: * struct foo *iterator; * nt_list_for_each_entry(iterator, list, next) { * [modify iterator] * } * * @param entry Assigned to the current list element * @param list The list to iterate through. * @param member Member name of the field pointing to next struct. */ #define nt_list_for_each_entry(_entry, _list, _member) \ for (_entry = _list; _entry; _entry = (_entry)->_member) /** * Iterate through each element in the list, keeping a backup pointer to the * element. This macro allows for the deletion of a list element while * looping through the list. * * See nt_list_for_each_entry for more details. * * @param entry Assigned to the current list element * @param tmp The pointer to the next element * @param list The list to iterate through. * @param member Member name of the field pointing to next struct. */ #define nt_list_for_each_entry_safe(_entry, _tmp, _list, _member) \ for (_entry = _list, _tmp = (_entry) ? (_entry)->_member : NULL;\ _entry; \ _entry = _tmp, _tmp = (_tmp) ? (_tmp)->_member: NULL) /** * Append the element to the end of the list. This macro may be used to * merge two lists. * * Example: * struct foo *elem = malloc(...); * nt_list_init(elem, next) * nt_list_append(elem, list, struct foo, next); * * Resulting list order: * list_item_0 -> list_item_1 -> ... -> elem_item_0 -> elem_item_1 ... * * @param entry An entry (or list) to append to the list * @param list The list to append to. This list must be a valid list, not * NULL. * @param type The list type * @param member Member name of the field pointing to next struct */ #define nt_list_append(_entry, _list, _type, _member) \ do { \ _type *__iterator = _list; \ while (__iterator->_member) { __iterator = __iterator->_member;}\ __iterator->_member = _entry; \ } while (0) /** * Insert the element at the next position in the list. This macro may be * used to insert a list into a list. * * struct foo *elem = malloc(...); * nt_list_init(elem, next) * nt_list_insert(elem, list, struct foo, next); * * Resulting list order: * list_item_0 -> elem_item_0 -> elem_item_1 ... -> list_item_1 -> ... * * @param entry An entry (or list) to append to the list * @param list The list to insert to. This list must be a valid list, not * NULL. * @param type The list type * @param member Member name of the field pointing to next struct */ #define nt_list_insert(_entry, _list, _type, _member) \ do { \ nt_list_append((_list)->_member, _entry, _type, _member); \ (_list)->_member = _entry; \ } while (0) /** * Delete the entry from the list by iterating through the list and * removing any reference from the list to the entry. * * Example: * struct foo *elem = * nt_list_del(elem, list, struct foo, next); * * @param entry The entry to delete from the list. entry is always * re-initialized as a null-terminated list. * @param list The list containing the entry, set to the new list without * the removed entry. * @param type The list type * @param member Member name of the field pointing to the next entry */ #define nt_list_del(_entry, _list, _type, _member) \ do { \ _type *__e = _entry; \ if (__e == NULL || _list == NULL) break; \ if ((_list) == __e) { \ _list = __e->_member; \ } else { \ _type *__prev = _list; \ while (__prev->_member && __prev->_member != __e) \ __prev = nt_list_next(__prev, _member); \ if (__prev->_member) \ __prev->_member = __e->_member; \ } \ nt_list_init(__e, _member); \ } while(0) /** * DO NOT USE THIS. * This is a remainder of the xfree86 DDX attempt of having a set of generic * list functions. Unfortunately, the xf86OptionRec uses it and we can't * easily get rid of it. Do not use for new code. */ typedef struct generic_list_rec { void *next; } GenericListRec, *GenericListPtr, *glp; #endif xorg-server-1.17.1/include/cursorstr.h0000664000175100017510000000725012456571574014677 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef CURSORSTRUCT_H #define CURSORSTRUCT_H #include "cursor.h" #include "privates.h" /* * device-independent cursor storage */ /* * source and mask point directly to the bits, which are in the server-defined * bitmap format. */ typedef struct _CursorBits { unsigned char *source; /* points to bits */ unsigned char *mask; /* points to bits */ Bool emptyMask; /* all zeros mask */ unsigned short width, height, xhot, yhot; /* metrics */ int refcnt; /* can be shared */ PrivateRec *devPrivates; /* set by pScr->RealizeCursor */ #ifdef ARGB_CURSOR CARD32 *argb; /* full-color alpha blended */ #endif } CursorBits, *CursorBitsPtr; #define CURSOR_BITS_SIZE (sizeof(CursorBits) + dixPrivatesSize(PRIVATE_CURSOR_BITS)) typedef struct _Cursor { CursorBitsPtr bits; unsigned short foreRed, foreGreen, foreBlue; /* device-independent color */ unsigned short backRed, backGreen, backBlue; /* device-independent color */ int refcnt; PrivateRec *devPrivates; /* set by pScr->RealizeCursor */ XID id; CARD32 serialNumber; Atom name; } CursorRec; #define CURSOR_REC_SIZE (sizeof(CursorRec) + dixPrivatesSize(PRIVATE_CURSOR)) typedef struct _CursorMetric { unsigned short width, height, xhot, yhot; } CursorMetricRec; typedef struct { int x, y; ScreenPtr pScreen; } HotSpot; #endif /* CURSORSTRUCT_H */ xorg-server-1.17.1/include/dixgrabs.h0000664000175100017510000000525612362011424014413 00000000000000/************************************************************ Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. ********************************************************/ #ifndef DIXGRABS_H #define DIXGRABS_H 1 struct _GrabParameters; extern void PrintDeviceGrabInfo(DeviceIntPtr dev); extern void UngrabAllDevices(Bool kill_client); extern GrabPtr AllocGrab(const GrabPtr src); extern void FreeGrab(GrabPtr grab); extern Bool CopyGrab(GrabPtr dst, const GrabPtr src); extern GrabPtr CreateGrab(int /* client */ , DeviceIntPtr /* device */ , DeviceIntPtr /* modDevice */ , WindowPtr /* window */ , enum InputLevel /* grabtype */ , GrabMask * /* mask */ , struct _GrabParameters * /* param */ , int /* type */ , KeyCode /* keybut */ , WindowPtr /* confineTo */ , CursorPtr /* cursor */ ); extern _X_EXPORT int DeletePassiveGrab(void *value, XID id); extern _X_EXPORT Bool GrabMatchesSecond(GrabPtr /* pFirstGrab */ , GrabPtr /* pSecondGrab */ , Bool /*ignoreDevice */ ); extern _X_EXPORT int AddPassiveGrabToList(ClientPtr /* client */ , GrabPtr /* pGrab */ ); extern _X_EXPORT Bool DeletePassiveGrabFromList(GrabPtr /* pMinuendGrab */ ); extern Bool GrabIsPointerGrab(GrabPtr grab); extern Bool GrabIsKeyboardGrab(GrabPtr grab); #endif /* DIXGRABS_H */ xorg-server-1.17.1/include/systemd-logind.h0000664000175100017510000000345712362011424015553 00000000000000/* * Copyright © 2013 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. * * Author: Hans de Goede */ #ifndef SYSTEMD_LOGIND_H #define SYSTEMD_LOGIND_H #ifdef SYSTEMD_LOGIND int systemd_logind_init(void); void systemd_logind_fini(void); int systemd_logind_take_fd(int major, int minor, const char *path, Bool *paus); void systemd_logind_release_fd(int major, int minor, int fd); int systemd_logind_controls_session(void); void systemd_logind_vtenter(void); #else #define systemd_logind_init() #define systemd_logind_fini() #define systemd_logind_take_fd(major, minor, path, paus) -1 #define systemd_logind_release_fd(major, minor, fd) close(fd) #define systemd_logind_controls_session() 0 #define systemd_logind_vtenter() #endif #endif xorg-server-1.17.1/include/screenint.h0000664000175100017510000000737012456571574014626 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ #ifndef SCREENINT_H #define SCREENINT_H #include "misc.h" typedef struct _PixmapFormat *PixmapFormatPtr; typedef struct _Visual *VisualPtr; typedef struct _Depth *DepthPtr; typedef struct _Screen *ScreenPtr; extern _X_EXPORT int AddScreen(Bool (* /*pfnInit */ )( ScreenPtr /*pScreen */ , int /*argc */ , char ** /*argv */ ), 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 */ xorg-server-1.17.1/test/0000775000175100017510000000000012466505446012064 500000000000000xorg-server-1.17.1/test/Makefile.am0000664000175100017510000000774512456571574014061 00000000000000if ENABLE_UNIT_TESTS SUBDIRS= . noinst_PROGRAMS = list string 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 += xi1 xi2 noinst_PROGRAMS += xkb input xtest misc fixes xfree86 os signal-logging touch if RES noinst_PROGRAMS += hashtabletest endif endif check_LTLIBRARIES = libxservertest.la TESTS=$(noinst_PROGRAMS) TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = $(XORG_INCS) -I$(top_srcdir)/miext/cw if XORG AM_CPPFLAGS += -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/dri \ -I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3 endif TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) if SPECIAL_DTRACE_OBJECTS TEST_LDADD += $(OS_LIB) $(DIX_LIB) endif xkb_LDADD=$(TEST_LDADD) input_LDADD=$(TEST_LDADD) xtest_LDADD=$(TEST_LDADD) 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) os_LDADD=$(TEST_LDADD) libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG nodist_libxservertest_la_SOURCES = sdksyms.c libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/loader/libloader.la \ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ $(top_builddir)/hw/xfree86/common/libcommon.la \ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ $(top_builddir)/hw/xfree86/ddc/libddc.la \ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @XORG_LIBS@ BUILT_SOURCES = sdksyms.c CLEANFILES = sdksyms.c sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c $(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c 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 if DRI3 libxservertest_la_LIBADD += $(top_builddir)/dri3/libdri3.la endif else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ $(top_srcdir)/mi/miinitext.c libxservertest_la_LIBADD += \ $(top_builddir)/damageext/libdamageext.la \ $(top_builddir)/fb/libfb.la \ $(top_builddir)/fb/libwfb.la \ $(top_builddir)/miext/damage/libdamage.la \ $(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/randr/librandr.la \ $(top_builddir)/render/librender.la \ $(top_builddir)/Xext/libXext.la \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXi.la \ $(top_builddir)/Xi/libXistubs.la \ $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/xkb/libxkb.la \ $(top_builddir)/xkb/libxkbstubs.la if COMPOSITE libxservertest_la_LIBADD += \ $(top_builddir)/composite/libcomposite.la endif if DBE libxservertest_la_LIBADD += \ $(top_builddir)/dbe/libdbe.la endif if GLX libxservertest_la_LIBADD += \ $(top_builddir)/glx/libglx.la endif if RECORD libxservertest_la_LIBADD += \ $(top_builddir)/record/librecord.la endif if DRI3 libxservertest_la_LIBADD += \ $(top_builddir)/dri3/libdri3.la endif if XQUARTZ libxservertest_la_LIBADD += \ $(top_builddir)/miext/rootless/librootless.la TEST_LDADD += -lXplugin endif if XWIN_MULTIWINDOWEXTWM libxservertest_la_LIBADD += \ $(top_builddir)/miext/rootless/librootless.la endif endif libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) endif EXTRA_DIST = ddxstubs.c xorg-server-1.17.1/test/README0000664000175100017510000000254512160102336012650 00000000000000 X server test suite This suite contains a set of tests to verify the behaviour of functions used internally to the server. This test suite is based on glib's testing framework [1]. = How it works = Through some automake abuse, we link the test programs with the same static libraries as the Xorg binary. The test suites can then call various functions and verify their behaviour - without the need to start the server or connect clients. This testing only works for functions that do not rely on a particular state of the X server. Unless the test suite replicates the expected state, which may be difficult. = How to run the tests = Run "make check" the test directory. This will compile the tests and execute them in the order specified in the TESTS variable in test/Makefile.am. Each set of tests related to a subsystem are available as a binary that can be executed directly. For example, run "xkb" to perform some xkb-related tests. == Adding a new test == When adding a new test, ensure that you add a short description of what the test does and what the expected outcome is. If the test reproduces a particular bug, using g_test_bug(). == Misc == The programs "gtester" and "gtester-report" may be used to generate XML/HTML log files of tests succeeded and failed. --------- [1] http://library.gnome.org/devel/glib/stable/glib-Testing.html xorg-server-1.17.1/test/os.c0000664000175100017510000001037112323563340012560 00000000000000/** * 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 = OsSignal(SIGIO, sighandler); expect_signal = 1; assert(raise(SIGIO) == 0); assert(OsSignal(SIGIO, old_handler) == sighandler); #endif } int main(int argc, char **argv) { block_sigio_test(); block_sigio_test_nested(); return 0; } xorg-server-1.17.1/test/input.c0000664000175100017510000015170712362011424013301 00000000000000/** * Copyright © 2009 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 #include "misc.h" #include "resource.h" #include #include #include #include "windowstr.h" #include "inputstr.h" #include "eventconvert.h" #include "exevents.h" #include "exglobals.h" #include "dixgrabs.h" #include "eventstr.h" #include "inpututils.h" #include "mi.h" #include "assert.h" /** * Init a device with axes. * Verify values set on the device. * * Result: All axes set to default values (usually 0). */ static void dix_init_valuators(void) { DeviceIntRec dev; ValuatorClassPtr val; AxisInfoPtr axis; const int num_axes = 2; int i; Atom atoms[MAX_VALUATORS] = { 0 }; memset(&dev, 0, sizeof(DeviceIntRec)); dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */ assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE); assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute)); val = dev.valuator; assert(val); assert(val->numAxes == num_axes); assert(val->numMotionEvents == 0); assert(val->axisVal); for (i = 0; i < num_axes; i++) { assert(val->axisVal[i] == 0); assert(val->axes->min_value == NO_AXIS_LIMITS); assert(val->axes->max_value == NO_AXIS_LIMITS); assert(val->axes->mode == Absolute); } assert(dev.last.numValuators == num_axes); /* invalid increment */ assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_VERTICAL, 0.0, SCROLL_FLAG_NONE) == FALSE); /* invalid type */ assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_VERTICAL - 1, 1.0, SCROLL_FLAG_NONE) == FALSE); assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_HORIZONTAL + 1, 1.0, SCROLL_FLAG_NONE) == FALSE); /* invalid axisnum */ assert(SetScrollValuator (&dev, 2, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE) == FALSE); /* valid */ assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_VERTICAL, 3.0, SCROLL_FLAG_NONE) == TRUE); axis = &dev.valuator->axes[0]; assert(axis->scroll.increment == 3.0); assert(axis->scroll.type == SCROLL_TYPE_VERTICAL); assert(axis->scroll.flags == 0); /* valid */ assert(SetScrollValuator (&dev, 1, SCROLL_TYPE_HORIZONTAL, 2.0, SCROLL_FLAG_NONE) == TRUE); axis = &dev.valuator->axes[1]; assert(axis->scroll.increment == 2.0); assert(axis->scroll.type == SCROLL_TYPE_HORIZONTAL); assert(axis->scroll.flags == 0); /* can add another non-preffered axis */ assert(SetScrollValuator (&dev, 1, SCROLL_TYPE_VERTICAL, 5.0, SCROLL_FLAG_NONE) == TRUE); assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_HORIZONTAL, 5.0, SCROLL_FLAG_NONE) == TRUE); /* can overwrite with Preferred */ assert(SetScrollValuator (&dev, 1, SCROLL_TYPE_VERTICAL, 5.5, SCROLL_FLAG_PREFERRED) == TRUE); axis = &dev.valuator->axes[1]; assert(axis->scroll.increment == 5.5); assert(axis->scroll.type == SCROLL_TYPE_VERTICAL); assert(axis->scroll.flags == SCROLL_FLAG_PREFERRED); assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_HORIZONTAL, 8.8, SCROLL_FLAG_PREFERRED) == TRUE); axis = &dev.valuator->axes[0]; assert(axis->scroll.increment == 8.8); assert(axis->scroll.type == SCROLL_TYPE_HORIZONTAL); assert(axis->scroll.flags == SCROLL_FLAG_PREFERRED); /* can overwrite as none */ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_NONE, 5.0, SCROLL_FLAG_NONE) == TRUE); axis = &dev.valuator->axes[0]; assert(axis->scroll.type == SCROLL_TYPE_NONE); /* can overwrite axis with new settings */ assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_VERTICAL, 5.0, SCROLL_FLAG_NONE) == TRUE); axis = &dev.valuator->axes[0]; assert(axis->scroll.type == SCROLL_TYPE_VERTICAL); assert(axis->scroll.increment == 5.0); assert(axis->scroll.flags == SCROLL_FLAG_NONE); assert(SetScrollValuator (&dev, 0, SCROLL_TYPE_VERTICAL, 3.0, SCROLL_FLAG_NONE) == TRUE); assert(axis->scroll.type == SCROLL_TYPE_VERTICAL); assert(axis->scroll.increment == 3.0); assert(axis->scroll.flags == SCROLL_FLAG_NONE); } /* just check the known success cases, and that error cases set the client's * error value correctly. */ static void dix_check_grab_values(void) { ClientRec client; GrabParameters param; int rc; memset(&client, 0, sizeof(client)); param.grabtype = CORE; param.this_device_mode = GrabModeSync; param.other_devices_mode = GrabModeSync; param.modifiers = AnyModifier; param.ownerEvents = FALSE; rc = CheckGrabValues(&client, ¶m); assert(rc == Success); param.this_device_mode = GrabModeAsync; rc = CheckGrabValues(&client, ¶m); assert(rc == Success); param.this_device_mode = XIGrabModeTouch; rc = CheckGrabValues(&client, ¶m); assert(rc == Success); param.this_device_mode = XIGrabModeTouch + 1; rc = CheckGrabValues(&client, ¶m); assert(rc == BadValue); assert(client.errorValue == param.this_device_mode); assert(client.errorValue == XIGrabModeTouch + 1); param.this_device_mode = GrabModeSync; param.other_devices_mode = GrabModeAsync; rc = CheckGrabValues(&client, ¶m); param.this_device_mode = GrabModeSync; param.other_devices_mode = XIGrabModeTouch; rc = CheckGrabValues(&client, ¶m); assert(rc == Success); assert(rc == Success); param.other_devices_mode = XIGrabModeTouch + 1; rc = CheckGrabValues(&client, ¶m); assert(rc == BadValue); assert(client.errorValue == param.other_devices_mode); assert(client.errorValue == XIGrabModeTouch + 1); param.other_devices_mode = GrabModeSync; param.modifiers = 1 << 13; rc = CheckGrabValues(&client, ¶m); assert(rc == BadValue); assert(client.errorValue == param.modifiers); assert(client.errorValue == (1 << 13)); param.modifiers = AnyModifier; param.ownerEvents = TRUE; rc = CheckGrabValues(&client, ¶m); assert(rc == Success); param.ownerEvents = 3; rc = CheckGrabValues(&client, ¶m); assert(rc == BadValue); assert(client.errorValue == param.ownerEvents); assert(client.errorValue == 3); } /** * Convert various internal events to the matching core event and verify the * parameters. */ static void dix_event_to_core(int type) { DeviceEvent ev; xEvent *core; int time; int x, y; int rc; int state; int detail; int count; const int ROOT_WINDOW_ID = 0x100; /* EventToCore memsets the event to 0 */ #define test_event() \ assert(rc == Success); \ assert(core); \ assert(count == 1); \ assert(core->u.u.type == type); \ assert(core->u.u.detail == detail); \ assert(core->u.keyButtonPointer.time == time); \ assert(core->u.keyButtonPointer.rootX == x); \ assert(core->u.keyButtonPointer.rootY == y); \ assert(core->u.keyButtonPointer.state == state); \ assert(core->u.keyButtonPointer.eventX == 0); \ assert(core->u.keyButtonPointer.eventY == 0); \ assert(core->u.keyButtonPointer.root == ROOT_WINDOW_ID); \ assert(core->u.keyButtonPointer.event == 0); \ assert(core->u.keyButtonPointer.child == 0); \ assert(core->u.keyButtonPointer.sameScreen == FALSE); x = 0; y = 0; time = 12345; state = 0; detail = 0; ev.header = 0xFF; ev.length = sizeof(DeviceEvent); ev.time = time; ev.root_y = x; ev.root_x = y; SetBit(ev.valuators.mask, 0); SetBit(ev.valuators.mask, 1); ev.root = ROOT_WINDOW_ID; ev.corestate = state; ev.detail.key = detail; ev.type = type; ev.detail.key = 0; rc = EventToCore((InternalEvent *) &ev, &core, &count); test_event(); x = 1; y = 2; ev.root_x = x; ev.root_y = y; rc = EventToCore((InternalEvent *) &ev, &core, &count); test_event(); x = 0x7FFF; y = 0x7FFF; ev.root_x = x; ev.root_y = y; rc = EventToCore((InternalEvent *) &ev, &core, &count); test_event(); x = 0x8000; /* too high */ y = 0x8000; /* too high */ ev.root_x = x; ev.root_y = y; rc = EventToCore((InternalEvent *) &ev, &core, &count); assert(rc == Success); assert(core); assert(count == 1); assert(core->u.keyButtonPointer.rootX != x); assert(core->u.keyButtonPointer.rootY != y); x = 0x7FFF; y = 0x7FFF; ev.root_x = x; ev.root_y = y; time = 0; ev.time = time; rc = EventToCore((InternalEvent *) &ev, &core, &count); test_event(); detail = 1; ev.detail.key = detail; rc = EventToCore((InternalEvent *) &ev, &core, &count); test_event(); detail = 0xFF; /* highest value */ ev.detail.key = detail; rc = EventToCore((InternalEvent *) &ev, &core, &count); test_event(); detail = 0xFFF; /* too big */ ev.detail.key = detail; rc = EventToCore((InternalEvent *) &ev, &core, &count); assert(rc == BadMatch); detail = 0xFF; /* too big */ ev.detail.key = detail; state = 0xFFFF; /* highest value */ ev.corestate = state; rc = EventToCore((InternalEvent *) &ev, &core, &count); test_event(); state = 0x10000; /* too big */ ev.corestate = state; rc = EventToCore((InternalEvent *) &ev, &core, &count); assert(rc == Success); assert(core); assert(count == 1); assert(core->u.keyButtonPointer.state != state); assert(core->u.keyButtonPointer.state == (state & 0xFFFF)); #undef test_event } static void dix_event_to_core_fail(int evtype, int expected_rc) { DeviceEvent ev; xEvent *core; int rc; int count; ev.header = 0xFF; ev.length = sizeof(DeviceEvent); ev.type = evtype; rc = EventToCore((InternalEvent *) &ev, &core, &count); assert(rc == expected_rc); } static void dix_event_to_core_conversion(void) { dix_event_to_core_fail(0, BadImplementation); dix_event_to_core_fail(1, BadImplementation); dix_event_to_core_fail(ET_ProximityOut + 1, BadImplementation); dix_event_to_core_fail(ET_ProximityIn, BadMatch); dix_event_to_core_fail(ET_ProximityOut, BadMatch); dix_event_to_core(ET_KeyPress); dix_event_to_core(ET_KeyRelease); dix_event_to_core(ET_ButtonPress); dix_event_to_core(ET_ButtonRelease); dix_event_to_core(ET_Motion); } static void _dix_test_xi_convert(DeviceEvent *ev, int expected_rc, int expected_count) { xEvent *xi; int count = 0; int rc; rc = EventToXI((InternalEvent *) ev, &xi, &count); assert(rc == expected_rc); assert(count >= expected_count); if (count > 0) { deviceKeyButtonPointer *kbp = (deviceKeyButtonPointer *) xi; assert(kbp->type == IEventBase + ev->type); assert(kbp->detail == ev->detail.key); assert(kbp->time == ev->time); assert((kbp->deviceid & ~MORE_EVENTS) == ev->deviceid); assert(kbp->root_x == ev->root_x); assert(kbp->root_y == ev->root_y); assert(kbp->state == ev->corestate); assert(kbp->event_x == 0); assert(kbp->event_y == 0); assert(kbp->root == ev->root); assert(kbp->event == 0); assert(kbp->child == 0); assert(kbp->same_screen == FALSE); while (--count > 0) { deviceValuator *v = (deviceValuator *) &xi[count]; assert(v->type == DeviceValuator); assert(v->num_valuators <= 6); } free(xi); } } /** * This tests for internal event → XI1 event conversion * - all conversions should generate the right XI event type * - right number of events generated * - extra events are valuators */ static void dix_event_to_xi1_conversion(void) { DeviceEvent ev = { 0 }; int time; int x, y; int state; int detail; const int ROOT_WINDOW_ID = 0x100; int deviceid; IEventBase = 80; DeviceValuator = IEventBase - 1; DeviceKeyPress = IEventBase + ET_KeyPress; DeviceKeyRelease = IEventBase + ET_KeyRelease; DeviceButtonPress = IEventBase + ET_ButtonPress; DeviceButtonRelease = IEventBase + ET_ButtonRelease; DeviceMotionNotify = IEventBase + ET_Motion; DeviceFocusIn = IEventBase + ET_FocusIn; DeviceFocusOut = IEventBase + ET_FocusOut; ProximityIn = IEventBase + ET_ProximityIn; ProximityOut = IEventBase + ET_ProximityOut; /* EventToXI callocs */ x = 0; y = 0; time = 12345; state = 0; detail = 0; deviceid = 4; ev.header = 0xFF; ev.header = 0xFF; ev.length = sizeof(DeviceEvent); ev.time = time; ev.root_y = x; ev.root_x = y; SetBit(ev.valuators.mask, 0); SetBit(ev.valuators.mask, 1); ev.root = ROOT_WINDOW_ID; ev.corestate = state; ev.detail.key = detail; ev.deviceid = deviceid; /* test all types for bad match */ ev.type = ET_KeyPress; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_KeyRelease; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_ButtonPress; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_ButtonRelease; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_Motion; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_ProximityIn; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_ProximityOut; _dix_test_xi_convert(&ev, Success, 1); /* No axes */ ClearBit(ev.valuators.mask, 0); ClearBit(ev.valuators.mask, 1); ev.type = ET_KeyPress; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_KeyRelease; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_ButtonPress; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_ButtonRelease; _dix_test_xi_convert(&ev, Success, 1); ev.type = ET_Motion; _dix_test_xi_convert(&ev, BadMatch, 0); ev.type = ET_ProximityIn; _dix_test_xi_convert(&ev, BadMatch, 0); ev.type = ET_ProximityOut; _dix_test_xi_convert(&ev, BadMatch, 0); /* more than 6 axes → 2 valuator events */ SetBit(ev.valuators.mask, 0); SetBit(ev.valuators.mask, 1); SetBit(ev.valuators.mask, 2); SetBit(ev.valuators.mask, 3); SetBit(ev.valuators.mask, 4); SetBit(ev.valuators.mask, 5); SetBit(ev.valuators.mask, 6); ev.type = ET_KeyPress; _dix_test_xi_convert(&ev, Success, 2); ev.type = ET_KeyRelease; _dix_test_xi_convert(&ev, Success, 2); ev.type = ET_ButtonPress; _dix_test_xi_convert(&ev, Success, 2); ev.type = ET_ButtonRelease; _dix_test_xi_convert(&ev, Success, 2); ev.type = ET_Motion; _dix_test_xi_convert(&ev, Success, 2); ev.type = ET_ProximityIn; _dix_test_xi_convert(&ev, Success, 2); ev.type = ET_ProximityOut; _dix_test_xi_convert(&ev, Success, 2); /* keycode too high */ ev.type = ET_KeyPress; ev.detail.key = 256; _dix_test_xi_convert(&ev, Success, 0); /* deviceid too high */ ev.type = ET_KeyPress; ev.detail.key = 18; ev.deviceid = 128; _dix_test_xi_convert(&ev, Success, 0); } static void xi2_struct_sizes(void) { #define compare(req) \ assert(sizeof(req) == sz_##req); compare(xXIQueryVersionReq); compare(xXIWarpPointerReq); compare(xXIChangeCursorReq); compare(xXIChangeHierarchyReq); compare(xXISetClientPointerReq); compare(xXIGetClientPointerReq); compare(xXISelectEventsReq); compare(xXIQueryVersionReq); compare(xXIQueryDeviceReq); compare(xXISetFocusReq); compare(xXIGetFocusReq); compare(xXIGrabDeviceReq); compare(xXIUngrabDeviceReq); compare(xXIAllowEventsReq); compare(xXIPassiveGrabDeviceReq); compare(xXIPassiveUngrabDeviceReq); compare(xXIListPropertiesReq); compare(xXIChangePropertyReq); compare(xXIDeletePropertyReq); compare(xXIGetPropertyReq); compare(xXIGetSelectedEventsReq); #undef compare } static void dix_grab_matching(void) { DeviceIntRec xi_all_devices, xi_all_master_devices, dev1, dev2; GrabRec a, b; BOOL rc; memset(&a, 0, sizeof(a)); memset(&b, 0, sizeof(b)); /* different grabtypes must fail */ a.grabtype = CORE; b.grabtype = XI2; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = XI; b.grabtype = XI2; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = XI; b.grabtype = CORE; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); /* XI2 grabs for different devices must fail, regardless of ignoreDevice * XI2 grabs for master devices must fail against a slave */ memset(&xi_all_devices, 0, sizeof(DeviceIntRec)); memset(&xi_all_master_devices, 0, sizeof(DeviceIntRec)); memset(&dev1, 0, sizeof(DeviceIntRec)); memset(&dev2, 0, sizeof(DeviceIntRec)); xi_all_devices.id = XIAllDevices; xi_all_master_devices.id = XIAllMasterDevices; dev1.id = 10; dev1.type = SLAVE; dev2.id = 11; dev2.type = SLAVE; inputInfo.all_devices = &xi_all_devices; inputInfo.all_master_devices = &xi_all_master_devices; a.grabtype = XI2; b.grabtype = XI2; a.device = &dev1; b.device = &dev2; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); a.device = &dev2; b.device = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); assert(rc == FALSE); a.device = inputInfo.all_master_devices; b.device = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); assert(rc == FALSE); a.device = &dev1; b.device = inputInfo.all_master_devices; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); assert(rc == FALSE); /* ignoreDevice FALSE must fail for different devices for CORE and XI */ a.grabtype = XI; b.grabtype = XI; a.device = &dev1; b.device = &dev2; a.modifierDevice = &dev1; b.modifierDevice = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; a.device = &dev1; b.device = &dev2; a.modifierDevice = &dev1; b.modifierDevice = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); /* ignoreDevice FALSE must fail for different modifier devices for CORE * and XI */ a.grabtype = XI; b.grabtype = XI; a.device = &dev1; b.device = &dev1; a.modifierDevice = &dev1; b.modifierDevice = &dev2; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; a.device = &dev1; b.device = &dev1; a.modifierDevice = &dev1; b.modifierDevice = &dev2; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); /* different event type must fail */ a.grabtype = XI2; b.grabtype = XI2; a.device = &dev1; b.device = &dev1; a.modifierDevice = &dev1; b.modifierDevice = &dev1; a.type = XI_KeyPress; b.type = XI_KeyRelease; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; a.device = &dev1; b.device = &dev1; a.modifierDevice = &dev1; b.modifierDevice = &dev1; a.type = XI_KeyPress; b.type = XI_KeyRelease; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); assert(rc == FALSE); a.grabtype = XI; b.grabtype = XI; a.device = &dev1; b.device = &dev1; a.modifierDevice = &dev1; b.modifierDevice = &dev1; a.type = XI_KeyPress; b.type = XI_KeyRelease; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); assert(rc == FALSE); /* different modifiers must fail */ a.grabtype = XI2; b.grabtype = XI2; a.device = &dev1; b.device = &dev1; a.modifierDevice = &dev1; b.modifierDevice = &dev1; a.type = XI_KeyPress; b.type = XI_KeyPress; a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 2; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = XI; b.grabtype = XI; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); /* AnyModifier must fail for XI2 */ a.grabtype = XI2; b.grabtype = XI2; a.modifiersDetail.exact = AnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); /* XIAnyModifier must fail for CORE and XI */ a.grabtype = XI; b.grabtype = XI; a.modifiersDetail.exact = XIAnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; a.modifiersDetail.exact = XIAnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); /* different detail must fail */ a.grabtype = XI2; b.grabtype = XI2; a.detail.exact = 1; b.detail.exact = 2; a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = XI; b.grabtype = XI; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); /* detail of AnyModifier must fail */ a.grabtype = XI2; b.grabtype = XI2; a.detail.exact = AnyModifier; b.detail.exact = 1; a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = XI; b.grabtype = XI; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); /* detail of XIAnyModifier must fail */ a.grabtype = XI2; b.grabtype = XI2; a.detail.exact = XIAnyModifier; b.detail.exact = 1; a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = CORE; b.grabtype = CORE; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); a.grabtype = XI; b.grabtype = XI; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == FALSE); /* XIAnyModifier or AnyModifer must succeed */ a.grabtype = XI2; b.grabtype = XI2; a.detail.exact = 1; b.detail.exact = 1; a.modifiersDetail.exact = XIAnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == TRUE); a.grabtype = CORE; b.grabtype = CORE; a.detail.exact = 1; b.detail.exact = 1; a.modifiersDetail.exact = AnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == TRUE); a.grabtype = XI; b.grabtype = XI; a.detail.exact = 1; b.detail.exact = 1; a.modifiersDetail.exact = AnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == TRUE); /* AnyKey or XIAnyKeycode must succeed */ a.grabtype = XI2; b.grabtype = XI2; a.detail.exact = XIAnyKeycode; b.detail.exact = 1; a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == TRUE); a.grabtype = CORE; b.grabtype = CORE; a.detail.exact = AnyKey; b.detail.exact = 1; a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == TRUE); a.grabtype = XI; b.grabtype = XI; a.detail.exact = AnyKey; b.detail.exact = 1; a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); assert(rc == TRUE); } static void test_bits_to_byte(int i) { int expected_bytes; expected_bytes = (i + 7) / 8; assert(bits_to_bytes(i) >= i / 8); assert((bits_to_bytes(i) * 8) - i <= 7); assert(expected_bytes == bits_to_bytes(i)); } static void test_bytes_to_int32(int i) { int expected_4byte; expected_4byte = (i + 3) / 4; assert(bytes_to_int32(i) <= i); assert((bytes_to_int32(i) * 4) - i <= 3); assert(expected_4byte == bytes_to_int32(i)); } static void test_pad_to_int32(int i) { int expected_bytes; expected_bytes = ((i + 3) / 4) * 4; assert(pad_to_int32(i) >= i); assert(pad_to_int32(i) - i <= 3); 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) { printf("Testing bits_to_bytes()\n"); /* the macros don't provide overflow protection */ test_bits_to_byte(0); test_bits_to_byte(1); test_bits_to_byte(2); test_bits_to_byte(7); test_bits_to_byte(8); test_bits_to_byte(0xFF); test_bits_to_byte(0x100); test_bits_to_byte(INT_MAX - 9); test_bits_to_byte(INT_MAX - 8); printf("Testing bytes_to_int32()\n"); test_bytes_to_int32(0); test_bytes_to_int32(1); test_bytes_to_int32(2); test_bytes_to_int32(7); test_bytes_to_int32(8); test_bytes_to_int32(0xFF); test_bytes_to_int32(0x100); test_bytes_to_int32(0xFFFF); test_bytes_to_int32(0x10000); test_bytes_to_int32(0xFFFFFF); test_bytes_to_int32(0x1000000); test_bytes_to_int32(INT_MAX - 4); test_bytes_to_int32(INT_MAX - 3); printf("Testing pad_to_int32()\n"); 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); test_pad_to_int32(0x100); test_pad_to_int32(0xFFFF); test_pad_to_int32(0x10000); test_pad_to_int32(0xFFFFFF); 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 xi_unregister_handlers(void) { DeviceIntRec dev; int handler; memset(&dev, 0, sizeof(dev)); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 1); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 2); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 3); printf("Unlinking from front.\n"); XIUnregisterPropertyHandler(&dev, 4); /* NOOP */ assert(dev.properties.handlers->id == 3); XIUnregisterPropertyHandler(&dev, 3); assert(dev.properties.handlers->id == 2); XIUnregisterPropertyHandler(&dev, 2); assert(dev.properties.handlers->id == 1); XIUnregisterPropertyHandler(&dev, 1); assert(dev.properties.handlers == NULL); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 4); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 5); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 6); XIUnregisterPropertyHandler(&dev, 3); /* NOOP */ assert(dev.properties.handlers->next->next->next == NULL); XIUnregisterPropertyHandler(&dev, 4); assert(dev.properties.handlers->next->next == NULL); XIUnregisterPropertyHandler(&dev, 5); assert(dev.properties.handlers->next == NULL); XIUnregisterPropertyHandler(&dev, 6); assert(dev.properties.handlers == NULL); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 7); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 8); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); assert(handler == 9); XIDeleteAllDeviceProperties(&dev); assert(dev.properties.handlers == NULL); XIUnregisterPropertyHandler(&dev, 7); /* NOOP */ } static void cmp_attr_fields(InputAttributes * attr1, InputAttributes * attr2) { char **tags1, **tags2; assert(attr1 && attr2); assert(attr1 != attr2); assert(attr1->flags == attr2->flags); if (attr1->product != NULL) { assert(attr1->product != attr2->product); assert(strcmp(attr1->product, attr2->product) == 0); } else assert(attr2->product == NULL); if (attr1->vendor != NULL) { assert(attr1->vendor != attr2->vendor); assert(strcmp(attr1->vendor, attr2->vendor) == 0); } else assert(attr2->vendor == NULL); if (attr1->device != NULL) { assert(attr1->device != attr2->device); assert(strcmp(attr1->device, attr2->device) == 0); } else assert(attr2->device == NULL); if (attr1->pnp_id != NULL) { assert(attr1->pnp_id != attr2->pnp_id); assert(strcmp(attr1->pnp_id, attr2->pnp_id) == 0); } else assert(attr2->pnp_id == NULL); if (attr1->usb_id != NULL) { assert(attr1->usb_id != attr2->usb_id); assert(strcmp(attr1->usb_id, attr2->usb_id) == 0); } else assert(attr2->usb_id == NULL); tags1 = attr1->tags; tags2 = attr2->tags; /* if we don't have any tags, skip the tag checking bits */ if (!tags1) { assert(!tags2); return; } /* Don't lug around empty arrays */ assert(*tags1); assert(*tags2); /* check for identical content, but duplicated */ while (*tags1) { assert(*tags1 != *tags2); assert(strcmp(*tags1, *tags2) == 0); tags1++; tags2++; } /* ensure tags1 and tags2 have the same no of elements */ assert(!*tags2); /* check for not sharing memory */ tags1 = attr1->tags; while (*tags1) { tags2 = attr2->tags; while (*tags2) assert(*tags1 != *tags2++); tags1++; } } static void dix_input_attributes(void) { InputAttributes *orig; InputAttributes *new; new = DuplicateInputAttributes(NULL); assert(!new); orig = calloc(1, sizeof(InputAttributes)); assert(orig); new = DuplicateInputAttributes(orig); assert(memcmp(orig, new, sizeof(InputAttributes)) == 0); orig->product = xnfstrdup("product name"); new = DuplicateInputAttributes(orig); cmp_attr_fields(orig, new); FreeInputAttributes(new); orig->vendor = xnfstrdup("vendor name"); new = DuplicateInputAttributes(orig); cmp_attr_fields(orig, new); FreeInputAttributes(new); orig->device = xnfstrdup("device path"); new = DuplicateInputAttributes(orig); cmp_attr_fields(orig, new); FreeInputAttributes(new); orig->pnp_id = xnfstrdup("PnPID"); new = DuplicateInputAttributes(orig); cmp_attr_fields(orig, new); FreeInputAttributes(new); orig->usb_id = xnfstrdup("USBID"); new = DuplicateInputAttributes(orig); cmp_attr_fields(orig, new); FreeInputAttributes(new); orig->flags = 0xF0; new = DuplicateInputAttributes(orig); cmp_attr_fields(orig, new); FreeInputAttributes(new); orig->tags = xstrtokenize("tag1 tag2 tag3", " "); new = DuplicateInputAttributes(orig); cmp_attr_fields(orig, new); FreeInputAttributes(new); FreeInputAttributes(orig); } static void dix_input_valuator_masks(void) { ValuatorMask *mask = NULL, *copy; int nvaluators = MAX_VALUATORS; double valuators[nvaluators]; int val_ranged[nvaluators]; int i; int first_val, num_vals; for (i = 0; i < nvaluators; i++) { valuators[i] = i + 0.5; val_ranged[i] = i; } mask = valuator_mask_new(nvaluators); assert(mask != NULL); assert(valuator_mask_size(mask) == 0); assert(valuator_mask_num_valuators(mask) == 0); for (i = 0; i < nvaluators; i++) { assert(!valuator_mask_isset(mask, i)); valuator_mask_set_double(mask, i, valuators[i]); assert(valuator_mask_isset(mask, i)); assert(valuator_mask_get(mask, i) == trunc(valuators[i])); assert(valuator_mask_get_double(mask, i) == valuators[i]); assert(valuator_mask_size(mask) == i + 1); assert(valuator_mask_num_valuators(mask) == i + 1); } for (i = 0; i < nvaluators; i++) { assert(valuator_mask_isset(mask, i)); valuator_mask_unset(mask, i); /* we're removing valuators from the front, so size should stay the * same until the last bit is removed */ if (i < nvaluators - 1) assert(valuator_mask_size(mask) == nvaluators); assert(!valuator_mask_isset(mask, i)); } assert(valuator_mask_size(mask) == 0); valuator_mask_zero(mask); assert(valuator_mask_size(mask) == 0); assert(valuator_mask_num_valuators(mask) == 0); for (i = 0; i < nvaluators; i++) assert(!valuator_mask_isset(mask, i)); first_val = 5; num_vals = 6; valuator_mask_set_range(mask, first_val, num_vals, val_ranged); assert(valuator_mask_size(mask) == first_val + num_vals); assert(valuator_mask_num_valuators(mask) == num_vals); for (i = 0; i < nvaluators; i++) { double val; if (i < first_val || i >= first_val + num_vals) { assert(!valuator_mask_isset(mask, i)); assert(!valuator_mask_fetch_double(mask, i, &val)); } else { assert(valuator_mask_isset(mask, i)); assert(valuator_mask_get(mask, i) == val_ranged[i - first_val]); assert(valuator_mask_get_double(mask, i) == val_ranged[i - first_val]); assert(valuator_mask_fetch_double(mask, i, &val)); assert(val_ranged[i - first_val] == val); } } copy = valuator_mask_new(nvaluators); valuator_mask_copy(copy, mask); assert(mask != copy); assert(valuator_mask_size(mask) == valuator_mask_size(copy)); assert(valuator_mask_num_valuators(mask) == valuator_mask_num_valuators(copy)); for (i = 0; i < nvaluators; i++) { double a, b; assert(valuator_mask_isset(mask, i) == valuator_mask_isset(copy, i)); if (!valuator_mask_isset(mask, i)) continue; assert(valuator_mask_get(mask, i) == valuator_mask_get(copy, i)); assert(valuator_mask_get_double(mask, i) == valuator_mask_get_double(copy, i)); assert(valuator_mask_fetch_double(mask, i, &a)); assert(valuator_mask_fetch_double(copy, i, &b)); assert(a == b); } valuator_mask_free(&mask); assert(mask == NULL); } static void dix_valuator_mode(void) { DeviceIntRec dev; const int num_axes = MAX_VALUATORS; int i; Atom atoms[MAX_VALUATORS] = { 0 }; memset(&dev, 0, sizeof(DeviceIntRec)); dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */ assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE); assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute)); for (i = 0; i < num_axes; i++) { assert(valuator_get_mode(&dev, i) == Absolute); valuator_set_mode(&dev, i, Relative); assert(dev.valuator->axes[i].mode == Relative); assert(valuator_get_mode(&dev, i) == Relative); } valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Absolute); for (i = 0; i < num_axes; i++) assert(valuator_get_mode(&dev, i) == Absolute); valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Relative); for (i = 0; i < num_axes; i++) assert(valuator_get_mode(&dev, i) == Relative); } static void include_bit_test_macros(void) { uint8_t mask[9] = { 0 }; int i; for (i = 0; i < sizeof(mask) / sizeof(mask[0]); i++) { assert(BitIsOn(mask, i) == 0); SetBit(mask, i); assert(BitIsOn(mask, i) == 1); assert(! !(mask[i / 8] & (1 << (i % 8)))); assert(CountBits(mask, sizeof(mask)) == 1); ClearBit(mask, i); assert(BitIsOn(mask, i) == 0); } } /** * Ensure that val->axisVal and val->axes are aligned on doubles. */ static void dix_valuator_alloc(void) { ValuatorClassPtr v = NULL; int num_axes = 0; while (num_axes < 5) { v = AllocValuatorClass(v, num_axes); assert(v); assert(v->numAxes == num_axes); #if !defined(__i386__) && !defined(__m68k__) && !defined(__sh__) /* must be double-aligned on 64 bit */ assert(offsetof(struct _ValuatorClassRec, axisVal) % sizeof(double) == 0); assert(offsetof(struct _ValuatorClassRec, axes) % sizeof(double) == 0); #endif num_axes++; } free(v); } static void dix_get_master(void) { DeviceIntRec vcp, vck; DeviceIntRec ptr, kbd; DeviceIntRec floating; SpriteInfoRec vcp_sprite, vck_sprite; SpriteInfoRec ptr_sprite, kbd_sprite; SpriteInfoRec floating_sprite; memset(&vcp, 0, sizeof(vcp)); memset(&vck, 0, sizeof(vck)); memset(&ptr, 0, sizeof(ptr)); memset(&kbd, 0, sizeof(kbd)); memset(&floating, 0, sizeof(floating)); memset(&vcp_sprite, 0, sizeof(vcp_sprite)); memset(&vck_sprite, 0, sizeof(vck_sprite)); memset(&ptr_sprite, 0, sizeof(ptr_sprite)); memset(&kbd_sprite, 0, sizeof(kbd_sprite)); memset(&floating_sprite, 0, sizeof(floating_sprite)); vcp.type = MASTER_POINTER; vck.type = MASTER_KEYBOARD; ptr.type = SLAVE; kbd.type = SLAVE; floating.type = SLAVE; vcp.spriteInfo = &vcp_sprite; vck.spriteInfo = &vck_sprite; ptr.spriteInfo = &ptr_sprite; kbd.spriteInfo = &kbd_sprite; floating.spriteInfo = &floating_sprite; vcp_sprite.paired = &vck; vck_sprite.paired = &vcp; ptr_sprite.paired = &vcp; kbd_sprite.paired = &vck; floating_sprite.paired = &floating; vcp_sprite.spriteOwner = TRUE; floating_sprite.spriteOwner = TRUE; ptr.master = &vcp; kbd.master = &vck; assert(GetPairedDevice(&vcp) == &vck); assert(GetPairedDevice(&vck) == &vcp); assert(GetMaster(&ptr, MASTER_POINTER) == &vcp); assert(GetMaster(&ptr, MASTER_KEYBOARD) == &vck); assert(GetMaster(&kbd, MASTER_POINTER) == &vcp); assert(GetMaster(&kbd, MASTER_KEYBOARD) == &vck); assert(GetMaster(&ptr, MASTER_ATTACHED) == &vcp); assert(GetMaster(&kbd, MASTER_ATTACHED) == &vck); assert(GetPairedDevice(&floating) == &floating); assert(GetMaster(&floating, MASTER_POINTER) == NULL); assert(GetMaster(&floating, MASTER_KEYBOARD) == NULL); assert(GetMaster(&floating, MASTER_ATTACHED) == NULL); assert(GetMaster(&vcp, POINTER_OR_FLOAT) == &vcp); assert(GetMaster(&vck, POINTER_OR_FLOAT) == &vcp); assert(GetMaster(&ptr, POINTER_OR_FLOAT) == &vcp); assert(GetMaster(&kbd, POINTER_OR_FLOAT) == &vcp); assert(GetMaster(&vcp, KEYBOARD_OR_FLOAT) == &vck); assert(GetMaster(&vck, KEYBOARD_OR_FLOAT) == &vck); assert(GetMaster(&ptr, KEYBOARD_OR_FLOAT) == &vck); assert(GetMaster(&kbd, KEYBOARD_OR_FLOAT) == &vck); assert(GetMaster(&floating, KEYBOARD_OR_FLOAT) == &floating); assert(GetMaster(&floating, POINTER_OR_FLOAT) == &floating); } static void input_option_test(void) { InputOption *list = NULL; InputOption *opt; const char *val; printf("Testing input_option list interface\n"); list = input_option_new(list, "key", "value"); assert(list); opt = input_option_find(list, "key"); val = input_option_get_value(opt); assert(strcmp(val, "value") == 0); list = input_option_new(list, "2", "v2"); opt = input_option_find(list, "key"); val = input_option_get_value(opt); assert(strcmp(val, "value") == 0); opt = input_option_find(list, "2"); val = input_option_get_value(opt); assert(strcmp(val, "v2") == 0); list = input_option_new(list, "3", "v3"); /* search, delete */ opt = input_option_find(list, "key"); val = input_option_get_value(opt); assert(strcmp(val, "value") == 0); list = input_option_free_element(list, "key"); opt = input_option_find(list, "key"); assert(opt == NULL); opt = input_option_find(list, "2"); val = input_option_get_value(opt); assert(strcmp(val, "v2") == 0); list = input_option_free_element(list, "2"); opt = input_option_find(list, "2"); assert(opt == NULL); opt = input_option_find(list, "3"); val = input_option_get_value(opt); assert(strcmp(val, "v3") == 0); list = input_option_free_element(list, "3"); opt = input_option_find(list, "3"); assert(opt == NULL); /* list deletion */ list = input_option_new(list, "1", "v3"); list = input_option_new(list, "2", "v3"); list = input_option_new(list, "3", "v3"); input_option_free_list(&list); assert(list == NULL); list = input_option_new(list, "1", "v1"); list = input_option_new(list, "2", "v2"); list = input_option_new(list, "3", "v3"); /* value replacement */ opt = input_option_find(list, "2"); val = input_option_get_value(opt); assert(strcmp(val, "v2") == 0); input_option_set_value(opt, "foo"); val = input_option_get_value(opt); assert(strcmp(val, "foo") == 0); opt = input_option_find(list, "2"); val = input_option_get_value(opt); assert(strcmp(val, "foo") == 0); /* key replacement */ input_option_set_key(opt, "bar"); val = input_option_get_key(opt); assert(strcmp(val, "bar") == 0); opt = input_option_find(list, "bar"); val = input_option_get_value(opt); assert(strcmp(val, "foo") == 0); /* value replacement in input_option_new */ list = input_option_new(list, "bar", "foobar"); opt = input_option_find(list, "bar"); val = input_option_get_value(opt); assert(strcmp(val, "foobar") == 0); input_option_free_list(&list); assert(list == NULL); } static void _test_double_fp16_values(double orig_d) { FP1616 first_fp16, final_fp16; double final_d; if (orig_d > 0x7FFF) { printf("Test out of range\n"); assert(0); } first_fp16 = double_to_fp1616(orig_d); final_d = fp1616_to_double(first_fp16); final_fp16 = double_to_fp1616(final_d); /* { * char first_fp16_s[64]; * char final_fp16_s[64]; * snprintf(first_fp16_s, sizeof(first_fp16_s), "%d + %u * 2^-16", (first_fp16 & 0xffff0000) >> 16, first_fp16 & 0xffff); * snprintf(final_fp16_s, sizeof(final_fp16_s), "%d + %u * 2^-16", (final_fp16 & 0xffff0000) >> 16, final_fp16 & 0xffff); * * printf("FP16: original double: %f first fp16: %s, re-encoded double: %f, final fp16: %s\n", orig_d, first_fp16_s, final_d, final_fp16_s); * } */ /* since we lose precision, we only do rough range testing */ assert(final_d > orig_d - 0.1); assert(final_d < orig_d + 0.1); assert(memcmp(&first_fp16, &final_fp16, sizeof(FP1616)) == 0); if (orig_d > 0) _test_double_fp16_values(-orig_d); } static void _test_double_fp32_values(double orig_d) { FP3232 first_fp32, final_fp32; double final_d; if (orig_d > 0x7FFFFFFF) { printf("Test out of range\n"); assert(0); } first_fp32 = double_to_fp3232(orig_d); final_d = fp3232_to_double(first_fp32); final_fp32 = double_to_fp3232(final_d); /* { * char first_fp32_s[64]; * char final_fp32_s[64]; * snprintf(first_fp32_s, sizeof(first_fp32_s), "%d + %u * 2^-32", first_fp32.integral, first_fp32.frac); * snprintf(final_fp32_s, sizeof(final_fp32_s), "%d + %u * 2^-32", first_fp32.integral, final_fp32.frac); * * printf("FP32: original double: %f first fp32: %s, re-encoded double: %f, final fp32: %s\n", orig_d, first_fp32_s, final_d, final_fp32_s); * } */ /* since we lose precision, we only do rough range testing */ assert(final_d > orig_d - 0.1); assert(final_d < orig_d + 0.1); assert(memcmp(&first_fp32, &final_fp32, sizeof(FP3232)) == 0); if (orig_d > 0) _test_double_fp32_values(-orig_d); } static void dix_double_fp_conversion(void) { uint32_t i; printf("Testing double to FP1616/FP3232 conversions\n"); _test_double_fp16_values(0); for (i = 1; i < 0x7FFF; i <<= 1) { double val; val = i; _test_double_fp16_values(val); _test_double_fp32_values(val); /* and some pseudo-random floating points */ val = i - 0.00382; _test_double_fp16_values(val); _test_double_fp32_values(val); val = i + 0.00382; _test_double_fp16_values(val); _test_double_fp32_values(val); val = i + 0.05234; _test_double_fp16_values(val); _test_double_fp32_values(val); val = i + 0.12342; _test_double_fp16_values(val); _test_double_fp32_values(val); val = i + 0.27583; _test_double_fp16_values(val); _test_double_fp32_values(val); val = i + 0.50535; _test_double_fp16_values(val); _test_double_fp32_values(val); val = i + 0.72342; _test_double_fp16_values(val); _test_double_fp32_values(val); val = i + 0.80408; _test_double_fp16_values(val); _test_double_fp32_values(val); } for (i = 0x7FFFF; i < 0x7FFFFFFF; i <<= 1) { _test_double_fp32_values(i); /* and a few more random floating points, obtained * by faceplanting into the numpad repeatedly */ _test_double_fp32_values(i + 0.010177); _test_double_fp32_values(i + 0.213841); _test_double_fp32_values(i + 0.348720); _test_double_fp32_values(i + 0.472020); _test_double_fp32_values(i + 0.572020); _test_double_fp32_values(i + 0.892929); } } /* The mieq test verifies that events added to the queue come out in the same * order that they went in. */ static uint32_t mieq_test_event_last_processed; static void mieq_test_event_handler(int screenNum, InternalEvent *ie, DeviceIntPtr dev) { RawDeviceEvent *e = (RawDeviceEvent *) ie; assert(e->type == ET_RawMotion); assert(e->flags > mieq_test_event_last_processed); mieq_test_event_last_processed = e->flags; } static void _mieq_test_generate_events(uint32_t start, uint32_t count) { static DeviceIntRec dev; static SpriteInfoRec spriteInfo; static SpriteRec sprite; memset(&dev, 0, sizeof(dev)); memset(&spriteInfo, 0, sizeof(spriteInfo)); memset(&sprite, 0, sizeof(sprite)); dev.spriteInfo = &spriteInfo; spriteInfo.sprite = &sprite; dev.enabled = 1; count += start; while (start < count) { RawDeviceEvent e = { 0 }; e.header = ET_Internal; e.type = ET_RawMotion; e.length = sizeof(e); e.time = GetTimeInMillis(); e.flags = start; mieqEnqueue(&dev, (InternalEvent *) &e); start++; } } #define mieq_test_generate_events(c) { _mieq_test_generate_events(next, c); next += c; } static void mieq_test(void) { uint32_t next = 1; mieq_test_event_last_processed = 0; mieqInit(); mieqSetHandler(ET_RawMotion, mieq_test_event_handler); /* Enough to fit the buffer but trigger a grow */ mieq_test_generate_events(180); /* We should resize to 512 now */ mieqProcessInputEvents(); /* Some should now get dropped */ mieq_test_generate_events(500); /* Tell us how many got dropped, 1024 now */ mieqProcessInputEvents(); /* Now make it 2048 */ mieq_test_generate_events(900); mieqProcessInputEvents(); /* Now make it 4096 (max) */ mieq_test_generate_events(1950); mieqProcessInputEvents(); /* Now overflow one last time with the maximal queue and reach the verbosity limit */ mieq_test_generate_events(10000); mieqProcessInputEvents(); mieqFini(); } /* Simple check that we're replaying events in-order */ static void process_input_proc(InternalEvent *ev, DeviceIntPtr device) { static int last_evtype = -1; if (ev->any.header == 0xac) last_evtype = -1; assert(ev->any.type == ++last_evtype); } static void dix_enqueue_events(void) { #define NEVENTS 5 DeviceIntRec dev; InternalEvent ev[NEVENTS]; SpriteInfoRec spriteInfo; SpriteRec sprite; QdEventPtr qe; int i; memset(&dev, 0, sizeof(dev)); dev.public.processInputProc = process_input_proc; memset(&spriteInfo, 0, sizeof(spriteInfo)); memset(&sprite, 0, sizeof(sprite)); dev.spriteInfo = &spriteInfo; spriteInfo.sprite = &sprite; InitEvents(); assert(xorg_list_is_empty(&syncEvents.pending)); /* this way PlayReleasedEvents really runs through all events in the * queue */ inputInfo.devices = &dev; /* to reset process_input_proc */ ev[0].any.header = 0xac; for (i = 0; i < NEVENTS; i++) { ev[i].any.length = sizeof(*ev); ev[i].any.type = i; EnqueueEvent(&ev[i], &dev); assert(!xorg_list_is_empty(&syncEvents.pending)); qe = xorg_list_last_entry(&syncEvents.pending, QdEventRec, next); assert(memcmp(qe->event, &ev[i], ev[i].any.length) == 0); qe = xorg_list_first_entry(&syncEvents.pending, QdEventRec, next); assert(memcmp(qe->event, &ev[0], ev[i].any.length) == 0); } /* calls process_input_proc */ dev.deviceGrab.sync.frozen = 1; PlayReleasedEvents(); assert(!xorg_list_is_empty(&syncEvents.pending)); dev.deviceGrab.sync.frozen = 0; PlayReleasedEvents(); assert(xorg_list_is_empty(&syncEvents.pending)); inputInfo.devices = NULL; } int main(int argc, char **argv) { dix_enqueue_events(); dix_double_fp_conversion(); dix_input_valuator_masks(); dix_input_attributes(); dix_init_valuators(); dix_event_to_core_conversion(); dix_event_to_xi1_conversion(); dix_check_grab_values(); xi2_struct_sizes(); dix_grab_matching(); dix_valuator_mode(); include_byte_padding_macros(); include_bit_test_macros(); xi_unregister_handlers(); dix_valuator_alloc(); dix_get_master(); input_option_test(); mieq_test(); return 0; } xorg-server-1.17.1/test/string.c0000664000175100017510000000412112274325512013443 00000000000000/* * Copyright (c) 2011, Oracle and/or its affiliates. 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 (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. */ /** * Tests for fallback implementations of string handling routines * provided in os/ subdirectory for some platforms. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "os.h" /* Ensure we're testing our functions, even on platforms with libc versions */ #include #undef strndup #define strndup my_strndup char *strndup(const char *str, size_t n); #include "../os/strndup.c" static void strndup_checks(void) { const char *sample = "0123456789abcdef"; char *allofit; char *firsthalf = strndup(sample, 8); char *secondhalf = strndup(sample + 8, 8); assert(strcmp(firsthalf, "01234567") == 0); assert(strcmp(secondhalf, "89abcdef") == 0); free(firsthalf); free(secondhalf); allofit = strndup(sample, 20); assert(strcmp(allofit, sample) == 0); free(allofit); } int main(int argc, char **argv) { strndup_checks(); return 0; } xorg-server-1.17.1/test/xi2/0000775000175100017510000000000012466505446012566 500000000000000xorg-server-1.17.1/test/xi2/Makefile.am0000664000175100017510000000600612200102654014520 00000000000000if ENABLE_UNIT_TESTS if HAVE_LD_WRAP noinst_PROGRAMS = \ protocol-xiqueryversion \ protocol-xiquerydevice \ protocol-xiselectevents \ protocol-xigetselectedevents \ protocol-xisetclientpointer \ protocol-xigetclientpointer \ protocol-xipassivegrabdevice \ protocol-xiquerypointer \ protocol-xiwarppointer \ protocol-eventconvert \ xi2 TESTS=$(noinst_PROGRAMS) TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = @XORG_INCS@ 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 TEST_LDADD += $(OS_LIB) $(DIX_LIB) endif protocol_xiqueryversion_LDADD=$(TEST_LDADD) protocol_xiquerydevice_LDADD=$(TEST_LDADD) protocol_xiselectevents_LDADD=$(TEST_LDADD) protocol_xigetselectedevents_LDADD=$(TEST_LDADD) protocol_xisetclientpointer_LDADD=$(TEST_LDADD) protocol_xigetclientpointer_LDADD=$(TEST_LDADD) protocol_xiquerypointer_LDADD=$(TEST_LDADD) protocol_xipassivegrabdevice_LDADD=$(TEST_LDADD) protocol_xiwarppointer_LDADD=$(TEST_LDADD) protocol_eventconvert_LDADD=$(TEST_LDADD) xi2_LDADD=$(TEST_LDADD) protocol_xiqueryversion_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient protocol_xiquerydevice_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient protocol_xiselectevents_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,dixLookupWindow -Wl,-wrap,XISetEventMask protocol_xigetselectedevents_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -Wl,-wrap,AddResource protocol_xisetclientpointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,dixLookupClient protocol_xigetclientpointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupClient protocol_xipassivegrabdevice_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,GrabButton -Wl,-wrap,dixLookupWindow -Wl,-wrap,WriteToClient protocol_xiquerypointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow protocol_xiwarppointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow xi2_LDFLAGS=$(AM_LDFLAGS) protocol_xiqueryversion_SOURCES=$(COMMON_SOURCES) protocol-xiqueryversion.c protocol_xiquerydevice_SOURCES=$(COMMON_SOURCES) protocol-xiquerydevice.c protocol_xiselectevents_SOURCES=$(COMMON_SOURCES) protocol-xiselectevents.c protocol_xigetselectedevents_SOURCES=$(COMMON_SOURCES) protocol-xigetselectedevents.c protocol_xisetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xisetclientpointer.c protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointer.c protocol_xiquerypointer_SOURCES=$(COMMON_SOURCES) protocol-xiquerypointer.c protocol_xipassivegrabdevice_SOURCES=$(COMMON_SOURCES) protocol-xipassivegrabdevice.c protocol_xiwarppointer_SOURCES=$(COMMON_SOURCES) protocol-xiwarppointer.c else # Print that xi2-tests were skipped (exit code 77 for automake test harness) TESTS = xi2-tests CLEANFILES = $(TESTS) xi2-tests: @echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@ @echo 'exit 77' >> $@ $(AM_V_GEN)chmod +x $@ endif endif xorg-server-1.17.1/test/xi2/protocol-xisetclientpointer.c0000664000175100017510000001030012274325512020426 00000000000000/** * Copyright © 2009 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 /* * Protocol testing for XISetClientPointer request. * * Tests include: * BadDevice of all devices except master pointers. * Success for a valid window. * Success for window None. * BadWindow for invalid windows. */ #include #include #include #include #include "inputstr.h" #include "windowstr.h" #include "extinit.h" /* for XInputExtensionInit */ #include "scrnintstr.h" #include "xisetclientpointer.h" #include "exevents.h" #include "exglobals.h" #include "protocol-common.h" static ClientRec client_window; static ClientRec client_request; int __wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access) { if (rid == ROOT_WINDOW_ID) return BadWindow; if (rid == CLIENT_WINDOW_ID) { *pClient = &client_window; return Success; } return __real_dixLookupClient(pClient, rid, client, access); } static void request_XISetClientPointer(xXISetClientPointerReq * req, int error) { int rc; client_request = init_client(req->length, req); rc = ProcXISetClientPointer(&client_request); assert(rc == error); if (rc == BadDevice) assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; swapl(&req->win); swaps(&req->length); swaps(&req->deviceid); rc = SProcXISetClientPointer(&client_request); assert(rc == error); if (rc == BadDevice) assert(client_request.errorValue == req->deviceid); } static void test_XISetClientPointer(void) { int i; xXISetClientPointerReq request; request_init(&request, XISetClientPointer); request.win = CLIENT_WINDOW_ID; printf("Testing BadDevice error for XIAllDevices and XIMasterDevices.\n"); request.deviceid = XIAllDevices; request_XISetClientPointer(&request, BadDevice); request.deviceid = XIAllMasterDevices; request_XISetClientPointer(&request, BadDevice); printf("Testing Success for VCP and VCK.\n"); request.deviceid = devices.vcp->id; /* 2 */ request_XISetClientPointer(&request, Success); assert(client_window.clientPtr->id == 2); request.deviceid = devices.vck->id; /* 3 */ request_XISetClientPointer(&request, Success); assert(client_window.clientPtr->id == 2); printf("Testing BadDevice error for all other devices.\n"); for (i = 4; i <= 0xFFFF; i++) { request.deviceid = i; request_XISetClientPointer(&request, BadDevice); } printf("Testing window None\n"); request.win = None; request.deviceid = devices.vcp->id; /* 2 */ request_XISetClientPointer(&request, Success); assert(client_request.clientPtr->id == 2); printf("Testing invalid window\n"); request.win = INVALID_WINDOW_ID; request.deviceid = devices.vcp->id; request_XISetClientPointer(&request, BadWindow); } int main(int argc, char **argv) { init_simple(); client_window = init_client(0, NULL); test_XISetClientPointer(); return 0; } xorg-server-1.17.1/test/xi2/xi2.c0000664000175100017510000001067412274325512013353 00000000000000/** * Copyright © 2011 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 "inpututils.h" #include "inputstr.h" #include "assert.h" static void 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); assert(xi2mask->nmasks > 0); assert(xi2mask->mask_size > 0); assert(xi2mask_mask_size(xi2mask) == xi2mask->mask_size); assert(xi2mask_num_masks(xi2mask) == xi2mask->nmasks); mask = calloc(1, xi2mask_mask_size(xi2mask)); /* ensure zeros */ for (i = 0; i < xi2mask_num_masks(xi2mask); i++) { const unsigned char *m = xi2mask_get_one_mask(xi2mask, i); assert(memcmp(mask, m, xi2mask_mask_size(xi2mask)) == 0); } /* set various bits */ for (i = 0; i < xi2mask_num_masks(xi2mask); i++) { const unsigned char *m; xi2mask_set(xi2mask, i, i); dev.id = i; assert(xi2mask_isset(xi2mask, &dev, i)); m = xi2mask_get_one_mask(xi2mask, i); SetBit(mask, i); assert(memcmp(mask, m, xi2mask_mask_size(xi2mask)) == 0); ClearBit(mask, i); } /* ensure zeros one-by-one */ for (i = 0; i < xi2mask_num_masks(xi2mask); i++) { const unsigned char *m = xi2mask_get_one_mask(xi2mask, i); assert(memcmp(mask, m, xi2mask_mask_size(xi2mask)) != 0); xi2mask_zero(xi2mask, i); assert(memcmp(mask, m, xi2mask_mask_size(xi2mask)) == 0); } /* re-set, zero all */ for (i = 0; i < xi2mask_num_masks(xi2mask); i++) xi2mask_set(xi2mask, i, i); xi2mask_zero(xi2mask, -1); for (i = 0; i < xi2mask_num_masks(xi2mask); i++) { const unsigned char *m = xi2mask_get_one_mask(xi2mask, i); assert(memcmp(mask, m, xi2mask_mask_size(xi2mask)) == 0); } for (i = 0; i < xi2mask_num_masks(xi2mask); i++) { const unsigned char *m; SetBit(mask, i); xi2mask_set_one_mask(xi2mask, i, mask, xi2mask_mask_size(xi2mask)); m = xi2mask_get_one_mask(xi2mask, i); assert(memcmp(mask, m, xi2mask_mask_size(xi2mask)) == 0); ClearBit(mask, i); } mergemask = xi2mask_new_with_size(MAXDEVICES + 2, (MAXDEVICES + 2) * 2); for (i = 0; i < xi2mask_num_masks(mergemask); i++) { dev.id = i; xi2mask_set(mergemask, i, i * 2); } /* xi2mask still has all i bits set, should now also have all i * 2 bits */ xi2mask_merge(xi2mask, mergemask); for (i = 0; i < xi2mask_num_masks(mergemask); i++) { const unsigned char *m = xi2mask_get_one_mask(xi2mask, i); SetBit(mask, i); SetBit(mask, i * 2); assert(memcmp(mask, m, xi2mask_mask_size(xi2mask)) == 0); ClearBit(mask, i); ClearBit(mask, i * 2); } xi2mask_free(&xi2mask); assert(xi2mask == NULL); xi2mask_free(&mergemask); assert(mergemask == NULL); free(mask); } int main(int argc, char **argv) { xi2mask_test(); return 0; } xorg-server-1.17.1/test/xi2/protocol-xigetselectedevents.c0000664000175100017510000001554712274325512020572 00000000000000/** * Copyright © 2009 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 /* * Protocol testing for XIGetSelectedEvents request. * * Tests include: * BadWindow on wrong window. * Zero-length masks if no masks are set. * Valid masks for valid devices. * Masks set on non-existent devices are not returned. * * Note that this test is not connected to the XISelectEvents request. */ #include #include #include #include #include "inputstr.h" #include "windowstr.h" #include "extinit.h" /* for XInputExtensionInit */ #include "scrnintstr.h" #include "xiselectev.h" #include "exevents.h" #include "protocol-common.h" static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, void *userdata); static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data, void *userdata); struct { int num_masks_expected; unsigned char mask[MAXDEVICES][XI2LASTEVENT]; /* intentionally bigger */ int mask_len; } test_data; /* dixLookupWindow requires a lot of setup not necessary for this test. * Simple wrapper that returns either one of the fake root window or the * fake client window. If the requested ID is neither of those wanted, * return whatever the real dixLookupWindow does. */ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) { if (id == root.drawable.id) { *win = &root; return Success; } else if (id == window.drawable.id) { *win = &window; return Success; } return __real_dixLookupWindow(win, id, client, access); } /* AddResource is called from XISetSEventMask, we don't need this */ Bool __wrap_AddResource(XID id, RESTYPE type, void *value) { return TRUE; } static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, void *userdata) { xXIGetSelectedEventsReply *rep = (xXIGetSelectedEventsReply *) data; if (client->swapped) { swapl(&rep->length); swaps(&rep->sequenceNumber); swaps(&rep->num_masks); } reply_check_defaults(rep, len, XIGetSelectedEvents); assert(rep->num_masks == test_data.num_masks_expected); reply_handler = reply_XIGetSelectedEvents_data; } static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data, void *userdata) { int i; xXIEventMask *mask; unsigned char *bitmask; mask = (xXIEventMask *) data; for (i = 0; i < test_data.num_masks_expected; i++) { if (client->swapped) { swaps(&mask->deviceid); swaps(&mask->mask_len); } assert(mask->deviceid < 6); assert(mask->mask_len <= (((XI2LASTEVENT + 8) / 8) + 3) / 4); bitmask = (unsigned char *) &mask[1]; assert(memcmp(bitmask, test_data.mask[mask->deviceid], mask->mask_len * 4) == 0); mask = (xXIEventMask *) ((char *) mask + mask->mask_len * 4 + sizeof(xXIEventMask)); } } static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq * req, int error) { int rc; ClientRec client; client = init_client(req->length, req); reply_handler = reply_XIGetSelectedEvents; rc = ProcXIGetSelectedEvents(&client); assert(rc == error); reply_handler = reply_XIGetSelectedEvents; client.swapped = TRUE; swapl(&req->win); swaps(&req->length); rc = SProcXIGetSelectedEvents(&client); assert(rc == error); } static void test_XIGetSelectedEvents(void) { int i, j; xXIGetSelectedEventsReq request; ClientRec client = init_client(0, NULL); unsigned char *mask; DeviceIntRec dev; request_init(&request, XIGetSelectedEvents); printf("Testing for BadWindow on invalid window.\n"); request.win = None; request_XIGetSelectedEvents(&request, BadWindow); printf("Testing for zero-length (unset) masks.\n"); /* No masks set yet */ test_data.num_masks_expected = 0; request.win = ROOT_WINDOW_ID; request_XIGetSelectedEvents(&request, Success); request.win = CLIENT_WINDOW_ID; request_XIGetSelectedEvents(&request, Success); memset(test_data.mask, 0, sizeof(test_data.mask)); printf("Testing for valid masks\n"); memset(&dev, 0, sizeof(dev)); /* dev->id is enough for XISetEventMask */ request.win = ROOT_WINDOW_ID; /* devices 6 - MAXDEVICES don't exist, they mustn't be included in the * reply even if a mask is set */ for (j = 0; j < MAXDEVICES; j++) { test_data.num_masks_expected = min(j + 1, devices.num_devices + 2); dev.id = j; mask = test_data.mask[j]; /* bits one-by-one */ for (i = 0; i < XI2LASTEVENT; i++) { SetBit(mask, i); XISetEventMask(&dev, &root, &client, (i + 8) / 8, mask); request_XIGetSelectedEvents(&request, Success); ClearBit(mask, i); } /* all valid mask bits */ for (i = 0; i < XI2LASTEVENT; i++) { SetBit(mask, i); XISetEventMask(&dev, &root, &client, (i + 8) / 8, mask); request_XIGetSelectedEvents(&request, Success); } } printf("Testing removing all masks\n"); /* Unset all masks one-by-one */ for (j = MAXDEVICES - 1; j >= 0; j--) { if (j < devices.num_devices + 2) test_data.num_masks_expected--; mask = test_data.mask[j]; memset(mask, 0, XI2LASTEVENT); dev.id = j; XISetEventMask(&dev, &root, &client, 0, NULL); request_XIGetSelectedEvents(&request, Success); } } int main(int argc, char **argv) { init_simple(); test_XIGetSelectedEvents(); return 0; } xorg-server-1.17.1/test/xi2/protocol-xiquerydevice.c0000664000175100017510000002664212274325512017400 00000000000000/** * Copyright © 2009 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 #include #include #include #include "inputstr.h" #include "extinit.h" #include "exglobals.h" #include "scrnintstr.h" #include "xkbsrv.h" #include "xiquerydevice.h" #include "protocol-common.h" /* * Protocol testing for XIQueryDevice request and reply. * * Test approach: * Wrap WriteToClient to intercept server's reply. ProcXIQueryDevice returns * data in two batches, once for the request, once for the trailing data * with the device information. * Repeatedly test with varying deviceids and check against data in reply. */ struct test_data { int which_device; int num_devices_in_reply; }; static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *closure); static void reply_XIQueryDevice(ClientPtr client, int len, char *data, void *closure); /* reply handling for the first bytes that constitute the reply */ static void reply_XIQueryDevice(ClientPtr client, int len, char *data, void *userdata) { xXIQueryDeviceReply *rep = (xXIQueryDeviceReply *) data; struct test_data *querydata = (struct test_data *) userdata; if (client->swapped) { swapl(&rep->length); swaps(&rep->sequenceNumber); swaps(&rep->num_devices); } reply_check_defaults(rep, len, XIQueryDevice); if (querydata->which_device == XIAllDevices) assert(rep->num_devices == devices.num_devices); else if (querydata->which_device == XIAllMasterDevices) assert(rep->num_devices == devices.num_master_devices); else assert(rep->num_devices == 1); querydata->num_devices_in_reply = rep->num_devices; reply_handler = reply_XIQueryDevice_data; } /* reply handling for the trailing bytes that constitute the device info */ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *closure) { int i, j; struct test_data *querydata = (struct test_data *) closure; DeviceIntPtr dev; xXIDeviceInfo *info = (xXIDeviceInfo *) data; xXIAnyInfo *any; for (i = 0; i < querydata->num_devices_in_reply; i++) { if (client->swapped) { swaps(&info->deviceid); swaps(&info->attachment); swaps(&info->use); swaps(&info->num_classes); swaps(&info->name_len); } if (querydata->which_device > XIAllMasterDevices) assert(info->deviceid == querydata->which_device); assert(info->deviceid >= 2); /* 0 and 1 is reserved */ switch (info->deviceid) { case 2: /* VCP */ dev = devices.vcp; assert(info->use == XIMasterPointer); assert(info->attachment == devices.vck->id); assert(info->num_classes == 3); /* 2 axes + button */ break; case 3: /* VCK */ dev = devices.vck; assert(info->use == XIMasterKeyboard); assert(info->attachment == devices.vcp->id); assert(info->num_classes == 1); break; case 4: /* mouse */ dev = devices.mouse; assert(info->use == XISlavePointer); assert(info->attachment == devices.vcp->id); assert(info->num_classes == 7); /* 4 axes + button + 2 scroll */ break; case 5: /* keyboard */ dev = devices.kbd; assert(info->use == XISlaveKeyboard); assert(info->attachment == devices.vck->id); assert(info->num_classes == 1); break; default: /* We shouldn't get here */ assert(0); break; } assert(info->enabled == dev->enabled); assert(info->name_len == strlen(dev->name)); assert(strncmp((char *) &info[1], dev->name, info->name_len) == 0); any = (xXIAnyInfo *) ((char *) &info[1] + ((info->name_len + 3) / 4) * 4); for (j = 0; j < info->num_classes; j++) { if (client->swapped) { swaps(&any->type); swaps(&any->length); swaps(&any->sourceid); } switch (info->deviceid) { case 3: /* VCK and kbd have the same properties */ case 5: { int k; xXIKeyInfo *ki = (xXIKeyInfo *) any; XkbDescPtr xkb = devices.vck->key->xkbInfo->desc; uint32_t *kc; if (client->swapped) swaps(&ki->num_keycodes); assert(any->type == XIKeyClass); assert(ki->num_keycodes == (xkb->max_key_code - xkb->min_key_code + 1)); assert(any->length == (2 + ki->num_keycodes)); kc = (uint32_t *) &ki[1]; for (k = 0; k < ki->num_keycodes; k++, kc++) { if (client->swapped) swapl(kc); assert(*kc >= xkb->min_key_code); assert(*kc <= xkb->max_key_code); } break; } case 4: { assert(any->type == XIButtonClass || any->type == XIValuatorClass || any->type == XIScrollClass); if (any->type == XIScrollClass) { xXIScrollInfo *si = (xXIScrollInfo *) any; if (client->swapped) { swaps(&si->number); swaps(&si->scroll_type); swapl(&si->increment.integral); swapl(&si->increment.frac); } assert(si->length == 6); assert(si->number == 2 || si->number == 3); if (si->number == 2) { assert(si->scroll_type == XIScrollTypeVertical); assert(!si->flags); } if (si->number == 3) { assert(si->scroll_type == XIScrollTypeHorizontal); assert(si->flags & XIScrollFlagPreferred); assert(!(si->flags & ~XIScrollFlagPreferred)); } assert(si->increment.integral == si->number); /* protocol-common.c sets up increments of 2.4 and 3.5 */ assert(si->increment.frac > 0.3 * (1ULL << 32)); assert(si->increment.frac < 0.6 * (1ULL << 32)); } } /* fall through */ case 2: /* VCP and mouse have the same properties except for scroll */ { if (info->deviceid == 2) /* VCP */ assert(any->type == XIButtonClass || any->type == XIValuatorClass); if (any->type == XIButtonClass) { int l; xXIButtonInfo *bi = (xXIButtonInfo *) any; if (client->swapped) swaps(&bi->num_buttons); assert(bi->num_buttons == devices.vcp->button->numButtons); l = 2 + bi->num_buttons + bytes_to_int32(bits_to_bytes(bi->num_buttons)); assert(bi->length == l); } else if (any->type == XIValuatorClass) { xXIValuatorInfo *vi = (xXIValuatorInfo *) any; if (client->swapped) { swaps(&vi->number); swapl(&vi->label); swapl(&vi->min.integral); swapl(&vi->min.frac); swapl(&vi->max.integral); swapl(&vi->max.frac); swapl(&vi->resolution); } assert(vi->length == 11); assert(vi->number >= 0 && vi->number < 4); if (info->deviceid == 2) /* VCP */ assert(vi->number < 2); assert(vi->mode == XIModeRelative); /* device was set up as relative, so standard * values here. */ assert(vi->min.integral == -1); assert(vi->min.frac == 0); assert(vi->max.integral == -1); assert(vi->max.frac == 0); assert(vi->resolution == 0); } } break; } any = (xXIAnyInfo *) (((char *) any) + any->length * 4); } info = (xXIDeviceInfo *) any; } } static void request_XIQueryDevice(struct test_data *querydata, int deviceid, int error) { int rc; ClientRec client; xXIQueryDeviceReq request; request_init(&request, XIQueryDevice); client = init_client(request.length, &request); reply_handler = reply_XIQueryDevice; querydata->which_device = deviceid; request.deviceid = deviceid; rc = ProcXIQueryDevice(&client); assert(rc == error); if (rc != Success) assert(client.errorValue == deviceid); reply_handler = reply_XIQueryDevice; client.swapped = TRUE; swaps(&request.length); swaps(&request.deviceid); rc = SProcXIQueryDevice(&client); assert(rc == error); if (rc != Success) assert(client.errorValue == deviceid); } static void test_XIQueryDevice(void) { int i; xXIQueryDeviceReq request; struct test_data data; reply_handler = reply_XIQueryDevice; global_userdata = &data; request_init(&request, XIQueryDevice); printf("Testing XIAllDevices.\n"); request_XIQueryDevice(&data, XIAllDevices, Success); printf("Testing XIAllMasterDevices.\n"); request_XIQueryDevice(&data, XIAllMasterDevices, Success); printf("Testing existing device ids.\n"); for (i = 2; i < 6; i++) request_XIQueryDevice(&data, i, Success); printf("Testing non-existing device ids.\n"); for (i = 6; i <= 0xFFFF; i++) request_XIQueryDevice(&data, i, BadDevice); reply_handler = NULL; } int main(int argc, char **argv) { init_simple(); test_XIQueryDevice(); return 0; } xorg-server-1.17.1/test/xi2/protocol-xiqueryversion.c0000664000175100017510000002201412274325512017613 00000000000000/** * Copyright © 2009 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 /* * Protocol testing for XIQueryVersion request and reply. * * Test approach: * Wrap WriteToClient to intercept the server's reply. * Repeatedly test a client/server version combination, compare version in * reply with versions given. Version must be equal to either * server version or client version, whichever is smaller. * Client version less than 2 must return BadValue. */ #include #include #include #include #include "inputstr.h" #include "extinit.h" /* for XInputExtensionInit */ #include "scrnintstr.h" #include "xiqueryversion.h" #include "protocol-common.h" #include "exglobals.h" extern XExtensionVersion XIVersion; struct test_data { int major_client; int minor_client; int major_server; int minor_server; int major_expected; int minor_expected; }; static void reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure) { xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data; struct test_data *versions = (struct test_data *) closure; unsigned int sver, cver, ver; if (client->swapped) { swapl(&rep->length); swaps(&rep->sequenceNumber); swaps(&rep->major_version); swaps(&rep->minor_version); } reply_check_defaults(rep, len, XIQueryVersion); assert(rep->length == 0); sver = versions->major_server * 1000 + versions->minor_server; cver = versions->major_client * 1000 + versions->minor_client; ver = rep->major_version * 1000 + rep->minor_version; assert(ver >= 2000); 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); assert(versions->major_expected == rep->major_version); assert(versions->minor_expected == 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'. * * Test is run normal, then for a swapped client. */ static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error) { int rc; struct test_data versions; xXIQueryVersionReq request; ClientRec client; request_init(&request, XIQueryVersion); client = init_client(request.length, &request); global_userdata = (void *) &versions; /* Change the server to support smaj.smin */ XIVersion.major_version = smaj; XIVersion.minor_version = smin; /* remember versions we send and expect */ versions.major_client = cmaj; versions.minor_client = cmin; versions.major_server = XIVersion.major_version; versions.minor_server = XIVersion.minor_version; request.major_version = versions.major_client; request.minor_version = versions.minor_client; rc = ProcXIQueryVersion(&client); assert(rc == error); client = init_client(request.length, &request); client.swapped = TRUE; swaps(&request.length); swaps(&request.major_version); swaps(&request.minor_version); rc = SProcXIQueryVersion(&client); assert(rc == error); } /* Client version less than 2.0 must return BadValue, all other combinations * Success */ static void test_XIQueryVersion(void) { reply_handler = reply_XIQueryVersion; printf("Server version 2.0 - client versions [1..3].0\n"); /* some simple tests to catch common errors quickly */ request_XIQueryVersion(2, 0, 1, 0, BadValue); request_XIQueryVersion(2, 0, 2, 0, Success); request_XIQueryVersion(2, 0, 3, 0, Success); printf("Server version 3.0 - client versions [1..3].0\n"); request_XIQueryVersion(3, 0, 1, 0, BadValue); request_XIQueryVersion(3, 0, 2, 0, Success); request_XIQueryVersion(3, 0, 3, 0, Success); printf("Server version 2.0 - client versions [1..3].[1..3]\n"); request_XIQueryVersion(2, 0, 1, 1, BadValue); request_XIQueryVersion(2, 0, 2, 2, Success); request_XIQueryVersion(2, 0, 3, 3, Success); printf("Server version 2.2 - client versions [1..3].0\n"); request_XIQueryVersion(2, 2, 1, 0, BadValue); request_XIQueryVersion(2, 2, 2, 0, Success); request_XIQueryVersion(2, 2, 3, 0, Success); #if 0 /* this one takes a while */ unsigned int cmin, cmaj, smin, smaj; printf("Testing all combinations.\n"); for (smaj = 2; smaj <= 0xFFFF; smaj++) for (smin = 0; smin <= 0xFFFF; smin++) for (cmin = 0; cmin <= 0xFFFF; cmin++) for (cmaj = 0; cmaj <= 0xFFFF; cmaj++) { int error = (cmaj < 2) ? BadValue : Success; request_XIQueryVersion(smaj, smin, cmaj, cmin, error); } #endif reply_handler = NULL; } static void test_XIQueryVersion_multiple(void) { xXIQueryVersionReq request; ClientRec client; XIClientPtr pXIClient; 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; global_userdata = (void *) &versions; /* run 1 */ /* client is lower than server, nonexpected */ versions.major_expected = request.major_version = 2; versions.minor_expected = request.minor_version = 1; rc = ProcXIQueryVersion(&client); assert(rc == Success); /* client is higher than server, no change */ request.major_version = 2; request.minor_version = 3; rc = ProcXIQueryVersion(&client); assert(rc == Success); /* client tries to set higher version, stays same */ request.major_version = 2; request.minor_version = 2; rc = ProcXIQueryVersion(&client); assert(rc == Success); /* client tries to set lower version, no change */ 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 = 3; versions.major_expected = request.major_version = 2; versions.minor_expected = request.minor_version = 2; rc = ProcXIQueryVersion(&client); assert(rc == Success); /* client bumps version from 2.2 to 2.3 */ request.major_version = 2; versions.minor_expected = request.minor_version = 3; rc = ProcXIQueryVersion(&client); assert(rc == Success); /* real version is changed, too! */ pXIClient = dixLookupPrivate(&client.devPrivates, XIClientPrivateKey); assert(pXIClient->minor_version == 3); /* client tries to set lower version, no change */ 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 = 3; versions.major_expected = request.major_version = 2; versions.minor_expected = request.minor_version = 3; rc = ProcXIQueryVersion(&client); assert(rc == Success); request.major_version = 2; versions.minor_expected = request.minor_version = 2; rc = ProcXIQueryVersion(&client); assert(rc == Success); /* but real client version must not be lowered */ pXIClient = dixLookupPrivate(&client.devPrivates, XIClientPrivateKey); assert(pXIClient->minor_version == 3); 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; } xorg-server-1.17.1/test/xi2/protocol-common.h0000664000175100017510000001214312274325512015776 00000000000000/** * Copyright © 2009 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 "scrnintstr.h" #include "windowstr.h" #include "exevents.h" #include #ifndef PROTOCOL_COMMON_H #define PROTOCOL_COMMON_H /* Check default values in a reply */ #define reply_check_defaults(rep, len, type) \ { \ assert((len) >= sz_x##type##Reply); \ assert((rep)->repType == X_Reply); \ assert((rep)->RepType == X_##type); \ assert((rep)->sequenceNumber == CLIENT_SEQUENCE); \ assert((rep)->length >= (sz_x##type##Reply - 32)/4); \ } /* initialise default values for request */ #define request_init(req, type) \ { \ (req)->reqType = 128; /* doesn't matter */ \ (req)->ReqType = X_##type; \ (req)->length = (sz_x##type##Req >> 2); \ } /* Various defines used in the tests. Some tests may use different values * than these defaults */ /* default client index */ #define CLIENT_INDEX 1 /* default client mask for resources and windows */ #define CLIENT_MASK ((CLIENT_INDEX) << CLIENTOFFSET) /* default client sequence number for replies */ #define CLIENT_SEQUENCE 0x100 /* default root window id */ #define ROOT_WINDOW_ID 0x10 /* default client window id */ #define CLIENT_WINDOW_ID 0x100001 /* invalid window ID. use for BadWindow checks. */ #define INVALID_WINDOW_ID 0x111111 /* initial fake sprite position */ #define SPRITE_X 100 #define SPRITE_Y 200 /* Various structs used throughout the tests */ /* The default devices struct, contains one pointer + keyboard and the * matching master devices. Initialize with init_devices() if needed. */ struct devices { DeviceIntPtr vcp; DeviceIntPtr vck; DeviceIntPtr mouse; DeviceIntPtr kbd; int num_devices; int num_master_devices; }; /** * The set of default devices available in all tests if necessary. */ extern struct devices devices; /** * test-specific userdata, passed into the reply handler. */ extern void *global_userdata; /** * The reply handler called from WriteToClient. Set this handler if you need * to check the reply values. */ void (*reply_handler) (ClientPtr client, int len, char *data, void *userdata); /** * The default screen used for the windows. Initialized by init_simple(). */ extern ScreenRec screen; /** * Semi-initialized root window. initialized by init(). */ extern WindowRec root; /** * Semi-initialized top-level window. initialized by init(). */ extern WindowRec window; /* various simple functions for quick setup */ /** * Initialize the above struct with default devices and return the struct. * Usually not needed if you call ::init_simple. */ struct devices init_devices(void); /** * Init a mostly zeroed out client with default values for index and mask. */ ClientRec init_client(int request_len, void *request_data); /** * Init a mostly zeroed out window with the given window ID. * Usually not needed if you call ::init_simple which sets up root and * window. */ void init_window(WindowPtr window, WindowPtr parent, int id); /** * Create a very simple setup that provides the minimum values for most * tests, including a screen, the root and client window and the default * device setup. */ void init_simple(void); /* Declarations for various overrides in the test files. */ void __wrap_WriteToClient(ClientPtr client, int len, void *data); int __wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, int len, unsigned char *mask); int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access); int __real_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access); Bool __wrap_AddResource(XID id, RESTYPE type, void *value); int __wrap_dixLookupClient(ClientPtr *c, XID id, ClientPtr client, Mask access); int __real_dixLookupClient(ClientPtr *c, XID id, ClientPtr client, Mask access); #endif /* PROTOCOL_COMMON_H */ xorg-server-1.17.1/test/xi2/protocol-xiselectevents.c0000664000175100017510000002420012274325512017543 00000000000000/** * Copyright © 2009 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 /* * Protocol testing for XISelectEvents request. * * Test approach: * * Wrap XISetEventMask to intercept when the server tries to apply the event * mask. Ensure that the mask passed in is equivalent to the one supplied by * the client. Ensure that invalid devices and invalid masks return errors * as appropriate. * * Tests included: * BadValue for num_masks < 0 * BadWindow for invalid windows * BadDevice for non-existing devices * BadImplemenation for devices >= 0xFF * BadValue if HierarchyChanged bit is set for devices other than * XIAllDevices * BadValue for invalid mask bits * Sucecss for excessive mask lengths * */ #include #include #include #include #include "inputstr.h" #include "windowstr.h" #include "extinit.h" /* for XInputExtensionInit */ #include "scrnintstr.h" #include "exglobals.h" #include "xiselectev.h" #include "protocol-common.h" static unsigned char *data[4096 * 20]; /* the request data buffer */ int __wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, int len, unsigned char *mask) { return Success; } /* dixLookupWindow requires a lot of setup not necessary for this test. * Simple wrapper that returns either one of the fake root window or the * fake client window. If the requested ID is neither of those wanted, * return whatever the real dixLookupWindow does. */ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) { if (id == root.drawable.id) { *win = &root; return Success; } else if (id == window.drawable.id) { *win = &window; return Success; } return __real_dixLookupWindow(win, id, client, access); } static void request_XISelectEvent(xXISelectEventsReq * req, int error) { int i; int rc; ClientRec client; xXIEventMask *mask, *next; req->length = (sz_xXISelectEventsReq / 4); 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); } client = init_client(req->length, req); rc = ProcXISelectEvents(&client); assert(rc == error); client.swapped = TRUE; mask = (xXIEventMask *) &req[1]; for (i = 0; i < req->num_masks; i++) { next = (xXIEventMask *) ((char *) &mask[1] + mask->mask_len * 4); swaps(&mask->deviceid); swaps(&mask->mask_len); mask = next; } swapl(&req->win); swaps(&req->length); swaps(&req->num_masks); rc = SProcXISelectEvents(&client); assert(rc == error); } static void _set_bit(unsigned char *bits, int bit) { SetBit(bits, bit); if (bit >= XI_TouchBegin && bit <= XI_TouchOwnership) { SetBit(bits, XI_TouchBegin); SetBit(bits, XI_TouchUpdate); SetBit(bits, XI_TouchEnd); } } static void _clear_bit(unsigned char *bits, int bit) { ClearBit(bits, bit); if (bit >= XI_TouchBegin && bit <= XI_TouchOwnership) { ClearBit(bits, XI_TouchBegin); ClearBit(bits, XI_TouchUpdate); ClearBit(bits, XI_TouchEnd); } } static void request_XISelectEvents_masks(xXISelectEventsReq * req) { int i, j; xXIEventMask *mask; int nmasks = (XI2LASTEVENT + 7) / 8; unsigned char *bits; mask = (xXIEventMask *) &req[1]; req->win = ROOT_WINDOW_ID; /* if a clients submits more than 100 masks, consider it insane and untested */ for (i = 1; i <= 1000; i++) { req->num_masks = i; mask->deviceid = XIAllDevices; /* Test 0: * mask_len is 0 -> Success */ mask->mask_len = 0; request_XISelectEvent(req, Success); /* Test 1: * mask may be larger than needed for XI2LASTEVENT. * Test setting each valid mask bit, while leaving unneeded bits 0. * -> Success */ bits = (unsigned char *) &mask[1]; mask->mask_len = (nmasks + 3) / 4 * 10; memset(bits, 0, mask->mask_len * 4); for (j = 0; j <= XI2LASTEVENT; j++) { _set_bit(bits, j); request_XISelectEvent(req, Success); _clear_bit(bits, j); } /* Test 2: * mask may be larger than needed for XI2LASTEVENT. * Test setting all valid mask bits, while leaving unneeded bits 0. * -> Success */ bits = (unsigned char *) &mask[1]; mask->mask_len = (nmasks + 3) / 4 * 10; memset(bits, 0, mask->mask_len * 4); for (j = 0; j <= XI2LASTEVENT; j++) { _set_bit(bits, j); request_XISelectEvent(req, Success); } /* Test 3: * mask is larger than needed for XI2LASTEVENT. If any unneeded bit * is set -> BadValue */ bits = (unsigned char *) &mask[1]; mask->mask_len = (nmasks + 3) / 4 * 10; memset(bits, 0, mask->mask_len * 4); for (j = XI2LASTEVENT + 1; j < mask->mask_len * 4; j++) { _set_bit(bits, j); request_XISelectEvent(req, BadValue); _clear_bit(bits, j); } /* Test 4: * Mask len is a sensible length, only valid bits are set -> Success */ bits = (unsigned char *) &mask[1]; mask->mask_len = (nmasks + 3) / 4; memset(bits, 0, mask->mask_len * 4); for (j = 0; j <= XI2LASTEVENT; j++) { _set_bit(bits, j); request_XISelectEvent(req, Success); } /* Test 5: * HierarchyChanged bit is BadValue for devices other than * XIAllDevices */ bits = (unsigned char *) &mask[1]; mask->mask_len = (nmasks + 3) / 4; memset(bits, 0, mask->mask_len * 4); SetBit(bits, XI_HierarchyChanged); mask->deviceid = XIAllDevices; request_XISelectEvent(req, Success); for (j = 1; j < devices.num_devices; j++) { mask->deviceid = j; request_XISelectEvent(req, BadValue); } /* Test 6: * All bits set minus hierarchy changed bit -> Success */ bits = (unsigned char *) &mask[1]; mask->mask_len = (nmasks + 3) / 4; memset(bits, 0, mask->mask_len * 4); for (j = 0; j <= XI2LASTEVENT; j++) _set_bit(bits, j); _clear_bit(bits, XI_HierarchyChanged); for (j = 1; j < 6; j++) { mask->deviceid = j; request_XISelectEvent(req, Success); } mask = (xXIEventMask *) ((char *) mask + sizeof(xXIEventMask) + mask->mask_len * 4); } } static void test_XISelectEvents(void) { int i; xXIEventMask *mask; xXISelectEventsReq *req; req = (xXISelectEventsReq *) data; request_init(req, XISelectEvents); printf("Testing for BadValue on zero-length masks\n"); /* zero masks are BadValue, regardless of the window */ req->num_masks = 0; req->win = None; request_XISelectEvent(req, BadValue); req->win = ROOT_WINDOW_ID; request_XISelectEvent(req, BadValue); req->win = CLIENT_WINDOW_ID; request_XISelectEvent(req, BadValue); printf("Testing for BadWindow.\n"); /* None window is BadWindow, regardless of the masks. * We don't actually need to set the masks here, BadWindow must occur * before checking the masks. */ req->win = None; req->num_masks = 1; request_XISelectEvent(req, BadWindow); req->num_masks = 2; request_XISelectEvent(req, BadWindow); req->num_masks = 0xFF; request_XISelectEvent(req, BadWindow); /* request size is 3, so 0xFFFC is the highest num_mask that doesn't * overflow req->length */ req->num_masks = 0xFFFC; request_XISelectEvent(req, BadWindow); printf("Triggering num_masks/length overflow\n"); req->win = ROOT_WINDOW_ID; /* Integer overflow - req->length can't hold that much */ req->num_masks = 0xFFFF; request_XISelectEvent(req, BadLength); req->win = ROOT_WINDOW_ID; req->num_masks = 1; printf("Triggering bogus mask length error\n"); mask = (xXIEventMask *) &req[1]; mask->deviceid = 0; mask->mask_len = 0xFFFF; request_XISelectEvent(req, BadLength); /* testing various device ids */ printf("Testing existing device ids.\n"); for (i = 0; i < 6; i++) { mask = (xXIEventMask *) &req[1]; mask->deviceid = i; mask->mask_len = 1; req->win = ROOT_WINDOW_ID; req->num_masks = 1; request_XISelectEvent(req, Success); } printf("Testing non-existing device ids.\n"); for (i = 6; i <= 0xFFFF; i++) { req->win = ROOT_WINDOW_ID; req->num_masks = 1; mask = (xXIEventMask *) &req[1]; mask->deviceid = i; mask->mask_len = 1; request_XISelectEvent(req, BadDevice); } request_XISelectEvents_masks(req); } int main(int argc, char **argv) { init_simple(); test_XISelectEvents(); return 0; } xorg-server-1.17.1/test/xi2/protocol-xiquerypointer.c0000664000175100017510000001425512456571574017633 00000000000000/** * Copyright © 2009 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 /* * Protocol testing for XIQueryPointer request. */ #include #include #include #include #include "inputstr.h" #include "windowstr.h" #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 *closure); static struct { DeviceIntPtr dev; WindowPtr win; } test_data; /* dixLookupWindow requires a lot of setup not necessary for this test. * Simple wrapper that returns either one of the fake root window or the * fake client window. If the requested ID is neither of those wanted, * return whatever the real dixLookupWindow does. */ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) { if (id == root.drawable.id) { *win = &root; return Success; } else if (id == window.drawable.id) { *win = &window; return Success; } return __real_dixLookupWindow(win, id, client, access); } static void reply_XIQueryPointer(ClientPtr client, int len, char *data, void *closure) { xXIQueryPointerReply *rep = (xXIQueryPointerReply *) data; SpritePtr sprite; if (!rep->repType) return; if (client->swapped) { swapl(&rep->length); swaps(&rep->sequenceNumber); swapl(&rep->root); swapl(&rep->child); swapl(&rep->root_x); swapl(&rep->root_y); swapl(&rep->win_x); swapl(&rep->win_y); swaps(&rep->buttons_len); } reply_check_defaults(rep, len, XIQueryPointer); assert(rep->root == root.drawable.id); assert(rep->same_screen == xTrue); sprite = test_data.dev->spriteInfo->sprite; assert((rep->root_x >> 16) == sprite->hot.x); assert((rep->root_y >> 16) == sprite->hot.y); if (test_data.win == &root) { assert(rep->root_x == rep->win_x); assert(rep->root_y == rep->win_y); assert(rep->child == window.drawable.id); } else { int x, y; x = sprite->hot.x - window.drawable.x; y = sprite->hot.y - window.drawable.y; assert((rep->win_x >> 16) == x); assert((rep->win_y >> 16) == y); assert(rep->child == None); } assert(rep->same_screen == xTrue); reply_handler = reply_XIQueryPointer_data; } static void reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *closure) { reply_handler = reply_XIQueryPointer; } static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq * req, int error) { int rc; rc = ProcXIQueryPointer(&client_request); assert(rc == error); if (rc == BadDevice) assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; swaps(&req->deviceid); swaps(&req->length); rc = SProcXIQueryPointer(&client_request); assert(rc == error); if (rc == BadDevice) assert(client_request.errorValue == req->deviceid); } static void test_XIQueryPointer(void) { int i; xXIQueryPointerReq request; memset(&request, 0, sizeof(request)); request_init(&request, XIQueryPointer); reply_handler = reply_XIQueryPointer; client_request = init_client(request.length, &request); request.deviceid = XIAllDevices; request_XIQueryPointer(&client_request, &request, BadDevice); request.deviceid = XIAllMasterDevices; request_XIQueryPointer(&client_request, &request, BadDevice); request.win = root.drawable.id; test_data.win = &root; test_data.dev = devices.vcp; request.deviceid = devices.vcp->id; request_XIQueryPointer(&client_request, &request, Success); request.deviceid = devices.vck->id; request_XIQueryPointer(&client_request, &request, BadDevice); request.deviceid = devices.mouse->id; request_XIQueryPointer(&client_request, &request, BadDevice); request.deviceid = devices.kbd->id; request_XIQueryPointer(&client_request, &request, BadDevice); test_data.dev = devices.mouse; devices.mouse->master = NULL; /* Float, kind-of */ request.deviceid = devices.mouse->id; request_XIQueryPointer(&client_request, &request, Success); for (i = devices.kbd->id + 1; i <= 0xFFFF; i++) { request.deviceid = i; request_XIQueryPointer(&client_request, &request, BadDevice); } request.win = window.drawable.id; test_data.dev = devices.vcp; test_data.win = &window; request.deviceid = devices.vcp->id; request_XIQueryPointer(&client_request, &request, Success); test_data.dev = devices.mouse; request.deviceid = devices.mouse->id; request_XIQueryPointer(&client_request, &request, Success); /* test REQUEST_SIZE_MATCH */ client_request.req_len -= 4; request_XIQueryPointer(&client_request, &request, BadLength); } int main(int argc, char **argv) { init_simple(); test_XIQueryPointer(); return 0; } xorg-server-1.17.1/test/xi2/protocol-eventconvert.c0000664000175100017510000007674312274325512017243 00000000000000/** * Copyright © 2009 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 "inputstr.h" #include "eventstr.h" #include "eventconvert.h" #include "exevents.h" #include "inpututils.h" #include static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent * out, BOOL swap) { int i; unsigned char *ptr; FP3232 *value, *raw_value; int nvals = 0; int bits_set; int len; uint32_t flagmask = 0; if (swap) { swaps(&out->sequenceNumber); swapl(&out->length); swaps(&out->evtype); swaps(&out->deviceid); swapl(&out->time); swapl(&out->detail); swaps(&out->valuators_len); swapl(&out->flags); } 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->detail == in->detail.button); assert(out->deviceid == in->deviceid); assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(sizeof(in->valuators.mask)))); switch (in->type) { case ET_RawMotion: case ET_RawButtonPress: case ET_RawButtonRelease: flagmask = XIPointerEmulated; break; default: flagmask = 0; } assert((out->flags & ~flagmask) == 0); ptr = (unsigned char *) &out[1]; bits_set = 0; for (i = 0; out->valuators_len && i < sizeof(in->valuators.mask) * 8; i++) { if (i >= MAX_VALUATORS) assert(!XIMaskIsSet(in->valuators.mask, i)); assert(XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); if (XIMaskIsSet(in->valuators.mask, i)) bits_set++; } /* length is len of valuator mask (in 4-byte units) + the number of bits * set. Each bit set represents 2 8-byte values, hence the * 'bits_set * 4' */ len = out->valuators_len + bits_set * 4; assert(out->length == len); nvals = 0; for (i = 0; out->valuators_len && i < MAX_VALUATORS; i++) { assert(XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); if (XIMaskIsSet(in->valuators.mask, i)) { FP3232 vi, vo; value = (FP3232 *) (((unsigned char *) &out[1]) + out->valuators_len * 4); value += nvals; vi = double_to_fp3232(in->valuators.data[i]); vo.integral = value->integral; vo.frac = value->frac; if (swap) { swapl(&vo.integral); swapl(&vo.frac); } assert(vi.integral == vo.integral); assert(vi.frac == vo.frac); raw_value = value + bits_set; vi = double_to_fp3232(in->valuators.data_raw[i]); vo.integral = raw_value->integral; vo.frac = raw_value->frac; if (swap) { swapl(&vo.integral); swapl(&vo.frac); } assert(vi.integral == vo.integral); assert(vi.frac == vo.frac); nvals++; } } } static void test_XIRawEvent(RawDeviceEvent *in) { xXIRawEvent *out, *swapped; int rc; rc = EventToXI2((InternalEvent *) in, (xEvent **) &out); assert(rc == Success); test_values_XIRawEvent(in, out, FALSE); swapped = calloc(1, sizeof(xEvent) + out->length * 4); XI2EventSwap((xGenericEvent *) out, (xGenericEvent *) swapped); test_values_XIRawEvent(in, swapped, TRUE); free(out); free(swapped); } static void test_convert_XIFocusEvent(void) { xEvent *out; DeviceEvent in; int rc; in.header = ET_Internal; in.type = ET_Enter; rc = EventToXI2((InternalEvent *) &in, &out); assert(rc == Success); assert(out == NULL); in.header = ET_Internal; in.type = ET_FocusIn; rc = EventToXI2((InternalEvent *) &in, &out); assert(rc == Success); assert(out == NULL); in.header = ET_Internal; in.type = ET_FocusOut; rc = EventToXI2((InternalEvent *) &in, &out); assert(rc == BadImplementation); in.header = ET_Internal; in.type = ET_Leave; rc = EventToXI2((InternalEvent *) &in, &out); assert(rc == BadImplementation); } static void test_convert_XIRawEvent(void) { RawDeviceEvent in; int i; memset(&in, 0, sizeof(in)); in.header = ET_Internal; in.type = ET_RawMotion; test_XIRawEvent(&in); in.header = ET_Internal; in.type = ET_RawKeyPress; test_XIRawEvent(&in); in.header = ET_Internal; in.type = ET_RawKeyRelease; test_XIRawEvent(&in); in.header = ET_Internal; in.type = ET_RawButtonPress; test_XIRawEvent(&in); in.header = ET_Internal; in.type = ET_RawButtonRelease; test_XIRawEvent(&in); in.detail.button = 1L; test_XIRawEvent(&in); in.detail.button = 1L << 8; test_XIRawEvent(&in); in.detail.button = 1L << 16; test_XIRawEvent(&in); in.detail.button = 1L << 24; test_XIRawEvent(&in); in.detail.button = ~0L; test_XIRawEvent(&in); in.detail.button = 0; in.time = 1L; test_XIRawEvent(&in); in.time = 1L << 8; test_XIRawEvent(&in); in.time = 1L << 16; test_XIRawEvent(&in); in.time = 1L << 24; test_XIRawEvent(&in); in.time = ~0L; test_XIRawEvent(&in); in.deviceid = 1; test_XIRawEvent(&in); in.deviceid = 1 << 8; test_XIRawEvent(&in); in.deviceid = ~0 & 0xFF; test_XIRawEvent(&in); for (i = 0; i < MAX_VALUATORS; i++) { XISetMask(in.valuators.mask, i); test_XIRawEvent(&in); XIClearMask(in.valuators.mask, i); } for (i = 0; i < MAX_VALUATORS; i++) { XISetMask(in.valuators.mask, i); in.valuators.data[i] = i + (i * 0.0010); in.valuators.data_raw[i] = (i + 10) + (i * 0.0030); test_XIRawEvent(&in); XIClearMask(in.valuators.mask, i); } for (i = 0; i < MAX_VALUATORS; i++) { XISetMask(in.valuators.mask, i); test_XIRawEvent(&in); } } static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent * out, BOOL swap) { int buttons, valuators; int i; unsigned char *ptr; uint32_t flagmask = 0; FP3232 *values; if (swap) { swaps(&out->sequenceNumber); swapl(&out->length); swaps(&out->evtype); swaps(&out->deviceid); swaps(&out->sourceid); swapl(&out->time); swapl(&out->detail); swapl(&out->root); swapl(&out->event); swapl(&out->child); swapl(&out->root_x); swapl(&out->root_y); swapl(&out->event_x); swapl(&out->event_y); swaps(&out->buttons_len); swaps(&out->valuators_len); swapl(&out->mods.base_mods); swapl(&out->mods.latched_mods); swapl(&out->mods.locked_mods); swapl(&out->mods.effective_mods); swapl(&out->flags); } assert(out->extension == 0); /* IReqCode defaults to 0 */ assert(out->evtype == GetXI2Type(in->type)); assert(out->time == in->time); assert(out->detail == in->detail.button); assert(out->length >= 12); assert(out->deviceid == in->deviceid); assert(out->sourceid == in->sourceid); switch (in->type) { case ET_ButtonPress: case ET_Motion: case ET_ButtonRelease: flagmask = XIPointerEmulated; break; case ET_KeyPress: flagmask = XIKeyRepeat; break; default: flagmask = 0; break; } assert((out->flags & ~flagmask) == 0); assert(out->root == in->root); assert(out->event == None); /* set in FixUpEventFromWindow */ assert(out->child == None); /* set in FixUpEventFromWindow */ assert(out->mods.base_mods == in->mods.base); assert(out->mods.latched_mods == in->mods.latched); assert(out->mods.locked_mods == in->mods.locked); assert(out->mods.effective_mods == in->mods.effective); assert(out->group.base_group == in->group.base); assert(out->group.latched_group == in->group.latched); assert(out->group.locked_group == in->group.locked); assert(out->group.effective_group == in->group.effective); assert(out->event_x == 0); /* set in FixUpEventFromWindow */ assert(out->event_y == 0); /* set in FixUpEventFromWindow */ 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++) { if (XIMaskIsSet(in->buttons, i)) { assert(out->buttons_len >= bytes_to_int32(bits_to_bytes(i))); buttons++; } } ptr = (unsigned char *) &out[1]; for (i = 0; i < sizeof(in->buttons) * 8; i++) assert(XIMaskIsSet(in->buttons, i) == XIMaskIsSet(ptr, i)); valuators = 0; for (i = 0; i < MAX_VALUATORS; i++) if (XIMaskIsSet(in->valuators.mask, i)) valuators++; assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(valuators))); ptr += out->buttons_len * 4; values = (FP3232 *) (ptr + out->valuators_len * 4); for (i = 0; i < sizeof(in->valuators.mask) * 8 || i < (out->valuators_len * 4) * 8; i++) { if (i >= MAX_VALUATORS) assert(!XIMaskIsSet(in->valuators.mask, i) && !XIMaskIsSet(ptr, i)); else if (i > sizeof(in->valuators.mask) * 8) assert(!XIMaskIsSet(ptr, i)); else if (i > out->valuators_len * 4 * 8) assert(!XIMaskIsSet(in->valuators.mask, i)); else { assert(XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); if (XIMaskIsSet(ptr, i)) { FP3232 vi, vo; vi = double_to_fp3232(in->valuators.data[i]); vo = *values; if (swap) { swapl(&vo.integral); swapl(&vo.frac); } assert(vi.integral == vo.integral); assert(vi.frac == vo.frac); values++; } } } } static void test_XIDeviceEvent(DeviceEvent *in) { xXIDeviceEvent *out, *swapped; int rc; rc = EventToXI2((InternalEvent *) in, (xEvent **) &out); assert(rc == Success); test_values_XIDeviceEvent(in, out, FALSE); swapped = calloc(1, sizeof(xEvent) + out->length * 4); XI2EventSwap((xGenericEvent *) out, (xGenericEvent *) swapped); test_values_XIDeviceEvent(in, swapped, TRUE); free(out); free(swapped); } static void test_convert_XIDeviceEvent(void) { DeviceEvent in; int i; memset(&in, 0, sizeof(in)); in.header = ET_Internal; in.type = ET_Motion; in.length = sizeof(DeviceEvent); in.time = 0; in.deviceid = 1; in.sourceid = 2; in.root = 3; in.root_x = 4; in.root_x_frac = 5; in.root_y = 6; in.root_y_frac = 7; in.detail.button = 8; in.mods.base = 9; in.mods.latched = 10; in.mods.locked = 11; in.mods.effective = 11; in.group.base = 12; in.group.latched = 13; in.group.locked = 14; in.group.effective = 15; test_XIDeviceEvent(&in); /* 32 bit */ in.detail.button = 1L; test_XIDeviceEvent(&in); in.detail.button = 1L << 8; test_XIDeviceEvent(&in); in.detail.button = 1L << 16; test_XIDeviceEvent(&in); in.detail.button = 1L << 24; test_XIDeviceEvent(&in); in.detail.button = ~0L; test_XIDeviceEvent(&in); /* 32 bit */ in.time = 1L; test_XIDeviceEvent(&in); in.time = 1L << 8; test_XIDeviceEvent(&in); in.time = 1L << 16; test_XIDeviceEvent(&in); in.time = 1L << 24; test_XIDeviceEvent(&in); in.time = ~0L; test_XIDeviceEvent(&in); /* 16 bit */ in.deviceid = 1; test_XIDeviceEvent(&in); in.deviceid = 1 << 8; test_XIDeviceEvent(&in); in.deviceid = ~0 & 0xFF; test_XIDeviceEvent(&in); /* 16 bit */ in.sourceid = 1; test_XIDeviceEvent(&in); in.deviceid = 1 << 8; test_XIDeviceEvent(&in); in.deviceid = ~0 & 0xFF; test_XIDeviceEvent(&in); /* 32 bit */ in.root = 1L; test_XIDeviceEvent(&in); in.root = 1L << 8; test_XIDeviceEvent(&in); in.root = 1L << 16; test_XIDeviceEvent(&in); in.root = 1L << 24; test_XIDeviceEvent(&in); in.root = ~0L; test_XIDeviceEvent(&in); /* 16 bit */ in.root_x = 1; test_XIDeviceEvent(&in); in.root_x = 1 << 8; test_XIDeviceEvent(&in); in.root_x = ~0 & 0xFF; test_XIDeviceEvent(&in); in.root_x_frac = 1; test_XIDeviceEvent(&in); in.root_x_frac = 1 << 8; test_XIDeviceEvent(&in); in.root_x_frac = ~0 & 0xFF; test_XIDeviceEvent(&in); in.root_y = 1; test_XIDeviceEvent(&in); in.root_y = 1 << 8; test_XIDeviceEvent(&in); in.root_y = ~0 & 0xFF; test_XIDeviceEvent(&in); in.root_y_frac = 1; test_XIDeviceEvent(&in); in.root_y_frac = 1 << 8; test_XIDeviceEvent(&in); in.root_y_frac = ~0 & 0xFF; test_XIDeviceEvent(&in); /* 32 bit */ in.mods.base = 1L; test_XIDeviceEvent(&in); in.mods.base = 1L << 8; test_XIDeviceEvent(&in); in.mods.base = 1L << 16; test_XIDeviceEvent(&in); in.mods.base = 1L << 24; test_XIDeviceEvent(&in); in.mods.base = ~0L; test_XIDeviceEvent(&in); in.mods.latched = 1L; test_XIDeviceEvent(&in); in.mods.latched = 1L << 8; test_XIDeviceEvent(&in); in.mods.latched = 1L << 16; test_XIDeviceEvent(&in); in.mods.latched = 1L << 24; test_XIDeviceEvent(&in); in.mods.latched = ~0L; test_XIDeviceEvent(&in); in.mods.locked = 1L; test_XIDeviceEvent(&in); in.mods.locked = 1L << 8; test_XIDeviceEvent(&in); in.mods.locked = 1L << 16; test_XIDeviceEvent(&in); in.mods.locked = 1L << 24; test_XIDeviceEvent(&in); in.mods.locked = ~0L; test_XIDeviceEvent(&in); in.mods.effective = 1L; test_XIDeviceEvent(&in); in.mods.effective = 1L << 8; test_XIDeviceEvent(&in); in.mods.effective = 1L << 16; test_XIDeviceEvent(&in); in.mods.effective = 1L << 24; test_XIDeviceEvent(&in); in.mods.effective = ~0L; test_XIDeviceEvent(&in); /* 8 bit */ in.group.base = 1; test_XIDeviceEvent(&in); in.group.base = ~0 & 0xFF; test_XIDeviceEvent(&in); in.group.latched = 1; test_XIDeviceEvent(&in); in.group.latched = ~0 & 0xFF; test_XIDeviceEvent(&in); in.group.locked = 1; test_XIDeviceEvent(&in); in.group.locked = ~0 & 0xFF; test_XIDeviceEvent(&in); in.mods.effective = 1; test_XIDeviceEvent(&in); in.mods.effective = ~0 & 0xFF; test_XIDeviceEvent(&in); for (i = 0; i < sizeof(in.buttons) * 8; i++) { XISetMask(in.buttons, i); test_XIDeviceEvent(&in); XIClearMask(in.buttons, i); } for (i = 0; i < sizeof(in.buttons) * 8; i++) { XISetMask(in.buttons, i); test_XIDeviceEvent(&in); } for (i = 0; i < MAX_VALUATORS; i++) { XISetMask(in.valuators.mask, i); test_XIDeviceEvent(&in); XIClearMask(in.valuators.mask, i); } for (i = 0; i < MAX_VALUATORS; i++) { XISetMask(in.valuators.mask, i); in.valuators.data[i] = i + (i * 0.0020); test_XIDeviceEvent(&in); XIClearMask(in.valuators.mask, i); } for (i = 0; i < MAX_VALUATORS; i++) { XISetMask(in.valuators.mask, i); test_XIDeviceEvent(&in); } } static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, xXIDeviceChangedEvent * out, BOOL swap) { int i, j; unsigned char *ptr; if (swap) { swaps(&out->sequenceNumber); swapl(&out->length); swaps(&out->evtype); swaps(&out->deviceid); swaps(&out->sourceid); swapl(&out->time); swaps(&out->num_classes); } 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); ptr = (unsigned char *) &out[1]; for (i = 0; i < out->num_classes; i++) { xXIAnyInfo *any = (xXIAnyInfo *) ptr; if (swap) { swaps(&any->length); swaps(&any->type); swaps(&any->sourceid); } switch (any->type) { case XIButtonClass: { xXIButtonInfo *b = (xXIButtonInfo *) any; Atom *names; if (swap) { swaps(&b->num_buttons); } assert(b->length == bytes_to_int32(sizeof(xXIButtonInfo)) + bytes_to_int32(bits_to_bytes(b->num_buttons)) + b->num_buttons); assert(b->num_buttons == in->buttons.num_buttons); names = (Atom *) ((char *) &b[1] + pad_to_int32(bits_to_bytes(b->num_buttons))); for (j = 0; j < b->num_buttons; j++) { if (swap) { swapl(&names[j]); } assert(names[j] == in->buttons.names[j]); } } break; case XIKeyClass: { xXIKeyInfo *k = (xXIKeyInfo *) any; uint32_t *kc; if (swap) { swaps(&k->num_keycodes); } assert(k->length == bytes_to_int32(sizeof(xXIKeyInfo)) + k->num_keycodes); assert(k->num_keycodes == in->keys.max_keycode - in->keys.min_keycode + 1); kc = (uint32_t *) &k[1]; for (j = 0; j < k->num_keycodes; j++) { if (swap) { swapl(&kc[j]); } assert(kc[j] >= in->keys.min_keycode); assert(kc[j] <= in->keys.max_keycode); } } break; case XIValuatorClass: { xXIValuatorInfo *v = (xXIValuatorInfo *) any; assert(v->length == bytes_to_int32(sizeof(xXIValuatorInfo))); } break; case XIScrollClass: { xXIScrollInfo *s = (xXIScrollInfo *) any; assert(s->length == bytes_to_int32(sizeof(xXIScrollInfo))); assert(s->sourceid == in->sourceid); assert(s->number < in->num_valuators); switch (s->type) { case XIScrollTypeVertical: assert(in->valuators[s->number].scroll.type == SCROLL_TYPE_VERTICAL); break; case XIScrollTypeHorizontal: assert(in->valuators[s->number].scroll.type == SCROLL_TYPE_HORIZONTAL); break; } if (s->flags & XIScrollFlagPreferred) assert(in->valuators[s->number].scroll. flags & SCROLL_FLAG_PREFERRED); } default: printf("Invalid class type.\n\n"); assert(1); break; } ptr += any->length * 4; } } static void test_XIDeviceChangedEvent(DeviceChangedEvent *in) { xXIDeviceChangedEvent *out, *swapped; int rc; rc = EventToXI2((InternalEvent *) in, (xEvent **) &out); assert(rc == Success); test_values_XIDeviceChangedEvent(in, out, FALSE); swapped = calloc(1, sizeof(xEvent) + out->length * 4); XI2EventSwap((xGenericEvent *) out, (xGenericEvent *) swapped); test_values_XIDeviceChangedEvent(in, swapped, TRUE); free(out); free(swapped); } static void test_convert_XIDeviceChangedEvent(void) { DeviceChangedEvent in; int i; memset(&in, 0, sizeof(in)); in.header = ET_Internal; in.type = ET_DeviceChanged; in.length = sizeof(DeviceChangedEvent); in.time = 0; in.deviceid = 1; in.sourceid = 2; in.masterid = 3; in.num_valuators = 4; in.flags = DEVCHANGE_SLAVE_SWITCH | DEVCHANGE_POINTER_EVENT | DEVCHANGE_KEYBOARD_EVENT; for (i = 0; i < MAX_BUTTONS; i++) in.buttons.names[i] = i + 10; in.keys.min_keycode = 8; in.keys.max_keycode = 255; test_XIDeviceChangedEvent(&in); in.time = 1L; test_XIDeviceChangedEvent(&in); in.time = 1L << 8; test_XIDeviceChangedEvent(&in); in.time = 1L << 16; test_XIDeviceChangedEvent(&in); in.time = 1L << 24; test_XIDeviceChangedEvent(&in); in.time = ~0L; test_XIDeviceChangedEvent(&in); in.deviceid = 1L; test_XIDeviceChangedEvent(&in); in.deviceid = 1L << 8; test_XIDeviceChangedEvent(&in); in.deviceid = ~0 & 0xFFFF; test_XIDeviceChangedEvent(&in); in.sourceid = 1L; test_XIDeviceChangedEvent(&in); in.sourceid = 1L << 8; test_XIDeviceChangedEvent(&in); in.sourceid = ~0 & 0xFFFF; test_XIDeviceChangedEvent(&in); in.masterid = 1L; test_XIDeviceChangedEvent(&in); in.masterid = 1L << 8; test_XIDeviceChangedEvent(&in); in.masterid = ~0 & 0xFFFF; test_XIDeviceChangedEvent(&in); in.buttons.num_buttons = 0; test_XIDeviceChangedEvent(&in); in.buttons.num_buttons = 1; test_XIDeviceChangedEvent(&in); in.buttons.num_buttons = MAX_BUTTONS; test_XIDeviceChangedEvent(&in); in.keys.min_keycode = 0; in.keys.max_keycode = 0; test_XIDeviceChangedEvent(&in); in.keys.max_keycode = 1 << 8; test_XIDeviceChangedEvent(&in); in.keys.max_keycode = 0xFFFC; /* highest range, above that the length field gives up */ test_XIDeviceChangedEvent(&in); in.keys.min_keycode = 1 << 8; in.keys.max_keycode = 1 << 8; test_XIDeviceChangedEvent(&in); in.keys.min_keycode = 1 << 8; in.keys.max_keycode = 0; test_XIDeviceChangedEvent(&in); in.num_valuators = 0; test_XIDeviceChangedEvent(&in); in.num_valuators = 1; test_XIDeviceChangedEvent(&in); in.num_valuators = MAX_VALUATORS; test_XIDeviceChangedEvent(&in); for (i = 0; i < MAX_VALUATORS; i++) { in.valuators[i].min = 0; in.valuators[i].max = 0; test_XIDeviceChangedEvent(&in); in.valuators[i].max = 1 << 8; test_XIDeviceChangedEvent(&in); in.valuators[i].max = 1 << 16; test_XIDeviceChangedEvent(&in); in.valuators[i].max = 1 << 24; test_XIDeviceChangedEvent(&in); in.valuators[i].max = abs(~0); test_XIDeviceChangedEvent(&in); in.valuators[i].resolution = 1 << 8; test_XIDeviceChangedEvent(&in); in.valuators[i].resolution = 1 << 16; test_XIDeviceChangedEvent(&in); in.valuators[i].resolution = 1 << 24; test_XIDeviceChangedEvent(&in); in.valuators[i].resolution = abs(~0); test_XIDeviceChangedEvent(&in); in.valuators[i].name = i; test_XIDeviceChangedEvent(&in); in.valuators[i].mode = Relative; test_XIDeviceChangedEvent(&in); in.valuators[i].mode = Absolute; test_XIDeviceChangedEvent(&in); } } static void test_values_XITouchOwnershipEvent(TouchOwnershipEvent *in, xXITouchOwnershipEvent * out, BOOL swap) { if (swap) { swaps(&out->sequenceNumber); swapl(&out->length); swaps(&out->evtype); swaps(&out->deviceid); swaps(&out->sourceid); swapl(&out->time); swapl(&out->touchid); swapl(&out->root); swapl(&out->event); swapl(&out->child); swapl(&out->time); } 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->touchid == in->touchid); assert(out->flags == in->reason); } static void test_XITouchOwnershipEvent(TouchOwnershipEvent *in) { xXITouchOwnershipEvent *out, *swapped; int rc; rc = EventToXI2((InternalEvent *) in, (xEvent **) &out); assert(rc == Success); test_values_XITouchOwnershipEvent(in, out, FALSE); swapped = calloc(1, sizeof(xEvent) + out->length * 4); XI2EventSwap((xGenericEvent *) out, (xGenericEvent *) swapped); test_values_XITouchOwnershipEvent(in, swapped, TRUE); free(out); free(swapped); } static void test_convert_XITouchOwnershipEvent(void) { TouchOwnershipEvent in; long i; memset(&in, 0, sizeof(in)); in.header = ET_Internal; in.type = ET_TouchOwnership; in.length = sizeof(in); in.time = 0; in.deviceid = 1; in.sourceid = 2; in.touchid = 0; in.reason = 0; in.resource = 0; in.flags = 0; test_XITouchOwnershipEvent(&in); in.flags = XIAcceptTouch; test_XITouchOwnershipEvent(&in); in.flags = XIRejectTouch; test_XITouchOwnershipEvent(&in); for (i = 1; i <= 0xFFFF; i <<= 1) { in.deviceid = i; test_XITouchOwnershipEvent(&in); } for (i = 1; i <= 0xFFFF; i <<= 1) { in.sourceid = i; test_XITouchOwnershipEvent(&in); } for (i = 1;; i <<= 1) { in.touchid = i; test_XITouchOwnershipEvent(&in); if (i == ((long) 1 << 31)) break; } } 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) { test_convert_XIRawEvent(); test_convert_XIFocusEvent(); test_convert_XIDeviceEvent(); test_convert_XIDeviceChangedEvent(); test_convert_XITouchOwnershipEvent(); test_convert_XIBarrierEvent(); return 0; } xorg-server-1.17.1/test/xi2/Makefile.in0000664000175100017510000016664612466505436014575 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@noinst_PROGRAMS = protocol-xiqueryversion$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiquerydevice$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiselectevents$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xigetselectedevents$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xisetclientpointer$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xigetclientpointer$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xipassivegrabdevice$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiquerypointer$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiwarppointer$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-eventconvert$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ xi2$(EXEEXT) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__append_1 = $(OS_LIB) $(DIX_LIB) subdir = test/xi2 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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 = PROGRAMS = $(noinst_PROGRAMS) protocol_eventconvert_SOURCES = protocol-eventconvert.c protocol_eventconvert_OBJECTS = protocol-eventconvert.$(OBJEXT) am__DEPENDENCIES_1 = @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@ $(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@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__protocol_xigetclientpointer_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xigetclientpointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am__objects_1 = protocol-common.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xigetclientpointer_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xigetclientpointer.$(OBJEXT) protocol_xigetclientpointer_OBJECTS = \ $(am_protocol_xigetclientpointer_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetclientpointer_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xigetclientpointer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xigetclientpointer_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xigetselectedevents_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xigetselectedevents.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xigetselectedevents_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xigetselectedevents.$(OBJEXT) protocol_xigetselectedevents_OBJECTS = \ $(am_protocol_xigetselectedevents_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetselectedevents_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xigetselectedevents_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xigetselectedevents_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xipassivegrabdevice_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xipassivegrabdevice.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xipassivegrabdevice_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xipassivegrabdevice.$(OBJEXT) protocol_xipassivegrabdevice_OBJECTS = \ $(am_protocol_xipassivegrabdevice_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xipassivegrabdevice_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xipassivegrabdevice_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xipassivegrabdevice_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xiquerydevice_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xiquerydevice.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xiquerydevice_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiquerydevice.$(OBJEXT) protocol_xiquerydevice_OBJECTS = $(am_protocol_xiquerydevice_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerydevice_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xiquerydevice_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xiquerydevice_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xiquerypointer_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xiquerypointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xiquerypointer_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiquerypointer.$(OBJEXT) protocol_xiquerypointer_OBJECTS = \ $(am_protocol_xiquerypointer_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerypointer_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xiquerypointer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xiquerypointer_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xiqueryversion_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xiqueryversion.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xiqueryversion_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiqueryversion.$(OBJEXT) protocol_xiqueryversion_OBJECTS = \ $(am_protocol_xiqueryversion_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiqueryversion_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xiqueryversion_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xiqueryversion_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xiselectevents_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xiselectevents.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xiselectevents_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiselectevents.$(OBJEXT) protocol_xiselectevents_OBJECTS = \ $(am_protocol_xiselectevents_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiselectevents_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xiselectevents_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xiselectevents_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xisetclientpointer_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xisetclientpointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xisetclientpointer_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xisetclientpointer.$(OBJEXT) protocol_xisetclientpointer_OBJECTS = \ $(am_protocol_xisetclientpointer_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xisetclientpointer_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xisetclientpointer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xisetclientpointer_LDFLAGS) \ $(LDFLAGS) -o $@ am__protocol_xiwarppointer_SOURCES_DIST = protocol-common.h \ protocol-common.c protocol-xiwarppointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xiwarppointer_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xiwarppointer.$(OBJEXT) protocol_xiwarppointer_OBJECTS = $(am_protocol_xiwarppointer_OBJECTS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiwarppointer_DEPENDENCIES = $(am__DEPENDENCIES_3) protocol_xiwarppointer_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(protocol_xiwarppointer_LDFLAGS) \ $(LDFLAGS) -o $@ xi2_SOURCES = xi2.c xi2_OBJECTS = xi2.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@xi2_DEPENDENCIES = $(am__DEPENDENCIES_3) xi2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xi2_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 = protocol-eventconvert.c \ $(protocol_xigetclientpointer_SOURCES) \ $(protocol_xigetselectedevents_SOURCES) \ $(protocol_xipassivegrabdevice_SOURCES) \ $(protocol_xiquerydevice_SOURCES) \ $(protocol_xiquerypointer_SOURCES) \ $(protocol_xiqueryversion_SOURCES) \ $(protocol_xiselectevents_SOURCES) \ $(protocol_xisetclientpointer_SOURCES) \ $(protocol_xiwarppointer_SOURCES) xi2.c DIST_SOURCES = protocol-eventconvert.c \ $(am__protocol_xigetclientpointer_SOURCES_DIST) \ $(am__protocol_xigetselectedevents_SOURCES_DIST) \ $(am__protocol_xipassivegrabdevice_SOURCES_DIST) \ $(am__protocol_xiquerydevice_SOURCES_DIST) \ $(am__protocol_xiquerypointer_SOURCES_DIST) \ $(am__protocol_xiqueryversion_SOURCES_DIST) \ $(am__protocol_xiselectevents_SOURCES_DIST) \ $(am__protocol_xisetclientpointer_SOURCES_DIST) \ $(am__protocol_xiwarppointer_SOURCES_DIST) xi2.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ # Print that xi2-tests were skipped (exit code 77 for automake test harness) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@TESTS = xi2-tests @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@TESTS = $(noinst_PROGRAMS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@AM_CPPFLAGS = @XORG_INCS@ @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) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerydevice_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiselectevents_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetselectedevents_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xisetclientpointer_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetclientpointer_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerypointer_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xipassivegrabdevice_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiwarppointer_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_eventconvert_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@xi2_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiqueryversion_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,WriteToClient @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerydevice_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,WriteToClient @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiselectevents_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,dixLookupWindow -Wl,-wrap,XISetEventMask @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetselectedevents_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -Wl,-wrap,AddResource @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xisetclientpointer_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,dixLookupClient @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetclientpointer_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupClient @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xipassivegrabdevice_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,GrabButton -Wl,-wrap,dixLookupWindow -Wl,-wrap,WriteToClient @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerypointer_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiwarppointer_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@xi2_LDFLAGS = $(AM_LDFLAGS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiqueryversion_SOURCES = $(COMMON_SOURCES) protocol-xiqueryversion.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerydevice_SOURCES = $(COMMON_SOURCES) protocol-xiquerydevice.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiselectevents_SOURCES = $(COMMON_SOURCES) protocol-xiselectevents.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetselectedevents_SOURCES = $(COMMON_SOURCES) protocol-xigetselectedevents.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xisetclientpointer_SOURCES = $(COMMON_SOURCES) protocol-xisetclientpointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xigetclientpointer_SOURCES = $(COMMON_SOURCES) protocol-xigetclientpointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiquerypointer_SOURCES = $(COMMON_SOURCES) protocol-xiquerypointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xipassivegrabdevice_SOURCES = $(COMMON_SOURCES) protocol-xipassivegrabdevice.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiwarppointer_SOURCES = $(COMMON_SOURCES) protocol-xiwarppointer.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@CLEANFILES = $(TESTS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(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 test/xi2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/xi2/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list protocol-eventconvert$(EXEEXT): $(protocol_eventconvert_OBJECTS) $(protocol_eventconvert_DEPENDENCIES) $(EXTRA_protocol_eventconvert_DEPENDENCIES) @rm -f protocol-eventconvert$(EXEEXT) $(AM_V_CCLD)$(LINK) $(protocol_eventconvert_OBJECTS) $(protocol_eventconvert_LDADD) $(LIBS) protocol-xigetclientpointer$(EXEEXT): $(protocol_xigetclientpointer_OBJECTS) $(protocol_xigetclientpointer_DEPENDENCIES) $(EXTRA_protocol_xigetclientpointer_DEPENDENCIES) @rm -f protocol-xigetclientpointer$(EXEEXT) $(AM_V_CCLD)$(protocol_xigetclientpointer_LINK) $(protocol_xigetclientpointer_OBJECTS) $(protocol_xigetclientpointer_LDADD) $(LIBS) protocol-xigetselectedevents$(EXEEXT): $(protocol_xigetselectedevents_OBJECTS) $(protocol_xigetselectedevents_DEPENDENCIES) $(EXTRA_protocol_xigetselectedevents_DEPENDENCIES) @rm -f protocol-xigetselectedevents$(EXEEXT) $(AM_V_CCLD)$(protocol_xigetselectedevents_LINK) $(protocol_xigetselectedevents_OBJECTS) $(protocol_xigetselectedevents_LDADD) $(LIBS) protocol-xipassivegrabdevice$(EXEEXT): $(protocol_xipassivegrabdevice_OBJECTS) $(protocol_xipassivegrabdevice_DEPENDENCIES) $(EXTRA_protocol_xipassivegrabdevice_DEPENDENCIES) @rm -f protocol-xipassivegrabdevice$(EXEEXT) $(AM_V_CCLD)$(protocol_xipassivegrabdevice_LINK) $(protocol_xipassivegrabdevice_OBJECTS) $(protocol_xipassivegrabdevice_LDADD) $(LIBS) protocol-xiquerydevice$(EXEEXT): $(protocol_xiquerydevice_OBJECTS) $(protocol_xiquerydevice_DEPENDENCIES) $(EXTRA_protocol_xiquerydevice_DEPENDENCIES) @rm -f protocol-xiquerydevice$(EXEEXT) $(AM_V_CCLD)$(protocol_xiquerydevice_LINK) $(protocol_xiquerydevice_OBJECTS) $(protocol_xiquerydevice_LDADD) $(LIBS) protocol-xiquerypointer$(EXEEXT): $(protocol_xiquerypointer_OBJECTS) $(protocol_xiquerypointer_DEPENDENCIES) $(EXTRA_protocol_xiquerypointer_DEPENDENCIES) @rm -f protocol-xiquerypointer$(EXEEXT) $(AM_V_CCLD)$(protocol_xiquerypointer_LINK) $(protocol_xiquerypointer_OBJECTS) $(protocol_xiquerypointer_LDADD) $(LIBS) protocol-xiqueryversion$(EXEEXT): $(protocol_xiqueryversion_OBJECTS) $(protocol_xiqueryversion_DEPENDENCIES) $(EXTRA_protocol_xiqueryversion_DEPENDENCIES) @rm -f protocol-xiqueryversion$(EXEEXT) $(AM_V_CCLD)$(protocol_xiqueryversion_LINK) $(protocol_xiqueryversion_OBJECTS) $(protocol_xiqueryversion_LDADD) $(LIBS) protocol-xiselectevents$(EXEEXT): $(protocol_xiselectevents_OBJECTS) $(protocol_xiselectevents_DEPENDENCIES) $(EXTRA_protocol_xiselectevents_DEPENDENCIES) @rm -f protocol-xiselectevents$(EXEEXT) $(AM_V_CCLD)$(protocol_xiselectevents_LINK) $(protocol_xiselectevents_OBJECTS) $(protocol_xiselectevents_LDADD) $(LIBS) protocol-xisetclientpointer$(EXEEXT): $(protocol_xisetclientpointer_OBJECTS) $(protocol_xisetclientpointer_DEPENDENCIES) $(EXTRA_protocol_xisetclientpointer_DEPENDENCIES) @rm -f protocol-xisetclientpointer$(EXEEXT) $(AM_V_CCLD)$(protocol_xisetclientpointer_LINK) $(protocol_xisetclientpointer_OBJECTS) $(protocol_xisetclientpointer_LDADD) $(LIBS) protocol-xiwarppointer$(EXEEXT): $(protocol_xiwarppointer_OBJECTS) $(protocol_xiwarppointer_DEPENDENCIES) $(EXTRA_protocol_xiwarppointer_DEPENDENCIES) @rm -f protocol-xiwarppointer$(EXEEXT) $(AM_V_CCLD)$(protocol_xiwarppointer_LINK) $(protocol_xiwarppointer_OBJECTS) $(protocol_xiwarppointer_LDADD) $(LIBS) xi2$(EXEEXT): $(xi2_OBJECTS) $(xi2_DEPENDENCIES) $(EXTRA_xi2_DEPENDENCIES) @rm -f xi2$(EXEEXT) $(AM_V_CCLD)$(xi2_LINK) $(xi2_OBJECTS) $(xi2_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-eventconvert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xigetclientpointer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xigetselectedevents.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xipassivegrabdevice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xiquerydevice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xiquerypointer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xiqueryversion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xiselectevents.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xisetclientpointer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xiwarppointer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xi2.Po@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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? xi2-tests.log: xi2-tests @p='xi2-tests'; \ b='xi2-tests'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xiqueryversion.log: protocol-xiqueryversion$(EXEEXT) @p='protocol-xiqueryversion$(EXEEXT)'; \ b='protocol-xiqueryversion'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xiquerydevice.log: protocol-xiquerydevice$(EXEEXT) @p='protocol-xiquerydevice$(EXEEXT)'; \ b='protocol-xiquerydevice'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xiselectevents.log: protocol-xiselectevents$(EXEEXT) @p='protocol-xiselectevents$(EXEEXT)'; \ b='protocol-xiselectevents'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xigetselectedevents.log: protocol-xigetselectedevents$(EXEEXT) @p='protocol-xigetselectedevents$(EXEEXT)'; \ b='protocol-xigetselectedevents'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xisetclientpointer.log: protocol-xisetclientpointer$(EXEEXT) @p='protocol-xisetclientpointer$(EXEEXT)'; \ b='protocol-xisetclientpointer'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xigetclientpointer.log: protocol-xigetclientpointer$(EXEEXT) @p='protocol-xigetclientpointer$(EXEEXT)'; \ b='protocol-xigetclientpointer'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xipassivegrabdevice.log: protocol-xipassivegrabdevice$(EXEEXT) @p='protocol-xipassivegrabdevice$(EXEEXT)'; \ b='protocol-xipassivegrabdevice'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xiquerypointer.log: protocol-xiquerypointer$(EXEEXT) @p='protocol-xiquerypointer$(EXEEXT)'; \ b='protocol-xiquerypointer'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xiwarppointer.log: protocol-xiwarppointer$(EXEEXT) @p='protocol-xiwarppointer$(EXEEXT)'; \ b='protocol-xiwarppointer'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-eventconvert.log: protocol-eventconvert$(EXEEXT) @p='protocol-eventconvert$(EXEEXT)'; \ b='protocol-eventconvert'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) xi2.log: xi2$(EXEEXT) @p='xi2$(EXEEXT)'; \ b='xi2'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) 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: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-noinstPROGRAMS \ 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: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am 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 \ recheck tags tags-am uninstall uninstall-am @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@xi2-tests: @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'exit 77' >> $@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ $(AM_V_GEN)chmod +x $@ # 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: xorg-server-1.17.1/test/xi2/protocol-common.c0000664000175100017510000002154412415476143016002 00000000000000/** * Copyright © 2009 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 #include "extinit.h" /* for XInputExtensionInit */ #include "exglobals.h" #include "xkbsrv.h" /* for XkbInitPrivates */ #include "xserver-properties.h" #include "syncsrv.h" #include #include "protocol-common.h" struct devices devices; ScreenRec screen; WindowRec root; WindowRec window; static ClientRec server_client; void *global_userdata; static void fake_init_sprite(DeviceIntPtr dev) { SpritePtr sprite; sprite = dev->spriteInfo->sprite; sprite->spriteTraceSize = 10; sprite->spriteTrace = calloc(sprite->spriteTraceSize, sizeof(WindowPtr)); sprite->spriteTraceGood = 1; sprite->spriteTrace[0] = &root; sprite->hot.x = SPRITE_X; sprite->hot.y = SPRITE_Y; sprite->hotPhys.x = sprite->hot.x; sprite->hotPhys.y = sprite->hot.y; sprite->win = &window; sprite->hotPhys.pScreen = &screen; sprite->physLimits.x1 = 0; sprite->physLimits.y1 = 0; sprite->physLimits.x2 = screen.width; sprite->physLimits.y2 = screen.height; } /* This is essentially CorePointerProc with ScrollAxes added */ static int TestPointerProc(DeviceIntPtr pDev, int what) { #define NBUTTONS 10 #define NAXES 4 BYTE map[NBUTTONS + 1]; int i = 0; Atom btn_labels[NBUTTONS] = { 0 }; Atom axes_labels[NAXES] = { 0 }; switch (what) { case DEVICE_INIT: for (i = 1; i <= NBUTTONS; i++) map[i] = i; btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); /* don't know about the rest */ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL); if (!InitPointerDeviceStruct ((DevicePtr) pDev, map, NBUTTONS, btn_labels, (PtrCtrlProcPtr) NoopDDA, GetMotionHistorySize(), NAXES, axes_labels)) { ErrorF("Could not initialize device '%s'. Out of memory.\n", pDev->name); return BadAlloc; } pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; pDev->last.valuators[0] = pDev->valuator->axisVal[0]; pDev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; pDev->last.valuators[1] = pDev->valuator->axisVal[1]; /* protocol-xiquerydevice.c relies on these increment */ SetScrollValuator(pDev, 2, SCROLL_TYPE_VERTICAL, 2.4, SCROLL_FLAG_NONE); SetScrollValuator(pDev, 3, SCROLL_TYPE_HORIZONTAL, 3.5, SCROLL_FLAG_PREFERRED); break; case DEVICE_CLOSE: break; default: break; } return Success; #undef NBUTTONS #undef NAXES } /** * Create and init 2 master devices (VCP + VCK) and two slave devices, one * default mouse, one default keyboard. */ struct devices init_devices(void) { ClientRec client; struct devices local_devices; int ret; /* * Put a unique name in display pointer so that when tests are run in * parallel, their xkbcomp outputs to /tmp/server-.xkm don't * stomp on each other. */ #ifdef HAVE_GETPROGNAME display = getprogname(); #elif HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME display = program_invocation_short_name; #endif client = init_client(0, NULL); AllocDevicePair(&client, "Virtual core", &local_devices.vcp, &local_devices.vck, CorePointerProc, CoreKeyboardProc, TRUE); inputInfo.pointer = local_devices.vcp; inputInfo.keyboard = local_devices.vck; ret = ActivateDevice(local_devices.vcp, FALSE); assert(ret == Success); /* This may fail if xkbcomp fails or xkb-config is not found. */ ret = ActivateDevice(local_devices.vck, FALSE); assert(ret == Success); EnableDevice(local_devices.vcp, FALSE); EnableDevice(local_devices.vck, FALSE); AllocDevicePair(&client, "", &local_devices.mouse, &local_devices.kbd, TestPointerProc, CoreKeyboardProc, FALSE); ret = ActivateDevice(local_devices.mouse, FALSE); assert(ret == Success); ret = ActivateDevice(local_devices.kbd, FALSE); assert(ret == Success); EnableDevice(local_devices.mouse, FALSE); EnableDevice(local_devices.kbd, FALSE); local_devices.num_devices = 4; local_devices.num_master_devices = 2; fake_init_sprite(local_devices.mouse); fake_init_sprite(local_devices.vcp); return local_devices; } /* Create minimal client, with the given buffer and len as request buffer */ ClientRec init_client(int len, void *data) { ClientRec client = { 0 }; /* we store the privates now and reassign it after the memset. this way * we can share them across multiple test runs and don't have to worry * about freeing them after each test run. */ client.index = CLIENT_INDEX; client.clientAsMask = CLIENT_MASK; client.sequence = CLIENT_SEQUENCE; client.req_len = len; client.requestBuffer = data; dixAllocatePrivates(&client.devPrivates, PRIVATE_CLIENT); return client; } void init_window(WindowPtr local_window, WindowPtr parent, int id) { memset(local_window, 0, sizeof(*local_window)); local_window->drawable.id = id; if (parent) { local_window->drawable.x = 30; local_window->drawable.y = 50; local_window->drawable.width = 100; local_window->drawable.height = 200; } local_window->parent = parent; local_window->optional = calloc(1, sizeof(WindowOptRec)); assert(local_window->optional); } extern DevPrivateKeyRec miPointerScreenKeyRec; extern DevPrivateKeyRec miPointerPrivKeyRec; /* Needed for the screen setup, otherwise we crash during sprite initialization */ static Bool device_cursor_init(DeviceIntPtr dev, ScreenPtr local_screen) { return TRUE; } static void device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr local_screen) { } static Bool set_cursor_pos(DeviceIntPtr dev, ScreenPtr local_screen, int x, int y, Bool event) { return TRUE; } void init_simple(void) { screenInfo.numScreens = 1; screenInfo.screens[0] = &screen; screen.myNum = 0; screen.id = 100; screen.width = 640; screen.height = 480; screen.DeviceCursorInitialize = device_cursor_init; screen.DeviceCursorCleanup = device_cursor_cleanup; screen.SetCursorPosition = set_cursor_pos; dixResetPrivates(); InitAtoms(); XkbInitPrivates(); dixRegisterPrivateKey(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)); dixRegisterPrivateKey(&miPointerScreenKeyRec, PRIVATE_SCREEN, 0); dixRegisterPrivateKey(&miPointerPrivKeyRec, PRIVATE_DEVICE, 0); XInputExtensionInit(); init_window(&root, NULL, ROOT_WINDOW_ID); init_window(&window, &root, CLIENT_WINDOW_ID); serverClient = &server_client; InitClient(serverClient, 0, (void *) NULL); if (!InitClientResources(serverClient)) /* for root resources */ FatalError("couldn't init server resources"); SyncExtensionInit(); devices = init_devices(); } void __wrap_WriteToClient(ClientPtr client, int len, void *data) { assert(reply_handler != NULL); (*reply_handler) (client, len, data, global_userdata); } xorg-server-1.17.1/test/xi2/protocol-xiwarppointer.c0000664000175100017510000001444312456571574017436 00000000000000/** * Copyright © 2009 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 /* * Protocol testing for XIWarpPointer request. */ #include #include #include #include #include "inputstr.h" #include "windowstr.h" #include "scrnintstr.h" #include "xiwarppointer.h" #include "exevents.h" #include "exglobals.h" #include "protocol-common.h" static int expected_x = SPRITE_X; static int expected_y = SPRITE_Y; /* dixLookupWindow requires a lot of setup not necessary for this test. * Simple wrapper that returns either one of the fake root window or the * fake client window. If the requested ID is neither of those wanted, * return whatever the real dixLookupWindow does. */ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) { if (id == root.drawable.id) { *win = &root; return Success; } else if (id == window.drawable.id) { *win = &window; return Success; } return __real_dixLookupWindow(win, id, client, access); } /** * This function overrides the one in the screen rec. */ static Bool ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr scr, int x, int y, Bool generateEvent) { assert(x == expected_x); assert(y == expected_y); return TRUE; } static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq * req, int error) { int rc; rc = ProcXIWarpPointer(client); assert(rc == error); if (rc == BadDevice) assert(client->errorValue == req->deviceid); else if (rc == BadWindow) assert(client->errorValue == req->dst_win || client->errorValue == req->src_win); client->swapped = TRUE; swapl(&req->src_win); swapl(&req->dst_win); swapl(&req->src_x); swapl(&req->src_y); swapl(&req->dst_x); swapl(&req->dst_y); swaps(&req->src_width); swaps(&req->src_height); swaps(&req->deviceid); rc = SProcXIWarpPointer(client); assert(rc == error); if (rc == BadDevice) assert(client->errorValue == req->deviceid); else if (rc == BadWindow) assert(client->errorValue == req->dst_win || client->errorValue == req->src_win); client->swapped = FALSE; } static void test_XIWarpPointer(void) { int i; ClientRec client_request; xXIWarpPointerReq request; memset(&request, 0, sizeof(request)); request_init(&request, XIWarpPointer); client_request = init_client(request.length, &request); request.deviceid = XIAllDevices; request_XIWarpPointer(&client_request, &request, BadDevice); request.deviceid = XIAllMasterDevices; request_XIWarpPointer(&client_request, &request, BadDevice); request.src_win = root.drawable.id; request.dst_win = root.drawable.id; request.deviceid = devices.vcp->id; request_XIWarpPointer(&client_request, &request, Success); request.deviceid = devices.vck->id; request_XIWarpPointer(&client_request, &request, BadDevice); request.deviceid = devices.mouse->id; request_XIWarpPointer(&client_request, &request, BadDevice); request.deviceid = devices.kbd->id; request_XIWarpPointer(&client_request, &request, BadDevice); devices.mouse->master = NULL; /* Float, kind-of */ request.deviceid = devices.mouse->id; request_XIWarpPointer(&client_request, &request, Success); for (i = devices.kbd->id + 1; i <= 0xFFFF; i++) { request.deviceid = i; request_XIWarpPointer(&client_request, &request, BadDevice); } request.src_win = window.drawable.id; request.deviceid = devices.vcp->id; request_XIWarpPointer(&client_request, &request, Success); request.deviceid = devices.mouse->id; request_XIWarpPointer(&client_request, &request, Success); request.src_win = root.drawable.id; request.dst_win = 0xFFFF; /* invalid window */ request_XIWarpPointer(&client_request, &request, BadWindow); request.src_win = 0xFFFF; /* invalid window */ request.dst_win = root.drawable.id; request_XIWarpPointer(&client_request, &request, BadWindow); request.src_win = None; request.dst_win = None; request.dst_y = 0; expected_y = SPRITE_Y; request.dst_x = 1 << 16; expected_x = SPRITE_X + 1; request.deviceid = devices.vcp->id; request_XIWarpPointer(&client_request, &request, Success); request.dst_x = -1 << 16; expected_x = SPRITE_X - 1; request.deviceid = devices.vcp->id; request_XIWarpPointer(&client_request, &request, Success); request.dst_x = 0; expected_x = SPRITE_X; request.dst_y = 1 << 16; expected_y = SPRITE_Y + 1; request.deviceid = devices.vcp->id; request_XIWarpPointer(&client_request, &request, Success); request.dst_y = -1 << 16; expected_y = SPRITE_Y - 1; request.deviceid = devices.vcp->id; request_XIWarpPointer(&client_request, &request, Success); /* FIXME: src_x/y checks */ client_request.req_len -= 2; /* invalid length */ request_XIWarpPointer(&client_request, &request, BadLength); } int main(int argc, char **argv) { init_simple(); screen.SetCursorPosition = ScreenSetCursorPosition; test_XIWarpPointer(); return 0; } xorg-server-1.17.1/test/xi2/protocol-xipassivegrabdevice.c0000664000175100017510000001756712456571574020564 00000000000000/** * Copyright © 2011 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 /* * Protocol testing for XIPassiveGrab request. */ #include #include #include #include #include "inputstr.h" #include "windowstr.h" #include "scrnintstr.h" #include "xipassivegrab.h" #include "exevents.h" #include "exglobals.h" #include "protocol-common.h" static ClientRec client_request; #define N_MODS 7 static uint32_t modifiers[N_MODS] = { 1, 2, 3, 4, 5, 6, 7 }; struct test_data { int num_modifiers; } testdata; int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, int button, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask); static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *closure); int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) { if (id == root.drawable.id) { *win = &root; return Success; } else if (id == window.drawable.id) { *win = &window; return Success; } return __real_dixLookupWindow(win, id, client, access); } int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, int button, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask) { /* Fail every odd modifier */ if (param->modifiers % 2) return BadAccess; return Success; } static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *closure) { xXIPassiveGrabDeviceReply *rep = (xXIPassiveGrabDeviceReply *) data; if (client->swapped) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_modifiers); testdata.num_modifiers = rep->num_modifiers; } reply_check_defaults(rep, len, XIPassiveGrabDevice); /* ProcXIPassiveGrabDevice sends the data in two batches, let the second * handler handle the modifier data */ if (rep->num_modifiers > 0) reply_handler = reply_XIPassiveGrabDevice_data; } static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *closure) { int i; xXIGrabModifierInfo *mods = (xXIGrabModifierInfo *) data; for (i = 0; i < testdata.num_modifiers; i++, mods++) { if (client->swapped) swapl(&mods->modifiers); /* 1 - 7 is the range we use for the global modifiers array * above */ assert(mods->modifiers > 0); assert(mods->modifiers <= 7); assert(mods->modifiers % 2 == 1); /* because we fail odd ones */ assert(mods->status != Success); assert(mods->pad0 == 0); assert(mods->pad1 == 0); } reply_handler = reply_XIPassiveGrabDevice; } static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req, int error, int errval) { int rc; int local_modifiers; int mask_len; client_request.req_len = req->length; rc = ProcXIPassiveGrabDevice(&client_request); assert(rc == error); if (rc != Success) assert(client_request.errorValue == errval); client_request.swapped = TRUE; swaps(&req->length); swapl(&req->time); swapl(&req->grab_window); swapl(&req->cursor); swapl(&req->detail); swaps(&req->deviceid); local_modifiers = req->num_modifiers; swaps(&req->num_modifiers); mask_len = req->mask_len; swaps(&req->mask_len); while (local_modifiers--) { CARD32 *mod = (CARD32 *) (req + 1) + mask_len + local_modifiers; swapl(mod); } rc = SProcXIPassiveGrabDevice(&client_request); assert(rc == error); if (rc != Success) assert(client_request.errorValue == errval); } static unsigned char *data[4096]; /* the request buffer */ static void test_XIPassiveGrabDevice(void) { int i; xXIPassiveGrabDeviceReq *request = (xXIPassiveGrabDeviceReq *) data; unsigned char *mask; request_init(request, XIPassiveGrabDevice); request->grab_window = CLIENT_WINDOW_ID; reply_handler = reply_XIPassiveGrabDevice; client_request = init_client(request->length, request); printf("Testing invalid device\n"); request->deviceid = 12; request_XIPassiveGrabDevice(&client_request, request, BadDevice, request->deviceid); printf("Testing invalid length\n"); request->length -= 2; request_XIPassiveGrabDevice(&client_request, request, BadLength, client_request.errorValue); /* re-init request since swapped length test leaves some values swapped */ request_init(request, XIPassiveGrabDevice); request->grab_window = CLIENT_WINDOW_ID; request->deviceid = XIAllMasterDevices; printf("Testing invalid grab types\n"); for (i = XIGrabtypeTouchBegin + 1; i < 0xFF; i++) { request->grab_type = i; request_XIPassiveGrabDevice(&client_request, request, BadValue, request->grab_type); } printf("Testing invalid grab type + detail combinations\n"); request->grab_type = XIGrabtypeEnter; request->detail = 1; request_XIPassiveGrabDevice(&client_request, request, BadValue, request->detail); request->grab_type = XIGrabtypeFocusIn; request_XIPassiveGrabDevice(&client_request, request, BadValue, request->detail); request->detail = 0; printf("Testing invalid masks\n"); mask = (unsigned char *) &request[1]; request->mask_len = bytes_to_int32(XI2LASTEVENT + 1); request->length += request->mask_len; SetBit(mask, XI2LASTEVENT + 1); request_XIPassiveGrabDevice(&client_request, request, BadValue, XI2LASTEVENT + 1); ClearBit(mask, XI2LASTEVENT + 1); /* tested all special cases now, test a few valid cases */ /* no modifiers */ request->deviceid = XIAllDevices; request->grab_type = XIGrabtypeButton; request->detail = XIAnyButton; request_XIPassiveGrabDevice(&client_request, request, Success, 0); /* Set a few random masks to make sure we handle modifiers correctly */ SetBit(mask, XI_ButtonPress); SetBit(mask, XI_KeyPress); SetBit(mask, XI_Enter); /* some modifiers */ request->num_modifiers = N_MODS; request->length += N_MODS; memcpy((uint32_t *) (request + 1) + request->mask_len, modifiers, sizeof(modifiers)); request_XIPassiveGrabDevice(&client_request, request, Success, 0); } int main(int argc, char **argv) { init_simple(); test_XIPassiveGrabDevice(); return 0; } xorg-server-1.17.1/test/xi2/protocol-xigetclientpointer.c0000664000175100017510000001117112456571574020436 00000000000000/** * Copyright © 2009 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 /* * Protocol testing for XIGetClientPointer request. */ #include #include #include #include #include "inputstr.h" #include "windowstr.h" #include "scrnintstr.h" #include "xigetclientpointer.h" #include "exevents.h" #include "protocol-common.h" struct { int cp_is_set; DeviceIntPtr dev; int win; } test_data; static ClientRec client_window; static ClientRec client_request; int __wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access) { if (rid == ROOT_WINDOW_ID) return BadWindow; if (rid == CLIENT_WINDOW_ID) { *pClient = &client_window; return Success; } return __real_dixLookupClient(pClient, rid, client, access); } static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void *userdata) { xXIGetClientPointerReply *rep = (xXIGetClientPointerReply *) data; if (client->swapped) { swapl(&rep->length); swaps(&rep->sequenceNumber); swaps(&rep->deviceid); } reply_check_defaults(rep, len, XIGetClientPointer); assert(rep->set == test_data.cp_is_set); if (rep->set) assert(rep->deviceid == test_data.dev->id); } static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq * req, int error) { int rc; test_data.win = req->win; rc = ProcXIGetClientPointer(&client_request); assert(rc == error); if (rc == BadWindow) assert(client_request.errorValue == req->win); client_request.swapped = TRUE; swapl(&req->win); swaps(&req->length); rc = SProcXIGetClientPointer(&client_request); assert(rc == error); if (rc == BadWindow) assert(client_request.errorValue == req->win); } static void test_XIGetClientPointer(void) { xXIGetClientPointerReq request; request_init(&request, XIGetClientPointer); request.win = CLIENT_WINDOW_ID; reply_handler = reply_XIGetClientPointer; client_request = init_client(request.length, &request); printf("Testing invalid window\n"); request.win = INVALID_WINDOW_ID; request_XIGetClientPointer(&client_request, &request, BadWindow); printf("Testing invalid length\n"); client_request.req_len -= 4; request_XIGetClientPointer(&client_request, &request, BadLength); client_request.req_len += 4; test_data.cp_is_set = FALSE; printf("Testing window None, unset ClientPointer.\n"); request.win = None; request_XIGetClientPointer(&client_request, &request, Success); printf("Testing valid window, unset ClientPointer.\n"); request.win = CLIENT_WINDOW_ID; request_XIGetClientPointer(&client_request, &request, Success); printf("Testing valid window, set ClientPointer.\n"); client_window.clientPtr = devices.vcp; test_data.dev = devices.vcp; test_data.cp_is_set = TRUE; request.win = CLIENT_WINDOW_ID; request_XIGetClientPointer(&client_request, &request, Success); client_window.clientPtr = NULL; printf("Testing window None, set ClientPointer.\n"); client_request.clientPtr = devices.vcp; test_data.dev = devices.vcp; test_data.cp_is_set = TRUE; request.win = None; request_XIGetClientPointer(&client_request, &request, Success); } int main(int argc, char **argv) { init_simple(); client_window = init_client(0, NULL); test_XIGetClientPointer(); return 0; } xorg-server-1.17.1/test/xfree86.c0000664000175100017510000000571512274325512013436 00000000000000/** * Copyright © 2011 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 "xf86.h" #include "xf86Parser.h" static void xfree86_option_list_duplicate(void) { XF86OptionPtr options; XF86OptionPtr duplicate; const char *o1 = "foo", *o2 = "bar", *v1 = "one", *v2 = "two"; const char *o_null = "NULL"; char *val1, *val2; XF86OptionPtr a, b; duplicate = xf86OptionListDuplicate(NULL); assert(!duplicate); options = xf86AddNewOption(NULL, o1, v1); assert(options); options = xf86AddNewOption(options, o2, v2); assert(options); options = xf86AddNewOption(options, o_null, NULL); assert(options); duplicate = xf86OptionListDuplicate(options); assert(duplicate); val1 = xf86CheckStrOption(options, o1, "1"); val2 = xf86CheckStrOption(duplicate, o1, "2"); assert(strcmp(val1, v1) == 0); assert(strcmp(val1, val2) == 0); val1 = xf86CheckStrOption(options, o2, "1"); val2 = xf86CheckStrOption(duplicate, o2, "2"); assert(strcmp(val1, v2) == 0); assert(strcmp(val1, val2) == 0); a = xf86FindOption(options, o_null); b = xf86FindOption(duplicate, o_null); assert(a && b); } static void xfree86_add_comment(void) { char *current = NULL; const char *comment; char compare[1024] = { 0 }; comment = "# foo"; current = xf86addComment(current, comment); strcpy(compare, comment); strcat(compare, "\n"); assert(!strcmp(current, compare)); /* this used to overflow */ strcpy(current, "\n"); comment = "foobar\n"; current = xf86addComment(current, comment); strcpy(compare, "\n#"); strcat(compare, comment); assert(!strcmp(current, compare)); free(current); } int main(int argc, char **argv) { xfree86_option_list_duplicate(); xfree86_add_comment(); return 0; } xorg-server-1.17.1/test/misc.c0000664000175100017510000001230212456571574013105 00000000000000/** * Copyright © 2011 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 "misc.h" #include "scrnintstr.h" #include "dix.h" #include "dixstruct.h" ScreenInfo screenInfo; static void dix_version_compare(void) { int rc; rc = version_compare(0, 0, 1, 0); assert(rc < 0); rc = version_compare(1, 0, 0, 0); assert(rc > 0); rc = version_compare(0, 0, 0, 0); assert(rc == 0); rc = version_compare(1, 0, 1, 0); assert(rc == 0); rc = version_compare(1, 0, 0, 9); assert(rc > 0); rc = version_compare(0, 9, 1, 0); assert(rc < 0); rc = version_compare(1, 0, 1, 9); assert(rc < 0); rc = version_compare(1, 9, 1, 0); assert(rc > 0); rc = version_compare(2, 0, 1, 9); assert(rc > 0); rc = version_compare(1, 9, 2, 0); assert(rc < 0); } static void dix_update_desktop_dimensions(void) { int i; int x, y, w, h; int w2, h2; ScreenRec screens[MAXSCREENS]; for (i = 0; i < MAXSCREENS; i++) screenInfo.screens[i] = &screens[i]; x = 0; y = 0; w = 10; h = 5; w2 = 35; h2 = 25; #define assert_dimensions(_x, _y, _w, _h) \ update_desktop_dimensions(); \ assert(screenInfo.x == _x); \ assert(screenInfo.y == _y); \ assert(screenInfo.width == _w); \ assert(screenInfo.height == _h); #define set_screen(idx, _x, _y, _w, _h) \ screenInfo.screens[idx]->x = _x; \ screenInfo.screens[idx]->y = _y; \ screenInfo.screens[idx]->width = _w; \ screenInfo.screens[idx]->height = _h; \ /* single screen */ screenInfo.numScreens = 1; set_screen(0, x, y, w, h); assert_dimensions(x, y, w, h); /* dualhead rightof */ screenInfo.numScreens = 2; set_screen(1, w, 0, w2, h2); assert_dimensions(x, y, w + w2, h2); /* dualhead belowof */ screenInfo.numScreens = 2; set_screen(1, 0, h, w2, h2); assert_dimensions(x, y, w2, h + h2); /* triplehead L shape */ screenInfo.numScreens = 3; set_screen(1, 0, h, w2, h2); set_screen(2, w2, h2, w, h); assert_dimensions(x, y, w + w2, h + h2); /* quadhead 2x2 */ screenInfo.numScreens = 4; set_screen(1, 0, h, w, h); set_screen(2, w, h, w, h2); set_screen(3, w, 0, w2, h); assert_dimensions(x, y, w + w2, h + h2); /* quadhead horiz line */ screenInfo.numScreens = 4; set_screen(1, w, 0, w, h); set_screen(2, 2 * w, 0, w, h); set_screen(3, 3 * w, 0, w, h); assert_dimensions(x, y, 4 * w, h); /* quadhead vert line */ screenInfo.numScreens = 4; set_screen(1, 0, h, w, h); set_screen(2, 0, 2 * h, w, h); set_screen(3, 0, 3 * h, w, h); assert_dimensions(x, y, w, 4 * h); /* x overlap */ screenInfo.numScreens = 2; set_screen(0, 0, 0, w2, h2); set_screen(1, w, 0, w2, h2); assert_dimensions(x, y, w2 + w, h2); /* y overlap */ screenInfo.numScreens = 2; set_screen(0, 0, 0, w2, h2); set_screen(1, 0, h, w2, h2); assert_dimensions(x, y, w2, h2 + h); /* negative origin */ screenInfo.numScreens = 1; set_screen(0, -w2, -h2, w, h); assert_dimensions(-w2, -h2, w, h); /* dualhead negative origin, overlap */ screenInfo.numScreens = 2; set_screen(0, -w2, -h2, w2, h2); set_screen(1, -w, -h, w, h); assert_dimensions(-w2, -h2, w2, h2); } static int dix_request_fixed_size_overflow(ClientRec *client) { xReq req = { 0 }; client->req_len = req.length = 1; REQUEST_FIXED_SIZE(req, SIZE_MAX); return Success; } static int dix_request_fixed_size_match(ClientRec *client) { xReq req = { 0 }; client->req_len = req.length = 9; REQUEST_FIXED_SIZE(req, 30); return Success; } static void dix_request_size_checks(void) { ClientRec client = { 0 }; int rc; rc = dix_request_fixed_size_overflow(&client); assert(rc == BadLength); rc = dix_request_fixed_size_match(&client); assert(rc == Success); } int main(int argc, char **argv) { dix_version_compare(); dix_update_desktop_dimensions(); dix_request_size_checks(); return 0; } xorg-server-1.17.1/test/ddxstubs.c0000664000175100017510000000451712274325512014006 00000000000000/** * Copyright © 2012 Apple 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. */ /* This file contains stubs for some symbols which are usually provided by a * DDX. These stubs should allow the unit tests to build on platforms with * stricter linkers (eg: darwin) when the Xorg DDX is not built. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "input.h" #include "mi.h" void DDXRingBell(int volume, int pitch, int duration) { } void ProcessInputEvents(void) { mieqProcessInputEvents(); } void OsVendorInit(void) { } void OsVendorFatalError(const char *f, va_list args) { } void AbortDDX(enum ExitCode error) { OsAbort(); } void ddxUseMsg(void) { } int ddxProcessArgument(int argc, char *argv[], int i) { return 0; } void ddxGiveUp(enum ExitCode error) { } Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) { return TRUE; } #ifdef XQUARTZ #include BOOL serverRunning = TRUE; pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; int darwinMainScreenX = 0; int darwinMainScreenY = 0; BOOL no_configure_window = FALSE; void darwinEvents_lock(void) { } void darwinEvents_unlock(void) { } #endif #ifdef DDXBEFORERESET void ddxBeforeReset(void) { } #endif xorg-server-1.17.1/test/list.c0000664000175100017510000002347512404747323013130 00000000000000/** * Copyright © 2011 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 #include #include #include struct parent { int a; struct xorg_list children; int b; }; struct child { int foo; int bar; struct xorg_list node; }; static void test_xorg_list_init(void) { struct parent parent, tmp; memset(&parent, 0, sizeof(parent)); parent.a = 0xa5a5a5; parent.b = ~0xa5a5a5; tmp = parent; xorg_list_init(&parent.children); /* test we haven't touched anything else. */ assert(parent.a == tmp.a); assert(parent.b == tmp.b); assert(xorg_list_is_empty(&parent.children)); } static void test_xorg_list_add(void) { struct parent parent = { 0 }; struct child child[3]; struct child *c; xorg_list_init(&parent.children); xorg_list_add(&child[0].node, &parent.children); assert(!xorg_list_is_empty(&parent.children)); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[0], sizeof(struct child)) == 0); /* note: xorg_list_add prepends */ xorg_list_add(&child[1].node, &parent.children); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[1], sizeof(struct child)) == 0); xorg_list_add(&child[2].node, &parent.children); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[2], sizeof(struct child)) == 0); }; static void test_xorg_list_append(void) { struct parent parent = { 0 }; struct child child[3]; struct child *c; int i; xorg_list_init(&parent.children); xorg_list_append(&child[0].node, &parent.children); assert(!xorg_list_is_empty(&parent.children)); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[0], sizeof(struct child)) == 0); c = xorg_list_last_entry(&parent.children, struct child, node); assert(memcmp(c, &child[0], sizeof(struct child)) == 0); xorg_list_append(&child[1].node, &parent.children); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[0], sizeof(struct child)) == 0); c = xorg_list_last_entry(&parent.children, struct child, node); assert(memcmp(c, &child[1], sizeof(struct child)) == 0); xorg_list_append(&child[2].node, &parent.children); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[0], sizeof(struct child)) == 0); c = xorg_list_last_entry(&parent.children, struct child, node); assert(memcmp(c, &child[2], sizeof(struct child)) == 0); i = 0; xorg_list_for_each_entry(c, &parent.children, node) { assert(memcmp(c, &child[i++], sizeof(struct child)) == 0); } }; static void test_xorg_list_del(void) { struct parent parent = { 0 }; struct child child[2]; struct child *c; xorg_list_init(&parent.children); xorg_list_add(&child[0].node, &parent.children); assert(!xorg_list_is_empty(&parent.children)); xorg_list_del(&parent.children); assert(xorg_list_is_empty(&parent.children)); xorg_list_add(&child[0].node, &parent.children); xorg_list_del(&child[0].node); assert(xorg_list_is_empty(&parent.children)); xorg_list_add(&child[0].node, &parent.children); xorg_list_add(&child[1].node, &parent.children); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[1], sizeof(struct child)) == 0); /* delete first node */ xorg_list_del(&child[1].node); assert(!xorg_list_is_empty(&parent.children)); assert(xorg_list_is_empty(&child[1].node)); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[0], sizeof(struct child)) == 0); /* delete last node */ xorg_list_add(&child[1].node, &parent.children); xorg_list_del(&child[0].node); c = xorg_list_first_entry(&parent.children, struct child, node); assert(memcmp(c, &child[1], sizeof(struct child)) == 0); /* delete list head */ 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)); } static void test_xorg_list_for_each(void) { struct parent parent = { 0 }; struct child child[3]; struct child *c; int i = 0; xorg_list_init(&parent.children); xorg_list_add(&child[2].node, &parent.children); xorg_list_add(&child[1].node, &parent.children); xorg_list_add(&child[0].node, &parent.children); xorg_list_for_each_entry(c, &parent.children, node) { assert(memcmp(c, &child[i], sizeof(struct child)) == 0); i++; } /* foreach on empty list */ xorg_list_del(&parent.children); assert(xorg_list_is_empty(&parent.children)); xorg_list_for_each_entry(c, &parent.children, node) { assert(0); /* we must not get here */ } } struct foo { char a; struct foo *next; char b; }; static void test_nt_list_init(void) { struct foo foo; foo.a = 10; foo.b = 20; nt_list_init(&foo, next); assert(foo.a == 10); assert(foo.b == 20); assert(foo.next == NULL); assert(nt_list_next(&foo, next) == NULL); } static void test_nt_list_append(void) { int i; struct foo *foo = calloc(10, sizeof(struct foo)); struct foo *item; for (item = foo, i = 1; i <= 10; i++, item++) { item->a = i; item->b = i * 2; nt_list_init(item, next); if (item != foo) nt_list_append(item, foo, struct foo, next); } /* Test using nt_list_next */ for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) { assert(item->a == i); assert(item->b == i * 2); } /* Test using nt_list_for_each_entry */ i = 1; nt_list_for_each_entry(item, foo, next) { assert(item->a == i); assert(item->b == i * 2); i++; } assert(i == 11); } static void test_nt_list_insert(void) { int i; struct foo *foo = calloc(10, sizeof(struct foo)); struct foo *item; foo->a = 1; foo->b = 2; nt_list_init(foo, next); for (item = &foo[1], i = 10; i > 1; i--, item++) { item->a = i; item->b = i * 2; nt_list_init(item, next); nt_list_insert(item, foo, struct foo, next); } /* Test using nt_list_next */ for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) { assert(item->a == i); assert(item->b == i * 2); } /* Test using nt_list_for_each_entry */ i = 1; nt_list_for_each_entry(item, foo, next) { assert(item->a == i); assert(item->b == i * 2); i++; } assert(i == 11); } static void test_nt_list_delete(void) { int i = 1; struct foo *list = calloc(10, sizeof(struct foo)); struct foo *foo = list; struct foo *item, *tmp; struct foo *empty_list = foo; nt_list_init(empty_list, next); nt_list_del(empty_list, empty_list, struct foo, next); assert(!empty_list); for (item = foo, i = 1; i <= 10; i++, item++) { item->a = i; item->b = i * 2; nt_list_init(item, next); if (item != foo) nt_list_append(item, foo, struct foo, next); } i = 0; nt_list_for_each_entry(item, foo, next) { i++; } assert(i == 10); /* delete last item */ nt_list_del(&foo[9], foo, struct foo, next); i = 0; nt_list_for_each_entry(item, foo, next) { assert(item->a != 10); /* element 10 is gone now */ i++; } assert(i == 9); /* 9 elements left */ /* delete second item */ nt_list_del(foo->next, foo, struct foo, next); assert(foo->next->a == 3); i = 0; nt_list_for_each_entry(item, foo, next) { assert(item->a != 10); /* element 10 is gone now */ assert(item->a != 2); /* element 2 is gone now */ i++; } assert(i == 8); /* 9 elements left */ item = foo; /* delete first item */ nt_list_del(foo, foo, struct foo, next); assert(item != foo); assert(item->next == NULL); assert(foo->a == 3); assert(foo->next->a == 4); nt_list_for_each_entry_safe(item, tmp, foo, next) { nt_list_del(item, foo, struct foo, next); } assert(!foo); assert(!item); free(list); } int main(int argc, char **argv) { test_xorg_list_init(); test_xorg_list_add(); test_xorg_list_append(); test_xorg_list_del(); test_xorg_list_for_each(); test_nt_list_init(); test_nt_list_append(); test_nt_list_insert(); test_nt_list_delete(); return 0; } xorg-server-1.17.1/test/xi1/0000775000175100017510000000000012466505446012565 500000000000000xorg-server-1.17.1/test/xi1/Makefile.am0000664000175100017510000000165012456571574014547 00000000000000if ENABLE_UNIT_TESTS if HAVE_LD_WRAP noinst_PROGRAMS = \ protocol-xchangedevicecontrol TESTS=$(noinst_PROGRAMS) TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = @XORG_INCS@ -I$(srcdir)/../xi2 TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) COMMON_SOURCES=$(srcdir)/../xi2/protocol-common.c if SPECIAL_DTRACE_OBJECTS TEST_LDADD += $(OS_LIB) $(DIX_LIB) endif protocol_xchangedevicecontrol_LDADD=$(TEST_LDADD) protocol_xchangedevicecontrol_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient protocol_xchangedevicecontrol_SOURCES=$(COMMON_SOURCES) protocol-xchangedevicecontrol.c else # Print that xi1-tests were skipped (exit code 77 for automake test harness) TESTS = xi1-tests CLEANFILES = $(TESTS) xi1-tests: @echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@ @echo 'exit 77' >> $@ $(AM_V_GEN)chmod +x $@ endif endif xorg-server-1.17.1/test/xi1/protocol-xchangedevicecontrol.c0000664000175100017510000000740712456571574020722 00000000000000/** * Copyright (c) 2014, Oracle and/or its affiliates. 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 (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 /* * Protocol testing for ChangeDeviceControl request. */ #include #include #include #include #include "inputstr.h" #include "chgdctl.h" #include "protocol-common.h" static ClientRec client_request; static void reply_ChangeDeviceControl(ClientPtr client, int len, char *data, void *userdata) { xChangeDeviceControlReply *rep = (xChangeDeviceControlReply *) data; if (client->swapped) { swapl(&rep->length); swaps(&rep->sequenceNumber); } reply_check_defaults(rep, len, ChangeDeviceControl); /* XXX: check status code in reply */ } static void request_ChangeDeviceControl(ClientPtr client, xChangeDeviceControlReq * req, xDeviceCtl *ctl, int error) { int rc; client_request.req_len = req->length; rc = ProcXChangeDeviceControl(&client_request); assert(rc == error); /* XXX: ChangeDeviceControl doesn't seem to fill in errorValue to check */ client_request.swapped = TRUE; swaps(&req->length); swaps(&req->control); swaps(&ctl->length); swaps(&ctl->control); /* XXX: swap other contents of ctl, depending on type */ rc = SProcXChangeDeviceControl(&client_request); assert(rc == error); } static unsigned char *data[4096]; /* the request buffer */ static void test_ChangeDeviceControl(void) { xChangeDeviceControlReq *request = (xChangeDeviceControlReq *) data; xDeviceCtl *control = (xDeviceCtl *) (&request[1]); request_init(request, ChangeDeviceControl); reply_handler = reply_ChangeDeviceControl; client_request = init_client(request->length, request); printf("Testing invalid lengths:\n"); printf(" -- no control struct\n"); request_ChangeDeviceControl(&client_request, request, control, BadLength); printf(" -- xDeviceResolutionCtl\n"); request_init(request, ChangeDeviceControl); request->control = DEVICE_RESOLUTION; control->length = (sizeof(xDeviceResolutionCtl) >> 2); request->length += control->length - 2; request_ChangeDeviceControl(&client_request, request, control, BadLength); printf(" -- xDeviceEnableCtl\n"); request_init(request, ChangeDeviceControl); request->control = DEVICE_ENABLE; control->length = (sizeof(xDeviceEnableCtl) >> 2); request->length += control->length - 2; request_ChangeDeviceControl(&client_request, request, control, BadLength); /* XXX: Test functionality! */ } int main(int argc, char **argv) { init_simple(); test_ChangeDeviceControl(); return 0; } xorg-server-1.17.1/test/xi1/Makefile.in0000664000175100017510000012713712466505436014564 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@noinst_PROGRAMS = protocol-xchangedevicecontrol$(EXEEXT) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__append_1 = $(OS_LIB) $(DIX_LIB) subdir = test/xi1 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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 = PROGRAMS = $(noinst_PROGRAMS) am__protocol_xchangedevicecontrol_SOURCES_DIST = \ $(srcdir)/../xi2/protocol-common.c \ protocol-xchangedevicecontrol.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am__objects_1 = protocol-common.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am_protocol_xchangedevicecontrol_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__objects_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ protocol-xchangedevicecontrol.$(OBJEXT) protocol_xchangedevicecontrol_OBJECTS = \ $(am_protocol_xchangedevicecontrol_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@ $(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_xchangedevicecontrol_DEPENDENCIES = $(am__DEPENDENCIES_3) 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 = protocol_xchangedevicecontrol_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(protocol_xchangedevicecontrol_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 = $(protocol_xchangedevicecontrol_SOURCES) DIST_SOURCES = $(am__protocol_xchangedevicecontrol_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ # Print that xi1-tests were skipped (exit code 77 for automake test harness) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@TESTS = xi1-tests @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@TESTS = $(noinst_PROGRAMS) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@AM_CPPFLAGS = @XORG_INCS@ -I$(srcdir)/../xi2 @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 = $(srcdir)/../xi2/protocol-common.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xchangedevicecontrol_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xchangedevicecontrol_LDFLAGS = $(AM_LDFLAGS) -Wl,-wrap,WriteToClient @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xchangedevicecontrol_SOURCES = $(COMMON_SOURCES) protocol-xchangedevicecontrol.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@CLEANFILES = $(TESTS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(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 test/xi1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/xi1/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list protocol-xchangedevicecontrol$(EXEEXT): $(protocol_xchangedevicecontrol_OBJECTS) $(protocol_xchangedevicecontrol_DEPENDENCIES) $(EXTRA_protocol_xchangedevicecontrol_DEPENDENCIES) @rm -f protocol-xchangedevicecontrol$(EXEEXT) $(AM_V_CCLD)$(protocol_xchangedevicecontrol_LINK) $(protocol_xchangedevicecontrol_OBJECTS) $(protocol_xchangedevicecontrol_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-xchangedevicecontrol.Po@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 -o $@ $< .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 -o $@ `$(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 $@ $< protocol-common.o: $(srcdir)/../xi2/protocol-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT protocol-common.o -MD -MP -MF $(DEPDIR)/protocol-common.Tpo -c -o protocol-common.o `test -f '$(srcdir)/../xi2/protocol-common.c' || echo '$(srcdir)/'`$(srcdir)/../xi2/protocol-common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/protocol-common.Tpo $(DEPDIR)/protocol-common.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../xi2/protocol-common.c' object='protocol-common.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o protocol-common.o `test -f '$(srcdir)/../xi2/protocol-common.c' || echo '$(srcdir)/'`$(srcdir)/../xi2/protocol-common.c protocol-common.obj: $(srcdir)/../xi2/protocol-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol-common.Tpo -c -o protocol-common.obj `if test -f '$(srcdir)/../xi2/protocol-common.c'; then $(CYGPATH_W) '$(srcdir)/../xi2/protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../xi2/protocol-common.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/protocol-common.Tpo $(DEPDIR)/protocol-common.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../xi2/protocol-common.c' object='protocol-common.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o protocol-common.obj `if test -f '$(srcdir)/../xi2/protocol-common.c'; then $(CYGPATH_W) '$(srcdir)/../xi2/protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../xi2/protocol-common.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? xi1-tests.log: xi1-tests @p='xi1-tests'; \ b='xi1-tests'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) protocol-xchangedevicecontrol.log: protocol-xchangedevicecontrol$(EXEEXT) @p='protocol-xchangedevicecontrol$(EXEEXT)'; \ b='protocol-xchangedevicecontrol'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) 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: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-noinstPROGRAMS \ 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: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am 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 \ recheck tags tags-am uninstall uninstall-am @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@xi1-tests: @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ @echo 'exit 77' >> $@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_FALSE@ $(AM_V_GEN)chmod +x $@ # 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: xorg-server-1.17.1/test/hashtabletest.c0000664000175100017510000000565712323563340015005 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "hashtable.h" #include "resource.h" static void print_xid(void* ptr, void* v) { XID *x = v; printf("%ld", (long)(*x)); } static void print_int(void* ptr, void* v) { int *x = v; printf("%d", *x); } static int test1(void) { HashTable h; 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; XID 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; 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) { XID 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; } xorg-server-1.17.1/test/Makefile.in0000664000175100017510000017137312466505436014064 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @ENABLE_UNIT_TESTS_TRUE@noinst_PROGRAMS = list$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@ string$(EXEEXT) $(am__EXEEXT_1) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_2) # 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 = xi1 xi2 @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 os signal-logging touch @ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__append_3 = hashtabletest @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_4 = -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 -I$(top_srcdir)/hw/xfree86/dri \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3 @ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__append_5 = $(OS_LIB) $(DIX_LIB) @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_6 = \ @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 \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ddc/libddc.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ @XORG_LIBS@ @DRI_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_7 = $(top_builddir)/hw/xfree86/dri/libdri.la @DRI2_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_8 = $(top_builddir)/hw/xfree86/dri2/libdri2.la @DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_9 = $(top_builddir)/dri3/libdri3.la @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_10 = \ @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 \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/miext/damage/libdamage.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/miext/sync/libsync.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/randr/librandr.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/render/librender.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXext.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXextdpmsstubs.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xi/libXi.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xi/libXistubs.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xfixes/libxfixes.la \ @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_11 = \ @COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/composite/libcomposite.la @DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_12 = \ @DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/dbe/libdbe.la @ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@am__append_13 = \ @ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@ $(top_builddir)/glx/libglx.la @ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@am__append_14 = \ @ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@ $(top_builddir)/record/librecord.la @DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_15 = \ @DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/dri3/libdri3.la @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_16 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@ $(top_builddir)/miext/rootless/librootless.la @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_17 = -lXplugin @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_18 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@ $(top_builddir)/miext/rootless/librootless.la subdir = test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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__DEPENDENCIES_1 = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/hw/xfree86/loader/libloader.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ddc/libddc.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@nodist_libxservertest_la_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ ddxstubs.lo miinitext.lo @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@nodist_libxservertest_la_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ sdksyms.lo libxservertest_la_OBJECTS = $(nodist_libxservertest_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 = @ENABLE_UNIT_TESTS_TRUE@am_libxservertest_la_rpath = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__EXEEXT_1 = xkb$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ input$(EXEEXT) \ @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@ os$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ signal-logging$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ touch$(EXEEXT) @ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__EXEEXT_2 = hashtabletest$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) fixes_SOURCES = fixes.c fixes_OBJECTS = fixes.$(OBJEXT) @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) input_SOURCES = input.c input_OBJECTS = input.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@input_DEPENDENCIES = $(am__DEPENDENCIES_4) list_SOURCES = list.c list_OBJECTS = list.$(OBJEXT) list_LDADD = $(LDADD) 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) touch_SOURCES = touch.c touch_OBJECTS = touch.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@touch_DEPENDENCIES = $(am__DEPENDENCIES_4) xfree86_SOURCES = xfree86.c xfree86_OBJECTS = xfree86.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@xfree86_DEPENDENCIES = $(am__DEPENDENCIES_4) xkb_SOURCES = xkb.c xkb_OBJECTS = xkb.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@xkb_DEPENDENCIES = $(am__DEPENDENCIES_4) xtest_SOURCES = xtest.c xtest_OBJECTS = xtest.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@xtest_DEPENDENCIES = $(am__DEPENDENCIES_4) 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 = $(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 cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ check recheck distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DIST_SUBDIRS = . xi1 xi2 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @ENABLE_UNIT_TESTS_TRUE@SUBDIRS = . $(am__append_1) @ENABLE_UNIT_TESTS_TRUE@check_LTLIBRARIES = libxservertest.la @ENABLE_UNIT_TESTS_TRUE@TESTS = $(noinst_PROGRAMS) @ENABLE_UNIT_TESTS_TRUE@TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) @ENABLE_UNIT_TESTS_TRUE@AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ @ENABLE_UNIT_TESTS_TRUE@AM_CPPFLAGS = $(XORG_INCS) \ @ENABLE_UNIT_TESTS_TRUE@ -I$(top_srcdir)/miext/cw \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_4) @ENABLE_UNIT_TESTS_TRUE@TEST_LDADD = libxservertest.la \ @ENABLE_UNIT_TESTS_TRUE@ $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) \ @ENABLE_UNIT_TESTS_TRUE@ $(GLX_SYS_LIBS) $(am__append_5) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_17) @ENABLE_UNIT_TESTS_TRUE@xkb_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@input_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@xtest_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@misc_LDADD = $(TEST_LDADD) @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) @ENABLE_UNIT_TESTS_TRUE@os_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@libxservertest_la_LIBADD = $(XSERVER_LIBS) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_6) $(am__append_7) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_8) $(am__append_9) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_10) $(am__append_11) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_12) $(am__append_13) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_14) $(am__append_15) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_16) $(am__append_18) @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 @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@nodist_libxservertest_la_SOURCES = sdksyms.c @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@BUILT_SOURCES = sdksyms.c @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@CLEANFILES = sdksyms.c @ENABLE_UNIT_TESTS_TRUE@libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) EXTRA_DIST = ddxstubs.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(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 test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_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}; \ } libxservertest.la: $(libxservertest_la_OBJECTS) $(libxservertest_la_DEPENDENCIES) $(EXTRA_libxservertest_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libxservertest_la_rpath) $(libxservertest_la_OBJECTS) $(libxservertest_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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) list$(EXEEXT): $(list_OBJECTS) $(list_DEPENDENCIES) $(EXTRA_list_DEPENDENCIES) @rm -f list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(list_OBJECTS) $(list_LDADD) $(LIBS) 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) touch$(EXEEXT): $(touch_OBJECTS) $(touch_DEPENDENCIES) $(EXTRA_touch_DEPENDENCIES) @rm -f touch$(EXEEXT) $(AM_V_CCLD)$(LINK) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) xfree86$(EXEEXT): $(xfree86_OBJECTS) $(xfree86_DEPENDENCIES) $(EXTRA_xfree86_DEPENDENCIES) @rm -f xfree86$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xfree86_OBJECTS) $(xfree86_LDADD) $(LIBS) xkb$(EXEEXT): $(xkb_OBJECTS) $(xkb_DEPENDENCIES) $(EXTRA_xkb_DEPENDENCIES) @rm -f xkb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xkb_OBJECTS) $(xkb_LDADD) $(LIBS) xtest$(EXEEXT): $(xtest_OBJECTS) $(xtest_DEPENDENCIES) $(EXTRA_xtest_DEPENDENCIES) @rm -f xtest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xtest_OBJECTS) $(xtest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxstubs.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)/touch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfree86.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtest.Po@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 -o $@ $< .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 -o $@ `$(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 $@ $< miinitext.lo: $(top_srcdir)/mi/miinitext.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) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.lo -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/mi/miinitext.c' object='miinitext.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) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c mostlyclean-libtool: -rm -f *.lo 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_LTLIBRARIES) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? list.log: list$(EXEEXT) @p='list$(EXEEXT)'; \ b='list'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) string.log: string$(EXEEXT) @p='string$(EXEEXT)'; \ b='string'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) xkb.log: xkb$(EXEEXT) @p='xkb$(EXEEXT)'; \ b='xkb'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) input.log: input$(EXEEXT) @p='input$(EXEEXT)'; \ b='input'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) xtest.log: xtest$(EXEEXT) @p='xtest$(EXEEXT)'; \ b='xtest'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) misc.log: misc$(EXEEXT) @p='misc$(EXEEXT)'; \ b='misc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) fixes.log: fixes$(EXEEXT) @p='fixes$(EXEEXT)'; \ b='fixes'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) xfree86.log: xfree86$(EXEEXT) @p='xfree86$(EXEEXT)'; \ b='xfree86'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) os.log: os$(EXEEXT) @p='os$(EXEEXT)'; \ b='os'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) signal-logging.log: signal-logging$(EXEEXT) @p='signal-logging$(EXEEXT)'; \ b='signal-logging'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) touch.log: touch$(EXEEXT) @p='touch$(EXEEXT)'; \ b='touch'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) hashtabletest.log: hashtabletest$(EXEEXT) @p='hashtabletest$(EXEEXT)'; \ b='hashtabletest'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 @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 $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all check check-am install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-TESTS check-am clean clean-checkLTLIBRARIES \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am 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 installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.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: xorg-server-1.17.1/test/xkb.c0000664000175100017510000001260612323563340012726 00000000000000/** * Copyright © 2009 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 #include #include #include #include #include #include #include #include #include "misc.h" #include "inputstr.h" #include "opaque.h" #include "property.h" #define XKBSRV_NEED_FILE_FUNCS #include #include "../xkb/xkbgeom.h" #include #include "xkbfile.h" #include "../xkb/xkb.h" #include /** * Initialize an empty XkbRMLVOSet. * Call XkbGetRulesDflts to obtain the default ruleset. * Compare obtained ruleset with the built-in defaults. * * Result: RMLVO defaults are the same as obtained. */ static void xkb_get_rules_test(void) { XkbRMLVOSet rmlvo = { NULL }; XkbGetRulesDflts(&rmlvo); assert(rmlvo.rules); assert(rmlvo.model); assert(rmlvo.layout); assert(rmlvo.variant); assert(rmlvo.options); assert(strcmp(rmlvo.rules, XKB_DFLT_RULES) == 0); assert(strcmp(rmlvo.model, XKB_DFLT_MODEL) == 0); assert(strcmp(rmlvo.layout, XKB_DFLT_LAYOUT) == 0); assert(strcmp(rmlvo.variant, XKB_DFLT_VARIANT) == 0); assert(strcmp(rmlvo.options, XKB_DFLT_OPTIONS) == 0); } /** * Initialize an random XkbRMLVOSet. * Call XkbGetRulesDflts to obtain the default ruleset. * Compare obtained ruleset with the built-in defaults. * Result: RMLVO defaults are the same as obtained. */ static void xkb_set_rules_test(void) { XkbRMLVOSet rmlvo; XkbRMLVOSet rmlvo_new = { NULL }; XkbInitRules(&rmlvo, "test-rules", "test-model", "test-layout", "test-variant", "test-options"); assert(rmlvo.rules); assert(rmlvo.model); assert(rmlvo.layout); assert(rmlvo.variant); assert(rmlvo.options); XkbSetRulesDflts(&rmlvo); XkbGetRulesDflts(&rmlvo_new); /* XkbGetRulesDflts strdups the values */ assert(rmlvo.rules != rmlvo_new.rules); assert(rmlvo.model != rmlvo_new.model); assert(rmlvo.layout != rmlvo_new.layout); assert(rmlvo.variant != rmlvo_new.variant); assert(rmlvo.options != rmlvo_new.options); assert(strcmp(rmlvo.rules, rmlvo_new.rules) == 0); assert(strcmp(rmlvo.model, rmlvo_new.model) == 0); assert(strcmp(rmlvo.layout, rmlvo_new.layout) == 0); assert(strcmp(rmlvo.variant, rmlvo_new.variant) == 0); assert(strcmp(rmlvo.options, rmlvo_new.options) == 0); XkbFreeRMLVOSet(&rmlvo, FALSE); } /** * Get the default RMLVO set. * Set the default RMLVO set. * Get the default RMLVO set. * Repeat the last two steps. * * Result: RMLVO set obtained is the same as previously set. */ static void xkb_set_get_rules_test(void) { /* This test failed before XkbGetRulesDftlts changed to strdup. We test this twice because the first time using XkbGetRulesDflts we obtain the built-in defaults. The unexpected free isn't triggered until the second XkbSetRulesDefaults. */ XkbRMLVOSet rmlvo = { NULL }; XkbRMLVOSet rmlvo_backup; XkbGetRulesDflts(&rmlvo); /* pass 1 */ XkbSetRulesDflts(&rmlvo); XkbGetRulesDflts(&rmlvo); /* Make a backup copy */ rmlvo_backup.rules = strdup(rmlvo.rules); rmlvo_backup.layout = strdup(rmlvo.layout); rmlvo_backup.model = strdup(rmlvo.model); rmlvo_backup.variant = strdup(rmlvo.variant); rmlvo_backup.options = strdup(rmlvo.options); /* pass 2 */ XkbSetRulesDflts(&rmlvo); /* This test is iffy, because strictly we may be comparing against already * freed memory */ assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0); assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0); assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0); assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0); assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0); XkbGetRulesDflts(&rmlvo); assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0); assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0); assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0); assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0); assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0); } int main(int argc, char **argv) { xkb_set_get_rules_test(); xkb_get_rules_test(); xkb_set_rules_test(); return 0; } xorg-server-1.17.1/test/xtest.c0000664000175100017510000000761212274325512013314 00000000000000/** * Copyright © 2009 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 #include "input.h" #include "inputstr.h" #include "scrnintstr.h" #include "exevents.h" #include "extinit.h" #include "xkbsrv.h" #include "xserver-properties.h" #include "syncsrv.h" /** */ /* from Xext/xtest.c */ extern DeviceIntPtr xtestpointer, xtestkeyboard; /* Needed for the screen setup, otherwise we crash during sprite initialization */ static Bool 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)); screenInfo.numScreens = 1; screenInfo.screens[0] = &screen; screen.myNum = 0; screen.id = 100; screen.width = 640; screen.height = 480; screen.DeviceCursorInitialize = device_cursor_init; screen.DeviceCursorCleanup = device_cursor_cleanup; dixResetPrivates(); serverClient = &server_client; InitClient(serverClient, 0, (void *) NULL); if (!InitClientResources(serverClient)) /* for root resources */ FatalError("couldn't init server resources"); InitAtoms(); SyncExtensionInit(); /* this also inits the xtest devices */ InitCoreDevices(); assert(xtestpointer); assert(xtestkeyboard); assert(IsXTestDevice(xtestpointer, NULL)); assert(IsXTestDevice(xtestkeyboard, NULL)); assert(IsXTestDevice(xtestpointer, inputInfo.pointer)); assert(IsXTestDevice(xtestkeyboard, inputInfo.keyboard)); assert(GetXTestDevice(inputInfo.pointer) == xtestpointer); assert(GetXTestDevice(inputInfo.keyboard) == xtestkeyboard); } /** * Each xtest devices has a property attached marking it. This property * cannot be changed. */ static void xtest_properties(void) { int rc; char value = 1; XIPropertyValuePtr prop; Atom xtest_prop = XIGetKnownProperty(XI_PROP_XTEST_DEVICE); rc = XIGetDeviceProperty(xtestpointer, xtest_prop, &prop); assert(rc == Success); assert(prop); rc = XIGetDeviceProperty(xtestkeyboard, xtest_prop, &prop); assert(rc == Success); assert(prop != NULL); rc = XIChangeDeviceProperty(xtestpointer, xtest_prop, XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE); assert(rc == BadAccess); rc = XIChangeDeviceProperty(xtestkeyboard, xtest_prop, XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE); assert(rc == BadAccess); } int main(int argc, char **argv) { xtest_init_devices(); xtest_properties(); return 0; } xorg-server-1.17.1/test/signal-logging.c0000664000175100017510000003121412406737373015052 00000000000000/** * 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", (intmax_t) 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", (intmax_t) 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", (intmax_t) 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 }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Woverflow" 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 pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" #pragma GCC diagnostic ignored "-Wformat" #pragma GCC diagnostic ignored "-Wformat-extra-args" 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; long li; unsigned long lui; 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) do { \ msg = fgets(read_buf, sizeof(read_buf), f); \ assert(msg != NULL); \ msg = strchr(read_buf, ']'); \ assert(msg != NULL); \ assert(strlen(msg) > 2); \ msg = msg + 2; /* advance past [time.stamp] */ \ } while (0) /* 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); /* literal % */ LogMessageVerbSigSafe(X_ERROR, -1, "test %%\n"); read_log_msg(logmsg); assert(strcmp(logmsg, "(EE) test %\n") == 0); /* character */ LogMessageVerbSigSafe(X_ERROR, -1, "test %c\n", 'a'); read_log_msg(logmsg); assert(strcmp(logmsg, "(EE) test a\n") == 0); /* something unsupported % */ LogMessageVerbSigSafe(X_ERROR, -1, "test %Q\n"); read_log_msg(logmsg); assert(strstr(logmsg, "BUG") != NULL); LogMessageVerbSigSafe(X_ERROR, -1, "\n"); fseek(f, 0, SEEK_END); /* string substitution */ LogMessageVerbSigSafe(X_ERROR, -1, "%s\n", "substituted string"); read_log_msg(logmsg); assert(strcmp(logmsg, "(EE) substituted string\n") == 0); /* Invalid format */ 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); /* %hld is bogus */ LogMessageVerbSigSafe(X_ERROR, -1, "%hld\n", 4); read_log_msg(logmsg); assert(strstr(logmsg, "BUG") != NULL); 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); 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); lui = 0; do { char expected[30]; sprintf(expected, "(EE) %lu\n", lui); LogMessageVerbSigSafe(X_ERROR, -1, "%lu\n", lui); read_log_msg(logmsg); sprintf(expected, "(EE) %lld\n", (unsigned long long)ui); LogMessageVerbSigSafe(X_ERROR, -1, "%lld\n", (unsigned long long)ui); read_log_msg(logmsg); assert(strcmp(logmsg, expected) == 0); sprintf(expected, "(EE) %lx\n", lui); printf("%s\n", expected); LogMessageVerbSigSafe(X_ERROR, -1, "%lx\n", lui); read_log_msg(logmsg); assert(strcmp(logmsg, expected) == 0); sprintf(expected, "(EE) %llx\n", (unsigned long long)ui); LogMessageVerbSigSafe(X_ERROR, -1, "%llx\n", (unsigned long long)ui); read_log_msg(logmsg); assert(strcmp(logmsg, expected) == 0); if (lui == 0) lui = 1; else lui <<= 1; } while(lui); /* 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); li = 0; do { char expected[30]; sprintf(expected, "(EE) %ld\n", li); LogMessageVerbSigSafe(X_ERROR, -1, "%ld\n", li); read_log_msg(logmsg); assert(strcmp(logmsg, expected) == 0); sprintf(expected, "(EE) %ld\n", li | LONG_MIN); LogMessageVerbSigSafe(X_ERROR, -1, "%ld\n", li | LONG_MIN); read_log_msg(logmsg); assert(strcmp(logmsg, expected) == 0); sprintf(expected, "(EE) %lld\n", (long long)li); LogMessageVerbSigSafe(X_ERROR, -1, "%lld\n", (long long)li); read_log_msg(logmsg); assert(strcmp(logmsg, expected) == 0); sprintf(expected, "(EE) %lld\n", (long long)(li | LONG_MIN)); LogMessageVerbSigSafe(X_ERROR, -1, "%lld\n", (long long)(li | LONG_MIN)); read_log_msg(logmsg); assert(strcmp(logmsg, expected) == 0); if (li == 0) li = 1; else li <<= 1; } while(li > LONG_MIN); /* 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]; #ifdef __sun /* Solaris doesn't autoadd "0x" to %p format */ sprintf(expected, "(EE) 0x%p\n", (void*)ptr); #else sprintf(expected, "(EE) %p\n", (void*)ptr); #endif 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; } xorg-server-1.17.1/test/touch.c0000664000175100017510000001677112323563340013273 00000000000000/** * Copyright © 2011 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 "inputstr.h" #include "assert.h" #include "scrnintstr.h" static void touch_grow_queue(void) { DeviceIntRec dev; ValuatorClassRec val; TouchClassRec touch; size_t size, new_size; int i; memset(&dev, 0, sizeof(dev)); dev.name = xnfstrdup("test device"); dev.id = 2; dev.valuator = &val; val.numAxes = 5; dev.touch = &touch; inputInfo.devices = &dev; size = 5; dev.last.num_touches = size; dev.last.touches = calloc(dev.last.num_touches, sizeof(*dev.last.touches)); assert(dev.last.touches); for (i = 0; i < size; i++) { dev.last.touches[i].active = TRUE; dev.last.touches[i].ddx_id = i; dev.last.touches[i].client_id = i * 2; } /* no more space, should've scheduled a workproc */ assert(TouchBeginDDXTouch(&dev, 1234) == NULL); ProcessWorkQueue(); new_size = size + size / 2 + 1; assert(dev.last.num_touches == new_size); /* make sure we haven't touched those */ for (i = 0; i < size; i++) { DDXTouchPointInfoPtr t = &dev.last.touches[i]; assert(t->active == TRUE); assert(t->ddx_id == i); assert(t->client_id == i * 2); } /* make sure those are zero-initialized */ for (i = size; i < new_size; i++) { DDXTouchPointInfoPtr t = &dev.last.touches[i]; assert(t->active == FALSE); assert(t->client_id == 0); assert(t->ddx_id == 0); } free(dev.name); } static void touch_find_ddxid(void) { DeviceIntRec dev; DDXTouchPointInfoPtr ti; ValuatorClassRec val; TouchClassRec touch; int size = 5; int i; memset(&dev, 0, sizeof(dev)); dev.name = xnfstrdup("test device"); dev.id = 2; dev.valuator = &val; val.numAxes = 5; dev.touch = &touch; dev.last.num_touches = size; dev.last.touches = calloc(dev.last.num_touches, sizeof(*dev.last.touches)); inputInfo.devices = &dev; assert(dev.last.touches); dev.last.touches[0].active = TRUE; dev.last.touches[0].ddx_id = 10; dev.last.touches[0].client_id = 20; /* existing */ ti = TouchFindByDDXID(&dev, 10, FALSE); assert(ti == &dev.last.touches[0]); /* non-existing */ ti = TouchFindByDDXID(&dev, 20, FALSE); assert(ti == NULL); /* Non-active */ dev.last.touches[0].active = FALSE; ti = TouchFindByDDXID(&dev, 10, FALSE); assert(ti == NULL); /* create on number 2 */ dev.last.touches[0].active = TRUE; ti = TouchFindByDDXID(&dev, 20, TRUE); assert(ti == &dev.last.touches[1]); assert(ti->active); assert(ti->ddx_id == 20); /* set all to active */ for (i = 0; i < size; i++) dev.last.touches[i].active = TRUE; /* Try to create more, fail */ ti = TouchFindByDDXID(&dev, 30, TRUE); assert(ti == NULL); ti = TouchFindByDDXID(&dev, 30, TRUE); assert(ti == NULL); /* make sure we haven't resized, we're in the signal handler */ assert(dev.last.num_touches == size); /* stop one touchpoint, try to create, succeed */ dev.last.touches[2].active = FALSE; ti = TouchFindByDDXID(&dev, 30, TRUE); assert(ti == &dev.last.touches[2]); /* but still grow anyway */ ProcessWorkQueue(); ti = TouchFindByDDXID(&dev, 40, TRUE); assert(ti == &dev.last.touches[size]); free(dev.name); } static void touch_begin_ddxtouch(void) { DeviceIntRec dev; DDXTouchPointInfoPtr ti; ValuatorClassRec val; TouchClassRec touch; int ddx_id = 123; unsigned int last_client_id = 0; int size = 5; memset(&dev, 0, sizeof(dev)); dev.name = xnfstrdup("test device"); dev.id = 2; dev.valuator = &val; val.numAxes = 5; touch.mode = XIDirectTouch; dev.touch = &touch; dev.last.num_touches = size; dev.last.touches = calloc(dev.last.num_touches, sizeof(*dev.last.touches)); inputInfo.devices = &dev; assert(dev.last.touches); ti = TouchBeginDDXTouch(&dev, ddx_id); assert(ti); assert(ti->ddx_id == ddx_id); /* client_id == ddx_id can happen in real life, but not in this test */ assert(ti->client_id != ddx_id); assert(ti->active); assert(ti->client_id > last_client_id); assert(ti->emulate_pointer); last_client_id = ti->client_id; ddx_id += 10; ti = TouchBeginDDXTouch(&dev, ddx_id); assert(ti); assert(ti->ddx_id == ddx_id); /* client_id == ddx_id can happen in real life, but not in this test */ assert(ti->client_id != ddx_id); assert(ti->active); assert(ti->client_id > last_client_id); assert(!ti->emulate_pointer); last_client_id = ti->client_id; free(dev.name); } static void touch_begin_touch(void) { DeviceIntRec dev; TouchClassRec touch; ValuatorClassRec val; TouchPointInfoPtr ti; int touchid = 12434; int sourceid = 23; SpriteInfoRec sprite; ScreenRec screen; screenInfo.screens[0] = &screen; memset(&dev, 0, sizeof(dev)); dev.name = xnfstrdup("test device"); dev.id = 2; memset(&sprite, 0, sizeof(sprite)); dev.spriteInfo = &sprite; memset(&touch, 0, sizeof(touch)); touch.num_touches = 0; memset(&val, 0, sizeof(val)); dev.valuator = &val; val.numAxes = 2; ti = TouchBeginTouch(&dev, sourceid, touchid, TRUE); assert(!ti); dev.touch = &touch; ti = TouchBeginTouch(&dev, sourceid, touchid, TRUE); assert(ti); assert(ti->client_id == touchid); assert(ti->active); assert(ti->sourceid == sourceid); assert(ti->emulate_pointer); assert(touch.num_touches == 1); free(dev.name); } static void touch_init(void) { DeviceIntRec dev; Atom labels[2] = { 0 }; int rc; SpriteInfoRec sprite; ScreenRec screen; screenInfo.screens[0] = &screen; memset(&dev, 0, sizeof(dev)); dev.name = xnfstrdup("test device"); memset(&sprite, 0, sizeof(sprite)); dev.spriteInfo = &sprite; InitAtoms(); rc = InitTouchClassDeviceStruct(&dev, 1, XIDirectTouch, 2); assert(rc == FALSE); InitValuatorClassDeviceStruct(&dev, 2, labels, 10, Absolute); rc = InitTouchClassDeviceStruct(&dev, 1, XIDirectTouch, 2); assert(rc == TRUE); assert(dev.touch); free(dev.name); } int main(int argc, char **argv) { touch_grow_queue(); touch_find_ddxid(); touch_begin_ddxtouch(); touch_init(); touch_begin_touch(); return 0; } xorg-server-1.17.1/test/fixes.c0000664000175100017510000002273312274325512013264 00000000000000/** * Copyright © 2011 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 #include #include #include static void _fixes_test_direction(struct PointerBarrier *barrier, int d[4], int permitted) { BOOL blocking; int i, j; int dir = barrier_get_direction(d[0], d[1], d[2], d[3]); barrier->directions = 0; blocking = barrier_is_blocking_direction(barrier, dir); assert(blocking); for (j = 0; j <= BarrierNegativeY; j++) { for (i = 0; i <= BarrierNegativeY; i++) { barrier->directions |= 1 << i; blocking = barrier_is_blocking_direction(barrier, dir); assert((barrier->directions & permitted) == permitted ? !blocking : blocking); } } } static void fixes_pointer_barrier_direction_test(void) { struct PointerBarrier barrier; int x = 100; int y = 100; int directions[8][4] = { {x, y, x, y + 100}, /* S */ {x + 50, y, x - 50, y + 100}, /* SW */ {x + 100, y, x, y}, /* W */ {x + 100, y + 50, x, y - 50}, /* NW */ {x, y + 100, x, y}, /* N */ {x - 50, y + 100, x + 50, y}, /* NE */ {x, y, x + 100, y}, /* E */ {x, y - 50, x + 100, y + 50}, /* SE */ }; barrier.x1 = x; barrier.x2 = x; barrier.y1 = y - 50; barrier.y2 = y + 49; _fixes_test_direction(&barrier, directions[0], BarrierPositiveY); _fixes_test_direction(&barrier, directions[1], BarrierPositiveY | BarrierNegativeX); _fixes_test_direction(&barrier, directions[2], BarrierNegativeX); _fixes_test_direction(&barrier, directions[3], BarrierNegativeY | BarrierNegativeX); _fixes_test_direction(&barrier, directions[4], BarrierNegativeY); _fixes_test_direction(&barrier, directions[5], BarrierPositiveX | BarrierNegativeY); _fixes_test_direction(&barrier, directions[6], BarrierPositiveX); _fixes_test_direction(&barrier, directions[7], BarrierPositiveY | BarrierPositiveX); } static void fixes_pointer_barriers_test(void) { struct PointerBarrier barrier; int x1, y1, x2, y2; double distance; int x = 100; int y = 100; /* vert barrier */ barrier.x1 = x; barrier.x2 = x; barrier.y1 = y - 50; barrier.y2 = y + 50; /* across at half-way */ x1 = x + 1; x2 = x - 1; y1 = y; y2 = y; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); assert(distance == 1); /* definitely not across */ x1 = x + 10; x2 = x + 5; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* across, but outside of y range */ x1 = x + 1; x2 = x - 1; y1 = y + 100; y2 = y + 100; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* across, diagonally */ x1 = x + 5; x2 = x - 5; y1 = y + 5; y2 = y - 5; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* across but outside boundary, diagonally */ x1 = x + 5; x2 = x - 5; y1 = y + 100; y2 = y + 50; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: startpoint of movement on barrier → blocking */ x1 = x; x2 = x - 1; y1 = y; y2 = y; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: startpoint of movement on barrier → not blocking, positive */ x1 = x; x2 = x + 1; y1 = y; y2 = y; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: startpoint of movement on barrier → not blocking, negative */ x1 = x - 1; x2 = x - 2; y1 = y; y2 = y; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: endpoint of movement on barrier → blocking */ x1 = x + 1; x2 = x; y1 = y; y2 = y; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* startpoint on barrier but outside y range */ x1 = x; x2 = x - 1; y1 = y + 100; y2 = y + 100; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* endpoint on barrier but outside y range */ x1 = x + 1; x2 = x; y1 = y + 100; y2 = y + 100; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* horizontal barrier */ barrier.x1 = x - 50; barrier.x2 = x + 50; barrier.y1 = y; barrier.y2 = y; /* across at half-way */ x1 = x; x2 = x; y1 = y - 1; y2 = y + 1; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* definitely not across */ y1 = y + 10; y2 = y + 5; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* across, but outside of y range */ x1 = x + 100; x2 = x + 100; y1 = y + 1; y2 = y - 1; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* across, diagonally */ y1 = y + 5; y2 = y - 5; x1 = x + 5; x2 = x - 5; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* across but outside boundary, diagonally */ y1 = y + 5; y2 = y - 5; x1 = x + 100; x2 = x + 50; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: startpoint of movement on barrier → blocking */ y1 = y; y2 = y - 1; x1 = x; x2 = x; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: startpoint of movement on barrier → not blocking, positive */ y1 = y; y2 = y + 1; x1 = x; x2 = x; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: startpoint of movement on barrier → not blocking, negative */ y1 = y - 1; y2 = y - 2; x1 = x; x2 = x; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* edge case: endpoint of movement on barrier → blocking */ y1 = y + 1; y2 = y; x1 = x; x2 = x; assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* startpoint on barrier but outside y range */ y1 = y; y2 = y - 1; x1 = x + 100; x2 = x + 100; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); /* endpoint on barrier but outside y range */ y1 = y + 1; y2 = y; x1 = x + 100; 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 fixes_pointer_barrier_clamp_test(void) { struct PointerBarrier barrier; int x = 100; int y = 100; int cx, cy; /* clamped */ /* vert barrier */ barrier.x1 = x; barrier.x2 = x; barrier.y1 = y - 50; barrier.y2 = y + 49; barrier.directions = 0; cx = INT_MAX; cy = INT_MAX; barrier_clamp_to_barrier(&barrier, BarrierPositiveX, &cx, &cy); assert(cx == barrier.x1 - 1); assert(cy == INT_MAX); cx = 0; cy = INT_MAX; barrier_clamp_to_barrier(&barrier, BarrierNegativeX, &cx, &cy); assert(cx == barrier.x1); assert(cy == INT_MAX); /* horiz barrier */ barrier.x1 = x - 50; barrier.x2 = x + 49; barrier.y1 = y; barrier.y2 = y; barrier.directions = 0; cx = INT_MAX; cy = INT_MAX; barrier_clamp_to_barrier(&barrier, BarrierPositiveY, &cx, &cy); assert(cx == INT_MAX); assert(cy == barrier.y1 - 1); cx = INT_MAX; cy = 0; barrier_clamp_to_barrier(&barrier, BarrierNegativeY, &cx, &cy); assert(cx == INT_MAX); assert(cy == barrier.y1); } int main(int argc, char **argv) { fixes_pointer_barriers_test(); fixes_pointer_barrier_direction_test(); fixes_pointer_barrier_clamp_test(); return 0; } xorg-server-1.17.1/xorg-server.pc.in0000664000175100017510000000073712366220413014233 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ moduledir=@moduledir@ sdkdir=@sdkdir@ sysconfigdir=@sysconfigdir@ abi_ansic=@abi_ansic@ abi_videodrv=@abi_videodrv@ abi_xinput=@abi_xinput@ abi_extension=@abi_extension@ Name: xorg-server Description: Modular X.Org X Server Version: @PACKAGE_VERSION@ Requires.private: @SDK_REQUIRED_MODULES@ Cflags: -I${sdkdir} @symbol_visibility@ Libs: -L${libdir} @XORG_DRIVER_LIBS@ xorg-server-1.17.1/xkb/0000775000175100017510000000000012466505444011667 500000000000000xorg-server-1.17.1/xkb/Makefile.am0000664000175100017510000000160612160102336013626 00000000000000noinst_LTLIBRARIES = libxkb.la libxkbstubs.la AM_CFLAGS = $(DIX_CFLAGS) DDX_SRCS = \ ddxBeep.c \ ddxCtrls.c \ ddxLEDs.c \ ddxLoad.c DIX_SRCS = \ xkb.c \ xkbUtils.c \ xkbEvents.c \ xkbAccessX.c \ xkbSwap.c \ xkbLEDs.c \ xkbInit.c \ xkbActions.c \ xkbPrKeyEv.c # this should be replaced by a common library or something, ideally -d XKBFILE_SRCS = \ maprules.c \ xkmread.c \ xkbtext.c \ xkbfmisc.c \ xkbout.c X11_SRCS = \ XKBMisc.c \ XKBAlloc.c \ XKBGAlloc.c \ XKBMAlloc.c libxkb_la_SOURCES = $(DDX_SRCS) $(DIX_SRCS) $(XKBFILE_SRCS) $(X11_SRCS) libxkbstubs_la_SOURCES = ddxVT.c ddxPrivate.c ddxKillSrv.c EXTRA_DIST = xkbDflts.h xkbgeom.h xkb.h xkbcompileddir = $(XKB_COMPILED_DIR) dist_xkbcompiled_DATA = README.compiled xorg-server-1.17.1/xkb/xkbEvents.c0000664000175100017510000010772312456571574013744 00000000000000/************************************************************ Copyright (c) 1993 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 "inputstr.h" #include "exevents.h" #include "exglobals.h" #include "windowstr.h" #include #include "xkb.h" /***====================================================================***/ /* * This function sends out two kinds of notification: * - Core mapping notify events sent to clients for whom kbd is the * current core ('picked') keyboard _and_ have not explicitly * selected for XKB mapping notify events; * - Xi mapping events, sent unconditionally to all clients who have * explicitly selected for them (including those who have explicitly * selected for XKB mapping notify events!). */ static void XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, int first_key, int num_keys) { int i; int keymap_changed = 0; int modmap_changed = 0; CARD32 time = GetTimeInMillis(); if (xkb_event == XkbNewKeyboardNotify) { if (changed & XkbNKN_KeycodesMask) { keymap_changed = 1; modmap_changed = 1; } } else if (xkb_event == XkbMapNotify) { if (changed & XkbKeySymsMask) keymap_changed = 1; if (changed & XkbModifierMapMask) modmap_changed = 1; } if (!keymap_changed && !modmap_changed) return; /* 0 is serverClient. */ for (i = 1; i < currentMaxClients; i++) { if (!clients[i] || clients[i]->clientState != ClientStateRunning) continue; /* XKB allows clients to restrict the MappingNotify events sent to * them. This was broken for three years. Sorry. */ if (xkb_event == XkbMapNotify && (clients[i]->xkbClientFlags & _XkbClientInitialized) && !(clients[i]->mapNotifyMask & changed)) continue; /* Emulate previous server behaviour: any client which has activated * XKB will not receive core events emulated from a NewKeyboardNotify * at all. */ if (xkb_event == XkbNewKeyboardNotify && (clients[i]->xkbClientFlags & _XkbClientInitialized)) continue; /* Don't send core events to clients who don't know about us. */ if (!XIShouldNotify(clients[i], kbd)) 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 * doesn't freak out. */ if (first_key >= clients[i]->minKC) core_mn.u.mappingNotify.firstKeyCode = first_key; else core_mn.u.mappingNotify.firstKeyCode = clients[i]->minKC; if (first_key + num_keys - 1 <= clients[i]->maxKC) core_mn.u.mappingNotify.count = num_keys; else core_mn.u.mappingNotify.count = clients[i]->maxKC - clients[i]->minKC + 1; WriteEventsToClient(clients[i], 1, &core_mn); } if (modmap_changed) { 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); } } /* Hmm, maybe we can accidentally generate Xi events for core devices * here? Clients might be upset, but that seems better than the * alternative of stale keymaps. -ds */ if (keymap_changed) { 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) { deviceMappingNotify xi_mn = { .type = DeviceMappingNotify, .deviceid = kbd->id, .request = MappingModifier, .firstKeyCode = 0, .count = 0, .time = time }; SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1); } } /***====================================================================***/ void XkbSendNewKeyboardNotify(DeviceIntPtr kbd, xkbNewKeyboardNotify * pNKN) { int i; Time time = GetTimeInMillis(); CARD16 changed = pNKN->changed; pNKN->type = XkbEventCode + XkbEventBase; pNKN->xkbType = XkbNewKeyboardNotify; for (i = 1; i < currentMaxClients; i++) { if (!clients[i] || clients[i]->clientState != ClientStateRunning) continue; if (!(clients[i]->newKeyboardNotifyMask & changed)) continue; pNKN->sequenceNumber = clients[i]->sequence; pNKN->time = time; pNKN->changed = changed; if (clients[i]->swapped) { swaps(&pNKN->sequenceNumber); swapl(&pNKN->time); swaps(&pNKN->changed); } WriteToClient(clients[i], sizeof(xEvent), pNKN); if (changed & XkbNKN_KeycodesMask) { clients[i]->minKC = pNKN->minKeyCode; clients[i]->maxKC = pNKN->maxKeyCode; } } XkbSendLegacyMapNotify(kbd, XkbNewKeyboardNotify, changed, pNKN->minKeyCode, pNKN->maxKeyCode - pNKN->minKeyCode + 1); return; } /***====================================================================***/ void XkbSendStateNotify(DeviceIntPtr kbd, xkbStateNotify * pSN) { XkbSrvInfoPtr xkbi; XkbStatePtr state; XkbInterestPtr interest; Time time; register CARD16 changed, bState; interest = kbd->xkb_interest; if (!interest || !kbd->key || !kbd->key->xkbInfo) return; xkbi = kbd->key->xkbInfo; state = &xkbi->state; pSN->type = XkbEventCode + XkbEventBase; pSN->xkbType = XkbStateNotify; pSN->deviceID = kbd->id; pSN->time = time = GetTimeInMillis(); pSN->mods = state->mods; pSN->baseMods = state->base_mods; pSN->latchedMods = state->latched_mods; pSN->lockedMods = state->locked_mods; pSN->group = state->group; pSN->baseGroup = state->base_group; pSN->latchedGroup = state->latched_group; pSN->lockedGroup = state->locked_group; pSN->compatState = state->compat_state; pSN->grabMods = state->grab_mods; pSN->compatGrabMods = state->compat_grab_mods; pSN->lookupMods = state->lookup_mods; pSN->compatLookupMods = state->compat_lookup_mods; pSN->ptrBtnState = state->ptr_buttons; changed = pSN->changed; bState = pSN->ptrBtnState; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->stateNotifyMask & changed)) { pSN->sequenceNumber = interest->client->sequence; pSN->time = time; pSN->changed = changed; pSN->ptrBtnState = bState; if (interest->client->swapped) { swaps(&pSN->sequenceNumber); swapl(&pSN->time); swaps(&pSN->changed); swaps(&pSN->ptrBtnState); } WriteToClient(interest->client, sizeof(xEvent), pSN); } interest = interest->next; } return; } /***====================================================================***/ /* * This function sends out XKB mapping notify events to clients which * have explicitly selected for them. Core and Xi events are handled by * XkbSendLegacyMapNotify. */ void XkbSendMapNotify(DeviceIntPtr kbd, xkbMapNotify * pMN) { int i; CARD32 time = GetTimeInMillis(); CARD16 changed = pMN->changed; XkbSrvInfoPtr xkbi = kbd->key->xkbInfo; pMN->minKeyCode = xkbi->desc->min_key_code; pMN->maxKeyCode = xkbi->desc->max_key_code; pMN->type = XkbEventCode + XkbEventBase; pMN->xkbType = XkbMapNotify; pMN->deviceID = kbd->id; /* 0 is serverClient. */ for (i = 1; i < currentMaxClients; i++) { if (!clients[i] || clients[i]->clientState != ClientStateRunning) continue; if (!(clients[i]->mapNotifyMask & changed)) continue; pMN->time = time; pMN->sequenceNumber = clients[i]->sequence; pMN->changed = changed; if (clients[i]->swapped) { swaps(&pMN->sequenceNumber); swapl(&pMN->time); swaps(&pMN->changed); } WriteToClient(clients[i], sizeof(xEvent), pMN); } XkbSendLegacyMapNotify(kbd, XkbMapNotify, changed, pMN->firstKeySym, pMN->nKeySyms); } int XkbComputeControlsNotify(DeviceIntPtr kbd, XkbControlsPtr old, XkbControlsPtr new, xkbControlsNotify * pCN, Bool forceCtrlProc) { int i; CARD32 changedControls; changedControls = 0; if (!kbd || !kbd->kbdfeed) return 0; if (old->enabled_ctrls != new->enabled_ctrls) changedControls |= XkbControlsEnabledMask; if ((old->repeat_delay != new->repeat_delay) || (old->repeat_interval != new->repeat_interval)) changedControls |= XkbRepeatKeysMask; for (i = 0; i < XkbPerKeyBitArraySize; i++) if (old->per_key_repeat[i] != new->per_key_repeat[i]) changedControls |= XkbPerKeyRepeatMask; if (old->slow_keys_delay != new->slow_keys_delay) changedControls |= XkbSlowKeysMask; if (old->debounce_delay != new->debounce_delay) changedControls |= XkbBounceKeysMask; if ((old->mk_delay != new->mk_delay) || (old->mk_interval != new->mk_interval) || (old->mk_dflt_btn != new->mk_dflt_btn)) changedControls |= XkbMouseKeysMask; if ((old->mk_time_to_max != new->mk_time_to_max) || (old->mk_curve != new->mk_curve) || (old->mk_max_speed != new->mk_max_speed)) changedControls |= XkbMouseKeysAccelMask; if (old->ax_options != new->ax_options) changedControls |= XkbAccessXKeysMask; if ((old->ax_options ^ new->ax_options) & XkbAX_SKOptionsMask) changedControls |= XkbStickyKeysMask; if ((old->ax_options ^ new->ax_options) & XkbAX_FBOptionsMask) changedControls |= XkbAccessXFeedbackMask; if ((old->ax_timeout != new->ax_timeout) || (old->axt_ctrls_mask != new->axt_ctrls_mask) || (old->axt_ctrls_values != new->axt_ctrls_values) || (old->axt_opts_mask != new->axt_opts_mask) || (old->axt_opts_values != new->axt_opts_values)) { changedControls |= XkbAccessXTimeoutMask; } if ((old->internal.mask != new->internal.mask) || (old->internal.real_mods != new->internal.real_mods) || (old->internal.vmods != new->internal.vmods)) changedControls |= XkbInternalModsMask; if ((old->ignore_lock.mask != new->ignore_lock.mask) || (old->ignore_lock.real_mods != new->ignore_lock.real_mods) || (old->ignore_lock.vmods != new->ignore_lock.vmods)) changedControls |= XkbIgnoreLockModsMask; if (new->enabled_ctrls & XkbRepeatKeysMask) kbd->kbdfeed->ctrl.autoRepeat = TRUE; else kbd->kbdfeed->ctrl.autoRepeat = FALSE; if (kbd->kbdfeed && kbd->kbdfeed->CtrlProc && (changedControls || forceCtrlProc)) (*kbd->kbdfeed->CtrlProc) (kbd, &kbd->kbdfeed->ctrl); if ((!changedControls) && (old->num_groups == new->num_groups)) return 0; if (!kbd->xkb_interest) return 0; pCN->changedControls = changedControls; pCN->enabledControls = new->enabled_ctrls; pCN->enabledControlChanges = (new->enabled_ctrls ^ old->enabled_ctrls); pCN->numGroups = new->num_groups; return 1; } void XkbSendControlsNotify(DeviceIntPtr kbd, xkbControlsNotify * pCN) { int initialized; CARD32 changedControls, enabledControls, enabledChanges = 0; XkbSrvInfoPtr xkbi; XkbInterestPtr interest; Time time = 0; interest = kbd->xkb_interest; if (!interest || !kbd->key || !kbd->key->xkbInfo) return; xkbi = kbd->key->xkbInfo; initialized = 0; enabledControls = xkbi->desc->ctrls->enabled_ctrls; changedControls = pCN->changedControls; pCN->numGroups = xkbi->desc->ctrls->num_groups; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->ctrlsNotifyMask & changedControls)) { if (!initialized) { pCN->type = XkbEventCode + XkbEventBase; pCN->xkbType = XkbControlsNotify; pCN->deviceID = kbd->id; pCN->time = time = GetTimeInMillis(); enabledChanges = pCN->enabledControlChanges; initialized = 1; } pCN->changedControls = changedControls; pCN->enabledControls = enabledControls; pCN->enabledControlChanges = enabledChanges; pCN->sequenceNumber = interest->client->sequence; pCN->time = time; if (interest->client->swapped) { swaps(&pCN->sequenceNumber); swapl(&pCN->changedControls); swapl(&pCN->enabledControls); swapl(&pCN->enabledControlChanges); swapl(&pCN->time); } WriteToClient(interest->client, sizeof(xEvent), pCN); } interest = interest->next; } return; } static void XkbSendIndicatorNotify(DeviceIntPtr kbd, int xkbType, xkbIndicatorNotify * pEv) { int initialized; XkbInterestPtr interest; Time time = 0; CARD32 state, changed; interest = kbd->xkb_interest; if (!interest) return; initialized = 0; state = pEv->state; changed = pEv->changed; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (((xkbType == XkbIndicatorStateNotify) && (interest->iStateNotifyMask & changed)) || ((xkbType == XkbIndicatorMapNotify) && (interest->iMapNotifyMask & changed)))) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = xkbType; pEv->deviceID = kbd->id; pEv->time = time = GetTimeInMillis(); initialized = 1; } pEv->sequenceNumber = interest->client->sequence; pEv->time = time; pEv->changed = changed; pEv->state = state; if (interest->client->swapped) { swaps(&pEv->sequenceNumber); swapl(&pEv->time); swapl(&pEv->changed); swapl(&pEv->state); } WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } return; } void XkbHandleBell(BOOL force, BOOL eventOnly, DeviceIntPtr kbd, CARD8 percent, void *pCtrl, CARD8 class, Atom name, WindowPtr pWin, ClientPtr pClient) { xkbBellNotify bn; int initialized; XkbSrvInfoPtr xkbi; XkbInterestPtr interest; CARD8 id; CARD16 pitch, duration; Time time = 0; XID winID = 0; if (!kbd->key || !kbd->key->xkbInfo) return; xkbi = kbd->key->xkbInfo; if ((force || (xkbi->desc->ctrls->enabled_ctrls & XkbAudibleBellMask)) && (!eventOnly)) { if (kbd->kbdfeed->BellProc) (*kbd->kbdfeed->BellProc) (percent, kbd, (void *) pCtrl, class); } interest = kbd->xkb_interest; if ((!interest) || (force)) return; if ((class == 0) || (class == KbdFeedbackClass)) { KeybdCtrl *pKeyCtrl = (KeybdCtrl *) pCtrl; id = pKeyCtrl->id; pitch = pKeyCtrl->bell_pitch; duration = pKeyCtrl->bell_duration; } else if (class == BellFeedbackClass) { BellCtrl *pBellCtrl = (BellCtrl *) pCtrl; id = pBellCtrl->id; pitch = pBellCtrl->pitch; duration = pBellCtrl->duration; } else return; initialized = 0; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->bellNotifyMask)) { if (!initialized) { time = GetTimeInMillis(); bn.type = XkbEventCode + XkbEventBase; bn.xkbType = XkbBellNotify; bn.deviceID = kbd->id; bn.bellClass = class; bn.bellID = id; bn.percent = percent; bn.eventOnly = (eventOnly != 0); winID = (pWin ? pWin->drawable.id : None); initialized = 1; } bn.sequenceNumber = interest->client->sequence; bn.time = time; bn.pitch = pitch; bn.duration = duration; bn.name = name; bn.window = winID; if (interest->client->swapped) { swaps(&bn.sequenceNumber); swapl(&bn.time); swaps(&bn.pitch); swaps(&bn.duration); swapl(&bn.name); swapl(&bn.window); } WriteToClient(interest->client, sizeof(xEvent), &bn); } interest = interest->next; } return; } void XkbSendAccessXNotify(DeviceIntPtr kbd, xkbAccessXNotify * pEv) { int initialized; XkbInterestPtr interest; Time time = 0; CARD16 sk_delay, db_delay; interest = kbd->xkb_interest; if (!interest) return; initialized = 0; sk_delay = pEv->slowKeysDelay; db_delay = pEv->debounceDelay; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->accessXNotifyMask & (1 << pEv->detail))) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbAccessXNotify; pEv->deviceID = kbd->id; pEv->time = time = GetTimeInMillis(); initialized = 1; } pEv->sequenceNumber = interest->client->sequence; pEv->time = time; pEv->slowKeysDelay = sk_delay; pEv->debounceDelay = db_delay; if (interest->client->swapped) { swaps(&pEv->sequenceNumber); swapl(&pEv->time); swaps(&pEv->slowKeysDelay); swaps(&pEv->debounceDelay); } WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } return; } void XkbSendNamesNotify(DeviceIntPtr kbd, xkbNamesNotify * pEv) { int initialized; XkbInterestPtr interest; Time time = 0; CARD16 changed, changedVirtualMods; CARD32 changedIndicators; interest = kbd->xkb_interest; if (!interest) return; initialized = 0; changed = pEv->changed; changedIndicators = pEv->changedIndicators; changedVirtualMods = pEv->changedVirtualMods; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->namesNotifyMask & pEv->changed)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbNamesNotify; pEv->deviceID = kbd->id; pEv->time = time = GetTimeInMillis(); initialized = 1; } pEv->sequenceNumber = interest->client->sequence; pEv->time = time; pEv->changed = changed; pEv->changedIndicators = changedIndicators; pEv->changedVirtualMods = changedVirtualMods; if (interest->client->swapped) { swaps(&pEv->sequenceNumber); swapl(&pEv->time); swaps(&pEv->changed); swapl(&pEv->changedIndicators); swaps(&pEv->changedVirtualMods); } WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } return; } void XkbSendCompatMapNotify(DeviceIntPtr kbd, xkbCompatMapNotify * pEv) { int initialized; XkbInterestPtr interest; Time time = 0; CARD16 firstSI = 0, nSI = 0, nTotalSI = 0; interest = kbd->xkb_interest; if (!interest) return; initialized = 0; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->compatNotifyMask)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbCompatMapNotify; pEv->deviceID = kbd->id; pEv->time = time = GetTimeInMillis(); firstSI = pEv->firstSI; nSI = pEv->nSI; nTotalSI = pEv->nTotalSI; initialized = 1; } pEv->sequenceNumber = interest->client->sequence; pEv->time = time; pEv->firstSI = firstSI; pEv->nSI = nSI; pEv->nTotalSI = nTotalSI; if (interest->client->swapped) { swaps(&pEv->sequenceNumber); swapl(&pEv->time); swaps(&pEv->firstSI); swaps(&pEv->nSI); swaps(&pEv->nTotalSI); } WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } return; } void XkbSendActionMessage(DeviceIntPtr kbd, xkbActionMessage * pEv) { int initialized; XkbSrvInfoPtr xkbi; XkbInterestPtr interest; Time time = 0; interest = kbd->xkb_interest; if (!interest || !kbd->key || !kbd->key->xkbInfo) return; xkbi = kbd->key->xkbInfo; initialized = 0; pEv->mods = xkbi->state.mods; pEv->group = xkbi->state.group; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->actionMessageMask)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbActionMessage; pEv->deviceID = kbd->id; pEv->sequenceNumber = interest->client->sequence; pEv->time = time = GetTimeInMillis(); initialized = 1; } pEv->sequenceNumber = interest->client->sequence; pEv->time = time; if (interest->client->swapped) { swaps(&pEv->sequenceNumber); swapl(&pEv->time); } WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } return; } void XkbSendExtensionDeviceNotify(DeviceIntPtr dev, ClientPtr client, xkbExtensionDeviceNotify * pEv) { int initialized; XkbInterestPtr interest; Time time = 0; CARD32 defined, state; CARD16 reason; interest = dev->xkb_interest; if (!interest) return; initialized = 0; reason = pEv->reason; defined = pEv->ledsDefined; state = pEv->ledState; while (interest) { if ((!interest->client->clientGone) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->extDevNotifyMask & reason)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbExtensionDeviceNotify; pEv->deviceID = dev->id; pEv->sequenceNumber = interest->client->sequence; pEv->time = time = GetTimeInMillis(); initialized = 1; } else { pEv->sequenceNumber = interest->client->sequence; pEv->time = time; pEv->ledsDefined = defined; pEv->ledState = state; pEv->reason = reason; pEv->supported = XkbXI_AllFeaturesMask; } if (interest->client->swapped) { swaps(&pEv->sequenceNumber); swapl(&pEv->time); swapl(&pEv->ledsDefined); swapl(&pEv->ledState); swaps(&pEv->reason); swaps(&pEv->supported); } WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } return; } void XkbSendNotification(DeviceIntPtr kbd, XkbChangesPtr pChanges, XkbEventCausePtr cause) { XkbSrvLedInfoPtr sli; sli = NULL; if (pChanges->state_changes) { xkbStateNotify sn; sn.changed = pChanges->state_changes; sn.keycode = cause->kc; sn.eventType = cause->event; sn.requestMajor = cause->mjr; sn.requestMinor = cause->mnr; XkbSendStateNotify(kbd, &sn); } if (pChanges->map.changed) { xkbMapNotify mn; memset(&mn, 0, sizeof(xkbMapNotify)); mn.changed = pChanges->map.changed; mn.firstType = pChanges->map.first_type; mn.nTypes = pChanges->map.num_types; mn.firstKeySym = pChanges->map.first_key_sym; mn.nKeySyms = pChanges->map.num_key_syms; mn.firstKeyAct = pChanges->map.first_key_act; mn.nKeyActs = pChanges->map.num_key_acts; mn.firstKeyBehavior = pChanges->map.first_key_behavior; mn.nKeyBehaviors = pChanges->map.num_key_behaviors; mn.virtualMods = pChanges->map.vmods; mn.firstKeyExplicit = pChanges->map.first_key_explicit; mn.nKeyExplicit = pChanges->map.num_key_explicit; mn.firstModMapKey = pChanges->map.first_modmap_key; mn.nModMapKeys = pChanges->map.num_modmap_keys; mn.firstVModMapKey = pChanges->map.first_vmodmap_key; mn.nVModMapKeys = pChanges->map.num_vmodmap_keys; XkbSendMapNotify(kbd, &mn); } if ((pChanges->ctrls.changed_ctrls) || (pChanges->ctrls.enabled_ctrls_changes)) { xkbControlsNotify cn; memset(&cn, 0, sizeof(xkbControlsNotify)); cn.changedControls = pChanges->ctrls.changed_ctrls; cn.enabledControlChanges = pChanges->ctrls.enabled_ctrls_changes; cn.keycode = cause->kc; cn.eventType = cause->event; cn.requestMajor = cause->mjr; cn.requestMinor = cause->mnr; XkbSendControlsNotify(kbd, &cn); } if (pChanges->indicators.map_changes) { xkbIndicatorNotify in; if (sli == NULL) sli = XkbFindSrvLedInfo(kbd, XkbDfltXIClass, XkbDfltXIId, 0); memset(&in, 0, sizeof(xkbIndicatorNotify)); in.state = sli->effectiveState; in.changed = pChanges->indicators.map_changes; XkbSendIndicatorNotify(kbd, XkbIndicatorMapNotify, &in); } if (pChanges->indicators.state_changes) { xkbIndicatorNotify in; if (sli == NULL) sli = XkbFindSrvLedInfo(kbd, XkbDfltXIClass, XkbDfltXIId, 0); memset(&in, 0, sizeof(xkbIndicatorNotify)); in.state = sli->effectiveState; in.changed = pChanges->indicators.state_changes; XkbSendIndicatorNotify(kbd, XkbIndicatorStateNotify, &in); } if (pChanges->names.changed) { xkbNamesNotify nn; memset(&nn, 0, sizeof(xkbNamesNotify)); nn.changed = pChanges->names.changed; nn.firstType = pChanges->names.first_type; nn.nTypes = pChanges->names.num_types; nn.firstLevelName = pChanges->names.first_lvl; nn.nLevelNames = pChanges->names.num_lvls; nn.nRadioGroups = pChanges->names.num_rg; nn.changedVirtualMods = pChanges->names.changed_vmods; nn.changedIndicators = pChanges->names.changed_indicators; XkbSendNamesNotify(kbd, &nn); } if ((pChanges->compat.changed_groups) || (pChanges->compat.num_si > 0)) { xkbCompatMapNotify cmn; memset(&cmn, 0, sizeof(xkbCompatMapNotify)); cmn.changedGroups = pChanges->compat.changed_groups; cmn.firstSI = pChanges->compat.first_si; cmn.nSI = pChanges->compat.num_si; cmn.nTotalSI = kbd->key->xkbInfo->desc->compat->num_si; XkbSendCompatMapNotify(kbd, &cmn); } return; } /***====================================================================***/ void XkbFilterEvents(ClientPtr client, int nEvents, xEvent *xE) { DeviceIntPtr dev = NULL; XkbSrvInfoPtr xkbi; CARD8 type = xE[0].u.u.type; if (xE->u.u.type & EXTENSION_EVENT_BASE) dev = XIGetDevice(xE); if (!dev) dev = PickKeyboard(client); if (!dev->key) return; xkbi = dev->key->xkbInfo; if (client->xkbClientFlags & _XkbClientInitialized) { if ((xkbDebugFlags & 0x10) && (type == KeyPress || type == KeyRelease || type == DeviceKeyPress || type == DeviceKeyRelease)) DebugF("[xkb] XkbFilterWriteEvents (XKB client): state 0x%04x\n", xE[0].u.keyButtonPointer.state); if (dev->deviceGrab.grab != NullGrab && dev->deviceGrab.fromPassiveGrab && (type == KeyPress || type == KeyRelease || type == DeviceKeyPress || type == DeviceKeyRelease)) { unsigned int state, flags; flags = client->xkbClientFlags; state = xkbi->state.compat_grab_mods; if (flags & XkbPCF_GrabsUseXKBStateMask) { int group; if (flags & XkbPCF_LookupStateWhenGrabbed) { group = xkbi->state.group; state = xkbi->state.lookup_mods; } else { state = xkbi->state.grab_mods; group = xkbi->state.base_group + xkbi->state.latched_group; if (group < 0 || group >= xkbi->desc->ctrls->num_groups) group = XkbAdjustGroup(group, xkbi->desc->ctrls); } state = XkbBuildCoreState(state, group); } else if (flags & XkbPCF_LookupStateWhenGrabbed) { state = xkbi->state.compat_lookup_mods; } xE[0].u.keyButtonPointer.state = state; } } else { if ((xkbDebugFlags & 0x4) && (xE[0].u.u.type == KeyPress || xE[0].u.u.type == KeyRelease || xE[0].u.u.type == DeviceKeyPress || xE[0].u.u.type == DeviceKeyRelease)) { DebugF("[xkb] XKbFilterWriteEvents (non-XKB):\n"); DebugF("[xkb] event= 0x%04x\n", xE[0].u.keyButtonPointer.state); DebugF("[xkb] lookup= 0x%02x, grab= 0x%02x\n", xkbi->state.lookup_mods, xkbi->state.grab_mods); DebugF("[xkb] compat lookup= 0x%02x, grab= 0x%02x\n", xkbi->state.compat_lookup_mods, xkbi->state.compat_grab_mods); } if (type >= KeyPress && type <= MotionNotify) { CARD16 old, new; old = xE[0].u.keyButtonPointer.state & ~0x1f00; new = xE[0].u.keyButtonPointer.state & 0x1F00; if (old == XkbStateFieldFromRec(&xkbi->state)) new |= xkbi->state.compat_lookup_mods; else new |= xkbi->state.compat_grab_mods; xE[0].u.keyButtonPointer.state = new; } else if (type == EnterNotify || type == LeaveNotify) { xE[0].u.enterLeave.state &= 0x1F00; xE[0].u.enterLeave.state |= xkbi->state.compat_grab_mods; } else if (type >= DeviceKeyPress && type <= DeviceMotionNotify) { CARD16 old, new; deviceKeyButtonPointer *kbp = (deviceKeyButtonPointer *) &xE[0]; old = kbp->state & ~0x1F00; new = kbp->state & 0x1F00; if (old == XkbStateFieldFromRec(&xkbi->state)) new |= xkbi->state.compat_lookup_mods; else new |= xkbi->state.compat_grab_mods; kbp->state = new; } } } /***====================================================================***/ XkbInterestPtr XkbFindClientResource(DevicePtr inDev, ClientPtr client) { DeviceIntPtr dev = (DeviceIntPtr) inDev; XkbInterestPtr interest; if (dev->xkb_interest) { interest = dev->xkb_interest; while (interest) { if (interest->client == client) { return interest; } interest = interest->next; } } return NULL; } XkbInterestPtr XkbAddClientResource(DevicePtr inDev, ClientPtr client, XID id) { DeviceIntPtr dev = (DeviceIntPtr) inDev; XkbInterestPtr interest; interest = dev->xkb_interest; while (interest) { if (interest->client == client) return ((interest->resource == id) ? interest : NULL); interest = interest->next; } interest = calloc(1, sizeof(XkbInterestRec)); if (interest) { interest->dev = dev; interest->client = client; interest->resource = id; interest->next = dev->xkb_interest; dev->xkb_interest = interest; return interest; } return NULL; } int XkbRemoveResourceClient(DevicePtr inDev, XID id) { XkbSrvInfoPtr xkbi; DeviceIntPtr dev = (DeviceIntPtr) inDev; XkbInterestPtr interest; Bool found; unsigned long autoCtrls, autoValues; ClientPtr client = NULL; found = FALSE; if (!dev->key || !dev->key->xkbInfo) return found; autoCtrls = autoValues = 0; if (dev->xkb_interest) { interest = dev->xkb_interest; if (interest && (interest->resource == id)) { dev->xkb_interest = interest->next; autoCtrls = interest->autoCtrls; autoValues = interest->autoCtrlValues; client = interest->client; free(interest); found = TRUE; } while ((!found) && (interest->next)) { if (interest->next->resource == id) { XkbInterestPtr victim = interest->next; interest->next = victim->next; autoCtrls = victim->autoCtrls; autoValues = victim->autoCtrlValues; client = victim->client; free(victim); found = TRUE; } interest = interest->next; } } if (found && autoCtrls && dev->key && dev->key->xkbInfo) { XkbEventCauseRec cause; xkbi = dev->key->xkbInfo; XkbSetCauseXkbReq(&cause, X_kbPerClientFlags, client); XkbEnableDisableControls(xkbi, autoCtrls, autoValues, NULL, &cause); } return found; } xorg-server-1.17.1/xkb/ddxLoad.c0000664000175100017510000003641212456571574013346 00000000000000/************************************************************ Copyright (c) 1993 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 #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS #include #include #include "xkb.h" /* * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is * relative to the top-level XKB configuration directory. * Making the server write to a subdirectory of that directory * requires some work in the general case (install procedure * has to create links to /var or somesuch on many machines), * so we just compile into /usr/tmp for now. */ #ifndef XKM_OUTPUT_DIR #define XKM_OUTPUT_DIR "compiled/" #endif #define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" #define ERROR_PREFIX "\"> \"" #define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" #define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" #if defined(WIN32) #define PATHSEPARATOR "\\" #else #define PATHSEPARATOR "/" #endif static unsigned LoadXKM(unsigned want, unsigned need, const char *keymap, XkbDescPtr *xkbRtrn); static void OutputDirectory(char *outdir, size_t size) { #ifndef WIN32 /* Can we write an xkm and then open it too? */ if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size)) { (void) strcpy(outdir, XKM_OUTPUT_DIR); } else #else if (strlen(Win32TempDir()) + 1 < size) { (void) strcpy(outdir, Win32TempDir()); (void) strcat(outdir, "\\"); } else #endif if (strlen("/tmp/") < size) { (void) strcpy(outdir, "/tmp/"); } } /** * Callback invoked by XkbRunXkbComp. Write to out to talk to xkbcomp. */ typedef void (*xkbcomp_buffer_callback)(FILE *out, void *userdata); /** * Start xkbcomp, let the callback write into xkbcomp's stdin. When done, * return a strdup'd copy of the file name we've written to. */ static char * RunXkbComp(xkbcomp_buffer_callback callback, void *userdata) { FILE *out; char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX]; const char *emptystring = ""; char *xkbbasedirflag = NULL; const char *xkbbindir = emptystring; const char *xkbbindirsep = emptystring; #ifdef WIN32 /* WIN32 has no popen. The input must be stored in a file which is used as input for xkbcomp. xkbcomp does not read from stdin. */ char tmpname[PATH_MAX]; const char *xkmfile = tmpname; #else const char *xkmfile = "-"; #endif snprintf(keymap, sizeof(keymap), "server-%s", display); OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); #ifdef WIN32 strcpy(tmpname, Win32TempDir()); strcat(tmpname, "\\xkb_XXXXXX"); (void) mktemp(tmpname); #endif if (XkbBaseDirectory != NULL) { if (asprintf(&xkbbasedirflag, "\"-R%s\"", XkbBaseDirectory) == -1) xkbbasedirflag = NULL; } if (XkbBinDirectory != NULL) { int ld = strlen(XkbBinDirectory); int lps = strlen(PATHSEPARATOR); xkbbindir = XkbBinDirectory; if ((ld >= lps) && (strcmp(xkbbindir + ld - lps, PATHSEPARATOR) != 0)) { xkbbindirsep = PATHSEPARATOR; } } if (asprintf(&buf, "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", xkbbindir, xkbbindirsep, ((xkbDebugFlags < 2) ? 1 : ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)), xkbbasedirflag ? xkbbasedirflag : "", xkmfile, PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, xkm_output_dir, keymap) == -1) buf = NULL; free(xkbbasedirflag); if (!buf) { LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n"); return NULL; } #ifndef WIN32 out = Popen(buf, "w"); #else out = fopen(tmpname, "w"); #endif if (out != NULL) { /* Now write to xkbcomp */ (*callback)(out, userdata); #ifndef WIN32 if (Pclose(out) == 0) #else if (fclose(out) == 0 && System(buf) >= 0) #endif { if (xkbDebugFlags) DebugF("[xkb] xkb executes: %s\n", buf); free(buf); #ifdef WIN32 unlink(tmpname); #endif return xnfstrdup(keymap); } else LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); #ifdef WIN32 /* remove the temporary file */ unlink(tmpname); #endif } else { #ifndef WIN32 LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n"); #else LogMessage(X_ERROR, "Could not open file %s\n", tmpname); #endif } free(buf); return NULL; } typedef struct { XkbDescPtr xkb; XkbComponentNamesPtr names; unsigned int want; unsigned int need; } XkbKeymapNamesCtx; static void xkb_write_keymap_for_names_cb(FILE *out, void *userdata) { XkbKeymapNamesCtx *ctx = userdata; #ifdef DEBUG if (xkbDebugFlags) { ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n"); XkbWriteXKBKeymapForNames(stderr, ctx->names, ctx->xkb, ctx->want, ctx->need); } #endif XkbWriteXKBKeymapForNames(out, ctx->names, ctx->xkb, ctx->want, ctx->need); } static Bool XkbDDXCompileKeymapByNames(XkbDescPtr xkb, XkbComponentNamesPtr names, unsigned want, unsigned need, char *nameRtrn, int nameRtrnLen) { char *keymap; Bool rc = FALSE; XkbKeymapNamesCtx ctx = { .xkb = xkb, .names = names, .want = want, .need = need }; keymap = RunXkbComp(xkb_write_keymap_for_names_cb, &ctx); if (keymap) { if(nameRtrn) strlcpy(nameRtrn, keymap, nameRtrnLen); free(keymap); rc = TRUE; } else if (nameRtrn) *nameRtrn = '\0'; return rc; } typedef struct { const char *keymap; size_t len; } XkbKeymapString; static void xkb_write_keymap_string_cb(FILE *out, void *userdata) { XkbKeymapString *s = userdata; fwrite(s->keymap, s->len, 1, out); } static unsigned int XkbDDXLoadKeymapFromString(DeviceIntPtr keybd, const char *keymap, int keymap_length, unsigned int want, unsigned int need, XkbDescPtr *xkbRtrn) { unsigned int have; char *map_name; XkbKeymapString map = { .keymap = keymap, .len = keymap_length }; *xkbRtrn = NULL; map_name = RunXkbComp(xkb_write_keymap_string_cb, &map); if (!map_name) { LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n"); return 0; } have = LoadXKM(want, need, map_name, xkbRtrn); free(map_name); return have; } static FILE * XkbDDXOpenConfigFile(const char *mapName, char *fileNameRtrn, int fileNameRtrnLen) { char buf[PATH_MAX], xkm_output_dir[PATH_MAX]; FILE *file; buf[0] = '\0'; if (mapName != NULL) { OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); if ((XkbBaseDirectory != NULL) && (xkm_output_dir[0] != '/') #ifdef WIN32 && (!isalpha(xkm_output_dir[0]) || xkm_output_dir[1] != ':') #endif ) { if (snprintf(buf, PATH_MAX, "%s/%s%s.xkm", XkbBaseDirectory, xkm_output_dir, mapName) >= PATH_MAX) buf[0] = '\0'; } else { if (snprintf(buf, PATH_MAX, "%s%s.xkm", xkm_output_dir, mapName) >= PATH_MAX) buf[0] = '\0'; } if (buf[0] != '\0') file = fopen(buf, "rb"); else file = NULL; } else file = NULL; if ((fileNameRtrn != NULL) && (fileNameRtrnLen > 0)) { strlcpy(fileNameRtrn, buf, fileNameRtrnLen); } return file; } static unsigned LoadXKM(unsigned want, unsigned need, const char *keymap, XkbDescPtr *xkbRtrn) { FILE *file; char fileName[PATH_MAX]; unsigned missing; file = XkbDDXOpenConfigFile(keymap, fileName, PATH_MAX); if (file == NULL) { LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n", fileName); return 0; } missing = XkmReadFile(file, need, want, xkbRtrn); if (*xkbRtrn == NULL) { LogMessage(X_ERROR, "Error loading keymap %s\n", fileName); fclose(file); (void) unlink(fileName); return 0; } else { DebugF("Loaded XKB keymap %s, defined=0x%x\n", fileName, (*xkbRtrn)->defined); } fclose(file); (void) unlink(fileName); return (need | want) & (~missing); } unsigned XkbDDXLoadKeymapByNames(DeviceIntPtr keybd, XkbComponentNamesPtr names, unsigned want, unsigned need, XkbDescPtr *xkbRtrn, char *nameRtrn, int nameRtrnLen) { XkbDescPtr xkb; *xkbRtrn = NULL; if ((keybd == NULL) || (keybd->key == NULL) || (keybd->key->xkbInfo == NULL)) xkb = NULL; else xkb = keybd->key->xkbInfo->desc; if ((names->keycodes == NULL) && (names->types == NULL) && (names->compat == NULL) && (names->symbols == NULL) && (names->geometry == NULL)) { LogMessage(X_ERROR, "XKB: No components provided for device %s\n", keybd->name ? keybd->name : "(unnamed keyboard)"); return 0; } else if (!XkbDDXCompileKeymapByNames(xkb, names, want, need, nameRtrn, nameRtrnLen)) { LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n"); return 0; } return LoadXKM(want, need, nameRtrn, xkbRtrn); } Bool XkbDDXNamesFromRules(DeviceIntPtr keybd, const char *rules_name, XkbRF_VarDefsPtr defs, XkbComponentNamesPtr names) { char buf[PATH_MAX]; FILE *file; Bool complete; XkbRF_RulesPtr rules; if (!rules_name) return FALSE; if (snprintf(buf, PATH_MAX, "%s/rules/%s", XkbBaseDirectory, rules_name) >= PATH_MAX) { LogMessage(X_ERROR, "XKB: Rules name is too long\n"); return FALSE; } file = fopen(buf, "r"); if (!file) { LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf); return FALSE; } rules = XkbRF_Create(); if (!rules) { LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n"); fclose(file); return FALSE; } if (!XkbRF_LoadRules(file, rules)) { LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name); fclose(file); XkbRF_Free(rules, TRUE); return FALSE; } memset(names, 0, sizeof(*names)); complete = XkbRF_GetComponents(rules, defs, names); fclose(file); XkbRF_Free(rules, TRUE); if (!complete) LogMessage(X_ERROR, "XKB: Rules returned no components\n"); return complete; } static Bool XkbRMLVOtoKcCGST(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, XkbComponentNamesPtr kccgst) { XkbRF_VarDefsRec mlvo; mlvo.model = rmlvo->model; mlvo.layout = rmlvo->layout; mlvo.variant = rmlvo->variant; mlvo.options = rmlvo->options; return XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, kccgst); } /** * Compile the given RMLVO keymap and return it. Returns the XkbDescPtr on * success or NULL on failure. If the components compiled are not a superset * or equal to need, the compiliation is treated as failure. */ static XkbDescPtr XkbCompileKeymapForDevice(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, int need) { XkbDescPtr xkb = NULL; unsigned int provided; XkbComponentNamesRec kccgst = { 0 }; char name[PATH_MAX]; if (XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst)) { provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need, &xkb, name, PATH_MAX); if ((need & provided) != need) { if (xkb) { XkbFreeKeyboard(xkb, 0, TRUE); xkb = NULL; } } } XkbFreeComponentNames(&kccgst, FALSE); return xkb; } static XkbDescPtr KeymapOrDefaults(DeviceIntPtr dev, XkbDescPtr xkb) { XkbRMLVOSet dflts; if (xkb) return xkb; /* we didn't get what we really needed. And that will likely leave * us with a keyboard that doesn't work. Use the defaults instead */ LogMessage(X_ERROR, "XKB: Failed to load keymap. Loading default " "keymap instead.\n"); XkbGetRulesDflts(&dflts); xkb = XkbCompileKeymapForDevice(dev, &dflts, 0); XkbFreeRMLVOSet(&dflts, FALSE); return xkb; } XkbDescPtr XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet * rmlvo) { XkbDescPtr xkb; unsigned int need; if (!dev || !rmlvo) { LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n"); return NULL; } /* These are the components we really really need */ need = XkmSymbolsMask | XkmCompatMapMask | XkmTypesMask | XkmKeyNamesMask | XkmVirtualModsMask; xkb = XkbCompileKeymapForDevice(dev, rmlvo, need); return KeymapOrDefaults(dev, xkb); } XkbDescPtr XkbCompileKeymapFromString(DeviceIntPtr dev, const char *keymap, int keymap_length) { XkbDescPtr xkb; unsigned int need, provided; if (!dev || !keymap) { LogMessage(X_ERROR, "XKB: No device or keymap specified\n"); return NULL; } /* These are the components we really really need */ need = XkmSymbolsMask | XkmCompatMapMask | XkmTypesMask | XkmKeyNamesMask | XkmVirtualModsMask; provided = XkbDDXLoadKeymapFromString(dev, keymap, keymap_length, XkmAllIndicesMask, need, &xkb); if ((need & provided) != need) { if (xkb) { XkbFreeKeyboard(xkb, 0, TRUE); xkb = NULL; } } return KeymapOrDefaults(dev, xkb); } xorg-server-1.17.1/xkb/XKBAlloc.c0000664000175100017510000002514712456571574013371 00000000000000/************************************************************ Copyright (c) 1993 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 "misc.h" #include "inputstr.h" #include #include "xkbgeom.h" #include #include /***===================================================================***/ /*ARGSUSED*/ Status XkbAllocCompatMap(XkbDescPtr xkb, unsigned which, unsigned nSI) { XkbCompatMapPtr compat; XkbSymInterpretRec *prev_interpret; if (!xkb) return BadMatch; if (xkb->compat) { if (xkb->compat->size_si >= nSI) return Success; compat = xkb->compat; compat->size_si = nSI; if (compat->sym_interpret == NULL) compat->num_si = 0; prev_interpret = compat->sym_interpret; compat->sym_interpret = realloc(compat->sym_interpret, nSI * sizeof(XkbSymInterpretRec)); if (compat->sym_interpret == NULL) { free(prev_interpret); compat->size_si = compat->num_si = 0; return BadAlloc; } if (compat->num_si != 0) { memset(&compat->sym_interpret[compat->num_si], 0, (compat->size_si - compat->num_si) * sizeof(XkbSymInterpretRec)); } return Success; } compat = calloc(1, sizeof(XkbCompatMapRec)); if (compat == NULL) return BadAlloc; if (nSI > 0) { compat->sym_interpret = calloc(nSI, sizeof(XkbSymInterpretRec)); if (!compat->sym_interpret) { free(compat); return BadAlloc; } } compat->size_si = nSI; compat->num_si = 0; memset((char *) &compat->groups[0], 0, XkbNumKbdGroups * sizeof(XkbModsRec)); xkb->compat = compat; return Success; } void XkbFreeCompatMap(XkbDescPtr xkb, unsigned which, Bool freeMap) { register XkbCompatMapPtr compat; if ((xkb == NULL) || (xkb->compat == NULL)) return; compat = xkb->compat; if (freeMap) which = XkbAllCompatMask; if (which & XkbGroupCompatMask) memset((char *) &compat->groups[0], 0, XkbNumKbdGroups * sizeof(XkbModsRec)); if (which & XkbSymInterpMask) { if ((compat->sym_interpret) && (compat->size_si > 0)) free(compat->sym_interpret); compat->size_si = compat->num_si = 0; compat->sym_interpret = NULL; } if (freeMap) { free(compat); xkb->compat = NULL; } return; } /***===================================================================***/ Status XkbAllocNames(XkbDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases) { XkbNamesPtr names; if (xkb == NULL) return BadMatch; if (xkb->names == NULL) { xkb->names = calloc(1, sizeof(XkbNamesRec)); if (xkb->names == NULL) return BadAlloc; } names = xkb->names; if ((which & XkbKTLevelNamesMask) && (xkb->map != NULL) && (xkb->map->types != NULL)) { register int i; XkbKeyTypePtr type; type = xkb->map->types; for (i = 0; i < xkb->map->num_types; i++, type++) { if (type->level_names == NULL) { type->level_names = calloc(type->num_levels, sizeof(Atom)); if (type->level_names == NULL) return BadAlloc; } } } if ((which & XkbKeyNamesMask) && (names->keys == NULL)) { if ((!XkbIsLegalKeycode(xkb->min_key_code)) || (!XkbIsLegalKeycode(xkb->max_key_code)) || (xkb->max_key_code < xkb->min_key_code)) return BadValue; names->keys = calloc((xkb->max_key_code + 1), sizeof(XkbKeyNameRec)); if (names->keys == NULL) return BadAlloc; } if ((which & XkbKeyAliasesMask) && (nTotalAliases > 0)) { if (names->key_aliases == NULL) { names->key_aliases = calloc(nTotalAliases, sizeof(XkbKeyAliasRec)); } else if (nTotalAliases > names->num_key_aliases) { XkbKeyAliasRec *prev_aliases = names->key_aliases; names->key_aliases = realloc(names->key_aliases, nTotalAliases * sizeof(XkbKeyAliasRec)); if (names->key_aliases != NULL) { memset(&names->key_aliases[names->num_key_aliases], 0, (nTotalAliases - names->num_key_aliases) * sizeof(XkbKeyAliasRec)); } else { free(prev_aliases); } } if (names->key_aliases == NULL) { names->num_key_aliases = 0; return BadAlloc; } names->num_key_aliases = nTotalAliases; } if ((which & XkbRGNamesMask) && (nTotalRG > 0)) { if (names->radio_groups == NULL) { names->radio_groups = calloc(nTotalRG, sizeof(Atom)); } else if (nTotalRG > names->num_rg) { Atom *prev_radio_groups = names->radio_groups; names->radio_groups = realloc(names->radio_groups, nTotalRG * sizeof(Atom)); if (names->radio_groups != NULL) { memset(&names->radio_groups[names->num_rg], 0, (nTotalRG - names->num_rg) * sizeof(Atom)); } else { free(prev_radio_groups); } } if (names->radio_groups == NULL) return BadAlloc; names->num_rg = nTotalRG; } return Success; } void XkbFreeNames(XkbDescPtr xkb, unsigned which, Bool freeMap) { XkbNamesPtr names; if ((xkb == NULL) || (xkb->names == NULL)) return; names = xkb->names; if (freeMap) which = XkbAllNamesMask; if (which & XkbKTLevelNamesMask) { XkbClientMapPtr map = xkb->map; if ((map != NULL) && (map->types != NULL)) { register int i; register XkbKeyTypePtr type; type = map->types; for (i = 0; i < map->num_types; i++, type++) { free(type->level_names); type->level_names = NULL; } } } if ((which & XkbKeyNamesMask) && (names->keys != NULL)) { free(names->keys); names->keys = NULL; names->num_keys = 0; } if ((which & XkbKeyAliasesMask) && (names->key_aliases)) { free(names->key_aliases); names->key_aliases = NULL; names->num_key_aliases = 0; } if ((which & XkbRGNamesMask) && (names->radio_groups)) { free(names->radio_groups); names->radio_groups = NULL; names->num_rg = 0; } if (freeMap) { free(names); xkb->names = NULL; } return; } /***===================================================================***/ /*ARGSUSED*/ Status XkbAllocControls(XkbDescPtr xkb, unsigned which) { if (xkb == NULL) return BadMatch; if (xkb->ctrls == NULL) { xkb->ctrls = calloc(1, sizeof(XkbControlsRec)); if (!xkb->ctrls) return BadAlloc; } return Success; } /*ARGSUSED*/ static void XkbFreeControls(XkbDescPtr xkb, unsigned which, Bool freeMap) { if (freeMap && (xkb != NULL) && (xkb->ctrls != NULL)) { free(xkb->ctrls); xkb->ctrls = NULL; } return; } /***===================================================================***/ Status XkbAllocIndicatorMaps(XkbDescPtr xkb) { if (xkb == NULL) return BadMatch; if (xkb->indicators == NULL) { xkb->indicators = calloc(1, sizeof(XkbIndicatorRec)); if (!xkb->indicators) return BadAlloc; } return Success; } static void XkbFreeIndicatorMaps(XkbDescPtr xkb) { if ((xkb != NULL) && (xkb->indicators != NULL)) { free(xkb->indicators); xkb->indicators = NULL; } return; } /***====================================================================***/ XkbDescRec * XkbAllocKeyboard(void) { XkbDescRec *xkb; xkb = calloc(1, sizeof(XkbDescRec)); if (xkb) xkb->device_spec = XkbUseCoreKbd; return xkb; } void XkbFreeKeyboard(XkbDescPtr xkb, unsigned which, Bool freeAll) { if (xkb == NULL) return; if (freeAll) which = XkbAllComponentsMask; if (which & XkbClientMapMask) XkbFreeClientMap(xkb, XkbAllClientInfoMask, TRUE); if (which & XkbServerMapMask) XkbFreeServerMap(xkb, XkbAllServerInfoMask, TRUE); if (which & XkbCompatMapMask) XkbFreeCompatMap(xkb, XkbAllCompatMask, TRUE); if (which & XkbIndicatorMapMask) XkbFreeIndicatorMaps(xkb); if (which & XkbNamesMask) XkbFreeNames(xkb, XkbAllNamesMask, TRUE); if ((which & XkbGeometryMask) && (xkb->geom != NULL)) { XkbFreeGeometry(xkb->geom, XkbGeomAllMask, TRUE); /* PERHAPS BONGHITS etc */ xkb->geom = NULL; } if (which & XkbControlsMask) XkbFreeControls(xkb, XkbAllControlsMask, TRUE); if (freeAll) free(xkb); return; } /***====================================================================***/ void XkbFreeComponentNames(XkbComponentNamesPtr names, Bool freeNames) { if (names) { free(names->keycodes); free(names->types); free(names->compat); free(names->symbols); free(names->geometry); memset(names, 0, sizeof(XkbComponentNamesRec)); } if (freeNames) free(names); } xorg-server-1.17.1/xkb/xkbtext.c0000664000175100017510000011102712456571574013454 00000000000000/************************************************************ Copyright (c) 1994 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 "misc.h" #include "inputstr.h" #include "dix.h" #include "xkbstr.h" #define XKBSRV_NEED_FILE_FUNCS 1 #include #include "xkbgeom.h" /***====================================================================***/ #define BUFFER_SIZE 512 static char textBuffer[BUFFER_SIZE]; static int tbNext = 0; static char * tbGetBuffer(unsigned size) { char *rtrn; if (size >= BUFFER_SIZE) return NULL; if ((BUFFER_SIZE - tbNext) <= size) tbNext = 0; rtrn = &textBuffer[tbNext]; tbNext += size; return rtrn; } /***====================================================================***/ char * XkbAtomText(Atom atm, unsigned format) { const char *atmstr; char *rtrn, *tmp; atmstr = NameForAtom(atm); if (atmstr != NULL) { int len; len = strlen(atmstr) + 1; if (len > BUFFER_SIZE) len = BUFFER_SIZE - 2; rtrn = tbGetBuffer(len); strlcpy(rtrn, atmstr, len); } else { rtrn = tbGetBuffer(1); rtrn[0] = '\0'; } if (format == XkbCFile) { for (tmp = rtrn; *tmp != '\0'; tmp++) { if ((tmp == rtrn) && (!isalpha(*tmp))) *tmp = '_'; else if (!isalnum(*tmp)) *tmp = '_'; } } return XkbStringText(rtrn, format); } /***====================================================================***/ char * XkbVModIndexText(XkbDescPtr xkb, unsigned ndx, unsigned format) { register int len; register Atom *vmodNames; char *rtrn; const char *tmp; char numBuf[20]; if (xkb && xkb->names) vmodNames = xkb->names->vmods; else vmodNames = NULL; tmp = NULL; if (ndx >= XkbNumVirtualMods) tmp = "illegal"; else if (vmodNames && (vmodNames[ndx] != None)) tmp = NameForAtom(vmodNames[ndx]); if (tmp == NULL) { snprintf(numBuf, sizeof(numBuf), "%d", ndx); tmp = numBuf; } len = strlen(tmp) + 1; if (format == XkbCFile) len += 4; if (len >= BUFFER_SIZE) len = BUFFER_SIZE - 1; rtrn = tbGetBuffer(len); if (format == XkbCFile) { strcpy(rtrn, "vmod_"); strncpy(&rtrn[5], tmp, len - 4); } else strncpy(rtrn, tmp, len); return rtrn; } char * XkbVModMaskText(XkbDescPtr xkb, unsigned modMask, unsigned mask, unsigned format) { 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) mm = XkbModMaskText(modMask, format); else mm = NULL; 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) *str++ = '|'; else *str++ = '+'; len--; } } if (format == XkbCFile) sprintf(str, "%sMask", tmp); else strcpy(str, tmp); str = &str[len - 1]; } } str = buf; } else str = NULL; if (mm) len = strlen(mm); else len = 0; if (str) len += strlen(str) + (mm == NULL ? 0 : 1); if (len >= BUFFER_SIZE) len = BUFFER_SIZE - 1; rtrn = tbGetBuffer(len + 1); rtrn[0] = '\0'; if (mm != NULL) { i = strlen(mm); if (i > len) i = len; strcpy(rtrn, mm); } else { i = 0; } if (str != NULL) { if (mm != NULL) { if (format == XkbCFile) strcat(rtrn, "|"); else strcat(rtrn, "+"); } strncat(rtrn, str, len - i); } rtrn[len] = '\0'; return rtrn; } static const char *modNames[XkbNumModifiers] = { "Shift", "Lock", "Control", "Mod1", "Mod2", "Mod3", "Mod4", "Mod5" }; char * XkbModIndexText(unsigned ndx, unsigned format) { char *rtrn; char buf[100]; if (format == XkbCFile) { if (ndx < XkbNumModifiers) snprintf(buf, sizeof(buf), "%sMapIndex", modNames[ndx]); else if (ndx == XkbNoModifier) snprintf(buf, sizeof(buf), "XkbNoModifier"); else snprintf(buf, sizeof(buf), "0x%02x", ndx); } else { if (ndx < XkbNumModifiers) strcpy(buf, modNames[ndx]); else if (ndx == XkbNoModifier) strcpy(buf, "none"); else snprintf(buf, sizeof(buf), "ILLEGAL_%02x", ndx); } rtrn = tbGetBuffer(strlen(buf) + 1); strcpy(rtrn, buf); return rtrn; } char * XkbModMaskText(unsigned mask, unsigned format) { register int i, bit; char buf[64], *rtrn; if ((mask & 0xff) == 0xff) { if (format == XkbCFile) strcpy(buf, "0xff"); else strcpy(buf, "all"); } else if ((mask & 0xff) == 0) { if (format == XkbCFile) strcpy(buf, "0"); else strcpy(buf, "none"); } else { char *str = buf; buf[0] = '\0'; for (i = 0, bit = 1; i < XkbNumModifiers; i++, bit <<= 1) { if (mask & bit) { if (str != buf) { if (format == XkbCFile) *str++ = '|'; else *str++ = '+'; } strcpy(str, modNames[i]); str = &str[strlen(str)]; if (format == XkbCFile) { strcpy(str, "Mask"); str += 4; } } } } rtrn = tbGetBuffer(strlen(buf) + 1); strcpy(rtrn, buf); return rtrn; } /***====================================================================***/ /*ARGSUSED*/ char * XkbConfigText(unsigned config, unsigned format) { static char *buf; buf = tbGetBuffer(32); switch (config) { case XkmSemanticsFile: strcpy(buf, "Semantics"); break; case XkmLayoutFile: strcpy(buf, "Layout"); break; case XkmKeymapFile: strcpy(buf, "Keymap"); break; case XkmGeometryFile: case XkmGeometryIndex: strcpy(buf, "Geometry"); break; case XkmTypesIndex: strcpy(buf, "Types"); break; case XkmCompatMapIndex: strcpy(buf, "CompatMap"); break; case XkmSymbolsIndex: strcpy(buf, "Symbols"); break; case XkmIndicatorsIndex: strcpy(buf, "Indicators"); break; case XkmKeyNamesIndex: strcpy(buf, "KeyNames"); break; case XkmVirtualModsIndex: strcpy(buf, "VirtualMods"); break; default: sprintf(buf, "unknown(%d)", config); break; } return buf; } /***====================================================================***/ char * XkbKeysymText(KeySym sym, unsigned format) { static char buf[32]; if (sym == NoSymbol) strcpy(buf, "NoSymbol"); else snprintf(buf, sizeof(buf), "0x%lx", (long) sym); return buf; } char * XkbKeyNameText(char *name, unsigned format) { char *buf; if (format == XkbCFile) { buf = tbGetBuffer(5); memcpy(buf, name, 4); buf[4] = '\0'; } else { int len; buf = tbGetBuffer(7); buf[0] = '<'; memcpy(&buf[1], name, 4); buf[5] = '\0'; len = strlen(buf); buf[len++] = '>'; buf[len] = '\0'; } return buf; } /***====================================================================***/ static const char *siMatchText[5] = { "NoneOf", "AnyOfOrNone", "AnyOf", "AllOf", "Exactly" }; const char * XkbSIMatchText(unsigned type, unsigned format) { static char buf[40]; const char *rtrn; switch (type & XkbSI_OpMask) { case XkbSI_NoneOf: rtrn = siMatchText[0]; break; case XkbSI_AnyOfOrNone: rtrn = siMatchText[1]; break; case XkbSI_AnyOf: rtrn = siMatchText[2]; break; case XkbSI_AllOf: rtrn = siMatchText[3]; break; case XkbSI_Exactly: rtrn = siMatchText[4]; break; default: snprintf(buf, sizeof(buf), "0x%x", type & XkbSI_OpMask); return buf; } if (format == XkbCFile) { if (type & XkbSI_LevelOneOnly) snprintf(buf, sizeof(buf), "XkbSI_LevelOneOnly|XkbSI_%s", rtrn); else snprintf(buf, sizeof(buf), "XkbSI_%s", rtrn); rtrn = buf; } return rtrn; } /***====================================================================***/ static const char *imWhichNames[] = { "base", "latched", "locked", "effective", "compat" }; char * XkbIMWhichStateMaskText(unsigned use_which, unsigned format) { int len; unsigned i, bit, tmp; char *buf; if (use_which == 0) { buf = tbGetBuffer(2); strcpy(buf, "0"); return buf; } tmp = use_which & XkbIM_UseAnyMods; for (len = i = 0, bit = 1; tmp != 0; i++, bit <<= 1) { if (tmp & bit) { tmp &= ~bit; len += strlen(imWhichNames[i]) + 1; if (format == XkbCFile) len += 9; } } buf = tbGetBuffer(len + 1); tmp = use_which & XkbIM_UseAnyMods; for (len = i = 0, bit = 1; tmp != 0; i++, bit <<= 1) { if (tmp & bit) { tmp &= ~bit; if (format == XkbCFile) { if (len != 0) buf[len++] = '|'; sprintf(&buf[len], "XkbIM_Use%s", imWhichNames[i]); buf[len + 9] = toupper(buf[len + 9]); } else { if (len != 0) buf[len++] = '+'; sprintf(&buf[len], "%s", imWhichNames[i]); } len += strlen(&buf[len]); } } return buf; } static const char *ctrlNames[] = { "repeatKeys", "slowKeys", "bounceKeys", "stickyKeys", "mouseKeys", "mouseKeysAccel", "accessXKeys", "accessXTimeout", "accessXFeedback", "audibleBell", "overlay1", "overlay2", "ignoreGroupLock" }; char * XkbControlsMaskText(unsigned ctrls, unsigned format) { int len; unsigned i, bit, tmp; char *buf; if (ctrls == 0) { buf = tbGetBuffer(5); if (format == XkbCFile) strcpy(buf, "0"); else strcpy(buf, "none"); return buf; } tmp = ctrls & XkbAllBooleanCtrlsMask; for (len = i = 0, bit = 1; tmp != 0; i++, bit <<= 1) { if (tmp & bit) { tmp &= ~bit; len += strlen(ctrlNames[i]) + 1; if (format == XkbCFile) len += 7; } } buf = tbGetBuffer(len + 1); tmp = ctrls & XkbAllBooleanCtrlsMask; for (len = i = 0, bit = 1; tmp != 0; i++, bit <<= 1) { if (tmp & bit) { tmp &= ~bit; if (format == XkbCFile) { if (len != 0) buf[len++] = '|'; sprintf(&buf[len], "Xkb%sMask", ctrlNames[i]); buf[len + 3] = toupper(buf[len + 3]); } else { if (len != 0) buf[len++] = '+'; sprintf(&buf[len], "%s", ctrlNames[i]); } len += strlen(&buf[len]); } } return buf; } /***====================================================================***/ char * XkbStringText(char *str, unsigned format) { char *buf; register char *in, *out; int len; Bool ok; if (str == NULL) { buf = tbGetBuffer(2); buf[0] = '\0'; return buf; } else if (format == XkbXKMFile) return str; for (ok = TRUE, len = 0, in = str; *in != '\0'; in++, len++) { if (!isprint(*in)) { ok = FALSE; switch (*in) { case '\n': case '\t': case '\v': case '\b': case '\r': case '\f': len++; break; default: len += 4; break; } } } if (ok) return str; buf = tbGetBuffer(len + 1); for (in = str, out = buf; *in != '\0'; in++) { if (isprint(*in)) *out++ = *in; else { *out++ = '\\'; if (*in == '\n') *out++ = 'n'; else if (*in == '\t') *out++ = 't'; else if (*in == '\v') *out++ = 'v'; else if (*in == '\b') *out++ = 'b'; else if (*in == '\r') *out++ = 'r'; else if (*in == '\f') *out++ = 'f'; else if ((*in == '\033') && (format == XkbXKMFile)) { *out++ = 'e'; } else { *out++ = '0'; sprintf(out, "%o", *in); while (*out != '\0') out++; } } } *out++ = '\0'; return buf; } /***====================================================================***/ char * XkbGeomFPText(int val, unsigned format) { int whole, frac; char *buf; buf = tbGetBuffer(12); if (format == XkbCFile) { sprintf(buf, "%d", val); } else { whole = val / XkbGeomPtsPerMM; frac = val % XkbGeomPtsPerMM; if (frac != 0) sprintf(buf, "%d.%d", whole, frac); else sprintf(buf, "%d", whole); } return buf; } char * XkbDoodadTypeText(unsigned type, unsigned format) { char *buf; if (format == XkbCFile) { buf = tbGetBuffer(24); if (type == XkbOutlineDoodad) strcpy(buf, "XkbOutlineDoodad"); else if (type == XkbSolidDoodad) strcpy(buf, "XkbSolidDoodad"); else if (type == XkbTextDoodad) strcpy(buf, "XkbTextDoodad"); else if (type == XkbIndicatorDoodad) strcpy(buf, "XkbIndicatorDoodad"); else if (type == XkbLogoDoodad) strcpy(buf, "XkbLogoDoodad"); else sprintf(buf, "UnknownDoodad%d", type); } else { buf = tbGetBuffer(12); if (type == XkbOutlineDoodad) strcpy(buf, "outline"); else if (type == XkbSolidDoodad) strcpy(buf, "solid"); else if (type == XkbTextDoodad) strcpy(buf, "text"); else if (type == XkbIndicatorDoodad) strcpy(buf, "indicator"); else if (type == XkbLogoDoodad) strcpy(buf, "logo"); else sprintf(buf, "unknown%d", type); } return buf; } static const char *actionTypeNames[XkbSA_NumActions] = { "NoAction", "SetMods", "LatchMods", "LockMods", "SetGroup", "LatchGroup", "LockGroup", "MovePtr", "PtrBtn", "LockPtrBtn", "SetPtrDflt", "ISOLock", "Terminate", "SwitchScreen", "SetControls", "LockControls", "ActionMessage", "RedirectKey", "DeviceBtn", "LockDeviceBtn" }; const char * XkbActionTypeText(unsigned type, unsigned format) { static char buf[32]; const char *rtrn; if (type <= XkbSA_LastAction) { rtrn = actionTypeNames[type]; if (format == XkbCFile) { snprintf(buf, sizeof(buf), "XkbSA_%s", rtrn); return buf; } return rtrn; } snprintf(buf, sizeof(buf), "Private"); return buf; } /***====================================================================***/ static int TryCopyStr(char *to, const char *from, int *pLeft) { register int len; if (*pLeft > 0) { len = strlen(from); if (len < ((*pLeft) - 3)) { strcat(to, from); *pLeft -= len; return TRUE; } } *pLeft = -1; return FALSE; } /*ARGSUSED*/ static Bool CopyNoActionArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { return TRUE; } static Bool CopyModActionArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbModAction *act; unsigned tmp; act = &action->mods; tmp = XkbModActionVMods(act); TryCopyStr(buf, "modifiers=", sz); if (act->flags & XkbSA_UseModMapMods) TryCopyStr(buf, "modMapMods", sz); else if (act->real_mods || tmp) { TryCopyStr(buf, XkbVModMaskText(xkb, act->real_mods, tmp, XkbXKBFile), sz); } else TryCopyStr(buf, "none", sz); if (act->type == XkbSA_LockMods) return TRUE; if (act->flags & XkbSA_ClearLocks) TryCopyStr(buf, ",clearLocks", sz); if (act->flags & XkbSA_LatchToLock) TryCopyStr(buf, ",latchToLock", sz); return TRUE; } /*ARGSUSED*/ static Bool CopyGroupActionArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbGroupAction *act; char tbuf[32]; act = &action->group; TryCopyStr(buf, "group=", sz); if (act->flags & XkbSA_GroupAbsolute) snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act) + 1); else if (XkbSAGroup(act) < 0) snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act)); else snprintf(tbuf, sizeof(tbuf), "+%d", XkbSAGroup(act)); TryCopyStr(buf, tbuf, sz); if (act->type == XkbSA_LockGroup) return TRUE; if (act->flags & XkbSA_ClearLocks) TryCopyStr(buf, ",clearLocks", sz); if (act->flags & XkbSA_LatchToLock) TryCopyStr(buf, ",latchToLock", sz); return TRUE; } /*ARGSUSED*/ static Bool CopyMovePtrArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbPtrAction *act; int x, y; char tbuf[32]; act = &action->ptr; x = XkbPtrActionX(act); y = XkbPtrActionY(act); if ((act->flags & XkbSA_MoveAbsoluteX) || (x < 0)) snprintf(tbuf, sizeof(tbuf), "x=%d", x); else snprintf(tbuf, sizeof(tbuf), "x=+%d", x); TryCopyStr(buf, tbuf, sz); if ((act->flags & XkbSA_MoveAbsoluteY) || (y < 0)) snprintf(tbuf, sizeof(tbuf), ",y=%d", y); else snprintf(tbuf, sizeof(tbuf), ",y=+%d", y); TryCopyStr(buf, tbuf, sz); if (act->flags & XkbSA_NoAcceleration) TryCopyStr(buf, ",!accel", sz); return TRUE; } /*ARGSUSED*/ static Bool CopyPtrBtnArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbPtrBtnAction *act; char tbuf[32]; act = &action->btn; TryCopyStr(buf, "button=", sz); if ((act->button > 0) && (act->button < 6)) { snprintf(tbuf, sizeof(tbuf), "%d", act->button); TryCopyStr(buf, tbuf, sz); } else TryCopyStr(buf, "default", sz); if (act->count > 0) { snprintf(tbuf, sizeof(tbuf), ",count=%d", act->count); TryCopyStr(buf, tbuf, sz); } if (action->type == XkbSA_LockPtrBtn) { switch (act->flags & (XkbSA_LockNoUnlock | XkbSA_LockNoLock)) { case XkbSA_LockNoLock: TryCopyStr(buf, ",affect=unlock", sz); break; case XkbSA_LockNoUnlock: TryCopyStr(buf, ",affect=lock", sz); break; case XkbSA_LockNoUnlock | XkbSA_LockNoLock: TryCopyStr(buf, ",affect=neither", sz); break; default: TryCopyStr(buf, ",affect=both", sz); break; } } return TRUE; } /*ARGSUSED*/ static Bool CopySetPtrDfltArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbPtrDfltAction *act; char tbuf[32]; act = &action->dflt; if (act->affect == XkbSA_AffectDfltBtn) { TryCopyStr(buf, "affect=button,button=", sz); if ((act->flags & XkbSA_DfltBtnAbsolute) || (XkbSAPtrDfltValue(act) < 0)) snprintf(tbuf, sizeof(tbuf), "%d", XkbSAPtrDfltValue(act)); else snprintf(tbuf, sizeof(tbuf), "+%d", XkbSAPtrDfltValue(act)); TryCopyStr(buf, tbuf, sz); } return TRUE; } static Bool CopyISOLockArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbISOAction *act; char tbuf[64]; act = &action->iso; if (act->flags & XkbSA_ISODfltIsGroup) { TryCopyStr(tbuf, "group=", sz); if (act->flags & XkbSA_GroupAbsolute) snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act) + 1); else if (XkbSAGroup(act) < 0) snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act)); else snprintf(tbuf, sizeof(tbuf), "+%d", XkbSAGroup(act)); TryCopyStr(buf, tbuf, sz); } else { unsigned tmp; tmp = XkbModActionVMods(act); TryCopyStr(buf, "modifiers=", sz); if (act->flags & XkbSA_UseModMapMods) TryCopyStr(buf, "modMapMods", sz); else if (act->real_mods || tmp) { if (act->real_mods) { TryCopyStr(buf, XkbModMaskText(act->real_mods, XkbXKBFile), sz); if (tmp) TryCopyStr(buf, "+", sz); } if (tmp) TryCopyStr(buf, XkbVModMaskText(xkb, 0, tmp, XkbXKBFile), sz); } else TryCopyStr(buf, "none", sz); } TryCopyStr(buf, ",affect=", sz); if ((act->affect & XkbSA_ISOAffectMask) == 0) TryCopyStr(buf, "all", sz); else { int nOut = 0; if ((act->affect & XkbSA_ISONoAffectMods) == 0) { TryCopyStr(buf, "mods", sz); nOut++; } if ((act->affect & XkbSA_ISONoAffectGroup) == 0) { snprintf(tbuf, sizeof(tbuf), "%sgroups", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if ((act->affect & XkbSA_ISONoAffectPtr) == 0) { snprintf(tbuf, sizeof(tbuf), "%spointer", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if ((act->affect & XkbSA_ISONoAffectCtrls) == 0) { snprintf(tbuf, sizeof(tbuf), "%scontrols", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } } return TRUE; } /*ARGSUSED*/ static Bool CopySwitchScreenArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbSwitchScreenAction *act; char tbuf[32]; act = &action->screen; if ((act->flags & XkbSA_SwitchAbsolute) || (XkbSAScreen(act) < 0)) snprintf(tbuf, sizeof(tbuf), "screen=%d", XkbSAScreen(act)); else snprintf(tbuf, sizeof(tbuf), "screen=+%d", XkbSAScreen(act)); TryCopyStr(buf, tbuf, sz); if (act->flags & XkbSA_SwitchApplication) TryCopyStr(buf, ",!same", sz); else TryCopyStr(buf, ",same", sz); return TRUE; } /*ARGSUSED*/ static Bool CopySetLockControlsArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbCtrlsAction *act; unsigned tmp; char tbuf[32]; act = &action->ctrls; tmp = XkbActionCtrls(act); TryCopyStr(buf, "controls=", sz); if (tmp == 0) TryCopyStr(buf, "none", sz); else if ((tmp & XkbAllBooleanCtrlsMask) == XkbAllBooleanCtrlsMask) TryCopyStr(buf, "all", sz); else { int nOut = 0; if (tmp & XkbRepeatKeysMask) { snprintf(tbuf, sizeof(tbuf), "%sRepeatKeys", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbSlowKeysMask) { snprintf(tbuf, sizeof(tbuf), "%sSlowKeys", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbBounceKeysMask) { snprintf(tbuf, sizeof(tbuf), "%sBounceKeys", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbStickyKeysMask) { snprintf(tbuf, sizeof(tbuf), "%sStickyKeys", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbMouseKeysMask) { snprintf(tbuf, sizeof(tbuf), "%sMouseKeys", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbMouseKeysAccelMask) { snprintf(tbuf, sizeof(tbuf), "%sMouseKeysAccel", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbAccessXKeysMask) { snprintf(tbuf, sizeof(tbuf), "%sAccessXKeys", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbAccessXTimeoutMask) { snprintf(tbuf, sizeof(tbuf), "%sAccessXTimeout", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbAccessXFeedbackMask) { snprintf(tbuf, sizeof(tbuf), "%sAccessXFeedback", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbAudibleBellMask) { snprintf(tbuf, sizeof(tbuf), "%sAudibleBell", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbOverlay1Mask) { snprintf(tbuf, sizeof(tbuf), "%sOverlay1", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbOverlay2Mask) { snprintf(tbuf, sizeof(tbuf), "%sOverlay2", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } if (tmp & XkbIgnoreGroupLockMask) { snprintf(tbuf, sizeof(tbuf), "%sIgnoreGroupLock", (nOut > 0 ? "+" : "")); TryCopyStr(buf, tbuf, sz); nOut++; } } return TRUE; } /*ARGSUSED*/ static Bool CopyActionMessageArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbMessageAction *act; unsigned all; char tbuf[32]; act = &action->msg; all = XkbSA_MessageOnPress | XkbSA_MessageOnRelease; TryCopyStr(buf, "report=", sz); if ((act->flags & all) == 0) TryCopyStr(buf, "none", sz); else if ((act->flags & all) == all) TryCopyStr(buf, "all", sz); else if (act->flags & XkbSA_MessageOnPress) TryCopyStr(buf, "KeyPress", sz); else TryCopyStr(buf, "KeyRelease", sz); snprintf(tbuf, sizeof(tbuf), ",data[0]=0x%02x", act->message[0]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[1]=0x%02x", act->message[1]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[2]=0x%02x", act->message[2]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[3]=0x%02x", act->message[3]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[4]=0x%02x", act->message[4]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[5]=0x%02x", act->message[5]); TryCopyStr(buf, tbuf, sz); return TRUE; } static Bool CopyRedirectKeyArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbRedirectKeyAction *act; char tbuf[32], *tmp; unsigned kc; unsigned vmods, vmods_mask; act = &action->redirect; kc = act->new_key; vmods = XkbSARedirectVMods(act); vmods_mask = XkbSARedirectVModsMask(act); if (xkb && xkb->names && xkb->names->keys && (kc <= xkb->max_key_code) && (xkb->names->keys[kc].name[0] != '\0')) { char *kn; kn = XkbKeyNameText(xkb->names->keys[kc].name, XkbXKBFile); snprintf(tbuf, sizeof(tbuf), "key=%s", kn); } else snprintf(tbuf, sizeof(tbuf), "key=%d", kc); TryCopyStr(buf, tbuf, sz); if ((act->mods_mask == 0) && (vmods_mask == 0)) return TRUE; if ((act->mods_mask == XkbAllModifiersMask) && (vmods_mask == XkbAllVirtualModsMask)) { tmp = XkbVModMaskText(xkb, act->mods, vmods, XkbXKBFile); TryCopyStr(buf, ",mods=", sz); TryCopyStr(buf, tmp, sz); } else { if ((act->mods_mask & act->mods) || (vmods_mask & vmods)) { tmp = XkbVModMaskText(xkb, act->mods_mask & act->mods, vmods_mask & vmods, XkbXKBFile); TryCopyStr(buf, ",mods= ", sz); TryCopyStr(buf, tmp, sz); } if ((act->mods_mask & (~act->mods)) || (vmods_mask & (~vmods))) { tmp = XkbVModMaskText(xkb, act->mods_mask & (~act->mods), vmods_mask & (~vmods), XkbXKBFile); TryCopyStr(buf, ",clearMods= ", sz); TryCopyStr(buf, tmp, sz); } } return TRUE; } /*ARGSUSED*/ static Bool CopyDeviceBtnArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbDeviceBtnAction *act; char tbuf[32]; act = &action->devbtn; snprintf(tbuf, sizeof(tbuf), "device= %d", act->device); TryCopyStr(buf, tbuf, sz); TryCopyStr(buf, ",button=", sz); snprintf(tbuf, sizeof(tbuf), "%d", act->button); TryCopyStr(buf, tbuf, sz); if (act->count > 0) { snprintf(tbuf, sizeof(tbuf), ",count=%d", act->count); TryCopyStr(buf, tbuf, sz); } if (action->type == XkbSA_LockDeviceBtn) { switch (act->flags & (XkbSA_LockNoUnlock | XkbSA_LockNoLock)) { case XkbSA_LockNoLock: TryCopyStr(buf, ",affect=unlock", sz); break; case XkbSA_LockNoUnlock: TryCopyStr(buf, ",affect=lock", sz); break; case XkbSA_LockNoUnlock | XkbSA_LockNoLock: TryCopyStr(buf, ",affect=neither", sz); break; default: TryCopyStr(buf, ",affect=both", sz); break; } } return TRUE; } /*ARGSUSED*/ static Bool CopyOtherArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz) { XkbAnyAction *act; char tbuf[32]; act = &action->any; snprintf(tbuf, sizeof(tbuf), "type=0x%02x", act->type); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[0]=0x%02x", act->data[0]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[1]=0x%02x", act->data[1]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[2]=0x%02x", act->data[2]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[3]=0x%02x", act->data[3]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[4]=0x%02x", act->data[4]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[5]=0x%02x", act->data[5]); TryCopyStr(buf, tbuf, sz); snprintf(tbuf, sizeof(tbuf), ",data[6]=0x%02x", act->data[6]); TryCopyStr(buf, tbuf, sz); return TRUE; } typedef Bool (*actionCopy) (XkbDescPtr /* xkb */ , XkbAction * /* action */ , char * /* buf */ , int * /* sz */ ); static actionCopy copyActionArgs[XkbSA_NumActions] = { CopyNoActionArgs /* NoAction */ , CopyModActionArgs /* SetMods */ , CopyModActionArgs /* LatchMods */ , CopyModActionArgs /* LockMods */ , CopyGroupActionArgs /* SetGroup */ , CopyGroupActionArgs /* LatchGroup */ , CopyGroupActionArgs /* LockGroup */ , CopyMovePtrArgs /* MovePtr */ , CopyPtrBtnArgs /* PtrBtn */ , CopyPtrBtnArgs /* LockPtrBtn */ , CopySetPtrDfltArgs /* SetPtrDflt */ , CopyISOLockArgs /* ISOLock */ , CopyNoActionArgs /* Terminate */ , CopySwitchScreenArgs /* SwitchScreen */ , CopySetLockControlsArgs /* SetControls */ , CopySetLockControlsArgs /* LockControls */ , CopyActionMessageArgs /* ActionMessage */ , CopyRedirectKeyArgs /* RedirectKey */ , CopyDeviceBtnArgs /* DeviceBtn */ , CopyDeviceBtnArgs /* LockDeviceBtn */ }; #define ACTION_SZ 256 char * XkbActionText(XkbDescPtr xkb, XkbAction *action, unsigned format) { char buf[ACTION_SZ], *tmp; int sz; if (format == XkbCFile) { snprintf(buf, sizeof(buf), "{ %20s, { 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x } }", XkbActionTypeText(action->type, XkbCFile), action->any.data[0], action->any.data[1], action->any.data[2], action->any.data[3], action->any.data[4], action->any.data[5], action->any.data[6]); } else { snprintf(buf, sizeof(buf), "%s(", XkbActionTypeText(action->type, XkbXKBFile)); sz = ACTION_SZ - strlen(buf) + 2; /* room for close paren and NULL */ if (action->type < (unsigned) XkbSA_NumActions) (*copyActionArgs[action->type]) (xkb, action, buf, &sz); else CopyOtherArgs(xkb, action, buf, &sz); TryCopyStr(buf, ")", &sz); } tmp = tbGetBuffer(strlen(buf) + 1); if (tmp != NULL) strcpy(tmp, buf); return tmp; } char * XkbBehaviorText(XkbDescPtr xkb, XkbBehavior * behavior, unsigned format) { char buf[256], *tmp; if (format == XkbCFile) { if (behavior->type == XkbKB_Default) snprintf(buf, sizeof(buf), "{ 0, 0 }"); else snprintf(buf, sizeof(buf), "{ %3d, 0x%02x }", behavior->type, behavior->data); } else { unsigned type, permanent; type = behavior->type & XkbKB_OpMask; permanent = ((behavior->type & XkbKB_Permanent) != 0); if (type == XkbKB_Lock) { snprintf(buf, sizeof(buf), "lock= %s", (permanent ? "Permanent" : "TRUE")); } else if (type == XkbKB_RadioGroup) { int g; g = ((behavior->data) & (~XkbKB_RGAllowNone)) + 1; if (XkbKB_RGAllowNone & behavior->data) { snprintf(buf, sizeof(buf), "allowNone,"); tmp = &buf[strlen(buf)]; } else tmp = buf; if (permanent) sprintf(tmp, "permanentRadioGroup= %d", g); else sprintf(tmp, "radioGroup= %d", g); } else if ((type == XkbKB_Overlay1) || (type == XkbKB_Overlay2)) { int ndx, kc; char *kn; ndx = ((type == XkbKB_Overlay1) ? 1 : 2); kc = behavior->data; if ((xkb) && (xkb->names) && (xkb->names->keys)) kn = XkbKeyNameText(xkb->names->keys[kc].name, XkbXKBFile); else { static char tbuf[8]; snprintf(tbuf, sizeof(tbuf), "%d", kc); kn = tbuf; } if (permanent) snprintf(buf, sizeof(buf), "permanentOverlay%d= %s", ndx, kn); else snprintf(buf, sizeof(buf), "overlay%d= %s", ndx, kn); } } tmp = tbGetBuffer(strlen(buf) + 1); if (tmp != NULL) strcpy(tmp, buf); return tmp; } /***====================================================================***/ char * XkbIndentText(unsigned size) { static char buf[32]; register int i; if (size > 31) size = 31; for (i = 0; i < size; i++) { buf[i] = ' '; } buf[size] = '\0'; return buf; } xorg-server-1.17.1/xkb/ddxLEDs.c0000664000175100017510000000437112456571574013255 00000000000000/************************************************************ Copyright (c) 1993 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 "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include #include static void XkbDDXUpdateIndicators(DeviceIntPtr dev, CARD32 new) { dev->kbdfeed->ctrl.leds = new; (*dev->kbdfeed->CtrlProc) (dev, &dev->kbdfeed->ctrl); return; } void XkbDDXUpdateDeviceIndicators(DeviceIntPtr dev, XkbSrvLedInfoPtr sli, CARD32 new) { if (sli->fb.kf == dev->kbdfeed) XkbDDXUpdateIndicators(dev, new); else if (sli->class == KbdFeedbackClass) { KbdFeedbackPtr kf; kf = sli->fb.kf; if (kf && kf->CtrlProc) { (*kf->CtrlProc) (dev, &kf->ctrl); } } else if (sli->class == LedFeedbackClass) { LedFeedbackPtr lf; lf = sli->fb.lf; if (lf && lf->CtrlProc) { (*lf->CtrlProc) (dev, &lf->ctrl); } } return; } xorg-server-1.17.1/xkb/xkbLEDs.c0000664000175100017510000010266312456571574013265 00000000000000/************************************************************ 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 "misc.h" #include "inputstr.h" #include #include #include "xkb.h" /***====================================================================***/ /* * unsigned * XkbIndicatorsToUpdate(dev,changed,check_devs_rtrn) * * Given a keyboard and a set of state components that have changed, * this function returns the indicators on the default keyboard * feedback that might be affected. It also reports whether or not * any extension devices might be affected in check_devs_rtrn. */ unsigned XkbIndicatorsToUpdate(DeviceIntPtr dev, unsigned long state_changes, Bool enable_changes) { register unsigned update = 0; XkbSrvLedInfoPtr sli; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); if (!sli) return update; if (state_changes & (XkbModifierStateMask | XkbGroupStateMask)) update |= sli->usesEffective; if (state_changes & (XkbModifierBaseMask | XkbGroupBaseMask)) update |= sli->usesBase; if (state_changes & (XkbModifierLatchMask | XkbGroupLatchMask)) update |= sli->usesLatched; if (state_changes & (XkbModifierLockMask | XkbGroupLockMask)) update |= sli->usesLocked; if (state_changes & XkbCompatStateMask) update |= sli->usesCompat; if (enable_changes) update |= sli->usesControls; return update; } /***====================================================================***/ /* * Bool *XkbApplyLEDChangeToKeyboard(xkbi,map,on,change) * * Some indicators "drive" the keyboard when their state is explicitly * changed, as described in section 9.2.1 of the XKB protocol spec. * This function updates the state and controls for the keyboard * specified by 'xkbi' to reflect any changes that are required * when the indicator described by 'map' is turned on or off. The * extent of the changes is reported in change, which must be defined. */ static Bool XkbApplyLEDChangeToKeyboard(XkbSrvInfoPtr xkbi, XkbIndicatorMapPtr map, Bool on, XkbChangesPtr change) { Bool ctrlChange, stateChange; XkbStatePtr state; if ((map->flags & XkbIM_NoExplicit) || ((map->flags & XkbIM_LEDDrivesKB) == 0)) return FALSE; ctrlChange = stateChange = FALSE; if (map->ctrls) { XkbControlsPtr ctrls = xkbi->desc->ctrls; unsigned old; old = ctrls->enabled_ctrls; if (on) ctrls->enabled_ctrls |= map->ctrls; else ctrls->enabled_ctrls &= ~map->ctrls; if (old != ctrls->enabled_ctrls) { change->ctrls.changed_ctrls = XkbControlsEnabledMask; change->ctrls.enabled_ctrls_changes = old ^ ctrls->enabled_ctrls; ctrlChange = TRUE; } } state = &xkbi->state; if ((map->groups) && ((map->which_groups & (~XkbIM_UseBase)) != 0)) { register int i; register unsigned bit, match; if (on) match = (map->groups) & XkbAllGroupsMask; else match = (~map->groups) & XkbAllGroupsMask; if (map->which_groups & (XkbIM_UseLocked | XkbIM_UseEffective)) { for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { if (bit & match) break; } if (map->which_groups & XkbIM_UseLatched) XkbLatchGroup(xkbi->device, 0); /* unlatch group */ state->locked_group = i; stateChange = TRUE; } else if (map->which_groups & (XkbIM_UseLatched | XkbIM_UseEffective)) { for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { if (bit & match) break; } state->locked_group = 0; XkbLatchGroup(xkbi->device, i); stateChange = TRUE; } } if ((map->mods.mask) && ((map->which_mods & (~XkbIM_UseBase)) != 0)) { if (map->which_mods & (XkbIM_UseLocked | XkbIM_UseEffective)) { register unsigned long old; old = state->locked_mods; if (on) state->locked_mods |= map->mods.mask; else state->locked_mods &= ~map->mods.mask; if (state->locked_mods != old) stateChange = TRUE; } if (map->which_mods & (XkbIM_UseLatched | XkbIM_UseEffective)) { register unsigned long newmods; newmods = state->latched_mods; if (on) newmods |= map->mods.mask; else newmods &= ~map->mods.mask; if (newmods != state->locked_mods) { newmods &= map->mods.mask; XkbLatchModifiers(xkbi->device, map->mods.mask, newmods); stateChange = TRUE; } } } return stateChange || ctrlChange; } /* * Bool * ComputeAutoState(map,state,ctrls) * * This function reports the effect of applying the specified * indicator map given the specified state and controls, as * described in section 9.2 of the XKB protocol specification. */ static Bool ComputeAutoState(XkbIndicatorMapPtr map, XkbStatePtr state, XkbControlsPtr ctrls) { Bool on; CARD8 mods, group; on = FALSE; mods = group = 0; if (map->which_mods & XkbIM_UseAnyMods) { if (map->which_mods & XkbIM_UseBase) mods |= state->base_mods; if (map->which_mods & XkbIM_UseLatched) mods |= state->latched_mods; if (map->which_mods & XkbIM_UseLocked) mods |= state->locked_mods; if (map->which_mods & XkbIM_UseEffective) mods |= state->mods; if (map->which_mods & XkbIM_UseCompat) mods |= state->compat_state; on = ((map->mods.mask & mods) != 0); on = on || ((mods == 0) && (map->mods.mask == 0) && (map->mods.vmods == 0)); } if (map->which_groups & XkbIM_UseAnyGroup) { if (map->which_groups & XkbIM_UseBase) group |= (1L << state->base_group); if (map->which_groups & XkbIM_UseLatched) group |= (1L << state->latched_group); if (map->which_groups & XkbIM_UseLocked) group |= (1L << state->locked_group); if (map->which_groups & XkbIM_UseEffective) group |= (1L << state->group); on = on || (((map->groups & group) != 0) || (map->groups == 0)); } if (map->ctrls) on = on || (ctrls->enabled_ctrls & map->ctrls); return on; } static void XkbUpdateLedAutoState(DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned maps_to_check, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) { DeviceIntPtr kbd; XkbStatePtr state; XkbControlsPtr ctrls; XkbChangesRec my_changes; xkbExtensionDeviceNotify my_ed; register unsigned i, bit, affected; register XkbIndicatorMapPtr map; unsigned oldState; if ((maps_to_check == 0) || (sli->maps == NULL) || (sli->mapsPresent == 0)) return; if (dev->key && dev->key->xkbInfo) kbd = dev; else kbd = inputInfo.keyboard; state = &kbd->key->xkbInfo->state; ctrls = kbd->key->xkbInfo->desc->ctrls; affected = maps_to_check; oldState = sli->effectiveState; sli->autoState &= ~affected; for (i = 0, bit = 1; (i < XkbNumIndicators) && (affected); i++, bit <<= 1) { if ((affected & bit) == 0) continue; affected &= ~bit; map = &sli->maps[i]; if ((!(map->flags & XkbIM_NoAutomatic)) && ComputeAutoState(map, state, ctrls)) sli->autoState |= bit; } sli->effectiveState = (sli->autoState | sli->explicitState); affected = sli->effectiveState ^ oldState; if (affected == 0) return; if (ed == NULL) { ed = &my_ed; memset((char *) ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if ((ed->reason & XkbXI_IndicatorsMask) && ((ed->ledClass != sli->class) || (ed->ledID != sli->id))) { XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); } if ((kbd == dev) && (sli->flags & XkbSLI_IsDefault)) { if (changes == NULL) { changes = &my_changes; memset((char *) changes, 0, sizeof(XkbChangesRec)); } changes->indicators.state_changes |= affected; } ed->reason |= XkbXI_IndicatorStateMask; ed->ledClass = sli->class; ed->ledID = sli->id; ed->ledsDefined = sli->namesPresent | sli->mapsPresent; ed->ledState = sli->effectiveState; ed->unsupported = 0; ed->supported = XkbXI_AllFeaturesMask; if (changes != &my_changes) changes = NULL; if (ed != &my_ed) ed = NULL; if (changes || ed) XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); return; } static void XkbUpdateAllDeviceIndicators(XkbChangesPtr changes, XkbEventCausePtr cause) { DeviceIntPtr edev; XkbSrvLedInfoPtr sli; for (edev = inputInfo.devices; edev != NULL; edev = edev->next) { if (edev->kbdfeed) { KbdFeedbackPtr kf; for (kf = edev->kbdfeed; kf != NULL; kf = kf->next) { if ((kf->xkb_sli == NULL) || (kf->xkb_sli->maps == NULL)) continue; sli = kf->xkb_sli; XkbUpdateLedAutoState(edev, sli, sli->mapsPresent, NULL, changes, cause); } } if (edev->leds) { LedFeedbackPtr lf; for (lf = edev->leds; lf != NULL; lf = lf->next) { if ((lf->xkb_sli == NULL) || (lf->xkb_sli->maps == NULL)) continue; sli = lf->xkb_sli; XkbUpdateLedAutoState(edev, sli, sli->mapsPresent, NULL, changes, cause); } } } return; } /***====================================================================***/ /* * void * XkbSetIndicators(dev,affect,values,cause) * * Attempts to change the indicators specified in 'affect' to the * states specified in 'values' for the default keyboard feedback * on the keyboard specified by 'dev.' Attempts to change indicator * state might be ignored or have no affect, depending on the XKB * indicator map for any affected indicators, as described in section * 9.2 of the XKB protocol specification. * * If 'changes' is non-NULL, this function notes any changes to the * keyboard state, controls, or indicator state that result from this * attempted change. If 'changes' is NULL, this function generates * XKB events to report any such changes to interested clients. * * If 'cause' is non-NULL, it specifies the reason for the change, * as reported in some XKB events. If it is NULL, this function * assumes that the change is the result of a core protocol * ChangeKeyboardMapping request. */ void XkbSetIndicators(DeviceIntPtr dev, CARD32 affect, CARD32 values, XkbEventCausePtr cause) { XkbSrvLedInfoPtr sli; XkbChangesRec changes; xkbExtensionDeviceNotify ed; unsigned side_affected; memset((char *) &changes, 0, sizeof(XkbChangesRec)); memset((char *) &ed, 0, sizeof(xkbExtensionDeviceNotify)); sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); sli->explicitState &= ~affect; sli->explicitState |= (affect & values); XkbApplyLedStateChanges(dev, sli, affect, &ed, &changes, cause); side_affected = 0; if (changes.state_changes != 0) side_affected |= XkbIndicatorsToUpdate(dev, changes.state_changes, FALSE); if (changes.ctrls.enabled_ctrls_changes) side_affected |= sli->usesControls; if (side_affected) { XkbUpdateLedAutoState(dev, sli, side_affected, &ed, &changes, cause); affect |= side_affected; } if (changes.state_changes || changes.ctrls.enabled_ctrls_changes) XkbUpdateAllDeviceIndicators(NULL, cause); XkbFlushLedEvents(dev, dev, sli, &ed, &changes, cause); return; } /***====================================================================***/ /***====================================================================***/ /* * void * XkbUpdateIndicators(dev,update,check_edevs,changes,cause) * * Applies the indicator maps for any indicators specified in * 'update' from the default keyboard feedback on the device * specified by 'dev.' * * If 'changes' is NULL, this function generates and XKB events * required to report the necessary changes, otherwise it simply * notes the indicators with changed state. * * If 'check_edevs' is TRUE, this function also checks the indicator * maps for any open extension devices that have them, and updates * the state of any extension device indicators as necessary. */ void XkbUpdateIndicators(DeviceIntPtr dev, register CARD32 update, Bool check_edevs, XkbChangesPtr changes, XkbEventCausePtr cause) { XkbSrvLedInfoPtr sli; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateLedAutoState(dev, sli, update, NULL, changes, cause); if (check_edevs) XkbUpdateAllDeviceIndicators(changes, cause); return; } /***====================================================================***/ /***====================================================================***/ /* * void * XkbCheckIndicatorMaps(dev,sli,which) * * Updates the 'indicator accelerators' for the indicators specified * by 'which' in the feedback specified by 'sli.' The indicator * accelerators are internal to the server and are used to simplify * and speed up the process of figuring out which indicators might * be affected by a particular change in keyboard state or controls. */ void XkbCheckIndicatorMaps(DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned which) { register unsigned i, bit; XkbIndicatorMapPtr map; XkbDescPtr xkb; if ((sli->flags & XkbSLI_HasOwnState) == 0) return; sli->usesBase &= ~which; sli->usesLatched &= ~which; sli->usesLocked &= ~which; sli->usesEffective &= ~which; sli->usesCompat &= ~which; sli->usesControls &= ~which; sli->mapsPresent &= ~which; xkb = dev->key->xkbInfo->desc; for (i = 0, bit = 1, map = sli->maps; i < XkbNumIndicators; i++, bit <<= 1, map++) { if (which & bit) { CARD8 what; if (!map || !XkbIM_InUse(map)) continue; sli->mapsPresent |= bit; what = (map->which_mods | map->which_groups); if (what & XkbIM_UseBase) sli->usesBase |= bit; if (what & XkbIM_UseLatched) sli->usesLatched |= bit; if (what & XkbIM_UseLocked) sli->usesLocked |= bit; if (what & XkbIM_UseEffective) sli->usesEffective |= bit; if (what & XkbIM_UseCompat) sli->usesCompat |= bit; if (map->ctrls) sli->usesControls |= bit; map->mods.mask = map->mods.real_mods; if (map->mods.vmods != 0) { map->mods.mask |= XkbMaskForVMask(xkb, map->mods.vmods); } } } sli->usedComponents = 0; if (sli->usesBase) sli->usedComponents |= XkbModifierBaseMask | XkbGroupBaseMask; if (sli->usesLatched) sli->usedComponents |= XkbModifierLatchMask | XkbGroupLatchMask; if (sli->usesLocked) sli->usedComponents |= XkbModifierLockMask | XkbGroupLockMask; if (sli->usesEffective) sli->usedComponents |= XkbModifierStateMask | XkbGroupStateMask; if (sli->usesCompat) sli->usedComponents |= XkbCompatStateMask; return; } /***====================================================================***/ /* * XkbSrvLedInfoPtr * XkbAllocSrvLedInfo(dev,kf,lf,needed_parts) * * Allocates an XkbSrvLedInfoPtr for the feedback specified by either * 'kf' or 'lf' on the keyboard specified by 'dev.' * * If 'needed_parts' is non-zero, this function makes sure that any * of the parts speicified therein are allocated. */ XkbSrvLedInfoPtr XkbAllocSrvLedInfo(DeviceIntPtr dev, KbdFeedbackPtr kf, LedFeedbackPtr lf, unsigned needed_parts) { XkbSrvLedInfoPtr sli; Bool checkAccel; Bool checkNames; sli = NULL; checkAccel = checkNames = FALSE; if ((kf != NULL) && (kf->xkb_sli == NULL)) { kf->xkb_sli = sli = calloc(1, sizeof(XkbSrvLedInfoRec)); if (sli == NULL) return NULL; /* ALLOCATION ERROR */ if (dev->key && dev->key->xkbInfo) sli->flags = XkbSLI_HasOwnState; else sli->flags = 0; sli->class = KbdFeedbackClass; sli->id = kf->ctrl.id; sli->fb.kf = kf; sli->autoState = 0; sli->explicitState = kf->ctrl.leds; sli->effectiveState = kf->ctrl.leds; if ((kf == dev->kbdfeed) && (dev->key) && (dev->key->xkbInfo)) { XkbDescPtr xkb; xkb = dev->key->xkbInfo->desc; sli->flags |= XkbSLI_IsDefault; sli->physIndicators = xkb->indicators->phys_indicators; sli->names = xkb->names->indicators; sli->maps = xkb->indicators->maps; checkNames = checkAccel = TRUE; } else { sli->physIndicators = XkbAllIndicatorsMask; sli->names = NULL; sli->maps = NULL; } } else if ((kf != NULL) && ((kf->xkb_sli->flags & XkbSLI_IsDefault) != 0)) { XkbDescPtr xkb; xkb = dev->key->xkbInfo->desc; sli = kf->xkb_sli; sli->physIndicators = xkb->indicators->phys_indicators; if (xkb->names->indicators != sli->names) { checkNames = TRUE; sli->names = xkb->names->indicators; } if (xkb->indicators->maps != sli->maps) { checkAccel = TRUE; sli->maps = xkb->indicators->maps; } } else if ((lf != NULL) && (lf->xkb_sli == NULL)) { lf->xkb_sli = sli = calloc(1, sizeof(XkbSrvLedInfoRec)); if (sli == NULL) return NULL; /* ALLOCATION ERROR */ if (dev->key && dev->key->xkbInfo) sli->flags = XkbSLI_HasOwnState; else sli->flags = 0; sli->class = LedFeedbackClass; sli->id = lf->ctrl.id; sli->fb.lf = lf; sli->physIndicators = lf->ctrl.led_mask; sli->autoState = 0; sli->explicitState = lf->ctrl.led_values; sli->effectiveState = lf->ctrl.led_values; sli->maps = NULL; sli->names = NULL; } else return NULL; if ((sli->names == NULL) && (needed_parts & XkbXI_IndicatorNamesMask)) sli->names = calloc(XkbNumIndicators, sizeof(Atom)); if ((sli->maps == NULL) && (needed_parts & XkbXI_IndicatorMapsMask)) sli->maps = calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec)); if (checkNames) { register unsigned i, bit; sli->namesPresent = 0; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (sli->names[i] != None) sli->namesPresent |= bit; } } if (checkAccel) XkbCheckIndicatorMaps(dev, sli, XkbAllIndicatorsMask); return sli; } void XkbFreeSrvLedInfo(XkbSrvLedInfoPtr sli) { if ((sli->flags & XkbSLI_IsDefault) == 0) { free(sli->maps); free(sli->names); } sli->maps = NULL; sli->names = NULL; free(sli); return; } /* * XkbSrvLedInfoPtr * XkbCopySrvLedInfo(dev,src,kf,lf) * * Takes the given XkbSrvLedInfoPtr and duplicates it. A deep copy is made, * thus the new copy behaves like the original one and can be freed with * XkbFreeSrvLedInfo. */ XkbSrvLedInfoPtr XkbCopySrvLedInfo(DeviceIntPtr from, XkbSrvLedInfoPtr src, KbdFeedbackPtr kf, LedFeedbackPtr lf) { XkbSrvLedInfoPtr sli_new = NULL; if (!src) goto finish; sli_new = calloc(1, sizeof(XkbSrvLedInfoRec)); if (!sli_new) goto finish; memcpy(sli_new, src, sizeof(XkbSrvLedInfoRec)); if (sli_new->class == KbdFeedbackClass) sli_new->fb.kf = kf; else sli_new->fb.lf = lf; if (!(sli_new->flags & XkbSLI_IsDefault)) { sli_new->names = calloc(XkbNumIndicators, sizeof(Atom)); sli_new->maps = calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec)); } /* else sli_new->names/maps is pointing to dev->key->xkbInfo->desc->names->indicators; dev->key->xkbInfo->desc->names->indicators; */ finish: return sli_new; } /***====================================================================***/ /* * XkbSrvLedInfoPtr * XkbFindSrvLedInfo(dev,class,id,needed_parts) * * Finds the XkbSrvLedInfoPtr for the specified 'class' and 'id' * on the device specified by 'dev.' If the class and id specify * a valid device feedback, this function returns the existing * feedback or allocates a new one. * */ XkbSrvLedInfoPtr XkbFindSrvLedInfo(DeviceIntPtr dev, unsigned class, unsigned id, unsigned needed_parts) { XkbSrvLedInfoPtr sli; /* optimization to check for most common case */ if (((class == XkbDfltXIClass) && (id == XkbDfltXIId)) && (dev->kbdfeed)) { if (dev->kbdfeed->xkb_sli == NULL) { dev->kbdfeed->xkb_sli = XkbAllocSrvLedInfo(dev, dev->kbdfeed, NULL, needed_parts); } return dev->kbdfeed->xkb_sli; } sli = NULL; if (class == XkbDfltXIClass) { if (dev->kbdfeed) class = KbdFeedbackClass; else if (dev->leds) class = LedFeedbackClass; else return NULL; } if (class == KbdFeedbackClass) { KbdFeedbackPtr kf; for (kf = dev->kbdfeed; kf != NULL; kf = kf->next) { if ((id == XkbDfltXIId) || (id == kf->ctrl.id)) { if (kf->xkb_sli == NULL) kf->xkb_sli = XkbAllocSrvLedInfo(dev, kf, NULL, needed_parts); sli = kf->xkb_sli; break; } } } else if (class == LedFeedbackClass) { LedFeedbackPtr lf; for (lf = dev->leds; lf != NULL; lf = lf->next) { if ((id == XkbDfltXIId) || (id == lf->ctrl.id)) { if (lf->xkb_sli == NULL) lf->xkb_sli = XkbAllocSrvLedInfo(dev, NULL, lf, needed_parts); sli = lf->xkb_sli; break; } } } if (sli) { if ((sli->names == NULL) && (needed_parts & XkbXI_IndicatorNamesMask)) sli->names = calloc(XkbNumIndicators, sizeof(Atom)); if ((sli->maps == NULL) && (needed_parts & XkbXI_IndicatorMapsMask)) sli->maps = calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec)); } return sli; } /***====================================================================***/ void XkbFlushLedEvents(DeviceIntPtr dev, DeviceIntPtr kbd, XkbSrvLedInfoPtr sli, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) { if (changes) { if (changes->indicators.state_changes) XkbDDXUpdateDeviceIndicators(dev, sli, sli->effectiveState); XkbSendNotification(kbd, changes, cause); memset((char *) changes, 0, sizeof(XkbChangesRec)); if (XkbAX_NeedFeedback (kbd->key->xkbInfo->desc->ctrls, XkbAX_IndicatorFBMask)) { if (sli->effectiveState) /* it appears that the which parameter is not used */ XkbDDXAccessXBeep(dev, _BEEP_LED_ON, XkbAccessXFeedbackMask); else XkbDDXAccessXBeep(dev, _BEEP_LED_OFF, XkbAccessXFeedbackMask); } } if (ed) { if (ed->reason) { if ((dev != kbd) && (ed->reason & XkbXI_IndicatorStateMask)) XkbDDXUpdateDeviceIndicators(dev, sli, sli->effectiveState); XkbSendExtensionDeviceNotify(dev, cause->client, ed); } memset((char *) ed, 0, sizeof(XkbExtensionDeviceNotify)); } return; } /***====================================================================***/ void XkbApplyLedNameChanges(DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned changed_names, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) { DeviceIntPtr kbd; XkbChangesRec my_changes; xkbExtensionDeviceNotify my_ed; if (changed_names == 0) return; if (dev->key && dev->key->xkbInfo) kbd = dev; else kbd = inputInfo.keyboard; if (ed == NULL) { ed = &my_ed; memset((char *) ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if ((ed->reason & XkbXI_IndicatorsMask) && ((ed->ledClass != sli->class) || (ed->ledID != sli->id))) { XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); } if ((kbd == dev) && (sli->flags & XkbSLI_IsDefault)) { if (changes == NULL) { changes = &my_changes; memset((char *) changes, 0, sizeof(XkbChangesRec)); } changes->names.changed |= XkbIndicatorNamesMask; changes->names.changed_indicators |= changed_names; } ed->reason |= XkbXI_IndicatorNamesMask; ed->ledClass = sli->class; ed->ledID = sli->id; ed->ledsDefined = sli->namesPresent | sli->mapsPresent; ed->ledState = sli->effectiveState; ed->unsupported = 0; ed->supported = XkbXI_AllFeaturesMask; if (changes != &my_changes) changes = NULL; if (ed != &my_ed) ed = NULL; if (changes || ed) XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); return; } /***====================================================================***/ /* * void * XkbApplyLedMapChanges(dev,sli,changed_maps,changes,cause) * * Handles all of the secondary effects of the changes to the * feedback specified by 'sli' on the device specified by 'dev.' * * If 'changed_maps' specifies any indicators, this function generates * XkbExtensionDeviceNotify events and possibly IndicatorMapNotify * events to report the changes, and recalculates the effective * state of each indicator with a changed map. If any indicators * change state, the server generates XkbExtensionDeviceNotify and * XkbIndicatorStateNotify events as appropriate. * * If 'changes' is non-NULL, this function updates it to reflect * any changes to the keyboard state or controls or to the 'core' * indicator names, maps, or state. If 'changes' is NULL, this * function generates XKB events as needed to report the changes. * If 'dev' is not a keyboard device, any changes are reported * for the core keyboard. * * The 'cause' specifies the reason for the event (key event or * request) for the change, as reported in some XKB events. */ void XkbApplyLedMapChanges(DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned changed_maps, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) { DeviceIntPtr kbd; XkbChangesRec my_changes; xkbExtensionDeviceNotify my_ed; if (changed_maps == 0) return; if (dev->key && dev->key->xkbInfo) kbd = dev; else kbd = inputInfo.keyboard; if (ed == NULL) { ed = &my_ed; memset((char *) ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if ((ed->reason & XkbXI_IndicatorsMask) && ((ed->ledClass != sli->class) || (ed->ledID != sli->id))) { XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); } if ((kbd == dev) && (sli->flags & XkbSLI_IsDefault)) { if (changes == NULL) { changes = &my_changes; memset((char *) changes, 0, sizeof(XkbChangesRec)); } changes->indicators.map_changes |= changed_maps; } XkbCheckIndicatorMaps(dev, sli, changed_maps); ed->reason |= XkbXI_IndicatorMapsMask; ed->ledClass = sli->class; ed->ledID = sli->id; ed->ledsDefined = sli->namesPresent | sli->mapsPresent; ed->ledState = sli->effectiveState; ed->unsupported = 0; ed->supported = XkbXI_AllFeaturesMask; XkbUpdateLedAutoState(dev, sli, changed_maps, ed, changes, cause); if (changes != &my_changes) changes = NULL; if (ed != &my_ed) ed = NULL; if (changes || ed) XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); return; } /***====================================================================***/ void XkbApplyLedStateChanges(DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned changed_leds, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) { XkbSrvInfoPtr xkbi; DeviceIntPtr kbd; XkbChangesRec my_changes; xkbExtensionDeviceNotify my_ed; register unsigned i, bit, affected; XkbIndicatorMapPtr map; unsigned oldState; Bool kb_changed; if (changed_leds == 0) return; if (dev->key && dev->key->xkbInfo) kbd = dev; else kbd = inputInfo.keyboard; xkbi = kbd->key->xkbInfo; if (changes == NULL) { changes = &my_changes; memset((char *) changes, 0, sizeof(XkbChangesRec)); } kb_changed = FALSE; affected = changed_leds; oldState = sli->effectiveState; for (i = 0, bit = 1; (i < XkbNumIndicators) && (affected); i++, bit <<= 1) { if ((affected & bit) == 0) continue; affected &= ~bit; map = &sli->maps[i]; if (map->flags & XkbIM_NoExplicit) { sli->explicitState &= ~bit; continue; } if (map->flags & XkbIM_LEDDrivesKB) { Bool on = ((sli->explicitState & bit) != 0); if (XkbApplyLEDChangeToKeyboard(xkbi, map, on, changes)) kb_changed = TRUE; } } sli->effectiveState = (sli->autoState | sli->explicitState); affected = sli->effectiveState ^ oldState; if (ed == NULL) { ed = &my_ed; memset((char *) ed, 0, sizeof(xkbExtensionDeviceNotify)); } else if (affected && (ed->reason & XkbXI_IndicatorsMask) && ((ed->ledClass != sli->class) || (ed->ledID != sli->id))) { XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); } if ((kbd == dev) && (sli->flags & XkbSLI_IsDefault)) changes->indicators.state_changes |= affected; if (affected) { ed->reason |= XkbXI_IndicatorStateMask; ed->ledClass = sli->class; ed->ledID = sli->id; ed->ledsDefined = sli->namesPresent | sli->mapsPresent; ed->ledState = sli->effectiveState; ed->unsupported = 0; ed->supported = XkbXI_AllFeaturesMask; } if (kb_changed) { XkbComputeDerivedState(kbd->key->xkbInfo); XkbUpdateLedAutoState(dev, sli, sli->mapsPresent, ed, changes, cause); } if (changes != &my_changes) changes = NULL; if (ed != &my_ed) ed = NULL; if (changes || ed) XkbFlushLedEvents(dev, kbd, sli, ed, changes, cause); if (kb_changed) XkbUpdateAllDeviceIndicators(NULL, cause); return; } xorg-server-1.17.1/xkb/xkbgeom.h0000664000175100017510000004206512456571574013431 00000000000000/************************************************************ Copyright (c) 1993 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. ********************************************************/ #ifndef _XKBGEOM_H_ #define _XKBGEOM_H_ #include "xkbstr.h" #define XkbAddGeomKeyAlias SrvXkbAddGeomKeyAlias #define XkbAddGeomColor SrvXkbAddGeomColor #define XkbAddGeomDoodad SrvXkbAddGeomDoodad #define XkbAddGeomKey SrvXkbAddGeomKey #define XkbAddGeomOutline SrvXkbAddGeomOutline #define XkbAddGeomOverlay SrvXkbAddGeomOverlay #define XkbAddGeomOverlayRow SrvXkbAddGeomOverlayRow #define XkbAddGeomOverlayKey SrvXkbAddGeomOverlayKey #define XkbAddGeomProperty SrvXkbAddGeomProperty #define XkbAddGeomRow SrvXkbAddGeomRow #define XkbAddGeomSection SrvXkbAddGeomSection #define XkbAddGeomShape SrvXkbAddGeomShape #define XkbAllocGeometry SrvXkbAllocGeometry #define XkbFreeGeomKeyAliases SrvXkbFreeGeomKeyAliases #define XkbFreeGeomColors SrvXkbFreeGeomColors #define XkbFreeGeomDoodads SrvXkbFreeGeomDoodads #define XkbFreeGeomProperties SrvXkbFreeGeomProperties #define XkbFreeGeomKeys SrvXkbFreeGeomKeys #define XkbFreeGeomRows SrvXkbFreeGeomRows #define XkbFreeGeomSections SrvXkbFreeGeomSections #define XkbFreeGeomPoints SrvXkbFreeGeomPoints #define XkbFreeGeomOutlines SrvXkbFreeGeomOutlines #define XkbFreeGeomShapes SrvXkbFreeGeomShapes #define XkbFreeGeometry SrvXkbFreeGeometry typedef struct _XkbProperty { char *name; char *value; } XkbPropertyRec, *XkbPropertyPtr; typedef struct _XkbColor { unsigned int pixel; char *spec; } XkbColorRec, *XkbColorPtr; typedef struct _XkbPoint { short x; short y; } XkbPointRec, *XkbPointPtr; typedef struct _XkbBounds { short x1, y1; short x2, y2; } XkbBoundsRec, *XkbBoundsPtr; #define XkbBoundsWidth(b) (((b)->x2)-((b)->x1)) #define XkbBoundsHeight(b) (((b)->y2)-((b)->y1)) typedef struct _XkbOutline { unsigned short num_points; unsigned short sz_points; unsigned short corner_radius; XkbPointPtr points; } XkbOutlineRec, *XkbOutlinePtr; typedef struct _XkbShape { Atom name; unsigned short num_outlines; unsigned short sz_outlines; XkbOutlinePtr outlines; XkbOutlinePtr approx; XkbOutlinePtr primary; XkbBoundsRec bounds; } XkbShapeRec, *XkbShapePtr; #define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0])) typedef struct _XkbShapeDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; unsigned short color_ndx; unsigned short shape_ndx; } XkbShapeDoodadRec, *XkbShapeDoodadPtr; #define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) #define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) #define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) #define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0]) typedef struct _XkbTextDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; short width; short height; unsigned short color_ndx; char *text; char *font; } XkbTextDoodadRec, *XkbTextDoodadPtr; #define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) #define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) typedef struct _XkbIndicatorDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; unsigned short shape_ndx; unsigned short on_color_ndx; unsigned short off_color_ndx; } XkbIndicatorDoodadRec, *XkbIndicatorDoodadPtr; #define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) #define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx]) #define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx]) #define XkbSetIndicatorDoodadOnColor(g,d,c) \ ((d)->on_color_ndx= (c)-&(g)->colors[0]) #define XkbSetIndicatorDoodadOffColor(g,d,c) \ ((d)->off_color_ndx= (c)-&(g)->colors[0]) #define XkbSetIndicatorDoodadShape(g,d,s) \ ((d)->shape_ndx= (s)-&(g)->shapes[0]) typedef struct _XkbLogoDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; unsigned short color_ndx; unsigned short shape_ndx; char *logo_name; } XkbLogoDoodadRec, *XkbLogoDoodadPtr; #define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) #define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) #define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) #define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0]) typedef struct _XkbAnyDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; } XkbAnyDoodadRec, *XkbAnyDoodadPtr; typedef union _XkbDoodad { XkbAnyDoodadRec any; XkbShapeDoodadRec shape; XkbTextDoodadRec text; XkbIndicatorDoodadRec indicator; XkbLogoDoodadRec logo; } XkbDoodadRec, *XkbDoodadPtr; #define XkbUnknownDoodad 0 #define XkbOutlineDoodad 1 #define XkbSolidDoodad 2 #define XkbTextDoodad 3 #define XkbIndicatorDoodad 4 #define XkbLogoDoodad 5 typedef struct _XkbKey { XkbKeyNameRec name; short gap; unsigned char shape_ndx; unsigned char color_ndx; } XkbKeyRec, *XkbKeyPtr; #define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx]) #define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx]) #define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0]) #define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0]) typedef struct _XkbRow { short top; short left; unsigned short num_keys; unsigned short sz_keys; int vertical; XkbKeyPtr keys; XkbBoundsRec bounds; } XkbRowRec, *XkbRowPtr; typedef struct _XkbSection { Atom name; unsigned char priority; short top; short left; unsigned short width; unsigned short height; short angle; unsigned short num_rows; unsigned short num_doodads; unsigned short num_overlays; unsigned short sz_rows; unsigned short sz_doodads; unsigned short sz_overlays; XkbRowPtr rows; XkbDoodadPtr doodads; XkbBoundsRec bounds; struct _XkbOverlay *overlays; } XkbSectionRec, *XkbSectionPtr; typedef struct _XkbOverlayKey { XkbKeyNameRec over; XkbKeyNameRec under; } XkbOverlayKeyRec, *XkbOverlayKeyPtr; typedef struct _XkbOverlayRow { unsigned short row_under; unsigned short num_keys; unsigned short sz_keys; XkbOverlayKeyPtr keys; } XkbOverlayRowRec, *XkbOverlayRowPtr; typedef struct _XkbOverlay { Atom name; XkbSectionPtr section_under; unsigned short num_rows; unsigned short sz_rows; XkbOverlayRowPtr rows; XkbBoundsPtr bounds; } XkbOverlayRec, *XkbOverlayPtr; typedef struct _XkbGeometry { Atom name; unsigned short width_mm; unsigned short height_mm; char *label_font; XkbColorPtr label_color; XkbColorPtr base_color; unsigned short sz_properties; unsigned short sz_colors; unsigned short sz_shapes; unsigned short sz_sections; unsigned short sz_doodads; unsigned short sz_key_aliases; unsigned short num_properties; unsigned short num_colors; unsigned short num_shapes; unsigned short num_sections; unsigned short num_doodads; unsigned short num_key_aliases; XkbPropertyPtr properties; XkbColorPtr colors; XkbShapePtr shapes; XkbSectionPtr sections; XkbDoodadPtr doodads; XkbKeyAliasPtr key_aliases; } XkbGeometryRec; #define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0])) #define XkbGeomPropertiesMask (1<<0) #define XkbGeomColorsMask (1<<1) #define XkbGeomShapesMask (1<<2) #define XkbGeomSectionsMask (1<<3) #define XkbGeomDoodadsMask (1<<4) #define XkbGeomKeyAliasesMask (1<<5) #define XkbGeomAllMask (0x3f) typedef struct _XkbGeometrySizes { unsigned int which; unsigned short num_properties; unsigned short num_colors; unsigned short num_shapes; unsigned short num_sections; unsigned short num_doodads; unsigned short num_key_aliases; } XkbGeometrySizesRec, *XkbGeometrySizesPtr; /** * Specifies which items should be cleared in an XKB geometry array * when the array is reallocated. */ typedef enum { XKB_GEOM_CLEAR_NONE, /* Don't clear any items, just reallocate. */ XKB_GEOM_CLEAR_EXCESS, /* Clear new extra items after reallocation. */ XKB_GEOM_CLEAR_ALL /* Clear all items after reallocation. */ } XkbGeomClearance; extern XkbPropertyPtr XkbAddGeomProperty(XkbGeometryPtr /* geom */ , char * /* name */ , char * /* value */ ); extern XkbKeyAliasPtr XkbAddGeomKeyAlias(XkbGeometryPtr /* geom */ , char * /* alias */ , char * /* real */ ); extern XkbColorPtr XkbAddGeomColor(XkbGeometryPtr /* geom */ , char * /* spec */ , unsigned int /* pixel */ ); extern XkbOutlinePtr XkbAddGeomOutline(XkbShapePtr /* shape */ , int /* sz_points */ ); extern XkbShapePtr XkbAddGeomShape(XkbGeometryPtr /* geom */ , Atom /* name */ , int /* sz_outlines */ ); extern XkbKeyPtr XkbAddGeomKey(XkbRowPtr /* row */ ); extern XkbRowPtr XkbAddGeomRow(XkbSectionPtr /* section */ , int /* sz_keys */ ); extern XkbSectionPtr XkbAddGeomSection(XkbGeometryPtr /* geom */ , Atom /* name */ , int /* sz_rows */ , int /* sz_doodads */ , int /* sz_overlays */ ); extern XkbOverlayPtr XkbAddGeomOverlay(XkbSectionPtr /* section */ , Atom /* name */ , int /* sz_rows */ ); extern XkbOverlayRowPtr XkbAddGeomOverlayRow(XkbOverlayPtr /* overlay */ , int /* row_under */ , int /* sz_keys */ ); extern XkbOverlayKeyPtr XkbAddGeomOverlayKey(XkbOverlayPtr /* overlay */ , XkbOverlayRowPtr /* row */ , char * /* over */ , char * /* under */ ); extern XkbDoodadPtr XkbAddGeomDoodad(XkbGeometryPtr /* geom */ , XkbSectionPtr /* section */ , Atom /* name */ ); extern void XkbFreeGeomKeyAliases(XkbGeometryPtr /* geom */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomColors(XkbGeometryPtr /* geom */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomDoodads(XkbDoodadPtr /* doodads */ , int /* nDoodads */ , Bool /* freeAll */ ); extern void XkbFreeGeomProperties(XkbGeometryPtr /* geom */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomOverlayKeys(XkbOverlayRowPtr /* row */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomOverlayRows(XkbOverlayPtr /* overlay */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomOverlays(XkbSectionPtr /* section */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomKeys(XkbRowPtr /* row */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomRows(XkbSectionPtr /* section */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomSections(XkbGeometryPtr /* geom */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomPoints(XkbOutlinePtr /* outline */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomOutlines(XkbShapePtr /* shape */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeomShapes(XkbGeometryPtr /* geom */ , int /* first */ , int /* count */ , Bool /* freeAll */ ); extern void XkbFreeGeometry(XkbGeometryPtr /* geom */ , unsigned int /* which */ , Bool /* freeMap */ ); extern Bool XkbGeomRealloc(void ** /* buffer */ , int /* szItems */ , int /* nrItems */ , int /* itemSize */ , XkbGeomClearance /* clearance */ ); extern Status XkbAllocGeomProps(XkbGeometryPtr /* geom */ , int /* nProps */ ); extern Status XkbAllocGeomKeyAliases(XkbGeometryPtr /* geom */ , int /* nAliases */ ); extern Status XkbAllocGeomColors(XkbGeometryPtr /* geom */ , int /* nColors */ ); extern Status XkbAllocGeomShapes(XkbGeometryPtr /* geom */ , int /* nShapes */ ); extern Status XkbAllocGeomSections(XkbGeometryPtr /* geom */ , int /* nSections */ ); extern Status XkbAllocGeomOverlays(XkbSectionPtr /* section */ , int /* num_needed */ ); extern Status XkbAllocGeomOverlayRows(XkbOverlayPtr /* overlay */ , int /* num_needed */ ); extern Status XkbAllocGeomOverlayKeys(XkbOverlayRowPtr /* row */ , int /* num_needed */ ); extern Status XkbAllocGeomDoodads(XkbGeometryPtr /* geom */ , int /* nDoodads */ ); extern Status XkbAllocGeomSectionDoodads(XkbSectionPtr /* section */ , int /* nDoodads */ ); extern Status XkbAllocGeomOutlines(XkbShapePtr /* shape */ , int /* nOL */ ); extern Status XkbAllocGeomRows(XkbSectionPtr /* section */ , int /* nRows */ ); extern Status XkbAllocGeomPoints(XkbOutlinePtr /* ol */ , int /* nPts */ ); extern Status XkbAllocGeomKeys(XkbRowPtr /* row */ , int /* nKeys */ ); extern Status XkbAllocGeometry(XkbDescPtr /* xkb */ , XkbGeometrySizesPtr /* sizes */ ); extern Bool XkbComputeShapeTop(XkbShapePtr /* shape */ , XkbBoundsPtr /* bounds */ ); extern Bool XkbComputeShapeBounds(XkbShapePtr /* shape */ ); extern Bool XkbComputeRowBounds(XkbGeometryPtr /* geom */ , XkbSectionPtr /* section */ , XkbRowPtr /* row */ ); extern Bool XkbComputeSectionBounds(XkbGeometryPtr /* geom */ , XkbSectionPtr /* section */ ); extern char *XkbFindOverlayForKey(XkbGeometryPtr /* geom */ , XkbSectionPtr /* wanted */ , char * /* under */ ); #endif /* _XKBGEOM_H_ */ xorg-server-1.17.1/xkb/XKBMisc.c0000664000175100017510000007427512456571574013240 00000000000000/************************************************************ Copyright (c) 1993 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 #elif defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "misc.h" #include "inputstr.h" #include #define XKBSRV_NEED_FILE_FUNCS #include /***====================================================================***/ #define CORE_SYM(i) (imap->num_types)) { nSyms[i] = xkb->map->types[types_inout[i]].num_levels; if (nSyms[i] > groupsWidth) groupsWidth = nSyms[i]; } else { types_inout[i] = XkbTwoLevelIndex; /* don't really know, yet */ nSyms[i] = 2; } } if (nSyms[XkbGroup1Index] < 2) nSyms[XkbGroup1Index] = 2; if (nSyms[XkbGroup2Index] < 2) nSyms[XkbGroup2Index] = 2; /* Step 2: Copy the symbols from the core ordering to XKB ordering */ /* symbols in the core are in the order: */ /* G1L1 G1L2 G2L1 G2L2 [G1L[3-n]] [G2L[3-n]] [G3L*] [G3L*] */ xkb_syms_rtrn[XKB_OFFSET(XkbGroup1Index, 0)] = CORE_SYM(0); xkb_syms_rtrn[XKB_OFFSET(XkbGroup1Index, 1)] = CORE_SYM(1); for (i = 2; i < nSyms[XkbGroup1Index]; i++) { xkb_syms_rtrn[XKB_OFFSET(XkbGroup1Index, i)] = CORE_SYM(2 + i); } xkb_syms_rtrn[XKB_OFFSET(XkbGroup2Index, 0)] = CORE_SYM(2); xkb_syms_rtrn[XKB_OFFSET(XkbGroup2Index, 1)] = CORE_SYM(3); tmp = 2 + (nSyms[XkbGroup1Index] - 2); /* offset to extra group2 syms */ for (i = 2; i < nSyms[XkbGroup2Index]; i++) { xkb_syms_rtrn[XKB_OFFSET(XkbGroup2Index, i)] = CORE_SYM(tmp + i); } /* Special case: if only the first group is explicit, and the symbols * replicate across all groups, then we have a Section 12.4 replication */ if ((protected & ~XkbExplicitKeyType1Mask) == 0) { int j, width = nSyms[XkbGroup1Index]; replicated = TRUE; /* Check ABAB in ABABCDECDEABCDE */ if ((width > 0 && CORE_SYM(0) != CORE_SYM(2)) || (width > 1 && CORE_SYM(1) != CORE_SYM(3))) replicated = FALSE; /* Check CDECDE in ABABCDECDEABCDE */ for (i = 2; i < width && replicated; i++) { if (CORE_SYM(2 + i) != CORE_SYM(i + width)) replicated = FALSE; } /* Check ABCDE in ABABCDECDEABCDE */ for (j = 2; replicated && j < XkbNumKbdGroups && map_width >= width * (j + 1); j++) { for (i = 0; i < width && replicated; i++) { if (CORE_SYM(((i < 2) ? i : 2 + i)) != CORE_SYM(i + width * j)) replicated = FALSE; } } } if (replicated) { nSyms[XkbGroup2Index] = 0; nSyms[XkbGroup3Index] = 0; nSyms[XkbGroup4Index] = 0; nGroups = 1; } else { tmp = nSyms[XkbGroup1Index] + nSyms[XkbGroup2Index]; if ((tmp >= map_width) && ((protected & (XkbExplicitKeyType3Mask | XkbExplicitKeyType4Mask)) == 0)) { nSyms[XkbGroup3Index] = 0; nSyms[XkbGroup4Index] = 0; nGroups = 2; } else { nGroups = 3; for (i = 0; i < nSyms[XkbGroup3Index]; i++, tmp++) { xkb_syms_rtrn[XKB_OFFSET(XkbGroup3Index, i)] = CORE_SYM(tmp); } if ((tmp < map_width) || (protected & XkbExplicitKeyType4Mask)) { nGroups = 4; for (i = 0; i < nSyms[XkbGroup4Index]; i++, tmp++) { xkb_syms_rtrn[XKB_OFFSET(XkbGroup4Index, i)] = CORE_SYM(tmp); } } else { nSyms[XkbGroup4Index] = 0; } } } /* steps 3&4: alphanumeric expansion, assign canonical types */ empty = 0; for (i = 0; i < nGroups; i++) { KeySym *syms; syms = &xkb_syms_rtrn[XKB_OFFSET(i, 0)]; if ((nSyms[i] > 1) && (syms[1] == NoSymbol) && (syms[0] != NoSymbol)) { KeySym upper, lower; XkbConvertCase(syms[0], &lower, &upper); if (upper != lower) { xkb_syms_rtrn[XKB_OFFSET(i, 0)] = lower; xkb_syms_rtrn[XKB_OFFSET(i, 1)] = upper; if ((protected & (1 << i)) == 0) types_inout[i] = XkbAlphabeticIndex; } else if ((protected & (1 << i)) == 0) { types_inout[i] = XkbOneLevelIndex; /* nSyms[i]= 1; */ } } if (((protected & (1 << i)) == 0) && (types_inout[i] == XkbTwoLevelIndex)) { if (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1])) types_inout[i] = XkbKeypadIndex; else { KeySym upper, lower; XkbConvertCase(syms[0], &lower, &upper); if ((syms[0] == lower) && (syms[1] == upper)) types_inout[i] = XkbAlphabeticIndex; } } if (syms[0] == NoSymbol) { register int n; Bool found; for (n = 1, found = FALSE; (!found) && (n < nSyms[i]); n++) { found = (syms[n] != NoSymbol); } if (!found) empty |= (1 << i); } } /* step 5: squoosh out empty groups */ if (empty) { for (i = nGroups - 1; i >= 0; i--) { if (((empty & (1 << i)) == 0) || (protected & (1 << i))) break; nGroups--; } } if (nGroups < 1) return 0; /* step 6: replicate group 1 into group two, if necessary */ if ((nGroups > 1) && ((empty & (XkbGroup1Mask | XkbGroup2Mask)) == XkbGroup2Mask)) { if ((protected & (XkbExplicitKeyType1Mask | XkbExplicitKeyType2Mask)) == 0) { nSyms[XkbGroup2Index] = nSyms[XkbGroup1Index]; types_inout[XkbGroup2Index] = types_inout[XkbGroup1Index]; memcpy((char *) &xkb_syms_rtrn[2], (char *) xkb_syms_rtrn, 2 * sizeof(KeySym)); } else if (types_inout[XkbGroup1Index] == types_inout[XkbGroup2Index]) { memcpy((char *) &xkb_syms_rtrn[nSyms[XkbGroup1Index]], (char *) xkb_syms_rtrn, nSyms[XkbGroup1Index] * sizeof(KeySym)); } } /* step 7: check for all groups identical or all width 1 * * Special feature: if group 1 has an explicit type and all other groups * have canonical types with same symbols, we assume it's info lost from * the core replication. */ if (nGroups > 1) { Bool sameType, allOneLevel, canonical = TRUE; allOneLevel = (xkb->map->types[types_inout[0]].num_levels == 1); for (i = 1, sameType = TRUE; (allOneLevel || sameType) && (i < nGroups); i++) { sameType = (sameType && (types_inout[i] == types_inout[XkbGroup1Index])); if (allOneLevel) allOneLevel = (xkb->map->types[types_inout[i]].num_levels == 1); if (types_inout[i] > XkbLastRequiredType) canonical = FALSE; } if (((sameType) || canonical) && (!(protected & (XkbExplicitKeyTypesMask & ~XkbExplicitKeyType1Mask)))) { register int s; Bool identical; for (i = 1, identical = TRUE; identical && (i < nGroups); i++) { KeySym *syms; if (nSyms[i] != nSyms[XkbGroup1Index]) identical = FALSE; syms = &xkb_syms_rtrn[XKB_OFFSET(i, 0)]; for (s = 0; identical && (s < nSyms[i]); s++) { if (syms[s] != xkb_syms_rtrn[s]) identical = FALSE; } } if (identical) nGroups = 1; } if (allOneLevel && (nGroups > 1)) { KeySym *syms; syms = &xkb_syms_rtrn[nSyms[XkbGroup1Index]]; nSyms[XkbGroup1Index] = 1; for (i = 1; i < nGroups; i++) { xkb_syms_rtrn[i] = syms[0]; syms += nSyms[i]; nSyms[i] = 1; } } } return nGroups; } static XkbSymInterpretPtr _XkbFindMatchingInterp(XkbDescPtr xkb, KeySym sym, unsigned int real_mods, unsigned int level) { register unsigned i; XkbSymInterpretPtr interp, rtrn; CARD8 mods; rtrn = NULL; interp = xkb->compat->sym_interpret; for (i = 0; i < xkb->compat->num_si; i++, interp++) { if ((interp->sym == NoSymbol) || (sym == interp->sym)) { int match; if ((level == 0) || ((interp->match & XkbSI_LevelOneOnly) == 0)) mods = real_mods; else mods = 0; switch (interp->match & XkbSI_OpMask) { case XkbSI_NoneOf: match = ((interp->mods & mods) == 0); break; case XkbSI_AnyOfOrNone: match = ((mods == 0) || ((interp->mods & mods) != 0)); break; case XkbSI_AnyOf: match = ((interp->mods & mods) != 0); break; case XkbSI_AllOf: match = ((interp->mods & mods) == interp->mods); break; case XkbSI_Exactly: match = (interp->mods == mods); break; default: match = 0; break; } if (match) { if (interp->sym != NoSymbol) { return interp; } else if (rtrn == NULL) { rtrn = interp; } } } } return rtrn; } static void _XkbAddKeyChange(KeyCode *pFirst, unsigned char *pNum, KeyCode newKey) { KeyCode last; last = (*pFirst) + (*pNum); if (newKey < *pFirst) { *pFirst = newKey; *pNum = (last - newKey) + 1; } else if (newKey > last) { *pNum = (last - *pFirst) + 1; } return; } static void _XkbSetActionKeyMods(XkbDescPtr xkb, XkbAction *act, unsigned mods) { unsigned tmp; switch (act->type) { case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods: if (act->mods.flags & XkbSA_UseModMapMods) act->mods.real_mods = act->mods.mask = mods; if ((tmp = XkbModActionVMods(&act->mods)) != 0) { XkbVirtualModsToReal(xkb, tmp, &tmp); act->mods.mask |= tmp; } break; case XkbSA_ISOLock: if (act->iso.flags & XkbSA_UseModMapMods) act->iso.real_mods = act->iso.mask = mods; if ((tmp = XkbModActionVMods(&act->iso)) != 0) { XkbVirtualModsToReal(xkb, tmp, &tmp); act->iso.mask |= tmp; } break; } return; } #define IBUF_SIZE 8 Bool XkbApplyCompatMapToKey(XkbDescPtr xkb, KeyCode key, XkbChangesPtr changes) { KeySym *syms; unsigned char explicit, mods; XkbSymInterpretPtr *interps, ibuf[IBUF_SIZE]; int n, nSyms, found; unsigned changed, tmp; if ((!xkb) || (!xkb->map) || (!xkb->map->key_sym_map) || (!xkb->compat) || (!xkb->compat->sym_interpret) || (key < xkb->min_key_code) || (key > xkb->max_key_code)) { return FALSE; } if (((!xkb->server) || (!xkb->server->key_acts)) && (XkbAllocServerMap(xkb, XkbAllServerInfoMask, 0) != Success)) { return FALSE; } changed = 0; /* keeps track of what has changed in _this_ call */ explicit = xkb->server->explicit[key]; if (explicit & XkbExplicitInterpretMask) /* nothing to do */ return TRUE; mods = (xkb->map->modmap ? xkb->map->modmap[key] : 0); nSyms = XkbKeyNumSyms(xkb, key); syms = XkbKeySymsPtr(xkb, key); if (nSyms > IBUF_SIZE) { interps = calloc(nSyms, sizeof(XkbSymInterpretPtr)); if (interps == NULL) { interps = ibuf; nSyms = IBUF_SIZE; } } else { interps = ibuf; } found = 0; for (n = 0; n < nSyms; n++) { unsigned level = (n % XkbKeyGroupsWidth(xkb, key)); interps[n] = NULL; if (syms[n] != NoSymbol) { interps[n] = _XkbFindMatchingInterp(xkb, syms[n], mods, level); if (interps[n] && interps[n]->act.type != XkbSA_NoAction) found++; else interps[n] = NULL; } } /* 1/28/96 (ef) -- XXX! WORKING HERE */ if (!found) { if (xkb->server->key_acts[key] != 0) { xkb->server->key_acts[key] = 0; changed |= XkbKeyActionsMask; } } else { XkbAction *pActs; unsigned int new_vmodmask; changed |= XkbKeyActionsMask; pActs = XkbResizeKeyActions(xkb, key, nSyms); if (!pActs) { if (nSyms > IBUF_SIZE) free(interps); return FALSE; } new_vmodmask = 0; for (n = 0; n < nSyms; n++) { if (interps[n]) { unsigned effMods; pActs[n] = *((XkbAction *) &interps[n]->act); if ((n == 0) || ((interps[n]->match & XkbSI_LevelOneOnly) == 0)) { effMods = mods; if (interps[n]->virtual_mod != XkbNoModifier) new_vmodmask |= (1 << interps[n]->virtual_mod); } else effMods = 0; _XkbSetActionKeyMods(xkb, &pActs[n], effMods); } else pActs[n].type = XkbSA_NoAction; } if (((explicit & XkbExplicitVModMapMask) == 0) && (xkb->server->vmodmap[key] != new_vmodmask)) { changed |= XkbVirtualModMapMask; xkb->server->vmodmap[key] = new_vmodmask; } if (interps[0]) { if ((interps[0]->flags & XkbSI_LockingKey) && ((explicit & XkbExplicitBehaviorMask) == 0)) { xkb->server->behaviors[key].type = XkbKB_Lock; changed |= XkbKeyBehaviorsMask; } if (((explicit & XkbExplicitAutoRepeatMask) == 0) && (xkb->ctrls)) { CARD8 old; old = BitIsOn(xkb->ctrls->per_key_repeat, key); if (interps[0]->flags & XkbSI_AutoRepeat) SetBit(xkb->ctrls->per_key_repeat, key); else ClearBit(xkb->ctrls->per_key_repeat, key); if (changes && old != BitIsOn(xkb->ctrls->per_key_repeat, key)) changes->ctrls.changed_ctrls |= XkbPerKeyRepeatMask; } } } if ((!found) || (interps[0] == NULL)) { if (((explicit & XkbExplicitAutoRepeatMask) == 0) && (xkb->ctrls)) { CARD8 old; old = BitIsOn(xkb->ctrls->per_key_repeat, key); SetBit(xkb->ctrls->per_key_repeat, key); if (changes && (old != BitIsOn(xkb->ctrls->per_key_repeat, key))) changes->ctrls.changed_ctrls |= XkbPerKeyRepeatMask; } if (((explicit & XkbExplicitBehaviorMask) == 0) && (xkb->server->behaviors[key].type == XkbKB_Lock)) { xkb->server->behaviors[key].type = XkbKB_Default; changed |= XkbKeyBehaviorsMask; } } if (changes) { XkbMapChangesPtr mc; mc = &changes->map; tmp = (changed & mc->changed); if (tmp & XkbKeyActionsMask) _XkbAddKeyChange(&mc->first_key_act, &mc->num_key_acts, key); else if (changed & XkbKeyActionsMask) { mc->changed |= XkbKeyActionsMask; mc->first_key_act = key; mc->num_key_acts = 1; } if (tmp & XkbKeyBehaviorsMask) { _XkbAddKeyChange(&mc->first_key_behavior, &mc->num_key_behaviors, key); } else if (changed & XkbKeyBehaviorsMask) { mc->changed |= XkbKeyBehaviorsMask; mc->first_key_behavior = key; mc->num_key_behaviors = 1; } if (tmp & XkbVirtualModMapMask) _XkbAddKeyChange(&mc->first_vmodmap_key, &mc->num_vmodmap_keys, key); else if (changed & XkbVirtualModMapMask) { mc->changed |= XkbVirtualModMapMask; mc->first_vmodmap_key = key; mc->num_vmodmap_keys = 1; } mc->changed |= changed; } if (interps != ibuf) free(interps); return TRUE; } Status XkbChangeTypesOfKey(XkbDescPtr xkb, int key, int nGroups, unsigned groups, int *newTypesIn, XkbMapChangesPtr changes) { XkbKeyTypePtr pOldType, pNewType; register int i; int width, nOldGroups, oldWidth, newTypes[XkbNumKbdGroups]; if ((!xkb) || (!XkbKeycodeInRange(xkb, key)) || (!xkb->map) || (!xkb->map->types) || (!newTypesIn) || ((groups & XkbAllGroupsMask) == 0) || (nGroups > XkbNumKbdGroups)) { return BadMatch; } if (nGroups == 0) { for (i = 0; i < XkbNumKbdGroups; i++) { xkb->map->key_sym_map[key].kt_index[i] = XkbOneLevelIndex; } i = xkb->map->key_sym_map[key].group_info; i = XkbSetNumGroups(i, 0); xkb->map->key_sym_map[key].group_info = i; XkbResizeKeySyms(xkb, key, 0); return Success; } nOldGroups = XkbKeyNumGroups(xkb, key); oldWidth = XkbKeyGroupsWidth(xkb, key); for (width = i = 0; i < nGroups; i++) { if (groups & (1 << i)) newTypes[i] = newTypesIn[i]; else if (i < nOldGroups) newTypes[i] = XkbKeyKeyTypeIndex(xkb, key, i); else if (nOldGroups > 0) newTypes[i] = XkbKeyKeyTypeIndex(xkb, key, XkbGroup1Index); else newTypes[i] = XkbTwoLevelIndex; if (newTypes[i] > xkb->map->num_types) return BadMatch; pNewType = &xkb->map->types[newTypes[i]]; if (pNewType->num_levels > width) width = pNewType->num_levels; } if ((xkb->ctrls) && (nGroups > xkb->ctrls->num_groups)) xkb->ctrls->num_groups = nGroups; if ((width != oldWidth) || (nGroups != nOldGroups)) { KeySym oldSyms[XkbMaxSymsPerKey], *pSyms; int nCopy; if (nOldGroups == 0) { pSyms = XkbResizeKeySyms(xkb, key, width * nGroups); if (pSyms != NULL) { i = xkb->map->key_sym_map[key].group_info; i = XkbSetNumGroups(i, nGroups); xkb->map->key_sym_map[key].group_info = i; xkb->map->key_sym_map[key].width = width; for (i = 0; i < nGroups; i++) { xkb->map->key_sym_map[key].kt_index[i] = newTypes[i]; } return Success; } return BadAlloc; } pSyms = XkbKeySymsPtr(xkb, key); memcpy(oldSyms, pSyms, XkbKeyNumSyms(xkb, key) * sizeof(KeySym)); pSyms = XkbResizeKeySyms(xkb, key, width * nGroups); if (pSyms == NULL) return BadAlloc; memset(pSyms, 0, width * nGroups * sizeof(KeySym)); for (i = 0; (i < nGroups) && (i < nOldGroups); i++) { pOldType = XkbKeyKeyType(xkb, key, i); pNewType = &xkb->map->types[newTypes[i]]; if (pNewType->num_levels > pOldType->num_levels) nCopy = pOldType->num_levels; else nCopy = pNewType->num_levels; memcpy(&pSyms[i * width], &oldSyms[i * oldWidth], nCopy * sizeof(KeySym)); } if (XkbKeyHasActions(xkb, key)) { XkbAction oldActs[XkbMaxSymsPerKey], *pActs; pActs = XkbKeyActionsPtr(xkb, key); memcpy(oldActs, pActs, XkbKeyNumSyms(xkb, key) * sizeof(XkbAction)); pActs = XkbResizeKeyActions(xkb, key, width * nGroups); if (pActs == NULL) return BadAlloc; memset(pActs, 0, width * nGroups * sizeof(XkbAction)); for (i = 0; (i < nGroups) && (i < nOldGroups); i++) { pOldType = XkbKeyKeyType(xkb, key, i); pNewType = &xkb->map->types[newTypes[i]]; if (pNewType->num_levels > pOldType->num_levels) nCopy = pOldType->num_levels; else nCopy = pNewType->num_levels; memcpy(&pActs[i * width], &oldActs[i * oldWidth], nCopy * sizeof(XkbAction)); } } i = xkb->map->key_sym_map[key].group_info; i = XkbSetNumGroups(i, nGroups); xkb->map->key_sym_map[key].group_info = i; xkb->map->key_sym_map[key].width = width; } width = 0; for (i = 0; i < nGroups; i++) { xkb->map->key_sym_map[key].kt_index[i] = newTypes[i]; if (xkb->map->types[newTypes[i]].num_levels > width) width = xkb->map->types[newTypes[i]].num_levels; } xkb->map->key_sym_map[key].width = width; if (changes != NULL) { if (changes->changed & XkbKeySymsMask) { _XkbAddKeyChange(&changes->first_key_sym, &changes->num_key_syms, key); } else { changes->changed |= XkbKeySymsMask; changes->first_key_sym = key; changes->num_key_syms = 1; } } return Success; } /***====================================================================***/ Bool XkbVirtualModsToReal(XkbDescPtr xkb, unsigned virtual_mask, unsigned *mask_rtrn) { register int i, bit; register unsigned mask; if (xkb == NULL) return FALSE; if (virtual_mask == 0) { *mask_rtrn = 0; return TRUE; } if (xkb->server == NULL) return FALSE; for (i = mask = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (virtual_mask & bit) mask |= xkb->server->vmods[i]; } *mask_rtrn = mask; return TRUE; } /***====================================================================***/ static Bool XkbUpdateActionVirtualMods(XkbDescPtr xkb, XkbAction *act, unsigned changed) { unsigned int tmp; switch (act->type) { case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods: if (((tmp = XkbModActionVMods(&act->mods)) & changed) != 0) { XkbVirtualModsToReal(xkb, tmp, &tmp); act->mods.mask = act->mods.real_mods; act->mods.mask |= tmp; return TRUE; } break; case XkbSA_ISOLock: if ((((tmp = XkbModActionVMods(&act->iso)) != 0) & changed) != 0) { XkbVirtualModsToReal(xkb, tmp, &tmp); act->iso.mask = act->iso.real_mods; act->iso.mask |= tmp; return TRUE; } break; } return FALSE; } static void XkbUpdateKeyTypeVirtualMods(XkbDescPtr xkb, XkbKeyTypePtr type, unsigned int changed, XkbChangesPtr changes) { register unsigned int i; unsigned int mask; XkbVirtualModsToReal(xkb, type->mods.vmods, &mask); type->mods.mask = type->mods.real_mods | mask; if ((type->map_count > 0) && (type->mods.vmods != 0)) { XkbKTMapEntryPtr entry; for (i = 0, entry = type->map; i < type->map_count; i++, entry++) { if (entry->mods.vmods != 0) { XkbVirtualModsToReal(xkb, entry->mods.vmods, &mask); entry->mods.mask = entry->mods.real_mods | mask; /* entry is active if vmods are bound */ entry->active = (mask != 0); } else entry->active = 1; } } if (changes) { int type_ndx; type_ndx = type - xkb->map->types; if ((type_ndx < 0) || (type_ndx > xkb->map->num_types)) return; if (changes->map.changed & XkbKeyTypesMask) { int last; last = changes->map.first_type + changes->map.num_types - 1; if (type_ndx < changes->map.first_type) { changes->map.first_type = type_ndx; changes->map.num_types = (last - type_ndx) + 1; } else if (type_ndx > last) { changes->map.num_types = (type_ndx - changes->map.first_type) + 1; } } else { changes->map.changed |= XkbKeyTypesMask; changes->map.first_type = type_ndx; changes->map.num_types = 1; } } return; } Bool XkbApplyVirtualModChanges(XkbDescPtr xkb, unsigned changed, XkbChangesPtr changes) { register int i; unsigned int checkState = 0; if ((!xkb) || (!xkb->map) || (changed == 0)) return FALSE; for (i = 0; i < xkb->map->num_types; i++) { if (xkb->map->types[i].mods.vmods & changed) XkbUpdateKeyTypeVirtualMods(xkb, &xkb->map->types[i], changed, changes); } if (changed & xkb->ctrls->internal.vmods) { unsigned int newMask; XkbVirtualModsToReal(xkb, xkb->ctrls->internal.vmods, &newMask); newMask |= xkb->ctrls->internal.real_mods; if (xkb->ctrls->internal.mask != newMask) { xkb->ctrls->internal.mask = newMask; if (changes) { changes->ctrls.changed_ctrls |= XkbInternalModsMask; checkState = TRUE; } } } if (changed & xkb->ctrls->ignore_lock.vmods) { unsigned int newMask; XkbVirtualModsToReal(xkb, xkb->ctrls->ignore_lock.vmods, &newMask); newMask |= xkb->ctrls->ignore_lock.real_mods; if (xkb->ctrls->ignore_lock.mask != newMask) { xkb->ctrls->ignore_lock.mask = newMask; if (changes) { changes->ctrls.changed_ctrls |= XkbIgnoreLockModsMask; checkState = TRUE; } } } if (xkb->indicators != NULL) { XkbIndicatorMapPtr map; map = &xkb->indicators->maps[0]; for (i = 0; i < XkbNumIndicators; i++, map++) { if (map->mods.vmods & changed) { unsigned int newMask; XkbVirtualModsToReal(xkb, map->mods.vmods, &newMask); newMask |= map->mods.real_mods; if (newMask != map->mods.mask) { map->mods.mask = newMask; if (changes) { changes->indicators.map_changes |= (1 << i); checkState = TRUE; } } } } } if (xkb->compat != NULL) { XkbCompatMapPtr compat; compat = xkb->compat; for (i = 0; i < XkbNumKbdGroups; i++) { unsigned int newMask; XkbVirtualModsToReal(xkb, compat->groups[i].vmods, &newMask); newMask |= compat->groups[i].real_mods; if (compat->groups[i].mask != newMask) { compat->groups[i].mask = newMask; if (changes) { changes->compat.changed_groups |= (1 << i); checkState = TRUE; } } } } if (xkb->map && xkb->server) { int highChange = 0, lowChange = -1; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { if (XkbKeyHasActions(xkb, i)) { register XkbAction *pAct; register int n; pAct = XkbKeyActionsPtr(xkb, i); for (n = XkbKeyNumActions(xkb, i); n > 0; n--, pAct++) { if ((pAct->type != XkbSA_NoAction) && XkbUpdateActionVirtualMods(xkb, pAct, changed)) { if (lowChange < 0) lowChange = i; highChange = i; } } } } if (changes && (lowChange > 0)) { /* something changed */ if (changes->map.changed & XkbKeyActionsMask) { int last; if (changes->map.first_key_act < lowChange) lowChange = changes->map.first_key_act; last = changes->map.first_key_act + changes->map.num_key_acts - 1; if (last > highChange) highChange = last; } changes->map.changed |= XkbKeyActionsMask; changes->map.first_key_act = lowChange; changes->map.num_key_acts = (highChange - lowChange) + 1; } } return checkState; } xorg-server-1.17.1/xkb/ddxBeep.c0000664000175100017510000002473312456571574013345 00000000000000/************************************************************ Copyright (c) 1993 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 "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include #include /*#define FALLING_TONE 1*/ /*#define RISING_TONE 1*/ #define FALLING_TONE 10 #define RISING_TONE 10 #define SHORT_TONE 50 #define SHORT_DELAY 60 #define LONG_TONE 75 #define VERY_LONG_TONE 100 #define LONG_DELAY 85 #define CLICK_DURATION 1 #define DEEP_PITCH 250 #define LOW_PITCH 500 #define MID_PITCH 1000 #define HIGH_PITCH 2000 #define CLICK_PITCH 1500 static unsigned long atomGeneration = 0; static Atom featureOn; static Atom featureOff; static Atom featureChange; static Atom ledOn; static Atom ledOff; static Atom ledChange; static Atom slowWarn; static Atom slowPress; static Atom slowReject; static Atom slowAccept; static Atom slowRelease; static Atom stickyLatch; static Atom stickyLock; static Atom stickyUnlock; static Atom bounceReject; static char doesPitch = 1; #define FEATURE_ON "AX_FeatureOn" #define FEATURE_OFF "AX_FeatureOff" #define FEATURE_CHANGE "AX_FeatureChange" #define LED_ON "AX_IndicatorOn" #define LED_OFF "AX_IndicatorOff" #define LED_CHANGE "AX_IndicatorChange" #define SLOW_WARN "AX_SlowKeysWarning" #define SLOW_PRESS "AX_SlowKeyPress" #define SLOW_REJECT "AX_SlowKeyReject" #define SLOW_ACCEPT "AX_SlowKeyAccept" #define SLOW_RELEASE "AX_SlowKeyRelease" #define STICKY_LATCH "AX_StickyLatch" #define STICKY_LOCK "AX_StickyLock" #define STICKY_UNLOCK "AX_StickyUnlock" #define BOUNCE_REJECT "AX_BounceKeyReject" #define MAKE_ATOM(a) MakeAtom(a,sizeof(a)-1,TRUE) static void _XkbDDXBeepInitAtoms(void) { featureOn = MAKE_ATOM(FEATURE_ON); featureOff = MAKE_ATOM(FEATURE_OFF); featureChange = MAKE_ATOM(FEATURE_CHANGE); ledOn = MAKE_ATOM(LED_ON); ledOff = MAKE_ATOM(LED_OFF); ledChange = MAKE_ATOM(LED_CHANGE); slowWarn = MAKE_ATOM(SLOW_WARN); slowPress = MAKE_ATOM(SLOW_PRESS); slowReject = MAKE_ATOM(SLOW_REJECT); slowAccept = MAKE_ATOM(SLOW_ACCEPT); slowRelease = MAKE_ATOM(SLOW_RELEASE); stickyLatch = MAKE_ATOM(STICKY_LATCH); stickyLock = MAKE_ATOM(STICKY_LOCK); stickyUnlock = MAKE_ATOM(STICKY_UNLOCK); bounceReject = MAKE_ATOM(BOUNCE_REJECT); return; } static CARD32 _XkbDDXBeepExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr dev = (DeviceIntPtr) arg; KbdFeedbackPtr feed; KeybdCtrl *ctrl; XkbSrvInfoPtr xkbInfo; CARD32 next; int pitch, duration; int oldPitch, oldDuration; Atom name; if ((dev == NULL) || (dev->key == NULL) || (dev->key->xkbInfo == NULL) || (dev->kbdfeed == NULL)) return 0; if (atomGeneration != serverGeneration) { _XkbDDXBeepInitAtoms(); atomGeneration = serverGeneration; } feed = dev->kbdfeed; ctrl = &feed->ctrl; xkbInfo = dev->key->xkbInfo; next = 0; pitch = oldPitch = ctrl->bell_pitch; duration = oldDuration = ctrl->bell_duration; name = None; switch (xkbInfo->beepType) { default: ErrorF("[xkb] Unknown beep type %d\n", xkbInfo->beepType); case _BEEP_NONE: duration = 0; break; /* When an LED is turned on, we want a high-pitched beep. * When the LED it turned off, we want a low-pitched beep. * If we cannot do pitch, we want a single beep for on and two * beeps for off. */ case _BEEP_LED_ON: if (name == None) name = ledOn; duration = SHORT_TONE; pitch = HIGH_PITCH; break; case _BEEP_LED_OFF: if (name == None) name = ledOff; duration = SHORT_TONE; pitch = LOW_PITCH; if (!doesPitch && xkbInfo->beepCount < 1) next = SHORT_DELAY; break; /* When a Feature is turned on, we want an up-siren. * When a Feature is turned off, we want a down-siren. * If we cannot do pitch, we want a single beep for on and two * beeps for off. */ case _BEEP_FEATURE_ON: if (name == None) name = featureOn; if (xkbInfo->beepCount < 1) { pitch = LOW_PITCH; duration = VERY_LONG_TONE; if (doesPitch) next = SHORT_DELAY; } else { pitch = MID_PITCH; duration = SHORT_TONE; } break; case _BEEP_FEATURE_OFF: if (name == None) name = featureOff; if (xkbInfo->beepCount < 1) { pitch = MID_PITCH; if (doesPitch) duration = VERY_LONG_TONE; else duration = SHORT_TONE; next = SHORT_DELAY; } else { pitch = LOW_PITCH; duration = SHORT_TONE; } break; /* Two high beeps indicate an LED or Feature changed * state, but that another LED or Feature is also on. * [[[WDW - This is not in AccessDOS ]]] */ case _BEEP_LED_CHANGE: if (name == None) name = ledChange; case _BEEP_FEATURE_CHANGE: if (name == None) name = featureChange; duration = SHORT_TONE; pitch = HIGH_PITCH; if (xkbInfo->beepCount < 1) { next = SHORT_DELAY; } break; /* Three high-pitched beeps are the warning that SlowKeys * is going to be turned on or off. */ case _BEEP_SLOW_WARN: if (name == None) name = slowWarn; duration = SHORT_TONE; pitch = HIGH_PITCH; if (xkbInfo->beepCount < 2) next = SHORT_DELAY; break; /* Click on SlowKeys press and accept. * Deep pitch when a SlowKey or BounceKey is rejected. * [[[WDW - Rejects are not in AccessDOS ]]] * If we cannot do pitch, we want single beeps. */ case _BEEP_SLOW_PRESS: if (name == None) name = slowPress; case _BEEP_SLOW_ACCEPT: if (name == None) name = slowAccept; case _BEEP_SLOW_RELEASE: if (name == None) name = slowRelease; duration = CLICK_DURATION; pitch = CLICK_PITCH; break; case _BEEP_BOUNCE_REJECT: if (name == None) name = bounceReject; case _BEEP_SLOW_REJECT: if (name == None) name = slowReject; duration = SHORT_TONE; pitch = DEEP_PITCH; break; /* Low followed by high pitch when a StickyKey is latched. * High pitch when a StickyKey is locked. * Low pitch when unlocked. * If we cannot do pitch, two beeps for latch, nothing for * lock, and two for unlock. */ case _BEEP_STICKY_LATCH: if (name == None) name = stickyLatch; duration = SHORT_TONE; if (xkbInfo->beepCount < 1) { next = SHORT_DELAY; pitch = LOW_PITCH; } else pitch = HIGH_PITCH; break; case _BEEP_STICKY_LOCK: if (name == None) name = stickyLock; if (doesPitch) { duration = SHORT_TONE; pitch = HIGH_PITCH; } break; case _BEEP_STICKY_UNLOCK: if (name == None) name = stickyUnlock; duration = SHORT_TONE; pitch = LOW_PITCH; if (!doesPitch && xkbInfo->beepCount < 1) next = SHORT_DELAY; break; } if (timer == NULL && duration > 0) { CARD32 starttime = GetTimeInMillis(); CARD32 elapsedtime; ctrl->bell_duration = duration; ctrl->bell_pitch = pitch; if (xkbInfo->beepCount == 0) { XkbHandleBell(0, 0, dev, ctrl->bell, (void *) ctrl, KbdFeedbackClass, name, None, NULL); } else if (xkbInfo->desc->ctrls->enabled_ctrls & XkbAudibleBellMask) { (*dev->kbdfeed->BellProc) (ctrl->bell, dev, (void *) ctrl, KbdFeedbackClass); } ctrl->bell_duration = oldDuration; ctrl->bell_pitch = oldPitch; xkbInfo->beepCount++; /* Some DDX schedule the beep and return immediately, others don't return until the beep is completed. We measure the time and if it's less than the beep duration, make sure not to schedule the next beep until after the current one finishes. */ elapsedtime = GetTimeInMillis(); if (elapsedtime > starttime) { /* watch out for millisecond counter overflow! */ elapsedtime -= starttime; } else { elapsedtime = 0; } if (elapsedtime < duration) { next += duration - elapsedtime; } } return next; } int XkbDDXAccessXBeep(DeviceIntPtr dev, unsigned what, unsigned which) { XkbSrvInfoRec *xkbInfo = dev->key->xkbInfo; CARD32 next; xkbInfo->beepType = what; xkbInfo->beepCount = 0; next = _XkbDDXBeepExpire(NULL, 0, (void *) dev); if (next > 0) { xkbInfo->beepTimer = TimerSet(xkbInfo->beepTimer, 0, next, _XkbDDXBeepExpire, (void *) dev); } return 1; } xorg-server-1.17.1/xkb/xkbDflts.h0000664000175100017510000003463412274325512013544 00000000000000/* This file generated automatically by xkbcomp */ /* DO NOT EDIT */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef DEFAULT_H #define DEFAULT_H 1 #define GET_ATOM(d,s) MakeAtom(s,strlen(s),1) #define DPYTYPE char * #define NUM_KEYS 1 #define vmod_NumLock 0 #define vmod_Alt 1 #define vmod_LevelThree 2 #define vmod_AltGr 3 #define vmod_ScrollLock 4 #define vmod_NumLockMask (1<<0) #define vmod_AltMask (1<<1) #define vmod_LevelThreeMask (1<<2) #define vmod_AltGrMask (1<<3) #define vmod_ScrollLockMask (1<<4) /* types name is "default" */ static Atom lnames_ONE_LEVEL[1]; static XkbKTMapEntryRec map_TWO_LEVEL[1] = { {1, 1, {ShiftMask, ShiftMask, 0}} }; static Atom lnames_TWO_LEVEL[2]; static XkbKTMapEntryRec map_ALPHABETIC[2] = { {1, 1, {ShiftMask, ShiftMask, 0}}, {1, 0, {LockMask, LockMask, 0}} }; static XkbModsRec preserve_ALPHABETIC[2] = { {0, 0, 0}, {LockMask, LockMask, 0} }; static Atom lnames_ALPHABETIC[2]; static XkbKTMapEntryRec map_KEYPAD[2] = { {1, 1, {ShiftMask, ShiftMask, 0}}, {0, 1, {0, 0, vmod_NumLockMask}} }; static Atom lnames_KEYPAD[2]; static XkbKTMapEntryRec map_PC_BREAK[1] = { {1, 1, {ControlMask, ControlMask, 0}} }; static Atom lnames_PC_BREAK[2]; static XkbKTMapEntryRec map_PC_SYSRQ[1] = { {0, 1, {0, 0, vmod_AltMask}} }; static Atom lnames_PC_SYSRQ[2]; static XkbKTMapEntryRec map_CTRL_ALT[1] = { {0, 1, {ControlMask, ControlMask, vmod_AltMask}} }; static Atom lnames_CTRL_ALT[2]; static XkbKTMapEntryRec map_THREE_LEVEL[3] = { {1, 1, {ShiftMask, ShiftMask, 0}}, {0, 2, {0, 0, vmod_LevelThreeMask}}, {0, 2, {ShiftMask, ShiftMask, vmod_LevelThreeMask}} }; static Atom lnames_THREE_LEVEL[3]; static XkbKTMapEntryRec map_SHIFT_ALT[1] = { {0, 1, {ShiftMask, ShiftMask, vmod_AltMask}} }; static Atom lnames_SHIFT_ALT[2]; static XkbKeyTypeRec dflt_types[] = { { {0, 0, 0}, 1, 0, NULL, NULL, None, lnames_ONE_LEVEL}, { {ShiftMask, ShiftMask, 0}, 2, 1, map_TWO_LEVEL, NULL, None, lnames_TWO_LEVEL}, { {ShiftMask | LockMask, ShiftMask | LockMask, 0}, 2, 2, map_ALPHABETIC, preserve_ALPHABETIC, None, lnames_ALPHABETIC}, { {ShiftMask, ShiftMask, vmod_NumLockMask}, 2, 2, map_KEYPAD, NULL, None, lnames_KEYPAD}, { {ControlMask, ControlMask, 0}, 2, 1, map_PC_BREAK, NULL, None, lnames_PC_BREAK}, { {0, 0, vmod_AltMask}, 2, 1, map_PC_SYSRQ, NULL, None, lnames_PC_SYSRQ}, { {ControlMask, ControlMask, vmod_AltMask}, 2, 1, map_CTRL_ALT, NULL, None, lnames_CTRL_ALT}, { {ShiftMask, ShiftMask, vmod_LevelThreeMask}, 3, 3, map_THREE_LEVEL, NULL, None, lnames_THREE_LEVEL}, { {ShiftMask, ShiftMask, vmod_AltMask}, 2, 1, map_SHIFT_ALT, NULL, None, lnames_SHIFT_ALT} }; #define num_dflt_types (sizeof(dflt_types)/sizeof(XkbKeyTypeRec)) static void initTypeNames(DPYTYPE dpy) { dflt_types[0].name = GET_ATOM(dpy, "ONE_LEVEL"); lnames_ONE_LEVEL[0] = GET_ATOM(dpy, "Any"); dflt_types[1].name = GET_ATOM(dpy, "TWO_LEVEL"); lnames_TWO_LEVEL[0] = GET_ATOM(dpy, "Base"); lnames_TWO_LEVEL[1] = GET_ATOM(dpy, "Shift"); dflt_types[2].name = GET_ATOM(dpy, "ALPHABETIC"); lnames_ALPHABETIC[0] = GET_ATOM(dpy, "Base"); lnames_ALPHABETIC[1] = GET_ATOM(dpy, "Caps"); dflt_types[3].name = GET_ATOM(dpy, "KEYPAD"); lnames_KEYPAD[0] = GET_ATOM(dpy, "Base"); lnames_KEYPAD[1] = GET_ATOM(dpy, "Number"); dflt_types[4].name = GET_ATOM(dpy, "PC_BREAK"); lnames_PC_BREAK[0] = GET_ATOM(dpy, "Base"); lnames_PC_BREAK[1] = GET_ATOM(dpy, "Control"); dflt_types[5].name = GET_ATOM(dpy, "PC_SYSRQ"); lnames_PC_SYSRQ[0] = GET_ATOM(dpy, "Base"); lnames_PC_SYSRQ[1] = GET_ATOM(dpy, "Alt"); dflt_types[6].name = GET_ATOM(dpy, "CTRL+ALT"); lnames_CTRL_ALT[0] = GET_ATOM(dpy, "Base"); lnames_CTRL_ALT[1] = GET_ATOM(dpy, "Ctrl+Alt"); dflt_types[7].name = GET_ATOM(dpy, "THREE_LEVEL"); lnames_THREE_LEVEL[0] = GET_ATOM(dpy, "Base"); lnames_THREE_LEVEL[1] = GET_ATOM(dpy, "Shift"); lnames_THREE_LEVEL[2] = GET_ATOM(dpy, "Level3"); dflt_types[8].name = GET_ATOM(dpy, "SHIFT+ALT"); lnames_SHIFT_ALT[0] = GET_ATOM(dpy, "Base"); lnames_SHIFT_ALT[1] = GET_ATOM(dpy, "Shift+Alt"); } /* compat name is "default" */ static XkbSymInterpretRec dfltSI[69] = { {XK_ISO_Level2_Latch, 0x0000, XkbSI_LevelOneOnly | XkbSI_Exactly, ShiftMask, 255, {XkbSA_LatchMods, {0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_Eisu_Shift, 0x0000, XkbSI_Exactly, LockMask, 255, {XkbSA_NoAction, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Eisu_toggle, 0x0000, XkbSI_Exactly, LockMask, 255, {XkbSA_NoAction, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Kana_Shift, 0x0000, XkbSI_Exactly, LockMask, 255, {XkbSA_NoAction, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Kana_Lock, 0x0000, XkbSI_Exactly, LockMask, 255, {XkbSA_NoAction, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Shift_Lock, 0x0000, XkbSI_AnyOf, ShiftMask | LockMask, 255, {XkbSA_LockMods, {0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_Num_Lock, 0x0000, XkbSI_AnyOf, 0xff, 0, {XkbSA_LockMods, {0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}}}, {XK_Alt_L, 0x0000, XkbSI_AnyOf, 0xff, 1, {XkbSA_SetMods, {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Alt_R, 0x0000, XkbSI_AnyOf, 0xff, 1, {XkbSA_SetMods, {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Scroll_Lock, 0x0000, XkbSI_AnyOf, 0xff, 4, {XkbSA_LockMods, {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_ISO_Lock, 0x0000, XkbSI_AnyOf, 0xff, 255, {XkbSA_ISOLock, {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_ISO_Level3_Shift, 0x0000, XkbSI_LevelOneOnly | XkbSI_AnyOf, 0xff, 2, {XkbSA_SetMods, {0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00}}}, {XK_ISO_Level3_Latch, 0x0000, XkbSI_LevelOneOnly | XkbSI_AnyOf, 0xff, 2, {XkbSA_LatchMods, {0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00}}}, {XK_Mode_switch, 0x0000, XkbSI_LevelOneOnly | XkbSI_AnyOfOrNone, 0xff, 3, {XkbSA_SetGroup, {0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_1, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00}}}, {XK_KP_End, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00}}}, {XK_KP_2, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}}}, {XK_KP_Down, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}}}, {XK_KP_3, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00}}}, {XK_KP_Next, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00}}}, {XK_KP_4, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Left, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_6, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Right, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_7, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00}}}, {XK_KP_Home, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00}}}, {XK_KP_8, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00}}}, {XK_KP_Up, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00}}}, {XK_KP_9, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00}}}, {XK_KP_Prior, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_MovePtr, {0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00}}}, {XK_KP_5, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Begin, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_F1, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Divide, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_F2, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Multiply, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_F3, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Subtract, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Separator, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Add, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_0, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Insert, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Decimal, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_KP_Delete, 0x0001, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Button_Dflt, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Button1, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Button2, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Button3, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_DblClick_Dflt, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_DblClick1, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_DblClick2, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_DblClick3, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_PtrBtn, {0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Drag_Dflt, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Drag1, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Drag2, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_Drag3, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockPtrBtn, {0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_EnableKeys, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockControls, {0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00}}}, {XK_Pointer_Accelerate, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockControls, {0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00}}}, {XK_Pointer_DfltBtnNext, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00}}}, {XK_Pointer_DfltBtnPrev, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_SetPtrDflt, {0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00}}}, {XK_AccessX_Enable, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockControls, {0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00}}}, {XK_Terminate_Server, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_Terminate, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_ISO_Group_Latch, 0x0000, XkbSI_LevelOneOnly | XkbSI_AnyOfOrNone, 0xff, 3, {XkbSA_LatchGroup, {0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_ISO_Next_Group, 0x0000, XkbSI_LevelOneOnly | XkbSI_AnyOfOrNone, 0xff, 3, {XkbSA_LockGroup, {0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_ISO_Prev_Group, 0x0000, XkbSI_LevelOneOnly | XkbSI_AnyOfOrNone, 0xff, 3, {XkbSA_LockGroup, {0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_ISO_First_Group, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockGroup, {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {XK_ISO_Last_Group, 0x0000, XkbSI_AnyOfOrNone, 0xff, 255, {XkbSA_LockGroup, {0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}}}, {NoSymbol, 0x0000, XkbSI_Exactly, LockMask, 255, {XkbSA_LockMods, {0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00}}}, {NoSymbol, 0x0000, XkbSI_AnyOf, 0xff, 255, {XkbSA_SetMods, {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}} }; #define num_dfltSI (sizeof(dfltSI)/sizeof(XkbSymInterpretRec)) static XkbCompatMapRec compatMap = { dfltSI, { /* group compatibility */ {0, 0, 0}, {0, 0, vmod_AltGrMask}, {0, 0, vmod_AltGrMask}, {0, 0, vmod_AltGrMask} }, num_dfltSI, num_dfltSI }; static void initIndicatorNames(DPYTYPE dpy, XkbDescPtr xkb) { xkb->names->indicators[0] = GET_ATOM(dpy, "Caps Lock"); xkb->names->indicators[1] = GET_ATOM(dpy, "Num Lock"); xkb->names->indicators[2] = GET_ATOM(dpy, "Shift Lock"); xkb->names->indicators[3] = GET_ATOM(dpy, "Mouse Keys"); xkb->names->indicators[4] = GET_ATOM(dpy, "Scroll Lock"); xkb->names->indicators[5] = GET_ATOM(dpy, "Group 2"); } #endif /* DEFAULT_H */ xorg-server-1.17.1/xkb/xkbActions.c0000664000175100017510000014611512456571574014076 00000000000000/************************************************************ Copyright (c) 1993 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 "misc.h" #include "inputstr.h" #include "exevents.h" #include "eventstr.h" #include #include "xkb.h" #include #include "mi.h" #include "mipointer.h" #include "inpututils.h" #define EXTENSION_EVENT_BASE 64 DevPrivateKeyRec xkbDevicePrivateKeyRec; static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y); void xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, void *data) { xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device); ProcessInputProc backupproc; if (xkbPrivPtr->unwrapProc) xkbPrivPtr->unwrapProc = NULL; UNWRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, backupproc); proc(device, data); COND_WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, backupproc, xkbUnwrapProc); } Bool XkbInitPrivates(void) { return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, sizeof(xkbDeviceInfoRec)); } void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) { xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device); WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc); } /***====================================================================***/ static XkbAction _FixUpAction(XkbDescPtr xkb, XkbAction *act) { static XkbAction fake; if (XkbIsPtrAction(act) && (!(xkb->ctrls->enabled_ctrls & XkbMouseKeysMask))) { fake.type = XkbSA_NoAction; return fake; } if (xkb->ctrls->enabled_ctrls & XkbStickyKeysMask) { if (act->any.type == XkbSA_SetMods) { fake.mods.type = XkbSA_LatchMods; fake.mods.mask = act->mods.mask; if (XkbAX_NeedOption(xkb->ctrls, XkbAX_LatchToLockMask)) fake.mods.flags = XkbSA_ClearLocks | XkbSA_LatchToLock; else fake.mods.flags = XkbSA_ClearLocks; return fake; } if (act->any.type == XkbSA_SetGroup) { fake.group.type = XkbSA_LatchGroup; if (XkbAX_NeedOption(xkb->ctrls, XkbAX_LatchToLockMask)) fake.group.flags = XkbSA_ClearLocks | XkbSA_LatchToLock; else fake.group.flags = XkbSA_ClearLocks; XkbSASetGroup(&fake.group, XkbSAGroup(&act->group)); return fake; } } return *act; } static XkbAction XkbGetKeyAction(XkbSrvInfoPtr xkbi, XkbStatePtr xkbState, CARD8 key) { int effectiveGroup; int col; XkbDescPtr xkb; XkbKeyTypePtr type; XkbAction *pActs; static XkbAction fake; xkb = xkbi->desc; if (!XkbKeyHasActions(xkb, key) || !XkbKeycodeInRange(xkb, key)) { fake.type = XkbSA_NoAction; return fake; } pActs = XkbKeyActionsPtr(xkb, key); col = 0; effectiveGroup = XkbGetEffectiveGroup(xkbi, xkbState, key); if (effectiveGroup != XkbGroup1Index) col += (effectiveGroup * XkbKeyGroupsWidth(xkb, key)); type = XkbKeyKeyType(xkb, key, effectiveGroup); if (type->map != NULL) { register unsigned i, mods; register XkbKTMapEntryPtr entry; mods = xkbState->mods & type->mods.mask; for (entry = type->map, i = 0; i < type->map_count; i++, entry++) { if ((entry->active) && (entry->mods.mask == mods)) { col += entry->level; break; } } } if (pActs[col].any.type == XkbSA_NoAction) return pActs[col]; fake = _FixUpAction(xkb, &pActs[col]); return fake; } static XkbAction XkbGetButtonAction(DeviceIntPtr kbd, DeviceIntPtr dev, int button) { XkbAction fake; if ((dev->button) && (dev->button->xkb_acts)) { if (dev->button->xkb_acts[button - 1].any.type != XkbSA_NoAction) { fake = _FixUpAction(kbd->key->xkbInfo->desc, &dev->button->xkb_acts[button - 1]); return fake; } } fake.any.type = XkbSA_NoAction; return fake; } /***====================================================================***/ #define SYNTHETIC_KEYCODE 1 #define BTN_ACT_FLAG 0x100 static int _XkbFilterSetState(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { if (filter->keycode == 0) { /* initial press */ filter->keycode = keycode; filter->active = 1; filter->filterOthers = ((pAction->mods.mask & XkbSA_ClearLocks) != 0); filter->priv = 0; filter->filter = _XkbFilterSetState; if (pAction->type == XkbSA_SetMods) { filter->upAction = *pAction; xkbi->setMods = pAction->mods.mask; } else { xkbi->groupChange = XkbSAGroup(&pAction->group); if (pAction->group.flags & XkbSA_GroupAbsolute) xkbi->groupChange -= xkbi->state.base_group; filter->upAction = *pAction; XkbSASetGroup(&filter->upAction.group, xkbi->groupChange); } } else if (filter->keycode == keycode) { if (filter->upAction.type == XkbSA_SetMods) { xkbi->clearMods = filter->upAction.mods.mask; if (filter->upAction.mods.flags & XkbSA_ClearLocks) { xkbi->state.locked_mods &= ~filter->upAction.mods.mask; } } else { if (filter->upAction.group.flags & XkbSA_ClearLocks) { xkbi->state.locked_group = 0; } xkbi->groupChange = -XkbSAGroup(&filter->upAction.group); } filter->active = 0; } else { filter->upAction.mods.flags &= ~XkbSA_ClearLocks; filter->filterOthers = 0; } return 1; } #define LATCH_KEY_DOWN 1 #define LATCH_PENDING 2 static int _XkbFilterLatchState(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { if (filter->keycode == 0) { /* initial press */ AccessXCancelRepeatKey(xkbi,keycode); filter->keycode = keycode; filter->active = 1; filter->filterOthers = 1; filter->priv = LATCH_KEY_DOWN; filter->filter = _XkbFilterLatchState; if (pAction->type == XkbSA_LatchMods) { filter->upAction = *pAction; xkbi->setMods = pAction->mods.mask; } else { xkbi->groupChange = XkbSAGroup(&pAction->group); if (pAction->group.flags & XkbSA_GroupAbsolute) xkbi->groupChange -= xkbi->state.base_group; filter->upAction = *pAction; XkbSASetGroup(&filter->upAction.group, xkbi->groupChange); } } else if (pAction && (filter->priv == LATCH_PENDING)) { if (((1 << pAction->type) & XkbSA_BreakLatch) != 0) { filter->active = 0; /* If one latch is broken, all latches are broken, so it's no use to find out which particular latch this filter tracks. */ xkbi->state.latched_mods = 0; xkbi->state.latched_group = 0; } } else if (filter->keycode == keycode && filter->priv != LATCH_PENDING){ /* The test above for LATCH_PENDING skips subsequent releases of the key after it has been released first time and the latch became pending. */ XkbControlsPtr ctrls = xkbi->desc->ctrls; int needBeep = ((ctrls->enabled_ctrls & XkbStickyKeysMask) && XkbAX_NeedFeedback(ctrls, XkbAX_StickyKeysFBMask)); if (filter->upAction.type == XkbSA_LatchMods) { unsigned char mask = filter->upAction.mods.mask; unsigned char common; xkbi->clearMods = mask; /* ClearLocks */ common = mask & xkbi->state.locked_mods; if ((filter->upAction.mods.flags & XkbSA_ClearLocks) && common) { mask &= ~common; xkbi->state.locked_mods &= ~common; if (needBeep) XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_UNLOCK, XkbStickyKeysMask); } /* LatchToLock */ common = mask & xkbi->state.latched_mods; if ((filter->upAction.mods.flags & XkbSA_LatchToLock) && common) { unsigned char newlocked; mask &= ~common; newlocked = common & ~xkbi->state.locked_mods; if(newlocked){ xkbi->state.locked_mods |= newlocked; if (needBeep) XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK, XkbStickyKeysMask); } xkbi->state.latched_mods &= ~common; } /* Latch remaining modifiers, if any. */ if (mask) { xkbi->state.latched_mods |= mask; filter->priv = LATCH_PENDING; if (needBeep) XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LATCH, XkbStickyKeysMask); } } else { xkbi->groupChange = -XkbSAGroup(&filter->upAction.group); /* ClearLocks */ if ((filter->upAction.group.flags & XkbSA_ClearLocks) && (xkbi->state.locked_group)) { xkbi->state.locked_group = 0; if (needBeep) XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_UNLOCK, XkbStickyKeysMask); } /* LatchToLock */ else if ((filter->upAction.group.flags & XkbSA_LatchToLock) && (xkbi->state.latched_group)) { xkbi->state.locked_group += XkbSAGroup(&filter->upAction.group); xkbi->state.latched_group -= XkbSAGroup(&filter->upAction.group); if(XkbSAGroup(&filter->upAction.group) && needBeep) XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK, XkbStickyKeysMask); } /* Latch group */ else if(XkbSAGroup(&filter->upAction.group)){ xkbi->state.latched_group += XkbSAGroup(&filter->upAction.group); filter->priv = LATCH_PENDING; if (needBeep) XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LATCH, XkbStickyKeysMask); } } if (filter->priv != LATCH_PENDING) filter->active = 0; } else if (pAction && (filter->priv == LATCH_KEY_DOWN)) { /* Latch was broken before it became pending: degrade to a SetMods/SetGroup. */ if (filter->upAction.type == XkbSA_LatchMods) filter->upAction.type = XkbSA_SetMods; else filter->upAction.type = XkbSA_SetGroup; filter->filter = _XkbFilterSetState; filter->priv = 0; return filter->filter(xkbi, filter, keycode, pAction); } return 1; } static int _XkbFilterLockState(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { if (pAction && (pAction->type == XkbSA_LockGroup)) { if (pAction->group.flags & XkbSA_GroupAbsolute) xkbi->state.locked_group = XkbSAGroup(&pAction->group); else xkbi->state.locked_group += XkbSAGroup(&pAction->group); return 1; } if (filter->keycode == 0) { /* initial press */ filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->priv = xkbi->state.locked_mods & pAction->mods.mask; filter->filter = _XkbFilterLockState; filter->upAction = *pAction; if (!(filter->upAction.mods.flags & XkbSA_LockNoLock)) xkbi->state.locked_mods |= pAction->mods.mask; xkbi->setMods = pAction->mods.mask; } else if (filter->keycode == keycode) { filter->active = 0; xkbi->clearMods = filter->upAction.mods.mask; if (!(filter->upAction.mods.flags & XkbSA_LockNoUnlock)) xkbi->state.locked_mods &= ~filter->priv; } return 1; } #define ISO_KEY_DOWN 0 #define NO_ISO_LOCK 1 static int _XkbFilterISOLock(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { if (filter->keycode == 0) { /* initial press */ CARD8 flags = pAction->iso.flags; filter->keycode = keycode; filter->active = 1; filter->filterOthers = 1; filter->priv = ISO_KEY_DOWN; filter->upAction = *pAction; filter->filter = _XkbFilterISOLock; if (flags & XkbSA_ISODfltIsGroup) { xkbi->groupChange = XkbSAGroup(&pAction->iso); xkbi->setMods = 0; } else { xkbi->setMods = pAction->iso.mask; xkbi->groupChange = 0; } if ((!(flags & XkbSA_ISONoAffectMods)) && (xkbi->state.base_mods)) { filter->priv = NO_ISO_LOCK; xkbi->state.locked_mods ^= xkbi->state.base_mods; } if ((!(flags & XkbSA_ISONoAffectGroup)) && (xkbi->state.base_group)) { /* 6/22/93 (ef) -- lock groups if group key is down first */ } if (!(flags & XkbSA_ISONoAffectPtr)) { /* 6/22/93 (ef) -- lock mouse buttons if they're down */ } } else if (filter->keycode == keycode) { CARD8 flags = filter->upAction.iso.flags; if (flags & XkbSA_ISODfltIsGroup) { xkbi->groupChange = -XkbSAGroup(&filter->upAction.iso); xkbi->clearMods = 0; if (filter->priv == ISO_KEY_DOWN) xkbi->state.locked_group += XkbSAGroup(&filter->upAction.iso); } else { xkbi->clearMods = filter->upAction.iso.mask; xkbi->groupChange = 0; if (filter->priv == ISO_KEY_DOWN) xkbi->state.locked_mods ^= filter->upAction.iso.mask; } filter->active = 0; } else if (pAction) { CARD8 flags = filter->upAction.iso.flags; switch (pAction->type) { case XkbSA_SetMods: case XkbSA_LatchMods: if (!(flags & XkbSA_ISONoAffectMods)) { pAction->type = XkbSA_LockMods; filter->priv = NO_ISO_LOCK; } break; case XkbSA_SetGroup: case XkbSA_LatchGroup: if (!(flags & XkbSA_ISONoAffectGroup)) { pAction->type = XkbSA_LockGroup; filter->priv = NO_ISO_LOCK; } break; case XkbSA_PtrBtn: if (!(flags & XkbSA_ISONoAffectPtr)) { pAction->type = XkbSA_LockPtrBtn; filter->priv = NO_ISO_LOCK; } break; case XkbSA_SetControls: if (!(flags & XkbSA_ISONoAffectCtrls)) { pAction->type = XkbSA_LockControls; filter->priv = NO_ISO_LOCK; } break; } } return 1; } static CARD32 _XkbPtrAccelExpire(OsTimerPtr timer, CARD32 now, void *arg) { XkbSrvInfoPtr xkbi = (XkbSrvInfoPtr) arg; XkbControlsPtr ctrls = xkbi->desc->ctrls; int dx, dy; if (xkbi->mouseKey == 0) return 0; if (xkbi->mouseKeysAccel) { if ((xkbi->mouseKeysCounter) < ctrls->mk_time_to_max) { double step; xkbi->mouseKeysCounter++; step = xkbi->mouseKeysCurveFactor * pow((double) xkbi->mouseKeysCounter, xkbi->mouseKeysCurve); if (xkbi->mouseKeysDX < 0) dx = floor(((double) xkbi->mouseKeysDX) * step); else dx = ceil(((double) xkbi->mouseKeysDX) * step); if (xkbi->mouseKeysDY < 0) dy = floor(((double) xkbi->mouseKeysDY) * step); else dy = ceil(((double) xkbi->mouseKeysDY) * step); } else { dx = xkbi->mouseKeysDX * ctrls->mk_max_speed; dy = xkbi->mouseKeysDY * ctrls->mk_max_speed; } if (xkbi->mouseKeysFlags & XkbSA_MoveAbsoluteX) dx = xkbi->mouseKeysDX; if (xkbi->mouseKeysFlags & XkbSA_MoveAbsoluteY) dy = xkbi->mouseKeysDY; } else { dx = xkbi->mouseKeysDX; dy = xkbi->mouseKeysDY; } XkbFakePointerMotion(xkbi->device, xkbi->mouseKeysFlags, dx, dy); return xkbi->desc->ctrls->mk_interval; } static int _XkbFilterPointerMove(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { int x, y; Bool accel; if (filter->keycode == 0) { /* initial press */ filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->priv = 0; filter->filter = _XkbFilterPointerMove; filter->upAction = *pAction; xkbi->mouseKeysCounter = 0; xkbi->mouseKey = keycode; accel = ((pAction->ptr.flags & XkbSA_NoAcceleration) == 0); x = XkbPtrActionX(&pAction->ptr); y = XkbPtrActionY(&pAction->ptr); XkbFakePointerMotion(xkbi->device, pAction->ptr.flags, x, y); AccessXCancelRepeatKey(xkbi, keycode); xkbi->mouseKeysAccel = accel && (xkbi->desc->ctrls->enabled_ctrls & XkbMouseKeysAccelMask); xkbi->mouseKeysFlags = pAction->ptr.flags; xkbi->mouseKeysDX = XkbPtrActionX(&pAction->ptr); xkbi->mouseKeysDY = XkbPtrActionY(&pAction->ptr); xkbi->mouseKeyTimer = TimerSet(xkbi->mouseKeyTimer, 0, xkbi->desc->ctrls->mk_delay, _XkbPtrAccelExpire, (void *) xkbi); } else if (filter->keycode == keycode) { filter->active = 0; if (xkbi->mouseKey == keycode) { xkbi->mouseKey = 0; xkbi->mouseKeyTimer = TimerSet(xkbi->mouseKeyTimer, 0, 0, NULL, NULL); } } return 0; } static int _XkbFilterPointerBtn(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { if (filter->keycode == 0) { /* initial press */ int button = pAction->btn.button; if (button == XkbSA_UseDfltButton) button = xkbi->desc->ctrls->mk_dflt_btn; filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->priv = 0; filter->filter = _XkbFilterPointerBtn; filter->upAction = *pAction; filter->upAction.btn.button = button; switch (pAction->type) { case XkbSA_LockPtrBtn: if (((xkbi->lockedPtrButtons & (1 << button)) == 0) && ((pAction->btn.flags & XkbSA_LockNoLock) == 0)) { xkbi->lockedPtrButtons |= (1 << button); AccessXCancelRepeatKey(xkbi, keycode); XkbFakeDeviceButton(xkbi->device, 1, button); filter->upAction.type = XkbSA_NoAction; } break; case XkbSA_PtrBtn: { register int i, nClicks; AccessXCancelRepeatKey(xkbi, keycode); if (pAction->btn.count > 0) { nClicks = pAction->btn.count; for (i = 0; i < nClicks; i++) { XkbFakeDeviceButton(xkbi->device, 1, button); XkbFakeDeviceButton(xkbi->device, 0, button); } filter->upAction.type = XkbSA_NoAction; } else XkbFakeDeviceButton(xkbi->device, 1, button); } break; case XkbSA_SetPtrDflt: { XkbControlsPtr ctrls = xkbi->desc->ctrls; XkbControlsRec old; xkbControlsNotify cn; old = *ctrls; AccessXCancelRepeatKey(xkbi, keycode); switch (pAction->dflt.affect) { case XkbSA_AffectDfltBtn: if (pAction->dflt.flags & XkbSA_DfltBtnAbsolute) ctrls->mk_dflt_btn = XkbSAPtrDfltValue(&pAction->dflt); else { ctrls->mk_dflt_btn += XkbSAPtrDfltValue(&pAction->dflt); if (ctrls->mk_dflt_btn > 5) ctrls->mk_dflt_btn = 5; else if (ctrls->mk_dflt_btn < 1) ctrls->mk_dflt_btn = 1; } break; default: ErrorF ("Attempt to change unknown pointer default (%d) ignored\n", pAction->dflt.affect); break; } if (XkbComputeControlsNotify(xkbi->device, &old, xkbi->desc->ctrls, &cn, FALSE)) { cn.keycode = keycode; /* XXX: what about DeviceKeyPress? */ cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; XkbSendControlsNotify(xkbi->device, &cn); } } break; } } else if (filter->keycode == keycode) { int button = filter->upAction.btn.button; switch (filter->upAction.type) { case XkbSA_LockPtrBtn: if (((filter->upAction.btn.flags & XkbSA_LockNoUnlock) != 0) || ((xkbi->lockedPtrButtons & (1 << button)) == 0)) { break; } xkbi->lockedPtrButtons &= ~(1 << button); if (IsMaster(xkbi->device)) { XkbMergeLockedPtrBtns(xkbi->device); /* One SD still has lock set, don't post event */ if ((xkbi->lockedPtrButtons & (1 << button)) != 0) break; } /* fallthrough */ case XkbSA_PtrBtn: XkbFakeDeviceButton(xkbi->device, 0, button); break; } filter->active = 0; } return 0; } static int _XkbFilterControls(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { XkbControlsRec old; XkbControlsPtr ctrls; DeviceIntPtr kbd; unsigned int change; XkbEventCauseRec cause; kbd = xkbi->device; ctrls = xkbi->desc->ctrls; old = *ctrls; if (filter->keycode == 0) { /* initial press */ filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; change = XkbActionCtrls(&pAction->ctrls); filter->priv = change; filter->filter = _XkbFilterControls; filter->upAction = *pAction; if (pAction->type == XkbSA_LockControls) { filter->priv = (ctrls->enabled_ctrls & change); change &= ~ctrls->enabled_ctrls; } if (change) { xkbControlsNotify cn; XkbSrvLedInfoPtr sli; ctrls->enabled_ctrls |= change; if (XkbComputeControlsNotify(kbd, &old, ctrls, &cn, FALSE)) { cn.keycode = keycode; /* XXX: what about DeviceKeyPress? */ cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; XkbSendControlsNotify(kbd, &cn); } XkbSetCauseKey(&cause, keycode, KeyPress); /* If sticky keys were disabled, clear all locks and latches */ if ((old.enabled_ctrls & XkbStickyKeysMask) && (!(ctrls->enabled_ctrls & XkbStickyKeysMask))) { XkbClearAllLatchesAndLocks(kbd, xkbi, FALSE, &cause); } sli = XkbFindSrvLedInfo(kbd, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(kbd, sli->usesControls, TRUE, NULL, &cause); if (XkbAX_NeedFeedback(ctrls, XkbAX_FeatureFBMask)) XkbDDXAccessXBeep(kbd, _BEEP_FEATURE_ON, change); } } else if (filter->keycode == keycode) { change = filter->priv; if (change) { xkbControlsNotify cn; XkbSrvLedInfoPtr sli; ctrls->enabled_ctrls &= ~change; if (XkbComputeControlsNotify(kbd, &old, ctrls, &cn, FALSE)) { cn.keycode = keycode; cn.eventType = KeyRelease; cn.requestMajor = 0; cn.requestMinor = 0; XkbSendControlsNotify(kbd, &cn); } XkbSetCauseKey(&cause, keycode, KeyRelease); /* If sticky keys were disabled, clear all locks and latches */ if ((old.enabled_ctrls & XkbStickyKeysMask) && (!(ctrls->enabled_ctrls & XkbStickyKeysMask))) { XkbClearAllLatchesAndLocks(kbd, xkbi, FALSE, &cause); } sli = XkbFindSrvLedInfo(kbd, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(kbd, sli->usesControls, TRUE, NULL, &cause); if (XkbAX_NeedFeedback(ctrls, XkbAX_FeatureFBMask)) XkbDDXAccessXBeep(kbd, _BEEP_FEATURE_OFF, change); } filter->keycode = 0; filter->active = 0; } return 1; } static int _XkbFilterActionMessage(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { 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; if ((pMsg->flags & XkbSA_MessageOnRelease) || ((pMsg->flags & XkbSA_MessageGenKeyEvent) == 0)) { filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->priv = 0; filter->filter = _XkbFilterActionMessage; filter->upAction = *pAction; } if (pMsg->flags & XkbSA_MessageOnPress) { xkbActionMessage msg; msg.keycode = keycode; msg.press = 1; msg.keyEventFollows = ((pMsg->flags & XkbSA_MessageGenKeyEvent) != 0); memcpy((char *) msg.message, (char *) pMsg->message, XkbActionMessageLength); XkbSendActionMessage(kbd, &msg); } return ((pAction->msg.flags & XkbSA_MessageGenKeyEvent) != 0); } else if (filter->keycode == keycode) { pMsg = &filter->upAction.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); } 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; } } return 1; } static int _XkbFilterRedirectKey(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { DeviceEvent ev; int x, y; XkbStateRec old, old_prev; unsigned mods, mask; 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)); GetSpritePosition(xkbi->device, &x, &y); ev.header = ET_Internal; ev.length = sizeof(DeviceEvent); ev.time = GetTimeInMillis(); ev.root_x = x; ev.root_y = y; /* redirect actions do not work across devices, therefore the following is * correct: */ ev.deviceid = xkbi->device->id; /* filter->priv must be set up by the caller for the initial press. */ ev.sourceid = filter->priv; if (filter->keycode == 0) { /* initial press */ if ((pAction->redirect.new_key < xkbi->desc->min_key_code) || (pAction->redirect.new_key > xkbi->desc->max_key_code)) { return 1; } filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->filter = _XkbFilterRedirectKey; filter->upAction = *pAction; ev.type = ET_KeyPress; ev.detail.key = pAction->redirect.new_key; mask = XkbSARedirectVModsMask(&pAction->redirect); mods = XkbSARedirectVMods(&pAction->redirect); if (mask) XkbVirtualModsToReal(xkbi->desc, mask, &mask); if (mods) XkbVirtualModsToReal(xkbi->desc, mods, &mods); mask |= pAction->redirect.mods_mask; mods |= pAction->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; } 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; } return 0; } 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; } 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; } 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; } /* 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); } } static int _XkbFilterSwitchScreen(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { DeviceIntPtr dev = xkbi->device; if (dev == inputInfo.keyboard) return 0; if (filter->keycode == 0) { /* initial press */ filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->filter = _XkbFilterSwitchScreen; AccessXCancelRepeatKey(xkbi, keycode); XkbDDXSwitchScreen(dev, keycode, pAction); return 0; } else if (filter->keycode == keycode) { filter->active = 0; return 0; } return 1; } static int _XkbFilterXF86Private(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { DeviceIntPtr dev = xkbi->device; if (dev == inputInfo.keyboard) return 0; if (filter->keycode == 0) { /* initial press */ filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->filter = _XkbFilterXF86Private; XkbDDXPrivate(dev, keycode, pAction); return 0; } else if (filter->keycode == keycode) { filter->active = 0; return 0; } return 1; } static int _XkbFilterDeviceBtn(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { if (xkbi->device == inputInfo.keyboard) return 0; if (filter->keycode == 0) { /* initial press */ DeviceIntPtr dev; int button; _XkbLookupButtonDevice(&dev, pAction->devbtn.device, serverClient, DixUnknownAccess, &button); if (!dev || !dev->public.on) return 1; button = pAction->devbtn.button; if ((button < 1) || (button > dev->button->numButtons)) return 1; filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; filter->priv = 0; filter->filter = _XkbFilterDeviceBtn; filter->upAction = *pAction; switch (pAction->type) { case XkbSA_LockDeviceBtn: if ((pAction->devbtn.flags & XkbSA_LockNoLock) || BitIsOn(dev->button->down, button)) return 0; XkbFakeDeviceButton(dev, TRUE, button); filter->upAction.type = XkbSA_NoAction; break; case XkbSA_DeviceBtn: if (pAction->devbtn.count > 0) { int nClicks, i; nClicks = pAction->btn.count; for (i = 0; i < nClicks; i++) { XkbFakeDeviceButton(dev, TRUE, button); XkbFakeDeviceButton(dev, FALSE, button); } filter->upAction.type = XkbSA_NoAction; } else XkbFakeDeviceButton(dev, TRUE, button); break; } } else if (filter->keycode == keycode) { DeviceIntPtr dev; int button; filter->active = 0; _XkbLookupButtonDevice(&dev, filter->upAction.devbtn.device, serverClient, DixUnknownAccess, &button); if (!dev || !dev->public.on) return 1; button = filter->upAction.btn.button; switch (filter->upAction.type) { case XkbSA_LockDeviceBtn: if ((filter->upAction.devbtn.flags & XkbSA_LockNoUnlock) || !BitIsOn(dev->button->down, button)) return 0; XkbFakeDeviceButton(dev, FALSE, button); break; case XkbSA_DeviceBtn: XkbFakeDeviceButton(dev, FALSE, button); break; } filter->active = 0; } return 0; } static XkbFilterPtr _XkbNextFreeFilter(XkbSrvInfoPtr xkbi) { register int i; if (xkbi->szFilters == 0) { xkbi->szFilters = 4; xkbi->filters = calloc(xkbi->szFilters, sizeof(XkbFilterRec)); /* 6/21/93 (ef) -- XXX! deal with allocation failure */ } for (i = 0; i < xkbi->szFilters; i++) { if (!xkbi->filters[i].active) { xkbi->filters[i].keycode = 0; return &xkbi->filters[i]; } } xkbi->szFilters *= 2; xkbi->filters = realloc(xkbi->filters, xkbi->szFilters * sizeof(XkbFilterRec)); /* 6/21/93 (ef) -- XXX! deal with allocation failure */ memset(&xkbi->filters[xkbi->szFilters / 2], 0, (xkbi->szFilters / 2) * sizeof(XkbFilterRec)); return &xkbi->filters[xkbi->szFilters / 2]; } static int _XkbApplyFilters(XkbSrvInfoPtr xkbi, unsigned kc, XkbAction *pAction) { register int i, send; send = 1; for (i = 0; i < xkbi->szFilters; i++) { if ((xkbi->filters[i].active) && (xkbi->filters[i].filter)) send = ((*xkbi->filters[i].filter) (xkbi, &xkbi->filters[i], kc, pAction) && send); } return send; } static int _XkbEnsureStateChange(XkbSrvInfoPtr xkbi) { Bool genStateNotify = FALSE; /* The state may change, so if we're not in the middle of sending a state * notify, prepare for it */ if ((xkbi->flags & _XkbStateNotifyInProgress) == 0) { xkbi->prev_state = xkbi->state; xkbi->flags |= _XkbStateNotifyInProgress; genStateNotify = TRUE; } return genStateNotify; } static void _XkbApplyState(DeviceIntPtr dev, Bool genStateNotify, int evtype, int key) { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; int changed; XkbComputeDerivedState(xkbi); changed = XkbStateChangedFlags(&xkbi->prev_state, &xkbi->state); if (genStateNotify) { if (changed) { xkbStateNotify sn; sn.keycode = key; sn.eventType = evtype; sn.requestMajor = sn.requestMinor = 0; sn.changed = changed; XkbSendStateNotify(dev, &sn); } xkbi->flags &= ~_XkbStateNotifyInProgress; } changed = XkbIndicatorsToUpdate(dev, changed, FALSE); if (changed) { XkbEventCauseRec cause; XkbSetCauseKey(&cause, key, evtype); XkbUpdateIndicators(dev, changed, FALSE, NULL, &cause); } } void XkbPushLockedStateToSlaves(DeviceIntPtr master, int evtype, int key) { DeviceIntPtr dev; Bool genStateNotify; nt_list_for_each_entry(dev, inputInfo.devices, next) { if (!dev->key || GetMaster(dev, MASTER_KEYBOARD) != master) continue; genStateNotify = _XkbEnsureStateChange(dev->key->xkbInfo); dev->key->xkbInfo->state.locked_mods = master->key->xkbInfo->state.locked_mods; _XkbApplyState(dev, genStateNotify, evtype, key); } } void XkbHandleActions(DeviceIntPtr dev, DeviceIntPtr kbd, DeviceEvent *event) { int key, bit, i; XkbSrvInfoPtr xkbi; KeyClassPtr keyc; int sendEvent; Bool genStateNotify; XkbAction act; XkbFilterPtr filter; Bool keyEvent; Bool pressEvent; ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); keyc = kbd->key; xkbi = keyc->xkbInfo; key = event->detail.key; genStateNotify = _XkbEnsureStateChange(xkbi); xkbi->clearMods = xkbi->setMods = 0; xkbi->groupChange = 0; sendEvent = 1; keyEvent = ((event->type == ET_KeyPress) || (event->type == ET_KeyRelease)); pressEvent = ((event->type == ET_KeyPress) || (event->type == ET_ButtonPress)); if (pressEvent) { if (keyEvent) act = XkbGetKeyAction(xkbi, &xkbi->state, key); else { act = XkbGetButtonAction(kbd, dev, key); key |= BTN_ACT_FLAG; } sendEvent = _XkbApplyFilters(xkbi, key, &act); if (sendEvent) { switch (act.type) { case XkbSA_SetMods: case XkbSA_SetGroup: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterSetState(xkbi, filter, key, &act); break; case XkbSA_LatchMods: case XkbSA_LatchGroup: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterLatchState(xkbi, filter, key, &act); break; case XkbSA_LockMods: case XkbSA_LockGroup: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterLockState(xkbi, filter, key, &act); break; case XkbSA_ISOLock: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterISOLock(xkbi, filter, key, &act); break; case XkbSA_MovePtr: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterPointerMove(xkbi, filter, key, &act); break; case XkbSA_PtrBtn: case XkbSA_LockPtrBtn: case XkbSA_SetPtrDflt: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterPointerBtn(xkbi, filter, key, &act); break; case XkbSA_Terminate: sendEvent = XkbDDXTerminateServer(dev, key, &act); break; case XkbSA_SwitchScreen: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterSwitchScreen(xkbi, filter, key, &act); break; case XkbSA_SetControls: case XkbSA_LockControls: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterControls(xkbi, filter, key, &act); break; case XkbSA_ActionMessage: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterActionMessage(xkbi, filter, key, &act); break; case XkbSA_RedirectKey: filter = _XkbNextFreeFilter(xkbi); /* redirect actions must create a new DeviceEvent. The * source device id for this event cannot be obtained from * xkbi, so we pass it here explicitly. The field deviceid * equals to xkbi->device->id. */ filter->priv = event->sourceid; sendEvent = _XkbFilterRedirectKey(xkbi, filter, key, &act); break; case XkbSA_DeviceBtn: case XkbSA_LockDeviceBtn: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterDeviceBtn(xkbi, filter, key, &act); break; case XkbSA_XFree86Private: filter = _XkbNextFreeFilter(xkbi); sendEvent = _XkbFilterXF86Private(xkbi, filter, key, &act); break; } } } else { if (!keyEvent) key |= BTN_ACT_FLAG; sendEvent = _XkbApplyFilters(xkbi, key, NULL); } if (xkbi->groupChange != 0) xkbi->state.base_group += xkbi->groupChange; if (xkbi->setMods) { for (i = 0, bit = 1; xkbi->setMods; i++, bit <<= 1) { if (xkbi->setMods & bit) { keyc->modifierKeyCount[i]++; xkbi->state.base_mods |= bit; xkbi->setMods &= ~bit; } } } if (xkbi->clearMods) { for (i = 0, bit = 1; xkbi->clearMods; i++, bit <<= 1) { if (xkbi->clearMods & bit) { keyc->modifierKeyCount[i]--; if (keyc->modifierKeyCount[i] <= 0) { xkbi->state.base_mods &= ~bit; keyc->modifierKeyCount[i] = 0; } xkbi->clearMods &= ~bit; } } } if (sendEvent) { DeviceIntPtr tmpdev; if (keyEvent) tmpdev = dev; else tmpdev = GetMaster(dev, POINTER_OR_FLOAT); UNWRAP_PROCESS_INPUT_PROC(tmpdev, xkbPrivPtr, backupproc); dev->public.processInputProc((InternalEvent *) event, tmpdev); COND_WRAP_PROCESS_INPUT_PROC(tmpdev, xkbPrivPtr, backupproc, xkbUnwrapProc); } else if (keyEvent) { FixKeyState(event, dev); } _XkbApplyState(dev, genStateNotify, event->type, key); XkbPushLockedStateToSlaves(dev, event->type, key); } int XkbLatchModifiers(DeviceIntPtr pXDev, CARD8 mask, CARD8 latches) { XkbSrvInfoPtr xkbi; XkbFilterPtr filter; XkbAction act; unsigned clear; if (pXDev && pXDev->key && pXDev->key->xkbInfo) { xkbi = pXDev->key->xkbInfo; clear = (mask & (~latches)); xkbi->state.latched_mods &= ~clear; /* Clear any pending latch to locks. */ act.type = XkbSA_NoAction; _XkbApplyFilters(xkbi, SYNTHETIC_KEYCODE, &act); act.type = XkbSA_LatchMods; act.mods.flags = 0; act.mods.mask = mask & latches; filter = _XkbNextFreeFilter(xkbi); _XkbFilterLatchState(xkbi, filter, SYNTHETIC_KEYCODE, &act); _XkbFilterLatchState(xkbi, filter, SYNTHETIC_KEYCODE, (XkbAction *) NULL); return Success; } return BadValue; } int XkbLatchGroup(DeviceIntPtr pXDev, int group) { XkbSrvInfoPtr xkbi; XkbFilterPtr filter; XkbAction act; if (pXDev && pXDev->key && pXDev->key->xkbInfo) { xkbi = pXDev->key->xkbInfo; act.type = XkbSA_LatchGroup; act.group.flags = 0; XkbSASetGroup(&act.group, group); filter = _XkbNextFreeFilter(xkbi); _XkbFilterLatchState(xkbi, filter, SYNTHETIC_KEYCODE, &act); _XkbFilterLatchState(xkbi, filter, SYNTHETIC_KEYCODE, (XkbAction *) NULL); return Success; } return BadValue; } /***====================================================================***/ void XkbClearAllLatchesAndLocks(DeviceIntPtr dev, XkbSrvInfoPtr xkbi, Bool genEv, XkbEventCausePtr cause) { XkbStateRec os; xkbStateNotify sn; sn.changed = 0; os = xkbi->state; if (os.latched_mods) { /* clear all latches */ XkbLatchModifiers(dev, ~0, 0); sn.changed |= XkbModifierLatchMask; } if (os.latched_group) { XkbLatchGroup(dev, 0); sn.changed |= XkbGroupLatchMask; } if (os.locked_mods) { xkbi->state.locked_mods = 0; sn.changed |= XkbModifierLockMask; } if (os.locked_group) { xkbi->state.locked_group = 0; sn.changed |= XkbGroupLockMask; } if (genEv && sn.changed) { CARD32 changed; XkbComputeDerivedState(xkbi); sn.keycode = cause->kc; sn.eventType = cause->event; sn.requestMajor = cause->mjr; sn.requestMinor = cause->mnr; sn.changed = XkbStateChangedFlags(&os, &xkbi->state); XkbSendStateNotify(dev, &sn); changed = XkbIndicatorsToUpdate(dev, sn.changed, FALSE); if (changed) { XkbUpdateIndicators(dev, changed, TRUE, NULL, cause); } } return; } /* * The event is injected into the event processing, not the EQ. Thus, * ensure that we restore the master after the event sequence to the * original set of classes. Otherwise, the master remains on the XTEST * classes and drops events that don't fit into the XTEST layout (e.g. * events with more than 2 valuators). * * FIXME: EQ injection in the processing stage is not designed for, so this * is a rather awkward hack. The event list returned by GetPointerEvents() * and friends is always prefixed with a DCE if the last _posted_ device was * different. For normal events, this sequence then resets the master during * the processing stage. Since we inject the PointerKey events in the * processing stage though, we need to manually reset to restore the * previous order, because the events already in the EQ must be sent for the * right device. * So we post-fix the event list we get from GPE with a DCE back to the * previous slave device. * * First one on drinking island wins! */ static void InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, ValuatorMask *mask) { ScreenPtr pScreen; InternalEvent *events; int nevents, i; DeviceIntPtr ptr, mpointer, lastSlave = NULL; Bool saveWait; if (IsMaster(dev)) { mpointer = GetMaster(dev, MASTER_POINTER); lastSlave = mpointer->lastSlave; ptr = GetXTestDevice(mpointer); } else if (IsFloating(dev)) ptr = dev; else return; events = InitEventList(GetMaximumEventsNum() + 1); OsBlockSignals(); pScreen = miPointerGetScreen(ptr); saveWait = miPointerSetWaitForUpdate(pScreen, FALSE); nevents = GetPointerEvents(events, ptr, type, button, flags, mask); if (IsMaster(dev) && (lastSlave && lastSlave != ptr)) UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT, &nevents); miPointerSetWaitForUpdate(pScreen, saveWait); OsReleaseSignals(); for (i = 0; i < nevents; i++) mieqProcessDeviceEvent(ptr, &events[i], NULL); FreeEventList(events, GetMaximumEventsNum()); } static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y) { ValuatorMask mask; int gpe_flags = 0; /* ignore attached SDs */ if (!IsMaster(dev) && !IsFloating(dev)) return; if (flags & XkbSA_MoveAbsoluteX || flags & XkbSA_MoveAbsoluteY) gpe_flags = POINTER_ABSOLUTE; else gpe_flags = POINTER_RELATIVE; valuator_mask_set_range(&mask, 0, 2, (int[]) { x, y}); InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, &mask); } void XkbFakeDeviceButton(DeviceIntPtr dev, Bool press, int button) { DeviceIntPtr ptr; int down; /* If dev is a slave device, and the SD is attached, do nothing. If we'd * post through the attached master pointer we'd get duplicate events. * * if dev is a master keyboard, post through the XTEST device * * if dev is a floating slave, post through the device itself. */ if (IsMaster(dev)) { DeviceIntPtr mpointer = GetMaster(dev, MASTER_POINTER); ptr = GetXTestDevice(mpointer); } else if (IsFloating(dev)) ptr = dev; else return; down = button_is_down(ptr, button, BUTTON_PROCESSED); if (press == down) return; InjectPointerKeyEvents(dev, press ? ButtonPress : ButtonRelease, button, 0, NULL); } xorg-server-1.17.1/xkb/XKBGAlloc.c0000664000175100017510000006370612456571574013503 00000000000000/************************************************************ Copyright (c) 1993 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 "misc.h" #include "inputstr.h" #include #include "xkbgeom.h" /***====================================================================***/ static void _XkbFreeGeomLeafElems(Bool freeAll, int first, int count, unsigned short *num_inout, unsigned short *sz_inout, char **elems, unsigned int elem_sz) { if ((freeAll) || (*elems == NULL)) { *num_inout = *sz_inout = 0; free(*elems); *elems = NULL; return; } if ((first >= (*num_inout)) || (first < 0) || (count < 1)) return; if (first + count >= (*num_inout)) { /* truncating the array is easy */ (*num_inout) = first; } else { char *ptr; int extra; ptr = *elems; extra = ((*num_inout) - (first + count)) * elem_sz; if (extra > 0) memmove(&ptr[first * elem_sz], &ptr[(first + count) * elem_sz], extra); (*num_inout) -= count; } return; } typedef void (*ContentsClearFunc) (char * /* priv */ ); static void _XkbFreeGeomNonLeafElems(Bool freeAll, int first, int count, unsigned short *num_inout, unsigned short *sz_inout, char **elems, unsigned int elem_sz, ContentsClearFunc freeFunc) { register int i; register char *ptr; if (freeAll) { first = 0; count = (*num_inout); } else if ((first >= (*num_inout)) || (first < 0) || (count < 1)) return; else if (first + count > (*num_inout)) count = (*num_inout) - first; if (*elems == NULL) return; if (freeFunc) { ptr = *elems; ptr += first * elem_sz; for (i = 0; i < count; i++) { (*freeFunc) (ptr); ptr += elem_sz; } } if (freeAll) { (*num_inout) = (*sz_inout) = 0; free(*elems); *elems = NULL; } else if (first + count >= (*num_inout)) *num_inout = first; else { i = ((*num_inout) - (first + count)) * elem_sz; ptr = *elems; memmove(&ptr[first * elem_sz], &ptr[(first + count) * elem_sz], i); (*num_inout) -= count; } return; } /***====================================================================***/ static void _XkbClearProperty(char *prop_in) { XkbPropertyPtr prop = (XkbPropertyPtr) prop_in; free(prop->name); prop->name = NULL; free(prop->value); prop->value = NULL; return; } void XkbFreeGeomProperties(XkbGeometryPtr geom, int first, int count, Bool freeAll) { _XkbFreeGeomNonLeafElems(freeAll, first, count, &geom->num_properties, &geom->sz_properties, (char **) &geom->properties, sizeof(XkbPropertyRec), _XkbClearProperty); return; } /***====================================================================***/ void XkbFreeGeomKeyAliases(XkbGeometryPtr geom, int first, int count, Bool freeAll) { _XkbFreeGeomLeafElems(freeAll, first, count, &geom->num_key_aliases, &geom->sz_key_aliases, (char **) &geom->key_aliases, sizeof(XkbKeyAliasRec)); return; } /***====================================================================***/ static void _XkbClearColor(char *color_in) { XkbColorPtr color = (XkbColorPtr) color_in; free(color->spec); return; } void XkbFreeGeomColors(XkbGeometryPtr geom, int first, int count, Bool freeAll) { _XkbFreeGeomNonLeafElems(freeAll, first, count, &geom->num_colors, &geom->sz_colors, (char **) &geom->colors, sizeof(XkbColorRec), _XkbClearColor); return; } /***====================================================================***/ void XkbFreeGeomPoints(XkbOutlinePtr outline, int first, int count, Bool freeAll) { _XkbFreeGeomLeafElems(freeAll, first, count, &outline->num_points, &outline->sz_points, (char **) &outline->points, sizeof(XkbPointRec)); return; } /***====================================================================***/ static void _XkbClearOutline(char *outline_in) { XkbOutlinePtr outline = (XkbOutlinePtr) outline_in; if (outline->points != NULL) XkbFreeGeomPoints(outline, 0, outline->num_points, TRUE); return; } void XkbFreeGeomOutlines(XkbShapePtr shape, int first, int count, Bool freeAll) { _XkbFreeGeomNonLeafElems(freeAll, first, count, &shape->num_outlines, &shape->sz_outlines, (char **) &shape->outlines, sizeof(XkbOutlineRec), _XkbClearOutline); return; } /***====================================================================***/ static void _XkbClearShape(char *shape_in) { XkbShapePtr shape = (XkbShapePtr) shape_in; if (shape->outlines) XkbFreeGeomOutlines(shape, 0, shape->num_outlines, TRUE); return; } void XkbFreeGeomShapes(XkbGeometryPtr geom, int first, int count, Bool freeAll) { _XkbFreeGeomNonLeafElems(freeAll, first, count, &geom->num_shapes, &geom->sz_shapes, (char **) &geom->shapes, sizeof(XkbShapeRec), _XkbClearShape); return; } /***====================================================================***/ void XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count, Bool freeAll) { _XkbFreeGeomLeafElems(freeAll, first, count, &row->num_keys, &row->sz_keys, (char **) &row->keys, sizeof(XkbOverlayKeyRec)); return; } /***====================================================================***/ void XkbFreeGeomKeys(XkbRowPtr row, int first, int count, Bool freeAll) { _XkbFreeGeomLeafElems(freeAll, first, count, &row->num_keys, &row->sz_keys, (char **) &row->keys, sizeof(XkbKeyRec)); return; } /***====================================================================***/ static void _XkbClearRow(char *row_in) { XkbRowPtr row = (XkbRowPtr) row_in; if (row->keys != NULL) XkbFreeGeomKeys(row, 0, row->num_keys, TRUE); return; } void XkbFreeGeomRows(XkbSectionPtr section, int first, int count, Bool freeAll) { _XkbFreeGeomNonLeafElems(freeAll, first, count, §ion->num_rows, §ion->sz_rows, (char **) §ion->rows, sizeof(XkbRowRec), _XkbClearRow); } /***====================================================================***/ static void _XkbClearSection(char *section_in) { XkbSectionPtr section = (XkbSectionPtr) section_in; if (section->rows != NULL) XkbFreeGeomRows(section, 0, section->num_rows, TRUE); if (section->doodads != NULL) { XkbFreeGeomDoodads(section->doodads, section->num_doodads, TRUE); section->doodads = NULL; } return; } void XkbFreeGeomSections(XkbGeometryPtr geom, int first, int count, Bool freeAll) { _XkbFreeGeomNonLeafElems(freeAll, first, count, &geom->num_sections, &geom->sz_sections, (char **) &geom->sections, sizeof(XkbSectionRec), _XkbClearSection); return; } /***====================================================================***/ static void _XkbClearDoodad(char *doodad_in) { XkbDoodadPtr doodad = (XkbDoodadPtr) doodad_in; switch (doodad->any.type) { case XkbTextDoodad: { free(doodad->text.text); doodad->text.text = NULL; free(doodad->text.font); doodad->text.font = NULL; } break; case XkbLogoDoodad: { free(doodad->logo.logo_name); doodad->logo.logo_name = NULL; } break; } return; } void XkbFreeGeomDoodads(XkbDoodadPtr doodads, int nDoodads, Bool freeAll) { register int i; register XkbDoodadPtr doodad; if (doodads) { for (i = 0, doodad = doodads; i < nDoodads; i++, doodad++) { _XkbClearDoodad((char *) doodad); } if (freeAll) free(doodads); } return; } void XkbFreeGeometry(XkbGeometryPtr geom, unsigned which, Bool freeMap) { if (geom == NULL) return; if (freeMap) which = XkbGeomAllMask; if ((which & XkbGeomPropertiesMask) && (geom->properties != NULL)) XkbFreeGeomProperties(geom, 0, geom->num_properties, TRUE); if ((which & XkbGeomColorsMask) && (geom->colors != NULL)) XkbFreeGeomColors(geom, 0, geom->num_colors, TRUE); if ((which & XkbGeomShapesMask) && (geom->shapes != NULL)) XkbFreeGeomShapes(geom, 0, geom->num_shapes, TRUE); if ((which & XkbGeomSectionsMask) && (geom->sections != NULL)) XkbFreeGeomSections(geom, 0, geom->num_sections, TRUE); if ((which & XkbGeomDoodadsMask) && (geom->doodads != NULL)) { XkbFreeGeomDoodads(geom->doodads, geom->num_doodads, TRUE); geom->doodads = NULL; geom->num_doodads = geom->sz_doodads = 0; } if ((which & XkbGeomKeyAliasesMask) && (geom->key_aliases != NULL)) XkbFreeGeomKeyAliases(geom, 0, geom->num_key_aliases, TRUE); if (freeMap) { free(geom->label_font); geom->label_font = NULL; free(geom); } return; } /***====================================================================***/ /** * Resize and clear an XKB geometry item array. The array size may * grow or shrink unlike in _XkbGeomAlloc. * * @param buffer[in,out] buffer to reallocate and clear * @param szItems[in] currently allocated item count for "buffer" * @param nrItems[in] required item count for "buffer" * @param itemSize[in] size of a single item in "buffer" * @param clearance[in] items to clear after reallocation * * @see _XkbGeomAlloc * * @return TRUE if reallocation succeeded. Otherwise FALSE is returned * and contents of "buffer" aren't touched. */ Bool XkbGeomRealloc(void **buffer, int szItems, int nrItems, int itemSize, XkbGeomClearance clearance) { void *items; int clearBegin; /* Check validity of arguments. */ if (!buffer) return FALSE; items = *buffer; if (!((items && (szItems > 0)) || (!items && !szItems))) return FALSE; /* Check if there is need to resize. */ if (nrItems != szItems) if (!(items = realloc(items, nrItems * itemSize))) return FALSE; /* Clear specified items to zero. */ switch (clearance) { case XKB_GEOM_CLEAR_EXCESS: clearBegin = szItems; break; case XKB_GEOM_CLEAR_ALL: clearBegin = 0; break; case XKB_GEOM_CLEAR_NONE: default: clearBegin = nrItems; break; } if (items && (clearBegin < nrItems)) memset((char *) items + (clearBegin * itemSize), 0, (nrItems - clearBegin) * itemSize); *buffer = items; return TRUE; } static Status _XkbGeomAlloc(void **old, unsigned short *num, unsigned short *total, int num_new, size_t sz_elem) { if (num_new < 1) return Success; if ((*old) == NULL) *num = *total = 0; if ((*num) + num_new <= (*total)) return Success; *total = (*num) + num_new; if (!XkbGeomRealloc(old, *num, *total, sz_elem, XKB_GEOM_CLEAR_EXCESS)) { free(*old); (*old) = NULL; *total = *num = 0; return BadAlloc; } return Success; } #define _XkbAllocProps(g,n) _XkbGeomAlloc((void *)&(g)->properties,\ &(g)->num_properties,&(g)->sz_properties,\ (n),sizeof(XkbPropertyRec)) #define _XkbAllocColors(g,n) _XkbGeomAlloc((void *)&(g)->colors,\ &(g)->num_colors,&(g)->sz_colors,\ (n),sizeof(XkbColorRec)) #define _XkbAllocShapes(g,n) _XkbGeomAlloc((void *)&(g)->shapes,\ &(g)->num_shapes,&(g)->sz_shapes,\ (n),sizeof(XkbShapeRec)) #define _XkbAllocSections(g,n) _XkbGeomAlloc((void *)&(g)->sections,\ &(g)->num_sections,&(g)->sz_sections,\ (n),sizeof(XkbSectionRec)) #define _XkbAllocDoodads(g,n) _XkbGeomAlloc((void *)&(g)->doodads,\ &(g)->num_doodads,&(g)->sz_doodads,\ (n),sizeof(XkbDoodadRec)) #define _XkbAllocKeyAliases(g,n) _XkbGeomAlloc((void *)&(g)->key_aliases,\ &(g)->num_key_aliases,&(g)->sz_key_aliases,\ (n),sizeof(XkbKeyAliasRec)) #define _XkbAllocOutlines(s,n) _XkbGeomAlloc((void *)&(s)->outlines,\ &(s)->num_outlines,&(s)->sz_outlines,\ (n),sizeof(XkbOutlineRec)) #define _XkbAllocRows(s,n) _XkbGeomAlloc((void *)&(s)->rows,\ &(s)->num_rows,&(s)->sz_rows,\ (n),sizeof(XkbRowRec)) #define _XkbAllocPoints(o,n) _XkbGeomAlloc((void *)&(o)->points,\ &(o)->num_points,&(o)->sz_points,\ (n),sizeof(XkbPointRec)) #define _XkbAllocKeys(r,n) _XkbGeomAlloc((void *)&(r)->keys,\ &(r)->num_keys,&(r)->sz_keys,\ (n),sizeof(XkbKeyRec)) #define _XkbAllocOverlays(s,n) _XkbGeomAlloc((void *)&(s)->overlays,\ &(s)->num_overlays,&(s)->sz_overlays,\ (n),sizeof(XkbOverlayRec)) #define _XkbAllocOverlayRows(o,n) _XkbGeomAlloc((void *)&(o)->rows,\ &(o)->num_rows,&(o)->sz_rows,\ (n),sizeof(XkbOverlayRowRec)) #define _XkbAllocOverlayKeys(r,n) _XkbGeomAlloc((void *)&(r)->keys,\ &(r)->num_keys,&(r)->sz_keys,\ (n),sizeof(XkbOverlayKeyRec)) Status XkbAllocGeometry(XkbDescPtr xkb, XkbGeometrySizesPtr sizes) { XkbGeometryPtr geom; Status rtrn; if (xkb->geom == NULL) { xkb->geom = calloc(1, sizeof(XkbGeometryRec)); if (!xkb->geom) return BadAlloc; } geom = xkb->geom; if ((sizes->which & XkbGeomPropertiesMask) && ((rtrn = _XkbAllocProps(geom, sizes->num_properties)) != Success)) { goto BAIL; } if ((sizes->which & XkbGeomColorsMask) && ((rtrn = _XkbAllocColors(geom, sizes->num_colors)) != Success)) { goto BAIL; } if ((sizes->which & XkbGeomShapesMask) && ((rtrn = _XkbAllocShapes(geom, sizes->num_shapes)) != Success)) { goto BAIL; } if ((sizes->which & XkbGeomSectionsMask) && ((rtrn = _XkbAllocSections(geom, sizes->num_sections)) != Success)) { goto BAIL; } if ((sizes->which & XkbGeomDoodadsMask) && ((rtrn = _XkbAllocDoodads(geom, sizes->num_doodads)) != Success)) { goto BAIL; } if ((sizes->which & XkbGeomKeyAliasesMask) && ((rtrn = _XkbAllocKeyAliases(geom, sizes->num_key_aliases)) != Success)) { goto BAIL; } return Success; BAIL: XkbFreeGeometry(geom, XkbGeomAllMask, TRUE); xkb->geom = NULL; return rtrn; } /***====================================================================***/ XkbPropertyPtr XkbAddGeomProperty(XkbGeometryPtr geom, char *name, char *value) { register int i; register XkbPropertyPtr prop; if ((!geom) || (!name) || (!value)) return NULL; for (i = 0, prop = geom->properties; i < geom->num_properties; i++, prop++) { if ((prop->name) && (strcmp(name, prop->name) == 0)) { free(prop->value); prop->value = strdup(value); return prop; } } if ((geom->num_properties >= geom->sz_properties) && (_XkbAllocProps(geom, 1) != Success)) { return NULL; } prop = &geom->properties[geom->num_properties]; prop->name = strdup(name); if (!prop->name) return NULL; prop->value = strdup(value); if (!prop->value) { free(prop->name); prop->name = NULL; return NULL; } geom->num_properties++; return prop; } XkbKeyAliasPtr XkbAddGeomKeyAlias(XkbGeometryPtr geom, char *aliasStr, char *realStr) { register int i; register XkbKeyAliasPtr alias; if ((!geom) || (!aliasStr) || (!realStr) || (!aliasStr[0]) || (!realStr[0])) return NULL; for (i = 0, alias = geom->key_aliases; i < geom->num_key_aliases; i++, alias++) { if (strncmp(alias->alias, aliasStr, XkbKeyNameLength) == 0) { memset(alias->real, 0, XkbKeyNameLength); strncpy(alias->real, realStr, XkbKeyNameLength); return alias; } } if ((geom->num_key_aliases >= geom->sz_key_aliases) && (_XkbAllocKeyAliases(geom, 1) != Success)) { return NULL; } alias = &geom->key_aliases[geom->num_key_aliases]; memset(alias, 0, sizeof(XkbKeyAliasRec)); strncpy(alias->alias, aliasStr, XkbKeyNameLength); strncpy(alias->real, realStr, XkbKeyNameLength); geom->num_key_aliases++; return alias; } XkbColorPtr XkbAddGeomColor(XkbGeometryPtr geom, char *spec, unsigned int pixel) { register int i; register XkbColorPtr color; if ((!geom) || (!spec)) return NULL; for (i = 0, color = geom->colors; i < geom->num_colors; i++, color++) { if ((color->spec) && (strcmp(color->spec, spec) == 0)) { color->pixel = pixel; return color; } } if ((geom->num_colors >= geom->sz_colors) && (_XkbAllocColors(geom, 1) != Success)) { return NULL; } color = &geom->colors[geom->num_colors]; color->pixel = pixel; color->spec = strdup(spec); if (!color->spec) return NULL; geom->num_colors++; return color; } XkbOutlinePtr XkbAddGeomOutline(XkbShapePtr shape, int sz_points) { XkbOutlinePtr outline; if ((!shape) || (sz_points < 0)) return NULL; if ((shape->num_outlines >= shape->sz_outlines) && (_XkbAllocOutlines(shape, 1) != Success)) { return NULL; } outline = &shape->outlines[shape->num_outlines]; memset(outline, 0, sizeof(XkbOutlineRec)); if ((sz_points > 0) && (_XkbAllocPoints(outline, sz_points) != Success)) return NULL; shape->num_outlines++; return outline; } XkbShapePtr XkbAddGeomShape(XkbGeometryPtr geom, Atom name, int sz_outlines) { XkbShapePtr shape; register int i; if ((!geom) || (!name) || (sz_outlines < 0)) return NULL; if (geom->num_shapes > 0) { for (shape = geom->shapes, i = 0; i < geom->num_shapes; i++, shape++) { if (name == shape->name) return shape; } } if ((geom->num_shapes >= geom->sz_shapes) && (_XkbAllocShapes(geom, 1) != Success)) return NULL; shape = &geom->shapes[geom->num_shapes]; memset(shape, 0, sizeof(XkbShapeRec)); if ((sz_outlines > 0) && (_XkbAllocOutlines(shape, sz_outlines) != Success)) return NULL; shape->name = name; shape->primary = shape->approx = NULL; geom->num_shapes++; return shape; } XkbKeyPtr XkbAddGeomKey(XkbRowPtr row) { XkbKeyPtr key; if (!row) return NULL; if ((row->num_keys >= row->sz_keys) && (_XkbAllocKeys(row, 1) != Success)) return NULL; key = &row->keys[row->num_keys++]; memset(key, 0, sizeof(XkbKeyRec)); return key; } XkbRowPtr XkbAddGeomRow(XkbSectionPtr section, int sz_keys) { XkbRowPtr row; if ((!section) || (sz_keys < 0)) return NULL; if ((section->num_rows >= section->sz_rows) && (_XkbAllocRows(section, 1) != Success)) return NULL; row = §ion->rows[section->num_rows]; memset(row, 0, sizeof(XkbRowRec)); if ((sz_keys > 0) && (_XkbAllocKeys(row, sz_keys) != Success)) return NULL; section->num_rows++; return row; } XkbSectionPtr XkbAddGeomSection(XkbGeometryPtr geom, Atom name, int sz_rows, int sz_doodads, int sz_over) { register int i; XkbSectionPtr section; if ((!geom) || (name == None) || (sz_rows < 0)) return NULL; for (i = 0, section = geom->sections; i < geom->num_sections; i++, section++) { if (section->name != name) continue; if (((sz_rows > 0) && (_XkbAllocRows(section, sz_rows) != Success)) || ((sz_doodads > 0) && (_XkbAllocDoodads(section, sz_doodads) != Success)) || ((sz_over > 0) && (_XkbAllocOverlays(section, sz_over) != Success))) return NULL; return section; } if ((geom->num_sections >= geom->sz_sections) && (_XkbAllocSections(geom, 1) != Success)) return NULL; section = &geom->sections[geom->num_sections]; if ((sz_rows > 0) && (_XkbAllocRows(section, sz_rows) != Success)) return NULL; if ((sz_doodads > 0) && (_XkbAllocDoodads(section, sz_doodads) != Success)) { if (section->rows) { free(section->rows); section->rows = NULL; section->sz_rows = section->num_rows = 0; } return NULL; } section->name = name; geom->num_sections++; return section; } XkbDoodadPtr XkbAddGeomDoodad(XkbGeometryPtr geom, XkbSectionPtr section, Atom name) { XkbDoodadPtr old, doodad; register int i, nDoodads; if ((!geom) || (name == None)) return NULL; if ((section != NULL) && (section->num_doodads > 0)) { old = section->doodads; nDoodads = section->num_doodads; } else { old = geom->doodads; nDoodads = geom->num_doodads; } for (i = 0, doodad = old; i < nDoodads; i++, doodad++) { if (doodad->any.name == name) return doodad; } if (section) { if ((section->num_doodads >= geom->sz_doodads) && (_XkbAllocDoodads(section, 1) != Success)) { return NULL; } doodad = §ion->doodads[section->num_doodads++]; } else { if ((geom->num_doodads >= geom->sz_doodads) && (_XkbAllocDoodads(geom, 1) != Success)) return NULL; doodad = &geom->doodads[geom->num_doodads++]; } memset(doodad, 0, sizeof(XkbDoodadRec)); doodad->any.name = name; return doodad; } XkbOverlayKeyPtr XkbAddGeomOverlayKey(XkbOverlayPtr overlay, XkbOverlayRowPtr row, char *over, char *under) { register int i; XkbOverlayKeyPtr key; XkbSectionPtr section; XkbRowPtr row_under; Bool found; if ((!overlay) || (!row) || (!over) || (!under)) return NULL; section = overlay->section_under; if (row->row_under >= section->num_rows) return NULL; row_under = §ion->rows[row->row_under]; for (i = 0, found = FALSE; i < row_under->num_keys; i++) { if (strncmp(under, row_under->keys[i].name.name, XkbKeyNameLength) == 0) { found = TRUE; break; } } if (!found) return NULL; if ((row->num_keys >= row->sz_keys) && (_XkbAllocOverlayKeys(row, 1) != Success)) return NULL; key = &row->keys[row->num_keys]; strncpy(key->under.name, under, XkbKeyNameLength); strncpy(key->over.name, over, XkbKeyNameLength); row->num_keys++; return key; } XkbOverlayRowPtr XkbAddGeomOverlayRow(XkbOverlayPtr overlay, int row_under, int sz_keys) { register int i; XkbOverlayRowPtr row; if ((!overlay) || (sz_keys < 0)) return NULL; if (row_under >= overlay->section_under->num_rows) return NULL; for (i = 0; i < overlay->num_rows; i++) { if (overlay->rows[i].row_under == row_under) { row = &overlay->rows[i]; if ((row->sz_keys < sz_keys) && (_XkbAllocOverlayKeys(row, sz_keys) != Success)) { return NULL; } return &overlay->rows[i]; } } if ((overlay->num_rows >= overlay->sz_rows) && (_XkbAllocOverlayRows(overlay, 1) != Success)) return NULL; row = &overlay->rows[overlay->num_rows]; memset(row, 0, sizeof(XkbOverlayRowRec)); if ((sz_keys > 0) && (_XkbAllocOverlayKeys(row, sz_keys) != Success)) return NULL; row->row_under = row_under; overlay->num_rows++; return row; } XkbOverlayPtr XkbAddGeomOverlay(XkbSectionPtr section, Atom name, int sz_rows) { register int i; XkbOverlayPtr overlay; if ((!section) || (name == None) || (sz_rows == 0)) return NULL; for (i = 0, overlay = section->overlays; i < section->num_overlays; i++, overlay++) { if (overlay->name == name) { if ((sz_rows > 0) && (_XkbAllocOverlayRows(overlay, sz_rows) != Success)) return NULL; return overlay; } } if ((section->num_overlays >= section->sz_overlays) && (_XkbAllocOverlays(section, 1) != Success)) return NULL; overlay = §ion->overlays[section->num_overlays]; if ((sz_rows > 0) && (_XkbAllocOverlayRows(overlay, sz_rows) != Success)) return NULL; overlay->name = name; overlay->section_under = section; section->num_overlays++; return overlay; } xorg-server-1.17.1/xkb/xkbSwap.c0000664000175100017510000003363312456571574013410 00000000000000/************************************************************ Copyright (c) 1993 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 "stdio.h" #include #include #include "misc.h" #include "inputstr.h" #include #include "xkbstr.h" #include "extnsionst.h" #include "xkb.h" /* * REQUEST SWAPPING */ static int SProcXkbUseExtension(ClientPtr client) { REQUEST(xkbUseExtensionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbUseExtensionReq); swaps(&stuff->wantedMajor); swaps(&stuff->wantedMinor); return ProcXkbUseExtension(client); } static int SProcXkbSelectEvents(ClientPtr client) { REQUEST(xkbSelectEventsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq); swaps(&stuff->deviceSpec); swaps(&stuff->affectWhich); swaps(&stuff->clear); swaps(&stuff->selectAll); swaps(&stuff->affectMap); swaps(&stuff->map); if ((stuff->affectWhich & (~XkbMapNotifyMask)) != 0) { union { BOOL *b; CARD8 *c8; CARD16 *c16; CARD32 *c32; } from; register unsigned bit, ndx, maskLeft, dataLeft, size; from.c8 = (CARD8 *) &stuff[1]; dataLeft = (stuff->length * 4) - SIZEOF(xkbSelectEventsReq); maskLeft = (stuff->affectWhich & (~XkbMapNotifyMask)); for (ndx = 0, bit = 1; (maskLeft != 0); ndx++, bit <<= 1) { if (((bit & maskLeft) == 0) || (ndx == XkbMapNotify)) continue; maskLeft &= ~bit; if ((stuff->selectAll & bit) || (stuff->clear & bit)) continue; switch (ndx) { case XkbNewKeyboardNotify: case XkbStateNotify: case XkbNamesNotify: case XkbAccessXNotify: case XkbExtensionDeviceNotify: size = 2; break; case XkbControlsNotify: case XkbIndicatorStateNotify: case XkbIndicatorMapNotify: size = 4; break; case XkbBellNotify: case XkbActionMessage: case XkbCompatMapNotify: size = 1; break; default: client->errorValue = _XkbErrCode2(0x1, bit); return BadValue; } if (dataLeft < (size * 2)) return BadLength; if (size == 2) { swaps(&from.c16[0]); swaps(&from.c16[1]); } else if (size == 4) { swapl(&from.c32[0]); swapl(&from.c32[1]); } else { size = 2; } from.c8 += (size * 2); dataLeft -= (size * 2); } if (dataLeft > 2) { ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n", dataLeft); return BadLength; } } return ProcXkbSelectEvents(client); } static int SProcXkbBell(ClientPtr client) { REQUEST(xkbBellReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbBellReq); swaps(&stuff->deviceSpec); swaps(&stuff->bellClass); swaps(&stuff->bellID); swapl(&stuff->name); swapl(&stuff->window); swaps(&stuff->pitch); swaps(&stuff->duration); return ProcXkbBell(client); } static int SProcXkbGetState(ClientPtr client) { REQUEST(xkbGetStateReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetStateReq); swaps(&stuff->deviceSpec); return ProcXkbGetState(client); } static int SProcXkbLatchLockState(ClientPtr client) { REQUEST(xkbLatchLockStateReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbLatchLockStateReq); swaps(&stuff->deviceSpec); swaps(&stuff->groupLatch); return ProcXkbLatchLockState(client); } static int SProcXkbGetControls(ClientPtr client) { REQUEST(xkbGetControlsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetControlsReq); swaps(&stuff->deviceSpec); return ProcXkbGetControls(client); } static int SProcXkbSetControls(ClientPtr client) { REQUEST(xkbSetControlsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbSetControlsReq); swaps(&stuff->deviceSpec); swaps(&stuff->affectInternalVMods); swaps(&stuff->internalVMods); swaps(&stuff->affectIgnoreLockVMods); swaps(&stuff->ignoreLockVMods); swaps(&stuff->axOptions); swapl(&stuff->affectEnabledCtrls); swapl(&stuff->enabledCtrls); swapl(&stuff->changeCtrls); swaps(&stuff->repeatDelay); swaps(&stuff->repeatInterval); swaps(&stuff->slowKeysDelay); swaps(&stuff->debounceDelay); swaps(&stuff->mkDelay); swaps(&stuff->mkInterval); swaps(&stuff->mkTimeToMax); swaps(&stuff->mkMaxSpeed); swaps(&stuff->mkCurve); swaps(&stuff->axTimeout); swapl(&stuff->axtCtrlsMask); swapl(&stuff->axtCtrlsValues); swaps(&stuff->axtOptsMask); swaps(&stuff->axtOptsValues); return ProcXkbSetControls(client); } static int SProcXkbGetMap(ClientPtr client) { REQUEST(xkbGetMapReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetMapReq); swaps(&stuff->deviceSpec); swaps(&stuff->full); swaps(&stuff->partial); swaps(&stuff->virtualMods); return ProcXkbGetMap(client); } static int SProcXkbSetMap(ClientPtr client) { REQUEST(xkbSetMapReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetMapReq); swaps(&stuff->deviceSpec); swaps(&stuff->present); swaps(&stuff->flags); swaps(&stuff->totalSyms); swaps(&stuff->totalActs); swaps(&stuff->virtualMods); return ProcXkbSetMap(client); } static int SProcXkbGetCompatMap(ClientPtr client) { REQUEST(xkbGetCompatMapReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetCompatMapReq); swaps(&stuff->deviceSpec); swaps(&stuff->firstSI); swaps(&stuff->nSI); return ProcXkbGetCompatMap(client); } static int SProcXkbSetCompatMap(ClientPtr client) { REQUEST(xkbSetCompatMapReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq); swaps(&stuff->deviceSpec); swaps(&stuff->firstSI); swaps(&stuff->nSI); return ProcXkbSetCompatMap(client); } static int SProcXkbGetIndicatorState(ClientPtr client) { REQUEST(xkbGetIndicatorStateReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); swaps(&stuff->deviceSpec); return ProcXkbGetIndicatorState(client); } static int SProcXkbGetIndicatorMap(ClientPtr client) { REQUEST(xkbGetIndicatorMapReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq); swaps(&stuff->deviceSpec); swapl(&stuff->which); return ProcXkbGetIndicatorMap(client); } static int SProcXkbSetIndicatorMap(ClientPtr client) { REQUEST(xkbSetIndicatorMapReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq); swaps(&stuff->deviceSpec); swapl(&stuff->which); return ProcXkbSetIndicatorMap(client); } static int SProcXkbGetNamedIndicator(ClientPtr client) { REQUEST(xkbGetNamedIndicatorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); swaps(&stuff->deviceSpec); swaps(&stuff->ledClass); swaps(&stuff->ledID); swapl(&stuff->indicator); return ProcXkbGetNamedIndicator(client); } static int SProcXkbSetNamedIndicator(ClientPtr client) { REQUEST(xkbSetNamedIndicatorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); swaps(&stuff->deviceSpec); swaps(&stuff->ledClass); swaps(&stuff->ledID); swapl(&stuff->indicator); swaps(&stuff->virtualMods); swapl(&stuff->ctrls); return ProcXkbSetNamedIndicator(client); } static int SProcXkbGetNames(ClientPtr client) { REQUEST(xkbGetNamesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetNamesReq); swaps(&stuff->deviceSpec); swapl(&stuff->which); return ProcXkbGetNames(client); } static int SProcXkbSetNames(ClientPtr client) { REQUEST(xkbSetNamesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); swaps(&stuff->deviceSpec); swaps(&stuff->virtualMods); swapl(&stuff->which); swapl(&stuff->indicators); swaps(&stuff->totalKTLevelNames); return ProcXkbSetNames(client); } static int SProcXkbGetGeometry(ClientPtr client) { REQUEST(xkbGetGeometryReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetGeometryReq); swaps(&stuff->deviceSpec); swapl(&stuff->name); return ProcXkbGetGeometry(client); } static int SProcXkbSetGeometry(ClientPtr client) { REQUEST(xkbSetGeometryReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); swaps(&stuff->deviceSpec); swapl(&stuff->name); swaps(&stuff->widthMM); swaps(&stuff->heightMM); swaps(&stuff->nProperties); swaps(&stuff->nColors); swaps(&stuff->nDoodads); swaps(&stuff->nKeyAliases); return ProcXkbSetGeometry(client); } static int SProcXkbPerClientFlags(ClientPtr client) { REQUEST(xkbPerClientFlagsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbPerClientFlagsReq); swaps(&stuff->deviceSpec); swapl(&stuff->change); swapl(&stuff->value); swapl(&stuff->ctrlsToChange); swapl(&stuff->autoCtrls); swapl(&stuff->autoCtrlValues); return ProcXkbPerClientFlags(client); } static int SProcXkbListComponents(ClientPtr client) { REQUEST(xkbListComponentsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbListComponentsReq); swaps(&stuff->deviceSpec); swaps(&stuff->maxNames); return ProcXkbListComponents(client); } static int SProcXkbGetKbdByName(ClientPtr client) { REQUEST(xkbGetKbdByNameReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq); swaps(&stuff->deviceSpec); swaps(&stuff->want); swaps(&stuff->need); return ProcXkbGetKbdByName(client); } static int SProcXkbGetDeviceInfo(ClientPtr client) { REQUEST(xkbGetDeviceInfoReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); swaps(&stuff->deviceSpec); swaps(&stuff->wanted); swaps(&stuff->ledClass); swaps(&stuff->ledID); return ProcXkbGetDeviceInfo(client); } static int SProcXkbSetDeviceInfo(ClientPtr client) { REQUEST(xkbSetDeviceInfoReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq); swaps(&stuff->deviceSpec); swaps(&stuff->change); swaps(&stuff->nDeviceLedFBs); return ProcXkbSetDeviceInfo(client); } static int SProcXkbSetDebuggingFlags(ClientPtr client) { REQUEST(xkbSetDebuggingFlagsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq); swapl(&stuff->affectFlags); swapl(&stuff->flags); swapl(&stuff->affectCtrls); swapl(&stuff->ctrls); swaps(&stuff->msgLength); return ProcXkbSetDebuggingFlags(client); } int SProcXkbDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_kbUseExtension: return SProcXkbUseExtension(client); case X_kbSelectEvents: return SProcXkbSelectEvents(client); case X_kbBell: return SProcXkbBell(client); case X_kbGetState: return SProcXkbGetState(client); case X_kbLatchLockState: return SProcXkbLatchLockState(client); case X_kbGetControls: return SProcXkbGetControls(client); case X_kbSetControls: return SProcXkbSetControls(client); case X_kbGetMap: return SProcXkbGetMap(client); case X_kbSetMap: return SProcXkbSetMap(client); case X_kbGetCompatMap: return SProcXkbGetCompatMap(client); case X_kbSetCompatMap: return SProcXkbSetCompatMap(client); case X_kbGetIndicatorState: return SProcXkbGetIndicatorState(client); case X_kbGetIndicatorMap: return SProcXkbGetIndicatorMap(client); case X_kbSetIndicatorMap: return SProcXkbSetIndicatorMap(client); case X_kbGetNamedIndicator: return SProcXkbGetNamedIndicator(client); case X_kbSetNamedIndicator: return SProcXkbSetNamedIndicator(client); case X_kbGetNames: return SProcXkbGetNames(client); case X_kbSetNames: return SProcXkbSetNames(client); case X_kbGetGeometry: return SProcXkbGetGeometry(client); case X_kbSetGeometry: return SProcXkbSetGeometry(client); case X_kbPerClientFlags: return SProcXkbPerClientFlags(client); case X_kbListComponents: return SProcXkbListComponents(client); case X_kbGetKbdByName: return SProcXkbGetKbdByName(client); case X_kbGetDeviceInfo: return SProcXkbGetDeviceInfo(client); case X_kbSetDeviceInfo: return SProcXkbSetDeviceInfo(client); case X_kbSetDebuggingFlags: return SProcXkbSetDebuggingFlags(client); default: return BadRequest; } } xorg-server-1.17.1/xkb/xkb.h0000664000175100017510000000247012274325512012540 00000000000000#ifndef _XKB_H #define _XKB_H extern int ProcXkbUseExtension(ClientPtr client); extern int ProcXkbSelectEvents(ClientPtr client); extern int ProcXkbBell(ClientPtr client); extern int ProcXkbGetState(ClientPtr client); extern int ProcXkbLatchLockState(ClientPtr client); extern int ProcXkbGetControls(ClientPtr client); extern int ProcXkbSetControls(ClientPtr client); extern int ProcXkbGetMap(ClientPtr client); extern int ProcXkbSetMap(ClientPtr client); extern int ProcXkbGetCompatMap(ClientPtr client); extern int ProcXkbSetCompatMap(ClientPtr client); extern int ProcXkbGetIndicatorState(ClientPtr client); extern int ProcXkbGetIndicatorMap(ClientPtr client); extern int ProcXkbSetIndicatorMap(ClientPtr client); extern int ProcXkbGetNamedIndicator(ClientPtr client); extern int ProcXkbSetNamedIndicator(ClientPtr client); extern int ProcXkbGetNames(ClientPtr client); extern int ProcXkbSetNames(ClientPtr client); extern int ProcXkbGetGeometry(ClientPtr client); extern int ProcXkbSetGeometry(ClientPtr client); extern int ProcXkbPerClientFlags(ClientPtr client); extern int ProcXkbListComponents(ClientPtr client); extern int ProcXkbGetKbdByName(ClientPtr client); extern int ProcXkbGetDeviceInfo(ClientPtr client); extern int ProcXkbSetDeviceInfo(ClientPtr client); extern int ProcXkbSetDebuggingFlags(ClientPtr client); #endif xorg-server-1.17.1/xkb/ddxKillSrv.c0000664000175100017510000000320112456571574014043 00000000000000/************************************************************ Copyright (c) 1993 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 "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include int XkbDDXTerminateServer(DeviceIntPtr dev, KeyCode key, XkbAction *act) { if (dev != inputInfo.keyboard) GiveUp(1); return 0; } xorg-server-1.17.1/xkb/xkbUtils.c0000664000175100017510000022034012456571574013567 00000000000000/************************************************************ Copyright (c) 1993 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. ********************************************************/ /* Copyright © 2008 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 "os.h" #include #include #include #include #include #define XK_CYRILLIC #include #include "misc.h" #include "inputstr.h" #include "eventstr.h" #define XKBSRV_NEED_FILE_FUNCS #include #include "xkbgeom.h" #include "xkb.h" /***====================================================================***/ int _XkbLookupAnyDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err) { int rc = XkbKeyboardErrorCode; if (id == XkbUseCoreKbd) id = PickKeyboard(client)->id; else if (id == XkbUseCorePtr) id = PickPointer(client)->id; rc = dixLookupDevice(pDev, id, client, access_mode); if (rc != Success) *xkb_err = XkbErr_BadDevice; return rc; } int _XkbLookupKeyboard(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err) { DeviceIntPtr dev; int rc; if (id == XkbDfltXIId) id = XkbUseCoreKbd; rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err); if (rc != Success) return rc; dev = *pDev; if (!dev->key || !dev->key->xkbInfo) { *pDev = NULL; *xkb_err = XkbErr_BadClass; return XkbKeyboardErrorCode; } return Success; } int _XkbLookupBellDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err) { DeviceIntPtr dev; int rc; rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err); if (rc != Success) return rc; dev = *pDev; if (!dev->kbdfeed && !dev->bell) { *pDev = NULL; *xkb_err = XkbErr_BadClass; return XkbKeyboardErrorCode; } return Success; } int _XkbLookupLedDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err) { DeviceIntPtr dev; int rc; if (id == XkbDfltXIId) id = XkbUseCorePtr; rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err); if (rc != Success) return rc; dev = *pDev; if (!dev->kbdfeed && !dev->leds) { *pDev = NULL; *xkb_err = XkbErr_BadClass; return XkbKeyboardErrorCode; } return Success; } int _XkbLookupButtonDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode, int *xkb_err) { DeviceIntPtr dev; int rc; rc = _XkbLookupAnyDevice(pDev, id, client, access_mode, xkb_err); if (rc != Success) return rc; dev = *pDev; if (!dev->button) { *pDev = NULL; *xkb_err = XkbErr_BadClass; return XkbKeyboardErrorCode; } return Success; } void XkbSetActionKeyMods(XkbDescPtr xkb, XkbAction *act, unsigned mods) { register unsigned tmp; switch (act->type) { case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods: if (act->mods.flags & XkbSA_UseModMapMods) act->mods.real_mods = act->mods.mask = mods; if ((tmp = XkbModActionVMods(&act->mods)) != 0) act->mods.mask |= XkbMaskForVMask(xkb, tmp); break; case XkbSA_ISOLock: if (act->iso.flags & XkbSA_UseModMapMods) act->iso.real_mods = act->iso.mask = mods; if ((tmp = XkbModActionVMods(&act->iso)) != 0) act->iso.mask |= XkbMaskForVMask(xkb, tmp); break; } return; } unsigned XkbMaskForVMask(XkbDescPtr xkb, unsigned vmask) { register int i, bit; register unsigned mask; for (mask = i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (vmask & bit) mask |= xkb->server->vmods[i]; } return mask; } /***====================================================================***/ void XkbUpdateKeyTypesFromCore(DeviceIntPtr pXDev, KeySymsPtr pCore, KeyCode first, CARD8 num, XkbChangesPtr changes) { XkbDescPtr xkb; unsigned key, nG, explicit; int types[XkbNumKbdGroups]; KeySym tsyms[XkbMaxSymsPerKey], *syms; XkbMapChangesPtr mc; xkb = pXDev->key->xkbInfo->desc; if (first + num - 1 > xkb->max_key_code) { /* 1/12/95 (ef) -- XXX! should allow XKB structures to grow */ num = xkb->max_key_code - first + 1; } mc = (changes ? (&changes->map) : NULL); syms = &pCore->map[(first - pCore->minKeyCode) * pCore->mapWidth]; for (key = first; key < (first + num); key++, syms += pCore->mapWidth) { explicit = xkb->server->explicit[key] & XkbExplicitKeyTypesMask; types[XkbGroup1Index] = XkbKeyKeyTypeIndex(xkb, key, XkbGroup1Index); types[XkbGroup2Index] = XkbKeyKeyTypeIndex(xkb, key, XkbGroup2Index); types[XkbGroup3Index] = XkbKeyKeyTypeIndex(xkb, key, XkbGroup3Index); types[XkbGroup4Index] = XkbKeyKeyTypeIndex(xkb, key, XkbGroup4Index); nG = XkbKeyTypesForCoreSymbols(xkb, pCore->mapWidth, syms, explicit, types, tsyms); XkbChangeTypesOfKey(xkb, key, nG, XkbAllGroupsMask, types, mc); memcpy((char *) XkbKeySymsPtr(xkb, key), (char *) tsyms, XkbKeyNumSyms(xkb, key) * sizeof(KeySym)); } if (changes->map.changed & XkbKeySymsMask) { CARD8 oldLast, newLast; oldLast = changes->map.first_key_sym + changes->map.num_key_syms - 1; newLast = first + num - 1; if (first < changes->map.first_key_sym) changes->map.first_key_sym = first; if (oldLast > newLast) newLast = oldLast; changes->map.num_key_syms = newLast - changes->map.first_key_sym + 1; } else { changes->map.changed |= XkbKeySymsMask; changes->map.first_key_sym = first; changes->map.num_key_syms = num; } return; } void XkbUpdateDescActions(XkbDescPtr xkb, KeyCode first, CARD8 num, XkbChangesPtr changes) { register unsigned key; for (key = first; key < (first + num); key++) { XkbApplyCompatMapToKey(xkb, key, changes); } if (changes->map.changed & (XkbVirtualModMapMask | XkbModifierMapMask)) { unsigned char newVMods[XkbNumVirtualMods]; register unsigned bit, i; unsigned present; memset(newVMods, 0, XkbNumVirtualMods); present = 0; for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) { if (xkb->server->vmodmap[key] == 0) continue; for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (bit & xkb->server->vmodmap[key]) { present |= bit; newVMods[i] |= xkb->map->modmap[key]; } } } for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if ((bit & present) && (newVMods[i] != xkb->server->vmods[i])) { changes->map.changed |= XkbVirtualModsMask; changes->map.vmods |= bit; xkb->server->vmods[i] = newVMods[i]; } } } if (changes->map.changed & XkbVirtualModsMask) XkbApplyVirtualModChanges(xkb, changes->map.vmods, changes); if (changes->map.changed & XkbKeyActionsMask) { CARD8 oldLast, newLast; oldLast = changes->map.first_key_act + changes->map.num_key_acts - 1; newLast = first + num - 1; if (first < changes->map.first_key_act) changes->map.first_key_act = first; if (newLast > oldLast) newLast = oldLast; changes->map.num_key_acts = newLast - changes->map.first_key_act + 1; } else { changes->map.changed |= XkbKeyActionsMask; changes->map.first_key_act = first; changes->map.num_key_acts = num; } return; } void XkbUpdateActions(DeviceIntPtr pXDev, KeyCode first, CARD8 num, XkbChangesPtr changes, unsigned *needChecksRtrn, XkbEventCausePtr cause) { XkbSrvInfoPtr xkbi; XkbDescPtr xkb; CARD8 *repeat; if (needChecksRtrn) *needChecksRtrn = 0; xkbi = pXDev->key->xkbInfo; xkb = xkbi->desc; repeat = xkb->ctrls->per_key_repeat; /* before letting XKB do any changes, copy the current core values */ if (pXDev->kbdfeed) memcpy(repeat, pXDev->kbdfeed->ctrl.autoRepeats, XkbPerKeyBitArraySize); XkbUpdateDescActions(xkb, first, num, changes); if ((pXDev->kbdfeed) && (changes->ctrls.changed_ctrls & XkbPerKeyRepeatMask)) { /* now copy the modified changes back to core */ memcpy(pXDev->kbdfeed->ctrl.autoRepeats, repeat, XkbPerKeyBitArraySize); if (pXDev->kbdfeed->CtrlProc) (*pXDev->kbdfeed->CtrlProc) (pXDev, &pXDev->kbdfeed->ctrl); } return; } KeySymsPtr XkbGetCoreMap(DeviceIntPtr keybd) { register int key, tmp; int maxSymsPerKey, maxGroup1Width; XkbDescPtr xkb; KeySymsPtr syms; int maxNumberOfGroups; if (!keybd || !keybd->key || !keybd->key->xkbInfo) return NULL; xkb = keybd->key->xkbInfo->desc; maxSymsPerKey = maxGroup1Width = 0; maxNumberOfGroups = 0; /* determine sizes */ for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) { if (XkbKeycodeInRange(xkb, key)) { int nGroups; int w; nGroups = XkbKeyNumGroups(xkb, key); tmp = 0; if (nGroups > 0) { if ((w = XkbKeyGroupWidth(xkb, key, XkbGroup1Index)) <= 2) tmp += 2; else tmp += w + 2; /* remember highest G1 width */ if (w > maxGroup1Width) maxGroup1Width = w; } if (nGroups > 1) { if (tmp <= 2) { if ((w = XkbKeyGroupWidth(xkb, key, XkbGroup2Index)) < 2) tmp += 2; else tmp += w; } else { if ((w = XkbKeyGroupWidth(xkb, key, XkbGroup2Index)) > 2) tmp += w - 2; } } if (nGroups > 2) tmp += XkbKeyGroupWidth(xkb, key, XkbGroup3Index); if (nGroups > 3) tmp += XkbKeyGroupWidth(xkb, key, XkbGroup4Index); if (tmp > maxSymsPerKey) maxSymsPerKey = tmp; if (nGroups > maxNumberOfGroups) maxNumberOfGroups = nGroups; } } if (maxSymsPerKey <= 0) return NULL; syms = calloc(1, sizeof(*syms)); if (!syms) return NULL; /* See Section 12.4 of the XKB Protocol spec. Because of the * single-group distribution for multi-group keyboards, we have to * have enough symbols for the largest group 1 to replicate across the * number of groups on the keyboard. e.g. a single-group key with 4 * symbols on a keyboard that has 3 groups -> 12 syms per key */ if (maxSymsPerKey < maxNumberOfGroups * maxGroup1Width) maxSymsPerKey = maxNumberOfGroups * maxGroup1Width; syms->mapWidth = maxSymsPerKey; syms->minKeyCode = xkb->min_key_code; syms->maxKeyCode = xkb->max_key_code; tmp = syms->mapWidth * (xkb->max_key_code - xkb->min_key_code + 1); syms->map = calloc(tmp, sizeof(*syms->map)); if (!syms->map) { free(syms); return NULL; } for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) { KeySym *pCore, *pXKB; unsigned nGroups, groupWidth, n, nOut; nGroups = XkbKeyNumGroups(xkb, key); n = (key - xkb->min_key_code) * syms->mapWidth; pCore = &syms->map[n]; pXKB = XkbKeySymsPtr(xkb, key); nOut = 2; if (nGroups > 0) { groupWidth = XkbKeyGroupWidth(xkb, key, XkbGroup1Index); if (groupWidth > 0) pCore[0] = pXKB[0]; if (groupWidth > 1) pCore[1] = pXKB[1]; for (n = 2; n < groupWidth; n++) pCore[2 + n] = pXKB[n]; if (groupWidth > 2) nOut = groupWidth; } /* See XKB Protocol Sec, Section 12.4. A 1-group key with ABCDE on a 2 group keyboard must be duplicated across all groups as ABABCDECDE. */ if (nGroups == 1) { int idx, j; groupWidth = XkbKeyGroupWidth(xkb, key, XkbGroup1Index); /* AB..CDE... -> ABABCDE... */ if (groupWidth > 0 && syms->mapWidth >= 3) pCore[2] = pCore[0]; if (groupWidth > 1 && syms->mapWidth >= 4) pCore[3] = pCore[1]; /* ABABCDE... -> ABABCDECDE */ idx = 2 + groupWidth; while (groupWidth > 2 && idx < syms->mapWidth && idx < groupWidth * 2) { pCore[idx] = pCore[idx - groupWidth + 2]; idx++; } idx = 2 * groupWidth; if (idx < 4) idx = 4; /* 3 or more groups: ABABCDECDEABCDEABCDE */ for (j = 3; j <= maxNumberOfGroups; j++) for (n = 0; n < groupWidth && idx < maxSymsPerKey; n++) pCore[idx++] = pXKB[n]; } pXKB += XkbKeyGroupsWidth(xkb, key); nOut += 2; if (nGroups > 1) { groupWidth = XkbKeyGroupWidth(xkb, key, XkbGroup2Index); if (groupWidth > 0) pCore[2] = pXKB[0]; if (groupWidth > 1) pCore[3] = pXKB[1]; for (n = 2; n < groupWidth; n++) { pCore[nOut + (n - 2)] = pXKB[n]; } if (groupWidth > 2) nOut += (groupWidth - 2); } pXKB += XkbKeyGroupsWidth(xkb, key); for (n = XkbGroup3Index; n < nGroups; n++) { register int s; groupWidth = XkbKeyGroupWidth(xkb, key, n); for (s = 0; s < groupWidth; s++) { pCore[nOut++] = pXKB[s]; } pXKB += XkbKeyGroupsWidth(xkb, key); } } return syms; } void XkbSetRepeatKeys(DeviceIntPtr pXDev, int key, int onoff) { if (pXDev && pXDev->key && pXDev->key->xkbInfo) { xkbControlsNotify cn; XkbControlsPtr ctrls = pXDev->key->xkbInfo->desc->ctrls; XkbControlsRec old; old = *ctrls; if (key == -1) { /* global autorepeat setting changed */ if (onoff) ctrls->enabled_ctrls |= XkbRepeatKeysMask; else ctrls->enabled_ctrls &= ~XkbRepeatKeysMask; } else if (pXDev->kbdfeed) { ctrls->per_key_repeat[key / 8] = pXDev->kbdfeed->ctrl.autoRepeats[key / 8]; } if (XkbComputeControlsNotify(pXDev, &old, ctrls, &cn, TRUE)) XkbSendControlsNotify(pXDev, &cn); } return; } /* Applies a change to a single device, does not traverse the device tree. */ void XkbApplyMappingChange(DeviceIntPtr kbd, KeySymsPtr map, KeyCode first_key, CARD8 num_keys, CARD8 *modmap, ClientPtr client) { XkbDescPtr xkb = kbd->key->xkbInfo->desc; XkbEventCauseRec cause; XkbChangesRec changes; unsigned int check; memset(&changes, 0, sizeof(changes)); memset(&cause, 0, sizeof(cause)); if (map && first_key && num_keys) { check = 0; XkbSetCauseCoreReq(&cause, X_ChangeKeyboardMapping, client); XkbUpdateKeyTypesFromCore(kbd, map, first_key, num_keys, &changes); XkbUpdateActions(kbd, first_key, num_keys, &changes, &check, &cause); if (check) XkbCheckSecondaryEffects(kbd->key->xkbInfo, 1, &changes, &cause); } if (modmap) { /* A keymap change can imply a modmap change, se we prefer the * former. */ if (!cause.mjr) XkbSetCauseCoreReq(&cause, X_SetModifierMapping, client); check = 0; num_keys = xkb->max_key_code - xkb->min_key_code + 1; changes.map.changed |= XkbModifierMapMask; changes.map.first_modmap_key = xkb->min_key_code; changes.map.num_modmap_keys = num_keys; memcpy(kbd->key->xkbInfo->desc->map->modmap, modmap, MAP_LENGTH); XkbUpdateActions(kbd, xkb->min_key_code, num_keys, &changes, &check, &cause); if (check) XkbCheckSecondaryEffects(kbd->key->xkbInfo, 1, &changes, &cause); } XkbSendNotification(kbd, &changes, &cause); } void XkbDisableComputedAutoRepeats(DeviceIntPtr dev, unsigned key) { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; xkbMapNotify mn; xkbi->desc->server->explicit[key] |= XkbExplicitAutoRepeatMask; memset(&mn, 0, sizeof(mn)); mn.changed = XkbExplicitComponentsMask; mn.firstKeyExplicit = key; mn.nKeyExplicit = 1; XkbSendMapNotify(dev, &mn); return; } unsigned XkbStateChangedFlags(XkbStatePtr old, XkbStatePtr new) { int changed; changed = (old->group != new->group ? XkbGroupStateMask : 0); changed |= (old->base_group != new->base_group ? XkbGroupBaseMask : 0); changed |= (old->latched_group != new->latched_group ? XkbGroupLatchMask : 0); changed |= (old->locked_group != new->locked_group ? XkbGroupLockMask : 0); changed |= (old->mods != new->mods ? XkbModifierStateMask : 0); changed |= (old->base_mods != new->base_mods ? XkbModifierBaseMask : 0); changed |= (old->latched_mods != new->latched_mods ? XkbModifierLatchMask : 0); changed |= (old->locked_mods != new->locked_mods ? XkbModifierLockMask : 0); changed |= (old->compat_state != new->compat_state ? XkbCompatStateMask : 0); changed |= (old->grab_mods != new->grab_mods ? XkbGrabModsMask : 0); if (old->compat_grab_mods != new->compat_grab_mods) changed |= XkbCompatGrabModsMask; changed |= (old->lookup_mods != new->lookup_mods ? XkbLookupModsMask : 0); if (old->compat_lookup_mods != new->compat_lookup_mods) changed |= XkbCompatLookupModsMask; changed |= (old->ptr_buttons != new->ptr_buttons ? XkbPointerButtonMask : 0); return changed; } static void 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; map = xkbi->desc->compat; 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 (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; } unsigned XkbAdjustGroup(int group, XkbControlsPtr ctrls) { unsigned act; act = XkbOutOfRangeGroupAction(ctrls->groups_wrap); if (group < 0) { while (group < 0) { if (act == XkbClampIntoRange) { group = XkbGroup1Index; } else if (act == XkbRedirectIntoRange) { int newGroup; newGroup = XkbOutOfRangeGroupNumber(ctrls->groups_wrap); if (newGroup >= ctrls->num_groups) group = XkbGroup1Index; else group = newGroup; } else { group += ctrls->num_groups; } } } else if (group >= ctrls->num_groups) { if (act == XkbClampIntoRange) { group = ctrls->num_groups - 1; } else if (act == XkbRedirectIntoRange) { int newGroup; newGroup = XkbOutOfRangeGroupNumber(ctrls->groups_wrap); if (newGroup >= ctrls->num_groups) group = XkbGroup1Index; else group = newGroup; } else { group %= ctrls->num_groups; } } return group; } void XkbComputeDerivedState(XkbSrvInfoPtr xkbi) { XkbStatePtr state = &xkbi->state; XkbControlsPtr ctrls = xkbi->desc->ctrls; unsigned char grp; if (!state || !ctrls) return; state->mods = (state->base_mods | state->latched_mods | state->locked_mods); state->lookup_mods = state->mods & (~ctrls->internal.mask); state->grab_mods = state->lookup_mods & (~ctrls->ignore_lock.mask); state->grab_mods |= ((state->base_mods | state->latched_mods) & ctrls->ignore_lock.mask); grp = state->locked_group; if (grp >= ctrls->num_groups) state->locked_group = XkbAdjustGroup(XkbCharToInt(grp), ctrls); grp = state->locked_group + state->base_group + state->latched_group; if (grp >= ctrls->num_groups) state->group = XkbAdjustGroup(XkbCharToInt(grp), ctrls); else state->group = grp; XkbComputeCompatState(xkbi); return; } /***====================================================================***/ void XkbCheckSecondaryEffects(XkbSrvInfoPtr xkbi, unsigned which, XkbChangesPtr changes, XkbEventCausePtr cause) { if (which & XkbStateNotifyMask) { XkbStateRec old; old = xkbi->state; changes->state_changes |= XkbStateChangedFlags(&old, &xkbi->state); XkbComputeDerivedState(xkbi); } if (which & XkbIndicatorStateNotifyMask) XkbUpdateIndicators(xkbi->device, XkbAllIndicatorsMask, TRUE, changes, cause); return; } /***====================================================================***/ Bool XkbEnableDisableControls(XkbSrvInfoPtr xkbi, unsigned long change, unsigned long newValues, XkbChangesPtr changes, XkbEventCausePtr cause) { XkbControlsPtr ctrls; unsigned old; XkbSrvLedInfoPtr sli; ctrls = xkbi->desc->ctrls; old = ctrls->enabled_ctrls; ctrls->enabled_ctrls &= ~change; ctrls->enabled_ctrls |= (change & newValues); if (old == ctrls->enabled_ctrls) return FALSE; if (cause != NULL) { xkbControlsNotify cn; cn.numGroups = ctrls->num_groups; cn.changedControls = XkbControlsEnabledMask; cn.enabledControls = ctrls->enabled_ctrls; cn.enabledControlChanges = (ctrls->enabled_ctrls ^ old); cn.keycode = cause->kc; cn.eventType = cause->event; cn.requestMajor = cause->mjr; cn.requestMinor = cause->mnr; XkbSendControlsNotify(xkbi->device, &cn); } else { /* Yes, this really should be an XOR. If ctrls->enabled_ctrls_changes */ /* is non-zero, the controls in question changed already in "this" */ /* request and this change merely undoes the previous one. By the */ /* same token, we have to figure out whether or not ControlsEnabled */ /* should be set or not in the changes structure */ changes->ctrls.enabled_ctrls_changes ^= (ctrls->enabled_ctrls ^ old); if (changes->ctrls.enabled_ctrls_changes) changes->ctrls.changed_ctrls |= XkbControlsEnabledMask; else changes->ctrls.changed_ctrls &= ~XkbControlsEnabledMask; } sli = XkbFindSrvLedInfo(xkbi->device, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(xkbi->device, sli->usesControls, TRUE, changes, cause); return TRUE; } /***====================================================================***/ #define MAX_TOC 16 XkbGeometryPtr XkbLookupNamedGeometry(DeviceIntPtr dev, Atom name, Bool *shouldFree) { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbDescPtr xkb = xkbi->desc; *shouldFree = 0; if (name == None) { if (xkb->geom != NULL) return xkb->geom; name = xkb->names->geometry; } if ((xkb->geom != NULL) && (xkb->geom->name == name)) return xkb->geom; *shouldFree = 1; return NULL; } void XkbConvertCase(register KeySym sym, KeySym * lower, KeySym * upper) { *lower = sym; *upper = sym; switch (sym >> 8) { case 0: /* Latin 1 */ if ((sym >= XK_A) && (sym <= XK_Z)) *lower += (XK_a - XK_A); else if ((sym >= XK_a) && (sym <= XK_z)) *upper -= (XK_a - XK_A); else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis)) *lower += (XK_agrave - XK_Agrave); else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis)) *upper -= (XK_agrave - XK_Agrave); else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn)) *lower += (XK_oslash - XK_Ooblique); else if ((sym >= XK_oslash) && (sym <= XK_thorn)) *upper -= (XK_oslash - XK_Ooblique); break; case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XK_Aogonek) *lower = XK_aogonek; else if (sym >= XK_Lstroke && sym <= XK_Sacute) *lower += (XK_lstroke - XK_Lstroke); else if (sym >= XK_Scaron && sym <= XK_Zacute) *lower += (XK_scaron - XK_Scaron); else if (sym >= XK_Zcaron && sym <= XK_Zabovedot) *lower += (XK_zcaron - XK_Zcaron); else if (sym == XK_aogonek) *upper = XK_Aogonek; else if (sym >= XK_lstroke && sym <= XK_sacute) *upper -= (XK_lstroke - XK_Lstroke); else if (sym >= XK_scaron && sym <= XK_zacute) *upper -= (XK_scaron - XK_Scaron); else if (sym >= XK_zcaron && sym <= XK_zabovedot) *upper -= (XK_zcaron - XK_Zcaron); else if (sym >= XK_Racute && sym <= XK_Tcedilla) *lower += (XK_racute - XK_Racute); else if (sym >= XK_racute && sym <= XK_tcedilla) *upper -= (XK_racute - XK_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XK_Hstroke && sym <= XK_Hcircumflex) *lower += (XK_hstroke - XK_Hstroke); else if (sym >= XK_Gbreve && sym <= XK_Jcircumflex) *lower += (XK_gbreve - XK_Gbreve); else if (sym >= XK_hstroke && sym <= XK_hcircumflex) *upper -= (XK_hstroke - XK_Hstroke); else if (sym >= XK_gbreve && sym <= XK_jcircumflex) *upper -= (XK_gbreve - XK_Gbreve); else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex) *lower += (XK_cabovedot - XK_Cabovedot); else if (sym >= XK_cabovedot && sym <= XK_scircumflex) *upper -= (XK_cabovedot - XK_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XK_Rcedilla && sym <= XK_Tslash) *lower += (XK_rcedilla - XK_Rcedilla); else if (sym >= XK_rcedilla && sym <= XK_tslash) *upper -= (XK_rcedilla - XK_Rcedilla); else if (sym == XK_ENG) *lower = XK_eng; else if (sym == XK_eng) *upper = XK_ENG; else if (sym >= XK_Amacron && sym <= XK_Umacron) *lower += (XK_amacron - XK_Amacron); else if (sym >= XK_amacron && sym <= XK_umacron) *upper -= (XK_amacron - XK_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE) *lower -= (XK_Serbian_DJE - XK_Serbian_dje); else if (sym >= XK_Serbian_dje && sym <= XK_Serbian_dze) *upper += (XK_Serbian_DJE - XK_Serbian_dje); else if (sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN) *lower -= (XK_Cyrillic_YU - XK_Cyrillic_yu); else if (sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign) *upper += (XK_Cyrillic_YU - XK_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent) *lower += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent); else if (sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent && sym != XK_Greek_iotaaccentdieresis && sym != XK_Greek_upsilonaccentdieresis) *upper -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent); else if (sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA) *lower += (XK_Greek_alpha - XK_Greek_ALPHA); else if (sym >= XK_Greek_alpha && sym <= XK_Greek_omega && sym != XK_Greek_finalsmallsigma) *upper -= (XK_Greek_alpha - XK_Greek_ALPHA); break; } } static Bool _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst) { void *tmp = NULL; int i; XkbKeyTypePtr stype = NULL, dtype = NULL; /* client map */ if (src->map) { if (!dst->map) { tmp = calloc(1, sizeof(XkbClientMapRec)); if (!tmp) return FALSE; dst->map = tmp; } if (src->map->syms) { if (src->map->size_syms != dst->map->size_syms) { tmp = realloc(dst->map->syms, src->map->size_syms * sizeof(KeySym)); if (!tmp) return FALSE; dst->map->syms = tmp; } memcpy(dst->map->syms, src->map->syms, src->map->size_syms * sizeof(KeySym)); } else { free(dst->map->syms); dst->map->syms = NULL; } dst->map->num_syms = src->map->num_syms; dst->map->size_syms = src->map->size_syms; if (src->map->key_sym_map) { if (src->max_key_code != dst->max_key_code) { tmp = realloc(dst->map->key_sym_map, (src->max_key_code + 1) * sizeof(XkbSymMapRec)); if (!tmp) return FALSE; dst->map->key_sym_map = tmp; } memcpy(dst->map->key_sym_map, src->map->key_sym_map, (src->max_key_code + 1) * sizeof(XkbSymMapRec)); } else { free(dst->map->key_sym_map); dst->map->key_sym_map = NULL; } if (src->map->types && src->map->num_types) { if (src->map->num_types > dst->map->size_types || !dst->map->types || !dst->map->size_types) { if (dst->map->types && dst->map->size_types) { tmp = realloc(dst->map->types, src->map->num_types * sizeof(XkbKeyTypeRec)); if (!tmp) return FALSE; dst->map->types = tmp; memset(dst->map->types + dst->map->num_types, 0, (src->map->num_types - dst->map->num_types) * sizeof(XkbKeyTypeRec)); } else { tmp = calloc(src->map->num_types, sizeof(XkbKeyTypeRec)); if (!tmp) return FALSE; dst->map->types = tmp; } } else if (src->map->num_types < dst->map->num_types && dst->map->types) { for (i = src->map->num_types, dtype = (dst->map->types + i); i < dst->map->num_types; i++, dtype++) { free(dtype->level_names); dtype->level_names = NULL; dtype->num_levels = 0; if (dtype->map_count) { free(dtype->map); free(dtype->preserve); } } } stype = src->map->types; dtype = dst->map->types; for (i = 0; i < src->map->num_types; i++, dtype++, stype++) { if (stype->num_levels && stype->level_names) { if (stype->num_levels != dtype->num_levels && dtype->num_levels && dtype->level_names && i < dst->map->num_types) { tmp = realloc(dtype->level_names, stype->num_levels * sizeof(Atom)); if (!tmp) continue; dtype->level_names = tmp; } else if (!dtype->num_levels || !dtype->level_names || i >= dst->map->num_types) { tmp = malloc(stype->num_levels * sizeof(Atom)); if (!tmp) continue; dtype->level_names = tmp; } dtype->num_levels = stype->num_levels; memcpy(dtype->level_names, stype->level_names, stype->num_levels * sizeof(Atom)); } else { if (dtype->num_levels && dtype->level_names && i < dst->map->num_types) free(dtype->level_names); dtype->num_levels = 0; dtype->level_names = NULL; } dtype->name = stype->name; memcpy(&dtype->mods, &stype->mods, sizeof(XkbModsRec)); if (stype->map_count) { if (stype->map) { if (stype->map_count != dtype->map_count && dtype->map_count && dtype->map && i < dst->map->num_types) { tmp = realloc(dtype->map, stype->map_count * sizeof(XkbKTMapEntryRec)); if (!tmp) return FALSE; dtype->map = tmp; } else if (!dtype->map_count || !dtype->map || i >= dst->map->num_types) { tmp = malloc(stype->map_count * sizeof(XkbKTMapEntryRec)); if (!tmp) return FALSE; dtype->map = tmp; } memcpy(dtype->map, stype->map, stype->map_count * sizeof(XkbKTMapEntryRec)); } else { if (dtype->map && i < dst->map->num_types) free(dtype->map); dtype->map = NULL; } if (stype->preserve) { if (stype->map_count != dtype->map_count && dtype->map_count && dtype->preserve && i < dst->map->num_types) { tmp = realloc(dtype->preserve, stype->map_count * sizeof(XkbModsRec)); if (!tmp) return FALSE; dtype->preserve = tmp; } else if (!dtype->preserve || !dtype->map_count || i >= dst->map->num_types) { tmp = malloc(stype->map_count * sizeof(XkbModsRec)); if (!tmp) return FALSE; dtype->preserve = tmp; } memcpy(dtype->preserve, stype->preserve, stype->map_count * sizeof(XkbModsRec)); } else { if (dtype->preserve && i < dst->map->num_types) free(dtype->preserve); dtype->preserve = NULL; } dtype->map_count = stype->map_count; } else { if (dtype->map_count && i < dst->map->num_types) { free(dtype->map); free(dtype->preserve); } dtype->map_count = 0; dtype->map = NULL; dtype->preserve = NULL; } } dst->map->size_types = src->map->num_types; dst->map->num_types = src->map->num_types; } else { if (dst->map->types) { for (i = 0, dtype = dst->map->types; i < dst->map->num_types; i++, dtype++) { free(dtype->level_names); if (dtype->map && dtype->map_count) free(dtype->map); if (dtype->preserve && dtype->map_count) free(dtype->preserve); } } free(dst->map->types); dst->map->types = NULL; dst->map->num_types = 0; dst->map->size_types = 0; } if (src->map->modmap) { if (src->max_key_code != dst->max_key_code) { tmp = realloc(dst->map->modmap, src->max_key_code + 1); if (!tmp) return FALSE; dst->map->modmap = tmp; } memcpy(dst->map->modmap, src->map->modmap, src->max_key_code + 1); } else { free(dst->map->modmap); dst->map->modmap = NULL; } } else { if (dst->map) XkbFreeClientMap(dst, XkbAllClientInfoMask, TRUE); } return TRUE; } static Bool _XkbCopyServerMap(XkbDescPtr src, XkbDescPtr dst) { void *tmp = NULL; /* server map */ if (src->server) { if (!dst->server) { tmp = calloc(1, sizeof(XkbServerMapRec)); if (!tmp) return FALSE; dst->server = tmp; } if (src->server->explicit) { if (src->max_key_code != dst->max_key_code) { tmp = realloc(dst->server->explicit, src->max_key_code + 1); if (!tmp) return FALSE; dst->server->explicit = tmp; } memcpy(dst->server->explicit, src->server->explicit, src->max_key_code + 1); } else { free(dst->server->explicit); dst->server->explicit = NULL; } if (src->server->acts) { if (src->server->size_acts != dst->server->size_acts) { tmp = realloc(dst->server->acts, src->server->size_acts * sizeof(XkbAction)); if (!tmp) return FALSE; dst->server->acts = tmp; } memcpy(dst->server->acts, src->server->acts, src->server->size_acts * sizeof(XkbAction)); } else { free(dst->server->acts); dst->server->acts = NULL; } dst->server->size_acts = src->server->size_acts; dst->server->num_acts = src->server->num_acts; if (src->server->key_acts) { if (src->max_key_code != dst->max_key_code) { tmp = realloc(dst->server->key_acts, (src->max_key_code + 1) * sizeof(unsigned short)); if (!tmp) return FALSE; dst->server->key_acts = tmp; } memcpy(dst->server->key_acts, src->server->key_acts, (src->max_key_code + 1) * sizeof(unsigned short)); } else { free(dst->server->key_acts); dst->server->key_acts = NULL; } if (src->server->behaviors) { if (src->max_key_code != dst->max_key_code) { tmp = realloc(dst->server->behaviors, (src->max_key_code + 1) * sizeof(XkbBehavior)); if (!tmp) return FALSE; dst->server->behaviors = tmp; } memcpy(dst->server->behaviors, src->server->behaviors, (src->max_key_code + 1) * sizeof(XkbBehavior)); } else { free(dst->server->behaviors); dst->server->behaviors = NULL; } memcpy(dst->server->vmods, src->server->vmods, XkbNumVirtualMods); if (src->server->vmodmap) { if (src->max_key_code != dst->max_key_code) { tmp = realloc(dst->server->vmodmap, (src->max_key_code + 1) * sizeof(unsigned short)); if (!tmp) return FALSE; dst->server->vmodmap = tmp; } memcpy(dst->server->vmodmap, src->server->vmodmap, (src->max_key_code + 1) * sizeof(unsigned short)); } else { free(dst->server->vmodmap); dst->server->vmodmap = NULL; } } else { if (dst->server) XkbFreeServerMap(dst, XkbAllServerInfoMask, TRUE); } return TRUE; } static Bool _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst) { void *tmp = NULL; /* names */ if (src->names) { if (!dst->names) { dst->names = calloc(1, sizeof(XkbNamesRec)); if (!dst->names) return FALSE; } if (src->names->keys) { if (src->max_key_code != dst->max_key_code) { tmp = realloc(dst->names->keys, (src->max_key_code + 1) * sizeof(XkbKeyNameRec)); if (!tmp) return FALSE; dst->names->keys = tmp; } memcpy(dst->names->keys, src->names->keys, (src->max_key_code + 1) * sizeof(XkbKeyNameRec)); } else { free(dst->names->keys); dst->names->keys = NULL; } if (src->names->num_key_aliases) { if (src->names->num_key_aliases != dst->names->num_key_aliases) { tmp = realloc(dst->names->key_aliases, src->names->num_key_aliases * sizeof(XkbKeyAliasRec)); if (!tmp) return FALSE; dst->names->key_aliases = tmp; } memcpy(dst->names->key_aliases, src->names->key_aliases, src->names->num_key_aliases * sizeof(XkbKeyAliasRec)); } else { free(dst->names->key_aliases); dst->names->key_aliases = NULL; } dst->names->num_key_aliases = src->names->num_key_aliases; if (src->names->num_rg) { if (src->names->num_rg != dst->names->num_rg) { tmp = realloc(dst->names->radio_groups, src->names->num_rg * sizeof(Atom)); if (!tmp) return FALSE; dst->names->radio_groups = tmp; } memcpy(dst->names->radio_groups, src->names->radio_groups, src->names->num_rg * sizeof(Atom)); } else { free(dst->names->radio_groups); } dst->names->num_rg = src->names->num_rg; dst->names->keycodes = src->names->keycodes; dst->names->geometry = src->names->geometry; dst->names->symbols = src->names->symbols; dst->names->types = src->names->types; dst->names->compat = src->names->compat; dst->names->phys_symbols = src->names->phys_symbols; memcpy(dst->names->vmods, src->names->vmods, XkbNumVirtualMods * sizeof(Atom)); memcpy(dst->names->indicators, src->names->indicators, XkbNumIndicators * sizeof(Atom)); memcpy(dst->names->groups, src->names->groups, XkbNumKbdGroups * sizeof(Atom)); } else { if (dst->names) XkbFreeNames(dst, XkbAllNamesMask, TRUE); } return TRUE; } static Bool _XkbCopyCompat(XkbDescPtr src, XkbDescPtr dst) { void *tmp = NULL; /* compat */ if (src->compat) { if (!dst->compat) { dst->compat = calloc(1, sizeof(XkbCompatMapRec)); if (!dst->compat) return FALSE; } if (src->compat->sym_interpret && src->compat->num_si) { if (src->compat->num_si != dst->compat->size_si) { tmp = realloc(dst->compat->sym_interpret, src->compat->num_si * sizeof(XkbSymInterpretRec)); if (!tmp) return FALSE; dst->compat->sym_interpret = tmp; } memcpy(dst->compat->sym_interpret, src->compat->sym_interpret, src->compat->num_si * sizeof(XkbSymInterpretRec)); dst->compat->num_si = src->compat->num_si; dst->compat->size_si = src->compat->num_si; } else { if (dst->compat->sym_interpret && dst->compat->size_si) free(dst->compat->sym_interpret); dst->compat->sym_interpret = NULL; dst->compat->num_si = 0; dst->compat->size_si = 0; } memcpy(dst->compat->groups, src->compat->groups, XkbNumKbdGroups * sizeof(XkbModsRec)); } else { if (dst->compat) XkbFreeCompatMap(dst, XkbAllCompatMask, TRUE); } return TRUE; } static Bool _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) { void *tmp = NULL; int i = 0, j = 0, k = 0; XkbColorPtr scolor = NULL, dcolor = NULL; XkbDoodadPtr sdoodad = NULL, ddoodad = NULL; XkbOutlinePtr soutline = NULL, doutline = NULL; XkbPropertyPtr sprop = NULL, dprop = NULL; XkbRowPtr srow = NULL, drow = NULL; XkbSectionPtr ssection = NULL, dsection = NULL; XkbShapePtr sshape = NULL, dshape = NULL; /* geometry */ if (src->geom) { if (!dst->geom) { dst->geom = calloc(sizeof(XkbGeometryRec), 1); if (!dst->geom) return FALSE; } /* properties */ if (src->geom->num_properties) { /* If we've got more properties in the destination than * the source, run through and free all the excess ones * first. */ if (src->geom->num_properties < dst->geom->sz_properties) { for (i = src->geom->num_properties, dprop = dst->geom->properties + i; i < dst->geom->num_properties; i++, dprop++) { free(dprop->name); free(dprop->value); } } /* Reallocate and clear all new items if the buffer grows. */ if (!XkbGeomRealloc ((void **) &dst->geom->properties, dst->geom->sz_properties, src->geom->num_properties, sizeof(XkbPropertyRec), XKB_GEOM_CLEAR_EXCESS)) return FALSE; /* We don't set num_properties as we need it to try and avoid * too much reallocing. */ dst->geom->sz_properties = src->geom->num_properties; for (i = 0, sprop = src->geom->properties, dprop = dst->geom->properties; i < src->geom->num_properties; i++, sprop++, dprop++) { if (i < dst->geom->num_properties) { if (strlen(sprop->name) != strlen(dprop->name)) { tmp = realloc(dprop->name, strlen(sprop->name) + 1); if (!tmp) return FALSE; dprop->name = tmp; } if (strlen(sprop->value) != strlen(dprop->value)) { tmp = realloc(dprop->value, strlen(sprop->value) + 1); if (!tmp) return FALSE; dprop->value = tmp; } strcpy(dprop->name, sprop->name); strcpy(dprop->value, sprop->value); } else { dprop->name = xstrdup(sprop->name); dprop->value = xstrdup(sprop->value); } } /* ... which is already src->geom->num_properties. */ dst->geom->num_properties = dst->geom->sz_properties; } else { if (dst->geom->sz_properties) { for (i = 0, dprop = dst->geom->properties; i < dst->geom->num_properties; i++, dprop++) { free(dprop->name); free(dprop->value); } free(dst->geom->properties); dst->geom->properties = NULL; } dst->geom->num_properties = 0; dst->geom->sz_properties = 0; } /* colors */ if (src->geom->num_colors) { if (src->geom->num_colors < dst->geom->sz_colors) { for (i = src->geom->num_colors, dcolor = dst->geom->colors + i; i < dst->geom->num_colors; i++, dcolor++) { free(dcolor->spec); } } /* Reallocate and clear all new items if the buffer grows. */ if (!XkbGeomRealloc ((void **) &dst->geom->colors, dst->geom->sz_colors, src->geom->num_colors, sizeof(XkbColorRec), XKB_GEOM_CLEAR_EXCESS)) return FALSE; dst->geom->sz_colors = src->geom->num_colors; for (i = 0, scolor = src->geom->colors, dcolor = dst->geom->colors; i < src->geom->num_colors; i++, scolor++, dcolor++) { if (i < dst->geom->num_colors) { if (strlen(scolor->spec) != strlen(dcolor->spec)) { tmp = realloc(dcolor->spec, strlen(scolor->spec) + 1); if (!tmp) return FALSE; dcolor->spec = tmp; } strcpy(dcolor->spec, scolor->spec); } else { dcolor->spec = xstrdup(scolor->spec); } dcolor->pixel = scolor->pixel; } dst->geom->num_colors = dst->geom->sz_colors; } else { if (dst->geom->sz_colors) { for (i = 0, dcolor = dst->geom->colors; i < dst->geom->num_colors; i++, dcolor++) { free(dcolor->spec); } free(dst->geom->colors); dst->geom->colors = NULL; } dst->geom->num_colors = 0; dst->geom->sz_colors = 0; } /* shapes */ /* shapes break down into outlines, which break down into points. */ if (dst->geom->num_shapes) { for (i = 0, dshape = dst->geom->shapes; i < dst->geom->num_shapes; i++, dshape++) { for (j = 0, doutline = dshape->outlines; j < dshape->num_outlines; j++, doutline++) { if (doutline->sz_points) free(doutline->points); } if (dshape->sz_outlines) { free(dshape->outlines); dshape->outlines = NULL; } dshape->num_outlines = 0; dshape->sz_outlines = 0; } } if (src->geom->num_shapes) { /* Reallocate and clear all items. */ if (!XkbGeomRealloc ((void **) &dst->geom->shapes, dst->geom->sz_shapes, src->geom->num_shapes, sizeof(XkbShapeRec), XKB_GEOM_CLEAR_ALL)) return FALSE; for (i = 0, sshape = src->geom->shapes, dshape = dst->geom->shapes; i < src->geom->num_shapes; i++, sshape++, dshape++) { if (sshape->num_outlines) { tmp = calloc(sshape->num_outlines, sizeof(XkbOutlineRec)); if (!tmp) return FALSE; dshape->outlines = tmp; for (j = 0, soutline = sshape->outlines, doutline = dshape->outlines; j < sshape->num_outlines; j++, soutline++, doutline++) { if (soutline->num_points) { tmp = malloc(soutline->num_points * sizeof(XkbPointRec)); if (!tmp) return FALSE; doutline->points = tmp; memcpy(doutline->points, soutline->points, soutline->num_points * sizeof(XkbPointRec)); doutline->corner_radius = soutline->corner_radius; } doutline->num_points = soutline->num_points; doutline->sz_points = soutline->num_points; } } dshape->num_outlines = sshape->num_outlines; dshape->sz_outlines = sshape->num_outlines; dshape->name = sshape->name; dshape->bounds = sshape->bounds; dshape->approx = NULL; if (sshape->approx && sshape->num_outlines > 0) { const ptrdiff_t approx_idx = sshape->approx - sshape->outlines; if (approx_idx < dshape->num_outlines) { dshape->approx = dshape->outlines + approx_idx; } else { LogMessage(X_WARNING, "XKB: approx outline " "index is out of range\n"); } } dshape->primary = NULL; if (sshape->primary && sshape->num_outlines > 0) { const ptrdiff_t primary_idx = sshape->primary - sshape->outlines; if (primary_idx < dshape->num_outlines) { dshape->primary = dshape->outlines + primary_idx; } else { LogMessage(X_WARNING, "XKB: primary outline " "index is out of range\n"); } } } dst->geom->num_shapes = src->geom->num_shapes; dst->geom->sz_shapes = src->geom->num_shapes; } else { if (dst->geom->sz_shapes) { free(dst->geom->shapes); } dst->geom->shapes = NULL; dst->geom->num_shapes = 0; dst->geom->sz_shapes = 0; } /* sections */ /* sections break down into doodads, and also into rows, which break * down into keys. */ if (dst->geom->num_sections) { for (i = 0, dsection = dst->geom->sections; i < dst->geom->num_sections; i++, dsection++) { for (j = 0, drow = dsection->rows; j < dsection->num_rows; j++, drow++) { if (drow->num_keys) free(drow->keys); } if (dsection->num_rows) free(dsection->rows); /* cut and waste from geom/doodad below. */ for (j = 0, ddoodad = dsection->doodads; j < dsection->num_doodads; j++, ddoodad++) { if (ddoodad->any.type == XkbTextDoodad) { free(ddoodad->text.text); ddoodad->text.text = NULL; free(ddoodad->text.font); ddoodad->text.font = NULL; } else if (ddoodad->any.type == XkbLogoDoodad) { free(ddoodad->logo.logo_name); ddoodad->logo.logo_name = NULL; } } free(dsection->doodads); } dst->geom->num_sections = 0; } if (src->geom->num_sections) { /* Reallocate and clear all items. */ if (!XkbGeomRealloc ((void **) &dst->geom->sections, dst->geom->sz_sections, src->geom->num_sections, sizeof(XkbSectionRec), XKB_GEOM_CLEAR_ALL)) return FALSE; dst->geom->num_sections = src->geom->num_sections; dst->geom->sz_sections = src->geom->num_sections; for (i = 0, ssection = src->geom->sections, dsection = dst->geom->sections; i < src->geom->num_sections; i++, ssection++, dsection++) { *dsection = *ssection; if (ssection->num_rows) { tmp = calloc(ssection->num_rows, sizeof(XkbRowRec)); if (!tmp) return FALSE; dsection->rows = tmp; } dsection->num_rows = ssection->num_rows; dsection->sz_rows = ssection->num_rows; for (j = 0, srow = ssection->rows, drow = dsection->rows; j < ssection->num_rows; j++, srow++, drow++) { if (srow->num_keys) { tmp = malloc(srow->num_keys * sizeof(XkbKeyRec)); if (!tmp) return FALSE; drow->keys = tmp; memcpy(drow->keys, srow->keys, srow->num_keys * sizeof(XkbKeyRec)); } drow->num_keys = srow->num_keys; drow->sz_keys = srow->num_keys; drow->top = srow->top; drow->left = srow->left; drow->vertical = srow->vertical; drow->bounds = srow->bounds; } if (ssection->num_doodads) { tmp = calloc(ssection->num_doodads, sizeof(XkbDoodadRec)); if (!tmp) return FALSE; dsection->doodads = tmp; } else { dsection->doodads = NULL; } dsection->sz_doodads = ssection->num_doodads; for (k = 0, sdoodad = ssection->doodads, ddoodad = dsection->doodads; k < ssection->num_doodads; k++, sdoodad++, ddoodad++) { memcpy(ddoodad, sdoodad, sizeof(XkbDoodadRec)); if (sdoodad->any.type == XkbTextDoodad) { if (sdoodad->text.text) ddoodad->text.text = strdup(sdoodad->text.text); if (sdoodad->text.font) ddoodad->text.font = strdup(sdoodad->text.font); } else if (sdoodad->any.type == XkbLogoDoodad) { if (sdoodad->logo.logo_name) ddoodad->logo.logo_name = strdup(sdoodad->logo.logo_name); } } dsection->overlays = NULL; dsection->sz_overlays = 0; dsection->num_overlays = 0; } } else { if (dst->geom->sz_sections) { free(dst->geom->sections); } dst->geom->sections = NULL; dst->geom->num_sections = 0; dst->geom->sz_sections = 0; } /* doodads */ if (dst->geom->num_doodads) { for (i = src->geom->num_doodads, ddoodad = dst->geom->doodads + src->geom->num_doodads; i < dst->geom->num_doodads; i++, ddoodad++) { if (ddoodad->any.type == XkbTextDoodad) { free(ddoodad->text.text); ddoodad->text.text = NULL; free(ddoodad->text.font); ddoodad->text.font = NULL; } else if (ddoodad->any.type == XkbLogoDoodad) { free(ddoodad->logo.logo_name); ddoodad->logo.logo_name = NULL; } } dst->geom->num_doodads = 0; } if (src->geom->num_doodads) { /* Reallocate and clear all items. */ if (!XkbGeomRealloc ((void **) &dst->geom->doodads, dst->geom->sz_doodads, src->geom->num_doodads, sizeof(XkbDoodadRec), XKB_GEOM_CLEAR_ALL)) return FALSE; dst->geom->sz_doodads = src->geom->num_doodads; for (i = 0, sdoodad = src->geom->doodads, ddoodad = dst->geom->doodads; i < src->geom->num_doodads; i++, sdoodad++, ddoodad++) { memcpy(ddoodad, sdoodad, sizeof(XkbDoodadRec)); if (sdoodad->any.type == XkbTextDoodad) { if (sdoodad->text.text) ddoodad->text.text = strdup(sdoodad->text.text); if (sdoodad->text.font) ddoodad->text.font = strdup(sdoodad->text.font); } else if (sdoodad->any.type == XkbLogoDoodad) { if (sdoodad->logo.logo_name) ddoodad->logo.logo_name = strdup(sdoodad->logo.logo_name); } } dst->geom->num_doodads = dst->geom->sz_doodads; } else { if (dst->geom->sz_doodads) { free(dst->geom->doodads); } dst->geom->doodads = NULL; dst->geom->num_doodads = 0; dst->geom->sz_doodads = 0; } /* key aliases */ if (src->geom->num_key_aliases) { /* Reallocate but don't clear any items. There is no need * to clear anything because data is immediately copied * over the whole memory area with memcpy. */ if (!XkbGeomRealloc ((void **) &dst->geom->key_aliases, dst->geom->sz_key_aliases, src->geom->num_key_aliases, 2 * XkbKeyNameLength, XKB_GEOM_CLEAR_NONE)) return FALSE; dst->geom->sz_key_aliases = src->geom->num_key_aliases; memcpy(dst->geom->key_aliases, src->geom->key_aliases, src->geom->num_key_aliases * 2 * XkbKeyNameLength); dst->geom->num_key_aliases = dst->geom->sz_key_aliases; } else { free(dst->geom->key_aliases); dst->geom->key_aliases = NULL; dst->geom->num_key_aliases = 0; dst->geom->sz_key_aliases = 0; } /* font */ if (src->geom->label_font) { if (!dst->geom->label_font) { tmp = malloc(strlen(src->geom->label_font) + 1); if (!tmp) return FALSE; dst->geom->label_font = tmp; } else if (strlen(src->geom->label_font) != strlen(dst->geom->label_font)) { tmp = realloc(dst->geom->label_font, strlen(src->geom->label_font) + 1); if (!tmp) return FALSE; dst->geom->label_font = tmp; } strcpy(dst->geom->label_font, src->geom->label_font); i = XkbGeomColorIndex(src->geom, src->geom->label_color); dst->geom->label_color = &(dst->geom->colors[i]); i = XkbGeomColorIndex(src->geom, src->geom->base_color); dst->geom->base_color = &(dst->geom->colors[i]); } else { free(dst->geom->label_font); dst->geom->label_font = NULL; dst->geom->label_color = NULL; dst->geom->base_color = NULL; } dst->geom->name = src->geom->name; dst->geom->width_mm = src->geom->width_mm; dst->geom->height_mm = src->geom->height_mm; } else { if (dst->geom) { /* I LOVE THE DIFFERENT CALL SIGNATURE. REALLY, I DO. */ XkbFreeGeometry(dst->geom, XkbGeomAllMask, TRUE); dst->geom = NULL; } } return TRUE; } static Bool _XkbCopyIndicators(XkbDescPtr src, XkbDescPtr dst) { /* indicators */ if (src->indicators) { if (!dst->indicators) { dst->indicators = malloc(sizeof(XkbIndicatorRec)); if (!dst->indicators) return FALSE; } memcpy(dst->indicators, src->indicators, sizeof(XkbIndicatorRec)); } else { free(dst->indicators); dst->indicators = NULL; } return TRUE; } static Bool _XkbCopyControls(XkbDescPtr src, XkbDescPtr dst) { /* controls */ if (src->ctrls) { if (!dst->ctrls) { dst->ctrls = malloc(sizeof(XkbControlsRec)); if (!dst->ctrls) return FALSE; } memcpy(dst->ctrls, src->ctrls, sizeof(XkbControlsRec)); } else { free(dst->ctrls); dst->ctrls = NULL; } return TRUE; } /** * Copy an XKB map from src to dst, reallocating when necessary: if some * map components are present in one, but not in the other, the destination * components will be allocated or freed as necessary. * * Basic map consistency is assumed on both sides, so maps with random * uninitialised data (e.g. names->radio_grous == NULL, names->num_rg == 19) * _will_ cause failures. You've been warned. * * Returns TRUE on success, or FALSE on failure. If this function fails, * dst may be in an inconsistent state: all its pointers are guaranteed * to remain valid, but part of the map may be from src and part from dst. * */ Bool XkbCopyKeymap(XkbDescPtr dst, XkbDescPtr src) { if (!src || !dst) { DebugF("XkbCopyKeymap: src (%p) or dst (%p) is NULL\n", src, dst); return FALSE; } if (src == dst) return TRUE; if (!_XkbCopyClientMap(src, dst)) { DebugF("XkbCopyKeymap: failed to copy client map\n"); return FALSE; } if (!_XkbCopyServerMap(src, dst)) { DebugF("XkbCopyKeymap: failed to copy server map\n"); return FALSE; } if (!_XkbCopyIndicators(src, dst)) { DebugF("XkbCopyKeymap: failed to copy indicators\n"); return FALSE; } if (!_XkbCopyControls(src, dst)) { DebugF("XkbCopyKeymap: failed to copy controls\n"); return FALSE; } if (!_XkbCopyNames(src, dst)) { DebugF("XkbCopyKeymap: failed to copy names\n"); return FALSE; } if (!_XkbCopyCompat(src, dst)) { DebugF("XkbCopyKeymap: failed to copy compat map\n"); return FALSE; } if (!_XkbCopyGeom(src, dst)) { DebugF("XkbCopyKeymap: failed to copy geometry\n"); return FALSE; } dst->min_key_code = src->min_key_code; dst->max_key_code = src->max_key_code; return TRUE; } Bool XkbDeviceApplyKeymap(DeviceIntPtr dst, XkbDescPtr desc) { xkbNewKeyboardNotify nkn; Bool ret; if (!dst->key || !desc) return FALSE; memset(&nkn, 0, sizeof(xkbNewKeyboardNotify)); nkn.oldMinKeyCode = dst->key->xkbInfo->desc->min_key_code; nkn.oldMaxKeyCode = dst->key->xkbInfo->desc->max_key_code; nkn.deviceID = dst->id; nkn.oldDeviceID = dst->id; nkn.minKeyCode = desc->min_key_code; nkn.maxKeyCode = desc->max_key_code; nkn.requestMajor = XkbReqCode; nkn.requestMinor = X_kbSetMap; /* Near enough's good enough. */ nkn.changed = XkbNKN_KeycodesMask; if (desc->geom) nkn.changed |= XkbNKN_GeometryMask; ret = XkbCopyKeymap(dst->key->xkbInfo->desc, desc); if (ret) XkbSendNewKeyboardNotify(dst, &nkn); return ret; } Bool XkbCopyDeviceKeymap(DeviceIntPtr dst, DeviceIntPtr src) { return XkbDeviceApplyKeymap(dst, src->key->xkbInfo->desc); } int XkbGetEffectiveGroup(XkbSrvInfoPtr xkbi, XkbStatePtr xkbState, CARD8 keycode) { XkbDescPtr xkb = xkbi->desc; int effectiveGroup = xkbState->group; if (!XkbKeycodeInRange(xkb, keycode)) return -1; if (effectiveGroup == XkbGroup1Index) return effectiveGroup; if (XkbKeyNumGroups(xkb, keycode) > 1U) { if (effectiveGroup >= XkbKeyNumGroups(xkb, keycode)) { unsigned int gi = XkbKeyGroupInfo(xkb, keycode); switch (XkbOutOfRangeGroupAction(gi)) { default: case XkbWrapIntoRange: effectiveGroup %= XkbKeyNumGroups(xkb, keycode); break; case XkbClampIntoRange: effectiveGroup = XkbKeyNumGroups(xkb, keycode) - 1; break; case XkbRedirectIntoRange: effectiveGroup = XkbOutOfRangeGroupInfo(gi); if (effectiveGroup >= XkbKeyNumGroups(xkb, keycode)) effectiveGroup = 0; break; } } } else effectiveGroup = XkbGroup1Index; return effectiveGroup; } /* Merge the lockedPtrButtons from all attached SDs for the given master * device into the MD's state. */ void XkbMergeLockedPtrBtns(DeviceIntPtr master) { DeviceIntPtr d = inputInfo.devices; XkbSrvInfoPtr xkbi = NULL; if (!IsMaster(master)) return; if (!master->key) return; xkbi = master->key->xkbInfo; xkbi->lockedPtrButtons = 0; for (; d; d = d->next) { if (IsMaster(d) || GetMaster(d, MASTER_KEYBOARD) != master || !d->key) continue; xkbi->lockedPtrButtons |= d->key->xkbInfo->lockedPtrButtons; } } void XkbCopyControls(XkbDescPtr dst, XkbDescPtr src) { int i, nG, nTG; if (!dst || !src) return; *dst->ctrls = *src->ctrls; for (nG = nTG = 0, i = dst->min_key_code; i <= dst->max_key_code; i++) { nG = XkbKeyNumGroups(dst, i); if (nG >= XkbNumKbdGroups) { nTG = XkbNumKbdGroups; break; } if (nG > nTG) { nTG = nG; } } dst->ctrls->num_groups = nTG; } xorg-server-1.17.1/xkb/ddxCtrls.c0000664000175100017510000000517212456571574013555 00000000000000/************************************************************ Copyright (c) 1993 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 "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include #include void XkbDDXKeybdCtrlProc(DeviceIntPtr dev, KeybdCtrl * ctrl) { int realRepeat; realRepeat = ctrl->autoRepeat; if ((dev->kbdfeed) && (XkbDDXUsesSoftRepeat(dev))) ctrl->autoRepeat = 0; if (dev->key && dev->key->xkbInfo && dev->key->xkbInfo->kbdProc) (*dev->key->xkbInfo->kbdProc) (dev, ctrl); ctrl->autoRepeat = realRepeat; return; } int XkbDDXUsesSoftRepeat(DeviceIntPtr pXDev) { return 1; } void XkbDDXChangeControls(DeviceIntPtr dev, XkbControlsPtr old, XkbControlsPtr new) { unsigned changed, i; unsigned char *rep_old, *rep_new, *rep_fb; changed = new->enabled_ctrls ^ old->enabled_ctrls; for (rep_old = old->per_key_repeat, rep_new = new->per_key_repeat, rep_fb = dev->kbdfeed->ctrl.autoRepeats, i = 0; i < XkbPerKeyBitArraySize; i++) { if (rep_old[i] != rep_new[i]) { rep_fb[i] = rep_new[i]; changed &= XkbPerKeyRepeatMask; } } if (changed & XkbPerKeyRepeatMask) { if (dev->kbdfeed->CtrlProc) (*dev->kbdfeed->CtrlProc) (dev, &dev->kbdfeed->ctrl); } return; } xorg-server-1.17.1/xkb/XKBMAlloc.c0000664000175100017510000010330112456571574013473 00000000000000/************************************************************ Copyright (c) 1993 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 #elif defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "misc.h" #include "inputstr.h" #include #define XKBSRV_NEED_FILE_FUNCS #include /***====================================================================***/ Status XkbAllocClientMap(XkbDescPtr xkb, unsigned which, unsigned nTotalTypes) { register int i; XkbClientMapPtr map; if ((xkb == NULL) || ((nTotalTypes > 0) && (nTotalTypes < XkbNumRequiredTypes))) return BadValue; if ((which & XkbKeySymsMask) && ((!XkbIsLegalKeycode(xkb->min_key_code)) || (!XkbIsLegalKeycode(xkb->max_key_code)) || (xkb->max_key_code < xkb->min_key_code))) { DebugF("bad keycode (%d,%d) in XkbAllocClientMap\n", xkb->min_key_code, xkb->max_key_code); return BadValue; } if (xkb->map == NULL) { map = calloc(1, sizeof(XkbClientMapRec)); if (map == NULL) return BadAlloc; xkb->map = map; } else map = xkb->map; if ((which & XkbKeyTypesMask) && (nTotalTypes > 0)) { if (map->types == NULL) { map->types = calloc(nTotalTypes, sizeof(XkbKeyTypeRec)); if (map->types == NULL) return BadAlloc; map->num_types = 0; map->size_types = nTotalTypes; } else if (map->size_types < nTotalTypes) { XkbKeyTypeRec *prev_types = map->types; map->types = realloc(map->types, nTotalTypes * sizeof(XkbKeyTypeRec)); if (map->types == NULL) { free(prev_types); map->num_types = map->size_types = 0; return BadAlloc; } map->size_types = nTotalTypes; memset(&map->types[map->num_types], 0, ((map->size_types - map->num_types) * sizeof(XkbKeyTypeRec))); } } if (which & XkbKeySymsMask) { int nKeys = XkbNumKeys(xkb); if (map->syms == NULL) { map->size_syms = (nKeys * 15) / 10; map->syms = calloc(map->size_syms, sizeof(KeySym)); if (!map->syms) { map->size_syms = 0; return BadAlloc; } map->num_syms = 1; map->syms[0] = NoSymbol; } if (map->key_sym_map == NULL) { i = xkb->max_key_code + 1; map->key_sym_map = calloc(i, sizeof(XkbSymMapRec)); if (map->key_sym_map == NULL) return BadAlloc; } } if (which & XkbModifierMapMask) { if ((!XkbIsLegalKeycode(xkb->min_key_code)) || (!XkbIsLegalKeycode(xkb->max_key_code)) || (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->modmap == NULL) { i = xkb->max_key_code + 1; map->modmap = calloc(i, sizeof(unsigned char)); if (map->modmap == NULL) return BadAlloc; } } return Success; } Status XkbAllocServerMap(XkbDescPtr xkb, unsigned which, unsigned nNewActions) { register int i; XkbServerMapPtr map; if (xkb == NULL) return BadMatch; if (xkb->server == NULL) { map = calloc(1, sizeof(XkbServerMapRec)); if (map == NULL) return BadAlloc; for (i = 0; i < XkbNumVirtualMods; i++) { map->vmods[i] = XkbNoModifierMask; } xkb->server = map; } else map = xkb->server; if (which & XkbExplicitComponentsMask) { if ((!XkbIsLegalKeycode(xkb->min_key_code)) || (!XkbIsLegalKeycode(xkb->max_key_code)) || (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->explicit == NULL) { i = xkb->max_key_code + 1; map->explicit = calloc(i, sizeof(unsigned char)); if (map->explicit == NULL) return BadAlloc; } } if (which & XkbKeyActionsMask) { if ((!XkbIsLegalKeycode(xkb->min_key_code)) || (!XkbIsLegalKeycode(xkb->max_key_code)) || (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (nNewActions < 1) nNewActions = 1; if (map->acts == NULL) { map->acts = calloc((nNewActions + 1), sizeof(XkbAction)); if (map->acts == NULL) return BadAlloc; map->num_acts = 1; map->size_acts = nNewActions + 1; } else if ((map->size_acts - map->num_acts) < nNewActions) { unsigned need; XkbAction *prev_acts = map->acts; need = map->num_acts + nNewActions; map->acts = realloc(map->acts, need * sizeof(XkbAction)); if (map->acts == NULL) { free(prev_acts); map->num_acts = map->size_acts = 0; return BadAlloc; } map->size_acts = need; memset(&map->acts[map->num_acts], 0, ((map->size_acts - map->num_acts) * sizeof(XkbAction))); } if (map->key_acts == NULL) { i = xkb->max_key_code + 1; map->key_acts = calloc(i, sizeof(unsigned short)); if (map->key_acts == NULL) return BadAlloc; } } if (which & XkbKeyBehaviorsMask) { if ((!XkbIsLegalKeycode(xkb->min_key_code)) || (!XkbIsLegalKeycode(xkb->max_key_code)) || (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->behaviors == NULL) { i = xkb->max_key_code + 1; map->behaviors = calloc(i, sizeof(XkbBehavior)); if (map->behaviors == NULL) return BadAlloc; } } if (which & XkbVirtualModMapMask) { if ((!XkbIsLegalKeycode(xkb->min_key_code)) || (!XkbIsLegalKeycode(xkb->max_key_code)) || (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->vmodmap == NULL) { i = xkb->max_key_code + 1; map->vmodmap = calloc(i, sizeof(unsigned short)); if (map->vmodmap == NULL) return BadAlloc; } } return Success; } /***====================================================================***/ static Status XkbCopyKeyType(XkbKeyTypePtr from, XkbKeyTypePtr into) { if ((!from) || (!into)) return BadMatch; free(into->map); into->map = NULL; free(into->preserve); into->preserve = NULL; free(into->level_names); into->level_names = NULL; *into = *from; if ((from->map) && (into->map_count > 0)) { into->map = calloc(into->map_count, sizeof(XkbKTMapEntryRec)); if (!into->map) return BadAlloc; memcpy(into->map, from->map, into->map_count * sizeof(XkbKTMapEntryRec)); } if ((from->preserve) && (into->map_count > 0)) { into->preserve = calloc(into->map_count, sizeof(XkbModsRec)); if (!into->preserve) return BadAlloc; memcpy(into->preserve, from->preserve, into->map_count * sizeof(XkbModsRec)); } if ((from->level_names) && (into->num_levels > 0)) { into->level_names = calloc(into->num_levels, sizeof(Atom)); if (!into->level_names) return BadAlloc; memcpy(into->level_names, from->level_names, into->num_levels * sizeof(Atom)); } return Success; } Status XkbCopyKeyTypes(XkbKeyTypePtr from, XkbKeyTypePtr into, int num_types) { register int i, rtrn; if ((!from) || (!into) || (num_types < 0)) return BadMatch; for (i = 0; i < num_types; i++) { if ((rtrn = XkbCopyKeyType(from++, into++)) != Success) return rtrn; } return Success; } Status XkbResizeKeyType(XkbDescPtr xkb, int type_ndx, int map_count, Bool want_preserve, int new_num_lvls) { XkbKeyTypePtr type; KeyCode matchingKeys[XkbMaxKeyCount], nMatchingKeys; if ((type_ndx < 0) || (type_ndx >= xkb->map->num_types) || (map_count < 0) || (new_num_lvls < 1)) return BadValue; switch (type_ndx) { case XkbOneLevelIndex: if (new_num_lvls != 1) return BadMatch; break; case XkbTwoLevelIndex: case XkbAlphabeticIndex: case XkbKeypadIndex: if (new_num_lvls != 2) return BadMatch; break; } type = &xkb->map->types[type_ndx]; if (map_count == 0) { free(type->map); type->map = NULL; free(type->preserve); type->preserve = NULL; type->map_count = 0; } else { XkbKTMapEntryRec *prev_map = type->map; if ((map_count > type->map_count) || (type->map == NULL)) type->map = realloc(type->map, map_count * sizeof(XkbKTMapEntryRec)); if (!type->map) { free(prev_map); return BadAlloc; } if (want_preserve) { XkbModsRec *prev_preserve = type->preserve; if ((map_count > type->map_count) || (type->preserve == NULL)) { type->preserve = realloc(type->preserve, map_count * sizeof(XkbModsRec)); } if (!type->preserve) { free(prev_preserve); return BadAlloc; } } else { free(type->preserve); type->preserve = NULL; } type->map_count = map_count; } if ((new_num_lvls > type->num_levels) || (type->level_names == NULL)) { Atom *prev_level_names = type->level_names; type->level_names = realloc(type->level_names, new_num_lvls * sizeof(Atom)); if (!type->level_names) { free(prev_level_names); return BadAlloc; } } /* * Here's the theory: * If the width of the type changed, we might have to resize the symbol * maps for any keys that use the type for one or more groups. This is * expensive, so we'll try to cull out any keys that are obviously okay: * In any case: * - keys that have a group width <= the old width are okay (because * they could not possibly have been associated with the old type) * If the key type increased in size: * - keys that already have a group width >= to the new width are okay * + keys that have a group width >= the old width but < the new width * might have to be enlarged. * If the key type decreased in size: * - keys that have a group width > the old width don't have to be * resized (because they must have some other wider type associated * with some group). * + keys that have a group width == the old width might have to be * shrunk. * The possibilities marked with '+' require us to examine the key types * associated with each group for the key. */ memset(matchingKeys, 0, XkbMaxKeyCount * sizeof(KeyCode)); nMatchingKeys = 0; if (new_num_lvls > type->num_levels) { int nTotal; KeySym *newSyms; int width, match, nResize; register int i, g, nSyms; nResize = 0; for (nTotal = 1, i = xkb->min_key_code; i <= xkb->max_key_code; i++) { width = XkbKeyGroupsWidth(xkb, i); if (width < type->num_levels || width >= new_num_lvls) { nTotal += XkbKeyNumSyms(xkb,i); continue; } for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1; (g >= 0) && (!match); g--) { if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) { matchingKeys[nMatchingKeys++] = i; match = 1; } } if (!match) nTotal += XkbKeyNumSyms(xkb, i); else { nTotal += XkbKeyNumGroups(xkb, i) * new_num_lvls; nResize++; } } if (nResize > 0) { int nextMatch; xkb->map->size_syms = (nTotal * 15) / 10; newSyms = calloc(xkb->map->size_syms, sizeof(KeySym)); if (newSyms == NULL) return BadAlloc; nextMatch = 0; nSyms = 1; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { if (matchingKeys[nextMatch] == i) { KeySym *pOld; nextMatch++; width = XkbKeyGroupsWidth(xkb, i); pOld = XkbKeySymsPtr(xkb, i); for (g = XkbKeyNumGroups(xkb, i) - 1; g >= 0; g--) { memcpy(&newSyms[nSyms + (new_num_lvls * g)], &pOld[width * g], width * sizeof(KeySym)); } xkb->map->key_sym_map[i].offset = nSyms; nSyms += XkbKeyNumGroups(xkb, i) * new_num_lvls; } else { memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i), XkbKeyNumSyms(xkb, i) * sizeof(KeySym)); xkb->map->key_sym_map[i].offset = nSyms; nSyms += XkbKeyNumSyms(xkb, i); } } type->num_levels = new_num_lvls; free(xkb->map->syms); xkb->map->syms = newSyms; xkb->map->num_syms = nSyms; return Success; } } else if (new_num_lvls < type->num_levels) { int width, match; register int g, i; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { width = XkbKeyGroupsWidth(xkb, i); if (width < type->num_levels) continue; for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1; (g >= 0) && (!match); g--) { if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) { matchingKeys[nMatchingKeys++] = i; match = 1; } } } } if (nMatchingKeys > 0) { int key, firstClear; register int i, g; if (new_num_lvls > type->num_levels) firstClear = type->num_levels; else firstClear = new_num_lvls; for (i = 0; i < nMatchingKeys; i++) { KeySym *pSyms; int width, nClear; key = matchingKeys[i]; width = XkbKeyGroupsWidth(xkb, key); nClear = width - firstClear; pSyms = XkbKeySymsPtr(xkb, key); for (g = XkbKeyNumGroups(xkb, key) - 1; g >= 0; g--) { if (XkbKeyKeyTypeIndex(xkb, key, g) == type_ndx) { if (nClear > 0) memset(&pSyms[g * width + firstClear], 0, nClear * sizeof(KeySym)); } } } } type->num_levels = new_num_lvls; return Success; } KeySym * XkbResizeKeySyms(XkbDescPtr xkb, int key, int needed) { register int i, nSyms, nKeySyms; unsigned nOldSyms; KeySym *newSyms; if (needed == 0) { xkb->map->key_sym_map[key].offset = 0; return xkb->map->syms; } nOldSyms = XkbKeyNumSyms(xkb, key); if (nOldSyms >= (unsigned) needed) { return XkbKeySymsPtr(xkb, key); } if (xkb->map->size_syms - xkb->map->num_syms >= (unsigned) needed) { if (nOldSyms > 0) { memcpy(&xkb->map->syms[xkb->map->num_syms], XkbKeySymsPtr(xkb, key), nOldSyms * sizeof(KeySym)); } if ((needed - nOldSyms) > 0) { memset(&xkb->map-> syms[xkb->map->num_syms + XkbKeyNumSyms(xkb, key)], 0, (needed - nOldSyms) * sizeof(KeySym)); } xkb->map->key_sym_map[key].offset = xkb->map->num_syms; xkb->map->num_syms += needed; return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; } xkb->map->size_syms += (needed > 32 ? needed : 32); newSyms = calloc(xkb->map->size_syms, sizeof(KeySym)); if (newSyms == NULL) return NULL; newSyms[0] = NoSymbol; nSyms = 1; for (i = xkb->min_key_code; i <= (int) xkb->max_key_code; i++) { int nCopy; nCopy = nKeySyms = XkbKeyNumSyms(xkb, i); if ((nKeySyms == 0) && (i != key)) continue; if (i == key) nKeySyms = needed; if (nCopy != 0) memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i), nCopy * sizeof(KeySym)); if (nKeySyms > nCopy) memset(&newSyms[nSyms + nCopy], 0, (nKeySyms - nCopy) * sizeof(KeySym)); xkb->map->key_sym_map[i].offset = nSyms; nSyms += nKeySyms; } free(xkb->map->syms); xkb->map->syms = newSyms; xkb->map->num_syms = nSyms; return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; } static unsigned _ExtendRange(unsigned int old_flags, unsigned int flag, KeyCode newKC, KeyCode *old_min, unsigned char *old_num) { if ((old_flags & flag) == 0) { old_flags |= flag; *old_min = newKC; *old_num = 1; } else { int last = (*old_min) + (*old_num) - 1; if (newKC < *old_min) { *old_min = newKC; *old_num = (last - newKC) + 1; } else if (newKC > last) { *old_num = (newKC - (*old_min)) + 1; } } return old_flags; } Status XkbChangeKeycodeRange(XkbDescPtr xkb, int minKC, int maxKC, XkbChangesPtr changes) { int tmp; if ((!xkb) || (minKC < XkbMinLegalKeyCode) || (maxKC > XkbMaxLegalKeyCode)) return BadValue; if (minKC > maxKC) return BadMatch; if (minKC < xkb->min_key_code) { if (changes) changes->map.min_key_code = minKC; tmp = xkb->min_key_code - minKC; if (xkb->map) { if (xkb->map->key_sym_map) { memset((char *) &xkb->map->key_sym_map[minKC], 0, tmp * sizeof(XkbSymMapRec)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbKeySymsMask, minKC, &changes->map. first_key_sym, &changes->map. num_key_syms); } } if (xkb->map->modmap) { memset((char *) &xkb->map->modmap[minKC], 0, tmp); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbModifierMapMask, minKC, &changes->map. first_modmap_key, &changes->map. num_modmap_keys); } } } if (xkb->server) { if (xkb->server->behaviors) { memset((char *) &xkb->server->behaviors[minKC], 0, tmp * sizeof(XkbBehavior)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbKeyBehaviorsMask, minKC, &changes->map. first_key_behavior, &changes->map. num_key_behaviors); } } if (xkb->server->key_acts) { memset((char *) &xkb->server->key_acts[minKC], 0, tmp * sizeof(unsigned short)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbKeyActionsMask, minKC, &changes->map. first_key_act, &changes->map. num_key_acts); } } if (xkb->server->vmodmap) { memset((char *) &xkb->server->vmodmap[minKC], 0, tmp * sizeof(unsigned short)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbVirtualModMapMask, minKC, &changes->map. first_modmap_key, &changes->map. num_vmodmap_keys); } } } if ((xkb->names) && (xkb->names->keys)) { memset((char *) &xkb->names->keys[minKC], 0, tmp * sizeof(XkbKeyNameRec)); if (changes) { changes->names.changed = _ExtendRange(changes->names.changed, XkbKeyNamesMask, minKC, &changes->names.first_key, &changes->names.num_keys); } } xkb->min_key_code = minKC; } if (maxKC > xkb->max_key_code) { if (changes) changes->map.max_key_code = maxKC; tmp = maxKC - xkb->max_key_code; if (xkb->map) { if (xkb->map->key_sym_map) { XkbSymMapRec *prev_key_sym_map = xkb->map->key_sym_map; xkb->map->key_sym_map = realloc(xkb->map->key_sym_map, (maxKC + 1) * sizeof(XkbSymMapRec)); if (!xkb->map->key_sym_map) { free(prev_key_sym_map); return BadAlloc; } memset((char *) &xkb->map->key_sym_map[xkb->max_key_code], 0, tmp * sizeof(XkbSymMapRec)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbKeySymsMask, maxKC, &changes->map. first_key_sym, &changes->map. num_key_syms); } } if (xkb->map->modmap) { unsigned char *prev_modmap = xkb->map->modmap; xkb->map->modmap = realloc(xkb->map->modmap, (maxKC + 1) * sizeof(unsigned char)); if (!xkb->map->modmap) { free(prev_modmap); return BadAlloc; } memset((char *) &xkb->map->modmap[xkb->max_key_code], 0, tmp); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbModifierMapMask, maxKC, &changes->map. first_modmap_key, &changes->map. num_modmap_keys); } } } if (xkb->server) { if (xkb->server->behaviors) { XkbBehavior *prev_behaviors = xkb->server->behaviors; xkb->server->behaviors = realloc(xkb->server->behaviors, (maxKC + 1) * sizeof(XkbBehavior)); if (!xkb->server->behaviors) { free(prev_behaviors); return BadAlloc; } memset((char *) &xkb->server->behaviors[xkb->max_key_code], 0, tmp * sizeof(XkbBehavior)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbKeyBehaviorsMask, maxKC, &changes->map. first_key_behavior, &changes->map. num_key_behaviors); } } if (xkb->server->key_acts) { unsigned short *prev_key_acts = xkb->server->key_acts; xkb->server->key_acts = realloc(xkb->server->key_acts, (maxKC + 1) * sizeof(unsigned short)); if (!xkb->server->key_acts) { free(prev_key_acts); return BadAlloc; } memset((char *) &xkb->server->key_acts[xkb->max_key_code], 0, tmp * sizeof(unsigned short)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbKeyActionsMask, maxKC, &changes->map. first_key_act, &changes->map. num_key_acts); } } if (xkb->server->vmodmap) { unsigned short *prev_vmodmap = xkb->server->vmodmap; xkb->server->vmodmap = realloc(xkb->server->vmodmap, (maxKC + 1) * sizeof(unsigned short)); if (!xkb->server->vmodmap) { free(prev_vmodmap); return BadAlloc; } memset((char *) &xkb->server->vmodmap[xkb->max_key_code], 0, tmp * sizeof(unsigned short)); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbVirtualModMapMask, maxKC, &changes->map. first_modmap_key, &changes->map. num_vmodmap_keys); } } } if ((xkb->names) && (xkb->names->keys)) { XkbKeyNameRec *prev_keys = xkb->names->keys; xkb->names->keys = realloc(xkb->names->keys, (maxKC + 1) * sizeof(XkbKeyNameRec)); if (!xkb->names->keys) { free(prev_keys); return BadAlloc; } memset((char *) &xkb->names->keys[xkb->max_key_code], 0, tmp * sizeof(XkbKeyNameRec)); if (changes) { changes->names.changed = _ExtendRange(changes->names.changed, XkbKeyNamesMask, maxKC, &changes->names.first_key, &changes->names.num_keys); } } xkb->max_key_code = maxKC; } return Success; } XkbAction * XkbResizeKeyActions(XkbDescPtr xkb, int key, int needed) { register int i, nActs; XkbAction *newActs; if (needed == 0) { xkb->server->key_acts[key] = 0; return NULL; } if (XkbKeyHasActions(xkb, key) && (XkbKeyNumSyms(xkb, key) >= (unsigned) needed)) return XkbKeyActionsPtr(xkb, key); if (xkb->server->size_acts - xkb->server->num_acts >= (unsigned) needed) { xkb->server->key_acts[key] = xkb->server->num_acts; xkb->server->num_acts += needed; return &xkb->server->acts[xkb->server->key_acts[key]]; } xkb->server->size_acts = xkb->server->num_acts + needed + 8; newActs = calloc(xkb->server->size_acts, sizeof(XkbAction)); if (newActs == NULL) return NULL; newActs[0].type = XkbSA_NoAction; nActs = 1; for (i = xkb->min_key_code; i <= (int) xkb->max_key_code; i++) { int nKeyActs, nCopy; if ((xkb->server->key_acts[i] == 0) && (i != key)) continue; nCopy = nKeyActs = XkbKeyNumActions(xkb, i); if (i == key) { nKeyActs = needed; if (needed < nCopy) nCopy = needed; } if (nCopy > 0) memcpy(&newActs[nActs], XkbKeyActionsPtr(xkb, i), nCopy * sizeof(XkbAction)); if (nCopy < nKeyActs) memset(&newActs[nActs + nCopy], 0, (nKeyActs - nCopy) * sizeof(XkbAction)); xkb->server->key_acts[i] = nActs; nActs += nKeyActs; } free(xkb->server->acts); xkb->server->acts = newActs; xkb->server->num_acts = nActs; return &xkb->server->acts[xkb->server->key_acts[key]]; } void XkbFreeClientMap(XkbDescPtr xkb, unsigned what, Bool freeMap) { XkbClientMapPtr map; if ((xkb == NULL) || (xkb->map == NULL)) return; if (freeMap) what = XkbAllClientInfoMask; map = xkb->map; if (what & XkbKeyTypesMask) { if (map->types != NULL) { if (map->num_types > 0) { register int i; XkbKeyTypePtr type; for (i = 0, type = map->types; i < map->num_types; i++, type++) { free(type->map); type->map = NULL; free(type->preserve); type->preserve = NULL; type->map_count = 0; free(type->level_names); type->level_names = NULL; } } free(map->types); map->num_types = map->size_types = 0; map->types = NULL; } } if (what & XkbKeySymsMask) { free(map->key_sym_map); map->key_sym_map = NULL; if (map->syms != NULL) { free(map->syms); map->size_syms = map->num_syms = 0; map->syms = NULL; } } if ((what & XkbModifierMapMask) && (map->modmap != NULL)) { free(map->modmap); map->modmap = NULL; } if (freeMap) { free(xkb->map); xkb->map = NULL; } return; } void XkbFreeServerMap(XkbDescPtr xkb, unsigned what, Bool freeMap) { XkbServerMapPtr map; if ((xkb == NULL) || (xkb->server == NULL)) return; if (freeMap) what = XkbAllServerInfoMask; map = xkb->server; if ((what & XkbExplicitComponentsMask) && (map->explicit != NULL)) { free(map->explicit); map->explicit = NULL; } if (what & XkbKeyActionsMask) { free(map->key_acts); map->key_acts = NULL; if (map->acts != NULL) { free(map->acts); map->num_acts = map->size_acts = 0; map->acts = NULL; } } if ((what & XkbKeyBehaviorsMask) && (map->behaviors != NULL)) { free(map->behaviors); map->behaviors = NULL; } if ((what & XkbVirtualModMapMask) && (map->vmodmap != NULL)) { free(map->vmodmap); map->vmodmap = NULL; } if (freeMap) { free(xkb->server); xkb->server = NULL; } return; } xorg-server-1.17.1/xkb/Makefile.in0000664000175100017510000007401012466505436013657 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = xkb DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(dist_xkbcompiled_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libxkb_la_LIBADD = 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 \ xkbout.lo am__objects_4 = XKBMisc.lo XKBAlloc.lo XKBGAlloc.lo XKBMAlloc.lo am_libxkb_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) libxkb_la_OBJECTS = $(am_libxkb_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 = libxkbstubs_la_LIBADD = am_libxkbstubs_la_OBJECTS = ddxVT.lo ddxPrivate.lo ddxKillSrv.lo libxkbstubs_la_OBJECTS = $(am_libxkbstubs_la_OBJECTS) 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 = $(libxkb_la_SOURCES) $(libxkbstubs_la_SOURCES) DIST_SOURCES = $(libxkb_la_SOURCES) $(libxkbstubs_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(xkbcompileddir)" DATA = $(dist_xkbcompiled_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libxkb.la libxkbstubs.la AM_CFLAGS = $(DIX_CFLAGS) DDX_SRCS = \ ddxBeep.c \ ddxCtrls.c \ ddxLEDs.c \ ddxLoad.c DIX_SRCS = \ xkb.c \ xkbUtils.c \ xkbEvents.c \ xkbAccessX.c \ xkbSwap.c \ xkbLEDs.c \ xkbInit.c \ xkbActions.c \ xkbPrKeyEv.c # this should be replaced by a common library or something, ideally -d XKBFILE_SRCS = \ maprules.c \ xkmread.c \ xkbtext.c \ xkbfmisc.c \ xkbout.c X11_SRCS = \ XKBMisc.c \ XKBAlloc.c \ XKBGAlloc.c \ XKBMAlloc.c libxkb_la_SOURCES = $(DDX_SRCS) $(DIX_SRCS) $(XKBFILE_SRCS) $(X11_SRCS) libxkbstubs_la_SOURCES = ddxVT.c ddxPrivate.c ddxKillSrv.c EXTRA_DIST = xkbDflts.h xkbgeom.h xkb.h xkbcompileddir = $(XKB_COMPILED_DIR) dist_xkbcompiled_DATA = README.compiled all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 xkb/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign xkb/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libxkb.la: $(libxkb_la_OBJECTS) $(libxkb_la_DEPENDENCIES) $(EXTRA_libxkb_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libxkb_la_OBJECTS) $(libxkb_la_LIBADD) $(LIBS) libxkbstubs.la: $(libxkbstubs_la_OBJECTS) $(libxkbstubs_la_DEPENDENCIES) $(EXTRA_libxkbstubs_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libxkbstubs_la_OBJECTS) $(libxkbstubs_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKBAlloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKBGAlloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKBMAlloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XKBMisc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxBeep.Plo@am__quote@ @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)/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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maprules.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbAccessX.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbActions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbEvents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbInit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbLEDs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbPrKeyEv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbSwap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbfmisc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbtext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkmread.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 -o $@ $< .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 -o $@ `$(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-dist_xkbcompiledDATA: $(dist_xkbcompiled_DATA) @$(NORMAL_INSTALL) @list='$(dist_xkbcompiled_DATA)'; test -n "$(xkbcompileddir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xkbcompileddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xkbcompileddir)" || 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_DATA) $$files '$(DESTDIR)$(xkbcompileddir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xkbcompileddir)" || exit $$?; \ done uninstall-dist_xkbcompiledDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xkbcompiled_DATA)'; test -n "$(xkbcompileddir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xkbcompileddir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) $(DATA) installdirs: for dir in "$(DESTDIR)$(xkbcompileddir)"; 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-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-dist_xkbcompiledDATA 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-dist_xkbcompiledDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-dist_xkbcompiledDATA 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 tags-am uninstall uninstall-am \ uninstall-dist_xkbcompiledDATA # 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: xorg-server-1.17.1/xkb/README.compiled0000664000175100017510000000120412274325512014250 00000000000000 The X server uses this directory to store the compiled version of the current keymap and/or any scratch keymaps used by clients. The X server or some other tool might destroy or replace the files in this directory, so it is not a safe place to store compiled keymaps for long periods of time. The default keymap for any server is usually stored in: X-default.xkm where is the display number of the server in question, which makes it possible for several servers *on the same host* to share the same directory. Unless the X server is modified, sharing this directory between servers on different hosts could cause problems. xorg-server-1.17.1/xkb/xkbout.c0000664000175100017510000010311112456571574013272 00000000000000/************************************************************ Copyright (c) 1994 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 #include "misc.h" #include "inputstr.h" #include "dix.h" #include "xkbstr.h" #define XKBSRV_NEED_FILE_FUNCS 1 #include #include "xkbgeom.h" #include "xkbfile.h" #define VMOD_HIDE_VALUE 0 #define VMOD_SHOW_VALUE 1 #define VMOD_COMMENT_VALUE 2 static Bool WriteXKBVModDecl(FILE * file, XkbDescPtr xkb, int showValue) { register int i, nMods; Atom *vmodNames; if (xkb == NULL) return FALSE; if (xkb->names != NULL) vmodNames = xkb->names->vmods; else vmodNames = NULL; for (i = nMods = 0; i < XkbNumVirtualMods; i++) { if ((vmodNames != NULL) && (vmodNames[i] != None)) { if (nMods == 0) fprintf(file, " virtual_modifiers "); else fprintf(file, ","); fprintf(file, "%s", XkbAtomText(vmodNames[i], XkbXKBFile)); if ((showValue != VMOD_HIDE_VALUE) && (xkb->server) && (xkb->server->vmods[i] != XkbNoModifierMask)) { if (showValue == VMOD_COMMENT_VALUE) { fprintf(file, "/* = %s */", XkbModMaskText(xkb->server->vmods[i], XkbXKBFile)); } else { fprintf(file, "= %s", XkbModMaskText(xkb->server->vmods[i], XkbXKBFile)); } } nMods++; } } if (nMods > 0) fprintf(file, ";\n\n"); return TRUE; } /***====================================================================***/ static Bool WriteXKBAction(FILE * file, XkbDescPtr xkb, XkbAnyAction * action) { fprintf(file, "%s", XkbActionText(xkb, (XkbAction *) action, XkbXKBFile)); return TRUE; } /***====================================================================***/ Bool XkbWriteXKBKeycodes(FILE * file, XkbDescPtr xkb, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void *priv) { Atom kcName; register unsigned i; const char *alternate; if ((!xkb) || (!xkb->names) || (!xkb->names->keys)) { _XkbLibError(_XkbErrMissingNames, "XkbWriteXKBKeycodes", 0); return FALSE; } kcName = xkb->names->keycodes; if (kcName != None) fprintf(file, "xkb_keycodes \"%s\" {\n", XkbAtomText(kcName, XkbXKBFile)); else fprintf(file, "xkb_keycodes {\n"); fprintf(file, " minimum = %d;\n", xkb->min_key_code); fprintf(file, " maximum = %d;\n", xkb->max_key_code); for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { if (xkb->names->keys[i].name[0] != '\0') { if (XkbFindKeycodeByName(xkb, xkb->names->keys[i].name, TRUE) != i) alternate = "alternate "; else alternate = ""; fprintf(file, " %s%6s = %d;\n", alternate, XkbKeyNameText(xkb->names->keys[i].name, XkbXKBFile), i); } } if (xkb->indicators != NULL) { for (i = 0; i < XkbNumIndicators; i++) { const char *type; if (xkb->indicators->phys_indicators & (1 << i)) type = " "; else type = " virtual "; if (xkb->names->indicators[i] != None) { fprintf(file, "%sindicator %d = \"%s\";\n", type, i + 1, XkbAtomText(xkb->names->indicators[i], XkbXKBFile)); } } } if (xkb->names->key_aliases != NULL) { XkbKeyAliasPtr pAl; pAl = xkb->names->key_aliases; for (i = 0; i < xkb->names->num_key_aliases; i++, pAl++) { fprintf(file, " alias %6s = %6s;\n", XkbKeyNameText(pAl->alias, XkbXKBFile), XkbKeyNameText(pAl->real, XkbXKBFile)); } } if (addOn) (*addOn) (file, xkb, topLevel, showImplicit, XkmKeyNamesIndex, priv); fprintf(file, "};\n\n"); return TRUE; } Bool XkbWriteXKBKeyTypes(FILE * file, XkbDescPtr xkb, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void *priv) { register unsigned i, n; XkbKeyTypePtr type; XkbKTMapEntryPtr entry; if ((!xkb) || (!xkb->map) || (!xkb->map->types)) { _XkbLibError(_XkbErrMissingTypes, "XkbWriteXKBKeyTypes", 0); return FALSE; } if (xkb->map->num_types < XkbNumRequiredTypes) { _XkbLibError(_XkbErrMissingReqTypes, "XkbWriteXKBKeyTypes", 0); return 0; } if ((xkb->names == NULL) || (xkb->names->types == None)) fprintf(file, "xkb_types {\n\n"); else fprintf(file, "xkb_types \"%s\" {\n\n", XkbAtomText(xkb->names->types, XkbXKBFile)); WriteXKBVModDecl(file, xkb, (showImplicit ? VMOD_COMMENT_VALUE : VMOD_HIDE_VALUE)); type = xkb->map->types; for (i = 0; i < xkb->map->num_types; i++, type++) { fprintf(file, " type \"%s\" {\n", XkbAtomText(type->name, XkbXKBFile)); fprintf(file, " modifiers= %s;\n", XkbVModMaskText(xkb, type->mods.real_mods, type->mods.vmods, XkbXKBFile)); entry = type->map; for (n = 0; n < type->map_count; n++, entry++) { char *str; str = XkbVModMaskText(xkb, entry->mods.real_mods, entry->mods.vmods, XkbXKBFile); fprintf(file, " map[%s]= Level%d;\n", str, entry->level + 1); if ((type->preserve) && ((type->preserve[n].real_mods) || (type->preserve[n].vmods))) { fprintf(file, " preserve[%s]= ", str); fprintf(file, "%s;\n", XkbVModMaskText(xkb, type->preserve[n]. real_mods, type->preserve[n].vmods, XkbXKBFile)); } } if (type->level_names != NULL) { Atom *name = type->level_names; for (n = 0; n < type->num_levels; n++, name++) { if ((*name) == None) continue; fprintf(file, " level_name[Level%d]= \"%s\";\n", n + 1, XkbAtomText(*name, XkbXKBFile)); } } fprintf(file, " };\n"); } if (addOn) (*addOn) (file, xkb, topLevel, showImplicit, XkmTypesIndex, priv); fprintf(file, "};\n\n"); return TRUE; } static Bool WriteXKBIndicatorMap(FILE * file, XkbDescPtr xkb, Atom name, XkbIndicatorMapPtr led, XkbFileAddOnFunc addOn, void *priv) { fprintf(file, " indicator \"%s\" {\n", NameForAtom(name)); if (led->flags & XkbIM_NoExplicit) fprintf(file, " !allowExplicit;\n"); if (led->flags & XkbIM_LEDDrivesKB) fprintf(file, " indicatorDrivesKeyboard;\n"); if (led->which_groups != 0) { if (led->which_groups != XkbIM_UseEffective) { fprintf(file, " whichGroupState= %s;\n", XkbIMWhichStateMaskText(led->which_groups, XkbXKBFile)); } fprintf(file, " groups= 0x%02x;\n", led->groups); } if (led->which_mods != 0) { if (led->which_mods != XkbIM_UseEffective) { fprintf(file, " whichModState= %s;\n", XkbIMWhichStateMaskText(led->which_mods, XkbXKBFile)); } fprintf(file, " modifiers= %s;\n", XkbVModMaskText(xkb, led->mods.real_mods, led->mods.vmods, XkbXKBFile)); } if (led->ctrls != 0) { fprintf(file, " controls= %s;\n", XkbControlsMaskText(led->ctrls, XkbXKBFile)); } if (addOn) (*addOn) (file, xkb, FALSE, TRUE, XkmIndicatorsIndex, priv); fprintf(file, " };\n"); return TRUE; } Bool XkbWriteXKBCompatMap(FILE * file, XkbDescPtr xkb, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void *priv) { register unsigned i; XkbSymInterpretPtr interp; if ((!xkb) || (!xkb->compat) || (!xkb->compat->sym_interpret)) { _XkbLibError(_XkbErrMissingCompatMap, "XkbWriteXKBCompatMap", 0); return FALSE; } if ((xkb->names == NULL) || (xkb->names->compat == None)) fprintf(file, "xkb_compatibility {\n\n"); else fprintf(file, "xkb_compatibility \"%s\" {\n\n", XkbAtomText(xkb->names->compat, XkbXKBFile)); WriteXKBVModDecl(file, xkb, (showImplicit ? VMOD_COMMENT_VALUE : VMOD_HIDE_VALUE)); fprintf(file, " interpret.useModMapMods= AnyLevel;\n"); fprintf(file, " interpret.repeat= FALSE;\n"); fprintf(file, " interpret.locking= FALSE;\n"); interp = xkb->compat->sym_interpret; for (i = 0; i < xkb->compat->num_si; i++, interp++) { fprintf(file, " interpret %s+%s(%s) {\n", ((interp->sym == NoSymbol) ? "Any" : XkbKeysymText(interp->sym, XkbXKBFile)), XkbSIMatchText(interp->match, XkbXKBFile), XkbModMaskText(interp->mods, XkbXKBFile)); if (interp->virtual_mod != XkbNoModifier) { fprintf(file, " virtualModifier= %s;\n", XkbVModIndexText(xkb, interp->virtual_mod, XkbXKBFile)); } if (interp->match & XkbSI_LevelOneOnly) fprintf(file, " useModMapMods=level1;\n"); if (interp->flags & XkbSI_LockingKey) fprintf(file, " locking= TRUE;\n"); if (interp->flags & XkbSI_AutoRepeat) fprintf(file, " repeat= TRUE;\n"); fprintf(file, " action= "); WriteXKBAction(file, xkb, &interp->act); fprintf(file, ";\n"); fprintf(file, " };\n"); } for (i = 0; i < XkbNumKbdGroups; i++) { XkbModsPtr gc; gc = &xkb->compat->groups[i]; if ((gc->real_mods == 0) && (gc->vmods == 0)) continue; fprintf(file, " group %d = %s;\n", i + 1, XkbVModMaskText(xkb, gc-> real_mods, gc->vmods, XkbXKBFile)); } if (xkb->indicators) { for (i = 0; i < XkbNumIndicators; i++) { XkbIndicatorMapPtr map = &xkb->indicators->maps[i]; if ((map->flags != 0) || (map->which_groups != 0) || (map->groups != 0) || (map->which_mods != 0) || (map->mods.real_mods != 0) || (map->mods.vmods != 0) || (map->ctrls != 0)) { WriteXKBIndicatorMap(file, xkb, xkb->names->indicators[i], map, addOn, priv); } } } if (addOn) (*addOn) (file, xkb, topLevel, showImplicit, XkmCompatMapIndex, priv); fprintf(file, "};\n\n"); return TRUE; } Bool XkbWriteXKBSymbols(FILE * file, XkbDescPtr xkb, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void *priv) { register unsigned i, tmp; XkbClientMapPtr map; XkbServerMapPtr srv; Bool showActions; if (!xkb) { _XkbLibError(_XkbErrMissingSymbols, "XkbWriteXKBSymbols", 0); return FALSE; } map = xkb->map; if ((!map) || (!map->syms) || (!map->key_sym_map)) { _XkbLibError(_XkbErrMissingSymbols, "XkbWriteXKBSymbols", 0); return FALSE; } if ((!xkb->names) || (!xkb->names->keys)) { _XkbLibError(_XkbErrMissingNames, "XkbWriteXKBSymbols", 0); return FALSE; } if ((xkb->names == NULL) || (xkb->names->symbols == None)) fprintf(file, "xkb_symbols {\n\n"); else fprintf(file, "xkb_symbols \"%s\" {\n\n", XkbAtomText(xkb->names->symbols, XkbXKBFile)); for (tmp = i = 0; i < XkbNumKbdGroups; i++) { if (xkb->names->groups[i] != None) { fprintf(file, " name[group%d]=\"%s\";\n", i + 1, XkbAtomText(xkb->names->groups[i], XkbXKBFile)); tmp++; } } if (tmp > 0) fprintf(file, "\n"); srv = xkb->server; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { Bool simple; if ((int) XkbKeyNumSyms(xkb, i) < 1) continue; if (XkbFindKeycodeByName(xkb, xkb->names->keys[i].name, TRUE) != i) continue; simple = TRUE; fprintf(file, " key %6s {", XkbKeyNameText(xkb->names->keys[i].name, XkbXKBFile)); if (srv->explicit) { if (((srv->explicit[i] & XkbExplicitKeyTypesMask) != 0) || (showImplicit)) { int typeNdx, g; Bool multi; const char *comment = " "; if ((srv->explicit[i] & XkbExplicitKeyTypesMask) == 0) comment = "//"; multi = FALSE; typeNdx = XkbKeyKeyTypeIndex(xkb, i, 0); for (g = 1; (g < XkbKeyNumGroups(xkb, i)) && (!multi); g++) { if (XkbKeyKeyTypeIndex(xkb, i, g) != typeNdx) multi = TRUE; } if (multi) { for (g = 0; g < XkbKeyNumGroups(xkb, i); g++) { typeNdx = XkbKeyKeyTypeIndex(xkb, i, g); if (srv->explicit[i] & (1 << g)) { fprintf(file, "\n%s type[group%d]= \"%s\",", comment, g + 1, XkbAtomText(map->types[typeNdx].name, XkbXKBFile)); } else if (showImplicit) { fprintf(file, "\n// type[group%d]= \"%s\",", g + 1, XkbAtomText(map->types[typeNdx].name, XkbXKBFile)); } } } else { fprintf(file, "\n%s type= \"%s\",", comment, XkbAtomText(map->types[typeNdx].name, XkbXKBFile)); } simple = FALSE; } if (((srv->explicit[i] & XkbExplicitAutoRepeatMask) != 0) && (xkb->ctrls != NULL)) { if (xkb->ctrls->per_key_repeat[i / 8] & (1 << (i % 8))) fprintf(file, "\n repeat= Yes,"); else fprintf(file, "\n repeat= No,"); simple = FALSE; } if ((xkb->server != NULL) && (xkb->server->vmodmap != NULL) && (xkb->server->vmodmap[i] != 0)) { if ((srv->explicit[i] & XkbExplicitVModMapMask) != 0) { fprintf(file, "\n virtualMods= %s,", XkbVModMaskText(xkb, 0, xkb->server->vmodmap[i], XkbXKBFile)); } else if (showImplicit) { fprintf(file, "\n// virtualMods= %s,", XkbVModMaskText(xkb, 0, xkb->server->vmodmap[i], XkbXKBFile)); } } } switch (XkbOutOfRangeGroupAction(XkbKeyGroupInfo(xkb, i))) { case XkbClampIntoRange: fprintf(file, "\n groupsClamp,"); break; case XkbRedirectIntoRange: fprintf(file, "\n groupsRedirect= Group%d,", XkbOutOfRangeGroupNumber(XkbKeyGroupInfo(xkb, i)) + 1); break; } if (srv->behaviors != NULL) { unsigned type; type = srv->behaviors[i].type & XkbKB_OpMask; if (type != XkbKB_Default) { simple = FALSE; fprintf(file, "\n %s,", XkbBehaviorText(xkb, &srv->behaviors[i], XkbXKBFile)); } } if ((srv->explicit == NULL) || showImplicit || ((srv->explicit[i] & XkbExplicitInterpretMask) != 0)) showActions = XkbKeyHasActions(xkb, i); else showActions = FALSE; if (((unsigned) XkbKeyNumGroups(xkb, i) > 1) || showActions) simple = FALSE; if (simple) { KeySym *syms; unsigned s; syms = XkbKeySymsPtr(xkb, i); fprintf(file, " [ "); for (s = 0; s < XkbKeyGroupWidth(xkb, i, XkbGroup1Index); s++) { if (s != 0) fprintf(file, ", "); fprintf(file, "%15s", XkbKeysymText(*syms++, XkbXKBFile)); } fprintf(file, " ] };\n"); } else { unsigned g, s; KeySym *syms; XkbAction *acts; syms = XkbKeySymsPtr(xkb, i); acts = XkbKeyActionsPtr(xkb, i); for (g = 0; g < XkbKeyNumGroups(xkb, i); g++) { if (g != 0) fprintf(file, ","); fprintf(file, "\n symbols[Group%d]= [ ", g + 1); for (s = 0; s < XkbKeyGroupWidth(xkb, i, g); s++) { if (s != 0) fprintf(file, ", "); fprintf(file, "%15s", XkbKeysymText(syms[s], XkbXKBFile)); } fprintf(file, " ]"); syms += XkbKeyGroupsWidth(xkb, i); if (showActions) { fprintf(file, ",\n actions[Group%d]= [ ", g + 1); for (s = 0; s < XkbKeyGroupWidth(xkb, i, g); s++) { if (s != 0) fprintf(file, ", "); WriteXKBAction(file, xkb, (XkbAnyAction *) &acts[s]); } fprintf(file, " ]"); acts += XkbKeyGroupsWidth(xkb, i); } } fprintf(file, "\n };\n"); } } if (map && map->modmap) { for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { if (map->modmap[i] != 0) { register int n, bit; for (bit = 1, n = 0; n < XkbNumModifiers; n++, bit <<= 1) { if (map->modmap[i] & bit) { char buf[5]; memcpy(buf, xkb->names->keys[i].name, 4); buf[4] = '\0'; fprintf(file, " modifier_map %s { <%s> };\n", XkbModIndexText(n, XkbXKBFile), buf); } } } } } if (addOn) (*addOn) (file, xkb, topLevel, showImplicit, XkmSymbolsIndex, priv); fprintf(file, "};\n\n"); return TRUE; } static Bool WriteXKBOutline(FILE * file, XkbShapePtr shape, XkbOutlinePtr outline, int lastRadius, int first, int indent) { register int i; XkbPointPtr pt; char *iStr; fprintf(file, "%s", iStr = XkbIndentText(first)); if (first != indent) iStr = XkbIndentText(indent); if (outline->corner_radius != lastRadius) { fprintf(file, "corner= %s,", XkbGeomFPText(outline->corner_radius, XkbMessage)); if (shape != NULL) { fprintf(file, "\n%s", iStr); } } if (shape) { if (outline == shape->approx) fprintf(file, "approx= "); else if (outline == shape->primary) fprintf(file, "primary= "); } fprintf(file, "{"); for (pt = outline->points, i = 0; i < outline->num_points; i++, pt++) { if (i == 0) fprintf(file, " "); else if ((i % 4) == 0) fprintf(file, ",\n%s ", iStr); else fprintf(file, ", "); fprintf(file, "[ %3s, %3s ]", XkbGeomFPText(pt->x, XkbXKBFile), XkbGeomFPText(pt->y, XkbXKBFile)); } fprintf(file, " }"); return TRUE; } static Bool WriteXKBDoodad(FILE * file, unsigned indent, XkbGeometryPtr geom, XkbDoodadPtr doodad) { register char *i_str; XkbShapePtr shape; XkbColorPtr color; i_str = XkbIndentText(indent); fprintf(file, "%s%s \"%s\" {\n", i_str, XkbDoodadTypeText(doodad->any.type, XkbMessage), XkbAtomText(doodad->any.name, XkbMessage)); fprintf(file, "%s top= %s;\n", i_str, XkbGeomFPText(doodad->any.top, XkbXKBFile)); fprintf(file, "%s left= %s;\n", i_str, XkbGeomFPText(doodad->any.left, XkbXKBFile)); fprintf(file, "%s priority= %d;\n", i_str, doodad->any.priority); switch (doodad->any.type) { case XkbOutlineDoodad: case XkbSolidDoodad: if (doodad->shape.angle != 0) { fprintf(file, "%s angle= %s;\n", i_str, XkbGeomFPText(doodad->shape.angle, XkbXKBFile)); } if (doodad->shape.color_ndx != 0) { fprintf(file, "%s color= \"%s\";\n", i_str, XkbShapeDoodadColor(geom, &doodad->shape)->spec); } shape = XkbShapeDoodadShape(geom, &doodad->shape); fprintf(file, "%s shape= \"%s\";\n", i_str, XkbAtomText(shape->name, XkbXKBFile)); break; case XkbTextDoodad: if (doodad->text.angle != 0) { fprintf(file, "%s angle= %s;\n", i_str, XkbGeomFPText(doodad->text.angle, XkbXKBFile)); } if (doodad->text.width != 0) { fprintf(file, "%s width= %s;\n", i_str, XkbGeomFPText(doodad->text.width, XkbXKBFile)); } if (doodad->text.height != 0) { fprintf(file, "%s height= %s;\n", i_str, XkbGeomFPText(doodad->text.height, XkbXKBFile)); } if (doodad->text.color_ndx != 0) { color = XkbTextDoodadColor(geom, &doodad->text); fprintf(file, "%s color= \"%s\";\n", i_str, XkbStringText(color->spec, XkbXKBFile)); } fprintf(file, "%s XFont= \"%s\";\n", i_str, XkbStringText(doodad->text.font, XkbXKBFile)); fprintf(file, "%s text= \"%s\";\n", i_str, XkbStringText(doodad->text.text, XkbXKBFile)); break; case XkbIndicatorDoodad: shape = XkbIndicatorDoodadShape(geom, &doodad->indicator); color = XkbIndicatorDoodadOnColor(geom, &doodad->indicator); fprintf(file, "%s onColor= \"%s\";\n", i_str, XkbStringText(color->spec, XkbXKBFile)); color = XkbIndicatorDoodadOffColor(geom, &doodad->indicator); fprintf(file, "%s offColor= \"%s\";\n", i_str, XkbStringText(color->spec, XkbXKBFile)); fprintf(file, "%s shape= \"%s\";\n", i_str, XkbAtomText(shape->name, XkbXKBFile)); break; case XkbLogoDoodad: fprintf(file, "%s logoName= \"%s\";\n", i_str, XkbStringText(doodad->logo.logo_name, XkbXKBFile)); if (doodad->shape.angle != 0) { fprintf(file, "%s angle= %s;\n", i_str, XkbGeomFPText(doodad->logo.angle, XkbXKBFile)); } if (doodad->shape.color_ndx != 0) { fprintf(file, "%s color= \"%s\";\n", i_str, XkbLogoDoodadColor(geom, &doodad->logo)->spec); } shape = XkbLogoDoodadShape(geom, &doodad->logo); fprintf(file, "%s shape= \"%s\";\n", i_str, XkbAtomText(shape->name, XkbXKBFile)); break; } fprintf(file, "%s};\n", i_str); return TRUE; } /*ARGSUSED*/ static Bool WriteXKBOverlay(FILE * file, unsigned indent, XkbGeometryPtr geom, XkbOverlayPtr ol) { register char *i_str; int r, k, nOut; XkbOverlayRowPtr row; XkbOverlayKeyPtr key; i_str = XkbIndentText(indent); if (ol->name != None) { fprintf(file, "%soverlay \"%s\" {\n", i_str, XkbAtomText(ol->name, XkbMessage)); } else fprintf(file, "%soverlay {\n", i_str); for (nOut = r = 0, row = ol->rows; r < ol->num_rows; r++, row++) { for (k = 0, key = row->keys; k < row->num_keys; k++, key++) { char *over, *under; over = XkbKeyNameText(key->over.name, XkbXKBFile); under = XkbKeyNameText(key->under.name, XkbXKBFile); if (nOut == 0) fprintf(file, "%s %6s=%6s", i_str, under, over); else if ((nOut % 4) == 0) fprintf(file, ",\n%s %6s=%6s", i_str, under, over); else fprintf(file, ", %6s=%6s", under, over); nOut++; } } fprintf(file, "\n%s};\n", i_str); return TRUE; } static Bool WriteXKBSection(FILE * file, XkbSectionPtr s, XkbGeometryPtr geom) { register int i; XkbRowPtr row; int dfltKeyColor = 0; fprintf(file, " section \"%s\" {\n", XkbAtomText(s->name, XkbXKBFile)); if (s->rows && (s->rows->num_keys > 0)) { dfltKeyColor = s->rows->keys[0].color_ndx; fprintf(file, " key.color= \"%s\";\n", XkbStringText(geom->colors[dfltKeyColor].spec, XkbXKBFile)); } fprintf(file, " priority= %d;\n", s->priority); fprintf(file, " top= %s;\n", XkbGeomFPText(s->top, XkbXKBFile)); fprintf(file, " left= %s;\n", XkbGeomFPText(s->left, XkbXKBFile)); fprintf(file, " width= %s;\n", XkbGeomFPText(s->width, XkbXKBFile)); fprintf(file, " height= %s;\n", XkbGeomFPText(s->height, XkbXKBFile)); if (s->angle != 0) { fprintf(file, " angle= %s;\n", XkbGeomFPText(s->angle, XkbXKBFile)); } for (i = 0, row = s->rows; i < s->num_rows; i++, row++) { fprintf(file, " row {\n"); fprintf(file, " top= %s;\n", XkbGeomFPText(row->top, XkbXKBFile)); fprintf(file, " left= %s;\n", XkbGeomFPText(row->left, XkbXKBFile)); if (row->vertical) fprintf(file, " vertical;\n"); if (row->num_keys > 0) { register int k; register XkbKeyPtr key; int forceNL = 0; int nThisLine = 0; fprintf(file, " keys {\n"); for (k = 0, key = row->keys; k < row->num_keys; k++, key++) { XkbShapePtr shape; if (key->color_ndx != dfltKeyColor) forceNL = 1; if (k == 0) { fprintf(file, " "); nThisLine = 0; } else if (((nThisLine % 2) == 1) || (forceNL)) { fprintf(file, ",\n "); forceNL = nThisLine = 0; } else { fprintf(file, ", "); nThisLine++; } shape = XkbKeyShape(geom, key); fprintf(file, "{ %6s, \"%s\", %3s", XkbKeyNameText(key->name.name, XkbXKBFile), XkbAtomText(shape->name, XkbXKBFile), XkbGeomFPText(key->gap, XkbXKBFile)); if (key->color_ndx != dfltKeyColor) { fprintf(file, ", color=\"%s\"", XkbKeyColor(geom, key)->spec); forceNL = 1; } fprintf(file, " }"); } fprintf(file, "\n };\n"); } fprintf(file, " };\n"); } if (s->doodads != NULL) { XkbDoodadPtr doodad; for (i = 0, doodad = s->doodads; i < s->num_doodads; i++, doodad++) { WriteXKBDoodad(file, 8, geom, doodad); } } if (s->overlays != NULL) { XkbOverlayPtr ol; for (i = 0, ol = s->overlays; i < s->num_overlays; i++, ol++) { WriteXKBOverlay(file, 8, geom, ol); } } fprintf(file, " }; // End of \"%s\" section\n\n", XkbAtomText(s->name, XkbXKBFile)); return TRUE; } Bool XkbWriteXKBGeometry(FILE * file, XkbDescPtr xkb, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void *priv) { register unsigned i, n; XkbGeometryPtr geom; if ((!xkb) || (!xkb->geom)) { _XkbLibError(_XkbErrMissingGeometry, "XkbWriteXKBGeometry", 0); return FALSE; } geom = xkb->geom; if (geom->name == None) fprintf(file, "xkb_geometry {\n\n"); else fprintf(file, "xkb_geometry \"%s\" {\n\n", XkbAtomText(geom->name, XkbXKBFile)); fprintf(file, " width= %s;\n", XkbGeomFPText(geom->width_mm, XkbXKBFile)); fprintf(file, " height= %s;\n\n", XkbGeomFPText(geom->height_mm, XkbXKBFile)); if (geom->key_aliases != NULL) { XkbKeyAliasPtr pAl; pAl = geom->key_aliases; for (i = 0; i < geom->num_key_aliases; i++, pAl++) { fprintf(file, " alias %6s = %6s;\n", XkbKeyNameText(pAl->alias, XkbXKBFile), XkbKeyNameText(pAl->real, XkbXKBFile)); } fprintf(file, "\n"); } if (geom->base_color != NULL) fprintf(file, " baseColor= \"%s\";\n", XkbStringText(geom->base_color->spec, XkbXKBFile)); if (geom->label_color != NULL) fprintf(file, " labelColor= \"%s\";\n", XkbStringText(geom->label_color->spec, XkbXKBFile)); if (geom->label_font != NULL) fprintf(file, " xfont= \"%s\";\n", XkbStringText(geom->label_font, XkbXKBFile)); if ((geom->num_colors > 0) && (showImplicit)) { XkbColorPtr color; for (color = geom->colors, i = 0; i < geom->num_colors; i++, color++) { fprintf(file, "// color[%d]= \"%s\"\n", i, XkbStringText(color->spec, XkbXKBFile)); } fprintf(file, "\n"); } if (geom->num_properties > 0) { XkbPropertyPtr prop; for (prop = geom->properties, i = 0; i < geom->num_properties; i++, prop++) { fprintf(file, " %s= \"%s\";\n", prop->name, XkbStringText(prop->value, XkbXKBFile)); } fprintf(file, "\n"); } if (geom->num_shapes > 0) { XkbShapePtr shape; XkbOutlinePtr outline; int lastR; for (shape = geom->shapes, i = 0; i < geom->num_shapes; i++, shape++) { lastR = 0; fprintf(file, " shape \"%s\" {", XkbAtomText(shape->name, XkbXKBFile)); outline = shape->outlines; if (shape->num_outlines > 1) { for (n = 0; n < shape->num_outlines; n++, outline++) { if (n == 0) fprintf(file, "\n"); else fprintf(file, ",\n"); WriteXKBOutline(file, shape, outline, lastR, 8, 8); lastR = outline->corner_radius; } fprintf(file, "\n };\n"); } else { WriteXKBOutline(file, NULL, outline, lastR, 1, 8); fprintf(file, " };\n"); } } } if (geom->num_sections > 0) { XkbSectionPtr section; for (section = geom->sections, i = 0; i < geom->num_sections; i++, section++) { WriteXKBSection(file, section, geom); } } if (geom->num_doodads > 0) { XkbDoodadPtr doodad; for (i = 0, doodad = geom->doodads; i < geom->num_doodads; i++, doodad++) { WriteXKBDoodad(file, 4, geom, doodad); } } if (addOn) (*addOn) (file, xkb, topLevel, showImplicit, XkmGeometryIndex, priv); fprintf(file, "};\n\n"); return TRUE; } xorg-server-1.17.1/xkb/maprules.c0000664000175100017510000007146712456571574013630 00000000000000/************************************************************ Copyright (c) 1996 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 #define X_INCLUDE_STRING_H #define XOS_USE_NO_LOCKING #include #include #include #include #include #include #include #include "misc.h" #include "inputstr.h" #include "dix.h" #include "os.h" #include "xkbstr.h" #define XKBSRV_NEED_FILE_FUNCS #include /***====================================================================***/ #define DFLT_LINE_SIZE 128 typedef struct { int line_num; int sz_line; int num_line; char buf[DFLT_LINE_SIZE]; char *line; } InputLine; static void InitInputLine(InputLine * line) { line->line_num = 1; line->num_line = 0; line->sz_line = DFLT_LINE_SIZE; line->line = line->buf; return; } static void FreeInputLine(InputLine * line) { if (line->line != line->buf) free(line->line); line->line_num = 1; line->num_line = 0; line->sz_line = DFLT_LINE_SIZE; line->line = line->buf; return; } static int InputLineAddChar(InputLine * line, int ch) { if (line->num_line >= line->sz_line) { if (line->line == line->buf) { line->line = malloc(line->sz_line * 2); memcpy(line->line, line->buf, line->sz_line); } else { line->line = realloc((char *) line->line, line->sz_line * 2); } line->sz_line *= 2; } line->line[line->num_line++] = ch; return ch; } #define ADD_CHAR(l,c) ((l)->num_line<(l)->sz_line?\ (int)((l)->line[(l)->num_line++]= (c)):\ InputLineAddChar(l,c)) static Bool GetInputLine(FILE * file, InputLine * line, Bool checkbang) { int ch; Bool endOfFile, spacePending, slashPending, inComment; endOfFile = FALSE; while ((!endOfFile) && (line->num_line == 0)) { spacePending = slashPending = inComment = FALSE; while (((ch = getc(file)) != '\n') && (ch != EOF)) { if (ch == '\\') { if ((ch = getc(file)) == EOF) break; if (ch == '\n') { inComment = FALSE; ch = ' '; line->line_num++; } } if (inComment) continue; if (ch == '/') { if (slashPending) { inComment = TRUE; slashPending = FALSE; } else { slashPending = TRUE; } continue; } else if (slashPending) { if (spacePending) { ADD_CHAR(line, ' '); spacePending = FALSE; } ADD_CHAR(line, '/'); slashPending = FALSE; } if (isspace(ch)) { while (isspace(ch) && (ch != '\n') && (ch != EOF)) { ch = getc(file); } if (ch == EOF) break; if ((ch != '\n') && (line->num_line > 0)) spacePending = TRUE; ungetc(ch, file); } else { if (spacePending) { ADD_CHAR(line, ' '); spacePending = FALSE; } if (checkbang && ch == '!') { if (line->num_line != 0) { DebugF("The '!' legal only at start of line\n"); DebugF("Line containing '!' ignored\n"); line->num_line = 0; inComment = 0; break; } } ADD_CHAR(line, ch); } } if (ch == EOF) endOfFile = TRUE; /* else line->num_line++;*/ } if ((line->num_line == 0) && (endOfFile)) return FALSE; ADD_CHAR(line, '\0'); return TRUE; } /***====================================================================***/ #define MODEL 0 #define LAYOUT 1 #define VARIANT 2 #define OPTION 3 #define KEYCODES 4 #define SYMBOLS 5 #define TYPES 6 #define COMPAT 7 #define GEOMETRY 8 #define MAX_WORDS 9 #define PART_MASK 0x000F #define COMPONENT_MASK 0x03F0 static const char *cname[MAX_WORDS] = { "model", "layout", "variant", "option", "keycodes", "symbols", "types", "compat", "geometry" }; typedef struct _RemapSpec { int number; int num_remap; struct { int word; int index; } remap[MAX_WORDS]; } RemapSpec; typedef struct _FileSpec { char *name[MAX_WORDS]; struct _FileSpec *pending; } FileSpec; typedef struct { const char *model; const char *layout[XkbNumKbdGroups + 1]; const char *variant[XkbNumKbdGroups + 1]; const char *options; } XkbRF_MultiDefsRec, *XkbRF_MultiDefsPtr; #define NDX_BUFF_SIZE 4 /***====================================================================***/ static char * get_index(char *str, int *ndx) { char ndx_buf[NDX_BUFF_SIZE]; char *end; if (*str != '[') { *ndx = 0; return str; } str++; end = strchr(str, ']'); if (end == NULL) { *ndx = -1; return str - 1; } if ((end - str) >= NDX_BUFF_SIZE) { *ndx = -1; return end + 1; } strlcpy(ndx_buf, str, 1 + end - str); *ndx = atoi(ndx_buf); return end + 1; } static void SetUpRemap(InputLine * line, RemapSpec * remap) { char *tok, *str; unsigned present, l_ndx_present, v_ndx_present; register int i; int len, ndx; _Xstrtokparams strtok_buf; Bool found; l_ndx_present = v_ndx_present = present = 0; str = &line->line[1]; len = remap->number; memset((char *) remap, 0, sizeof(RemapSpec)); remap->number = len; while ((tok = _XStrtok(str, " ", strtok_buf)) != NULL) { found = FALSE; str = NULL; if (strcmp(tok, "=") == 0) continue; for (i = 0; i < MAX_WORDS; i++) { len = strlen(cname[i]); if (strncmp(cname[i], tok, len) == 0) { if (strlen(tok) > len) { char *end = get_index(tok + len, &ndx); if ((i != LAYOUT && i != VARIANT) || *end != '\0' || ndx == -1) break; if (ndx < 1 || ndx > XkbNumKbdGroups) { DebugF("Illegal %s index: %d\n", cname[i], ndx); DebugF("Index must be in range 1..%d\n", XkbNumKbdGroups); break; } } else { ndx = 0; } found = TRUE; if (present & (1 << i)) { if ((i == LAYOUT && l_ndx_present & (1 << ndx)) || (i == VARIANT && v_ndx_present & (1 << ndx))) { DebugF("Component \"%s\" listed twice\n", tok); DebugF("Second definition ignored\n"); break; } } present |= (1 << i); if (i == LAYOUT) l_ndx_present |= 1 << ndx; if (i == VARIANT) v_ndx_present |= 1 << ndx; remap->remap[remap->num_remap].word = i; remap->remap[remap->num_remap++].index = ndx; break; } } if (!found) { fprintf(stderr, "Unknown component \"%s\" ignored\n", tok); } } if ((present & PART_MASK) == 0) { unsigned mask = PART_MASK; ErrorF("Mapping needs at least one of "); for (i = 0; (i < MAX_WORDS); i++) { if ((1L << i) & mask) { mask &= ~(1L << i); if (mask) DebugF("\"%s,\" ", cname[i]); else DebugF("or \"%s\"\n", cname[i]); } } DebugF("Illegal mapping ignored\n"); remap->num_remap = 0; return; } if ((present & COMPONENT_MASK) == 0) { DebugF("Mapping needs at least one component\n"); DebugF("Illegal mapping ignored\n"); remap->num_remap = 0; return; } remap->number++; return; } static Bool MatchOneOf(const char *wanted, const char *vals_defined) { const char *str, *next; int want_len = strlen(wanted); for (str = vals_defined, next = NULL; str != NULL; str = next) { int len; next = strchr(str, ','); if (next) { len = next - str; next++; } else { len = strlen(str); } if ((len == want_len) && (strncmp(wanted, str, len) == 0)) return TRUE; } return FALSE; } /***====================================================================***/ static Bool CheckLine(InputLine * line, RemapSpec * remap, XkbRF_RulePtr rule, XkbRF_GroupPtr group) { char *str, *tok; register int nread, i; FileSpec tmp; _Xstrtokparams strtok_buf; Bool append = FALSE; if (line->line[0] == '!') { if (line->line[1] == '$' || (line->line[1] == ' ' && line->line[2] == '$')) { char *gname = strchr(line->line, '$'); char *words = strchr(gname, ' '); if (!words) return FALSE; *words++ = '\0'; for (; *words; words++) { if (*words != '=' && *words != ' ') break; } if (*words == '\0') return FALSE; group->name = Xstrdup(gname); group->words = Xstrdup(words); for (i = 1, words = group->words; *words; words++) { if (*words == ' ') { *words++ = '\0'; i++; } } group->number = i; return TRUE; } else { SetUpRemap(line, remap); return FALSE; } } if (remap->num_remap == 0) { DebugF("Must have a mapping before first line of data\n"); DebugF("Illegal line of data ignored\n"); return FALSE; } memset((char *) &tmp, 0, sizeof(FileSpec)); str = line->line; for (nread = 0; (tok = _XStrtok(str, " ", strtok_buf)) != NULL; nread++) { str = NULL; if (strcmp(tok, "=") == 0) { nread--; continue; } if (nread > remap->num_remap) { DebugF("Too many words on a line\n"); DebugF("Extra word \"%s\" ignored\n", tok); continue; } tmp.name[remap->remap[nread].word] = tok; if (*tok == '+' || *tok == '|') append = TRUE; } if (nread < remap->num_remap) { DebugF("Too few words on a line: %s\n", line->line); DebugF("line ignored\n"); return FALSE; } rule->flags = 0; rule->number = remap->number; if (tmp.name[OPTION]) rule->flags |= XkbRF_Option; else if (append) rule->flags |= XkbRF_Append; else rule->flags |= XkbRF_Normal; rule->model = Xstrdup(tmp.name[MODEL]); rule->layout = Xstrdup(tmp.name[LAYOUT]); rule->variant = Xstrdup(tmp.name[VARIANT]); rule->option = Xstrdup(tmp.name[OPTION]); rule->keycodes = Xstrdup(tmp.name[KEYCODES]); rule->symbols = Xstrdup(tmp.name[SYMBOLS]); rule->types = Xstrdup(tmp.name[TYPES]); rule->compat = Xstrdup(tmp.name[COMPAT]); rule->geometry = Xstrdup(tmp.name[GEOMETRY]); rule->layout_num = rule->variant_num = 0; for (i = 0; i < nread; i++) { if (remap->remap[i].index) { if (remap->remap[i].word == LAYOUT) rule->layout_num = remap->remap[i].index; if (remap->remap[i].word == VARIANT) rule->variant_num = remap->remap[i].index; } } return TRUE; } static char * _Concat(char *str1, const char *str2) { int len; if ((!str1) || (!str2)) return str1; len = strlen(str1) + strlen(str2) + 1; str1 = realloc(str1, len * sizeof(char)); if (str1) strcat(str1, str2); return str1; } static void squeeze_spaces(char *p1) { char *p2; for (p2 = p1; *p2; p2++) { *p1 = *p2; if (*p1 != ' ') p1++; } *p1 = '\0'; } static Bool MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) { char *options; memset((char *) mdefs, 0, sizeof(XkbRF_MultiDefsRec)); mdefs->model = defs->model; options = Xstrdup(defs->options); if (options) squeeze_spaces(options); mdefs->options = options; if (defs->layout) { if (!strchr(defs->layout, ',')) { mdefs->layout[0] = defs->layout; } else { char *p; char *layout; int i; layout = Xstrdup(defs->layout); if (layout == NULL) return FALSE; squeeze_spaces(layout); mdefs->layout[1] = layout; p = layout; for (i = 2; i <= XkbNumKbdGroups; i++) { if ((p = strchr(p, ','))) { *p++ = '\0'; mdefs->layout[i] = p; } else { break; } } if (p && (p = strchr(p, ','))) *p = '\0'; } } if (defs->variant) { if (!strchr(defs->variant, ',')) { mdefs->variant[0] = defs->variant; } else { char *p; char *variant; int i; variant = Xstrdup(defs->variant); if (variant == NULL) return FALSE; squeeze_spaces(variant); mdefs->variant[1] = variant; p = variant; for (i = 2; i <= XkbNumKbdGroups; i++) { if ((p = strchr(p, ','))) { *p++ = '\0'; mdefs->variant[i] = p; } else { break; } } if (p && (p = strchr(p, ','))) *p = '\0'; } } return TRUE; } static void FreeMultiDefs(XkbRF_MultiDefsPtr defs) { free((void *) defs->options); free((void *) defs->layout[1]); free((void *) defs->variant[1]); } static void Apply(const char *src, char **dst) { if (src) { if (*src == '+' || *src == '!') { *dst = _Concat(*dst, src); } else { if (*dst == NULL) *dst = Xstrdup(src); } } } static void XkbRF_ApplyRule(XkbRF_RulePtr rule, XkbComponentNamesPtr names) { rule->flags &= ~XkbRF_PendingMatch; /* clear the flag because it's applied */ Apply(rule->keycodes, &names->keycodes); Apply(rule->symbols, &names->symbols); Apply(rule->types, &names->types); Apply(rule->compat, &names->compat); Apply(rule->geometry, &names->geometry); } static Bool CheckGroup(XkbRF_RulesPtr rules, const char *group_name, const char *name) { int i; char *p; XkbRF_GroupPtr group; for (i = 0, group = rules->groups; i < rules->num_groups; i++, group++) { if (!strcmp(group->name, group_name)) { break; } } if (i == rules->num_groups) return FALSE; for (i = 0, p = group->words; i < group->number; i++, p += strlen(p) + 1) { if (!strcmp(p, name)) { return TRUE; } } return FALSE; } static int XkbRF_CheckApplyRule(XkbRF_RulePtr rule, XkbRF_MultiDefsPtr mdefs, XkbComponentNamesPtr names, XkbRF_RulesPtr rules) { Bool pending = FALSE; if (rule->model != NULL) { if (mdefs->model == NULL) return 0; if (strcmp(rule->model, "*") == 0) { pending = TRUE; } else { if (rule->model[0] == '$') { if (!CheckGroup(rules, rule->model, mdefs->model)) return 0; } else { if (strcmp(rule->model, mdefs->model) != 0) return 0; } } } if (rule->option != NULL) { if (mdefs->options == NULL) return 0; if ((!MatchOneOf(rule->option, mdefs->options))) return 0; } if (rule->layout != NULL) { if (mdefs->layout[rule->layout_num] == NULL || *mdefs->layout[rule->layout_num] == '\0') return 0; if (strcmp(rule->layout, "*") == 0) { pending = TRUE; } else { if (rule->layout[0] == '$') { if (!CheckGroup(rules, rule->layout, mdefs->layout[rule->layout_num])) return 0; } else { if (strcmp(rule->layout, mdefs->layout[rule->layout_num]) != 0) return 0; } } } if (rule->variant != NULL) { if (mdefs->variant[rule->variant_num] == NULL || *mdefs->variant[rule->variant_num] == '\0') return 0; if (strcmp(rule->variant, "*") == 0) { pending = TRUE; } else { if (rule->variant[0] == '$') { if (!CheckGroup(rules, rule->variant, mdefs->variant[rule->variant_num])) return 0; } else { if (strcmp(rule->variant, mdefs->variant[rule->variant_num]) != 0) return 0; } } } if (pending) { rule->flags |= XkbRF_PendingMatch; return rule->number; } /* exact match, apply it now */ XkbRF_ApplyRule(rule, names); return rule->number; } static void XkbRF_ClearPartialMatches(XkbRF_RulesPtr rules) { register int i; XkbRF_RulePtr rule; for (i = 0, rule = rules->rules; i < rules->num_rules; i++, rule++) { rule->flags &= ~XkbRF_PendingMatch; } } static void XkbRF_ApplyPartialMatches(XkbRF_RulesPtr rules, XkbComponentNamesPtr names) { int i; XkbRF_RulePtr rule; for (rule = rules->rules, i = 0; i < rules->num_rules; i++, rule++) { if ((rule->flags & XkbRF_PendingMatch) == 0) continue; XkbRF_ApplyRule(rule, names); } } static void XkbRF_CheckApplyRules(XkbRF_RulesPtr rules, XkbRF_MultiDefsPtr mdefs, XkbComponentNamesPtr names, int flags) { int i; XkbRF_RulePtr rule; int skip; for (rule = rules->rules, i = 0; i < rules->num_rules; rule++, i++) { if ((rule->flags & flags) != flags) continue; skip = XkbRF_CheckApplyRule(rule, mdefs, names, rules); if (skip && !(flags & XkbRF_Option)) { for (; (i < rules->num_rules) && (rule->number == skip); rule++, i++); rule--; i--; } } } /***====================================================================***/ static char * XkbRF_SubstituteVars(char *name, XkbRF_MultiDefsPtr mdefs) { char *str, *outstr, *orig, *var; int len, ndx; orig = name; str = index(name, '%'); if (str == NULL) return name; len = strlen(name); while (str != NULL) { char pfx = str[1]; int extra_len = 0; if ((pfx == '+') || (pfx == '|') || (pfx == '_') || (pfx == '-')) { extra_len = 1; str++; } else if (pfx == '(') { extra_len = 2; str++; } var = str + 1; str = get_index(var + 1, &ndx); if (ndx == -1) { str = index(str, '%'); continue; } if ((*var == 'l') && mdefs->layout[ndx] && *mdefs->layout[ndx]) len += strlen(mdefs->layout[ndx]) + extra_len; else if ((*var == 'm') && mdefs->model) len += strlen(mdefs->model) + extra_len; else if ((*var == 'v') && mdefs->variant[ndx] && *mdefs->variant[ndx]) len += strlen(mdefs->variant[ndx]) + extra_len; if ((pfx == '(') && (*str == ')')) { str++; } str = index(&str[0], '%'); } name = malloc(len + 1); str = orig; outstr = name; while (*str != '\0') { if (str[0] == '%') { char pfx, sfx; str++; pfx = str[0]; sfx = '\0'; if ((pfx == '+') || (pfx == '|') || (pfx == '_') || (pfx == '-')) { str++; } else if (pfx == '(') { sfx = ')'; str++; } else pfx = '\0'; var = str; str = get_index(var + 1, &ndx); if (ndx == -1) { continue; } if ((*var == 'l') && mdefs->layout[ndx] && *mdefs->layout[ndx]) { if (pfx) *outstr++ = pfx; strcpy(outstr, mdefs->layout[ndx]); outstr += strlen(mdefs->layout[ndx]); if (sfx) *outstr++ = sfx; } else if ((*var == 'm') && (mdefs->model)) { if (pfx) *outstr++ = pfx; strcpy(outstr, mdefs->model); outstr += strlen(mdefs->model); if (sfx) *outstr++ = sfx; } else if ((*var == 'v') && mdefs->variant[ndx] && *mdefs->variant[ndx]) { if (pfx) *outstr++ = pfx; strcpy(outstr, mdefs->variant[ndx]); outstr += strlen(mdefs->variant[ndx]); if (sfx) *outstr++ = sfx; } if ((pfx == '(') && (*str == ')')) str++; } else { *outstr++ = *str++; } } *outstr++ = '\0'; if (orig != name) free(orig); return name; } /***====================================================================***/ Bool XkbRF_GetComponents(XkbRF_RulesPtr rules, XkbRF_VarDefsPtr defs, XkbComponentNamesPtr names) { XkbRF_MultiDefsRec mdefs; MakeMultiDefs(&mdefs, defs); memset((char *) names, 0, sizeof(XkbComponentNamesRec)); XkbRF_ClearPartialMatches(rules); XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Normal); XkbRF_ApplyPartialMatches(rules, names); 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); if (names->symbols) names->symbols = XkbRF_SubstituteVars(names->symbols, &mdefs); if (names->types) names->types = XkbRF_SubstituteVars(names->types, &mdefs); if (names->compat) names->compat = XkbRF_SubstituteVars(names->compat, &mdefs); if (names->geometry) names->geometry = XkbRF_SubstituteVars(names->geometry, &mdefs); FreeMultiDefs(&mdefs); return (names->keycodes && names->symbols && names->types && names->compat && names->geometry); } static XkbRF_RulePtr XkbRF_AddRule(XkbRF_RulesPtr rules) { if (rules->sz_rules < 1) { rules->sz_rules = 16; rules->num_rules = 0; rules->rules = calloc(rules->sz_rules, sizeof(XkbRF_RuleRec)); } else if (rules->num_rules >= rules->sz_rules) { rules->sz_rules *= 2; rules->rules = realloc(rules->rules, rules->sz_rules * sizeof(XkbRF_RuleRec)); } if (!rules->rules) { rules->sz_rules = rules->num_rules = 0; DebugF("Allocation failure in XkbRF_AddRule\n"); return NULL; } memset((char *) &rules->rules[rules->num_rules], 0, sizeof(XkbRF_RuleRec)); return &rules->rules[rules->num_rules++]; } static XkbRF_GroupPtr XkbRF_AddGroup(XkbRF_RulesPtr rules) { if (rules->sz_groups < 1) { rules->sz_groups = 16; rules->num_groups = 0; rules->groups = calloc(rules->sz_groups, sizeof(XkbRF_GroupRec)); } else if (rules->num_groups >= rules->sz_groups) { rules->sz_groups *= 2; rules->groups = realloc(rules->groups, rules->sz_groups * sizeof(XkbRF_GroupRec)); } if (!rules->groups) { rules->sz_groups = rules->num_groups = 0; return NULL; } memset((char *) &rules->groups[rules->num_groups], 0, sizeof(XkbRF_GroupRec)); return &rules->groups[rules->num_groups++]; } Bool XkbRF_LoadRules(FILE * file, XkbRF_RulesPtr rules) { InputLine line; RemapSpec remap; XkbRF_RuleRec trule, *rule; XkbRF_GroupRec tgroup, *group; if (!(rules && file)) return FALSE; memset((char *) &remap, 0, sizeof(RemapSpec)); memset((char *) &tgroup, 0, sizeof(XkbRF_GroupRec)); InitInputLine(&line); while (GetInputLine(file, &line, TRUE)) { if (CheckLine(&line, &remap, &trule, &tgroup)) { if (tgroup.number) { if ((group = XkbRF_AddGroup(rules)) != NULL) { *group = tgroup; memset((char *) &tgroup, 0, sizeof(XkbRF_GroupRec)); } } else { if ((rule = XkbRF_AddRule(rules)) != NULL) { *rule = trule; memset((char *) &trule, 0, sizeof(XkbRF_RuleRec)); } } } line.num_line = 0; } FreeInputLine(&line); return TRUE; } Bool XkbRF_LoadRulesByName(char *base, char *locale, XkbRF_RulesPtr rules) { FILE *file; char buf[PATH_MAX]; Bool ok; if ((!base) || (!rules)) return FALSE; if (locale) { if (snprintf(buf, PATH_MAX, "%s-%s", base, locale) >= PATH_MAX) return FALSE; } else { if (strlen(base) + 1 > PATH_MAX) return FALSE; strcpy(buf, base); } file = fopen(buf, "r"); if ((!file) && (locale)) { /* fallback if locale was specified */ strcpy(buf, base); file = fopen(buf, "r"); } if (!file) return FALSE; ok = XkbRF_LoadRules(file, rules); fclose(file); return ok; } /***====================================================================***/ XkbRF_RulesPtr XkbRF_Create(void) { return calloc(1, sizeof(XkbRF_RulesRec)); } /***====================================================================***/ void XkbRF_Free(XkbRF_RulesPtr rules, Bool freeRules) { int i; XkbRF_RulePtr rule; XkbRF_GroupPtr group; if (!rules) return; if (rules->rules) { for (i = 0, rule = rules->rules; i < rules->num_rules; i++, rule++) { free((void *) rule->model); free((void *) rule->layout); free((void *) rule->variant); free((void *) rule->option); free((void *) rule->keycodes); free((void *) rule->symbols); free((void *) rule->types); free((void *) rule->compat); free((void *) rule->geometry); memset((char *) rule, 0, sizeof(XkbRF_RuleRec)); } free(rules->rules); rules->num_rules = rules->sz_rules = 0; rules->rules = NULL; } if (rules->groups) { for (i = 0, group = rules->groups; i < rules->num_groups; i++, group++) { free((void *) group->name); free(group->words); } free(rules->groups); rules->num_groups = 0; rules->groups = NULL; } if (freeRules) free(rules); return; } xorg-server-1.17.1/xkb/xkb.c0000664000175100017510000066665712466504300012557 00000000000000/************************************************************ Copyright (c) 1993 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 "misc.h" #include "inputstr.h" #define XKBSRV_NEED_FILE_FUNCS #include #include "extnsionst.h" #include "extinit.h" #include "xace.h" #include "xkb.h" #include "protocol-versions.h" #include #include int XkbEventBase; static int XkbErrorBase; int XkbReqCode; int XkbKeyboardErrorCode; CARD32 xkbDebugFlags = 0; static CARD32 xkbDebugCtrls = 0; static RESTYPE RT_XKBCLIENT; /***====================================================================***/ #define CHK_DEVICE(dev, id, client, access_mode, lf) {\ int why;\ int tmprc = lf(&(dev), id, client, access_mode, &why);\ if (tmprc != Success) {\ client->errorValue = _XkbErrCode2(why, id);\ return tmprc;\ }\ } #define CHK_KBD_DEVICE(dev, id, client, mode) \ CHK_DEVICE(dev, id, client, mode, _XkbLookupKeyboard) #define CHK_LED_DEVICE(dev, id, client, mode) \ CHK_DEVICE(dev, id, client, mode, _XkbLookupLedDevice) #define CHK_BELL_DEVICE(dev, id, client, mode) \ CHK_DEVICE(dev, id, client, mode, _XkbLookupBellDevice) #define CHK_ANY_DEVICE(dev, id, client, mode) \ CHK_DEVICE(dev, id, client, mode, _XkbLookupAnyDevice) #define CHK_ATOM_ONLY2(a,ev,er) {\ if (((a)==None)||(!ValidAtom((a)))) {\ (ev)= (XID)(a);\ return er;\ }\ } #define CHK_ATOM_ONLY(a) \ CHK_ATOM_ONLY2(a,client->errorValue,BadAtom) #define CHK_ATOM_OR_NONE3(a,ev,er,ret) {\ if (((a)!=None)&&(!ValidAtom((a)))) {\ (ev)= (XID)(a);\ (er)= BadAtom;\ return ret;\ }\ } #define CHK_ATOM_OR_NONE2(a,ev,er) {\ if (((a)!=None)&&(!ValidAtom((a)))) {\ (ev)= (XID)(a);\ return er;\ }\ } #define CHK_ATOM_OR_NONE(a) \ CHK_ATOM_OR_NONE2(a,client->errorValue,BadAtom) #define CHK_MASK_LEGAL3(err,mask,legal,ev,er,ret) {\ if ((mask)&(~(legal))) { \ (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\ (er)= BadValue;\ return ret;\ }\ } #define CHK_MASK_LEGAL2(err,mask,legal,ev,er) {\ if ((mask)&(~(legal))) { \ (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\ return er;\ }\ } #define CHK_MASK_LEGAL(err,mask,legal) \ CHK_MASK_LEGAL2(err,mask,legal,client->errorValue,BadValue) #define CHK_MASK_MATCH(err,affect,value) {\ if ((value)&(~(affect))) { \ client->errorValue= _XkbErrCode2((err),((value)&(~(affect))));\ return BadMatch;\ }\ } #define CHK_MASK_OVERLAP(err,m1,m2) {\ if ((m1)&(m2)) { \ client->errorValue= _XkbErrCode2((err),((m1)&(m2)));\ return BadMatch;\ }\ } #define CHK_KEY_RANGE2(err,first,num,x,ev,er) {\ if (((unsigned)(first)+(num)-1)>(x)->max_key_code) {\ (ev)=_XkbErrCode4(err,(first),(num),(x)->max_key_code);\ return er;\ }\ else if ( (first)<(x)->min_key_code ) {\ (ev)=_XkbErrCode3(err+1,(first),xkb->min_key_code);\ return er;\ }\ } #define CHK_KEY_RANGE(err,first,num,x) \ CHK_KEY_RANGE2(err,first,num,x,client->errorValue,BadValue) #define CHK_REQ_KEY_RANGE2(err,first,num,r,ev,er) {\ if (((unsigned)(first)+(num)-1)>(r)->maxKeyCode) {\ (ev)=_XkbErrCode4(err,(first),(num),(r)->maxKeyCode);\ return er;\ }\ else if ( (first)<(r)->minKeyCode ) {\ (ev)=_XkbErrCode3(err+1,(first),(r)->minKeyCode);\ return er;\ }\ } #define CHK_REQ_KEY_RANGE(err,first,num,r) \ CHK_REQ_KEY_RANGE2(err,first,num,r,client->errorValue,BadValue) /***====================================================================***/ int ProcXkbUseExtension(ClientPtr client) { REQUEST(xkbUseExtensionReq); xkbUseExtensionReply rep; int supported; REQUEST_SIZE_MATCH(xkbUseExtensionReq); if (stuff->wantedMajor != SERVER_XKB_MAJOR_VERSION) { /* pre-release version 0.65 is compatible with 1.00 */ supported = ((SERVER_XKB_MAJOR_VERSION == 1) && (stuff->wantedMajor == 0) && (stuff->wantedMinor == 65)); } else supported = 1; if ((supported) && (!(client->xkbClientFlags & _XkbClientInitialized))) { client->xkbClientFlags = _XkbClientInitialized; client->vMajor = stuff->wantedMajor; client->vMinor = stuff->wantedMinor; } else if (xkbDebugFlags & 0x1) { ErrorF ("[xkb] Rejecting client %d (0x%lx) (wants %d.%02d, have %d.%02d)\n", client->index, (long) client->clientAsMask, stuff->wantedMajor, stuff->wantedMinor, SERVER_XKB_MAJOR_VERSION, 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), &rep); return Success; } /***====================================================================***/ int ProcXkbSelectEvents(ClientPtr client) { unsigned legal; DeviceIntPtr dev; XkbInterestPtr masks; REQUEST(xkbSelectEventsReq); REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixUseAccess); if (((stuff->affectWhich & XkbMapNotifyMask) != 0) && (stuff->affectMap)) { client->mapNotifyMask &= ~stuff->affectMap; client->mapNotifyMask |= (stuff->affectMap & stuff->map); } if ((stuff->affectWhich & (~XkbMapNotifyMask)) == 0) return Success; masks = XkbFindClientResource((DevicePtr) dev, client); if (!masks) { XID id = FakeClientID(client->index); if (!AddResource(id, RT_XKBCLIENT, dev)) return BadAlloc; masks = XkbAddClientResource((DevicePtr) dev, client, id); } if (masks) { union { CARD8 *c8; CARD16 *c16; CARD32 *c32; } from, to; register unsigned bit, ndx, maskLeft, dataLeft, size; from.c8 = (CARD8 *) &stuff[1]; dataLeft = (stuff->length * 4) - SIZEOF(xkbSelectEventsReq); maskLeft = (stuff->affectWhich & (~XkbMapNotifyMask)); for (ndx = 0, bit = 1; (maskLeft != 0); ndx++, bit <<= 1) { if ((bit & maskLeft) == 0) continue; maskLeft &= ~bit; switch (ndx) { case XkbNewKeyboardNotify: to.c16 = &client->newKeyboardNotifyMask; legal = XkbAllNewKeyboardEventsMask; size = 2; break; case XkbStateNotify: to.c16 = &masks->stateNotifyMask; legal = XkbAllStateEventsMask; size = 2; break; case XkbControlsNotify: to.c32 = &masks->ctrlsNotifyMask; legal = XkbAllControlEventsMask; size = 4; break; case XkbIndicatorStateNotify: to.c32 = &masks->iStateNotifyMask; legal = XkbAllIndicatorEventsMask; size = 4; break; case XkbIndicatorMapNotify: to.c32 = &masks->iMapNotifyMask; legal = XkbAllIndicatorEventsMask; size = 4; break; case XkbNamesNotify: to.c16 = &masks->namesNotifyMask; legal = XkbAllNameEventsMask; size = 2; break; case XkbCompatMapNotify: to.c8 = &masks->compatNotifyMask; legal = XkbAllCompatMapEventsMask; size = 1; break; case XkbBellNotify: to.c8 = &masks->bellNotifyMask; legal = XkbAllBellEventsMask; size = 1; break; case XkbActionMessage: to.c8 = &masks->actionMessageMask; legal = XkbAllActionMessagesMask; size = 1; break; case XkbAccessXNotify: to.c16 = &masks->accessXNotifyMask; legal = XkbAllAccessXEventsMask; size = 2; break; case XkbExtensionDeviceNotify: to.c16 = &masks->extDevNotifyMask; legal = XkbAllExtensionDeviceEventsMask; size = 2; break; default: client->errorValue = _XkbErrCode2(33, bit); return BadValue; } if (stuff->clear & bit) { if (size == 2) to.c16[0] = 0; else if (size == 4) to.c32[0] = 0; else to.c8[0] = 0; } else if (stuff->selectAll & bit) { if (size == 2) to.c16[0] = ~0; else if (size == 4) to.c32[0] = ~0; else to.c8[0] = ~0; } else { if (dataLeft < (size * 2)) return BadLength; if (size == 2) { CHK_MASK_MATCH(ndx, from.c16[0], from.c16[1]); CHK_MASK_LEGAL(ndx, from.c16[0], legal); to.c16[0] &= ~from.c16[0]; to.c16[0] |= (from.c16[0] & from.c16[1]); } else if (size == 4) { CHK_MASK_MATCH(ndx, from.c32[0], from.c32[1]); CHK_MASK_LEGAL(ndx, from.c32[0], legal); to.c32[0] &= ~from.c32[0]; to.c32[0] |= (from.c32[0] & from.c32[1]); } else { CHK_MASK_MATCH(ndx, from.c8[0], from.c8[1]); CHK_MASK_LEGAL(ndx, from.c8[0], legal); to.c8[0] &= ~from.c8[0]; to.c8[0] |= (from.c8[0] & from.c8[1]); size = 2; } from.c8 += (size * 2); dataLeft -= (size * 2); } } if (dataLeft > 2) { ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n", dataLeft); return BadLength; } return Success; } return BadAlloc; } /***====================================================================***/ /** * Ring a bell on the given device for the given client. */ static int _XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin, int bellClass, int bellID, int pitch, int duration, int percent, int forceSound, int eventOnly, Atom name) { int base; void *ctrl; int oldPitch, oldDuration; int newPercent; if (bellClass == KbdFeedbackClass) { KbdFeedbackPtr k; if (bellID == XkbDfltXIId) k = dev->kbdfeed; else { for (k = dev->kbdfeed; k; k = k->next) { if (k->ctrl.id == bellID) break; } } if (!k) { client->errorValue = _XkbErrCode2(0x5, bellID); return BadValue; } base = k->ctrl.bell; ctrl = (void *) &(k->ctrl); oldPitch = k->ctrl.bell_pitch; oldDuration = k->ctrl.bell_duration; if (pitch != 0) { if (pitch == -1) k->ctrl.bell_pitch = defaultKeyboardControl.bell_pitch; else k->ctrl.bell_pitch = pitch; } if (duration != 0) { if (duration == -1) k->ctrl.bell_duration = defaultKeyboardControl.bell_duration; else k->ctrl.bell_duration = duration; } } else if (bellClass == BellFeedbackClass) { BellFeedbackPtr b; if (bellID == XkbDfltXIId) b = dev->bell; else { for (b = dev->bell; b; b = b->next) { if (b->ctrl.id == bellID) break; } } if (!b) { client->errorValue = _XkbErrCode2(0x6, bellID); return BadValue; } base = b->ctrl.percent; ctrl = (void *) &(b->ctrl); oldPitch = b->ctrl.pitch; oldDuration = b->ctrl.duration; if (pitch != 0) { if (pitch == -1) b->ctrl.pitch = defaultKeyboardControl.bell_pitch; else b->ctrl.pitch = pitch; } if (duration != 0) { if (duration == -1) b->ctrl.duration = defaultKeyboardControl.bell_duration; else b->ctrl.duration = duration; } } else { client->errorValue = _XkbErrCode2(0x7, bellClass); return BadValue; } newPercent = (base * percent) / 100; if (percent < 0) newPercent = base + newPercent; else newPercent = base - newPercent + percent; XkbHandleBell(forceSound, eventOnly, dev, newPercent, ctrl, bellClass, name, pWin, client); if ((pitch != 0) || (duration != 0)) { if (bellClass == KbdFeedbackClass) { KbdFeedbackPtr k; k = (KbdFeedbackPtr) ctrl; if (pitch != 0) k->ctrl.bell_pitch = oldPitch; if (duration != 0) k->ctrl.bell_duration = oldDuration; } else { BellFeedbackPtr b; b = (BellFeedbackPtr) ctrl; if (pitch != 0) b->ctrl.pitch = oldPitch; if (duration != 0) b->ctrl.duration = oldDuration; } } return Success; } int ProcXkbBell(ClientPtr client) { REQUEST(xkbBellReq); DeviceIntPtr dev; WindowPtr pWin; int rc; REQUEST_SIZE_MATCH(xkbBellReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_BELL_DEVICE(dev, stuff->deviceSpec, client, DixBellAccess); CHK_ATOM_OR_NONE(stuff->name); /* device-independent checks request for sane values */ if ((stuff->forceSound) && (stuff->eventOnly)) { client->errorValue = _XkbErrCode3(0x1, stuff->forceSound, stuff->eventOnly); return BadMatch; } if (stuff->percent < -100 || stuff->percent > 100) { client->errorValue = _XkbErrCode2(0x2, stuff->percent); return BadValue; } if (stuff->duration < -1) { client->errorValue = _XkbErrCode2(0x3, stuff->duration); return BadValue; } if (stuff->pitch < -1) { client->errorValue = _XkbErrCode2(0x4, stuff->pitch); return BadValue; } if (stuff->bellClass == XkbDfltXIClass) { if (dev->kbdfeed != NULL) stuff->bellClass = KbdFeedbackClass; else stuff->bellClass = BellFeedbackClass; } if (stuff->window != None) { rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->window; return rc; } } else pWin = NULL; /* Client wants to ring a bell on the core keyboard? Ring the bell on the core keyboard (which does nothing, but if that fails the client is screwed anyway), and then on all extension devices. Fail if the core keyboard fails but not the extension devices. this may cause some keyboards to ding and others to stay silent. Fix your client to use explicit keyboards to avoid this. dev is the device the client requested. */ rc = _XkbBell(client, dev, pWin, stuff->bellClass, stuff->bellID, stuff->pitch, stuff->duration, stuff->percent, stuff->forceSound, stuff->eventOnly, stuff->name); if ((rc == Success) && ((stuff->deviceSpec == XkbUseCoreKbd) || (stuff->deviceSpec == XkbUseCorePtr))) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixBellAccess); if (rc == Success) _XkbBell(client, other, pWin, stuff->bellClass, stuff->bellID, stuff->pitch, stuff->duration, stuff->percent, stuff->forceSound, stuff->eventOnly, stuff->name); } } rc = Success; /* reset to success, that's what we got for the VCK */ } return rc; } /***====================================================================***/ int ProcXkbGetState(ClientPtr client) { REQUEST(xkbGetStateReq); DeviceIntPtr dev; xkbGetStateReply rep; XkbStateRec *xkb; REQUEST_SIZE_MATCH(xkbGetStateReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = &dev->key->xkbInfo->state; 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), &rep); return Success; } /***====================================================================***/ int ProcXkbLatchLockState(ClientPtr client) { int status; DeviceIntPtr dev, tmpd; XkbStateRec oldState, *newState; CARD16 changed; xkbStateNotify sn; XkbEventCauseRec cause; REQUEST(xkbLatchLockStateReq); REQUEST_SIZE_MATCH(xkbLatchLockStateReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); CHK_MASK_MATCH(0x01, stuff->affectModLocks, stuff->modLocks); CHK_MASK_MATCH(0x01, stuff->affectModLatches, stuff->modLatches); status = Success; for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { if (!tmpd->key || !tmpd->key->xkbInfo) continue; oldState = tmpd->key->xkbInfo->state; newState = &tmpd->key->xkbInfo->state; if (stuff->affectModLocks) { newState->locked_mods &= ~stuff->affectModLocks; newState->locked_mods |= (stuff->affectModLocks & stuff->modLocks); } if (status == Success && stuff->lockGroup) newState->locked_group = stuff->groupLock; if (status == Success && stuff->affectModLatches) status = XkbLatchModifiers(tmpd, stuff->affectModLatches, stuff->modLatches); if (status == Success && stuff->latchGroup) status = XkbLatchGroup(tmpd, stuff->groupLatch); if (status != Success) return status; XkbComputeDerivedState(tmpd->key->xkbInfo); changed = XkbStateChangedFlags(&oldState, newState); if (changed) { sn.keycode = 0; sn.eventType = 0; sn.requestMajor = XkbReqCode; sn.requestMinor = X_kbLatchLockState; sn.changed = changed; XkbSendStateNotify(tmpd, &sn); changed = XkbIndicatorsToUpdate(tmpd, changed, FALSE); if (changed) { XkbSetCauseXkbReq(&cause, X_kbLatchLockState, client); XkbUpdateIndicators(tmpd, changed, TRUE, NULL, &cause); } } } } return Success; } /***====================================================================***/ int ProcXkbGetControls(ClientPtr client) { xkbGetControlsReply rep; XkbControlsPtr xkb; DeviceIntPtr dev; REQUEST(xkbGetControlsReq); REQUEST_SIZE_MATCH(xkbGetControlsReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = dev->key->xkbInfo->desc->ctrls; 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); swapl(&rep.length); swaps(&rep.internalVMods); swaps(&rep.ignoreLockVMods); swapl(&rep.enabledCtrls); swaps(&rep.repeatDelay); swaps(&rep.repeatInterval); swaps(&rep.slowKeysDelay); swaps(&rep.debounceDelay); swaps(&rep.mkDelay); swaps(&rep.mkInterval); swaps(&rep.mkTimeToMax); swaps(&rep.mkMaxSpeed); swaps(&rep.mkCurve); swaps(&rep.axTimeout); swapl(&rep.axtCtrlsMask); swapl(&rep.axtCtrlsValues); swaps(&rep.axtOptsMask); swaps(&rep.axtOptsValues); swaps(&rep.axOptions); } WriteToClient(client, SIZEOF(xkbGetControlsReply), &rep); return Success; } int ProcXkbSetControls(ClientPtr client) { DeviceIntPtr dev, tmpd; XkbSrvInfoPtr xkbi; XkbControlsPtr ctrl; XkbControlsRec new, old; xkbControlsNotify cn; XkbEventCauseRec cause; XkbSrvLedInfoPtr sli; REQUEST(xkbSetControlsReq); REQUEST_SIZE_MATCH(xkbSetControlsReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask); for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { if (!tmpd->key || !tmpd->key->xkbInfo) continue; if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { xkbi = tmpd->key->xkbInfo; ctrl = xkbi->desc->ctrls; new = *ctrl; XkbSetCauseXkbReq(&cause, X_kbSetControls, client); if (stuff->changeCtrls & XkbInternalModsMask) { CHK_MASK_MATCH(0x02, stuff->affectInternalMods, stuff->internalMods); CHK_MASK_MATCH(0x03, stuff->affectInternalVMods, stuff->internalVMods); new.internal.real_mods &= ~(stuff->affectInternalMods); new.internal.real_mods |= (stuff->affectInternalMods & stuff->internalMods); new.internal.vmods &= ~(stuff->affectInternalVMods); new.internal.vmods |= (stuff->affectInternalVMods & stuff->internalVMods); new.internal.mask = new.internal.real_mods | XkbMaskForVMask(xkbi->desc, new.internal.vmods); } if (stuff->changeCtrls & XkbIgnoreLockModsMask) { CHK_MASK_MATCH(0x4, stuff->affectIgnoreLockMods, stuff->ignoreLockMods); CHK_MASK_MATCH(0x5, stuff->affectIgnoreLockVMods, stuff->ignoreLockVMods); new.ignore_lock.real_mods &= ~(stuff->affectIgnoreLockMods); new.ignore_lock.real_mods |= (stuff->affectIgnoreLockMods & stuff->ignoreLockMods); new.ignore_lock.vmods &= ~(stuff->affectIgnoreLockVMods); new.ignore_lock.vmods |= (stuff->affectIgnoreLockVMods & stuff->ignoreLockVMods); new.ignore_lock.mask = new.ignore_lock.real_mods | XkbMaskForVMask(xkbi->desc, new.ignore_lock.vmods); } CHK_MASK_MATCH(0x06, stuff->affectEnabledCtrls, stuff->enabledCtrls); if (stuff->affectEnabledCtrls) { CHK_MASK_LEGAL(0x07, stuff->affectEnabledCtrls, XkbAllBooleanCtrlsMask); new.enabled_ctrls &= ~(stuff->affectEnabledCtrls); new.enabled_ctrls |= (stuff->affectEnabledCtrls & stuff->enabledCtrls); } if (stuff->changeCtrls & XkbRepeatKeysMask) { if (stuff->repeatDelay < 1 || stuff->repeatInterval < 1) { client->errorValue = _XkbErrCode3(0x08, stuff->repeatDelay, stuff->repeatInterval); return BadValue; } new.repeat_delay = stuff->repeatDelay; new.repeat_interval = stuff->repeatInterval; } if (stuff->changeCtrls & XkbSlowKeysMask) { if (stuff->slowKeysDelay < 1) { client->errorValue = _XkbErrCode2(0x09, stuff->slowKeysDelay); return BadValue; } new.slow_keys_delay = stuff->slowKeysDelay; } if (stuff->changeCtrls & XkbBounceKeysMask) { if (stuff->debounceDelay < 1) { client->errorValue = _XkbErrCode2(0x0A, stuff->debounceDelay); return BadValue; } new.debounce_delay = stuff->debounceDelay; } if (stuff->changeCtrls & XkbMouseKeysMask) { if (stuff->mkDfltBtn > XkbMaxMouseKeysBtn) { client->errorValue = _XkbErrCode2(0x0B, stuff->mkDfltBtn); return BadValue; } new.mk_dflt_btn = stuff->mkDfltBtn; } if (stuff->changeCtrls & XkbMouseKeysAccelMask) { if (stuff->mkDelay < 1 || stuff->mkInterval < 1 || stuff->mkTimeToMax < 1 || stuff->mkMaxSpeed < 1 || stuff->mkCurve < -1000) { client->errorValue = _XkbErrCode2(0x0C, 0); return BadValue; } new.mk_delay = stuff->mkDelay; new.mk_interval = stuff->mkInterval; new.mk_time_to_max = stuff->mkTimeToMax; new.mk_max_speed = stuff->mkMaxSpeed; new.mk_curve = stuff->mkCurve; AccessXComputeCurveFactor(xkbi, &new); } if (stuff->changeCtrls & XkbGroupsWrapMask) { unsigned act, num; act = XkbOutOfRangeGroupAction(stuff->groupsWrap); switch (act) { case XkbRedirectIntoRange: num = XkbOutOfRangeGroupNumber(stuff->groupsWrap); if (num >= new.num_groups) { client->errorValue = _XkbErrCode3(0x0D, new.num_groups, num); return BadValue; } case XkbWrapIntoRange: case XkbClampIntoRange: break; default: client->errorValue = _XkbErrCode2(0x0E, act); return BadValue; } new.groups_wrap = stuff->groupsWrap; } CHK_MASK_LEGAL(0x0F, stuff->axOptions, XkbAX_AllOptionsMask); if (stuff->changeCtrls & XkbAccessXKeysMask) { new.ax_options = stuff->axOptions & XkbAX_AllOptionsMask; } else { if (stuff->changeCtrls & XkbStickyKeysMask) { new.ax_options &= ~(XkbAX_SKOptionsMask); new.ax_options |= (stuff->axOptions & XkbAX_SKOptionsMask); } if (stuff->changeCtrls & XkbAccessXFeedbackMask) { new.ax_options &= ~(XkbAX_FBOptionsMask); new.ax_options |= (stuff->axOptions & XkbAX_FBOptionsMask); } } if (stuff->changeCtrls & XkbAccessXTimeoutMask) { if (stuff->axTimeout < 1) { client->errorValue = _XkbErrCode2(0x10, stuff->axTimeout); return BadValue; } CHK_MASK_MATCH(0x11, stuff->axtCtrlsMask, stuff->axtCtrlsValues); CHK_MASK_LEGAL(0x12, stuff->axtCtrlsMask, XkbAllBooleanCtrlsMask); CHK_MASK_MATCH(0x13, stuff->axtOptsMask, stuff->axtOptsValues); CHK_MASK_LEGAL(0x14, stuff->axtOptsMask, XkbAX_AllOptionsMask); new.ax_timeout = stuff->axTimeout; new.axt_ctrls_mask = stuff->axtCtrlsMask; new.axt_ctrls_values = (stuff->axtCtrlsValues & stuff->axtCtrlsMask); new.axt_opts_mask = stuff->axtOptsMask; new.axt_opts_values = (stuff->axtOptsValues & stuff->axtOptsMask); } if (stuff->changeCtrls & XkbPerKeyRepeatMask) { memcpy(new.per_key_repeat, stuff->perKeyRepeat, XkbPerKeyBitArraySize); if (xkbi->repeatKey && !BitIsOn(new.per_key_repeat, xkbi->repeatKey)) { AccessXCancelRepeatKey(xkbi, xkbi->repeatKey); } } old = *ctrl; *ctrl = new; XkbDDXChangeControls(tmpd, &old, ctrl); if (XkbComputeControlsNotify(tmpd, &old, ctrl, &cn, FALSE)) { cn.keycode = 0; cn.eventType = 0; cn.requestMajor = XkbReqCode; cn.requestMinor = X_kbSetControls; XkbSendControlsNotify(tmpd, &cn); } sli = XkbFindSrvLedInfo(tmpd, XkbDfltXIClass, XkbDfltXIId, 0); if (sli) XkbUpdateIndicators(tmpd, sli->usesControls, TRUE, NULL, &cause); /* If sticky keys were disabled, clear all locks and latches */ if ((old.enabled_ctrls & XkbStickyKeysMask) && !(ctrl->enabled_ctrls & XkbStickyKeysMask)) XkbClearAllLatchesAndLocks(tmpd, xkbi, TRUE, &cause); } } return Success; } /***====================================================================***/ static int XkbSizeKeyTypes(XkbDescPtr xkb, xkbGetMapReply * rep) { XkbKeyTypeRec *type; unsigned i, len; len = 0; if (((rep->present & XkbKeyTypesMask) == 0) || (rep->nTypes < 1) || (!xkb) || (!xkb->map) || (!xkb->map->types)) { rep->present &= ~XkbKeyTypesMask; rep->firstType = rep->nTypes = 0; return 0; } type = &xkb->map->types[rep->firstType]; for (i = 0; i < rep->nTypes; i++, type++) { len += SIZEOF(xkbKeyTypeWireDesc); if (type->map_count > 0) { len += (type->map_count * SIZEOF(xkbKTMapEntryWireDesc)); if (type->preserve) len += (type->map_count * SIZEOF(xkbModsWireDesc)); } } return len; } static char * XkbWriteKeyTypes(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, ClientPtr client) { XkbKeyTypePtr type; unsigned i; xkbKeyTypeWireDesc *wire; type = &xkb->map->types[rep->firstType]; for (i = 0; i < rep->nTypes; i++, type++) { register unsigned n; wire = (xkbKeyTypeWireDesc *) buf; wire->mask = type->mods.mask; wire->realMods = type->mods.real_mods; wire->virtualMods = type->mods.vmods; wire->numLevels = type->num_levels; wire->nMapEntries = type->map_count; wire->preserve = (type->preserve != NULL); if (client->swapped) { swaps(&wire->virtualMods); } buf = (char *) &wire[1]; if (wire->nMapEntries > 0) { xkbKTMapEntryWireDesc *ewire; XkbKTMapEntryPtr entry; ewire = (xkbKTMapEntryWireDesc *) buf; entry = type->map; 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(&ewire->virtualMods); } } buf = (char *) ewire; if (type->preserve != NULL) { xkbModsWireDesc *pwire; XkbModsPtr preserve; pwire = (xkbModsWireDesc *) buf; preserve = type->preserve; for (n = 0; n < type->map_count; n++, pwire++, preserve++) { pwire->mask = preserve->mask; pwire->realMods = preserve->real_mods; pwire->virtualMods = preserve->vmods; if (client->swapped) { swaps(&pwire->virtualMods); } } buf = (char *) pwire; } } } return buf; } static int XkbSizeKeySyms(XkbDescPtr xkb, xkbGetMapReply * rep) { XkbSymMapPtr symMap; unsigned i, len; unsigned nSyms, nSymsThisKey; if (((rep->present & XkbKeySymsMask) == 0) || (rep->nKeySyms < 1) || (!xkb) || (!xkb->map) || (!xkb->map->key_sym_map)) { rep->present &= ~XkbKeySymsMask; rep->firstKeySym = rep->nKeySyms = 0; rep->totalSyms = 0; return 0; } len = rep->nKeySyms * SIZEOF(xkbSymMapWireDesc); symMap = &xkb->map->key_sym_map[rep->firstKeySym]; for (i = nSyms = 0; i < rep->nKeySyms; i++, symMap++) { if (symMap->offset != 0) { nSymsThisKey = XkbNumGroups(symMap->group_info) * symMap->width; nSyms += nSymsThisKey; } } len += nSyms * 4; rep->totalSyms = nSyms; return len; } static int XkbSizeVirtualMods(XkbDescPtr xkb, xkbGetMapReply * rep) { register unsigned i, nMods, bit; if (((rep->present & XkbVirtualModsMask) == 0) || (rep->virtualMods == 0) || (!xkb) || (!xkb->server)) { rep->present &= ~XkbVirtualModsMask; rep->virtualMods = 0; return 0; } for (i = nMods = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (rep->virtualMods & bit) nMods++; } return XkbPaddedSize(nMods); } static char * XkbWriteKeySyms(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, ClientPtr client) { register KeySym *pSym; XkbSymMapPtr symMap; xkbSymMapWireDesc *outMap; register unsigned i; symMap = &xkb->map->key_sym_map[rep->firstKeySym]; for (i = 0; i < rep->nKeySyms; i++, symMap++) { outMap = (xkbSymMapWireDesc *) buf; outMap->ktIndex[0] = symMap->kt_index[0]; outMap->ktIndex[1] = symMap->kt_index[1]; outMap->ktIndex[2] = symMap->kt_index[2]; outMap->ktIndex[3] = symMap->kt_index[3]; outMap->groupInfo = symMap->group_info; outMap->width = symMap->width; outMap->nSyms = symMap->width * XkbNumGroups(symMap->group_info); buf = (char *) &outMap[1]; if (outMap->nSyms == 0) continue; pSym = &xkb->map->syms[symMap->offset]; memcpy((char *) buf, (char *) pSym, outMap->nSyms * 4); if (client->swapped) { register int nSyms = outMap->nSyms; swaps(&outMap->nSyms); while (nSyms-- > 0) { swapl((int *) buf); buf += 4; } } else buf += outMap->nSyms * 4; } return buf; } static int XkbSizeKeyActions(XkbDescPtr xkb, xkbGetMapReply * rep) { unsigned i, len, nActs; register KeyCode firstKey; if (((rep->present & XkbKeyActionsMask) == 0) || (rep->nKeyActs < 1) || (!xkb) || (!xkb->server) || (!xkb->server->key_acts)) { rep->present &= ~XkbKeyActionsMask; rep->firstKeyAct = rep->nKeyActs = 0; rep->totalActs = 0; return 0; } firstKey = rep->firstKeyAct; for (nActs = i = 0; i < rep->nKeyActs; i++) { if (xkb->server->key_acts[i + firstKey] != 0) nActs += XkbKeyNumActions(xkb, i + firstKey); } len = XkbPaddedSize(rep->nKeyActs) + (nActs * SIZEOF(xkbActionWireDesc)); rep->totalActs = nActs; return len; } static char * XkbWriteKeyActions(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, ClientPtr client) { unsigned i; CARD8 *numDesc; XkbAnyAction *actDesc; numDesc = (CARD8 *) buf; for (i = 0; i < rep->nKeyActs; i++) { if (xkb->server->key_acts[i + rep->firstKeyAct] == 0) numDesc[i] = 0; else numDesc[i] = XkbKeyNumActions(xkb, (i + rep->firstKeyAct)); } buf += XkbPaddedSize(rep->nKeyActs); actDesc = (XkbAnyAction *) buf; for (i = 0; i < rep->nKeyActs; i++) { if (xkb->server->key_acts[i + rep->firstKeyAct] != 0) { unsigned int num; num = XkbKeyNumActions(xkb, (i + rep->firstKeyAct)); memcpy((char *) actDesc, (char *) XkbKeyActionsPtr(xkb, (i + rep->firstKeyAct)), num * SIZEOF(xkbActionWireDesc)); actDesc += num; } } buf = (char *) actDesc; return buf; } static int XkbSizeKeyBehaviors(XkbDescPtr xkb, xkbGetMapReply * rep) { unsigned i, len, nBhvr; XkbBehavior *bhv; if (((rep->present & XkbKeyBehaviorsMask) == 0) || (rep->nKeyBehaviors < 1) || (!xkb) || (!xkb->server) || (!xkb->server->behaviors)) { rep->present &= ~XkbKeyBehaviorsMask; rep->firstKeyBehavior = rep->nKeyBehaviors = 0; rep->totalKeyBehaviors = 0; return 0; } bhv = &xkb->server->behaviors[rep->firstKeyBehavior]; for (nBhvr = i = 0; i < rep->nKeyBehaviors; i++, bhv++) { if (bhv->type != XkbKB_Default) nBhvr++; } len = nBhvr * SIZEOF(xkbBehaviorWireDesc); rep->totalKeyBehaviors = nBhvr; return len; } static char * XkbWriteKeyBehaviors(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, ClientPtr client) { unsigned i; xkbBehaviorWireDesc *wire; XkbBehavior *pBhvr; wire = (xkbBehaviorWireDesc *) buf; pBhvr = &xkb->server->behaviors[rep->firstKeyBehavior]; for (i = 0; i < rep->nKeyBehaviors; i++, pBhvr++) { if (pBhvr->type != XkbKB_Default) { wire->key = i + rep->firstKeyBehavior; wire->type = pBhvr->type; wire->data = pBhvr->data; wire++; } } buf = (char *) wire; return buf; } static int XkbSizeExplicit(XkbDescPtr xkb, xkbGetMapReply * rep) { unsigned i, len, nRtrn; if (((rep->present & XkbExplicitComponentsMask) == 0) || (rep->nKeyExplicit < 1) || (!xkb) || (!xkb->server) || (!xkb->server->explicit)) { rep->present &= ~XkbExplicitComponentsMask; rep->firstKeyExplicit = rep->nKeyExplicit = 0; rep->totalKeyExplicit = 0; return 0; } for (nRtrn = i = 0; i < rep->nKeyExplicit; i++) { if (xkb->server->explicit[i + rep->firstKeyExplicit] != 0) nRtrn++; } rep->totalKeyExplicit = nRtrn; len = XkbPaddedSize(nRtrn * 2); /* two bytes per non-zero explicit component */ return len; } static char * XkbWriteExplicit(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, ClientPtr client) { unsigned i; char *start; unsigned char *pExp; start = buf; pExp = &xkb->server->explicit[rep->firstKeyExplicit]; for (i = 0; i < rep->nKeyExplicit; i++, pExp++) { if (*pExp != 0) { *buf++ = i + rep->firstKeyExplicit; *buf++ = *pExp; } } i = XkbPaddedSize(buf - start) - (buf - start); /* pad to word boundary */ return buf + i; } static int XkbSizeModifierMap(XkbDescPtr xkb, xkbGetMapReply * rep) { unsigned i, len, nRtrn; if (((rep->present & XkbModifierMapMask) == 0) || (rep->nModMapKeys < 1) || (!xkb) || (!xkb->map) || (!xkb->map->modmap)) { rep->present &= ~XkbModifierMapMask; rep->firstModMapKey = rep->nModMapKeys = 0; rep->totalModMapKeys = 0; return 0; } for (nRtrn = i = 0; i < rep->nModMapKeys; i++) { if (xkb->map->modmap[i + rep->firstModMapKey] != 0) nRtrn++; } rep->totalModMapKeys = nRtrn; len = XkbPaddedSize(nRtrn * 2); /* two bytes per non-zero modmap component */ return len; } static char * XkbWriteModifierMap(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, ClientPtr client) { unsigned i; char *start; unsigned char *pMap; start = buf; pMap = &xkb->map->modmap[rep->firstModMapKey]; for (i = 0; i < rep->nModMapKeys; i++, pMap++) { if (*pMap != 0) { *buf++ = i + rep->firstModMapKey; *buf++ = *pMap; } } i = XkbPaddedSize(buf - start) - (buf - start); /* pad to word boundary */ return buf + i; } static int XkbSizeVirtualModMap(XkbDescPtr xkb, xkbGetMapReply * rep) { unsigned i, len, nRtrn; if (((rep->present & XkbVirtualModMapMask) == 0) || (rep->nVModMapKeys < 1) || (!xkb) || (!xkb->server) || (!xkb->server->vmodmap)) { rep->present &= ~XkbVirtualModMapMask; rep->firstVModMapKey = rep->nVModMapKeys = 0; rep->totalVModMapKeys = 0; return 0; } for (nRtrn = i = 0; i < rep->nVModMapKeys; i++) { if (xkb->server->vmodmap[i + rep->firstVModMapKey] != 0) nRtrn++; } rep->totalVModMapKeys = nRtrn; len = nRtrn * SIZEOF(xkbVModMapWireDesc); return len; } static char * XkbWriteVirtualModMap(XkbDescPtr xkb, xkbGetMapReply * rep, char *buf, ClientPtr client) { unsigned i; xkbVModMapWireDesc *wire; unsigned short *pMap; wire = (xkbVModMapWireDesc *) buf; pMap = &xkb->server->vmodmap[rep->firstVModMapKey]; for (i = 0; i < rep->nVModMapKeys; i++, pMap++) { if (*pMap != 0) { wire->key = i + rep->firstVModMapKey; wire->vmods = *pMap; wire++; } } return (char *) wire; } static Status XkbComputeGetMapReplySize(XkbDescPtr xkb, xkbGetMapReply * rep) { int len; rep->minKeyCode = xkb->min_key_code; rep->maxKeyCode = xkb->max_key_code; len = XkbSizeKeyTypes(xkb, rep); len += XkbSizeKeySyms(xkb, rep); len += XkbSizeKeyActions(xkb, rep); len += XkbSizeKeyBehaviors(xkb, rep); len += XkbSizeVirtualMods(xkb, rep); len += XkbSizeExplicit(xkb, rep); len += XkbSizeModifierMap(xkb, rep); len += XkbSizeVirtualModMap(xkb, rep); rep->length += (len / 4); return Success; } static int XkbSendMap(ClientPtr client, XkbDescPtr xkb, xkbGetMapReply * rep) { unsigned i, len; char *desc, *start; len = (rep->length * 4) - (SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)); start = desc = calloc(1, len); if (!start) return BadAlloc; if (rep->nTypes > 0) desc = XkbWriteKeyTypes(xkb, rep, desc, client); if (rep->nKeySyms > 0) desc = XkbWriteKeySyms(xkb, rep, desc, client); if (rep->nKeyActs > 0) desc = XkbWriteKeyActions(xkb, rep, desc, client); if (rep->totalKeyBehaviors > 0) desc = XkbWriteKeyBehaviors(xkb, rep, desc, client); if (rep->virtualMods) { register int sz, bit; for (i = sz = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (rep->virtualMods & bit) { desc[sz++] = xkb->server->vmods[i]; } } desc += XkbPaddedSize(sz); } if (rep->totalKeyExplicit > 0) desc = XkbWriteExplicit(xkb, rep, desc, client); if (rep->totalModMapKeys > 0) desc = XkbWriteModifierMap(xkb, rep, desc, client); if (rep->totalVModMapKeys > 0) desc = XkbWriteVirtualModMap(xkb, rep, desc, client); if ((desc - start) != (len)) { ErrorF ("[xkb] BOGUS LENGTH in write keyboard desc, expected %d, got %ld\n", len, (unsigned long) (desc - start)); } if (client->swapped) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->present); swaps(&rep->totalSyms); swaps(&rep->totalActs); } WriteToClient(client, (i = SIZEOF(xkbGetMapReply)), rep); WriteToClient(client, len, start); free((char *) start); return Success; } int ProcXkbGetMap(ClientPtr client) { DeviceIntPtr dev; xkbGetMapReply rep; XkbDescRec *xkb; int n, status; REQUEST(xkbGetMapReq); REQUEST_SIZE_MATCH(xkbGetMapReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); CHK_MASK_OVERLAP(0x01, stuff->full, stuff->partial); CHK_MASK_LEGAL(0x02, stuff->full, XkbAllMapComponentsMask); CHK_MASK_LEGAL(0x03, stuff->partial, XkbAllMapComponentsMask); xkb = dev->key->xkbInfo->desc; 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; } else if (stuff->partial & XkbKeyTypesMask) { if (((unsigned) stuff->firstType + stuff->nTypes) > xkb->map->num_types) { client->errorValue = _XkbErrCode4(0x04, xkb->map->num_types, stuff->firstType, stuff->nTypes); return BadValue; } rep.firstType = stuff->firstType; rep.nTypes = stuff->nTypes; } else rep.nTypes = 0; rep.totalTypes = xkb->map->num_types; n = XkbNumKeys(xkb); if (stuff->full & XkbKeySymsMask) { rep.firstKeySym = xkb->min_key_code; rep.nKeySyms = n; } else if (stuff->partial & XkbKeySymsMask) { CHK_KEY_RANGE(0x05, stuff->firstKeySym, stuff->nKeySyms, xkb); rep.firstKeySym = stuff->firstKeySym; rep.nKeySyms = stuff->nKeySyms; } else rep.nKeySyms = 0; rep.totalSyms = 0; if (stuff->full & XkbKeyActionsMask) { rep.firstKeyAct = xkb->min_key_code; rep.nKeyActs = n; } else if (stuff->partial & XkbKeyActionsMask) { CHK_KEY_RANGE(0x07, stuff->firstKeyAct, stuff->nKeyActs, xkb); rep.firstKeyAct = stuff->firstKeyAct; rep.nKeyActs = stuff->nKeyActs; } else rep.nKeyActs = 0; rep.totalActs = 0; if (stuff->full & XkbKeyBehaviorsMask) { rep.firstKeyBehavior = xkb->min_key_code; rep.nKeyBehaviors = n; } else if (stuff->partial & XkbKeyBehaviorsMask) { CHK_KEY_RANGE(0x09, stuff->firstKeyBehavior, stuff->nKeyBehaviors, xkb); rep.firstKeyBehavior = stuff->firstKeyBehavior; rep.nKeyBehaviors = stuff->nKeyBehaviors; } else rep.nKeyBehaviors = 0; rep.totalKeyBehaviors = 0; if (stuff->full & XkbVirtualModsMask) rep.virtualMods = ~0; else if (stuff->partial & XkbVirtualModsMask) rep.virtualMods = stuff->virtualMods; if (stuff->full & XkbExplicitComponentsMask) { rep.firstKeyExplicit = xkb->min_key_code; rep.nKeyExplicit = n; } else if (stuff->partial & XkbExplicitComponentsMask) { CHK_KEY_RANGE(0x0B, stuff->firstKeyExplicit, stuff->nKeyExplicit, xkb); rep.firstKeyExplicit = stuff->firstKeyExplicit; rep.nKeyExplicit = stuff->nKeyExplicit; } else rep.nKeyExplicit = 0; rep.totalKeyExplicit = 0; if (stuff->full & XkbModifierMapMask) { rep.firstModMapKey = xkb->min_key_code; rep.nModMapKeys = n; } else if (stuff->partial & XkbModifierMapMask) { CHK_KEY_RANGE(0x0D, stuff->firstModMapKey, stuff->nModMapKeys, xkb); rep.firstModMapKey = stuff->firstModMapKey; rep.nModMapKeys = stuff->nModMapKeys; } else rep.nModMapKeys = 0; rep.totalModMapKeys = 0; if (stuff->full & XkbVirtualModMapMask) { rep.firstVModMapKey = xkb->min_key_code; rep.nVModMapKeys = n; } else if (stuff->partial & XkbVirtualModMapMask) { CHK_KEY_RANGE(0x0F, stuff->firstVModMapKey, stuff->nVModMapKeys, xkb); rep.firstVModMapKey = stuff->firstVModMapKey; rep.nVModMapKeys = stuff->nVModMapKeys; } else rep.nVModMapKeys = 0; rep.totalVModMapKeys = 0; if ((status = XkbComputeGetMapReplySize(xkb, &rep)) != Success) return status; return XkbSendMap(client, xkb, &rep); } /***====================================================================***/ static int CheckKeyTypes(ClientPtr client, XkbDescPtr xkb, xkbSetMapReq * req, xkbKeyTypeWireDesc ** wireRtrn, int *nMapsRtrn, CARD8 *mapWidthRtrn) { unsigned nMaps; register unsigned i, n; register CARD8 *map; register xkbKeyTypeWireDesc *wire = *wireRtrn; if (req->firstType > ((unsigned) xkb->map->num_types)) { *nMapsRtrn = _XkbErrCode3(0x01, req->firstType, xkb->map->num_types); return 0; } if (req->flags & XkbSetMapResizeTypes) { nMaps = req->firstType + req->nTypes; if (nMaps < XkbNumRequiredTypes) { /* canonical types must be there */ *nMapsRtrn = _XkbErrCode4(0x02, req->firstType, req->nTypes, 4); return 0; } } else if (req->present & XkbKeyTypesMask) { nMaps = xkb->map->num_types; if ((req->firstType + req->nTypes) > nMaps) { *nMapsRtrn = req->firstType + req->nTypes; return 0; } } else { *nMapsRtrn = xkb->map->num_types; for (i = 0; i < xkb->map->num_types; i++) { mapWidthRtrn[i] = xkb->map->types[i].num_levels; } return 1; } for (i = 0; i < req->firstType; i++) { mapWidthRtrn[i] = xkb->map->types[i].num_levels; } for (i = 0; i < req->nTypes; i++) { unsigned width; if (client->swapped) { swaps(&wire->virtualMods); } n = i + req->firstType; width = wire->numLevels; if (width < 1) { *nMapsRtrn = _XkbErrCode3(0x04, n, width); return 0; } else if ((n == XkbOneLevelIndex) && (width != 1)) { /* must be width 1 */ *nMapsRtrn = _XkbErrCode3(0x05, n, width); return 0; } else if ((width != 2) && ((n == XkbTwoLevelIndex) || (n == XkbKeypadIndex) || (n == XkbAlphabeticIndex))) { /* TWO_LEVEL, ALPHABETIC and KEYPAD must be width 2 */ *nMapsRtrn = _XkbErrCode3(0x05, n, width); return 0; } if (wire->nMapEntries > 0) { xkbKTSetMapEntryWireDesc *mapWire; xkbModsWireDesc *preWire; mapWire = (xkbKTSetMapEntryWireDesc *) &wire[1]; preWire = (xkbModsWireDesc *) &mapWire[wire->nMapEntries]; for (n = 0; n < wire->nMapEntries; n++) { if (client->swapped) { swaps(&mapWire[n].virtualMods); } if (mapWire[n].realMods & (~wire->realMods)) { *nMapsRtrn = _XkbErrCode4(0x06, n, mapWire[n].realMods, wire->realMods); return 0; } if (mapWire[n].virtualMods & (~wire->virtualMods)) { *nMapsRtrn = _XkbErrCode3(0x07, n, mapWire[n].virtualMods); return 0; } if (mapWire[n].level >= wire->numLevels) { *nMapsRtrn = _XkbErrCode4(0x08, n, wire->numLevels, mapWire[n].level); return 0; } if (wire->preserve) { if (client->swapped) { swaps(&preWire[n].virtualMods); } if (preWire[n].realMods & (~mapWire[n].realMods)) { *nMapsRtrn = _XkbErrCode4(0x09, n, preWire[n].realMods, mapWire[n].realMods); return 0; } if (preWire[n].virtualMods & (~mapWire[n].virtualMods)) { *nMapsRtrn = _XkbErrCode3(0x0a, n, preWire[n].virtualMods); return 0; } } } if (wire->preserve) map = (CARD8 *) &preWire[wire->nMapEntries]; else map = (CARD8 *) &mapWire[wire->nMapEntries]; } else map = (CARD8 *) &wire[1]; mapWidthRtrn[i + req->firstType] = wire->numLevels; wire = (xkbKeyTypeWireDesc *) map; } for (i = req->firstType + req->nTypes; i < nMaps; i++) { mapWidthRtrn[i] = xkb->map->types[i].num_levels; } *nMapsRtrn = nMaps; *wireRtrn = wire; return 1; } static int CheckKeySyms(ClientPtr client, XkbDescPtr xkb, xkbSetMapReq * req, int nTypes, CARD8 *mapWidths, CARD16 *symsPerKey, xkbSymMapWireDesc ** wireRtrn, int *errorRtrn) { register unsigned i; XkbSymMapPtr map; xkbSymMapWireDesc *wire = *wireRtrn; if (!(XkbKeySymsMask & req->present)) return 1; CHK_REQ_KEY_RANGE2(0x11, req->firstKeySym, req->nKeySyms, req, (*errorRtrn), 0); for (i = 0; i < req->nKeySyms; i++) { KeySym *pSyms; register unsigned nG; if (client->swapped) { swaps(&wire->nSyms); } nG = XkbNumGroups(wire->groupInfo); if (nG > XkbNumKbdGroups) { *errorRtrn = _XkbErrCode3(0x14, i + req->firstKeySym, nG); return 0; } if (nG > 0) { register int g, w; for (g = w = 0; g < nG; g++) { if (wire->ktIndex[g] >= (unsigned) nTypes) { *errorRtrn = _XkbErrCode4(0x15, i + req->firstKeySym, g, wire->ktIndex[g]); return 0; } if (mapWidths[wire->ktIndex[g]] > w) w = mapWidths[wire->ktIndex[g]]; } if (wire->width != w) { *errorRtrn = _XkbErrCode3(0x16, i + req->firstKeySym, wire->width); return 0; } w *= nG; symsPerKey[i + req->firstKeySym] = w; if (w != wire->nSyms) { *errorRtrn = _XkbErrCode4(0x16, i + req->firstKeySym, wire->nSyms, w); return 0; } } else if (wire->nSyms != 0) { *errorRtrn = _XkbErrCode3(0x17, i + req->firstKeySym, wire->nSyms); return 0; } pSyms = (KeySym *) &wire[1]; wire = (xkbSymMapWireDesc *) &pSyms[wire->nSyms]; } map = &xkb->map->key_sym_map[i]; for (; i <= (unsigned) xkb->max_key_code; i++, map++) { register int g, nG, w; nG = XkbKeyNumGroups(xkb, i); for (w = g = 0; g < nG; g++) { if (map->kt_index[g] >= (unsigned) nTypes) { *errorRtrn = _XkbErrCode4(0x18, i, g, map->kt_index[g]); return 0; } if (mapWidths[map->kt_index[g]] > w) w = mapWidths[map->kt_index[g]]; } symsPerKey[i] = w * nG; } *wireRtrn = wire; return 1; } static int CheckKeyActions(XkbDescPtr xkb, xkbSetMapReq * req, int nTypes, CARD8 *mapWidths, CARD16 *symsPerKey, CARD8 **wireRtrn, int *nActsRtrn) { int nActs; CARD8 *wire = *wireRtrn; register unsigned i; if (!(XkbKeyActionsMask & req->present)) return 1; CHK_REQ_KEY_RANGE2(0x21, req->firstKeyAct, req->nKeyActs, req, (*nActsRtrn), 0); for (nActs = i = 0; i < req->nKeyActs; i++) { if (wire[0] != 0) { if (wire[0] == symsPerKey[i + req->firstKeyAct]) nActs += wire[0]; else { *nActsRtrn = _XkbErrCode3(0x23, i + req->firstKeyAct, wire[0]); return 0; } } wire++; } if (req->nKeyActs % 4) wire += 4 - (req->nKeyActs % 4); *wireRtrn = (CARD8 *) (((XkbAnyAction *) wire) + nActs); *nActsRtrn = nActs; return 1; } static int CheckKeyBehaviors(XkbDescPtr xkb, xkbSetMapReq * req, xkbBehaviorWireDesc ** wireRtrn, int *errorRtrn) { register xkbBehaviorWireDesc *wire = *wireRtrn; register XkbServerMapPtr server = xkb->server; register unsigned i; unsigned first, last; if (((req->present & XkbKeyBehaviorsMask) == 0) || (req->nKeyBehaviors < 1)) { req->present &= ~XkbKeyBehaviorsMask; req->nKeyBehaviors = 0; return 1; } first = req->firstKeyBehavior; last = req->firstKeyBehavior + req->nKeyBehaviors - 1; if (first < req->minKeyCode) { *errorRtrn = _XkbErrCode3(0x31, first, req->minKeyCode); return 0; } if (last > req->maxKeyCode) { *errorRtrn = _XkbErrCode3(0x32, last, req->maxKeyCode); return 0; } for (i = 0; i < req->totalKeyBehaviors; i++, wire++) { if ((wire->key < first) || (wire->key > last)) { *errorRtrn = _XkbErrCode4(0x33, first, last, wire->key); return 0; } if ((wire->type & XkbKB_Permanent) && ((server->behaviors[wire->key].type != wire->type) || (server->behaviors[wire->key].data != wire->data))) { *errorRtrn = _XkbErrCode3(0x33, wire->key, wire->type); return 0; } if ((wire->type == XkbKB_RadioGroup) && ((wire->data & (~XkbKB_RGAllowNone)) > XkbMaxRadioGroups)) { *errorRtrn = _XkbErrCode4(0x34, wire->key, wire->data, XkbMaxRadioGroups); return 0; } if ((wire->type == XkbKB_Overlay1) || (wire->type == XkbKB_Overlay2)) { CHK_KEY_RANGE2(0x35, wire->key, 1, xkb, *errorRtrn, 0); } } *wireRtrn = wire; return 1; } static int CheckVirtualMods(XkbDescRec * xkb, xkbSetMapReq * req, CARD8 **wireRtrn, int *errorRtrn) { register CARD8 *wire = *wireRtrn; register unsigned i, nMods, bit; if (((req->present & XkbVirtualModsMask) == 0) || (req->virtualMods == 0)) return 1; for (i = nMods = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (req->virtualMods & bit) nMods++; } *wireRtrn = (wire + XkbPaddedSize(nMods)); return 1; } static int CheckKeyExplicit(XkbDescPtr xkb, xkbSetMapReq * req, CARD8 **wireRtrn, int *errorRtrn) { register CARD8 *wire = *wireRtrn; CARD8 *start; register unsigned i; int first, last; if (((req->present & XkbExplicitComponentsMask) == 0) || (req->nKeyExplicit < 1)) { req->present &= ~XkbExplicitComponentsMask; req->nKeyExplicit = 0; return 1; } first = req->firstKeyExplicit; last = first + req->nKeyExplicit - 1; if (first < req->minKeyCode) { *errorRtrn = _XkbErrCode3(0x51, first, req->minKeyCode); return 0; } if (last > req->maxKeyCode) { *errorRtrn = _XkbErrCode3(0x52, last, req->maxKeyCode); return 0; } start = wire; for (i = 0; i < req->totalKeyExplicit; i++, wire += 2) { if ((wire[0] < first) || (wire[0] > last)) { *errorRtrn = _XkbErrCode4(0x53, first, last, wire[0]); return 0; } if (wire[1] & (~XkbAllExplicitMask)) { *errorRtrn = _XkbErrCode3(0x52, ~XkbAllExplicitMask, wire[1]); return 0; } } wire += XkbPaddedSize(wire - start) - (wire - start); *wireRtrn = wire; return 1; } static int CheckModifierMap(XkbDescPtr xkb, xkbSetMapReq * req, CARD8 **wireRtrn, int *errRtrn) { register CARD8 *wire = *wireRtrn; CARD8 *start; register unsigned i; int first, last; if (((req->present & XkbModifierMapMask) == 0) || (req->nModMapKeys < 1)) { req->present &= ~XkbModifierMapMask; req->nModMapKeys = 0; return 1; } first = req->firstModMapKey; last = first + req->nModMapKeys - 1; if (first < req->minKeyCode) { *errRtrn = _XkbErrCode3(0x61, first, req->minKeyCode); return 0; } if (last > req->maxKeyCode) { *errRtrn = _XkbErrCode3(0x62, last, req->maxKeyCode); return 0; } start = wire; for (i = 0; i < req->totalModMapKeys; i++, wire += 2) { if ((wire[0] < first) || (wire[0] > last)) { *errRtrn = _XkbErrCode4(0x63, first, last, wire[0]); return 0; } } wire += XkbPaddedSize(wire - start) - (wire - start); *wireRtrn = wire; return 1; } static int CheckVirtualModMap(XkbDescPtr xkb, xkbSetMapReq * req, xkbVModMapWireDesc ** wireRtrn, int *errRtrn) { register xkbVModMapWireDesc *wire = *wireRtrn; register unsigned i; int first, last; if (((req->present & XkbVirtualModMapMask) == 0) || (req->nVModMapKeys < 1)) { req->present &= ~XkbVirtualModMapMask; req->nVModMapKeys = 0; return 1; } first = req->firstVModMapKey; last = first + req->nVModMapKeys - 1; if (first < req->minKeyCode) { *errRtrn = _XkbErrCode3(0x71, first, req->minKeyCode); return 0; } if (last > req->maxKeyCode) { *errRtrn = _XkbErrCode3(0x72, last, req->maxKeyCode); return 0; } for (i = 0; i < req->totalVModMapKeys; i++, wire++) { if ((wire->key < first) || (wire->key > last)) { *errRtrn = _XkbErrCode4(0x73, first, last, wire->key); return 0; } } *wireRtrn = wire; return 1; } static char * SetKeyTypes(XkbDescPtr xkb, xkbSetMapReq * req, xkbKeyTypeWireDesc * wire, XkbChangesPtr changes) { register unsigned i; unsigned first, last; CARD8 *map; if ((unsigned) (req->firstType + req->nTypes) > xkb->map->size_types) { i = req->firstType + req->nTypes; if (XkbAllocClientMap(xkb, XkbKeyTypesMask, i) != Success) { return NULL; } } if ((unsigned) (req->firstType + req->nTypes) > xkb->map->num_types) xkb->map->num_types = req->firstType + req->nTypes; for (i = 0; i < req->nTypes; i++) { XkbKeyTypePtr pOld; register unsigned n; if (XkbResizeKeyType(xkb, i + req->firstType, wire->nMapEntries, wire->preserve, wire->numLevels) != Success) { return NULL; } pOld = &xkb->map->types[i + req->firstType]; map = (CARD8 *) &wire[1]; pOld->mods.real_mods = wire->realMods; pOld->mods.vmods = wire->virtualMods; pOld->num_levels = wire->numLevels; pOld->map_count = wire->nMapEntries; pOld->mods.mask = pOld->mods.real_mods | XkbMaskForVMask(xkb, pOld->mods.vmods); if (wire->nMapEntries) { xkbKTSetMapEntryWireDesc *mapWire; xkbModsWireDesc *preWire; unsigned tmp; mapWire = (xkbKTSetMapEntryWireDesc *) map; 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; pOld->map[n].mods.real_mods = mapWire[n].realMods; pOld->map[n].mods.vmods = mapWire[n].virtualMods; pOld->map[n].level = mapWire[n].level; if (mapWire[n].virtualMods != 0) { tmp = XkbMaskForVMask(xkb, mapWire[n].virtualMods); pOld->map[n].active = (tmp != 0); pOld->map[n].mods.mask |= tmp; } if (wire->preserve) { pOld->preserve[n].real_mods = preWire[n].realMods; pOld->preserve[n].vmods = preWire[n].virtualMods; tmp = XkbMaskForVMask(xkb, preWire[n].virtualMods); pOld->preserve[n].mask = preWire[n].realMods | tmp; } } if (wire->preserve) map = (CARD8 *) &preWire[wire->nMapEntries]; else map = (CARD8 *) &mapWire[wire->nMapEntries]; } else map = (CARD8 *) &wire[1]; wire = (xkbKeyTypeWireDesc *) map; } first = req->firstType; last = first + req->nTypes - 1; /* last changed type */ if (changes->map.changed & XkbKeyTypesMask) { int oldLast; oldLast = changes->map.first_type + changes->map.num_types - 1; if (changes->map.first_type < first) first = changes->map.first_type; if (oldLast > last) last = oldLast; } changes->map.changed |= XkbKeyTypesMask; changes->map.first_type = first; changes->map.num_types = (last - first) + 1; return (char *) wire; } static char * SetKeySyms(ClientPtr client, XkbDescPtr xkb, xkbSetMapReq * req, xkbSymMapWireDesc * wire, XkbChangesPtr changes, DeviceIntPtr dev) { register unsigned i, s; XkbSymMapPtr oldMap; KeySym *newSyms; KeySym *pSyms; unsigned first, last; oldMap = &xkb->map->key_sym_map[req->firstKeySym]; for (i = 0; i < req->nKeySyms; i++, oldMap++) { pSyms = (KeySym *) &wire[1]; if (wire->nSyms > 0) { newSyms = XkbResizeKeySyms(xkb, i + req->firstKeySym, wire->nSyms); for (s = 0; s < wire->nSyms; s++) { newSyms[s] = pSyms[s]; } if (client->swapped) { for (s = 0; s < wire->nSyms; s++) { swapl(&newSyms[s]); } } } oldMap->kt_index[0] = wire->ktIndex[0]; oldMap->kt_index[1] = wire->ktIndex[1]; oldMap->kt_index[2] = wire->ktIndex[2]; oldMap->kt_index[3] = wire->ktIndex[3]; oldMap->group_info = wire->groupInfo; oldMap->width = wire->width; wire = (xkbSymMapWireDesc *) &pSyms[wire->nSyms]; } first = req->firstKeySym; last = first + req->nKeySyms - 1; if (changes->map.changed & XkbKeySymsMask) { int oldLast = (changes->map.first_key_sym + changes->map.num_key_syms - 1); if (changes->map.first_key_sym < first) first = changes->map.first_key_sym; if (oldLast > last) last = oldLast; } changes->map.changed |= XkbKeySymsMask; changes->map.first_key_sym = first; changes->map.num_key_syms = (last - first + 1); s = 0; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { if (XkbKeyNumGroups(xkb, i) > s) s = XkbKeyNumGroups(xkb, i); } if (s != xkb->ctrls->num_groups) { xkbControlsNotify cn; XkbControlsRec old; cn.keycode = 0; cn.eventType = 0; cn.requestMajor = XkbReqCode; cn.requestMinor = X_kbSetMap; old = *xkb->ctrls; xkb->ctrls->num_groups = s; if (XkbComputeControlsNotify(dev, &old, xkb->ctrls, &cn, FALSE)) XkbSendControlsNotify(dev, &cn); } return (char *) wire; } static char * SetKeyActions(XkbDescPtr xkb, xkbSetMapReq * req, CARD8 *wire, XkbChangesPtr changes) { register unsigned i, first, last; CARD8 *nActs = wire; XkbAction *newActs; wire += XkbPaddedSize(req->nKeyActs); for (i = 0; i < req->nKeyActs; i++) { if (nActs[i] == 0) xkb->server->key_acts[i + req->firstKeyAct] = 0; else { newActs = XkbResizeKeyActions(xkb, i + req->firstKeyAct, nActs[i]); memcpy((char *) newActs, (char *) wire, nActs[i] * SIZEOF(xkbActionWireDesc)); wire += nActs[i] * SIZEOF(xkbActionWireDesc); } } first = req->firstKeyAct; last = (first + req->nKeyActs - 1); if (changes->map.changed & XkbKeyActionsMask) { int oldLast; oldLast = changes->map.first_key_act + changes->map.num_key_acts - 1; if (changes->map.first_key_act < first) first = changes->map.first_key_act; if (oldLast > last) last = oldLast; } changes->map.changed |= XkbKeyActionsMask; changes->map.first_key_act = first; changes->map.num_key_acts = (last - first + 1); return (char *) wire; } static char * SetKeyBehaviors(XkbSrvInfoPtr xkbi, xkbSetMapReq * req, xkbBehaviorWireDesc * wire, XkbChangesPtr changes) { register unsigned i; int maxRG = -1; XkbDescPtr xkb = xkbi->desc; XkbServerMapPtr server = xkb->server; unsigned first, last; first = req->firstKeyBehavior; last = req->firstKeyBehavior + req->nKeyBehaviors - 1; memset(&server->behaviors[first], 0, req->nKeyBehaviors * sizeof(XkbBehavior)); for (i = 0; i < req->totalKeyBehaviors; i++) { if ((server->behaviors[wire->key].type & XkbKB_Permanent) == 0) { server->behaviors[wire->key].type = wire->type; server->behaviors[wire->key].data = wire->data; if ((wire->type == XkbKB_RadioGroup) && (((int) wire->data) > maxRG)) maxRG = wire->data + 1; } wire++; } if (maxRG > (int) xkbi->nRadioGroups) { int sz = maxRG * sizeof(XkbRadioGroupRec); if (xkbi->radioGroups) xkbi->radioGroups = realloc(xkbi->radioGroups, sz); else xkbi->radioGroups = calloc(1, sz); if (xkbi->radioGroups) { if (xkbi->nRadioGroups) memset(&xkbi->radioGroups[xkbi->nRadioGroups], 0, (maxRG - xkbi->nRadioGroups) * sizeof(XkbRadioGroupRec)); xkbi->nRadioGroups = maxRG; } else xkbi->nRadioGroups = 0; /* should compute members here */ } if (changes->map.changed & XkbKeyBehaviorsMask) { unsigned oldLast; oldLast = changes->map.first_key_behavior + changes->map.num_key_behaviors - 1; if (changes->map.first_key_behavior < req->firstKeyBehavior) first = changes->map.first_key_behavior; if (oldLast > last) last = oldLast; } changes->map.changed |= XkbKeyBehaviorsMask; changes->map.first_key_behavior = first; changes->map.num_key_behaviors = (last - first + 1); return (char *) wire; } static char * SetVirtualMods(XkbSrvInfoPtr xkbi, xkbSetMapReq * req, CARD8 *wire, XkbChangesPtr changes) { register int i, bit, nMods; XkbServerMapPtr srv = xkbi->desc->server; if (((req->present & XkbVirtualModsMask) == 0) || (req->virtualMods == 0)) return (char *) wire; for (i = nMods = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (req->virtualMods & bit) { if (srv->vmods[i] != wire[nMods]) { changes->map.changed |= XkbVirtualModsMask; changes->map.vmods |= bit; srv->vmods[i] = wire[nMods]; } nMods++; } } return (char *) (wire + XkbPaddedSize(nMods)); } static char * SetKeyExplicit(XkbSrvInfoPtr xkbi, xkbSetMapReq * req, CARD8 *wire, XkbChangesPtr changes) { register unsigned i, first, last; XkbServerMapPtr xkb = xkbi->desc->server; CARD8 *start; start = wire; first = req->firstKeyExplicit; last = req->firstKeyExplicit + req->nKeyExplicit - 1; memset(&xkb->explicit[first], 0, req->nKeyExplicit); for (i = 0; i < req->totalKeyExplicit; i++, wire += 2) { xkb->explicit[wire[0]] = wire[1]; } if (first > 0) { if (changes->map.changed & XkbExplicitComponentsMask) { int oldLast; oldLast = changes->map.first_key_explicit + changes->map.num_key_explicit - 1; if (changes->map.first_key_explicit < first) first = changes->map.first_key_explicit; if (oldLast > last) last = oldLast; } changes->map.first_key_explicit = first; changes->map.num_key_explicit = (last - first) + 1; } wire += XkbPaddedSize(wire - start) - (wire - start); return (char *) wire; } static char * SetModifierMap(XkbSrvInfoPtr xkbi, xkbSetMapReq * req, CARD8 *wire, XkbChangesPtr changes) { register unsigned i, first, last; XkbClientMapPtr xkb = xkbi->desc->map; CARD8 *start; start = wire; first = req->firstModMapKey; last = req->firstModMapKey + req->nModMapKeys - 1; memset(&xkb->modmap[first], 0, req->nModMapKeys); for (i = 0; i < req->totalModMapKeys; i++, wire += 2) { xkb->modmap[wire[0]] = wire[1]; } if (first > 0) { if (changes->map.changed & XkbModifierMapMask) { int oldLast; oldLast = changes->map.first_modmap_key + changes->map.num_modmap_keys - 1; if (changes->map.first_modmap_key < first) first = changes->map.first_modmap_key; if (oldLast > last) last = oldLast; } changes->map.first_modmap_key = first; changes->map.num_modmap_keys = (last - first) + 1; } wire += XkbPaddedSize(wire - start) - (wire - start); return (char *) wire; } static char * SetVirtualModMap(XkbSrvInfoPtr xkbi, xkbSetMapReq * req, xkbVModMapWireDesc * wire, XkbChangesPtr changes) { register unsigned i, first, last; XkbServerMapPtr srv = xkbi->desc->server; first = req->firstVModMapKey; last = req->firstVModMapKey + req->nVModMapKeys - 1; memset(&srv->vmodmap[first], 0, req->nVModMapKeys * sizeof(unsigned short)); for (i = 0; i < req->totalVModMapKeys; i++, wire++) { srv->vmodmap[wire->key] = wire->vmods; } if (first > 0) { if (changes->map.changed & XkbVirtualModMapMask) { int oldLast; oldLast = changes->map.first_vmodmap_key + changes->map.num_vmodmap_keys - 1; if (changes->map.first_vmodmap_key < first) first = changes->map.first_vmodmap_key; if (oldLast > last) last = oldLast; } changes->map.first_vmodmap_key = first; changes->map.num_vmodmap_keys = (last - first) + 1; } return (char *) wire; } /** * Check if the given request can be applied to the given device but don't * actually do anything.. */ static int _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, char *values) { XkbSrvInfoPtr xkbi; XkbDescPtr xkb; int error; int nTypes = 0, nActions; CARD8 mapWidths[XkbMaxLegalKeyCode + 1] = { 0 }; CARD16 symsPerKey[XkbMaxLegalKeyCode + 1] = { 0 }; XkbSymMapPtr map; int i; xkbi = dev->key->xkbInfo; xkb = xkbi->desc; if ((xkb->min_key_code != req->minKeyCode) || (xkb->max_key_code != req->maxKeyCode)) { if (client->vMajor != 1) { /* pre 1.0 versions of Xlib have a bug */ req->minKeyCode = xkb->min_key_code; req->maxKeyCode = xkb->max_key_code; } else { if (!XkbIsLegalKeycode(req->minKeyCode)) { client->errorValue = _XkbErrCode3(2, req->minKeyCode, req->maxKeyCode); return BadValue; } if (req->minKeyCode > req->maxKeyCode) { client->errorValue = _XkbErrCode3(3, req->minKeyCode, req->maxKeyCode); return BadMatch; } } } if ((req->present & XkbKeyTypesMask) && (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, &nTypes, mapWidths))) { client->errorValue = nTypes; return BadValue; } /* symsPerKey/mapWidths must be filled regardless of client-side flags */ map = &xkb->map->key_sym_map[xkb->min_key_code]; for (i = xkb->min_key_code; i < xkb->max_key_code; i++, map++) { register int g, ng, w; ng = XkbNumGroups(map->group_info); for (w = g = 0; g < ng; g++) { if (map->kt_index[g] >= (unsigned) nTypes) { client->errorValue = _XkbErrCode4(0x13, i, g, map->kt_index[g]); return 0; } if (mapWidths[map->kt_index[g]] > w) w = mapWidths[map->kt_index[g]]; } symsPerKey[i] = w * ng; } if ((req->present & XkbKeySymsMask) && (!CheckKeySyms(client, xkb, req, nTypes, mapWidths, symsPerKey, (xkbSymMapWireDesc **) &values, &error))) { client->errorValue = error; return BadValue; } if ((req->present & XkbKeyActionsMask) && (!CheckKeyActions(xkb, req, nTypes, mapWidths, symsPerKey, (CARD8 **) &values, &nActions))) { client->errorValue = nActions; return BadValue; } if ((req->present & XkbKeyBehaviorsMask) && (!CheckKeyBehaviors (xkb, req, (xkbBehaviorWireDesc **) &values, &error))) { client->errorValue = error; return BadValue; } if ((req->present & XkbVirtualModsMask) && (!CheckVirtualMods(xkb, req, (CARD8 **) &values, &error))) { client->errorValue = error; return BadValue; } if ((req->present & XkbExplicitComponentsMask) && (!CheckKeyExplicit(xkb, req, (CARD8 **) &values, &error))) { client->errorValue = error; return BadValue; } if ((req->present & XkbModifierMapMask) && (!CheckModifierMap(xkb, req, (CARD8 **) &values, &error))) { client->errorValue = error; return BadValue; } if ((req->present & XkbVirtualModMapMask) && (!CheckVirtualModMap (xkb, req, (xkbVModMapWireDesc **) &values, &error))) { client->errorValue = error; return BadValue; } if (((values - ((char *) req)) / 4) != req->length) { ErrorF("[xkb] Internal error! Bad length in XkbSetMap (after check)\n"); client->errorValue = values - ((char *) &req[1]); return BadLength; } return Success; } /** * Apply the given request on the given device. */ static int _XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, char *values) { XkbEventCauseRec cause; XkbChangesRec change; Bool sentNKN; XkbSrvInfoPtr xkbi; XkbDescPtr xkb; xkbi = dev->key->xkbInfo; xkb = xkbi->desc; XkbSetCauseXkbReq(&cause, X_kbSetMap, client); memset(&change, 0, sizeof(change)); sentNKN = FALSE; if ((xkb->min_key_code != req->minKeyCode) || (xkb->max_key_code != req->maxKeyCode)) { Status status; xkbNewKeyboardNotify nkn; nkn.deviceID = nkn.oldDeviceID = dev->id; nkn.oldMinKeyCode = xkb->min_key_code; nkn.oldMaxKeyCode = xkb->max_key_code; status = XkbChangeKeycodeRange(xkb, req->minKeyCode, req->maxKeyCode, &change); if (status != Success) return status; /* oh-oh. what about the other keyboards? */ nkn.minKeyCode = xkb->min_key_code; nkn.maxKeyCode = xkb->max_key_code; nkn.requestMajor = XkbReqCode; nkn.requestMinor = X_kbSetMap; nkn.changed = XkbNKN_KeycodesMask; XkbSendNewKeyboardNotify(dev, &nkn); sentNKN = TRUE; } if (req->present & XkbKeyTypesMask) { values = SetKeyTypes(xkb, req, (xkbKeyTypeWireDesc *) values, &change); if (!values) goto allocFailure; } if (req->present & XkbKeySymsMask) { values = SetKeySyms(client, xkb, req, (xkbSymMapWireDesc *) values, &change, dev); if (!values) goto allocFailure; } if (req->present & XkbKeyActionsMask) { values = SetKeyActions(xkb, req, (CARD8 *) values, &change); if (!values) goto allocFailure; } if (req->present & XkbKeyBehaviorsMask) { values = SetKeyBehaviors(xkbi, req, (xkbBehaviorWireDesc *) values, &change); if (!values) goto allocFailure; } if (req->present & XkbVirtualModsMask) values = SetVirtualMods(xkbi, req, (CARD8 *) values, &change); if (req->present & XkbExplicitComponentsMask) values = SetKeyExplicit(xkbi, req, (CARD8 *) values, &change); if (req->present & XkbModifierMapMask) values = SetModifierMap(xkbi, req, (CARD8 *) values, &change); if (req->present & XkbVirtualModMapMask) values = SetVirtualModMap(xkbi, req, (xkbVModMapWireDesc *) values, &change); if (((values - ((char *) req)) / 4) != req->length) { ErrorF("[xkb] Internal error! Bad length in XkbSetMap (after set)\n"); client->errorValue = values - ((char *) &req[1]); return BadLength; } if (req->flags & XkbSetMapRecomputeActions) { KeyCode first, last, firstMM, lastMM; if (change.map.num_key_syms > 0) { first = change.map.first_key_sym; last = first + change.map.num_key_syms - 1; } else first = last = 0; if (change.map.num_modmap_keys > 0) { firstMM = change.map.first_modmap_key; lastMM = first + change.map.num_modmap_keys - 1; } else firstMM = lastMM = 0; if ((last > 0) && (lastMM > 0)) { if (firstMM < first) first = firstMM; if (lastMM > last) last = lastMM; } else if (lastMM > 0) { first = firstMM; last = lastMM; } if (last > 0) { unsigned check = 0; XkbUpdateActions(dev, first, (last - first + 1), &change, &check, &cause); if (check) XkbCheckSecondaryEffects(xkbi, check, &change, &cause); } } if (!sentNKN) XkbSendNotification(dev, &change, &cause); return Success; allocFailure: return BadAlloc; } int ProcXkbSetMap(ClientPtr client) { DeviceIntPtr dev; char *tmp; int rc; REQUEST(xkbSetMapReq); REQUEST_AT_LEAST_SIZE(xkbSetMapReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); CHK_MASK_LEGAL(0x01, stuff->present, XkbAllMapComponentsMask); tmp = (char *) &stuff[1]; /* Check if we can to the SetMap on the requested device. If this succeeds, do the same thing for all extension devices (if needed). If any of them fails, fail. */ rc = _XkbSetMapChecks(client, dev, stuff, tmp); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) { rc = _XkbSetMapChecks(client, other, stuff, tmp); if (rc != Success) return rc; } } } } /* We know now that we will succed with the SetMap. In theory anyway. */ rc = _XkbSetMap(client, dev, stuff, tmp); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) _XkbSetMap(client, other, stuff, tmp); /* ignore rc. if the SetMap failed although the check above reported true there isn't much we can do. we still need to set all other devices, hoping that at least they stay in sync. */ } } } return Success; } /***====================================================================***/ static Status XkbComputeGetCompatMapReplySize(XkbCompatMapPtr compat, xkbGetCompatMapReply * rep) { unsigned size, nGroups; nGroups = 0; if (rep->groups != 0) { register int i, bit; for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { if (rep->groups & bit) nGroups++; } } size = nGroups * SIZEOF(xkbModsWireDesc); size += (rep->nSI * SIZEOF(xkbSymInterpretWireDesc)); rep->length = size / 4; return Success; } static int XkbSendCompatMap(ClientPtr client, XkbCompatMapPtr compat, xkbGetCompatMapReply * rep) { char *data; int size; size = rep->length * 4; if (size > 0) { data = malloc(size); if (data) { register unsigned i, bit; xkbModsWireDesc *grp; XkbSymInterpretPtr sym = &compat->sym_interpret[rep->firstSI]; xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *) data; for (i = 0; i < rep->nSI; i++, sym++, wire++) { wire->sym = sym->sym; wire->mods = sym->mods; wire->match = sym->match; wire->virtualMod = sym->virtual_mod; wire->flags = sym->flags; memcpy((char *) &wire->act, (char *) &sym->act, sz_xkbActionWireDesc); if (client->swapped) { swapl(&wire->sym); } } if (rep->groups) { grp = (xkbModsWireDesc *) wire; for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { if (rep->groups & bit) { grp->mask = compat->groups[i].mask; grp->realMods = compat->groups[i].real_mods; grp->virtualMods = compat->groups[i].vmods; if (client->swapped) { swaps(&grp->virtualMods); } grp++; } } wire = (xkbSymInterpretWireDesc *) grp; } } else return BadAlloc; } else data = NULL; if (client->swapped) { swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->firstSI); swaps(&rep->nSI); swaps(&rep->nTotalSI); } WriteToClient(client, SIZEOF(xkbGetCompatMapReply), rep); if (data) { WriteToClient(client, size, data); free((char *) data); } return Success; } int ProcXkbGetCompatMap(ClientPtr client) { xkbGetCompatMapReply rep; DeviceIntPtr dev; XkbDescPtr xkb; XkbCompatMapPtr compat; REQUEST(xkbGetCompatMapReq); REQUEST_SIZE_MATCH(xkbGetCompatMapReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = dev->key->xkbInfo->desc; compat = xkb->compat; 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; } else if ((((unsigned) stuff->nSI) > 0) && ((unsigned) (stuff->firstSI + stuff->nSI - 1) >= compat->num_si)) { client->errorValue = _XkbErrCode2(0x05, compat->num_si); return BadValue; } rep.nTotalSI = compat->num_si; rep.groups = stuff->groups; XkbComputeGetCompatMapReplySize(compat, &rep); return XkbSendCompatMap(client, compat, &rep); } /** * Apply the given request on the given device. * If dryRun is TRUE, then value checks are performed, but the device isn't * modified. */ static int _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev, xkbSetCompatMapReq * req, char *data, BOOL dryRun) { XkbSrvInfoPtr xkbi; XkbDescPtr xkb; XkbCompatMapPtr compat; int nGroups; unsigned i, bit; xkbi = dev->key->xkbInfo; xkb = xkbi->desc; compat = xkb->compat; if ((req->nSI > 0) || (req->truncateSI)) { xkbSymInterpretWireDesc *wire; if (req->firstSI > compat->num_si) { client->errorValue = _XkbErrCode2(0x02, compat->num_si); return BadValue; } wire = (xkbSymInterpretWireDesc *) data; wire += req->nSI; data = (char *) wire; } nGroups = 0; if (req->groups != 0) { for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { if (req->groups & bit) nGroups++; } } data += nGroups * SIZEOF(xkbModsWireDesc); if (((data - ((char *) req)) / 4) != req->length) { return BadLength; } /* Done all the checks we can do */ if (dryRun) return Success; data = (char *) &req[1]; if (req->nSI > 0) { xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *) data; XkbSymInterpretPtr sym; unsigned int skipped = 0; if ((unsigned) (req->firstSI + req->nSI) > compat->num_si) { compat->num_si = req->firstSI + req->nSI; compat->sym_interpret = realloc(compat->sym_interpret, compat->num_si * sizeof(XkbSymInterpretRec)); if (!compat->sym_interpret) { compat->num_si = 0; return BadAlloc; } } else if (req->truncateSI) { compat->num_si = req->firstSI + req->nSI; } sym = &compat->sym_interpret[req->firstSI]; for (i = 0; i < req->nSI; i++, wire++) { if (client->swapped) { swapl(&wire->sym); } if (wire->sym == NoSymbol && wire->match == XkbSI_AnyOfOrNone && (wire->mods & 0xff) == 0xff && wire->act.type == XkbSA_XFree86Private) { ErrorF("XKB: Skipping broken Any+AnyOfOrNone(All) -> Private " "action from client\n"); skipped++; continue; } sym->sym = wire->sym; sym->mods = wire->mods; sym->match = wire->match; sym->flags = wire->flags; sym->virtual_mod = wire->virtualMod; memcpy((char *) &sym->act, (char *) &wire->act, SIZEOF(xkbActionWireDesc)); sym++; } if (skipped) { if (req->firstSI + req->nSI < compat->num_si) memmove(sym, sym + skipped, (compat->num_si - req->firstSI - req->nSI) * sizeof(*sym)); compat->num_si -= skipped; } data = (char *) wire; } else if (req->truncateSI) { compat->num_si = req->firstSI; } if (req->groups != 0) { xkbModsWireDesc *wire = (xkbModsWireDesc *) data; for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { if (req->groups & bit) { if (client->swapped) { swaps(&wire->virtualMods); } compat->groups[i].mask = wire->realMods; compat->groups[i].real_mods = wire->realMods; compat->groups[i].vmods = wire->virtualMods; if (wire->virtualMods != 0) { unsigned tmp; tmp = XkbMaskForVMask(xkb, wire->virtualMods); compat->groups[i].mask |= tmp; } data += SIZEOF(xkbModsWireDesc); wire = (xkbModsWireDesc *) data; } } } i = XkbPaddedSize((data - ((char *) req))); if ((i / 4) != req->length) { ErrorF("[xkb] Internal length error on read in _XkbSetCompatMap\n"); return BadLength; } if (dev->xkb_interest) { xkbCompatMapNotify ev; ev.deviceID = dev->id; ev.changedGroups = req->groups; ev.firstSI = req->firstSI; ev.nSI = req->nSI; ev.nTotalSI = compat->num_si; XkbSendCompatMapNotify(dev, &ev); } if (req->recomputeActions) { XkbChangesRec change; unsigned check; XkbEventCauseRec cause; XkbSetCauseXkbReq(&cause, X_kbSetCompatMap, client); memset(&change, 0, sizeof(XkbChangesRec)); XkbUpdateActions(dev, xkb->min_key_code, XkbNumKeys(xkb), &change, &check, &cause); if (check) XkbCheckSecondaryEffects(xkbi, check, &change, &cause); XkbSendNotification(dev, &change, &cause); } return Success; } int ProcXkbSetCompatMap(ClientPtr client) { DeviceIntPtr dev; char *data; int rc; REQUEST(xkbSetCompatMapReq); REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); data = (char *) &stuff[1]; /* check first using a dry-run */ rc = _XkbSetCompatMap(client, dev, stuff, data, TRUE); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) { /* dry-run */ rc = _XkbSetCompatMap(client, other, stuff, data, TRUE); if (rc != Success) return rc; } } } } /* Yay, the dry-runs succeed. Let's apply */ rc = _XkbSetCompatMap(client, dev, stuff, data, FALSE); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) { rc = _XkbSetCompatMap(client, other, stuff, data, FALSE); if (rc != Success) return rc; } } } } return Success; } /***====================================================================***/ int ProcXkbGetIndicatorState(ClientPtr client) { xkbGetIndicatorStateReply rep; XkbSrvLedInfoPtr sli; DeviceIntPtr dev; REQUEST(xkbGetIndicatorStateReq); REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess); sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, XkbXI_IndicatorStateMask); if (!sli) return BadAlloc; 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), &rep); return Success; } /***====================================================================***/ static Status XkbComputeGetIndicatorMapReplySize(XkbIndicatorPtr indicators, xkbGetIndicatorMapReply * rep) { register int i, bit; int nIndicators; rep->realIndicators = indicators->phys_indicators; for (i = nIndicators = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (rep->which & bit) nIndicators++; } rep->length = (nIndicators * SIZEOF(xkbIndicatorMapWireDesc)) / 4; rep->nIndicators = nIndicators; return Success; } static int XkbSendIndicatorMap(ClientPtr client, XkbIndicatorPtr indicators, xkbGetIndicatorMapReply * rep) { int length; CARD8 *map; register int i; register unsigned bit; length = rep->length * 4; if (length > 0) { CARD8 *to; to = map = malloc(length); if (map) { xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *) to; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (rep->which & bit) { wire->flags = indicators->maps[i].flags; wire->whichGroups = indicators->maps[i].which_groups; wire->groups = indicators->maps[i].groups; wire->whichMods = indicators->maps[i].which_mods; wire->mods = indicators->maps[i].mods.mask; wire->realMods = indicators->maps[i].mods.real_mods; wire->virtualMods = indicators->maps[i].mods.vmods; wire->ctrls = indicators->maps[i].ctrls; if (client->swapped) { swaps(&wire->virtualMods); swapl(&wire->ctrls); } wire++; } } to = (CARD8 *) wire; if ((to - map) != length) { client->errorValue = _XkbErrCode2(0xff, length); free(map); return BadLength; } } else return BadAlloc; } else map = NULL; if (client->swapped) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->which); swapl(&rep->realIndicators); } WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), rep); if (map) { WriteToClient(client, length, map); free((char *) map); } return Success; } int ProcXkbGetIndicatorMap(ClientPtr client) { xkbGetIndicatorMapReply rep; DeviceIntPtr dev; XkbDescPtr xkb; XkbIndicatorPtr leds; REQUEST(xkbGetIndicatorMapReq); REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = dev->key->xkbInfo->desc; leds = xkb->indicators; rep = (xkbGetIndicatorMapReply) { .type = X_Reply, .deviceID = dev->id, .sequenceNumber = client->sequence, .length = 0, .which = stuff->which }; XkbComputeGetIndicatorMapReplySize(leds, &rep); return XkbSendIndicatorMap(client, leds, &rep); } /** * Apply the given map to the given device. Which specifies which components * to apply. */ static int _XkbSetIndicatorMap(ClientPtr client, DeviceIntPtr dev, int which, xkbIndicatorMapWireDesc * desc) { XkbSrvInfoPtr xkbi; XkbSrvLedInfoPtr sli; XkbEventCauseRec cause; int i, bit; xkbi = dev->key->xkbInfo; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, XkbXI_IndicatorMapsMask); if (!sli) return BadAlloc; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (which & bit) { sli->maps[i].flags = desc->flags; sli->maps[i].which_groups = desc->whichGroups; sli->maps[i].groups = desc->groups; sli->maps[i].which_mods = desc->whichMods; sli->maps[i].mods.mask = desc->mods; sli->maps[i].mods.real_mods = desc->mods; sli->maps[i].mods.vmods = desc->virtualMods; sli->maps[i].ctrls = desc->ctrls; if (desc->virtualMods != 0) { unsigned tmp; tmp = XkbMaskForVMask(xkbi->desc, desc->virtualMods); sli->maps[i].mods.mask = desc->mods | tmp; } desc++; } } XkbSetCauseXkbReq(&cause, X_kbSetIndicatorMap, client); XkbApplyLedMapChanges(dev, sli, which, NULL, NULL, &cause); return Success; } int ProcXkbSetIndicatorMap(ClientPtr client) { int i, bit; int nIndicators; DeviceIntPtr dev; xkbIndicatorMapWireDesc *from; int rc; REQUEST(xkbSetIndicatorMapReq); REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); if (stuff->which == 0) return Success; for (nIndicators = i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (stuff->which & bit) nIndicators++; } if (stuff->length != ((SIZEOF(xkbSetIndicatorMapReq) + (nIndicators * SIZEOF(xkbIndicatorMapWireDesc))) / 4)) { return BadLength; } from = (xkbIndicatorMapWireDesc *) &stuff[1]; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (stuff->which & bit) { if (client->swapped) { swaps(&from->virtualMods); swapl(&from->ctrls); } CHK_MASK_LEGAL(i, from->whichGroups, XkbIM_UseAnyGroup); CHK_MASK_LEGAL(i, from->whichMods, XkbIM_UseAnyMods); from++; } } from = (xkbIndicatorMapWireDesc *) &stuff[1]; rc = _XkbSetIndicatorMap(client, dev, stuff->which, from); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess); if (rc == Success) _XkbSetIndicatorMap(client, other, stuff->which, from); } } } return Success; } /***====================================================================***/ int ProcXkbGetNamedIndicator(ClientPtr client) { DeviceIntPtr dev; xkbGetNamedIndicatorReply rep; register int i = 0; XkbSrvLedInfoPtr sli; XkbIndicatorMapPtr map = NULL; REQUEST(xkbGetNamedIndicatorReq); REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess); CHK_ATOM_ONLY(stuff->indicator); sli = XkbFindSrvLedInfo(dev, stuff->ledClass, stuff->ledID, 0); if (!sli) return BadAlloc; i = 0; map = NULL; if ((sli->names) && (sli->maps)) { for (i = 0; i < XkbNumIndicators; i++) { if (stuff->indicator == sli->names[i]) { map = &sli->maps[i]; break; } } } 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); rep.realIndicator = ((sli->physIndicators & (1 << i)) != 0); rep.ndx = i; rep.flags = map->flags; rep.whichGroups = map->which_groups; rep.groups = map->groups; rep.whichMods = map->which_mods; rep.mods = map->mods.mask; rep.realMods = map->mods.real_mods; rep.virtualMods = map->mods.vmods; rep.ctrls = map->ctrls; rep.supported = TRUE; } else { rep.found = FALSE; rep.on = FALSE; rep.realIndicator = FALSE; rep.ndx = XkbNoIndicator; rep.flags = 0; rep.whichGroups = 0; rep.groups = 0; rep.whichMods = 0; rep.mods = 0; rep.realMods = 0; rep.virtualMods = 0; rep.ctrls = 0; rep.supported = TRUE; } if (client->swapped) { swapl(&rep.length); swaps(&rep.sequenceNumber); swapl(&rep.indicator); swaps(&rep.virtualMods); swapl(&rep.ctrls); } WriteToClient(client, SIZEOF(xkbGetNamedIndicatorReply), &rep); return Success; } /** * Find the IM on the device. * Returns the map, or NULL if the map doesn't exist. * If the return value is NULL, led_return is undefined. Otherwise, led_return * is set to the led index of the map. */ static XkbIndicatorMapPtr _XkbFindNamedIndicatorMap(XkbSrvLedInfoPtr sli, Atom indicator, int *led_return) { XkbIndicatorMapPtr map; /* search for the right indicator */ map = NULL; if (sli->names && sli->maps) { int led; for (led = 0; (led < XkbNumIndicators) && (map == NULL); led++) { if (sli->names[led] == indicator) { map = &sli->maps[led]; *led_return = led; break; } } } return map; } /** * Creates an indicator map on the device. If dryRun is TRUE, it only checks * if creation is possible, but doesn't actually create it. */ static int _XkbCreateIndicatorMap(DeviceIntPtr dev, Atom indicator, int ledClass, int ledID, XkbIndicatorMapPtr * map_return, int *led_return, Bool dryRun) { XkbSrvLedInfoPtr sli; XkbIndicatorMapPtr map; int led; sli = XkbFindSrvLedInfo(dev, ledClass, ledID, XkbXI_IndicatorsMask); if (!sli) return BadAlloc; map = _XkbFindNamedIndicatorMap(sli, indicator, &led); if (!map) { /* find first unused indicator maps and assign the name to it */ for (led = 0, map = NULL; (led < XkbNumIndicators) && (map == NULL); led++) { if ((sli->names) && (sli->maps) && (sli->names[led] == None) && (!XkbIM_InUse(&sli->maps[led]))) { map = &sli->maps[led]; if (!dryRun) sli->names[led] = indicator; break; } } } if (!map) return BadAlloc; *led_return = led; *map_return = map; return Success; } static int _XkbSetNamedIndicator(ClientPtr client, DeviceIntPtr dev, xkbSetNamedIndicatorReq * stuff) { unsigned int extDevReason; unsigned int statec, namec, mapc; XkbSrvLedInfoPtr sli; int led = 0; XkbIndicatorMapPtr map; DeviceIntPtr kbd; XkbEventCauseRec cause; xkbExtensionDeviceNotify ed; XkbChangesRec changes; int rc; rc = _XkbCreateIndicatorMap(dev, stuff->indicator, stuff->ledClass, stuff->ledID, &map, &led, FALSE); if (rc != Success || !map) /* oh-oh */ return rc; sli = XkbFindSrvLedInfo(dev, stuff->ledClass, stuff->ledID, XkbXI_IndicatorsMask); if (!sli) return BadAlloc; namec = mapc = statec = 0; extDevReason = 0; namec |= (1 << led); sli->namesPresent |= ((stuff->indicator != None) ? (1 << led) : 0); extDevReason |= XkbXI_IndicatorNamesMask; if (stuff->setMap) { map->flags = stuff->flags; map->which_groups = stuff->whichGroups; map->groups = stuff->groups; map->which_mods = stuff->whichMods; map->mods.mask = stuff->realMods; map->mods.real_mods = stuff->realMods; map->mods.vmods = stuff->virtualMods; map->ctrls = stuff->ctrls; mapc |= (1 << led); } if ((stuff->setState) && ((map->flags & XkbIM_NoExplicit) == 0)) { if (stuff->on) sli->explicitState |= (1 << led); else sli->explicitState &= ~(1 << led); statec |= ((sli->effectiveState ^ sli->explicitState) & (1 << led)); } memset((char *) &ed, 0, sizeof(xkbExtensionDeviceNotify)); memset((char *) &changes, 0, sizeof(XkbChangesRec)); XkbSetCauseXkbReq(&cause, X_kbSetNamedIndicator, client); if (namec) XkbApplyLedNameChanges(dev, sli, namec, &ed, &changes, &cause); if (mapc) XkbApplyLedMapChanges(dev, sli, mapc, &ed, &changes, &cause); if (statec) XkbApplyLedStateChanges(dev, sli, statec, &ed, &changes, &cause); kbd = dev; if ((sli->flags & XkbSLI_HasOwnState) == 0) kbd = inputInfo.keyboard; XkbFlushLedEvents(dev, kbd, sli, &ed, &changes, &cause); return Success; } int ProcXkbSetNamedIndicator(ClientPtr client) { int rc; DeviceIntPtr dev; int led = 0; XkbIndicatorMapPtr map; REQUEST(xkbSetNamedIndicatorReq); REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); CHK_ATOM_ONLY(stuff->indicator); CHK_MASK_LEGAL(0x10, stuff->whichGroups, XkbIM_UseAnyGroup); CHK_MASK_LEGAL(0x11, stuff->whichMods, XkbIM_UseAnyMods); /* Dry-run for checks */ rc = _XkbCreateIndicatorMap(dev, stuff->indicator, stuff->ledClass, stuff->ledID, &map, &led, TRUE); if (rc != Success || !map) /* couldn't be created or didn't exist */ return rc; if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev && (other->kbdfeed || other->leds) && (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) { rc = _XkbCreateIndicatorMap(other, stuff->indicator, stuff->ledClass, stuff->ledID, &map, &led, TRUE); if (rc != Success || !map) return rc; } } } /* All checks passed, let's do it */ rc = _XkbSetNamedIndicator(client, dev, stuff); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev && (other->kbdfeed || other->leds) && (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) { _XkbSetNamedIndicator(client, other, stuff); } } } return Success; } /***====================================================================***/ static CARD32 _XkbCountAtoms(Atom *atoms, int maxAtoms, int *count) { register unsigned int i, bit, nAtoms; register CARD32 atomsPresent; for (i = nAtoms = atomsPresent = 0, bit = 1; i < maxAtoms; i++, bit <<= 1) { if (atoms[i] != None) { atomsPresent |= bit; nAtoms++; } } if (count) *count = nAtoms; return atomsPresent; } static char * _XkbWriteAtoms(char *wire, Atom *atoms, int maxAtoms, int swap) { register unsigned int i; Atom *atm; atm = (Atom *) wire; for (i = 0; i < maxAtoms; i++) { if (atoms[i] != None) { *atm = atoms[i]; if (swap) { swapl(atm); } atm++; } } return (char *) atm; } static Status XkbComputeGetNamesReplySize(XkbDescPtr xkb, xkbGetNamesReply * rep) { register unsigned which, length; register int i; rep->minKeyCode = xkb->min_key_code; rep->maxKeyCode = xkb->max_key_code; which = rep->which; length = 0; if (xkb->names != NULL) { if (which & XkbKeycodesNameMask) length++; if (which & XkbGeometryNameMask) length++; if (which & XkbSymbolsNameMask) length++; if (which & XkbPhysSymbolsNameMask) length++; if (which & XkbTypesNameMask) length++; if (which & XkbCompatNameMask) length++; } else which &= ~XkbComponentNamesMask; if (xkb->map != NULL) { if (which & XkbKeyTypeNamesMask) length += xkb->map->num_types; rep->nTypes = xkb->map->num_types; if (which & XkbKTLevelNamesMask) { XkbKeyTypePtr pType = xkb->map->types; int nKTLevels = 0; length += XkbPaddedSize(xkb->map->num_types) / 4; for (i = 0; i < xkb->map->num_types; i++, pType++) { if (pType->level_names != NULL) nKTLevels += pType->num_levels; } rep->nKTLevels = nKTLevels; length += nKTLevels; } } else { rep->nTypes = 0; rep->nKTLevels = 0; which &= ~(XkbKeyTypeNamesMask | XkbKTLevelNamesMask); } rep->minKeyCode = xkb->min_key_code; rep->maxKeyCode = xkb->max_key_code; rep->indicators = 0; rep->virtualMods = 0; rep->groupNames = 0; if (xkb->names != NULL) { if (which & XkbIndicatorNamesMask) { int nLeds; rep->indicators = _XkbCountAtoms(xkb->names->indicators, XkbNumIndicators, &nLeds); length += nLeds; if (nLeds == 0) which &= ~XkbIndicatorNamesMask; } if (which & XkbVirtualModNamesMask) { int nVMods; rep->virtualMods = _XkbCountAtoms(xkb->names->vmods, XkbNumVirtualMods, &nVMods); length += nVMods; if (nVMods == 0) which &= ~XkbVirtualModNamesMask; } if (which & XkbGroupNamesMask) { int nGroups; rep->groupNames = _XkbCountAtoms(xkb->names->groups, XkbNumKbdGroups, &nGroups); length += nGroups; if (nGroups == 0) which &= ~XkbGroupNamesMask; } if ((which & XkbKeyNamesMask) && (xkb->names->keys)) length += rep->nKeys; else which &= ~XkbKeyNamesMask; if ((which & XkbKeyAliasesMask) && (xkb->names->key_aliases) && (xkb->names->num_key_aliases > 0)) { rep->nKeyAliases = xkb->names->num_key_aliases; length += rep->nKeyAliases * 2; } else { which &= ~XkbKeyAliasesMask; rep->nKeyAliases = 0; } if ((which & XkbRGNamesMask) && (xkb->names->num_rg > 0)) length += xkb->names->num_rg; else which &= ~XkbRGNamesMask; } else { which &= ~(XkbIndicatorNamesMask | XkbVirtualModNamesMask); which &= ~(XkbGroupNamesMask | XkbKeyNamesMask | XkbKeyAliasesMask); which &= ~XkbRGNamesMask; } rep->length = length; rep->which = which; return Success; } static int XkbSendNames(ClientPtr client, XkbDescPtr xkb, xkbGetNamesReply * rep) { register unsigned i, length, which; char *start; char *desc; length = rep->length * 4; which = rep->which; if (client->swapped) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->which); swaps(&rep->virtualMods); swapl(&rep->indicators); } start = desc = calloc(1, length); if (!start) return BadAlloc; if (xkb->names) { if (which & XkbKeycodesNameMask) { *((CARD32 *) desc) = xkb->names->keycodes; if (client->swapped) { swapl((int *) desc); } desc += 4; } if (which & XkbGeometryNameMask) { *((CARD32 *) desc) = xkb->names->geometry; if (client->swapped) { swapl((int *) desc); } desc += 4; } if (which & XkbSymbolsNameMask) { *((CARD32 *) desc) = xkb->names->symbols; if (client->swapped) { swapl((int *) desc); } desc += 4; } if (which & XkbPhysSymbolsNameMask) { register CARD32 *atm = (CARD32 *) desc; atm[0] = (CARD32) xkb->names->phys_symbols; if (client->swapped) { swapl(&atm[0]); } desc += 4; } if (which & XkbTypesNameMask) { *((CARD32 *) desc) = (CARD32) xkb->names->types; if (client->swapped) { swapl((int *) desc); } desc += 4; } if (which & XkbCompatNameMask) { *((CARD32 *) desc) = (CARD32) xkb->names->compat; if (client->swapped) { swapl((int *) desc); } desc += 4; } if (which & XkbKeyTypeNamesMask) { register CARD32 *atm = (CARD32 *) desc; register XkbKeyTypePtr type = xkb->map->types; for (i = 0; i < xkb->map->num_types; i++, atm++, type++) { *atm = (CARD32) type->name; if (client->swapped) { swapl(atm); } } desc = (char *) atm; } if (which & XkbKTLevelNamesMask && xkb->map) { XkbKeyTypePtr type = xkb->map->types; register CARD32 *atm; for (i = 0; i < rep->nTypes; i++, type++) { *desc++ = type->num_levels; } desc += XkbPaddedSize(rep->nTypes) - rep->nTypes; atm = (CARD32 *) desc; type = xkb->map->types; for (i = 0; i < xkb->map->num_types; i++, type++) { register unsigned l; if (type->level_names) { for (l = 0; l < type->num_levels; l++, atm++) { *atm = type->level_names[l]; if (client->swapped) { swapl(atm); } } desc += type->num_levels * 4; } } } if (which & XkbIndicatorNamesMask) { desc = _XkbWriteAtoms(desc, xkb->names->indicators, XkbNumIndicators, client->swapped); } if (which & XkbVirtualModNamesMask) { desc = _XkbWriteAtoms(desc, xkb->names->vmods, XkbNumVirtualMods, client->swapped); } if (which & XkbGroupNamesMask) { desc = _XkbWriteAtoms(desc, xkb->names->groups, XkbNumKbdGroups, client->swapped); } if (which & XkbKeyNamesMask) { for (i = 0; i < rep->nKeys; i++, desc += sizeof(XkbKeyNameRec)) { *((XkbKeyNamePtr) desc) = xkb->names->keys[i + rep->firstKey]; } } if (which & XkbKeyAliasesMask) { XkbKeyAliasPtr pAl; pAl = xkb->names->key_aliases; for (i = 0; i < rep->nKeyAliases; i++, pAl++, desc += 2 * XkbKeyNameLength) { *((XkbKeyAliasPtr) desc) = *pAl; } } if ((which & XkbRGNamesMask) && (rep->nRadioGroups > 0)) { register CARD32 *atm = (CARD32 *) desc; for (i = 0; i < rep->nRadioGroups; i++, atm++) { *atm = (CARD32) xkb->names->radio_groups[i]; if (client->swapped) { swapl(atm); } } desc += rep->nRadioGroups * 4; } } if ((desc - start) != (length)) { ErrorF("[xkb] BOGUS LENGTH in write names, expected %d, got %ld\n", length, (unsigned long) (desc - start)); } WriteToClient(client, SIZEOF(xkbGetNamesReply), rep); WriteToClient(client, length, start); free((char *) start); return Success; } int ProcXkbGetNames(ClientPtr client) { DeviceIntPtr dev; XkbDescPtr xkb; xkbGetNamesReply rep; REQUEST(xkbGetNamesReq); REQUEST_SIZE_MATCH(xkbGetNamesReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); CHK_MASK_LEGAL(0x01, stuff->which, XkbAllNamesMask); xkb = dev->key->xkbInfo->desc; 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); } /***====================================================================***/ static CARD32 * _XkbCheckAtoms(CARD32 *wire, int nAtoms, int swapped, Atom *pError) { register int i; for (i = 0; i < nAtoms; i++, wire++) { if (swapped) { swapl(wire); } if ((((Atom) *wire) != None) && (!ValidAtom((Atom) *wire))) { *pError = ((Atom) *wire); return NULL; } } return wire; } static CARD32 * _XkbCheckMaskedAtoms(CARD32 *wire, int nAtoms, CARD32 present, int swapped, Atom *pError) { register unsigned i, bit; for (i = 0, bit = 1; (i < nAtoms) && (present); i++, bit <<= 1) { if ((present & bit) == 0) continue; if (swapped) { swapl(wire); } if ((((Atom) *wire) != None) && (!ValidAtom(((Atom) *wire)))) { *pError = (Atom) *wire; return NULL; } wire++; } return wire; } static Atom * _XkbCopyMaskedAtoms(Atom *wire, Atom *dest, int nAtoms, CARD32 present) { register int i, bit; for (i = 0, bit = 1; (i < nAtoms) && (present); i++, bit <<= 1) { if ((present & bit) == 0) continue; dest[i] = *wire++; } return wire; } static Bool _XkbCheckTypeName(Atom name, int typeNdx) { const char *str; str = NameForAtom(name); if ((strcmp(str, "ONE_LEVEL") == 0) || (strcmp(str, "TWO_LEVEL") == 0) || (strcmp(str, "ALPHABETIC") == 0) || (strcmp(str, "KEYPAD") == 0)) return FALSE; return TRUE; } /** * Check the device-dependent data in the request against the device. Returns * Success, or the appropriate error code. */ static int _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, xkbSetNamesReq * stuff, CARD32 *data) { XkbDescRec *xkb; CARD32 *tmp; Atom bad = None; tmp = data; xkb = dev->key->xkbInfo->desc; if (stuff->which & XkbKeyTypeNamesMask) { int i; CARD32 *old; if (stuff->nTypes < 1) { client->errorValue = _XkbErrCode2(0x02, stuff->nTypes); return BadValue; } if ((unsigned) (stuff->firstType + stuff->nTypes - 1) >= xkb->map->num_types) { client->errorValue = _XkbErrCode4(0x03, stuff->firstType, stuff->nTypes, xkb->map->num_types); return BadValue; } if (((unsigned) stuff->firstType) <= XkbLastRequiredType) { client->errorValue = _XkbErrCode2(0x04, stuff->firstType); return BadAccess; } old = tmp; tmp = _XkbCheckAtoms(tmp, stuff->nTypes, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } for (i = 0; i < stuff->nTypes; i++, old++) { if (!_XkbCheckTypeName((Atom) *old, stuff->firstType + i)) client->errorValue = _XkbErrCode2(0x05, i); } } if (stuff->which & XkbKTLevelNamesMask) { unsigned i; XkbKeyTypePtr type; CARD8 *width; if (stuff->nKTLevels < 1) { client->errorValue = _XkbErrCode2(0x05, stuff->nKTLevels); return BadValue; } if ((unsigned) (stuff->firstKTLevel + stuff->nKTLevels - 1) >= xkb->map->num_types) { client->errorValue = _XkbErrCode4(0x06, stuff->firstKTLevel, stuff->nKTLevels, xkb->map->num_types); return BadValue; } width = (CARD8 *) tmp; tmp = (CARD32 *) (((char *) tmp) + XkbPaddedSize(stuff->nKTLevels)); type = &xkb->map->types[stuff->firstKTLevel]; for (i = 0; i < stuff->nKTLevels; i++, type++) { if (width[i] == 0) continue; else if (width[i] != type->num_levels) { client->errorValue = _XkbErrCode4(0x07, i + stuff->firstKTLevel, type->num_levels, width[i]); return BadMatch; } tmp = _XkbCheckAtoms(tmp, width[i], client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } } if (stuff->which & XkbIndicatorNamesMask) { if (stuff->indicators == 0) { client->errorValue = 0x08; return BadMatch; } tmp = _XkbCheckMaskedAtoms(tmp, XkbNumIndicators, stuff->indicators, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbVirtualModNamesMask) { if (stuff->virtualMods == 0) { client->errorValue = 0x09; return BadMatch; } tmp = _XkbCheckMaskedAtoms(tmp, XkbNumVirtualMods, (CARD32) stuff->virtualMods, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbGroupNamesMask) { if (stuff->groupNames == 0) { client->errorValue = 0x0a; return BadMatch; } tmp = _XkbCheckMaskedAtoms(tmp, XkbNumKbdGroups, (CARD32) stuff->groupNames, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbKeyNamesMask) { if (stuff->firstKey < (unsigned) xkb->min_key_code) { client->errorValue = _XkbErrCode3(0x0b, xkb->min_key_code, stuff->firstKey); return BadValue; } if (((unsigned) (stuff->firstKey + stuff->nKeys - 1) > xkb->max_key_code) || (stuff->nKeys < 1)) { client->errorValue = _XkbErrCode4(0x0c, xkb->max_key_code, stuff->firstKey, stuff->nKeys); return BadValue; } tmp += stuff->nKeys; } if ((stuff->which & XkbKeyAliasesMask) && (stuff->nKeyAliases > 0)) { tmp += stuff->nKeyAliases * 2; } if (stuff->which & XkbRGNamesMask) { if (stuff->nRadioGroups < 1) { client->errorValue = _XkbErrCode2(0x0d, stuff->nRadioGroups); return BadValue; } tmp = _XkbCheckAtoms(tmp, stuff->nRadioGroups, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if ((tmp - ((CARD32 *) stuff)) != stuff->length) { client->errorValue = stuff->length; return BadLength; } return Success; } static int _XkbSetNames(ClientPtr client, DeviceIntPtr dev, xkbSetNamesReq * stuff) { XkbDescRec *xkb; XkbNamesRec *names; CARD32 *tmp; xkbNamesNotify nn; tmp = (CARD32 *) &stuff[1]; xkb = dev->key->xkbInfo->desc; names = xkb->names; if (XkbAllocNames(xkb, stuff->which, stuff->nRadioGroups, stuff->nKeyAliases) != Success) { return BadAlloc; } memset(&nn, 0, sizeof(xkbNamesNotify)); nn.changed = stuff->which; tmp = (CARD32 *) &stuff[1]; if (stuff->which & XkbKeycodesNameMask) names->keycodes = *tmp++; if (stuff->which & XkbGeometryNameMask) names->geometry = *tmp++; if (stuff->which & XkbSymbolsNameMask) names->symbols = *tmp++; if (stuff->which & XkbPhysSymbolsNameMask) names->phys_symbols = *tmp++; if (stuff->which & XkbTypesNameMask) names->types = *tmp++; if (stuff->which & XkbCompatNameMask) names->compat = *tmp++; if ((stuff->which & XkbKeyTypeNamesMask) && (stuff->nTypes > 0)) { register unsigned i; register XkbKeyTypePtr type; type = &xkb->map->types[stuff->firstType]; for (i = 0; i < stuff->nTypes; i++, type++) { type->name = *tmp++; } nn.firstType = stuff->firstType; nn.nTypes = stuff->nTypes; } if (stuff->which & XkbKTLevelNamesMask) { register XkbKeyTypePtr type; register unsigned i; CARD8 *width; width = (CARD8 *) tmp; tmp = (CARD32 *) (((char *) tmp) + XkbPaddedSize(stuff->nKTLevels)); type = &xkb->map->types[stuff->firstKTLevel]; for (i = 0; i < stuff->nKTLevels; i++, type++) { if (width[i] > 0) { if (type->level_names) { register unsigned n; for (n = 0; n < width[i]; n++) { type->level_names[n] = tmp[n]; } } tmp += width[i]; } } nn.firstLevelName = 0; nn.nLevelNames = stuff->nTypes; } if (stuff->which & XkbIndicatorNamesMask) { tmp = _XkbCopyMaskedAtoms(tmp, names->indicators, XkbNumIndicators, stuff->indicators); nn.changedIndicators = stuff->indicators; } if (stuff->which & XkbVirtualModNamesMask) { tmp = _XkbCopyMaskedAtoms(tmp, names->vmods, XkbNumVirtualMods, stuff->virtualMods); nn.changedVirtualMods = stuff->virtualMods; } if (stuff->which & XkbGroupNamesMask) { tmp = _XkbCopyMaskedAtoms(tmp, names->groups, XkbNumKbdGroups, stuff->groupNames); nn.changedVirtualMods = stuff->groupNames; } if (stuff->which & XkbKeyNamesMask) { memcpy((char *) &names->keys[stuff->firstKey], (char *) tmp, stuff->nKeys * XkbKeyNameLength); tmp += stuff->nKeys; nn.firstKey = stuff->firstKey; nn.nKeys = stuff->nKeys; } if (stuff->which & XkbKeyAliasesMask) { if (stuff->nKeyAliases > 0) { register int na = stuff->nKeyAliases; if (XkbAllocNames(xkb, XkbKeyAliasesMask, 0, na) != Success) return BadAlloc; memcpy((char *) names->key_aliases, (char *) tmp, stuff->nKeyAliases * sizeof(XkbKeyAliasRec)); tmp += stuff->nKeyAliases * 2; } else if (names->key_aliases != NULL) { free(names->key_aliases); names->key_aliases = NULL; names->num_key_aliases = 0; } nn.nAliases = names->num_key_aliases; } if (stuff->which & XkbRGNamesMask) { if (stuff->nRadioGroups > 0) { register unsigned i, nrg; nrg = stuff->nRadioGroups; if (XkbAllocNames(xkb, XkbRGNamesMask, nrg, 0) != Success) return BadAlloc; for (i = 0; i < stuff->nRadioGroups; i++) { names->radio_groups[i] = tmp[i]; } tmp += stuff->nRadioGroups; } else if (names->radio_groups) { free(names->radio_groups); names->radio_groups = NULL; names->num_rg = 0; } nn.nRadioGroups = names->num_rg; } if (nn.changed) { Bool needExtEvent; needExtEvent = (nn.changed & XkbIndicatorNamesMask) != 0; XkbSendNamesNotify(dev, &nn); if (needExtEvent) { XkbSrvLedInfoPtr sli; xkbExtensionDeviceNotify edev; register int i; register unsigned bit; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, XkbXI_IndicatorsMask); sli->namesPresent = 0; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (names->indicators[i] != None) sli->namesPresent |= bit; } memset(&edev, 0, sizeof(xkbExtensionDeviceNotify)); edev.reason = XkbXI_IndicatorNamesMask; edev.ledClass = KbdFeedbackClass; edev.ledID = dev->kbdfeed->ctrl.id; edev.ledsDefined = sli->namesPresent | sli->mapsPresent; edev.ledState = sli->effectiveState; edev.firstBtn = 0; edev.nBtns = 0; edev.supported = XkbXI_AllFeaturesMask; edev.unsupported = 0; XkbSendExtensionDeviceNotify(dev, client, &edev); } } return Success; } int ProcXkbSetNames(ClientPtr client) { DeviceIntPtr dev; CARD32 *tmp; Atom bad; int rc; REQUEST(xkbSetNamesReq); REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); CHK_MASK_LEGAL(0x01, stuff->which, XkbAllNamesMask); /* check device-independent stuff */ tmp = (CARD32 *) &stuff[1]; if (stuff->which & XkbKeycodesNameMask) { tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbGeometryNameMask) { tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbSymbolsNameMask) { tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbPhysSymbolsNameMask) { tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbTypesNameMask) { tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } if (stuff->which & XkbCompatNameMask) { tmp = _XkbCheckAtoms(tmp, 1, client->swapped, &bad); if (!tmp) { client->errorValue = bad; return BadAtom; } } /* start of device-dependent tests */ rc = _XkbSetNamesCheck(client, dev, stuff, tmp); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) { rc = _XkbSetNamesCheck(client, other, stuff, tmp); if (rc != Success) return rc; } } } } /* everything is okay -- update names */ rc = _XkbSetNames(client, dev, stuff); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) _XkbSetNames(client, other, stuff); } } } /* everything is okay -- update names */ return Success; } /***====================================================================***/ #include "xkbgeom.h" #define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) /** * Write the zero-terminated string str into wire as a pascal string with a * 16-bit length field prefixed before the actual string. * * @param wire The destination array, usually the wire struct * @param str The source string as zero-terminated C string * @param swap If TRUE, the length field is swapped. * * @return The input string in the format with a * (swapped) 16 bit string length, non-zero terminated. */ static char * XkbWriteCountedString(char *wire, const char *str, Bool swap) { CARD16 len, *pLen, paddedLen; if (!str) return wire; len = strlen(str); pLen = (CARD16 *) wire; *pLen = len; if (swap) { swaps(pLen); } paddedLen = pad_to_int32(sizeof(len) + len) - sizeof(len); strncpy(&wire[sizeof(len)], str, paddedLen); wire += sizeof(len) + paddedLen; return wire; } static int XkbSizeGeomProperties(XkbGeometryPtr geom) { register int i, size; XkbPropertyPtr prop; for (size = i = 0, prop = geom->properties; i < geom->num_properties; i++, prop++) { size += XkbSizeCountedString(prop->name); size += XkbSizeCountedString(prop->value); } return size; } static char * XkbWriteGeomProperties(char *wire, XkbGeometryPtr geom, Bool swap) { register int i; register XkbPropertyPtr prop; for (i = 0, prop = geom->properties; i < geom->num_properties; i++, prop++) { wire = XkbWriteCountedString(wire, prop->name, swap); wire = XkbWriteCountedString(wire, prop->value, swap); } return wire; } static int XkbSizeGeomKeyAliases(XkbGeometryPtr geom) { return geom->num_key_aliases * (2 * XkbKeyNameLength); } static char * XkbWriteGeomKeyAliases(char *wire, XkbGeometryPtr geom, Bool swap) { register int sz; sz = geom->num_key_aliases * (XkbKeyNameLength * 2); if (sz > 0) { memcpy(wire, (char *) geom->key_aliases, sz); wire += sz; } return wire; } static int XkbSizeGeomColors(XkbGeometryPtr geom) { register int i, size; register XkbColorPtr color; for (i = size = 0, color = geom->colors; i < geom->num_colors; i++, color++) { size += XkbSizeCountedString(color->spec); } return size; } static char * XkbWriteGeomColors(char *wire, XkbGeometryPtr geom, Bool swap) { register int i; register XkbColorPtr color; for (i = 0, color = geom->colors; i < geom->num_colors; i++, color++) { wire = XkbWriteCountedString(wire, color->spec, swap); } return wire; } static int XkbSizeGeomShapes(XkbGeometryPtr geom) { register int i, size; register XkbShapePtr shape; for (i = size = 0, shape = geom->shapes; i < geom->num_shapes; i++, shape++) { register int n; register XkbOutlinePtr ol; size += SIZEOF(xkbShapeWireDesc); for (n = 0, ol = shape->outlines; n < shape->num_outlines; n++, ol++) { size += SIZEOF(xkbOutlineWireDesc); size += ol->num_points * SIZEOF(xkbPointWireDesc); } } return size; } static char * XkbWriteGeomShapes(char *wire, XkbGeometryPtr geom, Bool swap) { int i; XkbShapePtr shape; xkbShapeWireDesc *shapeWire; for (i = 0, shape = geom->shapes; i < geom->num_shapes; i++, shape++) { register int o; XkbOutlinePtr ol; xkbOutlineWireDesc *olWire; shapeWire = (xkbShapeWireDesc *) wire; shapeWire->name = shape->name; shapeWire->nOutlines = shape->num_outlines; if (shape->primary != NULL) shapeWire->primaryNdx = XkbOutlineIndex(shape, shape->primary); else shapeWire->primaryNdx = XkbNoShape; if (shape->approx != NULL) shapeWire->approxNdx = XkbOutlineIndex(shape, shape->approx); else shapeWire->approxNdx = XkbNoShape; shapeWire->pad = 0; if (swap) { swapl(&shapeWire->name); } wire = (char *) &shapeWire[1]; for (o = 0, ol = shape->outlines; o < shape->num_outlines; o++, ol++) { register int p; XkbPointPtr pt; xkbPointWireDesc *ptWire; olWire = (xkbOutlineWireDesc *) wire; olWire->nPoints = ol->num_points; olWire->cornerRadius = ol->corner_radius; olWire->pad = 0; wire = (char *) &olWire[1]; ptWire = (xkbPointWireDesc *) wire; for (p = 0, pt = ol->points; p < ol->num_points; p++, pt++) { ptWire[p].x = pt->x; ptWire[p].y = pt->y; if (swap) { swaps(&ptWire[p].x); swaps(&ptWire[p].y); } } wire = (char *) &ptWire[ol->num_points]; } } return wire; } static int XkbSizeGeomDoodads(int num_doodads, XkbDoodadPtr doodad) { register int i, size; for (i = size = 0; i < num_doodads; i++, doodad++) { size += SIZEOF(xkbAnyDoodadWireDesc); if (doodad->any.type == XkbTextDoodad) { size += XkbSizeCountedString(doodad->text.text); size += XkbSizeCountedString(doodad->text.font); } else if (doodad->any.type == XkbLogoDoodad) { size += XkbSizeCountedString(doodad->logo.logo_name); } } return size; } static char * XkbWriteGeomDoodads(char *wire, int num_doodads, XkbDoodadPtr doodad, Bool swap) { register int i; xkbDoodadWireDesc *doodadWire; for (i = 0; i < num_doodads; i++, doodad++) { doodadWire = (xkbDoodadWireDesc *) wire; wire = (char *) &doodadWire[1]; memset(doodadWire, 0, SIZEOF(xkbDoodadWireDesc)); doodadWire->any.name = doodad->any.name; doodadWire->any.type = doodad->any.type; doodadWire->any.priority = doodad->any.priority; doodadWire->any.top = doodad->any.top; doodadWire->any.left = doodad->any.left; if (swap) { swapl(&doodadWire->any.name); swaps(&doodadWire->any.top); swaps(&doodadWire->any.left); } switch (doodad->any.type) { case XkbOutlineDoodad: case XkbSolidDoodad: doodadWire->shape.angle = doodad->shape.angle; doodadWire->shape.colorNdx = doodad->shape.color_ndx; doodadWire->shape.shapeNdx = doodad->shape.shape_ndx; if (swap) { swaps(&doodadWire->shape.angle); } break; case XkbTextDoodad: doodadWire->text.angle = doodad->text.angle; doodadWire->text.width = doodad->text.width; doodadWire->text.height = doodad->text.height; doodadWire->text.colorNdx = doodad->text.color_ndx; if (swap) { swaps(&doodadWire->text.angle); swaps(&doodadWire->text.width); swaps(&doodadWire->text.height); } wire = XkbWriteCountedString(wire, doodad->text.text, swap); wire = XkbWriteCountedString(wire, doodad->text.font, swap); break; case XkbIndicatorDoodad: doodadWire->indicator.shapeNdx = doodad->indicator.shape_ndx; doodadWire->indicator.onColorNdx = doodad->indicator.on_color_ndx; doodadWire->indicator.offColorNdx = doodad->indicator.off_color_ndx; break; case XkbLogoDoodad: doodadWire->logo.angle = doodad->logo.angle; doodadWire->logo.colorNdx = doodad->logo.color_ndx; doodadWire->logo.shapeNdx = doodad->logo.shape_ndx; wire = XkbWriteCountedString(wire, doodad->logo.logo_name, swap); break; default: ErrorF("[xkb] Unknown doodad type %d in XkbWriteGeomDoodads\n", doodad->any.type); ErrorF("[xkb] Ignored\n"); break; } } return wire; } static char * XkbWriteGeomOverlay(char *wire, XkbOverlayPtr ol, Bool swap) { register int r; XkbOverlayRowPtr row; xkbOverlayWireDesc *olWire; olWire = (xkbOverlayWireDesc *) wire; olWire->name = ol->name; olWire->nRows = ol->num_rows; olWire->pad1 = 0; olWire->pad2 = 0; if (swap) { swapl(&olWire->name); } wire = (char *) &olWire[1]; for (r = 0, row = ol->rows; r < ol->num_rows; r++, row++) { unsigned int k; XkbOverlayKeyPtr key; xkbOverlayRowWireDesc *rowWire; rowWire = (xkbOverlayRowWireDesc *) wire; rowWire->rowUnder = row->row_under; rowWire->nKeys = row->num_keys; rowWire->pad1 = 0; wire = (char *) &rowWire[1]; for (k = 0, key = row->keys; k < row->num_keys; k++, key++) { xkbOverlayKeyWireDesc *keyWire; keyWire = (xkbOverlayKeyWireDesc *) wire; memcpy(keyWire->over, key->over.name, XkbKeyNameLength); memcpy(keyWire->under, key->under.name, XkbKeyNameLength); wire = (char *) &keyWire[1]; } } return wire; } static int XkbSizeGeomSections(XkbGeometryPtr geom) { register int i, size; XkbSectionPtr section; for (i = size = 0, section = geom->sections; i < geom->num_sections; i++, section++) { size += SIZEOF(xkbSectionWireDesc); if (section->rows) { int r; XkbRowPtr row; for (r = 0, row = section->rows; r < section->num_rows; row++, r++) { size += SIZEOF(xkbRowWireDesc); size += row->num_keys * SIZEOF(xkbKeyWireDesc); } } if (section->doodads) size += XkbSizeGeomDoodads(section->num_doodads, section->doodads); if (section->overlays) { int o; XkbOverlayPtr ol; for (o = 0, ol = section->overlays; o < section->num_overlays; o++, ol++) { int r; XkbOverlayRowPtr row; size += SIZEOF(xkbOverlayWireDesc); for (r = 0, row = ol->rows; r < ol->num_rows; r++, row++) { size += SIZEOF(xkbOverlayRowWireDesc); size += row->num_keys * SIZEOF(xkbOverlayKeyWireDesc); } } } } return size; } static char * XkbWriteGeomSections(char *wire, XkbGeometryPtr geom, Bool swap) { register int i; XkbSectionPtr section; xkbSectionWireDesc *sectionWire; for (i = 0, section = geom->sections; i < geom->num_sections; i++, section++) { sectionWire = (xkbSectionWireDesc *) wire; sectionWire->name = section->name; sectionWire->top = section->top; sectionWire->left = section->left; sectionWire->width = section->width; sectionWire->height = section->height; sectionWire->angle = section->angle; sectionWire->priority = section->priority; sectionWire->nRows = section->num_rows; sectionWire->nDoodads = section->num_doodads; sectionWire->nOverlays = section->num_overlays; sectionWire->pad = 0; if (swap) { swapl(§ionWire->name); swaps(§ionWire->top); swaps(§ionWire->left); swaps(§ionWire->width); swaps(§ionWire->height); swaps(§ionWire->angle); } wire = (char *) §ionWire[1]; if (section->rows) { int r; XkbRowPtr row; xkbRowWireDesc *rowWire; for (r = 0, row = section->rows; r < section->num_rows; r++, row++) { rowWire = (xkbRowWireDesc *) wire; rowWire->top = row->top; rowWire->left = row->left; rowWire->nKeys = row->num_keys; rowWire->vertical = row->vertical; rowWire->pad = 0; if (swap) { swaps(&rowWire->top); swaps(&rowWire->left); } wire = (char *) &rowWire[1]; if (row->keys) { int k; XkbKeyPtr key; xkbKeyWireDesc *keyWire; keyWire = (xkbKeyWireDesc *) wire; for (k = 0, key = row->keys; k < row->num_keys; k++, key++) { memcpy(keyWire[k].name, key->name.name, XkbKeyNameLength); keyWire[k].gap = key->gap; keyWire[k].shapeNdx = key->shape_ndx; keyWire[k].colorNdx = key->color_ndx; if (swap) { swaps(&keyWire[k].gap); } } wire = (char *) &keyWire[row->num_keys]; } } } if (section->doodads) { wire = XkbWriteGeomDoodads(wire, section->num_doodads, section->doodads, swap); } if (section->overlays) { register int o; for (o = 0; o < section->num_overlays; o++) { wire = XkbWriteGeomOverlay(wire, §ion->overlays[o], swap); } } } return wire; } static Status XkbComputeGetGeometryReplySize(XkbGeometryPtr geom, xkbGetGeometryReply * rep, Atom name) { int len; if (geom != NULL) { len = XkbSizeCountedString(geom->label_font); len += XkbSizeGeomProperties(geom); len += XkbSizeGeomColors(geom); len += XkbSizeGeomShapes(geom); len += XkbSizeGeomSections(geom); len += XkbSizeGeomDoodads(geom->num_doodads, geom->doodads); len += XkbSizeGeomKeyAliases(geom); rep->length = len / 4; rep->found = TRUE; rep->name = geom->name; rep->widthMM = geom->width_mm; rep->heightMM = geom->height_mm; rep->nProperties = geom->num_properties; rep->nColors = geom->num_colors; rep->nShapes = geom->num_shapes; rep->nSections = geom->num_sections; rep->nDoodads = geom->num_doodads; rep->nKeyAliases = geom->num_key_aliases; rep->baseColorNdx = XkbGeomColorIndex(geom, geom->base_color); rep->labelColorNdx = XkbGeomColorIndex(geom, geom->label_color); } else { rep->length = 0; rep->found = FALSE; rep->name = name; rep->widthMM = rep->heightMM = 0; rep->nProperties = rep->nColors = rep->nShapes = 0; rep->nSections = rep->nDoodads = 0; rep->nKeyAliases = 0; rep->labelColorNdx = rep->baseColorNdx = 0; } return Success; } static int XkbSendGeometry(ClientPtr client, XkbGeometryPtr geom, xkbGetGeometryReply * rep, Bool freeGeom) { char *desc, *start; int len; if (geom != NULL) { len = rep->length * 4; start = desc = malloc(len); if (!start) return BadAlloc; desc = XkbWriteCountedString(desc, geom->label_font, client->swapped); if (rep->nProperties > 0) desc = XkbWriteGeomProperties(desc, geom, client->swapped); if (rep->nColors > 0) desc = XkbWriteGeomColors(desc, geom, client->swapped); if (rep->nShapes > 0) desc = XkbWriteGeomShapes(desc, geom, client->swapped); if (rep->nSections > 0) desc = XkbWriteGeomSections(desc, geom, client->swapped); if (rep->nDoodads > 0) desc = XkbWriteGeomDoodads(desc, geom->num_doodads, geom->doodads, client->swapped); if (rep->nKeyAliases > 0) desc = XkbWriteGeomKeyAliases(desc, geom, client->swapped); if ((desc - start) != (len)) { ErrorF ("[xkb] BOGUS LENGTH in XkbSendGeometry, expected %d, got %ld\n", len, (unsigned long) (desc - start)); } } else { len = 0; start = NULL; } if (client->swapped) { swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->name); swaps(&rep->widthMM); swaps(&rep->heightMM); swaps(&rep->nProperties); swaps(&rep->nColors); swaps(&rep->nShapes); swaps(&rep->nSections); swaps(&rep->nDoodads); swaps(&rep->nKeyAliases); } WriteToClient(client, SIZEOF(xkbGetGeometryReply), rep); if (len > 0) WriteToClient(client, len, start); if (start != NULL) free((char *) start); if (freeGeom) XkbFreeGeometry(geom, XkbGeomAllMask, TRUE); return Success; } int ProcXkbGetGeometry(ClientPtr client) { DeviceIntPtr dev; xkbGetGeometryReply rep; XkbGeometryPtr geom; Bool shouldFree; Status status; REQUEST(xkbGetGeometryReq); REQUEST_SIZE_MATCH(xkbGetGeometryReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); CHK_ATOM_OR_NONE(stuff->name); geom = XkbLookupNamedGeometry(dev, stuff->name, &shouldFree); rep = (xkbGetGeometryReply) { .type = X_Reply, .deviceID = dev->id, .sequenceNumber = client->sequence, .length = 0 }; status = XkbComputeGetGeometryReplySize(geom, &rep, stuff->name); if (status != Success) return status; else return XkbSendGeometry(client, geom, &rep, shouldFree); } /***====================================================================***/ static Status _GetCountedString(char **wire_inout, ClientPtr client, char **str) { char *wire, *next; CARD16 len; wire = *wire_inout; len = *(CARD16 *) wire; if (client->swapped) { swaps(&len); } next = wire + XkbPaddedSize(len + 2); /* Check we're still within the size of the request */ if (client->req_len < bytes_to_int32(next - (char *) client->requestBuffer)) return BadValue; *str = malloc(len + 1); if (!*str) return BadAlloc; memcpy(*str, &wire[2], len); *(*str + len) = '\0'; *wire_inout = next; return Success; } static Status _CheckSetDoodad(char **wire_inout, XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) { char *wire; xkbDoodadWireDesc *dWire; xkbAnyDoodadWireDesc any; xkbTextDoodadWireDesc text; XkbDoodadPtr doodad; Status status; dWire = (xkbDoodadWireDesc *) (*wire_inout); any = dWire->any; wire = (char *) &dWire[1]; if (client->swapped) { swapl(&any.name); swaps(&any.top); swaps(&any.left); swaps(&any.angle); } CHK_ATOM_ONLY(dWire->any.name); doodad = XkbAddGeomDoodad(geom, section, any.name); if (!doodad) return BadAlloc; doodad->any.type = dWire->any.type; doodad->any.priority = dWire->any.priority; doodad->any.top = any.top; doodad->any.left = any.left; doodad->any.angle = any.angle; switch (doodad->any.type) { case XkbOutlineDoodad: case XkbSolidDoodad: if (dWire->shape.colorNdx >= geom->num_colors) { client->errorValue = _XkbErrCode3(0x40, geom->num_colors, dWire->shape.colorNdx); return BadMatch; } if (dWire->shape.shapeNdx >= geom->num_shapes) { client->errorValue = _XkbErrCode3(0x41, geom->num_shapes, dWire->shape.shapeNdx); return BadMatch; } doodad->shape.color_ndx = dWire->shape.colorNdx; doodad->shape.shape_ndx = dWire->shape.shapeNdx; break; case XkbTextDoodad: if (dWire->text.colorNdx >= geom->num_colors) { client->errorValue = _XkbErrCode3(0x42, geom->num_colors, dWire->text.colorNdx); return BadMatch; } text = dWire->text; if (client->swapped) { swaps(&text.width); swaps(&text.height); } doodad->text.width = text.width; doodad->text.height = text.height; doodad->text.color_ndx = dWire->text.colorNdx; status = _GetCountedString(&wire, client, &doodad->text.text); if (status != Success) return status; status = _GetCountedString(&wire, client, &doodad->text.font); if (status != Success) { free (doodad->text.text); return status; } break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx >= geom->num_colors) { client->errorValue = _XkbErrCode3(0x43, geom->num_colors, dWire->indicator.onColorNdx); return BadMatch; } if (dWire->indicator.offColorNdx >= geom->num_colors) { client->errorValue = _XkbErrCode3(0x44, geom->num_colors, dWire->indicator.offColorNdx); return BadMatch; } if (dWire->indicator.shapeNdx >= geom->num_shapes) { client->errorValue = _XkbErrCode3(0x45, geom->num_shapes, dWire->indicator.shapeNdx); return BadMatch; } doodad->indicator.shape_ndx = dWire->indicator.shapeNdx; doodad->indicator.on_color_ndx = dWire->indicator.onColorNdx; doodad->indicator.off_color_ndx = dWire->indicator.offColorNdx; break; case XkbLogoDoodad: if (dWire->logo.colorNdx >= geom->num_colors) { client->errorValue = _XkbErrCode3(0x46, geom->num_colors, dWire->logo.colorNdx); return BadMatch; } if (dWire->logo.shapeNdx >= geom->num_shapes) { client->errorValue = _XkbErrCode3(0x47, geom->num_shapes, dWire->logo.shapeNdx); return BadMatch; } doodad->logo.color_ndx = dWire->logo.colorNdx; doodad->logo.shape_ndx = dWire->logo.shapeNdx; status = _GetCountedString(&wire, client, &doodad->logo.logo_name); if (status != Success) return status; break; default: client->errorValue = _XkbErrCode2(0x4F, dWire->any.type); return BadValue; } *wire_inout = wire; return Success; } static Status _CheckSetOverlay(char **wire_inout, XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) { register int r; char *wire; XkbOverlayPtr ol; xkbOverlayWireDesc *olWire; xkbOverlayRowWireDesc *rWire; wire = *wire_inout; olWire = (xkbOverlayWireDesc *) wire; if (client->swapped) { swapl(&olWire->name); } CHK_ATOM_ONLY(olWire->name); ol = XkbAddGeomOverlay(section, olWire->name, olWire->nRows); rWire = (xkbOverlayRowWireDesc *) &olWire[1]; for (r = 0; r < olWire->nRows; r++) { register int k; xkbOverlayKeyWireDesc *kWire; XkbOverlayRowPtr row; if (rWire->rowUnder > section->num_rows) { client->errorValue = _XkbErrCode4(0x20, r, section->num_rows, rWire->rowUnder); return BadMatch; } row = XkbAddGeomOverlayRow(ol, rWire->rowUnder, rWire->nKeys); kWire = (xkbOverlayKeyWireDesc *) &rWire[1]; for (k = 0; k < rWire->nKeys; k++, kWire++) { if (XkbAddGeomOverlayKey(ol, row, (char *) kWire->over, (char *) kWire->under) == NULL) { client->errorValue = _XkbErrCode3(0x21, r, k); return BadMatch; } } rWire = (xkbOverlayRowWireDesc *) kWire; } olWire = (xkbOverlayWireDesc *) rWire; wire = (char *) olWire; *wire_inout = wire; return Success; } static Status _CheckSetSections(XkbGeometryPtr geom, xkbSetGeometryReq * req, char **wire_inout, ClientPtr client) { Status status; register int s; char *wire; xkbSectionWireDesc *sWire; XkbSectionPtr section; wire = *wire_inout; if (req->nSections < 1) return Success; sWire = (xkbSectionWireDesc *) wire; for (s = 0; s < req->nSections; s++) { register int r; xkbRowWireDesc *rWire; if (client->swapped) { swapl(&sWire->name); swaps(&sWire->top); swaps(&sWire->left); swaps(&sWire->width); swaps(&sWire->height); swaps(&sWire->angle); } CHK_ATOM_ONLY(sWire->name); section = XkbAddGeomSection(geom, sWire->name, sWire->nRows, sWire->nDoodads, sWire->nOverlays); if (!section) return BadAlloc; section->priority = sWire->priority; section->top = sWire->top; section->left = sWire->left; section->width = sWire->width; section->height = sWire->height; section->angle = sWire->angle; rWire = (xkbRowWireDesc *) &sWire[1]; for (r = 0; r < sWire->nRows; r++) { register int k; XkbRowPtr row; xkbKeyWireDesc *kWire; if (client->swapped) { swaps(&rWire->top); swaps(&rWire->left); } row = XkbAddGeomRow(section, rWire->nKeys); if (!row) return BadAlloc; row->top = rWire->top; row->left = rWire->left; row->vertical = rWire->vertical; kWire = (xkbKeyWireDesc *) &rWire[1]; for (k = 0; k < rWire->nKeys; k++) { XkbKeyPtr key; key = XkbAddGeomKey(row); if (!key) return BadAlloc; memcpy(key->name.name, kWire[k].name, XkbKeyNameLength); key->gap = kWire[k].gap; key->shape_ndx = kWire[k].shapeNdx; key->color_ndx = kWire[k].colorNdx; if (key->shape_ndx >= geom->num_shapes) { client->errorValue = _XkbErrCode3(0x10, key->shape_ndx, geom->num_shapes); return BadMatch; } if (key->color_ndx >= geom->num_colors) { client->errorValue = _XkbErrCode3(0x11, key->color_ndx, geom->num_colors); return BadMatch; } } rWire = (xkbRowWireDesc *) &kWire[rWire->nKeys]; } wire = (char *) rWire; if (sWire->nDoodads > 0) { register int d; for (d = 0; d < sWire->nDoodads; d++) { status = _CheckSetDoodad(&wire, geom, section, client); if (status != Success) return status; } } if (sWire->nOverlays > 0) { register int o; for (o = 0; o < sWire->nOverlays; o++) { status = _CheckSetOverlay(&wire, geom, section, client); if (status != Success) return status; } } sWire = (xkbSectionWireDesc *) wire; } wire = (char *) sWire; *wire_inout = wire; return Success; } static Status _CheckSetShapes(XkbGeometryPtr geom, xkbSetGeometryReq * req, char **wire_inout, ClientPtr client) { register int i; char *wire; wire = *wire_inout; if (req->nShapes < 1) { client->errorValue = _XkbErrCode2(0x06, req->nShapes); return BadValue; } else { xkbShapeWireDesc *shapeWire; XkbShapePtr shape; register int o; shapeWire = (xkbShapeWireDesc *) wire; for (i = 0; i < req->nShapes; i++) { xkbOutlineWireDesc *olWire; XkbOutlinePtr ol; shape = XkbAddGeomShape(geom, shapeWire->name, shapeWire->nOutlines); if (!shape) return BadAlloc; olWire = (xkbOutlineWireDesc *) (&shapeWire[1]); for (o = 0; o < shapeWire->nOutlines; o++) { register int p; XkbPointPtr pt; xkbPointWireDesc *ptWire; ol = XkbAddGeomOutline(shape, olWire->nPoints); if (!ol) return BadAlloc; ol->corner_radius = olWire->cornerRadius; 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; if (client->swapped) { swaps(&pt->x); swaps(&pt->y); } } ol->num_points = olWire->nPoints; olWire = (xkbOutlineWireDesc *) (&ptWire[olWire->nPoints]); } if (shapeWire->primaryNdx != XkbNoShape) shape->primary = &shape->outlines[shapeWire->primaryNdx]; if (shapeWire->approxNdx != XkbNoShape) shape->approx = &shape->outlines[shapeWire->approxNdx]; shapeWire = (xkbShapeWireDesc *) olWire; } wire = (char *) shapeWire; } if (geom->num_shapes != req->nShapes) { client->errorValue = _XkbErrCode3(0x07, geom->num_shapes, req->nShapes); return BadMatch; } *wire_inout = wire; return Success; } static Status _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client) { register int i; Status status; char *wire; wire = (char *) &req[1]; status = _GetCountedString(&wire, client, &geom->label_font); if (status != Success) return status; for (i = 0; i < req->nProperties; i++) { char *name, *val; status = _GetCountedString(&wire, client, &name); if (status != Success) return status; status = _GetCountedString(&wire, client, &val); if (status != Success) { free(name); return status; } if (XkbAddGeomProperty(geom, name, val) == NULL) { free(name); free(val); return BadAlloc; } free(name); free(val); } if (req->nColors < 2) { client->errorValue = _XkbErrCode3(0x01, 2, req->nColors); return BadValue; } if (req->baseColorNdx > req->nColors) { client->errorValue = _XkbErrCode3(0x03, req->nColors, req->baseColorNdx); return BadMatch; } if (req->labelColorNdx > req->nColors) { client->errorValue = _XkbErrCode3(0x03, req->nColors, req->labelColorNdx); return BadMatch; } if (req->labelColorNdx == req->baseColorNdx) { client->errorValue = _XkbErrCode3(0x04, req->baseColorNdx, req->labelColorNdx); return BadMatch; } for (i = 0; i < req->nColors; i++) { char *name; status = _GetCountedString(&wire, client, &name); if (status != Success) return status; if (!XkbAddGeomColor(geom, name, geom->num_colors)) { free(name); return BadAlloc; } free(name); } if (req->nColors != geom->num_colors) { client->errorValue = _XkbErrCode3(0x05, req->nColors, geom->num_colors); return BadMatch; } geom->label_color = &geom->colors[req->labelColorNdx]; geom->base_color = &geom->colors[req->baseColorNdx]; if ((status = _CheckSetShapes(geom, req, &wire, client)) != Success) return status; if ((status = _CheckSetSections(geom, req, &wire, client)) != Success) return status; for (i = 0; i < req->nDoodads; i++) { status = _CheckSetDoodad(&wire, geom, NULL, client); if (status != Success) return status; } for (i = 0; i < req->nKeyAliases; i++) { if (XkbAddGeomKeyAlias(geom, &wire[XkbKeyNameLength], wire) == NULL) return BadAlloc; wire += 2 * XkbKeyNameLength; } return Success; } static int _XkbSetGeometry(ClientPtr client, DeviceIntPtr dev, xkbSetGeometryReq * stuff) { XkbDescPtr xkb; Bool new_name; xkbNewKeyboardNotify nkn; XkbGeometryPtr geom, old; XkbGeometrySizesRec sizes; Status status; xkb = dev->key->xkbInfo->desc; old = xkb->geom; xkb->geom = NULL; sizes.which = XkbGeomAllMask; sizes.num_properties = stuff->nProperties; sizes.num_colors = stuff->nColors; sizes.num_shapes = stuff->nShapes; sizes.num_sections = stuff->nSections; sizes.num_doodads = stuff->nDoodads; sizes.num_key_aliases = stuff->nKeyAliases; if ((status = XkbAllocGeometry(xkb, &sizes)) != Success) { xkb->geom = old; return status; } geom = xkb->geom; geom->name = stuff->name; geom->width_mm = stuff->widthMM; geom->height_mm = stuff->heightMM; if ((status = _CheckSetGeom(geom, stuff, client)) != Success) { XkbFreeGeometry(geom, XkbGeomAllMask, TRUE); xkb->geom = old; return status; } new_name = (xkb->names->geometry != geom->name); xkb->names->geometry = geom->name; if (old) XkbFreeGeometry(old, XkbGeomAllMask, TRUE); if (new_name) { xkbNamesNotify nn; memset(&nn, 0, sizeof(xkbNamesNotify)); nn.changed = XkbGeometryNameMask; XkbSendNamesNotify(dev, &nn); } nkn.deviceID = nkn.oldDeviceID = dev->id; nkn.minKeyCode = nkn.oldMinKeyCode = xkb->min_key_code; nkn.maxKeyCode = nkn.oldMaxKeyCode = xkb->max_key_code; nkn.requestMajor = XkbReqCode; nkn.requestMinor = X_kbSetGeometry; nkn.changed = XkbNKN_GeometryMask; XkbSendNewKeyboardNotify(dev, &nkn); return Success; } int ProcXkbSetGeometry(ClientPtr client) { DeviceIntPtr dev; int rc; REQUEST(xkbSetGeometryReq); REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); CHK_ATOM_OR_NONE(stuff->name); rc = _XkbSetGeometry(client, dev, stuff); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) _XkbSetGeometry(client, other, stuff); } } } return Success; } /***====================================================================***/ int ProcXkbPerClientFlags(ClientPtr client) { DeviceIntPtr dev; xkbPerClientFlagsReply rep; XkbInterestPtr interest; Mask access_mode = DixGetAttrAccess | DixSetAttrAccess; REQUEST(xkbPerClientFlagsReq); REQUEST_SIZE_MATCH(xkbPerClientFlagsReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); CHK_MASK_LEGAL(0x01, stuff->change, XkbPCF_AllFlagsMask); CHK_MASK_MATCH(0x02, stuff->change, stuff->value); interest = XkbFindClientResource((DevicePtr) dev, client); if (stuff->change) { client->xkbClientFlags &= ~stuff->change; client->xkbClientFlags |= stuff->value; } if (stuff->change & XkbPCF_AutoResetControlsMask) { Bool want; want = stuff->value & XkbPCF_AutoResetControlsMask; if (interest && !want) { interest->autoCtrls = interest->autoCtrlValues = 0; } else if (want && (!interest)) { XID id = FakeClientID(client->index); if (!AddResource(id, RT_XKBCLIENT, dev)) return BadAlloc; interest = XkbAddClientResource((DevicePtr) dev, client, id); if (!interest) return BadAlloc; } if (interest && want) { register unsigned affect; affect = stuff->ctrlsToChange; CHK_MASK_LEGAL(0x03, affect, XkbAllBooleanCtrlsMask); CHK_MASK_MATCH(0x04, affect, stuff->autoCtrls); CHK_MASK_MATCH(0x05, stuff->autoCtrls, stuff->autoCtrlValues); interest->autoCtrls &= ~affect; interest->autoCtrlValues &= ~affect; interest->autoCtrls |= stuff->autoCtrls & affect; interest->autoCtrlValues |= stuff->autoCtrlValues & affect; } } 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); swapl(&rep.value); swapl(&rep.autoCtrls); swapl(&rep.autoCtrlValues); } WriteToClient(client, SIZEOF(xkbPerClientFlagsReply), &rep); return Success; } /***====================================================================***/ /* all latin-1 alphanumerics, plus parens, minus, underscore, slash */ /* and wildcards */ static unsigned char componentSpecLegal[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff }; /* same as above but accepts percent, plus and bar too */ static unsigned char componentExprLegal[] = { 0x00, 0x00, 0x00, 0x00, 0x20, 0xaf, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff }; static char * GetComponentSpec(unsigned char **pWire, Bool allowExpr, int *errRtrn) { int len; register int i; unsigned char *wire, *str, *tmp, *legal; if (allowExpr) legal = &componentExprLegal[0]; else legal = &componentSpecLegal[0]; wire = *pWire; len = (*(unsigned char *) wire++); if (len > 0) { str = calloc(1, len + 1); if (str) { tmp = str; for (i = 0; i < len; i++) { if (legal[(*wire) / 8] & (1 << ((*wire) % 8))) *tmp++ = *wire++; else wire++; } if (tmp != str) *tmp++ = '\0'; else { free(str); str = NULL; } } else { *errRtrn = BadAlloc; } } else { str = NULL; } *pWire = wire; return (char *) str; } /***====================================================================***/ int ProcXkbListComponents(ClientPtr client) { DeviceIntPtr dev; xkbListComponentsReply rep; unsigned len; unsigned char *str; uint8_t size; int i; REQUEST(xkbListComponentsReq); REQUEST_AT_LEAST_SIZE(xkbListComponentsReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); /* 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]; 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; 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); swaps(&rep.nKeymaps); swaps(&rep.nKeycodes); swaps(&rep.nTypes); swaps(&rep.nCompatMaps); swaps(&rep.nSymbols); swaps(&rep.nGeometries); swaps(&rep.extra); } WriteToClient(client, SIZEOF(xkbListComponentsReply), &rep); return Success; } /***====================================================================***/ int ProcXkbGetKbdByName(ClientPtr client) { DeviceIntPtr dev; DeviceIntPtr tmpd; DeviceIntPtr master; xkbGetKbdByNameReply rep = { 0 }; xkbGetMapReply mrep = { 0 }; xkbGetCompatMapReply crep = { 0 }; xkbGetIndicatorMapReply irep = { 0 }; xkbGetNamesReply nrep = { 0 }; xkbGetGeometryReply grep = { 0 }; XkbComponentNamesRec names = { 0 }; XkbDescPtr xkb, new; unsigned char *str; char mapFile[PATH_MAX]; unsigned len; unsigned fwant, fneed, reported; int status; Bool geom_changed; XkbSrvLedInfoPtr old_sli; XkbSrvLedInfoPtr sli; Mask access_mode = DixGetAttrAccess | DixManageAccess; REQUEST(xkbGetKbdByNameReq); REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); master = GetMaster(dev, MASTER_KEYBOARD); xkb = dev->key->xkbInfo->desc; status = Success; str = (unsigned char *) &stuff[1]; if (GetComponentSpec(&str, TRUE, &status)) /* keymap, unsupported */ return BadMatch; names.keycodes = GetComponentSpec(&str, TRUE, &status); names.types = GetComponentSpec(&str, TRUE, &status); names.compat = GetComponentSpec(&str, TRUE, &status); names.symbols = GetComponentSpec(&str, TRUE, &status); names.geometry = GetComponentSpec(&str, TRUE, &status); if (status != Success) return status; len = str - ((unsigned char *) stuff); if ((XkbPaddedSize(len) / 4) != stuff->length) return BadLength; CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask); CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask); if (stuff->load) fwant = XkbGBN_AllComponentsMask; else fwant = stuff->want | stuff->need; if ((!names.compat) && (fwant & (XkbGBN_CompatMapMask | XkbGBN_IndicatorMapMask))) { names.compat = Xstrdup("%"); } if ((!names.types) && (fwant & (XkbGBN_TypesMask))) { names.types = Xstrdup("%"); } if ((!names.symbols) && (fwant & XkbGBN_SymbolsMask)) { names.symbols = Xstrdup("%"); } geom_changed = ((names.geometry != NULL) && (strcmp(names.geometry, "%") != 0)); if ((!names.geometry) && (fwant & XkbGBN_GeometryMask)) { names.geometry = Xstrdup("%"); geom_changed = FALSE; } memset(mapFile, 0, PATH_MAX); rep.type = X_Reply; rep.deviceID = dev->id; rep.sequenceNumber = client->sequence; rep.length = 0; rep.minKeyCode = xkb->min_key_code; rep.maxKeyCode = xkb->max_key_code; rep.loaded = FALSE; fwant = XkbConvertGetByNameComponents(TRUE, stuff->want) | XkmVirtualModsMask; fneed = XkbConvertGetByNameComponents(TRUE, stuff->need); rep.reported = XkbConvertGetByNameComponents(FALSE, fwant | fneed); if (stuff->load) { fneed |= XkmKeymapRequired; fwant |= XkmKeymapLegal; } if ((fwant | fneed) & XkmSymbolsMask) { fneed |= XkmKeyNamesIndex | XkmTypesIndex; fwant |= XkmIndicatorsIndex; } /* We pass dev in here so we can get the old names out if needed. */ rep.found = XkbDDXLoadKeymapByNames(dev, &names, fwant, fneed, &new, mapFile, PATH_MAX); rep.newKeyboard = FALSE; rep.pad1 = rep.pad2 = rep.pad3 = rep.pad4 = 0; stuff->want |= stuff->need; if (new == NULL) rep.reported = 0; else { if (stuff->load) rep.loaded = TRUE; if (stuff->load || ((rep.reported & XkbGBN_SymbolsMask) && (new->compat))) { XkbChangesRec changes; memset(&changes, 0, sizeof(changes)); XkbUpdateDescActions(new, new->min_key_code, XkbNumKeys(new), &changes); } if (new->map == NULL) rep.reported &= ~(XkbGBN_SymbolsMask | XkbGBN_TypesMask); else if (rep.reported & (XkbGBN_SymbolsMask | XkbGBN_TypesMask)) { mrep.type = X_Reply; mrep.deviceID = dev->id; mrep.sequenceNumber = client->sequence; mrep.length = ((SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2); mrep.minKeyCode = new->min_key_code; mrep.maxKeyCode = new->max_key_code; mrep.present = 0; mrep.totalSyms = mrep.totalActs = mrep.totalKeyBehaviors = mrep.totalKeyExplicit = mrep.totalModMapKeys = mrep.totalVModMapKeys = 0; if (rep.reported & (XkbGBN_TypesMask | XkbGBN_ClientSymbolsMask)) { mrep.present |= XkbKeyTypesMask; mrep.firstType = 0; mrep.nTypes = mrep.totalTypes = new->map->num_types; } else { mrep.firstType = mrep.nTypes = 0; mrep.totalTypes = 0; } if (rep.reported & XkbGBN_ClientSymbolsMask) { mrep.present |= (XkbKeySymsMask | XkbModifierMapMask); mrep.firstKeySym = mrep.firstModMapKey = new->min_key_code; mrep.nKeySyms = mrep.nModMapKeys = XkbNumKeys(new); } else { mrep.firstKeySym = mrep.firstModMapKey = 0; mrep.nKeySyms = mrep.nModMapKeys = 0; } if (rep.reported & XkbGBN_ServerSymbolsMask) { mrep.present |= XkbAllServerInfoMask; mrep.virtualMods = ~0; mrep.firstKeyAct = mrep.firstKeyBehavior = mrep.firstKeyExplicit = new->min_key_code; mrep.nKeyActs = mrep.nKeyBehaviors = mrep.nKeyExplicit = XkbNumKeys(new); mrep.firstVModMapKey = new->min_key_code; mrep.nVModMapKeys = XkbNumKeys(new); } else { mrep.virtualMods = 0; mrep.firstKeyAct = mrep.firstKeyBehavior = mrep.firstKeyExplicit = 0; mrep.nKeyActs = mrep.nKeyBehaviors = mrep.nKeyExplicit = 0; } XkbComputeGetMapReplySize(new, &mrep); rep.length += SIZEOF(xGenericReply) / 4 + mrep.length; } if (new->compat == NULL) rep.reported &= ~XkbGBN_CompatMapMask; else if (rep.reported & XkbGBN_CompatMapMask) { crep.type = X_Reply; crep.deviceID = dev->id; crep.sequenceNumber = client->sequence; crep.length = 0; crep.groups = XkbAllGroupsMask; crep.firstSI = 0; crep.nSI = crep.nTotalSI = new->compat->num_si; XkbComputeGetCompatMapReplySize(new->compat, &crep); rep.length += SIZEOF(xGenericReply) / 4 + crep.length; } if (new->indicators == NULL) rep.reported &= ~XkbGBN_IndicatorMapMask; else if (rep.reported & XkbGBN_IndicatorMapMask) { irep.type = X_Reply; irep.deviceID = dev->id; irep.sequenceNumber = client->sequence; irep.length = 0; irep.which = XkbAllIndicatorsMask; XkbComputeGetIndicatorMapReplySize(new->indicators, &irep); rep.length += SIZEOF(xGenericReply) / 4 + irep.length; } if (new->names == NULL) rep.reported &= ~(XkbGBN_OtherNamesMask | XkbGBN_KeyNamesMask); else if (rep.reported & (XkbGBN_OtherNamesMask | XkbGBN_KeyNamesMask)) { nrep.type = X_Reply; nrep.deviceID = dev->id; nrep.sequenceNumber = client->sequence; nrep.length = 0; nrep.minKeyCode = new->min_key_code; nrep.maxKeyCode = new->max_key_code; if (rep.reported & XkbGBN_OtherNamesMask) { nrep.which = XkbAllNamesMask; if (new->map != NULL) nrep.nTypes = new->map->num_types; else nrep.nTypes = 0; nrep.nKTLevels = 0; nrep.groupNames = XkbAllGroupsMask; nrep.virtualMods = XkbAllVirtualModsMask; nrep.indicators = XkbAllIndicatorsMask; nrep.nRadioGroups = new->names->num_rg; } else { nrep.which = 0; nrep.nTypes = 0; nrep.nKTLevels = 0; nrep.groupNames = 0; nrep.virtualMods = 0; nrep.indicators = 0; nrep.nRadioGroups = 0; } if (rep.reported & XkbGBN_KeyNamesMask) { nrep.which |= XkbKeyNamesMask; nrep.firstKey = new->min_key_code; nrep.nKeys = XkbNumKeys(new); nrep.nKeyAliases = new->names->num_key_aliases; if (nrep.nKeyAliases) nrep.which |= XkbKeyAliasesMask; } else { nrep.which &= ~(XkbKeyNamesMask | XkbKeyAliasesMask); nrep.firstKey = nrep.nKeys = 0; nrep.nKeyAliases = 0; } XkbComputeGetNamesReplySize(new, &nrep); rep.length += SIZEOF(xGenericReply) / 4 + nrep.length; } if (new->geom == NULL) rep.reported &= ~XkbGBN_GeometryMask; else if (rep.reported & XkbGBN_GeometryMask) { grep.type = X_Reply; grep.deviceID = dev->id; grep.sequenceNumber = client->sequence; grep.length = 0; grep.found = TRUE; grep.pad = 0; grep.widthMM = grep.heightMM = 0; grep.nProperties = grep.nColors = grep.nShapes = 0; grep.nSections = grep.nDoodads = 0; grep.baseColorNdx = grep.labelColorNdx = 0; XkbComputeGetGeometryReplySize(new->geom, &grep, None); rep.length += SIZEOF(xGenericReply) / 4 + grep.length; } } reported = rep.reported; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.found); swaps(&rep.reported); } WriteToClient(client, SIZEOF(xkbGetKbdByNameReply), &rep); if (reported & (XkbGBN_SymbolsMask | XkbGBN_TypesMask)) XkbSendMap(client, new, &mrep); if (reported & XkbGBN_CompatMapMask) XkbSendCompatMap(client, new->compat, &crep); if (reported & XkbGBN_IndicatorMapMask) XkbSendIndicatorMap(client, new->indicators, &irep); if (reported & (XkbGBN_KeyNamesMask | XkbGBN_OtherNamesMask)) XkbSendNames(client, new, &nrep); if (reported & XkbGBN_GeometryMask) XkbSendGeometry(client, new->geom, &grep, FALSE); if (rep.loaded) { XkbDescPtr old_xkb; xkbNewKeyboardNotify nkn; old_xkb = xkb; xkb = new; dev->key->xkbInfo->desc = xkb; new = old_xkb; /* so it'll get freed automatically */ XkbCopyControls(xkb, old_xkb); nkn.deviceID = nkn.oldDeviceID = dev->id; nkn.minKeyCode = new->min_key_code; nkn.maxKeyCode = new->max_key_code; nkn.oldMinKeyCode = xkb->min_key_code; nkn.oldMaxKeyCode = xkb->max_key_code; nkn.requestMajor = XkbReqCode; nkn.requestMinor = X_kbGetKbdByName; nkn.changed = XkbNKN_KeycodesMask; if (geom_changed) nkn.changed |= XkbNKN_GeometryMask; XkbSendNewKeyboardNotify(dev, &nkn); /* Update the map and LED info on the device itself, as well as * any slaves if it's an MD, or its MD if it's an SD and was the * last device used on that MD. */ for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { if (tmpd != dev && GetMaster(tmpd, MASTER_KEYBOARD) != dev && (tmpd != master || dev != master->lastSlave)) continue; if (tmpd != dev) XkbDeviceApplyKeymap(tmpd, xkb); if (tmpd->kbdfeed && tmpd->kbdfeed->xkb_sli) { old_sli = tmpd->kbdfeed->xkb_sli; tmpd->kbdfeed->xkb_sli = NULL; sli = XkbAllocSrvLedInfo(tmpd, tmpd->kbdfeed, NULL, 0); if (sli) { sli->explicitState = old_sli->explicitState; sli->effectiveState = old_sli->effectiveState; } tmpd->kbdfeed->xkb_sli = sli; XkbFreeSrvLedInfo(old_sli); } } } if ((new != NULL) && (new != xkb)) { XkbFreeKeyboard(new, XkbAllComponentsMask, TRUE); new = NULL; } XkbFreeComponentNames(&names, FALSE); return Success; } /***====================================================================***/ static int ComputeDeviceLedInfoSize(DeviceIntPtr dev, unsigned int what, XkbSrvLedInfoPtr sli) { int nNames, nMaps; register unsigned n, bit; if (sli == NULL) return 0; nNames = nMaps = 0; if ((what & XkbXI_IndicatorNamesMask) == 0) sli->namesPresent = 0; if ((what & XkbXI_IndicatorMapsMask) == 0) sli->mapsPresent = 0; for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { if (sli->names && sli->names[n] != None) { sli->namesPresent |= bit; nNames++; } if (sli->maps && XkbIM_InUse(&sli->maps[n])) { sli->mapsPresent |= bit; nMaps++; } } return (nNames * 4) + (nMaps * SIZEOF(xkbIndicatorMapWireDesc)); } static int CheckDeviceLedFBs(DeviceIntPtr dev, int class, int id, xkbGetDeviceInfoReply * rep, ClientPtr client) { int nFBs = 0; int length = 0; Bool classOk; if (class == XkbDfltXIClass) { if (dev->kbdfeed) class = KbdFeedbackClass; else if (dev->leds) class = LedFeedbackClass; else { client->errorValue = _XkbErrCode2(XkbErr_BadClass, class); return XkbKeyboardErrorCode; } } classOk = FALSE; if ((dev->kbdfeed) && ((class == KbdFeedbackClass) || (class == XkbAllXIClasses))) { KbdFeedbackPtr kf; classOk = TRUE; for (kf = dev->kbdfeed; (kf); kf = kf->next) { if ((id != XkbAllXIIds) && (id != XkbDfltXIId) && (id != kf->ctrl.id)) continue; nFBs++; length += SIZEOF(xkbDeviceLedsWireDesc); if (!kf->xkb_sli) kf->xkb_sli = XkbAllocSrvLedInfo(dev, kf, NULL, 0); length += ComputeDeviceLedInfoSize(dev, rep->present, kf->xkb_sli); if (id != XkbAllXIIds) break; } } if ((dev->leds) && ((class == LedFeedbackClass) || (class == XkbAllXIClasses))) { LedFeedbackPtr lf; classOk = TRUE; for (lf = dev->leds; (lf); lf = lf->next) { if ((id != XkbAllXIIds) && (id != XkbDfltXIId) && (id != lf->ctrl.id)) continue; nFBs++; length += SIZEOF(xkbDeviceLedsWireDesc); if (!lf->xkb_sli) lf->xkb_sli = XkbAllocSrvLedInfo(dev, NULL, lf, 0); length += ComputeDeviceLedInfoSize(dev, rep->present, lf->xkb_sli); if (id != XkbAllXIIds) break; } } if (nFBs > 0) { rep->nDeviceLedFBs = nFBs; rep->length += (length / 4); return Success; } if (classOk) client->errorValue = _XkbErrCode2(XkbErr_BadId, id); else client->errorValue = _XkbErrCode2(XkbErr_BadClass, class); return XkbKeyboardErrorCode; } static int SendDeviceLedInfo(XkbSrvLedInfoPtr sli, ClientPtr client) { xkbDeviceLedsWireDesc wire; int length; length = 0; wire.ledClass = sli->class; wire.ledID = sli->id; wire.namesPresent = sli->namesPresent; wire.mapsPresent = sli->mapsPresent; wire.physIndicators = sli->physIndicators; wire.state = sli->effectiveState; if (client->swapped) { swaps(&wire.ledClass); swaps(&wire.ledID); swapl(&wire.namesPresent); swapl(&wire.mapsPresent); swapl(&wire.physIndicators); swapl(&wire.state); } WriteToClient(client, SIZEOF(xkbDeviceLedsWireDesc), &wire); length += SIZEOF(xkbDeviceLedsWireDesc); if (sli->namesPresent | sli->mapsPresent) { register unsigned i, bit; if (sli->namesPresent) { CARD32 awire; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (sli->namesPresent & bit) { awire = (CARD32) sli->names[i]; if (client->swapped) { swapl(&awire); } WriteToClient(client, 4, &awire); length += 4; } } } if (sli->mapsPresent) { for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { xkbIndicatorMapWireDesc iwire; if (sli->mapsPresent & bit) { iwire.flags = sli->maps[i].flags; iwire.whichGroups = sli->maps[i].which_groups; iwire.groups = sli->maps[i].groups; iwire.whichMods = sli->maps[i].which_mods; iwire.mods = sli->maps[i].mods.mask; iwire.realMods = sli->maps[i].mods.real_mods; iwire.virtualMods = sli->maps[i].mods.vmods; iwire.ctrls = sli->maps[i].ctrls; if (client->swapped) { swaps(&iwire.virtualMods); swapl(&iwire.ctrls); } WriteToClient(client, SIZEOF(xkbIndicatorMapWireDesc), &iwire); length += SIZEOF(xkbIndicatorMapWireDesc); } } } } return length; } static int SendDeviceLedFBs(DeviceIntPtr dev, int class, int id, unsigned wantLength, ClientPtr client) { int length = 0; if (class == XkbDfltXIClass) { if (dev->kbdfeed) class = KbdFeedbackClass; else if (dev->leds) class = LedFeedbackClass; } if ((dev->kbdfeed) && ((class == KbdFeedbackClass) || (class == XkbAllXIClasses))) { KbdFeedbackPtr kf; for (kf = dev->kbdfeed; (kf); kf = kf->next) { if ((id == XkbAllXIIds) || (id == XkbDfltXIId) || (id == kf->ctrl.id)) { length += SendDeviceLedInfo(kf->xkb_sli, client); if (id != XkbAllXIIds) break; } } } if ((dev->leds) && ((class == LedFeedbackClass) || (class == XkbAllXIClasses))) { LedFeedbackPtr lf; for (lf = dev->leds; (lf); lf = lf->next) { if ((id == XkbAllXIIds) || (id == XkbDfltXIId) || (id == lf->ctrl.id)) { length += SendDeviceLedInfo(lf->xkb_sli, client); if (id != XkbAllXIIds) break; } } } if (length == wantLength) return Success; else return BadLength; } int ProcXkbGetDeviceInfo(ClientPtr client) { DeviceIntPtr dev; xkbGetDeviceInfoReply rep; int status, nDeviceLedFBs; unsigned length, nameLen; CARD16 ledClass, ledID; unsigned wanted; char *str; REQUEST(xkbGetDeviceInfoReq); REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; wanted = stuff->wanted; CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); CHK_MASK_LEGAL(0x01, wanted, XkbXI_AllDeviceFeaturesMask); if ((!dev->button) || ((stuff->nBtns < 1) && (!stuff->allBtns))) wanted &= ~XkbXI_ButtonActionsMask; if ((!dev->kbdfeed) && (!dev->leds)) wanted &= ~XkbXI_IndicatorsMask; nameLen = XkbSizeCountedString(dev->name); 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; if (wanted & XkbXI_ButtonActionsMask) { if (stuff->allBtns) { stuff->firstBtn = 0; stuff->nBtns = dev->button->numButtons; } if ((stuff->firstBtn + stuff->nBtns) > dev->button->numButtons) { client->errorValue = _XkbErrCode4(0x02, dev->button->numButtons, stuff->firstBtn, stuff->nBtns); return BadValue; } else { rep.firstBtnWanted = stuff->firstBtn; rep.nBtnsWanted = stuff->nBtns; if (dev->button->xkb_acts != NULL) { XkbAction *act; register int i; rep.firstBtnRtrn = stuff->firstBtn; rep.nBtnsRtrn = stuff->nBtns; act = &dev->button->xkb_acts[rep.firstBtnWanted]; for (i = 0; i < rep.nBtnsRtrn; i++, act++) { if (act->type != XkbSA_NoAction) break; } rep.firstBtnRtrn += i; rep.nBtnsRtrn -= i; act = &dev->button->xkb_acts[rep.firstBtnRtrn + rep.nBtnsRtrn - 1]; for (i = 0; i < rep.nBtnsRtrn; i++, act--) { if (act->type != XkbSA_NoAction) break; } rep.nBtnsRtrn -= i; } rep.length += (rep.nBtnsRtrn * SIZEOF(xkbActionWireDesc)) / 4; } } if (wanted & XkbXI_IndicatorsMask) { status = CheckDeviceLedFBs(dev, ledClass, ledID, &rep, client); if (status != Success) return status; } length = rep.length * 4; nDeviceLedFBs = rep.nDeviceLedFBs; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.present); swaps(&rep.supported); swaps(&rep.unsupported); swaps(&rep.nDeviceLedFBs); swaps(&rep.dfltKbdFB); swaps(&rep.dfltLedFB); swapl(&rep.devType); } WriteToClient(client, SIZEOF(xkbGetDeviceInfoReply), &rep); str = malloc(nameLen); if (!str) return BadAlloc; XkbWriteCountedString(str, dev->name, client->swapped); WriteToClient(client, nameLen, str); free(str); length -= nameLen; if (rep.nBtnsRtrn > 0) { int sz; xkbActionWireDesc *awire; sz = rep.nBtnsRtrn * SIZEOF(xkbActionWireDesc); awire = (xkbActionWireDesc *) &dev->button->xkb_acts[rep.firstBtnRtrn]; WriteToClient(client, sz, awire); length -= sz; } if (nDeviceLedFBs > 0) { status = SendDeviceLedFBs(dev, ledClass, ledID, length, client); if (status != Success) return status; } else if (length != 0) { ErrorF("[xkb] Internal Error! BadLength in ProcXkbGetDeviceInfo\n"); ErrorF("[xkb] Wrote %d fewer bytes than expected\n", length); return BadLength; } return Success; } static char * CheckSetDeviceIndicators(char *wire, DeviceIntPtr dev, int num, int *status_rtrn, ClientPtr client) { xkbDeviceLedsWireDesc *ledWire; int i; XkbSrvLedInfoPtr sli; ledWire = (xkbDeviceLedsWireDesc *) wire; for (i = 0; i < num; i++) { if (client->swapped) { swaps(&ledWire->ledClass); swaps(&ledWire->ledID); swapl(&ledWire->namesPresent); swapl(&ledWire->mapsPresent); swapl(&ledWire->physIndicators); } sli = XkbFindSrvLedInfo(dev, ledWire->ledClass, ledWire->ledID, XkbXI_IndicatorsMask); if (sli != NULL) { register int n; register unsigned bit; int nMaps, nNames; CARD32 *atomWire; xkbIndicatorMapWireDesc *mapWire; nMaps = nNames = 0; for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { if (ledWire->namesPresent & bit) nNames++; if (ledWire->mapsPresent & bit) nMaps++; } atomWire = (CARD32 *) &ledWire[1]; if (nNames > 0) { for (n = 0; n < nNames; n++) { if (client->swapped) { swapl(atomWire); } CHK_ATOM_OR_NONE3(((Atom) (*atomWire)), client->errorValue, *status_rtrn, NULL); atomWire++; } } mapWire = (xkbIndicatorMapWireDesc *) atomWire; if (nMaps > 0) { for (n = 0; n < nMaps; n++) { if (client->swapped) { swaps(&mapWire->virtualMods); swapl(&mapWire->ctrls); } CHK_MASK_LEGAL3(0x21, mapWire->whichGroups, XkbIM_UseAnyGroup, client->errorValue, *status_rtrn, NULL); CHK_MASK_LEGAL3(0x22, mapWire->whichMods, XkbIM_UseAnyMods, client->errorValue, *status_rtrn, NULL); mapWire++; } } ledWire = (xkbDeviceLedsWireDesc *) mapWire; } else { /* SHOULD NEVER HAPPEN */ return (char *) ledWire; } } return (char *) ledWire; } static char * SetDeviceIndicators(char *wire, DeviceIntPtr dev, unsigned changed, int num, int *status_rtrn, ClientPtr client, xkbExtensionDeviceNotify * ev) { xkbDeviceLedsWireDesc *ledWire; int i; XkbEventCauseRec cause; unsigned namec, mapc, statec; xkbExtensionDeviceNotify ed; XkbChangesRec changes; DeviceIntPtr kbd; memset((char *) &ed, 0, sizeof(xkbExtensionDeviceNotify)); memset((char *) &changes, 0, sizeof(XkbChangesRec)); XkbSetCauseXkbReq(&cause, X_kbSetDeviceInfo, client); ledWire = (xkbDeviceLedsWireDesc *) wire; for (i = 0; i < num; i++) { register int n; register unsigned bit; CARD32 *atomWire; xkbIndicatorMapWireDesc *mapWire; XkbSrvLedInfoPtr sli; namec = mapc = statec = 0; sli = XkbFindSrvLedInfo(dev, ledWire->ledClass, ledWire->ledID, XkbXI_IndicatorMapsMask); if (!sli) { /* SHOULD NEVER HAPPEN!! */ return (char *) ledWire; } atomWire = (CARD32 *) &ledWire[1]; if (changed & XkbXI_IndicatorNamesMask) { namec = sli->namesPresent | ledWire->namesPresent; memset((char *) sli->names, 0, XkbNumIndicators * sizeof(Atom)); } if (ledWire->namesPresent) { sli->namesPresent = ledWire->namesPresent; memset((char *) sli->names, 0, XkbNumIndicators * sizeof(Atom)); for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { if (ledWire->namesPresent & bit) { sli->names[n] = (Atom) *atomWire; if (sli->names[n] == None) ledWire->namesPresent &= ~bit; atomWire++; } } } mapWire = (xkbIndicatorMapWireDesc *) atomWire; if (changed & XkbXI_IndicatorMapsMask) { mapc = sli->mapsPresent | ledWire->mapsPresent; sli->mapsPresent = ledWire->mapsPresent; memset((char *) sli->maps, 0, XkbNumIndicators * sizeof(XkbIndicatorMapRec)); } if (ledWire->mapsPresent) { for (n = 0, bit = 1; n < XkbNumIndicators; n++, bit <<= 1) { if (ledWire->mapsPresent & bit) { sli->maps[n].flags = mapWire->flags; sli->maps[n].which_groups = mapWire->whichGroups; sli->maps[n].groups = mapWire->groups; sli->maps[n].which_mods = mapWire->whichMods; sli->maps[n].mods.mask = mapWire->mods; sli->maps[n].mods.real_mods = mapWire->realMods; sli->maps[n].mods.vmods = mapWire->virtualMods; sli->maps[n].ctrls = mapWire->ctrls; mapWire++; } } } if (changed & XkbXI_IndicatorStateMask) { statec = sli->effectiveState ^ ledWire->state; sli->explicitState &= ~statec; sli->explicitState |= (ledWire->state & statec); } if (namec) XkbApplyLedNameChanges(dev, sli, namec, &ed, &changes, &cause); if (mapc) XkbApplyLedMapChanges(dev, sli, mapc, &ed, &changes, &cause); if (statec) XkbApplyLedStateChanges(dev, sli, statec, &ed, &changes, &cause); kbd = dev; if ((sli->flags & XkbSLI_HasOwnState) == 0) kbd = inputInfo.keyboard; XkbFlushLedEvents(dev, kbd, sli, &ed, &changes, &cause); ledWire = (xkbDeviceLedsWireDesc *) mapWire; } return (char *) ledWire; } static int _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, xkbSetDeviceInfoReq * stuff) { char *wire; wire = (char *) &stuff[1]; if (stuff->change & XkbXI_ButtonActionsMask) { if (!dev->button) { client->errorValue = _XkbErrCode2(XkbErr_BadClass, ButtonClass); return XkbKeyboardErrorCode; } if ((stuff->firstBtn + stuff->nBtns) > dev->button->numButtons) { client->errorValue = _XkbErrCode4(0x02, stuff->firstBtn, stuff->nBtns, dev->button->numButtons); return BadMatch; } wire += (stuff->nBtns * SIZEOF(xkbActionWireDesc)); } if (stuff->change & XkbXI_IndicatorsMask) { int status = Success; wire = CheckSetDeviceIndicators(wire, dev, stuff->nDeviceLedFBs, &status, client); if (status != Success) return status; } if (((wire - ((char *) stuff)) / 4) != stuff->length) return BadLength; return Success; } static int _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, xkbSetDeviceInfoReq * stuff) { char *wire; xkbExtensionDeviceNotify ed; memset((char *) &ed, 0, SIZEOF(xkbExtensionDeviceNotify)); ed.deviceID = dev->id; wire = (char *) &stuff[1]; if (stuff->change & XkbXI_ButtonActionsMask) { int nBtns, sz, i; XkbAction *acts; DeviceIntPtr kbd; nBtns = dev->button->numButtons; acts = dev->button->xkb_acts; if (acts == NULL) { acts = calloc(nBtns, sizeof(XkbAction)); if (!acts) return BadAlloc; dev->button->xkb_acts = acts; } sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); memcpy((char *) &acts[stuff->firstBtn], (char *) wire, sz); wire += sz; ed.reason |= XkbXI_ButtonActionsMask; ed.firstBtn = stuff->firstBtn; ed.nBtns = stuff->nBtns; if (dev->key) kbd = dev; else kbd = inputInfo.keyboard; acts = &dev->button->xkb_acts[stuff->firstBtn]; for (i = 0; i < stuff->nBtns; i++, acts++) { if (acts->type != XkbSA_NoAction) XkbSetActionKeyMods(kbd->key->xkbInfo->desc, acts, 0); } } if (stuff->change & XkbXI_IndicatorsMask) { int status = Success; wire = SetDeviceIndicators(wire, dev, stuff->change, stuff->nDeviceLedFBs, &status, client, &ed); if (status != Success) return status; } if ((stuff->change) && (ed.reason)) XkbSendExtensionDeviceNotify(dev, client, &ed); return Success; } int ProcXkbSetDeviceInfo(ClientPtr client) { DeviceIntPtr dev; int rc; REQUEST(xkbSetDeviceInfoReq); REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); CHK_MASK_LEGAL(0x01, stuff->change, XkbXI_AllFeaturesMask); rc = _XkbSetDeviceInfoCheck(client, dev, stuff); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) && ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || (stuff->deviceSpec == XkbUseCorePtr && other->button))) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) { rc = _XkbSetDeviceInfoCheck(client, other, stuff); if (rc != Success) return rc; } } } } /* checks done, apply */ rc = _XkbSetDeviceInfo(client, dev, stuff); if (rc != Success) return rc; if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) { DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) && ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || (stuff->deviceSpec == XkbUseCorePtr && other->button))) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) { rc = _XkbSetDeviceInfo(client, other, stuff); if (rc != Success) return rc; } } } } return Success; } /***====================================================================***/ int ProcXkbSetDebuggingFlags(ClientPtr client) { CARD32 newFlags, newCtrls, extraLength; xkbSetDebuggingFlagsReply rep; int rc; REQUEST(xkbSetDebuggingFlagsReq); REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq); rc = XaceHook(XACE_SERVER_ACCESS, client, DixDebugAccess); if (rc != Success) return rc; newFlags = xkbDebugFlags & (~stuff->affectFlags); newFlags |= (stuff->flags & stuff->affectFlags); newCtrls = xkbDebugCtrls & (~stuff->affectCtrls); newCtrls |= (stuff->ctrls & stuff->affectCtrls); if (xkbDebugFlags || newFlags || stuff->msgLength) { ErrorF("[xkb] XkbDebug: Setting debug flags to 0x%lx\n", (long) newFlags); if (newCtrls != xkbDebugCtrls) ErrorF("[xkb] XkbDebug: Setting debug controls to 0x%lx\n", (long) newCtrls); } extraLength = (stuff->length << 2) - sz_xkbSetDebuggingFlagsReq; if (stuff->msgLength > 0) { char *msg; if (extraLength < XkbPaddedSize(stuff->msgLength)) { ErrorF ("[xkb] XkbDebug: msgLength= %d, length= %ld (should be %d)\n", stuff->msgLength, (long) extraLength, XkbPaddedSize(stuff->msgLength)); return BadLength; } msg = (char *) &stuff[1]; if (msg[stuff->msgLength - 1] != '\0') { ErrorF("[xkb] XkbDebug: message not null-terminated\n"); return BadValue; } ErrorF("[xkb] XkbDebug: %s\n", msg); } xkbDebugFlags = newFlags; xkbDebugCtrls = newCtrls; 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); swapl(&rep.currentCtrls); swapl(&rep.supportedFlags); swapl(&rep.supportedCtrls); } WriteToClient(client, SIZEOF(xkbSetDebuggingFlagsReply), &rep); return Success; } /***====================================================================***/ static int ProcXkbDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_kbUseExtension: return ProcXkbUseExtension(client); case X_kbSelectEvents: return ProcXkbSelectEvents(client); case X_kbBell: return ProcXkbBell(client); case X_kbGetState: return ProcXkbGetState(client); case X_kbLatchLockState: return ProcXkbLatchLockState(client); case X_kbGetControls: return ProcXkbGetControls(client); case X_kbSetControls: return ProcXkbSetControls(client); case X_kbGetMap: return ProcXkbGetMap(client); case X_kbSetMap: return ProcXkbSetMap(client); case X_kbGetCompatMap: return ProcXkbGetCompatMap(client); case X_kbSetCompatMap: return ProcXkbSetCompatMap(client); case X_kbGetIndicatorState: return ProcXkbGetIndicatorState(client); case X_kbGetIndicatorMap: return ProcXkbGetIndicatorMap(client); case X_kbSetIndicatorMap: return ProcXkbSetIndicatorMap(client); case X_kbGetNamedIndicator: return ProcXkbGetNamedIndicator(client); case X_kbSetNamedIndicator: return ProcXkbSetNamedIndicator(client); case X_kbGetNames: return ProcXkbGetNames(client); case X_kbSetNames: return ProcXkbSetNames(client); case X_kbGetGeometry: return ProcXkbGetGeometry(client); case X_kbSetGeometry: return ProcXkbSetGeometry(client); case X_kbPerClientFlags: return ProcXkbPerClientFlags(client); case X_kbListComponents: return ProcXkbListComponents(client); case X_kbGetKbdByName: return ProcXkbGetKbdByName(client); case X_kbGetDeviceInfo: return ProcXkbGetDeviceInfo(client); case X_kbSetDeviceInfo: return ProcXkbSetDeviceInfo(client); case X_kbSetDebuggingFlags: return ProcXkbSetDebuggingFlags(client); default: return BadRequest; } } static int XkbClientGone(void *data, XID id) { DevicePtr pXDev = (DevicePtr) data; if (!XkbRemoveResourceClient(pXDev, id)) { ErrorF ("[xkb] Internal Error! bad RemoveResourceClient in XkbClientGone\n"); } return 1; } void XkbExtensionInit(void) { ExtensionEntry *extEntry; RT_XKBCLIENT = CreateNewResourceType(XkbClientGone, "XkbClient"); if (!RT_XKBCLIENT) return; if (!XkbInitPrivates()) return; if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors, ProcXkbDispatch, SProcXkbDispatch, NULL, StandardMinorOpcode))) { XkbReqCode = (unsigned char) extEntry->base; XkbEventBase = (unsigned char) extEntry->eventBase; XkbErrorBase = (unsigned char) extEntry->errorBase; XkbKeyboardErrorCode = XkbErrorBase + XkbKeyboard; } return; } xorg-server-1.17.1/xkb/xkmread.c0000664000175100017510000012724012456571574013422 00000000000000/************************************************************ Copyright (c) 1994 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 "misc.h" #include "inputstr.h" #include "xkbstr.h" #include "xkbsrv.h" #include "xkbgeom.h" Atom XkbInternAtom(char *str, Bool only_if_exists) { if (str == NULL) return None; return MakeAtom(str, strlen(str), !only_if_exists); } /***====================================================================***/ static void * XkmInsureSize(void *oldPtr, int oldCount, int *newCountRtrn, int elemSize) { int newCount = *newCountRtrn; if (oldPtr == NULL) { if (newCount == 0) return NULL; oldPtr = calloc(newCount, elemSize); } else if (oldCount < newCount) { oldPtr = realloc(oldPtr, newCount * elemSize); if (oldPtr != NULL) { char *tmp = (char *) oldPtr; memset(&tmp[oldCount * elemSize], 0, (newCount - oldCount) * elemSize); } } else if (newCount < oldCount) { *newCountRtrn = oldCount; } return oldPtr; } #define XkmInsureTypedSize(p,o,n,t) ((p)=((t *)XkmInsureSize((char *)(p),(o),(n),sizeof(t)))) static CARD8 XkmGetCARD8(FILE * file, int *pNRead) { int tmp; tmp = getc(file); if (pNRead && (tmp != EOF)) (*pNRead) += 1; return tmp; } static CARD16 XkmGetCARD16(FILE * file, int *pNRead) { CARD16 val; if ((fread(&val, 2, 1, file) == 1) && (pNRead)) (*pNRead) += 2; return val; } static CARD32 XkmGetCARD32(FILE * file, int *pNRead) { CARD32 val; if ((fread(&val, 4, 1, file) == 1) && (pNRead)) (*pNRead) += 4; return val; } static int XkmSkipPadding(FILE * file, unsigned pad) { register int i, nRead = 0; for (i = 0; i < pad; i++) { if (getc(file) != EOF) nRead++; } return nRead; } static int XkmGetCountedString(FILE * file, char *str, int max_len) { int count, nRead = 0; count = XkmGetCARD16(file, &nRead); if (count > 0) { int tmp; if (count > max_len) { tmp = fread(str, 1, max_len, file); while (tmp < count) { if ((getc(file)) != EOF) tmp++; else break; } } else { tmp = fread(str, 1, count, file); } nRead += tmp; } if (count >= max_len) str[max_len - 1] = '\0'; else str[count] = '\0'; count = XkbPaddedSize(nRead) - nRead; if (count > 0) nRead += XkmSkipPadding(file, count); return nRead; } /***====================================================================***/ static int ReadXkmVirtualMods(FILE * file, XkbDescPtr xkb, XkbChangesPtr changes) { register unsigned int i, bit; unsigned int bound, named, tmp; int nRead = 0; if (XkbAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmVirtualMods", 0); return -1; } bound = XkmGetCARD16(file, &nRead); named = XkmGetCARD16(file, &nRead); for (i = tmp = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (bound & bit) { xkb->server->vmods[i] = XkmGetCARD8(file, &nRead); if (changes) changes->map.vmods |= bit; tmp++; } } if ((i = XkbPaddedSize(tmp) - tmp) > 0) nRead += XkmSkipPadding(file, i); if (XkbAllocNames(xkb, XkbVirtualModNamesMask, 0, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmVirtualMods", 0); return -1; } for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { char name[100]; if (named & bit) { if (nRead += XkmGetCountedString(file, name, 100)) { xkb->names->vmods[i] = XkbInternAtom(name, FALSE); if (changes) changes->names.changed_vmods |= bit; } } } return nRead; } /***====================================================================***/ static int ReadXkmKeycodes(FILE * file, XkbDescPtr xkb, XkbChangesPtr changes) { register int i; unsigned minKC, maxKC, nAl; int nRead = 0; char name[100]; XkbKeyNamePtr pN; name[0] = '\0'; nRead += XkmGetCountedString(file, name, 100); minKC = XkmGetCARD8(file, &nRead); maxKC = XkmGetCARD8(file, &nRead); if (xkb->min_key_code == 0) { xkb->min_key_code = minKC; xkb->max_key_code = maxKC; } else { if (minKC < xkb->min_key_code) xkb->min_key_code = minKC; if (maxKC > xkb->max_key_code) { _XkbLibError(_XkbErrBadValue, "ReadXkmKeycodes", maxKC); return -1; } } nAl = XkmGetCARD8(file, &nRead); nRead += XkmSkipPadding(file, 1); #define WANTED (XkbKeycodesNameMask|XkbKeyNamesMask|XkbKeyAliasesMask) if (XkbAllocNames(xkb, WANTED, 0, nAl) != Success) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmKeycodes", 0); return -1; } if (name[0] != '\0') { xkb->names->keycodes = XkbInternAtom(name, FALSE); } for (pN = &xkb->names->keys[minKC], i = minKC; i <= (int) maxKC; i++, pN++) { if (fread(pN, 1, XkbKeyNameLength, file) != XkbKeyNameLength) { _XkbLibError(_XkbErrBadLength, "ReadXkmKeycodes", 0); return -1; } nRead += XkbKeyNameLength; } if (nAl > 0) { XkbKeyAliasPtr pAl; for (pAl = xkb->names->key_aliases, i = 0; i < nAl; i++, pAl++) { int tmp; tmp = fread(pAl, 1, 2 * XkbKeyNameLength, file); if (tmp != 2 * XkbKeyNameLength) { _XkbLibError(_XkbErrBadLength, "ReadXkmKeycodes", 0); return -1; } nRead += 2 * XkbKeyNameLength; } if (changes) changes->names.changed |= XkbKeyAliasesMask; } if (changes) changes->names.changed |= XkbKeyNamesMask; return nRead; } /***====================================================================***/ static int ReadXkmKeyTypes(FILE * file, XkbDescPtr xkb, XkbChangesPtr changes) { register unsigned i, n; unsigned num_types; int nRead = 0; int tmp; XkbKeyTypePtr type; xkmKeyTypeDesc wire; XkbKTMapEntryPtr entry; xkmKTMapEntryDesc wire_entry; char buf[100]; if ((tmp = XkmGetCountedString(file, buf, 100)) < 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmKeyTypes", 0); return -1; } nRead += tmp; if (buf[0] != '\0') { if (XkbAllocNames(xkb, XkbTypesNameMask, 0, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmKeyTypes", 0); return -1; } xkb->names->types = XkbInternAtom(buf, FALSE); } num_types = XkmGetCARD16(file, &nRead); nRead += XkmSkipPadding(file, 2); if (num_types < 1) return nRead; if (XkbAllocClientMap(xkb, XkbKeyTypesMask, num_types) != Success) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmKeyTypes", 0); return nRead; } xkb->map->num_types = num_types; if (num_types < XkbNumRequiredTypes) { _XkbLibError(_XkbErrMissingReqTypes, "ReadXkmKeyTypes", 0); return -1; } type = xkb->map->types; for (i = 0; i < num_types; i++, type++) { if ((int) fread(&wire, SIZEOF(xkmKeyTypeDesc), 1, file) < 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmKeyTypes", 0); return -1; } nRead += SIZEOF(xkmKeyTypeDesc); if (((i == XkbOneLevelIndex) && (wire.numLevels != 1)) || (((i == XkbTwoLevelIndex) || (i == XkbAlphabeticIndex) || ((i) == XkbKeypadIndex)) && (wire.numLevels != 2))) { _XkbLibError(_XkbErrBadTypeWidth, "ReadXkmKeyTypes", i); return -1; } tmp = wire.nMapEntries; XkmInsureTypedSize(type->map, type->map_count, &tmp, XkbKTMapEntryRec); if ((wire.nMapEntries > 0) && (type->map == NULL)) { _XkbLibError(_XkbErrBadValue, "ReadXkmKeyTypes", wire.nMapEntries); return -1; } for (n = 0, entry = type->map; n < wire.nMapEntries; n++, entry++) { if (fread(&wire_entry, SIZEOF(xkmKTMapEntryDesc), 1, file) < (int) 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmKeyTypes", 0); return -1; } nRead += SIZEOF(xkmKTMapEntryDesc); entry->active = (wire_entry.virtualMods == 0); entry->level = wire_entry.level; entry->mods.mask = wire_entry.realMods; entry->mods.real_mods = wire_entry.realMods; entry->mods.vmods = wire_entry.virtualMods; } nRead += XkmGetCountedString(file, buf, 100); if (((i == XkbOneLevelIndex) && (strcmp(buf, "ONE_LEVEL") != 0)) || ((i == XkbTwoLevelIndex) && (strcmp(buf, "TWO_LEVEL") != 0)) || ((i == XkbAlphabeticIndex) && (strcmp(buf, "ALPHABETIC") != 0)) || ((i == XkbKeypadIndex) && (strcmp(buf, "KEYPAD") != 0))) { _XkbLibError(_XkbErrBadTypeName, "ReadXkmKeyTypes", 0); return -1; } if (buf[0] != '\0') { type->name = XkbInternAtom(buf, FALSE); } else type->name = None; if (wire.preserve) { xkmModsDesc p_entry; XkbModsPtr pre; XkmInsureTypedSize(type->preserve, type->map_count, &tmp, XkbModsRec); if (type->preserve == NULL) { _XkbLibError(_XkbErrBadMatch, "ReadXkmKeycodes", 0); return -1; } for (n = 0, pre = type->preserve; n < wire.nMapEntries; n++, pre++) { if (fread(&p_entry, SIZEOF(xkmModsDesc), 1, file) < 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmKeycodes", 0); return -1; } nRead += SIZEOF(xkmModsDesc); pre->mask = p_entry.realMods; pre->real_mods = p_entry.realMods; pre->vmods = p_entry.virtualMods; } } if (wire.nLevelNames > 0) { int width = wire.numLevels; if (wire.nLevelNames > (unsigned) width) { _XkbLibError(_XkbErrBadMatch, "ReadXkmKeycodes", 0); return -1; } XkmInsureTypedSize(type->level_names, type->num_levels, &width, Atom); if (type->level_names != NULL) { for (n = 0; n < wire.nLevelNames; n++) { if ((tmp = XkmGetCountedString(file, buf, 100)) < 1) return -1; nRead += tmp; if (strlen(buf) == 0) type->level_names[n] = None; else type->level_names[n] = XkbInternAtom(buf, 0); } } } type->mods.mask = wire.realMods; type->mods.real_mods = wire.realMods; type->mods.vmods = wire.virtualMods; type->num_levels = wire.numLevels; type->map_count = wire.nMapEntries; } if (changes) { changes->map.changed |= XkbKeyTypesMask; changes->map.first_type = 0; changes->map.num_types = xkb->map->num_types; } return nRead; } /***====================================================================***/ static int ReadXkmCompatMap(FILE * file, XkbDescPtr xkb, XkbChangesPtr changes) { register int i; unsigned num_si, groups; char name[100]; XkbSymInterpretPtr interp; xkmSymInterpretDesc wire; unsigned tmp; int nRead = 0; XkbCompatMapPtr compat; XkbAction *act; if ((tmp = XkmGetCountedString(file, name, 100)) < 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmCompatMap", 0); return -1; } nRead += tmp; if (name[0] != '\0') { if (XkbAllocNames(xkb, XkbCompatNameMask, 0, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmCompatMap", 0); return -1; } xkb->names->compat = XkbInternAtom(name, FALSE); } num_si = XkmGetCARD16(file, &nRead); groups = XkmGetCARD8(file, &nRead); nRead += XkmSkipPadding(file, 1); if (XkbAllocCompatMap(xkb, XkbAllCompatMask, num_si) != Success) return -1; compat = xkb->compat; compat->num_si = 0; interp = compat->sym_interpret; for (i = 0; i < num_si; i++) { tmp = fread(&wire, SIZEOF(xkmSymInterpretDesc), 1, file); nRead += tmp * SIZEOF(xkmSymInterpretDesc); interp->sym = wire.sym; interp->mods = wire.mods; interp->match = wire.match; interp->virtual_mod = wire.virtualMod; interp->flags = wire.flags; interp->act.type = wire.actionType; act = (XkbAction *) &interp->act; switch (interp->act.type) { case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods: act->mods.flags = wire.actionData[0]; act->mods.mask = wire.actionData[1]; act->mods.real_mods = wire.actionData[2]; act->mods.vmods1 = wire.actionData[3]; act->mods.vmods2 = wire.actionData[4]; break; case XkbSA_SetGroup: case XkbSA_LatchGroup: case XkbSA_LockGroup: act->group.flags = wire.actionData[0]; act->group.group_XXX = wire.actionData[1]; break; case XkbSA_MovePtr: act->ptr.flags = wire.actionData[0]; act->ptr.high_XXX = wire.actionData[1]; act->ptr.low_XXX = wire.actionData[2]; act->ptr.high_YYY = wire.actionData[3]; act->ptr.low_YYY = wire.actionData[4]; break; case XkbSA_PtrBtn: case XkbSA_LockPtrBtn: act->btn.flags = wire.actionData[0]; act->btn.count = wire.actionData[1]; act->btn.button = wire.actionData[2]; break; case XkbSA_DeviceBtn: case XkbSA_LockDeviceBtn: act->devbtn.flags = wire.actionData[0]; act->devbtn.count = wire.actionData[1]; act->devbtn.button = wire.actionData[2]; act->devbtn.device = wire.actionData[3]; break; case XkbSA_SetPtrDflt: act->dflt.flags = wire.actionData[0]; act->dflt.affect = wire.actionData[1]; act->dflt.valueXXX = wire.actionData[2]; break; case XkbSA_ISOLock: act->iso.flags = wire.actionData[0]; act->iso.mask = wire.actionData[1]; act->iso.real_mods = wire.actionData[2]; act->iso.group_XXX = wire.actionData[3]; act->iso.affect = wire.actionData[4]; act->iso.vmods1 = wire.actionData[5]; act->iso.vmods2 = wire.actionData[6]; break; case XkbSA_SwitchScreen: act->screen.flags = wire.actionData[0]; act->screen.screenXXX = wire.actionData[1]; break; case XkbSA_SetControls: case XkbSA_LockControls: act->ctrls.flags = wire.actionData[0]; act->ctrls.ctrls3 = wire.actionData[1]; act->ctrls.ctrls2 = wire.actionData[2]; act->ctrls.ctrls1 = wire.actionData[3]; act->ctrls.ctrls0 = wire.actionData[4]; break; case XkbSA_RedirectKey: act->redirect.new_key = wire.actionData[0]; act->redirect.mods_mask = wire.actionData[1]; act->redirect.mods = wire.actionData[2]; act->redirect.vmods_mask0 = wire.actionData[3]; act->redirect.vmods_mask1 = wire.actionData[4]; act->redirect.vmods0 = wire.actionData[4]; act->redirect.vmods1 = wire.actionData[5]; break; case XkbSA_DeviceValuator: act->devval.device = wire.actionData[0]; act->devval.v1_what = wire.actionData[1]; act->devval.v1_ndx = wire.actionData[2]; act->devval.v1_value = wire.actionData[3]; act->devval.v2_what = wire.actionData[4]; act->devval.v2_ndx = wire.actionData[5]; act->devval.v2_what = wire.actionData[6]; break; case XkbSA_XFree86Private: /* * Bugfix for broken xkbcomp: if we encounter an XFree86Private * action with Any+AnyOfOrNone(All), then we skip the interp as * broken. Versions of xkbcomp below 1.2.2 had a bug where they * would interpret a symbol that couldn't be found in an interpret * as Any. So, an XF86LogWindowTree+AnyOfOrNone(All) interp that * triggered the PrWins action would make every key without an * action trigger PrWins if libX11 didn't yet know about the * XF86LogWindowTree keysym. None too useful. * * We only do this for XFree86 actions, as the current XKB * dataset relies on Any+AnyOfOrNone(All) -> SetMods for Ctrl in * particular. * * See xkbcomp commits 2a473b906943ffd807ad81960c47530ee7ae9a60 and * 3caab5aa37decb7b5dc1642a0452efc3e1f5100e for more details. */ if (interp->sym == NoSymbol && interp->match == XkbSI_AnyOfOrNone && (interp->mods & 0xff) == 0xff) { ErrorF("XKB: Skipping broken Any+AnyOfOrNone(All) -> Private " "action from compiled keymap\n"); continue; } /* copy the kind of action */ memcpy(act->any.data, wire.actionData, XkbAnyActionDataSize); break; case XkbSA_Terminate: /* no args, kinda (note: untrue for xfree86). */ break; case XkbSA_ActionMessage: /* unsupported. */ break; } interp++; compat->num_si++; } if ((num_si > 0) && (changes)) { changes->compat.first_si = 0; changes->compat.num_si = compat->num_si; } if (groups) { register unsigned bit; for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { xkmModsDesc md; if (groups & bit) { tmp = fread(&md, SIZEOF(xkmModsDesc), 1, file); nRead += tmp * SIZEOF(xkmModsDesc); xkb->compat->groups[i].real_mods = md.realMods; xkb->compat->groups[i].vmods = md.virtualMods; if (md.virtualMods != 0) { unsigned mask; if (XkbVirtualModsToReal(xkb, md.virtualMods, &mask)) xkb->compat->groups[i].mask = md.realMods | mask; } else xkb->compat->groups[i].mask = md.realMods; } } if (changes) changes->compat.changed_groups |= groups; } return nRead; } static int ReadXkmIndicators(FILE * file, XkbDescPtr xkb, XkbChangesPtr changes) { register unsigned nLEDs; xkmIndicatorMapDesc wire; char buf[100]; unsigned tmp; int nRead = 0; if ((xkb->indicators == NULL) && (XkbAllocIndicatorMaps(xkb) != Success)) { _XkbLibError(_XkbErrBadAlloc, "indicator rec", 0); return -1; } if (XkbAllocNames(xkb, XkbIndicatorNamesMask, 0, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "indicator names", 0); return -1; } nLEDs = XkmGetCARD8(file, &nRead); nRead += XkmSkipPadding(file, 3); xkb->indicators->phys_indicators = XkmGetCARD32(file, &nRead); while (nLEDs-- > 0) { Atom name; XkbIndicatorMapPtr map; if ((tmp = XkmGetCountedString(file, buf, 100)) < 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmIndicators", 0); return -1; } nRead += tmp; if (buf[0] != '\0') name = XkbInternAtom(buf, FALSE); else name = None; if ((tmp = fread(&wire, SIZEOF(xkmIndicatorMapDesc), 1, file)) < 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmIndicators", 0); return -1; } nRead += tmp * SIZEOF(xkmIndicatorMapDesc); if (xkb->names) { xkb->names->indicators[wire.indicator - 1] = name; if (changes) changes->names.changed_indicators |= (1 << (wire.indicator - 1)); } map = &xkb->indicators->maps[wire.indicator - 1]; map->flags = wire.flags; map->which_groups = wire.which_groups; map->groups = wire.groups; map->which_mods = wire.which_mods; map->mods.mask = wire.real_mods; map->mods.real_mods = wire.real_mods; map->mods.vmods = wire.vmods; map->ctrls = wire.ctrls; } return nRead; } static XkbKeyTypePtr FindTypeForKey(XkbDescPtr xkb, Atom name, unsigned width, KeySym * syms) { if ((!xkb) || (!xkb->map)) return NULL; if (name != None) { register unsigned i; for (i = 0; i < xkb->map->num_types; i++) { if (xkb->map->types[i].name == name) { if (xkb->map->types[i].num_levels != width) DebugF("Group width mismatch between key and type\n"); return &xkb->map->types[i]; } } } if ((width < 2) || ((syms != NULL) && (syms[1] == NoSymbol))) return &xkb->map->types[XkbOneLevelIndex]; if (syms != NULL) { if (XkbKSIsLower(syms[0]) && XkbKSIsUpper(syms[1])) return &xkb->map->types[XkbAlphabeticIndex]; else if (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1])) return &xkb->map->types[XkbKeypadIndex]; } return &xkb->map->types[XkbTwoLevelIndex]; } static int ReadXkmSymbols(FILE * file, XkbDescPtr xkb) { register int i, g, s, totalVModMaps; xkmKeySymMapDesc wireMap; char buf[100]; unsigned minKC, maxKC, groupNames, tmp; int nRead = 0; if ((tmp = XkmGetCountedString(file, buf, 100)) < 1) return -1; nRead += tmp; minKC = XkmGetCARD8(file, &nRead); maxKC = XkmGetCARD8(file, &nRead); groupNames = XkmGetCARD8(file, &nRead); totalVModMaps = XkmGetCARD8(file, &nRead); if (XkbAllocNames(xkb, XkbSymbolsNameMask | XkbPhysSymbolsNameMask | XkbGroupNamesMask, 0, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "physical names", 0); return -1; } if ((buf[0] != '\0') && (xkb->names)) { Atom name; name = XkbInternAtom(buf, 0); xkb->names->symbols = name; xkb->names->phys_symbols = name; } for (i = 0, g = 1; i < XkbNumKbdGroups; i++, g <<= 1) { if (groupNames & g) { if ((tmp = XkmGetCountedString(file, buf, 100)) < 1) return -1; nRead += tmp; if (!xkb->names) continue; if (buf[0] != '\0') { Atom name; name = XkbInternAtom(buf, 0); xkb->names->groups[i] = name; } else xkb->names->groups[i] = None; } } if (XkbAllocServerMap(xkb, XkbAllServerInfoMask, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "server map", 0); return -1; } if (XkbAllocClientMap(xkb, XkbAllClientInfoMask, 0) != Success) { _XkbLibError(_XkbErrBadAlloc, "client map", 0); return -1; } if (XkbAllocControls(xkb, XkbAllControlsMask) != Success) { _XkbLibError(_XkbErrBadAlloc, "controls", 0); return -1; } if ((xkb->map == NULL) || (xkb->server == NULL)) return -1; if (xkb->min_key_code < 8) xkb->min_key_code = minKC; if (xkb->max_key_code < 8) xkb->max_key_code = maxKC; if ((minKC >= 8) && (minKC < xkb->min_key_code)) xkb->min_key_code = minKC; if ((maxKC >= 8) && (maxKC > xkb->max_key_code)) { _XkbLibError(_XkbErrBadValue, "keys in symbol map", maxKC); return -1; } for (i = minKC; i <= (int) maxKC; i++) { Atom typeName[XkbNumKbdGroups]; XkbKeyTypePtr type[XkbNumKbdGroups]; if ((tmp = fread(&wireMap, SIZEOF(xkmKeySymMapDesc), 1, file)) < 1) { _XkbLibError(_XkbErrBadLength, "ReadXkmSymbols", 0); return -1; } nRead += tmp * SIZEOF(xkmKeySymMapDesc); memset((char *) typeName, 0, XkbNumKbdGroups * sizeof(Atom)); memset((char *) type, 0, XkbNumKbdGroups * sizeof(XkbKeyTypePtr)); if (wireMap.flags & XkmKeyHasTypes) { for (g = 0; g < XkbNumKbdGroups; g++) { if ((wireMap.flags & (1 << g)) && ((tmp = XkmGetCountedString(file, buf, 100)) > 0)) { typeName[g] = XkbInternAtom(buf, 1); nRead += tmp; } type[g] = FindTypeForKey(xkb, typeName[g], wireMap.width, NULL); if (type[g] == NULL) { _XkbLibError(_XkbErrMissingTypes, "ReadXkmSymbols", 0); return -1; } if (typeName[g] == type[g]->name) xkb->server->explicit[i] |= (1 << g); } } if (wireMap.flags & XkmRepeatingKey) { xkb->ctrls->per_key_repeat[i / 8] |= (1 << (i % 8)); xkb->server->explicit[i] |= XkbExplicitAutoRepeatMask; } else if (wireMap.flags & XkmNonRepeatingKey) { xkb->ctrls->per_key_repeat[i / 8] &= ~(1 << (i % 8)); xkb->server->explicit[i] |= XkbExplicitAutoRepeatMask; } xkb->map->modmap[i] = wireMap.modifier_map; if (XkbNumGroups(wireMap.num_groups) > 0) { KeySym *sym; int nSyms; if (XkbNumGroups(wireMap.num_groups) > xkb->ctrls->num_groups) xkb->ctrls->num_groups = wireMap.num_groups; nSyms = XkbNumGroups(wireMap.num_groups) * wireMap.width; sym = XkbResizeKeySyms(xkb, i, nSyms); if (!sym) return -1; for (s = 0; s < nSyms; s++) { *sym++ = XkmGetCARD32(file, &nRead); } if (wireMap.flags & XkmKeyHasActions) { XkbAction *act; act = XkbResizeKeyActions(xkb, i, nSyms); for (s = 0; s < nSyms; s++, act++) { tmp = fread(act, SIZEOF(xkmActionDesc), 1, file); nRead += tmp * SIZEOF(xkmActionDesc); } xkb->server->explicit[i] |= XkbExplicitInterpretMask; } } for (g = 0; g < XkbNumGroups(wireMap.num_groups); g++) { if (((xkb->server->explicit[i] & (1 << g)) == 0) || (type[g] == NULL)) { KeySym *tmpSyms; tmpSyms = XkbKeySymsPtr(xkb, i) + (wireMap.width * g); type[g] = FindTypeForKey(xkb, None, wireMap.width, tmpSyms); } xkb->map->key_sym_map[i].kt_index[g] = type[g] - (&xkb->map->types[0]); } xkb->map->key_sym_map[i].group_info = wireMap.num_groups; xkb->map->key_sym_map[i].width = wireMap.width; if (wireMap.flags & XkmKeyHasBehavior) { xkmBehaviorDesc b; tmp = fread(&b, SIZEOF(xkmBehaviorDesc), 1, file); nRead += tmp * SIZEOF(xkmBehaviorDesc); xkb->server->behaviors[i].type = b.type; xkb->server->behaviors[i].data = b.data; xkb->server->explicit[i] |= XkbExplicitBehaviorMask; } } if (totalVModMaps > 0) { xkmVModMapDesc v; for (i = 0; i < totalVModMaps; i++) { tmp = fread(&v, SIZEOF(xkmVModMapDesc), 1, file); nRead += tmp * SIZEOF(xkmVModMapDesc); if (tmp > 0) xkb->server->vmodmap[v.key] = v.vmods; } } return nRead; } static int ReadXkmGeomDoodad(FILE * file, XkbGeometryPtr geom, XkbSectionPtr section) { XkbDoodadPtr doodad; xkmDoodadDesc doodadWire; char buf[100]; unsigned tmp; int nRead = 0; nRead += XkmGetCountedString(file, buf, 100); tmp = fread(&doodadWire, SIZEOF(xkmDoodadDesc), 1, file); nRead += SIZEOF(xkmDoodadDesc) * tmp; doodad = XkbAddGeomDoodad(geom, section, XkbInternAtom(buf, FALSE)); if (!doodad) return nRead; doodad->any.type = doodadWire.any.type; doodad->any.priority = doodadWire.any.priority; doodad->any.top = doodadWire.any.top; doodad->any.left = doodadWire.any.left; switch (doodadWire.any.type) { case XkbOutlineDoodad: case XkbSolidDoodad: doodad->shape.angle = doodadWire.shape.angle; doodad->shape.color_ndx = doodadWire.shape.color_ndx; doodad->shape.shape_ndx = doodadWire.shape.shape_ndx; break; case XkbTextDoodad: doodad->text.angle = doodadWire.text.angle; doodad->text.width = doodadWire.text.width; doodad->text.height = doodadWire.text.height; doodad->text.color_ndx = doodadWire.text.color_ndx; nRead += XkmGetCountedString(file, buf, 100); doodad->text.text = Xstrdup(buf); nRead += XkmGetCountedString(file, buf, 100); doodad->text.font = Xstrdup(buf); break; case XkbIndicatorDoodad: doodad->indicator.shape_ndx = doodadWire.indicator.shape_ndx; doodad->indicator.on_color_ndx = doodadWire.indicator.on_color_ndx; doodad->indicator.off_color_ndx = doodadWire.indicator.off_color_ndx; break; case XkbLogoDoodad: doodad->logo.angle = doodadWire.logo.angle; doodad->logo.color_ndx = doodadWire.logo.color_ndx; doodad->logo.shape_ndx = doodadWire.logo.shape_ndx; nRead += XkmGetCountedString(file, buf, 100); doodad->logo.logo_name = Xstrdup(buf); break; default: /* report error? */ return nRead; } return nRead; } static int ReadXkmGeomOverlay(FILE * file, XkbGeometryPtr geom, XkbSectionPtr section) { char buf[100]; unsigned tmp; int nRead = 0; XkbOverlayPtr ol; XkbOverlayRowPtr row; xkmOverlayDesc olWire; xkmOverlayRowDesc rowWire; register int r; nRead += XkmGetCountedString(file, buf, 100); tmp = fread(&olWire, SIZEOF(xkmOverlayDesc), 1, file); nRead += tmp * SIZEOF(xkmOverlayDesc); ol = XkbAddGeomOverlay(section, XkbInternAtom(buf, FALSE), olWire.num_rows); if (!ol) return nRead; for (r = 0; r < olWire.num_rows; r++) { int k; xkmOverlayKeyDesc keyWire; tmp = fread(&rowWire, SIZEOF(xkmOverlayRowDesc), 1, file); nRead += tmp * SIZEOF(xkmOverlayRowDesc); row = XkbAddGeomOverlayRow(ol, rowWire.row_under, rowWire.num_keys); if (!row) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeomOverlay", 0); return nRead; } for (k = 0; k < rowWire.num_keys; k++) { tmp = fread(&keyWire, SIZEOF(xkmOverlayKeyDesc), 1, file); nRead += tmp * SIZEOF(xkmOverlayKeyDesc); memcpy(row->keys[k].over.name, keyWire.over, XkbKeyNameLength); memcpy(row->keys[k].under.name, keyWire.under, XkbKeyNameLength); } row->num_keys = rowWire.num_keys; } return nRead; } static int ReadXkmGeomSection(FILE * file, XkbGeometryPtr geom) { register int i; XkbSectionPtr section; xkmSectionDesc sectionWire; unsigned tmp; int nRead = 0; char buf[100]; Atom nameAtom; nRead += XkmGetCountedString(file, buf, 100); nameAtom = XkbInternAtom(buf, FALSE); tmp = fread(§ionWire, SIZEOF(xkmSectionDesc), 1, file); nRead += SIZEOF(xkmSectionDesc) * tmp; section = XkbAddGeomSection(geom, nameAtom, sectionWire.num_rows, sectionWire.num_doodads, sectionWire.num_overlays); if (!section) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeomSection", 0); return nRead; } section->top = sectionWire.top; section->left = sectionWire.left; section->width = sectionWire.width; section->height = sectionWire.height; section->angle = sectionWire.angle; section->priority = sectionWire.priority; if (sectionWire.num_rows > 0) { register int k; XkbRowPtr row; xkmRowDesc rowWire; XkbKeyPtr key; xkmKeyDesc keyWire; for (i = 0; i < sectionWire.num_rows; i++) { tmp = fread(&rowWire, SIZEOF(xkmRowDesc), 1, file); nRead += SIZEOF(xkmRowDesc) * tmp; row = XkbAddGeomRow(section, rowWire.num_keys); if (!row) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmKeycodes", 0); return nRead; } row->top = rowWire.top; row->left = rowWire.left; row->vertical = rowWire.vertical; for (k = 0; k < rowWire.num_keys; k++) { tmp = fread(&keyWire, SIZEOF(xkmKeyDesc), 1, file); nRead += SIZEOF(xkmKeyDesc) * tmp; key = XkbAddGeomKey(row); if (!key) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeomSection", 0); return nRead; } memcpy(key->name.name, keyWire.name, XkbKeyNameLength); key->gap = keyWire.gap; key->shape_ndx = keyWire.shape_ndx; key->color_ndx = keyWire.color_ndx; } } } if (sectionWire.num_doodads > 0) { for (i = 0; i < sectionWire.num_doodads; i++) { tmp = ReadXkmGeomDoodad(file, geom, section); nRead += tmp; if (tmp < 1) return nRead; } } if (sectionWire.num_overlays > 0) { for (i = 0; i < sectionWire.num_overlays; i++) { tmp = ReadXkmGeomOverlay(file, geom, section); nRead += tmp; if (tmp < 1) return nRead; } } return nRead; } static int ReadXkmGeometry(FILE * file, XkbDescPtr xkb) { register int i; char buf[100]; unsigned tmp; int nRead = 0; xkmGeometryDesc wireGeom; XkbGeometryPtr geom; XkbGeometrySizesRec sizes; nRead += XkmGetCountedString(file, buf, 100); tmp = fread(&wireGeom, SIZEOF(xkmGeometryDesc), 1, file); nRead += tmp * SIZEOF(xkmGeometryDesc); sizes.which = XkbGeomAllMask; sizes.num_properties = wireGeom.num_properties; sizes.num_colors = wireGeom.num_colors; sizes.num_shapes = wireGeom.num_shapes; sizes.num_sections = wireGeom.num_sections; sizes.num_doodads = wireGeom.num_doodads; sizes.num_key_aliases = wireGeom.num_key_aliases; if (XkbAllocGeometry(xkb, &sizes) != Success) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeometry", 0); return nRead; } geom = xkb->geom; geom->name = XkbInternAtom(buf, FALSE); geom->width_mm = wireGeom.width_mm; geom->height_mm = wireGeom.height_mm; nRead += XkmGetCountedString(file, buf, 100); geom->label_font = Xstrdup(buf); if (wireGeom.num_properties > 0) { char val[1024]; for (i = 0; i < wireGeom.num_properties; i++) { nRead += XkmGetCountedString(file, buf, 100); nRead += XkmGetCountedString(file, val, 1024); if (XkbAddGeomProperty(geom, buf, val) == NULL) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeometry", 0); return nRead; } } } if (wireGeom.num_colors > 0) { for (i = 0; i < wireGeom.num_colors; i++) { nRead += XkmGetCountedString(file, buf, 100); if (XkbAddGeomColor(geom, buf, i) == NULL) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeometry", 0); return nRead; } } } geom->base_color = &geom->colors[wireGeom.base_color_ndx]; geom->label_color = &geom->colors[wireGeom.label_color_ndx]; if (wireGeom.num_shapes > 0) { XkbShapePtr shape; xkmShapeDesc shapeWire; Atom nameAtom; for (i = 0; i < wireGeom.num_shapes; i++) { register int n; XkbOutlinePtr ol; xkmOutlineDesc olWire; nRead += XkmGetCountedString(file, buf, 100); nameAtom = XkbInternAtom(buf, FALSE); tmp = fread(&shapeWire, SIZEOF(xkmShapeDesc), 1, file); nRead += tmp * SIZEOF(xkmShapeDesc); shape = XkbAddGeomShape(geom, nameAtom, shapeWire.num_outlines); if (!shape) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeometry", 0); return nRead; } for (n = 0; n < shapeWire.num_outlines; n++) { register int p; xkmPointDesc ptWire; tmp = fread(&olWire, SIZEOF(xkmOutlineDesc), 1, file); nRead += tmp * SIZEOF(xkmOutlineDesc); ol = XkbAddGeomOutline(shape, olWire.num_points); if (!ol) { _XkbLibError(_XkbErrBadAlloc, "ReadXkmGeometry", 0); return nRead; } ol->num_points = olWire.num_points; ol->corner_radius = olWire.corner_radius; for (p = 0; p < olWire.num_points; p++) { tmp = fread(&ptWire, SIZEOF(xkmPointDesc), 1, file); nRead += tmp * SIZEOF(xkmPointDesc); ol->points[p].x = ptWire.x; ol->points[p].y = ptWire.y; if (ptWire.x < shape->bounds.x1) shape->bounds.x1 = ptWire.x; if (ptWire.x > shape->bounds.x2) shape->bounds.x2 = ptWire.x; if (ptWire.y < shape->bounds.y1) shape->bounds.y1 = ptWire.y; if (ptWire.y > shape->bounds.y2) shape->bounds.y2 = ptWire.y; } } if (shapeWire.primary_ndx != XkbNoShape) shape->primary = &shape->outlines[shapeWire.primary_ndx]; if (shapeWire.approx_ndx != XkbNoShape) shape->approx = &shape->outlines[shapeWire.approx_ndx]; } } if (wireGeom.num_sections > 0) { for (i = 0; i < wireGeom.num_sections; i++) { tmp = ReadXkmGeomSection(file, geom); nRead += tmp; if (tmp == 0) return nRead; } } if (wireGeom.num_doodads > 0) { for (i = 0; i < wireGeom.num_doodads; i++) { tmp = ReadXkmGeomDoodad(file, geom, NULL); nRead += tmp; if (tmp == 0) return nRead; } } if ((wireGeom.num_key_aliases > 0) && (geom->key_aliases)) { int sz = XkbKeyNameLength * 2; int num = wireGeom.num_key_aliases; if (fread(geom->key_aliases, sz, num, file) != num) { _XkbLibError(_XkbErrBadLength, "ReadXkmGeometry", 0); return -1; } nRead += (num * sz); geom->num_key_aliases = num; } return nRead; } Bool XkmProbe(FILE * file) { unsigned hdr, tmp; int nRead = 0; hdr = (('x' << 24) | ('k' << 16) | ('m' << 8) | XkmFileVersion); tmp = XkmGetCARD32(file, &nRead); if (tmp != hdr) { if ((tmp & (~0xff)) == (hdr & (~0xff))) { _XkbLibError(_XkbErrBadFileVersion, "XkmProbe", tmp & 0xff); } return 0; } return 1; } static Bool XkmReadTOC(FILE * file, xkmFileInfo * file_info, int max_toc, xkmSectionInfo * toc) { unsigned hdr, tmp; int nRead = 0; unsigned i, size_toc; hdr = (('x' << 24) | ('k' << 16) | ('m' << 8) | XkmFileVersion); tmp = XkmGetCARD32(file, &nRead); if (tmp != hdr) { if ((tmp & (~0xff)) == (hdr & (~0xff))) { _XkbLibError(_XkbErrBadFileVersion, "XkmReadTOC", tmp & 0xff); } else { _XkbLibError(_XkbErrBadFileType, "XkmReadTOC", tmp); } return 0; } if (fread(file_info, SIZEOF(xkmFileInfo), 1, file) != 1) return 0; size_toc = file_info->num_toc; if (size_toc > max_toc) { DebugF("Warning! Too many TOC entries; last %d ignored\n", size_toc - max_toc); size_toc = max_toc; } for (i = 0; i < size_toc; i++) { if (fread(&toc[i], SIZEOF(xkmSectionInfo), 1, file) != 1) return 0; } return 1; } /***====================================================================***/ #define MAX_TOC 16 unsigned XkmReadFile(FILE * file, unsigned need, unsigned want, XkbDescPtr *xkb) { register unsigned i; xkmSectionInfo toc[MAX_TOC], tmpTOC; xkmFileInfo fileInfo; unsigned tmp, nRead = 0; unsigned which = need | want; if (!XkmReadTOC(file, &fileInfo, MAX_TOC, toc)) return which; if ((fileInfo.present & need) != need) { _XkbLibError(_XkbErrIllegalContents, "XkmReadFile", need & (~fileInfo.present)); return which; } if (*xkb == NULL) *xkb = XkbAllocKeyboard(); for (i = 0; i < fileInfo.num_toc; i++) { fseek(file, toc[i].offset, SEEK_SET); tmp = fread(&tmpTOC, SIZEOF(xkmSectionInfo), 1, file); nRead = tmp * SIZEOF(xkmSectionInfo); if ((tmpTOC.type != toc[i].type) || (tmpTOC.format != toc[i].format) || (tmpTOC.size != toc[i].size) || (tmpTOC.offset != toc[i].offset)) { return which; } if ((which & (1 << tmpTOC.type)) == 0) { continue; } switch (tmpTOC.type) { case XkmVirtualModsIndex: tmp = ReadXkmVirtualMods(file, *xkb, NULL); break; case XkmTypesIndex: tmp = ReadXkmKeyTypes(file, *xkb, NULL); break; case XkmCompatMapIndex: tmp = ReadXkmCompatMap(file, *xkb, NULL); break; case XkmKeyNamesIndex: tmp = ReadXkmKeycodes(file, *xkb, NULL); break; case XkmIndicatorsIndex: tmp = ReadXkmIndicators(file, *xkb, NULL); break; case XkmSymbolsIndex: tmp = ReadXkmSymbols(file, *xkb); break; case XkmGeometryIndex: tmp = ReadXkmGeometry(file, *xkb); break; default: _XkbLibError(_XkbErrBadImplementation, XkbConfigText(tmpTOC.type, XkbMessage), 0); tmp = 0; break; } if (tmp > 0) { nRead += tmp; which &= ~(1 << toc[i].type); (*xkb)->defined |= (1 << toc[i].type); } if (nRead != tmpTOC.size) { _XkbLibError(_XkbErrBadLength, XkbConfigText(tmpTOC.type, XkbMessage), nRead - tmpTOC.size); } } return which; } xorg-server-1.17.1/xkb/xkbInit.c0000664000175100017510000005713012456571574013377 00000000000000/************************************************************ Copyright (c) 1993 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 #include #include #include "misc.h" #include "inputstr.h" #include "opaque.h" #include "property.h" #include "scrnintstr.h" #define XKBSRV_NEED_FILE_FUNCS #include #include "xkbgeom.h" #include #include "xkbfile.h" #include "xkb.h" #define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1) #if defined(__alpha) || defined(__alpha__) #define LED_COMPOSE 2 #define LED_CAPS 3 #define LED_SCROLL 4 #define LED_NUM 5 #define PHYS_LEDS 0x1f #else #ifdef sun #define LED_NUM 1 #define LED_SCROLL 2 #define LED_COMPOSE 3 #define LED_CAPS 4 #define PHYS_LEDS 0x0f #else #define LED_CAPS 1 #define LED_NUM 2 #define LED_SCROLL 3 #define PHYS_LEDS 0x07 #endif #endif #define MAX_TOC 16 typedef struct _SrvXkmInfo { DeviceIntPtr dev; FILE *file; XkbDescPtr xkb; } SrvXkmInfo; /***====================================================================***/ #ifndef XKB_DFLT_RULES_PROP #define XKB_DFLT_RULES_PROP TRUE #endif const char *XkbBaseDirectory = XKB_BASE_DIRECTORY; const char *XkbBinDirectory = XKB_BIN_DIRECTORY; static int XkbWantAccessX = 0; static char *XkbRulesDflt = NULL; static char *XkbModelDflt = NULL; static char *XkbLayoutDflt = NULL; static char *XkbVariantDflt = NULL; static char *XkbOptionsDflt = NULL; static char *XkbRulesUsed = NULL; static char *XkbModelUsed = NULL; static char *XkbLayoutUsed = NULL; static char *XkbVariantUsed = NULL; static char *XkbOptionsUsed = NULL; static XkbDescPtr xkb_cached_map = NULL; static Bool XkbWantRulesProp = XKB_DFLT_RULES_PROP; /***====================================================================***/ /** * Get the current default XKB rules. * Caller must free the data in rmlvo. */ void XkbGetRulesDflts(XkbRMLVOSet * rmlvo) { rmlvo->rules = strdup(XkbRulesDflt ? XkbRulesDflt : XKB_DFLT_RULES); rmlvo->model = strdup(XkbModelDflt ? XkbModelDflt : XKB_DFLT_MODEL); rmlvo->layout = strdup(XkbLayoutDflt ? XkbLayoutDflt : XKB_DFLT_LAYOUT); rmlvo->variant = strdup(XkbVariantDflt ? XkbVariantDflt : XKB_DFLT_VARIANT); rmlvo->options = strdup(XkbOptionsDflt ? XkbOptionsDflt : XKB_DFLT_OPTIONS); } void XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO) { if (!rmlvo) return; free(rmlvo->rules); free(rmlvo->model); free(rmlvo->layout); free(rmlvo->variant); free(rmlvo->options); if (freeRMLVO) free(rmlvo); else memset(rmlvo, 0, sizeof(XkbRMLVOSet)); } static Bool XkbWriteRulesProp(ClientPtr client, void *closure) { int len, out; Atom name; char *pval; len = (XkbRulesUsed ? strlen(XkbRulesUsed) : 0); len += (XkbModelUsed ? strlen(XkbModelUsed) : 0); len += (XkbLayoutUsed ? strlen(XkbLayoutUsed) : 0); len += (XkbVariantUsed ? strlen(XkbVariantUsed) : 0); len += (XkbOptionsUsed ? strlen(XkbOptionsUsed) : 0); if (len < 1) return TRUE; len += 5; /* trailing NULs */ name = MakeAtom(_XKB_RF_NAMES_PROP_ATOM, strlen(_XKB_RF_NAMES_PROP_ATOM), 1); if (name == None) { ErrorF("[xkb] Atom error: %s not created\n", _XKB_RF_NAMES_PROP_ATOM); return TRUE; } pval = (char *) malloc(len); if (!pval) { ErrorF("[xkb] Allocation error: %s proprerty not created\n", _XKB_RF_NAMES_PROP_ATOM); return TRUE; } out = 0; if (XkbRulesUsed) { strcpy(&pval[out], XkbRulesUsed); out += strlen(XkbRulesUsed); } pval[out++] = '\0'; if (XkbModelUsed) { strcpy(&pval[out], XkbModelUsed); out += strlen(XkbModelUsed); } pval[out++] = '\0'; if (XkbLayoutUsed) { strcpy(&pval[out], XkbLayoutUsed); out += strlen(XkbLayoutUsed); } pval[out++] = '\0'; if (XkbVariantUsed) { strcpy(&pval[out], XkbVariantUsed); out += strlen(XkbVariantUsed); } pval[out++] = '\0'; if (XkbOptionsUsed) { strcpy(&pval[out], XkbOptionsUsed); out += strlen(XkbOptionsUsed); } pval[out++] = '\0'; if (out != len) { ErrorF("[xkb] Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n", out, len); } dixChangeWindowProperty(serverClient, screenInfo.screens[0]->root, name, XA_STRING, 8, PropModeReplace, len, pval, TRUE); free(pval); return TRUE; } void XkbInitRules(XkbRMLVOSet *rmlvo, const char *rules, const char *model, const char *layout, const char *variant, const char *options) { rmlvo->rules = rules ? xnfstrdup(rules) : NULL; rmlvo->model = model ? xnfstrdup(model) : NULL; rmlvo->layout = layout ? xnfstrdup(layout) : NULL; rmlvo->variant = variant ? xnfstrdup(variant) : NULL; rmlvo->options = options ? xnfstrdup(options) : NULL; } static void XkbSetRulesUsed(XkbRMLVOSet * rmlvo) { free(XkbRulesUsed); XkbRulesUsed = (rmlvo->rules ? Xstrdup(rmlvo->rules) : NULL); free(XkbModelUsed); XkbModelUsed = (rmlvo->model ? Xstrdup(rmlvo->model) : NULL); free(XkbLayoutUsed); XkbLayoutUsed = (rmlvo->layout ? Xstrdup(rmlvo->layout) : NULL); free(XkbVariantUsed); XkbVariantUsed = (rmlvo->variant ? Xstrdup(rmlvo->variant) : NULL); free(XkbOptionsUsed); XkbOptionsUsed = (rmlvo->options ? Xstrdup(rmlvo->options) : NULL); if (XkbWantRulesProp) QueueWorkProc(XkbWriteRulesProp, NULL, NULL); return; } void XkbSetRulesDflts(XkbRMLVOSet * rmlvo) { if (rmlvo->rules) { free(XkbRulesDflt); XkbRulesDflt = Xstrdup(rmlvo->rules); } if (rmlvo->model) { free(XkbModelDflt); XkbModelDflt = Xstrdup(rmlvo->model); } if (rmlvo->layout) { free(XkbLayoutDflt); XkbLayoutDflt = Xstrdup(rmlvo->layout); } if (rmlvo->variant) { free(XkbVariantDflt); XkbVariantDflt = Xstrdup(rmlvo->variant); } if (rmlvo->options) { free(XkbOptionsDflt); XkbOptionsDflt = Xstrdup(rmlvo->options); } return; } void XkbDeleteRulesUsed(void) { free(XkbRulesUsed); XkbRulesUsed = NULL; free(XkbModelUsed); XkbModelUsed = NULL; free(XkbLayoutUsed); XkbLayoutUsed = NULL; free(XkbVariantUsed); XkbVariantUsed = NULL; free(XkbOptionsUsed); XkbOptionsUsed = NULL; } void XkbDeleteRulesDflts(void) { free(XkbRulesDflt); XkbRulesDflt = NULL; free(XkbModelDflt); XkbModelDflt = NULL; free(XkbLayoutDflt); XkbLayoutDflt = NULL; free(XkbVariantDflt); XkbVariantDflt = NULL; free(XkbOptionsDflt); XkbOptionsDflt = NULL; XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, TRUE); xkb_cached_map = NULL; } #define DIFFERS(a, b) (strcmp((a) ? (a) : "", (b) ? (b) : "") != 0) static Bool XkbCompareUsedRMLVO(XkbRMLVOSet * rmlvo) { if (DIFFERS(rmlvo->rules, XkbRulesUsed) || DIFFERS(rmlvo->model, XkbModelUsed) || DIFFERS(rmlvo->layout, XkbLayoutUsed) || DIFFERS(rmlvo->variant, XkbVariantUsed) || DIFFERS(rmlvo->options, XkbOptionsUsed)) return FALSE; return TRUE; } #undef DIFFERS /***====================================================================***/ #include "xkbDflts.h" static Bool XkbInitKeyTypes(XkbDescPtr xkb) { if (xkb->defined & XkmTypesMask) return TRUE; initTypeNames(NULL); if (XkbAllocClientMap(xkb, XkbKeyTypesMask, num_dflt_types) != Success) return FALSE; if (XkbCopyKeyTypes(dflt_types, xkb->map->types, num_dflt_types) != Success) { return FALSE; } xkb->map->size_types = xkb->map->num_types = num_dflt_types; return TRUE; } static void XkbInitRadioGroups(XkbSrvInfoPtr xkbi) { xkbi->nRadioGroups = 0; xkbi->radioGroups = NULL; return; } static Status XkbInitCompatStructs(XkbDescPtr xkb) { register int i; XkbCompatMapPtr compat; if (xkb->defined & XkmCompatMapMask) return TRUE; if (XkbAllocCompatMap(xkb, XkbAllCompatMask, num_dfltSI) != Success) return BadAlloc; compat = xkb->compat; if (compat->sym_interpret) { compat->num_si = num_dfltSI; memcpy((char *) compat->sym_interpret, (char *) dfltSI, sizeof(dfltSI)); } for (i = 0; i < XkbNumKbdGroups; i++) { compat->groups[i] = compatMap.groups[i]; if (compat->groups[i].vmods != 0) { unsigned mask; mask = XkbMaskForVMask(xkb, compat->groups[i].vmods); compat->groups[i].mask = compat->groups[i].real_mods | mask; } else compat->groups[i].mask = compat->groups[i].real_mods; } return Success; } static void XkbInitSemantics(XkbDescPtr xkb) { XkbInitKeyTypes(xkb); XkbInitCompatStructs(xkb); return; } /***====================================================================***/ static Status XkbInitNames(XkbSrvInfoPtr xkbi) { XkbDescPtr xkb; XkbNamesPtr names; Status rtrn; Atom unknown; xkb = xkbi->desc; if ((rtrn = XkbAllocNames(xkb, XkbAllNamesMask, 0, 0)) != Success) return rtrn; unknown = CREATE_ATOM("unknown"); names = xkb->names; if (names->keycodes == None) names->keycodes = unknown; if (names->geometry == None) names->geometry = unknown; if (names->phys_symbols == None) names->phys_symbols = unknown; if (names->symbols == None) names->symbols = unknown; if (names->types == None) names->types = unknown; if (names->compat == None) names->compat = unknown; if (!(xkb->defined & XkmVirtualModsMask)) { if (names->vmods[vmod_NumLock] == None) names->vmods[vmod_NumLock] = CREATE_ATOM("NumLock"); if (names->vmods[vmod_Alt] == None) names->vmods[vmod_Alt] = CREATE_ATOM("Alt"); if (names->vmods[vmod_AltGr] == None) names->vmods[vmod_AltGr] = CREATE_ATOM("ModeSwitch"); } if (!(xkb->defined & XkmIndicatorsMask) || !(xkb->defined & XkmGeometryMask)) { initIndicatorNames(NULL, xkb); if (names->indicators[LED_CAPS - 1] == None) names->indicators[LED_CAPS - 1] = CREATE_ATOM("Caps Lock"); if (names->indicators[LED_NUM - 1] == None) names->indicators[LED_NUM - 1] = CREATE_ATOM("Num Lock"); if (names->indicators[LED_SCROLL - 1] == None) names->indicators[LED_SCROLL - 1] = CREATE_ATOM("Scroll Lock"); #ifdef LED_COMPOSE if (names->indicators[LED_COMPOSE - 1] == None) names->indicators[LED_COMPOSE - 1] = CREATE_ATOM("Compose"); #endif } if (xkb->geom != NULL) names->geometry = xkb->geom->name; else names->geometry = unknown; return Success; } static Status XkbInitIndicatorMap(XkbSrvInfoPtr xkbi) { XkbDescPtr xkb; XkbIndicatorPtr map; XkbSrvLedInfoPtr sli; xkb = xkbi->desc; if (XkbAllocIndicatorMaps(xkb) != Success) return BadAlloc; if (!(xkb->defined & XkmIndicatorsMask)) { map = xkb->indicators; map->phys_indicators = PHYS_LEDS; map->maps[LED_CAPS - 1].flags = XkbIM_NoExplicit; map->maps[LED_CAPS - 1].which_mods = XkbIM_UseLocked; map->maps[LED_CAPS - 1].mods.mask = LockMask; map->maps[LED_CAPS - 1].mods.real_mods = LockMask; map->maps[LED_NUM - 1].flags = XkbIM_NoExplicit; map->maps[LED_NUM - 1].which_mods = XkbIM_UseLocked; map->maps[LED_NUM - 1].mods.mask = 0; map->maps[LED_NUM - 1].mods.real_mods = 0; map->maps[LED_NUM - 1].mods.vmods = vmod_NumLockMask; map->maps[LED_SCROLL - 1].flags = XkbIM_NoExplicit; map->maps[LED_SCROLL - 1].which_mods = XkbIM_UseLocked; map->maps[LED_SCROLL - 1].mods.mask = Mod3Mask; map->maps[LED_SCROLL - 1].mods.real_mods = Mod3Mask; } sli = XkbFindSrvLedInfo(xkbi->device, XkbDfltXIClass, XkbDfltXIId, 0); if (sli) XkbCheckIndicatorMaps(xkbi->device, sli, XkbAllIndicatorsMask); return Success; } static Status XkbInitControls(DeviceIntPtr pXDev, XkbSrvInfoPtr xkbi) { XkbDescPtr xkb; XkbControlsPtr ctrls; xkb = xkbi->desc; /* 12/31/94 (ef) -- XXX! Should check if controls loaded from file */ if (XkbAllocControls(xkb, XkbAllControlsMask) != Success) FatalError("Couldn't allocate keyboard controls\n"); ctrls = xkb->ctrls; if (!(xkb->defined & XkmSymbolsMask)) ctrls->num_groups = 1; ctrls->groups_wrap = XkbSetGroupInfo(1, XkbWrapIntoRange, 0); ctrls->internal.mask = 0; ctrls->internal.real_mods = 0; ctrls->internal.vmods = 0; ctrls->ignore_lock.mask = 0; ctrls->ignore_lock.real_mods = 0; ctrls->ignore_lock.vmods = 0; ctrls->enabled_ctrls = XkbAccessXTimeoutMask | XkbRepeatKeysMask | XkbMouseKeysAccelMask | XkbAudibleBellMask | XkbIgnoreGroupLockMask; if (XkbWantAccessX) ctrls->enabled_ctrls |= XkbAccessXKeysMask; AccessXInit(pXDev); return Success; } static Bool InitKeyboardDeviceStructInternal(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, const char *keymap, int keymap_length, BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func) { int i; unsigned int check; XkbSrvInfoPtr xkbi; XkbDescPtr xkb; XkbSrvLedInfoPtr sli; XkbChangesRec changes; XkbEventCauseRec cause; XkbRMLVOSet rmlvo_dflts = { NULL }; BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->key != NULL, FALSE); BUG_RETURN_VAL(dev->kbdfeed != NULL, FALSE); BUG_RETURN_VAL(rmlvo && keymap, FALSE); if (!rmlvo && !keymap) { rmlvo = &rmlvo_dflts; XkbGetRulesDflts(rmlvo); } memset(&changes, 0, sizeof(changes)); XkbSetCauseUnknown(&cause); dev->key = calloc(1, sizeof(*dev->key)); if (!dev->key) { ErrorF("XKB: Failed to allocate key class\n"); return FALSE; } dev->key->sourceid = dev->id; dev->kbdfeed = calloc(1, sizeof(*dev->kbdfeed)); if (!dev->kbdfeed) { ErrorF("XKB: Failed to allocate key feedback class\n"); goto unwind_key; } xkbi = calloc(1, sizeof(*xkbi)); if (!xkbi) { ErrorF("XKB: Failed to allocate XKB info\n"); goto unwind_kbdfeed; } dev->key->xkbInfo = xkbi; if (xkb_cached_map && (keymap || (rmlvo && !XkbCompareUsedRMLVO(rmlvo)))) { XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, TRUE); xkb_cached_map = NULL; } if (xkb_cached_map) LogMessageVerb(X_INFO, 4, "XKB: Reusing cached keymap\n"); else { if (rmlvo) xkb_cached_map = XkbCompileKeymap(dev, rmlvo); else xkb_cached_map = XkbCompileKeymapFromString(dev, keymap, keymap_length); if (!xkb_cached_map) { ErrorF("XKB: Failed to compile keymap\n"); goto unwind_info; } } xkb = XkbAllocKeyboard(); if (!xkb) { ErrorF("XKB: Failed to allocate keyboard description\n"); goto unwind_info; } if (!XkbCopyKeymap(xkb, xkb_cached_map)) { ErrorF("XKB: Failed to copy keymap\n"); goto unwind_desc; } xkb->defined = xkb_cached_map->defined; xkb->flags = xkb_cached_map->flags; xkb->device_spec = xkb_cached_map->device_spec; xkbi->desc = xkb; if (xkb->min_key_code == 0) xkb->min_key_code = 8; if (xkb->max_key_code == 0) xkb->max_key_code = 255; i = XkbNumKeys(xkb) / 3 + 1; if (XkbAllocClientMap(xkb, XkbAllClientInfoMask, 0) != Success) goto unwind_desc; if (XkbAllocServerMap(xkb, XkbAllServerInfoMask, i) != Success) goto unwind_desc; xkbi->dfltPtrDelta = 1; xkbi->device = dev; XkbInitSemantics(xkb); XkbInitNames(xkbi); XkbInitRadioGroups(xkbi); XkbInitControls(dev, xkbi); XkbInitIndicatorMap(xkbi); XkbUpdateActions(dev, xkb->min_key_code, XkbNumKeys(xkb), &changes, &check, &cause); if (!dev->focus) InitFocusClassDeviceStruct(dev); xkbi->kbdProc = ctrl_func; dev->kbdfeed->BellProc = bell_func; dev->kbdfeed->CtrlProc = XkbDDXKeybdCtrlProc; dev->kbdfeed->ctrl = defaultKeyboardControl; if (dev->kbdfeed->ctrl.autoRepeat) xkb->ctrls->enabled_ctrls |= XkbRepeatKeysMask; memcpy(dev->kbdfeed->ctrl.autoRepeats, xkb->ctrls->per_key_repeat, XkbPerKeyBitArraySize); sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); if (sli) XkbCheckIndicatorMaps(dev, sli, XkbAllIndicatorsMask); else DebugF("XKB: No indicator feedback in XkbFinishInit!\n"); dev->kbdfeed->CtrlProc(dev, &dev->kbdfeed->ctrl); if (rmlvo) { XkbSetRulesDflts(rmlvo); XkbSetRulesUsed(rmlvo); } XkbFreeRMLVOSet(&rmlvo_dflts, FALSE); return TRUE; unwind_desc: XkbFreeKeyboard(xkb, 0, TRUE); unwind_info: free(xkbi); dev->key->xkbInfo = NULL; unwind_kbdfeed: free(dev->kbdfeed); dev->kbdfeed = NULL; unwind_key: free(dev->key); dev->key = NULL; return FALSE; } _X_EXPORT Bool InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func) { return InitKeyboardDeviceStructInternal(dev, rmlvo, NULL, 0, bell_func, ctrl_func); } _X_EXPORT Bool InitKeyboardDeviceStructFromString(DeviceIntPtr dev, const char *keymap, int keymap_length, BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func) { return InitKeyboardDeviceStructInternal(dev, NULL, keymap, keymap_length, bell_func, ctrl_func); } /***====================================================================***/ /* * Be very careful about what does and doesn't get freed by this * function. To reduce fragmentation, XkbInitDevice allocates a * single huge block per device and divides it up into most of the * fixed-size structures for the device. Don't free anything that * is part of this larger block. */ void XkbFreeInfo(XkbSrvInfoPtr xkbi) { free(xkbi->radioGroups); xkbi->radioGroups = NULL; if (xkbi->mouseKeyTimer) { TimerFree(xkbi->mouseKeyTimer); xkbi->mouseKeyTimer = NULL; } if (xkbi->slowKeysTimer) { TimerFree(xkbi->slowKeysTimer); xkbi->slowKeysTimer = NULL; } if (xkbi->bounceKeysTimer) { TimerFree(xkbi->bounceKeysTimer); xkbi->bounceKeysTimer = NULL; } if (xkbi->repeatKeyTimer) { TimerFree(xkbi->repeatKeyTimer); xkbi->repeatKeyTimer = NULL; } if (xkbi->krgTimer) { TimerFree(xkbi->krgTimer); xkbi->krgTimer = NULL; } xkbi->beepType = _BEEP_NONE; if (xkbi->beepTimer) { TimerFree(xkbi->beepTimer); xkbi->beepTimer = NULL; } if (xkbi->desc) { XkbFreeKeyboard(xkbi->desc, XkbAllComponentsMask, TRUE); xkbi->desc = NULL; } free(xkbi); return; } /***====================================================================***/ extern int XkbDfltRepeatDelay; extern int XkbDfltRepeatInterval; extern unsigned short XkbDfltAccessXTimeout; extern unsigned int XkbDfltAccessXTimeoutMask; extern unsigned int XkbDfltAccessXFeedback; extern unsigned char XkbDfltAccessXOptions; int XkbProcessArguments(int argc, char *argv[], int i) { if (strncmp(argv[i], "-xkbdir", 7) == 0) { if (++i < argc) { #if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != geteuid()) { LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n"); return -1; } else #endif { if (strlen(argv[i]) < PATH_MAX) { XkbBaseDirectory = argv[i]; return 2; } else { LogMessage(X_ERROR, "-xkbdir pathname too long\n"); return -1; } } } else { return -1; } } else if ((strncmp(argv[i], "-accessx", 8) == 0) || (strncmp(argv[i], "+accessx", 8) == 0)) { int j = 1; if (argv[i][0] == '-') XkbWantAccessX = 0; else { XkbWantAccessX = 1; if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) { XkbDfltAccessXTimeout = atoi(argv[++i]); j++; if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) { /* * presumption that the reasonably useful range of * values fits in 0..MAXINT since SunOS 4 doesn't * have strtoul. */ XkbDfltAccessXTimeoutMask = (unsigned int) strtol(argv[++i], NULL, 16); j++; } if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) { if (argv[++i][0] == '1') XkbDfltAccessXFeedback = XkbAccessXFeedbackMask; else XkbDfltAccessXFeedback = 0; j++; } if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) { XkbDfltAccessXOptions = (unsigned char) strtol(argv[++i], NULL, 16); j++; } } } return j; } if ((strcmp(argv[i], "-ardelay") == 0) || (strcmp(argv[i], "-ar1") == 0)) { /* -ardelay int */ if (++i >= argc) UseMsg(); else XkbDfltRepeatDelay = (long) atoi(argv[i]); return 2; } if ((strcmp(argv[i], "-arinterval") == 0) || (strcmp(argv[i], "-ar2") == 0)) { /* -arinterval int */ if (++i >= argc) UseMsg(); else XkbDfltRepeatInterval = (long) atoi(argv[i]); return 2; } return 0; } void XkbUseMsg(void) { ErrorF ("[+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ]\n"); ErrorF(" enable/disable accessx key sequences\n"); ErrorF("-ardelay set XKB autorepeat delay\n"); ErrorF("-arinterval set XKB autorepeat interval\n"); } xorg-server-1.17.1/xkb/xkbfmisc.c0000664000175100017510000003652212456571574013577 00000000000000/************************************************************ 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 #include #include "misc.h" #include "inputstr.h" #include "dix.h" #include "xkbstr.h" #define XKBSRV_NEED_FILE_FUNCS 1 #include #include "xkbgeom.h" #include "xkb.h" unsigned _XkbKSCheckCase(KeySym ks) { unsigned set, rtrn; set = (ks & (~0xff)) >> 8; rtrn = 0; switch (set) { case 0: /* latin 1 */ if (((ks >= XK_A) && (ks <= XK_Z)) || ((ks >= XK_Agrave) && (ks <= XK_THORN) && (ks != XK_multiply))) { rtrn |= _XkbKSUpper; } if (((ks >= XK_a) && (ks <= XK_z)) || ((ks >= XK_ssharp) && (ks <= XK_ydiaeresis) && (ks != XK_division))) { rtrn |= _XkbKSLower; } break; case 1: /* latin 2 */ if (((ks >= XK_Aogonek) && (ks <= XK_Zabovedot) && (ks != XK_breve)) || ((ks >= XK_Racute) && (ks <= XK_Tcedilla))) { rtrn |= _XkbKSUpper; } if (((ks >= XK_aogonek) && (ks <= XK_zabovedot) && (ks != XK_ogonek) && (ks != XK_caron) && (ks != XK_doubleacute)) || ((ks >= XK_racute) && (ks <= XK_tcedilla))) { rtrn |= _XkbKSLower; } break; case 2: /* latin 3 */ if (((ks >= XK_Hstroke) && (ks <= XK_Jcircumflex)) || ((ks >= XK_Cabovedot) && (ks <= XK_Scircumflex))) { rtrn |= _XkbKSUpper; } if (((ks >= XK_hstroke) && (ks <= XK_jcircumflex)) || ((ks >= XK_cabovedot) && (ks <= XK_scircumflex))) { rtrn |= _XkbKSLower; } break; case 3: /* latin 4 */ if (((ks >= XK_Rcedilla) && (ks <= XK_Tslash)) || (ks == XK_ENG) || ((ks >= XK_Amacron) && (ks <= XK_Umacron))) { rtrn |= _XkbKSUpper; } if ((ks == XK_kra) || ((ks >= XK_rcedilla) && (ks <= XK_tslash)) || (ks == XK_eng) || ((ks >= XK_amacron) && (ks <= XK_umacron))) { rtrn |= _XkbKSLower; } break; case 18: /* latin 8 */ if ((ks == XK_Wcircumflex) || (ks == XK_Ycircumflex) || (ks == XK_Babovedot) || (ks == XK_Dabovedot) || (ks == XK_Fabovedot) || (ks == XK_Mabovedot) || (ks == XK_Pabovedot) || (ks == XK_Sabovedot) || (ks == XK_Tabovedot) || (ks == XK_Wgrave) || (ks == XK_Wacute) || (ks == XK_Wdiaeresis) || (ks == XK_Ygrave)) { rtrn |= _XkbKSUpper; } if ((ks == XK_wcircumflex) || (ks == XK_ycircumflex) || (ks == XK_babovedot) || (ks == XK_dabovedot) || (ks == XK_fabovedot) || (ks == XK_mabovedot) || (ks == XK_pabovedot) || (ks == XK_sabovedot) || (ks == XK_tabovedot) || (ks == XK_wgrave) || (ks == XK_wacute) || (ks == XK_wdiaeresis) || (ks == XK_ygrave)) { rtrn |= _XkbKSLower; } break; case 19: /* latin 9 */ if ((ks == XK_OE) || (ks == XK_Ydiaeresis)) { rtrn |= _XkbKSUpper; } if (ks == XK_oe) { rtrn |= _XkbKSLower; } break; } return rtrn; } /***===================================================================***/ static Bool XkbWriteSectionFromName(FILE * file, const char *sectionName, const char *name) { fprintf(file, " xkb_%-20s { include \"%s\" };\n", sectionName, name); return TRUE; } #define NEED_DESC(n) ((!n)||((n)[0]=='+')||((n)[0]=='|')||(strchr((n),'%'))) #define COMPLETE(n) ((n)&&(!NEED_DESC(n))) /* ARGSUSED */ static void _AddIncl(FILE * file, XkbDescPtr xkb, Bool topLevel, Bool showImplicit, int index, void *priv) { if ((priv) && (strcmp((char *) priv, "%") != 0)) fprintf(file, " include \"%s\"\n", (char *) priv); return; } Bool XkbWriteXKBKeymapForNames(FILE * file, XkbComponentNamesPtr names, XkbDescPtr xkb, unsigned want, unsigned need) { const char *tmp; unsigned complete; XkbNamesPtr old_names; int multi_section; unsigned wantNames, wantConfig, wantDflts; complete = 0; if (COMPLETE(names->keycodes)) complete |= XkmKeyNamesMask; if (COMPLETE(names->types)) complete |= XkmTypesMask; if (COMPLETE(names->compat)) complete |= XkmCompatMapMask; if (COMPLETE(names->symbols)) complete |= XkmSymbolsMask; if (COMPLETE(names->geometry)) complete |= XkmGeometryMask; want |= (complete | need); if (want & XkmSymbolsMask) want |= XkmKeyNamesMask | XkmTypesMask; if (want == 0) return FALSE; if (xkb) { old_names = xkb->names; xkb->defined = 0; /* Wow would it ever be neat if we didn't need this noise. */ if (xkb->names && xkb->names->keys) xkb->defined |= XkmKeyNamesMask; if (xkb->map && xkb->map->types) xkb->defined |= XkmTypesMask; if (xkb->compat) xkb->defined |= XkmCompatMapMask; if (xkb->map && xkb->map->num_syms) xkb->defined |= XkmSymbolsMask; if (xkb->indicators) xkb->defined |= XkmIndicatorsMask; if (xkb->geom) xkb->defined |= XkmGeometryMask; } else { old_names = NULL; } wantConfig = want & (~complete); if (xkb != NULL) { if (wantConfig & XkmTypesMask) { if ((!xkb->map) || (xkb->map->num_types < XkbNumRequiredTypes)) wantConfig &= ~XkmTypesMask; } if (wantConfig & XkmCompatMapMask) { if ((!xkb->compat) || (xkb->compat->num_si < 1)) wantConfig &= ~XkmCompatMapMask; } if (wantConfig & XkmSymbolsMask) { if ((!xkb->map) || (!xkb->map->key_sym_map)) wantConfig &= ~XkmSymbolsMask; } if (wantConfig & XkmIndicatorsMask) { if (!xkb->indicators) wantConfig &= ~XkmIndicatorsMask; } if (wantConfig & XkmKeyNamesMask) { if ((!xkb->names) || (!xkb->names->keys)) wantConfig &= ~XkmKeyNamesMask; } if ((wantConfig & XkmGeometryMask) && (!xkb->geom)) wantConfig &= ~XkmGeometryMask; } else { wantConfig = 0; } complete |= wantConfig; wantDflts = 0; wantNames = want & (~complete); if ((xkb != NULL) && (old_names != NULL)) { if (wantNames & XkmTypesMask) { if (old_names->types != None) { tmp = NameForAtom(old_names->types); names->types = Xstrdup(tmp); } else { wantDflts |= XkmTypesMask; } complete |= XkmTypesMask; } if (wantNames & XkmCompatMapMask) { if (old_names->compat != None) { tmp = NameForAtom(old_names->compat); names->compat = Xstrdup(tmp); } else wantDflts |= XkmCompatMapMask; complete |= XkmCompatMapMask; } if (wantNames & XkmSymbolsMask) { if (old_names->symbols == None) return FALSE; tmp = NameForAtom(old_names->symbols); names->symbols = Xstrdup(tmp); complete |= XkmSymbolsMask; } if (wantNames & XkmKeyNamesMask) { if (old_names->keycodes != None) { tmp = NameForAtom(old_names->keycodes); names->keycodes = Xstrdup(tmp); } else wantDflts |= XkmKeyNamesMask; complete |= XkmKeyNamesMask; } if (wantNames & XkmGeometryMask) { if (old_names->geometry == None) return FALSE; tmp = NameForAtom(old_names->geometry); names->geometry = Xstrdup(tmp); complete |= XkmGeometryMask; wantNames &= ~XkmGeometryMask; } } if (complete & XkmCompatMapMask) complete |= XkmIndicatorsMask | XkmVirtualModsMask; else if (complete & (XkmSymbolsMask | XkmTypesMask)) complete |= XkmVirtualModsMask; if (need & (~complete)) return FALSE; if ((complete & XkmSymbolsMask) && ((XkmKeyNamesMask | XkmTypesMask) & (~complete))) return FALSE; multi_section = 1; if (((complete & XkmKeymapRequired) == XkmKeymapRequired) && ((complete & (~XkmKeymapLegal)) == 0)) { fprintf(file, "xkb_keymap \"default\" {\n"); } else if (((complete & XkmSemanticsRequired) == XkmSemanticsRequired) && ((complete & (~XkmSemanticsLegal)) == 0)) { fprintf(file, "xkb_semantics \"default\" {\n"); } else if (((complete & XkmLayoutRequired) == XkmLayoutRequired) && ((complete & (~XkmLayoutLegal)) == 0)) { fprintf(file, "xkb_layout \"default\" {\n"); } else if (XkmSingleSection(complete & (~XkmVirtualModsMask))) { multi_section = 0; } else { return FALSE; } wantNames = complete & (~(wantConfig | wantDflts)); if (wantConfig & XkmKeyNamesMask) XkbWriteXKBKeycodes(file, xkb, FALSE, FALSE, _AddIncl, names->keycodes); else if (wantDflts & XkmKeyNamesMask) fprintf(stderr, "Default symbols not implemented yet!\n"); else if (wantNames & XkmKeyNamesMask) XkbWriteSectionFromName(file, "keycodes", names->keycodes); if (wantConfig & XkmTypesMask) XkbWriteXKBKeyTypes(file, xkb, FALSE, FALSE, _AddIncl, names->types); else if (wantDflts & XkmTypesMask) fprintf(stderr, "Default types not implemented yet!\n"); else if (wantNames & XkmTypesMask) XkbWriteSectionFromName(file, "types", names->types); if (wantConfig & XkmCompatMapMask) XkbWriteXKBCompatMap(file, xkb, FALSE, FALSE, _AddIncl, names->compat); else if (wantDflts & XkmCompatMapMask) fprintf(stderr, "Default interps not implemented yet!\n"); else if (wantNames & XkmCompatMapMask) XkbWriteSectionFromName(file, "compatibility", names->compat); if (wantConfig & XkmSymbolsMask) XkbWriteXKBSymbols(file, xkb, FALSE, FALSE, _AddIncl, names->symbols); else if (wantNames & XkmSymbolsMask) XkbWriteSectionFromName(file, "symbols", names->symbols); if (wantConfig & XkmGeometryMask) XkbWriteXKBGeometry(file, xkb, FALSE, FALSE, _AddIncl, names->geometry); else if (wantNames & XkmGeometryMask) XkbWriteSectionFromName(file, "geometry", names->geometry); if (multi_section) fprintf(file, "};\n"); return TRUE; } /***====================================================================***/ int XkbFindKeycodeByName(XkbDescPtr xkb, char *name, Bool use_aliases) { register int i; if ((!xkb) || (!xkb->names) || (!xkb->names->keys)) return 0; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { if (strncmp(xkb->names->keys[i].name, name, XkbKeyNameLength) == 0) return i; } if (!use_aliases) return 0; if (xkb->geom && xkb->geom->key_aliases) { XkbKeyAliasPtr a; a = xkb->geom->key_aliases; for (i = 0; i < xkb->geom->num_key_aliases; i++, a++) { if (strncmp(name, a->alias, XkbKeyNameLength) == 0) return XkbFindKeycodeByName(xkb, a->real, FALSE); } } if (xkb->names && xkb->names->key_aliases) { XkbKeyAliasPtr a; a = xkb->names->key_aliases; for (i = 0; i < xkb->names->num_key_aliases; i++, a++) { if (strncmp(name, a->alias, XkbKeyNameLength) == 0) return XkbFindKeycodeByName(xkb, a->real, FALSE); } } return 0; } unsigned XkbConvertGetByNameComponents(Bool toXkm, unsigned orig) { unsigned rtrn; rtrn = 0; if (toXkm) { if (orig & XkbGBN_TypesMask) rtrn |= XkmTypesMask; if (orig & XkbGBN_CompatMapMask) rtrn |= XkmCompatMapMask; if (orig & XkbGBN_SymbolsMask) rtrn |= XkmSymbolsMask; if (orig & XkbGBN_IndicatorMapMask) rtrn |= XkmIndicatorsMask; if (orig & XkbGBN_KeyNamesMask) rtrn |= XkmKeyNamesMask; if (orig & XkbGBN_GeometryMask) rtrn |= XkmGeometryMask; } else { if (orig & XkmTypesMask) rtrn |= XkbGBN_TypesMask; if (orig & XkmCompatMapMask) rtrn |= XkbGBN_CompatMapMask; if (orig & XkmSymbolsMask) rtrn |= XkbGBN_SymbolsMask; if (orig & XkmIndicatorsMask) rtrn |= XkbGBN_IndicatorMapMask; if (orig & XkmKeyNamesMask) rtrn |= XkbGBN_KeyNamesMask; if (orig & XkmGeometryMask) rtrn |= XkbGBN_GeometryMask; if (orig != 0) rtrn |= XkbGBN_OtherNamesMask; } return rtrn; } /***====================================================================***/ #define UNMATCHABLE(c) (((c)=='(')||((c)==')')||((c)=='/')) Bool XkbNameMatchesPattern(char *name, char *ptrn) { while (ptrn[0] != '\0') { if (name[0] == '\0') { if (ptrn[0] == '*') { ptrn++; continue; } return FALSE; } if (ptrn[0] == '?') { if (UNMATCHABLE(name[0])) return FALSE; } else if (ptrn[0] == '*') { if ((!UNMATCHABLE(name[0])) && XkbNameMatchesPattern(name + 1, ptrn)) return TRUE; return XkbNameMatchesPattern(name, ptrn + 1); } else if (ptrn[0] != name[0]) return FALSE; name++; ptrn++; } /* if we get here, the pattern is exhausted (-:just like me:-) */ return name[0] == '\0'; } xorg-server-1.17.1/xkb/ddxPrivate.c0000664000175100017510000000031412274325512014054 00000000000000 #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "windowstr.h" #include int XkbDDXPrivate(DeviceIntPtr dev, KeyCode key, XkbAction *act) { return 0; } xorg-server-1.17.1/xkb/xkbAccessX.c0000664000175100017510000006716312456571574014034 00000000000000/************************************************************ Copyright (c) 1993 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 "exglobals.h" #include #include "inputstr.h" #include "eventstr.h" #include "inpututils.h" #include #if !defined(WIN32) #include #endif int XkbDfltRepeatDelay = 660; int XkbDfltRepeatInterval = 40; #define DFLT_TIMEOUT_CTRLS (XkbAX_KRGMask|XkbStickyKeysMask|XkbMouseKeysMask) #define DFLT_TIMEOUT_OPTS (XkbAX_IndicatorFBMask) unsigned short XkbDfltAccessXTimeout = 120; unsigned int XkbDfltAccessXTimeoutMask = DFLT_TIMEOUT_CTRLS; static unsigned int XkbDfltAccessXTimeoutValues = 0; static unsigned int XkbDfltAccessXTimeoutOptionsMask = DFLT_TIMEOUT_OPTS; static unsigned int XkbDfltAccessXTimeoutOptionsValues = 0; unsigned int XkbDfltAccessXFeedback = XkbAccessXFeedbackMask; unsigned short XkbDfltAccessXOptions = XkbAX_AllOptionsMask & ~(XkbAX_IndicatorFBMask | XkbAX_SKReleaseFBMask | XkbAX_SKRejectFBMask); void AccessXComputeCurveFactor(XkbSrvInfoPtr xkbi, XkbControlsPtr ctrls) { xkbi->mouseKeysCurve = 1.0 + (((double) ctrls->mk_curve) * 0.001); xkbi->mouseKeysCurveFactor = (((double) ctrls->mk_max_speed) / pow((double) ctrls->mk_time_to_max, xkbi->mouseKeysCurve)); return; } void AccessXInit(DeviceIntPtr keybd) { XkbSrvInfoPtr xkbi = keybd->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; xkbi->shiftKeyCount = 0; xkbi->mouseKeysCounter = 0; xkbi->inactiveKey = 0; xkbi->slowKey = 0; xkbi->repeatKey = 0; xkbi->krgTimerActive = _OFF_TIMER; xkbi->beepType = _BEEP_NONE; xkbi->beepCount = 0; xkbi->mouseKeyTimer = NULL; xkbi->slowKeysTimer = NULL; xkbi->bounceKeysTimer = NULL; xkbi->repeatKeyTimer = NULL; xkbi->krgTimer = NULL; xkbi->beepTimer = NULL; ctrls->repeat_delay = XkbDfltRepeatDelay; ctrls->repeat_interval = XkbDfltRepeatInterval; ctrls->debounce_delay = 300; ctrls->slow_keys_delay = 300; ctrls->mk_delay = 160; ctrls->mk_interval = 40; ctrls->mk_time_to_max = 30; ctrls->mk_max_speed = 30; ctrls->mk_curve = 500; ctrls->mk_dflt_btn = 1; ctrls->ax_timeout = XkbDfltAccessXTimeout; ctrls->axt_ctrls_mask = XkbDfltAccessXTimeoutMask; ctrls->axt_ctrls_values = XkbDfltAccessXTimeoutValues; ctrls->axt_opts_mask = XkbDfltAccessXTimeoutOptionsMask; ctrls->axt_opts_values = XkbDfltAccessXTimeoutOptionsValues; if (XkbDfltAccessXTimeout) ctrls->enabled_ctrls |= XkbAccessXTimeoutMask; else ctrls->enabled_ctrls &= ~XkbAccessXTimeoutMask; ctrls->enabled_ctrls |= XkbDfltAccessXFeedback; ctrls->ax_options = XkbDfltAccessXOptions; AccessXComputeCurveFactor(xkbi, ctrls); return; } /************************************************************************/ /* */ /* AccessXKeyboardEvent */ /* */ /* Generate a synthetic keyboard event. */ /* */ /************************************************************************/ static void AccessXKeyboardEvent(DeviceIntPtr keybd, int type, BYTE keyCode, Bool isRepeat) { DeviceEvent event; init_device_event(&event, keybd, GetTimeInMillis()); event.type = type; event.detail.key = keyCode; event.key_repeat = isRepeat; if (xkbDebugFlags & 0x8) { DebugF("[xkb] AXKE: Key %d %s\n", keyCode, (event.type == ET_KeyPress ? "down" : "up")); } XkbProcessKeyboardEvent(&event, keybd); return; } /* AccessXKeyboardEvent */ /************************************************************************/ /* */ /* AccessXKRGTurnOn */ /* */ /* Turn the keyboard response group on. */ /* */ /************************************************************************/ static void AccessXKRGTurnOn(DeviceIntPtr dev, CARD16 KRGControl, xkbControlsNotify * pCN) { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; XkbControlsRec old; XkbEventCauseRec cause; XkbSrvLedInfoPtr sli; old = *ctrls; ctrls->enabled_ctrls |= (KRGControl & XkbAX_KRGMask); if (XkbComputeControlsNotify(dev, &old, ctrls, pCN, FALSE)) XkbSendControlsNotify(dev, pCN); cause.kc = pCN->keycode; cause.event = pCN->eventType; cause.mjr = pCN->requestMajor; cause.mnr = pCN->requestMinor; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(dev, sli->usesControls, TRUE, NULL, &cause); if (XkbAX_NeedFeedback(ctrls, XkbAX_FeatureFBMask)) XkbDDXAccessXBeep(dev, _BEEP_FEATURE_ON, KRGControl); return; } /* AccessXKRGTurnOn */ /************************************************************************/ /* */ /* AccessXKRGTurnOff */ /* */ /* Turn the keyboard response group off. */ /* */ /************************************************************************/ static void AccessXKRGTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN) { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; XkbControlsRec old; XkbEventCauseRec cause; XkbSrvLedInfoPtr sli; old = *ctrls; ctrls->enabled_ctrls &= ~XkbAX_KRGMask; if (XkbComputeControlsNotify(dev, &old, ctrls, pCN, FALSE)) XkbSendControlsNotify(dev, pCN); cause.kc = pCN->keycode; cause.event = pCN->eventType; cause.mjr = pCN->requestMajor; cause.mnr = pCN->requestMinor; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(dev, sli->usesControls, TRUE, NULL, &cause); if (XkbAX_NeedFeedback(ctrls, XkbAX_FeatureFBMask)) { unsigned changes = old.enabled_ctrls ^ ctrls->enabled_ctrls; XkbDDXAccessXBeep(dev, _BEEP_FEATURE_OFF, changes); } return; } /* AccessXKRGTurnOff */ /************************************************************************/ /* */ /* AccessXStickyKeysTurnOn */ /* */ /* Turn StickyKeys on. */ /* */ /************************************************************************/ static void AccessXStickyKeysTurnOn(DeviceIntPtr dev, xkbControlsNotify * pCN) { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; XkbControlsRec old; XkbEventCauseRec cause; XkbSrvLedInfoPtr sli; old = *ctrls; ctrls->enabled_ctrls |= XkbStickyKeysMask; xkbi->shiftKeyCount = 0; if (XkbComputeControlsNotify(dev, &old, ctrls, pCN, FALSE)) XkbSendControlsNotify(dev, pCN); cause.kc = pCN->keycode; cause.event = pCN->eventType; cause.mjr = pCN->requestMajor; cause.mnr = pCN->requestMinor; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(dev, sli->usesControls, TRUE, NULL, &cause); if (XkbAX_NeedFeedback(ctrls, XkbAX_FeatureFBMask)) { XkbDDXAccessXBeep(dev, _BEEP_FEATURE_ON, XkbStickyKeysMask); } return; } /* AccessXStickyKeysTurnOn */ /************************************************************************/ /* */ /* AccessXStickyKeysTurnOff */ /* */ /* Turn StickyKeys off. */ /* */ /************************************************************************/ static void AccessXStickyKeysTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN) { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; XkbControlsRec old; XkbEventCauseRec cause; XkbSrvLedInfoPtr sli; old = *ctrls; ctrls->enabled_ctrls &= ~XkbStickyKeysMask; xkbi->shiftKeyCount = 0; if (XkbComputeControlsNotify(dev, &old, ctrls, pCN, FALSE)) XkbSendControlsNotify(dev, pCN); cause.kc = pCN->keycode; cause.event = pCN->eventType; cause.mjr = pCN->requestMajor; cause.mnr = pCN->requestMinor; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(dev, sli->usesControls, TRUE, NULL, &cause); if (XkbAX_NeedFeedback(ctrls, XkbAX_FeatureFBMask)) { XkbDDXAccessXBeep(dev, _BEEP_FEATURE_OFF, XkbStickyKeysMask); } #ifndef NO_CLEAR_LATCHES_FOR_STICKY_KEYS_OFF XkbClearAllLatchesAndLocks(dev, xkbi, FALSE, &cause); #endif return; } /* AccessXStickyKeysTurnOff */ static CARD32 AccessXKRGExpire(OsTimerPtr timer, CARD32 now, void *arg) { xkbControlsNotify cn; DeviceIntPtr dev = arg; XkbSrvInfoPtr xkbi = dev->key->xkbInfo; if (xkbi->krgTimerActive == _KRG_WARN_TIMER) { XkbDDXAccessXBeep(dev, _BEEP_SLOW_WARN, XkbStickyKeysMask); xkbi->krgTimerActive = _KRG_TIMER; return 4000; } xkbi->krgTimerActive = _OFF_TIMER; cn.keycode = xkbi->slowKeyEnableKey; cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) { AccessXKRGTurnOff(dev, &cn); LogMessage(X_INFO, "XKB SlowKeys are disabled.\n"); } else { AccessXKRGTurnOn(dev, XkbSlowKeysMask, &cn); LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n"); } xkbi->slowKeyEnableKey = 0; return 0; } static CARD32 AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr dev = (DeviceIntPtr) arg; XkbSrvInfoPtr xkbi = dev->key->xkbInfo; if (xkbi->repeatKey == 0) return 0; AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE); return xkbi->desc->ctrls->repeat_interval; } void AccessXCancelRepeatKey(XkbSrvInfoPtr xkbi, KeyCode key) { if (xkbi->repeatKey == key) xkbi->repeatKey = 0; return; } static CARD32 AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr keybd; XkbSrvInfoPtr xkbi; XkbDescPtr xkb; XkbControlsPtr ctrls; keybd = (DeviceIntPtr) arg; xkbi = keybd->key->xkbInfo; xkb = xkbi->desc; ctrls = xkb->ctrls; if (xkbi->slowKey != 0) { xkbAccessXNotify ev; KeySym *sym = XkbKeySymsPtr(xkb, xkbi->slowKey); ev.detail = XkbAXN_SKAccept; ev.keycode = xkbi->slowKey; ev.slowKeysDelay = ctrls->slow_keys_delay; ev.debounceDelay = ctrls->debounce_delay; XkbSendAccessXNotify(keybd, &ev); if (XkbAX_NeedFeedback(ctrls, XkbAX_SKAcceptFBMask)) XkbDDXAccessXBeep(keybd, _BEEP_SLOW_ACCEPT, XkbSlowKeysMask); AccessXKeyboardEvent(keybd, ET_KeyPress, xkbi->slowKey, FALSE); /* check for magic sequences */ if ((ctrls->enabled_ctrls & XkbAccessXKeysMask) && ((sym[0] == XK_Shift_R) || (sym[0] == XK_Shift_L))) xkbi->shiftKeyCount++; /* Start repeating if necessary. Stop autorepeating if the user * presses a non-modifier key that doesn't autorepeat. */ if (keybd->kbdfeed->ctrl.autoRepeat && ((xkbi->slowKey != xkbi->mouseKey) || (!xkbi->mouseKeysAccel)) && (ctrls->enabled_ctrls & XkbRepeatKeysMask)) { if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats, xkbi->slowKey)) { xkbi->repeatKey = xkbi->slowKey; xkbi->repeatKeyTimer = TimerSet(xkbi->repeatKeyTimer, 0, ctrls->repeat_delay, AccessXRepeatKeyExpire, (void *) keybd); } } } return 0; } static CARD32 AccessXBounceKeyExpire(OsTimerPtr timer, CARD32 now, void *arg) { XkbSrvInfoPtr xkbi = ((DeviceIntPtr) arg)->key->xkbInfo; xkbi->inactiveKey = 0; return 0; } static CARD32 AccessXTimeoutExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr dev = (DeviceIntPtr) arg; XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; XkbControlsRec old; xkbControlsNotify cn; XkbEventCauseRec cause; XkbSrvLedInfoPtr sli; if (xkbi->lastPtrEventTime) { unsigned timeToWait = (ctrls->ax_timeout * 1000); unsigned timeElapsed = (now - xkbi->lastPtrEventTime); if (timeToWait > timeElapsed) return timeToWait - timeElapsed; } old = *ctrls; xkbi->shiftKeyCount = 0; ctrls->enabled_ctrls &= ~ctrls->axt_ctrls_mask; ctrls->enabled_ctrls |= (ctrls->axt_ctrls_values & ctrls->axt_ctrls_mask); if (ctrls->axt_opts_mask) { ctrls->ax_options &= ~ctrls->axt_opts_mask; ctrls->ax_options |= (ctrls->axt_opts_values & ctrls->axt_opts_mask); } if (XkbComputeControlsNotify(dev, &old, ctrls, &cn, FALSE)) { cn.keycode = 0; cn.eventType = 0; cn.requestMajor = 0; cn.requestMinor = 0; XkbSendControlsNotify(dev, &cn); } XkbSetCauseUnknown(&cause); sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); XkbUpdateIndicators(dev, sli->usesControls, TRUE, NULL, &cause); if (ctrls->ax_options != old.ax_options) { unsigned set, cleared, bell; set = ctrls->ax_options & (~old.ax_options); cleared = (~ctrls->ax_options) & old.ax_options; if (set && cleared) bell = _BEEP_FEATURE_CHANGE; else if (set) bell = _BEEP_FEATURE_ON; else bell = _BEEP_FEATURE_OFF; XkbDDXAccessXBeep(dev, bell, XkbAccessXTimeoutMask); } xkbi->krgTimerActive = _OFF_TIMER; return 0; } /************************************************************************/ /* */ /* AccessXFilterPressEvent */ /* */ /* Filter events before they get any further if SlowKeys is turned on. */ /* In addition, this routine handles the ever so popular magic key */ /* acts for turning various accessibility features on/off. */ /* */ /* Returns TRUE if this routine has discarded the event. */ /* Returns FALSE if the event needs further processing. */ /* */ /************************************************************************/ Bool AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd) { XkbSrvInfoPtr xkbi = keybd->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; Bool ignoreKeyEvent = FALSE; KeyCode key = event->detail.key; KeySym *sym = XkbKeySymsPtr(xkbi->desc, key); 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, AccessXKRGExpire, (void *) keybd); } else { xkbi->krgTimerActive = _KRG_TIMER; xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 8000, AccessXKRGExpire, (void *) keybd); } if (!(ctrls->enabled_ctrls & XkbSlowKeysMask)) { CARD32 now = GetTimeInMillis(); if ((now - xkbi->lastShiftEventTime) > 15000) xkbi->shiftKeyCount = 1; else xkbi->shiftKeyCount++; xkbi->lastShiftEventTime = now; } } else { if (xkbi->krgTimerActive) { xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 0, NULL, NULL); xkbi->krgTimerActive = _OFF_TIMER; } } } /* Don't transmit the KeyPress if SlowKeys is turned on; * The wakeup handler will synthesize one for us if the user * has held the key long enough. */ if (ctrls->enabled_ctrls & XkbSlowKeysMask) { xkbAccessXNotify ev; /* If key was already pressed, ignore subsequent press events * from the server's autorepeat */ if (xkbi->slowKey == key) return TRUE; ev.detail = XkbAXN_SKPress; ev.keycode = key; ev.slowKeysDelay = ctrls->slow_keys_delay; ev.debounceDelay = ctrls->debounce_delay; XkbSendAccessXNotify(keybd, &ev); if (XkbAX_NeedFeedback(ctrls, XkbAX_SKPressFBMask)) XkbDDXAccessXBeep(keybd, _BEEP_SLOW_PRESS, XkbSlowKeysMask); xkbi->slowKey = key; xkbi->slowKeysTimer = TimerSet(xkbi->slowKeysTimer, 0, ctrls->slow_keys_delay, AccessXSlowKeyExpire, (void *) keybd); ignoreKeyEvent = TRUE; } /* Don't transmit the KeyPress if BounceKeys is turned on * and the user pressed the same key within a given time period * from the last release. */ else if ((ctrls->enabled_ctrls & XkbBounceKeysMask) && (key == xkbi->inactiveKey)) { if (XkbAX_NeedFeedback(ctrls, XkbAX_BKRejectFBMask)) XkbDDXAccessXBeep(keybd, _BEEP_BOUNCE_REJECT, XkbBounceKeysMask); ignoreKeyEvent = TRUE; } /* Start repeating if necessary. Stop autorepeating if the user * presses a non-modifier key that doesn't autorepeat. */ if (XkbDDXUsesSoftRepeat(keybd)) { if ((keybd->kbdfeed->ctrl.autoRepeat) && ((ctrls->enabled_ctrls & (XkbSlowKeysMask | XkbRepeatKeysMask)) == XkbRepeatKeysMask)) { if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats, key)) { if (xkbDebugFlags & 0x10) DebugF("Starting software autorepeat...\n"); if (xkbi->repeatKey == key) ignoreKeyEvent = TRUE; else { xkbi->repeatKey = key; xkbi->repeatKeyTimer = TimerSet(xkbi->repeatKeyTimer, 0, ctrls->repeat_delay, AccessXRepeatKeyExpire, (void *) keybd); } } } } /* Check for two keys being pressed at the same time. This section * essentially says the following: * * If StickyKeys is on, and a modifier is currently being held down, * and one of the following is true: the current key is not a modifier * or the currentKey is a modifier, but not the only modifier being * held down, turn StickyKeys off if the TwoKeys off ctrl is set. */ if ((ctrls->enabled_ctrls & XkbStickyKeysMask) && (xkbi->state.base_mods != 0) && (XkbAX_NeedOption(ctrls, XkbAX_TwoKeysMask))) { xkbControlsNotify cn; cn.keycode = key; cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; AccessXStickyKeysTurnOff(keybd, &cn); } if (!ignoreKeyEvent) XkbProcessKeyboardEvent(event, keybd); return ignoreKeyEvent; } /* AccessXFilterPressEvent */ /************************************************************************/ /* */ /* AccessXFilterReleaseEvent */ /* */ /* Filter events before they get any further if SlowKeys is turned on. */ /* In addition, this routine handles the ever so popular magic key */ /* acts for turning various accessibility features on/off. */ /* */ /* Returns TRUE if this routine has discarded the event. */ /* Returns FALSE if the event needs further processing. */ /* */ /************************************************************************/ Bool AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) { XkbSrvInfoPtr xkbi = keybd->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; KeyCode key = event->detail.key; Bool ignoreKeyEvent = FALSE; /* Don't transmit the KeyRelease if BounceKeys is on and * this is the release of a key that was ignored due to * BounceKeys. */ if (ctrls->enabled_ctrls & XkbBounceKeysMask) { if ((key != xkbi->mouseKey) && (!BitIsOn(keybd->key->down, key))) ignoreKeyEvent = TRUE; xkbi->inactiveKey = key; xkbi->bounceKeysTimer = TimerSet(xkbi->bounceKeysTimer, 0, ctrls->debounce_delay, AccessXBounceKeyExpire, (void *) keybd); } /* Don't transmit the KeyRelease if SlowKeys is turned on and * the user didn't hold the key long enough. We know we passed * the key if the down bit was set by CoreProcessKeyboadEvent. */ if (ctrls->enabled_ctrls & XkbSlowKeysMask) { xkbAccessXNotify ev; unsigned beep_type; ev.keycode = key; ev.slowKeysDelay = ctrls->slow_keys_delay; ev.debounceDelay = ctrls->debounce_delay; if (BitIsOn(keybd->key->down, key) || (xkbi->mouseKey == key)) { ev.detail = XkbAXN_SKRelease; beep_type = _BEEP_SLOW_RELEASE; } else { ev.detail = XkbAXN_SKReject; beep_type = _BEEP_SLOW_REJECT; ignoreKeyEvent = TRUE; } XkbSendAccessXNotify(keybd, &ev); if (XkbAX_NeedFeedback(ctrls, XkbAX_SKRejectFBMask)) { XkbDDXAccessXBeep(keybd, beep_type, XkbSlowKeysMask); } if (xkbi->slowKey == key) xkbi->slowKey = 0; } /* Stop Repeating if the user releases the key that is currently * repeating. */ if (xkbi->repeatKey == key) { xkbi->repeatKey = 0; } if ((ctrls->enabled_ctrls & XkbAccessXTimeoutMask) && (ctrls->ax_timeout > 0)) { xkbi->lastPtrEventTime = 0; xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, ctrls->ax_timeout * 1000, AccessXTimeoutExpire, (void *) keybd); xkbi->krgTimerActive = _ALL_TIMEOUT_TIMER; } else if (xkbi->krgTimerActive != _OFF_TIMER) { xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 0, NULL, NULL); xkbi->krgTimerActive = _OFF_TIMER; } /* Keep track of how many times the Shift key has been pressed. * If it has been pressed and released 5 times in a row, toggle * the state of StickyKeys. */ if ((!ignoreKeyEvent) && (xkbi->shiftKeyCount)) { KeySym *pSym = XkbKeySymsPtr(xkbi->desc, key); if ((pSym[0] != XK_Shift_L) && (pSym[0] != XK_Shift_R)) { xkbi->shiftKeyCount = 0; } else if (xkbi->shiftKeyCount >= 5) { xkbControlsNotify cn; cn.keycode = key; cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; if (ctrls->enabled_ctrls & XkbStickyKeysMask) AccessXStickyKeysTurnOff(keybd, &cn); else AccessXStickyKeysTurnOn(keybd, &cn); xkbi->shiftKeyCount = 0; } } if (!ignoreKeyEvent) XkbProcessKeyboardEvent(event, keybd); return ignoreKeyEvent; } /* AccessXFilterReleaseEvent */ /************************************************************************/ /* */ /* ProcessPointerEvent */ /* */ /* This routine merely sets the shiftKeyCount and clears the keyboard */ /* response group timer (if necessary) on a mouse event. This is so */ /* multiple shifts with just the mouse and shift-drags with the mouse */ /* don't accidentally turn on StickyKeys or the Keyboard Response Group.*/ /* */ /************************************************************************/ extern int xkbDevicePrivateIndex; void ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse) { DeviceIntPtr dev; XkbSrvInfoPtr xkbi = NULL; unsigned changed = 0; ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse); DeviceEvent *event = &ev->device_event; dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD); if (dev && dev->key) { xkbi = dev->key->xkbInfo; xkbi->shiftKeyCount = 0; xkbi->lastPtrEventTime = event->time; } if (event->type == ET_ButtonPress) { changed |= XkbPointerButtonMask; } else if (event->type == ET_ButtonRelease) { 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; 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; } UNWRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, backupproc); mouse->public.processInputProc(ev, mouse); COND_WRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, backupproc, xkbUnwrapProc); if (!xkbi) return; xkbi->state.ptr_buttons = (mouse->button) ? mouse->button->state : 0; /* clear any latched modifiers */ if (xkbi->state.latched_mods && (event->type == ET_ButtonRelease)) { unsigned changed_leds; XkbStateRec oldState; XkbSrvLedInfoPtr sli; sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); oldState = xkbi->state; XkbLatchModifiers(dev, 0xFF, 0x00); XkbComputeDerivedState(xkbi); changed |= XkbStateChangedFlags(&oldState, &xkbi->state); if (changed & sli->usedComponents) { changed_leds = XkbIndicatorsToUpdate(dev, changed, FALSE); if (changed_leds) { XkbEventCauseRec cause; XkbSetCauseKey(&cause, (event->detail.key & 0x7), event->type); XkbUpdateIndicators(dev, changed_leds, TRUE, NULL, &cause); } } } if (((xkbi->flags & _XkbStateNotifyInProgress) == 0) && (changed != 0)) { xkbStateNotify sn; sn.keycode = event->detail.key; sn.eventType = event->type; sn.requestMajor = sn.requestMinor = 0; sn.changed = changed; XkbSendStateNotify(dev, &sn); } } /* ProcessPointerEvent */ xorg-server-1.17.1/xkb/xkbPrKeyEv.c0000664000175100017510000001523412456571574014020 00000000000000/************************************************************ Copyright (c) 1993 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 "misc.h" #include "inputstr.h" #include "exevents.h" #include "eventstr.h" #include #include #include "events.h" /***====================================================================***/ void XkbProcessKeyboardEvent(DeviceEvent *event, DeviceIntPtr keybd) { KeyClassPtr keyc = keybd->key; XkbSrvInfoPtr xkbi; int key; XkbBehavior behavior; unsigned ndx; xkbi = keyc->xkbInfo; key = event->detail.key; if (xkbDebugFlags & 0x8) DebugF("[xkb] XkbPKE: Key %d %s\n", key, (event->type == ET_KeyPress ? "down" : "up")); if (xkbi->repeatKey == key && event->type == ET_KeyRelease && !(xkbi->desc->ctrls->enabled_ctrls & XkbRepeatKeysMask)) AccessXCancelRepeatKey(xkbi, key); behavior = xkbi->desc->server->behaviors[key]; /* The "permanent" flag indicates a hard-wired behavior that occurs */ /* below XKB, such as a key that physically locks. XKB does not */ /* do anything to implement the behavior, but it *does* report that */ /* key is hardwired */ if (!(behavior.type & XkbKB_Permanent)) { switch (behavior.type) { case XkbKB_Default: /* Neither of these should happen in practice, but ignore them anyway. */ if (event->type == ET_KeyPress && !event->key_repeat && key_is_down(keybd, key, KEY_PROCESSED)) return; else if (event->type == ET_KeyRelease && !key_is_down(keybd, key, KEY_PROCESSED)) return; break; case XkbKB_Lock: if (event->type == ET_KeyRelease) return; else if (key_is_down(keybd, key, KEY_PROCESSED)) event->type = ET_KeyRelease; break; case XkbKB_RadioGroup: ndx = (behavior.data & (~XkbKB_RGAllowNone)); if (ndx < xkbi->nRadioGroups) { XkbRadioGroupPtr rg; if (event->type == ET_KeyRelease) return; rg = &xkbi->radioGroups[ndx]; if (rg->currentDown == event->detail.key) { if (behavior.data & XkbKB_RGAllowNone) { event->type = ET_KeyRelease; XkbHandleActions(keybd, keybd, event); rg->currentDown = 0; } return; } if (rg->currentDown != 0) { 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 = tmpkey; } rg->currentDown = key; } else ErrorF("[xkb] InternalError! Illegal radio group %d\n", ndx); break; case XkbKB_Overlay1: case XkbKB_Overlay2: { unsigned which; if (behavior.type == XkbKB_Overlay1) which = XkbOverlay1Mask; else which = XkbOverlay2Mask; if ((xkbi->desc->ctrls->enabled_ctrls & which) == 0) break; if ((behavior.data >= xkbi->desc->min_key_code) && (behavior.data <= xkbi->desc->max_key_code)) { event->detail.key = behavior.data; /* 9/11/94 (ef) -- XXX! need to match release with */ /* press even if the state of the */ /* corresponding overlay control */ /* changes while the key is down */ } } break; default: ErrorF("[xkb] unknown key behavior 0x%04x\n", behavior.type); break; } } XkbHandleActions(keybd, keybd, event); return; } void ProcessKeyboardEvent(InternalEvent *ev, DeviceIntPtr keybd) { KeyClassPtr keyc = keybd->key; XkbSrvInfoPtr xkbi = NULL; ProcessInputProc backup_proc; xkbDeviceInfoPtr xkb_priv = XKBDEVICEINFO(keybd); DeviceEvent *event = &ev->device_event; int is_press = (event->type == ET_KeyPress); int is_release = (event->type == ET_KeyRelease); /* We're only interested in key events. */ if (!is_press && !is_release) { UNWRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc); keybd->public.processInputProc(ev, keybd); COND_WRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc, xkbUnwrapProc); return; } xkbi = keyc->xkbInfo; /* If AccessX filters are active, then pass it through to * AccessXFilter{Press,Release}Event; else, punt to * XkbProcessKeyboardEvent. * * If AXF[PK]E don't intercept anything (which they probably won't), * they'll punt through XPKE anyway. */ if ((xkbi->desc->ctrls->enabled_ctrls & XkbAllFilteredEventsMask)) { if (is_press) AccessXFilterPressEvent(event, keybd); else if (is_release) AccessXFilterReleaseEvent(event, keybd); return; } else { XkbProcessKeyboardEvent(event, keybd); } return; } xorg-server-1.17.1/xkb/ddxVT.c0000664000175100017510000000310712456571574013013 00000000000000/************************************************************ Copyright (c) 1993 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 "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include int XkbDDXSwitchScreen(DeviceIntPtr dev, KeyCode key, XkbAction *act) { return 1; } xorg-server-1.17.1/record/0000775000175100017510000000000012466505444012361 500000000000000xorg-server-1.17.1/record/Makefile.am0000664000175100017510000000017012160102336014313 00000000000000noinst_LTLIBRARIES = librecord.la AM_CFLAGS = $(DIX_CFLAGS) librecord_la_SOURCES = record.c set.c EXTRA_DIST = set.h xorg-server-1.17.1/record/set.h0000664000175100017510000001272312274325512013243 00000000000000/* Copyright 1995, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* A Set Abstract Data Type (ADT) for the RECORD Extension David P. Wiggins 7/25/95 The RECORD extension server code needs to maintain sets of numbers that designate protocol message types. In most cases the interval of numbers starts at 0 and does not exceed 255, but in a few cases (minor opcodes of extension requests) the maximum is 65535. This disparity suggests that a single set representation may not be suitable for all sets, especially given that server memory is precious. We introduce a set ADT to hide implementation differences so that multiple simultaneous set representations can exist. A single interface is presented to the set user regardless of the implementation in use for a particular set. The existing RECORD SI appears to require only four set operations: create (given a list of members), destroy, see if a particular number is a member of the set, and iterate over the members of a set. Though many more set operations are imaginable, to keep the code space down, we won't provide any more operations than are needed. The following types and functions/macros define the ADT. */ /* an interval of set members */ typedef struct { CARD16 first; CARD16 last; } RecordSetInterval; typedef struct _RecordSetRec *RecordSetPtr; /* primary set type */ typedef void *RecordSetIteratePtr; /* table of function pointers for set operations. set users should never declare a variable of this type. */ typedef struct { void (*DestroySet) (RecordSetPtr pSet); unsigned long (*IsMemberOfSet) (RecordSetPtr pSet, int possible_member); RecordSetIteratePtr(*IterateSet) (RecordSetPtr pSet, RecordSetIteratePtr pIter, RecordSetInterval * interval); } RecordSetOperations; /* "base class" for sets. set users should never declare a variable of this type. */ typedef struct _RecordSetRec { RecordSetOperations *ops; } RecordSetRec; RecordSetPtr RecordCreateSet(RecordSetInterval * intervals, int nintervals, void *pMem, int memsize); /* RecordCreateSet creates and returns a new set having members specified by intervals and nintervals. nintervals is the number of RecordSetInterval structures pointed to by intervals. The elements belonging to the new set are determined as follows. For each RecordSetInterval structure, the elements between first and last inclusive are members of the new set. If a RecordSetInterval's first field is greater than its last field, the results are undefined. It is valid to create an empty set (nintervals == 0). If RecordCreateSet returns NULL, the set could not be created due to resource constraints. */ int RecordSetMemoryRequirements(RecordSetInterval * /*pIntervals */ , int /*nintervals */ , int * /*alignment */ ); #define RecordDestroySet(_pSet) \ /* void */ (*_pSet->ops->DestroySet)(/* RecordSetPtr */ _pSet) /* RecordDestroySet frees all resources used by _pSet. _pSet should not be used after it is destroyed. */ #define RecordIsMemberOfSet(_pSet, _m) \ /* unsigned long */ (*_pSet->ops->IsMemberOfSet)(/* RecordSetPtr */ _pSet, \ /* int */ _m) /* RecordIsMemberOfSet returns a non-zero value if _m is a member of _pSet, else it returns zero. */ #define RecordIterateSet(_pSet, _pIter, _interval) \ /* RecordSetIteratePtr */ (*_pSet->ops->IterateSet)(/* RecordSetPtr */ _pSet,\ /* RecordSetIteratePtr */ _pIter, /* RecordSetInterval */ _interval) /* RecordIterateSet returns successive intervals of members of _pSet. If _pIter is NULL, the first interval of set members is copied into _interval. The return value should be passed as _pIter in the next call to RecordIterateSet to obtain the next interval. When the return value is NULL, there were no more intervals in the set, and nothing is copied into the _interval parameter. Intervals appear in increasing numerical order with no overlap between intervals. As such, the list of intervals produced by RecordIterateSet may not match the list of intervals that were passed in RecordCreateSet. Typical usage: pIter = NULL; while (pIter = RecordIterateSet(pSet, pIter, &interval)) { process interval; } */ xorg-server-1.17.1/record/Makefile.in0000664000175100017510000006107512466505436014360 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = record DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) librecord_la_LIBADD = am_librecord_la_OBJECTS = record.lo set.lo librecord_la_OBJECTS = $(am_librecord_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 = $(librecord_la_SOURCES) DIST_SOURCES = $(librecord_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = librecord.la AM_CFLAGS = $(DIX_CFLAGS) librecord_la_SOURCES = record.c set.c EXTRA_DIST = set.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 record/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign record/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } librecord.la: $(librecord_la_OBJECTS) $(librecord_la_DEPENDENCIES) $(EXTRA_librecord_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(librecord_la_OBJECTS) $(librecord_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/record.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/record/set.c0000664000175100017510000003073212274325512013236 00000000000000/* Copyright 1995, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* See the header set.h for a description of the set ADT. Implementation Strategy A bit vector is an obvious choice to represent the set, but may take too much memory, depending on the numerically largest member in the set. One expected common case is for the client to ask for *all* protocol. This means it would ask for minor opcodes 0 through 65535. Representing this as a bit vector takes 8K -- and there may be multiple minor opcode intervals, as many as one per major (extension) opcode). In such cases, a list-of-intervals representation would be preferable to reduce memory consumption. Both representations will be implemented, and RecordCreateSet will decide heuristically which one to use based on the set members. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "misc.h" #include "set.h" static int maxMemberInInterval(RecordSetInterval * pIntervals, int nIntervals) { int i; int maxMember = -1; for (i = 0; i < nIntervals; i++) { if (maxMember < (int) pIntervals[i].last) maxMember = pIntervals[i].last; } return maxMember; } static void NoopDestroySet(RecordSetPtr pSet) { } /***************************************************************************/ /* set operations for bit vector representation */ typedef struct { RecordSetRec baseSet; int maxMember; /* followed by the bit vector itself */ } BitVectorSet, *BitVectorSetPtr; #define BITS_PER_LONG (sizeof(unsigned long) * 8) static void BitVectorDestroySet(RecordSetPtr pSet) { free(pSet); } static unsigned long BitVectorIsMemberOfSet(RecordSetPtr pSet, int pm) { BitVectorSetPtr pbvs = (BitVectorSetPtr) pSet; unsigned long *pbitvec; if ((int) pm > pbvs->maxMember) return FALSE; pbitvec = (unsigned long *) (&pbvs[1]); return (pbitvec[pm / BITS_PER_LONG] & ((unsigned long) 1 << (pm % BITS_PER_LONG))); } static int BitVectorFindBit(RecordSetPtr pSet, int iterbit, Bool bitval) { BitVectorSetPtr pbvs = (BitVectorSetPtr) pSet; unsigned long *pbitvec = (unsigned long *) (&pbvs[1]); int startlong; int startbit; int walkbit; int maxMember; unsigned long skipval; unsigned long bits; unsigned long usefulbits; startlong = iterbit / BITS_PER_LONG; pbitvec += startlong; startbit = startlong * BITS_PER_LONG; skipval = bitval ? 0L : ~0L; maxMember = pbvs->maxMember; if (startbit > maxMember) return -1; bits = *pbitvec; usefulbits = ~(((unsigned long) 1 << (iterbit - startbit)) - 1); if ((bits & usefulbits) == (skipval & usefulbits)) { pbitvec++; startbit += BITS_PER_LONG; while (startbit <= maxMember && *pbitvec == skipval) { pbitvec++; startbit += BITS_PER_LONG; } if (startbit > maxMember) return -1; } walkbit = (startbit < iterbit) ? iterbit - startbit : 0; bits = *pbitvec; while (walkbit < BITS_PER_LONG && ((!(bits & ((unsigned long) 1 << walkbit))) == bitval)) walkbit++; return startbit + walkbit; } static RecordSetIteratePtr BitVectorIterateSet(RecordSetPtr pSet, RecordSetIteratePtr pIter, RecordSetInterval * pInterval) { int iterbit = (int) (long) pIter; int b; b = BitVectorFindBit(pSet, iterbit, TRUE); if (b == -1) return (RecordSetIteratePtr) 0; pInterval->first = b; b = BitVectorFindBit(pSet, b, FALSE); pInterval->last = (b < 0) ? ((BitVectorSetPtr) pSet)->maxMember : b - 1; return (RecordSetIteratePtr) (long) (pInterval->last + 1); } static RecordSetOperations BitVectorSetOperations = { BitVectorDestroySet, BitVectorIsMemberOfSet, BitVectorIterateSet }; static RecordSetOperations BitVectorNoFreeOperations = { NoopDestroySet, BitVectorIsMemberOfSet, BitVectorIterateSet }; static int BitVectorSetMemoryRequirements(RecordSetInterval * pIntervals, int nIntervals, int maxMember, int *alignment) { int nlongs; *alignment = sizeof(unsigned long); nlongs = (maxMember + BITS_PER_LONG) / BITS_PER_LONG; return (sizeof(BitVectorSet) + nlongs * sizeof(unsigned long)); } static RecordSetPtr BitVectorCreateSet(RecordSetInterval * pIntervals, int nIntervals, void *pMem, int memsize) { BitVectorSetPtr pbvs; int i, j; unsigned long *pbitvec; /* allocate all storage needed by this set in one chunk */ if (pMem) { memset(pMem, 0, memsize); pbvs = (BitVectorSetPtr) pMem; pbvs->baseSet.ops = &BitVectorNoFreeOperations; } else { pbvs = (BitVectorSetPtr) calloc(1, memsize); if (!pbvs) return NULL; pbvs->baseSet.ops = &BitVectorSetOperations; } pbvs->maxMember = maxMemberInInterval(pIntervals, nIntervals); /* fill in the set */ pbitvec = (unsigned long *) (&pbvs[1]); for (i = 0; i < nIntervals; i++) { for (j = pIntervals[i].first; j <= (int) pIntervals[i].last; j++) { pbitvec[j / BITS_PER_LONG] |= ((unsigned long) 1 << (j % BITS_PER_LONG)); } } return (RecordSetPtr) pbvs; } /***************************************************************************/ /* set operations for interval list representation */ typedef struct { RecordSetRec baseSet; int nIntervals; /* followed by the intervals (RecordSetInterval) */ } IntervalListSet, *IntervalListSetPtr; static void IntervalListDestroySet(RecordSetPtr pSet) { free(pSet); } static unsigned long IntervalListIsMemberOfSet(RecordSetPtr pSet, int pm) { IntervalListSetPtr prls = (IntervalListSetPtr) pSet; RecordSetInterval *pInterval = (RecordSetInterval *) (&prls[1]); int hi, lo, probe; /* binary search */ lo = 0; hi = prls->nIntervals - 1; while (lo <= hi) { probe = (hi + lo) / 2; if (pm >= pInterval[probe].first && pm <= pInterval[probe].last) return 1; else if (pm < pInterval[probe].first) hi = probe - 1; else lo = probe + 1; } return 0; } static RecordSetIteratePtr IntervalListIterateSet(RecordSetPtr pSet, RecordSetIteratePtr pIter, RecordSetInterval * pIntervalReturn) { RecordSetInterval *pInterval = (RecordSetInterval *) pIter; IntervalListSetPtr prls = (IntervalListSetPtr) pSet; if (pInterval == NULL) { pInterval = (RecordSetInterval *) (&prls[1]); } if ((pInterval - (RecordSetInterval *) (&prls[1])) < prls->nIntervals) { *pIntervalReturn = *pInterval; return (RecordSetIteratePtr) (++pInterval); } else return (RecordSetIteratePtr) NULL; } static RecordSetOperations IntervalListSetOperations = { IntervalListDestroySet, IntervalListIsMemberOfSet, IntervalListIterateSet }; static RecordSetOperations IntervalListNoFreeOperations = { NoopDestroySet, IntervalListIsMemberOfSet, IntervalListIterateSet }; static int IntervalListMemoryRequirements(RecordSetInterval * pIntervals, int nIntervals, int maxMember, int *alignment) { *alignment = sizeof(unsigned long); return sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval); } static RecordSetPtr IntervalListCreateSet(RecordSetInterval * pIntervals, int nIntervals, void *pMem, int memsize) { IntervalListSetPtr prls; int i, j, k; RecordSetInterval *stackIntervals = NULL; CARD16 first; if (nIntervals > 0) { stackIntervals = (RecordSetInterval *) malloc(sizeof(RecordSetInterval) * nIntervals); if (!stackIntervals) return NULL; /* sort intervals, store in stackIntervals (insertion sort) */ for (i = 0; i < nIntervals; i++) { first = pIntervals[i].first; for (j = 0; j < i; j++) { if (first < stackIntervals[j].first) break; } for (k = i; k > j; k--) { stackIntervals[k] = stackIntervals[k - 1]; } stackIntervals[j] = pIntervals[i]; } /* merge abutting/overlapping intervals */ for (i = 0; i < nIntervals - 1;) { if ((stackIntervals[i].last + (unsigned int) 1) < stackIntervals[i + 1].first) { i++; /* disjoint intervals */ } else { stackIntervals[i].last = max(stackIntervals[i].last, stackIntervals[i + 1].last); nIntervals--; for (j = i + 1; j < nIntervals; j++) stackIntervals[j] = stackIntervals[j + 1]; } } } /* allocate and fill in set structure */ if (pMem) { prls = (IntervalListSetPtr) pMem; prls->baseSet.ops = &IntervalListNoFreeOperations; } else { prls = (IntervalListSetPtr) malloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval)); if (!prls) goto bailout; prls->baseSet.ops = &IntervalListSetOperations; } memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval)); prls->nIntervals = nIntervals; bailout: free(stackIntervals); return (RecordSetPtr) prls; } typedef RecordSetPtr(*RecordCreateSetProcPtr) (RecordSetInterval * pIntervals, int nIntervals, void *pMem, int memsize); static int _RecordSetMemoryRequirements(RecordSetInterval * pIntervals, int nIntervals, int *alignment, RecordCreateSetProcPtr * ppCreateSet) { int bmsize, rlsize, bma, rla; int maxMember; /* find maximum member of set so we know how big to make the bit vector */ maxMember = maxMemberInInterval(pIntervals, nIntervals); bmsize = BitVectorSetMemoryRequirements(pIntervals, nIntervals, maxMember, &bma); rlsize = IntervalListMemoryRequirements(pIntervals, nIntervals, maxMember, &rla); if (((nIntervals > 1) && (maxMember <= 255)) || (bmsize < rlsize)) { *alignment = bma; *ppCreateSet = BitVectorCreateSet; return bmsize; } else { *alignment = rla; *ppCreateSet = IntervalListCreateSet; return rlsize; } } /***************************************************************************/ /* user-visible functions */ int RecordSetMemoryRequirements(RecordSetInterval * pIntervals, int nIntervals, int *alignment) { RecordCreateSetProcPtr pCreateSet; return _RecordSetMemoryRequirements(pIntervals, nIntervals, alignment, &pCreateSet); } RecordSetPtr RecordCreateSet(RecordSetInterval * pIntervals, int nIntervals, void *pMem, int memsize) { RecordCreateSetProcPtr pCreateSet; int alignment; int size; size = _RecordSetMemoryRequirements(pIntervals, nIntervals, &alignment, &pCreateSet); if (pMem) { if (((long) pMem & (alignment - 1)) || memsize < size) return NULL; } return (*pCreateSet) (pIntervals, nIntervals, pMem, size); } xorg-server-1.17.1/record/record.c0000664000175100017510000030515712456571574013744 00000000000000 /* Copyright 1995, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Author: David P. Wiggins, The Open Group This work benefited from earlier work done by Martha Zimet of NCD and Jim Haggerty of Metheus. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "dixstruct.h" #include "extnsionst.h" #include "extinit.h" #include #include "set.h" #include "swaprep.h" #include "inputstr.h" #include "eventconvert.h" #include "scrnintstr.h" #include #include #ifdef PANORAMIX #include "globals.h" #include "panoramiX.h" #include "panoramiXsrv.h" #include "cursor.h" #endif #include "protocol-versions.h" static RESTYPE RTContext; /* internal resource type for Record contexts */ /* How many bytes of protocol data to buffer in a context. Don't set to less * than 32. */ #define REPLY_BUF_SIZE 1024 /* Record Context structure */ typedef struct { XID id; /* resource id of context */ ClientPtr pRecordingClient; /* client that has context enabled */ struct _RecordClientsAndProtocolRec *pListOfRCAP; /* all registered info */ ClientPtr pBufClient; /* client whose protocol is in replyBuffer */ unsigned int continuedReply:1; /* recording a reply that is split up? */ char elemHeaders; /* element header flags (time/seq no.) */ char bufCategory; /* category of protocol in replyBuffer */ int numBufBytes; /* number of bytes in replyBuffer */ char replyBuffer[REPLY_BUF_SIZE]; /* buffered recorded protocol */ int inFlush; /* are we inside RecordFlushReplyBuffer */ } RecordContextRec, *RecordContextPtr; /* RecordMinorOpRec - to hold minor opcode selections for extension requests * and replies */ typedef union { int count; /* first element of array: how many "major" structs to follow */ struct { /* rest of array elements are this */ short first; /* first major opcode */ short last; /* last major opcode */ RecordSetPtr pMinOpSet; /* minor opcode set for above major range */ } major; } RecordMinorOpRec, *RecordMinorOpPtr; /* RecordClientsAndProtocolRec, nicknamed RCAP - holds all the client and * protocol selections passed in a single CreateContext or RegisterClients. * Generally, a context will have one of these from the create and an * additional one for each RegisterClients. RCAPs are freed when all their * clients are unregistered. */ typedef struct _RecordClientsAndProtocolRec { RecordContextPtr pContext; /* context that owns this RCAP */ struct _RecordClientsAndProtocolRec *pNextRCAP; /* next RCAP on context */ RecordSetPtr pRequestMajorOpSet; /* requests to record */ RecordMinorOpPtr pRequestMinOpInfo; /* extension requests to record */ RecordSetPtr pReplyMajorOpSet; /* replies to record */ RecordMinorOpPtr pReplyMinOpInfo; /* extension replies to record */ RecordSetPtr pDeviceEventSet; /* device events to record */ RecordSetPtr pDeliveredEventSet; /* delivered events to record */ RecordSetPtr pErrorSet; /* errors to record */ XID *pClientIDs; /* array of clients to record */ short numClients; /* number of clients in pClientIDs */ short sizeClients; /* size of pClientIDs array */ unsigned int clientStarted:1; /* record new client connections? */ unsigned int clientDied:1; /* record client disconnections? */ unsigned int clientIDsSeparatelyAllocated:1; /* pClientIDs malloced? */ } RecordClientsAndProtocolRec, *RecordClientsAndProtocolPtr; /* how much bigger to make pRCAP->pClientIDs when reallocing */ #define CLIENT_ARRAY_GROWTH_INCREMENT 4 /* counts the total number of RCAPs belonging to enabled contexts. */ static int numEnabledRCAPs; /* void VERIFY_CONTEXT(RecordContextPtr, XID, ClientPtr) * In the spirit of the VERIFY_* macros in dix.h, this macro fills in * the context pointer if the given ID is a valid Record Context, else it * returns an error. */ #define VERIFY_CONTEXT(_pContext, _contextid, _client) { \ int rc = dixLookupResourceByType((void **)&(_pContext), _contextid, \ RTContext, _client, DixUseAccess); \ if (rc != Success) \ return rc; \ } static int RecordDeleteContext(void *value, XID id); /***************************************************************************/ /* client private stuff */ /* To make declarations less obfuscated, have a typedef for a pointer to a * Proc function. */ typedef int (*ProcFunctionPtr) (ClientPtr /*pClient */ ); /* Record client private. Generally a client only has one of these if * any of its requests are being recorded. */ typedef struct { /* ptr to client's proc vector before Record stuck its nose in */ ProcFunctionPtr *originalVector; /* proc vector with pointers for recorded requests redirected to the * function RecordARequest */ ProcFunctionPtr recordVector[256]; } RecordClientPrivateRec, *RecordClientPrivatePtr; static DevPrivateKeyRec RecordClientPrivateKeyRec; #define RecordClientPrivateKey (&RecordClientPrivateKeyRec) /* RecordClientPrivatePtr RecordClientPrivate(ClientPtr) * gets the client private of the given client. Syntactic sugar. */ #define RecordClientPrivate(_pClient) (RecordClientPrivatePtr) \ dixLookupPrivate(&(_pClient)->devPrivates, RecordClientPrivateKey) /***************************************************************************/ /* global list of all contexts */ static RecordContextPtr *ppAllContexts; static int numContexts; /* number of contexts in ppAllContexts */ /* number of currently enabled contexts. All enabled contexts are bunched * up at the front of the ppAllContexts array, from ppAllContexts[0] to * ppAllContexts[numEnabledContexts-1], to eliminate time spent skipping * past disabled contexts. */ static int numEnabledContexts; /* RecordFindContextOnAllContexts * * Arguments: * pContext is the context to search for. * * Returns: * The index into the array ppAllContexts at which pContext is stored. * If pContext is not found in ppAllContexts, returns -1. * * Side Effects: none. */ static int RecordFindContextOnAllContexts(RecordContextPtr pContext) { int i; assert(numContexts >= numEnabledContexts); for (i = 0; i < numContexts; i++) { if (ppAllContexts[i] == pContext) return i; } return -1; } /* RecordFindContextOnAllContexts */ /***************************************************************************/ /* RecordFlushReplyBuffer * * Arguments: * pContext is the context to flush. * data1 is a pointer to additional data, and len1 is its length in bytes. * data2 is a pointer to additional data, and len2 is its length in bytes. * * Returns: nothing. * * Side Effects: * If the context is enabled, any buffered (recorded) protocol is written * to the recording client, and the number of buffered bytes is set to * zero. If len1 is not zero, data1/len1 are then written to the * recording client, and similarly for data2/len2 (written after * data1/len1). */ static void RecordFlushReplyBuffer(RecordContextPtr pContext, void *data1, int len1, void *data2, int len2) { if (!pContext->pRecordingClient || pContext->pRecordingClient->clientGone || pContext->inFlush) return; ++pContext->inFlush; if (pContext->numBufBytes) WriteToClient(pContext->pRecordingClient, pContext->numBufBytes, pContext->replyBuffer); pContext->numBufBytes = 0; if (len1) WriteToClient(pContext->pRecordingClient, len1, data1); if (len2) WriteToClient(pContext->pRecordingClient, len2, data2); --pContext->inFlush; } /* RecordFlushReplyBuffer */ /* RecordAProtocolElement * * Arguments: * pContext is the context that is recording a protocol element. * pClient is the client whose protocol is being recorded. For * device events and EndOfData, pClient is NULL. * category is the category of the protocol element, as defined * by the RECORD spec. * data is a pointer to the protocol data, and datalen - padlen * is its length in bytes. * padlen is the number of pad bytes from a zeroed array. * futurelen is the number of bytes that will be sent in subsequent * calls to this function to complete this protocol element. * In those subsequent calls, futurelen will be -1 to indicate * that the current data is a continuation of the same protocol * element. * * Returns: nothing. * * Side Effects: * The context may be flushed. The new protocol element will be * added to the context's protocol buffer with appropriate element * headers prepended (sequence number and timestamp). If the data * is continuation data (futurelen == -1), element headers won't * be added. If the protocol element and headers won't fit in * the context's buffer, it is sent directly to the recording * client (after any buffered data). */ static void RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, int category, void *data, int datalen, int padlen, int futurelen) { CARD32 elemHeaderData[2]; int numElemHeaders = 0; Bool recordingClientSwapped = pContext->pRecordingClient->swapped; CARD32 serverTime = 0; Bool gotServerTime = FALSE; int replylen; if (futurelen >= 0) { /* start of new protocol element */ xRecordEnableContextReply *pRep = (xRecordEnableContextReply *) pContext->replyBuffer; if (pContext->pBufClient != pClient || pContext->bufCategory != category) { RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0); pContext->pBufClient = pClient; pContext->bufCategory = category; } if (!pContext->numBufBytes) { serverTime = GetTimeInMillis(); gotServerTime = TRUE; pRep->type = X_Reply; pRep->category = category; pRep->sequenceNumber = pContext->pRecordingClient->sequence; pRep->length = 0; pRep->elementHeader = pContext->elemHeaders; pRep->serverTime = serverTime; if (pClient) { pRep->clientSwapped = (pClient->swapped != recordingClientSwapped); pRep->idBase = pClient->clientAsMask; pRep->recordedSequenceNumber = pClient->sequence; } else { /* it's a device event, StartOfData, or EndOfData */ pRep->clientSwapped = (category != XRecordFromServer) && recordingClientSwapped; pRep->idBase = 0; pRep->recordedSequenceNumber = 0; } if (recordingClientSwapped) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->idBase); swapl(&pRep->serverTime); swapl(&pRep->recordedSequenceNumber); } pContext->numBufBytes = SIZEOF(xRecordEnableContextReply); } /* generate element headers if needed */ if (((pContext->elemHeaders & XRecordFromClientTime) && category == XRecordFromClient) || ((pContext->elemHeaders & XRecordFromServerTime) && category == XRecordFromServer)) { if (gotServerTime) elemHeaderData[numElemHeaders] = serverTime; else elemHeaderData[numElemHeaders] = GetTimeInMillis(); if (recordingClientSwapped) swapl(&elemHeaderData[numElemHeaders]); numElemHeaders++; } if ((pContext->elemHeaders & XRecordFromClientSequence) && (category == XRecordFromClient || category == XRecordClientDied)) { elemHeaderData[numElemHeaders] = pClient->sequence; if (recordingClientSwapped) swapl(&elemHeaderData[numElemHeaders]); numElemHeaders++; } /* adjust reply length */ replylen = pRep->length; if (recordingClientSwapped) swapl(&replylen); replylen += numElemHeaders + bytes_to_int32(datalen) + bytes_to_int32(futurelen); if (recordingClientSwapped) swapl(&replylen); pRep->length = replylen; } /* end if not continued reply */ numElemHeaders *= 4; /* if space available >= space needed, buffer the data */ if (REPLY_BUF_SIZE - pContext->numBufBytes >= datalen + numElemHeaders) { if (numElemHeaders) { memcpy(pContext->replyBuffer + pContext->numBufBytes, elemHeaderData, numElemHeaders); pContext->numBufBytes += numElemHeaders; } if (datalen) { static char padBuffer[3]; /* as in FlushClient */ memcpy(pContext->replyBuffer + pContext->numBufBytes, data, datalen - padlen); pContext->numBufBytes += datalen - padlen; memcpy(pContext->replyBuffer + pContext->numBufBytes, padBuffer, padlen); pContext->numBufBytes += padlen; } } else { RecordFlushReplyBuffer(pContext, (void *) elemHeaderData, numElemHeaders, (void *) data, datalen - padlen); } } /* RecordAProtocolElement */ /* RecordFindClientOnContext * * Arguments: * pContext is the context to search. * clientspec is the resource ID mask identifying the client to search * for, or XRecordFutureClients. * pposition is a pointer to an int, or NULL. See Returns. * * Returns: * The RCAP on which clientspec was found, or NULL if not found on * any RCAP on the given context. * If pposition was not NULL and the returned RCAP is not NULL, * *pposition will be set to the index into the returned the RCAP's * pClientIDs array that holds clientspec. * * Side Effects: none. */ static RecordClientsAndProtocolPtr RecordFindClientOnContext(RecordContextPtr pContext, XID clientspec, int *pposition) { RecordClientsAndProtocolPtr pRCAP; for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP) { int i; for (i = 0; i < pRCAP->numClients; i++) { if (pRCAP->pClientIDs[i] == clientspec) { if (pposition) *pposition = i; return pRCAP; } } } return NULL; } /* RecordFindClientOnContext */ /* RecordABigRequest * * Arguments: * pContext is the recording context. * client is the client being recorded. * stuff is a pointer to the big request of client (see the Big Requests * extension for details.) * * Returns: nothing. * * Side Effects: * The big request is recorded with the correct length field re-inserted. * * Note: this function exists mainly to make RecordARequest smaller. */ static void RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq * stuff) { CARD32 bigLength; int bytesLeft; /* note: client->req_len has been frobbed by ReadRequestFromClient * (os/io.c) to discount the extra 4 bytes taken by the extended length * field in a big request. The actual request length to record is * client->req_len + 1 (measured in CARD32s). */ /* record the request header */ bytesLeft = client->req_len << 2; RecordAProtocolElement(pContext, client, XRecordFromClient, (void *) stuff, SIZEOF(xReq), 0, bytesLeft); /* reinsert the extended length field that was squished out */ bigLength = client->req_len + bytes_to_int32(sizeof(bigLength)); if (client->swapped) swapl(&bigLength); RecordAProtocolElement(pContext, client, XRecordFromClient, (void *) &bigLength, sizeof(bigLength), 0, /* continuation */ -1); bytesLeft -= sizeof(bigLength); /* record the rest of the request after the length */ RecordAProtocolElement(pContext, client, XRecordFromClient, (void *) (stuff + 1), bytesLeft, 0, /* continuation */ -1); } /* RecordABigRequest */ /* RecordARequest * * Arguments: * client is a client that the server has dispatched a request to by * calling client->requestVector[request opcode] . * The request is in client->requestBuffer. * * Returns: * Whatever is returned by the "real" Proc function for this request. * The "real" Proc function is the function that was in * client->requestVector[request opcode] before it was replaced by * RecordARequest. (See the function RecordInstallHooks.) * * Side Effects: * The request is recorded by all contexts that have registered this * request for this client. The real Proc function is called. */ static int RecordARequest(ClientPtr client) { RecordContextPtr pContext; RecordClientsAndProtocolPtr pRCAP; int i; RecordClientPrivatePtr pClientPriv; REQUEST(xReq); int majorop; majorop = stuff->reqType; for (i = 0; i < numEnabledContexts; i++) { pContext = ppAllContexts[i]; pRCAP = RecordFindClientOnContext(pContext, client->clientAsMask, NULL); if (pRCAP && pRCAP->pRequestMajorOpSet && RecordIsMemberOfSet(pRCAP->pRequestMajorOpSet, majorop)) { if (majorop <= 127) { /* core request */ if (stuff->length == 0) RecordABigRequest(pContext, client, stuff); else RecordAProtocolElement(pContext, client, XRecordFromClient, (void *) stuff, client->req_len << 2, 0, 0); } else { /* extension, check minor opcode */ int minorop = client->minorOp; int numMinOpInfo; RecordMinorOpPtr pMinorOpInfo = pRCAP->pRequestMinOpInfo; assert(pMinorOpInfo); numMinOpInfo = pMinorOpInfo->count; pMinorOpInfo++; assert(numMinOpInfo); for (; numMinOpInfo; numMinOpInfo--, pMinorOpInfo++) { if (majorop >= pMinorOpInfo->major.first && majorop <= pMinorOpInfo->major.last && RecordIsMemberOfSet(pMinorOpInfo->major.pMinOpSet, minorop)) { if (stuff->length == 0) RecordABigRequest(pContext, client, stuff); else RecordAProtocolElement(pContext, client, XRecordFromClient, (void *) stuff, client->req_len << 2, 0, 0); break; } } /* end for each minor op info */ } /* end extension request */ } /* end this RCAP wants this major opcode */ } /* end for each context */ pClientPriv = RecordClientPrivate(client); assert(pClientPriv); return (*pClientPriv->originalVector[majorop]) (client); } /* RecordARequest */ /* RecordAReply * * Arguments: * pcbl is &ReplyCallback. * nulldata is NULL. * calldata is a pointer to a ReplyInfoRec (include/os.h) * which provides information about replies that are being sent * to clients. * * Returns: nothing. * * Side Effects: * The reply is recorded by all contexts that have registered this * reply type for this client. If more data belonging to the same * reply is expected, and if the reply is being recorded by any * context, pContext->continuedReply is set to 1. * If pContext->continuedReply was already 1 and this is the last * chunk of data belonging to this reply, it is set to 0. */ static void RecordAReply(CallbackListPtr *pcbl, void *nulldata, void *calldata) { RecordContextPtr pContext; RecordClientsAndProtocolPtr pRCAP; int eci; ReplyInfoRec *pri = (ReplyInfoRec *) calldata; ClientPtr client = pri->client; for (eci = 0; eci < numEnabledContexts; eci++) { pContext = ppAllContexts[eci]; pRCAP = RecordFindClientOnContext(pContext, client->clientAsMask, NULL); if (pRCAP) { int majorop = client->majorOp; if (pContext->continuedReply) { RecordAProtocolElement(pContext, client, XRecordFromServer, (void *) pri->replyData, pri->dataLenBytes, pri->padBytes, /* continuation */ -1); if (!pri->bytesRemaining) pContext->continuedReply = 0; } else if (pri->startOfReply && pRCAP->pReplyMajorOpSet && RecordIsMemberOfSet(pRCAP->pReplyMajorOpSet, majorop)) { if (majorop <= 127) { /* core reply */ RecordAProtocolElement(pContext, client, XRecordFromServer, (void *) pri->replyData, pri->dataLenBytes, 0, pri->bytesRemaining); if (pri->bytesRemaining) pContext->continuedReply = 1; } else { /* extension, check minor opcode */ int minorop = client->minorOp; int numMinOpInfo; RecordMinorOpPtr pMinorOpInfo = pRCAP->pReplyMinOpInfo; assert(pMinorOpInfo); numMinOpInfo = pMinorOpInfo->count; pMinorOpInfo++; assert(numMinOpInfo); for (; numMinOpInfo; numMinOpInfo--, pMinorOpInfo++) { if (majorop >= pMinorOpInfo->major.first && majorop <= pMinorOpInfo->major.last && RecordIsMemberOfSet(pMinorOpInfo->major.pMinOpSet, minorop)) { RecordAProtocolElement(pContext, client, XRecordFromServer, (void *) pri->replyData, pri->dataLenBytes, 0, pri->bytesRemaining); if (pri->bytesRemaining) pContext->continuedReply = 1; break; } } /* end for each minor op info */ } /* end extension reply */ } /* end continued reply vs. start of reply */ } /* end client is registered on this context */ } /* end for each context */ } /* RecordAReply */ /* RecordADeliveredEventOrError * * Arguments: * pcbl is &EventCallback. * nulldata is NULL. * calldata is a pointer to a EventInfoRec (include/dix.h) * which provides information about events that are being sent * to clients. * * Returns: nothing. * * Side Effects: * The event or error is recorded by all contexts that have registered * it for this client. */ static void RecordADeliveredEventOrError(CallbackListPtr *pcbl, void *nulldata, void *calldata) { EventInfoRec *pei = (EventInfoRec *) calldata; RecordContextPtr pContext; RecordClientsAndProtocolPtr pRCAP; int eci; /* enabled context index */ ClientPtr pClient = pei->client; for (eci = 0; eci < numEnabledContexts; eci++) { pContext = ppAllContexts[eci]; pRCAP = RecordFindClientOnContext(pContext, pClient->clientAsMask, NULL); if (pRCAP && (pRCAP->pDeliveredEventSet || pRCAP->pErrorSet)) { int ev; /* event index */ xEvent *pev = pei->events; for (ev = 0; ev < pei->count; ev++, pev++) { int recordit = 0; if (pRCAP->pErrorSet) { recordit = RecordIsMemberOfSet(pRCAP->pErrorSet, ((xError *) (pev))-> errorCode); } else if (pRCAP->pDeliveredEventSet) { recordit = RecordIsMemberOfSet(pRCAP->pDeliveredEventSet, pev->u.u.type & 0177); } if (recordit) { xEvent swappedEvent; xEvent *pEvToRecord = pev; if (pClient->swapped) { (*EventSwapVector[pev->u.u.type & 0177]) (pev, &swappedEvent); pEvToRecord = &swappedEvent; } RecordAProtocolElement(pContext, pClient, XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0, 0); } } /* end for each event */ } /* end this client is on this context */ } /* end for each enabled context */ } /* RecordADeliveredEventOrError */ static void RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP, RecordContextPtr pContext, xEvent *pev, int count) { int ev; /* event index */ for (ev = 0; ev < count; ev++, pev++) { if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet, pev->u.u.type & 0177)) { xEvent swappedEvent; xEvent *pEvToRecord = pev; #ifdef PANORAMIX xEvent shiftedEvent; if (!noPanoramiXExtension && (pev->u.u.type == MotionNotify || pev->u.u.type == ButtonPress || pev->u.u.type == ButtonRelease || pev->u.u.type == KeyPress || pev->u.u.type == KeyRelease)) { int scr = XineramaGetCursorScreen(inputInfo.pointer); memcpy(&shiftedEvent, pev, sizeof(xEvent)); shiftedEvent.u.keyButtonPointer.rootX += screenInfo.screens[scr]->x - screenInfo.screens[0]->x; shiftedEvent.u.keyButtonPointer.rootY += screenInfo.screens[scr]->y - screenInfo.screens[0]->y; pEvToRecord = &shiftedEvent; } #endif /* PANORAMIX */ if (pContext->pRecordingClient->swapped) { (*EventSwapVector[pEvToRecord->u.u.type & 0177]) (pEvToRecord, &swappedEvent); pEvToRecord = &swappedEvent; } RecordAProtocolElement(pContext, NULL, XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0, 0); /* make sure device events get flushed in the absence * of other client activity */ SetCriticalOutputPending(); } } /* end for each event */ } /* RecordADeviceEvent */ /* RecordADeviceEvent * * Arguments: * pcbl is &DeviceEventCallback. * nulldata is NULL. * calldata is a pointer to a DeviceEventInfoRec (include/dix.h) * which provides information about device events that occur. * * Returns: nothing. * * Side Effects: * The device event is recorded by all contexts that have registered * it for this client. */ static void RecordADeviceEvent(CallbackListPtr *pcbl, void *nulldata, void *calldata) { DeviceEventInfoRec *pei = (DeviceEventInfoRec *) calldata; RecordContextPtr pContext; RecordClientsAndProtocolPtr pRCAP; int eci; /* enabled context index */ for (eci = 0; eci < numEnabledContexts; eci++) { pContext = ppAllContexts[eci]; for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP) { if (pRCAP->pDeviceEventSet) { int count; xEvent *xi_events = NULL; /* TODO check return values */ if (IsMaster(pei->device)) { xEvent *core_events; EventToCore(pei->event, &core_events, &count); RecordSendProtocolEvents(pRCAP, pContext, core_events, count); free(core_events); } EventToXI(pei->event, &xi_events, &count); RecordSendProtocolEvents(pRCAP, pContext, xi_events, count); free(xi_events); } /* end this RCAP selects device events */ } /* end for each RCAP on this context */ } /* end for each enabled context */ } /* RecordFlushAllContexts * * Arguments: * pcbl is &FlushCallback. * nulldata and calldata are NULL. * * Returns: nothing. * * Side Effects: * All buffered reply data of all enabled contexts is written to * the recording clients. */ static void RecordFlushAllContexts(CallbackListPtr *pcbl, void *nulldata, void *calldata) { int eci; /* enabled context index */ RecordContextPtr pContext; for (eci = 0; eci < numEnabledContexts; eci++) { pContext = ppAllContexts[eci]; /* In most cases we leave it to RecordFlushReplyBuffer to make * this check, but this function could be called very often, so we * check before calling hoping to save the function call cost * most of the time. */ if (pContext->numBufBytes) RecordFlushReplyBuffer(ppAllContexts[eci], NULL, 0, NULL, 0); } } /* RecordFlushAllContexts */ /* RecordInstallHooks * * Arguments: * pRCAP is an RCAP on an enabled or being-enabled context. * oneclient can be zero or the resource ID mask identifying a client. * * Returns: BadAlloc if a memory allocation error occurred, else Success. * * Side Effects: * Recording hooks needed by RCAP are installed. * If oneclient is zero, recording hooks needed for all clients and * protocol on the RCAP are installed. If oneclient is non-zero, * only those hooks needed for the specified client are installed. * * Client requestVectors may be altered. numEnabledRCAPs will be * incremented if oneclient == 0. Callbacks may be added to * various callback lists. */ static int RecordInstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient) { int i = 0; XID client; if (oneclient) client = oneclient; else client = pRCAP->numClients ? pRCAP->pClientIDs[i++] : 0; while (client) { if (client != XRecordFutureClients) { if (pRCAP->pRequestMajorOpSet) { RecordSetIteratePtr pIter = NULL; RecordSetInterval interval; ClientPtr pClient = clients[CLIENT_ID(client)]; if (pClient && !RecordClientPrivate(pClient)) { RecordClientPrivatePtr pClientPriv; /* no Record proc vector; allocate one */ pClientPriv = (RecordClientPrivatePtr) malloc(sizeof(RecordClientPrivateRec)); if (!pClientPriv) return BadAlloc; /* copy old proc vector to new */ memcpy(pClientPriv->recordVector, pClient->requestVector, sizeof(pClientPriv->recordVector)); pClientPriv->originalVector = pClient->requestVector; dixSetPrivate(&pClient->devPrivates, RecordClientPrivateKey, pClientPriv); pClient->requestVector = pClientPriv->recordVector; } while ((pIter = RecordIterateSet(pRCAP->pRequestMajorOpSet, pIter, &interval))) { unsigned int j; for (j = interval.first; j <= interval.last; j++) pClient->requestVector[j] = RecordARequest; } } } if (oneclient) client = 0; else client = (i < pRCAP->numClients) ? pRCAP->pClientIDs[i++] : 0; } assert(numEnabledRCAPs >= 0); if (!oneclient && ++numEnabledRCAPs == 1) { /* we're enabling the first context */ if (!AddCallback(&EventCallback, RecordADeliveredEventOrError, NULL)) return BadAlloc; if (!AddCallback(&DeviceEventCallback, RecordADeviceEvent, NULL)) return BadAlloc; if (!AddCallback(&ReplyCallback, RecordAReply, NULL)) return BadAlloc; if (!AddCallback(&FlushCallback, RecordFlushAllContexts, NULL)) return BadAlloc; /* Alternate context flushing scheme: delete the line above * and call RegisterBlockAndWakeupHandlers here passing * RecordFlushAllContexts. Is this any better? */ } return Success; } /* RecordInstallHooks */ /* RecordUninstallHooks * * Arguments: * pRCAP is an RCAP on an enabled or being-disabled context. * oneclient can be zero or the resource ID mask identifying a client. * * Returns: nothing. * * Side Effects: * Recording hooks needed by RCAP may be uninstalled. * If oneclient is zero, recording hooks needed for all clients and * protocol on the RCAP may be uninstalled. If oneclient is non-zero, * only those hooks needed for the specified client may be uninstalled. * * Client requestVectors may be altered. numEnabledRCAPs will be * decremented if oneclient == 0. Callbacks may be deleted from * various callback lists. */ static void RecordUninstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient) { int i = 0; XID client; if (oneclient) client = oneclient; else client = pRCAP->numClients ? pRCAP->pClientIDs[i++] : 0; while (client) { if (client != XRecordFutureClients) { if (pRCAP->pRequestMajorOpSet) { ClientPtr pClient = clients[CLIENT_ID(client)]; int c; Bool otherRCAPwantsProcVector = FALSE; RecordClientPrivatePtr pClientPriv = NULL; assert(pClient); pClientPriv = RecordClientPrivate(pClient); assert(pClientPriv); memcpy(pClientPriv->recordVector, pClientPriv->originalVector, sizeof(pClientPriv->recordVector)); for (c = 0; c < numEnabledContexts; c++) { RecordClientsAndProtocolPtr pOtherRCAP; RecordContextPtr pContext = ppAllContexts[c]; if (pContext == pRCAP->pContext) continue; pOtherRCAP = RecordFindClientOnContext(pContext, client, NULL); if (pOtherRCAP && pOtherRCAP->pRequestMajorOpSet) { RecordSetIteratePtr pIter = NULL; RecordSetInterval interval; otherRCAPwantsProcVector = TRUE; while ((pIter = RecordIterateSet(pOtherRCAP->pRequestMajorOpSet, pIter, &interval))) { unsigned int j; for (j = interval.first; j <= interval.last; j++) pClient->requestVector[j] = RecordARequest; } } } if (!otherRCAPwantsProcVector) { /* nobody needs it, so free it */ pClient->requestVector = pClientPriv->originalVector; dixSetPrivate(&pClient->devPrivates, RecordClientPrivateKey, NULL); free(pClientPriv); } } /* end if this RCAP specifies any requests */ } /* end if not future clients */ if (oneclient) client = 0; else client = (i < pRCAP->numClients) ? pRCAP->pClientIDs[i++] : 0; } assert(numEnabledRCAPs >= 1); if (!oneclient && --numEnabledRCAPs == 0) { /* we're disabling the last context */ DeleteCallback(&EventCallback, RecordADeliveredEventOrError, NULL); DeleteCallback(&DeviceEventCallback, RecordADeviceEvent, NULL); DeleteCallback(&ReplyCallback, RecordAReply, NULL); DeleteCallback(&FlushCallback, RecordFlushAllContexts, NULL); /* Alternate context flushing scheme: delete the line above * and call RemoveBlockAndWakeupHandlers here passing * RecordFlushAllContexts. Is this any better? */ /* Having deleted the callback, call it one last time. -gildea */ RecordFlushAllContexts(&FlushCallback, NULL, NULL); } } /* RecordUninstallHooks */ /* RecordDeleteClientFromRCAP * * Arguments: * pRCAP is an RCAP to delete the client from. * position is the index into the array pRCAP->pClientIDs of the * client to delete. * * Returns: nothing. * * Side Effects: * Recording hooks needed by client will be uninstalled if the context * is enabled. The designated client will be removed from the * pRCAP->pClientIDs array. If it was the only client on the RCAP, * the RCAP is removed from the context and freed. (Invariant: RCAPs * have at least one client.) */ static void RecordDeleteClientFromRCAP(RecordClientsAndProtocolPtr pRCAP, int position) { if (pRCAP->pContext->pRecordingClient) RecordUninstallHooks(pRCAP, pRCAP->pClientIDs[position]); if (position != pRCAP->numClients - 1) pRCAP->pClientIDs[position] = pRCAP->pClientIDs[pRCAP->numClients - 1]; if (--pRCAP->numClients == 0) { /* no more clients; remove RCAP from context's list */ RecordContextPtr pContext = pRCAP->pContext; if (pContext->pRecordingClient) RecordUninstallHooks(pRCAP, 0); if (pContext->pListOfRCAP == pRCAP) pContext->pListOfRCAP = pRCAP->pNextRCAP; else { RecordClientsAndProtocolPtr prevRCAP; for (prevRCAP = pContext->pListOfRCAP; prevRCAP->pNextRCAP != pRCAP; prevRCAP = prevRCAP->pNextRCAP); prevRCAP->pNextRCAP = pRCAP->pNextRCAP; } /* free the RCAP */ if (pRCAP->clientIDsSeparatelyAllocated) free(pRCAP->pClientIDs); free(pRCAP); } } /* RecordDeleteClientFromRCAP */ /* RecordAddClientToRCAP * * Arguments: * pRCAP is an RCAP to add the client to. * clientspec is the resource ID mask identifying a client, or * XRecordFutureClients. * * Returns: nothing. * * Side Effects: * Recording hooks needed by client will be installed if the context * is enabled. The designated client will be added to the * pRCAP->pClientIDs array, which may be realloced. * pRCAP->clientIDsSeparatelyAllocated may be set to 1 if there * is no more room to hold clients internal to the RCAP. */ static void RecordAddClientToRCAP(RecordClientsAndProtocolPtr pRCAP, XID clientspec) { if (pRCAP->numClients == pRCAP->sizeClients) { if (pRCAP->clientIDsSeparatelyAllocated) { XID *pNewIDs = (XID *) realloc(pRCAP->pClientIDs, (pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT) * sizeof(XID)); if (!pNewIDs) return; pRCAP->pClientIDs = pNewIDs; pRCAP->sizeClients += CLIENT_ARRAY_GROWTH_INCREMENT; } else { XID *pNewIDs = (XID *) malloc((pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT) * sizeof(XID)); if (!pNewIDs) return; memcpy(pNewIDs, pRCAP->pClientIDs, pRCAP->numClients * sizeof(XID)); pRCAP->pClientIDs = pNewIDs; pRCAP->sizeClients += CLIENT_ARRAY_GROWTH_INCREMENT; pRCAP->clientIDsSeparatelyAllocated = 1; } } pRCAP->pClientIDs[pRCAP->numClients++] = clientspec; if (pRCAP->pContext->pRecordingClient) RecordInstallHooks(pRCAP, clientspec); } /* RecordDeleteClientFromRCAP */ /* RecordDeleteClientFromContext * * Arguments: * pContext is the context to delete from. * clientspec is the resource ID mask identifying a client, or * XRecordFutureClients. * * Returns: nothing. * * Side Effects: * If clientspec is on any RCAP of the context, it is deleted from that * RCAP. (A given clientspec can only be on one RCAP of a context.) */ static void RecordDeleteClientFromContext(RecordContextPtr pContext, XID clientspec) { RecordClientsAndProtocolPtr pRCAP; int position; if ((pRCAP = RecordFindClientOnContext(pContext, clientspec, &position))) RecordDeleteClientFromRCAP(pRCAP, position); } /* RecordDeleteClientFromContext */ /* RecordSanityCheckClientSpecifiers * * Arguments: * clientspecs is an array of alleged CLIENTSPECs passed by the client. * nspecs is the number of elements in clientspecs. * errorspec, if non-zero, is the resource id base of a client that * must not appear in clienspecs. * * Returns: BadMatch if any of the clientspecs are invalid, else Success. * * Side Effects: none. */ static int RecordSanityCheckClientSpecifiers(ClientPtr client, XID *clientspecs, int nspecs, XID errorspec) { int i; int clientIndex; int rc; void *value; for (i = 0; i < nspecs; i++) { if (clientspecs[i] == XRecordCurrentClients || clientspecs[i] == XRecordFutureClients || clientspecs[i] == XRecordAllClients) continue; if (errorspec && (CLIENT_BITS(clientspecs[i]) == errorspec)) return BadMatch; clientIndex = CLIENT_ID(clientspecs[i]); if (clientIndex && clients[clientIndex] && clients[clientIndex]->clientState == ClientStateRunning) { if (clientspecs[i] == clients[clientIndex]->clientAsMask) continue; rc = dixLookupResourceByClass(&value, clientspecs[i], RC_ANY, client, DixGetAttrAccess); if (rc != Success) return rc; } else return BadMatch; } return Success; } /* RecordSanityCheckClientSpecifiers */ /* RecordCanonicalizeClientSpecifiers * * Arguments: * pClientspecs is an array of CLIENTSPECs that have been sanity * checked. * pNumClientspecs is a pointer to the number of elements in pClientspecs. * excludespec, if non-zero, is the resource id base of a client that * should not be included in the expansion of XRecordAllClients or * XRecordCurrentClients. * * Returns: * A pointer to an array of CLIENTSPECs that is the same as the * passed array with the following modifications: * - all but the client id bits of resource IDs are stripped off. * - duplicates removed. * - XRecordAllClients expanded to a list of all currently connected * clients + XRecordFutureClients - excludespec (if non-zero) * - XRecordCurrentClients expanded to a list of all currently * connected clients - excludespec (if non-zero) * The returned array may be the passed array modified in place, or * it may be an malloc'ed array. The caller should keep a pointer to the * original array and free the returned array if it is different. * * *pNumClientspecs is set to the number of elements in the returned * array. * * Side Effects: * pClientspecs may be modified in place. */ static XID * RecordCanonicalizeClientSpecifiers(XID *pClientspecs, int *pNumClientspecs, XID excludespec) { int i; int numClients = *pNumClientspecs; /* first pass strips off the resource index bits, leaving just the * client id bits. This makes searching for a particular client simpler * (and faster.) */ for (i = 0; i < numClients; i++) { XID cs = pClientspecs[i]; if (cs > XRecordAllClients) pClientspecs[i] = CLIENT_BITS(cs); } for (i = 0; i < numClients; i++) { if (pClientspecs[i] == XRecordAllClients || pClientspecs[i] == XRecordCurrentClients) { /* expand All/Current */ int j, nc; XID *pCanon = (XID *) malloc(sizeof(XID) * (currentMaxClients + 1)); if (!pCanon) return NULL; for (nc = 0, j = 1; j < currentMaxClients; j++) { ClientPtr client = clients[j]; if (client != NullClient && client->clientState == ClientStateRunning && client->clientAsMask != excludespec) { pCanon[nc++] = client->clientAsMask; } } if (pClientspecs[i] == XRecordAllClients) pCanon[nc++] = XRecordFutureClients; *pNumClientspecs = nc; return pCanon; } else { /* not All or Current */ int j; for (j = i + 1; j < numClients;) { if (pClientspecs[i] == pClientspecs[j]) { pClientspecs[j] = pClientspecs[--numClients]; } else j++; } } } /* end for each clientspec */ *pNumClientspecs = numClients; return pClientspecs; } /* RecordCanonicalizeClientSpecifiers */ /****************************************************************************/ /* stuff for RegisterClients */ /* RecordPadAlign * * Arguments: * size is the number of bytes taken by an object. * align is a byte boundary (e.g. 4, 8) * * Returns: * the number of pad bytes to add at the end of an object of the * given size so that an object placed immediately behind it will * begin on an -byte boundary. * * Side Effects: none. */ static int RecordPadAlign(int size, int align) { return (align - (size & (align - 1))) & (align - 1); } /* RecordPadAlign */ /* RecordSanityCheckRegisterClients * * Arguments: * pContext is the context being registered on. * client is the client that issued a RecordCreateContext or * RecordRegisterClients request. * stuff is a pointer to the request. * * Returns: * Any one of several possible error values if any of the request * arguments are invalid. Success if everything is OK. * * Side Effects: none. */ static int RecordSanityCheckRegisterClients(RecordContextPtr pContext, ClientPtr client, xRecordRegisterClientsReq * stuff) { int err; xRecordRange *pRange; int i; XID recordingClient; if (((client->req_len << 2) - SIZEOF(xRecordRegisterClientsReq)) != 4 * stuff->nClients + SIZEOF(xRecordRange) * stuff->nRanges) return BadLength; if (stuff->elementHeader & ~(XRecordFromClientSequence | XRecordFromClientTime | XRecordFromServerTime)) { client->errorValue = stuff->elementHeader; return BadValue; } recordingClient = pContext->pRecordingClient ? pContext->pRecordingClient->clientAsMask : 0; err = RecordSanityCheckClientSpecifiers(client, (XID *) &stuff[1], stuff->nClients, recordingClient); if (err != Success) return err; pRange = (xRecordRange *) (((XID *) &stuff[1]) + stuff->nClients); for (i = 0; i < stuff->nRanges; i++, pRange++) { if (pRange->coreRequestsFirst > pRange->coreRequestsLast) { client->errorValue = pRange->coreRequestsFirst; return BadValue; } if (pRange->coreRepliesFirst > pRange->coreRepliesLast) { client->errorValue = pRange->coreRepliesFirst; return BadValue; } if ((pRange->extRequestsMajorFirst || pRange->extRequestsMajorLast) && (pRange->extRequestsMajorFirst < 128 || pRange->extRequestsMajorLast < 128 || pRange->extRequestsMajorFirst > pRange->extRequestsMajorLast)) { client->errorValue = pRange->extRequestsMajorFirst; return BadValue; } if (pRange->extRequestsMinorFirst > pRange->extRequestsMinorLast) { client->errorValue = pRange->extRequestsMinorFirst; return BadValue; } if ((pRange->extRepliesMajorFirst || pRange->extRepliesMajorLast) && (pRange->extRepliesMajorFirst < 128 || pRange->extRepliesMajorLast < 128 || pRange->extRepliesMajorFirst > pRange->extRepliesMajorLast)) { client->errorValue = pRange->extRepliesMajorFirst; return BadValue; } if (pRange->extRepliesMinorFirst > pRange->extRepliesMinorLast) { client->errorValue = pRange->extRepliesMinorFirst; return BadValue; } if ((pRange->deliveredEventsFirst || pRange->deliveredEventsLast) && (pRange->deliveredEventsFirst < 2 || pRange->deliveredEventsLast < 2 || pRange->deliveredEventsFirst > pRange->deliveredEventsLast)) { client->errorValue = pRange->deliveredEventsFirst; return BadValue; } if ((pRange->deviceEventsFirst || pRange->deviceEventsLast) && (pRange->deviceEventsFirst < 2 || pRange->deviceEventsLast < 2 || pRange->deviceEventsFirst > pRange->deviceEventsLast)) { client->errorValue = pRange->deviceEventsFirst; return BadValue; } if (pRange->errorsFirst > pRange->errorsLast) { client->errorValue = pRange->errorsFirst; return BadValue; } if (pRange->clientStarted != xFalse && pRange->clientStarted != xTrue) { client->errorValue = pRange->clientStarted; return BadValue; } if (pRange->clientDied != xFalse && pRange->clientDied != xTrue) { client->errorValue = pRange->clientDied; return BadValue; } } /* end for each range */ return Success; } /* end RecordSanityCheckRegisterClients */ /* This is a tactical structure used to gather information about all the sets * (RecordSetPtr) that need to be created for an RCAP in the process of * digesting a list of RECORDRANGEs (converting it to the internal * representation). */ typedef struct { int nintervals; /* number of intervals in following array */ RecordSetInterval *intervals; /* array of intervals for this set */ int size; /* size of intevals array; >= nintervals */ int align; /* alignment restriction for set */ int offset; /* where to store set pointer rel. to start of RCAP */ short first, last; /* if for extension, major opcode interval */ } SetInfoRec, *SetInfoPtr; #if defined(ERR) && defined(__sun) #undef ERR /* Avoid conflict with Solaris */ #endif /* These constant are used to index into an array of SetInfoRec. */ enum { REQ, /* set info for requests */ REP, /* set info for replies */ ERR, /* set info for errors */ DEV, /* set info for device events */ DLEV, /* set info for delivered events */ PREDEFSETS }; /* number of predefined array entries */ /* RecordAllocIntervals * * Arguments: * psi is a pointer to a SetInfoRec whose intervals pointer is NULL. * nIntervals is the desired size of the intervals array. * * Returns: BadAlloc if a memory allocation error occurred, else Success. * * Side Effects: * If Success is returned, psi->intervals is a pointer to size * RecordSetIntervals, all zeroed, and psi->size is set to size. */ static int RecordAllocIntervals(SetInfoPtr psi, int nIntervals) { assert(!psi->intervals); psi->intervals = (RecordSetInterval *) malloc(nIntervals * sizeof(RecordSetInterval)); if (!psi->intervals) return BadAlloc; memset(psi->intervals, 0, nIntervals * sizeof(RecordSetInterval)); psi->size = nIntervals; return Success; } /* end RecordAllocIntervals */ /* RecordConvertRangesToIntervals * * Arguments: * psi is a pointer to the SetInfoRec we are building. * pRanges is an array of xRecordRanges. * nRanges is the number of elements in pRanges. * byteoffset is the offset from the start of an xRecordRange of the * two bytes (1 for first, 1 for last) we are interested in. * pExtSetInfo, if non-NULL, indicates that the two bytes mentioned * above are followed by four bytes (2 for first, 2 for last) * representing a minor opcode range, and this information should be * stored in one of the SetInfoRecs starting at pExtSetInfo. * pnExtSetInfo is the number of elements in the pExtSetInfo array. * * Returns: BadAlloc if a memory allocation error occurred, else Success. * * Side Effects: * The slice of pRanges indicated by byteoffset is stored in psi. * If pExtSetInfo is non-NULL, minor opcode intervals are stored * in an existing SetInfoRec if the major opcode interval matches, else * they are stored in a new SetInfoRec, and *pnExtSetInfo is * increased accordingly. */ static int RecordConvertRangesToIntervals(SetInfoPtr psi, xRecordRange * pRanges, int nRanges, int byteoffset, SetInfoPtr pExtSetInfo, int *pnExtSetInfo) { int i; CARD8 *pCARD8; int first, last; int err; for (i = 0; i < nRanges; i++, pRanges++) { pCARD8 = ((CARD8 *) pRanges) + byteoffset; first = pCARD8[0]; last = pCARD8[1]; if (first || last) { if (!psi->intervals) { err = RecordAllocIntervals(psi, 2 * (nRanges - i)); if (err != Success) return err; } psi->intervals[psi->nintervals].first = first; psi->intervals[psi->nintervals].last = last; psi->nintervals++; assert(psi->nintervals <= psi->size); if (pExtSetInfo) { SetInfoPtr pesi = pExtSetInfo; CARD16 *pCARD16 = (CARD16 *) (pCARD8 + 2); int j; for (j = 0; j < *pnExtSetInfo; j++, pesi++) { if ((first == pesi->first) && (last == pesi->last)) break; } if (j == *pnExtSetInfo) { err = RecordAllocIntervals(pesi, 2 * (nRanges - i)); if (err != Success) return err; pesi->first = first; pesi->last = last; (*pnExtSetInfo)++; } pesi->intervals[pesi->nintervals].first = pCARD16[0]; pesi->intervals[pesi->nintervals].last = pCARD16[1]; pesi->nintervals++; assert(pesi->nintervals <= pesi->size); } } } return Success; } /* end RecordConvertRangesToIntervals */ #define offset_of(_structure, _field) \ ((char *)(& (_structure . _field)) - (char *)(&_structure)) /* RecordRegisterClients * * Arguments: * pContext is the context on which to register the clients. * client is the client that issued the RecordCreateContext or * RecordRegisterClients request. * stuff is a pointer to the request. * * Returns: * Any one of several possible error values defined by the protocol. * Success if everything is OK. * * Side Effects: * If different element headers are specified, the context is flushed. * If any of the specified clients are already registered on the * context, they are first unregistered. A new RCAP is created to * hold the specified protocol and clients, and it is linked onto the * context. If the context is enabled, appropriate hooks are installed * to record the new clients and protocol. */ static int RecordRegisterClients(RecordContextPtr pContext, ClientPtr client, xRecordRegisterClientsReq * stuff) { int err; int i; SetInfoPtr si; int maxSets; int nExtReqSets = 0; int nExtRepSets = 0; int extReqSetsOffset = 0; int extRepSetsOffset = 0; SetInfoPtr pExtReqSets, pExtRepSets; int clientListOffset; XID *pCanonClients; int clientStarted = 0, clientDied = 0; xRecordRange *pRanges, rr; int nClients; int sizeClients; int totRCAPsize; RecordClientsAndProtocolPtr pRCAP; int pad; XID recordingClient; /* do all sanity checking up front */ err = RecordSanityCheckRegisterClients(pContext, client, stuff); if (err != Success) return err; /* if element headers changed, flush buffer */ if (pContext->elemHeaders != stuff->elementHeader) { RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0); pContext->elemHeaders = stuff->elementHeader; } nClients = stuff->nClients; if (!nClients) /* if empty clients list, we're done. */ return Success; recordingClient = pContext->pRecordingClient ? pContext->pRecordingClient->clientAsMask : 0; pCanonClients = RecordCanonicalizeClientSpecifiers((XID *) &stuff[1], &nClients, recordingClient); if (!pCanonClients) return BadAlloc; /* We may have to create as many as one set for each "predefined" * protocol types, plus one per range for extension reuests, plus one per * range for extension replies. */ maxSets = PREDEFSETS + 2 * stuff->nRanges; si = (SetInfoPtr) malloc(sizeof(SetInfoRec) * maxSets); if (!si) { err = BadAlloc; goto bailout; } memset(si, 0, sizeof(SetInfoRec) * maxSets); /* theoretically you must do this because NULL may not be all-bits-zero */ for (i = 0; i < maxSets; i++) si[i].intervals = NULL; pExtReqSets = si + PREDEFSETS; pExtRepSets = pExtReqSets + stuff->nRanges; pRanges = (xRecordRange *) (((XID *) &stuff[1]) + stuff->nClients); err = RecordConvertRangesToIntervals(&si[REQ], pRanges, stuff->nRanges, offset_of(rr, coreRequestsFirst), NULL, NULL); if (err != Success) goto bailout; err = RecordConvertRangesToIntervals(&si[REQ], pRanges, stuff->nRanges, offset_of(rr, extRequestsMajorFirst), pExtReqSets, &nExtReqSets); if (err != Success) goto bailout; err = RecordConvertRangesToIntervals(&si[REP], pRanges, stuff->nRanges, offset_of(rr, coreRepliesFirst), NULL, NULL); if (err != Success) goto bailout; err = RecordConvertRangesToIntervals(&si[REP], pRanges, stuff->nRanges, offset_of(rr, extRepliesMajorFirst), pExtRepSets, &nExtRepSets); if (err != Success) goto bailout; err = RecordConvertRangesToIntervals(&si[ERR], pRanges, stuff->nRanges, offset_of(rr, errorsFirst), NULL, NULL); if (err != Success) goto bailout; err = RecordConvertRangesToIntervals(&si[DLEV], pRanges, stuff->nRanges, offset_of(rr, deliveredEventsFirst), NULL, NULL); if (err != Success) goto bailout; err = RecordConvertRangesToIntervals(&si[DEV], pRanges, stuff->nRanges, offset_of(rr, deviceEventsFirst), NULL, NULL); if (err != Success) goto bailout; /* collect client-started and client-died */ for (i = 0; i < stuff->nRanges; i++) { if (pRanges[i].clientStarted) clientStarted = TRUE; if (pRanges[i].clientDied) clientDied = TRUE; } /* We now have all the information collected to create all the sets, * and we can compute the total memory required for the RCAP. */ totRCAPsize = sizeof(RecordClientsAndProtocolRec); /* leave a little room to grow before forcing a separate allocation */ sizeClients = nClients + CLIENT_ARRAY_GROWTH_INCREMENT; pad = RecordPadAlign(totRCAPsize, sizeof(XID)); clientListOffset = totRCAPsize + pad; totRCAPsize += pad + sizeClients * sizeof(XID); if (nExtReqSets) { pad = RecordPadAlign(totRCAPsize, sizeof(RecordSetPtr)); extReqSetsOffset = totRCAPsize + pad; totRCAPsize += pad + (nExtReqSets + 1) * sizeof(RecordMinorOpRec); } if (nExtRepSets) { pad = RecordPadAlign(totRCAPsize, sizeof(RecordSetPtr)); extRepSetsOffset = totRCAPsize + pad; totRCAPsize += pad + (nExtRepSets + 1) * sizeof(RecordMinorOpRec); } for (i = 0; i < maxSets; i++) { if (si[i].nintervals) { si[i].size = RecordSetMemoryRequirements(si[i].intervals, si[i].nintervals, &si[i].align); pad = RecordPadAlign(totRCAPsize, si[i].align); si[i].offset = pad + totRCAPsize; totRCAPsize += pad + si[i].size; } } /* allocate memory for the whole RCAP */ pRCAP = (RecordClientsAndProtocolPtr) malloc(totRCAPsize); if (!pRCAP) { err = BadAlloc; goto bailout; } /* fill in the RCAP */ pRCAP->pContext = pContext; pRCAP->pClientIDs = (XID *) ((char *) pRCAP + clientListOffset); pRCAP->numClients = nClients; pRCAP->sizeClients = sizeClients; pRCAP->clientIDsSeparatelyAllocated = 0; for (i = 0; i < nClients; i++) { RecordDeleteClientFromContext(pContext, pCanonClients[i]); pRCAP->pClientIDs[i] = pCanonClients[i]; } /* create all the sets */ if (si[REQ].intervals) { pRCAP->pRequestMajorOpSet = RecordCreateSet(si[REQ].intervals, si[REQ].nintervals, (RecordSetPtr) ((char *) pRCAP + si[REQ].offset), si[REQ].size); } else pRCAP->pRequestMajorOpSet = NULL; if (si[REP].intervals) { pRCAP->pReplyMajorOpSet = RecordCreateSet(si[REP].intervals, si[REP].nintervals, (RecordSetPtr) ((char *) pRCAP + si[REP].offset), si[REP].size); } else pRCAP->pReplyMajorOpSet = NULL; if (si[ERR].intervals) { pRCAP->pErrorSet = RecordCreateSet(si[ERR].intervals, si[ERR].nintervals, (RecordSetPtr) ((char *) pRCAP + si[ERR].offset), si[ERR].size); } else pRCAP->pErrorSet = NULL; if (si[DEV].intervals) { pRCAP->pDeviceEventSet = RecordCreateSet(si[DEV].intervals, si[DEV].nintervals, (RecordSetPtr) ((char *) pRCAP + si[DEV].offset), si[DEV].size); } else pRCAP->pDeviceEventSet = NULL; if (si[DLEV].intervals) { pRCAP->pDeliveredEventSet = RecordCreateSet(si[DLEV].intervals, si[DLEV].nintervals, (RecordSetPtr) ((char *) pRCAP + si[DLEV].offset), si[DLEV].size); } else pRCAP->pDeliveredEventSet = NULL; if (nExtReqSets) { pRCAP->pRequestMinOpInfo = (RecordMinorOpPtr) ((char *) pRCAP + extReqSetsOffset); pRCAP->pRequestMinOpInfo[0].count = nExtReqSets; for (i = 0; i < nExtReqSets; i++, pExtReqSets++) { pRCAP->pRequestMinOpInfo[i + 1].major.first = pExtReqSets->first; pRCAP->pRequestMinOpInfo[i + 1].major.last = pExtReqSets->last; pRCAP->pRequestMinOpInfo[i + 1].major.pMinOpSet = RecordCreateSet(pExtReqSets->intervals, pExtReqSets->nintervals, (RecordSetPtr) ((char *) pRCAP + pExtReqSets->offset), pExtReqSets->size); } } else pRCAP->pRequestMinOpInfo = NULL; if (nExtRepSets) { pRCAP->pReplyMinOpInfo = (RecordMinorOpPtr) ((char *) pRCAP + extRepSetsOffset); pRCAP->pReplyMinOpInfo[0].count = nExtRepSets; for (i = 0; i < nExtRepSets; i++, pExtRepSets++) { pRCAP->pReplyMinOpInfo[i + 1].major.first = pExtRepSets->first; pRCAP->pReplyMinOpInfo[i + 1].major.last = pExtRepSets->last; pRCAP->pReplyMinOpInfo[i + 1].major.pMinOpSet = RecordCreateSet(pExtRepSets->intervals, pExtRepSets->nintervals, (RecordSetPtr) ((char *) pRCAP + pExtRepSets->offset), pExtRepSets->size); } } else pRCAP->pReplyMinOpInfo = NULL; pRCAP->clientStarted = clientStarted; pRCAP->clientDied = clientDied; /* link the RCAP onto the context */ pRCAP->pNextRCAP = pContext->pListOfRCAP; pContext->pListOfRCAP = pRCAP; if (pContext->pRecordingClient) /* context enabled */ RecordInstallHooks(pRCAP, 0); bailout: if (si) { for (i = 0; i < maxSets; i++) free(si[i].intervals); free(si); } if (pCanonClients && pCanonClients != (XID *) &stuff[1]) free(pCanonClients); return err; } /* RecordRegisterClients */ /* Proc functions all take a client argument, execute the request in * client->requestBuffer, and return a protocol error status. */ static int ProcRecordQueryVersion(ClientPtr client) { /* REQUEST(xRecordQueryVersionReq); */ xRecordQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_RECORD_MAJOR_VERSION, .minorVersion = SERVER_RECORD_MINOR_VERSION }; REQUEST_SIZE_MATCH(xRecordQueryVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xRecordQueryVersionReply), &rep); return Success; } /* ProcRecordQueryVersion */ static int ProcRecordCreateContext(ClientPtr client) { REQUEST(xRecordCreateContextReq); RecordContextPtr pContext; RecordContextPtr *ppNewAllContexts = NULL; int err = BadAlloc; REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); LEGAL_NEW_RESOURCE(stuff->context, client); pContext = (RecordContextPtr) malloc(sizeof(RecordContextRec)); if (!pContext) goto bailout; /* make sure there is room in ppAllContexts to store the new context */ ppNewAllContexts = (RecordContextPtr *) realloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1)); if (!ppNewAllContexts) goto bailout; ppAllContexts = ppNewAllContexts; pContext->id = stuff->context; pContext->pRecordingClient = NULL; pContext->pListOfRCAP = NULL; pContext->elemHeaders = 0; pContext->bufCategory = 0; pContext->numBufBytes = 0; pContext->pBufClient = NULL; pContext->continuedReply = 0; pContext->inFlush = 0; err = RecordRegisterClients(pContext, client, (xRecordRegisterClientsReq *) stuff); if (err != Success) goto bailout; if (AddResource(pContext->id, RTContext, pContext)) { ppAllContexts[numContexts++] = pContext; return Success; } else { RecordDeleteContext((void *) pContext, pContext->id); return BadAlloc; } bailout: free(pContext); return err; } /* ProcRecordCreateContext */ static int ProcRecordRegisterClients(ClientPtr client) { RecordContextPtr pContext; REQUEST(xRecordRegisterClientsReq); REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); VERIFY_CONTEXT(pContext, stuff->context, client); return RecordRegisterClients(pContext, client, stuff); } /* ProcRecordRegisterClients */ static int ProcRecordUnregisterClients(ClientPtr client) { RecordContextPtr pContext; int err; REQUEST(xRecordUnregisterClientsReq); XID *pCanonClients; int nClients; int i; REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq); if ((client->req_len << 2) - SIZEOF(xRecordUnregisterClientsReq) != 4 * stuff->nClients) return BadLength; VERIFY_CONTEXT(pContext, stuff->context, client); err = RecordSanityCheckClientSpecifiers(client, (XID *) &stuff[1], stuff->nClients, 0); if (err != Success) return err; nClients = stuff->nClients; pCanonClients = RecordCanonicalizeClientSpecifiers((XID *) &stuff[1], &nClients, 0); if (!pCanonClients) return BadAlloc; for (i = 0; i < nClients; i++) { RecordDeleteClientFromContext(pContext, pCanonClients[i]); } if (pCanonClients != (XID *) &stuff[1]) free(pCanonClients); return Success; } /* ProcRecordUnregisterClients */ /****************************************************************************/ /* stuff for GetContext */ /* This is a tactical structure used to hold the xRecordRanges as they are * being reconstituted from the sets in the RCAPs. */ typedef struct { xRecordRange *pRanges; /* array of xRecordRanges for one RCAP */ int size; /* number of elements in pRanges, >= nRanges */ int nRanges; /* number of occupied element of pRanges */ } GetContextRangeInfoRec, *GetContextRangeInfoPtr; /* RecordAllocRanges * * Arguments: * pri is a pointer to a GetContextRangeInfoRec to allocate for. * nRanges is the number of xRecordRanges desired for pri. * * Returns: BadAlloc if a memory allocation error occurred, else Success. * * Side Effects: * If Success is returned, pri->pRanges points to at least nRanges * ranges. pri->nRanges is set to nRanges. pri->size is the actual * number of ranges. Newly allocated ranges are zeroed. */ static int RecordAllocRanges(GetContextRangeInfoPtr pri, int nRanges) { int newsize; xRecordRange *pNewRange; #define SZINCR 8 newsize = max(pri->size + SZINCR, nRanges); pNewRange = (xRecordRange *) realloc(pri->pRanges, newsize * sizeof(xRecordRange)); if (!pNewRange) return BadAlloc; pri->pRanges = pNewRange; pri->size = newsize; memset(&pri->pRanges[pri->size - SZINCR], 0, SZINCR * sizeof(xRecordRange)); if (pri->nRanges < nRanges) pri->nRanges = nRanges; return Success; } /* RecordAllocRanges */ /* RecordConvertSetToRanges * * Arguments: * pSet is the set to be converted. * pri is where the result should be stored. * byteoffset is the offset from the start of an xRecordRange of the * two vales (first, last) we are interested in. * card8 is TRUE if the vales are one byte each and FALSE if two bytes * each. * imax is the largest set value to store in pri->pRanges. * pStartIndex, if non-NULL, is the index of the first range in * pri->pRanges that should be stored to. If NULL, * start at index 0. * * Returns: BadAlloc if a memory allocation error occurred, else Success. * * Side Effects: * If Success is returned, the slice of pri->pRanges indicated by * byteoffset and card8 is filled in with the intervals from pSet. * if pStartIndex was non-NULL, *pStartIndex is filled in with one * more than the index of the last xRecordRange that was touched. */ static int RecordConvertSetToRanges(RecordSetPtr pSet, GetContextRangeInfoPtr pri, int byteoffset, Bool card8, unsigned int imax, int *pStartIndex) { int nRanges; RecordSetIteratePtr pIter = NULL; RecordSetInterval interval; CARD8 *pCARD8; CARD16 *pCARD16; int err; if (!pSet) return Success; nRanges = pStartIndex ? *pStartIndex : 0; while ((pIter = RecordIterateSet(pSet, pIter, &interval))) { if (interval.first > imax) break; if (interval.last > imax) interval.last = imax; nRanges++; if (nRanges > pri->size) { err = RecordAllocRanges(pri, nRanges); if (err != Success) return err; } else pri->nRanges = max(pri->nRanges, nRanges); if (card8) { pCARD8 = ((CARD8 *) &pri->pRanges[nRanges - 1]) + byteoffset; *pCARD8++ = interval.first; *pCARD8 = interval.last; } else { pCARD16 = (CARD16 *) (((char *) &pri->pRanges[nRanges - 1]) + byteoffset); *pCARD16++ = interval.first; *pCARD16 = interval.last; } } if (pStartIndex) *pStartIndex = nRanges; return Success; } /* RecordConvertSetToRanges */ /* RecordConvertMinorOpInfoToRanges * * Arguments: * pMinOpInfo is the minor opcode info to convert to xRecordRanges. * pri is where the result should be stored. * byteoffset is the offset from the start of an xRecordRange of the * four vales (CARD8 major_first, CARD8 major_last, * CARD16 minor_first, CARD16 minor_last) we are going to store. * * Returns: BadAlloc if a memory allocation error occurred, else Success. * * Side Effects: * If Success is returned, the slice of pri->pRanges indicated by * byteoffset is filled in with the information from pMinOpInfo. */ static int RecordConvertMinorOpInfoToRanges(RecordMinorOpPtr pMinOpInfo, GetContextRangeInfoPtr pri, int byteoffset) { int nsets; int start; int i; int err; if (!pMinOpInfo) return Success; nsets = pMinOpInfo->count; pMinOpInfo++; start = 0; for (i = 0; i < nsets; i++) { int j, s; s = start; err = RecordConvertSetToRanges(pMinOpInfo[i].major.pMinOpSet, pri, byteoffset + 2, FALSE, 65535, &start); if (err != Success) return err; for (j = s; j < start; j++) { CARD8 *pCARD8 = ((CARD8 *) &pri->pRanges[j]) + byteoffset; *pCARD8++ = pMinOpInfo[i].major.first; *pCARD8 = pMinOpInfo[i].major.last; } } return Success; } /* RecordConvertMinorOpInfoToRanges */ /* RecordSwapRanges * * Arguments: * pRanges is an array of xRecordRanges. * nRanges is the number of elements in pRanges. * * Returns: nothing. * * Side Effects: * The 16 bit fields of each xRecordRange are byte swapped. */ static void RecordSwapRanges(xRecordRange * pRanges, int nRanges) { int i; for (i = 0; i < nRanges; i++, pRanges++) { swaps(&pRanges->extRequestsMinorFirst); swaps(&pRanges->extRequestsMinorLast); swaps(&pRanges->extRepliesMinorFirst); swaps(&pRanges->extRepliesMinorLast); } } /* RecordSwapRanges */ static int ProcRecordGetContext(ClientPtr client) { RecordContextPtr pContext; REQUEST(xRecordGetContextReq); xRecordGetContextReply rep; RecordClientsAndProtocolPtr pRCAP; int nRCAPs = 0; GetContextRangeInfoPtr pRangeInfo; GetContextRangeInfoPtr pri; int i; int err; CARD32 nClients, length; REQUEST_SIZE_MATCH(xRecordGetContextReq); VERIFY_CONTEXT(pContext, stuff->context, client); /* how many RCAPs are there on this context? */ for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP) nRCAPs++; /* allocate and initialize space for record range info */ pRangeInfo = (GetContextRangeInfoPtr) malloc(nRCAPs * sizeof(GetContextRangeInfoRec)); if (!pRangeInfo && nRCAPs > 0) return BadAlloc; for (i = 0; i < nRCAPs; i++) { pRangeInfo[i].pRanges = NULL; pRangeInfo[i].size = 0; pRangeInfo[i].nRanges = 0; } /* convert the RCAP (internal) representation of the recorded protocol * to the wire protocol (external) representation, storing the information * for the ith RCAP in pri[i] */ for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo; pRCAP; pRCAP = pRCAP->pNextRCAP, pri++) { xRecordRange rr; err = RecordConvertSetToRanges(pRCAP->pRequestMajorOpSet, pri, offset_of(rr, coreRequestsFirst), TRUE, 127, NULL); if (err != Success) goto bailout; err = RecordConvertSetToRanges(pRCAP->pReplyMajorOpSet, pri, offset_of(rr, coreRepliesFirst), TRUE, 127, NULL); if (err != Success) goto bailout; err = RecordConvertSetToRanges(pRCAP->pDeliveredEventSet, pri, offset_of(rr, deliveredEventsFirst), TRUE, 255, NULL); if (err != Success) goto bailout; err = RecordConvertSetToRanges(pRCAP->pDeviceEventSet, pri, offset_of(rr, deviceEventsFirst), TRUE, 255, NULL); if (err != Success) goto bailout; err = RecordConvertSetToRanges(pRCAP->pErrorSet, pri, offset_of(rr, errorsFirst), TRUE, 255, NULL); if (err != Success) goto bailout; err = RecordConvertMinorOpInfoToRanges(pRCAP->pRequestMinOpInfo, pri, offset_of(rr, extRequestsMajorFirst)); if (err != Success) goto bailout; err = RecordConvertMinorOpInfoToRanges(pRCAP->pReplyMinOpInfo, pri, offset_of(rr, extRepliesMajorFirst)); if (err != Success) goto bailout; if (pRCAP->clientStarted || pRCAP->clientDied) { if (pri->nRanges == 0) RecordAllocRanges(pri, 1); pri->pRanges[0].clientStarted = pRCAP->clientStarted; pri->pRanges[0].clientDied = pRCAP->clientDied; } } /* calculate number of clients and reply length */ nClients = 0; length = 0; for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo; pRCAP; pRCAP = pRCAP->pNextRCAP, pri++) { nClients += pRCAP->numClients; length += pRCAP->numClients * (bytes_to_int32(sizeof(xRecordClientInfo)) + pri->nRanges * bytes_to_int32(sizeof(xRecordRange))); } /* write the reply header */ 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); } WriteToClient(client, sizeof(xRecordGetContextReply), &rep); /* write all the CLIENT_INFOs */ for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo; pRCAP; pRCAP = pRCAP->pNextRCAP, pri++) { xRecordClientInfo rci; rci.nRanges = pri->nRanges; if (client->swapped) { swapl(&rci.nRanges); RecordSwapRanges(pri->pRanges, pri->nRanges); } for (i = 0; i < pRCAP->numClients; i++) { rci.clientResource = pRCAP->pClientIDs[i]; if (client->swapped) swapl(&rci.clientResource); WriteToClient(client, sizeof(xRecordClientInfo), &rci); WriteToClient(client, sizeof(xRecordRange) * pri->nRanges, pri->pRanges); } } err = Success; bailout: for (i = 0; i < nRCAPs; i++) { free(pRangeInfo[i].pRanges); } free(pRangeInfo); return err; } /* ProcRecordGetContext */ static int ProcRecordEnableContext(ClientPtr client) { RecordContextPtr pContext; REQUEST(xRecordEnableContextReq); int i; RecordClientsAndProtocolPtr pRCAP; REQUEST_SIZE_MATCH(xRecordGetContextReq); VERIFY_CONTEXT(pContext, stuff->context, client); if (pContext->pRecordingClient) return BadMatch; /* already enabled */ /* install record hooks for each RCAP */ for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP) { int err = RecordInstallHooks(pRCAP, 0); if (err != Success) { /* undo the previous installs */ RecordClientsAndProtocolPtr pUninstallRCAP; for (pUninstallRCAP = pContext->pListOfRCAP; pUninstallRCAP != pRCAP; pUninstallRCAP = pUninstallRCAP->pNextRCAP) { RecordUninstallHooks(pUninstallRCAP, 0); } return err; } } /* Disallow further request processing on this connection until * the context is disabled. */ IgnoreClient(client); pContext->pRecordingClient = client; /* Don't allow the data connection to record itself; unregister it. */ RecordDeleteClientFromContext(pContext, pContext->pRecordingClient->clientAsMask); /* move the newly enabled context to the front part of ppAllContexts, * where all the enabled contexts are */ i = RecordFindContextOnAllContexts(pContext); assert(i >= numEnabledContexts); if (i != numEnabledContexts) { ppAllContexts[i] = ppAllContexts[numEnabledContexts]; ppAllContexts[numEnabledContexts] = pContext; } ++numEnabledContexts; assert(numEnabledContexts > 0); /* send StartOfData */ RecordAProtocolElement(pContext, NULL, XRecordStartOfData, NULL, 0, 0, 0); RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0); return Success; } /* ProcRecordEnableContext */ /* RecordDisableContext * * Arguments: * pContext is the context to disable. * nRanges is the number of elements in pRanges. * * Returns: nothing. * * Side Effects: * If the context was enabled, it is disabled. An EndOfData * message is sent to the recording client. Recording hooks for * this context are uninstalled. The context is moved to the * rear part of the ppAllContexts array. numEnabledContexts is * decremented. Request processing for the formerly recording client * is resumed. */ static void RecordDisableContext(RecordContextPtr pContext) { RecordClientsAndProtocolPtr pRCAP; int i; if (!pContext->pRecordingClient) return; if (!pContext->pRecordingClient->clientGone) { RecordAProtocolElement(pContext, NULL, XRecordEndOfData, NULL, 0, 0, 0); RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0); /* Re-enable request processing on this connection. */ AttendClient(pContext->pRecordingClient); } for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP) { RecordUninstallHooks(pRCAP, 0); } pContext->pRecordingClient = NULL; /* move the newly disabled context to the rear part of ppAllContexts, * where all the disabled contexts are */ i = RecordFindContextOnAllContexts(pContext); assert((i != -1) && (i < numEnabledContexts)); if (i != (numEnabledContexts - 1)) { ppAllContexts[i] = ppAllContexts[numEnabledContexts - 1]; ppAllContexts[numEnabledContexts - 1] = pContext; } --numEnabledContexts; assert(numEnabledContexts >= 0); } /* RecordDisableContext */ static int ProcRecordDisableContext(ClientPtr client) { RecordContextPtr pContext; REQUEST(xRecordDisableContextReq); REQUEST_SIZE_MATCH(xRecordDisableContextReq); VERIFY_CONTEXT(pContext, stuff->context, client); RecordDisableContext(pContext); return Success; } /* ProcRecordDisableContext */ /* RecordDeleteContext * * Arguments: * value is the context to delete. * id is its resource ID. * * Returns: Success. * * Side Effects: * Disables the context, frees all associated memory, and removes * it from the ppAllContexts array. */ static int RecordDeleteContext(void *value, XID id) { int i; RecordContextPtr pContext = (RecordContextPtr) value; RecordClientsAndProtocolPtr pRCAP; RecordDisableContext(pContext); /* Remove all the clients from all the RCAPs. * As a result, the RCAPs will be freed. */ while ((pRCAP = pContext->pListOfRCAP)) { int numClients = pRCAP->numClients; /* when the last client is deleted, the RCAP will go away. */ while (numClients--) { RecordDeleteClientFromRCAP(pRCAP, numClients); } } /* remove context from AllContexts list */ if (-1 != (i = RecordFindContextOnAllContexts(pContext))) { ppAllContexts[i] = ppAllContexts[numContexts - 1]; if (--numContexts == 0) { free(ppAllContexts); ppAllContexts = NULL; } } free(pContext); return Success; } /* RecordDeleteContext */ static int ProcRecordFreeContext(ClientPtr client) { RecordContextPtr pContext; REQUEST(xRecordFreeContextReq); REQUEST_SIZE_MATCH(xRecordFreeContextReq); VERIFY_CONTEXT(pContext, stuff->context, client); FreeResource(stuff->context, RT_NONE); return Success; } /* ProcRecordFreeContext */ static int ProcRecordDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_RecordQueryVersion: return ProcRecordQueryVersion(client); case X_RecordCreateContext: return ProcRecordCreateContext(client); case X_RecordRegisterClients: return ProcRecordRegisterClients(client); case X_RecordUnregisterClients: return ProcRecordUnregisterClients(client); case X_RecordGetContext: return ProcRecordGetContext(client); case X_RecordEnableContext: return ProcRecordEnableContext(client); case X_RecordDisableContext: return ProcRecordDisableContext(client); case X_RecordFreeContext: return ProcRecordFreeContext(client); default: return BadRequest; } } /* ProcRecordDispatch */ static int SProcRecordQueryVersion(ClientPtr client) { REQUEST(xRecordQueryVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordQueryVersionReq); swaps(&stuff->majorVersion); swaps(&stuff->minorVersion); return ProcRecordQueryVersion(client); } /* SProcRecordQueryVersion */ static int SwapCreateRegister(xRecordRegisterClientsReq * stuff) { int i; XID *pClientID; swapl(&stuff->context); swapl(&stuff->nClients); swapl(&stuff->nRanges); pClientID = (XID *) &stuff[1]; if (stuff->nClients > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq)) return BadLength; for (i = 0; i < stuff->nClients; i++, pClientID++) { swapl(pClientID); } if (stuff->nRanges > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq) - stuff->nClients) return BadLength; RecordSwapRanges((xRecordRange *) pClientID, stuff->nRanges); return Success; } /* SwapCreateRegister */ static int SProcRecordCreateContext(ClientPtr client) { REQUEST(xRecordCreateContextReq); int status; swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); if ((status = SwapCreateRegister((void *) stuff)) != Success) return status; return ProcRecordCreateContext(client); } /* SProcRecordCreateContext */ static int SProcRecordRegisterClients(ClientPtr client) { REQUEST(xRecordRegisterClientsReq); int status; swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); if ((status = SwapCreateRegister((void *) stuff)) != Success) return status; return ProcRecordRegisterClients(client); } /* SProcRecordRegisterClients */ static int SProcRecordUnregisterClients(ClientPtr client) { REQUEST(xRecordUnregisterClientsReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq); swapl(&stuff->context); swapl(&stuff->nClients); SwapRestL(stuff); return ProcRecordUnregisterClients(client); } /* SProcRecordUnregisterClients */ static int SProcRecordGetContext(ClientPtr client) { REQUEST(xRecordGetContextReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordGetContextReq); swapl(&stuff->context); return ProcRecordGetContext(client); } /* SProcRecordGetContext */ static int SProcRecordEnableContext(ClientPtr client) { REQUEST(xRecordEnableContextReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordEnableContextReq); swapl(&stuff->context); return ProcRecordEnableContext(client); } /* SProcRecordEnableContext */ static int SProcRecordDisableContext(ClientPtr client) { REQUEST(xRecordDisableContextReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordDisableContextReq); swapl(&stuff->context); return ProcRecordDisableContext(client); } /* SProcRecordDisableContext */ static int SProcRecordFreeContext(ClientPtr client) { REQUEST(xRecordFreeContextReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordFreeContextReq); swapl(&stuff->context); return ProcRecordFreeContext(client); } /* SProcRecordFreeContext */ static int SProcRecordDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_RecordQueryVersion: return SProcRecordQueryVersion(client); case X_RecordCreateContext: return SProcRecordCreateContext(client); case X_RecordRegisterClients: return SProcRecordRegisterClients(client); case X_RecordUnregisterClients: return SProcRecordUnregisterClients(client); case X_RecordGetContext: return SProcRecordGetContext(client); case X_RecordEnableContext: return SProcRecordEnableContext(client); case X_RecordDisableContext: return SProcRecordDisableContext(client); case X_RecordFreeContext: return SProcRecordFreeContext(client); default: return BadRequest; } } /* SProcRecordDispatch */ /* RecordConnectionSetupInfo * * Arguments: * pContext is an enabled context that specifies recording of * connection setup info. * pci holds the connection setup info. * * Returns: nothing. * * Side Effects: * The connection setup info is sent to the recording client. */ static void RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec * pci) { int prefixsize = SIZEOF(xConnSetupPrefix); int restsize = pci->prefix->length * 4; if (pci->client->swapped) { char *pConnSetup = (char *) malloc(prefixsize + restsize); if (!pConnSetup) return; SwapConnSetupPrefix(pci->prefix, (xConnSetupPrefix *) pConnSetup); SwapConnSetupInfo((char *) pci->setup, (char *) (pConnSetup + prefixsize)); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, (void *) pConnSetup, prefixsize + restsize, 0, 0); free(pConnSetup); } else { /* don't alloc and copy as in the swapped case; just send the * data in two pieces */ RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, (void *) pci->prefix, prefixsize, 0, restsize); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, (void *) pci->setup, restsize, 0, /* continuation */ -1); } } /* RecordConnectionSetupInfo */ /* RecordDeleteContext * * Arguments: * pcbl is &ClientStateCallback. * nullata is NULL. * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h) * which contains information about client state changes. * * Returns: nothing. * * Side Effects: * If a new client has connected and any contexts have specified * XRecordFutureClients, the new client is registered on those contexts. * If any of those contexts specify recording of the connection setup * info, it is recorded. * * If an existing client has disconnected, it is deleted from any * contexts that it was registered on. If any of those contexts * specified XRecordClientDied, they record a ClientDied protocol element. * If the disconnectiong client happened to be the data connection of an * enabled context, the context is disabled. */ static void RecordAClientStateChange(CallbackListPtr *pcbl, void *nulldata, void *calldata) { NewClientInfoRec *pci = (NewClientInfoRec *) calldata; int i; ClientPtr pClient = pci->client; RecordContextPtr *ppAllContextsCopy = NULL; int numContextsCopy = 0; switch (pClient->clientState) { case ClientStateRunning: /* new client */ for (i = 0; i < numContexts; i++) { RecordClientsAndProtocolPtr pRCAP; RecordContextPtr pContext = ppAllContexts[i]; if ((pRCAP = RecordFindClientOnContext(pContext, XRecordFutureClients, NULL))) { RecordAddClientToRCAP(pRCAP, pClient->clientAsMask); if (pContext->pRecordingClient && pRCAP->clientStarted) RecordConnectionSetupInfo(pContext, pci); } } break; case ClientStateGone: case ClientStateRetained: /* client disconnected */ /* RecordDisableContext modifies contents of ppAllContexts. */ numContextsCopy = numContexts; ppAllContextsCopy = malloc(numContextsCopy * sizeof(RecordContextPtr)); assert(ppAllContextsCopy); memcpy(ppAllContextsCopy, ppAllContexts, numContextsCopy * sizeof(RecordContextPtr)); for (i = 0; i < numContextsCopy; i++) { RecordClientsAndProtocolPtr pRCAP; RecordContextPtr pContext = ppAllContextsCopy[i]; int pos; if (pContext->pRecordingClient == pClient) RecordDisableContext(pContext); if ((pRCAP = RecordFindClientOnContext(pContext, pClient->clientAsMask, &pos))) { if (pContext->pRecordingClient && pRCAP->clientDied) RecordAProtocolElement(pContext, pClient, XRecordClientDied, NULL, 0, 0, 0); RecordDeleteClientFromRCAP(pRCAP, pos); } } free(ppAllContextsCopy); break; default: break; } /* end switch on client state */ } /* RecordAClientStateChange */ /* RecordCloseDown * * Arguments: * extEntry is the extension information for RECORD. * * Returns: nothing. * * Side Effects: * Performs any cleanup needed by RECORD at server shutdown time. * */ static void RecordCloseDown(ExtensionEntry * extEntry) { DeleteCallback(&ClientStateCallback, RecordAClientStateChange, NULL); } /* RecordCloseDown */ /* RecordExtensionInit * * Arguments: none. * * Returns: nothing. * * Side Effects: * Enables the RECORD extension if possible. */ void RecordExtensionInit(void) { ExtensionEntry *extentry; RTContext = CreateNewResourceType(RecordDeleteContext, "RecordContext"); if (!RTContext) return; if (!dixRegisterPrivateKey(RecordClientPrivateKey, PRIVATE_CLIENT, 0)) return; ppAllContexts = NULL; numContexts = numEnabledContexts = numEnabledRCAPs = 0; if (!AddCallback(&ClientStateCallback, RecordAClientStateChange, NULL)) return; extentry = AddExtension(RECORD_NAME, RecordNumEvents, RecordNumErrors, ProcRecordDispatch, SProcRecordDispatch, RecordCloseDown, StandardMinorOpcode); if (!extentry) { DeleteCallback(&ClientStateCallback, RecordAClientStateChange, NULL); return; } SetResourceTypeErrorValue(RTContext, extentry->errorBase + XRecordBadContext); } /* RecordExtensionInit */ xorg-server-1.17.1/glamor/0000775000175100017510000000000012466505445012365 500000000000000xorg-server-1.17.1/glamor/glamor_prepare.c0000664000175100017510000002041112460362577015447 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_prepare.h" #include "glamor_transfer.h" /* * Make a pixmap ready to draw with fb by * creating a PBO large enough for the whole object * and downloading all of the FBOs into it. */ static Bool glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) { ScreenPtr screen = pixmap->drawable.pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); int gl_access, gl_usage; RegionRec region; if (priv->type == GLAMOR_DRM_ONLY) return FALSE; if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) return TRUE; RegionInit(®ion, box, 1); /* See if it's already mapped */ if (pixmap->devPrivate.ptr) { /* * Someone else has mapped this pixmap; * we'll assume that it's directly mapped * by a lower level driver */ if (!priv->base.prepared) return TRUE; /* In X, multiple Drawables can be stored in the same Pixmap (such as * each individual window in a non-composited screen pixmap, or the * reparented window contents inside the window-manager-decorated window * pixmap on a composited screen). * * As a result, when doing a series of mappings for a fallback, we may * need to add more boxes to the set of data we've downloaded, as we go. */ RegionSubtract(®ion, ®ion, &priv->base.prepare_region); if (!RegionNotEmpty(®ion)) return TRUE; if (access == GLAMOR_ACCESS_RW) FatalError("attempt to remap buffer as writable"); if (priv->base.pbo) { glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->base.pbo); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); pixmap->devPrivate.ptr = NULL; } } else { RegionInit(&priv->base.prepare_region, box, 1); if (glamor_priv->has_rw_pbo) { if (priv->base.pbo == 0) glGenBuffers(1, &priv->base.pbo); gl_usage = GL_STREAM_READ; glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->base.pbo); glBufferData(GL_PIXEL_PACK_BUFFER, pixmap->devKind * pixmap->drawable.height, NULL, gl_usage); } else { pixmap->devPrivate.ptr = malloc(pixmap->devKind * pixmap->drawable.height); if (!pixmap->devPrivate.ptr) return FALSE; } priv->base.map_access = access; } glamor_download_boxes(pixmap, RegionRects(®ion), RegionNumRects(®ion), 0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); RegionUninit(®ion); if (glamor_priv->has_rw_pbo) { if (priv->base.map_access == GLAMOR_ACCESS_RW) gl_access = GL_READ_WRITE; else gl_access = GL_READ_ONLY; pixmap->devPrivate.ptr = glMapBuffer(GL_PIXEL_PACK_BUFFER, gl_access); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); } priv->base.prepared = TRUE; return TRUE; } /* * When we're done with the drawable, unmap the PBO, reupload * if we were writing to it and then unbind it to release the memory */ static void glamor_fini_pixmap(PixmapPtr pixmap) { ScreenPtr screen = pixmap->drawable.pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) return; if (!priv->base.prepared) return; if (glamor_priv->has_rw_pbo) { glBindBuffer(GL_PIXEL_UNPACK_BUFFER, priv->base.pbo); glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); pixmap->devPrivate.ptr = NULL; } if (priv->base.map_access == GLAMOR_ACCESS_RW) { glamor_upload_boxes(pixmap, RegionRects(&priv->base.prepare_region), RegionNumRects(&priv->base.prepare_region), 0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); } RegionUninit(&priv->base.prepare_region); if (glamor_priv->has_rw_pbo) { glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); glDeleteBuffers(1, &priv->base.pbo); priv->base.pbo = 0; } else { free(pixmap->devPrivate.ptr); pixmap->devPrivate.ptr = NULL; } priv->base.prepared = FALSE; } Bool glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); BoxRec box; int off_x, off_y; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); box.x1 = drawable->x + off_x; box.x2 = box.x1 + drawable->width; box.y1 = drawable->y + off_y; box.y2 = box.y1 + drawable->height; return glamor_prep_pixmap_box(pixmap, access, &box); } Bool glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, int x, int y, int w, int h) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); BoxRec box; int off_x, off_y; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); box.x1 = drawable->x + x + off_x; box.x2 = box.x1 + w; box.y1 = drawable->y + y + off_y; box.y2 = box.y1 + h; return glamor_prep_pixmap_box(pixmap, access, &box); } void glamor_finish_access(DrawablePtr drawable) { glamor_fini_pixmap(glamor_get_drawable_pixmap(drawable)); } /* * Make a picture ready to use with fb. */ Bool glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access) { if (!picture || !picture->pDrawable) return TRUE; return glamor_prepare_access(picture->pDrawable, access); } Bool glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access, int x, int y, int w, int h) { if (!picture || !picture->pDrawable) return TRUE; return glamor_prepare_access_box(picture->pDrawable, access, x, y, w, h); } void glamor_finish_access_picture(PicturePtr picture) { if (!picture || !picture->pDrawable) return; glamor_finish_access(picture->pDrawable); } /* * Make a GC ready to use with fb. This just * means making sure the appropriate fill pixmap is * in CPU memory again */ Bool glamor_prepare_access_gc(GCPtr gc) { switch (gc->fillStyle) { case FillTiled: return glamor_prepare_access(&gc->tile.pixmap->drawable, GLAMOR_ACCESS_RO); case FillStippled: case FillOpaqueStippled: return glamor_prepare_access(&gc->stipple->drawable, GLAMOR_ACCESS_RO); } return TRUE; } /* * Free any temporary CPU pixmaps for the GC */ void glamor_finish_access_gc(GCPtr gc) { switch (gc->fillStyle) { case FillTiled: glamor_finish_access(&gc->tile.pixmap->drawable); break; case FillStippled: case FillOpaqueStippled: glamor_finish_access(&gc->stipple->drawable); break; } } xorg-server-1.17.1/glamor/glamor_font.h0000664000175100017510000000325412424353351014760 00000000000000/* * Copyright © 2014 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. */ #ifndef _GLAMOR_FONT_H_ #define _GLAMOR_FONT_H_ typedef struct { Bool realized; CharInfoPtr default_char; CARD8 default_row; CARD8 default_col; GLuint texture_id; CARD16 glyph_width_bytes; CARD16 glyph_width_pixels; CARD16 glyph_height; } glamor_font_t; glamor_font_t * glamor_font_get(ScreenPtr screen, FontPtr font); Bool glamor_font_init(ScreenPtr screen); void glamor_fini_glyph_shader(ScreenPtr screen); #endif /* _GLAMOR_FONT_H_ */ xorg-server-1.17.1/glamor/Makefile.am0000664000175100017510000000205212433525530014327 00000000000000noinst_LTLIBRARIES = libglamor.la libglamor_egl_stubs.la libglamor_la_LIBADD = $(GLAMOR_LIBS) AM_CFLAGS = $(CWARNFLAGS) $(DIX_CFLAGS) $(GLAMOR_CFLAGS) libglamor_la_SOURCES = \ glamor.c \ glamor_context.h \ glamor_copy.c \ glamor_core.c \ glamor_dash.c \ glamor_debug.h \ glamor_font.c \ glamor_font.h \ glamor_glx.c \ glamor_glyphs.c \ glamor_image.c \ glamor_lines.c \ glamor_segs.c \ glamor_render.c \ glamor_gradient.c \ glamor_prepare.c \ glamor_prepare.h \ glamor_program.c \ glamor_program.h \ glamor_rects.c \ glamor_spans.c \ glamor_text.c \ glamor_transfer.c \ glamor_transfer.h \ glamor_transform.c \ glamor_transform.h \ glamor_trapezoid.c \ glamor_triangles.c\ glamor_addtraps.c\ glamor_glyphblt.c\ glamor_points.c\ glamor_priv.h\ glamor_pixmap.c\ glamor_largepixmap.c\ glamor_picture.c\ glamor_vbo.c \ glamor_window.c\ glamor_fbo.c\ glamor_compositerects.c\ glamor_utils.c\ glamor_utils.h\ glamor_xv.c \ glamor_sync.c \ glamor.h libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c sdk_HEADERS = glamor.h xorg-server-1.17.1/glamor/glamor_utils.h0000664000175100017510000013143312460362577015165 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #ifndef GLAMOR_PRIV_H #error This file can only be included by glamor_priv.h #endif #ifndef __GLAMOR_UTILS_H__ #define __GLAMOR_UTILS_H__ #include "glamor_prepare.h" #define v_from_x_coord_x(_xscale_, _x_) ( 2 * (_x_) * (_xscale_) - 1.0) #define v_from_x_coord_y(_yscale_, _y_) (-2 * (_y_) * (_yscale_) + 1.0) #define v_from_x_coord_y_inverted(_yscale_, _y_) (2 * (_y_) * (_yscale_) - 1.0) #define t_from_x_coord_x(_xscale_, _x_) ((_x_) * (_xscale_)) #define t_from_x_coord_y(_yscale_, _y_) (1.0 - (_y_) * (_yscale_)) #define t_from_x_coord_y_inverted(_yscale_, _y_) ((_y_) * (_yscale_)) #define pixmap_priv_get_dest_scale(_pixmap_priv_, _pxscale_, _pyscale_) \ do { \ int _w_,_h_; \ PIXMAP_PRIV_GET_ACTUAL_SIZE(_pixmap_priv_, _w_, _h_); \ *(_pxscale_) = 1.0 / _w_; \ *(_pyscale_) = 1.0 / _h_; \ } while(0) #define pixmap_priv_get_scale(_pixmap_priv_, _pxscale_, _pyscale_) \ do { \ *(_pxscale_) = 1.0 / (_pixmap_priv_)->base.fbo->width; \ *(_pyscale_) = 1.0 / (_pixmap_priv_)->base.fbo->height; \ } while(0) #define GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE(priv) \ (priv->base.fbo->width != priv->base.pixmap->drawable.width \ || priv->base.fbo->height != priv->base.pixmap->drawable.height) \ #define PIXMAP_PRIV_GET_ACTUAL_SIZE(priv, w, h) \ do { \ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \ w = priv->large.box.x2 - priv->large.box.x1; \ h = priv->large.box.y2 - priv->large.box.y1; \ } else { \ w = priv->base.pixmap->drawable.width; \ h = priv->base.pixmap->drawable.height; \ } \ } while(0) #define glamor_pixmap_fbo_fix_wh_ratio(wh, priv) \ do { \ int actual_w, actual_h; \ PIXMAP_PRIV_GET_ACTUAL_SIZE(priv, actual_w, actual_h); \ wh[0] = (float)priv->base.fbo->width / actual_w; \ wh[1] = (float)priv->base.fbo->height / actual_h; \ wh[2] = 1.0 / priv->base.fbo->width; \ wh[3] = 1.0 / priv->base.fbo->height; \ } while(0) #define pixmap_priv_get_fbo_off(_priv_, _xoff_, _yoff_) \ do { \ if (_X_UNLIKELY(_priv_ && (_priv_)->type == GLAMOR_TEXTURE_LARGE)) { \ *(_xoff_) = - (_priv_)->large.box.x1; \ *(_yoff_) = - (_priv_)->large.box.y1; \ } else { \ *(_xoff_) = 0; \ *(_yoff_) = 0; \ } \ } while(0) #define xFixedToFloat(_val_) ((float)xFixedToInt(_val_) \ + ((float)xFixedFrac(_val_) / 65536.0)) #define glamor_picture_get_matrixf(_picture_, _matrix_) \ do { \ int _i_; \ if ((_picture_)->transform) \ { \ for(_i_ = 0; _i_ < 3; _i_++) \ { \ (_matrix_)[_i_ * 3 + 0] = \ xFixedToFloat((_picture_)->transform->matrix[_i_][0]); \ (_matrix_)[_i_ * 3 + 1] = \ xFixedToFloat((_picture_)->transform->matrix[_i_][1]); \ (_matrix_)[_i_ * 3 + 2] = \ xFixedToFloat((_picture_)->transform->matrix[_i_][2]); \ } \ } \ } while(0) #define fmod(x, w) (x - w * floor((float)x/w)) #define fmodulus(x, w, c) do {c = fmod(x, w); \ c = c >= 0 ? c : c + w;} \ while(0) /* @x: is current coord * @x2: is the right/bottom edge * @w: is current width or height * @odd: is output value, 0 means we are in an even region, 1 means we are in a * odd region. * @c: is output value, equal to x mod w. */ #define fodd_repeat_mod(x, x2, w, odd, c) \ do { \ float shift; \ fmodulus((x), w, c); \ shift = fabs((x) - (c)); \ shift = floor(fabs(round(shift)) / w); \ odd = (int)shift & 1; \ if (odd && (((x2 % w) == 0) && \ round(fabs(x)) == x2)) \ odd = 0; \ } while(0) /* @txy: output value, is the corrected coords. * @xy: input coords to be fixed up. * @cd: xy mod wh, is a input value. * @wh: current width or height. * @bxy1,bxy2: current box edge's x1/x2 or y1/y2 * * case 1: * ---------- * | * | * | | * ---------- * tx = (c - x1) mod w * * case 2: * --------- * * | | * | | * --------- * tx = - (c - (x1 mod w)) * * case 3: * * ---------- * | | * * | | * ---------- * tx = ((x2 mod x) - c) + (x2 - x1) **/ #define __glamor_repeat_reflect_fixup(txy, xy, \ cd, wh, bxy1, bxy2) \ do { \ cd = wh - cd; \ if ( xy >= bxy1 && xy < bxy2) { \ cd = cd - bxy1; \ fmodulus(cd, wh, txy); \ } else if (xy < bxy1) { \ float bxy1_mod; \ fmodulus(bxy1, wh, bxy1_mod); \ txy = -(cd - bxy1_mod); \ } \ else if (xy >= bxy2) { \ float bxy2_mod; \ fmodulus(bxy2, wh, bxy2_mod); \ if (bxy2_mod == 0) \ bxy2_mod = wh; \ txy = (bxy2_mod - cd) + bxy2 - bxy1; \ } else {assert(0); txy = 0;} \ } while(0) #define _glamor_repeat_reflect_fixup(txy, xy, cd, odd, \ wh, bxy1, bxy2) \ do { \ if (odd) { \ __glamor_repeat_reflect_fixup(txy, xy, \ cd, wh, bxy1, bxy2); \ } else \ txy = xy - bxy1; \ } while(0) #define _glamor_get_reflect_transform_coords(priv, repeat_type, \ tx1, ty1, \ _x1_, _y1_) \ do { \ int odd_x, odd_y; \ float c, d; \ fodd_repeat_mod(_x1_,priv->box.x2, \ priv->base.pixmap->drawable.width, \ odd_x, c); \ fodd_repeat_mod(_y1_, priv->box.y2, \ priv->base.pixmap->drawable.height, \ odd_y, d); \ DEBUGF("c %f d %f oddx %d oddy %d \n", \ c, d, odd_x, odd_y); \ DEBUGF("x2 %d x1 %d fbo->width %d \n", priv->box.x2, \ priv->box.x1, priv->base.fbo->width); \ DEBUGF("y2 %d y1 %d fbo->height %d \n", priv->box.y2, \ priv->box.y1, priv->base.fbo->height); \ _glamor_repeat_reflect_fixup(tx1, _x1_, c, odd_x, \ priv->base.pixmap->drawable.width, \ priv->box.x1, priv->box.x2); \ _glamor_repeat_reflect_fixup(ty1, _y1_, d, odd_y, \ priv->base.pixmap->drawable.height, \ priv->box.y1, priv->box.y2); \ } while(0) #define _glamor_get_repeat_coords(priv, repeat_type, tx1, \ ty1, tx2, ty2, \ _x1_, _y1_, _x2_, \ _y2_, c, d, odd_x, odd_y) \ do { \ if (repeat_type == RepeatReflect) { \ DEBUGF("x1 y1 %d %d\n", \ _x1_, _y1_ ); \ DEBUGF("width %d box.x1 %d \n", \ (priv)->base.pixmap->drawable.width, \ priv->box.x1); \ if (odd_x) { \ c = (priv)->base.pixmap->drawable.width \ - c; \ tx1 = c - priv->box.x1; \ tx2 = tx1 - ((_x2_) - (_x1_)); \ } else { \ tx1 = c - priv->box.x1; \ tx2 = tx1 + ((_x2_) - (_x1_)); \ } \ if (odd_y){ \ d = (priv)->base.pixmap->drawable.height\ - d; \ ty1 = d - priv->box.y1; \ ty2 = ty1 - ((_y2_) - (_y1_)); \ } else { \ ty1 = d - priv->box.y1; \ ty2 = ty1 + ((_y2_) - (_y1_)); \ } \ } else { /* RepeatNormal*/ \ tx1 = (c - priv->box.x1); \ ty1 = (d - priv->box.y1); \ tx2 = tx1 + ((_x2_) - (_x1_)); \ ty2 = ty1 + ((_y2_) - (_y1_)); \ } \ } while(0) /* _x1_ ... _y2_ may has fractional. */ #define glamor_get_repeat_transform_coords(priv, repeat_type, tx1, \ ty1, _x1_, _y1_) \ do { \ DEBUGF("width %d box.x1 %d x2 %d y1 %d y2 %d\n", \ (priv)->base.pixmap->drawable.width, \ priv->box.x1, priv->box.x2, priv->box.y1, \ priv->box.y2); \ DEBUGF("x1 %f y1 %f \n", _x1_, _y1_); \ if (repeat_type != RepeatReflect) { \ tx1 = _x1_ - priv->box.x1; \ ty1 = _y1_ - priv->box.y1; \ } else \ _glamor_get_reflect_transform_coords(priv, repeat_type, \ tx1, ty1, \ _x1_, _y1_); \ DEBUGF("tx1 %f ty1 %f \n", tx1, ty1); \ } while(0) /* _x1_ ... _y2_ must be integer. */ #define glamor_get_repeat_coords(priv, repeat_type, tx1, \ ty1, tx2, ty2, _x1_, _y1_, _x2_, \ _y2_) \ do { \ int c, d; \ int odd_x = 0, odd_y = 0; \ DEBUGF("width %d box.x1 %d x2 %d y1 %d y2 %d\n", \ (priv)->base.pixmap->drawable.width, \ priv->box.x1, priv->box.x2, \ priv->box.y1, priv->box.y2); \ modulus((_x1_), (priv)->base.pixmap->drawable.width, c); \ modulus((_y1_), (priv)->base.pixmap->drawable.height, d); \ DEBUGF("c %d d %d \n", c, d); \ if (repeat_type == RepeatReflect) { \ odd_x = abs((_x1_ - c) \ / (priv->base.pixmap->drawable.width)) & 1; \ odd_y = abs((_y1_ - d) \ / (priv->base.pixmap->drawable.height)) & 1; \ } \ _glamor_get_repeat_coords(priv, repeat_type, tx1, ty1, tx2, ty2,\ _x1_, _y1_, _x2_, _y2_, c, d, \ odd_x, odd_y); \ } while(0) #define glamor_transform_point(matrix, tx, ty, x, y) \ do { \ int _i_; \ float _result_[4]; \ for (_i_ = 0; _i_ < 3; _i_++) { \ _result_[_i_] = (matrix)[_i_ * 3] * (x) + (matrix)[_i_ * 3 + 1] * (y) \ + (matrix)[_i_ * 3 + 2]; \ } \ tx = _result_[0] / _result_[2]; \ ty = _result_[1] / _result_[2]; \ } while(0) #define _glamor_set_normalize_tpoint(xscale, yscale, _tx_, _ty_, \ texcoord) \ do { \ (texcoord)[0] = t_from_x_coord_x(xscale, _tx_); \ (texcoord)[1] = t_from_x_coord_y_inverted(yscale, _ty_); \ DEBUGF("normalized point tx %f ty %f \n", (texcoord)[0], \ (texcoord)[1]); \ } while(0) #define glamor_set_transformed_point(priv, matrix, xscale, \ yscale, texcoord, \ x, y) \ do { \ float tx, ty; \ int fbo_x_off, fbo_y_off; \ pixmap_priv_get_fbo_off(priv, &fbo_x_off, &fbo_y_off); \ glamor_transform_point(matrix, tx, ty, x, y); \ DEBUGF("tx %f ty %f fbooff %d %d \n", \ tx, ty, fbo_x_off, fbo_y_off); \ \ tx += fbo_x_off; \ ty += fbo_y_off; \ (texcoord)[0] = t_from_x_coord_x(xscale, tx); \ (texcoord)[1] = t_from_x_coord_y_inverted(yscale, ty); \ DEBUGF("normalized tx %f ty %f \n", (texcoord)[0], (texcoord)[1]); \ } while(0) #define glamor_set_transformed_normalize_tri_tcoords(priv, \ matrix, \ xscale, \ yscale, \ vtx, \ texcoords) \ do { \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ texcoords, (vtx)[0], (vtx)[1]); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ texcoords+2, (vtx)[2], (vtx)[3]); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ texcoords+4, (vtx)[4], (vtx)[5]); \ } while (0) #define glamor_set_transformed_normalize_tcoords_ext( priv, \ matrix, \ xscale, \ yscale, \ tx1, ty1, tx2, ty2, \ texcoords, \ stride) \ do { \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ texcoords, tx1, ty1); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ texcoords + 1 * stride, tx2, ty1); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ texcoords + 2 * stride, tx2, ty2); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ texcoords + 3 * stride, tx1, ty2); \ } while (0) #define glamor_set_transformed_normalize_tcoords( priv, \ matrix, \ xscale, \ yscale, \ tx1, ty1, tx2, ty2, \ texcoords) \ do { \ glamor_set_transformed_normalize_tcoords_ext( priv, \ matrix, \ xscale, \ yscale, \ tx1, ty1, tx2, ty2, \ texcoords, \ 2); \ } while (0) #define glamor_set_normalize_tri_tcoords(xscale, \ yscale, \ vtx, \ texcoords) \ do { \ _glamor_set_normalize_tpoint(xscale, yscale, \ (vtx)[0], (vtx)[1], \ texcoords); \ _glamor_set_normalize_tpoint(xscale, yscale, \ (vtx)[2], (vtx)[3], \ texcoords+2); \ _glamor_set_normalize_tpoint(xscale, yscale, \ (vtx)[4], (vtx)[5], \ texcoords+4); \ } while (0) #define glamor_set_repeat_transformed_normalize_tcoords_ext( priv, \ repeat_type, \ matrix, \ xscale, \ yscale, \ _x1_, _y1_, \ _x2_, _y2_, \ texcoords, \ stride) \ do { \ if (_X_LIKELY(priv->type != GLAMOR_TEXTURE_LARGE)) { \ glamor_set_transformed_normalize_tcoords_ext(priv, matrix, xscale, \ yscale, _x1_, _y1_, \ _x2_, _y2_, \ texcoords, stride); \ } else { \ float tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4; \ float ttx1, tty1, ttx2, tty2, ttx3, tty3, ttx4, tty4; \ DEBUGF("original coords %d %d %d %d\n", _x1_, _y1_, _x2_, _y2_); \ glamor_transform_point(matrix, tx1, ty1, _x1_, _y1_); \ glamor_transform_point(matrix, tx2, ty2, _x2_, _y1_); \ glamor_transform_point(matrix, tx3, ty3, _x2_, _y2_); \ glamor_transform_point(matrix, tx4, ty4, _x1_, _y2_); \ DEBUGF("transformed %f %f %f %f %f %f %f %f\n", \ tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4); \ glamor_get_repeat_transform_coords((&priv->large), repeat_type, \ ttx1, tty1, \ tx1, ty1); \ glamor_get_repeat_transform_coords((&priv->large), repeat_type, \ ttx2, tty2, \ tx2, ty2); \ glamor_get_repeat_transform_coords((&priv->large), repeat_type, \ ttx3, tty3, \ tx3, ty3); \ glamor_get_repeat_transform_coords((&priv->large), repeat_type, \ ttx4, tty4, \ tx4, ty4); \ DEBUGF("repeat transformed %f %f %f %f %f %f %f %f\n", ttx1, tty1, \ ttx2, tty2, ttx3, tty3, ttx4, tty4); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx1, tty1, \ texcoords); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx2, tty2, \ texcoords + 1 * stride); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx3, tty3, \ texcoords + 2 * stride); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx4, tty4, \ texcoords + 3 * stride); \ } \ } while (0) #define glamor_set_repeat_transformed_normalize_tcoords( priv, \ repeat_type, \ matrix, \ xscale, \ yscale, \ _x1_, _y1_, \ _x2_, _y2_, \ texcoords) \ do { \ glamor_set_repeat_transformed_normalize_tcoords_ext( priv, \ repeat_type, \ matrix, \ xscale, \ yscale, \ _x1_, _y1_, \ _x2_, _y2_, \ texcoords, \ 2); \ } while (0) #define _glamor_set_normalize_tcoords(xscale, yscale, tx1, \ ty1, tx2, ty2, \ vertices, stride) \ do { \ /* vertices may be write-only, so we use following \ * temporary variable. */ \ float _t0_, _t1_, _t2_, _t5_; \ (vertices)[0] = _t0_ = t_from_x_coord_x(xscale, tx1); \ (vertices)[1 * stride] = _t2_ = t_from_x_coord_x(xscale, tx2); \ (vertices)[2 * stride] = _t2_; \ (vertices)[3 * stride] = _t0_; \ (vertices)[1] = _t1_ = t_from_x_coord_y_inverted(yscale, ty1); \ (vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y_inverted(yscale, ty2); \ (vertices)[1 * stride + 1] = _t1_; \ (vertices)[3 * stride + 1] = _t5_; \ } while(0) #define glamor_set_normalize_tcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ vertices, stride) \ do { \ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \ float tx1, tx2, ty1, ty2; \ int fbo_x_off, fbo_y_off; \ pixmap_priv_get_fbo_off(priv, &fbo_x_off, &fbo_y_off); \ tx1 = x1 + fbo_x_off; \ tx2 = x2 + fbo_x_off; \ ty1 = y1 + fbo_y_off; \ ty2 = y2 + fbo_y_off; \ _glamor_set_normalize_tcoords(xscale, yscale, tx1, ty1, \ tx2, ty2, vertices, \ stride); \ } else \ _glamor_set_normalize_tcoords(xscale, yscale, x1, y1, \ x2, y2, vertices, stride); \ } while(0) #define glamor_set_normalize_tcoords(priv, xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ do { \ glamor_set_normalize_tcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ vertices, 2); \ } while(0) #define glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ vertices, stride) \ do { \ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \ float tx1, tx2, ty1, ty2; \ if (repeat_type == RepeatPad) { \ tx1 = _x1_ - priv->large.box.x1; \ ty1 = _y1_ - priv->large.box.y1; \ tx2 = tx1 + ((_x2_) - (_x1_)); \ ty2 = ty1 + ((_y2_) - (_y1_)); \ } else { \ glamor_get_repeat_coords((&priv->large), repeat_type, \ tx1, ty1, tx2, ty2, \ _x1_, _y1_, _x2_, _y2_); \ } \ _glamor_set_normalize_tcoords(xscale, yscale, tx1, ty1, \ tx2, ty2, vertices, \ stride); \ } else \ _glamor_set_normalize_tcoords(xscale, yscale, _x1_, _y1_, \ _x2_, _y2_, vertices, \ stride); \ } while(0) #define glamor_set_repeat_normalize_tcoords(priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ vertices) \ do { \ glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ vertices, 2); \ } while(0) #define glamor_set_normalize_tcoords_tri_stripe(xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ do { \ (vertices)[0] = t_from_x_coord_x(xscale, x1); \ (vertices)[2] = t_from_x_coord_x(xscale, x2); \ (vertices)[6] = (vertices)[2]; \ (vertices)[4] = (vertices)[0]; \ (vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \ (vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[5] = (vertices)[7]; \ } while(0) #define glamor_set_tcoords(x1, y1, x2, y2, vertices) \ do { \ (vertices)[0] = (x1); \ (vertices)[2] = (x2); \ (vertices)[4] = (vertices)[2]; \ (vertices)[6] = (vertices)[0]; \ (vertices)[1] = (y1); \ (vertices)[5] = (y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[7] = (vertices)[5]; \ } while(0) #define glamor_set_tcoords_ext(x1, y1, x2, y2, vertices, stride) \ do { \ (vertices)[0] = (x1); \ (vertices)[1*stride] = (x2); \ (vertices)[2*stride] = (vertices)[1*stride]; \ (vertices)[3*stride] = (vertices)[0]; \ (vertices)[1] = (y1); \ (vertices)[2*stride + 1] = (y2); \ (vertices)[1*stride + 1] = (vertices)[1]; \ (vertices)[3*stride + 1] = (vertices)[2*stride + 1]; \ } while(0) #define glamor_set_normalize_one_vcoord(xscale, yscale, x, y, \ vertices) \ do { \ (vertices)[0] = v_from_x_coord_x(xscale, x); \ (vertices)[1] = v_from_x_coord_y_inverted(yscale, y); \ } while(0) #define glamor_set_normalize_tri_vcoords(xscale, yscale, vtx, \ vertices) \ do { \ glamor_set_normalize_one_vcoord(xscale, yscale, \ (vtx)[0], (vtx)[1], \ vertices); \ glamor_set_normalize_one_vcoord(xscale, yscale, \ (vtx)[2], (vtx)[3], \ vertices+2); \ glamor_set_normalize_one_vcoord(xscale, yscale, \ (vtx)[4], (vtx)[5], \ vertices+4); \ } while(0) #define glamor_set_tcoords_tri_strip(x1, y1, x2, y2, vertices) \ do { \ (vertices)[0] = (x1); \ (vertices)[2] = (x2); \ (vertices)[6] = (vertices)[2]; \ (vertices)[4] = (vertices)[0]; \ (vertices)[1] = (y1); \ (vertices)[7] = (y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[5] = (vertices)[7]; \ } while(0) #define glamor_set_normalize_vcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ vertices, stride) \ do { \ int fbo_x_off, fbo_y_off; \ /* vertices may be write-only, so we use following \ * temporary variable. */ \ float _t0_, _t1_, _t2_, _t5_; \ pixmap_priv_get_fbo_off(priv, &fbo_x_off, &fbo_y_off); \ (vertices)[0] = _t0_ = v_from_x_coord_x(xscale, x1 + fbo_x_off); \ (vertices)[1 * stride] = _t2_ = v_from_x_coord_x(xscale, \ x2 + fbo_x_off); \ (vertices)[2 * stride] = _t2_; \ (vertices)[3 * stride] = _t0_; \ (vertices)[1] = _t1_ = v_from_x_coord_y_inverted(yscale, \ y1 + fbo_y_off); \ (vertices)[2 * stride + 1] = _t5_ = \ v_from_x_coord_y_inverted(yscale, \ y2 + fbo_y_off); \ (vertices)[1 * stride + 1] = _t1_; \ (vertices)[3 * stride + 1] = _t5_; \ } while(0) #define glamor_set_normalize_vcoords(priv, xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ do { \ glamor_set_normalize_vcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ vertices, 2); \ } while(0) #define glamor_set_const_ext(params, nparam, vertices, nverts, stride) \ do { \ int _i_ = 0, _j_ = 0; \ for(; _i_ < nverts; _i_++) { \ for(_j_ = 0; _j_ < nparam; _j_++) { \ vertices[stride*_i_ + _j_] = params[_j_]; \ } \ } \ } while(0) #define glamor_set_normalize_vcoords_tri_strip(xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ do { \ (vertices)[0] = v_from_x_coord_x(xscale, x1); \ (vertices)[2] = v_from_x_coord_x(xscale, x2); \ (vertices)[6] = (vertices)[2]; \ (vertices)[4] = (vertices)[0]; \ (vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \ (vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[5] = (vertices)[7]; \ } while(0) #define glamor_set_normalize_pt(xscale, yscale, x, y, \ pt) \ do { \ (pt)[0] = t_from_x_coord_x(xscale, x); \ (pt)[1] = t_from_x_coord_y_inverted(yscale, y); \ } while(0) #define glamor_set_circle_centre(width, height, x, y, \ c) \ do { \ (c)[0] = (float)x; \ (c)[1] = (float)y; \ } while(0) inline static void glamor_calculate_boxes_bound(BoxPtr bound, BoxPtr boxes, int nbox) { int x_min, y_min; int x_max, y_max; int i; x_min = y_min = MAXSHORT; x_max = y_max = MINSHORT; for (i = 0; i < nbox; i++) { if (x_min > boxes[i].x1) x_min = boxes[i].x1; if (y_min > boxes[i].y1) y_min = boxes[i].y1; if (x_max < boxes[i].x2) x_max = boxes[i].x2; if (y_max < boxes[i].y2) y_max = boxes[i].y2; } bound->x1 = x_min; bound->y1 = y_min; bound->x2 = x_max; bound->y2 = y_max; } inline static void glamor_translate_boxes(BoxPtr boxes, int nbox, int dx, int dy) { int i; for (i = 0; i < nbox; i++) { boxes[i].x1 += dx; boxes[i].y1 += dy; boxes[i].x2 += dx; boxes[i].y2 += dy; } } #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #endif #define ALIGN(i,m) (((i) + (m) - 1) & ~((m) - 1)) #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define glamor_check_fbo_size(_glamor_,_w_, _h_) ((_w_) > 0 && (_h_) > 0 \ && (_w_) <= _glamor_->max_fbo_size \ && (_h_) <= _glamor_->max_fbo_size) /* For 1bpp pixmap, we don't store it as texture. */ #define glamor_check_pixmap_fbo_depth(_depth_) ( \ _depth_ == 8 \ || _depth_ == 15 \ || _depth_ == 16 \ || _depth_ == 24 \ || _depth_ == 30 \ || _depth_ == 32) #define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv && pixmap_priv->base.is_picture == 1) #define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv && pixmap_priv->base.gl_fbo == GLAMOR_FBO_NORMAL) #define GLAMOR_PIXMAP_PRIV_HAS_FBO_DOWNLOADED(pixmap_priv) (pixmap_priv && (pixmap_priv->base.gl_fbo == GLAMOR_FBO_DOWNLOADED)) /** * Borrow from uxa. */ static inline CARD32 format_for_depth(int depth) { switch (depth) { case 1: return PICT_a1; case 4: return PICT_a4; case 8: return PICT_a8; case 15: return PICT_x1r5g5b5; case 16: return PICT_r5g6b5; default: case 24: return PICT_x8r8g8b8; #if XORG_VERSION_CURRENT >= 10699900 case 30: return PICT_x2r10g10b10; #endif case 32: return PICT_a8r8g8b8; } } static inline GLenum gl_iformat_for_pixmap(PixmapPtr pixmap) { glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && (pixmap->drawable.depth == 1 || pixmap->drawable.depth == 8)) { return GL_ALPHA; } else { return GL_RGBA; } } static inline CARD32 format_for_pixmap(PixmapPtr pixmap) { glamor_pixmap_private *pixmap_priv; PictFormatShort pict_format; pixmap_priv = glamor_get_pixmap_private(pixmap); if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv)) pict_format = pixmap_priv->base.picture->format; else pict_format = format_for_depth(pixmap->drawable.depth); return pict_format; } #define REVERT_NONE 0 #define REVERT_NORMAL 1 #define REVERT_DOWNLOADING_A1 2 #define REVERT_UPLOADING_A1 3 #define REVERT_DOWNLOADING_2_10_10_10 4 #define REVERT_UPLOADING_2_10_10_10 5 #define REVERT_DOWNLOADING_1_5_5_5 7 #define REVERT_UPLOADING_1_5_5_5 8 #define REVERT_DOWNLOADING_10_10_10_2 9 #define REVERT_UPLOADING_10_10_10_2 10 #define SWAP_NONE_DOWNLOADING 0 #define SWAP_DOWNLOADING 1 #define SWAP_UPLOADING 2 #define SWAP_NONE_UPLOADING 3 inline static int cache_format(GLenum format) { switch (format) { case GL_ALPHA: return 2; case GL_RGB: return 1; case GL_RGBA: return 0; default: return -1; } } /* borrowed from uxa */ static inline Bool glamor_get_rgba_from_pixel(CARD32 pixel, float *red, float *green, float *blue, float *alpha, CARD32 format) { int rbits, bbits, gbits, abits; int rshift, bshift, gshift, ashift; 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_A) { rshift = gshift = bshift = ashift = 0; } else 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; #if XORG_VERSION_CURRENT >= 10699900 } else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) { ashift = 0; rshift = abits; if (abits == 0) rshift = PICT_FORMAT_BPP(format) - (rbits + gbits + bbits); gshift = rshift + rbits; bshift = gshift + gbits; #endif } else { return FALSE; } #define COLOR_INT_TO_FLOAT(_fc_, _p_, _s_, _bits_) \ *_fc_ = (((_p_) >> (_s_)) & (( 1 << (_bits_)) - 1)) \ / (float)((1<<(_bits_)) - 1) if (rbits) COLOR_INT_TO_FLOAT(red, pixel, rshift, rbits); else *red = 0; if (gbits) COLOR_INT_TO_FLOAT(green, pixel, gshift, gbits); else *green = 0; if (bbits) COLOR_INT_TO_FLOAT(blue, pixel, bshift, bbits); else *blue = 0; if (abits) COLOR_INT_TO_FLOAT(alpha, pixel, ashift, abits); else *alpha = 1; return TRUE; } inline static Bool glamor_pict_format_is_compatible(PicturePtr picture) { GLenum iformat; PixmapPtr pixmap = glamor_get_drawable_pixmap(picture->pDrawable); iformat = gl_iformat_for_pixmap(pixmap); switch (iformat) { case GL_RGBA: return (picture->format == PICT_a8r8g8b8 || picture->format == PICT_x8r8g8b8); case GL_ALPHA: return (picture->format == PICT_a8); default: return FALSE; } } /* return TRUE if we can access this pixmap at DDX driver. */ inline static Bool glamor_ddx_fallback_check_pixmap(DrawablePtr drawable) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); return (!pixmap_priv || (pixmap_priv->type == GLAMOR_TEXTURE_DRM || pixmap_priv->type == GLAMOR_MEMORY || pixmap_priv->type == GLAMOR_DRM_ONLY)); } inline static Bool glamor_ddx_fallback_check_gc(GCPtr gc) { PixmapPtr pixmap; if (!gc) return TRUE; switch (gc->fillStyle) { case FillStippled: case FillOpaqueStippled: pixmap = gc->stipple; break; case FillTiled: pixmap = gc->tile.pixmap; break; default: pixmap = NULL; } return (!pixmap || glamor_ddx_fallback_check_pixmap(&pixmap->drawable)); } inline static Bool glamor_is_large_pixmap(PixmapPtr pixmap) { glamor_pixmap_private *priv; priv = glamor_get_pixmap_private(pixmap); return (priv->type == GLAMOR_TEXTURE_LARGE); } inline static Bool glamor_is_large_picture(PicturePtr picture) { PixmapPtr pixmap; if (picture->pDrawable) { pixmap = glamor_get_drawable_pixmap(picture->pDrawable); return glamor_is_large_pixmap(pixmap); } return FALSE; } inline static Bool glamor_tex_format_is_readable(GLenum format) { return ((format == GL_RGBA || format == GL_RGB || format == GL_ALPHA)); } static inline void _glamor_dump_pixmap_bits(PixmapPtr pixmap, int x, int y, int w, int h) { int i, j; unsigned char *p = pixmap->devPrivate.ptr; int stride = pixmap->devKind; p = p + y * stride + x; for (i = 0; i < h; i++) { ErrorF("line %3d: ", i); for (j = 0; j < w; j++) ErrorF("%2d ", (p[j / 8] & (1 << (j % 8))) >> (j % 8)); p += stride; ErrorF("\n"); } } static inline void _glamor_dump_pixmap_byte(PixmapPtr pixmap, int x, int y, int w, int h) { int i, j; unsigned char *p = pixmap->devPrivate.ptr; int stride = pixmap->devKind; p = p + y * stride + x; for (i = 0; i < h; i++) { ErrorF("line %3d: ", i); for (j = 0; j < w; j++) ErrorF("%2x ", p[j]); p += stride; ErrorF("\n"); } } static inline void _glamor_dump_pixmap_sword(PixmapPtr pixmap, int x, int y, int w, int h) { int i, j; unsigned short *p = pixmap->devPrivate.ptr; int stride = pixmap->devKind / 2; p = p + y * stride + x; for (i = 0; i < h; i++) { ErrorF("line %3d: ", i); for (j = 0; j < w; j++) ErrorF("%2x ", p[j]); p += stride; ErrorF("\n"); } } static inline void _glamor_dump_pixmap_word(PixmapPtr pixmap, int x, int y, int w, int h) { int i, j; unsigned int *p = pixmap->devPrivate.ptr; int stride = pixmap->devKind / 4; p = p + y * stride + x; for (i = 0; i < h; i++) { ErrorF("line %3d: ", i); for (j = 0; j < w; j++) ErrorF("%2x ", p[j]); p += stride; ErrorF("\n"); } } static inline void glamor_dump_pixmap(PixmapPtr pixmap, int x, int y, int w, int h) { w = ((x + w) > pixmap->drawable.width) ? (pixmap->drawable.width - x) : w; h = ((y + h) > pixmap->drawable.height) ? (pixmap->drawable.height - y) : h; glamor_prepare_access(&pixmap->drawable, GLAMOR_ACCESS_RO); switch (pixmap->drawable.depth) { case 8: _glamor_dump_pixmap_byte(pixmap, x, y, w, h); break; case 15: case 16: _glamor_dump_pixmap_sword(pixmap, x, y, w, h); break; case 24: case 32: _glamor_dump_pixmap_word(pixmap, x, y, w, h); break; case 1: _glamor_dump_pixmap_bits(pixmap, x, y, w, h); break; default: ErrorF("dump depth %d, not implemented.\n", pixmap->drawable.depth); } glamor_finish_access(&pixmap->drawable); } static inline void _glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2, int x, int y, int w, int h, PictFormatShort short_format, int all, int diffs) { int i, j; unsigned char *p1 = pixmap1->devPrivate.ptr; unsigned char *p2 = pixmap2->devPrivate.ptr; int line_need_printed = 0; int test_code = 0xAABBCCDD; int little_endian = 0; unsigned char *p_test; int bpp = pixmap1->drawable.depth == 8 ? 1 : 4; int stride = pixmap1->devKind; assert(pixmap1->devKind == pixmap2->devKind); ErrorF("stride:%d, width:%d, height:%d\n", stride, w, h); p1 = p1 + y * stride + x; p2 = p2 + y * stride + x; if (all) { for (i = 0; i < h; i++) { ErrorF("line %3d: ", i); for (j = 0; j < stride; j++) { if (j % bpp == 0) ErrorF("[%d]%2x:%2x ", j / bpp, p1[j], p2[j]); else ErrorF("%2x:%2x ", p1[j], p2[j]); } p1 += stride; p2 += stride; ErrorF("\n"); } } else { if (short_format == PICT_a8r8g8b8) { p_test = (unsigned char *) &test_code; little_endian = (*p_test == 0xDD); bpp = 4; for (i = 0; i < h; i++) { line_need_printed = 0; for (j = 0; j < stride; j++) { if (p1[j] != p2[j] && (p1[j] - p2[j] > diffs || p2[j] - p1[j] > diffs)) { if (line_need_printed) { if (little_endian) { switch (j % 4) { case 2: ErrorF("[%d]RED:%2x:%2x ", j / bpp, p1[j], p2[j]); break; case 1: ErrorF("[%d]GREEN:%2x:%2x ", j / bpp, p1[j], p2[j]); break; case 0: ErrorF("[%d]BLUE:%2x:%2x ", j / bpp, p1[j], p2[j]); break; case 3: ErrorF("[%d]Alpha:%2x:%2x ", j / bpp, p1[j], p2[j]); break; } } else { switch (j % 4) { case 1: ErrorF("[%d]RED:%2x:%2x ", j / bpp, p1[j], p2[j]); break; case 2: ErrorF("[%d]GREEN:%2x:%2x ", j / bpp, p1[j], p2[j]); break; case 3: ErrorF("[%d]BLUE:%2x:%2x ", j / bpp, p1[j], p2[j]); break; case 0: ErrorF("[%d]Alpha:%2x:%2x ", j / bpp, p1[j], p2[j]); break; } } } else { line_need_printed = 1; j = -1; ErrorF("line %3d: ", i); continue; } } } p1 += stride; p2 += stride; ErrorF("\n"); } } //more format can be added here. else { // the default format, just print. for (i = 0; i < h; i++) { line_need_printed = 0; for (j = 0; j < stride; j++) { if (p1[j] != p2[j]) { if (line_need_printed) { ErrorF("[%d]%2x:%2x ", j / bpp, p1[j], p2[j]); } else { line_need_printed = 1; j = -1; ErrorF("line %3d: ", i); continue; } } } p1 += stride; p2 += stride; ErrorF("\n"); } } } } static inline void glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2, int x, int y, int w, int h, int all, int diffs) { assert(pixmap1->drawable.depth == pixmap2->drawable.depth); if (glamor_prepare_access(&pixmap1->drawable, GLAMOR_ACCESS_RO) && glamor_prepare_access(&pixmap2->drawable, GLAMOR_ACCESS_RO)) { _glamor_compare_pixmaps(pixmap1, pixmap2, x, y, w, h, -1, all, diffs); } glamor_finish_access(&pixmap1->drawable); glamor_finish_access(&pixmap2->drawable); } /* This function is used to compare two pictures. If the picture has no drawable, we use fb functions to generate it. */ static inline void glamor_compare_pictures(ScreenPtr screen, PicturePtr fst_picture, PicturePtr snd_picture, int x_source, int y_source, int width, int height, int all, int diffs) { PixmapPtr fst_pixmap; PixmapPtr snd_pixmap; int fst_generated, snd_generated; int error; int fst_type = -1; int snd_type = -1; // -1 represent has drawable. if (fst_picture->format != snd_picture->format) { ErrorF("Different picture format can not compare!\n"); return; } if (!fst_picture->pDrawable) { fst_type = fst_picture->pSourcePict->type; } if (!snd_picture->pDrawable) { snd_type = snd_picture->pSourcePict->type; } if ((fst_type != -1) && (snd_type != -1) && (fst_type != snd_type)) { ErrorF("Different picture type will never be same!\n"); return; } fst_generated = snd_generated = 0; if (!fst_picture->pDrawable) { PicturePtr pixman_pic; PixmapPtr pixmap = NULL; PictFormatShort format; format = fst_picture->format; pixmap = glamor_create_pixmap(screen, width, height, PIXMAN_FORMAT_DEPTH(format), GLAMOR_CREATE_PIXMAP_CPU); pixman_pic = CreatePicture(0, &pixmap->drawable, PictureMatchFormat(screen, PIXMAN_FORMAT_DEPTH (format), format), 0, 0, serverClient, &error); fbComposite(PictOpSrc, fst_picture, NULL, pixman_pic, x_source, y_source, 0, 0, 0, 0, width, height); glamor_destroy_pixmap(pixmap); fst_picture = pixman_pic; fst_generated = 1; } if (!snd_picture->pDrawable) { PicturePtr pixman_pic; PixmapPtr pixmap = NULL; PictFormatShort format; format = snd_picture->format; pixmap = glamor_create_pixmap(screen, width, height, PIXMAN_FORMAT_DEPTH(format), GLAMOR_CREATE_PIXMAP_CPU); pixman_pic = CreatePicture(0, &pixmap->drawable, PictureMatchFormat(screen, PIXMAN_FORMAT_DEPTH (format), format), 0, 0, serverClient, &error); fbComposite(PictOpSrc, snd_picture, NULL, pixman_pic, x_source, y_source, 0, 0, 0, 0, width, height); glamor_destroy_pixmap(pixmap); snd_picture = pixman_pic; snd_generated = 1; } fst_pixmap = glamor_get_drawable_pixmap(fst_picture->pDrawable); snd_pixmap = glamor_get_drawable_pixmap(snd_picture->pDrawable); if (fst_pixmap->drawable.depth != snd_pixmap->drawable.depth) { if (fst_generated) glamor_destroy_picture(fst_picture); if (snd_generated) glamor_destroy_picture(snd_picture); ErrorF("Different pixmap depth can not compare!\n"); return; } if ((fst_type == SourcePictTypeLinear) || (fst_type == SourcePictTypeRadial) || (fst_type == SourcePictTypeConical) || (snd_type == SourcePictTypeLinear) || (snd_type == SourcePictTypeRadial) || (snd_type == SourcePictTypeConical)) { x_source = y_source = 0; } if (glamor_prepare_access(&fst_pixmap->drawable, GLAMOR_ACCESS_RO) && glamor_prepare_access(&snd_pixmap->drawable, GLAMOR_ACCESS_RO)) { _glamor_compare_pixmaps(fst_pixmap, snd_pixmap, x_source, y_source, width, height, fst_picture->format, all, diffs); } glamor_finish_access(&fst_pixmap->drawable); glamor_finish_access(&snd_pixmap->drawable); if (fst_generated) glamor_destroy_picture(fst_picture); if (snd_generated) glamor_destroy_picture(snd_picture); return; } #ifdef __i386__ static inline unsigned long __fls(unsigned long x) { asm("bsr %1,%0":"=r"(x) : "rm"(x)); return x; } #else static inline unsigned long __fls(unsigned long x) { int n; if (x == 0) return (0); n = 0; if (x <= 0x0000FFFF) { n = n + 16; x = x << 16; } if (x <= 0x00FFFFFF) { n = n + 8; x = x << 8; } if (x <= 0x0FFFFFFF) { n = n + 4; x = x << 4; } if (x <= 0x3FFFFFFF) { n = n + 2; x = x << 2; } if (x <= 0x7FFFFFFF) { n = n + 1; } return 31 - n; } #endif static inline void glamor_make_current(glamor_screen_private *glamor_priv) { if (lastGLContext != &glamor_priv->ctx) { lastGLContext = &glamor_priv->ctx; glamor_priv->ctx.make_current(&glamor_priv->ctx); } } #endif xorg-server-1.17.1/glamor/glamor_glyphblt.c0000664000175100017510000002332112460362577015641 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #include "glamor_priv.h" #include #include "glamor_transform.h" static const glamor_facet glamor_facet_poly_glyph_blt = { .name = "poly_glyph_blt", .vs_vars = "attribute vec2 primitive;\n", .vs_exec = (" vec2 pos = vec2(0,0);\n" GLAMOR_POS(gl_Position, primitive)), }; static Bool glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, int start_x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyph_base) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; glamor_program *prog; RegionPtr clip = gc->pCompositeClip; int box_x, box_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; glamor_make_current(glamor_priv); prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_glyph_blt_progs, &glamor_facet_poly_glyph_blt); if (!prog) goto bail_ctx; glEnableVertexAttribArray(GLAMOR_VERTEX_POS); start_x += drawable->x; y += drawable->y; glamor_pixmap_loop(pixmap_priv, box_x, box_y) { int x; int n; int num_points, max_points; INT16 *points = NULL; int off_x, off_y; char *vbo_offset; glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE, prog->matrix_uniform, &off_x, &off_y); max_points = 500; num_points = 0; x = start_x; for (n = 0; n < nglyph; n++) { CharInfoPtr charinfo = ppci[n]; int w = GLYPHWIDTHPIXELS(charinfo); int h = GLYPHHEIGHTPIXELS(charinfo); uint8_t *glyphbits = FONTGLYPHBITS(NULL, charinfo); if (w && h) { int glyph_x = x + charinfo->metrics.leftSideBearing; int glyph_y = y - charinfo->metrics.ascent; int glyph_stride = GLYPHWIDTHBYTESPADDED(charinfo); int xx, yy; for (yy = 0; yy < h; yy++) { uint8_t *glyph = glyphbits; for (xx = 0; xx < w; glyph += ((xx&7) == 7), xx++) { int pt_x_i = glyph_x + xx; int pt_y_i = glyph_y + yy; if (!(*glyph & (1 << (xx & 7)))) continue; if (!RegionContainsPoint(clip, pt_x_i, pt_y_i, NULL)) continue; if (!num_points) { points = glamor_get_vbo_space(screen, max_points * (2 * sizeof (INT16)), &vbo_offset); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 0, vbo_offset); } *points++ = pt_x_i; *points++ = pt_y_i; num_points++; if (num_points == max_points) { glamor_put_vbo_space(screen); glDrawArrays(GL_POINTS, 0, num_points); num_points = 0; } } glyphbits += glyph_stride; } } x += charinfo->metrics.characterWidth; } if (num_points) { glamor_put_vbo_space(screen); glDrawArrays(GL_POINTS, 0, num_points); } } glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } void glamor_poly_glyph_blt(DrawablePtr drawable, GCPtr gc, int start_x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyph_base) { if (glamor_poly_glyph_blt_gl(drawable, gc, start_x, y, nglyph, ppci, pglyph_base)) return; miPolyGlyphBlt(drawable, gc, start_x, y, nglyph, ppci, pglyph_base); } Bool glamor_poly_glyph_blt_nf(DrawablePtr drawable, GCPtr gc, int start_x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyph_base) { if (glamor_poly_glyph_blt_gl(drawable, gc, start_x, y, nglyph, ppci, pglyph_base)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) { return FALSE; } miPolyGlyphBlt(drawable, gc, start_x, y, nglyph, ppci, pglyph_base); return TRUE; } Bool glamor_image_glyph_blt_nf(DrawablePtr drawable, GCPtr gc, int start_x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyph_base) { miImageGlyphBlt(drawable, gc, start_x, y, nglyph, ppci, pglyph_base); return TRUE; } static Bool glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap, DrawablePtr drawable, int w, int h, int x, int y) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; uint8_t *bitmap_data = bitmap->devPrivate.ptr; int bitmap_stride = bitmap->devKind; glamor_program *prog; RegionPtr clip = gc->pCompositeClip; int box_x, box_y; int yy, xx; int num_points; INT16 *points = NULL; char *vbo_offset; if (w * h > MAXINT / (2 * sizeof(float))) goto bail; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; glamor_make_current(glamor_priv); prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_glyph_blt_progs, &glamor_facet_poly_glyph_blt); if (!prog) goto bail_ctx; glEnableVertexAttribArray(GLAMOR_VERTEX_POS); points = glamor_get_vbo_space(screen, w * h * sizeof(INT16) * 2, &vbo_offset); num_points = 0; /* Note that because fb sets miTranslate in the GC, our incoming X * and Y are in screen coordinate space (same for spans, but not * other operations). */ for (yy = 0; yy < h; yy++) { uint8_t *bitmap_row = bitmap_data + yy * bitmap_stride; for (xx = 0; xx < w; xx++) { if (bitmap_row[xx / 8] & (1 << xx % 8) && RegionContainsPoint(clip, x + xx, y + yy, NULL)) { *points++ = x + xx; *points++ = y + yy; num_points++; } } } glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 0, vbo_offset); glamor_put_vbo_space(screen); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE, prog->matrix_uniform, NULL, NULL); glDrawArrays(GL_POINTS, 0, num_points); } glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y) { if (glamor_push_pixels_gl(pGC, pBitmap, pDrawable, w, h, x, y)) return; miPushPixels(pGC, pBitmap, pDrawable, w, h, x, y); } Bool glamor_push_pixels_nf(GCPtr gc, PixmapPtr bitmap, DrawablePtr drawable, int w, int h, int x, int y) { if (glamor_push_pixels_gl(gc, bitmap, drawable, w, h, x, y)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_pixmap(&bitmap->drawable) && glamor_ddx_fallback_check_gc(gc)) { return FALSE; } miPushPixels(gc, bitmap, drawable, w, h, x, y); return TRUE; } xorg-server-1.17.1/glamor/glamor_egl.c0000664000175100017510000006053512462701171014560 00000000000000/* * Copyright © 2010 Intel Corporation. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including * the next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #include "dix-config.h" #define GLAMOR_FOR_XORG #include #include #include #include #include #include #define EGL_DISPLAY_NO_X_MESA #ifdef GLAMOR_HAS_GBM #include #include #endif #define MESA_EGL_NO_X11_HEADERS #include #include #include "glamor.h" #include "glamor_priv.h" #include "dri3.h" static const char glamor_name[] = "glamor"; static void glamor_identify(int flags) { xf86Msg(X_INFO, "%s: OpenGL accelerated X.org driver based.\n", glamor_name); } struct glamor_egl_screen_private { EGLDisplay display; EGLContext context; EGLint major, minor; char *device_path; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; int fd; int cpp; #ifdef GLAMOR_HAS_GBM struct gbm_device *gbm; #endif int has_gem; int gl_context_depth; int dri3_capable; CloseScreenProcPtr saved_close_screen; xf86FreeScreenProc *saved_free_screen; }; int xf86GlamorEGLPrivateIndex = -1; static struct glamor_egl_screen_private * glamor_egl_get_screen_private(ScrnInfoPtr scrn) { return (struct glamor_egl_screen_private *) scrn->privates[xf86GlamorEGLPrivateIndex].ptr; } static void glamor_egl_make_current(struct glamor_context *glamor_ctx) { /* There's only a single global dispatch table in Mesa. EGL, GLX, * and AIGLX's direct dispatch table manipulation don't talk to * each other. We need to set the context to NULL first to avoid * EGL's no-op context change fast path when switching back to * EGL. */ eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (!eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE, EGL_NO_SURFACE, glamor_ctx->ctx)) { FatalError("Failed to make EGL context current\n"); } } static EGLImageKHR _glamor_egl_create_image(struct glamor_egl_screen_private *glamor_egl, int width, int height, int stride, int name, int depth) { EGLImageKHR image; EGLint attribs[] = { EGL_WIDTH, 0, EGL_HEIGHT, 0, EGL_DRM_BUFFER_STRIDE_MESA, 0, EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, EGL_DRM_BUFFER_USE_MESA, EGL_DRM_BUFFER_USE_SHARE_MESA | EGL_DRM_BUFFER_USE_SCANOUT_MESA, EGL_NONE }; attribs[1] = width; attribs[3] = height; attribs[5] = stride; if (depth != 32 && depth != 24) return EGL_NO_IMAGE_KHR; image = eglCreateImageKHR(glamor_egl->display, glamor_egl->context, EGL_DRM_BUFFER_MESA, (void *) (uintptr_t) name, attribs); if (image == EGL_NO_IMAGE_KHR) return EGL_NO_IMAGE_KHR; return image; } static int glamor_get_flink_name(int fd, int handle, int *name) { struct drm_gem_flink flink; flink.handle = handle; if (ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) return FALSE; *name = flink.name; return TRUE; } static Bool glamor_create_texture_from_image(ScreenPtr screen, EGLImageKHR image, GLuint * texture) { struct glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glGenTextures(1, texture); glBindTexture(GL_TEXTURE_2D, *texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); glBindTexture(GL_TEXTURE_2D, 0); return TRUE; } void * glamor_egl_get_gbm_device(ScreenPtr screen) { #ifdef GLAMOR_HAS_GBM struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); return glamor_egl->gbm; #else return NULL; #endif } unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_egl_screen_private *glamor_egl; EGLImageKHR image; GLuint texture; #ifdef GLAMOR_HAS_GBM struct gbm_bo *bo; EGLNativePixmapType native_pixmap; glamor_egl = glamor_egl_get_screen_private(scrn); bo = gbm_bo_create(glamor_egl->gbm, w, h, GBM_FORMAT_ARGB8888, GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); if (!bo) return 0; /* If the following assignment raises an error or a warning * then that means EGLNativePixmapType is not struct gbm_bo * * on your platform: This code won't work and you should not * compile with dri3 support enabled */ native_pixmap = bo; image = eglCreateImageKHR(glamor_egl->display, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, native_pixmap, NULL); gbm_bo_destroy(bo); if (image == EGL_NO_IMAGE_KHR) return 0; glamor_create_texture_from_image(screen, image, &texture); eglDestroyImageKHR(glamor_egl->display, image); return texture; #else return 0; /* this path should never happen */ #endif } Bool glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); PixmapPtr screen_pixmap; screen_pixmap = screen->GetScreenPixmap(screen); if (!glamor_egl_create_textured_pixmap(screen_pixmap, handle, stride)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create textured screen."); return FALSE; } glamor_set_screen_pixmap(screen_pixmap, NULL); return TRUE; } Bool glamor_egl_create_textured_screen_ext(ScreenPtr screen, int handle, int stride, PixmapPtr *back_pixmap) { return glamor_egl_create_textured_screen(screen, handle, stride); } static Bool glamor_egl_check_has_gem(int fd) { struct drm_gem_flink flink; flink.handle = 0; ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); if (errno == ENOENT || errno == EINVAL) return TRUE; return FALSE; } static void glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image) { struct glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); EGLImageKHR old; old = pixmap_priv->base.image; if (old) { ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); eglDestroyImageKHR(glamor_egl->display, old); } pixmap_priv->base.image = image; } Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) { ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); struct glamor_egl_screen_private *glamor_egl; EGLImageKHR image; GLuint texture; int name; Bool ret = FALSE; glamor_egl = glamor_egl_get_screen_private(scrn); glamor_make_current(glamor_priv); if (glamor_egl->has_gem) { if (!glamor_get_flink_name(glamor_egl->fd, handle, &name)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't flink pixmap handle\n"); glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); assert(0); return FALSE; } } else name = handle; image = _glamor_egl_create_image(glamor_egl, pixmap->drawable.width, pixmap->drawable.height, ((stride * 8 + 7) / pixmap->drawable.bitsPerPixel), name, pixmap->drawable.depth); if (image == EGL_NO_IMAGE_KHR) { glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); goto done; } glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); glamor_egl_set_pixmap_image(pixmap, image); ret = TRUE; done: return ret; } Bool glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) { ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); struct glamor_egl_screen_private *glamor_egl; EGLImageKHR image; GLuint texture; Bool ret = FALSE; glamor_egl = glamor_egl_get_screen_private(scrn); glamor_make_current(glamor_priv); image = eglCreateImageKHR(glamor_egl->display, glamor_egl->context, EGL_NATIVE_PIXMAP_KHR, bo, NULL); if (image == EGL_NO_IMAGE_KHR) { glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); goto done; } glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); glamor_egl_set_pixmap_image(pixmap, image); ret = TRUE; done: return ret; } #ifdef GLAMOR_HAS_GBM int glamor_get_fd_from_bo(int gbm_fd, struct gbm_bo *bo, int *fd); void glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name); int glamor_get_fd_from_bo(int gbm_fd, struct gbm_bo *bo, int *fd) { union gbm_bo_handle handle; struct drm_prime_handle args; handle = gbm_bo_get_handle(bo); args.handle = handle.u32; args.flags = DRM_CLOEXEC; if (ioctl(gbm_fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args)) return FALSE; *fd = args.fd; return TRUE; } void glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name) { union gbm_bo_handle handle; handle = gbm_bo_get_handle(bo); if (!glamor_get_flink_name(gbm_fd, handle.u32, name)) *name = -1; } #endif int glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, PixmapPtr pixmap, unsigned int tex, Bool want_name, CARD16 *stride, CARD32 *size) { #ifdef GLAMOR_HAS_GBM ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); struct glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); struct glamor_egl_screen_private *glamor_egl; EGLImageKHR image; struct gbm_bo *bo; int fd = -1; EGLint attribs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_GL_TEXTURE_LEVEL_KHR, 0, EGL_NONE }; glamor_egl = glamor_egl_get_screen_private(scrn); glamor_make_current(glamor_priv); image = pixmap_priv->base.image; if (!image) { image = eglCreateImageKHR(glamor_egl->display, glamor_egl->context, EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer) (uintptr_t) tex, attribs); if (image == EGL_NO_IMAGE_KHR) goto failure; glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_egl_set_pixmap_image(pixmap, image); } bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, image, 0); if (!bo) goto failure; pixmap->devKind = gbm_bo_get_stride(bo); if (want_name) { if (glamor_egl->has_gem) glamor_get_name_from_bo(glamor_egl->fd, bo, &fd); } else { if (glamor_get_fd_from_bo(glamor_egl->fd, bo, &fd)) { } } *stride = pixmap->devKind; *size = pixmap->devKind * gbm_bo_get_height(bo); gbm_bo_destroy(bo); failure: return fd; #else return -1; #endif } _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen, int fd, CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp) { #ifdef GLAMOR_HAS_GBM ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_egl_screen_private *glamor_egl; struct gbm_bo *bo; EGLImageKHR image; PixmapPtr pixmap; Bool ret = FALSE; EGLint attribs[] = { EGL_WIDTH, 0, EGL_HEIGHT, 0, EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_ARGB8888, EGL_DMA_BUF_PLANE0_FD_EXT, 0, EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0, EGL_DMA_BUF_PLANE0_PITCH_EXT, 0, EGL_NONE }; glamor_egl = glamor_egl_get_screen_private(scrn); if (!glamor_egl->dri3_capable) return NULL; if (bpp != 32 || !(depth == 24 || depth == 32) || width == 0 || height == 0) return NULL; attribs[1] = width; attribs[3] = height; attribs[7] = fd; attribs[11] = stride; image = eglCreateImageKHR(glamor_egl->display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attribs); if (image == EGL_NO_IMAGE_KHR) return NULL; /* EGL_EXT_image_dma_buf_import can impose restrictions on the * usage of the image. Use gbm_bo to bypass the limitations. */ bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, image, 0); eglDestroyImageKHR(glamor_egl->display, image); if (!bo) return NULL; pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0); screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL); ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo); gbm_bo_destroy(bo); if (ret) return pixmap; else { screen->DestroyPixmap(pixmap); return NULL; } #else return NULL; #endif } void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) { struct glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv && pixmap_priv->base.image) { ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); /* Before destroy an image which was attached to * a texture. we must call glFlush to make sure the * operation on that texture has been done.*/ glamor_block_handler(pixmap->drawable.pScreen); eglDestroyImageKHR(glamor_egl->display, pixmap_priv->base.image); pixmap_priv->base.image = NULL; } } _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) { EGLImageKHR temp; struct glamor_pixmap_private *front_priv = glamor_get_pixmap_private(front); struct glamor_pixmap_private *back_priv = glamor_get_pixmap_private(back); glamor_pixmap_exchange_fbos(front, back); temp = back_priv->base.image; back_priv->base.image = front_priv->base.image; front_priv->base.image = temp; glamor_set_pixmap_type(front, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM); } void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) { glamor_destroy_textured_pixmap(pixmap); } static Bool glamor_egl_close_screen(ScreenPtr screen) { ScrnInfoPtr scrn; struct glamor_egl_screen_private *glamor_egl; struct glamor_pixmap_private *pixmap_priv; PixmapPtr screen_pixmap; scrn = xf86ScreenToScrn(screen); glamor_egl = glamor_egl_get_screen_private(scrn); screen_pixmap = screen->GetScreenPixmap(screen); pixmap_priv = glamor_get_pixmap_private(screen_pixmap); eglDestroyImageKHR(glamor_egl->display, pixmap_priv->base.image); pixmap_priv->base.image = NULL; screen->CloseScreen = glamor_egl->saved_close_screen; return screen->CloseScreen(screen); } static int glamor_dri3_open_client(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fdp) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); int fd; drm_magic_t magic; fd = open(glamor_egl->device_path, O_RDWR|O_CLOEXEC); if (fd < 0) return BadAlloc; /* Before FD passing in the X protocol with DRI3 (and increased * security of rendering with per-process address spaces on the * GPU), the kernel had to come up with a way to have the server * decide which clients got to access the GPU, which was done by * each client getting a unique (magic) number from the kernel, * passing it to the server, and the server then telling the * kernel which clients were authenticated for using the device. * * Now that we have FD passing, the server can just set up the * authentication on its own and hand the prepared FD off to the * client. */ if (drmGetMagic(fd, &magic) < 0) { if (errno == EACCES) { /* Assume that we're on a render node, and the fd is * already as authenticated as it should be. */ *fdp = fd; return Success; } else { close(fd); return BadMatch; } } if (drmAuthMagic(glamor_egl->fd, magic) < 0) { close(fd); return BadMatch; } *fdp = fd; return Success; } static dri3_screen_info_rec glamor_dri3_info = { .version = 1, .open_client = glamor_dri3_open_client, .pixmap_from_fd = glamor_pixmap_from_fd, .fd_from_pixmap = glamor_fd_from_pixmap, }; void glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); glamor_egl->saved_close_screen = screen->CloseScreen; screen->CloseScreen = glamor_egl_close_screen; glamor_ctx->ctx = glamor_egl->context; glamor_ctx->display = glamor_egl->display; glamor_ctx->make_current = glamor_egl_make_current; if (glamor_egl->dri3_capable) { /* Tell the core that we have the interfaces for import/export * of pixmaps. */ glamor_enable_dri3(screen); /* If the driver wants to do its own auth dance (e.g. Xwayland * on pre-3.15 kernels that don't have render nodes and thus * has the wayland compositor as a master), then it needs us * to stay out of the way and let it init DRI3 on its own. */ if (!(glamor_priv->flags & GLAMOR_NO_DRI3)) { /* To do DRI3 device FD generation, we need to open a new fd * to the same device we were handed in originally. */ glamor_egl->device_path = drmGetDeviceNameFromFd(glamor_egl->fd); if (!dri3_screen_init(screen, &glamor_dri3_info)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to initialize DRI3.\n"); } } } } static void glamor_egl_free_screen(ScrnInfoPtr scrn) { struct glamor_egl_screen_private *glamor_egl; glamor_egl = glamor_egl_get_screen_private(scrn); if (glamor_egl != NULL) { eglMakeCurrent(glamor_egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); #ifdef GLAMOR_HAS_GBM if (glamor_egl->gbm) gbm_device_destroy(glamor_egl->gbm); #endif free(glamor_egl->device_path); scrn->FreeScreen = glamor_egl->saved_free_screen; free(glamor_egl); scrn->FreeScreen(scrn); } } Bool glamor_egl_init(ScrnInfoPtr scrn, int fd) { struct glamor_egl_screen_private *glamor_egl; const char *version; EGLint config_attribs[] = { #ifdef GLAMOR_GLES2 EGL_CONTEXT_CLIENT_VERSION, 2, #endif EGL_NONE }; glamor_identify(0); glamor_egl = calloc(sizeof(*glamor_egl), 1); if (glamor_egl == NULL) return FALSE; if (xf86GlamorEGLPrivateIndex == -1) xf86GlamorEGLPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); scrn->privates[xf86GlamorEGLPrivateIndex].ptr = glamor_egl; glamor_egl->fd = fd; #ifdef GLAMOR_HAS_GBM glamor_egl->gbm = gbm_create_device(glamor_egl->fd); if (glamor_egl->gbm == NULL) { ErrorF("couldn't get display device\n"); return FALSE; } glamor_egl->display = eglGetDisplay(glamor_egl->gbm); #else glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd); #endif glamor_egl->has_gem = glamor_egl_check_has_gem(fd); #ifndef GLAMOR_GLES2 eglBindAPI(EGL_OPENGL_API); #else eglBindAPI(EGL_OPENGL_ES_API); #endif if (!eglInitialize (glamor_egl->display, &glamor_egl->major, &glamor_egl->minor)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglInitialize() failed\n"); return FALSE; } version = eglQueryString(glamor_egl->display, EGL_VERSION); xf86Msg(X_INFO, "%s: EGL version %s:\n", glamor_name, version); #define GLAMOR_CHECK_EGL_EXTENSION(EXT) \ if (!epoxy_has_egl_extension(glamor_egl->display, "EGL_" #EXT)) { \ ErrorF("EGL_" #EXT " required.\n"); \ return FALSE; \ } #define GLAMOR_CHECK_EGL_EXTENSIONS(EXT1, EXT2) \ if (!epoxy_has_egl_extension(glamor_egl->display, "EGL_" #EXT1) && \ !epoxy_has_egl_extension(glamor_egl->display, "EGL_" #EXT2)) { \ ErrorF("EGL_" #EXT1 " or EGL_" #EXT2 " required.\n"); \ return FALSE; \ } GLAMOR_CHECK_EGL_EXTENSION(MESA_drm_image); GLAMOR_CHECK_EGL_EXTENSION(KHR_gl_renderbuffer_image); #ifdef GLAMOR_GLES2 GLAMOR_CHECK_EGL_EXTENSIONS(KHR_surfaceless_context, KHR_surfaceless_gles2); #else GLAMOR_CHECK_EGL_EXTENSIONS(KHR_surfaceless_context, KHR_surfaceless_opengl); #endif #ifdef GLAMOR_HAS_GBM if (epoxy_has_egl_extension(glamor_egl->display, "EGL_KHR_gl_texture_2D_image") && epoxy_has_egl_extension(glamor_egl->display, "EGL_EXT_image_dma_buf_import")) glamor_egl->dri3_capable = TRUE; #endif glamor_egl->context = eglCreateContext(glamor_egl->display, NULL, EGL_NO_CONTEXT, config_attribs); if (glamor_egl->context == EGL_NO_CONTEXT) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create EGL context\n"); return FALSE; } if (!eglMakeCurrent(glamor_egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, glamor_egl->context)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to make EGL context current\n"); return FALSE; } glamor_egl->saved_free_screen = scrn->FreeScreen; scrn->FreeScreen = glamor_egl_free_screen; #ifdef GLAMOR_GLES2 xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using GLES2.\n"); xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Glamor is using GLES2 but GLX needs GL. " "Indirect GLX may not work correctly.\n"); #endif return TRUE; } /** Stub to retain compatibility with pre-server-1.16 ABI. */ Bool glamor_egl_init_textured_pixmap(ScreenPtr screen) { return TRUE; } xorg-server-1.17.1/glamor/glamor_glx.c0000664000175100017510000000444612424353351014603 00000000000000/* * Copyright © 2013 Intel Corporation * * 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. */ #include #include "glamor_context.h" /** * @file glamor_glx.c * * GLX context management for glamor. * * This has to be kept separate from the server sources because of * Xlib's conflicting definition of CARD32 and similar typedefs. */ static void glamor_glx_make_current(struct glamor_context *glamor_ctx) { /* There's only a single global dispatch table in Mesa. EGL, GLX, * and AIGLX's direct dispatch table manipulation don't talk to * each other. We need to set the context to NULL first to avoid * GLX's no-op context change fast path when switching back to * GLX. */ glXMakeCurrent(glamor_ctx->display, None, None); glXMakeCurrent(glamor_ctx->display, glamor_ctx->drawable_xid, glamor_ctx->ctx); } Bool glamor_glx_screen_init(struct glamor_context *glamor_ctx) { glamor_ctx->ctx = glXGetCurrentContext(); if (!glamor_ctx->ctx) return False; glamor_ctx->display = glXGetCurrentDisplay(); if (!glamor_ctx->display) return False; glamor_ctx->drawable_xid = glXGetCurrentDrawable(); glamor_ctx->make_current = glamor_glx_make_current; return True; } xorg-server-1.17.1/glamor/glamor_transform.h0000664000175100017510000000654212433525530016030 00000000000000/* * Copyright © 2014 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. */ #ifndef _GLAMOR_TRANSFORM_H_ #define _GLAMOR_TRANSFORM_H_ void glamor_set_destination_drawable(DrawablePtr drawable, int box_x, int box_y, Bool do_drawable_translate, Bool center_offset, GLint matrix_uniform_location, int *p_off_x, int *p_off_y); void glamor_set_color(PixmapPtr pixmap, CARD32 pixel, GLint uniform); Bool glamor_set_texture(PixmapPtr pixmap, PixmapPtr texture, int off_x, int off_y, GLint offset_uniform, GLint size_uniform); Bool glamor_set_solid(PixmapPtr pixmap, GCPtr gc, Bool use_alu, GLint uniform); Bool glamor_set_tiled(PixmapPtr pixmap, GCPtr gc, GLint offset_uniform, GLint size_uniform); Bool glamor_set_stippled(PixmapPtr pixmap, GCPtr gc, GLint fg_uniform, GLint offset_uniform, GLint size_uniform); /* * Vertex shader bits that transform X coordinates to pixmap * coordinates using the matrix computed above */ #define GLAMOR_DECLARE_MATRIX "uniform vec4 v_matrix;\n" #define GLAMOR_X_POS(x) #x " *v_matrix.x + v_matrix.y" #define GLAMOR_Y_POS(y) #y " *v_matrix.z + v_matrix.w" #if 0 #define GLAMOR_POS(dst,src) \ " " #dst ".x = " #src ".x * v_matrix.x + v_matrix.y;\n" \ " " #dst ".y = " #src ".y * v_matrix.z + v_matrix.w;\n" \ " " #dst ".z = 0.0;\n" \ " " #dst ".w = 1.0;\n" #endif #define GLAMOR_POS(dst,src) \ " " #dst ".xy = " #src ".xy * v_matrix.xz + v_matrix.yw;\n" \ " " #dst ".zw = vec2(0.0,1.0);\n" #endif /* _GLAMOR_TRANSFORM_H_ */ xorg-server-1.17.1/glamor/glamor_segs.c0000664000175100017510000001350112460362577014754 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_program.h" #include "glamor_transform.h" #include "glamor_prepare.h" static const glamor_facet glamor_facet_poly_segment = { .name = "poly_segment", .vs_vars = "attribute vec2 primitive;\n", .vs_exec = (" vec2 pos = vec2(0.0,0.0);\n" GLAMOR_POS(gl_Position, primitive.xy)), }; static Bool glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; glamor_program *prog; int off_x, off_y; xSegment *v; char *vbo_offset; int box_x, box_y; int add_last; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; add_last = 0; if (gc->capStyle != CapNotLast) add_last = 1; glamor_make_current(glamor_priv); prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_segment_program, &glamor_facet_poly_segment); if (!prog) goto bail_ctx; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, (nseg << add_last) * sizeof (xSegment), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, sizeof(DDXPointRec), vbo_offset); if (add_last) { int i, j; for (i = 0, j=0; i < nseg; i++) { v[j++] = segs[i]; v[j].x1 = segs[i].x2; v[j].y1 = segs[i].y2; v[j].x2 = segs[i].x2+1; v[j].y2 = segs[i].y2; j++; } } else memcpy(v, segs, nseg * sizeof (xSegment)); glamor_put_vbo_space(screen); glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE, prog->matrix_uniform, &off_x, &off_y); while (nbox--) { glScissor(box->x1 + off_x, box->y1 + off_y, box->x2 - box->x1, box->y2 - box->y1); box++; glDrawArrays(GL_LINES, 0, nseg << (1 + add_last)); } } glDisable(GL_SCISSOR_TEST); glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } static Bool glamor_poly_segment_gl(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { if (gc->lineWidth != 0) return FALSE; switch (gc->lineStyle) { case LineSolid: return glamor_poly_segment_solid_gl(drawable, gc, nseg, segs); case LineOnOffDash: return glamor_poly_segment_dash_gl(drawable, gc, nseg, segs); case LineDoubleDash: if (gc->fillStyle == FillTiled) return glamor_poly_segment_solid_gl(drawable, gc, nseg, segs); else return glamor_poly_segment_dash_gl(drawable, gc, nseg, segs); default: return FALSE; } } static void glamor_poly_segment_bail(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { glamor_fallback("to %p (%c)\n", drawable, glamor_get_drawable_location(drawable)); if (gc->lineWidth == 0) { if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) && glamor_prepare_access_gc(gc)) { fbPolySegment(drawable, gc, nseg, segs); } glamor_finish_access_gc(gc); glamor_finish_access(drawable); } else miPolySegment(drawable, gc, nseg, segs); } void glamor_poly_segment(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { if (glamor_poly_segment_gl(drawable, gc, nseg, segs)) return; glamor_poly_segment_bail(drawable, gc, nseg, segs); } Bool glamor_poly_segment_nf(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { if (glamor_poly_segment_gl(drawable, gc, nseg, segs)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) { return FALSE; } glamor_poly_segment_bail(drawable, gc, nseg, segs); return TRUE; } xorg-server-1.17.1/glamor/glamor_eglmodule.c0000664000175100017510000000374112424353351015763 00000000000000/* * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project shall * not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from the * XFree86 Project. * * Authors: * Zhigang Gong */ #include "dix-config.h" #include #define GLAMOR_FOR_XORG #include #include "glamor.h" static XF86ModuleVersionInfo VersRec = { GLAMOR_EGL_MODULE_NAME, MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 0, 0, /* version */ ABI_CLASS_ANSIC, /* Only need the ansic layer */ ABI_ANSIC_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} /* signature, to be patched into the file by a tool */ }; _X_EXPORT XF86ModuleData glamoreglModuleData = { &VersRec, NULL, NULL }; xorg-server-1.17.1/glamor/glamor_spans.c0000664000175100017510000003317512460362577015150 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_transform.h" #include "glamor_transfer.h" glamor_program fill_spans_progs[4]; static const glamor_facet glamor_facet_fillspans_130 = { .name = "fill_spans", .version = 130, .vs_vars = "attribute vec3 primitive;\n", .vs_exec = (" vec2 pos = vec2(primitive.z,1) * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" GLAMOR_POS(gl_Position, (primitive.xy + pos))), }; static const glamor_facet glamor_facet_fillspans_120 = { .name = "fill_spans", .vs_vars = "attribute vec2 primitive;\n", .vs_exec = (" vec2 pos = vec2(0,0);\n" GLAMOR_POS(gl_Position, primitive.xy)), }; static Bool glamor_fill_spans_gl(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; glamor_program *prog; int off_x, off_y; GLshort *v; char *vbo_offset; int c; int box_x, box_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; glamor_make_current(glamor_priv); if (glamor_priv->glsl_version >= 130) { prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->fill_spans_program, &glamor_facet_fillspans_130); if (!prog) goto bail_ctx; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, n * (4 * sizeof (GLshort)), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribDivisor(GLAMOR_VERTEX_POS, 1); glVertexAttribPointer(GLAMOR_VERTEX_POS, 3, GL_SHORT, GL_FALSE, 4 * sizeof (GLshort), vbo_offset); for (c = 0; c < n; c++) { v[0] = points->x; v[1] = points->y; v[2] = *widths++; points++; v += 4; } glamor_put_vbo_space(screen); } else { prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->fill_spans_program, &glamor_facet_fillspans_120); if (!prog) goto bail_ctx; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, n * 8 * sizeof (short), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 2 * sizeof (short), vbo_offset); for (c = 0; c < n; c++) { v[0] = points->x; v[1] = points->y; v[2] = points->x; v[3] = points->y + 1; v[4] = points->x + *widths; v[5] = points->y + 1; v[6] = points->x + *widths; v[7] = points->y; widths++; points++; v += 8; } glamor_put_vbo_space(screen); } glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, FALSE, prog->matrix_uniform, &off_x, &off_y); while (nbox--) { glScissor(box->x1 + off_x, box->y1 + off_y, box->x2 - box->x1, box->y2 - box->y1); box++; if (glamor_priv->glsl_version >= 130) glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, n); else { if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { glDrawArrays(GL_QUADS, 0, 4 * n); } else { int i; for (i = 0; i < n; i++) { glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4); } } } } } glDisable(GL_SCISSOR_TEST); glDisable(GL_COLOR_LOGIC_OP); if (glamor_priv->glsl_version >= 130) glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } static void glamor_fill_spans_bail(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted) { if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) && glamor_prepare_access_gc(gc)) { fbFillSpans(drawable, gc, n, points, widths, sorted); } glamor_finish_access_gc(gc); glamor_finish_access(drawable); } void glamor_fill_spans(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted) { if (glamor_fill_spans_gl(drawable, gc, n, points, widths, sorted)) return; glamor_fill_spans_bail(drawable, gc, n, points, widths, sorted); } Bool glamor_fill_spans_nf(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted) { if (glamor_fill_spans_gl(drawable, gc, n, points, widths, sorted)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) return FALSE; glamor_fill_spans_bail(drawable, gc, n, points, widths, sorted); return TRUE; } static Bool glamor_get_spans_gl(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; int box_x, box_y; int n; char *d; GLenum type; GLenum format; int off_x, off_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); glamor_format_for_pixmap(pixmap, &format, &type); glamor_make_current(glamor_priv); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_x, box_y); glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(pixmap_priv, box_x, box_y); glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->fb); glPixelStorei(GL_PACK_ALIGNMENT, 4); d = dst; for (n = 0; n < count; n++) { int x1 = points[n].x + off_x; int y = points[n].y + off_y; int w = widths[n]; int x2 = x1 + w; char *l; l = d; d += PixmapBytePad(w, drawable->depth); /* clip */ if (x1 < box->x1) { l += (box->x1 - x1) * (drawable->bitsPerPixel >> 3); x1 = box->x1; } if (x2 > box->x2) x2 = box->x2; if (x1 >= x2) continue; if (y < box->y1) continue; if (y >= box->y2) continue; glReadPixels(x1 - box->x1, y - box->y1, x2 - x1, 1, format, type, l); } } return TRUE; bail: return FALSE; } static void glamor_get_spans_bail(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst) { if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) fbGetSpans(drawable, wmax, points, widths, count, dst); glamor_finish_access(drawable); } void glamor_get_spans(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst) { if (glamor_get_spans_gl(drawable, wmax, points, widths, count, dst)) return; glamor_get_spans_bail(drawable, wmax, points, widths, count, dst); } Bool glamor_get_spans_nf(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst) { if (glamor_get_spans_gl(drawable, wmax, points, widths, count, dst)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable)) return FALSE; glamor_get_spans_bail(drawable, wmax, points, widths, count, dst); return TRUE; } static Bool glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, DDXPointPtr points, int *widths, int numPoints, int sorted) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; int box_x, box_y; int n; char *s; GLenum type; GLenum format; int off_x, off_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; if (gc->alu != GXcopy) goto bail; if (!glamor_pm_is_solid(&pixmap->drawable, gc->planemask)) goto bail; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); glamor_format_for_pixmap(pixmap, &format, &type); glamor_make_current(glamor_priv); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_x, box_y); glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(pixmap_priv, box_x, box_y); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, fbo->tex); s = src; for (n = 0; n < numPoints; n++) { BoxPtr clip_box = RegionRects(gc->pCompositeClip); int nclip_box = RegionNumRects(gc->pCompositeClip); int w = widths[n]; int y = points[n].y; int x = points[n].x; while (nclip_box--) { int x1 = x; int x2 = x + w; int y1 = y; char *l = s; /* clip to composite clip */ if (x1 < clip_box->x1) { l += (clip_box->x1 - x1) * (drawable->bitsPerPixel >> 3); x1 = clip_box->x1; } if (x2 > clip_box->x2) x2 = clip_box->x2; if (y < clip_box->y1) continue; if (y >= clip_box->y2) continue; /* adjust to pixmap coordinates */ x1 += off_x; x2 += off_x; y1 += off_y; if (x1 < box->x1) { l += (box->x1 - x1) * (drawable->bitsPerPixel >> 3); x1 = box->x1; } if (x2 > box->x2) x2 = box->x2; if (x1 >= x2) continue; if (y1 < box->y1) continue; if (y1 >= box->y2) continue; glTexSubImage2D(GL_TEXTURE_2D, 0, x1 - box->x1, y1 - box->y1, x2 - x1, 1, format, type, l); } s += PixmapBytePad(w, drawable->depth); } } return TRUE; bail: return FALSE; } static void glamor_set_spans_bail(DrawablePtr drawable, GCPtr gc, char *src, DDXPointPtr points, int *widths, int numPoints, int sorted) { if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) && glamor_prepare_access_gc(gc)) fbSetSpans(drawable, gc, src, points, widths, numPoints, sorted); glamor_finish_access_gc(gc); glamor_finish_access(drawable); } void glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src, DDXPointPtr points, int *widths, int numPoints, int sorted) { if (glamor_set_spans_gl(drawable, gc, src, points, widths, numPoints, sorted)) return; glamor_set_spans_bail(drawable, gc, src, points, widths, numPoints, sorted); } Bool glamor_set_spans_nf(DrawablePtr drawable, GCPtr gc, char *src, DDXPointPtr points, int *widths, int numPoints, int sorted) { if (glamor_set_spans_gl(drawable, gc, src, points, widths, numPoints, sorted)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) return FALSE; glamor_set_spans_bail(drawable, gc, src, points, widths, numPoints, sorted); return TRUE; } xorg-server-1.17.1/glamor/glamor_text.c0000664000175100017510000004145312460362577015006 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include #include "glamor_transform.h" /* * Fill in the array of charinfo pointers for the provided characters. For * missing characters, place a NULL in the array so that the charinfo array * aligns exactly with chars */ static void glamor_get_glyphs(FontPtr font, glamor_font_t *glamor_font, int count, char *chars, Bool sixteen, CharInfoPtr *charinfo) { unsigned long nglyphs; FontEncoding encoding; int char_step; int c; if (sixteen) { char_step = 2; if (FONTLASTROW(font) == 0) encoding = Linear16Bit; else encoding = TwoD16Bit; } else { char_step = 1; encoding = Linear8Bit; } /* If the font has a default character, then we shouldn't have to * worry about missing glyphs, so just get the whole string all at * once. Otherwise, we have to fetch chars one at a time to notice * missing ones. */ if (glamor_font->default_char) { GetGlyphs(font, (unsigned long) count, (unsigned char *) chars, encoding, &nglyphs, charinfo); /* Make sure it worked. There's a bug in libXfont through * version 1.4.7 which would cause it to fail when the font is * a 2D font without a first row, and the application sends a * 1-d request. In this case, libXfont would return zero * glyphs, even when the font had a default character. * * It's easy enough for us to work around that bug here by * simply checking the returned nglyphs and falling through to * the one-at-a-time code below. Not doing this check would * result in uninitialized memory accesses in the rendering code. */ if (nglyphs == count) return; } for (c = 0; c < count; c++) { GetGlyphs(font, 1, (unsigned char *) chars, encoding, &nglyphs, &charinfo[c]); if (!nglyphs) charinfo[c] = NULL; chars += char_step; } } /* * Construct quads for the provided list of characters and draw them */ static int glamor_text(DrawablePtr drawable, GCPtr gc, glamor_font_t *glamor_font, glamor_program *prog, int x, int y, int count, char *s_chars, CharInfoPtr *charinfo, Bool sixteen) { unsigned char *chars = (unsigned char *) s_chars; FontPtr font = gc->font; int off_x, off_y; int c; int nglyph; GLshort *v; char *vbo_offset; CharInfoPtr ci; int firstRow = font->info.firstRow; int firstCol = font->info.firstCol; int glyph_spacing_x = glamor_font->glyph_width_bytes * 8; int glyph_spacing_y = glamor_font->glyph_height; int box_x, box_y; PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); /* Set the font as texture 1 */ glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, glamor_font->texture_id); glUniform1i(prog->font_uniform, 1); /* Set up the vertex buffers for the font and destination */ v = glamor_get_vbo_space(drawable->pScreen, count * (6 * sizeof (GLshort)), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribDivisor(GLAMOR_VERTEX_POS, 1); glVertexAttribPointer(GLAMOR_VERTEX_POS, 4, GL_SHORT, GL_FALSE, 6 * sizeof (GLshort), vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 1); glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_SHORT, GL_FALSE, 6 * sizeof (GLshort), vbo_offset + 4 * sizeof (GLshort)); /* Set the vertex coordinates */ nglyph = 0; for (c = 0; c < count; c++) { if ((ci = *charinfo++)) { int x1 = x + ci->metrics.leftSideBearing; int y1 = y - ci->metrics.ascent; int width = GLYPHWIDTHPIXELS(ci); int height = GLYPHHEIGHTPIXELS(ci); int tx, ty = 0; int row = 0, col; x += ci->metrics.characterWidth; if (sixteen) { if (ci == glamor_font->default_char) { row = glamor_font->default_row; col = glamor_font->default_col; } else { row = chars[0]; col = chars[1]; } if (FONTLASTROW(font) != 0) ty = (row - firstRow) * glyph_spacing_y; else col += row << 8; } else { if (ci == glamor_font->default_char) col = glamor_font->default_col; else col = chars[0]; } tx = (col - firstCol) * glyph_spacing_x; v[ 0] = x1; v[ 1] = y1; v[ 2] = width; v[ 3] = height; v[ 4] = tx; v[ 5] = ty; v += 6; nglyph++; } chars += 1 + sixteen; } glamor_put_vbo_space(drawable->pScreen); if (nglyph != 0) { glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { BoxPtr box = RegionRects(gc->pCompositeClip); int nbox = RegionNumRects(gc->pCompositeClip); glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, FALSE, prog->matrix_uniform, &off_x, &off_y); /* Run over the clip list, drawing the glyphs * in each box */ while (nbox--) { glScissor(box->x1 + off_x, box->y1 + off_y, box->x2 - box->x1, box->y2 - box->y1); box++; glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, nglyph); } } glDisable(GL_SCISSOR_TEST); } glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisable(GL_COLOR_LOGIC_OP); return x; } static const char vs_vars_text[] = "attribute vec4 primitive;\n" "attribute vec2 source;\n" "varying vec2 glyph_pos;\n"; static const char vs_exec_text[] = " vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" GLAMOR_POS(gl_Position, (primitive.xy + pos)) " glyph_pos = source + pos;\n"; static const char fs_vars_text[] = "varying vec2 glyph_pos;\n"; static const char fs_exec_text[] = " ivec2 itile_texture = ivec2(glyph_pos);\n" " uint x = uint(itile_texture.x & 7);\n" " itile_texture.x >>= 3;\n" " uint texel = texelFetch(font, itile_texture, 0).x;\n" " uint bit = (texel >> x) & uint(1);\n" " if (bit == uint(0))\n" " discard;\n"; static const char fs_exec_te[] = " ivec2 itile_texture = ivec2(glyph_pos);\n" " uint x = uint(itile_texture.x & 7);\n" " itile_texture.x >>= 3;\n" " uint texel = texelFetch(font, itile_texture, 0).x;\n" " uint bit = (texel >> x) & uint(1);\n" " if (bit == uint(0))\n" " gl_FragColor = bg;\n" " else\n" " gl_FragColor = fg;\n"; static const glamor_facet glamor_facet_poly_text = { .name = "poly_text", .version = 130, .vs_vars = vs_vars_text, .vs_exec = vs_exec_text, .fs_vars = fs_vars_text, .fs_exec = fs_exec_text, .source_name = "source", .locations = glamor_program_location_font, }; static Bool glamor_poly_text(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars, Bool sixteen, int *final_pos) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_program *prog; glamor_pixmap_private *pixmap_priv; glamor_font_t *glamor_font; CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ glamor_font = glamor_font_get(drawable->pScreen, gc->font); if (!glamor_font) goto bail; glamor_get_glyphs(gc->font, glamor_font, count, chars, sixteen, charinfo); pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; glamor_make_current(glamor_priv); prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_text_progs, &glamor_facet_poly_text); if (!prog) goto bail_ctx; x = glamor_text(drawable, gc, glamor_font, prog, x, y, count, chars, charinfo, sixteen); glDisable(GL_COLOR_LOGIC_OP); *final_pos = x; return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } Bool glamor_poly_text8_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars, int *final_pos) { if (glamor_poly_text(drawable, gc, x, y, count, chars, FALSE, final_pos)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) return FALSE; *final_pos = miPolyText8(drawable, gc, x, y, count, chars); return TRUE; } int glamor_poly_text8(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars) { int final_pos; if (glamor_poly_text(drawable, gc, x, y, count, chars, FALSE, &final_pos)) return final_pos; return miPolyText8(drawable, gc, x, y, count, chars); } Bool glamor_poly_text16_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, unsigned short *chars, int *final_pos) { if (glamor_poly_text(drawable, gc, x, y, count, (char *) chars, TRUE, final_pos)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) return FALSE; *final_pos = miPolyText16(drawable, gc, x, y, count, chars); return TRUE; } int glamor_poly_text16(DrawablePtr drawable, GCPtr gc, int x, int y, int count, unsigned short *chars) { int final_pos; if (glamor_poly_text(drawable, gc, x, y, count, (char *) chars, TRUE, &final_pos)) return final_pos; return miPolyText16(drawable, gc, x, y, count, chars); } /* * Draw image text, which is always solid in copy mode and has the * background cleared while painting the text. For fonts which have * their bitmap metrics exactly equal to the area to clear, we can use * the accelerated version which paints both fg and bg at the same * time. Otherwise, clear the whole area and then paint the glyphs on * top */ static const glamor_facet glamor_facet_image_text = { .name = "image_text", .version = 130, .vs_vars = vs_vars_text, .vs_exec = vs_exec_text, .fs_vars = fs_vars_text, .fs_exec = fs_exec_text, .source_name = "source", .locations = glamor_program_location_font, }; static Bool use_image_solid(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) { return glamor_set_solid(pixmap, gc, FALSE, prog->fg_uniform); } static const glamor_facet glamor_facet_image_fill = { .name = "solid", .fs_exec = " gl_FragColor = fg;\n", .locations = glamor_program_location_fg, .use = use_image_solid, }; static Bool glamor_te_text_use(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) { if (!glamor_set_solid(pixmap, gc, FALSE, prog->fg_uniform)) return FALSE; glamor_set_color(pixmap, gc->bgPixel, prog->bg_uniform); return TRUE; } static const glamor_facet glamor_facet_te_text = { .name = "te_text", .version = 130, .vs_vars = vs_vars_text, .vs_exec = vs_exec_text, .fs_vars = fs_vars_text, .fs_exec = fs_exec_te, .locations = glamor_program_location_fg | glamor_program_location_bg | glamor_program_location_font, .source_name = "source", .use = glamor_te_text_use, }; static Bool glamor_image_text(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars, Bool sixteen) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_program *prog; glamor_pixmap_private *pixmap_priv; glamor_font_t *glamor_font; const glamor_facet *prim_facet; const glamor_facet *fill_facet; CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) return FALSE; glamor_font = glamor_font_get(drawable->pScreen, gc->font); if (!glamor_font) return FALSE; glamor_get_glyphs(gc->font, glamor_font, count, chars, sixteen, charinfo); glamor_make_current(glamor_priv); if (TERMINALFONT(gc->font)) prog = &glamor_priv->te_text_prog; else prog = &glamor_priv->image_text_prog; if (prog->failed) goto bail; if (!prog->prog) { if (TERMINALFONT(gc->font)) { prim_facet = &glamor_facet_te_text; fill_facet = NULL; } else { prim_facet = &glamor_facet_image_text; fill_facet = &glamor_facet_image_fill; } if (!glamor_build_program(screen, prog, prim_facet, fill_facet)) goto bail; } if (!TERMINALFONT(gc->font)) { int width = 0; int c; RegionRec region; BoxRec box; int off_x, off_y; /* Check planemask before drawing background to * bail early if it's not OK */ if (!glamor_set_planemask(pixmap, gc->planemask)) goto bail; for (c = 0; c < count; c++) if (charinfo[c]) width += charinfo[c]->metrics.characterWidth; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); if (width >= 0) { box.x1 = off_x + drawable->x + x; box.x2 = off_x + drawable->x + x + width; } else { box.x1 = off_x + drawable->x + x + width; box.x2 = off_x + drawable->x + x; } box.y1 = off_y + drawable->y + y - gc->font->info.fontAscent; box.y2 = off_y + drawable->y + y + gc->font->info.fontDescent; RegionInit(®ion, &box, 1); RegionIntersect(®ion, ®ion, gc->pCompositeClip); glamor_solid_boxes(pixmap, RegionRects(®ion), RegionNumRects(®ion), gc->bgPixel); RegionUninit(®ion); } if (!glamor_use_program(pixmap, gc, prog, NULL)) goto bail; (void) glamor_text(drawable, gc, glamor_font, prog, x, y, count, chars, charinfo, sixteen); return TRUE; bail: glDisable(GL_COLOR_LOGIC_OP); return FALSE; } Bool glamor_image_text8_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars) { return glamor_image_text(drawable, gc, x, y, count, chars, FALSE); } void glamor_image_text8(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars) { if (!glamor_image_text(drawable, gc, x, y, count, chars, FALSE)) miImageText8(drawable, gc, x, y, count, chars); } Bool glamor_image_text16_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, unsigned short *chars) { return glamor_image_text(drawable, gc, x, y, count, (char *) chars, TRUE); } void glamor_image_text16(DrawablePtr drawable, GCPtr gc, int x, int y, int count, unsigned short *chars) { if (!glamor_image_text(drawable, gc, x, y, count, (char *) chars, TRUE)) miImageText16(drawable, gc, x, y, count, chars); } xorg-server-1.17.1/glamor/glamor_vbo.c0000664000175100017510000001467212424353351014601 00000000000000/* * Copyright © 2014 Intel Corporation * * 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. */ /** * @file glamor_vbo.c * * Helpers for managing streamed vertex bufffers used in glamor. */ #include "glamor_priv.h" /** Default size of the VBO, in bytes. * * If a single request is larger than this size, we'll resize the VBO * and return an appropriate mapping, but we'll resize back down after * that to avoid hogging that memory forever. We don't anticipate * normal usage actually requiring larger VBO sizes. */ #define GLAMOR_VBO_SIZE (512 * 1024) /** * Returns a pointer to @size bytes of VBO storage, which should be * accessed by the GL using vbo_offset within the VBO. */ void * glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); void *data; glamor_make_current(glamor_priv); glBindBuffer(GL_ARRAY_BUFFER, glamor_priv->vbo); if (glamor_priv->has_buffer_storage) { if (glamor_priv->vbo_size < glamor_priv->vbo_offset + size) { if (glamor_priv->vbo_size) glUnmapBuffer(GL_ARRAY_BUFFER); if (size > glamor_priv->vbo_size) { glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size); /* We aren't allowed to resize glBufferStorage() * buffers, so we need to gen a new one. */ glDeleteBuffers(1, &glamor_priv->vbo); glGenBuffers(1, &glamor_priv->vbo); glBindBuffer(GL_ARRAY_BUFFER, glamor_priv->vbo); assert(glGetError() == GL_NO_ERROR); glBufferStorage(GL_ARRAY_BUFFER, glamor_priv->vbo_size, NULL, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); if (glGetError() != GL_NO_ERROR) { /* If the driver failed our coherent mapping, fall * back to the ARB_mbr path. */ glamor_priv->has_buffer_storage = false; glamor_priv->vbo_size = 0; return glamor_get_vbo_space(screen, size, vbo_offset); } } glamor_priv->vbo_offset = 0; glamor_priv->vb = glMapBufferRange(GL_ARRAY_BUFFER, 0, glamor_priv->vbo_size, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); } *vbo_offset = (void *)(uintptr_t)glamor_priv->vbo_offset; data = glamor_priv->vb + glamor_priv->vbo_offset; glamor_priv->vbo_offset += size; } else if (glamor_priv->has_map_buffer_range) { if (glamor_priv->vbo_size < glamor_priv->vbo_offset + size) { glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size); glamor_priv->vbo_offset = 0; glBufferData(GL_ARRAY_BUFFER, glamor_priv->vbo_size, NULL, GL_STREAM_DRAW); } data = glMapBufferRange(GL_ARRAY_BUFFER, glamor_priv->vbo_offset, size, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_RANGE_BIT); assert(data != NULL); *vbo_offset = (char *)(uintptr_t)glamor_priv->vbo_offset; glamor_priv->vbo_offset += size; } else { /* Return a pointer to the statically allocated non-VBO * memory. We'll upload it through glBufferData() later. */ if (glamor_priv->vbo_size < size) { glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size); free(glamor_priv->vb); glamor_priv->vb = XNFalloc(glamor_priv->vbo_size); } *vbo_offset = NULL; /* We point to the start of glamor_priv->vb every time, and * the vbo_offset determines the size of the glBufferData(). */ glamor_priv->vbo_offset = size; data = glamor_priv->vb; } return data; } void glamor_put_vbo_space(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); if (glamor_priv->has_buffer_storage) { /* If we're in the ARB_buffer_storage path, we have a * persistent mapping, so we can leave it around until we * reach the end of the buffer. */ } else if (glamor_priv->has_map_buffer_range) { glUnmapBuffer(GL_ARRAY_BUFFER); } else { glBufferData(GL_ARRAY_BUFFER, glamor_priv->vbo_offset, glamor_priv->vb, GL_DYNAMIC_DRAW); } glBindBuffer(GL_ARRAY_BUFFER, 0); } void glamor_init_vbo(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glGenBuffers(1, &glamor_priv->vbo); } void glamor_fini_vbo(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glDeleteBuffers(1, &glamor_priv->vbo); if (!glamor_priv->has_map_buffer_range) free(glamor_priv->vb); } xorg-server-1.17.1/glamor/glamor_context.h0000664000175100017510000000352512424353351015477 00000000000000/* * Copyright © 2013 Intel Corporation * * 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. */ /** * @file glamor_context.h * * This is the struct of state required for context switching in * glamor. It has to use types that don't require including either * server headers or Xlib headers, since it will be included by both * the server and the GLX (xlib) code. */ struct glamor_context { /** Either an EGLDisplay or an Xlib Display */ void *display; /** Either a GLXContext or an EGLContext. */ void *ctx; /** The EGLSurface we should MakeCurrent to */ void *drawable; /** The GLXDrawable we should MakeCurrent to */ uint32_t drawable_xid; void (*make_current)(struct glamor_context *glamor_ctx); }; Bool glamor_glx_screen_init(struct glamor_context *glamor_ctx); xorg-server-1.17.1/glamor/glamor_picture.c0000664000175100017510000000727512460362577015501 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #include #include "glamor_priv.h" #include "mipict.h" /* Upload picture to texture. We may need to flip the y axis or * wire alpha to 1. So we may conditional create fbo for the picture. * */ enum glamor_pixmap_status glamor_upload_picture_to_texture(PicturePtr picture) { PixmapPtr pixmap; assert(picture->pDrawable); pixmap = glamor_get_drawable_pixmap(picture->pDrawable); return glamor_upload_pixmap_to_texture(pixmap); } /* * We should already have drawable attached to it, if it has one. * Then set the attached pixmap to is_picture format, and set * the pict format. * */ int glamor_create_picture(PicturePtr picture) { PixmapPtr pixmap; glamor_pixmap_private *pixmap_priv; if (!picture || !picture->pDrawable) return 0; pixmap = glamor_get_drawable_pixmap(picture->pDrawable); pixmap_priv = glamor_get_pixmap_private(pixmap); if (!pixmap_priv) { /* We must create a pixmap priv to track the picture format even * if the pixmap is a pure in memory pixmap. The reason is that * we may need to upload this pixmap to a texture on the fly. During * the uploading, we need to know the picture format. */ glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY); pixmap_priv = glamor_get_pixmap_private(pixmap); } else { if (GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) { /* If the picture format is not compatible with glamor fbo format, * we have to mark this pixmap as a separated texture, and don't * fallback to DDX layer. */ if (pixmap_priv->type == GLAMOR_TEXTURE_DRM && !glamor_pict_format_is_compatible(picture)) glamor_set_pixmap_type(pixmap, GLAMOR_SEPARATE_TEXTURE); } } pixmap_priv->base.is_picture = 1; pixmap_priv->base.picture = picture; return miCreatePicture(picture); } void glamor_destroy_picture(PicturePtr picture) { PixmapPtr pixmap; glamor_pixmap_private *pixmap_priv; if (!picture || !picture->pDrawable) return; pixmap = glamor_get_drawable_pixmap(picture->pDrawable); pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv) { pixmap_priv->base.is_picture = 0; pixmap_priv->base.picture = NULL; } miDestroyPicture(picture); } void glamor_picture_format_fixup(PicturePtr picture, glamor_pixmap_private *pixmap_priv) { pixmap_priv->base.picture = picture; } xorg-server-1.17.1/glamor/glamor_trapezoid.c0000664000175100017510000001270312460362577016017 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Junyan He * */ /** @file glamor_trapezoid.c * * Trapezoid acceleration implementation */ #include "glamor_priv.h" #ifdef RENDER #include "mipict.h" #include "fbpict.h" /** * Creates an appropriate picture for temp mask use. */ static PicturePtr glamor_create_mask_picture(ScreenPtr screen, PicturePtr dst, PictFormatPtr pict_format, CARD16 width, CARD16 height) { PixmapPtr pixmap; PicturePtr picture; int error; if (!pict_format) { if (dst->polyEdge == PolyEdgeSharp) pict_format = PictureMatchFormat(screen, 1, PICT_a1); else pict_format = PictureMatchFormat(screen, 8, PICT_a8); if (!pict_format) return 0; } pixmap = glamor_create_pixmap(screen, 0, 0, pict_format->depth, GLAMOR_CREATE_PIXMAP_CPU); if (!pixmap) return 0; picture = CreatePicture(0, &pixmap->drawable, pict_format, 0, 0, serverClient, &error); glamor_destroy_pixmap(pixmap); return picture; } /** * glamor_trapezoids will generate trapezoid mask accumulating in * system memory. */ void glamor_trapezoids(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int ntrap, xTrapezoid *traps) { ScreenPtr screen = dst->pDrawable->pScreen; BoxRec bounds; PicturePtr picture; INT16 x_dst, y_dst; INT16 x_rel, y_rel; int width, height, stride; PixmapPtr pixmap; pixman_image_t *image = NULL; /* If a mask format wasn't provided, we get to choose, but behavior should * be as if there was no temporary mask the traps were accumulated into. */ if (!mask_format) { if (dst->polyEdge == PolyEdgeSharp) mask_format = PictureMatchFormat(screen, 1, PICT_a1); else mask_format = PictureMatchFormat(screen, 8, PICT_a8); for (; ntrap; ntrap--, traps++) glamor_trapezoids(op, src, dst, mask_format, x_src, y_src, 1, traps); return; } miTrapezoidBounds(ntrap, traps, &bounds); if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) return; x_dst = traps[0].left.p1.x >> 16; y_dst = traps[0].left.p1.y >> 16; width = bounds.x2 - bounds.x1; height = bounds.y2 - bounds.y1; stride = PixmapBytePad(width, mask_format->depth); picture = glamor_create_mask_picture(screen, dst, mask_format, width, height); if (!picture) return; image = pixman_image_create_bits(picture->format, width, height, NULL, stride); if (!image) { FreePicture(picture, 0); return; } for (; ntrap; ntrap--, traps++) pixman_rasterize_trapezoid(image, (pixman_trapezoid_t *) traps, -bounds.x1, -bounds.y1); pixmap = glamor_get_drawable_pixmap(picture->pDrawable); screen->ModifyPixmapHeader(pixmap, width, height, mask_format->depth, BitsPerPixel(mask_format->depth), PixmapBytePad(width, mask_format->depth), pixman_image_get_data(image)); x_rel = bounds.x1 + x_src - x_dst; y_rel = bounds.y1 + y_src - y_dst; CompositePicture(op, src, picture, dst, x_rel, y_rel, 0, 0, bounds.x1, bounds.y1, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); if (image) pixman_image_unref(image); FreePicture(picture, 0); } Bool glamor_trapezoids_nf(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int ntrap, xTrapezoid *traps) { DEBUGF("x_src = %d, y_src = %d, ntrap = %d\n", x_src, y_src, ntrap); glamor_trapezoids(op, src, dst, mask_format, x_src, y_src, ntrap, traps); return TRUE; } #endif /* RENDER */ xorg-server-1.17.1/glamor/glamor_fbo.c0000664000175100017510000004347312460362577014574 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #include #include "glamor_priv.h" #define GLAMOR_CACHE_EXPIRE_MAX 100 #define GLAMOR_CACHE_DEFAULT 0 #define GLAMOR_CACHE_EXACT_SIZE 1 //#define NO_FBO_CACHE 1 #define FBO_CACHE_THRESHOLD (256*1024*1024) /* Loop from the tail to the head. */ #define xorg_list_for_each_entry_reverse(pos, head, member) \ for (pos = __container_of((head)->prev, pos, member); \ &pos->member != (head); \ pos = __container_of(pos->member.prev, pos, member)) #define xorg_list_for_each_entry_safe_reverse(pos, tmp, head, member) \ for (pos = __container_of((head)->prev, pos, member), \ tmp = __container_of(pos->member.prev, pos, member); \ &pos->member != (head); \ pos = tmp, tmp = __container_of(pos->member.prev, tmp, member)) inline static int cache_wbucket(int size) { int order = __fls(size / 32); if (order >= CACHE_BUCKET_WCOUNT) order = CACHE_BUCKET_WCOUNT - 1; return order; } inline static int cache_hbucket(int size) { int order = __fls(size / 32); if (order >= CACHE_BUCKET_HCOUNT) order = CACHE_BUCKET_HCOUNT - 1; return order; } static glamor_pixmap_fbo * glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag) { struct xorg_list *cache; glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL; int n_format; #ifdef NO_FBO_CACHE return NULL; #else n_format = cache_format(format); if (n_format == -1) return NULL; cache = &glamor_priv->fbo_cache[n_format] [cache_wbucket(w)] [cache_hbucket(h)]; if (!(flag & GLAMOR_CACHE_EXACT_SIZE)) { xorg_list_for_each_entry(fbo_entry, cache, list) { if (fbo_entry->width >= w && fbo_entry->height >= h) { DEBUGF("Request w %d h %d format %x \n", w, h, format); DEBUGF("got cache entry %p w %d h %d fbo %d tex %d format %x\n", fbo_entry, fbo_entry->width, fbo_entry->height, fbo_entry->fb, fbo_entry->tex); xorg_list_del(&fbo_entry->list); ret_fbo = fbo_entry; break; } } } else { xorg_list_for_each_entry(fbo_entry, cache, list) { if (fbo_entry->width == w && fbo_entry->height == h) { DEBUGF("Request w %d h %d format %x \n", w, h, format); DEBUGF("got cache entry %p w %d h %d fbo %d tex %d format %x\n", fbo_entry, fbo_entry->width, fbo_entry->height, fbo_entry->fb, fbo_entry->tex, fbo_entry->format); assert(format == fbo_entry->format); xorg_list_del(&fbo_entry->list); ret_fbo = fbo_entry; break; } } } if (ret_fbo) glamor_priv->fbo_cache_watermark -= ret_fbo->width * ret_fbo->height; assert(glamor_priv->fbo_cache_watermark >= 0); return ret_fbo; #endif } static void glamor_purge_fbo(glamor_pixmap_fbo *fbo) { glamor_make_current(fbo->glamor_priv); if (fbo->fb) glDeleteFramebuffers(1, &fbo->fb); if (fbo->tex) glDeleteTextures(1, &fbo->tex); if (fbo->pbo) glDeleteBuffers(1, &fbo->pbo); free(fbo); } static void glamor_pixmap_fbo_cache_put(glamor_pixmap_fbo *fbo) { struct xorg_list *cache; int n_format; #ifdef NO_FBO_CACHE glamor_purge_fbo(fbo); return; #else n_format = cache_format(fbo->format); if (fbo->fb == 0 || fbo->external || n_format == -1 || fbo->glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) { fbo->glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX; glamor_fbo_expire(fbo->glamor_priv); glamor_purge_fbo(fbo); return; } cache = &fbo->glamor_priv->fbo_cache[n_format] [cache_wbucket(fbo->width)] [cache_hbucket(fbo->height)]; DEBUGF ("Put cache entry %p to cache %p w %d h %d format %x fbo %d tex %d \n", fbo, cache, fbo->width, fbo->height, fbo->format, fbo->fb, fbo->tex); fbo->glamor_priv->fbo_cache_watermark += fbo->width * fbo->height; xorg_list_add(&fbo->list, cache); fbo->expire = fbo->glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX; #endif } static int glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo) { int status, err = 0; glamor_make_current(fbo->glamor_priv); if (fbo->fb == 0) glGenFramebuffers(1, &fbo->fb); assert(fbo->tex != 0); glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo->tex, 0); status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { const char *str; switch (status) { case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: str = "incomplete attachment"; break; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: str = "incomplete/missing attachment"; break; case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: str = "incomplete draw buffer"; break; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: str = "incomplete read buffer"; break; case GL_FRAMEBUFFER_UNSUPPORTED: str = "unsupported"; break; case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: str = "incomplete multiple"; break; default: str = "unknown error"; break; } glamor_fallback("glamor: Failed to create fbo, %s\n", str); err = -1; } return err; } glamor_pixmap_fbo * glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, int w, int h, GLenum format, GLint tex, int flag) { glamor_pixmap_fbo *fbo; fbo = calloc(1, sizeof(*fbo)); if (fbo == NULL) return NULL; xorg_list_init(&fbo->list); fbo->tex = tex; fbo->width = w; fbo->height = h; fbo->external = FALSE; fbo->format = format; fbo->glamor_priv = glamor_priv; if (flag == GLAMOR_CREATE_PIXMAP_MAP) { glamor_make_current(glamor_priv); glGenBuffers(1, &fbo->pbo); goto done; } if (flag != GLAMOR_CREATE_FBO_NO_FBO) { if (glamor_pixmap_ensure_fb(fbo) != 0) { glamor_purge_fbo(fbo); fbo = NULL; } } done: return fbo; } void glamor_fbo_expire(glamor_screen_private *glamor_priv) { struct xorg_list *cache; glamor_pixmap_fbo *fbo_entry, *tmp; int i, j, k; for (i = 0; i < CACHE_FORMAT_COUNT; i++) for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { cache = &glamor_priv->fbo_cache[i][j][k]; xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache, list) { if (GLAMOR_TICK_AFTER(fbo_entry->expire, glamor_priv->tick)) { break; } glamor_priv->fbo_cache_watermark -= fbo_entry->width * fbo_entry->height; xorg_list_del(&fbo_entry->list); DEBUGF("cache %p fbo %p expired %d current %d \n", cache, fbo_entry, fbo_entry->expire, glamor_priv->tick); glamor_purge_fbo(fbo_entry); } } } void glamor_init_pixmap_fbo(ScreenPtr screen) { glamor_screen_private *glamor_priv; int i, j, k; glamor_priv = glamor_get_screen_private(screen); for (i = 0; i < CACHE_FORMAT_COUNT; i++) for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { xorg_list_init(&glamor_priv->fbo_cache[i][j][k]); } glamor_priv->fbo_cache_watermark = 0; } void glamor_fini_pixmap_fbo(ScreenPtr screen) { struct xorg_list *cache; glamor_screen_private *glamor_priv; glamor_pixmap_fbo *fbo_entry, *tmp; int i, j, k; glamor_priv = glamor_get_screen_private(screen); for (i = 0; i < CACHE_FORMAT_COUNT; i++) for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { cache = &glamor_priv->fbo_cache[i][j][k]; xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache, list) { xorg_list_del(&fbo_entry->list); glamor_purge_fbo(fbo_entry); } } } void glamor_destroy_fbo(glamor_pixmap_fbo *fbo) { xorg_list_del(&fbo->list); glamor_pixmap_fbo_cache_put(fbo); } static int _glamor_create_tex(glamor_screen_private *glamor_priv, int w, int h, GLenum format) { unsigned int tex = 0; /* With dri3, we want to allocate ARGB8888 pixmaps only. * Depending on the implementation, GL_RGBA might not * give us ARGB8888. We ask glamor_egl to use get * an ARGB8888 based texture for us. */ if (glamor_priv->dri3_enabled && format == GL_RGBA) { tex = glamor_egl_create_argb8888_based_texture(glamor_priv->screen, w, h); } if (!tex) { glamor_make_current(glamor_priv); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, format, GL_UNSIGNED_BYTE, NULL); } return tex; } glamor_pixmap_fbo * glamor_create_fbo(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag) { glamor_pixmap_fbo *fbo; GLint tex = 0; int cache_flag; if (flag == GLAMOR_CREATE_FBO_NO_FBO) goto new_fbo; if (flag == GLAMOR_CREATE_PIXMAP_MAP) goto no_tex; /* Tiling from textures requires exact pixmap sizes. As we don't * know which pixmaps will be used as tiles, just allocate * everything at the requested size */ cache_flag = GLAMOR_CACHE_EXACT_SIZE; fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format, cache_flag); if (fbo) return fbo; new_fbo: tex = _glamor_create_tex(glamor_priv, w, h, format); no_tex: fbo = glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag); return fbo; } static glamor_pixmap_fbo * _glamor_create_fbo_array(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag, int block_w, int block_h, glamor_pixmap_private *pixmap_priv, int has_fbo) { int block_wcnt; int block_hcnt; glamor_pixmap_fbo **fbo_array; BoxPtr box_array; int i, j; glamor_pixmap_private_large_t *priv; priv = &pixmap_priv->large; block_wcnt = (w + block_w - 1) / block_w; block_hcnt = (h + block_h - 1) / block_h; box_array = calloc(block_wcnt * block_hcnt, sizeof(box_array[0])); if (box_array == NULL) return NULL; fbo_array = calloc(block_wcnt * block_hcnt, sizeof(glamor_pixmap_fbo *)); if (fbo_array == NULL) { free(box_array); return FALSE; } for (i = 0; i < block_hcnt; i++) { int block_y1, block_y2; int fbo_w, fbo_h; block_y1 = i * block_h; block_y2 = (block_y1 + block_h) > h ? h : (block_y1 + block_h); fbo_h = block_y2 - block_y1; for (j = 0; j < block_wcnt; j++) { box_array[i * block_wcnt + j].x1 = j * block_w; box_array[i * block_wcnt + j].y1 = block_y1; box_array[i * block_wcnt + j].x2 = (j + 1) * block_w > w ? w : (j + 1) * block_w; box_array[i * block_wcnt + j].y2 = block_y2; fbo_w = box_array[i * block_wcnt + j].x2 - box_array[i * block_wcnt + j].x1; if (!has_fbo) fbo_array[i * block_wcnt + j] = glamor_create_fbo(glamor_priv, fbo_w, fbo_h, format, GLAMOR_CREATE_PIXMAP_FIXUP); else fbo_array[i * block_wcnt + j] = priv->base.fbo; if (fbo_array[i * block_wcnt + j] == NULL) goto cleanup; } } priv->box = box_array[0]; priv->box_array = box_array; priv->fbo_array = fbo_array; priv->block_wcnt = block_wcnt; priv->block_hcnt = block_hcnt; return fbo_array[0]; cleanup: for (i = 0; i < block_wcnt * block_hcnt; i++) if ((fbo_array)[i]) glamor_destroy_fbo((fbo_array)[i]); free(box_array); free(fbo_array); return NULL; } /* Create a fbo array to cover the w*h region, by using block_w*block_h * block.*/ glamor_pixmap_fbo * glamor_create_fbo_array(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag, int block_w, int block_h, glamor_pixmap_private *pixmap_priv) { pixmap_priv->large.block_w = block_w; pixmap_priv->large.block_h = block_h; return _glamor_create_fbo_array(glamor_priv, w, h, format, flag, block_w, block_h, pixmap_priv, 0); } glamor_pixmap_fbo * glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv) { glamor_pixmap_fbo *fbo; if (pixmap_priv == NULL) return NULL; fbo = pixmap_priv->base.fbo; if (fbo == NULL) return NULL; pixmap_priv->base.fbo = NULL; return fbo; } /* The pixmap must not be attached to another fbo. */ void glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo) { glamor_pixmap_private *pixmap_priv; pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv->base.fbo) return; pixmap_priv->base.fbo = fbo; switch (pixmap_priv->type) { case GLAMOR_TEXTURE_LARGE: case GLAMOR_TEXTURE_ONLY: case GLAMOR_TEXTURE_DRM: pixmap_priv->base.gl_fbo = GLAMOR_FBO_NORMAL; if (fbo->tex != 0) pixmap_priv->base.gl_tex = 1; else { /* XXX For the Xephyr only, may be broken now. */ pixmap_priv->base.gl_tex = 0; } case GLAMOR_MEMORY_MAP: pixmap->devPrivate.ptr = NULL; break; default: break; } } void glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv) { glamor_pixmap_fbo *fbo; if (priv->type == GLAMOR_TEXTURE_LARGE) { int i; glamor_pixmap_private_large_t *large = &priv->large; for (i = 0; i < large->block_wcnt * large->block_hcnt; i++) glamor_destroy_fbo(large->fbo_array[i]); free(large->fbo_array); } else { fbo = glamor_pixmap_detach_fbo(priv); if (fbo) glamor_destroy_fbo(fbo); } } Bool glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag) { glamor_screen_private *glamor_priv; glamor_pixmap_private *pixmap_priv; glamor_pixmap_fbo *fbo; glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv->base.fbo == NULL) { fbo = glamor_create_fbo(glamor_priv, pixmap->drawable.width, pixmap->drawable.height, format, flag); if (fbo == NULL) return FALSE; glamor_pixmap_attach_fbo(pixmap, fbo); } else { /* We do have a fbo, but it may lack of fb or tex. */ if (!pixmap_priv->base.fbo->tex) pixmap_priv->base.fbo->tex = _glamor_create_tex(glamor_priv, pixmap->drawable.width, pixmap->drawable.height, format); if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->base.fbo->fb == 0) if (glamor_pixmap_ensure_fb(pixmap_priv->base.fbo) != 0) return FALSE; } return TRUE; } _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back) { glamor_pixmap_private *front_priv, *back_priv; glamor_pixmap_fbo *temp_fbo; front_priv = glamor_get_pixmap_private(front); back_priv = glamor_get_pixmap_private(back); temp_fbo = front_priv->base.fbo; front_priv->base.fbo = back_priv->base.fbo; back_priv->base.fbo = temp_fbo; } xorg-server-1.17.1/glamor/glamor_largepixmap.c0000664000175100017510000016704512460362577016341 00000000000000#include #include "glamor_priv.h" static inline glamor_pixmap_private_large_t * __glamor_large(glamor_pixmap_private *pixmap_priv) { assert(pixmap_priv->type == GLAMOR_TEXTURE_LARGE); return &pixmap_priv->large; } /** * Clip the boxes regards to each pixmap's block array. * * Should translate the region to relative coords to the pixmap, * start at (0,0). */ #if 0 //#define DEBUGF(str, ...) do {} while(0) #define DEBUGF(str, ...) ErrorF(str, ##__VA_ARGS__) //#define DEBUGRegionPrint(x) do {} while (0) #define DEBUGRegionPrint RegionPrint #endif static glamor_pixmap_clipped_regions * __glamor_compute_clipped_regions(int block_w, int block_h, int block_stride, int x, int y, int w, int h, RegionPtr region, int *n_region, int reverse, int upsidedown) { glamor_pixmap_clipped_regions *clipped_regions; BoxPtr extent; int start_x, start_y, end_x, end_y; int start_block_x, start_block_y; int end_block_x, end_block_y; int loop_start_block_x, loop_start_block_y; int loop_end_block_x, loop_end_block_y; int loop_block_stride; int i, j, delta_i, delta_j; RegionRec temp_region; RegionPtr current_region; int block_idx; int k = 0; int temp_block_idx; extent = RegionExtents(region); start_x = MAX(x, extent->x1); start_y = MAX(y, extent->y1); end_x = MIN(x + w, extent->x2); end_y = MIN(y + h, extent->y2); DEBUGF("start compute clipped regions:\n"); DEBUGF("block w %d h %d x %d y %d w %d h %d, block_stride %d \n", block_w, block_h, x, y, w, h, block_stride); DEBUGRegionPrint(region); DEBUGF("start_x %d start_y %d end_x %d end_y %d \n", start_x, start_y, end_x, end_y); if (start_x >= end_x || start_y >= end_y) { *n_region = 0; return NULL; } start_block_x = (start_x - x) / block_w; start_block_y = (start_y - y) / block_h; end_block_x = (end_x - x) / block_w; end_block_y = (end_y - y) / block_h; clipped_regions = calloc((end_block_x - start_block_x + 1) * (end_block_y - start_block_y + 1), sizeof(*clipped_regions)); DEBUGF("startx %d starty %d endx %d endy %d \n", start_x, start_y, end_x, end_y); DEBUGF("start_block_x %d end_block_x %d \n", start_block_x, end_block_x); DEBUGF("start_block_y %d end_block_y %d \n", start_block_y, end_block_y); if (!reverse) { loop_start_block_x = start_block_x; loop_end_block_x = end_block_x + 1; delta_i = 1; } else { loop_start_block_x = end_block_x; loop_end_block_x = start_block_x - 1; delta_i = -1; } if (!upsidedown) { loop_start_block_y = start_block_y; loop_end_block_y = end_block_y + 1; delta_j = 1; } else { loop_start_block_y = end_block_y; loop_end_block_y = start_block_y - 1; delta_j = -1; } loop_block_stride = delta_j * block_stride; block_idx = (loop_start_block_y - delta_j) * block_stride; for (j = loop_start_block_y; j != loop_end_block_y; j += delta_j) { block_idx += loop_block_stride; temp_block_idx = block_idx + loop_start_block_x; for (i = loop_start_block_x; i != loop_end_block_x; i += delta_i, temp_block_idx += delta_i) { BoxRec temp_box; temp_box.x1 = x + i * block_w; temp_box.y1 = y + j * block_h; temp_box.x2 = MIN(temp_box.x1 + block_w, end_x); temp_box.y2 = MIN(temp_box.y1 + block_h, end_y); RegionInitBoxes(&temp_region, &temp_box, 1); DEBUGF("block idx %d \n", temp_block_idx); DEBUGRegionPrint(&temp_region); current_region = RegionCreate(NULL, 4); RegionIntersect(current_region, &temp_region, region); DEBUGF("i %d j %d region: \n", i, j); DEBUGRegionPrint(current_region); if (RegionNumRects(current_region)) { clipped_regions[k].region = current_region; clipped_regions[k].block_idx = temp_block_idx; k++; } else RegionDestroy(current_region); RegionUninit(&temp_region); } } *n_region = k; return clipped_regions; } /** * Do a two round clipping, * first is to clip the region regard to current pixmap's * block array. Then for each clipped region, do a inner * block clipping. This is to make sure the final result * will be shapped by inner_block_w and inner_block_h, and * the final region also will not cross the pixmap's block * boundary. * * This is mainly used by transformation support when do * compositing. */ glamor_pixmap_clipped_regions * glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv, RegionPtr region, int *n_region, int inner_block_w, int inner_block_h, int reverse, int upsidedown) { glamor_pixmap_clipped_regions *clipped_regions, *inner_regions, *result_regions; int i, j, x, y, k, inner_n_regions; int width, height; BoxPtr box_array; BoxRec small_box; int block_w, block_h; DEBUGF("ext called \n"); if (pixmap_priv->type != GLAMOR_TEXTURE_LARGE) { clipped_regions = calloc(1, sizeof(*clipped_regions)); if (clipped_regions == NULL) { *n_region = 0; return NULL; } clipped_regions[0].region = RegionCreate(NULL, 1); clipped_regions[0].block_idx = 0; RegionCopy(clipped_regions[0].region, region); *n_region = 1; block_w = pixmap_priv->base.pixmap->drawable.width; block_h = pixmap_priv->base.pixmap->drawable.height; box_array = &small_box; small_box.x1 = small_box.y1 = 0; small_box.x2 = block_w; small_box.y2 = block_h; } else { glamor_pixmap_private_large_t *priv = __glamor_large(pixmap_priv); clipped_regions = __glamor_compute_clipped_regions(priv->block_w, priv->block_h, priv->block_wcnt, 0, 0, priv->base.pixmap-> drawable.width, priv->base.pixmap-> drawable.height, region, n_region, reverse, upsidedown); if (clipped_regions == NULL) { *n_region = 0; return NULL; } block_w = priv->block_w; block_h = priv->block_h; box_array = priv->box_array; } if (inner_block_w >= block_w && inner_block_h >= block_h) return clipped_regions; result_regions = calloc(*n_region * ((block_w + inner_block_w - 1) / inner_block_w) * ((block_h + inner_block_h - 1) / inner_block_h), sizeof(*result_regions)); k = 0; for (i = 0; i < *n_region; i++) { x = box_array[clipped_regions[i].block_idx].x1; y = box_array[clipped_regions[i].block_idx].y1; width = box_array[clipped_regions[i].block_idx].x2 - x; height = box_array[clipped_regions[i].block_idx].y2 - y; inner_regions = __glamor_compute_clipped_regions(inner_block_w, inner_block_h, 0, x, y, width, height, clipped_regions[i]. region, &inner_n_regions, reverse, upsidedown); for (j = 0; j < inner_n_regions; j++) { result_regions[k].region = inner_regions[j].region; result_regions[k].block_idx = clipped_regions[i].block_idx; k++; } free(inner_regions); } *n_region = k; free(clipped_regions); return result_regions; } /* * * For the repeat pad mode, we can simply convert the region and * let the out-of-box region can cover the needed edge of the source/mask * Then apply a normal clip we can get what we want. */ static RegionPtr _glamor_convert_pad_region(RegionPtr region, int w, int h) { RegionPtr pad_region; int nrect; BoxPtr box; int overlap; nrect = RegionNumRects(region); box = RegionRects(region); pad_region = RegionCreate(NULL, 4); if (pad_region == NULL) return NULL; while (nrect--) { BoxRec pad_box; RegionRec temp_region; pad_box = *box; if (pad_box.x1 < 0 && pad_box.x2 <= 0) pad_box.x2 = 1; else if (pad_box.x1 >= w && pad_box.x2 > w) pad_box.x1 = w - 1; if (pad_box.y1 < 0 && pad_box.y2 <= 0) pad_box.y2 = 1; else if (pad_box.y1 >= h && pad_box.y2 > h) pad_box.y1 = h - 1; RegionInitBoxes(&temp_region, &pad_box, 1); RegionAppend(pad_region, &temp_region); RegionUninit(&temp_region); box++; } RegionValidate(pad_region, &overlap); return pad_region; } /* * For one type of large pixmap, its one direction is not exceed the * size limitation, and in another word, on one direction it has only * one block. * * This case of reflect repeating, we can optimize it and avoid repeat * clip on that direction. We can just enlarge the repeat box and can * cover all the dest region on that direction. But latter, we need to * fixup the clipped result to get a correct coords for the subsequent * processing. This function is to do the coords correction. * * */ static void _glamor_largepixmap_reflect_fixup(short *xy1, short *xy2, int wh) { int odd1, odd2; int c1, c2; if (*xy2 - *xy1 > wh) { *xy1 = 0; *xy2 = wh; return; } modulus(*xy1, wh, c1); odd1 = ((*xy1 - c1) / wh) & 0x1; modulus(*xy2, wh, c2); odd2 = ((*xy2 - c2) / wh) & 0x1; if (odd1 && odd2) { *xy1 = wh - c2; *xy2 = wh - c1; } else if (odd1 && !odd2) { *xy1 = 0; *xy2 = MAX(c2, wh - c1); } else if (!odd1 && odd2) { *xy2 = wh; *xy1 = MIN(c1, wh - c2); } else { *xy1 = c1; *xy2 = c2; } } /** * Clip the boxes regards to each pixmap's block array. * * Should translate the region to relative coords to the pixmap, * start at (0,0). * * @is_transform: if it is set, it has a transform matrix. * */ static glamor_pixmap_clipped_regions * _glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv, RegionPtr region, int *n_region, int repeat_type, int is_transform, int reverse, int upsidedown) { glamor_pixmap_clipped_regions *clipped_regions; BoxPtr extent; int i, j; RegionPtr current_region; int pixmap_width, pixmap_height; int m; BoxRec repeat_box; RegionRec repeat_region; int right_shift = 0; int down_shift = 0; int x_center_shift = 0, y_center_shift = 0; glamor_pixmap_private_large_t *priv; DEBUGRegionPrint(region); if (pixmap_priv->type != GLAMOR_TEXTURE_LARGE) { clipped_regions = calloc(1, sizeof(*clipped_regions)); clipped_regions[0].region = RegionCreate(NULL, 1); clipped_regions[0].block_idx = 0; RegionCopy(clipped_regions[0].region, region); *n_region = 1; return clipped_regions; } priv = __glamor_large(pixmap_priv); pixmap_width = priv->base.pixmap->drawable.width; pixmap_height = priv->base.pixmap->drawable.height; if (repeat_type == 0 || repeat_type == RepeatPad) { RegionPtr saved_region = NULL; if (repeat_type == RepeatPad) { saved_region = region; region = _glamor_convert_pad_region(saved_region, pixmap_width, pixmap_height); if (region == NULL) { *n_region = 0; return NULL; } } clipped_regions = __glamor_compute_clipped_regions(priv->block_w, priv->block_h, priv->block_wcnt, 0, 0, priv->base.pixmap-> drawable.width, priv->base.pixmap-> drawable.height, region, n_region, reverse, upsidedown); if (saved_region) RegionDestroy(region); return clipped_regions; } extent = RegionExtents(region); x_center_shift = extent->x1 / pixmap_width; if (x_center_shift < 0) x_center_shift--; if (abs(x_center_shift) & 1) x_center_shift++; y_center_shift = extent->y1 / pixmap_height; if (y_center_shift < 0) y_center_shift--; if (abs(y_center_shift) & 1) y_center_shift++; if (extent->x1 < 0) right_shift = ((-extent->x1 + pixmap_width - 1) / pixmap_width); if (extent->y1 < 0) down_shift = ((-extent->y1 + pixmap_height - 1) / pixmap_height); if (right_shift != 0 || down_shift != 0) { if (repeat_type == RepeatReflect) { right_shift = (right_shift + 1) & ~1; down_shift = (down_shift + 1) & ~1; } RegionTranslate(region, right_shift * pixmap_width, down_shift * pixmap_height); } extent = RegionExtents(region); /* Tile a large pixmap to another large pixmap. * We can't use the target large pixmap as the * loop variable, instead we need to loop for all * the blocks in the tile pixmap. * * simulate repeat each single block to cover the * target's blocks. Two special case: * a block_wcnt == 1 or block_hcnt ==1, then we * only need to loop one direction as the other * direction is fully included in the first block. * * For the other cases, just need to start * from a proper shiftx/shifty, and then increase * y by tile_height each time to walk trhough the * target block and then walk trhough the target * at x direction by increate tile_width each time. * * This way, we can consolidate all the sub blocks * of the target boxes into one tile source's block. * * */ m = 0; clipped_regions = calloc(priv->block_wcnt * priv->block_hcnt, sizeof(*clipped_regions)); if (clipped_regions == NULL) { *n_region = 0; return NULL; } if (right_shift != 0 || down_shift != 0) { DEBUGF("region to be repeated shifted \n"); DEBUGRegionPrint(region); } DEBUGF("repeat pixmap width %d height %d \n", pixmap_width, pixmap_height); DEBUGF("extent x1 %d y1 %d x2 %d y2 %d \n", extent->x1, extent->y1, extent->x2, extent->y2); for (j = 0; j < priv->block_hcnt; j++) { for (i = 0; i < priv->block_wcnt; i++) { int dx = pixmap_width; int dy = pixmap_height; int idx; int shift_x; int shift_y; int saved_y1, saved_y2; int x_idx = 0, y_idx = 0, saved_y_idx = 0; RegionRec temp_region; BoxRec reflect_repeat_box; BoxPtr valid_repeat_box; shift_x = (extent->x1 / pixmap_width) * pixmap_width; shift_y = (extent->y1 / pixmap_height) * pixmap_height; idx = j * priv->block_wcnt + i; if (repeat_type == RepeatReflect) { x_idx = (extent->x1 / pixmap_width); y_idx = (extent->y1 / pixmap_height); } /* Construct a rect to clip the target region. */ repeat_box.x1 = shift_x + priv->box_array[idx].x1; repeat_box.y1 = shift_y + priv->box_array[idx].y1; if (priv->block_wcnt == 1) { repeat_box.x2 = extent->x2; dx = extent->x2 - repeat_box.x1; } else repeat_box.x2 = shift_x + priv->box_array[idx].x2; if (priv->block_hcnt == 1) { repeat_box.y2 = extent->y2; dy = extent->y2 - repeat_box.y1; } else repeat_box.y2 = shift_y + priv->box_array[idx].y2; current_region = RegionCreate(NULL, 4); RegionInit(&temp_region, NULL, 4); DEBUGF("init repeat box %d %d %d %d \n", repeat_box.x1, repeat_box.y1, repeat_box.x2, repeat_box.y2); if (repeat_type == RepeatNormal) { saved_y1 = repeat_box.y1; saved_y2 = repeat_box.y2; for (; repeat_box.x1 < extent->x2; repeat_box.x1 += dx, repeat_box.x2 += dx) { repeat_box.y1 = saved_y1; repeat_box.y2 = saved_y2; for (repeat_box.y1 = saved_y1, repeat_box.y2 = saved_y2; repeat_box.y1 < extent->y2; repeat_box.y1 += dy, repeat_box.y2 += dy) { RegionInitBoxes(&repeat_region, &repeat_box, 1); DEBUGF("Start to clip repeat region: \n"); DEBUGRegionPrint(&repeat_region); RegionIntersect(&temp_region, &repeat_region, region); DEBUGF("clip result:\n"); DEBUGRegionPrint(&temp_region); RegionAppend(current_region, &temp_region); RegionUninit(&repeat_region); } } } else if (repeat_type == RepeatReflect) { saved_y1 = repeat_box.y1; saved_y2 = repeat_box.y2; saved_y_idx = y_idx; for (;; repeat_box.x1 += dx, repeat_box.x2 += dx) { repeat_box.y1 = saved_y1; repeat_box.y2 = saved_y2; y_idx = saved_y_idx; reflect_repeat_box.x1 = (x_idx & 1) ? ((2 * x_idx + 1) * dx - repeat_box.x2) : repeat_box.x1; reflect_repeat_box.x2 = (x_idx & 1) ? ((2 * x_idx + 1) * dx - repeat_box.x1) : repeat_box.x2; valid_repeat_box = &reflect_repeat_box; if (valid_repeat_box->x1 >= extent->x2) break; for (repeat_box.y1 = saved_y1, repeat_box.y2 = saved_y2;; repeat_box.y1 += dy, repeat_box.y2 += dy) { DEBUGF("x_idx %d y_idx %d dx %d dy %d\n", x_idx, y_idx, dx, dy); DEBUGF("repeat box %d %d %d %d \n", repeat_box.x1, repeat_box.y1, repeat_box.x2, repeat_box.y2); if (priv->block_hcnt > 1) { reflect_repeat_box.y1 = (y_idx & 1) ? ((2 * y_idx + 1) * dy - repeat_box.y2) : repeat_box.y1; reflect_repeat_box.y2 = (y_idx & 1) ? ((2 * y_idx + 1) * dy - repeat_box.y1) : repeat_box.y2; } else { reflect_repeat_box.y1 = repeat_box.y1; reflect_repeat_box.y2 = repeat_box.y2; } DEBUGF("valid_repeat_box x1 %d y1 %d \n", valid_repeat_box->x1, valid_repeat_box->y1); if (valid_repeat_box->y1 >= extent->y2) break; RegionInitBoxes(&repeat_region, valid_repeat_box, 1); DEBUGF("start to clip repeat[reflect] region: \n"); DEBUGRegionPrint(&repeat_region); RegionIntersect(&temp_region, &repeat_region, region); DEBUGF("result:\n"); DEBUGRegionPrint(&temp_region); if (is_transform && RegionNumRects(&temp_region)) { BoxRec temp_box; BoxPtr temp_extent; temp_extent = RegionExtents(&temp_region); if (priv->block_wcnt > 1) { if (x_idx & 1) { temp_box.x1 = ((2 * x_idx + 1) * dx - temp_extent->x2); temp_box.x2 = ((2 * x_idx + 1) * dx - temp_extent->x1); } else { temp_box.x1 = temp_extent->x1; temp_box.x2 = temp_extent->x2; } modulus(temp_box.x1, pixmap_width, temp_box.x1); modulus(temp_box.x2, pixmap_width, temp_box.x2); if (temp_box.x2 == 0) temp_box.x2 = pixmap_width; } else { temp_box.x1 = temp_extent->x1; temp_box.x2 = temp_extent->x2; _glamor_largepixmap_reflect_fixup(&temp_box.x1, &temp_box.x2, pixmap_width); } if (priv->block_hcnt > 1) { if (y_idx & 1) { temp_box.y1 = ((2 * y_idx + 1) * dy - temp_extent->y2); temp_box.y2 = ((2 * y_idx + 1) * dy - temp_extent->y1); } else { temp_box.y1 = temp_extent->y1; temp_box.y2 = temp_extent->y2; } modulus(temp_box.y1, pixmap_height, temp_box.y1); modulus(temp_box.y2, pixmap_height, temp_box.y2); if (temp_box.y2 == 0) temp_box.y2 = pixmap_height; } else { temp_box.y1 = temp_extent->y1; temp_box.y2 = temp_extent->y2; _glamor_largepixmap_reflect_fixup(&temp_box.y1, &temp_box.y2, pixmap_height); } RegionInitBoxes(&temp_region, &temp_box, 1); RegionTranslate(&temp_region, x_center_shift * pixmap_width, y_center_shift * pixmap_height); DEBUGF("for transform result:\n"); DEBUGRegionPrint(&temp_region); } RegionAppend(current_region, &temp_region); RegionUninit(&repeat_region); y_idx++; } x_idx++; } } DEBUGF("dx %d dy %d \n", dx, dy); if (RegionNumRects(current_region)) { if ((right_shift != 0 || down_shift != 0) && !(is_transform && repeat_type == RepeatReflect)) RegionTranslate(current_region, -right_shift * pixmap_width, -down_shift * pixmap_height); clipped_regions[m].region = current_region; clipped_regions[m].block_idx = idx; m++; } else RegionDestroy(current_region); RegionUninit(&temp_region); } } if (right_shift != 0 || down_shift != 0) RegionTranslate(region, -right_shift * pixmap_width, -down_shift * pixmap_height); *n_region = m; return clipped_regions; } glamor_pixmap_clipped_regions * glamor_compute_clipped_regions(glamor_pixmap_private *priv, RegionPtr region, int *n_region, int repeat_type, int reverse, int upsidedown) { return _glamor_compute_clipped_regions(priv, region, n_region, repeat_type, 0, reverse, upsidedown); } /* XXX overflow still exist. maybe we need to change to use region32. * by default. Or just use region32 for repeat cases? **/ glamor_pixmap_clipped_regions * glamor_compute_transform_clipped_regions(glamor_pixmap_private *priv, struct pixman_transform *transform, RegionPtr region, int *n_region, int dx, int dy, int repeat_type, int reverse, int upsidedown) { BoxPtr temp_extent; struct pixman_box32 temp_box; struct pixman_box16 short_box; RegionPtr temp_region; glamor_pixmap_clipped_regions *ret; temp_region = RegionCreate(NULL, 4); temp_extent = RegionExtents(region); DEBUGF("dest region \n"); DEBUGRegionPrint(region); /* dx/dy may exceed MAX SHORT. we have to use * a box32 to represent it.*/ temp_box.x1 = temp_extent->x1 + dx; temp_box.x2 = temp_extent->x2 + dx; temp_box.y1 = temp_extent->y1 + dy; temp_box.y2 = temp_extent->y2 + dy; DEBUGF("source box %d %d %d %d \n", temp_box.x1, temp_box.y1, temp_box.x2, temp_box.y2); if (transform) glamor_get_transform_extent_from_box(&temp_box, transform); if (repeat_type == RepeatNone) { if (temp_box.x1 < 0) temp_box.x1 = 0; if (temp_box.y1 < 0) temp_box.y1 = 0; temp_box.x2 = MIN(temp_box.x2, priv->base.pixmap->drawable.width); temp_box.y2 = MIN(temp_box.y2, priv->base.pixmap->drawable.height); } /* Now copy back the box32 to a box16 box. */ short_box.x1 = temp_box.x1; short_box.y1 = temp_box.y1; short_box.x2 = temp_box.x2; short_box.y2 = temp_box.y2; RegionInitBoxes(temp_region, &short_box, 1); DEBUGF("copy to temp source region \n"); DEBUGRegionPrint(temp_region); ret = _glamor_compute_clipped_regions(priv, temp_region, n_region, repeat_type, 1, reverse, upsidedown); DEBUGF("n_regions = %d \n", *n_region); RegionDestroy(temp_region); return ret; } /* * As transform and repeatpad mode. * We may get a clipped result which in multipe regions. * It's not easy to do a 2nd round clipping just as we do * without transform/repeatPad. As it's not easy to reverse * the 2nd round clipping result with a transform/repeatPad mode, * or even impossible for some transformation. * * So we have to merge the fragmental region into one region * if the clipped result cross the region boundary. */ static void glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv, int repeat_type, glamor_pixmap_clipped_regions *clipped_regions, int *n_regions, int *need_clean_fbo) { BoxPtr temp_extent; BoxRec temp_box, copy_box; RegionPtr temp_region; glamor_pixmap_private *temp_priv; PixmapPtr temp_pixmap; int overlap; int i; int pixmap_width, pixmap_height; glamor_pixmap_private_large_t *priv; priv = __glamor_large(pixmap_priv); pixmap_width = priv->base.pixmap->drawable.width; pixmap_height = priv->base.pixmap->drawable.height; temp_region = RegionCreate(NULL, 4); for (i = 0; i < *n_regions; i++) { DEBUGF("Region %d:\n", i); DEBUGRegionPrint(clipped_regions[i].region); RegionAppend(temp_region, clipped_regions[i].region); } RegionValidate(temp_region, &overlap); DEBUGF("temp region: \n"); DEBUGRegionPrint(temp_region); temp_extent = RegionExtents(temp_region); temp_box = *temp_extent; DEBUGF("need copy region: \n"); DEBUGF("%d %d %d %d \n", temp_box.x1, temp_box.y1, temp_box.x2, temp_box.y2); temp_pixmap = glamor_create_pixmap(priv->base.pixmap->drawable.pScreen, temp_box.x2 - temp_box.x1, temp_box.y2 - temp_box.y1, priv->base.pixmap->drawable.depth, GLAMOR_CREATE_PIXMAP_FIXUP); if (temp_pixmap == NULL) { assert(0); return; } temp_priv = glamor_get_pixmap_private(temp_pixmap); assert(temp_priv->type != GLAMOR_TEXTURE_LARGE); priv->box = temp_box; if (temp_extent->x1 >= 0 && temp_extent->x2 <= pixmap_width && temp_extent->y1 >= 0 && temp_extent->y2 <= pixmap_height) { int dx, dy; copy_box.x1 = 0; copy_box.y1 = 0; copy_box.x2 = temp_extent->x2 - temp_extent->x1; copy_box.y2 = temp_extent->y2 - temp_extent->y1; dx = temp_extent->x1; dy = temp_extent->y1; glamor_copy(&priv->base.pixmap->drawable, &temp_pixmap->drawable, NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL); // glamor_solid(temp_pixmap, 0, 0, temp_pixmap->drawable.width, // temp_pixmap->drawable.height, GXcopy, 0xffffffff, 0xff00); } else { for (i = 0; i < *n_regions; i++) { BoxPtr box; int nbox; box = REGION_RECTS(clipped_regions[i].region); nbox = REGION_NUM_RECTS(clipped_regions[i].region); while (nbox--) { int dx, dy, c, d; DEBUGF("box x1 %d y1 %d x2 %d y2 %d \n", box->x1, box->y1, box->x2, box->y2); modulus(box->x1, pixmap_width, c); dx = c - (box->x1 - temp_box.x1); copy_box.x1 = box->x1 - temp_box.x1; copy_box.x2 = box->x2 - temp_box.x1; modulus(box->y1, pixmap_height, d); dy = d - (box->y1 - temp_box.y1); copy_box.y1 = box->y1 - temp_box.y1; copy_box.y2 = box->y2 - temp_box.y1; DEBUGF("copying box %d %d %d %d, dx %d dy %d\n", copy_box.x1, copy_box.y1, copy_box.x2, copy_box.y2, dx, dy); glamor_copy(&priv->base.pixmap->drawable, &temp_pixmap->drawable, NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL); box++; } } //glamor_solid(temp_pixmap, 0, 0, temp_pixmap->drawable.width, // temp_pixmap->drawable.height, GXcopy, 0xffffffff, 0xff); } /* The first region will be released at caller side. */ for (i = 1; i < *n_regions; i++) RegionDestroy(clipped_regions[i].region); RegionDestroy(temp_region); priv->box = temp_box; priv->base.fbo = glamor_pixmap_detach_fbo(temp_priv); DEBUGF("priv box x1 %d y1 %d x2 %d y2 %d \n", priv->box.x1, priv->box.y1, priv->box.x2, priv->box.y2); glamor_destroy_pixmap(temp_pixmap); *need_clean_fbo = 1; *n_regions = 1; } /** * Given an expected transformed block width and block height, * * This function calculate a new block width and height which * guarantee the transform result will not exceed the given * block width and height. * * For large block width and height (> 2048), we choose a * smaller new width and height and to reduce the cross region * boundary and can avoid some overhead. * **/ Bool glamor_get_transform_block_size(struct pixman_transform *transform, int block_w, int block_h, int *transformed_block_w, int *transformed_block_h) { double a, b, c, d, e, f, g, h; double scale; int width, height; a = pixman_fixed_to_double(transform->matrix[0][0]); b = pixman_fixed_to_double(transform->matrix[0][1]); c = pixman_fixed_to_double(transform->matrix[1][0]); d = pixman_fixed_to_double(transform->matrix[1][1]); scale = pixman_fixed_to_double(transform->matrix[2][2]); if (block_w > 2048) { /* For large block size, we shrink it to smaller box, * thus latter we may get less cross boundary regions and * thus can avoid some extra copy. * **/ width = block_w / 4; height = block_h / 4; } else { width = block_w - 2; height = block_h - 2; } e = a + b; f = c + d; g = a - b; h = c - d; e = MIN(block_w, floor(width * scale) / MAX(fabs(e), fabs(g))); f = MIN(block_h, floor(height * scale) / MAX(fabs(f), fabs(h))); *transformed_block_w = MIN(e, f) - 1; *transformed_block_h = *transformed_block_w; if (*transformed_block_w <= 0 || *transformed_block_h <= 0) return FALSE; DEBUGF("original block_w/h %d %d, fixed %d %d \n", block_w, block_h, *transformed_block_w, *transformed_block_h); return TRUE; } #define VECTOR_FROM_POINT(p, x, y) \ p.v[0] = x; \ p.v[1] = y; \ p.v[2] = 1.0; void glamor_get_transform_extent_from_box(struct pixman_box32 *box, struct pixman_transform *transform) { struct pixman_f_vector p0, p1, p2, p3; float min_x, min_y, max_x, max_y; struct pixman_f_transform ftransform; VECTOR_FROM_POINT(p0, box->x1, box->y1) VECTOR_FROM_POINT(p1, box->x2, box->y1) VECTOR_FROM_POINT(p2, box->x2, box->y2) VECTOR_FROM_POINT(p3, box->x1, box->y2) pixman_f_transform_from_pixman_transform(&ftransform, transform); pixman_f_transform_point(&ftransform, &p0); pixman_f_transform_point(&ftransform, &p1); pixman_f_transform_point(&ftransform, &p2); pixman_f_transform_point(&ftransform, &p3); min_x = MIN(p0.v[0], p1.v[0]); min_x = MIN(min_x, p2.v[0]); min_x = MIN(min_x, p3.v[0]); min_y = MIN(p0.v[1], p1.v[1]); min_y = MIN(min_y, p2.v[1]); min_y = MIN(min_y, p3.v[1]); max_x = MAX(p0.v[0], p1.v[0]); max_x = MAX(max_x, p2.v[0]); max_x = MAX(max_x, p3.v[0]); max_y = MAX(p0.v[1], p1.v[1]); max_y = MAX(max_y, p2.v[1]); max_y = MAX(max_y, p3.v[1]); box->x1 = floor(min_x) - 1; box->y1 = floor(min_y) - 1; box->x2 = ceil(max_x) + 1; box->y2 = ceil(max_y) + 1; } static void _glamor_process_transformed_clipped_region(glamor_pixmap_private *priv, int repeat_type, glamor_pixmap_clipped_regions * clipped_regions, int *n_regions, int *need_clean_fbo) { int shift_x, shift_y; if (*n_regions != 1) { /* Merge all source regions into one region. */ glamor_merge_clipped_regions(priv, repeat_type, clipped_regions, n_regions, need_clean_fbo); } else { glamor_set_pixmap_fbo_current(priv, clipped_regions[0].block_idx); if (repeat_type == RepeatReflect || repeat_type == RepeatNormal) { /* The required source areas are in one region, * we need to shift the corresponding box's coords to proper position, * thus we can calculate the relative coords correctly.*/ BoxPtr temp_box; int rem; temp_box = RegionExtents(clipped_regions[0].region); modulus(temp_box->x1, priv->base.pixmap->drawable.width, rem); shift_x = (temp_box->x1 - rem) / priv->base.pixmap->drawable.width; modulus(temp_box->y1, priv->base.pixmap->drawable.height, rem); shift_y = (temp_box->y1 - rem) / priv->base.pixmap->drawable.height; if (shift_x != 0) { __glamor_large(priv)->box.x1 += shift_x * priv->base.pixmap->drawable.width; __glamor_large(priv)->box.x2 += shift_x * priv->base.pixmap->drawable.width; } if (shift_y != 0) { __glamor_large(priv)->box.y1 += shift_y * priv->base.pixmap->drawable.height; __glamor_large(priv)->box.y2 += shift_y * priv->base.pixmap->drawable.height; } } } } Bool glamor_composite_largepixmap_region(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, glamor_pixmap_private *source_pixmap_priv, glamor_pixmap_private *mask_pixmap_priv, glamor_pixmap_private *dest_pixmap_priv, RegionPtr region, Bool force_clip, INT16 x_source, INT16 y_source, INT16 x_mask, INT16 y_mask, INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height) { glamor_pixmap_clipped_regions *clipped_dest_regions; glamor_pixmap_clipped_regions *clipped_source_regions; glamor_pixmap_clipped_regions *clipped_mask_regions; int n_dest_regions; int n_mask_regions; int n_source_regions; int i, j, k; int need_clean_source_fbo = 0; int need_clean_mask_fbo = 0; int is_normal_source_fbo = 0; int is_normal_mask_fbo = 0; int fixed_block_width, fixed_block_height; int dest_block_width, dest_block_height; int null_source, null_mask; glamor_pixmap_private *need_free_source_pixmap_priv = NULL; glamor_pixmap_private *need_free_mask_pixmap_priv = NULL; int source_repeat_type = 0, mask_repeat_type = 0; int ok = TRUE; if (source->repeat) source_repeat_type = source->repeatType; else source_repeat_type = RepeatNone; if (mask && mask->repeat) mask_repeat_type = mask->repeatType; else mask_repeat_type = RepeatNone; if (dest_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { dest_block_width = __glamor_large(dest_pixmap_priv)->block_w; dest_block_height = __glamor_large(dest_pixmap_priv)->block_h; } else { dest_block_width = dest_pixmap_priv->base.pixmap->drawable.width; dest_block_height = dest_pixmap_priv->base.pixmap->drawable.height; } fixed_block_width = dest_block_width; fixed_block_height = dest_block_height; /* If we got an totally out-of-box region for a source or mask * region without repeat, we need to set it as null_source and * give it a solid color (0,0,0,0). */ null_source = 0; null_mask = 0; RegionTranslate(region, -dest->pDrawable->x, -dest->pDrawable->y); /* need to transform the dest region to the correct sourcei/mask region. * it's a little complex, as one single edge of the * target region may be transformed to cross a block boundary of the * source or mask. Then it's impossible to handle it as usual way. * We may have to split the original dest region to smaller region, and * make sure each region's transformed region can fit into one texture, * and then continue this loop again, and each time when a transformed region * cross the bound, we need to copy it to a single pixmap and do the composition * with the new pixmap. If the transformed region doesn't cross a source/mask's * boundary then we don't need to copy. * */ if (source_pixmap_priv && source->transform && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { int source_transformed_block_width, source_transformed_block_height; if (!glamor_get_transform_block_size(source->transform, __glamor_large(source_pixmap_priv)->block_w, __glamor_large(source_pixmap_priv)->block_h, &source_transformed_block_width, &source_transformed_block_height)) { DEBUGF("source block size less than 1, fallback.\n"); RegionTranslate(region, dest->pDrawable->x, dest->pDrawable->y); return FALSE; } fixed_block_width = min(fixed_block_width, source_transformed_block_width); fixed_block_height = min(fixed_block_height, source_transformed_block_height); DEBUGF("new source block size %d x %d \n", fixed_block_width, fixed_block_height); } if (mask_pixmap_priv && mask->transform && mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { int mask_transformed_block_width, mask_transformed_block_height; if (!glamor_get_transform_block_size(mask->transform, __glamor_large(mask_pixmap_priv)->block_w, __glamor_large(mask_pixmap_priv)->block_h, &mask_transformed_block_width, &mask_transformed_block_height)) { DEBUGF("mask block size less than 1, fallback.\n"); RegionTranslate(region, dest->pDrawable->x, dest->pDrawable->y); return FALSE; } fixed_block_width = min(fixed_block_width, mask_transformed_block_width); fixed_block_height = min(fixed_block_height, mask_transformed_block_height); DEBUGF("new mask block size %d x %d \n", fixed_block_width, fixed_block_height); } /*compute the correct block width and height whose transformed source/mask *region can fit into one texture.*/ if (force_clip || fixed_block_width < dest_block_width || fixed_block_height < dest_block_height) clipped_dest_regions = glamor_compute_clipped_regions_ext(dest_pixmap_priv, region, &n_dest_regions, fixed_block_width, fixed_block_height, 0, 0); else clipped_dest_regions = glamor_compute_clipped_regions(dest_pixmap_priv, region, &n_dest_regions, 0, 0, 0); DEBUGF("dest clipped result %d region: \n", n_dest_regions); if (source_pixmap_priv && (source_pixmap_priv == dest_pixmap_priv || source_pixmap_priv == mask_pixmap_priv) && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { /* XXX self-copy... */ need_free_source_pixmap_priv = source_pixmap_priv; source_pixmap_priv = malloc(sizeof(*source_pixmap_priv)); *source_pixmap_priv = *need_free_source_pixmap_priv; need_free_source_pixmap_priv = source_pixmap_priv; } assert(mask_pixmap_priv != dest_pixmap_priv); for (i = 0; i < n_dest_regions; i++) { DEBUGF("dest region %d idx %d\n", i, clipped_dest_regions[i].block_idx); DEBUGRegionPrint(clipped_dest_regions[i].region); glamor_set_pixmap_fbo_current(dest_pixmap_priv, clipped_dest_regions[i].block_idx); if (source_pixmap_priv && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { if (!source->transform && source_repeat_type != RepeatPad) { RegionTranslate(clipped_dest_regions[i].region, x_source - x_dest, y_source - y_dest); clipped_source_regions = glamor_compute_clipped_regions(source_pixmap_priv, clipped_dest_regions[i]. region, &n_source_regions, source_repeat_type, 0, 0); is_normal_source_fbo = 1; } else { clipped_source_regions = glamor_compute_transform_clipped_regions(source_pixmap_priv, source->transform, clipped_dest_regions [i].region, &n_source_regions, x_source - x_dest, y_source - y_dest, source_repeat_type, 0, 0); is_normal_source_fbo = 0; if (n_source_regions == 0) { /* Pad the out-of-box region to (0,0,0,0). */ null_source = 1; n_source_regions = 1; } else _glamor_process_transformed_clipped_region (source_pixmap_priv, source_repeat_type, clipped_source_regions, &n_source_regions, &need_clean_source_fbo); } DEBUGF("source clipped result %d region: \n", n_source_regions); for (j = 0; j < n_source_regions; j++) { if (is_normal_source_fbo) glamor_set_pixmap_fbo_current(source_pixmap_priv, clipped_source_regions[j].block_idx); if (mask_pixmap_priv && mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { if (is_normal_mask_fbo && is_normal_source_fbo) { /* both mask and source are normal fbo box without transform or repeatpad. * The region is clipped against source and then we clip it against mask here.*/ DEBUGF("source region %d idx %d\n", j, clipped_source_regions[j].block_idx); DEBUGRegionPrint(clipped_source_regions[j].region); RegionTranslate(clipped_source_regions[j].region, -x_source + x_mask, -y_source + y_mask); clipped_mask_regions = glamor_compute_clipped_regions(mask_pixmap_priv, clipped_source_regions [j].region, &n_mask_regions, mask_repeat_type, 0, 0); is_normal_mask_fbo = 1; } else if (is_normal_mask_fbo && !is_normal_source_fbo) { assert(n_source_regions == 1); /* The source fbo is not a normal fbo box, it has transform or repeatpad. * the valid clip region should be the clip dest region rather than the * clip source region.*/ RegionTranslate(clipped_dest_regions[i].region, -x_dest + x_mask, -y_dest + y_mask); clipped_mask_regions = glamor_compute_clipped_regions(mask_pixmap_priv, clipped_dest_regions [i].region, &n_mask_regions, mask_repeat_type, 0, 0); is_normal_mask_fbo = 1; } else { /* This mask region has transform or repeatpad, we need clip it agains the previous * valid region rather than the mask region. */ if (!is_normal_source_fbo) clipped_mask_regions = glamor_compute_transform_clipped_regions (mask_pixmap_priv, mask->transform, clipped_dest_regions[i].region, &n_mask_regions, x_mask - x_dest, y_mask - y_dest, mask_repeat_type, 0, 0); else clipped_mask_regions = glamor_compute_transform_clipped_regions (mask_pixmap_priv, mask->transform, clipped_source_regions[j].region, &n_mask_regions, x_mask - x_source, y_mask - y_source, mask_repeat_type, 0, 0); is_normal_mask_fbo = 0; if (n_mask_regions == 0) { /* Pad the out-of-box region to (0,0,0,0). */ null_mask = 1; n_mask_regions = 1; } else _glamor_process_transformed_clipped_region (mask_pixmap_priv, mask_repeat_type, clipped_mask_regions, &n_mask_regions, &need_clean_mask_fbo); } DEBUGF("mask clipped result %d region: \n", n_mask_regions); #define COMPOSITE_REGION(region) do { \ if (!glamor_composite_clipped_region(op, \ null_source ? NULL : source, \ null_mask ? NULL : mask, dest, \ null_source ? NULL : source_pixmap_priv, \ null_mask ? NULL : mask_pixmap_priv, \ dest_pixmap_priv, region, \ x_source, y_source, x_mask, y_mask, \ x_dest, y_dest)) { \ assert(0); \ } \ } while(0) for (k = 0; k < n_mask_regions; k++) { DEBUGF("mask region %d idx %d\n", k, clipped_mask_regions[k].block_idx); DEBUGRegionPrint(clipped_mask_regions[k].region); if (is_normal_mask_fbo) { glamor_set_pixmap_fbo_current(mask_pixmap_priv, clipped_mask_regions[k]. block_idx); DEBUGF("mask fbo off %d %d \n", __glamor_large(mask_pixmap_priv)->box.x1, __glamor_large(mask_pixmap_priv)->box.y1); DEBUGF("start composite mask hasn't transform.\n"); RegionTranslate(clipped_mask_regions[k].region, x_dest - x_mask + dest->pDrawable->x, y_dest - y_mask + dest->pDrawable->y); COMPOSITE_REGION(clipped_mask_regions[k].region); } else if (!is_normal_mask_fbo && !is_normal_source_fbo) { DEBUGF ("start composite both mask and source have transform.\n"); RegionTranslate(clipped_dest_regions[i].region, dest->pDrawable->x, dest->pDrawable->y); COMPOSITE_REGION(clipped_dest_regions[i].region); } else { DEBUGF ("start composite only mask has transform.\n"); RegionTranslate(clipped_source_regions[j].region, x_dest - x_source + dest->pDrawable->x, y_dest - y_source + dest->pDrawable->y); COMPOSITE_REGION(clipped_source_regions[j].region); } RegionDestroy(clipped_mask_regions[k].region); } free(clipped_mask_regions); if (null_mask) null_mask = 0; if (need_clean_mask_fbo) { assert(is_normal_mask_fbo == 0); glamor_destroy_fbo(mask_pixmap_priv->base.fbo); mask_pixmap_priv->base.fbo = NULL; need_clean_mask_fbo = 0; } } else { if (is_normal_source_fbo) { RegionTranslate(clipped_source_regions[j].region, -x_source + x_dest + dest->pDrawable->x, -y_source + y_dest + dest->pDrawable->y); COMPOSITE_REGION(clipped_source_regions[j].region); } else { /* Source has transform or repeatPad. dest regions is the right * region to do the composite. */ RegionTranslate(clipped_dest_regions[i].region, dest->pDrawable->x, dest->pDrawable->y); COMPOSITE_REGION(clipped_dest_regions[i].region); } } if (clipped_source_regions && clipped_source_regions[j].region) RegionDestroy(clipped_source_regions[j].region); } free(clipped_source_regions); if (null_source) null_source = 0; if (need_clean_source_fbo) { assert(is_normal_source_fbo == 0); glamor_destroy_fbo(source_pixmap_priv->base.fbo); source_pixmap_priv->base.fbo = NULL; need_clean_source_fbo = 0; } } else { if (mask_pixmap_priv && mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { if (!mask->transform && mask_repeat_type != RepeatPad) { RegionTranslate(clipped_dest_regions[i].region, x_mask - x_dest, y_mask - y_dest); clipped_mask_regions = glamor_compute_clipped_regions(mask_pixmap_priv, clipped_dest_regions[i]. region, &n_mask_regions, mask_repeat_type, 0, 0); is_normal_mask_fbo = 1; } else { clipped_mask_regions = glamor_compute_transform_clipped_regions (mask_pixmap_priv, mask->transform, clipped_dest_regions[i].region, &n_mask_regions, x_mask - x_dest, y_mask - y_dest, mask_repeat_type, 0, 0); is_normal_mask_fbo = 0; if (n_mask_regions == 0) { /* Pad the out-of-box region to (0,0,0,0). */ null_mask = 1; n_mask_regions = 1; } else _glamor_process_transformed_clipped_region (mask_pixmap_priv, mask_repeat_type, clipped_mask_regions, &n_mask_regions, &need_clean_mask_fbo); } for (k = 0; k < n_mask_regions; k++) { DEBUGF("mask region %d idx %d\n", k, clipped_mask_regions[k].block_idx); DEBUGRegionPrint(clipped_mask_regions[k].region); if (is_normal_mask_fbo) { glamor_set_pixmap_fbo_current(mask_pixmap_priv, clipped_mask_regions[k]. block_idx); RegionTranslate(clipped_mask_regions[k].region, x_dest - x_mask + dest->pDrawable->x, y_dest - y_mask + dest->pDrawable->y); COMPOSITE_REGION(clipped_mask_regions[k].region); } else { RegionTranslate(clipped_dest_regions[i].region, dest->pDrawable->x, dest->pDrawable->y); COMPOSITE_REGION(clipped_dest_regions[i].region); } RegionDestroy(clipped_mask_regions[k].region); } free(clipped_mask_regions); if (null_mask) null_mask = 0; if (need_clean_mask_fbo) { glamor_destroy_fbo(mask_pixmap_priv->base.fbo); mask_pixmap_priv->base.fbo = NULL; need_clean_mask_fbo = 0; } } else { RegionTranslate(clipped_dest_regions[i].region, dest->pDrawable->x, dest->pDrawable->y); COMPOSITE_REGION(clipped_dest_regions[i].region); } } RegionDestroy(clipped_dest_regions[i].region); } free(clipped_dest_regions); free(need_free_source_pixmap_priv); free(need_free_mask_pixmap_priv); ok = TRUE; return ok; } xorg-server-1.17.1/glamor/glamor_sync.c0000664000175100017510000000771512424353351014767 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "misyncshm.h" #include "misyncstr.h" #if XSYNC /* * This whole file exists to wrap a sync fence trigger operation so * that we can flush GL to provide serialization between the server * and the shm fence client */ static DevPrivateKeyRec glamor_sync_fence_key; struct glamor_sync_fence { SyncFenceSetTriggeredFunc set_triggered; }; static inline struct glamor_sync_fence * glamor_get_sync_fence(SyncFence *fence) { return (struct glamor_sync_fence *) dixLookupPrivate(&fence->devPrivates, &glamor_sync_fence_key); } static void glamor_sync_fence_set_triggered (SyncFence *fence) { ScreenPtr screen = fence->pScreen; glamor_screen_private *glamor = glamor_get_screen_private(screen); struct glamor_sync_fence *glamor_fence = glamor_get_sync_fence(fence); /* Flush pending rendering operations */ glamor_make_current(glamor); glFlush(); fence->funcs.SetTriggered = glamor_fence->set_triggered; fence->funcs.SetTriggered(fence); glamor_fence->set_triggered = fence->funcs.SetTriggered; fence->funcs.SetTriggered = glamor_sync_fence_set_triggered; } static void glamor_sync_create_fence(ScreenPtr screen, SyncFence *fence, Bool initially_triggered) { glamor_screen_private *glamor = glamor_get_screen_private(screen); SyncScreenFuncsPtr screen_funcs = miSyncGetScreenFuncs(screen); struct glamor_sync_fence *glamor_fence = glamor_get_sync_fence(fence); screen_funcs->CreateFence = glamor->saved_procs.sync_screen_funcs.CreateFence; screen_funcs->CreateFence(screen, fence, initially_triggered); glamor->saved_procs.sync_screen_funcs.CreateFence = screen_funcs->CreateFence; screen_funcs->CreateFence = glamor_sync_create_fence; glamor_fence->set_triggered = fence->funcs.SetTriggered; fence->funcs.SetTriggered = glamor_sync_fence_set_triggered; } #endif Bool glamor_sync_init(ScreenPtr screen) { #if XSYNC glamor_screen_private *glamor = glamor_get_screen_private(screen); SyncScreenFuncsPtr screen_funcs; if (!dixPrivateKeyRegistered(&glamor_sync_fence_key)) { if (!dixRegisterPrivateKey(&glamor_sync_fence_key, PRIVATE_SYNC_FENCE, sizeof (struct glamor_sync_fence))) return FALSE; } if (!miSyncShmScreenInit(screen)) return FALSE; screen_funcs = miSyncGetScreenFuncs(screen); glamor->saved_procs.sync_screen_funcs.CreateFence = screen_funcs->CreateFence; screen_funcs->CreateFence = glamor_sync_create_fence; #endif return TRUE; } void glamor_sync_close(ScreenPtr screen) { #if XSYNC glamor_screen_private *glamor = glamor_get_screen_private(screen); SyncScreenFuncsPtr screen_funcs = miSyncGetScreenFuncs(screen); if (screen_funcs) screen_funcs->CreateFence = glamor->saved_procs.sync_screen_funcs.CreateFence; #endif } xorg-server-1.17.1/glamor/glamor_points.c0000664000175100017510000001050412460362577015327 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #include "glamor_priv.h" #include "glamor_transform.h" static const glamor_facet glamor_facet_point = { .name = "poly_point", .vs_vars = "attribute vec2 primitive;\n", .vs_exec = GLAMOR_POS(gl_Position, primitive), }; static Bool glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPointPtr ppt) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_program *prog = &glamor_priv->point_prog; glamor_pixmap_private *pixmap_priv; int off_x, off_y; GLshort *vbo_ppt; char *vbo_offset; int box_x, box_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; glamor_make_current(glamor_priv); if (prog->failed) goto bail_ctx; if (!prog->prog) { if (!glamor_build_program(screen, prog, &glamor_facet_point, &glamor_fill_solid)) goto bail_ctx; } if (!glamor_use_program(pixmap, gc, prog, NULL)) goto bail_ctx; vbo_ppt = glamor_get_vbo_space(screen, npt * (2 * sizeof (INT16)), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 0, vbo_offset); if (mode == CoordModePrevious) { int n = npt; INT16 x = 0, y = 0; while (n--) { vbo_ppt[0] = (x += ppt->x); vbo_ppt[1] = (y += ppt->y); vbo_ppt += 2; ppt++; } } else memcpy(vbo_ppt, ppt, npt * (2 * sizeof (INT16))); glamor_put_vbo_space(screen); glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE, prog->matrix_uniform, &off_x, &off_y); while (nbox--) { glScissor(box->x1 + off_x, box->y1 + off_y, box->x2 - box->x1, box->y2 - box->y1); box++; glDrawArrays(GL_POINTS, 0, npt); } } glDisable(GL_SCISSOR_TEST); glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } void glamor_poly_point(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPointPtr ppt) { if (glamor_poly_point_gl(drawable, gc, mode, npt, ppt)) return; miPolyPoint(drawable, gc, mode, npt, ppt); } Bool glamor_poly_point_nf(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPointPtr ppt) { if (glamor_poly_point_gl(drawable, gc, mode, npt, ppt)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) return FALSE; miPolyPoint(drawable, gc, mode, npt, ppt); return TRUE; } xorg-server-1.17.1/glamor/glamor_triangles.c0000664000175100017510000000523212460362577016005 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #include "glamor_priv.h" static Bool _glamor_triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris, Bool fallback) { if (!fallback && glamor_ddx_fallback_check_pixmap(pDst->pDrawable) && (!pSrc->pDrawable || glamor_ddx_fallback_check_pixmap(pSrc->pDrawable))) return FALSE; if (glamor_prepare_access_picture(pDst, GLAMOR_ACCESS_RW) && glamor_prepare_access_picture(pSrc, GLAMOR_ACCESS_RO)) { fbTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, tris); } glamor_finish_access_picture(pSrc); glamor_finish_access_picture(pDst); return TRUE; } void glamor_triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris) { _glamor_triangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, tris, TRUE); } Bool glamor_triangles_nf(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris) { return _glamor_triangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, tris, FALSE); } xorg-server-1.17.1/glamor/glamor_egl_stubs.c0000664000175100017510000000342412456571574016011 00000000000000/* * Copyright © 2013 Intel Corporation * * 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. */ /** @file glamor_egl_stubs.c * * Stubbed out glamor_egl.c functions for servers other than Xorg. */ #include "dix-config.h" #include "glamor.h" void glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) { } void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) { } int glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, PixmapPtr pixmap, unsigned int tex, Bool want_name, CARD16 *stride, CARD32 *size) { return 0; } unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) { return 0; } xorg-server-1.17.1/glamor/glamor_utils.c0000664000175100017510000000505112424353351015142 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" void glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, unsigned long fg_pixel) { DrawablePtr drawable = &pixmap->drawable; GCPtr gc; xRectangle *rect; int n; rect = malloc(nbox * sizeof (xRectangle)); if (!rect) return; for (n = 0; n < nbox; n++) { rect[n].x = box[n].x1; rect[n].y = box[n].y1; rect[n].width = box[n].x2 - box[n].x1; rect[n].height = box[n].y2 - box[n].y1; } gc = GetScratchGC(drawable->depth, drawable->pScreen); if (gc) { ChangeGCVal vals[1]; vals[0].val = fg_pixel; ChangeGC(NullClient, gc, GCForeground, vals); ValidateGC(drawable, gc); gc->ops->PolyFillRect(drawable, gc, nbox, rect); FreeScratchGC(gc); } free(rect); } void glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, unsigned long fg_pixel) { DrawablePtr drawable = &pixmap->drawable; GCPtr gc; ChangeGCVal vals[1]; xRectangle rect; vals[0].val = fg_pixel; gc = GetScratchGC(drawable->depth, drawable->pScreen); if (!gc) return; ChangeGC(NullClient, gc, GCForeground, vals); ValidateGC(drawable, gc); rect.x = x; rect.y = y; rect.width = width; rect.height = height; gc->ops->PolyFillRect(drawable, gc, 1, &rect); FreeScratchGC(gc); } xorg-server-1.17.1/glamor/glamor_gradient.c0000664000175100017510000016002612460362577015615 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Junyan He * */ /** @file glamor_gradient.c * * Gradient acceleration implementation */ #include "glamor_priv.h" #ifdef RENDER #define LINEAR_SMALL_STOPS (6 + 2) #define LINEAR_LARGE_STOPS (16 + 2) #define RADIAL_SMALL_STOPS (6 + 2) #define RADIAL_LARGE_STOPS (16 + 2) #ifdef GLAMOR_GRADIENT_SHADER static const char * _glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count, int use_array) { char *gradient_fs = NULL; #define gradient_fs_getcolor\ GLAMOR_DEFAULT_PRECISION\ "uniform int n_stop;\n"\ "uniform float stops[%d];\n"\ "uniform vec4 stop_colors[%d];\n"\ "vec4 get_color(float stop_len)\n"\ "{\n"\ " int i = 0;\n"\ " float new_alpha; \n"\ " vec4 gradient_color;\n"\ " float percentage; \n"\ " for(i = 0; i < n_stop - 1; i++) {\n"\ " if(stop_len < stops[i])\n"\ " break; \n"\ " }\n"\ " \n"\ " if(stops[i] - stops[i-1] > 2.0)\n"\ " percentage = 0.0;\n" /*For comply with pixman, walker->stepper overflow.*/\ " else if(stops[i] - stops[i-1] < 0.000001)\n"\ " percentage = 0.0;\n"\ " else \n"\ " percentage = (stop_len - stops[i-1])/(stops[i] - stops[i-1]);\n"\ " new_alpha = percentage * stop_colors[i].a + \n"\ " (1.0-percentage) * stop_colors[i-1].a; \n"\ " gradient_color = vec4((percentage * stop_colors[i].rgb \n"\ " + (1.0-percentage) * stop_colors[i-1].rgb)*new_alpha, \n"\ " new_alpha);\n"\ " \n"\ " return gradient_color;\n"\ "}\n" /* Because the array access for shader is very slow, the performance is very low if use array. So use global uniform to replace for it if the number of n_stops is small. */ const char *gradient_fs_getcolor_no_array = GLAMOR_DEFAULT_PRECISION "uniform int n_stop;\n" "uniform float stop0;\n" "uniform float stop1;\n" "uniform float stop2;\n" "uniform float stop3;\n" "uniform float stop4;\n" "uniform float stop5;\n" "uniform float stop6;\n" "uniform float stop7;\n" "uniform vec4 stop_color0;\n" "uniform vec4 stop_color1;\n" "uniform vec4 stop_color2;\n" "uniform vec4 stop_color3;\n" "uniform vec4 stop_color4;\n" "uniform vec4 stop_color5;\n" "uniform vec4 stop_color6;\n" "uniform vec4 stop_color7;\n" "\n" "vec4 get_color(float stop_len)\n" "{\n" " float stop_after;\n" " float stop_before;\n" " vec4 stop_color_before;\n" " vec4 stop_color_after;\n" " float new_alpha; \n" " vec4 gradient_color;\n" " float percentage; \n" " \n" " if((stop_len < stop0) && (n_stop >= 1)) {\n" " stop_color_before = stop_color0;\n" " stop_color_after = stop_color0;\n" " stop_after = stop0;\n" " stop_before = stop0;\n" " } else if((stop_len < stop1) && (n_stop >= 2)) {\n" " stop_color_before = stop_color0;\n" " stop_color_after = stop_color1;\n" " stop_after = stop1;\n" " stop_before = stop0;\n" " } else if((stop_len < stop2) && (n_stop >= 3)) {\n" " stop_color_before = stop_color1;\n" " stop_color_after = stop_color2;\n" " stop_after = stop2;\n" " stop_before = stop1;\n" " } else if((stop_len < stop3) && (n_stop >= 4)){\n" " stop_color_before = stop_color2;\n" " stop_color_after = stop_color3;\n" " stop_after = stop3;\n" " stop_before = stop2;\n" " } else if((stop_len < stop4) && (n_stop >= 5)){\n" " stop_color_before = stop_color3;\n" " stop_color_after = stop_color4;\n" " stop_after = stop4;\n" " stop_before = stop3;\n" " } else if((stop_len < stop5) && (n_stop >= 6)){\n" " stop_color_before = stop_color4;\n" " stop_color_after = stop_color5;\n" " stop_after = stop5;\n" " stop_before = stop4;\n" " } else if((stop_len < stop6) && (n_stop >= 7)){\n" " stop_color_before = stop_color5;\n" " stop_color_after = stop_color6;\n" " stop_after = stop6;\n" " stop_before = stop5;\n" " } else if((stop_len < stop7) && (n_stop >= 8)){\n" " stop_color_before = stop_color6;\n" " stop_color_after = stop_color7;\n" " stop_after = stop7;\n" " stop_before = stop6;\n" " } else {\n" " stop_color_before = stop_color7;\n" " stop_color_after = stop_color7;\n" " stop_after = stop7;\n" " stop_before = stop7;\n" " }\n" " if(stop_after - stop_before > 2.0)\n" " percentage = 0.0;\n" //For comply with pixman, walker->stepper overflow. " else if(stop_after - stop_before < 0.000001)\n" " percentage = 0.0;\n" " else \n" " percentage = (stop_len - stop_before)/(stop_after - stop_before);\n" " new_alpha = percentage * stop_color_after.a + \n" " (1.0-percentage) * stop_color_before.a; \n" " gradient_color = vec4((percentage * stop_color_after.rgb \n" " + (1.0-percentage) * stop_color_before.rgb)*new_alpha, \n" " new_alpha);\n" " \n" " return gradient_color;\n" "}\n"; if (use_array) { XNFasprintf(&gradient_fs, gradient_fs_getcolor, stops_count, stops_count); return gradient_fs; } else { return XNFstrdup(gradient_fs_getcolor_no_array); } } static void _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, int dyn_gen) { glamor_screen_private *glamor_priv; int index; GLint gradient_prog = 0; char *gradient_fs = NULL; GLint fs_prog, vs_prog; const char *gradient_vs = GLAMOR_DEFAULT_PRECISION "attribute vec4 v_position;\n" "attribute vec4 v_texcoord;\n" "varying vec2 source_texture;\n" "\n" "void main()\n" "{\n" " gl_Position = v_position;\n" " source_texture = v_texcoord.xy;\n" "}\n"; /* * Refer to pixman radial gradient. * * The problem is given the two circles of c1 and c2 with the radius of r1 and * r1, we need to caculate the t, which is used to do interpolate with stops, * using the fomula: * length((1-t)*c1 + t*c2 - p) = (1-t)*r1 + t*r2 * expand the fomula with xy coond, get the following: * sqrt(sqr((1-t)*c1.x + t*c2.x - p.x) + sqr((1-t)*c1.y + t*c2.y - p.y)) * = (1-t)r1 + t*r2 * <====> At*t- 2Bt + C = 0 * where A = sqr(c2.x - c1.x) + sqr(c2.y - c1.y) - sqr(r2 -r1) * B = (p.x - c1.x)*(c2.x - c1.x) + (p.y - c1.y)*(c2.y - c1.y) + r1*(r2 -r1) * C = sqr(p.x - c1.x) + sqr(p.y - c1.y) - r1*r1 * * solve the fomula and we get the result of * t = (B + sqrt(B*B - A*C)) / A or * t = (B - sqrt(B*B - A*C)) / A (quadratic equation have two solutions) * * The solution we are going to prefer is the bigger one, unless the * radius associated to it is negative (or it falls outside the valid t range) */ #define gradient_radial_fs_template\ GLAMOR_DEFAULT_PRECISION\ "uniform mat3 transform_mat;\n"\ "uniform int repeat_type;\n"\ "uniform float A_value;\n"\ "uniform vec2 c1;\n"\ "uniform float r1;\n"\ "uniform vec2 c2;\n"\ "uniform float r2;\n"\ "varying vec2 source_texture;\n"\ "\n"\ "vec4 get_color(float stop_len);\n"\ "\n"\ "int t_invalid;\n"\ "\n"\ "float get_stop_len()\n"\ "{\n"\ " float t = 0.0;\n"\ " float sqrt_value;\n"\ " t_invalid = 0;\n"\ " \n"\ " vec3 tmp = vec3(source_texture.x, source_texture.y, 1.0);\n"\ " vec3 source_texture_trans = transform_mat * tmp;\n"\ " source_texture_trans.xy = source_texture_trans.xy/source_texture_trans.z;\n"\ " float B_value = (source_texture_trans.x - c1.x) * (c2.x - c1.x)\n"\ " + (source_texture_trans.y - c1.y) * (c2.y - c1.y)\n"\ " + r1 * (r2 - r1);\n"\ " float C_value = (source_texture_trans.x - c1.x) * (source_texture_trans.x - c1.x)\n"\ " + (source_texture_trans.y - c1.y) * (source_texture_trans.y - c1.y)\n"\ " - r1*r1;\n"\ " if(abs(A_value) < 0.00001) {\n"\ " if(B_value == 0.0) {\n"\ " t_invalid = 1;\n"\ " return t;\n"\ " }\n"\ " t = 0.5 * C_value / B_value;"\ " } else {\n"\ " sqrt_value = B_value * B_value - A_value * C_value;\n"\ " if(sqrt_value < 0.0) {\n"\ " t_invalid = 1;\n"\ " return t;\n"\ " }\n"\ " sqrt_value = sqrt(sqrt_value);\n"\ " t = (B_value + sqrt_value) / A_value;\n"\ " }\n"\ " if(repeat_type == %d) {\n" /* RepeatNone case. */\ " if((t <= 0.0) || (t > 1.0))\n"\ /* try another if first one invalid*/\ " t = (B_value - sqrt_value) / A_value;\n"\ " \n"\ " if((t <= 0.0) || (t > 1.0)) {\n" /*still invalid, return.*/\ " t_invalid = 1;\n"\ " return t;\n"\ " }\n"\ " } else {\n"\ " if(t * (r2 - r1) <= -1.0 * r1)\n"\ /* try another if first one invalid*/\ " t = (B_value - sqrt_value) / A_value;\n"\ " \n"\ " if(t * (r2 -r1) <= -1.0 * r1) {\n" /*still invalid, return.*/\ " t_invalid = 1;\n"\ " return t;\n"\ " }\n"\ " }\n"\ " \n"\ " if(repeat_type == %d){\n" /* repeat normal*/\ " t = fract(t);\n"\ " }\n"\ " \n"\ " if(repeat_type == %d) {\n" /* repeat reflect*/\ " t = abs(fract(t * 0.5 + 0.5) * 2.0 - 1.0);\n"\ " }\n"\ " \n"\ " return t;\n"\ "}\n"\ "\n"\ "void main()\n"\ "{\n"\ " float stop_len = get_stop_len();\n"\ " if(t_invalid == 1) {\n"\ " gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"\ " } else {\n"\ " gl_FragColor = get_color(stop_len);\n"\ " }\n"\ "}\n"\ "\n"\ "%s\n" /* fs_getcolor_source */ const char *fs_getcolor_source; glamor_priv = glamor_get_screen_private(screen); if ((glamor_priv->radial_max_nstops >= stops_count) && (dyn_gen)) { /* Very Good, not to generate again. */ return; } glamor_make_current(glamor_priv); if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2]) { glDeleteProgram(glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2]); glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2] = 0; } gradient_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, gradient_vs); fs_getcolor_source = _glamor_create_getcolor_fs_source(screen, stops_count, (stops_count > 0)); XNFasprintf(&gradient_fs, gradient_radial_fs_template, PIXMAN_REPEAT_NONE, PIXMAN_REPEAT_NORMAL, PIXMAN_REPEAT_REFLECT, fs_getcolor_source); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs); free(gradient_fs); glAttachShader(gradient_prog, vs_prog); glAttachShader(gradient_prog, fs_prog); glDeleteShader(vs_prog); glDeleteShader(fs_prog); glBindAttribLocation(gradient_prog, GLAMOR_VERTEX_POS, "v_position"); glBindAttribLocation(gradient_prog, GLAMOR_VERTEX_SOURCE, "v_texcoord"); glamor_link_glsl_prog(screen, gradient_prog, "radial gradient"); if (dyn_gen) { index = 2; glamor_priv->radial_max_nstops = stops_count; } else if (stops_count) { index = 1; } else { index = 0; } glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][index] = gradient_prog; } static void _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, int dyn_gen) { glamor_screen_private *glamor_priv; int index = 0; GLint gradient_prog = 0; char *gradient_fs = NULL; GLint fs_prog, vs_prog; const char *gradient_vs = GLAMOR_DEFAULT_PRECISION "attribute vec4 v_position;\n" "attribute vec4 v_texcoord;\n" "varying vec2 source_texture;\n" "\n" "void main()\n" "{\n" " gl_Position = v_position;\n" " source_texture = v_texcoord.xy;\n" "}\n"; /* * | * |\ * | \ * | \ * | \ * |\ \ * | \ \ * cos_val = |\ p1d \ / * sqrt(1/(slope*slope+1.0)) ------>\ \ \ / * | \ \ \ * | \ \ / \ * | \ *Pt1\ * *p1 | \ \ *P * \ | / \ \ / * \ | / \ \ / * \ | pd \ * \ | \ / \ * p2* | \ / \ / * slope = (p2.y - p1.y) / | / p2d / * (p2.x - p1.x) | / \ / * | / \ / * | / / * | / / * | / *Pt2 * | / * | / * | / * | / * | / * -------+--------------------------------- * O| * | * | * * step 1: compute the distance of p, pt1 and pt2 in the slope direction. * Caculate the distance on Y axis first and multiply cos_val to * get the value on slope direction(pd, p1d and p2d represent the * distance of p, pt1, and pt2 respectively). * * step 2: caculate the percentage of (pd - p1d)/(p2d - p1d). * If (pd - p1d) > (p2d - p1d) or < 0, then sub or add (p2d - p1d) * to make it in the range of [0, (p2d - p1d)]. * * step 3: compare the percentage to every stop and find the stpos just * before and after it. Use the interpolation fomula to compute RGBA. */ #define gradient_fs_template \ GLAMOR_DEFAULT_PRECISION\ "uniform mat3 transform_mat;\n"\ "uniform int repeat_type;\n"\ "uniform int hor_ver;\n"\ "uniform float pt_slope;\n"\ "uniform float cos_val;\n"\ "uniform float p1_distance;\n"\ "uniform float pt_distance;\n"\ "varying vec2 source_texture;\n"\ "\n"\ "vec4 get_color(float stop_len);\n"\ "\n"\ "float get_stop_len()\n"\ "{\n"\ " vec3 tmp = vec3(source_texture.x, source_texture.y, 1.0);\n"\ " float len_percentage;\n"\ " float distance;\n"\ " float _p1_distance;\n"\ " float _pt_distance;\n"\ " float y_dist;\n"\ " float stop_after;\n"\ " float stop_before;\n"\ " vec4 stop_color_before;\n"\ " vec4 stop_color_after;\n"\ " float new_alpha; \n"\ " vec4 gradient_color;\n"\ " float percentage; \n"\ " vec3 source_texture_trans = transform_mat * tmp;\n"\ " \n"\ " if(hor_ver == 0) { \n" /*Normal case.*/\ " y_dist = source_texture_trans.y - source_texture_trans.x*pt_slope;\n"\ " distance = y_dist * cos_val;\n"\ " _p1_distance = p1_distance * source_texture_trans.z;\n"\ " _pt_distance = pt_distance * source_texture_trans.z;\n"\ " \n"\ " } else if (hor_ver == 1) {\n"/*horizontal case.*/\ " distance = source_texture_trans.x;\n"\ " _p1_distance = p1_distance * source_texture_trans.z;\n"\ " _pt_distance = pt_distance * source_texture_trans.z;\n"\ " } \n"\ " \n"\ " distance = distance - _p1_distance; \n"\ " \n"\ " if(repeat_type == %d){\n" /* repeat normal*/\ " distance = mod(distance, _pt_distance);\n"\ " }\n"\ " \n"\ " if(repeat_type == %d) {\n" /* repeat reflect*/\ " distance = abs(mod(distance + _pt_distance, 2.0 * _pt_distance) - _pt_distance);\n"\ " }\n"\ " \n"\ " len_percentage = distance/(_pt_distance);\n"\ " \n"\ " return len_percentage;\n"\ "}\n"\ "\n"\ "void main()\n"\ "{\n"\ " float stop_len = get_stop_len();\n"\ " gl_FragColor = get_color(stop_len);\n"\ "}\n"\ "\n"\ "%s" /* fs_getcolor_source */ const char *fs_getcolor_source; glamor_priv = glamor_get_screen_private(screen); if ((glamor_priv->linear_max_nstops >= stops_count) && (dyn_gen)) { /* Very Good, not to generate again. */ return; } glamor_make_current(glamor_priv); if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2]) { glDeleteProgram(glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2]); glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2] = 0; } gradient_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, gradient_vs); fs_getcolor_source = _glamor_create_getcolor_fs_source(screen, stops_count, stops_count > 0); XNFasprintf(&gradient_fs, gradient_fs_template, PIXMAN_REPEAT_NORMAL, PIXMAN_REPEAT_REFLECT, fs_getcolor_source); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs); free(gradient_fs); glAttachShader(gradient_prog, vs_prog); glAttachShader(gradient_prog, fs_prog); glDeleteShader(vs_prog); glDeleteShader(fs_prog); glBindAttribLocation(gradient_prog, GLAMOR_VERTEX_POS, "v_position"); glBindAttribLocation(gradient_prog, GLAMOR_VERTEX_SOURCE, "v_texcoord"); glamor_link_glsl_prog(screen, gradient_prog, "linear gradient"); if (dyn_gen) { index = 2; glamor_priv->linear_max_nstops = stops_count; } else if (stops_count) { index = 1; } else { index = 0; } glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][index] = gradient_prog; } void glamor_init_gradient_shader(ScreenPtr screen) { glamor_screen_private *glamor_priv; int i; glamor_priv = glamor_get_screen_private(screen); for (i = 0; i < 3; i++) { glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][i] = 0; glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][i] = 0; } glamor_priv->linear_max_nstops = 0; glamor_priv->radial_max_nstops = 0; _glamor_create_linear_gradient_program(screen, 0, 0); _glamor_create_linear_gradient_program(screen, LINEAR_LARGE_STOPS, 0); _glamor_create_radial_gradient_program(screen, 0, 0); _glamor_create_radial_gradient_program(screen, RADIAL_LARGE_STOPS, 0); } void glamor_fini_gradient_shader(ScreenPtr screen) { glamor_screen_private *glamor_priv; int i = 0; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); for (i = 0; i < 3; i++) { /* Linear Gradient */ if (glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][i]) glDeleteProgram(glamor_priv->gradient_prog [SHADER_GRADIENT_LINEAR][i]); if (glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][i]) glDeleteProgram(glamor_priv->gradient_prog [SHADER_GRADIENT_RADIAL][i]); } } static void _glamor_gradient_convert_trans_matrix(PictTransform *from, float to[3][3], int width, int height, int normalize) { /* * Because in the shader program, we normalize all the pixel cood to [0, 1], * so with the transform matrix, the correct logic should be: * v_s = A*T*v * v_s: point vector in shader after normalized. * A: The transition matrix from width X height --> 1.0 X 1.0 * T: The transform matrix. * v: point vector in width X height space. * * result is OK if we use this fomula. But for every point in width X height space, * we can just use their normalized point vector in shader, namely we can just * use the result of A*v in shader. So we have no chance to insert T in A*v. * We can just convert v_s = A*T*v to v_s = A*T*inv(A)*A*v, where inv(A) is the * inverse matrix of A. Now, v_s = (A*T*inv(A)) * (A*v) * So, to get the correct v_s, we need to cacula1 the matrix: (A*T*inv(A)), and * we name this matrix T_s. * * Firstly, because A is for the scale convertion, we find * -- -- * |1/w 0 0 | * A = | 0 1/h 0 | * | 0 0 1.0| * -- -- * so T_s = A*T*inv(a) and result * * -- -- * | t11 h*t12/w t13/w| * T_s = | w*t21/h t22 t23/h| * | w*t31 h*t32 t33 | * -- -- */ to[0][0] = (float) pixman_fixed_to_double(from->matrix[0][0]); to[0][1] = (float) pixman_fixed_to_double(from->matrix[0][1]) * (normalize ? (((float) height) / ((float) width)) : 1.0); to[0][2] = (float) pixman_fixed_to_double(from->matrix[0][2]) / (normalize ? ((float) width) : 1.0); to[1][0] = (float) pixman_fixed_to_double(from->matrix[1][0]) * (normalize ? (((float) width) / ((float) height)) : 1.0); to[1][1] = (float) pixman_fixed_to_double(from->matrix[1][1]); to[1][2] = (float) pixman_fixed_to_double(from->matrix[1][2]) / (normalize ? ((float) height) : 1.0); to[2][0] = (float) pixman_fixed_to_double(from->matrix[2][0]) * (normalize ? ((float) width) : 1.0); to[2][1] = (float) pixman_fixed_to_double(from->matrix[2][1]) * (normalize ? ((float) height) : 1.0); to[2][2] = (float) pixman_fixed_to_double(from->matrix[2][2]); DEBUGF("the transform matrix is:\n%f\t%f\t%f\n%f\t%f\t%f\n%f\t%f\t%f\n", to[0][0], to[0][1], to[0][2], to[1][0], to[1][1], to[1][2], to[2][0], to[2][1], to[2][2]); } static int _glamor_gradient_set_pixmap_destination(ScreenPtr screen, glamor_screen_private *glamor_priv, PicturePtr dst_picture, GLfloat *xscale, GLfloat *yscale, int x_source, int y_source, float vertices[8], float tex_vertices[8], int tex_normalize) { glamor_pixmap_private *pixmap_priv; PixmapPtr pixmap = NULL; pixmap = glamor_get_drawable_pixmap(dst_picture->pDrawable); pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) { /* should always have here. */ return 0; } glamor_set_destination_pixmap_priv_nc(pixmap_priv); pixmap_priv_get_dest_scale(pixmap_priv, xscale, yscale); DEBUGF("xscale = %f, yscale = %f," " x_source = %d, y_source = %d, width = %d, height = %d\n", *xscale, *yscale, x_source, y_source, dst_picture->pDrawable->width, dst_picture->pDrawable->height); glamor_set_normalize_vcoords_tri_strip(*xscale, *yscale, 0, 0, (INT16) (dst_picture->pDrawable-> width), (INT16) (dst_picture->pDrawable-> height), vertices); if (tex_normalize) { glamor_set_normalize_tcoords_tri_stripe(*xscale, *yscale, x_source, y_source, (INT16) (dst_picture-> pDrawable->width + x_source), (INT16) (dst_picture-> pDrawable->height + y_source), tex_vertices); } else { glamor_set_tcoords_tri_strip(x_source, y_source, (INT16) (dst_picture->pDrawable->width) + x_source, (INT16) (dst_picture->pDrawable->height) + y_source, tex_vertices); } DEBUGF("vertices --> leftup : %f X %f, rightup: %f X %f," "rightbottom: %f X %f, leftbottom : %f X %f\n", vertices[0], vertices[1], vertices[2], vertices[3], vertices[4], vertices[5], vertices[6], vertices[7]); DEBUGF("tex_vertices --> leftup : %f X %f, rightup: %f X %f," "rightbottom: %f X %f, leftbottom : %f X %f\n", tex_vertices[0], tex_vertices[1], tex_vertices[2], tex_vertices[3], tex_vertices[4], tex_vertices[5], tex_vertices[6], tex_vertices[7]); glamor_make_current(glamor_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, 0, tex_vertices); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); return 1; } static int _glamor_gradient_set_stops(PicturePtr src_picture, PictGradient *pgradient, GLfloat *stop_colors, GLfloat *n_stops) { int i; int count = 1; for (i = 0; i < pgradient->nstops; i++) { stop_colors[count * 4] = pixman_fixed_to_double(pgradient->stops[i].color.red); stop_colors[count * 4 + 1] = pixman_fixed_to_double(pgradient->stops[i].color.green); stop_colors[count * 4 + 2] = pixman_fixed_to_double(pgradient->stops[i].color.blue); stop_colors[count * 4 + 3] = pixman_fixed_to_double(pgradient->stops[i].color.alpha); n_stops[count] = (GLfloat) pixman_fixed_to_double(pgradient->stops[i].x); count++; } /* for the end stop. */ count++; switch (src_picture->repeatType) { #define REPEAT_FILL_STOPS(m, n) \ stop_colors[(m)*4 + 0] = stop_colors[(n)*4 + 0]; \ stop_colors[(m)*4 + 1] = stop_colors[(n)*4 + 1]; \ stop_colors[(m)*4 + 2] = stop_colors[(n)*4 + 2]; \ stop_colors[(m)*4 + 3] = stop_colors[(n)*4 + 3]; default: case PIXMAN_REPEAT_NONE: stop_colors[0] = 0.0; //R stop_colors[1] = 0.0; //G stop_colors[2] = 0.0; //B stop_colors[3] = 0.0; //Alpha n_stops[0] = -(float) INT_MAX; //should be small enough. stop_colors[0 + (count - 1) * 4] = 0.0; //R stop_colors[1 + (count - 1) * 4] = 0.0; //G stop_colors[2 + (count - 1) * 4] = 0.0; //B stop_colors[3 + (count - 1) * 4] = 0.0; //Alpha n_stops[count - 1] = (float) INT_MAX; //should be large enough. break; case PIXMAN_REPEAT_NORMAL: REPEAT_FILL_STOPS(0, count - 2); n_stops[0] = n_stops[count - 2] - 1.0; REPEAT_FILL_STOPS(count - 1, 1); n_stops[count - 1] = n_stops[1] + 1.0; break; case PIXMAN_REPEAT_REFLECT: REPEAT_FILL_STOPS(0, 1); n_stops[0] = -n_stops[1]; REPEAT_FILL_STOPS(count - 1, count - 2); n_stops[count - 1] = 1.0 + 1.0 - n_stops[count - 2]; break; case PIXMAN_REPEAT_PAD: REPEAT_FILL_STOPS(0, 1); n_stops[0] = -(float) INT_MAX; REPEAT_FILL_STOPS(count - 1, count - 2); n_stops[count - 1] = (float) INT_MAX; break; #undef REPEAT_FILL_STOPS } for (i = 0; i < count; i++) { DEBUGF("n_stops[%d] = %f, color = r:%f g:%f b:%f a:%f\n", i, n_stops[i], stop_colors[i * 4], stop_colors[i * 4 + 1], stop_colors[i * 4 + 2], stop_colors[i * 4 + 3]); } return count; } PicturePtr glamor_generate_radial_gradient_picture(ScreenPtr screen, PicturePtr src_picture, int x_source, int y_source, int width, int height, PictFormatShort format) { glamor_screen_private *glamor_priv; PicturePtr dst_picture = NULL; PixmapPtr pixmap = NULL; GLint gradient_prog = 0; int error; float tex_vertices[8]; int stops_count = 0; int count = 0; GLfloat *stop_colors = NULL; GLfloat *n_stops = NULL; GLfloat xscale, yscale; float vertices[8]; float transform_mat[3][3]; static const float identity_mat[3][3] = { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0} }; GLfloat stop_colors_st[RADIAL_SMALL_STOPS * 4]; GLfloat n_stops_st[RADIAL_SMALL_STOPS]; GLfloat A_value; GLfloat cxy[4]; float c1x, c1y, c2x, c2y, r1, r2; GLint transform_mat_uniform_location = 0; GLint repeat_type_uniform_location = 0; GLint n_stop_uniform_location = 0; GLint stops_uniform_location = 0; GLint stop_colors_uniform_location = 0; GLint stop0_uniform_location = 0; GLint stop1_uniform_location = 0; GLint stop2_uniform_location = 0; GLint stop3_uniform_location = 0; GLint stop4_uniform_location = 0; GLint stop5_uniform_location = 0; GLint stop6_uniform_location = 0; GLint stop7_uniform_location = 0; GLint stop_color0_uniform_location = 0; GLint stop_color1_uniform_location = 0; GLint stop_color2_uniform_location = 0; GLint stop_color3_uniform_location = 0; GLint stop_color4_uniform_location = 0; GLint stop_color5_uniform_location = 0; GLint stop_color6_uniform_location = 0; GLint stop_color7_uniform_location = 0; GLint A_value_uniform_location = 0; GLint c1_uniform_location = 0; GLint r1_uniform_location = 0; GLint c2_uniform_location = 0; GLint r2_uniform_location = 0; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); /* Create a pixmap with VBO. */ pixmap = glamor_create_pixmap(screen, width, height, PIXMAN_FORMAT_DEPTH(format), 0); if (!pixmap) goto GRADIENT_FAIL; dst_picture = CreatePicture(0, &pixmap->drawable, PictureMatchFormat(screen, PIXMAN_FORMAT_DEPTH(format), format), 0, 0, serverClient, &error); /* Release the reference, picture will hold the last one. */ glamor_destroy_pixmap(pixmap); if (!dst_picture) goto GRADIENT_FAIL; ValidatePicture(dst_picture); stops_count = src_picture->pSourcePict->radial.nstops + 2; /* Because the max value of nstops is unkown, so create a program when nstops > LINEAR_LARGE_STOPS. */ if (stops_count <= RADIAL_SMALL_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][0]; } else if (stops_count <= RADIAL_LARGE_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][1]; } else { _glamor_create_radial_gradient_program(screen, src_picture->pSourcePict->linear. nstops + 2, 1); gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2]; } /* Bind all the uniform vars . */ transform_mat_uniform_location = glGetUniformLocation(gradient_prog, "transform_mat"); repeat_type_uniform_location = glGetUniformLocation(gradient_prog, "repeat_type"); n_stop_uniform_location = glGetUniformLocation(gradient_prog, "n_stop"); A_value_uniform_location = glGetUniformLocation(gradient_prog, "A_value"); c1_uniform_location = glGetUniformLocation(gradient_prog, "c1"); r1_uniform_location = glGetUniformLocation(gradient_prog, "r1"); c2_uniform_location = glGetUniformLocation(gradient_prog, "c2"); r2_uniform_location = glGetUniformLocation(gradient_prog, "r2"); if (src_picture->pSourcePict->radial.nstops + 2 <= RADIAL_SMALL_STOPS) { stop0_uniform_location = glGetUniformLocation(gradient_prog, "stop0"); stop1_uniform_location = glGetUniformLocation(gradient_prog, "stop1"); stop2_uniform_location = glGetUniformLocation(gradient_prog, "stop2"); stop3_uniform_location = glGetUniformLocation(gradient_prog, "stop3"); stop4_uniform_location = glGetUniformLocation(gradient_prog, "stop4"); stop5_uniform_location = glGetUniformLocation(gradient_prog, "stop5"); stop6_uniform_location = glGetUniformLocation(gradient_prog, "stop6"); stop7_uniform_location = glGetUniformLocation(gradient_prog, "stop7"); stop_color0_uniform_location = glGetUniformLocation(gradient_prog, "stop_color0"); stop_color1_uniform_location = glGetUniformLocation(gradient_prog, "stop_color1"); stop_color2_uniform_location = glGetUniformLocation(gradient_prog, "stop_color2"); stop_color3_uniform_location = glGetUniformLocation(gradient_prog, "stop_color3"); stop_color4_uniform_location = glGetUniformLocation(gradient_prog, "stop_color4"); stop_color5_uniform_location = glGetUniformLocation(gradient_prog, "stop_color5"); stop_color6_uniform_location = glGetUniformLocation(gradient_prog, "stop_color6"); stop_color7_uniform_location = glGetUniformLocation(gradient_prog, "stop_color7"); } else { stops_uniform_location = glGetUniformLocation(gradient_prog, "stops"); stop_colors_uniform_location = glGetUniformLocation(gradient_prog, "stop_colors"); } glUseProgram(gradient_prog); glUniform1i(repeat_type_uniform_location, src_picture->repeatType); if (src_picture->transform) { _glamor_gradient_convert_trans_matrix(src_picture->transform, transform_mat, width, height, 0); glUniformMatrix3fv(transform_mat_uniform_location, 1, 1, &transform_mat[0][0]); } else { glUniformMatrix3fv(transform_mat_uniform_location, 1, 1, &identity_mat[0][0]); } if (!_glamor_gradient_set_pixmap_destination (screen, glamor_priv, dst_picture, &xscale, &yscale, x_source, y_source, vertices, tex_vertices, 0)) goto GRADIENT_FAIL; /* Set all the stops and colors to shader. */ if (stops_count > RADIAL_SMALL_STOPS) { stop_colors = malloc(4 * stops_count * sizeof(float)); if (stop_colors == NULL) { ErrorF("Failed to allocate stop_colors memory.\n"); goto GRADIENT_FAIL; } n_stops = malloc(stops_count * sizeof(float)); if (n_stops == NULL) { ErrorF("Failed to allocate n_stops memory.\n"); goto GRADIENT_FAIL; } } else { stop_colors = stop_colors_st; n_stops = n_stops_st; } count = _glamor_gradient_set_stops(src_picture, &src_picture->pSourcePict->gradient, stop_colors, n_stops); if (src_picture->pSourcePict->linear.nstops + 2 <= RADIAL_SMALL_STOPS) { int j = 0; glUniform4f(stop_color0_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color1_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color2_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color3_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color4_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color5_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color6_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color7_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j = 0; glUniform1f(stop0_uniform_location, n_stops[j++]); glUniform1f(stop1_uniform_location, n_stops[j++]); glUniform1f(stop2_uniform_location, n_stops[j++]); glUniform1f(stop3_uniform_location, n_stops[j++]); glUniform1f(stop4_uniform_location, n_stops[j++]); glUniform1f(stop5_uniform_location, n_stops[j++]); glUniform1f(stop6_uniform_location, n_stops[j++]); glUniform1f(stop7_uniform_location, n_stops[j++]); glUniform1i(n_stop_uniform_location, count); } else { glUniform4fv(stop_colors_uniform_location, count, stop_colors); glUniform1fv(stops_uniform_location, count, n_stops); glUniform1i(n_stop_uniform_location, count); } c1x = (float) pixman_fixed_to_double(src_picture->pSourcePict->radial.c1.x); c1y = (float) pixman_fixed_to_double(src_picture->pSourcePict->radial.c1.y); c2x = (float) pixman_fixed_to_double(src_picture->pSourcePict->radial.c2.x); c2y = (float) pixman_fixed_to_double(src_picture->pSourcePict->radial.c2.y); r1 = (float) pixman_fixed_to_double(src_picture->pSourcePict->radial.c1. radius); r2 = (float) pixman_fixed_to_double(src_picture->pSourcePict->radial.c2. radius); glamor_set_circle_centre(width, height, c1x, c1y, cxy); glUniform2fv(c1_uniform_location, 1, cxy); glUniform1f(r1_uniform_location, r1); glamor_set_circle_centre(width, height, c2x, c2y, cxy); glUniform2fv(c2_uniform_location, 1, cxy); glUniform1f(r2_uniform_location, r2); A_value = (c2x - c1x) * (c2x - c1x) + (c2y - c1y) * (c2y - c1y) - (r2 - r1) * (r2 - r1); glUniform1f(A_value_uniform_location, A_value); DEBUGF("C1:(%f, %f) R1:%f\nC2:(%f, %f) R2:%f\nA = %f\n", c1x, c1y, r1, c2x, c2y, r2, A_value); /* Now rendering. */ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); /* Do the clear logic. */ if (stops_count > RADIAL_SMALL_STOPS) { free(n_stops); free(stop_colors); } glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); return dst_picture; GRADIENT_FAIL: if (dst_picture) { FreePicture(dst_picture, 0); } if (stops_count > RADIAL_SMALL_STOPS) { if (n_stops) free(n_stops); if (stop_colors) free(stop_colors); } glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); return NULL; } PicturePtr glamor_generate_linear_gradient_picture(ScreenPtr screen, PicturePtr src_picture, int x_source, int y_source, int width, int height, PictFormatShort format) { glamor_screen_private *glamor_priv; PicturePtr dst_picture = NULL; PixmapPtr pixmap = NULL; GLint gradient_prog = 0; int error; float pt_distance; float p1_distance; GLfloat cos_val; float tex_vertices[8]; int stops_count = 0; GLfloat *stop_colors = NULL; GLfloat *n_stops = NULL; int count = 0; float slope; GLfloat xscale, yscale; GLfloat pt1[2], pt2[2]; float vertices[8]; float transform_mat[3][3]; static const float identity_mat[3][3] = { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0} }; GLfloat stop_colors_st[LINEAR_SMALL_STOPS * 4]; GLfloat n_stops_st[LINEAR_SMALL_STOPS]; GLint transform_mat_uniform_location = 0; GLint n_stop_uniform_location = 0; GLint stops_uniform_location = 0; GLint stop0_uniform_location = 0; GLint stop1_uniform_location = 0; GLint stop2_uniform_location = 0; GLint stop3_uniform_location = 0; GLint stop4_uniform_location = 0; GLint stop5_uniform_location = 0; GLint stop6_uniform_location = 0; GLint stop7_uniform_location = 0; GLint stop_colors_uniform_location = 0; GLint stop_color0_uniform_location = 0; GLint stop_color1_uniform_location = 0; GLint stop_color2_uniform_location = 0; GLint stop_color3_uniform_location = 0; GLint stop_color4_uniform_location = 0; GLint stop_color5_uniform_location = 0; GLint stop_color6_uniform_location = 0; GLint stop_color7_uniform_location = 0; GLint pt_slope_uniform_location = 0; GLint repeat_type_uniform_location = 0; GLint hor_ver_uniform_location = 0; GLint cos_val_uniform_location = 0; GLint p1_distance_uniform_location = 0; GLint pt_distance_uniform_location = 0; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); /* Create a pixmap with VBO. */ pixmap = glamor_create_pixmap(screen, width, height, PIXMAN_FORMAT_DEPTH(format), 0); if (!pixmap) goto GRADIENT_FAIL; dst_picture = CreatePicture(0, &pixmap->drawable, PictureMatchFormat(screen, PIXMAN_FORMAT_DEPTH(format), format), 0, 0, serverClient, &error); /* Release the reference, picture will hold the last one. */ glamor_destroy_pixmap(pixmap); if (!dst_picture) goto GRADIENT_FAIL; ValidatePicture(dst_picture); stops_count = src_picture->pSourcePict->linear.nstops + 2; /* Because the max value of nstops is unkown, so create a program when nstops > LINEAR_LARGE_STOPS. */ if (stops_count <= LINEAR_SMALL_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][0]; } else if (stops_count <= LINEAR_LARGE_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][1]; } else { _glamor_create_linear_gradient_program(screen, src_picture->pSourcePict->linear. nstops + 2, 1); gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2]; } /* Bind all the uniform vars . */ n_stop_uniform_location = glGetUniformLocation(gradient_prog, "n_stop"); pt_slope_uniform_location = glGetUniformLocation(gradient_prog, "pt_slope"); repeat_type_uniform_location = glGetUniformLocation(gradient_prog, "repeat_type"); hor_ver_uniform_location = glGetUniformLocation(gradient_prog, "hor_ver"); transform_mat_uniform_location = glGetUniformLocation(gradient_prog, "transform_mat"); cos_val_uniform_location = glGetUniformLocation(gradient_prog, "cos_val"); p1_distance_uniform_location = glGetUniformLocation(gradient_prog, "p1_distance"); pt_distance_uniform_location = glGetUniformLocation(gradient_prog, "pt_distance"); if (src_picture->pSourcePict->linear.nstops + 2 <= LINEAR_SMALL_STOPS) { stop0_uniform_location = glGetUniformLocation(gradient_prog, "stop0"); stop1_uniform_location = glGetUniformLocation(gradient_prog, "stop1"); stop2_uniform_location = glGetUniformLocation(gradient_prog, "stop2"); stop3_uniform_location = glGetUniformLocation(gradient_prog, "stop3"); stop4_uniform_location = glGetUniformLocation(gradient_prog, "stop4"); stop5_uniform_location = glGetUniformLocation(gradient_prog, "stop5"); stop6_uniform_location = glGetUniformLocation(gradient_prog, "stop6"); stop7_uniform_location = glGetUniformLocation(gradient_prog, "stop7"); stop_color0_uniform_location = glGetUniformLocation(gradient_prog, "stop_color0"); stop_color1_uniform_location = glGetUniformLocation(gradient_prog, "stop_color1"); stop_color2_uniform_location = glGetUniformLocation(gradient_prog, "stop_color2"); stop_color3_uniform_location = glGetUniformLocation(gradient_prog, "stop_color3"); stop_color4_uniform_location = glGetUniformLocation(gradient_prog, "stop_color4"); stop_color5_uniform_location = glGetUniformLocation(gradient_prog, "stop_color5"); stop_color6_uniform_location = glGetUniformLocation(gradient_prog, "stop_color6"); stop_color7_uniform_location = glGetUniformLocation(gradient_prog, "stop_color7"); } else { stops_uniform_location = glGetUniformLocation(gradient_prog, "stops"); stop_colors_uniform_location = glGetUniformLocation(gradient_prog, "stop_colors"); } glUseProgram(gradient_prog); glUniform1i(repeat_type_uniform_location, src_picture->repeatType); /* set the transform matrix. */ if (src_picture->transform) { _glamor_gradient_convert_trans_matrix(src_picture->transform, transform_mat, width, height, 1); glUniformMatrix3fv(transform_mat_uniform_location, 1, 1, &transform_mat[0][0]); } else { glUniformMatrix3fv(transform_mat_uniform_location, 1, 1, &identity_mat[0][0]); } if (!_glamor_gradient_set_pixmap_destination (screen, glamor_priv, dst_picture, &xscale, &yscale, x_source, y_source, vertices, tex_vertices, 1)) goto GRADIENT_FAIL; /* Normalize the PTs. */ glamor_set_normalize_pt(xscale, yscale, pixman_fixed_to_double(src_picture->pSourcePict-> linear.p1.x), pixman_fixed_to_double(src_picture->pSourcePict-> linear.p1.y), pt1); DEBUGF("pt1:(%f, %f) ---> (%f %f)\n", pixman_fixed_to_double(src_picture->pSourcePict->linear.p1.x), pixman_fixed_to_double(src_picture->pSourcePict->linear.p1.y), pt1[0], pt1[1]); glamor_set_normalize_pt(xscale, yscale, pixman_fixed_to_double(src_picture->pSourcePict-> linear.p2.x), pixman_fixed_to_double(src_picture->pSourcePict-> linear.p2.y), pt2); DEBUGF("pt2:(%f, %f) ---> (%f %f)\n", pixman_fixed_to_double(src_picture->pSourcePict->linear.p2.x), pixman_fixed_to_double(src_picture->pSourcePict->linear.p2.y), pt2[0], pt2[1]); /* Set all the stops and colors to shader. */ if (stops_count > LINEAR_SMALL_STOPS) { stop_colors = malloc(4 * stops_count * sizeof(float)); if (stop_colors == NULL) { ErrorF("Failed to allocate stop_colors memory.\n"); goto GRADIENT_FAIL; } n_stops = malloc(stops_count * sizeof(float)); if (n_stops == NULL) { ErrorF("Failed to allocate n_stops memory.\n"); goto GRADIENT_FAIL; } } else { stop_colors = stop_colors_st; n_stops = n_stops_st; } count = _glamor_gradient_set_stops(src_picture, &src_picture->pSourcePict->gradient, stop_colors, n_stops); if (src_picture->pSourcePict->linear.nstops + 2 <= LINEAR_SMALL_STOPS) { int j = 0; glUniform4f(stop_color0_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color1_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color2_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color3_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color4_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color5_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color6_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j++; glUniform4f(stop_color7_uniform_location, stop_colors[4 * j + 0], stop_colors[4 * j + 1], stop_colors[4 * j + 2], stop_colors[4 * j + 3]); j = 0; glUniform1f(stop0_uniform_location, n_stops[j++]); glUniform1f(stop1_uniform_location, n_stops[j++]); glUniform1f(stop2_uniform_location, n_stops[j++]); glUniform1f(stop3_uniform_location, n_stops[j++]); glUniform1f(stop4_uniform_location, n_stops[j++]); glUniform1f(stop5_uniform_location, n_stops[j++]); glUniform1f(stop6_uniform_location, n_stops[j++]); glUniform1f(stop7_uniform_location, n_stops[j++]); glUniform1i(n_stop_uniform_location, count); } else { glUniform4fv(stop_colors_uniform_location, count, stop_colors); glUniform1fv(stops_uniform_location, count, n_stops); glUniform1i(n_stop_uniform_location, count); } if (src_picture->pSourcePict->linear.p2.y == src_picture->pSourcePict->linear.p1.y) { // The horizontal case. glUniform1i(hor_ver_uniform_location, 1); DEBUGF("p1.y: %f, p2.y: %f, enter the horizontal case\n", pt1[1], pt2[1]); p1_distance = pt1[0]; pt_distance = (pt2[0] - p1_distance); glUniform1f(p1_distance_uniform_location, p1_distance); glUniform1f(pt_distance_uniform_location, pt_distance); } else { /* The slope need to compute here. In shader, the viewport set will change the orginal slope and the slope which is vertical to it will not be correct. */ slope = -(float) (src_picture->pSourcePict->linear.p2.x - src_picture->pSourcePict->linear.p1.x) / (float) (src_picture->pSourcePict->linear.p2.y - src_picture->pSourcePict->linear.p1.y); slope = slope * yscale / xscale; glUniform1f(pt_slope_uniform_location, slope); glUniform1i(hor_ver_uniform_location, 0); cos_val = sqrt(1.0 / (slope * slope + 1.0)); glUniform1f(cos_val_uniform_location, cos_val); p1_distance = (pt1[1] - pt1[0] * slope) * cos_val; pt_distance = (pt2[1] - pt2[0] * slope) * cos_val - p1_distance; glUniform1f(p1_distance_uniform_location, p1_distance); glUniform1f(pt_distance_uniform_location, pt_distance); } /* Now rendering. */ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); /* Do the clear logic. */ if (stops_count > LINEAR_SMALL_STOPS) { free(n_stops); free(stop_colors); } glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); return dst_picture; GRADIENT_FAIL: if (dst_picture) { FreePicture(dst_picture, 0); } if (stops_count > LINEAR_SMALL_STOPS) { if (n_stops) free(n_stops); if (stop_colors) free(stop_colors); } glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); return NULL; } #endif /* End of GLAMOR_GRADIENT_SHADER */ #endif /* End of RENDER */ xorg-server-1.17.1/glamor/glamor_priv.h0000664000175100017510000010717012460477634015007 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ #ifndef GLAMOR_PRIV_H #define GLAMOR_PRIV_H #include "dix-config.h" #include "glamor.h" #include "xvdix.h" #if XSYNC #include "misyncshm.h" #include "misyncstr.h" #endif #include #if GLAMOR_HAS_GBM #define MESA_EGL_NO_X11_HEADERS #include #endif #define GLAMOR_DEFAULT_PRECISION \ "#ifdef GL_ES\n" \ "precision mediump float;\n" \ "#endif\n" #ifdef RENDER #include "glyphstr.h" #endif #include "glamor_debug.h" #include "glamor_context.h" #include "glamor_program.h" #include struct glamor_pixmap_private; typedef struct glamor_composite_shader { GLuint prog; GLint dest_to_dest_uniform_location; GLint dest_to_source_uniform_location; GLint dest_to_mask_uniform_location; GLint source_uniform_location; GLint mask_uniform_location; GLint source_wh; GLint mask_wh; GLint source_repeat_mode; GLint mask_repeat_mode; union { float source_solid_color[4]; struct { struct glamor_pixmap_private *source_priv; PicturePtr source; }; }; union { float mask_solid_color[4]; struct { struct glamor_pixmap_private *mask_priv; PicturePtr mask; }; }; } glamor_composite_shader; enum shader_source { SHADER_SOURCE_SOLID, SHADER_SOURCE_TEXTURE, SHADER_SOURCE_TEXTURE_ALPHA, SHADER_SOURCE_COUNT, }; enum shader_mask { SHADER_MASK_NONE, SHADER_MASK_SOLID, SHADER_MASK_TEXTURE, SHADER_MASK_TEXTURE_ALPHA, SHADER_MASK_COUNT, }; enum shader_in { SHADER_IN_SOURCE_ONLY, SHADER_IN_NORMAL, SHADER_IN_CA_SOURCE, SHADER_IN_CA_ALPHA, SHADER_IN_COUNT, }; struct shader_key { enum shader_source source; enum shader_mask mask; enum shader_in in; }; struct blendinfo { Bool dest_alpha; Bool source_alpha; GLenum source_blend; GLenum dest_blend; }; typedef struct { INT16 x_src; INT16 y_src; INT16 x_mask; INT16 y_mask; INT16 x_dst; INT16 y_dst; INT16 width; INT16 height; } glamor_composite_rect_t; enum glamor_vertex_type { GLAMOR_VERTEX_POS, GLAMOR_VERTEX_SOURCE, GLAMOR_VERTEX_MASK }; enum gradient_shader { SHADER_GRADIENT_LINEAR, SHADER_GRADIENT_RADIAL, SHADER_GRADIENT_CONICAL, SHADER_GRADIENT_COUNT, }; struct glamor_screen_private; struct glamor_pixmap_private; enum glamor_gl_flavor { GLAMOR_GL_DESKTOP, // OPENGL API GLAMOR_GL_ES2 // OPENGL ES2.0 API }; #define GLAMOR_NUM_GLYPH_CACHE_FORMATS 2 #define GLAMOR_COMPOSITE_VBO_VERT_CNT (64*1024) typedef struct { PicturePtr picture; /* Where the glyphs of the cache are stored */ GlyphPtr *glyphs; uint16_t count; uint16_t evict; } glamor_glyph_cache_t; #define CACHE_PICTURE_SIZE 1024 #define GLYPH_MIN_SIZE 8 #define GLYPH_MAX_SIZE 64 #define GLYPH_CACHE_SIZE ((CACHE_PICTURE_SIZE) * CACHE_PICTURE_SIZE / (GLYPH_MIN_SIZE * GLYPH_MIN_SIZE)) #define MASK_CACHE_MAX_SIZE 32 #define MASK_CACHE_WIDTH (CACHE_PICTURE_SIZE / MASK_CACHE_MAX_SIZE) #define MASK_CACHE_MASK ((1LL << (MASK_CACHE_WIDTH)) - 1) struct glamor_glyph_mask_cache_entry { int idx; int width; int height; int x; int y; }; typedef struct { PixmapPtr pixmap; struct glamor_glyph_mask_cache_entry mcache[MASK_CACHE_WIDTH]; unsigned int free_bitmap; unsigned int cleared_bitmap; } glamor_glyph_mask_cache_t; struct glamor_saved_procs { CloseScreenProcPtr close_screen; CreateScreenResourcesProcPtr create_screen_resources; CreateGCProcPtr create_gc; CreatePixmapProcPtr create_pixmap; DestroyPixmapProcPtr destroy_pixmap; GetSpansProcPtr get_spans; GetImageProcPtr get_image; CompositeProcPtr composite; CompositeRectsProcPtr composite_rects; TrapezoidsProcPtr trapezoids; GlyphsProcPtr glyphs; ChangeWindowAttributesProcPtr change_window_attributes; CopyWindowProcPtr copy_window; BitmapToRegionProcPtr bitmap_to_region; TrianglesProcPtr triangles; AddTrapsProcPtr addtraps; CreatePictureProcPtr create_picture; DestroyPictureProcPtr destroy_picture; UnrealizeGlyphProcPtr unrealize_glyph; SetWindowPixmapProcPtr set_window_pixmap; #if XSYNC SyncScreenFuncsRec sync_screen_funcs; #endif ScreenBlockHandlerProcPtr block_handler; }; #define CACHE_FORMAT_COUNT 3 #define CACHE_BUCKET_WCOUNT 4 #define CACHE_BUCKET_HCOUNT 4 #define GLAMOR_TICK_AFTER(t0, t1) \ (((int)(t1) - (int)(t0)) < 0) typedef struct glamor_screen_private { unsigned int tick; enum glamor_gl_flavor gl_flavor; int glsl_version; int has_pack_invert; int has_fbo_blit; int has_map_buffer_range; int has_buffer_storage; int has_khr_debug; int has_nv_texture_barrier; int max_fbo_size; int has_rw_pbo; struct xorg_list fbo_cache[CACHE_FORMAT_COUNT][CACHE_BUCKET_WCOUNT][CACHE_BUCKET_HCOUNT]; unsigned long fbo_cache_watermark; /* glamor point shader */ glamor_program point_prog; /* glamor spans shaders */ glamor_program_fill fill_spans_program; /* glamor rect shaders */ glamor_program_fill poly_fill_rect_program; /* glamor glyphblt shaders */ glamor_program_fill poly_glyph_blt_progs; /* glamor text shaders */ glamor_program_fill poly_text_progs; glamor_program te_text_prog; glamor_program image_text_prog; /* glamor copy shaders */ glamor_program copy_area_prog; glamor_program copy_plane_prog; /* glamor line shader */ glamor_program_fill poly_line_program; /* glamor segment shaders */ glamor_program_fill poly_segment_program; /* glamor dash line shader */ glamor_program_fill on_off_dash_line_progs; glamor_program double_dash_line_prog; /* vertext/elment_index buffer object for render */ GLuint vbo, ebo; /** Next offset within the VBO that glamor_get_vbo_space() will use. */ int vbo_offset; int vbo_size; /** * Pointer to glamor_get_vbo_space()'s current VBO mapping. * * Note that this is not necessarily equal to the pointer returned * by glamor_get_vbo_space(), so it can't be used in place of that. */ char *vb; int vb_stride; Bool has_source_coords, has_mask_coords; int render_nr_verts; glamor_composite_shader composite_shader[SHADER_SOURCE_COUNT] [SHADER_MASK_COUNT] [SHADER_IN_COUNT]; glamor_glyph_cache_t glyphCaches[GLAMOR_NUM_GLYPH_CACHE_FORMATS]; glamor_glyph_mask_cache_t *mask_cache[GLAMOR_NUM_GLYPH_CACHE_FORMATS]; Bool glyph_caches_realized; /* shaders to restore a texture to another texture. */ GLint finish_access_prog[2]; GLint finish_access_revert[2]; GLint finish_access_swap_rb[2]; /* glamor gradient, 0 for small nstops, 1 for large nstops and 2 for dynamic generate. */ GLint gradient_prog[SHADER_GRADIENT_COUNT][3]; int linear_max_nstops; int radial_max_nstops; int screen_fbo; struct glamor_saved_procs saved_procs; char delayed_fallback_string[GLAMOR_DELAYED_STRING_MAX + 1]; int delayed_fallback_pending; int flags; ScreenPtr screen; int dri3_enabled; /* xv */ GLint xv_prog; struct glamor_context ctx; } glamor_screen_private; typedef enum glamor_access { GLAMOR_ACCESS_RO, GLAMOR_ACCESS_RW, } glamor_access_t; enum glamor_fbo_state { /** There is no storage attached to the pixmap. */ GLAMOR_FBO_UNATTACHED, /** * The pixmap has FBO storage attached, but devPrivate.ptr doesn't * point at anything. */ GLAMOR_FBO_NORMAL, /** * The FBO is present and can be accessed as a linear memory * mapping through devPrivate.ptr. */ GLAMOR_FBO_DOWNLOADED, }; /* glamor_pixmap_fbo: * @list: to be used to link to the cache pool list. * @expire: when push to cache pool list, set a expire count. * will be freed when glamor_priv->tick is equal or * larger than this expire count in block handler. * @pbo_valid: The pbo has a valid copy of the pixmap's data. * @tex: attached texture. * @fb: attached fbo. * @pbo: attached pbo. * @width: width of this fbo. * @height: height of this fbo. * @external set when the texture was not created by glamor * @format: internal format of this fbo's texture. * @type: internal type of this fbo's texture. * @glamor_priv: point to glamor private data. */ typedef struct glamor_pixmap_fbo { struct xorg_list list; unsigned int expire; unsigned char pbo_valid; GLuint tex; GLuint fb; GLuint pbo; int width; int height; Bool external; GLenum format; GLenum type; glamor_screen_private *glamor_priv; } glamor_pixmap_fbo; /* * glamor_pixmap_private - glamor pixmap's private structure. * @gl_tex: The pixmap is in a gl texture originally. * @is_picture: The drawable is attached to a picture. * @pict_format: the corresponding picture's format. * @pixmap: The corresponding pixmap's pointer. * * For GLAMOR_TEXTURE_LARGE, nbox should larger than 1. * And the box and fbo will both have nbox elements. * and box[i] store the relatively coords in this pixmap * of the fbo[i]. The reason why use boxes not region to * represent this structure is we may need to use overlapped * boxes for one pixmap for some special reason. * * pixmap * ****************** * * fbo0 * fbo1 * * * * * * ****************** * * fbo2 * fbo3 * * * * * * ****************** * * Let's assume the texture has size of 1024x1024 * box[0] = {0,0,1024,1024} * box[1] = {1024,0,2048,2048} * ... * * For GLAMOR_TEXTURE_ATLAS nbox should be 1. And box * and fbo both has one elements, and the box store * the relatively coords in the fbo of this pixmap: * * fbo * ****************** * * pixmap * * * ********* * * * * * * * * ********* * * * * * ****************** * * Assume the pixmap is at the (100,100) relatively to * the fbo's origin. * box[0]={100, 100, 1124, 1124}; * * Considering large pixmap is not a normal case, to keep * it simple, I designe it as the following way. * When deal with a large pixmap, it split the working * rectangle into serval boxes, and each box fit into a * corresponding fbo. And then the rendering function will * loop from the left-top box to the right-bottom box, * each time, we will set current box and current fbo * to the box and fbo elements. Thus the inner routines * can handle it as normal, only the coords calculation need * to aware of it's large pixmap. * * Currently, we haven't implemented the atlas pixmap. * **/ typedef struct glamor_pixmap_clipped_regions { int block_idx; RegionPtr region; } glamor_pixmap_clipped_regions; typedef struct glamor_pixmap_private_base { glamor_pixmap_type_t type; enum glamor_fbo_state gl_fbo; /** * If devPrivate.ptr is non-NULL (meaning we're within * glamor_prepare_access), determies whether we should re-upload * that data on glamor_finish_access(). */ glamor_access_t map_access; unsigned char is_picture:1; unsigned char gl_tex:1; glamor_pixmap_fbo *fbo; PixmapPtr pixmap; BoxRec box; int drm_stride; glamor_screen_private *glamor_priv; PicturePtr picture; GLuint pbo; RegionRec prepare_region; Bool prepared; #if GLAMOR_HAS_GBM EGLImageKHR image; #endif } glamor_pixmap_private_base_t; /* * @base.fbo: current fbo. * @box: current fbo's coords in the whole pixmap. * @block_w: block width of this large pixmap. * @block_h: block height of this large pixmap. * @block_wcnt: block count in one block row. * @block_hcnt: block count in one block column. * @nbox: total block count. * @box_array: contains each block's corresponding box. * @fbo_array: contains each block's fbo pointer. * **/ typedef struct glamor_pixmap_private_large { union { glamor_pixmap_type_t type; glamor_pixmap_private_base_t base; }; BoxRec box; int block_w; int block_h; int block_wcnt; int block_hcnt; int nbox; BoxPtr box_array; glamor_pixmap_fbo **fbo_array; } glamor_pixmap_private_large_t; /* * @box: the relative coords in the corresponding fbo. */ typedef struct glamor_pixmap_private_atlas { union { glamor_pixmap_type_t type; glamor_pixmap_private_base_t base; }; BoxRec box; } glamor_pixmap_private_atlas_t; typedef struct glamor_pixmap_private { union { glamor_pixmap_type_t type; glamor_pixmap_private_base_t base; glamor_pixmap_private_large_t large; glamor_pixmap_private_atlas_t atlas; }; } glamor_pixmap_private; static inline void glamor_set_pixmap_fbo_current(glamor_pixmap_private *priv, int idx) { if (priv->type == GLAMOR_TEXTURE_LARGE) { priv->large.base.fbo = priv->large.fbo_array[idx]; priv->large.box = priv->large.box_array[idx]; } } static inline glamor_pixmap_fbo * glamor_pixmap_fbo_at(glamor_pixmap_private *priv, int x, int y) { if (priv->type == GLAMOR_TEXTURE_LARGE) { assert(x < priv->large.block_wcnt); assert(y < priv->large.block_hcnt); return priv->large.fbo_array[y * priv->large.block_wcnt + x]; } assert (x == 0); assert (y == 0); return priv->base.fbo; } static inline BoxPtr glamor_pixmap_box_at(glamor_pixmap_private *priv, int x, int y) { if (priv->type == GLAMOR_TEXTURE_LARGE) { assert(x < priv->large.block_wcnt); assert(y < priv->large.block_hcnt); return &priv->large.box_array[y * priv->large.block_wcnt + x]; } assert (x == 0); assert (y == 0); return &priv->base.box; } static inline int glamor_pixmap_wcnt(glamor_pixmap_private *priv) { if (priv->type == GLAMOR_TEXTURE_LARGE) return priv->large.block_wcnt; return 1; } static inline int glamor_pixmap_hcnt(glamor_pixmap_private *priv) { if (priv->type == GLAMOR_TEXTURE_LARGE) return priv->large.block_hcnt; return 1; } #define glamor_pixmap_loop(priv, x, y) \ for (y = 0; y < glamor_pixmap_hcnt(priv); y++) \ for (x = 0; x < glamor_pixmap_wcnt(priv); x++) /* * Pixmap dynamic status, used by dynamic upload feature. * * GLAMOR_NONE: initial status, don't need to do anything. * GLAMOR_UPLOAD_PENDING: marked as need to be uploaded to gl texture. * GLAMOR_UPLOAD_DONE: the pixmap has been uploaded successfully. * GLAMOR_UPLOAD_FAILED: fail to upload the pixmap. * * */ typedef enum glamor_pixmap_status { GLAMOR_NONE, GLAMOR_UPLOAD_PENDING, GLAMOR_UPLOAD_DONE, GLAMOR_UPLOAD_FAILED } glamor_pixmap_status_t; /* GC private structure. Currently holds only any computed dash pixmap */ typedef struct { PixmapPtr dash; PixmapPtr stipple; DamagePtr stipple_damage; } glamor_gc_private; extern DevPrivateKeyRec glamor_gc_private_key; extern DevPrivateKeyRec glamor_screen_private_key; extern DevPrivateKeyRec glamor_pixmap_private_key; static inline glamor_screen_private * glamor_get_screen_private(ScreenPtr screen) { return (glamor_screen_private *) dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key); } static inline void glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv) { dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv); } static inline glamor_pixmap_private * glamor_get_pixmap_private(PixmapPtr pixmap) { glamor_pixmap_private *priv; priv = dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key); if (!priv) { glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY); priv = dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key); } return priv; } void glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv); static inline glamor_gc_private * glamor_get_gc_private(GCPtr gc) { return dixLookupPrivate(&gc->devPrivates, &glamor_gc_private_key); } /** * Returns TRUE if the given planemask covers all the significant bits in the * pixel values for pDrawable. */ static inline Bool glamor_pm_is_solid(DrawablePtr drawable, unsigned long planemask) { return (planemask & FbFullMask(drawable->depth)) == FbFullMask(drawable->depth); } extern int glamor_debug_level; /* glamor.c */ PixmapPtr glamor_get_drawable_pixmap(DrawablePtr drawable); glamor_pixmap_fbo *glamor_pixmap_detach_fbo(glamor_pixmap_private * pixmap_priv); void glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo); glamor_pixmap_fbo *glamor_create_fbo_from_tex(glamor_screen_private * glamor_priv, int w, int h, GLenum format, GLint tex, int flag); glamor_pixmap_fbo *glamor_create_fbo(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag); void glamor_destroy_fbo(glamor_pixmap_fbo *fbo); void glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv); void glamor_init_pixmap_fbo(ScreenPtr screen); void glamor_fini_pixmap_fbo(ScreenPtr screen); Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap); void glamor_fbo_expire(glamor_screen_private *glamor_priv); glamor_pixmap_fbo *glamor_create_fbo_array(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag, int block_w, int block_h, glamor_pixmap_private *); /* glamor_core.c */ void glamor_init_finish_access_shaders(ScreenPtr screen); void glamor_fini_finish_access_shaders(ScreenPtr screen); const Bool glamor_get_drawable_location(const DrawablePtr drawable); void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int *x, int *y); GLint glamor_compile_glsl_prog(GLenum type, const char *source); void glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); void glamor_get_color_4f_from_pixel(PixmapPtr pixmap, unsigned long fg_pixel, GLfloat *color); int glamor_set_destination_pixmap(PixmapPtr pixmap); int glamor_set_destination_pixmap_priv(glamor_pixmap_private *pixmap_priv); void glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo *, int, int, int, int); /* nc means no check. caller must ensure this pixmap has valid fbo. * usually use the GLAMOR_PIXMAP_PRIV_HAS_FBO firstly. * */ void glamor_set_destination_pixmap_priv_nc(glamor_pixmap_private *pixmap_priv); glamor_pixmap_fbo *glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, GLenum format, GLenum type, int no_alpha, int revert, int swap_rb); Bool glamor_set_alu(ScreenPtr screen, unsigned char alu); Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask); RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap); void glamor_track_stipple(GCPtr gc); /* glamor_glyphs.c */ Bool glamor_realize_glyph_caches(ScreenPtr screen); void glamor_glyphs_fini(ScreenPtr screen); void glamor_glyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr *glyphs); /* glamor_render.c */ Bool glamor_composite_clipped_region(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, glamor_pixmap_private *soruce_pixmap_priv, glamor_pixmap_private *mask_pixmap_priv, glamor_pixmap_private *dest_pixmap_priv, RegionPtr region, int x_source, int y_source, int x_mask, int y_mask, int x_dest, int y_dest); void glamor_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); void glamor_init_composite_shaders(ScreenPtr screen); void glamor_fini_composite_shaders(ScreenPtr screen); void glamor_composite_glyph_rects(CARD8 op, PicturePtr src, PicturePtr mask, PicturePtr dst, int nrect, glamor_composite_rect_t *rects); void glamor_composite_rects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, xRectangle *rects); PicturePtr glamor_convert_gradient_picture(ScreenPtr screen, PicturePtr source, int x_source, int y_source, int width, int height); Bool glamor_composite_choose_shader(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, glamor_pixmap_private *source_pixmap_priv, glamor_pixmap_private *mask_pixmap_priv, glamor_pixmap_private *dest_pixmap_priv, struct shader_key *s_key, glamor_composite_shader ** shader, struct blendinfo *op_info, PictFormatShort *psaved_source_format); void glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv, struct shader_key *key, glamor_composite_shader *shader, struct blendinfo *op_info); void *glamor_setup_composite_vbo(ScreenPtr screen, int n_verts); /* glamor_trapezoid.c */ void glamor_trapezoids(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int ntrap, xTrapezoid *traps); /* glamor_gradient.c */ void glamor_init_gradient_shader(ScreenPtr screen); void glamor_fini_gradient_shader(ScreenPtr screen); PicturePtr glamor_generate_linear_gradient_picture(ScreenPtr screen, PicturePtr src_picture, int x_source, int y_source, int width, int height, PictFormatShort format); PicturePtr glamor_generate_radial_gradient_picture(ScreenPtr screen, PicturePtr src_picture, int x_source, int y_source, int width, int height, PictFormatShort format); /* glamor_triangles.c */ void glamor_triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris); /* glamor_pixmap.c */ void glamor_pixmap_init(ScreenPtr screen); void glamor_pixmap_fini(ScreenPtr screen); /* glamor_vbo.c */ void glamor_init_vbo(ScreenPtr screen); void glamor_fini_vbo(ScreenPtr screen); void * glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset); void glamor_put_vbo_space(ScreenPtr screen); /** * According to the flag, * if the flag is GLAMOR_CREATE_FBO_NO_FBO then just ensure * the fbo has a valid texture. Otherwise, it will ensure * the fbo has valid texture and attach to a valid fb. * If the fbo already has a valid glfbo then do nothing. */ Bool glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag); /** * Upload a pixmap to gl texture. Used by dynamic pixmap * uploading feature. The pixmap must be a software pixmap. * This function will change current FBO and current shaders. */ enum glamor_pixmap_status glamor_upload_pixmap_to_texture(PixmapPtr pixmap); Bool glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, int h, int stride, void *bits, int pbo); glamor_pixmap_clipped_regions * glamor_compute_clipped_regions(glamor_pixmap_private *priv, RegionPtr region, int *clipped_nbox, int repeat_type, int reverse, int upsidedown); glamor_pixmap_clipped_regions * glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv, RegionPtr region, int *n_region, int inner_block_w, int inner_block_h, int reverse, int upsidedown); glamor_pixmap_clipped_regions * glamor_compute_transform_clipped_regions(glamor_pixmap_private *priv, struct pixman_transform *transform, RegionPtr region, int *n_region, int dx, int dy, int repeat_type, int reverse, int upsidedown); Bool glamor_composite_largepixmap_region(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, glamor_pixmap_private *source_pixmap_priv, glamor_pixmap_private *mask_pixmap_priv, glamor_pixmap_private *dest_pixmap_priv, RegionPtr region, Bool force_clip, INT16 x_source, INT16 y_source, INT16 x_mask, INT16 y_mask, INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height); Bool glamor_get_transform_block_size(struct pixman_transform *transform, int block_w, int block_h, int *transformed_block_w, int *transformed_block_h); void glamor_get_transform_extent_from_box(struct pixman_box32 *temp_box, struct pixman_transform *transform); /** * Upload a picture to gl texture. Similar to the * glamor_upload_pixmap_to_texture. Used in rendering. **/ enum glamor_pixmap_status glamor_upload_picture_to_texture(PicturePtr picture); /** * Upload bits to a pixmap's texture. This function will * convert the bits to the specified format/type format * if the conversion is unavoidable. **/ Bool glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, GLenum type, int no_alpha, int revert, int swap_rb, void *bits); int glamor_create_picture(PicturePtr picture); void glamor_set_window_pixmap(WindowPtr pWindow, PixmapPtr pPixmap); void glamor_destroy_picture(PicturePtr picture); /* fixup a fbo to the exact size as the pixmap. */ Bool glamor_fixup_pixmap_priv(ScreenPtr screen, glamor_pixmap_private *pixmap_priv); void glamor_picture_format_fixup(PicturePtr picture, glamor_pixmap_private *pixmap_priv); void glamor_add_traps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps); /* glamor_text.c */ int glamor_poly_text8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars); int glamor_poly_text16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars); void glamor_image_text8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars); void glamor_image_text16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars); /* glamor_spans.c */ void glamor_fill_spans(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted); void glamor_get_spans(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst); void glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src, DDXPointPtr points, int *widths, int numPoints, int sorted); /* glamor_rects.c */ void glamor_poly_fill_rect(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect); /* glamor_image.c */ void glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits); void glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); /* glamor_dash.c */ Bool glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points); Bool glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs); /* glamor_lines.c */ void glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points); /* glamor_segs.c */ void glamor_poly_segment(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs); /* glamor_copy.c */ void glamor_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); RegionPtr glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, int srcx, int srcy, int width, int height, int dstx, int dsty); RegionPtr glamor_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bitplane); /* glamor_glyphblt.c */ void glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase); void glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase); void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y); void glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt); void glamor_composite_rectangles(CARD8 op, PicturePtr dst, xRenderColor *color, int num_rects, xRectangle *rects); /* glamor_sync.c */ Bool glamor_sync_init(ScreenPtr screen); void glamor_sync_close(ScreenPtr screen); /* glamor_util.c */ void glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, unsigned long fg_pixel); void glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, unsigned long fg_pixel); /* glamor_xv */ typedef struct { uint32_t transform_index; uint32_t gamma; /* gamma value x 1000 */ int brightness; int saturation; int hue; int contrast; DrawablePtr pDraw; PixmapPtr pPixmap; uint32_t src_pitch; uint8_t *src_addr; int src_w, src_h, dst_w, dst_h; int src_x, src_y, drw_x, drw_y; int w, h; RegionRec clip; PixmapPtr src_pix[3]; /* y, u, v for planar */ int src_pix_w, src_pix_h; } glamor_port_private; extern XvAttributeRec glamor_xv_attributes[]; extern int glamor_xv_num_attributes; extern XvImageRec glamor_xv_images[]; extern int glamor_xv_num_images; void glamor_xv_init_port(glamor_port_private *port_priv); void glamor_xv_stop_video(glamor_port_private *port_priv); int glamor_xv_set_port_attribute(glamor_port_private *port_priv, Atom attribute, INT32 value); int glamor_xv_get_port_attribute(glamor_port_private *port_priv, Atom attribute, INT32 *value); int glamor_xv_query_image_attributes(int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets); int glamor_xv_put_image(glamor_port_private *port_priv, DrawablePtr pDrawable, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, unsigned char *buf, short width, short height, Bool sync, RegionPtr clipBoxes); void glamor_xv_core_init(ScreenPtr screen); void glamor_xv_render(glamor_port_private *port_priv); #include"glamor_utils.h" /* Dynamic pixmap upload to texture if needed. * Sometimes, the target is a gl texture pixmap/picture, * but the source or mask is in cpu memory. In that case, * upload the source/mask to gl texture and then avoid * fallback the whole process to cpu. Most of the time, * this will increase performance obviously. */ #define GLAMOR_PIXMAP_DYNAMIC_UPLOAD #define GLAMOR_GRADIENT_SHADER #define GLAMOR_TEXTURED_LARGE_PIXMAP 1 #define WALKAROUND_LARGE_TEXTURE_MAP #if 0 #define MAX_FBO_SIZE 32 /* For test purpose only. */ #endif //#define GLYPHS_NO_EDEGEMAP_OVERLAP_CHECK #define GLYPHS_EDEGE_OVERLAP_LOOSE_CHECK #include "glamor_font.h" #endif /* GLAMOR_PRIV_H */ xorg-server-1.17.1/glamor/glamor.c0000664000175100017510000005351512460477634013745 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Zhigang Gong * */ /** @file glamor.c * This file covers the initialization and teardown of glamor, and has various * functions not responsible for performing rendering. */ #include #include "glamor_priv.h" DevPrivateKeyRec glamor_screen_private_key; DevPrivateKeyRec glamor_pixmap_private_key; DevPrivateKeyRec glamor_gc_private_key; /** * glamor_get_drawable_pixmap() returns a backing pixmap for a given drawable. * * @param drawable the drawable being requested. * * This function returns the backing pixmap for a drawable, whether it is a * redirected window, unredirected window, or already a pixmap. Note that * coordinate translation is needed when drawing to the backing pixmap of a * redirected window, and the translation coordinates are provided by calling * exaGetOffscreenPixmap() on the drawable. */ PixmapPtr glamor_get_drawable_pixmap(DrawablePtr drawable) { if (drawable->type == DRAWABLE_WINDOW) return drawable->pScreen->GetWindowPixmap((WindowPtr) drawable); else return (PixmapPtr) drawable; } _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type) { glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); pixmap_priv = dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key); if (pixmap_priv == NULL) { pixmap_priv = calloc(sizeof(*pixmap_priv), 1); glamor_set_pixmap_private(pixmap, pixmap_priv); pixmap_priv->base.pixmap = pixmap; pixmap_priv->base.glamor_priv = glamor_priv; } pixmap_priv->type = type; pixmap_priv->base.box.x1 = 0; pixmap_priv->base.box.x2 = pixmap->drawable.width; pixmap_priv->base.box.y1 = 0; pixmap_priv->base.box.y2 = pixmap->drawable.height; } _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) { ScreenPtr screen = pixmap->drawable.pScreen; glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv; glamor_pixmap_fbo *fbo; GLenum format; glamor_priv = glamor_get_screen_private(screen); pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv->base.fbo) { fbo = glamor_pixmap_detach_fbo(pixmap_priv); glamor_destroy_fbo(fbo); } format = gl_iformat_for_pixmap(pixmap); fbo = glamor_create_fbo_from_tex(glamor_priv, pixmap->drawable.width, pixmap->drawable.height, format, tex, 0); if (fbo == NULL) { ErrorF("XXX fail to create fbo.\n"); return; } fbo->external = TRUE; glamor_pixmap_attach_fbo(pixmap, fbo); } void glamor_set_screen_pixmap(PixmapPtr screen_pixmap, PixmapPtr *back_pixmap) { glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen_pixmap->drawable.pScreen); pixmap_priv = glamor_get_pixmap_private(screen_pixmap); glamor_priv->screen_fbo = pixmap_priv->base.fbo->fb; pixmap_priv->base.fbo->width = screen_pixmap->drawable.width; pixmap_priv->base.fbo->height = screen_pixmap->drawable.height; } uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap) { glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv->type != GLAMOR_TEXTURE_ONLY) return 0; return pixmap_priv->base.fbo->tex; } PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, unsigned int usage) { PixmapPtr pixmap; glamor_pixmap_type_t type = GLAMOR_TEXTURE_ONLY; glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_pixmap_fbo *fbo = NULL; int pitch; GLenum format; if (w > 32767 || h > 32767) return NullPixmap; if ((usage == GLAMOR_CREATE_PIXMAP_CPU || (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE && w <= 64 && h <= 64) || (w == 0 && h == 0) || !glamor_check_pixmap_fbo_depth(depth)) || (!GLAMOR_TEXTURED_LARGE_PIXMAP && !glamor_check_fbo_size(glamor_priv, w, h))) return fbCreatePixmap(screen, w, h, depth, usage); else pixmap = fbCreatePixmap(screen, 0, 0, depth, usage); pixmap_priv = calloc(1, sizeof(*pixmap_priv)); if (!pixmap_priv) { fbDestroyPixmap(pixmap); return fbCreatePixmap(screen, w, h, depth, usage); } glamor_set_pixmap_private(pixmap, pixmap_priv); if (usage == GLAMOR_CREATE_PIXMAP_MAP) type = GLAMOR_MEMORY_MAP; pixmap_priv->base.pixmap = pixmap; pixmap_priv->base.glamor_priv = glamor_priv; format = gl_iformat_for_pixmap(pixmap); pitch = (((w * pixmap->drawable.bitsPerPixel + 7) / 8) + 3) & ~3; screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, pitch, NULL); if (usage == GLAMOR_CREATE_PIXMAP_NO_TEXTURE) { pixmap_priv->type = GLAMOR_TEXTURE_ONLY; pixmap_priv->base.box.x1 = 0; pixmap_priv->base.box.y1 = 0; pixmap_priv->base.box.x2 = w; pixmap_priv->base.box.y2 = h; return pixmap; } else if (type == GLAMOR_MEMORY_MAP || usage == GLAMOR_CREATE_NO_LARGE || glamor_check_fbo_size(glamor_priv, w, h)) { pixmap_priv->type = type; pixmap_priv->base.box.x1 = 0; pixmap_priv->base.box.y1 = 0; pixmap_priv->base.box.x2 = w; pixmap_priv->base.box.y2 = h; fbo = glamor_create_fbo(glamor_priv, w, h, format, usage); } else { int tile_size = glamor_priv->max_fbo_size; DEBUGF("Create LARGE pixmap %p width %d height %d, tile size %d\n", pixmap, w, h, tile_size); pixmap_priv->type = GLAMOR_TEXTURE_LARGE; fbo = glamor_create_fbo_array(glamor_priv, w, h, format, usage, tile_size, tile_size, pixmap_priv); } if (fbo == NULL) { fbDestroyPixmap(pixmap); free(pixmap_priv); return fbCreatePixmap(screen, w, h, depth, usage); } glamor_pixmap_attach_fbo(pixmap, fbo); return pixmap; } void glamor_destroy_textured_pixmap(PixmapPtr pixmap) { if (pixmap->refcnt == 1) { glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv != NULL) { #if GLAMOR_HAS_GBM glamor_egl_destroy_pixmap_image(pixmap); #endif glamor_set_pixmap_private(pixmap, NULL); } } } Bool glamor_destroy_pixmap(PixmapPtr pixmap) { glamor_destroy_textured_pixmap(pixmap); return fbDestroyPixmap(pixmap); } void glamor_block_handler(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glamor_priv->tick++; glFlush(); glamor_fbo_expire(glamor_priv); } static void _glamor_block_handler(ScreenPtr screen, void *timeout, void *readmask) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); screen->BlockHandler = glamor_priv->saved_procs.block_handler; screen->BlockHandler(screen, timeout, readmask); glamor_priv->saved_procs.block_handler = screen->BlockHandler; screen->BlockHandler = _glamor_block_handler; glamor_make_current(glamor_priv); glFlush(); } static void glamor_set_debug_level(int *debug_level) { char *debug_level_string; debug_level_string = getenv("GLAMOR_DEBUG"); if (debug_level_string && sscanf(debug_level_string, "%d", debug_level) == 1) return; *debug_level = 0; } int glamor_debug_level; /** * Creates any pixmaps used internally by glamor, since those can't be * allocated at ScreenInit time. */ static Bool glamor_create_screen_resources(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); Bool ret = TRUE; screen->CreateScreenResources = glamor_priv->saved_procs.create_screen_resources; if (screen->CreateScreenResources) ret = screen->CreateScreenResources(screen); screen->CreateScreenResources = glamor_create_screen_resources; if (!glamor_glyphs_init(screen)) { ErrorF("Failed to initialize glyphs\n"); ret = FALSE; } if (!glamor_realize_glyph_caches(screen)) { ErrorF("Failed to initialize glyph cache\n"); ret = FALSE; } return ret; } /** Set up glamor for an already-configured GL context. */ Bool glamor_init(ScreenPtr screen, unsigned int flags) { glamor_screen_private *glamor_priv; int gl_version; int max_viewport_size[2]; #ifdef RENDER PictureScreenPtr ps = GetPictureScreenIfSet(screen); #endif if (flags & ~GLAMOR_VALID_FLAGS) { ErrorF("glamor_init: Invalid flags %x\n", flags); return FALSE; } glamor_priv = calloc(1, sizeof(*glamor_priv)); if (glamor_priv == NULL) return FALSE; glamor_priv->flags = flags; if (!dixRegisterPrivateKey(&glamor_screen_private_key, PRIVATE_SCREEN, 0)) { LogMessage(X_WARNING, "glamor%d: Failed to allocate screen private\n", screen->myNum); goto fail; } glamor_set_screen_private(screen, glamor_priv); if (!dixRegisterPrivateKey(&glamor_pixmap_private_key, PRIVATE_PIXMAP, 0)) { LogMessage(X_WARNING, "glamor%d: Failed to allocate pixmap private\n", screen->myNum); goto fail; } if (!dixRegisterPrivateKey(&glamor_gc_private_key, PRIVATE_GC, sizeof (glamor_gc_private))) { LogMessage(X_WARNING, "glamor%d: Failed to allocate gc private\n", screen->myNum); goto fail; } if (epoxy_is_desktop_gl()) glamor_priv->gl_flavor = GLAMOR_GL_DESKTOP; else glamor_priv->gl_flavor = GLAMOR_GL_ES2; gl_version = epoxy_gl_version(); /* Would be nice to have a cleaner test for GLSL 1.30 support, * but for now this should suffice */ if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && gl_version >= 30) glamor_priv->glsl_version = 130; else glamor_priv->glsl_version = 120; /* We'd like to require GL_ARB_map_buffer_range or * GL_OES_map_buffer_range, since it offers more information to * the driver than plain old glMapBuffer() or glBufferSubData(). * It's been supported on Mesa on the desktop since 2009 and on * GLES2 since October 2012. It's supported on Apple's iOS * drivers for SGX535 and A7, but apparently not on most Android * devices (the OES extension spec wasn't released until June * 2012). * * 82% of 0 A.D. players (desktop GL) submitting hardware reports * have support for it, with most of the ones lacking it being on * Windows with Intel 4-series (G45) graphics or older. */ if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { if (gl_version < 21) { ErrorF("Require OpenGL version 2.1 or later.\n"); goto fail; } } else { if (gl_version < 20) { ErrorF("Require Open GLES2.0 or later.\n"); goto fail; } if (!epoxy_has_gl_extension("GL_EXT_texture_format_BGRA8888")) { ErrorF("GL_EXT_texture_format_BGRA8888 required\n"); goto fail; } } glamor_priv->has_rw_pbo = FALSE; if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) glamor_priv->has_rw_pbo = TRUE; glamor_priv->has_khr_debug = epoxy_has_gl_extension("GL_KHR_debug"); glamor_priv->has_pack_invert = epoxy_has_gl_extension("GL_MESA_pack_invert"); glamor_priv->has_fbo_blit = epoxy_has_gl_extension("GL_EXT_framebuffer_blit"); glamor_priv->has_map_buffer_range = epoxy_has_gl_extension("GL_ARB_map_buffer_range"); glamor_priv->has_buffer_storage = epoxy_has_gl_extension("GL_ARB_buffer_storage"); glamor_priv->has_nv_texture_barrier = epoxy_has_gl_extension("GL_NV_texture_barrier"); glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glamor_priv->max_fbo_size); glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glamor_priv->max_fbo_size); glGetIntegerv(GL_MAX_VIEWPORT_DIMS, max_viewport_size); glamor_priv->max_fbo_size = MIN(glamor_priv->max_fbo_size, max_viewport_size[0]); glamor_priv->max_fbo_size = MIN(glamor_priv->max_fbo_size, max_viewport_size[1]); #ifdef MAX_FBO_SIZE glamor_priv->max_fbo_size = MAX_FBO_SIZE; #endif glamor_set_debug_level(&glamor_debug_level); glamor_priv->saved_procs.close_screen = screen->CloseScreen; screen->CloseScreen = glamor_close_screen; /* If we are using egl screen, call egl screen init to * register correct close screen function. */ if (flags & GLAMOR_USE_EGL_SCREEN) { glamor_egl_screen_init(screen, &glamor_priv->ctx); } else { if (!glamor_glx_screen_init(&glamor_priv->ctx)) goto fail; } glamor_priv->saved_procs.create_screen_resources = screen->CreateScreenResources; screen->CreateScreenResources = glamor_create_screen_resources; if (!glamor_font_init(screen)) goto fail; if (flags & GLAMOR_USE_SCREEN) { glamor_priv->saved_procs.block_handler = screen->BlockHandler; screen->BlockHandler = _glamor_block_handler; glamor_priv->saved_procs.create_gc = screen->CreateGC; screen->CreateGC = glamor_create_gc; glamor_priv->saved_procs.create_pixmap = screen->CreatePixmap; screen->CreatePixmap = glamor_create_pixmap; glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap; screen->DestroyPixmap = glamor_destroy_pixmap; glamor_priv->saved_procs.get_spans = screen->GetSpans; screen->GetSpans = glamor_get_spans; glamor_priv->saved_procs.get_image = screen->GetImage; screen->GetImage = glamor_get_image; glamor_priv->saved_procs.change_window_attributes = screen->ChangeWindowAttributes; screen->ChangeWindowAttributes = glamor_change_window_attributes; glamor_priv->saved_procs.copy_window = screen->CopyWindow; screen->CopyWindow = glamor_copy_window; glamor_priv->saved_procs.bitmap_to_region = screen->BitmapToRegion; screen->BitmapToRegion = glamor_bitmap_to_region; } #ifdef RENDER if (flags & GLAMOR_USE_PICTURE_SCREEN) { glamor_priv->saved_procs.composite = ps->Composite; ps->Composite = glamor_composite; glamor_priv->saved_procs.trapezoids = ps->Trapezoids; ps->Trapezoids = glamor_trapezoids; glamor_priv->saved_procs.triangles = ps->Triangles; ps->Triangles = glamor_triangles; glamor_priv->saved_procs.addtraps = ps->AddTraps; ps->AddTraps = glamor_add_traps; } glamor_priv->saved_procs.composite_rects = ps->CompositeRects; ps->CompositeRects = glamor_composite_rectangles; glamor_priv->saved_procs.glyphs = ps->Glyphs; ps->Glyphs = glamor_glyphs; glamor_priv->saved_procs.unrealize_glyph = ps->UnrealizeGlyph; ps->UnrealizeGlyph = glamor_glyph_unrealize; glamor_priv->saved_procs.create_picture = ps->CreatePicture; ps->CreatePicture = glamor_create_picture; glamor_priv->saved_procs.destroy_picture = ps->DestroyPicture; ps->DestroyPicture = glamor_destroy_picture; glamor_init_composite_shaders(screen); #endif glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap; screen->SetWindowPixmap = glamor_set_window_pixmap; glamor_init_vbo(screen); glamor_init_pixmap_fbo(screen); glamor_init_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_init_gradient_shader(screen); #endif glamor_pixmap_init(screen); glamor_sync_init(screen); glamor_priv->screen = screen; return TRUE; fail: free(glamor_priv); glamor_set_screen_private(screen, NULL); return FALSE; } static void glamor_release_screen_priv(ScreenPtr screen) { glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); #ifdef RENDER glamor_fini_composite_shaders(screen); #endif glamor_fini_vbo(screen); glamor_fini_pixmap_fbo(screen); glamor_fini_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_fini_gradient_shader(screen); #endif glamor_pixmap_fini(screen); free(glamor_priv); glamor_set_screen_private(screen, NULL); } _X_EXPORT void glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv) { glamor_pixmap_private *old_priv; old_priv = dixGetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key); if (priv) { assert(old_priv == NULL); } else { if (old_priv == NULL) return; glamor_pixmap_destroy_fbo(old_priv); free(old_priv); } dixSetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key, priv); } Bool glamor_close_screen(ScreenPtr screen) { glamor_screen_private *glamor_priv; PixmapPtr screen_pixmap; int flags; #ifdef RENDER PictureScreenPtr ps = GetPictureScreenIfSet(screen); #endif glamor_priv = glamor_get_screen_private(screen); flags = glamor_priv->flags; glamor_sync_close(screen); glamor_glyphs_fini(screen); screen->CloseScreen = glamor_priv->saved_procs.close_screen; screen->CreateScreenResources = glamor_priv->saved_procs.create_screen_resources; if (flags & GLAMOR_USE_SCREEN) { screen->CreateGC = glamor_priv->saved_procs.create_gc; screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap; screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap; screen->GetSpans = glamor_priv->saved_procs.get_spans; screen->ChangeWindowAttributes = glamor_priv->saved_procs.change_window_attributes; screen->CopyWindow = glamor_priv->saved_procs.copy_window; screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region; screen->BlockHandler = glamor_priv->saved_procs.block_handler; } #ifdef RENDER if (ps && (flags & GLAMOR_USE_PICTURE_SCREEN)) { ps->Composite = glamor_priv->saved_procs.composite; ps->Trapezoids = glamor_priv->saved_procs.trapezoids; ps->Triangles = glamor_priv->saved_procs.triangles; ps->CreatePicture = glamor_priv->saved_procs.create_picture; } ps->CompositeRects = glamor_priv->saved_procs.composite_rects; ps->Glyphs = glamor_priv->saved_procs.glyphs; ps->UnrealizeGlyph = glamor_priv->saved_procs.unrealize_glyph; screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap; #endif screen_pixmap = screen->GetScreenPixmap(screen); glamor_set_pixmap_private(screen_pixmap, NULL); glamor_release_screen_priv(screen); return screen->CloseScreen(screen); } void glamor_fini(ScreenPtr screen) { /* Do nothing currently. */ } void glamor_enable_dri3(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_priv->dri3_enabled = TRUE; } Bool glamor_supports_pixmap_import_export(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); return glamor_priv->dri3_enabled; } _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv == NULL || !glamor_priv->dri3_enabled) return -1; switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: case GLAMOR_TEXTURE_ONLY: if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0)) return -1; return glamor_egl_dri3_fd_name_from_tex(screen, pixmap, pixmap_priv->base.fbo->tex, FALSE, stride, size); default: break; } return -1; } int glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); pixmap_priv = glamor_get_pixmap_private(pixmap); if (pixmap_priv == NULL || !glamor_priv->dri3_enabled) return -1; switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: case GLAMOR_TEXTURE_ONLY: if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0)) return -1; return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen, pixmap, pixmap_priv->base.fbo->tex, TRUE, stride, size); default: break; } return -1; } xorg-server-1.17.1/glamor/glamor_debug.h0000664000175100017510000000755112424353351015104 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #ifndef __GLAMOR_DEBUG_H__ #define __GLAMOR_DEBUG_H__ #define GLAMOR_DELAYED_STRING_MAX 64 #define GLAMOR_DEBUG_NONE 0 #define GLAMOR_DEBUG_UNIMPL 0 #define GLAMOR_DEBUG_FALLBACK 1 #define GLAMOR_DEBUG_TEXTURE_DOWNLOAD 2 #define GLAMOR_DEBUG_TEXTURE_DYNAMIC_UPLOAD 3 extern void AbortServer(void) _X_NORETURN; #define GLAMOR_PANIC(_format_, ...) \ do { \ LogMessageVerb(X_NONE, 0, "Glamor Fatal Error" \ " at %32s line %d: " _format_ "\n", \ __FUNCTION__, __LINE__, \ ##__VA_ARGS__ ); \ exit(1); \ } while(0) #define __debug_output_message(_format_, _prefix_, ...) \ LogMessageVerb(X_NONE, 0, \ "%32s:\t" _format_ , \ /*_prefix_,*/ \ __FUNCTION__, \ ##__VA_ARGS__) #define glamor_debug_output(_level_, _format_,...) \ do { \ if (glamor_debug_level >= _level_) \ __debug_output_message(_format_, \ "Glamor debug", \ ##__VA_ARGS__); \ } while(0) #define glamor_fallback(_format_,...) \ do { \ if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) \ __debug_output_message(_format_, \ "Glamor fallback", \ ##__VA_ARGS__);} while(0) #define glamor_delayed_fallback(_screen_, _format_,...) \ do { \ if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ glamor_screen_private *_glamor_priv_; \ _glamor_priv_ = glamor_get_screen_private(_screen_); \ _glamor_priv_->delayed_fallback_pending = 1; \ snprintf(_glamor_priv_->delayed_fallback_string, \ GLAMOR_DELAYED_STRING_MAX, \ "glamor delayed fallback: \t%s " _format_ , \ __FUNCTION__, ##__VA_ARGS__); } } while(0) #define glamor_clear_delayed_fallbacks(_screen_) \ do { \ if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ glamor_screen_private *_glamor_priv_; \ _glamor_priv_ = glamor_get_screen_private(_screen_); \ _glamor_priv_->delayed_fallback_pending = 0; } } while(0) #define glamor_report_delayed_fallbacks(_screen_) \ do { \ if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ glamor_screen_private *_glamor_priv_; \ _glamor_priv_ = glamor_get_screen_private(_screen_); \ LogMessageVerb(X_INFO, 0, "%s", \ _glamor_priv_->delayed_fallback_string); \ _glamor_priv_->delayed_fallback_pending = 0; } } while(0) #define DEBUGF(str, ...) do {} while(0) //#define DEBUGF(str, ...) ErrorF(str, ##__VA_ARGS__) #define DEBUGRegionPrint(x) do {} while (0) //#define DEBUGRegionPrint RegionPrint #endif xorg-server-1.17.1/glamor/glamor_program.c0000664000175100017510000003131712456256034015462 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_transform.h" #include "glamor_program.h" static Bool use_solid(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) { return glamor_set_solid(pixmap, gc, TRUE, prog->fg_uniform); } const glamor_facet glamor_fill_solid = { .name = "solid", .fs_exec = " gl_FragColor = fg;\n", .locations = glamor_program_location_fg, .use = use_solid, }; static Bool use_tile(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) { return glamor_set_tiled(pixmap, gc, prog->fill_offset_uniform, prog->fill_size_uniform); } static const glamor_facet glamor_fill_tile = { .name = "tile", .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\n", .fs_exec = " gl_FragColor = texture2D(sampler, fill_pos);\n", .locations = glamor_program_location_fill, .use = use_tile, }; static Bool use_stipple(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) { return glamor_set_stippled(pixmap, gc, prog->fg_uniform, prog->fill_offset_uniform, prog->fill_size_uniform); } static const glamor_facet glamor_fill_stipple = { .name = "stipple", .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\n", .fs_exec = (" float a = texture2D(sampler, fill_pos).w;\n" " if (a == 0.0)\n" " discard;\n" " gl_FragColor = fg;\n"), .locations = glamor_program_location_fg | glamor_program_location_fill, .use = use_stipple, }; static Bool use_opaque_stipple(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) { if (!use_stipple(pixmap, gc, prog, arg)) return FALSE; glamor_set_color(pixmap, gc->bgPixel, prog->bg_uniform); return TRUE; } static const glamor_facet glamor_fill_opaque_stipple = { .name = "opaque_stipple", .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\n", .fs_exec = (" float a = texture2D(sampler, fill_pos).w;\n" " if (a == 0.0)\n" " gl_FragColor = bg;\n" " else\n" " gl_FragColor = fg;\n"), .locations = glamor_program_location_fg | glamor_program_location_bg | glamor_program_location_fill, .use = use_opaque_stipple }; static const glamor_facet *glamor_facet_fill[4] = { &glamor_fill_solid, &glamor_fill_tile, &glamor_fill_stipple, &glamor_fill_opaque_stipple, }; typedef struct { glamor_program_location location; const char *vs_vars; const char *fs_vars; } glamor_location_var; static glamor_location_var location_vars[] = { { .location = glamor_program_location_fg, .fs_vars = "uniform vec4 fg;\n" }, { .location = glamor_program_location_bg, .fs_vars = "uniform vec4 bg;\n" }, { .location = glamor_program_location_fill, .vs_vars = ("uniform vec2 fill_offset;\n" "uniform vec2 fill_size;\n" "varying vec2 fill_pos;\n"), .fs_vars = ("uniform sampler2D sampler;\n" "uniform vec2 fill_size;\n" "varying vec2 fill_pos;\n") }, { .location = glamor_program_location_font, .fs_vars = "uniform usampler2D font;\n", }, { .location = glamor_program_location_bitplane, .fs_vars = ("uniform uvec4 bitplane;\n" "uniform vec4 bitmul;\n"), }, { .location = glamor_program_location_dash, .vs_vars = "uniform float dash_length;\n", .fs_vars = "uniform sampler2D dash;\n", }, }; #define NUM_LOCATION_VARS (sizeof location_vars / sizeof location_vars[0]) static char * add_var(char *cur, const char *add) { char *new; if (!add) return cur; new = realloc(cur, strlen(cur) + strlen(add) + 1); if (!new) { free(cur); return NULL; } strcat(new, add); return new; } static char * vs_location_vars(glamor_program_location locations) { int l; char *vars = strdup(""); for (l = 0; vars && l < NUM_LOCATION_VARS; l++) if (locations & location_vars[l].location) vars = add_var(vars, location_vars[l].vs_vars); return vars; } static char * fs_location_vars(glamor_program_location locations) { int l; char *vars = strdup(""); for (l = 0; vars && l < NUM_LOCATION_VARS; l++) if (locations & location_vars[l].location) vars = add_var(vars, location_vars[l].fs_vars); return vars; } static const char vs_template[] = "%s" /* version */ "%s" /* prim vs_vars */ "%s" /* fill vs_vars */ "%s" /* location vs_vars */ GLAMOR_DECLARE_MATRIX "void main() {\n" "%s" /* prim vs_exec, outputs 'pos' and gl_Position */ "%s" /* fill vs_exec */ "}\n"; static const char fs_template[] = "%s" /* version */ GLAMOR_DEFAULT_PRECISION "%s" /* prim fs_vars */ "%s" /* fill fs_vars */ "%s" /* location fs_vars */ "void main() {\n" "%s" /* prim fs_exec */ "%s" /* fill fs_exec */ "}\n"; static const char * str(const char *s) { if (!s) return ""; return s; } static const glamor_facet facet_null_fill = { .name = "" }; #define DBG 0 static GLint glamor_get_uniform(glamor_program *prog, glamor_program_location location, const char *name) { GLint uniform; if (location && (prog->locations & location) == 0) return -2; uniform = glGetUniformLocation(prog->prog, name); #if DBG ErrorF("%s uniform %d\n", name, uniform); #endif return uniform; } Bool glamor_build_program(ScreenPtr screen, glamor_program *prog, const glamor_facet *prim, const glamor_facet *fill) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_program_location locations = prim->locations; glamor_program_flag flags = prim->flags; int version = prim->version; char *version_string = NULL; char *fs_vars = NULL; char *vs_vars = NULL; char *vs_prog_string; char *fs_prog_string; GLint fs_prog, vs_prog; if (!fill) fill = &facet_null_fill; locations |= fill->locations; flags |= fill->flags; version = MAX(version, fill->version); if (version > glamor_priv->glsl_version) goto fail; vs_vars = vs_location_vars(locations); fs_vars = fs_location_vars(locations); if (!vs_vars) goto fail; if (!fs_vars) goto fail; if (version) { if (asprintf(&version_string, "#version %d\n", version) < 0) version_string = NULL; if (!version_string) goto fail; } if (asprintf(&vs_prog_string, vs_template, str(version_string), str(prim->vs_vars), str(fill->vs_vars), vs_vars, str(prim->vs_exec), str(fill->vs_exec)) < 0) vs_prog_string = NULL; if (asprintf(&fs_prog_string, fs_template, str(version_string), str(prim->fs_vars), str(fill->fs_vars), fs_vars, str(prim->fs_exec), str(fill->fs_exec)) < 0) fs_prog_string = NULL; if (!vs_prog_string || !fs_prog_string) goto fail; #if DBG ErrorF("\nPrograms for %s %s\nVertex shader:\n\n%s\n\nFragment Shader:\n\n%s", prim->name, fill->name, vs_prog_string, fs_prog_string); #endif prog->prog = glCreateProgram(); prog->flags = flags; prog->locations = locations; prog->prim_use = prim->use; prog->fill_use = fill->use; vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_prog_string); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, fs_prog_string); free(vs_prog_string); free(fs_prog_string); glAttachShader(prog->prog, vs_prog); glDeleteShader(vs_prog); glAttachShader(prog->prog, fs_prog); glDeleteShader(fs_prog); glBindAttribLocation(prog->prog, GLAMOR_VERTEX_POS, "primitive"); if (prim->source_name) { #if DBG ErrorF("Bind GLAMOR_VERTEX_SOURCE to %s\n", prim->source_name); #endif glBindAttribLocation(prog->prog, GLAMOR_VERTEX_SOURCE, prim->source_name); } glamor_link_glsl_prog(screen, prog->prog, "%s_%s", prim->name, fill->name); prog->matrix_uniform = glamor_get_uniform(prog, glamor_program_location_none, "v_matrix"); prog->fg_uniform = glamor_get_uniform(prog, glamor_program_location_fg, "fg"); prog->bg_uniform = glamor_get_uniform(prog, glamor_program_location_bg, "bg"); prog->fill_offset_uniform = glamor_get_uniform(prog, glamor_program_location_fill, "fill_offset"); prog->fill_size_uniform = glamor_get_uniform(prog, glamor_program_location_fill, "fill_size"); prog->font_uniform = glamor_get_uniform(prog, glamor_program_location_font, "font"); prog->bitplane_uniform = glamor_get_uniform(prog, glamor_program_location_bitplane, "bitplane"); prog->bitmul_uniform = glamor_get_uniform(prog, glamor_program_location_bitplane, "bitmul"); prog->dash_uniform = glamor_get_uniform(prog, glamor_program_location_dash, "dash"); prog->dash_length_uniform = glamor_get_uniform(prog, glamor_program_location_dash, "dash_length"); if (glGetError() != GL_NO_ERROR) goto fail; free(version_string); free(fs_vars); free(vs_vars); return TRUE; fail: prog->failed = 1; if (prog->prog) { glDeleteProgram(prog->prog); prog->prog = 0; } free(version_string); free(fs_vars); free(vs_vars); return FALSE; } Bool glamor_use_program(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) { glUseProgram(prog->prog); if (prog->prim_use && !prog->prim_use(pixmap, gc, prog, arg)) return FALSE; if (prog->fill_use && !prog->fill_use(pixmap, gc, prog, arg)) return FALSE; return TRUE; } glamor_program * glamor_use_program_fill(PixmapPtr pixmap, GCPtr gc, glamor_program_fill *program_fill, const glamor_facet *prim) { ScreenPtr screen = pixmap->drawable.pScreen; glamor_program *prog = &program_fill->progs[gc->fillStyle]; int fill_style = gc->fillStyle; const glamor_facet *fill; if (prog->failed) return FALSE; if (!prog->prog) { fill = glamor_facet_fill[fill_style]; if (!fill) return NULL; if (!glamor_build_program(screen, prog, prim, fill)) return NULL; } if (!glamor_use_program(pixmap, gc, prog, NULL)) return NULL; return prog; } xorg-server-1.17.1/glamor/glamor_font.c0000664000175100017510000001464512424353351014761 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_font.h" #include static int glamor_font_generation; static int glamor_font_private_index; static int glamor_font_screen_count; glamor_font_t * glamor_font_get(ScreenPtr screen, FontPtr font) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_font_t *privates; glamor_font_t *glamor_font; int overall_width, overall_height; int num_rows; int num_cols; int glyph_width_pixels; int glyph_width_bytes; int glyph_height; int row, col; unsigned char c[2]; CharInfoPtr glyph; unsigned long count; if (glamor_priv->glsl_version < 130) return NULL; privates = FontGetPrivate(font, glamor_font_private_index); if (!privates) { privates = calloc(glamor_font_screen_count, sizeof (glamor_font_t)); if (!privates) return NULL; FontSetPrivate(font, glamor_font_private_index, privates); } glamor_font = &privates[screen->myNum]; if (glamor_font->realized) return glamor_font; glamor_font->realized = TRUE; /* Figure out how many glyphs are in the font */ num_cols = font->info.lastCol - font->info.firstCol + 1; num_rows = font->info.lastRow - font->info.firstRow + 1; /* Figure out the size of each glyph */ glyph_width_pixels = font->info.maxbounds.rightSideBearing - font->info.minbounds.leftSideBearing; glyph_height = font->info.maxbounds.ascent + font->info.maxbounds.descent; glyph_width_bytes = (glyph_width_pixels + 7) >> 3; glamor_font->glyph_width_pixels = glyph_width_pixels; glamor_font->glyph_width_bytes = glyph_width_bytes; glamor_font->glyph_height = glyph_height; overall_width = glyph_width_bytes * num_cols; overall_height = glyph_height * num_rows; /* Check whether the font has a default character */ c[0] = font->info.lastRow + 1; c[1] = font->info.lastCol + 1; (*font->get_glyphs)(font, 1, c, TwoD16Bit, &count, &glyph); glamor_font->default_char = count ? glyph : NULL; glamor_font->default_row = font->info.defaultCh >> 8; glamor_font->default_col = font->info.defaultCh; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glGenTextures(1, &glamor_font->texture_id); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, glamor_font->texture_id); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); /* Allocate storage */ glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, NULL); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); /* Paint all of the glyphs */ for (row = 0; row < num_rows; row++) { for (col = 0; col < num_cols; col++) { c[0] = row + font->info.firstRow; c[1] = col + font->info.firstCol; (*font->get_glyphs)(font, 1, c, TwoD16Bit, &count, &glyph); if (count) glTexSubImage2D(GL_TEXTURE_2D, 0, col * glyph_width_bytes, row * glyph_height, GLYPHWIDTHBYTES(glyph), GLYPHHEIGHTPIXELS(glyph), GL_RED_INTEGER, GL_UNSIGNED_BYTE, glyph->bits); } } return glamor_font; } static Bool glamor_realize_font(ScreenPtr screen, FontPtr font) { return TRUE; } static Bool glamor_unrealize_font(ScreenPtr screen, FontPtr font) { glamor_screen_private *glamor_priv; glamor_font_t *privates = FontGetPrivate(font, glamor_font_private_index); glamor_font_t *glamor_font; int s; if (!privates) return TRUE; glamor_font = &privates[screen->myNum]; if (!glamor_font->realized) return TRUE; /* Unrealize the font, freeing the allocated texture */ glamor_font->realized = FALSE; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glDeleteTextures(1, &glamor_font->texture_id); /* Check to see if all of the screens are done with this font * and free the private when that happens */ for (s = 0; s < glamor_font_screen_count; s++) if (privates[s].realized) return TRUE; free(privates); FontSetPrivate(font, glamor_font_private_index, NULL); return TRUE; } Bool glamor_font_init(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); if (glamor_priv->glsl_version < 130) return TRUE; if (glamor_font_generation != serverGeneration) { glamor_font_private_index = AllocateFontPrivateIndex(); if (glamor_font_private_index == -1) return FALSE; glamor_font_screen_count = 0; glamor_font_generation = serverGeneration; } if (screen->myNum >= glamor_font_screen_count) glamor_font_screen_count = screen->myNum + 1; screen->RealizeFont = glamor_realize_font; screen->UnrealizeFont = glamor_unrealize_font; return TRUE; } xorg-server-1.17.1/glamor/glamor_transfer.h0000664000175100017510000000416312424353351015636 00000000000000/* * Copyright © 2014 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. */ #ifndef _GLAMOR_TRANSFER_H_ #define _GLAMOR_TRANSFER_H_ void glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type); void glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, int dx_src, int dy_src, int dx_dst, int dy_dst, uint8_t *bits, uint32_t byte_stride); void glamor_upload_region(PixmapPtr pixmap, RegionPtr region, int region_x, int region_y, uint8_t *bits, uint32_t byte_stride); void glamor_upload_pixmap(PixmapPtr pixmap); void glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, int dx_src, int dy_src, int dx_dst, int dy_dst, uint8_t *bits, uint32_t byte_stride); void glamor_download_rect(PixmapPtr pixmap, int x, int y, int w, int h, uint8_t *bits); void glamor_download_pixmap(PixmapPtr pixmap); #endif /* _GLAMOR_TRANSFER_H_ */ xorg-server-1.17.1/glamor/glamor_pixmap.c0000664000175100017510000011410012460362577015306 00000000000000/* * Copyright © 2001 Keith Packard * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Zhigang Gong * */ #include #include "glamor_priv.h" /** * Sets the offsets to add to coordinates to make them address the same bits in * the backing drawable. These coordinates are nonzero only for redirected * windows. */ void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int *x, int *y) { #ifdef COMPOSITE if (drawable->type == DRAWABLE_WINDOW) { *x = -pixmap->screen_x; *y = -pixmap->screen_y; return; } #endif *x = 0; *y = 0; } void glamor_pixmap_init(ScreenPtr screen) { } void glamor_pixmap_fini(ScreenPtr screen) { } void glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo *fbo, int x0, int y0, int width, int height) { glamor_make_current(fbo->glamor_priv); glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb); glViewport(x0, y0, width, height); } void glamor_set_destination_pixmap_priv_nc(glamor_pixmap_private *pixmap_priv) { int w, h; PIXMAP_PRIV_GET_ACTUAL_SIZE(pixmap_priv, w, h); glamor_set_destination_pixmap_fbo(pixmap_priv->base.fbo, 0, 0, w, h); } int glamor_set_destination_pixmap_priv(glamor_pixmap_private *pixmap_priv) { if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) return -1; glamor_set_destination_pixmap_priv_nc(pixmap_priv); return 0; } int glamor_set_destination_pixmap(PixmapPtr pixmap) { int err; glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); err = glamor_set_destination_pixmap_priv(pixmap_priv); return err; } Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask) { if (glamor_pm_is_solid(&pixmap->drawable, planemask)) { return GL_TRUE; } glamor_fallback("unsupported planemask %lx\n", planemask); return GL_FALSE; } Bool glamor_set_alu(ScreenPtr screen, unsigned char alu) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); if (glamor_priv->gl_flavor == GLAMOR_GL_ES2) { if (alu != GXcopy) return FALSE; else return TRUE; } if (alu == GXcopy) { glDisable(GL_COLOR_LOGIC_OP); return TRUE; } glEnable(GL_COLOR_LOGIC_OP); switch (alu) { case GXclear: glLogicOp(GL_CLEAR); break; case GXand: glLogicOp(GL_AND); break; case GXandReverse: glLogicOp(GL_AND_REVERSE); break; case GXandInverted: glLogicOp(GL_AND_INVERTED); break; case GXnoop: glLogicOp(GL_NOOP); break; case GXxor: glLogicOp(GL_XOR); break; case GXor: glLogicOp(GL_OR); break; case GXnor: glLogicOp(GL_NOR); break; case GXequiv: glLogicOp(GL_EQUIV); break; case GXinvert: glLogicOp(GL_INVERT); break; case GXorReverse: glLogicOp(GL_OR_REVERSE); break; case GXcopyInverted: glLogicOp(GL_COPY_INVERTED); break; case GXorInverted: glLogicOp(GL_OR_INVERTED); break; case GXnand: glLogicOp(GL_NAND); break; case GXset: glLogicOp(GL_SET); break; default: glamor_fallback("unsupported alu %x\n", alu); return FALSE; } return TRUE; } /* * Map picture's format to the correct gl texture format and type. * no_alpha is used to indicate whehter we need to wire alpha to 1. * * Although opengl support A1/GL_BITMAP, we still don't use it * here, it seems that mesa has bugs when uploading a A1 bitmap. * * Return 0 if find a matched texture type. Otherwise return -1. **/ static int glamor_get_tex_format_type_from_pictformat_gl(PictFormatShort format, GLenum *tex_format, GLenum *tex_type, int *no_alpha, int *revert, int *swap_rb, int is_upload) { *no_alpha = 0; *revert = REVERT_NONE; *swap_rb = is_upload ? SWAP_NONE_UPLOADING : SWAP_NONE_DOWNLOADING; switch (format) { case PICT_a1: *tex_format = GL_ALPHA; *tex_type = GL_UNSIGNED_BYTE; *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1; break; case PICT_b8g8r8x8: *no_alpha = 1; case PICT_b8g8r8a8: *tex_format = GL_BGRA; *tex_type = GL_UNSIGNED_INT_8_8_8_8; break; case PICT_x8r8g8b8: *no_alpha = 1; case PICT_a8r8g8b8: *tex_format = GL_BGRA; *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; break; case PICT_x8b8g8r8: *no_alpha = 1; case PICT_a8b8g8r8: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; break; case PICT_x2r10g10b10: *no_alpha = 1; case PICT_a2r10g10b10: *tex_format = GL_BGRA; *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; break; case PICT_x2b10g10r10: *no_alpha = 1; case PICT_a2b10g10r10: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; break; case PICT_r5g6b5: *tex_format = GL_RGB; *tex_type = GL_UNSIGNED_SHORT_5_6_5; break; case PICT_b5g6r5: *tex_format = GL_RGB; *tex_type = GL_UNSIGNED_SHORT_5_6_5_REV; break; case PICT_x1b5g5r5: *no_alpha = 1; case PICT_a1b5g5r5: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; break; case PICT_x1r5g5b5: *no_alpha = 1; case PICT_a1r5g5b5: *tex_format = GL_BGRA; *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; break; case PICT_a8: *tex_format = GL_ALPHA; *tex_type = GL_UNSIGNED_BYTE; break; case PICT_x4r4g4b4: *no_alpha = 1; case PICT_a4r4g4b4: *tex_format = GL_BGRA; *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; break; case PICT_x4b4g4r4: *no_alpha = 1; case PICT_a4b4g4r4: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; break; default: return -1; } return 0; } #define IS_LITTLE_ENDIAN (IMAGE_BYTE_ORDER == LSBFirst) static int glamor_get_tex_format_type_from_pictformat_gles2(PictFormatShort format, GLenum *tex_format, GLenum *tex_type, int *no_alpha, int *revert, int *swap_rb, int is_upload) { int need_swap_rb = 0; *no_alpha = 0; *revert = IS_LITTLE_ENDIAN ? REVERT_NONE : REVERT_NORMAL; switch (format) { case PICT_b8g8r8x8: *no_alpha = 1; case PICT_b8g8r8a8: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_BYTE; need_swap_rb = 1; *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; break; case PICT_x8r8g8b8: *no_alpha = 1; case PICT_a8r8g8b8: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_BYTE; need_swap_rb = 1; break; case PICT_x8b8g8r8: *no_alpha = 1; case PICT_a8b8g8r8: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_BYTE; break; case PICT_x2r10g10b10: *no_alpha = 1; case PICT_a2r10g10b10: *tex_format = GL_RGBA; /* glReadPixmap doesn't support GL_UNSIGNED_INT_10_10_10_2. * we have to use GL_UNSIGNED_BYTE and do the conversion in * shader latter.*/ *tex_type = GL_UNSIGNED_BYTE; if (is_upload == 1) { if (!IS_LITTLE_ENDIAN) *revert = REVERT_UPLOADING_10_10_10_2; else *revert = REVERT_UPLOADING_2_10_10_10; } else { if (!IS_LITTLE_ENDIAN) { *revert = REVERT_DOWNLOADING_10_10_10_2; } else { *revert = REVERT_DOWNLOADING_2_10_10_10; } } need_swap_rb = 1; break; case PICT_x2b10g10r10: *no_alpha = 1; case PICT_a2b10g10r10: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_BYTE; if (is_upload == 1) { if (!IS_LITTLE_ENDIAN) *revert = REVERT_UPLOADING_10_10_10_2; else *revert = REVERT_UPLOADING_2_10_10_10; } else { if (!IS_LITTLE_ENDIAN) { *revert = REVERT_DOWNLOADING_10_10_10_2; } else { *revert = REVERT_DOWNLOADING_2_10_10_10; } } break; case PICT_r5g6b5: *tex_format = GL_RGB; *tex_type = GL_UNSIGNED_SHORT_5_6_5; *revert = IS_LITTLE_ENDIAN ? REVERT_NONE : REVERT_NORMAL; break; case PICT_b5g6r5: *tex_format = GL_RGB; *tex_type = GL_UNSIGNED_SHORT_5_6_5; need_swap_rb = IS_LITTLE_ENDIAN ? 1 : 0;; break; case PICT_x1b5g5r5: *no_alpha = 1; case PICT_a1b5g5r5: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_SHORT_5_5_5_1; if (IS_LITTLE_ENDIAN) { *revert = is_upload ? REVERT_UPLOADING_1_5_5_5 : REVERT_DOWNLOADING_1_5_5_5; } else *revert = REVERT_NONE; break; case PICT_x1r5g5b5: *no_alpha = 1; case PICT_a1r5g5b5: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_SHORT_5_5_5_1; if (IS_LITTLE_ENDIAN) { *revert = is_upload ? REVERT_UPLOADING_1_5_5_5 : REVERT_DOWNLOADING_1_5_5_5; } else *revert = REVERT_NONE; need_swap_rb = 1; break; case PICT_a1: *tex_format = GL_ALPHA; *tex_type = GL_UNSIGNED_BYTE; *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1; break; case PICT_a8: *tex_format = GL_ALPHA; *tex_type = GL_UNSIGNED_BYTE; *revert = REVERT_NONE; break; case PICT_x4r4g4b4: *no_alpha = 1; case PICT_a4r4g4b4: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; need_swap_rb = 1; break; case PICT_x4b4g4r4: *no_alpha = 1; case PICT_a4b4g4r4: *tex_format = GL_RGBA; *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; break; default: LogMessageVerb(X_INFO, 0, "fail to get matched format for %x \n", format); return -1; } if (need_swap_rb) *swap_rb = is_upload ? SWAP_UPLOADING : SWAP_DOWNLOADING; else *swap_rb = is_upload ? SWAP_NONE_UPLOADING : SWAP_NONE_DOWNLOADING; return 0; } static int glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type, int *no_alpha, int *revert, int *swap_rb, int is_upload) { glamor_pixmap_private *pixmap_priv; PictFormatShort pict_format; glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); pixmap_priv = glamor_get_pixmap_private(pixmap); if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv)) pict_format = pixmap_priv->base.picture->format; else pict_format = format_for_depth(pixmap->drawable.depth); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { return glamor_get_tex_format_type_from_pictformat_gl(pict_format, format, type, no_alpha, revert, swap_rb, is_upload); } else { return glamor_get_tex_format_type_from_pictformat_gles2(pict_format, format, type, no_alpha, revert, swap_rb, is_upload); } } static void * _glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int stride, int revert) { PictFormatShort dst_format, src_format; pixman_image_t *dst_image; pixman_image_t *src_image; int src_stride; if (revert == REVERT_UPLOADING_A1) { src_format = PICT_a1; dst_format = PICT_a8; src_stride = PixmapBytePad(w, 1); } else { dst_format = PICT_a1; src_format = PICT_a8; src_stride = (((w * 8 + 7) / 8) + 3) & ~3; } dst_image = pixman_image_create_bits(dst_format, w, h, dst_bits, stride); if (dst_image == NULL) { return NULL; } src_image = pixman_image_create_bits(src_format, w, h, src_bits, src_stride); if (src_image == NULL) { pixman_image_unref(dst_image); return NULL; } pixman_image_composite(PictOpSrc, src_image, NULL, dst_image, 0, 0, 0, 0, 0, 0, w, h); pixman_image_unref(src_image); pixman_image_unref(dst_image); return dst_bits; } #define ADJUST_BITS(d, src_bits, dst_bits) (((dst_bits) == (src_bits)) ? (d) : \ (((dst_bits) > (src_bits)) ? \ (((d) << ((dst_bits) - (src_bits))) \ + (( 1 << ((dst_bits) - (src_bits))) >> 1)) \ : ((d) >> ((src_bits) - (dst_bits))))) #define GLAMOR_DO_CONVERT(src, dst, no_alpha, swap, \ a_shift_src, a_bits_src, \ b_shift_src, b_bits_src, \ g_shift_src, g_bits_src, \ r_shift_src, r_bits_src, \ a_shift, a_bits, \ b_shift, b_bits, \ g_shift, g_bits, \ r_shift, r_bits) \ do { \ typeof(src) a,b,g,r; \ typeof(src) a_mask_src, b_mask_src, g_mask_src, r_mask_src;\ a_mask_src = (((1 << (a_bits_src)) - 1) << a_shift_src);\ b_mask_src = (((1 << (b_bits_src)) - 1) << b_shift_src);\ g_mask_src = (((1 << (g_bits_src)) - 1) << g_shift_src);\ r_mask_src = (((1 << (r_bits_src)) - 1) << r_shift_src);\ if (no_alpha) \ a = (a_mask_src) >> (a_shift_src); \ else \ a = ((src) & (a_mask_src)) >> (a_shift_src); \ b = ((src) & (b_mask_src)) >> (b_shift_src); \ g = ((src) & (g_mask_src)) >> (g_shift_src); \ r = ((src) & (r_mask_src)) >> (r_shift_src); \ a = ADJUST_BITS(a, a_bits_src, a_bits); \ b = ADJUST_BITS(b, b_bits_src, b_bits); \ g = ADJUST_BITS(g, g_bits_src, g_bits); \ r = ADJUST_BITS(r, r_bits_src, r_bits); \ if (swap == 0) \ (*dst) = ((a) << (a_shift)) | ((b) << (b_shift)) | ((g) << (g_shift)) | ((r) << (r_shift)); \ else \ (*dst) = ((a) << (a_shift)) | ((r) << (b_shift)) | ((g) << (g_shift)) | ((b) << (r_shift)); \ } while (0) static void * _glamor_color_revert_x2b10g10r10(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb) { int x, y; unsigned int *words, *saved_words, *source_words; int swap = !(swap_rb == SWAP_NONE_DOWNLOADING || swap_rb == SWAP_NONE_UPLOADING); source_words = src_bits; words = dst_bits; saved_words = words; for (y = 0; y < h; y++) { DEBUGF("Line %d : ", y); for (x = 0; x < w; x++) { unsigned int pixel = source_words[x]; if (revert == REVERT_DOWNLOADING_2_10_10_10) GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, 24, 8, 16, 8, 8, 8, 0, 8, 30, 2, 20, 10, 10, 10, 0, 10); else GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, 30, 2, 20, 10, 10, 10, 0, 10, 24, 8, 16, 8, 8, 8, 0, 8); DEBUGF("%x:%x ", pixel, words[x]); } DEBUGF("\n"); words += stride / sizeof(*words); source_words += stride / sizeof(*words); } DEBUGF("\n"); return saved_words; } static void * _glamor_color_revert_x1b5g5r5(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb) { int x, y; unsigned short *words, *saved_words, *source_words; int swap = !(swap_rb == SWAP_NONE_DOWNLOADING || swap_rb == SWAP_NONE_UPLOADING); words = dst_bits; source_words = src_bits; saved_words = words; for (y = 0; y < h; y++) { DEBUGF("Line %d : ", y); for (x = 0; x < w; x++) { unsigned short pixel = source_words[x]; if (revert == REVERT_DOWNLOADING_1_5_5_5) GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, 0, 1, 1, 5, 6, 5, 11, 5, 15, 1, 10, 5, 5, 5, 0, 5); else GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, 15, 1, 10, 5, 5, 5, 0, 5, 0, 1, 1, 5, 6, 5, 11, 5); DEBUGF("%04x:%04x ", pixel, words[x]); } DEBUGF("\n"); words += stride / sizeof(*words); source_words += stride / sizeof(*words); } DEBUGF("\n"); return saved_words; } /* * This function is to convert an unsupported color format to/from a * supported GL format. * Here are the current scenarios: * * @no_alpha: * If it is set, then we need to wire the alpha value to 1. * @revert: REVERT_DOWNLOADING_A1 : convert an Alpha8 buffer to a A1 buffer. REVERT_UPLOADING_A1 : convert an A1 buffer to an Alpha8 buffer REVERT_DOWNLOADING_2_10_10_10 : convert r10G10b10X2 to X2B10G10R10 REVERT_UPLOADING_2_10_10_10 : convert X2B10G10R10 to R10G10B10X2 REVERT_DOWNLOADING_1_5_5_5 : convert B5G5R5X1 to X1R5G5B5 REVERT_UPLOADING_1_5_5_5 : convert X1R5G5B5 to B5G5R5X1 @swap_rb: if we have the swap_rb set, then we need to swap the R and B's position. * */ static void * glamor_color_convert_to_bits(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb) { if (revert == REVERT_DOWNLOADING_A1 || revert == REVERT_UPLOADING_A1) { return _glamor_color_convert_a1_a8(src_bits, dst_bits, w, h, stride, revert); } else if (revert == REVERT_DOWNLOADING_2_10_10_10 || revert == REVERT_UPLOADING_2_10_10_10) { return _glamor_color_revert_x2b10g10r10(src_bits, dst_bits, w, h, stride, no_alpha, revert, swap_rb); } else if (revert == REVERT_DOWNLOADING_1_5_5_5 || revert == REVERT_UPLOADING_1_5_5_5) { return _glamor_color_revert_x1b5g5r5(src_bits, dst_bits, w, h, stride, no_alpha, revert, swap_rb); } else ErrorF("convert a non-supported mode %x.\n", revert); return NULL; } /** * Upload pixmap to a specified texture. * This texture may not be the one attached to it. **/ static void __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, GLenum format, GLenum type, int x, int y, int w, int h, void *bits, int pbo) { glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); int non_sub = 0; unsigned int iformat = 0; glamor_make_current(glamor_priv); if (*tex == 0) { glGenTextures(1, tex); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) iformat = gl_iformat_for_pixmap(pixmap); else iformat = format; non_sub = 1; assert(x == 0 && y == 0); } glBindTexture(GL_TEXTURE_2D, *tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); assert(pbo || bits != 0); if (bits == NULL) { glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); } if (non_sub) glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, format, type, bits); else glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, format, type, bits); if (bits == NULL) glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); } static Bool _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, GLenum type, int no_alpha, int revert, int swap_rb, int x, int y, int w, int h, int stride, void *bits, int pbo) { glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); glamor_screen_private *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); static float vertices[8]; static float texcoords_inv[8] = { 0, 0, 1, 0, 1, 1, 0, 1 }; float *ptexcoords; float dst_xscale, dst_yscale; GLuint tex = 0; int need_free_bits = 0; if (bits == NULL) goto ready_to_upload; if (revert > REVERT_NORMAL) { /* XXX if we are restoring the pixmap, then we may not need to allocate * new buffer */ void *converted_bits; if (pixmap->drawable.depth == 1) stride = (((w * 8 + 7) / 8) + 3) & ~3; converted_bits = malloc(h * stride); if (converted_bits == NULL) return FALSE; bits = glamor_color_convert_to_bits(bits, converted_bits, w, h, stride, no_alpha, revert, swap_rb); if (bits == NULL) { free(converted_bits); ErrorF("Failed to convert pixmap no_alpha %d," "revert mode %d, swap mode %d\n", no_alpha, revert, swap_rb); return FALSE; } no_alpha = 0; revert = REVERT_NONE; swap_rb = SWAP_NONE_UPLOADING; need_free_bits = TRUE; } ready_to_upload: /* Try fast path firstly, upload the pixmap to the texture attached * to the fbo directly. */ if (no_alpha == 0 && revert == REVERT_NONE && swap_rb == SWAP_NONE_UPLOADING #ifdef WALKAROUND_LARGE_TEXTURE_MAP && pixmap_priv->type != GLAMOR_TEXTURE_LARGE #endif ) { int fbo_x_off, fbo_y_off; assert(pixmap_priv->base.fbo->tex); pixmap_priv_get_fbo_off(pixmap_priv, &fbo_x_off, &fbo_y_off); assert(x + fbo_x_off >= 0 && y + fbo_y_off >= 0); assert(x + fbo_x_off + w <= pixmap_priv->base.fbo->width); assert(y + fbo_y_off + h <= pixmap_priv->base.fbo->height); __glamor_upload_pixmap_to_texture(pixmap, &pixmap_priv->base.fbo->tex, format, type, x + fbo_x_off, y + fbo_y_off, w, h, bits, pbo); } else { ptexcoords = texcoords_inv; pixmap_priv_get_dest_scale(pixmap_priv, &dst_xscale, &dst_yscale); glamor_set_normalize_vcoords(pixmap_priv, dst_xscale, dst_yscale, x, y, x + w, y + h, vertices); /* Slow path, we need to flip y or wire alpha to 1. */ glamor_make_current(glamor_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), vertices); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), ptexcoords); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glamor_set_destination_pixmap_priv_nc(pixmap_priv); __glamor_upload_pixmap_to_texture(pixmap, &tex, format, type, 0, 0, w, h, bits, pbo); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glUseProgram(glamor_priv->finish_access_prog[no_alpha]); glUniform1i(glamor_priv->finish_access_revert[no_alpha], revert); glUniform1i(glamor_priv->finish_access_swap_rb[no_alpha], swap_rb); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glDeleteTextures(1, &tex); glBindFramebuffer(GL_FRAMEBUFFER, 0); } if (need_free_bits) free(bits); return TRUE; } /* * Prepare to upload a pixmap to texture memory. * no_alpha equals 1 means the format needs to wire alpha to 1. */ static int glamor_pixmap_upload_prepare(PixmapPtr pixmap, GLenum format, int no_alpha, int revert, int swap_rb) { int flag = 0; glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv; glamor_pixmap_fbo *fbo; GLenum iformat; pixmap_priv = glamor_get_pixmap_private(pixmap); glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); if (pixmap_priv->base.gl_fbo != GLAMOR_FBO_UNATTACHED) return 0; if (pixmap_priv->base.fbo && (pixmap_priv->base.fbo->width < pixmap->drawable.width || pixmap_priv->base.fbo->height < pixmap->drawable.height)) { fbo = glamor_pixmap_detach_fbo(pixmap_priv); glamor_destroy_fbo(fbo); } if (pixmap_priv->base.fbo && pixmap_priv->base.fbo->fb) return 0; if (!(no_alpha || (revert == REVERT_NORMAL) || (swap_rb != SWAP_NONE_UPLOADING))) { /* We don't need a fbo, a simple texture uploading should work. */ flag = GLAMOR_CREATE_FBO_NO_FBO; } if ((flag == GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->base.fbo && pixmap_priv->base.fbo->tex) || (flag == 0 && pixmap_priv->base.fbo && pixmap_priv->base.fbo->fb)) return 0; if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) iformat = gl_iformat_for_pixmap(pixmap); else iformat = format; if (!glamor_pixmap_ensure_fbo(pixmap, iformat, flag)) return -1; return 0; } /* * upload sub region to a large region. * */ static void glamor_put_bits(char *dst_bits, int dst_stride, char *src_bits, int src_stride, int bpp, int x, int y, int w, int h) { int j; int byte_per_pixel; byte_per_pixel = bpp / 8; src_bits += y * src_stride + (x * byte_per_pixel); for (j = y; j < y + h; j++) { memcpy(dst_bits, src_bits, w * byte_per_pixel); src_bits += src_stride; dst_bits += dst_stride; } } Bool glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, int h, int stride, void *bits, int pbo) { GLenum format, type; int no_alpha, revert, swap_rb; glamor_pixmap_private *pixmap_priv; Bool force_clip; if (glamor_get_tex_format_type_from_pixmap(pixmap, &format, &type, &no_alpha, &revert, &swap_rb, 1)) { glamor_fallback("Unknown pixmap depth %d.\n", pixmap->drawable.depth); return FALSE; } if (glamor_pixmap_upload_prepare(pixmap, format, no_alpha, revert, swap_rb)) return FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); force_clip = pixmap_priv->base.glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP && !glamor_check_fbo_size(pixmap_priv->base.glamor_priv, w, h); if (pixmap_priv->type == GLAMOR_TEXTURE_LARGE || force_clip) { RegionRec region; BoxRec box; int n_region; glamor_pixmap_clipped_regions *clipped_regions; void *sub_bits; int i, j; sub_bits = malloc(h * stride); if (sub_bits == NULL) return FALSE; box.x1 = x; box.y1 = y; box.x2 = x + w; box.y2 = y + h; RegionInitBoxes(®ion, &box, 1); if (!force_clip) clipped_regions = glamor_compute_clipped_regions(pixmap_priv, ®ion, &n_region, 0, 0, 0); else clipped_regions = glamor_compute_clipped_regions_ext(pixmap_priv, ®ion, &n_region, pixmap_priv->large.block_w, pixmap_priv->large.block_h, 0, 0); DEBUGF("prepare upload %dx%d to a large pixmap %p\n", w, h, pixmap); for (i = 0; i < n_region; i++) { BoxPtr boxes; int nbox; int temp_stride; void *temp_bits; assert(pbo == 0); glamor_set_pixmap_fbo_current(pixmap_priv, clipped_regions[i].block_idx); boxes = RegionRects(clipped_regions[i].region); nbox = RegionNumRects(clipped_regions[i].region); DEBUGF("split to %d boxes\n", nbox); for (j = 0; j < nbox; j++) { temp_stride = PixmapBytePad(boxes[j].x2 - boxes[j].x1, pixmap->drawable.depth); if (boxes[j].x1 == x && temp_stride == stride) { temp_bits = (char *) bits + (boxes[j].y1 - y) * stride; } else { temp_bits = sub_bits; glamor_put_bits(temp_bits, temp_stride, bits, stride, pixmap->drawable.bitsPerPixel, boxes[j].x1 - x, boxes[j].y1 - y, boxes[j].x2 - boxes[j].x1, boxes[j].y2 - boxes[j].y1); } DEBUGF("upload x %d y %d w %d h %d temp stride %d \n", boxes[j].x1 - x, boxes[j].y1 - y, boxes[j].x2 - boxes[j].x1, boxes[j].y2 - boxes[j].y1, temp_stride); if (_glamor_upload_bits_to_pixmap_texture (pixmap, format, type, no_alpha, revert, swap_rb, boxes[j].x1, boxes[j].y1, boxes[j].x2 - boxes[j].x1, boxes[j].y2 - boxes[j].y1, temp_stride, temp_bits, pbo) == FALSE) { RegionUninit(®ion); free(sub_bits); assert(0); return FALSE; } } RegionDestroy(clipped_regions[i].region); } free(sub_bits); free(clipped_regions); RegionUninit(®ion); return TRUE; } else return _glamor_upload_bits_to_pixmap_texture(pixmap, format, type, no_alpha, revert, swap_rb, x, y, w, h, stride, bits, pbo); } enum glamor_pixmap_status glamor_upload_pixmap_to_texture(PixmapPtr pixmap) { glamor_pixmap_private *pixmap_priv; void *data; int pbo; int ret; pixmap_priv = glamor_get_pixmap_private(pixmap); if ((pixmap_priv->base.fbo) && (pixmap_priv->base.fbo->pbo_valid)) { data = NULL; pbo = pixmap_priv->base.fbo->pbo; } else { data = pixmap->devPrivate.ptr; pbo = 0; } if (glamor_upload_sub_pixmap_to_texture(pixmap, 0, 0, pixmap->drawable.width, pixmap->drawable.height, pixmap->devKind, data, pbo)) ret = GLAMOR_UPLOAD_DONE; else ret = GLAMOR_UPLOAD_FAILED; return ret; } /* * as gles2 only support a very small set of color format and * type when do glReadPixel, * Before we use glReadPixels to get back a textured pixmap, * Use shader to convert it to a supported format and thus * get a new temporary pixmap returned. * */ glamor_pixmap_fbo * glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, GLenum format, GLenum type, int no_alpha, int revert, int swap_rb) { glamor_pixmap_private *source_priv; glamor_screen_private *glamor_priv; ScreenPtr screen; glamor_pixmap_fbo *temp_fbo; float temp_xscale, temp_yscale, source_xscale, source_yscale; static float vertices[8]; static float texcoords[8]; screen = source->drawable.pScreen; glamor_priv = glamor_get_screen_private(screen); source_priv = glamor_get_pixmap_private(source); temp_fbo = glamor_create_fbo(glamor_priv, w, h, format, 0); if (temp_fbo == NULL) return NULL; glamor_make_current(glamor_priv); temp_xscale = 1.0 / w; temp_yscale = 1.0 / h; glamor_set_normalize_vcoords((struct glamor_pixmap_private *) NULL, temp_xscale, temp_yscale, 0, 0, w, h, vertices); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), vertices); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); pixmap_priv_get_scale(source_priv, &source_xscale, &source_yscale); glamor_set_normalize_tcoords(source_priv, source_xscale, source_yscale, x, y, x + w, y + h, texcoords); glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), texcoords); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, source_priv->base.fbo->tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glamor_set_destination_pixmap_fbo(temp_fbo, 0, 0, w, h); glUseProgram(glamor_priv->finish_access_prog[no_alpha]); glUniform1i(glamor_priv->finish_access_revert[no_alpha], revert); glUniform1i(glamor_priv->finish_access_swap_rb[no_alpha], swap_rb); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); return temp_fbo; } /* fixup a fbo to the exact size as the pixmap. */ /* XXX LARGE pixmap? */ Bool glamor_fixup_pixmap_priv(ScreenPtr screen, glamor_pixmap_private *pixmap_priv) { glamor_pixmap_fbo *old_fbo; glamor_pixmap_fbo *new_fbo = NULL; PixmapPtr scratch = NULL; glamor_pixmap_private *scratch_priv; DrawablePtr drawable; GCPtr gc = NULL; int ret = FALSE; drawable = &pixmap_priv->base.pixmap->drawable; if (!GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE(pixmap_priv)) return TRUE; old_fbo = pixmap_priv->base.fbo; if (!old_fbo) return FALSE; gc = GetScratchGC(drawable->depth, screen); if (!gc) goto fail; scratch = glamor_create_pixmap(screen, drawable->width, drawable->height, drawable->depth, GLAMOR_CREATE_PIXMAP_FIXUP); scratch_priv = glamor_get_pixmap_private(scratch); if (!scratch_priv->base.fbo) goto fail; ValidateGC(&scratch->drawable, gc); glamor_copy_area(drawable, &scratch->drawable, gc, 0, 0, drawable->width, drawable->height, 0, 0); old_fbo = glamor_pixmap_detach_fbo(pixmap_priv); new_fbo = glamor_pixmap_detach_fbo(scratch_priv); glamor_pixmap_attach_fbo(pixmap_priv->base.pixmap, new_fbo); glamor_pixmap_attach_fbo(scratch, old_fbo); DEBUGF("old %dx%d type %d\n", drawable->width, drawable->height, pixmap_priv->type); DEBUGF("copy tex %d %dx%d to tex %d %dx%d \n", old_fbo->tex, old_fbo->width, old_fbo->height, new_fbo->tex, new_fbo->width, new_fbo->height); ret = TRUE; fail: if (gc) FreeScratchGC(gc); if (scratch) glamor_destroy_pixmap(scratch); return ret; } xorg-server-1.17.1/glamor/glamor_render.c0000664000175100017510000020777512460362577015314 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Zhigang Gong * Junyan He * */ /** @file glamor_render.c * * Render acceleration implementation */ #include "glamor_priv.h" #ifdef RENDER #include "mipict.h" #include "fbpict.h" #if 0 //#define DEBUGF(str, ...) do {} while(0) #define DEBUGF(str, ...) ErrorF(str, ##__VA_ARGS__) //#define DEBUGRegionPrint(x) do {} while (0) #define DEBUGRegionPrint RegionPrint #endif static struct blendinfo composite_op_info[] = { [PictOpClear] = {0, 0, GL_ZERO, GL_ZERO}, [PictOpSrc] = {0, 0, GL_ONE, GL_ZERO}, [PictOpDst] = {0, 0, GL_ZERO, GL_ONE}, [PictOpOver] = {0, 1, GL_ONE, GL_ONE_MINUS_SRC_ALPHA}, [PictOpOverReverse] = {1, 0, GL_ONE_MINUS_DST_ALPHA, GL_ONE}, [PictOpIn] = {1, 0, GL_DST_ALPHA, GL_ZERO}, [PictOpInReverse] = {0, 1, GL_ZERO, GL_SRC_ALPHA}, [PictOpOut] = {1, 0, GL_ONE_MINUS_DST_ALPHA, GL_ZERO}, [PictOpOutReverse] = {0, 1, GL_ZERO, GL_ONE_MINUS_SRC_ALPHA}, [PictOpAtop] = {1, 1, GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA}, [PictOpAtopReverse] = {1, 1, GL_ONE_MINUS_DST_ALPHA, GL_SRC_ALPHA}, [PictOpXor] = {1, 1, GL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA}, [PictOpAdd] = {0, 0, GL_ONE, GL_ONE}, }; #define RepeatFix 10 static GLuint glamor_create_composite_fs(struct shader_key *key) { const char *repeat_define = "#define RepeatNone 0\n" "#define RepeatNormal 1\n" "#define RepeatPad 2\n" "#define RepeatReflect 3\n" "#define RepeatFix 10\n" "uniform int source_repeat_mode;\n" "uniform int mask_repeat_mode;\n"; const char *relocate_texture = GLAMOR_DEFAULT_PRECISION "vec2 rel_tex_coord(vec2 texture, vec4 wh, int repeat) \n" "{\n" " vec2 rel_tex; \n" " rel_tex = texture * wh.xy; \n" " if (repeat == RepeatNone)\n" " return rel_tex; \n" " else if (repeat == RepeatNormal) \n" " rel_tex = floor(rel_tex) + (fract(rel_tex) / wh.xy); \n" " else if(repeat == RepeatPad) { \n" " if (rel_tex.x >= 1.0) rel_tex.x = 1.0 - wh.z * wh.x / 2.; \n" " else if(rel_tex.x < 0.0) rel_tex.x = 0.0; \n" " if (rel_tex.y >= 1.0) rel_tex.y = 1.0 - wh.w * wh.y / 2.; \n" " else if(rel_tex.y < 0.0) rel_tex.y = 0.0; \n" " rel_tex = rel_tex / wh.xy; \n" " } \n" " else if(repeat == RepeatReflect) {\n" " if ((1.0 - mod(abs(floor(rel_tex.x)), 2.0)) < 0.001)\n" " rel_tex.x = 2.0 - (1.0 - fract(rel_tex.x))/wh.x;\n" " else \n" " rel_tex.x = fract(rel_tex.x)/wh.x;\n" " if ((1.0 - mod(abs(floor(rel_tex.y)), 2.0)) < 0.001)\n" " rel_tex.y = 2.0 - (1.0 - fract(rel_tex.y))/wh.y;\n" " else \n" " rel_tex.y = fract(rel_tex.y)/wh.y;\n" " } \n" " return rel_tex; \n" "}\n"; /* The texture and the pixmap size is not match eaxctly, so can't sample it directly. * rel_sampler will recalculate the texture coords.*/ const char *rel_sampler = " vec4 rel_sampler(sampler2D tex_image, vec2 tex, vec4 wh, int repeat, int set_alpha)\n" "{\n" " tex = rel_tex_coord(tex, wh, repeat - RepeatFix);\n" " if (repeat == RepeatFix) {\n" " if (!(tex.x >= 0.0 && tex.x < 1.0 \n" " && tex.y >= 0.0 && tex.y < 1.0))\n" " return vec4(0.0, 0.0, 0.0, set_alpha);\n" " tex = (fract(tex) / wh.xy);\n" " }\n" " if (set_alpha != 1)\n" " return texture2D(tex_image, tex);\n" " else\n" " return vec4(texture2D(tex_image, tex).rgb, 1.0);\n" "}\n"; const char *source_solid_fetch = GLAMOR_DEFAULT_PRECISION "uniform vec4 source;\n" "vec4 get_source()\n" "{\n" " return source;\n" "}\n"; const char *source_alpha_pixmap_fetch = GLAMOR_DEFAULT_PRECISION "varying vec2 source_texture;\n" "uniform sampler2D source_sampler;\n" "uniform vec4 source_wh;" "vec4 get_source()\n" "{\n" " if (source_repeat_mode < RepeatFix)\n" " return texture2D(source_sampler, source_texture);\n" " else \n" " return rel_sampler(source_sampler, source_texture,\n" " source_wh, source_repeat_mode, 0);\n" "}\n"; const char *source_pixmap_fetch = GLAMOR_DEFAULT_PRECISION "varying vec2 source_texture;\n" "uniform sampler2D source_sampler;\n" "uniform vec4 source_wh;\n" "vec4 get_source()\n" "{\n" " if (source_repeat_mode < RepeatFix) \n" " return vec4(texture2D(source_sampler, source_texture).rgb, 1);\n" " else \n" " return rel_sampler(source_sampler, source_texture,\n" " source_wh, source_repeat_mode, 1);\n" "}\n"; const char *mask_solid_fetch = GLAMOR_DEFAULT_PRECISION "uniform vec4 mask;\n" "vec4 get_mask()\n" "{\n" " return mask;\n" "}\n"; const char *mask_alpha_pixmap_fetch = GLAMOR_DEFAULT_PRECISION "varying vec2 mask_texture;\n" "uniform sampler2D mask_sampler;\n" "uniform vec4 mask_wh;\n" "vec4 get_mask()\n" "{\n" " if (mask_repeat_mode < RepeatFix) \n" " return texture2D(mask_sampler, mask_texture);\n" " else \n" " return rel_sampler(mask_sampler, mask_texture,\n" " mask_wh, mask_repeat_mode, 0);\n" "}\n"; const char *mask_pixmap_fetch = GLAMOR_DEFAULT_PRECISION "varying vec2 mask_texture;\n" "uniform sampler2D mask_sampler;\n" "uniform vec4 mask_wh;\n" "vec4 get_mask()\n" "{\n" " if (mask_repeat_mode < RepeatFix) \n" " return vec4(texture2D(mask_sampler, mask_texture).rgb, 1);\n" " else \n" " return rel_sampler(mask_sampler, mask_texture,\n" " mask_wh, mask_repeat_mode, 1);\n" "}\n"; const char *in_source_only = GLAMOR_DEFAULT_PRECISION "void main()\n" "{\n" " gl_FragColor = get_source();\n" "}\n"; const char *in_normal = GLAMOR_DEFAULT_PRECISION "void main()\n" "{\n" " gl_FragColor = get_source() * get_mask().a;\n" "}\n"; const char *in_ca_source = GLAMOR_DEFAULT_PRECISION "void main()\n" "{\n" " gl_FragColor = get_source() * get_mask();\n" "}\n"; const char *in_ca_alpha = GLAMOR_DEFAULT_PRECISION "void main()\n" "{\n" " gl_FragColor = get_source().a * get_mask();\n" "}\n"; char *source; const char *source_fetch; const char *mask_fetch = ""; const char *in; GLuint prog; switch (key->source) { case SHADER_SOURCE_SOLID: source_fetch = source_solid_fetch; break; case SHADER_SOURCE_TEXTURE_ALPHA: source_fetch = source_alpha_pixmap_fetch; break; case SHADER_SOURCE_TEXTURE: source_fetch = source_pixmap_fetch; break; default: FatalError("Bad composite shader source"); } switch (key->mask) { case SHADER_MASK_NONE: break; case SHADER_MASK_SOLID: mask_fetch = mask_solid_fetch; break; case SHADER_MASK_TEXTURE_ALPHA: mask_fetch = mask_alpha_pixmap_fetch; break; case SHADER_MASK_TEXTURE: mask_fetch = mask_pixmap_fetch; break; default: FatalError("Bad composite shader mask"); } switch (key->in) { case SHADER_IN_SOURCE_ONLY: in = in_source_only; break; case SHADER_IN_NORMAL: in = in_normal; break; case SHADER_IN_CA_SOURCE: in = in_ca_source; break; case SHADER_IN_CA_ALPHA: in = in_ca_alpha; break; default: FatalError("Bad composite IN type"); } XNFasprintf(&source, "%s%s%s%s%s%s", repeat_define, relocate_texture, rel_sampler, source_fetch, mask_fetch, in); prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, source); free(source); return prog; } static GLuint glamor_create_composite_vs(struct shader_key *key) { const char *main_opening = "attribute vec4 v_position;\n" "attribute vec4 v_texcoord0;\n" "attribute vec4 v_texcoord1;\n" "varying vec2 source_texture;\n" "varying vec2 mask_texture;\n" "void main()\n" "{\n" " gl_Position = v_position;\n"; const char *source_coords = " source_texture = v_texcoord0.xy;\n"; const char *mask_coords = " mask_texture = v_texcoord1.xy;\n"; const char *main_closing = "}\n"; const char *source_coords_setup = ""; const char *mask_coords_setup = ""; char *source; GLuint prog; if (key->source != SHADER_SOURCE_SOLID) source_coords_setup = source_coords; if (key->mask != SHADER_MASK_NONE && key->mask != SHADER_MASK_SOLID) mask_coords_setup = mask_coords; XNFasprintf(&source, "%s%s%s%s", main_opening, source_coords_setup, mask_coords_setup, main_closing); prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, source); free(source); return prog; } static void glamor_create_composite_shader(ScreenPtr screen, struct shader_key *key, glamor_composite_shader *shader) { GLuint vs, fs, prog; GLint source_sampler_uniform_location, mask_sampler_uniform_location; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); vs = glamor_create_composite_vs(key); if (vs == 0) return; fs = glamor_create_composite_fs(key); if (fs == 0) return; prog = glCreateProgram(); glAttachShader(prog, vs); glAttachShader(prog, fs); glBindAttribLocation(prog, GLAMOR_VERTEX_POS, "v_position"); glBindAttribLocation(prog, GLAMOR_VERTEX_SOURCE, "v_texcoord0"); glBindAttribLocation(prog, GLAMOR_VERTEX_MASK, "v_texcoord1"); glamor_link_glsl_prog(screen, prog, "composite"); shader->prog = prog; glUseProgram(prog); if (key->source == SHADER_SOURCE_SOLID) { shader->source_uniform_location = glGetUniformLocation(prog, "source"); } else { source_sampler_uniform_location = glGetUniformLocation(prog, "source_sampler"); glUniform1i(source_sampler_uniform_location, 0); shader->source_wh = glGetUniformLocation(prog, "source_wh"); shader->source_repeat_mode = glGetUniformLocation(prog, "source_repeat_mode"); } if (key->mask != SHADER_MASK_NONE) { if (key->mask == SHADER_MASK_SOLID) { shader->mask_uniform_location = glGetUniformLocation(prog, "mask"); } else { mask_sampler_uniform_location = glGetUniformLocation(prog, "mask_sampler"); glUniform1i(mask_sampler_uniform_location, 1); shader->mask_wh = glGetUniformLocation(prog, "mask_wh"); shader->mask_repeat_mode = glGetUniformLocation(prog, "mask_repeat_mode"); } } } static glamor_composite_shader * glamor_lookup_composite_shader(ScreenPtr screen, struct shader_key *key) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_composite_shader *shader; shader = &glamor_priv->composite_shader[key->source][key->mask][key->in]; if (shader->prog == 0) glamor_create_composite_shader(screen, key, shader); return shader; } static void glamor_init_eb(unsigned short *eb, int vert_cnt) { int i, j; for (i = 0, j = 0; j < vert_cnt; i += 6, j += 4) { eb[i] = j; eb[i + 1] = j + 1; eb[i + 2] = j + 2; eb[i + 3] = j; eb[i + 4] = j + 2; eb[i + 5] = j + 3; } } void glamor_init_composite_shaders(ScreenPtr screen) { glamor_screen_private *glamor_priv; unsigned short *eb; int eb_size; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glGenBuffers(1, &glamor_priv->ebo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ebo); eb_size = GLAMOR_COMPOSITE_VBO_VERT_CNT * sizeof(short) * 2; eb = XNFalloc(eb_size); glamor_init_eb(eb, GLAMOR_COMPOSITE_VBO_VERT_CNT); glBufferData(GL_ELEMENT_ARRAY_BUFFER, eb_size, eb, GL_STATIC_DRAW); free(eb); } void glamor_fini_composite_shaders(ScreenPtr screen) { glamor_screen_private *glamor_priv; glamor_composite_shader *shader; int i, j, k; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glDeleteBuffers(1, &glamor_priv->ebo); for (i = 0; i < SHADER_SOURCE_COUNT; i++) for (j = 0; j < SHADER_MASK_COUNT; j++) for (k = 0; k < SHADER_IN_COUNT; k++) { shader = &glamor_priv->composite_shader[i][j][k]; if (shader->prog) glDeleteProgram(shader->prog); } } static Bool glamor_set_composite_op(ScreenPtr screen, CARD8 op, struct blendinfo *op_info_result, PicturePtr dest, PicturePtr mask) { GLenum source_blend, dest_blend; struct blendinfo *op_info; if (op >= ARRAY_SIZE(composite_op_info)) { glamor_fallback("unsupported render op %d \n", op); return GL_FALSE; } op_info = &composite_op_info[op]; source_blend = op_info->source_blend; dest_blend = op_info->dest_blend; /* If there's no dst alpha channel, adjust the blend op so that we'll treat * it as always 1. */ if (PICT_FORMAT_A(dest->format) == 0 && op_info->dest_alpha) { if (source_blend == GL_DST_ALPHA) source_blend = GL_ONE; else if (source_blend == GL_ONE_MINUS_DST_ALPHA) source_blend = GL_ZERO; } /* Set up the source alpha value for blending in component alpha mode. */ if (mask && mask->componentAlpha && PICT_FORMAT_RGB(mask->format) != 0 && op_info->source_alpha) { if (dest_blend == GL_SRC_ALPHA) dest_blend = GL_SRC_COLOR; else if (dest_blend == GL_ONE_MINUS_SRC_ALPHA) dest_blend = GL_ONE_MINUS_SRC_COLOR; } op_info_result->source_blend = source_blend; op_info_result->dest_blend = dest_blend; op_info_result->source_alpha = op_info->source_alpha; op_info_result->dest_alpha = op_info->dest_alpha; return TRUE; } static void glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, PicturePtr picture, glamor_pixmap_private *pixmap_priv, GLuint wh_location, GLuint repeat_location) { float wh[4]; int repeat_type; glamor_make_current(glamor_priv); glActiveTexture(GL_TEXTURE0 + unit); glBindTexture(GL_TEXTURE_2D, pixmap_priv->base.fbo->tex); repeat_type = picture->repeatType; switch (picture->repeatType) { case RepeatNone: if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) { /* XXX GLES2 doesn't support GL_CLAMP_TO_BORDER. */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); } else { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } break; case RepeatNormal: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); break; case RepeatPad: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); break; case RepeatReflect: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT); break; } switch (picture->filter) { default: case PictFilterFast: case PictFilterNearest: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); break; case PictFilterGood: case PictFilterBest: case PictFilterBilinear: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); break; } /* * GLES2 doesn't support RepeatNone. We need to fix it anyway. * **/ if (repeat_type != RepeatNone) repeat_type += RepeatFix; else if (glamor_priv->gl_flavor == GLAMOR_GL_ES2 || pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { if (picture->transform || (GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE(pixmap_priv))) repeat_type += RepeatFix; } if (repeat_type >= RepeatFix) { glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap_priv); if ((wh[0] != 1.0 || wh[1] != 1.0) || (glamor_priv->gl_flavor == GLAMOR_GL_ES2 && repeat_type == RepeatFix)) glUniform4fv(wh_location, 1, wh); else repeat_type -= RepeatFix; } glUniform1i(repeat_location, repeat_type); } static void glamor_set_composite_solid(float *color, GLint uniform_location) { glUniform4fv(uniform_location, 1, color); } static int compatible_formats(CARD8 op, PicturePtr dst, PicturePtr src) { if (op == PictOpSrc) { if (src->format == dst->format) return 1; if (src->format == PICT_a8r8g8b8 && dst->format == PICT_x8r8g8b8) return 1; if (src->format == PICT_a8b8g8r8 && dst->format == PICT_x8b8g8r8) return 1; } else if (op == PictOpOver) { if (src->alphaMap || dst->alphaMap) return 0; if (src->format != dst->format) return 0; if (src->format == PICT_x8r8g8b8 || src->format == PICT_x8b8g8r8) return 1; } return 0; } static char glamor_get_picture_location(PicturePtr picture) { if (picture == NULL) return ' '; if (picture->pDrawable == NULL) { switch (picture->pSourcePict->type) { case SourcePictTypeSolidFill: return 'c'; case SourcePictTypeLinear: return 'l'; case SourcePictTypeRadial: return 'r'; default: return '?'; } } return glamor_get_drawable_location(picture->pDrawable); } static Bool glamor_composite_with_copy(CARD8 op, PicturePtr source, PicturePtr dest, INT16 x_source, INT16 y_source, INT16 x_dest, INT16 y_dest, RegionPtr region) { int ret = FALSE; if (!source->pDrawable) return FALSE; if (!compatible_formats(op, dest, source)) return FALSE; if (source->repeat || source->transform) { return FALSE; } x_dest += dest->pDrawable->x; y_dest += dest->pDrawable->y; x_source += source->pDrawable->x; y_source += source->pDrawable->y; if (PICT_FORMAT_A(source->format) == 0) { /* Fallback if we sample outside the source so that we * swizzle the correct clear color for out-of-bounds texels. */ if (region->extents.x1 + x_source - x_dest < 0) goto cleanup_region; if (region->extents.x2 + x_source - x_dest > source->pDrawable->width) goto cleanup_region; if (region->extents.y1 + y_source - y_dest < 0) goto cleanup_region; if (region->extents.y2 + y_source - y_dest > source->pDrawable->height) goto cleanup_region; } glamor_copy(source->pDrawable, dest->pDrawable, NULL, RegionRects(region), RegionNumRects(region), x_source - x_dest, y_source - y_dest, FALSE, FALSE, 0, NULL); ret = TRUE; cleanup_region: return ret; } void * glamor_setup_composite_vbo(ScreenPtr screen, int n_verts) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); int vert_size; char *vbo_offset; float *vb; glamor_priv->render_nr_verts = 0; glamor_priv->vb_stride = 2 * sizeof(float); if (glamor_priv->has_source_coords) glamor_priv->vb_stride += 2 * sizeof(float); if (glamor_priv->has_mask_coords) glamor_priv->vb_stride += 2 * sizeof(float); vert_size = n_verts * glamor_priv->vb_stride; glamor_make_current(glamor_priv); vb = glamor_get_vbo_space(screen, vert_size, &vbo_offset); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, glamor_priv->vb_stride, vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); if (glamor_priv->has_source_coords) { glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, glamor_priv->vb_stride, vbo_offset + 2 * sizeof(float)); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); } if (glamor_priv->has_mask_coords) { glVertexAttribPointer(GLAMOR_VERTEX_MASK, 2, GL_FLOAT, GL_FALSE, glamor_priv->vb_stride, vbo_offset + (glamor_priv->has_source_coords ? 4 : 2) * sizeof(float)); glEnableVertexAttribArray(GLAMOR_VERTEX_MASK); } return vb; } static void glamor_flush_composite_rects(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); if (!glamor_priv->render_nr_verts) return; if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { glDrawRangeElements(GL_TRIANGLES, 0, glamor_priv->render_nr_verts, (glamor_priv->render_nr_verts * 3) / 2, GL_UNSIGNED_SHORT, NULL); } else { glDrawElements(GL_TRIANGLES, (glamor_priv->render_nr_verts * 3) / 2, GL_UNSIGNED_SHORT, NULL); } } int pict_format_combine_tab[][3] = { {PICT_TYPE_ARGB, PICT_TYPE_A, PICT_TYPE_ARGB}, {PICT_TYPE_ABGR, PICT_TYPE_A, PICT_TYPE_ABGR}, }; static Bool combine_pict_format(PictFormatShort * des, const PictFormatShort src, const PictFormatShort mask, enum shader_in in_ca) { PictFormatShort new_vis; int src_type, mask_type, src_bpp; int i; if (src == mask) { *des = src; return TRUE; } src_bpp = PICT_FORMAT_BPP(src); assert(src_bpp == PICT_FORMAT_BPP(mask)); new_vis = PICT_FORMAT_VIS(src) | PICT_FORMAT_VIS(mask); switch (in_ca) { case SHADER_IN_SOURCE_ONLY: return TRUE; case SHADER_IN_NORMAL: src_type = PICT_FORMAT_TYPE(src); mask_type = PICT_TYPE_A; break; case SHADER_IN_CA_SOURCE: src_type = PICT_FORMAT_TYPE(src); mask_type = PICT_FORMAT_TYPE(mask); break; case SHADER_IN_CA_ALPHA: src_type = PICT_TYPE_A; mask_type = PICT_FORMAT_TYPE(mask); break; default: return FALSE; } if (src_type == mask_type) { *des = PICT_VISFORMAT(src_bpp, src_type, new_vis); return TRUE; } for (i = 0; i < sizeof(pict_format_combine_tab) / sizeof(pict_format_combine_tab[0]); i++) { if ((src_type == pict_format_combine_tab[i][0] && mask_type == pict_format_combine_tab[i][1]) || (src_type == pict_format_combine_tab[i][1] && mask_type == pict_format_combine_tab[i][0])) { *des = PICT_VISFORMAT(src_bpp, pict_format_combine_tab[i] [2], new_vis); return TRUE; } } return FALSE; } static void glamor_set_normalize_tcoords_generic(glamor_pixmap_private *priv, int repeat_type, float *matrix, float xscale, float yscale, int x1, int y1, int x2, int y2, float *texcoords, int stride) { if (!matrix && repeat_type == RepeatNone) glamor_set_normalize_tcoords_ext(priv, xscale, yscale, x1, y1, x2, y2, texcoords, stride); else if (matrix && repeat_type == RepeatNone) glamor_set_transformed_normalize_tcoords_ext(priv, matrix, xscale, yscale, x1, y1, x2, y2, texcoords, stride); else if (!matrix && repeat_type != RepeatNone) glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, xscale, yscale, x1, y1, x2, y2, texcoords, stride); else if (matrix && repeat_type != RepeatNone) glamor_set_repeat_transformed_normalize_tcoords_ext(priv, repeat_type, matrix, xscale, yscale, x1, y1, x2, y2, texcoords, stride); } Bool glamor_composite_choose_shader(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, glamor_pixmap_private *source_pixmap_priv, glamor_pixmap_private *mask_pixmap_priv, glamor_pixmap_private *dest_pixmap_priv, struct shader_key *s_key, glamor_composite_shader ** shader, struct blendinfo *op_info, PictFormatShort *psaved_source_format) { ScreenPtr screen = dest->pDrawable->pScreen; PixmapPtr dest_pixmap = dest_pixmap_priv->base.pixmap; PixmapPtr source_pixmap = NULL; PixmapPtr mask_pixmap = NULL; enum glamor_pixmap_status source_status = GLAMOR_NONE; enum glamor_pixmap_status mask_status = GLAMOR_NONE; PictFormatShort saved_source_format = 0; struct shader_key key; GLfloat source_solid_color[4]; GLfloat mask_solid_color[4]; Bool ret = FALSE; if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) { glamor_fallback("dest has no fbo.\n"); goto fail; } memset(&key, 0, sizeof(key)); if (!source) { key.source = SHADER_SOURCE_SOLID; source_solid_color[0] = 0.0; source_solid_color[1] = 0.0; source_solid_color[2] = 0.0; source_solid_color[3] = 0.0; } else if (!source->pDrawable) { if (source->pSourcePict->type == SourcePictTypeSolidFill) { key.source = SHADER_SOURCE_SOLID; glamor_get_rgba_from_pixel(source->pSourcePict->solidFill.color, &source_solid_color[0], &source_solid_color[1], &source_solid_color[2], &source_solid_color[3], PICT_a8r8g8b8); } else goto fail; } else { if (PICT_FORMAT_A(source->format)) key.source = SHADER_SOURCE_TEXTURE_ALPHA; else key.source = SHADER_SOURCE_TEXTURE; } if (mask) { if (!mask->pDrawable) { if (mask->pSourcePict->type == SourcePictTypeSolidFill) { key.mask = SHADER_MASK_SOLID; glamor_get_rgba_from_pixel (mask->pSourcePict->solidFill.color, &mask_solid_color[0], &mask_solid_color[1], &mask_solid_color[2], &mask_solid_color[3], PICT_a8r8g8b8); } else goto fail; } else { key.mask = SHADER_MASK_TEXTURE_ALPHA; } if (!mask->componentAlpha) { key.in = SHADER_IN_NORMAL; } else { if (op == PictOpClear) key.mask = SHADER_MASK_NONE; else if (op == PictOpSrc || op == PictOpAdd || op == PictOpIn || op == PictOpOut || op == PictOpOverReverse) key.in = SHADER_IN_CA_SOURCE; else if (op == PictOpOutReverse || op == PictOpInReverse) { key.in = SHADER_IN_CA_ALPHA; } else { glamor_fallback("Unsupported component alpha op: %d\n", op); goto fail; } } } else { key.mask = SHADER_MASK_NONE; key.in = SHADER_IN_SOURCE_ONLY; } if (source && source->alphaMap) { glamor_fallback("source alphaMap\n"); goto fail; } if (mask && mask->alphaMap) { glamor_fallback("mask alphaMap\n"); goto fail; } if (key.source == SHADER_SOURCE_TEXTURE || key.source == SHADER_SOURCE_TEXTURE_ALPHA) { source_pixmap = source_pixmap_priv->base.pixmap; if (source_pixmap == dest_pixmap) { /* XXX source and the dest share the same texture. * Does it need special handle? */ glamor_fallback("source == dest\n"); } if (source_pixmap_priv->base.gl_fbo == GLAMOR_FBO_UNATTACHED) { #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD source_status = GLAMOR_UPLOAD_PENDING; #else glamor_fallback("no texture in source\n"); goto fail; #endif } } if (key.mask == SHADER_MASK_TEXTURE || key.mask == SHADER_MASK_TEXTURE_ALPHA) { mask_pixmap = mask_pixmap_priv->base.pixmap; if (mask_pixmap == dest_pixmap) { glamor_fallback("mask == dest\n"); goto fail; } if (mask_pixmap_priv->base.gl_fbo == GLAMOR_FBO_UNATTACHED) { #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD mask_status = GLAMOR_UPLOAD_PENDING; #else glamor_fallback("no texture in mask\n"); goto fail; #endif } } #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD if (source_status == GLAMOR_UPLOAD_PENDING && mask_status == GLAMOR_UPLOAD_PENDING && source_pixmap == mask_pixmap) { if (source->format != mask->format) { saved_source_format = source->format; if (!combine_pict_format(&source->format, source->format, mask->format, key.in)) { glamor_fallback("combine source %x mask %x failed.\n", source->format, mask->format); goto fail; } if (source->format != saved_source_format) { glamor_picture_format_fixup(source, source_pixmap_priv); } /* XXX * By default, glamor_upload_picture_to_texture will wire alpha to 1 * if one picture doesn't have alpha. So we don't do that again in * rendering function. But here is a special case, as source and * mask share the same texture but may have different formats. For * example, source doesn't have alpha, but mask has alpha. Then the * texture will have the alpha value for the mask. And will not wire * to 1 for the source. In this case, we have to use different shader * to wire the source's alpha to 1. * * But this may cause a potential problem if the source's repeat mode * is REPEAT_NONE, and if the source is smaller than the dest, then * for the region not covered by the source may be painted incorrectly. * because we wire the alpha to 1. * **/ if (!PICT_FORMAT_A(saved_source_format) && PICT_FORMAT_A(mask->format)) key.source = SHADER_SOURCE_TEXTURE; if (!PICT_FORMAT_A(mask->format) && PICT_FORMAT_A(saved_source_format)) key.mask = SHADER_MASK_TEXTURE; mask_status = GLAMOR_NONE; } source_status = glamor_upload_picture_to_texture(source); if (source_status != GLAMOR_UPLOAD_DONE) { glamor_fallback("Failed to upload source texture.\n"); goto fail; } } else { if (source_status == GLAMOR_UPLOAD_PENDING) { source_status = glamor_upload_picture_to_texture(source); if (source_status != GLAMOR_UPLOAD_DONE) { glamor_fallback("Failed to upload source texture.\n"); goto fail; } } if (mask_status == GLAMOR_UPLOAD_PENDING) { mask_status = glamor_upload_picture_to_texture(mask); if (mask_status != GLAMOR_UPLOAD_DONE) { glamor_fallback("Failed to upload mask texture.\n"); goto fail; } } } #endif /* If the source and mask are two differently-formatted views of * the same pixmap bits, and the pixmap was already uploaded (so * the dynamic code above doesn't apply), then fall back to * software. We should use texture views to fix this properly. */ if (source_pixmap && source_pixmap == mask_pixmap && source->format != mask->format) { goto fail; } /*Before enter the rendering stage, we need to fixup * transformed source and mask, if the transform is not int translate. */ if (key.source != SHADER_SOURCE_SOLID && source->transform && !pixman_transform_is_int_translate(source->transform) && source_pixmap_priv->type != GLAMOR_TEXTURE_LARGE) { if (!glamor_fixup_pixmap_priv(screen, source_pixmap_priv)) goto fail; } if (key.mask != SHADER_MASK_NONE && key.mask != SHADER_MASK_SOLID && mask->transform && !pixman_transform_is_int_translate(mask->transform) && mask_pixmap_priv->type != GLAMOR_TEXTURE_LARGE) { if (!glamor_fixup_pixmap_priv(screen, mask_pixmap_priv)) goto fail; } if (!glamor_set_composite_op(screen, op, op_info, dest, mask)) goto fail; *shader = glamor_lookup_composite_shader(screen, &key); if ((*shader)->prog == 0) { glamor_fallback("no shader program for this render acccel mode\n"); goto fail; } if (key.source == SHADER_SOURCE_SOLID) memcpy(&(*shader)->source_solid_color[0], source_solid_color, 4 * sizeof(float)); else { (*shader)->source_priv = source_pixmap_priv; (*shader)->source = source; } if (key.mask == SHADER_MASK_SOLID) memcpy(&(*shader)->mask_solid_color[0], mask_solid_color, 4 * sizeof(float)); else { (*shader)->mask_priv = mask_pixmap_priv; (*shader)->mask = mask; } ret = TRUE; memcpy(s_key, &key, sizeof(key)); *psaved_source_format = saved_source_format; goto done; fail: if (saved_source_format) source->format = saved_source_format; done: return ret; } void glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv, struct shader_key *key, glamor_composite_shader *shader, struct blendinfo *op_info) { glamor_screen_private *glamor_priv; glamor_priv = dest_priv->base.glamor_priv; glamor_make_current(glamor_priv); glUseProgram(shader->prog); if (key->source == SHADER_SOURCE_SOLID) { glamor_set_composite_solid(shader->source_solid_color, shader->source_uniform_location); } else { glamor_set_composite_texture(glamor_priv, 0, shader->source, shader->source_priv, shader->source_wh, shader->source_repeat_mode); } if (key->mask != SHADER_MASK_NONE) { if (key->mask == SHADER_MASK_SOLID) { glamor_set_composite_solid(shader->mask_solid_color, shader->mask_uniform_location); } else { glamor_set_composite_texture(glamor_priv, 1, shader->mask, shader->mask_priv, shader->mask_wh, shader->mask_repeat_mode); } } if (op_info->source_blend == GL_ONE && op_info->dest_blend == GL_ZERO) { glDisable(GL_BLEND); } else { glEnable(GL_BLEND); glBlendFunc(op_info->source_blend, op_info->dest_blend); } } static Bool glamor_composite_with_shader(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, glamor_pixmap_private *source_pixmap_priv, glamor_pixmap_private *mask_pixmap_priv, glamor_pixmap_private *dest_pixmap_priv, int nrect, glamor_composite_rect_t *rects, Bool two_pass_ca) { ScreenPtr screen = dest->pDrawable->pScreen; glamor_screen_private *glamor_priv = dest_pixmap_priv->base.glamor_priv; PixmapPtr dest_pixmap = dest_pixmap_priv->base.pixmap; PixmapPtr source_pixmap = NULL; PixmapPtr mask_pixmap = NULL; GLfloat dst_xscale, dst_yscale; GLfloat mask_xscale = 1, mask_yscale = 1, src_xscale = 1, src_yscale = 1; struct shader_key key, key_ca; int dest_x_off, dest_y_off; int source_x_off, source_y_off; int mask_x_off, mask_y_off; PictFormatShort saved_source_format = 0; float src_matrix[9], mask_matrix[9]; float *psrc_matrix = NULL, *pmask_matrix = NULL; int nrect_max; Bool ret = FALSE; glamor_composite_shader *shader = NULL, *shader_ca = NULL; struct blendinfo op_info, op_info_ca; if (!glamor_composite_choose_shader(op, source, mask, dest, source_pixmap_priv, mask_pixmap_priv, dest_pixmap_priv, &key, &shader, &op_info, &saved_source_format)) { glamor_fallback("glamor_composite_choose_shader failed\n"); return ret; } if (two_pass_ca) { if (!glamor_composite_choose_shader(PictOpAdd, source, mask, dest, source_pixmap_priv, mask_pixmap_priv, dest_pixmap_priv, &key_ca, &shader_ca, &op_info_ca, &saved_source_format)) { glamor_fallback("glamor_composite_choose_shader failed\n"); return ret; } } glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv); glamor_composite_set_shader_blend(dest_pixmap_priv, &key, shader, &op_info); glamor_make_current(glamor_priv); glamor_priv->has_source_coords = key.source != SHADER_SOURCE_SOLID; glamor_priv->has_mask_coords = (key.mask != SHADER_MASK_NONE && key.mask != SHADER_MASK_SOLID); dest_pixmap = glamor_get_drawable_pixmap(dest->pDrawable); dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap); glamor_get_drawable_deltas(dest->pDrawable, dest_pixmap, &dest_x_off, &dest_y_off); pixmap_priv_get_dest_scale(dest_pixmap_priv, &dst_xscale, &dst_yscale); if (glamor_priv->has_source_coords) { source_pixmap = source_pixmap_priv->base.pixmap; glamor_get_drawable_deltas(source->pDrawable, source_pixmap, &source_x_off, &source_y_off); pixmap_priv_get_scale(source_pixmap_priv, &src_xscale, &src_yscale); if (source->transform) { psrc_matrix = src_matrix; glamor_picture_get_matrixf(source, psrc_matrix); } } if (glamor_priv->has_mask_coords) { mask_pixmap = mask_pixmap_priv->base.pixmap; glamor_get_drawable_deltas(mask->pDrawable, mask_pixmap, &mask_x_off, &mask_y_off); pixmap_priv_get_scale(mask_pixmap_priv, &mask_xscale, &mask_yscale); if (mask->transform) { pmask_matrix = mask_matrix; glamor_picture_get_matrixf(mask, pmask_matrix); } } nrect_max = MIN(nrect, GLAMOR_COMPOSITE_VBO_VERT_CNT / 4); while (nrect) { int mrect, rect_processed; int vb_stride; float *vertices; mrect = nrect > nrect_max ? nrect_max : nrect; vertices = glamor_setup_composite_vbo(screen, mrect * 4); rect_processed = mrect; vb_stride = glamor_priv->vb_stride / sizeof(float); while (mrect--) { INT16 x_source; INT16 y_source; INT16 x_mask; INT16 y_mask; INT16 x_dest; INT16 y_dest; CARD16 width; CARD16 height; x_dest = rects->x_dst + dest_x_off; y_dest = rects->y_dst + dest_y_off; x_source = rects->x_src + source_x_off; y_source = rects->y_src + source_y_off; x_mask = rects->x_mask + mask_x_off; y_mask = rects->y_mask + mask_y_off; width = rects->width; height = rects->height; DEBUGF ("dest(%d,%d) source(%d %d) mask (%d %d), width %d height %d \n", x_dest, y_dest, x_source, y_source, x_mask, y_mask, width, height); glamor_set_normalize_vcoords_ext(dest_pixmap_priv, dst_xscale, dst_yscale, x_dest, y_dest, x_dest + width, y_dest + height, vertices, vb_stride); vertices += 2; if (key.source != SHADER_SOURCE_SOLID) { glamor_set_normalize_tcoords_generic(source_pixmap_priv, source->repeatType, psrc_matrix, src_xscale, src_yscale, x_source, y_source, x_source + width, y_source + height, vertices, vb_stride); vertices += 2; } if (key.mask != SHADER_MASK_NONE && key.mask != SHADER_MASK_SOLID) { glamor_set_normalize_tcoords_generic(mask_pixmap_priv, mask->repeatType, pmask_matrix, mask_xscale, mask_yscale, x_mask, y_mask, x_mask + width, y_mask + height, vertices, vb_stride); vertices += 2; } glamor_priv->render_nr_verts += 4; rects++; /* We've incremented by one of our 4 verts, now do the other 3. */ vertices += 3 * vb_stride; } glamor_put_vbo_space(screen); glamor_flush_composite_rects(screen); nrect -= rect_processed; if (two_pass_ca) { glamor_composite_set_shader_blend(dest_pixmap_priv, &key_ca, shader_ca, &op_info_ca); glamor_flush_composite_rects(screen); if (nrect) glamor_composite_set_shader_blend(dest_pixmap_priv, &key, shader, &op_info); } } glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glDisableVertexAttribArray(GLAMOR_VERTEX_MASK); glDisable(GL_BLEND); DEBUGF("finish rendering.\n"); if (saved_source_format) source->format = saved_source_format; ret = TRUE; return ret; } PicturePtr glamor_convert_gradient_picture(ScreenPtr screen, PicturePtr source, int x_source, int y_source, int width, int height) { PixmapPtr pixmap; PicturePtr dst = NULL; int error; PictFormatShort format; if (!source->pDrawable) format = PICT_a8r8g8b8; else format = source->format; #ifdef GLAMOR_GRADIENT_SHADER if (!source->pDrawable) { if (source->pSourcePict->type == SourcePictTypeLinear) { dst = glamor_generate_linear_gradient_picture(screen, source, x_source, y_source, width, height, format); } else if (source->pSourcePict->type == SourcePictTypeRadial) { dst = glamor_generate_radial_gradient_picture(screen, source, x_source, y_source, width, height, format); } if (dst) { #if 0 /* Debug to compare it to pixman, Enable it if needed. */ glamor_compare_pictures(screen, source, dst, x_source, y_source, width, height, 0, 3); #endif return dst; } } #endif pixmap = glamor_create_pixmap(screen, width, height, PIXMAN_FORMAT_DEPTH(format), GLAMOR_CREATE_PIXMAP_CPU); if (!pixmap) return NULL; dst = CreatePicture(0, &pixmap->drawable, PictureMatchFormat(screen, PIXMAN_FORMAT_DEPTH(format), format), 0, 0, serverClient, &error); glamor_destroy_pixmap(pixmap); if (!dst) return NULL; ValidatePicture(dst); fbComposite(PictOpSrc, source, NULL, dst, x_source, y_source, 0, 0, 0, 0, width, height); return dst; } Bool glamor_composite_clipped_region(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, glamor_pixmap_private *source_pixmap_priv, glamor_pixmap_private *mask_pixmap_priv, glamor_pixmap_private *dest_pixmap_priv, RegionPtr region, int x_source, int y_source, int x_mask, int y_mask, int x_dest, int y_dest) { ScreenPtr screen = dest->pDrawable->pScreen; PixmapPtr source_pixmap = NULL, mask_pixmap = NULL; PicturePtr temp_src = source, temp_mask = mask; glamor_pixmap_private *temp_src_priv = source_pixmap_priv; glamor_pixmap_private *temp_mask_priv = mask_pixmap_priv; int x_temp_src, y_temp_src, x_temp_mask, y_temp_mask; BoxPtr extent; glamor_composite_rect_t rect[10]; glamor_composite_rect_t *prect = rect; int prect_size = ARRAY_SIZE(rect); int ok = FALSE; int i; int width; int height; BoxPtr box; int nbox; Bool two_pass_ca = FALSE; extent = RegionExtents(region); box = RegionRects(region); nbox = RegionNumRects(region); width = extent->x2 - extent->x1; height = extent->y2 - extent->y1; x_temp_src = x_source; y_temp_src = y_source; x_temp_mask = x_mask; y_temp_mask = y_mask; DEBUGF("clipped (%d %d) (%d %d) (%d %d) width %d height %d \n", x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height); if (source_pixmap_priv) source_pixmap = source_pixmap_priv->base.pixmap; if (mask_pixmap_priv) mask_pixmap = mask_pixmap_priv->base.pixmap; /* XXX is it possible source mask have non-zero drawable.x/y? */ if (source && ((!source->pDrawable && (source->pSourcePict->type != SourcePictTypeSolidFill)) || (source->pDrawable && !GLAMOR_PIXMAP_PRIV_HAS_FBO(source_pixmap_priv) && (source_pixmap->drawable.width != width || source_pixmap->drawable.height != height)))) { temp_src = glamor_convert_gradient_picture(screen, source, extent->x1 + x_source - x_dest - dest->pDrawable->x, extent->y1 + y_source - y_dest - dest->pDrawable->y, width, height); if (!temp_src) { temp_src = source; goto out; } temp_src_priv = glamor_get_pixmap_private((PixmapPtr) (temp_src->pDrawable)); x_temp_src = -extent->x1 + x_dest + dest->pDrawable->x; y_temp_src = -extent->y1 + y_dest + dest->pDrawable->y; } if (mask && ((!mask->pDrawable && (mask->pSourcePict->type != SourcePictTypeSolidFill)) || (mask->pDrawable && !GLAMOR_PIXMAP_PRIV_HAS_FBO(mask_pixmap_priv) && (mask_pixmap->drawable.width != width || mask_pixmap->drawable.height != height)))) { /* XXX if mask->pDrawable is the same as source->pDrawable, we have an opportunity * to do reduce one convertion. */ temp_mask = glamor_convert_gradient_picture(screen, mask, extent->x1 + x_mask - x_dest - dest->pDrawable->x, extent->y1 + y_mask - y_dest - dest->pDrawable->y, width, height); if (!temp_mask) { temp_mask = mask; goto out; } temp_mask_priv = glamor_get_pixmap_private((PixmapPtr) (temp_mask->pDrawable)); x_temp_mask = -extent->x1 + x_dest + dest->pDrawable->x; y_temp_mask = -extent->y1 + y_dest + dest->pDrawable->y; } /* Do two-pass PictOpOver componentAlpha, until we enable * dual source color blending. */ if (mask && mask->componentAlpha) { if (op == PictOpOver) { two_pass_ca = TRUE; op = PictOpOutReverse; } } if (!mask && temp_src) { if (glamor_composite_with_copy(op, temp_src, dest, x_temp_src, y_temp_src, x_dest, y_dest, region)) { ok = TRUE; goto out; } } /*XXXXX, self copy? */ x_dest += dest->pDrawable->x; y_dest += dest->pDrawable->y; if (temp_src && temp_src->pDrawable) { x_temp_src += temp_src->pDrawable->x; y_temp_src += temp_src->pDrawable->y; } if (temp_mask && temp_mask->pDrawable) { x_temp_mask += temp_mask->pDrawable->x; y_temp_mask += temp_mask->pDrawable->y; } if (nbox > ARRAY_SIZE(rect)) { prect = calloc(nbox, sizeof(*prect)); if (prect) prect_size = nbox; else { prect = rect; prect_size = ARRAY_SIZE(rect); } } while (nbox) { int box_cnt; box_cnt = nbox > prect_size ? prect_size : nbox; for (i = 0; i < box_cnt; i++) { prect[i].x_src = box[i].x1 + x_temp_src - x_dest; prect[i].y_src = box[i].y1 + y_temp_src - y_dest; prect[i].x_mask = box[i].x1 + x_temp_mask - x_dest; prect[i].y_mask = box[i].y1 + y_temp_mask - y_dest; prect[i].x_dst = box[i].x1; prect[i].y_dst = box[i].y1; prect[i].width = box[i].x2 - box[i].x1; prect[i].height = box[i].y2 - box[i].y1; DEBUGF("dest %d %d \n", prect[i].x_dst, prect[i].y_dst); } ok = glamor_composite_with_shader(op, temp_src, temp_mask, dest, temp_src_priv, temp_mask_priv, dest_pixmap_priv, box_cnt, prect, two_pass_ca); if (!ok) break; nbox -= box_cnt; box += box_cnt; } if (prect != rect) free(prect); out: if (temp_src != source) FreePicture(temp_src, 0); if (temp_mask != mask) FreePicture(temp_mask, 0); return ok; } static Bool _glamor_composite(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, INT16 x_source, INT16 y_source, INT16 x_mask, INT16 y_mask, INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height, Bool fallback) { ScreenPtr screen = dest->pDrawable->pScreen; glamor_pixmap_private *dest_pixmap_priv; glamor_pixmap_private *source_pixmap_priv = NULL, *mask_pixmap_priv = NULL; PixmapPtr dest_pixmap = glamor_get_drawable_pixmap(dest->pDrawable); PixmapPtr source_pixmap = NULL, mask_pixmap = NULL; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); Bool ret = TRUE; RegionRec region; BoxPtr extent; int nbox, ok = FALSE; int force_clip = 0; dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap); if (source->pDrawable) { source_pixmap = glamor_get_drawable_pixmap(source->pDrawable); source_pixmap_priv = glamor_get_pixmap_private(source_pixmap); if (source_pixmap_priv && source_pixmap_priv->type == GLAMOR_DRM_ONLY) goto fail; } if (mask && mask->pDrawable) { mask_pixmap = glamor_get_drawable_pixmap(mask->pDrawable); mask_pixmap_priv = glamor_get_pixmap_private(mask_pixmap); if (mask_pixmap_priv && mask_pixmap_priv->type == GLAMOR_DRM_ONLY) goto fail; } DEBUGF ("source pixmap %p (%d %d) mask(%d %d) dest(%d %d) width %d height %d \n", source_pixmap, x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) { goto fail; } if (op >= ARRAY_SIZE(composite_op_info)) goto fail; if (mask && mask->componentAlpha) { if (op == PictOpAtop || op == PictOpAtopReverse || op == PictOpXor || op >= PictOpSaturate) { glamor_fallback("glamor_composite(): component alpha op %x\n", op); goto fail; } } if ((source && source->filter >= PictFilterConvolution) || (mask && mask->filter >= PictFilterConvolution)) { glamor_fallback("glamor_composite(): unsupported filter\n"); goto fail; } if (!miComputeCompositeRegion(®ion, source, mask, dest, x_source + (source_pixmap ? source->pDrawable->x : 0), y_source + (source_pixmap ? source->pDrawable->y : 0), x_mask + (mask_pixmap ? mask->pDrawable->x : 0), y_mask + (mask_pixmap ? mask->pDrawable->y : 0), x_dest + dest->pDrawable->x, y_dest + dest->pDrawable->y, width, height)) { ret = TRUE; goto done; } nbox = REGION_NUM_RECTS(®ion); DEBUGF("first clipped when compositing.\n"); DEBUGRegionPrint(®ion); extent = RegionExtents(®ion); if (nbox == 0) { ret = TRUE; goto done; } /* If destination is not a large pixmap, but the region is larger * than texture size limitation, and source or mask is memory pixmap, * then there may be need to load a large memory pixmap to a * texture, and this is not permitted. Then we force to clip the * destination and make sure latter will not upload a large memory * pixmap. */ if (!glamor_check_fbo_size(glamor_priv, extent->x2 - extent->x1, extent->y2 - extent->y1) && (dest_pixmap_priv->type != GLAMOR_TEXTURE_LARGE) && ((source_pixmap_priv && (source_pixmap_priv->type == GLAMOR_MEMORY || source->repeatType == RepeatPad)) || (mask_pixmap_priv && (mask_pixmap_priv->type == GLAMOR_MEMORY || mask->repeatType == RepeatPad)) || (!source_pixmap_priv && (source->pSourcePict->type != SourcePictTypeSolidFill)) || (!mask_pixmap_priv && mask && mask->pSourcePict->type != SourcePictTypeSolidFill))) force_clip = 1; if (force_clip || dest_pixmap_priv->type == GLAMOR_TEXTURE_LARGE || (source_pixmap_priv && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) || (mask_pixmap_priv && mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE)) ok = glamor_composite_largepixmap_region(op, source, mask, dest, source_pixmap_priv, mask_pixmap_priv, dest_pixmap_priv, ®ion, force_clip, x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height); else ok = glamor_composite_clipped_region(op, source, mask, dest, source_pixmap_priv, mask_pixmap_priv, dest_pixmap_priv, ®ion, x_source, y_source, x_mask, y_mask, x_dest, y_dest); REGION_UNINIT(dest->pDrawable->pScreen, ®ion); if (ok) goto done; fail: if (!fallback && glamor_ddx_fallback_check_pixmap(&dest_pixmap->drawable) && (!source_pixmap || glamor_ddx_fallback_check_pixmap(&source_pixmap->drawable)) && (!mask_pixmap || glamor_ddx_fallback_check_pixmap(&mask_pixmap->drawable))) { ret = FALSE; goto done; } glamor_fallback ("from picts %p:%p %dx%d / %p:%p %d x %d (%c,%c) to pict %p:%p %dx%d (%c)\n", source, source->pDrawable, source->pDrawable ? source->pDrawable->width : 0, source->pDrawable ? source->pDrawable->height : 0, mask, (!mask) ? NULL : mask->pDrawable, (!mask || !mask->pDrawable) ? 0 : mask->pDrawable->width, (!mask || !mask->pDrawable) ? 0 : mask-> pDrawable->height, glamor_get_picture_location(source), glamor_get_picture_location(mask), dest, dest->pDrawable, dest->pDrawable->width, dest->pDrawable->height, glamor_get_picture_location(dest)); if (glamor_prepare_access_picture_box(dest, GLAMOR_ACCESS_RW, x_dest, y_dest, width, height) && glamor_prepare_access_picture_box(source, GLAMOR_ACCESS_RO, x_source, y_source, width, height) && glamor_prepare_access_picture_box(mask, GLAMOR_ACCESS_RO, x_mask, y_mask, width, height)) { fbComposite(op, source, mask, dest, x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height); } glamor_finish_access_picture(mask); glamor_finish_access_picture(source); glamor_finish_access_picture(dest); done: return ret; } void glamor_composite(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, INT16 x_source, INT16 y_source, INT16 x_mask, INT16 y_mask, INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height) { _glamor_composite(op, source, mask, dest, x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height, TRUE); } Bool glamor_composite_nf(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, INT16 x_source, INT16 y_source, INT16 x_mask, INT16 y_mask, INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height) { return _glamor_composite(op, source, mask, dest, x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height, FALSE); } static void glamor_get_src_rect_extent(int nrect, glamor_composite_rect_t *rects, BoxPtr extent) { extent->x1 = MAXSHORT; extent->y1 = MAXSHORT; extent->x2 = MINSHORT; extent->y2 = MINSHORT; while (nrect--) { if (extent->x1 > rects->x_src) extent->x1 = rects->x_src; if (extent->y1 > rects->y_src) extent->y1 = rects->y_src; if (extent->x2 < rects->x_src + rects->width) extent->x2 = rects->x_src + rects->width; if (extent->y2 < rects->y_src + rects->height) extent->y2 = rects->y_src + rects->height; rects++; } } static void glamor_composite_src_rect_translate(int nrect, glamor_composite_rect_t *rects, int x, int y) { while (nrect--) { rects->x_src += x; rects->y_src += y; rects++; } } void glamor_composite_glyph_rects(CARD8 op, PicturePtr src, PicturePtr mask, PicturePtr dst, int nrect, glamor_composite_rect_t *rects) { int n; PicturePtr temp_src = NULL; glamor_composite_rect_t *r; ValidatePicture(src); ValidatePicture(dst); if (!(glamor_is_large_picture(src) || (mask && glamor_is_large_picture(mask)) || glamor_is_large_picture(dst))) { glamor_pixmap_private *src_pixmap_priv = NULL; glamor_pixmap_private *mask_pixmap_priv = NULL; glamor_pixmap_private *dst_pixmap_priv; glamor_pixmap_private *temp_src_priv = NULL; BoxRec src_extent; dst_pixmap_priv = glamor_get_pixmap_private (glamor_get_drawable_pixmap(dst->pDrawable)); if (mask && mask->pDrawable) mask_pixmap_priv = glamor_get_pixmap_private (glamor_get_drawable_pixmap(mask->pDrawable)); if (src->pDrawable) src_pixmap_priv = glamor_get_pixmap_private (glamor_get_drawable_pixmap(src->pDrawable)); if (!src->pDrawable && (src->pSourcePict->type != SourcePictTypeSolidFill)) { glamor_get_src_rect_extent(nrect, rects, &src_extent); temp_src = glamor_convert_gradient_picture(dst->pDrawable->pScreen, src, src_extent.x1, src_extent.y1, src_extent.x2 - src_extent.x1, src_extent.y2 - src_extent.y1); if (!temp_src) goto fallback; temp_src_priv = glamor_get_pixmap_private ((PixmapPtr) (temp_src->pDrawable)); glamor_composite_src_rect_translate(nrect, rects, -src_extent.x1, -src_extent.y1); } else { temp_src = src; temp_src_priv = src_pixmap_priv; } if (mask && mask->componentAlpha) { if (op == PictOpOver) { if (glamor_composite_with_shader(PictOpOutReverse, temp_src, mask, dst, temp_src_priv, mask_pixmap_priv, dst_pixmap_priv, nrect, rects, TRUE)) goto done; } } else { if (glamor_composite_with_shader (op, temp_src, mask, dst, temp_src_priv, mask_pixmap_priv, dst_pixmap_priv, nrect, rects, FALSE)) goto done; } } fallback: n = nrect; r = rects; while (n--) { CompositePicture(op, temp_src ? temp_src : src, mask, dst, r->x_src, r->y_src, r->x_mask, r->y_mask, r->x_dst, r->y_dst, r->width, r->height); r++; } done: if (temp_src && temp_src != src) FreePicture(temp_src, 0); } static Bool _glamor_composite_rects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, xRectangle *rects, Bool fallback) { miCompositeRects(op, pDst, color, nRect, rects); return TRUE; } void glamor_composite_rects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, xRectangle *rects) { _glamor_composite_rects(op, pDst, color, nRect, rects, TRUE); } Bool glamor_composite_rects_nf(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, xRectangle *rects) { return _glamor_composite_rects(op, pDst, color, nRect, rects, FALSE); } #endif /* RENDER */ xorg-server-1.17.1/glamor/glamor_xv.c0000664000175100017510000004334512460362577014461 00000000000000/* * Copyright © 2013 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 (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Dave Airlie * * some code is derived from the xf86-video-ati radeon driver, mainly * the calculations. */ /** @file glamor_xv.c * * Xv acceleration implementation */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glamor_priv.h" #include #include "../hw/xfree86/common/fourcc.h" /* Reference color space transform data */ typedef struct tagREF_TRANSFORM { float RefLuma; float RefRCb; float RefRCr; float RefGCb; float RefGCr; float RefBCb; float RefBCr; } REF_TRANSFORM; #define RTFSaturation(a) (1.0 + ((a)*1.0)/1000.0) #define RTFBrightness(a) (((a)*1.0)/2000.0) #define RTFIntensity(a) (((a)*1.0)/2000.0) #define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0) #define RTFHue(a) (((a)*3.1416)/1000.0) static const char *xv_vs = "attribute vec4 v_position;\n" "attribute vec4 v_texcoord0;\n" "varying vec2 tcs;\n" "void main()\n" "{\n" " gl_Position = v_position;\n" "tcs = v_texcoord0.xy;\n" "}\n"; static const char *xv_ps = GLAMOR_DEFAULT_PRECISION "uniform sampler2D y_sampler;\n" "uniform sampler2D u_sampler;\n" "uniform sampler2D v_sampler;\n" "uniform vec4 offsetyco;\n" "uniform vec4 ucogamma;\n" "uniform vec4 vco;\n" "varying vec2 tcs;\n" "float sample;\n" "vec4 temp1;\n" "void main()\n" "{\n" "sample = texture2D(y_sampler, tcs).w;\n" "temp1.xyz = offsetyco.www * vec3(sample) + offsetyco.xyz;\n" "sample = texture2D(u_sampler, tcs).w;\n" "temp1.xyz = ucogamma.xyz * vec3(sample) + temp1.xyz;\n" "sample = texture2D(v_sampler, tcs).w;\n" "temp1.xyz = clamp(vco.xyz * vec3(sample) + temp1.xyz, 0.0, 1.0);\n" "temp1.w = 1.0;\n" "gl_FragColor = temp1;\n" "}\n"; #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) XvAttributeRec glamor_xv_attributes[] = { {XvSettable | XvGettable, -1000, 1000, (char *)"XV_BRIGHTNESS"}, {XvSettable | XvGettable, -1000, 1000, (char *)"XV_CONTRAST"}, {XvSettable | XvGettable, -1000, 1000, (char *)"XV_SATURATION"}, {XvSettable | XvGettable, -1000, 1000, (char *)"XV_HUE"}, {XvSettable | XvGettable, 0, 1, (char *)"XV_COLORSPACE"}, {0, 0, 0, NULL} }; int glamor_xv_num_attributes = ARRAY_SIZE(glamor_xv_attributes) - 1; Atom glamorBrightness, glamorContrast, glamorSaturation, glamorHue, glamorColorspace, glamorGamma; XvImageRec glamor_xv_images[] = { XVIMAGE_YV12, XVIMAGE_I420, }; int glamor_xv_num_images = ARRAY_SIZE(glamor_xv_images); static void glamor_init_xv_shader(ScreenPtr screen) { glamor_screen_private *glamor_priv; GLint fs_prog, vs_prog; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glamor_priv->xv_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, xv_vs); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, xv_ps); glAttachShader(glamor_priv->xv_prog, vs_prog); glAttachShader(glamor_priv->xv_prog, fs_prog); glBindAttribLocation(glamor_priv->xv_prog, GLAMOR_VERTEX_POS, "v_position"); glBindAttribLocation(glamor_priv->xv_prog, GLAMOR_VERTEX_SOURCE, "v_texcoord0"); glamor_link_glsl_prog(screen, glamor_priv->xv_prog, "xv"); } #define ClipValue(v,min,max) ((v) < (min) ? (min) : (v) > (max) ? (max) : (v)) void glamor_xv_stop_video(glamor_port_private *port_priv) { } static void glamor_xv_free_port_data(glamor_port_private *port_priv) { int i; for (i = 0; i < 3; i++) { if (port_priv->src_pix[i]) { glamor_destroy_pixmap(port_priv->src_pix[i]); port_priv->src_pix[i] = NULL; } } RegionUninit(&port_priv->clip); RegionNull(&port_priv->clip); } int glamor_xv_set_port_attribute(glamor_port_private *port_priv, Atom attribute, INT32 value) { if (attribute == glamorBrightness) port_priv->brightness = ClipValue(value, -1000, 1000); else if (attribute == glamorHue) port_priv->hue = ClipValue(value, -1000, 1000); else if (attribute == glamorContrast) port_priv->contrast = ClipValue(value, -1000, 1000); else if (attribute == glamorSaturation) port_priv->saturation = ClipValue(value, -1000, 1000); else if (attribute == glamorGamma) port_priv->gamma = ClipValue(value, 100, 10000); else if (attribute == glamorColorspace) port_priv->transform_index = ClipValue(value, 0, 1); else return BadMatch; return Success; } int glamor_xv_get_port_attribute(glamor_port_private *port_priv, Atom attribute, INT32 *value) { if (attribute == glamorBrightness) *value = port_priv->brightness; else if (attribute == glamorHue) *value = port_priv->hue; else if (attribute == glamorContrast) *value = port_priv->contrast; else if (attribute == glamorSaturation) *value = port_priv->saturation; else if (attribute == glamorGamma) *value = port_priv->gamma; else if (attribute == glamorColorspace) *value = port_priv->transform_index; else return BadMatch; return Success; } int glamor_xv_query_image_attributes(int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets) { int size = 0, tmp; if (offsets) offsets[0] = 0; switch (id) { case FOURCC_YV12: case FOURCC_I420: *h = ALIGN(*h, 2); size = ALIGN(*w, 4); if (pitches) pitches[0] = size; size *= *h; if (offsets) offsets[1] = size; tmp = ALIGN(*w >> 1, 4); if (pitches) pitches[1] = pitches[2] = tmp; tmp *= (*h >> 1); size += tmp; if (offsets) offsets[2] = size; size += tmp; break; } return size; } /* Parameters for ITU-R BT.601 and ITU-R BT.709 colour spaces note the difference to the parameters used in overlay are due to 10bit vs. float calcs */ static REF_TRANSFORM trans[2] = { {1.1643, 0.0, 1.5960, -0.3918, -0.8129, 2.0172, 0.0}, /* BT.601 */ {1.1643, 0.0, 1.7927, -0.2132, -0.5329, 2.1124, 0.0} /* BT.709 */ }; void glamor_xv_render(glamor_port_private *port_priv) { ScreenPtr screen = port_priv->pPixmap->drawable.pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(port_priv->pPixmap); glamor_pixmap_private *src_pixmap_priv[3]; float vertices[32], texcoords[8]; BoxPtr box = REGION_RECTS(&port_priv->clip); int nBox = REGION_NUM_RECTS(&port_priv->clip); int dst_x_off, dst_y_off; GLfloat dst_xscale, dst_yscale; GLfloat src_xscale[3], src_yscale[3]; int i; const float Loff = -0.0627; const float Coff = -0.502; float uvcosf, uvsinf; float yco; float uco[3], vco[3], off[3]; float bright, cont, gamma; int ref = port_priv->transform_index; GLint uloc, sampler_loc; if (!glamor_priv->xv_prog) glamor_init_xv_shader(screen); cont = RTFContrast(port_priv->contrast); bright = RTFBrightness(port_priv->brightness); gamma = (float) port_priv->gamma / 1000.0; uvcosf = RTFSaturation(port_priv->saturation) * cos(RTFHue(port_priv->hue)); uvsinf = RTFSaturation(port_priv->saturation) * sin(RTFHue(port_priv->hue)); /* overlay video also does pre-gamma contrast/sat adjust, should we? */ yco = trans[ref].RefLuma * cont; uco[0] = -trans[ref].RefRCr * uvsinf; uco[1] = trans[ref].RefGCb * uvcosf - trans[ref].RefGCr * uvsinf; uco[2] = trans[ref].RefBCb * uvcosf; vco[0] = trans[ref].RefRCr * uvcosf; vco[1] = trans[ref].RefGCb * uvsinf + trans[ref].RefGCr * uvcosf; vco[2] = trans[ref].RefBCb * uvsinf; off[0] = Loff * yco + Coff * (uco[0] + vco[0]) + bright; off[1] = Loff * yco + Coff * (uco[1] + vco[1]) + bright; off[2] = Loff * yco + Coff * (uco[2] + vco[2]) + bright; gamma = 1.0; pixmap_priv_get_dest_scale(pixmap_priv, &dst_xscale, &dst_yscale); glamor_get_drawable_deltas(port_priv->pDraw, port_priv->pPixmap, &dst_x_off, &dst_y_off); glamor_set_destination_pixmap_priv_nc(pixmap_priv); for (i = 0; i < 3; i++) { if (port_priv->src_pix[i]) { src_pixmap_priv[i] = glamor_get_pixmap_private(port_priv->src_pix[i]); pixmap_priv_get_scale(src_pixmap_priv[i], &src_xscale[i], &src_yscale[i]); } } glamor_make_current(glamor_priv); glUseProgram(glamor_priv->xv_prog); uloc = glGetUniformLocation(glamor_priv->xv_prog, "offsetyco"); glUniform4f(uloc, off[0], off[1], off[2], yco); uloc = glGetUniformLocation(glamor_priv->xv_prog, "ucogamma"); glUniform4f(uloc, uco[0], uco[1], uco[2], gamma); uloc = glGetUniformLocation(glamor_priv->xv_prog, "vco"); glUniform4f(uloc, vco[0], vco[1], vco[2], 0); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[0]->base.fbo->tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[1]->base.fbo->tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[2]->base.fbo->tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); sampler_loc = glGetUniformLocation(glamor_priv->xv_prog, "y_sampler"); glUniform1i(sampler_loc, 0); sampler_loc = glGetUniformLocation(glamor_priv->xv_prog, "u_sampler"); glUniform1i(sampler_loc, 1); sampler_loc = glGetUniformLocation(glamor_priv->xv_prog, "v_sampler"); glUniform1i(sampler_loc, 2); glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), texcoords); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), vertices); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glEnable(GL_SCISSOR_TEST); for (i = 0; i < nBox; i++) { float off_x = box[i].x1 - port_priv->drw_x; float off_y = box[i].y1 - port_priv->drw_y; float diff_x = (float) port_priv->src_w / (float) port_priv->dst_w; float diff_y = (float) port_priv->src_h / (float) port_priv->dst_h; float srcx, srcy, srcw, srch; int dstx, dsty, dstw, dsth; dstx = box[i].x1 + dst_x_off; dsty = box[i].y1 + dst_y_off; dstw = box[i].x2 - box[i].x1; dsth = box[i].y2 - box[i].y1; srcx = port_priv->src_x + off_x * diff_x; srcy = port_priv->src_y + off_y * diff_y; srcw = (port_priv->src_w * dstw) / (float) port_priv->dst_w; srch = (port_priv->src_h * dsth) / (float) port_priv->dst_h; glamor_set_normalize_vcoords(pixmap_priv, dst_xscale, dst_yscale, dstx - dstw, dsty, dstx + dstw, dsty + dsth * 2, vertices); glamor_set_normalize_tcoords(src_pixmap_priv[0], src_xscale[0], src_yscale[0], srcx - srcw, srcy, srcx + srcw, srcy + srch * 2, texcoords); glScissor(dstx, dsty, dstw, dsth); glDrawArrays(GL_TRIANGLE_FAN, 0, 3); } glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); DamageDamageRegion(port_priv->pDraw, &port_priv->clip); glamor_xv_free_port_data(port_priv); } int glamor_xv_put_image(glamor_port_private *port_priv, DrawablePtr pDrawable, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, unsigned char *buf, short width, short height, Bool sync, RegionPtr clipBoxes) { ScreenPtr pScreen = pDrawable->pScreen; int srcPitch, srcPitch2; int top, nlines; int s2offset, s3offset, tmp; s2offset = s3offset = srcPitch2 = 0; if (!port_priv->src_pix[0] || (width != port_priv->src_pix_w || height != port_priv->src_pix_h)) { int i; for (i = 0; i < 3; i++) if (port_priv->src_pix[i]) glamor_destroy_pixmap(port_priv->src_pix[i]); port_priv->src_pix[0] = glamor_create_pixmap(pScreen, width, height, 8, 0); port_priv->src_pix[1] = glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0); port_priv->src_pix[2] = glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0); port_priv->src_pix_w = width; port_priv->src_pix_h = height; if (!port_priv->src_pix[0] || !port_priv->src_pix[1] || !port_priv->src_pix[2]) return BadAlloc; } top = (src_y) & ~1; nlines = (src_y + src_h) - top; switch (id) { case FOURCC_YV12: case FOURCC_I420: srcPitch = ALIGN(width, 4); srcPitch2 = ALIGN(width >> 1, 4); s2offset = srcPitch * height; s3offset = s2offset + (srcPitch2 * ((height + 1) >> 1)); s2offset += ((top >> 1) * srcPitch2); s3offset += ((top >> 1) * srcPitch2); if (id == FOURCC_YV12) { tmp = s2offset; s2offset = s3offset; s3offset = tmp; } glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[0], 0, 0, width, nlines, srcPitch, buf + (top * srcPitch), 0); glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[1], 0, 0, width >> 1, (nlines + 1) >> 1, srcPitch2, buf + s2offset, 0); glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[2], 0, 0, width >> 1, (nlines + 1) >> 1, srcPitch2, buf + s3offset, 0); break; default: return BadMatch; } if (pDrawable->type == DRAWABLE_WINDOW) port_priv->pPixmap = pScreen->GetWindowPixmap((WindowPtr) pDrawable); else port_priv->pPixmap = (PixmapPtr) pDrawable; RegionCopy(&port_priv->clip, clipBoxes); port_priv->src_x = src_x; port_priv->src_y = src_y; port_priv->src_w = src_w; port_priv->src_h = src_h; port_priv->dst_w = drw_w; port_priv->dst_h = drw_h; port_priv->drw_x = drw_x; port_priv->drw_y = drw_y; port_priv->w = width; port_priv->h = height; port_priv->pDraw = pDrawable; glamor_xv_render(port_priv); return Success; } void glamor_xv_init_port(glamor_port_private *port_priv) { port_priv->brightness = 0; port_priv->contrast = 0; port_priv->saturation = 0; port_priv->hue = 0; port_priv->gamma = 1000; port_priv->transform_index = 0; REGION_NULL(pScreen, &port_priv->clip); } void glamor_xv_core_init(ScreenPtr screen) { glamorBrightness = MAKE_ATOM("XV_BRIGHTNESS"); glamorContrast = MAKE_ATOM("XV_CONTRAST"); glamorSaturation = MAKE_ATOM("XV_SATURATION"); glamorHue = MAKE_ATOM("XV_HUE"); glamorGamma = MAKE_ATOM("XV_GAMMA"); glamorColorspace = MAKE_ATOM("XV_COLORSPACE"); } xorg-server-1.17.1/glamor/glamor_compositerects.c0000664000175100017510000002067012460362577017063 00000000000000/* * Copyright © 2009 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * * original author is Chris Wilson at sna. * */ #include "glamor_priv.h" #include "mipict.h" #include "damage.h" /** @file glamor_compositerects. * * compositeRects acceleration implementation */ static int16_t bound(int16_t a, uint16_t b) { int v = (int) a + (int) b; if (v > MAXSHORT) return MAXSHORT; return v; } static Bool _pixman_region_init_clipped_rectangles(pixman_region16_t * region, unsigned int num_rects, xRectangle *rects, int tx, int ty, BoxPtr extents) { pixman_box16_t stack_boxes[64], *boxes = stack_boxes; pixman_bool_t ret; unsigned int i, j; if (num_rects > ARRAY_SIZE(stack_boxes)) { boxes = malloc(sizeof(pixman_box16_t) * num_rects); if (boxes == NULL) return FALSE; } for (i = j = 0; i < num_rects; i++) { boxes[j].x1 = rects[i].x + tx; if (boxes[j].x1 < extents->x1) boxes[j].x1 = extents->x1; boxes[j].y1 = rects[i].y + ty; if (boxes[j].y1 < extents->y1) boxes[j].y1 = extents->y1; boxes[j].x2 = bound(rects[i].x + tx, rects[i].width); if (boxes[j].x2 > extents->x2) boxes[j].x2 = extents->x2; boxes[j].y2 = bound(rects[i].y + ty, rects[i].height); if (boxes[j].y2 > extents->y2) boxes[j].y2 = extents->y2; if (boxes[j].x2 > boxes[j].x1 && boxes[j].y2 > boxes[j].y1) j++; } ret = FALSE; if (j) ret = pixman_region_init_rects(region, boxes, j); if (boxes != stack_boxes) free(boxes); DEBUGF("%s: nrects=%d, region=(%d, %d), (%d, %d) x %d\n", __FUNCTION__, num_rects, region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, j); return ret; } void glamor_composite_rectangles(CARD8 op, PicturePtr dst, xRenderColor * color, int num_rects, xRectangle *rects) { PixmapPtr pixmap; struct glamor_pixmap_private *priv; pixman_region16_t region; pixman_box16_t *boxes; int dst_x, dst_y; int num_boxes; PicturePtr source = NULL; Bool need_free_region = FALSE; DEBUGF("%s(op=%d, %08x x %d [(%d, %d)x(%d, %d) ...])\n", __FUNCTION__, op, (color->alpha >> 8 << 24) | (color->red >> 8 << 16) | (color->green >> 8 << 8) | (color->blue >> 8 << 0), num_rects, rects[0].x, rects[0].y, rects[0].width, rects[0].height); if (!num_rects) return; if (RegionNil(dst->pCompositeClip)) { DEBUGF("%s: empty clip, skipping\n", __FUNCTION__); return; } if ((color->red | color->green | color->blue | color->alpha) <= 0x00ff) { switch (op) { case PictOpOver: case PictOpOutReverse: case PictOpAdd: return; case PictOpInReverse: case PictOpSrc: op = PictOpClear; break; case PictOpAtopReverse: op = PictOpOut; break; case PictOpXor: op = PictOpOverReverse; break; } } if (color->alpha <= 0x00ff) { switch (op) { case PictOpOver: case PictOpOutReverse: return; case PictOpInReverse: op = PictOpClear; break; case PictOpAtopReverse: op = PictOpOut; break; case PictOpXor: op = PictOpOverReverse; break; } } else if (color->alpha >= 0xff00) { switch (op) { case PictOpOver: op = PictOpSrc; break; case PictOpInReverse: return; case PictOpOutReverse: op = PictOpClear; break; case PictOpAtopReverse: op = PictOpOverReverse; break; case PictOpXor: op = PictOpOut; break; } } DEBUGF("%s: converted to op %d\n", __FUNCTION__, op); if (!_pixman_region_init_clipped_rectangles(®ion, num_rects, rects, dst->pDrawable->x, dst->pDrawable->y, &dst->pCompositeClip->extents)) { DEBUGF("%s: allocation failed for region\n", __FUNCTION__); return; } pixmap = glamor_get_drawable_pixmap(dst->pDrawable); priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) goto fallback; if (dst->alphaMap) { DEBUGF("%s: fallback, dst has an alpha-map\n", __FUNCTION__); goto fallback; } need_free_region = TRUE; DEBUGF("%s: drawable extents (%d, %d),(%d, %d) x %d\n", __FUNCTION__, RegionExtents(®ion)->x1, RegionExtents(®ion)->y1, RegionExtents(®ion)->x2, RegionExtents(®ion)->y2, RegionNumRects(®ion)); if (dst->pCompositeClip->data && (!pixman_region_intersect(®ion, ®ion, dst->pCompositeClip) || RegionNil(®ion))) { DEBUGF("%s: zero-intersection between rectangles and clip\n", __FUNCTION__); pixman_region_fini(®ion); return; } DEBUGF("%s: clipped extents (%d, %d),(%d, %d) x %d\n", __FUNCTION__, RegionExtents(®ion)->x1, RegionExtents(®ion)->y1, RegionExtents(®ion)->x2, RegionExtents(®ion)->y2, RegionNumRects(®ion)); glamor_get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y); pixman_region_translate(®ion, dst_x, dst_y); DEBUGF("%s: pixmap +(%d, %d) extents (%d, %d),(%d, %d)\n", __FUNCTION__, dst_x, dst_y, RegionExtents(®ion)->x1, RegionExtents(®ion)->y1, RegionExtents(®ion)->x2, RegionExtents(®ion)->y2); boxes = pixman_region_rectangles(®ion, &num_boxes); if (op == PictOpSrc || op == PictOpClear) { CARD32 pixel; if (op == PictOpClear) pixel = 0; else miRenderColorToPixel(dst->pFormat, color, &pixel); glamor_solid_boxes(pixmap, boxes, num_boxes, pixel); goto done; } else { if (_X_LIKELY(priv->type != GLAMOR_TEXTURE_LARGE)) { int error; source = CreateSolidPicture(0, color, &error); if (!source) goto done; if (glamor_composite_clipped_region(op, source, NULL, dst, NULL, NULL, priv, ®ion, 0, 0, 0, 0, 0, 0)) goto done; } } fallback: miCompositeRects(op, dst, color, num_rects, rects); done: /* XXX xserver-1.8: CompositeRects is not tracked by Damage, so we must * manually append the damaged regions ourselves. */ DamageRegionAppend(&pixmap->drawable, ®ion); DamageRegionProcessPending(&pixmap->drawable); if (need_free_region) pixman_region_fini(®ion); if (source) FreePicture(source, 0); return; } xorg-server-1.17.1/glamor/glamor_rects.c0000664000175100017510000001505212460362577015136 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_program.h" #include "glamor_transform.h" static const glamor_facet glamor_facet_polyfillrect_130 = { .name = "poly_fill_rect", .version = 130, .vs_vars = "attribute vec4 primitive;\n", .vs_exec = (" vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" GLAMOR_POS(gl_Position, (primitive.xy + pos))), }; static const glamor_facet glamor_facet_polyfillrect_120 = { .name = "poly_fill_rect", .vs_vars = "attribute vec2 primitive;\n", .vs_exec = (" vec2 pos = vec2(0,0);\n" GLAMOR_POS(gl_Position, primitive.xy)), }; static Bool glamor_poly_fill_rect_gl(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; glamor_program *prog; int off_x, off_y; GLshort *v; char *vbo_offset; int box_x, box_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; glamor_make_current(glamor_priv); if (glamor_priv->glsl_version >= 130) { prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_fill_rect_program, &glamor_facet_polyfillrect_130); if (!prog) goto bail_ctx; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, nrect * sizeof (xRectangle), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribDivisor(GLAMOR_VERTEX_POS, 1); glVertexAttribPointer(GLAMOR_VERTEX_POS, 4, GL_SHORT, GL_FALSE, 4 * sizeof (short), vbo_offset); memcpy(v, prect, nrect * sizeof (xRectangle)); glamor_put_vbo_space(screen); } else { int n; prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_fill_rect_program, &glamor_facet_polyfillrect_120); if (!prog) goto bail_ctx; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, nrect * 8 * sizeof (short), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 2 * sizeof (short), vbo_offset); for (n = 0; n < nrect; n++) { v[0] = prect->x; v[1] = prect->y; v[2] = prect->x; v[3] = prect->y + prect->height; v[4] = prect->x + prect->width; v[5] = prect->y + prect->height; v[6] = prect->x + prect->width; v[7] = prect->y; prect++; v += 8; } glamor_put_vbo_space(screen); } glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, FALSE, prog->matrix_uniform, &off_x, &off_y); while (nbox--) { glScissor(box->x1 + off_x, box->y1 + off_y, box->x2 - box->x1, box->y2 - box->y1); box++; if (glamor_priv->glsl_version >= 130) glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, nrect); else { if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { glDrawArrays(GL_QUADS, 0, nrect * 4); } else { int i; for (i = 0; i < nrect; i++) { glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4); } } } } } glDisable(GL_SCISSOR_TEST); glDisable(GL_COLOR_LOGIC_OP); if (glamor_priv->glsl_version >= 130) glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } static void glamor_poly_fill_rect_bail(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect) { glamor_fallback("to %p (%c)\n", drawable, glamor_get_drawable_location(drawable)); if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) && glamor_prepare_access_gc(gc)) { fbPolyFillRect(drawable, gc, nrect, prect); } glamor_finish_access_gc(gc); glamor_finish_access(drawable); } void glamor_poly_fill_rect(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect) { if (glamor_poly_fill_rect_gl(drawable, gc, nrect, prect)) return; glamor_poly_fill_rect_bail(drawable, gc, nrect, prect); } Bool glamor_poly_fill_rect_nf(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect) { if (glamor_poly_fill_rect_gl(drawable, gc, nrect, prect)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) return FALSE; glamor_poly_fill_rect_bail(drawable, gc, nrect, prect); return TRUE; } xorg-server-1.17.1/glamor/glamor_core.c0000664000175100017510000004213412460362577014747 00000000000000/* * Copyright © 2001 Keith Packard * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** @file glamor_core.c * * This file covers core X rendering in glamor. */ #include #include "glamor_priv.h" const Bool glamor_get_drawable_location(const DrawablePtr drawable) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); glamor_screen_private *glamor_priv = glamor_get_screen_private(drawable->pScreen); if (pixmap_priv == NULL || pixmap_priv->base.gl_fbo == GLAMOR_FBO_UNATTACHED) return 'm'; if (pixmap_priv->base.fbo->fb == glamor_priv->screen_fbo) return 's'; else return 'f'; } GLint glamor_compile_glsl_prog(GLenum type, const char *source) { GLint ok; GLint prog; prog = glCreateShader(type); glShaderSource(prog, 1, (const GLchar **) &source, NULL); glCompileShader(prog); glGetShaderiv(prog, GL_COMPILE_STATUS, &ok); if (!ok) { GLchar *info; GLint size; glGetShaderiv(prog, GL_INFO_LOG_LENGTH, &size); info = malloc(size); if (info) { glGetShaderInfoLog(prog, size, NULL, info); ErrorF("Failed to compile %s: %s\n", type == GL_FRAGMENT_SHADER ? "FS" : "VS", info); ErrorF("Program source:\n%s", source); free(info); } else ErrorF("Failed to get shader compilation info.\n"); FatalError("GLSL compile failure\n"); } return prog; } void glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...) { GLint ok; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glLinkProgram(prog); glGetProgramiv(prog, GL_LINK_STATUS, &ok); if (!ok) { GLchar *info; GLint size; glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &size); info = malloc(size); glGetProgramInfoLog(prog, size, NULL, info); ErrorF("Failed to link: %s\n", info); FatalError("GLSL link failure\n"); } if (glamor_priv->has_khr_debug) { char *label; va_list va; va_start(va, format); XNFvasprintf(&label, format, va); glObjectLabel(GL_PROGRAM, prog, -1, label); free(label); va_end(va); } } /* * When downloading a unsupported color format to CPU memory, we need to shuffle the color elements and then use a supported color format to read it back to CPU memory. For an example, the picture's format is PICT_b8g8r8a8, Then the expecting color layout is as below (little endian): 0 1 2 3 : address a r g b Now the in GLES2 the supported color format is GL_RGBA, type is GL_UNSIGNED_TYPE, then we need to shuffle the fragment color as : frag_color = sample(texture).argb; before we use glReadPixel to get it back. For the uploading process, the shuffle is a revert shuffle. We still use GL_RGBA, GL_UNSIGNED_BYTE to upload the color to a texture, then let's see 0 1 2 3 : address a r g b : correct colors R G B A : GL_RGBA with GL_UNSIGNED_BYTE Now we need to shuffle again, the mapping rule is r = G, g = B, b = A, a = R. Then the uploading shuffle is as below: frag_color = sample(texture).gbar; */ void glamor_init_finish_access_shaders(ScreenPtr screen) { glamor_screen_private *glamor_priv; const char *vs_source = "attribute vec4 v_position;\n" "attribute vec4 v_texcoord0;\n" "varying vec2 source_texture;\n" "void main()\n" "{\n" " gl_Position = v_position;\n" " source_texture = v_texcoord0.xy;\n" "}\n"; const char *common_source = GLAMOR_DEFAULT_PRECISION "varying vec2 source_texture;\n" "uniform sampler2D sampler;\n" "uniform int revert;\n" "uniform int swap_rb;\n" "#define REVERT_NONE 0\n" "#define REVERT_NORMAL 1\n" "#define SWAP_NONE_DOWNLOADING 0\n" "#define SWAP_DOWNLOADING 1\n" "#define SWAP_UPLOADING 2\n" "#define SWAP_NONE_UPLOADING 3\n"; const char *fs_source = "void main()\n" "{\n" " if (revert == REVERT_NONE) \n" " { \n" " if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING)) \n" " gl_FragColor = texture2D(sampler, source_texture).bgra;\n" " else \n" " gl_FragColor = texture2D(sampler, source_texture).rgba;\n" " } \n" " else \n" " { \n" " if (swap_rb == SWAP_DOWNLOADING) \n" " gl_FragColor = texture2D(sampler, source_texture).argb;\n" " else if (swap_rb == SWAP_NONE_DOWNLOADING)\n" " gl_FragColor = texture2D(sampler, source_texture).abgr;\n" " else if (swap_rb == SWAP_UPLOADING)\n" " gl_FragColor = texture2D(sampler, source_texture).gbar;\n" " else if (swap_rb == SWAP_NONE_UPLOADING)\n" " gl_FragColor = texture2D(sampler, source_texture).abgr;\n" " } \n" "}\n"; const char *set_alpha_source = "void main()\n" "{\n" " if (revert == REVERT_NONE) \n" " { \n" " if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING)) \n" " gl_FragColor = vec4(texture2D(sampler, source_texture).bgr, 1);\n" " else \n" " gl_FragColor = vec4(texture2D(sampler, source_texture).rgb, 1);\n" " } \n" " else \n" " { \n" " if (swap_rb == SWAP_DOWNLOADING) \n" " gl_FragColor = vec4(1, texture2D(sampler, source_texture).rgb);\n" " else if (swap_rb == SWAP_NONE_DOWNLOADING)\n" " gl_FragColor = vec4(1, texture2D(sampler, source_texture).bgr);\n" " else if (swap_rb == SWAP_UPLOADING)\n" " gl_FragColor = vec4(texture2D(sampler, source_texture).gba, 1);\n" " else if (swap_rb == SWAP_NONE_UPLOADING)\n" " gl_FragColor = vec4(texture2D(sampler, source_texture).abg, 1);\n" " } \n" "}\n"; GLint fs_prog, vs_prog, avs_prog, set_alpha_prog; GLint sampler_uniform_location; char *source; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glamor_priv->finish_access_prog[0] = glCreateProgram(); glamor_priv->finish_access_prog[1] = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source); XNFasprintf(&source, "%s%s", common_source, fs_source); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, source); free(source); glAttachShader(glamor_priv->finish_access_prog[0], vs_prog); glAttachShader(glamor_priv->finish_access_prog[0], fs_prog); avs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source); XNFasprintf(&source, "%s%s", common_source, set_alpha_source); set_alpha_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, source); free(source); glAttachShader(glamor_priv->finish_access_prog[1], avs_prog); glAttachShader(glamor_priv->finish_access_prog[1], set_alpha_prog); glBindAttribLocation(glamor_priv->finish_access_prog[0], GLAMOR_VERTEX_POS, "v_position"); glBindAttribLocation(glamor_priv->finish_access_prog[0], GLAMOR_VERTEX_SOURCE, "v_texcoord0"); glamor_link_glsl_prog(screen, glamor_priv->finish_access_prog[0], "finish access 0"); glBindAttribLocation(glamor_priv->finish_access_prog[1], GLAMOR_VERTEX_POS, "v_position"); glBindAttribLocation(glamor_priv->finish_access_prog[1], GLAMOR_VERTEX_SOURCE, "v_texcoord0"); glamor_link_glsl_prog(screen, glamor_priv->finish_access_prog[1], "finish access 1"); glamor_priv->finish_access_revert[0] = glGetUniformLocation(glamor_priv->finish_access_prog[0], "revert"); glamor_priv->finish_access_swap_rb[0] = glGetUniformLocation(glamor_priv->finish_access_prog[0], "swap_rb"); sampler_uniform_location = glGetUniformLocation(glamor_priv->finish_access_prog[0], "sampler"); glUseProgram(glamor_priv->finish_access_prog[0]); glUniform1i(sampler_uniform_location, 0); glUniform1i(glamor_priv->finish_access_revert[0], 0); glUniform1i(glamor_priv->finish_access_swap_rb[0], 0); glamor_priv->finish_access_revert[1] = glGetUniformLocation(glamor_priv->finish_access_prog[1], "revert"); glamor_priv->finish_access_swap_rb[1] = glGetUniformLocation(glamor_priv->finish_access_prog[1], "swap_rb"); sampler_uniform_location = glGetUniformLocation(glamor_priv->finish_access_prog[1], "sampler"); glUseProgram(glamor_priv->finish_access_prog[1]); glUniform1i(glamor_priv->finish_access_revert[1], 0); glUniform1i(sampler_uniform_location, 0); glUniform1i(glamor_priv->finish_access_swap_rb[1], 0); } void glamor_fini_finish_access_shaders(ScreenPtr screen) { glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); glDeleteProgram(glamor_priv->finish_access_prog[0]); glDeleteProgram(glamor_priv->finish_access_prog[1]); } GCOps glamor_gc_ops = { .FillSpans = glamor_fill_spans, .SetSpans = glamor_set_spans, .PutImage = glamor_put_image, .CopyArea = glamor_copy_area, .CopyPlane = glamor_copy_plane, .PolyPoint = glamor_poly_point, .Polylines = glamor_poly_lines, .PolySegment = glamor_poly_segment, .PolyRectangle = miPolyRectangle, .PolyArc = miPolyArc, .FillPolygon = miFillPolygon, .PolyFillRect = glamor_poly_fill_rect, .PolyFillArc = miPolyFillArc, .PolyText8 = glamor_poly_text8, .PolyText16 = glamor_poly_text16, .ImageText8 = glamor_image_text8, .ImageText16 = glamor_image_text16, .ImageGlyphBlt = miImageGlyphBlt, .PolyGlyphBlt = glamor_poly_glyph_blt, .PushPixels = glamor_push_pixels, }; /* * When the stipple is changed or drawn to, invalidate any * cached copy */ static void glamor_invalidate_stipple(GCPtr gc) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); if (gc_priv->stipple) { if (gc_priv->stipple_damage) DamageUnregister(gc_priv->stipple_damage); glamor_destroy_pixmap(gc_priv->stipple); gc_priv->stipple = NULL; } } static void glamor_stipple_damage_report(DamagePtr damage, RegionPtr region, void *closure) { GCPtr gc = closure; glamor_invalidate_stipple(gc); } static void glamor_stipple_damage_destroy(DamagePtr damage, void *closure) { GCPtr gc = closure; glamor_gc_private *gc_priv = glamor_get_gc_private(gc); gc_priv->stipple_damage = NULL; glamor_invalidate_stipple(gc); } void glamor_track_stipple(GCPtr gc) { if (gc->stipple) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); if (!gc_priv->stipple_damage) gc_priv->stipple_damage = DamageCreate(glamor_stipple_damage_report, glamor_stipple_damage_destroy, DamageReportNonEmpty, TRUE, gc->pScreen, gc); if (gc_priv->stipple_damage) DamageRegister(&gc->stipple->drawable, gc_priv->stipple_damage); } } /** * uxa_validate_gc() sets the ops to glamor's implementations, which may be * accelerated or may sync the card and fall back to fb. */ void glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable) { /* fbValidateGC will do direct access to pixmaps if the tiling has changed. * Preempt fbValidateGC by doing its work and masking the change out, so * that we can do the Prepare/finish_access. */ #ifdef FB_24_32BIT if ((changes & GCTile) && fbGetRotatedPixmap(gc)) { gc->pScreen->DestroyPixmap(fbGetRotatedPixmap(gc)); fbGetRotatedPixmap(gc) = 0; } if (gc->fillStyle == FillTiled) { PixmapPtr old_tile, new_tile; old_tile = gc->tile.pixmap; if (old_tile->drawable.bitsPerPixel != drawable->bitsPerPixel) { new_tile = fbGetRotatedPixmap(gc); if (!new_tile || new_tile->drawable.bitsPerPixel != drawable->bitsPerPixel) { if (new_tile) gc->pScreen->DestroyPixmap(new_tile); /* fb24_32ReformatTile will do direct access of a newly- * allocated pixmap. */ glamor_fallback ("GC %p tile FB_24_32 transformat %p.\n", gc, old_tile); if (glamor_prepare_access (&old_tile->drawable, GLAMOR_ACCESS_RO)) { new_tile = fb24_32ReformatTile(old_tile, drawable->bitsPerPixel); glamor_finish_access(&old_tile->drawable); } } if (new_tile) { fbGetRotatedPixmap(gc) = old_tile; gc->tile.pixmap = new_tile; changes |= GCTile; } } } #endif if (changes & GCTile) { if (!gc->tileIsPixel) { glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(gc->tile.pixmap); if ((!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) && FbEvenTile(gc->tile.pixmap->drawable.width * drawable->bitsPerPixel)) { glamor_fallback ("GC %p tile changed %p.\n", gc, gc->tile.pixmap); if (glamor_prepare_access (&gc->tile.pixmap->drawable, GLAMOR_ACCESS_RW)) { fbPadPixmap(gc->tile.pixmap); glamor_finish_access(&gc->tile.pixmap->drawable); } } } /* Mask out the GCTile change notification, now that we've done FB's * job for it. */ changes &= ~GCTile; } if (changes & GCStipple) glamor_invalidate_stipple(gc); if (changes & GCStipple && gc->stipple) { /* We can't inline stipple handling like we do for GCTile because * it sets fbgc privates. */ if (glamor_prepare_access(&gc->stipple->drawable, GLAMOR_ACCESS_RW)) { fbValidateGC(gc, changes, drawable); glamor_finish_access(&gc->stipple->drawable); } } else { fbValidateGC(gc, changes, drawable); } if (changes & GCDashList) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); if (gc_priv->dash) { glamor_destroy_pixmap(gc_priv->dash); gc_priv->dash = NULL; } } gc->ops = &glamor_gc_ops; } void glamor_destroy_gc(GCPtr gc) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); if (gc_priv->dash) { glamor_destroy_pixmap(gc_priv->dash); gc_priv->dash = NULL; } glamor_invalidate_stipple(gc); if (gc_priv->stipple_damage) DamageDestroy(gc_priv->stipple_damage); miDestroyGC(gc); } static GCFuncs glamor_gc_funcs = { glamor_validate_gc, miChangeGC, miCopyGC, glamor_destroy_gc, miChangeClip, miDestroyClip, miCopyClip }; /** * exaCreateGC makes a new GC and hooks up its funcs handler, so that * exaValidateGC() will get called. */ int glamor_create_gc(GCPtr gc) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); gc_priv->dash = NULL; gc_priv->stipple = NULL; if (!fbCreateGC(gc)) return FALSE; gc->funcs = &glamor_gc_funcs; return TRUE; } RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap) { RegionPtr ret; glamor_fallback("pixmap %p \n", pixmap); if (!glamor_prepare_access(&pixmap->drawable, GLAMOR_ACCESS_RO)) return NULL; ret = fbPixmapToRegion(pixmap); glamor_finish_access(&pixmap->drawable); return ret; } xorg-server-1.17.1/glamor/glamor.h0000664000175100017510000005102712462701171013732 00000000000000/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * Zhigang Gong * */ #ifndef GLAMOR_H #define GLAMOR_H #include #include #include #include #include #include #ifdef GLAMOR_FOR_XORG #include #endif struct glamor_context; /* * glamor_pixmap_type : glamor pixmap's type. * @MEMORY: pixmap is in memory. * @TEXTURE_DRM: pixmap is in a texture created from a DRM buffer. * @SEPARATE_TEXTURE: The texture is created from a DRM buffer, but * the format is incompatible, so this type of pixmap * will never fallback to DDX layer. * @DRM_ONLY: pixmap is in a external DRM buffer. * @TEXTURE_ONLY: pixmap is in an internal texture. */ typedef enum glamor_pixmap_type { GLAMOR_MEMORY, GLAMOR_MEMORY_MAP, GLAMOR_TEXTURE_DRM, GLAMOR_SEPARATE_TEXTURE, GLAMOR_DRM_ONLY, GLAMOR_TEXTURE_ONLY, GLAMOR_TEXTURE_LARGE, GLAMOR_TEXTURE_PACK } glamor_pixmap_type_t; #define GLAMOR_EGL_EXTERNAL_BUFFER 3 #define GLAMOR_INVERTED_Y_AXIS 1 /* compat stub */ #define GLAMOR_USE_SCREEN (1 << 1) #define GLAMOR_USE_PICTURE_SCREEN (1 << 2) #define GLAMOR_USE_EGL_SCREEN (1 << 3) #define GLAMOR_NO_DRI3 (1 << 4) #define GLAMOR_VALID_FLAGS (GLAMOR_INVERTED_Y_AXIS \ | GLAMOR_USE_SCREEN \ | GLAMOR_USE_PICTURE_SCREEN \ | GLAMOR_USE_EGL_SCREEN \ | GLAMOR_NO_DRI3) /* @glamor_init: Initialize glamor internal data structure. * * @screen: Current screen pointer. * @flags: Please refer the flags description above. * * @GLAMOR_USE_SCREEN: * If running in an pre-existing X environment, and the * gl context is GLX, then you should set this bit and * let the glamor to handle all the screen related * functions such as GC ops and CreatePixmap/DestroyPixmap. * * @GLAMOR_USE_PICTURE_SCREEN: * If don't use any other underlying DDX driver to handle * the picture related rendering functions, please set this * bit on. Otherwise, clear this bit. And then it is the DDX * driver's responsibility to determine how/when to jump to * glamor's picture compositing path. * * @GLAMOR_USE_EGL_SCREEN: * If you are using EGL layer, then please set this bit * on, otherwise, clear it. * * This function initializes necessary internal data structure * for glamor. And before calling into this function, the OpenGL * environment should be ready. Should be called before any real * glamor rendering or texture allocation functions. And should * be called after the DDX's screen initialization or at the last * step of the DDX's screen initialization. */ extern _X_EXPORT Bool glamor_init(ScreenPtr screen, unsigned int flags); extern _X_EXPORT void glamor_fini(ScreenPtr screen); /* This function is used to free the glamor private screen's * resources. If the DDX driver is not set GLAMOR_USE_SCREEN, * then, DDX need to call this function at proper stage, if * it is the xorg DDX driver,then it should be called at free * screen stage not the close screen stage. The reason is after * call to this function, the xorg DDX may need to destroy the * screen pixmap which must be a glamor pixmap and requires * the internal data structure still exist at that time. * Otherwise, the glamor internal structure will not be freed.*/ extern _X_EXPORT Bool glamor_close_screen(ScreenPtr screen); /* Let glamor to know the screen's fbo. The low level * driver should already assign a tex * to this pixmap through the set_pixmap_texture. */ extern _X_EXPORT void glamor_set_screen_pixmap(PixmapPtr screen_pixmap, PixmapPtr *back_pixmap); extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap); extern _X_EXPORT Bool glamor_glyphs_init(ScreenPtr pScreen); extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex); extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type); extern _X_EXPORT void glamor_destroy_textured_pixmap(PixmapPtr pixmap); extern _X_EXPORT void glamor_block_handler(ScreenPtr screen); extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, unsigned int usage); extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap); #define GLAMOR_CREATE_PIXMAP_CPU 0x100 #define GLAMOR_CREATE_PIXMAP_FIXUP 0x101 #define GLAMOR_CREATE_FBO_NO_FBO 0x103 #define GLAMOR_CREATE_PIXMAP_MAP 0x104 #define GLAMOR_CREATE_NO_LARGE 0x105 #define GLAMOR_CREATE_PIXMAP_NO_TEXTURE 0x106 /* @glamor_egl_exchange_buffers: Exchange the underlying buffers(KHR image,fbo). * * @front: front pixmap. * @back: back pixmap. * * Used by the DRI2 page flip. This function will exchange the KHR images and * fbos of the two pixmaps. * */ extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back); extern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back); /* The DDX is not supposed to call these three functions */ extern _X_EXPORT void glamor_enable_dri3(ScreenPtr screen); extern _X_EXPORT unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h); extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr, unsigned int, Bool, CARD16 *, CARD32 *); extern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap); extern _X_EXPORT void *glamor_egl_get_gbm_device(ScreenPtr screen); /* @glamor_supports_pixmap_import_export: Returns whether * glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and * glamor_pixmap_from_fd() are supported. * * @screen: Current screen pointer. * * To have DRI3 support enabled, glamor and glamor_egl need to be * initialized. glamor also has to be compiled with gbm support. * * The EGL layer needs to have the following extensions working: * * .EGL_KHR_gl_texture_2D_image * .EGL_EXT_image_dma_buf_import * */ extern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen); /* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap. * * @screen: Current screen pointer. * @pixmap: The pixmap from which we want the fd. * @stride, @size: Pointers to fill the stride and size of the * buffer associated to the fd. * * the pixmap and the buffer associated by the fd will share the same * content. * Returns the fd on success, -1 on error. * */ extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size); /** * @glamor_name_from_pixmap: Gets a gem name from a pixmap. * * @pixmap: The pixmap from which we want the gem name. * * the pixmap and the buffer associated by the gem name will share the * same content. This function can be used by the DDX to support DRI2, * and needs the same set of buffer export GL extensions as DRI3 * support. * * Returns the name on success, -1 on error. * */ extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size); /* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd. * * @screen: Current screen pointer. * @fd: The dma-buf fd to import. * @width: The width of the buffer. * @height: The height of the buffer. * @stride: The stride of the buffer. * @depth: The depth of the buffer. * @bpp: The number of bpp of the buffer. * * Returns a valid pixmap if the import succeeded, else NULL. * */ extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen, int fd, CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp); #ifdef GLAMOR_FOR_XORG #define GLAMOR_EGL_MODULE_NAME "glamoregl" /* @glamor_egl_init: Initialize EGL environment. * * @scrn: Current screen info pointer. * @fd: Current drm fd. * * This function creates and intialize EGL contexts. * Should be called from DDX's preInit function. * Return TRUE if success, otherwise return FALSE. * */ extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd); extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen); /* @glamor_egl_create_textured_screen: Create textured screen pixmap. * * @screen: screen pointer to be processed. * @handle: screen pixmap's BO handle. * @stride: screen pixmap's stride in bytes. * * This function is similar with the create_textured_pixmap. As the * screen pixmap is a special, we handle it separately in this function. */ extern _X_EXPORT Bool glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride); /* @glamor_egl_create_textured_screen_ext: * * extent one parameter to track the pointer of the DDX layer's back pixmap. * We need this pointer during the closing screen stage. As before back to * the DDX's close screen, we have to free all the glamor related resources. */ extern _X_EXPORT Bool glamor_egl_create_textured_screen_ext(ScreenPtr screen, int handle, int stride, PixmapPtr *back_pixmap); /* * @glamor_egl_create_textured_pixmap: Try to create a textured pixmap from * a BO handle. * * @pixmap: The pixmap need to be processed. * @handle: The BO's handle attached to this pixmap at DDX layer. * @stride: Stride in bytes for this pixmap. * * This function try to create a texture from the handle and attach * the texture to the pixmap , thus glamor can render to this pixmap * as well. Return true if successful, otherwise return FALSE. */ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride); /* * @glamor_egl_create_textured_pixmap_from_bo: Try to create a textured pixmap * from a gbm_bo. * * @pixmap: The pixmap need to be processed. * @bo: a pointer on a gbm_bo structure attached to this pixmap at DDX layer. * * This function is similar to glamor_egl_create_textured_pixmap. */ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo); #endif extern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx); extern _X_EXPORT void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap); extern _X_EXPORT int glamor_create_gc(GCPtr gc); extern _X_EXPORT void glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable); extern _X_EXPORT void glamor_destroy_gc(GCPtr gc); #define HAS_GLAMOR_DESTROY_GC 1 extern Bool _X_EXPORT glamor_change_window_attributes(WindowPtr pWin, unsigned long mask); extern void _X_EXPORT glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_region); /* Glamor rendering/drawing functions with XXX_nf. * nf means no fallback within glamor internal if possible. If glamor * fail to accelerate the operation, glamor will return a false, and the * caller need to implement fallback method. Return a true means the * rendering request get done successfully. */ extern _X_EXPORT Bool glamor_fill_spans_nf(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted); extern _X_EXPORT Bool glamor_poly_fill_rect_nf(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect); extern _X_EXPORT Bool glamor_put_image_nf(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int left_pad, int image_format, char *bits); extern _X_EXPORT Bool glamor_copy_n_to_n_nf(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT Bool glamor_copy_nf(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT Bool glamor_composite_nf(CARD8 op, PicturePtr source, PicturePtr mask, PicturePtr dest, INT16 x_source, INT16 y_source, INT16 x_mask, INT16 y_mask, INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height); extern _X_EXPORT Bool glamor_trapezoids_nf(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int ntrap, xTrapezoid *traps); extern _X_EXPORT Bool glamor_glyphs_nf(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs); extern _X_EXPORT Bool glamor_triangles_nf(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle *tris); extern _X_EXPORT void glamor_glyph_unrealize(ScreenPtr screen, GlyphPtr glyph); extern _X_EXPORT Bool glamor_set_spans_nf(DrawablePtr drawable, GCPtr gc, char *src, DDXPointPtr points, int *widths, int n, int sorted); extern _X_EXPORT Bool glamor_get_spans_nf(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst); extern _X_EXPORT Bool glamor_composite_rects_nf(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, xRectangle *rects); extern _X_EXPORT Bool glamor_get_image_nf(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); extern _X_EXPORT Bool glamor_add_traps_nf(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps); extern _X_EXPORT Bool glamor_copy_plane_nf(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long bitPlane, RegionPtr *pRegion); extern _X_EXPORT Bool glamor_image_glyph_blt_nf(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase); extern _X_EXPORT Bool glamor_poly_glyph_blt_nf(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyphBase); extern _X_EXPORT Bool glamor_push_pixels_nf(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y); extern _X_EXPORT Bool glamor_poly_point_nf(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt); extern _X_EXPORT Bool glamor_poly_segment_nf(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSeg); extern _X_EXPORT Bool glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points); extern _X_EXPORT Bool glamor_poly_text8_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars, int *final_pos); extern _X_EXPORT Bool glamor_poly_text16_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, unsigned short *chars, int *final_pos); extern _X_EXPORT Bool glamor_image_text8_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars); extern _X_EXPORT Bool glamor_image_text16_nf(DrawablePtr drawable, GCPtr gc, int x, int y, int count, unsigned short *chars); #define HAS_GLAMOR_TEXT 1 #ifdef GLAMOR_FOR_XORG extern _X_EXPORT XF86VideoAdaptorPtr glamor_xv_init(ScreenPtr pScreen, int num_texture_ports); #endif #endif /* GLAMOR_H */ xorg-server-1.17.1/glamor/glamor_addtraps.c0000664000175100017510000000415512460362577015622 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Zhigang Gong * */ #include "glamor_priv.h" static Bool _glamor_add_traps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps, Bool fallback) { if (!fallback && (!pPicture->pDrawable || glamor_ddx_fallback_check_pixmap(pPicture->pDrawable))) return FALSE; if (glamor_prepare_access_picture(pPicture, GLAMOR_ACCESS_RW)) { fbAddTraps(pPicture, x_off, y_off, ntrap, traps); } glamor_finish_access_picture(pPicture); return TRUE; } void glamor_add_traps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps) { _glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, TRUE); } Bool glamor_add_traps_nf(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps) { return _glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, FALSE); } xorg-server-1.17.1/glamor/Makefile.in0000664000175100017510000007640412466505430014357 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = glamor DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = libglamor_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libglamor_la_OBJECTS = glamor.lo glamor_copy.lo glamor_core.lo \ glamor_dash.lo glamor_font.lo glamor_glx.lo glamor_glyphs.lo \ glamor_image.lo glamor_lines.lo glamor_segs.lo \ glamor_render.lo glamor_gradient.lo glamor_prepare.lo \ glamor_program.lo glamor_rects.lo glamor_spans.lo \ glamor_text.lo glamor_transfer.lo glamor_transform.lo \ glamor_trapezoid.lo glamor_triangles.lo glamor_addtraps.lo \ glamor_glyphblt.lo glamor_points.lo glamor_pixmap.lo \ glamor_largepixmap.lo glamor_picture.lo glamor_vbo.lo \ glamor_window.lo glamor_fbo.lo glamor_compositerects.lo \ glamor_utils.lo glamor_xv.lo glamor_sync.lo libglamor_la_OBJECTS = $(am_libglamor_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 = libglamor_egl_stubs_la_LIBADD = am_libglamor_egl_stubs_la_OBJECTS = glamor_egl_stubs.lo libglamor_egl_stubs_la_OBJECTS = $(am_libglamor_egl_stubs_la_OBJECTS) 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 = $(libglamor_la_SOURCES) $(libglamor_egl_stubs_la_SOURCES) DIST_SOURCES = $(libglamor_la_SOURCES) \ $(libglamor_egl_stubs_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libglamor.la libglamor_egl_stubs.la libglamor_la_LIBADD = $(GLAMOR_LIBS) AM_CFLAGS = $(CWARNFLAGS) $(DIX_CFLAGS) $(GLAMOR_CFLAGS) libglamor_la_SOURCES = \ glamor.c \ glamor_context.h \ glamor_copy.c \ glamor_core.c \ glamor_dash.c \ glamor_debug.h \ glamor_font.c \ glamor_font.h \ glamor_glx.c \ glamor_glyphs.c \ glamor_image.c \ glamor_lines.c \ glamor_segs.c \ glamor_render.c \ glamor_gradient.c \ glamor_prepare.c \ glamor_prepare.h \ glamor_program.c \ glamor_program.h \ glamor_rects.c \ glamor_spans.c \ glamor_text.c \ glamor_transfer.c \ glamor_transfer.h \ glamor_transform.c \ glamor_transform.h \ glamor_trapezoid.c \ glamor_triangles.c\ glamor_addtraps.c\ glamor_glyphblt.c\ glamor_points.c\ glamor_priv.h\ glamor_pixmap.c\ glamor_largepixmap.c\ glamor_picture.c\ glamor_vbo.c \ glamor_window.c\ glamor_fbo.c\ glamor_compositerects.c\ glamor_utils.c\ glamor_utils.h\ glamor_xv.c \ glamor_sync.c \ glamor.h libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c sdk_HEADERS = glamor.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 glamor/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign glamor/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libglamor.la: $(libglamor_la_OBJECTS) $(libglamor_la_DEPENDENCIES) $(EXTRA_libglamor_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libglamor_la_OBJECTS) $(libglamor_la_LIBADD) $(LIBS) libglamor_egl_stubs.la: $(libglamor_egl_stubs_la_OBJECTS) $(libglamor_egl_stubs_la_DEPENDENCIES) $(EXTRA_libglamor_egl_stubs_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libglamor_egl_stubs_la_OBJECTS) $(libglamor_egl_stubs_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_addtraps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_compositerects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_copy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_dash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_egl_stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_fbo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_font.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_glx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_glyphblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_glyphs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_gradient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_largepixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_lines.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_picture.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_pixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_prepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_program.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_rects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_render.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_segs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_spans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_transfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_transform.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_trapezoid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_triangles.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_vbo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_xv.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/glamor/glamor_prepare.h0000664000175100017510000000354412424353351015452 00000000000000/* * Copyright © 2014 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. */ #ifndef _GLAMOR_PREPARE_H_ #define _GLAMOR_PREPARE_H_ Bool glamor_prepare_access(DrawablePtr drawable, glamor_access_t access); Bool glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, int x, int y, int w, int h); void glamor_finish_access(DrawablePtr drawable); Bool glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access); Bool glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access, int x, int y, int w, int h); void glamor_finish_access_picture(PicturePtr picture); Bool glamor_prepare_access_gc(GCPtr gc); void glamor_finish_access_gc(GCPtr gc); #endif /* _GLAMOR_PREPARE_H_ */ xorg-server-1.17.1/glamor/glamor_window.c0000664000175100017510000000700212460362577015321 00000000000000/* * Copyright © 2008 Intel Corporation * Copyright © 1998 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. */ #include "glamor_priv.h" /** @file glamor_window.c * * Screen Change Window Attribute implementation. */ static void glamor_fixup_window_pixmap(DrawablePtr pDrawable, PixmapPtr *ppPixmap) { PixmapPtr pPixmap = *ppPixmap; glamor_pixmap_private *pixmap_priv; if (pPixmap->drawable.bitsPerPixel != pDrawable->bitsPerPixel) { pixmap_priv = glamor_get_pixmap_private(pPixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) { glamor_fallback("pixmap %p has no fbo\n", pPixmap); goto fail; } glamor_debug_output(GLAMOR_DEBUG_UNIMPL, "To be implemented.\n"); } return; fail: GLAMOR_PANIC (" We can't fall back to fbFixupWindowPixmap, as the fb24_32ReformatTile" " is broken for glamor. \n"); } Bool glamor_change_window_attributes(WindowPtr pWin, unsigned long mask) { if (mask & CWBackPixmap) { if (pWin->backgroundState == BackgroundPixmap) glamor_fixup_window_pixmap(&pWin->drawable, &pWin->background.pixmap); } if (mask & CWBorderPixmap) { if (pWin->borderIsPixel == FALSE) glamor_fixup_window_pixmap(&pWin->drawable, &pWin->border.pixmap); } return TRUE; } void glamor_set_window_pixmap(WindowPtr win, PixmapPtr pPixmap) { ScreenPtr screen = win->drawable.pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr old = screen->GetWindowPixmap(win); if (pPixmap != old) { glamor_pixmap_private *pixmap_priv; PicturePtr pic = NULL; pixmap_priv = glamor_get_pixmap_private(old); if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) && pixmap_priv->base.picture->pDrawable == (DrawablePtr) win) { pic = pixmap_priv->base.picture; pixmap_priv->base.is_picture = 0; pixmap_priv->base.picture = NULL; } pixmap_priv = glamor_get_pixmap_private(pPixmap); if (pixmap_priv) { pixmap_priv->base.is_picture = ! !pic; pixmap_priv->base.picture = pic; } } screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap; (screen->SetWindowPixmap) (win, pPixmap); glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap; screen->SetWindowPixmap = glamor_set_window_pixmap; } xorg-server-1.17.1/glamor/glamor_transfer.c0000664000175100017510000001666012424353351015636 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_transfer.h" /* XXX a kludge for now */ void glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type) { switch (pixmap->drawable.depth) { case 24: case 32: *format = GL_BGRA; *type = GL_UNSIGNED_INT_8_8_8_8_REV; break; case 16: *format = GL_RGB; *type = GL_UNSIGNED_SHORT_5_6_5; break; case 15: *format = GL_BGRA; *type = GL_UNSIGNED_SHORT_1_5_5_5_REV; break; case 8: *format = GL_ALPHA; *type = GL_UNSIGNED_BYTE; break; default: FatalError("Invalid pixmap depth %d\n", pixmap->drawable.depth); break; } } /* * Write a region of bits into a pixmap */ void glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, int dx_src, int dy_src, int dx_dst, int dy_dst, uint8_t *bits, uint32_t byte_stride) { ScreenPtr screen = pixmap->drawable.pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); int box_x, box_y; int bytes_per_pixel = pixmap->drawable.bitsPerPixel >> 3; GLenum type; GLenum format; glamor_format_for_pixmap(pixmap, &format, &type); glamor_make_current(glamor_priv); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glPixelStorei(GL_UNPACK_ROW_LENGTH, byte_stride / bytes_per_pixel); glamor_pixmap_loop(priv, box_x, box_y) { BoxPtr box = glamor_pixmap_box_at(priv, box_x, box_y); glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(priv, box_x, box_y); BoxPtr boxes = in_boxes; int nbox = in_nbox; glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, fbo->tex); while (nbox--) { /* compute drawable coordinates */ int x1 = MAX(boxes->x1 + dx_dst, box->x1); int x2 = MIN(boxes->x2 + dx_dst, box->x2); int y1 = MAX(boxes->y1 + dy_dst, box->y1); int y2 = MIN(boxes->y2 + dy_dst, box->y2); boxes++; if (x2 <= x1 || y2 <= y1) continue; glPixelStorei(GL_UNPACK_SKIP_ROWS, y1 - dy_dst + dy_src); glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1 - dx_dst + dx_src); glTexSubImage2D(GL_TEXTURE_2D, 0, x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, format, type, bits); } } glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); } /* * Upload a region of data */ void glamor_upload_region(PixmapPtr pixmap, RegionPtr region, int region_x, int region_y, uint8_t *bits, uint32_t byte_stride) { glamor_upload_boxes(pixmap, RegionRects(region), RegionNumRects(region), -region_x, -region_y, 0, 0, bits, byte_stride); } /* * Take the data in the pixmap and stuff it back into the FBO */ void glamor_upload_pixmap(PixmapPtr pixmap) { BoxRec box; box.x1 = 0; box.x2 = pixmap->drawable.width; box.y1 = 0; box.y2 = pixmap->drawable.height; glamor_upload_boxes(pixmap, &box, 1, 0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); } /* * Read stuff from the pixmap FBOs and write to memory */ void glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, int dx_src, int dy_src, int dx_dst, int dy_dst, uint8_t *bits, uint32_t byte_stride) { ScreenPtr screen = pixmap->drawable.pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); int box_x, box_y; int bytes_per_pixel = pixmap->drawable.bitsPerPixel >> 3; GLenum type; GLenum format; glamor_format_for_pixmap(pixmap, &format, &type); glamor_make_current(glamor_priv); glPixelStorei(GL_PACK_ALIGNMENT, 4); glPixelStorei(GL_PACK_ROW_LENGTH, byte_stride / bytes_per_pixel); glamor_pixmap_loop(priv, box_x, box_y) { BoxPtr box = glamor_pixmap_box_at(priv, box_x, box_y); glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(priv, box_x, box_y); BoxPtr boxes = in_boxes; int nbox = in_nbox; glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->fb); while (nbox--) { /* compute drawable coordinates */ int x1 = MAX(boxes->x1 + dx_src, box->x1); int x2 = MIN(boxes->x2 + dx_src, box->x2); int y1 = MAX(boxes->y1 + dy_src, box->y1); int y2 = MIN(boxes->y2 + dy_src, box->y2); boxes++; if (x2 <= x1 || y2 <= y1) continue; glPixelStorei(GL_PACK_SKIP_PIXELS, x1 - dx_src + dx_dst); glPixelStorei(GL_PACK_SKIP_ROWS, y1 - dy_src + dy_dst); glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, format, type, bits); } } glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_SKIP_ROWS, 0); glPixelStorei(GL_PACK_SKIP_PIXELS, 0); } /* * Read data from the pixmap FBO */ void glamor_download_rect(PixmapPtr pixmap, int x, int y, int w, int h, uint8_t *bits) { BoxRec box; box.x1 = x; box.x2 = x + w; box.y1 = y; box.y2 = y + h; glamor_download_boxes(pixmap, &box, 1, 0, 0, -x, -y, bits, PixmapBytePad(w, pixmap->drawable.depth)); } /* * Pull the data from the FBO down to the pixmap */ void glamor_download_pixmap(PixmapPtr pixmap) { BoxRec box; box.x1 = 0; box.x2 = pixmap->drawable.width; box.y1 = 0; box.y2 = pixmap->drawable.height; glamor_download_boxes(pixmap, &box, 1, 0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); } xorg-server-1.17.1/glamor/glamor_program.h0000664000175100017510000000737612456256034015477 00000000000000/* * Copyright © 2014 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. */ #ifndef _GLAMOR_PROGRAM_H_ #define _GLAMOR_PROGRAM_H_ typedef enum { glamor_program_location_none = 0, glamor_program_location_fg = 1, glamor_program_location_bg = 2, glamor_program_location_fill = 4, glamor_program_location_font = 8, glamor_program_location_bitplane = 16, glamor_program_location_dash = 32, } glamor_program_location; typedef enum { glamor_program_flag_none = 0, } glamor_program_flag; typedef struct _glamor_program glamor_program; typedef Bool (*glamor_use) (PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg); typedef struct { const char *name; const int version; const char *vs_vars; const char *vs_exec; const char *fs_vars; const char *fs_exec; const glamor_program_location locations; const glamor_program_flag flags; const char *source_name; glamor_use use; } glamor_facet; struct _glamor_program { GLint prog; GLint failed; GLint matrix_uniform; GLint fg_uniform; GLint bg_uniform; GLint fill_size_uniform; GLint fill_offset_uniform; GLint font_uniform; GLint bitplane_uniform; GLint bitmul_uniform; GLint dash_uniform; GLint dash_length_uniform; glamor_program_location locations; glamor_program_flag flags; glamor_use prim_use; glamor_use fill_use; }; typedef struct { glamor_program progs[4]; } glamor_program_fill; extern const glamor_facet glamor_fill_solid; Bool glamor_build_program(ScreenPtr screen, glamor_program *prog, const glamor_facet *prim, const glamor_facet *fill); Bool glamor_use_program(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg); glamor_program * glamor_use_program_fill(PixmapPtr pixmap, GCPtr gc, glamor_program_fill *program_fill, const glamor_facet *prim); #endif /* _GLAMOR_PROGRAM_H_ */ xorg-server-1.17.1/glamor/glamor_image.c0000664000175100017510000001366712460362577015112 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_transfer.h" #include "glamor_transform.h" /* * PutImage. Only does ZPixmap right now as other formats are quite a bit harder */ static Bool glamor_put_image_gl(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; uint32_t byte_stride = PixmapBytePad(w, drawable->depth); RegionRec region; BoxRec box; int off_x, off_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) return FALSE; if (gc->alu != GXcopy) goto bail; if (!glamor_pm_is_solid(&pixmap->drawable, gc->planemask)) goto bail; if (format == XYPixmap && drawable->depth == 1 && leftPad == 0) format = ZPixmap; if (format != ZPixmap) goto bail; x += drawable->x; y += drawable->y; box.x1 = x; box.y1 = y; box.x2 = box.x1 + w; box.y2 = box.y1 + h; RegionInit(®ion, &box, 1); RegionIntersect(®ion, ®ion, gc->pCompositeClip); glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); if (off_x || off_y) { x += off_x; y += off_y; RegionTranslate(®ion, off_x, off_y); } glamor_make_current(glamor_priv); glamor_upload_region(pixmap, ®ion, x, y, (uint8_t *) bits, byte_stride); RegionUninit(®ion); return TRUE; bail: return FALSE; } static void glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) fbPutImage(drawable, gc, depth, x, y, w, h, leftPad, format, bits); glamor_finish_access(drawable); } void glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { if (glamor_put_image_gl(drawable, gc, depth, x, y, w, h, leftPad, format, bits)) return; glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits); } Bool glamor_put_image_nf(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { if (glamor_put_image_gl(drawable, gc, depth, x, y, w, h, leftPad, format, bits)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) return FALSE; glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits); return TRUE; } static Bool glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; uint32_t byte_stride = PixmapBytePad(w, drawable->depth); BoxRec box; int off_x, off_y; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; if (format != ZPixmap || !glamor_pm_is_solid(drawable, plane_mask)) goto bail; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); box.x1 = x; box.x2 = x + w; box.y1 = y; box.y2 = y + h; glamor_download_boxes(pixmap, &box, 1, drawable->x + off_x, drawable->y + off_y, -x, -y, (uint8_t *) d, byte_stride); return TRUE; bail: return FALSE; } static void glamor_get_image_bail(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) fbGetImage(drawable, x, y, w, h, format, plane_mask, d); glamor_finish_access(drawable); } void glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { if (glamor_get_image_gl(drawable, x, y, w, h, format, plane_mask, d)) return; glamor_get_image_bail(drawable, x, y, w, h, format, plane_mask, d); } Bool glamor_get_image_nf(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { if (glamor_get_image_gl(drawable, x, y, w, h, format, plane_mask, d)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable)) return FALSE; glamor_get_image_bail(drawable, x, y, w, h, format, plane_mask, d); return TRUE; } xorg-server-1.17.1/glamor/glamor_copy.c0000664000175100017510000005771712460362577015006 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_transfer.h" #include "glamor_prepare.h" #include "glamor_transform.h" struct copy_args { PixmapPtr src_pixmap; glamor_pixmap_fbo *src; uint32_t bitplane; int dx, dy; }; static Bool use_copyarea(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg) { struct copy_args *args = arg; glamor_pixmap_fbo *src = args->src; glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, src->tex); glUniform2f(prog->fill_offset_uniform, args->dx, args->dy); glUniform2f(prog->fill_size_uniform, src->width, src->height); return TRUE; } static const glamor_facet glamor_facet_copyarea = { "copy_area", .vs_vars = "attribute vec2 primitive;\n", .vs_exec = (GLAMOR_POS(gl_Position, primitive.xy) " fill_pos = (fill_offset + primitive.xy) / fill_size;\n"), .fs_exec = " gl_FragColor = texture2D(sampler, fill_pos);\n", .locations = glamor_program_location_fill, .use = use_copyarea, }; /* * Configure the copy plane program for the current operation */ static Bool use_copyplane(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg) { struct copy_args *args = arg; glamor_pixmap_fbo *src = args->src; glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, src->tex); glUniform2f(prog->fill_offset_uniform, args->dx, args->dy); glUniform2f(prog->fill_size_uniform, src->width, src->height); glamor_set_color(dst, gc->fgPixel, prog->fg_uniform); glamor_set_color(dst, gc->bgPixel, prog->bg_uniform); /* XXX handle 2 10 10 10 and 1555 formats; presumably the pixmap private knows this? */ switch (args->src_pixmap->drawable.depth) { case 24: glUniform4ui(prog->bitplane_uniform, (args->bitplane >> 16) & 0xff, (args->bitplane >> 8) & 0xff, (args->bitplane ) & 0xff, 0); glUniform4f(prog->bitmul_uniform, 0xff, 0xff, 0xff, 0); break; case 32: glUniform4ui(prog->bitplane_uniform, (args->bitplane >> 16) & 0xff, (args->bitplane >> 8) & 0xff, (args->bitplane ) & 0xff, (args->bitplane >> 24) & 0xff); glUniform4f(prog->bitmul_uniform, 0xff, 0xff, 0xff, 0xff); break; case 16: glUniform4ui(prog->bitplane_uniform, (args->bitplane >> 11) & 0x1f, (args->bitplane >> 5) & 0x3f, (args->bitplane ) & 0x1f, 0); glUniform4f(prog->bitmul_uniform, 0x1f, 0x3f, 0x1f, 0); break; case 15: glUniform4ui(prog->bitplane_uniform, (args->bitplane >> 10) & 0x1f, (args->bitplane >> 5) & 0x1f, (args->bitplane ) & 0x1f, 0); glUniform4f(prog->bitmul_uniform, 0x1f, 0x1f, 0x1f, 0); break; case 8: glUniform4ui(prog->bitplane_uniform, 0, 0, 0, args->bitplane); glUniform4f(prog->bitmul_uniform, 0, 0, 0, 0xff); break; case 1: glUniform4ui(prog->bitplane_uniform, 0, 0, 0, args->bitplane); glUniform4f(prog->bitmul_uniform, 0, 0, 0, 0xff); break; } return TRUE; } static const glamor_facet glamor_facet_copyplane = { "copy_plane", .version = 130, .vs_vars = "attribute vec2 primitive;\n", .vs_exec = (GLAMOR_POS(gl_Position, (primitive.xy)) " fill_pos = (fill_offset + primitive.xy) / fill_size;\n"), .fs_exec = (" uvec4 bits = uvec4(round(texture2D(sampler, fill_pos) * bitmul));\n" " if ((bits & bitplane) != uvec4(0,0,0,0))\n" " gl_FragColor = fg;\n" " else\n" " gl_FragColor = bg;\n"), .locations = glamor_program_location_fill|glamor_program_location_fg|glamor_program_location_bg|glamor_program_location_bitplane, .use = use_copyplane, }; /* * When all else fails, pull the bits out of the GPU and do the * operation with fb */ static void glamor_copy_bail(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { if (glamor_prepare_access(dst, GLAMOR_ACCESS_RW) && glamor_prepare_access(src, GLAMOR_ACCESS_RO)) { if (bitplane) { if (src->bitsPerPixel > 1) fbCopyNto1(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); else fbCopy1toN(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } else { fbCopyNtoN(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } } glamor_finish_access(dst); glamor_finish_access(src); } /** * Implements CopyPlane and CopyArea from the GPU to the GPU by using * the source as a texture and painting that into the destination. * * This requires that source and dest are different textures, or that * (if the copy area doesn't overlap), GL_NV_texture_barrier is used * to ensure that the caches are flushed at the right times. */ static Bool glamor_copy_cpu_fbo(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { ScreenPtr screen = dst->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); FbBits *src_bits; FbStride src_stride; int src_bpp; int src_xoff, src_yoff; int dst_xoff, dst_yoff; if (gc && gc->alu != GXcopy) goto bail; if (gc && !glamor_pm_is_solid(dst, gc->planemask)) goto bail; glamor_make_current(glamor_priv); glamor_prepare_access(src, GLAMOR_ACCESS_RO); glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff); fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff); glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, dst_xoff, dst_yoff, (uint8_t *) src_bits, src_stride * sizeof (FbBits)); glamor_finish_access(src); return TRUE; bail: return FALSE; } /** * Implements CopyArea from the GPU to the CPU using glReadPixels from the * source FBO. */ static Bool glamor_copy_fbo_cpu(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { ScreenPtr screen = dst->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); FbBits *dst_bits; FbStride dst_stride; int dst_bpp; int src_xoff, src_yoff; int dst_xoff, dst_yoff; if (gc && gc->alu != GXcopy) goto bail; if (gc && !glamor_pm_is_solid(dst, gc->planemask)) goto bail; glamor_make_current(glamor_priv); glamor_prepare_access(dst, GLAMOR_ACCESS_RW); glamor_get_drawable_deltas(src, src_pixmap, &src_xoff, &src_yoff); fbGetDrawable(dst, dst_bits, dst_stride, dst_bpp, dst_xoff, dst_yoff); glamor_download_boxes(src_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, dst_xoff, dst_yoff, (uint8_t *) dst_bits, dst_stride * sizeof (FbBits)); glamor_finish_access(dst); return TRUE; bail: return FALSE; } /* * Copy from GPU to GPU by using the source * as a texture and painting that into the destination */ static Bool glamor_copy_fbo_fbo_draw(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { ScreenPtr screen = dst->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); glamor_pixmap_private *src_priv = glamor_get_pixmap_private(src_pixmap); glamor_pixmap_private *dst_priv = glamor_get_pixmap_private(dst_pixmap); int src_box_x, src_box_y, dst_box_x, dst_box_y; int dst_off_x, dst_off_y; int src_off_x, src_off_y; GLshort *v; char *vbo_offset; struct copy_args args; glamor_program *prog; const glamor_facet *copy_facet; Bool set_scissor; int n; glamor_make_current(glamor_priv); if (gc && !glamor_set_planemask(dst_pixmap, gc->planemask)) goto bail_ctx; if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy)) goto bail_ctx; if (bitplane) { prog = &glamor_priv->copy_plane_prog; copy_facet = &glamor_facet_copyplane; } else { prog = &glamor_priv->copy_area_prog; copy_facet = &glamor_facet_copyarea; } if (prog->failed) goto bail_ctx; if (!prog->prog) { if (!glamor_build_program(screen, prog, copy_facet, NULL)) goto bail_ctx; } args.src_pixmap = src_pixmap; args.bitplane = bitplane; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(dst->pScreen, nbox * 8 * sizeof (int16_t), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 2 * sizeof (GLshort), vbo_offset); for (n = 0; n < nbox; n++) { v[0] = box->x1; v[1] = box->y1; v[2] = box->x1; v[3] = box->y2; v[4] = box->x2; v[5] = box->y2; v[6] = box->x2; v[7] = box->y1; v += 8; box++; } glamor_put_vbo_space(screen); glamor_get_drawable_deltas(src, src_pixmap, &src_off_x, &src_off_y); set_scissor = src_priv->type == GLAMOR_TEXTURE_LARGE; if (set_scissor) glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(src_priv, src_box_x, src_box_y) { BoxPtr src_box = glamor_pixmap_box_at(src_priv, src_box_x, src_box_y); args.dx = dx + src_off_x - src_box->x1; args.dy = dy + src_off_y - src_box->y1; args.src = glamor_pixmap_fbo_at(src_priv, src_box_x, src_box_y); if (!glamor_use_program(dst_pixmap, gc, prog, &args)) goto bail_ctx; glamor_pixmap_loop(dst_priv, dst_box_x, dst_box_y) { glamor_set_destination_drawable(dst, dst_box_x, dst_box_y, FALSE, FALSE, prog->matrix_uniform, &dst_off_x, &dst_off_y); if (set_scissor) glScissor(dst_off_x - args.dx, dst_off_y - args.dy, src_box->x2 - src_box->x1, src_box->y2 - src_box->y1); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) glDrawArrays(GL_QUADS, 0, nbox * 4); else { int i; for (i = 0; i < nbox; i++) glDrawArrays(GL_TRIANGLE_FAN, i*4, 4); } } } if (set_scissor) glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisable(GL_COLOR_LOGIC_OP); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); return FALSE; } /** * Copies from the GPU to the GPU using a temporary pixmap in between, * to correctly handle overlapping copies. */ static Bool glamor_copy_fbo_fbo_temp(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { ScreenPtr screen = dst->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); PixmapPtr tmp_pixmap; BoxRec bounds; int n; BoxPtr tmp_box; if (nbox == 0) return TRUE; /* Sanity check state to avoid getting halfway through and bailing * at the last second. Might be nice to have checks that didn't * involve setting state. */ glamor_make_current(glamor_priv); if (gc && !glamor_set_planemask(dst_pixmap, gc->planemask)) goto bail_ctx; if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy)) goto bail_ctx; glDisable(GL_COLOR_LOGIC_OP); /* Find the size of the area to copy */ bounds = box[0]; for (n = 1; n < nbox; n++) { bounds.x1 = min(bounds.x1, box[n].x1); bounds.x2 = max(bounds.x2, box[n].x2); bounds.y1 = min(bounds.y1, box[n].y1); bounds.y2 = max(bounds.y2, box[n].y2); } /* Allocate a suitable temporary pixmap */ tmp_pixmap = glamor_create_pixmap(screen, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1, src->depth, 0); if (!tmp_pixmap) goto bail; tmp_box = calloc(nbox, sizeof (BoxRec)); if (!tmp_box) goto bail_pixmap; /* Convert destination boxes into tmp pixmap boxes */ for (n = 0; n < nbox; n++) { tmp_box[n].x1 = box[n].x1 - bounds.x1; tmp_box[n].x2 = box[n].x2 - bounds.x1; tmp_box[n].y1 = box[n].y1 - bounds.y1; tmp_box[n].y2 = box[n].y2 - bounds.y1; } if (!glamor_copy_fbo_fbo_draw(src, &tmp_pixmap->drawable, NULL, tmp_box, nbox, dx + bounds.x1, dy + bounds.y1, FALSE, FALSE, 0, NULL)) goto bail_box; if (!glamor_copy_fbo_fbo_draw(&tmp_pixmap->drawable, dst, gc, box, nbox, -bounds.x1, -bounds.y1, FALSE, FALSE, bitplane, closure)) goto bail_box; free(tmp_box); glamor_destroy_pixmap(tmp_pixmap); return TRUE; bail_box: free(tmp_box); bail_pixmap: glamor_destroy_pixmap(tmp_pixmap); bail: return FALSE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); return FALSE; } /** * Returns TRUE if the copy has to be implemented with * glamor_copy_fbo_fbo_temp() instead of glamor_copy_fbo_fbo(). * * If the src and dst are in the same pixmap, then glamor_copy_fbo_fbo()'s * sampling would give undefined results (since the same texture would be * bound as an FBO destination and as a texture source). However, if we * have GL_NV_texture_barrier, we can take advantage of the exception it * added: * * "- If a texel has been written, then in order to safely read the result * a texel fetch must be in a subsequent Draw separated by the command * * void TextureBarrierNV(void); * * TextureBarrierNV() will guarantee that writes have completed and caches * have been invalidated before subsequent Draws are executed." */ static Bool glamor_copy_needs_temp(DrawablePtr src, DrawablePtr dst, BoxPtr box, int nbox, int dx, int dy) { PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); ScreenPtr screen = dst->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); int n; int dst_off_x, dst_off_y; int src_off_x, src_off_y; BoxRec bounds; if (src_pixmap != dst_pixmap) return FALSE; if (nbox == 0) return FALSE; if (!glamor_priv->has_nv_texture_barrier) return TRUE; glamor_get_drawable_deltas(src, src_pixmap, &src_off_x, &src_off_y); glamor_get_drawable_deltas(dst, dst_pixmap, &dst_off_x, &dst_off_y); bounds = box[0]; for (n = 1; n < nbox; n++) { bounds.x1 = min(bounds.x1, box[n].x1); bounds.y1 = min(bounds.y1, box[n].y1); bounds.x2 = max(bounds.x2, box[n].x2); bounds.y2 = max(bounds.y2, box[n].y2); } /* Check to see if the pixmap-relative boxes overlap in both X and Y, * in which case we can't rely on NV_texture_barrier and must * make a temporary copy * * dst.x1 < src.x2 && * src.x1 < dst.x2 && * * dst.y1 < src.y2 && * src.y1 < dst.y2 */ if (bounds.x1 + dst_off_x < bounds.x2 + dx + src_off_x && bounds.x1 + dx + src_off_x < bounds.x2 + dst_off_x && bounds.y1 + dst_off_y < bounds.y2 + dy + src_off_y && bounds.y1 + dy + src_off_y < bounds.y2 + dst_off_y) { return TRUE; } glTextureBarrierNV(); return FALSE; } static Bool glamor_copy_gl(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); glamor_pixmap_private *src_priv = glamor_get_pixmap_private(src_pixmap); glamor_pixmap_private *dst_priv = glamor_get_pixmap_private(dst_pixmap); if (GLAMOR_PIXMAP_PRIV_HAS_FBO(dst_priv)) { if (GLAMOR_PIXMAP_PRIV_HAS_FBO(src_priv)) { if (glamor_copy_needs_temp(src, dst, box, nbox, dx, dy)) return glamor_copy_fbo_fbo_temp(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); else return glamor_copy_fbo_fbo_draw(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } if (bitplane == 0) return glamor_copy_cpu_fbo(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } else if (GLAMOR_PIXMAP_PRIV_HAS_FBO(src_priv) && dst_priv->type != GLAMOR_DRM_ONLY && bitplane == 0) { return glamor_copy_fbo_cpu(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } return FALSE; } void glamor_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { if (glamor_copy_gl(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure)) return; glamor_copy_bail(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } RegionPtr glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, int srcx, int srcy, int width, int height, int dstx, int dsty) { return miDoCopy(src, dst, gc, srcx, srcy, width, height, dstx, dsty, glamor_copy, 0, NULL); } RegionPtr glamor_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bitplane) { if ((bitplane & FbFullMask(src->depth)) == 0) return miHandleExposures(src, dst, gc, srcx, srcy, width, height, dstx, dsty); return miDoCopy(src, dst, gc, srcx, srcy, width, height, dstx, dsty, glamor_copy, bitplane, NULL); } void glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_region) { PixmapPtr pixmap = glamor_get_drawable_pixmap(&window->drawable); DrawablePtr drawable = &pixmap->drawable; RegionRec dst_region; int dx, dy; dx = old_origin.x - window->drawable.x; dy = old_origin.y - window->drawable.y; RegionTranslate(src_region, -dx, -dy); RegionNull(&dst_region); RegionIntersect(&dst_region, &window->borderClip, src_region); #ifdef COMPOSITE if (pixmap->screen_x || pixmap->screen_y) RegionTranslate(&dst_region, -pixmap->screen_x, -pixmap->screen_y); #endif miCopyRegion(drawable, drawable, 0, &dst_region, dx, dy, glamor_copy, 0, 0); RegionUninit(&dst_region); } Bool glamor_copy_n_to_n_nf(DrawablePtr src, DrawablePtr dst, GCPtr gc, BoxPtr box, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { if (glamor_copy_gl(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure)) return TRUE; if (glamor_ddx_fallback_check_pixmap(src) && glamor_ddx_fallback_check_pixmap(dst)) return FALSE; glamor_copy_bail(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); return TRUE; } Bool glamor_copy_plane_nf(DrawablePtr src, DrawablePtr dst, GCPtr gc, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long bitplane, RegionPtr *region) { if (glamor_ddx_fallback_check_pixmap(src) && glamor_ddx_fallback_check_pixmap(dst) && glamor_ddx_fallback_check_gc(gc)) return FALSE; *region = glamor_copy_plane(src, dst, gc, srcx, srcy, w, h, dstx, dsty, bitplane); return TRUE; } xorg-server-1.17.1/glamor/glamor_dash.c0000664000175100017510000002520612460362577014737 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_program.h" #include "glamor_transform.h" #include "glamor_transfer.h" #include "glamor_prepare.h" static const char dash_vs_vars[] = "attribute vec3 primitive;\n" "varying float dash_offset;\n"; static const char dash_vs_exec[] = " dash_offset = primitive.z / dash_length;\n" GLAMOR_POS(gl_Position, primitive.xy); static const char dash_fs_vars[] = "varying float dash_offset;\n"; static const char on_off_fs_exec[] = " float pattern = texture2D(dash, vec2(dash_offset, 0.5)).w;\n" " if (pattern == 0.0)\n" " discard;\n"; /* XXX deal with stippled double dashed lines once we have stippling support */ static const char double_fs_exec[] = " float pattern = texture2D(dash, vec2(dash_offset, 0.5)).w;\n" " if (pattern == 0.0)\n" " gl_FragColor = bg;\n" " else\n" " gl_FragColor = fg;\n"; static const glamor_facet glamor_facet_on_off_dash_lines = { .version = 130, .name = "poly_lines_on_off_dash", .vs_vars = dash_vs_vars, .vs_exec = dash_vs_exec, .fs_vars = dash_fs_vars, .fs_exec = on_off_fs_exec, .locations = glamor_program_location_dash, }; static const glamor_facet glamor_facet_double_dash_lines = { .version = 130, .name = "poly_lines_double_dash", .vs_vars = dash_vs_vars, .vs_exec = dash_vs_exec, .fs_vars = dash_fs_vars, .fs_exec = double_fs_exec, .locations = (glamor_program_location_dash| glamor_program_location_fg| glamor_program_location_bg), }; static PixmapPtr glamor_get_dash_pixmap(GCPtr gc) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); ScreenPtr screen = gc->pScreen; PixmapPtr pixmap; int offset; int d; uint32_t pixel; GCPtr scratch_gc; if (gc_priv->dash) return gc_priv->dash; offset = 0; for (d = 0; d < gc->numInDashList; d++) offset += gc->dash[d]; pixmap = glamor_create_pixmap(screen, offset, 1, 8, 0); if (!pixmap) goto bail; scratch_gc = GetScratchGC(8, screen); if (!scratch_gc) goto bail_pixmap; pixel = 0xffffffff; offset = 0; for (d = 0; d < gc->numInDashList; d++) { xRectangle rect; ChangeGCVal changes; changes.val = pixel; (void) ChangeGC(NullClient, scratch_gc, GCForeground, &changes); ValidateGC(&pixmap->drawable, scratch_gc); rect.x = offset; rect.y = 0; rect.width = gc->dash[d]; rect.height = 1; scratch_gc->ops->PolyFillRect (&pixmap->drawable, scratch_gc, 1, &rect); offset += gc->dash[d]; pixel = ~pixel; } FreeScratchGC(scratch_gc); gc_priv->dash = pixmap; return pixmap; bail_pixmap: glamor_destroy_pixmap(pixmap); bail: return NULL; } static glamor_program * glamor_dash_setup(DrawablePtr drawable, GCPtr gc) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); PixmapPtr dash_pixmap; glamor_pixmap_private *dash_priv; glamor_program *prog; if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; if (gc->lineWidth != 0) goto bail; dash_pixmap = glamor_get_dash_pixmap(gc); dash_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dash_priv)) goto bail; glamor_make_current(glamor_priv); switch (gc->lineStyle) { case LineOnOffDash: prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->on_off_dash_line_progs, &glamor_facet_on_off_dash_lines); if (!prog) goto bail_ctx; break; case LineDoubleDash: if (gc->fillStyle != FillSolid) goto bail_ctx; prog = &glamor_priv->double_dash_line_prog; if (!prog->prog) { if (!glamor_build_program(screen, prog, &glamor_facet_double_dash_lines, NULL)) goto bail_ctx; } if (!glamor_use_program(pixmap, gc, prog, NULL)) goto bail_ctx; glamor_set_color(pixmap, gc->fgPixel, prog->fg_uniform); glamor_set_color(pixmap, gc->bgPixel, prog->bg_uniform); break; default: goto bail_ctx; } /* Set the dash pattern as texture 1 */ glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, dash_priv->base.fbo->tex); glUniform1i(prog->dash_uniform, 1); glUniform1f(prog->dash_length_uniform, dash_pixmap->drawable.width); return prog; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return NULL; } static void glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog, int n, GLenum mode) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); int box_x, box_y; int off_x, off_y; glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE, prog->matrix_uniform, &off_x, &off_y); while (nbox--) { glScissor(box->x1 + off_x, box->y1 + off_y, box->x2 - box->x1, box->y2 - box->y1); box++; glDrawArrays(mode, 0, n); } } glDisable(GL_SCISSOR_TEST); glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); } static int glamor_line_length(short x1, short y1, short x2, short y2) { return max(abs(x2 - x1), abs(y2 - y1)); } Bool glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { ScreenPtr screen = drawable->pScreen; glamor_program *prog; short *v; char *vbo_offset; int add_last; int dash_pos; int prev_x, prev_y; int i; if (n < 2) return TRUE; if (!(prog = glamor_dash_setup(drawable, gc))) return FALSE; add_last = 0; if (gc->capStyle != CapNotLast) add_last = 1; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, (n + add_last) * 3 * sizeof (short), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 3, GL_SHORT, GL_FALSE, 3 * sizeof (short), vbo_offset); dash_pos = gc->dashOffset; prev_x = prev_y = 0; for (i = 0; i < n; i++) { int this_x = points[i].x; int this_y = points[i].y; if (i) { if (mode == CoordModePrevious) { this_x += prev_x; this_y += prev_y; } dash_pos += glamor_line_length(prev_x, prev_y, this_x, this_y); } v[0] = prev_x = this_x; v[1] = prev_y = this_y; v[2] = dash_pos; v += 3; } if (add_last) { v[0] = prev_x + 1; v[1] = prev_y; v[2] = dash_pos + 1; } glamor_put_vbo_space(screen); glamor_dash_loop(drawable, gc, prog, n + add_last, GL_LINE_STRIP); return TRUE; } static short * glamor_add_segment(short *v, short x1, short y1, short x2, short y2, int dash_start, int dash_end) { v[0] = x1; v[1] = y1; v[2] = dash_start; v[3] = x2; v[4] = y2; v[5] = dash_end; return v + 6; } Bool glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { ScreenPtr screen = drawable->pScreen; glamor_program *prog; short *v; char *vbo_offset; int dash_start = gc->dashOffset; int add_last; int i; if (!(prog = glamor_dash_setup(drawable, gc))) return FALSE; add_last = 0; if (gc->capStyle != CapNotLast) add_last = 1; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, (nseg< * Based on code by: Keith Packard */ #include #include "glamor_priv.h" #include #if DEBUG_GLYPH_CACHE #define DBG_GLYPH_CACHE(a) ErrorF a #else #define DBG_GLYPH_CACHE(a) #endif /* Width of the pixmaps we use for the caches; this should be less than * max texture size of the driver; this may need to actually come from * the driver. */ /* Maximum number of glyphs we buffer on the stack before flushing * rendering to the mask or destination surface. */ #define GLYPH_BUFFER_SIZE 1024 typedef struct { PicturePtr source; glamor_composite_rect_t rects[GLYPH_BUFFER_SIZE + 4]; int count; } glamor_glyph_buffer_t; struct glamor_glyph { glamor_glyph_cache_t *cache; uint16_t x, y; uint16_t size, pos; unsigned long long left_x1_map, left_x2_map; unsigned long long right_x1_map, right_x2_map; /* Use to check real intersect or not. */ Bool has_edge_map; Bool cached; }; typedef enum { GLAMOR_GLYPH_SUCCESS, /* Glyph added to render buffer */ GLAMOR_GLYPH_FAIL, /* out of memory, etc */ GLAMOR_GLYPH_NEED_FLUSH, /* would evict a glyph already in the buffer */ } glamor_glyph_cache_result_t; #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) static DevPrivateKeyRec glamor_glyph_key; static inline struct glamor_glyph * glamor_glyph_get_private(ScreenPtr screen, GlyphPtr glyph) { struct glamor_glyph *privates = (struct glamor_glyph*)glyph->devPrivates; return &privates[screen->myNum]; } /* * Mask cache is located at the corresponding cache picture's last row. * and is deadicated for the mask picture when do the glyphs_via_mask. * * As we split the glyphs list according to its overlapped or non-overlapped, * we can reduce the length of glyphs to do the glyphs_via_mask to 2 or 3 * glyphs one time for most cases. Thus it give us a case to allocate a * small portion of the corresponding cache directly as the mask picture. * Then we can rendering the glyphs to this mask picture, and latter we * can accumulate the second steps, composite the mask to the dest with * the other non-overlapped glyphs's rendering process. * Another major benefit is we now only need to clear a relatively small mask * region then before. It also make us implement a bunch mask picture clearing * algorithm to avoid too frequently small region clearing. * * If there is no any overlapping, this method will not get performance gain. * If there is some overlapping, then this algorithm can get about 15% performance * gain. */ static void clear_mask_cache_bitmap(glamor_glyph_mask_cache_t *maskcache, unsigned int clear_mask_bits) { unsigned int i = 0; BoxRec box[MASK_CACHE_WIDTH]; int box_cnt = 0; assert((clear_mask_bits & ~MASK_CACHE_MASK) == 0); for (i = 0; i < MASK_CACHE_WIDTH; i++) { if (clear_mask_bits & (1 << i)) { box[box_cnt].x1 = maskcache->mcache[i].x; box[box_cnt].x2 = maskcache->mcache[i].x + MASK_CACHE_MAX_SIZE; box[box_cnt].y1 = maskcache->mcache[i].y; box[box_cnt].y2 = maskcache->mcache[i].y + MASK_CACHE_MAX_SIZE; box_cnt++; } } glamor_solid_boxes(maskcache->pixmap, box, box_cnt, 0); maskcache->cleared_bitmap |= clear_mask_bits; } static void clear_mask_cache(glamor_glyph_mask_cache_t *maskcache) { int x = 0; int cnt = MASK_CACHE_WIDTH; unsigned int i = 0; struct glamor_glyph_mask_cache_entry *mce; glamor_solid(maskcache->pixmap, 0, CACHE_PICTURE_SIZE, CACHE_PICTURE_SIZE, MASK_CACHE_MAX_SIZE, 0); mce = &maskcache->mcache[0]; while (cnt--) { mce->width = 0; mce->height = 0; mce->x = x; mce->y = CACHE_PICTURE_SIZE; mce->idx = i++; x += MASK_CACHE_MAX_SIZE; mce++; } maskcache->free_bitmap = MASK_CACHE_MASK; maskcache->cleared_bitmap = MASK_CACHE_MASK; } static int find_continuous_bits(unsigned int bits, int bits_cnt, unsigned int *pbits_mask) { int idx = 0; unsigned int bits_mask; bits_mask = ((1LL << bits_cnt) - 1); if (_X_UNLIKELY(bits_cnt > 56)) { while (bits) { if ((bits & bits_mask) == bits_mask) { *pbits_mask = bits_mask << idx; return idx; } bits >>= 1; idx++; } } else { idx = __fls(bits); while (bits) { unsigned int temp_bits; temp_bits = bits_mask << (idx - bits_cnt + 1); if ((bits & temp_bits) == temp_bits) { *pbits_mask = temp_bits; return (idx - bits_cnt + 1); } /* Find first zero. And clear the tested bit. */ bits &= ~(1LL << idx); idx = __fls(~bits); bits &= ~((1LL << idx) - 1); idx--; } } return -1; } static struct glamor_glyph_mask_cache_entry * get_mask_cache(glamor_glyph_mask_cache_t *maskcache, int blocks) { int free_cleared_bit, idx = -1; int retry_cnt = 0; unsigned int bits_mask = 0; if (maskcache->free_bitmap == 0) return NULL; retry: free_cleared_bit = maskcache->free_bitmap & maskcache->cleared_bitmap; if (free_cleared_bit && blocks == 1) { idx = __fls(free_cleared_bit); bits_mask = 1 << idx; } else if (free_cleared_bit && blocks > 1) { idx = find_continuous_bits(free_cleared_bit, blocks, &bits_mask); } if (idx < 0) { clear_mask_cache_bitmap(maskcache, maskcache->free_bitmap); if (retry_cnt++ > 2) return NULL; goto retry; } maskcache->cleared_bitmap &= ~bits_mask; maskcache->free_bitmap &= ~bits_mask; DEBUGF("get idx %d free %x clear %x \n", idx, maskcache->free_bitmap, maskcache->cleared_bitmap); return &maskcache->mcache[idx]; } static void put_mask_cache_bitmap(glamor_glyph_mask_cache_t *maskcache, unsigned int bitmap) { maskcache->free_bitmap |= bitmap; DEBUGF("put bitmap %x free %x clear %x \n", bitmap, maskcache->free_bitmap, maskcache->cleared_bitmap); } static void glamor_unrealize_glyph_caches(ScreenPtr pScreen) { glamor_screen_private *glamor = glamor_get_screen_private(pScreen); int i; if (!glamor->glyph_caches_realized) return; for (i = 0; i < GLAMOR_NUM_GLYPH_CACHE_FORMATS; i++) { glamor_glyph_cache_t *cache = &glamor->glyphCaches[i]; if (cache->picture) FreePicture(cache->picture, 0); if (cache->glyphs) free(cache->glyphs); if (glamor->mask_cache[i]) free(glamor->mask_cache[i]); } glamor->glyph_caches_realized = FALSE; } void glamor_glyphs_fini(ScreenPtr pScreen) { glamor_unrealize_glyph_caches(pScreen); } /* All caches for a single format share a single pixmap for glyph storage, * allowing mixing glyphs of different sizes without paying a penalty * for switching between source pixmaps. (Note that for a size of font * right at the border between two sizes, we might be switching for almost * every glyph.) * * This function allocates the storage pixmap, and then fills in the * rest of the allocated structures for all caches with the given format. */ Bool glamor_realize_glyph_caches(ScreenPtr pScreen) { glamor_screen_private *glamor = glamor_get_screen_private(pScreen); unsigned int formats[] = { PIXMAN_a8, PIXMAN_a8r8g8b8, }; int i; if (glamor->glyph_caches_realized) return TRUE; memset(glamor->glyphCaches, 0, sizeof(glamor->glyphCaches)); for (i = 0; i < sizeof(formats) / sizeof(formats[0]); i++) { glamor_glyph_cache_t *cache = &glamor->glyphCaches[i]; PixmapPtr pixmap; PicturePtr picture; XID component_alpha; int depth = PIXMAN_FORMAT_DEPTH(formats[i]); int error; PictFormatPtr pPictFormat = PictureMatchFormat(pScreen, depth, formats[i]); if (!pPictFormat) goto bail; /* Now allocate the pixmap and picture */ pixmap = pScreen->CreatePixmap(pScreen, CACHE_PICTURE_SIZE, CACHE_PICTURE_SIZE + MASK_CACHE_MAX_SIZE, depth, GLAMOR_CREATE_NO_LARGE); if (!pixmap) goto bail; component_alpha = NeedsComponent(pPictFormat->format); picture = CreatePicture(0, &pixmap->drawable, pPictFormat, CPComponentAlpha, &component_alpha, serverClient, &error); pScreen->DestroyPixmap(pixmap); if (!picture) goto bail; ValidatePicture(picture); cache->picture = picture; cache->glyphs = calloc(sizeof(GlyphPtr), GLYPH_CACHE_SIZE); if (!cache->glyphs) goto bail; cache->evict = rand() % GLYPH_CACHE_SIZE; glamor->mask_cache[i] = calloc(1, sizeof(*glamor->mask_cache[i])); glamor->mask_cache[i]->pixmap = pixmap; clear_mask_cache(glamor->mask_cache[i]); } assert(i == GLAMOR_NUM_GLYPH_CACHE_FORMATS); glamor->glyph_caches_realized = TRUE; return TRUE; bail: glamor_unrealize_glyph_caches(pScreen); return FALSE; } /** * Called by glamor_create_screen_resources() to set up the glyph cache. * * This was previously required to be called by the drivers, but not * as of the xserver 1.16 ABI. */ Bool glamor_glyphs_init(ScreenPtr pScreen) { if (!dixRegisterPrivateKey(&glamor_glyph_key, PRIVATE_GLYPH, screenInfo.numScreens * sizeof(struct glamor_glyph))) return FALSE; return TRUE; } /* The most efficient thing to way to upload the glyph to the screen * is to use CopyArea; glamor pixmaps are always offscreen. */ static void glamor_glyph_cache_upload_glyph(ScreenPtr screen, glamor_glyph_cache_t *cache, GlyphPtr glyph, int x, int y) { PicturePtr pGlyphPicture = GlyphPicture(glyph)[screen->myNum]; PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable; PixmapPtr pCachePixmap = (PixmapPtr) cache->picture->pDrawable; PixmapPtr scratch; BoxRec box; GCPtr gc; gc = GetScratchGC(pCachePixmap->drawable.depth, screen); if (!gc) return; ValidateGC(&pCachePixmap->drawable, gc); scratch = pGlyphPixmap; if (pGlyphPixmap->drawable.depth != pCachePixmap->drawable.depth) { scratch = glamor_create_pixmap(screen, glyph->info.width, glyph->info.height, pCachePixmap->drawable.depth, 0); if (scratch) { PicturePtr picture; int error; picture = CreatePicture(0, &scratch->drawable, PictureMatchFormat (screen, pCachePixmap->drawable.depth, cache->picture->format), 0, NULL, serverClient, &error); if (picture) { ValidatePicture(picture); glamor_composite(PictOpSrc, pGlyphPicture, NULL, picture, 0, 0, 0, 0, 0, 0, glyph->info.width, glyph->info.height); FreePicture(picture, 0); } } else { scratch = pGlyphPixmap; } } box.x1 = x; box.y1 = y; box.x2 = x + glyph->info.width; box.y2 = y + glyph->info.height; glamor_copy(&scratch->drawable, &pCachePixmap->drawable, NULL, &box, 1, -x, -y, FALSE, FALSE, 0, NULL); if (scratch != pGlyphPixmap) screen->DestroyPixmap(scratch); FreeScratchGC(gc); } void glamor_glyph_unrealize(ScreenPtr screen, GlyphPtr glyph) { struct glamor_glyph *priv; /* Use Lookup in case we have not attached to this glyph. */ priv = glamor_glyph_get_private(screen, glyph); if (priv->cached) priv->cache->glyphs[priv->pos] = NULL; } /* Cut and paste from render/glyph.c - probably should export it instead */ static void glamor_glyph_extents(int nlist, GlyphListPtr list, GlyphPtr *glyphs, BoxPtr extents) { int x1, x2, y1, y2; int x, y, n; x1 = y1 = MAXSHORT; x2 = y2 = MINSHORT; x = y = 0; while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; list++; while (n--) { GlyphPtr glyph = *glyphs++; int v; v = x - glyph->info.x; if (v < x1) x1 = v; v += glyph->info.width; if (v > x2) x2 = v; v = y - glyph->info.y; if (v < y1) y1 = v; v += glyph->info.height; if (v > y2) y2 = v; x += glyph->info.xOff; y += glyph->info.yOff; } } extents->x1 = x1 < MINSHORT ? MINSHORT : x1; extents->x2 = x2 > MAXSHORT ? MAXSHORT : x2; extents->y1 = y1 < MINSHORT ? MINSHORT : y1; extents->y2 = y2 > MAXSHORT ? MAXSHORT : y2; } static void glamor_glyph_priv_get_edge_map(GlyphPtr glyph, struct glamor_glyph *priv, PicturePtr glyph_picture) { PixmapPtr glyph_pixmap = (PixmapPtr) glyph_picture->pDrawable; int j; unsigned long long left_x1_map = 0, left_x2_map = 0; unsigned long long right_x1_map = 0, right_x2_map = 0; int bitsPerPixel; int stride; void *bits; int width; unsigned int left_x1_data = 0, left_x2_data = 0; unsigned int right_x1_data = 0, right_x2_data = 0; bitsPerPixel = glyph_pixmap->drawable.bitsPerPixel; stride = glyph_pixmap->devKind; bits = glyph_pixmap->devPrivate.ptr; width = glyph->info.width; if (glyph_pixmap->drawable.width < 2 || !(glyph_pixmap->drawable.depth == 8 || glyph_pixmap->drawable.depth == 1 || glyph_pixmap->drawable.depth == 32)) { priv->has_edge_map = FALSE; return; } left_x1_map = left_x2_map = 0; right_x1_map = right_x2_map = 0; for (j = 0; j < glyph_pixmap->drawable.height; j++) { if (bitsPerPixel == 8) { unsigned char *data; data = (unsigned char *) ((unsigned char *) bits + stride * j); left_x1_data = *data++; left_x2_data = *data; data = (unsigned char *) ((unsigned char *) bits + stride * j + width - 2); right_x1_data = *data++; right_x2_data = *data; } else if (bitsPerPixel == 32) { left_x1_data = *((unsigned int *) bits + stride / 4 * j); left_x2_data = *((unsigned int *) bits + stride / 4 * j + 1); right_x1_data = *((unsigned int *) bits + stride / 4 * j + width - 2); right_x2_data = *((unsigned int *) bits + stride / 4 * j + width - 1); } else if (bitsPerPixel == 1) { unsigned char temp; temp = *((unsigned char *) glyph_pixmap->devPrivate.ptr + glyph_pixmap->devKind * j) & 0x3; left_x1_data = temp & 0x1; left_x2_data = temp & 0x2; temp = *((unsigned char *) glyph_pixmap->devPrivate.ptr + glyph_pixmap->devKind * j + (glyph_pixmap->drawable.width - 2) / 8); right_x1_data = temp & (1 << ((glyph_pixmap->drawable.width - 2) % 8)); temp = *((unsigned char *) glyph_pixmap->devPrivate.ptr + glyph_pixmap->devKind * j + (glyph_pixmap->drawable.width - 1) / 8); right_x2_data = temp & (1 << ((glyph_pixmap->drawable.width - 1) % 8)); } left_x1_map |= (left_x1_data != 0) << j; left_x2_map |= (left_x2_data != 0) << j; right_x1_map |= (right_x1_data != 0) << j; right_x2_map |= (right_x2_data != 0) << j; } priv->left_x1_map = left_x1_map; priv->left_x2_map = left_x2_map; priv->right_x1_map = right_x1_map; priv->right_x2_map = right_x2_map; priv->has_edge_map = TRUE; return; } /** * Returns TRUE if the glyphs in the lists intersect. Only checks based on * bounding box, which appears to be good enough to catch most cases at least. */ #define INTERSECTED_TYPE_MASK 1 #define NON_INTERSECTED 0 #define INTERSECTED 1 struct glamor_glyph_list { int nlist; GlyphListPtr list; GlyphPtr *glyphs; int type; }; static Bool glyph_new_fixed_list(struct glamor_glyph_list *fixed_list, GlyphPtr *cur_glyphs, GlyphPtr ** head_glyphs, GlyphListPtr cur_list, int cur_pos, int cur_x, int cur_y, int x1, int y1, int x2, int y2, GlyphListPtr *head_list, int *head_pos, int *head_x, int *head_y, int *fixed_cnt, int type, BoxPtr prev_extents) { int x_off = 0; int y_off = 0; int n_off = 0; int list_cnt; if (type == NON_INTERSECTED) { if (x1 < prev_extents->x2 && x2 > prev_extents->x1 && y1 < prev_extents->y2 && y2 > prev_extents->y1) return FALSE; x_off = (*(cur_glyphs - 1))->info.xOff; y_off = (*(cur_glyphs - 1))->info.yOff; n_off = 1; } list_cnt = cur_list - *head_list + 1; if (cur_pos <= n_off) { DEBUGF("break at %d n_off %d\n", cur_pos, n_off); list_cnt--; if (cur_pos < n_off) { /* we overlap with previous list's last glyph. */ x_off += cur_list->xOff; y_off += cur_list->yOff; cur_list--; cur_pos = cur_list->len; if (cur_pos <= n_off) { list_cnt--; } } } DEBUGF("got %d lists\n", list_cnt); if (list_cnt != 0) { fixed_list->list = malloc(list_cnt * sizeof(*cur_list)); memcpy(fixed_list->list, *head_list, list_cnt * sizeof(*cur_list)); fixed_list->list[0].xOff = *head_x; fixed_list->list[0].yOff = *head_y; fixed_list->glyphs = *head_glyphs; fixed_list->type = type & INTERSECTED_TYPE_MASK; fixed_list->nlist = list_cnt; if (cur_list != *head_list) { fixed_list->list[0].len = (*head_list)->len - *head_pos; if (cur_pos != n_off) fixed_list->list[list_cnt - 1].len = cur_pos - n_off; } else fixed_list->list[0].len = cur_pos - *head_pos - n_off; (*fixed_cnt)++; } if (type <= INTERSECTED) { *head_list = cur_list; *head_pos = cur_pos - n_off; *head_x = cur_x - x_off; *head_y = cur_y - y_off; *head_glyphs = cur_glyphs - n_off; } return TRUE; } /* * This function detects glyph lists's overlapping. * * If check_fake_overlap is set, then it will check the glyph's left * and right small boxes's real overlapping pixels. And if there is * no real pixel overlapping, then it will not be treated as overlapped * case. And we also can configured it to ignore less than 2 pixels * overlappig. * * This function analyzes all the lists and split the list to multiple * lists which are pure overlapped glyph lists or pure non-overlapped * list if the overlapping only ocurr on the two adjacent glyphs. * Otherwise, it return -1. * **/ static int glamor_glyphs_intersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs, PictFormatShort mask_format, ScreenPtr screen, Bool check_fake_overlap, struct glamor_glyph_list *fixed_list, int fixed_size) { int x1, x2, y1, y2; int n; int x, y; BoxPtr extents; BoxRec prev_extents; Bool first = TRUE, first_list = TRUE; Bool need_free_list_region = FALSE; Bool need_free_fixed_list = FALSE; struct glamor_glyph *priv = NULL; Bool in_non_intersected_list = -1; GlyphListPtr head_list; int head_x, head_y, head_pos; int fixed_cnt = 0; GlyphPtr *head_glyphs; GlyphListPtr cur_list = list; RegionRec list_region; RegionRec current_region; BoxRec current_box; if (nlist > 1) { pixman_region_init(&list_region); need_free_list_region = TRUE; } pixman_region_init(¤t_region); extents = pixman_region_extents(¤t_region); x = 0; y = 0; x1 = x2 = y1 = y2 = 0; n = 0; extents->x1 = 0; extents->y1 = 0; extents->x2 = 0; extents->y2 = 0; head_list = list; DEBUGF("has %d lists.\n", nlist); while (nlist--) { BoxRec left_box, right_box = { 0 }; Bool has_left_edge_box = FALSE, has_right_edge_box = FALSE; Bool left_to_right; struct glamor_glyph *left_priv = NULL, *right_priv = NULL; x += list->xOff; y += list->yOff; n = list->len; left_to_right = TRUE; cur_list = list++; if (_X_UNLIKELY(!first_list)) { pixman_region_init_with_extents(¤t_region, extents); pixman_region_union(&list_region, &list_region, ¤t_region); first = TRUE; } else { head_list = cur_list; head_pos = cur_list->len - n; head_x = x; head_y = y; head_glyphs = glyphs; } DEBUGF("current list %p has %d glyphs\n", cur_list, n); while (n--) { GlyphPtr glyph = *glyphs++; DEBUGF("the %dth glyph\n", cur_list->len - n - 1); if (glyph->info.width == 0 || glyph->info.height == 0) { x += glyph->info.xOff; y += glyph->info.yOff; continue; } if (mask_format && mask_format != GlyphPicture(glyph)[screen->myNum]->format) { need_free_fixed_list = TRUE; goto done; } x1 = x - glyph->info.x; if (x1 < MINSHORT) x1 = MINSHORT; y1 = y - glyph->info.y; if (y1 < MINSHORT) y1 = MINSHORT; if (check_fake_overlap) priv = glamor_glyph_get_private(screen, glyph); x2 = x1 + glyph->info.width; y2 = y1 + glyph->info.height; if (x2 > MAXSHORT) x2 = MAXSHORT; if (y2 > MAXSHORT) y2 = MAXSHORT; if (first) { extents->x1 = x1; extents->y1 = y1; extents->x2 = x2; extents->y2 = y2; prev_extents = *extents; first = FALSE; if (check_fake_overlap && priv && priv->has_edge_map && glyph->info.yOff == 0) { left_box.x1 = x1; left_box.x2 = x1 + 1; left_box.y1 = y1; right_box.x1 = x2 - 2; right_box.x2 = x2 - 1; right_box.y1 = y1; left_priv = right_priv = priv; has_left_edge_box = TRUE; has_right_edge_box = TRUE; } } else { if (_X_UNLIKELY(!first_list)) { current_box.x1 = x1; current_box.y1 = y1; current_box.x2 = x2; current_box.y2 = y2; if (pixman_region_contains_rectangle (&list_region, ¤t_box) != PIXMAN_REGION_OUT) { need_free_fixed_list = TRUE; goto done; } } if (x1 < extents->x2 && x2 > extents->x1 && y1 < extents->y2 && y2 > extents->y1) { if (check_fake_overlap && (has_left_edge_box || has_right_edge_box) && priv->has_edge_map && glyph->info.yOff == 0) { int left_dx, right_dx; unsigned long long intersected; left_dx = has_left_edge_box ? 1 : 0; right_dx = has_right_edge_box ? 1 : 0; if (x1 + 1 < extents->x2 - right_dx && x2 - 1 > extents->x1 + left_dx) goto real_intersected; if (left_to_right && has_right_edge_box) { if (x1 == right_box.x1) { intersected = ((priv->left_x1_map & right_priv-> right_x1_map) | (priv->left_x2_map & right_priv-> right_x2_map)); if (intersected) goto real_intersected; } else if (x1 == right_box.x2) { intersected = (priv->left_x1_map & right_priv-> right_x2_map); if (intersected) { #ifdef GLYPHS_EDEGE_OVERLAP_LOOSE_CHECK /* tolerate with two pixels overlap. */ intersected &= ~(1 << __fls(intersected)); if ((intersected & (intersected - 1))) #endif goto real_intersected; } } } else if (!left_to_right && has_left_edge_box) { if (x2 - 1 == left_box.x1) { intersected = (priv->right_x2_map & left_priv-> left_x1_map); if (intersected) { #ifdef GLYPHS_EDEGE_OVERLAP_LOOSE_CHECK /* tolerate with two pixels overlap. */ intersected &= ~(1 << __fls(intersected)); if ((intersected & (intersected - 1))) #endif goto real_intersected; } } else if (x2 - 1 == right_box.x2) { if ((priv->right_x1_map & left_priv-> left_x1_map) || (priv->right_x2_map & left_priv-> left_x2_map)) goto real_intersected; } } else { if (x1 < extents->x2 && x1 + 2 > extents->x1) goto real_intersected; } goto non_intersected; } else { real_intersected: DEBUGF("overlap with previous glyph.\n"); if (in_non_intersected_list == 1) { if (fixed_cnt >= fixed_size) { need_free_fixed_list = TRUE; goto done; } if (!glyph_new_fixed_list(&fixed_list[fixed_cnt], glyphs - 1, &head_glyphs, cur_list, cur_list->len - (n + 1), x, y, x1, y1, x2, y2, &head_list, &head_pos, &head_x, &head_y, &fixed_cnt, NON_INTERSECTED, &prev_extents)) { need_free_fixed_list = TRUE; goto done; } } in_non_intersected_list = 0; } } else { non_intersected: DEBUGF("doesn't overlap with previous glyph.\n"); if (in_non_intersected_list == 0) { if (fixed_cnt >= fixed_size) { need_free_fixed_list = TRUE; goto done; } if (!glyph_new_fixed_list(&fixed_list[fixed_cnt], glyphs - 1, &head_glyphs, cur_list, cur_list->len - (n + 1), x, y, x1, y1, x2, y2, &head_list, &head_pos, &head_x, &head_y, &fixed_cnt, INTERSECTED, &prev_extents)) { need_free_fixed_list = TRUE; goto done; } } in_non_intersected_list = 1; } prev_extents = *extents; } if (check_fake_overlap && priv && priv->has_edge_map && glyph->info.yOff == 0) { if (!has_left_edge_box || x1 < extents->x1) { left_box.x1 = x1; left_box.x2 = x1 + 1; left_box.y1 = y1; has_left_edge_box = TRUE; left_priv = priv; } if (!has_right_edge_box || x2 > extents->x2) { right_box.x1 = x2 - 2; right_box.x2 = x2 - 1; right_box.y1 = y1; has_right_edge_box = TRUE; right_priv = priv; } } if (x1 < extents->x1) extents->x1 = x1; if (x2 > extents->x2) extents->x2 = x2; if (y1 < extents->y1) extents->y1 = y1; if (y2 > extents->y2) extents->y2 = y2; x += glyph->info.xOff; y += glyph->info.yOff; } first_list = FALSE; } if (in_non_intersected_list == 0 && fixed_cnt == 0) { fixed_cnt = -1; goto done; } if ((in_non_intersected_list != -1 || head_pos != n) && (fixed_cnt > 0)) { if (fixed_cnt >= fixed_size) { need_free_fixed_list = TRUE; goto done; } if (!glyph_new_fixed_list(&fixed_list[fixed_cnt], glyphs - 1, &head_glyphs, cur_list, cur_list->len - (n + 1), x, y, x1, y1, x2, y2, &head_list, &head_pos, &head_x, &head_y, &fixed_cnt, (!in_non_intersected_list) | 0x80, &prev_extents)) { need_free_fixed_list = TRUE; goto done; } } done: if (need_free_list_region) pixman_region_fini(&list_region); pixman_region_fini(¤t_region); if (need_free_fixed_list && fixed_cnt >= 0) { while (fixed_cnt--) { free(fixed_list[fixed_cnt].list); } } DEBUGF("Got %d fixed list \n", fixed_cnt); return fixed_cnt; } static inline unsigned int glamor_glyph_size_to_count(int size) { size /= GLYPH_MIN_SIZE; return size * size; } static inline unsigned int glamor_glyph_count_to_mask(int count) { return ~(count - 1); } static inline unsigned int glamor_glyph_size_to_mask(int size) { return glamor_glyph_count_to_mask(glamor_glyph_size_to_count(size)); } static PicturePtr glamor_glyph_cache(glamor_screen_private *glamor, GlyphPtr glyph, int *out_x, int *out_y) { ScreenPtr screen = glamor->screen; PicturePtr glyph_picture = GlyphPicture(glyph)[screen->myNum]; glamor_glyph_cache_t *cache = &glamor->glyphCaches[PICT_FORMAT_RGB(glyph_picture->format) != 0]; struct glamor_glyph *priv = NULL, *evicted_priv = NULL; int size, mask, pos, s; if (glyph->info.width > GLYPH_MAX_SIZE || glyph->info.height > GLYPH_MAX_SIZE) return NULL; for (size = GLYPH_MIN_SIZE; size <= GLYPH_MAX_SIZE; size *= 2) if (glyph->info.width <= size && glyph->info.height <= size) break; s = glamor_glyph_size_to_count(size); mask = glamor_glyph_count_to_mask(s); pos = (cache->count + s - 1) & mask; priv = glamor_glyph_get_private(screen, glyph); if (pos < GLYPH_CACHE_SIZE) { cache->count = pos + s; } else { for (s = size; s <= GLYPH_MAX_SIZE; s *= 2) { int i = cache->evict & glamor_glyph_size_to_mask(s); GlyphPtr evicted = cache->glyphs[i]; if (evicted == NULL) continue; evicted_priv = glamor_glyph_get_private(screen, evicted); assert(evicted_priv->pos == i); if (evicted_priv->size >= s) { cache->glyphs[i] = NULL; evicted_priv->cached = FALSE; pos = cache->evict & glamor_glyph_size_to_mask(size); } else evicted_priv = NULL; break; } if (evicted_priv == NULL) { int count = glamor_glyph_size_to_count(size); mask = glamor_glyph_count_to_mask(count); pos = cache->evict & mask; for (s = 0; s < count; s++) { GlyphPtr evicted = cache->glyphs[pos + s]; if (evicted != NULL) { evicted_priv = glamor_glyph_get_private(screen, evicted); assert(evicted_priv->pos == pos + s); evicted_priv->cached = FALSE; cache->glyphs[pos + s] = NULL; } } } /* And pick a new eviction position */ cache->evict = rand() % GLYPH_CACHE_SIZE; } cache->glyphs[pos] = glyph; priv->cache = cache; priv->size = size; priv->pos = pos; s = pos / ((GLYPH_MAX_SIZE / GLYPH_MIN_SIZE) * (GLYPH_MAX_SIZE / GLYPH_MIN_SIZE)); priv->x = s % (CACHE_PICTURE_SIZE / GLYPH_MAX_SIZE) * GLYPH_MAX_SIZE; priv->y = (s / (CACHE_PICTURE_SIZE / GLYPH_MAX_SIZE)) * GLYPH_MAX_SIZE; for (s = GLYPH_MIN_SIZE; s < GLYPH_MAX_SIZE; s *= 2) { if (pos & 1) priv->x += s; if (pos & 2) priv->y += s; pos >>= 2; } glamor_glyph_cache_upload_glyph(screen, cache, glyph, priv->x, priv->y); #ifndef GLYPHS_NO_EDEGEMAP_OVERLAP_CHECK if (priv->has_edge_map == FALSE && glyph->info.width >= 2) glamor_glyph_priv_get_edge_map(glyph, priv, glyph_picture); #endif priv->cached = TRUE; *out_x = priv->x; *out_y = priv->y; return cache->picture; } typedef void (*glyphs_flush_func) (void *arg); struct glyphs_flush_dst_arg { CARD8 op; PicturePtr src; PicturePtr dst; glamor_glyph_buffer_t *buffer; int x_src, y_src; int x_dst, y_dst; }; static struct glyphs_flush_dst_arg dst_arg; static struct glyphs_flush_mask_arg mask_arg; static glamor_glyph_buffer_t dst_buffer; static glamor_glyph_buffer_t mask_buffer; unsigned long long mask_glyphs_cnt = 0; unsigned long long dst_glyphs_cnt = 0; #define GLYPHS_DST_MODE_VIA_MASK 0 #define GLYPHS_DST_MODE_VIA_MASK_CACHE 1 #define GLYPHS_DST_MODE_TO_DST 2 #define GLYPHS_DST_MODE_MASK_TO_DST 3 struct glyphs_flush_mask_arg { PicturePtr mask; glamor_glyph_buffer_t *buffer; glamor_glyph_mask_cache_t *maskcache; unsigned int used_bitmap; }; static void glamor_glyphs_flush_mask(struct glyphs_flush_mask_arg *arg) { if (arg->buffer->count > 0) { #ifdef RENDER glamor_composite_glyph_rects(PictOpAdd, arg->buffer->source, NULL, arg->mask, arg->buffer->count, arg->buffer->rects); #endif } arg->buffer->count = 0; arg->buffer->source = NULL; } static void glamor_glyphs_flush_dst(struct glyphs_flush_dst_arg *arg) { if (!arg->buffer) return; if (mask_buffer.count > 0) { glamor_glyphs_flush_mask(&mask_arg); } if (mask_arg.used_bitmap) { put_mask_cache_bitmap(mask_arg.maskcache, mask_arg.used_bitmap); mask_arg.used_bitmap = 0; } if (arg->buffer->count > 0) { glamor_composite_glyph_rects(arg->op, arg->src, arg->buffer->source, arg->dst, arg->buffer->count, &arg->buffer->rects[0]); arg->buffer->count = 0; arg->buffer->source = NULL; } } static glamor_glyph_cache_result_t glamor_buffer_glyph(glamor_screen_private *glamor_priv, glamor_glyph_buffer_t *buffer, PictFormatShort format, GlyphPtr glyph, struct glamor_glyph *priv, int x_glyph, int y_glyph, int dx, int dy, int w, int h, int glyphs_dst_mode, glyphs_flush_func glyphs_flush, void *flush_arg) { ScreenPtr screen = glamor_priv->screen; glamor_composite_rect_t *rect; PicturePtr source; int x, y; glamor_glyph_cache_t *cache; if (glyphs_dst_mode != GLYPHS_DST_MODE_MASK_TO_DST) priv = glamor_glyph_get_private(screen, glyph); if (PICT_FORMAT_BPP(format) == 1) format = PICT_a8; cache = &glamor_priv->glyphCaches[PICT_FORMAT_RGB(format) != 0]; if (buffer->source && buffer->source != cache->picture && glyphs_flush) { (*glyphs_flush) (flush_arg); glyphs_flush = NULL; } if (buffer->count == GLYPH_BUFFER_SIZE && glyphs_flush) { (*glyphs_flush) (flush_arg); glyphs_flush = NULL; } if (priv && priv->cached) { rect = &buffer->rects[buffer->count++]; rect->x_src = priv->x + dx; rect->y_src = priv->y + dy; if (buffer->source == NULL) buffer->source = priv->cache->picture; if (glyphs_dst_mode <= GLYPHS_DST_MODE_VIA_MASK_CACHE) assert(priv->cache->glyphs[priv->pos] == glyph); } else { assert(glyphs_dst_mode != GLYPHS_DST_MODE_MASK_TO_DST); if (glyphs_flush) (*glyphs_flush) (flush_arg); source = glamor_glyph_cache(glamor_priv, glyph, &x, &y); if (source != NULL) { rect = &buffer->rects[buffer->count++]; rect->x_src = x + dx; rect->y_src = y + dy; if (buffer->source == NULL) buffer->source = source; if (glyphs_dst_mode == GLYPHS_DST_MODE_VIA_MASK_CACHE) { /* mode 1 means we are using global mask cache, * thus we have to composite from the cache picture * to the cache picture, we need a flush here to make * sure latter we get the corret glyphs data.*/ glamor_make_current(glamor_priv); glFlush(); } } else { /* Couldn't find the glyph in the cache, use the glyph picture directly */ source = GlyphPicture(glyph)[screen->myNum]; if (buffer->source && buffer->source != source && glyphs_flush) (*glyphs_flush) (flush_arg); buffer->source = source; rect = &buffer->rects[buffer->count++]; rect->x_src = 0 + dx; rect->y_src = 0 + dy; } priv = glamor_glyph_get_private(screen, glyph); } rect->x_dst = x_glyph; rect->y_dst = y_glyph; if (glyphs_dst_mode != GLYPHS_DST_MODE_MASK_TO_DST) { rect->x_dst -= glyph->info.x; rect->y_dst -= glyph->info.y; } rect->width = w; rect->height = h; if (glyphs_dst_mode > GLYPHS_DST_MODE_VIA_MASK_CACHE) { rect->x_mask = rect->x_src; rect->y_mask = rect->y_src; rect->x_src = dst_arg.x_src + rect->x_dst - dst_arg.x_dst; rect->y_src = dst_arg.y_src + rect->y_dst - dst_arg.y_dst; } return GLAMOR_GLYPH_SUCCESS; } static void glamor_buffer_glyph_clip(glamor_screen_private *glamor_priv, BoxPtr rects, int nrect, PictFormatShort format, GlyphPtr glyph, struct glamor_glyph *priv, int glyph_x, int glyph_y, int glyph_dx, int glyph_dy, int width, int height, int glyphs_mode, glyphs_flush_func flush_func, void *arg) { int i; for (i = 0; i < nrect; i++) { int dst_x, dst_y; int dx, dy; int x2, y2; dst_x = glyph_x - glyph_dx; dst_y = glyph_y - glyph_dy; x2 = dst_x + width; y2 = dst_y + height; dx = dy = 0; if (rects[i].y1 >= y2) break; if (dst_x < rects[i].x1) dx = rects[i].x1 - dst_x, dst_x = rects[i].x1; if (x2 > rects[i].x2) x2 = rects[i].x2; if (dst_y < rects[i].y1) dy = rects[i].y1 - dst_y, dst_y = rects[i].y1; if (y2 > rects[i].y2) y2 = rects[i].y2; if (dst_x < x2 && dst_y < y2) { glamor_buffer_glyph(glamor_priv, &dst_buffer, format, glyph, priv, dst_x + glyph_dx, dst_y + glyph_dy, dx, dy, x2 - dst_x, y2 - dst_y, glyphs_mode, flush_func, arg); } } } static void glamor_glyphs_via_mask(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs, Bool use_mask_cache) { PixmapPtr mask_pixmap = 0; PicturePtr mask; ScreenPtr screen = dst->pDrawable->pScreen; int width = 0, height = 0; int x, y; int x_dst = list->xOff, y_dst = list->yOff; int n; GlyphPtr glyph; int error; BoxRec extents = { 0, 0, 0, 0 }; XID component_alpha; glamor_screen_private *glamor_priv; int need_free_mask = FALSE; glamor_glyph_buffer_t buffer; struct glyphs_flush_mask_arg arg; glamor_glyph_buffer_t *pmask_buffer; struct glyphs_flush_mask_arg *pmask_arg; struct glamor_glyph_mask_cache_entry *mce = NULL; glamor_glyph_mask_cache_t *maskcache; glamor_glyph_cache_t *cache; int glyphs_dst_mode; glamor_glyph_extents(nlist, list, glyphs, &extents); if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) return; glamor_priv = glamor_get_screen_private(screen); width = extents.x2 - extents.x1; height = extents.y2 - extents.y1; if (mask_format->depth == 1) { PictFormatPtr a8Format = PictureMatchFormat(screen, 8, PICT_a8); if (a8Format) mask_format = a8Format; } cache = &glamor_priv->glyphCaches [PICT_FORMAT_RGB(mask_format->format) != 0]; maskcache = glamor_priv->mask_cache[PICT_FORMAT_RGB(mask_format->format) != 0]; x = -extents.x1; y = -extents.y1; if (!use_mask_cache || width > (CACHE_PICTURE_SIZE / 4) || height > MASK_CACHE_MAX_SIZE) { new_mask_pixmap: mask_pixmap = glamor_create_pixmap(screen, width, height, mask_format->depth, CREATE_PIXMAP_USAGE_SCRATCH); if (!mask_pixmap) { glamor_destroy_pixmap(mask_pixmap); return; } glamor_solid(mask_pixmap, 0, 0, width, height, 0); component_alpha = NeedsComponent(mask_format->format); mask = CreatePicture(0, &mask_pixmap->drawable, mask_format, CPComponentAlpha, &component_alpha, serverClient, &error); if (!mask) return; need_free_mask = TRUE; pmask_arg = &arg; pmask_buffer = &buffer; pmask_buffer->count = 0; pmask_buffer->source = NULL; pmask_arg->used_bitmap = 0; glyphs_dst_mode = GLYPHS_DST_MODE_VIA_MASK; } else { int retry_cnt = 0; retry: mce = get_mask_cache(maskcache, (width + MASK_CACHE_MAX_SIZE - 1) / MASK_CACHE_MAX_SIZE); if (mce == NULL) { glamor_glyphs_flush_dst(&dst_arg); retry_cnt++; if (retry_cnt > 2) { assert(0); goto new_mask_pixmap; } goto retry; } mask = cache->picture; x += mce->x; y += mce->y; mce->width = (width + MASK_CACHE_MAX_SIZE - 1) / MASK_CACHE_MAX_SIZE; mce->height = 1; if (mask_arg.mask && mask_arg.mask != mask && mask_buffer.count != 0) glamor_glyphs_flush_dst(&dst_arg); pmask_arg = &mask_arg; pmask_buffer = &mask_buffer; pmask_arg->maskcache = maskcache; glyphs_dst_mode = GLYPHS_DST_MODE_VIA_MASK_CACHE; } pmask_arg->mask = mask; pmask_arg->buffer = pmask_buffer; while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; mask_glyphs_cnt += n; while (n--) { glyph = *glyphs++; if (glyph->info.width > 0 && glyph->info.height > 0) { glyphs_flush_func flush_func; void *temp_arg; if (need_free_mask) { if (pmask_buffer->count) flush_func = (glyphs_flush_func) glamor_glyphs_flush_mask; else flush_func = NULL; temp_arg = pmask_arg; } else { /* If we are using global mask cache, then we need to * flush dst instead of mask. As some dst depends on the * previous mask result. Just flush mask can't get all previous's * overlapped glyphs.*/ if (dst_buffer.count || mask_buffer.count) flush_func = (glyphs_flush_func) glamor_glyphs_flush_dst; else flush_func = NULL; temp_arg = &dst_arg; } glamor_buffer_glyph(glamor_priv, pmask_buffer, mask_format->format, glyph, NULL, x, y, 0, 0, glyph->info.width, glyph->info.height, glyphs_dst_mode, flush_func, (void *) temp_arg); } x += glyph->info.xOff; y += glyph->info.yOff; } list++; } x = extents.x1; y = extents.y1; if (need_free_mask) { glamor_glyphs_flush_mask(pmask_arg); CompositePicture(op, src, mask, dst, x_src + x - x_dst, y_src + y - y_dst, 0, 0, x, y, width, height); FreePicture(mask, 0); glamor_destroy_pixmap(mask_pixmap); } else { struct glamor_glyph priv; glyphs_flush_func flush_func; BoxPtr rects; int nrect; priv.cache = cache; priv.x = mce->x; priv.y = mce->y; priv.cached = TRUE; rects = REGION_RECTS(dst->pCompositeClip); nrect = REGION_NUM_RECTS(dst->pCompositeClip); pmask_arg->used_bitmap |= ((1 << mce->width) - 1) << mce->idx; dst_arg.op = op; dst_arg.src = src; dst_arg.dst = dst; dst_arg.buffer = &dst_buffer; dst_arg.x_src = x_src; dst_arg.y_src = y_src; dst_arg.x_dst = x_dst; dst_arg.y_dst = y_dst; if (dst_buffer.source == NULL) { dst_buffer.source = cache->picture; } else if (dst_buffer.source != cache->picture) { glamor_glyphs_flush_dst(&dst_arg); dst_buffer.source = cache->picture; } x += dst->pDrawable->x; y += dst->pDrawable->y; if (dst_buffer.count || mask_buffer.count) flush_func = (glyphs_flush_func) glamor_glyphs_flush_dst; else flush_func = NULL; glamor_buffer_glyph_clip(glamor_priv, rects, nrect, mask_format->format, NULL, &priv, x, y, 0, 0, width, height, GLYPHS_DST_MODE_MASK_TO_DST, flush_func, (void *) &dst_arg); } } static void glamor_glyphs_to_dst(CARD8 op, PicturePtr src, PicturePtr dst, INT16 x_src, INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs) { ScreenPtr screen = dst->pDrawable->pScreen; int x = 0, y = 0; int x_dst = list->xOff, y_dst = list->yOff; int n; GlyphPtr glyph; BoxPtr rects; int nrect; glamor_screen_private *glamor_priv; rects = REGION_RECTS(dst->pCompositeClip); nrect = REGION_NUM_RECTS(dst->pCompositeClip); glamor_priv = glamor_get_screen_private(screen); dst_arg.op = op; dst_arg.src = src; dst_arg.dst = dst; dst_arg.buffer = &dst_buffer; dst_arg.x_src = x_src; dst_arg.y_src = y_src; dst_arg.x_dst = x_dst; dst_arg.y_dst = y_dst; x = dst->pDrawable->x; y = dst->pDrawable->y; while (nlist--) { x += list->xOff; y += list->yOff; n = list->len; dst_glyphs_cnt += n; while (n--) { glyph = *glyphs++; if (glyph->info.width > 0 && glyph->info.height > 0) { glyphs_flush_func flush_func; if (dst_buffer.count || mask_buffer.count) flush_func = (glyphs_flush_func) glamor_glyphs_flush_dst; else flush_func = NULL; glamor_buffer_glyph_clip(glamor_priv, rects, nrect, (GlyphPicture(glyph)[screen->myNum])-> format, glyph, NULL, x, y, glyph->info.x, glyph->info.y, glyph->info.width, glyph->info.height, GLYPHS_DST_MODE_TO_DST, flush_func, (void *) &dst_arg); } x += glyph->info.xOff; y += glyph->info.yOff; } list++; } } #define MAX_FIXED_SIZE static void glamor_glyphs_reset_buffer(glamor_glyph_buffer_t *buffer) { buffer->count = 0; buffer->source = NULL; } static Bool _glamor_glyphs(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs, Bool fallback) { PictFormatShort format; int fixed_size, fixed_cnt = 0; struct glamor_glyph_list *fixed_list = NULL; Bool need_free_list = FALSE; #ifndef GLYPHS_NO_EDEGEMAP_OVERLAP_CHECK Bool check_fake_overlap = TRUE; if (!(op == PictOpOver || op == PictOpAdd || op == PictOpXor)) { /* C = (0,0,0,0) D = glyphs , SRC = A, DEST = B (faked overlapped glyphs, overlapped with (0,0,0,0)). * For those op, (A IN (C ADD D)) OP B != (A IN D) OP ((A IN C) OP B) * or (A IN (D ADD C)) OP B != (A IN C) OP ((A IN D) OP B) * We need to split the faked regions to three or two, and composite the disoverlapped small * boxes one by one. For other Ops, it's safe to composite the whole box. */ check_fake_overlap = FALSE; } #else Bool check_fake_overlap = FALSE; #endif if (mask_format) format = mask_format->depth << 24 | mask_format->format; else format = 0; fixed_size = 32; glamor_glyphs_reset_buffer(&dst_buffer); if (!mask_format || (((nlist == 1 && list->len == 1) || op == PictOpAdd) && (dst->format == ((mask_format->depth << 24) | mask_format-> format)))) { glamor_glyphs_to_dst(op, src, dst, x_src, y_src, nlist, list, glyphs); goto last_flush; } glamor_glyphs_reset_buffer(&mask_buffer); /* We have mask_format. Need to check the real overlap or not. */ format = mask_format->depth << 24 | mask_format->format; fixed_list = calloc(fixed_size, sizeof(*fixed_list)); if (_X_UNLIKELY(fixed_list == NULL)) fixed_size = 0; fixed_cnt = glamor_glyphs_intersect(nlist, list, glyphs, format, dst->pDrawable->pScreen, check_fake_overlap, fixed_list, fixed_size); if (fixed_cnt == 0) mask_format = NULL; need_free_list = TRUE; if (fixed_cnt <= 0) { if (mask_format == NULL) { glamor_glyphs_to_dst(op, src, dst, x_src, y_src, nlist, list, glyphs); goto last_flush; } else { glamor_glyphs_via_mask(op, src, dst, mask_format, x_src, y_src, nlist, list, glyphs, FALSE); goto free_fixed_list; } } else { /* We have splitted the original list to serval list, some are overlapped * and some are non-overlapped. For the non-overlapped, we render it to * dst directly. For the overlapped, we render it to mask picture firstly, * then render the mask to dst. If we can use mask cache which is in the * glyphs cache's last row, we can accumulate the rendering of mask to dst * with the other dst_buffer's rendering operations thus can reduce the call * of glDrawElements. * * */ struct glamor_glyph_list *saved_list; saved_list = fixed_list; mask_arg.used_bitmap = 0; while (fixed_cnt--) { if (fixed_list->type == NON_INTERSECTED) { glamor_glyphs_to_dst(op, src, dst, x_src, y_src, fixed_list->nlist, fixed_list->list, fixed_list->glyphs); } else glamor_glyphs_via_mask(op, src, dst, mask_format, x_src, y_src, fixed_list->nlist, fixed_list->list, fixed_list->glyphs, TRUE); free(fixed_list->list); fixed_list++; } free(saved_list); need_free_list = FALSE; } last_flush: if (dst_buffer.count || mask_buffer.count) glamor_glyphs_flush_dst(&dst_arg); free_fixed_list: if (need_free_list) { assert(fixed_cnt <= 0); free(fixed_list); } return TRUE; } void glamor_glyphs(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs) { _glamor_glyphs(op, src, dst, mask_format, x_src, y_src, nlist, list, glyphs, TRUE); } Bool glamor_glyphs_nf(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs) { return _glamor_glyphs(op, src, dst, mask_format, x_src, y_src, nlist, list, glyphs, FALSE); } xorg-server-1.17.1/glamor/glamor_lines.c0000664000175100017510000001324212460362577015127 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_program.h" #include "glamor_transform.h" #include "glamor_prepare.h" static const glamor_facet glamor_facet_poly_lines = { .name = "poly_lines", .vs_vars = "attribute vec2 primitive;\n", .vs_exec = (" vec2 pos = vec2(0.0,0.0);\n" GLAMOR_POS(gl_Position, primitive.xy)), }; static Bool glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv; glamor_program *prog; int off_x, off_y; DDXPointPtr v; char *vbo_offset; int box_x, box_y; int add_last; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; add_last = 0; if (gc->capStyle != CapNotLast) add_last = 1; if (n < 2) return TRUE; glamor_make_current(glamor_priv); prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_line_program, &glamor_facet_poly_lines); if (!prog) goto bail_ctx; /* Set up the vertex buffers for the points */ v = glamor_get_vbo_space(drawable->pScreen, (n + add_last) * sizeof (DDXPointRec), &vbo_offset); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, sizeof (DDXPointRec), vbo_offset); if (mode == CoordModePrevious) { int i; DDXPointRec here = { 0, 0 }; for (i = 0; i < n; i++) { here.x += points[i].x; here.y += points[i].y; v[i] = here; } } else { memcpy(v, points, n * sizeof (DDXPointRec)); } if (add_last) { v[n].x = v[n-1].x + 1; v[n].y = v[n-1].y; } glamor_put_vbo_space(screen); glEnable(GL_SCISSOR_TEST); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE, prog->matrix_uniform, &off_x, &off_y); while (nbox--) { glScissor(box->x1 + off_x, box->y1 + off_y, box->x2 - box->x1, box->y2 - box->y1); box++; glDrawArrays(GL_LINE_STRIP, 0, n + add_last); } } glDisable(GL_SCISSOR_TEST); glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } static Bool glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { if (gc->lineWidth != 0) return FALSE; switch (gc->lineStyle) { case LineSolid: return glamor_poly_lines_solid_gl(drawable, gc, mode, n, points); case LineOnOffDash: return glamor_poly_lines_dash_gl(drawable, gc, mode, n, points); case LineDoubleDash: if (gc->fillStyle == FillTiled) return glamor_poly_lines_solid_gl(drawable, gc, mode, n, points); else return glamor_poly_lines_dash_gl(drawable, gc, mode, n, points); default: return FALSE; } } static void glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { glamor_fallback("to %p (%c)\n", drawable, glamor_get_drawable_location(drawable)); miPolylines(drawable, gc, mode, n, points); } void glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { if (glamor_poly_lines_gl(drawable, gc, mode, n, points)) return; glamor_poly_lines_bail(drawable, gc, mode, n, points); } Bool glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { if (glamor_poly_lines_gl(drawable, gc, mode, n, points)) return TRUE; if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) { return FALSE; } glamor_poly_lines_bail(drawable, gc, mode, n, points); return TRUE; } xorg-server-1.17.1/glamor/glamor_transform.c0000664000175100017510000002115112460362577016026 00000000000000/* * Copyright © 2014 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 "glamor_priv.h" #include "glamor_transform.h" /* * Set up rendering to target the specified drawable, computing an * appropriate transform for the vertex shader to convert * drawable-relative coordinates into pixmap-relative coordinates. If * requested, the offset from pixmap origin coordinates back to window * system coordinates will be returned in *p_off_x, *p_off_y so that * clipping computations can be adjusted as appropriate */ void glamor_set_destination_drawable(DrawablePtr drawable, int box_x, int box_y, Bool do_drawable_translate, Bool center_offset, GLint matrix_uniform_location, int *p_off_x, int *p_off_y) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); int off_x, off_y; BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_x, box_y); int w = box->x2 - box->x1; int h = box->y2 - box->y1; float scale_x = 2.0f / (float) w; float scale_y = 2.0f / (float) h; float center_adjust = 0.0f; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); off_x -= box->x1; off_y -= box->y1; if (p_off_x) { *p_off_x = off_x; *p_off_y = off_y; } /* A tricky computation to find the right value for the two linear functions * that transform rendering coordinates to pixmap coordinates * * pixmap_x = render_x + drawable->x + off_x * pixmap_y = render_y + drawable->y + off_y * * gl_x = pixmap_x * 2 / width - 1 * gl_y = pixmap_y * 2 / height - 1 * * gl_x = (render_x + drawable->x + off_x) * 2 / width - 1 * * gl_x = (render_x) * 2 / width + (drawable->x + off_x) * 2 / width - 1 * * I'll think about yInverted later, when I have some way to test */ if (do_drawable_translate) { off_x += drawable->x; off_y += drawable->y; } /* * To get GL_POINTS drawn in the right spot, we need to adjust the * coordinates by 1/2 a pixel. */ if (center_offset) center_adjust = 0.5f; glUniform4f(matrix_uniform_location, scale_x, (off_x + center_adjust) * scale_x - 1.0f, scale_y, (off_y + center_adjust) * scale_y - 1.0f); glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo_at(pixmap_priv, box_x, box_y), 0, 0, w, h); } /* * Set up for solid rendering to the specified pixmap using alu, fg and planemask * from the specified GC. Load the target color into the specified uniform */ void glamor_set_color(PixmapPtr pixmap, CARD32 pixel, GLint uniform) { float color[4]; glamor_get_rgba_from_pixel(pixel, &color[0], &color[1], &color[2], &color[3], format_for_pixmap(pixmap)); glUniform4fv(uniform, 1, color); } Bool glamor_set_solid(PixmapPtr pixmap, GCPtr gc, Bool use_alu, GLint uniform) { CARD32 pixel; int alu = use_alu ? gc->alu : GXcopy; if (!glamor_set_planemask(pixmap, gc->planemask)) return FALSE; pixel = gc->fgPixel; if (!glamor_set_alu(pixmap->drawable.pScreen, alu)) { switch (gc->alu) { case GXclear: pixel = 0; break; case GXcopyInverted: pixel = ~pixel; break; case GXset: pixel = ~0 & gc->planemask; break; default: return FALSE; } } glamor_set_color(pixmap, gc->fgPixel, uniform); return TRUE; } Bool glamor_set_texture(PixmapPtr pixmap, PixmapPtr texture, int off_x, int off_y, GLint offset_uniform, GLint size_uniform) { glamor_pixmap_private *texture_priv; texture_priv = glamor_get_pixmap_private(texture); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(texture_priv)) return FALSE; if (texture_priv->type == GLAMOR_TEXTURE_LARGE) return FALSE; glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture_priv->base.fbo->tex); glUniform2f(offset_uniform, off_x, off_y); glUniform2f(size_uniform, texture->drawable.width, texture->drawable.height); return TRUE; } Bool glamor_set_tiled(PixmapPtr pixmap, GCPtr gc, GLint offset_uniform, GLint size_uniform) { if (!glamor_set_alu(pixmap->drawable.pScreen, gc->alu)) return FALSE; if (!glamor_set_planemask(pixmap, gc->planemask)) return FALSE; return glamor_set_texture(pixmap, gc->tile.pixmap, -gc->patOrg.x, -gc->patOrg.y, offset_uniform, size_uniform); } static PixmapPtr glamor_get_stipple_pixmap(GCPtr gc) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); ScreenPtr screen = gc->pScreen; PixmapPtr bitmap; PixmapPtr pixmap; GCPtr scratch_gc; ChangeGCVal changes[2]; if (gc_priv->stipple) return gc_priv->stipple; bitmap = gc->stipple; if (!bitmap) goto bail; pixmap = glamor_create_pixmap(screen, bitmap->drawable.width, bitmap->drawable.height, 8, GLAMOR_CREATE_NO_LARGE); if (!pixmap) goto bail; scratch_gc = GetScratchGC(8, screen); if (!scratch_gc) goto bail_pixmap; changes[0].val = 0xff; changes[1].val = 0x00; if (ChangeGC(NullClient, scratch_gc, GCForeground|GCBackground, changes) != Success) goto bail_gc; ValidateGC(&pixmap->drawable, scratch_gc); (*scratch_gc->ops->CopyPlane)(&bitmap->drawable, &pixmap->drawable, scratch_gc, 0, 0, bitmap->drawable.width, bitmap->drawable.height, 0, 0, 0x1); FreeScratchGC(scratch_gc); gc_priv->stipple = pixmap; glamor_track_stipple(gc); return pixmap; bail_gc: FreeScratchGC(scratch_gc); bail_pixmap: glamor_destroy_pixmap(pixmap); bail: return NULL; } Bool glamor_set_stippled(PixmapPtr pixmap, GCPtr gc, GLint fg_uniform, GLint offset_uniform, GLint size_uniform) { PixmapPtr stipple; stipple = glamor_get_stipple_pixmap(gc); if (!stipple) return FALSE; if (!glamor_set_solid(pixmap, gc, TRUE, fg_uniform)) return FALSE; return glamor_set_texture(pixmap, stipple, -gc->patOrg.x, -gc->patOrg.y, offset_uniform, size_uniform); } xorg-server-1.17.1/man/0000775000175100017510000000000012466505443011655 500000000000000xorg-server-1.17.1/man/Makefile.am0000664000175100017510000000036312160102336013614 00000000000000# Xserver.man covers options generic to all X servers built in this tree # (i.e. those handled in the os/utils.c options processing instead of in # the DDX-level options processing) include $(top_srcdir)/manpages.am appman_PRE = Xserver.man xorg-server-1.17.1/man/Xserver.man0000664000175100017510000006016012456571574013742 00000000000000.\" $Xorg: Xserver.man,v 1.4 2001/02/09 02:04:07 xorgcvs Exp $ .\" $XdotOrg: xserver/xorg/doc/Xserver.man.pre,v 1.4 2005/12/23 20:11:12 alanc Exp $ .\" Copyright 1984 - 1991, 1993, 1994, 1998 The Open Group .\" .\" Permission to use, copy, modify, distribute, and sell this software and its .\" documentation for any purpose is hereby granted without fee, provided that .\" the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting .\" documentation. .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The Open Group shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" $XFree86: xc/programs/Xserver/Xserver.man,v 3.31 2004/01/10 22:27:46 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH XSERVER 1 __xorgversion__ .SH NAME Xserver \- X Window System display server .SH SYNOPSIS .B X [option ...] .SH DESCRIPTION .I X is the generic name for the X Window System display server. It is frequently a link or a copy of the appropriate server binary for driving the most frequently used server on a given machine. .SH "STARTING THE SERVER" The X server is usually started from the X Display Manager program \fIxdm\fP(1) or a similar display manager program. This utility is run from the system boot files and takes care of keeping the server running, prompting for usernames and passwords, and starting up the user sessions. .PP Installations that run more than one window system may need to use the \fIxinit\fP(1) utility instead of a display manager. However, \fIxinit\fP is to be considered a tool for building startup scripts and is not intended for use by end users. Site administrators are \fBstrongly\fP urged to use a display manager, or build other interfaces for novice users. .PP The X server may also be started directly by the user, though this method is usually reserved for testing and is not recommended for normal operation. On some platforms, the user must have special permission to start the X server, often because access to certain devices (e.g. \fI/dev/mouse\fP) is restricted. .PP When the X server starts up, it typically takes over the display. If you are running on a workstation whose console is the display, you may not be able to log into the console while the server is running. .SH OPTIONS Many X servers have device-specific command line options. See the manual pages for the individual servers for more details; a list of server-specific manual pages is provided in the SEE ALSO section below. .PP All of the X servers accept the command line options described below. Some X servers may have alternative ways of providing the parameters described here, but the values provided via the command line options should override values specified via other mechanisms. .TP 8 .B :\fIdisplaynumber\fP The X server runs as the given \fIdisplaynumber\fP, which by default is 0. If multiple X servers are to run simultaneously on a host, each must have a unique display number. See the DISPLAY NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to specify which display number clients should try to use. .TP 8 .B \-a \fInumber\fP sets pointer acceleration (i.e. the ratio of how much is reported to how much the user actually moved the pointer). .TP 8 .B \-ac disables host-based access control mechanisms. Enables access by any host, and permits any host to modify the access control list. Use with extreme caution. This option exists primarily for running test suites remotely. .TP 8 .B \-audit \fIlevel\fP sets the audit trail level. The default level is 1, meaning only connection rejections are reported. Level 2 additionally reports all successful connections and disconnects. Level 4 enables messages from the SECURITY extension, if present, including generation and revocation of authorizations and violations of the security policy. Level 0 turns off the audit trail. Audit lines are sent as standard error output. .TP 8 .B \-auth \fIauthorization-file\fP specifies a file which contains a collection of authorization records used to authenticate access. See also the \fIxdm\fP(1) and \fIXsecurity\fP(__miscmansuffix__) manual pages. .TP 8 .BI \-background\ none Asks the driver not to clear the background on startup, if the driver supports that. May be useful for smooth transition with eg. fbdev driver. For security reasons this is not the default as the screen contents might show a previous user session. .TP 8 .B \-br sets the default root window to solid black instead of the standard root weave pattern. This is the default unless -retro or -wr is specified. .TP 8 .B \-bs disables backing store support on all screens. .TP 8 .B \-c turns off key-click. .TP 8 .B c \fIvolume\fP sets key-click volume (allowable range: 0-100). .TP 8 .B \-cc \fIclass\fP sets the visual class for the root window of color screens. The class numbers are as specified in the X protocol. Not obeyed by all servers. .TP 8 .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), none (no fonts), or 16 (16 bit fonts only). .TP 8 .B \-dpi \fIresolution\fP sets the resolution for all screens, in dots per inch. To be used when the server cannot determine the screen size(s) from the hardware. .TP 8 .B dpms enables DPMS (display power management services), where supported. The default state is platform and configuration specific. .TP 8 .B \-dpms disables DPMS (display power management services). The default state is platform and configuration specific. .TP 8 .BI \-extension extensionName disables named extension. If an unknown extension name is specified, a list of accepted extension names is printed. .TP 8 .BI +extension extensionName enables named extension. If an unknown extension name is specified, a list of accepted extension names is printed. .TP 8 .B \-f \fIvolume\fP sets beep (bell) volume (allowable range: 0-100). .TP 8 .B \-fc \fIcursorFont\fP sets default cursor font. .TP 8 .B \-fn \fIfont\fP sets the default font. .TP 8 .B \-fp \fIfontPath\fP sets the search path for fonts. This path is a comma separated list of directories which the X server searches for font databases. See the FONTS section of this manual page for more information and the default list. .TP 8 .B \-help prints a usage message. .TP 8 .B \-I causes all remaining command line arguments to be ignored. .TP 8 .B \-iglx Prohibit creating indirect GLX contexts. Indirect GLX is of limited use, since it lacks support for many modern OpenGL features and extensions; it's slower than direct contexts; and it opens a large attack surface for protocol parsing errors. This is the default unless +iglx is specified. .TP 8 .B +iglx Allow creating indirect GLX contexts. .TP 8 .B \-maxbigreqsize \fIsize\fP sets the maximum big request to .I size MB. .TP 8 .B \-nocursor disable the display of the pointer cursor. .TP 8 .B \-nolisten \fItrans-type\fP disables a transport type. For example, TCP/IP connections can be disabled with .BR "\-nolisten tcp" . This option may be issued multiple times to disable listening to different transport types. .TP 8 .B \-listen \fItrans-type\fP enables a transport type. For example, TCP/IP connections can be enabled with .BR "\-listen tcp" . This option may be issued multiple times to enable listening to different transport types. .TP 8 .B \-noreset prevents a server reset when the last client connection is closed. This overrides a previous .B \-terminate command line option. .TP 8 .B \-p \fIminutes\fP sets screen-saver pattern cycle time in minutes. .TP 8 .B \-pn permits the server to continue running if it fails to establish all of its well-known sockets (connection points for clients), but establishes at least one. This option is set by default. .TP 8 .B \-nopn causes the server to exit if it fails to establish all of its well-known sockets (connection points for clients). .TP 8 .B \-r turns off auto-repeat. .TP 8 .B r turns on auto-repeat. .TP 8 .B -retro starts the stipple with the classic stipple and cursor visible. The default is to start with a black root window, and to suppress display of the cursor until the first time an application calls XDefineCursor(). For kdrive servers, this implies -zap. .TP 8 .B \-s \fIminutes\fP sets screen-saver timeout time in minutes. .TP 8 .B \-su disables save under support on all screens. .TP 8 .B \-seat \fIseat\fP seat to run on. Takes a string identifying a seat in a platform specific syntax. On platforms which support this feature this may be used to limit the server to expose only a specific subset of devices connected to the system. .TP 8 .B \-t \fInumber\fP sets pointer acceleration threshold in pixels (i.e. after how many pixels pointer acceleration should take effect). .TP 8 .B \-terminate causes the server to terminate at server reset, instead of continuing to run. This overrides a previous .B \-noreset command line option. .TP 8 .B \-to \fIseconds\fP sets default connection timeout in seconds. .TP 8 .B \-tst disables all testing extensions (e.g., XTEST, XTrap, XTestExtension1, RECORD). .TP 8 .B tty\fIxx\fP ignored, for servers started the ancient way (from init). .TP 8 .B v sets video-off screen-saver preference. .TP 8 .B \-v sets video-on screen-saver preference. .TP 8 .B \-wm forces the default backing-store of all windows to be WhenMapped. This is a backdoor way of getting backing-store to apply to all windows. Although all mapped windows will have backing store, the backing store attribute value reported by the server for a window will be the last value established by a client. If it has never been set by a client, the server will report the default value, NotUseful. This behavior is required by the X protocol, which allows the server to exceed the client's backing store expectations but does not provide a way to tell the client that it is doing so. .TP 8 .B \-wr sets the default root window to solid white instead of the standard root weave pattern. .TP 8 .B \-x \fIextension\fP loads the specified extension at init. This is a no-op for most implementations. .TP 8 .B [+-]xinerama enables(+) or disables(-) the XINERAMA extension. The default state is platform and configuration specific. .SH SERVER DEPENDENT OPTIONS Some X servers accept the following options: .TP 8 .B \-ld \fIkilobytes\fP sets the data space limit of the server to the specified number of kilobytes. A value of zero makes the data size as large as possible. The default value of \-1 leaves the data space limit unchanged. .TP 8 .B \-lf \fIfiles\fP sets the number-of-open-files limit of the server to the specified number. A value of zero makes the limit as large as possible. The default value of \-1 leaves the limit unchanged. .TP 8 .B \-ls \fIkilobytes\fP sets the stack space limit of the server to the specified number of kilobytes. A value of zero makes the stack size as large as possible. The default value of \-1 leaves the stack space limit unchanged. .TP 8 .B \-render .BR default | mono | gray | color sets the color allocation policy that will be used by the render extension. .RS 8 .TP 8 .I default selects the default policy defined for the display depth of the X server. .TP 8 .I mono don't use any color cell. .TP 8 .I gray use a gray map of 13 color cells for the X render extension. .TP 8 .I color use a color cube of at most 4*4*4 colors (that is 64 color cells). .RE .TP 8 .B \-dumbSched disables smart scheduling on platforms that support the smart scheduler. .TP .B \-schedInterval \fIinterval\fP sets the smart scheduler's scheduling interval to .I interval milliseconds. .SH XDMCP OPTIONS X servers that support XDMCP have the following options. See the \fIX Display Manager Control Protocol\fP specification for more information. .TP 8 .B \-query \fIhostname\fP enables XDMCP and sends Query packets to the specified .IR hostname . .TP 8 .B \-broadcast enable XDMCP and broadcasts BroadcastQuery packets to the network. The first responding display manager will be chosen for the session. .TP 8 .B \-multicast [\fIaddress\fP [\fIhop count\fP]] Enable XDMCP and multicast BroadcastQuery packets to the network. The first responding display manager is chosen for the session. If an address is specified, the multicast is sent to that address. If no address is specified, the multicast is sent to the default XDMCP IPv6 multicast group. If a hop count is specified, it is used as the maximum hop count for the multicast. If no hop count is specified, the multicast is set to a maximum of 1 hop, to prevent the multicast from being routed beyond the local network. .TP 8 .B \-indirect \fIhostname\fP enables XDMCP and send IndirectQuery packets to the specified .IR hostname . .TP 8 .B \-port \fIport-number\fP uses the specified \fIport-number\fP for XDMCP packets, instead of the default. This option must be specified before any \-query, \-broadcast, \-multicast, or \-indirect options. .TP 8 .B \-from \fIlocal-address\fP specifies the local address to connect from (useful if the connecting host has multiple network interfaces). The \fIlocal-address\fP may be expressed in any form acceptable to the host platform's \fIgethostbyname\fP(3) implementation. .TP 8 .B \-once causes the server to terminate (rather than reset) when the XDMCP session ends. .TP 8 .B \-class \fIdisplay-class\fP XDMCP has an additional display qualifier used in resource lookup for display-specific options. This option sets that value, by default it is "MIT-Unspecified" (not a very useful value). .TP 8 .B \-cookie \fIxdm-auth-bits\fP When testing XDM-AUTHENTICATION-1, a private key is shared between the server and the manager. This option sets the value of that private data (not that it is very private, being on the command line!). .TP 8 .B \-displayID \fIdisplay-id\fP Yet another XDMCP specific value, this one allows the display manager to identify each display so that it can locate the shared key. .SH XKEYBOARD OPTIONS X servers that support the XKEYBOARD (a.k.a. \*qXKB\*q) extension accept the following options. All layout files specified on the command line must be located in the XKB base directory or a subdirectory, and specified as the relative path from the XKB base directory. The default XKB base directory is .IR __projectroot__/lib/X11/xkb . .TP 8 .BR [+-]accessx " [ \fItimeout\fP [ \fItimeout_mask\fP [ \fIfeedback\fP [ \fIoptions_mask\fP ] ] ] ]" enables(+) or disables(-) AccessX key sequences. .TP 8 .B \-xkbdir \fIdirectory\fP base directory for keyboard layout files. This option is not available for setuid X servers (i.e., when the X server's real and effective uids are different). .TP 8 .B \-ardelay \fImilliseconds\fP sets the autorepeat delay (length of time in milliseconds that a key must be depressed before autorepeat starts). .TP 8 .B \-arinterval \fImilliseconds\fP sets the autorepeat interval (length of time in milliseconds that should elapse between autorepeat-generated keystrokes). .TP 8 .B \-xkbmap \fIfilename\fP loads keyboard description in \fIfilename\fP on server startup. .SH "NETWORK CONNECTIONS" The X server supports client connections via a platform-dependent subset of the following transport types: TCP\/IP, Unix Domain sockets, DECnet, and several varieties of SVR4 local connections. See the DISPLAY NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to specify which transport type clients should try to use. .SH GRANTING ACCESS The X server implements a platform-dependent subset of the following authorization protocols: MIT-MAGIC-COOKIE-1, XDM-AUTHORIZATION-1, XDM-AUTHORIZATION-2, SUN-DES-1, and MIT-KERBEROS-5. See the \fIXsecurity\fP(__miscmansuffix__) manual page for information on the operation of these protocols. .PP Authorization data required by the above protocols is passed to the server in a private file named with the \fB\-auth\fP command line option. Each time the server is about to accept the first connection after a reset (or when the server is starting), it reads this file. If this file contains any authorization records, the local host is not automatically allowed access to the server, and only clients which send one of the authorization records contained in the file in the connection setup information will be allowed access. See the \fIXau\fP manual page for a description of the binary format of this file. See \fIxauth\fP(1) for maintenance of this file, and distribution of its contents to remote hosts. .PP The X server also uses a host-based access control list for deciding whether or not to accept connections from clients on a particular machine. If no other authorization mechanism is being used, this list initially consists of the host on which the server is running as well as any machines listed in the file \fI/etc/X\fBn\fI.hosts\fR, where \fBn\fP is the display number of the server. Each line of the file should contain either an Internet hostname (e.g. expo.lcs.mit.edu) or a DECnet hostname in double colon format (e.g. hydra::) or a complete name in the format \fIfamily\fP:\fIname\fP as described in the \fIxhost\fP(1) manual page. There should be no leading or trailing spaces on any lines. For example: .sp .in +8 .nf joesworkstation corporate.company.com star:: inet:bigcpu local: .fi .in -8 .PP Users can add or remove hosts from this list and enable or disable access control using the \fIxhost\fP command from the same machine as the server. .PP If the X FireWall Proxy (\fIxfwp\fP) is being used without a sitepolicy, host-based authorization must be turned on for clients to be able to connect to the X server via the \fIxfwp\fP. If \fIxfwp\fP is run without a configuration file and thus no sitepolicy is defined, if \fIxfwp\fP is using an X server where xhost + has been run to turn off host-based authorization checks, when a client tries to connect to this X server via \fIxfwp\fP, the X server will deny the connection. See \fIxfwp\fP(1) for more information about this proxy. .PP The X protocol intrinsically does not have any notion of window operation permissions or place any restrictions on what a client can do; if a program can connect to a display, it has full run of the screen. X servers that support the SECURITY extension fare better because clients can be designated untrusted via the authorization they use to connect; see the \fIxauth\fP(1) manual page for details. Restrictions are imposed on untrusted clients that curtail the mischief they can do. See the SECURITY extension specification for a complete list of these restrictions. .PP Sites that have better authentication and authorization systems might wish to make use of the hooks in the libraries and the server to provide additional security models. .SH SIGNALS The X server attaches special meaning to the following signals: .TP 8 .I SIGHUP This signal causes the server to close all existing connections, free all resources, and restore all defaults. It is sent by the display manager whenever the main user's main application (usually an \fIxterm\fP or window manager) exits to force the server to clean up and prepare for the next user. .TP 8 .I SIGTERM This signal causes the server to exit cleanly. .TP 8 .I SIGUSR1 This signal is used quite differently from either of the above. When the server starts, it checks to see if it has inherited SIGUSR1 as SIG_IGN instead of the usual SIG_DFL. In this case, the server sends a SIGUSR1 to its parent process after it has set up the various connection schemes. \fIXdm\fP uses this feature to recognize when connecting to the server is possible. .SH FONTS The X server can obtain fonts from directories and/or from font servers. The list of directories and font servers the X server uses when trying to open a font is controlled by the \fIfont path\fP. .LP The default font path is __default_font_path__ . .LP A special kind of directory can be specified using the \fBcatalogue\fP: prefix. Directories specified this way can contain symlinks pointing to the real font directories. See the FONTPATH.D section for details. .LP The font path can be set with the \fB\-fp\fP option or by \fIxset\fP(1) after the server has started. .SH "FONTPATH.D" You can specify a special kind of font path in the form \fBcatalogue:\fR. The directory specified after the catalogue: prefix will be scanned for symlinks and each symlink destination will be added as a local fontfile FPE. .PP The symlink can be suffixed by attributes such as '\fBunscaled\fR', which will be passed through to the underlying fontfile FPE. The only exception is the newly introduced '\fBpri\fR' attribute, which will be used for ordering the font paths specified by the symlinks. An example configuration: .nf 75dpi:unscaled:pri=20 \-> /usr/share/X11/fonts/75dpi ghostscript:pri=60 \-> /usr/share/fonts/default/ghostscript misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc type1:pri=40 \-> /usr/share/X11/fonts/Type1 type1:pri=50 \-> /usr/share/fonts/default/Type1 .fi This will add /usr/share/X11/fonts/misc as the first FPE with the attribute \N'39'unscaled', second FPE will be /usr/share/X11/fonts/75dpi, also with the attribute 'unscaled' etc. This is functionally equivalent to setting the following font path: .nf /usr/share/X11/fonts/misc:unscaled, /usr/share/X11/fonts/75dpi:unscaled, /usr/share/X11/fonts/Type1, /usr/share/fonts/default/Type1, /usr/share/fonts/default/ghostscript .fi .SH FILES .TP 30 .I /etc/X\fBn\fP.hosts Initial access control list for display number \fBn\fP .TP 30 .IR __datadir__/fonts/X11/misc , __datadir__/fonts/X11/75dpi , __datadir__/fonts/X11/100dpi Bitmap font directories .TP 30 .IR __datadir__/fonts/X11/TTF , __datadir__/fonts/X11/Type1 Outline font directories .TP 30 .I /tmp/.X11-unix/X\fBn\fP Unix domain socket for display number \fBn\fP .TP 30 .I /usr/adm/X\fBn\fPmsgs Error log file for display number \fBn\fP if run from \fIinit\fP(__adminmansuffix__) .TP 30 .I __projectroot__/lib/X11/xdm/xdm-errors Default error log file if the server is run from \fIxdm\fP(1) .SH "SEE ALSO" General information: \fIX\fP(__miscmansuffix__) .PP Protocols: .I "X Window System Protocol," .I "The X Font Service Protocol," .I "X Display Manager Control Protocol" .PP Fonts: \fIbdftopcf\fP(1), \fImkfontdir\fP(1), \fImkfontscale\fP(1), \fIxfs\fP(1), \fIxlsfonts\fP(1), \fIxfontsel\fP(1), \fIxfd\fP(1), .I "X Logical Font Description Conventions" .PP Keyboards: \fIxkeyboard-config\fP(__miscmansuffix__) .PP Security: \fIXsecurity\fP(__miscmansuffix__), \fIxauth\fP(1), \fIXau\fP(1), \fIxdm\fP(1), \fIxhost\fP(1), \fIxfwp\fP(1), .I "Security Extension Specification" .PP Starting the server: \fIstartx\fP(1), \fIxdm\fP(1), \fIxinit\fP(1) .PP Controlling the server once started: \fIxset\fP(1), \fIxsetroot\fP(1), \fIxhost\fP(1), \fIxinput\fP(1), \fIxrandr\fP(1) .PP Server-specific man pages: \fIXorg\fP(1), \fIXdmx\fP(1), \fIXephyr\fP(1), \fIXnest\fP(1), \fIXvfb\fP(1), \fIXquartz\fP(1), \fIXWin\fP(1). .PP Server internal documentation: .I "Definition of the Porting Layer for the X v11 Sample Server" .SH AUTHORS The sample server was originally written by Susan Angebranndt, Raymond Drewry, Philip Karlton, and Todd Newman, from Digital Equipment Corporation, with support from a large cast. It has since been extensively rewritten by Keith Packard and Bob Scheifler, from MIT. Dave Wiggins took over post-R5 and made substantial improvements. xorg-server-1.17.1/man/Makefile.in0000664000175100017510000006256012466505435013654 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Xserver.man covers options generic to all X servers built in this tree # (i.e. those handled in the os/utils.c options processing instead of in # the DDX-level options processing) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man appman_PRE = Xserver.man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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 man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/config/0000775000175100017510000000000012466505444012350 500000000000000xorg-server-1.17.1/config/Makefile.am0000664000175100017510000000141312323563340014312 00000000000000AM_CFLAGS = $(DIX_CFLAGS) noinst_LTLIBRARIES = libconfig.la libconfig_la_SOURCES = config.c config-backends.h libconfig_la_LIBADD = if NEED_DBUS AM_CFLAGS += $(DBUS_CFLAGS) libconfig_la_SOURCES += dbus-core.c libconfig_la_LIBADD += $(DBUS_LIBS) endif if CONFIG_UDEV AM_CFLAGS += $(UDEV_CFLAGS) libconfig_la_SOURCES += udev.c libconfig_la_LIBADD += $(UDEV_LIBS) if XORG xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR) xorgconfd_DATA = 10-evdev.conf 10-quirks.conf endif else if CONFIG_HAL AM_CFLAGS += $(HAL_CFLAGS) libconfig_la_SOURCES += hal.c libconfig_la_LIBADD += $(HAL_LIBS) else if CONFIG_WSCONS libconfig_la_SOURCES += wscons.c endif # CONFIG_WSCONS endif # !CONFIG_HAL endif # !CONFIG_UDEV EXTRA_DIST = x11-input.fdi 10-evdev.conf fdi2iclass.py 10-quirks.conf xorg-server-1.17.1/config/udev.c0000664000175100017510000004105712462701204013372 00000000000000/* * Copyright © 2009 Julien Cristau * * 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: Julien Cristau */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "input.h" #include "inputstr.h" #include "hotplug.h" #include "config-backends.h" #include "os.h" #include "globals.h" #include "systemd-logind.h" #define UDEV_XKB_PROP_KEY "xkb" #define LOG_PROPERTY(path, prop, val) \ LogMessageVerb(X_INFO, 10, \ "config/udev: getting property %s on %s " \ "returned \"%s\"\n", \ (prop), (path), (val) ? (val) : "(null)") #define LOG_SYSATTR(path, attr, val) \ LogMessageVerb(X_INFO, 10, \ "config/udev: getting attribute %s on %s " \ "returned \"%s\"\n", \ (attr), (path), (val) ? (val) : "(null)") static struct udev_monitor *udev_monitor; #ifdef CONFIG_UDEV_KMS static void config_udev_odev_setup_attribs(const char *path, const char *syspath, int major, int minor, config_odev_probe_proc_ptr probe_callback); #endif static char itoa_buf[16]; static const char *itoa(int i) { snprintf(itoa_buf, sizeof(itoa_buf), "%d", i); return itoa_buf; } static Bool check_seat(struct udev_device *udev_device) { const char *dev_seat; dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT"); if (!dev_seat) dev_seat = "seat0"; if (SeatId && strcmp(dev_seat, SeatId)) return FALSE; if (!SeatId && strcmp(dev_seat, "seat0")) return FALSE; return TRUE; } static void device_added(struct udev_device *udev_device) { const char *path, *name = NULL; char *config_info = NULL; const char *syspath; const char *tags_prop; const char *key, *value, *tmp; InputOption *input_options; InputAttributes attrs = { }; DeviceIntPtr dev = NULL; struct udev_list_entry *set, *entry; struct udev_device *parent; int rc; dev_t devnum; path = udev_device_get_devnode(udev_device); syspath = udev_device_get_syspath(udev_device); if (!path || !syspath) return; if (!check_seat(udev_device)) return; devnum = udev_device_get_devnum(udev_device); #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; /* Check for devices already added through xf86platformProbe() */ if (xf86_find_platform_device_by_devnum(major(devnum), minor(devnum))) return; LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", path); config_udev_odev_setup_attribs(path, syspath, major(devnum), minor(devnum), NewGPUDeviceRequest); return; } #endif if (!udev_device_get_property_value(udev_device, "ID_INPUT")) { LogMessageVerb(X_INFO, 10, "config/udev: ignoring device %s without " "property ID_INPUT set\n", path); return; } input_options = input_option_new(NULL, "_source", "server/udev"); if (!input_options) return; parent = udev_device_get_parent(udev_device); if (parent) { const char *ppath = udev_device_get_devnode(parent); const char *product = udev_device_get_property_value(parent, "PRODUCT"); const char *pnp_id = udev_device_get_sysattr_value(parent, "id"); unsigned int usb_vendor, usb_model; name = udev_device_get_sysattr_value(parent, "name"); LOG_SYSATTR(ppath, "name", name); if (!name) { name = udev_device_get_property_value(parent, "NAME"); LOG_PROPERTY(ppath, "NAME", name); } /* construct USB ID in lowercase hex - "0000:ffff" */ if (product && sscanf(product, "%*x/%4x/%4x/%*x", &usb_vendor, &usb_model) == 2) { char *usb_id; if (asprintf(&usb_id, "%04x:%04x", usb_vendor, usb_model) == -1) usb_id = NULL; else LOG_PROPERTY(ppath, "PRODUCT", product); attrs.usb_id = usb_id; } while (!pnp_id && (parent = udev_device_get_parent(parent))) { pnp_id = udev_device_get_sysattr_value(parent, "id"); if (!pnp_id) continue; attrs.pnp_id = strdup(pnp_id); ppath = udev_device_get_devnode(parent); LOG_SYSATTR(ppath, "id", pnp_id); } } if (!name) name = "(unnamed)"; else attrs.product = strdup(name); input_options = input_option_new(input_options, "name", name); input_options = input_option_new(input_options, "path", path); input_options = input_option_new(input_options, "device", path); input_options = input_option_new(input_options, "major", itoa(major(devnum))); input_options = input_option_new(input_options, "minor", itoa(minor(devnum))); if (path) attrs.device = strdup(path); tags_prop = udev_device_get_property_value(udev_device, "ID_INPUT.tags"); LOG_PROPERTY(path, "ID_INPUT.tags", tags_prop); attrs.tags = xstrtokenize(tags_prop, ","); if (asprintf(&config_info, "udev:%s", syspath) == -1) { config_info = NULL; goto unwind; } if (device_is_duplicate(config_info)) { LogMessage(X_WARNING, "config/udev: device %s already added. " "Ignoring.\n", name); goto unwind; } set = udev_device_get_properties_list_entry(udev_device); udev_list_entry_foreach(entry, set) { key = udev_list_entry_get_name(entry); if (!key) continue; value = udev_list_entry_get_value(entry); if (!strncasecmp(key, UDEV_XKB_PROP_KEY, sizeof(UDEV_XKB_PROP_KEY) - 1)) { LOG_PROPERTY(path, key, value); tmp = key + sizeof(UDEV_XKB_PROP_KEY) - 1; if (!strcasecmp(tmp, "rules")) input_options = input_option_new(input_options, "xkb_rules", value); else if (!strcasecmp(tmp, "layout")) input_options = input_option_new(input_options, "xkb_layout", value); else if (!strcasecmp(tmp, "variant")) input_options = input_option_new(input_options, "xkb_variant", value); else if (!strcasecmp(tmp, "model")) input_options = input_option_new(input_options, "xkb_model", value); else if (!strcasecmp(tmp, "options")) input_options = input_option_new(input_options, "xkb_options", value); } else if (!strcmp(key, "ID_VENDOR")) { LOG_PROPERTY(path, key, value); attrs.vendor = strdup(value); } else if (!strcmp(key, "ID_INPUT_KEY")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_KEYBOARD; } else if (!strcmp(key, "ID_INPUT_MOUSE")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_POINTER; } else if (!strcmp(key, "ID_INPUT_JOYSTICK")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_JOYSTICK; } else if (!strcmp(key, "ID_INPUT_TABLET")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_TABLET; } else if (!strcmp(key, "ID_INPUT_TOUCHPAD")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_TOUCHPAD; } else if (!strcmp(key, "ID_INPUT_TOUCHSCREEN")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_TOUCHSCREEN; } } input_options = input_option_new(input_options, "config_info", config_info); /* Default setting needed for non-seat0 seats */ if (ServerIsNotSeat0()) input_options = input_option_new(input_options, "GrabDevice", "on"); LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n", name, path); rc = NewInputDeviceRequest(input_options, &attrs, &dev); if (rc != Success) goto unwind; unwind: free(config_info); input_option_free_list(&input_options); free(attrs.usb_id); free(attrs.pnp_id); free(attrs.product); free(attrs.device); free(attrs.vendor); if (attrs.tags) { char **tag = attrs.tags; while (*tag) { free(*tag); tag++; } free(attrs.tags); } return; } static void 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); dev_t devnum = udev_device_get_devnum(device); if ((strncmp(sysname,"card", 4) != 0) || (path == NULL)) return; LogMessage(X_INFO, "config/udev: removing GPU device %s %s\n", syspath, path); config_udev_odev_setup_attribs(path, syspath, major(devnum), minor(devnum), DeleteGPUDeviceRequest); /* Retry vtenter after a drm node removal */ systemd_logind_vtenter(); return; } #endif if (asprintf(&value, "udev:%s", syspath) == -1) return; remove_devices("udev", value); free(value); } static void wakeup_handler(void *data, int err, void *read_mask) { int udev_fd = udev_monitor_get_fd(udev_monitor); struct udev_device *udev_device; const char *action; if (err < 0) return; if (FD_ISSET(udev_fd, (fd_set *) read_mask)) { udev_device = udev_monitor_receive_device(udev_monitor); if (!udev_device) return; action = udev_device_get_action(udev_device); if (action) { 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); } udev_device_unref(udev_device); } } static void block_handler(void *data, struct timeval **tv, void *read_mask) { } int config_udev_pre_init(void) { struct udev *udev; 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); /* 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 (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); /* Device might be gone by the time we try to open it */ if (!udev_device) continue; device_added(udev_device); udev_device_unref(udev_device); } udev_enumerate_unref(enumerate); RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); AddGeneralSocket(udev_monitor_get_fd(udev_monitor)); return 1; } void config_udev_fini(void) { struct udev *udev; if (!udev_monitor) return; udev = udev_monitor_get_udev(udev_monitor); RemoveGeneralSocket(udev_monitor_get_fd(udev_monitor)); RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); udev_monitor_unref(udev_monitor); udev_monitor = NULL; udev_unref(udev); } #ifdef CONFIG_UDEV_KMS static void config_udev_odev_setup_attribs(const char *path, const char *syspath, int major, int minor, config_odev_probe_proc_ptr probe_callback) { struct OdevAttributes *attribs = config_odev_allocate_attributes(); attribs->path = XNFstrdup(path); attribs->syspath = XNFstrdup(syspath); attribs->major = major; attribs->minor = minor; /* ownership of attribs is passed to probe layer */ probe_callback(attribs); } 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); dev_t devnum = udev_device_get_devnum(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; else if (!check_seat(udev_device)) goto no_probe; config_udev_odev_setup_attribs(path, syspath, major(devnum), minor(devnum), probe_callback); no_probe: udev_device_unref(udev_device); } udev_enumerate_unref(enumerate); return; } #endif xorg-server-1.17.1/config/fdi2iclass.py0000775000175100017510000001550512160102336014656 00000000000000#!/usr/bin/python # # Convert xorg keys from hal FDIs files to xorg.conf InputClass sections. # Modified from Martin Pitt's original fdi2mpi.py script: # http://cgit.freedesktop.org/media-player-info/tree/tools/fdi2mpi.py # # (C) 2010 Dan Nicholson # (C) 2009 Canonical Ltd. # Author: Dan Nicholson # Author: Martin Pitt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # fur- nished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FIT- NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- # NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import sys, xml.dom.minidom # dict converting tags to Match* entries match_table = { 'info.product': 'MatchProduct', 'input.product': 'MatchProduct', 'info.vendor': 'MatchVendor', 'input.vendor': 'MatchVendor', 'info.device': 'MatchDevicePath', 'linux.device_file': 'MatchDevicePath', '/org/freedesktop/Hal/devices/computer:system.kernel.name': 'MatchOS', '@info.parent:pnp.id': 'MatchPnPID', } # dict converting info.capabilities list to Match* entries cap_match_table = { 'input.keys': 'MatchIsKeyboard', 'input.keyboard': 'MatchIsKeyboard', 'input.keypad': 'MatchIsKeyboard', 'input.mouse': 'MatchIsPointer', 'input.joystick': 'MatchIsJoystick', 'input.tablet': 'MatchIsTablet', 'input.touchpad': 'MatchIsTouchpad', 'input.touchscreen': 'MatchIsTouchscreen', } def device_glob(path): '''Convert a contains device path to a glob entry''' if path[0] != '/': path = '*' + path return path + '*' def parse_match(node): '''Parse a tag to a tuple with InputClass values''' match = None value = None booltype = False # see what type of key we have if node.attributes.has_key('key'): key = node.attributes['key'].nodeValue if key in match_table: match = match_table[key] elif key == 'info.capabilities': booltype = True # bail out now if it's unrecognized if not match and not booltype: return (match, value) if node.attributes.has_key('string'): value = node.attributes['string'].nodeValue elif node.attributes.has_key('contains'): value = node.attributes['contains'].nodeValue if match == 'MatchDevicePath': value = device_glob(value) elif booltype and value in cap_match_table: match = cap_match_table[value] value = 'yes' elif node.attributes.has_key('string_outof'): value = node.attributes['string_outof'].nodeValue.replace(';','|') elif node.attributes.has_key('contains_outof'): all_values = node.attributes['contains_outof'].nodeValue.split(';') for v in all_values: if match == 'MatchDevicePath': v = device_glob(v) elif match == 'MatchPnPID' and len(v) < 7: v += '*' if value: value += '|' + v else: value = v return (match, value) def parse_options(node): '''Parse the x11_* options and return InputClass entries''' driver = '' ignore = False options = [] for n in node.childNodes: if n.nodeType != xml.dom.minidom.Node.ELEMENT_NODE: continue tag = n.tagName key = n.attributes['key'].nodeValue value = '' if n.hasChildNodes(): content_node = n.childNodes[0] assert content_node.nodeType == xml.dom.Node.TEXT_NODE value = content_node.nodeValue if tag == 'match': continue assert tag in ('addset', 'merge', 'append', 'remove') if tag == 'remove' and key == 'input.x11_driver': ignore = True elif key == 'input.x11_driver': driver = value elif key.startswith('input.x11_options.'): option = key.split('.', 2)[2] options.append((option, value)) return (driver, ignore, options) def is_match_node(node): '''Check if a node is a element''' return node.nodeType == xml.dom.minidom.Node.ELEMENT_NODE and \ node.tagName == 'match' def parse_all_matches(node): '''Parse a x11 match tag and any parents that don't supply their own options''' matches = [] while True: (key, value) = parse_match(node) if key and value: matches.append((key, value)) # walk up to a parent match node node = node.parentNode if node == None or not is_match_node(node): break # leave if there other options at this level children = set([n.tagName for n in node.childNodes if n.nodeType == xml.dom.minidom.Node.ELEMENT_NODE]) if children & set(['addset', 'merge', 'append']): break return matches # stupid counter to give "unique" rule names num_sections = 1 def print_section(matches, driver, ignore, options): '''Print a valid InputClass section to stdout''' global num_sections print 'Section "InputClass"' print '\tIdentifier "Converted Class %d"' % num_sections num_sections += 1 for m, v in matches: print '\t%s "%s"' % (m, v) if driver: print '\tDriver "%s"' % driver if ignore: print '\tOption "Ignore" "yes"' for o, v in options: print '\tOption "%s" "%s"' % (o, v) print 'EndSection' def parse_fdi(fdi): '''Parse x11 matches from fdi''' # find all leaf nodes num = 0 for match_node in fdi.getElementsByTagName('match'): children = set([n.tagName for n in match_node.childNodes if n.nodeType == xml.dom.minidom.Node.ELEMENT_NODE]) # see if there are any options at this level (driver, ignore, options) = parse_options(match_node) if not driver and not ignore and not options: continue matches = parse_all_matches(match_node) if num > 0: print print_section(matches, driver, ignore, options) num += 1 for f in sys.argv[1:]: parse_fdi(xml.dom.minidom.parse(f)) xorg-server-1.17.1/config/10-evdev.conf0000664000175100017510000000211312274325511014453 00000000000000# # Catch-all evdev loader for udev-based systems # We don't simply match on any device since that also adds accelerometers # and other devices that we don't really want to use. The list below # matches everything but joysticks. Section "InputClass" Identifier "evdev pointer catchall" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection Section "InputClass" Identifier "evdev keyboard catchall" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection Section "InputClass" Identifier "evdev touchpad catchall" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection Section "InputClass" Identifier "evdev tablet catchall" MatchIsTablet "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection Section "InputClass" Identifier "evdev touchscreen catchall" MatchIsTouchscreen "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection xorg-server-1.17.1/config/wscons.c0000664000175100017510000001761412274325511013751 00000000000000/* * Copyright (c) 2011 Matthieu Herrb * * 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 #include #include #include #include "input.h" #include "inputstr.h" #include "os.h" #include "config-backends.h" #define WSCONS_KBD_DEVICE "/dev/wskbd" #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" } struct nameint { int val; char *name; } kbdenc[] = { KB_OVRENC, KB_ENCTAB, {0} }; struct nameint kbdvar[] = { {KB_NODEAD | KB_SG, "de_nodeadkeys"}, {KB_NODEAD | KB_SF, "fr_nodeadkeys"}, {KB_SF, "fr"}, {KB_DVORAK | KB_CF, "fr-dvorak"}, {KB_DVORAK | KB_FR, "bepo"}, {KB_DVORAK, "dvorak"}, {KB_CF, "fr-legacy"}, {KB_NODEAD, "nodeadkeys"}, {0} }; struct nameint kbdopt[] = { {KB_SWAPCTRLCAPS, "ctrl:swapcaps"}, {0} }; struct nameint kbdmodel[] = { {WSKBD_TYPE_ZAURUS, "zaurus"}, {0} }; static void wscons_add_keyboard(void) { InputAttributes attrs = { }; DeviceIntPtr dev = NULL; InputOption *input_options = NULL; char *config_info = NULL; int fd, i, rc; unsigned int type; kbd_t wsenc = 0; /* Find keyboard configuration */ fd = open(WSCONS_KBD_DEVICE, O_RDWR | O_NONBLOCK | O_EXCL); if (fd == -1) { LogMessage(X_ERROR, "wskbd: open %s: %s\n", WSCONS_KBD_DEVICE, strerror(errno)); return; } if (ioctl(fd, WSKBDIO_GETENCODING, &wsenc) == -1) { LogMessage(X_WARNING, "wskbd: ioctl(WSKBDIO_GETENCODING) " "failed: %s\n", strerror(errno)); close(fd); return; } if (ioctl(fd, WSKBDIO_GTYPE, &type) == -1) { LogMessage(X_WARNING, "wskbd: ioctl(WSKBDIO_GTYPE) " "failed: %s\n", strerror(errno)); close(fd); return; } close(fd); input_options = input_option_new(input_options, "_source", "server/wscons"); if (input_options == NULL) return; LogMessage(X_INFO, "config/wscons: checking input device %s\n", WSCONS_KBD_DEVICE); input_options = input_option_new(input_options, "name", WSCONS_KBD_DEVICE); input_options = input_option_new(input_options, "driver", "kbd"); config_info = Xprintf("wscons:%s", WSCONS_KBD_DEVICE); if (!config_info) goto unwind; if (KB_ENCODING(wsenc) == KB_USER) { /* Ignore wscons "user" layout */ LogMessageVerb(X_INFO, 3, "wskbd: ignoring \"user\" layout\n"); goto kbd_config_done; } for (i = 0; kbdenc[i].val; i++) if (KB_ENCODING(wsenc) == kbdenc[i].val) { LogMessageVerb(X_INFO, 3, "wskbd: using layout %s\n", kbdenc[i].name); input_options = input_option_new(input_options, "xkb_layout", kbdenc[i].name); break; } for (i = 0; kbdvar[i].val; i++) if (wsenc == kbdvar[i].val || KB_VARIANT(wsenc) == kbdvar[i].val) { LogMessageVerb(X_INFO, 3, "wskbd: using variant %s\n", kbdvar[i].name); input_options = input_option_new(input_options, "xkb_variant", kbdvar[i].name); break; } for (i = 0; kbdopt[i].val; i++) if (KB_VARIANT(wsenc) == kbdopt[i].val) { LogMessageVerb(X_INFO, 3, "wskbd: using option %s\n", kbdopt[i].name); input_options = input_option_new(input_options, "xkb_options", kbdopt[i].name); break; } for (i = 0; kbdmodel[i].val; i++) if (type == kbdmodel[i].val) { LogMessageVerb(X_INFO, 3, "wskbd: using model %s\n", kbdmodel[i].name); input_options = input_option_new(input_options, "xkb_model", kbdmodel[i].name); break; } kbd_config_done: attrs.flags |= ATTR_KEYBOARD; rc = NewInputDeviceRequest(input_options, &attrs, &dev); if (rc != Success) goto unwind; for (; dev; dev = dev->next) { free(dev->config_info); dev->config_info = strdup(config_info); } unwind: input_option_free_list(&input_options); } static void wscons_add_pointer(const char *path, const char *driver, int flags) { InputAttributes attrs = { }; DeviceIntPtr dev = NULL; InputOption *input_options = NULL; char *config_info = NULL; int rc; config_info = Xprintf("wscons:%s", path); if (!config_info) return; input_options = input_option_new(input_options, "_source", "server/wscons"); if (input_options == NULL) return; input_options = input_option_new(input_options, "name", strdup(path)); input_options = input_option_new(input_options, "driver", strdup(driver)); input_options = input_option_new(input_options, "device", strdup(path)); LogMessage(X_INFO, "config/wscons: checking input device %s\n", path); attrs.flags |= flags; rc = NewInputDeviceRequest(input_options, &attrs, &dev); if (rc != Success) goto unwind; for (; dev; dev = dev->next) { free(dev->config_info); dev->config_info = strdup(config_info); } unwind: input_option_free_list(&input_options); } static void wscons_add_pointers(void) { char devname[256]; int fd, i, wsmouse_type; /* Check pointing devices */ for (i = 0; i < 4; i++) { snprintf(devname, sizeof(devname), "%s%d", WSCONS_MOUSE_PREFIX, i); LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname); fd = open_device(devnamem O_RDWR | O_NONBLOCK | O_EXCL); if (fd == -1) { LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname, strerror(errno)); continue; } if (ioctl(fd, WSMOUSEIO_GTYPE, &wsmouse_type) != 0) { LogMessageVerb(X_WARNING, 10, "%s: WSMOUSEIO_GTYPE failed\n", devname); close(fd); continue; } close(fd); switch (wsmouse_type) { case WSMOUSE_TYPE_SYNAPTICS: wscons_add_pointer(devname, "synaptics", ATTR_TOUCHPAD); break; case WSMOUSE_TYPE_TPANEL: wscons_add_pointer(devname, "ws", ATTR_TOUCHSCREEN); break; default: break; } } /* Add a default entry catching all other mux elements as "mouse" */ wscons_add_pointer(WSCONS_MOUSE_PREFIX, "mouse", ATTR_POINTER); } int config_wscons_init(void) { wscons_add_keyboard(); wscons_add_pointers(); return 1; } void config_wscons_fini(void) { /* Not much to do ? */ } xorg-server-1.17.1/config/x11-input.fdi0000664000175100017510000000712012160102336014502 00000000000000 mouse evdev usbms VUID base kbd pc105 evdev evdev usbkbm VUID us xorg-server-1.17.1/config/10-quirks.conf0000664000175100017510000000250612362011423014656 00000000000000# Collection of quirks and blacklist/whitelists for specific devices. # Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable # http://bugs.freedesktop.org/show_bug.cgi?id=22442 Section "InputClass" Identifier "ThinkPad HDAPS accelerometer blacklist" MatchProduct "ThinkPad HDAPS accelerometer data" Option "Ignore" "on" EndSection # https://bugzilla.redhat.com/show_bug.cgi?id=523914 # Mouse does not move in PV Xen guest # Explicitly tell evdev to not ignore the absolute axes. Section "InputClass" Identifier "Xen Virtual Pointer axis blacklist" MatchProduct "Xen Virtual Pointer" Option "IgnoreAbsoluteAxes" "off" Option "IgnoreRelativeAxes" "off" EndSection # https://bugs.freedesktop.org/show_bug.cgi?id=55867 # Bug 55867 - Doesn't know how to tag XI_TRACKBALL Section "InputClass" Identifier "Tag trackballs as XI_TRACKBALL" MatchProduct "trackball" MatchDriver "evdev" Option "TypeName" "TRACKBALL" EndSection # https://bugs.freedesktop.org/show_bug.cgi?id=62831 # Bug 62831 - Mionix Naos 5000 mouse detected incorrectly Section "InputClass" Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE" MatchProduct "La-VIEW Technology Naos 5000 Mouse" MatchDriver "evdev" Option "TypeName" "MOUSE" EndSection xorg-server-1.17.1/config/config-backends.h0000664000175100017510000000336212323563340015451 00000000000000/* * Copyright © 2006-2007 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_DIX_CONFIG_H #include #endif #include "input.h" #include "list.h" void remove_devices(const char *backend, const char *config_info); BOOL device_is_duplicate(const char *config_info); #ifdef CONFIG_UDEV int config_udev_pre_init(void); int config_udev_init(void); void config_udev_fini(void); void config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback); #elif defined(CONFIG_HAL) int config_hal_init(void); void config_hal_fini(void); #elif defined(CONFIG_WSCONS) int config_wscons_init(void); void config_wscons_fini(void); #endif xorg-server-1.17.1/config/Makefile.in0000664000175100017510000007117612466505427014352 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @NEED_DBUS_TRUE@am__append_1 = $(DBUS_CFLAGS) @NEED_DBUS_TRUE@am__append_2 = dbus-core.c @NEED_DBUS_TRUE@am__append_3 = $(DBUS_LIBS) @CONFIG_UDEV_TRUE@am__append_4 = $(UDEV_CFLAGS) @CONFIG_UDEV_TRUE@am__append_5 = udev.c @CONFIG_UDEV_TRUE@am__append_6 = $(UDEV_LIBS) @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_7 = $(HAL_CFLAGS) @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_8 = hal.c @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_9 = $(HAL_LIBS) @CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__append_10 = wscons.c subdir = config DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = @NEED_DBUS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @CONFIG_UDEV_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__DEPENDENCIES_4 = \ @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@ $(am__DEPENDENCIES_1) libconfig_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4) am__libconfig_la_SOURCES_DIST = config.c config-backends.h dbus-core.c \ udev.c hal.c wscons.c @NEED_DBUS_TRUE@am__objects_1 = dbus-core.lo @CONFIG_UDEV_TRUE@am__objects_2 = udev.lo @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__objects_3 = hal.lo @CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__objects_4 = wscons.lo am_libconfig_la_OBJECTS = config.lo $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) libconfig_la_OBJECTS = $(am_libconfig_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 = $(libconfig_la_SOURCES) DIST_SOURCES = $(am__libconfig_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 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)$(xorgconfddir)" DATA = $(xorgconfd_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CFLAGS = $(DIX_CFLAGS) $(am__append_1) $(am__append_4) \ $(am__append_7) noinst_LTLIBRARIES = libconfig.la libconfig_la_SOURCES = config.c config-backends.h $(am__append_2) \ $(am__append_5) $(am__append_8) $(am__append_10) libconfig_la_LIBADD = $(am__append_3) $(am__append_6) $(am__append_9) @CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR) @CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfd_DATA = 10-evdev.conf 10-quirks.conf EXTRA_DIST = x11-input.fdi 10-evdev.conf fdi2iclass.py 10-quirks.conf all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign config/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libconfig.la: $(libconfig_la_OBJECTS) $(libconfig_la_DEPENDENCIES) $(EXTRA_libconfig_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libconfig_la_OBJECTS) $(libconfig_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wscons.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 -o $@ $< .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 -o $@ `$(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-xorgconfdDATA: $(xorgconfd_DATA) @$(NORMAL_INSTALL) @list='$(xorgconfd_DATA)'; test -n "$(xorgconfddir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xorgconfddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xorgconfddir)" || 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_DATA) $$files '$(DESTDIR)$(xorgconfddir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xorgconfddir)" || exit $$?; \ done uninstall-xorgconfdDATA: @$(NORMAL_UNINSTALL) @list='$(xorgconfd_DATA)'; test -n "$(xorgconfddir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xorgconfddir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) $(DATA) installdirs: for dir in "$(DESTDIR)$(xorgconfddir)"; 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-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-xorgconfdDATA 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-xorgconfdDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 install-xorgconfdDATA \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-xorgconfdDATA # 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: xorg-server-1.17.1/config/hal.c0000664000175100017510000005366012323563340013201 00000000000000/* * Copyright © 2007 Daniel Stone * Copyright © 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Author: Daniel Stone */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include #include "dbus-core.h" #include "input.h" #include "inputstr.h" #include "hotplug.h" #include "config-backends.h" #include "os.h" #define LIBHAL_PROP_KEY "input.x11_options." #define LIBHAL_XKB_PROP_KEY "input.xkb." struct config_hal_info { DBusConnection *system_bus; LibHalContext *hal_ctx; }; /* Used for special handling of xkb options. */ struct xkb_options { char *layout; char *model; char *rules; char *variant; char *options; }; static void device_removed(LibHalContext * ctx, const char *udi) { char *value; if (asprintf(&value, "hal:%s", udi) == -1) return; remove_devices("hal", value); free(value); } static char * get_prop_string(LibHalContext * hal_ctx, const char *udi, const char *name) { char *prop, *ret; prop = libhal_device_get_property_string(hal_ctx, udi, name, NULL); LogMessageVerb(X_INFO, 10, "config/hal: getting %s on %s returned %s\n", name, udi, prop ? prop : "(null)"); if (prop) { ret = strdup(prop); libhal_free_string(prop); } else { return NULL; } return ret; } static char * get_prop_string_array(LibHalContext * hal_ctx, const char *udi, const char *prop) { char **props, *ret, *str; int i, len = 0; props = libhal_device_get_property_strlist(hal_ctx, udi, prop, NULL); if (props) { for (i = 0; props[i]; i++) len += strlen(props[i]); ret = calloc(sizeof(char), len + i); /* i - 1 commas, 1 NULL */ if (!ret) { libhal_free_string_array(props); return NULL; } str = ret; for (i = 0; props[i]; i++) { strcpy(str, props[i]); str += strlen(props[i]); *str++ = ','; } *(str - 1) = '\0'; libhal_free_string_array(props); } else { return NULL; } return ret; } static void device_added(LibHalContext * hal_ctx, const char *udi) { char *path = NULL, *driver = NULL, *name = NULL, *config_info = NULL; char *hal_tags, *parent; InputOption *input_options = NULL; InputAttributes attrs = { 0 }; DeviceIntPtr dev = NULL; DBusError error; struct xkb_options xkb_opts = { 0 }; int rc; LibHalPropertySet *set = NULL; LibHalPropertySetIterator set_iter; char *psi_key = NULL, *tmp_val; dbus_error_init(&error); driver = get_prop_string(hal_ctx, udi, "input.x11_driver"); if (!driver) { /* verbose, don't tell the user unless they _want_ to see it */ LogMessageVerb(X_INFO, 7, "config/hal: no driver specified for device %s\n", udi); goto unwind; } path = get_prop_string(hal_ctx, udi, "input.device"); if (!path) { LogMessage(X_WARNING, "config/hal: no driver or path specified for %s\n", udi); goto unwind; } attrs.device = strdup(path); name = get_prop_string(hal_ctx, udi, "info.product"); if (!name) name = strdup("(unnamed)"); else attrs.product = strdup(name); attrs.vendor = get_prop_string(hal_ctx, udi, "info.vendor"); hal_tags = get_prop_string(hal_ctx, udi, "input.tags"); attrs.tags = xstrtokenize(hal_tags, ","); free(hal_tags); if (libhal_device_query_capability(hal_ctx, udi, "input.keys", NULL)) attrs.flags |= ATTR_KEYBOARD; if (libhal_device_query_capability(hal_ctx, udi, "input.mouse", NULL)) attrs.flags |= ATTR_POINTER; if (libhal_device_query_capability(hal_ctx, udi, "input.joystick", NULL)) attrs.flags |= ATTR_JOYSTICK; if (libhal_device_query_capability(hal_ctx, udi, "input.tablet", NULL)) attrs.flags |= ATTR_TABLET; if (libhal_device_query_capability(hal_ctx, udi, "input.touchpad", NULL)) attrs.flags |= ATTR_TOUCHPAD; if (libhal_device_query_capability(hal_ctx, udi, "input.touchscreen", NULL)) attrs.flags |= ATTR_TOUCHSCREEN; parent = get_prop_string(hal_ctx, udi, "info.parent"); if (parent) { int usb_vendor, usb_product; char *old_parent; /* construct USB ID in lowercase - "0000:ffff" */ usb_vendor = libhal_device_get_property_int(hal_ctx, parent, "usb.vendor_id", NULL); LogMessageVerb(X_INFO, 10, "config/hal: getting usb.vendor_id on %s " "returned %04x\n", parent, usb_vendor); usb_product = libhal_device_get_property_int(hal_ctx, parent, "usb.product_id", NULL); LogMessageVerb(X_INFO, 10, "config/hal: getting usb.product_id on %s " "returned %04x\n", parent, usb_product); if (usb_vendor && usb_product) if (asprintf(&attrs.usb_id, "%04x:%04x", usb_vendor, usb_product) == -1) attrs.usb_id = NULL; attrs.pnp_id = get_prop_string(hal_ctx, parent, "pnp.id"); old_parent = parent; while (!attrs.pnp_id && (parent = get_prop_string(hal_ctx, parent, "info.parent"))) { attrs.pnp_id = get_prop_string(hal_ctx, parent, "pnp.id"); free(old_parent); old_parent = parent; } free(old_parent); } input_options = input_option_new(NULL, "_source", "server/hal"); if (!input_options) { LogMessage(X_ERROR, "config/hal: couldn't allocate first key/value pair\n"); goto unwind; } /* most drivers use device.. not path. evdev uses both however, but the * path version isn't documented apparently. support both for now. */ input_options = input_option_new(input_options, "path", path); input_options = input_option_new(input_options, "device", path); input_options = input_option_new(input_options, "driver", driver); input_options = input_option_new(input_options, "name", name); if (asprintf(&config_info, "hal:%s", udi) == -1) { config_info = NULL; LogMessage(X_ERROR, "config/hal: couldn't allocate name\n"); goto unwind; } /* Check for duplicate devices */ if (device_is_duplicate(config_info)) { LogMessage(X_WARNING, "config/hal: device %s already added. Ignoring.\n", name); goto unwind; } /* ok, grab options from hal.. iterate through all properties * and lets see if any of them are options that we can add */ set = libhal_device_get_all_properties(hal_ctx, udi, &error); if (!set) { LogMessage(X_ERROR, "config/hal: couldn't get property list for %s: %s (%s)\n", udi, error.name, error.message); goto unwind; } libhal_psi_init(&set_iter, set); while (libhal_psi_has_more(&set_iter)) { /* we are looking for supported keys.. extract and add to options */ psi_key = libhal_psi_get_key(&set_iter); if (psi_key) { /* normal options first (input.x11_options.) */ if (!strncasecmp (psi_key, LIBHAL_PROP_KEY, sizeof(LIBHAL_PROP_KEY) - 1)) { char *tmp; /* only support strings for all values */ tmp_val = get_prop_string(hal_ctx, udi, psi_key); if (tmp_val) { /* xkb needs special handling. HAL specs include * input.xkb.xyz options, but the x11-input.fdi specifies * input.x11_options.Xkbxyz options. By default, we use * the former, unless the specific X11 ones are specified. * Since we can't predict the order in which the keys * arrive, we need to store them. */ if ((tmp = strcasestr(psi_key, "xkb")) && strlen(tmp) >= 4) { if (!strcasecmp(&tmp[3], "layout")) { free(xkb_opts.layout); xkb_opts.layout = strdup(tmp_val); } else if (!strcasecmp(&tmp[3], "model")) { free(xkb_opts.model); xkb_opts.model = strdup(tmp_val); } else if (!strcasecmp(&tmp[3], "rules")) { free(xkb_opts.rules); xkb_opts.rules = strdup(tmp_val); } else if (!strcasecmp(&tmp[3], "variant")) { free(xkb_opts.variant); xkb_opts.variant = strdup(tmp_val); } else if (!strcasecmp(&tmp[3], "options")) { free(xkb_opts.options); xkb_opts.options = strdup(tmp_val); } } else { /* all others */ input_options = input_option_new(input_options, psi_key + sizeof(LIBHAL_PROP_KEY) - 1, tmp_val); free(tmp_val); } } else { /* server 1.4 had xkb_options as strlist. */ if ((tmp = strcasestr(psi_key, "xkb")) && (strlen(tmp) >= 4) && (!strcasecmp(&tmp[3], "options")) && (tmp_val = get_prop_string_array(hal_ctx, udi, psi_key))) { free(xkb_opts.options); xkb_opts.options = strdup(tmp_val); } } } else if (!strncasecmp (psi_key, LIBHAL_XKB_PROP_KEY, sizeof(LIBHAL_XKB_PROP_KEY) - 1)) { char *tmp; /* only support strings for all values */ tmp_val = get_prop_string(hal_ctx, udi, psi_key); if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_PROP_KEY)) { tmp = &psi_key[sizeof(LIBHAL_XKB_PROP_KEY) - 1]; if (!strcasecmp(tmp, "layout")) { if (!xkb_opts.layout) xkb_opts.layout = strdup(tmp_val); } else if (!strcasecmp(tmp, "rules")) { if (!xkb_opts.rules) xkb_opts.rules = strdup(tmp_val); } else if (!strcasecmp(tmp, "variant")) { if (!xkb_opts.variant) xkb_opts.variant = strdup(tmp_val); } else if (!strcasecmp(tmp, "model")) { if (!xkb_opts.model) xkb_opts.model = strdup(tmp_val); } else if (!strcasecmp(tmp, "options")) { if (!xkb_opts.options) xkb_opts.options = strdup(tmp_val); } free(tmp_val); } else { /* server 1.4 had xkb options as strlist */ tmp_val = get_prop_string_array(hal_ctx, udi, psi_key); if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_PROP_KEY)) { tmp = &psi_key[sizeof(LIBHAL_XKB_PROP_KEY) - 1]; if (!strcasecmp(tmp, ".options") && (!xkb_opts.options)) xkb_opts.options = strdup(tmp_val); } free(tmp_val); } } } /* psi_key doesn't need to be freed */ libhal_psi_next(&set_iter); } /* Now add xkb options */ if (xkb_opts.layout) input_options = input_option_new(input_options, "xkb_layout", xkb_opts.layout); if (xkb_opts.rules) input_options = input_option_new(input_options, "xkb_rules", xkb_opts.rules); if (xkb_opts.variant) input_options = input_option_new(input_options, "xkb_variant", xkb_opts.variant); if (xkb_opts.model) input_options = input_option_new(input_options, "xkb_model", xkb_opts.model); if (xkb_opts.options) input_options = input_option_new(input_options, "xkb_options", xkb_opts.options); input_options = input_option_new(input_options, "config_info", config_info); /* this isn't an error, but how else do you output something that the user can see? */ LogMessage(X_INFO, "config/hal: Adding input device %s\n", name); if ((rc = NewInputDeviceRequest(input_options, &attrs, &dev)) != Success) { LogMessage(X_ERROR, "config/hal: NewInputDeviceRequest failed (%d)\n", rc); dev = NULL; goto unwind; } unwind: if (set) libhal_free_property_set(set); free(path); free(driver); free(name); free(config_info); input_option_free_list(&input_options); free(attrs.product); free(attrs.vendor); free(attrs.device); free(attrs.pnp_id); free(attrs.usb_id); if (attrs.tags) { char **tag = attrs.tags; while (*tag) { free(*tag); tag++; } free(attrs.tags); } free(xkb_opts.layout); free(xkb_opts.rules); free(xkb_opts.model); free(xkb_opts.variant); free(xkb_opts.options); dbus_error_free(&error); return; } static void disconnect_hook(void *data) { DBusError error; struct config_hal_info *info = data; if (info->hal_ctx) { if (dbus_connection_get_is_connected(info->system_bus)) { dbus_error_init(&error); if (!libhal_ctx_shutdown(info->hal_ctx, &error)) LogMessage(X_WARNING, "config/hal: disconnect_hook couldn't shut down context: %s (%s)\n", error.name, error.message); dbus_error_free(&error); } libhal_ctx_free(info->hal_ctx); } info->hal_ctx = NULL; info->system_bus = NULL; } static BOOL connect_and_register(DBusConnection * connection, struct config_hal_info *info) { DBusError error; char **devices; int num_devices, i; if (info->hal_ctx) return TRUE; /* already registered, pretend we did something */ info->system_bus = connection; dbus_error_init(&error); info->hal_ctx = libhal_ctx_new(); if (!info->hal_ctx) { LogMessage(X_ERROR, "config/hal: couldn't create HAL context\n"); goto out_err; } if (!libhal_ctx_set_dbus_connection(info->hal_ctx, info->system_bus)) { LogMessage(X_ERROR, "config/hal: couldn't associate HAL context with bus\n"); goto out_err; } if (!libhal_ctx_init(info->hal_ctx, &error)) { LogMessage(X_ERROR, "config/hal: couldn't initialise context: %s (%s)\n", error.name ? error.name : "unknown error", error.message ? error.message : "null"); goto out_err; } if (!libhal_device_property_watch_all(info->hal_ctx, &error)) { LogMessage(X_ERROR, "config/hal: couldn't watch all properties: %s (%s)\n", error.name ? error.name : "unknown error", error.message ? error.message : "null"); goto out_ctx; } libhal_ctx_set_device_added(info->hal_ctx, device_added); libhal_ctx_set_device_removed(info->hal_ctx, device_removed); devices = libhal_find_device_by_capability(info->hal_ctx, "input", &num_devices, &error); /* FIXME: Get default devices if error is set. */ if (dbus_error_is_set(&error)) { LogMessage(X_ERROR, "config/hal: couldn't find input device: %s (%s)\n", error.name ? error.name : "unknown error", error.message ? error.message : "null"); goto out_ctx; } for (i = 0; i < num_devices; i++) device_added(info->hal_ctx, devices[i]); libhal_free_string_array(devices); dbus_error_free(&error); return TRUE; out_ctx: dbus_error_free(&error); if (!libhal_ctx_shutdown(info->hal_ctx, &error)) { LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n", error.name ? error.name : "unknown error", error.message ? error.message : "null"); dbus_error_free(&error); } out_err: dbus_error_free(&error); if (info->hal_ctx) { libhal_ctx_free(info->hal_ctx); } info->hal_ctx = NULL; info->system_bus = NULL; return FALSE; } /** * Handle NewOwnerChanged signals to deal with HAL startup at X server runtime. * * NewOwnerChanged is send once when HAL shuts down, and once again when it * comes back up. Message has three arguments, first is the name * (org.freedesktop.Hal), the second one is the old owner, third one is new * owner. */ static DBusHandlerResult ownerchanged_handler(DBusConnection * connection, DBusMessage * message, void *data) { int ret = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; if (dbus_message_is_signal(message, "org.freedesktop.DBus", "NameOwnerChanged")) { DBusError error; char *name, *old_owner, *new_owner; dbus_error_init(&error); dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner, DBUS_TYPE_INVALID); if (dbus_error_is_set(&error)) { ErrorF ("[config/hal] failed to get NameOwnerChanged args: %s (%s)\n", error.name, error.message); } else if (name && strcmp(name, "org.freedesktop.Hal") == 0) { if (!old_owner || !strlen(old_owner)) { DebugF("[config/hal] HAL startup detected.\n"); if (connect_and_register (connection, (struct config_hal_info *) data)) dbus_connection_unregister_object_path(connection, "/org/freedesktop/DBus"); else ErrorF("[config/hal] Failed to connect to HAL bus.\n"); } ret = DBUS_HANDLER_RESULT_HANDLED; } dbus_error_free(&error); } return ret; } /** * Register a handler for the NameOwnerChanged signal. */ static BOOL listen_for_startup(DBusConnection * connection, void *data) { DBusObjectPathVTable vtable = {.message_function = ownerchanged_handler, }; DBusError error; const char MATCH_RULE[] = "sender='org.freedesktop.DBus'," "interface='org.freedesktop.DBus'," "type='signal'," "path='/org/freedesktop/DBus'," "member='NameOwnerChanged'"; int rc = FALSE; dbus_error_init(&error); dbus_bus_add_match(connection, MATCH_RULE, &error); if (!dbus_error_is_set(&error)) { if (dbus_connection_register_object_path(connection, "/org/freedesktop/DBus", &vtable, data)) rc = TRUE; else ErrorF("[config/hal] cannot register object path.\n"); } else { ErrorF("[config/hal] couldn't add match rule: %s (%s)\n", error.name, error.message); ErrorF("[config/hal] cannot detect a HAL startup.\n"); } dbus_error_free(&error); return rc; } static void connect_hook(DBusConnection * connection, void *data) { struct config_hal_info *info = data; if (listen_for_startup(connection, data) && connect_and_register(connection, info)) dbus_connection_unregister_object_path(connection, "/org/freedesktop/DBus"); return; } static struct config_hal_info hal_info; static struct dbus_core_hook hook = { .connect = connect_hook, .disconnect = disconnect_hook, .data = &hal_info, }; int config_hal_init(void) { memset(&hal_info, 0, sizeof(hal_info)); hal_info.system_bus = NULL; hal_info.hal_ctx = NULL; if (!dbus_core_add_hook(&hook)) { LogMessage(X_ERROR, "config/hal: failed to add D-Bus hook\n"); return 0; } /* verbose message */ LogMessageVerb(X_INFO, 7, "config/hal: initialized\n"); return 1; } void config_hal_fini(void) { dbus_core_remove_hook(&hook); } xorg-server-1.17.1/config/dbus-core.c0000664000175100017510000001557312362011423014312 00000000000000/* * Copyright © 2006-2007 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_DIX_CONFIG_H #include #endif #include #include #include "dix.h" #include "os.h" #include "dbus-core.h" /* How often to attempt reconnecting when we get booted off the bus. */ #define RECONNECT_DELAY (10 * 1000) /* in ms */ struct dbus_core_info { int fd; DBusConnection *connection; OsTimerPtr timer; struct dbus_core_hook *hooks; }; static struct dbus_core_info bus_info; static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg); static void wakeup_handler(void *data, int num_fds, void *read_mask) { struct dbus_core_info *info = data; if (info->connection && num_fds > 0 && FD_ISSET(info->fd, (fd_set *) read_mask)) { do { dbus_connection_read_write_dispatch(info->connection, 0); } while (info->connection && dbus_connection_get_is_connected(info->connection) && dbus_connection_get_dispatch_status(info->connection) == DBUS_DISPATCH_DATA_REMAINS); } } static void block_handler(void *data, struct timeval **tv, void *read_mask) { } /** * Disconnect (if we haven't already been forcefully disconnected), clean up * after ourselves, and call all registered disconnect hooks. */ static void teardown(void) { struct dbus_core_hook *hook; if (bus_info.timer) { TimerFree(bus_info.timer); bus_info.timer = NULL; } /* We should really have pre-disconnect hooks and run them here, for * completeness. But then it gets awkward, given that you can't * guarantee that they'll be called ... */ if (bus_info.connection) dbus_connection_unref(bus_info.connection); RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); if (bus_info.fd != -1) RemoveGeneralSocket(bus_info.fd); bus_info.fd = -1; bus_info.connection = NULL; for (hook = bus_info.hooks; hook; hook = hook->next) { if (hook->disconnect) hook->disconnect(hook->data); } } /** * This is a filter, which only handles the disconnected signal, which * doesn't go to the normal message handling function. This takes * precedence over the message handling function, so have have to be * careful to ignore anything we don't want to deal with here. */ static DBusHandlerResult message_filter(DBusConnection * connection, DBusMessage * message, void *data) { /* If we get disconnected, then take everything down, and attempt to * reconnect immediately (assuming it's just a restart). The * connection isn't valid at this point, so throw it out immediately. */ if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) { DebugF("[dbus-core] disconnected from bus\n"); bus_info.connection = NULL; teardown(); if (bus_info.timer) TimerFree(bus_info.timer); bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL); return DBUS_HANDLER_RESULT_HANDLED; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } /** * Attempt to connect to the system bus, and set a filter to deal with * disconnection (see message_filter above). * * @return 1 on success, 0 on failure. */ static int connect_to_bus(void) { DBusError error; struct dbus_core_hook *hook; dbus_error_init(&error); bus_info.connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error); if (!bus_info.connection || dbus_error_is_set(&error)) { LogMessage(X_ERROR, "dbus-core: error connecting to system bus: %s (%s)\n", error.name, error.message); goto err_begin; } /* Thankyou. Really, thankyou. */ dbus_connection_set_exit_on_disconnect(bus_info.connection, FALSE); if (!dbus_connection_get_unix_fd(bus_info.connection, &bus_info.fd)) { ErrorF("[dbus-core] couldn't get fd for system bus\n"); goto err_unref; } if (!dbus_connection_add_filter(bus_info.connection, message_filter, &bus_info, NULL)) { ErrorF("[dbus-core] couldn't add filter: %s (%s)\n", error.name, error.message); goto err_fd; } dbus_error_free(&error); AddGeneralSocket(bus_info.fd); RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); for (hook = bus_info.hooks; hook; hook = hook->next) { if (hook->connect) hook->connect(bus_info.connection, hook->data); } return 1; err_fd: bus_info.fd = -1; err_unref: dbus_connection_unref(bus_info.connection); bus_info.connection = NULL; err_begin: dbus_error_free(&error); return 0; } static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg) { if (connect_to_bus()) { TimerFree(bus_info.timer); bus_info.timer = NULL; return 0; } else { return RECONNECT_DELAY; } } int dbus_core_add_hook(struct dbus_core_hook *hook) { struct dbus_core_hook **prev; for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next); hook->next = NULL; *prev = hook; /* If we're already connected, call the connect hook. */ if (bus_info.connection) hook->connect(bus_info.connection, hook->data); return 1; } void dbus_core_remove_hook(struct dbus_core_hook *hook) { struct dbus_core_hook **prev; for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next) { if (*prev == hook) { *prev = hook->next; break; } } } int dbus_core_init(void) { memset(&bus_info, 0, sizeof(bus_info)); bus_info.fd = -1; bus_info.hooks = NULL; if (!connect_to_bus()) bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL); return 1; } void dbus_core_fini(void) { teardown(); } xorg-server-1.17.1/config/config.c0000664000175100017510000001002312362063004013657 00000000000000/* * Copyright © 2006-2007 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_DIX_CONFIG_H #include #endif #include #include "os.h" #include "inputstr.h" #include "hotplug.h" #include "config-backends.h" #include "systemd-logind.h" void config_pre_init(void) { #ifdef CONFIG_UDEV if (!config_udev_pre_init()) ErrorF("[config] failed to pre-init udev\n"); #endif } void config_init(void) { #ifdef CONFIG_UDEV if (!config_udev_init()) ErrorF("[config] failed to initialise udev\n"); #elif defined(CONFIG_HAL) if (!config_hal_init()) ErrorF("[config] failed to initialise HAL\n"); #elif defined(CONFIG_WSCONS) if (!config_wscons_init()) ErrorF("[config] failed to initialise wscons\n"); #endif } void config_fini(void) { #if defined(CONFIG_UDEV) config_udev_fini(); #elif defined(CONFIG_HAL) config_hal_fini(); #elif defined(CONFIG_WSCONS) config_wscons_fini(); #endif } void config_odev_probe(config_odev_probe_proc_ptr probe_callback) { #if defined(CONFIG_UDEV_KMS) config_udev_odev_probe(probe_callback); #endif } static void remove_device(const char *backend, DeviceIntPtr dev) { /* this only gets called for devices that have already been added */ LogMessage(X_INFO, "config/%s: removing device %s\n", backend, dev->name); /* Call PIE here so we don't try to dereference a device that's * already been removed. */ OsBlockSignals(); ProcessInputEvents(); DeleteInputDeviceRequest(dev); OsReleaseSignals(); } void remove_devices(const char *backend, const char *config_info) { DeviceIntPtr dev, next; for (dev = inputInfo.devices; dev; dev = next) { next = dev->next; if (dev->config_info && strcmp(dev->config_info, config_info) == 0) remove_device(backend, dev); } for (dev = inputInfo.off_devices; dev; dev = next) { next = dev->next; if (dev->config_info && strcmp(dev->config_info, config_info) == 0) remove_device(backend, dev); } } BOOL device_is_duplicate(const char *config_info) { DeviceIntPtr dev; for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev->config_info && (strcmp(dev->config_info, config_info) == 0)) return TRUE; } for (dev = inputInfo.off_devices; dev; dev = dev->next) { if (dev->config_info && (strcmp(dev->config_info, config_info) == 0)) return TRUE; } return FALSE; } struct OdevAttributes * config_odev_allocate_attributes(void) { struct OdevAttributes *attribs = XNFcalloc(sizeof (struct OdevAttributes)); attribs->fd = -1; return attribs; } void config_odev_free_attributes(struct OdevAttributes *attribs) { if (attribs->fd != -1) systemd_logind_release_fd(attribs->major, attribs->minor, attribs->fd); free(attribs->path); free(attribs->syspath); free(attribs->busid); free(attribs->driver); free(attribs); } xorg-server-1.17.1/dbe/0000775000175100017510000000000012466505444011635 500000000000000xorg-server-1.17.1/dbe/Makefile.am0000664000175100017510000000025412223624774013611 00000000000000noinst_LTLIBRARIES = libdbe.la AM_CFLAGS = $(DIX_CFLAGS) if XORG sdk_HEADERS = dbestruct.h endif libdbe_la_SOURCES = \ dbe.c \ midbe.c \ midbe.h xorg-server-1.17.1/dbe/midbe.h0000664000175100017510000000412212456571574013013 00000000000000/****************************************************************************** * Copyright (c) 1994, 1995 Hewlett-Packard Company * * 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. * * Header file for users of machine-independent DBE code * *****************************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef MIDBE_H #define MIDBE_H #include "privates.h" /* EXTERNS */ extern Bool miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv); extern DevPrivateKeyRec dbeScreenPrivKeyRec; #define dbeScreenPrivKey (&dbeScreenPrivKeyRec) extern DevPrivateKeyRec dbeWindowPrivKeyRec; #define dbeWindowPrivKey (&dbeWindowPrivKeyRec) extern RESTYPE dbeDrawableResType; extern RESTYPE dbeWindowPrivResType; #endif /* MIDBE_H */ xorg-server-1.17.1/dbe/dbe.c0000664000175100017510000013305412456571574012467 00000000000000/****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company * * 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. * * DIX DBE code * *****************************************************************************/ /* INCLUDES */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include #include "scrnintstr.h" #include "extnsionst.h" #include "extinit.h" #include "gcstruct.h" #include "dixstruct.h" #define NEED_DBE_PROTOCOL #include "dbestruct.h" #include "midbe.h" #include "xace.h" /* GLOBALS */ /* These are globals for use by DDX */ DevPrivateKeyRec dbeScreenPrivKeyRec; DevPrivateKeyRec dbeWindowPrivKeyRec; /* These are globals for use by DDX */ RESTYPE dbeDrawableResType; RESTYPE dbeWindowPrivResType; /* Used to generate DBE's BadBuffer error. */ static int dbeErrorBase; /****************************************************************************** * * DBE DIX Procedure: DbeStubScreen * * Description: * * This is function stubs the function pointers in the given DBE screen * private and increments the number of stubbed screens. * *****************************************************************************/ static void DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens) { /* Stub DIX. */ pDbeScreenPriv->SetupBackgroundPainter = NULL; /* Do not unwrap PositionWindow nor DestroyWindow. If the DDX * initialization function failed, we assume that it did not wrap * PositionWindow. Also, DestroyWindow is only wrapped if the DDX * initialization function succeeded. */ /* Stub DDX. */ pDbeScreenPriv->GetVisualInfo = NULL; pDbeScreenPriv->AllocBackBufferName = NULL; pDbeScreenPriv->SwapBuffers = NULL; pDbeScreenPriv->WinPrivDelete = NULL; (*nStubbedScreens)++; } /* DbeStubScreen() */ /****************************************************************************** * * DBE DIX Procedure: ProcDbeGetVersion * * Description: * * This function is for processing a DbeGetVersion request. * This request returns the major and minor version numbers of this * extension. * * Return Values: * * Success * *****************************************************************************/ static int ProcDbeGetVersion(ClientPtr client) { /* REQUEST(xDbeGetVersionReq); */ xDbeGetVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = DBE_MAJOR_VERSION, .minorVersion = DBE_MINOR_VERSION }; REQUEST_SIZE_MATCH(xDbeGetVersionReq); if (client->swapped) { swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(xDbeGetVersionReply), &rep); return Success; } /* ProcDbeGetVersion() */ /****************************************************************************** * * DBE DIX Procedure: ProcDbeAllocateBackBufferName * * Description: * * This function is for processing a DbeAllocateBackBufferName request. * This request allocates a drawable ID used to refer to the back buffer * of a window. * * Return Values: * * BadAlloc - server can not allocate resources * BadIDChoice - id is out of range for client; id is already in use * BadMatch - window is not an InputOutput window; * visual of window is not on list returned by * DBEGetVisualInfo; * BadValue - invalid swap action is specified * BadWindow - window is not a valid window * Success * *****************************************************************************/ static int ProcDbeAllocateBackBufferName(ClientPtr client) { REQUEST(xDbeAllocateBackBufferNameReq); WindowPtr pWin; DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv; XdbeScreenVisualInfo scrVisInfo; register int i; Bool visualMatched = FALSE; xDbeSwapAction swapAction; VisualID visual; int status; int add_index; REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq); /* The window must be valid. */ status = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); if (status != Success) return status; /* The window must be InputOutput. */ if (pWin->drawable.class != InputOutput) { return BadMatch; } /* The swap action must be valid. */ swapAction = stuff->swapAction; /* use local var for performance. */ if ((swapAction != XdbeUndefined) && (swapAction != XdbeBackground) && (swapAction != XdbeUntouched) && (swapAction != XdbeCopied)) { return BadValue; } /* The id must be in range and not already in use. */ LEGAL_NEW_RESOURCE(stuff->buffer, client); /* The visual of the window must be in the list returned by * GetVisualInfo. */ pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin); if (!pDbeScreenPriv->GetVisualInfo) return BadMatch; /* screen doesn't support double buffering */ if (!(*pDbeScreenPriv->GetVisualInfo) (pWin->drawable.pScreen, &scrVisInfo)) { /* GetVisualInfo() failed to allocate visual info data. */ return BadAlloc; } /* See if the window's visual is on the list. */ visual = wVisual(pWin); for (i = 0; (i < scrVisInfo.count) && !visualMatched; i++) { if (scrVisInfo.visinfo[i].visual == visual) { visualMatched = TRUE; } } /* Free what was allocated by the GetVisualInfo() call above. */ free(scrVisInfo.visinfo); if (!visualMatched) { return BadMatch; } if ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)) == NULL) { /* There is no buffer associated with the window. * Allocate a window priv. */ pDbeWindowPriv = calloc(1, sizeof(DbeWindowPrivRec)); if (!pDbeWindowPriv) return BadAlloc; /* Fill out window priv information. */ pDbeWindowPriv->pWindow = pWin; pDbeWindowPriv->width = pWin->drawable.width; pDbeWindowPriv->height = pWin->drawable.height; pDbeWindowPriv->x = pWin->drawable.x; pDbeWindowPriv->y = pWin->drawable.y; pDbeWindowPriv->nBufferIDs = 0; /* Set the buffer ID array pointer to the initial (static) array). */ pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs; /* Initialize the buffer ID list. */ pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS; pDbeWindowPriv->IDs[0] = stuff->buffer; add_index = 0; for (i = 0; i < DBE_INIT_MAX_IDS; i++) { pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT; } /* Actually connect the window priv to the window. */ dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, pDbeWindowPriv); } /* if -- There is no buffer associated with the window. */ else { /* A buffer is already associated with the window. * Add the new buffer ID to the array, reallocating the array memory * if necessary. */ /* Determine if there is a free element in the ID array. */ for (i = 0; i < pDbeWindowPriv->maxAvailableIDs; i++) { if (pDbeWindowPriv->IDs[i] == DBE_FREE_ID_ELEMENT) { /* There is still room in the ID array. */ break; } } if (i == pDbeWindowPriv->maxAvailableIDs) { /* No more room in the ID array -- reallocate another array. */ XID *pIDs; /* Setup an array pointer for the realloc operation below. */ if (pDbeWindowPriv->maxAvailableIDs == DBE_INIT_MAX_IDS) { /* We will malloc a new array. */ pIDs = NULL; } else { /* We will realloc a new array. */ pIDs = pDbeWindowPriv->IDs; } /* malloc/realloc a new array and initialize all elements to 0. */ pDbeWindowPriv->IDs = (XID *) realloc(pIDs, (pDbeWindowPriv-> maxAvailableIDs + DBE_INCR_MAX_IDS) * sizeof(XID)); if (!pDbeWindowPriv->IDs) { return BadAlloc; } memset(&pDbeWindowPriv->IDs[pDbeWindowPriv->nBufferIDs], 0, (pDbeWindowPriv->maxAvailableIDs + DBE_INCR_MAX_IDS - pDbeWindowPriv->nBufferIDs) * sizeof(XID)); if (pDbeWindowPriv->maxAvailableIDs == DBE_INIT_MAX_IDS) { /* We just went from using the initial (static) array to a * newly allocated array. Copy the IDs from the initial array * to the new array. */ memcpy(pDbeWindowPriv->IDs, pDbeWindowPriv->initIDs, DBE_INIT_MAX_IDS * sizeof(XID)); } pDbeWindowPriv->maxAvailableIDs += DBE_INCR_MAX_IDS; } add_index = i; } /* else -- A buffer is already associated with the window. */ /* Call the DDX routine to allocate the back buffer. */ status = (*pDbeScreenPriv->AllocBackBufferName) (pWin, stuff->buffer, stuff->swapAction); if (status == Success) { pDbeWindowPriv->IDs[add_index] = stuff->buffer; if (!AddResource(stuff->buffer, dbeWindowPrivResType, (void *) pDbeWindowPriv)) { pDbeWindowPriv->IDs[add_index] = DBE_FREE_ID_ELEMENT; if (pDbeWindowPriv->nBufferIDs == 0) { status = BadAlloc; goto out_free; } } } else { /* The DDX buffer allocation routine failed for the first buffer of * this window. */ if (pDbeWindowPriv->nBufferIDs == 0) { goto out_free; } } /* Increment the number of buffers (XIDs) associated with this window. */ pDbeWindowPriv->nBufferIDs++; /* Set swap action on all calls. */ pDbeWindowPriv->swapAction = stuff->swapAction; return status; out_free: dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, NULL); free(pDbeWindowPriv); return status; } /* ProcDbeAllocateBackBufferName() */ /****************************************************************************** * * DBE DIX Procedure: ProcDbeDeallocateBackBufferName * * Description: * * This function is for processing a DbeDeallocateBackBufferName request. * This request frees a drawable ID that was obtained by a * DbeAllocateBackBufferName request. * * Return Values: * * BadBuffer - buffer to deallocate is not associated with a window * Success * *****************************************************************************/ static int ProcDbeDeallocateBackBufferName(ClientPtr client) { REQUEST(xDbeDeallocateBackBufferNameReq); DbeWindowPrivPtr pDbeWindowPriv; int rc, i; void *val; REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq); /* Buffer name must be valid */ rc = dixLookupResourceByType((void **) &pDbeWindowPriv, stuff->buffer, dbeWindowPrivResType, client, DixDestroyAccess); if (rc != Success) return rc; rc = dixLookupResourceByType(&val, stuff->buffer, dbeDrawableResType, client, DixDestroyAccess); if (rc != Success) return rc; /* Make sure that the id is valid for the window. * This is paranoid code since we already looked up the ID by type * above. */ for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) { /* Loop through the ID list to find the ID. */ if (pDbeWindowPriv->IDs[i] == stuff->buffer) { break; } } if (i == pDbeWindowPriv->nBufferIDs) { /* We did not find the ID in the ID list. */ client->errorValue = stuff->buffer; return dbeErrorBase + DbeBadBuffer; } FreeResource(stuff->buffer, RT_NONE); return Success; } /* ProcDbeDeallocateBackBufferName() */ /****************************************************************************** * * DBE DIX Procedure: ProcDbeSwapBuffers * * Description: * * This function is for processing a DbeSwapBuffers request. * This request swaps the buffers for all windows listed, applying the * appropriate swap action for each window. * * Return Values: * * BadAlloc - local allocation failed; this return value is not defined * by the protocol * BadMatch - a window in request is not double-buffered; a window in * request is listed more than once * BadValue - invalid swap action is specified; no swap action is * specified * BadWindow - a window in request is not valid * Success * *****************************************************************************/ static int ProcDbeSwapBuffers(ClientPtr client) { REQUEST(xDbeSwapBuffersReq); WindowPtr pWin; DbeScreenPrivPtr pDbeScreenPriv; DbeSwapInfoPtr swapInfo; xDbeSwapInfo *dbeSwapInfo; int error; unsigned int i, j; unsigned int nStuff; int nStuff_i; /* DDX API requires int for nStuff */ REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq); nStuff = stuff->n; /* use local variable for performance. */ if (nStuff == 0) { REQUEST_SIZE_MATCH(xDbeSwapBuffersReq); return Success; } if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec)) return BadAlloc; REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, nStuff * sizeof(xDbeSwapInfo)); /* Get to the swap info appended to the end of the request. */ dbeSwapInfo = (xDbeSwapInfo *) &stuff[1]; /* Allocate array to record swap information. */ swapInfo = (DbeSwapInfoPtr) malloc(nStuff * sizeof(DbeSwapInfoRec)); if (swapInfo == NULL) { return BadAlloc; } for (i = 0; i < nStuff; i++) { /* Check all windows to swap. */ /* Each window must be a valid window - BadWindow. */ error = dixLookupWindow(&pWin, dbeSwapInfo[i].window, client, DixWriteAccess); if (error != Success) { free(swapInfo); return error; } /* Each window must be double-buffered - BadMatch. */ if (DBE_WINDOW_PRIV(pWin) == NULL) { free(swapInfo); return BadMatch; } /* Each window must only be specified once - BadMatch. */ for (j = i + 1; j < nStuff; j++) { if (dbeSwapInfo[i].window == dbeSwapInfo[j].window) { free(swapInfo); return BadMatch; } } /* Each swap action must be valid - BadValue. */ if ((dbeSwapInfo[i].swapAction != XdbeUndefined) && (dbeSwapInfo[i].swapAction != XdbeBackground) && (dbeSwapInfo[i].swapAction != XdbeUntouched) && (dbeSwapInfo[i].swapAction != XdbeCopied)) { free(swapInfo); return BadValue; } /* Everything checks out OK. Fill in the swap info array. */ swapInfo[i].pWindow = pWin; swapInfo[i].swapAction = dbeSwapInfo[i].swapAction; } /* for (i = 0; i < nStuff; i++) */ /* Call the DDX routine to perform the swap(s). The DDX routine should * scan the swap list (swap info), swap any buffers that it knows how to * handle, delete them from the list, and update nStuff to indicate how * many windows it did not handle. * * This scheme allows a range of sophistication in the DDX SwapBuffers() * implementation. Naive implementations could just swap the first buffer * in the list, move the last buffer to the front, decrement nStuff, and * return. The next level of sophistication could be to scan the whole * list for windows on the same screen. Up another level, the DDX routine * could deal with cross-screen synchronization. */ nStuff_i = nStuff; while (nStuff_i > 0) { pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(swapInfo[0].pWindow); error = (*pDbeScreenPriv->SwapBuffers) (client, &nStuff_i, swapInfo); if (error != Success) { free(swapInfo); return error; } } free(swapInfo); return Success; } /* ProcDbeSwapBuffers() */ /****************************************************************************** * * DBE DIX Procedure: ProcDbeGetVisualInfo * * Description: * * This function is for processing a ProcDbeGetVisualInfo request. * This request returns information about which visuals support * double buffering. * * Return Values: * * BadDrawable - value in screen specifiers is not a valid drawable * Success * *****************************************************************************/ static int ProcDbeGetVisualInfo(ClientPtr client) { REQUEST(xDbeGetVisualInfoReq); DbeScreenPrivPtr pDbeScreenPriv; xDbeGetVisualInfoReply rep; Drawable *drawables; DrawablePtr *pDrawables = NULL; register int i, j, rc; register int count; /* number of visual infos in reply */ register int length; /* length of reply */ ScreenPtr pScreen; XdbeScreenVisualInfo *pScrVisInfo; REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq); if (stuff->n > UINT32_MAX / sizeof(DrawablePtr)) return BadAlloc; /* Make sure any specified drawables are valid. */ if (stuff->n != 0) { if (!(pDrawables = (DrawablePtr *) malloc(stuff->n * sizeof(DrawablePtr)))) { return BadAlloc; } drawables = (Drawable *) &stuff[1]; for (i = 0; i < stuff->n; i++) { rc = dixLookupDrawable(pDrawables + i, drawables[i], client, 0, DixGetAttrAccess); if (rc != Success) { free(pDrawables); return rc; } } } count = (stuff->n == 0) ? screenInfo.numScreens : stuff->n; if (!(pScrVisInfo = calloc(count, sizeof(XdbeScreenVisualInfo)))) { free(pDrawables); return BadAlloc; } length = 0; for (i = 0; i < count; i++) { pScreen = (stuff->n == 0) ? screenInfo.screens[i] : pDrawables[i]->pScreen; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess); if (rc != Success) goto freeScrVisInfo; if (!(*pDbeScreenPriv->GetVisualInfo) (pScreen, &pScrVisInfo[i])) { /* We failed to alloc pScrVisInfo[i].visinfo. */ rc = BadAlloc; /* Free visinfos that we allocated for previous screen infos. */ goto freeScrVisInfo; } /* Account for n, number of xDbeVisInfo items in list. */ length += sizeof(CARD32); /* Account for n xDbeVisInfo items */ length += pScrVisInfo[i].count * sizeof(xDbeVisInfo); } rep = (xDbeGetVisualInfoReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = bytes_to_int32(length), .m = count }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.m); } /* Send off reply. */ WriteToClient(client, sizeof(xDbeGetVisualInfoReply), &rep); for (i = 0; i < count; i++) { CARD32 data32; /* For each screen in the reply, send off the visual info */ /* Send off number of visuals. */ data32 = (CARD32) pScrVisInfo[i].count; if (client->swapped) { swapl(&data32); } WriteToClient(client, sizeof(CARD32), &data32); /* Now send off visual info items. */ for (j = 0; j < pScrVisInfo[i].count; j++) { xDbeVisInfo visInfo; /* Copy the data in the client data structure to a protocol * data structure. We will send data to the client from the * protocol data structure. */ visInfo.visualID = (CARD32) pScrVisInfo[i].visinfo[j].visual; visInfo.depth = (CARD8) pScrVisInfo[i].visinfo[j].depth; visInfo.perfLevel = (CARD8) pScrVisInfo[i].visinfo[j].perflevel; if (client->swapped) { swapl(&visInfo.visualID); /* We do not need to swap depth and perfLevel since they are * already 1 byte quantities. */ } /* Write visualID(32), depth(8), perfLevel(8), and pad(16). */ WriteToClient(client, 2 * sizeof(CARD32), &visInfo.visualID); } } rc = Success; freeScrVisInfo: /* Clean up memory. */ for (i = 0; i < count; i++) { free(pScrVisInfo[i].visinfo); } free(pScrVisInfo); free(pDrawables); return rc; } /* ProcDbeGetVisualInfo() */ /****************************************************************************** * * DBE DIX Procedure: ProcDbeGetbackBufferAttributes * * Description: * * This function is for processing a ProcDbeGetbackBufferAttributes * request. This request returns information about a back buffer. * * Return Values: * * Success * *****************************************************************************/ static int ProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); xDbeGetBackBufferAttributesReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; DbeWindowPrivPtr pDbeWindowPriv; int rc; REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); rc = dixLookupResourceByType((void **) &pDbeWindowPriv, stuff->buffer, dbeWindowPrivResType, client, DixGetAttrAccess); if (rc == Success) { rep.attributes = pDbeWindowPriv->pWindow->drawable.id; } else { rep.attributes = None; } if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.attributes); } WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), &rep); return Success; } /* ProcDbeGetbackBufferAttributes() */ /****************************************************************************** * * DBE DIX Procedure: ProcDbeDispatch * * Description: * * This function dispatches DBE requests. * *****************************************************************************/ static int ProcDbeDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_DbeGetVersion: return (ProcDbeGetVersion(client)); case X_DbeAllocateBackBufferName: return (ProcDbeAllocateBackBufferName(client)); case X_DbeDeallocateBackBufferName: return (ProcDbeDeallocateBackBufferName(client)); case X_DbeSwapBuffers: return (ProcDbeSwapBuffers(client)); case X_DbeBeginIdiom: return Success; case X_DbeEndIdiom: return Success; case X_DbeGetVisualInfo: return (ProcDbeGetVisualInfo(client)); case X_DbeGetBackBufferAttributes: return (ProcDbeGetBackBufferAttributes(client)); default: return BadRequest; } } /* ProcDbeDispatch() */ /****************************************************************************** * * DBE DIX Procedure: SProcDbeGetVersion * * Description: * * This function is for processing a DbeGetVersion request on a swapped * server. This request returns the major and minor version numbers of * this extension. * * Return Values: * * Success * *****************************************************************************/ static int SProcDbeGetVersion(ClientPtr client) { REQUEST(xDbeGetVersionReq); swaps(&stuff->length); return (ProcDbeGetVersion(client)); } /* SProcDbeGetVersion() */ /****************************************************************************** * * DBE DIX Procedure: SProcDbeAllocateBackBufferName * * Description: * * This function is for processing a DbeAllocateBackBufferName request on * a swapped server. This request allocates a drawable ID used to refer * to the back buffer of a window. * * Return Values: * * BadAlloc - server can not allocate resources * BadIDChoice - id is out of range for client; id is already in use * BadMatch - window is not an InputOutput window; * visual of window is not on list returned by * DBEGetVisualInfo; * BadValue - invalid swap action is specified * BadWindow - window is not a valid window * Success * *****************************************************************************/ static int SProcDbeAllocateBackBufferName(ClientPtr client) { REQUEST(xDbeAllocateBackBufferNameReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq); swapl(&stuff->window); swapl(&stuff->buffer); /* stuff->swapAction is a byte. We do not need to swap this field. */ return (ProcDbeAllocateBackBufferName(client)); } /* SProcDbeAllocateBackBufferName() */ /****************************************************************************** * * DBE DIX Procedure: SProcDbeDeallocateBackBufferName * * Description: * * This function is for processing a DbeDeallocateBackBufferName request * on a swapped server. This request frees a drawable ID that was * obtained by a DbeAllocateBackBufferName request. * * Return Values: * * BadBuffer - buffer to deallocate is not associated with a window * Success * *****************************************************************************/ static int SProcDbeDeallocateBackBufferName(ClientPtr client) { REQUEST(xDbeDeallocateBackBufferNameReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq); swapl(&stuff->buffer); return (ProcDbeDeallocateBackBufferName(client)); } /* SProcDbeDeallocateBackBufferName() */ /****************************************************************************** * * DBE DIX Procedure: SProcDbeSwapBuffers * * Description: * * This function is for processing a DbeSwapBuffers request on a swapped * server. This request swaps the buffers for all windows listed, * applying the appropriate swap action for each window. * * Return Values: * * BadMatch - a window in request is not double-buffered; a window in * request is listed more than once; all windows in request do * not have the same root * BadValue - invalid swap action is specified * BadWindow - a window in request is not valid * Success * *****************************************************************************/ static int SProcDbeSwapBuffers(ClientPtr client) { REQUEST(xDbeSwapBuffersReq); unsigned int i; xDbeSwapInfo *pSwapInfo; swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq); swapl(&stuff->n); if (stuff->n > UINT32_MAX / sizeof(DbeSwapInfoRec)) return BadAlloc; REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, stuff->n * sizeof(xDbeSwapInfo)); if (stuff->n != 0) { pSwapInfo = (xDbeSwapInfo *) stuff + 1; /* The swap info following the fix part of this request is a window(32) * followed by a 1 byte swap action and then 3 pad bytes. We only need * to swap the window information. */ for (i = 0; i < stuff->n; i++) { swapl(&pSwapInfo->window); } } return (ProcDbeSwapBuffers(client)); } /* SProcDbeSwapBuffers() */ /****************************************************************************** * * DBE DIX Procedure: SProcDbeGetVisualInfo * * Description: * * This function is for processing a ProcDbeGetVisualInfo request on a * swapped server. This request returns information about which visuals * support double buffering. * * Return Values: * * BadDrawable - value in screen specifiers is not a valid drawable * Success * *****************************************************************************/ static int SProcDbeGetVisualInfo(ClientPtr client) { REQUEST(xDbeGetVisualInfoReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq); swapl(&stuff->n); SwapRestL(stuff); return (ProcDbeGetVisualInfo(client)); } /* SProcDbeGetVisualInfo() */ /****************************************************************************** * * DBE DIX Procedure: SProcDbeGetbackBufferAttributes * * Description: * * This function is for processing a ProcDbeGetbackBufferAttributes * request on a swapped server. This request returns information about a * back buffer. * * Return Values: * * Success * *****************************************************************************/ static int SProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); swapl(&stuff->buffer); return (ProcDbeGetBackBufferAttributes(client)); } /* SProcDbeGetBackBufferAttributes() */ /****************************************************************************** * * DBE DIX Procedure: SProcDbeDispatch * * Description: * * This function dispatches DBE requests on a swapped server. * *****************************************************************************/ static int SProcDbeDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_DbeGetVersion: return (SProcDbeGetVersion(client)); case X_DbeAllocateBackBufferName: return (SProcDbeAllocateBackBufferName(client)); case X_DbeDeallocateBackBufferName: return (SProcDbeDeallocateBackBufferName(client)); case X_DbeSwapBuffers: return (SProcDbeSwapBuffers(client)); case X_DbeBeginIdiom: return Success; case X_DbeEndIdiom: return Success; case X_DbeGetVisualInfo: return (SProcDbeGetVisualInfo(client)); case X_DbeGetBackBufferAttributes: return (SProcDbeGetBackBufferAttributes(client)); default: return BadRequest; } } /* SProcDbeDispatch() */ /****************************************************************************** * * DBE DIX Procedure: DbeSetupBackgroundPainter * * Description: * * This function sets up pGC to clear pixmaps. * * Return Values: * * TRUE - setup was successful * FALSE - the window's background state is NONE * *****************************************************************************/ static Bool DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC) { ChangeGCVal gcvalues[4]; int ts_x_origin, ts_y_origin; PixUnion background; int backgroundState; Mask gcmask; /* First take care of any ParentRelative stuff by altering the * tile/stipple origin to match the coordinates of the upper-left * corner of the first ancestor without a ParentRelative background. * This coordinate is, of course, negative. */ ts_x_origin = ts_y_origin = 0; while (pWin->backgroundState == ParentRelative) { ts_x_origin -= pWin->origin.x; ts_y_origin -= pWin->origin.y; pWin = pWin->parent; } backgroundState = pWin->backgroundState; background = pWin->background; switch (backgroundState) { case BackgroundPixel: gcvalues[0].val = background.pixel; gcvalues[1].val = FillSolid; gcmask = GCForeground | GCFillStyle; break; case BackgroundPixmap: gcvalues[0].val = FillTiled; gcvalues[1].ptr = background.pixmap; gcvalues[2].val = ts_x_origin; gcvalues[3].val = ts_y_origin; gcmask = GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; break; default: /* pWin->backgroundState == None */ return FALSE; } return ChangeGC(NullClient, pGC, gcmask, gcvalues) == 0; } /* DbeSetupBackgroundPainter() */ /****************************************************************************** * * DBE DIX Procedure: DbeDrawableDelete * * Description: * * This is the resource delete function for dbeDrawableResType. * It is registered when the drawable resource type is created in * DbeExtensionInit(). * * To make resource deletion simple, we do not do anything in this function * and leave all resource deleteion to DbeWindowPrivDelete(), which will * eventually be called or already has been called. Deletion functions are * not guaranteed to be called in any particular order. * *****************************************************************************/ static int DbeDrawableDelete(void *pDrawable, XID id) { return Success; } /* DbeDrawableDelete() */ /****************************************************************************** * * DBE DIX Procedure: DbeWindowPrivDelete * * Description: * * This is the resource delete function for dbeWindowPrivResType. * It is registered when the drawable resource type is created in * DbeExtensionInit(). * *****************************************************************************/ static int DbeWindowPrivDelete(void *pDbeWinPriv, XID id) { DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv = (DbeWindowPrivPtr) pDbeWinPriv; int i; /* ************************************************************************** ** Remove the buffer ID from the ID array. ************************************************************************** */ /* Find the ID in the ID array. */ i = 0; while ((i < pDbeWindowPriv->nBufferIDs) && (pDbeWindowPriv->IDs[i] != id)) { i++; } if (i == pDbeWindowPriv->nBufferIDs) { /* We did not find the ID in the array. We should never get here. */ return BadValue; } /* Remove the ID from the array. */ if (i < (pDbeWindowPriv->nBufferIDs - 1)) { /* Compress the buffer ID array, overwriting the ID in the process. */ memmove(&pDbeWindowPriv->IDs[i], &pDbeWindowPriv->IDs[i + 1], (pDbeWindowPriv->nBufferIDs - i - 1) * sizeof(XID)); } else { /* We are removing the last ID in the array, in which case, the * assignement below is all that we need to do. */ } pDbeWindowPriv->IDs[pDbeWindowPriv->nBufferIDs - 1] = DBE_FREE_ID_ELEMENT; pDbeWindowPriv->nBufferIDs--; /* If an extended array was allocated, then check to see if the remaining * buffer IDs will fit in the static array. */ if ((pDbeWindowPriv->maxAvailableIDs > DBE_INIT_MAX_IDS) && (pDbeWindowPriv->nBufferIDs == DBE_INIT_MAX_IDS)) { /* Copy the IDs back into the static array. */ memcpy(pDbeWindowPriv->initIDs, pDbeWindowPriv->IDs, DBE_INIT_MAX_IDS * sizeof(XID)); /* Free the extended array; use the static array. */ free(pDbeWindowPriv->IDs); pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs; pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS; } /* ************************************************************************** ** Perform DDX level tasks. ************************************************************************** */ pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW_PRIV((DbeWindowPrivPtr) pDbeWindowPriv); (*pDbeScreenPriv->WinPrivDelete) ((DbeWindowPrivPtr) pDbeWindowPriv, id); /* ************************************************************************** ** Perform miscellaneous tasks if this is the last buffer associated ** with the window. ************************************************************************** */ if (pDbeWindowPriv->nBufferIDs == 0) { /* Reset the DBE window priv pointer. */ dixSetPrivate(&pDbeWindowPriv->pWindow->devPrivates, dbeWindowPrivKey, NULL); /* We are done with the window priv. */ free(pDbeWindowPriv); } return Success; } /* DbeWindowPrivDelete() */ /****************************************************************************** * * DBE DIX Procedure: DbeResetProc * * Description: * * This routine is called at the end of every server generation. * It deallocates any memory reserved for the extension and performs any * other tasks related to shutting down the extension. * *****************************************************************************/ static void DbeResetProc(ExtensionEntry * extEntry) { int i; ScreenPtr pScreen; DbeScreenPrivPtr pDbeScreenPriv; for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); if (pDbeScreenPriv) { /* Unwrap DestroyWindow, which was wrapped in DbeExtensionInit(). */ pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow; pScreen->PositionWindow = pDbeScreenPriv->PositionWindow; free(pDbeScreenPriv); } } } /* DbeResetProc() */ /****************************************************************************** * * DBE DIX Procedure: DbeDestroyWindow * * Description: * * This is the wrapper for pScreen->DestroyWindow. * This function frees buffer resources for a window before it is * destroyed. * *****************************************************************************/ static Bool DbeDestroyWindow(WindowPtr pWin) { DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv; ScreenPtr pScreen; Bool ret; /* ************************************************************************** ** 1. Unwrap the member routine. ************************************************************************** */ pScreen = pWin->drawable.pScreen; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow; /* ************************************************************************** ** 2. Do any work necessary before the member routine is called. ** ** Call the window priv delete function for all buffer IDs associated ** with this window. ************************************************************************** */ if ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin))) { while (pDbeWindowPriv) { /* *DbeWinPrivDelete() will free the window private and set it to * NULL if there are no more buffer IDs associated with this * window. */ FreeResource(pDbeWindowPriv->IDs[0], RT_NONE); pDbeWindowPriv = DBE_WINDOW_PRIV(pWin); } } /* ************************************************************************** ** 3. Call the member routine, saving its result if necessary. ************************************************************************** */ ret = (*pScreen->DestroyWindow) (pWin); /* ************************************************************************** ** 4. Rewrap the member routine, restoring the wrapper value first in case ** the wrapper (or something that it wrapped) change this value. ************************************************************************** */ pDbeScreenPriv->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = DbeDestroyWindow; /* ************************************************************************** ** 5. Do any work necessary after the member routine has been called. ** ** In this case we do not need to do anything. ************************************************************************** */ return ret; } /* DbeDestroyWindow() */ /****************************************************************************** * * DBE DIX Procedure: DbeExtensionInit * * Description: * * Called from InitExtensions in main() * *****************************************************************************/ void DbeExtensionInit(void) { ExtensionEntry *extEntry; register int i, j; ScreenPtr pScreen = NULL; DbeScreenPrivPtr pDbeScreenPriv; int nStubbedScreens = 0; Bool ddxInitSuccess; #ifdef PANORAMIX if (!noPanoramiXExtension) return; #endif /* Create the resource types. */ dbeDrawableResType = CreateNewResourceType(DbeDrawableDelete, "dbeDrawable"); if (!dbeDrawableResType) return; dbeDrawableResType |= RC_DRAWABLE; dbeWindowPrivResType = CreateNewResourceType(DbeWindowPrivDelete, "dbeWindow"); if (!dbeWindowPrivResType) return; if (!dixRegisterPrivateKey(&dbeScreenPrivKeyRec, PRIVATE_SCREEN, 0)) return; if (!dixRegisterPrivateKey(&dbeWindowPrivKeyRec, PRIVATE_WINDOW, 0)) return; for (i = 0; i < screenInfo.numScreens; i++) { /* For each screen, set up DBE screen privates and init DIX and DDX * interface. */ pScreen = screenInfo.screens[i]; if (!(pDbeScreenPriv = malloc(sizeof(DbeScreenPrivRec)))) { /* If we can not alloc a window or screen private, * then free any privates that we already alloc'ed and return */ for (j = 0; j < i; j++) { free(dixLookupPrivate(&screenInfo.screens[j]->devPrivates, dbeScreenPrivKey)); dixSetPrivate(&screenInfo.screens[j]->devPrivates, dbeScreenPrivKey, NULL); } return; } dixSetPrivate(&pScreen->devPrivates, dbeScreenPrivKey, pDbeScreenPriv); { /* We don't have DDX support for DBE anymore */ #ifndef DISABLE_MI_DBE_BY_DEFAULT /* Setup DIX. */ pDbeScreenPriv->SetupBackgroundPainter = DbeSetupBackgroundPainter; /* Setup DDX. */ ddxInitSuccess = miDbeInit(pScreen, pDbeScreenPriv); /* DDX DBE initialization may have the side affect of * reallocating pDbeScreenPriv, so we need to update it. */ pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); if (ddxInitSuccess) { /* Wrap DestroyWindow. The DDX initialization function * already wrapped PositionWindow for us. */ pDbeScreenPriv->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = DbeDestroyWindow; } else { /* DDX initialization failed. Stub the screen. */ DbeStubScreen(pDbeScreenPriv, &nStubbedScreens); } #else DbeStubScreen(pDbeScreenPriv, &nStubbedScreens); #endif } } /* for (i = 0; i < screenInfo.numScreens; i++) */ if (nStubbedScreens == screenInfo.numScreens) { /* All screens stubbed. Clean up and return. */ for (i = 0; i < screenInfo.numScreens; i++) { free(dixLookupPrivate(&screenInfo.screens[i]->devPrivates, dbeScreenPrivKey)); dixSetPrivate(&pScreen->devPrivates, dbeScreenPrivKey, NULL); } return; } /* Now add the extension. */ extEntry = AddExtension(DBE_PROTOCOL_NAME, DbeNumberEvents, DbeNumberErrors, ProcDbeDispatch, SProcDbeDispatch, DbeResetProc, StandardMinorOpcode); dbeErrorBase = extEntry->errorBase; SetResourceTypeErrorValue(dbeWindowPrivResType, dbeErrorBase + DbeBadBuffer); SetResourceTypeErrorValue(dbeDrawableResType, dbeErrorBase + DbeBadBuffer); } /* DbeExtensionInit() */ xorg-server-1.17.1/dbe/dbestruct.h0000664000175100017510000001622012456571574013734 00000000000000/****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company * * 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. * * Header file for DIX-related DBE * *****************************************************************************/ #ifndef DBE_STRUCT_H #define DBE_STRUCT_H /* INCLUDES */ #define NEED_DBE_PROTOCOL #include #include "windowstr.h" #include "privates.h" typedef struct { VisualID visual; /* one visual ID that supports double-buffering */ int depth; /* depth of visual in bits */ int perflevel; /* performance level of visual */ } XdbeVisualInfo; typedef struct { int count; /* number of items in visual_depth */ XdbeVisualInfo *visinfo; /* list of visuals & depths for scrn */ } XdbeScreenVisualInfo; /* DEFINES */ #define DBE_SCREEN_PRIV(pScreen) ((DbeScreenPrivPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, dbeScreenPrivKey)) #define DBE_SCREEN_PRIV_FROM_DRAWABLE(pDrawable) \ DBE_SCREEN_PRIV((pDrawable)->pScreen) #define DBE_SCREEN_PRIV_FROM_WINDOW_PRIV(pDbeWindowPriv) \ DBE_SCREEN_PRIV((pDbeWindowPriv)->pWindow->drawable.pScreen) #define DBE_SCREEN_PRIV_FROM_WINDOW(pWindow) \ DBE_SCREEN_PRIV((pWindow)->drawable.pScreen) #define DBE_SCREEN_PRIV_FROM_PIXMAP(pPixmap) \ DBE_SCREEN_PRIV((pPixmap)->drawable.pScreen) #define DBE_SCREEN_PRIV_FROM_GC(pGC)\ DBE_SCREEN_PRIV((pGC)->pScreen) #define DBE_WINDOW_PRIV(pWin) ((DbeWindowPrivPtr) \ dixLookupPrivate(&(pWin)->devPrivates, dbeWindowPrivKey)) /* Initial size of the buffer ID array in the window priv. */ #define DBE_INIT_MAX_IDS 2 /* Reallocation increment for the buffer ID array. */ #define DBE_INCR_MAX_IDS 4 /* Marker for free elements in the buffer ID array. */ #define DBE_FREE_ID_ELEMENT 0 /* TYPEDEFS */ /* Record used to pass swap information between DIX and DDX swapping * procedures. */ typedef struct _DbeSwapInfoRec { WindowPtr pWindow; unsigned char swapAction; } DbeSwapInfoRec, *DbeSwapInfoPtr; /* ****************************************************************************** ** Per-window data ****************************************************************************** */ typedef struct _DbeWindowPrivRec { /* A pointer to the window with which the DBE window private (buffer) is * associated. */ WindowPtr pWindow; /* Last known swap action for this buffer. Legal values for this field * are XdbeUndefined, XdbeBackground, XdbeUntouched, and XdbeCopied. */ unsigned char swapAction; /* Last known buffer size. */ unsigned short width, height; /* Coordinates used for static gravity when the window is positioned. */ short x, y; /* Number of XIDs associated with this buffer. */ int nBufferIDs; /* Capacity of the current buffer ID array, IDs. */ int maxAvailableIDs; /* Pointer to the array of buffer IDs. This initially points to initIDs. * When the static limit of the initIDs array is reached, the array is * reallocated and this pointer is set to the new array instead of initIDs. */ XID *IDs; /* Initial array of buffer IDs. We are defining the XID array within the * window priv to optimize for data locality. In most cases, only one * buffer will be associated with a window. Having the array declared * here can prevent us from accessing the data in another memory page, * possibly resulting in a page swap and loss of performance. Initially we * will use this array to store buffer IDs. For situations where we have * more IDs than can fit in this static array, we will allocate a larger * array to use, possibly suffering a performance loss. */ XID initIDs[DBE_INIT_MAX_IDS]; /* Pointer to a drawable that contains the contents of the back buffer. */ PixmapPtr pBackBuffer; /* Pointer to a drawable that contains the contents of the front buffer. * This pointer is only used for the XdbeUntouched swap action. For that * swap action, we need to copy the front buffer (window) contents into * this drawable, copy the contents of current back buffer drawable (the * back buffer) into the window, swap the front and back drawable pointers, * and then swap the drawable/resource associations in the resource * database. */ PixmapPtr pFrontBuffer; /* Device-specific private information. */ PrivateRec *devPrivates; } DbeWindowPrivRec, *DbeWindowPrivPtr; /* ****************************************************************************** ** Per-screen data ****************************************************************************** */ typedef struct _DbeScreenPrivRec { /* Wrapped functions * It is the responsibilty of the DDX layer to wrap PositionWindow(). * DbeExtensionInit wraps DestroyWindow(). */ PositionWindowProcPtr PositionWindow; DestroyWindowProcPtr DestroyWindow; /* Per-screen DIX routines */ Bool (*SetupBackgroundPainter) (WindowPtr /*pWin */ , GCPtr /*pGC */ ); /* Per-screen DDX routines */ Bool (*GetVisualInfo) (ScreenPtr /*pScreen */ , XdbeScreenVisualInfo * /*pVisInfo */ ); int (*AllocBackBufferName) (WindowPtr /*pWin */ , XID /*bufId */ , int /*swapAction */ ); int (*SwapBuffers) (ClientPtr /*client */ , int * /*pNumWindows */ , DbeSwapInfoPtr /*swapInfo */ ); void (*WinPrivDelete) (DbeWindowPrivPtr /*pDbeWindowPriv */ , XID /*bufId */ ); } DbeScreenPrivRec, *DbeScreenPrivPtr; #endif /* DBE_STRUCT_H */ xorg-server-1.17.1/dbe/midbe.c0000664000175100017510000005541112456571574013015 00000000000000/****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company * * 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. * * Machine-independent DBE code * *****************************************************************************/ /* INCLUDES */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "misc.h" #include "os.h" #include "windowstr.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "extnsionst.h" #include "dixstruct.h" #include "resource.h" #include "opaque.h" #include "dbestruct.h" #include "regionstr.h" #include "gcstruct.h" #include "inputstr.h" #include "midbe.h" #include "xace.h" #include /****************************************************************************** * * DBE MI Procedure: miDbeGetVisualInfo * * Description: * * This is the MI function for the DbeGetVisualInfo request. This function * is called through pDbeScreenPriv->GetVisualInfo. This function is also * called for the DbeAllocateBackBufferName request at the extension level; * it is called by ProcDbeAllocateBackBufferName() in dbe.c. * * If memory allocation fails or we can not get the visual info, this * function returns FALSE. Otherwise, it returns TRUE for success. * *****************************************************************************/ static Bool miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo * pScrVisInfo) { register int i, j, k; register int count; DepthPtr pDepth; XdbeVisualInfo *visInfo; /* Determine number of visuals for this screen. */ for (i = 0, count = 0; i < pScreen->numDepths; i++) { count += pScreen->allowedDepths[i].numVids; } /* Allocate an array of XdbeVisualInfo items. */ if (!(visInfo = (XdbeVisualInfo *) malloc(count * sizeof(XdbeVisualInfo)))) { return FALSE; /* memory alloc failure */ } for (i = 0, k = 0; i < pScreen->numDepths; i++) { /* For each depth of this screen, get visual information. */ pDepth = &pScreen->allowedDepths[i]; for (j = 0; j < pDepth->numVids; j++) { /* For each visual for this depth of this screen, get visual ID * and visual depth. Since this is MI code, we will always return * the same performance level for all visuals (0). A higher * performance level value indicates higher performance. */ visInfo[k].visual = pDepth->vids[j]; visInfo[k].depth = pDepth->depth; visInfo[k].perflevel = 0; k++; } } /* Record the number of visuals and point visual_depth to * the array of visual info. */ pScrVisInfo->count = count; pScrVisInfo->visinfo = visInfo; return TRUE; /* success */ } /* miDbeGetVisualInfo() */ /****************************************************************************** * * DBE MI Procedure: miAllocBackBufferName * * Description: * * This is the MI function for the DbeAllocateBackBufferName request. * *****************************************************************************/ static int miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) { ScreenPtr pScreen; DbeWindowPrivPtr pDbeWindowPriv; DbeScreenPrivPtr pDbeScreenPriv; GCPtr pGC; xRectangle clearRect; int rc; pScreen = pWin->drawable.pScreen; pDbeWindowPriv = DBE_WINDOW_PRIV(pWin); if (pDbeWindowPriv->nBufferIDs == 0) { /* There is no buffer associated with the window. * We have to create the window priv priv. Remember, the window * priv was created at the DIX level, so all we need to do is * create the priv priv and attach it to the priv. */ pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); /* Get a front pixmap. */ if (!(pDbeWindowPriv->pFrontBuffer = (*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width, pDbeWindowPriv->height, pWin->drawable.depth, 0))) { return BadAlloc; } /* Get a back pixmap. */ if (!(pDbeWindowPriv->pBackBuffer = (*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width, pDbeWindowPriv->height, pWin->drawable.depth, 0))) { (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); return BadAlloc; } /* Security creation/labeling check. */ rc = XaceHook(XACE_RESOURCE_ACCESS, serverClient, bufId, dbeDrawableResType, pDbeWindowPriv->pBackBuffer, RT_WINDOW, pWin, DixCreateAccess); /* Make the back pixmap a DBE drawable resource. */ if (rc != Success || !AddResource(bufId, dbeDrawableResType, pDbeWindowPriv->pBackBuffer)) { /* free the buffer and the drawable resource */ FreeResource(bufId, RT_NONE); return (rc == Success) ? BadAlloc : rc; } /* Clear the back buffer. */ pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) { ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC); clearRect.x = clearRect.y = 0; clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width; clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height; (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv-> pBackBuffer, pGC, 1, &clearRect); } FreeScratchGC(pGC); } /* if no buffer associated with the window */ else { /* A buffer is already associated with the window. * Place the new buffer ID information at the head of the ID list. */ /* Associate the new ID with an existing pixmap. */ if (!AddResource(bufId, dbeDrawableResType, (void *) pDbeWindowPriv->pBackBuffer)) { return BadAlloc; } } return Success; } /* miDbeAllocBackBufferName() */ /****************************************************************************** * * DBE MI Procedure: miDbeAliasBuffers * * Description: * * This function associates all XIDs of a buffer with the back pixmap * stored in the window priv. * *****************************************************************************/ static void miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv) { int i; for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) { ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType, (void *) pDbeWindowPriv->pBackBuffer); } } /* miDbeAliasBuffers() */ /****************************************************************************** * * DBE MI Procedure: miDbeSwapBuffers * * Description: * * This is the MI function for the DbeSwapBuffers request. * *****************************************************************************/ static int miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) { DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv; GCPtr pGC; WindowPtr pWin; PixmapPtr pTmpBuffer; xRectangle clearRect; pWin = swapInfo[0].pWindow; pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin); pDbeWindowPriv = DBE_WINDOW_PRIV(pWin); pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); /* ********************************************************************** ** Setup before swap. ********************************************************************** */ switch (swapInfo[0].swapAction) { case XdbeUndefined: break; case XdbeBackground: break; case XdbeUntouched: ValidateGC((DrawablePtr) pDbeWindowPriv->pFrontBuffer, pGC); (*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pDbeWindowPriv->pFrontBuffer, pGC, 0, 0, pWin->drawable.width, pWin->drawable.height, 0, 0); break; case XdbeCopied: break; } /* ********************************************************************** ** Swap. ********************************************************************** */ ValidateGC((DrawablePtr) pWin, pGC); (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer, (DrawablePtr) pWin, pGC, 0, 0, pWin->drawable.width, pWin->drawable.height, 0, 0); /* ********************************************************************** ** Tasks after swap. ********************************************************************** */ switch (swapInfo[0].swapAction) { case XdbeUndefined: break; case XdbeBackground: if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) { ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC); clearRect.x = 0; clearRect.y = 0; clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width; clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height; (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv-> pBackBuffer, pGC, 1, &clearRect); } break; case XdbeUntouched: /* Swap pixmap pointers. */ pTmpBuffer = pDbeWindowPriv->pBackBuffer; pDbeWindowPriv->pBackBuffer = pDbeWindowPriv->pFrontBuffer; pDbeWindowPriv->pFrontBuffer = pTmpBuffer; miDbeAliasBuffers(pDbeWindowPriv); break; case XdbeCopied: break; } /* Remove the swapped window from the swap information array and decrement * pNumWindows to indicate to the DIX level how many windows were actually * swapped. */ if (*pNumWindows > 1) { /* We were told to swap more than one window, but we only swapped the * first one. Remove the first window in the list by moving the last * window to the beginning. */ swapInfo[0].pWindow = swapInfo[*pNumWindows - 1].pWindow; swapInfo[0].swapAction = swapInfo[*pNumWindows - 1].swapAction; /* Clear the last window information just to be safe. */ swapInfo[*pNumWindows - 1].pWindow = (WindowPtr) NULL; swapInfo[*pNumWindows - 1].swapAction = 0; } else { /* Clear the window information just to be safe. */ swapInfo[0].pWindow = (WindowPtr) NULL; swapInfo[0].swapAction = 0; } (*pNumWindows)--; FreeScratchGC(pGC); return Success; } /* miSwapBuffers() */ /****************************************************************************** * * DBE MI Procedure: miDbeWinPrivDelete * * Description: * * This is the MI function for deleting the dbeWindowPrivResType resource. * This function is invoked indirectly by calling FreeResource() to free * the resources associated with a DBE buffer ID. There are 5 ways that * miDbeWinPrivDelete() can be called by FreeResource(). They are: * * - A DBE window is destroyed, in which case the DbeDestroyWindow() * wrapper is invoked. The wrapper calls FreeResource() for all DBE * buffer IDs. * * - miDbeAllocBackBufferName() calls FreeResource() to clean up resources * after a buffer allocation failure. * * - The PositionWindow wrapper, miDbePositionWindow(), calls * FreeResource() when it fails to create buffers of the new size. * FreeResource() is called for all DBE buffer IDs. * * - FreeClientResources() calls FreeResource() when a client dies or the * the server resets. * * When FreeResource() is called for a DBE buffer ID, the delete function * for the only other type of DBE resource, dbeDrawableResType, is also * invoked. This delete function (DbeDrawableDelete) is a NOOP to make * resource deletion easier. It is not guaranteed which delete function is * called first. Hence, we will let miDbeWinPrivDelete() free all DBE * resources. * * This function deletes/frees the following stuff associated with * the window private: * * - the ID node in the ID list representing the passed in ID. * * In addition, pDbeWindowPriv->nBufferIDs is decremented. * * If this function is called for the last/only buffer ID for a window, * these are additionally deleted/freed: * * - the front and back pixmaps * - the window priv itself * *****************************************************************************/ static void miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId) { if (pDbeWindowPriv->nBufferIDs != 0) { /* We still have at least one more buffer ID associated with this * window. */ return; } /* We have no more buffer IDs associated with this window. We need to * free some stuff. */ /* Destroy the front and back pixmaps. */ if (pDbeWindowPriv->pFrontBuffer) { (*pDbeWindowPriv->pWindow->drawable.pScreen-> DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); } if (pDbeWindowPriv->pBackBuffer) { (*pDbeWindowPriv->pWindow->drawable.pScreen-> DestroyPixmap) (pDbeWindowPriv->pBackBuffer); } } /* miDbeWinPrivDelete() */ /****************************************************************************** * * DBE MI Procedure: miDbePositionWindow * * Description: * * This function was cloned from miMbxPositionWindow() in mimultibuf.c. * This function resizes the buffer when the window is resized. * *****************************************************************************/ static Bool miDbePositionWindow(WindowPtr pWin, int x, int y) { ScreenPtr pScreen; DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv; int width, height; int dx, dy, dw, dh; int sourcex, sourcey; int destx, desty; int savewidth, saveheight; PixmapPtr pFrontBuffer; PixmapPtr pBackBuffer; Bool clear; GCPtr pGC; xRectangle clearRect; Bool ret; /* ************************************************************************** ** 1. Unwrap the member routine. ************************************************************************** */ pScreen = pWin->drawable.pScreen; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); pScreen->PositionWindow = pDbeScreenPriv->PositionWindow; /* ************************************************************************** ** 2. Do any work necessary before the member routine is called. ** ** In this case we do not need to do anything. ************************************************************************** */ /* ************************************************************************** ** 3. Call the member routine, saving its result if necessary. ************************************************************************** */ ret = (*pScreen->PositionWindow) (pWin, x, y); /* ************************************************************************** ** 4. Rewrap the member routine, restoring the wrapper value first in case ** the wrapper (or something that it wrapped) change this value. ************************************************************************** */ pDbeScreenPriv->PositionWindow = pScreen->PositionWindow; pScreen->PositionWindow = miDbePositionWindow; /* ************************************************************************** ** 5. Do any work necessary after the member routine has been called. ************************************************************************** */ if (!(pDbeWindowPriv = DBE_WINDOW_PRIV(pWin))) { return ret; } if (pDbeWindowPriv->width == pWin->drawable.width && pDbeWindowPriv->height == pWin->drawable.height) { return ret; } width = pWin->drawable.width; height = pWin->drawable.height; dx = pWin->drawable.x - pDbeWindowPriv->x; dy = pWin->drawable.y - pDbeWindowPriv->y; dw = width - pDbeWindowPriv->width; dh = height - pDbeWindowPriv->height; GravityTranslate(0, 0, -dx, -dy, dw, dh, pWin->bitGravity, &destx, &desty); clear = ((pDbeWindowPriv->width < (unsigned short) width) || (pDbeWindowPriv->height < (unsigned short) height) || (pWin->bitGravity == ForgetGravity)); sourcex = 0; sourcey = 0; savewidth = pDbeWindowPriv->width; saveheight = pDbeWindowPriv->height; /* Clip rectangle to source and destination. */ if (destx < 0) { savewidth += destx; sourcex -= destx; destx = 0; } if (destx + savewidth > width) { savewidth = width - destx; } if (desty < 0) { saveheight += desty; sourcey -= desty; desty = 0; } if (desty + saveheight > height) { saveheight = height - desty; } pDbeWindowPriv->width = width; pDbeWindowPriv->height = height; pDbeWindowPriv->x = pWin->drawable.x; pDbeWindowPriv->y = pWin->drawable.y; pGC = GetScratchGC(pWin->drawable.depth, pScreen); if (clear) { if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) { clearRect.x = 0; clearRect.y = 0; clearRect.width = width; clearRect.height = height; } else { clear = FALSE; } } /* Create DBE buffer pixmaps equal to size of resized window. */ pFrontBuffer = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth, 0); pBackBuffer = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth, 0); if (!pFrontBuffer || !pBackBuffer) { /* We failed at creating 1 or 2 of the pixmaps. */ if (pFrontBuffer) { (*pScreen->DestroyPixmap) (pFrontBuffer); } if (pBackBuffer) { (*pScreen->DestroyPixmap) (pBackBuffer); } /* Destroy all buffers for this window. */ while (pDbeWindowPriv) { /* DbeWindowPrivDelete() will free the window private if there no * more buffer IDs associated with this window. */ FreeResource(pDbeWindowPriv->IDs[0], RT_NONE); pDbeWindowPriv = DBE_WINDOW_PRIV(pWin); } FreeScratchGC(pGC); return FALSE; } else { /* Clear out the new DBE buffer pixmaps. */ /* I suppose this could avoid quite a bit of work if * it computed the minimal area required. */ ValidateGC(&pFrontBuffer->drawable, pGC); if (clear) { (*pGC->ops->PolyFillRect) ((DrawablePtr) pFrontBuffer, pGC, 1, &clearRect); } /* Copy the contents of the old front pixmap to the new one. */ if (pWin->bitGravity != ForgetGravity) { (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pFrontBuffer, (DrawablePtr) pFrontBuffer, pGC, sourcex, sourcey, savewidth, saveheight, destx, desty); } ValidateGC(&pBackBuffer->drawable, pGC); if (clear) { (*pGC->ops->PolyFillRect) ((DrawablePtr) pBackBuffer, pGC, 1, &clearRect); } /* Copy the contents of the old back pixmap to the new one. */ if (pWin->bitGravity != ForgetGravity) { (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer, (DrawablePtr) pBackBuffer, pGC, sourcex, sourcey, savewidth, saveheight, destx, desty); } /* Destroy the old pixmaps, and point the DBE window priv to the new * pixmaps. */ (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); (*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer); pDbeWindowPriv->pFrontBuffer = pFrontBuffer; pDbeWindowPriv->pBackBuffer = pBackBuffer; /* Make sure all XID are associated with the new back pixmap. */ miDbeAliasBuffers(pDbeWindowPriv); FreeScratchGC(pGC); } return ret; } /* miDbePositionWindow() */ /****************************************************************************** * * DBE MI Procedure: miDbeInit * * Description: * * This is the MI initialization function called by DbeExtensionInit(). * *****************************************************************************/ Bool miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv) { /* Wrap functions. */ pDbeScreenPriv->PositionWindow = pScreen->PositionWindow; pScreen->PositionWindow = miDbePositionWindow; /* Initialize the per-screen DBE function pointers. */ pDbeScreenPriv->GetVisualInfo = miDbeGetVisualInfo; pDbeScreenPriv->AllocBackBufferName = miDbeAllocBackBufferName; pDbeScreenPriv->SwapBuffers = miDbeSwapBuffers; pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete; return TRUE; } /* miDbeInit() */ xorg-server-1.17.1/dbe/Makefile.in0000664000175100017510000006542612466505427013640 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = dbe DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libdbe_la_LIBADD = am_libdbe_la_OBJECTS = dbe.lo midbe.lo libdbe_la_OBJECTS = $(am_libdbe_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 = $(libdbe_la_SOURCES) DIST_SOURCES = $(libdbe_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = dbestruct.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libdbe.la AM_CFLAGS = $(DIX_CFLAGS) @XORG_TRUE@sdk_HEADERS = dbestruct.h libdbe_la_SOURCES = \ dbe.c \ midbe.c \ midbe.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 dbe/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dbe/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libdbe.la: $(libdbe_la_OBJECTS) $(libdbe_la_DEPENDENCIES) $(EXTRA_libdbe_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdbe_la_OBJECTS) $(libdbe_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midbe.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/INSTALL0000644000175100017510000003660012466505442012055 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. xorg-server-1.17.1/os/0000775000175100017510000000000012466505443011523 500000000000000xorg-server-1.17.1/os/Makefile.am0000664000175100017510000000215612240262364013473 00000000000000noinst_LTLIBRARIES = libos.la AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c XORG_SRCS = log.c BUSFAULT_SRCS = busfault.c libos_la_SOURCES = \ WaitFor.c \ access.c \ auth.c \ backtrace.c \ client.c \ connection.c \ io.c \ mitauth.c \ oscolor.c \ osdep.h \ osinit.c \ utils.c \ xdmauth.c \ xsha1.c \ xstrans.c \ xprintf.c \ $(XORG_SRCS) libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS) if SECURE_RPC libos_la_SOURCES += $(SECURERPC_SRCS) endif if XDMCP libos_la_SOURCES += $(XDMCP_SRCS) endif if HAVE_LIBUNWIND AM_CFLAGS += $(LIBUNWIND_CFLAGS) libos_la_LIBADD += $(LIBUNWIND_LIBS) endif if BUSFAULT libos_la_SOURCES += $(BUSFAULT_SRCS) endif EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libos & libdix dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o noinst_PROGRAMS = os.O os_O_SOURCES = os.O: dtrace.o $(am_libos_la_OBJECTS) $(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o endif xorg-server-1.17.1/os/strcasecmp.c0000664000175100017510000000460512274325511013751 00000000000000/* * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "dix.h" #ifndef HAVE_STRCASECMP int xstrcasecmp(const char *str1, const char *str2) { const u_char *us1 = (const u_char *) str1, *us2 = (const u_char *) str2; while (tolower(*us1) == tolower(*us2)) { if (*us1++ == '\0') return 0; us2++; } return (tolower(*us1) - tolower(*us2)); } #endif #ifndef HAVE_STRNCASECMP int xstrncasecmp(const char *s1, const char *s2, size_t n) { if (n != 0) { const u_char *us1 = (const u_char *) s1, *us2 = (const u_char *) s2; do { if (tolower(*us1) != tolower(*us2++)) return (tolower(*us1) - tolower(*--us2)); if (*us1++ == '\0') break; } while (--n != 0); } return 0; } #endif xorg-server-1.17.1/os/auth.c0000664000175100017510000002102112274325511012535 00000000000000/* Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * authorization hooks for the server * Author: Keith Packard, MIT X Consortium */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "misc.h" #include "osdep.h" #include "dixstruct.h" #include #include #ifdef WIN32 #include #endif struct protocol { unsigned short name_length; const char *name; AuthAddCFunc Add; /* new authorization data */ AuthCheckFunc Check; /* verify client authorization data */ AuthRstCFunc Reset; /* delete all authorization data entries */ AuthToIDFunc ToID; /* convert cookie to ID */ AuthFromIDFunc FromID; /* convert ID to cookie */ AuthRemCFunc Remove; /* remove a specific cookie */ #ifdef XCSECURITY AuthGenCFunc Generate; #endif }; static struct protocol protocols[] = { {(unsigned short) 18, "MIT-MAGIC-COOKIE-1", MitAddCookie, MitCheckCookie, MitResetCookie, MitToID, MitFromID, MitRemoveCookie, #ifdef XCSECURITY MitGenerateCookie #endif }, #ifdef HASXDMAUTH {(unsigned short) 19, "XDM-AUTHORIZATION-1", XdmAddCookie, XdmCheckCookie, XdmResetCookie, XdmToID, XdmFromID, XdmRemoveCookie, #ifdef XCSECURITY NULL #endif }, #endif #ifdef SECURE_RPC {(unsigned short) 9, "SUN-DES-1", SecureRPCAdd, SecureRPCCheck, SecureRPCReset, SecureRPCToID, SecureRPCFromID, SecureRPCRemove, #ifdef XCSECURITY NULL #endif }, #endif }; #define NUM_AUTHORIZATION (sizeof (protocols) /\ sizeof (struct protocol)) /* * Initialize all classes of authorization by reading the * specified authorization file */ static const char *authorization_file = NULL; static Bool ShouldLoadAuth = TRUE; void InitAuthorization(const char *file_name) { authorization_file = file_name; } static int LoadAuthorization(void) { FILE *f; Xauth *auth; int i; int count = 0; ShouldLoadAuth = FALSE; if (!authorization_file) return 0; f = Fopen(authorization_file, "r"); if (!f) return -1; while ((auth = XauReadAuth(f)) != 0) { for (i = 0; i < NUM_AUTHORIZATION; i++) { if (protocols[i].name_length == auth->name_length && memcmp(protocols[i].name, auth->name, (int) auth->name_length) == 0 && protocols[i].Add) { ++count; (*protocols[i].Add) (auth->data_length, auth->data, FakeClientID(0)); } } XauDisposeAuth(auth); } Fclose(f); return count; } #ifdef XDMCP /* * XdmcpInit calls this function to discover all authorization * schemes supported by the display */ void RegisterAuthorizations(void) { int i; for (i = 0; i < NUM_AUTHORIZATION; i++) XdmcpRegisterAuthorization(protocols[i].name, (int) protocols[i].name_length); } #endif XID CheckAuthorization(unsigned int name_length, const char *name, unsigned int data_length, const char *data, ClientPtr client, const char **reason) { /* failure message. NULL for default msg */ int i; struct stat buf; static time_t lastmod = 0; static Bool loaded = FALSE; if (!authorization_file || stat(authorization_file, &buf)) { if (lastmod != 0) { lastmod = 0; ShouldLoadAuth = TRUE; /* stat lost, so force reload */ } } else if (buf.st_mtime > lastmod) { lastmod = buf.st_mtime; ShouldLoadAuth = TRUE; } if (ShouldLoadAuth) { int loadauth = LoadAuthorization(); /* * If the authorization file has at least one entry for this server, * disable local host access. (loadauth > 0) * * If there are zero entries (either initially or when the * authorization file is later reloaded), or if a valid * authorization file was never loaded, enable local host access. * (loadauth == 0 || !loaded) * * If the authorization file was loaded initially (with valid * entries for this server), and reloading it later fails, don't * change anything. (loadauth == -1 && loaded) */ if (loadauth > 0) { DisableLocalHost(); /* got at least one */ loaded = TRUE; } else if (loadauth == 0 || !loaded) EnableLocalHost(); } if (name_length) { for (i = 0; i < NUM_AUTHORIZATION; i++) { if (protocols[i].name_length == name_length && memcmp(protocols[i].name, name, (int) name_length) == 0) { return (*protocols[i].Check) (data_length, data, client, reason); } *reason = "Protocol not supported by server\n"; } } else *reason = "No protocol specified\n"; return (XID) ~0L; } void ResetAuthorization(void) { int i; for (i = 0; i < NUM_AUTHORIZATION; i++) if (protocols[i].Reset) (*protocols[i].Reset) (); ShouldLoadAuth = TRUE; } int AuthorizationFromID(XID id, unsigned short *name_lenp, const char **namep, unsigned short *data_lenp, char **datap) { int i; for (i = 0; i < NUM_AUTHORIZATION; i++) { if (protocols[i].FromID && (*protocols[i].FromID) (id, data_lenp, datap)) { *name_lenp = protocols[i].name_length; *namep = protocols[i].name; return 1; } } return 0; } int RemoveAuthorization(unsigned short name_length, const char *name, unsigned short data_length, const char *data) { int i; for (i = 0; i < NUM_AUTHORIZATION; i++) { if (protocols[i].name_length == name_length && memcmp(protocols[i].name, name, (int) name_length) == 0 && protocols[i].Remove) { return (*protocols[i].Remove) (data_length, data); } } return 0; } int AddAuthorization(unsigned name_length, const char *name, unsigned data_length, char *data) { int i; for (i = 0; i < NUM_AUTHORIZATION; i++) { if (protocols[i].name_length == name_length && memcmp(protocols[i].name, name, (int) name_length) == 0 && protocols[i].Add) { return (*protocols[i].Add) (data_length, data, FakeClientID(0)); } } return 0; } #ifdef XCSECURITY XID GenerateAuthorization(unsigned name_length, const char *name, unsigned data_length, const char *data, unsigned *data_length_return, char **data_return) { int i; for (i = 0; i < NUM_AUTHORIZATION; i++) { if (protocols[i].name_length == name_length && memcmp(protocols[i].name, name, (int) name_length) == 0 && protocols[i].Generate) { return (*protocols[i].Generate) (data_length, data, FakeClientID(0), data_length_return, data_return); } } return -1; } void GenerateRandomData(int len, char *buf) { int fd; fd = open("/dev/urandom", O_RDONLY); read(fd, buf, len); close(fd); } #endif /* XCSECURITY */ xorg-server-1.17.1/os/mitauth.c0000664000175100017510000001033412274325511013254 00000000000000/* Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * MIT-MAGIC-COOKIE-1 authorization scheme * Author: Keith Packard, MIT X Consortium */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "os.h" #include "osdep.h" #include "dixstruct.h" static struct auth { struct auth *next; unsigned short len; char *data; XID id; } *mit_auth; int MitAddCookie(unsigned short data_length, const char *data, XID id) { struct auth *new; new = malloc(sizeof(struct auth)); if (!new) return 0; new->data = malloc((unsigned) data_length); if (!new->data) { free(new); return 0; } new->next = mit_auth; mit_auth = new; memmove(new->data, data, (int) data_length); new->len = data_length; new->id = id; return 1; } XID MitCheckCookie(unsigned short data_length, const char *data, ClientPtr client, const char **reason) { struct auth *auth; for (auth = mit_auth; auth; auth = auth->next) { if (data_length == auth->len && memcmp(data, auth->data, (int) data_length) == 0) return auth->id; } *reason = "Invalid MIT-MAGIC-COOKIE-1 key"; return (XID) -1; } int MitResetCookie(void) { struct auth *auth, *next; for (auth = mit_auth; auth; auth = next) { next = auth->next; free(auth->data); free(auth); } mit_auth = 0; return 0; } XID MitToID(unsigned short data_length, char *data) { struct auth *auth; for (auth = mit_auth; auth; auth = auth->next) { if (data_length == auth->len && memcmp(data, auth->data, data_length) == 0) return auth->id; } return (XID) -1; } int MitFromID(XID id, unsigned short *data_lenp, char **datap) { struct auth *auth; for (auth = mit_auth; auth; auth = auth->next) { if (id == auth->id) { *data_lenp = auth->len; *datap = auth->data; return 1; } } return 0; } int MitRemoveCookie(unsigned short data_length, const char *data) { struct auth *auth, *prev; prev = 0; for (auth = mit_auth; auth; prev = auth, auth = auth->next) { if (data_length == auth->len && memcmp(data, auth->data, data_length) == 0) { if (prev) prev->next = auth->next; else mit_auth = auth->next; free(auth->data); free(auth); return 1; } } return 0; } #ifdef XCSECURITY static char cookie[16]; /* 128 bits */ XID MitGenerateCookie(unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return) { int i = 0; int status; while (data_length--) { cookie[i++] += *data++; if (i >= sizeof(cookie)) i = 0; } GenerateRandomData(sizeof(cookie), cookie); status = MitAddCookie(sizeof(cookie), cookie, id); if (!status) { id = -1; } else { *data_return = cookie; *data_length_return = sizeof(cookie); } return id; } #endif /* XCSECURITY */ xorg-server-1.17.1/os/client.c0000664000175100017510000002770512366220413013066 00000000000000/* * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All * rights reserved. * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * 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. */ /** * @file * * This file contains functionality for identifying clients by various * means. The primary purpose of identification is to simply aid in * finding out which clients are using X server and how they are using * it. For example, it's often necessary to monitor what requests * clients are executing (to spot bad behaviour) and how they are * allocating resources in X server (to spot excessive resource * usage). * * This framework automatically allocates information, that can be * used for client identification, when a client connects to the * server. The information is freed when the client disconnects. The * allocated information is just a collection of various IDs, such as * PID and process name for local clients, that are likely to be * useful in analyzing X server usage. * * Users of the framework can query ID information about clients at * any time. To avoid repeated polling of IDs the users can also * subscribe for notifications about the availability of ID * information. IDs have been allocated before ClientStateCallback is * called with ClientStateInitial state. Similarly the IDs will be * released after ClientStateCallback is called with ClientStateGone * state. * * Author: Rami Ylimäki */ #include #include #include #include "client.h" #include "os.h" #include "dixstruct.h" #ifdef __sun #include #include #endif #ifdef __OpenBSD__ #include #include #include #include #include #endif /** * Try to determine a PID for a client from its connection * information. This should be called only once when new client has * connected, use GetClientPid to determine the PID at other times. * * @param[in] client Connection linked to some process. * * @return PID of the client. Error (-1) if PID can't be determined * for the client. * * @see GetClientPid */ pid_t DetermineClientPid(struct _Client * client) { LocalClientCredRec *lcc = NULL; pid_t pid = -1; if (client == NullClient) return pid; if (client == serverClient) return getpid(); if (GetLocalClientCreds(client, &lcc) != -1) { if (lcc->fieldsSet & LCC_PID_SET) pid = lcc->pid; FreeLocalClientCreds(lcc); } return pid; } /** * Try to determine a command line string for a client based on its * PID. Note that mapping PID to a command hasn't been implemented for * some operating systems. This should be called only once when a new * client has connected, use GetClientCmdName/Args to determine the * string at other times. * * @param[in] pid Process ID of a client. * @param[out] cmdname Client process name without arguments. You must * release this by calling free. On error NULL is * returned. Pass NULL if you aren't interested in * this value. * @param[out] cmdargs Arguments to client process. Useful for * identifying a client that is executed from a * launcher program. You must release this by * calling free. On error NULL is returned. Pass * NULL if you aren't interested in this value. * * @see GetClientCmdName/Args */ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs) { char path[PATH_MAX + 1]; int totsize = 0; int fd = 0; if (cmdname) *cmdname = NULL; if (cmdargs) *cmdargs = NULL; if (pid == -1) return; #ifdef __sun /* Solaris */ /* Solaris does not support /proc/pid/cmdline, but makes information * similar to what ps shows available in a binary structure in the * /proc/pid/psinfo file. */ if (snprintf(path, sizeof(path), "/proc/%d/psinfo", pid) < 0) return; fd = open(path, O_RDONLY); if (fd < 0) { ErrorF("Failed to open %s: %s\n", path, strerror(errno)); return; } else { psinfo_t psinfo = { 0 }; char *sp; totsize = read(fd, &psinfo, sizeof(psinfo_t)); close(fd); if (totsize <= 0) return; /* pr_psargs is the first PRARGSZ (80) characters of the command * line string - assume up to the first space is the command name, * since it's not delimited. While there is also pr_fname, that's * more limited, giving only the first 16 chars of the basename of * the file that was exec'ed, thus cutting off many long gnome * command names, or returning "isapython2.6" for all python scripts. */ psinfo.pr_psargs[PRARGSZ - 1] = '\0'; sp = strchr(psinfo.pr_psargs, ' '); if (sp) *sp++ = '\0'; if (cmdname) *cmdname = strdup(psinfo.pr_psargs); if (cmdargs && sp) *cmdargs = strdup(sp); } #elif defined(__OpenBSD__) /* on OpenBSD use kvm_getargv() */ { kvm_t *kd; char errbuf[_POSIX2_LINE_MAX]; char **argv; struct kinfo_proc *kp; size_t len = 0; int i, n; kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, errbuf); if (kd == NULL) return; kp = kvm_getprocs(kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), &n); if (n != 1) return; argv = kvm_getargv(kd, kp, 0); *cmdname = strdup(argv[0]); i = 1; while (argv[i] != NULL) { len += strlen(argv[i]) + 1; i++; } *cmdargs = calloc(1, len); i = 1; while (argv[i] != NULL) { strlcat(*cmdargs, argv[i], len); strlcat(*cmdargs, " ", len); i++; } kvm_close(kd); } #else /* Linux using /proc/pid/cmdline */ /* Check if /proc/pid/cmdline exists. It's not supported on all * operating systems. */ if (snprintf(path, sizeof(path), "/proc/%d/cmdline", pid) < 0) return; fd = open(path, O_RDONLY); if (fd < 0) return; /* Read the contents of /proc/pid/cmdline. It should contain the * process name and arguments. */ totsize = read(fd, path, sizeof(path)); close(fd); if (totsize <= 0) return; path[totsize - 1] = '\0'; /* Contruct the process name without arguments. */ if (cmdname) { *cmdname = strdup(path); } /* Construct the arguments for client process. */ if (cmdargs) { int cmdsize = strlen(path) + 1; int argsize = totsize - cmdsize; char *args = NULL; if (argsize > 0) args = malloc(argsize); if (args) { int i = 0; for (i = 0; i < (argsize - 1); ++i) { const char c = path[cmdsize + i]; args[i] = (c == '\0') ? ' ' : c; } args[argsize - 1] = '\0'; *cmdargs = args; } } #endif } /** * Called when a new client connects. Allocates client ID information. * * @param[in] client Recently connected client. */ void ReserveClientIds(struct _Client *client) { #ifdef CLIENTIDS if (client == NullClient) return; assert(!client->clientIds); client->clientIds = calloc(1, sizeof(ClientIdRec)); if (!client->clientIds) return; client->clientIds->pid = DetermineClientPid(client); if (client->clientIds->pid != -1) DetermineClientCmd(client->clientIds->pid, &client->clientIds->cmdname, &client->clientIds->cmdargs); DebugF("client(%lx): Reserved pid(%d).\n", (unsigned long) client->clientAsMask, client->clientIds->pid); DebugF("client(%lx): Reserved cmdname(%s) and cmdargs(%s).\n", (unsigned long) client->clientAsMask, client->clientIds->cmdname ? client->clientIds->cmdname : "NULL", client->clientIds->cmdargs ? client->clientIds->cmdargs : "NULL"); #endif /* CLIENTIDS */ } /** * Called when an existing client disconnects. Frees client ID * information. * * @param[in] client Recently disconnected client. */ void ReleaseClientIds(struct _Client *client) { #ifdef CLIENTIDS if (client == NullClient) return; if (!client->clientIds) return; DebugF("client(%lx): Released pid(%d).\n", (unsigned long) client->clientAsMask, client->clientIds->pid); DebugF("client(%lx): Released cmdline(%s) and cmdargs(%s).\n", (unsigned long) client->clientAsMask, client->clientIds->cmdname ? client->clientIds->cmdname : "NULL", client->clientIds->cmdargs ? client->clientIds->cmdargs : "NULL"); free((void *) client->clientIds->cmdname); /* const char * */ free((void *) client->clientIds->cmdargs); /* const char * */ free(client->clientIds); client->clientIds = NULL; #endif /* CLIENTIDS */ } /** * Get cached PID of a client. * * param[in] client Client whose PID has been already cached. * * @return Cached client PID. Error (-1) if called: * - before ClientStateInitial client state notification * - after ClientStateGone client state notification * - for remote clients * * @see DetermineClientPid */ pid_t GetClientPid(struct _Client *client) { if (client == NullClient) return -1; if (!client->clientIds) return -1; return client->clientIds->pid; } /** * Get cached command name string of a client. * * param[in] client Client whose command line string has been already * cached. * * @return Cached client command name. Error (NULL) if called: * - before ClientStateInitial client state notification * - after ClientStateGone client state notification * - for remote clients * - on OS that doesn't support mapping of PID to command line * * @see DetermineClientCmd */ const char * GetClientCmdName(struct _Client *client) { if (client == NullClient) return NULL; if (!client->clientIds) return NULL; return client->clientIds->cmdname; } /** * Get cached command arguments string of a client. * * param[in] client Client whose command line string has been already * cached. * * @return Cached client command arguments. Error (NULL) if called: * - before ClientStateInitial client state notification * - after ClientStateGone client state notification * - for remote clients * - on OS that doesn't support mapping of PID to command line * * @see DetermineClientCmd */ const char * GetClientCmdArgs(struct _Client *client) { if (client == NullClient) return NULL; if (!client->clientIds) return NULL; return client->clientIds->cmdargs; } xorg-server-1.17.1/os/xdmcp.c0000664000175100017510000013450512456571574012741 00000000000000/* * Copyright 1989 Network Computing Devices, Inc., Mountain View, 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 and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of N.C.D. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. N.C.D. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #if !defined(WIN32) #include #include #include #include #endif #include #include #include #include #include "misc.h" #include #include "osdep.h" #include "input.h" #include "dixstruct.h" #include "opaque.h" #include "site.h" #ifdef STREAMSCONN #include #include #include #endif #ifdef XDMCP #undef REQUEST #ifdef XDMCP_NO_IPV6 #undef IPv6 #endif #include #define X_INCLUDE_NETDB_H #include static const char *defaultDisplayClass = COMPILEDDISPLAYCLASS; static int xdmcpSocket, sessionSocket; static xdmcp_states state; #if defined(IPv6) && defined(AF_INET6) static int xdmcpSocket6; static struct sockaddr_storage req_sockaddr; #else static struct sockaddr_in req_sockaddr; #endif static int req_socklen; static CARD32 SessionID; static CARD32 timeOutTime; static int timeOutRtx; static CARD32 defaultKeepaliveDormancy = XDM_DEF_DORMANCY; static CARD32 keepaliveDormancy = XDM_DEF_DORMANCY; static CARD16 DisplayNumber; static xdmcp_states XDM_INIT_STATE = XDM_OFF; #ifdef HASXDMAUTH static char *xdmAuthCookie; #endif static XdmcpBuffer buffer; #if defined(IPv6) && defined(AF_INET6) static struct addrinfo *mgrAddr; static struct addrinfo *mgrAddrFirst; #define SOCKADDR_TYPE struct sockaddr_storage #define SOCKADDR_FAMILY(s) ((struct sockaddr *)&(s))->sa_family #ifdef BSD44SOCKETS #define SOCKLEN_FIELD(s) ((struct sockaddr *)&(s))->sa_len #define SOCKLEN_TYPE unsigned char #else #define SOCKLEN_TYPE unsigned int #endif #else #define SOCKADDR_TYPE struct sockaddr_in #define SOCKADDR_FAMILY(s) (s).sin_family #ifdef BSD44SOCKETS #define SOCKLEN_FIELD(s) (s).sin_len #define SOCKLEN_TYPE unsigned char #else #define SOCKLEN_TYPE size_t #endif #endif static SOCKADDR_TYPE ManagerAddress; static SOCKADDR_TYPE FromAddress; #ifdef SOCKLEN_FIELD #define ManagerAddressLen SOCKLEN_FIELD(ManagerAddress) #define FromAddressLen SOCKLEN_FIELD(FromAddress) #else static SOCKLEN_TYPE ManagerAddressLen, FromAddressLen; #endif #if defined(IPv6) && defined(AF_INET6) static struct multicastinfo { struct multicastinfo *next; struct addrinfo *ai; int hops; } *mcastlist; #endif static void XdmcpAddHost(const struct sockaddr *from, int fromlen, ARRAY8Ptr AuthenticationName, ARRAY8Ptr hostname, ARRAY8Ptr status); static void XdmcpSelectHost(const struct sockaddr *host_sockaddr, int host_len, ARRAY8Ptr AuthenticationName); static void get_xdmcp_sock(void); static void send_query_msg(void); static void recv_willing_msg(struct sockaddr *from, int fromlen, unsigned length); static void send_request_msg(void); static void recv_accept_msg(unsigned length); static void recv_decline_msg(unsigned length); static void send_manage_msg(void); static void recv_refuse_msg(unsigned length); static void recv_failed_msg(unsigned length); static void send_keepalive_msg(void); static void recv_alive_msg(unsigned length ); static void XdmcpFatal(const char *type, ARRAY8Ptr status); static void XdmcpWarning(const char *str); static void get_manager_by_name(int argc, char **argv, int i); static void get_fromaddr_by_name(int argc, char **argv, int i); #if defined(IPv6) && defined(AF_INET6) static int get_mcast_options(int argc, char **argv, int i); #endif static void receive_packet(int socketfd); static void send_packet(void); static void timeout(void); static void restart(void); static void XdmcpBlockHandler(void *data , struct timeval **wt, void *LastSelectMask); static void XdmcpWakeupHandler(void *data, int i, void *LastSelectMask); /* * Register the Manufacturer display ID */ static ARRAY8 ManufacturerDisplayID; static void XdmcpRegisterManufacturerDisplayID(const char *name, int length) { int i; XdmcpDisposeARRAY8(&ManufacturerDisplayID); if (!XdmcpAllocARRAY8(&ManufacturerDisplayID, length)) return; for (i = 0; i < length; i++) ManufacturerDisplayID.data[i] = (CARD8) name[i]; } static unsigned short xdm_udp_port = XDM_UDP_PORT; static Bool OneSession = FALSE; static const char *xdm_from = NULL; void XdmcpUseMsg(void) { ErrorF("-query host-name contact named host for XDMCP\n"); ErrorF("-broadcast broadcast for XDMCP\n"); #if defined(IPv6) && defined(AF_INET6) ErrorF("-multicast [addr [hops]] IPv6 multicast for XDMCP\n"); #endif ErrorF("-indirect host-name contact named host for indirect XDMCP\n"); ErrorF("-port port-num UDP port number to send messages to\n"); ErrorF ("-from local-address specify the local address to connect from\n"); ErrorF("-once Terminate server after one session\n"); ErrorF("-class display-class specify display class to send in manage\n"); #ifdef HASXDMAUTH ErrorF("-cookie xdm-auth-bits specify the magic cookie for XDMCP\n"); #endif ErrorF("-displayID display-id manufacturer display ID for request\n"); } int XdmcpOptions(int argc, char **argv, int i) { if (strcmp(argv[i], "-query") == 0) { get_manager_by_name(argc, argv, i++); XDM_INIT_STATE = XDM_QUERY; AccessUsingXdmcp(); return i + 1; } if (strcmp(argv[i], "-broadcast") == 0) { XDM_INIT_STATE = XDM_BROADCAST; AccessUsingXdmcp(); return i + 1; } #if defined(IPv6) && defined(AF_INET6) if (strcmp(argv[i], "-multicast") == 0) { i = get_mcast_options(argc, argv, ++i); XDM_INIT_STATE = XDM_MULTICAST; AccessUsingXdmcp(); return i + 1; } #endif if (strcmp(argv[i], "-indirect") == 0) { get_manager_by_name(argc, argv, i++); XDM_INIT_STATE = XDM_INDIRECT; AccessUsingXdmcp(); return i + 1; } if (strcmp(argv[i], "-port") == 0) { if (++i == argc) { FatalError("Xserver: missing port number in command line\n"); } xdm_udp_port = (unsigned short) atoi(argv[i]); return i + 1; } if (strcmp(argv[i], "-from") == 0) { get_fromaddr_by_name(argc, argv, ++i); return i + 1; } if (strcmp(argv[i], "-once") == 0) { OneSession = TRUE; return i + 1; } if (strcmp(argv[i], "-class") == 0) { if (++i == argc) { FatalError("Xserver: missing class name in command line\n"); } defaultDisplayClass = argv[i]; return i + 1; } #ifdef HASXDMAUTH if (strcmp(argv[i], "-cookie") == 0) { if (++i == argc) { FatalError("Xserver: missing cookie data in command line\n"); } xdmAuthCookie = argv[i]; return i + 1; } #endif if (strcmp(argv[i], "-displayID") == 0) { if (++i == argc) { FatalError("Xserver: missing displayID in command line\n"); } XdmcpRegisterManufacturerDisplayID(argv[i], strlen(argv[i])); return i + 1; } return i; } /* * This section is a collection of routines for * registering server-specific data with the XDMCP * state machine. */ /* * Save all broadcast addresses away so BroadcastQuery * packets get sent everywhere */ #define MAX_BROADCAST 10 /* This stays sockaddr_in since IPv6 doesn't support broadcast */ static struct sockaddr_in BroadcastAddresses[MAX_BROADCAST]; static int NumBroadcastAddresses; void XdmcpRegisterBroadcastAddress(const struct sockaddr_in *addr) { struct sockaddr_in *bcast; if (NumBroadcastAddresses >= MAX_BROADCAST) return; bcast = &BroadcastAddresses[NumBroadcastAddresses++]; memset(bcast, 0, sizeof(struct sockaddr_in)); #ifdef BSD44SOCKETS bcast->sin_len = addr->sin_len; #endif bcast->sin_family = addr->sin_family; bcast->sin_port = htons(xdm_udp_port); bcast->sin_addr = addr->sin_addr; } /* * Each authentication type is registered here; Validator * will be called to check all access attempts using * the specified authentication type */ static ARRAYofARRAY8 AuthenticationNames, AuthenticationDatas; typedef struct _AuthenticationFuncs { ValidatorFunc Validator; GeneratorFunc Generator; AddAuthorFunc AddAuth; } AuthenticationFuncsRec, *AuthenticationFuncsPtr; static AuthenticationFuncsPtr AuthenticationFuncsList; void XdmcpRegisterAuthentication(const char *name, int namelen, const char *data, int datalen, ValidatorFunc Validator, GeneratorFunc Generator, AddAuthorFunc AddAuth) { int i; ARRAY8 AuthenticationName, AuthenticationData; static AuthenticationFuncsPtr newFuncs; if (!XdmcpAllocARRAY8(&AuthenticationName, namelen)) return; if (!XdmcpAllocARRAY8(&AuthenticationData, datalen)) { XdmcpDisposeARRAY8(&AuthenticationName); return; } for (i = 0; i < namelen; i++) AuthenticationName.data[i] = name[i]; for (i = 0; i < datalen; i++) AuthenticationData.data[i] = data[i]; if (!(XdmcpReallocARRAYofARRAY8(&AuthenticationNames, AuthenticationNames.length + 1) && XdmcpReallocARRAYofARRAY8(&AuthenticationDatas, AuthenticationDatas.length + 1) && (newFuncs = malloc((AuthenticationNames.length + 1) * sizeof(AuthenticationFuncsRec))))) { XdmcpDisposeARRAY8(&AuthenticationName); XdmcpDisposeARRAY8(&AuthenticationData); return; } for (i = 0; i < AuthenticationNames.length - 1; i++) newFuncs[i] = AuthenticationFuncsList[i]; newFuncs[AuthenticationNames.length - 1].Validator = Validator; newFuncs[AuthenticationNames.length - 1].Generator = Generator; newFuncs[AuthenticationNames.length - 1].AddAuth = AddAuth; free(AuthenticationFuncsList); AuthenticationFuncsList = newFuncs; AuthenticationNames.data[AuthenticationNames.length - 1] = AuthenticationName; AuthenticationDatas.data[AuthenticationDatas.length - 1] = AuthenticationData; } /* * Select the authentication type to be used; this is * set by the manager of the host to be connected to. */ static ARRAY8 noAuthenticationName = { (CARD16) 0, (CARD8Ptr) 0 }; static ARRAY8 noAuthenticationData = { (CARD16) 0, (CARD8Ptr) 0 }; static ARRAY8Ptr AuthenticationName = &noAuthenticationName; static ARRAY8Ptr AuthenticationData = &noAuthenticationData; static AuthenticationFuncsPtr AuthenticationFuncs; static void XdmcpSetAuthentication(const ARRAY8Ptr name) { int i; for (i = 0; i < AuthenticationNames.length; i++) if (XdmcpARRAY8Equal(&AuthenticationNames.data[i], name)) { AuthenticationName = &AuthenticationNames.data[i]; AuthenticationData = &AuthenticationDatas.data[i]; AuthenticationFuncs = &AuthenticationFuncsList[i]; break; } } /* * Register the host address for the display */ static ARRAY16 ConnectionTypes; static ARRAYofARRAY8 ConnectionAddresses; static long xdmcpGeneration; void XdmcpRegisterConnection(int type, const char *address, int addrlen) { int i; CARD8 *newAddress; if (xdmcpGeneration != serverGeneration) { XdmcpDisposeARRAY16(&ConnectionTypes); XdmcpDisposeARRAYofARRAY8(&ConnectionAddresses); xdmcpGeneration = serverGeneration; } if (xdm_from != NULL) { /* Only register the requested address */ const void *regAddr = address; const void *fromAddr = NULL; int regAddrlen = addrlen; if (addrlen == sizeof(struct in_addr)) { if (SOCKADDR_FAMILY(FromAddress) == AF_INET) { fromAddr = &((struct sockaddr_in *) &FromAddress)->sin_addr; } #if defined(IPv6) && defined(AF_INET6) else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET6) && IN6_IS_ADDR_V4MAPPED(& ((struct sockaddr_in6 *) &FromAddress)->sin6_addr)) { fromAddr = &((struct sockaddr_in6 *) &FromAddress)->sin6_addr. s6_addr[12]; } #endif } #if defined(IPv6) && defined(AF_INET6) else if (addrlen == sizeof(struct in6_addr)) { if (SOCKADDR_FAMILY(FromAddress) == AF_INET6) { fromAddr = &((struct sockaddr_in6 *) &FromAddress)->sin6_addr; } else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET) && IN6_IS_ADDR_V4MAPPED((const struct in6_addr *) address)) { fromAddr = &((struct sockaddr_in *) &FromAddress)->sin_addr; regAddr = &((struct sockaddr_in6 *) &address)->sin6_addr.s6_addr[12]; regAddrlen = sizeof(struct in_addr); } } #endif if (!fromAddr || memcmp(regAddr, fromAddr, regAddrlen) != 0) { return; } } if (ConnectionAddresses.length + 1 == 256) return; newAddress = malloc(addrlen * sizeof(CARD8)); if (!newAddress) return; if (!XdmcpReallocARRAY16(&ConnectionTypes, ConnectionTypes.length + 1)) { free(newAddress); return; } if (!XdmcpReallocARRAYofARRAY8(&ConnectionAddresses, ConnectionAddresses.length + 1)) { free(newAddress); return; } ConnectionTypes.data[ConnectionTypes.length - 1] = (CARD16) type; for (i = 0; i < addrlen; i++) newAddress[i] = address[i]; ConnectionAddresses.data[ConnectionAddresses.length - 1].data = newAddress; ConnectionAddresses.data[ConnectionAddresses.length - 1].length = addrlen; } /* * Register an Authorization Name. XDMCP advertises this list * to the manager. */ static ARRAYofARRAY8 AuthorizationNames; void XdmcpRegisterAuthorizations(void) { XdmcpDisposeARRAYofARRAY8(&AuthorizationNames); RegisterAuthorizations(); } void XdmcpRegisterAuthorization(const char *name, int namelen) { ARRAY8 authName; int i; authName.data = malloc(namelen * sizeof(CARD8)); if (!authName.data) return; if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length + 1)) { free(authName.data); return; } for (i = 0; i < namelen; i++) authName.data[i] = (CARD8) name[i]; authName.length = namelen; AuthorizationNames.data[AuthorizationNames.length - 1] = authName; } /* * Register the DisplayClass string */ static ARRAY8 DisplayClass; static void XdmcpRegisterDisplayClass(const char *name, int length) { int i; XdmcpDisposeARRAY8(&DisplayClass); if (!XdmcpAllocARRAY8(&DisplayClass, length)) return; for (i = 0; i < length; i++) DisplayClass.data[i] = (CARD8) name[i]; } /* * initialize XDMCP; create the socket, compute the display * number, set up the state machine */ void XdmcpInit(void) { state = XDM_INIT_STATE; #ifdef HASXDMAUTH if (xdmAuthCookie) XdmAuthenticationInit(xdmAuthCookie, strlen(xdmAuthCookie)); #endif if (state != XDM_OFF) { XdmcpRegisterAuthorizations(); XdmcpRegisterDisplayClass(defaultDisplayClass, strlen(defaultDisplayClass)); AccessUsingXdmcp(); RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, (void *) 0); timeOutRtx = 0; DisplayNumber = (CARD16) atoi(display); get_xdmcp_sock(); send_packet(); } } void XdmcpReset(void) { state = XDM_INIT_STATE; if (state != XDM_OFF) { RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, (void *) 0); timeOutRtx = 0; send_packet(); } } /* * Called whenever a new connection is created; notices the * first connection and saves it to terminate the session * when it is closed */ void XdmcpOpenDisplay(int sock) { if (state != XDM_AWAIT_MANAGE_RESPONSE) return; state = XDM_RUN_SESSION; sessionSocket = sock; } void XdmcpCloseDisplay(int sock) { if ((state != XDM_RUN_SESSION && state != XDM_AWAIT_ALIVE_RESPONSE) || sessionSocket != sock) return; state = XDM_INIT_STATE; if (OneSession) dispatchException |= DE_TERMINATE; else dispatchException |= DE_RESET; isItTimeToYield = TRUE; } /* * called before going to sleep, this routine * may modify the timeout value about to be sent * to select; in this way XDMCP can do appropriate things * dynamically while starting up */ /*ARGSUSED*/ static void XdmcpBlockHandler(void *data, /* unused */ struct timeval **wt, void *pReadmask) { fd_set *last_select_mask = (fd_set *) pReadmask; CARD32 millisToGo; if (state == XDM_OFF) return; FD_SET(xdmcpSocket, last_select_mask); #if defined(IPv6) && defined(AF_INET6) if (xdmcpSocket6 >= 0) FD_SET(xdmcpSocket6, last_select_mask); #endif if (timeOutTime == 0) return; millisToGo = timeOutTime - GetTimeInMillis(); if ((int) millisToGo < 0) millisToGo = 0; AdjustWaitForDelay(wt, millisToGo); } /* * called after select returns; this routine will * recognise when XDMCP packets await and * process them appropriately */ /*ARGSUSED*/ static void XdmcpWakeupHandler(void *data, /* unused */ int i, void *pReadmask) { fd_set *last_select_mask = (fd_set *) pReadmask; fd_set devicesReadable; if (state == XDM_OFF) return; if (i > 0) { if (FD_ISSET(xdmcpSocket, last_select_mask)) { receive_packet(xdmcpSocket); FD_CLR(xdmcpSocket, last_select_mask); } #if defined(IPv6) && defined(AF_INET6) if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, last_select_mask)) { receive_packet(xdmcpSocket6); FD_CLR(xdmcpSocket6, last_select_mask); } #endif XFD_ANDSET(&devicesReadable, last_select_mask, &EnabledDevices); if (XFD_ANYSET(&devicesReadable)) { if (state == XDM_AWAIT_USER_INPUT) restart(); else if (state == XDM_RUN_SESSION) keepaliveDormancy = defaultKeepaliveDormancy; } if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION) timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; } else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0) { if (state == XDM_RUN_SESSION) { state = XDM_KEEPALIVE; send_packet(); } else timeout(); } } /* * This routine should be called from the routine that drives the * user's host menu when the user selects a host */ static void XdmcpSelectHost(const struct sockaddr *host_sockaddr, int host_len, ARRAY8Ptr auth_name) { state = XDM_START_CONNECTION; memmove(&req_sockaddr, host_sockaddr, host_len); req_socklen = host_len; XdmcpSetAuthentication(auth_name); send_packet(); } /* * !!! this routine should be replaced by a routine that adds * the host to the user's host menu. the current version just * selects the first host to respond with willing message. */ /*ARGSUSED*/ static void XdmcpAddHost(const struct sockaddr *from, int fromlen, ARRAY8Ptr auth_name, ARRAY8Ptr hostname, ARRAY8Ptr status) { XdmcpSelectHost(from, fromlen, auth_name); } /* * A message is queued on the socket; read it and * do the appropriate thing */ static ARRAY8 UnwillingMessage = { (CARD8) 14, (CARD8 *) "Host unwilling" }; static void receive_packet(int socketfd) { #if defined(IPv6) && defined(AF_INET6) struct sockaddr_storage from; #else struct sockaddr_in from; #endif int fromlen = sizeof(from); XdmcpHeader header; /* read message off socket */ if (!XdmcpFill(socketfd, &buffer, (XdmcpNetaddr) &from, &fromlen)) return; /* reset retransmission backoff */ timeOutRtx = 0; if (!XdmcpReadHeader(&buffer, &header)) return; if (header.version != XDM_PROTOCOL_VERSION) return; switch (header.opcode) { case WILLING: recv_willing_msg((struct sockaddr *) &from, fromlen, header.length); break; case UNWILLING: XdmcpFatal("Manager unwilling", &UnwillingMessage); break; case ACCEPT: recv_accept_msg(header.length); break; case DECLINE: recv_decline_msg(header.length); break; case REFUSE: recv_refuse_msg(header.length); break; case FAILED: recv_failed_msg(header.length); break; case ALIVE: recv_alive_msg(header.length); break; } } /* * send the appropriate message given the current state */ static void send_packet(void) { int rtx; switch (state) { case XDM_QUERY: case XDM_BROADCAST: case XDM_INDIRECT: #if defined(IPv6) && defined(AF_INET6) case XDM_MULTICAST: #endif send_query_msg(); break; case XDM_START_CONNECTION: send_request_msg(); break; case XDM_MANAGE: send_manage_msg(); break; case XDM_KEEPALIVE: send_keepalive_msg(); break; default: break; } rtx = (XDM_MIN_RTX << timeOutRtx); if (rtx > XDM_MAX_RTX) rtx = XDM_MAX_RTX; timeOutTime = GetTimeInMillis() + rtx * 1000; } /* * The session is declared dead for some reason; too many * timeouts, or Keepalive failure. */ static void XdmcpDeadSession(const char *reason) { ErrorF("XDM: %s, declaring session dead\n", reason); state = XDM_INIT_STATE; isItTimeToYield = TRUE; dispatchException |= DE_RESET; timeOutTime = 0; timeOutRtx = 0; send_packet(); } /* * Timeout waiting for an XDMCP response. */ static void timeout(void) { timeOutRtx++; if (state == XDM_AWAIT_ALIVE_RESPONSE && timeOutRtx >= XDM_KA_RTX_LIMIT) { XdmcpDeadSession("too many keepalive retransmissions"); return; } else if (timeOutRtx >= XDM_RTX_LIMIT) { /* Quit if "-once" specified, otherwise reset and try again. */ if (OneSession) { dispatchException |= DE_TERMINATE; ErrorF("XDM: too many retransmissions\n"); } else { XdmcpDeadSession("too many retransmissions"); } return; } #if defined(IPv6) && defined(AF_INET6) if (state == XDM_COLLECT_QUERY || state == XDM_COLLECT_INDIRECT_QUERY) { /* Try next address */ for (mgrAddr = mgrAddr->ai_next;; mgrAddr = mgrAddr->ai_next) { if (mgrAddr == NULL) { mgrAddr = mgrAddrFirst; } if (mgrAddr->ai_family == AF_INET || mgrAddr->ai_family == AF_INET6) break; } #ifndef SIN6_LEN ManagerAddressLen = mgrAddr->ai_addrlen; #endif memcpy(&ManagerAddress, mgrAddr->ai_addr, mgrAddr->ai_addrlen); } #endif switch (state) { case XDM_COLLECT_QUERY: state = XDM_QUERY; break; case XDM_COLLECT_BROADCAST_QUERY: state = XDM_BROADCAST; break; #if defined(IPv6) && defined(AF_INET6) case XDM_COLLECT_MULTICAST_QUERY: state = XDM_MULTICAST; break; #endif case XDM_COLLECT_INDIRECT_QUERY: state = XDM_INDIRECT; break; case XDM_AWAIT_REQUEST_RESPONSE: state = XDM_START_CONNECTION; break; case XDM_AWAIT_MANAGE_RESPONSE: state = XDM_MANAGE; break; case XDM_AWAIT_ALIVE_RESPONSE: state = XDM_KEEPALIVE; break; default: break; } send_packet(); } static void restart(void) { state = XDM_INIT_STATE; timeOutRtx = 0; send_packet(); } static int XdmcpCheckAuthentication(ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type) { return (XdmcpARRAY8Equal(Name, AuthenticationName) && (AuthenticationName->length == 0 || (*AuthenticationFuncs->Validator) (AuthenticationData, Data, packet_type))); } static int XdmcpAddAuthorization(ARRAY8Ptr name, ARRAY8Ptr data) { AddAuthorFunc AddAuth; if (AuthenticationFuncs && AuthenticationFuncs->AddAuth) AddAuth = AuthenticationFuncs->AddAuth; else AddAuth = AddAuthorization; return (*AddAuth) ((unsigned short) name->length, (char *) name->data, (unsigned short) data->length, (char *) data->data); } /* * from here to the end of this file are routines private * to the state machine. */ static void get_xdmcp_sock(void) { #ifdef STREAMSCONN struct netconfig *nconf; if ((xdmcpSocket = t_open("/dev/udp", O_RDWR, 0)) < 0) { XdmcpWarning("t_open() of /dev/udp failed"); return; } if (t_bind(xdmcpSocket, NULL, NULL) < 0) { XdmcpWarning("UDP socket creation failed"); t_error("t_bind(xdmcpSocket) failed"); t_close(xdmcpSocket); return; } /* * This part of the code looks contrived. It will actually fit in nicely * when the CLTS part of Xtrans is implemented. */ if ((nconf = getnetconfigent("udp")) == NULL) { XdmcpWarning("UDP socket creation failed: getnetconfigent()"); t_unbind(xdmcpSocket); t_close(xdmcpSocket); return; } if (netdir_options(nconf, ND_SET_BROADCAST, xdmcpSocket, NULL)) { XdmcpWarning("UDP set broadcast option failed: netdir_options()"); freenetconfigent(nconf); t_unbind(xdmcpSocket); t_close(xdmcpSocket); return; } freenetconfigent(nconf); #else int soopts = 1; #if defined(IPv6) && defined(AF_INET6) if ((xdmcpSocket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) XdmcpWarning("INET6 UDP socket creation failed"); #endif if ((xdmcpSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) XdmcpWarning("UDP socket creation failed"); #ifdef SO_BROADCAST else if (setsockopt(xdmcpSocket, SOL_SOCKET, SO_BROADCAST, (char *) &soopts, sizeof(soopts)) < 0) XdmcpWarning("UDP set broadcast socket-option failed"); #endif /* SO_BROADCAST */ if (xdmcpSocket >= 0 && xdm_from != NULL) { if (bind(xdmcpSocket, (struct sockaddr *) &FromAddress, FromAddressLen) < 0) { FatalError("Xserver: failed to bind to -from address: %s\n", xdm_from); } } #endif /* STREAMSCONN */ } static void send_query_msg(void) { XdmcpHeader header; Bool broadcast = FALSE; #if defined(IPv6) && defined(AF_INET6) Bool multicast = FALSE; #endif int i; int socketfd = xdmcpSocket; header.version = XDM_PROTOCOL_VERSION; switch (state) { case XDM_QUERY: header.opcode = (CARD16) QUERY; state = XDM_COLLECT_QUERY; break; case XDM_BROADCAST: header.opcode = (CARD16) BROADCAST_QUERY; state = XDM_COLLECT_BROADCAST_QUERY; broadcast = TRUE; break; #if defined(IPv6) && defined(AF_INET6) case XDM_MULTICAST: header.opcode = (CARD16) BROADCAST_QUERY; state = XDM_COLLECT_MULTICAST_QUERY; multicast = TRUE; break; #endif case XDM_INDIRECT: header.opcode = (CARD16) INDIRECT_QUERY; state = XDM_COLLECT_INDIRECT_QUERY; break; default: break; } header.length = 1; for (i = 0; i < AuthenticationNames.length; i++) header.length += 2 + AuthenticationNames.data[i].length; XdmcpWriteHeader(&buffer, &header); XdmcpWriteARRAYofARRAY8(&buffer, &AuthenticationNames); if (broadcast) { for (i = 0; i < NumBroadcastAddresses; i++) XdmcpFlush(xdmcpSocket, &buffer, (XdmcpNetaddr) &BroadcastAddresses[i], sizeof(struct sockaddr_in)); } #if defined(IPv6) && defined(AF_INET6) else if (multicast) { struct multicastinfo *mcl; struct addrinfo *ai; for (mcl = mcastlist; mcl != NULL; mcl = mcl->next) { for (ai = mcl->ai; ai != NULL; ai = ai->ai_next) { if (ai->ai_family == AF_INET) { unsigned char hopflag = (unsigned char) mcl->hops; socketfd = xdmcpSocket; setsockopt(socketfd, IPPROTO_IP, IP_MULTICAST_TTL, &hopflag, sizeof(hopflag)); } else if (ai->ai_family == AF_INET6) { int hopflag6 = mcl->hops; socketfd = xdmcpSocket6; setsockopt(socketfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &hopflag6, sizeof(hopflag6)); } else { continue; } XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) ai->ai_addr, ai->ai_addrlen); break; } } } #endif else { #if defined(IPv6) && defined(AF_INET6) if (SOCKADDR_FAMILY(ManagerAddress) == AF_INET6) socketfd = xdmcpSocket6; #endif XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) &ManagerAddress, ManagerAddressLen); } } static void recv_willing_msg(struct sockaddr *from, int fromlen, unsigned length) { ARRAY8 authenticationName; ARRAY8 hostname; ARRAY8 status; authenticationName.data = 0; hostname.data = 0; status.data = 0; if (XdmcpReadARRAY8(&buffer, &authenticationName) && XdmcpReadARRAY8(&buffer, &hostname) && XdmcpReadARRAY8(&buffer, &status)) { if (length == 6 + authenticationName.length + hostname.length + status.length) { switch (state) { case XDM_COLLECT_QUERY: XdmcpSelectHost(from, fromlen, &authenticationName); break; case XDM_COLLECT_BROADCAST_QUERY: #if defined(IPv6) && defined(AF_INET6) case XDM_COLLECT_MULTICAST_QUERY: #endif case XDM_COLLECT_INDIRECT_QUERY: XdmcpAddHost(from, fromlen, &authenticationName, &hostname, &status); break; default: break; } } } XdmcpDisposeARRAY8(&authenticationName); XdmcpDisposeARRAY8(&hostname); XdmcpDisposeARRAY8(&status); } static void send_request_msg(void) { XdmcpHeader header; int length; int i; CARD16 XdmcpConnectionType; ARRAY8 authenticationData; int socketfd = xdmcpSocket; switch (SOCKADDR_FAMILY(ManagerAddress)) { case AF_INET: XdmcpConnectionType = FamilyInternet; break; #if defined(IPv6) && defined(AF_INET6) case AF_INET6: XdmcpConnectionType = FamilyInternet6; break; #endif default: XdmcpConnectionType = 0xffff; break; } header.version = XDM_PROTOCOL_VERSION; header.opcode = (CARD16) REQUEST; length = 2; /* display number */ length += 1 + 2 * ConnectionTypes.length; /* connection types */ length += 1; /* connection addresses */ for (i = 0; i < ConnectionAddresses.length; i++) length += 2 + ConnectionAddresses.data[i].length; authenticationData.length = 0; authenticationData.data = 0; if (AuthenticationFuncs) { (*AuthenticationFuncs->Generator) (AuthenticationData, &authenticationData, REQUEST); } length += 2 + AuthenticationName->length; /* authentication name */ length += 2 + authenticationData.length; /* authentication data */ length += 1; /* authorization names */ for (i = 0; i < AuthorizationNames.length; i++) length += 2 + AuthorizationNames.data[i].length; length += 2 + ManufacturerDisplayID.length; /* display ID */ header.length = length; if (!XdmcpWriteHeader(&buffer, &header)) { XdmcpDisposeARRAY8(&authenticationData); return; } XdmcpWriteCARD16(&buffer, DisplayNumber); XdmcpWriteCARD8(&buffer, ConnectionTypes.length); /* The connection array is send reordered, so that connections of */ /* the same address type as the XDMCP manager connection are send */ /* first. This works around a bug in xdm. mario@klebsch.de */ for (i = 0; i < (int) ConnectionTypes.length; i++) if (ConnectionTypes.data[i] == XdmcpConnectionType) XdmcpWriteCARD16(&buffer, ConnectionTypes.data[i]); for (i = 0; i < (int) ConnectionTypes.length; i++) if (ConnectionTypes.data[i] != XdmcpConnectionType) XdmcpWriteCARD16(&buffer, ConnectionTypes.data[i]); XdmcpWriteCARD8(&buffer, ConnectionAddresses.length); for (i = 0; i < (int) ConnectionAddresses.length; i++) if ((i < ConnectionTypes.length) && (ConnectionTypes.data[i] == XdmcpConnectionType)) XdmcpWriteARRAY8(&buffer, &ConnectionAddresses.data[i]); for (i = 0; i < (int) ConnectionAddresses.length; i++) if ((i >= ConnectionTypes.length) || (ConnectionTypes.data[i] != XdmcpConnectionType)) XdmcpWriteARRAY8(&buffer, &ConnectionAddresses.data[i]); XdmcpWriteARRAY8(&buffer, AuthenticationName); XdmcpWriteARRAY8(&buffer, &authenticationData); XdmcpDisposeARRAY8(&authenticationData); XdmcpWriteARRAYofARRAY8(&buffer, &AuthorizationNames); XdmcpWriteARRAY8(&buffer, &ManufacturerDisplayID); #if defined(IPv6) && defined(AF_INET6) if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) socketfd = xdmcpSocket6; #endif if (XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen)) state = XDM_AWAIT_REQUEST_RESPONSE; } static void recv_accept_msg(unsigned length) { CARD32 AcceptSessionID; ARRAY8 AcceptAuthenticationName, AcceptAuthenticationData; ARRAY8 AcceptAuthorizationName, AcceptAuthorizationData; if (state != XDM_AWAIT_REQUEST_RESPONSE) return; AcceptAuthenticationName.data = 0; AcceptAuthenticationData.data = 0; AcceptAuthorizationName.data = 0; AcceptAuthorizationData.data = 0; if (XdmcpReadCARD32(&buffer, &AcceptSessionID) && XdmcpReadARRAY8(&buffer, &AcceptAuthenticationName) && XdmcpReadARRAY8(&buffer, &AcceptAuthenticationData) && XdmcpReadARRAY8(&buffer, &AcceptAuthorizationName) && XdmcpReadARRAY8(&buffer, &AcceptAuthorizationData)) { if (length == 12 + AcceptAuthenticationName.length + AcceptAuthenticationData.length + AcceptAuthorizationName.length + AcceptAuthorizationData.length) { if (!XdmcpCheckAuthentication(&AcceptAuthenticationName, &AcceptAuthenticationData, ACCEPT)) { XdmcpFatal("Authentication Failure", &AcceptAuthenticationName); } /* permit access control manipulations from this host */ AugmentSelf(&req_sockaddr, req_socklen); /* if the authorization specified in the packet fails * to be acceptable, enable the local addresses */ if (!XdmcpAddAuthorization(&AcceptAuthorizationName, &AcceptAuthorizationData)) { AddLocalHosts(); } SessionID = AcceptSessionID; state = XDM_MANAGE; send_packet(); } } XdmcpDisposeARRAY8(&AcceptAuthenticationName); XdmcpDisposeARRAY8(&AcceptAuthenticationData); XdmcpDisposeARRAY8(&AcceptAuthorizationName); XdmcpDisposeARRAY8(&AcceptAuthorizationData); } static void recv_decline_msg(unsigned length) { ARRAY8 status, DeclineAuthenticationName, DeclineAuthenticationData; status.data = 0; DeclineAuthenticationName.data = 0; DeclineAuthenticationData.data = 0; if (XdmcpReadARRAY8(&buffer, &status) && XdmcpReadARRAY8(&buffer, &DeclineAuthenticationName) && XdmcpReadARRAY8(&buffer, &DeclineAuthenticationData)) { if (length == 6 + status.length + DeclineAuthenticationName.length + DeclineAuthenticationData.length && XdmcpCheckAuthentication(&DeclineAuthenticationName, &DeclineAuthenticationData, DECLINE)) { XdmcpFatal("Session declined", &status); } } XdmcpDisposeARRAY8(&status); XdmcpDisposeARRAY8(&DeclineAuthenticationName); XdmcpDisposeARRAY8(&DeclineAuthenticationData); } static void send_manage_msg(void) { XdmcpHeader header; int socketfd = xdmcpSocket; header.version = XDM_PROTOCOL_VERSION; header.opcode = (CARD16) MANAGE; header.length = 8 + DisplayClass.length; if (!XdmcpWriteHeader(&buffer, &header)) return; XdmcpWriteCARD32(&buffer, SessionID); XdmcpWriteCARD16(&buffer, DisplayNumber); XdmcpWriteARRAY8(&buffer, &DisplayClass); state = XDM_AWAIT_MANAGE_RESPONSE; #if defined(IPv6) && defined(AF_INET6) if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) socketfd = xdmcpSocket6; #endif XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); } static void recv_refuse_msg(unsigned length) { CARD32 RefusedSessionID; if (state != XDM_AWAIT_MANAGE_RESPONSE) return; if (length != 4) return; if (XdmcpReadCARD32(&buffer, &RefusedSessionID)) { if (RefusedSessionID == SessionID) { state = XDM_START_CONNECTION; send_packet(); } } } static void recv_failed_msg(unsigned length) { CARD32 FailedSessionID; ARRAY8 status; if (state != XDM_AWAIT_MANAGE_RESPONSE) return; status.data = 0; if (XdmcpReadCARD32(&buffer, &FailedSessionID) && XdmcpReadARRAY8(&buffer, &status)) { if (length == 6 + status.length && SessionID == FailedSessionID) { XdmcpFatal("Session failed", &status); } } XdmcpDisposeARRAY8(&status); } static void send_keepalive_msg(void) { XdmcpHeader header; int socketfd = xdmcpSocket; header.version = XDM_PROTOCOL_VERSION; header.opcode = (CARD16) KEEPALIVE; header.length = 6; XdmcpWriteHeader(&buffer, &header); XdmcpWriteCARD16(&buffer, DisplayNumber); XdmcpWriteCARD32(&buffer, SessionID); state = XDM_AWAIT_ALIVE_RESPONSE; #if defined(IPv6) && defined(AF_INET6) if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) socketfd = xdmcpSocket6; #endif XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); } static void recv_alive_msg(unsigned length) { CARD8 SessionRunning; CARD32 AliveSessionID; if (state != XDM_AWAIT_ALIVE_RESPONSE) return; if (length != 5) return; if (XdmcpReadCARD8(&buffer, &SessionRunning) && XdmcpReadCARD32(&buffer, &AliveSessionID)) { if (SessionRunning && AliveSessionID == SessionID) { /* backoff dormancy period */ state = XDM_RUN_SESSION; if ((GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds) > keepaliveDormancy * 1000) { keepaliveDormancy <<= 1; if (keepaliveDormancy > XDM_MAX_DORMANCY) keepaliveDormancy = XDM_MAX_DORMANCY; } timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; } else { XdmcpDeadSession("Alive response indicates session dead"); } } } static void XdmcpFatal(const char *type, ARRAY8Ptr status) { FatalError("XDMCP fatal error: %s %*.*s\n", type, status->length, status->length, status->data); } static void XdmcpWarning(const char *str) { ErrorF("XDMCP warning: %s\n", str); } static void get_addr_by_name(const char *argtype, const char *namestr, int port, int socktype, SOCKADDR_TYPE * addr, SOCKLEN_TYPE * addrlen #if defined(IPv6) && defined(AF_INET6) , struct addrinfo **aip, struct addrinfo **aifirstp #endif ) { #if defined(IPv6) && defined(AF_INET6) struct addrinfo *ai; struct addrinfo hints; char portstr[6]; char *pport = portstr; int gaierr; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = socktype; if (port == 0) { pport = NULL; } else if (port > 0 && port < 65535) { snprintf(portstr, sizeof(portstr), "%d", port); } else { FatalError("Xserver: port out of range: %d\n", port); } if (*aifirstp != NULL) { freeaddrinfo(*aifirstp); *aifirstp = NULL; } if ((gaierr = getaddrinfo(namestr, pport, &hints, aifirstp)) == 0) { for (ai = *aifirstp; ai != NULL; ai = ai->ai_next) { if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) break; } if ((ai == NULL) || (ai->ai_addrlen > sizeof(SOCKADDR_TYPE))) { FatalError("Xserver: %s host %s not on supported network type\n", argtype, namestr); } else { *aip = ai; *addrlen = ai->ai_addrlen; memcpy(addr, ai->ai_addr, ai->ai_addrlen); } } else { FatalError("Xserver: %s: %s %s\n", gai_strerror(gaierr), argtype, namestr); } #else struct hostent *hep; #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif #if defined(WIN32) && defined(TCPCONN) _XSERVTransWSAStartup(); #endif if (!(hep = _XGethostbyname(namestr, hparams))) { FatalError("Xserver: %s unknown host: %s\n", argtype, namestr); } if (hep->h_length == sizeof(struct in_addr)) { memmove(&addr->sin_addr, hep->h_addr, hep->h_length); *addrlen = sizeof(struct sockaddr_in); addr->sin_family = AF_INET; addr->sin_port = htons(port); } else { FatalError("Xserver: %s host on strange network %s\n", argtype, namestr); } #endif } static void get_manager_by_name(int argc, char **argv, int i) { if ((i + 1) == argc) { FatalError("Xserver: missing %s host name in command line\n", argv[i]); } get_addr_by_name(argv[i], argv[i + 1], xdm_udp_port, SOCK_DGRAM, &ManagerAddress, &ManagerAddressLen #if defined(IPv6) && defined(AF_INET6) , &mgrAddr, &mgrAddrFirst #endif ); } static void get_fromaddr_by_name(int argc, char **argv, int i) { #if defined(IPv6) && defined(AF_INET6) struct addrinfo *ai = NULL; struct addrinfo *aifirst = NULL; #endif if (i == argc) { FatalError("Xserver: missing -from host name in command line\n"); } get_addr_by_name("-from", argv[i], 0, 0, &FromAddress, &FromAddressLen #if defined(IPv6) && defined(AF_INET6) , &ai, &aifirst #endif ); #if defined(IPv6) && defined(AF_INET6) if (aifirst != NULL) freeaddrinfo(aifirst); #endif xdm_from = argv[i]; } #if defined(IPv6) && defined(AF_INET6) static int get_mcast_options(int argc, char **argv, int i) { const char *address = XDM_DEFAULT_MCAST_ADDR6; int hopcount = 1; struct addrinfo hints; char portstr[6]; int gaierr; struct addrinfo *ai, *firstai; if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) { address = argv[i++]; if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) { hopcount = strtol(argv[i++], NULL, 10); if ((hopcount < 1) || (hopcount > 255)) { FatalError("Xserver: multicast hop count out of range: %d\n", hopcount); } } } if (xdm_udp_port > 0 && xdm_udp_port < 65535) { snprintf(portstr, sizeof(portstr), "%d", xdm_udp_port); } else { FatalError("Xserver: port out of range: %d\n", xdm_udp_port); } memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_DGRAM; if ((gaierr = getaddrinfo(address, portstr, &hints, &firstai)) == 0) { for (ai = firstai; ai != NULL; ai = ai->ai_next) { if (((ai->ai_family == AF_INET) && IN_MULTICAST(((struct sockaddr_in *) ai->ai_addr) ->sin_addr.s_addr)) || ((ai->ai_family == AF_INET6) && IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *) ai->ai_addr) ->sin6_addr))) break; } if (ai == NULL) { FatalError("Xserver: address not supported multicast type %s\n", address); } else { struct multicastinfo *mcastinfo, *mcl; mcastinfo = malloc(sizeof(struct multicastinfo)); mcastinfo->next = NULL; mcastinfo->ai = firstai; mcastinfo->hops = hopcount; if (mcastlist == NULL) { mcastlist = mcastinfo; } else { for (mcl = mcastlist; mcl->next != NULL; mcl = mcl->next) { /* Do nothing - just find end of list */ } mcl->next = mcastinfo; } } } else { FatalError("Xserver: %s: %s\n", gai_strerror(gaierr), address); } return i; } #endif #else static int xdmcp_non_empty; /* avoid complaint by ranlib */ #endif /* XDMCP */ xorg-server-1.17.1/os/connection.c0000664000175100017510000011276112456571574013765 00000000000000/*********************************************************** Copyright 1987, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /***************************************************************** * Stuff to create connections --- OS dependent * * EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets, * CloseDownConnection, CheckConnections, AddEnabledDevice, * RemoveEnabledDevice, OnlyListToOneClient, * ListenToAllClients, * * (WaitForSomething is in its own file) * * In this implementation, a client socket table is not kept. * Instead, what would be the index into the table is just the * file descriptor of the socket. This won't work for if the * socket ids aren't small nums (0 - 2^8) * *****************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN #include #include #include #include #include #include #ifndef WIN32 #include #if defined(TCPCONN) || defined(STREAMSCONN) #include #include #ifdef apollo #ifndef NO_TCP_H #include #endif #else #ifdef CSRG_BASED #include #endif #include #endif #include #endif #include #endif /* WIN32 */ #include "misc.h" /* for typedef of pointer */ #include "osdep.h" #include #include "opaque.h" #include "dixstruct.h" #include "xace.h" #define Pid_t pid_t #ifdef HAVE_GETPEERUCRED #include #include #endif #ifdef XSERVER_DTRACE #include typedef const char *string; #ifndef HAVE_GETPEERUCRED #define zoneid_t int #endif #include "../dix/Xserver-dtrace.h" #endif static int lastfdesc; /* maximum file descriptor */ fd_set WellKnownConnections; /* Listener mask */ fd_set EnabledDevices; /* mask for input devices that are on */ fd_set AllSockets; /* select on this */ fd_set AllClients; /* available clients */ fd_set LastSelectMask; /* mask returned from last select call */ fd_set ClientsWithInput; /* clients with FULL requests in buffer */ fd_set ClientsWriteBlocked; /* clients who cannot receive output */ fd_set OutputPending; /* clients with reply/event data ready to go */ int MaxClients = 0; Bool NewOutputPending; /* not yet attempted to write some new output */ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ Bool NoListenAll; /* Don't establish any listening sockets */ 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; static Bool debug_conns = FALSE; fd_set IgnoredClientsWithInput; static fd_set GrabImperviousClients; static fd_set SavedAllClients; static fd_set SavedAllSockets; static fd_set SavedClientsWithInput; int GrabInProgress = 0; #if !defined(WIN32) int *ConnectionTranslation = NULL; #else /* * On NT fds are not between 0 and MAXSOCKS, they are unrelated, and there is * not even a known maximum value, so use something quite arbitrary for now. * Do storage is a hash table of size 256. Collisions are handled in a linked * list. */ #undef MAXSOCKS #define MAXSOCKS 500 #undef MAXSELECT #define MAXSELECT 500 struct _ct_node { struct _ct_node *next; int key; int value; }; struct _ct_node *ct_head[256]; void InitConnectionTranslation(void) { memset(ct_head, 0, sizeof(ct_head)); } int GetConnectionTranslation(int conn) { struct _ct_node *node = ct_head[conn & 0xff]; while (node != NULL) { if (node->key == conn) return node->value; node = node->next; } return 0; } void SetConnectionTranslation(int conn, int client) { struct _ct_node **node = ct_head + (conn & 0xff); if (client == 0) { /* remove entry */ while (*node != NULL) { if ((*node)->key == conn) { struct _ct_node *temp = *node; *node = (*node)->next; free(temp); return; } node = &((*node)->next); } return; } else { while (*node != NULL) { if ((*node)->key == conn) { (*node)->value = client; return; } node = &((*node)->next); } *node = malloc(sizeof(struct _ct_node)); (*node)->next = NULL; (*node)->key = conn; (*node)->value = client; return; } } void ClearConnectionTranslation(void) { unsigned i; for (i = 0; i < 256; i++) { struct _ct_node *node = ct_head[i]; while (node != NULL) { struct _ct_node *temp = node; node = node->next; free(temp); } } } #endif static XtransConnInfo *ListenTransConns = NULL; static int *ListenTransFds = NULL; static int ListenTransCount; static void ErrorConnMax(XtransConnInfo /* trans_conn */ ); static XtransConnInfo lookup_trans_conn(int fd) { if (ListenTransFds) { int i; for (i = 0; i < ListenTransCount; i++) if (ListenTransFds[i] == fd) return ListenTransConns[i]; } return NULL; } /* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */ void InitConnectionLimits(void) { lastfdesc = -1; #ifndef __CYGWIN__ #if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) lastfdesc = sysconf(_SC_OPEN_MAX) - 1; #endif #ifdef HAVE_GETDTABLESIZE if (lastfdesc < 0) lastfdesc = getdtablesize() - 1; #endif #ifdef _NFILE if (lastfdesc < 0) lastfdesc = _NFILE - 1; #endif #endif /* __CYGWIN__ */ /* This is the fallback */ if (lastfdesc < 0) lastfdesc = MAXSOCKS; if (lastfdesc > MAXSELECT) lastfdesc = MAXSELECT; if (lastfdesc > MAXCLIENTS) { lastfdesc = MAXCLIENTS; if (debug_conns) ErrorF("REACHED MAXIMUM CLIENTS LIMIT %d\n", MAXCLIENTS); } MaxClients = lastfdesc; #ifdef DEBUG ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients); #endif #if !defined(WIN32) if (!ConnectionTranslation) ConnectionTranslation = (int *) xnfalloc(sizeof(int) * (lastfdesc + 1)); #else InitConnectionTranslation(); #endif } /* * If SIGUSR1 was set to SIG_IGN when the server started, assume that either * * a- The parent process is ignoring SIGUSR1 * * or * * b- The parent process is expecting a SIGUSR1 * when the server is ready to accept connections * * In the first case, the signal will be harmless, in the second case, * the signal will be quite useful. */ static void InitParentProcess(void) { #if !defined(WIN32) OsSigHandlerPtr handler; handler = OsSignal(SIGUSR1, SIG_IGN); if (handler == SIG_IGN) RunFromSmartParent = TRUE; OsSignal(SIGUSR1, handler); ParentProcess = getppid(); #endif } void NotifyParentProcess(void) { #if !defined(WIN32) if (displayfd >= 0) { if (write(displayfd, display, strlen(display)) != strlen(display)) FatalError("Cannot write display number to fd %d\n", displayfd); if (write(displayfd, "\n", 1) != 1) FatalError("Cannot write display number to fd %d\n", displayfd); close(displayfd); displayfd = -1; } if (RunFromSmartParent) { if (ParentProcess > 1) { kill(ParentProcess, SIGUSR1); } } 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. *****************/ void CreateWellKnownSockets(void) { int i; int partial; FD_ZERO(&AllSockets); FD_ZERO(&AllClients); FD_ZERO(&LastSelectMask); FD_ZERO(&ClientsWithInput); #if !defined(WIN32) for (i = 0; i < MaxClients; i++) ConnectionTranslation[i] = 0; #else ClearConnectionTranslation(); #endif FD_ZERO(&WellKnownConnections); /* display is initialized to "0" by main(). It is then set to the display * number if specified on the command line. */ if (NoListenAll) { ListenTransCount = 0; } else if ((displayfd < 0) || explicit_display) { if (TryCreateSocket(atoi(display), &partial) && ListenTransCount >= 1) if (!PartialNetwork && partial) FatalError ("Failed to establish all listening sockets"); } else { /* -displayfd and no explicit display number */ Bool found = 0; for (i = 0; i < 65536 - 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) && !NoListenAll) FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running"); #if !defined(WIN32) OsSignal(SIGPIPE, SIG_IGN); OsSignal(SIGHUP, AutoResetServer); #endif OsSignal(SIGINT, GiveUp); OsSignal(SIGTERM, GiveUp); XFD_COPYSET(&WellKnownConnections, &AllSockets); ResetHosts(display); InitParentProcess(); #ifdef XDMCP XdmcpInit(); #endif } void ResetWellKnownSockets(void) { int i; ResetOsBuffers(); for (i = 0; i < ListenTransCount; i++) { int status = _XSERVTransResetListener(ListenTransConns[i]); if (status != TRANS_RESET_NOOP) { if (status == TRANS_RESET_FAILURE) { /* * ListenTransConns[i] freed by xtrans. * Remove it from out list. */ FD_CLR(ListenTransFds[i], &WellKnownConnections); ListenTransFds[i] = ListenTransFds[ListenTransCount - 1]; ListenTransConns[i] = ListenTransConns[ListenTransCount - 1]; ListenTransCount -= 1; i -= 1; } else if (status == TRANS_RESET_NEW_FD) { /* * A new file descriptor was allocated (the old one was closed) */ int newfd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); FD_CLR(ListenTransFds[i], &WellKnownConnections); ListenTransFds[i] = newfd; FD_SET(newfd, &WellKnownConnections); } } } ResetAuthorization(); ResetHosts(display); /* * restart XDMCP */ #ifdef XDMCP XdmcpReset(); #endif } void CloseWellKnownConnections(void) { int i; for (i = 0; i < ListenTransCount; i++) _XSERVTransClose(ListenTransConns[i]); } static void AuthAudit(ClientPtr client, Bool letin, struct sockaddr *saddr, int len, unsigned int proto_n, char *auth_proto, int auth_id) { char addr[128]; char client_uid_string[64]; LocalClientCredRec *lcc; #ifdef XSERVER_DTRACE pid_t client_pid = -1; zoneid_t client_zid = -1; #endif if (!len) strlcpy(addr, "local host", sizeof(addr)); else switch (saddr->sa_family) { case AF_UNSPEC: #if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: #endif strlcpy(addr, "local host", sizeof(addr)); break; #if defined(TCPCONN) || defined(STREAMSCONN) case AF_INET: snprintf(addr, sizeof(addr), "IP %s", inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr)); break; #if defined(IPv6) && defined(AF_INET6) case AF_INET6:{ char ipaddr[INET6_ADDRSTRLEN]; inet_ntop(AF_INET6, &((struct sockaddr_in6 *) saddr)->sin6_addr, ipaddr, sizeof(ipaddr)); snprintf(addr, sizeof(addr), "IP %s", ipaddr); } break; #endif #endif default: strlcpy(addr, "unknown address", sizeof(addr)); } if (GetLocalClientCreds(client, &lcc) != -1) { int slen; /* length written to client_uid_string */ strcpy(client_uid_string, " ( "); slen = 3; if (lcc->fieldsSet & LCC_UID_SET) { snprintf(client_uid_string + slen, sizeof(client_uid_string) - slen, "uid=%ld ", (long) lcc->euid); slen = strlen(client_uid_string); } if (lcc->fieldsSet & LCC_GID_SET) { snprintf(client_uid_string + slen, sizeof(client_uid_string) - slen, "gid=%ld ", (long) lcc->egid); slen = strlen(client_uid_string); } if (lcc->fieldsSet & LCC_PID_SET) { #ifdef XSERVER_DTRACE client_pid = lcc->pid; #endif snprintf(client_uid_string + slen, sizeof(client_uid_string) - slen, "pid=%ld ", (long) lcc->pid); slen = strlen(client_uid_string); } if (lcc->fieldsSet & LCC_ZID_SET) { #ifdef XSERVER_DTRACE client_zid = lcc->zoneid; #endif snprintf(client_uid_string + slen, sizeof(client_uid_string) - slen, "zoneid=%ld ", (long) lcc->zoneid); slen = strlen(client_uid_string); } snprintf(client_uid_string + slen, sizeof(client_uid_string) - slen, ")"); FreeLocalClientCreds(lcc); } else { client_uid_string[0] = '\0'; } #ifdef XSERVER_DTRACE XSERVER_CLIENT_AUTH(client->index, addr, client_pid, client_zid); #endif if (auditTrailLevel > 1) { if (proto_n) AuditF("client %d %s from %s%s\n Auth name: %.*s ID: %d\n", client->index, letin ? "connected" : "rejected", addr, client_uid_string, (int) proto_n, auth_proto, auth_id); else AuditF("client %d %s from %s%s\n", client->index, letin ? "connected" : "rejected", addr, client_uid_string); } } XID AuthorizationIDOfClient(ClientPtr client) { if (client->osPrivate) return ((OsCommPtr) client->osPrivate)->auth_id; else return None; } /***************************************************************** * ClientAuthorized * * Sent by the client at connection setup: * typedef struct _xConnClientPrefix { * CARD8 byteOrder; * BYTE pad; * CARD16 majorVersion, minorVersion; * CARD16 nbytesAuthProto; * CARD16 nbytesAuthString; * } xConnClientPrefix; * * It is hoped that eventually one protocol will be agreed upon. In the * mean time, a server that implements a different protocol than the * client expects, or a server that only implements the host-based * mechanism, will simply ignore this information. * *****************************************************************/ const char * ClientAuthorized(ClientPtr client, unsigned int proto_n, char *auth_proto, unsigned int string_n, char *auth_string) { OsCommPtr priv; Xtransaddr *from = NULL; int family; int fromlen; XID auth_id; const char *reason = NULL; XtransConnInfo trans_conn; priv = (OsCommPtr) client->osPrivate; trans_conn = priv->trans_conn; /* Allow any client to connect without authorization on a launchd socket, because it is securely created -- this prevents a race condition on launch */ if (trans_conn->flags & TRANS_NOXAUTH) { auth_id = (XID) 0L; } else { auth_id = CheckAuthorization(proto_n, auth_proto, string_n, auth_string, client, &reason); } if (auth_id == (XID) ~0L) { if (_XSERVTransGetPeerAddr(trans_conn, &family, &fromlen, &from) != -1) { if (InvalidHost((struct sockaddr *) from, fromlen, client)) AuthAudit(client, FALSE, (struct sockaddr *) from, fromlen, proto_n, auth_proto, auth_id); else { auth_id = (XID) 0; #ifdef XSERVER_DTRACE if ((auditTrailLevel > 1) || XSERVER_CLIENT_AUTH_ENABLED()) #else if (auditTrailLevel > 1) #endif AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen, proto_n, auth_proto, auth_id); } free(from); } if (auth_id == (XID) ~0L) { if (reason) return reason; else return "Client is not authorized to connect to Server"; } } #ifdef XSERVER_DTRACE else if ((auditTrailLevel > 1) || XSERVER_CLIENT_AUTH_ENABLED()) #else else if (auditTrailLevel > 1) #endif { if (_XSERVTransGetPeerAddr(trans_conn, &family, &fromlen, &from) != -1) { AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen, proto_n, auth_proto, auth_id); free(from); } } priv->auth_id = auth_id; priv->conn_time = 0; #ifdef XDMCP /* indicate to Xdmcp protocol that we've opened new client */ XdmcpOpenDisplay(priv->fd); #endif /* XDMCP */ XaceHook(XACE_AUTH_AVAIL, client, auth_id); /* At this point, if the client is authorized to change the access control * list, we should getpeername() information, and add the client to * the selfhosts list. It's not really the host machine, but the * true purpose of the selfhosts list is to see who may change the * access control list. */ return ((char *) NULL); } static ClientPtr AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) { OsCommPtr oc; ClientPtr client; if ( #ifndef WIN32 fd >= lastfdesc #else XFD_SETCOUNT(&AllClients) >= MaxClients #endif ) return NullClient; oc = malloc(sizeof(OsCommRec)); if (!oc) return NullClient; oc->trans_conn = trans_conn; oc->fd = fd; oc->input = (ConnectionInputPtr) NULL; oc->output = (ConnectionOutputPtr) NULL; oc->auth_id = None; oc->conn_time = conn_time; if (!(client = NextAvailableClient((void *) oc))) { free(oc); return NullClient; } client->local = ComputeLocalClient(client); #if !defined(WIN32) ConnectionTranslation[fd] = client->index; #else SetConnectionTranslation(fd, client->index); #endif if (GrabInProgress) { FD_SET(fd, &SavedAllClients); FD_SET(fd, &SavedAllSockets); } else { FD_SET(fd, &AllClients); FD_SET(fd, &AllSockets); } #ifdef DEBUG ErrorF("AllocNewConnection: client index = %d, socket fd = %d\n", client->index, fd); #endif #ifdef XSERVER_DTRACE XSERVER_CLIENT_CONNECT(client->index, fd); #endif return client; } /***************** * EstablishNewConnections * If anyone is waiting on listened sockets, accept them. * Returns a mask with indices of new clients. Updates AllClients * and AllSockets. *****************/ /*ARGSUSED*/ Bool EstablishNewConnections(ClientPtr clientUnused, void *closure) { fd_set readyconnections; /* set of listeners that are ready */ int curconn; /* fd of listener that's ready */ register int newconn; /* fd of new client */ CARD32 connect_time; register int i; register ClientPtr client; register OsCommPtr oc; fd_set tmask; XFD_ANDSET(&tmask, (fd_set *) closure, &WellKnownConnections); XFD_COPYSET(&tmask, &readyconnections); if (!XFD_ANYSET(&readyconnections)) return TRUE; connect_time = GetTimeInMillis(); /* kill off stragglers */ for (i = 1; i < currentMaxClients; i++) { if ((client = clients[i])) { oc = (OsCommPtr) (client->osPrivate); if ((oc && (oc->conn_time != 0) && (connect_time - oc->conn_time) >= TimeOutValue) || (client->noClientException != Success && !client->clientGone)) CloseDownClient(client); } } #ifndef WIN32 for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { while (readyconnections.fds_bits[i]) #else for (i = 0; i < XFD_SETCOUNT(&readyconnections); i++) #endif { XtransConnInfo trans_conn, new_trans_conn; int status; #ifndef WIN32 curconn = mffs(readyconnections.fds_bits[i]) - 1; readyconnections.fds_bits[i] &= ~((fd_mask) 1 << curconn); curconn += (i * (sizeof(fd_mask) * 8)); #else curconn = XFD_FD(&readyconnections, i); #endif if ((trans_conn = lookup_trans_conn(curconn)) == NULL) continue; if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL) continue; newconn = _XSERVTransGetConnectionNumber(new_trans_conn); if (newconn < lastfdesc) { int clientid; #if !defined(WIN32) clientid = ConnectionTranslation[newconn]; #else clientid = GetConnectionTranslation(newconn); #endif if (clientid && (client = clients[clientid])) CloseDownClient(client); } _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); if (trans_conn->flags & TRANS_NOXAUTH) new_trans_conn->flags = new_trans_conn->flags | TRANS_NOXAUTH; if (!AllocNewConnection(new_trans_conn, newconn, connect_time)) { ErrorConnMax(new_trans_conn); _XSERVTransClose(new_trans_conn); } } #ifndef WIN32 } #endif return TRUE; } #define NOROOM "Maximum number of clients reached" /************ * ErrorConnMax * Fail a connection due to lack of client or file descriptor space ************/ #define BOTIMEOUT 200 /* in milliseconds */ static void ErrorConnMax(XtransConnInfo trans_conn) { int fd = _XSERVTransGetConnectionNumber(trans_conn); xConnSetupPrefix csp; char pad[3] = { 0, 0, 0 }; struct iovec iov[3]; char order = 0; int whichbyte = 1; struct timeval waittime; fd_set mask; /* if these seems like a lot of trouble to go to, it probably is */ waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND; waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) * (1000000 / MILLI_PER_SECOND); FD_ZERO(&mask); 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, &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) && (order == 'B' || order == 'R')) || (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { swaps(&csp.majorVersion); swaps(&csp.minorVersion); swaps(&csp.length); } iov[0].iov_len = sz_xConnSetupPrefix; iov[0].iov_base = (char *) &csp; iov[1].iov_len = csp.lengthReason; iov[1].iov_base = (void *) NOROOM; iov[2].iov_len = (4 - (csp.lengthReason & 3)) & 3; iov[2].iov_base = pad; (void) _XSERVTransWritev(trans_conn, iov, 3); } } /************ * CloseDownFileDescriptor: * Remove this file descriptor and it's I/O buffers, etc. ************/ static void CloseDownFileDescriptor(OsCommPtr oc) { int connection = oc->fd; if (oc->trans_conn) { _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); } #ifndef WIN32 ConnectionTranslation[connection] = 0; #else SetConnectionTranslation(connection, 0); #endif FD_CLR(connection, &AllSockets); FD_CLR(connection, &AllClients); FD_CLR(connection, &ClientsWithInput); FD_CLR(connection, &GrabImperviousClients); if (GrabInProgress) { FD_CLR(connection, &SavedAllSockets); FD_CLR(connection, &SavedAllClients); FD_CLR(connection, &SavedClientsWithInput); } FD_CLR(connection, &ClientsWriteBlocked); if (!XFD_ANYSET(&ClientsWriteBlocked)) AnyClientsWriteBlocked = FALSE; FD_CLR(connection, &OutputPending); } /***************** * CheckConnections * Some connection has died, go find which one and shut it down * The file descriptor has been closed, but is still in AllClients. * If would truly be wonderful if select() would put the bogus * file descriptors in the exception mask, but nooooo. So we have * to check each and every socket individually. *****************/ void CheckConnections(void) { #ifndef WIN32 fd_mask mask; #endif fd_set tmask; int curclient, curoff; int i; struct timeval notime; int r; #ifdef WIN32 fd_set savedAllClients; #endif notime.tv_sec = 0; notime.tv_usec = 0; #ifndef WIN32 for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { mask = AllClients.fds_bits[i]; while (mask) { curoff = mffs(mask) - 1; curclient = curoff + (i * (sizeof(fd_mask) * 8)); FD_ZERO(&tmask); FD_SET(curclient, &tmask); do { r = Select(curclient + 1, &tmask, NULL, NULL, ¬ime); } while (r < 0 && (errno == EINTR || errno == EAGAIN)); if (r < 0) if (ConnectionTranslation[curclient] > 0) CloseDownClient(clients[ConnectionTranslation[curclient]]); mask &= ~((fd_mask) 1 << curoff); } } #else XFD_COPYSET(&AllClients, &savedAllClients); for (i = 0; i < XFD_SETCOUNT(&savedAllClients); i++) { curclient = XFD_FD(&savedAllClients, i); FD_ZERO(&tmask); FD_SET(curclient, &tmask); do { r = Select(curclient + 1, &tmask, NULL, NULL, ¬ime); } while (r < 0 && (errno == EINTR || errno == EAGAIN)); if (r < 0) if (GetConnectionTranslation(curclient) > 0) CloseDownClient(clients[GetConnectionTranslation(curclient)]); } #endif } /***************** * CloseDownConnection * Delete client from AllClients and free resources *****************/ void CloseDownConnection(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; if (FlushCallback) CallCallbacks(&FlushCallback, NULL); if (oc->output) FlushClient(client, oc, (char *) NULL, 0); #ifdef XDMCP XdmcpCloseDisplay(oc->fd); #endif CloseDownFileDescriptor(oc); FreeOsBuffers(oc); free(client->osPrivate); client->osPrivate = (void *) NULL; if (auditTrailLevel > 1) AuditF("client %d disconnected\n", client->index); } void AddGeneralSocket(int fd) { FD_SET(fd, &AllSockets); if (GrabInProgress) FD_SET(fd, &SavedAllSockets); } void AddEnabledDevice(int fd) { FD_SET(fd, &EnabledDevices); AddGeneralSocket(fd); } void RemoveGeneralSocket(int fd) { FD_CLR(fd, &AllSockets); if (GrabInProgress) FD_CLR(fd, &SavedAllSockets); } void RemoveEnabledDevice(int fd) { FD_CLR(fd, &EnabledDevices); RemoveGeneralSocket(fd); } /***************** * OnlyListenToOneClient: * Only accept requests from one client. Continue to handle new * connections, but don't take any protocol requests from the new * ones. Note that if GrabInProgress is set, EstablishNewConnections * needs to put new clients into SavedAllSockets and SavedAllClients. * Note also that there is no timeout for this in the protocol. * This routine is "undone" by ListenToAllClients() *****************/ int OnlyListenToOneClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; int rc, connection = oc->fd; rc = XaceHook(XACE_SERVER_ACCESS, client, DixGrabAccess); if (rc != Success) return rc; if (!GrabInProgress) { XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput); XFD_ANDSET(&ClientsWithInput, &ClientsWithInput, &GrabImperviousClients); if (FD_ISSET(connection, &SavedClientsWithInput)) { FD_CLR(connection, &SavedClientsWithInput); FD_SET(connection, &ClientsWithInput); } XFD_UNSET(&SavedClientsWithInput, &GrabImperviousClients); XFD_COPYSET(&AllSockets, &SavedAllSockets); XFD_COPYSET(&AllClients, &SavedAllClients); XFD_UNSET(&AllSockets, &AllClients); XFD_ANDSET(&AllClients, &AllClients, &GrabImperviousClients); FD_SET(connection, &AllClients); XFD_ORSET(&AllSockets, &AllSockets, &AllClients); GrabInProgress = client->index; } return rc; } /**************** * ListenToAllClients: * Undoes OnlyListentToOneClient() ****************/ void ListenToAllClients(void) { if (GrabInProgress) { XFD_ORSET(&AllSockets, &AllSockets, &SavedAllSockets); XFD_ORSET(&AllClients, &AllClients, &SavedAllClients); XFD_ORSET(&ClientsWithInput, &ClientsWithInput, &SavedClientsWithInput); GrabInProgress = 0; } } /**************** * IgnoreClient * Removes one client from input masks. * Must have cooresponding call to AttendClient. ****************/ void IgnoreClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; int connection = oc->fd; client->ignoreCount++; if (client->ignoreCount > 1) return; isItTimeToYield = TRUE; if (!GrabInProgress || FD_ISSET(connection, &AllClients)) { if (FD_ISSET(connection, &ClientsWithInput)) FD_SET(connection, &IgnoredClientsWithInput); else FD_CLR(connection, &IgnoredClientsWithInput); FD_CLR(connection, &ClientsWithInput); FD_CLR(connection, &AllSockets); FD_CLR(connection, &AllClients); FD_CLR(connection, &LastSelectMask); } else { if (FD_ISSET(connection, &SavedClientsWithInput)) FD_SET(connection, &IgnoredClientsWithInput); else FD_CLR(connection, &IgnoredClientsWithInput); FD_CLR(connection, &SavedClientsWithInput); FD_CLR(connection, &SavedAllSockets); FD_CLR(connection, &SavedAllClients); } } /**************** * AttendClient * Adds one client back into the input masks. ****************/ void AttendClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; int connection = oc->fd; client->ignoreCount--; if (client->ignoreCount) return; if (!GrabInProgress || GrabInProgress == client->index || FD_ISSET(connection, &GrabImperviousClients)) { FD_SET(connection, &AllClients); FD_SET(connection, &AllSockets); FD_SET(connection, &LastSelectMask); if (FD_ISSET(connection, &IgnoredClientsWithInput)) FD_SET(connection, &ClientsWithInput); } else { FD_SET(connection, &SavedAllClients); FD_SET(connection, &SavedAllSockets); if (FD_ISSET(connection, &IgnoredClientsWithInput)) FD_SET(connection, &SavedClientsWithInput); } } /* make client impervious to grabs; assume only executing client calls this */ void MakeClientGrabImpervious(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; int connection = oc->fd; FD_SET(connection, &GrabImperviousClients); if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = CLIENT_IMPERVIOUS; CallCallbacks(&ServerGrabCallback, &grabinfo); } } /* make client pervious to grabs; assume only executing client calls this */ void MakeClientGrabPervious(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; int connection = oc->fd; FD_CLR(connection, &GrabImperviousClients); if (GrabInProgress && (GrabInProgress != client->index)) { if (FD_ISSET(connection, &ClientsWithInput)) { FD_SET(connection, &SavedClientsWithInput); FD_CLR(connection, &ClientsWithInput); } FD_CLR(connection, &AllSockets); FD_CLR(connection, &AllClients); isItTimeToYield = TRUE; } if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = CLIENT_PERVIOUS; CallCallbacks(&ServerGrabCallback, &grabinfo); } } /* Add a fd (from launchd or similar) to our listeners */ void ListenOnOpenFD(int fd, int noxauth) { char port[256]; XtransConnInfo ciptr; const char *display_env = getenv("DISPLAY"); if (display_env && (strncmp(display_env, "/tmp/launch", 11) == 0)) { /* Make the path the launchd socket if our DISPLAY is set right */ strcpy(port, display_env); } else { /* Just some default so things don't break and die. */ snprintf(port, sizeof(port), ":%d", atoi(display)); } /* Make our XtransConnInfo * TRANS_SOCKET_LOCAL_INDEX = 5 from Xtrans.c */ ciptr = _XSERVTransReopenCOTSServer(5, fd, port); if (ciptr == NULL) { ErrorF("Got NULL while trying to Reopen listen port.\n"); return; } if (noxauth) ciptr->flags = ciptr->flags | TRANS_NOXAUTH; /* Allocate space to store it */ ListenTransFds = (int *) realloc(ListenTransFds, (ListenTransCount + 1) * sizeof(int)); ListenTransConns = (XtransConnInfo *) realloc(ListenTransConns, (ListenTransCount + 1) * sizeof(XtransConnInfo)); /* Store it */ ListenTransConns[ListenTransCount] = ciptr; ListenTransFds[ListenTransCount] = fd; FD_SET(fd, &WellKnownConnections); FD_SET(fd, &AllSockets); /* Increment the count */ ListenTransCount++; } /* based on TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) */ Bool AddClientOnOpenFD(int fd) { XtransConnInfo ciptr; CARD32 connect_time; char port[20]; snprintf(port, sizeof(port), ":%d", atoi(display)); ciptr = _XSERVTransReopenCOTSServer(5, fd, port); if (ciptr == NULL) return FALSE; _XSERVTransSetOption(ciptr, TRANS_NONBLOCKING, 1); ciptr->flags |= TRANS_NOXAUTH; connect_time = GetTimeInMillis(); if (!AllocNewConnection(ciptr, fd, connect_time)) { ErrorConnMax(ciptr); _XSERVTransClose(ciptr); return FALSE; } return TRUE; } xorg-server-1.17.1/os/io.c0000664000175100017510000010552112456571574012231 00000000000000/*********************************************************** Copyright 1987, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /***************************************************************** * i/o functions * * WriteToClient, ReadRequestFromClient * InsertFakeRequest, ResetCurrentRequest * *****************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include #endif #undef DEBUG_COMMUNICATION #ifdef WIN32 #include #endif #include #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN #include #include #include #if !defined(WIN32) #include #endif #include #include #include "os.h" #include "osdep.h" #include #include "opaque.h" #include "dixstruct.h" #include "misc.h" 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); /* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno * for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX * systems are broken and return EWOULDBLOCK when they should return EAGAIN */ #ifndef WIN32 # if (EAGAIN != EWOULDBLOCK) # define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) # else # define ETEST(err) (err == EAGAIN) # endif #else /* WIN32 The socket errorcodes differ from the normal errors */ #define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) #endif static Bool CriticalOutputPending; static int timesThisConnection = 0; static ConnectionInputPtr FreeInputs = (ConnectionInputPtr) NULL; static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr) NULL; static OsCommPtr AvailableInput = (OsCommPtr) NULL; #define get_req_len(req,cli) ((cli)->swapped ? \ lswaps((req)->length) : (req)->length) #include #define get_big_req_len(req,cli) ((cli)->swapped ? \ lswapl(((xBigReq *)(req))->length) : \ ((xBigReq *)(req))->length) #define MAX_TIMES_PER 10 #define BUFSIZE 4096 #define BUFWATERMARK 8192 /* * A lot of the code in this file manipulates a ConnectionInputPtr: * * ----------------------------------------------- * |------- bufcnt ------->| | | * | |- gotnow ->| | | * | |-------- needed ------>| | * |-----------+--------- size --------+---------->| * ----------------------------------------------- * ^ ^ * | | * buffer bufptr * * buffer is a pointer to the start of the buffer. * bufptr points to the start of the current request. * bufcnt counts how many bytes are in the buffer. * size is the size of the buffer in bytes. * * In several of the functions, gotnow and needed are local variables * that do the following: * * gotnow is the number of bytes of the request that we're * trying to read that are currently in the buffer. * Typically, gotnow = (buffer + bufcnt) - bufptr * * needed = the length of the request that we're trying to * read. Watch out: needed sometimes counts bytes and sometimes * counts CARD32's. */ /***************************************************************** * ReadRequestFromClient * Returns one request in client->requestBuffer. The request * length will be in client->req_len. Return status is: * * > 0 if successful, specifies length in bytes of the request * = 0 if entire request is not yet available * < 0 if client should be terminated * * The request returned must be contiguous so that it can be * cast in the dispatcher to the correct request type. Because requests * are variable length, ReadRequestFromClient() must look at the first 4 * or 8 bytes of a request to determine the length (the request length is * in the 3rd and 4th bytes of the request unless it is a Big Request * (see the Big Request Extension), in which case the 3rd and 4th bytes * are zero and the following 4 bytes are the request length. * * Note: in order to make the server scheduler (WaitForSomething()) * "fair", the ClientsWithInput mask is used. This mask tells which * clients have FULL requests left in their buffers. Clients with * partial requests require a read. Basically, client buffers * are drained before select() is called again. But, we can't keep * reading from a client that is sending buckets of data (or has * a partial request) because others clients need to be scheduled. *****************************************************************/ static void YieldControl(void) { isItTimeToYield = TRUE; timesThisConnection = 0; } static void YieldControlNoInput(int fd) { YieldControl(); FD_CLR(fd, &ClientsWithInput); } static void YieldControlDeath(void) { timesThisConnection = 0; } /* If an input buffer was empty, either free it if it is too big or link it * into our list of free input buffers. This means that different clients can * share the same input buffer (at different times). This was done to save * memory. */ static void NextAvailableInput(OsCommPtr oc) { if (AvailableInput) { if (AvailableInput != oc) { ConnectionInputPtr aci = AvailableInput->input; if (aci->size > BUFWATERMARK) { free(aci->buffer); free(aci); } else { aci->next = FreeInputs; FreeInputs = aci; } AvailableInput->input = NULL; } AvailableInput = NULL; } } int ReadRequestFromClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; ConnectionInputPtr oci = oc->input; int fd = oc->fd; unsigned int gotnow, needed; int result; register xReq *request; Bool need_header; Bool move_header; NextAvailableInput(oc); /* make sure we have an input buffer */ if (!oci) { if ((oci = FreeInputs)) { FreeInputs = oci->next; } else if (!(oci = AllocateInputBuffer())) { YieldControlDeath(); return -1; } oc->input = oci; } #if XTRANS_SEND_FDS /* Discard any unused file descriptors */ while (client->req_fds > 0) { int req_fd = ReadFdFromClient(client); if (req_fd >= 0) close(req_fd); } #endif /* advance to start of next request */ oci->bufptr += oci->lenLastReq; need_header = FALSE; move_header = FALSE; gotnow = oci->bufcnt + oci->buffer - oci->bufptr; if (oci->ignoreBytes > 0) { if (oci->ignoreBytes > oci->size) needed = oci->size; else needed = oci->ignoreBytes; } else if (gotnow < sizeof(xReq)) { /* We don't have an entire xReq yet. Can't tell how big * the request will be until we get the whole xReq. */ needed = sizeof(xReq); need_header = TRUE; } else { /* We have a whole xReq. We can tell how big the whole * request will be unless it is a Big Request. */ request = (xReq *) oci->bufptr; needed = get_req_len(request, client); if (!needed && client->big_requests) { /* It's a Big Request. */ move_header = TRUE; if (gotnow < sizeof(xBigReq)) { /* Still need more data to tell just how big. */ needed = bytes_to_int32(sizeof(xBigReq)); /* needed is in CARD32s now */ need_header = TRUE; } else needed = get_big_req_len(request, client); } client->req_len = needed; needed <<= 2; /* needed is in bytes now */ } if (gotnow < needed) { /* Need to read more data, either so that we can get a * complete xReq (if need_header is TRUE), a complete * xBigReq (if move_header is TRUE), or the rest of the * request (if need_header and move_header are both FALSE). */ oci->lenLastReq = 0; if (needed > maxBigRequestSize << 2) { /* request is too big for us to handle */ /* * Mark the rest of it as needing to be ignored, and then return * the full size. Dispatch() will turn it into a BadLength error. */ oci->ignoreBytes = needed - gotnow; oci->lenLastReq = gotnow; return needed; } if ((gotnow == 0) || ((oci->bufptr - oci->buffer + needed) > oci->size)) { /* no data, or the request is too big to fit in the buffer */ if ((gotnow > 0) && (oci->bufptr != oci->buffer)) /* save the data we've already read */ memmove(oci->buffer, oci->bufptr, gotnow); if (needed > oci->size) { /* make buffer bigger to accomodate request */ char *ibuf; ibuf = (char *) realloc(oci->buffer, needed); if (!ibuf) { YieldControlDeath(); return -1; } oci->size = needed; oci->buffer = ibuf; } oci->bufptr = oci->buffer; oci->bufcnt = gotnow; } /* XXX this is a workaround. This function is sometimes called * after the trans_conn has been freed. In this case trans_conn * will be null. Really ought to restructure things so that we * never get here in those circumstances. */ if (!oc->trans_conn) { /* treat as if an error occured on the read, which is what * used to happen */ YieldControlDeath(); return -1; } result = _XSERVTransRead(oc->trans_conn, oci->buffer + oci->bufcnt, oci->size - oci->bufcnt); if (result <= 0) { if ((result < 0) && ETEST(errno)) { #if defined(SVR4) && defined(__i386__) && !defined(sun) if (0) #endif { YieldControlNoInput(fd); return 0; } } YieldControlDeath(); return -1; } oci->bufcnt += result; gotnow += result; /* free up some space after huge requests */ if ((oci->size > BUFWATERMARK) && (oci->bufcnt < BUFSIZE) && (needed < BUFSIZE)) { char *ibuf; ibuf = (char *) realloc(oci->buffer, BUFSIZE); if (ibuf) { oci->size = BUFSIZE; oci->buffer = ibuf; oci->bufptr = ibuf + oci->bufcnt - gotnow; } } if (need_header && gotnow >= needed) { /* We wanted an xReq, now we've gotten it. */ request = (xReq *) oci->bufptr; needed = get_req_len(request, client); if (!needed && client->big_requests) { move_header = TRUE; if (gotnow < sizeof(xBigReq)) needed = bytes_to_int32(sizeof(xBigReq)); else needed = get_big_req_len(request, client); } client->req_len = needed; needed <<= 2; } if (gotnow < needed) { /* Still don't have enough; punt. */ YieldControlNoInput(fd); return 0; } } if (needed == 0) { if (client->big_requests) needed = sizeof(xBigReq); else needed = sizeof(xReq); } /* If there are bytes to ignore, ignore them now. */ if (oci->ignoreBytes > 0) { assert(needed == oci->ignoreBytes || needed == oci->size); /* * The _XSERVTransRead call above may return more or fewer bytes than we * want to ignore. Ignore the smaller of the two sizes. */ if (gotnow < needed) { oci->ignoreBytes -= gotnow; oci->bufptr += gotnow; gotnow = 0; } else { oci->ignoreBytes -= needed; oci->bufptr += needed; gotnow -= needed; } needed = 0; } oci->lenLastReq = needed; /* * Check to see if client has at least one whole request in the * buffer beyond the request we're returning to the caller. * If there is only a partial request, treat like buffer * is empty so that select() will be called again and other clients * can get into the queue. */ gotnow -= needed; if (gotnow >= sizeof(xReq)) { request = (xReq *) (oci->bufptr + needed); if (gotnow >= (result = (get_req_len(request, client) << 2)) && (result || (client->big_requests && (gotnow >= sizeof(xBigReq) && gotnow >= (get_big_req_len(request, client) << 2)))) ) FD_SET(fd, &ClientsWithInput); else { if (!SmartScheduleDisable) FD_CLR(fd, &ClientsWithInput); else YieldControlNoInput(fd); } } else { if (!gotnow) AvailableInput = oc; if (!SmartScheduleDisable) FD_CLR(fd, &ClientsWithInput); else YieldControlNoInput(fd); } if (SmartScheduleDisable) if (++timesThisConnection >= MAX_TIMES_PER) YieldControl(); if (move_header) { request = (xReq *) oci->bufptr; oci->bufptr += (sizeof(xBigReq) - sizeof(xReq)); *(xReq *) oci->bufptr = *request; oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq)); client->req_len -= bytes_to_int32(sizeof(xBigReq) - sizeof(xReq)); } client->requestBuffer = (void *) oci->bufptr; #ifdef DEBUG_COMMUNICATION { xReq *req = client->requestBuffer; ErrorF("REQUEST: ClientIDX: %i, type: 0x%x data: 0x%x len: %i\n", client->index, req->reqType, req->data, req->length); } #endif return needed; } #if XTRANS_SEND_FDS int ReadFdFromClient(ClientPtr client) { int fd = -1; if (client->req_fds > 0) { OsCommPtr oc = (OsCommPtr) client->osPrivate; --client->req_fds; fd = _XSERVTransRecvFd(oc->trans_conn); } else LogMessage(X_ERROR, "Request asks for FD without setting req_fds\n"); return fd; } int WriteFdToClient(ClientPtr client, int fd, Bool do_close) { OsCommPtr oc = (OsCommPtr) client->osPrivate; return _XSERVTransSendFd(oc->trans_conn, fd, do_close); } #endif /***************************************************************** * InsertFakeRequest * Splice a consed up (possibly partial) request in as the next request. * **********************/ Bool InsertFakeRequest(ClientPtr client, char *data, int count) { OsCommPtr oc = (OsCommPtr) client->osPrivate; ConnectionInputPtr oci = oc->input; int fd = oc->fd; int gotnow, moveup; NextAvailableInput(oc); if (!oci) { if ((oci = FreeInputs)) FreeInputs = oci->next; else if (!(oci = AllocateInputBuffer())) return FALSE; oc->input = oci; } oci->bufptr += oci->lenLastReq; oci->lenLastReq = 0; gotnow = oci->bufcnt + oci->buffer - oci->bufptr; if ((gotnow + count) > oci->size) { char *ibuf; ibuf = (char *) realloc(oci->buffer, gotnow + count); if (!ibuf) return FALSE; oci->size = gotnow + count; oci->buffer = ibuf; oci->bufptr = ibuf + oci->bufcnt - gotnow; } moveup = count - (oci->bufptr - oci->buffer); if (moveup > 0) { if (gotnow > 0) memmove(oci->bufptr + moveup, oci->bufptr, gotnow); oci->bufptr += moveup; oci->bufcnt += moveup; } memmove(oci->bufptr - count, data, count); oci->bufptr -= count; gotnow += count; if ((gotnow >= sizeof(xReq)) && (gotnow >= (int) (get_req_len((xReq *) oci->bufptr, client) << 2))) FD_SET(fd, &ClientsWithInput); else YieldControlNoInput(fd); return TRUE; } /***************************************************************** * ResetRequestFromClient * Reset to reexecute the current request, and yield. * **********************/ void ResetCurrentRequest(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; register ConnectionInputPtr oci = oc->input; int fd = oc->fd; register xReq *request; int gotnow, needed; if (AvailableInput == oc) AvailableInput = (OsCommPtr) NULL; oci->lenLastReq = 0; gotnow = oci->bufcnt + oci->buffer - oci->bufptr; if (gotnow < sizeof(xReq)) { YieldControlNoInput(fd); } else { request = (xReq *) oci->bufptr; needed = get_req_len(request, client); if (!needed && client->big_requests) { oci->bufptr -= sizeof(xBigReq) - sizeof(xReq); *(xReq *) oci->bufptr = *request; ((xBigReq *) oci->bufptr)->length = client->req_len; if (client->swapped) { swapl(&((xBigReq *) oci->bufptr)->length); } } if (gotnow >= (needed << 2)) { if (FD_ISSET(fd, &AllClients)) { FD_SET(fd, &ClientsWithInput); } else { FD_SET(fd, &IgnoredClientsWithInput); } YieldControl(); } else YieldControlNoInput(fd); } } /******************** * FlushAllOutput() * Flush all clients with output. However, if some client still * has input in the queue (more requests), then don't flush. This * will prevent the output queue from being flushed every time around * the round robin queue. Now, some say that it SHOULD be flushed * every time around, but... * **********************/ void FlushAllOutput(void) { register int index, base; register fd_mask mask; /* raphael */ OsCommPtr oc; register ClientPtr client; Bool newoutput = NewOutputPending; #if defined(WIN32) fd_set newOutputPending; #endif if (FlushCallback) CallCallbacks(&FlushCallback, NULL); if (!newoutput) return; /* * It may be that some client still has critical output pending, * but he is not yet ready to receive it anyway, so we will * simply wait for the select to tell us when he's ready to receive. */ CriticalOutputPending = FALSE; NewOutputPending = FALSE; #ifndef WIN32 for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++) { mask = OutputPending.fds_bits[base]; OutputPending.fds_bits[base] = 0; while (mask) { index = ffs(mask) - 1; mask &= ~lowbit(mask); if ((index = ConnectionTranslation[(base * (sizeof(fd_mask) * 8)) + index]) == 0) continue; client = clients[index]; if (client->clientGone) continue; oc = (OsCommPtr) client->osPrivate; if (FD_ISSET(oc->fd, &ClientsWithInput)) { FD_SET(oc->fd, &OutputPending); /* set the bit again */ NewOutputPending = TRUE; } else (void) FlushClient(client, oc, (char *) NULL, 0); } } #else /* WIN32 */ FD_ZERO(&newOutputPending); for (base = 0; base < XFD_SETCOUNT(&OutputPending); base++) { index = XFD_FD(&OutputPending, base); if ((index = GetConnectionTranslation(index)) == 0) continue; client = clients[index]; if (client->clientGone) continue; oc = (OsCommPtr) client->osPrivate; if (FD_ISSET(oc->fd, &ClientsWithInput)) { FD_SET(oc->fd, &newOutputPending); /* set the bit again */ NewOutputPending = TRUE; } else (void) FlushClient(client, oc, (char *) NULL, 0); } XFD_COPYSET(&newOutputPending, &OutputPending); #endif /* WIN32 */ } void FlushIfCriticalOutputPending(void) { if (CriticalOutputPending) FlushAllOutput(); } void SetCriticalOutputPending(void) { CriticalOutputPending = TRUE; } /***************** * WriteToClient * Copies buf into ClientPtr.buf if it fits (with padding), else * flushes ClientPtr.buf and buf to client. As of this writing, * every use of WriteToClient is cast to void, and the result * is ignored. Potentially, this could be used by requests * that are sending several chunks of data and want to break * out of a loop on error. Thus, we will leave the type of * this routine as int. *****************/ int WriteToClient(ClientPtr who, int count, const void *__buf) { OsCommPtr oc; ConnectionOutputPtr oco; int padBytes; const char *buf = __buf; #ifdef DEBUG_COMMUNICATION Bool multicount = FALSE; #endif if (!count || !who || who == serverClient || who->clientGone) return 0; oc = who->osPrivate; oco = oc->output; #ifdef DEBUG_COMMUNICATION { char info[128]; xError *err; xGenericReply *rep; xEvent *ev; if (!who->replyBytesRemaining) { switch (buf[0]) { case X_Reply: rep = (xGenericReply *) buf; if (rep->sequenceNumber == who->sequence) { snprintf(info, 127, "Xreply: type: 0x%x data: 0x%x " "len: %i seq#: 0x%x", rep->type, rep->data1, rep->length, rep->sequenceNumber); multicount = TRUE; } break; case X_Error: err = (xError *) buf; snprintf(info, 127, "Xerror: Code: 0x%x resID: 0x%x maj: 0x%x " "min: %x", err->errorCode, err->resourceID, err->minorCode, err->majorCode); break; default: if ((buf[0] & 0x7f) == KeymapNotify) snprintf(info, 127, "KeymapNotifyEvent: %i", buf[0]); else { ev = (xEvent *) buf; snprintf(info, 127, "XEvent: type: 0x%x detail: 0x%x " "seq#: 0x%x", ev->u.u.type, ev->u.u.detail, ev->u.u.sequenceNumber); } } ErrorF("REPLY: ClientIDX: %i %s\n", who->index, info); } else multicount = TRUE; } #endif if (!oco) { if ((oco = FreeOutputs)) { FreeOutputs = oco->next; } else if (!(oco = AllocateOutputBuffer())) { if (oc->trans_conn) { _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); oc->trans_conn = NULL; } MarkClientException(who); return -1; } oc->output = oco; } padBytes = padding_for_int32(count); if (ReplyCallback) { ReplyInfoRec replyinfo; replyinfo.client = who; replyinfo.replyData = buf; replyinfo.dataLenBytes = count + padBytes; replyinfo.padBytes = padBytes; if (who->replyBytesRemaining) { /* still sending data of an earlier reply */ who->replyBytesRemaining -= count + padBytes; replyinfo.startOfReply = FALSE; replyinfo.bytesRemaining = who->replyBytesRemaining; CallCallbacks((&ReplyCallback), (void *) &replyinfo); } else if (who->clientState == ClientStateRunning && buf[0] == X_Reply) { /* start of new reply */ CARD32 replylen; unsigned long bytesleft; replylen = ((const xGenericReply *) buf)->length; if (who->swapped) swapl(&replylen); bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes; replyinfo.startOfReply = TRUE; replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft; CallCallbacks((&ReplyCallback), (void *) &replyinfo); } } #ifdef DEBUG_COMMUNICATION else if (multicount) { if (who->replyBytesRemaining) { who->replyBytesRemaining -= (count + padBytes); } else { CARD32 replylen; replylen = ((xGenericReply *) buf)->length; who->replyBytesRemaining = (replylen * 4) + SIZEOF(xReply) - count - padBytes; } } #endif if (oco->count == 0 || oco->count + count + padBytes > oco->size) { FD_CLR(oc->fd, &OutputPending); if (!XFD_ANYSET(&OutputPending)) { CriticalOutputPending = FALSE; NewOutputPending = FALSE; } if (FlushCallback) CallCallbacks(&FlushCallback, NULL); return FlushClient(who, oc, buf, count); } NewOutputPending = TRUE; FD_SET(oc->fd, &OutputPending); memmove((char *) oco->buf + oco->count, buf, count); oco->count += count; if (padBytes) { memset(oco->buf + oco->count, '\0', padBytes); oco->count += padBytes; } return count; } /******************** * FlushClient() * If the client isn't keeping up with us, then we try to continue * buffering the data and set the apropriate bit in ClientsWritable * (which is used by WaitFor in the select). If the connection yields * a permanent error, or we can't allocate any more space, we then * close the connection. * **********************/ int FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) { ConnectionOutputPtr oco = oc->output; int connection = oc->fd; XtransConnInfo trans_conn = oc->trans_conn; struct iovec iov[3]; static char padBuffer[3]; const char *extraBuf = __extraBuf; long written; long padsize; long notWritten; long todo; if (!oco) return 0; written = 0; 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 */ long remain = todo; /* amount to try this time, <= notWritten */ int i = 0; long len; /* You could be very general here and have "in" and "out" iovecs * and write a loop without using a macro, but what the heck. This * translates to: * * how much of this piece is new? * if more new then we are trying this time, clamp * if nothing new * then bump down amount already written, for next piece * else put new stuff in iovec, will need all of next piece * * Note that todo had better be at least 1 or else we'll end up * writing 0 iovecs. */ #define InsertIOV(pointer, length) \ len = (length) - before; \ if (len > remain) \ len = remain; \ if (len <= 0) { \ before = (-len); \ } else { \ iov[i].iov_len = len; \ iov[i].iov_base = (pointer) + before; \ i++; \ remain -= len; \ before = 0; \ } InsertIOV((char *) oco->buf, oco->count) InsertIOV((char *) extraBuf, extraCount) InsertIOV(padBuffer, padsize) errno = 0; if (trans_conn && (len = _XSERVTransWritev(trans_conn, iov, i)) >= 0) { written += len; notWritten -= len; todo = notWritten; } else if (ETEST(errno) #ifdef SUNSYSV /* check for another brain-damaged OS bug */ || (errno == 0) #endif #ifdef EMSGSIZE /* check for another brain-damaged OS bug */ || ((errno == EMSGSIZE) && (todo == 1)) #endif ) { /* If we've arrived here, then the client is stuffed to the gills and not ready to accept more. Make a note of it and buffer the rest. */ FD_SET(connection, &ClientsWriteBlocked); AnyClientsWriteBlocked = TRUE; if (written < oco->count) { if (written > 0) { oco->count -= written; memmove((char *) oco->buf, (char *) oco->buf + written, oco->count); written = 0; } } else { written -= oco->count; oco->count = 0; } if (notWritten > oco->size) { unsigned char *obuf = NULL; if (notWritten + BUFSIZE <= INT_MAX) { obuf = realloc(oco->buf, notWritten + BUFSIZE); } if (!obuf) { _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); oc->trans_conn = NULL; MarkClientException(who); oco->count = 0; return -1; } oco->size = notWritten + BUFSIZE; oco->buf = obuf; } /* If the amount written extended into the padBuffer, then the difference "extraCount - written" may be less than 0 */ if ((len = extraCount - written) > 0) memmove((char *) oco->buf + oco->count, extraBuf + written, len); oco->count = notWritten; /* this will include the pad */ /* return only the amount explicitly requested */ return extraCount; } #ifdef EMSGSIZE /* check for another brain-damaged OS bug */ else if (errno == EMSGSIZE) { todo >>= 1; } #endif else { if (oc->trans_conn) { _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); oc->trans_conn = NULL; } MarkClientException(who); oco->count = 0; return -1; } } /* everything was flushed out */ oco->count = 0; /* check to see if this client was write blocked */ if (AnyClientsWriteBlocked) { FD_CLR(oc->fd, &ClientsWriteBlocked); if (!XFD_ANYSET(&ClientsWriteBlocked)) AnyClientsWriteBlocked = FALSE; } if (oco->size > BUFWATERMARK) { free(oco->buf); free(oco); } else { oco->next = FreeOutputs; FreeOutputs = oco; } oc->output = (ConnectionOutputPtr) NULL; return extraCount; /* return only the amount explicitly requested */ } static ConnectionInputPtr AllocateInputBuffer(void) { ConnectionInputPtr oci; oci = malloc(sizeof(ConnectionInput)); if (!oci) return NULL; oci->buffer = malloc(BUFSIZE); if (!oci->buffer) { free(oci); return NULL; } oci->size = BUFSIZE; oci->bufptr = oci->buffer; oci->bufcnt = 0; oci->lenLastReq = 0; oci->ignoreBytes = 0; return oci; } static ConnectionOutputPtr AllocateOutputBuffer(void) { ConnectionOutputPtr oco; oco = malloc(sizeof(ConnectionOutput)); if (!oco) return NULL; oco->buf = calloc(1, BUFSIZE); if (!oco->buf) { free(oco); return NULL; } oco->size = BUFSIZE; oco->count = 0; return oco; } void FreeOsBuffers(OsCommPtr oc) { ConnectionInputPtr oci; ConnectionOutputPtr oco; if (AvailableInput == oc) AvailableInput = (OsCommPtr) NULL; if ((oci = oc->input)) { if (FreeInputs) { free(oci->buffer); free(oci); } else { FreeInputs = oci; oci->next = (ConnectionInputPtr) NULL; oci->bufptr = oci->buffer; oci->bufcnt = 0; oci->lenLastReq = 0; oci->ignoreBytes = 0; } } if ((oco = oc->output)) { if (FreeOutputs) { free(oco->buf); free(oco); } else { FreeOutputs = oco; oco->next = (ConnectionOutputPtr) NULL; oco->count = 0; } } } void ResetOsBuffers(void) { ConnectionInputPtr oci; ConnectionOutputPtr oco; while ((oci = FreeInputs)) { FreeInputs = oci->next; free(oci->buffer); free(oci); } while ((oco = FreeOutputs)) { FreeOutputs = oco->next; free(oco->buf); free(oco); } } xorg-server-1.17.1/os/oscolor.c0000664000175100017510000016071612456571574013311 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "os.h" typedef struct _builtinColor { unsigned char red; unsigned char green; unsigned char blue; unsigned short name; } BuiltinColor; static const char BuiltinColorNames[] = { "alice blue\0" "AliceBlue\0" "antique white\0" "AntiqueWhite\0" "AntiqueWhite1\0" "AntiqueWhite2\0" "AntiqueWhite3\0" "AntiqueWhite4\0" "aqua\0" "aquamarine\0" "aquamarine1\0" "aquamarine2\0" "aquamarine3\0" "aquamarine4\0" "azure\0" "azure1\0" "azure2\0" "azure3\0" "azure4\0" "beige\0" "bisque\0" "bisque1\0" "bisque2\0" "bisque3\0" "bisque4\0" "black\0" "blanched almond\0" "BlanchedAlmond\0" "blue\0" "blue violet\0" "blue1\0" "blue2\0" "blue3\0" "blue4\0" "BlueViolet\0" "brown\0" "brown1\0" "brown2\0" "brown3\0" "brown4\0" "burlywood\0" "burlywood1\0" "burlywood2\0" "burlywood3\0" "burlywood4\0" "cadet blue\0" "CadetBlue\0" "CadetBlue1\0" "CadetBlue2\0" "CadetBlue3\0" "CadetBlue4\0" "chartreuse\0" "chartreuse1\0" "chartreuse2\0" "chartreuse3\0" "chartreuse4\0" "chocolate\0" "chocolate1\0" "chocolate2\0" "chocolate3\0" "chocolate4\0" "coral\0" "coral1\0" "coral2\0" "coral3\0" "coral4\0" "cornflower blue\0" "CornflowerBlue\0" "cornsilk\0" "cornsilk1\0" "cornsilk2\0" "cornsilk3\0" "cornsilk4\0" "crimson\0" "cyan\0" "cyan1\0" "cyan2\0" "cyan3\0" "cyan4\0" "dark blue\0" "dark cyan\0" "dark goldenrod\0" "dark gray\0" "dark green\0" "dark grey\0" "dark khaki\0" "dark magenta\0" "dark olive green\0" "dark orange\0" "dark orchid\0" "dark red\0" "dark salmon\0" "dark sea green\0" "dark slate blue\0" "dark slate gray\0" "dark slate grey\0" "dark turquoise\0" "dark violet\0" "DarkBlue\0" "DarkCyan\0" "DarkGoldenrod\0" "DarkGoldenrod1\0" "DarkGoldenrod2\0" "DarkGoldenrod3\0" "DarkGoldenrod4\0" "DarkGray\0" "DarkGreen\0" "DarkGrey\0" "DarkKhaki\0" "DarkMagenta\0" "DarkOliveGreen\0" "DarkOliveGreen1\0" "DarkOliveGreen2\0" "DarkOliveGreen3\0" "DarkOliveGreen4\0" "DarkOrange\0" "DarkOrange1\0" "DarkOrange2\0" "DarkOrange3\0" "DarkOrange4\0" "DarkOrchid\0" "DarkOrchid1\0" "DarkOrchid2\0" "DarkOrchid3\0" "DarkOrchid4\0" "DarkRed\0" "DarkSalmon\0" "DarkSeaGreen\0" "DarkSeaGreen1\0" "DarkSeaGreen2\0" "DarkSeaGreen3\0" "DarkSeaGreen4\0" "DarkSlateBlue\0" "DarkSlateGray\0" "DarkSlateGray1\0" "DarkSlateGray2\0" "DarkSlateGray3\0" "DarkSlateGray4\0" "DarkSlateGrey\0" "DarkTurquoise\0" "DarkViolet\0" "deep pink\0" "deep sky blue\0" "DeepPink\0" "DeepPink1\0" "DeepPink2\0" "DeepPink3\0" "DeepPink4\0" "DeepSkyBlue\0" "DeepSkyBlue1\0" "DeepSkyBlue2\0" "DeepSkyBlue3\0" "DeepSkyBlue4\0" "dim gray\0" "dim grey\0" "DimGray\0" "DimGrey\0" "dodger blue\0" "DodgerBlue\0" "DodgerBlue1\0" "DodgerBlue2\0" "DodgerBlue3\0" "DodgerBlue4\0" "firebrick\0" "firebrick1\0" "firebrick2\0" "firebrick3\0" "firebrick4\0" "floral white\0" "FloralWhite\0" "forest green\0" "ForestGreen\0" "fuchsia\0" "gainsboro\0" "ghost white\0" "GhostWhite\0" "gold\0" "gold1\0" "gold2\0" "gold3\0" "gold4\0" "goldenrod\0" "goldenrod1\0" "goldenrod2\0" "goldenrod3\0" "goldenrod4\0" "gray\0" "gray0\0" "gray1\0" "gray10\0" "gray100\0" "gray11\0" "gray12\0" "gray13\0" "gray14\0" "gray15\0" "gray16\0" "gray17\0" "gray18\0" "gray19\0" "gray2\0" "gray20\0" "gray21\0" "gray22\0" "gray23\0" "gray24\0" "gray25\0" "gray26\0" "gray27\0" "gray28\0" "gray29\0" "gray3\0" "gray30\0" "gray31\0" "gray32\0" "gray33\0" "gray34\0" "gray35\0" "gray36\0" "gray37\0" "gray38\0" "gray39\0" "gray4\0" "gray40\0" "gray41\0" "gray42\0" "gray43\0" "gray44\0" "gray45\0" "gray46\0" "gray47\0" "gray48\0" "gray49\0" "gray5\0" "gray50\0" "gray51\0" "gray52\0" "gray53\0" "gray54\0" "gray55\0" "gray56\0" "gray57\0" "gray58\0" "gray59\0" "gray6\0" "gray60\0" "gray61\0" "gray62\0" "gray63\0" "gray64\0" "gray65\0" "gray66\0" "gray67\0" "gray68\0" "gray69\0" "gray7\0" "gray70\0" "gray71\0" "gray72\0" "gray73\0" "gray74\0" "gray75\0" "gray76\0" "gray77\0" "gray78\0" "gray79\0" "gray8\0" "gray80\0" "gray81\0" "gray82\0" "gray83\0" "gray84\0" "gray85\0" "gray86\0" "gray87\0" "gray88\0" "gray89\0" "gray9\0" "gray90\0" "gray91\0" "gray92\0" "gray93\0" "gray94\0" "gray95\0" "gray96\0" "gray97\0" "gray98\0" "gray99\0" "green\0" "green yellow\0" "green1\0" "green2\0" "green3\0" "green4\0" "GreenYellow\0" "grey\0" "grey0\0" "grey1\0" "grey10\0" "grey100\0" "grey11\0" "grey12\0" "grey13\0" "grey14\0" "grey15\0" "grey16\0" "grey17\0" "grey18\0" "grey19\0" "grey2\0" "grey20\0" "grey21\0" "grey22\0" "grey23\0" "grey24\0" "grey25\0" "grey26\0" "grey27\0" "grey28\0" "grey29\0" "grey3\0" "grey30\0" "grey31\0" "grey32\0" "grey33\0" "grey34\0" "grey35\0" "grey36\0" "grey37\0" "grey38\0" "grey39\0" "grey4\0" "grey40\0" "grey41\0" "grey42\0" "grey43\0" "grey44\0" "grey45\0" "grey46\0" "grey47\0" "grey48\0" "grey49\0" "grey5\0" "grey50\0" "grey51\0" "grey52\0" "grey53\0" "grey54\0" "grey55\0" "grey56\0" "grey57\0" "grey58\0" "grey59\0" "grey6\0" "grey60\0" "grey61\0" "grey62\0" "grey63\0" "grey64\0" "grey65\0" "grey66\0" "grey67\0" "grey68\0" "grey69\0" "grey7\0" "grey70\0" "grey71\0" "grey72\0" "grey73\0" "grey74\0" "grey75\0" "grey76\0" "grey77\0" "grey78\0" "grey79\0" "grey8\0" "grey80\0" "grey81\0" "grey82\0" "grey83\0" "grey84\0" "grey85\0" "grey86\0" "grey87\0" "grey88\0" "grey89\0" "grey9\0" "grey90\0" "grey91\0" "grey92\0" "grey93\0" "grey94\0" "grey95\0" "grey96\0" "grey97\0" "grey98\0" "grey99\0" "honeydew\0" "honeydew1\0" "honeydew2\0" "honeydew3\0" "honeydew4\0" "hot pink\0" "HotPink\0" "HotPink1\0" "HotPink2\0" "HotPink3\0" "HotPink4\0" "indian red\0" "IndianRed\0" "IndianRed1\0" "IndianRed2\0" "IndianRed3\0" "IndianRed4\0" "indigo\0" "ivory\0" "ivory1\0" "ivory2\0" "ivory3\0" "ivory4\0" "khaki\0" "khaki1\0" "khaki2\0" "khaki3\0" "khaki4\0" "lavender\0" "lavender blush\0" "LavenderBlush\0" "LavenderBlush1\0" "LavenderBlush2\0" "LavenderBlush3\0" "LavenderBlush4\0" "lawn green\0" "LawnGreen\0" "lemon chiffon\0" "LemonChiffon\0" "LemonChiffon1\0" "LemonChiffon2\0" "LemonChiffon3\0" "LemonChiffon4\0" "light blue\0" "light coral\0" "light cyan\0" "light goldenrod\0" "light goldenrod yellow\0" "light gray\0" "light green\0" "light grey\0" "light pink\0" "light salmon\0" "light sea green\0" "light sky blue\0" "light slate blue\0" "light slate gray\0" "light slate grey\0" "light steel blue\0" "light yellow\0" "LightBlue\0" "LightBlue1\0" "LightBlue2\0" "LightBlue3\0" "LightBlue4\0" "LightCoral\0" "LightCyan\0" "LightCyan1\0" "LightCyan2\0" "LightCyan3\0" "LightCyan4\0" "LightGoldenrod\0" "LightGoldenrod1\0" "LightGoldenrod2\0" "LightGoldenrod3\0" "LightGoldenrod4\0" "LightGoldenrodYellow\0" "LightGray\0" "LightGreen\0" "LightGrey\0" "LightPink\0" "LightPink1\0" "LightPink2\0" "LightPink3\0" "LightPink4\0" "LightSalmon\0" "LightSalmon1\0" "LightSalmon2\0" "LightSalmon3\0" "LightSalmon4\0" "LightSeaGreen\0" "LightSkyBlue\0" "LightSkyBlue1\0" "LightSkyBlue2\0" "LightSkyBlue3\0" "LightSkyBlue4\0" "LightSlateBlue\0" "LightSlateGray\0" "LightSlateGrey\0" "LightSteelBlue\0" "LightSteelBlue1\0" "LightSteelBlue2\0" "LightSteelBlue3\0" "LightSteelBlue4\0" "LightYellow\0" "LightYellow1\0" "LightYellow2\0" "LightYellow3\0" "LightYellow4\0" "lime\0" "lime green\0" "LimeGreen\0" "linen\0" "magenta\0" "magenta1\0" "magenta2\0" "magenta3\0" "magenta4\0" "maroon\0" "maroon1\0" "maroon2\0" "maroon3\0" "maroon4\0" "medium aquamarine\0" "medium blue\0" "medium orchid\0" "medium purple\0" "medium sea green\0" "medium slate blue\0" "medium spring green\0" "medium turquoise\0" "medium violet red\0" "MediumAquamarine\0" "MediumBlue\0" "MediumOrchid\0" "MediumOrchid1\0" "MediumOrchid2\0" "MediumOrchid3\0" "MediumOrchid4\0" "MediumPurple\0" "MediumPurple1\0" "MediumPurple2\0" "MediumPurple3\0" "MediumPurple4\0" "MediumSeaGreen\0" "MediumSlateBlue\0" "MediumSpringGreen\0" "MediumTurquoise\0" "MediumVioletRed\0" "midnight blue\0" "MidnightBlue\0" "mint cream\0" "MintCream\0" "misty rose\0" "MistyRose\0" "MistyRose1\0" "MistyRose2\0" "MistyRose3\0" "MistyRose4\0" "moccasin\0" "navajo white\0" "NavajoWhite\0" "NavajoWhite1\0" "NavajoWhite2\0" "NavajoWhite3\0" "NavajoWhite4\0" "navy\0" "navy blue\0" "NavyBlue\0" "old lace\0" "OldLace\0" "olive\0" "olive drab\0" "OliveDrab\0" "OliveDrab1\0" "OliveDrab2\0" "OliveDrab3\0" "OliveDrab4\0" "orange\0" "orange red\0" "orange1\0" "orange2\0" "orange3\0" "orange4\0" "OrangeRed\0" "OrangeRed1\0" "OrangeRed2\0" "OrangeRed3\0" "OrangeRed4\0" "orchid\0" "orchid1\0" "orchid2\0" "orchid3\0" "orchid4\0" "pale goldenrod\0" "pale green\0" "pale turquoise\0" "pale violet red\0" "PaleGoldenrod\0" "PaleGreen\0" "PaleGreen1\0" "PaleGreen2\0" "PaleGreen3\0" "PaleGreen4\0" "PaleTurquoise\0" "PaleTurquoise1\0" "PaleTurquoise2\0" "PaleTurquoise3\0" "PaleTurquoise4\0" "PaleVioletRed\0" "PaleVioletRed1\0" "PaleVioletRed2\0" "PaleVioletRed3\0" "PaleVioletRed4\0" "papaya whip\0" "PapayaWhip\0" "peach puff\0" "PeachPuff\0" "PeachPuff1\0" "PeachPuff2\0" "PeachPuff3\0" "PeachPuff4\0" "peru\0" "pink\0" "pink1\0" "pink2\0" "pink3\0" "pink4\0" "plum\0" "plum1\0" "plum2\0" "plum3\0" "plum4\0" "powder blue\0" "PowderBlue\0" "purple\0" "purple1\0" "purple2\0" "purple3\0" "purple4\0" "rebecca purple\0" "RebeccaPurple\0" "red\0" "red1\0" "red2\0" "red3\0" "red4\0" "rosy brown\0" "RosyBrown\0" "RosyBrown1\0" "RosyBrown2\0" "RosyBrown3\0" "RosyBrown4\0" "royal blue\0" "RoyalBlue\0" "RoyalBlue1\0" "RoyalBlue2\0" "RoyalBlue3\0" "RoyalBlue4\0" "saddle brown\0" "SaddleBrown\0" "salmon\0" "salmon1\0" "salmon2\0" "salmon3\0" "salmon4\0" "sandy brown\0" "SandyBrown\0" "sea green\0" "SeaGreen\0" "SeaGreen1\0" "SeaGreen2\0" "SeaGreen3\0" "SeaGreen4\0" "seashell\0" "seashell1\0" "seashell2\0" "seashell3\0" "seashell4\0" "sienna\0" "sienna1\0" "sienna2\0" "sienna3\0" "sienna4\0" "silver\0" "sky blue\0" "SkyBlue\0" "SkyBlue1\0" "SkyBlue2\0" "SkyBlue3\0" "SkyBlue4\0" "slate blue\0" "slate gray\0" "slate grey\0" "SlateBlue\0" "SlateBlue1\0" "SlateBlue2\0" "SlateBlue3\0" "SlateBlue4\0" "SlateGray\0" "SlateGray1\0" "SlateGray2\0" "SlateGray3\0" "SlateGray4\0" "SlateGrey\0" "snow\0" "snow1\0" "snow2\0" "snow3\0" "snow4\0" "spring green\0" "SpringGreen\0" "SpringGreen1\0" "SpringGreen2\0" "SpringGreen3\0" "SpringGreen4\0" "steel blue\0" "SteelBlue\0" "SteelBlue1\0" "SteelBlue2\0" "SteelBlue3\0" "SteelBlue4\0" "tan\0" "tan1\0" "tan2\0" "tan3\0" "tan4\0" "teal\0" "thistle\0" "thistle1\0" "thistle2\0" "thistle3\0" "thistle4\0" "tomato\0" "tomato1\0" "tomato2\0" "tomato3\0" "tomato4\0" "turquoise\0" "turquoise1\0" "turquoise2\0" "turquoise3\0" "turquoise4\0" "violet\0" "violet red\0" "VioletRed\0" "VioletRed1\0" "VioletRed2\0" "VioletRed3\0" "VioletRed4\0" "web gray\0" "web green\0" "web grey\0" "web maroon\0" "web purple\0" "WebGray\0" "WebGreen\0" "WebGrey\0" "WebMaroon\0" "WebPurple\0" "wheat\0" "wheat1\0" "wheat2\0" "wheat3\0" "wheat4\0" "white\0" "white smoke\0" "WhiteSmoke\0" "x11 gray\0" "x11 green\0" "x11 grey\0" "x11 maroon\0" "x11 purple\0" "X11Gray\0" "X11Green\0" "X11Grey\0" "X11Maroon\0" "X11Purple\0" "yellow\0" "yellow green\0" "yellow1\0" "yellow2\0" "yellow3\0" "yellow4\0" "YellowGreen\0" }; static const BuiltinColor BuiltinColors[] = { {240, 248, 255, 0}, /* alice blue */ {240, 248, 255, 11}, /* AliceBlue */ {250, 235, 215, 21}, /* antique white */ {250, 235, 215, 35}, /* AntiqueWhite */ {255, 239, 219, 48}, /* AntiqueWhite1 */ {238, 223, 204, 62}, /* AntiqueWhite2 */ {205, 192, 176, 76}, /* AntiqueWhite3 */ {139, 131, 120, 90}, /* AntiqueWhite4 */ {0, 255, 255, 104}, /* aqua */ {127, 255, 212, 109}, /* aquamarine */ {127, 255, 212, 120}, /* aquamarine1 */ {118, 238, 198, 132}, /* aquamarine2 */ {102, 205, 170, 144}, /* aquamarine3 */ {69, 139, 116, 156}, /* aquamarine4 */ {240, 255, 255, 168}, /* azure */ {240, 255, 255, 174}, /* azure1 */ {224, 238, 238, 181}, /* azure2 */ {193, 205, 205, 188}, /* azure3 */ {131, 139, 139, 195}, /* azure4 */ {245, 245, 220, 202}, /* beige */ {255, 228, 196, 208}, /* bisque */ {255, 228, 196, 215}, /* bisque1 */ {238, 213, 183, 223}, /* bisque2 */ {205, 183, 158, 231}, /* bisque3 */ {139, 125, 107, 239}, /* bisque4 */ {0, 0, 0, 247}, /* black */ {255, 235, 205, 253}, /* blanched almond */ {255, 235, 205, 269}, /* BlanchedAlmond */ {0, 0, 255, 284}, /* blue */ {138, 43, 226, 289}, /* blue violet */ {0, 0, 255, 301}, /* blue1 */ {0, 0, 238, 307}, /* blue2 */ {0, 0, 205, 313}, /* blue3 */ {0, 0, 139, 319}, /* blue4 */ {138, 43, 226, 325}, /* BlueViolet */ {165, 42, 42, 336}, /* brown */ {255, 64, 64, 342}, /* brown1 */ {238, 59, 59, 349}, /* brown2 */ {205, 51, 51, 356}, /* brown3 */ {139, 35, 35, 363}, /* brown4 */ {222, 184, 135, 370}, /* burlywood */ {255, 211, 155, 380}, /* burlywood1 */ {238, 197, 145, 391}, /* burlywood2 */ {205, 170, 125, 402}, /* burlywood3 */ {139, 115, 85, 413}, /* burlywood4 */ {95, 158, 160, 424}, /* cadet blue */ {95, 158, 160, 435}, /* CadetBlue */ {152, 245, 255, 445}, /* CadetBlue1 */ {142, 229, 238, 456}, /* CadetBlue2 */ {122, 197, 205, 467}, /* CadetBlue3 */ {83, 134, 139, 478}, /* CadetBlue4 */ {127, 255, 0, 489}, /* chartreuse */ {127, 255, 0, 500}, /* chartreuse1 */ {118, 238, 0, 512}, /* chartreuse2 */ {102, 205, 0, 524}, /* chartreuse3 */ {69, 139, 0, 536}, /* chartreuse4 */ {210, 105, 30, 548}, /* chocolate */ {255, 127, 36, 558}, /* chocolate1 */ {238, 118, 33, 569}, /* chocolate2 */ {205, 102, 29, 580}, /* chocolate3 */ {139, 69, 19, 591}, /* chocolate4 */ {255, 127, 80, 602}, /* coral */ {255, 114, 86, 608}, /* coral1 */ {238, 106, 80, 615}, /* coral2 */ {205, 91, 69, 622}, /* coral3 */ {139, 62, 47, 629}, /* coral4 */ {100, 149, 237, 636}, /* cornflower blue */ {100, 149, 237, 652}, /* CornflowerBlue */ {255, 248, 220, 667}, /* cornsilk */ {255, 248, 220, 676}, /* cornsilk1 */ {238, 232, 205, 686}, /* cornsilk2 */ {205, 200, 177, 696}, /* cornsilk3 */ {139, 136, 120, 706}, /* cornsilk4 */ {220, 20, 60, 716}, /* crimson */ {0, 255, 255, 724}, /* cyan */ {0, 255, 255, 729}, /* cyan1 */ {0, 238, 238, 735}, /* cyan2 */ {0, 205, 205, 741}, /* cyan3 */ {0, 139, 139, 747}, /* cyan4 */ {0, 0, 139, 753}, /* dark blue */ {0, 139, 139, 763}, /* dark cyan */ {184, 134, 11, 773}, /* dark goldenrod */ {169, 169, 169, 788}, /* dark gray */ {0, 100, 0, 798}, /* dark green */ {169, 169, 169, 809}, /* dark grey */ {189, 183, 107, 819}, /* dark khaki */ {139, 0, 139, 830}, /* dark magenta */ {85, 107, 47, 843}, /* dark olive green */ {255, 140, 0, 860}, /* dark orange */ {153, 50, 204, 872}, /* dark orchid */ {139, 0, 0, 884}, /* dark red */ {233, 150, 122, 893}, /* dark salmon */ {143, 188, 143, 905}, /* dark sea green */ {72, 61, 139, 920}, /* dark slate blue */ {47, 79, 79, 936}, /* dark slate gray */ {47, 79, 79, 952}, /* dark slate grey */ {0, 206, 209, 968}, /* dark turquoise */ {148, 0, 211, 983}, /* dark violet */ {0, 0, 139, 995}, /* DarkBlue */ {0, 139, 139, 1004}, /* DarkCyan */ {184, 134, 11, 1013}, /* DarkGoldenrod */ {255, 185, 15, 1027}, /* DarkGoldenrod1 */ {238, 173, 14, 1042}, /* DarkGoldenrod2 */ {205, 149, 12, 1057}, /* DarkGoldenrod3 */ {139, 101, 8, 1072}, /* DarkGoldenrod4 */ {169, 169, 169, 1087}, /* DarkGray */ {0, 100, 0, 1096}, /* DarkGreen */ {169, 169, 169, 1106}, /* DarkGrey */ {189, 183, 107, 1115}, /* DarkKhaki */ {139, 0, 139, 1125}, /* DarkMagenta */ {85, 107, 47, 1137}, /* DarkOliveGreen */ {202, 255, 112, 1152}, /* DarkOliveGreen1 */ {188, 238, 104, 1168}, /* DarkOliveGreen2 */ {162, 205, 90, 1184}, /* DarkOliveGreen3 */ {110, 139, 61, 1200}, /* DarkOliveGreen4 */ {255, 140, 0, 1216}, /* DarkOrange */ {255, 127, 0, 1227}, /* DarkOrange1 */ {238, 118, 0, 1239}, /* DarkOrange2 */ {205, 102, 0, 1251}, /* DarkOrange3 */ {139, 69, 0, 1263}, /* DarkOrange4 */ {153, 50, 204, 1275}, /* DarkOrchid */ {191, 62, 255, 1286}, /* DarkOrchid1 */ {178, 58, 238, 1298}, /* DarkOrchid2 */ {154, 50, 205, 1310}, /* DarkOrchid3 */ {104, 34, 139, 1322}, /* DarkOrchid4 */ {139, 0, 0, 1334}, /* DarkRed */ {233, 150, 122, 1342}, /* DarkSalmon */ {143, 188, 143, 1353}, /* DarkSeaGreen */ {193, 255, 193, 1366}, /* DarkSeaGreen1 */ {180, 238, 180, 1380}, /* DarkSeaGreen2 */ {155, 205, 155, 1394}, /* DarkSeaGreen3 */ {105, 139, 105, 1408}, /* DarkSeaGreen4 */ {72, 61, 139, 1422}, /* DarkSlateBlue */ {47, 79, 79, 1436}, /* DarkSlateGray */ {151, 255, 255, 1450}, /* DarkSlateGray1 */ {141, 238, 238, 1465}, /* DarkSlateGray2 */ {121, 205, 205, 1480}, /* DarkSlateGray3 */ {82, 139, 139, 1495}, /* DarkSlateGray4 */ {47, 79, 79, 1510}, /* DarkSlateGrey */ {0, 206, 209, 1524}, /* DarkTurquoise */ {148, 0, 211, 1538}, /* DarkViolet */ {255, 20, 147, 1549}, /* deep pink */ {0, 191, 255, 1559}, /* deep sky blue */ {255, 20, 147, 1573}, /* DeepPink */ {255, 20, 147, 1582}, /* DeepPink1 */ {238, 18, 137, 1592}, /* DeepPink2 */ {205, 16, 118, 1602}, /* DeepPink3 */ {139, 10, 80, 1612}, /* DeepPink4 */ {0, 191, 255, 1622}, /* DeepSkyBlue */ {0, 191, 255, 1634}, /* DeepSkyBlue1 */ {0, 178, 238, 1647}, /* DeepSkyBlue2 */ {0, 154, 205, 1660}, /* DeepSkyBlue3 */ {0, 104, 139, 1673}, /* DeepSkyBlue4 */ {105, 105, 105, 1686}, /* dim gray */ {105, 105, 105, 1695}, /* dim grey */ {105, 105, 105, 1704}, /* DimGray */ {105, 105, 105, 1712}, /* DimGrey */ {30, 144, 255, 1720}, /* dodger blue */ {30, 144, 255, 1732}, /* DodgerBlue */ {30, 144, 255, 1743}, /* DodgerBlue1 */ {28, 134, 238, 1755}, /* DodgerBlue2 */ {24, 116, 205, 1767}, /* DodgerBlue3 */ {16, 78, 139, 1779}, /* DodgerBlue4 */ {178, 34, 34, 1791}, /* firebrick */ {255, 48, 48, 1801}, /* firebrick1 */ {238, 44, 44, 1812}, /* firebrick2 */ {205, 38, 38, 1823}, /* firebrick3 */ {139, 26, 26, 1834}, /* firebrick4 */ {255, 250, 240, 1845}, /* floral white */ {255, 250, 240, 1858}, /* FloralWhite */ {34, 139, 34, 1870}, /* forest green */ {34, 139, 34, 1883}, /* ForestGreen */ {255, 0, 255, 1895}, /* fuchsia */ {220, 220, 220, 1903}, /* gainsboro */ {248, 248, 255, 1913}, /* ghost white */ {248, 248, 255, 1925}, /* GhostWhite */ {255, 215, 0, 1936}, /* gold */ {255, 215, 0, 1941}, /* gold1 */ {238, 201, 0, 1947}, /* gold2 */ {205, 173, 0, 1953}, /* gold3 */ {139, 117, 0, 1959}, /* gold4 */ {218, 165, 32, 1965}, /* goldenrod */ {255, 193, 37, 1975}, /* goldenrod1 */ {238, 180, 34, 1986}, /* goldenrod2 */ {205, 155, 29, 1997}, /* goldenrod3 */ {139, 105, 20, 2008}, /* goldenrod4 */ {190, 190, 190, 2019}, /* gray */ {0, 0, 0, 2024}, /* gray0 */ {3, 3, 3, 2030}, /* gray1 */ {26, 26, 26, 2036}, /* gray10 */ {255, 255, 255, 2043}, /* gray100 */ {28, 28, 28, 2051}, /* gray11 */ {31, 31, 31, 2058}, /* gray12 */ {33, 33, 33, 2065}, /* gray13 */ {36, 36, 36, 2072}, /* gray14 */ {38, 38, 38, 2079}, /* gray15 */ {41, 41, 41, 2086}, /* gray16 */ {43, 43, 43, 2093}, /* gray17 */ {46, 46, 46, 2100}, /* gray18 */ {48, 48, 48, 2107}, /* gray19 */ {5, 5, 5, 2114}, /* gray2 */ {51, 51, 51, 2120}, /* gray20 */ {54, 54, 54, 2127}, /* gray21 */ {56, 56, 56, 2134}, /* gray22 */ {59, 59, 59, 2141}, /* gray23 */ {61, 61, 61, 2148}, /* gray24 */ {64, 64, 64, 2155}, /* gray25 */ {66, 66, 66, 2162}, /* gray26 */ {69, 69, 69, 2169}, /* gray27 */ {71, 71, 71, 2176}, /* gray28 */ {74, 74, 74, 2183}, /* gray29 */ {8, 8, 8, 2190}, /* gray3 */ {77, 77, 77, 2196}, /* gray30 */ {79, 79, 79, 2203}, /* gray31 */ {82, 82, 82, 2210}, /* gray32 */ {84, 84, 84, 2217}, /* gray33 */ {87, 87, 87, 2224}, /* gray34 */ {89, 89, 89, 2231}, /* gray35 */ {92, 92, 92, 2238}, /* gray36 */ {94, 94, 94, 2245}, /* gray37 */ {97, 97, 97, 2252}, /* gray38 */ {99, 99, 99, 2259}, /* gray39 */ {10, 10, 10, 2266}, /* gray4 */ {102, 102, 102, 2272}, /* gray40 */ {105, 105, 105, 2279}, /* gray41 */ {107, 107, 107, 2286}, /* gray42 */ {110, 110, 110, 2293}, /* gray43 */ {112, 112, 112, 2300}, /* gray44 */ {115, 115, 115, 2307}, /* gray45 */ {117, 117, 117, 2314}, /* gray46 */ {120, 120, 120, 2321}, /* gray47 */ {122, 122, 122, 2328}, /* gray48 */ {125, 125, 125, 2335}, /* gray49 */ {13, 13, 13, 2342}, /* gray5 */ {127, 127, 127, 2348}, /* gray50 */ {130, 130, 130, 2355}, /* gray51 */ {133, 133, 133, 2362}, /* gray52 */ {135, 135, 135, 2369}, /* gray53 */ {138, 138, 138, 2376}, /* gray54 */ {140, 140, 140, 2383}, /* gray55 */ {143, 143, 143, 2390}, /* gray56 */ {145, 145, 145, 2397}, /* gray57 */ {148, 148, 148, 2404}, /* gray58 */ {150, 150, 150, 2411}, /* gray59 */ {15, 15, 15, 2418}, /* gray6 */ {153, 153, 153, 2424}, /* gray60 */ {156, 156, 156, 2431}, /* gray61 */ {158, 158, 158, 2438}, /* gray62 */ {161, 161, 161, 2445}, /* gray63 */ {163, 163, 163, 2452}, /* gray64 */ {166, 166, 166, 2459}, /* gray65 */ {168, 168, 168, 2466}, /* gray66 */ {171, 171, 171, 2473}, /* gray67 */ {173, 173, 173, 2480}, /* gray68 */ {176, 176, 176, 2487}, /* gray69 */ {18, 18, 18, 2494}, /* gray7 */ {179, 179, 179, 2500}, /* gray70 */ {181, 181, 181, 2507}, /* gray71 */ {184, 184, 184, 2514}, /* gray72 */ {186, 186, 186, 2521}, /* gray73 */ {189, 189, 189, 2528}, /* gray74 */ {191, 191, 191, 2535}, /* gray75 */ {194, 194, 194, 2542}, /* gray76 */ {196, 196, 196, 2549}, /* gray77 */ {199, 199, 199, 2556}, /* gray78 */ {201, 201, 201, 2563}, /* gray79 */ {20, 20, 20, 2570}, /* gray8 */ {204, 204, 204, 2576}, /* gray80 */ {207, 207, 207, 2583}, /* gray81 */ {209, 209, 209, 2590}, /* gray82 */ {212, 212, 212, 2597}, /* gray83 */ {214, 214, 214, 2604}, /* gray84 */ {217, 217, 217, 2611}, /* gray85 */ {219, 219, 219, 2618}, /* gray86 */ {222, 222, 222, 2625}, /* gray87 */ {224, 224, 224, 2632}, /* gray88 */ {227, 227, 227, 2639}, /* gray89 */ {23, 23, 23, 2646}, /* gray9 */ {229, 229, 229, 2652}, /* gray90 */ {232, 232, 232, 2659}, /* gray91 */ {235, 235, 235, 2666}, /* gray92 */ {237, 237, 237, 2673}, /* gray93 */ {240, 240, 240, 2680}, /* gray94 */ {242, 242, 242, 2687}, /* gray95 */ {245, 245, 245, 2694}, /* gray96 */ {247, 247, 247, 2701}, /* gray97 */ {250, 250, 250, 2708}, /* gray98 */ {252, 252, 252, 2715}, /* gray99 */ {0, 255, 0, 2722}, /* green */ {173, 255, 47, 2728}, /* green yellow */ {0, 255, 0, 2741}, /* green1 */ {0, 238, 0, 2748}, /* green2 */ {0, 205, 0, 2755}, /* green3 */ {0, 139, 0, 2762}, /* green4 */ {173, 255, 47, 2769}, /* GreenYellow */ {190, 190, 190, 2781}, /* grey */ {0, 0, 0, 2786}, /* grey0 */ {3, 3, 3, 2792}, /* grey1 */ {26, 26, 26, 2798}, /* grey10 */ {255, 255, 255, 2805}, /* grey100 */ {28, 28, 28, 2813}, /* grey11 */ {31, 31, 31, 2820}, /* grey12 */ {33, 33, 33, 2827}, /* grey13 */ {36, 36, 36, 2834}, /* grey14 */ {38, 38, 38, 2841}, /* grey15 */ {41, 41, 41, 2848}, /* grey16 */ {43, 43, 43, 2855}, /* grey17 */ {46, 46, 46, 2862}, /* grey18 */ {48, 48, 48, 2869}, /* grey19 */ {5, 5, 5, 2876}, /* grey2 */ {51, 51, 51, 2882}, /* grey20 */ {54, 54, 54, 2889}, /* grey21 */ {56, 56, 56, 2896}, /* grey22 */ {59, 59, 59, 2903}, /* grey23 */ {61, 61, 61, 2910}, /* grey24 */ {64, 64, 64, 2917}, /* grey25 */ {66, 66, 66, 2924}, /* grey26 */ {69, 69, 69, 2931}, /* grey27 */ {71, 71, 71, 2938}, /* grey28 */ {74, 74, 74, 2945}, /* grey29 */ {8, 8, 8, 2952}, /* grey3 */ {77, 77, 77, 2958}, /* grey30 */ {79, 79, 79, 2965}, /* grey31 */ {82, 82, 82, 2972}, /* grey32 */ {84, 84, 84, 2979}, /* grey33 */ {87, 87, 87, 2986}, /* grey34 */ {89, 89, 89, 2993}, /* grey35 */ {92, 92, 92, 3000}, /* grey36 */ {94, 94, 94, 3007}, /* grey37 */ {97, 97, 97, 3014}, /* grey38 */ {99, 99, 99, 3021}, /* grey39 */ {10, 10, 10, 3028}, /* grey4 */ {102, 102, 102, 3034}, /* grey40 */ {105, 105, 105, 3041}, /* grey41 */ {107, 107, 107, 3048}, /* grey42 */ {110, 110, 110, 3055}, /* grey43 */ {112, 112, 112, 3062}, /* grey44 */ {115, 115, 115, 3069}, /* grey45 */ {117, 117, 117, 3076}, /* grey46 */ {120, 120, 120, 3083}, /* grey47 */ {122, 122, 122, 3090}, /* grey48 */ {125, 125, 125, 3097}, /* grey49 */ {13, 13, 13, 3104}, /* grey5 */ {127, 127, 127, 3110}, /* grey50 */ {130, 130, 130, 3117}, /* grey51 */ {133, 133, 133, 3124}, /* grey52 */ {135, 135, 135, 3131}, /* grey53 */ {138, 138, 138, 3138}, /* grey54 */ {140, 140, 140, 3145}, /* grey55 */ {143, 143, 143, 3152}, /* grey56 */ {145, 145, 145, 3159}, /* grey57 */ {148, 148, 148, 3166}, /* grey58 */ {150, 150, 150, 3173}, /* grey59 */ {15, 15, 15, 3180}, /* grey6 */ {153, 153, 153, 3186}, /* grey60 */ {156, 156, 156, 3193}, /* grey61 */ {158, 158, 158, 3200}, /* grey62 */ {161, 161, 161, 3207}, /* grey63 */ {163, 163, 163, 3214}, /* grey64 */ {166, 166, 166, 3221}, /* grey65 */ {168, 168, 168, 3228}, /* grey66 */ {171, 171, 171, 3235}, /* grey67 */ {173, 173, 173, 3242}, /* grey68 */ {176, 176, 176, 3249}, /* grey69 */ {18, 18, 18, 3256}, /* grey7 */ {179, 179, 179, 3262}, /* grey70 */ {181, 181, 181, 3269}, /* grey71 */ {184, 184, 184, 3276}, /* grey72 */ {186, 186, 186, 3283}, /* grey73 */ {189, 189, 189, 3290}, /* grey74 */ {191, 191, 191, 3297}, /* grey75 */ {194, 194, 194, 3304}, /* grey76 */ {196, 196, 196, 3311}, /* grey77 */ {199, 199, 199, 3318}, /* grey78 */ {201, 201, 201, 3325}, /* grey79 */ {20, 20, 20, 3332}, /* grey8 */ {204, 204, 204, 3338}, /* grey80 */ {207, 207, 207, 3345}, /* grey81 */ {209, 209, 209, 3352}, /* grey82 */ {212, 212, 212, 3359}, /* grey83 */ {214, 214, 214, 3366}, /* grey84 */ {217, 217, 217, 3373}, /* grey85 */ {219, 219, 219, 3380}, /* grey86 */ {222, 222, 222, 3387}, /* grey87 */ {224, 224, 224, 3394}, /* grey88 */ {227, 227, 227, 3401}, /* grey89 */ {23, 23, 23, 3408}, /* grey9 */ {229, 229, 229, 3414}, /* grey90 */ {232, 232, 232, 3421}, /* grey91 */ {235, 235, 235, 3428}, /* grey92 */ {237, 237, 237, 3435}, /* grey93 */ {240, 240, 240, 3442}, /* grey94 */ {242, 242, 242, 3449}, /* grey95 */ {245, 245, 245, 3456}, /* grey96 */ {247, 247, 247, 3463}, /* grey97 */ {250, 250, 250, 3470}, /* grey98 */ {252, 252, 252, 3477}, /* grey99 */ {240, 255, 240, 3484}, /* honeydew */ {240, 255, 240, 3493}, /* honeydew1 */ {224, 238, 224, 3503}, /* honeydew2 */ {193, 205, 193, 3513}, /* honeydew3 */ {131, 139, 131, 3523}, /* honeydew4 */ {255, 105, 180, 3533}, /* hot pink */ {255, 105, 180, 3542}, /* HotPink */ {255, 110, 180, 3550}, /* HotPink1 */ {238, 106, 167, 3559}, /* HotPink2 */ {205, 96, 144, 3568}, /* HotPink3 */ {139, 58, 98, 3577}, /* HotPink4 */ {205, 92, 92, 3586}, /* indian red */ {205, 92, 92, 3597}, /* IndianRed */ {255, 106, 106, 3607}, /* IndianRed1 */ {238, 99, 99, 3618}, /* IndianRed2 */ {205, 85, 85, 3629}, /* IndianRed3 */ {139, 58, 58, 3640}, /* IndianRed4 */ {75, 0, 130, 3651}, /* indigo */ {255, 255, 240, 3658}, /* ivory */ {255, 255, 240, 3664}, /* ivory1 */ {238, 238, 224, 3671}, /* ivory2 */ {205, 205, 193, 3678}, /* ivory3 */ {139, 139, 131, 3685}, /* ivory4 */ {240, 230, 140, 3692}, /* khaki */ {255, 246, 143, 3698}, /* khaki1 */ {238, 230, 133, 3705}, /* khaki2 */ {205, 198, 115, 3712}, /* khaki3 */ {139, 134, 78, 3719}, /* khaki4 */ {230, 230, 250, 3726}, /* lavender */ {255, 240, 245, 3735}, /* lavender blush */ {255, 240, 245, 3750}, /* LavenderBlush */ {255, 240, 245, 3764}, /* LavenderBlush1 */ {238, 224, 229, 3779}, /* LavenderBlush2 */ {205, 193, 197, 3794}, /* LavenderBlush3 */ {139, 131, 134, 3809}, /* LavenderBlush4 */ {124, 252, 0, 3824}, /* lawn green */ {124, 252, 0, 3835}, /* LawnGreen */ {255, 250, 205, 3845}, /* lemon chiffon */ {255, 250, 205, 3859}, /* LemonChiffon */ {255, 250, 205, 3872}, /* LemonChiffon1 */ {238, 233, 191, 3886}, /* LemonChiffon2 */ {205, 201, 165, 3900}, /* LemonChiffon3 */ {139, 137, 112, 3914}, /* LemonChiffon4 */ {173, 216, 230, 3928}, /* light blue */ {240, 128, 128, 3939}, /* light coral */ {224, 255, 255, 3951}, /* light cyan */ {238, 221, 130, 3962}, /* light goldenrod */ {250, 250, 210, 3978}, /* light goldenrod yellow */ {211, 211, 211, 4001}, /* light gray */ {144, 238, 144, 4012}, /* light green */ {211, 211, 211, 4024}, /* light grey */ {255, 182, 193, 4035}, /* light pink */ {255, 160, 122, 4046}, /* light salmon */ {32, 178, 170, 4059}, /* light sea green */ {135, 206, 250, 4075}, /* light sky blue */ {132, 112, 255, 4090}, /* light slate blue */ {119, 136, 153, 4107}, /* light slate gray */ {119, 136, 153, 4124}, /* light slate grey */ {176, 196, 222, 4141}, /* light steel blue */ {255, 255, 224, 4158}, /* light yellow */ {173, 216, 230, 4171}, /* LightBlue */ {191, 239, 255, 4181}, /* LightBlue1 */ {178, 223, 238, 4192}, /* LightBlue2 */ {154, 192, 205, 4203}, /* LightBlue3 */ {104, 131, 139, 4214}, /* LightBlue4 */ {240, 128, 128, 4225}, /* LightCoral */ {224, 255, 255, 4236}, /* LightCyan */ {224, 255, 255, 4246}, /* LightCyan1 */ {209, 238, 238, 4257}, /* LightCyan2 */ {180, 205, 205, 4268}, /* LightCyan3 */ {122, 139, 139, 4279}, /* LightCyan4 */ {238, 221, 130, 4290}, /* LightGoldenrod */ {255, 236, 139, 4305}, /* LightGoldenrod1 */ {238, 220, 130, 4321}, /* LightGoldenrod2 */ {205, 190, 112, 4337}, /* LightGoldenrod3 */ {139, 129, 76, 4353}, /* LightGoldenrod4 */ {250, 250, 210, 4369}, /* LightGoldenrodYellow */ {211, 211, 211, 4390}, /* LightGray */ {144, 238, 144, 4400}, /* LightGreen */ {211, 211, 211, 4411}, /* LightGrey */ {255, 182, 193, 4421}, /* LightPink */ {255, 174, 185, 4431}, /* LightPink1 */ {238, 162, 173, 4442}, /* LightPink2 */ {205, 140, 149, 4453}, /* LightPink3 */ {139, 95, 101, 4464}, /* LightPink4 */ {255, 160, 122, 4475}, /* LightSalmon */ {255, 160, 122, 4487}, /* LightSalmon1 */ {238, 149, 114, 4500}, /* LightSalmon2 */ {205, 129, 98, 4513}, /* LightSalmon3 */ {139, 87, 66, 4526}, /* LightSalmon4 */ {32, 178, 170, 4539}, /* LightSeaGreen */ {135, 206, 250, 4553}, /* LightSkyBlue */ {176, 226, 255, 4566}, /* LightSkyBlue1 */ {164, 211, 238, 4580}, /* LightSkyBlue2 */ {141, 182, 205, 4594}, /* LightSkyBlue3 */ {96, 123, 139, 4608}, /* LightSkyBlue4 */ {132, 112, 255, 4622}, /* LightSlateBlue */ {119, 136, 153, 4637}, /* LightSlateGray */ {119, 136, 153, 4652}, /* LightSlateGrey */ {176, 196, 222, 4667}, /* LightSteelBlue */ {202, 225, 255, 4682}, /* LightSteelBlue1 */ {188, 210, 238, 4698}, /* LightSteelBlue2 */ {162, 181, 205, 4714}, /* LightSteelBlue3 */ {110, 123, 139, 4730}, /* LightSteelBlue4 */ {255, 255, 224, 4746}, /* LightYellow */ {255, 255, 224, 4758}, /* LightYellow1 */ {238, 238, 209, 4771}, /* LightYellow2 */ {205, 205, 180, 4784}, /* LightYellow3 */ {139, 139, 122, 4797}, /* LightYellow4 */ {0, 255, 0, 4810}, /* lime */ {50, 205, 50, 4815}, /* lime green */ {50, 205, 50, 4826}, /* LimeGreen */ {250, 240, 230, 4836}, /* linen */ {255, 0, 255, 4842}, /* magenta */ {255, 0, 255, 4850}, /* magenta1 */ {238, 0, 238, 4859}, /* magenta2 */ {205, 0, 205, 4868}, /* magenta3 */ {139, 0, 139, 4877}, /* magenta4 */ {176, 48, 96, 4886}, /* maroon */ {255, 52, 179, 4893}, /* maroon1 */ {238, 48, 167, 4901}, /* maroon2 */ {205, 41, 144, 4909}, /* maroon3 */ {139, 28, 98, 4917}, /* maroon4 */ {102, 205, 170, 4925}, /* medium aquamarine */ {0, 0, 205, 4943}, /* medium blue */ {186, 85, 211, 4955}, /* medium orchid */ {147, 112, 219, 4969}, /* medium purple */ {60, 179, 113, 4983}, /* medium sea green */ {123, 104, 238, 5000}, /* medium slate blue */ {0, 250, 154, 5018}, /* medium spring green */ {72, 209, 204, 5038}, /* medium turquoise */ {199, 21, 133, 5055}, /* medium violet red */ {102, 205, 170, 5073}, /* MediumAquamarine */ {0, 0, 205, 5090}, /* MediumBlue */ {186, 85, 211, 5101}, /* MediumOrchid */ {224, 102, 255, 5114}, /* MediumOrchid1 */ {209, 95, 238, 5128}, /* MediumOrchid2 */ {180, 82, 205, 5142}, /* MediumOrchid3 */ {122, 55, 139, 5156}, /* MediumOrchid4 */ {147, 112, 219, 5170}, /* MediumPurple */ {171, 130, 255, 5183}, /* MediumPurple1 */ {159, 121, 238, 5197}, /* MediumPurple2 */ {137, 104, 205, 5211}, /* MediumPurple3 */ {93, 71, 139, 5225}, /* MediumPurple4 */ {60, 179, 113, 5239}, /* MediumSeaGreen */ {123, 104, 238, 5254}, /* MediumSlateBlue */ {0, 250, 154, 5270}, /* MediumSpringGreen */ {72, 209, 204, 5288}, /* MediumTurquoise */ {199, 21, 133, 5304}, /* MediumVioletRed */ {25, 25, 112, 5320}, /* midnight blue */ {25, 25, 112, 5334}, /* MidnightBlue */ {245, 255, 250, 5347}, /* mint cream */ {245, 255, 250, 5358}, /* MintCream */ {255, 228, 225, 5368}, /* misty rose */ {255, 228, 225, 5379}, /* MistyRose */ {255, 228, 225, 5389}, /* MistyRose1 */ {238, 213, 210, 5400}, /* MistyRose2 */ {205, 183, 181, 5411}, /* MistyRose3 */ {139, 125, 123, 5422}, /* MistyRose4 */ {255, 228, 181, 5433}, /* moccasin */ {255, 222, 173, 5442}, /* navajo white */ {255, 222, 173, 5455}, /* NavajoWhite */ {255, 222, 173, 5467}, /* NavajoWhite1 */ {238, 207, 161, 5480}, /* NavajoWhite2 */ {205, 179, 139, 5493}, /* NavajoWhite3 */ {139, 121, 94, 5506}, /* NavajoWhite4 */ {0, 0, 128, 5519}, /* navy */ {0, 0, 128, 5524}, /* navy blue */ {0, 0, 128, 5534}, /* NavyBlue */ {253, 245, 230, 5543}, /* old lace */ {253, 245, 230, 5552}, /* OldLace */ {128, 128, 0, 5560}, /* olive */ {107, 142, 35, 5566}, /* olive drab */ {107, 142, 35, 5577}, /* OliveDrab */ {192, 255, 62, 5587}, /* OliveDrab1 */ {179, 238, 58, 5598}, /* OliveDrab2 */ {154, 205, 50, 5609}, /* OliveDrab3 */ {105, 139, 34, 5620}, /* OliveDrab4 */ {255, 165, 0, 5631}, /* orange */ {255, 69, 0, 5638}, /* orange red */ {255, 165, 0, 5649}, /* orange1 */ {238, 154, 0, 5657}, /* orange2 */ {205, 133, 0, 5665}, /* orange3 */ {139, 90, 0, 5673}, /* orange4 */ {255, 69, 0, 5681}, /* OrangeRed */ {255, 69, 0, 5691}, /* OrangeRed1 */ {238, 64, 0, 5702}, /* OrangeRed2 */ {205, 55, 0, 5713}, /* OrangeRed3 */ {139, 37, 0, 5724}, /* OrangeRed4 */ {218, 112, 214, 5735}, /* orchid */ {255, 131, 250, 5742}, /* orchid1 */ {238, 122, 233, 5750}, /* orchid2 */ {205, 105, 201, 5758}, /* orchid3 */ {139, 71, 137, 5766}, /* orchid4 */ {238, 232, 170, 5774}, /* pale goldenrod */ {152, 251, 152, 5789}, /* pale green */ {175, 238, 238, 5800}, /* pale turquoise */ {219, 112, 147, 5815}, /* pale violet red */ {238, 232, 170, 5831}, /* PaleGoldenrod */ {152, 251, 152, 5845}, /* PaleGreen */ {154, 255, 154, 5855}, /* PaleGreen1 */ {144, 238, 144, 5866}, /* PaleGreen2 */ {124, 205, 124, 5877}, /* PaleGreen3 */ {84, 139, 84, 5888}, /* PaleGreen4 */ {175, 238, 238, 5899}, /* PaleTurquoise */ {187, 255, 255, 5913}, /* PaleTurquoise1 */ {174, 238, 238, 5928}, /* PaleTurquoise2 */ {150, 205, 205, 5943}, /* PaleTurquoise3 */ {102, 139, 139, 5958}, /* PaleTurquoise4 */ {219, 112, 147, 5973}, /* PaleVioletRed */ {255, 130, 171, 5987}, /* PaleVioletRed1 */ {238, 121, 159, 6002}, /* PaleVioletRed2 */ {205, 104, 137, 6017}, /* PaleVioletRed3 */ {139, 71, 93, 6032}, /* PaleVioletRed4 */ {255, 239, 213, 6047}, /* papaya whip */ {255, 239, 213, 6059}, /* PapayaWhip */ {255, 218, 185, 6070}, /* peach puff */ {255, 218, 185, 6081}, /* PeachPuff */ {255, 218, 185, 6091}, /* PeachPuff1 */ {238, 203, 173, 6102}, /* PeachPuff2 */ {205, 175, 149, 6113}, /* PeachPuff3 */ {139, 119, 101, 6124}, /* PeachPuff4 */ {205, 133, 63, 6135}, /* peru */ {255, 192, 203, 6140}, /* pink */ {255, 181, 197, 6145}, /* pink1 */ {238, 169, 184, 6151}, /* pink2 */ {205, 145, 158, 6157}, /* pink3 */ {139, 99, 108, 6163}, /* pink4 */ {221, 160, 221, 6169}, /* plum */ {255, 187, 255, 6174}, /* plum1 */ {238, 174, 238, 6180}, /* plum2 */ {205, 150, 205, 6186}, /* plum3 */ {139, 102, 139, 6192}, /* plum4 */ {176, 224, 230, 6198}, /* powder blue */ {176, 224, 230, 6210}, /* PowderBlue */ {160, 32, 240, 6221}, /* purple */ {155, 48, 255, 6228}, /* purple1 */ {145, 44, 238, 6236}, /* purple2 */ {125, 38, 205, 6244}, /* purple3 */ {85, 26, 139, 6252}, /* purple4 */ {102, 51, 153, 6260}, /* rebecca purple */ {102, 51, 153, 6275}, /* RebeccaPurple */ {255, 0, 0, 6289}, /* red */ {255, 0, 0, 6293}, /* red1 */ {238, 0, 0, 6298}, /* red2 */ {205, 0, 0, 6303}, /* red3 */ {139, 0, 0, 6308}, /* red4 */ {188, 143, 143, 6313}, /* rosy brown */ {188, 143, 143, 6324}, /* RosyBrown */ {255, 193, 193, 6334}, /* RosyBrown1 */ {238, 180, 180, 6345}, /* RosyBrown2 */ {205, 155, 155, 6356}, /* RosyBrown3 */ {139, 105, 105, 6367}, /* RosyBrown4 */ {65, 105, 225, 6378}, /* royal blue */ {65, 105, 225, 6389}, /* RoyalBlue */ {72, 118, 255, 6399}, /* RoyalBlue1 */ {67, 110, 238, 6410}, /* RoyalBlue2 */ {58, 95, 205, 6421}, /* RoyalBlue3 */ {39, 64, 139, 6432}, /* RoyalBlue4 */ {139, 69, 19, 6443}, /* saddle brown */ {139, 69, 19, 6456}, /* SaddleBrown */ {250, 128, 114, 6468}, /* salmon */ {255, 140, 105, 6475}, /* salmon1 */ {238, 130, 98, 6483}, /* salmon2 */ {205, 112, 84, 6491}, /* salmon3 */ {139, 76, 57, 6499}, /* salmon4 */ {244, 164, 96, 6507}, /* sandy brown */ {244, 164, 96, 6519}, /* SandyBrown */ {46, 139, 87, 6530}, /* sea green */ {46, 139, 87, 6540}, /* SeaGreen */ {84, 255, 159, 6549}, /* SeaGreen1 */ {78, 238, 148, 6559}, /* SeaGreen2 */ {67, 205, 128, 6569}, /* SeaGreen3 */ {46, 139, 87, 6579}, /* SeaGreen4 */ {255, 245, 238, 6589}, /* seashell */ {255, 245, 238, 6598}, /* seashell1 */ {238, 229, 222, 6608}, /* seashell2 */ {205, 197, 191, 6618}, /* seashell3 */ {139, 134, 130, 6628}, /* seashell4 */ {160, 82, 45, 6638}, /* sienna */ {255, 130, 71, 6645}, /* sienna1 */ {238, 121, 66, 6653}, /* sienna2 */ {205, 104, 57, 6661}, /* sienna3 */ {139, 71, 38, 6669}, /* sienna4 */ {192, 192, 192, 6677}, /* silver */ {135, 206, 235, 6684}, /* sky blue */ {135, 206, 235, 6693}, /* SkyBlue */ {135, 206, 255, 6701}, /* SkyBlue1 */ {126, 192, 238, 6710}, /* SkyBlue2 */ {108, 166, 205, 6719}, /* SkyBlue3 */ {74, 112, 139, 6728}, /* SkyBlue4 */ {106, 90, 205, 6737}, /* slate blue */ {112, 128, 144, 6748}, /* slate gray */ {112, 128, 144, 6759}, /* slate grey */ {106, 90, 205, 6770}, /* SlateBlue */ {131, 111, 255, 6780}, /* SlateBlue1 */ {122, 103, 238, 6791}, /* SlateBlue2 */ {105, 89, 205, 6802}, /* SlateBlue3 */ {71, 60, 139, 6813}, /* SlateBlue4 */ {112, 128, 144, 6824}, /* SlateGray */ {198, 226, 255, 6834}, /* SlateGray1 */ {185, 211, 238, 6845}, /* SlateGray2 */ {159, 182, 205, 6856}, /* SlateGray3 */ {108, 123, 139, 6867}, /* SlateGray4 */ {112, 128, 144, 6878}, /* SlateGrey */ {255, 250, 250, 6888}, /* snow */ {255, 250, 250, 6893}, /* snow1 */ {238, 233, 233, 6899}, /* snow2 */ {205, 201, 201, 6905}, /* snow3 */ {139, 137, 137, 6911}, /* snow4 */ {0, 255, 127, 6917}, /* spring green */ {0, 255, 127, 6930}, /* SpringGreen */ {0, 255, 127, 6942}, /* SpringGreen1 */ {0, 238, 118, 6955}, /* SpringGreen2 */ {0, 205, 102, 6968}, /* SpringGreen3 */ {0, 139, 69, 6981}, /* SpringGreen4 */ {70, 130, 180, 6994}, /* steel blue */ {70, 130, 180, 7005}, /* SteelBlue */ {99, 184, 255, 7015}, /* SteelBlue1 */ {92, 172, 238, 7026}, /* SteelBlue2 */ {79, 148, 205, 7037}, /* SteelBlue3 */ {54, 100, 139, 7048}, /* SteelBlue4 */ {210, 180, 140, 7059}, /* tan */ {255, 165, 79, 7063}, /* tan1 */ {238, 154, 73, 7068}, /* tan2 */ {205, 133, 63, 7073}, /* tan3 */ {139, 90, 43, 7078}, /* tan4 */ {0, 128, 128, 7083}, /* teal */ {216, 191, 216, 7088}, /* thistle */ {255, 225, 255, 7096}, /* thistle1 */ {238, 210, 238, 7105}, /* thistle2 */ {205, 181, 205, 7114}, /* thistle3 */ {139, 123, 139, 7123}, /* thistle4 */ {255, 99, 71, 7132}, /* tomato */ {255, 99, 71, 7139}, /* tomato1 */ {238, 92, 66, 7147}, /* tomato2 */ {205, 79, 57, 7155}, /* tomato3 */ {139, 54, 38, 7163}, /* tomato4 */ {64, 224, 208, 7171}, /* turquoise */ {0, 245, 255, 7181}, /* turquoise1 */ {0, 229, 238, 7192}, /* turquoise2 */ {0, 197, 205, 7203}, /* turquoise3 */ {0, 134, 139, 7214}, /* turquoise4 */ {238, 130, 238, 7225}, /* violet */ {208, 32, 144, 7232}, /* violet red */ {208, 32, 144, 7243}, /* VioletRed */ {255, 62, 150, 7253}, /* VioletRed1 */ {238, 58, 140, 7264}, /* VioletRed2 */ {205, 50, 120, 7275}, /* VioletRed3 */ {139, 34, 82, 7286}, /* VioletRed4 */ {128, 128, 128, 7297}, /* web gray */ {0, 128, 0, 7306}, /* web green */ {128, 128, 128, 7316}, /* web grey */ {128, 0, 0, 7325}, /* web maroon */ {128, 0, 128, 7336}, /* web purple */ {128, 128, 128, 7347}, /* WebGray */ {0, 128, 0, 7355}, /* WebGreen */ {128, 128, 128, 7364}, /* WebGrey */ {128, 0, 0, 7372}, /* WebMaroon */ {128, 0, 128, 7382}, /* WebPurple */ {245, 222, 179, 7392}, /* wheat */ {255, 231, 186, 7398}, /* wheat1 */ {238, 216, 174, 7405}, /* wheat2 */ {205, 186, 150, 7412}, /* wheat3 */ {139, 126, 102, 7419}, /* wheat4 */ {255, 255, 255, 7426}, /* white */ {245, 245, 245, 7432}, /* white smoke */ {245, 245, 245, 7444}, /* WhiteSmoke */ {190, 190, 190, 7455}, /* x11 gray */ {0, 255, 0, 7464}, /* x11 green */ {190, 190, 190, 7474}, /* x11 grey */ {176, 48, 96, 7483}, /* x11 maroon */ {160, 32, 240, 7494}, /* x11 purple */ {190, 190, 190, 7505}, /* X11Gray */ {0, 255, 0, 7513}, /* X11Green */ {190, 190, 190, 7522}, /* X11Grey */ {176, 48, 96, 7530}, /* X11Maroon */ {160, 32, 240, 7540}, /* X11Purple */ {255, 255, 0, 7550}, /* yellow */ {154, 205, 50, 7557}, /* yellow green */ {255, 255, 0, 7570}, /* yellow1 */ {238, 238, 0, 7578}, /* yellow2 */ {205, 205, 0, 7586}, /* yellow3 */ {139, 139, 0, 7594}, /* yellow4 */ {154, 205, 50, 7602}, /* YellowGreen */ }; #define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0])) Bool OsLookupColor(int screen, char *name, unsigned int len, unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) { const BuiltinColor *c; int low, mid, high; int r; low = 0; high = NUM_BUILTIN_COLORS - 1; while (high >= low) { mid = (low + high) / 2; c = &BuiltinColors[mid]; r = strncasecmp(&BuiltinColorNames[c->name], name, len); if (r == 0 && len == strlen(&BuiltinColorNames[c->name])) { *pred = c->red * 0x101; *pgreen = c->green * 0x101; *pblue = c->blue * 0x101; return TRUE; } if (r < 0) low = mid + 1; else high = mid - 1; } return FALSE; } xorg-server-1.17.1/os/xprintf.c0000664000175100017510000001773712274325511013311 00000000000000/** * @file * * @section DESCRIPTION * * These functions provide a portable implementation of the common (but not * yet universal) asprintf & vasprintf routines to allocate a buffer big * enough to sprintf the arguments to. The XNF variants terminate the server * if the allocation fails. */ /* * Copyright (c) 2004 Alexander Gottwald * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ /* * Copyright (c) 2010, Oracle and/or its affiliates. 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 (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" #include #include #include #include #ifdef asprintf #undef asprintf #endif #ifdef vasprintf #undef vasprintf #endif #ifndef va_copy #ifdef __va_copy #define va_copy __va_copy #else #error "no working va_copy was found" #endif #endif /** * Varargs sprintf that allocates a string buffer the right size for * the pattern & data provided and prints the requested data to it. * * @param ret Pointer to which the newly allocated buffer is written * (contents undefined on error) * @param format printf style format string * @param va variable argument list * @return size of allocated buffer, or -1 on error. */ int Xvasprintf(char **ret, const char *_X_RESTRICT_KYWD format, va_list va) { #ifdef HAVE_VASPRINTF return vasprintf(ret, format, va); #else int size; va_list va2; va_copy(va2, va); size = vsnprintf(NULL, 0, format, va2); va_end(va2); *ret = malloc(size + 1); if (*ret == NULL) return -1; vsnprintf(*ret, size + 1, format, va); (*ret)[size] = 0; return size; #endif } #ifndef HAVE_VASPRINTF #define vasprintf Xvasprintf #endif /** * sprintf that allocates a string buffer the right size for * the pattern & data provided and prints the requested data to it. * * @param ret Pointer to which the newly allocated buffer is written * (contents undefined on error) * @param format printf style format string * @param ... arguments for specified format * @return size of allocated buffer, or -1 on error. */ int Xasprintf(char **ret, const char *_X_RESTRICT_KYWD format, ...) { int size; va_list va; va_start(va, format); size = vasprintf(ret, format, va); va_end(va); return size; } /** * Varargs sprintf that allocates a string buffer the right size for * the pattern & data provided and prints the requested data to it. * On failure, issues a FatalError message and aborts the server. * * @param ret Pointer to which the newly allocated buffer is written * (contents undefined on error) * @param format printf style format string * @param va variable argument list * @return size of allocated buffer */ int XNFvasprintf(char **ret, const char *_X_RESTRICT_KYWD format, va_list va) { int size = vasprintf(ret, format, va); if ((size == -1) || (*ret == NULL)) { FatalError("XNFvasprintf failed: %s", strerror(errno)); } return size; } /** * sprintf that allocates a string buffer the right size for * the pattern & data provided and prints the requested data to it. * On failure, issues a FatalError message and aborts the server. * * @param ret Pointer to which the newly allocated buffer is written * (contents undefined on error) * @param format printf style format string * @param ... arguments for specified format * @return size of allocated buffer */ int XNFasprintf(char **ret, const char *_X_RESTRICT_KYWD format, ...) { int size; va_list va; va_start(va, format); size = XNFvasprintf(ret, format, va); va_end(va); return size; } /** * Varargs snprintf that returns the actual number of bytes (excluding final * '\0') that were copied into the buffer. * This is opposed to the normal sprintf() usually returns the number of bytes * that would have been written. * * @param s buffer to copy into * @param n size of buffer s * @param format printf style format string * @param va variable argument list * @return number of bytes actually copied, excluding final '\0' */ int Xvscnprintf(char *s, int n, const char *format, va_list args) { int x; if (n == 0) return 0; x = vsnprintf(s, n , format, args); return (x >= n) ? (n - 1) : x; } /** * snprintf that returns the actual number of bytes (excluding final '\0') that * were copied into the buffer. * This is opposed to the normal sprintf() usually returns the number of bytes * that would have been written. * * @param s buffer to copy into * @param n size of buffer s * @param format printf style format string * @param ... arguments for specified format * @return number of bytes actually copied, excluding final '\0' */ int Xscnprintf(char *s, int n, const char *format, ...) { int x; va_list ap; va_start(ap, format); x = Xvscnprintf(s, n, format, ap); va_end(ap); return x; } /* Old api, now deprecated, may be removed in the future */ char * Xvprintf(const char *format, va_list va) { char *ret; if (vasprintf(&ret, format, va) == -1) ret = NULL; return ret; } char * Xprintf(const char *format, ...) { char *ret; va_list va; va_start(va, format); if (vasprintf(&ret, format, va) == -1) ret = NULL; va_end(va); return ret; } char * XNFvprintf(const char *format, va_list va) { char *ret; XNFvasprintf(&ret, format, va); return ret; } char * XNFprintf(const char *format, ...) { char *ret; va_list va; va_start(va, format); XNFvasprintf(&ret, format, va); va_end(va); return ret; } xorg-server-1.17.1/os/xstrans.c0000664000175100017510000000047712404635270013313 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #include /* ErrorF is used by xtrans */ #ifndef HAVE_DIX_CONFIG_H extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2); #endif #define TRANS_REOPEN #define TRANS_SERVER #define XSERV_t #include xorg-server-1.17.1/os/access.c0000664000175100017510000016203312456571574013064 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. X Window System is a trademark of The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /* * Copyright (c) 2004, Oracle and/or its affiliates. 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 (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 #ifdef WIN32 #include #endif #include #include #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN #include #include #include #include #include "misc.h" #include "site.h" #include #include #ifndef WIN32 #include #include #include #if defined(TCPCONN) || defined(STREAMSCONN) #include #endif /* TCPCONN || STREAMSCONN */ #ifdef HAVE_GETPEERUCRED #include #ifdef sun #include #endif #endif #if defined(SVR4) || (defined(SYSV) && defined(__i386__)) || defined(__GNU__) #include #endif #if defined(SYSV) && defined(__i386__) #include #endif #ifdef __GNU__ #undef SIOCGIFCONF #include #else /*!__GNU__ */ #include #endif /*__GNU__ */ #ifdef SVR4 #include #include #endif #include #ifdef CSRG_BASED #include #if (BSD >= 199103) #define VARIABLE_IFREQ #endif #endif #ifdef BSD44SOCKETS #ifndef VARIABLE_IFREQ #define VARIABLE_IFREQ #endif #endif #ifdef HAVE_GETIFADDRS #include #endif /* Solaris provides an extended interface SIOCGLIFCONF. Other systems * may have this as well, but the code has only been tested on Solaris * so far, so we only enable it there. Other platforms may be added as * needed. * * Test for Solaris commented out -- TSI @ UQV 2003.06.13 */ #ifdef SIOCGLIFCONF /* #if defined(sun) */ #define USE_SIOCGLIFCONF /* #endif */ #endif #if defined(IPv6) && defined(AF_INET6) #include #endif #endif /* WIN32 */ #define X_INCLUDE_NETDB_H #include #include "dixstruct.h" #include "osdep.h" #include "xace.h" Bool defeatAccessControl = FALSE; #define addrEqual(fam, address, length, host) \ ((fam) == (host)->family &&\ (length) == (host)->len &&\ !memcmp (address, (host)->addr, length)) static int ConvertAddr(struct sockaddr * /*saddr */ , int * /*len */ , void ** /*addr */ ); static int CheckAddr(int /*family */ , const void * /*pAddr */ , unsigned /*length */ ); static Bool NewHost(int /*family */ , const void * /*addr */ , int /*len */ , int /* addingLocalHosts */ ); /* XFree86 bug #156: To keep track of which hosts were explicitly requested in /etc/X.hosts, we've added a requested field to the HOST struct, and a LocalHostRequested variable. These default to FALSE, but are set to TRUE in ResetHosts when reading in /etc/X.hosts. They are checked in DisableLocalHost(), which is called to disable the default local host entries when stronger authentication is turned on. */ typedef struct _host { short family; short len; unsigned char *addr; struct _host *next; int requested; } HOST; #define MakeHost(h,l) (h)=malloc(sizeof *(h)+(l));\ if (h) { \ (h)->addr=(unsigned char *) ((h) + 1);\ (h)->requested = FALSE; \ } #define FreeHost(h) free(h) static HOST *selfhosts = NULL; static HOST *validhosts = NULL; static int AccessEnabled = DEFAULT_ACCESS_CONTROL; static int LocalHostEnabled = FALSE; static int LocalHostRequested = FALSE; static int UsingXdmcp = FALSE; /* FamilyServerInterpreted implementation */ static Bool siAddrMatch(int family, void *addr, int len, HOST * host, ClientPtr client); static int siCheckAddr(const char *addrString, int length); static void siTypesInitialize(void); /* * called when authorization is not enabled to add the * local host to the access list */ void EnableLocalHost(void) { if (!UsingXdmcp) { LocalHostEnabled = TRUE; AddLocalHosts(); } } /* * called when authorization is enabled to keep us secure */ void DisableLocalHost(void) { HOST *self; if (!LocalHostRequested) /* Fix for XFree86 bug #156 */ LocalHostEnabled = FALSE; for (self = selfhosts; self; self = self->next) { if (!self->requested) /* Fix for XFree86 bug #156 */ (void) RemoveHost((ClientPtr) NULL, self->family, self->len, (void *) self->addr); } } /* * called at init time when XDMCP will be used; xdmcp always * adds local hosts manually when needed */ void AccessUsingXdmcp(void) { UsingXdmcp = TRUE; LocalHostEnabled = FALSE; } #if defined(SVR4) && !defined(sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ static int ifioctl(int fd, int cmd, char *arg) { struct strioctl ioc; int ret; memset((char *) &ioc, 0, sizeof(ioc)); ioc.ic_cmd = cmd; ioc.ic_timout = 0; if (cmd == SIOCGIFCONF) { ioc.ic_len = ((struct ifconf *) arg)->ifc_len; ioc.ic_dp = ((struct ifconf *) arg)->ifc_buf; } else { ioc.ic_len = sizeof(struct ifreq); ioc.ic_dp = arg; } ret = ioctl(fd, I_STR, (char *) &ioc); if (ret >= 0 && cmd == SIOCGIFCONF) #ifdef SVR4 ((struct ifconf *) arg)->ifc_len = ioc.ic_len; #endif return ret; } #else #define ifioctl ioctl #endif /* * DefineSelf (fd): * * Define this host for access control. Find all the hosts the OS knows about * for this fd and add them to the selfhosts list. */ #if !defined(SIOCGIFCONF) void DefineSelf(int fd) { #if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN) return; #else register int n; int len; caddr_t addr; int family; register HOST *host; #ifndef WIN32 struct utsname name; #else struct { char nodename[512]; } name; #endif register struct hostent *hp; union { struct sockaddr sa; struct sockaddr_in in; #if defined(IPv6) && defined(AF_INET6) struct sockaddr_in6 in6; #endif } saddr; struct sockaddr_in *inetaddr; struct sockaddr_in6 *inet6addr; struct sockaddr_in broad_addr; #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif /* Why not use gethostname()? Well, at least on my system, I've had to * make an ugly kernel patch to get a name longer than 8 characters, and * uname() lets me access to the whole string (it smashes release, you * see), whereas gethostname() kindly truncates it for me. */ #ifndef WIN32 uname(&name); #else gethostname(name.nodename, sizeof(name.nodename)); #endif hp = _XGethostbyname(name.nodename, hparams); if (hp != NULL) { saddr.sa.sa_family = hp->h_addrtype; switch (hp->h_addrtype) { case AF_INET: inetaddr = (struct sockaddr_in *) (&(saddr.sa)); memcpy(&(inetaddr->sin_addr), hp->h_addr, hp->h_length); len = sizeof(saddr.sa); break; #if defined(IPv6) && defined(AF_INET6) case AF_INET6: inet6addr = (struct sockaddr_in6 *) (&(saddr.sa)); memcpy(&(inet6addr->sin6_addr), hp->h_addr, hp->h_length); len = sizeof(saddr.in6); break; #endif default: goto DefineLocalHost; } family = ConvertAddr(&(saddr.sa), &len, (void **) &addr); if (family != -1 && family != FamilyLocal) { for (host = selfhosts; host && !addrEqual(family, addr, len, host); host = host->next); if (!host) { /* add this host to the host list. */ MakeHost(host, len) if (host) { host->family = family; host->len = len; memcpy(host->addr, addr, len); host->next = selfhosts; selfhosts = host; } #ifdef XDMCP /* * If this is an Internet Address, but not the localhost * address (127.0.0.1), nor the bogus address (0.0.0.0), * register it. */ if (family == FamilyInternet && !(len == 4 && ((addr[0] == 127) || (addr[0] == 0 && addr[1] == 0 && addr[2] == 0 && addr[3] == 0))) ) { XdmcpRegisterConnection(family, (char *) addr, len); broad_addr = *inetaddr; ((struct sockaddr_in *) &broad_addr)->sin_addr.s_addr = htonl(INADDR_BROADCAST); XdmcpRegisterBroadcastAddress((struct sockaddr_in *) &broad_addr); } #if defined(IPv6) && defined(AF_INET6) else if (family == FamilyInternet6 && !(IN6_IS_ADDR_LOOPBACK((struct in6_addr *) addr))) { XdmcpRegisterConnection(family, (char *) addr, len); } #endif #endif /* XDMCP */ } } } /* * now add a host of family FamilyLocalHost... */ DefineLocalHost: for (host = selfhosts; host && !addrEqual(FamilyLocalHost, "", 0, host); host = host->next); if (!host) { MakeHost(host, 0); if (host) { host->family = FamilyLocalHost; host->len = 0; /* Nothing to store in host->addr */ host->next = selfhosts; selfhosts = host; } } #endif /* !TCPCONN && !STREAMSCONN && !UNIXCONN */ } #else #ifdef USE_SIOCGLIFCONF #define ifr_type struct lifreq #else #define ifr_type struct ifreq #endif #ifdef VARIABLE_IFREQ #define ifr_size(p) (sizeof (struct ifreq) + \ (p->ifr_addr.sa_len > sizeof (p->ifr_addr) ? \ p->ifr_addr.sa_len - sizeof (p->ifr_addr) : 0)) #define ifraddr_size(a) (a.sa_len) #else #define ifr_size(p) (sizeof (ifr_type)) #define ifraddr_size(a) (sizeof (a)) #endif #if defined(IPv6) && defined(AF_INET6) static void 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]); sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = 0; } #endif } #endif void DefineSelf(int fd) { #ifndef HAVE_GETIFADDRS char *cp, *cplim; #ifdef USE_SIOCGLIFCONF struct sockaddr_storage buf[16]; struct lifconf ifc; register struct lifreq *ifr; #ifdef SIOCGLIFNUM struct lifnum ifn; #endif #else /* !USE_SIOCGLIFCONF */ char buf[2048]; struct ifconf ifc; register struct ifreq *ifr; #endif void *bufptr = buf; #else /* HAVE_GETIFADDRS */ struct ifaddrs *ifap, *ifr; #endif int len; unsigned char *addr; int family; register HOST *host; #ifndef HAVE_GETIFADDRS len = sizeof(buf); #ifdef USE_SIOCGLIFCONF #ifdef SIOCGLIFNUM ifn.lifn_family = AF_UNSPEC; ifn.lifn_flags = 0; if (ioctl(fd, SIOCGLIFNUM, (char *) &ifn) < 0) ErrorF("Getting interface count: %s\n", strerror(errno)); if (len < (ifn.lifn_count * sizeof(struct lifreq))) { len = ifn.lifn_count * sizeof(struct lifreq); bufptr = malloc(len); } #endif ifc.lifc_family = AF_UNSPEC; ifc.lifc_flags = 0; ifc.lifc_len = len; ifc.lifc_buf = bufptr; #define IFC_IOCTL_REQ SIOCGLIFCONF #define IFC_IFC_REQ ifc.lifc_req #define IFC_IFC_LEN ifc.lifc_len #define IFR_IFR_ADDR ifr->lifr_addr #define IFR_IFR_NAME ifr->lifr_name #else /* Use SIOCGIFCONF */ ifc.ifc_len = len; ifc.ifc_buf = bufptr; #define IFC_IOCTL_REQ SIOCGIFCONF #define IFC_IFC_REQ ifc.ifc_req #define IFC_IFC_LEN ifc.ifc_len #define IFR_IFR_ADDR ifr->ifr_addr #define IFR_IFR_NAME ifr->ifr_name #endif if (ifioctl(fd, IFC_IOCTL_REQ, (void *) &ifc) < 0) ErrorF("Getting interface configuration (4): %s\n", strerror(errno)); cplim = (char *) IFC_IFC_REQ + IFC_IFC_LEN; for (cp = (char *) IFC_IFC_REQ; cp < cplim; cp += ifr_size(ifr)) { ifr = (ifr_type *) cp; len = ifraddr_size(IFR_IFR_ADDR); family = ConvertAddr((struct sockaddr *) &IFR_IFR_ADDR, &len, (void **) &addr); if (family == -1 || family == FamilyLocal) continue; #if defined(IPv6) && defined(AF_INET6) if (family == FamilyInternet6) in6_fillscopeid((struct sockaddr_in6 *) &IFR_IFR_ADDR); #endif for (host = selfhosts; host && !addrEqual(family, addr, len, host); host = host->next); if (host) continue; MakeHost(host, len) if (host) { host->family = family; host->len = len; memcpy(host->addr, addr, len); host->next = selfhosts; selfhosts = host; } #ifdef XDMCP { #ifdef USE_SIOCGLIFCONF struct sockaddr_storage broad_addr; #else struct sockaddr broad_addr; #endif /* * If this isn't an Internet Address, don't register it. */ if (family != FamilyInternet #if defined(IPv6) && defined(AF_INET6) && family != FamilyInternet6 #endif ) continue; /* * ignore 'localhost' entries as they're not useful * on the other end of the wire */ if (family == FamilyInternet && addr[0] == 127 && addr[1] == 0 && addr[2] == 0 && addr[3] == 1) continue; #if defined(IPv6) && defined(AF_INET6) else if (family == FamilyInternet6 && IN6_IS_ADDR_LOOPBACK((struct in6_addr *) addr)) continue; #endif /* * Ignore '0.0.0.0' entries as they are * returned by some OSes for unconfigured NICs but they are * not useful on the other end of the wire. */ if (len == 4 && addr[0] == 0 && addr[1] == 0 && addr[2] == 0 && addr[3] == 0) continue; XdmcpRegisterConnection(family, (char *) addr, len); #if defined(IPv6) && defined(AF_INET6) /* IPv6 doesn't support broadcasting, so we drop out here */ if (family == FamilyInternet6) continue; #endif broad_addr = IFR_IFR_ADDR; ((struct sockaddr_in *) &broad_addr)->sin_addr.s_addr = htonl(INADDR_BROADCAST); #if defined(USE_SIOCGLIFCONF) && defined(SIOCGLIFBRDADDR) { struct lifreq broad_req; broad_req = *ifr; if (ioctl(fd, SIOCGLIFFLAGS, (char *) &broad_req) != -1 && (broad_req.lifr_flags & IFF_BROADCAST) && (broad_req.lifr_flags & IFF_UP) ) { broad_req = *ifr; if (ioctl(fd, SIOCGLIFBRDADDR, &broad_req) != -1) broad_addr = broad_req.lifr_broadaddr; else continue; } else continue; } #elif defined(SIOCGIFBRDADDR) { struct ifreq broad_req; broad_req = *ifr; if (ifioctl(fd, SIOCGIFFLAGS, (void *) &broad_req) != -1 && (broad_req.ifr_flags & IFF_BROADCAST) && (broad_req.ifr_flags & IFF_UP) ) { broad_req = *ifr; if (ifioctl(fd, SIOCGIFBRDADDR, (void *) &broad_req) != -1) broad_addr = broad_req.ifr_addr; else continue; } else continue; } #endif /* SIOCGIFBRDADDR */ XdmcpRegisterBroadcastAddress((struct sockaddr_in *) &broad_addr); } #endif /* XDMCP */ } if (bufptr != buf) free(bufptr); #else /* HAVE_GETIFADDRS */ if (getifaddrs(&ifap) < 0) { ErrorF("Warning: getifaddrs returns %s\n", strerror(errno)); return; } for (ifr = ifap; ifr != NULL; ifr = ifr->ifa_next) { if (!ifr->ifa_addr) continue; len = sizeof(*(ifr->ifa_addr)); family = ConvertAddr((struct sockaddr *) ifr->ifa_addr, &len, (void **) &addr); if (family == -1 || family == FamilyLocal) continue; #if defined(IPv6) && defined(AF_INET6) if (family == FamilyInternet6) in6_fillscopeid((struct sockaddr_in6 *) ifr->ifa_addr); #endif for (host = selfhosts; host != NULL && !addrEqual(family, addr, len, host); host = host->next); if (host != NULL) continue; MakeHost(host, len); if (host != NULL) { host->family = family; host->len = len; memcpy(host->addr, addr, len); host->next = selfhosts; selfhosts = host; } #ifdef XDMCP { /* * If this isn't an Internet Address, don't register it. */ if (family != FamilyInternet #if defined(IPv6) && defined(AF_INET6) && family != FamilyInternet6 #endif ) continue; /* * ignore 'localhost' entries as they're not useful * on the other end of the wire */ if (ifr->ifa_flags & IFF_LOOPBACK) continue; if (family == FamilyInternet && addr[0] == 127 && addr[1] == 0 && addr[2] == 0 && addr[3] == 1) continue; /* * Ignore '0.0.0.0' entries as they are * returned by some OSes for unconfigured NICs but they are * not useful on the other end of the wire. */ if (len == 4 && addr[0] == 0 && addr[1] == 0 && addr[2] == 0 && addr[3] == 0) continue; #if defined(IPv6) && defined(AF_INET6) else if (family == FamilyInternet6 && IN6_IS_ADDR_LOOPBACK((struct in6_addr *) addr)) continue; #endif XdmcpRegisterConnection(family, (char *) addr, len); #if defined(IPv6) && defined(AF_INET6) if (family == FamilyInternet6) /* IPv6 doesn't support broadcasting, so we drop out here */ continue; #endif if ((ifr->ifa_flags & IFF_BROADCAST) && (ifr->ifa_flags & IFF_UP) && ifr->ifa_broadaddr) XdmcpRegisterBroadcastAddress((struct sockaddr_in *) ifr-> ifa_broadaddr); else continue; } #endif /* XDMCP */ } /* for */ freeifaddrs(ifap); #endif /* HAVE_GETIFADDRS */ /* * add something of FamilyLocalHost */ for (host = selfhosts; host && !addrEqual(FamilyLocalHost, "", 0, host); host = host->next); if (!host) { MakeHost(host, 0); if (host) { host->family = FamilyLocalHost; host->len = 0; /* Nothing to store in host->addr */ host->next = selfhosts; selfhosts = host; } } } #endif /* hpux && !HAVE_IFREQ */ #ifdef XDMCP void AugmentSelf(void *from, int len) { int family; void *addr; register HOST *host; family = ConvertAddr(from, &len, (void **) &addr); if (family == -1 || family == FamilyLocal) return; for (host = selfhosts; host; host = host->next) { if (addrEqual(family, addr, len, host)) return; } MakeHost(host, len) if (!host) return; host->family = family; host->len = len; memcpy(host->addr, addr, len); host->next = selfhosts; selfhosts = host; } #endif void AddLocalHosts(void) { HOST *self; for (self = selfhosts; self; self = self->next) /* Fix for XFree86 bug #156: pass addingLocal = TRUE to * NewHost to tell that we are adding the default local * host entries and not to flag the entries as being * explicitely requested */ (void) NewHost(self->family, self->addr, self->len, TRUE); } /* Reset access control list to initial hosts */ void ResetHosts(const char *display) { register HOST *host; char lhostname[120], ohostname[120]; char *hostname = ohostname; char fname[PATH_MAX + 1]; int fnamelen; FILE *fd; char *ptr; int i, hostlen; #if (defined(TCPCONN) || defined(STREAMSCONN) ) && \ (!defined(IPv6) || !defined(AF_INET6)) union { struct sockaddr sa; #if defined(TCPCONN) || defined(STREAMSCONN) struct sockaddr_in in; #endif /* TCPCONN || STREAMSCONN */ } saddr; #endif int family = 0; void *addr = NULL; int len; siTypesInitialize(); AccessEnabled = defeatAccessControl ? FALSE : DEFAULT_ACCESS_CONTROL; LocalHostEnabled = FALSE; while ((host = validhosts) != 0) { validhosts = host->next; FreeHost(host); } #if defined WIN32 && defined __MINGW32__ #define ETC_HOST_PREFIX "X" #else #define ETC_HOST_PREFIX "/etc/X" #endif #define ETC_HOST_SUFFIX ".hosts" fnamelen = strlen(ETC_HOST_PREFIX) + strlen(ETC_HOST_SUFFIX) + strlen(display) + 1; if (fnamelen > sizeof(fname)) FatalError("Display name `%s' is too long\n", display); snprintf(fname, sizeof(fname), ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX, display); if ((fd = fopen(fname, "r")) != 0) { while (fgets(ohostname, sizeof(ohostname), fd)) { family = FamilyWild; if (*ohostname == '#') continue; if ((ptr = strchr(ohostname, '\n')) != 0) *ptr = 0; hostlen = strlen(ohostname) + 1; for (i = 0; i < hostlen; i++) lhostname[i] = tolower(ohostname[i]); hostname = ohostname; if (!strncmp("local:", lhostname, 6)) { family = FamilyLocalHost; NewHost(family, "", 0, FALSE); LocalHostRequested = TRUE; /* Fix for XFree86 bug #156 */ } #if defined(TCPCONN) || defined(STREAMSCONN) else if (!strncmp("inet:", lhostname, 5)) { family = FamilyInternet; hostname = ohostname + 5; } #if defined(IPv6) && defined(AF_INET6) else if (!strncmp("inet6:", lhostname, 6)) { family = FamilyInternet6; hostname = ohostname + 6; } #endif #endif #ifdef SECURE_RPC else if (!strncmp("nis:", lhostname, 4)) { family = FamilyNetname; hostname = ohostname + 4; } #endif else if (!strncmp("si:", lhostname, 3)) { family = FamilyServerInterpreted; hostname = ohostname + 3; hostlen -= 3; } if (family == FamilyServerInterpreted) { len = siCheckAddr(hostname, hostlen); if (len >= 0) { NewHost(family, hostname, len, FALSE); } } else #ifdef SECURE_RPC if ((family == FamilyNetname) || (strchr(hostname, '@'))) { SecureRPCInit(); (void) NewHost(FamilyNetname, hostname, strlen(hostname), FALSE); } else #endif /* SECURE_RPC */ #if defined(TCPCONN) || defined(STREAMSCONN) { #if defined(IPv6) && defined(AF_INET6) if ((family == FamilyInternet) || (family == FamilyInternet6) || (family == FamilyWild)) { struct addrinfo *addresses; struct addrinfo *a; int f; if (getaddrinfo(hostname, NULL, NULL, &addresses) == 0) { for (a = addresses; a != NULL; a = a->ai_next) { len = a->ai_addrlen; f = ConvertAddr(a->ai_addr, &len, (void **) &addr); if (addr && ((family == f) || ((family == FamilyWild) && (f != -1)))) { NewHost(f, addr, len, FALSE); } } freeaddrinfo(addresses); } } #else #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif register struct hostent *hp; /* host name */ if ((family == FamilyInternet && ((hp = _XGethostbyname(hostname, hparams)) != 0)) || ((hp = _XGethostbyname(hostname, hparams)) != 0)) { saddr.sa.sa_family = hp->h_addrtype; len = sizeof(saddr.sa); if ((family = ConvertAddr(&saddr.sa, &len, (void **) &addr)) != -1) { #ifdef h_addr /* new 4.3bsd version of gethostent */ char **list; /* iterate over the addresses */ for (list = hp->h_addr_list; *list; list++) (void) NewHost(family, (void *) *list, len, FALSE); #else (void) NewHost(family, (void *) hp->h_addr, len, FALSE); #endif } } #endif /* IPv6 */ } #endif /* TCPCONN || STREAMSCONN */ family = FamilyWild; } fclose(fd); } } /* Is client on the local host */ Bool ComputeLocalClient(ClientPtr client) { int alen, family, notused; Xtransaddr *from = NULL; void *addr; register HOST *host; OsCommPtr oc = (OsCommPtr) client->osPrivate; if (!oc->trans_conn) return FALSE; if (!_XSERVTransGetPeerAddr(oc->trans_conn, ¬used, &alen, &from)) { family = ConvertAddr((struct sockaddr *) from, &alen, (void **) &addr); if (family == -1) { free(from); return FALSE; } if (family == FamilyLocal) { free(from); return TRUE; } for (host = selfhosts; host; host = host->next) { if (addrEqual(family, addr, alen, host)) { free(from); return TRUE; } } free(from); } return FALSE; } /* * Return the uid and all gids of a connected local client * Allocates a LocalClientCredRec - caller must call FreeLocalClientCreds * * Used by localuser & localgroup ServerInterpreted access control forms below * Used by AuthAudit to log who local connections came from */ int GetLocalClientCreds(ClientPtr client, LocalClientCredRec ** lccp) { #if defined(HAVE_GETPEEREID) || defined(HAVE_GETPEERUCRED) || defined(SO_PEERCRED) int fd; XtransConnInfo ci; LocalClientCredRec *lcc; #ifdef HAVE_GETPEEREID uid_t uid; gid_t gid; #elif defined(HAVE_GETPEERUCRED) ucred_t *peercred = NULL; const gid_t *gids; #elif defined(SO_PEERCRED) struct ucred peercred; socklen_t so_len = sizeof(peercred); #endif if (client == NULL) return -1; ci = ((OsCommPtr) client->osPrivate)->trans_conn; #if !(defined(sun) && defined(HAVE_GETPEERUCRED)) /* Most implementations can only determine peer credentials for Unix * domain sockets - Solaris getpeerucred can work with a bit more, so * we just let it tell us if the connection type is supported or not */ if (!_XSERVTransIsLocal(ci)) { return -1; } #endif *lccp = calloc(1, sizeof(LocalClientCredRec)); if (*lccp == NULL) return -1; lcc = *lccp; fd = _XSERVTransGetConnectionNumber(ci); #ifdef HAVE_GETPEEREID if (getpeereid(fd, &uid, &gid) == -1) { FreeLocalClientCreds(lcc); return -1; } lcc->euid = uid; lcc->egid = gid; lcc->fieldsSet = LCC_UID_SET | LCC_GID_SET; return 0; #elif defined(HAVE_GETPEERUCRED) if (getpeerucred(fd, &peercred) < 0) { FreeLocalClientCreds(lcc); return -1; } lcc->euid = ucred_geteuid(peercred); if (lcc->euid != -1) lcc->fieldsSet |= LCC_UID_SET; lcc->egid = ucred_getegid(peercred); if (lcc->egid != -1) lcc->fieldsSet |= LCC_GID_SET; lcc->pid = ucred_getpid(peercred); if (lcc->pid != -1) lcc->fieldsSet |= LCC_PID_SET; #ifdef HAVE_GETZONEID lcc->zoneid = ucred_getzoneid(peercred); if (lcc->zoneid != -1) lcc->fieldsSet |= LCC_ZID_SET; #endif lcc->nSuppGids = ucred_getgroups(peercred, &gids); if (lcc->nSuppGids > 0) { lcc->pSuppGids = calloc(lcc->nSuppGids, sizeof(int)); if (lcc->pSuppGids == NULL) { lcc->nSuppGids = 0; } else { int i; for (i = 0; i < lcc->nSuppGids; i++) { (lcc->pSuppGids)[i] = (int) gids[i]; } } } else { lcc->nSuppGids = 0; } ucred_free(peercred); return 0; #elif defined(SO_PEERCRED) if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &peercred, &so_len) == -1) { FreeLocalClientCreds(lcc); return -1; } lcc->euid = peercred.uid; lcc->egid = peercred.gid; lcc->pid = peercred.pid; lcc->fieldsSet = LCC_UID_SET | LCC_GID_SET | LCC_PID_SET; return 0; #endif #else /* No system call available to get the credentials of the peer */ #define NO_LOCAL_CLIENT_CRED return -1; #endif } void FreeLocalClientCreds(LocalClientCredRec * lcc) { if (lcc != NULL) { if (lcc->nSuppGids > 0) { free(lcc->pSuppGids); } free(lcc); } } static int AuthorizedClient(ClientPtr client) { int rc; if (!client || defeatAccessControl) return Success; /* untrusted clients can't change host access */ rc = XaceHook(XACE_SERVER_ACCESS, client, DixManageAccess); if (rc != Success) return rc; return client->local ? Success : BadAccess; } /* Add a host to the access control list. This is the external interface * called from the dispatcher */ int AddHost(ClientPtr client, int family, unsigned length, /* of bytes in pAddr */ const void *pAddr) { int rc, len; rc = AuthorizedClient(client); if (rc != Success) return rc; switch (family) { case FamilyLocalHost: len = length; LocalHostEnabled = TRUE; break; #ifdef SECURE_RPC case FamilyNetname: len = length; SecureRPCInit(); break; #endif case FamilyInternet: #if defined(IPv6) && defined(AF_INET6) case FamilyInternet6: #endif case FamilyDECnet: case FamilyChaos: case FamilyServerInterpreted: if ((len = CheckAddr(family, pAddr, length)) < 0) { client->errorValue = length; return BadValue; } break; case FamilyLocal: default: client->errorValue = family; return BadValue; } if (NewHost(family, pAddr, len, FALSE)) return Success; return BadAlloc; } Bool ForEachHostInFamily(int family, Bool (*func) (unsigned char *addr, short len, void *closure), void *closure) { HOST *host; for (host = validhosts; host; host = host->next) if (family == host->family && func(host->addr, host->len, closure)) return TRUE; return FALSE; } /* Add a host to the access control list. This is the internal interface * called when starting or resetting the server */ static Bool NewHost(int family, const void *addr, int len, int addingLocalHosts) { register HOST *host; for (host = validhosts; host; host = host->next) { if (addrEqual(family, addr, len, host)) return TRUE; } if (!addingLocalHosts) { /* Fix for XFree86 bug #156 */ for (host = selfhosts; host; host = host->next) { if (addrEqual(family, addr, len, host)) { host->requested = TRUE; break; } } } MakeHost(host, len) if (!host) return FALSE; host->family = family; host->len = len; memcpy(host->addr, addr, len); host->next = validhosts; validhosts = host; return TRUE; } /* Remove a host from the access control list */ int RemoveHost(ClientPtr client, int family, unsigned length, /* of bytes in pAddr */ void *pAddr) { int rc, len; register HOST *host, **prev; rc = AuthorizedClient(client); if (rc != Success) return rc; switch (family) { case FamilyLocalHost: len = length; LocalHostEnabled = FALSE; break; #ifdef SECURE_RPC case FamilyNetname: len = length; break; #endif case FamilyInternet: #if defined(IPv6) && defined(AF_INET6) case FamilyInternet6: #endif case FamilyDECnet: case FamilyChaos: case FamilyServerInterpreted: if ((len = CheckAddr(family, pAddr, length)) < 0) { client->errorValue = length; return BadValue; } break; case FamilyLocal: default: client->errorValue = family; return BadValue; } for (prev = &validhosts; (host = *prev) && (!addrEqual(family, pAddr, len, host)); prev = &host->next); if (host) { *prev = host->next; FreeHost(host); } return Success; } /* Get all hosts in the access control list */ int GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled) { int len; register int n = 0; register unsigned char *ptr; register HOST *host; int nHosts = 0; *pEnabled = AccessEnabled ? EnableAccess : DisableAccess; for (host = validhosts; host; host = host->next) { nHosts++; n += pad_to_int32(host->len) + sizeof(xHostEntry); /* Could check for INT_MAX, but in reality having more than 1mb of hostnames in the access list is ridiculous */ if (n >= 1048576) break; } if (n) { *data = ptr = malloc(n); if (!ptr) { return BadAlloc; } for (host = validhosts; host; host = host->next) { len = host->len; if ((ptr + sizeof(xHostEntry) + len) > ((unsigned char *) *data + n)) break; ((xHostEntry *) ptr)->family = host->family; ((xHostEntry *) ptr)->length = len; ptr += sizeof(xHostEntry); memcpy(ptr, host->addr, len); ptr += pad_to_int32(len); } } else { *data = NULL; } *pnHosts = nHosts; *pLen = n; return Success; } /* Check for valid address family and length, and return address length. */ /*ARGSUSED*/ static int CheckAddr(int family, const void *pAddr, unsigned length) { int len; switch (family) { #if defined(TCPCONN) || defined(STREAMSCONN) case FamilyInternet: if (length == sizeof(struct in_addr)) len = length; else len = -1; break; #if defined(IPv6) && defined(AF_INET6) case FamilyInternet6: if (length == sizeof(struct in6_addr)) len = length; else len = -1; break; #endif #endif case FamilyServerInterpreted: len = siCheckAddr(pAddr, length); break; default: len = -1; } return len; } /* Check if a host is not in the access control list. * Returns 1 if host is invalid, 0 if we've found it. */ int InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) { int family; void *addr = NULL; register HOST *selfhost, *host; if (!AccessEnabled) /* just let them in */ return 0; family = ConvertAddr(saddr, &len, (void **) &addr); if (family == -1) return 1; if (family == FamilyLocal) { if (!LocalHostEnabled) { /* * check to see if any local address is enabled. This * implicitly enables local connections. */ for (selfhost = selfhosts; selfhost; selfhost = selfhost->next) { for (host = validhosts; host; host = host->next) { if (addrEqual(selfhost->family, selfhost->addr, selfhost->len, host)) return 0; } } } else return 0; } for (host = validhosts; host; host = host->next) { if (host->family == FamilyServerInterpreted) { if (addr && siAddrMatch(family, addr, len, host, client)) { return 0; } } else { if (addr && addrEqual(family, addr, len, host)) return 0; } } return 1; } static int ConvertAddr(register struct sockaddr *saddr, int *len, void **addr) { if (*len == 0) return FamilyLocal; switch (saddr->sa_family) { case AF_UNSPEC: #if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: #endif return FamilyLocal; #if defined(TCPCONN) || defined(STREAMSCONN) case AF_INET: #ifdef WIN32 if (16777343 == *(long *) &((struct sockaddr_in *) saddr)->sin_addr) return FamilyLocal; #endif *len = sizeof(struct in_addr); *addr = (void *) &(((struct sockaddr_in *) saddr)->sin_addr); return FamilyInternet; #if defined(IPv6) && defined(AF_INET6) case AF_INET6: { struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *) saddr; if (IN6_IS_ADDR_V4MAPPED(&(saddr6->sin6_addr))) { *len = sizeof(struct in_addr); *addr = (void *) &(saddr6->sin6_addr.s6_addr[12]); return FamilyInternet; } else { *len = sizeof(struct in6_addr); *addr = (void *) &(saddr6->sin6_addr); return FamilyInternet6; } } #endif #endif default: return -1; } } int ChangeAccessControl(ClientPtr client, int fEnabled) { int rc = AuthorizedClient(client); if (rc != Success) return rc; AccessEnabled = fEnabled; return Success; } /* returns FALSE if xhost + in effect, else TRUE */ int GetAccessControl(void) { return AccessEnabled; } /***************************************************************************** * FamilyServerInterpreted host entry implementation * * Supports an extensible system of host types which the server can interpret * See the IPv6 extensions to the X11 protocol spec for the definition. * * Currently supported schemes: * * hostname - hostname as defined in IETF RFC 2396 * ipv6 - IPv6 literal address as defined in IETF RFC's 3513 and * * See xc/doc/specs/SIAddresses for formal definitions of each type. */ /* These definitions and the siTypeAdd function could be exported in the * future to enable loading additional host types, but that was not done for * the initial implementation. */ typedef Bool (*siAddrMatchFunc) (int family, void *addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *siTypePriv); typedef int (*siCheckAddrFunc) (const char *addrString, int length, void *siTypePriv); struct siType { struct siType *next; const char *typeName; siAddrMatchFunc addrMatch; siCheckAddrFunc checkAddr; void *typePriv; /* Private data for type routines */ }; static struct siType *siTypeList; static int siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch, siCheckAddrFunc checkAddr, void *typePriv) { struct siType *s, *p; if ((typeName == NULL) || (addrMatch == NULL) || (checkAddr == NULL)) return BadValue; for (s = siTypeList, p = NULL; s != NULL; p = s, s = s->next) { if (strcmp(typeName, s->typeName) == 0) { s->addrMatch = addrMatch; s->checkAddr = checkAddr; s->typePriv = typePriv; return Success; } } s = malloc(sizeof(struct siType)); if (s == NULL) return BadAlloc; if (p == NULL) siTypeList = s; else p->next = s; s->next = NULL; s->typeName = typeName; s->addrMatch = addrMatch; s->checkAddr = checkAddr; s->typePriv = typePriv; return Success; } /* Checks to see if a host matches a server-interpreted host entry */ static Bool siAddrMatch(int family, void *addr, int len, HOST * host, ClientPtr client) { Bool matches = FALSE; struct siType *s; const char *valueString; int addrlen; valueString = (const char *) memchr(host->addr, '\0', host->len); if (valueString != NULL) { for (s = siTypeList; s != NULL; s = s->next) { if (strcmp((char *) host->addr, s->typeName) == 0) { addrlen = host->len - (strlen((char *) host->addr) + 1); matches = s->addrMatch(family, addr, len, valueString + 1, addrlen, client, s->typePriv); break; } } #ifdef FAMILY_SI_DEBUG ErrorF("Xserver: siAddrMatch(): type = %s, value = %*.*s -- %s\n", host->addr, addrlen, addrlen, valueString + 1, (matches) ? "accepted" : "rejected"); #endif } return matches; } static int siCheckAddr(const char *addrString, int length) { const char *valueString; int addrlen, typelen; int len = -1; struct siType *s; /* Make sure there is a \0 byte inside the specified length to separate the address type from the address value. */ valueString = (const char *) memchr(addrString, '\0', length); if (valueString != NULL) { /* Make sure the first string is a recognized address type, * and the second string is a valid address of that type. */ typelen = strlen(addrString) + 1; addrlen = length - typelen; for (s = siTypeList; s != NULL; s = s->next) { if (strcmp(addrString, s->typeName) == 0) { len = s->checkAddr(valueString + 1, addrlen, s->typePriv); if (len >= 0) { len += typelen; } break; } } #ifdef FAMILY_SI_DEBUG { const char *resultMsg; if (s == NULL) { resultMsg = "type not registered"; } else { if (len == -1) resultMsg = "rejected"; else resultMsg = "accepted"; } ErrorF ("Xserver: siCheckAddr(): type = %s, value = %*.*s, len = %d -- %s\n", addrString, addrlen, addrlen, valueString + 1, len, resultMsg); } #endif } return len; } /*** * Hostname server-interpreted host type * * Stored as hostname string, explicitly defined to be resolved ONLY * at access check time, to allow for hosts with dynamic addresses * but static hostnames, such as found in some DHCP & mobile setups. * * Hostname must conform to IETF RFC 2396 sec. 3.2.2, which defines it as: * hostname = *( domainlabel "." ) toplabel [ "." ] * domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum * toplabel = alpha | alpha *( alphanum | "-" ) alphanum */ #ifdef NI_MAXHOST #define SI_HOSTNAME_MAXLEN NI_MAXHOST #else #ifdef MAXHOSTNAMELEN #define SI_HOSTNAME_MAXLEN MAXHOSTNAMELEN #else #define SI_HOSTNAME_MAXLEN 256 #endif #endif static Bool siHostnameAddrMatch(int family, void *addr, int len, const char *siAddr, int siAddrLen, ClientPtr client, void *typePriv) { Bool res = FALSE; /* Currently only supports checking against IPv4 & IPv6 connections, but * support for other address families, such as DECnet, could be added if * desired. */ #if defined(IPv6) && defined(AF_INET6) if ((family == FamilyInternet) || (family == FamilyInternet6)) { char hostname[SI_HOSTNAME_MAXLEN]; struct addrinfo *addresses; struct addrinfo *a; int f, hostaddrlen; void *hostaddr = NULL; if (siAddrLen >= sizeof(hostname)) return FALSE; strlcpy(hostname, siAddr, siAddrLen + 1); if (getaddrinfo(hostname, NULL, NULL, &addresses) == 0) { for (a = addresses; a != NULL; a = a->ai_next) { hostaddrlen = a->ai_addrlen; f = ConvertAddr(a->ai_addr, &hostaddrlen, &hostaddr); if ((f == family) && (len == hostaddrlen) && hostaddr && (memcmp(addr, hostaddr, len) == 0)) { res = TRUE; break; } } freeaddrinfo(addresses); } } #else /* IPv6 not supported, use gethostbyname instead for IPv4 */ if (family == FamilyInternet) { register struct hostent *hp; #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif char hostname[SI_HOSTNAME_MAXLEN]; int f, hostaddrlen; void *hostaddr; const char **addrlist; if (siAddrLen >= sizeof(hostname)) return FALSE; strlcpy(hostname, siAddr, siAddrLen + 1); if ((hp = _XGethostbyname(hostname, hparams)) != NULL) { #ifdef h_addr /* new 4.3bsd version of gethostent */ /* iterate over the addresses */ for (addrlist = hp->h_addr_list; *addrlist; addrlist++) #else addrlist = &hp->h_addr; #endif { struct sockaddr_in sin; sin.sin_family = hp->h_addrtype; memcpy(&(sin.sin_addr), *addrlist, hp->h_length); hostaddrlen = sizeof(sin); f = ConvertAddr((struct sockaddr *) &sin, &hostaddrlen, &hostaddr); if ((f == family) && (len == hostaddrlen) && (memcmp(addr, hostaddr, len) == 0)) { res = TRUE; break; } } } } #endif return res; } static int siHostnameCheckAddr(const char *valueString, int length, void *typePriv) { /* Check conformance of hostname to RFC 2396 sec. 3.2.2 definition. * We do not use ctype functions here to avoid locale-specific * character sets. Hostnames must be pure ASCII. */ int len = length; int i; Bool dotAllowed = FALSE; Bool dashAllowed = FALSE; if ((length <= 0) || (length >= SI_HOSTNAME_MAXLEN)) { len = -1; } else { for (i = 0; i < length; i++) { char c = valueString[i]; if (c == 0x2E) { /* '.' */ if (dotAllowed == FALSE) { len = -1; break; } else { dotAllowed = FALSE; dashAllowed = FALSE; } } else if (c == 0x2D) { /* '-' */ if (dashAllowed == FALSE) { len = -1; break; } else { dotAllowed = FALSE; } } else if (((c >= 0x30) && (c <= 0x3A)) /* 0-9 */ || ((c >= 0x61) && (c <= 0x7A)) /* a-z */ || ((c >= 0x41) && (c <= 0x5A)) /* A-Z */ ) { dotAllowed = TRUE; dashAllowed = TRUE; } else { /* Invalid character */ len = -1; break; } } } return len; } #if defined(IPv6) && defined(AF_INET6) /*** * "ipv6" server interpreted type * * Currently supports only IPv6 literal address as specified in IETF RFC 3513 * * Once draft-ietf-ipv6-scoping-arch-00.txt becomes an RFC, support will be * added for the scoped address format it specifies. */ /* Maximum length of an IPv6 address string - increase when adding support * for scoped address qualifiers. Includes room for trailing NUL byte. */ #define SI_IPv6_MAXLEN INET6_ADDRSTRLEN static Bool siIPv6AddrMatch(int family, void *addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv) { struct in6_addr addr6; char addrbuf[SI_IPv6_MAXLEN]; if ((family != FamilyInternet6) || (len != sizeof(addr6))) return FALSE; memcpy(addrbuf, siAddr, siAddrlen); addrbuf[siAddrlen] = '\0'; if (inet_pton(AF_INET6, addrbuf, &addr6) != 1) { perror("inet_pton"); return FALSE; } if (memcmp(addr, &addr6, len) == 0) { return TRUE; } else { return FALSE; } } static int siIPv6CheckAddr(const char *addrString, int length, void *typePriv) { int len; /* Minimum length is 3 (smallest legal address is "::1") */ if (length < 3) { /* Address is too short! */ len = -1; } else if (length >= SI_IPv6_MAXLEN) { /* Address is too long! */ len = -1; } else { /* Assume inet_pton is sufficient validation */ struct in6_addr addr6; char addrbuf[SI_IPv6_MAXLEN]; memcpy(addrbuf, addrString, length); addrbuf[length] = '\0'; if (inet_pton(AF_INET6, addrbuf, &addr6) != 1) { perror("inet_pton"); len = -1; } else { len = length; } } return len; } #endif /* IPv6 */ #if !defined(NO_LOCAL_CLIENT_CRED) /*** * "localuser" & "localgroup" server interpreted types * * Allows local connections from a given local user or group */ #include #include #define LOCAL_USER 1 #define LOCAL_GROUP 2 typedef struct { int credType; } siLocalCredPrivRec, *siLocalCredPrivPtr; static siLocalCredPrivRec siLocalUserPriv = { LOCAL_USER }; static siLocalCredPrivRec siLocalGroupPriv = { LOCAL_GROUP }; static Bool siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id) { Bool parsedOK = FALSE; char *addrbuf = malloc(len + 1); if (addrbuf == NULL) { return FALSE; } memcpy(addrbuf, addr, len); addrbuf[len] = '\0'; if (addr[0] == '#') { /* numeric id */ char *cp; errno = 0; *id = strtol(addrbuf + 1, &cp, 0); if ((errno == 0) && (cp != (addrbuf + 1))) { parsedOK = TRUE; } } else { /* non-numeric name */ if (lcPriv->credType == LOCAL_USER) { struct passwd *pw = getpwnam(addrbuf); if (pw != NULL) { *id = (int) pw->pw_uid; parsedOK = TRUE; } } else { /* group */ struct group *gr = getgrnam(addrbuf); if (gr != NULL) { *id = (int) gr->gr_gid; parsedOK = TRUE; } } } free(addrbuf); return parsedOK; } static Bool siLocalCredAddrMatch(int family, void *addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv) { int siAddrId; LocalClientCredRec *lcc; siLocalCredPrivPtr lcPriv = (siLocalCredPrivPtr) typePriv; if (GetLocalClientCreds(client, &lcc) == -1) { return FALSE; } #ifdef HAVE_GETZONEID /* Ensure process is in the same zone */ if ((lcc->fieldsSet & LCC_ZID_SET) && (lcc->zoneid != getzoneid())) { FreeLocalClientCreds(lcc); return FALSE; } #endif if (siLocalCredGetId(siAddr, siAddrlen, lcPriv, &siAddrId) == FALSE) { FreeLocalClientCreds(lcc); return FALSE; } if (lcPriv->credType == LOCAL_USER) { if ((lcc->fieldsSet & LCC_UID_SET) && (lcc->euid == siAddrId)) { FreeLocalClientCreds(lcc); return TRUE; } } else { if ((lcc->fieldsSet & LCC_GID_SET) && (lcc->egid == siAddrId)) { FreeLocalClientCreds(lcc); return TRUE; } if (lcc->pSuppGids != NULL) { int i; for (i = 0; i < lcc->nSuppGids; i++) { if (lcc->pSuppGids[i] == siAddrId) { FreeLocalClientCreds(lcc); return TRUE; } } } } FreeLocalClientCreds(lcc); return FALSE; } static int siLocalCredCheckAddr(const char *addrString, int length, void *typePriv) { int len = length; int id; if (siLocalCredGetId(addrString, length, (siLocalCredPrivPtr) typePriv, &id) == FALSE) { len = -1; } return len; } #endif /* localuser */ static void siTypesInitialize(void) { siTypeAdd("hostname", siHostnameAddrMatch, siHostnameCheckAddr, NULL); #if defined(IPv6) && defined(AF_INET6) siTypeAdd("ipv6", siIPv6AddrMatch, siIPv6CheckAddr, NULL); #endif #if !defined(NO_LOCAL_CLIENT_CRED) siTypeAdd("localuser", siLocalCredAddrMatch, siLocalCredCheckAddr, &siLocalUserPriv); siTypeAdd("localgroup", siLocalCredAddrMatch, siLocalCredCheckAddr, &siLocalGroupPriv); #endif } xorg-server-1.17.1/os/busfault.c0000664000175100017510000001003612456571574013443 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "misc.h" #include #include #include #include #include #include #include struct busfault { struct xorg_list list; void *addr; size_t size; Bool valid; busfault_notify_ptr notify; void *context; }; static Bool busfaulted; static struct xorg_list busfaults; struct busfault * busfault_register_mmap(void *addr, size_t size, busfault_notify_ptr notify, void *context) { struct busfault *busfault; busfault = calloc(1, sizeof (struct busfault)); if (!busfault) return NULL; busfault->addr = addr; busfault->size = size; busfault->notify = notify; busfault->context = context; busfault->valid = TRUE; xorg_list_add(&busfault->list, &busfaults); return busfault; } void busfault_unregister(struct busfault *busfault) { xorg_list_del(&busfault->list); free(busfault); } void busfault_check(void) { struct busfault *busfault, *tmp; if (!busfaulted) return; busfaulted = FALSE; xorg_list_for_each_entry_safe(busfault, tmp, &busfaults, list) { if (!busfault->valid) (*busfault->notify)(busfault->context); } } static void (*previous_busfault_sigaction)(int sig, siginfo_t *info, void *param); static void busfault_sigaction(int sig, siginfo_t *info, void *param) { void *fault = info->si_addr; struct busfault *busfault = NULL; void *new_addr; /* Locate the faulting address in our list of shared segments */ xorg_list_for_each_entry(busfault, &busfaults, list) { if ((char *) busfault->addr <= (char *) fault && (char *) fault < (char *) busfault->addr + busfault->size) { break; } } if (!busfault) goto panic; if (!busfault->valid) goto panic; busfault->valid = FALSE; busfaulted = TRUE; /* The client truncated the file; unmap the shared file, map * /dev/zero over that area and keep going */ new_addr = mmap(busfault->addr, busfault->size, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, 0); if (new_addr == MAP_FAILED) goto panic; return; panic: if (previous_busfault_sigaction) (*previous_busfault_sigaction)(sig, info, param); else FatalError("bus error"); } Bool busfault_init(void) { struct sigaction act, old_act; act.sa_sigaction = busfault_sigaction; act.sa_flags = SA_SIGINFO; sigemptyset(&act.sa_mask); if (sigaction(SIGBUS, &act, &old_act) < 0) return FALSE; previous_busfault_sigaction = old_act.sa_sigaction; xorg_list_init(&busfaults); return TRUE; } xorg-server-1.17.1/os/osdep.h0000664000175100017510000002007512456571574012741 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 #ifndef _OSDEP_H_ #define _OSDEP_H_ 1 #if defined(XDMCP) || defined(HASXDMAUTH) #include #endif #ifdef _POSIX_SOURCE #include #else #define _POSIX_SOURCE #include #undef _POSIX_SOURCE #endif #ifndef OPEN_MAX #ifdef SVR4 #define OPEN_MAX 256 #else #include #ifndef OPEN_MAX #if defined(NOFILE) && !defined(NOFILES_MAX) #define OPEN_MAX NOFILE #else #if !defined(WIN32) #define OPEN_MAX NOFILES_MAX #else #define OPEN_MAX 256 #endif #endif #endif #endif #endif #include /* * MAXSOCKS is used only for initialising MaxClients when no other method * like sysconf(_SC_OPEN_MAX) is not supported. */ #if OPEN_MAX <= 256 #define MAXSOCKS (OPEN_MAX - 1) #else #define MAXSOCKS 256 #endif /* MAXSELECT is the number of fds that select() can handle */ #define MAXSELECT (sizeof(fd_set) * NBBY) #include #if defined(XDMCP) || defined(HASXDMAUTH) typedef Bool (*ValidatorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type); typedef Bool (*GeneratorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type); typedef Bool (*AddAuthorFunc) (unsigned name_length, const char *name, unsigned data_length, char *data); #endif typedef struct _connectionInput *ConnectionInputPtr; typedef struct _connectionOutput *ConnectionOutputPtr; struct _osComm; #define AuthInitArgs void typedef void (*AuthInitFunc) (AuthInitArgs); #define AuthAddCArgs unsigned short data_length, const char *data, XID id typedef int (*AuthAddCFunc) (AuthAddCArgs); #define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, const char **reason typedef XID (*AuthCheckFunc) (AuthCheckArgs); #define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap typedef int (*AuthFromIDFunc) (AuthFromIDArgs); #define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return typedef XID (*AuthGenCFunc) (AuthGenCArgs); #define AuthRemCArgs unsigned short data_length, const char *data typedef int (*AuthRemCFunc) (AuthRemCArgs); #define AuthRstCArgs void typedef int (*AuthRstCFunc) (AuthRstCArgs); #define AuthToIDArgs unsigned short data_length, char *data typedef XID (*AuthToIDFunc) (AuthToIDArgs); typedef void (*OsCloseFunc) (ClientPtr); typedef int (*OsFlushFunc) (ClientPtr who, struct _osComm * oc, char *extraBuf, int extraCount); typedef struct _osComm { int fd; ConnectionInputPtr input; ConnectionOutputPtr output; XID auth_id; /* authorization id */ CARD32 conn_time; /* timestamp if not established, else 0 */ struct _XtransConnInfo *trans_conn; /* transport connection object */ } OsCommRec, *OsCommPtr; extern int FlushClient(ClientPtr /*who */ , OsCommPtr /*oc */ , const void * /*extraBuf */ , int /*extraCount */ ); extern void FreeOsBuffers(OsCommPtr /*oc */ ); #include "dix.h" extern fd_set AllSockets; extern fd_set AllClients; extern fd_set LastSelectMask; extern fd_set WellKnownConnections; extern fd_set EnabledDevices; extern fd_set ClientsWithInput; extern fd_set ClientsWriteBlocked; extern fd_set OutputPending; extern fd_set IgnoredClientsWithInput; #ifndef WIN32 extern int *ConnectionTranslation; #else extern int GetConnectionTranslation(int conn); extern void SetConnectionTranslation(int conn, int client); extern void ClearConnectionTranslation(void); #endif extern Bool NewOutputPending; extern Bool AnyClientsWriteBlocked; extern WorkQueuePtr workQueue; /* in WaitFor.c */ #ifdef WIN32 typedef long int fd_mask; #endif #define ffs mffs extern int mffs(fd_mask); /* in access.c */ extern Bool ComputeLocalClient(ClientPtr client); /* in auth.c */ extern void GenerateRandomData(int len, char *buf); /* in mitauth.c */ extern XID MitCheckCookie(AuthCheckArgs); extern XID MitGenerateCookie(AuthGenCArgs); extern XID MitToID(AuthToIDArgs); extern int MitAddCookie(AuthAddCArgs); extern int MitFromID(AuthFromIDArgs); extern int MitRemoveCookie(AuthRemCArgs); extern int MitResetCookie(AuthRstCArgs); /* in xdmauth.c */ #ifdef HASXDMAUTH extern XID XdmCheckCookie(AuthCheckArgs); extern XID XdmToID(AuthToIDArgs); extern int XdmAddCookie(AuthAddCArgs); extern int XdmFromID(AuthFromIDArgs); extern int XdmRemoveCookie(AuthRemCArgs); extern int XdmResetCookie(AuthRstCArgs); #endif /* in rpcauth.c */ #ifdef SECURE_RPC extern void SecureRPCInit(AuthInitArgs); extern XID SecureRPCCheck(AuthCheckArgs); extern XID SecureRPCToID(AuthToIDArgs); extern int SecureRPCAdd(AuthAddCArgs); extern int SecureRPCFromID(AuthFromIDArgs); extern int SecureRPCRemove(AuthRemCArgs); extern int SecureRPCReset(AuthRstCArgs); #endif #ifdef XDMCP /* in xdmcp.c */ extern void XdmcpUseMsg(void); extern int XdmcpOptions(int argc, char **argv, int i); extern void XdmcpRegisterConnection(int type, const char *address, int addrlen); extern void XdmcpRegisterAuthorizations(void); extern void XdmcpRegisterAuthorization(const char *name, int namelen); extern void XdmcpInit(void); extern void XdmcpReset(void); extern void XdmcpOpenDisplay(int sock); extern void XdmcpCloseDisplay(int sock); extern void XdmcpRegisterAuthentication(const char *name, int namelen, const char *data, int datalen, ValidatorFunc Validator, GeneratorFunc Generator, AddAuthorFunc AddAuth); struct sockaddr_in; extern void XdmcpRegisterBroadcastAddress(const struct sockaddr_in *addr); #endif #ifdef HASXDMAUTH extern void XdmAuthenticationInit(const char *cookie, int cookie_length); #endif #endif /* _OSDEP_H_ */ xorg-server-1.17.1/os/xdmauth.c0000664000175100017510000003154512274325511013262 00000000000000/* Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * XDM-AUTHENTICATION-1 (XDMCP authentication) and * XDM-AUTHORIZATION-1 (client authorization) protocols * * Author: Keith Packard, MIT X Consortium */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN #include #include "os.h" #include "osdep.h" #include "dixstruct.h" #ifdef HASXDMAUTH static Bool authFromXDMCP; #ifdef XDMCP #include #undef REQUEST #include /* XDM-AUTHENTICATION-1 */ static XdmAuthKeyRec privateKey; static char XdmAuthenticationName[] = "XDM-AUTHENTICATION-1"; #define XdmAuthenticationNameLen (sizeof XdmAuthenticationName - 1) static XdmAuthKeyRec global_rho; static Bool XdmAuthenticationValidator(ARRAY8Ptr privateData, ARRAY8Ptr incomingData, xdmOpCode packet_type) { XdmAuthKeyPtr incoming; XdmcpUnwrap(incomingData->data, (unsigned char *) &privateKey, incomingData->data, incomingData->length); if (packet_type == ACCEPT) { if (incomingData->length != 8) return FALSE; incoming = (XdmAuthKeyPtr) incomingData->data; XdmcpDecrementKey(incoming); return XdmcpCompareKeys(incoming, &global_rho); } return FALSE; } static Bool XdmAuthenticationGenerator(ARRAY8Ptr privateData, ARRAY8Ptr outgoingData, xdmOpCode packet_type) { outgoingData->length = 0; outgoingData->data = 0; if (packet_type == REQUEST) { if (XdmcpAllocARRAY8(outgoingData, 8)) XdmcpWrap((unsigned char *) &global_rho, (unsigned char *) &privateKey, outgoingData->data, 8); } return TRUE; } static Bool XdmAuthenticationAddAuth(int name_len, const char *name, int data_len, char *data) { Bool ret; XdmcpUnwrap((unsigned char *) data, (unsigned char *) &privateKey, (unsigned char *) data, data_len); authFromXDMCP = TRUE; ret = AddAuthorization(name_len, name, data_len, data); authFromXDMCP = FALSE; return ret; } #define atox(c) ('0' <= c && c <= '9' ? c - '0' : \ 'a' <= c && c <= 'f' ? c - 'a' + 10 : \ 'A' <= c && c <= 'F' ? c - 'A' + 10 : -1) static int HexToBinary(const char *in, char *out, int len) { int top, bottom; while (len > 0) { top = atox(in[0]); if (top == -1) return 0; bottom = atox(in[1]); if (bottom == -1) return 0; *out++ = (top << 4) | bottom; in += 2; len -= 2; } if (len) return 0; *out++ = '\0'; return 1; } void XdmAuthenticationInit(const char *cookie, int cookie_len) { memset(privateKey.data, 0, 8); if (!strncmp(cookie, "0x", 2) || !strncmp(cookie, "0X", 2)) { if (cookie_len > 2 + 2 * 8) cookie_len = 2 + 2 * 8; HexToBinary(cookie + 2, (char *) privateKey.data, cookie_len - 2); } else { if (cookie_len > 7) cookie_len = 7; memmove(privateKey.data + 1, cookie, cookie_len); } XdmcpGenerateKey(&global_rho); XdmcpRegisterAuthentication(XdmAuthenticationName, XdmAuthenticationNameLen, (char *) &global_rho, sizeof(global_rho), (ValidatorFunc) XdmAuthenticationValidator, (GeneratorFunc) XdmAuthenticationGenerator, (AddAuthorFunc) XdmAuthenticationAddAuth); } #endif /* XDMCP */ /* XDM-AUTHORIZATION-1 */ typedef struct _XdmAuthorization { struct _XdmAuthorization *next; XdmAuthKeyRec rho; XdmAuthKeyRec key; XID id; } XdmAuthorizationRec, *XdmAuthorizationPtr; static XdmAuthorizationPtr xdmAuth; typedef struct _XdmClientAuth { struct _XdmClientAuth *next; XdmAuthKeyRec rho; char client[6]; long time; } XdmClientAuthRec, *XdmClientAuthPtr; static XdmClientAuthPtr xdmClients; static long clockOffset; static Bool gotClock; #define TwentyMinutes (20 * 60) #define TwentyFiveMinutes (25 * 60) static Bool XdmClientAuthCompare(const XdmClientAuthPtr a, const XdmClientAuthPtr b) { int i; if (!XdmcpCompareKeys(&a->rho, &b->rho)) return FALSE; for (i = 0; i < 6; i++) if (a->client[i] != b->client[i]) return FALSE; return a->time == b->time; } static void XdmClientAuthDecode(const unsigned char *plain, XdmClientAuthPtr auth) { int i, j; j = 0; for (i = 0; i < 8; i++) { auth->rho.data[i] = plain[j]; ++j; } for (i = 0; i < 6; i++) { auth->client[i] = plain[j]; ++j; } auth->time = 0; for (i = 0; i < 4; i++) { auth->time |= plain[j] << ((3 - i) << 3); j++; } } static void XdmClientAuthTimeout(long now) { XdmClientAuthPtr client, next, prev; prev = 0; for (client = xdmClients; client; client = next) { next = client->next; if (abs(now - client->time) > TwentyFiveMinutes) { if (prev) prev->next = next; else xdmClients = next; free(client); } else prev = client; } } static XdmClientAuthPtr XdmAuthorizationValidate(unsigned char *plain, int length, XdmAuthKeyPtr rho, ClientPtr xclient, const char **reason) { XdmClientAuthPtr client, existing; long now; int i; if (length != (192 / 8)) { if (reason) *reason = "Bad XDM authorization key length"; return NULL; } client = malloc(sizeof(XdmClientAuthRec)); if (!client) return NULL; XdmClientAuthDecode(plain, client); if (!XdmcpCompareKeys(&client->rho, rho)) { free(client); if (reason) *reason = "Invalid XDM-AUTHORIZATION-1 key (failed key comparison)"; return NULL; } for (i = 18; i < 24; i++) if (plain[i] != 0) { free(client); if (reason) *reason = "Invalid XDM-AUTHORIZATION-1 key (failed NULL check)"; return NULL; } if (xclient) { int family, addr_len; Xtransaddr *addr; if (_XSERVTransGetPeerAddr(((OsCommPtr) xclient->osPrivate)->trans_conn, &family, &addr_len, &addr) == 0 && _XSERVTransConvertAddress(&family, &addr_len, &addr) == 0) { #if defined(TCPCONN) || defined(STREAMSCONN) if (family == FamilyInternet && memcmp((char *) addr, client->client, 4) != 0) { free(client); free(addr); if (reason) *reason = "Invalid XDM-AUTHORIZATION-1 key (failed address comparison)"; return NULL; } #endif free(addr); } } now = time(0); if (!gotClock) { clockOffset = client->time - now; gotClock = TRUE; } now += clockOffset; XdmClientAuthTimeout(now); if (abs(client->time - now) > TwentyMinutes) { free(client); if (reason) *reason = "Excessive XDM-AUTHORIZATION-1 time offset"; return NULL; } for (existing = xdmClients; existing; existing = existing->next) { if (XdmClientAuthCompare(existing, client)) { free(client); if (reason) *reason = "XDM authorization key matches an existing client!"; return NULL; } } return client; } int XdmAddCookie(unsigned short data_length, const char *data, XID id) { XdmAuthorizationPtr new; unsigned char *rho_bits, *key_bits; switch (data_length) { case 16: /* auth from files is 16 bytes long */ #ifdef XDMCP if (authFromXDMCP) { /* R5 xdm sent bogus authorization data in the accept packet, * but we can recover */ rho_bits = global_rho.data; key_bits = (unsigned char *) data; key_bits[0] = '\0'; } else #endif { rho_bits = (unsigned char *) data; key_bits = (unsigned char *) (data + 8); } break; #ifdef XDMCP case 8: /* auth from XDMCP is 8 bytes long */ rho_bits = global_rho.data; key_bits = (unsigned char *) data; break; #endif default: return 0; } /* the first octet of the key must be zero */ if (key_bits[0] != '\0') return 0; new = malloc(sizeof(XdmAuthorizationRec)); if (!new) return 0; new->next = xdmAuth; xdmAuth = new; memmove(new->key.data, key_bits, (int) 8); memmove(new->rho.data, rho_bits, (int) 8); new->id = id; return 1; } XID XdmCheckCookie(unsigned short cookie_length, const char *cookie, ClientPtr xclient, const char **reason) { XdmAuthorizationPtr auth; XdmClientAuthPtr client; unsigned char *plain; /* Auth packets must be a multiple of 8 bytes long */ if (cookie_length & 7) return (XID) -1; plain = malloc(cookie_length); if (!plain) return (XID) -1; for (auth = xdmAuth; auth; auth = auth->next) { XdmcpUnwrap((unsigned char *) cookie, (unsigned char *) &auth->key, plain, cookie_length); if ((client = XdmAuthorizationValidate(plain, cookie_length, &auth->rho, xclient, reason)) != NULL) { client->next = xdmClients; xdmClients = client; free(plain); return auth->id; } } free(plain); return (XID) -1; } int XdmResetCookie(void) { XdmAuthorizationPtr auth, next_auth; XdmClientAuthPtr client, next_client; for (auth = xdmAuth; auth; auth = next_auth) { next_auth = auth->next; free(auth); } xdmAuth = 0; for (client = xdmClients; client; client = next_client) { next_client = client->next; free(client); } xdmClients = (XdmClientAuthPtr) 0; return 1; } XID XdmToID(unsigned short cookie_length, char *cookie) { XdmAuthorizationPtr auth; XdmClientAuthPtr client; unsigned char *plain; plain = malloc(cookie_length); if (!plain) return (XID) -1; for (auth = xdmAuth; auth; auth = auth->next) { XdmcpUnwrap((unsigned char *) cookie, (unsigned char *) &auth->key, plain, cookie_length); if ((client = XdmAuthorizationValidate(plain, cookie_length, &auth->rho, NULL, NULL)) != NULL) { free(client); free(cookie); free(plain); return auth->id; } } free(cookie); free(plain); return (XID) -1; } int XdmFromID(XID id, unsigned short *data_lenp, char **datap) { XdmAuthorizationPtr auth; for (auth = xdmAuth; auth; auth = auth->next) { if (id == auth->id) { *data_lenp = 16; *datap = (char *) &auth->rho; return 1; } } return 0; } int XdmRemoveCookie(unsigned short data_length, const char *data) { XdmAuthorizationPtr auth; XdmAuthKeyPtr key_bits, rho_bits; switch (data_length) { case 16: rho_bits = (XdmAuthKeyPtr) data; key_bits = (XdmAuthKeyPtr) (data + 8); break; #ifdef XDMCP case 8: rho_bits = &global_rho; key_bits = (XdmAuthKeyPtr) data; break; #endif default: return 0; } for (auth = xdmAuth; auth; auth = auth->next) { if (XdmcpCompareKeys(rho_bits, &auth->rho) && XdmcpCompareKeys(key_bits, &auth->key)) { xdmAuth = auth->next; free(auth); return 1; } } return 0; } #endif xorg-server-1.17.1/os/strndup.c0000664000175100017510000000372712274325511013310 00000000000000/* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "os.h" char * strndup(const char *str, size_t n) { size_t len; char *copy; for (len = 0; len < n && str[len]; len++) continue; if ((copy = malloc(len + 1)) == NULL) return (NULL); memcpy(copy, str, len); copy[len] = '\0'; return (copy); } xorg-server-1.17.1/os/backtrace.c0000664000175100017510000002036212274325511013522 00000000000000/* * Copyright 2008 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 "os.h" #include "misc.h" #include #include #ifdef HAVE_LIBUNWIND #define UNW_LOCAL_ONLY #include #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include void xorg_backtrace(void) { unw_cursor_t cursor; unw_context_t context; unw_word_t off; unw_proc_info_t pip; int ret, i = 0; char procname[256]; const char *filename; Dl_info dlinfo; pip.unwind_info = NULL; ret = unw_getcontext(&context); if (ret) { ErrorFSigSafe("unw_getcontext failed: %s [%d]\n", unw_strerror(ret), ret); return; } ret = unw_init_local(&cursor, &context); if (ret) { ErrorFSigSafe("unw_init_local failed: %s [%d]\n", unw_strerror(ret), ret); return; } ErrorFSigSafe("\n"); ErrorFSigSafe("Backtrace:\n"); ret = unw_step(&cursor); while (ret > 0) { ret = unw_get_proc_info(&cursor, &pip); if (ret) { ErrorFSigSafe("unw_get_proc_info failed: %s [%d]\n", unw_strerror(ret), ret); break; } ret = unw_get_proc_name(&cursor, procname, 256, &off); if (ret && ret != -UNW_ENOMEM) { if (ret != -UNW_EUNSPEC) ErrorFSigSafe("unw_get_proc_name failed: %s [%d]\n", unw_strerror(ret), ret); procname[0] = '?'; procname[1] = 0; } if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname && *dlinfo.dli_fname) filename = dlinfo.dli_fname; else filename = "?"; ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname, ret == -UNW_ENOMEM ? "..." : "", (int)off, (void *)(pip.start_ip + off)); ret = unw_step(&cursor); if (ret < 0) ErrorFSigSafe("unw_step failed: %s [%d]\n", unw_strerror(ret), ret); } ErrorFSigSafe("\n"); } #else /* HAVE_LIBUNWIND */ #ifdef HAVE_BACKTRACE #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include void xorg_backtrace(void) { const int BT_SIZE = 64; void *array[BT_SIZE]; const char *mod; int size, i; Dl_info info; ErrorFSigSafe("\n"); ErrorFSigSafe("Backtrace:\n"); size = backtrace(array, BT_SIZE); for (i = 0; i < size; i++) { int rc = dladdr(array[i], &info); if (rc == 0) { ErrorFSigSafe("%u: ?? [%p]\n", i, array[i]); continue; } mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)"; if (info.dli_saddr) 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 ErrorFSigSafe( "%u: %s (%p+0x%x) [%p]\n", i, mod, info.dli_fbase, (unsigned int)((char *) array[i] - (char *) info.dli_fbase), array[i]); } ErrorFSigSafe("\n"); } #else /* not glibc or glibc < 2.1 */ #if defined(sun) && defined(__SVR4) #define HAVE_PSTACK #endif #if defined(HAVE_WALKCONTEXT) /* Solaris 9 & later */ #include #include #include #include #ifdef _LP64 #define ElfSym Elf64_Sym #else #define ElfSym Elf32_Sym #endif /* Called for each frame on the stack to print it's contents */ static int xorg_backtrace_frame(uintptr_t pc, int signo, void *arg) { Dl_info dlinfo; ElfSym *dlsym; char header[32]; int depth = *((int *) arg); if (signo) { char signame[SIG2STR_MAX]; if (sig2str(signo, signame) != 0) { strcpy(signame, "unknown"); } ErrorFSigSafe("** Signal %u (%s)\n", signo, signame); } snprintf(header, sizeof(header), "%d: 0x%lx", depth, pc); *((int *) arg) = depth + 1; /* Ask system dynamic loader for info on the address */ if (dladdr1((void *) pc, &dlinfo, (void **) &dlsym, RTLD_DL_SYMENT)) { unsigned long offset = pc - (uintptr_t) dlinfo.dli_saddr; const char *symname; if (offset < dlsym->st_size) { /* inside a function */ symname = dlinfo.dli_sname; } else { /* found which file it was in, but not which function */ symname = "
"; offset = pc - (uintptr_t) dlinfo.dli_fbase; } ErrorFSigSafe("%s: %s:%s+0x%x\n", header, dlinfo.dli_fname, symname, offset); } else { /* Couldn't find symbol info from system dynamic loader, should * probably poke elfloader here, but haven't written that code yet, * so we just print the pc. */ ErrorFSigSafe("%s\n", header); } return 0; } #endif /* HAVE_WALKCONTEXT */ #ifdef HAVE_PSTACK static int xorg_backtrace_pstack(void) { pid_t kidpid; int pipefd[2]; if (pipe(pipefd) != 0) { return -1; } kidpid = fork1(); if (kidpid == -1) { /* ERROR */ return -1; } else if (kidpid == 0) { /* CHILD */ char parent[16]; seteuid(0); close(STDIN_FILENO); close(STDOUT_FILENO); dup2(pipefd[1], STDOUT_FILENO); closefrom(STDERR_FILENO); snprintf(parent, sizeof(parent), "%d", getppid()); execle("/usr/bin/pstack", "pstack", parent, NULL); exit(1); } else { /* PARENT */ char btline[256]; int kidstat; int bytesread; int done = 0; close(pipefd[1]); while (!done) { bytesread = read(pipefd[0], btline, sizeof(btline) - 1); if (bytesread > 0) { btline[bytesread] = 0; ErrorFSigSafe("%s", btline); } else if ((bytesread < 0) || ((errno != EINTR) && (errno != EAGAIN))) done = 1; } close(pipefd[0]); waitpid(kidpid, &kidstat, 0); if (kidstat != 0) return -1; } return 0; } #endif /* HAVE_PSTACK */ #if defined(HAVE_PSTACK) || defined(HAVE_WALKCONTEXT) void xorg_backtrace(void) { ErrorFSigSafe("\n"); ErrorFSigSafe("Backtrace:\n"); #ifdef HAVE_PSTACK /* First try fork/exec of pstack - otherwise fall back to walkcontext pstack is preferred since it can print names of non-exported functions */ if (xorg_backtrace_pstack() < 0) #endif { #ifdef HAVE_WALKCONTEXT ucontext_t u; int depth = 1; if (getcontext(&u) == 0) walkcontext(&u, xorg_backtrace_frame, &depth); else #endif ErrorFSigSafe("Failed to get backtrace info: %s\n", strerror(errno)); } ErrorFSigSafe("\n"); } #else /* Default fallback if we can't find any way to get a backtrace */ void xorg_backtrace(void) { return; } #endif #endif #endif xorg-server-1.17.1/os/Makefile.in0000664000175100017510000007146412466505436013526 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @SECURE_RPC_TRUE@am__append_1 = $(SECURERPC_SRCS) @XDMCP_TRUE@am__append_2 = $(XDMCP_SRCS) @HAVE_LIBUNWIND_TRUE@am__append_3 = $(LIBUNWIND_CFLAGS) @HAVE_LIBUNWIND_TRUE@am__append_4 = $(LIBUNWIND_LIBS) @BUSFAULT_TRUE@am__append_5 = $(BUSFAULT_SRCS) @SPECIAL_DTRACE_OBJECTS_TRUE@noinst_PROGRAMS = os.O$(EXEEXT) subdir = os DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am strlcpy.c \ strndup.c strcasestr.c strlcat.c strcasecmp.c \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = @HAVE_LIBUNWIND_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) libos_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LTLIBOBJS) \ $(am__DEPENDENCIES_2) am__libos_la_SOURCES_DIST = WaitFor.c access.c auth.c backtrace.c \ client.c connection.c io.c mitauth.c oscolor.c osdep.h \ osinit.c utils.c xdmauth.c xsha1.c xstrans.c xprintf.c log.c \ rpcauth.c xdmcp.c busfault.c am__objects_1 = log.lo am__objects_2 = rpcauth.lo @SECURE_RPC_TRUE@am__objects_3 = $(am__objects_2) am__objects_4 = xdmcp.lo @XDMCP_TRUE@am__objects_5 = $(am__objects_4) am__objects_6 = busfault.lo @BUSFAULT_TRUE@am__objects_7 = $(am__objects_6) am_libos_la_OBJECTS = WaitFor.lo access.lo auth.lo backtrace.lo \ client.lo connection.lo io.lo mitauth.lo oscolor.lo osinit.lo \ utils.lo xdmauth.lo xsha1.lo xstrans.lo xprintf.lo \ $(am__objects_1) $(am__objects_3) $(am__objects_5) \ $(am__objects_7) libos_la_OBJECTS = $(am_libos_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 = PROGRAMS = $(noinst_PROGRAMS) am_os_O_OBJECTS = os_O_OBJECTS = $(am_os_O_OBJECTS) os_O_LDADD = $(LDADD) 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 = $(libos_la_SOURCES) $(os_O_SOURCES) DIST_SOURCES = $(am__libos_la_SOURCES_DIST) $(os_O_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libos.la AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) $(am__append_3) SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c XORG_SRCS = log.c BUSFAULT_SRCS = busfault.c libos_la_SOURCES = WaitFor.c access.c auth.c backtrace.c client.c \ connection.c io.c mitauth.c oscolor.c osdep.h osinit.c utils.c \ xdmauth.c xsha1.c xstrans.c xprintf.c $(XORG_SRCS) \ $(am__append_1) $(am__append_2) $(am__append_5) libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS) \ $(am__append_4) EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) @SPECIAL_DTRACE_OBJECTS_TRUE@os_O_SOURCES = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 os/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign os/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libos.la: $(libos_la_OBJECTS) $(libos_la_DEPENDENCIES) $(EXTRA_libos_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libos_la_OBJECTS) $(libos_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list @SPECIAL_DTRACE_OBJECTS_FALSE@os.O$(EXEEXT): $(os_O_OBJECTS) $(os_O_DEPENDENCIES) $(EXTRA_os_O_DEPENDENCIES) @SPECIAL_DTRACE_OBJECTS_FALSE@ @rm -f os.O$(EXEEXT) @SPECIAL_DTRACE_OBJECTS_FALSE@ $(AM_V_CCLD)$(LINK) $(os_O_OBJECTS) $(os_O_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasestr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strlcat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strlcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strndup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WaitFor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/busfault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mitauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oscolor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdmauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdmcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsha1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrans.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) $(PROGRAMS) 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 \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf $(DEPDIR) ./$(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) ./$(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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am 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 tags-am uninstall uninstall-am # Generate dtrace object code for probes in libos & libdix @SPECIAL_DTRACE_OBJECTS_TRUE@dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o @SPECIAL_DTRACE_OBJECTS_TRUE@os.O: dtrace.o $(am_libos_la_OBJECTS) @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o # 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: xorg-server-1.17.1/os/utils.c0000664000175100017510000015517312432306326012753 00000000000000/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, Copyright 1994 Quarterdeck Office Systems. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital and Quarterdeck not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 #ifdef __CYGWIN__ #include #include /* Sigh... We really need a prototype for this to know it is stdcall, but #include-ing here is not a good idea... */ __stdcall unsigned long GetTickCount(void); #endif #if defined(WIN32) && !defined(__CYGWIN__) #include #endif #include #include #include #if !defined(WIN32) || !defined(__MINGW32__) #include #include # define SMART_SCHEDULE_POSSIBLE #endif #include "misc.h" #include #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN #include #include "input.h" #include "dixfont.h" #include "osdep.h" #include "extension.h" #ifdef X_POSIX_C_SOURCE #define _POSIX_C_SOURCE X_POSIX_C_SOURCE #include #undef _POSIX_C_SOURCE #else #if defined(_POSIX_SOURCE) #include #else #define _POSIX_SOURCE #include #undef _POSIX_SOURCE #endif #endif #ifndef WIN32 #include #endif #if !defined(SYSV) && !defined(WIN32) #include #endif #include #include /* for isspace */ #include #include /* for malloc() */ #if defined(TCPCONN) || defined(STREAMSCONN) #ifndef WIN32 #include #endif #endif #include "opaque.h" #include "dixstruct.h" #include "xkbsrv.h" #include "picture.h" Bool noTestExtensions; #ifdef COMPOSITE Bool noCompositeExtension = FALSE; #endif #ifdef DAMAGE Bool noDamageExtension = FALSE; #endif #ifdef DBE Bool noDbeExtension = FALSE; #endif #ifdef DPMSExtension Bool noDPMSExtension = FALSE; #endif #ifdef GLXEXT Bool noGlxExtension = FALSE; #endif #ifdef SCREENSAVER Bool noScreenSaverExtension = FALSE; #endif #ifdef MITSHM Bool noMITShmExtension = FALSE; #endif #ifdef RANDR Bool noRRExtension = FALSE; #endif Bool noRenderExtension = FALSE; #ifdef XCSECURITY Bool noSecurityExtension = FALSE; #endif #ifdef RES Bool noResExtension = FALSE; #endif #ifdef XF86BIGFONT Bool noXFree86BigfontExtension = FALSE; #endif #ifdef XFreeXDGA Bool noXFree86DGAExtension = FALSE; #endif #ifdef XF86DRI Bool noXFree86DRIExtension = FALSE; #endif #ifdef XF86VIDMODE Bool noXFree86VidModeExtension = FALSE; #endif Bool noXFixesExtension = FALSE; #ifdef PANORAMIX /* Xinerama is disabled by default unless enabled via +xinerama */ Bool noPanoramiXExtension = TRUE; #endif #ifdef XSELINUX Bool noSELinuxExtension = FALSE; int selinuxEnforcingState = SELINUX_MODE_DEFAULT; #endif #ifdef XV Bool noXvExtension = FALSE; #endif #ifdef DRI2 Bool noDRI2Extension = FALSE; #endif Bool noGEExtension = FALSE; #define X_INCLUDE_NETDB_H #include #include Bool CoreDump; Bool enableIndirectGLX = FALSE; #ifdef PANORAMIX Bool PanoramiXExtensionDisabledHack = FALSE; #endif 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 OsSigHandlerPtr OsSignal(int sig, OsSigHandlerPtr handler) { #if defined(WIN32) && !defined(__CYGWIN__) return signal(sig, handler); #else struct sigaction act, oact; sigemptyset(&act.sa_mask); if (handler != SIG_IGN) sigaddset(&act.sa_mask, sig); act.sa_flags = 0; act.sa_handler = handler; if (sigaction(sig, &act, &oact)) perror("sigaction"); return oact.sa_handler; #endif } /* * Explicit support for a server lock file like the ones used for UUCP. * For architectures with virtual terminals that can run more than one * server at a time. This keeps the servers from stomping on each other * if the user forgets to give them different display numbers. */ #define LOCK_DIR "/tmp" #define LOCK_TMP_PREFIX "/.tX" #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; /* * LockServer -- * Check if the server lock file exists. If so, check if the PID * contained inside is valid. If so, then die. Otherwise, create * the lock file containing the PID. */ void LockServer(void) { char tmp[PATH_MAX], pid_str[12]; int lfd, i, haslock, l_pid, t; const char *tmppath = LOCK_DIR; int len; char port[20]; if (nolock || NoListenAll) return; /* * Path names */ snprintf(port, sizeof(port), "%d", atoi(display)); len = strlen(LOCK_PREFIX) > strlen(LOCK_TMP_PREFIX) ? strlen(LOCK_PREFIX) : strlen(LOCK_TMP_PREFIX); len += strlen(tmppath) + strlen(port) + strlen(LOCK_SUFFIX) + 1; if (len > sizeof(LockFile)) FatalError("Display name `%s' is too long\n", 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 * to create the file. */ StillLocking = TRUE; i = 0; do { i++; lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644); if (lfd < 0) sleep(2); else break; } while (i < 3); if (lfd < 0) { unlink(tmp); i = 0; do { i++; lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644); if (lfd < 0) sleep(2); else break; } while (i < 3); } if (lfd < 0) FatalError("Could not create lock file in %s\n", tmp); snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); if (write(lfd, pid_str, 11) != 11) FatalError("Could not write pid to lock file in %s\n", tmp); (void) fchmod(lfd, 0444); (void) close(lfd); /* * OK. Now the tmp file exists. Try three times to move it in place * for the lock. */ i = 0; haslock = 0; while ((!haslock) && (i++ < 3)) { haslock = (link(tmp, LockFile) == 0); if (haslock) { /* * We're done. */ break; } else { /* * Read the pid from the existing file */ lfd = open(LockFile, O_RDONLY | O_NOFOLLOW); if (lfd < 0) { unlink(tmp); FatalError("Can't read lock file %s\n", LockFile); } pid_str[0] = '\0'; if (read(lfd, pid_str, 11) != 11) { /* * Bogus lock file. */ unlink(LockFile); close(lfd); continue; } pid_str[11] = '\0'; sscanf(pid_str, "%d", &l_pid); close(lfd); /* * Now try to kill the PID to see if it exists. */ errno = 0; t = kill(l_pid, 0); if ((t < 0) && (errno == ESRCH)) { /* * Stale lock file. */ unlink(LockFile); continue; } else if (((t < 0) && (errno == EPERM)) || (t == 0)) { /* * Process is still active. */ unlink(tmp); FatalError ("Server is already active for display %s\n%s %s\n%s\n", port, "\tIf this server is no longer running, remove", LockFile, "\tand start again."); } } } unlink(tmp); if (!haslock) FatalError("Could not create server lock file: %s\n", LockFile); StillLocking = FALSE; } /* * UnlockServer -- * Remove the server lock file. */ void UnlockServer(void) { if (nolock || NoListenAll) return; if (!StillLocking) { (void) unlink(LockFile); } } #endif /* LOCK_SERVER */ /* Force connections to close on SIGHUP from init */ void AutoResetServer(int sig) { int olderrno = errno; dispatchException |= DE_RESET; isItTimeToYield = TRUE; errno = olderrno; } /* Force connections to close and then exit on SIGTERM, SIGINT */ void GiveUp(int sig) { int olderrno = errno; dispatchException |= DE_TERMINATE; isItTimeToYield = TRUE; errno = olderrno; } #if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__) CARD32 GetTimeInMillis(void) { return GetTickCount(); } CARD64 GetTimeInMicros(void) { return (CARD64) GetTickCount() * 1000; } #else CARD32 GetTimeInMillis(void) { struct timeval tv; #ifdef MONOTONIC_CLOCK struct timespec tp; static clockid_t clockid; if (!clockid) { #ifdef CLOCK_MONOTONIC_COARSE if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 && (tp.tv_nsec / 1000) <= 1000 && clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0) clockid = CLOCK_MONOTONIC_COARSE; else #endif if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) clockid = CLOCK_MONOTONIC; else clockid = ~0L; } if (clockid != ~0L && clock_gettime(clockid, &tp) == 0) return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L); #endif X_GETTIMEOFDAY(&tv); return (tv.tv_sec * 1000) + (tv.tv_usec / 1000); } CARD64 GetTimeInMicros(void) { struct timeval tv; #ifdef MONOTONIC_CLOCK struct timespec tp; static clockid_t clockid; if (!clockid) { if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) clockid = CLOCK_MONOTONIC; else clockid = ~0L; } if (clockid != ~0L && clock_gettime(clockid, &tp) == 0) return (CARD64) tp.tv_sec * (CARD64)1000000 + tp.tv_nsec / 1000; #endif X_GETTIMEOFDAY(&tv); return (CARD64) tv.tv_sec * (CARD64)1000000000 + (CARD64) tv.tv_usec * 1000; } #endif void AdjustWaitForDelay(void *waitTime, unsigned long newdelay) { static struct timeval delay_val; struct timeval **wt = (struct timeval **) waitTime; unsigned long olddelay; if (*wt == NULL) { delay_val.tv_sec = newdelay / 1000; delay_val.tv_usec = 1000 * (newdelay % 1000); *wt = &delay_val; } else { olddelay = (*wt)->tv_sec * 1000 + (*wt)->tv_usec / 1000; if (newdelay < olddelay) { (*wt)->tv_sec = newdelay / 1000; (*wt)->tv_usec = 1000 * (newdelay % 1000); } } } void UseMsg(void) { ErrorF("use: X [:] [option]\n"); ErrorF("-a # default pointer acceleration (factor)\n"); ErrorF("-ac disable access control restrictions\n"); ErrorF("-audit int set audit trail level\n"); ErrorF("-auth file select authorization file\n"); ErrorF("-br create root window with black background\n"); ErrorF("+bs enable any backing store support\n"); ErrorF("-bs disable any backing store support\n"); ErrorF("-c turns off key-click\n"); ErrorF("c # key-click volume (0-100)\n"); ErrorF("-cc int default color visual class\n"); ErrorF("-nocursor disable the cursor\n"); ErrorF("-core generate core dump on fatal error\n"); ErrorF("-displayfd fd file descriptor to write display number to when ready to connect\n"); ErrorF("-dpi int screen resolution in dots per inch\n"); #ifdef DPMSExtension ErrorF("-dpms disables VESA DPMS monitor control\n"); #endif ErrorF ("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n"); ErrorF("-f # bell base (0-100)\n"); ErrorF("-fc string cursor font\n"); ErrorF("-fn string default font name\n"); ErrorF("-fp string default font path\n"); ErrorF("-help prints message with these options\n"); ErrorF("+iglx Allow creating indirect GLX contexts\n"); ErrorF("-iglx Prohibit creating indirect GLX contexts (default)\n"); ErrorF("-I ignore all remaining arguments\n"); #ifdef RLIMIT_DATA ErrorF("-ld int limit data space to N Kb\n"); #endif #ifdef RLIMIT_NOFILE ErrorF("-lf int limit number of open files to N\n"); #endif #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("-listen string listen on protocol\n"); ErrorF("-noreset don't reset after last client exists\n"); ErrorF("-background [none] create root window with no background\n"); ErrorF("-reset reset after last client exists\n"); ErrorF("-p # screen-saver pattern duration (minutes)\n"); ErrorF("-pn accept failure to listen on all ports\n"); ErrorF("-nopn reject failure to listen on all ports\n"); ErrorF("-r turns off auto-repeat\n"); ErrorF("r turns on auto-repeat \n"); ErrorF("-render [default|mono|gray|color] set render color alloc policy\n"); ErrorF("-retro start with classic stipple and cursor\n"); ErrorF("-s # screen-saver timeout (minutes)\n"); ErrorF("-seat string seat to run on\n"); ErrorF("-t # default pointer threshold (pixels/t)\n"); ErrorF("-terminate terminate at server reset\n"); ErrorF("-to # connection time out\n"); ErrorF("-tst disable testing extensions\n"); ErrorF("ttyxx server started from init on /dev/ttyxx\n"); ErrorF("v video blanking for screen-saver\n"); ErrorF("-v screen-saver without video blanking\n"); ErrorF("-wm WhenMapped default backing-store\n"); ErrorF("-wr create root window with white background\n"); ErrorF("-maxbigreqsize set maximal bigrequest size \n"); #ifdef PANORAMIX ErrorF("+xinerama Enable XINERAMA extension\n"); ErrorF("-xinerama Disable XINERAMA extension\n"); #endif ErrorF ("-dumbSched Disable smart scheduling, enable old behavior\n"); ErrorF("-schedInterval int Set scheduler interval in msec\n"); ErrorF("-sigstop Enable SIGSTOP based startup\n"); ErrorF("+extension name Enable extension\n"); ErrorF("-extension name Disable extension\n"); #ifdef XDMCP XdmcpUseMsg(); #endif XkbUseMsg(); ddxUseMsg(); } /* This function performs a rudimentary sanity check * on the display name passed in on the command-line, * since this string is used to generate filenames. * It is especially important that the display name * not contain a "/" and not start with a "-". * --kvajk */ static int VerifyDisplayName(const char *d) { int i; int period_found = FALSE; int after_period = 0; if (d == (char *) 0) return 0; /* null */ if (*d == '\0') return 0; /* empty */ if (*d == '-') return 0; /* could be confused for an option */ if (*d == '.') return 0; /* must not equal "." or ".." */ if (strchr(d, '/') != (char *) 0) return 0; /* very important!!! */ /* Since we run atoi() on the display later, only allow for digits, or exception of :0.0 and similar (two decimal points max) */ for (i = 0; i < strlen(d); i++) { if (!isdigit(d[i])) { if (d[i] != '.' || period_found) return 0; period_found = TRUE; } else if (period_found) after_period++; if (after_period > 2) return 0; } /* don't allow for :0. */ if (period_found && after_period == 0) return 0; if (atol(d) > INT_MAX) return 0; return 1; } static const char *defaultNoListenList[] = { #ifndef LISTEN_TCP "tcp", #endif #ifndef LISTEN_UNIX "unix", #endif #ifndef LISTEN_LOCAL "local", #endif NULL }; /* * This function parses the command line. Handles device-independent fields * and allows ddx to handle additional fields. It is not allowed to modify * argc or any of the strings pointed to by argv. */ void ProcessCommandLine(int argc, char *argv[]) { int i, skip; defaultKeyboardControl.autoRepeat = TRUE; #ifdef NO_PART_NET PartialNetwork = FALSE; #else PartialNetwork = TRUE; #endif for (i = 0; defaultNoListenList[i] != NULL; i++) { if (_XSERVTransNoListen(defaultNoListenList[i])) ErrorF("Failed to disable listen for %s transport", defaultNoListenList[i]); } for (i = 1; i < argc; i++) { /* call ddx first, so it can peek/override if it wants */ if ((skip = ddxProcessArgument(argc, argv, i))) { i += (skip - 1); } else if (argv[i][0] == ':') { /* initialize display */ display = argv[i]; explicit_display = TRUE; display++; if (!VerifyDisplayName(display)) { ErrorF("Bad display name: %s\n", display); UseMsg(); FatalError("Bad display name, exiting: %s\n", display); } } else if (strcmp(argv[i], "-a") == 0) { if (++i < argc) defaultPointerControl.num = atoi(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-ac") == 0) { defeatAccessControl = TRUE; } else if (strcmp(argv[i], "-audit") == 0) { if (++i < argc) auditTrailLevel = atoi(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-auth") == 0) { if (++i < argc) InitAuthorization(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-br") == 0); /* default */ else if (strcmp(argv[i], "+bs") == 0) enableBackingStore = TRUE; else if (strcmp(argv[i], "-bs") == 0) disableBackingStore = TRUE; else if (strcmp(argv[i], "c") == 0) { if (++i < argc) defaultKeyboardControl.click = atoi(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-c") == 0) { defaultKeyboardControl.click = 0; } else if (strcmp(argv[i], "-cc") == 0) { if (++i < argc) defaultColorVisualClass = atoi(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-core") == 0) { #if !defined(WIN32) || !defined(__MINGW32__) struct rlimit core_limit; getrlimit(RLIMIT_CORE, &core_limit); core_limit.rlim_cur = core_limit.rlim_max; setrlimit(RLIMIT_CORE, &core_limit); #endif CoreDump = TRUE; } else if (strcmp(argv[i], "-nocursor") == 0) { EnableCursor = FALSE; } else if (strcmp(argv[i], "-dpi") == 0) { if (++i < argc) monitorResolution = atoi(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-displayfd") == 0) { if (++i < argc) { displayfd = atoi(argv[i]); #ifdef LOCK_SERVER nolock = TRUE; #endif } else UseMsg(); } #ifdef DPMSExtension else if (strcmp(argv[i], "dpms") == 0) /* ignored for compatibility */ ; else if (strcmp(argv[i], "-dpms") == 0) DPMSDisabledSwitch = TRUE; #endif else if (strcmp(argv[i], "-deferglyphs") == 0) { if (++i >= argc || !ParseGlyphCachingMode(argv[i])) UseMsg(); } else if (strcmp(argv[i], "-f") == 0) { if (++i < argc) defaultKeyboardControl.bell = atoi(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-fc") == 0) { if (++i < argc) defaultCursorFont = argv[i]; else UseMsg(); } else if (strcmp(argv[i], "-fn") == 0) { if (++i < argc) defaultTextFont = argv[i]; else UseMsg(); } else if (strcmp(argv[i], "-fp") == 0) { if (++i < argc) { defaultFontPath = argv[i]; } else UseMsg(); } else if (strcmp(argv[i], "-help") == 0) { UseMsg(); exit(0); } else if (strcmp(argv[i], "+iglx") == 0) enableIndirectGLX = TRUE; else if (strcmp(argv[i], "-iglx") == 0) enableIndirectGLX = FALSE; else if ((skip = XkbProcessArguments(argc, argv, i)) != 0) { if (skip > 0) i += skip - 1; else UseMsg(); } #ifdef RLIMIT_DATA else if (strcmp(argv[i], "-ld") == 0) { if (++i < argc) { limitDataSpace = atoi(argv[i]); if (limitDataSpace > 0) limitDataSpace *= 1024; } else UseMsg(); } #endif #ifdef RLIMIT_NOFILE else if (strcmp(argv[i], "-lf") == 0) { if (++i < argc) limitNoFile = atoi(argv[i]); else UseMsg(); } #endif #ifdef RLIMIT_STACK else if (strcmp(argv[i], "-ls") == 0) { if (++i < argc) { limitStackSpace = atoi(argv[i]); if (limitStackSpace > 0) limitStackSpace *= 1024; } else UseMsg(); } #endif #ifdef LOCK_SERVER else if (strcmp(argv[i], "-nolock") == 0) { #if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != 0) ErrorF ("Warning: the -nolock option can only be used by root\n"); else #endif nolock = TRUE; } #endif else if (strcmp(argv[i], "-nolisten") == 0) { if (++i < argc) { if (_XSERVTransNoListen(argv[i])) ErrorF("Failed to disable listen for %s transport", argv[i]); } else UseMsg(); } else if (strcmp(argv[i], "-listen") == 0) { if (++i < argc) { if (_XSERVTransListen(argv[i])) ErrorF("Failed to enable listen for %s transport", argv[i]); } else UseMsg(); } else if (strcmp(argv[i], "-noreset") == 0) { dispatchExceptionAtReset = 0; } else if (strcmp(argv[i], "-reset") == 0) { dispatchExceptionAtReset = DE_RESET; } else if (strcmp(argv[i], "-p") == 0) { if (++i < argc) defaultScreenSaverInterval = ((CARD32) atoi(argv[i])) * MILLI_PER_MIN; else UseMsg(); } else if (strcmp(argv[i], "-pogo") == 0) { dispatchException = DE_TERMINATE; } else if (strcmp(argv[i], "-pn") == 0) PartialNetwork = TRUE; else if (strcmp(argv[i], "-nopn") == 0) PartialNetwork = FALSE; else if (strcmp(argv[i], "r") == 0) defaultKeyboardControl.autoRepeat = TRUE; else if (strcmp(argv[i], "-r") == 0) defaultKeyboardControl.autoRepeat = FALSE; else if (strcmp(argv[i], "-retro") == 0) party_like_its_1989 = TRUE; else if (strcmp(argv[i], "-s") == 0) { if (++i < argc) defaultScreenSaverTime = ((CARD32) atoi(argv[i])) * MILLI_PER_MIN; else UseMsg(); } else if (strcmp(argv[i], "-seat") == 0) { if (++i < argc) SeatId = argv[i]; else UseMsg(); } else if (strcmp(argv[i], "-t") == 0) { if (++i < argc) defaultPointerControl.threshold = atoi(argv[i]); else UseMsg(); } else if (strcmp(argv[i], "-terminate") == 0) { dispatchExceptionAtReset = DE_TERMINATE; } else if (strcmp(argv[i], "-to") == 0) { if (++i < argc) TimeOutValue = ((CARD32) atoi(argv[i])) * MILLI_PER_SECOND; else UseMsg(); } else if (strcmp(argv[i], "-tst") == 0) { noTestExtensions = TRUE; } else if (strcmp(argv[i], "v") == 0) defaultScreenSaverBlanking = PreferBlanking; else if (strcmp(argv[i], "-v") == 0) defaultScreenSaverBlanking = DontPreferBlanking; else if (strcmp(argv[i], "-wm") == 0) defaultBackingStore = WhenMapped; else if (strcmp(argv[i], "-wr") == 0) whiteRoot = TRUE; else if (strcmp(argv[i], "-background") == 0) { if (++i < argc) { if (!strcmp(argv[i], "none")) bgNoneRoot = TRUE; else UseMsg(); } } else if (strcmp(argv[i], "-maxbigreqsize") == 0) { if (++i < argc) { long reqSizeArg = atol(argv[i]); /* Request size > 128MB does not make much sense... */ if (reqSizeArg > 0L && reqSizeArg < 128L) { maxBigRequestSize = (reqSizeArg * 1048576L) - 1L; } else { UseMsg(); } } else { UseMsg(); } } #ifdef PANORAMIX else if (strcmp(argv[i], "+xinerama") == 0) { noPanoramiXExtension = FALSE; } else if (strcmp(argv[i], "-xinerama") == 0) { noPanoramiXExtension = TRUE; } else if (strcmp(argv[i], "-disablexineramaextension") == 0) { PanoramiXExtensionDisabledHack = TRUE; } #endif else if (strcmp(argv[i], "-I") == 0) { /* ignore all remaining arguments */ break; } else if (strncmp(argv[i], "tty", 3) == 0) { /* init supplies us with this useless information */ } #ifdef XDMCP else if ((skip = XdmcpOptions(argc, argv, i)) != i) { i = skip - 1; } #endif #ifdef SMART_SCHEDULE_POSSIBLE else if (strcmp(argv[i], "-dumbSched") == 0) { SmartScheduleDisable = TRUE; } else if (strcmp(argv[i], "-schedInterval") == 0) { if (++i < argc) { SmartScheduleInterval = atoi(argv[i]); SmartScheduleSlice = SmartScheduleInterval; } else UseMsg(); } else if (strcmp(argv[i], "-schedMax") == 0) { if (++i < argc) { SmartScheduleMaxSlice = atoi(argv[i]); } else UseMsg(); } #endif else if (strcmp(argv[i], "-render") == 0) { if (++i < argc) { int policy = PictureParseCmapPolicy(argv[i]); if (policy != PictureCmapPolicyInvalid) PictureCmapPolicy = policy; else UseMsg(); } else UseMsg(); } else if (strcmp(argv[i], "-sigstop") == 0) { RunFromSigStopParent = TRUE; } else if (strcmp(argv[i], "+extension") == 0) { if (++i < argc) { if (!EnableDisableExtension(argv[i], TRUE)) EnableDisableExtensionError(argv[i], TRUE); } else UseMsg(); } else if (strcmp(argv[i], "-extension") == 0) { if (++i < argc) { if (!EnableDisableExtension(argv[i], FALSE)) EnableDisableExtensionError(argv[i], FALSE); } else UseMsg(); } else { ErrorF("Unrecognized option: %s\n", argv[i]); UseMsg(); FatalError("Unrecognized option: %s\n", argv[i]); } } } /* Implement a simple-minded font authorization scheme. The authorization name is "hp-hostname-1", the contents are simply the host name. */ int set_font_authorizations(char **authorizations, int *authlen, void *client) { #define AUTHORIZATION_NAME "hp-hostname-1" #if defined(TCPCONN) || defined(STREAMSCONN) static char *result = NULL; static char *p = NULL; if (p == NULL) { char hname[1024], *hnameptr; unsigned int len; #if defined(IPv6) && defined(AF_INET6) struct addrinfo hints, *ai = NULL; #else struct hostent *host; #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif #endif gethostname(hname, 1024); #if defined(IPv6) && defined(AF_INET6) memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_CANONNAME; if (getaddrinfo(hname, NULL, &hints, &ai) == 0) { hnameptr = ai->ai_canonname; } else { hnameptr = hname; } #else host = _XGethostbyname(hname, hparams); if (host == NULL) hnameptr = hname; else hnameptr = host->h_name; #endif len = strlen(hnameptr) + 1; result = malloc(len + sizeof(AUTHORIZATION_NAME) + 4); p = result; *p++ = sizeof(AUTHORIZATION_NAME) >> 8; *p++ = sizeof(AUTHORIZATION_NAME) & 0xff; *p++ = (len) >> 8; *p++ = (len & 0xff); memmove(p, AUTHORIZATION_NAME, sizeof(AUTHORIZATION_NAME)); p += sizeof(AUTHORIZATION_NAME); memmove(p, hnameptr, len); p += len; #if defined(IPv6) && defined(AF_INET6) if (ai) { freeaddrinfo(ai); } #endif } *authlen = p - result; *authorizations = result; return 1; #else /* TCPCONN */ return 0; #endif /* TCPCONN */ } void * XNFalloc(unsigned long amount) { void *ptr = malloc(amount); if (!ptr) FatalError("Out of memory"); return ptr; } void * XNFcalloc(unsigned long amount) { void *ret = calloc(1, amount); if (!ret) FatalError("XNFcalloc: Out of memory"); return ret; } void * XNFrealloc(void *ptr, unsigned long amount) { void *ret = realloc(ptr, amount); if (!ret) FatalError("XNFrealloc: Out of memory"); return ret; } char * Xstrdup(const char *s) { if (s == NULL) return NULL; return strdup(s); } char * XNFstrdup(const char *s) { char *ret; if (s == NULL) return NULL; ret = strdup(s); if (!ret) FatalError("XNFstrdup: Out of memory"); return ret; } void SmartScheduleStopTimer(void) { #ifdef SMART_SCHEDULE_POSSIBLE struct itimerval timer; if (SmartScheduleDisable) return; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = 0; 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) return; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = SmartScheduleInterval * 1000; timer.it_value.tv_sec = 0; timer.it_value.tv_usec = SmartScheduleInterval * 1000; setitimer(ITIMER_REAL, &timer, 0); #endif } static void SmartScheduleTimer(int sig) { SmartScheduleTime += SmartScheduleInterval; } void SmartScheduleInit(void) { #ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; if (SmartScheduleDisable) return; memset((char *) &act, 0, sizeof(struct sigaction)); /* Set up the timer signal function */ act.sa_handler = SmartScheduleTimer; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); if (sigaction(SIGALRM, &act, 0) < 0) { perror("sigaction for smart scheduler"); SmartScheduleDisable = TRUE; } #endif } #ifdef SIG_BLOCK static sigset_t PreviousSignalMask; static int BlockedSignalCount; #endif void OsBlockSignals(void) { #ifdef SIG_BLOCK if (BlockedSignalCount++ == 0) { sigset_t set; #ifdef SIGIO OsBlockSIGIO(); #endif sigemptyset(&set); sigaddset(&set, SIGALRM); sigaddset(&set, SIGVTALRM); #ifdef SIGWINCH sigaddset(&set, SIGWINCH); #endif sigaddset(&set, SIGTSTP); sigaddset(&set, SIGTTIN); sigaddset(&set, SIGTTOU); sigaddset(&set, SIGCHLD); sigprocmask(SIG_BLOCK, &set, &PreviousSignalMask); } #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. */ void OsAbort(void) { #ifndef __APPLE__ OsBlockSignals(); #endif abort(); } #if !defined(WIN32) /* * "safer" versions of system(3), popen(3) and pclose(3) which give up * all privs before running a command. * * This is based on the code in FreeBSD 2.2 libc. * * XXX It'd be good to redirect stderr so that it ends up in the log file * as well. As it is now, xkbcomp messages don't end up in the log file. */ int System(const char *command) { int pid, p; void (*csig) (int); int status; if (!command) return 1; csig = signal(SIGCHLD, SIG_DFL); if (csig == SIG_ERR) { perror("signal"); return -1; } DebugF("System: `%s'\n", command); switch (pid = fork()) { case -1: /* error */ p = -1; break; case 0: /* child */ if (setgid(getgid()) == -1) _exit(127); if (setuid(getuid()) == -1) _exit(127); execl("/bin/sh", "sh", "-c", command, (char *) NULL); _exit(127); default: /* parent */ do { p = waitpid(pid, &status, 0); } while (p == -1 && errno == EINTR); } if (signal(SIGCHLD, csig) == SIG_ERR) { perror("signal"); return -1; } return p == -1 ? -1 : status; } static struct pid { struct pid *next; FILE *fp; int pid; } *pidlist; OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */ void * Popen(const char *command, const char *type) { struct pid *cur; FILE *iop; int pdes[2], pid; if (command == NULL || type == NULL) return NULL; if ((*type != 'r' && *type != 'w') || type[1]) return NULL; if ((cur = malloc(sizeof(struct pid))) == NULL) return NULL; if (pipe(pdes) < 0) { free(cur); return NULL; } /* Ignore the smart scheduler while this is going on */ old_alarm = OsSignal(SIGALRM, SIG_IGN); if (old_alarm == SIG_ERR) { close(pdes[0]); close(pdes[1]); free(cur); perror("signal"); return NULL; } switch (pid = fork()) { case -1: /* error */ close(pdes[0]); close(pdes[1]); free(cur); if (OsSignal(SIGALRM, old_alarm) == SIG_ERR) perror("signal"); return NULL; case 0: /* child */ if (setgid(getgid()) == -1) _exit(127); if (setuid(getuid()) == -1) _exit(127); if (*type == 'r') { if (pdes[1] != 1) { /* stdout */ dup2(pdes[1], 1); close(pdes[1]); } close(pdes[0]); } else { if (pdes[0] != 0) { /* stdin */ dup2(pdes[0], 0); close(pdes[0]); } close(pdes[1]); } execl("/bin/sh", "sh", "-c", command, (char *) NULL); _exit(127); } /* Avoid EINTR during stdio calls */ OsBlockSignals(); /* parent */ if (*type == 'r') { iop = fdopen(pdes[0], type); close(pdes[1]); } else { iop = fdopen(pdes[1], type); close(pdes[0]); } cur->fp = iop; cur->pid = pid; cur->next = pidlist; pidlist = cur; DebugF("Popen: `%s', fp = %p\n", command, iop); return iop; } /* fopen that drops privileges */ void * Fopen(const char *file, const char *type) { FILE *iop; #ifndef HAS_SAVED_IDS_AND_SETEUID struct pid *cur; int pdes[2], pid; if (file == NULL || type == NULL) return NULL; if ((*type != 'r' && *type != 'w') || type[1]) return NULL; if ((cur = malloc(sizeof(struct pid))) == NULL) return NULL; if (pipe(pdes) < 0) { free(cur); return NULL; } switch (pid = fork()) { case -1: /* error */ close(pdes[0]); close(pdes[1]); free(cur); return NULL; case 0: /* child */ if (setgid(getgid()) == -1) _exit(127); if (setuid(getuid()) == -1) _exit(127); if (*type == 'r') { if (pdes[1] != 1) { /* stdout */ dup2(pdes[1], 1); close(pdes[1]); } close(pdes[0]); } else { if (pdes[0] != 0) { /* stdin */ dup2(pdes[0], 0); close(pdes[0]); } close(pdes[1]); } execl("/bin/cat", "cat", file, (char *) NULL); _exit(127); } /* Avoid EINTR during stdio calls */ OsBlockSignals(); /* parent */ if (*type == 'r') { iop = fdopen(pdes[0], type); close(pdes[1]); } else { iop = fdopen(pdes[1], type); close(pdes[0]); } cur->fp = iop; cur->pid = pid; cur->next = pidlist; pidlist = cur; DebugF("Fopen(%s), fp = %p\n", file, iop); return iop; #else int ruid, euid; ruid = getuid(); euid = geteuid(); if (seteuid(ruid) == -1) { return NULL; } iop = fopen(file, type); if (seteuid(euid) == -1) { fclose(iop); return NULL; } return iop; #endif /* HAS_SAVED_IDS_AND_SETEUID */ } int Pclose(void *iop) { struct pid *cur, *last; int pstat; int pid; DebugF("Pclose: fp = %p\n", iop); fclose(iop); for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next) if (cur->fp == iop) break; if (cur == NULL) return -1; do { pid = waitpid(cur->pid, &pstat, 0); } while (pid == -1 && errno == EINTR); if (last == NULL) pidlist = cur->next; else last->next = cur->next; free(cur); /* allow EINTR again */ OsReleaseSignals(); if (old_alarm && OsSignal(SIGALRM, old_alarm) == SIG_ERR) { perror("signal"); return -1; } return pid == -1 ? -1 : pstat; } int Fclose(void *iop) { #ifdef HAS_SAVED_IDS_AND_SETEUID return fclose(iop); #else return Pclose(iop); #endif } #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 * the server's euid != ruid. In 3.3.x, these checks were done in an * external wrapper utility. */ /* Consider LD* variables insecure? */ #ifndef REMOVE_ENV_LD #define REMOVE_ENV_LD 1 #endif /* Remove long environment variables? */ #ifndef REMOVE_LONG_ENV #define REMOVE_LONG_ENV 1 #endif /* * Disallow stdout or stderr as pipes? It's possible to block the X server * when piping stdout+stderr to a pipe. * * Don't enable this because it looks like it's going to cause problems. */ #ifndef NO_OUTPUT_PIPES #define NO_OUTPUT_PIPES 0 #endif /* Check args and env only if running setuid (euid == 0 && euid != uid) ? */ #ifndef CHECK_EUID #ifndef WIN32 #define CHECK_EUID 1 #else #define CHECK_EUID 0 #endif #endif /* * Maybe the locale can be faked to make isprint(3) report that everything * is printable? Avoid it by default. */ #ifndef USE_ISPRINT #define USE_ISPRINT 0 #endif #define MAX_ARG_LENGTH 128 #define MAX_ENV_LENGTH 256 #define MAX_ENV_PATH_LENGTH 2048 /* Limit for *PATH and TERMCAP */ #if USE_ISPRINT #include #define checkPrintable(c) isprint(c) #else #define checkPrintable(c) (((c) & 0x7f) >= 0x20 && ((c) & 0x7f) != 0x7f) #endif enum BadCode { NotBad = 0, UnsafeArg, ArgTooLong, UnprintableArg, EnvTooLong, OutputIsPipe, InternalError }; #if defined(VENDORSUPPORT) #define BUGADDRESS VENDORSUPPORT #elif defined(BUILDERADDR) #define BUGADDRESS BUILDERADDR #else #define BUGADDRESS "xorg@freedesktop.org" #endif void CheckUserParameters(int argc, char **argv, char **envp) { enum BadCode bad = NotBad; int i = 0, j; char *a, *e = NULL; #if CHECK_EUID if (geteuid() == 0 && getuid() != geteuid()) #endif { /* Check each argv[] */ for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-fp") == 0) { i++; /* continue with next argument. skip the length check */ if (i >= argc) break; } else { if (strlen(argv[i]) > MAX_ARG_LENGTH) { bad = ArgTooLong; break; } } a = argv[i]; while (*a) { if (checkPrintable(*a) == 0) { bad = UnprintableArg; break; } a++; } if (bad) break; } if (!bad) { /* Check each envp[] */ for (i = 0; envp[i]; i++) { /* Check for bad environment variables and values */ #if REMOVE_ENV_LD while (envp[i] && (strncmp(envp[i], "LD", 2) == 0)) { for (j = i; envp[j]; j++) { envp[j] = envp[j + 1]; } } #endif if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) { #if REMOVE_LONG_ENV for (j = i; envp[j]; j++) { envp[j] = envp[j + 1]; } i--; #else char *eq; int len; eq = strchr(envp[i], '='); if (!eq) continue; len = eq - envp[i]; e = strndup(envp[i], len); if (!e) { bad = InternalError; break; } if (len >= 4 && (strcmp(e + len - 4, "PATH") == 0 || strcmp(e, "TERMCAP") == 0)) { if (strlen(envp[i]) > MAX_ENV_PATH_LENGTH) { bad = EnvTooLong; break; } else { free(e); } } else { bad = EnvTooLong; break; } #endif } } } #if NO_OUTPUT_PIPES if (!bad) { struct stat buf; if (fstat(fileno(stdout), &buf) == 0 && S_ISFIFO(buf.st_mode)) bad = OutputIsPipe; if (fstat(fileno(stderr), &buf) == 0 && S_ISFIFO(buf.st_mode)) bad = OutputIsPipe; } #endif } switch (bad) { case NotBad: return; case UnsafeArg: ErrorF("Command line argument number %d is unsafe\n", i); break; case ArgTooLong: ErrorF("Command line argument number %d is too long\n", i); break; case UnprintableArg: ErrorF("Command line argument number %d contains unprintable" " characters\n", i); break; case EnvTooLong: ErrorF("Environment variable `%s' is too long\n", e); break; case OutputIsPipe: ErrorF("Stdout and/or stderr is a pipe\n"); break; case InternalError: ErrorF("Internal Error\n"); break; default: ErrorF("Unknown error\n"); break; } FatalError("X server aborted because of unsafe environment\n"); } /* * CheckUserAuthorization: check if the user is allowed to start the * X server. This usually means some sort of PAM checking, and it is * usually only done for setuid servers (uid != euid). */ #ifdef USE_PAM #include #include #include #endif /* USE_PAM */ void CheckUserAuthorization(void) { #ifdef USE_PAM static struct pam_conv conv = { misc_conv, NULL }; pam_handle_t *pamh = NULL; struct passwd *pw; int retval; if (getuid() != geteuid()) { pw = getpwuid(getuid()); if (pw == NULL) FatalError("getpwuid() failed for uid %d\n", getuid()); retval = pam_start("xserver", pw->pw_name, &conv, &pamh); if (retval != PAM_SUCCESS) FatalError("pam_start() failed.\n" "\tMissing or mangled PAM config file or module?\n"); retval = pam_authenticate(pamh, 0); if (retval != PAM_SUCCESS) { pam_end(pamh, retval); FatalError("PAM authentication failed, cannot start X server.\n" "\tPerhaps you do not have console ownership?\n"); } retval = pam_acct_mgmt(pamh, 0); if (retval != PAM_SUCCESS) { pam_end(pamh, retval); FatalError("PAM authentication failed, cannot start X server.\n" "\tPerhaps you do not have console ownership?\n"); } /* this is not a session, so do not do session management */ pam_end(pamh, PAM_SUCCESS); } #endif } /* * Tokenize a string into a NULL terminated array of strings. Always returns * an allocated array unless an error occurs. */ char ** xstrtokenize(const char *str, const char *separators) { char **list, **nlist; char *tok, *tmp; unsigned num = 0, n; if (!str) return NULL; list = calloc(1, sizeof(*list)); if (!list) return NULL; tmp = strdup(str); if (!tmp) goto error; for (tok = strtok(tmp, separators); tok; tok = strtok(NULL, separators)) { nlist = realloc(list, (num + 2) * sizeof(*list)); if (!nlist) goto error; list = nlist; list[num] = strdup(tok); if (!list[num]) goto error; list[++num] = NULL; } free(tmp); return list; error: free(tmp); for (n = 0; n < num; n++) free(list[n]); 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'; } /* Move a file descriptor out of the way of our select mask; this * is useful for file descriptors which will never appear in the * select mask to avoid reducing the number of clients that can * connect to the server */ int os_move_fd(int fd) { int newfd; #ifdef F_DUPFD_CLOEXEC newfd = fcntl(fd, F_DUPFD_CLOEXEC, MAXCLIENTS); #else newfd = fcntl(fd, F_DUPFD, MAXCLIENTS); #endif if (newfd < 0) return fd; #ifndef F_DUPFD_CLOEXEC fcntl(newfd, F_SETFD, FD_CLOEXEC); #endif close(fd); return newfd; } xorg-server-1.17.1/os/WaitFor.c0000664000175100017510000004675412461505036013173 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. ******************************************************************/ /***************************************************************** * OS Dependent input routines: * * WaitForSomething * TimerForce, TimerSet, TimerCheck, TimerFree * *****************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include /* for strings, fcntl, time */ #include #include #include #include "misc.h" #include "osdep.h" #include #include "dixstruct.h" #include "opaque.h" #ifdef DPMSExtension #include "dpmsproc.h" #endif #include "busfault.h" #ifdef WIN32 /* Error codes from windows sockets differ from fileio error codes */ #undef EINTR #define EINTR WSAEINTR #undef EINVAL #define EINVAL WSAEINVAL #undef EBADF #define EBADF WSAENOTSOCK /* Windows select does not set errno. Use GetErrno as wrapper for WSAGetLastError */ #define GetErrno WSAGetLastError #else /* This is just a fallback to errno to hide the differences between unix and Windows in the code */ #define GetErrno() errno #endif /* like ffs, but uses fd_mask instead of int as argument, so it works when fd_mask is longer than an int, such as common 64-bit platforms */ /* modifications by raphael */ int mffs(fd_mask mask) { int i; if (!mask) return 0; i = 1; while (!(mask & 1)) { i++; mask >>= 1; } return i; } #ifdef DPMSExtension #include #endif struct _OsTimerRec { OsTimerPtr next; CARD32 expires; CARD32 delta; OsTimerCallback callback; void *arg; }; static void DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev); static void CheckAllTimers(void); static volatile OsTimerPtr timers = NULL; /***************** * WaitForSomething: * Make the server suspend until there is * 1. data from clients or * 2. input events available or * 3. ddx notices something of interest (graphics * queue ready, etc.) or * 4. clients that have buffered replies/events are ready * * If the time between INPUT events is * greater than ScreenSaverTime, the display is turned off (or * saved, depending on the hardware). So, WaitForSomething() * has to handle this also (that's why the select() has a timeout. * For more info on ClientsWithInput, see ReadRequestFromClient(). * pClientsReady is an array to store ready client->index values into. *****************/ int WaitForSomething(int *pClientsReady) { int i; struct timeval waittime, *wt; INT32 timeout = 0; fd_set clientsReadable; fd_set clientsWritable; int curclient; int selecterr; static int nready; fd_set devicesReadable; CARD32 now = 0; Bool someReady = FALSE; FD_ZERO(&clientsReadable); if (nready) SmartScheduleStopTimer(); nready = 0; #ifdef BUSFAULT busfault_check(); #endif /* We need a while loop here to handle crashed connections and the screen saver timeout */ while (1) { /* deal with any blocked jobs */ if (workQueue) ProcessWorkQueue(); if (XFD_ANYSET(&ClientsWithInput)) { if (!SmartScheduleDisable) { someReady = TRUE; waittime.tv_sec = 0; waittime.tv_usec = 0; wt = &waittime; } else { XFD_COPYSET(&ClientsWithInput, &clientsReadable); break; } } if (someReady) { XFD_COPYSET(&AllSockets, &LastSelectMask); XFD_UNSET(&LastSelectMask, &ClientsWithInput); } else { wt = NULL; if (timers) { now = GetTimeInMillis(); timeout = timers->expires - now; if (timeout > 0 && timeout > timers->delta + 250) { /* time has rewound. reset the timers. */ CheckAllTimers(); } if (timers) { timeout = timers->expires - now; if (timeout < 0) timeout = 0; waittime.tv_sec = timeout / MILLI_PER_SECOND; waittime.tv_usec = (timeout % MILLI_PER_SECOND) * (1000000 / MILLI_PER_SECOND); wt = &waittime; } } XFD_COPYSET(&AllSockets, &LastSelectMask); } BlockHandler((void *) &wt, (void *) &LastSelectMask); if (NewOutputPending) FlushAllOutput(); /* keep this check close to select() call to minimize race */ if (dispatchException) i = -1; else if (AnyClientsWriteBlocked) { XFD_COPYSET(&ClientsWriteBlocked, &clientsWritable); i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); } else { i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); } selecterr = GetErrno(); WakeupHandler(i, (void *) &LastSelectMask); if (i <= 0) { /* An error or timeout occurred */ if (dispatchException) return 0; if (i < 0) { if (selecterr == EBADF) { /* Some client disconnected */ CheckConnections(); if (!XFD_ANYSET(&AllClients)) return 0; } else if (selecterr == EINVAL) { FatalError("WaitForSomething(): select: %s\n", strerror(selecterr)); } else if (selecterr != EINTR && selecterr != EAGAIN) { ErrorF("WaitForSomething(): select: %s\n", strerror(selecterr)); } } else if (someReady) { /* * If no-one else is home, bail quickly */ XFD_COPYSET(&ClientsWithInput, &LastSelectMask); XFD_COPYSET(&ClientsWithInput, &clientsReadable); break; } if (*checkForInput[0] != *checkForInput[1]) return 0; if (timers) { int expired = 0; now = GetTimeInMillis(); if ((int) (timers->expires - now) <= 0) expired = 1; if (expired) { OsBlockSignals(); while (timers && (int) (timers->expires - now) <= 0) DoTimer(timers, now, &timers); OsReleaseSignals(); return 0; } } } else { fd_set tmp_set; if (*checkForInput[0] == *checkForInput[1]) { if (timers) { int expired = 0; now = GetTimeInMillis(); if ((int) (timers->expires - now) <= 0) expired = 1; if (expired) { OsBlockSignals(); while (timers && (int) (timers->expires - now) <= 0) DoTimer(timers, now, &timers); OsReleaseSignals(); return 0; } } } if (someReady) XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask); if (AnyClientsWriteBlocked && XFD_ANYSET(&clientsWritable)) { NewOutputPending = TRUE; XFD_ORSET(&OutputPending, &clientsWritable, &OutputPending); XFD_UNSET(&ClientsWriteBlocked, &clientsWritable); if (!XFD_ANYSET(&ClientsWriteBlocked)) AnyClientsWriteBlocked = FALSE; } XFD_ANDSET(&devicesReadable, &LastSelectMask, &EnabledDevices); XFD_ANDSET(&clientsReadable, &LastSelectMask, &AllClients); XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); if (XFD_ANYSET(&tmp_set)) QueueWorkProc(EstablishNewConnections, NULL, (void *) &LastSelectMask); if (XFD_ANYSET(&devicesReadable) || XFD_ANYSET(&clientsReadable)) break; /* check here for DDXes that queue events during Block/Wakeup */ if (*checkForInput[0] != *checkForInput[1]) return 0; } } nready = 0; if (XFD_ANYSET(&clientsReadable)) { #ifndef WIN32 for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { int highest_priority = 0; while (clientsReadable.fds_bits[i]) { int client_priority, client_index; curclient = mffs(clientsReadable.fds_bits[i]) - 1; client_index = /* raphael: modified */ ConnectionTranslation[curclient + (i * (sizeof(fd_mask) * 8))]; #else int highest_priority = 0; fd_set savedClientsReadable; XFD_COPYSET(&clientsReadable, &savedClientsReadable); for (i = 0; i < XFD_SETCOUNT(&savedClientsReadable); i++) { int client_priority, client_index; curclient = XFD_FD(&savedClientsReadable, i); client_index = GetConnectionTranslation(curclient); #endif /* We implement "strict" priorities. * Only the highest priority client is returned to * dix. If multiple clients at the same priority are * ready, they are all returned. This means that an * aggressive client could take over the server. * This was not considered a big problem because * aggressive clients can hose the server in so many * other ways :) */ client_priority = clients[client_index]->priority; if (nready == 0 || client_priority > highest_priority) { /* Either we found the first client, or we found * a client whose priority is greater than all others * that have been found so far. Either way, we want * to initialize the list of clients to contain just * this client. */ pClientsReady[0] = client_index; highest_priority = client_priority; nready = 1; } /* the following if makes sure that multiple same-priority * clients get batched together */ else if (client_priority == highest_priority) { pClientsReady[nready++] = client_index; } #ifndef WIN32 clientsReadable.fds_bits[i] &= ~(((fd_mask) 1L) << curclient); } #else FD_CLR(curclient, &clientsReadable); #endif } } if (nready) SmartScheduleStartTimer(); return nready; } /* If time has rewound, re-run every affected timer. * Timers might drop out of the list, so we have to restart every time. */ static void CheckAllTimers(void) { OsTimerPtr timer; CARD32 now; OsBlockSignals(); start: now = GetTimeInMillis(); for (timer = timers; timer; timer = timer->next) { if (timer->expires - now > timer->delta + 250) { TimerForce(timer); goto start; } } OsReleaseSignals(); } static void DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev) { CARD32 newTime; OsBlockSignals(); *prev = timer->next; timer->next = NULL; OsReleaseSignals(); newTime = (*timer->callback) (timer, now, timer->arg); if (newTime) TimerSet(timer, 0, newTime, timer->callback, timer->arg); } OsTimerPtr TimerSet(OsTimerPtr timer, int flags, CARD32 millis, OsTimerCallback func, void *arg) { volatile OsTimerPtr *prev; CARD32 now = GetTimeInMillis(); if (!timer) { timer = malloc(sizeof(struct _OsTimerRec)); if (!timer) return NULL; } else { OsBlockSignals(); for (prev = &timers; *prev; prev = &(*prev)->next) { if (*prev == timer) { *prev = timer->next; if (flags & TimerForceOld) (void) (*timer->callback) (timer, now, timer->arg); break; } } OsReleaseSignals(); } if (!millis) return timer; if (flags & TimerAbsolute) { timer->delta = millis - now; } else { timer->delta = millis; millis += now; } timer->expires = millis; timer->callback = func; timer->arg = arg; if ((int) (millis - now) <= 0) { timer->next = NULL; millis = (*timer->callback) (timer, now, timer->arg); if (!millis) return timer; } OsBlockSignals(); for (prev = &timers; *prev && (int) ((*prev)->expires - millis) <= 0; prev = &(*prev)->next); timer->next = *prev; *prev = timer; OsReleaseSignals(); return timer; } Bool TimerForce(OsTimerPtr timer) { int rc = FALSE; volatile OsTimerPtr *prev; OsBlockSignals(); for (prev = &timers; *prev; prev = &(*prev)->next) { if (*prev == timer) { DoTimer(timer, GetTimeInMillis(), prev); rc = TRUE; break; } } OsReleaseSignals(); return rc; } void TimerCancel(OsTimerPtr timer) { volatile OsTimerPtr *prev; if (!timer) return; OsBlockSignals(); for (prev = &timers; *prev; prev = &(*prev)->next) { if (*prev == timer) { *prev = timer->next; break; } } OsReleaseSignals(); } void TimerFree(OsTimerPtr timer) { if (!timer) return; TimerCancel(timer); free(timer); } void TimerCheck(void) { CARD32 now = GetTimeInMillis(); if (timers && (int) (timers->expires - now) <= 0) { OsBlockSignals(); while (timers && (int) (timers->expires - now) <= 0) DoTimer(timers, now, &timers); OsReleaseSignals(); } } void TimerInit(void) { OsTimerPtr timer; while ((timer = timers)) { timers = timer->next; free(timer); } } #ifdef DPMSExtension #define DPMS_CHECK_MODE(mode,time)\ if (time > 0 && DPMSPowerLevel < mode && timeout >= time)\ DPMSSet(serverClient, mode); #define DPMS_CHECK_TIMEOUT(time)\ if (time > 0 && (time - timeout) > 0)\ return time - timeout; static CARD32 NextDPMSTimeout(INT32 timeout) { /* * Return the amount of time remaining until we should set * the next power level. Fallthroughs are intentional. */ switch (DPMSPowerLevel) { case DPMSModeOn: DPMS_CHECK_TIMEOUT(DPMSStandbyTime) case DPMSModeStandby: DPMS_CHECK_TIMEOUT(DPMSSuspendTime) case DPMSModeSuspend: DPMS_CHECK_TIMEOUT(DPMSOffTime) default: /* DPMSModeOff */ return 0; } } #endif /* DPMSExtension */ static CARD32 ScreenSaverTimeoutExpire(OsTimerPtr timer, CARD32 now, void *arg) { INT32 timeout = now - LastEventTime(XIAllDevices).milliseconds; CARD32 nextTimeout = 0; #ifdef DPMSExtension /* * Check each mode lowest to highest, since a lower mode can * have the same timeout as a higher one. */ if (DPMSEnabled) { DPMS_CHECK_MODE(DPMSModeOff, DPMSOffTime) DPMS_CHECK_MODE(DPMSModeSuspend, DPMSSuspendTime) DPMS_CHECK_MODE(DPMSModeStandby, DPMSStandbyTime) nextTimeout = NextDPMSTimeout(timeout); } /* * Only do the screensaver checks if we're not in a DPMS * power saving mode */ if (DPMSPowerLevel != DPMSModeOn) return nextTimeout; #endif /* DPMSExtension */ if (!ScreenSaverTime) return nextTimeout; if (timeout < ScreenSaverTime) { return nextTimeout > 0 ? min(ScreenSaverTime - timeout, nextTimeout) : ScreenSaverTime - timeout; } ResetOsBuffers(); /* not ideal, but better than nothing */ dixSaveScreens(serverClient, SCREEN_SAVER_ON, ScreenSaverActive); if (ScreenSaverInterval > 0) { nextTimeout = nextTimeout > 0 ? min(ScreenSaverInterval, nextTimeout) : ScreenSaverInterval; } return nextTimeout; } static OsTimerPtr ScreenSaverTimer = NULL; void FreeScreenSaverTimer(void) { if (ScreenSaverTimer) { TimerFree(ScreenSaverTimer); ScreenSaverTimer = NULL; } } void SetScreenSaverTimer(void) { CARD32 timeout = 0; #ifdef DPMSExtension if (DPMSEnabled) { /* * A higher DPMS level has a timeout that's either less * than or equal to that of a lower DPMS level. */ if (DPMSStandbyTime > 0) timeout = DPMSStandbyTime; else if (DPMSSuspendTime > 0) timeout = DPMSSuspendTime; else if (DPMSOffTime > 0) timeout = DPMSOffTime; } #endif if (ScreenSaverTime > 0) { timeout = timeout > 0 ? min(ScreenSaverTime, timeout) : ScreenSaverTime; } #ifdef SCREENSAVER if (timeout && !screenSaverSuspended) { #else if (timeout) { #endif ScreenSaverTimer = TimerSet(ScreenSaverTimer, 0, timeout, ScreenSaverTimeoutExpire, NULL); } else if (ScreenSaverTimer) { FreeScreenSaverTimer(); } } xorg-server-1.17.1/os/rpcauth.c0000664000175100017510000001176712456571574013300 00000000000000/* Copyright 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * SUN-DES-1 authentication mechanism * Author: Mayank Choudhary, Sun Microsystems */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifdef SECURE_RPC #include #include #include "misc.h" #include "os.h" #include "osdep.h" #include "dixstruct.h" #include #ifdef sun /* only includes this if _KERNEL is #defined... */ extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); #endif static enum auth_stat why; static char * authdes_ezdecode(const char *inmsg, int len) { struct rpc_msg msg; char cred_area[MAX_AUTH_BYTES]; char verf_area[MAX_AUTH_BYTES]; char *temp_inmsg; struct svc_req r; bool_t res0, res1; XDR xdr; SVCXPRT xprt; temp_inmsg = malloc(len); if (temp_inmsg == NULL) { why = AUTH_FAILED; /* generic error, since there is no AUTH_BADALLOC */ return NULL; } memmove(temp_inmsg, inmsg, len); memset((char *) &msg, 0, sizeof(msg)); memset((char *) &r, 0, sizeof(r)); memset(cred_area, 0, sizeof(cred_area)); memset(verf_area, 0, sizeof(verf_area)); msg.rm_call.cb_cred.oa_base = cred_area; msg.rm_call.cb_verf.oa_base = verf_area; why = AUTH_FAILED; xdrmem_create(&xdr, temp_inmsg, len, XDR_DECODE); if ((r.rq_clntcred = malloc(MAX_AUTH_BYTES)) == NULL) goto bad1; r.rq_xprt = &xprt; /* decode into msg */ res0 = xdr_opaque_auth(&xdr, &(msg.rm_call.cb_cred)); res1 = xdr_opaque_auth(&xdr, &(msg.rm_call.cb_verf)); if (!(res0 && res1)) goto bad2; /* do the authentication */ r.rq_cred = msg.rm_call.cb_cred; /* read by opaque stuff */ if (r.rq_cred.oa_flavor != AUTH_DES) { why = AUTH_TOOWEAK; goto bad2; } #ifdef SVR4 if ((why = __authenticate(&r, &msg)) != AUTH_OK) { #else if ((why = _authenticate(&r, &msg)) != AUTH_OK) { #endif goto bad2; } return (((struct authdes_cred *) r.rq_clntcred)->adc_fullname.name); bad2: free(r.rq_clntcred); bad1: return ((char *) 0); /* ((struct authdes_cred *) NULL); */ } static XID rpc_id = (XID) ~0L; static Bool CheckNetName(unsigned char *addr, short len, void *closure) { return (len == strlen((char *) closure) && strncmp((char *) addr, (char *) closure, len) == 0); } static char rpc_error[MAXNETNAMELEN + 50]; _X_HIDDEN XID SecureRPCCheck(unsigned short data_length, const char *data, ClientPtr client, const char **reason) { char *fullname; if (rpc_id == (XID) ~0L) { *reason = "Secure RPC authorization not initialized"; } else { fullname = authdes_ezdecode(data, data_length); if (fullname == (char *) 0) { snprintf(rpc_error, sizeof(rpc_error), "Unable to authenticate secure RPC client (why=%d)", why); *reason = rpc_error; } else { if (ForEachHostInFamily(FamilyNetname, CheckNetName, fullname)) return rpc_id; snprintf(rpc_error, sizeof(rpc_error), "Principal \"%s\" is not authorized to connect", fullname); *reason = rpc_error; } } return (XID) ~0L; } _X_HIDDEN void SecureRPCInit(void) { if (rpc_id == ~0L) AddAuthorization(9, "SUN-DES-1", 0, (char *) 0); } _X_HIDDEN int SecureRPCAdd(unsigned short data_length, const char *data, XID id) { if (data_length) AddHost((void *) 0, FamilyNetname, data_length, data); rpc_id = id; return 1; } _X_HIDDEN int SecureRPCReset(void) { rpc_id = (XID) ~0L; return 1; } _X_HIDDEN XID SecureRPCToID(unsigned short data_length, char *data) { return rpc_id; } _X_HIDDEN int SecureRPCFromID(XID id, unsigned short *data_lenp, char **datap) { return 0; } _X_HIDDEN int SecureRPCRemove(unsigned short data_length, const char *data) { return 0; } #endif /* SECURE_RPC */ xorg-server-1.17.1/os/osinit.c0000664000175100017510000002231612456571574013127 00000000000000/*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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 "os.h" #include "osdep.h" #include #include #include #ifdef HAVE_DLFCN_H #include #endif #ifdef HAVE_BACKTRACE #include #endif #include "misc.h" #include "dixstruct.h" #if !defined(SYSV) && !defined(WIN32) #include #endif #ifndef ADMPATH #define ADMPATH "/usr/adm/X%smsgs" #endif extern char *display; #ifdef RLIMIT_DATA int limitDataSpace = -1; #endif #ifdef RLIMIT_STACK int limitStackSpace = -1; #endif #ifdef RLIMIT_NOFILE int limitNoFile = -1; #endif static OsSigWrapperPtr OsSigWrapper = NULL; OsSigWrapperPtr OsRegisterSigWrapper(OsSigWrapperPtr newSigWrapper) { OsSigWrapperPtr oldSigWrapper = OsSigWrapper; OsSigWrapper = newSigWrapper; return oldSigWrapper; } /* * 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) #else OsSigHandler(int signo) #endif { #ifdef RTLD_DI_SETSIGNAL const char *dlerr = dlerror(); if (dlerr) { LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr); } #endif /* RTLD_DI_SETSIGNAL */ if (OsSigWrapper != NULL) { if (OsSigWrapper(signo) == 0) { /* ddx handled signal and wants us to continue */ return; } } /* log, cleanup, and abort */ xorg_backtrace(); #ifdef SA_SIGINFO if (sip->si_code == SI_USER) { ErrorFSigSafe("Received signal %u sent by process %u, uid %u\n", signo, sip->si_pid, sip->si_uid); } else { switch (signo) { case SIGSEGV: case SIGBUS: case SIGILL: case SIGFPE: ErrorFSigSafe("%s at address %p\n", strsignal(signo), sip->si_addr); } } #endif FatalError("Caught signal %d (%s). Server aborting\n", signo, strsignal(signo)); } #endif /* !WIN32 || __CYGWIN__ */ #include "busfault.h" void OsInit(void) { static Bool been_here = FALSE; static const char *devnull = "/dev/null"; char fname[PATH_MAX]; if (!been_here) { #if !defined(WIN32) || defined(__CYGWIN__) struct sigaction act, oact; int i; int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS, SIGSYS, SIGXCPU, SIGXFSZ, #ifdef SIGEMT SIGEMT, #endif 0 /* must be last */ }; sigemptyset(&act.sa_mask); #ifdef SA_SIGINFO act.sa_sigaction = OsSigHandler; act.sa_flags = SA_SIGINFO; #else act.sa_handler = OsSigHandler; act.sa_flags = 0; #endif for (i = 0; siglist[i] != 0; i++) { if (sigaction(siglist[i], &act, &oact)) { ErrorF("failed to install signal handler for signal %d: %s\n", siglist[i], strerror(errno)); } } #endif /* !WIN32 || __CYGWIN__ */ #ifdef BUSFAULT busfault_init(); #endif #ifdef HAVE_BACKTRACE /* * initialize the backtracer, since the ctor calls dlopen(), which * calls malloc(), which isn't signal-safe. */ do { void *array; backtrace(&array, 1); } while (0); #endif #ifdef RTLD_DI_SETSIGNAL /* Tell runtime linker to send a signal we can catch instead of SIGKILL * for failures to load libraries/modules at runtime so we can clean up * after ourselves. */ { int failure_signal = SIGQUIT; dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal); } #endif #if !defined(XQUARTZ) /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */ # if defined(__APPLE__) int devnullfd = open(devnull, O_RDWR, 0); assert(devnullfd > 2); dup2(devnullfd, STDIN_FILENO); dup2(devnullfd, STDOUT_FILENO); close(devnullfd); # elif !defined(__CYGWIN__) 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 strcpy(fname, devnull); /* * 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]; setvbuf(stderr, buf, _IOLBF, BUFSIZ); } #else setlinebuf(stderr); #endif } #endif /* !XQUARTZ */ #if !defined(WIN32) || defined(__CYGWIN__) if (getpgrp() == 0) setpgid(0, 0); #endif #ifdef RLIMIT_DATA if (limitDataSpace >= 0) { struct rlimit rlim; if (!getrlimit(RLIMIT_DATA, &rlim)) { if ((limitDataSpace > 0) && (limitDataSpace < rlim.rlim_max)) rlim.rlim_cur = limitDataSpace; else rlim.rlim_cur = rlim.rlim_max; (void) setrlimit(RLIMIT_DATA, &rlim); } } #endif #ifdef RLIMIT_STACK if (limitStackSpace >= 0) { struct rlimit rlim; if (!getrlimit(RLIMIT_STACK, &rlim)) { if ((limitStackSpace > 0) && (limitStackSpace < rlim.rlim_max)) rlim.rlim_cur = limitStackSpace; else rlim.rlim_cur = rlim.rlim_max; (void) setrlimit(RLIMIT_STACK, &rlim); } } #endif #ifdef RLIMIT_NOFILE if (limitNoFile >= 0) { struct rlimit rlim; if (!getrlimit(RLIMIT_NOFILE, &rlim)) { if ((limitNoFile > 0) && (limitNoFile < rlim.rlim_max)) rlim.rlim_cur = limitNoFile; else rlim.rlim_cur = rlim.rlim_max; (void) setrlimit(RLIMIT_NOFILE, &rlim); } } #endif LockServer(); been_here = TRUE; } TimerInit(); OsVendorInit(); OsResetSignals(); /* * No log file by default. OsVendorInit() should call LogInit() with the * log file name if logging to a file is desired. */ LogInit(NULL, NULL); SmartScheduleInit(); } void OsCleanup(Bool terminating) { if (terminating) { UnlockServer(); } } xorg-server-1.17.1/os/log.c0000664000175100017510000006406512456571574012412 00000000000000/* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, Copyright 1994 Quarterdeck Office Systems. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital and Quarterdeck not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. */ /* * 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). */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include #include #include /* for malloc() */ #include "input.h" #include "site.h" #include "opaque.h" #ifdef WIN32 #include #define getpid(x) _getpid(x) #endif #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" #endif #ifdef __clang__ #pragma clang diagnostic ignored "-Wformat-nonliteral" #endif #ifdef DDXOSVERRORF 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; static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; /* Buffer to information logged before the log file is opened. */ static char *saveBuffer = NULL; static int bufferSize = 0, bufferUnused = 0, bufferPos = 0; static Bool needBuffer = TRUE; #ifdef __APPLE__ #include static char __crashreporter_info_buff__[4096] = { 0 }; static const char *__crashreporter_info__ __attribute__ ((__used__)) = &__crashreporter_info_buff__[0]; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 // This is actually a toolchain requirement, but I'm not sure the correct check, // but it should be fine to just only include it for Leopard and later. This line // just tells the linker to never strip this symbol (such as for space optimization) asm(".desc ___crashreporter_info__, 0x10"); #endif #endif /* Prefix strings for log messages. */ #ifndef X_UNKNOWN_STRING #define X_UNKNOWN_STRING "(\?\?)" #endif #ifndef X_PROBE_STRING #define X_PROBE_STRING "(--)" #endif #ifndef X_CONFIG_STRING #define X_CONFIG_STRING "(**)" #endif #ifndef X_DEFAULT_STRING #define X_DEFAULT_STRING "(==)" #endif #ifndef X_CMDLINE_STRING #define X_CMDLINE_STRING "(++)" #endif #ifndef X_NOTICE_STRING #define X_NOTICE_STRING "(!!)" #endif #ifndef X_ERROR_STRING #define X_ERROR_STRING "(EE)" #endif #ifndef X_WARNING_STRING #define X_WARNING_STRING "(WW)" #endif #ifndef X_INFO_STRING #define X_INFO_STRING "(II)" #endif #ifndef X_NOT_IMPLEMENTED_STRING #define X_NOT_IMPLEMENTED_STRING "(NI)" #endif #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 * called, otherwise log messages will continue to accumulate in a buffer. * * %s, if present in the fname or backup strings, is expanded to the display * string. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" const char * LogInit(const char *fname, const char *backup) { char *logFileName = NULL; if (fname && *fname) { if (asprintf(&logFileName, fname, display) == -1) FatalError("Cannot allocate space for the log file name\n"); if (backup && *backup) { struct stat buf; if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) { char *suffix; char *oldLog; if ((asprintf(&suffix, backup, display) == -1) || (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1)) FatalError("Cannot allocate space for the log file name\n"); free(suffix); if (rename(logFileName, oldLog) == -1) { FatalError("Cannot move old log file \"%s\" to \"%s\"\n", logFileName, oldLog); } free(oldLog); } } else { unlink(logFileName); } if ((logFile = fopen(logFileName, "w")) == NULL) 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); fflush(logFile); #ifndef WIN32 fsync(fileno(logFile)); #endif } } /* * Unconditionally free the buffer, and flag that the buffer is no longer * needed. */ if (saveBuffer && bufferSize > 0) { free(saveBuffer); saveBuffer = NULL; bufferSize = 0; } needBuffer = FALSE; return logFileName; } #pragma GCC diagnostic pop void LogClose(enum ExitCode error) { if (logFile) { int msgtype = (error == EXIT_NO_ERROR) ? X_INFO : X_ERROR; LogMessageVerbSigSafe(msgtype, -1, "Server terminated %s (%d). Closing log file.\n", (error == EXIT_NO_ERROR) ? "successfully" : "with error", error); fclose(logFile); logFile = NULL; logFileFd = -1; } } Bool LogSetParameter(LogParameter param, int value) { switch (param) { case XLOG_FLUSH: logFlush = value ? TRUE : FALSE; return TRUE; case XLOG_SYNC: logSync = value ? TRUE : FALSE; return TRUE; case XLOG_VERBOSITY: logVerbosity = value; return TRUE; case XLOG_FILE_VERBOSITY: logFileVerbosity = value; return TRUE; default: return FALSE; } } enum { LMOD_LONG = 0x1, LMOD_LONGLONG = 0x2, LMOD_SHORT = 0x4, LMOD_SIZET = 0x8, }; /** * Parse non-digit length modifiers and set the corresponding flag in * flags_return. * * @return the number of bytes parsed */ static int parse_length_modifier(const char *format, size_t len, int *flags_return) { int idx = 0; int length_modifier = 0; while (idx < len) { switch (format[idx]) { case 'l': BUG_RETURN_VAL(length_modifier & LMOD_SHORT, 0); if (length_modifier & LMOD_LONG) length_modifier |= LMOD_LONGLONG; else length_modifier |= LMOD_LONG; break; case 'h': BUG_RETURN_VAL(length_modifier & (LMOD_LONG|LMOD_LONGLONG), 0); length_modifier |= LMOD_SHORT; /* gcc says 'short int' is promoted to 'int' when * passed through '...', so ignored during * processing */ break; case 'z': length_modifier |= LMOD_SIZET; break; default: goto out; } idx++; } out: *flags_return = length_modifier; return idx; } /** * Signal-safe snprintf, with some limitations over snprintf. Be careful * which directives you use. */ static int vpnprintf(char *string, int size_in, 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; size_t size = size_in; for (; f_idx < f_len && s_idx < size - 1; f_idx++) { int length_modifier = 0; if (f[f_idx] != '%') { string[s_idx++] = f[f_idx]; continue; } f_idx++; /* silently swallow digit length modifiers */ while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9') || f[f_idx] == '.')) f_idx++; /* non-digit length modifiers */ if (f_idx < f_len) { int parsed_bytes = parse_length_modifier(&f[f_idx], f_len - f_idx, &length_modifier); if (parsed_bytes < 0) return 0; f_idx += parsed_bytes; } 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': if (length_modifier & LMOD_LONGLONG) ui = va_arg(args, unsigned long long); else if (length_modifier & LMOD_LONG) ui = va_arg(args, unsigned long); else if (length_modifier & LMOD_SIZET) ui = va_arg(args, size_t); else 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': if (length_modifier & LMOD_LONGLONG) si = va_arg(args, long long); else if (length_modifier & LMOD_LONG) si = va_arg(args, long); else if (length_modifier & LMOD_SIZET) si = va_arg(args, ssize_t); else 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': if (length_modifier & LMOD_LONGLONG) ui = va_arg(args, unsigned long long); else if (length_modifier & LMOD_LONG) ui = va_arg(args, unsigned long); else if (length_modifier & LMOD_SIZET) ui = va_arg(args, size_t); else 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; case 'c': { char c = va_arg(args, int); if (s_idx < size - 1) string[s_idx++] = c; } break; case '%': string[s_idx++] = '%'; break; default: BUG_WARN_MSG(f[f_idx], "Unsupported printf directive '%c'\n", f[f_idx]); 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; } static int pnprintf(char *string, int size, const char *f, ...) { int rc; va_list args; va_start(args, f); rc = vpnprintf(string, size, f, args); va_end(args); return rc; } /* 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; int ret; if (verb < 0 || logVerbosity >= verb) ret = write(2, buf, len); if (verb < 0 || logFileVerbosity >= verb) { if (inSignalContext && logFileFd >= 0) { ret = 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; fwrite(buf, len, 1, logFile); if (logFlush) { fflush(logFile); #ifndef WIN32 if (logSync) fsync(fileno(logFile)); #endif } } else if (!inSignalContext && needBuffer) { if (len > bufferUnused) { bufferSize += 1024; bufferUnused += 1024; saveBuffer = realloc(saveBuffer, bufferSize); if (!saveBuffer) FatalError("realloc() failed while saving log messages\n"); } bufferUnused -= len; memcpy(saveBuffer + bufferPos, buf, len); bufferPos += len; } } /* There's no place to log an error message if the log write * fails... */ (void) ret; } void LogVWrite(int verb, const char *f, va_list args) { return LogVMessageVerb(X_NONE, verb, f, args); } void LogWrite(int verb, const char *f, ...) { va_list args; va_start(args, f); LogVWrite(verb, f, args); va_end(args); } /* Returns the Message Type string to prepend to a logging message, or NULL * if the message will be dropped due to insufficient verbosity. */ static const char * LogMessageTypeVerbString(MessageType type, int verb) { if (type == X_ERROR) verb = 0; if (logVerbosity < verb && logFileVerbosity < verb) return NULL; switch (type) { case X_PROBED: return X_PROBE_STRING; case X_CONFIG: return X_CONFIG_STRING; case X_DEFAULT: return X_DEFAULT_STRING; case X_CMDLINE: return X_CMDLINE_STRING; case X_NOTICE: return X_NOTICE_STRING; case X_ERROR: return X_ERROR_STRING; case X_WARNING: return X_WARNING_STRING; case X_INFO: return X_INFO_STRING; case X_NOT_IMPLEMENTED: return X_NOT_IMPLEMENTED_STRING; case X_UNKNOWN: return X_UNKNOWN_STRING; case X_NONE: return X_NONE_STRING; case X_DEBUG: return X_DEBUG_STRING; default: return X_UNKNOWN_STRING; } } void LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) { const char *type_str; char buf[1024]; const size_t size = sizeof(buf); Bool newline; size_t len = 0; if (inSignalContext) { LogVMessageVerbSigSafe(type, verb, format, args); return; } type_str = LogMessageTypeVerbString(type, verb); if (!type_str) return; /* if type_str is not "", prepend it and ' ', to message */ if (type_str[0] != '\0') len += Xscnprintf(&buf[len], size - len, "%s ", type_str); if (size - len > 1) len += Xvscnprintf(&buf[len], size - len, format, args); /* Force '\n' at end of truncated line */ if (size - len == 1) buf[len - 1] = '\n'; newline = (buf[len - 1] == '\n'); LogSWrite(verb, buf, len, newline); } /* Log message with verbosity level specified. */ void LogMessageVerb(MessageType type, int verb, const char *format, ...) { va_list ap; va_start(ap, format); LogVMessageVerb(type, verb, format, ap); va_end(ap); } /* Log a message with the standard verbosity level of 1. */ void LogMessage(MessageType type, const char *format, ...) { va_list ap; va_start(ap, format); LogVMessageVerb(type, 1, format, ap); 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 = vpnprintf(buf, sizeof(buf), format, args); /* Force '\n' at end of truncated line */ if (sizeof(buf) - len == 1) buf[len - 1] = '\n'; newline = (len > 0 && 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) { const char *type_str; char buf[1024]; const size_t size = sizeof(buf); Bool newline; size_t len = 0; int (*vprintf_func)(char *, int, const char* _X_RESTRICT_KYWD f, va_list args) _X_ATTRIBUTE_PRINTF(3, 0); int (*printf_func)(char *, int, const char* _X_RESTRICT_KYWD f, ...) _X_ATTRIBUTE_PRINTF(3, 4); type_str = LogMessageTypeVerbString(type, verb); if (!type_str) return; if (inSignalContext) { vprintf_func = vpnprintf; printf_func = pnprintf; } else { vprintf_func = Xvscnprintf; printf_func = Xscnprintf; } /* if type_str is not "", prepend it and ' ', to message */ if (type_str[0] != '\0') len += printf_func(&buf[len], size - len, "%s ", type_str); if (hdr_format && size - len > 1) len += vprintf_func(&buf[len], size - len, hdr_format, hdr_args); if (msg_format && size - len > 1) len += vprintf_func(&buf[len], size - len, msg_format, msg_args); /* Force '\n' at end of truncated line */ if (size - len == 1) buf[len - 1] = '\n'; newline = (buf[len - 1] == '\n'); LogSWrite(verb, buf, len, newline); } void LogHdrMessageVerb(MessageType type, int verb, const char *msg_format, va_list msg_args, const char *hdr_format, ...) { va_list hdr_args; va_start(hdr_args, hdr_format); LogVHdrMessageVerb(type, verb, msg_format, msg_args, hdr_format, hdr_args); va_end(hdr_args); } void LogHdrMessage(MessageType type, const char *msg_format, va_list msg_args, const char *hdr_format, ...) { va_list hdr_args; va_start(hdr_args, hdr_format); LogVHdrMessageVerb(type, 1, msg_format, msg_args, hdr_format, hdr_args); va_end(hdr_args); } void AbortServer(void) _X_NORETURN; void AbortServer(void) { #ifdef XF86BIGFONT XF86BigfontCleanup(); #endif CloseWellKnownConnections(); OsCleanup(TRUE); AbortDevices(); AbortDDX(EXIT_ERR_ABORT); fflush(stderr); if (CoreDump) OsAbort(); exit(1); } #define AUDIT_PREFIX "AUDIT: %s: %ld: " #ifndef AUDIT_TIMEOUT #define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */ #endif static int nrepeat = 0; static int oldlen = -1; static OsTimerPtr auditTimer = NULL; void FreeAuditTimer(void) { if (auditTimer != NULL) { /* Force output of pending messages */ TimerForce(auditTimer); TimerFree(auditTimer); auditTimer = NULL; } } static char * AuditPrefix(void) { time_t tm; char *autime, *s; char *tmpBuf; int len; time(&tm); autime = ctime(&tm); if ((s = strchr(autime, '\n'))) *s = '\0'; len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + 1; tmpBuf = malloc(len); if (!tmpBuf) return NULL; snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long) getpid()); return tmpBuf; } void AuditF(const char *f, ...) { va_list args; va_start(args, f); VAuditF(f, args); va_end(args); } static CARD32 AuditFlush(OsTimerPtr timer, CARD32 now, void *arg) { char *prefix; if (nrepeat > 0) { prefix = AuditPrefix(); ErrorF("%slast message repeated %d times\n", prefix != NULL ? prefix : "", nrepeat); nrepeat = 0; free(prefix); return AUDIT_TIMEOUT; } else { /* if the timer expires without anything to print, flush the message */ oldlen = -1; return 0; } } void VAuditF(const char *f, va_list args) { char *prefix; char buf[1024]; int len; static char oldbuf[1024]; prefix = AuditPrefix(); len = vsnprintf(buf, sizeof(buf), f, args); if (len == oldlen && strcmp(buf, oldbuf) == 0) { /* Message already seen */ nrepeat++; } else { /* new message */ if (auditTimer != NULL) TimerForce(auditTimer); ErrorF("%s%s", prefix != NULL ? prefix : "", buf); strlcpy(oldbuf, buf, sizeof(oldbuf)); oldlen = len; nrepeat = 0; auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); } free(prefix); } void FatalError(const char *f, ...) { va_list args; va_list args2; static Bool beenhere = FALSE; if (beenhere) ErrorFSigSafe("\nFatalError re-entered, aborting\n"); else ErrorFSigSafe("\nFatal server error:\n"); va_start(args, f); /* Make a copy for OsVendorFatalError */ va_copy(args2, args); #ifdef __APPLE__ { va_list apple_args; va_copy(apple_args, args); (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, apple_args); va_end(apple_args); } #endif VErrorFSigSafe(f, args); va_end(args); ErrorFSigSafe("\n"); if (!beenhere) OsVendorFatalError(f, args2); va_end(args2); if (!beenhere) { beenhere = TRUE; AbortServer(); } else OsAbort(); /*NOTREACHED*/} void VErrorF(const char *f, va_list args) { #ifdef DDXOSVERRORF if (OsVendorVErrorFProc) OsVendorVErrorFProc(f, args); else LogVWrite(-1, f, args); #else LogVWrite(-1, f, args); #endif } void ErrorF(const char *f, ...) { va_list args; va_start(args, f); VErrorF(f, args); 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) { /* Show what the message marker symbols mean. */ LogWrite(0, "Markers: "); LogMessageVerb(X_PROBED, 0, "probed, "); LogMessageVerb(X_CONFIG, 0, "from config file, "); LogMessageVerb(X_DEFAULT, 0, "default setting,\n\t"); LogMessageVerb(X_CMDLINE, 0, "from command line, "); LogMessageVerb(X_NOTICE, 0, "notice, "); LogMessageVerb(X_INFO, 0, "informational,\n\t"); LogMessageVerb(X_WARNING, 0, "warning, "); LogMessageVerb(X_ERROR, 0, "error, "); LogMessageVerb(X_NOT_IMPLEMENTED, 0, "not implemented, "); LogMessageVerb(X_UNKNOWN, 0, "unknown.\n"); } xorg-server-1.17.1/os/strlcpy.c0000664000175100017510000000331112274325511013276 00000000000000/* * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF 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 "os.h" #ifndef HAVE_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(char *dst, const char *src, size_t siz) { register char *d = dst; register const char *s = src; register size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++); } return s - src - 1; /* count does not include NUL */ } #endif xorg-server-1.17.1/os/xsha1.c0000664000175100017510000001340512456571574012645 00000000000000/* Copyright © 2007 Carl Worth * Copyright © 2009 Jeremy Huddleston, Julien Cristau, and Matthieu Herrb * Copyright © 2009-2010 Mikhail Gusarov * Copyright © 2012 Yaakov Selkowitz and Keith Packard * * 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 "os.h" #include "xsha1.h" #if defined(HAVE_SHA1_IN_LIBMD) /* Use libmd for SHA1 */ \ || defined(HAVE_SHA1_IN_LIBC) /* Use libc for SHA1 */ #include void * x_sha1_init(void) { SHA1_CTX *ctx = malloc(sizeof(*ctx)); if (!ctx) return NULL; SHA1Init(ctx); return ctx; } int x_sha1_update(void *ctx, void *data, int size) { SHA1_CTX *sha1_ctx = ctx; SHA1Update(sha1_ctx, data, size); return 1; } int x_sha1_final(void *ctx, unsigned char result[20]) { SHA1_CTX *sha1_ctx = ctx; SHA1Final(result, sha1_ctx); free(sha1_ctx); return 1; } #elif defined(HAVE_SHA1_IN_COMMONCRYPTO) /* Use CommonCrypto for SHA1 */ #include void * x_sha1_init(void) { CC_SHA1_CTX *ctx = malloc(sizeof(*ctx)); if (!ctx) return NULL; CC_SHA1_Init(ctx); return ctx; } int x_sha1_update(void *ctx, void *data, int size) { CC_SHA1_CTX *sha1_ctx = ctx; CC_SHA1_Update(sha1_ctx, data, size); return 1; } int x_sha1_final(void *ctx, unsigned char result[20]) { CC_SHA1_CTX *sha1_ctx = ctx; CC_SHA1_Final(result, sha1_ctx); free(sha1_ctx); 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 void * x_sha1_init(void) { static int init; gcry_md_hd_t h; gcry_error_t err; if (!init) { if (!gcry_check_version(NULL)) return NULL; gcry_control(GCRYCTL_DISABLE_SECMEM, 0); gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); init = 1; } err = gcry_md_open(&h, GCRY_MD_SHA1, 0); if (err) return NULL; return h; } int x_sha1_update(void *ctx, void *data, int size) { gcry_md_hd_t h = ctx; gcry_md_write(h, data, size); return 1; } int x_sha1_final(void *ctx, unsigned char result[20]) { gcry_md_hd_t h = ctx; memcpy(result, gcry_md_read(h, GCRY_MD_SHA1), 20); gcry_md_close(h); return 1; } #elif defined(HAVE_SHA1_IN_LIBSHA1) /* Use libsha1 */ #include void * x_sha1_init(void) { sha1_ctx *ctx = malloc(sizeof(*ctx)); if (!ctx) return NULL; sha1_begin(ctx); return ctx; } int x_sha1_update(void *ctx, void *data, int size) { sha1_hash(data, size, ctx); return 1; } int x_sha1_final(void *ctx, unsigned char result[20]) { sha1_end(result, ctx); free(ctx); return 1; } #else /* Use OpenSSL's libcrypto */ #include /* buggy openssl/sha.h wants size_t */ #include void * x_sha1_init(void) { int ret; SHA_CTX *ctx = malloc(sizeof(*ctx)); if (!ctx) return NULL; ret = SHA1_Init(ctx); if (!ret) { free(ctx); return NULL; } return ctx; } int x_sha1_update(void *ctx, void *data, int size) { int ret; SHA_CTX *sha_ctx = ctx; ret = SHA1_Update(sha_ctx, data, size); if (!ret) free(sha_ctx); return ret; } int x_sha1_final(void *ctx, unsigned char result[20]) { int ret; SHA_CTX *sha_ctx = ctx; ret = SHA1_Final(result, sha_ctx); free(sha_ctx); return ret; } #endif xorg-server-1.17.1/os/strlcat.c0000664000175100017510000000342712274325511013262 00000000000000/* * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF 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 "os.h" /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(char *dst, const char *src, size_t siz) { register char *d = dst; register const char *s = src; register size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return (dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return (dlen + (s - src)); /* count does not include NUL */ } xorg-server-1.17.1/os/strcasestr.c0000664000175100017510000000444212274325511014001 00000000000000/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * 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. * 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "dix.h" /* * Find the first occurrence of find in s, ignore case. */ #ifndef HAVE_STRCASESTR char * xstrcasestr(const char *s, const char *find) { char c, sc; size_t len; if ((c = *find++) != 0) { c = tolower((unsigned char) c); len = strlen(find); do { do { if ((sc = *s++) == 0) return NULL; } while ((char) tolower((unsigned char) sc) != c); } while (strncasecmp(s, find, len) != 0); s--; } return ((char *) s); } #endif xorg-server-1.17.1/config.guess0000755000175100017510000012355012460514302013332 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-03-23' # 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 # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; 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 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xorg-server-1.17.1/test-driver0000755000175100017510000001027712460514307013216 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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 # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xorg-server-1.17.1/Makefile.in0000664000175100017510000011145712466505427013102 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/xserver.ent.in $(srcdir)/xorg-server.pc.in COPYING \ ChangeLog INSTALL README compile config.guess config.sub \ depcomp install-sh missing ylwrap ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/xorg-tls.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno 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 = xserver.ent xorg-server.pc CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 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)$(aclocaldir)" \ "$(DESTDIR)$(pkgconfigdir)" DATA = $(aclocal_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) 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" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AUTOMAKE_OPTIONS = nostdinc # Required for automake < 1.14 ACLOCAL_AMFLAGS = -I m4 @COMPOSITE_TRUE@COMPOSITE_DIR = composite @GLX_TRUE@GLX_DIR = glx @DBE_TRUE@DBE_DIR = dbe @RECORD_TRUE@RECORD_DIR = record @DRI3_TRUE@DRI3_DIR = dri3 @PRESENT_TRUE@PRESENT_DIR = present @PSEUDORAMIX_TRUE@PSEUDORAMIX_DIR = pseudoramiX @GLAMOR_TRUE@GLAMOR_DIR = glamor SUBDIRS = \ doc \ man \ include \ dix \ fb \ mi \ Xext \ miext \ os \ randr \ render \ Xi \ xkb \ $(PSEUDORAMIX_DIR) \ $(DBE_DIR) \ $(RECORD_DIR) \ xfixes \ damageext \ $(COMPOSITE_DIR) \ $(GLX_DIR) \ $(PRESENT_DIR) \ $(DRI3_DIR) \ exa \ $(GLAMOR_DIR) \ config \ hw \ test @XORG_TRUE@aclocaldir = $(datadir)/aclocal @XORG_TRUE@aclocal_DATA = xorg-server.m4 @XORG_TRUE@pkgconfigdir = $(libdir)/pkgconfig @XORG_TRUE@pkgconfig_DATA = xorg-server.pc EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh DISTCHECK_CONFIGURE_FLAGS = \ --with-xkb-path=$(XKB_BASE_DIRECTORY) \ --with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \ --with-xkb-output='$${datadir}/X11/xkb/compiled' DIST_SUBDIRS = \ doc \ man \ include \ dix \ fb \ mi \ Xext \ miext \ os \ pseudoramiX \ randr \ render \ Xi \ xkb \ dbe \ record \ xfixes \ damageext \ composite \ glx \ exa \ glamor \ config \ dri3 \ present \ hw \ test all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(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 cd $(top_builddir) && $(SHELL) ./config.status $@ xorg-server.pc: $(top_builddir)/config.status $(srcdir)/xorg-server.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-aclocalDATA: $(aclocal_DATA) @$(NORMAL_INSTALL) @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(aclocaldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" || 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_DATA) $$files '$(DESTDIR)$(aclocaldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(aclocaldir)" || exit $$?; \ done uninstall-aclocalDATA: @$(NORMAL_UNINSTALL) @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(aclocaldir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || 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_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 @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 $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(pkgconfigdir)"; 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-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-aclocalDATA install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-aclocalDATA uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-aclocalDATA 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-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-aclocalDATA \ uninstall-am uninstall-pkgconfigDATA .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL # 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 # 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: xorg-server-1.17.1/present/0000775000175100017510000000000012466505444012563 500000000000000xorg-server-1.17.1/present/Makefile.am0000664000175100017510000000050512406354444014533 00000000000000noinst_LTLIBRARIES = libpresent.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ @DIX_CFLAGS@ @XORG_CFLAGS@ libpresent_la_SOURCES = \ present.h \ present.c \ present_event.c \ present_fake.c \ present_fence.c \ present_notify.c \ present_priv.h \ present_request.c \ present_screen.c sdk_HEADERS = present.h presentext.h xorg-server-1.17.1/present/present_notify.c0000664000175100017510000000637712366220413015721 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "present_priv.h" /* * Mark all pending notifies for 'window' as invalid when * the window is destroyed */ void present_clear_window_notifies(WindowPtr window) { present_notify_ptr notify; present_window_priv_ptr window_priv = present_window_priv(window); if (!window_priv) return; xorg_list_for_each_entry(notify, &window_priv->notifies, window_list) { notify->window = NULL; } } /* * 'notify' is being freed; remove it from the window's notify list */ void present_free_window_notify(present_notify_ptr notify) { xorg_list_del(¬ify->window_list); } /* * 'notify' is new; add it to the specified window */ int present_add_window_notify(present_notify_ptr notify) { WindowPtr window = notify->window; present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); if (!window_priv) return BadAlloc; xorg_list_add(¬ify->window_list, &window_priv->notifies); return Success; } int present_create_notifies(ClientPtr client, int num_notifies, xPresentNotify *x_notifies, present_notify_ptr *p_notifies) { present_notify_ptr notifies; int i; int added = 0; int status; notifies = calloc (num_notifies, sizeof (present_notify_rec)); if (!notifies) return BadAlloc; for (i = 0; i < num_notifies; i++) { status = dixLookupWindow(¬ifies[i].window, x_notifies[i].window, client, DixGetAttrAccess); if (status != Success) goto bail; notifies[i].serial = x_notifies[i].serial; status = present_add_window_notify(¬ifies[i]); if (status != Success) goto bail; added = i; } return Success; bail: present_destroy_notifies(notifies, added); return status; } void present_destroy_notifies(present_notify_ptr notifies, int num_notifies) { int i; for (i = 0; i < num_notifies; i++) present_free_window_notify(¬ifies[i]); free(notifies); } xorg-server-1.17.1/present/present_screen.c0000664000175100017510000001606312406354444015670 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "present_priv.h" int present_request; DevPrivateKeyRec present_screen_private_key; DevPrivateKeyRec present_window_private_key; /* * Get a pointer to a present window private, creating if necessary */ present_window_priv_ptr present_get_window_priv(WindowPtr window, Bool create) { present_window_priv_ptr window_priv = present_window_priv(window); if (!create || window_priv != NULL) return window_priv; window_priv = calloc (1, sizeof (present_window_priv_rec)); if (!window_priv) return NULL; xorg_list_init(&window_priv->vblank); xorg_list_init(&window_priv->notifies); window_priv->crtc = PresentCrtcNeverSet; dixSetPrivate(&window->devPrivates, &present_window_private_key, window_priv); return window_priv; } /* * Hook the close screen function to clean up our screen private */ static Bool present_close_screen(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); present_flip_destroy(screen); unwrap(screen_priv, screen, CloseScreen); (*screen->CloseScreen) (screen); free(screen_priv); return TRUE; } /* * Free any queued presentations for this window */ static void present_free_window_vblank(WindowPtr window) { present_window_priv_ptr window_priv = present_window_priv(window); present_vblank_ptr vblank, tmp; xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) { present_abort_vblank(window->drawable.pScreen, vblank->crtc, vblank->event_id, vblank->target_msc); present_vblank_destroy(vblank); } } /* * Clean up any pending or current flips for this window */ static void present_clear_window_flip(WindowPtr window) { ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); present_vblank_ptr flip_pending = screen_priv->flip_pending; if (flip_pending && flip_pending->window == window) { assert (flip_pending->abort_flip); flip_pending->window = NULL; } if (screen_priv->flip_window == window) screen_priv->flip_window = NULL; } /* * Hook the close window function to clean up our window private */ static Bool present_destroy_window(WindowPtr window) { Bool ret; ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); present_window_priv_ptr window_priv = present_window_priv(window); if (window_priv) { present_clear_window_notifies(window); present_free_events(window); present_free_window_vblank(window); present_clear_window_flip(window); free(window_priv); } unwrap(screen_priv, screen, DestroyWindow); if (screen->DestroyWindow) ret = screen->DestroyWindow (window); else ret = TRUE; wrap(screen_priv, screen, DestroyWindow, present_destroy_window); return ret; } /* * Hook the config notify screen function to deliver present config notify events */ static int present_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling) { int ret; ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); present_send_config_notify(window, x, y, w, h, bw, sibling); unwrap(screen_priv, screen, ConfigNotify); if (screen->ConfigNotify) ret = screen->ConfigNotify (window, x, y, w, h, bw, sibling); else ret = 0; wrap(screen_priv, screen, ConfigNotify, present_config_notify); return ret; } /* * Hook the clip notify screen function to un-flip as necessary */ static void present_clip_notify(WindowPtr window, int dx, int dy) { ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); present_check_flip_window(window); unwrap(screen_priv, screen, ClipNotify) if (screen->ClipNotify) screen->ClipNotify (window, dx, dy); wrap(screen_priv, screen, ClipNotify, present_clip_notify); } /* * Initialize a screen for use with present */ int present_screen_init(ScreenPtr screen, present_screen_info_ptr info) { if (!dixRegisterPrivateKey(&present_screen_private_key, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&present_window_private_key, PRIVATE_WINDOW, 0)) return FALSE; if (!present_screen_priv(screen)) { present_screen_priv_ptr screen_priv = calloc(1, sizeof (present_screen_priv_rec)); if (!screen_priv) return FALSE; wrap(screen_priv, screen, CloseScreen, present_close_screen); wrap(screen_priv, screen, DestroyWindow, present_destroy_window); wrap(screen_priv, screen, ConfigNotify, present_config_notify); wrap(screen_priv, screen, ClipNotify, present_clip_notify); screen_priv->info = info; dixSetPrivate(&screen->devPrivates, &present_screen_private_key, screen_priv); present_fake_screen_init(screen); } return TRUE; } /* * Initialize the present extension */ void present_extension_init(void) { ExtensionEntry *extension; int i; #ifdef PANORAMIX if (!noPanoramiXExtension) return; #endif extension = AddExtension(PRESENT_NAME, PresentNumberEvents, PresentNumberErrors, proc_present_dispatch, sproc_present_dispatch, NULL, StandardMinorOpcode); if (!extension) goto bail; present_request = extension->base; if (!present_init()) goto bail; if (!present_event_init()) goto bail; for (i = 0; i < screenInfo.numScreens; i++) { if (!present_screen_init(screenInfo.screens[i], NULL)) goto bail; } return; bail: FatalError("Cannot initialize Present extension"); } xorg-server-1.17.1/present/present.c0000664000175100017510000007451212456571574014346 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "present_priv.h" #include #include #include #ifdef MONOTONIC_CLOCK #include #endif static uint64_t present_event_id; static struct xorg_list present_exec_queue; static struct xorg_list present_flip_queue; #if 0 #define DebugPresent(x) ErrorF x #else #define DebugPresent(x) #endif static void present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); /* * Copies the update region from a pixmap to the target drawable */ static void present_copy_region(DrawablePtr drawable, PixmapPtr pixmap, RegionPtr update, int16_t x_off, int16_t y_off) { ScreenPtr screen = drawable->pScreen; GCPtr gc; gc = GetScratchGC(drawable->depth, screen); if (update) { ChangeGCVal changes[2]; changes[0].val = x_off; changes[1].val = y_off; ChangeGC(serverClient, gc, GCClipXOrigin|GCClipYOrigin, changes); (*gc->funcs->ChangeClip)(gc, CT_REGION, update, 0); } ValidateGC(drawable, gc); (*gc->ops->CopyArea)(&pixmap->drawable, drawable, gc, 0, 0, pixmap->drawable.width, pixmap->drawable.height, x_off, y_off); if (update) (*gc->funcs->ChangeClip)(gc, CT_NONE, NULL, 0); FreeScratchGC(gc); } static inline PixmapPtr present_flip_pending_pixmap(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (!screen_priv) return NULL; if (!screen_priv->flip_pending) return NULL; return screen_priv->flip_pending->pixmap; } static Bool present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip, RegionPtr valid, int16_t x_off, int16_t y_off) { ScreenPtr screen = window->drawable.pScreen; PixmapPtr window_pixmap; WindowPtr root = screen->root; present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (!screen_priv) return FALSE; if (!screen_priv->info) return FALSE; if (!crtc) return FALSE; /* Check to see if the driver supports flips at all */ if (!screen_priv->info->flip) return FALSE; /* Make sure the window hasn't been redirected with Composite */ window_pixmap = screen->GetWindowPixmap(window); if (window_pixmap != screen->GetScreenPixmap(screen) && window_pixmap != screen_priv->flip_pixmap && window_pixmap != present_flip_pending_pixmap(screen)) return FALSE; /* Check for full-screen window */ if (!RegionEqual(&window->clipList, &root->winSize)) { return FALSE; } /* Source pixmap must align with window exactly */ if (x_off || y_off) { return FALSE; } /* Make sure the area marked as valid fills the screen */ if (valid && !RegionEqual(valid, &root->winSize)) { return FALSE; } /* Does the window match the pixmap exactly? */ if (window->drawable.x != 0 || window->drawable.y != 0 || #ifdef COMPOSITE window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y || #endif window->drawable.width != pixmap->drawable.width || window->drawable.height != pixmap->drawable.height) { return FALSE; } /* Ask the driver for permission */ if (screen_priv->info->check_flip) { if (!(*screen_priv->info->check_flip) (crtc, window, pixmap, sync_flip)) { DebugPresent(("\td %08lx -> %08lx\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0)); return FALSE; } } return TRUE; } static Bool present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc, PixmapPtr pixmap, Bool sync_flip) { ScreenPtr screen = crtc->pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); return (*screen_priv->info->flip) (crtc, event_id, target_msc, pixmap, sync_flip); } static void present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_t ust, uint64_t crtc_msc) { int n; if (vblank->window) present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset); for (n = 0; n < vblank->num_notifies; n++) { WindowPtr window = vblank->notifies[n].window; CARD32 serial = vblank->notifies[n].serial; if (window) present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset); } } static void present_pixmap_idle(PixmapPtr pixmap, WindowPtr window, CARD32 serial, struct present_fence *present_fence) { if (present_fence) present_fence_set_triggered(present_fence); if (window) { DebugPresent(("\ti %08lx\n", pixmap ? pixmap->drawable.id : 0)); present_send_idle_notify(window, serial, pixmap, present_fence); } } RRCrtcPtr present_get_crtc(WindowPtr window) { ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (!screen_priv) return NULL; if (!screen_priv->info) return NULL; return (*screen_priv->info->get_crtc)(window); } uint32_t present_query_capabilities(RRCrtcPtr crtc) { present_screen_priv_ptr screen_priv; if (!crtc) return 0; screen_priv = present_screen_priv(crtc->pScreen); if (!screen_priv) return 0; if (!screen_priv->info) return 0; return screen_priv->info->capabilities; } static int present_get_ust_msc(ScreenPtr screen, RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (crtc == NULL) return present_fake_get_ust_msc(screen, ust, msc); else return (*screen_priv->info->get_ust_msc)(crtc, ust, msc); } static void present_flush(WindowPtr window) { ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (!screen_priv) return; if (!screen_priv->info) return; (*screen_priv->info->flush) (window); } static int present_queue_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) { Bool ret; if (crtc == NULL) ret = present_fake_queue_vblank(screen, event_id, msc); else { present_screen_priv_ptr screen_priv = present_screen_priv(screen); ret = (*screen_priv->info->queue_vblank) (crtc, event_id, msc); } return ret; } static uint64_t present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc, uint64_t new_msc) { present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); if (crtc != window_priv->crtc) { uint64_t old_ust, old_msc; if (window_priv->crtc == PresentCrtcNeverSet) { window_priv->msc_offset = 0; } else { /* The old CRTC may have been turned off, in which case * we'll just use whatever previous MSC we'd seen from this CRTC */ if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success) old_msc = window_priv->msc; window_priv->msc_offset += new_msc - old_msc; } window_priv->crtc = crtc; } return window_msc + window_priv->msc_offset; } /* * When the wait fence or previous flip is completed, it's time * to re-try the request */ static void present_re_execute(present_vblank_ptr vblank) { uint64_t ust = 0, crtc_msc = 0; if (vblank->crtc) (void) present_get_ust_msc(vblank->screen, vblank->crtc, &ust, &crtc_msc); present_execute(vblank, ust, crtc_msc); } static void present_flip_try_ready(ScreenPtr screen) { present_vblank_ptr vblank, tmp; xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) { if (vblank->flip_ready) { present_re_execute(vblank); return; } } } static void present_flip_idle(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (screen_priv->flip_pixmap) { present_pixmap_idle(screen_priv->flip_pixmap, screen_priv->flip_window, screen_priv->flip_serial, screen_priv->flip_idle_fence); if (screen_priv->flip_idle_fence) present_fence_destroy(screen_priv->flip_idle_fence); dixDestroyPixmap(screen_priv->flip_pixmap, screen_priv->flip_pixmap->drawable.id); screen_priv->flip_crtc = NULL; screen_priv->flip_window = NULL; screen_priv->flip_serial = 0; screen_priv->flip_pixmap = NULL; screen_priv->flip_idle_fence = NULL; } } struct pixmap_visit { PixmapPtr old; PixmapPtr new; }; static int present_set_tree_pixmap_visit(WindowPtr window, void *data) { struct pixmap_visit *visit = data; ScreenPtr screen = window->drawable.pScreen; if ((*screen->GetWindowPixmap)(window) != visit->old) return WT_DONTWALKCHILDREN; (*screen->SetWindowPixmap)(window, visit->new); return WT_WALKCHILDREN; } static void present_set_tree_pixmap(WindowPtr window, PixmapPtr pixmap) { struct pixmap_visit visit; ScreenPtr screen = window->drawable.pScreen; visit.old = (*screen->GetWindowPixmap)(window); visit.new = pixmap; if (visit.old == visit.new) return; TraverseTree(window, present_set_tree_pixmap_visit, &visit); } static void present_set_abort_flip(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); /* Switch back to using the screen pixmap now to avoid * 2D applications drawing to the wrong pixmap. */ if (screen_priv->flip_window) present_set_tree_pixmap(screen_priv->flip_window, (*screen->GetScreenPixmap)(screen)); if (screen->root) present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen)); screen_priv->flip_pending->abort_flip = TRUE; } static void present_unflip(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); assert (!screen_priv->unflip_event_id); assert (!screen_priv->flip_pending); if (screen_priv->flip_window) present_set_tree_pixmap(screen_priv->flip_window, (*screen->GetScreenPixmap)(screen)); present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen)); /* Update the screen pixmap with the current flip pixmap contents */ if (screen_priv->flip_pixmap && screen_priv->flip_window) { present_copy_region(&screen_priv->flip_window->drawable, screen_priv->flip_pixmap, NULL, 0, 0); } screen_priv->unflip_event_id = ++present_event_id; DebugPresent(("u %lld\n", screen_priv->unflip_event_id)); (*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id); } static void present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) { ScreenPtr screen = vblank->screen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n", vblank->event_id, vblank, vblank->target_msc, vblank->pixmap ? vblank->pixmap->drawable.id : 0, vblank->window ? vblank->window->drawable.id : 0)); assert (vblank == screen_priv->flip_pending); present_flip_idle(screen); xorg_list_del(&vblank->event_queue); /* Transfer reference for pixmap and fence from vblank to screen_priv */ screen_priv->flip_crtc = vblank->crtc; screen_priv->flip_window = vblank->window; screen_priv->flip_serial = vblank->serial; screen_priv->flip_pixmap = vblank->pixmap; screen_priv->flip_idle_fence = vblank->idle_fence; vblank->pixmap = NULL; vblank->idle_fence = NULL; screen_priv->flip_pending = NULL; if (vblank->abort_flip) present_unflip(screen); present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc); present_vblank_destroy(vblank); present_flip_try_ready(screen); } void present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc) { present_vblank_ptr vblank, tmp; int s; if (!event_id) return; DebugPresent(("\te %lld ust %lld msc %lld\n", event_id, ust, msc)); xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) { if (vblank->event_id == event_id) { present_execute(vblank, ust, msc); return; } } xorg_list_for_each_entry_safe(vblank, tmp, &present_flip_queue, event_queue) { if (vblank->event_id == event_id) { present_flip_notify(vblank, ust, msc); return; } } for (s = 0; s < screenInfo.numScreens; s++) { ScreenPtr screen = screenInfo.screens[s]; present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (event_id == screen_priv->unflip_event_id) { DebugPresent(("\tun %lld\n", event_id)); screen_priv->unflip_event_id = 0; present_flip_idle(screen); present_flip_try_ready(screen); return; } } } /* * 'window' is being reconfigured. Check to see if it is involved * in flipping and clean up as necessary */ void present_check_flip_window (WindowPtr window) { ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); present_window_priv_ptr window_priv = present_window_priv(window); present_vblank_ptr flip_pending = screen_priv->flip_pending; present_vblank_ptr vblank; /* If this window hasn't ever been used with Present, it can't be * flipping */ if (!window_priv) return; if (screen_priv->unflip_event_id) return; if (flip_pending) { /* * Check pending flip */ if (flip_pending->window == window) { if (!present_check_flip(flip_pending->crtc, window, flip_pending->pixmap, flip_pending->sync_flip, NULL, 0, 0)) present_set_abort_flip(screen); } } else { /* * Check current flip */ if (window == screen_priv->flip_window) { if (!present_check_flip(screen_priv->flip_crtc, window, screen_priv->flip_pixmap, FALSE, NULL, 0, 0)) present_unflip(screen); } } /* Now check any queued vblanks */ xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) { if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, FALSE, NULL, 0, 0)) vblank->flip = FALSE; } } /* * Called when the wait fence is triggered; just gets the current msc/ust and * calls present_execute again. That will re-check the fence and pend the * request again if it's still not actually ready */ static void present_wait_fence_triggered(void *param) { present_vblank_ptr vblank = param; present_re_execute(vblank); } /* * Once the required MSC has been reached, execute the pending request. * * For requests to actually present something, either blt contents to * the screen or queue a frame buffer swap. * * For requests to just get the current MSC/UST combo, skip that part and * go straight to event delivery */ static void present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) { WindowPtr window = vblank->window; ScreenPtr screen = window->drawable.pScreen; present_screen_priv_ptr screen_priv = present_screen_priv(screen); uint8_t mode; if (vblank->wait_fence) { if (!present_fence_check_triggered(vblank->wait_fence)) { present_fence_set_callback(vblank->wait_fence, present_wait_fence_triggered, vblank); return; } } if (vblank->flip && vblank->pixmap && vblank->window) { if (screen_priv->flip_pending || screen_priv->unflip_event_id) { DebugPresent(("\tr %lld %p (pending %p unflip %lld)\n", vblank->event_id, vblank, screen_priv->flip_pending, screen_priv->unflip_event_id)); vblank->flip_ready = TRUE; return; } } xorg_list_del(&vblank->event_queue); xorg_list_del(&vblank->window_list); vblank->queued = FALSE; if (vblank->pixmap && vblank->window) { if (vblank->flip) { DebugPresent(("\tf %lld %p %8lld: %08lx -> %08lx\n", vblank->event_id, vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); /* Prepare to flip by placing it in the flip queue and * and sticking it into the flip_pending field */ screen_priv->flip_pending = vblank; xorg_list_add(&vblank->event_queue, &present_flip_queue); /* Try to flip */ if (present_flip(vblank->crtc, vblank->event_id, vblank->target_msc, vblank->pixmap, vblank->sync_flip)) { RegionPtr damage; /* Fix window pixmaps: * 1) Restore previous flip window pixmap * 2) Set current flip window pixmap to the new pixmap */ if (screen_priv->flip_window && screen_priv->flip_window != window) present_set_tree_pixmap(screen_priv->flip_window, (*screen->GetScreenPixmap)(screen)); present_set_tree_pixmap(vblank->window, vblank->pixmap); present_set_tree_pixmap(screen->root, vblank->pixmap); /* Report update region as damaged */ if (vblank->update) { damage = vblank->update; RegionIntersect(damage, damage, &window->clipList); } else damage = &window->clipList; DamageDamageRegion(&vblank->window->drawable, damage); return; } xorg_list_del(&vblank->event_queue); /* Oops, flip failed. Clear the flip_pending field */ screen_priv->flip_pending = NULL; vblank->flip = FALSE; } DebugPresent(("\tc %p %8lld: %08lx -> %08lx\n", vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); if (screen_priv->flip_pending) { /* Check pending flip */ if (window == screen_priv->flip_pending->window) present_set_abort_flip(screen); } else if (!screen_priv->unflip_event_id) { /* Check current flip */ if (window == screen_priv->flip_window) present_unflip(screen); } present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off); /* present_copy_region sticks the region into a scratch GC, * which is then freed, freeing the region */ vblank->update = NULL; present_flush(window); present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); } /* Compute correct CompleteMode */ if (vblank->kind == PresentCompleteKindPixmap) { if (vblank->pixmap && vblank->window) mode = PresentCompleteModeCopy; else mode = PresentCompleteModeSkip; } else mode = PresentCompleteModeCopy; present_vblank_notify(vblank, vblank->kind, mode, ust, crtc_msc); present_vblank_destroy(vblank); } int present_pixmap(WindowPtr window, PixmapPtr pixmap, CARD32 serial, RegionPtr valid, RegionPtr update, int16_t x_off, int16_t y_off, RRCrtcPtr target_crtc, SyncFence *wait_fence, SyncFence *idle_fence, uint32_t options, uint64_t window_msc, uint64_t divisor, uint64_t remainder, present_notify_ptr notifies, int num_notifies) { uint64_t ust; uint64_t target_msc; uint64_t crtc_msc; int ret; present_vblank_ptr vblank, tmp; ScreenPtr screen = window->drawable.pScreen; present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (!window_priv) return BadAlloc; if (!screen_priv || !screen_priv->info) target_crtc = NULL; else if (!target_crtc) { /* Update the CRTC if we have a pixmap or we don't have a CRTC */ if (!pixmap) target_crtc = window_priv->crtc; if (!target_crtc || target_crtc == PresentCrtcNeverSet) target_crtc = present_get_crtc(window); } present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc); target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc); /* Stash the current MSC away in case we need it later */ window_priv->msc = crtc_msc; /* Adjust target_msc to match modulus */ if (crtc_msc >= target_msc) { if (divisor != 0) { target_msc = crtc_msc - (crtc_msc % divisor) + remainder; if (options & PresentOptionAsync) { if (target_msc < crtc_msc) target_msc += divisor; } else { if (target_msc <= crtc_msc) target_msc += divisor; } } else { target_msc = crtc_msc; if (!(options & PresentOptionAsync)) target_msc++; } } /* * Look for a matching presentation already on the list and * don't bother doing the previous one if this one will overwrite it * in the same frame */ if (!update && pixmap) { xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) { if (!vblank->pixmap) continue; if (!vblank->queued) continue; if (vblank->crtc != target_crtc || vblank->target_msc != target_msc) continue; DebugPresent(("\tx %lld %p %8lld: %08lx -> %08lx (crtc %p)\n", vblank->event_id, vblank, vblank->target_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id, vblank->crtc)); present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); present_fence_destroy(vblank->idle_fence); dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); vblank->pixmap = NULL; vblank->idle_fence = NULL; vblank->flip = FALSE; if (vblank->flip_ready) present_re_execute(vblank); } } vblank = calloc (1, sizeof (present_vblank_rec)); if (!vblank) return BadAlloc; xorg_list_append(&vblank->window_list, &window_priv->vblank); xorg_list_init(&vblank->event_queue); vblank->screen = screen; vblank->window = window; vblank->pixmap = pixmap; vblank->event_id = ++present_event_id; if (pixmap) { vblank->kind = PresentCompleteKindPixmap; pixmap->refcnt++; } else vblank->kind = PresentCompleteKindNotifyMSC; vblank->serial = serial; if (valid) { vblank->valid = RegionDuplicate(valid); if (!vblank->valid) goto no_mem; } if (update) { vblank->update = RegionDuplicate(update); if (!vblank->update) goto no_mem; } vblank->x_off = x_off; vblank->y_off = y_off; vblank->target_msc = target_msc; vblank->crtc = target_crtc; vblank->msc_offset = window_priv->msc_offset; vblank->notifies = notifies; vblank->num_notifies = num_notifies; if (!(options & PresentOptionAsync)) vblank->sync_flip = TRUE; if (!(options & PresentOptionCopy) && !((options & PresentOptionAsync) && (!screen_priv->info || !(screen_priv->info->capabilities & PresentCapabilityAsync))) && pixmap != NULL && present_check_flip (target_crtc, window, pixmap, vblank->sync_flip, valid, x_off, y_off)) { vblank->flip = TRUE; if (vblank->sync_flip) target_msc--; } if (wait_fence) { vblank->wait_fence = present_fence_create(wait_fence); if (!vblank->wait_fence) goto no_mem; } if (idle_fence) { vblank->idle_fence = present_fence_create(idle_fence); if (!vblank->idle_fence) goto no_mem; } if (pixmap) DebugPresent(("q %lld %p %8lld: %08lx -> %08lx (crtc %p) flip %d vsync %d serial %d\n", vblank->event_id, vblank, target_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id, target_crtc, vblank->flip, vblank->sync_flip, vblank->serial)); xorg_list_add(&vblank->event_queue, &present_exec_queue); vblank->queued = TRUE; if ((pixmap && target_msc >= crtc_msc) || (!pixmap && target_msc > crtc_msc)) { ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc); if (ret == Success) return Success; DebugPresent(("present_queue_vblank failed\n")); } present_execute(vblank, ust, crtc_msc); return Success; no_mem: ret = BadAlloc; vblank->notifies = NULL; present_vblank_destroy(vblank); return ret; } void present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) { present_vblank_ptr vblank, tmp; if (crtc == NULL) present_fake_abort_vblank(screen, event_id, msc); else { present_screen_priv_ptr screen_priv = present_screen_priv(screen); (*screen_priv->info->abort_vblank) (crtc, event_id, msc); } xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) { if (vblank->event_id == event_id) { xorg_list_del(&vblank->event_queue); vblank->queued = FALSE; return; } } xorg_list_for_each_entry_safe(vblank, tmp, &present_flip_queue, event_queue) { if (vblank->event_id == event_id) { xorg_list_del(&vblank->event_queue); return; } } } int present_notify_msc(WindowPtr window, CARD32 serial, uint64_t target_msc, uint64_t divisor, uint64_t remainder) { return present_pixmap(window, NULL, serial, NULL, NULL, 0, 0, NULL, NULL, NULL, PresentOptionAsync, target_msc, divisor, remainder, NULL, 0); } void present_flip_destroy(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); /* Reset window pixmaps back to the screen pixmap */ if (screen_priv->flip_pending) present_set_abort_flip(screen); /* Drop reference to any pending flip or unflip pixmaps. */ present_flip_idle(screen); } void present_vblank_destroy(present_vblank_ptr vblank) { /* Remove vblank from window and screen lists */ xorg_list_del(&vblank->window_list); DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n", vblank->event_id, vblank, vblank->target_msc, vblank->pixmap ? vblank->pixmap->drawable.id : 0, vblank->window ? vblank->window->drawable.id : 0)); /* Drop pixmap reference */ if (vblank->pixmap) dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); /* Free regions */ if (vblank->valid) RegionDestroy(vblank->valid); if (vblank->update) RegionDestroy(vblank->update); if (vblank->wait_fence) present_fence_destroy(vblank->wait_fence); if (vblank->idle_fence) present_fence_destroy(vblank->idle_fence); if (vblank->notifies) present_destroy_notifies(vblank->notifies, vblank->num_notifies); free(vblank); } Bool present_init(void) { xorg_list_init(&present_exec_queue); xorg_list_init(&present_flip_queue); present_fake_queue_init(); return TRUE; } xorg-server-1.17.1/present/present_priv.h0000664000175100017510000002020312444227027015363 00000000000000/* * Copyright © 2013 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. */ #ifndef _PRESENT_PRIV_H_ #define _PRESENT_PRIV_H_ #include #include "scrnintstr.h" #include "misc.h" #include "list.h" #include "windowstr.h" #include "dixstruct.h" #include "present.h" #include #include #include #include extern int present_request; extern DevPrivateKeyRec present_screen_private_key; typedef struct present_fence *present_fence_ptr; typedef struct present_notify present_notify_rec, *present_notify_ptr; struct present_notify { struct xorg_list window_list; WindowPtr window; CARD32 serial; }; struct present_vblank { struct xorg_list window_list; struct xorg_list event_queue; ScreenPtr screen; WindowPtr window; PixmapPtr pixmap; RegionPtr valid; RegionPtr update; RRCrtcPtr crtc; uint32_t serial; int16_t x_off; int16_t y_off; CARD16 kind; uint64_t event_id; uint64_t target_msc; uint64_t msc_offset; present_fence_ptr idle_fence; present_fence_ptr wait_fence; present_notify_ptr notifies; int num_notifies; Bool queued; /* on present_exec_queue */ Bool flip; /* planning on using flip */ Bool flip_ready; /* wants to flip, but waiting for previous flip or unflip */ Bool sync_flip; /* do flip synchronous to vblank */ Bool abort_flip; /* aborting this flip */ }; typedef struct present_screen_priv { CloseScreenProcPtr CloseScreen; ConfigNotifyProcPtr ConfigNotify; DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; present_vblank_ptr flip_pending; uint64_t unflip_event_id; uint32_t fake_interval; /* Currently active flipped pixmap and fence */ RRCrtcPtr flip_crtc; WindowPtr flip_window; uint32_t flip_serial; PixmapPtr flip_pixmap; present_fence_ptr flip_idle_fence; present_screen_info_ptr info; } present_screen_priv_rec, *present_screen_priv_ptr; #define wrap(priv,real,mem,func) {\ priv->mem = real->mem; \ real->mem = func; \ } #define unwrap(priv,real,mem) {\ real->mem = priv->mem; \ } static inline present_screen_priv_ptr present_screen_priv(ScreenPtr screen) { return (present_screen_priv_ptr)dixLookupPrivate(&(screen)->devPrivates, &present_screen_private_key); } /* * Each window has a list of clients and event masks */ typedef struct present_event *present_event_ptr; typedef struct present_event { present_event_ptr next; ClientPtr client; WindowPtr window; XID id; int mask; } present_event_rec; typedef struct present_window_priv { present_event_ptr events; RRCrtcPtr crtc; /* Last reported CRTC from get_ust_msc */ uint64_t msc_offset; uint64_t msc; /* Last reported MSC from the current crtc */ struct xorg_list vblank; struct xorg_list notifies; } present_window_priv_rec, *present_window_priv_ptr; #define PresentCrtcNeverSet ((RRCrtcPtr) 1) extern DevPrivateKeyRec present_window_private_key; static inline present_window_priv_ptr present_window_priv(WindowPtr window) { return (present_window_priv_ptr)dixGetPrivate(&(window)->devPrivates, &present_window_private_key); } present_window_priv_ptr present_get_window_priv(WindowPtr window, Bool create); extern RESTYPE present_event_type; /* * present.c */ int present_pixmap(WindowPtr window, PixmapPtr pixmap, CARD32 serial, RegionPtr valid, RegionPtr update, int16_t x_off, int16_t y_off, RRCrtcPtr target_crtc, SyncFence *wait_fence, SyncFence *idle_fence, uint32_t options, uint64_t target_msc, uint64_t divisor, uint64_t remainder, present_notify_ptr notifies, int num_notifies); int present_notify_msc(WindowPtr window, CARD32 serial, uint64_t target_msc, uint64_t divisor, uint64_t remainder); void present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc); void present_vblank_destroy(present_vblank_ptr vblank); void present_flip_destroy(ScreenPtr screen); void present_check_flip_window(WindowPtr window); RRCrtcPtr present_get_crtc(WindowPtr window); uint32_t present_query_capabilities(RRCrtcPtr crtc); Bool present_init(void); /* * present_event.c */ void present_free_events(WindowPtr window); void present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling); void present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc); void present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, present_fence_ptr idle_fence); int present_select_input(ClientPtr client, CARD32 eid, WindowPtr window, CARD32 event_mask); Bool present_event_init(void); /* * present_fake.c */ int present_fake_get_ust_msc(ScreenPtr screen, uint64_t *ust, uint64_t *msc); int present_fake_queue_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc); void present_fake_abort_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc); void present_fake_screen_init(ScreenPtr screen); void present_fake_queue_init(void); /* * present_fence.c */ struct present_fence * present_fence_create(SyncFence *sync_fence); void present_fence_destroy(struct present_fence *present_fence); void present_fence_set_triggered(struct present_fence *present_fence); Bool present_fence_check_triggered(struct present_fence *present_fence); void present_fence_set_callback(struct present_fence *present_fence, void (*callback)(void *param), void *param); XID present_fence_id(struct present_fence *present_fence); /* * present_notify.c */ void present_clear_window_notifies(WindowPtr window); void present_free_window_notify(present_notify_ptr notify); int present_add_window_notify(present_notify_ptr notify); int present_create_notifies(ClientPtr client, int num_notifies, xPresentNotify *x_notifies, present_notify_ptr *p_notifies); void present_destroy_notifies(present_notify_ptr notifies, int num_notifies); /* * present_redirect.c */ WindowPtr present_redirect(ClientPtr client, WindowPtr target); /* * present_request.c */ int proc_present_dispatch(ClientPtr client); int sproc_present_dispatch(ClientPtr client); /* * present_screen.c */ #endif /* _PRESENT_PRIV_H_ */ xorg-server-1.17.1/present/present_request.c0000664000175100017510000002500112456571574016103 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "present_priv.h" #include "randrstr.h" #include static int proc_present_query_version(ClientPtr client) { REQUEST(xPresentQueryVersionReq); xPresentQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = SERVER_PRESENT_MAJOR_VERSION, .minorVersion = SERVER_PRESENT_MINOR_VERSION }; REQUEST_SIZE_MATCH(xPresentQueryVersionReq); (void) stuff; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.majorVersion); swapl(&rep.minorVersion); } WriteToClient(client, sizeof(rep), &rep); return Success; } #define VERIFY_FENCE_OR_NONE(fence_ptr, fence_id, client, access) do { \ if ((fence_id) == None) \ (fence_ptr) = NULL; \ else { \ int __rc__ = SyncVerifyFence(&fence_ptr, fence_id, client, access); \ if (__rc__ != Success) \ return __rc__; \ } \ } while (0) #define VERIFY_CRTC_OR_NONE(crtc_ptr, crtc_id, client, access) do { \ if ((crtc_id) == None) \ (crtc_ptr) = NULL; \ else { \ VERIFY_RR_CRTC(crtc_id, crtc_ptr, access); \ } \ } while (0) static int proc_present_pixmap(ClientPtr client) { REQUEST(xPresentPixmapReq); WindowPtr window; PixmapPtr pixmap; RegionPtr valid = NULL; RegionPtr update = NULL; SyncFence *wait_fence; SyncFence *idle_fence; RRCrtcPtr target_crtc; int ret; int nnotifies; present_notify_ptr notifies = NULL; REQUEST_AT_LEAST_SIZE(xPresentPixmapReq); ret = dixLookupWindow(&window, stuff->window, client, DixWriteAccess); if (ret != Success) return ret; ret = dixLookupResourceByType((void **) &pixmap, stuff->pixmap, RT_PIXMAP, client, DixReadAccess); if (ret != Success) return ret; if (window->drawable.depth != pixmap->drawable.depth) return BadMatch; VERIFY_REGION_OR_NONE(valid, stuff->valid, client, DixReadAccess); VERIFY_REGION_OR_NONE(update, stuff->update, client, DixReadAccess); VERIFY_CRTC_OR_NONE(target_crtc, stuff->target_crtc, client, DixReadAccess); VERIFY_FENCE_OR_NONE(wait_fence, stuff->wait_fence, client, DixReadAccess); VERIFY_FENCE_OR_NONE(idle_fence, stuff->idle_fence, client, DixWriteAccess); if (stuff->options & ~(PresentAllOptions)) { client->errorValue = stuff->options; return BadValue; } /* * Check to see if remainder is sane */ if (stuff->divisor == 0) { if (stuff->remainder != 0) { client->errorValue = (CARD32) stuff->remainder; return BadValue; } } else { if (stuff->remainder >= stuff->divisor) { client->errorValue = (CARD32) stuff->remainder; return BadValue; } } nnotifies = (client->req_len << 2) - sizeof (xPresentPixmapReq); if (nnotifies % sizeof (xPresentNotify)) return BadLength; nnotifies /= sizeof (xPresentNotify); if (nnotifies) { ret = present_create_notifies(client, nnotifies, (xPresentNotify *) (stuff + 1), ¬ifies); if (ret != Success) return ret; } ret = present_pixmap(window, pixmap, stuff->serial, valid, update, stuff->x_off, stuff->y_off, target_crtc, wait_fence, idle_fence, stuff->options, stuff->target_msc, stuff->divisor, stuff->remainder, notifies, nnotifies); if (ret != Success) present_destroy_notifies(notifies, nnotifies); return ret; } static int proc_present_notify_msc(ClientPtr client) { REQUEST(xPresentNotifyMSCReq); WindowPtr window; int rc; REQUEST_SIZE_MATCH(xPresentNotifyMSCReq); rc = dixLookupWindow(&window, stuff->window, client, DixReadAccess); if (rc != Success) return rc; /* * Check to see if remainder is sane */ if (stuff->divisor == 0) { if (stuff->remainder != 0) { client->errorValue = (CARD32) stuff->remainder; return BadValue; } } else { if (stuff->remainder >= stuff->divisor) { client->errorValue = (CARD32) stuff->remainder; return BadValue; } } return present_notify_msc(window, stuff->serial, stuff->target_msc, stuff->divisor, stuff->remainder); } static int proc_present_select_input (ClientPtr client) { REQUEST(xPresentSelectInputReq); WindowPtr window; int rc; REQUEST_SIZE_MATCH(xPresentSelectInputReq); LEGAL_NEW_RESOURCE(stuff->eid, client); rc = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; if (stuff->eventMask & ~PresentAllEvents) { client->errorValue = stuff->eventMask; return BadValue; } return present_select_input(client, stuff->eid, window, stuff->eventMask); } static int proc_present_query_capabilities (ClientPtr client) { REQUEST(xPresentQueryCapabilitiesReq); xPresentQueryCapabilitiesReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, }; WindowPtr window; RRCrtcPtr crtc = NULL; int r; REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq); r = dixLookupWindow(&window, stuff->target, client, DixGetAttrAccess); switch (r) { case Success: crtc = present_get_crtc(window); break; case BadWindow: VERIFY_RR_CRTC(stuff->target, crtc, DixGetAttrAccess); break; default: return r; } rep.capabilities = present_query_capabilities(crtc); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.capabilities); } WriteToClient(client, sizeof(rep), &rep); return Success; } int (*proc_present_vector[PresentNumberRequests]) (ClientPtr) = { proc_present_query_version, /* 0 */ proc_present_pixmap, /* 1 */ proc_present_notify_msc, /* 2 */ proc_present_select_input, /* 3 */ proc_present_query_capabilities, /* 4 */ }; int proc_present_dispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data >= PresentNumberRequests || !proc_present_vector[stuff->data]) return BadRequest; return (*proc_present_vector[stuff->data]) (client); } static int sproc_present_query_version(ClientPtr client) { REQUEST(xPresentQueryVersionReq); REQUEST_SIZE_MATCH(xPresentQueryVersionReq); swaps(&stuff->length); swapl(&stuff->majorVersion); swapl(&stuff->minorVersion); return (*proc_present_vector[stuff->presentReqType]) (client); } static int sproc_present_pixmap(ClientPtr client) { REQUEST(xPresentPixmapReq); REQUEST_AT_LEAST_SIZE(xPresentPixmapReq); swaps(&stuff->length); swapl(&stuff->window); swapl(&stuff->pixmap); swapl(&stuff->valid); swapl(&stuff->update); swaps(&stuff->x_off); swaps(&stuff->y_off); swapll(&stuff->target_msc); swapll(&stuff->divisor); swapll(&stuff->remainder); swapl(&stuff->idle_fence); return (*proc_present_vector[stuff->presentReqType]) (client); } static int sproc_present_notify_msc(ClientPtr client) { REQUEST(xPresentNotifyMSCReq); REQUEST_SIZE_MATCH(xPresentNotifyMSCReq); swaps(&stuff->length); swapl(&stuff->window); swapll(&stuff->target_msc); swapll(&stuff->divisor); swapll(&stuff->remainder); return (*proc_present_vector[stuff->presentReqType]) (client); } static int sproc_present_select_input (ClientPtr client) { REQUEST(xPresentSelectInputReq); REQUEST_SIZE_MATCH(xPresentSelectInputReq); swaps(&stuff->length); swapl(&stuff->window); swapl(&stuff->eventMask); return (*proc_present_vector[stuff->presentReqType]) (client); } static int sproc_present_query_capabilities (ClientPtr client) { REQUEST(xPresentQueryCapabilitiesReq); REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq); swaps(&stuff->length); swapl(&stuff->target); return (*proc_present_vector[stuff->presentReqType]) (client); } int (*sproc_present_vector[PresentNumberRequests]) (ClientPtr) = { sproc_present_query_version, /* 0 */ sproc_present_pixmap, /* 1 */ sproc_present_notify_msc, /* 2 */ sproc_present_select_input, /* 3 */ sproc_present_query_capabilities, /* 4 */ }; int sproc_present_dispatch(ClientPtr client) { REQUEST(xReq); if (stuff->data >= PresentNumberRequests || !sproc_present_vector[stuff->data]) return BadRequest; return (*sproc_present_vector[stuff->data]) (client); } xorg-server-1.17.1/present/present.h0000664000175100017510000001164612406354444014340 00000000000000/* * Copyright © 2013 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. */ #ifndef _PRESENT_H_ #define _PRESENT_H_ #include #include "randrstr.h" #include "presentext.h" typedef struct present_vblank present_vblank_rec, *present_vblank_ptr; /* Return the current CRTC for 'window'. */ typedef RRCrtcPtr (*present_get_crtc_ptr) (WindowPtr window); /* Return the current ust/msc for 'crtc' */ typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc); /* Queue callback on 'crtc' for time 'msc'. Call present_event_notify with 'event_id' * at or after 'msc'. Return false if it didn't happen (which might occur if 'crtc' * is not currently generating vblanks). */ typedef Bool (*present_queue_vblank_ptr) (RRCrtcPtr crtc, uint64_t event_id, uint64_t msc); /* Abort pending vblank. The extension is no longer interested in * 'event_id' which was to be notified at 'msc'. If possible, the * driver is free to de-queue the notification. */ typedef void (*present_abort_vblank_ptr) (RRCrtcPtr crtc, uint64_t event_id, uint64_t msc); /* Flush pending drawing on 'window' to the hardware. */ typedef void (*present_flush_ptr) (WindowPtr window); /* Check if 'pixmap' is suitable for flipping to 'window'. */ typedef Bool (*present_check_flip_ptr) (RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip); /* Flip pixmap, return false if it didn't happen. * * 'crtc' is to be used for any necessary synchronization. * * 'sync_flip' requests that the flip be performed at the next * vertical blank interval to avoid tearing artifacts. If false, the * flip should be performed as soon as possible. * * present_event_notify should be called with 'event_id' when the flip * occurs */ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc, PixmapPtr pixmap, Bool sync_flip); /* "unflip" back to the regular screen scanout buffer * * present_event_notify should be called with 'event_id' when the unflip occurs. */ typedef void (*present_unflip_ptr) (ScreenPtr screen, uint64_t event_id); #define PRESENT_SCREEN_INFO_VERSION 0 typedef struct present_screen_info { uint32_t version; present_get_crtc_ptr get_crtc; present_get_ust_msc_ptr get_ust_msc; present_queue_vblank_ptr queue_vblank; present_abort_vblank_ptr abort_vblank; present_flush_ptr flush; uint32_t capabilities; present_check_flip_ptr check_flip; present_flip_ptr flip; present_unflip_ptr unflip; } present_screen_info_rec, *present_screen_info_ptr; /* * Called when 'event_id' occurs. 'ust' and 'msc' indicate when the * event actually happened */ extern _X_EXPORT void present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc); /* 'crtc' has been turned off, so any pending events will never occur. */ extern _X_EXPORT void present_event_abandon(RRCrtcPtr crtc); extern _X_EXPORT Bool present_screen_init(ScreenPtr screen, present_screen_info_ptr info); typedef void (*present_complete_notify_proc)(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc); extern _X_EXPORT void present_register_complete_notify(present_complete_notify_proc proc); #endif /* _PRESENT_H_ */ xorg-server-1.17.1/present/present_fake.c0000664000175100017510000001056612366220413015312 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "present_priv.h" #include "list.h" static struct xorg_list fake_vblank_queue; typedef struct present_fake_vblank { struct xorg_list list; uint64_t event_id; OsTimerPtr timer; ScreenPtr screen; } present_fake_vblank_rec, *present_fake_vblank_ptr; int present_fake_get_ust_msc(ScreenPtr screen, uint64_t *ust, uint64_t *msc) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); *ust = GetTimeInMicros(); *msc = (*ust + screen_priv->fake_interval / 2) / screen_priv->fake_interval; return Success; } static void present_fake_notify(ScreenPtr screen, uint64_t event_id) { uint64_t ust, msc; present_fake_get_ust_msc(screen, &ust, &msc); present_event_notify(event_id, ust, msc); } static CARD32 present_fake_do_timer(OsTimerPtr timer, CARD32 time, void *arg) { present_fake_vblank_ptr fake_vblank = arg; present_fake_notify(fake_vblank->screen, fake_vblank->event_id); xorg_list_del(&fake_vblank->list); free(fake_vblank); return 0; } void present_fake_abort_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc) { present_fake_vblank_ptr fake_vblank, tmp; xorg_list_for_each_entry_safe(fake_vblank, tmp, &fake_vblank_queue, list) { if (fake_vblank->event_id == event_id) { TimerCancel(fake_vblank->timer); xorg_list_del(&fake_vblank->list); free (fake_vblank); break; } } } int present_fake_queue_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); uint64_t ust = msc * screen_priv->fake_interval; uint64_t now = GetTimeInMicros(); INT32 delay = ((int64_t) (ust - now)) / 1000; present_fake_vblank_ptr fake_vblank; if (delay <= 0) { present_fake_notify(screen, event_id); return Success; } fake_vblank = calloc (1, sizeof (present_fake_vblank_rec)); if (!fake_vblank) return BadAlloc; fake_vblank->screen = screen; fake_vblank->event_id = event_id; fake_vblank->timer = TimerSet(NULL, 0, delay, present_fake_do_timer, fake_vblank); if (!fake_vblank->timer) { free(fake_vblank); return BadAlloc; } xorg_list_add(&fake_vblank->list, &fake_vblank_queue); return Success; } void present_fake_screen_init(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); /* For screens with hardware vblank support, the fake code * will be used for off-screen windows and while screens are blanked, * in which case we want a slow interval here * * Otherwise, pretend that the screen runs at 60Hz */ if (screen_priv->info && screen_priv->info->get_crtc) screen_priv->fake_interval = 1000000; else screen_priv->fake_interval = 16667; } void present_fake_queue_init(void) { xorg_list_init(&fake_vblank_queue); } xorg-server-1.17.1/present/presentext.h0000664000175100017510000000244712274325511015054 00000000000000/* * Copyright © 2013 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. */ #ifndef _PRESENTEXT_H_ #define _PRESENTEXT_H_ extern _X_EXPORT void present_extension_init(void); #endif /* _PRESENTEXT_H_ */ xorg-server-1.17.1/present/Makefile.in0000664000175100017510000006670312466505436014565 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = present DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libpresent_la_LIBADD = am_libpresent_la_OBJECTS = present.lo present_event.lo present_fake.lo \ present_fence.lo present_notify.lo present_request.lo \ present_screen.lo libpresent_la_OBJECTS = $(am_libpresent_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 = $(libpresent_la_SOURCES) DIST_SOURCES = $(libpresent_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libpresent.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ @DIX_CFLAGS@ @XORG_CFLAGS@ libpresent_la_SOURCES = \ present.h \ present.c \ present_event.c \ present_fake.c \ present_fence.c \ present_notify.c \ present_priv.h \ present_request.c \ present_screen.c sdk_HEADERS = present.h presentext.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 present/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign present/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libpresent.la: $(libpresent_la_OBJECTS) $(libpresent_la_DEPENDENCIES) $(EXTRA_libpresent_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libpresent_la_OBJECTS) $(libpresent_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_fake.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_fence.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_notify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present_screen.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/present/present_event.c0000664000175100017510000001616612404676435015543 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "present_priv.h" RESTYPE present_event_type; static int present_free_event(void *data, XID id) { present_event_ptr present_event = (present_event_ptr) data; present_window_priv_ptr window_priv = present_window_priv(present_event->window); present_event_ptr *previous, current; for (previous = &window_priv->events; (current = *previous); previous = ¤t->next) { if (current == present_event) { *previous = present_event->next; break; } } free((void *) present_event); return 1; } void present_free_events(WindowPtr window) { present_window_priv_ptr window_priv = present_window_priv(window); present_event_ptr event; if (!window_priv) return; while ((event = window_priv->events)) FreeResource(event->id, RT_NONE); } static void present_event_swap(xGenericEvent *from, xGenericEvent *to) { *to = *from; swaps(&to->sequenceNumber); swapl(&to->length); swaps(&to->evtype); switch (from->evtype) { case PresentConfigureNotify: { xPresentConfigureNotify *c = (xPresentConfigureNotify *) to; swapl(&c->eid); swapl(&c->window); swaps(&c->x); swaps(&c->y); swaps(&c->width); swaps(&c->height); swaps(&c->off_x); swaps(&c->off_y); swaps(&c->pixmap_width); swaps(&c->pixmap_height); swapl(&c->pixmap_flags); break; } case PresentCompleteNotify: { xPresentCompleteNotify *c = (xPresentCompleteNotify *) to; swapl(&c->eid); swapl(&c->window); swapl(&c->serial); swapll(&c->ust); swapll(&c->msc); } case PresentIdleNotify: { xPresentIdleNotify *c = (xPresentIdleNotify *) to; swapl(&c->eid); swapl(&c->window); swapl(&c->serial); swapl(&c->idle_fence); } } } void present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling) { present_window_priv_ptr window_priv = present_window_priv(window); if (window_priv) { xPresentConfigureNotify cn = { .type = GenericEvent, .extension = present_request, .length = (sizeof(xPresentConfigureNotify) - 32) >> 2, .evtype = PresentConfigureNotify, .eid = 0, .window = window->drawable.id, .x = x, .y = y, .width = w, .height = h, .off_x = 0, .off_y = 0, .pixmap_width = w, .pixmap_height = h, .pixmap_flags = 0 }; present_event_ptr event; for (event = window_priv->events; event; event = event->next) { if (event->mask & (1 << PresentConfigureNotify)) { cn.eid = event->id; WriteEventsToClient(event->client, 1, (xEvent *) &cn); } } } } static present_complete_notify_proc complete_notify; void present_register_complete_notify(present_complete_notify_proc proc) { complete_notify = proc; } void present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc) { present_window_priv_ptr window_priv = present_window_priv(window); if (window_priv) { xPresentCompleteNotify cn = { .type = GenericEvent, .extension = present_request, .length = (sizeof(xPresentCompleteNotify) - 32) >> 2, .evtype = PresentCompleteNotify, .kind = kind, .mode = mode, .eid = 0, .window = window->drawable.id, .serial = serial, .ust = ust, .msc = msc, }; present_event_ptr event; for (event = window_priv->events; event; event = event->next) { if (event->mask & PresentCompleteNotifyMask) { cn.eid = event->id; WriteEventsToClient(event->client, 1, (xEvent *) &cn); } } } if (complete_notify) (*complete_notify)(window, kind, mode, serial, ust, msc); } void present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, struct present_fence *idle_fence) { present_window_priv_ptr window_priv = present_window_priv(window); if (window_priv) { xPresentIdleNotify in = { .type = GenericEvent, .extension = present_request, .length = (sizeof(xPresentIdleNotify) - 32) >> 2, .evtype = PresentIdleNotify, .eid = 0, .window = window->drawable.id, .serial = serial, .pixmap = pixmap->drawable.id, .idle_fence = present_fence_id(idle_fence) }; present_event_ptr event; for (event = window_priv->events; event; event = event->next) { if (event->mask & PresentIdleNotifyMask) { in.eid = event->id; WriteEventsToClient(event->client, 1, (xEvent *) &in); } } } } int present_select_input(ClientPtr client, XID eid, WindowPtr window, CARD32 mask) { present_window_priv_ptr window_priv = present_get_window_priv(window, mask != 0); present_event_ptr event; if (!window_priv) { if (mask) return BadAlloc; return Success; } event = calloc (1, sizeof (present_event_rec)); if (!event) return BadAlloc; event->client = client; event->window = window; event->id = eid; event->mask = mask; event->next = window_priv->events; window_priv->events = event; if (!AddResource(event->id, present_event_type, (void *) event)) return BadAlloc; return Success; } Bool present_event_init(void) { present_event_type = CreateNewResourceType(present_free_event, "PresentEvent"); if (!present_event_type) return FALSE; GERegisterExtension(present_request, present_event_swap); return TRUE; } xorg-server-1.17.1/present/present_fence.c0000664000175100017510000001024712366220413015460 00000000000000/* * Copyright © 2013 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "present_priv.h" #include #include #include /* * Wraps SyncFence objects so we can add a SyncTrigger to find out * when the SyncFence gets destroyed and clean up appropriately */ struct present_fence { SyncTrigger trigger; SyncFence *fence; void (*callback)(void *param); void *param; }; /* * SyncTrigger callbacks */ static Bool present_fence_sync_check_trigger(SyncTrigger *trigger, XSyncValue oldval) { struct present_fence *present_fence = container_of(trigger, struct present_fence, trigger); return present_fence->callback != NULL; } static void present_fence_sync_trigger_fired(SyncTrigger *trigger) { struct present_fence *present_fence = container_of(trigger, struct present_fence, trigger); if (present_fence->callback) (*present_fence->callback)(present_fence->param); } static void present_fence_sync_counter_destroyed(SyncTrigger *trigger) { struct present_fence *present_fence = container_of(trigger, struct present_fence, trigger); present_fence->fence = NULL; } struct present_fence * present_fence_create(SyncFence *fence) { struct present_fence *present_fence; present_fence = calloc (1, sizeof (struct present_fence)); if (!present_fence) return NULL; present_fence->fence = fence; present_fence->trigger.pSync = (SyncObject *) fence; present_fence->trigger.CheckTrigger = present_fence_sync_check_trigger; present_fence->trigger.TriggerFired = present_fence_sync_trigger_fired; present_fence->trigger.CounterDestroyed = present_fence_sync_counter_destroyed; if (SyncAddTriggerToSyncObject(&present_fence->trigger) != Success) { free (present_fence); return NULL; } return present_fence; } void present_fence_destroy(struct present_fence *present_fence) { if (present_fence) { if (present_fence->fence) SyncDeleteTriggerFromSyncObject(&present_fence->trigger); free(present_fence); } } void present_fence_set_triggered(struct present_fence *present_fence) { if (present_fence) if (present_fence->fence) (*present_fence->fence->funcs.SetTriggered) (present_fence->fence); } Bool present_fence_check_triggered(struct present_fence *present_fence) { if (!present_fence) return TRUE; if (!present_fence->fence) return TRUE; return (*present_fence->fence->funcs.CheckTriggered)(present_fence->fence); } void present_fence_set_callback(struct present_fence *present_fence, void (*callback) (void *param), void *param) { present_fence->callback = callback; present_fence->param = param; } XID present_fence_id(struct present_fence *present_fence) { if (!present_fence) return None; if (!present_fence->fence) return None; return present_fence->fence->sync.id; } xorg-server-1.17.1/configure.ac0000664000175100017510000027347712466504650013333 00000000000000dnl Copyright © 2003-2007 Keith Packard, Daniel Stone dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, dnl and/or sell copies of the Software, and to permit persons to whom the dnl Software is furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice (including the next dnl paragraph) shall be included in all copies or substantial portions of the dnl Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER dnl DEALINGS IN THE SOFTWARE. dnl dnl Authors: Keith Packard dnl Daniel Stone dnl an unwitting cast of miscellaneous others dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) AC_INIT([xorg-server], 1.17.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) RELEASE_DATE="2015-02-10" RELEASE_NAME="lambic" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AC_USE_SYSTEM_EXTENSIONS # Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.14 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.14) XORG_DEFAULT_OPTIONS XORG_WITH_DOXYGEN(1.6.1) XORG_CHECK_SGML_DOCTOOLS(1.8) XORG_ENABLE_DOCS XORG_ENABLE_DEVEL_DOCS XORG_WITH_XMLTO(0.0.20) XORG_WITH_FOP XORG_WITH_XSLTPROC XORG_ENABLE_UNIT_TESTS XORG_LD_WRAP([optional]) m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install font-util 1.1 or later before running autoconf/autogen])]) XORG_FONT_MACROS_VERSION(1.1) dnl this gets generated by autoheader, and thus contains all the defines. we dnl don't ever actually use it, internally. AC_CONFIG_HEADERS(include/do-not-use-config.h) dnl xorg-server.h is an external header, designed to be included by loadable dnl drivers. AC_CONFIG_HEADERS(include/xorg-server.h) dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just dnl dix/). AC_CONFIG_HEADERS(include/dix-config.h) dnl xorg-config.h covers the Xorg DDX. AC_CONFIG_HEADERS(include/xorg-config.h) dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs. AC_CONFIG_HEADERS(include/xkb-config.h) dnl xwin-config.h covers the XWin DDX. AC_CONFIG_HEADERS(include/xwin-config.h) dnl kdrive-config.h covers the kdrive DDX AC_CONFIG_HEADERS(include/kdrive-config.h) dnl version-config.h covers the version numbers so they can be bumped without dnl forcing an entire recompile.x AC_CONFIG_HEADERS(include/version-config.h) AM_PROG_AS AC_PROG_LN_S LT_PREREQ([2.2]) LT_INIT([disable-static win32-dll]) PKG_PROG_PKG_CONFIG AC_PROG_LEX AC_PROG_YACC AC_SYS_LARGEFILE XORG_PROG_RAWCPP # Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow # easier overrides at build time. XSERVER_CFLAGS='$(CWARNFLAGS)' dnl Explicitly add -fno-strict-aliasing since this option should disappear dnl from util-macros CWARNFLAGS if test "x$GCC" = xyes ; then XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing" fi dnl Check for dtrace program (needed to build Xserver dtrace probes) dnl Also checks for , since some Linux distros have an dnl ISDN trace program named dtrace AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH], [Enable dtrace probes (default: enabled if dtrace found)]), [WDTRACE=$withval], [WDTRACE=auto]) if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin]) if test "x$DTRACE" = "xnot_found" ; then if test "x$WDTRACE" = "xyes" ; then AC_MSG_FAILURE([dtrace requested but not found]) fi WDTRACE="no" else AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"]) if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then WDTRACE="no" fi fi fi if test "x$WDTRACE" != "xno" ; then AC_DEFINE(XSERVER_DTRACE, 1, [Define to 1 if the DTrace Xserver provider probes should be built in.]) # Solaris/OpenSolaris require dtrace -G to build dtrace probe information into # object files, and require linking with those as relocatable objects, not .a # archives. MacOS X handles all this in the normal compiler toolchain, and on # some releases (like Tiger), will error out on dtrace -G. For now, other # platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux # ports appear to, based on my web searches, but have not yet been tested). case $host_os in darwin*) SPECIAL_DTRACE_OBJECTS=no ;; *) SPECIAL_DTRACE_OBJECTS=yes ;; esac fi AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"]) AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"]) AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \ fnmatch.h sys/mkdev.h sys/utsname.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_TYPEOF AC_C_BIGENDIAN(AC_DEFINE(X_BYTE_ORDER, X_BIG_ENDIAN, [byte order]), AC_DEFINE(X_BYTE_ORDER, X_LITTLE_ENDIAN, [byte order])) AC_CHECK_SIZEOF([unsigned long]) if test "$ac_cv_sizeof_unsigned_long" = 8; then AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.]) fi AC_TYPE_PID_T # Checks for headers/macros for byte swapping # Known variants: # bswap_16, bswap_32, bswap_64 (glibc) # __swap16, __swap32, __swap64 (OpenBSD) # bswap16, bswap32, bswap64 (other BSD's) # and a fallback to local macros if none of the above are found # if is found, assume it's the correct version AC_CHECK_HEADERS([byteswap.h]) # if is found, have to check which version AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"]) if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then AC_MSG_CHECKING([for __swap16 variant of byteswapping macros]) AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include #include ], [ int a = 1, b; b = __swap16(a); ]) ], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no']) AC_MSG_RESULT([$SYS_ENDIAN__SWAP]) AC_MSG_CHECKING([for bswap16 variant of byteswapping macros]) AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include #include ], [ int a = 1, b; b = bswap16(a); ]) ], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no']) AC_MSG_RESULT([$SYS_ENDIAN_BSWAP]) if test "$SYS_ENDIAN_BSWAP" = "yes" ; then USE_SYS_ENDIAN_H=yes BSWAP=bswap else if test "$SYS_ENDIAN__SWAP" = "yes" ; then USE_SYS_ENDIAN_H=yes BSWAP=__swap else USE_SYS_ENDIAN_H=no fi fi if test "$USE_SYS_ENDIAN_H" = "yes" ; then AC_DEFINE([USE_SYS_ENDIAN_H], 1, [Define to use byteswap macros from ]) AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, [Define to 16-bit byteswap macro]) AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, [Define to 32-bit byteswap macro]) AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, [Define to 64-bit byteswap macro]) fi fi dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext]) AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup]) AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include ]]) dnl Find the math libary, then check for cbrt function in it. AC_CHECK_LIB(m, sqrt) AC_CHECK_FUNCS([cbrt]) AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h]) dnl AGPGART headers AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes) AM_CONDITIONAL(AGP, [test "x$AGP" = xyes]) dnl fbdev header AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes) AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes]) dnl FreeBSD kldload support (sys/linker.h) AC_CHECK_HEADERS([sys/linker.h], [ac_cv_sys_linker_h=yes], [ac_cv_sys_linker_h=no], [#include ]) AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes]) AC_CACHE_CHECK([for SYSV IPC], ac_cv_sysv_ipc, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include ]],[[ { int id; id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR); if (id < 0) return -1; return shmctl(id, IPC_RMID, 0); }]])], [ac_cv_sysv_ipc=yes], [ac_cv_sysv_ipc=no])]) if test "x$ac_cv_sysv_ipc" = xyes; then AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available]) fi dnl OpenBSD /dev/xf86 aperture driver if test -c /dev/xf86 ; then AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver]) fi dnl BSD APM support AC_CHECK_HEADER([machine/apmvar.h],[ AC_CHECK_HEADER([sys/event.h], ac_cv_BSD_KQUEUE_APM=yes, ac_cv_BSD_APM=yes)]) AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes]) AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes]) dnl glibc backtrace support check AC_CHECK_HEADER([execinfo.h],[ AC_CHECK_LIB(c, backtrace, [ AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support]) AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h]) ])] ) dnl --------------------------------------------------------------------------- dnl Bus options and CPU capabilities. Replaces logic in dnl hw/xfree86/os-support/bus/Makefile.am, among others. dnl --------------------------------------------------------------------------- DEFAULT_INT10="x86emu" dnl Override defaults as needed for specific platforms: case $host_cpu in alpha*) ALPHA_VIDEO=yes case $host_os in *freebsd*) SYS_LIBS=-lio ;; *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;; esac GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee" ;; arm*) ARM_VIDEO=yes DEFAULT_INT10="stub" ;; i*86) I386_VIDEO=yes case $host_os in *freebsd*) AC_DEFINE(USE_DEV_IO) ;; *dragonfly*) AC_DEFINE(USE_DEV_IO) ;; *netbsd*) AC_DEFINE(USE_I386_IOPL) SYS_LIBS=-li386 ;; *openbsd*) AC_DEFINE(USE_I386_IOPL) SYS_LIBS=-li386 ;; esac ;; powerpc*) PPC_VIDEO=yes case $host_os in *freebsd*) DEFAULT_INT10=stub ;; esac ;; sparc*) SPARC64_VIDEO=yes BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c" GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; x86_64*|amd64*) I386_VIDEO=yes case $host_os in *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; *dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) SYS_LIBS=-lx86_64 ;; *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl]) SYS_LIBS=-lamd64 ;; esac GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; ia64*) GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; s390*) GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; esac AC_SUBST(GLX_ARCH_DEFINES) dnl BSD *_video.c selection AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes]) AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes]) AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes]) AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes]) AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes]) DRI=no USE_SIGIO_BY_DEFAULT="yes" dnl it would be nice to autodetect these *CONS_SUPPORTs case $host_os in *freebsd* | *dragonfly*) case $host_os in kfreebsd*-gnu) ;; *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;; esac AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console]) DRI=yes ;; *netbsd*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) DRI=yes ;; *openbsd*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console]) AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) ;; *linux*) DRI=yes ;; *solaris*) PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no) # Disable use of SIGIO by default until some system bugs are # fixed - see Sun/OpenSolaris bug id 6879897 USE_SIGIO_BY_DEFAULT="no" ;; darwin*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;; cygwin*|mingw*) CFLAGS="$CFLAGS -DFD_SETSIZE=256" ;; esac dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the dnl major number PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1` PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1` if test "x$PVS" = "x"; then PVS="0" fi VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)" VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" VENDOR_NAME="The X.Org Foundation" VENDOR_NAME_SHORT="X.Org" VENDOR_WEB="http://wiki.x.org" dnl Build options. AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], [Obsolete - use --enable-strict-compilation instead]), AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation])) AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debugging (default: disabled)]), [DEBUGGING=$enableval], [DEBUGGING=no]) AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default] [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]), [USE_SIGIO_BY_DEFAULT=$enableval], []) AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]), [INT10="$withval"], [INT10="$DEFAULT_INT10"]) AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR], [Vendor string reported by the server]), [ VENDOR_NAME="$withval" ], []) AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR], [Short version of vendor string reported by the server]), [ VENDOR_NAME_SHORT="$withval" ], []) AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL], [Vendor web address reported by the server]), [ VENDOR_WEB="$withval" ], []) AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR], [Directory where modules are installed (default: $libdir/xorg/modules)]), [ moduledir="$withval" ], [ moduledir="${libdir}/xorg/modules" ]) AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR], [Directory where log files are kept (default: $localstatedir/log)]), [ logdir="$withval" ], [ logdir="$localstatedir/log" ]) AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS], [Builder address (default: xorg@lists.freedesktop.org)]), [ BUILDERADDR="$withval" ], [ BUILDERADDR="xorg@lists.freedesktop.org" ]) AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]), [ OSNAME="$withval" ], [ OSNAME=`uname -srm` ]) AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]), [ OSVENDOR="$withval" ], [ OSVENDOR="" ]) AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]), [ BUILDERSTRING="$withval" ] [ ]) AC_ARG_ENABLE(listen-tcp, AS_HELP_STRING([--enable-listen-tcp], [Listen on TCP by default (default:disabled)]), [LISTEN_TCP=$enableval], [LISTEN_TCP=no]) AC_ARG_ENABLE(listen-unix, AS_HELP_STRING([--disable-listen-unix], [Listen on Unix by default (default:enabled)]), [LISTEN_UNIX=$enableval], [LISTEN_UNIX=yes]) AC_ARG_ENABLE(listen-local, AS_HELP_STRING([--disable-listen-local], [Listen on local by default (default:enabled)]), [LISTEN_LOCAL=$enableval], [LISTEN_LOCAL=yes]) dnl Determine font path XORG_FONTROOTDIR XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF) XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF) XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1) XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi) XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi) dnl Uses --with-default-font-path if set, otherwise uses standard dnl subdirectories of FONTROOTDIR. Some distros set the default font path to dnl "catalogue:/etc/X11/fontpath.d,built-ins" DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/" case $host_os in darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;; esac AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]), [ FONTPATH="$withval" ], [ FONTPATH="${DEFAULT_FONT_PATH}" ]) AC_MSG_CHECKING([for default font path]) AC_MSG_RESULT([$FONTPATH]) AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]), [ XKBPATH="$withval" ], [ XKBPATH="${datadir}/X11/xkb" ]) AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), [ XKBOUTPUT="$withval" ], [ XKBOUTPUT="compiled" ]) AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES], [Keyboard ruleset (default: base/evdev)]), [ XKB_DFLT_RULES="$withval" ], [ XKB_DFLT_RULES="" ]) AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL], [Keyboard model (default: pc105)]), [ XKB_DFLT_MODEL="$withval" ], [ XKB_DFLT_MODEL="pc105" ]) AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT], [Keyboard layout (default: us)]), [ XKB_DFLT_LAYOUT="$withval" ], [ XKB_DFLT_LAYOUT="us" ]) AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT], [Keyboard variant (default: (none))]), [ XKB_DFLT_VARIANT="$withval" ], [ XKB_DFLT_VARIANT="" ]) AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS], [Keyboard layout options (default: (none))]), [ XKB_DFLT_OPTIONS="$withval" ], [ XKB_DFLT_OPTIONS="" ]) AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]), [ SERVERCONFIG="$withval" ], [ SERVERCONFIG="${libdir}/xorg" ]) AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]), [ APPLE_APPLICATIONS_DIR="${withval}" ], [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ]) AC_SUBST([APPLE_APPLICATIONS_DIR]) AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]), [ APPLE_APPLICATION_NAME="${withval}" ], [ APPLE_APPLICATION_NAME="X11" ]) AC_SUBST([APPLE_APPLICATION_NAME]) AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]), [ BUNDLE_ID_PREFIX="${withval}" ], [ BUNDLE_ID_PREFIX="org.x" ]) AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]), [ BUNDLE_ID_PREFIX="${withval}" ]) AC_SUBST([BUNDLE_ID_PREFIX]) AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle identifiers]) AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]), [ XQUARTZ_SPARKLE="${enableval}" ], [ XQUARTZ_SPARKLE="no" ]) AC_SUBST([XQUARTZ_SPARKLE]) AC_ARG_ENABLE(install-libxf86config, AS_HELP_STRING([--enable-install-libxf86config], [Install libxf86config (default: disabled)]), [INSTALL_LIBXF86CONFIG=$enableval], [INSTALL_LIBXF86CONFIG=no]) AC_ARG_ENABLE(visibility, AS_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]), [SYMBOL_VISIBILITY=$enableval], [SYMBOL_VISIBILITY=auto]) dnl GLX build options AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]), [AIGLX=$enableval], [AIGLX=yes]) XORG_TLS AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]), [GLX_USE_TLS=$enableval if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.]) fi], [GLX_USE_TLS=no if test "${ac_cv_tls}" != "none" ; then GLX_USE_TLS=yes fi]) AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]), [KHRONOS_SPEC_DIR="${withval}"], [KHRONOS_SPEC_DIR=auto]) dnl Extensions. 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: 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]) AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes]) AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto]) AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes]) AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto]) AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto]) AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes]) AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval]) AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto]) AC_ARG_ENABLE(dri3, AS_HELP_STRING([--enable-dri3], [Build DRI3 extension (default: auto)]), [DRI3=$enableval], [DRI3=auto]) AC_ARG_ENABLE(present, AS_HELP_STRING([--disable-present], [Build Present extension (default: enabled)]), [PRESENT=$enableval], [PRESENT=yes]) AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes]) AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto]) AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes]) AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no]) AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no]) AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no]) AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes]) 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-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(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]) AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no]) AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes]) AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes]) AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes]) AC_ARG_ENABLE(linux_acpi, AS_HELP_STRING([--disable-linux-acpi], [Disable building ACPI support on Linux (if available).]), [enable_linux_acpi=$enableval], [enable_linux_acpi=yes]) AC_ARG_ENABLE(linux_apm, AS_HELP_STRING([--disable-linux-apm], [Disable building APM support on Linux (if available).]), [enable_linux_apm=$enableval], [enable_linux_apm=yes]) AC_ARG_ENABLE(systemd-logind, AS_HELP_STRING([--enable-systemd-logind], [Build systemd-logind support (default: auto)]), [SYSTEMD_LOGIND=$enableval], [SYSTEMD_LOGIND=auto]) AC_ARG_ENABLE(suid-wrapper, AS_HELP_STRING([--enable-suid-wrapper], [Build suid-root wrapper for legacy driver support on rootless xserver systems (default: no)]), [SUID_WRAPPER=$enableval], [SUID_WRAPPER=no]) dnl DDXes. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no]) AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto]) AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: no)]), [GLAMOR=$enableval], [GLAMOR=no]) dnl kdrive and its subsystems AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) dnl kdrive options AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto]) AC_ARG_ENABLE(kdrive-mouse, AS_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto]) AC_ARG_ENABLE(kdrive-evdev, AS_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto]) AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--enable-libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"]) AC_ARG_ENABLE(xshmfence, AS_HELP_STRING([--disable-xshmfence], [Disable xshmfence (default: auto)]), [XSHMFENCE="$enableval"], [XSHMFENCE="auto"]) dnl chown/chmod to be setuid root as part of build dnl Replaces InstallXserverSetUID in imake AC_ARG_ENABLE(install-setuid, AS_HELP_STRING([--enable-install-setuid], [Install Xorg server as owned by root with setuid bit (default: auto)]), [SETUID=$enableval], [SETUID=auto]) 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 sparc) SETUID="no" ;; *) SETUID="yes" ;; esac esac if test "x$SETUID" = xyes; then touch testfile chown root testfile > /dev/null 2>&1 || SETUID="no" rm -f testfile fi fi AC_MSG_RESULT([$SETUID]) AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"]) dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro dnl was not expanded, since xorg-server with no transport types is rather useless. dnl dnl If you're seeing an error here, be sure you installed the lib/xtrans module dnl first and if it's not in the default location, that you set the ACLOCAL dnl environment variable to find it, such as: dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal" m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$]) # Transport selection macro from xtrans.m4 XTRANS_CONNECTION_FLAGS # Secure RPC detection macro from xtrans.m4 XTRANS_SECURE_RPC_FLAGS AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes]) AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86]) AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu]) AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub]) dnl Handle installing libxf86config 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* | mingw*) CONFIG_HAL=no CONFIG_UDEV=no CONFIG_UDEV_KMS=no DGA=no DRM=no DRI2=no DRI3=no INT10MODULE=no PCI=no VGAHW=no VBE=no XF86UTILS=no XF86VIDMODE=no XSELINUX=no XV=no SYMBOL_VISIBILITY=no ;; darwin*) PCI=no INT10MODULE=no VGAHW=no VBE=no DRM=no DRI2=no DRI3=no if test x$XQUARTZ = xauto; then AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[ save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -framework Carbon" AC_LINK_IFELSE([AC_LANG_SOURCE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}])], [xorg_cv_Carbon_framework=yes], [xorg_cv_Carbon_framework=no]) LDFLAGS=$save_LDFLAGS]) if test "X$xorg_cv_Carbon_framework" = Xyes; then XQUARTZ=yes else XQUARTZ=no fi fi AC_CHECK_FUNC(dispatch_async, AC_DEFINE([HAVE_LIBDISPATCH], 1, [Define to 1 if you have the libdispatch (GCD) available]), []) if test "x$XQUARTZ" = xyes ; then XQUARTZ=yes XVFB=no XNEST=no XWAYLAND=no COMPOSITE=no DGA=no DPMSExtension=no XF86VIDMODE=no fi ;; *) XQUARTZ=no ;; esac dnl --------------------------------------------------------------------------- dnl Extension section dnl --------------------------------------------------------------------------- XEXT_INC='-I$(top_srcdir)/Xext' XEXT_LIB='$(top_builddir)/Xext/libXext.la' dnl Optional modules VIDEOPROTO="videoproto" COMPOSITEPROTO="compositeproto >= 0.4" RECORDPROTO="recordproto >= 1.13.99.1" SCRNSAVERPROTO="scrnsaverproto >= 1.1" RESOURCEPROTO="resourceproto >= 1.2.0" DRIPROTO="xf86driproto >= 2.1.0" DRI2PROTO="dri2proto >= 2.8" DRI3PROTO="dri3proto >= 1.0" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" GLPROTO="glproto >= 1.4.17" DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" LIBXSHMFENCE="xshmfence >= 1.1" dnl Required modules XPROTO="xproto >= 7.0.26" RANDRPROTO="randrproto >= 1.4.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" INPUTPROTO="inputproto >= 2.3" KBPROTO="kbproto >= 1.0.3" FONTSPROTO="fontsproto >= 2.1.3" FIXESPROTO="fixesproto >= 5.0" DAMAGEPROTO="damageproto >= 1.1" XCMISCPROTO="xcmiscproto >= 1.2.0" BIGREQSPROTO="bigreqsproto >= 1.1.0" XTRANS="xtrans >= 1.3.5" PRESENTPROTO="presentproto >= 1.0" dnl List of libraries that require a specific version LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" LIBDRM="libdrm >= 2.3.0" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" LIBXEXT="xext >= 1.0.99.4" LIBXFONT="xfont >= 1.4.2" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.12.901" LIBUDEV="libudev >= 143" LIBSELINUX="libselinux >= 2.0.86" LIBDBUS="dbus-1 >= 1.0" 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 PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN) REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau" dnl Core modules for most extensions, et al. SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $KBPROTO $FONTSPROTO $LIBPIXMAN" # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc AC_SUBST(SDK_REQUIRED_MODULES) REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES" dnl systemd socket activation dnl activate the code in libxtrans that grabs systemd's socket fds AC_ARG_WITH([systemd-daemon], AS_HELP_STRING([--with-systemd-daemon], [support systemd socket activation (default: auto)]), [WITH_SYSTEMD_DAEMON=$withval], [WITH_SYSTEMD_DAEMON=auto]) PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], [HAVE_SYSTEMD_DAEMON=yes], [HAVE_SYSTEMD_DAEMON=no]) if test "x$WITH_SYSTEMD_DAEMON" = xauto; then WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON" fi if test "x$WITH_SYSTEMD_DAEMON" = xyes; then if test "x$HAVE_SYSTEMD_DAEMON" = xno; then AC_MSG_ERROR([systemd support requested but no library has been found]) fi AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if libsystemd-daemon is available]) REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon" fi AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"]) if test "x$CONFIG_UDEV" = xyes && test "x$CONFIG_HAL" = xyes; then AC_MSG_ERROR([Hotplugging through both libudev and hal not allowed]) fi PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no]) if test "x$CONFIG_UDEV" = xauto; then CONFIG_UDEV="$HAVE_LIBUDEV" AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if libudev is available.]) fi AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes]) if test "x$CONFIG_UDEV" = xyes; then 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 LIBS=$UDEV_LIBS AC_CHECK_FUNCS([udev_monitor_filter_add_match_tag]) AC_CHECK_FUNCS([udev_enumerate_add_match_tag]) LIBS=$SAVE_LIBS CFLAGS=$SAVE_CFLAGS fi AM_CONDITIONAL(CONFIG_UDEV_KMS, [test "x$CONFIG_UDEV_KMS" = xyes]) PKG_CHECK_MODULES(DBUS, $LIBDBUS, [HAVE_DBUS=yes], [HAVE_DBUS=no]) if test "x$HAVE_DBUS" = xyes; then AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support]) fi AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes]) PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no]) if test "x$CONFIG_HAL" = xauto; then CONFIG_HAL="$HAVE_HAL" fi if test "x$CONFIG_HAL" = xyes; then if ! test "x$HAVE_HAL" = xyes; then AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.]) fi AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API]) NEED_DBUS="yes" fi AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes]) if test "x$SYSTEMD_LOGIND" = xauto; then if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then SYSTEMD_LOGIND=yes else SYSTEMD_LOGIND=no fi fi if test "x$SYSTEMD_LOGIND" = xyes; then if ! test "x$HAVE_DBUS" = xyes; then AC_MSG_ERROR([systemd-logind requested, but D-Bus is not installed.]) fi if ! test "x$CONFIG_UDEV" = xyes ; then AC_MSG_ERROR([systemd-logind is only supported in combination with udev configuration.]) fi AC_DEFINE(SYSTEMD_LOGIND, 1, [Enable systemd-logind integration]) NEED_DBUS="yes" fi AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes]) if test "x$SUID_WRAPPER" = xyes; then dnl The wrapper uses libdrm headers, so ensure they are available PKG_CHECK_MODULES([LIBDRM], $LIBDRM) dnl This is a define so that if some platforms want to put the wrapper dnl somewhere else this can be easily changed AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap]) SETUID="no" fi AM_CONDITIONAL(SUID_WRAPPER, [test "x$SUID_WRAPPER" = xyes]) if test "x$NEED_DBUS" = xyes; then AC_DEFINE(NEED_DBUS, 1, [Enable D-Bus core]) fi AM_CONDITIONAL(NEED_DBUS, [test "x$NEED_DBUS" = xyes]) if test "x$CONFIG_WSCONS" = xauto; then case $host_os in *openbsd*) CONFIG_WSCONS=yes; ;; *) CONFIG_WSCONS=no; ;; esac fi AM_CONDITIONAL(CONFIG_WSCONS, [test "x$CONFIG_WSCONS" = xyes]) if test "x$CONFIG_WSCONS" = xyes; then AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration]) fi if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then USE_SIGIO_BY_DEFAULT_VALUE=TRUE else USE_SIGIO_BY_DEFAULT_VALUE=FALSE fi AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE], [Use SIGIO handlers for input device events by default]) AC_MSG_CHECKING([for glibc...]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([ #include #ifndef __GLIBC__ #error #endif ])], glibc=yes, glibc=no) AC_MSG_RESULT([$glibc]) AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], [have_clock_gettime=no])]) AC_MSG_CHECKING([for a useful monotonic clock ...]) if ! test "x$have_clock_gettime" = xno; then if ! test "x$have_clock_gettime" = xyes; then CLOCK_LIBS="$have_clock_gettime" else CLOCK_LIBS="" fi LIBS_SAVE="$LIBS" LIBS="$CLOCK_LIBS" CPPFLAGS_SAVE="$CPPFLAGS" if test x"$glibc" = xyes; then CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L" fi AC_RUN_IFELSE([AC_LANG_SOURCE([ #include int main(int argc, char *argv[[]]) { struct timespec tp; if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) return 0; else return 1; } ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], [MONOTONIC_CLOCK="cross compiling"]) LIBS="$LIBS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" else MONOTONIC_CLOCK=no fi AC_MSG_RESULT([$MONOTONIC_CLOCK]) if test "x$MONOTONIC_CLOCK" = xyes; then AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) LIBS="$LIBS $CLOCK_LIBS" fi AM_CONDITIONAL(XV, [test "x$XV" = xyes]) if test "x$XV" = xyes; then AC_DEFINE(XV, 1, [Support Xv extension]) AC_DEFINE(XvExtension, 1, [Build Xv extension]) REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $VIDEOPROTO" else XVMC=no fi AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes]) if test "x$XVMC" = xyes; then AC_DEFINE(XvMCExtension, 1, [Build XvMC extension]) fi AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes]) if test "x$COMPOSITE" = xyes; then AC_DEFINE(COMPOSITE, 1, [Support Composite Extension]) REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO" COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la' 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]) AC_DEFINE(HAS_SHM, 1, [Support SHM]) fi AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes]) if test "x$RECORD" = xyes; then AC_DEFINE(XRECORD, 1, [Support Record extension]) REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO" RECORD_LIB='$(top_builddir)/record/librecord.la' fi AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes]) if test "x$SCREENSAVER" = xyes; then AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension]) REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $SCRNSAVERPROTO" fi AM_CONDITIONAL(RES, [test "x$RES" = xyes]) if test "x$RES" = xyes; then AC_DEFINE(RES, 1, [Support X resource extension]) REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $RESOURCEPROTO" fi if test "x$LISTEN_TCP" = xyes; then AC_DEFINE(LISTEN_TCP, 1, [Listen on TCP socket]) fi if test "x$LISTEN_UNIX" = xyes; then AC_DEFINE(LISTEN_UNIX, 1, [Listen on Unix socket]) fi if test "x$LISTEN_LOCAL" = xyes; then AC_DEFINE(LISTEN_LOCAL, 1, [Listen on local socket]) fi # The XRes extension may support client ID tracking only if it has # been specifically enabled. Client ID tracking is implicitly not # supported if XRes extension is disabled. AC_MSG_CHECKING([whether to track client ids]) if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then AC_DEFINE(CLIENTIDS, 1, [Support client ID tracking]) else CLIENTIDS=no fi if test "x$CLIENTIDS" = xyes; then case $host_os in openbsd*) SYS_LIBS="$SYS_LIBS -lkvm" ;; esac fi AC_MSG_RESULT([$CLIENTIDS]) AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes]) AM_CONDITIONAL(DRI, test "x$DRI" = xyes) if test "x$DRI" = xyes; then AC_DEFINE(XF86DRI, 1, [Build DRI extension]) REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" fi PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO, [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no]) case "$DRI2,$HAVE_DRI2PROTO" in yes,no) AC_MSG_ERROR([DRI2 requested, but dri2proto not found.]) ;; yes,yes | auto,yes) AC_DEFINE(DRI2, 1, [Build DRI2 extension]) DRI2=yes LIBGL="gl >= 9.2.0" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO" ;; esac AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes) dnl dnl Locate a suitable tmp file system for creating shared memeory files dnl AC_ARG_WITH(shared-memory-dir, AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto)]), [], [with_shared_memory_dir=yes]) shmdirs="/run/shm /var/tmp /tmp" case x"$with_shared_memory_dir" in xyes) for dir in $shmdirs; do case x"$with_shared_memory_dir" in xyes) echo Checking temp dir "$dir" if test -d "$dir"; then with_shared_memory_dir="$dir" fi ;; esac done ;; x/*) ;; xno) ;; *) AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir]) ;; esac case x"$with_shared_memory_dir" in xyes) AC_MSG_ERROR([No directory found for shared memory temp files.]) ;; xno) ;; *) AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for shared memory temp files]) ;; esac AC_ARG_ENABLE(xtrans-send-fds, AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing (default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto]) case "x$XTRANS_SEND_FDS" in xauto) case "$host_os" in linux*|solaris*) XTRANS_SEND_FDS=yes ;; *) XTRANS_SEND_FDS=no ;; esac esac case "x$XTRANS_SEND_FDS" in xyes) AC_DEFINE(XTRANS_SEND_FDS, 1, [Enable xtrans fd passing support]) ;; esac case "$DRI3,$XTRANS_SEND_FDS" in yes,yes | auto,yes) ;; yes,no) AC_MSG_ERROR([DRI3 requested, but xtrans fd passing support not found.]) DRI3=no ;; no,*) ;; *) AC_MSG_NOTICE([DRI3 disabled because xtrans fd passing support not found.]) DRI3=no ;; esac PKG_CHECK_MODULES([DRI3PROTO], $DRI3PROTO, [HAVE_DRI3PROTO=yes], [HAVE_DRI3PROTO=no]) case "$DRI3,$HAVE_DRI3PROTO" in yes,yes | auto,yes) ;; yes,no) AC_MSG_ERROR([DRI3 requested, but dri3proto not found.]) DRI3=no ;; no,*) ;; *) AC_MSG_NOTICE([DRI3 disabled because dri3proto not found.]) DRI3=no ;; esac AC_CHECK_FUNCS([sigaction]) BUSFAULT=no case x"$ac_cv_func_sigaction" in xyes) AC_DEFINE(HAVE_SIGACTION, 1, [Have sigaction function]) BUSFAULT=yes ;; esac case x"$BUSFAULT" in xyes) AC_DEFINE(BUSFAULT, 1, [Include busfault OS API]) ;; esac AM_CONDITIONAL(BUSFAULT, test x"$BUSFAULT" = xyes) PKG_CHECK_MODULES([XSHMFENCE], $LIBXSHMFENCE, [HAVE_XSHMFENCE=yes], [HAVE_XSHMFENCE=no]) if test "x$XSHMFENCE" = "xauto"; then XSHMFENCE="$HAVE_XSHMFENCE" fi if test "x$XSHMFENCE" = "xyes"; then if test "x$HAVE_XSHMFENCE" != "xyes"; then AC_MSG_ERROR([xshmfence requested but not installed.]) fi AC_DEFINE(HAVE_XSHMFENCE, 1, [Have xshmfence support]) REQUIRED_LIBS="$REQUIRED_LIBS $LIBXSHMFENCE" fi AM_CONDITIONAL(XSHMFENCE, [test "x$XSHMFENCE" = xyes]) case "$DRI3,$XSHMFENCE" in yes,yes | auto,yes) ;; yes,no) AC_MSG_ERROR([DRI3 requested, but xshmfence not found.]) DRI3=no ;; no,*) ;; *) AC_MSG_NOTICE([DRI3 disabled because xshmfence not found.]) DRI3=no ;; esac case x"$DRI3" in xyes|xauto) DRI3=yes AC_DEFINE(DRI3, 1, [Build DRI3 extension]) DRI3_LIB='$(top_builddir)/dri3/libdri3.la' SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI3PROTO" AC_MSG_NOTICE([DRI3 enabled]); ;; esac AM_CONDITIONAL(DRI3, test "x$DRI3" = xyes) if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = 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) fi fi if test "x$DRI2" = xyes; then save_CFLAGS=$CFLAGS CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include #include #ifndef __DRI_DRI2 #error DRI2 extension not available. #endif]])], [HAVE_DRI2EXTENSION=yes], [HAVE_DRI2EXTENSION=no]) CFLAGS=$save_CFLAGS if test "x$HAVE_DRI2EXTENSION" = xyes; then AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader]) DRI2_AIGLX=yes else AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.]) DRI2_AIGLX=no fi fi AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes) if test "x$GLX" = xyes; then PKG_CHECK_MODULES([XLIB], [x11]) PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) AC_SUBST(XLIB_CFLAGS) AC_DEFINE(GLXEXT, 1, [Build GLX extension]) GLX_LIBS='$(top_builddir)/glx/libglx.la' GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS" else GLX=no fi AM_CONDITIONAL(GLX, test "x$GLX" = xyes) if test "x$GLX" = xno; then AIGLX=no fi if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then AC_DEFINE(AIGLX, 1, [Build AIGLX loader]) fi AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes) if test "x$GLX_USE_TLS" = xyes ; then GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" fi AC_SUBST([GLX_DEFINES]) AC_SUBST([GLX_SYS_LIBS]) AM_CONDITIONAL(PRESENT, [test "x$PRESENT" = xyes]) if test "x$PRESENT" = xyes; then AC_DEFINE(PRESENT, 1, [Support Present extension]) REQUIRED_MODULES="$REQUIRED_MODULES $PRESENTPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $PRESENTPROTO" PRESENT_INC='-I$(top_srcdir)/present' PRESENT_LIB='$(top_builddir)/present/libpresent.la' fi AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes]) if test "x$XINERAMA" = xyes; then AC_DEFINE(XINERAMA, 1, [Support Xinerama extension]) AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama]) REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO" fi AM_CONDITIONAL(XACE, [test "x$XACE" = xyes]) if test "x$XACE" = xyes; then AC_DEFINE(XACE, 1, [Build X-ACE extension]) fi AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes]) if test "x$XSELINUX" = xyes; then if test "x$XACE" != xyes; then AC_MSG_ERROR([cannot build SELinux extension without X-ACE]) fi AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers])) AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library])) PKG_CHECK_MODULES([SELINUX], $LIBSELINUX) SELINUX_LIBS="$SELINUX_LIBS -laudit" AC_DEFINE(XSELINUX, 1, [Build SELinux extension]) fi AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes]) if test "x$XCSECURITY" = xyes; then if test "x$XACE" != xyes; then AC_MSG_ERROR([cannot build Security extension without X-ACE]) fi AC_DEFINE(XCSECURITY, 1, [Build Security extension]) fi 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]) if test "x$XF86BIGFONT" = xyes; then AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension]) REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $BIGFONTPROTO" fi AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes]) if test "x$DPMSExtension" = xyes; then AC_DEFINE(DPMSExtension, 1, [Support DPMS extension]) fi AC_DEFINE(RENDER, 1, [Support RENDER extension]) RENDER_LIB='$(top_builddir)/render/librender.la' RENDER_INC='-I$(top_srcdir)/render' AC_DEFINE(RANDR, 1, [Support RANDR extension]) RANDR_LIB='$(top_builddir)/randr/librandr.la' RANDR_INC='-I$(top_srcdir)/randr' AC_DEFINE(XFIXES,1,[Support XFixes extension]) FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la' FIXES_INC='-I$(top_srcdir)/xfixes' AC_DEFINE(DAMAGE,1,[Support Damage extension]) DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la' DAMAGE_INC='-I$(top_srcdir)/damageext' MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la' MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage' # XINPUT extension is integral part of the server AC_DEFINE(XINPUT, 1, [Support X Input extension]) XI_LIB='$(top_builddir)/Xi/libXi.la' XI_INC='-I$(top_srcdir)/Xi' AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes) AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes) AM_CONDITIONAL(VBE, test "x$VBE" = xyes) AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes) AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) AC_ARG_WITH(xkb-bin-directory, AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program (default: ${bindir})]), [XKB_BIN_DIRECTORY="$withval"], [XKB_BIN_DIRECTORY="$bindir"]) AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir]) dnl Make sure XKM_OUTPUT_DIR is an absolute path XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" fi dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused XKBOUTPUT=`echo $XKBOUTPUT/ | $SED 's|/*$|/|'` XKB_COMPILED_DIR=`echo $XKBOUTPUT | $SED 's|/*$||'` AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir]) AC_SUBST(XKB_COMPILED_DIR) if test "x$XKB_DFLT_RULES" = x; then case $host_os in linux*) dnl doesn't take AutoAddDevices into account, but whatever. XKB_DFLT_RULES="evdev" ;; *) XKB_DFLT_RULES="base" ;; esac fi AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset]) AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model]) AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout]) AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant]) AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options]) AC_SUBST([XKB_DFLT_RULES]) AC_SUBST([XKB_DFLT_MODEL]) AC_SUBST([XKB_DFLT_LAYOUT]) AC_SUBST([XKB_DFLT_VARIANT]) AC_SUBST([XKB_DFLT_OPTIONS]) XKB_LIB='$(top_builddir)/xkb/libxkb.la' XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' REQUIRED_MODULES="$REQUIRED_MODULES xkbfile" PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"]) if test "x$have_libxdmcp" = xyes; then AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS]) fi if test "x$XDMCP" = xauto; then if test "x$have_libxdmcp" = xyes; then XDMCP=yes else XDMCP=no fi fi if test "x$XDMAUTH" = xauto; then if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then XDMAUTH=yes else XDMAUTH=no fi fi AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes]) if test "x$XDMCP" = xyes; then AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol]) REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" XDMCP_MODULES="xdmcp" fi AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes]) if test "x$XDMAUTH" = xyes; then AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1]) if ! test "x$XDMCP" = xyes; then REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" XDMCP_MODULES="xdmcp" fi fi AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path]) AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path]) dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path]) AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name]) AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name]) AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release]) AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) if test -z "$OSNAME"; then OSNAME="UNKNOWN" fi AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name]) AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor]) AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string]) AC_SUBST([VENDOR_NAME_SHORT]) AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name]) AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name]) AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release]) AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper]) if test "x$DEBUGGING" = xyes; then AC_DEFINE(DEBUG, 1, [Enable debugging code]) fi AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) AC_DEFINE(XTEST, 1, [Support XTest extension]) AC_DEFINE(XSYNC, 1, [Support XSync extension]) AC_DEFINE(XCMISC, 1, [Support XCMisc extension]) AC_DEFINE(BIGREQS, 1, [Support BigRequests extension]) if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then DIX_LIB='$(top_builddir)/dix/dix.O' OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)' else DIX_LIB='$(top_builddir)/dix/libdix.la' OS_LIB='$(top_builddir)/os/libos.la' fi AC_SUBST([DIX_LIB]) AC_SUBST([OS_LIB]) MAIN_LIB='$(top_builddir)/dix/libmain.la' AC_SUBST([MAIN_LIB]) MI_LIB='$(top_builddir)/mi/libmi.la' MI_EXT_LIB='$(top_builddir)/mi/libmiext.la' MI_INC='-I$(top_srcdir)/mi' FB_LIB='$(top_builddir)/fb/libfb.la' FB_INC='-I$(top_srcdir)/fb' MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow' MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la' MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync' MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la' CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' # SHA1 hashing AC_ARG_WITH([sha1], [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 with_sha1=libc fi if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then AC_MSG_ERROR([libc requested but not found]) fi if test "x$with_sha1" = xlibc; then AC_DEFINE([HAVE_SHA1_IN_LIBC], [1], [Use libc SHA1 functions]) SHA1_LIBS="" fi AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes]) if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then with_sha1=CommonCrypto fi if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then AC_MSG_ERROR([CommonCrypto requested but not found]) fi if test "x$with_sha1" = xCommonCrypto; then AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1], [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 fi if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then AC_MSG_ERROR([libmd requested but not found]) fi if test "x$with_sha1" = xlibmd; then AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1], [Use libmd SHA1 functions]) SHA1_LIBS=-lmd fi PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no]) if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then with_sha1=libsha1 fi if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then AC_MSG_ERROR([libsha1 requested but not found]) fi if test "x$with_sha1" = xlibsha1; then AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1], [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 fi if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then AC_MSG_ERROR([libgcrypt requested but not found]) fi if test "x$with_sha1" = xlibgcrypt; then AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1], [Use libgcrypt SHA1 functions]) SHA1_LIBS=-lgcrypt fi # We don't need all of the OpenSSL libraries, just libcrypto AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes]) PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes], [HAVE_OPENSSL_PKC=no]) if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then if test "x$with_sha1" = x; then with_sha1=libcrypto fi else if test "x$with_sha1" = xlibcrypto; then AC_MSG_ERROR([OpenSSL libcrypto requested but not found]) fi fi if test "x$with_sha1" = xlibcrypto; then if test "x$HAVE_LIBCRYPTO" = xyes; then SHA1_LIBS=-lcrypto else SHA1_LIBS="$OPENSSL_LIBS" SHA1_CFLAGS="$OPENSSL_CFLAGS" fi fi AC_MSG_CHECKING([for SHA1 implementation]) if test "x$with_sha1" = x; then AC_MSG_ERROR([No suitable SHA1 implementation found]) fi AC_MSG_RESULT([$with_sha1]) AC_SUBST(SHA1_LIBS) AC_SUBST(SHA1_CFLAGS) PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no]) if test "x$LIBUNWIND" = "xauto"; then LIBUNWIND="$HAVE_LIBUNWIND" fi if test "x$LIBUNWIND" = "xyes"; then if test "x$HAVE_LIBUNWIND" != "xyes"; then AC_MSG_ERROR([libunwind requested but not installed.]) fi AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support]) fi AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$LIBUNWIND" = xyes]) # Autotools has some unfortunate issues with library handling. In order to # get a server to rebuild when a dependency in the tree is changed, it must # be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be # listed there, or some versions of autotools will break (especially if a -L # is required to find the library). So, we keep two sets of libraries # detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which # will go into the _DEPENDENCIES and _LDADD of the server, and # NAMESPACE_SYS_LIBS which will go into only the _LDADD. The # NAMESPACEMODULES_LIBS detected from pkgconfig should always go in # NAMESPACE_SYS_LIBS. # # XSERVER_LIBS is the set of in-tree libraries which all servers require. # XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers # require. # XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}" XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB" XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" AC_SUBST([XSERVER_LIBS]) AC_SUBST([XSERVER_SYS_LIBS]) UTILS_SYS_LIBS="${SYS_LIBS}" AC_SUBST([UTILS_SYS_LIBS]) # The Xorg binary needs to export symbols so that they can be used from modules # Some platforms require extra flags to do this. libtool should set the # necessary flags for each platform when -export-dynamic is passed to it. LD_EXPORT_SYMBOLS_FLAG="-export-dynamic" LD_NO_UNDEFINED_FLAG= XORG_DRIVER_LIBS= case "$host_os" in cygwin*) LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a" LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a" XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined" CYGWIN=yes ;; solaris*) # We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT # that we can link against for testing if the system linker is new # enough to support -z parent= 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 AC_MSG_CHECKING([if SVR4 needs to be defined]) AC_EGREP_CPP([I_AM_SVR4],[ #if defined(SVR4) || defined(__svr4__) || defined(__SVR4) I_AM_SVR4 #endif ],[ 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 $DBE_INC $PRESENT_INC" dnl --------------------------------------------------------------------------- dnl DDX section. dnl --------------------------------------------------------------------------- dnl Xvfb DDX AC_MSG_CHECKING([whether to build Xvfb DDX]) AC_MSG_RESULT([$XVFB]) AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) if test "x$XVFB" = xyes; then XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XVFB_LIBS]) AC_SUBST([XVFB_SYS_LIBS]) fi dnl Xnest DDX PKG_CHECK_MODULES(XNESTMODULES, [$LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no]) AC_MSG_CHECKING([whether to build Xnest DDX]) if test "x$XNEST" = xauto; then XNEST="$have_xnest" fi AC_MSG_RESULT([$XNEST]) AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) if test "x$XNEST" = xyes; then if test "x$have_xnest" = xno; then AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) fi XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XNEST_LIBS]) AC_SUBST([XNEST_SYS_LIBS]) fi dnl Xorg DDX AC_MSG_CHECKING([whether to build Xorg DDX]) if test "x$XORG" = xauto; then XORG="yes" case $host_os in cygwin*) XORG="no" ;; mingw*) XORG="no" ;; darwin*) XORG="no" ;; esac fi AC_MSG_RESULT([$XORG]) if test "x$XORG" = xyes; then XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' 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 $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB" dnl ================================================================== dnl symbol visibility symbol_visibility= have_visibility=disabled if test x$SYMBOL_VISIBILITY != xno; then AC_MSG_CHECKING(for symbol visibility support) if test x$GCC = xyes; then VISIBILITY_CFLAGS="-fvisibility=hidden" else if test x$SUNCC = xyes; then VISIBILITY_CFLAGS="-xldscope=hidden" else have_visibility=no fi fi if test x$have_visibility != xno; then save_CFLAGS="$CFLAGS" proto_inc=`$PKG_CONFIG --cflags xproto` CFLAGS="$CFLAGS $VISIBILITY_CFLAGS $proto_inc" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ [#include extern _X_HIDDEN int hidden_int; extern _X_EXPORT int public_int; extern _X_HIDDEN int hidden_int_func(void); extern _X_EXPORT int public_int_func(void);]], [])], have_visibility=yes, have_visibility=no) CFLAGS=$save_CFLAGS fi AC_MSG_RESULT([$have_visibility]) if test x$have_visibility != xno; then symbol_visibility=$VISIBILITY_CFLAGS XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS" XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS" fi fi dnl added to xorg-server.pc AC_SUBST([symbol_visibility]) dnl =================================================================== dnl =================================================================== dnl ================= beginning of PCI configuration ================== dnl =================================================================== xorg_bus_bsdpci=no xorg_bus_sparc=no AC_MSG_CHECKING([whether to build Xorg PCI functions]) if test "x$PCI" = xyes; then PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS) SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS" XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_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]) case $host_os in gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*) xorg_bus_bsdpci="yes" ;; esac case $host_cpu in sparc*) xorg_bus_sparc="yes" ;; esac else if test "x$CONFIG_UDEV_KMS" = xyes; then AC_MSG_ERROR([Platform device enumeration requires libpciaccess]) fi if test "x$INT10MODULE" = xyes && test "x$INT10" != xstub; then AC_MSG_ERROR([Cannot build int10 without libpciaccess]) fi 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 =================================================================== case $host_os in linux*) XORG_OS_SUBDIR="linux" linux_acpi="no" case $host_cpu in alpha*) linux_alpha=yes ;; i*86|amd64*|x86_64*|ia64*) linux_acpi=$enable_linux_acpi ;; *) ;; esac dnl APM header AC_CHECK_HEADERS([linux/apm_bios.h], [linux_apm=$enable_linux_apm]) if test "x$linux_apm" = xyes -o "x$linux_acpi" = xyes; then AC_DEFINE(XF86PM, 1, [Support APM/ACPI power management in the server]) fi ;; freebsd* | kfreebsd*-gnu | dragonfly*) XORG_OS_SUBDIR="bsd" ;; netbsd*) XORG_OS_SUBDIR="bsd" ;; openbsd*) if test "x$ac_cv_BSD_APM" = xyes \ -o "x$ac_cv_BSD_KQUEUE_APM" = xyes; then XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" fi XORG_OS_SUBDIR="bsd" ;; solaris*) XORG_OS_SUBDIR="solaris" XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" AC_CHECK_HEADERS([sys/kd.h]) AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no]) # Check for minimum supported release AC_MSG_CHECKING([Solaris version]) OS_MINOR=`echo ${host_os}|$SED -e 's/^.*solaris2\.//' -e s'/\..*$//'` if test "${OS_MINOR}" -ge 7 ; then AC_MSG_RESULT(Solaris ${OS_MINOR}) else AC_MSG_RESULT(Solaris `echo ${host_os}|$SED -e 's/^.*solaris//`) fi if test "${OS_MINOR}" -lt 8 ; then AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.]) fi AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"]) case $host_cpu in sparc*) SOLARIS_INOUT_ARCH="sparcv8plus" ;; i*86) if test x$SOLARIS_64 = xyes ; then SOLARIS_INOUT_ARCH="amd64" else SOLARIS_INOUT_ARCH="ia32" fi ;; *) AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \ are supported on Solaris in this release. If you are \ interested in porting Xorg to your platform, please email \ xorg@lists.freedesktop.org.]) ;; esac AC_SUBST([SOLARIS_INOUT_ARCH]) ;; gnu*) XORG_OS_SUBDIR="hurd" ;; cygwin*) XORG_OS_SUBDIR="stub" ;; *) XORG_OS_SUBDIR="stub" AC_MSG_NOTICE([m4_text_wrap(m4_join([ ], [Your OS is unknown.], [If you are interested in porting Xorg to your platform,], [please email xorg@lists.freedesktop.org.]))]) ;; esac case $host_cpu in i*86) ;; esac if test "x$DGA" = xauto; then PKG_CHECK_MODULES(DGA, $DGAPROTO, [DGA=yes], [DGA=no]) fi if test "x$DGA" = xyes; then XORG_MODULES="$XORG_MODULES $DGAPROTO" PKG_CHECK_MODULES(DGA, $DGAPROTO) AC_DEFINE(DGA, 1, [Support DGA extension]) AC_DEFINE(XFreeXDGA, 1, [Build XDGA support]) fi if test "x$XF86VIDMODE" = xauto; then PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no]) fi if test "x$XF86VIDMODE" = xyes; then XORG_MODULES="$XORG_MODULES $VIDMODEPROTO" PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO) AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension]) fi if test -n "$XORG_MODULES"; then PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES]) XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS" XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" fi if test "x$DRM" = xyes; then dnl 2.4.46 is required for cursor hotspot support. PKG_CHECK_EXISTS(libdrm >= 2.4.46) XORG_DRIVER_MODESETTING=yes fi AC_SUBST([XORG_LIBS]) AC_SUBST([XORG_SYS_LIBS]) AC_SUBST([XORG_INCS]) AC_SUBST([XORG_OS_SUBDIR]) AC_SUBST([XORG_CFLAGS]) dnl these only go in xorg-config.h XF86CONFIGFILE="xorg.conf" XF86CONFIGDIR="xorg.conf.d" AC_SUBST(XF86CONFIGDIR) CONFIGFILE="$sysconfdir/$XF86CONFIGFILE" LOGPREFIX="Xorg." XDG_DATA_HOME=".local/share" XDG_DATA_HOME_LOGDIR="xorg" AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) AC_DEFINE(XFree86Server, 1, [Building 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]) AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file]) AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory]) AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path]) AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path]) AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location]) AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default logfile prefix]) AC_DEFINE_DIR(DEFAULT_XDG_DATA_HOME, XDG_DATA_HOME, [Default XDG_DATA dir under HOME]) AC_DEFINE_DIR(DEFAULT_XDG_DATA_HOME_LOGDIR, XDG_DATA_HOME_LOGDIR, [Default log dir under XDG_DATA_HOME]) AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) if test "x$VGAHW" = xyes; then AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module]) fi driverdir="$moduledir/drivers" AC_SUBST([moduledir]) AC_SUBST([driverdir]) sdkdir="$includedir/xorg" extdir="$includedir/X11/extensions" sysconfigdir="$datadir/X11/$XF86CONFIGDIR" AC_SUBST([sdkdir]) AC_SUBST([extdir]) AC_SUBST([sysconfigdir]) AC_SUBST([logdir]) # stuff the ABI versions into the pc file too extract_abi() { grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }' } abi_ansic=`extract_abi ANSIC` abi_videodrv=`extract_abi VIDEODRV` abi_xinput=`extract_abi XINPUT` abi_extension=`extract_abi EXTENSION` AC_SUBST([abi_ansic]) AC_SUBST([abi_videodrv]) AC_SUBST([abi_xinput]) AC_SUBST([abi_extension]) fi AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes]) AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes]) AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) AM_CONDITIONAL([LNXAPM], [test "x$linux_apm" = 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]) AM_CONDITIONAL([XORG_DRIVER_MODESETTING], [test "x$XORG_DRIVER_MODESETTING" = xyes]) dnl glamor AM_CONDITIONAL([GLAMOR], [test "x$GLAMOR" = xyes]) if test "x$GLAMOR" = xyes; then AC_DEFINE(GLAMOR, 1, [Build glamor]) PKG_CHECK_MODULES([GLAMOR], [epoxy]) PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) if test "x$GBM" = xyes; then AC_DEFINE(GLAMOR_HAS_GBM, 1, [Build glamor with GBM-based EGL support]) fi fi AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes]) dnl XWin DDX AC_MSG_CHECKING([whether to build XWin DDX]) if test "x$XWIN" = xauto; then case $host_os in cygwin*) XWIN="yes" ;; mingw*) XWIN="yes" ;; *) XWIN="no" ;; esac fi AC_MSG_RESULT([$XWIN]) if test "x$XWIN" = xyes; then AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location]) AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes]) if test "x$WINDOWSWM" = xauto; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) fi if test "x$WINDOWSWM" = xyes ; then PKG_CHECK_MODULES(WINDOWSWM, $WINDOWSWMPROTO) XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS" AC_DEFINE(ROOTLESS,1,[Build Rootless code]) fi case $host_os in cygwin*) XWIN_SERVER_NAME=XWin AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages]) ;; mingw*) 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="-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 $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" AC_SUBST(XWIN_LIBS) AC_SUBST(XWIN_SERVER_NAME) AC_SUBST(XWIN_SYS_LIBS) if test "x$DEBUGGING" = xyes; then AC_DEFINE(CYGDEBUG, 1, [Simple debug messages]) AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling]) AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager]) fi AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF]) AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ]) dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then AC_CHECK_PROG(PYTHON3, python3, python3) if test -z "$PYTHON3"; then AC_MSG_ERROR([python3 not found]) fi AC_MSG_CHECKING(for python module lxml) $PYTHON3 -c "import lxml;" if test $? -ne 0 ; then AC_MSG_ERROR([not found]) fi AC_MSG_RESULT(yes) if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then PKG_CHECK_MODULES([KHRONOS_OPENGL_REGISTRY], [khronos-opengl-registry]) KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir` fi AC_SUBST(KHRONOS_SPEC_DIR) fi fi AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$AIGLX" = xyes]) AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) dnl Darwin / OS X DDX if test "x$XQUARTZ" = xyes; then AC_DEFINE(XQUARTZ,1,[Have Quartz]) AC_DEFINE(ROOTLESS,1,[Build Rootless code]) XQUARTZ_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $PRESENT_LIB" AC_SUBST([XQUARTZ_LIBS]) AC_CHECK_LIB([Xplugin],[xp_init],[:]) CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA" PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11) if test "x$XQUARTZ_SPARKLE" = xyes ; then AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.]) fi if test "x$STANDALONE_XPBPROXY" = xyes ; then AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy]) fi fi AM_CONDITIONAL(PSEUDORAMIX, [test "x$XQUARTZ" = xyes -o "x$XWIN" = xyes ]) # Support for objc in autotools is minimal and not documented. OBJC='$(CC)' OBJCLD='$(CCLD)' OBJCLINK='$(LINK)' OBJCFLAGS='$(CFLAGS)' AC_SUBST([OBJC]) AC_SUBST([OBJCCLD]) AC_SUBST([OBJCLINK]) AC_SUBST([OBJCFLAGS]) # internal, undocumented automake func follows :( _AM_DEPENDENCIES([OBJC]) AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"]) AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes]) dnl DMX DDX PKG_CHECK_MODULES( [DMXMODULES], [xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES], [PKG_CHECK_MODULES( [XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11], [have_dmx=yes], [have_dmx=no])], [have_dmx=no]) AC_MSG_CHECKING([whether to build Xdmx DDX]) if test "x$DMX" = xauto; then DMX="$have_dmx" case $host_os in cygwin*) DMX="no" ;; mingw*) DMX="no" ;; darwin*) DMX="no" ;; esac fi AC_MSG_RESULT([$DMX]) AM_CONDITIONAL(DMX, [test "x$DMX" = xyes]) if test "x$DMX" = xyes; then if test "x$have_dmx" = xno; then AC_MSG_ERROR([Xdmx build explicitly requested, but required modules not found.]) fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) AC_SUBST([XDMX_SYS_LIBS]) dnl USB sources in DMX require AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes", DMX_BUILD_USB="no") dnl Linux sources in DMX require AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes", DMX_BUILD_LNX="no") AC_SUBST(XDMXCONFIG_DEP_CFLAGS) AC_SUBST(XDMXCONFIG_DEP_LIBS) PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11]) AC_SUBST(DMXEXAMPLES_DEP_LIBS) PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11]) AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS) PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11]) AC_SUBST(DMXXIEXAMPLES_DEP_LIBS) PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11]) AC_SUBST(XTSTEXAMPLES_DEP_LIBS) PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11]) AC_SUBST(XRESEXAMPLES_DEP_LIBS) PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11]) AC_SUBST(X11EXAMPLES_DEP_LIBS) fi AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes]) AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes]) dnl kdrive DDX XEPHYR_LIBS= XEPHYR_INCS= AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes]) if test "$KDRIVE" = yes; then AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server]) AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx]) AC_CHECK_HEADERS([linux/fb.h]) if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then XFBDEV=yes fi if test "x$XFBDEV" = xyes; then KDRIVEFBDEVLIB=yes AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server]) fi PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) if test "x$HAVE_TSLIB" = xno; then AC_CHECK_LIB(ts, ts_open, [ HAVE_TSLIB="yes" TSLIB_LIBS="-lts" ]) fi if test "xTSLIB" = xauto; then TSLIB="$HAVE_TSLIB" fi if test "x$TSLIB" = xyes; then if ! test "x$HAVE_TSLIB" = xyes; then AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/]) else AC_DEFINE(TSLIB, 1, [Have tslib support]) fi fi if test "x$KDRIVE_KBD" = xyes; then AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver]) fi if test "x$KDRIVE_EVDEV" = xyes; then AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver]) fi if test "x$KDRIVE_MOUSE" = xyes; then AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) fi XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi if test "x$DRI" = xyes && test "x$GLX" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6" fi if test "x$GLAMOR" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb" fi if test "x$XEPHYR" = xauto; then PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [XEPHYR="yes"], [XEPHYR="no"]) elif test "x$XEPHYR" = xyes ; then PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS) fi # Xephyr needs nanosleep() which is in librt on Solaris AC_CHECK_FUNC([nanosleep], [], AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt")) # damage shadow extension glx (NOTYET) fb mi KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src' KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' case $host_os in *linux*) KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' KDRIVELINUX=yes if test "x$KDRIVE_EVDEV" = xauto; then KDRIVE_EVDEV=yes fi if test "x$KDRIVE_KBD" = xauto; then KDRIVE_KBD=yes fi if test "x$KDRIVE_MOUSE" = xauto; then KDRIVE_MOUSE=yes fi ;; *) if test "x$KDRIVE_EVDEV" = xauto; then KDRIVE_EVDEV=no fi if test "x$KDRIVE_KBD" = xauto; then KDRIVE_KBD=no fi if test "x$KDRIVE_MOUSE" = xauto; then KDRIVE_MOUSE=no fi ;; esac KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" AC_SUBST([XEPHYR_LIBS]) AC_SUBST([XEPHYR_INCS]) fi AC_SUBST([KDRIVE_INCS]) AC_SUBST([KDRIVE_PURE_INCS]) AC_SUBST([KDRIVE_CFLAGS]) AC_SUBST([KDRIVE_PURE_LIBS]) AC_SUBST([KDRIVE_LOCAL_LIBS]) AC_SUBST([KDRIVE_LIBS]) AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes]) AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes]) AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes]) AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes]) AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes]) AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes]) AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) dnl Xwayland DDX PKG_CHECK_MODULES(XWAYLANDMODULES, [wayland-client >= 1.3.0 libdrm epoxy], [have_xwayland=yes], [have_xwayland=no]) AC_MSG_CHECKING([whether to build Xwayland DDX]) if test "x$XWAYLAND" = xauto; then XWAYLAND="$have_xwayland" fi AC_MSG_RESULT([$XWAYLAND]) AM_CONDITIONAL(XWAYLAND, [test "x$XWAYLAND" = xyes]) if test "x$XWAYLAND" = xyes; then if test "x$have_xwayland" = xno; then AC_MSG_ERROR([Xwayland build explicitly requested, but required modules not found.]) fi XWAYLAND_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XWAYLAND_LIBS]) AC_SUBST([XWAYLAND_SYS_LIBS]) WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) fi dnl and the rest of these are generic, so they're in config.h dnl dnl though, thanks to the passing of some significant amount of time, the dnl above is probably a complete fallacy, and you should not rely on it. dnl but this is still actually better than imake, honest. -daniels AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #ifndef __GLIBC__ #error not glibc #endif ]], [])], [AC_DEFINE(_GNU_SOURCE, 1, [ Enable GNU and other extensions to the C environment for glibc])]) AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix]) AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [sysconfdir]) AC_SUBST([RELEASE_DATE]) BUILD_DATE="`date +'%Y%m%d'`" AC_SUBST([BUILD_DATE]) BUILD_TIME="`date +'1%H%M%S'`" AC_SUBST([BUILD_TIME]) DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" AC_SUBST([DIX_CFLAGS]) AC_SUBST([libdir]) AC_SUBST([exec_prefix]) AC_SUBST([prefix]) AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep]) if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then AC_MSG_WARN([ *********************************************** Neither HAL nor udev backend will be enabled. Input device hotplugging will not be available! ***********************************************]) fi 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 glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh 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/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/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/xwin/winclipboard/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/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc ]) AC_OUTPUT xorg-server-1.17.1/glx/0000775000175100017510000000000012466505444011675 500000000000000xorg-server-1.17.1/glx/glxdricommon.c0000664000175100017510000002624512323563340014463 00000000000000/* * Copyright © 2008 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "glxserver.h" #include "glxext.h" #include "glxcontext.h" #include "glxscreens.h" #include "glxdricommon.h" static int getUST(int64_t * ust) { struct timeval tv; if (ust == NULL) return -EFAULT; if (gettimeofday(&tv, NULL) == 0) { ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec; return 0; } else { return -errno; } } const __DRIsystemTimeExtension systemTimeExtension = { {__DRI_SYSTEM_TIME, 1}, getUST, NULL, }; #define __ATTRIB(attrib, field) \ { attrib, offsetof(__GLXconfig, field) } static const struct { unsigned int attrib, offset; } attribMap[] = { __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits), __ATTRIB(__DRI_ATTRIB_LEVEL, level), __ATTRIB(__DRI_ATTRIB_RED_SIZE, redBits), __ATTRIB(__DRI_ATTRIB_GREEN_SIZE, greenBits), __ATTRIB(__DRI_ATTRIB_BLUE_SIZE, blueBits), __ATTRIB(__DRI_ATTRIB_ALPHA_SIZE, alphaBits), __ATTRIB(__DRI_ATTRIB_DEPTH_SIZE, depthBits), __ATTRIB(__DRI_ATTRIB_STENCIL_SIZE, stencilBits), __ATTRIB(__DRI_ATTRIB_ACCUM_RED_SIZE, accumRedBits), __ATTRIB(__DRI_ATTRIB_ACCUM_GREEN_SIZE, accumGreenBits), __ATTRIB(__DRI_ATTRIB_ACCUM_BLUE_SIZE, accumBlueBits), __ATTRIB(__DRI_ATTRIB_ACCUM_ALPHA_SIZE, accumAlphaBits), __ATTRIB(__DRI_ATTRIB_SAMPLE_BUFFERS, sampleBuffers), __ATTRIB(__DRI_ATTRIB_SAMPLES, samples), __ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER, doubleBufferMode), __ATTRIB(__DRI_ATTRIB_STEREO, stereoMode), __ATTRIB(__DRI_ATTRIB_AUX_BUFFERS, numAuxBuffers), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_TYPE, transparentPixel), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, transparentPixel), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_RED_VALUE, transparentRed), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue), __ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha), __ATTRIB(__DRI_ATTRIB_RED_MASK, redMask), __ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask), __ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask), __ATTRIB(__DRI_ATTRIB_ALPHA_MASK, alphaMask), __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_WIDTH, maxPbufferWidth), __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_HEIGHT, maxPbufferHeight), __ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_PIXELS, maxPbufferPixels), __ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH, optimalPbufferWidth), __ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT, optimalPbufferHeight), __ATTRIB(__DRI_ATTRIB_SWAP_METHOD, swapMethod), __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb), __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba), __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture), __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted), __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable), }; static void setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value) { int i; for (i = 0; i < ARRAY_SIZE(attribMap); i++) if (attribMap[i].attrib == attrib) { *(unsigned int *) ((char *) config + attribMap[i].offset) = value; return; } } static __GLXconfig * createModeFromConfig(const __DRIcoreExtension * core, const __DRIconfig * driConfig, unsigned int visualType, unsigned int drawableType) { __GLXDRIconfig *config; GLint renderType = 0; unsigned int attrib, value; int i; config = calloc(1, sizeof *config); config->driConfig = driConfig; i = 0; while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) { switch (attrib) { case __DRI_ATTRIB_RENDER_TYPE: if (value & __DRI_ATTRIB_RGBA_BIT) renderType |= GLX_RGBA_BIT; if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) renderType |= GLX_COLOR_INDEX_BIT; if (value & __DRI_ATTRIB_FLOAT_BIT) renderType |= GLX_RGBA_FLOAT_BIT_ARB; if (value & __DRI_ATTRIB_UNSIGNED_FLOAT_BIT) renderType |= GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT; break; case __DRI_ATTRIB_CONFIG_CAVEAT: if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG) config->config.visualRating = GLX_NON_CONFORMANT_CONFIG; else if (value & __DRI_ATTRIB_SLOW_BIT) config->config.visualRating = GLX_SLOW_CONFIG; else config->config.visualRating = GLX_NONE; break; case __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS: config->config.bindToTextureTargets = 0; if (value & __DRI_ATTRIB_TEXTURE_1D_BIT) config->config.bindToTextureTargets |= GLX_TEXTURE_1D_BIT_EXT; if (value & __DRI_ATTRIB_TEXTURE_2D_BIT) config->config.bindToTextureTargets |= GLX_TEXTURE_2D_BIT_EXT; if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT) config->config.bindToTextureTargets |= GLX_TEXTURE_RECTANGLE_BIT_EXT; break; default: setScalar(&config->config, attrib, value); break; } } config->config.next = NULL; config->config.xRenderable = GL_TRUE; config->config.visualType = visualType; config->config.renderType = renderType; config->config.drawableType = drawableType; config->config.yInverted = GL_TRUE; return &config->config; } static Bool render_type_is_pbuffer_only(unsigned renderType) { /* The GL_ARB_color_buffer_float spec says: * * "Note that floating point rendering is only supported for * GLXPbuffer drawables. The GLX_DRAWABLE_TYPE attribute of the * GLXFBConfig must have the GLX_PBUFFER_BIT bit set and the * GLX_RENDER_TYPE attribute must have the GLX_RGBA_FLOAT_BIT set." */ return !!(renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT | __DRI_ATTRIB_FLOAT_BIT)); } __GLXconfig * glxConvertConfigs(const __DRIcoreExtension * core, const __DRIconfig ** configs, unsigned int drawableType) { __GLXconfig head, *tail; int i; tail = &head; head.next = NULL; for (i = 0; configs[i]; i++) { unsigned renderType = 0; if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, &renderType)) { if (render_type_is_pbuffer_only(renderType) && !(drawableType & GLX_PBUFFER_BIT)) continue; } /* Add all the others */ tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR, drawableType); if (tail->next == NULL) break; tail = tail->next; } for (i = 0; configs[i]; i++) { unsigned int renderType = 0; if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, &renderType)) { if (render_type_is_pbuffer_only(renderType) && !(drawableType & GLX_PBUFFER_BIT)) continue; } /* Add all the others */ tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR, drawableType); if (tail->next == NULL) break; tail = tail->next; } return head.next; } static const char dri_driver_path[] = DRI_DRIVER_PATH; /* Temporary define to allow building without a dri_interface.h from * updated Mesa. Some day when we don't care about Mesa that old any * more this can be removed. */ #ifndef __DRI_DRIVER_GET_EXTENSIONS #define __DRI_DRIVER_GET_EXTENSIONS "__driDriverGetExtensions" #endif void * glxProbeDriver(const char *driverName, void **coreExt, const char *coreName, int coreVersion, void **renderExt, const char *renderName, int renderVersion) { int i; void *driver; char filename[PATH_MAX]; char *get_extensions_name; const __DRIextension **extensions = NULL; snprintf(filename, sizeof filename, "%s/%s_dri.so", dri_driver_path, driverName); driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); if (driver == NULL) { LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", filename, dlerror()); goto cleanup_failure; } if (asprintf(&get_extensions_name, "%s_%s", __DRI_DRIVER_GET_EXTENSIONS, driverName) != -1) { const __DRIextension **(*get_extensions)(void); get_extensions = dlsym(driver, get_extensions_name); if (get_extensions) extensions = get_extensions(); free(get_extensions_name); } if (!extensions) extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); if (extensions == NULL) { LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", driverName, dlerror()); goto cleanup_failure; } for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, coreName) == 0 && extensions[i]->version >= coreVersion) { *coreExt = (void *) extensions[i]; } if (strcmp(extensions[i]->name, renderName) == 0 && extensions[i]->version >= renderVersion) { *renderExt = (void *) extensions[i]; } } if (*coreExt == NULL || *renderExt == NULL) { LogMessage(X_ERROR, "AIGLX error: %s does not export required DRI extension\n", driverName); goto cleanup_failure; } return driver; cleanup_failure: if (driver) dlclose(driver); *coreExt = *renderExt = NULL; return NULL; } xorg-server-1.17.1/glx/Makefile.am0000664000175100017510000000336512275273333013655 00000000000000if AIGLX_DRI_LOADER GLXDRI_LIBRARY = libglxdri.la endif noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) AM_CFLAGS = \ @DIX_CFLAGS@ \ @GL_CFLAGS@ \ @XLIB_CFLAGS@ \ @LIBDRM_CFLAGS@ \ @GLX_DEFINES@ \ @GLX_ARCH_DEFINES@ # none yet #sdk_HEADERS = AM_CPPFLAGS = \ -I$(top_srcdir)/hw/xfree86/os-support \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/dri \ -I$(top_srcdir)/mi \ -I$(top_srcdir)/present if DRI2_AIGLX AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/dri2 endif indirect_sources = \ indirect_dispatch.c \ indirect_dispatch.h \ indirect_dispatch_swap.c \ indirect_reqsize.c \ indirect_reqsize.h \ indirect_size.h \ indirect_size_get.c \ indirect_size_get.h \ indirect_table.c libglxdri_la_SOURCES = if DRI2_AIGLX libglxdri_la_SOURCES += glxdri2.c endif libglxdri_la_LIBADD = $(DLOPEN_LIBS) libglx_la_SOURCES = \ $(indirect_sources) \ clientinfo.c \ createcontext.c \ extension_string.c \ extension_string.h \ indirect_util.c \ indirect_util.h \ indirect_program.c \ indirect_table.h \ indirect_texture_compression.c \ glxbyteorder.h \ glxcmds.c \ glxcmdsswap.c \ glxcontext.h \ glxdrawable.h \ glxext.c \ glxext.h \ glxdriswrast.c \ glxdricommon.c \ glxdricommon.h \ glxscreens.c \ glxscreens.h \ glxserver.h \ glxutil.h \ render2.c \ render2swap.c \ renderpix.c \ renderpixswap.c \ rensize.c \ single2.c \ single2swap.c \ singlepix.c \ singlepixswap.c \ singlesize.c \ singlesize.h \ swap_interval.c \ unpack.h \ xfont.c libglx_la_LIBADD = $(DLOPEN_LIBS) xorg-server-1.17.1/glx/glxext.c0000664000175100017510000003752512456571574013316 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "glxserver.h" #include #include #include #include "privates.h" #include #include "extinit.h" #include "glx_extinit.h" #include "unpack.h" #include "glxutil.h" #include "glxext.h" #include "indirect_table.h" #include "indirect_util.h" /* ** X resources. */ RESTYPE __glXContextRes; RESTYPE __glXDrawableRes; /* ** Reply for most singles. */ xGLXSingleReply __glXReply; static DevPrivateKeyRec glxClientPrivateKeyRec; #define glxClientPrivateKey (&glxClientPrivateKeyRec) /* ** Forward declarations. */ static int __glXDispatch(ClientPtr); static GLboolean __glXFreeContext(__GLXcontext * cx); /* ** Called when the extension is reset. */ static void ResetExtension(ExtensionEntry * extEntry) { lastGLContext = NULL; } /* ** Reset state used to keep track of large (multi-request) commands. */ void __glXResetLargeCommandStatus(__GLXclientState * cl) { cl->largeCmdBytesSoFar = 0; cl->largeCmdBytesTotal = 0; cl->largeCmdRequestsSoFar = 0; cl->largeCmdRequestsTotal = 0; } /* * This procedure is called when the client who created the context goes away * OR when glXDestroyContext is called. In either case, all we do is flag that * the ID is no longer valid, and (maybe) free the context. */ static int ContextGone(__GLXcontext * cx, XID id) { cx->idExists = GL_FALSE; if (!cx->currentClient) { __glXFreeContext(cx); } return True; } static __GLXcontext *glxPendingDestroyContexts; static __GLXcontext *glxAllContexts; static int glxServerLeaveCount; static int glxBlockClients; /* ** Destroy routine that gets called when a drawable is freed. A drawable ** contains the ancillary buffers needed for rendering. */ static Bool DrawableGone(__GLXdrawable * glxPriv, XID xid) { __GLXcontext *c, *next; if (glxPriv->type == GLX_DRAWABLE_WINDOW) { /* If this was created by glXCreateWindow, free the matching resource */ if (glxPriv->drawId != glxPriv->pDraw->id) { if (xid == glxPriv->drawId) FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE); else FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE); } /* otherwise this window was implicitly created by MakeCurrent */ } for (c = glxAllContexts; c; c = next) { next = c->next; if (c->currentClient && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { /* flush the context */ glFlush(); c->hasUnflushedCommands = GL_FALSE; /* just force a re-bind the next time through */ (*c->loseCurrent) (c); lastGLContext = NULL; } if (c->drawPriv == glxPriv) c->drawPriv = NULL; if (c->readPriv == glxPriv) c->readPriv = NULL; } /* drop our reference to any backing pixmap */ if (glxPriv->type == GLX_DRAWABLE_PIXMAP) glxPriv->pDraw->pScreen->DestroyPixmap((PixmapPtr) glxPriv->pDraw); glxPriv->destroy(glxPriv); return True; } Bool __glXAddContext(__GLXcontext * cx) { /* Register this context as a resource. */ if (!AddResource(cx->id, __glXContextRes, (void *)cx)) { return False; } cx->next = glxAllContexts; glxAllContexts = cx; return True; } static void __glXRemoveFromContextList(__GLXcontext * cx) { __GLXcontext *c, *prev; if (cx == glxAllContexts) glxAllContexts = cx->next; else { prev = glxAllContexts; for (c = glxAllContexts; c; c = c->next) { if (c == cx) prev->next = c->next; prev = c; } } } /* ** Free a context. */ static GLboolean __glXFreeContext(__GLXcontext * cx) { if (cx->idExists || cx->currentClient) return GL_FALSE; __glXRemoveFromContextList(cx); free(cx->feedbackBuf); free(cx->selectBuf); if (cx == lastGLContext) { lastGLContext = NULL; } /* We can get here through both regular dispatching from * __glXDispatch() or as a callback from the resource manager. In * the latter case we need to lift the DRI lock manually. */ if (!glxBlockClients) { __glXleaveServer(GL_FALSE); cx->destroy(cx); __glXenterServer(GL_FALSE); } else { cx->next = glxPendingDestroyContexts; glxPendingDestroyContexts = cx; } return GL_TRUE; } /************************************************************************/ /* ** These routines can be used to check whether a particular GL command ** has caused an error. Specifically, we use them to check whether a ** given query has caused an error, in which case a zero-length data ** reply is sent to the client. */ static GLboolean errorOccured = GL_FALSE; /* ** The GL was will call this routine if an error occurs. */ void __glXErrorCallBack(GLenum code) { errorOccured = GL_TRUE; } /* ** Clear the error flag before calling the GL command. */ void __glXClearErrorOccured(void) { errorOccured = GL_FALSE; } /* ** Check if the GL command caused an error. */ GLboolean __glXErrorOccured(void) { return errorOccured; } static int __glXErrorBase; int __glXEventBase; int __glXError(int error) { return __glXErrorBase + error; } __GLXclientState * glxGetClient(ClientPtr pClient) { return dixLookupPrivate(&pClient->devPrivates, glxClientPrivateKey); } static void glxClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; __GLXclientState *cl = glxGetClient(pClient); __GLXcontext *c, *next; switch (pClient->clientState) { case ClientStateRunning: cl->client = pClient; break; case ClientStateGone: /* detach from all current contexts */ for (c = glxAllContexts; c; c = next) { next = c->next; if (c->currentClient == pClient) { c->loseCurrent(c); lastGLContext = NULL; c->currentClient = NULL; FreeResourceByType(c->id, __glXContextRes, FALSE); } } free(cl->returnBuf); free(cl->largeCmdBuf); free(cl->GLClientextensions); break; default: break; } } /************************************************************************/ static __GLXprovider *__glXProviderStack; void GlxPushProvider(__GLXprovider * provider) { provider->next = __glXProviderStack; __glXProviderStack = provider; } static Bool checkScreenVisuals(void) { int i, j; for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr screen = screenInfo.screens[i]; for (j = 0; j < screen->numVisuals; j++) { if (screen->visuals[j].class == TrueColor || screen->visuals[j].class == DirectColor) return True; } } return False; } /* ** Initialize the GLX extension. */ void GlxExtensionInit(void) { ExtensionEntry *extEntry; ScreenPtr pScreen; int i; __GLXprovider *p, **stack; Bool glx_provided = False; if (serverGeneration == 1) { for (stack = &__glXProviderStack; *stack; stack = &(*stack)->next) ; *stack = &__glXDRISWRastProvider; } /* Mesa requires at least one True/DirectColor visual */ if (!checkScreenVisuals()) return; __glXContextRes = CreateNewResourceType((DeleteType) ContextGone, "GLXContext"); __glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone, "GLXDrawable"); if (!__glXContextRes || !__glXDrawableRes) return; if (!dixRegisterPrivateKey (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState))) return; if (!AddCallback(&ClientStateCallback, glxClientCallback, 0)) return; for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; for (p = __glXProviderStack; p != NULL; p = p->next) { __GLXscreen *glxScreen; glxScreen = p->screenProbe(pScreen); if (glxScreen != NULL) { if (glxScreen->GLXminor < glxMinorVersion) glxMinorVersion = glxScreen->GLXminor; LogMessage(X_INFO, "GLX: Initialized %s GL provider for screen %d\n", p->name, i); break; } } if (!p) LogMessage(X_INFO, "GLX: no usable GL providers found for screen %d\n", i); else glx_provided = True; } /* don't register extension if GL is not provided on any screen */ if (!glx_provided) return; /* ** Add extension to server extensions. */ extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, __GLX_NUMBER_ERRORS, __glXDispatch, __glXDispatch, ResetExtension, StandardMinorOpcode); if (!extEntry) { FatalError("__glXExtensionInit: AddExtensions failed\n"); return; } if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); return; } __glXErrorBase = extEntry->errorBase; __glXEventBase = extEntry->eventBase; #if PRESENT __glXregisterPresentCompleteNotify(); #endif } /************************************************************************/ /* ** Make a context the current one for the GL (in this implementation, there ** is only one instance of the GL, and we use it to serve all GL clients by ** switching it between different contexts). While we are at it, look up ** a context by its tag and return its (__GLXcontext *). */ __GLXcontext * __glXForceCurrent(__GLXclientState * cl, GLXContextTag tag, int *error) { __GLXcontext *cx; /* ** See if the context tag is legal; it is managed by the extension, ** so if it's invalid, we have an implementation error. */ cx = __glXLookupContextByTag(cl, tag); if (!cx) { cl->client->errorValue = tag; *error = __glXError(GLXBadContextTag); return 0; } if (!cx->isDirect) { if (cx->drawPriv == NULL) { /* ** The drawable has vanished. It must be a window, because only ** windows can be destroyed from under us; GLX pixmaps are ** refcounted and don't go away until no one is using them. */ *error = __glXError(GLXBadCurrentWindow); return 0; } } if (cx->wait && (*cx->wait) (cx, cl, error)) return NULL; if (cx == lastGLContext) { /* No need to re-bind */ return cx; } /* Make this context the current one for the GL. */ if (!cx->isDirect) { lastGLContext = cx; if (!(*cx->makeCurrent) (cx)) { /* Bind failed, and set the error code. Bummer */ lastGLContext = NULL; cl->client->errorValue = cx->id; *error = __glXError(GLXBadContextState); return 0; } } return cx; } /************************************************************************/ void glxSuspendClients(void) { int i; for (i = 1; i < currentMaxClients; i++) { if (clients[i] && glxGetClient(clients[i])->inUse) IgnoreClient(clients[i]); } glxBlockClients = TRUE; } void glxResumeClients(void) { __GLXcontext *cx, *next; int i; glxBlockClients = FALSE; for (i = 1; i < currentMaxClients; i++) { if (clients[i] && glxGetClient(clients[i])->inUse) AttendClient(clients[i]); } __glXleaveServer(GL_FALSE); for (cx = glxPendingDestroyContexts; cx != NULL; cx = next) { next = cx->next; cx->destroy(cx); } glxPendingDestroyContexts = NULL; __glXenterServer(GL_FALSE); } static void __glXnopEnterServer(GLboolean rendering) { } static void __glXnopLeaveServer(GLboolean rendering) { } static void (*__glXenterServerFunc) (GLboolean) = __glXnopEnterServer; static void (*__glXleaveServerFunc) (GLboolean) = __glXnopLeaveServer; void __glXsetEnterLeaveServerFuncs(void (*enter) (GLboolean), void (*leave) (GLboolean)) { __glXenterServerFunc = enter; __glXleaveServerFunc = leave; } void __glXenterServer(GLboolean rendering) { glxServerLeaveCount--; if (glxServerLeaveCount == 0) (*__glXenterServerFunc) (rendering); } void __glXleaveServer(GLboolean rendering) { if (glxServerLeaveCount == 0) (*__glXleaveServerFunc) (rendering); glxServerLeaveCount++; } static glx_gpa_proc _get_proc_address; void __glXsetGetProcAddress(glx_gpa_proc get_proc_address) { _get_proc_address = get_proc_address; } void *__glGetProcAddress(const char *proc) { void *ret = (void *) _get_proc_address(proc); return ret ? ret : (void *) NoopDDA; } /* ** Top level dispatcher; all commands are executed from here down. */ static int __glXDispatch(ClientPtr client) { REQUEST(xGLXSingleReq); CARD8 opcode; __GLXdispatchSingleProcPtr proc; __GLXclientState *cl; int retval; opcode = stuff->glxCode; cl = glxGetClient(client); /* Mark it in use so we suspend it on VT switch. */ cl->inUse = TRUE; /* ** If we're expecting a glXRenderLarge request, this better be one. */ if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) { client->errorValue = stuff->glxCode; return __glXError(GLXBadLargeRequest); } /* If we're currently blocking GLX clients, just put this guy to * sleep, reset the request and return. */ if (glxBlockClients) { ResetCurrentRequest(client); client->sequence--; IgnoreClient(client); return Success; } /* ** Use the opcode to index into the procedure table. */ proc = __glXGetProtocolDecodeFunction(&Single_dispatch_info, opcode, client->swapped); if (proc != NULL) { GLboolean rendering = opcode <= X_GLXRenderLarge; __glXleaveServer(rendering); retval = (*proc) (cl, (GLbyte *) stuff); __glXenterServer(rendering); } else { retval = BadRequest; } return retval; } xorg-server-1.17.1/glx/extension_string.h0000664000175100017510000000531512274325511015364 00000000000000/* * (C) Copyright IBM Corporation 2002-2006 * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * on the rights to use, copy, modify, merge, publish, distribute, sub * license, and/or sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file extension_string.h * Routines to manage the GLX extension string and GLX version for AIGLX * drivers. This code is loosely based on src/glx/x11/glxextensions.c from * Mesa. * * \author Ian Romanick */ #ifndef GLX_EXTENSION_STRING_H #define GLX_EXTENSION_STRING_H enum { /* GLX_ARB_get_proc_address is implemented on the client. */ ARB_create_context_bit = 0, ARB_create_context_profile_bit, ARB_create_context_robustness_bit, ARB_fbconfig_float_bit, ARB_framebuffer_sRGB_bit, ARB_multisample_bit, EXT_create_context_es2_profile_bit, EXT_import_context_bit, EXT_texture_from_pixmap_bit, EXT_visual_info_bit, EXT_visual_rating_bit, MESA_copy_sub_buffer_bit, OML_swap_method_bit, SGI_make_current_read_bit, SGI_swap_control_bit, SGI_video_sync_bit, SGIS_multisample_bit, SGIX_fbconfig_bit, SGIX_pbuffer_bit, SGIX_visual_select_group_bit, INTEL_swap_event_bit, __NUM_GLX_EXTS, }; /* For extensions which have identical ARB and EXT implementation * in GLX area, use one enabling bit for both. */ #define EXT_framebuffer_sRGB_bit ARB_framebuffer_sRGB_bit #define __GLX_EXT_BYTES ((__NUM_GLX_EXTS + 7) / 8) extern int __glXGetExtensionString(const unsigned char *enable_bits, char *buffer); extern void __glXEnableExtension(unsigned char *enable_bits, const char *ext); extern void __glXInitExtensionEnableBits(unsigned char *enable_bits); #endif /* GLX_EXTENSION_STRING_H */ xorg-server-1.17.1/glx/indirect_table.h0000664000175100017510000000655612456571574014760 00000000000000/* * (C) Copyright IBM Corporation 2005, 2006 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * \file indirect_table.h * * \author Ian Romanick */ #ifndef INDIRECT_TABLE_H #define INDIRECT_TABLE_H #include /** */ struct __glXDispatchInfo { /** * Number of significant bits in the protocol opcode. Opcodes with values * larger than ((1 << bits) - 1) are invalid. */ unsigned bits; /** */ const int_fast16_t *dispatch_tree; /** * Array of protocol decode and dispatch functions index by the opcode * search tree (i.e., \c dispatch_tree). The first element in each pair * is the non-byte-swapped version, and the second element is the * byte-swapped version. */ const void *(*dispatch_functions)[2]; /** * Pointer to size validation data. This table is indexed with the same * value as ::dispatch_functions. * * The first element in the pair is the size, in bytes, of the fixed-size * portion of the protocol. * * For opcodes that have a variable-size portion, the second value is an * index in \c size_func_table to calculate that size. If there is no * variable-size portion, this index will be ~0. * * \note * If size checking is not to be performed on this type of protocol * data, this pointer will be \c NULL. */ const int_fast16_t(*size_table)[2]; /** * Array of functions used to calculate the variable-size portion of * protocol messages. Indexed by the second element of the entries * in \c ::size_table. * * \note * If size checking is not to be performed on this type of protocol * data, this pointer will be \c NULL. */ const gl_proto_size_func *size_func_table; }; /** * Sentinel value for an empty leaf in the \c dispatch_tree. */ #define EMPTY_LEAF INT_FAST16_MIN /** * Declare the index \c x as a leaf index. */ #define LEAF(x) -x /** * Determine if an index is a leaf index. */ #define IS_LEAF_INDEX(x) ((x) <= 0) extern const struct __glXDispatchInfo Single_dispatch_info; extern const struct __glXDispatchInfo Render_dispatch_info; extern const struct __glXDispatchInfo VendorPriv_dispatch_info; #endif /* INDIRECT_TABLE_H */ xorg-server-1.17.1/glx/glxserver.h0000664000175100017510000001754512456571574014031 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _GLX_server_h_ #define _GLX_server_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #include #include #include #include #include #include #include #include #include #include #include #include #include /* ** GLX resources. */ typedef XID GLXContextID; typedef XID GLXPixmap; typedef XID GLXDrawable; typedef struct __GLXclientStateRec __GLXclientState; typedef struct __GLXdrawable __GLXdrawable; typedef struct __GLXcontext __GLXcontext; #include "glxscreens.h" #include "glxdrawable.h" #include "glxcontext.h" #ifndef True #define True 1 #endif #ifndef False #define False 0 #endif extern __GLXscreen *glxGetScreen(ScreenPtr pScreen); extern __GLXclientState *glxGetClient(ClientPtr pClient); /************************************************************************/ void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates); void __glXScreenInitVisuals(__GLXscreen * screen); /* ** The last context used (from the server's persective) is cached. */ extern __GLXcontext *__glXForceCurrent(__GLXclientState *, GLXContextTag, int *); int __glXError(int error); /************************************************************************/ typedef struct __GLXprovider __GLXprovider; struct __GLXprovider { __GLXscreen *(*screenProbe) (ScreenPtr pScreen); const char *name; __GLXprovider *next; }; extern __GLXprovider __glXDRISWRastProvider; void GlxPushProvider(__GLXprovider * provider); enum { GLX_MINIMAL_VISUALS, GLX_TYPICAL_VISUALS, GLX_ALL_VISUALS }; void __glXsetEnterLeaveServerFuncs(void (*enter) (GLboolean), void (*leave) (GLboolean)); void __glXenterServer(GLboolean rendering); void __glXleaveServer(GLboolean rendering); void glxSuspendClients(void); void glxResumeClients(void); typedef void (*glx_func_ptr)(void); typedef glx_func_ptr (*glx_gpa_proc)(const char *); void __glXsetGetProcAddress(glx_gpa_proc get_proc_address); void *__glGetProcAddress(const char *); void __glXsendSwapEvent(__GLXdrawable *drawable, int type, CARD64 ust, CARD64 msc, CARD32 sbc); #if PRESENT void __glXregisterPresentCompleteNotify(void); #endif /* ** State kept per client. */ struct __GLXclientStateRec { /* ** Whether this structure is currently being used to support a client. */ Bool inUse; /* ** Buffer for returned data. */ GLbyte *returnBuf; GLint returnBufSize; /* ** Keep track of large rendering commands, which span multiple requests. */ GLint largeCmdBytesSoFar; /* bytes received so far */ GLint largeCmdBytesTotal; /* total bytes expected */ GLint largeCmdRequestsSoFar; /* requests received so far */ GLint largeCmdRequestsTotal; /* total requests expected */ GLbyte *largeCmdBuf; GLint largeCmdBufSize; /* Back pointer to X client record */ ClientPtr client; char *GLClientextensions; }; /************************************************************************/ /* ** Dispatch tables. */ typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *); typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *); typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *); /* * Dispatch for GLX commands. */ typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc); /* * Tables for computing the size of each rendering command. */ typedef int (*gl_proto_size_func) (const GLbyte *, Bool, int); typedef struct { int bytes; gl_proto_size_func varsize; } __GLXrenderSizeData; /************************************************************************/ /* ** X resources. */ extern RESTYPE __glXContextRes; extern RESTYPE __glXClientRes; extern RESTYPE __glXPixmapRes; extern RESTYPE __glXDrawableRes; /************************************************************************/ /* ** Prototypes. */ extern char *__glXcombine_strings(const char *, const char *); /* ** Routines for sending swapped replies. */ extern void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply * reply); extern void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply); extern void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply); extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply * reply, int *buf); extern void __glXSwapGetDrawableAttributesReply(ClientPtr client, xGLXGetDrawableAttributesReply * reply, CARD32 *buf); extern void glxSwapQueryExtensionsStringReply(ClientPtr client, xGLXQueryExtensionsStringReply * reply, char *buf); extern void glxSwapQueryServerStringReply(ClientPtr client, xGLXQueryServerStringReply * reply, char *buf); /* * Routines for computing the size of variably-sized rendering commands. */ static _X_INLINE int safe_add(int a, int b) { if (a < 0 || b < 0) return -1; if (INT_MAX - a < b) return -1; return a + b; } static _X_INLINE int safe_mul(int a, int b) { if (a < 0 || b < 0) return -1; if (a == 0 || b == 0) return 0; if (a > INT_MAX / b) return -1; return a * b; } static _X_INLINE int safe_pad(int a) { int ret; if (a < 0) return -1; if ((ret = safe_add(a, 3)) < 0) return -1; return ret & (GLuint)~3; } extern int __glXTypeSize(GLenum enm); extern int __glXImageSize(GLenum format, GLenum type, GLenum target, GLsizei w, GLsizei h, GLsizei d, GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows, GLint alignment); extern unsigned glxMajorVersion; extern unsigned glxMinorVersion; extern int __glXEventBase; #endif /* !__GLX_server_h__ */ xorg-server-1.17.1/glx/singlepixswap.c0000664000175100017510000004363312456571574014675 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "glxext.h" #include "singlesize.h" #include "unpack.h" #include "indirect_dispatch.h" #include "indirect_size_get.h" int __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc) { GLsizei width, height; GLenum format, type; GLboolean swapBytes, lsbFirst; GLint compsize; __GLX_DECLARE_SWAP_VARIABLES; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; REQUEST_FIXED_SIZE(xGLXSingleReq, 28); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); __GLX_SWAP_INT(pc + 12); __GLX_SWAP_INT(pc + 16); __GLX_SWAP_INT(pc + 20); width = *(GLsizei *) (pc + 8); height = *(GLsizei *) (pc + 12); format = *(GLenum *) (pc + 16); type = *(GLenum *) (pc + 20); swapBytes = *(GLboolean *) (pc + 24); lsbFirst = *(GLboolean *) (pc + 25); compsize = __glReadPixels_size(format, type, width, height); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glReadPixels(*(GLint *) (pc + 0), *(GLint *) (pc + 4), *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12), *(GLenum *) (pc + 16), *(GLenum *) (pc + 20), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } cx->hasUnflushedCommands = GL_FALSE; return Success; } int __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc) { GLint level, compsize; GLenum format, type, target; GLboolean swapBytes; __GLX_DECLARE_SWAP_VARIABLES; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0, depth = 1; REQUEST_FIXED_SIZE(xGLXSingleReq, 20); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); __GLX_SWAP_INT(pc + 12); level = *(GLint *) (pc + 4); format = *(GLenum *) (pc + 8); type = *(GLenum *) (pc + 12); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 16); glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width); glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height); if (target == GL_TEXTURE_3D) { glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth); } /* * The three queries above might fail if we're in a state where queries * are illegal, but then width, height, and depth would still be zero anyway. */ compsize = __glGetTexImage_size(target, level, format, type, width, height, depth); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetTexImage(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLenum *) (pc + 8), *(GLenum *) (pc + 12), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); __GLX_SWAP_INT(&depth); ((xGLXGetTexImageReply *) &__glXReply)->width = width; ((xGLXGetTexImageReply *) &__glXReply)->height = height; ((xGLXGetTexImageReply *) &__glXReply)->depth = depth; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDispSwap_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc) { GLboolean lsbFirst; __GLXcontext *cx; ClientPtr client = cl->client; int error; GLubyte answerBuffer[200]; char *answer; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; lsbFirst = *(GLboolean *) (pc + 0); glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst); __GLX_GET_ANSWER_BUFFER(answer, cl, 128, 1); __glXClearErrorOccured(); glGetPolygonStipple((GLubyte *) answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(128); __GLX_SWAP_REPLY_HEADER(); __GLX_SEND_HEADER(); __GLX_SEND_BYTE_ARRAY(128); } return Success; } static int GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize, compsize2; GLenum format, type, target; GLboolean swapBytes; __GLXcontext *cx; ClientPtr client = cl->client; int error; __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0, height = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); /* target must be SEPARABLE_2D, however I guess we can let the GL barf on this one.... */ glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width); glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height); /* * The two queries above might fail if we're in a state where queries * are illegal, but then width and height would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1); if ((compsize = safe_pad(compsize)) < 0) return BadLength; if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1); __glXClearErrorOccured(); glGetSeparableFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), answer, answer + compsize, NULL); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); } else { __GLX_BEGIN_REPLY(compsize + compsize2); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width; ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height; __GLX_SEND_VOID_ARRAY(compsize + compsize2); } return Success; } int __glXDispSwap_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDispSwap_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes; __GLXcontext *cx; ClientPtr client = cl->client; int error; __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0, height = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width); if (target == GL_CONVOLUTION_2D) { height = 1; } else { glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height); } /* * The two queries above might fail if we're in a state where queries * are illegal, but then width and height would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetConvolutionFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width; ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height; __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDispSwap_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDispSwap_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes, reset; __GLXcontext *cx; ClientPtr client = cl->client; int error; __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); reset = *(GLboolean *) (pc + 13); glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width); /* * The one query above might fail if we're in a state where queries * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetHistogram(target, reset, format, type, answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); ((xGLXGetHistogramReply *) &__glXReply)->width = width; __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDispSwap_GetHistogram(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDispSwap_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes, reset; __GLXcontext *cx; ClientPtr client = cl->client; int error; __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); reset = *(GLboolean *) (pc + 13); compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetMinmax(target, reset, format, type, answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDispSwap_GetMinmax(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDispSwap_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes; __GLXcontext *cx; ClientPtr client = cl->client; int error; __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; GLint width = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width); /* * The one query above might fail if we're in a state where queries * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetColorTable(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SWAP_REPLY_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); ((xGLXGetColorTableReply *) &__glXReply)->width = width; __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDispSwap_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } xorg-server-1.17.1/glx/glxext.h0000664000175100017510000000511212456571574013306 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _glxext_h_ #define _glxext_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ /* doing #include & #include could cause problems * with overlapping definitions, so let's use the easy way */ #ifndef GLX_RGBA_FLOAT_BIT_ARB #define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 #endif #ifndef GLX_RGBA_FLOAT_TYPE_ARB #define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 #endif #ifndef GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT #define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 #endif #ifndef GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT #define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 #endif extern void __glXFlushContextCache(void); extern Bool __glXAddContext(__GLXcontext * cx); extern void __glXErrorCallBack(GLenum code); extern void __glXClearErrorOccured(void); extern GLboolean __glXErrorOccured(void); extern void __glXResetLargeCommandStatus(__GLXclientState *); extern const char GLServerVersion[]; extern int DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap); #endif /* _glxext_h_ */ xorg-server-1.17.1/glx/indirect_size_get.c0000664000175100017510000010717112456571574015470 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2004 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include "indirect_size_get.h" #include "glxserver.h" #include "indirect_util.h" #include "indirect_size.h" #if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) #define PURE __attribute__((pure)) #else #define PURE #endif #if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) #define FASTCALL __attribute__((fastcall)) #else #define FASTCALL #endif #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(GLX_USE_APPLEGL) #undef HAVE_ALIAS #endif #ifdef HAVE_ALIAS #define ALIAS2(from,to) \ _X_INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \ __attribute__ ((alias( # to ))); #define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size ) #else #define ALIAS(from,to) \ _X_INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \ { return __gl ## to ## _size( e ); } #endif _X_INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum e) { switch (e) { case GL_BYTE: case GL_UNSIGNED_BYTE: return 1; case GL_SHORT: case GL_UNSIGNED_SHORT: case GL_2_BYTES: case GL_HALF_FLOAT: return 2; case GL_3_BYTES: return 3; case GL_INT: case GL_UNSIGNED_INT: case GL_FLOAT: case GL_4_BYTES: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum e) { switch (e) { case GL_FOG_INDEX: case GL_FOG_DENSITY: case GL_FOG_START: case GL_FOG_END: case GL_FOG_MODE: case GL_FOG_OFFSET_VALUE_SGIX: case GL_FOG_DISTANCE_MODE_NV: return 1; case GL_FOG_COLOR: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum e) { switch (e) { case GL_SPOT_EXPONENT: case GL_SPOT_CUTOFF: case GL_CONSTANT_ATTENUATION: case GL_LINEAR_ATTENUATION: case GL_QUADRATIC_ATTENUATION: return 1; case GL_SPOT_DIRECTION: return 3; case GL_AMBIENT: case GL_DIFFUSE: case GL_SPECULAR: case GL_POSITION: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum e) { switch (e) { case GL_LIGHT_MODEL_LOCAL_VIEWER: case GL_LIGHT_MODEL_TWO_SIDE: case GL_LIGHT_MODEL_COLOR_CONTROL: /* case GL_LIGHT_MODEL_COLOR_CONTROL_EXT:*/ return 1; case GL_LIGHT_MODEL_AMBIENT: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum e) { switch (e) { case GL_SHININESS: return 1; case GL_COLOR_INDEXES: return 3; case GL_AMBIENT: case GL_DIFFUSE: case GL_SPECULAR: case GL_EMISSION: case GL_AMBIENT_AND_DIFFUSE: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum e) { switch (e) { case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: case GL_TEXTURE_PRIORITY: case GL_TEXTURE_WRAP_R: case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: /* case GL_SHADOW_AMBIENT_SGIX:*/ case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: case GL_TEXTURE_CLIPMAP_FRAME_SGIX: case GL_TEXTURE_LOD_BIAS_S_SGIX: case GL_TEXTURE_LOD_BIAS_T_SGIX: case GL_TEXTURE_LOD_BIAS_R_SGIX: case GL_GENERATE_MIPMAP: /* case GL_GENERATE_MIPMAP_SGIS:*/ case GL_TEXTURE_COMPARE_SGIX: case GL_TEXTURE_COMPARE_OPERATOR_SGIX: case GL_TEXTURE_MAX_CLAMP_S_SGIX: case GL_TEXTURE_MAX_CLAMP_T_SGIX: case GL_TEXTURE_MAX_CLAMP_R_SGIX: case GL_TEXTURE_MAX_ANISOTROPY_EXT: case GL_TEXTURE_LOD_BIAS: /* case GL_TEXTURE_LOD_BIAS_EXT:*/ case GL_TEXTURE_STORAGE_HINT_APPLE: case GL_STORAGE_PRIVATE_APPLE: case GL_STORAGE_CACHED_APPLE: case GL_STORAGE_SHARED_APPLE: case GL_DEPTH_TEXTURE_MODE: /* case GL_DEPTH_TEXTURE_MODE_ARB:*/ case GL_TEXTURE_COMPARE_MODE: /* case GL_TEXTURE_COMPARE_MODE_ARB:*/ case GL_TEXTURE_COMPARE_FUNC: /* case GL_TEXTURE_COMPARE_FUNC_ARB:*/ case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: return 1; case GL_TEXTURE_CLIPMAP_CENTER_SGIX: case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: return 2; case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: return 3; case GL_TEXTURE_BORDER_COLOR: case GL_POST_TEXTURE_FILTER_BIAS_SGIX: case GL_POST_TEXTURE_FILTER_SCALE_SGIX: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum e) { switch (e) { case GL_ALPHA_SCALE: case GL_TEXTURE_ENV_MODE: case GL_TEXTURE_LOD_BIAS: case GL_COMBINE_RGB: case GL_COMBINE_ALPHA: case GL_RGB_SCALE: case GL_SOURCE0_RGB: case GL_SOURCE1_RGB: case GL_SOURCE2_RGB: case GL_SOURCE3_RGB_NV: case GL_SOURCE0_ALPHA: case GL_SOURCE1_ALPHA: case GL_SOURCE2_ALPHA: case GL_SOURCE3_ALPHA_NV: case GL_OPERAND0_RGB: case GL_OPERAND1_RGB: case GL_OPERAND2_RGB: case GL_OPERAND3_RGB_NV: case GL_OPERAND0_ALPHA: case GL_OPERAND1_ALPHA: case GL_OPERAND2_ALPHA: case GL_OPERAND3_ALPHA_NV: case GL_BUMP_TARGET_ATI: case GL_COORD_REPLACE_ARB: /* case GL_COORD_REPLACE_NV:*/ return 1; case GL_TEXTURE_ENV_COLOR: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum e) { switch (e) { case GL_TEXTURE_GEN_MODE: return 1; case GL_OBJECT_PLANE: case GL_EYE_PLANE: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum e) { switch (e) { case GL_MAP1_INDEX: case GL_MAP1_TEXTURE_COORD_1: return 1; case GL_MAP1_TEXTURE_COORD_2: return 2; case GL_MAP1_NORMAL: case GL_MAP1_TEXTURE_COORD_3: case GL_MAP1_VERTEX_3: return 3; case GL_MAP1_COLOR_4: case GL_MAP1_TEXTURE_COORD_4: case GL_MAP1_VERTEX_4: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum e) { switch (e) { case GL_MAP2_INDEX: case GL_MAP2_TEXTURE_COORD_1: return 1; case GL_MAP2_TEXTURE_COORD_2: return 2; case GL_MAP2_NORMAL: case GL_MAP2_TEXTURE_COORD_3: case GL_MAP2_VERTEX_3: return 3; case GL_MAP2_COLOR_4: case GL_MAP2_TEXTURE_COORD_4: case GL_MAP2_VERTEX_4: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum e) { switch (e) { case GL_CURRENT_INDEX: case GL_CURRENT_RASTER_INDEX: case GL_CURRENT_RASTER_POSITION_VALID: case GL_CURRENT_RASTER_DISTANCE: case GL_POINT_SMOOTH: case GL_POINT_SIZE: case GL_SMOOTH_POINT_SIZE_GRANULARITY: case GL_LINE_SMOOTH: case GL_LINE_WIDTH: case GL_LINE_WIDTH_GRANULARITY: case GL_LINE_STIPPLE: case GL_LINE_STIPPLE_PATTERN: case GL_LINE_STIPPLE_REPEAT: case GL_LIST_MODE: case GL_MAX_LIST_NESTING: case GL_LIST_BASE: case GL_LIST_INDEX: case GL_POLYGON_SMOOTH: case GL_POLYGON_STIPPLE: case GL_EDGE_FLAG: case GL_CULL_FACE: case GL_CULL_FACE_MODE: case GL_FRONT_FACE: case GL_LIGHTING: case GL_LIGHT_MODEL_LOCAL_VIEWER: case GL_LIGHT_MODEL_TWO_SIDE: case GL_SHADE_MODEL: case GL_COLOR_MATERIAL_FACE: case GL_COLOR_MATERIAL_PARAMETER: case GL_COLOR_MATERIAL: case GL_FOG: case GL_FOG_INDEX: case GL_FOG_DENSITY: case GL_FOG_START: case GL_FOG_END: case GL_FOG_MODE: case GL_DEPTH_TEST: case GL_DEPTH_WRITEMASK: case GL_DEPTH_CLEAR_VALUE: case GL_DEPTH_FUNC: case GL_STENCIL_TEST: case GL_STENCIL_CLEAR_VALUE: case GL_STENCIL_FUNC: case GL_STENCIL_VALUE_MASK: case GL_STENCIL_FAIL: case GL_STENCIL_PASS_DEPTH_FAIL: case GL_STENCIL_PASS_DEPTH_PASS: case GL_STENCIL_REF: case GL_STENCIL_WRITEMASK: case GL_MATRIX_MODE: case GL_NORMALIZE: case GL_MODELVIEW_STACK_DEPTH: case GL_PROJECTION_STACK_DEPTH: case GL_TEXTURE_STACK_DEPTH: case GL_ATTRIB_STACK_DEPTH: case GL_CLIENT_ATTRIB_STACK_DEPTH: case GL_ALPHA_TEST: case GL_ALPHA_TEST_FUNC: case GL_ALPHA_TEST_REF: case GL_DITHER: case GL_BLEND_DST: case GL_BLEND_SRC: case GL_BLEND: case GL_LOGIC_OP_MODE: case GL_LOGIC_OP: case GL_AUX_BUFFERS: case GL_DRAW_BUFFER: case GL_READ_BUFFER: case GL_SCISSOR_TEST: case GL_INDEX_CLEAR_VALUE: case GL_INDEX_WRITEMASK: case GL_INDEX_MODE: case GL_RGBA_MODE: case GL_DOUBLEBUFFER: case GL_STEREO: case GL_RENDER_MODE: case GL_PERSPECTIVE_CORRECTION_HINT: case GL_POINT_SMOOTH_HINT: case GL_LINE_SMOOTH_HINT: case GL_POLYGON_SMOOTH_HINT: case GL_FOG_HINT: case GL_TEXTURE_GEN_S: case GL_TEXTURE_GEN_T: case GL_TEXTURE_GEN_R: case GL_TEXTURE_GEN_Q: case GL_PIXEL_MAP_I_TO_I: case GL_PIXEL_MAP_I_TO_I_SIZE: case GL_PIXEL_MAP_S_TO_S_SIZE: case GL_PIXEL_MAP_I_TO_R_SIZE: case GL_PIXEL_MAP_I_TO_G_SIZE: case GL_PIXEL_MAP_I_TO_B_SIZE: case GL_PIXEL_MAP_I_TO_A_SIZE: case GL_PIXEL_MAP_R_TO_R_SIZE: case GL_PIXEL_MAP_G_TO_G_SIZE: case GL_PIXEL_MAP_B_TO_B_SIZE: case GL_PIXEL_MAP_A_TO_A_SIZE: case GL_UNPACK_SWAP_BYTES: case GL_UNPACK_LSB_FIRST: case GL_UNPACK_ROW_LENGTH: case GL_UNPACK_SKIP_ROWS: case GL_UNPACK_SKIP_PIXELS: case GL_UNPACK_ALIGNMENT: case GL_PACK_SWAP_BYTES: case GL_PACK_LSB_FIRST: case GL_PACK_ROW_LENGTH: case GL_PACK_SKIP_ROWS: case GL_PACK_SKIP_PIXELS: case GL_PACK_ALIGNMENT: case GL_MAP_COLOR: case GL_MAP_STENCIL: case GL_INDEX_SHIFT: case GL_INDEX_OFFSET: case GL_RED_SCALE: case GL_RED_BIAS: case GL_ZOOM_X: case GL_ZOOM_Y: case GL_GREEN_SCALE: case GL_GREEN_BIAS: case GL_BLUE_SCALE: case GL_BLUE_BIAS: case GL_ALPHA_SCALE: case GL_ALPHA_BIAS: case GL_DEPTH_SCALE: case GL_DEPTH_BIAS: case GL_MAX_EVAL_ORDER: case GL_MAX_LIGHTS: case GL_MAX_CLIP_PLANES: case GL_MAX_TEXTURE_SIZE: case GL_MAX_PIXEL_MAP_TABLE: case GL_MAX_ATTRIB_STACK_DEPTH: case GL_MAX_MODELVIEW_STACK_DEPTH: case GL_MAX_NAME_STACK_DEPTH: case GL_MAX_PROJECTION_STACK_DEPTH: case GL_MAX_TEXTURE_STACK_DEPTH: case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: case GL_SUBPIXEL_BITS: case GL_INDEX_BITS: case GL_RED_BITS: case GL_GREEN_BITS: case GL_BLUE_BITS: case GL_ALPHA_BITS: case GL_DEPTH_BITS: case GL_STENCIL_BITS: case GL_ACCUM_RED_BITS: case GL_ACCUM_GREEN_BITS: case GL_ACCUM_BLUE_BITS: case GL_ACCUM_ALPHA_BITS: case GL_NAME_STACK_DEPTH: case GL_AUTO_NORMAL: case GL_MAP1_COLOR_4: case GL_MAP1_INDEX: case GL_MAP1_NORMAL: case GL_MAP1_TEXTURE_COORD_1: case GL_MAP1_TEXTURE_COORD_2: case GL_MAP1_TEXTURE_COORD_3: case GL_MAP1_TEXTURE_COORD_4: case GL_MAP1_VERTEX_3: case GL_MAP1_VERTEX_4: case GL_MAP2_COLOR_4: case GL_MAP2_INDEX: case GL_MAP2_NORMAL: case GL_MAP2_TEXTURE_COORD_1: case GL_MAP2_TEXTURE_COORD_2: case GL_MAP2_TEXTURE_COORD_3: case GL_MAP2_TEXTURE_COORD_4: case GL_MAP2_VERTEX_3: case GL_MAP2_VERTEX_4: case GL_MAP1_GRID_SEGMENTS: case GL_TEXTURE_1D: case GL_TEXTURE_2D: case GL_POLYGON_OFFSET_UNITS: case GL_CLIP_PLANE0: case GL_CLIP_PLANE1: case GL_CLIP_PLANE2: case GL_CLIP_PLANE3: case GL_CLIP_PLANE4: case GL_CLIP_PLANE5: case GL_LIGHT0: case GL_LIGHT1: case GL_LIGHT2: case GL_LIGHT3: case GL_LIGHT4: case GL_LIGHT5: case GL_LIGHT6: case GL_LIGHT7: case GL_BLEND_EQUATION: /* case GL_BLEND_EQUATION_EXT:*/ case GL_CONVOLUTION_1D: case GL_CONVOLUTION_2D: case GL_SEPARABLE_2D: case GL_MAX_CONVOLUTION_WIDTH: /* case GL_MAX_CONVOLUTION_WIDTH_EXT:*/ case GL_MAX_CONVOLUTION_HEIGHT: /* case GL_MAX_CONVOLUTION_HEIGHT_EXT:*/ case GL_POST_CONVOLUTION_RED_SCALE: /* case GL_POST_CONVOLUTION_RED_SCALE_EXT:*/ case GL_POST_CONVOLUTION_GREEN_SCALE: /* case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:*/ case GL_POST_CONVOLUTION_BLUE_SCALE: /* case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:*/ case GL_POST_CONVOLUTION_ALPHA_SCALE: /* case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:*/ case GL_POST_CONVOLUTION_RED_BIAS: /* case GL_POST_CONVOLUTION_RED_BIAS_EXT:*/ case GL_POST_CONVOLUTION_GREEN_BIAS: /* case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:*/ case GL_POST_CONVOLUTION_BLUE_BIAS: /* case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:*/ case GL_POST_CONVOLUTION_ALPHA_BIAS: /* case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:*/ case GL_HISTOGRAM: case GL_MINMAX: case GL_POLYGON_OFFSET_FACTOR: case GL_RESCALE_NORMAL: /* case GL_RESCALE_NORMAL_EXT:*/ case GL_TEXTURE_BINDING_1D: case GL_TEXTURE_BINDING_2D: case GL_TEXTURE_BINDING_3D: case GL_PACK_SKIP_IMAGES: case GL_PACK_IMAGE_HEIGHT: case GL_UNPACK_SKIP_IMAGES: case GL_UNPACK_IMAGE_HEIGHT: case GL_TEXTURE_3D: case GL_MAX_3D_TEXTURE_SIZE: case GL_VERTEX_ARRAY: case GL_NORMAL_ARRAY: case GL_COLOR_ARRAY: case GL_INDEX_ARRAY: case GL_TEXTURE_COORD_ARRAY: case GL_EDGE_FLAG_ARRAY: case GL_VERTEX_ARRAY_SIZE: case GL_VERTEX_ARRAY_TYPE: case GL_VERTEX_ARRAY_STRIDE: case GL_NORMAL_ARRAY_TYPE: case GL_NORMAL_ARRAY_STRIDE: case GL_COLOR_ARRAY_SIZE: case GL_COLOR_ARRAY_TYPE: case GL_COLOR_ARRAY_STRIDE: case GL_INDEX_ARRAY_TYPE: case GL_INDEX_ARRAY_STRIDE: case GL_TEXTURE_COORD_ARRAY_SIZE: case GL_TEXTURE_COORD_ARRAY_TYPE: case GL_TEXTURE_COORD_ARRAY_STRIDE: case GL_EDGE_FLAG_ARRAY_STRIDE: case GL_MULTISAMPLE: /* case GL_MULTISAMPLE_ARB:*/ case GL_SAMPLE_ALPHA_TO_COVERAGE: /* case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:*/ case GL_SAMPLE_ALPHA_TO_ONE: /* case GL_SAMPLE_ALPHA_TO_ONE_ARB:*/ case GL_SAMPLE_COVERAGE: /* case GL_SAMPLE_COVERAGE_ARB:*/ case GL_SAMPLE_BUFFERS: /* case GL_SAMPLE_BUFFERS_ARB:*/ case GL_SAMPLES: /* case GL_SAMPLES_ARB:*/ case GL_SAMPLE_COVERAGE_VALUE: /* case GL_SAMPLE_COVERAGE_VALUE_ARB:*/ case GL_SAMPLE_COVERAGE_INVERT: /* case GL_SAMPLE_COVERAGE_INVERT_ARB:*/ case GL_COLOR_MATRIX_STACK_DEPTH: case GL_MAX_COLOR_MATRIX_STACK_DEPTH: case GL_POST_COLOR_MATRIX_RED_SCALE: case GL_POST_COLOR_MATRIX_GREEN_SCALE: case GL_POST_COLOR_MATRIX_BLUE_SCALE: case GL_POST_COLOR_MATRIX_ALPHA_SCALE: case GL_POST_COLOR_MATRIX_RED_BIAS: case GL_POST_COLOR_MATRIX_GREEN_BIAS: case GL_POST_COLOR_MATRIX_BLUE_BIAS: case GL_POST_COLOR_MATRIX_ALPHA_BIAS: case GL_BLEND_DST_RGB: case GL_BLEND_SRC_RGB: case GL_BLEND_DST_ALPHA: case GL_BLEND_SRC_ALPHA: case GL_COLOR_TABLE: case GL_POST_CONVOLUTION_COLOR_TABLE: case GL_POST_COLOR_MATRIX_COLOR_TABLE: case GL_MAX_ELEMENTS_VERTICES: case GL_MAX_ELEMENTS_INDICES: case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: case GL_POINT_SIZE_MIN: case GL_POINT_SIZE_MAX: case GL_POINT_FADE_THRESHOLD_SIZE: case GL_OCCLUSION_TEST_HP: case GL_OCCLUSION_TEST_RESULT_HP: case GL_LIGHT_MODEL_COLOR_CONTROL: case GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB: case GL_RESET_NOTIFICATION_STRATEGY_ARB: case GL_CURRENT_FOG_COORD: case GL_FOG_COORDINATE_ARRAY_TYPE: case GL_FOG_COORDINATE_ARRAY_STRIDE: case GL_FOG_COORD_ARRAY: case GL_COLOR_SUM_ARB: case GL_SECONDARY_COLOR_ARRAY_SIZE: case GL_SECONDARY_COLOR_ARRAY_TYPE: case GL_SECONDARY_COLOR_ARRAY_STRIDE: case GL_SECONDARY_COLOR_ARRAY: case GL_ACTIVE_TEXTURE: /* case GL_ACTIVE_TEXTURE_ARB:*/ case GL_CLIENT_ACTIVE_TEXTURE: /* case GL_CLIENT_ACTIVE_TEXTURE_ARB:*/ case GL_MAX_TEXTURE_UNITS: /* case GL_MAX_TEXTURE_UNITS_ARB:*/ case GL_MAX_RENDERBUFFER_SIZE: /* case GL_MAX_RENDERBUFFER_SIZE_EXT:*/ case GL_TEXTURE_COMPRESSION_HINT: /* case GL_TEXTURE_COMPRESSION_HINT_ARB:*/ case GL_TEXTURE_RECTANGLE_ARB: /* case GL_TEXTURE_RECTANGLE_NV:*/ case GL_TEXTURE_BINDING_RECTANGLE_ARB: /* case GL_TEXTURE_BINDING_RECTANGLE_NV:*/ case GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB: /* case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:*/ case GL_MAX_TEXTURE_LOD_BIAS: case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: case GL_MAX_SHININESS_NV: case GL_MAX_SPOT_EXPONENT_NV: case GL_TEXTURE_CUBE_MAP: /* case GL_TEXTURE_CUBE_MAP_ARB:*/ case GL_TEXTURE_BINDING_CUBE_MAP: /* case GL_TEXTURE_BINDING_CUBE_MAP_ARB:*/ case GL_MAX_CUBE_MAP_TEXTURE_SIZE: /* case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:*/ case GL_MULTISAMPLE_FILTER_HINT_NV: case GL_FOG_DISTANCE_MODE_NV: case GL_VERTEX_PROGRAM_ARB: case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: case GL_MAX_PROGRAM_MATRICES_ARB: case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: case GL_PROGRAM_ERROR_POSITION_ARB: case GL_DEPTH_CLAMP: /* case GL_DEPTH_CLAMP_NV:*/ case GL_NUM_COMPRESSED_TEXTURE_FORMATS: /* case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:*/ case GL_MAX_VERTEX_UNITS_ARB: case GL_ACTIVE_VERTEX_UNITS_ARB: case GL_WEIGHT_SUM_UNITY_ARB: case GL_VERTEX_BLEND_ARB: case GL_CURRENT_WEIGHT_ARB: case GL_WEIGHT_ARRAY_TYPE_ARB: case GL_WEIGHT_ARRAY_STRIDE_ARB: case GL_WEIGHT_ARRAY_SIZE_ARB: case GL_WEIGHT_ARRAY_ARB: case GL_PACK_INVERT_MESA: case GL_STENCIL_BACK_FUNC_ATI: case GL_STENCIL_BACK_FAIL_ATI: case GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI: case GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI: case GL_FRAGMENT_PROGRAM_ARB: case GL_MAX_DRAW_BUFFERS_ARB: /* case GL_MAX_DRAW_BUFFERS_ATI:*/ case GL_DRAW_BUFFER0_ARB: /* case GL_DRAW_BUFFER0_ATI:*/ case GL_DRAW_BUFFER1_ARB: /* case GL_DRAW_BUFFER1_ATI:*/ case GL_DRAW_BUFFER2_ARB: /* case GL_DRAW_BUFFER2_ATI:*/ case GL_DRAW_BUFFER3_ARB: /* case GL_DRAW_BUFFER3_ATI:*/ case GL_DRAW_BUFFER4_ARB: /* case GL_DRAW_BUFFER4_ATI:*/ case GL_DRAW_BUFFER5_ARB: /* case GL_DRAW_BUFFER5_ATI:*/ case GL_DRAW_BUFFER6_ARB: /* case GL_DRAW_BUFFER6_ATI:*/ case GL_DRAW_BUFFER7_ARB: /* case GL_DRAW_BUFFER7_ATI:*/ case GL_DRAW_BUFFER8_ARB: /* case GL_DRAW_BUFFER8_ATI:*/ case GL_DRAW_BUFFER9_ARB: /* case GL_DRAW_BUFFER9_ATI:*/ case GL_DRAW_BUFFER10_ARB: /* case GL_DRAW_BUFFER10_ATI:*/ case GL_DRAW_BUFFER11_ARB: /* case GL_DRAW_BUFFER11_ATI:*/ case GL_DRAW_BUFFER12_ARB: /* case GL_DRAW_BUFFER12_ATI:*/ case GL_DRAW_BUFFER13_ARB: /* case GL_DRAW_BUFFER13_ATI:*/ case GL_DRAW_BUFFER14_ARB: /* case GL_DRAW_BUFFER14_ATI:*/ case GL_DRAW_BUFFER15_ARB: /* case GL_DRAW_BUFFER15_ATI:*/ case GL_BLEND_EQUATION_ALPHA_EXT: case GL_MATRIX_PALETTE_ARB: case GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB: case GL_MAX_PALETTE_MATRICES_ARB: case GL_CURRENT_PALETTE_MATRIX_ARB: case GL_MATRIX_INDEX_ARRAY_ARB: case GL_CURRENT_MATRIX_INDEX_ARB: case GL_MATRIX_INDEX_ARRAY_SIZE_ARB: case GL_MATRIX_INDEX_ARRAY_TYPE_ARB: case GL_MATRIX_INDEX_ARRAY_STRIDE_ARB: case GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT: case GL_TEXTURE_CUBE_MAP_SEAMLESS: case GL_POINT_SPRITE_ARB: /* case GL_POINT_SPRITE_NV:*/ case GL_POINT_SPRITE_R_MODE_NV: case GL_MAX_VERTEX_ATTRIBS_ARB: case GL_MAX_TEXTURE_COORDS_ARB: case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: case GL_DEPTH_BOUNDS_TEST_EXT: case GL_ARRAY_BUFFER_BINDING_ARB: case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT: case GL_STENCIL_TEST_TWO_SIDE_EXT: case GL_ACTIVE_STENCIL_FACE_EXT: case GL_SAMPLER_BINDING: case GL_TEXTURE_BINDING_1D_ARRAY_EXT: case GL_TEXTURE_BINDING_2D_ARRAY_EXT: case GL_FRAMEBUFFER_BINDING: /* case GL_DRAW_FRAMEBUFFER_BINDING_EXT:*/ case GL_RENDERBUFFER_BINDING: /* case GL_RENDERBUFFER_BINDING_EXT:*/ case GL_READ_FRAMEBUFFER_BINDING: /* case GL_READ_FRAMEBUFFER_BINDING_EXT:*/ case GL_MAX_COLOR_ATTACHMENTS: /* case GL_MAX_COLOR_ATTACHMENTS_EXT:*/ case GL_MAX_SAMPLES: /* case GL_MAX_SAMPLES_EXT:*/ case GL_MAX_SERVER_WAIT_TIMEOUT: case GL_MAX_DEBUG_MESSAGE_LENGTH_ARB: case GL_MAX_DEBUG_LOGGED_MESSAGES_ARB: case GL_DEBUG_LOGGED_MESSAGES_ARB: case GL_RASTER_POSITION_UNCLIPPED_IBM: return 1; case GL_SMOOTH_POINT_SIZE_RANGE: case GL_LINE_WIDTH_RANGE: case GL_POLYGON_MODE: case GL_DEPTH_RANGE: case GL_MAX_VIEWPORT_DIMS: case GL_MAP1_GRID_DOMAIN: case GL_MAP2_GRID_SEGMENTS: case GL_ALIASED_POINT_SIZE_RANGE: case GL_ALIASED_LINE_WIDTH_RANGE: case GL_DEPTH_BOUNDS_EXT: return 2; case GL_CURRENT_NORMAL: case GL_POINT_DISTANCE_ATTENUATION: return 3; case GL_CURRENT_COLOR: case GL_CURRENT_TEXTURE_COORDS: case GL_CURRENT_RASTER_COLOR: case GL_CURRENT_RASTER_TEXTURE_COORDS: case GL_CURRENT_RASTER_POSITION: case GL_LIGHT_MODEL_AMBIENT: case GL_FOG_COLOR: case GL_ACCUM_CLEAR_VALUE: case GL_VIEWPORT: case GL_SCISSOR_BOX: case GL_COLOR_CLEAR_VALUE: case GL_COLOR_WRITEMASK: case GL_MAP2_GRID_DOMAIN: case GL_BLEND_COLOR: /* case GL_BLEND_COLOR_EXT:*/ case GL_CURRENT_SECONDARY_COLOR: return 4; case GL_MODELVIEW_MATRIX: case GL_PROJECTION_MATRIX: case GL_TEXTURE_MATRIX: case GL_MODELVIEW0_ARB: case GL_COLOR_MATRIX: case GL_MODELVIEW1_ARB: case GL_CURRENT_MATRIX_ARB: case GL_MODELVIEW2_ARB: case GL_MODELVIEW3_ARB: case GL_MODELVIEW4_ARB: case GL_MODELVIEW5_ARB: case GL_MODELVIEW6_ARB: case GL_MODELVIEW7_ARB: case GL_MODELVIEW8_ARB: case GL_MODELVIEW9_ARB: case GL_MODELVIEW10_ARB: case GL_MODELVIEW11_ARB: case GL_MODELVIEW12_ARB: case GL_MODELVIEW13_ARB: case GL_MODELVIEW14_ARB: case GL_MODELVIEW15_ARB: case GL_MODELVIEW16_ARB: case GL_MODELVIEW17_ARB: case GL_MODELVIEW18_ARB: case GL_MODELVIEW19_ARB: case GL_MODELVIEW20_ARB: case GL_MODELVIEW21_ARB: case GL_MODELVIEW22_ARB: case GL_MODELVIEW23_ARB: case GL_MODELVIEW24_ARB: case GL_MODELVIEW25_ARB: case GL_MODELVIEW26_ARB: case GL_MODELVIEW27_ARB: case GL_MODELVIEW28_ARB: case GL_MODELVIEW29_ARB: case GL_MODELVIEW30_ARB: case GL_MODELVIEW31_ARB: case GL_TRANSPOSE_CURRENT_MATRIX_ARB: return 16; case GL_FOG_COORDINATE_SOURCE: case GL_COMPRESSED_TEXTURE_FORMATS: case GL_RGBA_INTEGER_MODE_EXT: return __glGetBooleanv_variable_size(e); default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum e) { switch (e) { case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: case GL_TEXTURE_PRIORITY: case GL_TEXTURE_RESIDENT: case GL_TEXTURE_WRAP_R: case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: /* case GL_SHADOW_AMBIENT_SGIX:*/ case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: case GL_TEXTURE_CLIPMAP_FRAME_SGIX: case GL_TEXTURE_LOD_BIAS_S_SGIX: case GL_TEXTURE_LOD_BIAS_T_SGIX: case GL_TEXTURE_LOD_BIAS_R_SGIX: case GL_GENERATE_MIPMAP: /* case GL_GENERATE_MIPMAP_SGIS:*/ case GL_TEXTURE_COMPARE_SGIX: case GL_TEXTURE_COMPARE_OPERATOR_SGIX: case GL_TEXTURE_MAX_CLAMP_S_SGIX: case GL_TEXTURE_MAX_CLAMP_T_SGIX: case GL_TEXTURE_MAX_CLAMP_R_SGIX: case GL_TEXTURE_MAX_ANISOTROPY_EXT: case GL_TEXTURE_LOD_BIAS: /* case GL_TEXTURE_LOD_BIAS_EXT:*/ case GL_TEXTURE_RANGE_LENGTH_APPLE: case GL_TEXTURE_STORAGE_HINT_APPLE: case GL_DEPTH_TEXTURE_MODE: /* case GL_DEPTH_TEXTURE_MODE_ARB:*/ case GL_TEXTURE_COMPARE_MODE: /* case GL_TEXTURE_COMPARE_MODE_ARB:*/ case GL_TEXTURE_COMPARE_FUNC: /* case GL_TEXTURE_COMPARE_FUNC_ARB:*/ case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: return 1; case GL_TEXTURE_CLIPMAP_CENTER_SGIX: case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: return 2; case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: return 3; case GL_TEXTURE_BORDER_COLOR: case GL_POST_TEXTURE_FILTER_BIAS_SGIX: case GL_POST_TEXTURE_FILTER_SCALE_SGIX: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum e) { switch (e) { case GL_TEXTURE_WIDTH: case GL_TEXTURE_HEIGHT: case GL_TEXTURE_COMPONENTS: case GL_TEXTURE_BORDER: case GL_TEXTURE_RED_SIZE: /* case GL_TEXTURE_RED_SIZE_EXT:*/ case GL_TEXTURE_GREEN_SIZE: /* case GL_TEXTURE_GREEN_SIZE_EXT:*/ case GL_TEXTURE_BLUE_SIZE: /* case GL_TEXTURE_BLUE_SIZE_EXT:*/ case GL_TEXTURE_ALPHA_SIZE: /* case GL_TEXTURE_ALPHA_SIZE_EXT:*/ case GL_TEXTURE_LUMINANCE_SIZE: /* case GL_TEXTURE_LUMINANCE_SIZE_EXT:*/ case GL_TEXTURE_INTENSITY_SIZE: /* case GL_TEXTURE_INTENSITY_SIZE_EXT:*/ case GL_TEXTURE_DEPTH: case GL_TEXTURE_INDEX_SIZE_EXT: case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: /* case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:*/ case GL_TEXTURE_COMPRESSED: /* case GL_TEXTURE_COMPRESSED_ARB:*/ case GL_TEXTURE_DEPTH_SIZE: /* case GL_TEXTURE_DEPTH_SIZE_ARB:*/ case GL_TEXTURE_STENCIL_SIZE: /* case GL_TEXTURE_STENCIL_SIZE_EXT:*/ return 1; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetPointerv_size(GLenum e) { switch (e) { case GL_DEBUG_CALLBACK_FUNCTION_ARB: case GL_DEBUG_CALLBACK_USER_PARAM_ARB: return 1; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum e) { switch (e) { case GL_COLOR_TABLE_SCALE: case GL_COLOR_TABLE_BIAS: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum e) { switch (e) { case GL_COLOR_TABLE_FORMAT: /* case GL_COLOR_TABLE_FORMAT_EXT:*/ case GL_COLOR_TABLE_WIDTH: /* case GL_COLOR_TABLE_WIDTH_EXT:*/ case GL_COLOR_TABLE_RED_SIZE: /* case GL_COLOR_TABLE_RED_SIZE_EXT:*/ case GL_COLOR_TABLE_GREEN_SIZE: /* case GL_COLOR_TABLE_GREEN_SIZE_EXT:*/ case GL_COLOR_TABLE_BLUE_SIZE: /* case GL_COLOR_TABLE_BLUE_SIZE_EXT:*/ case GL_COLOR_TABLE_ALPHA_SIZE: /* case GL_COLOR_TABLE_ALPHA_SIZE_EXT:*/ case GL_COLOR_TABLE_LUMINANCE_SIZE: /* case GL_COLOR_TABLE_LUMINANCE_SIZE_EXT:*/ case GL_COLOR_TABLE_INTENSITY_SIZE: /* case GL_COLOR_TABLE_INTENSITY_SIZE_EXT:*/ return 1; case GL_COLOR_TABLE_SCALE: case GL_COLOR_TABLE_BIAS: return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum e) { switch (e) { case GL_CONVOLUTION_BORDER_MODE: /* case GL_CONVOLUTION_BORDER_MODE_EXT:*/ return 1; case GL_CONVOLUTION_FILTER_SCALE: /* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/ case GL_CONVOLUTION_FILTER_BIAS: /* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/ case GL_CONVOLUTION_BORDER_COLOR: /* case GL_CONVOLUTION_BORDER_COLOR_HP:*/ return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetConvolutionParameterfv_size(GLenum e) { switch (e) { case GL_CONVOLUTION_BORDER_MODE: /* case GL_CONVOLUTION_BORDER_MODE_EXT:*/ case GL_CONVOLUTION_FORMAT: /* case GL_CONVOLUTION_FORMAT_EXT:*/ case GL_CONVOLUTION_WIDTH: /* case GL_CONVOLUTION_WIDTH_EXT:*/ case GL_CONVOLUTION_HEIGHT: /* case GL_CONVOLUTION_HEIGHT_EXT:*/ case GL_MAX_CONVOLUTION_WIDTH: /* case GL_MAX_CONVOLUTION_WIDTH_EXT:*/ case GL_MAX_CONVOLUTION_HEIGHT: /* case GL_MAX_CONVOLUTION_HEIGHT_EXT:*/ return 1; case GL_CONVOLUTION_FILTER_SCALE: /* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/ case GL_CONVOLUTION_FILTER_BIAS: /* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/ case GL_CONVOLUTION_BORDER_COLOR: /* case GL_CONVOLUTION_BORDER_COLOR_HP:*/ return 4; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum e) { switch (e) { case GL_HISTOGRAM_WIDTH: case GL_HISTOGRAM_FORMAT: case GL_HISTOGRAM_RED_SIZE: case GL_HISTOGRAM_GREEN_SIZE: case GL_HISTOGRAM_BLUE_SIZE: case GL_HISTOGRAM_ALPHA_SIZE: case GL_HISTOGRAM_LUMINANCE_SIZE: case GL_HISTOGRAM_SINK: return 1; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum e) { switch (e) { case GL_MINMAX_FORMAT: case GL_MINMAX_SINK: return 1; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glPointParameterfv_size(GLenum e) { switch (e) { case GL_POINT_SIZE_MIN: /* case GL_POINT_SIZE_MIN_ARB:*/ /* case GL_POINT_SIZE_MIN_SGIS:*/ case GL_POINT_SIZE_MAX: /* case GL_POINT_SIZE_MAX_ARB:*/ /* case GL_POINT_SIZE_MAX_SGIS:*/ case GL_POINT_FADE_THRESHOLD_SIZE: /* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/ /* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/ case GL_POINT_SPRITE_R_MODE_NV: case GL_POINT_SPRITE_COORD_ORIGIN: return 1; case GL_POINT_DISTANCE_ATTENUATION: /* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/ /* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/ return 3; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectiv_size(GLenum e) { switch (e) { case GL_QUERY_RESULT_ARB: case GL_QUERY_RESULT_AVAILABLE_ARB: return 1; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetQueryiv_size(GLenum e) { switch (e) { case GL_QUERY_COUNTER_BITS_ARB: case GL_CURRENT_QUERY_ARB: case GL_ANY_SAMPLES_PASSED: return 1; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum e) { switch (e) { case GL_PROGRAM_LENGTH_ARB: case GL_PROGRAM_BINDING_ARB: case GL_PROGRAM_ALU_INSTRUCTIONS_ARB: case GL_PROGRAM_TEX_INSTRUCTIONS_ARB: case GL_PROGRAM_TEX_INDIRECTIONS_ARB: case GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: case GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: case GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: case GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB: case GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB: case GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB: case GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: case GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: case GL_PROGRAM_FORMAT_ARB: case GL_PROGRAM_INSTRUCTIONS_ARB: case GL_MAX_PROGRAM_INSTRUCTIONS_ARB: case GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB: case GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB: case GL_PROGRAM_TEMPORARIES_ARB: case GL_MAX_PROGRAM_TEMPORARIES_ARB: case GL_PROGRAM_NATIVE_TEMPORARIES_ARB: case GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB: case GL_PROGRAM_PARAMETERS_ARB: case GL_MAX_PROGRAM_PARAMETERS_ARB: case GL_PROGRAM_NATIVE_PARAMETERS_ARB: case GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB: case GL_PROGRAM_ATTRIBS_ARB: case GL_MAX_PROGRAM_ATTRIBS_ARB: case GL_PROGRAM_NATIVE_ATTRIBS_ARB: case GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB: case GL_PROGRAM_ADDRESS_REGISTERS_ARB: case GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB: case GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: case GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: case GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB: case GL_MAX_PROGRAM_ENV_PARAMETERS_ARB: case GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB: case GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV: case GL_MAX_PROGRAM_CALL_DEPTH_NV: case GL_MAX_PROGRAM_IF_DEPTH_NV: case GL_MAX_PROGRAM_LOOP_DEPTH_NV: case GL_MAX_PROGRAM_LOOP_COUNT_NV: return 1; default: return 0; } } _X_INTERNAL PURE FASTCALL GLint __glGetFramebufferAttachmentParameteriv_size(GLenum e) { switch (e) { case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: /* case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:*/ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: /* case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT:*/ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: /* case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT:*/ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: /* case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT:*/ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT: return 1; default: return 0; } } ALIAS(Fogiv, Fogfv) ALIAS(Lightiv, Lightfv) ALIAS(LightModeliv, LightModelfv) ALIAS(Materialiv, Materialfv) ALIAS(TexParameteriv, TexParameterfv) ALIAS(TexEnviv, TexEnvfv) ALIAS(TexGenfv, TexGendv) ALIAS(TexGeniv, TexGendv) ALIAS(Map1f, Map1d) ALIAS(Map2f, Map2d) ALIAS(GetDoublev, GetBooleanv) ALIAS(GetFloatv, GetBooleanv) ALIAS(GetIntegerv, GetBooleanv) ALIAS(GetLightfv, Lightfv) ALIAS(GetLightiv, Lightfv) ALIAS(GetMaterialfv, Materialfv) ALIAS(GetMaterialiv, Materialfv) ALIAS(GetTexEnvfv, TexEnvfv) ALIAS(GetTexEnviv, TexEnvfv) ALIAS(GetTexGendv, TexGendv) ALIAS(GetTexGenfv, TexGendv) ALIAS(GetTexGeniv, TexGendv) ALIAS(GetTexParameteriv, GetTexParameterfv) ALIAS(GetTexLevelParameteriv, GetTexLevelParameterfv) ALIAS(ColorTableParameteriv, ColorTableParameterfv) ALIAS(GetColorTableParameteriv, GetColorTableParameterfv) ALIAS(ConvolutionParameteriv, ConvolutionParameterfv) ALIAS(GetConvolutionParameteriv, GetConvolutionParameterfv) ALIAS(GetHistogramParameteriv, GetHistogramParameterfv) ALIAS(GetMinmaxParameteriv, GetMinmaxParameterfv) ALIAS(PointParameteriv, PointParameterfv) ALIAS(GetQueryObjectuiv, GetQueryObjectiv) #undef PURE #undef FASTCALL xorg-server-1.17.1/glx/indirect_texture_compression.c0000664000175100017510000001023012456571574017765 00000000000000/* * (C) Copyright IBM Corporation 2005, 2006 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "glxbyteorder.h" #include "glxext.h" #include "singlesize.h" #include "unpack.h" #include "indirect_size_get.h" #include "indirect_dispatch.h" int __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 8); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = *(GLenum *) (pc + 0); const GLint level = *(GLint *) (pc + 4); GLint compsize = 0; char *answer = NULL, answerBuffer[200]; glGetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize); if (compsize != 0) { PFNGLGETCOMPRESSEDTEXIMAGEARBPROC GetCompressedTexImageARB = __glGetProcAddress("glGetCompressedTexImageARB"); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); GetCompressedTexImageARB(target, level, answer); } if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } error = Success; } return error; } int __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_32(req->contextTag), &error); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 8); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0)); const GLint level = (GLint) bswap_32(*(int *) (pc + 4)); GLint compsize = 0; char *answer = NULL, answerBuffer[200]; glGetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize); if (compsize != 0) { PFNGLGETCOMPRESSEDTEXIMAGEARBPROC GetCompressedTexImageARB = __glGetProcAddress("glGetCompressedTexImageARB"); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); GetCompressedTexImageARB(target, level, answer); } if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } error = Success; } return error; } xorg-server-1.17.1/glx/createcontext.c0000664000175100017510000002741212274325511014627 00000000000000/* * Copyright © 2011 Intel Corporation * * 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 "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: case GLX_RGBA_FLOAT_TYPE_ARB: case GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT: return True; default: return False; } } int __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) { 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->currentClient = 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 __glXDispSwap_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) { return BadRequest; } xorg-server-1.17.1/glx/singlesize.c0000664000175100017510000001300012274325511014117 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "glxserver.h" #include "singlesize.h" #include "indirect_size_get.h" /* ** These routines compute the size of variable-size returned parameters. ** Unlike the similar routines that do the same thing for variable-size ** incoming parameters, the samplegl library itself doesn't use these routines. ** Hence, they are located here, in the GLX extension library. */ GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h) { return __glXImageSize(format, type, 0, w, h, 1, 0, 0, 0, 0, 4); } GLint __glGetMap_size(GLenum target, GLenum query) { GLint k, order = 0, majorMinor[2]; /* ** Assume target and query are both valid. */ switch (target) { case GL_MAP1_COLOR_4: case GL_MAP1_NORMAL: case GL_MAP1_INDEX: case GL_MAP1_TEXTURE_COORD_1: case GL_MAP1_TEXTURE_COORD_2: case GL_MAP1_TEXTURE_COORD_3: case GL_MAP1_TEXTURE_COORD_4: case GL_MAP1_VERTEX_3: case GL_MAP1_VERTEX_4: switch (query) { case GL_COEFF: k = __glMap1d_size(target); glGetMapiv(target, GL_ORDER, &order); /* ** The query above might fail, but then order will be zero anyway. */ return order * k; case GL_DOMAIN: return 2; case GL_ORDER: return 1; } break; case GL_MAP2_COLOR_4: case GL_MAP2_NORMAL: case GL_MAP2_INDEX: case GL_MAP2_TEXTURE_COORD_1: case GL_MAP2_TEXTURE_COORD_2: case GL_MAP2_TEXTURE_COORD_3: case GL_MAP2_TEXTURE_COORD_4: case GL_MAP2_VERTEX_3: case GL_MAP2_VERTEX_4: switch (query) { case GL_COEFF: k = __glMap2d_size(target); majorMinor[0] = majorMinor[1] = 0; glGetMapiv(target, GL_ORDER, majorMinor); /* ** The query above might fail, but then majorMinor will be zeroes */ return majorMinor[0] * majorMinor[1] * k; case GL_DOMAIN: return 4; case GL_ORDER: return 2; } break; } return -1; } GLint __glGetMapdv_size(GLenum target, GLenum query) { return __glGetMap_size(target, query); } GLint __glGetMapfv_size(GLenum target, GLenum query) { return __glGetMap_size(target, query); } GLint __glGetMapiv_size(GLenum target, GLenum query) { return __glGetMap_size(target, query); } GLint __glGetPixelMap_size(GLenum map) { GLint size; GLenum query; switch (map) { case GL_PIXEL_MAP_I_TO_I: query = GL_PIXEL_MAP_I_TO_I_SIZE; break; case GL_PIXEL_MAP_S_TO_S: query = GL_PIXEL_MAP_S_TO_S_SIZE; break; case GL_PIXEL_MAP_I_TO_R: query = GL_PIXEL_MAP_I_TO_R_SIZE; break; case GL_PIXEL_MAP_I_TO_G: query = GL_PIXEL_MAP_I_TO_G_SIZE; break; case GL_PIXEL_MAP_I_TO_B: query = GL_PIXEL_MAP_I_TO_B_SIZE; break; case GL_PIXEL_MAP_I_TO_A: query = GL_PIXEL_MAP_I_TO_A_SIZE; break; case GL_PIXEL_MAP_R_TO_R: query = GL_PIXEL_MAP_R_TO_R_SIZE; break; case GL_PIXEL_MAP_G_TO_G: query = GL_PIXEL_MAP_G_TO_G_SIZE; break; case GL_PIXEL_MAP_B_TO_B: query = GL_PIXEL_MAP_B_TO_B_SIZE; break; case GL_PIXEL_MAP_A_TO_A: query = GL_PIXEL_MAP_A_TO_A_SIZE; break; default: return -1; } glGetIntegerv(query, &size); return size; } GLint __glGetPixelMapfv_size(GLenum map) { return __glGetPixelMap_size(map); } GLint __glGetPixelMapuiv_size(GLenum map) { return __glGetPixelMap_size(map); } GLint __glGetPixelMapusv_size(GLenum map) { return __glGetPixelMap_size(map); } GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format, GLenum type, GLint width, GLint height, GLint depth) { return __glXImageSize(format, type, target, width, height, depth, 0, 0, 0, 0, 4); } xorg-server-1.17.1/glx/renderpix.c0000664000175100017510000000547012274325511013757 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "unpack.h" #include "indirect_dispatch.h" void __glXDisp_SeparableFilter2D(GLbyte * pc) { __GLXdispatchConvolutionFilterHeader *hdr = (__GLXdispatchConvolutionFilterHeader *) pc; GLint hdrlen, image1len; hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment); /* XXX check this usage - internal code called ** a version without the packing parameters */ image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1, 0, hdr->rowLength, 0, hdr->skipRows, hdr->alignment); image1len = __GLX_PAD(image1len); glSeparableFilter2D(hdr->target, hdr->internalformat, hdr->width, hdr->height, hdr->format, hdr->type, ((GLubyte *) hdr + hdrlen), ((GLubyte *) hdr + hdrlen + image1len)); } xorg-server-1.17.1/glx/indirect_dispatch.h0000664000175100017510000025422012456571574015461 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2005 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if !defined( _INDIRECT_DISPATCH_H_ ) #define _INDIRECT_DISPATCH_H_ #include struct __GLXclientStateRec; extern _X_HIDDEN void __glXDisp_MapGrid1d(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MapGrid1d(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MapGrid1f(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MapGrid1f(GLbyte * pc); extern _X_HIDDEN int __glXDisp_NewList(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_NewList(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_LoadIdentity(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LoadIdentity(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ConvolutionFilter1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ConvolutionFilter1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos3dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord1iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord1iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord4sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord4sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib3dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4ubvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4ubvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Histogram(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Histogram(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetMapfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMapfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_RasterPos4dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos4dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PolygonStipple(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PolygonStipple(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord1dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord1dv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Color3uiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3uiv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_IsEnabled(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsEnabled(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib4svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4svNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EvalCoord2fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalCoord2fv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_FramebufferTexture1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FramebufferTexture1D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetMapiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMapiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_SwapBuffers(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_SwapBuffers(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Indexubv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Indexubv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_Render(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_Render(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexImage3D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_MakeContextCurrent(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_MakeContextCurrent(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetFBConfigs(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetFBConfigs(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib1sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib1sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color3ubv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3ubv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex3dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_LightModeliv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LightModeliv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs1dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Normal3bv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Normal3bv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_VendorPrivate(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_VendorPrivate(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexGeniv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexGeniv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex3iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex3iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RenderbufferStorage(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RenderbufferStorage(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyConvolutionFilter1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyConvolutionFilter1D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GenQueries(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GenQueries(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BlendColor(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BlendColor(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CompressedTexImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CompressedTexImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Scalef(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Scalef(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Normal3iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Normal3iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PassThrough(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PassThrough(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Viewport(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Viewport(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyTexSubImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyTexSubImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_DepthRange(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DepthRange(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetQueryiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetQueryiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ResetHistogram(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ResetHistogram(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CompressedTexSubImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CompressedTexSubImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3uiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3uiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord2sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord2sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex4dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex4dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4Nbv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4Nbv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs2svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs2svNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetConvolutionParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetConvolutionParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetConvolutionParameterivEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetConvolutionParameterivEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Vertex2dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex2dv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetVisualConfigs(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetVisualConfigs(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_DeleteRenderbuffers(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DeleteRenderbuffers(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord1fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord3iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord3iv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CopyContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CopyContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib4usv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4usv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color3fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord4sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord4sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PointSize(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PointSize(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PopName(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PopName(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib2dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib2dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4Nusv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4Nusv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex4sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex4sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ClampColor(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ClampColor(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexEnvfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexEnvfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_LineStipple(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LineStipple(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexEnvi(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexEnvi(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetClipPlane(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetClipPlane(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttribs3dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs4fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs4fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Scaled(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Scaled(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CallLists(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CallLists(GLbyte * pc); extern _X_HIDDEN void __glXDisp_AlphaFunc(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_AlphaFunc(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord2iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord2iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Rotated(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Rotated(GLbyte * pc); extern _X_HIDDEN int __glXDisp_ReadPixels(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_ReadPixels(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_EdgeFlagv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EdgeFlagv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CompressedTexSubImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CompressedTexSubImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexParameterf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexParameterf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexParameteri(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexParameteri(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DestroyContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DestroyContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_DrawPixels(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DrawPixels(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord3sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GenLists(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GenLists(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_MapGrid2d(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MapGrid2d(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MapGrid2f(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MapGrid2f(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Scissor(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Scissor(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Fogf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Fogf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexSubImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexSubImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color4usv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4usv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Fogi(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Fogi(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos3iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos3iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PixelMapfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PixelMapfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color3usv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3usv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord2iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord2iv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Color3bv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3bv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib2fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib2fvARB(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetProgramLocalParameterfvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetProgramLocalParameterfvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ColorTable(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ColorTable(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Accum(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Accum(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexImage(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexImage(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ConvolutionFilter2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ConvolutionFilter2D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_Finish(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_Finish(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ClearStencil(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ClearStencil(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ConvolutionParameteriv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ConvolutionParameteriv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos2fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos2fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord1fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord1fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord4dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord4dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ProgramEnvParameter4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ProgramEnvParameter4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos4fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos4fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ClearIndex(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ClearIndex(GLbyte * pc); extern _X_HIDDEN void __glXDisp_LoadMatrixd(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LoadMatrixd(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PushMatrix(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PushMatrix(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ConvolutionParameterfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ConvolutionParameterfv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexGendv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexGendv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_EndList(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_EndList(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_EvalCoord1fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalCoord1fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EvalMesh2(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalMesh2(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex4fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex4fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs3fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs3fvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetProgramEnvParameterdvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetProgramEnvParameterdvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetFBConfigsSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetFBConfigsSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BindFramebuffer(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BindFramebuffer(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateNewContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateNewContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMinmax(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMinmax(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMinmaxEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMinmaxEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BlendFuncSeparate(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BlendFuncSeparate(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Normal3fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Normal3fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_End(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_End(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs3svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs3svNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs2dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateContextAttribsARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateContextAttribsARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BindTexture(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BindTexture(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib2sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib2sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexSubImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexSubImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexGenfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexGenfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_DrawBuffers(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DrawBuffers(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateContextWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateContextWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_CopySubBufferMESA(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CopySubBufferMESA(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BlendEquation(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BlendEquation(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetError(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetError(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexCoord3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord3dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Indexdv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Indexdv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PushName(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PushName(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib1dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib1dv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_IsRenderbuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsRenderbuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_DepthMask(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DepthMask(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color4iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_StencilOp(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_StencilOp(GLbyte * pc); extern _X_HIDDEN void __glXDisp_FramebufferTextureLayer(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FramebufferTextureLayer(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Ortho(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Ortho(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexEnvfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexEnvfv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_QueryServerString(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_QueryServerString(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_LoadMatrixf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LoadMatrixf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color4bv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4bv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib2fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib2fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DeleteLists(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DeleteLists(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_LogicOp(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LogicOp(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RenderbufferStorageMultisample(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RenderbufferStorageMultisample(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord4fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord4fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ActiveTexture(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ActiveTexture(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3bv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3bv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_WaitX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_WaitX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib1dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GenTextures(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GenTextures(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GenTexturesEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GenTexturesEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_RasterPos2sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos2sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color4ubv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4ubv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_DrawBuffer(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DrawBuffer(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord2fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord2fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord4iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord4iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord1sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord1sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_DepthFunc(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DepthFunc(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PixelMapusv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PixelMapusv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_BlendFunc(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BlendFunc(GLbyte * pc); extern _X_HIDDEN int __glXDisp_WaitGL(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_WaitGL(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_CompressedTexImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CompressedTexImage2D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_Flush(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_Flush(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Color4uiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4uiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord1sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord1sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos3sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PushAttrib(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PushAttrib(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexParameteriv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexParameteriv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_QueryExtensionsString(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_QueryExtensionsString(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_RasterPos3fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos3fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyTexSubImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyTexSubImage3D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetColorTable(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetColorTable(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetColorTableSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetColorTableSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Indexiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Indexiv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_CopyColorTable(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyColorTable(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PointParameterfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PointParameterfv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetHistogramParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetHistogramParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetHistogramParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetHistogramParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Frustum(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Frustum(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetString(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetString(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_CreateGLXPixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateGLXPixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexEnvf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexEnvf(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GenProgramsARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GenProgramsARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_DeleteTextures(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DeleteTextures(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_DeleteTexturesEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DeleteTexturesEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetTexLevelParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexLevelParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ClearAccum(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ClearAccum(GLbyte * pc); extern _X_HIDDEN int __glXDisp_QueryVersion(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_QueryVersion(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexCoord4iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord4iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_FramebufferTexture3D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FramebufferTexture3D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ColorTableParameteriv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ColorTableParameteriv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyTexImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyTexImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord2dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord2dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Lightfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Lightfv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetFramebufferAttachmentParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetFramebufferAttachmentParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ClearDepth(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ClearDepth(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ColorSubTable(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ColorSubTable(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color4fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4fv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreatePixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreatePixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Lightiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Lightiv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib3sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_IsQuery(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsQuery(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Rectdv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Rectdv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Materialiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Materialiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3fvEXT(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3fvEXT(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PolygonMode(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PolygonMode(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4Niv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4Niv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexGeni(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexGeni(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexGenf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexGenf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexGend(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexGend(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetPolygonStipple(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetPolygonStipple(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib2svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib2svNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs1fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs1fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib2dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DestroyWindow(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DestroyWindow(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Color4sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PixelZoom(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PixelZoom(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ColorTableParameterfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ColorTableParameterfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PixelMapuiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PixelMapuiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3dv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_IsTexture(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsTexture(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_IsTextureEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsTextureEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib4fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_BeginQuery(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BeginQuery(GLbyte * pc); extern _X_HIDDEN int __glXDisp_SetClientInfo2ARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_SetClientInfo2ARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMapdv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMapdv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_MultiTexCoord3iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord3iv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DestroyGLXPixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DestroyGLXPixmap(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_PixelStoref(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_PixelStoref(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_PrioritizeTextures(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PrioritizeTextures(GLbyte * pc); extern _X_HIDDEN int __glXDisp_PixelStorei(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_PixelStorei(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_DestroyGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DestroyGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_EvalCoord2dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalCoord2dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ColorMaterial(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ColorMaterial(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs1svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs1svNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetSeparableFilter(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetSeparableFilter(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetSeparableFilterEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetSeparableFilterEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_FeedbackBuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_FeedbackBuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_RasterPos2iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos2iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_FrontFace(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FrontFace(GLbyte * pc); extern _X_HIDDEN int __glXDisp_RenderLarge(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_RenderLarge(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_PolygonOffset(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PolygonOffset(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Normal3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Normal3dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Lightf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Lightf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MatrixMode(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MatrixMode(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetPixelMapusv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetPixelMapusv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Lighti(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Lighti(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GenFramebuffers(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GenFramebuffers(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_IsFramebuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsFramebuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_ChangeDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_ChangeDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BlendEquationSeparate(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BlendEquationSeparate(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreatePbuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreatePbuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetDoublev(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetDoublev(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_MultMatrixd(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultMatrixd(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultMatrixf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultMatrixf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CompressedTexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CompressedTexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos4sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos4sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib3fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib3fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ClearColor(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ClearColor(GLbyte * pc); extern _X_HIDDEN int __glXDisp_IsDirect(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsDirect(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib1svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib1svNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3ubv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3ubv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PointParameteri(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PointParameteri(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PointParameterf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PointParameterf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexEnviv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexEnviv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexSubImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexSubImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4iv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetColorTableParameterfvSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetColorTableParameterfvSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_FramebufferTexture2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FramebufferTexture2D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Bitmap(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Bitmap(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexLevelParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexLevelParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_CheckFramebufferStatus(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CheckFramebufferStatus(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Vertex2sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex2sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetIntegerv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetIntegerv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BindProgramARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BindProgramARB(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetProgramEnvParameterfvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetProgramEnvParameterfvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib3svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib3svNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexEnviv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexEnviv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_VendorPrivateWithReply(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_VendorPrivateWithReply(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_SeparableFilter2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SeparableFilter2D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetQueryObjectuiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetQueryObjectuiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Map1d(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Map1d(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Map1f(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Map1f(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexImage2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexImage2D(GLbyte * pc); extern _X_HIDDEN int __glXDisp_ChangeDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_ChangeDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMinmaxParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMinmaxParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMinmaxParameterivEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMinmaxParameterivEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_PixelTransferf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PixelTransferf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyTexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyTexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos2dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos2dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Fogiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Fogiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EndQuery(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EndQuery(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord1dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord1dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PixelTransferi(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PixelTransferi(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib3fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib3fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Clear(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Clear(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ReadBuffer(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ReadBuffer(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ConvolutionParameteri(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ConvolutionParameteri(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_LightModeli(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LightModeli(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ListBase(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ListBase(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ConvolutionParameterf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ConvolutionParameterf(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetColorTableParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetColorTableParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetColorTableParameterivSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetColorTableParameterivSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_ReleaseTexImageEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_ReleaseTexImageEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_CallList(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CallList(GLbyte * pc); extern _X_HIDDEN void __glXDisp_GenerateMipmap(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_GenerateMipmap(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Rectiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Rectiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord1iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord1iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex2fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex2fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex3sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetQueryObjectiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetQueryObjectiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_SetClientInfoARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_SetClientInfoARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_BindTexImageEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_BindTexImageEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ProgramLocalParameter4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ProgramLocalParameter4fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EvalMesh1(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalMesh1(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CompressedTexSubImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CompressedTexSubImage3D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex2iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex2iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_LineWidth(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LineWidth(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexGendv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexGendv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ResetMinmax(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ResetMinmax(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetConvolutionParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetConvolutionParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetConvolutionParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetConvolutionParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMaterialfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMaterialfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_WindowPos3fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_WindowPos3fv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DeleteProgramsARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DeleteProgramsARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_UseXFont(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_UseXFont(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ShadeModel(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ShadeModel(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Materialfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Materialfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord3fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord3fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_FogCoordfvEXT(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FogCoordfvEXT(GLbyte * pc); extern _X_HIDDEN void __glXDisp_DrawArrays(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DrawArrays(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SampleCoverage(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SampleCoverage(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color3iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color3iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4ubv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4ubv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetProgramLocalParameterdvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetProgramLocalParameterdvARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_PointParameteriv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PointParameteriv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Rotatef(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Rotatef(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_BindRenderbuffer(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BindRenderbuffer(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EvalPoint2(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalPoint2(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EvalPoint1(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalPoint1(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PopMatrix(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PopMatrix(GLbyte * pc); extern _X_HIDDEN void __glXDisp_DeleteFramebuffers(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DeleteFramebuffers(GLbyte * pc); extern _X_HIDDEN int __glXDisp_MakeCurrentReadSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_MakeCurrentReadSGI(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetTexGeniv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexGeniv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_MakeCurrent(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_MakeCurrent(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_FramebufferRenderbuffer(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FramebufferRenderbuffer(GLbyte * pc); extern _X_HIDDEN int __glXDisp_IsProgramARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsProgramARB(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib4uiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4uiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4Nsv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4Nsv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Map2d(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Map2d(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Map2f(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Map2f(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ProgramStringARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ProgramStringARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4bv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4bv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttribs4dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetHistogram(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetHistogram(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetHistogramEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetHistogramEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ActiveStencilFaceEXT(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Materialf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Materialf(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Materiali(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Materiali(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Indexsv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Indexsv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib1fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib1fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_LightModelfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LightModelfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord2dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord2dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EvalCoord1dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_EvalCoord1dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Translated(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Translated(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Translatef(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Translatef(GLbyte * pc); extern _X_HIDDEN void __glXDisp_StencilMask(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_StencilMask(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateWindow(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_CreateWindow(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetLightiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetLightiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_IsList(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_IsList(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_RenderMode(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_RenderMode(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_LoadName(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LoadName(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyTexSubImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyTexSubImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CullFace(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CullFace(GLbyte * pc); extern _X_HIDDEN int __glXDisp_QueryContextInfoEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_QueryContextInfoEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttribs2fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_StencilFunc(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_StencilFunc(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyPixels(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyPixels(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Rectsv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Rectsv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyConvolutionFilter2D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyConvolutionFilter2D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexParameterfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexParameterfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4Nubv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4Nubv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_ClipPlane(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ClipPlane(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3usv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3usv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord3dv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetPixelMapuiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetPixelMapuiv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Indexfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Indexfv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_QueryContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_QueryContext(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_MultiTexCoord3fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDisp_BlitFramebuffer(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_BlitFramebuffer(GLbyte * pc); extern _X_HIDDEN void __glXDisp_IndexMask(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_IndexMask(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetFloatv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetFloatv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_TexCoord3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord3sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_FogCoorddv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_FogCoorddv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PopAttrib(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PopAttrib(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Fogfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Fogfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_InitNames(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_InitNames(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Normal3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Normal3sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Minmax(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Minmax(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DeleteQueries(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_DeleteQueries(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetBooleanv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetBooleanv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Hint(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Hint(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Color4dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Color4dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_CopyColorSubTable(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyColorSubTable(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib3dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex4iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex4iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_TexCoord4dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexCoord4dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Begin(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Begin(GLbyte * pc); extern _X_HIDDEN int __glXDisp_ClientInfo(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_ClientInfo(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Rectfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Rectfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_LightModelf(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LightModelf(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetLightfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetLightfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_Disable(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Disable(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord2fvARB(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc); extern _X_HIDDEN int __glXDisp_SelectBuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_SelectBuffer(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_ColorMask(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ColorMask(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos4iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos4iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Enable(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Enable(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetRenderbufferParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetRenderbufferParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttribs4svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs4svNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GenRenderbuffers(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GenRenderbuffers(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMinmaxParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMinmaxParameterfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDisp_GetMinmaxParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetMinmaxParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_VertexAttrib4Nuiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4Nuiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex3fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex3fv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_SecondaryColor3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_SecondaryColor3sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_MultiTexCoord2sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord2sv(GLbyte * pc); #endif /* !defined( _INDIRECT_DISPATCH_H_ ) */ xorg-server-1.17.1/glx/indirect_reqsize.c0000664000175100017510000005212412456571574015336 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2005 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include "glxserver.h" #include "glxbyteorder.h" #include "indirect_size.h" #include "indirect_reqsize.h" #if defined(__CYGWIN__) || defined(__MINGW32__) #undef HAVE_ALIAS #endif #ifdef HAVE_ALIAS #define ALIAS2(from,to) \ GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \ __attribute__ ((alias( # to ))); #define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize ) #else #define ALIAS(from,to) \ GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \ { return __glX ## to ## ReqSize( pc, swap, reqlen ); } #endif int __glXCallListsReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 0); GLenum type = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { n = bswap_32(n); type = bswap_32(type); } compsize = __glCallLists_size(type); return safe_pad(safe_mul(compsize, n)); } int __glXBitmapReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLsizei width = *(GLsizei *) (pc + 20); GLsizei height = *(GLsizei *) (pc + 24); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); width = bswap_32(width); height = bswap_32(height); } return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXFogfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 0); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glFogfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXLightfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glLightfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXLightModelfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 0); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glLightModelfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glMaterialfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXPolygonStippleReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); } return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXTexParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glTexParameterfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei width = *(GLsizei *) (pc + 32); GLenum format = *(GLenum *) (pc + 44); GLenum type = *(GLenum *) (pc + 48); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, 1, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei width = *(GLsizei *) (pc + 32); GLsizei height = *(GLsizei *) (pc + 36); GLenum format = *(GLenum *) (pc + 44); GLenum type = *(GLenum *) (pc + 48); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); height = bswap_32(height); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, height, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glTexEnvfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXTexGendvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glTexGendv_size(pname); return safe_pad(safe_mul(compsize, 8)); } int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glTexGenfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei mapsize = *(GLsizei *) (pc + 4); if (swap) { mapsize = bswap_32(mapsize); } return safe_pad(safe_mul(mapsize, 4)); } int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei mapsize = *(GLsizei *) (pc + 4); if (swap) { mapsize = bswap_32(mapsize); } return safe_pad(safe_mul(mapsize, 2)); } int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLsizei width = *(GLsizei *) (pc + 20); GLsizei height = *(GLsizei *) (pc + 24); GLenum format = *(GLenum *) (pc + 28); GLenum type = *(GLenum *) (pc + 32); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); width = bswap_32(width); height = bswap_32(height); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, 0, width, height, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 0); if (swap) { n = bswap_32(n); } return safe_pad(safe_add(safe_mul(n, 4), safe_mul(n, 4))); } int __glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei width = *(GLsizei *) (pc + 36); GLenum format = *(GLenum *) (pc + 44); GLenum type = *(GLenum *) (pc + 48); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, 1, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei width = *(GLsizei *) (pc + 36); GLsizei height = *(GLsizei *) (pc + 40); GLenum format = *(GLenum *) (pc + 44); GLenum type = *(GLenum *) (pc + 48); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); height = bswap_32(height); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, height, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXColorTableReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei width = *(GLsizei *) (pc + 28); GLenum format = *(GLenum *) (pc + 32); GLenum type = *(GLenum *) (pc + 36); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, 1, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glColorTableParameterfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXColorSubTableReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei count = *(GLsizei *) (pc + 28); GLenum format = *(GLenum *) (pc + 32); GLenum type = *(GLenum *) (pc + 36); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); count = bswap_32(count); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, count, 1, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei width = *(GLsizei *) (pc + 28); GLenum format = *(GLenum *) (pc + 36); GLenum type = *(GLenum *) (pc + 40); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, 1, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = 0; GLint skip_images = 0; GLint skip_rows = *(GLint *) (pc + 8); GLint alignment = *(GLint *) (pc + 16); GLenum target = *(GLenum *) (pc + 20); GLsizei width = *(GLsizei *) (pc + 28); GLsizei height = *(GLsizei *) (pc + 32); GLenum format = *(GLenum *) (pc + 36); GLenum type = *(GLenum *) (pc + 40); if (swap) { row_length = bswap_32(row_length); skip_rows = bswap_32(skip_rows); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); height = bswap_32(height); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, height, 1, image_height, row_length, skip_images, skip_rows, alignment); } int __glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 4); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glConvolutionParameterfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = *(GLint *) (pc + 8); GLint skip_rows = *(GLint *) (pc + 16); GLint skip_images = *(GLint *) (pc + 20); GLint alignment = *(GLint *) (pc + 32); GLenum target = *(GLenum *) (pc + 36); GLsizei width = *(GLsizei *) (pc + 48); GLsizei height = *(GLsizei *) (pc + 52); GLsizei depth = *(GLsizei *) (pc + 56); GLenum format = *(GLenum *) (pc + 68); GLenum type = *(GLenum *) (pc + 72); if (swap) { row_length = bswap_32(row_length); image_height = bswap_32(image_height); skip_rows = bswap_32(skip_rows); skip_images = bswap_32(skip_images); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); height = bswap_32(height); depth = bswap_32(depth); format = bswap_32(format); type = bswap_32(type); } if (*(CARD32 *) (pc + 76)) return 0; return __glXImageSize(format, type, target, width, height, depth, image_height, row_length, skip_images, skip_rows, alignment); } int __glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLint row_length = *(GLint *) (pc + 4); GLint image_height = *(GLint *) (pc + 8); GLint skip_rows = *(GLint *) (pc + 16); GLint skip_images = *(GLint *) (pc + 20); GLint alignment = *(GLint *) (pc + 32); GLenum target = *(GLenum *) (pc + 36); GLsizei width = *(GLsizei *) (pc + 60); GLsizei height = *(GLsizei *) (pc + 64); GLsizei depth = *(GLsizei *) (pc + 68); GLenum format = *(GLenum *) (pc + 76); GLenum type = *(GLenum *) (pc + 80); if (swap) { row_length = bswap_32(row_length); image_height = bswap_32(image_height); skip_rows = bswap_32(skip_rows); skip_images = bswap_32(skip_images); alignment = bswap_32(alignment); target = bswap_32(target); width = bswap_32(width); height = bswap_32(height); depth = bswap_32(depth); format = bswap_32(format); type = bswap_32(type); } return __glXImageSize(format, type, target, width, height, depth, image_height, row_length, skip_images, skip_rows, alignment); } int __glXCompressedTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei imageSize = *(GLsizei *) (pc + 20); if (swap) { imageSize = bswap_32(imageSize); } return safe_pad(imageSize); } int __glXCompressedTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei imageSize = *(GLsizei *) (pc + 24); if (swap) { imageSize = bswap_32(imageSize); } return safe_pad(imageSize); } int __glXCompressedTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei imageSize = *(GLsizei *) (pc + 28); if (swap) { imageSize = bswap_32(imageSize); } return safe_pad(imageSize); } int __glXCompressedTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei imageSize = *(GLsizei *) (pc + 36); if (swap) { imageSize = bswap_32(imageSize); } return safe_pad(imageSize); } int __glXPointParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *) (pc + 0); GLsizei compsize; if (swap) { pname = bswap_32(pname); } compsize = __glPointParameterfv_size(pname); return safe_pad(safe_mul(compsize, 4)); } int __glXDrawBuffersReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 0); if (swap) { n = bswap_32(n); } return safe_pad(safe_mul(n, 4)); } int __glXProgramStringARBReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei len = *(GLsizei *) (pc + 8); if (swap) { len = bswap_32(len); } return safe_pad(len); } int __glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 4); if (swap) { n = bswap_32(n); } return safe_pad(safe_mul(n, 8)); } int __glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 4); if (swap) { n = bswap_32(n); } return safe_pad(safe_mul(n, 16)); } int __glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 4); if (swap) { n = bswap_32(n); } return safe_pad(safe_mul(n, 24)); } int __glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 4); if (swap) { n = bswap_32(n); } return safe_pad(safe_mul(n, 12)); } int __glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 4); if (swap) { n = bswap_32(n); } return safe_pad(safe_mul(n, 6)); } int __glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *) (pc + 4); if (swap) { n = bswap_32(n); } return safe_pad(safe_mul(n, 32)); } ALIAS(Fogiv, Fogfv) ALIAS(Lightiv, Lightfv) ALIAS(LightModeliv, LightModelfv) ALIAS(Materialiv, Materialfv) ALIAS(TexParameteriv, TexParameterfv) ALIAS(TexEnviv, TexEnvfv) ALIAS(TexGeniv, TexGenfv) ALIAS(PixelMapuiv, PixelMapfv) ALIAS(ColorTableParameteriv, ColorTableParameterfv) ALIAS(ConvolutionParameteriv, ConvolutionParameterfv) ALIAS(CompressedTexSubImage1D, CompressedTexImage1D) ALIAS(CompressedTexSubImage2D, CompressedTexImage3D) ALIAS(PointParameteriv, PointParameterfv) ALIAS(DeleteFramebuffers, DrawBuffers) ALIAS(DeleteRenderbuffers, DrawBuffers) ALIAS(VertexAttribs1fvNV, PixelMapfv) ALIAS(VertexAttribs1svNV, PixelMapusv) ALIAS(VertexAttribs2fvNV, VertexAttribs1dvNV) ALIAS(VertexAttribs2svNV, PixelMapfv) ALIAS(VertexAttribs4fvNV, VertexAttribs2dvNV) ALIAS(VertexAttribs4svNV, VertexAttribs1dvNV) ALIAS(VertexAttribs4ubvNV, PixelMapfv) xorg-server-1.17.1/glx/glxbyteorder.h0000664000175100017510000000416412456571574014513 00000000000000/* * (C) Copyright IBM Corporation 2006, 2007 * 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 * THE COPYRIGHT HOLDERS, THE AUTHORS, AND/OR THEIR SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file glxbyteorder.h * Platform glue for handling byte-ordering issues in GLX protocol. * * \author Ian Romanick */ #if !defined(__GLXBYTEORDER_H__) #define __GLXBYTEORDER_H__ #ifdef HAVE_DIX_CONFIG_H #include #endif #if HAVE_BYTESWAP_H #include #elif defined(USE_SYS_ENDIAN_H) #include #elif defined(__APPLE__) #include #define bswap_16 OSSwapInt16 #define bswap_32 OSSwapInt32 #define bswap_64 OSSwapInt64 #else #define bswap_16(value) \ ((((value) & 0xff) << 8) | ((value) >> 8)) #define bswap_32(value) \ (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \ (uint32_t)bswap_16((uint16_t)((value) >> 16))) #define bswap_64(value) \ (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \ << 32) | \ (uint64_t)bswap_32((uint32_t)((value) >> 32))) #endif #endif /* !defined(__GLXBYTEORDER_H__) */ xorg-server-1.17.1/glx/singlepix.c0000664000175100017510000004023512456571574013775 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "glxext.h" #include "singlesize.h" #include "unpack.h" #include "indirect_size_get.h" #include "indirect_dispatch.h" int __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc) { GLsizei width, height; GLenum format, type; GLboolean swapBytes, lsbFirst; GLint compsize; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; REQUEST_FIXED_SIZE(xGLXSingleReq, 28); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; width = *(GLsizei *) (pc + 8); height = *(GLsizei *) (pc + 12); format = *(GLenum *) (pc + 16); type = *(GLenum *) (pc + 20); swapBytes = *(GLboolean *) (pc + 24); lsbFirst = *(GLboolean *) (pc + 25); compsize = __glReadPixels_size(format, type, width, height); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glReadPixels(*(GLint *) (pc + 0), *(GLint *) (pc + 4), *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12), *(GLenum *) (pc + 16), *(GLenum *) (pc + 20), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } cx->hasUnflushedCommands = GL_FALSE; return Success; } int __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc) { GLint level, compsize; GLenum format, type, target; GLboolean swapBytes; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0, depth = 1; REQUEST_FIXED_SIZE(xGLXSingleReq, 20); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; level = *(GLint *) (pc + 4); format = *(GLenum *) (pc + 8); type = *(GLenum *) (pc + 12); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 16); glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width); glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height); if (target == GL_TEXTURE_3D) { glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth); } /* * The three queries above might fail if we're in a state where queries * are illegal, but then width, height, and depth would still be zero anyway. */ compsize = __glGetTexImage_size(target, level, format, type, width, height, depth); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetTexImage(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLenum *) (pc + 8), *(GLenum *) (pc + 12), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); ((xGLXGetTexImageReply *) &__glXReply)->width = width; ((xGLXGetTexImageReply *) &__glXReply)->height = height; ((xGLXGetTexImageReply *) &__glXReply)->depth = depth; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDisp_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc) { GLboolean lsbFirst; __GLXcontext *cx; ClientPtr client = cl->client; int error; GLubyte answerBuffer[200]; char *answer; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; lsbFirst = *(GLboolean *) (pc + 0); glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst); __GLX_GET_ANSWER_BUFFER(answer, cl, 128, 1); __glXClearErrorOccured(); glGetPolygonStipple((GLubyte *) answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(128); __GLX_SEND_HEADER(); __GLX_SEND_BYTE_ARRAY(128); } return Success; } static int GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize, compsize2; GLenum format, type, target; GLboolean swapBytes; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); /* target must be SEPARABLE_2D, however I guess we can let the GL barf on this one.... */ glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width); glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height); /* * The two queries above might fail if we're in a state where queries * are illegal, but then width and height would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1); if ((compsize = safe_pad(compsize)) < 0) return BadLength; if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1); __glXClearErrorOccured(); glGetSeparableFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), answer, answer + compsize, NULL); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize + compsize2); ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width; ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize + compsize2); } return Success; } int __glXDisp_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDisp_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; GLint width = 0, height = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width); if (target == GL_CONVOLUTION_1D) { height = 1; } else { glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height); } /* * The two queries above might fail if we're in a state where queries * are illegal, but then width and height would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetConvolutionFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width; ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDisp_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDisp_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes, reset; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; GLint width = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); reset = *(GLboolean *) (pc + 13); glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width); /* * The one query above might fail if we're in a state where queries * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetHistogram(target, reset, format, type, answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); ((xGLXGetHistogramReply *) &__glXReply)->width = width; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDisp_GetHistogram(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDisp_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes, reset; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); target = *(GLenum *) (pc + 0); swapBytes = *(GLboolean *) (pc + 12); reset = *(GLboolean *) (pc + 13); compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetMinmax(target, reset, format, type, answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDisp_GetMinmax(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDisp_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } static int GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) { GLint compsize; GLenum format, type, target; GLboolean swapBytes; __GLXcontext *cx; ClientPtr client = cl->client; int error; char *answer, answerBuffer[200]; GLint width = 0; cx = __glXForceCurrent(cl, tag, &error); if (!cx) { return error; } target = *(GLenum *) (pc + 0); format = *(GLenum *) (pc + 4); type = *(GLenum *) (pc + 8); swapBytes = *(GLboolean *) (pc + 12); glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width); /* * The one query above might fail if we're in a state where queries * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); glGetColorTable(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), answer); if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); ((xGLXGetColorTableReply *) &__glXReply)->width = width; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } return Success; } int __glXDisp_GetColorTable(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXSingleReq, 16); return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); } int __glXDisp_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc) { const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); } xorg-server-1.17.1/glx/single2swap.c0000664000175100017510000002036512456571574014233 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "glxutil.h" #include "glxext.h" #include "indirect_dispatch.h" #include "unpack.h" int __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; GLsizei size; GLenum type; __GLX_DECLARE_SWAP_VARIABLES; __GLXcontext *cx; int error; REQUEST_FIXED_SIZE(xGLXSingleReq, 8); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 4); size = *(GLsizei *) (pc + 0); type = *(GLenum *) (pc + 4); if (cx->feedbackBufSize < size) { cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf, (size_t) size * __GLX_SIZE_FLOAT32); if (!cx->feedbackBuf) { cl->client->errorValue = size; return BadAlloc; } cx->feedbackBufSize = size; } glFeedbackBuffer(size, type, cx->feedbackBuf); cx->hasUnflushedCommands = GL_TRUE; return Success; } int __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; GLsizei size; __GLX_DECLARE_SWAP_VARIABLES; int error; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; __GLX_SWAP_INT(pc + 0); size = *(GLsizei *) (pc + 0); if (cx->selectBufSize < size) { cx->selectBuf = (GLuint *) realloc(cx->selectBuf, (size_t) size * __GLX_SIZE_CARD32); if (!cx->selectBuf) { cl->client->errorValue = size; return BadAlloc; } cx->selectBufSize = size; } glSelectBuffer(size, cx->selectBuf); cx->hasUnflushedCommands = GL_TRUE; return Success; } int __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; xGLXRenderModeReply reply; GLint nitems = 0, retBytes = 0, retval, newModeCheck; GLubyte *retBuffer = NULL; GLenum newMode; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; int error; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; __GLX_SWAP_INT(pc); newMode = *(GLenum *) pc; retval = glRenderMode(newMode); /* Check that render mode worked */ glGetIntegerv(GL_RENDER_MODE, &newModeCheck); if (newModeCheck != newMode) { /* Render mode change failed. Bail */ newMode = newModeCheck; goto noChangeAllowed; } /* ** Render mode might have still failed if we get here. But in this ** case we can't really tell, nor does it matter. If it did fail, it ** will return 0, and thus we won't send any data across the wire. */ switch (cx->renderMode) { case GL_RENDER: cx->renderMode = newMode; break; case GL_FEEDBACK: if (retval < 0) { /* Overflow happened. Copy the entire buffer */ nitems = cx->feedbackBufSize; } else { nitems = retval; } retBytes = nitems * __GLX_SIZE_FLOAT32; retBuffer = (GLubyte *) cx->feedbackBuf; __GLX_SWAP_FLOAT_ARRAY((GLbyte *) retBuffer, nitems); cx->renderMode = newMode; break; case GL_SELECT: if (retval < 0) { /* Overflow happened. Copy the entire buffer */ nitems = cx->selectBufSize; } else { GLuint *bp = cx->selectBuf; GLint i; /* ** Figure out how many bytes of data need to be sent. Parse ** the selection buffer to determine this fact as the ** return value is the number of hits, not the number of ** items in the buffer. */ nitems = 0; i = retval; while (--i >= 0) { GLuint n; /* Parse select data for this hit */ n = *bp; bp += 3 + n; } nitems = bp - cx->selectBuf; } retBytes = nitems * __GLX_SIZE_CARD32; retBuffer = (GLubyte *) cx->selectBuf; __GLX_SWAP_INT_ARRAY((GLbyte *) retBuffer, nitems); cx->renderMode = newMode; break; } /* ** First reply is the number of elements returned in the feedback or ** selection array, as per the API for glRenderMode itself. */ noChangeAllowed:; 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, &reply); if (retBytes) { WriteToClient(client, retBytes, retBuffer); } return Success; } int __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; int error; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXSingleReq); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } glFlush(); cx->hasUnflushedCommands = GL_FALSE; return Success; } int __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; int error; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXSingleReq); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } /* Do a local glFinish */ glFinish(); cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ __GLX_BEGIN_REPLY(0); __GLX_PUT_RETVAL(0); __GLX_SWAP_REPLY_HEADER(); __GLX_SEND_HEADER(); return Success; } int __glXDispSwap_GetString(__GLXclientState * cl, GLbyte * pc) { return DoGetString(cl, pc, GL_TRUE); } xorg-server-1.17.1/glx/glxscreens.h0000664000175100017510000001241312456571574014152 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _GLX_screens_h_ #define _GLX_screens_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ typedef struct __GLXconfig __GLXconfig; struct __GLXconfig { __GLXconfig *next; GLuint doubleBufferMode; GLuint stereoMode; GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ GLuint redMask, greenMask, blueMask, alphaMask; GLint rgbBits; /* total bits for rgb */ GLint indexBits; /* total bits for colorindex */ GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; GLint depthBits; GLint stencilBits; GLint numAuxBuffers; GLint level; /* GLX */ GLint visualID; GLint visualType; /**< One of the GLX X visual types. (i.e., * \c GLX_TRUE_COLOR, etc.) */ /* EXT_visual_rating / GLX 1.2 */ GLint visualRating; /* EXT_visual_info / GLX 1.2 */ GLint transparentPixel; /* colors are floats scaled to ints */ GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; GLint transparentIndex; /* ARB_multisample / SGIS_multisample */ GLint sampleBuffers; GLint samples; /* SGIX_fbconfig / GLX 1.3 */ GLint drawableType; GLint renderType; GLint xRenderable; GLint fbconfigID; /* SGIX_pbuffer / GLX 1.3 */ GLint maxPbufferWidth; GLint maxPbufferHeight; GLint maxPbufferPixels; GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ /* SGIX_visual_select_group */ GLint visualSelectGroup; /* OML_swap_method */ GLint swapMethod; /* EXT_texture_from_pixmap */ GLint bindToTextureRgb; GLint bindToTextureRgba; GLint bindToMipmapTexture; GLint bindToTextureTargets; GLint yInverted; /* ARB_framebuffer_sRGB */ GLint sRGBCapable; }; GLint glxConvertToXVisualType(int visualType); /* ** Screen dependent data. These methods are the interface between the DIX ** and DDX layers of the GLX server extension. The methods provide an ** interface for context management on a screen. */ typedef struct __GLXscreen __GLXscreen; struct __GLXscreen { void (*destroy) (__GLXscreen * screen); __GLXcontext *(*createContext) (__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * shareContext, unsigned num_attribs, const uint32_t *attribs, int *error); __GLXdrawable *(*createDrawable) (ClientPtr client, __GLXscreen * context, DrawablePtr pDraw, XID drawId, int type, XID glxDrawId, __GLXconfig * modes); int (*swapInterval) (__GLXdrawable * drawable, int interval); ScreenPtr pScreen; /* Linked list of valid fbconfigs for this screen. */ __GLXconfig *fbconfigs; int numFBConfigs; /* Subset of fbconfigs that are exposed as GLX visuals. */ __GLXconfig **visuals; GLint numVisuals; char *GLextensions; char *GLXextensions; /** * \name GLX version supported by this screen. * * Since the GLX version advertised by the server is for the whole server, * the GLX protocol code uses the minimum version supported on all screens. */ /*@{ */ unsigned GLXmajor; unsigned GLXminor; /*@} */ Bool (*CloseScreen) (ScreenPtr pScreen); }; void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen); void __glXScreenDestroy(__GLXscreen * screen); #endif /* !__GLX_screens_h__ */ xorg-server-1.17.1/glx/indirect_size_get.h0000664000175100017510000001023612456571574015470 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2004 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if !defined( _INDIRECT_SIZE_GET_H_ ) #define _INDIRECT_SIZE_GET_H_ /** * \file * Prototypes for functions used to determine the number of data elements in * various GLX protocol messages. * * \author Ian Romanick */ #include #if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) #define PURE __attribute__((pure)) #else #define PURE #endif #if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) #define FASTCALL __attribute__((fastcall)) #else #define FASTCALL #endif extern _X_INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetDoublev_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetFloatv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetIntegerv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetLightfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetLightiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetMaterialfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetMaterialiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexEnvfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexEnviv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGendv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGenfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexGeniv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetTexLevelParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetPointerv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetColorTableParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetConvolutionParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetConvolutionParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetHistogramParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectuiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetFramebufferAttachmentParameteriv_size(GLenum); #undef PURE #undef FASTCALL #endif /* !defined( _INDIRECT_SIZE_GET_H_ ) */ xorg-server-1.17.1/glx/swap_interval.c0000664000175100017510000000541712456571574014654 00000000000000/* * (C) Copyright IBM Corporation 2006 * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * on the rights to use, copy, modify, merge, publish, distribute, sub * license, and/or sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "glxutil.h" #include "glxext.h" #include "singlesize.h" #include "unpack.h" #include "indirect_size_get.h" #include "indirect_dispatch.h" #include "glxbyteorder.h" static int DoSwapInterval(__GLXclientState * cl, GLbyte * pc, int do_swap); int DoSwapInterval(__GLXclientState * cl, GLbyte * pc, int do_swap) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; ClientPtr client = cl->client; const GLXContextTag tag = req->contextTag; __GLXcontext *cx; GLint interval; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 4); cx = __glXLookupContextByTag(cl, tag); if ((cx == NULL) || (cx->pGlxScreen == NULL)) { client->errorValue = tag; return __glXError(GLXBadContext); } if (cx->pGlxScreen->swapInterval == NULL) { LogMessage(X_ERROR, "AIGLX: cx->pGlxScreen->swapInterval == NULL\n"); client->errorValue = tag; return __glXError(GLXUnsupportedPrivateRequest); } if (cx->drawPriv == NULL) { client->errorValue = tag; return BadValue; } pc += __GLX_VENDPRIV_HDR_SIZE; interval = (do_swap) ? bswap_32(*(int *) (pc + 0)) : *(int *) (pc + 0); if (interval <= 0) return BadValue; (void) (*cx->pGlxScreen->swapInterval) (cx->drawPriv, interval); return Success; } int __glXDisp_SwapIntervalSGI(__GLXclientState * cl, GLbyte * pc) { return DoSwapInterval(cl, pc, 0); } int __glXDispSwap_SwapIntervalSGI(__GLXclientState * cl, GLbyte * pc) { return DoSwapInterval(cl, pc, 1); } xorg-server-1.17.1/glx/indirect_util.h0000664000175100017510000000455412456571574014642 00000000000000/* * (C) Copyright IBM Corporation 2005 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef __GLX_INDIRECT_UTIL_H__ #define __GLX_INDIRECT_UTIL_H__ extern GLint __glGetBooleanv_variable_size(GLenum e); extern void *__glXGetAnswerBuffer(__GLXclientState * cl, size_t required_size, void *local_buffer, size_t local_size, unsigned alignment); extern void __glXSendReply(ClientPtr client, const void *data, size_t elements, size_t element_size, GLboolean always_array, CARD32 retval); extern void __glXSendReplySwap(ClientPtr client, const void *data, size_t elements, size_t element_size, GLboolean always_array, CARD32 retval); struct __glXDispatchInfo; extern void *__glXGetProtocolDecodeFunction(const struct __glXDispatchInfo *dispatch_info, int opcode, int swapped_version); extern int __glXGetProtocolSizeData(const struct __glXDispatchInfo *dispatch_info, int opcode, __GLXrenderSizeData * data); #endif /* __GLX_INDIRECT_UTIL_H__ */ xorg-server-1.17.1/glx/indirect_program.c0000664000175100017510000001003212456571574015313 00000000000000/* * (C) Copyright IBM Corporation 2005, 2006 * 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 * THE COPYRIGHT HOLDERS, THE AUTHORS, AND/OR THEIR SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file indirect_program.c * Hand-coded routines needed to support programmable pipeline extensions. * * \author Ian Romanick */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "glxbyteorder.h" #include "glxext.h" #include "singlesize.h" #include "unpack.h" #include "indirect_size_get.h" #include "indirect_dispatch.h" /** * Handle both types of glGetProgramString calls. */ static int DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc, PFNGLGETPROGRAMIVARBPROC get_programiv, PFNGLGETPROGRAMSTRINGARBPROC get_program_string, Bool do_swap) { xGLXVendorPrivateWithReplyReq *const req = (xGLXVendorPrivateWithReplyReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); ClientPtr client = cl->client; REQUEST_FIXED_SIZE(xGLXVendorPrivateWithReplyReq, 8); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLenum target; GLenum pname; GLint compsize = 0; char *answer = NULL, answerBuffer[200]; if (do_swap) { target = (GLenum) bswap_32(*(int *) (pc + 0)); pname = (GLenum) bswap_32(*(int *) (pc + 4)); } else { target = *(GLenum *) (pc + 0); pname = *(GLuint *) (pc + 4); } /* The value of the GL_PROGRAM_LENGTH_ARB and GL_PROGRAM_LENGTH_NV * enumerants is the same. */ get_programiv(target, GL_PROGRAM_LENGTH_ARB, &compsize); if (compsize != 0) { __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); __glXClearErrorOccured(); get_program_string(target, pname, (GLubyte *) answer); } if (__glXErrorOccured()) { __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); } else { __GLX_BEGIN_REPLY(compsize); ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } error = Success; } return error; } int __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc) { PFNGLGETPROGRAMIVARBPROC get_program = __glGetProcAddress("glGetProgramivARB"); PFNGLGETPROGRAMSTRINGARBPROC get_program_string = __glGetProcAddress("glGetProgramStringARB"); return DoGetProgramString(cl, pc, get_program, get_program_string, False); } int __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc) { PFNGLGETPROGRAMIVARBPROC get_program = __glGetProcAddress("glGetProgramivARB"); PFNGLGETPROGRAMSTRINGARBPROC get_program_string = __glGetProcAddress("glGetProgramStringARB"); return DoGetProgramString(cl, pc, get_program, get_program_string, True); } xorg-server-1.17.1/glx/clientinfo.c0000664000175100017510000001012012456571574014113 00000000000000/* * Copyright © 2011 Intel Corporation * * 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 "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) { ClientPtr client = cl->client; char *gl_extensions; char *glx_extensions; int size; REQUEST_AT_LEAST_SIZE(xGLXSetClientInfoARBReq); /* Verify that the size of the packet matches the size inferred from the * sizes specified for the various fields. */ size = sz_xGLXSetClientInfoARBReq; size = safe_add(size, safe_mul(req->numVersions, bytes_per_version)); size = safe_add(size, safe_pad(req->numGLExtensionBytes)); size = safe_add(size, safe_pad(req->numGLXExtensionBytes)); if (size < 0 || req->length != (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 set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 8); } int __glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc; REQUEST_AT_LEAST_SIZE(xGLXSetClientInfoARBReq); 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 set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 12); } int __glXDispSwap_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc; REQUEST_AT_LEAST_SIZE(xGLXSetClientInfoARBReq); 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); } xorg-server-1.17.1/glx/extension_string.c0000664000175100017510000001400412366220413015347 00000000000000/* * (C) Copyright IBM Corporation 2002-2006 * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * on the rights to use, copy, modify, merge, publish, distribute, sub * license, and/or sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file extension_string.c * Routines to manage the GLX extension string and GLX version for AIGLX * drivers. This code is loosely based on src/glx/x11/glxextensions.c from * Mesa. * * \author Ian Romanick */ #include #include "extension_string.h" #define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8))) #define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8))) #define IS_SET(m,b) ((m[ (b) / 8 ] & (1U << ((b) % 8))) != 0) #define CONCAT(a,b) a ## b #define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit) #define VER(a,b) a, b #define Y 1 #define N 0 #define EXT_ENABLED(bit,supported) (IS_SET(supported, bit)) struct extension_info { const char *const name; unsigned name_len; unsigned char bit; /** * This is the lowest version of GLX that "requires" this extension. * For example, GLX 1.3 requires SGIX_fbconfig, SGIX_pbuffer, and * SGI_make_current_read. If the extension is not required by any known * version of GLX, use 0, 0. */ unsigned char version_major; unsigned char version_minor; /** * Is driver support forced by the ABI? */ unsigned char driver_support; }; /** * List of known GLX Extensions. * The last Y/N switch informs whether the support of this extension is always enabled. */ static const struct extension_info known_glx_extensions[] = { /* GLX_ARB_get_proc_address is implemented on the client. */ /* *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_fbconfig_float), VER(0,0), N, }, { GLX(ARB_framebuffer_sRGB), VER(0,0), N, }, { GLX(ARB_multisample), VER(1,4), Y, }, { GLX(EXT_create_context_es2_profile), VER(0,0), N, }, { GLX(EXT_framebuffer_sRGB), VER(0,0), N, }, { GLX(EXT_import_context), VER(0,0), Y, }, { GLX(EXT_texture_from_pixmap), VER(0,0), Y, }, { GLX(EXT_visual_info), VER(0,0), Y, }, { GLX(EXT_visual_rating), VER(0,0), Y, }, { GLX(MESA_copy_sub_buffer), VER(0,0), N, }, { GLX(OML_swap_method), VER(0,0), Y, }, { GLX(SGI_make_current_read), VER(1,3), N, }, { GLX(SGI_swap_control), VER(0,0), N, }, { GLX(SGIS_multisample), VER(0,0), Y, }, { GLX(SGIX_fbconfig), VER(1,3), Y, }, { GLX(SGIX_pbuffer), VER(1,3), Y, }, { GLX(SGIX_visual_select_group), VER(0,0), Y, }, { GLX(INTEL_swap_event), VER(0,0), N, }, { NULL } /* *INDENT-ON* */ }; /** * Create a GLX extension string for a set of enable bits. * * Creates a GLX extension string for the set of bit in \c enable_bits. This * string is then stored in \c buffer if buffer is not \c NULL. This allows * two-pass operation. On the first pass the caller passes \c NULL for * \c buffer, and the function determines how much space is required to store * the extension string. The caller allocates the buffer and calls the * function again. * * \param enable_bits Bits representing the enabled extensions. * \param buffer Buffer to store the extension string. May be \c NULL. * * \return * The number of characters in \c buffer that were written to. If \c buffer * is \c NULL, this is the size of buffer that must be allocated by the * caller. */ int __glXGetExtensionString(const unsigned char *enable_bits, char *buffer) { unsigned i; int length = 0; for (i = 0; known_glx_extensions[i].name != NULL; i++) { const unsigned bit = known_glx_extensions[i].bit; const size_t len = known_glx_extensions[i].name_len; if (EXT_ENABLED(bit, enable_bits)) { if (buffer != NULL) { (void) memcpy(&buffer[length], known_glx_extensions[i].name, len); buffer[length + len + 0] = ' '; buffer[length + len + 1] = '\0'; } length += len + 1; } } return length + 1; } void __glXEnableExtension(unsigned char *enable_bits, const char *ext) { const size_t ext_name_len = strlen(ext); unsigned i; for (i = 0; known_glx_extensions[i].name != NULL; i++) { if ((ext_name_len == known_glx_extensions[i].name_len) && (memcmp(ext, known_glx_extensions[i].name, ext_name_len) == 0)) { SET_BIT(enable_bits, known_glx_extensions[i].bit); break; } } } void __glXInitExtensionEnableBits(unsigned char *enable_bits) { unsigned i; (void) memset(enable_bits, 0, __GLX_EXT_BYTES); for (i = 0; known_glx_extensions[i].name != NULL; i++) { if (known_glx_extensions[i].driver_support) { SET_BIT(enable_bits, known_glx_extensions[i].bit); } } } xorg-server-1.17.1/glx/indirect_reqsize.h0000664000175100017510000003040712456571574015343 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2005 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if !defined( _INDIRECT_REQSIZE_H_ ) #define _INDIRECT_REQSIZE_H_ #include #if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) #define PURE __attribute__((pure)) #else #define PURE #endif extern PURE _X_HIDDEN int __glXCallListsReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXBitmapReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXFogfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXFogivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXLightfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXLightivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXLightModelfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXLightModelivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXMaterialivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXPolygonStippleReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexParameterivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexEnvivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexGendvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexGenivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXMap1dReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXMap1fReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXMap2dReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXPixelMapuivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXColorTableReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXColorTableParameterivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXColorSubTableReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXCompressedTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXCompressedTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXCompressedTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXCompressedTexSubImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXCompressedTexSubImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXCompressedTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXPointParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXPointParameterivReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXDrawBuffersReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXProgramStringARBReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXDeleteFramebuffersReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXDeleteRenderbuffersReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte * pc, Bool swap, int reqlen); extern PURE _X_HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte * pc, Bool swap, int reqlen); #undef PURE #endif /* !defined( _INDIRECT_REQSIZE_H_ ) */ xorg-server-1.17.1/glx/glxutil.h0000664000175100017510000000431612274325511013452 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _glxcmds_h_ #define _glxcmds_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ extern GLboolean __glXDrawableInit(__GLXdrawable * drawable, __GLXscreen * screen, DrawablePtr pDraw, int type, XID drawID, __GLXconfig * config); extern void __glXDrawableRelease(__GLXdrawable * drawable); /* context helper routines */ extern __GLXcontext *__glXLookupContextByTag(__GLXclientState *, GLXContextTag); /* init helper routines */ extern void *__glXglDDXScreenInfo(void); extern void *__glXglDDXExtensionInfo(void); #endif /* _glxcmds_h_ */ xorg-server-1.17.1/glx/glxcmds.c0000664000175100017510000022577112456571574013446 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include "glxserver.h" #include #include #include #include #include "glxutil.h" #include "glxext.h" #include "indirect_dispatch.h" #include "indirect_table.h" #include "indirect_util.h" static char GLXServerVendorName[] = "SGI"; _X_HIDDEN int validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen, int *err) { /* ** Check if screen exists. */ if (screen < 0 || screen >= screenInfo.numScreens) { client->errorValue = screen; *err = BadValue; return FALSE; } *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); return TRUE; } _X_HIDDEN int validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen, XID id, __GLXconfig ** config, int *err) { __GLXconfig *m; for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) if (m->fbconfigID == id) { *config = m; return TRUE; } client->errorValue = id; *err = __glXError(GLXBadFBConfig); return FALSE; } static int validGlxVisual(ClientPtr client, __GLXscreen * pGlxScreen, XID id, __GLXconfig ** config, int *err) { int i; for (i = 0; i < pGlxScreen->numVisuals; i++) if (pGlxScreen->visuals[i]->visualID == id) { *config = pGlxScreen->visuals[i]; return TRUE; } client->errorValue = id; *err = BadValue; return FALSE; } static int validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config, DrawablePtr pDraw, int *err) { ScreenPtr pScreen = pDraw->pScreen; VisualPtr pVisual = NULL; XID vid; int i; vid = wVisual((WindowPtr) pDraw); for (i = 0; i < pScreen->numVisuals; i++) { if (pScreen->visuals[i].vid == vid) { pVisual = &pScreen->visuals[i]; break; } } /* FIXME: What exactly should we check here... */ if (pVisual->class != glxConvertToXVisualType(config->visualType) || !(config->drawableType & GLX_WINDOW_BIT)) { client->errorValue = pDraw->id; *err = BadMatch; return FALSE; } return TRUE; } _X_HIDDEN int validGlxContext(ClientPtr client, XID id, int access_mode, __GLXcontext ** context, int *err) { *err = dixLookupResourceByType((void **) context, id, __glXContextRes, client, access_mode); if (*err != Success || (*context)->idExists == GL_FALSE) { client->errorValue = id; if (*err == BadValue || *err == Success) *err = __glXError(GLXBadContext); return FALSE; } return TRUE; } static int validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, __GLXdrawable ** drawable, int *err) { int rc; rc = dixLookupResourceByType((void **) drawable, id, __glXDrawableRes, client, access_mode); if (rc != Success && rc != BadValue) { *err = rc; client->errorValue = id; return FALSE; } /* If the ID of the glx drawable we looked up doesn't match the id * we looked for, it's because we looked it up under the X * drawable ID (see DoCreateGLXDrawable). */ if (rc == BadValue || (*drawable)->drawId != id || (type != GLX_DRAWABLE_ANY && type != (*drawable)->type)) { client->errorValue = id; switch (type) { case GLX_DRAWABLE_WINDOW: *err = __glXError(GLXBadWindow); return FALSE; case GLX_DRAWABLE_PIXMAP: *err = __glXError(GLXBadPixmap); return FALSE; case GLX_DRAWABLE_PBUFFER: *err = __glXError(GLXBadPbuffer); return FALSE; case GLX_DRAWABLE_ANY: *err = __glXError(GLXBadDrawable); return FALSE; } } return TRUE; } void __glXContextDestroy(__GLXcontext * context) { lastGLContext = NULL; } static void __glXdirectContextDestroy(__GLXcontext * context) { __glXContextDestroy(context); free(context); } static int __glXdirectContextLoseCurrent(__GLXcontext * context) { return GL_TRUE; } _X_HIDDEN __GLXcontext * __glXdirectContextCreate(__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * shareContext) { __GLXcontext *context; context = calloc(1, sizeof(__GLXcontext)); if (context == NULL) return NULL; context->destroy = __glXdirectContextDestroy; context->loseCurrent = __glXdirectContextLoseCurrent; return context; } /** * Create a GL context with the given properties. This routine is used * to implement \c glXCreateContext, \c glXCreateNewContext, and * \c glXCreateContextWithConfigSGIX. This works becuase of the hack way * that GLXFBConfigs are implemented. Basically, the FBConfigID is the * same as the VisualID. */ static int DoCreateContext(__GLXclientState * cl, GLXContextID gcId, GLXContextID shareList, __GLXconfig * config, __GLXscreen * pGlxScreen, GLboolean isDirect) { ClientPtr client = cl->client; __GLXcontext *glxc, *shareglxc; int err; LEGAL_NEW_RESOURCE(gcId, client); /* ** Find the display list space that we want to share. ** ** NOTE: In a multithreaded X server, we would need to keep a reference ** count for each display list so that if one client detroyed a list that ** another client was using, the list would not really be freed until it ** was no longer in use. Since this sample implementation has no support ** for multithreaded servers, we don't do this. */ if (shareList == None) { shareglxc = 0; } else { if (!validGlxContext(client, shareList, DixReadAccess, &shareglxc, &err)) return err; /* 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; } 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. */ isDirect = GL_FALSE; } } /* ** Allocate memory for the new context */ if (!isDirect) { /* Only allow creating indirect GLX contexts if allowed by * server command line. Indirect GLX is of limited use (since * it's only GL 1.4), it's slower than direct contexts, and * it's a massive attack surface for buffer overflow type * errors. */ if (!enableIndirectGLX) { client->errorValue = isDirect; return BadValue; } /* 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; } /* Initialize the GLXcontext structure. */ glxc->pGlxScreen = pGlxScreen; glxc->config = config; glxc->id = gcId; glxc->share_id = shareList; glxc->idExists = GL_TRUE; glxc->currentClient = NULL; glxc->isDirect = isDirect; glxc->hasUnflushedCommands = GL_FALSE; glxc->renderMode = GL_RENDER; glxc->feedbackBuf = NULL; glxc->feedbackBufSize = 0; glxc->selectBuf = NULL; glxc->selectBufSize = 0; glxc->drawPriv = NULL; glxc->readPriv = NULL; /* The GLX_ARB_create_context_robustness spec says: * * "The default value for GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB * is GLX_NO_RESET_NOTIFICATION_ARB." * * Without using glXCreateContextAttribsARB, there is no way to specify a * non-default reset notification strategy. */ glxc->resetNotificationStrategy = GLX_NO_RESET_NOTIFICATION_ARB; /* 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; } int __glXDisp_CreateContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; REQUEST_SIZE_MATCH(xGLXCreateContextReq); if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) return err; return DoCreateContext(cl, req->context, req->shareList, config, pGlxScreen, req->isDirect); } int __glXDisp_CreateNewContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) return err; return DoCreateContext(cl, req->context, req->shareList, config, pGlxScreen, req->isDirect); } int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateContextWithConfigSGIXReq *req = (xGLXCreateContextWithConfigSGIXReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) return err; return DoCreateContext(cl, req->context, req->shareList, config, pGlxScreen, req->isDirect); } int __glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; __GLXcontext *glxc; int err; REQUEST_SIZE_MATCH(xGLXDestroyContextReq); if (!validGlxContext(cl->client, req->context, DixDestroyAccess, &glxc, &err)) return err; glxc->idExists = GL_FALSE; if (!glxc->currentClient) FreeResourceByType(req->context, __glXContextRes, FALSE); return Success; } /* * This will return "deleted" contexts, ie, where idExists is GL_FALSE. * Contrast validGlxContext, which will not. We're cheating here and * using the XID as the context tag, which is fine as long as we defer * actually destroying the context until it's no longer referenced, and * block clients from trying to MakeCurrent on contexts that are on the * way to destruction. Notice that DoMakeCurrent calls validGlxContext * for new contexts but __glXLookupContextByTag for previous contexts. */ __GLXcontext * __glXLookupContextByTag(__GLXclientState * cl, GLXContextTag tag) { __GLXcontext *ret; if (dixLookupResourceByType((void **) &ret, tag, __glXContextRes, cl->client, DixUseAccess) == Success) return ret; return NULL; } /*****************************************************************************/ static void StopUsingContext(__GLXcontext * glxc) { if (glxc) { glxc->currentClient = NULL; if (!glxc->idExists) { FreeResourceByType(glxc->id, __glXContextRes, FALSE); } } } static void StartUsingContext(__GLXclientState * cl, __GLXcontext * glxc) { glxc->currentClient = cl->client; } /** * This is a helper function to handle the legacy (pre GLX 1.3) cases * where passing an X window to glXMakeCurrent is valid. Given a * resource ID, look up the GLX drawable if available, otherwise, make * sure it's an X window and create a GLX drawable one the fly. */ static __GLXdrawable * __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client, int *error) { DrawablePtr pDraw; __GLXdrawable *pGlxDraw; int rc; if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, DixWriteAccess, &pGlxDraw, &rc)) { if (glxc != NULL && pGlxDraw->config != glxc->config) { client->errorValue = drawId; *error = BadMatch; return NULL; } return pGlxDraw; } /* No active context and an unknown drawable, bail. */ if (glxc == NULL) { client->errorValue = drawId; *error = BadMatch; return NULL; } /* The drawId wasn't a GLX drawable. Make sure it's a window and * create a GLXWindow for it. Check that the drawable screen * matches the context screen and that the context fbconfig is * compatible with the window visual. */ rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess); if (rc != Success || pDraw->type != DRAWABLE_WINDOW) { client->errorValue = drawId; *error = __glXError(GLXBadDrawable); return NULL; } if (pDraw->pScreen != glxc->pGlxScreen->pScreen) { client->errorValue = pDraw->pScreen->myNum; *error = BadMatch; return NULL; } if (!validGlxFBConfigForWindow(client, glxc->config, pDraw, error)) return NULL; pGlxDraw = glxc->pGlxScreen->createDrawable(client, glxc->pGlxScreen, pDraw, drawId, GLX_DRAWABLE_WINDOW, drawId, glxc->config); if (!pGlxDraw) { *error = BadAlloc; return NULL; } /* since we are creating the drawablePrivate, drawId should be new */ if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) { pGlxDraw->destroy(pGlxDraw); *error = BadAlloc; return NULL; } return pGlxDraw; } /*****************************************************************************/ /* ** Make an OpenGL context and drawable current. */ static int DoMakeCurrent(__GLXclientState * cl, GLXDrawable drawId, GLXDrawable readId, GLXContextID contextId, GLXContextTag tag) { ClientPtr client = cl->client; xGLXMakeCurrentReply reply; __GLXcontext *glxc, *prevglxc; __GLXdrawable *drawPriv = NULL; __GLXdrawable *readPriv = NULL; int error; GLuint mask; /* ** If one is None and the other isn't, it's a bad match. */ mask = (drawId == None) ? (1 << 0) : 0; mask |= (readId == None) ? (1 << 1) : 0; mask |= (contextId == None) ? (1 << 2) : 0; if ((mask != 0x00) && (mask != 0x07)) { return BadMatch; } /* ** Lookup old context. If we have one, it must be in a usable state. */ if (tag != 0) { prevglxc = __glXLookupContextByTag(cl, tag); if (!prevglxc) { /* ** Tag for previous context is invalid. */ return __glXError(GLXBadContextTag); } if (prevglxc->renderMode != GL_RENDER) { /* Oops. Not in render mode render. */ client->errorValue = prevglxc->id; return __glXError(GLXBadContextState); } } else { prevglxc = 0; } /* ** Lookup new context. It must not be current for someone else. */ if (contextId != None) { int status; if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error)) return error; if ((glxc != prevglxc) && glxc->currentClient) { /* Context is current to somebody else */ return BadAccess; } assert(drawId != None); assert(readId != None); drawPriv = __glXGetDrawable(glxc, drawId, client, &status); if (drawPriv == NULL) return status; readPriv = __glXGetDrawable(glxc, readId, client, &status); if (readPriv == NULL) return status; } else { /* Switching to no context. Ignore new drawable. */ glxc = 0; drawPriv = 0; readPriv = 0; } if (prevglxc) { /* ** Flush the previous context if needed. */ if (prevglxc->hasUnflushedCommands) { if (__glXForceCurrent(cl, tag, (int *) &error)) { glFlush(); prevglxc->hasUnflushedCommands = GL_FALSE; } else { return error; } } /* ** Make the previous context not current. */ if (!(*prevglxc->loseCurrent) (prevglxc)) { return __glXError(GLXBadContext); } lastGLContext = NULL; if (!prevglxc->isDirect) { prevglxc->drawPriv = NULL; prevglxc->readPriv = NULL; } } if ((glxc != 0) && !glxc->isDirect) { glxc->drawPriv = drawPriv; glxc->readPriv = readPriv; /* make the context current */ lastGLContext = glxc; if (!(*glxc->makeCurrent) (glxc)) { lastGLContext = NULL; glxc->drawPriv = NULL; glxc->readPriv = NULL; return __glXError(GLXBadContext); } glxc->currentClient = client; } StopUsingContext(prevglxc); reply = (xGLXMakeCurrentReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .contextTag = 0 }; if (glxc) { StartUsingContext(cl, glxc); reply.contextTag = glxc->id; } if (client->swapped) { __glXSwapMakeCurrentReply(client, &reply); } else { WriteToClient(client, sz_xGLXMakeCurrentReply, &reply); } return Success; } int __glXDisp_MakeCurrent(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); return DoMakeCurrent(cl, req->drawable, req->drawable, req->context, req->oldContextTag); } int __glXDisp_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); return DoMakeCurrent(cl, req->drawable, req->readdrawable, req->context, req->oldContextTag); } int __glXDisp_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); return DoMakeCurrent(cl, req->drawable, req->readable, req->context, req->oldContextTag); } int __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; xGLXIsDirectReply reply; __GLXcontext *glxc; int err; REQUEST_SIZE_MATCH(xGLXIsDirectReq); if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err)) return err; reply = (xGLXIsDirectReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .isDirect = glxc->isDirect }; if (client->swapped) { __glXSwapIsDirectReply(client, &reply); } else { WriteToClient(client, sz_xGLXIsDirectReply, &reply); } return Success; } int __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; xGLXQueryVersionReply reply; GLuint major, minor; REQUEST_SIZE_MATCH(xGLXQueryVersionReq); major = req->majorVersion; minor = req->minorVersion; (void) major; (void) minor; /* ** 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 = (xGLXQueryVersionReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .majorVersion = glxMajorVersion, .minorVersion = glxMinorVersion }; if (client->swapped) { __glXSwapQueryVersionReply(client, &reply); } else { WriteToClient(client, sz_xGLXQueryVersionReply, &reply); } return Success; } int __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; GLXContextTag tag; __GLXcontext *glxc = NULL; int error; REQUEST_SIZE_MATCH(xGLXWaitGLReq); tag = req->contextTag; if (tag) { glxc = __glXLookupContextByTag(cl, tag); if (!glxc) return __glXError(GLXBadContextTag); if (!__glXForceCurrent(cl, req->contextTag, &error)) return error; glFinish(); } if (glxc && glxc->drawPriv->waitGL) (*glxc->drawPriv->waitGL) (glxc->drawPriv); return Success; } int __glXDisp_WaitX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXWaitXReq *req = (xGLXWaitXReq *) pc; GLXContextTag tag; __GLXcontext *glxc = NULL; int error; REQUEST_SIZE_MATCH(xGLXWaitXReq); tag = req->contextTag; if (tag) { glxc = __glXLookupContextByTag(cl, tag); if (!glxc) return __glXError(GLXBadContextTag); if (!__glXForceCurrent(cl, req->contextTag, &error)) return error; } if (glxc && glxc->drawPriv->waitX) (*glxc->drawPriv->waitX) (glxc->drawPriv); return Success; } int __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; GLXContextID source; GLXContextID dest; GLXContextTag tag; unsigned long mask; __GLXcontext *src, *dst; int error; REQUEST_SIZE_MATCH(xGLXCopyContextReq); source = req->source; dest = req->dest; tag = req->contextTag; mask = req->mask; if (!validGlxContext(cl->client, source, DixReadAccess, &src, &error)) return error; if (!validGlxContext(cl->client, dest, DixWriteAccess, &dst, &error)) return error; /* ** They must be in the same address space, and same screen. ** NOTE: no support for direct rendering contexts here. */ if (src->isDirect || dst->isDirect || (src->pGlxScreen != dst->pGlxScreen)) { client->errorValue = source; return BadMatch; } /* ** The destination context must not be current for any client. */ if (dst->currentClient) { client->errorValue = dest; return BadAccess; } if (tag) { __GLXcontext *tagcx = __glXLookupContextByTag(cl, tag); if (!tagcx) { return __glXError(GLXBadContextTag); } if (tagcx != src) { /* ** This would be caused by a faulty implementation of the client ** library. */ return BadMatch; } /* ** In this case, glXCopyContext is in both GL and X streams, in terms ** of sequentiality. */ if (__glXForceCurrent(cl, tag, &error)) { /* ** Do whatever is needed to make sure that all preceding requests ** in both streams are completed before the copy is executed. */ glFinish(); tagcx->hasUnflushedCommands = GL_FALSE; } else { return error; } } /* ** Issue copy. The only reason for failure is a bad mask. */ if (!(*dst->copy) (dst, src, mask)) { client->errorValue = mask; return BadValue; } return Success; } enum { GLX_VIS_CONFIG_UNPAIRED = 18, GLX_VIS_CONFIG_PAIRED = 22 }; enum { GLX_VIS_CONFIG_TOTAL = GLX_VIS_CONFIG_UNPAIRED + GLX_VIS_CONFIG_PAIRED }; int __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) { xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; ClientPtr client = cl->client; xGLXGetVisualConfigsReply reply; __GLXscreen *pGlxScreen; __GLXconfig *modes; CARD32 buf[GLX_VIS_CONFIG_TOTAL]; int p, i, err; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; 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); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.numVisuals); __GLX_SWAP_INT(&reply.numProps); } WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); for (i = 0; i < pGlxScreen->numVisuals; i++) { modes = pGlxScreen->visuals[i]; p = 0; buf[p++] = modes->visualID; buf[p++] = glxConvertToXVisualType(modes->visualType); buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE; buf[p++] = modes->redBits; buf[p++] = modes->greenBits; buf[p++] = modes->blueBits; buf[p++] = modes->alphaBits; buf[p++] = modes->accumRedBits; buf[p++] = modes->accumGreenBits; buf[p++] = modes->accumBlueBits; buf[p++] = modes->accumAlphaBits; buf[p++] = modes->doubleBufferMode; buf[p++] = modes->stereoMode; buf[p++] = modes->rgbBits; buf[p++] = modes->depthBits; buf[p++] = modes->stencilBits; buf[p++] = modes->numAuxBuffers; buf[p++] = modes->level; assert(p == GLX_VIS_CONFIG_UNPAIRED); /* ** Add token/value pairs for extensions. */ buf[p++] = GLX_VISUAL_CAVEAT_EXT; buf[p++] = modes->visualRating; buf[p++] = GLX_TRANSPARENT_TYPE; buf[p++] = modes->transparentPixel; buf[p++] = GLX_TRANSPARENT_RED_VALUE; buf[p++] = modes->transparentRed; buf[p++] = GLX_TRANSPARENT_GREEN_VALUE; buf[p++] = modes->transparentGreen; buf[p++] = GLX_TRANSPARENT_BLUE_VALUE; buf[p++] = modes->transparentBlue; buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE; buf[p++] = modes->transparentAlpha; buf[p++] = GLX_TRANSPARENT_INDEX_VALUE; buf[p++] = modes->transparentIndex; buf[p++] = GLX_SAMPLES_SGIS; buf[p++] = modes->samples; buf[p++] = GLX_SAMPLE_BUFFERS_SGIS; buf[p++] = modes->sampleBuffers; /* Add attribute only if its value is not default. */ if (modes->sRGBCapable != GL_FALSE) { buf[p++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT; buf[p++] = modes->sRGBCapable; } /* Don't add visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? * Pad the remaining place with zeroes, so that attributes count is constant. */ while (p < GLX_VIS_CONFIG_TOTAL) { buf[p++] = 0; buf[p++] = 0; } assert(p == GLX_VIS_CONFIG_TOTAL); if (client->swapped) { __GLX_SWAP_INT_ARRAY(buf, p); } WriteToClient(client, __GLX_SIZE_CARD32 * p, buf); } return Success; } #define __GLX_TOTAL_FBCONFIG_ATTRIBS (44) #define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2) /** * Send the set of GLXFBConfigs to the client. There is not currently * and interface into the driver on the server-side to get GLXFBConfigs, * so we "invent" some based on the \c __GLXvisualConfig structures that * the driver does supply. * * The reply format for both \c glXGetFBConfigs and \c glXGetFBConfigsSGIX * is the same, so this routine pulls double duty. */ static int DoGetFBConfigs(__GLXclientState * cl, unsigned screen) { ClientPtr client = cl->client; xGLXGetFBConfigsReply reply; __GLXscreen *pGlxScreen; CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH]; int p, err; __GLXconfig *modes; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err)) return err; 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); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.numFBConfigs); __GLX_SWAP_INT(&reply.numAttribs); } WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply); for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) { p = 0; #define WRITE_PAIR(tag,value) \ do { buf[p++] = tag ; buf[p++] = value ; } while( 0 ) WRITE_PAIR(GLX_VISUAL_ID, modes->visualID); WRITE_PAIR(GLX_FBCONFIG_ID, modes->fbconfigID); WRITE_PAIR(GLX_X_RENDERABLE, GL_TRUE); WRITE_PAIR(GLX_RGBA, (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE); WRITE_PAIR(GLX_RENDER_TYPE, modes->renderType); WRITE_PAIR(GLX_DOUBLEBUFFER, modes->doubleBufferMode); WRITE_PAIR(GLX_STEREO, modes->stereoMode); WRITE_PAIR(GLX_BUFFER_SIZE, modes->rgbBits); WRITE_PAIR(GLX_LEVEL, modes->level); WRITE_PAIR(GLX_AUX_BUFFERS, modes->numAuxBuffers); WRITE_PAIR(GLX_RED_SIZE, modes->redBits); WRITE_PAIR(GLX_GREEN_SIZE, modes->greenBits); WRITE_PAIR(GLX_BLUE_SIZE, modes->blueBits); WRITE_PAIR(GLX_ALPHA_SIZE, modes->alphaBits); WRITE_PAIR(GLX_ACCUM_RED_SIZE, modes->accumRedBits); WRITE_PAIR(GLX_ACCUM_GREEN_SIZE, modes->accumGreenBits); WRITE_PAIR(GLX_ACCUM_BLUE_SIZE, modes->accumBlueBits); WRITE_PAIR(GLX_ACCUM_ALPHA_SIZE, modes->accumAlphaBits); WRITE_PAIR(GLX_DEPTH_SIZE, modes->depthBits); WRITE_PAIR(GLX_STENCIL_SIZE, modes->stencilBits); WRITE_PAIR(GLX_X_VISUAL_TYPE, modes->visualType); WRITE_PAIR(GLX_CONFIG_CAVEAT, modes->visualRating); WRITE_PAIR(GLX_TRANSPARENT_TYPE, modes->transparentPixel); WRITE_PAIR(GLX_TRANSPARENT_RED_VALUE, modes->transparentRed); WRITE_PAIR(GLX_TRANSPARENT_GREEN_VALUE, modes->transparentGreen); WRITE_PAIR(GLX_TRANSPARENT_BLUE_VALUE, modes->transparentBlue); WRITE_PAIR(GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha); WRITE_PAIR(GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex); WRITE_PAIR(GLX_SWAP_METHOD_OML, modes->swapMethod); WRITE_PAIR(GLX_SAMPLES_SGIS, modes->samples); WRITE_PAIR(GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers); WRITE_PAIR(GLX_VISUAL_SELECT_GROUP_SGIX, modes->visualSelectGroup); WRITE_PAIR(GLX_DRAWABLE_TYPE, modes->drawableType); WRITE_PAIR(GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb); WRITE_PAIR(GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba); WRITE_PAIR(GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture); WRITE_PAIR(GLX_BIND_TO_TEXTURE_TARGETS_EXT, modes->bindToTextureTargets); /* can't report honestly until mesa is fixed */ WRITE_PAIR(GLX_Y_INVERTED_EXT, GLX_DONT_CARE); if (modes->drawableType & GLX_PBUFFER_BIT) { WRITE_PAIR(GLX_MAX_PBUFFER_WIDTH, modes->maxPbufferWidth); WRITE_PAIR(GLX_MAX_PBUFFER_HEIGHT, modes->maxPbufferHeight); WRITE_PAIR(GLX_MAX_PBUFFER_PIXELS, modes->maxPbufferPixels); WRITE_PAIR(GLX_OPTIMAL_PBUFFER_WIDTH_SGIX, modes->optimalPbufferWidth); WRITE_PAIR(GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX, modes->optimalPbufferHeight); } /* Add attribute only if its value is not default. */ if (modes->sRGBCapable != GL_FALSE) { WRITE_PAIR(GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, modes->sRGBCapable); } /* Pad the remaining place with zeroes, so that attributes count is constant. */ while (p < __GLX_FBCONFIG_ATTRIBS_LENGTH) { WRITE_PAIR(0, 0); } assert(p == __GLX_FBCONFIG_ATTRIBS_LENGTH); if (client->swapped) { __GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH); } WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_FBCONFIG_ATTRIBS_LENGTH, (char *) buf); } return Success; } int __glXDisp_GetFBConfigs(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); return DoGetFBConfigs(cl, req->screen); } int __glXDisp_GetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; /* work around mesa bug, don't use REQUEST_SIZE_MATCH */ REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq); return DoGetFBConfigs(cl, req->screen); } GLboolean __glXDrawableInit(__GLXdrawable * drawable, __GLXscreen * screen, DrawablePtr pDraw, int type, XID drawId, __GLXconfig * config) { drawable->pDraw = pDraw; drawable->type = type; drawable->drawId = drawId; drawable->config = config; drawable->eventMask = 0; return GL_TRUE; } void __glXDrawableRelease(__GLXdrawable * drawable) { } static int DoCreateGLXDrawable(ClientPtr client, __GLXscreen * pGlxScreen, __GLXconfig * config, DrawablePtr pDraw, XID drawableId, XID glxDrawableId, int type) { __GLXdrawable *pGlxDraw; if (pGlxScreen->pScreen != pDraw->pScreen) return BadMatch; pGlxDraw = pGlxScreen->createDrawable(client, pGlxScreen, pDraw, drawableId, type, glxDrawableId, config); if (pGlxDraw == NULL) return BadAlloc; if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw)) { pGlxDraw->destroy(pGlxDraw); return BadAlloc; } /* * Windows aren't refcounted, so track both the X and the GLX window * so we get called regardless of destruction order. */ if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW && !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) { pGlxDraw->destroy(pGlxDraw); return BadAlloc; } return Success; } static int DoCreateGLXPixmap(ClientPtr client, __GLXscreen * pGlxScreen, __GLXconfig * config, XID drawableId, XID glxDrawableId) { DrawablePtr pDraw; int err; LEGAL_NEW_RESOURCE(glxDrawableId, client); err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess); if (err != Success) { client->errorValue = drawableId; return err; } if (pDraw->type != DRAWABLE_PIXMAP) { client->errorValue = drawableId; return BadPixmap; } err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId, glxDrawableId, GLX_DRAWABLE_PIXMAP); if (err == Success) ((PixmapPtr) pDraw)->refcnt++; return err; } static void determineTextureTarget(ClientPtr client, XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs) { GLenum target = 0; GLenum format = 0; int i, err; __GLXdrawable *pGlxDraw; if (!validGlxDrawable(client, glxDrawableID, GLX_DRAWABLE_PIXMAP, DixWriteAccess, &pGlxDraw, &err)) /* We just added it in CreatePixmap, so we should never get here. */ return; for (i = 0; i < numAttribs; i++) { if (attribs[2 * i] == GLX_TEXTURE_TARGET_EXT) { switch (attribs[2 * i + 1]) { case GLX_TEXTURE_2D_EXT: target = GL_TEXTURE_2D; break; case GLX_TEXTURE_RECTANGLE_EXT: target = GL_TEXTURE_RECTANGLE_ARB; break; } } if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT) format = attribs[2 * i + 1]; } if (!target) { int w = pGlxDraw->pDraw->width, h = pGlxDraw->pDraw->height; if (h & (h - 1) || w & (w - 1)) target = GL_TEXTURE_RECTANGLE_ARB; else target = GL_TEXTURE_2D; } pGlxDraw->target = target; pGlxDraw->format = format; } int __glXDisp_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) return err; return DoCreateGLXPixmap(cl->client, pGlxScreen, config, req->pixmap, req->glxpixmap); } int __glXDisp_CreatePixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) return err; err = DoCreateGLXPixmap(cl->client, pGlxScreen, config, req->pixmap, req->glxpixmap); if (err != Success) return err; determineTextureTarget(cl->client, req->glxpixmap, (CARD32 *) (req + 1), req->numAttribs); return Success; } int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateGLXPixmapWithConfigSGIXReq *req = (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) return err; return DoCreateGLXPixmap(cl->client, pGlxScreen, config, req->pixmap, req->glxpixmap); } static int DoDestroyDrawable(__GLXclientState * cl, XID glxdrawable, int type) { __GLXdrawable *pGlxDraw; int err; if (!validGlxDrawable(cl->client, glxdrawable, type, DixDestroyAccess, &pGlxDraw, &err)) return err; FreeResource(glxdrawable, FALSE); return Success; } int __glXDisp_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); } int __glXDisp_DestroyPixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc; /* should be REQUEST_SIZE_MATCH, but mesa's glXDestroyPixmap used to set * length to 3 instead of 2 */ REQUEST_AT_LEAST_SIZE(xGLXDestroyPixmapReq); return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); } static int DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, int width, int height, XID glxDrawableId) { __GLXconfig *config; __GLXscreen *pGlxScreen; PixmapPtr pPixmap; int err; LEGAL_NEW_RESOURCE(glxDrawableId, client); if (!validGlxScreen(client, screenNum, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(client, pGlxScreen, fbconfigId, &config, &err)) return err; __glXenterServer(GL_FALSE); pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen, width, height, config->rgbBits, 0); __glXleaveServer(GL_FALSE); if (!pPixmap) return BadAlloc; /* Assign the pixmap the same id as the pbuffer and add it as a * resource so it and the DRI2 drawable will be reclaimed when the * pbuffer is destroyed. */ pPixmap->drawable.id = glxDrawableId; if (!AddResource(pPixmap->drawable.id, RT_PIXMAP, pPixmap)) return BadAlloc; return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable, glxDrawableId, glxDrawableId, GLX_DRAWABLE_PBUFFER); } int __glXDisp_CreatePbuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; CARD32 *attrs; int width, height, i; REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); attrs = (CARD32 *) (req + 1); width = 0; height = 0; for (i = 0; i < req->numAttribs; i++) { switch (attrs[i * 2]) { case GLX_PBUFFER_WIDTH: width = attrs[i * 2 + 1]; break; case GLX_PBUFFER_HEIGHT: height = attrs[i * 2 + 1]; break; case GLX_LARGEST_PBUFFER: /* FIXME: huh... */ break; } } return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, width, height, req->pbuffer); } int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); /* * We should really handle attributes correctly, but this extension * is so rare I have difficulty caring. */ return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, req->width, req->height, req->pbuffer); } int __glXDisp_DestroyPbuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); } int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); } static int DoChangeDrawableAttributes(ClientPtr client, XID glxdrawable, int numAttribs, CARD32 *attribs) { __GLXdrawable *pGlxDraw; int i, err; if (!validGlxDrawable(client, glxdrawable, GLX_DRAWABLE_ANY, DixSetAttrAccess, &pGlxDraw, &err)) return err; for (i = 0; i < numAttribs; i++) { switch (attribs[i * 2]) { case GLX_EVENT_MASK: /* All we do is to record the event mask so we can send it * back when queried. We never actually clobber the * pbuffers, so we never need to send out the event. */ pGlxDraw->eventMask = attribs[i * 2 + 1]; break; } } return Success; } int __glXDisp_ChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXChangeDrawableAttributesReq *req = (xGLXChangeDrawableAttributesReq *) pc; REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } #if 0 /* mesa sends an additional 8 bytes */ REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3); #else if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len) return BadLength; #endif return DoChangeDrawableAttributes(cl->client, req->drawable, req->numAttribs, (CARD32 *) (req + 1)); } int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXChangeDrawableAttributesSGIXReq *req = (xGLXChangeDrawableAttributesSGIXReq *) pc; REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); return DoChangeDrawableAttributes(cl->client, req->drawable, req->numAttribs, (CARD32 *) (req + 1)); } int __glXDisp_CreateWindow(__GLXclientState * cl, GLbyte * pc) { xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; ClientPtr client = cl->client; DrawablePtr pDraw; int err; REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); LEGAL_NEW_RESOURCE(req->glxwindow, client); if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err)) return err; err = dixLookupDrawable(&pDraw, req->window, client, 0, DixAddAccess); if (err != Success || pDraw->type != DRAWABLE_WINDOW) { client->errorValue = req->window; return BadWindow; } if (!validGlxFBConfigForWindow(client, config, pDraw, &err)) return err; return DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, req->window, req->glxwindow, GLX_DRAWABLE_WINDOW); } int __glXDisp_DestroyWindow(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; /* mesa's glXDestroyWindow used to set length to 3 instead of 2 */ REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq); return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW); } /*****************************************************************************/ /* ** NOTE: There is no portable implementation for swap buffers as of ** this time that is of value. Consequently, this code must be ** implemented by somebody other than SGI. */ int __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; GLXContextTag tag; XID drawId; __GLXcontext *glxc = NULL; __GLXdrawable *pGlxDraw; int error; REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); tag = req->contextTag; drawId = req->drawable; if (tag) { glxc = __glXLookupContextByTag(cl, tag); if (!glxc) { return __glXError(GLXBadContextTag); } /* ** The calling thread is swapping its current drawable. In this case, ** glxSwapBuffers is in both GL and X streams, in terms of ** sequentiality. */ if (__glXForceCurrent(cl, tag, &error)) { /* ** Do whatever is needed to make sure that all preceding requests ** in both streams are completed before the swap is executed. */ glFinish(); glxc->hasUnflushedCommands = GL_FALSE; } else { return error; } } pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error); if (pGlxDraw == NULL) return error; if (pGlxDraw->type == DRAWABLE_WINDOW && (*pGlxDraw->swapBuffers) (cl->client, pGlxDraw) == GL_FALSE) return __glXError(GLXBadDrawable); return Success; } static int DoQueryContext(__GLXclientState * cl, GLXContextID gcId) { ClientPtr client = cl->client; __GLXcontext *ctx; xGLXQueryContextInfoEXTReply reply; int nProps = 3; int sendBuf[nProps * 2]; int nReplyBytes; int err; if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err)) return err; reply = (xGLXQueryContextInfoEXTReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = nProps << 1, .n = nProps }; nReplyBytes = reply.length << 2; sendBuf[0] = GLX_SHARE_CONTEXT_EXT; sendBuf[1] = (int) (ctx->share_id); sendBuf[2] = GLX_VISUAL_ID_EXT; sendBuf[3] = (int) (ctx->config->visualID); sendBuf[4] = GLX_SCREEN_EXT; sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum); if (client->swapped) { __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); } else { WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); WriteToClient(client, nReplyBytes, sendBuf); } return Success; } int __glXDisp_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); return DoQueryContext(cl, req->context); } int __glXDisp_QueryContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; REQUEST_SIZE_MATCH(xGLXQueryContextReq); return DoQueryContext(cl, req->context); } int __glXDisp_BindTexImageEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; ClientPtr client = cl->client; __GLXcontext *context; __GLXdrawable *pGlxDraw; GLXDrawable drawId; int buffer; int error; CARD32 num_attribs; if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len) return BadLength; pc += __GLX_VENDPRIV_HDR_SIZE; drawId = *((CARD32 *) (pc)); buffer = *((INT32 *) (pc + 4)); num_attribs = *((CARD32 *) (pc + 8)); if (num_attribs > (UINT32_MAX >> 3)) { client->errorValue = num_attribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 12 + (num_attribs << 3)); if (buffer != GLX_FRONT_LEFT_EXT) return __glXError(GLXBadPixmap); context = __glXForceCurrent(cl, req->contextTag, &error); if (!context) return error; if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP, DixReadAccess, &pGlxDraw, &error)) return error; if (!context->textureFromPixmap) return __glXError(GLXUnsupportedPrivateRequest); return context->textureFromPixmap->bindTexImage(context, buffer, pGlxDraw); } int __glXDisp_ReleaseTexImageEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; ClientPtr client = cl->client; __GLXdrawable *pGlxDraw; __GLXcontext *context; GLXDrawable drawId; int buffer; int error; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); pc += __GLX_VENDPRIV_HDR_SIZE; drawId = *((CARD32 *) (pc)); buffer = *((INT32 *) (pc + 4)); context = __glXForceCurrent(cl, req->contextTag, &error); if (!context) return error; if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP, DixReadAccess, &pGlxDraw, &error)) return error; if (!context->textureFromPixmap) return __glXError(GLXUnsupportedPrivateRequest); return context->textureFromPixmap->releaseTexImage(context, buffer, pGlxDraw); } int __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLXContextTag tag = req->contextTag; __GLXcontext *glxc = NULL; __GLXdrawable *pGlxDraw; ClientPtr client = cl->client; GLXDrawable drawId; int error; int x, y, width, height; (void) client; (void) req; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); pc += __GLX_VENDPRIV_HDR_SIZE; drawId = *((CARD32 *) (pc)); x = *((INT32 *) (pc + 4)); y = *((INT32 *) (pc + 8)); width = *((INT32 *) (pc + 12)); height = *((INT32 *) (pc + 16)); if (tag) { glxc = __glXLookupContextByTag(cl, tag); if (!glxc) { return __glXError(GLXBadContextTag); } /* ** The calling thread is swapping its current drawable. In this case, ** glxSwapBuffers is in both GL and X streams, in terms of ** sequentiality. */ if (__glXForceCurrent(cl, tag, &error)) { /* ** Do whatever is needed to make sure that all preceding requests ** in both streams are completed before the swap is executed. */ glFinish(); glxc->hasUnflushedCommands = GL_FALSE; } else { return error; } } pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error); if (!pGlxDraw) return error; if (pGlxDraw == NULL || pGlxDraw->type != GLX_DRAWABLE_WINDOW || pGlxDraw->copySubBuffer == NULL) return __glXError(GLXBadDrawable); (*pGlxDraw->copySubBuffer) (pGlxDraw, x, y, width, height); return Success; } /* ** Get drawable attributes */ static int DoGetDrawableAttributes(__GLXclientState * cl, XID drawId) { ClientPtr client = cl->client; xGLXGetDrawableAttributesReply reply; __GLXdrawable *pGlxDraw = NULL; DrawablePtr pDraw; CARD32 attributes[14]; int num = 0, error; if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, DixGetAttrAccess, &pGlxDraw, &error)) { /* hack for GLX 1.2 naked windows */ int err = dixLookupWindow((WindowPtr *)&pDraw, drawId, client, DixGetAttrAccess); if (err != Success) return error; } if (pGlxDraw) pDraw = pGlxDraw->pDraw; attributes[2*num] = GLX_Y_INVERTED_EXT; attributes[2*num+1] = GL_FALSE; num++; attributes[2*num] = GLX_WIDTH; attributes[2*num+1] = pDraw->width; num++; attributes[2*num] = GLX_HEIGHT; attributes[2*num+1] = pDraw->height; num++; if (pGlxDraw) { attributes[2*num] = GLX_TEXTURE_TARGET_EXT; attributes[2*num+1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT : GLX_TEXTURE_RECTANGLE_EXT; num++; attributes[2*num] = GLX_EVENT_MASK; attributes[2*num+1] = pGlxDraw->eventMask; num++; attributes[2*num] = GLX_FBCONFIG_ID; attributes[2*num+1] = pGlxDraw->config->fbconfigID; num++; if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) { attributes[2*num] = GLX_PRESERVED_CONTENTS; attributes[2*num+1] = GL_TRUE; num++; } } reply = (xGLXGetDrawableAttributesReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = num << 1, .numAttribs = num }; if (client->swapped) { __glXSwapGetDrawableAttributesReply(client, &reply, attributes); } else { WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply); WriteToClient(client, reply.length * sizeof(CARD32), attributes); } return Success; } int __glXDisp_GetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *) pc; /* this should be REQUEST_SIZE_MATCH, but mesa sends an additional 4 bytes */ REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq); return DoGetDrawableAttributes(cl, req->drawable); } int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetDrawableAttributesSGIXReq *req = (xGLXGetDrawableAttributesSGIXReq *) pc; REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); return DoGetDrawableAttributes(cl, req->drawable); } /************************************************************************/ /* ** Render and Renderlarge are not in the GLX API. They are used by the GLX ** client library to send batches of GL rendering commands. */ /* ** Execute all the drawing commands in a request. */ int __glXDisp_Render(__GLXclientState * cl, GLbyte * pc) { xGLXRenderReq *req; ClientPtr client = cl->client; int left, cmdlen, error; int commandsDone; CARD16 opcode; __GLXrenderHeader *hdr; __GLXcontext *glxc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXRenderReq); req = (xGLXRenderReq *) pc; if (client->swapped) { __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); } glxc = __glXForceCurrent(cl, req->contextTag, &error); if (!glxc) { return error; } commandsDone = 0; pc += sz_xGLXRenderReq; left = (req->length << 2) - sz_xGLXRenderReq; while (left > 0) { __GLXrenderSizeData entry; int extra = 0; __GLXdispatchRenderProcPtr proc; int err; if (left < sizeof(__GLXrenderHeader)) return BadLength; /* ** Verify that the header length and the overall length agree. ** Also, each command must be word aligned. */ hdr = (__GLXrenderHeader *) pc; if (client->swapped) { __GLX_SWAP_SHORT(&hdr->length); __GLX_SWAP_SHORT(&hdr->opcode); } cmdlen = hdr->length; opcode = hdr->opcode; if (left < cmdlen) return BadLength; /* ** Check for core opcodes and grab entry data. */ err = __glXGetProtocolSizeData(&Render_dispatch_info, opcode, &entry); proc = (__GLXdispatchRenderProcPtr) __glXGetProtocolDecodeFunction(&Render_dispatch_info, opcode, client->swapped); if ((err < 0) || (proc == NULL)) { client->errorValue = commandsDone; return __glXError(GLXBadRenderRequest); } if (cmdlen < entry.bytes) { return BadLength; } if (entry.varsize) { /* variable size command */ extra = (*entry.varsize) (pc + __GLX_RENDER_HDR_SIZE, client->swapped, left - __GLX_RENDER_HDR_SIZE); if (extra < 0) { return BadLength; } } if (cmdlen != safe_pad(safe_add(entry.bytes, extra))) { return BadLength; } /* ** Skip over the header and execute the command. We allow the ** caller to trash the command memory. This is useful especially ** for things that require double alignment - they can just shift ** the data towards lower memory (trashing the header) by 4 bytes ** and achieve the required alignment. */ (*proc) (pc + __GLX_RENDER_HDR_SIZE); pc += cmdlen; left -= cmdlen; commandsDone++; } glxc->hasUnflushedCommands = GL_TRUE; return Success; } /* ** Execute a large rendering request (one that spans multiple X requests). */ int __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) { xGLXRenderLargeReq *req; ClientPtr client = cl->client; size_t dataBytes; __GLXrenderLargeHeader *hdr; __GLXcontext *glxc; int error; CARD16 opcode; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq); req = (xGLXRenderLargeReq *) pc; if (client->swapped) { __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->dataBytes); __GLX_SWAP_SHORT(&req->requestNumber); __GLX_SWAP_SHORT(&req->requestTotal); } glxc = __glXForceCurrent(cl, req->contextTag, &error); if (!glxc) { /* Reset in case this isn't 1st request. */ __glXResetLargeCommandStatus(cl); return error; } if (safe_pad(req->dataBytes) < 0) return BadLength; dataBytes = req->dataBytes; /* ** Check the request length. */ if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) { client->errorValue = req->length; /* Reset in case this isn't 1st request. */ __glXResetLargeCommandStatus(cl); return BadLength; } pc += sz_xGLXRenderLargeReq; if (cl->largeCmdRequestsSoFar == 0) { __GLXrenderSizeData entry; int extra = 0; int left = (req->length << 2) - sz_xGLXRenderLargeReq; size_t cmdlen; int err; /* ** This is the first request of a multi request command. ** Make enough space in the buffer, then copy the entire request. */ if (req->requestNumber != 1) { client->errorValue = req->requestNumber; return __glXError(GLXBadLargeRequest); } if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE) return BadLength; hdr = (__GLXrenderLargeHeader *) pc; if (client->swapped) { __GLX_SWAP_INT(&hdr->length); __GLX_SWAP_INT(&hdr->opcode); } opcode = hdr->opcode; if ((cmdlen = safe_pad(hdr->length)) < 0) return BadLength; /* ** Check for core opcodes and grab entry data. */ err = __glXGetProtocolSizeData(&Render_dispatch_info, opcode, &entry); if (err < 0) { client->errorValue = opcode; return __glXError(GLXBadLargeRequest); } if (entry.varsize) { /* ** If it's a variable-size command (a command whose length must ** be computed from its parameters), all the parameters needed ** will be in the 1st request, so it's okay to do this. */ extra = (*entry.varsize) (pc + __GLX_RENDER_LARGE_HDR_SIZE, client->swapped, left - __GLX_RENDER_LARGE_HDR_SIZE); if (extra < 0) { return BadLength; } } /* the +4 is safe because we know entry.bytes is small */ if (cmdlen != safe_pad(safe_add(entry.bytes + 4, extra))) { return BadLength; } /* ** Make enough space in the buffer, then copy the entire request. */ if (cl->largeCmdBufSize < cmdlen) { GLbyte *newbuf = cl->largeCmdBuf; if (!(newbuf = realloc(newbuf, cmdlen))) return BadAlloc; cl->largeCmdBuf = newbuf; cl->largeCmdBufSize = cmdlen; } memcpy(cl->largeCmdBuf, pc, dataBytes); cl->largeCmdBytesSoFar = dataBytes; cl->largeCmdBytesTotal = cmdlen; cl->largeCmdRequestsSoFar = 1; cl->largeCmdRequestsTotal = req->requestTotal; return Success; } else { /* ** We are receiving subsequent (i.e. not the first) requests of a ** multi request command. */ int bytesSoFar; /* including this packet */ /* ** Check the request number and the total request count. */ if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) { client->errorValue = req->requestNumber; __glXResetLargeCommandStatus(cl); return __glXError(GLXBadLargeRequest); } if (req->requestTotal != cl->largeCmdRequestsTotal) { client->errorValue = req->requestTotal; __glXResetLargeCommandStatus(cl); return __glXError(GLXBadLargeRequest); } /* ** Check that we didn't get too much data. */ if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) { client->errorValue = dataBytes; __glXResetLargeCommandStatus(cl); return __glXError(GLXBadLargeRequest); } if (bytesSoFar > cl->largeCmdBytesTotal) { client->errorValue = dataBytes; __glXResetLargeCommandStatus(cl); return __glXError(GLXBadLargeRequest); } memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); cl->largeCmdBytesSoFar += dataBytes; cl->largeCmdRequestsSoFar++; if (req->requestNumber == cl->largeCmdRequestsTotal) { __GLXdispatchRenderProcPtr proc; /* ** This is the last request; it must have enough bytes to complete ** the command. */ /* NOTE: the pad macro below is needed because the client library ** pads the total byte count, but not the per-request byte counts. ** The Protocol Encoding says the total byte count should not be ** padded, so a proposal will be made to the ARB to relax the ** padding constraint on the total byte count, thus preserving ** backward compatibility. Meanwhile, the padding done below ** fixes a bug that did not allow large commands of odd sizes to ** be accepted by the server. */ if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) { client->errorValue = dataBytes; __glXResetLargeCommandStatus(cl); return __glXError(GLXBadLargeRequest); } hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf; /* ** The opcode and length field in the header had already been ** swapped when the first request was received. ** ** Use the opcode to index into the procedure table. */ opcode = hdr->opcode; proc = (__GLXdispatchRenderProcPtr) __glXGetProtocolDecodeFunction(&Render_dispatch_info, opcode, client->swapped); if (proc == NULL) { client->errorValue = opcode; return __glXError(GLXBadLargeRequest); } /* ** Skip over the header and execute the command. */ (*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); glxc->hasUnflushedCommands = GL_TRUE; /* ** Reset for the next RenderLarge series. */ __glXResetLargeCommandStatus(cl); } else { /* ** This is neither the first nor the last request. */ } return Success; } } /************************************************************************/ /* ** No support is provided for the vendor-private requests other than ** allocating the entry points in the dispatch table. */ int __glXDisp_VendorPrivate(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLint vendorcode = req->vendorCode; __GLXdispatchVendorPrivProcPtr proc; REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); proc = (__GLXdispatchVendorPrivProcPtr) __glXGetProtocolDecodeFunction(&VendorPriv_dispatch_info, vendorcode, 0); if (proc != NULL) { (*proc) (cl, (GLbyte *) req); return Success; } cl->client->errorValue = req->vendorCode; return __glXError(GLXUnsupportedPrivateRequest); } int __glXDisp_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLint vendorcode = req->vendorCode; __GLXdispatchVendorPrivProcPtr proc; REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); proc = (__GLXdispatchVendorPrivProcPtr) __glXGetProtocolDecodeFunction(&VendorPriv_dispatch_info, vendorcode, 0); if (proc != NULL) { return (*proc) (cl, (GLbyte *) req); } cl->client->errorValue = vendorcode; return __glXError(GLXUnsupportedPrivateRequest); } int __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; xGLXQueryExtensionsStringReply reply; __GLXscreen *pGlxScreen; size_t n, length; char *buf; int err; REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; n = strlen(pGlxScreen->GLXextensions) + 1; length = __GLX_PAD(n) >> 2; 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 = calloc(length, 4); if (buf == NULL) return BadAlloc; memcpy(buf, pGlxScreen->GLXextensions, n); if (client->swapped) { glxSwapQueryExtensionsStringReply(client, &reply, buf); } else { WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply); WriteToClient(client, (int) (length << 2), buf); } free(buf); return Success; } int __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc; xGLXQueryServerStringReply reply; size_t n, length; const char *ptr; char *buf; __GLXscreen *pGlxScreen; int err; char ver_str[16]; REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; switch (req->name) { case GLX_VENDOR: ptr = GLXServerVendorName; break; case GLX_VERSION: /* Return to the server version rather than the screen version * to prevent confusion when they do not match. */ snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion); ptr = ver_str; break; case GLX_EXTENSIONS: ptr = pGlxScreen->GLXextensions; break; default: return BadValue; } n = strlen(ptr) + 1; length = __GLX_PAD(n) >> 2; reply = (xGLXQueryServerStringReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = length, .n = n }; buf = calloc(length, 4); if (buf == NULL) { return BadAlloc; } memcpy(buf, ptr, n); if (client->swapped) { glxSwapQueryServerStringReply(client, &reply, buf); } else { WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); WriteToClient(client, (int) (length << 2), buf); } free(buf); return Success; } int __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc; const char *buf; REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); buf = (const char *) (req + 1); if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq))) return BadLength; free(cl->GLClientextensions); cl->GLClientextensions = strdup(buf); return Success; } #include void __glXsendSwapEvent(__GLXdrawable *drawable, int type, CARD64 ust, CARD64 msc, CARD32 sbc) { ClientPtr client = clients[CLIENT_ID(drawable->drawId)]; xGLXBufferSwapComplete2 wire = { .type = __glXEventBase + GLX_BufferSwapComplete }; if (!client) return; if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK)) return; wire.event_type = type; wire.drawable = drawable->drawId; wire.ust_hi = ust >> 32; wire.ust_lo = ust & 0xffffffff; wire.msc_hi = msc >> 32; wire.msc_lo = msc & 0xffffffff; wire.sbc = sbc; WriteEventsToClient(client, 1, (xEvent *) &wire); } #if PRESENT static void __glXpresentCompleteNotify(WindowPtr window, CARD8 present_kind, CARD8 present_mode, CARD32 serial, uint64_t ust, uint64_t msc) { __GLXdrawable *drawable; int glx_type; int rc; if (present_kind != PresentCompleteKindPixmap) return; rc = dixLookupResourceByType((void **) &drawable, window->drawable.id, __glXDrawableRes, serverClient, DixGetAttrAccess); if (rc != Success) return; if (present_mode == PresentCompleteModeFlip) glx_type = GLX_FLIP_COMPLETE_INTEL; else glx_type = GLX_BLIT_COMPLETE_INTEL; __glXsendSwapEvent(drawable, glx_type, ust, msc, serial); } #include void __glXregisterPresentCompleteNotify(void) { present_register_complete_notify(__glXpresentCompleteNotify); } #endif xorg-server-1.17.1/glx/renderpixswap.c0000664000175100017510000000664212274325511014654 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "unpack.h" #include "indirect_dispatch.h" void __glXDispSwap_SeparableFilter2D(GLbyte * pc) { __GLXdispatchConvolutionFilterHeader *hdr = (__GLXdispatchConvolutionFilterHeader *) pc; GLint hdrlen, image1len; __GLX_DECLARE_SWAP_VARIABLES; 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->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 ** the pixel data. */ glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment); /* XXX check this usage - internal code called ** a version without the packing parameters */ image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1, 0, hdr->rowLength, 0, hdr->skipRows, hdr->alignment); image1len = __GLX_PAD(image1len); glSeparableFilter2D(hdr->target, hdr->internalformat, hdr->width, hdr->height, hdr->format, hdr->type, ((GLubyte *) hdr + hdrlen), ((GLubyte *) hdr + hdrlen + image1len)); } xorg-server-1.17.1/glx/Makefile.in0000664000175100017510000007252212466505430013665 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @DRI2_AIGLX_TRUE@am__append_1 = -I$(top_srcdir)/hw/xfree86/dri2 @DRI2_AIGLX_TRUE@am__append_2 = glxdri2.c subdir = glx DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = libglx_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = indirect_dispatch.lo indirect_dispatch_swap.lo \ indirect_reqsize.lo indirect_size_get.lo indirect_table.lo am_libglx_la_OBJECTS = $(am__objects_1) clientinfo.lo createcontext.lo \ extension_string.lo indirect_util.lo indirect_program.lo \ indirect_texture_compression.lo glxcmds.lo glxcmdsswap.lo \ glxext.lo glxdriswrast.lo glxdricommon.lo glxscreens.lo \ render2.lo render2swap.lo renderpix.lo renderpixswap.lo \ rensize.lo single2.lo single2swap.lo singlepix.lo \ singlepixswap.lo singlesize.lo swap_interval.lo xfont.lo libglx_la_OBJECTS = $(am_libglx_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 = libglxdri_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libglxdri_la_SOURCES_DIST = glxdri2.c @DRI2_AIGLX_TRUE@am__objects_2 = glxdri2.lo am_libglxdri_la_OBJECTS = $(am__objects_2) libglxdri_la_OBJECTS = $(am_libglxdri_la_OBJECTS) @AIGLX_DRI_LOADER_TRUE@am_libglxdri_la_rpath = 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 = $(libglx_la_SOURCES) $(libglxdri_la_SOURCES) DIST_SOURCES = $(libglx_la_SOURCES) $(am__libglxdri_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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @AIGLX_DRI_LOADER_TRUE@GLXDRI_LIBRARY = libglxdri.la noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) AM_CFLAGS = \ @DIX_CFLAGS@ \ @GL_CFLAGS@ \ @XLIB_CFLAGS@ \ @LIBDRM_CFLAGS@ \ @GLX_DEFINES@ \ @GLX_ARCH_DEFINES@ # none yet #sdk_HEADERS = AM_CPPFLAGS = -I$(top_srcdir)/hw/xfree86/os-support \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/dri -I$(top_srcdir)/mi \ -I$(top_srcdir)/present $(am__append_1) indirect_sources = \ indirect_dispatch.c \ indirect_dispatch.h \ indirect_dispatch_swap.c \ indirect_reqsize.c \ indirect_reqsize.h \ indirect_size.h \ indirect_size_get.c \ indirect_size_get.h \ indirect_table.c libglxdri_la_SOURCES = $(am__append_2) libglxdri_la_LIBADD = $(DLOPEN_LIBS) libglx_la_SOURCES = \ $(indirect_sources) \ clientinfo.c \ createcontext.c \ extension_string.c \ extension_string.h \ indirect_util.c \ indirect_util.h \ indirect_program.c \ indirect_table.h \ indirect_texture_compression.c \ glxbyteorder.h \ glxcmds.c \ glxcmdsswap.c \ glxcontext.h \ glxdrawable.h \ glxext.c \ glxext.h \ glxdriswrast.c \ glxdricommon.c \ glxdricommon.h \ glxscreens.c \ glxscreens.h \ glxserver.h \ glxutil.h \ render2.c \ render2swap.c \ renderpix.c \ renderpixswap.c \ rensize.c \ single2.c \ single2swap.c \ singlepix.c \ singlepixswap.c \ singlesize.c \ singlesize.h \ swap_interval.c \ unpack.h \ xfont.c libglx_la_LIBADD = $(DLOPEN_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 glx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign glx/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libglx.la: $(libglx_la_OBJECTS) $(libglx_la_DEPENDENCIES) $(EXTRA_libglx_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libglx_la_OBJECTS) $(libglx_la_LIBADD) $(LIBS) libglxdri.la: $(libglxdri_la_OBJECTS) $(libglxdri_la_DEPENDENCIES) $(EXTRA_libglxdri_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libglxdri_la_rpath) $(libglxdri_la_OBJECTS) $(libglxdri_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/createcontext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extension_string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxcmds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxcmdsswap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxdri2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxdricommon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxdriswrast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxscreens.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_dispatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_dispatch_swap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_program.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_reqsize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_size_get.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_texture_compression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render2swap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renderpix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renderpixswap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rensize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/single2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/single2swap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/singlepix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/singlepixswap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/singlesize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap_interval.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfont.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/glx/rensize.c0000664000175100017510000003466212456571574013461 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "glxserver.h" #include "GL/glxproto.h" #include "unpack.h" #include "indirect_size.h" #include "indirect_reqsize.h" #define SWAPL(a) \ (((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \ ((a & 0xff00U)<<8) | ((a & 0xffU)<<24)) int __glXMap1dReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum target; GLint order; target = *(GLenum *) (pc + 16); order = *(GLint *) (pc + 20); if (swap) { target = SWAPL(target); order = SWAPL(order); } if (order < 1) return -1; return safe_mul(8, safe_mul(__glMap1d_size(target), order)); } int __glXMap1fReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum target; GLint order; target = *(GLenum *) (pc + 0); order = *(GLint *) (pc + 12); if (swap) { target = SWAPL(target); order = SWAPL(order); } if (order < 1) return -1; return safe_mul(4, safe_mul(__glMap1f_size(target), order)); } static int Map2Size(int k, int majorOrder, int minorOrder) { if (majorOrder < 1 || minorOrder < 1) return -1; return safe_mul(k, safe_mul(majorOrder, minorOrder)); } int __glXMap2dReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum target; GLint uorder, vorder; target = *(GLenum *) (pc + 32); uorder = *(GLint *) (pc + 36); vorder = *(GLint *) (pc + 40); if (swap) { target = SWAPL(target); uorder = SWAPL(uorder); vorder = SWAPL(vorder); } return safe_mul(8, Map2Size(__glMap2d_size(target), uorder, vorder)); } int __glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen) { GLenum target; GLint uorder, vorder; target = *(GLenum *) (pc + 0); uorder = *(GLint *) (pc + 12); vorder = *(GLint *) (pc + 24); if (swap) { target = SWAPL(target); uorder = SWAPL(uorder); vorder = SWAPL(vorder); } return safe_mul(4, Map2Size(__glMap2f_size(target), uorder, vorder)); } /** * Calculate the size of an image. * * The size of an image sent to the server from the client or sent from the * server to the client is calculated. The size is based on the dimensions * of the image, the type of pixel data, padding in the image, and the * alignment requirements of the image. * * \param format Format of the pixels. Same as the \c format parameter * to \c glTexImage1D * \param type Type of the pixel data. Same as the \c type parameter * to \c glTexImage1D * \param target Typically the texture target of the image. If the * target is one of \c GL_PROXY_*, the size returned is * always zero. For uses that do not have a texture target * (e.g, glDrawPixels), zero should be specified. * \param w Width of the image data. Must be >= 1. * \param h Height of the image data. Must be >= 1, even for 1D * images. * \param d Depth of the image data. Must be >= 1, even for 1D or * 2D images. * \param imageHeight If non-zero, defines the true height of a volumetric * image. This value will be used instead of \c h for * calculating the size of the image. * \param rowLength If non-zero, defines the true width of an image. This * value will be used instead of \c w for calculating the * size of the image. * \param skipImages Number of extra layers of image data in a volumtric * image that are to be skipped before the real data. * \param skipRows Number of extra rows of image data in an image that are * to be skipped before the real data. * \param alignment Specifies the alignment for the start of each pixel row * in memory. This value must be one of 1, 2, 4, or 8. * * \returns * The size of the image is returned. If the specified \c format and \c type * are invalid, -1 is returned. If \c target is one of \c GL_PROXY_*, zero * is returned. */ int __glXImageSize(GLenum format, GLenum type, GLenum target, GLsizei w, GLsizei h, GLsizei d, GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows, GLint alignment) { GLint bytesPerElement, elementsPerGroup, groupsPerRow; GLint groupSize, rowSize, padding, imageSize; if (w == 0 || h == 0 || d == 0) return 0; if (w < 0 || h < 0 || d < 0 || (type == GL_BITMAP && (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) { return -1; } /* proxy targets have no data */ switch (target) { case GL_PROXY_TEXTURE_1D: case GL_PROXY_TEXTURE_2D: case GL_PROXY_TEXTURE_3D: case GL_PROXY_TEXTURE_4D_SGIS: case GL_PROXY_TEXTURE_CUBE_MAP: case GL_PROXY_TEXTURE_RECTANGLE_ARB: case GL_PROXY_HISTOGRAM: case GL_PROXY_COLOR_TABLE: case GL_PROXY_TEXTURE_COLOR_TABLE_SGI: case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: case GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP: return 0; } /* real data has to have real sizes */ if (imageHeight < 0 || rowLength < 0 || skipImages < 0 || skipRows < 0) return -1; if (alignment != 1 && alignment != 2 && alignment != 4 && alignment != 8) return -1; if (type == GL_BITMAP) { if (rowLength > 0) { groupsPerRow = rowLength; } else { groupsPerRow = w; } rowSize = bits_to_bytes(groupsPerRow); if (rowSize < 0) return -1; padding = (rowSize % alignment); if (padding) { rowSize += alignment - padding; } return safe_mul(safe_add(h, skipRows), rowSize); } else { switch (format) { case GL_COLOR_INDEX: case GL_STENCIL_INDEX: case GL_DEPTH_COMPONENT: case GL_RED: case GL_GREEN: case GL_BLUE: case GL_ALPHA: case GL_LUMINANCE: case GL_INTENSITY: case GL_RED_INTEGER_EXT: case GL_GREEN_INTEGER_EXT: case GL_BLUE_INTEGER_EXT: case GL_ALPHA_INTEGER_EXT: case GL_LUMINANCE_INTEGER_EXT: elementsPerGroup = 1; break; case GL_422_EXT: case GL_422_REV_EXT: case GL_422_AVERAGE_EXT: case GL_422_REV_AVERAGE_EXT: case GL_DEPTH_STENCIL_NV: case GL_DEPTH_STENCIL_MESA: case GL_YCBCR_MESA: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE_ALPHA_INTEGER_EXT: elementsPerGroup = 2; break; case GL_RGB: case GL_BGR: case GL_RGB_INTEGER_EXT: case GL_BGR_INTEGER_EXT: elementsPerGroup = 3; break; case GL_RGBA: case GL_BGRA: case GL_RGBA_INTEGER_EXT: case GL_BGRA_INTEGER_EXT: case GL_ABGR_EXT: elementsPerGroup = 4; break; default: return -1; } switch (type) { case GL_UNSIGNED_BYTE: case GL_BYTE: bytesPerElement = 1; break; case GL_UNSIGNED_BYTE_3_3_2: case GL_UNSIGNED_BYTE_2_3_3_REV: bytesPerElement = 1; elementsPerGroup = 1; break; case GL_UNSIGNED_SHORT: case GL_SHORT: bytesPerElement = 2; break; case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4_REV: case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_1_5_5_5_REV: case GL_UNSIGNED_SHORT_8_8_APPLE: case GL_UNSIGNED_SHORT_8_8_REV_APPLE: case GL_UNSIGNED_SHORT_15_1_MESA: case GL_UNSIGNED_SHORT_1_15_REV_MESA: bytesPerElement = 2; elementsPerGroup = 1; break; case GL_INT: case GL_UNSIGNED_INT: case GL_FLOAT: bytesPerElement = 4; break; case GL_UNSIGNED_INT_8_8_8_8: case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: case GL_UNSIGNED_INT_24_8_NV: case GL_UNSIGNED_INT_24_8_MESA: case GL_UNSIGNED_INT_8_24_REV_MESA: bytesPerElement = 4; elementsPerGroup = 1; break; default: return -1; } /* known safe by the switches above, not checked */ groupSize = bytesPerElement * elementsPerGroup; if (rowLength > 0) { groupsPerRow = rowLength; } else { groupsPerRow = w; } if ((rowSize = safe_mul(groupsPerRow, groupSize)) < 0) return -1; padding = (rowSize % alignment); if (padding) { rowSize += alignment - padding; } if (imageHeight > 0) h = imageHeight; h = safe_add(h, skipRows); imageSize = safe_mul(h, rowSize); return safe_mul(safe_add(d, skipImages), imageSize); } } /* XXX this is used elsewhere - should it be exported from glxserver.h? */ int __glXTypeSize(GLenum enm) { switch (enm) { case GL_BYTE: return sizeof(GLbyte); case GL_UNSIGNED_BYTE: return sizeof(GLubyte); case GL_SHORT: return sizeof(GLshort); case GL_UNSIGNED_SHORT: return sizeof(GLushort); case GL_INT: return sizeof(GLint); case GL_UNSIGNED_INT: return sizeof(GLint); case GL_FLOAT: return sizeof(GLfloat); case GL_DOUBLE: return sizeof(GLdouble); default: return -1; } } int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap, int reqlen) { __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc; __GLXdispatchDrawArraysComponentHeader *compHeader; GLint numVertexes = hdr->numVertexes; GLint numComponents = hdr->numComponents; GLint arrayElementSize = 0; GLint x, size; int i; if (swap) { numVertexes = SWAPL(numVertexes); numComponents = SWAPL(numComponents); } pc += sizeof(__GLXdispatchDrawArraysHeader); reqlen -= sizeof(__GLXdispatchDrawArraysHeader); size = safe_mul(sizeof(__GLXdispatchDrawArraysComponentHeader), numComponents); if (size < 0 || reqlen < 0 || reqlen < size) return -1; compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; for (i = 0; i < numComponents; i++) { GLenum datatype = compHeader[i].datatype; GLint numVals = compHeader[i].numVals; GLint component = compHeader[i].component; if (swap) { datatype = SWAPL(datatype); numVals = SWAPL(numVals); component = SWAPL(component); } switch (component) { case GL_VERTEX_ARRAY: case GL_COLOR_ARRAY: case GL_TEXTURE_COORD_ARRAY: break; case GL_SECONDARY_COLOR_ARRAY: case GL_NORMAL_ARRAY: if (numVals != 3) { /* bad size */ return -1; } break; case GL_FOG_COORD_ARRAY: case GL_INDEX_ARRAY: if (numVals != 1) { /* bad size */ return -1; } break; case GL_EDGE_FLAG_ARRAY: if ((numVals != 1) && (datatype != GL_UNSIGNED_BYTE)) { /* bad size or bad type */ return -1; } break; default: /* unknown component type */ return -1; } x = safe_pad(safe_mul(numVals, __glXTypeSize(datatype))); if ((arrayElementSize = safe_add(arrayElementSize, x)) < 0) return -1; pc += sizeof(__GLXdispatchDrawArraysComponentHeader); } return safe_add(size, safe_mul(numVertexes, arrayElementSize)); } int __glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen) { __GLXdispatchConvolutionFilterHeader *hdr = (__GLXdispatchConvolutionFilterHeader *) pc; GLint image1size, image2size; GLenum format = hdr->format; GLenum type = hdr->type; GLint w = hdr->width; GLint h = hdr->height; GLint rowLength = hdr->rowLength; GLint alignment = hdr->alignment; if (swap) { format = SWAPL(format); type = SWAPL(type); w = SWAPL(w); h = SWAPL(h); rowLength = SWAPL(rowLength); alignment = SWAPL(alignment); } /* XXX Should rowLength be used for either or both image? */ image1size = __glXImageSize(format, type, 0, w, 1, 1, 0, rowLength, 0, 0, alignment); image2size = __glXImageSize(format, type, 0, h, 1, 1, 0, rowLength, 0, 0, alignment); return safe_add(safe_pad(image1size), image2size); } xorg-server-1.17.1/glx/render2.c0000664000175100017510000001735612274325511013326 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "unpack.h" #include "indirect_size.h" #include "indirect_dispatch.h" void __glXDisp_Map1f(GLbyte * pc) { GLint order, k; GLfloat u1, u2, *points; GLenum target; target = *(GLenum *) (pc + 0); order = *(GLint *) (pc + 12); u1 = *(GLfloat *) (pc + 4); u2 = *(GLfloat *) (pc + 8); points = (GLfloat *) (pc + 16); k = __glMap1f_size(target); glMap1f(target, u1, u2, k, order, points); } void __glXDisp_Map2f(GLbyte * pc) { GLint uorder, vorder, ustride, vstride, k; GLfloat u1, u2, v1, v2, *points; GLenum target; target = *(GLenum *) (pc + 0); uorder = *(GLint *) (pc + 12); vorder = *(GLint *) (pc + 24); u1 = *(GLfloat *) (pc + 4); u2 = *(GLfloat *) (pc + 8); v1 = *(GLfloat *) (pc + 16); v2 = *(GLfloat *) (pc + 20); points = (GLfloat *) (pc + 28); k = __glMap2f_size(target); ustride = vorder * k; vstride = k; glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); } void __glXDisp_Map1d(GLbyte * pc) { GLint order, k; #ifdef __GLX_ALIGN64 GLint compsize; #endif GLenum target; GLdouble u1, u2, *points; target = *(GLenum *) (pc + 16); order = *(GLint *) (pc + 20); k = __glMap1d_size(target); #ifdef __GLX_ALIGN64 if (order < 0 || k < 0) { compsize = 0; } else { compsize = order * k; } #endif __GLX_GET_DOUBLE(u1, pc); __GLX_GET_DOUBLE(u2, pc + 8); pc += 24; #ifdef __GLX_ALIGN64 if (((unsigned long) pc) & 7) { /* ** Copy the doubles up 4 bytes, trashing the command but aligning ** the data in the process */ __GLX_MEM_COPY(pc - 4, pc, compsize * 8); points = (GLdouble *) (pc - 4); } else { points = (GLdouble *) pc; } #else points = (GLdouble *) pc; #endif glMap1d(target, u1, u2, k, order, points); } void __glXDisp_Map2d(GLbyte * pc) { GLdouble u1, u2, v1, v2, *points; GLint uorder, vorder, ustride, vstride, k; #ifdef __GLX_ALIGN64 GLint compsize; #endif GLenum target; target = *(GLenum *) (pc + 32); uorder = *(GLint *) (pc + 36); vorder = *(GLint *) (pc + 40); k = __glMap2d_size(target); #ifdef __GLX_ALIGN64 if (vorder < 0 || uorder < 0 || k < 0) { compsize = 0; } else { compsize = uorder * vorder * k; } #endif __GLX_GET_DOUBLE(u1, pc); __GLX_GET_DOUBLE(u2, pc + 8); __GLX_GET_DOUBLE(v1, pc + 16); __GLX_GET_DOUBLE(v2, pc + 24); pc += 44; ustride = vorder * k; vstride = k; #ifdef __GLX_ALIGN64 if (((unsigned long) pc) & 7) { /* ** Copy the doubles up 4 bytes, trashing the command but aligning ** the data in the process */ __GLX_MEM_COPY(pc - 4, pc, compsize * 8); points = (GLdouble *) (pc - 4); } else { points = (GLdouble *) pc; } #else points = (GLdouble *) pc; #endif glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); } void __glXDisp_DrawArrays(GLbyte * pc) { __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc; __GLXdispatchDrawArraysComponentHeader *compHeader; GLint numVertexes = hdr->numVertexes; GLint numComponents = hdr->numComponents; GLenum primType = hdr->primType; GLint stride = 0; int i; pc += sizeof(__GLXdispatchDrawArraysHeader); compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; /* compute stride (same for all component arrays) */ for (i = 0; i < numComponents; i++) { GLenum datatype = compHeader[i].datatype; GLint numVals = compHeader[i].numVals; stride += __GLX_PAD(numVals * __glXTypeSize(datatype)); } pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader); /* set up component arrays */ for (i = 0; i < numComponents; i++) { GLenum datatype = compHeader[i].datatype; GLint numVals = compHeader[i].numVals; GLenum component = compHeader[i].component; switch (component) { case GL_VERTEX_ARRAY: glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(numVals, datatype, stride, pc); break; case GL_NORMAL_ARRAY: glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(datatype, stride, pc); break; case GL_COLOR_ARRAY: glEnableClientState(GL_COLOR_ARRAY); glColorPointer(numVals, datatype, stride, pc); break; case GL_INDEX_ARRAY: glEnableClientState(GL_INDEX_ARRAY); glIndexPointer(datatype, stride, pc); break; case GL_TEXTURE_COORD_ARRAY: glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(numVals, datatype, stride, pc); break; case GL_EDGE_FLAG_ARRAY: glEnableClientState(GL_EDGE_FLAG_ARRAY); glEdgeFlagPointer(stride, (const GLboolean *) pc); break; case GL_SECONDARY_COLOR_ARRAY: { PFNGLSECONDARYCOLORPOINTERPROC SecondaryColorPointerEXT = __glGetProcAddress("glSecondaryColorPointerEXT"); glEnableClientState(GL_SECONDARY_COLOR_ARRAY); SecondaryColorPointerEXT(numVals, datatype, stride, pc); break; } case GL_FOG_COORD_ARRAY: { PFNGLFOGCOORDPOINTERPROC FogCoordPointerEXT = __glGetProcAddress("glFogCoordPointerEXT"); glEnableClientState(GL_FOG_COORD_ARRAY); FogCoordPointerEXT(datatype, stride, pc); break; } default: break; } pc += __GLX_PAD(numVals * __glXTypeSize(datatype)); } glDrawArrays(primType, 0, numVertexes); /* turn off anything we might have turned on */ glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_INDEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_EDGE_FLAG_ARRAY); glDisableClientState(GL_SECONDARY_COLOR_ARRAY); glDisableClientState(GL_FOG_COORD_ARRAY); } xorg-server-1.17.1/glx/glxcmdsswap.c0000664000175100017510000006531412456571574014334 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "glxserver.h" #include "glxutil.h" #include #include #include #include #include "glxext.h" #include "indirect_dispatch.h" #include "indirect_table.h" #include "indirect_util.h" /************************************************************************/ /* ** Byteswapping versions of GLX commands. In most cases they just swap ** the incoming arguments and then call the unswapped routine. For commands ** that have replies, a separate swapping routine for the reply is provided; ** it is called at the end of the unswapped routine. */ int __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXCreateContextReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->visual); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->shareList); return __glXDisp_CreateContext(cl, pc); } int __glXDispSwap_CreateNewContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->renderType); __GLX_SWAP_INT(&req->shareList); return __glXDisp_CreateNewContext(cl, pc); } int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateContextWithConfigSGIXReq *req = (xGLXCreateContextWithConfigSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->renderType); __GLX_SWAP_INT(&req->shareList); return __glXDisp_CreateContextWithConfigSGIX(cl, pc); } int __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXDestroyContextReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); return __glXDisp_DestroyContext(cl, pc); } int __glXDispSwap_MakeCurrent(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->oldContextTag); return __glXDisp_MakeCurrent(cl, pc); } int __glXDispSwap_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->readdrawable); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->oldContextTag); return __glXDisp_MakeContextCurrent(cl, pc); } int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->readable); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->oldContextTag); return __glXDisp_MakeCurrentReadSGI(cl, pc); } int __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXIsDirectReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); return __glXDisp_IsDirect(cl, pc); } int __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXQueryVersionReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->majorVersion); __GLX_SWAP_INT(&req->minorVersion); return __glXDisp_QueryVersion(cl, pc); } int __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXWaitGLReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); return __glXDisp_WaitGL(cl, pc); } int __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXWaitXReq *req = (xGLXWaitXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXWaitXReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); return __glXDisp_WaitX(cl, pc); } int __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXCopyContextReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->source); __GLX_SWAP_INT(&req->dest); __GLX_SWAP_INT(&req->mask); return __glXDisp_CopyContext(cl, pc); } int __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); __GLX_SWAP_INT(&req->screen); return __glXDisp_GetVisualConfigs(cl, pc); } int __glXDispSwap_GetFBConfigs(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); __GLX_SWAP_INT(&req->screen); return __glXDisp_GetFBConfigs(cl, pc); } int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq); __GLX_SWAP_INT(&req->screen); return __glXDisp_GetFBConfigsSGIX(cl, pc); } int __glXDispSwap_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->visual); __GLX_SWAP_INT(&req->pixmap); __GLX_SWAP_INT(&req->glxpixmap); return __glXDisp_CreateGLXPixmap(cl, pc); } int __glXDispSwap_CreatePixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; CARD32 *attribs; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->pixmap); __GLX_SWAP_INT(&req->glxpixmap); __GLX_SWAP_INT(&req->numAttribs); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); attribs = (CARD32 *) (req + 1); __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_CreatePixmap(cl, pc); } int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateGLXPixmapWithConfigSGIXReq *req = (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->pixmap); __GLX_SWAP_INT(&req->glxpixmap); return __glXDisp_CreateGLXPixmapWithConfigSGIX(cl, pc); } int __glXDispSwap_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->glxpixmap); return __glXDisp_DestroyGLXPixmap(cl, pc); } int __glXDispSwap_DestroyPixmap(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXDestroyGLXPixmapReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->glxpixmap); return __glXDisp_DestroyGLXPixmap(cl, pc); } int __glXDispSwap_QueryContext(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXQueryContextReq); __GLX_SWAP_INT(&req->context); return __glXDisp_QueryContext(cl, pc); } int __glXDispSwap_CreatePbuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->pbuffer); __GLX_SWAP_INT(&req->numAttribs); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); attribs = (CARD32 *) (req + 1); __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_CreatePbuffer(cl, pc); } int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->pbuffer); __GLX_SWAP_INT(&req->width); __GLX_SWAP_INT(&req->height); return __glXDisp_CreateGLXPbufferSGIX(cl, pc); } int __glXDispSwap_DestroyPbuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); __GLX_SWAP_INT(&req->pbuffer); return __glXDisp_DestroyPbuffer(cl, pc); } int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); __GLX_SWAP_INT(&req->pbuffer); return __glXDisp_DestroyGLXPbufferSGIX(cl, pc); } int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXChangeDrawableAttributesReq *req = (xGLXChangeDrawableAttributesReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->numAttribs); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len) return BadLength; attribs = (CARD32 *) (req + 1); __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_ChangeDrawableAttributes(cl, pc); } int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXChangeDrawableAttributesSGIXReq *req = (xGLXChangeDrawableAttributesSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->numAttribs); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); attribs = (CARD32 *) (req + 1); __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc); } int __glXDispSwap_CreateWindow(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->window); __GLX_SWAP_INT(&req->glxwindow); __GLX_SWAP_INT(&req->numAttribs); if (req->numAttribs > (UINT32_MAX >> 3)) { client->errorValue = req->numAttribs; return BadValue; } REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); attribs = (CARD32 *) (req + 1); __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_CreateWindow(cl, pc); } int __glXDispSwap_DestroyWindow(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq); __GLX_SWAP_INT(&req->glxwindow); return __glXDisp_DestroyWindow(cl, pc); } int __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->drawable); return __glXDisp_SwapBuffers(cl, pc); } int __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXUseXFontReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->font); __GLX_SWAP_INT(&req->first); __GLX_SWAP_INT(&req->count); __GLX_SWAP_INT(&req->listBase); return __glXDisp_UseXFont(cl, pc); } int __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); return __glXDisp_QueryExtensionsString(cl, pc); } int __glXDispSwap_QueryServerString(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->name); return __glXDisp_QueryServerString(cl, pc); } int __glXDispSwap_ClientInfo(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->major); __GLX_SWAP_INT(&req->minor); __GLX_SWAP_INT(&req->numbytes); return __glXDisp_ClientInfo(cl, pc); } int __glXDispSwap_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); return __glXDisp_QueryContextInfoEXT(cl, pc); } int __glXDispSwap_BindTexImageEXT(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLXDrawable *drawId; int *buffer; CARD32 *num_attribs; __GLX_DECLARE_SWAP_VARIABLES; if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len) return BadLength; pc += __GLX_VENDPRIV_HDR_SIZE; drawId = ((GLXDrawable *) (pc)); buffer = ((int *) (pc + 4)); num_attribs = ((CARD32 *) (pc + 8)); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(drawId); __GLX_SWAP_INT(buffer); __GLX_SWAP_INT(num_attribs); return __glXDisp_BindTexImageEXT(cl, (GLbyte *) pc); } int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLXDrawable *drawId; int *buffer; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); pc += __GLX_VENDPRIV_HDR_SIZE; drawId = ((GLXDrawable *) (pc)); buffer = ((int *) (pc + 4)); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(drawId); __GLX_SWAP_INT(buffer); return __glXDisp_ReleaseTexImageEXT(cl, (GLbyte *) pc); } int __glXDispSwap_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLXDrawable *drawId; int *buffer; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); (void) drawId; (void) buffer; pc += __GLX_VENDPRIV_HDR_SIZE; __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(pc); __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 8); __GLX_SWAP_INT(pc + 12); __GLX_SWAP_INT(pc + 16); return __glXDisp_CopySubBufferMESA(cl, pc); } int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *) pc; CARD32 *data; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); data = (CARD32 *) (req + 1); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(data); return __glXDisp_GetDrawableAttributesSGIX(cl, pc); } int __glXDispSwap_GetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); return __glXDisp_GetDrawableAttributes(cl, pc); } /************************************************************************/ /* ** Swap replies. */ void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply * reply) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->contextTag); WriteToClient(client, sz_xGLXMakeCurrentReply, reply); } void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); WriteToClient(client, sz_xGLXIsDirectReply, reply); } void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->majorVersion); __GLX_SWAP_INT(&reply->minorVersion); WriteToClient(client, sz_xGLXQueryVersionReply, reply); } void glxSwapQueryExtensionsStringReply(ClientPtr client, xGLXQueryExtensionsStringReply * reply, char *buf) { int length = reply->length; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); WriteToClient(client, length << 2, buf); } void glxSwapQueryServerStringReply(ClientPtr client, xGLXQueryServerStringReply * reply, char *buf) { int length = reply->length; __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); 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); } void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply * reply, int *buf) { int length = reply->length; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); WriteToClient(client, length << 2, buf); } void __glXSwapGetDrawableAttributesReply(ClientPtr client, xGLXGetDrawableAttributesReply * reply, CARD32 *buf) { int length = reply->length; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->numAttribs); WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); WriteToClient(client, length << 2, buf); } /************************************************************************/ /* ** Render and Renderlarge are not in the GLX API. They are used by the GLX ** client library to send batches of GL rendering commands. */ int __glXDispSwap_Render(__GLXclientState * cl, GLbyte * pc) { return __glXDisp_Render(cl, pc); } /* ** Execute a large rendering request (one that spans multiple X requests). */ int __glXDispSwap_RenderLarge(__GLXclientState * cl, GLbyte * pc) { return __glXDisp_RenderLarge(cl, pc); } /************************************************************************/ /* ** No support is provided for the vendor-private requests other than ** allocating these entry points in the dispatch table. */ int __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateReq *req; GLint vendorcode; __GLXdispatchVendorPrivProcPtr proc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); req = (xGLXVendorPrivateReq *) pc; __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->vendorCode); vendorcode = req->vendorCode; proc = (__GLXdispatchVendorPrivProcPtr) __glXGetProtocolDecodeFunction(&VendorPriv_dispatch_info, vendorcode, 1); if (proc != NULL) { (*proc) (cl, (GLbyte *) req); return Success; } cl->client->errorValue = req->vendorCode; return __glXError(GLXUnsupportedPrivateRequest); } int __glXDispSwap_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXVendorPrivateWithReplyReq *req; GLint vendorcode; __GLXdispatchVendorPrivProcPtr proc; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq); req = (xGLXVendorPrivateWithReplyReq *) pc; __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->vendorCode); vendorcode = req->vendorCode; proc = (__GLXdispatchVendorPrivProcPtr) __glXGetProtocolDecodeFunction(&VendorPriv_dispatch_info, vendorcode, 1); if (proc != NULL) { return (*proc) (cl, (GLbyte *) req); } cl->client->errorValue = req->vendorCode; return __glXError(GLXUnsupportedPrivateRequest); } xorg-server-1.17.1/glx/glxdri2.c0000664000175100017510000007621412456571574013354 00000000000000/* * Copyright © 2007 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 Red Hat, * Inc not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Red Hat, Inc makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * RED HAT, INC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL RED HAT, INC 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 #include #include #include #define _XF86DRI_SERVER_ #include #include #include #include "glxserver.h" #include "glxutil.h" #include "glxdricommon.h" #include #include "extension_string.h" typedef struct __GLXDRIscreen __GLXDRIscreen; typedef struct __GLXDRIcontext __GLXDRIcontext; typedef struct __GLXDRIdrawable __GLXDRIdrawable; #define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \ | __DRI_CTX_FLAG_FORWARD_COMPATIBLE \ | __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS) struct __GLXDRIscreen { __GLXscreen base; __DRIscreen *driScreen; void *driver; int fd; xf86EnterVTProc *enterVT; xf86LeaveVTProc *leaveVT; const __DRIcoreExtension *core; const __DRIdri2Extension *dri2; const __DRI2flushExtension *flush; const __DRIcopySubBufferExtension *copySubBuffer; const __DRIswapControlExtension *swapControl; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; unsigned char glx_enable_bits[__GLX_EXT_BYTES]; }; struct __GLXDRIcontext { __GLXcontext base; __DRIcontext *driContext; }; #define MAX_DRAWABLE_BUFFERS 5 struct __GLXDRIdrawable { __GLXdrawable base; __DRIdrawable *driDrawable; __GLXDRIscreen *screen; /* Dimensions as last reported by DRI2GetBuffers. */ int width; int height; __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS]; int count; XID dri2_id; }; static void __glXDRIdrawableDestroy(__GLXdrawable * drawable) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; const __DRIcoreExtension *core = private->screen->core; FreeResource(private->dri2_id, FALSE); (*core->destroyDrawable) (private->driDrawable); __glXDrawableRelease(drawable); free(private); } static void copy_box(__GLXdrawable * drawable, int dst, int src, int x, int y, int w, int h) { BoxRec box; RegionRec region; __GLXcontext *cx = lastGLContext; box.x1 = x; box.y1 = y; box.x2 = x + w; box.y2 = y + h; RegionInit(®ion, &box, 0); DRI2CopyRegion(drawable->pDraw, ®ion, dst, src); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); } } static void __glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable, int x, int y, int w, int h) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; copy_box(drawable, x, private->height - y - h, w, h, DRI2BufferFrontLeft, DRI2BufferBackLeft); } static void __glXDRIdrawableWaitX(__GLXdrawable * drawable) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; copy_box(drawable, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft, 0, 0, private->width, private->height); } static void __glXDRIdrawableWaitGL(__GLXdrawable * drawable) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; copy_box(drawable, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft, 0, 0, private->width, private->height); } static void __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, CARD32 sbc) { __GLXdrawable *drawable = data; int glx_type; switch (type) { case DRI2_EXCHANGE_COMPLETE: glx_type = GLX_EXCHANGE_COMPLETE_INTEL; break; default: /* unknown swap completion type, * BLIT is a reasonable default, so * fall through ... */ case DRI2_BLIT_COMPLETE: glx_type = GLX_BLIT_COMPLETE_INTEL; break; case DRI2_FLIP_COMPLETE: glx_type = GLX_FLIP_COMPLETE_INTEL; break; } __glXsendSwapEvent(drawable, glx_type, ust, msc, sbc); } /* * Copy or flip back to front, honoring the swap interval if possible. * * If the kernel supports it, we request an event for the frame when the * swap should happen, then perform the copy when we receive it. */ static GLboolean __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable * drawable) { __GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable; __GLXDRIscreen *screen = priv->screen; CARD64 unused; __GLXcontext *cx = lastGLContext; int status; if (screen->flush) { (*screen->flush->flush) (priv->driDrawable); (*screen->flush->invalidate) (priv->driDrawable); } status = DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused, __glXdriSwapEvent, drawable); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); } return status == Success; } static int __glXDRIdrawableSwapInterval(__GLXdrawable * drawable, int interval) { __GLXcontext *cx = lastGLContext; if (interval <= 0) /* || interval > BIGNUM? */ return GLX_BAD_VALUE; DRI2SwapInterval(drawable->pDraw, interval); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); } return 0; } static void __glXDRIcontextDestroy(__GLXcontext * baseContext) { __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; (*screen->core->destroyContext) (context->driContext); __glXContextDestroy(&context->base); free(context); } static int __glXDRIcontextMakeCurrent(__GLXcontext * baseContext) { __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv; __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv; __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; return (*screen->core->bindContext) (context->driContext, draw->driDrawable, read->driDrawable); } static int __glXDRIcontextLoseCurrent(__GLXcontext * baseContext) { __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; return (*screen->core->unbindContext) (context->driContext); } static int __glXDRIcontextCopy(__GLXcontext * baseDst, __GLXcontext * baseSrc, unsigned long mask) { __GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst; __GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc; __GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen; return (*screen->core->copyContext) (dst->driContext, src->driContext, mask); } static Bool __glXDRIcontextWait(__GLXcontext * baseContext, __GLXclientState * cl, int *error) { __GLXcontext *cx = lastGLContext; Bool ret; ret = DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); } if (ret) { *error = cl->client->noClientException; return TRUE; } return FALSE; } static int __glXDRIbindTexImage(__GLXcontext * baseContext, int buffer, __GLXdrawable * glxPixmap) { __GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap; const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer; __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; if (texBuffer == NULL) return Success; if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) { (*texBuffer->setTexBuffer2) (context->driContext, glxPixmap->target, glxPixmap->format, drawable->driDrawable); } else { texBuffer->setTexBuffer(context->driContext, glxPixmap->target, drawable->driDrawable); } return Success; } static int __glXDRIreleaseTexImage(__GLXcontext * baseContext, int buffer, __GLXdrawable * pixmap) { /* FIXME: Just unbind the texture? */ return Success; } static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { __glXDRIbindTexImage, __glXDRIreleaseTexImage }; static void __glXDRIscreenDestroy(__GLXscreen * baseScreen) { int i; ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen); __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; (*screen->core->destroyScreen) (screen->driScreen); dlclose(screen->driver); __glXScreenDestroy(baseScreen); if (screen->driConfigs) { for (i = 0; screen->driConfigs[i] != NULL; i++) free((__DRIconfig **) screen->driConfigs[i]); free(screen->driConfigs); } pScrn->EnterVT = screen->enterVT; pScrn->LeaveVT = screen->leaveVT; 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; *reset = __DRI_CTX_RESET_NO_NOTIFICATION; 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; 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; 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 (screen->dri2->base.version >= 3) { uint32_t ctx_attribs[4 * 2]; unsigned num_ctx_attribs = 0; unsigned dri_err = 0; unsigned major_ver; unsigned minor_ver; uint32_t flags = 0; 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; } if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) { ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_RESET_STRATEGY; ctx_attribs[num_ctx_attribs++] = reset; } assert(num_ctx_attribs <= ARRAY_SIZE(ctx_attribs)); } 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; } 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, unsigned num_attribs, const uint32_t *attribs, int *error) { __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; __GLXDRIcontext *context, *shareContext; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __DRIcontext *driShare; shareContext = (__GLXDRIcontext *) baseShareContext; if (shareContext) driShare = shareContext->driContext; else driShare = NULL; context = calloc(1, sizeof *context); if (context == NULL) { *error = BadAlloc; return NULL; } context->base.destroy = __glXDRIcontextDestroy; context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->base.wait = __glXDRIcontextWait; create_driver_context(context, screen, config, driShare, num_attribs, attribs, error); if (context->driContext == NULL) { free(context); return NULL; } return &context->base; } static void __glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id) { __GLXDRIdrawable *private = priv; __GLXDRIscreen *screen = private->screen; if (screen->flush) (*screen->flush->invalidate) (private->driDrawable); } static __GLXdrawable * __glXDRIscreenCreateDrawable(ClientPtr client, __GLXscreen * screen, DrawablePtr pDraw, XID drawId, int type, XID glxDrawId, __GLXconfig * glxConfig) { __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __GLXDRIdrawable *private; __GLXcontext *cx = lastGLContext; Bool ret; private = calloc(1, sizeof *private); if (private == NULL) return NULL; private->screen = driScreen; if (!__glXDrawableInit(&private->base, screen, pDraw, type, glxDrawId, glxConfig)) { free(private); return NULL; } private->base.destroy = __glXDRIdrawableDestroy; private->base.swapBuffers = __glXDRIdrawableSwapBuffers; private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer; private->base.waitGL = __glXDRIdrawableWaitGL; private->base.waitX = __glXDRIdrawableWaitX; ret = DRI2CreateDrawable2(client, pDraw, drawId, __glXDRIinvalidateBuffers, private, &private->dri2_id); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); } if (ret) { free(private); return NULL; } private->driDrawable = (*driScreen->dri2->createNewDrawable) (driScreen->driScreen, config->driConfig, private); return &private->base; } static __DRIbuffer * dri2GetBuffers(__DRIdrawable * driDrawable, int *width, int *height, unsigned int *attachments, int count, int *out_count, void *loaderPrivate) { __GLXDRIdrawable *private = loaderPrivate; DRI2BufferPtr *buffers; int i; int j; __GLXcontext *cx = lastGLContext; buffers = DRI2GetBuffers(private->base.pDraw, width, height, attachments, count, out_count); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); /* If DRI2GetBuffers() changed the GL context, it may also have * invalidated the DRI2 buffers, so let's get them again */ buffers = DRI2GetBuffers(private->base.pDraw, width, height, attachments, count, out_count); assert(lastGLContext == cx); } if (*out_count > MAX_DRAWABLE_BUFFERS) { *out_count = 0; return NULL; } private->width = *width; private->height = *height; /* This assumes the DRI2 buffer attachment tokens matches the * __DRIbuffer tokens. */ j = 0; for (i = 0; i < *out_count; i++) { /* Do not send the real front buffer of a window to the client. */ if ((private->base.pDraw->type == DRAWABLE_WINDOW) && (buffers[i]->attachment == DRI2BufferFrontLeft)) { continue; } private->buffers[j].attachment = buffers[i]->attachment; private->buffers[j].name = buffers[i]->name; private->buffers[j].pitch = buffers[i]->pitch; private->buffers[j].cpp = buffers[i]->cpp; private->buffers[j].flags = buffers[i]->flags; j++; } *out_count = j; return private->buffers; } static __DRIbuffer * dri2GetBuffersWithFormat(__DRIdrawable * driDrawable, int *width, int *height, unsigned int *attachments, int count, int *out_count, void *loaderPrivate) { __GLXDRIdrawable *private = loaderPrivate; DRI2BufferPtr *buffers; int i; int j = 0; __GLXcontext *cx = lastGLContext; buffers = DRI2GetBuffersWithFormat(private->base.pDraw, width, height, attachments, count, out_count); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); /* If DRI2GetBuffersWithFormat() changed the GL context, it may also have * invalidated the DRI2 buffers, so let's get them again */ buffers = DRI2GetBuffersWithFormat(private->base.pDraw, width, height, attachments, count, out_count); assert(lastGLContext == cx); } if (*out_count > MAX_DRAWABLE_BUFFERS) { *out_count = 0; return NULL; } private->width = *width; private->height = *height; /* This assumes the DRI2 buffer attachment tokens matches the * __DRIbuffer tokens. */ for (i = 0; i < *out_count; i++) { /* Do not send the real front buffer of a window to the client. */ if ((private->base.pDraw->type == DRAWABLE_WINDOW) && (buffers[i]->attachment == DRI2BufferFrontLeft)) { continue; } private->buffers[j].attachment = buffers[i]->attachment; private->buffers[j].name = buffers[i]->name; private->buffers[j].pitch = buffers[i]->pitch; private->buffers[j].cpp = buffers[i]->cpp; private->buffers[j].flags = buffers[i]->flags; j++; } *out_count = j; return private->buffers; } static void dri2FlushFrontBuffer(__DRIdrawable * driDrawable, void *loaderPrivate) { (void) driDrawable; __glXDRIdrawableWaitGL((__GLXdrawable *) loaderPrivate); } static const __DRIdri2LoaderExtension loaderExtension = { {__DRI_DRI2_LOADER, 3}, dri2GetBuffers, dri2FlushFrontBuffer, dri2GetBuffersWithFormat, }; static const __DRIuseInvalidateExtension dri2UseInvalidate = { {__DRI_USE_INVALIDATE, 1} }; static const __DRIextension *loader_extensions[] = { &systemTimeExtension.base, &loaderExtension.base, &dri2UseInvalidate.base, NULL }; static Bool glxDRIEnterVT(ScrnInfoPtr scrn) { Bool ret; __GLXDRIscreen *screen = (__GLXDRIscreen *) glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n"); scrn->EnterVT = screen->enterVT; ret = scrn->EnterVT(scrn); screen->enterVT = scrn->EnterVT; scrn->EnterVT = glxDRIEnterVT; if (!ret) return FALSE; glxResumeClients(); return TRUE; } static void glxDRILeaveVT(ScrnInfoPtr scrn) { __GLXDRIscreen *screen = (__GLXDRIscreen *) glxGetScreen(xf86ScrnToScreen(scrn)); LogMessageVerbSigSafe(X_INFO, -1, "AIGLX: Suspending AIGLX clients for VT switch\n"); glxSuspendClients(); scrn->LeaveVT = screen->leaveVT; (*screen->leaveVT) (scrn); screen->leaveVT = scrn->LeaveVT; scrn->LeaveVT = glxDRILeaveVT; } /** * Initialize extension flags in glx_enable_bits when a new screen is created * * @param screen The screen where glx_enable_bits are to be set. */ static void initializeExtensions(__GLXDRIscreen * screen) { ScreenPtr pScreen = screen->base.pScreen; const __DRIextension **extensions; int i; extensions = screen->core->getExtensions(screen->driScreen); __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); 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"); } if (DRI2HasSwapControl(pScreen)) { __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event"); __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control"); __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control"); LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n"); LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n"); } /* enable EXT_framebuffer_sRGB extension (even if there are no sRGB capable fbconfigs) */ { __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_framebuffer_sRGB"); LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_framebuffer_sRGB\n"); } /* enable ARB_fbconfig_float extension (even if there are no float fbconfigs) */ { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_fbconfig_float\n"); } for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) { __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_make_current_read"); LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n"); } if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; /* GLX_EXT_texture_from_pixmap is always enabled. */ LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n"); } if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 && extensions[i]->version >= 3) { screen->flush = (__DRI2flushExtension *) extensions[i]; } 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"); } /* Ignore unknown extensions */ } } /* white lie */ extern glx_func_ptr glXGetProcAddressARB(const char *); static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName, *deviceName; __GLXDRIscreen *screen; size_t buffer_size; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); screen = calloc(1, sizeof *screen); if (screen == NULL) return NULL; if (!DRI2Connect(serverClient, pScreen, DRI2DriverDRI, &screen->fd, &driverName, &deviceName)) { LogMessage(X_INFO, "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum); goto handle_error; } screen->base.destroy = __glXDRIscreenDestroy; screen->base.createContext = __glXDRIscreenCreateContext; screen->base.createDrawable = __glXDRIscreenCreateDrawable; screen->base.swapInterval = __glXDRIdrawableSwapInterval; screen->base.pScreen = pScreen; __glXInitExtensionEnableBits(screen->glx_enable_bits); screen->driver = glxProbeDriver(driverName, (void **) &screen->core, __DRI_CORE, 1, (void **) &screen->dri2, __DRI_DRI2, 1); if (screen->driver == NULL) { goto handle_error; } screen->driScreen = (*screen->dri2->createNewScreen) (pScreen->myNum, screen->fd, loader_extensions, &screen->driConfigs, screen); if (screen->driScreen == NULL) { LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed\n"); goto handle_error; } initializeExtensions(screen); screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs, GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT); __glXScreenInit(&screen->base, pScreen); /* The first call simply determines the length of the extension string. * This allows us to allocate some memory to hold the extension string, * but it requires that we call __glXGetExtensionString a second time. */ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); (void) __glXGetExtensionString(screen->glx_enable_bits, screen->base.GLXextensions); } /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled * drivers support the required extensions for GLX 1.4. The extensions * we're assuming are: * * - GLX_SGI_make_current_read (1.3) * - GLX_SGIX_fbconfig (1.3) * - GLX_SGIX_pbuffer (1.3) * - GLX_ARB_multisample (1.4) */ screen->base.GLXmajor = 1; screen->base.GLXminor = 4; screen->enterVT = pScrn->EnterVT; pScrn->EnterVT = glxDRIEnterVT; screen->leaveVT = pScrn->LeaveVT; pScrn->LeaveVT = glxDRILeaveVT; __glXsetGetProcAddress(glXGetProcAddressARB); LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName); return &screen->base; handle_error: if (screen->driver) dlclose(screen->driver); free(screen); LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n"); return NULL; } _X_EXPORT __GLXprovider __glXDRI2Provider = { __glXDRIscreenProbe, "DRI2", NULL }; xorg-server-1.17.1/glx/glxdrawable.h0000664000175100017510000000506012274325511014253 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _GLX_drawable_h_ #define _GLX_drawable_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ /* We just need to avoid clashing with DRAWABLE_{WINDOW,PIXMAP} */ enum { GLX_DRAWABLE_WINDOW, GLX_DRAWABLE_PIXMAP, GLX_DRAWABLE_PBUFFER, GLX_DRAWABLE_ANY }; struct __GLXdrawable { void (*destroy) (__GLXdrawable * private); GLboolean(*swapBuffers) (ClientPtr client, __GLXdrawable *); void (*copySubBuffer) (__GLXdrawable * drawable, int x, int y, int w, int h); void (*waitX) (__GLXdrawable *); void (*waitGL) (__GLXdrawable *); DrawablePtr pDraw; XID drawId; /* ** Either GLX_DRAWABLE_PIXMAP, GLX_DRAWABLE_WINDOW or ** GLX_DRAWABLE_PBUFFER. */ int type; /* ** Configuration of the visual to which this drawable was created. */ __GLXconfig *config; GLenum target; GLenum format; /* ** Event mask */ unsigned long eventMask; }; #endif /* !__GLX_drawable_h__ */ xorg-server-1.17.1/glx/indirect_dispatch_swap.c0000664000175100017510000047611612456571574016520 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2005 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include "glxserver.h" #include "indirect_size.h" #include "indirect_size_get.h" #include "indirect_dispatch.h" #include "glxbyteorder.h" #include "indirect_util.h" #include "singlesize.h" #define __GLX_PAD(x) (((x) + 3) & ~3) typedef struct { __GLX_PIXEL_3D_HDR; } __GLXpixel3DHeader; extern GLboolean __glXErrorOccured(void); extern void __glXClearErrorOccured(void); static const unsigned dummy_answer[2] = { 0, 0 }; static GLsizei bswap_CARD32(const void *src) { union { uint32_t dst; GLsizei ret; } x; x.dst = bswap_32(*(uint32_t *) src); return x.ret; } static GLshort bswap_CARD16(const void *src) { union { uint16_t dst; GLshort ret; } x; x.dst = bswap_16(*(uint16_t *) src); return x.ret; } static GLenum bswap_ENUM(const void *src) { union { uint32_t dst; GLenum ret; } x; x.dst = bswap_32(*(uint32_t *) src); return x.ret; } static GLsync bswap_CARD64(const void *src) { union { uint64_t dst; GLsync ret; } x; x.dst = bswap_64(*(uint64_t *) src); return x.ret; } static GLdouble bswap_FLOAT64(const void *src) { union { uint64_t dst; GLdouble ret; } x; x.dst = bswap_64(*(uint64_t *) src); return x.ret; } static GLfloat bswap_FLOAT32(const void *src) { union { uint32_t dst; GLfloat ret; } x; x.dst = bswap_32(*(uint32_t *) src); return x.ret; } static void * bswap_16_array(uint16_t * src, unsigned count) { unsigned i; for (i = 0; i < count; i++) { uint16_t temp = bswap_16(src[i]); src[i] = temp; } return src; } static void * bswap_32_array(uint32_t * src, unsigned count) { unsigned i; for (i = 0; i < count; i++) { uint32_t temp = bswap_32(src[i]); src[i] = temp; } return src; } static void * bswap_64_array(uint64_t * src, unsigned count) { unsigned i; for (i = 0; i < count; i++) { uint64_t temp = bswap_64(src[i]); src[i] = temp; } return src; } int __glXDispSwap_NewList(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glNewList((GLuint) bswap_CARD32(pc + 0), (GLenum) bswap_ENUM(pc + 4)); error = Success; } return error; } int __glXDispSwap_EndList(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glEndList(); error = Success; } return error; } void __glXDispSwap_CallList(GLbyte * pc) { glCallList((GLuint) bswap_CARD32(pc + 0)); } void __glXDispSwap_CallLists(GLbyte * pc) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); const GLenum type = (GLenum) bswap_ENUM(pc + 4); const GLvoid *lists; switch (type) { case GL_BYTE: case GL_UNSIGNED_BYTE: case GL_2_BYTES: case GL_3_BYTES: case GL_4_BYTES: lists = (const GLvoid *) (pc + 8); break; case GL_SHORT: case GL_UNSIGNED_SHORT: lists = (const GLvoid *) bswap_16_array((uint16_t *) (pc + 8), n); break; case GL_INT: case GL_UNSIGNED_INT: case GL_FLOAT: lists = (const GLvoid *) bswap_32_array((uint32_t *) (pc + 8), n); break; default: return; } glCallLists(n, type, lists); } int __glXDispSwap_DeleteLists(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glDeleteLists((GLuint) bswap_CARD32(pc + 0), (GLsizei) bswap_CARD32(pc + 4)); error = Success; } return error; } int __glXDispSwap_GenLists(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLuint retval; retval = glGenLists((GLsizei) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDispSwap_ListBase(GLbyte * pc) { glListBase((GLuint) bswap_CARD32(pc + 0)); } void __glXDispSwap_Begin(GLbyte * pc) { glBegin((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_Bitmap(GLbyte * pc) { const GLubyte *const bitmap = (const GLubyte *) ((pc + 44)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glBitmap((GLsizei) bswap_CARD32(pc + 20), (GLsizei) bswap_CARD32(pc + 24), (GLfloat) bswap_FLOAT32(pc + 28), (GLfloat) bswap_FLOAT32(pc + 32), (GLfloat) bswap_FLOAT32(pc + 36), (GLfloat) bswap_FLOAT32(pc + 40), bitmap); } void __glXDispSwap_Color3bv(GLbyte * pc) { glColor3bv((const GLbyte *) (pc + 0)); } void __glXDispSwap_Color3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glColor3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_Color3fv(GLbyte * pc) { glColor3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_Color3iv(GLbyte * pc) { glColor3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_Color3sv(GLbyte * pc) { glColor3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_Color3ubv(GLbyte * pc) { glColor3ubv((const GLubyte *) (pc + 0)); } void __glXDispSwap_Color3uiv(GLbyte * pc) { glColor3uiv((const GLuint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_Color3usv(GLbyte * pc) { glColor3usv((const GLushort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_Color4bv(GLbyte * pc) { glColor4bv((const GLbyte *) (pc + 0)); } void __glXDispSwap_Color4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glColor4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); } void __glXDispSwap_Color4fv(GLbyte * pc) { glColor4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_Color4iv(GLbyte * pc) { glColor4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_Color4sv(GLbyte * pc) { glColor4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); } void __glXDispSwap_Color4ubv(GLbyte * pc) { glColor4ubv((const GLubyte *) (pc + 0)); } void __glXDispSwap_Color4uiv(GLbyte * pc) { glColor4uiv((const GLuint *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_Color4usv(GLbyte * pc) { glColor4usv((const GLushort *) bswap_16_array((uint16_t *) (pc + 0), 4)); } void __glXDispSwap_EdgeFlagv(GLbyte * pc) { glEdgeFlagv((const GLboolean *) (pc + 0)); } void __glXDispSwap_End(GLbyte * pc) { glEnd(); } void __glXDispSwap_Indexdv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glIndexdv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); } void __glXDispSwap_Indexfv(GLbyte * pc) { glIndexfv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); } void __glXDispSwap_Indexiv(GLbyte * pc) { glIndexiv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 1)); } void __glXDispSwap_Indexsv(GLbyte * pc) { glIndexsv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 1)); } void __glXDispSwap_Normal3bv(GLbyte * pc) { glNormal3bv((const GLbyte *) (pc + 0)); } void __glXDispSwap_Normal3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glNormal3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_Normal3fv(GLbyte * pc) { glNormal3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_Normal3iv(GLbyte * pc) { glNormal3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_Normal3sv(GLbyte * pc) { glNormal3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_RasterPos2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glRasterPos2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); } void __glXDispSwap_RasterPos2fv(GLbyte * pc) { glRasterPos2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); } void __glXDispSwap_RasterPos2iv(GLbyte * pc) { glRasterPos2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2)); } void __glXDispSwap_RasterPos2sv(GLbyte * pc) { glRasterPos2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2)); } void __glXDispSwap_RasterPos3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glRasterPos3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_RasterPos3fv(GLbyte * pc) { glRasterPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_RasterPos3iv(GLbyte * pc) { glRasterPos3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_RasterPos3sv(GLbyte * pc) { glRasterPos3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_RasterPos4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glRasterPos4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); } void __glXDispSwap_RasterPos4fv(GLbyte * pc) { glRasterPos4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_RasterPos4iv(GLbyte * pc) { glRasterPos4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_RasterPos4sv(GLbyte * pc) { glRasterPos4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); } void __glXDispSwap_Rectdv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glRectdv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 16), 2)); } void __glXDispSwap_Rectfv(GLbyte * pc) { glRectfv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 2)); } void __glXDispSwap_Rectiv(GLbyte * pc) { glRectiv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2), (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 2)); } void __glXDispSwap_Rectsv(GLbyte * pc) { glRectsv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2)); } void __glXDispSwap_TexCoord1dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glTexCoord1dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); } void __glXDispSwap_TexCoord1fv(GLbyte * pc) { glTexCoord1fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); } void __glXDispSwap_TexCoord1iv(GLbyte * pc) { glTexCoord1iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 1)); } void __glXDispSwap_TexCoord1sv(GLbyte * pc) { glTexCoord1sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 1)); } void __glXDispSwap_TexCoord2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glTexCoord2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); } void __glXDispSwap_TexCoord2fv(GLbyte * pc) { glTexCoord2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); } void __glXDispSwap_TexCoord2iv(GLbyte * pc) { glTexCoord2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2)); } void __glXDispSwap_TexCoord2sv(GLbyte * pc) { glTexCoord2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2)); } void __glXDispSwap_TexCoord3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glTexCoord3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_TexCoord3fv(GLbyte * pc) { glTexCoord3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_TexCoord3iv(GLbyte * pc) { glTexCoord3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_TexCoord3sv(GLbyte * pc) { glTexCoord3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_TexCoord4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glTexCoord4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); } void __glXDispSwap_TexCoord4fv(GLbyte * pc) { glTexCoord4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_TexCoord4iv(GLbyte * pc) { glTexCoord4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_TexCoord4sv(GLbyte * pc) { glTexCoord4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); } void __glXDispSwap_Vertex2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glVertex2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); } void __glXDispSwap_Vertex2fv(GLbyte * pc) { glVertex2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); } void __glXDispSwap_Vertex2iv(GLbyte * pc) { glVertex2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2)); } void __glXDispSwap_Vertex2sv(GLbyte * pc) { glVertex2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2)); } void __glXDispSwap_Vertex3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glVertex3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_Vertex3fv(GLbyte * pc) { glVertex3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_Vertex3iv(GLbyte * pc) { glVertex3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_Vertex3sv(GLbyte * pc) { glVertex3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_Vertex4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glVertex4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); } void __glXDispSwap_Vertex4fv(GLbyte * pc) { glVertex4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_Vertex4iv(GLbyte * pc) { glVertex4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); } void __glXDispSwap_Vertex4sv(GLbyte * pc) { glVertex4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); } void __glXDispSwap_ClipPlane(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif glClipPlane((GLenum) bswap_ENUM(pc + 32), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); } void __glXDispSwap_ColorMaterial(GLbyte * pc) { glColorMaterial((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_CullFace(GLbyte * pc) { glCullFace((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_Fogf(GLbyte * pc) { glFogf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_Fogfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), __glFogfv_size(pname)); glFogfv(pname, params); } void __glXDispSwap_Fogi(GLbyte * pc) { glFogi((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); } void __glXDispSwap_Fogiv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 4), __glFogiv_size(pname)); glFogiv(pname, params); } void __glXDispSwap_FrontFace(GLbyte * pc) { glFrontFace((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_Hint(GLbyte * pc) { glHint((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_Lightf(GLbyte * pc) { glLightf((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_Lightfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), __glLightfv_size(pname)); glLightfv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_Lighti(GLbyte * pc) { glLighti((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); } void __glXDispSwap_Lightiv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 8), __glLightiv_size(pname)); glLightiv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_LightModelf(GLbyte * pc) { glLightModelf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_LightModelfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), __glLightModelfv_size(pname)); glLightModelfv(pname, params); } void __glXDispSwap_LightModeli(GLbyte * pc) { glLightModeli((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); } void __glXDispSwap_LightModeliv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 4), __glLightModeliv_size(pname)); glLightModeliv(pname, params); } void __glXDispSwap_LineStipple(GLbyte * pc) { glLineStipple((GLint) bswap_CARD32(pc + 0), (GLushort) bswap_CARD16(pc + 4)); } void __glXDispSwap_LineWidth(GLbyte * pc) { glLineWidth((GLfloat) bswap_FLOAT32(pc + 0)); } void __glXDispSwap_Materialf(GLbyte * pc) { glMaterialf((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_Materialfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), __glMaterialfv_size(pname)); glMaterialfv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_Materiali(GLbyte * pc) { glMateriali((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); } void __glXDispSwap_Materialiv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 8), __glMaterialiv_size(pname)); glMaterialiv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_PointSize(GLbyte * pc) { glPointSize((GLfloat) bswap_FLOAT32(pc + 0)); } void __glXDispSwap_PolygonMode(GLbyte * pc) { glPolygonMode((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_PolygonStipple(GLbyte * pc) { const GLubyte *const mask = (const GLubyte *) ((pc + 20)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glPolygonStipple(mask); } void __glXDispSwap_Scissor(GLbyte * pc) { glScissor((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12)); } void __glXDispSwap_ShadeModel(GLbyte * pc) { glShadeModel((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_TexParameterf(GLbyte * pc) { glTexParameterf((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_TexParameterfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), __glTexParameterfv_size(pname)); glTexParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_TexParameteri(GLbyte * pc) { glTexParameteri((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); } void __glXDispSwap_TexParameteriv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 8), __glTexParameteriv_size(pname)); glTexParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_TexImage1D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glTexImage1D((GLenum) bswap_ENUM(pc + 20), (GLint) bswap_CARD32(pc + 24), (GLint) bswap_CARD32(pc + 28), (GLsizei) bswap_CARD32(pc + 32), (GLint) bswap_CARD32(pc + 40), (GLenum) bswap_ENUM(pc + 44), (GLenum) bswap_ENUM(pc + 48), pixels); } void __glXDispSwap_TexImage2D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glTexImage2D((GLenum) bswap_ENUM(pc + 20), (GLint) bswap_CARD32(pc + 24), (GLint) bswap_CARD32(pc + 28), (GLsizei) bswap_CARD32(pc + 32), (GLsizei) bswap_CARD32(pc + 36), (GLint) bswap_CARD32(pc + 40), (GLenum) bswap_ENUM(pc + 44), (GLenum) bswap_ENUM(pc + 48), pixels); } void __glXDispSwap_TexEnvf(GLbyte * pc) { glTexEnvf((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_TexEnvfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), __glTexEnvfv_size(pname)); glTexEnvfv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_TexEnvi(GLbyte * pc) { glTexEnvi((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); } void __glXDispSwap_TexEnviv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 8), __glTexEnviv_size(pname)); glTexEnviv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_TexGend(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glTexGend((GLenum) bswap_ENUM(pc + 8), (GLenum) bswap_ENUM(pc + 12), (GLdouble) bswap_FLOAT64(pc + 0)); } void __glXDispSwap_TexGendv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLdouble *params; #ifdef __GLX_ALIGN64 const GLuint compsize = __glTexGendv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif params = (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), __glTexGendv_size(pname)); glTexGendv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_TexGenf(GLbyte * pc) { glTexGenf((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_TexGenfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), __glTexGenfv_size(pname)); glTexGenfv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_TexGeni(GLbyte * pc) { glTexGeni((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); } void __glXDispSwap_TexGeniv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 8), __glTexGeniv_size(pname)); glTexGeniv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_InitNames(GLbyte * pc) { glInitNames(); } void __glXDispSwap_LoadName(GLbyte * pc) { glLoadName((GLuint) bswap_CARD32(pc + 0)); } void __glXDispSwap_PassThrough(GLbyte * pc) { glPassThrough((GLfloat) bswap_FLOAT32(pc + 0)); } void __glXDispSwap_PopName(GLbyte * pc) { glPopName(); } void __glXDispSwap_PushName(GLbyte * pc) { glPushName((GLuint) bswap_CARD32(pc + 0)); } void __glXDispSwap_DrawBuffer(GLbyte * pc) { glDrawBuffer((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_Clear(GLbyte * pc) { glClear((GLbitfield) bswap_CARD32(pc + 0)); } void __glXDispSwap_ClearAccum(GLbyte * pc) { glClearAccum((GLfloat) bswap_FLOAT32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8), (GLfloat) bswap_FLOAT32(pc + 12)); } void __glXDispSwap_ClearIndex(GLbyte * pc) { glClearIndex((GLfloat) bswap_FLOAT32(pc + 0)); } void __glXDispSwap_ClearColor(GLbyte * pc) { glClearColor((GLclampf) bswap_FLOAT32(pc + 0), (GLclampf) bswap_FLOAT32(pc + 4), (GLclampf) bswap_FLOAT32(pc + 8), (GLclampf) bswap_FLOAT32(pc + 12)); } void __glXDispSwap_ClearStencil(GLbyte * pc) { glClearStencil((GLint) bswap_CARD32(pc + 0)); } void __glXDispSwap_ClearDepth(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glClearDepth((GLclampd) bswap_FLOAT64(pc + 0)); } void __glXDispSwap_StencilMask(GLbyte * pc) { glStencilMask((GLuint) bswap_CARD32(pc + 0)); } void __glXDispSwap_ColorMask(GLbyte * pc) { glColorMask(*(GLboolean *) (pc + 0), *(GLboolean *) (pc + 1), *(GLboolean *) (pc + 2), *(GLboolean *) (pc + 3)); } void __glXDispSwap_DepthMask(GLbyte * pc) { glDepthMask(*(GLboolean *) (pc + 0)); } void __glXDispSwap_IndexMask(GLbyte * pc) { glIndexMask((GLuint) bswap_CARD32(pc + 0)); } void __glXDispSwap_Accum(GLbyte * pc) { glAccum((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_Disable(GLbyte * pc) { glDisable((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_Enable(GLbyte * pc) { glEnable((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_PopAttrib(GLbyte * pc) { glPopAttrib(); } void __glXDispSwap_PushAttrib(GLbyte * pc) { glPushAttrib((GLbitfield) bswap_CARD32(pc + 0)); } void __glXDispSwap_MapGrid1d(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif glMapGrid1d((GLint) bswap_CARD32(pc + 16), (GLdouble) bswap_FLOAT64(pc + 0), (GLdouble) bswap_FLOAT64(pc + 8)); } void __glXDispSwap_MapGrid1f(GLbyte * pc) { glMapGrid1f((GLint) bswap_CARD32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_MapGrid2d(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); pc -= 4; } #endif glMapGrid2d((GLint) bswap_CARD32(pc + 32), (GLdouble) bswap_FLOAT64(pc + 0), (GLdouble) bswap_FLOAT64(pc + 8), (GLint) bswap_CARD32(pc + 36), (GLdouble) bswap_FLOAT64(pc + 16), (GLdouble) bswap_FLOAT64(pc + 24)); } void __glXDispSwap_MapGrid2f(GLbyte * pc) { glMapGrid2f((GLint) bswap_CARD32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLfloat) bswap_FLOAT32(pc + 16), (GLfloat) bswap_FLOAT32(pc + 20)); } void __glXDispSwap_EvalCoord1dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glEvalCoord1dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); } void __glXDispSwap_EvalCoord1fv(GLbyte * pc) { glEvalCoord1fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); } void __glXDispSwap_EvalCoord2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glEvalCoord2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); } void __glXDispSwap_EvalCoord2fv(GLbyte * pc) { glEvalCoord2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); } void __glXDispSwap_EvalMesh1(GLbyte * pc) { glEvalMesh1((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8)); } void __glXDispSwap_EvalPoint1(GLbyte * pc) { glEvalPoint1((GLint) bswap_CARD32(pc + 0)); } void __glXDispSwap_EvalMesh2(GLbyte * pc) { glEvalMesh2((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16)); } void __glXDispSwap_EvalPoint2(GLbyte * pc) { glEvalPoint2((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4)); } void __glXDispSwap_AlphaFunc(GLbyte * pc) { glAlphaFunc((GLenum) bswap_ENUM(pc + 0), (GLclampf) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_BlendFunc(GLbyte * pc) { glBlendFunc((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_LogicOp(GLbyte * pc) { glLogicOp((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_StencilFunc(GLbyte * pc) { glStencilFunc((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLuint) bswap_CARD32(pc + 8)); } void __glXDispSwap_StencilOp(GLbyte * pc) { glStencilOp((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8)); } void __glXDispSwap_DepthFunc(GLbyte * pc) { glDepthFunc((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_PixelZoom(GLbyte * pc) { glPixelZoom((GLfloat) bswap_FLOAT32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_PixelTransferf(GLbyte * pc) { glPixelTransferf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_PixelTransferi(GLbyte * pc) { glPixelTransferi((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); } int __glXDispSwap_PixelStoref(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glPixelStoref((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); error = Success; } return error; } int __glXDispSwap_PixelStorei(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glPixelStorei((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); error = Success; } return error; } void __glXDispSwap_PixelMapfv(GLbyte * pc) { const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4); glPixelMapfv((GLenum) bswap_ENUM(pc + 0), mapsize, (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 0)); } void __glXDispSwap_PixelMapuiv(GLbyte * pc) { const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4); glPixelMapuiv((GLenum) bswap_ENUM(pc + 0), mapsize, (const GLuint *) bswap_32_array((uint32_t *) (pc + 8), 0)); } void __glXDispSwap_PixelMapusv(GLbyte * pc) { const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4); glPixelMapusv((GLenum) bswap_ENUM(pc + 0), mapsize, (const GLushort *) bswap_16_array((uint16_t *) (pc + 8), 0)); } void __glXDispSwap_ReadBuffer(GLbyte * pc) { glReadBuffer((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_CopyPixels(GLbyte * pc) { glCopyPixels((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12), (GLenum) bswap_ENUM(pc + 16)); } void __glXDispSwap_DrawPixels(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 36)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glDrawPixels((GLsizei) bswap_CARD32(pc + 20), (GLsizei) bswap_CARD32(pc + 24), (GLenum) bswap_ENUM(pc + 28), (GLenum) bswap_ENUM(pc + 32), pixels); } int __glXDispSwap_GetBooleanv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLuint compsize = __glGetBooleanv_size(pname); GLboolean answerBuffer[200]; GLboolean *params = __glXGetAnswerBuffer(cl, compsize, answerBuffer, sizeof(answerBuffer), 1); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetBooleanv(pname, params); __glXSendReplySwap(cl->client, params, compsize, 1, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetClipPlane(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLdouble equation[4]; glGetClipPlane((GLenum) bswap_ENUM(pc + 0), equation); (void) bswap_64_array((uint64_t *) equation, 4); __glXSendReplySwap(cl->client, equation, 4, 8, GL_TRUE, 0); error = Success; } return error; } int __glXDispSwap_GetDoublev(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLuint compsize = __glGetDoublev_size(pname); GLdouble answerBuffer[200]; GLdouble *params = __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, sizeof(answerBuffer), 8); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetDoublev(pname, params); (void) bswap_64_array((uint64_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetError(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLenum retval; retval = glGetError(); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDispSwap_GetFloatv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLuint compsize = __glGetFloatv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetFloatv(pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetIntegerv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLuint compsize = __glGetIntegerv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetIntegerv(pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetLightfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetLightfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetLightfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetLightiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetLightiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetLightiv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMapdv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = (GLenum) bswap_ENUM(pc + 0); const GLenum query = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMapdv_size(target, query); GLdouble answerBuffer[200]; GLdouble *v = __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, sizeof(answerBuffer), 8); if (v == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMapdv(target, query, v); (void) bswap_64_array((uint64_t *) v, compsize); __glXSendReplySwap(cl->client, v, compsize, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMapfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = (GLenum) bswap_ENUM(pc + 0); const GLenum query = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMapfv_size(target, query); GLfloat answerBuffer[200]; GLfloat *v = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (v == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMapfv(target, query, v); (void) bswap_32_array((uint32_t *) v, compsize); __glXSendReplySwap(cl->client, v, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMapiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = (GLenum) bswap_ENUM(pc + 0); const GLenum query = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMapiv_size(target, query); GLint answerBuffer[200]; GLint *v = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (v == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMapiv(target, query, v); (void) bswap_32_array((uint32_t *) v, compsize); __glXSendReplySwap(cl->client, v, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMaterialfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMaterialfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMaterialfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMaterialiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMaterialiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMaterialiv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetPixelMapfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum map = (GLenum) bswap_ENUM(pc + 0); const GLuint compsize = __glGetPixelMapfv_size(map); GLfloat answerBuffer[200]; GLfloat *values = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (values == NULL) return BadAlloc; __glXClearErrorOccured(); glGetPixelMapfv(map, values); (void) bswap_32_array((uint32_t *) values, compsize); __glXSendReplySwap(cl->client, values, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetPixelMapuiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum map = (GLenum) bswap_ENUM(pc + 0); const GLuint compsize = __glGetPixelMapuiv_size(map); GLuint answerBuffer[200]; GLuint *values = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (values == NULL) return BadAlloc; __glXClearErrorOccured(); glGetPixelMapuiv(map, values); (void) bswap_32_array((uint32_t *) values, compsize); __glXSendReplySwap(cl->client, values, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetPixelMapusv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum map = (GLenum) bswap_ENUM(pc + 0); const GLuint compsize = __glGetPixelMapusv_size(map); GLushort answerBuffer[200]; GLushort *values = __glXGetAnswerBuffer(cl, compsize * 2, answerBuffer, sizeof(answerBuffer), 2); if (values == NULL) return BadAlloc; __glXClearErrorOccured(); glGetPixelMapusv(map, values); (void) bswap_16_array((uint16_t *) values, compsize); __glXSendReplySwap(cl->client, values, compsize, 2, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexEnvfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetTexEnvfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexEnvfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexEnviv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetTexEnviv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexEnviv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexGendv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetTexGendv_size(pname); GLdouble answerBuffer[200]; GLdouble *params = __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, sizeof(answerBuffer), 8); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexGendv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_64_array((uint64_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexGenfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetTexGenfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexGenfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexGeniv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetTexGeniv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexGeniv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetTexParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetTexParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 8); const GLuint compsize = __glGetTexLevelParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexLevelParameterfv((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 8); const GLuint compsize = __glGetTexLevelParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexLevelParameteriv((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_IsEnabled(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsEnabled((GLenum) bswap_ENUM(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDispSwap_IsList(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsList((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDispSwap_DepthRange(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glDepthRange((GLclampd) bswap_FLOAT64(pc + 0), (GLclampd) bswap_FLOAT64(pc + 8)); } void __glXDispSwap_Frustum(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 48); pc -= 4; } #endif glFrustum((GLdouble) bswap_FLOAT64(pc + 0), (GLdouble) bswap_FLOAT64(pc + 8), (GLdouble) bswap_FLOAT64(pc + 16), (GLdouble) bswap_FLOAT64(pc + 24), (GLdouble) bswap_FLOAT64(pc + 32), (GLdouble) bswap_FLOAT64(pc + 40)); } void __glXDispSwap_LoadIdentity(GLbyte * pc) { glLoadIdentity(); } void __glXDispSwap_LoadMatrixf(GLbyte * pc) { glLoadMatrixf((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 16)); } void __glXDispSwap_LoadMatrixd(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 128); pc -= 4; } #endif glLoadMatrixd((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 16)); } void __glXDispSwap_MatrixMode(GLbyte * pc) { glMatrixMode((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_MultMatrixf(GLbyte * pc) { glMultMatrixf((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 16)); } void __glXDispSwap_MultMatrixd(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 128); pc -= 4; } #endif glMultMatrixd((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 16)); } void __glXDispSwap_Ortho(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 48); pc -= 4; } #endif glOrtho((GLdouble) bswap_FLOAT64(pc + 0), (GLdouble) bswap_FLOAT64(pc + 8), (GLdouble) bswap_FLOAT64(pc + 16), (GLdouble) bswap_FLOAT64(pc + 24), (GLdouble) bswap_FLOAT64(pc + 32), (GLdouble) bswap_FLOAT64(pc + 40)); } void __glXDispSwap_PopMatrix(GLbyte * pc) { glPopMatrix(); } void __glXDispSwap_PushMatrix(GLbyte * pc) { glPushMatrix(); } void __glXDispSwap_Rotated(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glRotated((GLdouble) bswap_FLOAT64(pc + 0), (GLdouble) bswap_FLOAT64(pc + 8), (GLdouble) bswap_FLOAT64(pc + 16), (GLdouble) bswap_FLOAT64(pc + 24)); } void __glXDispSwap_Rotatef(GLbyte * pc) { glRotatef((GLfloat) bswap_FLOAT32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8), (GLfloat) bswap_FLOAT32(pc + 12)); } void __glXDispSwap_Scaled(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glScaled((GLdouble) bswap_FLOAT64(pc + 0), (GLdouble) bswap_FLOAT64(pc + 8), (GLdouble) bswap_FLOAT64(pc + 16)); } void __glXDispSwap_Scalef(GLbyte * pc) { glScalef((GLfloat) bswap_FLOAT32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_Translated(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glTranslated((GLdouble) bswap_FLOAT64(pc + 0), (GLdouble) bswap_FLOAT64(pc + 8), (GLdouble) bswap_FLOAT64(pc + 16)); } void __glXDispSwap_Translatef(GLbyte * pc) { glTranslatef((GLfloat) bswap_FLOAT32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_Viewport(GLbyte * pc) { glViewport((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12)); } void __glXDispSwap_BindTexture(GLbyte * pc) { glBindTexture((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } void __glXDispSwap_Indexubv(GLbyte * pc) { glIndexubv((const GLubyte *) (pc + 0)); } void __glXDispSwap_PolygonOffset(GLbyte * pc) { glPolygonOffset((GLfloat) bswap_FLOAT32(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); } int __glXDispSwap_AreTexturesResident(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLboolean retval; GLboolean answerBuffer[200]; GLboolean *residences = __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); if (residences == NULL) return BadAlloc; retval = glAreTexturesResident(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0), residences); __glXSendReplySwap(cl->client, residences, n, 1, GL_TRUE, retval); error = Success; } return error; } int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLboolean retval; GLboolean answerBuffer[200]; GLboolean *residences = __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); if (residences == NULL) return BadAlloc; retval = glAreTexturesResident(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0), residences); __glXSendReplySwap(cl->client, residences, n, 1, GL_TRUE, retval); error = Success; } return error; } void __glXDispSwap_CopyTexImage1D(GLbyte * pc) { glCopyTexImage1D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLsizei) bswap_CARD32(pc + 20), (GLint) bswap_CARD32(pc + 24)); } void __glXDispSwap_CopyTexImage2D(GLbyte * pc) { glCopyTexImage2D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLsizei) bswap_CARD32(pc + 20), (GLsizei) bswap_CARD32(pc + 24), (GLint) bswap_CARD32(pc + 28)); } void __glXDispSwap_CopyTexSubImage1D(GLbyte * pc) { glCopyTexSubImage1D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLsizei) bswap_CARD32(pc + 20)); } void __glXDispSwap_CopyTexSubImage2D(GLbyte * pc) { glCopyTexSubImage2D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLint) bswap_CARD32(pc + 20), (GLsizei) bswap_CARD32(pc + 24), (GLsizei) bswap_CARD32(pc + 28)); } int __glXDispSwap_DeleteTextures(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); glDeleteTextures(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0)); error = Success; } return error; } int __glXDispSwap_DeleteTexturesEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); glDeleteTextures(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0)); error = Success; } return error; } int __glXDispSwap_GenTextures(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLuint answerBuffer[200]; GLuint *textures = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (textures == NULL) return BadAlloc; glGenTextures(n, textures); (void) bswap_32_array((uint32_t *) textures, n); __glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDispSwap_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLuint answerBuffer[200]; GLuint *textures = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (textures == NULL) return BadAlloc; glGenTextures(n, textures); (void) bswap_32_array((uint32_t *) textures, n); __glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDispSwap_IsTexture(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsTexture((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDispSwap_IsTextureEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsTexture((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDispSwap_PrioritizeTextures(GLbyte * pc) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); glPrioritizeTextures(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0), (const GLclampf *) bswap_32_array((uint32_t *) (pc + 4), 0)); } void __glXDispSwap_TexSubImage1D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glTexSubImage1D((GLenum) bswap_ENUM(pc + 20), (GLint) bswap_CARD32(pc + 24), (GLint) bswap_CARD32(pc + 28), (GLsizei) bswap_CARD32(pc + 36), (GLenum) bswap_ENUM(pc + 44), (GLenum) bswap_ENUM(pc + 48), pixels); } void __glXDispSwap_TexSubImage2D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glTexSubImage2D((GLenum) bswap_ENUM(pc + 20), (GLint) bswap_CARD32(pc + 24), (GLint) bswap_CARD32(pc + 28), (GLint) bswap_CARD32(pc + 32), (GLsizei) bswap_CARD32(pc + 36), (GLsizei) bswap_CARD32(pc + 40), (GLenum) bswap_ENUM(pc + 44), (GLenum) bswap_ENUM(pc + 48), pixels); } void __glXDispSwap_BlendColor(GLbyte * pc) { glBlendColor((GLclampf) bswap_FLOAT32(pc + 0), (GLclampf) bswap_FLOAT32(pc + 4), (GLclampf) bswap_FLOAT32(pc + 8), (GLclampf) bswap_FLOAT32(pc + 12)); } void __glXDispSwap_BlendEquation(GLbyte * pc) { glBlendEquation((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_ColorTable(GLbyte * pc) { const GLvoid *const table = (const GLvoid *) ((pc + 40)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glColorTable((GLenum) bswap_ENUM(pc + 20), (GLenum) bswap_ENUM(pc + 24), (GLsizei) bswap_CARD32(pc + 28), (GLenum) bswap_ENUM(pc + 32), (GLenum) bswap_ENUM(pc + 36), table); } void __glXDispSwap_ColorTableParameterfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), __glColorTableParameterfv_size(pname)); glColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_ColorTableParameteriv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 8), __glColorTableParameteriv_size(pname)); glColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_CopyColorTable(GLbyte * pc) { glCopyColorTable((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16)); } int __glXDispSwap_GetColorTableParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetColorTableParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetColorTableParameterfvSGI(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetColorTableParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetColorTableParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetColorTableParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetColorTableParameterivSGI(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetColorTableParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } void __glXDispSwap_ColorSubTable(GLbyte * pc) { const GLvoid *const data = (const GLvoid *) ((pc + 40)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glColorSubTable((GLenum) bswap_ENUM(pc + 20), (GLsizei) bswap_CARD32(pc + 24), (GLsizei) bswap_CARD32(pc + 28), (GLenum) bswap_ENUM(pc + 32), (GLenum) bswap_ENUM(pc + 36), data); } void __glXDispSwap_CopyColorSubTable(GLbyte * pc) { glCopyColorSubTable((GLenum) bswap_ENUM(pc + 0), (GLsizei) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16)); } void __glXDispSwap_ConvolutionFilter1D(GLbyte * pc) { const GLvoid *const image = (const GLvoid *) ((pc + 44)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glConvolutionFilter1D((GLenum) bswap_ENUM(pc + 20), (GLenum) bswap_ENUM(pc + 24), (GLsizei) bswap_CARD32(pc + 28), (GLenum) bswap_ENUM(pc + 36), (GLenum) bswap_ENUM(pc + 40), image); } void __glXDispSwap_ConvolutionFilter2D(GLbyte * pc) { const GLvoid *const image = (const GLvoid *) ((pc + 44)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glConvolutionFilter2D((GLenum) bswap_ENUM(pc + 20), (GLenum) bswap_ENUM(pc + 24), (GLsizei) bswap_CARD32(pc + 28), (GLsizei) bswap_CARD32(pc + 32), (GLenum) bswap_ENUM(pc + 36), (GLenum) bswap_ENUM(pc + 40), image); } void __glXDispSwap_ConvolutionParameterf(GLbyte * pc) { glConvolutionParameterf((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); } void __glXDispSwap_ConvolutionParameterfv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), __glConvolutionParameterfv_size (pname)); glConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_ConvolutionParameteri(GLbyte * pc) { glConvolutionParameteri((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); } void __glXDispSwap_ConvolutionParameteriv(GLbyte * pc) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 8), __glConvolutionParameteriv_size(pname)); glConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); } void __glXDispSwap_CopyConvolutionFilter1D(GLbyte * pc) { glCopyConvolutionFilter1D((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16)); } void __glXDispSwap_CopyConvolutionFilter2D(GLbyte * pc) { glCopyConvolutionFilter2D((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16), (GLsizei) bswap_CARD32(pc + 20)); } int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetConvolutionParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetConvolutionParameterfvEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetConvolutionParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetConvolutionParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetConvolutionParameterivEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetConvolutionParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetHistogramParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetHistogramParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetHistogramParameterfvEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetHistogramParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetHistogramParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetHistogramParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetHistogramParameterivEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetHistogramParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMinmaxParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMinmaxParameterfvEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMinmaxParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMinmaxParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetMinmaxParameterivEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetMinmaxParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } void __glXDispSwap_Histogram(GLbyte * pc) { glHistogram((GLenum) bswap_ENUM(pc + 0), (GLsizei) bswap_CARD32(pc + 4), (GLenum) bswap_ENUM(pc + 8), *(GLboolean *) (pc + 12)); } void __glXDispSwap_Minmax(GLbyte * pc) { glMinmax((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), *(GLboolean *) (pc + 8)); } void __glXDispSwap_ResetHistogram(GLbyte * pc) { glResetHistogram((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_ResetMinmax(GLbyte * pc) { glResetMinmax((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_TexImage3D(GLbyte * pc) { const CARD32 ptr_is_null = *(CARD32 *) (pc + 76); const GLvoid *const pixels = (const GLvoid *) ((ptr_is_null != 0) ? NULL : (pc + 80)); __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) bswap_CARD32(&hdr->imageHeight)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) bswap_CARD32(&hdr->skipImages)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glTexImage3D((GLenum) bswap_ENUM(pc + 36), (GLint) bswap_CARD32(pc + 40), (GLint) bswap_CARD32(pc + 44), (GLsizei) bswap_CARD32(pc + 48), (GLsizei) bswap_CARD32(pc + 52), (GLsizei) bswap_CARD32(pc + 56), (GLint) bswap_CARD32(pc + 64), (GLenum) bswap_ENUM(pc + 68), (GLenum) bswap_ENUM(pc + 72), pixels); } void __glXDispSwap_TexSubImage3D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 88)); __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) bswap_CARD32(&hdr->imageHeight)); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) bswap_CARD32(&hdr->skipImages)); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) bswap_CARD32(&hdr->skipPixels)); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); glTexSubImage3D((GLenum) bswap_ENUM(pc + 36), (GLint) bswap_CARD32(pc + 40), (GLint) bswap_CARD32(pc + 44), (GLint) bswap_CARD32(pc + 48), (GLint) bswap_CARD32(pc + 52), (GLsizei) bswap_CARD32(pc + 60), (GLsizei) bswap_CARD32(pc + 64), (GLsizei) bswap_CARD32(pc + 68), (GLenum) bswap_ENUM(pc + 76), (GLenum) bswap_ENUM(pc + 80), pixels); } void __glXDispSwap_CopyTexSubImage3D(GLbyte * pc) { glCopyTexSubImage3D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLint) bswap_CARD32(pc + 20), (GLint) bswap_CARD32(pc + 24), (GLsizei) bswap_CARD32(pc + 28), (GLsizei) bswap_CARD32(pc + 32)); } void __glXDispSwap_ActiveTexture(GLbyte * pc) { glActiveTextureARB((GLenum) bswap_ENUM(pc + 0)); } void __glXDispSwap_MultiTexCoord1dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); pc -= 4; } #endif glMultiTexCoord1dvARB((GLenum) bswap_ENUM(pc + 8), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); } void __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc) { glMultiTexCoord1fvARB((GLenum) bswap_ENUM(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 1)); } void __glXDispSwap_MultiTexCoord1iv(GLbyte * pc) { glMultiTexCoord1ivARB((GLenum) bswap_ENUM(pc + 0), (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 1)); } void __glXDispSwap_MultiTexCoord1sv(GLbyte * pc) { glMultiTexCoord1svARB((GLenum) bswap_ENUM(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 1)); } void __glXDispSwap_MultiTexCoord2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif glMultiTexCoord2dvARB((GLenum) bswap_ENUM(pc + 16), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); } void __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc) { glMultiTexCoord2fvARB((GLenum) bswap_ENUM(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 2)); } void __glXDispSwap_MultiTexCoord2iv(GLbyte * pc) { glMultiTexCoord2ivARB((GLenum) bswap_ENUM(pc + 0), (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 2)); } void __glXDispSwap_MultiTexCoord2sv(GLbyte * pc) { glMultiTexCoord2svARB((GLenum) bswap_ENUM(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2)); } void __glXDispSwap_MultiTexCoord3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); pc -= 4; } #endif glMultiTexCoord3dvARB((GLenum) bswap_ENUM(pc + 24), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc) { glMultiTexCoord3fvARB((GLenum) bswap_ENUM(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 3)); } void __glXDispSwap_MultiTexCoord3iv(GLbyte * pc) { glMultiTexCoord3ivARB((GLenum) bswap_ENUM(pc + 0), (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 3)); } void __glXDispSwap_MultiTexCoord3sv(GLbyte * pc) { glMultiTexCoord3svARB((GLenum) bswap_ENUM(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3)); } void __glXDispSwap_MultiTexCoord4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif glMultiTexCoord4dvARB((GLenum) bswap_ENUM(pc + 32), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); } void __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc) { glMultiTexCoord4fvARB((GLenum) bswap_ENUM(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_MultiTexCoord4iv(GLbyte * pc) { glMultiTexCoord4ivARB((GLenum) bswap_ENUM(pc + 0), (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_MultiTexCoord4sv(GLbyte * pc) { glMultiTexCoord4svARB((GLenum) bswap_ENUM(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4)); } void __glXDispSwap_CompressedTexImage1D(GLbyte * pc) { PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D = __glGetProcAddress("glCompressedTexImage1D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20); CompressedTexImage1D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLsizei) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), imageSize, (const GLvoid *) (pc + 24)); } void __glXDispSwap_CompressedTexImage2D(GLbyte * pc) { PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D = __glGetProcAddress("glCompressedTexImage2D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 24); CompressedTexImage2D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLsizei) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16), (GLint) bswap_CARD32(pc + 20), imageSize, (const GLvoid *) (pc + 28)); } void __glXDispSwap_CompressedTexImage3D(GLbyte * pc) { PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D = __glGetProcAddress("glCompressedTexImage3D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28); CompressedTexImage3D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLsizei) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16), (GLsizei) bswap_CARD32(pc + 20), (GLint) bswap_CARD32(pc + 24), imageSize, (const GLvoid *) (pc + 32)); } void __glXDispSwap_CompressedTexSubImage1D(GLbyte * pc) { PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D = __glGetProcAddress("glCompressedTexSubImage1D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20); CompressedTexSubImage1D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12), (GLenum) bswap_ENUM(pc + 16), imageSize, (const GLvoid *) (pc + 24)); } void __glXDispSwap_CompressedTexSubImage2D(GLbyte * pc) { PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D = __glGetProcAddress("glCompressedTexSubImage2D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28); CompressedTexSubImage2D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16), (GLsizei) bswap_CARD32(pc + 20), (GLenum) bswap_ENUM(pc + 24), imageSize, (const GLvoid *) (pc + 32)); } void __glXDispSwap_CompressedTexSubImage3D(GLbyte * pc) { PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D = __glGetProcAddress("glCompressedTexSubImage3D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 36); CompressedTexSubImage3D((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLsizei) bswap_CARD32(pc + 20), (GLsizei) bswap_CARD32(pc + 24), (GLsizei) bswap_CARD32(pc + 28), (GLenum) bswap_ENUM(pc + 32), imageSize, (const GLvoid *) (pc + 40)); } void __glXDispSwap_SampleCoverage(GLbyte * pc) { PFNGLSAMPLECOVERAGEPROC SampleCoverage = __glGetProcAddress("glSampleCoverage"); SampleCoverage((GLclampf) bswap_FLOAT32(pc + 0), *(GLboolean *) (pc + 4)); } void __glXDispSwap_BlendFuncSeparate(GLbyte * pc) { PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate = __glGetProcAddress("glBlendFuncSeparate"); BlendFuncSeparate((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLenum) bswap_ENUM(pc + 12)); } void __glXDispSwap_FogCoorddv(GLbyte * pc) { PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif FogCoorddv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); } void __glXDispSwap_PointParameterf(GLbyte * pc) { PFNGLPOINTPARAMETERFPROC PointParameterf = __glGetProcAddress("glPointParameterf"); PointParameterf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_PointParameterfv(GLbyte * pc) { PFNGLPOINTPARAMETERFVPROC PointParameterfv = __glGetProcAddress("glPointParameterfv"); const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLfloat *params; params = (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), __glPointParameterfv_size(pname)); PointParameterfv(pname, params); } void __glXDispSwap_PointParameteri(GLbyte * pc) { PFNGLPOINTPARAMETERIPROC PointParameteri = __glGetProcAddress("glPointParameteri"); PointParameteri((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); } void __glXDispSwap_PointParameteriv(GLbyte * pc) { PFNGLPOINTPARAMETERIVPROC PointParameteriv = __glGetProcAddress("glPointParameteriv"); const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLint *params; params = (const GLint *) bswap_32_array((uint32_t *) (pc + 4), __glPointParameteriv_size(pname)); PointParameteriv(pname, params); } void __glXDispSwap_SecondaryColor3bv(GLbyte * pc) { PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv = __glGetProcAddress("glSecondaryColor3bv"); SecondaryColor3bv((const GLbyte *) (pc + 0)); } void __glXDispSwap_SecondaryColor3dv(GLbyte * pc) { PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv = __glGetProcAddress("glSecondaryColor3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif SecondaryColor3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3iv(GLbyte * pc) { PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv = __glGetProcAddress("glSecondaryColor3iv"); SecondaryColor3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3sv(GLbyte * pc) { PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv = __glGetProcAddress("glSecondaryColor3sv"); SecondaryColor3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3ubv(GLbyte * pc) { PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv = __glGetProcAddress("glSecondaryColor3ubv"); SecondaryColor3ubv((const GLubyte *) (pc + 0)); } void __glXDispSwap_SecondaryColor3uiv(GLbyte * pc) { PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv = __glGetProcAddress("glSecondaryColor3uiv"); SecondaryColor3uiv((const GLuint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3usv(GLbyte * pc) { PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv = __glGetProcAddress("glSecondaryColor3usv"); SecondaryColor3usv((const GLushort *) bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_WindowPos3fv(GLbyte * pc) { PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv"); WindowPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_BeginQuery(GLbyte * pc) { PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery"); BeginQuery((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } int __glXDispSwap_DeleteQueries(__GLXclientState * cl, GLbyte * pc) { PFNGLDELETEQUERIESPROC DeleteQueries = __glGetProcAddress("glDeleteQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); DeleteQueries(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0)); error = Success; } return error; } void __glXDispSwap_EndQuery(GLbyte * pc) { PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery"); EndQuery((GLenum) bswap_ENUM(pc + 0)); } int __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc) { PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLuint answerBuffer[200]; GLuint *ids = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (ids == NULL) return BadAlloc; GenQueries(n, ids); (void) bswap_32_array((uint32_t *) ids, n); __glXSendReplySwap(cl->client, ids, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDispSwap_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv = __glGetProcAddress("glGetQueryObjectiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetQueryObjectiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetQueryObjectiv((GLuint) bswap_CARD32(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv = __glGetProcAddress("glGetQueryObjectuiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetQueryObjectuiv_size(pname); GLuint answerBuffer[200]; GLuint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetQueryObjectuiv((GLuint) bswap_CARD32(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetQueryiv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetQueryiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetQueryiv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_IsQuery(__GLXclientState * cl, GLbyte * pc) { PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsQuery((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDispSwap_BlendEquationSeparate(GLbyte * pc) { PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate = __glGetProcAddress("glBlendEquationSeparate"); BlendEquationSeparate((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_DrawBuffers(GLbyte * pc) { PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); DrawBuffers(n, (const GLenum *) bswap_32_array((uint32_t *) (pc + 4), 0)); } void __glXDispSwap_VertexAttrib1dv(GLbyte * pc) { PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv = __glGetProcAddress("glVertexAttrib1dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); pc -= 4; } #endif VertexAttrib1dv((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 1)); } void __glXDispSwap_VertexAttrib1sv(GLbyte * pc) { PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv = __glGetProcAddress("glVertexAttrib1sv"); VertexAttrib1sv((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 1)); } void __glXDispSwap_VertexAttrib2dv(GLbyte * pc) { PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv = __glGetProcAddress("glVertexAttrib2dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif VertexAttrib2dv((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 2)); } void __glXDispSwap_VertexAttrib2sv(GLbyte * pc) { PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv = __glGetProcAddress("glVertexAttrib2sv"); VertexAttrib2sv((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2)); } void __glXDispSwap_VertexAttrib3dv(GLbyte * pc) { PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv = __glGetProcAddress("glVertexAttrib3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); pc -= 4; } #endif VertexAttrib3dv((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 3)); } void __glXDispSwap_VertexAttrib3sv(GLbyte * pc) { PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv = __glGetProcAddress("glVertexAttrib3sv"); VertexAttrib3sv((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3)); } void __glXDispSwap_VertexAttrib4Nbv(GLbyte * pc) { PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv = __glGetProcAddress("glVertexAttrib4Nbv"); VertexAttrib4Nbv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4Niv(GLbyte * pc) { PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv = __glGetProcAddress("glVertexAttrib4Niv"); VertexAttrib4Niv((GLuint) bswap_CARD32(pc + 0), (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4Nsv(GLbyte * pc) { PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv = __glGetProcAddress("glVertexAttrib4Nsv"); VertexAttrib4Nsv((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4Nubv(GLbyte * pc) { PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv = __glGetProcAddress("glVertexAttrib4Nubv"); VertexAttrib4Nubv((GLuint) bswap_CARD32(pc + 0), (const GLubyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4Nuiv(GLbyte * pc) { PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv = __glGetProcAddress("glVertexAttrib4Nuiv"); VertexAttrib4Nuiv((GLuint) bswap_CARD32(pc + 0), (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4Nusv(GLbyte * pc) { PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv = __glGetProcAddress("glVertexAttrib4Nusv"); VertexAttrib4Nusv((GLuint) bswap_CARD32(pc + 0), (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4bv(GLbyte * pc) { PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv = __glGetProcAddress("glVertexAttrib4bv"); VertexAttrib4bv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4dv(GLbyte * pc) { PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv = __glGetProcAddress("glVertexAttrib4dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif VertexAttrib4dv((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4iv(GLbyte * pc) { PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv = __glGetProcAddress("glVertexAttrib4iv"); VertexAttrib4iv((GLuint) bswap_CARD32(pc + 0), (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4sv(GLbyte * pc) { PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv = __glGetProcAddress("glVertexAttrib4sv"); VertexAttrib4sv((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4ubv(GLbyte * pc) { PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv = __glGetProcAddress("glVertexAttrib4ubv"); VertexAttrib4ubv((GLuint) bswap_CARD32(pc + 0), (const GLubyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4uiv(GLbyte * pc) { PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv = __glGetProcAddress("glVertexAttrib4uiv"); VertexAttrib4uiv((GLuint) bswap_CARD32(pc + 0), (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4usv(GLbyte * pc) { PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv = __glGetProcAddress("glVertexAttrib4usv"); VertexAttrib4usv((GLuint) bswap_CARD32(pc + 0), (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), 4)); } void __glXDispSwap_ClampColor(GLbyte * pc) { PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor"); ClampColor((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_BindProgramARB(GLbyte * pc) { PFNGLBINDPROGRAMARBPROC BindProgramARB = __glGetProcAddress("glBindProgramARB"); BindProgramARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } int __glXDispSwap_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) { PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB = __glGetProcAddress("glDeleteProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); DeleteProgramsARB(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0)); error = Success; } return error; } int __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGENPROGRAMSARBPROC GenProgramsARB = __glGetProcAddress("glGenProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLuint answerBuffer[200]; GLuint *programs = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (programs == NULL) return BadAlloc; GenProgramsARB(n, programs); (void) bswap_32_array((uint32_t *) programs, n); __glXSendReplySwap(cl->client, programs, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDispSwap_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB = __glGetProcAddress("glGetProgramEnvParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLdouble params[4]; GetProgramEnvParameterdvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_64_array((uint64_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB = __glGetProcAddress("glGetProgramEnvParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLfloat params[4]; GetProgramEnvParameterfvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_32_array((uint32_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB = __glGetProcAddress("glGetProgramLocalParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLdouble params[4]; GetProgramLocalParameterdvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_64_array((uint64_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB = __glGetProcAddress("glGetProgramLocalParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLfloat params[4]; GetProgramLocalParameterfvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_32_array((uint32_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMIVARBPROC GetProgramivARB = __glGetProcAddress("glGetProgramivARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = (GLenum) bswap_ENUM(pc + 4); const GLuint compsize = __glGetProgramivARB_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetProgramivARB((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_IsProgramARB(__GLXclientState * cl, GLbyte * pc) { PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsProgramARB((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc) { PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB = __glGetProcAddress("glProgramEnvParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); pc -= 4; } #endif ProgramEnvParameter4dvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramEnvParameter4fvARB(GLbyte * pc) { PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB = __glGetProcAddress("glProgramEnvParameter4fvARB"); ProgramEnvParameter4fvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc) { PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB = __glGetProcAddress("glProgramLocalParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); pc -= 4; } #endif ProgramLocalParameter4dvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramLocalParameter4fvARB(GLbyte * pc) { PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB = __glGetProcAddress("glProgramLocalParameter4fvARB"); ProgramLocalParameter4fvARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramStringARB(GLbyte * pc) { PFNGLPROGRAMSTRINGARBPROC ProgramStringARB = __glGetProcAddress("glProgramStringARB"); const GLsizei len = (GLsizei) bswap_CARD32(pc + 8); ProgramStringARB((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), len, (const GLvoid *) (pc + 12)); } void __glXDispSwap_VertexAttrib1fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB = __glGetProcAddress("glVertexAttrib1fvARB"); VertexAttrib1fvARB((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 1)); } void __glXDispSwap_VertexAttrib2fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB = __glGetProcAddress("glVertexAttrib2fvARB"); VertexAttrib2fvARB((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 2)); } void __glXDispSwap_VertexAttrib3fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB = __glGetProcAddress("glVertexAttrib3fvARB"); VertexAttrib3fvARB((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 3)); } void __glXDispSwap_VertexAttrib4fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB = __glGetProcAddress("glVertexAttrib4fvARB"); VertexAttrib4fvARB((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_BindFramebuffer(GLbyte * pc) { PFNGLBINDFRAMEBUFFERPROC BindFramebuffer = __glGetProcAddress("glBindFramebuffer"); BindFramebuffer((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } void __glXDispSwap_BindRenderbuffer(GLbyte * pc) { PFNGLBINDRENDERBUFFERPROC BindRenderbuffer = __glGetProcAddress("glBindRenderbuffer"); BindRenderbuffer((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } void __glXDispSwap_BlitFramebuffer(GLbyte * pc) { PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer = __glGetProcAddress("glBlitFramebuffer"); BlitFramebuffer((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLint) bswap_CARD32(pc + 20), (GLint) bswap_CARD32(pc + 24), (GLint) bswap_CARD32(pc + 28), (GLbitfield) bswap_CARD32(pc + 32), (GLenum) bswap_ENUM(pc + 36)); } int __glXDispSwap_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) { PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus = __glGetProcAddress("glCheckFramebufferStatus"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLenum retval; retval = CheckFramebufferStatus((GLenum) bswap_ENUM(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDispSwap_DeleteFramebuffers(GLbyte * pc) { PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers = __glGetProcAddress("glDeleteFramebuffers"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); DeleteFramebuffers(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0)); } void __glXDispSwap_DeleteRenderbuffers(GLbyte * pc) { PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers = __glGetProcAddress("glDeleteRenderbuffers"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); DeleteRenderbuffers(n, (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 0)); } void __glXDispSwap_FramebufferRenderbuffer(GLbyte * pc) { PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer = __glGetProcAddress("glFramebufferRenderbuffer"); FramebufferRenderbuffer((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLuint) bswap_CARD32(pc + 12)); } void __glXDispSwap_FramebufferTexture1D(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D = __glGetProcAddress("glFramebufferTexture1D"); FramebufferTexture1D((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLuint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16)); } void __glXDispSwap_FramebufferTexture2D(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D = __glGetProcAddress("glFramebufferTexture2D"); FramebufferTexture2D((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLuint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16)); } void __glXDispSwap_FramebufferTexture3D(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D = __glGetProcAddress("glFramebufferTexture3D"); FramebufferTexture3D((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLuint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16), (GLint) bswap_CARD32(pc + 20)); } void __glXDispSwap_FramebufferTextureLayer(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer = __glGetProcAddress("glFramebufferTextureLayer"); FramebufferTextureLayer((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLuint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16)); } int __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) { PFNGLGENFRAMEBUFFERSPROC GenFramebuffers = __glGetProcAddress("glGenFramebuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLuint answerBuffer[200]; GLuint *framebuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (framebuffers == NULL) return BadAlloc; GenFramebuffers(n, framebuffers); (void) bswap_32_array((uint32_t *) framebuffers, n); __glXSendReplySwap(cl->client, framebuffers, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) { PFNGLGENRENDERBUFFERSPROC GenRenderbuffers = __glGetProcAddress("glGenRenderbuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); GLuint answerBuffer[200]; GLuint *renderbuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (renderbuffers == NULL) return BadAlloc; GenRenderbuffers(n, renderbuffers); (void) bswap_32_array((uint32_t *) renderbuffers, n); __glXSendReplySwap(cl->client, renderbuffers, n, 4, GL_TRUE, 0); error = Success; } return error; } void __glXDispSwap_GenerateMipmap(GLbyte * pc) { PFNGLGENERATEMIPMAPPROC GenerateMipmap = __glGetProcAddress("glGenerateMipmap"); GenerateMipmap((GLenum) bswap_ENUM(pc + 0)); } int __glXDispSwap_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv = __glGetProcAddress("glGetFramebufferAttachmentParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLint params[1]; GetFramebufferAttachmentParameteriv((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8), params); (void) bswap_32_array((uint32_t *) params, 1); __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv = __glGetProcAddress("glGetRenderbufferParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLint params[1]; GetRenderbufferParameteriv((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), params); (void) bswap_32_array((uint32_t *) params, 1); __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDispSwap_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) { PFNGLISFRAMEBUFFERPROC IsFramebuffer = __glGetProcAddress("glIsFramebuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsFramebuffer((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDispSwap_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) { PFNGLISRENDERBUFFERPROC IsRenderbuffer = __glGetProcAddress("glIsRenderbuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsRenderbuffer((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDispSwap_RenderbufferStorage(GLbyte * pc) { PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage = __glGetProcAddress("glRenderbufferStorage"); RenderbufferStorage((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12)); } void __glXDispSwap_RenderbufferStorageMultisample(GLbyte * pc) { PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample = __glGetProcAddress("glRenderbufferStorageMultisample"); RenderbufferStorageMultisample((GLenum) bswap_ENUM(pc + 0), (GLsizei) bswap_CARD32(pc + 4), (GLenum) bswap_ENUM(pc + 8), (GLsizei) bswap_CARD32(pc + 12), (GLsizei) bswap_CARD32(pc + 16)); } void __glXDispSwap_SecondaryColor3fvEXT(GLbyte * pc) { PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT = __glGetProcAddress("glSecondaryColor3fvEXT"); SecondaryColor3fvEXT((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_FogCoordfvEXT(GLbyte * pc) { PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT = __glGetProcAddress("glFogCoordfvEXT"); FogCoordfvEXT((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); } void __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV = __glGetProcAddress("glVertexAttrib1dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); pc -= 4; } #endif VertexAttrib1dvNV((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 1)); } void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV = __glGetProcAddress("glVertexAttrib1fvNV"); VertexAttrib1fvNV((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 1)); } void __glXDispSwap_VertexAttrib1svNV(GLbyte * pc) { PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV = __glGetProcAddress("glVertexAttrib1svNV"); VertexAttrib1svNV((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 1)); } void __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV = __glGetProcAddress("glVertexAttrib2dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif VertexAttrib2dvNV((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 2)); } void __glXDispSwap_VertexAttrib2fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV = __glGetProcAddress("glVertexAttrib2fvNV"); VertexAttrib2fvNV((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 2)); } void __glXDispSwap_VertexAttrib2svNV(GLbyte * pc) { PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV = __glGetProcAddress("glVertexAttrib2svNV"); VertexAttrib2svNV((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2)); } void __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV = __glGetProcAddress("glVertexAttrib3dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); pc -= 4; } #endif VertexAttrib3dvNV((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 3)); } void __glXDispSwap_VertexAttrib3fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV = __glGetProcAddress("glVertexAttrib3fvNV"); VertexAttrib3fvNV((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 3)); } void __glXDispSwap_VertexAttrib3svNV(GLbyte * pc) { PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV = __glGetProcAddress("glVertexAttrib3svNV"); VertexAttrib3svNV((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3)); } void __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV = __glGetProcAddress("glVertexAttrib4dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif VertexAttrib4dvNV((GLuint) bswap_CARD32(pc + 0), (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV = __glGetProcAddress("glVertexAttrib4fvNV"); VertexAttrib4fvNV((GLuint) bswap_CARD32(pc + 0), (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4svNV(GLbyte * pc) { PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV = __glGetProcAddress("glVertexAttrib4svNV"); VertexAttrib4svNV((GLuint) bswap_CARD32(pc + 0), (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4ubvNV(GLbyte * pc) { PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV = __glGetProcAddress("glVertexAttrib4ubvNV"); VertexAttrib4ubvNV((GLuint) bswap_CARD32(pc + 0), (const GLubyte *) (pc + 4)); } void __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV = __glGetProcAddress("glVertexAttribs1dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 8)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs1dvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs1fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV = __glGetProcAddress("glVertexAttribs1fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs1fvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs1svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV = __glGetProcAddress("glVertexAttribs1svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs1svNV((GLuint) bswap_CARD32(pc + 0), n, (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV = __glGetProcAddress("glVertexAttribs2dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 16)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs2dvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV = __glGetProcAddress("glVertexAttribs2fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs2fvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs2svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV = __glGetProcAddress("glVertexAttribs2svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs2svNV((GLuint) bswap_CARD32(pc + 0), n, (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV = __glGetProcAddress("glVertexAttribs3dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 24)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs3dvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs3fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV = __glGetProcAddress("glVertexAttribs3fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs3fvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs3svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV = __glGetProcAddress("glVertexAttribs3svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs3svNV((GLuint) bswap_CARD32(pc + 0), n, (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV = __glGetProcAddress("glVertexAttribs4dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 32)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs4dvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs4fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV = __glGetProcAddress("glVertexAttribs4fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs4fvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs4svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV = __glGetProcAddress("glVertexAttribs4svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs4svNV((GLuint) bswap_CARD32(pc + 0), n, (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 0)); } void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV = __glGetProcAddress("glVertexAttribs4ubvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); VertexAttribs4ubvNV((GLuint) bswap_CARD32(pc + 0), n, (const GLubyte *) (pc + 8)); } void __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc) { PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT = __glGetProcAddress("glActiveStencilFaceEXT"); ActiveStencilFaceEXT((GLenum) bswap_ENUM(pc + 0)); } xorg-server-1.17.1/glx/xfont.c0000664000175100017510000001327512274325511013117 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "glxutil.h" #include "unpack.h" #include "indirect_dispatch.h" #include #include #include #include /* ** Make a single GL bitmap from a single X glyph */ static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci) { int i, j; int widthPadded; /* width of glyph in bytes, as padded by X */ int allocBytes; /* bytes to allocate to store bitmap */ int w; /* width of glyph in bits */ int h; /* height of glyph */ register unsigned char *pglyph; register unsigned char *p; unsigned char *allocbuf; #define __GL_CHAR_BUF_SIZE 2048 unsigned char buf[__GL_CHAR_BUF_SIZE]; w = GLYPHWIDTHPIXELS(pci); h = GLYPHHEIGHTPIXELS(pci); widthPadded = GLYPHWIDTHBYTESPADDED(pci); /* ** Use the local buf if possible, otherwise malloc. */ allocBytes = widthPadded * h; if (allocBytes <= __GL_CHAR_BUF_SIZE) { p = buf; allocbuf = 0; } else { p = (unsigned char *) malloc(allocBytes); if (!p) return BadAlloc; allocbuf = p; } /* ** We have to reverse the picture, top to bottom */ pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h - 1) * widthPadded; for (j = 0; j < h; j++) { for (i = 0; i < widthPadded; i++) { p[i] = pglyph[i]; } pglyph -= widthPadded; p += widthPadded; } glBitmap(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent, pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf); free(allocbuf); return Success; #undef __GL_CHAR_BUF_SIZE } /* ** Create a GL bitmap for each character in the X font. The bitmap is stored ** in a display list. */ static int MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base) { unsigned long i, nglyphs; CARD8 chs[2]; /* the font index we are going after */ CharInfoPtr pci; int rv; /* return value */ int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit; glPixelStorei(GL_UNPACK_SWAP_BYTES, FALSE); glPixelStorei(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); glPixelStorei(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES); for (i = 0; i < count; i++) { chs[0] = (first + i) >> 8; /* high byte is first byte */ chs[1] = first + i; (*pFont->get_glyphs) (pFont, 1, chs, (FontEncoding) encoding, &nglyphs, &pci); /* ** Define a display list containing just a glBitmap() call. */ glNewList(list_base + i, GL_COMPILE); if (nglyphs) { rv = __glXMakeBitmapFromGlyph(pFont, pci); if (rv) { return rv; } } glEndList(); } return Success; } /************************************************************************/ int __glXDisp_UseXFont(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXUseXFontReq *req; FontPtr pFont; GLuint currentListIndex; __GLXcontext *cx; int error; REQUEST_SIZE_MATCH(xGLXUseXFontReq); req = (xGLXUseXFontReq *) pc; cx = __glXForceCurrent(cl, req->contextTag, &error); if (!cx) { return error; } glGetIntegerv(GL_LIST_INDEX, (GLint *) ¤tListIndex); if (currentListIndex != 0) { /* ** A display list is currently being made. It is an error ** to try to make a font during another lists construction. */ client->errorValue = cx->id; return __glXError(GLXBadContextState); } /* ** Font can actually be either the ID of a font or the ID of a GC ** containing a font. */ error = dixLookupFontable(&pFont, req->font, client, DixReadAccess); if (error != Success) return error; return MakeBitmapsFromFont(pFont, req->first, req->count, req->listBase); } xorg-server-1.17.1/glx/glxcontext.h0000664000175100017510000001070612274325511014161 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _GLX_context_h_ #define _GLX_context_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap; struct __GLXtextureFromPixmap { int (*bindTexImage) (__GLXcontext * baseContext, int buffer, __GLXdrawable * pixmap); int (*releaseTexImage) (__GLXcontext * baseContext, int buffer, __GLXdrawable * pixmap); }; struct __GLXcontext { void (*destroy) (__GLXcontext * context); int (*makeCurrent) (__GLXcontext * context); int (*loseCurrent) (__GLXcontext * context); int (*copy) (__GLXcontext * dst, __GLXcontext * src, unsigned long mask); Bool (*wait) (__GLXcontext * context, __GLXclientState * cl, int *error); __GLXtextureFromPixmap *textureFromPixmap; /* ** list of context structs */ __GLXcontext *next; /* ** config struct for this context */ __GLXconfig *config; /* ** Pointer to screen info data for this context. This is set ** when the context is created. */ __GLXscreen *pGlxScreen; /* ** If this context is current for a client, this will be that client */ ClientPtr currentClient; /* ** The XID of this context. */ XID id; /* ** The XID of the shareList context. */ XID share_id; /* ** Whether this context's ID still exists. */ GLboolean idExists; /* ** Whether this context is a direct rendering context. */ GLboolean isDirect; /* ** This flag keeps track of whether there are unflushed GL commands. */ GLboolean hasUnflushedCommands; /* ** Current rendering mode for this context. */ GLenum renderMode; /** * Reset notification strategy used when a GPU reset occurs. */ GLenum resetNotificationStrategy; /* ** Buffers for feedback and selection. */ GLfloat *feedbackBuf; GLint feedbackBufSize; /* number of elements allocated */ GLuint *selectBuf; GLint selectBufSize; /* number of elements allocated */ /* ** The drawable private this context is bound to */ __GLXdrawable *drawPriv; __GLXdrawable *readPriv; }; 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__ */ xorg-server-1.17.1/glx/singlesize.h0000664000175100017510000000472012274325511014135 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _singlesize_h_ #define _singlesize_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #include "indirect_size.h" extern GLint __glReadPixels_size(GLenum format, GLenum type, GLint width, GLint height); extern GLint __glGetMap_size(GLenum pname, GLenum query); extern GLint __glGetMapdv_size(GLenum target, GLenum query); extern GLint __glGetMapfv_size(GLenum target, GLenum query); extern GLint __glGetMapiv_size(GLenum target, GLenum query); extern GLint __glGetPixelMap_size(GLenum map); extern GLint __glGetPixelMapfv_size(GLenum map); extern GLint __glGetPixelMapuiv_size(GLenum map); extern GLint __glGetPixelMapusv_size(GLenum map); extern GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format, GLenum type, GLint width, GLint height, GLint depth); #endif /* _singlesize_h_ */ xorg-server-1.17.1/glx/unpack.h0000664000175100017510000001670412456571574013265 00000000000000#ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef __GLX_unpack_h__ #define __GLX_unpack_h__ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #define __GLX_PAD(s) (((s)+3) & (GLuint)~3) /* ** Fetch the context-id out of a SingleReq request pointed to by pc. */ #define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag) #define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag) /* ** Fetch a double from potentially unaligned memory. */ #ifdef __GLX_ALIGN64 #define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n) #define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8) #else #define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src)) #endif extern void __glXMemInit(void); extern xGLXSingleReply __glXReply; #define __GLX_BEGIN_REPLY(size) \ __glXReply.length = __GLX_PAD(size) >> 2; \ __glXReply.type = X_Reply; \ __glXReply.sequenceNumber = client->sequence; #define __GLX_SEND_HEADER() \ WriteToClient (client, sz_xGLXSingleReply, &__glXReply); #define __GLX_PUT_RETVAL(a) \ __glXReply.retval = (a); #define __GLX_PUT_SIZE(a) \ __glXReply.size = (a); #define __GLX_PUT_RENDERMODE(m) \ __glXReply.pad3 = (m) /* ** Get a buffer to hold returned data, with the given alignment. If we have ** to realloc, allocate size+align, in case the pointer has to be bumped for ** alignment. The answerBuffer should already be aligned. ** ** NOTE: the cast (long)res below assumes a long is large enough to hold a ** pointer. */ #define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \ if (size < 0) return BadLength; \ else if ((size) > sizeof(answerBuffer)) { \ int bump; \ if ((cl)->returnBufSize < (size)+(align)) { \ (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \ (size)+(align)); \ if (!(cl)->returnBuf) { \ return BadAlloc; \ } \ (cl)->returnBufSize = (size)+(align); \ } \ res = (char*)cl->returnBuf; \ bump = (long)(res) % (align); \ if (bump) res += (align) - (bump); \ } else { \ res = (char *)answerBuffer; \ } #define __GLX_PUT_BYTE() \ *(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer #define __GLX_PUT_SHORT() \ *(GLshort *)&__glXReply.pad3 = *(GLshort *)answer #define __GLX_PUT_INT() \ *(GLint *)&__glXReply.pad3 = *(GLint *)answer #define __GLX_PUT_FLOAT() \ *(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer #define __GLX_PUT_DOUBLE() \ *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer #define __GLX_SEND_BYTE_ARRAY(len) \ WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer) #define __GLX_SEND_SHORT_ARRAY(len) \ WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer) #define __GLX_SEND_INT_ARRAY(len) \ WriteToClient(client, (len)*__GLX_SIZE_INT32, answer) #define __GLX_SEND_FLOAT_ARRAY(len) \ WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer) #define __GLX_SEND_DOUBLE_ARRAY(len) \ 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) #define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len) #define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len) /* ** PERFORMANCE NOTE: ** Machine dependent optimizations abound here; these swapping macros can ** conceivably be replaced with routines that do the job faster. */ #define __GLX_DECLARE_SWAP_VARIABLES \ GLbyte sw #define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \ GLbyte *swapPC; \ GLbyte *swapEnd #define __GLX_SWAP_INT(pc) \ sw = ((GLbyte *)(pc))[0]; \ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \ ((GLbyte *)(pc))[3] = sw; \ sw = ((GLbyte *)(pc))[1]; \ ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \ ((GLbyte *)(pc))[2] = sw; #define __GLX_SWAP_SHORT(pc) \ sw = ((GLbyte *)(pc))[0]; \ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \ ((GLbyte *)(pc))[1] = sw; #define __GLX_SWAP_DOUBLE(pc) \ sw = ((GLbyte *)(pc))[0]; \ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \ ((GLbyte *)(pc))[7] = sw; \ sw = ((GLbyte *)(pc))[1]; \ ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \ ((GLbyte *)(pc))[6] = sw; \ sw = ((GLbyte *)(pc))[2]; \ ((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \ ((GLbyte *)(pc))[5] = sw; \ sw = ((GLbyte *)(pc))[3]; \ ((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \ ((GLbyte *)(pc))[4] = sw; #define __GLX_SWAP_FLOAT(pc) \ sw = ((GLbyte *)(pc))[0]; \ ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \ ((GLbyte *)(pc))[3] = sw; \ sw = ((GLbyte *)(pc))[1]; \ ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \ ((GLbyte *)(pc))[2] = sw; #define __GLX_SWAP_INT_ARRAY(pc, count) \ swapPC = ((GLbyte *)(pc)); \ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\ while (swapPC < swapEnd) { \ __GLX_SWAP_INT(swapPC); \ swapPC += __GLX_SIZE_INT32; \ } #define __GLX_SWAP_SHORT_ARRAY(pc, count) \ swapPC = ((GLbyte *)(pc)); \ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\ while (swapPC < swapEnd) { \ __GLX_SWAP_SHORT(swapPC); \ swapPC += __GLX_SIZE_INT16; \ } #define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \ swapPC = ((GLbyte *)(pc)); \ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\ while (swapPC < swapEnd) { \ __GLX_SWAP_DOUBLE(swapPC); \ swapPC += __GLX_SIZE_FLOAT64; \ } #define __GLX_SWAP_FLOAT_ARRAY(pc, count) \ swapPC = ((GLbyte *)(pc)); \ swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\ while (swapPC < swapEnd) { \ __GLX_SWAP_FLOAT(swapPC); \ swapPC += __GLX_SIZE_FLOAT32; \ } #define __GLX_SWAP_REPLY_HEADER() \ __GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \ __GLX_SWAP_INT(&__glXReply.length); #define __GLX_SWAP_REPLY_RETVAL() \ __GLX_SWAP_INT(&__glXReply.retval) #define __GLX_SWAP_REPLY_SIZE() \ __GLX_SWAP_INT(&__glXReply.size) #endif /* !__GLX_unpack_h__ */ xorg-server-1.17.1/glx/single2.c0000664000175100017510000002607112456571574013340 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include "glxserver.h" #include "glxutil.h" #include "glxext.h" #include "indirect_dispatch.h" #include "unpack.h" int __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; GLsizei size; GLenum type; __GLXcontext *cx; int error; REQUEST_FIXED_SIZE(xGLXSingleReq, 8); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; size = *(GLsizei *) (pc + 0); type = *(GLenum *) (pc + 4); if (cx->feedbackBufSize < size) { cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf, (size_t) size * __GLX_SIZE_FLOAT32); if (!cx->feedbackBuf) { cl->client->errorValue = size; return BadAlloc; } cx->feedbackBufSize = size; } glFeedbackBuffer(size, type, cx->feedbackBuf); cx->hasUnflushedCommands = GL_TRUE; return Success; } int __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; GLsizei size; int error; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; size = *(GLsizei *) (pc + 0); if (cx->selectBufSize < size) { cx->selectBuf = (GLuint *) realloc(cx->selectBuf, (size_t) size * __GLX_SIZE_CARD32); if (!cx->selectBuf) { cl->client->errorValue = size; return BadAlloc; } cx->selectBufSize = size; } glSelectBuffer(size, cx->selectBuf); cx->hasUnflushedCommands = GL_TRUE; return Success; } int __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; xGLXRenderModeReply reply; __GLXcontext *cx; GLint nitems = 0, retBytes = 0, retval, newModeCheck; GLubyte *retBuffer = NULL; GLenum newMode; int error; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; newMode = *(GLenum *) pc; retval = glRenderMode(newMode); /* Check that render mode worked */ glGetIntegerv(GL_RENDER_MODE, &newModeCheck); if (newModeCheck != newMode) { /* Render mode change failed. Bail */ newMode = newModeCheck; goto noChangeAllowed; } /* ** Render mode might have still failed if we get here. But in this ** case we can't really tell, nor does it matter. If it did fail, it ** will return 0, and thus we won't send any data across the wire. */ switch (cx->renderMode) { case GL_RENDER: cx->renderMode = newMode; break; case GL_FEEDBACK: if (retval < 0) { /* Overflow happened. Copy the entire buffer */ nitems = cx->feedbackBufSize; } else { nitems = retval; } retBytes = nitems * __GLX_SIZE_FLOAT32; retBuffer = (GLubyte *) cx->feedbackBuf; cx->renderMode = newMode; break; case GL_SELECT: if (retval < 0) { /* Overflow happened. Copy the entire buffer */ nitems = cx->selectBufSize; } else { GLuint *bp = cx->selectBuf; GLint i; /* ** Figure out how many bytes of data need to be sent. Parse ** the selection buffer to determine this fact as the ** return value is the number of hits, not the number of ** items in the buffer. */ nitems = 0; i = retval; while (--i >= 0) { GLuint n; /* Parse select data for this hit */ n = *bp; bp += 3 + n; } nitems = bp - cx->selectBuf; } retBytes = nitems * __GLX_SIZE_CARD32; retBuffer = (GLubyte *) cx->selectBuf; cx->renderMode = newMode; break; } /* ** First reply is the number of elements returned in the feedback or ** selection array, as per the API for glRenderMode itself. */ noChangeAllowed:; 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, retBuffer); } return Success; } int __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; int error; REQUEST_SIZE_MATCH(xGLXSingleReq); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } glFlush(); cx->hasUnflushedCommands = GL_FALSE; return Success; } int __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; int error; REQUEST_SIZE_MATCH(xGLXSingleReq); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } /* Do a local glFinish */ glFinish(); cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ client = cl->client; __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); return Success; } #define SEPARATOR " " char * __glXcombine_strings(const char *cext_string, const char *sext_string) { size_t clen, slen; char *combo_string, *token, *s1; const char *s2, *end; /* safeguard to prevent potentially fatal errors in the string functions */ if (!cext_string) cext_string = ""; if (!sext_string) sext_string = ""; /* ** String can't be longer than min(cstring, sstring) ** pull tokens out of shortest string ** include space in combo_string for final separator and null terminator */ clen = strlen(cext_string); slen = strlen(sext_string); if (clen > slen) { combo_string = (char *) malloc(slen + 2); s1 = (char *) malloc(slen + 2); if (s1) strcpy(s1, sext_string); s2 = cext_string; } else { combo_string = (char *) malloc(clen + 2); s1 = (char *) malloc(clen + 2); if (s1) strcpy(s1, cext_string); s2 = sext_string; } if (!combo_string || !s1) { free(combo_string); free(s1); return NULL; } combo_string[0] = '\0'; /* Get first extension token */ token = strtok(s1, SEPARATOR); while (token != NULL) { /* ** if token in second string then save it ** beware of extension names which are prefixes of other extension names */ const char *p = s2; end = p + strlen(p); while (p < end) { size_t n = strcspn(p, SEPARATOR); if ((strlen(token) == n) && (strncmp(token, p, n) == 0)) { combo_string = strcat(combo_string, token); combo_string = strcat(combo_string, SEPARATOR); } p += (n + 1); } /* Get next extension token */ token = strtok(NULL, SEPARATOR); } free(s1); return combo_string; } int DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap) { ClientPtr client = cl->client; __GLXcontext *cx; GLenum name; const char *string; __GLX_DECLARE_SWAP_VARIABLES; int error; char *buf = NULL, *buf1 = NULL; GLint length = 0; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); /* If the client has the opposite byte order, swap the contextTag and * the name. */ if (need_swap) { __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + __GLX_SINGLE_HDR_SIZE); } cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; name = *(GLenum *) (pc + 0); string = (const char *) glGetString(name); if (string == NULL) string = ""; /* ** Restrict extensions to those that are supported by both the ** implementation and the connection. That is, return the ** intersection of client, server, and core extension strings. */ if (name == GL_EXTENSIONS) { buf1 = __glXcombine_strings(string, cl->GLClientextensions); buf = __glXcombine_strings(buf1, cx->pGlxScreen->GLextensions); free(buf1); string = buf; } else if (name == GL_VERSION) { if (atof(string) > atof(GLServerVersion)) { if (asprintf(&buf, "%s (%s)", GLServerVersion, string) == -1) { string = GLServerVersion; } else { string = buf; } } } if (string) { length = strlen((const char *) string) + 1; } __GLX_BEGIN_REPLY(length); __GLX_PUT_SIZE(length); if (need_swap) { __GLX_SWAP_REPLY_SIZE(); __GLX_SWAP_REPLY_HEADER(); } __GLX_SEND_HEADER(); WriteToClient(client, length, string); free(buf); return Success; } int __glXDisp_GetString(__GLXclientState * cl, GLbyte * pc) { return DoGetString(cl, pc, GL_FALSE); } xorg-server-1.17.1/glx/indirect_table.c0000664000175100017510000022454312456571574014751 00000000000000/* DO NOT EDIT - This file generated automatically by glX_server_table.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2005, 2006 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include "glxserver.h" #include "glxext.h" #include "indirect_dispatch.h" #include "indirect_reqsize.h" #include "indirect_table.h" /*****************************************************************/ /* tree depth = 3 */ static const int_fast16_t Single_dispatch_tree[24] = { /* [0] -> opcode range [0, 256], node depth 1 */ 2, 5, 13, 16, EMPTY_LEAF, /* [5] -> opcode range [0, 64], node depth 2 */ 2, LEAF(0), LEAF(16), 10, EMPTY_LEAF, /* [10] -> opcode range [32, 48], node depth 3 */ 1, LEAF(32), EMPTY_LEAF, /* [13] -> opcode range [64, 128], node depth 2 */ 1, EMPTY_LEAF, LEAF(40), /* [16] -> opcode range [128, 192], node depth 2 */ 2, LEAF(72), LEAF(88), 21, EMPTY_LEAF, /* [21] -> opcode range [160, 176], node depth 3 */ 1, LEAF(104), EMPTY_LEAF, }; static const void *Single_function_table[112][2] = { /* [ 0] = 0 */ {NULL, NULL}, /* [ 1] = 1 */ {__glXDisp_Render, __glXDispSwap_Render}, /* [ 2] = 2 */ {__glXDisp_RenderLarge, __glXDispSwap_RenderLarge}, /* [ 3] = 3 */ {__glXDisp_CreateContext, __glXDispSwap_CreateContext}, /* [ 4] = 4 */ {__glXDisp_DestroyContext, __glXDispSwap_DestroyContext}, /* [ 5] = 5 */ {__glXDisp_MakeCurrent, __glXDispSwap_MakeCurrent}, /* [ 6] = 6 */ {__glXDisp_IsDirect, __glXDispSwap_IsDirect}, /* [ 7] = 7 */ {__glXDisp_QueryVersion, __glXDispSwap_QueryVersion}, /* [ 8] = 8 */ {__glXDisp_WaitGL, __glXDispSwap_WaitGL}, /* [ 9] = 9 */ {__glXDisp_WaitX, __glXDispSwap_WaitX}, /* [ 10] = 10 */ {__glXDisp_CopyContext, __glXDispSwap_CopyContext}, /* [ 11] = 11 */ {__glXDisp_SwapBuffers, __glXDispSwap_SwapBuffers}, /* [ 12] = 12 */ {__glXDisp_UseXFont, __glXDispSwap_UseXFont}, /* [ 13] = 13 */ {__glXDisp_CreateGLXPixmap, __glXDispSwap_CreateGLXPixmap}, /* [ 14] = 14 */ {__glXDisp_GetVisualConfigs, __glXDispSwap_GetVisualConfigs}, /* [ 15] = 15 */ {__glXDisp_DestroyGLXPixmap, __glXDispSwap_DestroyGLXPixmap}, /* [ 16] = 16 */ {__glXDisp_VendorPrivate, __glXDispSwap_VendorPrivate}, /* [ 17] = 17 */ {__glXDisp_VendorPrivateWithReply, __glXDispSwap_VendorPrivateWithReply}, /* [ 18] = 18 */ {__glXDisp_QueryExtensionsString, __glXDispSwap_QueryExtensionsString}, /* [ 19] = 19 */ {__glXDisp_QueryServerString, __glXDispSwap_QueryServerString}, /* [ 20] = 20 */ {__glXDisp_ClientInfo, __glXDispSwap_ClientInfo}, /* [ 21] = 21 */ {__glXDisp_GetFBConfigs, __glXDispSwap_GetFBConfigs}, /* [ 22] = 22 */ {__glXDisp_CreatePixmap, __glXDispSwap_CreatePixmap}, /* [ 23] = 23 */ {__glXDisp_DestroyPixmap, __glXDispSwap_DestroyPixmap}, /* [ 24] = 24 */ {__glXDisp_CreateNewContext, __glXDispSwap_CreateNewContext}, /* [ 25] = 25 */ {__glXDisp_QueryContext, __glXDispSwap_QueryContext}, /* [ 26] = 26 */ {__glXDisp_MakeContextCurrent, __glXDispSwap_MakeContextCurrent}, /* [ 27] = 27 */ {__glXDisp_CreatePbuffer, __glXDispSwap_CreatePbuffer}, /* [ 28] = 28 */ {__glXDisp_DestroyPbuffer, __glXDispSwap_DestroyPbuffer}, /* [ 29] = 29 */ {__glXDisp_GetDrawableAttributes, __glXDispSwap_GetDrawableAttributes}, /* [ 30] = 30 */ {__glXDisp_ChangeDrawableAttributes, __glXDispSwap_ChangeDrawableAttributes}, /* [ 31] = 31 */ {__glXDisp_CreateWindow, __glXDispSwap_CreateWindow}, /* [ 32] = 32 */ {__glXDisp_DestroyWindow, __glXDispSwap_DestroyWindow}, /* [ 33] = 33 */ {__glXDisp_SetClientInfoARB, __glXDispSwap_SetClientInfoARB}, /* [ 34] = 34 */ {__glXDisp_CreateContextAttribsARB, __glXDispSwap_CreateContextAttribsARB}, /* [ 35] = 35 */ {__glXDisp_SetClientInfo2ARB, __glXDispSwap_SetClientInfo2ARB}, /* [ 36] = 36 */ {NULL, NULL}, /* [ 37] = 37 */ {NULL, NULL}, /* [ 38] = 38 */ {NULL, NULL}, /* [ 39] = 39 */ {NULL, NULL}, /* [ 40] = 96 */ {NULL, NULL}, /* [ 41] = 97 */ {NULL, NULL}, /* [ 42] = 98 */ {NULL, NULL}, /* [ 43] = 99 */ {NULL, NULL}, /* [ 44] = 100 */ {NULL, NULL}, /* [ 45] = 101 */ {__glXDisp_NewList, __glXDispSwap_NewList}, /* [ 46] = 102 */ {__glXDisp_EndList, __glXDispSwap_EndList}, /* [ 47] = 103 */ {__glXDisp_DeleteLists, __glXDispSwap_DeleteLists}, /* [ 48] = 104 */ {__glXDisp_GenLists, __glXDispSwap_GenLists}, /* [ 49] = 105 */ {__glXDisp_FeedbackBuffer, __glXDispSwap_FeedbackBuffer}, /* [ 50] = 106 */ {__glXDisp_SelectBuffer, __glXDispSwap_SelectBuffer}, /* [ 51] = 107 */ {__glXDisp_RenderMode, __glXDispSwap_RenderMode}, /* [ 52] = 108 */ {__glXDisp_Finish, __glXDispSwap_Finish}, /* [ 53] = 109 */ {__glXDisp_PixelStoref, __glXDispSwap_PixelStoref}, /* [ 54] = 110 */ {__glXDisp_PixelStorei, __glXDispSwap_PixelStorei}, /* [ 55] = 111 */ {__glXDisp_ReadPixels, __glXDispSwap_ReadPixels}, /* [ 56] = 112 */ {__glXDisp_GetBooleanv, __glXDispSwap_GetBooleanv}, /* [ 57] = 113 */ {__glXDisp_GetClipPlane, __glXDispSwap_GetClipPlane}, /* [ 58] = 114 */ {__glXDisp_GetDoublev, __glXDispSwap_GetDoublev}, /* [ 59] = 115 */ {__glXDisp_GetError, __glXDispSwap_GetError}, /* [ 60] = 116 */ {__glXDisp_GetFloatv, __glXDispSwap_GetFloatv}, /* [ 61] = 117 */ {__glXDisp_GetIntegerv, __glXDispSwap_GetIntegerv}, /* [ 62] = 118 */ {__glXDisp_GetLightfv, __glXDispSwap_GetLightfv}, /* [ 63] = 119 */ {__glXDisp_GetLightiv, __glXDispSwap_GetLightiv}, /* [ 64] = 120 */ {__glXDisp_GetMapdv, __glXDispSwap_GetMapdv}, /* [ 65] = 121 */ {__glXDisp_GetMapfv, __glXDispSwap_GetMapfv}, /* [ 66] = 122 */ {__glXDisp_GetMapiv, __glXDispSwap_GetMapiv}, /* [ 67] = 123 */ {__glXDisp_GetMaterialfv, __glXDispSwap_GetMaterialfv}, /* [ 68] = 124 */ {__glXDisp_GetMaterialiv, __glXDispSwap_GetMaterialiv}, /* [ 69] = 125 */ {__glXDisp_GetPixelMapfv, __glXDispSwap_GetPixelMapfv}, /* [ 70] = 126 */ {__glXDisp_GetPixelMapuiv, __glXDispSwap_GetPixelMapuiv}, /* [ 71] = 127 */ {__glXDisp_GetPixelMapusv, __glXDispSwap_GetPixelMapusv}, /* [ 72] = 128 */ {__glXDisp_GetPolygonStipple, __glXDispSwap_GetPolygonStipple}, /* [ 73] = 129 */ {__glXDisp_GetString, __glXDispSwap_GetString}, /* [ 74] = 130 */ {__glXDisp_GetTexEnvfv, __glXDispSwap_GetTexEnvfv}, /* [ 75] = 131 */ {__glXDisp_GetTexEnviv, __glXDispSwap_GetTexEnviv}, /* [ 76] = 132 */ {__glXDisp_GetTexGendv, __glXDispSwap_GetTexGendv}, /* [ 77] = 133 */ {__glXDisp_GetTexGenfv, __glXDispSwap_GetTexGenfv}, /* [ 78] = 134 */ {__glXDisp_GetTexGeniv, __glXDispSwap_GetTexGeniv}, /* [ 79] = 135 */ {__glXDisp_GetTexImage, __glXDispSwap_GetTexImage}, /* [ 80] = 136 */ {__glXDisp_GetTexParameterfv, __glXDispSwap_GetTexParameterfv}, /* [ 81] = 137 */ {__glXDisp_GetTexParameteriv, __glXDispSwap_GetTexParameteriv}, /* [ 82] = 138 */ {__glXDisp_GetTexLevelParameterfv, __glXDispSwap_GetTexLevelParameterfv}, /* [ 83] = 139 */ {__glXDisp_GetTexLevelParameteriv, __glXDispSwap_GetTexLevelParameteriv}, /* [ 84] = 140 */ {__glXDisp_IsEnabled, __glXDispSwap_IsEnabled}, /* [ 85] = 141 */ {__glXDisp_IsList, __glXDispSwap_IsList}, /* [ 86] = 142 */ {__glXDisp_Flush, __glXDispSwap_Flush}, /* [ 87] = 143 */ {__glXDisp_AreTexturesResident, __glXDispSwap_AreTexturesResident}, /* [ 88] = 144 */ {__glXDisp_DeleteTextures, __glXDispSwap_DeleteTextures}, /* [ 89] = 145 */ {__glXDisp_GenTextures, __glXDispSwap_GenTextures}, /* [ 90] = 146 */ {__glXDisp_IsTexture, __glXDispSwap_IsTexture}, /* [ 91] = 147 */ {__glXDisp_GetColorTable, __glXDispSwap_GetColorTable}, /* [ 92] = 148 */ {__glXDisp_GetColorTableParameterfv, __glXDispSwap_GetColorTableParameterfv}, /* [ 93] = 149 */ {__glXDisp_GetColorTableParameteriv, __glXDispSwap_GetColorTableParameteriv}, /* [ 94] = 150 */ {__glXDisp_GetConvolutionFilter, __glXDispSwap_GetConvolutionFilter}, /* [ 95] = 151 */ {__glXDisp_GetConvolutionParameterfv, __glXDispSwap_GetConvolutionParameterfv}, /* [ 96] = 152 */ {__glXDisp_GetConvolutionParameteriv, __glXDispSwap_GetConvolutionParameteriv}, /* [ 97] = 153 */ {__glXDisp_GetSeparableFilter, __glXDispSwap_GetSeparableFilter}, /* [ 98] = 154 */ {__glXDisp_GetHistogram, __glXDispSwap_GetHistogram}, /* [ 99] = 155 */ {__glXDisp_GetHistogramParameterfv, __glXDispSwap_GetHistogramParameterfv}, /* [ 100] = 156 */ {__glXDisp_GetHistogramParameteriv, __glXDispSwap_GetHistogramParameteriv}, /* [ 101] = 157 */ {__glXDisp_GetMinmax, __glXDispSwap_GetMinmax}, /* [ 102] = 158 */ {__glXDisp_GetMinmaxParameterfv, __glXDispSwap_GetMinmaxParameterfv}, /* [ 103] = 159 */ {__glXDisp_GetMinmaxParameteriv, __glXDispSwap_GetMinmaxParameteriv}, /* [ 104] = 160 */ {__glXDisp_GetCompressedTexImage, __glXDispSwap_GetCompressedTexImage}, /* [ 105] = 161 */ {__glXDisp_DeleteQueries, __glXDispSwap_DeleteQueries}, /* [ 106] = 162 */ {__glXDisp_GenQueries, __glXDispSwap_GenQueries}, /* [ 107] = 163 */ {__glXDisp_IsQuery, __glXDispSwap_IsQuery}, /* [ 108] = 164 */ {__glXDisp_GetQueryiv, __glXDispSwap_GetQueryiv}, /* [ 109] = 165 */ {__glXDisp_GetQueryObjectiv, __glXDispSwap_GetQueryObjectiv}, /* [ 110] = 166 */ {__glXDisp_GetQueryObjectuiv, __glXDispSwap_GetQueryObjectuiv}, /* [ 111] = 167 */ {NULL, NULL}, }; const struct __glXDispatchInfo Single_dispatch_info = { 8, Single_dispatch_tree, Single_function_table, NULL, NULL }; /*****************************************************************/ /* tree depth = 8 */ static const int_fast16_t Render_dispatch_tree[92] = { /* [0] -> opcode range [0, 8192], node depth 1 */ 2, 5, 31, 54, EMPTY_LEAF, /* [5] -> opcode range [0, 2048], node depth 2 */ 1, 8, EMPTY_LEAF, /* [8] -> opcode range [0, 1024], node depth 3 */ 1, 11, EMPTY_LEAF, /* [11] -> opcode range [0, 512], node depth 4 */ 1, 14, EMPTY_LEAF, /* [14] -> opcode range [0, 256], node depth 5 */ 4, LEAF(0), LEAF(16), LEAF(32), LEAF(48), LEAF(64), LEAF(80), LEAF(96), LEAF(112), LEAF(128), LEAF(144), LEAF(160), LEAF(176), LEAF(192), LEAF(208), LEAF(224), EMPTY_LEAF, /* [31] -> opcode range [2048, 4096], node depth 2 */ 1, 34, EMPTY_LEAF, /* [34] -> opcode range [2048, 3072], node depth 3 */ 1, 37, EMPTY_LEAF, /* [37] -> opcode range [2048, 2560], node depth 4 */ 1, 40, EMPTY_LEAF, /* [40] -> opcode range [2048, 2304], node depth 5 */ 1, 43, EMPTY_LEAF, /* [43] -> opcode range [2048, 2176], node depth 6 */ 1, 46, EMPTY_LEAF, /* [46] -> opcode range [2048, 2112], node depth 7 */ 1, 49, EMPTY_LEAF, /* [49] -> opcode range [2048, 2080], node depth 8 */ 2, LEAF(240), LEAF(248), LEAF(256), EMPTY_LEAF, /* [54] -> opcode range [4096, 6144], node depth 2 */ 1, 57, EMPTY_LEAF, /* [57] -> opcode range [4096, 5120], node depth 3 */ 1, 60, EMPTY_LEAF, /* [60] -> opcode range [4096, 4608], node depth 4 */ 1, 63, EMPTY_LEAF, /* [63] -> opcode range [4096, 4352], node depth 5 */ 4, LEAF(264), LEAF(280), 80, EMPTY_LEAF, EMPTY_LEAF, LEAF(296), LEAF(312), LEAF(328), LEAF(344), EMPTY_LEAF, 83, 86, EMPTY_LEAF, 89, LEAF(360), EMPTY_LEAF, /* [80] -> opcode range [4128, 4144], node depth 6 */ 1, LEAF(376), EMPTY_LEAF, /* [83] -> opcode range [4256, 4272], node depth 6 */ 1, EMPTY_LEAF, LEAF(384), /* [86] -> opcode range [4272, 4288], node depth 6 */ 1, LEAF(392), EMPTY_LEAF, /* [89] -> opcode range [4304, 4320], node depth 6 */ 1, EMPTY_LEAF, LEAF(400), }; static const void *Render_function_table[408][2] = { /* [ 0] = 0 */ {NULL, NULL}, /* [ 1] = 1 */ {__glXDisp_CallList, __glXDispSwap_CallList}, /* [ 2] = 2 */ {__glXDisp_CallLists, __glXDispSwap_CallLists}, /* [ 3] = 3 */ {__glXDisp_ListBase, __glXDispSwap_ListBase}, /* [ 4] = 4 */ {__glXDisp_Begin, __glXDispSwap_Begin}, /* [ 5] = 5 */ {__glXDisp_Bitmap, __glXDispSwap_Bitmap}, /* [ 6] = 6 */ {__glXDisp_Color3bv, __glXDispSwap_Color3bv}, /* [ 7] = 7 */ {__glXDisp_Color3dv, __glXDispSwap_Color3dv}, /* [ 8] = 8 */ {__glXDisp_Color3fv, __glXDispSwap_Color3fv}, /* [ 9] = 9 */ {__glXDisp_Color3iv, __glXDispSwap_Color3iv}, /* [ 10] = 10 */ {__glXDisp_Color3sv, __glXDispSwap_Color3sv}, /* [ 11] = 11 */ {__glXDisp_Color3ubv, __glXDispSwap_Color3ubv}, /* [ 12] = 12 */ {__glXDisp_Color3uiv, __glXDispSwap_Color3uiv}, /* [ 13] = 13 */ {__glXDisp_Color3usv, __glXDispSwap_Color3usv}, /* [ 14] = 14 */ {__glXDisp_Color4bv, __glXDispSwap_Color4bv}, /* [ 15] = 15 */ {__glXDisp_Color4dv, __glXDispSwap_Color4dv}, /* [ 16] = 16 */ {__glXDisp_Color4fv, __glXDispSwap_Color4fv}, /* [ 17] = 17 */ {__glXDisp_Color4iv, __glXDispSwap_Color4iv}, /* [ 18] = 18 */ {__glXDisp_Color4sv, __glXDispSwap_Color4sv}, /* [ 19] = 19 */ {__glXDisp_Color4ubv, __glXDispSwap_Color4ubv}, /* [ 20] = 20 */ {__glXDisp_Color4uiv, __glXDispSwap_Color4uiv}, /* [ 21] = 21 */ {__glXDisp_Color4usv, __glXDispSwap_Color4usv}, /* [ 22] = 22 */ {__glXDisp_EdgeFlagv, __glXDispSwap_EdgeFlagv}, /* [ 23] = 23 */ {__glXDisp_End, __glXDispSwap_End}, /* [ 24] = 24 */ {__glXDisp_Indexdv, __glXDispSwap_Indexdv}, /* [ 25] = 25 */ {__glXDisp_Indexfv, __glXDispSwap_Indexfv}, /* [ 26] = 26 */ {__glXDisp_Indexiv, __glXDispSwap_Indexiv}, /* [ 27] = 27 */ {__glXDisp_Indexsv, __glXDispSwap_Indexsv}, /* [ 28] = 28 */ {__glXDisp_Normal3bv, __glXDispSwap_Normal3bv}, /* [ 29] = 29 */ {__glXDisp_Normal3dv, __glXDispSwap_Normal3dv}, /* [ 30] = 30 */ {__glXDisp_Normal3fv, __glXDispSwap_Normal3fv}, /* [ 31] = 31 */ {__glXDisp_Normal3iv, __glXDispSwap_Normal3iv}, /* [ 32] = 32 */ {__glXDisp_Normal3sv, __glXDispSwap_Normal3sv}, /* [ 33] = 33 */ {__glXDisp_RasterPos2dv, __glXDispSwap_RasterPos2dv}, /* [ 34] = 34 */ {__glXDisp_RasterPos2fv, __glXDispSwap_RasterPos2fv}, /* [ 35] = 35 */ {__glXDisp_RasterPos2iv, __glXDispSwap_RasterPos2iv}, /* [ 36] = 36 */ {__glXDisp_RasterPos2sv, __glXDispSwap_RasterPos2sv}, /* [ 37] = 37 */ {__glXDisp_RasterPos3dv, __glXDispSwap_RasterPos3dv}, /* [ 38] = 38 */ {__glXDisp_RasterPos3fv, __glXDispSwap_RasterPos3fv}, /* [ 39] = 39 */ {__glXDisp_RasterPos3iv, __glXDispSwap_RasterPos3iv}, /* [ 40] = 40 */ {__glXDisp_RasterPos3sv, __glXDispSwap_RasterPos3sv}, /* [ 41] = 41 */ {__glXDisp_RasterPos4dv, __glXDispSwap_RasterPos4dv}, /* [ 42] = 42 */ {__glXDisp_RasterPos4fv, __glXDispSwap_RasterPos4fv}, /* [ 43] = 43 */ {__glXDisp_RasterPos4iv, __glXDispSwap_RasterPos4iv}, /* [ 44] = 44 */ {__glXDisp_RasterPos4sv, __glXDispSwap_RasterPos4sv}, /* [ 45] = 45 */ {__glXDisp_Rectdv, __glXDispSwap_Rectdv}, /* [ 46] = 46 */ {__glXDisp_Rectfv, __glXDispSwap_Rectfv}, /* [ 47] = 47 */ {__glXDisp_Rectiv, __glXDispSwap_Rectiv}, /* [ 48] = 48 */ {__glXDisp_Rectsv, __glXDispSwap_Rectsv}, /* [ 49] = 49 */ {__glXDisp_TexCoord1dv, __glXDispSwap_TexCoord1dv}, /* [ 50] = 50 */ {__glXDisp_TexCoord1fv, __glXDispSwap_TexCoord1fv}, /* [ 51] = 51 */ {__glXDisp_TexCoord1iv, __glXDispSwap_TexCoord1iv}, /* [ 52] = 52 */ {__glXDisp_TexCoord1sv, __glXDispSwap_TexCoord1sv}, /* [ 53] = 53 */ {__glXDisp_TexCoord2dv, __glXDispSwap_TexCoord2dv}, /* [ 54] = 54 */ {__glXDisp_TexCoord2fv, __glXDispSwap_TexCoord2fv}, /* [ 55] = 55 */ {__glXDisp_TexCoord2iv, __glXDispSwap_TexCoord2iv}, /* [ 56] = 56 */ {__glXDisp_TexCoord2sv, __glXDispSwap_TexCoord2sv}, /* [ 57] = 57 */ {__glXDisp_TexCoord3dv, __glXDispSwap_TexCoord3dv}, /* [ 58] = 58 */ {__glXDisp_TexCoord3fv, __glXDispSwap_TexCoord3fv}, /* [ 59] = 59 */ {__glXDisp_TexCoord3iv, __glXDispSwap_TexCoord3iv}, /* [ 60] = 60 */ {__glXDisp_TexCoord3sv, __glXDispSwap_TexCoord3sv}, /* [ 61] = 61 */ {__glXDisp_TexCoord4dv, __glXDispSwap_TexCoord4dv}, /* [ 62] = 62 */ {__glXDisp_TexCoord4fv, __glXDispSwap_TexCoord4fv}, /* [ 63] = 63 */ {__glXDisp_TexCoord4iv, __glXDispSwap_TexCoord4iv}, /* [ 64] = 64 */ {__glXDisp_TexCoord4sv, __glXDispSwap_TexCoord4sv}, /* [ 65] = 65 */ {__glXDisp_Vertex2dv, __glXDispSwap_Vertex2dv}, /* [ 66] = 66 */ {__glXDisp_Vertex2fv, __glXDispSwap_Vertex2fv}, /* [ 67] = 67 */ {__glXDisp_Vertex2iv, __glXDispSwap_Vertex2iv}, /* [ 68] = 68 */ {__glXDisp_Vertex2sv, __glXDispSwap_Vertex2sv}, /* [ 69] = 69 */ {__glXDisp_Vertex3dv, __glXDispSwap_Vertex3dv}, /* [ 70] = 70 */ {__glXDisp_Vertex3fv, __glXDispSwap_Vertex3fv}, /* [ 71] = 71 */ {__glXDisp_Vertex3iv, __glXDispSwap_Vertex3iv}, /* [ 72] = 72 */ {__glXDisp_Vertex3sv, __glXDispSwap_Vertex3sv}, /* [ 73] = 73 */ {__glXDisp_Vertex4dv, __glXDispSwap_Vertex4dv}, /* [ 74] = 74 */ {__glXDisp_Vertex4fv, __glXDispSwap_Vertex4fv}, /* [ 75] = 75 */ {__glXDisp_Vertex4iv, __glXDispSwap_Vertex4iv}, /* [ 76] = 76 */ {__glXDisp_Vertex4sv, __glXDispSwap_Vertex4sv}, /* [ 77] = 77 */ {__glXDisp_ClipPlane, __glXDispSwap_ClipPlane}, /* [ 78] = 78 */ {__glXDisp_ColorMaterial, __glXDispSwap_ColorMaterial}, /* [ 79] = 79 */ {__glXDisp_CullFace, __glXDispSwap_CullFace}, /* [ 80] = 80 */ {__glXDisp_Fogf, __glXDispSwap_Fogf}, /* [ 81] = 81 */ {__glXDisp_Fogfv, __glXDispSwap_Fogfv}, /* [ 82] = 82 */ {__glXDisp_Fogi, __glXDispSwap_Fogi}, /* [ 83] = 83 */ {__glXDisp_Fogiv, __glXDispSwap_Fogiv}, /* [ 84] = 84 */ {__glXDisp_FrontFace, __glXDispSwap_FrontFace}, /* [ 85] = 85 */ {__glXDisp_Hint, __glXDispSwap_Hint}, /* [ 86] = 86 */ {__glXDisp_Lightf, __glXDispSwap_Lightf}, /* [ 87] = 87 */ {__glXDisp_Lightfv, __glXDispSwap_Lightfv}, /* [ 88] = 88 */ {__glXDisp_Lighti, __glXDispSwap_Lighti}, /* [ 89] = 89 */ {__glXDisp_Lightiv, __glXDispSwap_Lightiv}, /* [ 90] = 90 */ {__glXDisp_LightModelf, __glXDispSwap_LightModelf}, /* [ 91] = 91 */ {__glXDisp_LightModelfv, __glXDispSwap_LightModelfv}, /* [ 92] = 92 */ {__glXDisp_LightModeli, __glXDispSwap_LightModeli}, /* [ 93] = 93 */ {__glXDisp_LightModeliv, __glXDispSwap_LightModeliv}, /* [ 94] = 94 */ {__glXDisp_LineStipple, __glXDispSwap_LineStipple}, /* [ 95] = 95 */ {__glXDisp_LineWidth, __glXDispSwap_LineWidth}, /* [ 96] = 96 */ {__glXDisp_Materialf, __glXDispSwap_Materialf}, /* [ 97] = 97 */ {__glXDisp_Materialfv, __glXDispSwap_Materialfv}, /* [ 98] = 98 */ {__glXDisp_Materiali, __glXDispSwap_Materiali}, /* [ 99] = 99 */ {__glXDisp_Materialiv, __glXDispSwap_Materialiv}, /* [ 100] = 100 */ {__glXDisp_PointSize, __glXDispSwap_PointSize}, /* [ 101] = 101 */ {__glXDisp_PolygonMode, __glXDispSwap_PolygonMode}, /* [ 102] = 102 */ {__glXDisp_PolygonStipple, __glXDispSwap_PolygonStipple}, /* [ 103] = 103 */ {__glXDisp_Scissor, __glXDispSwap_Scissor}, /* [ 104] = 104 */ {__glXDisp_ShadeModel, __glXDispSwap_ShadeModel}, /* [ 105] = 105 */ {__glXDisp_TexParameterf, __glXDispSwap_TexParameterf}, /* [ 106] = 106 */ {__glXDisp_TexParameterfv, __glXDispSwap_TexParameterfv}, /* [ 107] = 107 */ {__glXDisp_TexParameteri, __glXDispSwap_TexParameteri}, /* [ 108] = 108 */ {__glXDisp_TexParameteriv, __glXDispSwap_TexParameteriv}, /* [ 109] = 109 */ {__glXDisp_TexImage1D, __glXDispSwap_TexImage1D}, /* [ 110] = 110 */ {__glXDisp_TexImage2D, __glXDispSwap_TexImage2D}, /* [ 111] = 111 */ {__glXDisp_TexEnvf, __glXDispSwap_TexEnvf}, /* [ 112] = 112 */ {__glXDisp_TexEnvfv, __glXDispSwap_TexEnvfv}, /* [ 113] = 113 */ {__glXDisp_TexEnvi, __glXDispSwap_TexEnvi}, /* [ 114] = 114 */ {__glXDisp_TexEnviv, __glXDispSwap_TexEnviv}, /* [ 115] = 115 */ {__glXDisp_TexGend, __glXDispSwap_TexGend}, /* [ 116] = 116 */ {__glXDisp_TexGendv, __glXDispSwap_TexGendv}, /* [ 117] = 117 */ {__glXDisp_TexGenf, __glXDispSwap_TexGenf}, /* [ 118] = 118 */ {__glXDisp_TexGenfv, __glXDispSwap_TexGenfv}, /* [ 119] = 119 */ {__glXDisp_TexGeni, __glXDispSwap_TexGeni}, /* [ 120] = 120 */ {__glXDisp_TexGeniv, __glXDispSwap_TexGeniv}, /* [ 121] = 121 */ {__glXDisp_InitNames, __glXDispSwap_InitNames}, /* [ 122] = 122 */ {__glXDisp_LoadName, __glXDispSwap_LoadName}, /* [ 123] = 123 */ {__glXDisp_PassThrough, __glXDispSwap_PassThrough}, /* [ 124] = 124 */ {__glXDisp_PopName, __glXDispSwap_PopName}, /* [ 125] = 125 */ {__glXDisp_PushName, __glXDispSwap_PushName}, /* [ 126] = 126 */ {__glXDisp_DrawBuffer, __glXDispSwap_DrawBuffer}, /* [ 127] = 127 */ {__glXDisp_Clear, __glXDispSwap_Clear}, /* [ 128] = 128 */ {__glXDisp_ClearAccum, __glXDispSwap_ClearAccum}, /* [ 129] = 129 */ {__glXDisp_ClearIndex, __glXDispSwap_ClearIndex}, /* [ 130] = 130 */ {__glXDisp_ClearColor, __glXDispSwap_ClearColor}, /* [ 131] = 131 */ {__glXDisp_ClearStencil, __glXDispSwap_ClearStencil}, /* [ 132] = 132 */ {__glXDisp_ClearDepth, __glXDispSwap_ClearDepth}, /* [ 133] = 133 */ {__glXDisp_StencilMask, __glXDispSwap_StencilMask}, /* [ 134] = 134 */ {__glXDisp_ColorMask, __glXDispSwap_ColorMask}, /* [ 135] = 135 */ {__glXDisp_DepthMask, __glXDispSwap_DepthMask}, /* [ 136] = 136 */ {__glXDisp_IndexMask, __glXDispSwap_IndexMask}, /* [ 137] = 137 */ {__glXDisp_Accum, __glXDispSwap_Accum}, /* [ 138] = 138 */ {__glXDisp_Disable, __glXDispSwap_Disable}, /* [ 139] = 139 */ {__glXDisp_Enable, __glXDispSwap_Enable}, /* [ 140] = 140 */ {NULL, NULL}, /* [ 141] = 141 */ {__glXDisp_PopAttrib, __glXDispSwap_PopAttrib}, /* [ 142] = 142 */ {__glXDisp_PushAttrib, __glXDispSwap_PushAttrib}, /* [ 143] = 143 */ {__glXDisp_Map1d, __glXDispSwap_Map1d}, /* [ 144] = 144 */ {__glXDisp_Map1f, __glXDispSwap_Map1f}, /* [ 145] = 145 */ {__glXDisp_Map2d, __glXDispSwap_Map2d}, /* [ 146] = 146 */ {__glXDisp_Map2f, __glXDispSwap_Map2f}, /* [ 147] = 147 */ {__glXDisp_MapGrid1d, __glXDispSwap_MapGrid1d}, /* [ 148] = 148 */ {__glXDisp_MapGrid1f, __glXDispSwap_MapGrid1f}, /* [ 149] = 149 */ {__glXDisp_MapGrid2d, __glXDispSwap_MapGrid2d}, /* [ 150] = 150 */ {__glXDisp_MapGrid2f, __glXDispSwap_MapGrid2f}, /* [ 151] = 151 */ {__glXDisp_EvalCoord1dv, __glXDispSwap_EvalCoord1dv}, /* [ 152] = 152 */ {__glXDisp_EvalCoord1fv, __glXDispSwap_EvalCoord1fv}, /* [ 153] = 153 */ {__glXDisp_EvalCoord2dv, __glXDispSwap_EvalCoord2dv}, /* [ 154] = 154 */ {__glXDisp_EvalCoord2fv, __glXDispSwap_EvalCoord2fv}, /* [ 155] = 155 */ {__glXDisp_EvalMesh1, __glXDispSwap_EvalMesh1}, /* [ 156] = 156 */ {__glXDisp_EvalPoint1, __glXDispSwap_EvalPoint1}, /* [ 157] = 157 */ {__glXDisp_EvalMesh2, __glXDispSwap_EvalMesh2}, /* [ 158] = 158 */ {__glXDisp_EvalPoint2, __glXDispSwap_EvalPoint2}, /* [ 159] = 159 */ {__glXDisp_AlphaFunc, __glXDispSwap_AlphaFunc}, /* [ 160] = 160 */ {__glXDisp_BlendFunc, __glXDispSwap_BlendFunc}, /* [ 161] = 161 */ {__glXDisp_LogicOp, __glXDispSwap_LogicOp}, /* [ 162] = 162 */ {__glXDisp_StencilFunc, __glXDispSwap_StencilFunc}, /* [ 163] = 163 */ {__glXDisp_StencilOp, __glXDispSwap_StencilOp}, /* [ 164] = 164 */ {__glXDisp_DepthFunc, __glXDispSwap_DepthFunc}, /* [ 165] = 165 */ {__glXDisp_PixelZoom, __glXDispSwap_PixelZoom}, /* [ 166] = 166 */ {__glXDisp_PixelTransferf, __glXDispSwap_PixelTransferf}, /* [ 167] = 167 */ {__glXDisp_PixelTransferi, __glXDispSwap_PixelTransferi}, /* [ 168] = 168 */ {__glXDisp_PixelMapfv, __glXDispSwap_PixelMapfv}, /* [ 169] = 169 */ {__glXDisp_PixelMapuiv, __glXDispSwap_PixelMapuiv}, /* [ 170] = 170 */ {__glXDisp_PixelMapusv, __glXDispSwap_PixelMapusv}, /* [ 171] = 171 */ {__glXDisp_ReadBuffer, __glXDispSwap_ReadBuffer}, /* [ 172] = 172 */ {__glXDisp_CopyPixels, __glXDispSwap_CopyPixels}, /* [ 173] = 173 */ {__glXDisp_DrawPixels, __glXDispSwap_DrawPixels}, /* [ 174] = 174 */ {__glXDisp_DepthRange, __glXDispSwap_DepthRange}, /* [ 175] = 175 */ {__glXDisp_Frustum, __glXDispSwap_Frustum}, /* [ 176] = 176 */ {__glXDisp_LoadIdentity, __glXDispSwap_LoadIdentity}, /* [ 177] = 177 */ {__glXDisp_LoadMatrixf, __glXDispSwap_LoadMatrixf}, /* [ 178] = 178 */ {__glXDisp_LoadMatrixd, __glXDispSwap_LoadMatrixd}, /* [ 179] = 179 */ {__glXDisp_MatrixMode, __glXDispSwap_MatrixMode}, /* [ 180] = 180 */ {__glXDisp_MultMatrixf, __glXDispSwap_MultMatrixf}, /* [ 181] = 181 */ {__glXDisp_MultMatrixd, __glXDispSwap_MultMatrixd}, /* [ 182] = 182 */ {__glXDisp_Ortho, __glXDispSwap_Ortho}, /* [ 183] = 183 */ {__glXDisp_PopMatrix, __glXDispSwap_PopMatrix}, /* [ 184] = 184 */ {__glXDisp_PushMatrix, __glXDispSwap_PushMatrix}, /* [ 185] = 185 */ {__glXDisp_Rotated, __glXDispSwap_Rotated}, /* [ 186] = 186 */ {__glXDisp_Rotatef, __glXDispSwap_Rotatef}, /* [ 187] = 187 */ {__glXDisp_Scaled, __glXDispSwap_Scaled}, /* [ 188] = 188 */ {__glXDisp_Scalef, __glXDispSwap_Scalef}, /* [ 189] = 189 */ {__glXDisp_Translated, __glXDispSwap_Translated}, /* [ 190] = 190 */ {__glXDisp_Translatef, __glXDispSwap_Translatef}, /* [ 191] = 191 */ {__glXDisp_Viewport, __glXDispSwap_Viewport}, /* [ 192] = 192 */ {__glXDisp_PolygonOffset, __glXDispSwap_PolygonOffset}, /* [ 193] = 193 */ {__glXDisp_DrawArrays, __glXDispSwap_DrawArrays}, /* [ 194] = 194 */ {__glXDisp_Indexubv, __glXDispSwap_Indexubv}, /* [ 195] = 195 */ {__glXDisp_ColorSubTable, __glXDispSwap_ColorSubTable}, /* [ 196] = 196 */ {__glXDisp_CopyColorSubTable, __glXDispSwap_CopyColorSubTable}, /* [ 197] = 197 */ {__glXDisp_ActiveTexture, __glXDispSwap_ActiveTexture}, /* [ 198] = 198 */ {__glXDisp_MultiTexCoord1dv, __glXDispSwap_MultiTexCoord1dv}, /* [ 199] = 199 */ {__glXDisp_MultiTexCoord1fvARB, __glXDispSwap_MultiTexCoord1fvARB}, /* [ 200] = 200 */ {__glXDisp_MultiTexCoord1iv, __glXDispSwap_MultiTexCoord1iv}, /* [ 201] = 201 */ {__glXDisp_MultiTexCoord1sv, __glXDispSwap_MultiTexCoord1sv}, /* [ 202] = 202 */ {__glXDisp_MultiTexCoord2dv, __glXDispSwap_MultiTexCoord2dv}, /* [ 203] = 203 */ {__glXDisp_MultiTexCoord2fvARB, __glXDispSwap_MultiTexCoord2fvARB}, /* [ 204] = 204 */ {__glXDisp_MultiTexCoord2iv, __glXDispSwap_MultiTexCoord2iv}, /* [ 205] = 205 */ {__glXDisp_MultiTexCoord2sv, __glXDispSwap_MultiTexCoord2sv}, /* [ 206] = 206 */ {__glXDisp_MultiTexCoord3dv, __glXDispSwap_MultiTexCoord3dv}, /* [ 207] = 207 */ {__glXDisp_MultiTexCoord3fvARB, __glXDispSwap_MultiTexCoord3fvARB}, /* [ 208] = 208 */ {__glXDisp_MultiTexCoord3iv, __glXDispSwap_MultiTexCoord3iv}, /* [ 209] = 209 */ {__glXDisp_MultiTexCoord3sv, __glXDispSwap_MultiTexCoord3sv}, /* [ 210] = 210 */ {__glXDisp_MultiTexCoord4dv, __glXDispSwap_MultiTexCoord4dv}, /* [ 211] = 211 */ {__glXDisp_MultiTexCoord4fvARB, __glXDispSwap_MultiTexCoord4fvARB}, /* [ 212] = 212 */ {__glXDisp_MultiTexCoord4iv, __glXDispSwap_MultiTexCoord4iv}, /* [ 213] = 213 */ {__glXDisp_MultiTexCoord4sv, __glXDispSwap_MultiTexCoord4sv}, /* [ 214] = 214 */ {__glXDisp_CompressedTexImage1D, __glXDispSwap_CompressedTexImage1D}, /* [ 215] = 215 */ {__glXDisp_CompressedTexImage2D, __glXDispSwap_CompressedTexImage2D}, /* [ 216] = 216 */ {__glXDisp_CompressedTexImage3D, __glXDispSwap_CompressedTexImage3D}, /* [ 217] = 217 */ {__glXDisp_CompressedTexSubImage1D, __glXDispSwap_CompressedTexSubImage1D}, /* [ 218] = 218 */ {__glXDisp_CompressedTexSubImage2D, __glXDispSwap_CompressedTexSubImage2D}, /* [ 219] = 219 */ {__glXDisp_CompressedTexSubImage3D, __glXDispSwap_CompressedTexSubImage3D}, /* [ 220] = 220 */ {NULL, NULL}, /* [ 221] = 221 */ {NULL, NULL}, /* [ 222] = 222 */ {NULL, NULL}, /* [ 223] = 223 */ {NULL, NULL}, /* [ 224] = 224 */ {NULL, NULL}, /* [ 225] = 225 */ {NULL, NULL}, /* [ 226] = 226 */ {NULL, NULL}, /* [ 227] = 227 */ {NULL, NULL}, /* [ 228] = 228 */ {NULL, NULL}, /* [ 229] = 229 */ {__glXDisp_SampleCoverage, __glXDispSwap_SampleCoverage}, /* [ 230] = 230 */ {__glXDisp_WindowPos3fv, __glXDispSwap_WindowPos3fv}, /* [ 231] = 231 */ {__glXDisp_BeginQuery, __glXDispSwap_BeginQuery}, /* [ 232] = 232 */ {__glXDisp_EndQuery, __glXDispSwap_EndQuery}, /* [ 233] = 233 */ {__glXDisp_DrawBuffers, __glXDispSwap_DrawBuffers}, /* [ 234] = 234 */ {__glXDisp_ClampColor, __glXDispSwap_ClampColor}, /* [ 235] = 235 */ {NULL, NULL}, /* [ 236] = 236 */ {NULL, NULL}, /* [ 237] = 237 */ {__glXDisp_FramebufferTextureLayer, __glXDispSwap_FramebufferTextureLayer}, /* [ 238] = 238 */ {NULL, NULL}, /* [ 239] = 239 */ {NULL, NULL}, /* [ 240] = 2048 */ {NULL, NULL}, /* [ 241] = 2049 */ {NULL, NULL}, /* [ 242] = 2050 */ {NULL, NULL}, /* [ 243] = 2051 */ {NULL, NULL}, /* [ 244] = 2052 */ {NULL, NULL}, /* [ 245] = 2053 */ {__glXDisp_ColorTable, __glXDispSwap_ColorTable}, /* [ 246] = 2054 */ {__glXDisp_ColorTableParameterfv, __glXDispSwap_ColorTableParameterfv}, /* [ 247] = 2055 */ {__glXDisp_ColorTableParameteriv, __glXDispSwap_ColorTableParameteriv}, /* [ 248] = 2056 */ {__glXDisp_CopyColorTable, __glXDispSwap_CopyColorTable}, /* [ 249] = 2057 */ {NULL, NULL}, /* [ 250] = 2058 */ {NULL, NULL}, /* [ 251] = 2059 */ {NULL, NULL}, /* [ 252] = 2060 */ {NULL, NULL}, /* [ 253] = 2061 */ {NULL, NULL}, /* [ 254] = 2062 */ {NULL, NULL}, /* [ 255] = 2063 */ {NULL, NULL}, /* [ 256] = 2064 */ {NULL, NULL}, /* [ 257] = 2065 */ {__glXDisp_PointParameterf, __glXDispSwap_PointParameterf}, /* [ 258] = 2066 */ {__glXDisp_PointParameterfv, __glXDispSwap_PointParameterfv}, /* [ 259] = 2067 */ {NULL, NULL}, /* [ 260] = 2068 */ {NULL, NULL}, /* [ 261] = 2069 */ {NULL, NULL}, /* [ 262] = 2070 */ {NULL, NULL}, /* [ 263] = 2071 */ {NULL, NULL}, /* [ 264] = 4096 */ {__glXDisp_BlendColor, __glXDispSwap_BlendColor}, /* [ 265] = 4097 */ {__glXDisp_BlendEquation, __glXDispSwap_BlendEquation}, /* [ 266] = 4098 */ {NULL, NULL}, /* [ 267] = 4099 */ {__glXDisp_TexSubImage1D, __glXDispSwap_TexSubImage1D}, /* [ 268] = 4100 */ {__glXDisp_TexSubImage2D, __glXDispSwap_TexSubImage2D}, /* [ 269] = 4101 */ {__glXDisp_ConvolutionFilter1D, __glXDispSwap_ConvolutionFilter1D}, /* [ 270] = 4102 */ {__glXDisp_ConvolutionFilter2D, __glXDispSwap_ConvolutionFilter2D}, /* [ 271] = 4103 */ {__glXDisp_ConvolutionParameterf, __glXDispSwap_ConvolutionParameterf}, /* [ 272] = 4104 */ {__glXDisp_ConvolutionParameterfv, __glXDispSwap_ConvolutionParameterfv}, /* [ 273] = 4105 */ {__glXDisp_ConvolutionParameteri, __glXDispSwap_ConvolutionParameteri}, /* [ 274] = 4106 */ {__glXDisp_ConvolutionParameteriv, __glXDispSwap_ConvolutionParameteriv}, /* [ 275] = 4107 */ {__glXDisp_CopyConvolutionFilter1D, __glXDispSwap_CopyConvolutionFilter1D}, /* [ 276] = 4108 */ {__glXDisp_CopyConvolutionFilter2D, __glXDispSwap_CopyConvolutionFilter2D}, /* [ 277] = 4109 */ {__glXDisp_SeparableFilter2D, __glXDispSwap_SeparableFilter2D}, /* [ 278] = 4110 */ {__glXDisp_Histogram, __glXDispSwap_Histogram}, /* [ 279] = 4111 */ {__glXDisp_Minmax, __glXDispSwap_Minmax}, /* [ 280] = 4112 */ {__glXDisp_ResetHistogram, __glXDispSwap_ResetHistogram}, /* [ 281] = 4113 */ {__glXDisp_ResetMinmax, __glXDispSwap_ResetMinmax}, /* [ 282] = 4114 */ {__glXDisp_TexImage3D, __glXDispSwap_TexImage3D}, /* [ 283] = 4115 */ {__glXDisp_TexSubImage3D, __glXDispSwap_TexSubImage3D}, /* [ 284] = 4116 */ {NULL, NULL}, /* [ 285] = 4117 */ {__glXDisp_BindTexture, __glXDispSwap_BindTexture}, /* [ 286] = 4118 */ {__glXDisp_PrioritizeTextures, __glXDispSwap_PrioritizeTextures}, /* [ 287] = 4119 */ {__glXDisp_CopyTexImage1D, __glXDispSwap_CopyTexImage1D}, /* [ 288] = 4120 */ {__glXDisp_CopyTexImage2D, __glXDispSwap_CopyTexImage2D}, /* [ 289] = 4121 */ {__glXDisp_CopyTexSubImage1D, __glXDispSwap_CopyTexSubImage1D}, /* [ 290] = 4122 */ {__glXDisp_CopyTexSubImage2D, __glXDispSwap_CopyTexSubImage2D}, /* [ 291] = 4123 */ {__glXDisp_CopyTexSubImage3D, __glXDispSwap_CopyTexSubImage3D}, /* [ 292] = 4124 */ {__glXDisp_FogCoordfvEXT, __glXDispSwap_FogCoordfvEXT}, /* [ 293] = 4125 */ {__glXDisp_FogCoorddv, __glXDispSwap_FogCoorddv}, /* [ 294] = 4126 */ {__glXDisp_SecondaryColor3bv, __glXDispSwap_SecondaryColor3bv}, /* [ 295] = 4127 */ {__glXDisp_SecondaryColor3sv, __glXDispSwap_SecondaryColor3sv}, /* [ 296] = 4176 */ {NULL, NULL}, /* [ 297] = 4177 */ {NULL, NULL}, /* [ 298] = 4178 */ {NULL, NULL}, /* [ 299] = 4179 */ {NULL, NULL}, /* [ 300] = 4180 */ {__glXDisp_BindProgramARB, __glXDispSwap_BindProgramARB}, /* [ 301] = 4181 */ {NULL, NULL}, /* [ 302] = 4182 */ {NULL, NULL}, /* [ 303] = 4183 */ {NULL, NULL}, /* [ 304] = 4184 */ {__glXDisp_ProgramEnvParameter4fvARB, __glXDispSwap_ProgramEnvParameter4fvARB}, /* [ 305] = 4185 */ {__glXDisp_ProgramEnvParameter4dvARB, __glXDispSwap_ProgramEnvParameter4dvARB}, /* [ 306] = 4186 */ {NULL, NULL}, /* [ 307] = 4187 */ {NULL, NULL}, /* [ 308] = 4188 */ {NULL, NULL}, /* [ 309] = 4189 */ {__glXDisp_VertexAttrib1sv, __glXDispSwap_VertexAttrib1sv}, /* [ 310] = 4190 */ {__glXDisp_VertexAttrib2sv, __glXDispSwap_VertexAttrib2sv}, /* [ 311] = 4191 */ {__glXDisp_VertexAttrib3sv, __glXDispSwap_VertexAttrib3sv}, /* [ 312] = 4192 */ {__glXDisp_VertexAttrib4sv, __glXDispSwap_VertexAttrib4sv}, /* [ 313] = 4193 */ {__glXDisp_VertexAttrib1fvARB, __glXDispSwap_VertexAttrib1fvARB}, /* [ 314] = 4194 */ {__glXDisp_VertexAttrib2fvARB, __glXDispSwap_VertexAttrib2fvARB}, /* [ 315] = 4195 */ {__glXDisp_VertexAttrib3fvARB, __glXDispSwap_VertexAttrib3fvARB}, /* [ 316] = 4196 */ {__glXDisp_VertexAttrib4fvARB, __glXDispSwap_VertexAttrib4fvARB}, /* [ 317] = 4197 */ {__glXDisp_VertexAttrib1dv, __glXDispSwap_VertexAttrib1dv}, /* [ 318] = 4198 */ {__glXDisp_VertexAttrib2dv, __glXDispSwap_VertexAttrib2dv}, /* [ 319] = 4199 */ {__glXDisp_VertexAttrib3dv, __glXDispSwap_VertexAttrib3dv}, /* [ 320] = 4200 */ {__glXDisp_VertexAttrib4dv, __glXDispSwap_VertexAttrib4dv}, /* [ 321] = 4201 */ {__glXDisp_VertexAttrib4Nubv, __glXDispSwap_VertexAttrib4Nubv}, /* [ 322] = 4202 */ {__glXDisp_VertexAttribs1svNV, __glXDispSwap_VertexAttribs1svNV}, /* [ 323] = 4203 */ {__glXDisp_VertexAttribs2svNV, __glXDispSwap_VertexAttribs2svNV}, /* [ 324] = 4204 */ {__glXDisp_VertexAttribs3svNV, __glXDispSwap_VertexAttribs3svNV}, /* [ 325] = 4205 */ {__glXDisp_VertexAttribs4svNV, __glXDispSwap_VertexAttribs4svNV}, /* [ 326] = 4206 */ {__glXDisp_VertexAttribs1fvNV, __glXDispSwap_VertexAttribs1fvNV}, /* [ 327] = 4207 */ {__glXDisp_VertexAttribs2fvNV, __glXDispSwap_VertexAttribs2fvNV}, /* [ 328] = 4208 */ {__glXDisp_VertexAttribs3fvNV, __glXDispSwap_VertexAttribs3fvNV}, /* [ 329] = 4209 */ {__glXDisp_VertexAttribs4fvNV, __glXDispSwap_VertexAttribs4fvNV}, /* [ 330] = 4210 */ {__glXDisp_VertexAttribs1dvNV, __glXDispSwap_VertexAttribs1dvNV}, /* [ 331] = 4211 */ {__glXDisp_VertexAttribs2dvNV, __glXDispSwap_VertexAttribs2dvNV}, /* [ 332] = 4212 */ {__glXDisp_VertexAttribs3dvNV, __glXDispSwap_VertexAttribs3dvNV}, /* [ 333] = 4213 */ {__glXDisp_VertexAttribs4dvNV, __glXDispSwap_VertexAttribs4dvNV}, /* [ 334] = 4214 */ {__glXDisp_VertexAttribs4ubvNV, __glXDispSwap_VertexAttribs4ubvNV}, /* [ 335] = 4215 */ {__glXDisp_ProgramLocalParameter4fvARB, __glXDispSwap_ProgramLocalParameter4fvARB}, /* [ 336] = 4216 */ {__glXDisp_ProgramLocalParameter4dvARB, __glXDispSwap_ProgramLocalParameter4dvARB}, /* [ 337] = 4217 */ {__glXDisp_ProgramStringARB, __glXDispSwap_ProgramStringARB}, /* [ 338] = 4218 */ {NULL, NULL}, /* [ 339] = 4219 */ {NULL, NULL}, /* [ 340] = 4220 */ {__glXDisp_ActiveStencilFaceEXT, __glXDispSwap_ActiveStencilFaceEXT}, /* [ 341] = 4221 */ {__glXDisp_PointParameteri, __glXDispSwap_PointParameteri}, /* [ 342] = 4222 */ {__glXDisp_PointParameteriv, __glXDispSwap_PointParameteriv}, /* [ 343] = 4223 */ {NULL, NULL}, /* [ 344] = 4224 */ {NULL, NULL}, /* [ 345] = 4225 */ {NULL, NULL}, /* [ 346] = 4226 */ {NULL, NULL}, /* [ 347] = 4227 */ {NULL, NULL}, /* [ 348] = 4228 */ {__glXDisp_BlendEquationSeparate, __glXDispSwap_BlendEquationSeparate}, /* [ 349] = 4229 */ {NULL, NULL}, /* [ 350] = 4230 */ {__glXDisp_VertexAttrib4bv, __glXDispSwap_VertexAttrib4bv}, /* [ 351] = 4231 */ {__glXDisp_VertexAttrib4iv, __glXDispSwap_VertexAttrib4iv}, /* [ 352] = 4232 */ {__glXDisp_VertexAttrib4ubv, __glXDispSwap_VertexAttrib4ubv}, /* [ 353] = 4233 */ {__glXDisp_VertexAttrib4usv, __glXDispSwap_VertexAttrib4usv}, /* [ 354] = 4234 */ {__glXDisp_VertexAttrib4uiv, __glXDispSwap_VertexAttrib4uiv}, /* [ 355] = 4235 */ {__glXDisp_VertexAttrib4Nbv, __glXDispSwap_VertexAttrib4Nbv}, /* [ 356] = 4236 */ {__glXDisp_VertexAttrib4Nsv, __glXDispSwap_VertexAttrib4Nsv}, /* [ 357] = 4237 */ {__glXDisp_VertexAttrib4Niv, __glXDispSwap_VertexAttrib4Niv}, /* [ 358] = 4238 */ {__glXDisp_VertexAttrib4Nusv, __glXDispSwap_VertexAttrib4Nusv}, /* [ 359] = 4239 */ {__glXDisp_VertexAttrib4Nuiv, __glXDispSwap_VertexAttrib4Nuiv}, /* [ 360] = 4320 */ {__glXDisp_DeleteFramebuffers, __glXDispSwap_DeleteFramebuffers}, /* [ 361] = 4321 */ {__glXDisp_FramebufferTexture1D, __glXDispSwap_FramebufferTexture1D}, /* [ 362] = 4322 */ {__glXDisp_FramebufferTexture2D, __glXDispSwap_FramebufferTexture2D}, /* [ 363] = 4323 */ {__glXDisp_FramebufferTexture3D, __glXDispSwap_FramebufferTexture3D}, /* [ 364] = 4324 */ {__glXDisp_FramebufferRenderbuffer, __glXDispSwap_FramebufferRenderbuffer}, /* [ 365] = 4325 */ {__glXDisp_GenerateMipmap, __glXDispSwap_GenerateMipmap}, /* [ 366] = 4326 */ {NULL, NULL}, /* [ 367] = 4327 */ {NULL, NULL}, /* [ 368] = 4328 */ {NULL, NULL}, /* [ 369] = 4329 */ {NULL, NULL}, /* [ 370] = 4330 */ {__glXDisp_BlitFramebuffer, __glXDispSwap_BlitFramebuffer}, /* [ 371] = 4331 */ {__glXDisp_RenderbufferStorageMultisample, __glXDispSwap_RenderbufferStorageMultisample}, /* [ 372] = 4332 */ {NULL, NULL}, /* [ 373] = 4333 */ {NULL, NULL}, /* [ 374] = 4334 */ {NULL, NULL}, /* [ 375] = 4335 */ {NULL, NULL}, /* [ 376] = 4128 */ {__glXDisp_SecondaryColor3iv, __glXDispSwap_SecondaryColor3iv}, /* [ 377] = 4129 */ {__glXDisp_SecondaryColor3fvEXT, __glXDispSwap_SecondaryColor3fvEXT}, /* [ 378] = 4130 */ {__glXDisp_SecondaryColor3dv, __glXDispSwap_SecondaryColor3dv}, /* [ 379] = 4131 */ {__glXDisp_SecondaryColor3ubv, __glXDispSwap_SecondaryColor3ubv}, /* [ 380] = 4132 */ {__glXDisp_SecondaryColor3usv, __glXDispSwap_SecondaryColor3usv}, /* [ 381] = 4133 */ {__glXDisp_SecondaryColor3uiv, __glXDispSwap_SecondaryColor3uiv}, /* [ 382] = 4134 */ {__glXDisp_BlendFuncSeparate, __glXDispSwap_BlendFuncSeparate}, /* [ 383] = 4135 */ {NULL, NULL}, /* [ 384] = 4264 */ {NULL, NULL}, /* [ 385] = 4265 */ {__glXDisp_VertexAttrib1svNV, __glXDispSwap_VertexAttrib1svNV}, /* [ 386] = 4266 */ {__glXDisp_VertexAttrib2svNV, __glXDispSwap_VertexAttrib2svNV}, /* [ 387] = 4267 */ {__glXDisp_VertexAttrib3svNV, __glXDispSwap_VertexAttrib3svNV}, /* [ 388] = 4268 */ {__glXDisp_VertexAttrib4svNV, __glXDispSwap_VertexAttrib4svNV}, /* [ 389] = 4269 */ {__glXDisp_VertexAttrib1fvNV, __glXDispSwap_VertexAttrib1fvNV}, /* [ 390] = 4270 */ {__glXDisp_VertexAttrib2fvNV, __glXDispSwap_VertexAttrib2fvNV}, /* [ 391] = 4271 */ {__glXDisp_VertexAttrib3fvNV, __glXDispSwap_VertexAttrib3fvNV}, /* [ 392] = 4272 */ {__glXDisp_VertexAttrib4fvNV, __glXDispSwap_VertexAttrib4fvNV}, /* [ 393] = 4273 */ {__glXDisp_VertexAttrib1dvNV, __glXDispSwap_VertexAttrib1dvNV}, /* [ 394] = 4274 */ {__glXDisp_VertexAttrib2dvNV, __glXDispSwap_VertexAttrib2dvNV}, /* [ 395] = 4275 */ {__glXDisp_VertexAttrib3dvNV, __glXDispSwap_VertexAttrib3dvNV}, /* [ 396] = 4276 */ {__glXDisp_VertexAttrib4dvNV, __glXDispSwap_VertexAttrib4dvNV}, /* [ 397] = 4277 */ {__glXDisp_VertexAttrib4ubvNV, __glXDispSwap_VertexAttrib4ubvNV}, /* [ 398] = 4278 */ {NULL, NULL}, /* [ 399] = 4279 */ {NULL, NULL}, /* [ 400] = 4312 */ {NULL, NULL}, /* [ 401] = 4313 */ {NULL, NULL}, /* [ 402] = 4314 */ {NULL, NULL}, /* [ 403] = 4315 */ {NULL, NULL}, /* [ 404] = 4316 */ {__glXDisp_BindRenderbuffer, __glXDispSwap_BindRenderbuffer}, /* [ 405] = 4317 */ {__glXDisp_DeleteRenderbuffers, __glXDispSwap_DeleteRenderbuffers}, /* [ 406] = 4318 */ {__glXDisp_RenderbufferStorage, __glXDispSwap_RenderbufferStorage}, /* [ 407] = 4319 */ {__glXDisp_BindFramebuffer, __glXDispSwap_BindFramebuffer}, }; static const int_fast16_t Render_size_table[408][2] = { /* [ 0] = 0 */ {0, ~0}, /* [ 1] = 1 */ {8, ~0}, /* [ 2] = 2 */ {12, 0}, /* [ 3] = 3 */ {8, ~0}, /* [ 4] = 4 */ {8, ~0}, /* [ 5] = 5 */ {48, 1}, /* [ 6] = 6 */ {8, ~0}, /* [ 7] = 7 */ {28, ~0}, /* [ 8] = 8 */ {16, ~0}, /* [ 9] = 9 */ {16, ~0}, /* [ 10] = 10 */ {12, ~0}, /* [ 11] = 11 */ {8, ~0}, /* [ 12] = 12 */ {16, ~0}, /* [ 13] = 13 */ {12, ~0}, /* [ 14] = 14 */ {8, ~0}, /* [ 15] = 15 */ {36, ~0}, /* [ 16] = 16 */ {20, ~0}, /* [ 17] = 17 */ {20, ~0}, /* [ 18] = 18 */ {12, ~0}, /* [ 19] = 19 */ {8, ~0}, /* [ 20] = 20 */ {20, ~0}, /* [ 21] = 21 */ {12, ~0}, /* [ 22] = 22 */ {8, ~0}, /* [ 23] = 23 */ {4, ~0}, /* [ 24] = 24 */ {12, ~0}, /* [ 25] = 25 */ {8, ~0}, /* [ 26] = 26 */ {8, ~0}, /* [ 27] = 27 */ {8, ~0}, /* [ 28] = 28 */ {8, ~0}, /* [ 29] = 29 */ {28, ~0}, /* [ 30] = 30 */ {16, ~0}, /* [ 31] = 31 */ {16, ~0}, /* [ 32] = 32 */ {12, ~0}, /* [ 33] = 33 */ {20, ~0}, /* [ 34] = 34 */ {12, ~0}, /* [ 35] = 35 */ {12, ~0}, /* [ 36] = 36 */ {8, ~0}, /* [ 37] = 37 */ {28, ~0}, /* [ 38] = 38 */ {16, ~0}, /* [ 39] = 39 */ {16, ~0}, /* [ 40] = 40 */ {12, ~0}, /* [ 41] = 41 */ {36, ~0}, /* [ 42] = 42 */ {20, ~0}, /* [ 43] = 43 */ {20, ~0}, /* [ 44] = 44 */ {12, ~0}, /* [ 45] = 45 */ {36, ~0}, /* [ 46] = 46 */ {20, ~0}, /* [ 47] = 47 */ {20, ~0}, /* [ 48] = 48 */ {12, ~0}, /* [ 49] = 49 */ {12, ~0}, /* [ 50] = 50 */ {8, ~0}, /* [ 51] = 51 */ {8, ~0}, /* [ 52] = 52 */ {8, ~0}, /* [ 53] = 53 */ {20, ~0}, /* [ 54] = 54 */ {12, ~0}, /* [ 55] = 55 */ {12, ~0}, /* [ 56] = 56 */ {8, ~0}, /* [ 57] = 57 */ {28, ~0}, /* [ 58] = 58 */ {16, ~0}, /* [ 59] = 59 */ {16, ~0}, /* [ 60] = 60 */ {12, ~0}, /* [ 61] = 61 */ {36, ~0}, /* [ 62] = 62 */ {20, ~0}, /* [ 63] = 63 */ {20, ~0}, /* [ 64] = 64 */ {12, ~0}, /* [ 65] = 65 */ {20, ~0}, /* [ 66] = 66 */ {12, ~0}, /* [ 67] = 67 */ {12, ~0}, /* [ 68] = 68 */ {8, ~0}, /* [ 69] = 69 */ {28, ~0}, /* [ 70] = 70 */ {16, ~0}, /* [ 71] = 71 */ {16, ~0}, /* [ 72] = 72 */ {12, ~0}, /* [ 73] = 73 */ {36, ~0}, /* [ 74] = 74 */ {20, ~0}, /* [ 75] = 75 */ {20, ~0}, /* [ 76] = 76 */ {12, ~0}, /* [ 77] = 77 */ {40, ~0}, /* [ 78] = 78 */ {12, ~0}, /* [ 79] = 79 */ {8, ~0}, /* [ 80] = 80 */ {12, ~0}, /* [ 81] = 81 */ {8, 2}, /* [ 82] = 82 */ {12, ~0}, /* [ 83] = 83 */ {8, 3}, /* [ 84] = 84 */ {8, ~0}, /* [ 85] = 85 */ {12, ~0}, /* [ 86] = 86 */ {16, ~0}, /* [ 87] = 87 */ {12, 4}, /* [ 88] = 88 */ {16, ~0}, /* [ 89] = 89 */ {12, 5}, /* [ 90] = 90 */ {12, ~0}, /* [ 91] = 91 */ {8, 6}, /* [ 92] = 92 */ {12, ~0}, /* [ 93] = 93 */ {8, 7}, /* [ 94] = 94 */ {12, ~0}, /* [ 95] = 95 */ {8, ~0}, /* [ 96] = 96 */ {16, ~0}, /* [ 97] = 97 */ {12, 8}, /* [ 98] = 98 */ {16, ~0}, /* [ 99] = 99 */ {12, 9}, /* [100] = 100 */ {8, ~0}, /* [101] = 101 */ {12, ~0}, /* [102] = 102 */ {24, 10}, /* [103] = 103 */ {20, ~0}, /* [104] = 104 */ {8, ~0}, /* [105] = 105 */ {16, ~0}, /* [106] = 106 */ {12, 11}, /* [107] = 107 */ {16, ~0}, /* [108] = 108 */ {12, 12}, /* [109] = 109 */ {56, 13}, /* [110] = 110 */ {56, 14}, /* [111] = 111 */ {16, ~0}, /* [112] = 112 */ {12, 15}, /* [113] = 113 */ {16, ~0}, /* [114] = 114 */ {12, 16}, /* [115] = 115 */ {20, ~0}, /* [116] = 116 */ {12, 17}, /* [117] = 117 */ {16, ~0}, /* [118] = 118 */ {12, 18}, /* [119] = 119 */ {16, ~0}, /* [120] = 120 */ {12, 19}, /* [121] = 121 */ {4, ~0}, /* [122] = 122 */ {8, ~0}, /* [123] = 123 */ {8, ~0}, /* [124] = 124 */ {4, ~0}, /* [125] = 125 */ {8, ~0}, /* [126] = 126 */ {8, ~0}, /* [127] = 127 */ {8, ~0}, /* [128] = 128 */ {20, ~0}, /* [129] = 129 */ {8, ~0}, /* [130] = 130 */ {20, ~0}, /* [131] = 131 */ {8, ~0}, /* [132] = 132 */ {12, ~0}, /* [133] = 133 */ {8, ~0}, /* [134] = 134 */ {8, ~0}, /* [135] = 135 */ {8, ~0}, /* [136] = 136 */ {8, ~0}, /* [137] = 137 */ {12, ~0}, /* [138] = 138 */ {8, ~0}, /* [139] = 139 */ {8, ~0}, /* [140] = 140 */ {0, ~0}, /* [141] = 141 */ {4, ~0}, /* [142] = 142 */ {8, ~0}, /* [143] = 143 */ {28, 20}, /* [144] = 144 */ {20, 21}, /* [145] = 145 */ {48, 22}, /* [146] = 146 */ {32, 23}, /* [147] = 147 */ {24, ~0}, /* [148] = 148 */ {16, ~0}, /* [149] = 149 */ {44, ~0}, /* [150] = 150 */ {28, ~0}, /* [151] = 151 */ {12, ~0}, /* [152] = 152 */ {8, ~0}, /* [153] = 153 */ {20, ~0}, /* [154] = 154 */ {12, ~0}, /* [155] = 155 */ {16, ~0}, /* [156] = 156 */ {8, ~0}, /* [157] = 157 */ {24, ~0}, /* [158] = 158 */ {12, ~0}, /* [159] = 159 */ {12, ~0}, /* [160] = 160 */ {12, ~0}, /* [161] = 161 */ {8, ~0}, /* [162] = 162 */ {16, ~0}, /* [163] = 163 */ {16, ~0}, /* [164] = 164 */ {8, ~0}, /* [165] = 165 */ {12, ~0}, /* [166] = 166 */ {12, ~0}, /* [167] = 167 */ {12, ~0}, /* [168] = 168 */ {12, 24}, /* [169] = 169 */ {12, 25}, /* [170] = 170 */ {12, 26}, /* [171] = 171 */ {8, ~0}, /* [172] = 172 */ {24, ~0}, /* [173] = 173 */ {40, 27}, /* [174] = 174 */ {20, ~0}, /* [175] = 175 */ {52, ~0}, /* [176] = 176 */ {4, ~0}, /* [177] = 177 */ {68, ~0}, /* [178] = 178 */ {132, ~0}, /* [179] = 179 */ {8, ~0}, /* [180] = 180 */ {68, ~0}, /* [181] = 181 */ {132, ~0}, /* [182] = 182 */ {52, ~0}, /* [183] = 183 */ {4, ~0}, /* [184] = 184 */ {4, ~0}, /* [185] = 185 */ {36, ~0}, /* [186] = 186 */ {20, ~0}, /* [187] = 187 */ {28, ~0}, /* [188] = 188 */ {16, ~0}, /* [189] = 189 */ {28, ~0}, /* [190] = 190 */ {16, ~0}, /* [191] = 191 */ {20, ~0}, /* [192] = 192 */ {12, ~0}, /* [193] = 193 */ {16, 28}, /* [194] = 194 */ {8, ~0}, /* [195] = 195 */ {44, 29}, /* [196] = 196 */ {24, ~0}, /* [197] = 197 */ {8, ~0}, /* [198] = 198 */ {16, ~0}, /* [199] = 199 */ {12, ~0}, /* [200] = 200 */ {12, ~0}, /* [201] = 201 */ {12, ~0}, /* [202] = 202 */ {24, ~0}, /* [203] = 203 */ {16, ~0}, /* [204] = 204 */ {16, ~0}, /* [205] = 205 */ {12, ~0}, /* [206] = 206 */ {32, ~0}, /* [207] = 207 */ {20, ~0}, /* [208] = 208 */ {20, ~0}, /* [209] = 209 */ {16, ~0}, /* [210] = 210 */ {40, ~0}, /* [211] = 211 */ {24, ~0}, /* [212] = 212 */ {24, ~0}, /* [213] = 213 */ {16, ~0}, /* [214] = 214 */ {28, 30}, /* [215] = 215 */ {32, 31}, /* [216] = 216 */ {36, 32}, /* [217] = 217 */ {28, 33}, /* [218] = 218 */ {36, 34}, /* [219] = 219 */ {44, 35}, /* [220] = 220 */ {0, ~0}, /* [221] = 221 */ {0, ~0}, /* [222] = 222 */ {0, ~0}, /* [223] = 223 */ {0, ~0}, /* [224] = 224 */ {0, ~0}, /* [225] = 225 */ {0, ~0}, /* [226] = 226 */ {0, ~0}, /* [227] = 227 */ {0, ~0}, /* [228] = 228 */ {0, ~0}, /* [229] = 229 */ {12, ~0}, /* [230] = 230 */ {16, ~0}, /* [231] = 231 */ {12, ~0}, /* [232] = 232 */ {8, ~0}, /* [233] = 233 */ {8, 36}, /* [234] = 234 */ {12, ~0}, /* [235] = 235 */ {0, ~0}, /* [236] = 236 */ {0, ~0}, /* [237] = 237 */ {24, ~0}, /* [238] = 238 */ {0, ~0}, /* [239] = 239 */ {0, ~0}, /* [240] = 2048 */ {0, ~0}, /* [241] = 2049 */ {0, ~0}, /* [242] = 2050 */ {0, ~0}, /* [243] = 2051 */ {0, ~0}, /* [244] = 2052 */ {0, ~0}, /* [245] = 2053 */ {44, 37}, /* [246] = 2054 */ {12, 38}, /* [247] = 2055 */ {12, 39}, /* [248] = 2056 */ {24, ~0}, /* [249] = 2057 */ {0, ~0}, /* [250] = 2058 */ {0, ~0}, /* [251] = 2059 */ {0, ~0}, /* [252] = 2060 */ {0, ~0}, /* [253] = 2061 */ {0, ~0}, /* [254] = 2062 */ {0, ~0}, /* [255] = 2063 */ {0, ~0}, /* [256] = 2064 */ {0, ~0}, /* [257] = 2065 */ {12, ~0}, /* [258] = 2066 */ {8, 40}, /* [259] = 2067 */ {0, ~0}, /* [260] = 2068 */ {0, ~0}, /* [261] = 2069 */ {0, ~0}, /* [262] = 2070 */ {0, ~0}, /* [263] = 2071 */ {0, ~0}, /* [264] = 4096 */ {20, ~0}, /* [265] = 4097 */ {8, ~0}, /* [266] = 4098 */ {0, ~0}, /* [267] = 4099 */ {60, 41}, /* [268] = 4100 */ {60, 42}, /* [269] = 4101 */ {48, 43}, /* [270] = 4102 */ {48, 44}, /* [271] = 4103 */ {16, ~0}, /* [272] = 4104 */ {12, 45}, /* [273] = 4105 */ {16, ~0}, /* [274] = 4106 */ {12, 46}, /* [275] = 4107 */ {24, ~0}, /* [276] = 4108 */ {28, ~0}, /* [277] = 4109 */ {32, 47}, /* [278] = 4110 */ {20, ~0}, /* [279] = 4111 */ {16, ~0}, /* [280] = 4112 */ {8, ~0}, /* [281] = 4113 */ {8, ~0}, /* [282] = 4114 */ {84, 48}, /* [283] = 4115 */ {92, 49}, /* [284] = 4116 */ {0, ~0}, /* [285] = 4117 */ {12, ~0}, /* [286] = 4118 */ {8, 50}, /* [287] = 4119 */ {32, ~0}, /* [288] = 4120 */ {36, ~0}, /* [289] = 4121 */ {28, ~0}, /* [290] = 4122 */ {36, ~0}, /* [291] = 4123 */ {40, ~0}, /* [292] = 4124 */ {8, ~0}, /* [293] = 4125 */ {12, ~0}, /* [294] = 4126 */ {8, ~0}, /* [295] = 4127 */ {12, ~0}, /* [296] = 4176 */ {0, ~0}, /* [297] = 4177 */ {0, ~0}, /* [298] = 4178 */ {0, ~0}, /* [299] = 4179 */ {0, ~0}, /* [300] = 4180 */ {12, ~0}, /* [301] = 4181 */ {0, ~0}, /* [302] = 4182 */ {0, ~0}, /* [303] = 4183 */ {0, ~0}, /* [304] = 4184 */ {28, ~0}, /* [305] = 4185 */ {44, ~0}, /* [306] = 4186 */ {0, ~0}, /* [307] = 4187 */ {0, ~0}, /* [308] = 4188 */ {0, ~0}, /* [309] = 4189 */ {12, ~0}, /* [310] = 4190 */ {12, ~0}, /* [311] = 4191 */ {16, ~0}, /* [312] = 4192 */ {16, ~0}, /* [313] = 4193 */ {12, ~0}, /* [314] = 4194 */ {16, ~0}, /* [315] = 4195 */ {20, ~0}, /* [316] = 4196 */ {24, ~0}, /* [317] = 4197 */ {16, ~0}, /* [318] = 4198 */ {24, ~0}, /* [319] = 4199 */ {32, ~0}, /* [320] = 4200 */ {40, ~0}, /* [321] = 4201 */ {12, ~0}, /* [322] = 4202 */ {12, 51}, /* [323] = 4203 */ {12, 52}, /* [324] = 4204 */ {12, 53}, /* [325] = 4205 */ {12, 54}, /* [326] = 4206 */ {12, 55}, /* [327] = 4207 */ {12, 56}, /* [328] = 4208 */ {12, 57}, /* [329] = 4209 */ {12, 58}, /* [330] = 4210 */ {12, 59}, /* [331] = 4211 */ {12, 60}, /* [332] = 4212 */ {12, 61}, /* [333] = 4213 */ {12, 62}, /* [334] = 4214 */ {12, 63}, /* [335] = 4215 */ {28, ~0}, /* [336] = 4216 */ {44, ~0}, /* [337] = 4217 */ {16, 64}, /* [338] = 4218 */ {0, ~0}, /* [339] = 4219 */ {0, ~0}, /* [340] = 4220 */ {8, ~0}, /* [341] = 4221 */ {12, ~0}, /* [342] = 4222 */ {8, 65}, /* [343] = 4223 */ {0, ~0}, /* [344] = 4224 */ {0, ~0}, /* [345] = 4225 */ {0, ~0}, /* [346] = 4226 */ {0, ~0}, /* [347] = 4227 */ {0, ~0}, /* [348] = 4228 */ {12, ~0}, /* [349] = 4229 */ {0, ~0}, /* [350] = 4230 */ {12, ~0}, /* [351] = 4231 */ {24, ~0}, /* [352] = 4232 */ {12, ~0}, /* [353] = 4233 */ {16, ~0}, /* [354] = 4234 */ {24, ~0}, /* [355] = 4235 */ {12, ~0}, /* [356] = 4236 */ {16, ~0}, /* [357] = 4237 */ {24, ~0}, /* [358] = 4238 */ {16, ~0}, /* [359] = 4239 */ {24, ~0}, /* [360] = 4320 */ {8, 66}, /* [361] = 4321 */ {24, ~0}, /* [362] = 4322 */ {24, ~0}, /* [363] = 4323 */ {28, ~0}, /* [364] = 4324 */ {20, ~0}, /* [365] = 4325 */ {8, ~0}, /* [366] = 4326 */ {0, ~0}, /* [367] = 4327 */ {0, ~0}, /* [368] = 4328 */ {0, ~0}, /* [369] = 4329 */ {0, ~0}, /* [370] = 4330 */ {44, ~0}, /* [371] = 4331 */ {24, ~0}, /* [372] = 4332 */ {0, ~0}, /* [373] = 4333 */ {0, ~0}, /* [374] = 4334 */ {0, ~0}, /* [375] = 4335 */ {0, ~0}, /* [376] = 4128 */ {16, ~0}, /* [377] = 4129 */ {16, ~0}, /* [378] = 4130 */ {28, ~0}, /* [379] = 4131 */ {8, ~0}, /* [380] = 4132 */ {12, ~0}, /* [381] = 4133 */ {16, ~0}, /* [382] = 4134 */ {20, ~0}, /* [383] = 4135 */ {0, ~0}, /* [384] = 4264 */ {0, ~0}, /* [385] = 4265 */ {12, ~0}, /* [386] = 4266 */ {12, ~0}, /* [387] = 4267 */ {16, ~0}, /* [388] = 4268 */ {16, ~0}, /* [389] = 4269 */ {12, ~0}, /* [390] = 4270 */ {16, ~0}, /* [391] = 4271 */ {20, ~0}, /* [392] = 4272 */ {24, ~0}, /* [393] = 4273 */ {16, ~0}, /* [394] = 4274 */ {24, ~0}, /* [395] = 4275 */ {32, ~0}, /* [396] = 4276 */ {40, ~0}, /* [397] = 4277 */ {12, ~0}, /* [398] = 4278 */ {0, ~0}, /* [399] = 4279 */ {0, ~0}, /* [400] = 4312 */ {0, ~0}, /* [401] = 4313 */ {0, ~0}, /* [402] = 4314 */ {0, ~0}, /* [403] = 4315 */ {0, ~0}, /* [404] = 4316 */ {12, ~0}, /* [405] = 4317 */ {8, 67}, /* [406] = 4318 */ {20, ~0}, /* [407] = 4319 */ {12, ~0}, }; static const gl_proto_size_func Render_size_func_table[68] = { __glXCallListsReqSize, __glXBitmapReqSize, __glXFogfvReqSize, __glXFogivReqSize, __glXLightfvReqSize, __glXLightivReqSize, __glXLightModelfvReqSize, __glXLightModelivReqSize, __glXMaterialfvReqSize, __glXMaterialivReqSize, __glXPolygonStippleReqSize, __glXTexParameterfvReqSize, __glXTexParameterivReqSize, __glXTexImage1DReqSize, __glXTexImage2DReqSize, __glXTexEnvfvReqSize, __glXTexEnvivReqSize, __glXTexGendvReqSize, __glXTexGenfvReqSize, __glXTexGenivReqSize, __glXMap1dReqSize, __glXMap1fReqSize, __glXMap2dReqSize, __glXMap2fReqSize, __glXPixelMapfvReqSize, __glXPixelMapuivReqSize, __glXPixelMapusvReqSize, __glXDrawPixelsReqSize, __glXDrawArraysReqSize, __glXColorSubTableReqSize, __glXCompressedTexImage1DReqSize, __glXCompressedTexImage2DReqSize, __glXCompressedTexImage3DReqSize, __glXCompressedTexSubImage1DReqSize, __glXCompressedTexSubImage2DReqSize, __glXCompressedTexSubImage3DReqSize, __glXDrawBuffersReqSize, __glXColorTableReqSize, __glXColorTableParameterfvReqSize, __glXColorTableParameterivReqSize, __glXPointParameterfvReqSize, __glXTexSubImage1DReqSize, __glXTexSubImage2DReqSize, __glXConvolutionFilter1DReqSize, __glXConvolutionFilter2DReqSize, __glXConvolutionParameterfvReqSize, __glXConvolutionParameterivReqSize, __glXSeparableFilter2DReqSize, __glXTexImage3DReqSize, __glXTexSubImage3DReqSize, __glXPrioritizeTexturesReqSize, __glXVertexAttribs1svNVReqSize, __glXVertexAttribs2svNVReqSize, __glXVertexAttribs3svNVReqSize, __glXVertexAttribs4svNVReqSize, __glXVertexAttribs1fvNVReqSize, __glXVertexAttribs2fvNVReqSize, __glXVertexAttribs3fvNVReqSize, __glXVertexAttribs4fvNVReqSize, __glXVertexAttribs1dvNVReqSize, __glXVertexAttribs2dvNVReqSize, __glXVertexAttribs3dvNVReqSize, __glXVertexAttribs4dvNVReqSize, __glXVertexAttribs4ubvNVReqSize, __glXProgramStringARBReqSize, __glXPointParameterivReqSize, __glXDeleteFramebuffersReqSize, __glXDeleteRenderbuffersReqSize, }; const struct __glXDispatchInfo Render_dispatch_info = { 13, Render_dispatch_tree, Render_function_table, Render_size_table, Render_size_func_table }; /*****************************************************************/ /* tree depth = 12 */ static const int_fast16_t VendorPriv_dispatch_tree[152] = { /* [0] -> opcode range [0, 131072], node depth 1 */ 2, 5, EMPTY_LEAF, 119, EMPTY_LEAF, /* [5] -> opcode range [0, 32768], node depth 2 */ 1, 8, EMPTY_LEAF, /* [8] -> opcode range [0, 16384], node depth 3 */ 1, 11, EMPTY_LEAF, /* [11] -> opcode range [0, 8192], node depth 4 */ 2, 16, EMPTY_LEAF, 78, EMPTY_LEAF, /* [16] -> opcode range [0, 2048], node depth 5 */ 2, 21, EMPTY_LEAF, 36, EMPTY_LEAF, /* [21] -> opcode range [0, 512], node depth 6 */ 1, 24, EMPTY_LEAF, /* [24] -> opcode range [0, 256], node depth 7 */ 1, 27, EMPTY_LEAF, /* [27] -> opcode range [0, 128], node depth 8 */ 1, 30, EMPTY_LEAF, /* [30] -> opcode range [0, 64], node depth 9 */ 1, 33, EMPTY_LEAF, /* [33] -> opcode range [0, 32], node depth 10 */ 1, LEAF(0), EMPTY_LEAF, /* [36] -> opcode range [1024, 1536], node depth 6 */ 2, 41, EMPTY_LEAF, 53, 67, /* [41] -> opcode range [1024, 1152], node depth 7 */ 1, 44, EMPTY_LEAF, /* [44] -> opcode range [1024, 1088], node depth 8 */ 1, 47, EMPTY_LEAF, /* [47] -> opcode range [1024, 1056], node depth 9 */ 1, 50, EMPTY_LEAF, /* [50] -> opcode range [1024, 1040], node depth 10 */ 1, LEAF(16), EMPTY_LEAF, /* [53] -> opcode range [1280, 1408], node depth 7 */ 1, 56, EMPTY_LEAF, /* [56] -> opcode range [1280, 1344], node depth 8 */ 2, 61, LEAF(24), EMPTY_LEAF, 64, /* [61] -> opcode range [1280, 1296], node depth 9 */ 1, EMPTY_LEAF, LEAF(40), /* [64] -> opcode range [1328, 1344], node depth 9 */ 1, LEAF(48), EMPTY_LEAF, /* [67] -> opcode range [1408, 1536], node depth 7 */ 1, 70, EMPTY_LEAF, /* [70] -> opcode range [1408, 1472], node depth 8 */ 1, 73, EMPTY_LEAF, /* [73] -> opcode range [1408, 1440], node depth 9 */ 2, EMPTY_LEAF, LEAF(56), LEAF(64), EMPTY_LEAF, /* [78] -> opcode range [4096, 6144], node depth 5 */ 2, 83, EMPTY_LEAF, 101, EMPTY_LEAF, /* [83] -> opcode range [4096, 4608], node depth 6 */ 1, 86, EMPTY_LEAF, /* [86] -> opcode range [4096, 4352], node depth 7 */ 1, 89, EMPTY_LEAF, /* [89] -> opcode range [4096, 4224], node depth 8 */ 1, 92, EMPTY_LEAF, /* [92] -> opcode range [4096, 4160], node depth 9 */ 1, 95, EMPTY_LEAF, /* [95] -> opcode range [4096, 4128], node depth 10 */ 1, 98, EMPTY_LEAF, /* [98] -> opcode range [4096, 4112], node depth 11 */ 1, LEAF(72), EMPTY_LEAF, /* [101] -> opcode range [5120, 5632], node depth 6 */ 1, 104, EMPTY_LEAF, /* [104] -> opcode range [5120, 5376], node depth 7 */ 1, 107, EMPTY_LEAF, /* [107] -> opcode range [5120, 5248], node depth 8 */ 1, 110, EMPTY_LEAF, /* [110] -> opcode range [5120, 5184], node depth 9 */ 1, EMPTY_LEAF, 113, /* [113] -> opcode range [5152, 5184], node depth 10 */ 1, 116, EMPTY_LEAF, /* [116] -> opcode range [5152, 5168], node depth 11 */ 1, LEAF(80), EMPTY_LEAF, /* [119] -> opcode range [65536, 98304], node depth 2 */ 1, 122, EMPTY_LEAF, /* [122] -> opcode range [65536, 81920], node depth 3 */ 1, 125, EMPTY_LEAF, /* [125] -> opcode range [65536, 73728], node depth 4 */ 1, 128, EMPTY_LEAF, /* [128] -> opcode range [65536, 69632], node depth 5 */ 1, 131, EMPTY_LEAF, /* [131] -> opcode range [65536, 67584], node depth 6 */ 1, 134, EMPTY_LEAF, /* [134] -> opcode range [65536, 66560], node depth 7 */ 1, 137, EMPTY_LEAF, /* [137] -> opcode range [65536, 66048], node depth 8 */ 1, 140, EMPTY_LEAF, /* [140] -> opcode range [65536, 65792], node depth 9 */ 1, 143, EMPTY_LEAF, /* [143] -> opcode range [65536, 65664], node depth 10 */ 1, 146, EMPTY_LEAF, /* [146] -> opcode range [65536, 65600], node depth 11 */ 1, 149, EMPTY_LEAF, /* [149] -> opcode range [65536, 65568], node depth 12 */ 1, LEAF(88), EMPTY_LEAF, }; static const void *VendorPriv_function_table[104][2] = { /* [ 0] = 0 */ {NULL, NULL}, /* [ 1] = 1 */ {__glXDisp_GetConvolutionFilterEXT, __glXDispSwap_GetConvolutionFilterEXT}, /* [ 2] = 2 */ {__glXDisp_GetConvolutionParameterfvEXT, __glXDispSwap_GetConvolutionParameterfvEXT}, /* [ 3] = 3 */ {__glXDisp_GetConvolutionParameterivEXT, __glXDispSwap_GetConvolutionParameterivEXT}, /* [ 4] = 4 */ {__glXDisp_GetSeparableFilterEXT, __glXDispSwap_GetSeparableFilterEXT}, /* [ 5] = 5 */ {__glXDisp_GetHistogramEXT, __glXDispSwap_GetHistogramEXT}, /* [ 6] = 6 */ {__glXDisp_GetHistogramParameterfvEXT, __glXDispSwap_GetHistogramParameterfvEXT}, /* [ 7] = 7 */ {__glXDisp_GetHistogramParameterivEXT, __glXDispSwap_GetHistogramParameterivEXT}, /* [ 8] = 8 */ {__glXDisp_GetMinmaxEXT, __glXDispSwap_GetMinmaxEXT}, /* [ 9] = 9 */ {__glXDisp_GetMinmaxParameterfvEXT, __glXDispSwap_GetMinmaxParameterfvEXT}, /* [ 10] = 10 */ {__glXDisp_GetMinmaxParameterivEXT, __glXDispSwap_GetMinmaxParameterivEXT}, /* [ 11] = 11 */ {__glXDisp_AreTexturesResidentEXT, __glXDispSwap_AreTexturesResidentEXT}, /* [ 12] = 12 */ {__glXDisp_DeleteTexturesEXT, __glXDispSwap_DeleteTexturesEXT}, /* [ 13] = 13 */ {__glXDisp_GenTexturesEXT, __glXDispSwap_GenTexturesEXT}, /* [ 14] = 14 */ {__glXDisp_IsTextureEXT, __glXDispSwap_IsTextureEXT}, /* [ 15] = 15 */ {NULL, NULL}, /* [ 16] = 1024 */ {__glXDisp_QueryContextInfoEXT, __glXDispSwap_QueryContextInfoEXT}, /* [ 17] = 1025 */ {NULL, NULL}, /* [ 18] = 1026 */ {NULL, NULL}, /* [ 19] = 1027 */ {NULL, NULL}, /* [ 20] = 1028 */ {NULL, NULL}, /* [ 21] = 1029 */ {NULL, NULL}, /* [ 22] = 1030 */ {NULL, NULL}, /* [ 23] = 1031 */ {NULL, NULL}, /* [ 24] = 1296 */ {__glXDisp_GetProgramEnvParameterfvARB, __glXDispSwap_GetProgramEnvParameterfvARB}, /* [ 25] = 1297 */ {__glXDisp_GetProgramEnvParameterdvARB, __glXDispSwap_GetProgramEnvParameterdvARB}, /* [ 26] = 1298 */ {NULL, NULL}, /* [ 27] = 1299 */ {NULL, NULL}, /* [ 28] = 1300 */ {NULL, NULL}, /* [ 29] = 1301 */ {NULL, NULL}, /* [ 30] = 1302 */ {NULL, NULL}, /* [ 31] = 1303 */ {NULL, NULL}, /* [ 32] = 1304 */ {__glXDisp_IsProgramARB, __glXDispSwap_IsProgramARB}, /* [ 33] = 1305 */ {__glXDisp_GetProgramLocalParameterfvARB, __glXDispSwap_GetProgramLocalParameterfvARB}, /* [ 34] = 1306 */ {__glXDisp_GetProgramLocalParameterdvARB, __glXDispSwap_GetProgramLocalParameterdvARB}, /* [ 35] = 1307 */ {__glXDisp_GetProgramivARB, __glXDispSwap_GetProgramivARB}, /* [ 36] = 1308 */ {__glXDisp_GetProgramStringARB, __glXDispSwap_GetProgramStringARB}, /* [ 37] = 1309 */ {NULL, NULL}, /* [ 38] = 1310 */ {NULL, NULL}, /* [ 39] = 1311 */ {NULL, NULL}, /* [ 40] = 1288 */ {NULL, NULL}, /* [ 41] = 1289 */ {NULL, NULL}, /* [ 42] = 1290 */ {NULL, NULL}, /* [ 43] = 1291 */ {NULL, NULL}, /* [ 44] = 1292 */ {NULL, NULL}, /* [ 45] = 1293 */ {NULL, NULL}, /* [ 46] = 1294 */ {__glXDisp_DeleteProgramsARB, __glXDispSwap_DeleteProgramsARB}, /* [ 47] = 1295 */ {__glXDisp_GenProgramsARB, __glXDispSwap_GenProgramsARB}, /* [ 48] = 1328 */ {NULL, NULL}, /* [ 49] = 1329 */ {NULL, NULL}, /* [ 50] = 1330 */ {__glXDisp_BindTexImageEXT, __glXDispSwap_BindTexImageEXT}, /* [ 51] = 1331 */ {__glXDisp_ReleaseTexImageEXT, __glXDispSwap_ReleaseTexImageEXT}, /* [ 52] = 1332 */ {NULL, NULL}, /* [ 53] = 1333 */ {NULL, NULL}, /* [ 54] = 1334 */ {NULL, NULL}, /* [ 55] = 1335 */ {NULL, NULL}, /* [ 56] = 1416 */ {NULL, NULL}, /* [ 57] = 1417 */ {NULL, NULL}, /* [ 58] = 1418 */ {NULL, NULL}, /* [ 59] = 1419 */ {NULL, NULL}, /* [ 60] = 1420 */ {NULL, NULL}, /* [ 61] = 1421 */ {NULL, NULL}, /* [ 62] = 1422 */ {__glXDisp_IsRenderbuffer, __glXDispSwap_IsRenderbuffer}, /* [ 63] = 1423 */ {__glXDisp_GenRenderbuffers, __glXDispSwap_GenRenderbuffers}, /* [ 64] = 1424 */ {__glXDisp_GetRenderbufferParameteriv, __glXDispSwap_GetRenderbufferParameteriv}, /* [ 65] = 1425 */ {__glXDisp_IsFramebuffer, __glXDispSwap_IsFramebuffer}, /* [ 66] = 1426 */ {__glXDisp_GenFramebuffers, __glXDispSwap_GenFramebuffers}, /* [ 67] = 1427 */ {__glXDisp_CheckFramebufferStatus, __glXDispSwap_CheckFramebufferStatus}, /* [ 68] = 1428 */ {__glXDisp_GetFramebufferAttachmentParameteriv, __glXDispSwap_GetFramebufferAttachmentParameteriv}, /* [ 69] = 1429 */ {NULL, NULL}, /* [ 70] = 1430 */ {NULL, NULL}, /* [ 71] = 1431 */ {NULL, NULL}, /* [ 72] = 4096 */ {NULL, NULL}, /* [ 73] = 4097 */ {NULL, NULL}, /* [ 74] = 4098 */ {__glXDisp_GetColorTableSGI, __glXDispSwap_GetColorTableSGI}, /* [ 75] = 4099 */ {__glXDisp_GetColorTableParameterfvSGI, __glXDispSwap_GetColorTableParameterfvSGI}, /* [ 76] = 4100 */ {__glXDisp_GetColorTableParameterivSGI, __glXDispSwap_GetColorTableParameterivSGI}, /* [ 77] = 4101 */ {NULL, NULL}, /* [ 78] = 4102 */ {NULL, NULL}, /* [ 79] = 4103 */ {NULL, NULL}, /* [ 80] = 5152 */ {NULL, NULL}, /* [ 81] = 5153 */ {NULL, NULL}, /* [ 82] = 5154 */ {__glXDisp_CopySubBufferMESA, __glXDispSwap_CopySubBufferMESA}, /* [ 83] = 5155 */ {NULL, NULL}, /* [ 84] = 5156 */ {NULL, NULL}, /* [ 85] = 5157 */ {NULL, NULL}, /* [ 86] = 5158 */ {NULL, NULL}, /* [ 87] = 5159 */ {NULL, NULL}, /* [ 88] = 65536 */ {__glXDisp_SwapIntervalSGI, __glXDispSwap_SwapIntervalSGI}, /* [ 89] = 65537 */ {__glXDisp_MakeCurrentReadSGI, __glXDispSwap_MakeCurrentReadSGI}, /* [ 90] = 65538 */ {NULL, NULL}, /* [ 91] = 65539 */ {NULL, NULL}, /* [ 92] = 65540 */ {__glXDisp_GetFBConfigsSGIX, __glXDispSwap_GetFBConfigsSGIX}, /* [ 93] = 65541 */ {__glXDisp_CreateContextWithConfigSGIX, __glXDispSwap_CreateContextWithConfigSGIX}, /* [ 94] = 65542 */ {__glXDisp_CreateGLXPixmapWithConfigSGIX, __glXDispSwap_CreateGLXPixmapWithConfigSGIX}, /* [ 95] = 65543 */ {__glXDisp_CreateGLXPbufferSGIX, __glXDispSwap_CreateGLXPbufferSGIX}, /* [ 96] = 65544 */ {__glXDisp_DestroyGLXPbufferSGIX, __glXDispSwap_DestroyGLXPbufferSGIX}, /* [ 97] = 65545 */ {__glXDisp_ChangeDrawableAttributesSGIX, __glXDispSwap_ChangeDrawableAttributesSGIX}, /* [ 98] = 65546 */ {__glXDisp_GetDrawableAttributesSGIX, __glXDispSwap_GetDrawableAttributesSGIX}, /* [ 99] = 65547 */ {NULL, NULL}, /* [ 100] = 65548 */ {NULL, NULL}, /* [ 101] = 65549 */ {NULL, NULL}, /* [ 102] = 65550 */ {NULL, NULL}, /* [ 103] = 65551 */ {NULL, NULL}, }; const struct __glXDispatchInfo VendorPriv_dispatch_info = { 17, VendorPriv_dispatch_tree, VendorPriv_function_table, NULL, NULL }; xorg-server-1.17.1/glx/glxdricommon.h0000664000175100017510000000350012274325511014456 00000000000000/* * Copyright © 2008 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. */ #ifndef _GLX_dri_common_h #define _GLX_dri_common_h typedef struct __GLXDRIconfig __GLXDRIconfig; struct __GLXDRIconfig { __GLXconfig config; const __DRIconfig *driConfig; }; __GLXconfig *glxConvertConfigs(const __DRIcoreExtension * core, const __DRIconfig ** configs, unsigned int drawableType); extern const __DRIsystemTimeExtension systemTimeExtension; void *glxProbeDriver(const char *name, void **coreExt, const char *coreName, int coreVersion, void **renderExt, const char *renderName, int renderVersion); #endif xorg-server-1.17.1/glx/indirect_size.h0000664000175100017510000000716612456571574014641 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2004 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if !defined( _INDIRECT_SIZE_H_ ) #define _INDIRECT_SIZE_H_ /** * \file * Prototypes for functions used to determine the number of data elements in * various GLX protocol messages. * * \author Ian Romanick */ #include #if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) #define PURE __attribute__((pure)) #else #define PURE #endif #if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) #define FASTCALL __attribute__((fastcall)) #else #define FASTCALL #endif extern _X_INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glLightiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glLightModeliv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glMaterialiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glTexParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glTexEnviv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glTexGenfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glTexGeniv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glMap1f_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glMap2f_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glColorTableParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glConvolutionParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glPointParameterfv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glPointParameteriv_size(GLenum); #undef PURE #undef FASTCALL #endif /* !defined( _INDIRECT_SIZE_H_ ) */ xorg-server-1.17.1/glx/indirect_util.c0000664000175100017510000002165212456571574014633 00000000000000/* * (C) Copyright IBM Corporation 2005 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include #include #include "indirect_size.h" #include "indirect_size_get.h" #include "indirect_dispatch.h" #include "glxserver.h" #include "glxbyteorder.h" #include "singlesize.h" #include "glxext.h" #include "indirect_table.h" #include "indirect_util.h" #define __GLX_PAD(a) (((a)+3)&~3) extern xGLXSingleReply __glXReply; GLint __glGetBooleanv_variable_size(GLenum e) { if (e == GL_COMPRESSED_TEXTURE_FORMATS) { GLint temp; glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &temp); return temp; } else { return 0; } } /** * Get a properly aligned buffer to hold reply data. * * \warning * This function assumes that \c local_buffer is already properly aligned. * It also assumes that \c alignment is a power of two. */ void * __glXGetAnswerBuffer(__GLXclientState * cl, size_t required_size, void *local_buffer, size_t local_size, unsigned alignment) { void *buffer = local_buffer; const intptr_t mask = alignment - 1; if (local_size < required_size) { size_t worst_case_size; intptr_t temp_buf; if (required_size < SIZE_MAX - alignment) worst_case_size = required_size + alignment; else return NULL; if (cl->returnBufSize < worst_case_size) { void *temp = realloc(cl->returnBuf, worst_case_size); if (temp == NULL) { return NULL; } cl->returnBuf = temp; cl->returnBufSize = worst_case_size; } temp_buf = (intptr_t) cl->returnBuf; temp_buf = (temp_buf + mask) & ~mask; buffer = (void *) temp_buf; } return buffer; } /** * Send a GLX reply to the client. * * Technically speaking, there are several different ways to encode a GLX * reply. The primary difference is whether or not certain fields (e.g., * retval, size, and "pad3") are set. This function gets around that by * always setting all of the fields to "reasonable" values. This does no * harm to clients, but it does make the server-side code much more compact. */ void __glXSendReply(ClientPtr client, const void *data, size_t elements, size_t element_size, GLboolean always_array, CARD32 retval) { size_t reply_ints = 0; if (__glXErrorOccured()) { elements = 0; } else if ((elements > 1) || always_array) { reply_ints = bytes_to_int32(elements * element_size); } __glXReply.length = reply_ints; __glXReply.type = X_Reply; __glXReply.sequenceNumber = client->sequence; __glXReply.size = elements; __glXReply.retval = retval; /* It is faster on almost always every architecture to just copy the 8 * bytes, even when not necessary, than check to see of the value of * elements requires it. Copying the data when not needed will do no * harm. */ (void) memcpy(&__glXReply.pad3, data, 8); WriteToClient(client, sz_xGLXSingleReply, &__glXReply); if (reply_ints != 0) { WriteToClient(client, reply_ints * 4, data); } } /** * Send a GLX reply to the client. * * Technically speaking, there are several different ways to encode a GLX * reply. The primary difference is whether or not certain fields (e.g., * retval, size, and "pad3") are set. This function gets around that by * always setting all of the fields to "reasonable" values. This does no * harm to clients, but it does make the server-side code much more compact. * * \warning * This function assumes that values stored in \c data will be byte-swapped * by the caller if necessary. */ void __glXSendReplySwap(ClientPtr client, const void *data, size_t elements, size_t element_size, GLboolean always_array, CARD32 retval) { size_t reply_ints = 0; if (__glXErrorOccured()) { elements = 0; } else if ((elements > 1) || always_array) { reply_ints = bytes_to_int32(elements * element_size); } __glXReply.length = bswap_32(reply_ints); __glXReply.type = X_Reply; __glXReply.sequenceNumber = bswap_16(client->sequence); __glXReply.size = bswap_32(elements); __glXReply.retval = bswap_32(retval); /* It is faster on almost always every architecture to just copy the 8 * bytes, even when not necessary, than check to see of the value of * elements requires it. Copying the data when not needed will do no * harm. */ (void) memcpy(&__glXReply.pad3, data, 8); WriteToClient(client, sz_xGLXSingleReply, &__glXReply); if (reply_ints != 0) { WriteToClient(client, reply_ints * 4, data); } } static int get_decode_index(const struct __glXDispatchInfo *dispatch_info, unsigned opcode) { int remaining_bits; int next_remain; const int_fast16_t *const tree = dispatch_info->dispatch_tree; int_fast16_t index; remaining_bits = dispatch_info->bits; if (opcode >= (1U << remaining_bits)) { return -1; } index = 0; for ( /* empty */ ; remaining_bits > 0; remaining_bits = next_remain) { unsigned mask; unsigned child_index; /* Calculate the slice of bits used by this node. * * If remaining_bits = 8 and tree[index] = 3, the mask of just the * remaining bits is 0x00ff and the mask for the remaining bits after * this node is 0x001f. By taking 0x00ff & ~0x001f, we get 0x00e0. * This masks the 3 bits that we would want for this node. */ next_remain = remaining_bits - tree[index]; mask = ((1 << remaining_bits) - 1) & ~((1 << next_remain) - 1); /* Using the mask, calculate the index of the opcode in the node. * With that index, fetch the index of the next node. */ child_index = (opcode & mask) >> next_remain; index = tree[index + 1 + child_index]; /* If the next node is an empty leaf, the opcode is for a non-existant * function. We're done. * * If the next node is a non-empty leaf, look up the function pointer * and return it. */ if (index == EMPTY_LEAF) { return -1; } else if (IS_LEAF_INDEX(index)) { unsigned func_index; /* The value stored in the tree for a leaf node is the base of * the function pointers for that leaf node. The offset for the * function for a particular opcode is the remaining bits in the * opcode. */ func_index = -index; func_index += opcode & ((1 << next_remain) - 1); return func_index; } } /* We should *never* get here!!! */ return -1; } void * __glXGetProtocolDecodeFunction(const struct __glXDispatchInfo *dispatch_info, int opcode, int swapped_version) { const int func_index = get_decode_index(dispatch_info, opcode); return (func_index < 0) ? NULL : (void *) dispatch_info-> dispatch_functions[func_index][swapped_version]; } int __glXGetProtocolSizeData(const struct __glXDispatchInfo *dispatch_info, int opcode, __GLXrenderSizeData * data) { if (dispatch_info->size_table != NULL) { const int func_index = get_decode_index(dispatch_info, opcode); if ((func_index >= 0) && (dispatch_info->size_table[func_index][0] != 0)) { const int var_offset = dispatch_info->size_table[func_index][1]; data->bytes = dispatch_info->size_table[func_index][0]; data->varsize = (var_offset != ~0) ? dispatch_info->size_func_table[var_offset] : NULL; return 0; } } return -1; } xorg-server-1.17.1/glx/glxdriswrast.c0000664000175100017510000003402712404747323014520 00000000000000/* * Copyright © 2008 George Sapountzis * Copyright © 2008 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. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "scrnintstr.h" #include "pixmapstr.h" #include "gcstruct.h" #include "os.h" #include "glxserver.h" #include "glxutil.h" #include "glxdricommon.h" #include "extension_string.h" /* RTLD_LOCAL is not defined on Cygwin */ #ifdef __CYGWIN__ #ifndef RTLD_LOCAL #define RTLD_LOCAL 0 #endif #endif typedef struct __GLXDRIscreen __GLXDRIscreen; typedef struct __GLXDRIcontext __GLXDRIcontext; typedef struct __GLXDRIdrawable __GLXDRIdrawable; struct __GLXDRIscreen { __GLXscreen base; __DRIscreen *driScreen; void *driver; const __DRIcoreExtension *core; const __DRIswrastExtension *swrast; const __DRIcopySubBufferExtension *copySubBuffer; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; }; struct __GLXDRIcontext { __GLXcontext base; __DRIcontext *driContext; }; struct __GLXDRIdrawable { __GLXdrawable base; __DRIdrawable *driDrawable; __GLXDRIscreen *screen; GCPtr gc; /* scratch GC for span drawing */ GCPtr swapgc; /* GC for swapping the color buffers */ }; static void __glXDRIdrawableDestroy(__GLXdrawable * drawable) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; const __DRIcoreExtension *core = private->screen->core; (*core->destroyDrawable) (private->driDrawable); FreeGC(private->gc, (GContext) 0); FreeGC(private->swapgc, (GContext) 0); __glXDrawableRelease(drawable); free(private); } static GLboolean __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable * drawable) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; const __DRIcoreExtension *core = private->screen->core; (*core->swapBuffers) (private->driDrawable); return TRUE; } static void __glXDRIdrawableCopySubBuffer(__GLXdrawable * basePrivate, int x, int y, int w, int h) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate; const __DRIcopySubBufferExtension *copySubBuffer = private->screen->copySubBuffer; if (copySubBuffer) (*copySubBuffer->copySubBuffer) (private->driDrawable, x, y, w, h); } static void __glXDRIcontextDestroy(__GLXcontext * baseContext) { __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; (*screen->core->destroyContext) (context->driContext); __glXContextDestroy(&context->base); free(context); } static int __glXDRIcontextMakeCurrent(__GLXcontext * baseContext) { __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv; __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv; __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; return (*screen->core->bindContext) (context->driContext, draw->driDrawable, read->driDrawable); } static int __glXDRIcontextLoseCurrent(__GLXcontext * baseContext) { __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; return (*screen->core->unbindContext) (context->driContext); } static int __glXDRIcontextCopy(__GLXcontext * baseDst, __GLXcontext * baseSrc, unsigned long mask) { __GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst; __GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc; __GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen; return (*screen->core->copyContext) (dst->driContext, src->driContext, mask); } static int __glXDRIbindTexImage(__GLXcontext * baseContext, int buffer, __GLXdrawable * glxPixmap) { __GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap; const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer; __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; if (texBuffer == NULL) return Success; #if __DRI_TEX_BUFFER_VERSION >= 2 if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) { (*texBuffer->setTexBuffer2) (context->driContext, glxPixmap->target, glxPixmap->format, drawable->driDrawable); } else #endif texBuffer->setTexBuffer(context->driContext, glxPixmap->target, drawable->driDrawable); return Success; } static int __glXDRIreleaseTexImage(__GLXcontext * baseContext, int buffer, __GLXdrawable * pixmap) { /* FIXME: Just unbind the texture? */ return Success; } static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { __glXDRIbindTexImage, __glXDRIreleaseTexImage }; static void __glXDRIscreenDestroy(__GLXscreen * baseScreen) { int i; __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; (*screen->core->destroyScreen) (screen->driScreen); dlclose(screen->driver); __glXScreenDestroy(baseScreen); if (screen->driConfigs) { for (i = 0; screen->driConfigs[i] != NULL; i++) free((__DRIconfig **) screen->driConfigs[i]); free(screen->driConfigs); } free(screen); } static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, __GLXcontext * baseShareContext, unsigned num_attribs, const uint32_t *attribs, int *error) { __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; __GLXDRIcontext *context, *shareContext; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; 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; else driShare = NULL; context = calloc(1, sizeof *context); if (context == NULL) return NULL; context->base.destroy = __glXDRIcontextDestroy; context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->driContext = (*core->createNewContext) (screen->driScreen, config->driConfig, driShare, context); return &context->base; } static __GLXdrawable * __glXDRIscreenCreateDrawable(ClientPtr client, __GLXscreen * screen, DrawablePtr pDraw, XID drawId, int type, XID glxDrawId, __GLXconfig * glxConfig) { XID gcvals[2]; int status; __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __GLXDRIdrawable *private; private = calloc(1, sizeof *private); if (private == NULL) return NULL; private->screen = driScreen; if (!__glXDrawableInit(&private->base, screen, pDraw, type, glxDrawId, glxConfig)) { free(private); return NULL; } private->base.destroy = __glXDRIdrawableDestroy; private->base.swapBuffers = __glXDRIdrawableSwapBuffers; private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer; gcvals[0] = GXcopy; private->gc = CreateGC(pDraw, GCFunction, gcvals, &status, (XID) 0, serverClient); gcvals[1] = FALSE; private->swapgc = CreateGC(pDraw, GCFunction | GCGraphicsExposures, gcvals, &status, (XID) 0, serverClient); private->driDrawable = (*driScreen->swrast->createNewDrawable) (driScreen->driScreen, config->driConfig, private); return &private->base; } static void swrastGetDrawableInfo(__DRIdrawable * draw, int *x, int *y, int *w, int *h, void *loaderPrivate) { __GLXDRIdrawable *drawable = loaderPrivate; DrawablePtr pDraw = drawable->base.pDraw; *x = pDraw->x; *y = pDraw->y; *w = pDraw->width; *h = pDraw->height; } static void swrastPutImage(__DRIdrawable * draw, int op, int x, int y, int w, int h, char *data, void *loaderPrivate) { __GLXDRIdrawable *drawable = loaderPrivate; DrawablePtr pDraw = drawable->base.pDraw; GCPtr gc; __GLXcontext *cx = lastGLContext; switch (op) { case __DRI_SWRAST_IMAGE_OP_DRAW: gc = drawable->gc; break; case __DRI_SWRAST_IMAGE_OP_SWAP: gc = drawable->swapgc; break; default: return; } ValidateGC(pDraw, gc); gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap, data); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); } } static void swrastGetImage(__DRIdrawable * draw, int x, int y, int w, int h, char *data, void *loaderPrivate) { __GLXDRIdrawable *drawable = loaderPrivate; DrawablePtr pDraw = drawable->base.pDraw; ScreenPtr pScreen = pDraw->pScreen; __GLXcontext *cx = lastGLContext; pScreen->GetImage(pDraw, x, y, w, h, ZPixmap, ~0L, data); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); } } static const __DRIswrastLoaderExtension swrastLoaderExtension = { {__DRI_SWRAST_LOADER, 1}, swrastGetDrawableInfo, swrastPutImage, swrastGetImage }; static const __DRIextension *loader_extensions[] = { &systemTimeExtension.base, &swrastLoaderExtension.base, NULL }; static void initializeExtensions(__GLXDRIscreen * screen) { const __DRIextension **extensions; int i; extensions = screen->core->getExtensions(screen->driScreen); for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { screen->copySubBuffer = (const __DRIcopySubBufferExtension *) extensions[i]; /* GLX_MESA_copy_sub_buffer is always enabled. */ } if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; /* GLX_EXT_texture_from_pixmap is always enabled. */ } /* Ignore unknown extensions */ } } /* white lie */ extern glx_func_ptr glXGetProcAddressARB(const char *); static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName = "swrast"; __GLXDRIscreen *screen; screen = calloc(1, sizeof *screen); if (screen == NULL) return NULL; screen->base.destroy = __glXDRIscreenDestroy; screen->base.createContext = __glXDRIscreenCreateContext; screen->base.createDrawable = __glXDRIscreenCreateDrawable; screen->base.swapInterval = NULL; screen->base.pScreen = pScreen; screen->driver = glxProbeDriver(driverName, (void **) &screen->core, __DRI_CORE, 1, (void **) &screen->swrast, __DRI_SWRAST, 1); if (screen->driver == NULL) { goto handle_error; } screen->driScreen = (*screen->swrast->createNewScreen) (pScreen->myNum, loader_extensions, &screen->driConfigs, screen); if (screen->driScreen == NULL) { LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed\n"); goto handle_error; } initializeExtensions(screen); screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs, GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT); __glXScreenInit(&screen->base, pScreen); screen->base.GLXmajor = 1; screen->base.GLXminor = 4; __glXsetGetProcAddress(glXGetProcAddressARB); LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName); return &screen->base; handle_error: if (screen->driver) dlclose(screen->driver); free(screen); LogMessage(X_ERROR, "GLX: could not load software renderer\n"); return NULL; } _X_EXPORT __GLXprovider __glXDRISWRastProvider = { __glXDRIscreenProbe, "DRISWRAST", NULL }; xorg-server-1.17.1/glx/glxscreens.c0000664000175100017510000003124312456571574014147 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include #include #include #include #include "privates.h" #include "glxserver.h" #include "glxutil.h" #include "glxext.h" #include "protocol-versions.h" static DevPrivateKeyRec glxScreenPrivateKeyRec; #define glxScreenPrivateKey (&glxScreenPrivateKeyRec) const char GLServerVersion[] = "1.4"; static const char GLServerExtensions[] = "GL_ARB_depth_texture " "GL_ARB_draw_buffers " "GL_ARB_fragment_program " "GL_ARB_fragment_program_shadow " "GL_ARB_imaging " "GL_ARB_multisample " "GL_ARB_multitexture " "GL_ARB_occlusion_query " "GL_ARB_point_parameters " "GL_ARB_point_sprite " "GL_ARB_shadow " "GL_ARB_shadow_ambient " "GL_ARB_texture_border_clamp " "GL_ARB_texture_compression " "GL_ARB_texture_cube_map " "GL_ARB_texture_env_add " "GL_ARB_texture_env_combine " "GL_ARB_texture_env_crossbar " "GL_ARB_texture_env_dot3 " "GL_ARB_texture_mirrored_repeat " "GL_ARB_texture_non_power_of_two " "GL_ARB_transpose_matrix " "GL_ARB_vertex_program " "GL_ARB_window_pos " "GL_EXT_abgr " "GL_EXT_bgra " "GL_EXT_blend_color " "GL_EXT_blend_equation_separate " "GL_EXT_blend_func_separate " "GL_EXT_blend_logic_op " "GL_EXT_blend_minmax " "GL_EXT_blend_subtract " "GL_EXT_clip_volume_hint " "GL_EXT_copy_texture " "GL_EXT_draw_range_elements " "GL_EXT_fog_coord " "GL_EXT_framebuffer_object " "GL_EXT_multi_draw_arrays " "GL_EXT_packed_pixels " "GL_EXT_paletted_texture " "GL_EXT_point_parameters " "GL_EXT_polygon_offset " "GL_EXT_rescale_normal " "GL_EXT_secondary_color " "GL_EXT_separate_specular_color " "GL_EXT_shadow_funcs " "GL_EXT_shared_texture_palette " "GL_EXT_stencil_two_side " "GL_EXT_stencil_wrap " "GL_EXT_subtexture " "GL_EXT_texture " "GL_EXT_texture3D " "GL_EXT_texture_compression_dxt1 " "GL_EXT_texture_compression_s3tc " "GL_EXT_texture_edge_clamp " "GL_EXT_texture_env_add " "GL_EXT_texture_env_combine " "GL_EXT_texture_env_dot3 " "GL_EXT_texture_filter_anisotropic " "GL_EXT_texture_lod " "GL_EXT_texture_lod_bias " "GL_EXT_texture_mirror_clamp " "GL_EXT_texture_object " "GL_EXT_texture_rectangle " "GL_EXT_vertex_array " "GL_3DFX_texture_compression_FXT1 " "GL_APPLE_packed_pixels " "GL_ATI_draw_buffers " "GL_ATI_texture_env_combine3 " "GL_ATI_texture_mirror_once " "GL_HP_occlusion_test " "GL_IBM_texture_mirrored_repeat " "GL_INGR_blend_func_separate " "GL_MESA_pack_invert " "GL_MESA_ycbcr_texture " "GL_NV_blend_square " "GL_NV_depth_clamp " "GL_NV_fog_distance " "GL_NV_fragment_program_option " "GL_NV_fragment_program2 " "GL_NV_light_max_exponent " "GL_NV_multisample_filter_hint " "GL_NV_point_sprite " "GL_NV_texgen_reflection " "GL_NV_texture_compression_vtc " "GL_NV_texture_env_combine4 " "GL_NV_texture_expand_normal " "GL_NV_texture_rectangle " "GL_NV_vertex_program2_option " "GL_NV_vertex_program3 " "GL_OES_compressed_paletted_texture " "GL_SGI_color_matrix " "GL_SGI_color_table " "GL_SGIS_generate_mipmap " "GL_SGIS_multisample " "GL_SGIS_point_parameters " "GL_SGIS_texture_border_clamp " "GL_SGIS_texture_edge_clamp " "GL_SGIS_texture_lod " "GL_SGIX_depth_texture " "GL_SGIX_shadow " "GL_SGIX_shadow_ambient " "GL_SUN_slice_accum "; /* ** We have made the simplifying assuption that the same extensions are ** supported across all screens in a multi-screen system. */ unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION; static char GLXServerExtensions[] = "GLX_ARB_multisample " "GLX_EXT_visual_info " "GLX_EXT_visual_rating " "GLX_EXT_import_context " "GLX_EXT_texture_from_pixmap " "GLX_OML_swap_method " "GLX_SGI_make_current_read " #ifndef __APPLE__ "GLX_SGIS_multisample " #endif "GLX_SGIX_fbconfig " "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer "; static Bool glxCloseScreen(ScreenPtr pScreen) { __GLXscreen *pGlxScreen = glxGetScreen(pScreen); pScreen->CloseScreen = pGlxScreen->CloseScreen; pGlxScreen->destroy(pGlxScreen); return pScreen->CloseScreen(pScreen); } __GLXscreen * glxGetScreen(ScreenPtr pScreen) { return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey); } _X_EXPORT void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates) { /* We keep this stub around for the DDX drivers that still * call it. */ } GLint glxConvertToXVisualType(int visualType) { static const int x_visual_types[] = { TrueColor, DirectColor, PseudoColor, StaticColor, GrayScale, StaticGray }; return ((unsigned) (visualType - GLX_TRUE_COLOR) < 6) ? x_visual_types[visualType - GLX_TRUE_COLOR] : -1; } /* This code inspired by composite/compinit.c. We could move this to * mi/ and share it with composite.*/ static VisualPtr AddScreenVisuals(ScreenPtr pScreen, int count, int d) { int i; DepthPtr depth; depth = NULL; for (i = 0; i < pScreen->numDepths; i++) { if (pScreen->allowedDepths[i].depth == d) { depth = &pScreen->allowedDepths[i]; break; } } if (depth == NULL) return NULL; if (ResizeVisualArray(pScreen, count, depth) == FALSE) return NULL; /* Return a pointer to the first of the added visuals. */ return pScreen->visuals + pScreen->numVisuals - count; } static int findFirstSet(unsigned int v) { int i; for (i = 0; i < 32; i++) if (v & (1 << i)) return i; return -1; } static void initGlxVisual(VisualPtr visual, __GLXconfig * config) { int maxBits; maxBits = max(config->redBits, max(config->greenBits, config->blueBits)); config->visualID = visual->vid; visual->class = glxConvertToXVisualType(config->visualType); visual->bitsPerRGBValue = maxBits; visual->ColormapEntries = 1 << maxBits; visual->nplanes = config->redBits + config->greenBits + config->blueBits; visual->redMask = config->redMask; visual->greenMask = config->greenMask; visual->blueMask = config->blueMask; visual->offsetRed = findFirstSet(config->redMask); visual->offsetGreen = findFirstSet(config->greenMask); visual->offsetBlue = findFirstSet(config->blueMask); } static __GLXconfig * pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual) { __GLXconfig *best = NULL, *config; int best_score = 0; for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) { int score = 0; if (config->redMask != visual->redMask || config->greenMask != visual->greenMask || config->blueMask != visual->blueMask) 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. */ if (visual->nplanes == 32 && config->rgbBits != 32) continue; /* Can't use the same FBconfig for multiple X visuals. I think. */ if (config->visualID != 0) continue; if (config->doubleBufferMode > 0) score += 8; if (config->depthBits > 0) score += 4; if (config->stencilBits > 0) score += 2; if (config->alphaBits > 0) score++; if (score > best_score) { best = config; best_score = score; } } return best; } void __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) { __GLXconfig *m; __GLXconfig *config; int i; if (!dixRegisterPrivateKey(&glxScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return; pGlxScreen->pScreen = pScreen; pGlxScreen->GLextensions = strdup(GLServerExtensions); pGlxScreen->GLXextensions = strdup(GLXServerExtensions); /* All GLX providers must support all of the functionality required for at * least GLX 1.2. If the provider supports a higher version, the GLXminor * version can be changed in the provider's screen-probe routine. For * most providers, the screen-probe routine is the caller of this * function. */ pGlxScreen->GLXmajor = 1; pGlxScreen->GLXminor = 2; pGlxScreen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = glxCloseScreen; i = 0; for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) { m->fbconfigID = FakeClientID(0); m->visualID = 0; i++; } pGlxScreen->numFBConfigs = i; pGlxScreen->visuals = calloc(pGlxScreen->numFBConfigs, sizeof(__GLXconfig *)); /* First, try to choose featureful FBconfigs for the existing X visuals. * Note that if multiple X visuals end up with the same FBconfig being * chosen, the later X visuals don't get GLX visuals (because we want to * prioritize the root visual being GLX). */ for (i = 0; i < pScreen->numVisuals; i++) { VisualPtr visual = &pScreen->visuals[i]; config = pickFBConfig(pGlxScreen, visual); if (config) { pGlxScreen->visuals[pGlxScreen->numVisuals++] = config; config->visualID = visual->vid; } } /* Then, add new visuals corresponding to all FBconfigs that didn't have * an existing, appropriate visual. */ for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) { int depth; VisualPtr visual; if (config->visualID != 0) continue; /* Only count RGB bits and not alpha, as we're not trying to create * visuals for compositing (that's what the 32-bit composite visual * set up above is for. */ depth = config->redBits + config->greenBits + config->blueBits; /* Make sure that our FBconfig's depth can actually be displayed * (corresponds to an existing visual). */ for (i = 0; i < pScreen->numVisuals; i++) { if (depth == pScreen->visuals[i].nplanes) break; } /* if it can't, fix up the fbconfig to not advertise window support */ if (i == pScreen->numVisuals) config->drawableType &= ~(GLX_WINDOW_BIT); /* fbconfig must support window drawables */ if (!(config->drawableType & GLX_WINDOW_BIT)) { config->visualID = 0; continue; } /* Create a new X visual for our FBconfig. */ visual = AddScreenVisuals(pScreen, 1, depth); if (visual == NULL) continue; pGlxScreen->visuals[pGlxScreen->numVisuals++] = config; initGlxVisual(visual, config); } dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen); } void __glXScreenDestroy(__GLXscreen * screen) { free(screen->GLXextensions); free(screen->GLextensions); free(screen->visuals); } xorg-server-1.17.1/glx/indirect_dispatch.c0000664000175100017510000040146612456571574015462 00000000000000/* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */ /* * (C) Copyright IBM Corporation 2005 * 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 * IBM, * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include "glxserver.h" #include "indirect_size.h" #include "indirect_size_get.h" #include "indirect_dispatch.h" #include "glxbyteorder.h" #include "indirect_util.h" #include "singlesize.h" #define __GLX_PAD(x) (((x) + 3) & ~3) typedef struct { __GLX_PIXEL_3D_HDR; } __GLXpixel3DHeader; extern GLboolean __glXErrorOccured(void); extern void __glXClearErrorOccured(void); static const unsigned dummy_answer[2] = { 0, 0 }; int __glXDisp_NewList(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glNewList(*(GLuint *) (pc + 0), *(GLenum *) (pc + 4)); error = Success; } return error; } int __glXDisp_EndList(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glEndList(); error = Success; } return error; } void __glXDisp_CallList(GLbyte * pc) { glCallList(*(GLuint *) (pc + 0)); } void __glXDisp_CallLists(GLbyte * pc) { const GLsizei n = *(GLsizei *) (pc + 0); const GLenum type = *(GLenum *) (pc + 4); const GLvoid *lists = (const GLvoid *) (pc + 8); lists = (const GLvoid *) (pc + 8); glCallLists(n, type, lists); } int __glXDisp_DeleteLists(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glDeleteLists(*(GLuint *) (pc + 0), *(GLsizei *) (pc + 4)); error = Success; } return error; } int __glXDisp_GenLists(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLuint retval; retval = glGenLists(*(GLsizei *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDisp_ListBase(GLbyte * pc) { glListBase(*(GLuint *) (pc + 0)); } void __glXDisp_Begin(GLbyte * pc) { glBegin(*(GLenum *) (pc + 0)); } void __glXDisp_Bitmap(GLbyte * pc) { const GLubyte *const bitmap = (const GLubyte *) ((pc + 44)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glBitmap(*(GLsizei *) (pc + 20), *(GLsizei *) (pc + 24), *(GLfloat *) (pc + 28), *(GLfloat *) (pc + 32), *(GLfloat *) (pc + 36), *(GLfloat *) (pc + 40), bitmap); } void __glXDisp_Color3bv(GLbyte * pc) { glColor3bv((const GLbyte *) (pc + 0)); } void __glXDisp_Color3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glColor3dv((const GLdouble *) (pc + 0)); } void __glXDisp_Color3fv(GLbyte * pc) { glColor3fv((const GLfloat *) (pc + 0)); } void __glXDisp_Color3iv(GLbyte * pc) { glColor3iv((const GLint *) (pc + 0)); } void __glXDisp_Color3sv(GLbyte * pc) { glColor3sv((const GLshort *) (pc + 0)); } void __glXDisp_Color3ubv(GLbyte * pc) { glColor3ubv((const GLubyte *) (pc + 0)); } void __glXDisp_Color3uiv(GLbyte * pc) { glColor3uiv((const GLuint *) (pc + 0)); } void __glXDisp_Color3usv(GLbyte * pc) { glColor3usv((const GLushort *) (pc + 0)); } void __glXDisp_Color4bv(GLbyte * pc) { glColor4bv((const GLbyte *) (pc + 0)); } void __glXDisp_Color4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glColor4dv((const GLdouble *) (pc + 0)); } void __glXDisp_Color4fv(GLbyte * pc) { glColor4fv((const GLfloat *) (pc + 0)); } void __glXDisp_Color4iv(GLbyte * pc) { glColor4iv((const GLint *) (pc + 0)); } void __glXDisp_Color4sv(GLbyte * pc) { glColor4sv((const GLshort *) (pc + 0)); } void __glXDisp_Color4ubv(GLbyte * pc) { glColor4ubv((const GLubyte *) (pc + 0)); } void __glXDisp_Color4uiv(GLbyte * pc) { glColor4uiv((const GLuint *) (pc + 0)); } void __glXDisp_Color4usv(GLbyte * pc) { glColor4usv((const GLushort *) (pc + 0)); } void __glXDisp_EdgeFlagv(GLbyte * pc) { glEdgeFlagv((const GLboolean *) (pc + 0)); } void __glXDisp_End(GLbyte * pc) { glEnd(); } void __glXDisp_Indexdv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glIndexdv((const GLdouble *) (pc + 0)); } void __glXDisp_Indexfv(GLbyte * pc) { glIndexfv((const GLfloat *) (pc + 0)); } void __glXDisp_Indexiv(GLbyte * pc) { glIndexiv((const GLint *) (pc + 0)); } void __glXDisp_Indexsv(GLbyte * pc) { glIndexsv((const GLshort *) (pc + 0)); } void __glXDisp_Normal3bv(GLbyte * pc) { glNormal3bv((const GLbyte *) (pc + 0)); } void __glXDisp_Normal3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glNormal3dv((const GLdouble *) (pc + 0)); } void __glXDisp_Normal3fv(GLbyte * pc) { glNormal3fv((const GLfloat *) (pc + 0)); } void __glXDisp_Normal3iv(GLbyte * pc) { glNormal3iv((const GLint *) (pc + 0)); } void __glXDisp_Normal3sv(GLbyte * pc) { glNormal3sv((const GLshort *) (pc + 0)); } void __glXDisp_RasterPos2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glRasterPos2dv((const GLdouble *) (pc + 0)); } void __glXDisp_RasterPos2fv(GLbyte * pc) { glRasterPos2fv((const GLfloat *) (pc + 0)); } void __glXDisp_RasterPos2iv(GLbyte * pc) { glRasterPos2iv((const GLint *) (pc + 0)); } void __glXDisp_RasterPos2sv(GLbyte * pc) { glRasterPos2sv((const GLshort *) (pc + 0)); } void __glXDisp_RasterPos3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glRasterPos3dv((const GLdouble *) (pc + 0)); } void __glXDisp_RasterPos3fv(GLbyte * pc) { glRasterPos3fv((const GLfloat *) (pc + 0)); } void __glXDisp_RasterPos3iv(GLbyte * pc) { glRasterPos3iv((const GLint *) (pc + 0)); } void __glXDisp_RasterPos3sv(GLbyte * pc) { glRasterPos3sv((const GLshort *) (pc + 0)); } void __glXDisp_RasterPos4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glRasterPos4dv((const GLdouble *) (pc + 0)); } void __glXDisp_RasterPos4fv(GLbyte * pc) { glRasterPos4fv((const GLfloat *) (pc + 0)); } void __glXDisp_RasterPos4iv(GLbyte * pc) { glRasterPos4iv((const GLint *) (pc + 0)); } void __glXDisp_RasterPos4sv(GLbyte * pc) { glRasterPos4sv((const GLshort *) (pc + 0)); } void __glXDisp_Rectdv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glRectdv((const GLdouble *) (pc + 0), (const GLdouble *) (pc + 16)); } void __glXDisp_Rectfv(GLbyte * pc) { glRectfv((const GLfloat *) (pc + 0), (const GLfloat *) (pc + 8)); } void __glXDisp_Rectiv(GLbyte * pc) { glRectiv((const GLint *) (pc + 0), (const GLint *) (pc + 8)); } void __glXDisp_Rectsv(GLbyte * pc) { glRectsv((const GLshort *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_TexCoord1dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glTexCoord1dv((const GLdouble *) (pc + 0)); } void __glXDisp_TexCoord1fv(GLbyte * pc) { glTexCoord1fv((const GLfloat *) (pc + 0)); } void __glXDisp_TexCoord1iv(GLbyte * pc) { glTexCoord1iv((const GLint *) (pc + 0)); } void __glXDisp_TexCoord1sv(GLbyte * pc) { glTexCoord1sv((const GLshort *) (pc + 0)); } void __glXDisp_TexCoord2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glTexCoord2dv((const GLdouble *) (pc + 0)); } void __glXDisp_TexCoord2fv(GLbyte * pc) { glTexCoord2fv((const GLfloat *) (pc + 0)); } void __glXDisp_TexCoord2iv(GLbyte * pc) { glTexCoord2iv((const GLint *) (pc + 0)); } void __glXDisp_TexCoord2sv(GLbyte * pc) { glTexCoord2sv((const GLshort *) (pc + 0)); } void __glXDisp_TexCoord3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glTexCoord3dv((const GLdouble *) (pc + 0)); } void __glXDisp_TexCoord3fv(GLbyte * pc) { glTexCoord3fv((const GLfloat *) (pc + 0)); } void __glXDisp_TexCoord3iv(GLbyte * pc) { glTexCoord3iv((const GLint *) (pc + 0)); } void __glXDisp_TexCoord3sv(GLbyte * pc) { glTexCoord3sv((const GLshort *) (pc + 0)); } void __glXDisp_TexCoord4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glTexCoord4dv((const GLdouble *) (pc + 0)); } void __glXDisp_TexCoord4fv(GLbyte * pc) { glTexCoord4fv((const GLfloat *) (pc + 0)); } void __glXDisp_TexCoord4iv(GLbyte * pc) { glTexCoord4iv((const GLint *) (pc + 0)); } void __glXDisp_TexCoord4sv(GLbyte * pc) { glTexCoord4sv((const GLshort *) (pc + 0)); } void __glXDisp_Vertex2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glVertex2dv((const GLdouble *) (pc + 0)); } void __glXDisp_Vertex2fv(GLbyte * pc) { glVertex2fv((const GLfloat *) (pc + 0)); } void __glXDisp_Vertex2iv(GLbyte * pc) { glVertex2iv((const GLint *) (pc + 0)); } void __glXDisp_Vertex2sv(GLbyte * pc) { glVertex2sv((const GLshort *) (pc + 0)); } void __glXDisp_Vertex3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glVertex3dv((const GLdouble *) (pc + 0)); } void __glXDisp_Vertex3fv(GLbyte * pc) { glVertex3fv((const GLfloat *) (pc + 0)); } void __glXDisp_Vertex3iv(GLbyte * pc) { glVertex3iv((const GLint *) (pc + 0)); } void __glXDisp_Vertex3sv(GLbyte * pc) { glVertex3sv((const GLshort *) (pc + 0)); } void __glXDisp_Vertex4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glVertex4dv((const GLdouble *) (pc + 0)); } void __glXDisp_Vertex4fv(GLbyte * pc) { glVertex4fv((const GLfloat *) (pc + 0)); } void __glXDisp_Vertex4iv(GLbyte * pc) { glVertex4iv((const GLint *) (pc + 0)); } void __glXDisp_Vertex4sv(GLbyte * pc) { glVertex4sv((const GLshort *) (pc + 0)); } void __glXDisp_ClipPlane(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif glClipPlane(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0)); } void __glXDisp_ColorMaterial(GLbyte * pc) { glColorMaterial(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_CullFace(GLbyte * pc) { glCullFace(*(GLenum *) (pc + 0)); } void __glXDisp_Fogf(GLbyte * pc) { glFogf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); } void __glXDisp_Fogfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 0); const GLfloat *params; params = (const GLfloat *) (pc + 4); glFogfv(pname, params); } void __glXDisp_Fogi(GLbyte * pc) { glFogi(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); } void __glXDisp_Fogiv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 0); const GLint *params; params = (const GLint *) (pc + 4); glFogiv(pname, params); } void __glXDisp_FrontFace(GLbyte * pc) { glFrontFace(*(GLenum *) (pc + 0)); } void __glXDisp_Hint(GLbyte * pc) { glHint(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_Lightf(GLbyte * pc) { glLightf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_Lightfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLfloat *params; params = (const GLfloat *) (pc + 8); glLightfv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_Lighti(GLbyte * pc) { glLighti(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); } void __glXDisp_Lightiv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLint *params; params = (const GLint *) (pc + 8); glLightiv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_LightModelf(GLbyte * pc) { glLightModelf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); } void __glXDisp_LightModelfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 0); const GLfloat *params; params = (const GLfloat *) (pc + 4); glLightModelfv(pname, params); } void __glXDisp_LightModeli(GLbyte * pc) { glLightModeli(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); } void __glXDisp_LightModeliv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 0); const GLint *params; params = (const GLint *) (pc + 4); glLightModeliv(pname, params); } void __glXDisp_LineStipple(GLbyte * pc) { glLineStipple(*(GLint *) (pc + 0), *(GLushort *) (pc + 4)); } void __glXDisp_LineWidth(GLbyte * pc) { glLineWidth(*(GLfloat *) (pc + 0)); } void __glXDisp_Materialf(GLbyte * pc) { glMaterialf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_Materialfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLfloat *params; params = (const GLfloat *) (pc + 8); glMaterialfv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_Materiali(GLbyte * pc) { glMateriali(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); } void __glXDisp_Materialiv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLint *params; params = (const GLint *) (pc + 8); glMaterialiv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_PointSize(GLbyte * pc) { glPointSize(*(GLfloat *) (pc + 0)); } void __glXDisp_PolygonMode(GLbyte * pc) { glPolygonMode(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_PolygonStipple(GLbyte * pc) { const GLubyte *const mask = (const GLubyte *) ((pc + 20)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glPolygonStipple(mask); } void __glXDisp_Scissor(GLbyte * pc) { glScissor(*(GLint *) (pc + 0), *(GLint *) (pc + 4), *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); } void __glXDisp_ShadeModel(GLbyte * pc) { glShadeModel(*(GLenum *) (pc + 0)); } void __glXDisp_TexParameterf(GLbyte * pc) { glTexParameterf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_TexParameterfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLfloat *params; params = (const GLfloat *) (pc + 8); glTexParameterfv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_TexParameteri(GLbyte * pc) { glTexParameteri(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); } void __glXDisp_TexParameteriv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLint *params; params = (const GLint *) (pc + 8); glTexParameteriv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_TexImage1D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glTexImage1D(*(GLenum *) (pc + 20), *(GLint *) (pc + 24), *(GLint *) (pc + 28), *(GLsizei *) (pc + 32), *(GLint *) (pc + 40), *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); } void __glXDisp_TexImage2D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glTexImage2D(*(GLenum *) (pc + 20), *(GLint *) (pc + 24), *(GLint *) (pc + 28), *(GLsizei *) (pc + 32), *(GLsizei *) (pc + 36), *(GLint *) (pc + 40), *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); } void __glXDisp_TexEnvf(GLbyte * pc) { glTexEnvf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_TexEnvfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLfloat *params; params = (const GLfloat *) (pc + 8); glTexEnvfv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_TexEnvi(GLbyte * pc) { glTexEnvi(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); } void __glXDisp_TexEnviv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLint *params; params = (const GLint *) (pc + 8); glTexEnviv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_TexGend(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glTexGend(*(GLenum *) (pc + 8), *(GLenum *) (pc + 12), *(GLdouble *) (pc + 0)); } void __glXDisp_TexGendv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLdouble *params; #ifdef __GLX_ALIGN64 const GLuint compsize = __glTexGendv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif params = (const GLdouble *) (pc + 8); glTexGendv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_TexGenf(GLbyte * pc) { glTexGenf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_TexGenfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLfloat *params; params = (const GLfloat *) (pc + 8); glTexGenfv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_TexGeni(GLbyte * pc) { glTexGeni(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); } void __glXDisp_TexGeniv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLint *params; params = (const GLint *) (pc + 8); glTexGeniv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_InitNames(GLbyte * pc) { glInitNames(); } void __glXDisp_LoadName(GLbyte * pc) { glLoadName(*(GLuint *) (pc + 0)); } void __glXDisp_PassThrough(GLbyte * pc) { glPassThrough(*(GLfloat *) (pc + 0)); } void __glXDisp_PopName(GLbyte * pc) { glPopName(); } void __glXDisp_PushName(GLbyte * pc) { glPushName(*(GLuint *) (pc + 0)); } void __glXDisp_DrawBuffer(GLbyte * pc) { glDrawBuffer(*(GLenum *) (pc + 0)); } void __glXDisp_Clear(GLbyte * pc) { glClear(*(GLbitfield *) (pc + 0)); } void __glXDisp_ClearAccum(GLbyte * pc) { glClearAccum(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8), *(GLfloat *) (pc + 12)); } void __glXDisp_ClearIndex(GLbyte * pc) { glClearIndex(*(GLfloat *) (pc + 0)); } void __glXDisp_ClearColor(GLbyte * pc) { glClearColor(*(GLclampf *) (pc + 0), *(GLclampf *) (pc + 4), *(GLclampf *) (pc + 8), *(GLclampf *) (pc + 12)); } void __glXDisp_ClearStencil(GLbyte * pc) { glClearStencil(*(GLint *) (pc + 0)); } void __glXDisp_ClearDepth(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glClearDepth(*(GLclampd *) (pc + 0)); } void __glXDisp_StencilMask(GLbyte * pc) { glStencilMask(*(GLuint *) (pc + 0)); } void __glXDisp_ColorMask(GLbyte * pc) { glColorMask(*(GLboolean *) (pc + 0), *(GLboolean *) (pc + 1), *(GLboolean *) (pc + 2), *(GLboolean *) (pc + 3)); } void __glXDisp_DepthMask(GLbyte * pc) { glDepthMask(*(GLboolean *) (pc + 0)); } void __glXDisp_IndexMask(GLbyte * pc) { glIndexMask(*(GLuint *) (pc + 0)); } void __glXDisp_Accum(GLbyte * pc) { glAccum(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); } void __glXDisp_Disable(GLbyte * pc) { glDisable(*(GLenum *) (pc + 0)); } void __glXDisp_Enable(GLbyte * pc) { glEnable(*(GLenum *) (pc + 0)); } void __glXDisp_PopAttrib(GLbyte * pc) { glPopAttrib(); } void __glXDisp_PushAttrib(GLbyte * pc) { glPushAttrib(*(GLbitfield *) (pc + 0)); } void __glXDisp_MapGrid1d(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif glMapGrid1d(*(GLint *) (pc + 16), *(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8)); } void __glXDisp_MapGrid1f(GLbyte * pc) { glMapGrid1f(*(GLint *) (pc + 0), *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_MapGrid2d(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); pc -= 4; } #endif glMapGrid2d(*(GLint *) (pc + 32), *(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8), *(GLint *) (pc + 36), *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24)); } void __glXDisp_MapGrid2f(GLbyte * pc) { glMapGrid2f(*(GLint *) (pc + 0), *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8), *(GLint *) (pc + 12), *(GLfloat *) (pc + 16), *(GLfloat *) (pc + 20)); } void __glXDisp_EvalCoord1dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif glEvalCoord1dv((const GLdouble *) (pc + 0)); } void __glXDisp_EvalCoord1fv(GLbyte * pc) { glEvalCoord1fv((const GLfloat *) (pc + 0)); } void __glXDisp_EvalCoord2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glEvalCoord2dv((const GLdouble *) (pc + 0)); } void __glXDisp_EvalCoord2fv(GLbyte * pc) { glEvalCoord2fv((const GLfloat *) (pc + 0)); } void __glXDisp_EvalMesh1(GLbyte * pc) { glEvalMesh1(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8)); } void __glXDisp_EvalPoint1(GLbyte * pc) { glEvalPoint1(*(GLint *) (pc + 0)); } void __glXDisp_EvalMesh2(GLbyte * pc) { glEvalMesh2(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16)); } void __glXDisp_EvalPoint2(GLbyte * pc) { glEvalPoint2(*(GLint *) (pc + 0), *(GLint *) (pc + 4)); } void __glXDisp_AlphaFunc(GLbyte * pc) { glAlphaFunc(*(GLenum *) (pc + 0), *(GLclampf *) (pc + 4)); } void __glXDisp_BlendFunc(GLbyte * pc) { glBlendFunc(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_LogicOp(GLbyte * pc) { glLogicOp(*(GLenum *) (pc + 0)); } void __glXDisp_StencilFunc(GLbyte * pc) { glStencilFunc(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLuint *) (pc + 8)); } void __glXDisp_StencilOp(GLbyte * pc) { glStencilOp(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8)); } void __glXDisp_DepthFunc(GLbyte * pc) { glDepthFunc(*(GLenum *) (pc + 0)); } void __glXDisp_PixelZoom(GLbyte * pc) { glPixelZoom(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4)); } void __glXDisp_PixelTransferf(GLbyte * pc) { glPixelTransferf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); } void __glXDisp_PixelTransferi(GLbyte * pc) { glPixelTransferi(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); } int __glXDisp_PixelStoref(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glPixelStoref(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); error = Success; } return error; } int __glXDisp_PixelStorei(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { glPixelStorei(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); error = Success; } return error; } void __glXDisp_PixelMapfv(GLbyte * pc) { const GLsizei mapsize = *(GLsizei *) (pc + 4); glPixelMapfv(*(GLenum *) (pc + 0), mapsize, (const GLfloat *) (pc + 8)); } void __glXDisp_PixelMapuiv(GLbyte * pc) { const GLsizei mapsize = *(GLsizei *) (pc + 4); glPixelMapuiv(*(GLenum *) (pc + 0), mapsize, (const GLuint *) (pc + 8)); } void __glXDisp_PixelMapusv(GLbyte * pc) { const GLsizei mapsize = *(GLsizei *) (pc + 4); glPixelMapusv(*(GLenum *) (pc + 0), mapsize, (const GLushort *) (pc + 8)); } void __glXDisp_ReadBuffer(GLbyte * pc) { glReadBuffer(*(GLenum *) (pc + 0)); } void __glXDisp_CopyPixels(GLbyte * pc) { glCopyPixels(*(GLint *) (pc + 0), *(GLint *) (pc + 4), *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12), *(GLenum *) (pc + 16)); } void __glXDisp_DrawPixels(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 36)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glDrawPixels(*(GLsizei *) (pc + 20), *(GLsizei *) (pc + 24), *(GLenum *) (pc + 28), *(GLenum *) (pc + 32), pixels); } int __glXDisp_GetBooleanv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 0); const GLuint compsize = __glGetBooleanv_size(pname); GLboolean answerBuffer[200]; GLboolean *params = __glXGetAnswerBuffer(cl, compsize, answerBuffer, sizeof(answerBuffer), 1); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetBooleanv(pname, params); __glXSendReply(cl->client, params, compsize, 1, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetClipPlane(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLdouble equation[4]; glGetClipPlane(*(GLenum *) (pc + 0), equation); __glXSendReply(cl->client, equation, 4, 8, GL_TRUE, 0); error = Success; } return error; } int __glXDisp_GetDoublev(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 0); const GLuint compsize = __glGetDoublev_size(pname); GLdouble answerBuffer[200]; GLdouble *params = __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, sizeof(answerBuffer), 8); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetDoublev(pname, params); __glXSendReply(cl->client, params, compsize, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetError(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLenum retval; retval = glGetError(); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDisp_GetFloatv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 0); const GLuint compsize = __glGetFloatv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetFloatv(pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetIntegerv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 0); const GLuint compsize = __glGetIntegerv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetIntegerv(pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetLightfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetLightfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetLightfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetLightiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetLightiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetLightiv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMapdv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = *(GLenum *) (pc + 0); const GLenum query = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMapdv_size(target, query); GLdouble answerBuffer[200]; GLdouble *v = __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, sizeof(answerBuffer), 8); if (v == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMapdv(target, query, v); __glXSendReply(cl->client, v, compsize, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMapfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = *(GLenum *) (pc + 0); const GLenum query = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMapfv_size(target, query); GLfloat answerBuffer[200]; GLfloat *v = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (v == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMapfv(target, query, v); __glXSendReply(cl->client, v, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMapiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum target = *(GLenum *) (pc + 0); const GLenum query = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMapiv_size(target, query); GLint answerBuffer[200]; GLint *v = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (v == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMapiv(target, query, v); __glXSendReply(cl->client, v, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMaterialfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMaterialfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMaterialfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMaterialiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMaterialiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMaterialiv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetPixelMapfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum map = *(GLenum *) (pc + 0); const GLuint compsize = __glGetPixelMapfv_size(map); GLfloat answerBuffer[200]; GLfloat *values = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (values == NULL) return BadAlloc; __glXClearErrorOccured(); glGetPixelMapfv(map, values); __glXSendReply(cl->client, values, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetPixelMapuiv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum map = *(GLenum *) (pc + 0); const GLuint compsize = __glGetPixelMapuiv_size(map); GLuint answerBuffer[200]; GLuint *values = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (values == NULL) return BadAlloc; __glXClearErrorOccured(); glGetPixelMapuiv(map, values); __glXSendReply(cl->client, values, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetPixelMapusv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum map = *(GLenum *) (pc + 0); const GLuint compsize = __glGetPixelMapusv_size(map); GLushort answerBuffer[200]; GLushort *values = __glXGetAnswerBuffer(cl, compsize * 2, answerBuffer, sizeof(answerBuffer), 2); if (values == NULL) return BadAlloc; __glXClearErrorOccured(); glGetPixelMapusv(map, values); __glXSendReply(cl->client, values, compsize, 2, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexEnvfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetTexEnvfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexEnvfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexEnviv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetTexEnviv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexEnviv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexGendv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetTexGendv_size(pname); GLdouble answerBuffer[200]; GLdouble *params = __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, sizeof(answerBuffer), 8); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexGendv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexGenfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetTexGenfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexGenfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexGeniv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetTexGeniv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexGeniv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetTexParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetTexParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexLevelParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 8); const GLuint compsize = __glGetTexLevelParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexLevelParameterfv(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetTexLevelParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 8); const GLuint compsize = __glGetTexLevelParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetTexLevelParameteriv(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_IsEnabled(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsEnabled(*(GLenum *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDisp_IsList(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsList(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDisp_DepthRange(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 16); pc -= 4; } #endif glDepthRange(*(GLclampd *) (pc + 0), *(GLclampd *) (pc + 8)); } void __glXDisp_Frustum(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 48); pc -= 4; } #endif glFrustum(*(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24), *(GLdouble *) (pc + 32), *(GLdouble *) (pc + 40)); } void __glXDisp_LoadIdentity(GLbyte * pc) { glLoadIdentity(); } void __glXDisp_LoadMatrixf(GLbyte * pc) { glLoadMatrixf((const GLfloat *) (pc + 0)); } void __glXDisp_LoadMatrixd(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 128); pc -= 4; } #endif glLoadMatrixd((const GLdouble *) (pc + 0)); } void __glXDisp_MatrixMode(GLbyte * pc) { glMatrixMode(*(GLenum *) (pc + 0)); } void __glXDisp_MultMatrixf(GLbyte * pc) { glMultMatrixf((const GLfloat *) (pc + 0)); } void __glXDisp_MultMatrixd(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 128); pc -= 4; } #endif glMultMatrixd((const GLdouble *) (pc + 0)); } void __glXDisp_Ortho(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 48); pc -= 4; } #endif glOrtho(*(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24), *(GLdouble *) (pc + 32), *(GLdouble *) (pc + 40)); } void __glXDisp_PopMatrix(GLbyte * pc) { glPopMatrix(); } void __glXDisp_PushMatrix(GLbyte * pc) { glPushMatrix(); } void __glXDisp_Rotated(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 32); pc -= 4; } #endif glRotated(*(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24)); } void __glXDisp_Rotatef(GLbyte * pc) { glRotatef(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8), *(GLfloat *) (pc + 12)); } void __glXDisp_Scaled(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glScaled(*(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16)); } void __glXDisp_Scalef(GLbyte * pc) { glScalef(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_Translated(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif glTranslated(*(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16)); } void __glXDisp_Translatef(GLbyte * pc) { glTranslatef(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_Viewport(GLbyte * pc) { glViewport(*(GLint *) (pc + 0), *(GLint *) (pc + 4), *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); } void __glXDisp_BindTexture(GLbyte * pc) { glBindTexture(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } void __glXDisp_Indexubv(GLbyte * pc) { glIndexubv((const GLubyte *) (pc + 0)); } void __glXDisp_PolygonOffset(GLbyte * pc) { glPolygonOffset(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4)); } int __glXDisp_AreTexturesResident(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLboolean retval; GLboolean answerBuffer[200]; GLboolean *residences = __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); if (residences == NULL) return BadAlloc; retval = glAreTexturesResident(n, (const GLuint *) (pc + 4), residences); __glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval); error = Success; } return error; } int __glXDisp_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLboolean retval; GLboolean answerBuffer[200]; GLboolean *residences = __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); if (residences == NULL) return BadAlloc; retval = glAreTexturesResident(n, (const GLuint *) (pc + 4), residences); __glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval); error = Success; } return error; } void __glXDisp_CopyTexImage1D(GLbyte * pc) { glCopyTexImage1D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLenum *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16), *(GLsizei *) (pc + 20), *(GLint *) (pc + 24)); } void __glXDisp_CopyTexImage2D(GLbyte * pc) { glCopyTexImage2D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLenum *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16), *(GLsizei *) (pc + 20), *(GLsizei *) (pc + 24), *(GLint *) (pc + 28)); } void __glXDisp_CopyTexSubImage1D(GLbyte * pc) { glCopyTexSubImage1D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16), *(GLsizei *) (pc + 20)); } void __glXDisp_CopyTexSubImage2D(GLbyte * pc) { glCopyTexSubImage2D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16), *(GLint *) (pc + 20), *(GLsizei *) (pc + 24), *(GLsizei *) (pc + 28)); } int __glXDisp_DeleteTextures(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); glDeleteTextures(n, (const GLuint *) (pc + 4)); error = Success; } return error; } int __glXDisp_DeleteTexturesEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); glDeleteTextures(n, (const GLuint *) (pc + 4)); error = Success; } return error; } int __glXDisp_GenTextures(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLuint answerBuffer[200]; GLuint *textures = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (textures == NULL) return BadAlloc; glGenTextures(n, textures); __glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDisp_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLuint answerBuffer[200]; GLuint *textures = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (textures == NULL) return BadAlloc; glGenTextures(n, textures); __glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDisp_IsTexture(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsTexture(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDisp_IsTextureEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = glIsTexture(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDisp_PrioritizeTextures(GLbyte * pc) { const GLsizei n = *(GLsizei *) (pc + 0); glPrioritizeTextures(n, (const GLuint *) (pc + 4), (const GLclampf *) (pc + 4)); } void __glXDisp_TexSubImage1D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glTexSubImage1D(*(GLenum *) (pc + 20), *(GLint *) (pc + 24), *(GLint *) (pc + 28), *(GLsizei *) (pc + 36), *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); } void __glXDisp_TexSubImage2D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glTexSubImage2D(*(GLenum *) (pc + 20), *(GLint *) (pc + 24), *(GLint *) (pc + 28), *(GLint *) (pc + 32), *(GLsizei *) (pc + 36), *(GLsizei *) (pc + 40), *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels); } void __glXDisp_BlendColor(GLbyte * pc) { glBlendColor(*(GLclampf *) (pc + 0), *(GLclampf *) (pc + 4), *(GLclampf *) (pc + 8), *(GLclampf *) (pc + 12)); } void __glXDisp_BlendEquation(GLbyte * pc) { glBlendEquation(*(GLenum *) (pc + 0)); } void __glXDisp_ColorTable(GLbyte * pc) { const GLvoid *const table = (const GLvoid *) ((pc + 40)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glColorTable(*(GLenum *) (pc + 20), *(GLenum *) (pc + 24), *(GLsizei *) (pc + 28), *(GLenum *) (pc + 32), *(GLenum *) (pc + 36), table); } void __glXDisp_ColorTableParameterfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLfloat *params; params = (const GLfloat *) (pc + 8); glColorTableParameterfv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_ColorTableParameteriv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLint *params; params = (const GLint *) (pc + 8); glColorTableParameteriv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_CopyColorTable(GLbyte * pc) { glCopyColorTable(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLsizei *) (pc + 16)); } int __glXDisp_GetColorTableParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetColorTableParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetColorTableParameterfvSGI(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetColorTableParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetColorTableParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetColorTableParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetColorTableParameterivSGI(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetColorTableParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetColorTableParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } void __glXDisp_ColorSubTable(GLbyte * pc) { const GLvoid *const data = (const GLvoid *) ((pc + 40)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glColorSubTable(*(GLenum *) (pc + 20), *(GLsizei *) (pc + 24), *(GLsizei *) (pc + 28), *(GLenum *) (pc + 32), *(GLenum *) (pc + 36), data); } void __glXDisp_CopyColorSubTable(GLbyte * pc) { glCopyColorSubTable(*(GLenum *) (pc + 0), *(GLsizei *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLsizei *) (pc + 16)); } void __glXDisp_ConvolutionFilter1D(GLbyte * pc) { const GLvoid *const image = (const GLvoid *) ((pc + 44)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glConvolutionFilter1D(*(GLenum *) (pc + 20), *(GLenum *) (pc + 24), *(GLsizei *) (pc + 28), *(GLenum *) (pc + 36), *(GLenum *) (pc + 40), image); } void __glXDisp_ConvolutionFilter2D(GLbyte * pc) { const GLvoid *const image = (const GLvoid *) ((pc + 44)); __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glConvolutionFilter2D(*(GLenum *) (pc + 20), *(GLenum *) (pc + 24), *(GLsizei *) (pc + 28), *(GLsizei *) (pc + 32), *(GLenum *) (pc + 36), *(GLenum *) (pc + 40), image); } void __glXDisp_ConvolutionParameterf(GLbyte * pc) { glConvolutionParameterf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8)); } void __glXDisp_ConvolutionParameterfv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLfloat *params; params = (const GLfloat *) (pc + 8); glConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_ConvolutionParameteri(GLbyte * pc) { glConvolutionParameteri(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8)); } void __glXDisp_ConvolutionParameteriv(GLbyte * pc) { const GLenum pname = *(GLenum *) (pc + 4); const GLint *params; params = (const GLint *) (pc + 8); glConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params); } void __glXDisp_CopyConvolutionFilter1D(GLbyte * pc) { glCopyConvolutionFilter1D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLsizei *) (pc + 16)); } void __glXDisp_CopyConvolutionFilter2D(GLbyte * pc) { glCopyConvolutionFilter2D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLsizei *) (pc + 16), *(GLsizei *) (pc + 20)); } int __glXDisp_GetConvolutionParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetConvolutionParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetConvolutionParameterfvEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetConvolutionParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetConvolutionParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetConvolutionParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetConvolutionParameterivEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetConvolutionParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetHistogramParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetHistogramParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetHistogramParameterfvEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetHistogramParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetHistogramParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetHistogramParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetHistogramParameterivEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetHistogramParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetHistogramParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMinmaxParameterfv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMinmaxParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMinmaxParameterfvEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMinmaxParameterfv_size(pname); GLfloat answerBuffer[200]; GLfloat *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameterfv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMinmaxParameteriv(__GLXclientState * cl, GLbyte * pc) { xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMinmaxParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetMinmaxParameterivEXT(__GLXclientState * cl, GLbyte * pc) { xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetMinmaxParameteriv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); glGetMinmaxParameteriv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } void __glXDisp_Histogram(GLbyte * pc) { glHistogram(*(GLenum *) (pc + 0), *(GLsizei *) (pc + 4), *(GLenum *) (pc + 8), *(GLboolean *) (pc + 12)); } void __glXDisp_Minmax(GLbyte * pc) { glMinmax(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLboolean *) (pc + 8)); } void __glXDisp_ResetHistogram(GLbyte * pc) { glResetHistogram(*(GLenum *) (pc + 0)); } void __glXDisp_ResetMinmax(GLbyte * pc) { glResetMinmax(*(GLenum *) (pc + 0)); } void __glXDisp_TexImage3D(GLbyte * pc) { const CARD32 ptr_is_null = *(CARD32 *) (pc + 76); const GLvoid *const pixels = (const GLvoid *) ((ptr_is_null != 0) ? NULL : (pc + 80)); __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) hdr->imageHeight); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) hdr->skipImages); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glTexImage3D(*(GLenum *) (pc + 36), *(GLint *) (pc + 40), *(GLint *) (pc + 44), *(GLsizei *) (pc + 48), *(GLsizei *) (pc + 52), *(GLsizei *) (pc + 56), *(GLint *) (pc + 64), *(GLenum *) (pc + 68), *(GLenum *) (pc + 72), pixels); } void __glXDisp_TexSubImage3D(GLbyte * pc) { const GLvoid *const pixels = (const GLvoid *) ((pc + 88)); __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) hdr->imageHeight); glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows); glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) hdr->skipImages); glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels); glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment); glTexSubImage3D(*(GLenum *) (pc + 36), *(GLint *) (pc + 40), *(GLint *) (pc + 44), *(GLint *) (pc + 48), *(GLint *) (pc + 52), *(GLsizei *) (pc + 60), *(GLsizei *) (pc + 64), *(GLsizei *) (pc + 68), *(GLenum *) (pc + 76), *(GLenum *) (pc + 80), pixels); } void __glXDisp_CopyTexSubImage3D(GLbyte * pc) { glCopyTexSubImage3D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16), *(GLint *) (pc + 20), *(GLint *) (pc + 24), *(GLsizei *) (pc + 28), *(GLsizei *) (pc + 32)); } void __glXDisp_ActiveTexture(GLbyte * pc) { glActiveTextureARB(*(GLenum *) (pc + 0)); } void __glXDisp_MultiTexCoord1dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); pc -= 4; } #endif glMultiTexCoord1dvARB(*(GLenum *) (pc + 8), (const GLdouble *) (pc + 0)); } void __glXDisp_MultiTexCoord1fvARB(GLbyte * pc) { glMultiTexCoord1fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_MultiTexCoord1iv(GLbyte * pc) { glMultiTexCoord1ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord1sv(GLbyte * pc) { glMultiTexCoord1svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_MultiTexCoord2dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif glMultiTexCoord2dvARB(*(GLenum *) (pc + 16), (const GLdouble *) (pc + 0)); } void __glXDisp_MultiTexCoord2fvARB(GLbyte * pc) { glMultiTexCoord2fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_MultiTexCoord2iv(GLbyte * pc) { glMultiTexCoord2ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord2sv(GLbyte * pc) { glMultiTexCoord2svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_MultiTexCoord3dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); pc -= 4; } #endif glMultiTexCoord3dvARB(*(GLenum *) (pc + 24), (const GLdouble *) (pc + 0)); } void __glXDisp_MultiTexCoord3fvARB(GLbyte * pc) { glMultiTexCoord3fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_MultiTexCoord3iv(GLbyte * pc) { glMultiTexCoord3ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord3sv(GLbyte * pc) { glMultiTexCoord3svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_MultiTexCoord4dv(GLbyte * pc) { #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif glMultiTexCoord4dvARB(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0)); } void __glXDisp_MultiTexCoord4fvARB(GLbyte * pc) { glMultiTexCoord4fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_MultiTexCoord4iv(GLbyte * pc) { glMultiTexCoord4ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord4sv(GLbyte * pc) { glMultiTexCoord4svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_CompressedTexImage1D(GLbyte * pc) { PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D = __glGetProcAddress("glCompressedTexImage1D"); const GLsizei imageSize = *(GLsizei *) (pc + 20); CompressedTexImage1D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLenum *) (pc + 8), *(GLsizei *) (pc + 12), *(GLint *) (pc + 16), imageSize, (const GLvoid *) (pc + 24)); } void __glXDisp_CompressedTexImage2D(GLbyte * pc) { PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D = __glGetProcAddress("glCompressedTexImage2D"); const GLsizei imageSize = *(GLsizei *) (pc + 24); CompressedTexImage2D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLenum *) (pc + 8), *(GLsizei *) (pc + 12), *(GLsizei *) (pc + 16), *(GLint *) (pc + 20), imageSize, (const GLvoid *) (pc + 28)); } void __glXDisp_CompressedTexImage3D(GLbyte * pc) { PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D = __glGetProcAddress("glCompressedTexImage3D"); const GLsizei imageSize = *(GLsizei *) (pc + 28); CompressedTexImage3D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLenum *) (pc + 8), *(GLsizei *) (pc + 12), *(GLsizei *) (pc + 16), *(GLsizei *) (pc + 20), *(GLint *) (pc + 24), imageSize, (const GLvoid *) (pc + 32)); } void __glXDisp_CompressedTexSubImage1D(GLbyte * pc) { PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D = __glGetProcAddress("glCompressedTexSubImage1D"); const GLsizei imageSize = *(GLsizei *) (pc + 20); CompressedTexSubImage1D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLsizei *) (pc + 12), *(GLenum *) (pc + 16), imageSize, (const GLvoid *) (pc + 24)); } void __glXDisp_CompressedTexSubImage2D(GLbyte * pc) { PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D = __glGetProcAddress("glCompressedTexSubImage2D"); const GLsizei imageSize = *(GLsizei *) (pc + 28); CompressedTexSubImage2D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLsizei *) (pc + 16), *(GLsizei *) (pc + 20), *(GLenum *) (pc + 24), imageSize, (const GLvoid *) (pc + 32)); } void __glXDisp_CompressedTexSubImage3D(GLbyte * pc) { PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D = __glGetProcAddress("glCompressedTexSubImage3D"); const GLsizei imageSize = *(GLsizei *) (pc + 36); CompressedTexSubImage3D(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16), *(GLsizei *) (pc + 20), *(GLsizei *) (pc + 24), *(GLsizei *) (pc + 28), *(GLenum *) (pc + 32), imageSize, (const GLvoid *) (pc + 40)); } void __glXDisp_SampleCoverage(GLbyte * pc) { PFNGLSAMPLECOVERAGEPROC SampleCoverage = __glGetProcAddress("glSampleCoverage"); SampleCoverage(*(GLclampf *) (pc + 0), *(GLboolean *) (pc + 4)); } void __glXDisp_BlendFuncSeparate(GLbyte * pc) { PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate = __glGetProcAddress("glBlendFuncSeparate"); BlendFuncSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), *(GLenum *) (pc + 12)); } void __glXDisp_FogCoorddv(GLbyte * pc) { PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); pc -= 4; } #endif FogCoorddv((const GLdouble *) (pc + 0)); } void __glXDisp_PointParameterf(GLbyte * pc) { PFNGLPOINTPARAMETERFPROC PointParameterf = __glGetProcAddress("glPointParameterf"); PointParameterf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); } void __glXDisp_PointParameterfv(GLbyte * pc) { PFNGLPOINTPARAMETERFVPROC PointParameterfv = __glGetProcAddress("glPointParameterfv"); const GLenum pname = *(GLenum *) (pc + 0); const GLfloat *params; params = (const GLfloat *) (pc + 4); PointParameterfv(pname, params); } void __glXDisp_PointParameteri(GLbyte * pc) { PFNGLPOINTPARAMETERIPROC PointParameteri = __glGetProcAddress("glPointParameteri"); PointParameteri(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); } void __glXDisp_PointParameteriv(GLbyte * pc) { PFNGLPOINTPARAMETERIVPROC PointParameteriv = __glGetProcAddress("glPointParameteriv"); const GLenum pname = *(GLenum *) (pc + 0); const GLint *params; params = (const GLint *) (pc + 4); PointParameteriv(pname, params); } void __glXDisp_SecondaryColor3bv(GLbyte * pc) { PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv = __glGetProcAddress("glSecondaryColor3bv"); SecondaryColor3bv((const GLbyte *) (pc + 0)); } void __glXDisp_SecondaryColor3dv(GLbyte * pc) { PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv = __glGetProcAddress("glSecondaryColor3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); pc -= 4; } #endif SecondaryColor3dv((const GLdouble *) (pc + 0)); } void __glXDisp_SecondaryColor3iv(GLbyte * pc) { PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv = __glGetProcAddress("glSecondaryColor3iv"); SecondaryColor3iv((const GLint *) (pc + 0)); } void __glXDisp_SecondaryColor3sv(GLbyte * pc) { PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv = __glGetProcAddress("glSecondaryColor3sv"); SecondaryColor3sv((const GLshort *) (pc + 0)); } void __glXDisp_SecondaryColor3ubv(GLbyte * pc) { PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv = __glGetProcAddress("glSecondaryColor3ubv"); SecondaryColor3ubv((const GLubyte *) (pc + 0)); } void __glXDisp_SecondaryColor3uiv(GLbyte * pc) { PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv = __glGetProcAddress("glSecondaryColor3uiv"); SecondaryColor3uiv((const GLuint *) (pc + 0)); } void __glXDisp_SecondaryColor3usv(GLbyte * pc) { PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv = __glGetProcAddress("glSecondaryColor3usv"); SecondaryColor3usv((const GLushort *) (pc + 0)); } void __glXDisp_WindowPos3fv(GLbyte * pc) { PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv"); WindowPos3fv((const GLfloat *) (pc + 0)); } void __glXDisp_BeginQuery(GLbyte * pc) { PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery"); BeginQuery(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } int __glXDisp_DeleteQueries(__GLXclientState * cl, GLbyte * pc) { PFNGLDELETEQUERIESPROC DeleteQueries = __glGetProcAddress("glDeleteQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); DeleteQueries(n, (const GLuint *) (pc + 4)); error = Success; } return error; } void __glXDisp_EndQuery(GLbyte * pc) { PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery"); EndQuery(*(GLenum *) (pc + 0)); } int __glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc) { PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLuint answerBuffer[200]; GLuint *ids = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (ids == NULL) return BadAlloc; GenQueries(n, ids); __glXSendReply(cl->client, ids, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDisp_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv = __glGetProcAddress("glGetQueryObjectiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetQueryObjectiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetQueryObjectiv(*(GLuint *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv = __glGetProcAddress("glGetQueryObjectuiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetQueryObjectuiv_size(pname); GLuint answerBuffer[200]; GLuint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetQueryObjectuiv(*(GLuint *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetQueryiv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetQueryiv_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetQueryiv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_IsQuery(__GLXclientState * cl, GLbyte * pc) { PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_SINGLE_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsQuery(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDisp_BlendEquationSeparate(GLbyte * pc) { PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate = __glGetProcAddress("glBlendEquationSeparate"); BlendEquationSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_DrawBuffers(GLbyte * pc) { PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers"); const GLsizei n = *(GLsizei *) (pc + 0); DrawBuffers(n, (const GLenum *) (pc + 4)); } void __glXDisp_VertexAttrib1dv(GLbyte * pc) { PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv = __glGetProcAddress("glVertexAttrib1dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); pc -= 4; } #endif VertexAttrib1dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib1sv(GLbyte * pc) { PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv = __glGetProcAddress("glVertexAttrib1sv"); VertexAttrib1sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib2dv(GLbyte * pc) { PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv = __glGetProcAddress("glVertexAttrib2dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif VertexAttrib2dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib2sv(GLbyte * pc) { PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv = __glGetProcAddress("glVertexAttrib2sv"); VertexAttrib2sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib3dv(GLbyte * pc) { PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv = __glGetProcAddress("glVertexAttrib3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); pc -= 4; } #endif VertexAttrib3dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib3sv(GLbyte * pc) { PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv = __glGetProcAddress("glVertexAttrib3sv"); VertexAttrib3sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4Nbv(GLbyte * pc) { PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv = __glGetProcAddress("glVertexAttrib4Nbv"); VertexAttrib4Nbv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); } void __glXDisp_VertexAttrib4Niv(GLbyte * pc) { PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv = __glGetProcAddress("glVertexAttrib4Niv"); VertexAttrib4Niv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_VertexAttrib4Nsv(GLbyte * pc) { PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv = __glGetProcAddress("glVertexAttrib4Nsv"); VertexAttrib4Nsv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4Nubv(GLbyte * pc) { PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv = __glGetProcAddress("glVertexAttrib4Nubv"); VertexAttrib4Nubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); } void __glXDisp_VertexAttrib4Nuiv(GLbyte * pc) { PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv = __glGetProcAddress("glVertexAttrib4Nuiv"); VertexAttrib4Nuiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); } void __glXDisp_VertexAttrib4Nusv(GLbyte * pc) { PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv = __glGetProcAddress("glVertexAttrib4Nusv"); VertexAttrib4Nusv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); } void __glXDisp_VertexAttrib4bv(GLbyte * pc) { PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv = __glGetProcAddress("glVertexAttrib4bv"); VertexAttrib4bv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); } void __glXDisp_VertexAttrib4dv(GLbyte * pc) { PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv = __glGetProcAddress("glVertexAttrib4dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif VertexAttrib4dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib4iv(GLbyte * pc) { PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv = __glGetProcAddress("glVertexAttrib4iv"); VertexAttrib4iv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_VertexAttrib4sv(GLbyte * pc) { PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv = __glGetProcAddress("glVertexAttrib4sv"); VertexAttrib4sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4ubv(GLbyte * pc) { PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv = __glGetProcAddress("glVertexAttrib4ubv"); VertexAttrib4ubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); } void __glXDisp_VertexAttrib4uiv(GLbyte * pc) { PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv = __glGetProcAddress("glVertexAttrib4uiv"); VertexAttrib4uiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); } void __glXDisp_VertexAttrib4usv(GLbyte * pc) { PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv = __glGetProcAddress("glVertexAttrib4usv"); VertexAttrib4usv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); } void __glXDisp_ClampColor(GLbyte * pc) { PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor"); ClampColor(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_BindProgramARB(GLbyte * pc) { PFNGLBINDPROGRAMARBPROC BindProgramARB = __glGetProcAddress("glBindProgramARB"); BindProgramARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } int __glXDisp_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) { PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB = __glGetProcAddress("glDeleteProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); DeleteProgramsARB(n, (const GLuint *) (pc + 4)); error = Success; } return error; } int __glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGENPROGRAMSARBPROC GenProgramsARB = __glGetProcAddress("glGenProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLuint answerBuffer[200]; GLuint *programs = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (programs == NULL) return BadAlloc; GenProgramsARB(n, programs); __glXSendReply(cl->client, programs, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDisp_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB = __glGetProcAddress("glGetProgramEnvParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLdouble params[4]; GetProgramEnvParameterdvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB = __glGetProcAddress("glGetProgramEnvParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLfloat params[4]; GetProgramEnvParameterfvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB = __glGetProcAddress("glGetProgramLocalParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLdouble params[4]; GetProgramLocalParameterdvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB = __glGetProcAddress("glGetProgramLocalParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLfloat params[4]; GetProgramLocalParameterfvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) { PFNGLGETPROGRAMIVARBPROC GetProgramivARB = __glGetProcAddress("glGetProgramivARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLenum pname = *(GLenum *) (pc + 4); const GLuint compsize = __glGetProgramivARB_size(pname); GLint answerBuffer[200]; GLint *params = __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, sizeof(answerBuffer), 4); if (params == NULL) return BadAlloc; __glXClearErrorOccured(); GetProgramivARB(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_IsProgramARB(__GLXclientState * cl, GLbyte * pc) { PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsProgramARB(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc) { PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB = __glGetProcAddress("glProgramEnvParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); pc -= 4; } #endif ProgramEnvParameter4dvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), (const GLdouble *) (pc + 8)); } void __glXDisp_ProgramEnvParameter4fvARB(GLbyte * pc) { PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB = __glGetProcAddress("glProgramEnvParameter4fvARB"); ProgramEnvParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), (const GLfloat *) (pc + 8)); } void __glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc) { PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB = __glGetProcAddress("glProgramLocalParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); pc -= 4; } #endif ProgramLocalParameter4dvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), (const GLdouble *) (pc + 8)); } void __glXDisp_ProgramLocalParameter4fvARB(GLbyte * pc) { PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB = __glGetProcAddress("glProgramLocalParameter4fvARB"); ProgramLocalParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), (const GLfloat *) (pc + 8)); } void __glXDisp_ProgramStringARB(GLbyte * pc) { PFNGLPROGRAMSTRINGARBPROC ProgramStringARB = __glGetProcAddress("glProgramStringARB"); const GLsizei len = *(GLsizei *) (pc + 8); ProgramStringARB(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), len, (const GLvoid *) (pc + 12)); } void __glXDisp_VertexAttrib1fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB = __glGetProcAddress("glVertexAttrib1fvARB"); VertexAttrib1fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib2fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB = __glGetProcAddress("glVertexAttrib2fvARB"); VertexAttrib2fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib3fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB = __glGetProcAddress("glVertexAttrib3fvARB"); VertexAttrib3fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib4fvARB(GLbyte * pc) { PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB = __glGetProcAddress("glVertexAttrib4fvARB"); VertexAttrib4fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_BindFramebuffer(GLbyte * pc) { PFNGLBINDFRAMEBUFFERPROC BindFramebuffer = __glGetProcAddress("glBindFramebuffer"); BindFramebuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } void __glXDisp_BindRenderbuffer(GLbyte * pc) { PFNGLBINDRENDERBUFFERPROC BindRenderbuffer = __glGetProcAddress("glBindRenderbuffer"); BindRenderbuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } void __glXDisp_BlitFramebuffer(GLbyte * pc) { PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer = __glGetProcAddress("glBlitFramebuffer"); BlitFramebuffer(*(GLint *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16), *(GLint *) (pc + 20), *(GLint *) (pc + 24), *(GLint *) (pc + 28), *(GLbitfield *) (pc + 32), *(GLenum *) (pc + 36)); } int __glXDisp_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) { PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus = __glGetProcAddress("glCheckFramebufferStatus"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLenum retval; retval = CheckFramebufferStatus(*(GLenum *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDisp_DeleteFramebuffers(GLbyte * pc) { PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers = __glGetProcAddress("glDeleteFramebuffers"); const GLsizei n = *(GLsizei *) (pc + 0); DeleteFramebuffers(n, (const GLuint *) (pc + 4)); } void __glXDisp_DeleteRenderbuffers(GLbyte * pc) { PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers = __glGetProcAddress("glDeleteRenderbuffers"); const GLsizei n = *(GLsizei *) (pc + 0); DeleteRenderbuffers(n, (const GLuint *) (pc + 4)); } void __glXDisp_FramebufferRenderbuffer(GLbyte * pc) { PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer = __glGetProcAddress("glFramebufferRenderbuffer"); FramebufferRenderbuffer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), *(GLuint *) (pc + 12)); } void __glXDisp_FramebufferTexture1D(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D = __glGetProcAddress("glFramebufferTexture1D"); FramebufferTexture1D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), *(GLint *) (pc + 16)); } void __glXDisp_FramebufferTexture2D(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D = __glGetProcAddress("glFramebufferTexture2D"); FramebufferTexture2D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), *(GLint *) (pc + 16)); } void __glXDisp_FramebufferTexture3D(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D = __glGetProcAddress("glFramebufferTexture3D"); FramebufferTexture3D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), *(GLint *) (pc + 16), *(GLint *) (pc + 20)); } void __glXDisp_FramebufferTextureLayer(GLbyte * pc) { PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer = __glGetProcAddress("glFramebufferTextureLayer"); FramebufferTextureLayer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLuint *) (pc + 8), *(GLint *) (pc + 12), *(GLint *) (pc + 16)); } int __glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) { PFNGLGENFRAMEBUFFERSPROC GenFramebuffers = __glGetProcAddress("glGenFramebuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLuint answerBuffer[200]; GLuint *framebuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (framebuffers == NULL) return BadAlloc; GenFramebuffers(n, framebuffers); __glXSendReply(cl->client, framebuffers, n, 4, GL_TRUE, 0); error = Success; } return error; } int __glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) { PFNGLGENRENDERBUFFERSPROC GenRenderbuffers = __glGetProcAddress("glGenRenderbuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); GLuint answerBuffer[200]; GLuint *renderbuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); if (renderbuffers == NULL) return BadAlloc; GenRenderbuffers(n, renderbuffers); __glXSendReply(cl->client, renderbuffers, n, 4, GL_TRUE, 0); error = Success; } return error; } void __glXDisp_GenerateMipmap(GLbyte * pc) { PFNGLGENERATEMIPMAPPROC GenerateMipmap = __glGetProcAddress("glGenerateMipmap"); GenerateMipmap(*(GLenum *) (pc + 0)); } int __glXDisp_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv = __glGetProcAddress("glGetFramebufferAttachmentParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLint params[1]; GetFramebufferAttachmentParameteriv(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLenum *) (pc + 8), params); __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) { PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv = __glGetProcAddress("glGetRenderbufferParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLint params[1]; GetRenderbufferParameteriv(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), params); __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; } return error; } int __glXDisp_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) { PFNGLISFRAMEBUFFERPROC IsFramebuffer = __glGetProcAddress("glIsFramebuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsFramebuffer(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } int __glXDisp_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) { PFNGLISRENDERBUFFERPROC IsRenderbuffer = __glGetProcAddress("glIsRenderbuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); pc += __GLX_VENDPRIV_HDR_SIZE; if (cx != NULL) { GLboolean retval; retval = IsRenderbuffer(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } return error; } void __glXDisp_RenderbufferStorage(GLbyte * pc) { PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage = __glGetProcAddress("glRenderbufferStorage"); RenderbufferStorage(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); } void __glXDisp_RenderbufferStorageMultisample(GLbyte * pc) { PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample = __glGetProcAddress("glRenderbufferStorageMultisample"); RenderbufferStorageMultisample(*(GLenum *) (pc + 0), *(GLsizei *) (pc + 4), *(GLenum *) (pc + 8), *(GLsizei *) (pc + 12), *(GLsizei *) (pc + 16)); } void __glXDisp_SecondaryColor3fvEXT(GLbyte * pc) { PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT = __glGetProcAddress("glSecondaryColor3fvEXT"); SecondaryColor3fvEXT((const GLfloat *) (pc + 0)); } void __glXDisp_FogCoordfvEXT(GLbyte * pc) { PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT = __glGetProcAddress("glFogCoordfvEXT"); FogCoordfvEXT((const GLfloat *) (pc + 0)); } void __glXDisp_VertexAttrib1dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV = __glGetProcAddress("glVertexAttrib1dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); pc -= 4; } #endif VertexAttrib1dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib1fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV = __glGetProcAddress("glVertexAttrib1fvNV"); VertexAttrib1fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib1svNV(GLbyte * pc) { PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV = __glGetProcAddress("glVertexAttrib1svNV"); VertexAttrib1svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib2dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV = __glGetProcAddress("glVertexAttrib2dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); pc -= 4; } #endif VertexAttrib2dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib2fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV = __glGetProcAddress("glVertexAttrib2fvNV"); VertexAttrib2fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib2svNV(GLbyte * pc) { PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV = __glGetProcAddress("glVertexAttrib2svNV"); VertexAttrib2svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib3dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV = __glGetProcAddress("glVertexAttrib3dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); pc -= 4; } #endif VertexAttrib3dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib3fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV = __glGetProcAddress("glVertexAttrib3fvNV"); VertexAttrib3fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib3svNV(GLbyte * pc) { PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV = __glGetProcAddress("glVertexAttrib3svNV"); VertexAttrib3svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4dvNV(GLbyte * pc) { PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV = __glGetProcAddress("glVertexAttrib4dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); pc -= 4; } #endif VertexAttrib4dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib4fvNV(GLbyte * pc) { PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV = __glGetProcAddress("glVertexAttrib4fvNV"); VertexAttrib4fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib4svNV(GLbyte * pc) { PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV = __glGetProcAddress("glVertexAttrib4svNV"); VertexAttrib4svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4ubvNV(GLbyte * pc) { PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV = __glGetProcAddress("glVertexAttrib4ubvNV"); VertexAttrib4ubvNV(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); } void __glXDisp_VertexAttribs1dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV = __glGetProcAddress("glVertexAttribs1dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 8)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs1dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs1fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV = __glGetProcAddress("glVertexAttribs1fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs1fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs1svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV = __glGetProcAddress("glVertexAttribs1svNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs1svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs2dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV = __glGetProcAddress("glVertexAttribs2dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 16)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs2dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs2fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV = __glGetProcAddress("glVertexAttribs2fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs2fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs2svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV = __glGetProcAddress("glVertexAttribs2svNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs2svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs3dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV = __glGetProcAddress("glVertexAttribs3dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 24)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs3dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs3fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV = __glGetProcAddress("glVertexAttribs3fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs3fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs3svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV = __glGetProcAddress("glVertexAttribs3svNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs3svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs4dvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV = __glGetProcAddress("glVertexAttribs4dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 const GLuint cmdlen = 12 + __GLX_PAD((n * 32)) - 4; if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, cmdlen); pc -= 4; } #endif VertexAttribs4dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs4fvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV = __glGetProcAddress("glVertexAttribs4fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs4fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs4svNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV = __glGetProcAddress("glVertexAttribs4svNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs4svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc) { PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV = __glGetProcAddress("glVertexAttribs4ubvNV"); const GLsizei n = *(GLsizei *) (pc + 4); VertexAttribs4ubvNV(*(GLuint *) (pc + 0), n, (const GLubyte *) (pc + 8)); } void __glXDisp_ActiveStencilFaceEXT(GLbyte * pc) { PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT = __glGetProcAddress("glActiveStencilFaceEXT"); ActiveStencilFaceEXT(*(GLenum *) (pc + 0)); } xorg-server-1.17.1/glx/render2swap.c0000664000175100017510000002575112274325511014217 00000000000000/* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include "glxserver.h" #include "unpack.h" #include "indirect_size.h" #include "indirect_dispatch.h" void __glXDispSwap_Map1f(GLbyte * pc) { GLint order, k; GLfloat u1, u2, *points; GLenum target; GLint compsize; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 12); __GLX_SWAP_FLOAT(pc + 4); __GLX_SWAP_FLOAT(pc + 8); target = *(GLenum *) (pc + 0); order = *(GLint *) (pc + 12); u1 = *(GLfloat *) (pc + 4); u2 = *(GLfloat *) (pc + 8); points = (GLfloat *) (pc + 16); k = __glMap1f_size(target); if (order <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; } else { compsize = order * k; } __GLX_SWAP_FLOAT_ARRAY(points, compsize); glMap1f(target, u1, u2, k, order, points); } void __glXDispSwap_Map2f(GLbyte * pc) { GLint uorder, vorder, ustride, vstride, k; GLfloat u1, u2, v1, v2, *points; GLenum target; GLint compsize; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 12); __GLX_SWAP_INT(pc + 24); __GLX_SWAP_FLOAT(pc + 4); __GLX_SWAP_FLOAT(pc + 8); __GLX_SWAP_FLOAT(pc + 16); __GLX_SWAP_FLOAT(pc + 20); target = *(GLenum *) (pc + 0); uorder = *(GLint *) (pc + 12); vorder = *(GLint *) (pc + 24); u1 = *(GLfloat *) (pc + 4); u2 = *(GLfloat *) (pc + 8); v1 = *(GLfloat *) (pc + 16); v2 = *(GLfloat *) (pc + 20); points = (GLfloat *) (pc + 28); k = __glMap2f_size(target); ustride = vorder * k; vstride = k; if (vorder <= 0 || uorder <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; } else { compsize = uorder * vorder * k; } __GLX_SWAP_FLOAT_ARRAY(points, compsize); glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); } void __glXDispSwap_Map1d(GLbyte * pc) { GLint order, k, compsize; GLenum target; GLdouble u1, u2, *points; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_DOUBLE(pc + 0); __GLX_SWAP_DOUBLE(pc + 8); __GLX_SWAP_INT(pc + 16); __GLX_SWAP_INT(pc + 20); target = *(GLenum *) (pc + 16); order = *(GLint *) (pc + 20); k = __glMap1d_size(target); if (order <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; } else { compsize = order * k; } __GLX_GET_DOUBLE(u1, pc); __GLX_GET_DOUBLE(u2, pc + 8); __GLX_SWAP_DOUBLE_ARRAY(pc + 24, compsize); pc += 24; #ifdef __GLX_ALIGN64 if (((unsigned long) pc) & 7) { /* ** Copy the doubles up 4 bytes, trashing the command but aligning ** the data in the process */ __GLX_MEM_COPY(pc - 4, pc, compsize * 8); points = (GLdouble *) (pc - 4); } else { points = (GLdouble *) pc; } #else points = (GLdouble *) pc; #endif glMap1d(target, u1, u2, k, order, points); } void __glXDispSwap_Map2d(GLbyte * pc) { GLdouble u1, u2, v1, v2, *points; GLint uorder, vorder, ustride, vstride, k, compsize; GLenum target; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_DOUBLE(pc + 0); __GLX_SWAP_DOUBLE(pc + 8); __GLX_SWAP_DOUBLE(pc + 16); __GLX_SWAP_DOUBLE(pc + 24); __GLX_SWAP_INT(pc + 32); __GLX_SWAP_INT(pc + 36); __GLX_SWAP_INT(pc + 40); target = *(GLenum *) (pc + 32); uorder = *(GLint *) (pc + 36); vorder = *(GLint *) (pc + 40); k = __glMap2d_size(target); if (vorder <= 0 || uorder <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; } else { compsize = uorder * vorder * k; } __GLX_GET_DOUBLE(u1, pc); __GLX_GET_DOUBLE(u2, pc + 8); __GLX_GET_DOUBLE(v1, pc + 16); __GLX_GET_DOUBLE(v2, pc + 24); __GLX_SWAP_DOUBLE_ARRAY(pc + 44, compsize); pc += 44; ustride = vorder * k; vstride = k; #ifdef __GLX_ALIGN64 if (((unsigned long) pc) & 7) { /* ** Copy the doubles up 4 bytes, trashing the command but aligning ** the data in the process */ __GLX_MEM_COPY(pc - 4, pc, compsize * 8); points = (GLdouble *) (pc - 4); } else { points = (GLdouble *) pc; } #else points = (GLdouble *) pc; #endif glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); } static void swapArray(GLint numVals, GLenum datatype, GLint stride, GLint numVertexes, GLbyte * pc) { int i, j; __GLX_DECLARE_SWAP_VARIABLES; switch (datatype) { case GL_BYTE: case GL_UNSIGNED_BYTE: /* don't need to swap */ return; case GL_SHORT: case GL_UNSIGNED_SHORT: for (i = 0; i < numVertexes; i++) { GLshort *pVal = (GLshort *) pc; for (j = 0; j < numVals; j++) { __GLX_SWAP_SHORT(&pVal[j]); } pc += stride; } break; case GL_INT: case GL_UNSIGNED_INT: for (i = 0; i < numVertexes; i++) { GLint *pVal = (GLint *) pc; for (j = 0; j < numVals; j++) { __GLX_SWAP_INT(&pVal[j]); } pc += stride; } break; case GL_FLOAT: for (i = 0; i < numVertexes; i++) { GLfloat *pVal = (GLfloat *) pc; for (j = 0; j < numVals; j++) { __GLX_SWAP_FLOAT(&pVal[j]); } pc += stride; } break; case GL_DOUBLE: for (i = 0; i < numVertexes; i++) { GLdouble *pVal = (GLdouble *) pc; for (j = 0; j < numVals; j++) { __GLX_SWAP_DOUBLE(&pVal[j]); } pc += stride; } break; default: return; } } void __glXDispSwap_DrawArrays(GLbyte * pc) { __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc; __GLXdispatchDrawArraysComponentHeader *compHeader; GLint numVertexes = hdr->numVertexes; GLint numComponents = hdr->numComponents; GLenum primType = hdr->primType; GLint stride = 0; int i; __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_INT(&numVertexes); __GLX_SWAP_INT(&numComponents); __GLX_SWAP_INT(&primType); pc += sizeof(__GLXdispatchDrawArraysHeader); compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; /* compute stride (same for all component arrays) */ for (i = 0; i < numComponents; i++) { GLenum datatype = compHeader[i].datatype; GLint numVals = compHeader[i].numVals; GLenum component = compHeader[i].component; __GLX_SWAP_INT(&datatype); __GLX_SWAP_INT(&numVals); __GLX_SWAP_INT(&component); stride += __GLX_PAD(numVals * __glXTypeSize(datatype)); } pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader); /* set up component arrays */ for (i = 0; i < numComponents; i++) { GLenum datatype = compHeader[i].datatype; GLint numVals = compHeader[i].numVals; GLenum component = compHeader[i].component; __GLX_SWAP_INT(&datatype); __GLX_SWAP_INT(&numVals); __GLX_SWAP_INT(&component); swapArray(numVals, datatype, stride, numVertexes, pc); switch (component) { case GL_VERTEX_ARRAY: glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(numVals, datatype, stride, pc); break; case GL_NORMAL_ARRAY: glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(datatype, stride, pc); break; case GL_COLOR_ARRAY: glEnableClientState(GL_COLOR_ARRAY); glColorPointer(numVals, datatype, stride, pc); break; case GL_INDEX_ARRAY: glEnableClientState(GL_INDEX_ARRAY); glIndexPointer(datatype, stride, pc); break; case GL_TEXTURE_COORD_ARRAY: glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(numVals, datatype, stride, pc); break; case GL_EDGE_FLAG_ARRAY: glEnableClientState(GL_EDGE_FLAG_ARRAY); glEdgeFlagPointer(stride, (const GLboolean *) pc); break; case GL_SECONDARY_COLOR_ARRAY: { PFNGLSECONDARYCOLORPOINTERPROC SecondaryColorPointerEXT = __glGetProcAddress("glSecondaryColorPointerEXT"); glEnableClientState(GL_SECONDARY_COLOR_ARRAY); SecondaryColorPointerEXT(numVals, datatype, stride, pc); break; } case GL_FOG_COORD_ARRAY: { PFNGLFOGCOORDPOINTERPROC FogCoordPointerEXT = __glGetProcAddress("glFogCoordPointerEXT"); glEnableClientState(GL_FOG_COORD_ARRAY); FogCoordPointerEXT(datatype, stride, pc); break; } default: break; } pc += __GLX_PAD(numVals * __glXTypeSize(datatype)); } glDrawArrays(primType, 0, numVertexes); /* turn off anything we might have turned on */ glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_INDEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_EDGE_FLAG_ARRAY); glDisableClientState(GL_SECONDARY_COLOR_ARRAY); glDisableClientState(GL_FOG_COORD_ARRAY); } xorg-server-1.17.1/COPYING0000664000175100017510000027107712406661137012070 00000000000000The following is the 'standard copyright' agreed upon by most contributors, and is currently the canonical license preferred by the X.Org Foundation. This is a slight variant of the common MIT license form published by the Open Source Initiative at http://www.opensource.org/licenses/mit-license.php Copyright holders of new code should use this license statement where possible, and insert their name to this list. Please sort by surname for people, and by the full name for other entities (e.g. Juliusz Chroboczek sorts before Intel Corporation sorts before Daniel Stone). Copyright © 2011 Dave Airlie Copyright © 2000-2001 Juliusz Chroboczek Copyright © 1998 Egbert Eich Copyright © 2006-2007 Intel Corporation Copyright © 2006 Nokia Corporation Copyright © 2006-2008 Peter Hutterer Copyright © 2006 Adam Jackson Copyright © 2009-2010 NVIDIA Corporation Copyright © 1987, 2003-2006, 2008-2010 Oracle and/or its affiliates. Copyright © 1999 Keith Packard Copyright © 2007-2009 Red Hat, Inc. Copyright © 2005-2008 Daniel Stone Copyright © 2006-2009 Simon Thum Copyright © 2003-2008, 2013 Geert Uytterhoeven Copyright © 2006 Luc Verhaegen 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. The following licenses are 'legacy': usually MIT/X11 licenses with the name of the copyright holder(s) in the license statement, but also some BSD-like licenses. Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) Colin Harrison 2005-2008 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. Copyright 1997 by 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 the XFree86 Project, Inc. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Xfree86 Project, Inc. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI 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. Copyright 1985-1998, 2001 The Open Group Copyright 2002 Red Hat Inc., Durham, North Carolina. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright (c) 1987, 1989-1990, 1992-1995 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. 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 TUNGSTEN GRAPHICS 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. Copyright © 1999-2000 SuSE, Inc. Copyright © 2007 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 SuSE not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. SuSE makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE 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. Copyright 1987-1991, 1993 by Digital Equipment Corporation, Maynard, Massachusetts. Copyright 1991 Massachusetts Institute of Technology, Cambridge, Massachusetts. Copyright 1991, 1993 Olivetti Research Limited, Cambridge, England. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, Copyright 1994 Quarterdeck Office Systems. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital and Quarterdeck not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL 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. Copyright 1997 Digital Equipment Corporation. All rights reserved. This software is furnished under license and may be used and copied only in accordance with the following terms and conditions. Subject to these conditions, you may download, copy, install, use, modify and distribute this software in source and/or binary form. No title or ownership is transferred hereby. 1) Any source code used, modified or distributed must reproduce and retain this copyright notice and list of conditions as they appear in the source file. 2) No right is granted to use any trade name, trademark, or logo of Digital Equipment Corporation. Neither the "Digital Equipment Corporation" name nor any trademark or logo of Digital Equipment Corporation may be used to endorse or promote products derived from this software without the prior written permission of Digital Equipment Corporation. 3) This software is provided "AS-IS" and any express or implied warranties, including but not limited to, any implied warranties of merchantability, fitness for a particular purpose, or non-infringement are disclaimed. In no event shall DIGITAL be liable for any damages whatsoever, and in particular, DIGITAL shall not be liable for special, indirect, consequential, or incidental damages or damages for lost profits, loss of revenue or loss of use, whether such damages arise in contract, negligence, tort, under statute, in equity, at law or otherwise, even if advised of the possibility of such damage. Copyright (c) 1991, 1996-1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice including the dates of first publication and either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright (c) 1994, 1995 Hewlett-Packard Company 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard Company 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 Hewlett-Packard Company. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. Copyright (c) 2003 by the XFree86 Project, Inc. Copyright 2004-2005 Red Hat Inc., Raleigh, North Carolina. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation on the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright © 2008 Red Hat, Inc. Partly based on code Copyright © 2000 SuSE, 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 Red Hat not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Red Hat makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. Red Hat DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Red Hat 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. 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 SuSE not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. SuSE makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE 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. Copyright © 2006 Red Hat, Inc. (C) Copyright 1998-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 RED HAT, INC, OR PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright (c) 1995 X Consortium Copyright 2004 Red Hat Inc., Durham, North Carolina. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation on the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT, THE X CONSORTIUM, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. Copyright 1998-2000 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. Copyright (c) 2002, 2008, 2009 Apple Computer, Inc. Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), 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. (C) Copyright IBM Corporation 2003 All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation on the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. (C) Copyright IBM Corporation 2004-2005 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 IBM, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright (c) 1997 Metro Link Incorporated 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the Metro Link shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Metro Link. Copyright 1995-1998 by Metro Link, Inc. 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 Metro Link, Inc. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Metro Link, Inc. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL METRO LINK, INC. 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. Copyright 1998 by Metro Link Incorporated 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 Metro Link Incorporated not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Metro Link Incorporated makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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. Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com) 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 CONECTIVA LINUX 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 Conectiva Linux shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Conectiva Linux. Copyright (c) 2001, Andy Ritger aritger@nvidia.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: o Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. o 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. o Neither the name of NVIDIA 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 COPYRIGHT HOLDERS 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. Copyright 1992 Vrije Universiteit, The Netherlands 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 the Vrije Universiteit not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Vrije Universiteit makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL The Vrije Universiteit 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. Copyright 1998 by Concurrent Computer Corporation 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 Concurrent Computer Corporation not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Concurrent Computer Corporation makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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. Copyright © 2004 Nokia 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 Nokia not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Nokia makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NOKIA 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. (c)Copyright 1988,1991 Adobe Systems Incorporated. All rights reserved. Permission to use, copy, modify, distribute, and sublicense this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notices appear in all copies and that both those copyright notices and this permission notice appear in supporting documentation and that the name of Adobe Systems Incorporated not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. No trademark license to use the Adobe trademarks is hereby granted. If the Adobe trademark "Display PostScript"(tm) is used to describe this software, its functionality or for any other purpose, such use shall be limited to a statement that this software works in conjunction with the Display PostScript system. Proper trademark attribution to reflect Adobe's ownership of the trademark shall be given whenever any such reference to the Display PostScript system is made. ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE. Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems Incorporated which may be registered in certain jurisdictions. Copyright 1989 Network Computing Devices, Inc., Mountain View, 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 and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of N.C.D. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. N.C.D. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. 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. Copyright 1992, 1993 Data General Corporation; Copyright 1992, 1993 OMRON Corporation 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 neither the name OMRON or DATA GENERAL be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission of the party whose name is to be used. Neither OMRON or DATA GENERAL make any representation about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OMRON OR DATA GENERAL 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. Copyright © 1998-2004, 2006 Keith Packard Copyright © 2000-2002 Keith Packard, member of The XFree86 Project, Inc. Copyright (c) 2002 Apple Computer, Inc. Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. 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. Copyright © 1999 Keith Packard Copyright © 2000 Compaq Computer Corporation Copyright © 2002 MontaVista Software Inc. Copyright © 2005 OpenedHand Ltd. Copyright © 2006 Nokia Corporation 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 authors and/or copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The authors and/or 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 AUTHORS AND/OR COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS AND/OR 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. Copyright 1993 by Davor Matic 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. Davor Matic makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. Copyright (C) Colin Harrison 2005-2008 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 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. Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. 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 Thomas Roell not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Thomas Roell makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELL 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. Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany Copyright 1993 by David Wexelblat 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 names of Thomas Roell and David Wexelblat not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Thomas Roell and David Wexelblat makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THOMAS ROELL AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELL 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. Copyright 1990,91,92,93 by Thomas Roell, Germany. Copyright 1991,92,93 by SGCS (Snitily Graphics Consulting Services), USA. 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 Thomas Roell nor SGCS be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Thomas Roell nor SGCS makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THOMAS ROELL AND SGCS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELL OR SGCS 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. Copyright 1998 by Alan Hourihane, Wigan, England. Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales. 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 Alan Hourihane not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Alan Hourihane makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ALAN HOURIHANE 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. Copyright 1995 Kaleb S. KEITHLEY 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 Kaleb S. KEITHLEY 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 Kaleb S. KEITHLEY shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Kaleb S. KEITHLEY 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. Copyright 2004, Egbert Eich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL EGBERT EICH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Egbert Eich shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from Egbert Eich. Copyright 1993 by David Wexelblat Copyright 2005 by Kean Johnston Copyright 1993 by David McCullough 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 David Wexelblat not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. David Wexelblat makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 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. Copyright 1992 by Orest Zborowski Copyright 1993 by David Wexelblat 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 names of Orest Zborowski and David Wexelblat not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Orest Zborowski and David Wexelblat make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. OREST ZBOROWSKI AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI 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. Copyright 1992 by Orest Zborowski Copyright 1993 by David Dawes 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 names of Orest Zborowski and David Dawes not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Orest Zborowski and David Dawes make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES 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. 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 copyright notice and this permission notice appear in supporting documentation, and that the name of Frederic Lepied not be used in 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. 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 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. Copyright 1992 by Rich Murphey Copyright 1993 by David Wexelblat 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 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 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 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright 1992 by Rich Murphey Copyright 1993 by David Dawes 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 names of Rich Murphey and David Dawes not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Rich Murphey and David Dawes 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 DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID DAWES 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. Copyright © 2003-2004 Anders Carlsson 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 Anders Carlsson not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Anders Carlsson makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. ANDERS CARLSSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ANDERS CARLSSON 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. Copyright (C) 2003 Anders Carlsson Copyright © 2003-2004 Eric Anholt Copyright © 2004 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 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. Copyright (c) 1998 Todd C. Miller Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright © 2003-2004 Philip Blundell 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 Philip Blundell not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Philip Blundell makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL PHILIP BLUNDELL 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. Copyright (c) 1994-2003 by The XFree86 Project, Inc. Copyright 1997 by Metro Link, Inc. Copyright 2003 by David H. Dawes. Copyright 2003 by X-Oz Technologies. Copyright (c) 2004, X.Org Foundation 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). Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany Copyright 1993 by David Wexelblat Copyright 1999 by David Holland Copyright © 2000 Compaq Computer Corporation Copyright © 2002 Hewlett-Packard Company Copyright © 2004, 2005 Red Hat, Inc. Copyright © 2004 Nicholas Miell Copyright © 2005 Trolltech AS Copyright © 2006 Intel Corporation Copyright © 2006-2007 Keith Packard Copyright © 2008 Red Hat, Inc Copyright © 2008 George Sapountzis 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. Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. 2005 Lars Knoll & Zack Rusin, Trolltech 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. 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. Copyright 1987, 1998 The Open Group Copyright © 1998-1999, 2001 The XFree86 Project, Inc. Copyright © 2000 VA Linux Systems, Inc. Copyright (c) 2000, 2001 Nokia Home Communications Copyright © 2007, 2008 Red Hat, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. Copyright 1996 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright (c) 2001 Andreas Monitzer. Copyright (c) 2001-2004 Greg Parker. Copyright (c) 2001-2004 Torrey T. Lyons Copyright (c) 2002-2003 Apple Computer, Inc. Copyright (c) 2004-2005 Alexander Gottwald Copyright (c) 2002-2009 Apple Inc. Copyright (c) 2007 Jeremy Huddleston All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. Copyright (C) 1999,2000 by Eric Sunshine Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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. Copyright (C) 2005 Bogdan D. bogdand@users.sourceforge.net 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 AUTHOR 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 author 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 author. Copyright © 2002 David Dawes 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 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 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 author(s). Copyright (C) 1996-1999 SciTech Software, Inc. Copyright (C) David Mosberger-Tang Copyright (C) 1999 Egbert Eich Copyright (C) 2008 Bart Trojanowski, Symbio Technologies, LLC 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 authors not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The authors makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS 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. Copyright 2005-2006 Luc Verhaegen. 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. Copyright 1995 by Robin Cutshaw Copyright 2000 by Egbert Eich Copyright 2002 by David Dawes 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 names of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The above listed copyright holder(s) make(s) no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. Copyright 1997-2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org 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 Marc Aurele La France not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Marc Aurele La France makes no representations about the suitability of this software for any purpose. It is provided "as-is" without express or implied warranty. MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL MARC AURELE LA FRANCE 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. Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany Copyright 1992 by David Dawes Copyright 1992 by Jim Tsillas Copyright 1992 by Rich Murphey Copyright 1992 by Robert Baron Copyright 1992 by Orest Zborowski Copyright 1993 by Vrije Universiteit, The Netherlands Copyright 1993 by David Wexelblat Copyright 1994, 1996 by Holger Veit Copyright 1997 by Takis Psarogiannakopoulos Copyright 1994-2003 by 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 names of the above listed copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The above listed 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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. Copyright 2001-2005 by J. Kean Johnston 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 J. Kean Johnston not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. J. Kean Johnston makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL J. KEAN JOHNSTON 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. Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com) 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 JAKUB JELINEK 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 1997,1998 by UCHIYAMA Yasushi 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 UCHIYAMA Yasushi not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. UCHIYAMA Yasushi makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL UCHIYAMA YASUSHI 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. Copyright (C) 2000 Keith Packard 2004 Eric Anholt 2005 Zack Rusin 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 copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. 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. (C) Copyright IBM Corporation 2002-2007 All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation on the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that this permission notice appear in supporting documentation. 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 AUTHOR 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 © 2007 OpenedHand Ltd Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of OpenedHand Ltd not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. OpenedHand Ltd makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 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 Chris Torek. 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. 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. xorg-server-1.17.1/fb/0000775000175100017510000000000012466505443011471 500000000000000xorg-server-1.17.1/fb/Makefile.am0000664000175100017510000000143612432306326013441 00000000000000noinst_LTLIBRARIES = libfb.la libwfb.la AM_CFLAGS = $(DIX_CFLAGS) if XORG sdk_HEADERS = fb.h fbrop.h fboverlay.h wfbrename.h fbpict.h endif libfb_la_CFLAGS = $(AM_CFLAGS) libfb_la_LIBADD = $(PIXMAN_LIBS) libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libwfb_la_LIBADD = $(PIXMAN_LIBS) libfb_la_SOURCES = \ fb.h \ fb24_32.c \ fb24_32.h \ fballpriv.c \ fbarc.c \ fbbits.c \ fbbits.h \ fbblt.c \ fbbltone.c \ fbcmap_mi.c \ fbcopy.c \ fbfill.c \ fbfillrect.c \ fbfillsp.c \ fbgc.c \ fbgetsp.c \ fbglyph.c \ fbimage.c \ fbline.c \ fboverlay.c \ fboverlay.h \ fbpict.c \ fbpict.h \ fbpixmap.c \ fbpoint.c \ fbpush.c \ fbrop.h \ fbscreen.c \ fbseg.c \ fbsetsp.c \ fbsolid.c \ fbtrap.c \ fbutil.c \ fbwindow.c libwfb_la_SOURCES = $(libfb_la_SOURCES) xorg-server-1.17.1/fb/fboverlay.c0000664000175100017510000002757312456571574013573 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "fb.h" #include "fboverlay.h" #include "shmint.h" static DevPrivateKeyRec fbOverlayScreenPrivateKeyRec; #define fbOverlayScreenPrivateKey (&fbOverlayScreenPrivateKeyRec) DevPrivateKey fbOverlayGetScreenPrivateKey(void) { return fbOverlayScreenPrivateKey; } /* * Replace this if you want something supporting * multiple overlays with the same depth */ Bool fbOverlayCreateWindow(WindowPtr pWin) { FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pWin->drawable.pScreen); int i; PixmapPtr pPixmap; if (pWin->drawable.class != InputOutput) return TRUE; if (pWin->drawable.bitsPerPixel == 32) pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; 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(pWin), pPixmap); /* * Make sure layer keys are written correctly by * having non-root layers set to full while the * root layer is set to empty. This will cause * all of the layers to get painted when the root * is mapped */ if (!pWin->parent) { RegionEmpty(&pScrPriv->layer[i].u.run.region); } return TRUE; } } return FALSE; } Bool fbOverlayCloseScreen(ScreenPtr pScreen) { FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); int i; for (i = 0; i < pScrPriv->nlayers; i++) { (*pScreen->DestroyPixmap) (pScrPriv->layer[i].u.run.pixmap); RegionUninit(&pScrPriv->layer[i].u.run.region); } return TRUE; } /* * Return layer containing this window */ int fbOverlayWindowLayer(WindowPtr pWin) { FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pWin->drawable.pScreen); int i; for (i = 0; i < pScrPriv->nlayers; i++) if (dixLookupPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin)) == (void *) pScrPriv->layer[i].u.run.pixmap) return i; return 0; } Bool fbOverlayCreateScreenResources(ScreenPtr pScreen) { int i; FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); PixmapPtr pPixmap; void *pbits; int width; int depth; BoxRec box; if (!miCreateScreenResources(pScreen)) return FALSE; box.x1 = 0; box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; for (i = 0; i < pScrPriv->nlayers; i++) { pbits = pScrPriv->layer[i].u.init.pbits; width = pScrPriv->layer[i].u.init.width; depth = pScrPriv->layer[i].u.init.depth; pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, 0); if (!pPixmap) return FALSE; if (!(*pScreen->ModifyPixmapHeader) (pPixmap, pScreen->width, pScreen->height, depth, BitsPerPixel(depth), PixmapBytePad(width, depth), pbits)) return FALSE; pScrPriv->layer[i].u.run.pixmap = pPixmap; RegionInit(&pScrPriv->layer[i].u.run.region, &box, 0); } pScreen->devPrivate = pScrPriv->layer[0].u.run.pixmap; return TRUE; } void fbOverlayPaintKey(DrawablePtr pDrawable, RegionPtr pRegion, CARD32 pixel, int layer) { fbFillRegionSolid(pDrawable, pRegion, 0, fbReplicatePixel(pixel, pDrawable->bitsPerPixel)); } /* * Track visible region for each layer */ void fbOverlayUpdateLayerRegion(ScreenPtr pScreen, int layer, RegionPtr prgn) { FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); int i; RegionRec rgnNew; if (!prgn || !RegionNotEmpty(prgn)) return; for (i = 0; i < pScrPriv->nlayers; i++) { if (i == layer) { /* add new piece to this fb */ RegionUnion(&pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); } else if (RegionNotEmpty(&pScrPriv->layer[i].u.run.region)) { /* paint new piece with chroma key */ RegionNull(&rgnNew); RegionIntersect(&rgnNew, prgn, &pScrPriv->layer[i].u.run.region); (*pScrPriv->PaintKey) (&pScrPriv->layer[i].u.run.pixmap->drawable, &rgnNew, pScrPriv->layer[i].key, i); RegionUninit(&rgnNew); /* remove piece from other fbs */ RegionSubtract(&pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); } } } /* * Copy only areas in each layer containing real bits */ void fbOverlayCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWin->drawable.pScreen; FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); RegionRec rgnDst; int dx, dy; int i; RegionRec layerRgn[FB_OVERLAY_MAX]; PixmapPtr pPixmap; dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; /* * Clip to existing bits */ RegionTranslate(prgnSrc, -dx, -dy); RegionNull(&rgnDst); RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); RegionTranslate(&rgnDst, dx, dy); /* * Compute the portion of each fb affected by this copy */ for (i = 0; i < pScrPriv->nlayers; i++) { RegionNull(&layerRgn[i]); RegionIntersect(&layerRgn[i], &rgnDst, &pScrPriv->layer[i].u.run.region); if (RegionNotEmpty(&layerRgn[i])) { RegionTranslate(&layerRgn[i], -dx, -dy); pPixmap = pScrPriv->layer[i].u.run.pixmap; miCopyRegion(&pPixmap->drawable, &pPixmap->drawable, 0, &layerRgn[i], dx, dy, pScrPriv->CopyWindow, 0, (void *) (long) i); } } /* * Update regions */ for (i = 0; i < pScrPriv->nlayers; i++) { if (RegionNotEmpty(&layerRgn[i])) fbOverlayUpdateLayerRegion(pScreen, i, &layerRgn[i]); RegionUninit(&layerRgn[i]); } RegionUninit(&rgnDst); } void fbOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn) { fbOverlayUpdateLayerRegion(pWin->drawable.pScreen, fbOverlayWindowLayer(pWin), prgn); miWindowExposures(pWin, prgn); } Bool fbOverlaySetupScreen(ScreenPtr pScreen, void *pbits1, void *pbits2, int xsize, int ysize, int dpix, int dpiy, int width1, int width2, int bpp1, int bpp2) { return fbSetupScreen(pScreen, pbits1, xsize, ysize, dpix, dpiy, width1, bpp1); } static Bool fb24_32OverlayCreateScreenResources(ScreenPtr pScreen) { FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); int pitch; Bool retval; int i; if ((retval = fbOverlayCreateScreenResources(pScreen))) { for (i = 0; i < pScrPriv->nlayers; i++) { /* fix the screen pixmap */ PixmapPtr pPix = (PixmapPtr) pScrPriv->layer[i].u.run.pixmap; if (pPix->drawable.bitsPerPixel == 32) { pPix->drawable.bitsPerPixel = 24; pitch = BitmapBytePad(pPix->drawable.width * 24); pPix->devKind = pitch; } } } return retval; } Bool fbOverlayFinishScreenInit(ScreenPtr pScreen, void *pbits1, void *pbits2, int xsize, int ysize, int dpix, int dpiy, int width1, int width2, int bpp1, int bpp2, int depth1, int depth2) { VisualPtr visuals; DepthPtr depths; int nvisuals; int ndepths; int bpp = 0, imagebpp = 32; VisualID defaultVisual; FbOverlayScrPrivPtr pScrPriv; if (!dixRegisterPrivateKey (&fbOverlayScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; pScrPriv = malloc(sizeof(FbOverlayScrPrivRec)); if (!pScrPriv) return FALSE; if (bpp1 == 32 || bpp2 == 32) bpp = 32; else if (bpp1 == 24 || bpp2 == 24) bpp = 24; if (bpp == 24) { int f; imagebpp = 32; /* * Check to see if we're advertising a 24bpp image format, * in which case windows will use it in preference to a 32 bit * format. */ for (f = 0; f < screenInfo.numPixmapFormats; f++) { if (screenInfo.formats[f].bitsPerPixel == 24) { imagebpp = 24; break; } } } if (imagebpp == 32) { fbGetScreenPrivate(pScreen)->win32bpp = bpp; fbGetScreenPrivate(pScreen)->pix32bpp = bpp; } else { fbGetScreenPrivate(pScreen)->win32bpp = 32; fbGetScreenPrivate(pScreen)->pix32bpp = 32; } if (!fbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &depth1, &defaultVisual, ((unsigned long) 1 << (bpp1 - 1)) | ((unsigned long) 1 << (bpp2 - 1)), 8)) { free(pScrPriv); return FALSE; } if (!miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0, depth1, ndepths, depths, defaultVisual, nvisuals, visuals)) { free(pScrPriv); return FALSE; } /* MI thinks there's no frame buffer */ #ifdef MITSHM ShmRegisterFbFuncs(pScreen); #endif pScreen->minInstalledCmaps = 1; pScreen->maxInstalledCmaps = 2; pScrPriv->nlayers = 2; pScrPriv->PaintKey = fbOverlayPaintKey; pScrPriv->CopyWindow = fbCopyWindowProc; pScrPriv->layer[0].u.init.pbits = pbits1; pScrPriv->layer[0].u.init.width = width1; pScrPriv->layer[0].u.init.depth = depth1; pScrPriv->layer[1].u.init.pbits = pbits2; pScrPriv->layer[1].u.init.width = width2; pScrPriv->layer[1].u.init.depth = depth2; dixSetPrivate(&pScreen->devPrivates, fbOverlayScreenPrivateKey, pScrPriv); /* overwrite miCloseScreen with our own */ pScreen->CloseScreen = fbOverlayCloseScreen; pScreen->CreateScreenResources = fbOverlayCreateScreenResources; pScreen->CreateWindow = fbOverlayCreateWindow; pScreen->WindowExposures = fbOverlayWindowExposures; pScreen->CopyWindow = fbOverlayCopyWindow; if (bpp == 24 && imagebpp == 32) { pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; pScreen->CreateScreenResources = fb24_32OverlayCreateScreenResources; } return TRUE; } xorg-server-1.17.1/fb/wfbrename.h0000664000175100017510000001300712432306326013521 00000000000000#define fb24_32CopyMtoN wfb24_32CopyMtoN #define fb24_32CreateScreenResources wfb24_32CreateScreenResources #define fb24_32GetImage wfb24_32GetImage #define fb24_32GetSpans wfb24_32GetSpans #define fb24_32ModifyPixmapHeader wfb24_32ModifyPixmapHeader #define fb24_32PutZImage wfb24_32PutZImage #define fb24_32ReformatTile wfb24_32ReformatTile #define fb24_32SetSpans wfb24_32SetSpans #define fbAddTraps wfbAddTraps #define fbAddTriangles wfbAddTriangles #define fbAllocatePrivates wfbAllocatePrivates #define fbArc16 wfbArc16 #define fbArc24 wfbArc24 #define fbArc32 wfbArc32 #define fbArc8 wfbArc8 #define fbBlt wfbBlt #define fbBlt24 wfbBlt24 #define fbBltOne wfbBltOne #define fbBltOne24 wfbBltOne24 #define fbBltPlane wfbBltPlane #define fbBltStip wfbBltStip #define fbBres wfbBres #define fbBresDash wfbBresDash #define fbBresDash16 wfbBresDash16 #define fbBresDash24 wfbBresDash24 #define fbBresDash32 wfbBresDash32 #define fbBresDash8 wfbBresDash8 #define fbBresFill wfbBresFill #define fbBresFillDash wfbBresFillDash #define fbBresSolid wfbBresSolid #define fbBresSolid16 wfbBresSolid16 #define fbBresSolid24 wfbBresSolid24 #define fbBresSolid32 wfbBresSolid32 #define fbBresSolid8 wfbBresSolid8 #define fbChangeWindowAttributes wfbChangeWindowAttributes #define fbClearVisualTypes wfbClearVisualTypes #define fbCloseScreen wfbCloseScreen #define fbComposite wfbComposite #define fbCopy1toN wfbCopy1toN #define fbCopyArea wfbCopyArea #define fbCopyNto1 wfbCopyNto1 #define fbCopyNtoN wfbCopyNtoN #define fbCopyPlane wfbCopyPlane #define fbCopyRegion wfbCopyRegion #define fbCopyWindow wfbCopyWindow #define fbCopyWindowProc wfbCopyWindowProc #define fbCreateDefColormap wfbCreateDefColormap #define fbCreateGC wfbCreateGC #define fbCreatePixmap wfbCreatePixmap #define fbCreatePixmapBpp wfbCreatePixmapBpp #define fbCreateWindow wfbCreateWindow #define fbDestroyGlyphCache wfbDestroyGlyphCache #define fbDestroyPixmap wfbDestroyPixmap #define fbDestroyWindow wfbDestroyWindow #define fbDoCopy wfbDoCopy #define fbDots wfbDots #define fbDots16 wfbDots16 #define fbDots24 wfbDots24 #define fbDots32 wfbDots32 #define fbDots8 wfbDots8 #define fbExpandDirectColors wfbExpandDirectColors #define fbFill wfbFill #define fbFillRegionSolid wfbFillRegionSolid #define fbFillSpans wfbFillSpans #define fbFixCoordModePrevious wfbFixCoordModePrevious #define fbGCFuncs wfbGCFuncs #define fbGCOps wfbGCOps #define fbGeneration wfbGeneration #define fbGetImage wfbGetImage #define fbGetScreenPrivateKey wfbGetScreenPrivateKey #define fbGetSpans wfbGetSpans #define _fbGetWindowPixmap _wfbGetWindowPixmap #define fbGlyph16 wfbGlyph16 #define fbGlyph24 wfbGlyph24 #define fbGlyph32 wfbGlyph32 #define fbGlyph8 wfbGlyph8 #define fbHasVisualTypes wfbHasVisualTypes #define fbImageGlyphBlt wfbImageGlyphBlt #define fbIn wfbIn #define fbInitializeColormap wfbInitializeColormap #define fbInitVisuals wfbInitVisuals #define fbListInstalledColormaps wfbListInstalledColormaps #define FbMergeRopBits wFbMergeRopBits #define fbOver wfbOver #define fbOver24 wfbOver24 #define fbOverlayCloseScreen wfbOverlayCloseScreen #define fbOverlayCopyWindow wfbOverlayCopyWindow #define fbOverlayCreateScreenResources wfbOverlayCreateScreenResources #define fbOverlayCreateWindow wfbOverlayCreateWindow #define fbOverlayFinishScreenInit wfbOverlayFinishScreenInit #define fbOverlayGeneration wfbOverlayGeneration #define fbOverlayGetScreenPrivateKey wfbOverlayGetScreenPrivateKey #define fbOverlayPaintKey wfbOverlayPaintKey #define fbOverlaySetupScreen wfbOverlaySetupScreen #define fbOverlayUpdateLayerRegion wfbOverlayUpdateLayerRegion #define fbOverlayWindowExposures wfbOverlayWindowExposures #define fbOverlayWindowLayer wfbOverlayWindowLayer #define fbPadPixmap wfbPadPixmap #define fbPictureInit wfbPictureInit #define fbPixmapToRegion wfbPixmapToRegion #define fbPolyArc wfbPolyArc #define fbPolyFillRect wfbPolyFillRect #define fbPolyGlyphBlt wfbPolyGlyphBlt #define fbPolyLine wfbPolyLine #define fbPolyline16 wfbPolyline16 #define fbPolyline24 wfbPolyline24 #define fbPolyline32 wfbPolyline32 #define fbPolyline8 wfbPolyline8 #define fbPolyPoint wfbPolyPoint #define fbPolySegment wfbPolySegment #define fbPolySegment16 wfbPolySegment16 #define fbPolySegment24 wfbPolySegment24 #define fbPolySegment32 wfbPolySegment32 #define fbPolySegment8 wfbPolySegment8 #define fbPositionWindow wfbPositionWindow #define fbPushFill wfbPushFill #define fbPushImage wfbPushImage #define fbPushPattern wfbPushPattern #define fbPushPixels wfbPushPixels #define fbPutImage wfbPutImage #define fbPutXYImage wfbPutXYImage #define fbPutZImage wfbPutZImage #define fbQueryBestSize wfbQueryBestSize #define fbRasterizeTrapezoid wfbRasterizeTrapezoid #define fbRealizeFont wfbRealizeFont #define fbReplicatePixel wfbReplicatePixel #define fbResolveColor wfbResolveColor #define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec #define fbSegment wfbSegment #define fbSelectBres wfbSelectBres #define fbSetSpans wfbSetSpans #define fbSetupScreen wfbSetupScreen #define fbSetVisualTypes wfbSetVisualTypes #define fbSetVisualTypesAndMasks wfbSetVisualTypesAndMasks #define _fbSetWindowPixmap _wfbSetWindowPixmap #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles #define fbUninstallColormap wfbUninstallColormap #define fbUnrealizeWindow wfbUnrealizeWindow #define fbUnrealizeFont wfbUnrealizeFont #define fbValidateGC wfbValidateGC #define fbWinPrivateKeyRec wfbWinPrivateKeyRec #define free_pixman_pict wfb_free_pixman_pict #define image_from_pict wfb_image_from_pict xorg-server-1.17.1/fb/fbcmap_mi.c0000664000175100017510000000637712422276410013476 00000000000000/* * Copyright (c) 1987, Oracle and/or its affiliates. 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 (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. */ /** * This version of fbcmap.c is implemented in terms of mi functions. * These functions used to be in fbcmap.c and depended upon the symbol * XFree86Server being defined. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "fb.h" #include "micmap.h" int fbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps) { return miListInstalledColormaps(pScreen, pmaps); } void fbInstallColormap(ColormapPtr pmap) { miInstallColormap(pmap); } void fbUninstallColormap(ColormapPtr pmap) { miUninstallColormap(pmap); } void fbResolveColor(unsigned short *pred, unsigned short *pgreen, unsigned short *pblue, VisualPtr pVisual) { miResolveColor(pred, pgreen, pblue, pVisual); } Bool fbInitializeColormap(ColormapPtr pmap) { return miInitializeColormap(pmap); } int fbExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem * indefs, xColorItem * outdefs) { return miExpandDirectColors(pmap, ndef, indefs, outdefs); } Bool fbCreateDefColormap(ScreenPtr pScreen) { return miCreateDefColormap(pScreen); } void fbClearVisualTypes(void) { miClearVisualTypes(); } Bool fbSetVisualTypes(int depth, int visuals, int bitsPerRGB) { return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); } Bool fbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, Pixel redMask, Pixel greenMask, Pixel blueMask) { return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, -1, redMask, greenMask, blueMask); } /* * Given a list of formats for a screen, create a list * of visuals and depths for the screen which coorespond to * the set which can be used with this version of fb. */ Bool fbInitVisuals(VisualPtr * visualp, DepthPtr * depthp, int *nvisualp, int *ndepthp, int *rootDepthp, VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB) { return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp, sizes, bitsPerRGB, -1); } xorg-server-1.17.1/fb/fbbits.c0000664000175100017510000001041312432306326013015 00000000000000/* * Copyright © 1998 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 "fb.h" #include "miline.h" #include "mizerarc.h" #undef BRESSOLID #undef BRESDASH #undef DOTS #undef ARC #undef GLYPH #undef BITS #undef BITS2 #undef BITS4 #define BRESSOLID fbBresSolid8 #define BRESDASH fbBresDash8 #define DOTS fbDots8 #define ARC fbArc8 #define GLYPH fbGlyph8 #define POLYLINE fbPolyline8 #define POLYSEGMENT fbPolySegment8 #define BITS BYTE #define BITS2 CARD16 #define BITS4 CARD32 #include "fbbits.h" #undef BRESSOLID #undef BRESDASH #undef DOTS #undef ARC #undef GLYPH #undef POLYLINE #undef POLYSEGMENT #undef BITS #undef BITS2 #undef BITS4 #define BRESSOLID fbBresSolid16 #define BRESDASH fbBresDash16 #define DOTS fbDots16 #define ARC fbArc16 #define GLYPH fbGlyph16 #define POLYLINE fbPolyline16 #define POLYSEGMENT fbPolySegment16 #define BITS CARD16 #define BITS2 CARD32 #include "fbbits.h" #undef BRESSOLID #undef BRESDASH #undef DOTS #undef ARC #undef GLYPH #undef POLYLINE #undef POLYSEGMENT #undef BITS #undef BITS2 #define BRESSOLID fbBresSolid24 #define BRESDASH fbBresDash24 #define DOTS fbDots24 #define ARC fbArc24 #define POLYLINE fbPolyline24 #define POLYSEGMENT fbPolySegment24 #define BITS CARD32 #define BITSUNIT BYTE #define BITSMUL 3 #define FbDoTypeStore(b,t,x,s) WRITE(((t *) (b)), (x) >> (s)) #define FbDoTypeRRop(b,t,a,x,s) WRITE((t *) (b), FbDoRRop(READ((t *) (b)),\ (a) >> (s), \ (x) >> (s))) #define FbDoTypeMaskRRop(b,t,a,x,m,s) WRITE((t *) (b), FbDoMaskRRop(READ((t *) (b)),\ (a) >> (s), \ (x) >> (s), \ (m) >> (s))) #if BITMAP_BIT_ORDER == LSBFirst #define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \ (FbDoTypeStore (b, CARD8, x, 0), \ FbDoTypeStore ((b) + 1, CARD16, x, 8)) : \ (FbDoTypeStore (b, CARD16, x, 0), \ FbDoTypeStore ((b) + 2, CARD8, x, 16))) #define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \ (FbDoTypeRRop(b,CARD8,a,x,0), \ FbDoTypeRRop((b)+1,CARD16,a,x,8)) : \ (FbDoTypeRRop(b,CARD16,a,x,0), \ FbDoTypeRRop((b)+2,CARD8,a,x,16))) #else #define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \ (FbDoTypeStore (b, CARD8, x, 16), \ FbDoTypeStore ((b) + 1, CARD16, x, 0)) : \ (FbDoTypeStore (b, CARD16, x, 8), \ FbDoTypeStore ((b) + 2, CARD8, x, 0))) #define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \ (FbDoTypeRRop (b, CARD8, a, x, 16), \ FbDoTypeRRop ((b) + 1, CARD16, a, x, 0)) : \ (FbDoTypeRRop (b, CARD16, a, x, 8), \ FbDoTypeRRop ((b) + 2, CARD8, a, x, 0))) #endif #include "fbbits.h" #undef BITSSTORE #undef BITSRROP #undef BITSMUL #undef BITSUNIT #undef BITS #undef BRESSOLID #undef BRESDASH #undef DOTS #undef ARC #undef POLYLINE #undef POLYSEGMENT #define BRESSOLID fbBresSolid32 #define BRESDASH fbBresDash32 #define DOTS fbDots32 #define ARC fbArc32 #define GLYPH fbGlyph32 #define POLYLINE fbPolyline32 #define POLYSEGMENT fbPolySegment32 #define BITS CARD32 #include "fbbits.h" #undef BRESSOLID #undef BRESDASH #undef DOTS #undef ARC #undef GLYPH #undef POLYLINE #undef POLYSEGMENT #undef BITS xorg-server-1.17.1/fb/fboverlay.h0000664000175100017510000000672312456571574013572 00000000000000/* * * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifndef _FBOVERLAY_H_ #define _FBOVERLAY_H_ #include "privates.h" extern _X_EXPORT DevPrivateKey fbOverlayGetScreenPrivateKey(void); #ifndef FB_OVERLAY_MAX #define FB_OVERLAY_MAX 2 #endif typedef void (*fbOverlayPaintKeyProc) (DrawablePtr, RegionPtr, CARD32, int); typedef struct _fbOverlayLayer { union { struct { void *pbits; int width; int depth; } init; struct { PixmapPtr pixmap; RegionRec region; } run; } u; CARD32 key; /* special pixel value */ } FbOverlayLayer; typedef struct _fbOverlayScrPriv { int nlayers; fbOverlayPaintKeyProc PaintKey; miCopyProc CopyWindow; FbOverlayLayer layer[FB_OVERLAY_MAX]; } FbOverlayScrPrivRec, *FbOverlayScrPrivPtr; #define fbOverlayGetScrPriv(s) \ dixLookupPrivate(&(s)->devPrivates, fbOverlayGetScreenPrivateKey()) extern _X_EXPORT Bool fbOverlayCreateWindow(WindowPtr pWin); extern _X_EXPORT Bool fbOverlayCloseScreen(ScreenPtr pScreen); extern _X_EXPORT int fbOverlayWindowLayer(WindowPtr pWin); extern _X_EXPORT Bool fbOverlayCreateScreenResources(ScreenPtr pScreen); extern _X_EXPORT void fbOverlayPaintKey(DrawablePtr pDrawable, RegionPtr pRegion, CARD32 pixel, int layer); extern _X_EXPORT void fbOverlayUpdateLayerRegion(ScreenPtr pScreen, int layer, RegionPtr prgn); extern _X_EXPORT void fbOverlayCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); extern _X_EXPORT void fbOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn); extern _X_EXPORT Bool fbOverlaySetupScreen(ScreenPtr pScreen, void *pbits1, void *pbits2, int xsize, int ysize, int dpix, int dpiy, int width1, int width2, int bpp1, int bpp2); extern _X_EXPORT Bool fbOverlayFinishScreenInit(ScreenPtr pScreen, void *pbits1, void *pbits2, int xsize, int ysize, int dpix, int dpiy, int width1, int width2, int bpp1, int bpp2, int depth1, int depth2); #endif /* _FBOVERLAY_H_ */ xorg-server-1.17.1/fb/fbpoint.c0000664000175100017510000001064612432306326013215 00000000000000/* * Copyright © 1998 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 "fb.h" typedef void (*FbDots) (FbBits * dst, FbStride dstStride, int dstBpp, BoxPtr pBox, xPoint * pts, int npt, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); static void fbDots(FbBits * dstOrig, FbStride dstStride, int dstBpp, BoxPtr pBox, xPoint * pts, int npt, int xorg, int yorg, int xoff, int yoff, FbBits andOrig, FbBits xorOrig) { FbStip *dst = (FbStip *) dstOrig; int x1, y1, x2, y2; int x, y; FbStip *d; FbStip and = andOrig; FbStip xor = xorOrig; dstStride = FbBitsStrideToStipStride(dstStride); x1 = pBox->x1; y1 = pBox->y1; x2 = pBox->x2; y2 = pBox->y2; while (npt--) { x = pts->x + xorg; y = pts->y + yorg; pts++; if (x1 <= x && x < x2 && y1 <= y && y < y2) { x = (x + xoff) * dstBpp; d = dst + ((y + yoff) * dstStride) + (x >> FB_STIP_SHIFT); x &= FB_STIP_MASK; if (dstBpp == 24) { FbStip leftMask, rightMask; int n, rot; FbStip andT, xorT; rot = FbFirst24Rot(x); andT = FbRot24Stip(and, rot); xorT = FbRot24Stip(xor, rot); FbMaskStip(x, 24, leftMask, n, rightMask); if (leftMask) { WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, leftMask)); andT = FbNext24Stip(andT); xorT = FbNext24Stip(xorT); d++; } if (rightMask) WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); } else { FbStip mask; mask = FbStipMask(x, dstBpp); WRITE(d, FbDoMaskRRop(READ(d), and, xor, mask)); } } } } void fbPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nptInit, xPoint * pptInit) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); RegionPtr pClip = fbGetCompositeClip(pGC); FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbDots dots; FbBits and, xor; xPoint *ppt; int npt; BoxPtr pBox; int nBox; /* make pointlist origin relative */ ppt = pptInit; npt = nptInit; if (mode == CoordModePrevious) { npt--; while (npt--) { ppt++; ppt->x += (ppt - 1)->x; ppt->y += (ppt - 1)->y; } } fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); and = pPriv->and; xor = pPriv->xor; dots = fbDots; switch (dstBpp) { case 8: dots = fbDots8; break; case 16: dots = fbDots16; break; case 24: dots = fbDots24; break; case 32: dots = fbDots32; break; } for (nBox = RegionNumRects(pClip), pBox = RegionRects(pClip); nBox--; pBox++) (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit, pDrawable->x, pDrawable->y, dstXoff, dstYoff, and, xor); fbFinishAccess(pDrawable); } xorg-server-1.17.1/fb/fbbltone.c0000664000175100017510000005700512456571574013366 00000000000000/* * Copyright © 1998 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 "fb.h" /* * Stipple masks are independent of bit/byte order as long * as bitorder == byteorder. FB doesn't handle the case * where these differ */ #define BitsMask(x,w) ((FB_ALLONES << ((x) & FB_MASK)) & \ (FB_ALLONES >> ((FB_UNIT - ((x) + (w))) & FB_MASK))) #define Mask(x,w) BitsMask((x)*(w),(w)) #define SelMask(b,n,w) ((((b) >> n) & 1) * Mask(n,w)) #define C1(b,w) \ (SelMask(b,0,w)) #define C2(b,w) \ (SelMask(b,0,w) | \ SelMask(b,1,w)) #define C4(b,w) \ (SelMask(b,0,w) | \ SelMask(b,1,w) | \ SelMask(b,2,w) | \ SelMask(b,3,w)) #define C8(b,w) \ (SelMask(b,0,w) | \ SelMask(b,1,w) | \ SelMask(b,2,w) | \ SelMask(b,3,w) | \ SelMask(b,4,w) | \ SelMask(b,5,w) | \ SelMask(b,6,w) | \ SelMask(b,7,w)) static const FbBits fbStipple8Bits[256] = { C8(0, 4), C8(1, 4), C8(2, 4), C8(3, 4), C8(4, 4), C8(5, 4), C8(6, 4), C8(7, 4), C8(8, 4), C8(9, 4), C8(10, 4), C8(11, 4), C8(12, 4), C8(13, 4), C8(14, 4), C8(15, 4), C8(16, 4), C8(17, 4), C8(18, 4), C8(19, 4), C8(20, 4), C8(21, 4), C8(22, 4), C8(23, 4), C8(24, 4), C8(25, 4), C8(26, 4), C8(27, 4), C8(28, 4), C8(29, 4), C8(30, 4), C8(31, 4), C8(32, 4), C8(33, 4), C8(34, 4), C8(35, 4), C8(36, 4), C8(37, 4), C8(38, 4), C8(39, 4), C8(40, 4), C8(41, 4), C8(42, 4), C8(43, 4), C8(44, 4), C8(45, 4), C8(46, 4), C8(47, 4), C8(48, 4), C8(49, 4), C8(50, 4), C8(51, 4), C8(52, 4), C8(53, 4), C8(54, 4), C8(55, 4), C8(56, 4), C8(57, 4), C8(58, 4), C8(59, 4), C8(60, 4), C8(61, 4), C8(62, 4), C8(63, 4), C8(64, 4), C8(65, 4), C8(66, 4), C8(67, 4), C8(68, 4), C8(69, 4), C8(70, 4), C8(71, 4), C8(72, 4), C8(73, 4), C8(74, 4), C8(75, 4), C8(76, 4), C8(77, 4), C8(78, 4), C8(79, 4), C8(80, 4), C8(81, 4), C8(82, 4), C8(83, 4), C8(84, 4), C8(85, 4), C8(86, 4), C8(87, 4), C8(88, 4), C8(89, 4), C8(90, 4), C8(91, 4), C8(92, 4), C8(93, 4), C8(94, 4), C8(95, 4), C8(96, 4), C8(97, 4), C8(98, 4), C8(99, 4), C8(100, 4), C8(101, 4), C8(102, 4), C8(103, 4), C8(104, 4), C8(105, 4), C8(106, 4), C8(107, 4), C8(108, 4), C8(109, 4), C8(110, 4), C8(111, 4), C8(112, 4), C8(113, 4), C8(114, 4), C8(115, 4), C8(116, 4), C8(117, 4), C8(118, 4), C8(119, 4), C8(120, 4), C8(121, 4), C8(122, 4), C8(123, 4), C8(124, 4), C8(125, 4), C8(126, 4), C8(127, 4), C8(128, 4), C8(129, 4), C8(130, 4), C8(131, 4), C8(132, 4), C8(133, 4), C8(134, 4), C8(135, 4), C8(136, 4), C8(137, 4), C8(138, 4), C8(139, 4), C8(140, 4), C8(141, 4), C8(142, 4), C8(143, 4), C8(144, 4), C8(145, 4), C8(146, 4), C8(147, 4), C8(148, 4), C8(149, 4), C8(150, 4), C8(151, 4), C8(152, 4), C8(153, 4), C8(154, 4), C8(155, 4), C8(156, 4), C8(157, 4), C8(158, 4), C8(159, 4), C8(160, 4), C8(161, 4), C8(162, 4), C8(163, 4), C8(164, 4), C8(165, 4), C8(166, 4), C8(167, 4), C8(168, 4), C8(169, 4), C8(170, 4), C8(171, 4), C8(172, 4), C8(173, 4), C8(174, 4), C8(175, 4), C8(176, 4), C8(177, 4), C8(178, 4), C8(179, 4), C8(180, 4), C8(181, 4), C8(182, 4), C8(183, 4), C8(184, 4), C8(185, 4), C8(186, 4), C8(187, 4), C8(188, 4), C8(189, 4), C8(190, 4), C8(191, 4), C8(192, 4), C8(193, 4), C8(194, 4), C8(195, 4), C8(196, 4), C8(197, 4), C8(198, 4), C8(199, 4), C8(200, 4), C8(201, 4), C8(202, 4), C8(203, 4), C8(204, 4), C8(205, 4), C8(206, 4), C8(207, 4), C8(208, 4), C8(209, 4), C8(210, 4), C8(211, 4), C8(212, 4), C8(213, 4), C8(214, 4), C8(215, 4), C8(216, 4), C8(217, 4), C8(218, 4), C8(219, 4), C8(220, 4), C8(221, 4), C8(222, 4), C8(223, 4), C8(224, 4), C8(225, 4), C8(226, 4), C8(227, 4), C8(228, 4), C8(229, 4), C8(230, 4), C8(231, 4), C8(232, 4), C8(233, 4), C8(234, 4), C8(235, 4), C8(236, 4), C8(237, 4), C8(238, 4), C8(239, 4), C8(240, 4), C8(241, 4), C8(242, 4), C8(243, 4), C8(244, 4), C8(245, 4), C8(246, 4), C8(247, 4), C8(248, 4), C8(249, 4), C8(250, 4), C8(251, 4), C8(252, 4), C8(253, 4), C8(254, 4), C8(255, 4), }; static const FbBits fbStipple4Bits[16] = { C4(0, 8), C4(1, 8), C4(2, 8), C4(3, 8), C4(4, 8), C4(5, 8), C4(6, 8), C4(7, 8), C4(8, 8), C4(9, 8), C4(10, 8), C4(11, 8), C4(12, 8), C4(13, 8), C4(14, 8), C4(15, 8), }; static const FbBits fbStipple2Bits[4] = { C2(0, 16), C2(1, 16), C2(2, 16), C2(3, 16), }; static const FbBits fbStipple1Bits[2] = { C1(0, 32), C1(1, 32), }; #ifdef __clang__ /* shift overflow is intentional */ #pragma clang diagnostic ignored "-Wshift-overflow" #endif /* * Example: srcX = 13 dstX = 8 (FB unit 32 dstBpp 8) * * **** **** **** **** **** **** **** **** * ^ * ******** ******** ******** ******** * ^ * leftShift = 12 * rightShift = 20 * * Example: srcX = 0 dstX = 8 (FB unit 32 dstBpp 8) * * **** **** **** **** **** **** **** **** * ^ * ******** ******** ******** ******** * ^ * * leftShift = 24 * rightShift = 8 */ #define LoadBits {\ if (leftShift) { \ bitsRight = (src < srcEnd ? READ(src++) : 0); \ bits = (FbStipLeft (bitsLeft, leftShift) | \ FbStipRight(bitsRight, rightShift)); \ bitsLeft = bitsRight; \ } else \ bits = (src < srcEnd ? READ(src++) : 0); \ } void fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ int srcX, /* bit position of source */ FbBits * dst, FbStride dstStride, /* FbBits units per scanline */ int dstX, /* bit position of dest */ int dstBpp, /* bits per destination unit */ int width, /* width in bits of destination */ int height, /* height in scanlines */ FbBits fgand, /* rrop values */ FbBits fgxor, FbBits bgand, FbBits bgxor) { const FbBits *fbBits; FbBits *srcEnd; int pixelsPerDst; /* dst pixels per FbBits */ int unitsPerSrc; /* src patterns per FbStip */ int leftShift, rightShift; /* align source with dest */ FbBits startmask, endmask; /* dest scanline masks */ FbStip bits = 0, bitsLeft, bitsRight; /* source bits */ FbStip left; FbBits mask; int nDst; /* dest longwords (w.o. end) */ int w; int n, nmiddle; int dstS; /* stipple-relative dst X coordinate */ Bool copy; /* accelerate dest-invariant */ Bool transparent; /* accelerate 0 nop */ int srcinc; /* source units consumed */ Bool endNeedsLoad = FALSE; /* need load for endmask */ int startbyte, endbyte; if (dstBpp == 24) { fbBltOne24(src, srcStride, srcX, dst, dstStride, dstX, dstBpp, width, height, fgand, fgxor, bgand, bgxor); return; } /* * Do not read past the end of the buffer! */ srcEnd = src + height * srcStride; /* * Number of destination units in FbBits == number of stipple pixels * used each time */ pixelsPerDst = FB_UNIT / dstBpp; /* * Number of source stipple patterns in FbStip */ unitsPerSrc = FB_STIP_UNIT / pixelsPerDst; copy = FALSE; transparent = FALSE; if (bgand == 0 && fgand == 0) copy = TRUE; else if (bgand == FB_ALLONES && bgxor == 0) transparent = TRUE; /* * Adjust source and dest to nearest FbBits boundary */ src += srcX >> FB_STIP_SHIFT; dst += dstX >> FB_SHIFT; srcX &= FB_STIP_MASK; dstX &= FB_MASK; FbMaskBitsBytes(dstX, width, copy, startmask, startbyte, nmiddle, endmask, endbyte); /* * Compute effective dest alignment requirement for * source -- must align source to dest unit boundary */ dstS = dstX / dstBpp; /* * Compute shift constants for effective alignement */ if (srcX >= dstS) { leftShift = srcX - dstS; rightShift = FB_STIP_UNIT - leftShift; } else { rightShift = dstS - srcX; leftShift = FB_STIP_UNIT - rightShift; } /* * Get pointer to stipple mask array for this depth */ fbBits = 0; /* unused */ switch (pixelsPerDst) { case 8: fbBits = fbStipple8Bits; break; case 4: fbBits = fbStipple4Bits; break; case 2: fbBits = fbStipple2Bits; break; case 1: fbBits = fbStipple1Bits; break; default: return; } /* * Compute total number of destination words written, but * don't count endmask */ nDst = nmiddle; if (startmask) nDst++; dstStride -= nDst; /* * Compute total number of source words consumed */ srcinc = (nDst + unitsPerSrc - 1) / unitsPerSrc; if (srcX > dstS) srcinc++; if (endmask) { endNeedsLoad = nDst % unitsPerSrc == 0; if (endNeedsLoad) srcinc++; } srcStride -= srcinc; /* * Copy rectangle */ while (height--) { w = nDst; /* total units across scanline */ n = unitsPerSrc; /* units avail in single stipple */ if (n > w) n = w; bitsLeft = 0; if (srcX > dstS) bitsLeft = READ(src++); if (n) { /* * Load first set of stipple bits */ LoadBits; /* * Consume stipple bits for startmask */ if (startmask) { mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; if (mask || !transparent) FbDoLeftMaskByteStippleRRop(dst, mask, fgand, fgxor, bgand, bgxor, startbyte, startmask); bits = FbStipLeft(bits, pixelsPerDst); dst++; n--; w--; } /* * Consume stipple bits across scanline */ for (;;) { w -= n; if (copy) { while (n--) { mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; WRITE(dst, FbOpaqueStipple(mask, fgxor, bgxor)); dst++; bits = FbStipLeft(bits, pixelsPerDst); } } else { while (n--) { left = FbLeftStipBits(bits, pixelsPerDst); if (left || !transparent) { mask = fbBits[left]; WRITE(dst, FbStippleRRop(READ(dst), mask, fgand, fgxor, bgand, bgxor)); } dst++; bits = FbStipLeft(bits, pixelsPerDst); } } if (!w) break; /* * Load another set and reset number of available units */ LoadBits; n = unitsPerSrc; if (n > w) n = w; } } /* * Consume stipple bits for endmask */ if (endmask) { if (endNeedsLoad) { LoadBits; } mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; if (mask || !transparent) FbDoRightMaskByteStippleRRop(dst, mask, fgand, fgxor, bgand, bgxor, endbyte, endmask); } dst += dstStride; src += srcStride; } } /* * Crufty macros to initialize the mask array, most of this * is to avoid compile-time warnings about shift overflow */ #if BITMAP_BIT_ORDER == MSBFirst #define Mask24Pos(x,r) ((x)*24-(r)) #else #define Mask24Pos(x,r) ((x)*24-((r) ? 24 - (r) : 0)) #endif #define Mask24Neg(x,r) (Mask24Pos(x,r) < 0 ? -Mask24Pos(x,r) : 0) #define Mask24Check(x,r) (Mask24Pos(x,r) < 0 ? 0 : \ Mask24Pos(x,r) >= FB_UNIT ? 0 : Mask24Pos(x,r)) #define Mask24(x,r) (Mask24Pos(x,r) < FB_UNIT ? \ (Mask24Pos(x,r) < 0 ? \ 0xffffffU >> Mask24Neg (x,r) : \ 0xffffffU << Mask24Check(x,r)) : 0) #define SelMask24(b,n,r) ((((b) >> n) & 1) * Mask24(n,r)) #define C2_24(b,r) \ (SelMask24(b,0,r) | \ SelMask24(b,1,r)) #define FbStip24Len 2 #if BITMAP_BIT_ORDER == MSBFirst #define FbStip24New(rot) (1 + (rot == 0)) #else #define FbStip24New(rot) (1 + (rot == 8)) #endif const FbBits fbStipple24Bits[3][1 << FbStip24Len] = { /* rotate 0 */ { C2_24(0, 0), C2_24(1, 0), C2_24(2, 0), C2_24(3, 0), }, /* rotate 8 */ { C2_24(0, 8), C2_24(1, 8), C2_24(2, 8), C2_24(3, 8), }, /* rotate 16 */ { C2_24(0, 16), C2_24(1, 16), C2_24(2, 16), C2_24(3, 16), } }; #if BITMAP_BIT_ORDER == LSBFirst #define FbMergeStip24Bits(left, right, new) \ (FbStipLeft (left, new) | FbStipRight ((right), (FbStip24Len - (new)))) #define FbMergePartStip24Bits(left, right, llen, rlen) \ (left | FbStipRight(right, llen)) #else #define FbMergeStip24Bits(left, right, new) \ ((FbStipLeft (left, new) & ((1 << FbStip24Len) - 1)) | right) #define FbMergePartStip24Bits(left, right, llen, rlen) \ (FbStipLeft(left, rlen) | right) #endif #define fbFirstStipBits(len,stip) {\ int __len = (len); \ if (len <= remain) { \ stip = FbLeftStipBits(bits, len); \ } else { \ stip = FbLeftStipBits(bits, remain); \ bits = (src < srcEnd ? READ(src++) : 0); \ __len = (len) - remain; \ stip = FbMergePartStip24Bits(stip, FbLeftStipBits(bits, __len), \ remain, __len); \ remain = FB_STIP_UNIT; \ } \ bits = FbStipLeft (bits, __len); \ remain -= __len; \ } #define fbInitStipBits(offset,len,stip) {\ bits = FbStipLeft (READ(src++),offset); \ remain = FB_STIP_UNIT - offset; \ fbFirstStipBits(len,stip); \ stip = FbMergeStip24Bits (0, stip, len); \ } #define fbNextStipBits(rot,stip) {\ int __new = FbStip24New(rot); \ FbStip __right; \ fbFirstStipBits(__new, __right); \ stip = FbMergeStip24Bits (stip, __right, __new); \ rot = FbNext24Rot (rot); \ } /* * Use deep mask tables that incorporate rotation, pull * a variable number of bits out of the stipple and * reuse the right bits as needed for the next write * * Yes, this is probably too much code, but most 24-bpp screens * have no acceleration so this code is used for stipples, copyplane * and text */ void fbBltOne24(FbStip * srcLine, FbStride srcStride, /* FbStip units per scanline */ int srcX, /* bit position of source */ FbBits * dst, FbStride dstStride, /* FbBits units per scanline */ int dstX, /* bit position of dest */ int dstBpp, /* bits per destination unit */ int width, /* width in bits of destination */ int height, /* height in scanlines */ FbBits fgand, /* rrop values */ FbBits fgxor, FbBits bgand, FbBits bgxor) { FbStip *src, *srcEnd; FbBits leftMask, rightMask, mask; int nlMiddle, nl; FbStip stip, bits; int remain; int dstS; int firstlen; int rot0, rot; int nDst; /* * Do not read past the end of the buffer! */ srcEnd = srcLine + height * srcStride; srcLine += srcX >> FB_STIP_SHIFT; dst += dstX >> FB_SHIFT; srcX &= FB_STIP_MASK; dstX &= FB_MASK; rot0 = FbFirst24Rot(dstX); FbMaskBits(dstX, width, leftMask, nlMiddle, rightMask); dstS = (dstX + 23) / 24; firstlen = FbStip24Len - dstS; nDst = nlMiddle; if (leftMask) nDst++; dstStride -= nDst; /* opaque copy */ if (bgand == 0 && fgand == 0) { while (height--) { rot = rot0; src = srcLine; srcLine += srcStride; fbInitStipBits(srcX, firstlen, stip); if (leftMask) { mask = fbStipple24Bits[rot >> 3][stip]; WRITE(dst, (READ(dst) & ~leftMask) | (FbOpaqueStipple(mask, FbRot24(fgxor, rot), FbRot24(bgxor, rot)) & leftMask)); dst++; fbNextStipBits(rot, stip); } nl = nlMiddle; while (nl--) { mask = fbStipple24Bits[rot >> 3][stip]; WRITE(dst, FbOpaqueStipple(mask, FbRot24(fgxor, rot), FbRot24(bgxor, rot))); dst++; fbNextStipBits(rot, stip); } if (rightMask) { mask = fbStipple24Bits[rot >> 3][stip]; WRITE(dst, (READ(dst) & ~rightMask) | (FbOpaqueStipple(mask, FbRot24(fgxor, rot), FbRot24(bgxor, rot)) & rightMask)); } dst += dstStride; src += srcStride; } } /* transparent copy */ else if (bgand == FB_ALLONES && bgxor == 0 && fgand == 0) { while (height--) { rot = rot0; src = srcLine; srcLine += srcStride; fbInitStipBits(srcX, firstlen, stip); if (leftMask) { if (stip) { mask = fbStipple24Bits[rot >> 3][stip] & leftMask; WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask)); } dst++; fbNextStipBits(rot, stip); } nl = nlMiddle; while (nl--) { if (stip) { mask = fbStipple24Bits[rot >> 3][stip]; WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask)); } dst++; fbNextStipBits(rot, stip); } if (rightMask) { if (stip) { mask = fbStipple24Bits[rot >> 3][stip] & rightMask; WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask)); } } dst += dstStride; } } else { while (height--) { rot = rot0; src = srcLine; srcLine += srcStride; fbInitStipBits(srcX, firstlen, stip); if (leftMask) { mask = fbStipple24Bits[rot >> 3][stip]; WRITE(dst, FbStippleRRopMask(READ(dst), mask, FbRot24(fgand, rot), FbRot24(fgxor, rot), FbRot24(bgand, rot), FbRot24(bgxor, rot), leftMask)); dst++; fbNextStipBits(rot, stip); } nl = nlMiddle; while (nl--) { mask = fbStipple24Bits[rot >> 3][stip]; WRITE(dst, FbStippleRRop(READ(dst), mask, FbRot24(fgand, rot), FbRot24(fgxor, rot), FbRot24(bgand, rot), FbRot24(bgxor, rot))); dst++; fbNextStipBits(rot, stip); } if (rightMask) { mask = fbStipple24Bits[rot >> 3][stip]; WRITE(dst, FbStippleRRopMask(READ(dst), mask, FbRot24(fgand, rot), FbRot24(fgxor, rot), FbRot24(bgand, rot), FbRot24(bgxor, rot), rightMask)); } dst += dstStride; } } } /* * Not very efficient, but simple -- copy a single plane * from an N bit image to a 1 bit image */ void fbBltPlane(FbBits * src, FbStride srcStride, int srcX, int srcBpp, FbStip * dst, FbStride dstStride, int dstX, int width, int height, FbStip fgand, FbStip fgxor, FbStip bgand, FbStip bgxor, Pixel planeMask) { FbBits *s; FbBits pm; FbBits srcMask; FbBits srcMaskFirst; FbBits srcMask0 = 0; FbBits srcBits; FbStip dstBits; FbStip *d; FbStip dstMask; FbStip dstMaskFirst; FbStip dstUnion; int w; int wt; int rot0; if (!width) return; src += srcX >> FB_SHIFT; srcX &= FB_MASK; dst += dstX >> FB_STIP_SHIFT; dstX &= FB_STIP_MASK; w = width / srcBpp; pm = fbReplicatePixel(planeMask, srcBpp); if (srcBpp == 24) { int tmpw = 24; rot0 = FbFirst24Rot(srcX); if (srcX + tmpw > FB_UNIT) tmpw = FB_UNIT - srcX; srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, tmpw); } else { rot0 = 0; srcMaskFirst = pm & FbBitsMask(srcX, srcBpp); srcMask0 = pm & FbBitsMask(0, srcBpp); } dstMaskFirst = FbStipMask(dstX, 1); while (height--) { d = dst; dst += dstStride; s = src; src += srcStride; srcMask = srcMaskFirst; if (srcBpp == 24) srcMask0 = FbRot24(pm, rot0) & FbBitsMask(0, srcBpp); srcBits = READ(s++); dstMask = dstMaskFirst; dstUnion = 0; dstBits = 0; wt = w; while (wt--) { if (!srcMask) { srcBits = READ(s++); if (srcBpp == 24) srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0, 24); srcMask = srcMask0; } if (!dstMask) { WRITE(d, FbStippleRRopMask(READ(d), dstBits, fgand, fgxor, bgand, bgxor, dstUnion)); d++; dstMask = FbStipMask(0, 1); dstUnion = 0; dstBits = 0; } if (srcBits & srcMask) dstBits |= dstMask; dstUnion |= dstMask; if (srcBpp == FB_UNIT) srcMask = 0; else srcMask = FbScrRight(srcMask, srcBpp); dstMask = FbStipRight(dstMask, 1); } if (dstUnion) WRITE(d, FbStippleRRopMask(READ(d), dstBits, fgand, fgxor, bgand, bgxor, dstUnion)); } } xorg-server-1.17.1/fb/fbpict.c0000664000175100017510000003416112456571574013040 00000000000000/* * * Copyright © 2000 SuSE, Inc. * Copyright © 2007 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "fb.h" #include "picturestr.h" #include "mipict.h" #include "fbpict.h" void fbComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { pixman_image_t *src, *mask, *dest; int src_xoff, src_yoff; int msk_xoff, msk_yoff; int dst_xoff, dst_yoff; miCompositeSourceValidate(pSrc); if (pMask) miCompositeSourceValidate(pMask); src = image_from_pict(pSrc, FALSE, &src_xoff, &src_yoff); mask = image_from_pict(pMask, FALSE, &msk_xoff, &msk_yoff); dest = image_from_pict(pDst, TRUE, &dst_xoff, &dst_yoff); if (src && dest && !(pMask && !mask)) { pixman_image_composite(op, src, mask, dest, xSrc + src_xoff, ySrc + src_yoff, xMask + msk_xoff, yMask + msk_yoff, xDst + dst_xoff, yDst + dst_yoff, width, height); } free_pixman_pict(pSrc, src); free_pixman_pict(pMask, mask); 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); } 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; format = maskFormat->format | (maskFormat->depth << 24); pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents); pixman_composite_glyphs(op, srcImage, dstImage, format, xSrc + srcXoff + extents.x1 - xDst, ySrc + srcYoff + extents.y1 - yDst, extents.x1, extents.y1, extents.x1 + dstXoff, extents.y1 + 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) { PictSolidFill *solid = &pict->pSourcePict->solidFill; pixman_color_t color; CARD32 a, r, g, b; a = (solid->color & 0xff000000) >> 24; r = (solid->color & 0x00ff0000) >> 16; g = (solid->color & 0x0000ff00) >> 8; b = (solid->color & 0x000000ff) >> 0; color.alpha = (a << 8) | a; color.red = (r << 8) | r; color.green = (g << 8) | g; color.blue = (b << 8) | b; return pixman_image_create_solid_fill(&color); } static pixman_image_t * create_linear_gradient_image(PictGradient * gradient) { PictLinearGradient *linear = (PictLinearGradient *) gradient; pixman_point_fixed_t p1; pixman_point_fixed_t p2; p1.x = linear->p1.x; p1.y = linear->p1.y; p2.x = linear->p2.x; p2.y = linear->p2.y; return pixman_image_create_linear_gradient(&p1, &p2, (pixman_gradient_stop_t *) gradient->stops, gradient->nstops); } static pixman_image_t * create_radial_gradient_image(PictGradient * gradient) { PictRadialGradient *radial = (PictRadialGradient *) gradient; pixman_point_fixed_t c1; pixman_point_fixed_t c2; c1.x = radial->c1.x; c1.y = radial->c1.y; c2.x = radial->c2.x; c2.y = radial->c2.y; return pixman_image_create_radial_gradient(&c1, &c2, radial->c1.radius, radial->c2.radius, (pixman_gradient_stop_t *) gradient->stops, gradient->nstops); } static pixman_image_t * create_conical_gradient_image(PictGradient * gradient) { PictConicalGradient *conical = (PictConicalGradient *) gradient; pixman_point_fixed_t center; center.x = conical->center.x; center.y = conical->center.y; return pixman_image_create_conical_gradient(¢er, conical->angle, (pixman_gradient_stop_t *) gradient->stops, gradient->nstops); } static pixman_image_t * create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) { PixmapPtr pixmap; FbBits *bits; FbStride stride; int bpp; pixman_image_t *image; fbGetDrawablePixmap(pict->pDrawable, pixmap, *xoff, *yoff); fbGetPixmapBitsData(pixmap, bits, stride, bpp); image = pixman_image_create_bits((pixman_format_code_t) pict->format, pixmap->drawable.width, pixmap->drawable.height, (uint32_t *) bits, stride * sizeof(FbStride)); if (!image) return NULL; #ifdef FB_ACCESS_WRAPPER pixman_image_set_accessors(image, (pixman_read_memory_func_t) wfbReadMemory, (pixman_write_memory_func_t) wfbWriteMemory); #endif /* pCompositeClip is undefined for source pictures, so * only set the clip region for pictures with drawables */ if (has_clip) { if (pict->clientClip) pixman_image_set_has_client_clip(image, TRUE); if (*xoff || *yoff) pixman_region_translate(pict->pCompositeClip, *xoff, *yoff); pixman_image_set_clip_region(image, pict->pCompositeClip); if (*xoff || *yoff) pixman_region_translate(pict->pCompositeClip, -*xoff, -*yoff); } /* Indexed table */ if (pict->pFormat->index.devPrivate) pixman_image_set_indexed(image, pict->pFormat->index.devPrivate); /* Add in drawable origin to position within the image */ *xoff += pict->pDrawable->x; *yoff += pict->pDrawable->y; return image; } static pixman_image_t *image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map); static void set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map) { pixman_repeat_t repeat; pixman_filter_t filter; if (pict->transform) { /* For source images, adjust the transform to account * for the drawable offset within the pixman image, * then set the offset to 0 as it will be used * to compute positions within the transformed image. */ if (!has_clip) { struct pixman_transform adjusted; adjusted = *pict->transform; pixman_transform_translate(&adjusted, NULL, pixman_int_to_fixed(*xoff), pixman_int_to_fixed(*yoff)); pixman_image_set_transform(image, &adjusted); *xoff = 0; *yoff = 0; } else pixman_image_set_transform(image, pict->transform); } switch (pict->repeatType) { default: case RepeatNone: repeat = PIXMAN_REPEAT_NONE; break; case RepeatPad: repeat = PIXMAN_REPEAT_PAD; break; case RepeatNormal: repeat = PIXMAN_REPEAT_NORMAL; break; case RepeatReflect: repeat = PIXMAN_REPEAT_REFLECT; break; } pixman_image_set_repeat(image, repeat); /* Fetch alpha map unless 'pict' is being used * as the alpha map for this operation */ if (pict->alphaMap && !is_alpha_map) { int alpha_xoff, alpha_yoff; pixman_image_t *alpha_map = image_from_pict_internal(pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff, TRUE); pixman_image_set_alpha_map(image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y); free_pixman_pict(pict->alphaMap, alpha_map); } pixman_image_set_component_alpha(image, pict->componentAlpha); switch (pict->filter) { default: case PictFilterNearest: case PictFilterFast: filter = PIXMAN_FILTER_NEAREST; break; case PictFilterBilinear: case PictFilterGood: filter = PIXMAN_FILTER_BILINEAR; break; case PictFilterConvolution: filter = PIXMAN_FILTER_CONVOLUTION; break; } pixman_image_set_filter(image, filter, (pixman_fixed_t *) pict->filter_params, pict->filter_nparams); pixman_image_set_source_clipping(image, TRUE); } static pixman_image_t * image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map) { pixman_image_t *image = NULL; if (!pict) return NULL; if (pict->pDrawable) { image = create_bits_picture(pict, has_clip, xoff, yoff); } else if (pict->pSourcePict) { SourcePict *sp = pict->pSourcePict; if (sp->type == SourcePictTypeSolidFill) { image = create_solid_fill_image(pict); } else { PictGradient *gradient = &pict->pSourcePict->gradient; if (sp->type == SourcePictTypeLinear) image = create_linear_gradient_image(gradient); else if (sp->type == SourcePictTypeRadial) image = create_radial_gradient_image(gradient); else if (sp->type == SourcePictTypeConical) image = create_conical_gradient_image(gradient); } *xoff = *yoff = 0; } if (image) set_image_properties(image, pict, has_clip, xoff, yoff, is_alpha_map); return image; } pixman_image_t * image_from_pict(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) { return image_from_pict_internal(pict, has_clip, xoff, yoff, FALSE); } void free_pixman_pict(PicturePtr pict, pixman_image_t * image) { if (image && pixman_image_unref(image) && pict->pDrawable) fbFinishAccess(pict->pDrawable); } Bool fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) { PictureScreenPtr ps; if (!miPictureInit(pScreen, formats, nformats)) return FALSE; ps = GetPictureScreen(pScreen); ps->Composite = fbComposite; ps->Glyphs = fbGlyphs; ps->UnrealizeGlyph = fbUnrealizeGlyph; ps->CompositeRects = miCompositeRects; ps->RasterizeTrapezoid = fbRasterizeTrapezoid; ps->Trapezoids = fbTrapezoids; ps->AddTraps = fbAddTraps; ps->AddTriangles = fbAddTriangles; ps->Triangles = fbTriangles; return TRUE; } xorg-server-1.17.1/fb/fbpixmap.c0000664000175100017510000002605212456571574013377 00000000000000/* * Copyright © 1998 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 #include "fb.h" PixmapPtr fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp, unsigned usage_hint) { PixmapPtr pPixmap; size_t datasize; size_t paddedWidth; int adjust; int base; paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); if (paddedWidth / 4 > 32767 || height > 32767) return NullPixmap; datasize = height * paddedWidth; base = pScreen->totalPixmapSize; adjust = 0; if (base & 7) adjust = 8 - (base & 7); datasize += adjust; #ifdef FB_DEBUG datasize += 2 * paddedWidth; #endif pPixmap = AllocatePixmap(pScreen, datasize); if (!pPixmap) return NullPixmap; pPixmap->drawable.type = DRAWABLE_PIXMAP; pPixmap->drawable.class = 0; pPixmap->drawable.pScreen = pScreen; pPixmap->drawable.depth = depth; pPixmap->drawable.bitsPerPixel = bpp; pPixmap->drawable.id = 0; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pPixmap->drawable.x = 0; pPixmap->drawable.y = 0; pPixmap->drawable.width = width; pPixmap->drawable.height = height; pPixmap->devKind = paddedWidth; pPixmap->refcnt = 1; pPixmap->devPrivate.ptr = (void *) ((char *) pPixmap + base + adjust); pPixmap->master_pixmap = NULL; #ifdef FB_DEBUG pPixmap->devPrivate.ptr = (void *) ((char *) pPixmap->devPrivate.ptr + paddedWidth); fbInitializeDrawable(&pPixmap->drawable); #endif #ifdef COMPOSITE pPixmap->screen_x = 0; pPixmap->screen_y = 0; #endif pPixmap->usage_hint = usage_hint; return pPixmap; } PixmapPtr fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, unsigned usage_hint) { int bpp; bpp = BitsPerPixel(depth); if (bpp == 32 && depth <= 24) bpp = fbGetScreenPrivate(pScreen)->pix32bpp; return fbCreatePixmapBpp(pScreen, width, height, depth, bpp, usage_hint); } Bool fbDestroyPixmap(PixmapPtr pPixmap) { if (--pPixmap->refcnt) return TRUE; FreePixmap(pPixmap); return TRUE; } #define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ (!((reg)->data->numRects && \ ((r-1)->y1 == (ry1)) && \ ((r-1)->y2 == (ry2)) && \ ((r-1)->x1 <= (rx1)) && \ ((r-1)->x2 >= (rx2))))) \ { \ if ((reg)->data->numRects == (reg)->data->size) \ { \ RegionRectAlloc(reg, 1); \ fr = RegionBoxptr(reg); \ r = fr + (reg)->data->numRects; \ } \ r->x1 = (rx1); \ r->y1 = (ry1); \ r->x2 = (rx2); \ r->y2 = (ry2); \ (reg)->data->numRects++; \ if(r->x1 < (reg)->extents.x1) \ (reg)->extents.x1 = r->x1; \ if(r->x2 > (reg)->extents.x2) \ (reg)->extents.x2 = r->x2; \ r++; \ } /* Convert bitmap clip mask into clipping region. * First, goes through each line and makes boxes by noting the transitions * from 0 to 1 and 1 to 0. * Then it coalesces the current line with the previous if they have boxes * at the same X coordinates. */ RegionPtr fbPixmapToRegion(PixmapPtr pPix) { register RegionPtr pReg; FbBits *pw, w; register int ib; int width, h, base, rx1 = 0, crects; FbBits *pwLineEnd; int irectPrevStart, irectLineStart; register BoxPtr prectO, prectN; BoxPtr FirstRect, rects, prectLineStart; Bool fInBox, fSame; register FbBits mask0 = FB_ALLONES & ~FbScrRight(FB_ALLONES, 1); FbBits *pwLine; int nWidth; pReg = RegionCreate(NULL, 1); if (!pReg) return NullRegion; FirstRect = RegionBoxptr(pReg); rects = FirstRect; fbPrepareAccess(&pPix->drawable); pwLine = (FbBits *) pPix->devPrivate.ptr; nWidth = pPix->devKind >> (FB_SHIFT - 3); width = pPix->drawable.width; pReg->extents.x1 = width - 1; pReg->extents.x2 = 0; irectPrevStart = -1; for (h = 0; h < pPix->drawable.height; h++) { pw = pwLine; pwLine += nWidth; irectLineStart = rects - FirstRect; /* If the Screen left most bit of the word is set, we're starting in * a box */ if (READ(pw) & mask0) { fInBox = TRUE; rx1 = 0; } else fInBox = FALSE; /* Process all words which are fully in the pixmap */ pwLineEnd = pw + (width >> FB_SHIFT); for (base = 0; pw < pwLineEnd; base += FB_UNIT) { w = READ(pw++); if (fInBox) { if (!~w) continue; } else { if (!w) continue; } for (ib = 0; ib < FB_UNIT; ib++) { /* If the Screen left most bit of the word is set, we're * starting a box */ if (w & mask0) { if (!fInBox) { rx1 = base + ib; /* start new box */ fInBox = TRUE; } } else { if (fInBox) { /* end box */ ADDRECT(pReg, rects, FirstRect, rx1, h, base + ib, h + 1); fInBox = FALSE; } } /* Shift the word VISUALLY left one. */ w = FbScrLeft(w, 1); } } if (width & FB_MASK) { /* Process final partial word on line */ w = READ(pw++); for (ib = 0; ib < (width & FB_MASK); ib++) { /* If the Screen left most bit of the word is set, we're * starting a box */ if (w & mask0) { if (!fInBox) { rx1 = base + ib; /* start new box */ fInBox = TRUE; } } else { if (fInBox) { /* end box */ ADDRECT(pReg, rects, FirstRect, rx1, h, base + ib, h + 1); fInBox = FALSE; } } /* Shift the word VISUALLY left one. */ w = FbScrLeft(w, 1); } } /* If scanline ended with last bit set, end the box */ if (fInBox) { ADDRECT(pReg, rects, FirstRect, rx1, h, base + (width & FB_MASK), h + 1); } /* if all rectangles on this line have the same x-coords as * those on the previous line, then add 1 to all the previous y2s and * throw away all the rectangles from this line */ fSame = FALSE; if (irectPrevStart != -1) { crects = irectLineStart - irectPrevStart; if (crects == ((rects - FirstRect) - irectLineStart)) { prectO = FirstRect + irectPrevStart; prectN = prectLineStart = FirstRect + irectLineStart; fSame = TRUE; while (prectO < prectLineStart) { if ((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2)) { fSame = FALSE; break; } prectO++; prectN++; } if (fSame) { prectO = FirstRect + irectPrevStart; while (prectO < prectLineStart) { prectO->y2 += 1; prectO++; } rects -= crects; pReg->data->numRects -= crects; } } } if (!fSame) irectPrevStart = irectLineStart; } if (!pReg->data->numRects) pReg->extents.x1 = pReg->extents.x2 = 0; else { pReg->extents.y1 = RegionBoxptr(pReg)->y1; pReg->extents.y2 = RegionEnd(pReg)->y2; if (pReg->data->numRects == 1) { free(pReg->data); pReg->data = (RegDataPtr) NULL; } } fbFinishAccess(&pPix->drawable); #ifdef DEBUG if (!RegionIsValid(pReg)) FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__); #endif return pReg; } #ifdef FB_DEBUG #ifndef WIN32 #include #else #include #endif static Bool fbValidateBits(FbStip * bits, int stride, FbStip data) { while (stride--) { if (*bits != data) { #ifdef WIN32 NCD_DEBUG((DEBUG_FAILURE, "fdValidateBits failed at 0x%x (is 0x%x want 0x%x)", bits, *bits, data)); #else fprintf(stderr, "fbValidateBits failed\n"); #endif return FALSE; } bits++; } } void fbValidateDrawable(DrawablePtr pDrawable) { FbStip *bits, *first, *last; int stride, bpp; int xoff, yoff; int height; Bool failed; if (pDrawable->type != DRAWABLE_PIXMAP) pDrawable = (DrawablePtr) fbGetWindowPixmap(pDrawable); fbGetStipDrawable(pDrawable, bits, stride, bpp, xoff, yoff); first = bits - stride; last = bits + stride * pDrawable->height; if (!fbValidateBits(first, stride, FB_HEAD_BITS) || !fbValidateBits(last, stride, FB_TAIL_BITS)) fbInitializeDrawable(pDrawable); fbFinishAccess(pDrawable); } void fbSetBits(FbStip * bits, int stride, FbStip data) { while (stride--) *bits++ = data; } void fbInitializeDrawable(DrawablePtr pDrawable) { FbStip *bits, *first, *last; int stride, bpp; int xoff, yoff; fbGetStipDrawable(pDrawable, bits, stride, bpp, xoff, yoff); first = bits - stride; last = bits + stride * pDrawable->height; fbSetBits(first, stride, FB_HEAD_BITS); fbSetBits(last, stride, FB_TAIL_BITS); fbFinishAccess(pDrawable); } #endif /* FB_DEBUG */ xorg-server-1.17.1/fb/fbcopy.c0000664000175100017510000002263612422315650013037 00000000000000/* * Copyright © 1998 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 #include "fb.h" void fbCopyNtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { CARD8 alu = pGC ? pGC->alu : GXcopy; FbBits pm = pGC ? fbGetGCPrivate(pGC)->pm : FB_ALLONES; FbBits *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; fbGetDrawable(pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); fbGetDrawable(pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (nbox--) { #ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */ if (pm == FB_ALLONES && alu == GXcopy && !reverse && !upsidedown) { if (!pixman_blt ((uint32_t *) src, (uint32_t *) dst, srcStride, dstStride, srcBpp, dstBpp, (pbox->x1 + dx + srcXoff), (pbox->y1 + dy + srcYoff), (pbox->x1 + dstXoff), (pbox->y1 + dstYoff), (pbox->x2 - pbox->x1), (pbox->y2 - pbox->y1))) goto fallback; else goto next; } fallback: #endif fbBlt(src + (pbox->y1 + dy + srcYoff) * srcStride, srcStride, (pbox->x1 + dx + srcXoff) * srcBpp, dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff) * dstBpp, (pbox->x2 - pbox->x1) * dstBpp, (pbox->y2 - pbox->y1), alu, pm, dstBpp, reverse, upsidedown); #ifndef FB_ACCESS_WRAPPER next: #endif pbox++; } fbFinishAccess(pDstDrawable); fbFinishAccess(pSrcDrawable); } void fbCopy1toN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbBits *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; fbGetDrawable(pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); fbGetDrawable(pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (nbox--) { if (dstBpp == 1) { fbBlt(src + (pbox->y1 + dy + srcYoff) * srcStride, srcStride, (pbox->x1 + dx + srcXoff) * srcBpp, dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff) * dstBpp, (pbox->x2 - pbox->x1) * dstBpp, (pbox->y2 - pbox->y1), FbOpaqueStipple1Rop(pGC->alu, pGC->fgPixel, pGC->bgPixel), pPriv->pm, dstBpp, reverse, upsidedown); } else { fbBltOne((FbStip *) (src + (pbox->y1 + dy + srcYoff) * srcStride), srcStride * (FB_UNIT / FB_STIP_UNIT), (pbox->x1 + dx + srcXoff), dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff) * dstBpp, dstBpp, (pbox->x2 - pbox->x1) * dstBpp, (pbox->y2 - pbox->y1), pPriv->and, pPriv->xor, pPriv->bgand, pPriv->bgxor); } pbox++; } fbFinishAccess(pDstDrawable); fbFinishAccess(pSrcDrawable); } void fbCopyNto1(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); while (nbox--) { if (pDstDrawable->bitsPerPixel == 1) { FbBits *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; FbStip *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; fbGetDrawable(pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); fbGetStipDrawable(pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); fbBltPlane(src + (pbox->y1 + dy + srcYoff) * srcStride, srcStride, (pbox->x1 + dx + srcXoff) * srcBpp, srcBpp, dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff) * dstBpp, (pbox->x2 - pbox->x1) * srcBpp, (pbox->y2 - pbox->y1), (FbStip) pPriv->and, (FbStip) pPriv->xor, (FbStip) pPriv->bgand, (FbStip) pPriv->bgxor, bitplane); fbFinishAccess(pDstDrawable); fbFinishAccess(pSrcDrawable); } else { FbBits *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbStip *tmp; FbStride tmpStride; int width, height; width = pbox->x2 - pbox->x1; height = pbox->y2 - pbox->y1; tmpStride = ((width + FB_STIP_MASK) >> FB_STIP_SHIFT); tmp = malloc(tmpStride * height * sizeof(FbStip)); if (!tmp) return; fbGetDrawable(pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); fbGetDrawable(pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); fbBltPlane(src + (pbox->y1 + dy + srcYoff) * srcStride, srcStride, (pbox->x1 + dx + srcXoff) * srcBpp, srcBpp, tmp, tmpStride, 0, width * srcBpp, height, fbAndStip(GXcopy, FB_ALLONES, FB_ALLONES), fbXorStip(GXcopy, FB_ALLONES, FB_ALLONES), fbAndStip(GXcopy, 0, FB_ALLONES), fbXorStip(GXcopy, 0, FB_ALLONES), bitplane); fbBltOne(tmp, tmpStride, 0, dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff) * dstBpp, dstBpp, width * dstBpp, height, pPriv->and, pPriv->xor, pPriv->bgand, pPriv->bgxor); free(tmp); fbFinishAccess(pDstDrawable); fbFinishAccess(pSrcDrawable); } pbox++; } } RegionPtr fbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut) { miCopyProc copy; if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel) copy = fb24_32CopyMtoN; else copy = fbCopyNtoN; return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, copy, 0, 0); } RegionPtr fbCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut, unsigned long bitplane) { if (pSrcDrawable->bitsPerPixel > 1) return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, fbCopyNto1, (Pixel) bitplane, 0); else if (bitplane & 1) return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, fbCopy1toN, (Pixel) bitplane, 0); else return miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut); } xorg-server-1.17.1/fb/fb24_32.c0000664000175100017510000003731112456571574012632 00000000000000/* * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "fb.h" /* X apps don't like 24bpp images, this code exposes 32bpp images */ /* * These two functions do a full CopyArea while reformatting * the data between 24 and 32bpp. They try to go a bit faster * by reading/writing aligned CARD32s where it's easy */ #define Get8(a) ((CARD32) READ(a)) #if BITMAP_BIT_ORDER == MSBFirst #define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2)) #define Put24(a,p) ((WRITE((a+0), (CARD8) ((p) >> 16))), \ (WRITE((a+1), (CARD8) ((p) >> 8))), \ (WRITE((a+2), (CARD8) (p)))) #else #define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16)) #define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \ (WRITE((a+1), (CARD8) ((p) >> 8))), \ (WRITE((a+2), (CARD8) ((p) >> 16)))) #endif typedef void (*fb24_32BltFunc) (CARD8 *srcLine, FbStride srcStride, int srcX, CARD8 *dstLine, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm); static void fb24_32BltDown(CARD8 *srcLine, FbStride srcStride, int srcX, CARD8 *dstLine, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm) { CARD32 *src; CARD8 *dst; int w; Bool destInvarient; CARD32 pixel, dpixel; FbDeclareMergeRop(); srcLine += srcX * 4; dstLine += dstX * 3; FbInitializeMergeRop(alu, (pm | ~(FbBits) 0xffffff)); destInvarient = FbDestInvarientMergeRop(); while (height--) { src = (CARD32 *) srcLine; dst = dstLine; srcLine += srcStride; dstLine += dstStride; w = width; if (destInvarient) { while (((long) dst & 3) && w) { w--; pixel = READ(src++); pixel = FbDoDestInvarientMergeRop(pixel); Put24(dst, pixel); dst += 3; } /* Do four aligned pixels at a time */ while (w >= 4) { CARD32 s0, s1; s0 = READ(src++); s0 = FbDoDestInvarientMergeRop(s0); s1 = READ(src++); s1 = FbDoDestInvarientMergeRop(s1); #if BITMAP_BIT_ORDER == LSBFirst WRITE((CARD32 *) dst, (s0 & 0xffffff) | (s1 << 24)); #else WRITE((CARD32 *) dst, (s0 << 8) | ((s1 & 0xffffff) >> 16)); #endif s0 = READ(src++); s0 = FbDoDestInvarientMergeRop(s0); #if BITMAP_BIT_ORDER == LSBFirst WRITE((CARD32 *) (dst + 4), ((s1 & 0xffffff) >> 8) | (s0 << 16)); #else WRITE((CARD32 *) (dst + 4), (s1 << 16) | ((s0 & 0xffffff) >> 8)); #endif s1 = READ(src++); s1 = FbDoDestInvarientMergeRop(s1); #if BITMAP_BIT_ORDER == LSBFirst WRITE((CARD32 *) (dst + 8), ((s0 & 0xffffff) >> 16) | (s1 << 8)); #else WRITE((CARD32 *) (dst + 8), (s0 << 24) | (s1 & 0xffffff)); #endif dst += 12; w -= 4; } while (w--) { pixel = READ(src++); pixel = FbDoDestInvarientMergeRop(pixel); Put24(dst, pixel); dst += 3; } } else { while (w--) { pixel = READ(src++); dpixel = Get24(dst); pixel = FbDoMergeRop(pixel, dpixel); Put24(dst, pixel); dst += 3; } } } } static void fb24_32BltUp(CARD8 *srcLine, FbStride srcStride, int srcX, CARD8 *dstLine, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm) { CARD8 *src; CARD32 *dst; int w; Bool destInvarient; CARD32 pixel; FbDeclareMergeRop(); FbInitializeMergeRop(alu, (pm | (~(FbBits) 0xffffff))); destInvarient = FbDestInvarientMergeRop(); srcLine += srcX * 3; dstLine += dstX * 4; while (height--) { w = width; src = srcLine; dst = (CARD32 *) dstLine; srcLine += srcStride; dstLine += dstStride; if (destInvarient) { while (((long) src & 3) && w) { w--; pixel = Get24(src); src += 3; WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); } /* Do four aligned pixels at a time */ while (w >= 4) { CARD32 s0, s1; s0 = READ((CARD32 *) src); #if BITMAP_BIT_ORDER == LSBFirst pixel = s0 & 0xffffff; #else pixel = s0 >> 8; #endif WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); s1 = READ((CARD32 *) (src + 4)); #if BITMAP_BIT_ORDER == LSBFirst pixel = (s0 >> 24) | ((s1 << 8) & 0xffffff); #else pixel = ((s0 << 16) & 0xffffff) | (s1 >> 16); #endif WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); s0 = READ((CARD32 *) (src + 8)); #if BITMAP_BIT_ORDER == LSBFirst pixel = (s1 >> 16) | ((s0 << 16) & 0xffffff); #else pixel = ((s1 << 8) & 0xffffff) | (s0 >> 24); #endif WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); #if BITMAP_BIT_ORDER == LSBFirst pixel = s0 >> 8; #else pixel = s0 & 0xffffff; #endif WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); src += 12; w -= 4; } while (w) { w--; pixel = Get24(src); src += 3; WRITE(dst++, FbDoDestInvarientMergeRop(pixel)); } } else { while (w--) { pixel = Get24(src); src += 3; WRITE(dst, FbDoMergeRop(pixel, READ(dst))); dst++; } } } } /* * Spans functions; probably unused. */ void fb24_32GetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart) { FbBits *srcBits; CARD8 *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; CARD8 *dst; fbGetDrawable(pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff); src = (CARD8 *) srcBits; srcStride *= sizeof(FbBits); while (nspans--) { dst = (CARD8 *) pchardstStart; fb24_32BltUp(src + (ppt->y + srcYoff) * srcStride, srcStride, ppt->x + srcXoff, dst, 1, 0, *pwidth, 1, GXcopy, FB_ALLONES); pchardstStart += PixmapBytePad(*pwidth, pDrawable->depth); ppt++; pwidth++; } fbFinishAccess(pDrawable); } void fb24_32SetSpans(DrawablePtr pDrawable, GCPtr pGC, char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); RegionPtr pClip = fbGetCompositeClip(pGC); FbBits *dstBits; CARD8 *dst, *d, *s; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; BoxPtr pbox; int n; int x1, x2; fbGetDrawable(pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff); dst = (CARD8 *) dstBits; dstStride *= sizeof(FbBits); while (nspans--) { d = dst + (ppt->y + dstYoff) * dstStride; s = (CARD8 *) src; n = RegionNumRects(pClip); pbox = RegionRects(pClip); while (n--) { if (pbox->y1 > ppt->y) break; if (pbox->y2 > ppt->y) { x1 = ppt->x; x2 = x1 + *pwidth; if (pbox->x1 > x1) x1 = pbox->x1; if (pbox->x2 < x2) x2 = pbox->x2; if (x1 < x2) fb24_32BltDown(s, 0, (x1 - ppt->x), d, dstStride, x1 + dstXoff, (x2 - x1), 1, pGC->alu, pPriv->pm); } } src += PixmapBytePad(*pwidth, pDrawable->depth); ppt++; pwidth++; } fbFinishAccess(pDrawable); } /* * Clip and put 32bpp Z-format images to a 24bpp drawable */ void fb24_32PutZImage(DrawablePtr pDrawable, RegionPtr pClip, int alu, FbBits pm, int x, int y, int width, int height, CARD8 *src, FbStride srcStride) { FbBits *dstBits; CARD8 *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; int nbox; BoxPtr pbox; int x1, y1, x2, y2; fbGetDrawable(pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff); dstStride *= sizeof(FbBits); dst = (CARD8 *) dstBits; for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { x1 = x; y1 = y; x2 = x + width; y2 = y + height; if (x1 < pbox->x1) x1 = pbox->x1; if (y1 < pbox->y1) y1 = pbox->y1; if (x2 > pbox->x2) x2 = pbox->x2; if (y2 > pbox->y2) y2 = pbox->y2; if (x1 >= x2 || y1 >= y2) continue; fb24_32BltDown(src + (y1 - y) * srcStride, srcStride, (x1 - x), dst + (y1 + dstYoff) * dstStride, dstStride, x1 + dstXoff, (x2 - x1), (y2 - y1), alu, pm); } fbFinishAccess(pDrawable); } void fb24_32GetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d) { FbBits *srcBits; CARD8 *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; FbStride dstStride; FbBits pm; fbGetDrawable(pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff); src = (CARD8 *) srcBits; srcStride *= sizeof(FbBits); x += pDrawable->x; y += pDrawable->y; pm = fbReplicatePixel(planeMask, 32); dstStride = PixmapBytePad(w, pDrawable->depth); if (pm != FB_ALLONES) memset(d, 0, dstStride * h); fb24_32BltUp(src + (y + srcYoff) * srcStride, srcStride, x + srcXoff, (CARD8 *) d, dstStride, 0, w, h, GXcopy, pm); fbFinishAccess(pDrawable); } void fb24_32CopyMtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbBits *srcBits; CARD8 *src; FbStride srcStride; int srcBpp; FbBits *dstBits; CARD8 *dst; FbStride dstStride; int dstBpp; fb24_32BltFunc blt; int srcXoff, srcYoff; int dstXoff, dstYoff; fbGetDrawable(pSrcDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff); src = (CARD8 *) srcBits; srcStride *= sizeof(FbBits); fbGetDrawable(pDstDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff); dst = (CARD8 *) dstBits; dstStride *= sizeof(FbBits); if (srcBpp == 24) blt = fb24_32BltUp; else blt = fb24_32BltDown; while (nbox--) { (*blt) (src + (pbox->y1 + dy + srcYoff) * srcStride, srcStride, (pbox->x1 + dx + srcXoff), dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff), (pbox->x2 - pbox->x1), (pbox->y2 - pbox->y1), pGC->alu, pPriv->pm); pbox++; } fbFinishAccess(pSrcDrawable); fbFinishAccess(pDstDrawable); } PixmapPtr fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) { ScreenPtr pScreen = pOldTile->drawable.pScreen; PixmapPtr pNewTile; FbBits *old, *new; FbStride oldStride, newStride; int oldBpp, newBpp; fb24_32BltFunc blt; _X_UNUSED int oldXoff, oldYoff; _X_UNUSED int newXoff, newYoff; pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width, pOldTile->drawable.height, pOldTile->drawable.depth, pOldTile->usage_hint); if (!pNewTile) return 0; fbGetDrawable(&pOldTile->drawable, old, oldStride, oldBpp, oldXoff, oldYoff); fbGetDrawable(&pNewTile->drawable, new, newStride, newBpp, newXoff, newYoff); if (oldBpp == 24) blt = fb24_32BltUp; else blt = fb24_32BltDown; (*blt) ((CARD8 *) old, oldStride * sizeof(FbBits), 0, (CARD8 *) new, newStride * sizeof(FbBits), 0, pOldTile->drawable.width, pOldTile->drawable.height, GXcopy, FB_ALLONES); fbFinishAccess(&pOldTile->drawable); fbFinishAccess(&pNewTile->drawable); return pNewTile; } typedef struct { void *pbits; int width; } miScreenInitParmsRec, *miScreenInitParmsPtr; Bool fb24_32CreateScreenResources(ScreenPtr pScreen) { miScreenInitParmsPtr pScrInitParms; int pitch; Bool retval; /* get the pitch before mi destroys it */ pScrInitParms = (miScreenInitParmsPtr) pScreen->devPrivate; pitch = BitmapBytePad(pScrInitParms->width * 24); if ((retval = miCreateScreenResources(pScreen))) { /* fix the screen pixmap */ PixmapPtr pPix = (PixmapPtr) pScreen->devPrivate; pPix->drawable.bitsPerPixel = 24; pPix->devKind = pitch; } return retval; } Bool fb24_32ModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData) { int bpp, w; if (!pPixmap) return FALSE; bpp = bitsPerPixel; if (bpp <= 0) bpp = pPixmap->drawable.bitsPerPixel; if (bpp == 24) { if (devKind < 0) { w = width; if (w <= 0) w = pPixmap->drawable.width; devKind = BitmapBytePad(w * 24); } } return miModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); } xorg-server-1.17.1/fb/fbwindow.c0000664000175100017510000001333012422315650013363 00000000000000/* * Copyright © 1998 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 #include "fb.h" Bool fbCreateWindow(WindowPtr pWin) { dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin), fbGetScreenPixmap(pWin->drawable.pScreen)); if (pWin->drawable.bitsPerPixel == 32 && pWin->drawable.depth <= 24) pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; return TRUE; } Bool fbDestroyWindow(WindowPtr pWin) { return TRUE; } Bool fbRealizeWindow(WindowPtr pWindow) { return TRUE; } Bool fbPositionWindow(WindowPtr pWin, int x, int y) { return TRUE; } Bool fbUnrealizeWindow(WindowPtr pWindow) { return TRUE; } void fbCopyWindowProc(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { FbBits *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; fbGetDrawable(pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); fbGetDrawable(pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (nbox--) { fbBlt(src + (pbox->y1 + dy + srcYoff) * srcStride, srcStride, (pbox->x1 + dx + srcXoff) * srcBpp, dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff) * dstBpp, (pbox->x2 - pbox->x1) * dstBpp, (pbox->y2 - pbox->y1), GXcopy, FB_ALLONES, dstBpp, reverse, upsidedown); pbox++; } fbFinishAccess(pDstDrawable); fbFinishAccess(pSrcDrawable); } void fbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { RegionRec rgnDst; int dx, dy; PixmapPtr pPixmap = fbGetWindowPixmap(pWin); DrawablePtr pDrawable = &pPixmap->drawable; dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; RegionTranslate(prgnSrc, -dx, -dy); RegionNull(&rgnDst); RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); #ifdef COMPOSITE if (pPixmap->screen_x || pPixmap->screen_y) RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); #endif miCopyRegion(pDrawable, pDrawable, 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); RegionUninit(&rgnDst); fbValidateDrawable(&pWin->drawable); } static void fbFixupWindowPixmap(DrawablePtr pDrawable, PixmapPtr *ppPixmap) { PixmapPtr pPixmap = *ppPixmap; if (pPixmap->drawable.bitsPerPixel != pDrawable->bitsPerPixel) { pPixmap = fb24_32ReformatTile(pPixmap, pDrawable->bitsPerPixel); if (!pPixmap) return; (*pDrawable->pScreen->DestroyPixmap) (*ppPixmap); *ppPixmap = pPixmap; } if (FbEvenTile(pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel)) fbPadPixmap(pPixmap); } Bool fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { if (mask & CWBackPixmap) { if (pWin->backgroundState == BackgroundPixmap) fbFixupWindowPixmap(&pWin->drawable, &pWin->background.pixmap); } if (mask & CWBorderPixmap) { if (pWin->borderIsPixel == FALSE) fbFixupWindowPixmap(&pWin->drawable, &pWin->border.pixmap); } return TRUE; } void fbFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, FbBits and, FbBits xor) { FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; int n = RegionNumRects(pRegion); BoxPtr pbox = RegionRects(pRegion); #ifndef FB_ACCESS_WRAPPER int try_mmx = 0; if (!and) try_mmx = 1; #endif fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (n--) { #ifndef FB_ACCESS_WRAPPER if (!try_mmx || !pixman_fill((uint32_t *) dst, dstStride, dstBpp, pbox->x1 + dstXoff, pbox->y1 + dstYoff, (pbox->x2 - pbox->x1), (pbox->y2 - pbox->y1), xor)) { #endif fbSolid(dst + (pbox->y1 + dstYoff) * dstStride, dstStride, (pbox->x1 + dstXoff) * dstBpp, dstBpp, (pbox->x2 - pbox->x1) * dstBpp, pbox->y2 - pbox->y1, and, xor); #ifndef FB_ACCESS_WRAPPER } #endif fbValidateDrawable(pDrawable); pbox++; } fbFinishAccess(pDrawable); } xorg-server-1.17.1/fb/fbrop.h0000664000175100017510000001055612456571574012710 00000000000000/* * Copyright © 1998 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. */ #ifndef _FBROP_H_ #define _FBROP_H_ typedef struct _mergeRopBits { FbBits ca1, cx1, ca2, cx2; } FbMergeRopRec, *FbMergeRopPtr; extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16]; #define FbDeclareMergeRop() FbBits _ca1, _cx1, _ca2, _cx2; #define FbDeclarePrebuiltMergeRop() FbBits _cca, _ccx; #define FbInitializeMergeRop(alu,pm) {\ const FbMergeRopRec *_bits; \ _bits = &FbMergeRopBits[alu]; \ _ca1 = _bits->ca1 & pm; \ _cx1 = _bits->cx1 | ~pm; \ _ca2 = _bits->ca2 & pm; \ _cx2 = _bits->cx2 & pm; \ } #define FbDestInvarientRop(alu,pm) ((pm) == FB_ALLONES && \ (((alu) >> 1 & 5) == ((alu) & 5))) #define FbDestInvarientMergeRop() (_ca1 == 0 && _cx1 == 0) /* AND has higher precedence than XOR */ #define FbDoMergeRop(src, dst) \ (((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2)) #define FbDoDestInvarientMergeRop(src) (((src) & _ca2) ^ _cx2) #define FbDoMaskMergeRop(src, dst, mask) \ (((dst) & ((((src) & _ca1) ^ _cx1) | ~(mask))) ^ ((((src) & _ca2) ^ _cx2) & (mask))) #define FbDoLeftMaskByteMergeRop(dst, src, lb, l) { \ FbBits __xor = ((src) & _ca2) ^ _cx2; \ FbDoLeftMaskByteRRop(dst,lb,l,((src) & _ca1) ^ _cx1,__xor); \ } #define FbDoRightMaskByteMergeRop(dst, src, rb, r) { \ FbBits __xor = ((src) & _ca2) ^ _cx2; \ FbDoRightMaskByteRRop(dst,rb,r,((src) & _ca1) ^ _cx1,__xor); \ } #define FbDoRRop(dst, and, xor) (((dst) & (and)) ^ (xor)) #define FbDoMaskRRop(dst, and, xor, mask) \ (((dst) & ((and) | ~(mask))) ^ (xor & mask)) /* * Take a single bit (0 or 1) and generate a full mask */ #define fbFillFromBit(b,t) (~((t) ((b) & 1)-1)) #define fbXorT(rop,fg,pm,t) ((((fg) & fbFillFromBit((rop) >> 1,t)) | \ (~(fg) & fbFillFromBit((rop) >> 3,t))) & (pm)) #define fbAndT(rop,fg,pm,t) ((((fg) & fbFillFromBit (rop ^ (rop>>1),t)) | \ (~(fg) & fbFillFromBit((rop>>2) ^ (rop>>3),t))) | \ ~(pm)) #define fbXor(rop,fg,pm) fbXorT(rop,fg,pm,FbBits) #define fbAnd(rop,fg,pm) fbAndT(rop,fg,pm,FbBits) #define fbXorStip(rop,fg,pm) fbXorT(rop,fg,pm,FbStip) #define fbAndStip(rop,fg,pm) fbAndT(rop,fg,pm,FbStip) /* * Stippling operations; */ #define FbStippleRRop(dst, b, fa, fx, ba, bx) \ (FbDoRRop(dst, fa, fx) & b) | (FbDoRRop(dst, ba, bx) & ~b) #define FbStippleRRopMask(dst, b, fa, fx, ba, bx, m) \ (FbDoMaskRRop(dst, fa, fx, m) & (b)) | (FbDoMaskRRop(dst, ba, bx, m) & ~(b)) #define FbDoLeftMaskByteStippleRRop(dst, b, fa, fx, ba, bx, lb, l) { \ FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \ FbDoLeftMaskByteRRop(dst, lb, l, ((fa) & (b)) | ((ba) & ~(b)), __xor); \ } #define FbDoRightMaskByteStippleRRop(dst, b, fa, fx, ba, bx, rb, r) { \ FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \ FbDoRightMaskByteRRop(dst, rb, r, ((fa) & (b)) | ((ba) & ~(b)), __xor); \ } #define FbOpaqueStipple(b, fg, bg) (((fg) & (b)) | ((bg) & ~(b))) /* * Compute rop for using tile code for 1-bit dest stipples; modifies * existing rop to flip depending on pixel values */ #define FbStipple1RopPick(alu,b) (((alu) >> (2 - (((b) & 1) << 1))) & 3) #define FbOpaqueStipple1Rop(alu,fg,bg) (FbStipple1RopPick(alu,fg) | \ (FbStipple1RopPick(alu,bg) << 2)) #define FbStipple1Rop(alu,fg) (FbStipple1RopPick(alu,fg) | 4) #endif xorg-server-1.17.1/fb/fbseg.c0000664000175100017510000004150012432306326012633 00000000000000/* * Copyright © 1998 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 #include "fb.h" #include "miline.h" #define fbBresShiftMask(mask,dir,bpp) ((bpp == FB_STIP_UNIT) ? 0 : \ ((dir < 0) ? FbStipLeft(mask,bpp) : \ FbStipRight(mask,bpp))) static void fbBresSolid(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbStip *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbStip and = (FbStip) pPriv->and; FbStip xor = (FbStip) pPriv->xor; FbStip mask, mask0; FbStip bits; fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); dst += ((y1 + dstYoff) * dstStride); x1 = (x1 + dstXoff) * dstBpp; dst += x1 >> FB_STIP_SHIFT; x1 &= FB_STIP_MASK; mask0 = FbStipMask(0, dstBpp); mask = FbStipRight(mask0, x1); if (signdx < 0) mask0 = FbStipRight(mask0, FB_STIP_UNIT - dstBpp); if (signdy < 0) dstStride = -dstStride; if (axis == X_AXIS) { bits = 0; while (len--) { bits |= mask; mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits)); bits = 0; dst += signdx; mask = mask0; } e += e1; if (e >= 0) { if (bits) { 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); if (!mask) { dst += signdx; mask = mask0; } } } } fbFinishAccess(pDrawable); } static void fbBresDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbStip *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbStip and = (FbStip) pPriv->and; FbStip xor = (FbStip) pPriv->xor; FbStip bgand = (FbStip) pPriv->bgand; FbStip bgxor = (FbStip) pPriv->bgxor; FbStip mask, mask0; FbDashDeclare; int dashlen; Bool even; Bool doOdd; fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); doOdd = pGC->lineStyle == LineDoubleDash; FbDashInit(pGC, pPriv, dashOffset, dashlen, even); dst += ((y1 + dstYoff) * dstStride); x1 = (x1 + dstXoff) * dstBpp; dst += x1 >> FB_STIP_SHIFT; x1 &= FB_STIP_MASK; mask0 = FbStipMask(0, dstBpp); mask = FbStipRight(mask0, x1); if (signdx < 0) mask0 = FbStipRight(mask0, FB_STIP_UNIT - dstBpp); if (signdy < 0) dstStride = -dstStride; while (len--) { if (even) WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); else if (doOdd) WRITE(dst, FbDoMaskRRop(READ(dst), bgand, bgxor, mask)); if (axis == X_AXIS) { mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { dst += signdx; mask = mask0; } e += e1; if (e >= 0) { dst += dstStride; e += e3; } } else { dst += dstStride; e += e1; if (e >= 0) { e += e3; mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { dst += signdx; mask = mask0; } } } FbDashStep(dashlen, even); } fbFinishAccess(pDrawable); } static void fbBresFill(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { while (len--) { fbFill(pDrawable, pGC, x1, y1, 1, 1); if (axis == X_AXIS) { x1 += signdx; e += e1; if (e >= 0) { e += e3; y1 += signdy; } } else { y1 += signdy; e += e1; if (e >= 0) { e += e3; x1 += signdx; } } } } static void fbSetFg(DrawablePtr pDrawable, GCPtr pGC, Pixel fg) { if (fg != pGC->fgPixel) { ChangeGCVal val; val.val = fg; ChangeGC(NullClient, pGC, GCForeground, &val); ValidateGC(pDrawable, pGC); } } static void fbBresFillDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbDashDeclare; int dashlen; Bool even; Bool doOdd; Bool doBg; Pixel fg, bg; fg = pGC->fgPixel; bg = pGC->bgPixel; /* whether to fill the odd dashes */ doOdd = pGC->lineStyle == LineDoubleDash; /* whether to switch fg to bg when filling odd dashes */ doBg = doOdd && (pGC->fillStyle == FillSolid || pGC->fillStyle == FillStippled); /* compute current dash position */ FbDashInit(pGC, pPriv, dashOffset, dashlen, even); while (len--) { if (even || doOdd) { if (doBg) { if (even) fbSetFg(pDrawable, pGC, fg); else fbSetFg(pDrawable, pGC, bg); } fbFill(pDrawable, pGC, x1, y1, 1, 1); } if (axis == X_AXIS) { x1 += signdx; e += e1; if (e >= 0) { e += e3; y1 += signdy; } } else { y1 += signdy; e += e1; if (e >= 0) { e += e3; x1 += signdx; } } FbDashStep(dashlen, even); } if (doBg) fbSetFg(pDrawable, pGC, fg); } static void fbBresSolid24RRop(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbStip *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbStip and = pPriv->and; FbStip xor = pPriv->xor; FbStip leftMask, rightMask; int nl; FbStip *d; int x; int rot; FbStip andT, xorT; fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); dst += ((y1 + dstYoff) * dstStride); x1 = (x1 + dstXoff) * 24; if (signdy < 0) dstStride = -dstStride; signdx *= 24; while (len--) { d = dst + (x1 >> FB_STIP_SHIFT); x = x1 & FB_STIP_MASK; rot = FbFirst24Rot(x); andT = FbRot24Stip(and, rot); xorT = FbRot24Stip(xor, rot); FbMaskStip(x, 24, leftMask, nl, rightMask); if (leftMask) { WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, leftMask)); d++; andT = FbNext24Stip(andT); xorT = FbNext24Stip(xorT); } if (rightMask) WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); if (axis == X_AXIS) { x1 += signdx; e += e1; if (e >= 0) { e += e3; dst += dstStride; } } else { dst += dstStride; e += e1; if (e >= 0) { e += e3; x1 += signdx; } } } fbFinishAccess(pDrawable); } static void fbBresDash24RRop(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbStip *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbStip andT, xorT; FbStip fgand = pPriv->and; FbStip fgxor = pPriv->xor; FbStip bgand = pPriv->bgand; FbStip bgxor = pPriv->bgxor; FbStip leftMask, rightMask; int nl; FbStip *d; int x; int rot; FbDashDeclare; int dashlen; Bool even; Bool doOdd; fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); doOdd = pGC->lineStyle == LineDoubleDash; /* compute current dash position */ FbDashInit(pGC, pPriv, dashOffset, dashlen, even); dst += ((y1 + dstYoff) * dstStride); x1 = (x1 + dstXoff) * 24; if (signdy < 0) dstStride = -dstStride; signdx *= 24; while (len--) { if (even || doOdd) { if (even) { andT = fgand; xorT = fgxor; } else { andT = bgand; xorT = bgxor; } d = dst + (x1 >> FB_STIP_SHIFT); x = x1 & FB_STIP_MASK; rot = FbFirst24Rot(x); andT = FbRot24Stip(andT, rot); xorT = FbRot24Stip(xorT, rot); FbMaskStip(x, 24, leftMask, nl, rightMask); if (leftMask) { WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, leftMask)); d++; andT = FbNext24Stip(andT); xorT = FbNext24Stip(xorT); } if (rightMask) WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); } if (axis == X_AXIS) { x1 += signdx; e += e1; if (e >= 0) { e += e3; dst += dstStride; } } else { dst += dstStride; e += e1; if (e >= 0) { e += e3; x1 += signdx; } } FbDashStep(dashlen, even); } fbFinishAccess(pDrawable); } /* * For drivers that want to bail drawing some lines, this * function takes care of selecting the appropriate rasterizer * based on the contents of the specified GC. */ static FbBres * fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); int dstBpp = pDrawable->bitsPerPixel; FbBres *bres; if (pGC->lineStyle == LineSolid) { bres = fbBresFill; if (pGC->fillStyle == FillSolid) { bres = fbBresSolid; if (dstBpp == 24) bres = fbBresSolid24RRop; if (pPriv->and == 0) { switch (dstBpp) { case 8: bres = fbBresSolid8; break; case 16: bres = fbBresSolid16; break; case 24: bres = fbBresSolid24; break; case 32: bres = fbBresSolid32; break; } } } } else { bres = fbBresFillDash; if (pGC->fillStyle == FillSolid) { bres = fbBresDash; if (dstBpp == 24) bres = fbBresDash24RRop; if (pPriv->and == 0 && (pGC->lineStyle == LineOnOffDash || pPriv->bgand == 0)) { switch (dstBpp) { case 8: bres = fbBresDash8; break; case 16: bres = fbBresDash16; break; case 24: bres = fbBresDash24; break; case 32: bres = fbBresDash32; break; } } } } return bres; } void fbSegment(DrawablePtr pDrawable, GCPtr pGC, int x1, int y1, int x2, int y2, Bool drawLast, int *dashOffset) { FbBres *bres; RegionPtr pClip = fbGetCompositeClip(pGC); BoxPtr pBox; int nBox; int adx; /* abs values of dx and dy */ int ady; int signdx; /* sign of dx and dy */ int signdy; int e, e1, e2, e3; /* bresenham error and increments */ int len; /* length of segment */ int axis; /* major axis */ int octant; int dashoff; int doff; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ nBox = RegionNumRects(pClip); pBox = RegionRects(pClip); bres = fbSelectBres(pDrawable, pGC); CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant); if (adx > ady) { axis = X_AXIS; e1 = ady << 1; e2 = e1 - (adx << 1); e = e1 - adx; len = adx; } else { axis = Y_AXIS; e1 = adx << 1; e2 = e1 - (ady << 1); e = e1 - ady; SetYMajorOctant(octant); len = ady; } FIXUP_ERROR(e, octant, bias); /* * Adjust error terms to compare against zero */ e3 = e2 - e1; e = e - e1; /* we have bresenham parameters and two points. all we have to do now is clip and draw. */ if (drawLast) len++; dashoff = *dashOffset; *dashOffset = dashoff + len; while (nBox--) { oc1 = 0; oc2 = 0; OUTCODES(oc1, x1, y1, pBox); OUTCODES(oc2, x2, y2, pBox); if ((oc1 | oc2) == 0) { (*bres) (pDrawable, pGC, dashoff, signdx, signdy, axis, x1, y1, e, e1, e3, len); break; } else if (oc1 & oc2) { pBox++; } else { int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2; int clip1 = 0, clip2 = 0; int clipdx, clipdy; int err; 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 (axis == X_AXIS) len = abs(new_x2 - new_x1); else len = abs(new_y2 - new_y1); if (clip2 != 0 || drawLast) len++; if (len) { /* unwind bresenham error term to first point */ doff = dashoff; err = e; if (clip1) { clipdx = abs(new_x1 - x1); clipdy = abs(new_y1 - y1); if (axis == X_AXIS) { doff += clipdx; err += e3 * clipdy + e1 * clipdx; } else { doff += clipdy; err += e3 * clipdx + e1 * clipdy; } } (*bres) (pDrawable, pGC, doff, signdx, signdy, axis, new_x1, new_y1, err, e1, e3, len); } pBox++; } } /* while (nBox--) */ } xorg-server-1.17.1/fb/fbbits.h0000664000175100017510000006162712422276410013036 00000000000000/* * Copyright © 1998 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. */ /* * This file defines functions for drawing some primitives using * underlying datatypes instead of masks */ #define isClipped(c,ul,lr) (((c) | ((c) - (ul)) | ((lr) - (c))) & 0x80008000) #ifdef HAVE_DIX_CONFIG_H #include #endif #ifdef BITSMUL #define MUL BITSMUL #else #define MUL 1 #endif #ifdef BITSSTORE #define STORE(b,x) BITSSTORE(b,x) #else #define STORE(b,x) WRITE((b), (x)) #endif #ifdef BITSRROP #define RROP(b,a,x) BITSRROP(b,a,x) #else #define RROP(b,a,x) WRITE((b), FbDoRRop (READ(b), (a), (x))) #endif #ifdef BITSUNIT #define UNIT BITSUNIT #define USE_SOLID #else #define UNIT BITS #endif /* * Define the following before including this file: * * BRESSOLID name of function for drawing a solid segment * BRESDASH name of function for drawing a dashed segment * DOTS name of function for drawing dots * ARC name of function for drawing a solid arc * BITS type of underlying unit */ #ifdef BRESSOLID void BRESSOLID(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); UNIT *bits; FbStride bitsStride; FbStride majorStep, minorStep; BITS xor = (BITS) pPriv->xor; fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); bits = ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff) * MUL; bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); if (signdy < 0) bitsStride = -bitsStride; if (axis == X_AXIS) { majorStep = signdx * MUL; minorStep = bitsStride; } else { majorStep = bitsStride; minorStep = signdx * MUL; } while (len--) { STORE(bits, xor); bits += majorStep; e += e1; if (e >= 0) { bits += minorStep; e += e3; } } fbFinishAccess(pDrawable); } #endif #ifdef BRESDASH void BRESDASH(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); UNIT *bits; FbStride bitsStride; FbStride majorStep, minorStep; BITS xorfg, xorbg; FbDashDeclare; int dashlen; Bool even; Bool doOdd; fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); doOdd = pGC->lineStyle == LineDoubleDash; xorfg = (BITS) pPriv->xor; xorbg = (BITS) pPriv->bgxor; FbDashInit(pGC, pPriv, dashOffset, dashlen, even); bits = ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff) * MUL; bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); if (signdy < 0) bitsStride = -bitsStride; if (axis == X_AXIS) { majorStep = signdx * MUL; minorStep = bitsStride; } else { majorStep = bitsStride; minorStep = signdx * MUL; } if (dashlen >= len) dashlen = len; if (doOdd) { if (!even) goto doubleOdd; for (;;) { len -= dashlen; while (dashlen--) { STORE(bits, xorfg); bits += majorStep; if ((e += e1) >= 0) { e += e3; bits += minorStep; } } if (!len) break; FbDashNextEven(dashlen); if (dashlen >= len) dashlen = len; doubleOdd: len -= dashlen; while (dashlen--) { STORE(bits, xorbg); bits += majorStep; if ((e += e1) >= 0) { e += e3; bits += minorStep; } } if (!len) break; FbDashNextOdd(dashlen); if (dashlen >= len) dashlen = len; } } else { if (!even) goto onOffOdd; for (;;) { len -= dashlen; while (dashlen--) { STORE(bits, xorfg); bits += majorStep; if ((e += e1) >= 0) { e += e3; bits += minorStep; } } if (!len) break; FbDashNextEven(dashlen); if (dashlen >= len) dashlen = len; onOffOdd: len -= dashlen; while (dashlen--) { bits += majorStep; if ((e += e1) >= 0) { e += e3; bits += minorStep; } } if (!len) break; FbDashNextOdd(dashlen); if (dashlen >= len) dashlen = len; } } fbFinishAccess(pDrawable); } #endif #ifdef DOTS void DOTS(FbBits * dst, FbStride dstStride, int dstBpp, BoxPtr pBox, xPoint * ptsOrig, int npt, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor) { INT32 *pts = (INT32 *) ptsOrig; UNIT *bits = (UNIT *) dst; UNIT *point; BITS bxor = (BITS) xor; BITS band = (BITS) and; FbStride bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); INT32 ul, lr; INT32 pt; ul = coordToInt(pBox->x1 - xorg, pBox->y1 - yorg); lr = coordToInt(pBox->x2 - xorg - 1, pBox->y2 - yorg - 1); bits += bitsStride * (yorg + yoff) + (xorg + xoff) * MUL; if (and == 0) { while (npt--) { pt = *pts++; if (!isClipped(pt, ul, lr)) { point = bits + intToY(pt) * bitsStride + intToX(pt) * MUL; STORE(point, bxor); } } } else { while (npt--) { pt = *pts++; if (!isClipped(pt, ul, lr)) { point = bits + intToY(pt) * bitsStride + intToX(pt) * MUL; RROP(point, band, bxor); } } } } #endif #ifdef ARC #define ARCCOPY(d) STORE(d,xorBits) #define ARCRROP(d) RROP(d,andBits,xorBits) void ARC(FbBits * dst, FbStride dstStride, int dstBpp, xArc * arc, int drawX, int drawY, FbBits and, FbBits xor) { UNIT *bits; FbStride bitsStride; miZeroArcRec info; Bool do360; int x; UNIT *yorgp, *yorgop; BITS andBits, xorBits; int yoffset, dyoffset; int y, a, b, d, mask; int k1, k3, dx, dy; bits = (UNIT *) dst; bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); andBits = (BITS) and; xorBits = (BITS) xor; do360 = miZeroArcSetup(arc, &info, TRUE); yorgp = bits + ((info.yorg + drawY) * bitsStride); yorgop = bits + ((info.yorgo + drawY) * bitsStride); info.xorg = (info.xorg + drawX) * MUL; info.xorgo = (info.xorgo + drawX) * MUL; MIARCSETUP(); yoffset = y ? bitsStride : 0; dyoffset = 0; mask = info.initialMask; if (!(arc->width & 1)) { if (andBits == 0) { if (mask & 2) ARCCOPY(yorgp + info.xorgo); if (mask & 8) ARCCOPY(yorgop + info.xorgo); } else { if (mask & 2) ARCRROP(yorgp + info.xorgo); if (mask & 8) ARCRROP(yorgop + info.xorgo); } } if (!info.end.x || !info.end.y) { mask = info.end.mask; info.end = info.altend; } if (do360 && (arc->width == arc->height) && !(arc->width & 1)) { int xoffset = bitsStride; UNIT *yorghb = yorgp + (info.h * bitsStride) + info.xorg; UNIT *yorgohb = yorghb - info.h * MUL; yorgp += info.xorg; yorgop += info.xorg; yorghb += info.h * MUL; while (1) { if (andBits == 0) { ARCCOPY(yorgp + yoffset + x * MUL); ARCCOPY(yorgp + yoffset - x * MUL); ARCCOPY(yorgop - yoffset - x * MUL); ARCCOPY(yorgop - yoffset + x * MUL); } else { ARCRROP(yorgp + yoffset + x * MUL); ARCRROP(yorgp + yoffset - x * MUL); ARCRROP(yorgop - yoffset - x * MUL); ARCRROP(yorgop - yoffset + x * MUL); } if (a < 0) break; if (andBits == 0) { ARCCOPY(yorghb - xoffset - y * MUL); ARCCOPY(yorgohb - xoffset + y * MUL); ARCCOPY(yorgohb + xoffset + y * MUL); ARCCOPY(yorghb + xoffset - y * MUL); } else { ARCRROP(yorghb - xoffset - y * MUL); ARCRROP(yorgohb - xoffset + y * MUL); ARCRROP(yorgohb + xoffset + y * MUL); ARCRROP(yorghb + xoffset - y * MUL); } xoffset += bitsStride; MIARCCIRCLESTEP(yoffset += bitsStride; ); } yorgp -= info.xorg; yorgop -= info.xorg; x = info.w; yoffset = info.h * bitsStride; } else if (do360) { while (y < info.h || x < info.w) { MIARCOCTANTSHIFT(dyoffset = bitsStride; ); if (andBits == 0) { ARCCOPY(yorgp + yoffset + info.xorg + x * MUL); ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL); ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL); ARCCOPY(yorgop - yoffset + info.xorg + x * MUL); } else { ARCRROP(yorgp + yoffset + info.xorg + x * MUL); ARCRROP(yorgp + yoffset + info.xorgo - x * MUL); ARCRROP(yorgop - yoffset + info.xorgo - x * MUL); ARCRROP(yorgop - yoffset + info.xorg + x * MUL); } MIARCSTEP(yoffset += dyoffset; , yoffset += bitsStride; ); } } else { while (y < info.h || x < info.w) { MIARCOCTANTSHIFT(dyoffset = bitsStride; ); if ((x == info.start.x) || (y == info.start.y)) { mask = info.start.mask; info.start = info.altstart; } if (andBits == 0) { if (mask & 1) ARCCOPY(yorgp + yoffset + info.xorg + x * MUL); if (mask & 2) ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL); if (mask & 4) ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL); if (mask & 8) ARCCOPY(yorgop - yoffset + info.xorg + x * MUL); } else { if (mask & 1) ARCRROP(yorgp + yoffset + info.xorg + x * MUL); if (mask & 2) ARCRROP(yorgp + yoffset + info.xorgo - x * MUL); if (mask & 4) ARCRROP(yorgop - yoffset + info.xorgo - x * MUL); if (mask & 8) ARCRROP(yorgop - yoffset + info.xorg + x * MUL); } if ((x == info.end.x) || (y == info.end.y)) { mask = info.end.mask; info.end = info.altend; } MIARCSTEP(yoffset += dyoffset; , yoffset += bitsStride; ); } } if ((x == info.start.x) || (y == info.start.y)) mask = info.start.mask; if (andBits == 0) { if (mask & 1) ARCCOPY(yorgp + yoffset + info.xorg + x * MUL); if (mask & 4) ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL); if (arc->height & 1) { if (mask & 2) ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL); if (mask & 8) ARCCOPY(yorgop - yoffset + info.xorg + x * MUL); } } else { if (mask & 1) ARCRROP(yorgp + yoffset + info.xorg + x * MUL); if (mask & 4) ARCRROP(yorgop - yoffset + info.xorgo - x * MUL); if (arc->height & 1) { if (mask & 2) ARCRROP(yorgp + yoffset + info.xorgo - x * MUL); if (mask & 8) ARCRROP(yorgop - yoffset + info.xorg + x * MUL); } } } #undef ARCCOPY #undef ARCRROP #endif #ifdef GLYPH #if BITMAP_BIT_ORDER == LSBFirst #define WRITE_ADDR1(n) (n) #define WRITE_ADDR2(n) (n) #define WRITE_ADDR4(n) (n) #else #define WRITE_ADDR1(n) ((n) ^ 3) #define WRITE_ADDR2(n) ((n) ^ 2) #define WRITE_ADDR4(n) ((n)) #endif #define WRITE1(d,n,fg) WRITE(d + WRITE_ADDR1(n), (BITS) (fg)) #ifdef BITS2 #define WRITE2(d,n,fg) WRITE((BITS2 *) &((d)[WRITE_ADDR2(n)]), (BITS2) (fg)) #else #define WRITE2(d,n,fg) (WRITE1(d,n,fg), WRITE1(d,(n)+1,fg)) #endif #ifdef BITS4 #define WRITE4(d,n,fg) WRITE((BITS4 *) &((d)[WRITE_ADDR4(n)]), (BITS4) (fg)) #else #define WRITE4(d,n,fg) (WRITE2(d,n,fg), WRITE2(d,(n)+2,fg)) #endif void GLYPH(FbBits * dstBits, FbStride dstStride, int dstBpp, FbStip * stipple, FbBits fg, int x, int height) { int lshift; FbStip bits; BITS *dstLine; BITS *dst; int n; int shift; dstLine = (BITS *) dstBits; dstLine += x & ~3; dstStride *= (sizeof(FbBits) / sizeof(BITS)); shift = x & 3; lshift = 4 - shift; while (height--) { bits = *stipple++; dst = (BITS *) dstLine; n = lshift; while (bits) { switch (FbStipMoveLsb(FbLeftStipBits(bits, n), 4, n)) { case 0: break; case 1: WRITE1(dst, 0, fg); break; case 2: WRITE1(dst, 1, fg); break; case 3: WRITE2(dst, 0, fg); break; case 4: WRITE1(dst, 2, fg); break; case 5: WRITE1(dst, 0, fg); WRITE1(dst, 2, fg); break; case 6: WRITE1(dst, 1, fg); WRITE1(dst, 2, fg); break; case 7: WRITE2(dst, 0, fg); WRITE1(dst, 2, fg); break; case 8: WRITE1(dst, 3, fg); break; case 9: WRITE1(dst, 0, fg); WRITE1(dst, 3, fg); break; case 10: WRITE1(dst, 1, fg); WRITE1(dst, 3, fg); break; case 11: WRITE2(dst, 0, fg); WRITE1(dst, 3, fg); break; case 12: WRITE2(dst, 2, fg); break; case 13: WRITE1(dst, 0, fg); WRITE2(dst, 2, fg); break; case 14: WRITE1(dst, 1, fg); WRITE2(dst, 2, fg); break; case 15: WRITE4(dst, 0, fg); break; } bits = FbStipLeft(bits, n); n = 4; dst += 4; } dstLine += dstStride; } } #undef WRITE_ADDR1 #undef WRITE_ADDR2 #undef WRITE_ADDR4 #undef WRITE1 #undef WRITE2 #undef WRITE4 #endif #ifdef POLYLINE void POLYLINE(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig) { INT32 *pts = (INT32 *) ptsOrig; int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); BoxPtr pBox = RegionExtents(fbGetCompositeClip(pGC)); FbBits *dst; int dstStride; int dstBpp; int dstXoff, dstYoff; UNIT *bits, *bitsBase; FbStride bitsStride; BITS xor = fbGetGCPrivate(pGC)->xor; BITS and = fbGetGCPrivate(pGC)->and; int dashoffset = 0; INT32 ul, lr; INT32 pt1, pt2; int e, e1, e3, len; int stepmajor, stepminor; int octant; if (mode == CoordModePrevious) fbFixCoordModePrevious(npt, ptsOrig); fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); bitsBase = ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff) * MUL; ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff); lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1); pt1 = *pts++; npt--; pt2 = *pts++; npt--; for (;;) { if (isClipped(pt1, ul, lr) | isClipped(pt2, ul, lr)) { fbSegment(pDrawable, pGC, intToX(pt1) + xoff, intToY(pt1) + yoff, intToX(pt2) + xoff, intToY(pt2) + yoff, npt == 0 && pGC->capStyle != CapNotLast, &dashoffset); if (!npt) { fbFinishAccess(pDrawable); return; } pt1 = pt2; pt2 = *pts++; npt--; } else { bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1) * MUL; for (;;) { CalcLineDeltas(intToX(pt1), intToY(pt1), intToX(pt2), intToY(pt2), len, e1, stepmajor, stepminor, 1, bitsStride, octant); stepmajor *= MUL; if (len < e1) { e3 = len; len = e1; e1 = e3; e3 = stepminor; stepminor = stepmajor; stepmajor = e3; SetYMajorOctant(octant); } e = -len; e1 <<= 1; e3 = e << 1; FIXUP_ERROR(e, octant, bias); if (and == 0) { while (len--) { STORE(bits, xor); bits += stepmajor; e += e1; if (e >= 0) { bits += stepminor; e += e3; } } } else { while (len--) { RROP(bits, and, xor); bits += stepmajor; e += e1; if (e >= 0) { bits += stepminor; e += e3; } } } if (!npt) { if (pGC->capStyle != CapNotLast && pt2 != *((INT32 *) ptsOrig)) { RROP(bits, and, xor); } fbFinishAccess(pDrawable); return; } pt1 = pt2; pt2 = *pts++; --npt; if (isClipped(pt2, ul, lr)) break; } } } fbFinishAccess(pDrawable); } #endif #ifdef POLYSEGMENT void POLYSEGMENT(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) { INT32 *pts = (INT32 *) pseg; int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); BoxPtr pBox = RegionExtents(fbGetCompositeClip(pGC)); FbBits *dst; int dstStride; int dstBpp; int dstXoff, dstYoff; UNIT *bits, *bitsBase; FbStride bitsStride; FbBits xorBits = fbGetGCPrivate(pGC)->xor; FbBits andBits = fbGetGCPrivate(pGC)->and; BITS xor = xorBits; BITS and = andBits; int dashoffset = 0; INT32 ul, lr; INT32 pt1, pt2; int e, e1, e3, len; int stepmajor, stepminor; int octant; Bool capNotLast; fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT)); bitsBase = ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff) * MUL; ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff); lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1); capNotLast = pGC->capStyle == CapNotLast; while (nseg--) { pt1 = *pts++; pt2 = *pts++; if (isClipped(pt1, ul, lr) | isClipped(pt2, ul, lr)) { fbSegment(pDrawable, pGC, intToX(pt1) + xoff, intToY(pt1) + yoff, intToX(pt2) + xoff, intToY(pt2) + yoff, !capNotLast, &dashoffset); } else { CalcLineDeltas(intToX(pt1), intToY(pt1), intToX(pt2), intToY(pt2), len, e1, stepmajor, stepminor, 1, bitsStride, octant); if (e1 == 0 && len > 3 #if MUL != 1 && FbCheck24Pix(and) && FbCheck24Pix(xor) #endif ) { int x1, x2; FbBits *dstLine; int dstX, width; FbBits startmask, endmask; int nmiddle; if (stepmajor < 0) { x1 = intToX(pt2); x2 = intToX(pt1) + 1; if (capNotLast) x1++; } else { x1 = intToX(pt1); x2 = intToX(pt2); if (!capNotLast) x2++; } dstX = (x1 + xoff + dstXoff) * (sizeof(UNIT) * 8 * MUL); width = (x2 - x1) * (sizeof(UNIT) * 8 * MUL); dstLine = dst + (intToY(pt1) + yoff + dstYoff) * dstStride; dstLine += dstX >> FB_SHIFT; dstX &= FB_MASK; FbMaskBits(dstX, width, startmask, nmiddle, endmask); if (startmask) { WRITE(dstLine, FbDoMaskRRop(READ(dstLine), andBits, xorBits, startmask)); dstLine++; } if (!andBits) while (nmiddle--) WRITE(dstLine++, xorBits); else while (nmiddle--) { WRITE(dstLine, FbDoRRop(READ(dstLine), andBits, xorBits)); dstLine++; } if (endmask) WRITE(dstLine, FbDoMaskRRop(READ(dstLine), andBits, xorBits, endmask)); } else { stepmajor *= MUL; bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1) * MUL; if (len < e1) { e3 = len; len = e1; e1 = e3; e3 = stepminor; stepminor = stepmajor; stepmajor = e3; SetYMajorOctant(octant); } e = -len; e1 <<= 1; e3 = e << 1; FIXUP_ERROR(e, octant, bias); if (!capNotLast) len++; if (and == 0) { while (len--) { STORE(bits, xor); bits += stepmajor; e += e1; if (e >= 0) { bits += stepminor; e += e3; } } } else { while (len--) { RROP(bits, and, xor); bits += stepmajor; e += e1; if (e >= 0) { bits += stepminor; e += e3; } } } } } } fbFinishAccess(pDrawable); } #endif #undef MUL #undef STORE #undef RROP #undef UNIT #undef USE_SOLID #undef isClipped xorg-server-1.17.1/fb/fbsolid.c0000664000175100017510000001177612422276410013202 00000000000000/* * Copyright © 1998 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. */ #define FbSelectPart(xor,o,t) xor #ifdef HAVE_DIX_CONFIG_H #include #endif #include "fb.h" void fbSolid(FbBits * dst, FbStride dstStride, int dstX, int bpp, int width, int height, FbBits and, FbBits xor) { FbBits startmask, endmask; int n, nmiddle; int startbyte, endbyte; if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor))) { fbSolid24(dst, dstStride, dstX, width, height, and, xor); return; } dst += dstX >> FB_SHIFT; dstX &= FB_MASK; FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte, nmiddle, endmask, endbyte); if (startmask) dstStride--; dstStride -= nmiddle; while (height--) { if (startmask) { FbDoLeftMaskByteRRop(dst, startbyte, startmask, and, xor); dst++; } n = nmiddle; if (!and) while (n--) WRITE(dst++, xor); else while (n--) { WRITE(dst, FbDoRRop(READ(dst), and, xor)); dst++; } if (endmask) FbDoRightMaskByteRRop(dst, endbyte, endmask, and, xor); dst += dstStride; } } void fbSolid24(FbBits * dst, FbStride dstStride, int dstX, int width, int height, FbBits and, FbBits xor) { FbBits startmask, endmask; FbBits xor0 = 0, xor1 = 0, xor2 = 0; FbBits and0 = 0, and1 = 0, and2 = 0; FbBits xorS = 0, andS = 0, xorE = 0, andE = 0; int n, nmiddle; int rotS, rot; dst += dstX >> FB_SHIFT; dstX &= FB_MASK; /* * Rotate pixel values this far across the word to align on * screen pixel boundaries */ rot = FbFirst24Rot(dstX); FbMaskBits(dstX, width, startmask, nmiddle, endmask); if (startmask) dstStride--; dstStride -= nmiddle; /* * Precompute rotated versions of the rasterop values */ rotS = rot; xor = FbRot24(xor, rotS); and = FbRot24(and, rotS); if (startmask) { xorS = xor; andS = and; xor = FbNext24Pix(xor); and = FbNext24Pix(and); } if (nmiddle) { xor0 = xor; and0 = and; xor1 = FbNext24Pix(xor0); and1 = FbNext24Pix(and0); xor2 = FbNext24Pix(xor1); and2 = FbNext24Pix(and1); } if (endmask) { switch (nmiddle % 3) { case 0: xorE = xor; andE = and; break; case 1: xorE = xor1; andE = and1; break; case 2: xorE = xor2; andE = and2; break; } } while (height--) { if (startmask) { WRITE(dst, FbDoMaskRRop(READ(dst), andS, xorS, startmask)); dst++; } n = nmiddle; if (!and0) { while (n >= 3) { WRITE(dst++, xor0); WRITE(dst++, xor1); WRITE(dst++, xor2); n -= 3; } if (n) { WRITE(dst++, xor0); n--; if (n) { WRITE(dst++, xor1); } } } else { while (n >= 3) { WRITE(dst, FbDoRRop(READ(dst), and0, xor0)); dst++; WRITE(dst, FbDoRRop(READ(dst), and1, xor1)); dst++; WRITE(dst, FbDoRRop(READ(dst), and2, xor2)); dst++; n -= 3; } if (n) { WRITE(dst, FbDoRRop(READ(dst), and0, xor0)); dst++; n--; if (n) { WRITE(dst, FbDoRRop(READ(dst), and1, xor1)); dst++; } } } if (endmask) WRITE(dst, FbDoMaskRRop(READ(dst), andE, xorE, endmask)); dst += dstStride; } } xorg-server-1.17.1/fb/fbarc.c0000664000175100017510000001201112422276410012614 00000000000000/* * Copyright © 1998 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 "fb.h" #include "mizerarc.h" #include typedef void (*FbArc) (FbBits * dst, FbStride dstStride, int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor); void fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs) { FbArc arc; if (pGC->lineWidth == 0) { arc = 0; if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid) { switch (pDrawable->bitsPerPixel) { case 8: arc = fbArc8; break; case 16: arc = fbArc16; break; case 24: arc = fbArc24; break; case 32: arc = fbArc32; break; } } if (arc) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; BoxRec box; int x2, y2; RegionPtr cclip; #ifdef FB_ACCESS_WRAPPER int wrapped = 1; #endif cclip = fbGetCompositeClip(pGC); fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (narcs--) { if (miCanZeroArc(parcs)) { box.x1 = parcs->x + pDrawable->x; box.y1 = parcs->y + pDrawable->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) parcs->width + 1; box.x2 = x2; y2 = box.y1 + (int) parcs->height + 1; box.y2 = y2; if ((x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) && (RegionContainsRect(cclip, &box) == rgnIN)) { #ifdef FB_ACCESS_WRAPPER if (!wrapped) { fbPrepareAccess(pDrawable); wrapped = 1; } #endif (*arc) (dst, dstStride, dstBpp, parcs, pDrawable->x + dstXoff, pDrawable->y + dstYoff, pPriv->and, pPriv->xor); } else { #ifdef FB_ACCESS_WRAPPER if (wrapped) { fbFinishAccess(pDrawable); wrapped = 0; } #endif miZeroPolyArc(pDrawable, pGC, 1, parcs); } } else { #ifdef FB_ACCESS_WRAPPER if (wrapped) { fbFinishAccess(pDrawable); wrapped = 0; } #endif miPolyArc(pDrawable, pGC, 1, parcs); } parcs++; } #ifdef FB_ACCESS_WRAPPER if (wrapped) { fbFinishAccess(pDrawable); wrapped = 0; } #endif } else miZeroPolyArc(pDrawable, pGC, narcs, parcs); } else miPolyArc(pDrawable, pGC, narcs, parcs); } xorg-server-1.17.1/fb/fbfillrect.c0000664000175100017510000000647412456571574013713 00000000000000/* * Copyright © 1998 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 "fb.h" void fbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect) { RegionPtr pClip = fbGetCompositeClip(pGC); register BoxPtr pbox; BoxPtr pextent; int extentX1, extentX2, extentY1, extentY2; int fullX1, fullX2, fullY1, fullY2; int partX1, partX2, partY1, partY2; int xorg, yorg; int n; xorg = pDrawable->x; yorg = pDrawable->y; pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; extentY2 = pextent->y2; while (nrect--) { fullX1 = prect->x + xorg; fullY1 = prect->y + yorg; fullX2 = fullX1 + (int) prect->width; fullY2 = fullY1 + (int) prect->height; prect++; if (fullX1 < extentX1) fullX1 = extentX1; if (fullY1 < extentY1) fullY1 = extentY1; if (fullX2 > extentX2) fullX2 = extentX2; if (fullY2 > extentY2) fullY2 = extentY2; if ((fullX1 >= fullX2) || (fullY1 >= fullY2)) continue; n = RegionNumRects(pClip); if (n == 1) { fbFill(pDrawable, pGC, fullX1, fullY1, fullX2 - fullX1, fullY2 - fullY1); } else { pbox = RegionRects(pClip); /* * clip the rectangle to each box in the clip region * this is logically equivalent to calling Intersect() */ while (n--) { partX1 = pbox->x1; if (partX1 < fullX1) partX1 = fullX1; partY1 = pbox->y1; if (partY1 < fullY1) partY1 = fullY1; partX2 = pbox->x2; if (partX2 > fullX2) partX2 = fullX2; partY2 = pbox->y2; if (partY2 > fullY2) partY2 = fullY2; pbox++; if (partX1 < partX2 && partY1 < partY2) fbFill(pDrawable, pGC, partX1, partY1, partX2 - partX1, partY2 - partY1); } } } } xorg-server-1.17.1/fb/fballpriv.c0000664000175100017510000000372412422276410013533 00000000000000/* * Copyright © 1998 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 "fb.h" static DevPrivateKeyRec fbScreenPrivateKeyRec; DevPrivateKey fbGetScreenPrivateKey(void) { return &fbScreenPrivateKeyRec; } Bool fbAllocatePrivates(ScreenPtr pScreen) { FbScreenPrivPtr pScrPriv; if (!dixRegisterPrivateKey (&fbScreenPrivateKeyRec, PRIVATE_SCREEN, sizeof(FbScreenPrivRec))) return FALSE; 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; } #ifdef FB_ACCESS_WRAPPER ReadMemoryProcPtr wfbReadMemory; WriteMemoryProcPtr wfbWriteMemory; #endif xorg-server-1.17.1/fb/fbpict.h0000664000175100017510000000510112432306326013016 00000000000000/* * * 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_DIX_CONFIG_H #include #endif #ifndef _FBPICT_H_ #define _FBPICT_H_ /* fbpict.c */ extern _X_EXPORT void fbComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); /* fbtrap.c */ extern _X_EXPORT void fbAddTraps(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntrap, xTrap * traps); extern _X_EXPORT void fbRasterizeTrapezoid(PicturePtr alpha, xTrapezoid * trap, int x_off, int y_off); extern _X_EXPORT void fbAddTriangles(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntri, xTriangle * tris); extern _X_EXPORT void fbTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps); extern _X_EXPORT void fbTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris); extern _X_EXPORT void fbGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr *glyphs); #endif /* _FBPICT_H_ */ xorg-server-1.17.1/fb/fbtrap.c0000664000175100017510000001312712422276410013026 00000000000000/* * Copyright © 2004 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 "fb.h" #include "picturestr.h" #include "mipict.h" #include "fbpict.h" #include "damage.h" void fbAddTraps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap * traps) { pixman_image_t *image; int dst_xoff, dst_yoff; if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff))) return; pixman_add_traps(image, x_off + dst_xoff, y_off + dst_yoff, ntrap, (pixman_trap_t *) traps); free_pixman_pict(pPicture, image); } void fbRasterizeTrapezoid(PicturePtr pPicture, xTrapezoid * trap, int x_off, int y_off) { pixman_image_t *image; int dst_xoff, dst_yoff; if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff))) return; pixman_rasterize_trapezoid(image, (pixman_trapezoid_t *) trap, x_off + dst_xoff, y_off + dst_yoff); free_pixman_pict(pPicture, image); } void fbAddTriangles(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, xTriangle * tris) { pixman_image_t *image; int dst_xoff, dst_yoff; if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff))) return; pixman_add_triangles(image, dst_xoff + x_off, dst_yoff + y_off, ntri, (pixman_triangle_t *) tris); free_pixman_pict(pPicture, image); } typedef void (*CompositeShapesFunc) (pixman_op_t op, pixman_image_t * src, pixman_image_t * dst, pixman_format_code_t mask_format, int x_src, int y_src, int x_dst, int y_dst, int n_shapes, const uint8_t * shapes); static void fbShapes(CompositeShapesFunc composite, pixman_op_t op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, int16_t xSrc, int16_t ySrc, int nshapes, int shape_size, const uint8_t * shapes) { pixman_image_t *src, *dst; int src_xoff, src_yoff; int dst_xoff, dst_yoff; miCompositeSourceValidate(pSrc); src = image_from_pict(pSrc, FALSE, &src_xoff, &src_yoff); dst = image_from_pict(pDst, TRUE, &dst_xoff, &dst_yoff); if (src && dst) { pixman_format_code_t format; DamageRegionAppend(pDst->pDrawable, pDst->pCompositeClip); if (!maskFormat) { int i; if (pDst->polyEdge == PolyEdgeSharp) format = PIXMAN_a1; else format = PIXMAN_a8; for (i = 0; i < nshapes; ++i) { composite(op, src, dst, format, xSrc + src_xoff, ySrc + src_yoff, dst_xoff, dst_yoff, 1, shapes + i * shape_size); } } else { switch (PICT_FORMAT_A(maskFormat->format)) { case 1: format = PIXMAN_a1; break; case 4: format = PIXMAN_a4; break; default: case 8: format = PIXMAN_a8; break; } composite(op, src, dst, format, xSrc + src_xoff, ySrc + src_yoff, dst_xoff, dst_yoff, nshapes, shapes); } DamageRegionProcessPending(pDst->pDrawable); } free_pixman_pict(pSrc, src); free_pixman_pict(pDst, dst); } void fbTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps) { xSrc -= (traps[0].left.p1.x >> 16); ySrc -= (traps[0].left.p1.y >> 16); fbShapes((CompositeShapesFunc) pixman_composite_trapezoids, op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, sizeof(xTrapezoid), (const uint8_t *) traps); } void fbTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris) { xSrc -= (tris[0].p1.x >> 16); ySrc -= (tris[0].p1.y >> 16); fbShapes((CompositeShapesFunc) pixman_composite_triangles, op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, sizeof(xTriangle), (const uint8_t *) tris); } xorg-server-1.17.1/fb/fbgetsp.c0000664000175100017510000000460312422276410013201 00000000000000/* * Copyright © 1998 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 "fb.h" void fbGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart) { FbBits *src, *dst; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; int xoff; /* * XFree86 DDX empties the root borderClip when the VT is * switched away; this checks for that case */ if (!fbDrawableEnabled(pDrawable)) return; if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { fb24_32GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart); return; } fbGetDrawable(pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); while (nspans--) { xoff = (int) (((long) pchardstStart) & (FB_MASK >> 3)); dst = (FbBits *) (pchardstStart - xoff); xoff <<= 3; fbBlt(src + (ppt->y + srcYoff) * srcStride, srcStride, (ppt->x + srcXoff) * srcBpp, dst, 1, xoff, *pwidth * srcBpp, 1, GXcopy, FB_ALLONES, srcBpp, FALSE, FALSE); pchardstStart += PixmapBytePad(*pwidth, pDrawable->depth); ppt++; pwidth++; } fbFinishAccess(pDrawable); } xorg-server-1.17.1/fb/fbscreen.c0000664000175100017510000002004212422276410013331 00000000000000/* * Copyright © 1998 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 "fb.h" Bool fbCloseScreen(ScreenPtr pScreen) { int d; DepthPtr depths = pScreen->allowedDepths; fbDestroyGlyphCache(); for (d = 0; d < pScreen->numDepths; d++) free(depths[d].vids); free(depths); free(pScreen->visuals); if (pScreen->devPrivate) FreePixmap((PixmapPtr)pScreen->devPrivate); return TRUE; } Bool fbRealizeFont(ScreenPtr pScreen, FontPtr pFont) { return TRUE; } Bool fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) { return TRUE; } void fbQueryBestSize(int class, unsigned short *width, unsigned short *height, ScreenPtr pScreen) { unsigned short w; switch (class) { case CursorShape: if (*width > pScreen->width) *width = pScreen->width; if (*height > pScreen->height) *height = pScreen->height; break; case TileShape: case StippleShape: w = *width; if ((w & (w - 1)) && w < FB_UNIT) { for (w = 1; w < *width; w <<= 1); *width = w; } } } PixmapPtr _fbGetWindowPixmap(WindowPtr pWindow) { return fbGetWindowPixmap(pWindow); } void _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap) { dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(pWindow), pPixmap); } Bool fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */ int xsize, /* in pixels */ int ysize, int dpix, /* dots per inch */ int dpiy, int width, /* pixel width of frame buffer */ int bpp) { /* bits per pixel for screen */ if (!fbAllocatePrivates(pScreen)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; pScreen->QueryBestSize = fbQueryBestSize; /* SaveScreen */ pScreen->GetImage = fbGetImage; pScreen->GetSpans = fbGetSpans; pScreen->CreateWindow = fbCreateWindow; pScreen->DestroyWindow = fbDestroyWindow; pScreen->PositionWindow = fbPositionWindow; pScreen->ChangeWindowAttributes = fbChangeWindowAttributes; pScreen->RealizeWindow = fbRealizeWindow; pScreen->UnrealizeWindow = fbUnrealizeWindow; pScreen->CopyWindow = fbCopyWindow; pScreen->CreatePixmap = fbCreatePixmap; pScreen->DestroyPixmap = fbDestroyPixmap; pScreen->RealizeFont = fbRealizeFont; pScreen->UnrealizeFont = fbUnrealizeFont; pScreen->CreateGC = fbCreateGC; pScreen->CreateColormap = fbInitializeColormap; pScreen->DestroyColormap = (void (*)(ColormapPtr)) NoopDDA; pScreen->InstallColormap = fbInstallColormap; pScreen->UninstallColormap = fbUninstallColormap; pScreen->ListInstalledColormaps = fbListInstalledColormaps; pScreen->StoreColors = (void (*)(ColormapPtr, int, xColorItem *)) NoopDDA; pScreen->ResolveColor = fbResolveColor; pScreen->BitmapToRegion = fbPixmapToRegion; pScreen->GetWindowPixmap = _fbGetWindowPixmap; pScreen->SetWindowPixmap = _fbSetWindowPixmap; return TRUE; } #ifdef FB_ACCESS_WRAPPER Bool wfbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap) #else Bool fbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp) #endif { VisualPtr visuals; DepthPtr depths; int nvisuals; int ndepths; int rootdepth; VisualID defaultVisual; int imagebpp = bpp; #ifdef FB_DEBUG int stride; ysize -= 2; stride = (width * bpp) / 8; fbSetBits((FbStip *) pbits, stride / sizeof(FbStip), FB_HEAD_BITS); pbits = (void *) ((char *) pbits + stride); fbSetBits((FbStip *) ((char *) pbits + stride * ysize), stride / sizeof(FbStip), FB_TAIL_BITS); #endif /* * By default, a 24bpp screen will use 32bpp images, this avoids * problems with many applications which just can't handle packed * pixels. If you want real 24bit images, include a 24bpp * format in the pixmap formats */ if (bpp == 24) { int f; imagebpp = 32; /* * Check to see if we're advertising a 24bpp image format, * in which case windows will use it in preference to a 32 bit * format. */ for (f = 0; f < screenInfo.numPixmapFormats; f++) { if (screenInfo.formats[f].bitsPerPixel == 24) { imagebpp = 24; break; } } } if (imagebpp == 32) { fbGetScreenPrivate(pScreen)->win32bpp = bpp; fbGetScreenPrivate(pScreen)->pix32bpp = bpp; } else { fbGetScreenPrivate(pScreen)->win32bpp = 32; fbGetScreenPrivate(pScreen)->pix32bpp = 32; } #ifdef FB_ACCESS_WRAPPER fbGetScreenPrivate(pScreen)->setupWrap = setupWrap; fbGetScreenPrivate(pScreen)->finishWrap = finishWrap; #endif rootdepth = 0; if (!fbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth, &defaultVisual, ((unsigned long) 1 << (imagebpp - 1)), 8)) return FALSE; if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootdepth, ndepths, depths, defaultVisual, nvisuals, visuals)) return FALSE; /* overwrite miCloseScreen with our own */ pScreen->CloseScreen = fbCloseScreen; if (bpp == 24 && imagebpp == 32) { pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; pScreen->CreateScreenResources = fb24_32CreateScreenResources; } return TRUE; } /* dts * (inch/dot) * (25.4 mm / inch) = mm */ #ifdef FB_ACCESS_WRAPPER Bool wfbScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap) { if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) return FALSE; if (!wfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp, setupWrap, finishWrap)) return FALSE; return TRUE; } #else Bool fbScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp) { if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) return FALSE; if (!fbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) return FALSE; return TRUE; } #endif xorg-server-1.17.1/fb/Makefile.in0000664000175100017510000026213712466505430013465 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = fb DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = libfb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libfb_la_OBJECTS = libfb_la-fb24_32.lo libfb_la-fballpriv.lo \ libfb_la-fbarc.lo libfb_la-fbbits.lo libfb_la-fbblt.lo \ libfb_la-fbbltone.lo libfb_la-fbcmap_mi.lo libfb_la-fbcopy.lo \ libfb_la-fbfill.lo libfb_la-fbfillrect.lo libfb_la-fbfillsp.lo \ libfb_la-fbgc.lo libfb_la-fbgetsp.lo libfb_la-fbglyph.lo \ libfb_la-fbimage.lo libfb_la-fbline.lo libfb_la-fboverlay.lo \ libfb_la-fbpict.lo libfb_la-fbpixmap.lo libfb_la-fbpoint.lo \ libfb_la-fbpush.lo libfb_la-fbscreen.lo libfb_la-fbseg.lo \ libfb_la-fbsetsp.lo libfb_la-fbsolid.lo libfb_la-fbtrap.lo \ libfb_la-fbutil.lo libfb_la-fbwindow.lo libfb_la_OBJECTS = $(am_libfb_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 = libfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libfb_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ libwfb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = libwfb_la-fb24_32.lo libwfb_la-fballpriv.lo \ libwfb_la-fbarc.lo libwfb_la-fbbits.lo libwfb_la-fbblt.lo \ libwfb_la-fbbltone.lo libwfb_la-fbcmap_mi.lo \ libwfb_la-fbcopy.lo libwfb_la-fbfill.lo \ libwfb_la-fbfillrect.lo libwfb_la-fbfillsp.lo \ libwfb_la-fbgc.lo libwfb_la-fbgetsp.lo libwfb_la-fbglyph.lo \ libwfb_la-fbimage.lo libwfb_la-fbline.lo \ libwfb_la-fboverlay.lo libwfb_la-fbpict.lo \ libwfb_la-fbpixmap.lo libwfb_la-fbpoint.lo libwfb_la-fbpush.lo \ libwfb_la-fbscreen.lo libwfb_la-fbseg.lo libwfb_la-fbsetsp.lo \ libwfb_la-fbsolid.lo libwfb_la-fbtrap.lo libwfb_la-fbutil.lo \ libwfb_la-fbwindow.lo am_libwfb_la_OBJECTS = $(am__objects_1) libwfb_la_OBJECTS = $(am_libwfb_la_OBJECTS) libwfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libwfb_la_CFLAGS) \ $(CFLAGS) $(AM_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 = $(libfb_la_SOURCES) $(libwfb_la_SOURCES) DIST_SOURCES = $(libfb_la_SOURCES) $(libwfb_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = fb.h fbrop.h fboverlay.h wfbrename.h fbpict.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libfb.la libwfb.la AM_CFLAGS = $(DIX_CFLAGS) @XORG_TRUE@sdk_HEADERS = fb.h fbrop.h fboverlay.h wfbrename.h fbpict.h libfb_la_CFLAGS = $(AM_CFLAGS) libfb_la_LIBADD = $(PIXMAN_LIBS) libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libwfb_la_LIBADD = $(PIXMAN_LIBS) libfb_la_SOURCES = \ fb.h \ fb24_32.c \ fb24_32.h \ fballpriv.c \ fbarc.c \ fbbits.c \ fbbits.h \ fbblt.c \ fbbltone.c \ fbcmap_mi.c \ fbcopy.c \ fbfill.c \ fbfillrect.c \ fbfillsp.c \ fbgc.c \ fbgetsp.c \ fbglyph.c \ fbimage.c \ fbline.c \ fboverlay.c \ fboverlay.h \ fbpict.c \ fbpict.h \ fbpixmap.c \ fbpoint.c \ fbpush.c \ fbrop.h \ fbscreen.c \ fbseg.c \ fbsetsp.c \ fbsolid.c \ fbtrap.c \ fbutil.c \ fbwindow.c libwfb_la_SOURCES = $(libfb_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 fb/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fb/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libfb.la: $(libfb_la_OBJECTS) $(libfb_la_DEPENDENCIES) $(EXTRA_libfb_la_DEPENDENCIES) $(AM_V_CCLD)$(libfb_la_LINK) $(libfb_la_OBJECTS) $(libfb_la_LIBADD) $(LIBS) libwfb.la: $(libwfb_la_OBJECTS) $(libwfb_la_DEPENDENCIES) $(EXTRA_libwfb_la_DEPENDENCIES) $(AM_V_CCLD)$(libwfb_la_LINK) $(libwfb_la_OBJECTS) $(libwfb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fb24_32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fballpriv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbbits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbbltone.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-fbcopy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbfill.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbfillrect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbfillsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbgc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbgetsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbglyph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbimage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fboverlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbpict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbpixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbpoint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbpush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbscreen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbseg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbsetsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbsolid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbtrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbwindow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fb24_32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fballpriv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbbits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbbltone.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-fbcopy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbfill.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbfillrect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbfillsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbgc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbgetsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbglyph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbimage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fboverlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbpict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbpixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbpoint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbpush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbscreen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbseg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbsetsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbsolid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbtrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbwindow.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 -o $@ $< .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 -o $@ `$(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 $@ $< libfb_la-fb24_32.lo: fb24_32.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fb24_32.lo -MD -MP -MF $(DEPDIR)/libfb_la-fb24_32.Tpo -c -o libfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fb24_32.Tpo $(DEPDIR)/libfb_la-fb24_32.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fb24_32.c' object='libfb_la-fb24_32.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c libfb_la-fballpriv.lo: fballpriv.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fballpriv.lo -MD -MP -MF $(DEPDIR)/libfb_la-fballpriv.Tpo -c -o libfb_la-fballpriv.lo `test -f 'fballpriv.c' || echo '$(srcdir)/'`fballpriv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fballpriv.Tpo $(DEPDIR)/libfb_la-fballpriv.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fballpriv.c' object='libfb_la-fballpriv.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fballpriv.lo `test -f 'fballpriv.c' || echo '$(srcdir)/'`fballpriv.c libfb_la-fbarc.lo: fbarc.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbarc.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbarc.Tpo -c -o libfb_la-fbarc.lo `test -f 'fbarc.c' || echo '$(srcdir)/'`fbarc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbarc.Tpo $(DEPDIR)/libfb_la-fbarc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbarc.c' object='libfb_la-fbarc.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbarc.lo `test -f 'fbarc.c' || echo '$(srcdir)/'`fbarc.c libfb_la-fbbits.lo: fbbits.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbbits.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbbits.Tpo -c -o libfb_la-fbbits.lo `test -f 'fbbits.c' || echo '$(srcdir)/'`fbbits.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbbits.Tpo $(DEPDIR)/libfb_la-fbbits.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbbits.c' object='libfb_la-fbbits.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbbits.lo `test -f 'fbbits.c' || echo '$(srcdir)/'`fbbits.c libfb_la-fbblt.lo: fbblt.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbblt.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbblt.Tpo -c -o libfb_la-fbblt.lo `test -f 'fbblt.c' || echo '$(srcdir)/'`fbblt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbblt.Tpo $(DEPDIR)/libfb_la-fbblt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbblt.c' object='libfb_la-fbblt.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbblt.lo `test -f 'fbblt.c' || echo '$(srcdir)/'`fbblt.c libfb_la-fbbltone.lo: fbbltone.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbbltone.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbbltone.Tpo -c -o libfb_la-fbbltone.lo `test -f 'fbbltone.c' || echo '$(srcdir)/'`fbbltone.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbbltone.Tpo $(DEPDIR)/libfb_la-fbbltone.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbbltone.c' object='libfb_la-fbbltone.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbbltone.lo `test -f 'fbbltone.c' || echo '$(srcdir)/'`fbbltone.c libfb_la-fbcmap_mi.lo: fbcmap_mi.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbcmap_mi.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbcmap_mi.Tpo -c -o libfb_la-fbcmap_mi.lo `test -f 'fbcmap_mi.c' || echo '$(srcdir)/'`fbcmap_mi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbcmap_mi.Tpo $(DEPDIR)/libfb_la-fbcmap_mi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbcmap_mi.c' object='libfb_la-fbcmap_mi.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbcmap_mi.lo `test -f 'fbcmap_mi.c' || echo '$(srcdir)/'`fbcmap_mi.c libfb_la-fbcopy.lo: fbcopy.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbcopy.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbcopy.Tpo -c -o libfb_la-fbcopy.lo `test -f 'fbcopy.c' || echo '$(srcdir)/'`fbcopy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbcopy.Tpo $(DEPDIR)/libfb_la-fbcopy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbcopy.c' object='libfb_la-fbcopy.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbcopy.lo `test -f 'fbcopy.c' || echo '$(srcdir)/'`fbcopy.c libfb_la-fbfill.lo: fbfill.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbfill.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbfill.Tpo -c -o libfb_la-fbfill.lo `test -f 'fbfill.c' || echo '$(srcdir)/'`fbfill.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbfill.Tpo $(DEPDIR)/libfb_la-fbfill.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbfill.c' object='libfb_la-fbfill.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbfill.lo `test -f 'fbfill.c' || echo '$(srcdir)/'`fbfill.c libfb_la-fbfillrect.lo: fbfillrect.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbfillrect.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbfillrect.Tpo -c -o libfb_la-fbfillrect.lo `test -f 'fbfillrect.c' || echo '$(srcdir)/'`fbfillrect.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbfillrect.Tpo $(DEPDIR)/libfb_la-fbfillrect.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbfillrect.c' object='libfb_la-fbfillrect.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbfillrect.lo `test -f 'fbfillrect.c' || echo '$(srcdir)/'`fbfillrect.c libfb_la-fbfillsp.lo: fbfillsp.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbfillsp.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbfillsp.Tpo -c -o libfb_la-fbfillsp.lo `test -f 'fbfillsp.c' || echo '$(srcdir)/'`fbfillsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbfillsp.Tpo $(DEPDIR)/libfb_la-fbfillsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbfillsp.c' object='libfb_la-fbfillsp.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbfillsp.lo `test -f 'fbfillsp.c' || echo '$(srcdir)/'`fbfillsp.c libfb_la-fbgc.lo: fbgc.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbgc.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbgc.Tpo -c -o libfb_la-fbgc.lo `test -f 'fbgc.c' || echo '$(srcdir)/'`fbgc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbgc.Tpo $(DEPDIR)/libfb_la-fbgc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbgc.c' object='libfb_la-fbgc.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbgc.lo `test -f 'fbgc.c' || echo '$(srcdir)/'`fbgc.c libfb_la-fbgetsp.lo: fbgetsp.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbgetsp.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbgetsp.Tpo -c -o libfb_la-fbgetsp.lo `test -f 'fbgetsp.c' || echo '$(srcdir)/'`fbgetsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbgetsp.Tpo $(DEPDIR)/libfb_la-fbgetsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbgetsp.c' object='libfb_la-fbgetsp.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbgetsp.lo `test -f 'fbgetsp.c' || echo '$(srcdir)/'`fbgetsp.c libfb_la-fbglyph.lo: fbglyph.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbglyph.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbglyph.Tpo -c -o libfb_la-fbglyph.lo `test -f 'fbglyph.c' || echo '$(srcdir)/'`fbglyph.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbglyph.Tpo $(DEPDIR)/libfb_la-fbglyph.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbglyph.c' object='libfb_la-fbglyph.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbglyph.lo `test -f 'fbglyph.c' || echo '$(srcdir)/'`fbglyph.c libfb_la-fbimage.lo: fbimage.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbimage.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbimage.Tpo -c -o libfb_la-fbimage.lo `test -f 'fbimage.c' || echo '$(srcdir)/'`fbimage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbimage.Tpo $(DEPDIR)/libfb_la-fbimage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbimage.c' object='libfb_la-fbimage.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbimage.lo `test -f 'fbimage.c' || echo '$(srcdir)/'`fbimage.c libfb_la-fbline.lo: fbline.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbline.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbline.Tpo -c -o libfb_la-fbline.lo `test -f 'fbline.c' || echo '$(srcdir)/'`fbline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbline.Tpo $(DEPDIR)/libfb_la-fbline.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbline.c' object='libfb_la-fbline.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbline.lo `test -f 'fbline.c' || echo '$(srcdir)/'`fbline.c libfb_la-fboverlay.lo: fboverlay.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fboverlay.lo -MD -MP -MF $(DEPDIR)/libfb_la-fboverlay.Tpo -c -o libfb_la-fboverlay.lo `test -f 'fboverlay.c' || echo '$(srcdir)/'`fboverlay.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fboverlay.Tpo $(DEPDIR)/libfb_la-fboverlay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fboverlay.c' object='libfb_la-fboverlay.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fboverlay.lo `test -f 'fboverlay.c' || echo '$(srcdir)/'`fboverlay.c libfb_la-fbpict.lo: fbpict.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbpict.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbpict.Tpo -c -o libfb_la-fbpict.lo `test -f 'fbpict.c' || echo '$(srcdir)/'`fbpict.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbpict.Tpo $(DEPDIR)/libfb_la-fbpict.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpict.c' object='libfb_la-fbpict.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbpict.lo `test -f 'fbpict.c' || echo '$(srcdir)/'`fbpict.c libfb_la-fbpixmap.lo: fbpixmap.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbpixmap.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbpixmap.Tpo -c -o libfb_la-fbpixmap.lo `test -f 'fbpixmap.c' || echo '$(srcdir)/'`fbpixmap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbpixmap.Tpo $(DEPDIR)/libfb_la-fbpixmap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpixmap.c' object='libfb_la-fbpixmap.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbpixmap.lo `test -f 'fbpixmap.c' || echo '$(srcdir)/'`fbpixmap.c libfb_la-fbpoint.lo: fbpoint.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbpoint.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbpoint.Tpo -c -o libfb_la-fbpoint.lo `test -f 'fbpoint.c' || echo '$(srcdir)/'`fbpoint.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbpoint.Tpo $(DEPDIR)/libfb_la-fbpoint.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpoint.c' object='libfb_la-fbpoint.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbpoint.lo `test -f 'fbpoint.c' || echo '$(srcdir)/'`fbpoint.c libfb_la-fbpush.lo: fbpush.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbpush.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbpush.Tpo -c -o libfb_la-fbpush.lo `test -f 'fbpush.c' || echo '$(srcdir)/'`fbpush.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbpush.Tpo $(DEPDIR)/libfb_la-fbpush.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpush.c' object='libfb_la-fbpush.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbpush.lo `test -f 'fbpush.c' || echo '$(srcdir)/'`fbpush.c libfb_la-fbscreen.lo: fbscreen.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbscreen.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbscreen.Tpo -c -o libfb_la-fbscreen.lo `test -f 'fbscreen.c' || echo '$(srcdir)/'`fbscreen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbscreen.Tpo $(DEPDIR)/libfb_la-fbscreen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbscreen.c' object='libfb_la-fbscreen.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbscreen.lo `test -f 'fbscreen.c' || echo '$(srcdir)/'`fbscreen.c libfb_la-fbseg.lo: fbseg.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbseg.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbseg.Tpo -c -o libfb_la-fbseg.lo `test -f 'fbseg.c' || echo '$(srcdir)/'`fbseg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbseg.Tpo $(DEPDIR)/libfb_la-fbseg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbseg.c' object='libfb_la-fbseg.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbseg.lo `test -f 'fbseg.c' || echo '$(srcdir)/'`fbseg.c libfb_la-fbsetsp.lo: fbsetsp.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbsetsp.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbsetsp.Tpo -c -o libfb_la-fbsetsp.lo `test -f 'fbsetsp.c' || echo '$(srcdir)/'`fbsetsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbsetsp.Tpo $(DEPDIR)/libfb_la-fbsetsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbsetsp.c' object='libfb_la-fbsetsp.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbsetsp.lo `test -f 'fbsetsp.c' || echo '$(srcdir)/'`fbsetsp.c libfb_la-fbsolid.lo: fbsolid.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbsolid.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbsolid.Tpo -c -o libfb_la-fbsolid.lo `test -f 'fbsolid.c' || echo '$(srcdir)/'`fbsolid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbsolid.Tpo $(DEPDIR)/libfb_la-fbsolid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbsolid.c' object='libfb_la-fbsolid.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbsolid.lo `test -f 'fbsolid.c' || echo '$(srcdir)/'`fbsolid.c libfb_la-fbtrap.lo: fbtrap.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbtrap.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbtrap.Tpo -c -o libfb_la-fbtrap.lo `test -f 'fbtrap.c' || echo '$(srcdir)/'`fbtrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbtrap.Tpo $(DEPDIR)/libfb_la-fbtrap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbtrap.c' object='libfb_la-fbtrap.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbtrap.lo `test -f 'fbtrap.c' || echo '$(srcdir)/'`fbtrap.c libfb_la-fbutil.lo: fbutil.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbutil.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbutil.Tpo -c -o libfb_la-fbutil.lo `test -f 'fbutil.c' || echo '$(srcdir)/'`fbutil.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbutil.Tpo $(DEPDIR)/libfb_la-fbutil.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbutil.c' object='libfb_la-fbutil.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbutil.lo `test -f 'fbutil.c' || echo '$(srcdir)/'`fbutil.c libfb_la-fbwindow.lo: fbwindow.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbwindow.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbwindow.Tpo -c -o libfb_la-fbwindow.lo `test -f 'fbwindow.c' || echo '$(srcdir)/'`fbwindow.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbwindow.Tpo $(DEPDIR)/libfb_la-fbwindow.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbwindow.c' object='libfb_la-fbwindow.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbwindow.lo `test -f 'fbwindow.c' || echo '$(srcdir)/'`fbwindow.c libwfb_la-fb24_32.lo: fb24_32.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fb24_32.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fb24_32.Tpo -c -o libwfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fb24_32.Tpo $(DEPDIR)/libwfb_la-fb24_32.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fb24_32.c' object='libwfb_la-fb24_32.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fb24_32.lo `test -f 'fb24_32.c' || echo '$(srcdir)/'`fb24_32.c libwfb_la-fballpriv.lo: fballpriv.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fballpriv.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fballpriv.Tpo -c -o libwfb_la-fballpriv.lo `test -f 'fballpriv.c' || echo '$(srcdir)/'`fballpriv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fballpriv.Tpo $(DEPDIR)/libwfb_la-fballpriv.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fballpriv.c' object='libwfb_la-fballpriv.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fballpriv.lo `test -f 'fballpriv.c' || echo '$(srcdir)/'`fballpriv.c libwfb_la-fbarc.lo: fbarc.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbarc.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbarc.Tpo -c -o libwfb_la-fbarc.lo `test -f 'fbarc.c' || echo '$(srcdir)/'`fbarc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbarc.Tpo $(DEPDIR)/libwfb_la-fbarc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbarc.c' object='libwfb_la-fbarc.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbarc.lo `test -f 'fbarc.c' || echo '$(srcdir)/'`fbarc.c libwfb_la-fbbits.lo: fbbits.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbbits.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbbits.Tpo -c -o libwfb_la-fbbits.lo `test -f 'fbbits.c' || echo '$(srcdir)/'`fbbits.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbbits.Tpo $(DEPDIR)/libwfb_la-fbbits.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbbits.c' object='libwfb_la-fbbits.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbbits.lo `test -f 'fbbits.c' || echo '$(srcdir)/'`fbbits.c libwfb_la-fbblt.lo: fbblt.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbblt.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbblt.Tpo -c -o libwfb_la-fbblt.lo `test -f 'fbblt.c' || echo '$(srcdir)/'`fbblt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbblt.Tpo $(DEPDIR)/libwfb_la-fbblt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbblt.c' object='libwfb_la-fbblt.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbblt.lo `test -f 'fbblt.c' || echo '$(srcdir)/'`fbblt.c libwfb_la-fbbltone.lo: fbbltone.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbbltone.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbbltone.Tpo -c -o libwfb_la-fbbltone.lo `test -f 'fbbltone.c' || echo '$(srcdir)/'`fbbltone.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbbltone.Tpo $(DEPDIR)/libwfb_la-fbbltone.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbbltone.c' object='libwfb_la-fbbltone.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbbltone.lo `test -f 'fbbltone.c' || echo '$(srcdir)/'`fbbltone.c libwfb_la-fbcmap_mi.lo: fbcmap_mi.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbcmap_mi.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbcmap_mi.Tpo -c -o libwfb_la-fbcmap_mi.lo `test -f 'fbcmap_mi.c' || echo '$(srcdir)/'`fbcmap_mi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbcmap_mi.Tpo $(DEPDIR)/libwfb_la-fbcmap_mi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbcmap_mi.c' object='libwfb_la-fbcmap_mi.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbcmap_mi.lo `test -f 'fbcmap_mi.c' || echo '$(srcdir)/'`fbcmap_mi.c libwfb_la-fbcopy.lo: fbcopy.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbcopy.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbcopy.Tpo -c -o libwfb_la-fbcopy.lo `test -f 'fbcopy.c' || echo '$(srcdir)/'`fbcopy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbcopy.Tpo $(DEPDIR)/libwfb_la-fbcopy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbcopy.c' object='libwfb_la-fbcopy.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbcopy.lo `test -f 'fbcopy.c' || echo '$(srcdir)/'`fbcopy.c libwfb_la-fbfill.lo: fbfill.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbfill.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbfill.Tpo -c -o libwfb_la-fbfill.lo `test -f 'fbfill.c' || echo '$(srcdir)/'`fbfill.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbfill.Tpo $(DEPDIR)/libwfb_la-fbfill.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbfill.c' object='libwfb_la-fbfill.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbfill.lo `test -f 'fbfill.c' || echo '$(srcdir)/'`fbfill.c libwfb_la-fbfillrect.lo: fbfillrect.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbfillrect.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbfillrect.Tpo -c -o libwfb_la-fbfillrect.lo `test -f 'fbfillrect.c' || echo '$(srcdir)/'`fbfillrect.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbfillrect.Tpo $(DEPDIR)/libwfb_la-fbfillrect.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbfillrect.c' object='libwfb_la-fbfillrect.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbfillrect.lo `test -f 'fbfillrect.c' || echo '$(srcdir)/'`fbfillrect.c libwfb_la-fbfillsp.lo: fbfillsp.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbfillsp.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbfillsp.Tpo -c -o libwfb_la-fbfillsp.lo `test -f 'fbfillsp.c' || echo '$(srcdir)/'`fbfillsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbfillsp.Tpo $(DEPDIR)/libwfb_la-fbfillsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbfillsp.c' object='libwfb_la-fbfillsp.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbfillsp.lo `test -f 'fbfillsp.c' || echo '$(srcdir)/'`fbfillsp.c libwfb_la-fbgc.lo: fbgc.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbgc.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbgc.Tpo -c -o libwfb_la-fbgc.lo `test -f 'fbgc.c' || echo '$(srcdir)/'`fbgc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbgc.Tpo $(DEPDIR)/libwfb_la-fbgc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbgc.c' object='libwfb_la-fbgc.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbgc.lo `test -f 'fbgc.c' || echo '$(srcdir)/'`fbgc.c libwfb_la-fbgetsp.lo: fbgetsp.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbgetsp.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbgetsp.Tpo -c -o libwfb_la-fbgetsp.lo `test -f 'fbgetsp.c' || echo '$(srcdir)/'`fbgetsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbgetsp.Tpo $(DEPDIR)/libwfb_la-fbgetsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbgetsp.c' object='libwfb_la-fbgetsp.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbgetsp.lo `test -f 'fbgetsp.c' || echo '$(srcdir)/'`fbgetsp.c libwfb_la-fbglyph.lo: fbglyph.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbglyph.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbglyph.Tpo -c -o libwfb_la-fbglyph.lo `test -f 'fbglyph.c' || echo '$(srcdir)/'`fbglyph.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbglyph.Tpo $(DEPDIR)/libwfb_la-fbglyph.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbglyph.c' object='libwfb_la-fbglyph.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbglyph.lo `test -f 'fbglyph.c' || echo '$(srcdir)/'`fbglyph.c libwfb_la-fbimage.lo: fbimage.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbimage.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbimage.Tpo -c -o libwfb_la-fbimage.lo `test -f 'fbimage.c' || echo '$(srcdir)/'`fbimage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbimage.Tpo $(DEPDIR)/libwfb_la-fbimage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbimage.c' object='libwfb_la-fbimage.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbimage.lo `test -f 'fbimage.c' || echo '$(srcdir)/'`fbimage.c libwfb_la-fbline.lo: fbline.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbline.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbline.Tpo -c -o libwfb_la-fbline.lo `test -f 'fbline.c' || echo '$(srcdir)/'`fbline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbline.Tpo $(DEPDIR)/libwfb_la-fbline.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbline.c' object='libwfb_la-fbline.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbline.lo `test -f 'fbline.c' || echo '$(srcdir)/'`fbline.c libwfb_la-fboverlay.lo: fboverlay.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fboverlay.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fboverlay.Tpo -c -o libwfb_la-fboverlay.lo `test -f 'fboverlay.c' || echo '$(srcdir)/'`fboverlay.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fboverlay.Tpo $(DEPDIR)/libwfb_la-fboverlay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fboverlay.c' object='libwfb_la-fboverlay.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fboverlay.lo `test -f 'fboverlay.c' || echo '$(srcdir)/'`fboverlay.c libwfb_la-fbpict.lo: fbpict.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbpict.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbpict.Tpo -c -o libwfb_la-fbpict.lo `test -f 'fbpict.c' || echo '$(srcdir)/'`fbpict.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbpict.Tpo $(DEPDIR)/libwfb_la-fbpict.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpict.c' object='libwfb_la-fbpict.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbpict.lo `test -f 'fbpict.c' || echo '$(srcdir)/'`fbpict.c libwfb_la-fbpixmap.lo: fbpixmap.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbpixmap.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbpixmap.Tpo -c -o libwfb_la-fbpixmap.lo `test -f 'fbpixmap.c' || echo '$(srcdir)/'`fbpixmap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbpixmap.Tpo $(DEPDIR)/libwfb_la-fbpixmap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpixmap.c' object='libwfb_la-fbpixmap.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbpixmap.lo `test -f 'fbpixmap.c' || echo '$(srcdir)/'`fbpixmap.c libwfb_la-fbpoint.lo: fbpoint.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbpoint.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbpoint.Tpo -c -o libwfb_la-fbpoint.lo `test -f 'fbpoint.c' || echo '$(srcdir)/'`fbpoint.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbpoint.Tpo $(DEPDIR)/libwfb_la-fbpoint.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpoint.c' object='libwfb_la-fbpoint.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbpoint.lo `test -f 'fbpoint.c' || echo '$(srcdir)/'`fbpoint.c libwfb_la-fbpush.lo: fbpush.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbpush.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbpush.Tpo -c -o libwfb_la-fbpush.lo `test -f 'fbpush.c' || echo '$(srcdir)/'`fbpush.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbpush.Tpo $(DEPDIR)/libwfb_la-fbpush.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbpush.c' object='libwfb_la-fbpush.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbpush.lo `test -f 'fbpush.c' || echo '$(srcdir)/'`fbpush.c libwfb_la-fbscreen.lo: fbscreen.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbscreen.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbscreen.Tpo -c -o libwfb_la-fbscreen.lo `test -f 'fbscreen.c' || echo '$(srcdir)/'`fbscreen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbscreen.Tpo $(DEPDIR)/libwfb_la-fbscreen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbscreen.c' object='libwfb_la-fbscreen.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbscreen.lo `test -f 'fbscreen.c' || echo '$(srcdir)/'`fbscreen.c libwfb_la-fbseg.lo: fbseg.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbseg.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbseg.Tpo -c -o libwfb_la-fbseg.lo `test -f 'fbseg.c' || echo '$(srcdir)/'`fbseg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbseg.Tpo $(DEPDIR)/libwfb_la-fbseg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbseg.c' object='libwfb_la-fbseg.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbseg.lo `test -f 'fbseg.c' || echo '$(srcdir)/'`fbseg.c libwfb_la-fbsetsp.lo: fbsetsp.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbsetsp.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbsetsp.Tpo -c -o libwfb_la-fbsetsp.lo `test -f 'fbsetsp.c' || echo '$(srcdir)/'`fbsetsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbsetsp.Tpo $(DEPDIR)/libwfb_la-fbsetsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbsetsp.c' object='libwfb_la-fbsetsp.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbsetsp.lo `test -f 'fbsetsp.c' || echo '$(srcdir)/'`fbsetsp.c libwfb_la-fbsolid.lo: fbsolid.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbsolid.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbsolid.Tpo -c -o libwfb_la-fbsolid.lo `test -f 'fbsolid.c' || echo '$(srcdir)/'`fbsolid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbsolid.Tpo $(DEPDIR)/libwfb_la-fbsolid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbsolid.c' object='libwfb_la-fbsolid.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbsolid.lo `test -f 'fbsolid.c' || echo '$(srcdir)/'`fbsolid.c libwfb_la-fbtrap.lo: fbtrap.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbtrap.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbtrap.Tpo -c -o libwfb_la-fbtrap.lo `test -f 'fbtrap.c' || echo '$(srcdir)/'`fbtrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbtrap.Tpo $(DEPDIR)/libwfb_la-fbtrap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbtrap.c' object='libwfb_la-fbtrap.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbtrap.lo `test -f 'fbtrap.c' || echo '$(srcdir)/'`fbtrap.c libwfb_la-fbutil.lo: fbutil.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbutil.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbutil.Tpo -c -o libwfb_la-fbutil.lo `test -f 'fbutil.c' || echo '$(srcdir)/'`fbutil.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbutil.Tpo $(DEPDIR)/libwfb_la-fbutil.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbutil.c' object='libwfb_la-fbutil.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbutil.lo `test -f 'fbutil.c' || echo '$(srcdir)/'`fbutil.c libwfb_la-fbwindow.lo: fbwindow.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbwindow.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbwindow.Tpo -c -o libwfb_la-fbwindow.lo `test -f 'fbwindow.c' || echo '$(srcdir)/'`fbwindow.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbwindow.Tpo $(DEPDIR)/libwfb_la-fbwindow.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbwindow.c' object='libwfb_la-fbwindow.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbwindow.lo `test -f 'fbwindow.c' || echo '$(srcdir)/'`fbwindow.c 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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/fb/fbline.c0000664000175100017510000001040312432306326013002 00000000000000/* * Copyright © 1998 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 "fb.h" static void fbZeroLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { int x1, y1, x2, y2; int x, y; int dashOffset; x = pDrawable->x; y = pDrawable->y; x1 = ppt->x; y1 = ppt->y; dashOffset = pGC->dashOffset; while (--npt) { ++ppt; x2 = ppt->x; y2 = ppt->y; if (mode == CoordModePrevious) { x2 += x1; y2 += y1; } fbSegment(pDrawable, pGC, x1 + x, y1 + y, x2 + x, y2 + y, npt == 1 && pGC->capStyle != CapNotLast, &dashOffset); x1 = x2; y1 = y2; } } static void fbZeroSegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSegs) { int dashOffset; int x, y; Bool drawLast = pGC->capStyle != CapNotLast; x = pDrawable->x; y = pDrawable->y; while (nseg--) { dashOffset = pGC->dashOffset; fbSegment(pDrawable, pGC, pSegs->x1 + x, pSegs->y1 + y, pSegs->x2 + x, pSegs->y2 + y, drawLast, &dashOffset); pSegs++; } } void fbFixCoordModePrevious(int npt, DDXPointPtr ppt) { int x, y; x = ppt->x; y = ppt->y; npt--; while (npt--) { ppt++; x = (ppt->x += x); y = (ppt->y += y); } } void fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { void (*line) (DrawablePtr, GCPtr, int mode, int npt, DDXPointPtr ppt); if (pGC->lineWidth == 0) { line = fbZeroLine; if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && RegionNumRects(fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: line = fbPolyline8; break; case 16: line = fbPolyline16; break; case 24: line = fbPolyline24; break; case 32: line = fbPolyline32; break; } } } else { if (pGC->lineStyle != LineSolid) line = miWideDash; else line = miWideLine; } (*line) (pDrawable, pGC, mode, npt, ppt); } void fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg) { void (*seg) (DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg); if (pGC->lineWidth == 0) { seg = fbZeroSegment; if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && RegionNumRects(fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: seg = fbPolySegment8; break; case 16: seg = fbPolySegment16; break; case 24: seg = fbPolySegment24; break; case 32: seg = fbPolySegment32; break; } } } else { seg = miPolySegment; } (*seg) (pDrawable, pGC, nseg, pseg); } xorg-server-1.17.1/fb/fbgc.c0000664000175100017510000001401212456571574012463 00000000000000/* * Copyright © 1998 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 #include "fb.h" const GCFuncs fbGCFuncs = { fbValidateGC, miChangeGC, miCopyGC, miDestroyGC, miChangeClip, miDestroyClip, miCopyClip, }; const GCOps fbGCOps = { fbFillSpans, fbSetSpans, fbPutImage, fbCopyArea, fbCopyPlane, fbPolyPoint, fbPolyLine, fbPolySegment, fbPolyRectangle, fbPolyArc, miFillPolygon, fbPolyFillRect, fbPolyFillArc, miPolyText8, miPolyText16, miImageText8, miImageText16, fbImageGlyphBlt, fbPolyGlyphBlt, fbPushPixels }; Bool fbCreateGC(GCPtr pGC) { pGC->ops = (GCOps *) &fbGCOps; pGC->funcs = (GCFuncs *) &fbGCFuncs; /* fb wants to translate before scan conversion */ pGC->miTranslate = 1; pGC->fExpose = 1; fbGetGCPrivate(pGC)->bpp = BitsPerPixel(pGC->depth); return TRUE; } /* * Pad pixmap to FB_UNIT bits wide */ void fbPadPixmap(PixmapPtr pPixmap) { int width; FbBits *bits; FbBits b; FbBits mask; int height; int w; int stride; int bpp; _X_UNUSED int xOff, yOff; fbGetDrawable(&pPixmap->drawable, bits, stride, bpp, xOff, yOff); width = pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel; height = pPixmap->drawable.height; mask = FbBitsMask(0, width); while (height--) { b = READ(bits) & mask; w = width; while (w < FB_UNIT) { b = b | FbScrRight(b, w); w <<= 1; } WRITE(bits, b); bits += stride; } fbFinishAccess(&pPixmap->drawable); } void fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbBits mask; /* * if the client clip is different or moved OR the subwindowMode has * changed OR the window's clip has changed since the last validation * we need to recompute the composite clip */ if ((changes & (GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode)) || (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)) ) { miComputeCompositeClip(pGC, pDrawable); } if (pPriv->bpp != pDrawable->bitsPerPixel) { changes |= GCStipple | GCForeground | GCBackground | GCPlaneMask; pPriv->bpp = pDrawable->bitsPerPixel; } if ((changes & GCTile) && fbGetRotatedPixmap(pGC)) { (*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC)); fbGetRotatedPixmap(pGC) = 0; } if (pGC->fillStyle == FillTiled) { PixmapPtr pOldTile, pNewTile; pOldTile = pGC->tile.pixmap; if (pOldTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) { pNewTile = fbGetRotatedPixmap(pGC); if (!pNewTile || pNewTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) { if (pNewTile) (*pGC->pScreen->DestroyPixmap) (pNewTile); pNewTile = fb24_32ReformatTile(pOldTile, pDrawable->bitsPerPixel); } if (pNewTile) { fbGetRotatedPixmap(pGC) = pOldTile; pGC->tile.pixmap = pNewTile; changes |= GCTile; } } } if (changes & GCTile) { if (!pGC->tileIsPixel && FbEvenTile(pGC->tile.pixmap->drawable.width * pDrawable->bitsPerPixel)) fbPadPixmap(pGC->tile.pixmap); } if (changes & GCStipple) { if (pGC->stipple) { if (pGC->stipple->drawable.width * pDrawable->bitsPerPixel < FB_UNIT) fbPadPixmap(pGC->stipple); } } /* * Recompute reduced rop values */ if (changes & (GCForeground | GCBackground | GCPlaneMask | GCFunction)) { int s; FbBits depthMask; mask = FbFullMask(pDrawable->bitsPerPixel); depthMask = FbFullMask(pDrawable->depth); pPriv->fg = pGC->fgPixel & mask; pPriv->bg = pGC->bgPixel & mask; if ((pGC->planemask & depthMask) == depthMask) pPriv->pm = mask; else pPriv->pm = pGC->planemask & mask; s = pDrawable->bitsPerPixel; while (s < FB_UNIT) { pPriv->fg |= pPriv->fg << s; pPriv->bg |= pPriv->bg << s; pPriv->pm |= pPriv->pm << s; s <<= 1; } pPriv->and = fbAnd(pGC->alu, pPriv->fg, pPriv->pm); pPriv->xor = fbXor(pGC->alu, pPriv->fg, pPriv->pm); pPriv->bgand = fbAnd(pGC->alu, pPriv->bg, pPriv->pm); pPriv->bgxor = fbXor(pGC->alu, pPriv->bg, pPriv->pm); } if (changes & GCDashList) { unsigned short n = pGC->numInDashList; unsigned char *dash = pGC->dash; unsigned int dashLength = 0; while (n--) dashLength += (unsigned int) *dash++; pPriv->dashLength = dashLength; } } xorg-server-1.17.1/fb/fbfillsp.c0000664000175100017510000000547312422276410013356 00000000000000/* * Copyright © 1998 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 "fb.h" void fbFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, DDXPointPtr ppt, int *pwidth, int fSorted) { RegionPtr pClip = fbGetCompositeClip(pGC); BoxPtr pextent, pbox; int nbox; int extentX1, extentX2, extentY1, extentY2; int fullX1, fullX2, fullY1; int partX1, partX2; pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; extentY2 = pextent->y2; while (n--) { fullX1 = ppt->x; fullY1 = ppt->y; fullX2 = fullX1 + (int) *pwidth; ppt++; pwidth++; if (fullY1 < extentY1 || extentY2 <= fullY1) continue; if (fullX1 < extentX1) fullX1 = extentX1; if (fullX2 > extentX2) fullX2 = extentX2; if (fullX1 >= fullX2) continue; nbox = RegionNumRects(pClip); if (nbox == 1) { fbFill(pDrawable, pGC, fullX1, fullY1, fullX2 - fullX1, 1); } else { pbox = RegionRects(pClip); while (nbox--) { if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) { partX1 = pbox->x1; if (partX1 < fullX1) partX1 = fullX1; partX2 = pbox->x2; if (partX2 > fullX2) partX2 = fullX2; if (partX2 > partX1) { fbFill(pDrawable, pGC, partX1, fullY1, partX2 - partX1, 1); } } pbox++; } } } } xorg-server-1.17.1/fb/fb24_32.h0000664000175100017510000000312312456571574012631 00000000000000/* * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _FB24_32_H_ #define _FB24_32_H_ Bool fb24_32FinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); Bool fb24_32ScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); #endif xorg-server-1.17.1/fb/fbglyph.c0000664000175100017510000002760412456571574013230 00000000000000/* * * Copyright © 1998 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 "fb.h" #include #include "dixfontstr.h" static Bool fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height) { BoxRec box; BoxPtr pExtents = RegionExtents(pRegion); /* * Check extents by hand to avoid 16 bit overflows */ if (x < (int) pExtents->x1) return FALSE; if ((int) pExtents->x2 < x + width) return FALSE; if (y < (int) pExtents->y1) return FALSE; if ((int) pExtents->y2 < y + height) return FALSE; box.x1 = x; box.x2 = x + width; box.y1 = y; box.y2 = y + height; return RegionContainsRect(pRegion, &box) == rgnIN; } #define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg) #define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg) #define WRITE4(d,n,fg) WRITE((CARD32 *) &(d[n]), (CARD32) fg) #define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB) /* * This is a bit tricky, but it's brief. Write 12 bytes worth * of dest, which is four pixels, at a time. This gives constant * code for each pattern as they're always aligned the same * * a b c d a b c d a b c d bytes * A B C A B C A B C A B C pixels * * f0 f1 f2 * A B C A B C A B C A B C pixels LSB * C A B C A B C A B C A B pixels MSB * * LSB MSB * A f0 f1 * B f1 f2 * C f2 f0 * A B f0 f2 * B C f1 f0 * C A f2 f1 * A B C A f0 f1 * B C A B f1 f2 * C A B C f2 f0 */ #undef _A #undef _B #undef _C #undef _AB #undef _BC #undef _CA #undef _ABCA #undef _BCAB #undef _CABC #if IMAGE_BYTE_ORDER == MSBFirst #define _A f1 #define _B f2 #define _C f0 #define _AB f2 #define _BC f0 #define _CA f1 #define _ABCA f1 #define _BCAB f2 #define _CABC f0 #define CASE(a,b,c,d) ((a << 3) | (b << 2) | (c << 1) | d) #else #define _A f0 #define _B f1 #define _C f2 #define _AB f0 #define _BC f1 #define _CA f2 #define _ABCA f0 #define _BCAB f1 #define _CABC f2 #define CASE(a,b,c,d) (a | (b << 1) | (c << 2) | (d << 3)) #endif static void fbGlyph24(FbBits * dstBits, FbStride dstStride, int dstBpp, FbStip * stipple, FbBits fg, int x, int height) { int lshift; FbStip bits; CARD8 *dstLine; CARD8 *dst; FbStip f0, f1, f2; int n; int shift; f0 = fg; f1 = FbRot24(f0, 16); f2 = FbRot24(f0, 8); dstLine = (CARD8 *) dstBits; dstLine += (x & ~3) * 3; dstStride *= (sizeof(FbBits) / sizeof(CARD8)); shift = x & 3; lshift = 4 - shift; while (height--) { bits = READ(stipple++); n = lshift; dst = dstLine; while (bits) { switch (FbStipMoveLsb(FbLeftStipBits(bits, n), 4, n)) { case CASE(0, 0, 0, 0): break; case CASE(1, 0, 0, 0): WRITE2(dst, 0, _AB); WRITE1(dst, 2, _C); break; case CASE(0, 1, 0, 0): WRITE1(dst, 3, _A); WRITE2(dst, 4, _BC); break; case CASE(1, 1, 0, 0): WRITE4(dst, 0, _ABCA); WRITE2(dst, 4, _BC); break; case CASE(0, 0, 1, 0): WRITE2(dst, 6, _AB); WRITE1(dst, 8, _C); break; case CASE(1, 0, 1, 0): WRITE2(dst, 0, _AB); WRITE1(dst, 2, _C); WRITE2(dst, 6, _AB); WRITE1(dst, 8, _C); break; case CASE(0, 1, 1, 0): WRITE1(dst, 3, _A); WRITE4(dst, 4, _BCAB); WRITE1(dst, 8, _C); break; case CASE(1, 1, 1, 0): WRITE8(dst); WRITE1(dst, 8, _C); break; case CASE(0, 0, 0, 1): WRITE1(dst, 9, _A); WRITE2(dst, 10, _BC); break; case CASE(1, 0, 0, 1): WRITE2(dst, 0, _AB); WRITE1(dst, 2, _C); WRITE1(dst, 9, _A); WRITE2(dst, 10, _BC); break; case CASE(0, 1, 0, 1): WRITE1(dst, 3, _A); WRITE2(dst, 4, _BC); WRITE1(dst, 9, _A); WRITE2(dst, 10, _BC); break; case CASE(1, 1, 0, 1): WRITE4(dst, 0, _ABCA); WRITE2(dst, 4, _BC); WRITE1(dst, 9, _A); WRITE2(dst, 10, _BC); break; case CASE(0, 0, 1, 1): WRITE2(dst, 6, _AB); WRITE4(dst, 8, _CABC); break; case CASE(1, 0, 1, 1): WRITE2(dst, 0, _AB); WRITE1(dst, 2, _C); WRITE2(dst, 6, _AB); WRITE4(dst, 8, _CABC); break; case CASE(0, 1, 1, 1): WRITE1(dst, 3, _A); WRITE4(dst, 4, _BCAB); WRITE4(dst, 8, _CABC); break; case CASE(1, 1, 1, 1): WRITE8(dst); WRITE4(dst, 8, _CABC); break; } bits = FbStipLeft(bits, n); n = 4; dst += 12; } dstLine += dstStride; } } void fbPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); CharInfoPtr pci; unsigned char *pglyph; /* pointer bits in glyph */ int gx, gy; int gWidth, gHeight; /* width and height of glyph */ FbStride gStride; /* stride of glyph */ void (*glyph) (FbBits *, FbStride, int, FbStip *, FbBits, int, int); FbBits *dst = 0; FbStride dstStride = 0; int dstBpp = 0; int dstXoff = 0, dstYoff = 0; glyph = 0; if (pGC->fillStyle == FillSolid && pPriv->and == 0) { dstBpp = pDrawable->bitsPerPixel; switch (dstBpp) { case 8: glyph = fbGlyph8; break; case 16: glyph = fbGlyph16; break; case 24: glyph = fbGlyph24; break; case 32: glyph = fbGlyph32; break; } } x += pDrawable->x; y += pDrawable->y; while (nglyph--) { pci = *ppci++; pglyph = FONTGLYPHBITS(pglyphBase, pci); gWidth = GLYPHWIDTHPIXELS(pci); gHeight = GLYPHHEIGHTPIXELS(pci); if (gWidth && gHeight) { gx = x + pci->metrics.leftSideBearing; gy = y - pci->metrics.ascent; if (glyph && gWidth <= sizeof(FbStip) * 8 && fbGlyphIn(fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) { fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); (*glyph) (dst + (gy + dstYoff) * dstStride, dstStride, dstBpp, (FbStip *) pglyph, pPriv->xor, gx + dstXoff, gHeight); fbFinishAccess(pDrawable); } else { gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof(FbStip); fbPushImage(pDrawable, pGC, (FbStip *) pglyph, gStride, 0, gx, gy, gWidth, gHeight); } } x += pci->metrics.characterWidth; } } void fbImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppciInit, void *pglyphBase) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); CharInfoPtr *ppci; CharInfoPtr pci; unsigned char *pglyph; /* pointer bits in glyph */ int gWidth, gHeight; /* width and height of glyph */ FbStride gStride; /* stride of glyph */ Bool opaque; int n; int gx, gy; void (*glyph) (FbBits *, FbStride, int, FbStip *, FbBits, int, int); FbBits *dst = 0; FbStride dstStride = 0; int dstBpp = 0; int dstXoff = 0, dstYoff = 0; glyph = 0; if (pPriv->and == 0) { dstBpp = pDrawable->bitsPerPixel; switch (dstBpp) { case 8: glyph = fbGlyph8; break; case 16: glyph = fbGlyph16; break; case 24: glyph = fbGlyph24; break; case 32: glyph = fbGlyph32; break; } } x += pDrawable->x; y += pDrawable->y; if (TERMINALFONT(pGC->font) && !glyph) { opaque = TRUE; } else { int xBack, widthBack; int yBack, heightBack; ppci = ppciInit; n = nglyph; widthBack = 0; while (n--) widthBack += (*ppci++)->metrics.characterWidth; xBack = x; if (widthBack < 0) { xBack += widthBack; widthBack = -widthBack; } yBack = y - FONTASCENT(pGC->font); heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); fbSolidBoxClipped(pDrawable, fbGetCompositeClip(pGC), xBack, yBack, xBack + widthBack, yBack + heightBack, fbAnd(GXcopy, pPriv->bg, pPriv->pm), fbXor(GXcopy, pPriv->bg, pPriv->pm)); opaque = FALSE; } ppci = ppciInit; while (nglyph--) { pci = *ppci++; pglyph = FONTGLYPHBITS(pglyphBase, pci); gWidth = GLYPHWIDTHPIXELS(pci); gHeight = GLYPHHEIGHTPIXELS(pci); if (gWidth && gHeight) { gx = x + pci->metrics.leftSideBearing; gy = y - pci->metrics.ascent; if (glyph && gWidth <= sizeof(FbStip) * 8 && fbGlyphIn(fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) { fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); (*glyph) (dst + (gy + dstYoff) * dstStride, dstStride, dstBpp, (FbStip *) pglyph, pPriv->fg, gx + dstXoff, gHeight); fbFinishAccess(pDrawable); } else { gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof(FbStip); fbPutXYImage(pDrawable, fbGetCompositeClip(pGC), pPriv->fg, pPriv->bg, pPriv->pm, GXcopy, opaque, gx, gy, gWidth, gHeight, (FbStip *) pglyph, gStride, 0); } } x += pci->metrics.characterWidth; } } xorg-server-1.17.1/fb/fbblt.c0000664000175100017510000004221412432306326012641 00000000000000/* * Copyright © 1998 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 #include "fb.h" #define InitializeShifts(sx,dx,ls,rs) { \ if (sx != dx) { \ if (sx > dx) { \ ls = sx - dx; \ rs = FB_UNIT - ls; \ } else { \ rs = dx - sx; \ ls = FB_UNIT - rs; \ } \ } \ } void fbBlt(FbBits * srcLine, FbStride srcStride, int srcX, FbBits * dstLine, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown) { FbBits *src, *dst; int leftShift, rightShift; FbBits startmask, endmask; FbBits bits, bits1; int n, nmiddle; Bool destInvarient; int startbyte, endbyte; FbDeclareMergeRop(); if (alu == GXcopy && pm == FB_ALLONES && !(srcX & 7) && !(dstX & 7) && !(width & 7)) { CARD8 *src_byte = (CARD8 *) srcLine + (srcX >> 3); CARD8 *dst_byte = (CARD8 *) dstLine + (dstX >> 3); FbStride src_byte_stride = srcStride << (FB_SHIFT - 3); FbStride dst_byte_stride = dstStride << (FB_SHIFT - 3); int width_byte = (width >> 3); /* Make sure there's no overlap; we can't use memcpy in that * case as it's not well defined, so fall through to the * general code */ if (src_byte + width_byte <= dst_byte || dst_byte + width_byte <= src_byte) { int i; if (!upsidedown) for (i = 0; i < height; i++) MEMCPY_WRAPPED(dst_byte + i * dst_byte_stride, src_byte + i * src_byte_stride, width_byte); else for (i = height - 1; i >= 0; i--) MEMCPY_WRAPPED(dst_byte + i * dst_byte_stride, src_byte + i * src_byte_stride, width_byte); return; } } if (bpp == 24 && !FbCheck24Pix(pm)) { fbBlt24(srcLine, srcStride, srcX, dstLine, dstStride, dstX, width, height, alu, pm, reverse, upsidedown); return; } FbInitializeMergeRop(alu, pm); destInvarient = FbDestInvarientMergeRop(); if (upsidedown) { srcLine += (height - 1) * (srcStride); dstLine += (height - 1) * (dstStride); srcStride = -srcStride; dstStride = -dstStride; } FbMaskBitsBytes(dstX, width, destInvarient, startmask, startbyte, nmiddle, endmask, endbyte); if (reverse) { srcLine += ((srcX + width - 1) >> FB_SHIFT) + 1; dstLine += ((dstX + width - 1) >> FB_SHIFT) + 1; srcX = (srcX + width - 1) & FB_MASK; dstX = (dstX + width - 1) & FB_MASK; } else { srcLine += srcX >> FB_SHIFT; dstLine += dstX >> FB_SHIFT; srcX &= FB_MASK; dstX &= FB_MASK; } if (srcX == dstX) { while (height--) { src = srcLine; srcLine += srcStride; dst = dstLine; dstLine += dstStride; if (reverse) { if (endmask) { bits = READ(--src); --dst; FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask); } n = nmiddle; if (destInvarient) { while (n--) WRITE(--dst, FbDoDestInvarientMergeRop(READ(--src))); } else { while (n--) { bits = READ(--src); --dst; WRITE(dst, FbDoMergeRop(bits, READ(dst))); } } if (startmask) { bits = READ(--src); --dst; FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask); } } else { if (startmask) { bits = READ(src++); FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask); dst++; } n = nmiddle; if (destInvarient) { #if 0 /* * This provides some speedup on screen->screen blts * over the PCI bus, usually about 10%. But fb * isn't usually used for this operation... */ if (_ca2 + 1 == 0 && _cx2 == 0) { FbBits t1, t2, t3, t4; while (n >= 4) { t1 = *src++; t2 = *src++; t3 = *src++; t4 = *src++; *dst++ = t1; *dst++ = t2; *dst++ = t3; *dst++ = t4; n -= 4; } } #endif while (n--) WRITE(dst++, FbDoDestInvarientMergeRop(READ(src++))); } else { while (n--) { bits = READ(src++); WRITE(dst, FbDoMergeRop(bits, READ(dst))); dst++; } } if (endmask) { bits = READ(src); FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask); } } } } else { if (srcX > dstX) { leftShift = srcX - dstX; rightShift = FB_UNIT - leftShift; } else { rightShift = dstX - srcX; leftShift = FB_UNIT - rightShift; } while (height--) { src = srcLine; srcLine += srcStride; dst = dstLine; dstLine += dstStride; bits1 = 0; if (reverse) { if (srcX < dstX) bits1 = READ(--src); if (endmask) { bits = FbScrRight(bits1, rightShift); if (FbScrRight(endmask, leftShift)) { bits1 = READ(--src); bits |= FbScrLeft(bits1, leftShift); } --dst; FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask); } n = nmiddle; if (destInvarient) { while (n--) { bits = FbScrRight(bits1, rightShift); bits1 = READ(--src); bits |= FbScrLeft(bits1, leftShift); --dst; WRITE(dst, FbDoDestInvarientMergeRop(bits)); } } else { while (n--) { bits = FbScrRight(bits1, rightShift); bits1 = READ(--src); bits |= FbScrLeft(bits1, leftShift); --dst; WRITE(dst, FbDoMergeRop(bits, READ(dst))); } } if (startmask) { bits = FbScrRight(bits1, rightShift); if (FbScrRight(startmask, leftShift)) { bits1 = READ(--src); bits |= FbScrLeft(bits1, leftShift); } --dst; FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask); } } else { if (srcX > dstX) bits1 = READ(src++); if (startmask) { bits = FbScrLeft(bits1, leftShift); if (FbScrLeft(startmask, rightShift)) { bits1 = READ(src++); bits |= FbScrRight(bits1, rightShift); } FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask); dst++; } n = nmiddle; if (destInvarient) { while (n--) { bits = FbScrLeft(bits1, leftShift); bits1 = READ(src++); bits |= FbScrRight(bits1, rightShift); WRITE(dst, FbDoDestInvarientMergeRop(bits)); dst++; } } else { while (n--) { bits = FbScrLeft(bits1, leftShift); bits1 = READ(src++); bits |= FbScrRight(bits1, rightShift); WRITE(dst, FbDoMergeRop(bits, READ(dst))); dst++; } } if (endmask) { bits = FbScrLeft(bits1, leftShift); if (FbScrLeft(endmask, rightShift)) { bits1 = READ(src); bits |= FbScrRight(bits1, rightShift); } FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask); } } } } } #undef DEBUG_BLT24 #ifdef DEBUG_BLT24 static unsigned long getPixel(char *src, int x) { unsigned long l; l = 0; memcpy(&l, src + x * 3, 3); return l; } #endif static void fbBlt24Line(FbBits * src, int srcX, FbBits * dst, int dstX, int width, int alu, FbBits pm, Bool reverse) { #ifdef DEBUG_BLT24 char *origDst = (char *) dst; FbBits *origLine = dst + ((dstX >> FB_SHIFT) - 1); int origNlw = ((width + FB_MASK) >> FB_SHIFT) + 3; int origX = dstX / 24; #endif int leftShift, rightShift; FbBits startmask, endmask; int n; FbBits bits, bits1; FbBits mask; int rot; FbDeclareMergeRop(); FbInitializeMergeRop(alu, FB_ALLONES); FbMaskBits(dstX, width, startmask, n, endmask); #ifdef DEBUG_BLT24 ErrorF("dstX %d width %d reverse %d\n", dstX, width, reverse); #endif if (reverse) { src += ((srcX + width - 1) >> FB_SHIFT) + 1; dst += ((dstX + width - 1) >> FB_SHIFT) + 1; rot = FbFirst24Rot(((dstX + width - 8) & FB_MASK)); rot = FbPrev24Rot(rot); #ifdef DEBUG_BLT24 ErrorF("dstX + width - 8: %d rot: %d\n", (dstX + width - 8) & FB_MASK, rot); #endif srcX = (srcX + width - 1) & FB_MASK; dstX = (dstX + width - 1) & FB_MASK; } else { src += srcX >> FB_SHIFT; dst += dstX >> FB_SHIFT; srcX &= FB_MASK; dstX &= FB_MASK; rot = FbFirst24Rot(dstX); #ifdef DEBUG_BLT24 ErrorF("dstX: %d rot: %d\n", dstX, rot); #endif } mask = FbRot24(pm, rot); #ifdef DEBUG_BLT24 ErrorF("pm 0x%x mask 0x%x\n", pm, mask); #endif if (srcX == dstX) { if (reverse) { if (endmask) { bits = READ(--src); --dst; WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); mask = FbPrev24Pix(mask); } while (n--) { bits = READ(--src); --dst; WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); mask = FbPrev24Pix(mask); } if (startmask) { bits = READ(--src); --dst; WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); } } else { if (startmask) { bits = READ(src++); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); dst++; mask = FbNext24Pix(mask); } while (n--) { bits = READ(src++); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); dst++; mask = FbNext24Pix(mask); } if (endmask) { bits = READ(src); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); } } } else { if (srcX > dstX) { leftShift = srcX - dstX; rightShift = FB_UNIT - leftShift; } else { rightShift = dstX - srcX; leftShift = FB_UNIT - rightShift; } bits1 = 0; if (reverse) { if (srcX < dstX) bits1 = READ(--src); if (endmask) { bits = FbScrRight(bits1, rightShift); if (FbScrRight(endmask, leftShift)) { bits1 = READ(--src); bits |= FbScrLeft(bits1, leftShift); } --dst; WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); mask = FbPrev24Pix(mask); } while (n--) { bits = FbScrRight(bits1, rightShift); bits1 = READ(--src); bits |= FbScrLeft(bits1, leftShift); --dst; WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); mask = FbPrev24Pix(mask); } if (startmask) { bits = FbScrRight(bits1, rightShift); if (FbScrRight(startmask, leftShift)) { bits1 = READ(--src); bits |= FbScrLeft(bits1, leftShift); } --dst; WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); } } else { if (srcX > dstX) bits1 = READ(src++); if (startmask) { bits = FbScrLeft(bits1, leftShift); bits1 = READ(src++); bits |= FbScrRight(bits1, rightShift); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask)); dst++; mask = FbNext24Pix(mask); } while (n--) { bits = FbScrLeft(bits1, leftShift); bits1 = READ(src++); bits |= FbScrRight(bits1, rightShift); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask)); dst++; mask = FbNext24Pix(mask); } if (endmask) { bits = FbScrLeft(bits1, leftShift); if (FbScrLeft(endmask, rightShift)) { bits1 = READ(src); bits |= FbScrRight(bits1, rightShift); } WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask)); } } } #ifdef DEBUG_BLT24 { int firstx, lastx, x; firstx = origX; if (firstx) firstx--; lastx = origX + width / 24 + 1; for (x = firstx; x <= lastx; x++) ErrorF("%06x ", getPixel(origDst, x)); ErrorF("\n"); while (origNlw--) ErrorF("%08x ", *origLine++); ErrorF("\n"); } #endif } void fbBlt24(FbBits * srcLine, FbStride srcStride, int srcX, FbBits * dstLine, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm, Bool reverse, Bool upsidedown) { if (upsidedown) { srcLine += (height - 1) * srcStride; dstLine += (height - 1) * dstStride; srcStride = -srcStride; dstStride = -dstStride; } while (height--) { fbBlt24Line(srcLine, srcX, dstLine, dstX, width, alu, pm, reverse); srcLine += srcStride; dstLine += dstStride; } #ifdef DEBUG_BLT24 ErrorF("\n"); #endif } void fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */ int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */ int dstX, int width, int height, int alu, FbBits pm, int bpp) { fbBlt((FbBits *) src, FbStipStrideToBitsStride(srcStride), srcX, (FbBits *) dst, FbStipStrideToBitsStride(dstStride), dstX, width, height, alu, pm, bpp, FALSE, FALSE); } xorg-server-1.17.1/fb/fbimage.c0000664000175100017510000002115512422315650013142 00000000000000/* * Copyright © 1998 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 #include "fb.h" void fbPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); unsigned long i; FbStride srcStride; FbStip *src = (FbStip *) pImage; x += pDrawable->x; y += pDrawable->y; switch (format) { case XYBitmap: srcStride = BitmapBytePad(w + leftPad) / sizeof(FbStip); fbPutXYImage(pDrawable, fbGetCompositeClip(pGC), pPriv->fg, pPriv->bg, pPriv->pm, pGC->alu, TRUE, x, y, w, h, src, srcStride, leftPad); break; case XYPixmap: srcStride = BitmapBytePad(w + leftPad) / sizeof(FbStip); for (i = (unsigned long) 1 << (pDrawable->depth - 1); i; i >>= 1) { if (i & pGC->planemask) { fbPutXYImage(pDrawable, fbGetCompositeClip(pGC), FB_ALLONES, 0, fbReplicatePixel(i, pDrawable->bitsPerPixel), pGC->alu, TRUE, x, y, w, h, src, srcStride, leftPad); src += srcStride * h; } } break; case ZPixmap: if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { srcStride = PixmapBytePad(w, pDrawable->depth); fb24_32PutZImage(pDrawable, fbGetCompositeClip(pGC), pGC->alu, (FbBits) pGC->planemask, x, y, w, h, (CARD8 *) pImage, srcStride); } else { srcStride = PixmapBytePad(w, pDrawable->depth) / sizeof(FbStip); fbPutZImage(pDrawable, fbGetCompositeClip(pGC), pGC->alu, pPriv->pm, x, y, w, h, src, srcStride); } } } void fbPutZImage(DrawablePtr pDrawable, RegionPtr pClip, int alu, FbBits pm, int x, int y, int width, int height, FbStip * src, FbStride srcStride) { FbStip *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; int nbox; BoxPtr pbox; int x1, y1, x2, y2; fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { x1 = x; y1 = y; x2 = x + width; y2 = y + height; if (x1 < pbox->x1) x1 = pbox->x1; if (y1 < pbox->y1) y1 = pbox->y1; if (x2 > pbox->x2) x2 = pbox->x2; if (y2 > pbox->y2) y2 = pbox->y2; if (x1 >= x2 || y1 >= y2) continue; fbBltStip(src + (y1 - y) * srcStride, srcStride, (x1 - x) * dstBpp, dst + (y1 + dstYoff) * dstStride, dstStride, (x1 + dstXoff) * dstBpp, (x2 - x1) * dstBpp, (y2 - y1), alu, pm, dstBpp); } fbFinishAccess(pDrawable); } void fbPutXYImage(DrawablePtr pDrawable, RegionPtr pClip, FbBits fg, FbBits bg, FbBits pm, int alu, Bool opaque, int x, int y, int width, int height, FbStip * src, FbStride srcStride, int srcX) { FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; int nbox; BoxPtr pbox; int x1, y1, x2, y2; FbBits fgand = 0, fgxor = 0, bgand = 0, bgxor = 0; fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); if (dstBpp == 1) { if (opaque) alu = FbOpaqueStipple1Rop(alu, fg, bg); else alu = FbStipple1Rop(alu, fg); } else { fgand = fbAnd(alu, fg, pm); fgxor = fbXor(alu, fg, pm); if (opaque) { bgand = fbAnd(alu, bg, pm); bgxor = fbXor(alu, bg, pm); } else { bgand = fbAnd(GXnoop, (FbBits) 0, FB_ALLONES); bgxor = fbXor(GXnoop, (FbBits) 0, FB_ALLONES); } } for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { x1 = x; y1 = y; x2 = x + width; y2 = y + height; if (x1 < pbox->x1) x1 = pbox->x1; if (y1 < pbox->y1) y1 = pbox->y1; if (x2 > pbox->x2) x2 = pbox->x2; if (y2 > pbox->y2) y2 = pbox->y2; if (x1 >= x2 || y1 >= y2) continue; if (dstBpp == 1) { fbBltStip(src + (y1 - y) * srcStride, srcStride, (x1 - x) + srcX, (FbStip *) (dst + (y1 + dstYoff) * dstStride), FbBitsStrideToStipStride(dstStride), (x1 + dstXoff) * dstBpp, (x2 - x1) * dstBpp, (y2 - y1), alu, pm, dstBpp); } else { fbBltOne(src + (y1 - y) * srcStride, srcStride, (x1 - x) + srcX, dst + (y1 + dstYoff) * dstStride, dstStride, (x1 + dstXoff) * dstBpp, dstBpp, (x2 - x1) * dstBpp, (y2 - y1), fgand, fgxor, bgand, bgxor); } } fbFinishAccess(pDrawable); } void fbGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d) { FbBits *src; FbStride srcStride; int srcBpp; int srcXoff, srcYoff; FbStip *dst; FbStride dstStride; /* * XFree86 DDX empties the root borderClip when the VT is * switched away; this checks for that case */ if (!fbDrawableEnabled(pDrawable)) return; if (format == ZPixmap && pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { fb24_32GetImage(pDrawable, x, y, w, h, format, planeMask, d); return; } fbGetDrawable(pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); x += pDrawable->x; y += pDrawable->y; dst = (FbStip *) d; if (format == ZPixmap || srcBpp == 1) { FbBits pm; pm = fbReplicatePixel(planeMask, srcBpp); dstStride = PixmapBytePad(w, pDrawable->depth); if (pm != FB_ALLONES) memset(d, 0, dstStride * h); dstStride /= sizeof(FbStip); fbBltStip((FbStip *) (src + (y + srcYoff) * srcStride), FbBitsStrideToStipStride(srcStride), (x + srcXoff) * srcBpp, dst, dstStride, 0, w * srcBpp, h, GXcopy, pm, srcBpp); } else { dstStride = BitmapBytePad(w) / sizeof(FbStip); fbBltPlane(src + (y + srcYoff) * srcStride, srcStride, (x + srcXoff) * srcBpp, srcBpp, dst, dstStride, 0, w * srcBpp, h, fbAndStip(GXcopy, FB_STIP_ALLONES, FB_STIP_ALLONES), fbXorStip(GXcopy, FB_STIP_ALLONES, FB_STIP_ALLONES), fbAndStip(GXcopy, 0, FB_STIP_ALLONES), fbXorStip(GXcopy, 0, FB_STIP_ALLONES), planeMask); } fbFinishAccess(pDrawable); } xorg-server-1.17.1/fb/fb.h0000664000175100017510000011027512432306326012147 00000000000000/* * * Copyright © 1998 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. */ #ifndef _FB_H_ #define _FB_H_ #include #include #include "scrnintstr.h" #include "pixmap.h" #include "pixmapstr.h" #include "region.h" #include "gcstruct.h" #include "colormap.h" #include "miscstruct.h" #include "servermd.h" #include "windowstr.h" #include "privates.h" #include "mi.h" #include "migc.h" #include "picturestr.h" #ifdef FB_ACCESS_WRAPPER #include "wfbrename.h" #define FBPREFIX(x) wfb##x #define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr)))) #define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr)))) #define MEMCPY_WRAPPED(dst, src, size) do { \ size_t _i; \ CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \ for(_i = 0; _i < size; _i++) { \ WRITE(_dst +_i, READ(_src + _i)); \ } \ } while(0) #define MEMSET_WRAPPED(dst, val, size) do { \ size_t _i; \ CARD8 *_dst = (CARD8*)(dst); \ for(_i = 0; _i < size; _i++) { \ WRITE(_dst +_i, (val)); \ } \ } while(0) #else #define FBPREFIX(x) fb##x #define WRITE(ptr, val) (*(ptr) = (val)) #define READ(ptr) (*(ptr)) #define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size)) #define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size)) #endif /* * This single define controls the basic size of data manipulated * by this software; it must be log2(sizeof (FbBits) * 8) */ #ifndef FB_SHIFT #define FB_SHIFT LOG2_BITMAP_PAD #endif #define FB_UNIT (1 << FB_SHIFT) #define FB_MASK (FB_UNIT - 1) #define FB_ALLONES ((FbBits) -1) #if GLYPHPADBYTES != 4 #error "GLYPHPADBYTES must be 4" #endif /* for driver compat - intel UXA needs the second one at least */ #define FB_24BIT #define FB_24_32BIT #define FB_STIP_SHIFT LOG2_BITMAP_PAD #define FB_STIP_UNIT (1 << FB_STIP_SHIFT) #define FB_STIP_MASK (FB_STIP_UNIT - 1) #define FB_STIP_ALLONES ((FbStip) -1) #define FB_STIP_ODDSTRIDE(s) (((s) & (FB_MASK >> FB_STIP_SHIFT)) != 0) #define FB_STIP_ODDPTR(p) ((((long) (p)) & (FB_MASK >> 3)) != 0) #define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT))) #define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT))) #define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1)) #if FB_SHIFT == 5 typedef CARD32 FbBits; #else #error "Unsupported FB_SHIFT" #endif #if LOG2_BITMAP_PAD == FB_SHIFT typedef FbBits FbStip; #endif typedef int FbStride; #ifdef FB_DEBUG extern _X_EXPORT void fbValidateDrawable(DrawablePtr d); extern _X_EXPORT void fbInitializeDrawable(DrawablePtr d); extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); #define FB_HEAD_BITS (FbStip) (0xbaadf00d) #define FB_TAIL_BITS (FbStip) (0xbaddf0ad) #else #define fbValidateDrawable(d) #define fdInitializeDrawable(d) #endif #include "fbrop.h" #if BITMAP_BIT_ORDER == LSBFirst #define FbScrLeft(x,n) ((x) >> (n)) #define FbScrRight(x,n) ((x) << (n)) /* #define FbLeftBits(x,n) ((x) & ((((FbBits) 1) << (n)) - 1)) */ #define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1)) #define FbStipMoveLsb(x,s,n) (FbStipRight (x,(s)-(n))) #define FbPatternOffsetBits 0 #else #define FbScrLeft(x,n) ((x) << (n)) #define FbScrRight(x,n) ((x) >> (n)) /* #define FbLeftBits(x,n) ((x) >> (FB_UNIT - (n))) */ #define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n))) #define FbStipMoveLsb(x,s,n) (x) #define FbPatternOffsetBits (sizeof (FbBits) - 1) #endif #include "micoord.h" #define FbStipLeft(x,n) FbScrLeft(x,n) #define FbStipRight(x,n) FbScrRight(x,n) #define FbRotLeft(x,n) FbScrLeft(x,n) | (n ? FbScrRight(x,FB_UNIT-n) : 0) #define FbRotRight(x,n) FbScrRight(x,n) | (n ? FbScrLeft(x,FB_UNIT-n) : 0) #define FbRotStipLeft(x,n) FbStipLeft(x,n) | (n ? FbStipRight(x,FB_STIP_UNIT-n) : 0) #define FbRotStipRight(x,n) FbStipRight(x,n) | (n ? FbStipLeft(x,FB_STIP_UNIT-n) : 0) #define FbLeftMask(x) ( ((x) & FB_MASK) ? \ FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0) #define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \ FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0) #define FbLeftStipMask(x) ( ((x) & FB_STIP_MASK) ? \ FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) : 0) #define FbRightStipMask(x) ( ((FB_STIP_UNIT - (x)) & FB_STIP_MASK) ? \ FbScrLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - (x)) & FB_STIP_MASK) : 0) #define FbBitsMask(x,w) (FbScrRight(FB_ALLONES,(x) & FB_MASK) & \ FbScrLeft(FB_ALLONES,(FB_UNIT - ((x) + (w))) & FB_MASK)) #define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \ FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK)) #define FbMaskBits(x,w,l,n,r) { \ n = (w); \ r = FbRightMask((x)+n); \ l = FbLeftMask(x); \ if (l) { \ n -= FB_UNIT - ((x) & FB_MASK); \ if (n < 0) { \ n = 0; \ l &= r; \ r = 0; \ } \ } \ n >>= FB_SHIFT; \ } #define FbByteMaskInvalid 0x10 #define FbPatternOffset(o,t) ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1))) #define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o))) #define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3)) #define FbStorePart(dst,off,t,xor) (WRITE(FbPtrOffset(dst,off,t), \ FbSelectPart(xor,off,t))) #ifndef FbSelectPart #define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t) #endif #define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) { \ n = (w); \ lb = 0; \ rb = 0; \ r = FbRightMask((x)+n); \ if (r) { \ /* compute right byte length */ \ if ((copy) && (((x) + n) & 7) == 0) { \ rb = (((x) + n) & FB_MASK) >> 3; \ } else { \ rb = FbByteMaskInvalid; \ } \ } \ l = FbLeftMask(x); \ if (l) { \ /* compute left byte length */ \ if ((copy) && ((x) & 7) == 0) { \ lb = ((x) & FB_MASK) >> 3; \ } else { \ lb = FbByteMaskInvalid; \ } \ /* subtract out the portion painted by leftMask */ \ n -= FB_UNIT - ((x) & FB_MASK); \ if (n < 0) { \ if (lb != FbByteMaskInvalid) { \ if (rb == FbByteMaskInvalid) { \ lb = FbByteMaskInvalid; \ } else if (rb) { \ lb |= (rb - lb) << (FB_SHIFT - 3); \ rb = 0; \ } \ } \ n = 0; \ l &= r; \ r = 0; \ }\ } \ n >>= FB_SHIFT; \ } #define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \ switch (lb) { \ case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ break; \ case (sizeof (FbBits) - 3) | (2 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ case sizeof (FbBits) - 3: \ FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ case sizeof (FbBits) - 2: \ FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \ break; \ case sizeof (FbBits) - 1: \ FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \ break; \ default: \ WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, l)); \ break; \ } \ } #define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \ switch (rb) { \ case 1: \ FbStorePart(dst,0,CARD8,xor); \ break; \ case 2: \ FbStorePart(dst,0,CARD16,xor); \ break; \ case 3: \ FbStorePart(dst,0,CARD16,xor); \ FbStorePart(dst,2,CARD8,xor); \ break; \ default: \ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \ } \ } #define FbMaskStip(x,w,l,n,r) { \ n = (w); \ r = FbRightStipMask((x)+n); \ l = FbLeftStipMask(x); \ if (l) { \ n -= FB_STIP_UNIT - ((x) & FB_STIP_MASK); \ if (n < 0) { \ n = 0; \ l &= r; \ r = 0; \ } \ } \ n >>= FB_STIP_SHIFT; \ } /* * These macros are used to transparently stipple * in copy mode; the expected usage is with 'n' constant * so all of the conditional parts collapse into a minimal * sequence of partial word writes * * 'n' is the bytemask of which bytes to store, 'a' is the address * of the FbBits base unit, 'o' is the offset within that unit * * The term "lane" comes from the hardware term "byte-lane" which */ #define FbLaneCase1(n,a,o) \ if ((n) == 0x01) { \ WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), fgxor); \ } #define FbLaneCase2(n,a,o) \ if ((n) == 0x03) { \ WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), fgxor); \ } else { \ FbLaneCase1((n)&1,a,o) \ FbLaneCase1((n)>>1,a,(o)+1) \ } #define FbLaneCase4(n,a,o) \ if ((n) == 0x0f) { \ WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), fgxor); \ } else { \ FbLaneCase2((n)&3,a,o) \ FbLaneCase2((n)>>2,a,(o)+2) \ } #define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0) /* Rotate a filled pixel value to the specified alignement */ #define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b))) #define FbRot24Stip(p,b) (FbStipRight(p,b) | FbStipLeft(p,24-(b))) /* step a filled pixel value to the next/previous FB_UNIT alignment */ #define FbNext24Pix(p) (FbRot24(p,(24-FB_UNIT%24))) #define FbPrev24Pix(p) (FbRot24(p,FB_UNIT%24)) #define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24))) #define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24)) /* step a rotation value to the next/previous rotation value */ #define FbNext24Rot(r) ((r) == 0 ? 16 : (r) - 8) #define FbPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8) #if IMAGE_BYTE_ORDER == MSBFirst #define FbFirst24Rot(x) (((x) + 16) % 24) #else #define FbFirst24Rot(x) ((x) % 24) #endif #define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8) #define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8) /* Whether 24-bit specific code is needed for this filled pixel value */ #define FbCheck24Pix(p) ((p) == FbNext24Pix(p)) /* Macros for dealing with dashing */ #define FbDashDeclare \ unsigned char *__dash, *__firstDash, *__lastDash #define FbDashInit(pGC,pPriv,dashOffset,dashlen,even) { \ (even) = TRUE; \ __firstDash = (pGC)->dash; \ __lastDash = __firstDash + (pGC)->numInDashList; \ (dashOffset) %= (pPriv)->dashLength; \ \ __dash = __firstDash; \ while ((dashOffset) >= ((dashlen) = *__dash)) \ { \ (dashOffset) -= (dashlen); \ (even) = 1-(even); \ if (++__dash == __lastDash) \ __dash = __firstDash; \ } \ (dashlen) -= (dashOffset); \ } #define FbDashNext(dashlen) { \ if (++__dash == __lastDash) \ __dash = __firstDash; \ (dashlen) = *__dash; \ } /* as numInDashList is always even, this case can skip a test */ #define FbDashNextEven(dashlen) { \ (dashlen) = *++__dash; \ } #define FbDashNextOdd(dashlen) FbDashNext(dashlen) #define FbDashStep(dashlen,even) { \ if (!--(dashlen)) { \ FbDashNext(dashlen); \ (even) = 1-(even); \ } \ } extern _X_EXPORT const GCOps fbGCOps; extern _X_EXPORT const GCFuncs fbGCFuncs; /* Framebuffer access wrapper */ typedef FbBits(*ReadMemoryProcPtr) (const void *src, int size); typedef void (*WriteMemoryProcPtr) (void *dst, FbBits value, int size); typedef void (*SetupWrapProcPtr) (ReadMemoryProcPtr * pRead, WriteMemoryProcPtr * pWrite, DrawablePtr pDraw); typedef void (*FinishWrapProcPtr) (DrawablePtr pDraw); #ifdef FB_ACCESS_WRAPPER #define fbPrepareAccess(pDraw) \ fbGetScreenPrivate((pDraw)->pScreen)->setupWrap( \ &wfbReadMemory, \ &wfbWriteMemory, \ (pDraw)) #define fbFinishAccess(pDraw) \ fbGetScreenPrivate((pDraw)->pScreen)->finishWrap(pDraw) #else #define fbPrepareAccess(pPix) #define fbFinishAccess(pDraw) #endif extern _X_EXPORT DevPrivateKey fbGetScreenPrivateKey(void); /* private field of a screen */ typedef struct { unsigned char win32bpp; /* window bpp for 32-bpp images */ unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */ #ifdef FB_ACCESS_WRAPPER 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) \ dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey())) /* private field of GC */ typedef struct { FbBits and, xor; /* reduced rop values */ FbBits bgand, bgxor; /* for stipples */ FbBits fg, bg, pm; /* expanded and filled */ unsigned int dashLength; /* total of all dash elements */ unsigned char bpp; /* current drawable bpp */ } FbGCPrivRec, *FbGCPrivPtr; #define fbGetGCPrivateKey(pGC) (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec) #define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\ dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey(pGC))) #define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip) #define fbGetExpose(pGC) ((pGC)->fExpose) #define fbGetFreeCompClip(pGC) ((pGC)->freeCompClip) #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(pWin))) #ifdef ROOTLESS #define __fbPixDrawableX(pPix) ((pPix)->drawable.x) #define __fbPixDrawableY(pPix) ((pPix)->drawable.y) #else #define __fbPixDrawableX(pPix) 0 #define __fbPixDrawableY(pPix) 0 #endif #ifdef COMPOSITE #define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix) - (pPix)->screen_x) #define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix) - (pPix)->screen_y) #else #define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix)) #define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix)) #endif #define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix)) #define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix)) #define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \ if ((pDrawable)->type != DRAWABLE_PIXMAP) { \ (pixmap) = fbGetWindowPixmap(pDrawable); \ (xoff) = __fbPixOffXWin(pixmap); \ (yoff) = __fbPixOffYWin(pixmap); \ } else { \ (pixmap) = (PixmapPtr) (pDrawable); \ (xoff) = __fbPixOffXPix(pixmap); \ (yoff) = __fbPixOffYPix(pixmap); \ } \ fbPrepareAccess(pDrawable); \ } #define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) { \ (pointer) = (FbBits *) (pixmap)->devPrivate.ptr; \ (stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride); \ (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \ } #define fbGetPixmapStipData(pixmap, pointer, stride, bpp) { \ (pointer) = (FbStip *) (pixmap)->devPrivate.ptr; \ (stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride); \ (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \ } #define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \ PixmapPtr _pPix; \ fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \ fbGetPixmapBitsData(_pPix, pointer, stride, bpp); \ } #define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \ PixmapPtr _pPix; \ fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \ fbGetPixmapStipData(_pPix, pointer, stride, bpp); \ } /* * XFree86 empties the root BorderClip when the VT is inactive, * here's a macro which uses that to disable GetImage and GetSpans */ #define fbWindowEnabled(pWin) \ RegionNotEmpty(&(pWin)->drawable.pScreen->root->borderClip) #define fbDrawableEnabled(pDrawable) \ ((pDrawable)->type == DRAWABLE_PIXMAP ? \ TRUE : fbWindowEnabled((WindowPtr) pDrawable)) #define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0) /* * Accelerated tiles are power of 2 width <= FB_UNIT */ #define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w)) /* * fb24_32.c */ extern _X_EXPORT void fb24_32GetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart); extern _X_EXPORT void fb24_32SetSpans(DrawablePtr pDrawable, GCPtr pGC, char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); extern _X_EXPORT void fb24_32PutZImage(DrawablePtr pDrawable, RegionPtr pClip, int alu, FbBits pm, int x, int y, int width, int height, CARD8 *src, FbStride srcStride); extern _X_EXPORT void fb24_32GetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); extern _X_EXPORT void fb24_32CopyMtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT PixmapPtr fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel); extern _X_EXPORT Bool fb24_32CreateScreenResources(ScreenPtr pScreen); extern _X_EXPORT Bool fb24_32ModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData); /* * fballpriv.c */ extern _X_EXPORT Bool fbAllocatePrivates(ScreenPtr pScreen); /* * fbarc.c */ extern _X_EXPORT void fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs); /* * fbbits.c */ extern _X_EXPORT void fbBresSolid8(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbBresDash8(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbDots8(FbBits * dst, FbStride dstStride, int dstBpp, BoxPtr pBox, xPoint * pts, int npt, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); extern _X_EXPORT void fbArc8(FbBits * dst, FbStride dstStride, int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor); extern _X_EXPORT void fbGlyph8(FbBits * dstLine, FbStride dstStride, int dstBpp, FbStip * stipple, FbBits fg, int height, int shift); extern _X_EXPORT void fbPolyline8(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig); extern _X_EXPORT void fbPolySegment8(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg); extern _X_EXPORT void fbBresSolid16(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbBresDash16(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbDots16(FbBits * dst, FbStride dstStride, int dstBpp, BoxPtr pBox, xPoint * pts, int npt, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); extern _X_EXPORT void fbArc16(FbBits * dst, FbStride dstStride, int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor); extern _X_EXPORT void fbGlyph16(FbBits * dstLine, FbStride dstStride, int dstBpp, FbStip * stipple, FbBits fg, int height, int shift); extern _X_EXPORT void fbPolyline16(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig); extern _X_EXPORT void fbPolySegment16(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg); extern _X_EXPORT void fbBresSolid24(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbBresDash24(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbDots24(FbBits * dst, FbStride dstStride, int dstBpp, BoxPtr pBox, xPoint * pts, int npt, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); extern _X_EXPORT void fbArc24(FbBits * dst, FbStride dstStride, int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor); extern _X_EXPORT void fbPolyline24(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig); extern _X_EXPORT void fbPolySegment24(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg); extern _X_EXPORT void fbBresSolid32(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbBresDash32(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbDots32(FbBits * dst, FbStride dstStride, int dstBpp, BoxPtr pBox, xPoint * pts, int npt, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); extern _X_EXPORT void fbArc32(FbBits * dst, FbStride dstStride, int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor); extern _X_EXPORT void fbGlyph32(FbBits * dstLine, FbStride dstStride, int dstBpp, FbStip * stipple, FbBits fg, int height, int shift); extern _X_EXPORT void fbPolyline32(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig); extern _X_EXPORT void fbPolySegment32(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg); /* * fbblt.c */ extern _X_EXPORT void fbBlt(FbBits * src, FbStride srcStride, int srcX, FbBits * dst, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown); extern _X_EXPORT void fbBlt24(FbBits * srcLine, FbStride srcStride, int srcX, FbBits * dstLine, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm, Bool reverse, Bool upsidedown); extern _X_EXPORT void fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */ int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */ int dstX, int width, int height, int alu, FbBits pm, int bpp); /* * fbbltone.c */ extern _X_EXPORT void fbBltOne(FbStip * src, FbStride srcStride, int srcX, FbBits * dst, FbStride dstStride, int dstX, int dstBpp, int width, int height, FbBits fgand, FbBits fbxor, FbBits bgand, FbBits bgxor); extern _X_EXPORT void fbBltOne24(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ int srcX, /* bit position of source */ FbBits * dst, FbStride dstStride, /* FbBits units per scanline */ int dstX, /* bit position of dest */ int dstBpp, /* bits per destination unit */ int width, /* width in bits of destination */ int height, /* height in scanlines */ FbBits fgand, /* rrop values */ FbBits fgxor, FbBits bgand, FbBits bgxor); extern _X_EXPORT void fbBltPlane(FbBits * src, FbStride srcStride, int srcX, int srcBpp, FbStip * dst, FbStride dstStride, int dstX, int width, int height, FbStip fgand, FbStip fgxor, FbStip bgand, FbStip bgxor, Pixel planeMask); /* * fbcmap_mi.c */ extern _X_EXPORT int fbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps); extern _X_EXPORT void fbInstallColormap(ColormapPtr pmap); extern _X_EXPORT void fbUninstallColormap(ColormapPtr pmap); extern _X_EXPORT void fbResolveColor(unsigned short *pred, unsigned short *pgreen, unsigned short *pblue, VisualPtr pVisual); extern _X_EXPORT Bool fbInitializeColormap(ColormapPtr pmap); extern _X_EXPORT int fbExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem * indefs, xColorItem * outdefs); extern _X_EXPORT Bool fbCreateDefColormap(ScreenPtr pScreen); extern _X_EXPORT void fbClearVisualTypes(void); extern _X_EXPORT Bool fbHasVisualTypes(int depth); extern _X_EXPORT Bool fbSetVisualTypes(int depth, int visuals, int bitsPerRGB); extern _X_EXPORT Bool fbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, Pixel redMask, Pixel greenMask, Pixel blueMask); extern _X_EXPORT Bool fbInitVisuals(VisualPtr * visualp, DepthPtr * depthp, int *nvisualp, int *ndepthp, int *rootDepthp, VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB); /* * fbcopy.c */ extern _X_EXPORT void fbCopyNtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT void fbCopy1toN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT void fbCopyNto1(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT RegionPtr fbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut); extern _X_EXPORT RegionPtr fbCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut, unsigned long bitplane); /* * fbfill.c */ extern _X_EXPORT void fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height); extern _X_EXPORT void fbSolidBoxClipped(DrawablePtr pDrawable, RegionPtr pClip, int xa, int ya, int xb, int yb, FbBits and, FbBits xor); /* * fbfillrect.c */ extern _X_EXPORT void fbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectInit, xRectangle *prectInit); #define fbPolyFillArc miPolyFillArc #define fbFillPolygon miFillPolygon /* * fbfillsp.c */ extern _X_EXPORT void fbFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted); /* * fbgc.c */ extern _X_EXPORT Bool fbCreateGC(GCPtr pGC); extern _X_EXPORT void fbPadPixmap(PixmapPtr pPixmap); extern _X_EXPORT void fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); /* * fbgetsp.c */ extern _X_EXPORT void fbGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart); /* * fbglyph.c */ extern _X_EXPORT void fbPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); extern _X_EXPORT void fbImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); /* * fbimage.c */ extern _X_EXPORT void fbPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage); extern _X_EXPORT void fbPutZImage(DrawablePtr pDrawable, RegionPtr pClip, int alu, FbBits pm, int x, int y, int width, int height, FbStip * src, FbStride srcStride); extern _X_EXPORT void fbPutXYImage(DrawablePtr pDrawable, RegionPtr pClip, FbBits fg, FbBits bg, FbBits pm, int alu, Bool opaque, int x, int y, int width, int height, FbStip * src, FbStride srcStride, int srcX); extern _X_EXPORT void fbGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); /* * fbline.c */ extern _X_EXPORT void fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt); extern _X_EXPORT void fbFixCoordModePrevious(int npt, DDXPointPtr ppt); extern _X_EXPORT void fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg); #define fbPolyRectangle miPolyRectangle /* * fbpict.c */ extern _X_EXPORT Bool fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats); extern _X_EXPORT void fbDestroyGlyphCache(void); /* * fbpixmap.c */ extern _X_EXPORT PixmapPtr fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp, unsigned usage_hint); extern _X_EXPORT PixmapPtr fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, unsigned usage_hint); extern _X_EXPORT Bool fbDestroyPixmap(PixmapPtr pPixmap); extern _X_EXPORT RegionPtr fbPixmapToRegion(PixmapPtr pPix); /* * fbpoint.c */ extern _X_EXPORT void fbPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, xPoint * pptInit); /* * fbpush.c */ extern _X_EXPORT void fbPushImage(DrawablePtr pDrawable, GCPtr pGC, FbStip * src, FbStride srcStride, int srcX, int x, int y, int width, int height); extern _X_EXPORT void fbPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg); /* * fbscreen.c */ extern _X_EXPORT Bool fbCloseScreen(ScreenPtr pScreen); extern _X_EXPORT Bool fbRealizeFont(ScreenPtr pScreen, FontPtr pFont); extern _X_EXPORT Bool fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont); extern _X_EXPORT void fbQueryBestSize(int class, unsigned short *width, unsigned short *height, ScreenPtr pScreen); extern _X_EXPORT PixmapPtr _fbGetWindowPixmap(WindowPtr pWindow); extern _X_EXPORT void _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap); extern _X_EXPORT Bool fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */ int xsize, /* in pixels */ int ysize, int dpix, /* dots per inch */ int dpiy, int width, /* pixel width of frame buffer */ int bpp); /* bits per pixel of frame buffer */ extern _X_EXPORT Bool wfbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap); extern _X_EXPORT Bool wfbScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap); extern _X_EXPORT Bool fbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); extern _X_EXPORT Bool fbScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); /* * fbseg.c */ typedef void FbBres(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); extern _X_EXPORT void fbSegment(DrawablePtr pDrawable, GCPtr pGC, int xa, int ya, int xb, int yb, Bool drawLast, int *dashOffset); /* * fbsetsp.c */ extern _X_EXPORT void fbSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); /* * fbsolid.c */ extern _X_EXPORT void fbSolid(FbBits * dst, FbStride dstStride, int dstX, int bpp, int width, int height, FbBits and, FbBits xor); extern _X_EXPORT void fbSolid24(FbBits * dst, FbStride dstStride, int dstX, int width, int height, FbBits and, FbBits xor); /* * fbutil.c */ extern _X_EXPORT FbBits fbReplicatePixel(Pixel p, int bpp); #ifdef FB_ACCESS_WRAPPER extern _X_EXPORT ReadMemoryProcPtr wfbReadMemory; extern _X_EXPORT WriteMemoryProcPtr wfbWriteMemory; #endif /* * fbwindow.c */ extern _X_EXPORT Bool fbCreateWindow(WindowPtr pWin); extern _X_EXPORT Bool fbDestroyWindow(WindowPtr pWin); extern _X_EXPORT Bool fbRealizeWindow(WindowPtr pWindow); extern _X_EXPORT Bool fbPositionWindow(WindowPtr pWin, int x, int y); extern _X_EXPORT Bool fbUnrealizeWindow(WindowPtr pWindow); extern _X_EXPORT void fbCopyWindowProc(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); extern _X_EXPORT void fbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); extern _X_EXPORT Bool fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask); extern _X_EXPORT void fbFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, FbBits and, FbBits xor); extern _X_EXPORT pixman_image_t *image_from_pict(PicturePtr pict, Bool has_clip, int *xoff, int *yoff); extern _X_EXPORT void free_pixman_pict(PicturePtr, pixman_image_t *); #endif /* _FB_H_ */ xorg-server-1.17.1/fb/fbutil.c0000664000175100017510000000521612432306326013036 00000000000000/* * Copyright © 1998 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 "fb.h" FbBits fbReplicatePixel(Pixel p, int bpp) { FbBits b = p; b &= FbFullMask(bpp); while (bpp < FB_UNIT) { b |= b << bpp; bpp <<= 1; } return b; } #define O 0 #define I FB_ALLONES const FbMergeRopRec FbMergeRopBits[16] = { {O, O, O, O}, /* clear 0x0 0 */ {I, O, O, O}, /* and 0x1 src AND dst */ {I, O, I, O}, /* andReverse 0x2 src AND NOT dst */ {O, O, I, O}, /* copy 0x3 src */ {I, I, O, O}, /* andInverted 0x4 NOT src AND dst */ {O, I, O, O}, /* noop 0x5 dst */ {O, I, I, O}, /* xor 0x6 src XOR dst */ {I, I, I, O}, /* or 0x7 src OR dst */ {I, I, I, I}, /* nor 0x8 NOT src AND NOT dst */ {O, I, I, I}, /* equiv 0x9 NOT src XOR dst */ {O, I, O, I}, /* invert 0xa NOT dst */ {I, I, O, I}, /* orReverse 0xb src OR NOT dst */ {O, O, I, I}, /* copyInverted 0xc NOT src */ {I, O, I, I}, /* orInverted 0xd NOT src OR dst */ {I, O, O, I}, /* nand 0xe NOT src OR NOT dst */ {O, O, O, I}, /* set 0xf 1 */ }; xorg-server-1.17.1/fb/fbfill.c0000664000175100017510000002115012432306326013002 00000000000000/* * Copyright © 1998 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 "fb.h" static void fbTile(FbBits * dst, FbStride dstStride, int dstX, int width, int height, FbBits * tile, FbStride tileStride, int tileWidth, int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot) { int tileX, tileY; int widthTmp; int h, w; int x, y; modulus(-yRot, tileHeight, tileY); y = 0; while (height) { h = tileHeight - tileY; if (h > height) h = height; height -= h; widthTmp = width; x = dstX; modulus(dstX - xRot, tileWidth, tileX); while (widthTmp) { w = tileWidth - tileX; if (w > widthTmp) w = widthTmp; widthTmp -= w; fbBlt(tile + tileY * tileStride, tileStride, tileX, dst + y * dstStride, dstStride, x, w, h, alu, pm, bpp, FALSE, FALSE); x += w; tileX = 0; } y += h; tileY = 0; } } static void fbStipple(FbBits * dst, FbStride dstStride, int dstX, int dstBpp, int width, int height, FbStip * stip, FbStride stipStride, int stipWidth, int stipHeight, FbBits fgand, FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot) { int stipX, stipY, sx; int widthTmp; int h, w; int x, y; modulus(-yRot, stipHeight, stipY); modulus(dstX / dstBpp - xRot, stipWidth, stipX); y = 0; while (height) { h = stipHeight - stipY; if (h > height) h = height; height -= h; widthTmp = width; x = dstX; sx = stipX; while (widthTmp) { w = (stipWidth - sx) * dstBpp; if (w > widthTmp) w = widthTmp; widthTmp -= w; fbBltOne(stip + stipY * stipStride, stipStride, sx, dst + y * dstStride, dstStride, x, dstBpp, w, h, fgand, fgxor, bgand, bgxor); x += w; sx = 0; } y += h; stipY = 0; } } void fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height) { FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); switch (pGC->fillStyle) { case FillSolid: #ifndef FB_ACCESS_WRAPPER if (pPriv->and || !pixman_fill((uint32_t *) dst, dstStride, dstBpp, x + dstXoff, y + dstYoff, width, height, pPriv->xor)) #endif fbSolid(dst + (y + dstYoff) * dstStride, dstStride, (x + dstXoff) * dstBpp, dstBpp, width * dstBpp, height, pPriv->and, pPriv->xor); break; case FillStippled: case FillOpaqueStippled:{ PixmapPtr pStip = pGC->stipple; int stipWidth = pStip->drawable.width; int stipHeight = pStip->drawable.height; if (dstBpp == 1) { int alu; FbBits *stip; FbStride stipStride; int stipBpp; _X_UNUSED int stipXoff, stipYoff; if (pGC->fillStyle == FillStippled) alu = FbStipple1Rop(pGC->alu, pGC->fgPixel); else alu = FbOpaqueStipple1Rop(pGC->alu, pGC->fgPixel, pGC->bgPixel); fbGetDrawable(&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff); fbTile(dst + (y + dstYoff) * dstStride, dstStride, x + dstXoff, width, height, stip, stipStride, stipWidth, stipHeight, alu, pPriv->pm, dstBpp, (pGC->patOrg.x + pDrawable->x + dstXoff), pGC->patOrg.y + pDrawable->y - y); fbFinishAccess(&pStip->drawable); } else { FbStip *stip; FbStride stipStride; int stipBpp; _X_UNUSED int stipXoff, stipYoff; FbBits fgand, fgxor, bgand, bgxor; fgand = pPriv->and; fgxor = pPriv->xor; if (pGC->fillStyle == FillStippled) { bgand = fbAnd(GXnoop, (FbBits) 0, FB_ALLONES); bgxor = fbXor(GXnoop, (FbBits) 0, FB_ALLONES); } else { bgand = pPriv->bgand; bgxor = pPriv->bgxor; } fbGetStipDrawable(&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff); fbStipple(dst + (y + dstYoff) * dstStride, dstStride, (x + dstXoff) * dstBpp, dstBpp, width * dstBpp, height, stip, stipStride, stipWidth, stipHeight, fgand, fgxor, bgand, bgxor, pGC->patOrg.x + pDrawable->x + dstXoff, pGC->patOrg.y + pDrawable->y - y); fbFinishAccess(&pStip->drawable); } break; } case FillTiled:{ PixmapPtr pTile = pGC->tile.pixmap; FbBits *tile; FbStride tileStride; int tileBpp; int tileWidth; int tileHeight; _X_UNUSED int tileXoff, tileYoff; fbGetDrawable(&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff); tileWidth = pTile->drawable.width; tileHeight = pTile->drawable.height; fbTile(dst + (y + dstYoff) * dstStride, dstStride, (x + dstXoff) * dstBpp, width * dstBpp, height, tile, tileStride, tileWidth * tileBpp, tileHeight, pGC->alu, pPriv->pm, dstBpp, (pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp, pGC->patOrg.y + pDrawable->y - y); fbFinishAccess(&pTile->drawable); break; } } fbValidateDrawable(pDrawable); fbFinishAccess(pDrawable); } void fbSolidBoxClipped(DrawablePtr pDrawable, RegionPtr pClip, int x1, int y1, int x2, int y2, FbBits and, FbBits xor) { FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; BoxPtr pbox; int nbox; int partX1, partX2, partY1, partY2; fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { partX1 = pbox->x1; if (partX1 < x1) partX1 = x1; partX2 = pbox->x2; if (partX2 > x2) partX2 = x2; if (partX2 <= partX1) continue; partY1 = pbox->y1; if (partY1 < y1) partY1 = y1; partY2 = pbox->y2; if (partY2 > y2) partY2 = y2; if (partY2 <= partY1) continue; #ifndef FB_ACCESS_WRAPPER if (and || !pixman_fill((uint32_t *) dst, dstStride, dstBpp, partX1 + dstXoff, partY1 + dstYoff, (partX2 - partX1), (partY2 - partY1), xor)) #endif fbSolid(dst + (partY1 + dstYoff) * dstStride, dstStride, (partX1 + dstXoff) * dstBpp, dstBpp, (partX2 - partX1) * dstBpp, (partY2 - partY1), and, xor); } fbFinishAccess(pDrawable); } xorg-server-1.17.1/fb/fbsetsp.c0000664000175100017510000000570212422276410013216 00000000000000/* * Copyright © 1998 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 "fb.h" void fbSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); RegionPtr pClip = fbGetCompositeClip(pGC); FbBits *dst, *d, *s; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; BoxPtr pbox; int n; int xoff; int x1, x2; if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { fb24_32SetSpans(pDrawable, pGC, src, ppt, pwidth, nspans, fSorted); return; } fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (nspans--) { d = dst + (ppt->y + dstYoff) * dstStride; xoff = (int) (((long) src) & (FB_MASK >> 3)); s = (FbBits *) (src - xoff); xoff <<= 3; n = RegionNumRects(pClip); pbox = RegionRects(pClip); while (n--) { if (pbox->y1 > ppt->y) break; if (pbox->y2 > ppt->y) { x1 = ppt->x; x2 = x1 + *pwidth; if (pbox->x1 > x1) x1 = pbox->x1; if (pbox->x2 < x2) x2 = pbox->x2; if (x1 < x2) fbBlt((FbBits *) s, 0, (x1 - ppt->x) * dstBpp + xoff, d, dstStride, (x1 + dstXoff) * dstBpp, (x2 - x1) * dstBpp, 1, pGC->alu, pPriv->pm, dstBpp, FALSE, FALSE); } } src += PixmapBytePad(*pwidth, pDrawable->depth); ppt++; pwidth++; } fbValidateDrawable(pDrawable); fbFinishAccess(pDrawable); } xorg-server-1.17.1/fb/fbpush.c0000664000175100017510000001316512432306326013042 00000000000000/* * Copyright © 1998 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 "fb.h" static void fbPushPattern(DrawablePtr pDrawable, GCPtr pGC, FbStip * src, FbStride srcStride, int srcX, int x, int y, int width, int height) { FbStip *s, bitsMask, bitsMask0, bits; int xspan; int w; int lenspan; src += srcX >> FB_STIP_SHIFT; srcX &= FB_STIP_MASK; bitsMask0 = FbStipMask(srcX, 1); while (height--) { bitsMask = bitsMask0; w = width; s = src; src += srcStride; bits = READ(s++); xspan = x; while (w) { if (bits & bitsMask) { lenspan = 0; do { lenspan++; if (lenspan == w) break; bitsMask = FbStipRight(bitsMask, 1); if (!bitsMask) { bits = READ(s++); bitsMask = FbBitsMask(0, 1); } } while (bits & bitsMask); fbFill(pDrawable, pGC, xspan, y, lenspan, 1); xspan += lenspan; w -= lenspan; } else { do { w--; xspan++; if (!w) break; bitsMask = FbStipRight(bitsMask, 1); if (!bitsMask) { bits = READ(s++); bitsMask = FbBitsMask(0, 1); } } while (!(bits & bitsMask)); } } y++; } } static void fbPushFill(DrawablePtr pDrawable, GCPtr pGC, FbStip * src, FbStride srcStride, int srcX, int x, int y, int width, int height) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); if (pGC->fillStyle == FillSolid) { FbBits *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; int dstX; int dstWidth; fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); dst = dst + (y + dstYoff) * dstStride; dstX = (x + dstXoff) * dstBpp; dstWidth = width * dstBpp; if (dstBpp == 1) { fbBltStip(src, srcStride, srcX, (FbStip *) dst, FbBitsStrideToStipStride(dstStride), dstX, dstWidth, height, FbStipple1Rop(pGC->alu, pGC->fgPixel), pPriv->pm, dstBpp); } else { fbBltOne(src, srcStride, srcX, dst, dstStride, dstX, dstBpp, dstWidth, height, pPriv->and, pPriv->xor, fbAnd(GXnoop, (FbBits) 0, FB_ALLONES), fbXor(GXnoop, (FbBits) 0, FB_ALLONES)); } fbFinishAccess(pDrawable); } else { fbPushPattern(pDrawable, pGC, src, srcStride, srcX, x, y, width, height); } } void fbPushImage(DrawablePtr pDrawable, GCPtr pGC, FbStip * src, FbStride srcStride, int srcX, int x, int y, int width, int height) { RegionPtr pClip = fbGetCompositeClip(pGC); int nbox; BoxPtr pbox; int x1, y1, x2, y2; for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { x1 = x; y1 = y; x2 = x + width; y2 = y + height; if (x1 < pbox->x1) x1 = pbox->x1; if (y1 < pbox->y1) y1 = pbox->y1; if (x2 > pbox->x2) x2 = pbox->x2; if (y2 > pbox->y2) y2 = pbox->y2; if (x1 >= x2 || y1 >= y2) continue; fbPushFill(pDrawable, pGC, src + (y1 - y) * srcStride, srcStride, srcX + (x1 - x), x1, y1, x2 - x1, y2 - y1); } } void fbPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg) { FbStip *stip; FbStride stipStride; int stipBpp; _X_UNUSED int stipXoff, stipYoff; fbGetStipDrawable(&pBitmap->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff); fbPushImage(pDrawable, pGC, stip, stipStride, 0, xOrg, yOrg, dx, dy); } xorg-server-1.17.1/pseudoramiX/0000775000175100017510000000000012466505443013402 500000000000000xorg-server-1.17.1/pseudoramiX/Makefile.am0000664000175100017510000000022612213444026015343 00000000000000# Fake Xinerama extension AM_CFLAGS = $(DIX_CFLAGS) noinst_LTLIBRARIES = libPseudoramiX.la libPseudoramiX_la_SOURCES = pseudoramiX.c pseudoramiX.h xorg-server-1.17.1/pseudoramiX/pseudoramiX.c0000664000175100017510000003251512274325511015765 00000000000000/* * Minimal implementation of PanoramiX/Xinerama * * This is used in rootless mode where the underlying window server * already provides an abstracted view of multiple screens as one * large screen area. * * This code is largely based on panoramiX.c, which contains the * following copyright notice: */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 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. 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 DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ #ifdef HAVE_DIX_CONFIG_H #include #endif #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 ProcPanoramiXQueryVersion(ClientPtr client); static void PseudoramiXResetProc(ExtensionEntry *extEntry); static int ProcPseudoramiXQueryVersion(ClientPtr client); static int ProcPseudoramiXGetState(ClientPtr client); static int ProcPseudoramiXGetScreenCount(ClientPtr client); static int ProcPseudoramiXGetScreenSize(ClientPtr client); static int ProcPseudoramiXIsActive(ClientPtr client); static int ProcPseudoramiXQueryScreens(ClientPtr client); static int ProcPseudoramiXDispatch(ClientPtr client); static int SProcPseudoramiXQueryVersion(ClientPtr client); static int SProcPseudoramiXGetState(ClientPtr client); static int SProcPseudoramiXGetScreenCount(ClientPtr client); static int SProcPseudoramiXGetScreenSize(ClientPtr client); static int SProcPseudoramiXIsActive(ClientPtr client); static int SProcPseudoramiXQueryScreens(ClientPtr client); static int SProcPseudoramiXDispatch(ClientPtr client); typedef struct { int x; int y; int w; int h; } PseudoramiXScreenRec; static PseudoramiXScreenRec *pseudoramiXScreens = NULL; static int pseudoramiXScreensAllocated = 0; static int pseudoramiXNumScreens = 0; static unsigned long pseudoramiXGeneration = 0; static void PseudoramiXTrace(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); 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, ...) _X_ATTRIBUTE_PRINTF(1, 2); 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. // Screens must be re-added once per generation. void PseudoramiXAddScreen(int x, int y, int w, int h) { PseudoramiXScreenRec *s; if (noPseudoramiXExtension) return; if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) { pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1; pseudoramiXScreens = realloc(pseudoramiXScreens, pseudoramiXScreensAllocated * sizeof(PseudoramiXScreenRec)); } DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h); s = &pseudoramiXScreens[pseudoramiXNumScreens++]; s->x = x; s->y = y; s->w = w; s->h = h; } // Initialize PseudoramiX. // Copied from PanoramiXExtensionInit void PseudoramiXExtensionInit(void) { Bool success = FALSE; ExtensionEntry *extEntry; if (noPseudoramiXExtension) return; TRACE; /* Even with only one screen we need to enable PseudoramiX to allow dynamic screen configuration changes. */ #if 0 if (pseudoramiXNumScreens == 1) { // Only one screen - disable Xinerama extension. noPseudoramiXExtension = TRUE; return; } #endif if (pseudoramiXGeneration != serverGeneration) { extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0, ProcPseudoramiXDispatch, SProcPseudoramiXDispatch, PseudoramiXResetProc, StandardMinorOpcode); if (!extEntry) { ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n"); } else { pseudoramiXGeneration = serverGeneration; success = TRUE; } } if (!success) { ErrorF("%s Extension (PseudoramiX) failed to initialize\n", PANORAMIX_PROTOCOL_NAME); return; } } void PseudoramiXResetScreens(void) { TRACE; pseudoramiXNumScreens = 0; } static void PseudoramiXResetProc(ExtensionEntry *extEntry) { TRACE; PseudoramiXResetScreens(); } // was PanoramiX static int ProcPseudoramiXQueryVersion(ClientPtr client) { TRACE; return ProcPanoramiXQueryVersion(client); } // was PanoramiX static int ProcPseudoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); WindowPtr pWin; xPanoramiXGetStateReply rep; register int rc; TRACE; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = !noPseudoramiXExtension; rep.window = stuff->window; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.window); } WriteToClient(client, sizeof(xPanoramiXGetStateReply),&rep); return Success; } // was PanoramiX static int ProcPseudoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); WindowPtr pWin; xPanoramiXGetScreenCountReply rep; register int rc; TRACE; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.ScreenCount = pseudoramiXNumScreens; rep.window = stuff->window; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.window); } WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply),&rep); return Success; } // was PanoramiX static int ProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; register int rc; TRACE; if (stuff->screen >= pseudoramiXNumScreens) return BadMatch; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; /* screen dimensions */ rep.width = pseudoramiXScreens[stuff->screen].w; // 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); swapl(&rep.width); swapl(&rep.height); swapl(&rep.window); swapl(&rep.screen); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply),&rep); return Success; } // was Xinerama static int ProcPseudoramiXIsActive(ClientPtr client) { /* REQUEST(xXineramaIsActiveReq); */ xXineramaIsActiveReply rep; TRACE; REQUEST_SIZE_MATCH(xXineramaIsActiveReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = !noPseudoramiXExtension; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.state); } WriteToClient(client, sizeof(xXineramaIsActiveReply),&rep); return Success; } // was Xinerama static int ProcPseudoramiXQueryScreens(ClientPtr client) { /* REQUEST(xXineramaQueryScreensReq); */ xXineramaQueryScreensReply rep; DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n", noPseudoramiXExtension, pseudoramiXNumScreens); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens; 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),&rep); if (!noPseudoramiXExtension) { xXineramaScreenInfo scratch; int i; for (i = 0; i < pseudoramiXNumScreens; i++) { scratch.x_org = pseudoramiXScreens[i].x; scratch.y_org = pseudoramiXScreens[i].y; scratch.width = pseudoramiXScreens[i].w; scratch.height = pseudoramiXScreens[i].h; if (client->swapped) { swaps(&scratch.x_org); swaps(&scratch.y_org); swaps(&scratch.width); swaps(&scratch.height); } WriteToClient(client, sz_XineramaScreenInfo,&scratch); } } return Success; } // was PanoramiX static int ProcPseudoramiXDispatch(ClientPtr client) { REQUEST(xReq); TRACE; switch (stuff->data) { case X_PanoramiXQueryVersion: return ProcPseudoramiXQueryVersion(client); case X_PanoramiXGetState: return ProcPseudoramiXGetState(client); case X_PanoramiXGetScreenCount: return ProcPseudoramiXGetScreenCount(client); case X_PanoramiXGetScreenSize: return ProcPseudoramiXGetScreenSize(client); case X_XineramaIsActive: return ProcPseudoramiXIsActive(client); case X_XineramaQueryScreens: return ProcPseudoramiXQueryScreens(client); } return BadRequest; } static int SProcPseudoramiXQueryVersion(ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); return ProcPseudoramiXQueryVersion(client); } static int SProcPseudoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); return ProcPseudoramiXGetState(client); } static int SProcPseudoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); return ProcPseudoramiXGetScreenCount(client); } static int SProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); return ProcPseudoramiXGetScreenSize(client); } static int SProcPseudoramiXIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return ProcPseudoramiXIsActive(client); } static int SProcPseudoramiXQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return ProcPseudoramiXQueryScreens(client); } static int SProcPseudoramiXDispatch(ClientPtr client) { REQUEST(xReq); TRACE; switch (stuff->data) { case X_PanoramiXQueryVersion: return SProcPseudoramiXQueryVersion(client); case X_PanoramiXGetState: return SProcPseudoramiXGetState(client); case X_PanoramiXGetScreenCount: return SProcPseudoramiXGetScreenCount(client); case X_PanoramiXGetScreenSize: return SProcPseudoramiXGetScreenSize(client); case X_XineramaIsActive: return SProcPseudoramiXIsActive(client); case X_XineramaQueryScreens: return SProcPseudoramiXQueryScreens(client); } return BadRequest; } xorg-server-1.17.1/pseudoramiX/Makefile.in0000664000175100017510000006114612466505436015401 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Fake Xinerama extension VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = pseudoramiX DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libPseudoramiX_la_LIBADD = am_libPseudoramiX_la_OBJECTS = pseudoramiX.lo libPseudoramiX_la_OBJECTS = $(am_libPseudoramiX_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 = $(libPseudoramiX_la_SOURCES) DIST_SOURCES = $(libPseudoramiX_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CFLAGS = $(DIX_CFLAGS) noinst_LTLIBRARIES = libPseudoramiX.la libPseudoramiX_la_SOURCES = pseudoramiX.c pseudoramiX.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 pseudoramiX/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign pseudoramiX/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libPseudoramiX.la: $(libPseudoramiX_la_OBJECTS) $(libPseudoramiX_la_DEPENDENCIES) $(EXTRA_libPseudoramiX_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libPseudoramiX_la_OBJECTS) $(libPseudoramiX_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pseudoramiX.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/pseudoramiX/pseudoramiX.h0000664000175100017510000000026712274325511015771 00000000000000/* * Minimal implementation of PanoramiX/Xinerama */ extern int noPseudoramiXExtension; void PseudoramiXAddScreen(int x, int y, int w, int h); void PseudoramiXResetScreens(void); xorg-server-1.17.1/hw/0000775000175100017510000000000012466505446011523 500000000000000xorg-server-1.17.1/hw/Makefile.am0000664000175100017510000000117512323563340013470 00000000000000if DMX DMX_SUBDIRS = dmx endif if XORG XORG_SUBDIRS = xfree86 endif if XVFB XVFB_SUBDIRS = vfb endif if XNEST XNEST_SUBDIRS = xnest endif if XWIN XWIN_SUBDIRS = xwin endif if KDRIVE KDRIVE_SUBDIRS = kdrive endif if XQUARTZ XQUARTZ_SUBDIRS = xquartz endif if XWAYLAND XWAYLAND_SUBDIRS = xwayland endif SUBDIRS = \ $(XORG_SUBDIRS) \ $(XWIN_SUBDIRS) \ $(XVFB_SUBDIRS) \ $(XNEST_SUBDIRS) \ $(DMX_SUBDIRS) \ $(KDRIVE_SUBDIRS) \ $(XQUARTZ_SUBDIRS) \ $(XWAYLAND_SUBDIRS) DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland relink: $(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done xorg-server-1.17.1/hw/vfb/0000775000175100017510000000000012466505445012277 500000000000000xorg-server-1.17.1/hw/vfb/Makefile.am0000664000175100017510000000107112323563340014240 00000000000000SUBDIRS = man bin_PROGRAMS = Xvfb AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ $(XVFBMODULES_CFLAGS) \ $(DIX_CFLAGS) SRCS = InitInput.c \ InitOutput.c \ $(top_srcdir)/mi/miinitext.c Xvfb_SOURCES = $(SRCS) XVFB_LIBS = \ @XVFB_LIBS@ \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) relink: $(AM_V_at)rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT) xorg-server-1.17.1/hw/vfb/InitInput.c0000664000175100017510000000725612274325511014307 00000000000000/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "mi.h" #include #include "scrnintstr.h" #include "inputstr.h" #include #include "mipointer.h" #include "xkbsrv.h" #include #include "xserver-properties.h" #include "exevents.h" #include "extinit.h" Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) { return TRUE; } void ProcessInputEvents(void) { mieqProcessInputEvents(); } void DDXRingBell(int volume, int pitch, int duration) { } #define VFB_MIN_KEY 8 #define VFB_MAX_KEY 255 static int vfbKeybdProc(DeviceIntPtr pDevice, int onoff) { DevicePtr pDev = (DevicePtr) pDevice; switch (onoff) { case DEVICE_INIT: InitKeyboardDeviceStruct(pDevice, NULL, NULL, NULL); break; case DEVICE_ON: pDev->on = TRUE; break; case DEVICE_OFF: pDev->on = FALSE; break; case DEVICE_CLOSE: break; } return Success; } static int vfbMouseProc(DeviceIntPtr pDevice, int onoff) { #define NBUTTONS 3 #define NAXES 2 BYTE map[NBUTTONS + 1]; DevicePtr pDev = (DevicePtr) pDevice; Atom btn_labels[NBUTTONS] = { 0 }; Atom axes_labels[NAXES] = { 0 }; switch (onoff) { case DEVICE_INIT: map[1] = 1; map[2] = 2; map[3] = 3; btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); InitPointerDeviceStruct(pDev, map, NBUTTONS, btn_labels, (PtrCtrlProcPtr) NoopDDA, GetMotionHistorySize(), NAXES, axes_labels); break; case DEVICE_ON: pDev->on = TRUE; break; case DEVICE_OFF: pDev->on = FALSE; break; case DEVICE_CLOSE: break; } return Success; #undef NBUTTONS #undef NAXES } void InitInput(int argc, char *argv[]) { DeviceIntPtr p, k; Atom xiclass; p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE); AssignTypeAndName(p, xiclass, "Xvfb mouse"); xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE); AssignTypeAndName(k, xiclass, "Xvfb keyboard"); (void) mieqInit(); } void CloseInput(void) { mieqFini(); } xorg-server-1.17.1/hw/vfb/InitOutput.c0000664000175100017510000006212512415504317014504 00000000000000/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #if defined(WIN32) #include #endif #include #include #include #include #include "scrnintstr.h" #include "servermd.h" #define PSZ 8 #include "fb.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" #include "mipointer.h" #include "micmap.h" #include #ifdef HAVE_MMAP #include #ifndef MAP_FILE #define MAP_FILE 0 #endif #endif /* HAVE_MMAP */ #include #include #ifndef WIN32 #include #endif #include #ifdef HAS_SHM #include #include #endif /* HAS_SHM */ #include "dix.h" #include "miline.h" #include "glx_extinit.h" #define VFB_DEFAULT_WIDTH 1280 #define VFB_DEFAULT_HEIGHT 1024 #define VFB_DEFAULT_DEPTH 8 #define VFB_DEFAULT_WHITEPIXEL 1 #define VFB_DEFAULT_BLACKPIXEL 0 #define VFB_DEFAULT_LINEBIAS 0 #define XWD_WINDOW_NAME_LEN 60 typedef struct { int width; int paddedBytesWidth; int paddedWidth; int height; int depth; int bitsPerPixel; int sizeInBytes; int ncolors; char *pfbMemory; XWDColor *pXWDCmap; XWDFileHeader *pXWDHeader; Pixel blackPixel; Pixel whitePixel; unsigned int lineBias; CloseScreenProcPtr closeScreen; #ifdef HAVE_MMAP int mmap_fd; char mmap_file[MAXPATHLEN]; #endif #ifdef HAS_SHM int shmid; #endif } vfbScreenInfo, *vfbScreenInfoPtr; static int vfbNumScreens; static vfbScreenInfo *vfbScreens; static vfbScreenInfo defaultScreenInfo = { .width = VFB_DEFAULT_WIDTH, .height = VFB_DEFAULT_HEIGHT, .depth = VFB_DEFAULT_DEPTH, .blackPixel = VFB_DEFAULT_BLACKPIXEL, .whitePixel = VFB_DEFAULT_WHITEPIXEL, .lineBias = VFB_DEFAULT_LINEBIAS, }; static Bool vfbPixmapDepths[33]; #ifdef HAVE_MMAP static char *pfbdir = NULL; #endif typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType; static fbMemType fbmemtype = NORMAL_MEMORY_FB; static char needswap = 0; static Bool Render = TRUE; #define swapcopy16(_dst, _src) \ if (needswap) { CARD16 _s = _src; cpswaps(_s, _dst); } \ else _dst = _src; #define swapcopy32(_dst, _src) \ if (needswap) { CARD32 _s = _src; cpswapl(_s, _dst); } \ else _dst = _src; static void vfbInitializePixmapDepths(void) { int i; vfbPixmapDepths[1] = TRUE; /* always need bitmaps */ for (i = 2; i <= 32; i++) vfbPixmapDepths[i] = FALSE; } static int vfbBitsPerPixel(int depth) { if (depth == 1) return 1; else if (depth <= 8) return 8; else if (depth <= 16) return 16; else return 32; } void ddxGiveUp(enum ExitCode error) { int i; /* clean up the framebuffers */ switch (fbmemtype) { #ifdef HAVE_MMAP case MMAPPED_FILE_FB: for (i = 0; i < vfbNumScreens; i++) { if (-1 == unlink(vfbScreens[i].mmap_file)) { perror("unlink"); ErrorF("unlink %s failed, %s", vfbScreens[i].mmap_file, strerror(errno)); } } break; #else /* HAVE_MMAP */ case MMAPPED_FILE_FB: break; #endif /* HAVE_MMAP */ #ifdef HAS_SHM case SHARED_MEMORY_FB: for (i = 0; i < vfbNumScreens; i++) { if (-1 == shmdt((char *) vfbScreens[i].pXWDHeader)) { perror("shmdt"); ErrorF("shmdt failed, %s", strerror(errno)); } } break; #else /* HAS_SHM */ case SHARED_MEMORY_FB: break; #endif /* HAS_SHM */ case NORMAL_MEMORY_FB: for (i = 0; i < vfbNumScreens; i++) { free(vfbScreens[i].pXWDHeader); } break; } } void AbortDDX(enum ExitCode error) { ddxGiveUp(error); } #ifdef __APPLE__ void DarwinHandleGUI(int argc, char *argv[]) { } #endif void OsVendorInit(void) { } void OsVendorFatalError(const char *f, va_list args) { } #if defined(DDXBEFORERESET) void ddxBeforeReset(void) { return; } #endif void ddxUseMsg(void) { ErrorF("-screen scrn WxHxD set screen's width, height, depth\n"); ErrorF("-pixdepths list-of-int support given pixmap depths\n"); ErrorF("+/-render turn on/off RENDER extension support" "(default on)\n"); ErrorF("-linebias n adjust thin line pixelization\n"); ErrorF("-blackpixel n pixel value for black\n"); ErrorF("-whitepixel n pixel value for white\n"); #ifdef HAVE_MMAP ErrorF ("-fbdir directory put framebuffers in mmap'ed files in directory\n"); #endif #ifdef HAS_SHM ErrorF("-shmem put framebuffers in shared memory\n"); #endif } int ddxProcessArgument(int argc, char *argv[], int i) { static Bool firstTime = TRUE; static int lastScreen = -1; vfbScreenInfo *currentScreen; if (firstTime) { vfbInitializePixmapDepths(); firstTime = FALSE; } if (lastScreen == -1) currentScreen = &defaultScreenInfo; else currentScreen = &vfbScreens[lastScreen]; #define CHECK_FOR_REQUIRED_ARGUMENTS(num) \ if (((i + num) >= argc) || (!argv[i + num])) { \ ErrorF("Required argument to %s not specified\n", argv[i]); \ UseMsg(); \ FatalError("Required argument to %s not specified\n", argv[i]); \ } if (strcmp(argv[i], "-screen") == 0) { /* -screen n WxHxD */ int screenNum; CHECK_FOR_REQUIRED_ARGUMENTS(2); screenNum = atoi(argv[i + 1]); /* The protocol only has a CARD8 for number of screens in the connection setup block, so don't allow more than that. */ if ((screenNum < 0) || (screenNum >= 255)) { ErrorF("Invalid screen number %d\n", screenNum); UseMsg(); FatalError("Invalid screen number %d passed to -screen\n", screenNum); } if (vfbNumScreens <= screenNum) { vfbScreens = realloc(vfbScreens, sizeof(*vfbScreens) * (screenNum + 1)); if (!vfbScreens) FatalError("Not enough memory for screen %d\n", screenNum); for (; vfbNumScreens <= screenNum; ++vfbNumScreens) vfbScreens[vfbNumScreens] = defaultScreenInfo; } if (3 != sscanf(argv[i + 2], "%dx%dx%d", &vfbScreens[screenNum].width, &vfbScreens[screenNum].height, &vfbScreens[screenNum].depth)) { ErrorF("Invalid screen configuration %s\n", argv[i + 2]); UseMsg(); FatalError("Invalid screen configuration %s for -screen %d\n", argv[i + 2], screenNum); } lastScreen = screenNum; return 3; } if (strcmp(argv[i], "-pixdepths") == 0) { /* -pixdepths list-of-depth */ int depth, ret = 1; CHECK_FOR_REQUIRED_ARGUMENTS(1); while ((++i < argc) && (depth = atoi(argv[i])) != 0) { if (depth < 0 || depth > 32) { ErrorF("Invalid pixmap depth %d\n", depth); UseMsg(); FatalError("Invalid pixmap depth %d passed to -pixdepths\n", depth); } vfbPixmapDepths[depth] = TRUE; ret++; } return ret; } if (strcmp(argv[i], "+render") == 0) { /* +render */ Render = TRUE; return 1; } if (strcmp(argv[i], "-render") == 0) { /* -render */ Render = FALSE; #ifdef COMPOSITE noCompositeExtension = TRUE; #endif return 1; } if (strcmp(argv[i], "-blackpixel") == 0) { /* -blackpixel n */ CHECK_FOR_REQUIRED_ARGUMENTS(1); currentScreen->blackPixel = atoi(argv[++i]); return 2; } if (strcmp(argv[i], "-whitepixel") == 0) { /* -whitepixel n */ CHECK_FOR_REQUIRED_ARGUMENTS(1); currentScreen->whitePixel = atoi(argv[++i]); return 2; } if (strcmp(argv[i], "-linebias") == 0) { /* -linebias n */ CHECK_FOR_REQUIRED_ARGUMENTS(1); currentScreen->lineBias = atoi(argv[++i]); return 2; } #ifdef HAVE_MMAP if (strcmp(argv[i], "-fbdir") == 0) { /* -fbdir directory */ CHECK_FOR_REQUIRED_ARGUMENTS(1); pfbdir = argv[++i]; fbmemtype = MMAPPED_FILE_FB; return 2; } #endif /* HAVE_MMAP */ #ifdef HAS_SHM if (strcmp(argv[i], "-shmem") == 0) { /* -shmem */ fbmemtype = SHARED_MEMORY_FB; return 1; } #endif return 0; } static void vfbInstallColormap(ColormapPtr pmap) { ColormapPtr oldpmap = GetInstalledmiColormap(pmap->pScreen); if (pmap != oldpmap) { int entries; XWDFileHeader *pXWDHeader; VisualPtr pVisual; Pixel *ppix; xrgb *prgb; xColorItem *defs; int i; miInstallColormap(pmap); entries = pmap->pVisual->ColormapEntries; pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader; pVisual = pmap->pVisual; swapcopy32(pXWDHeader->visual_class, pVisual->class); swapcopy32(pXWDHeader->red_mask, pVisual->redMask); swapcopy32(pXWDHeader->green_mask, pVisual->greenMask); swapcopy32(pXWDHeader->blue_mask, pVisual->blueMask); swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue); swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries); ppix = (Pixel *) malloc(entries * sizeof(Pixel)); prgb = (xrgb *) malloc(entries * sizeof(xrgb)); defs = (xColorItem *) malloc(entries * sizeof(xColorItem)); for (i = 0; i < entries; i++) ppix[i] = i; /* XXX truecolor */ QueryColors(pmap, entries, ppix, prgb, serverClient); for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */ defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */ defs[i].red = prgb[i].red; defs[i].green = prgb[i].green; defs[i].blue = prgb[i].blue; defs[i].flags = DoRed | DoGreen | DoBlue; } (*pmap->pScreen->StoreColors) (pmap, entries, defs); free(ppix); free(prgb); free(defs); } } static void vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs) { XWDColor *pXWDCmap; int i; if (pmap != GetInstalledmiColormap(pmap->pScreen)) { return; } pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap; if ((pmap->pVisual->class | DynamicClass) == DirectColor) { return; } for (i = 0; i < ndef; i++) { if (pdefs[i].flags & DoRed) { swapcopy16(pXWDCmap[pdefs[i].pixel].red, pdefs[i].red); } if (pdefs[i].flags & DoGreen) { swapcopy16(pXWDCmap[pdefs[i].pixel].green, pdefs[i].green); } if (pdefs[i].flags & DoBlue) { swapcopy16(pXWDCmap[pdefs[i].pixel].blue, pdefs[i].blue); } } } static Bool vfbSaveScreen(ScreenPtr pScreen, int on) { return TRUE; } #ifdef HAVE_MMAP /* this flushes any changes to the screens out to the mmapped file */ static void vfbBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) { int i; for (i = 0; i < vfbNumScreens; i++) { #ifdef MS_ASYNC if (-1 == msync((caddr_t) vfbScreens[i].pXWDHeader, (size_t) vfbScreens[i].sizeInBytes, MS_ASYNC)) #else /* silly NetBSD and who else? */ if (-1 == msync((caddr_t) vfbScreens[i].pXWDHeader, (size_t) vfbScreens[i].sizeInBytes)) #endif { perror("msync"); ErrorF("msync failed, %s", strerror(errno)); } } } static void vfbWakeupHandler(void *blockData, int result, void *pReadmask) { } static void vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb) { #define DUMMY_BUFFER_SIZE 65536 char dummyBuffer[DUMMY_BUFFER_SIZE]; int currentFileSize, writeThisTime; snprintf(pvfb->mmap_file, sizeof(pvfb->mmap_file), "%s/Xvfb_screen%d", pfbdir, (int) (pvfb - vfbScreens)); if (-1 == (pvfb->mmap_fd = open(pvfb->mmap_file, O_CREAT | O_RDWR, 0666))) { perror("open"); ErrorF("open %s failed, %s", pvfb->mmap_file, strerror(errno)); return; } /* Extend the file to be the proper size */ memset(dummyBuffer, 0, DUMMY_BUFFER_SIZE); for (currentFileSize = 0; currentFileSize < pvfb->sizeInBytes; currentFileSize += writeThisTime) { writeThisTime = min(DUMMY_BUFFER_SIZE, pvfb->sizeInBytes - currentFileSize); if (-1 == write(pvfb->mmap_fd, dummyBuffer, writeThisTime)) { perror("write"); ErrorF("write %s failed, %s", pvfb->mmap_file, strerror(errno)); return; } } /* try to mmap the file */ pvfb->pXWDHeader = (XWDFileHeader *) mmap((caddr_t) NULL, pvfb->sizeInBytes, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, pvfb->mmap_fd, 0); if (-1 == (long) pvfb->pXWDHeader) { perror("mmap"); ErrorF("mmap %s failed, %s", pvfb->mmap_file, strerror(errno)); pvfb->pXWDHeader = NULL; return; } if (!RegisterBlockAndWakeupHandlers(vfbBlockHandler, vfbWakeupHandler, NULL)) { pvfb->pXWDHeader = NULL; } } #endif /* HAVE_MMAP */ #ifdef HAS_SHM static void vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb) { /* create the shared memory segment */ pvfb->shmid = shmget(IPC_PRIVATE, pvfb->sizeInBytes, IPC_CREAT | 0777); if (pvfb->shmid < 0) { perror("shmget"); ErrorF("shmget %d bytes failed, %s", pvfb->sizeInBytes, strerror(errno)); return; } /* try to attach it */ pvfb->pXWDHeader = (XWDFileHeader *) shmat(pvfb->shmid, 0, 0); if (-1 == (long) pvfb->pXWDHeader) { perror("shmat"); ErrorF("shmat failed, %s", strerror(errno)); pvfb->pXWDHeader = NULL; return; } ErrorF("screen %d shmid %d\n", (int) (pvfb - vfbScreens), pvfb->shmid); } #endif /* HAS_SHM */ static char * vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) { if (pvfb->pfbMemory) return pvfb->pfbMemory; /* already done */ pvfb->sizeInBytes = pvfb->paddedBytesWidth * pvfb->height; /* Calculate how many entries in colormap. This is rather bogus, because * the visuals haven't even been set up yet, but we need to know because we * have to allocate space in the file for the colormap. The number 10 * below comes from the MAX_PSEUDO_DEPTH define in cfbcmap.c. */ if (pvfb->depth <= 10) { /* single index colormaps */ pvfb->ncolors = 1 << pvfb->depth; } else { /* decomposed colormaps */ int nplanes_per_color_component = pvfb->depth / 3; if (pvfb->depth % 3) nplanes_per_color_component++; pvfb->ncolors = 1 << nplanes_per_color_component; } /* add extra bytes for XWDFileHeader, window name, and colormap */ pvfb->sizeInBytes += SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN + pvfb->ncolors * SIZEOF(XWDColor); pvfb->pXWDHeader = NULL; switch (fbmemtype) { #ifdef HAVE_MMAP case MMAPPED_FILE_FB: vfbAllocateMmappedFramebuffer(pvfb); break; #else case MMAPPED_FILE_FB: break; #endif #ifdef HAS_SHM case SHARED_MEMORY_FB: vfbAllocateSharedMemoryFramebuffer(pvfb); break; #else case SHARED_MEMORY_FB: break; #endif case NORMAL_MEMORY_FB: pvfb->pXWDHeader = (XWDFileHeader *) malloc(pvfb->sizeInBytes); break; } if (pvfb->pXWDHeader) { pvfb->pXWDCmap = (XWDColor *) ((char *) pvfb->pXWDHeader + SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN); pvfb->pfbMemory = (char *) (pvfb->pXWDCmap + pvfb->ncolors); return pvfb->pfbMemory; } else return NULL; } static void vfbWriteXWDFileHeader(ScreenPtr pScreen) { vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; XWDFileHeader *pXWDHeader = pvfb->pXWDHeader; char hostname[XWD_WINDOW_NAME_LEN]; unsigned long swaptest = 1; int i; needswap = *(char *) &swaptest; pXWDHeader->header_size = (char *) pvfb->pXWDCmap - (char *) pvfb->pXWDHeader; pXWDHeader->file_version = XWD_FILE_VERSION; pXWDHeader->pixmap_format = ZPixmap; pXWDHeader->pixmap_depth = pvfb->depth; pXWDHeader->pixmap_height = pXWDHeader->window_height = pvfb->height; pXWDHeader->xoffset = 0; pXWDHeader->byte_order = IMAGE_BYTE_ORDER; pXWDHeader->bitmap_bit_order = BITMAP_BIT_ORDER; #ifndef INTERNAL_VS_EXTERNAL_PADDING pXWDHeader->pixmap_width = pXWDHeader->window_width = pvfb->width; pXWDHeader->bitmap_unit = BITMAP_SCANLINE_UNIT; pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD; #else pXWDHeader->pixmap_width = pXWDHeader->window_width = pvfb->paddedWidth; pXWDHeader->bitmap_unit = BITMAP_SCANLINE_UNIT_PROTO; pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD_PROTO; #endif pXWDHeader->bits_per_pixel = pvfb->bitsPerPixel; pXWDHeader->bytes_per_line = pvfb->paddedBytesWidth; pXWDHeader->ncolors = pvfb->ncolors; /* visual related fields are written when colormap is installed */ pXWDHeader->window_x = pXWDHeader->window_y = 0; pXWDHeader->window_bdrwidth = 0; /* write xwd "window" name: Xvfb hostname:server.screen */ if (-1 == gethostname(hostname, sizeof(hostname))) hostname[0] = 0; else hostname[XWD_WINDOW_NAME_LEN - 1] = 0; sprintf((char *) (pXWDHeader + 1), "Xvfb %s:%s.%d", hostname, display, pScreen->myNum); /* write colormap pixel slot values */ for (i = 0; i < pvfb->ncolors; i++) { pvfb->pXWDCmap[i].pixel = i; } /* byte swap to most significant byte first */ if (needswap) { SwapLongs((CARD32 *) pXWDHeader, SIZEOF(XWDheader) / 4); for (i = 0; i < pvfb->ncolors; i++) { swapl(&pvfb->pXWDCmap[i].pixel); } } } static Bool vfbCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) { return FALSE; } static void vfbCrossScreen(ScreenPtr pScreen, Bool entering) { } static miPointerScreenFuncRec vfbPointerCursorFuncs = { vfbCursorOffScreen, vfbCrossScreen, miPointerWarpCursor }; static Bool vfbCloseScreen(ScreenPtr pScreen) { vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; pScreen->CloseScreen = pvfb->closeScreen; /* * fb overwrites miCloseScreen, so do this here */ if (pScreen->devPrivate) (*pScreen->DestroyPixmap) (pScreen->devPrivate); pScreen->devPrivate = NULL; return pScreen->CloseScreen(pScreen); } static Bool vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) { vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; int dpix = monitorResolution, dpiy = monitorResolution; int ret; char *pbits; if (dpix == 0) dpix = 100; if (dpiy == 0) dpiy = 100; pvfb->paddedBytesWidth = PixmapBytePad(pvfb->width, pvfb->depth); pvfb->bitsPerPixel = vfbBitsPerPixel(pvfb->depth); if (pvfb->bitsPerPixel >= 8) pvfb->paddedWidth = pvfb->paddedBytesWidth / (pvfb->bitsPerPixel / 8); else pvfb->paddedWidth = pvfb->paddedBytesWidth * 8; pbits = vfbAllocateFramebufferMemory(pvfb); if (!pbits) return FALSE; switch (pvfb->depth) { case 8: miSetVisualTypesAndMasks(8, ((1 << StaticGray) | (1 << GrayScale) | (1 << StaticColor) | (1 << PseudoColor) | (1 << TrueColor) | (1 << DirectColor)), 8, PseudoColor, 0, 0, 0); break; case 15: miSetVisualTypesAndMasks(15, ((1 << TrueColor) | (1 << DirectColor)), 8, TrueColor, 0x7c00, 0x03e0, 0x001f); break; case 16: miSetVisualTypesAndMasks(16, ((1 << TrueColor) | (1 << DirectColor)), 8, TrueColor, 0xf800, 0x07e0, 0x001f); break; case 24: miSetVisualTypesAndMasks(24, ((1 << TrueColor) | (1 << DirectColor)), 8, TrueColor, 0xff0000, 0x00ff00, 0x0000ff); break; case 30: miSetVisualTypesAndMasks(30, ((1 << TrueColor) | (1 << DirectColor)), 10, TrueColor, 0x3ff00000, 0x000ffc00, 0x000003ff); break; default: return FALSE; } miSetPixmapDepths(); ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, dpix, dpiy, pvfb->paddedWidth, pvfb->bitsPerPixel); if (ret && Render) fbPictureInit(pScreen, 0, 0); if (!ret) return FALSE; pScreen->InstallColormap = vfbInstallColormap; pScreen->SaveScreen = vfbSaveScreen; pScreen->StoreColors = vfbStoreColors; miDCInitialize(pScreen, &vfbPointerCursorFuncs); vfbWriteXWDFileHeader(pScreen); pScreen->blackPixel = pvfb->blackPixel; pScreen->whitePixel = pvfb->whitePixel; ret = fbCreateDefColormap(pScreen); miSetZeroLineBias(pScreen, pvfb->lineBias); pvfb->closeScreen = pScreen->CloseScreen; pScreen->CloseScreen = vfbCloseScreen; return ret; } /* end vfbScreenInit */ static const ExtensionModule vfbExtensions[] = { #ifdef GLXEXT { GlxExtensionInit, "GLX", &noGlxExtension }, #endif }; static void vfbExtensionInit(void) { LoadExtensionList(vfbExtensions, ARRAY_SIZE(vfbExtensions), TRUE); } void InitOutput(ScreenInfo * screen_info, 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 */ for (i = 0; i < vfbNumScreens; i++) { vfbPixmapDepths[vfbScreens[i].depth] = TRUE; } /* RENDER needs a good set of pixmaps. */ if (Render) { vfbPixmapDepths[1] = TRUE; vfbPixmapDepths[4] = TRUE; vfbPixmapDepths[8] = TRUE; #if 0 vfbPixmapDepths[12] = TRUE; #endif /* vfbPixmapDepths[15] = TRUE; */ vfbPixmapDepths[16] = TRUE; vfbPixmapDepths[24] = TRUE; #if 0 vfbPixmapDepths[30] = TRUE; #endif vfbPixmapDepths[32] = TRUE; } for (i = 1; i <= 32; i++) { if (vfbPixmapDepths[i]) { if (NumFormats >= MAXFORMATS) FatalError("MAXFORMATS is too small for this server\n"); screen_info->formats[NumFormats].depth = i; screen_info->formats[NumFormats].bitsPerPixel = vfbBitsPerPixel(i); screen_info->formats[NumFormats].scanlinePad = BITMAP_SCANLINE_PAD; NumFormats++; } } screen_info->imageByteOrder = IMAGE_BYTE_ORDER; screen_info->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; screen_info->bitmapScanlinePad = BITMAP_SCANLINE_PAD; screen_info->bitmapBitOrder = BITMAP_BIT_ORDER; screen_info->numPixmapFormats = NumFormats; /* initialize screens */ if (vfbNumScreens < 1) { vfbScreens = &defaultScreenInfo; vfbNumScreens = 1; } for (i = 0; i < vfbNumScreens; i++) { if (-1 == AddScreen(vfbScreenInit, argc, argv)) { FatalError("Couldn't add screen %d", i); } } } /* end InitOutput */ xorg-server-1.17.1/hw/vfb/man/0000775000175100017510000000000012466505445013052 500000000000000xorg-server-1.17.1/hw/vfb/man/Makefile.am0000664000175100017510000000007012160102336015002 00000000000000include $(top_srcdir)/manpages.am appman_PRE = Xvfb.man xorg-server-1.17.1/hw/vfb/man/Makefile.in0000664000175100017510000006231212466505431015036 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = hw/vfb/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man appman_PRE = Xvfb.man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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/vfb/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/vfb/man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/vfb/man/Xvfb.man0000664000175100017510000001257612160102336014366 00000000000000.\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.3 2005/03/23 20:49:52 gisburn Exp $ .\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $ .\" Copyright 1993, 1998 The Open Group .\" .\" Permission to use, copy, modify, distribute, and sell this software and its .\" documentation for any purpose is hereby granted without fee, provided that .\" the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting .\" documentation. .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The Open Group shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" .\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.9 2001/12/14 19:59:45 dawes Exp $ .\" .TH XVFB 1 __xorgversion__ .SH NAME Xvfb \- virtual framebuffer X server for X Version 11 .SH SYNOPSIS .B Xvfb [ option ] ... .SH DESCRIPTION .I Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory. .PP The primary use of this server was intended to be server testing. The fb code for any depth can be exercised with this server without the need for real hardware that supports the desired depths. The X community has found many other novel uses for \fIXvfb\fP, including testing clients against unusual depths and screen configurations, doing batch processing with \fIXvfb\fP as a background rendering engine, load testing, as an aid to porting the X server to a new platform, and providing an unobtrusive way to run applications that don't really need an X server but insist on having one anyway. .SH OPTIONS .PP In addition to the normal server options described in the \fIXserver(1)\fP manual page, \fIXvfb\fP accepts the following command line switches: .TP 4 .B "\-screen \fIscreennum\fP \fIWxHxD\fP" This option creates screen \fIscreennum\fP and sets its width, height, and depth to W, H, and D respectively. By default, only screen 0 exists and has the dimensions 1280x1024x8. .TP 4 .B "\-pixdepths \fIlist-of-depths\fP" This option specifies a list of pixmap depths that the server should support in addition to the depths implied by the supported screens. \fIlist-of-depths\fP is a space-separated list of integers that can have values from 1 to 32. .TP 4 .B "\-fbdir \fIframebuffer-directory\fP" This option specifies the directory in which the memory mapped files containing the framebuffer memory should be created. See FILES. This option only exists on machines that have the mmap and msync system calls. .TP 4 .B "\-shmem" This option specifies that the framebuffer should be put in shared memory. The shared memory ID for each screen will be printed by the server. The shared memory is in xwd format. This option only exists on machines that support the System V shared memory interface. .PP If neither \fB\-shmem\fP nor \fB\-fbdir\fP is specified, the framebuffer memory will be allocated with malloc(). .TP 4 .B "\-linebias \fIn\fP" This option specifies how to adjust the pixelization of thin lines. The value \fIn\fP is a bitmask of octants in which to prefer an axial step when the Bresenham error term is exactly zero. See the file Xserver/mi/miline.h for more information. This option is probably only useful to server developers to experiment with the range of line pixelization possible with the fb code. .TP 4 .B "\-blackpixel \fIpixel-value\fP, \-whitepixel \fIpixel-value\fP" These options specify the black and white pixel values the server should use. .SH FILES The following files are created if the \-fbdir option is given. .TP 4 \fIframebuffer-directory\fP/Xvfb_screen Memory mapped file containing screen n's framebuffer memory, one file per screen. The file is in xwd format. Thus, taking a full-screen snapshot can be done with a file copy command, and the resulting snapshot will even contain the cursor image. .SH EXAMPLES .TP 8 Xvfb :1 -screen 0 1600x1200x32 The server will listen for connections as server number 1, and screen 0 will be depth 32 1600x1200. .TP 8 Xvfb :1 -screen 1 1600x1200x16 The server will listen for connections as server number 1, will have the default screen configuration (one screen, 1280x1024x8), and screen 1 will be depth 16 1600x1200. .TP 8 Xvfb -pixdepths 3 27 -fbdir /var/tmp The server will listen for connections as server number 0, will have the default screen configuration (one screen, 1280x1024x8), will also support pixmap depths of 3 and 27, and will use memory mapped files in /var/tmp for the framebuffer. .TP 8 xwud -in /var/tmp/Xvfb_screen0 Displays screen 0 of the server started by the preceding example. .SH "SEE ALSO" .PP X(__miscmansuffix__), Xserver(1), xwd(1), xwud(1), XWDFile.h .SH AUTHORS David P. Wiggins, The Open Group, Inc. xorg-server-1.17.1/hw/vfb/Makefile.in0000664000175100017510000010240712466505431014263 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ bin_PROGRAMS = Xvfb$(EXEEXT) subdir = hw/vfb DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ miinitext.$(OBJEXT) am_Xvfb_OBJECTS = $(am__objects_1) Xvfb_OBJECTS = $(am_Xvfb_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la 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 = Xvfb_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(Xvfb_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 = $(Xvfb_SOURCES) DIST_SOURCES = $(Xvfb_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ XSLTPROC = @XSLTPROC@ XSL_STYLESHEET = @XSL_STYLESHEET@ XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ XVFB_LIBS = \ @XVFB_LIBS@ \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = man AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ $(XVFBMODULES_CFLAGS) \ $(DIX_CFLAGS) SRCS = InitInput.c \ InitOutput.c \ $(top_srcdir)/mi/miinitext.c Xvfb_SOURCES = $(SRCS) Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/vfb/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/vfb/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list Xvfb$(EXEEXT): $(Xvfb_OBJECTS) $(Xvfb_DEPENDENCIES) $(EXTRA_Xvfb_DEPENDENCIES) @rm -f Xvfb$(EXEEXT) $(AM_V_CCLD)$(Xvfb_LINK) $(Xvfb_OBJECTS) $(Xvfb_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InitInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InitOutput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Po@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 -o $@ $< .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 -o $@ `$(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 $@ $< miinitext.o: $(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.o -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.o `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/mi/miinitext.c' object='miinitext.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.o `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c miinitext.obj: $(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.obj -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.obj `if test -f '$(top_srcdir)/mi/miinitext.c'; then $(CYGPATH_W) '$(top_srcdir)/mi/miinitext.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/mi/miinitext.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/mi/miinitext.c' object='miinitext.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.obj `if test -f '$(top_srcdir)/mi/miinitext.c'; then $(CYGPATH_W) '$(top_srcdir)/mi/miinitext.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/mi/miinitext.c'; fi` mostlyclean-libtool: -rm -f *.lo 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; 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-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS relink: $(AM_V_at)rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT) # 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: xorg-server-1.17.1/hw/xfree86/0000775000175100017510000000000012466505445013011 500000000000000xorg-server-1.17.1/hw/xfree86/Makefile.am0000664000175100017510000000761012456571574014776 00000000000000 if DRI DRI_SUBDIR = dri DRI_LIB = dri/libdri.la endif if DRI2 DRI2_SUBDIR = dri2 DRI2_LIB = dri2/libdri2.la endif if DRI3 DRI3_BUILDDIR = $(top_builddir)/dri3 DRI3_LIB = $(DRI3_BUILDDIR)/libdri3.la endif if GLAMOR_EGL GLAMOR_EGL_SUBDIR = glamor_egl endif if XF86UTILS XF86UTILS_SUBDIR = utils endif if VGAHW VGAHW_SUBDIR = vgahw endif if VBE VBE_SUBDIR = vbe endif if INT10MODULE INT10_SUBDIR = int10 endif 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 \ $(GLAMOR_EGL_SUBDIR) drivers DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ parser ramdac shadowfb vbe vgahw \ loader dixmods dri dri2 exa modes \ utils doc man glamor_egl drivers bin_PROGRAMS = Xorg nodist_Xorg_SOURCES = sdksyms.c AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \ -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \ -I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3 LOCAL_LIBS = \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ loader/libloader.la \ common/libcommon.la \ os-support/libxorgos.la \ parser/libxf86config_internal.la \ dixmods/libdixmods.la \ modes/libxf86modes.la \ ramdac/libramdac.la \ ddc/libddc.la \ i2c/libi2c.la \ $(XORG_LIBS) \ dixmods/libxorgxkb.la \ $(DRI_LIB) \ $(DRI2_LIB) \ $(DRI3_LIB) \ $(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la Xorg_LDADD = \ $(LOCAL_LIBS) \ $(XORG_SYS_LIBS) \ $(XSERVER_SYS_LIBS) Xorg_DEPENDENCIES = $(LOCAL_LIBS) Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) if SUID_WRAPPER wrapdir = $(SUID_WRAPPER_DIR) wrap_PROGRAMS = Xorg.wrap Xorg_wrap_SOURCES = xorg-wrapper.c endif BUILT_SOURCES = xorg.conf.example DISTCLEANFILES = xorg.conf.example EXTRA_DIST = xorgconf.cpp # Without logdir, X will post an error on the terminal and will not start install-data-local: $(AM_V_GEN)$(MKDIR_P) $(DESTDIR)$(logdir) if CYGWIN $(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a endif install-exec-hook: (cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg$(EXEEXT) X) if INSTALL_SETUID chown root $(DESTDIR)$(bindir)/Xorg chmod u+s $(DESTDIR)$(bindir)/Xorg endif if SUID_WRAPPER $(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR) mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg -chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap endif uninstall-local: if CYGWIN $(AM_V_at)rm -f $(DESTDIR)$(libdir)/libXorg.exe.a endif uninstall-hook: $(AM_V_at)rm -f $(DESTDIR)$(bindir)/X # Use variables from XORG_MANPAGE_SECTIONS and X Server configuration # Do not include manpages.am as values are not appropriate for rc files CONF_SUBSTS = -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' \ -e 's|MODULEPATH|$(DEFAULT_MODULE_PATH)|g' \ -e 's|DEFAULTFONTPATH|$(COMPILEDDEFAULTFONTPATH)|g' xorg.conf.example: xorgconf.cpp $(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $(srcdir)/xorgconf.cpp > $@ relink: $(AM_V_at)rm -f Xorg$(EXEEXT) && $(MAKE) Xorg$(EXEEXT) CLEANFILES = sdksyms.c sdksyms.dep Xorg.sh EXTRA_DIST += sdksyms.sh sdksyms.dep sdksyms.c: sdksyms.sh $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) 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 xorg-server-1.17.1/hw/xfree86/dri2/0000775000175100017510000000000012466505445013651 500000000000000xorg-server-1.17.1/hw/xfree86/dri2/Makefile.am0000664000175100017510000000043712432306326015617 00000000000000SUBDIRS=pci_ids noinst_LTLIBRARIES = libdri2.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ @DIX_CFLAGS@ @XORG_CFLAGS@ \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/os-support/bus libdri2_la_SOURCES = \ dri2.c \ dri2.h \ dri2ext.c \ dri2int.h sdk_HEADERS = dri2.h xorg-server-1.17.1/hw/xfree86/dri2/dri2int.h0000664000175100017510000000232512274325511015306 00000000000000/* * 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 */ extern Bool DRI2ModuleSetup(void); xorg-server-1.17.1/hw/xfree86/dri2/dri2ext.c0000664000175100017510000004434312456571574015333 00000000000000/* * Copyright © 2008 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Soft- * ware"), to deal in the Software without restriction, including without * limitation the rights to use, copy, modify, merge, publish, distribute, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, provided that the above copyright * notice(s) and this permission notice appear in all copies of the Soft- * ware and that both the above copyright notice(s) and this permission * notice appear in supporting documentation. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- * QUENTIAL 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 PERFOR- * MANCE OF THIS SOFTWARE. * * Except as contained in this notice, the name of a copyright holder shall * not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization of * the copyright holder. * * Authors: * Kristian Høgsberg (krh@redhat.com) */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "dixstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "extnsionst.h" #include "xfixes.h" #include "dri2.h" #include "dri2int.h" #include "protocol-versions.h" /* The only xf86 includes */ #include "xf86Module.h" #include "xf86Extensions.h" static int DRI2EventBase; static Bool validDrawable(ClientPtr client, XID drawable, Mask access_mode, DrawablePtr *pDrawable, int *status) { *status = dixLookupDrawable(pDrawable, drawable, client, M_DRAWABLE_WINDOW | M_DRAWABLE_PIXMAP, access_mode); if (*status != Success) { client->errorValue = drawable; return FALSE; } return TRUE; } static int ProcDRI2QueryVersion(ClientPtr client) { REQUEST(xDRI2QueryVersionReq); 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); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.majorVersion); swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep); return Success; } static int ProcDRI2Connect(ClientPtr client) { REQUEST(xDRI2ConnectReq); xDRI2ConnectReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .driverNameLength = 0, .deviceNameLength = 0 }; DrawablePtr pDraw; int fd, status; const char *driverName; const char *deviceName; REQUEST_SIZE_MATCH(xDRI2ConnectReq); if (!validDrawable(client, stuff->window, DixGetAttrAccess, &pDraw, &status)) return status; if (!DRI2Connect(client, pDraw->pScreen, stuff->driverType, &fd, &driverName, &deviceName)) goto fail; rep.driverNameLength = strlen(driverName); rep.deviceNameLength = strlen(deviceName); rep.length = (rep.driverNameLength + 3) / 4 + (rep.deviceNameLength + 3) / 4; fail: WriteToClient(client, sizeof(xDRI2ConnectReply), &rep); WriteToClient(client, rep.driverNameLength, driverName); WriteToClient(client, rep.deviceNameLength, deviceName); return Success; } static int ProcDRI2Authenticate(ClientPtr client) { REQUEST(xDRI2AuthenticateReq); xDRI2AuthenticateReply rep; DrawablePtr pDraw; int status; REQUEST_SIZE_MATCH(xDRI2AuthenticateReq); if (!validDrawable(client, stuff->window, DixGetAttrAccess, &pDraw, &status)) return status; rep = (xDRI2AuthenticateReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .authenticated = DRI2Authenticate(client, pDraw->pScreen, stuff->magic) }; WriteToClient(client, sizeof(xDRI2AuthenticateReply), &rep); return Success; } static void DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv, XID id) { ClientPtr client = priv; xDRI2InvalidateBuffers event = { .type = DRI2EventBase + DRI2_InvalidateBuffers, .drawable = id }; WriteEventsToClient(client, 1, (xEvent *) &event); } static int ProcDRI2CreateDrawable(ClientPtr client) { REQUEST(xDRI2CreateDrawableReq); DrawablePtr pDrawable; int status; REQUEST_SIZE_MATCH(xDRI2CreateDrawableReq); if (!validDrawable(client, stuff->drawable, DixAddAccess, &pDrawable, &status)) return status; status = DRI2CreateDrawable(client, pDrawable, stuff->drawable, DRI2InvalidateBuffersEvent, client); if (status != Success) return status; return Success; } static int ProcDRI2DestroyDrawable(ClientPtr client) { REQUEST(xDRI2DestroyDrawableReq); DrawablePtr pDrawable; int status; REQUEST_SIZE_MATCH(xDRI2DestroyDrawableReq); if (!validDrawable(client, stuff->drawable, DixRemoveAccess, &pDrawable, &status)) return status; return Success; } static int send_buffers_reply(ClientPtr client, DrawablePtr pDrawable, DRI2BufferPtr * buffers, int count, int width, int height) { xDRI2GetBuffersReply rep; int skip = 0; int i; if (buffers == NULL) return BadAlloc; if (pDrawable->type == DRAWABLE_WINDOW) { for (i = 0; i < count; i++) { /* Do not send the real front buffer of a window to the client. */ if (buffers[i]->attachment == DRI2BufferFrontLeft) { skip++; continue; } } } 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++) { xDRI2Buffer buffer; /* Do not send the real front buffer of a window to the client. */ if ((pDrawable->type == DRAWABLE_WINDOW) && (buffers[i]->attachment == DRI2BufferFrontLeft)) { continue; } buffer.attachment = buffers[i]->attachment; buffer.name = buffers[i]->name; buffer.pitch = buffers[i]->pitch; buffer.cpp = buffers[i]->cpp; buffer.flags = buffers[i]->flags; WriteToClient(client, sizeof(xDRI2Buffer), &buffer); } return Success; } static int ProcDRI2GetBuffers(ClientPtr client) { REQUEST(xDRI2GetBuffersReq); DrawablePtr pDrawable; DRI2BufferPtr *buffers; int status, width, height, count; unsigned int *attachments; REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4); if (stuff->count > (INT_MAX / 4)) return BadLength; if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; if (DRI2ThrottleClient(client, pDrawable)) return Success; attachments = (unsigned int *) &stuff[1]; buffers = DRI2GetBuffers(pDrawable, &width, &height, attachments, stuff->count, &count); return send_buffers_reply(client, pDrawable, buffers, count, width, height); } static int ProcDRI2GetBuffersWithFormat(ClientPtr client) { REQUEST(xDRI2GetBuffersReq); DrawablePtr pDrawable; DRI2BufferPtr *buffers; int status, width, height, count; unsigned int *attachments; REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * (2 * 4)); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; if (DRI2ThrottleClient(client, pDrawable)) return Success; attachments = (unsigned int *) &stuff[1]; buffers = DRI2GetBuffersWithFormat(pDrawable, &width, &height, attachments, stuff->count, &count); return send_buffers_reply(client, pDrawable, buffers, count, width, height); } static int ProcDRI2CopyRegion(ClientPtr client) { REQUEST(xDRI2CopyRegionReq); xDRI2CopyRegionReply rep; DrawablePtr pDrawable; int status; RegionPtr pRegion; REQUEST_SIZE_MATCH(xDRI2CopyRegionReq); if (!validDrawable(client, stuff->drawable, DixWriteAccess, &pDrawable, &status)) return status; VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess); status = DRI2CopyRegion(pDrawable, pRegion, stuff->dest, stuff->src); if (status != Success) return status; /* CopyRegion needs to be a round trip to make sure the X server * queues the swap buffer rendering commands before the DRI client * continues rendering. The reply has a bitmask to signal the * presense of optional return values as well, but we're not using * that yet. */ rep = (xDRI2CopyRegionReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; WriteToClient(client, sizeof(xDRI2CopyRegionReply), &rep); return Success; } static void load_swap_reply(xDRI2SwapBuffersReply * rep, CARD64 sbc) { rep->swap_hi = sbc >> 32; rep->swap_lo = sbc & 0xffffffff; } static CARD64 vals_to_card64(CARD32 lo, CARD32 hi) { return (CARD64) hi << 32 | lo; } static void DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, CARD32 sbc) { DrawablePtr pDrawable = data; 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); } static int ProcDRI2SwapBuffers(ClientPtr client) { REQUEST(xDRI2SwapBuffersReq); xDRI2SwapBuffersReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; DrawablePtr pDrawable; CARD64 target_msc, divisor, remainder, swap_target; int status; REQUEST_SIZE_MATCH(xDRI2SwapBuffersReq); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; /* * Ensures an out of control client can't exhaust our swap queue, and * also orders swaps. */ if (DRI2ThrottleClient(client, pDrawable)) return Success; target_msc = vals_to_card64(stuff->target_msc_lo, stuff->target_msc_hi); divisor = vals_to_card64(stuff->divisor_lo, stuff->divisor_hi); remainder = vals_to_card64(stuff->remainder_lo, stuff->remainder_hi); status = DRI2SwapBuffers(client, pDrawable, target_msc, divisor, remainder, &swap_target, DRI2SwapEvent, pDrawable); if (status != Success) return BadDrawable; load_swap_reply(&rep, swap_target); WriteToClient(client, sizeof(xDRI2SwapBuffersReply), &rep); return Success; } static void load_msc_reply(xDRI2MSCReply * rep, CARD64 ust, CARD64 msc, CARD64 sbc) { rep->ust_hi = ust >> 32; rep->ust_lo = ust & 0xffffffff; rep->msc_hi = msc >> 32; rep->msc_lo = msc & 0xffffffff; rep->sbc_hi = sbc >> 32; rep->sbc_lo = sbc & 0xffffffff; } static int ProcDRI2GetMSC(ClientPtr client) { REQUEST(xDRI2GetMSCReq); xDRI2MSCReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; DrawablePtr pDrawable; CARD64 ust, msc, sbc; int status; REQUEST_SIZE_MATCH(xDRI2GetMSCReq); if (!validDrawable(client, stuff->drawable, DixReadAccess, &pDrawable, &status)) return status; status = DRI2GetMSC(pDrawable, &ust, &msc, &sbc); if (status != Success) return status; load_msc_reply(&rep, ust, msc, sbc); WriteToClient(client, sizeof(xDRI2MSCReply), &rep); return Success; } static int ProcDRI2WaitMSC(ClientPtr client) { REQUEST(xDRI2WaitMSCReq); DrawablePtr pDrawable; CARD64 target, divisor, remainder; int status; /* FIXME: in restart case, client may be gone at this point */ REQUEST_SIZE_MATCH(xDRI2WaitMSCReq); if (!validDrawable(client, stuff->drawable, DixReadAccess, &pDrawable, &status)) return status; target = vals_to_card64(stuff->target_msc_lo, stuff->target_msc_hi); divisor = vals_to_card64(stuff->divisor_lo, stuff->divisor_hi); remainder = vals_to_card64(stuff->remainder_lo, stuff->remainder_hi); status = DRI2WaitMSC(client, pDrawable, target, divisor, remainder); if (status != Success) return status; return Success; } int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust, CARD64 msc, CARD64 sbc) { xDRI2MSCReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; load_msc_reply(&rep, ust, msc, sbc); WriteToClient(client, sizeof(xDRI2MSCReply), &rep); return Success; } static int ProcDRI2SwapInterval(ClientPtr client) { REQUEST(xDRI2SwapIntervalReq); DrawablePtr pDrawable; int status; /* FIXME: in restart case, client may be gone at this point */ REQUEST_SIZE_MATCH(xDRI2SwapIntervalReq); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; DRI2SwapInterval(pDrawable, stuff->interval); return Success; } static int ProcDRI2WaitSBC(ClientPtr client) { REQUEST(xDRI2WaitSBCReq); DrawablePtr pDrawable; CARD64 target; int status; REQUEST_SIZE_MATCH(xDRI2WaitSBCReq); if (!validDrawable(client, stuff->drawable, DixReadAccess, &pDrawable, &status)) return status; target = vals_to_card64(stuff->target_sbc_lo, stuff->target_sbc_hi); status = DRI2WaitSBC(client, pDrawable, target); 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) { REQUEST(xReq); switch (stuff->data) { case X_DRI2QueryVersion: return ProcDRI2QueryVersion(client); } if (!client->local) return BadRequest; switch (stuff->data) { case X_DRI2Connect: return ProcDRI2Connect(client); case X_DRI2Authenticate: return ProcDRI2Authenticate(client); case X_DRI2CreateDrawable: return ProcDRI2CreateDrawable(client); case X_DRI2DestroyDrawable: return ProcDRI2DestroyDrawable(client); case X_DRI2GetBuffers: return ProcDRI2GetBuffers(client); case X_DRI2CopyRegion: return ProcDRI2CopyRegion(client); case X_DRI2GetBuffersWithFormat: return ProcDRI2GetBuffersWithFormat(client); case X_DRI2SwapBuffers: return ProcDRI2SwapBuffers(client); case X_DRI2GetMSC: return ProcDRI2GetMSC(client); case X_DRI2WaitMSC: return ProcDRI2WaitMSC(client); case X_DRI2WaitSBC: return ProcDRI2WaitSBC(client); case X_DRI2SwapInterval: return ProcDRI2SwapInterval(client); case X_DRI2GetParam: return ProcDRI2GetParam(client); default: return BadRequest; } } static int SProcDRI2Connect(ClientPtr client) { REQUEST(xDRI2ConnectReq); 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. */ swaps(&stuff->length); if (sizeof(*stuff) / 4 != client->req_len) return BadLength; swaps(&rep.sequenceNumber); WriteToClient(client, sizeof(xDRI2ConnectReply), &rep); return Success; } static int SProcDRI2Dispatch(ClientPtr client) { REQUEST(xReq); /* * Only local clients are allowed DRI access, but remote clients * still need these requests to find out cleanly. */ switch (stuff->data) { case X_DRI2QueryVersion: return ProcDRI2QueryVersion(client); case X_DRI2Connect: return SProcDRI2Connect(client); default: return BadRequest; } } void DRI2ExtensionInit(void) { ExtensionEntry *dri2Extension; #ifdef PANORAMIX if (!noPanoramiXExtension) return; #endif dri2Extension = AddExtension(DRI2_NAME, DRI2NumberEvents, DRI2NumberErrors, ProcDRI2Dispatch, SProcDRI2Dispatch, NULL, StandardMinorOpcode); DRI2EventBase = dri2Extension->eventBase; DRI2ModuleSetup(); } xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/0000775000175100017510000000000012466505445015263 500000000000000xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/Makefile.am0000664000175100017510000000031612432306326017225 00000000000000EXTRA_DIST = \ pci_id_driver_map.h \ i810_pci_ids.h \ i915_pci_ids.h \ i965_pci_ids.h \ r200_pci_ids.h \ r300_pci_ids.h \ r600_pci_ids.h \ radeon_pci_ids.h \ radeonsi_pci_ids.h \ vmwgfx_pci_ids.h xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/i915_pci_ids.h0000664000175100017510000000122412432306326017522 00000000000000CHIPSET(0x3577, I830_M, "Intel(R) 830M") CHIPSET(0x2562, 845_G, "Intel(R) 845G") CHIPSET(0x3582, I855_GM, "Intel(R) 852GM/855GM") CHIPSET(0x2572, I865_G, "Intel(R) 865G") CHIPSET(0x2582, I915_G, "Intel(R) 915G") CHIPSET(0x258A, E7221_G, "Intel(R) E7221G (i915)") CHIPSET(0x2592, I915_GM, "Intel(R) 915GM") CHIPSET(0x2772, I945_G, "Intel(R) 945G") CHIPSET(0x27A2, I945_GM, "Intel(R) 945GM") CHIPSET(0x27AE, I945_GME, "Intel(R) 945GME") CHIPSET(0x29B2, Q35_G, "Intel(R) Q35") CHIPSET(0x29C2, G33_G, "Intel(R) G33") CHIPSET(0x29D2, Q33_G, "Intel(R) Q33") CHIPSET(0xA011, IGD_GM, "Intel(R) IGD") CHIPSET(0xA001, IGD_G, "Intel(R) IGD") xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h0000664000175100017510000000004012432306326020344 00000000000000CHIPSET(0x0405, SVGAII, SVGAII) xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/r300_pci_ids.h0000664000175100017510000001543512432306326017530 00000000000000CHIPSET(0x4144, R300_AD, R300) CHIPSET(0x4145, R300_AE, R300) CHIPSET(0x4146, R300_AF, R300) CHIPSET(0x4147, R300_AG, R300) CHIPSET(0x4E44, R300_ND, R300) CHIPSET(0x4E45, R300_NE, R300) CHIPSET(0x4E46, R300_NF, R300) CHIPSET(0x4E47, R300_NG, R300) CHIPSET(0x4E48, R350_NH, R350) CHIPSET(0x4E49, R350_NI, R350) CHIPSET(0x4E4B, R350_NK, R350) CHIPSET(0x4148, R350_AH, R350) CHIPSET(0x4149, R350_AI, R350) CHIPSET(0x414A, R350_AJ, R350) CHIPSET(0x414B, R350_AK, R350) CHIPSET(0x4E4A, R360_NJ, R350) CHIPSET(0x4150, RV350_AP, RV350) CHIPSET(0x4151, RV350_AQ, RV350) CHIPSET(0x4152, RV350_AR, RV350) CHIPSET(0x4153, RV350_AS, RV350) CHIPSET(0x4154, RV350_AT, RV350) CHIPSET(0x4155, RV350_AU, RV350) CHIPSET(0x4156, RV350_AV, RV350) CHIPSET(0x4E50, RV350_NP, RV350) CHIPSET(0x4E51, RV350_NQ, RV350) CHIPSET(0x4E52, RV350_NR, RV350) CHIPSET(0x4E53, RV350_NS, RV350) CHIPSET(0x4E54, RV350_NT, RV350) CHIPSET(0x4E56, RV350_NV, RV350) CHIPSET(0x5460, RV370_5460, RV370) CHIPSET(0x5462, RV370_5462, RV370) CHIPSET(0x5464, RV370_5464, RV370) CHIPSET(0x5B60, RV370_5B60, RV370) CHIPSET(0x5B62, RV370_5B62, RV370) CHIPSET(0x5B63, RV370_5B63, RV370) CHIPSET(0x5B64, RV370_5B64, RV370) CHIPSET(0x5B65, RV370_5B65, RV370) CHIPSET(0x3150, RV380_3150, RV380) CHIPSET(0x3151, RV380_3151, RV380) CHIPSET(0x3152, RV380_3152, RV380) CHIPSET(0x3154, RV380_3154, RV380) CHIPSET(0x3155, RV380_3155, RV380) CHIPSET(0x3E50, RV380_3E50, RV380) CHIPSET(0x3E54, RV380_3E54, RV380) CHIPSET(0x4A48, R420_JH, R420) CHIPSET(0x4A49, R420_JI, R420) CHIPSET(0x4A4A, R420_JJ, R420) CHIPSET(0x4A4B, R420_JK, R420) CHIPSET(0x4A4C, R420_JL, R420) CHIPSET(0x4A4D, R420_JM, R420) CHIPSET(0x4A4E, R420_JN, R420) CHIPSET(0x4A4F, R420_JO, R420) CHIPSET(0x4A50, R420_JP, R420) CHIPSET(0x4A54, R420_JT, R420) CHIPSET(0x5548, R423_UH, R423) CHIPSET(0x5549, R423_UI, R423) CHIPSET(0x554A, R423_UJ, R423) CHIPSET(0x554B, R423_UK, R423) CHIPSET(0x5550, R423_5550, R423) CHIPSET(0x5551, R423_UQ, R423) CHIPSET(0x5552, R423_UR, R423) CHIPSET(0x5554, R423_UT, R423) CHIPSET(0x5D57, R423_5D57, R423) CHIPSET(0x554C, R430_554C, R430) CHIPSET(0x554D, R430_554D, R430) CHIPSET(0x554E, R430_554E, R430) CHIPSET(0x554F, R430_554F, R430) CHIPSET(0x5D48, R430_5D48, R430) CHIPSET(0x5D49, R430_5D49, R430) CHIPSET(0x5D4A, R430_5D4A, R430) CHIPSET(0x5D4C, R480_5D4C, R480) CHIPSET(0x5D4D, R480_5D4D, R480) CHIPSET(0x5D4E, R480_5D4E, R480) CHIPSET(0x5D4F, R480_5D4F, R480) CHIPSET(0x5D50, R480_5D50, R480) CHIPSET(0x5D52, R480_5D52, R480) CHIPSET(0x4B48, R481_4B48, R481) CHIPSET(0x4B49, R481_4B49, R481) CHIPSET(0x4B4A, R481_4B4A, R481) CHIPSET(0x4B4B, R481_4B4B, R481) CHIPSET(0x4B4C, R481_4B4C, R481) CHIPSET(0x564A, RV410_564A, RV410) CHIPSET(0x564B, RV410_564B, RV410) CHIPSET(0x564F, RV410_564F, RV410) CHIPSET(0x5652, RV410_5652, RV410) CHIPSET(0x5653, RV410_5653, RV410) CHIPSET(0x5657, RV410_5657, RV410) CHIPSET(0x5E48, RV410_5E48, RV410) CHIPSET(0x5E4A, RV410_5E4A, RV410) CHIPSET(0x5E4B, RV410_5E4B, RV410) CHIPSET(0x5E4C, RV410_5E4C, RV410) CHIPSET(0x5E4D, RV410_5E4D, RV410) CHIPSET(0x5E4F, RV410_5E4F, RV410) CHIPSET(0x5A41, RS400_5A41, RS400) CHIPSET(0x5A42, RS400_5A42, RS400) CHIPSET(0x5A61, RC410_5A61, RC410) CHIPSET(0x5A62, RC410_5A62, RC410) CHIPSET(0x5954, RS480_5954, RS480) CHIPSET(0x5955, RS480_5955, RS480) CHIPSET(0x5974, RS482_5974, RS480) CHIPSET(0x5975, RS482_5975, RS480) CHIPSET(0x7100, R520_7100, R520) CHIPSET(0x7101, R520_7101, R520) CHIPSET(0x7102, R520_7102, R520) CHIPSET(0x7103, R520_7103, R520) CHIPSET(0x7104, R520_7104, R520) CHIPSET(0x7105, R520_7105, R520) CHIPSET(0x7106, R520_7106, R520) CHIPSET(0x7108, R520_7108, R520) CHIPSET(0x7109, R520_7109, R520) CHIPSET(0x710A, R520_710A, R520) CHIPSET(0x710B, R520_710B, R520) CHIPSET(0x710C, R520_710C, R520) CHIPSET(0x710E, R520_710E, R520) CHIPSET(0x710F, R520_710F, R520) CHIPSET(0x7140, RV515_7140, RV515) CHIPSET(0x7141, RV515_7141, RV515) CHIPSET(0x7142, RV515_7142, RV515) CHIPSET(0x7143, RV515_7143, RV515) CHIPSET(0x7144, RV515_7144, RV515) CHIPSET(0x7145, RV515_7145, RV515) CHIPSET(0x7146, RV515_7146, RV515) CHIPSET(0x7147, RV515_7147, RV515) CHIPSET(0x7149, RV515_7149, RV515) CHIPSET(0x714A, RV515_714A, RV515) CHIPSET(0x714B, RV515_714B, RV515) CHIPSET(0x714C, RV515_714C, RV515) CHIPSET(0x714D, RV515_714D, RV515) CHIPSET(0x714E, RV515_714E, RV515) CHIPSET(0x714F, RV515_714F, RV515) CHIPSET(0x7151, RV515_7151, RV515) CHIPSET(0x7152, RV515_7152, RV515) CHIPSET(0x7153, RV515_7153, RV515) CHIPSET(0x715E, RV515_715E, RV515) CHIPSET(0x715F, RV515_715F, RV515) CHIPSET(0x7180, RV515_7180, RV515) CHIPSET(0x7181, RV515_7181, RV515) CHIPSET(0x7183, RV515_7183, RV515) CHIPSET(0x7186, RV515_7186, RV515) CHIPSET(0x7187, RV515_7187, RV515) CHIPSET(0x7188, RV515_7188, RV515) CHIPSET(0x718A, RV515_718A, RV515) CHIPSET(0x718B, RV515_718B, RV515) CHIPSET(0x718C, RV515_718C, RV515) CHIPSET(0x718D, RV515_718D, RV515) CHIPSET(0x718F, RV515_718F, RV515) CHIPSET(0x7193, RV515_7193, RV515) CHIPSET(0x7196, RV515_7196, RV515) CHIPSET(0x719B, RV515_719B, RV515) CHIPSET(0x719F, RV515_719F, RV515) CHIPSET(0x7200, RV515_7200, RV515) CHIPSET(0x7210, RV515_7210, RV515) CHIPSET(0x7211, RV515_7211, RV515) CHIPSET(0x71C0, RV530_71C0, RV530) CHIPSET(0x71C1, RV530_71C1, RV530) CHIPSET(0x71C2, RV530_71C2, RV530) CHIPSET(0x71C3, RV530_71C3, RV530) CHIPSET(0x71C4, RV530_71C4, RV530) CHIPSET(0x71C5, RV530_71C5, RV530) CHIPSET(0x71C6, RV530_71C6, RV530) CHIPSET(0x71C7, RV530_71C7, RV530) CHIPSET(0x71CD, RV530_71CD, RV530) CHIPSET(0x71CE, RV530_71CE, RV530) CHIPSET(0x71D2, RV530_71D2, RV530) CHIPSET(0x71D4, RV530_71D4, RV530) CHIPSET(0x71D5, RV530_71D5, RV530) CHIPSET(0x71D6, RV530_71D6, RV530) CHIPSET(0x71DA, RV530_71DA, RV530) CHIPSET(0x71DE, RV530_71DE, RV530) CHIPSET(0x7281, RV560_7281, RV560) CHIPSET(0x7283, RV560_7283, RV560) CHIPSET(0x7287, RV560_7287, RV560) CHIPSET(0x7290, RV560_7290, RV560) CHIPSET(0x7291, RV560_7291, RV560) CHIPSET(0x7293, RV560_7293, RV560) CHIPSET(0x7297, RV560_7297, RV560) CHIPSET(0x7280, RV570_7280, RV570) CHIPSET(0x7288, RV570_7288, RV570) CHIPSET(0x7289, RV570_7289, RV570) CHIPSET(0x728B, RV570_728B, RV570) CHIPSET(0x728C, RV570_728C, RV570) CHIPSET(0x7240, R580_7240, R580) CHIPSET(0x7243, R580_7243, R580) CHIPSET(0x7244, R580_7244, R580) CHIPSET(0x7245, R580_7245, R580) CHIPSET(0x7246, R580_7246, R580) CHIPSET(0x7247, R580_7247, R580) CHIPSET(0x7248, R580_7248, R580) CHIPSET(0x7249, R580_7249, R580) CHIPSET(0x724A, R580_724A, R580) CHIPSET(0x724B, R580_724B, R580) CHIPSET(0x724C, R580_724C, R580) CHIPSET(0x724D, R580_724D, R580) CHIPSET(0x724E, R580_724E, R580) CHIPSET(0x724F, R580_724F, R580) CHIPSET(0x7284, R580_7284, R580) CHIPSET(0x793F, RS600_793F, RS600) CHIPSET(0x7941, RS600_7941, RS600) CHIPSET(0x7942, RS600_7942, RS600) CHIPSET(0x791E, RS690_791E, RS690) CHIPSET(0x791F, RS690_791F, RS690) CHIPSET(0x796C, RS740_796C, RS740) CHIPSET(0x796D, RS740_796D, RS740) CHIPSET(0x796E, RS740_796E, RS740) CHIPSET(0x796F, RS740_796F, RS740) xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/r600_pci_ids.h0000664000175100017510000002506412432306326017532 00000000000000CHIPSET(0x9400, R600_9400, R600) CHIPSET(0x9401, R600_9401, R600) CHIPSET(0x9402, R600_9402, R600) CHIPSET(0x9403, R600_9403, R600) CHIPSET(0x9405, R600_9405, R600) CHIPSET(0x940A, R600_940A, R600) CHIPSET(0x940B, R600_940B, R600) CHIPSET(0x940F, R600_940F, R600) CHIPSET(0x94C0, RV610_94C0, RV610) CHIPSET(0x94C1, RV610_94C1, RV610) CHIPSET(0x94C3, RV610_94C3, RV610) CHIPSET(0x94C4, RV610_94C4, RV610) CHIPSET(0x94C5, RV610_94C5, RV610) CHIPSET(0x94C6, RV610_94C6, RV610) CHIPSET(0x94C7, RV610_94C7, RV610) CHIPSET(0x94C8, RV610_94C8, RV610) CHIPSET(0x94C9, RV610_94C9, RV610) CHIPSET(0x94CB, RV610_94CB, RV610) CHIPSET(0x94CC, RV610_94CC, RV610) CHIPSET(0x94CD, RV610_94CD, RV610) CHIPSET(0x9580, RV630_9580, RV630) CHIPSET(0x9581, RV630_9581, RV630) CHIPSET(0x9583, RV630_9583, RV630) CHIPSET(0x9586, RV630_9586, RV630) CHIPSET(0x9587, RV630_9587, RV630) CHIPSET(0x9588, RV630_9588, RV630) CHIPSET(0x9589, RV630_9589, RV630) CHIPSET(0x958A, RV630_958A, RV630) CHIPSET(0x958B, RV630_958B, RV630) CHIPSET(0x958C, RV630_958C, RV630) CHIPSET(0x958D, RV630_958D, RV630) CHIPSET(0x958E, RV630_958E, RV630) CHIPSET(0x958F, RV630_958F, RV630) CHIPSET(0x9500, RV670_9500, RV670) CHIPSET(0x9501, RV670_9501, RV670) CHIPSET(0x9504, RV670_9504, RV670) CHIPSET(0x9505, RV670_9505, RV670) CHIPSET(0x9506, RV670_9506, RV670) CHIPSET(0x9507, RV670_9507, RV670) CHIPSET(0x9508, RV670_9508, RV670) CHIPSET(0x9509, RV670_9509, RV670) CHIPSET(0x950F, RV670_950F, RV670) CHIPSET(0x9511, RV670_9511, RV670) CHIPSET(0x9515, RV670_9515, RV670) CHIPSET(0x9517, RV670_9517, RV670) CHIPSET(0x9519, RV670_9519, RV670) CHIPSET(0x95C0, RV620_95C0, RV620) CHIPSET(0x95C2, RV620_95C2, RV620) CHIPSET(0x95C4, RV620_95C4, RV620) CHIPSET(0x95C5, RV620_95C5, RV620) CHIPSET(0x95C6, RV620_95C6, RV620) CHIPSET(0x95C7, RV620_95C7, RV620) CHIPSET(0x95C9, RV620_95C9, RV620) CHIPSET(0x95CC, RV620_95CC, RV620) CHIPSET(0x95CD, RV620_95CD, RV620) CHIPSET(0x95CE, RV620_95CE, RV620) CHIPSET(0x95CF, RV620_95CF, RV620) CHIPSET(0x9590, RV635_9590, RV635) CHIPSET(0x9591, RV635_9591, RV635) CHIPSET(0x9593, RV635_9593, RV635) CHIPSET(0x9595, RV635_9595, RV635) CHIPSET(0x9596, RV635_9596, RV635) CHIPSET(0x9597, RV635_9597, RV635) CHIPSET(0x9598, RV635_9598, RV635) CHIPSET(0x9599, RV635_9599, RV635) CHIPSET(0x959B, RV635_959B, RV635) CHIPSET(0x9610, RS780_9610, RS780) CHIPSET(0x9611, RS780_9611, RS780) CHIPSET(0x9612, RS780_9612, RS780) CHIPSET(0x9613, RS780_9613, RS780) CHIPSET(0x9614, RS780_9614, RS780) CHIPSET(0x9615, RS780_9615, RS780) CHIPSET(0x9616, RS780_9616, RS780) CHIPSET(0x9710, RS880_9710, RS880) CHIPSET(0x9711, RS880_9711, RS880) CHIPSET(0x9712, RS880_9712, RS880) CHIPSET(0x9713, RS880_9713, RS880) CHIPSET(0x9714, RS880_9714, RS880) CHIPSET(0x9715, RS880_9715, RS880) CHIPSET(0x9440, RV770_9440, RV770) CHIPSET(0x9441, RV770_9441, RV770) CHIPSET(0x9442, RV770_9442, RV770) CHIPSET(0x9443, RV770_9443, RV770) CHIPSET(0x9444, RV770_9444, RV770) CHIPSET(0x9446, RV770_9446, RV770) CHIPSET(0x944A, RV770_944A, RV770) CHIPSET(0x944B, RV770_944B, RV770) CHIPSET(0x944C, RV770_944C, RV770) CHIPSET(0x944E, RV770_944E, RV770) CHIPSET(0x9450, RV770_9450, RV770) CHIPSET(0x9452, RV770_9452, RV770) CHIPSET(0x9456, RV770_9456, RV770) CHIPSET(0x945A, RV770_945A, RV770) CHIPSET(0x945B, RV770_945B, RV770) CHIPSET(0x945E, RV770_945E, RV770) CHIPSET(0x9460, RV790_9460, RV770) CHIPSET(0x9462, RV790_9462, RV770) CHIPSET(0x946A, RV770_946A, RV770) CHIPSET(0x946B, RV770_946B, RV770) CHIPSET(0x947A, RV770_947A, RV770) CHIPSET(0x947B, RV770_947B, RV770) CHIPSET(0x9480, RV730_9480, RV730) CHIPSET(0x9487, RV730_9487, RV730) CHIPSET(0x9488, RV730_9488, RV730) CHIPSET(0x9489, RV730_9489, RV730) CHIPSET(0x948A, RV730_948A, RV730) CHIPSET(0x948F, RV730_948F, RV730) CHIPSET(0x9490, RV730_9490, RV730) CHIPSET(0x9491, RV730_9491, RV730) CHIPSET(0x9495, RV730_9495, RV730) CHIPSET(0x9498, RV730_9498, RV730) CHIPSET(0x949C, RV730_949C, RV730) CHIPSET(0x949E, RV730_949E, RV730) CHIPSET(0x949F, RV730_949F, RV730) CHIPSET(0x9540, RV710_9540, RV710) CHIPSET(0x9541, RV710_9541, RV710) CHIPSET(0x9542, RV710_9542, RV710) CHIPSET(0x954E, RV710_954E, RV710) CHIPSET(0x954F, RV710_954F, RV710) CHIPSET(0x9552, RV710_9552, RV710) CHIPSET(0x9553, RV710_9553, RV710) CHIPSET(0x9555, RV710_9555, RV710) CHIPSET(0x9557, RV710_9557, RV710) CHIPSET(0x955F, RV710_955F, RV710) CHIPSET(0x94A0, RV740_94A0, RV740) CHIPSET(0x94A1, RV740_94A1, RV740) CHIPSET(0x94A3, RV740_94A3, RV740) CHIPSET(0x94B1, RV740_94B1, RV740) CHIPSET(0x94B3, RV740_94B3, RV740) CHIPSET(0x94B4, RV740_94B4, RV740) CHIPSET(0x94B5, RV740_94B5, RV740) CHIPSET(0x94B9, RV740_94B9, RV740) CHIPSET(0x68E0, CEDAR_68E0, CEDAR) CHIPSET(0x68E1, CEDAR_68E1, CEDAR) CHIPSET(0x68E4, CEDAR_68E4, CEDAR) CHIPSET(0x68E5, CEDAR_68E5, CEDAR) CHIPSET(0x68E8, CEDAR_68E8, CEDAR) CHIPSET(0x68E9, CEDAR_68E9, CEDAR) CHIPSET(0x68F1, CEDAR_68F1, CEDAR) CHIPSET(0x68F2, CEDAR_68F2, CEDAR) CHIPSET(0x68F8, CEDAR_68F8, CEDAR) CHIPSET(0x68F9, CEDAR_68F9, CEDAR) CHIPSET(0x68FA, CEDAR_68FA, CEDAR) CHIPSET(0x68FE, CEDAR_68FE, CEDAR) CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD) CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD) CHIPSET(0x68C7, REDWOOD_68C7, REDWOOD) CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD) CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD) CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD) CHIPSET(0x68D9, REDWOOD_68D9, REDWOOD) CHIPSET(0x68DA, REDWOOD_68DA, REDWOOD) CHIPSET(0x68DE, REDWOOD_68DE, REDWOOD) CHIPSET(0x68A0, JUNIPER_68A0, JUNIPER) CHIPSET(0x68A1, JUNIPER_68A1, JUNIPER) CHIPSET(0x68A8, JUNIPER_68A8, JUNIPER) CHIPSET(0x68A9, JUNIPER_68A9, JUNIPER) CHIPSET(0x68B0, JUNIPER_68B0, JUNIPER) CHIPSET(0x68B8, JUNIPER_68B8, JUNIPER) CHIPSET(0x68B9, JUNIPER_68B9, JUNIPER) CHIPSET(0x68BA, JUNIPER_68BA, JUNIPER) CHIPSET(0x68BE, JUNIPER_68BE, JUNIPER) CHIPSET(0x68BF, JUNIPER_68BF, JUNIPER) CHIPSET(0x6880, CYPRESS_6880, CYPRESS) CHIPSET(0x6888, CYPRESS_6888, CYPRESS) CHIPSET(0x6889, CYPRESS_6889, CYPRESS) CHIPSET(0x688A, CYPRESS_688A, CYPRESS) CHIPSET(0x688C, CYPRESS_688C, CYPRESS) CHIPSET(0x688D, CYPRESS_688D, CYPRESS) CHIPSET(0x6898, CYPRESS_6898, CYPRESS) CHIPSET(0x6899, CYPRESS_6899, CYPRESS) CHIPSET(0x689B, CYPRESS_689B, CYPRESS) CHIPSET(0x689E, CYPRESS_689E, CYPRESS) CHIPSET(0x689C, HEMLOCK_689C, HEMLOCK) CHIPSET(0x689D, HEMLOCK_689D, HEMLOCK) CHIPSET(0x9802, PALM_9802, PALM) CHIPSET(0x9803, PALM_9803, PALM) CHIPSET(0x9804, PALM_9804, PALM) CHIPSET(0x9805, PALM_9805, PALM) CHIPSET(0x9806, PALM_9806, PALM) CHIPSET(0x9807, PALM_9807, PALM) CHIPSET(0x9808, PALM_9808, PALM) CHIPSET(0x9809, PALM_9809, PALM) CHIPSET(0x980A, PALM_980A, PALM) CHIPSET(0x9640, SUMO_9640, SUMO) CHIPSET(0x9641, SUMO_9641, SUMO) CHIPSET(0x9642, SUMO2_9642, SUMO2) CHIPSET(0x9643, SUMO2_9643, SUMO2) CHIPSET(0x9644, SUMO2_9644, SUMO2) CHIPSET(0x9645, SUMO2_9645, SUMO2) CHIPSET(0x9647, SUMO_9647, SUMO) CHIPSET(0x9648, SUMO_9648, SUMO) CHIPSET(0x9649, SUMO2_9649, SUMO2) CHIPSET(0x964a, SUMO_964A, SUMO) CHIPSET(0x964b, SUMO_964B, SUMO) CHIPSET(0x964c, SUMO_964C, SUMO) CHIPSET(0x964e, SUMO_964E, SUMO) CHIPSET(0x964f, SUMO_964F, SUMO) CHIPSET(0x6700, CAYMAN_6700, CAYMAN) CHIPSET(0x6701, CAYMAN_6701, CAYMAN) CHIPSET(0x6702, CAYMAN_6702, CAYMAN) CHIPSET(0x6703, CAYMAN_6703, CAYMAN) CHIPSET(0x6704, CAYMAN_6704, CAYMAN) CHIPSET(0x6705, CAYMAN_6705, CAYMAN) CHIPSET(0x6706, CAYMAN_6706, CAYMAN) CHIPSET(0x6707, CAYMAN_6707, CAYMAN) CHIPSET(0x6708, CAYMAN_6708, CAYMAN) CHIPSET(0x6709, CAYMAN_6709, CAYMAN) CHIPSET(0x6718, CAYMAN_6718, CAYMAN) CHIPSET(0x6719, CAYMAN_6719, CAYMAN) CHIPSET(0x671C, CAYMAN_671C, CAYMAN) CHIPSET(0x671D, CAYMAN_671D, CAYMAN) CHIPSET(0x671F, CAYMAN_671F, CAYMAN) CHIPSET(0x6720, BARTS_6720, BARTS) CHIPSET(0x6721, BARTS_6721, BARTS) CHIPSET(0x6722, BARTS_6722, BARTS) CHIPSET(0x6723, BARTS_6723, BARTS) CHIPSET(0x6724, BARTS_6724, BARTS) CHIPSET(0x6725, BARTS_6725, BARTS) CHIPSET(0x6726, BARTS_6726, BARTS) CHIPSET(0x6727, BARTS_6727, BARTS) CHIPSET(0x6728, BARTS_6728, BARTS) CHIPSET(0x6729, BARTS_6729, BARTS) CHIPSET(0x6738, BARTS_6738, BARTS) CHIPSET(0x6739, BARTS_6739, BARTS) CHIPSET(0x673E, BARTS_673E, BARTS) CHIPSET(0x6740, TURKS_6740, TURKS) CHIPSET(0x6741, TURKS_6741, TURKS) CHIPSET(0x6742, TURKS_6742, TURKS) CHIPSET(0x6743, TURKS_6743, TURKS) CHIPSET(0x6744, TURKS_6744, TURKS) CHIPSET(0x6745, TURKS_6745, TURKS) CHIPSET(0x6746, TURKS_6746, TURKS) CHIPSET(0x6747, TURKS_6747, TURKS) CHIPSET(0x6748, TURKS_6748, TURKS) CHIPSET(0x6749, TURKS_6749, TURKS) CHIPSET(0x674A, TURKS_674A, TURKS) CHIPSET(0x6750, TURKS_6750, TURKS) CHIPSET(0x6751, TURKS_6751, TURKS) CHIPSET(0x6758, TURKS_6758, TURKS) CHIPSET(0x6759, TURKS_6759, TURKS) CHIPSET(0x675B, TURKS_675B, TURKS) CHIPSET(0x675D, TURKS_675D, TURKS) CHIPSET(0x675F, TURKS_675F, TURKS) CHIPSET(0x6840, TURKS_6840, TURKS) CHIPSET(0x6841, TURKS_6841, TURKS) CHIPSET(0x6842, TURKS_6842, TURKS) CHIPSET(0x6843, TURKS_6843, TURKS) CHIPSET(0x6849, TURKS_6849, TURKS) CHIPSET(0x6850, TURKS_6850, TURKS) CHIPSET(0x6858, TURKS_6858, TURKS) CHIPSET(0x6859, TURKS_6859, TURKS) CHIPSET(0x6760, CAICOS_6760, CAICOS) CHIPSET(0x6761, CAICOS_6761, CAICOS) CHIPSET(0x6762, CAICOS_6762, CAICOS) CHIPSET(0x6763, CAICOS_6763, CAICOS) CHIPSET(0x6764, CAICOS_6764, CAICOS) CHIPSET(0x6765, CAICOS_6765, CAICOS) CHIPSET(0x6766, CAICOS_6766, CAICOS) CHIPSET(0x6767, CAICOS_6767, CAICOS) CHIPSET(0x6768, CAICOS_6768, CAICOS) CHIPSET(0x6770, CAICOS_6770, CAICOS) CHIPSET(0x6771, CAICOS_6771, CAICOS) CHIPSET(0x6772, CAICOS_6772, CAICOS) CHIPSET(0x6778, CAICOS_6778, CAICOS) CHIPSET(0x6779, CAICOS_6779, CAICOS) CHIPSET(0x677B, CAICOS_677B, CAICOS) CHIPSET(0x9900, ARUBA_9900, ARUBA) CHIPSET(0x9901, ARUBA_9901, ARUBA) CHIPSET(0x9903, ARUBA_9903, ARUBA) CHIPSET(0x9904, ARUBA_9904, ARUBA) CHIPSET(0x9905, ARUBA_9905, ARUBA) CHIPSET(0x9906, ARUBA_9906, ARUBA) CHIPSET(0x9907, ARUBA_9907, ARUBA) CHIPSET(0x9908, ARUBA_9908, ARUBA) CHIPSET(0x9909, ARUBA_9909, ARUBA) CHIPSET(0x990A, ARUBA_990A, ARUBA) CHIPSET(0x990B, ARUBA_990B, ARUBA) CHIPSET(0x990C, ARUBA_990C, ARUBA) CHIPSET(0x990D, ARUBA_990D, ARUBA) CHIPSET(0x990E, ARUBA_990E, ARUBA) CHIPSET(0x990F, ARUBA_990F, ARUBA) CHIPSET(0x9910, ARUBA_9910, ARUBA) CHIPSET(0x9913, ARUBA_9913, ARUBA) CHIPSET(0x9917, ARUBA_9917, ARUBA) CHIPSET(0x9918, ARUBA_9918, ARUBA) CHIPSET(0x9919, ARUBA_9919, ARUBA) CHIPSET(0x9990, ARUBA_9990, ARUBA) CHIPSET(0x9991, ARUBA_9991, ARUBA) CHIPSET(0x9992, ARUBA_9992, ARUBA) CHIPSET(0x9993, ARUBA_9993, ARUBA) CHIPSET(0x9994, ARUBA_9994, ARUBA) CHIPSET(0x9995, ARUBA_9995, ARUBA) CHIPSET(0x9996, ARUBA_9996, ARUBA) CHIPSET(0x9997, ARUBA_9997, ARUBA) CHIPSET(0x9998, ARUBA_9998, ARUBA) CHIPSET(0x9999, ARUBA_9999, ARUBA) CHIPSET(0x999A, ARUBA_999A, ARUBA) CHIPSET(0x999B, ARUBA_999B, ARUBA) CHIPSET(0x999C, ARUBA_999C, ARUBA) CHIPSET(0x999D, ARUBA_999D, ARUBA) CHIPSET(0x99A0, ARUBA_99A0, ARUBA) CHIPSET(0x99A2, ARUBA_99A2, ARUBA) CHIPSET(0x99A4, ARUBA_99A4, ARUBA) xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/i965_pci_ids.h0000664000175100017510000001333612432306326017536 00000000000000CHIPSET(0x29A2, i965, "Intel(R) 965G") CHIPSET(0x2992, i965, "Intel(R) 965Q") CHIPSET(0x2982, i965, "Intel(R) 965G") CHIPSET(0x2972, i965, "Intel(R) 946GZ") CHIPSET(0x2A02, i965, "Intel(R) 965GM") CHIPSET(0x2A12, i965, "Intel(R) 965GME/GLE") CHIPSET(0x2A42, g4x, "Mobile Intel® GM45 Express Chipset") CHIPSET(0x2E02, g4x, "Intel(R) Integrated Graphics Device") CHIPSET(0x2E12, g4x, "Intel(R) Q45/Q43") CHIPSET(0x2E22, g4x, "Intel(R) G45/G43") CHIPSET(0x2E32, g4x, "Intel(R) G41") CHIPSET(0x2E42, g4x, "Intel(R) B43") CHIPSET(0x2E92, g4x, "Intel(R) B43") CHIPSET(0x0042, ilk, "Intel(R) Ironlake Desktop") CHIPSET(0x0046, ilk, "Intel(R) Ironlake Mobile") CHIPSET(0x0102, snb_gt1, "Intel(R) Sandybridge Desktop") CHIPSET(0x0112, snb_gt2, "Intel(R) Sandybridge Desktop") CHIPSET(0x0122, snb_gt2, "Intel(R) Sandybridge Desktop") CHIPSET(0x0106, snb_gt1, "Intel(R) Sandybridge Mobile") CHIPSET(0x0116, snb_gt2, "Intel(R) Sandybridge Mobile") CHIPSET(0x0126, snb_gt2, "Intel(R) Sandybridge Mobile") CHIPSET(0x010A, snb_gt1, "Intel(R) Sandybridge Server") CHIPSET(0x0152, ivb_gt1, "Intel(R) Ivybridge Desktop") CHIPSET(0x0162, ivb_gt2, "Intel(R) Ivybridge Desktop") CHIPSET(0x0156, ivb_gt1, "Intel(R) Ivybridge Mobile") CHIPSET(0x0166, ivb_gt2, "Intel(R) Ivybridge Mobile") CHIPSET(0x015a, ivb_gt1, "Intel(R) Ivybridge Server") CHIPSET(0x016a, ivb_gt2, "Intel(R) Ivybridge Server") CHIPSET(0x0402, hsw_gt1, "Intel(R) Haswell Desktop") CHIPSET(0x0412, hsw_gt2, "Intel(R) Haswell Desktop") CHIPSET(0x0422, hsw_gt3, "Intel(R) Haswell Desktop") CHIPSET(0x0406, hsw_gt1, "Intel(R) Haswell Mobile") CHIPSET(0x0416, hsw_gt2, "Intel(R) Haswell Mobile") CHIPSET(0x0426, hsw_gt3, "Intel(R) Haswell Mobile") CHIPSET(0x040A, hsw_gt1, "Intel(R) Haswell Server") CHIPSET(0x041A, hsw_gt2, "Intel(R) Haswell Server") CHIPSET(0x042A, hsw_gt3, "Intel(R) Haswell Server") CHIPSET(0x040B, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x041B, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x042B, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x040E, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x041E, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x042E, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0C02, hsw_gt1, "Intel(R) Haswell Desktop") CHIPSET(0x0C12, hsw_gt2, "Intel(R) Haswell Desktop") CHIPSET(0x0C22, hsw_gt3, "Intel(R) Haswell Desktop") CHIPSET(0x0C06, hsw_gt1, "Intel(R) Haswell Mobile") CHIPSET(0x0C16, hsw_gt2, "Intel(R) Haswell Mobile") CHIPSET(0x0C26, hsw_gt3, "Intel(R) Haswell Mobile") CHIPSET(0x0C0A, hsw_gt1, "Intel(R) Haswell Server") CHIPSET(0x0C1A, hsw_gt2, "Intel(R) Haswell Server") CHIPSET(0x0C2A, hsw_gt3, "Intel(R) Haswell Server") CHIPSET(0x0C0B, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x0C1B, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x0C2B, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0C0E, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x0C1E, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x0C2E, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0A02, hsw_gt1, "Intel(R) Haswell Desktop") CHIPSET(0x0A12, hsw_gt2, "Intel(R) Haswell Desktop") CHIPSET(0x0A22, hsw_gt3, "Intel(R) Haswell Desktop") CHIPSET(0x0A06, hsw_gt1, "Intel(R) Haswell Mobile") CHIPSET(0x0A16, hsw_gt2, "Intel(R) Haswell Mobile") CHIPSET(0x0A26, hsw_gt3, "Intel(R) Haswell Mobile") CHIPSET(0x0A0A, hsw_gt1, "Intel(R) Haswell Server") CHIPSET(0x0A1A, hsw_gt2, "Intel(R) Haswell Server") CHIPSET(0x0A2A, hsw_gt3, "Intel(R) Haswell Server") CHIPSET(0x0A0B, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x0A1B, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x0A2B, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0A0E, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x0A1E, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x0A2E, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0D02, hsw_gt1, "Intel(R) Haswell Desktop") CHIPSET(0x0D12, hsw_gt2, "Intel(R) Haswell Desktop") CHIPSET(0x0D22, hsw_gt3, "Intel(R) Haswell Desktop") CHIPSET(0x0D06, hsw_gt1, "Intel(R) Haswell Mobile") CHIPSET(0x0D16, hsw_gt2, "Intel(R) Haswell Mobile") CHIPSET(0x0D26, hsw_gt3, "Intel(R) Haswell Mobile") CHIPSET(0x0D0A, hsw_gt1, "Intel(R) Haswell Server") CHIPSET(0x0D1A, hsw_gt2, "Intel(R) Haswell Server") CHIPSET(0x0D2A, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0D0B, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x0D1B, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x0D2B, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0D0E, hsw_gt1, "Intel(R) Haswell") CHIPSET(0x0D1E, hsw_gt2, "Intel(R) Haswell") CHIPSET(0x0D2E, hsw_gt3, "Intel(R) Haswell") CHIPSET(0x0F31, byt, "Intel(R) Bay Trail") CHIPSET(0x0F32, byt, "Intel(R) Bay Trail") CHIPSET(0x0F33, byt, "Intel(R) Bay Trail") CHIPSET(0x0157, byt, "Intel(R) Bay Trail") CHIPSET(0x0155, byt, "Intel(R) Bay Trail") CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1") CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1") CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1") CHIPSET(0x160B, bdw_gt1, "Intel(R) Broadwell GT1") CHIPSET(0x160D, bdw_gt1, "Intel(R) Broadwell GT1") CHIPSET(0x160E, bdw_gt1, "Intel(R) Broadwell GT1") CHIPSET(0x1612, bdw_gt2, "Intel(R) HD Graphics 5600 (Broadwell GT2)") CHIPSET(0x1616, bdw_gt2, "Intel(R) HD Graphics 5500 (Broadwell GT2)") CHIPSET(0x161A, bdw_gt2, "Intel(R) Broadwell GT2") CHIPSET(0x161B, bdw_gt2, "Intel(R) Broadwell GT2") CHIPSET(0x161D, bdw_gt2, "Intel(R) Broadwell GT2") CHIPSET(0x161E, bdw_gt2, "Intel(R) HD Graphics 5300 (Broadwell GT2)") CHIPSET(0x1622, bdw_gt3, "Intel(R) Iris Pro 6200 (Broadwell GT3e)") CHIPSET(0x1626, bdw_gt3, "Intel(R) HD Graphics 6000 (Broadwell GT3)") CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)") CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)") CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3") CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3") CHIPSET(0x22B0, chv, "Intel(R) Cherryview") CHIPSET(0x22B1, chv, "Intel(R) Cherryview") CHIPSET(0x22B2, chv, "Intel(R) Cherryview") CHIPSET(0x22B3, chv, "Intel(R) Cherryview") xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h0000664000175100017510000001260512432306326020644 00000000000000CHIPSET(0x6780, TAHITI_6780, TAHITI) CHIPSET(0x6784, TAHITI_6784, TAHITI) CHIPSET(0x6788, TAHITI_6788, TAHITI) CHIPSET(0x678A, TAHITI_678A, TAHITI) CHIPSET(0x6790, TAHITI_6790, TAHITI) CHIPSET(0x6791, TAHITI_6791, TAHITI) CHIPSET(0x6792, TAHITI_6792, TAHITI) CHIPSET(0x6798, TAHITI_6798, TAHITI) CHIPSET(0x6799, TAHITI_6799, TAHITI) CHIPSET(0x679A, TAHITI_679A, TAHITI) CHIPSET(0x679B, TAHITI_679B, TAHITI) CHIPSET(0x679E, TAHITI_679E, TAHITI) CHIPSET(0x679F, TAHITI_679F, TAHITI) CHIPSET(0x6800, PITCAIRN_6800, PITCAIRN) CHIPSET(0x6801, PITCAIRN_6801, PITCAIRN) CHIPSET(0x6802, PITCAIRN_6802, PITCAIRN) CHIPSET(0x6806, PITCAIRN_6806, PITCAIRN) CHIPSET(0x6808, PITCAIRN_6808, PITCAIRN) CHIPSET(0x6809, PITCAIRN_6809, PITCAIRN) CHIPSET(0x6810, PITCAIRN_6810, PITCAIRN) CHIPSET(0x6811, PITCAIRN_6811, PITCAIRN) CHIPSET(0x6816, PITCAIRN_6816, PITCAIRN) CHIPSET(0x6817, PITCAIRN_6817, PITCAIRN) CHIPSET(0x6818, PITCAIRN_6818, PITCAIRN) CHIPSET(0x6819, PITCAIRN_6819, PITCAIRN) CHIPSET(0x684C, PITCAIRN_684C, PITCAIRN) CHIPSET(0x6820, VERDE_6820, VERDE) CHIPSET(0x6821, VERDE_6821, VERDE) CHIPSET(0x6822, VERDE_6822, VERDE) CHIPSET(0x6823, VERDE_6823, VERDE) CHIPSET(0x6824, VERDE_6824, VERDE) CHIPSET(0x6825, VERDE_6825, VERDE) CHIPSET(0x6826, VERDE_6826, VERDE) CHIPSET(0x6827, VERDE_6827, VERDE) CHIPSET(0x6828, VERDE_6828, VERDE) CHIPSET(0x6829, VERDE_6829, VERDE) CHIPSET(0x682A, VERDE_682A, VERDE) CHIPSET(0x682B, VERDE_682B, VERDE) CHIPSET(0x682C, VERDE_682C, VERDE) CHIPSET(0x682D, VERDE_682D, VERDE) CHIPSET(0x682F, VERDE_682F, VERDE) CHIPSET(0x6830, VERDE_6830, VERDE) CHIPSET(0x6831, VERDE_6831, VERDE) CHIPSET(0x6835, VERDE_6835, VERDE) CHIPSET(0x6837, VERDE_6837, VERDE) CHIPSET(0x6838, VERDE_6838, VERDE) CHIPSET(0x6839, VERDE_6839, VERDE) CHIPSET(0x683B, VERDE_683B, VERDE) CHIPSET(0x683D, VERDE_683D, VERDE) CHIPSET(0x683F, VERDE_683F, VERDE) CHIPSET(0x6600, OLAND_6600, OLAND) CHIPSET(0x6601, OLAND_6601, OLAND) CHIPSET(0x6602, OLAND_6602, OLAND) CHIPSET(0x6603, OLAND_6603, OLAND) CHIPSET(0x6604, OLAND_6604, OLAND) CHIPSET(0x6605, OLAND_6605, OLAND) CHIPSET(0x6606, OLAND_6606, OLAND) CHIPSET(0x6607, OLAND_6607, OLAND) CHIPSET(0x6608, OLAND_6608, OLAND) CHIPSET(0x6610, OLAND_6610, OLAND) CHIPSET(0x6611, OLAND_6611, OLAND) CHIPSET(0x6613, OLAND_6613, OLAND) CHIPSET(0x6620, OLAND_6620, OLAND) CHIPSET(0x6621, OLAND_6621, OLAND) CHIPSET(0x6623, OLAND_6623, OLAND) CHIPSET(0x6631, OLAND_6631, OLAND) CHIPSET(0x6660, HAINAN_6660, HAINAN) CHIPSET(0x6663, HAINAN_6663, HAINAN) CHIPSET(0x6664, HAINAN_6664, HAINAN) CHIPSET(0x6665, HAINAN_6665, HAINAN) CHIPSET(0x6667, HAINAN_6667, HAINAN) CHIPSET(0x666F, HAINAN_666F, HAINAN) CHIPSET(0x6640, BONAIRE_6640, BONAIRE) CHIPSET(0x6641, BONAIRE_6641, BONAIRE) CHIPSET(0x6646, BONAIRE_6646, BONAIRE) CHIPSET(0x6647, BONAIRE_6647, BONAIRE) CHIPSET(0x6649, BONAIRE_6649, BONAIRE) CHIPSET(0x6650, BONAIRE_6650, BONAIRE) CHIPSET(0x6651, BONAIRE_6651, BONAIRE) CHIPSET(0x6658, BONAIRE_6658, BONAIRE) CHIPSET(0x665C, BONAIRE_665C, BONAIRE) CHIPSET(0x665D, BONAIRE_665D, BONAIRE) CHIPSET(0x9830, KABINI_9830, KABINI) CHIPSET(0x9831, KABINI_9831, KABINI) CHIPSET(0x9832, KABINI_9832, KABINI) CHIPSET(0x9833, KABINI_9833, KABINI) CHIPSET(0x9834, KABINI_9834, KABINI) CHIPSET(0x9835, KABINI_9835, KABINI) CHIPSET(0x9836, KABINI_9836, KABINI) CHIPSET(0x9837, KABINI_9837, KABINI) CHIPSET(0x9838, KABINI_9838, KABINI) CHIPSET(0x9839, KABINI_9839, KABINI) CHIPSET(0x983A, KABINI_983A, KABINI) CHIPSET(0x983B, KABINI_983B, KABINI) CHIPSET(0x983C, KABINI_983C, KABINI) CHIPSET(0x983D, KABINI_983D, KABINI) CHIPSET(0x983E, KABINI_983E, KABINI) CHIPSET(0x983F, KABINI_983F, KABINI) CHIPSET(0x9850, MULLINS_9850, MULLINS) CHIPSET(0x9851, MULLINS_9851, MULLINS) CHIPSET(0x9852, MULLINS_9852, MULLINS) CHIPSET(0x9853, MULLINS_9853, MULLINS) CHIPSET(0x9854, MULLINS_9854, MULLINS) CHIPSET(0x9855, MULLINS_9855, MULLINS) CHIPSET(0x9856, MULLINS_9856, MULLINS) CHIPSET(0x9857, MULLINS_9857, MULLINS) CHIPSET(0x9858, MULLINS_9858, MULLINS) CHIPSET(0x9859, MULLINS_9859, MULLINS) CHIPSET(0x985A, MULLINS_985A, MULLINS) CHIPSET(0x985B, MULLINS_985B, MULLINS) CHIPSET(0x985C, MULLINS_985C, MULLINS) CHIPSET(0x985D, MULLINS_985D, MULLINS) CHIPSET(0x985E, MULLINS_985E, MULLINS) CHIPSET(0x985F, MULLINS_985F, MULLINS) CHIPSET(0x1304, KAVERI_1304, KAVERI) CHIPSET(0x1305, KAVERI_1305, KAVERI) CHIPSET(0x1306, KAVERI_1306, KAVERI) CHIPSET(0x1307, KAVERI_1307, KAVERI) CHIPSET(0x1309, KAVERI_1309, KAVERI) CHIPSET(0x130A, KAVERI_130A, KAVERI) CHIPSET(0x130B, KAVERI_130B, KAVERI) CHIPSET(0x130C, KAVERI_130C, KAVERI) CHIPSET(0x130D, KAVERI_130D, KAVERI) CHIPSET(0x130E, KAVERI_130E, KAVERI) CHIPSET(0x130F, KAVERI_130F, KAVERI) CHIPSET(0x1310, KAVERI_1310, KAVERI) CHIPSET(0x1311, KAVERI_1311, KAVERI) CHIPSET(0x1312, KAVERI_1312, KAVERI) CHIPSET(0x1313, KAVERI_1313, KAVERI) CHIPSET(0x1315, KAVERI_1315, KAVERI) CHIPSET(0x1316, KAVERI_1316, KAVERI) CHIPSET(0x1317, KAVERI_1317, KAVERI) CHIPSET(0x1318, KAVERI_1318, KAVERI) CHIPSET(0x131B, KAVERI_131B, KAVERI) CHIPSET(0x131C, KAVERI_131C, KAVERI) CHIPSET(0x131D, KAVERI_131D, KAVERI) CHIPSET(0x67A0, HAWAII_67A0, HAWAII) CHIPSET(0x67A1, HAWAII_67A1, HAWAII) CHIPSET(0x67A2, HAWAII_67A2, HAWAII) CHIPSET(0x67A8, HAWAII_67A8, HAWAII) CHIPSET(0x67A9, HAWAII_67A9, HAWAII) CHIPSET(0x67AA, HAWAII_67AA, HAWAII) CHIPSET(0x67B0, HAWAII_67B0, HAWAII) CHIPSET(0x67B1, HAWAII_67B1, HAWAII) CHIPSET(0x67B8, HAWAII_67B8, HAWAII) CHIPSET(0x67B9, HAWAII_67B9, HAWAII) CHIPSET(0x67BA, HAWAII_67BA, HAWAII) CHIPSET(0x67BE, HAWAII_67BE, HAWAII) xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/r200_pci_ids.h0000664000175100017510000000131012432306326017512 00000000000000CHIPSET(0x5148, R200_QH, R200) CHIPSET(0x514C, R200_QL, R200) CHIPSET(0x514D, R200_QM, R200) CHIPSET(0x4242, R200_BB, R200) CHIPSET(0x4966, RV250_If, RV250) CHIPSET(0x4967, RV250_Ig, RV250) CHIPSET(0x4C64, RV250_Ld, RV250) CHIPSET(0x4C66, RV250_Lf, RV250) CHIPSET(0x4C67, RV250_Lg, RV250) CHIPSET(0x4C6E, RV280_4C6E, RV280) CHIPSET(0x5960, RV280_5960, RV280) CHIPSET(0x5961, RV280_5961, RV280) CHIPSET(0x5962, RV280_5962, RV280) CHIPSET(0x5964, RV280_5964, RV280) CHIPSET(0x5965, RV280_5965, RV280) CHIPSET(0x5C61, RV280_5C61, RV280) CHIPSET(0x5C63, RV280_5C63, RV280) CHIPSET(0x5834, RS300_5834, RS300) CHIPSET(0x5835, RS300_5835, RS300) CHIPSET(0x7834, RS350_7834, RS300) CHIPSET(0x7835, RS350_7835, RS300) xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/Makefile.in0000664000175100017510000004647712466505432017266 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/dri2/pci_ids DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ EXTRA_DIST = \ pci_id_driver_map.h \ i810_pci_ids.h \ i915_pci_ids.h \ i965_pci_ids.h \ r200_pci_ids.h \ r300_pci_ids.h \ r600_pci_ids.h \ radeon_pci_ids.h \ radeonsi_pci_ids.h \ vmwgfx_pci_ids.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(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/dri2/pci_ids/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/dri2/pci_ids/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am 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: xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/radeon_pci_ids.h0000664000175100017510000000125712432306326020311 00000000000000CHIPSET(0x4C57, RADEON_LW, RV200) CHIPSET(0x4C58, RADEON_LX, RV200) CHIPSET(0x4C59, RADEON_LY, RV100) CHIPSET(0x4C5A, RADEON_LZ, RV100) CHIPSET(0x5144, RADEON_QD, R100) CHIPSET(0x5145, RADEON_QE, R100) CHIPSET(0x5146, RADEON_QF, R100) CHIPSET(0x5147, RADEON_QG, R100) CHIPSET(0x5159, RADEON_QY, RV100) CHIPSET(0x515A, RADEON_QZ, RV100) CHIPSET(0x5157, RV200_QW, RV200) CHIPSET(0x5158, RV200_QX, RV200) CHIPSET(0x515E, RN50_515E, UNKNOWN) CHIPSET(0x5969, RN50_5969, UNKNOWN) CHIPSET(0x4136, RS100_4136, RS100) CHIPSET(0x4336, RS100_4336, RS100) CHIPSET(0x4137, RS200_4137, RS200) CHIPSET(0x4337, RS200_4337, RS200) CHIPSET(0x4237, RS250_4237, RS200) CHIPSET(0x4437, RS250_4437, RS200) xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h0000664000175100017510000000403712432306326021005 00000000000000#ifndef _PCI_ID_DRIVER_MAP_H_ #define _PCI_ID_DRIVER_MAP_H_ #include #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) #endif static const int i915_chip_ids[] = { #define CHIPSET(chip, desc, name) chip, #include "pci_ids/i915_pci_ids.h" #undef CHIPSET }; static const int i965_chip_ids[] = { #define CHIPSET(chip, family, name) chip, #include "pci_ids/i965_pci_ids.h" #undef CHIPSET }; #ifndef DRIVER_MAP_GALLIUM_ONLY static const int r100_chip_ids[] = { #define CHIPSET(chip, name, family) chip, #include "pci_ids/radeon_pci_ids.h" #undef CHIPSET }; static const int r200_chip_ids[] = { #define CHIPSET(chip, name, family) chip, #include "pci_ids/r200_pci_ids.h" #undef CHIPSET }; #endif static const int r300_chip_ids[] = { #define CHIPSET(chip, name, family) chip, #include "pci_ids/r300_pci_ids.h" #undef CHIPSET }; static const int r600_chip_ids[] = { #define CHIPSET(chip, name, family) chip, #include "pci_ids/r600_pci_ids.h" #undef CHIPSET }; static const int radeonsi_chip_ids[] = { #define CHIPSET(chip, name, family) chip, #include "pci_ids/radeonsi_pci_ids.h" #undef CHIPSET }; static const int vmwgfx_chip_ids[] = { #define CHIPSET(chip, name, family) chip, #include "pci_ids/vmwgfx_pci_ids.h" #undef CHIPSET }; static const struct { int vendor_id; const char *driver; const int *chip_ids; int num_chips_ids; } driver_map[] = { { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, #ifndef DRIVER_MAP_GALLIUM_ONLY { 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) }, { 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) }, #endif { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, { 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, { 0x10de, "nouveau", NULL, -1 }, { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, { 0x0000, NULL, NULL, 0 }, }; #endif /* _PCI_ID_DRIVER_MAP_H_ */ xorg-server-1.17.1/hw/xfree86/dri2/pci_ids/i810_pci_ids.h0000664000175100017510000000017012432306326017513 00000000000000CHIPSET(0x7121, I810, i8xx) CHIPSET(0x7123, I810_DC100, i8xx) CHIPSET(0x7125, I810_E, i8xx) CHIPSET(0x1132, I815, i8xx) xorg-server-1.17.1/hw/xfree86/dri2/dri2.h0000664000175100017510000003744112274325511014602 00000000000000/* * Copyright © 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Soft- * ware"), to deal in the Software without restriction, including without * limitation the rights to use, copy, modify, merge, publish, distribute, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, provided that the above copyright * notice(s) and this permission notice appear in all copies of the Soft- * ware and that both the above copyright notice(s) and this permission * notice appear in supporting documentation. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- * QUENTIAL 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 PERFOR- * MANCE OF THIS SOFTWARE. * * Except as contained in this notice, the name of a copyright holder shall * not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization of * the copyright holder. * * Authors: * Kristian Høgsberg (krh@redhat.com) */ #ifndef _DRI2_H_ #define _DRI2_H_ #include /* Version 2 structure (with format at the end) */ typedef struct { unsigned int attachment; unsigned int name; unsigned int pitch; unsigned int cpp; unsigned int flags; unsigned int format; void *driverPrivate; } DRI2BufferRec, *DRI2BufferPtr; extern CARD8 dri2_major; /* version of DRI2 supported by DDX */ extern CARD8 dri2_minor; typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr; typedef void (*DRI2SwapEventPtr) (ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, CARD32 sbc); typedef DRI2BufferPtr(*DRI2CreateBuffersProcPtr) (DrawablePtr pDraw, unsigned int *attachments, int count); typedef void (*DRI2DestroyBuffersProcPtr) (DrawablePtr pDraw, DRI2BufferPtr buffers, int count); typedef void (*DRI2CopyRegionProcPtr) (DrawablePtr pDraw, RegionPtr pRegion, DRI2BufferPtr pDestBuffer, 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 * * This callback is used to support glXSwapBuffers and the OML_sync_control * extension (see it for a description of the params). * * Drivers should queue an event for the frame count that satisfies the * parameters passed in. If the event is in the future (i.e. the conditions * aren't currently satisfied), the server may block the client at the next * GLX request using DRI2WaitSwap. When the event arrives, drivers should call * \c DRI2SwapComplete, which will handle waking the client and returning * the appropriate data. * * The DDX is responsible for doing a flip, exchange, or blit of the swap * when the corresponding event arrives. The \c DRI2CanFlip and * \c DRI2CanExchange functions can be used as helpers for this purpose. * * \param client client pointer (used for block/unblock) * \param pDraw drawable whose count we want * \param pDestBuffer current front buffer * \param pSrcBuffer current back buffer * \param target_msc frame count to wait for * \param divisor divisor for condition equation * \param remainder remainder for division equation * \param func function to call when the swap completes * \param data data for the callback \p func. */ typedef int (*DRI2ScheduleSwapProcPtr) (ClientPtr client, DrawablePtr pDraw, DRI2BufferPtr pDestBuffer, DRI2BufferPtr pSrcBuffer, CARD64 * target_msc, CARD64 divisor, CARD64 remainder, DRI2SwapEventPtr func, void *data); typedef DRI2BufferPtr(*DRI2CreateBufferProcPtr) (DrawablePtr pDraw, unsigned int attachment, unsigned int format); typedef void (*DRI2DestroyBufferProcPtr) (DrawablePtr pDraw, DRI2BufferPtr buffer); /** * Notifies driver when DRI2GetBuffers reuses a dri2 buffer. * * Driver may rename the dri2 buffer in this notify if it is required. * * \param pDraw drawable whose count we want * \param buffer buffer that will be returned to client */ typedef void (*DRI2ReuseBufferNotifyProcPtr) (DrawablePtr pDraw, DRI2BufferPtr buffer); /** * Get current media stamp counter values * * This callback is used to support the SGI_video_sync and OML_sync_control * extensions. * * Drivers should return the current frame counter and the timestamp from * when the returned frame count was last incremented. * * The count should correspond to the screen where the drawable is currently * visible. If the drawable isn't visible (e.g. redirected), the server * should return BadDrawable to the client, pending GLX spec updates to * define this behavior. * * \param pDraw drawable whose count we want * \param ust timestamp from when the count was last incremented. * \param mst current frame count */ typedef int (*DRI2GetMSCProcPtr) (DrawablePtr pDraw, CARD64 * ust, CARD64 * msc); /** * Schedule a frame count related wait * * This callback is used to support the SGI_video_sync and OML_sync_control * extensions. See those specifications for details on how to handle * the divisor and remainder parameters. * * Drivers should queue an event for the frame count that satisfies the * parameters passed in. If the event is in the future (i.e. the conditions * aren't currently satisfied), the driver should block the client using * \c DRI2BlockClient. When the event arrives, drivers should call * \c DRI2WaitMSCComplete, which will handle waking the client and returning * the appropriate data. * * \param client client pointer (used for block/unblock) * \param pDraw drawable whose count we want * \param target_msc frame count to wait for * \param divisor divisor for condition equation * \param remainder remainder for division equation */ typedef int (*DRI2ScheduleWaitMSCProcPtr) (ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, CARD64 divisor, CARD64 remainder); typedef void (*DRI2InvalidateProcPtr) (DrawablePtr pDraw, void *data, XID id); /** * DRI2 calls this hook when ever swap_limit is going to be changed. Default * implementation for the hook only accepts one as swap_limit. If driver can * support other swap_limits it has to implement supported limits with this * callback. * * \param pDraw drawable whos swap_limit is going to be changed * \param swap_limit new swap_limit that going to be set * \return TRUE if limit is support, FALSE if not. */ 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 9 typedef struct { unsigned int version; /**< Version of this struct */ int fd; const char *driverName; const char *deviceName; DRI2CreateBufferProcPtr CreateBuffer; DRI2DestroyBufferProcPtr DestroyBuffer; DRI2CopyRegionProcPtr CopyRegion; DRI2WaitProcPtr Wait; /* added in version 4 */ DRI2ScheduleSwapProcPtr ScheduleSwap; DRI2GetMSCProcPtr GetMSC; DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; /* number of drivers in the driverNames array */ unsigned int numDrivers; /* array of driver names, indexed by DRI2Driver* driver types */ /* a name of NULL means that driver is not supported */ const char *const *driverNames; /* added in version 5 */ DRI2AuthMagicProcPtr AuthMagic; /* added in version 6 */ DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; /* 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); extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen); extern _X_EXPORT Bool DRI2HasSwapControl(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(ClientPtr client, ScreenPtr pScreen, uint32_t magic); extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, DRI2InvalidateProcPtr invalidate, void *priv); 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, int *height, unsigned int *attachments, int count, int *out_count); extern _X_EXPORT int DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, unsigned int dest, unsigned int src); /** * Determine the major and minor version of the DRI2 extension. * * Provides a mechanism to other modules (e.g., 2D drivers) to determine the * version of the DRI2 extension. While it is possible to peek directly at * the \c XF86ModuleData from a layered module, such a module will fail to * load (due to an unresolved symbol) if the DRI2 extension is not loaded. * * \param major Location to store the major verion of the DRI2 extension * \param minor Location to store the minor verion of the DRI2 extension * * \note * This interface was added some time after the initial release of the DRI2 * module. Layered modules that wish to use this interface must first test * its existance by calling \c xf86LoaderCheckSymbol. */ extern _X_EXPORT void DRI2Version(int *major, int *minor); extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffersWithFormat(DrawablePtr pDraw, int *width, int *height, unsigned int *attachments, int count, int *out_count); extern _X_EXPORT void DRI2SwapInterval(DrawablePtr pDrawable, int interval); extern _X_EXPORT Bool DRI2SwapLimit(DrawablePtr pDraw, int swap_limit); extern _X_EXPORT int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDrawable, CARD64 target_msc, CARD64 divisor, CARD64 remainder, CARD64 * swap_target, DRI2SwapEventPtr func, void *data); extern _X_EXPORT Bool DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable); extern _X_EXPORT int DRI2GetMSC(DrawablePtr pDrawable, CARD64 * ust, CARD64 * msc, CARD64 * sbc); extern _X_EXPORT int DRI2WaitMSC(ClientPtr client, DrawablePtr pDrawable, CARD64 target_msc, CARD64 divisor, CARD64 remainder); extern _X_EXPORT int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust, CARD64 msc, CARD64 sbc); extern _X_EXPORT int DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc); extern _X_EXPORT Bool DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw); extern _X_EXPORT Bool DRI2CanFlip(DrawablePtr pDraw); extern _X_EXPORT Bool DRI2CanExchange(DrawablePtr pDraw); /* Note: use *only* for MSC related waits */ extern _X_EXPORT void DRI2BlockClient(ClientPtr client, DrawablePtr pDraw); extern _X_EXPORT void DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame, unsigned int tv_sec, unsigned int tv_usec, int type, DRI2SwapEventPtr swap_complete, void *swap_data); 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 xorg-server-1.17.1/hw/xfree86/dri2/Makefile.in0000664000175100017510000007620412466505432015643 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/dri2 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libdri2_la_LIBADD = 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 = 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 = $(libdri2_la_SOURCES) DIST_SOURCES = $(libdri2_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 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) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = pci_ids noinst_LTLIBRARIES = libdri2.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ @DIX_CFLAGS@ @XORG_CFLAGS@ \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/os-support/bus libdri2_la_SOURCES = \ dri2.c \ dri2.h \ dri2ext.c \ dri2int.h sdk_HEADERS = dri2.h all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/dri2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/dri2/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libdri2.la: $(libdri2_la_OBJECTS) $(libdri2_la_DEPENDENCIES) $(EXTRA_libdri2_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdri2_la_OBJECTS) $(libdri2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @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 $@ $< @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 -o $@ $< .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 -o $@ `$(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) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sdkdir)"; 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-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-sdkHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-sdkHEADERS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am 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-sdkHEADERS install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/xfree86/dri2/dri2.c0000664000175100017510000013637212461505217014601 00000000000000/* * Copyright © 2007, 2008 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Soft- * ware"), to deal in the Software without restriction, including without * limitation the rights to use, copy, modify, merge, publish, distribute, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, provided that the above copyright * notice(s) and this permission notice appear in all copies of the Soft- * ware and that both the above copyright notice(s) and this permission * notice appear in supporting documentation. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- * QUENTIAL 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 PERFOR- * MANCE OF THIS SOFTWARE. * * Except as contained in this notice, the name of a copyright holder shall * not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization of * the copyright holder. * * Authors: * Kristian Høgsberg (krh@redhat.com) */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #ifdef WITH_LIBDRM #include #endif #include "xf86Module.h" #include "list.h" #include "scrnintstr.h" #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) static DevPrivateKeyRec dri2WindowPrivateKeyRec; #define dri2WindowPrivateKey (&dri2WindowPrivateKeyRec) 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; typedef struct _DRI2Drawable { DRI2ScreenPtr dri2_screen; DrawablePtr drawable; struct xorg_list reference_list; int width; int height; DRI2BufferPtr *buffers; int bufferCount; unsigned int swapsPending; ClientPtr blockedClient; Bool blockedOnMsc; int swap_interval; CARD64 swap_count; int64_t target_sbc; /* -1 means no SBC wait outstanding */ CARD64 last_swap_target; /* most recently queued swap target */ CARD64 last_swap_msc; /* msc at completion of most recent swap */ CARD64 last_swap_ust; /* ust at completion of most recent swap */ int swap_limit; /* for N-buffering */ Bool needInvalidate; int prime_id; PixmapPtr prime_slave_pixmap; PixmapPtr redirectpixmap; } DRI2DrawableRec, *DRI2DrawablePtr; typedef struct _DRI2Screen { ScreenPtr screen; int refcnt; unsigned int numDrivers; const char **driverNames; const char *deviceName; int fd; unsigned int lastSequence; int prime_id; DRI2CreateBufferProcPtr CreateBuffer; DRI2DestroyBufferProcPtr DestroyBuffer; DRI2CopyRegionProcPtr CopyRegion; DRI2ScheduleSwapProcPtr ScheduleSwap; DRI2GetMSCProcPtr GetMSC; DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; DRI2AuthMagic2ProcPtr AuthMagic; DRI2AuthMagicProcPtr LegacyAuthMagic; DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; DRI2GetParamProcPtr GetParam; HandleExposuresProcPtr HandleExposures; ConfigNotifyProcPtr ConfigNotify; SetWindowPixmapProcPtr SetWindowPixmap; 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 == NULL) continue; if (ds->prime_id == prime_id) return slave; } return master; } static DRI2ScreenPtr DRI2GetScreenPrime(ScreenPtr master, int prime_id) { ScreenPtr slave = GetScreenPrime(master, prime_id); return DRI2GetScreen(slave); } static DRI2DrawablePtr DRI2GetDrawable(DrawablePtr pDraw) { WindowPtr pWin; PixmapPtr pPixmap; switch (pDraw->type) { case DRAWABLE_WINDOW: pWin = (WindowPtr) pDraw; return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey); case DRAWABLE_PIXMAP: pPixmap = (PixmapPtr) pDraw; return dixLookupPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey); default: return NULL; } } static DRI2DrawablePtr DRI2AllocateDrawable(DrawablePtr pDraw) { DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); DRI2DrawablePtr pPriv; CARD64 ust; WindowPtr pWin; PixmapPtr pPixmap; pPriv = malloc(sizeof *pPriv); if (pPriv == NULL) return NULL; pPriv->dri2_screen = ds; pPriv->drawable = pDraw; pPriv->width = pDraw->width; pPriv->height = pDraw->height; pPriv->buffers = NULL; pPriv->bufferCount = 0; pPriv->swapsPending = 0; pPriv->blockedClient = NULL; pPriv->blockedOnMsc = FALSE; pPriv->swap_count = 0; pPriv->target_sbc = -1; pPriv->swap_interval = 1; /* Initialize last swap target from DDX if possible */ if (!ds->GetMSC || !(*ds->GetMSC) (pDraw, &ust, &pPriv->last_swap_target)) pPriv->last_swap_target = 0; pPriv->swap_limit = 1; /* default to double buffering */ pPriv->last_swap_msc = 0; pPriv->last_swap_ust = 0; xorg_list_init(&pPriv->reference_list); pPriv->needInvalidate = FALSE; pPriv->redirectpixmap = NULL; pPriv->prime_slave_pixmap = NULL; if (pDraw->type == DRAWABLE_WINDOW) { pWin = (WindowPtr) pDraw; dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); } else { pPixmap = (PixmapPtr) pDraw; dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv); } return pPriv; } Bool DRI2SwapLimit(DrawablePtr pDraw, int swap_limit) { DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); DRI2ScreenPtr ds; if (!pPriv) return FALSE; ds = pPriv->dri2_screen; if (!ds->SwapLimitValidate || !ds->SwapLimitValidate(pDraw, swap_limit)) return FALSE; pPriv->swap_limit = swap_limit; /* Check throttling */ if (pPriv->swapsPending >= pPriv->swap_limit) return TRUE; if (pPriv->target_sbc == -1 && !pPriv->blockedOnMsc) { if (pPriv->blockedClient) { AttendClient(pPriv->blockedClient); pPriv->blockedClient = NULL; } } return TRUE; } typedef struct DRI2DrawableRefRec { XID id; XID dri2_id; DRI2InvalidateProcPtr invalidate; void *priv; struct xorg_list link; } DRI2DrawableRefRec, *DRI2DrawableRefPtr; static DRI2DrawableRefPtr DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id) { DRI2DrawableRefPtr ref; xorg_list_for_each_entry(ref, &pPriv->reference_list, link) { if (ref->id == id) return ref; } return NULL; } static int DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id, DRI2InvalidateProcPtr invalidate, void *priv) { DRI2DrawableRefPtr ref; ref = malloc(sizeof *ref); if (ref == NULL) return BadAlloc; if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) { free(ref); return BadAlloc; } if (!DRI2LookupDrawableRef(pPriv, id)) if (!AddResource(id, dri2DrawableRes, pPriv)) { FreeResourceByType(dri2_id, dri2DrawableRes, TRUE); free(ref); return BadAlloc; } ref->id = id; ref->dri2_id = dri2_id; ref->invalidate = invalidate; ref->priv = priv; xorg_list_add(&ref->link, &pPriv->reference_list); return Success; } int 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; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) pPriv = DRI2AllocateDrawable(pDraw); 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(void *p, XID id) { DRI2DrawablePtr pPriv = p; DRI2DrawableRefPtr ref, next; WindowPtr pWin; PixmapPtr pPixmap; DrawablePtr pDraw; int i; xorg_list_for_each_entry_safe(ref, next, &pPriv->reference_list, link) { if (ref->dri2_id == id) { xorg_list_del(&ref->link); /* If this was the last ref under this X drawable XID, * unregister the X drawable resource. */ if (!DRI2LookupDrawableRef(pPriv, ref->id)) FreeResourceByType(ref->id, dri2DrawableRes, TRUE); free(ref); break; } if (ref->id == id) { xorg_list_del(&ref->link); FreeResourceByType(ref->dri2_id, dri2DrawableRes, TRUE); free(ref); } } if (!xorg_list_is_empty(&pPriv->reference_list)) return Success; pDraw = pPriv->drawable; if (pDraw->type == DRAWABLE_WINDOW) { pWin = (WindowPtr) pDraw; dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, NULL); } else { pPixmap = (PixmapPtr) pDraw; 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++) 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(DRI2ScreenPtr ds, DrawablePtr pDraw, unsigned int attachment, unsigned int format) { DRI2BufferPtr buffer; if (ds->CreateBuffer2) buffer = (*ds->CreateBuffer2)(GetScreenPrime(pDraw->pScreen, DRI2GetDrawable(pDraw)->prime_id), 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) { int i; if (pPriv->buffers == NULL) { return -1; } for (i = 0; i < pPriv->bufferCount; i++) { if ((pPriv->buffers[i] != NULL) && (pPriv->buffers[i]->attachment == attachment)) { return i; } } return -1; } static Bool allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds, DRI2DrawablePtr pPriv, unsigned int attachment, unsigned int format, int dimensions_match, DRI2BufferPtr * buffer) { int old_buf = find_attachment(pPriv, attachment); if ((old_buf < 0) || attachment == DRI2BufferFrontLeft || !dimensions_match || (pPriv->buffers[old_buf]->format != format)) { *buffer = create_buffer(ds, pDraw, attachment, format); return TRUE; } else { *buffer = pPriv->buffers[old_buf]; if (ds->ReuseBufferNotify) (*ds->ReuseBufferNotify) (pDraw, *buffer); pPriv->buffers[old_buf] = NULL; return FALSE; } } static void update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw, DRI2BufferPtr * buffers, int out_count, int *width, int *height) { int i; if (pPriv->buffers != NULL) { for (i = 0; i < pPriv->bufferCount; i++) { if (pPriv->buffers[i] != NULL) { destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id); } } free(pPriv->buffers); } pPriv->buffers = buffers; pPriv->bufferCount = out_count; pPriv->width = pDraw->width; pPriv->height = pDraw->height; *width = pPriv->width; *height = pPriv->height; } static DRI2BufferPtr * do_get_buffers(DrawablePtr pDraw, int *width, int *height, unsigned int *attachments, int count, int *out_count, int has_format) { DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); DRI2ScreenPtr ds; DRI2BufferPtr *buffers; int need_real_front = 0; int need_fake_front = 0; int have_fake_front = 0; int front_format = 0; int dimensions_match; int buffers_changed = 0; int i; if (!pPriv) { *width = pDraw->width; *height = pDraw->height; *out_count = 0; return NULL; } ds = DRI2GetScreenPrime(pDraw->pScreen, pPriv->prime_id); dimensions_match = (pDraw->width == pPriv->width) && (pDraw->height == pPriv->height); buffers = calloc((count + 1), sizeof(buffers[0])); if (!buffers) goto err_out; for (i = 0; i < count; i++) { const unsigned attachment = *(attachments++); const unsigned format = (has_format) ? *(attachments++) : 0; if (allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment, format, dimensions_match, &buffers[i])) buffers_changed = 1; if (buffers[i] == NULL) goto err_out; /* If the drawable is a window and the front-buffer is requested, * silently add the fake front-buffer to the list of requested * attachments. The counting logic in the loop accounts for the case * where the client requests both the fake and real front-buffer. */ if (attachment == DRI2BufferBackLeft) { need_real_front++; front_format = format; } if (attachment == DRI2BufferFrontLeft) { need_real_front--; front_format = format; if (pDraw->type == DRAWABLE_WINDOW) { need_fake_front++; } } if (pDraw->type == DRAWABLE_WINDOW) { if (attachment == DRI2BufferFakeFrontLeft) { need_fake_front--; have_fake_front = 1; } } } if (need_real_front > 0) { if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft, front_format, dimensions_match, &buffers[i])) buffers_changed = 1; if (buffers[i] == NULL) goto err_out; i++; } if (need_fake_front > 0) { if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft, front_format, dimensions_match, &buffers[i])) buffers_changed = 1; if (buffers[i] == NULL) goto err_out; i++; have_fake_front = 1; } *out_count = i; update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, height); /* If the client is getting a fake front-buffer, pre-fill it with the * contents of the real front-buffer. This ensures correct operation of * applications that call glXWaitX before calling glDrawBuffer. */ if (have_fake_front && buffers_changed) { BoxRec box; RegionRec region; box.x1 = 0; box.y1 = 0; box.x2 = pPriv->width; box.y2 = pPriv->height; RegionInit(®ion, &box, 0); DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); } pPriv->needInvalidate = TRUE; return pPriv->buffers; err_out: *out_count = 0; if (buffers) { for (i = 0; i < count; i++) { if (buffers[i] != NULL) destroy_buffer(pDraw, buffers[i], 0); } free(buffers); buffers = NULL; } update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, height); return buffers; } DRI2BufferPtr * DRI2GetBuffers(DrawablePtr pDraw, int *width, int *height, unsigned int *attachments, int count, int *out_count) { return do_get_buffers(pDraw, width, height, attachments, count, out_count, FALSE); } DRI2BufferPtr * DRI2GetBuffersWithFormat(DrawablePtr pDraw, int *width, int *height, unsigned int *attachments, int count, int *out_count) { return do_get_buffers(pDraw, width, height, attachments, count, out_count, TRUE); } static void DRI2InvalidateDrawable(DrawablePtr pDraw) { DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); DRI2DrawableRefPtr ref; if (!pPriv || !pPriv->needInvalidate) return; pPriv->needInvalidate = FALSE; xorg_list_for_each_entry(ref, &pPriv->reference_list, link) ref->invalidate(pDraw, ref->priv, ref->id); } /* * In the direct rendered case, we throttle the clients that have more * than their share of outstanding swaps (and thus busy buffers) when a * new GetBuffers request is received. In the AIGLX case, we allow the * client to get the new buffers, but throttle when the next GLX request * comes in (see __glXDRIcontextWait()). */ Bool DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw) { DRI2DrawablePtr pPriv; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) return FALSE; /* Throttle to swap limit */ if ((pPriv->swapsPending >= pPriv->swap_limit) && !pPriv->blockedClient) { ResetCurrentRequest(client); client->sequence--; IgnoreClient(client); pPriv->blockedClient = client; return TRUE; } return FALSE; } static void __DRI2BlockClient(ClientPtr client, DRI2DrawablePtr pPriv) { if (pPriv->blockedClient == NULL) { IgnoreClient(client); pPriv->blockedClient = client; } } void DRI2BlockClient(ClientPtr client, DrawablePtr pDraw) { DRI2DrawablePtr pPriv; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) return; __DRI2BlockClient(client, pPriv); 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, void *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) { DRI2DrawablePtr pPriv; DRI2BufferPtr pDestBuffer, pSrcBuffer; int i; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) return BadDrawable; pDestBuffer = NULL; pSrcBuffer = NULL; for (i = 0; i < pPriv->bufferCount; i++) { if (pPriv->buffers[i]->attachment == dest) pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i]; if (pPriv->buffers[i]->attachment == src) pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; } if (pSrcBuffer == NULL || pDestBuffer == NULL) return BadValue; dri2_copy_region(pDraw, pRegion, pDestBuffer, pSrcBuffer); return Success; } /* Can this drawable be page flipped? */ Bool DRI2CanFlip(DrawablePtr pDraw) { ScreenPtr pScreen = pDraw->pScreen; WindowPtr pWin, pRoot; PixmapPtr pWinPixmap, pRootPixmap; if (pDraw->type == DRAWABLE_PIXMAP) return TRUE; pRoot = pScreen->root; pRootPixmap = pScreen->GetWindowPixmap(pRoot); pWin = (WindowPtr) pDraw; pWinPixmap = pScreen->GetWindowPixmap(pWin); if (pRootPixmap != pWinPixmap) return FALSE; if (!RegionEqual(&pWin->clipList, &pRoot->winSize)) return FALSE; /* Does the window match the pixmap exactly? */ if (pDraw->x != 0 || pDraw->y != 0 || #ifdef COMPOSITE pDraw->x != pWinPixmap->screen_x || pDraw->y != pWinPixmap->screen_y || #endif pDraw->width != pWinPixmap->drawable.width || pDraw->height != pWinPixmap->drawable.height) return FALSE; return TRUE; } /* Can we do a pixmap exchange instead of a blit? */ Bool DRI2CanExchange(DrawablePtr pDraw) { return FALSE; } void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame, unsigned int tv_sec, unsigned int tv_usec) { DRI2DrawablePtr pPriv; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) return; ProcDRI2WaitMSCReply(client, ((CARD64) tv_sec * 1000000) + tv_usec, frame, pPriv->swap_count); if (pPriv->blockedClient) AttendClient(pPriv->blockedClient); pPriv->blockedClient = NULL; pPriv->blockedOnMsc = FALSE; } static void DRI2WakeClient(ClientPtr client, DrawablePtr pDraw, int frame, unsigned int tv_sec, unsigned int tv_usec) { ScreenPtr pScreen = pDraw->pScreen; DRI2DrawablePtr pPriv; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] %s: bad drawable\n", __func__); return; } /* * Swap completed. * Wake the client iff: * - it was waiting on SBC * - was blocked due to GLX make current * - was blocked due to swap throttling * - is not blocked due to an MSC wait */ if (pPriv->target_sbc != -1 && pPriv->target_sbc <= pPriv->swap_count) { ProcDRI2WaitMSCReply(client, ((CARD64) tv_sec * 1000000) + tv_usec, frame, pPriv->swap_count); pPriv->target_sbc = -1; AttendClient(pPriv->blockedClient); pPriv->blockedClient = NULL; } else if (pPriv->target_sbc == -1 && !pPriv->blockedOnMsc) { if (pPriv->blockedClient) { AttendClient(pPriv->blockedClient); pPriv->blockedClient = NULL; } } } void DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame, unsigned int tv_sec, unsigned int tv_usec, int type, DRI2SwapEventPtr swap_complete, void *swap_data) { ScreenPtr pScreen = pDraw->pScreen; DRI2DrawablePtr pPriv; CARD64 ust = 0; BoxRec box; RegionRec region; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] %s: bad drawable\n", __func__); return; } pPriv->swapsPending--; pPriv->swap_count++; box.x1 = 0; box.y1 = 0; box.x2 = pDraw->width; box.y2 = pDraw->height; RegionInit(®ion, &box, 0); DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); ust = ((CARD64) tv_sec * 1000000) + tv_usec; if (swap_complete) swap_complete(client, swap_data, type, ust, frame, pPriv->swap_count); pPriv->last_swap_msc = frame; pPriv->last_swap_ust = ust; DRI2WakeClient(client, pDraw, frame, tv_sec, tv_usec); } Bool DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable) { DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable); /* If we're currently waiting for a swap on this drawable, reset * the request and suspend the client. We only support one * blocked client per drawable. */ if (pPriv && pPriv->swapsPending && pPriv->blockedClient == NULL) { ResetCurrentRequest(client); client->sequence--; __DRI2BlockClient(client, pPriv); return TRUE; } return FALSE; } int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, CARD64 divisor, CARD64 remainder, CARD64 * swap_target, DRI2SwapEventPtr func, void *data) { ScreenPtr pScreen = pDraw->pScreen; DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); DRI2DrawablePtr pPriv; DRI2BufferPtr pDestBuffer = NULL, pSrcBuffer = NULL; int ret, i; CARD64 ust, current_msc; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] %s: bad drawable\n", __func__); return BadDrawable; } /* According to spec, return expected swapbuffers count SBC after this swap * will complete. This is ignored unless we return Success, but it must be * initialized on every path where we return Success or the caller will send * an uninitialized value off the stack to the client. So let's initialize * it as early as possible, just to be sure. */ *swap_target = pPriv->swap_count + pPriv->swapsPending + 1; for (i = 0; i < pPriv->bufferCount; i++) { if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft) pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i]; if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft) pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; } if (pSrcBuffer == NULL || pDestBuffer == NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] %s: drawable has no back or front?\n", __func__); return BadDrawable; } /* Old DDX or no swap interval, just blit */ if (!ds->ScheduleSwap || !pPriv->swap_interval || pPriv->prime_id) { BoxRec box; RegionRec region; box.x1 = 0; box.y1 = 0; box.x2 = pDraw->width; box.y2 = pDraw->height; RegionInit(®ion, &box, 0); pPriv->swapsPending++; dri2_copy_region(pDraw, ®ion, pDestBuffer, pSrcBuffer); DRI2SwapComplete(client, pDraw, target_msc, 0, 0, DRI2_BLIT_COMPLETE, func, data); return Success; } /* * In the simple glXSwapBuffers case, all params will be 0, and we just * need to schedule a swap for the last swap target + the swap interval. */ if (target_msc == 0 && divisor == 0 && remainder == 0) { /* If the current vblank count of the drawable's crtc is lower * than the count stored in last_swap_target from a previous swap * then reinitialize last_swap_target to the current crtc's msc, * otherwise the swap will hang. This will happen if the drawable * is moved to a crtc with a lower refresh rate, or a crtc that just * got enabled. */ if (ds->GetMSC) { if (!(*ds->GetMSC) (pDraw, &ust, ¤t_msc)) pPriv->last_swap_target = 0; if (current_msc < pPriv->last_swap_target) pPriv->last_swap_target = current_msc; } /* * Swap target for this swap is last swap target + swap interval since * we have to account for the current swap count, interval, and the * number of pending swaps. */ target_msc = pPriv->last_swap_target + pPriv->swap_interval; } pPriv->swapsPending++; ret = (*ds->ScheduleSwap) (client, pDraw, pDestBuffer, pSrcBuffer, &target_msc, divisor, remainder, func, data); if (!ret) { pPriv->swapsPending--; /* didn't schedule */ xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] %s: driver failed to schedule swap\n", __func__); return BadDrawable; } pPriv->last_swap_target = target_msc; DRI2InvalidateDrawableAll(pDraw); return Success; } void DRI2SwapInterval(DrawablePtr pDrawable, int interval) { ScreenPtr pScreen = pDrawable->pScreen; DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable); if (pPriv == NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] %s: bad drawable\n", __func__); return; } /* fixme: check against arbitrary max? */ pPriv->swap_interval = interval; } int DRI2GetMSC(DrawablePtr pDraw, CARD64 * ust, CARD64 * msc, CARD64 * sbc) { ScreenPtr pScreen = pDraw->pScreen; DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); DRI2DrawablePtr pPriv; Bool ret; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] %s: bad drawable\n", __func__); return BadDrawable; } if (!ds->GetMSC) { *ust = 0; *msc = 0; *sbc = pPriv->swap_count; return Success; } /* * Spec needs to be updated to include unmapped or redirected * drawables */ ret = (*ds->GetMSC) (pDraw, ust, msc); if (!ret) return BadDrawable; *sbc = pPriv->swap_count; return Success; } int DRI2WaitMSC(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, CARD64 divisor, CARD64 remainder) { DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); DRI2DrawablePtr pPriv; Bool ret; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) return BadDrawable; /* Old DDX just completes immediately */ if (!ds->ScheduleWaitMSC) { DRI2WaitMSCComplete(client, pDraw, target_msc, 0, 0); return Success; } ret = (*ds->ScheduleWaitMSC) (client, pDraw, target_msc, divisor, remainder); if (!ret) return BadDrawable; return Success; } int DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc) { DRI2DrawablePtr pPriv; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) return BadDrawable; /* target_sbc == 0 means to block until all pending swaps are * finished. Recalculate target_sbc to get that behaviour. */ if (target_sbc == 0) target_sbc = pPriv->swap_count + pPriv->swapsPending; /* If current swap count already >= target_sbc, reply and * return immediately with (ust, msc, sbc) triplet of * most recent completed swap. */ if (pPriv->swap_count >= target_sbc) { ProcDRI2WaitMSCReply(client, pPriv->last_swap_ust, pPriv->last_swap_msc, pPriv->swap_count); return Success; } pPriv->target_sbc = target_sbc; __DRI2BlockClient(client, pPriv); return Success; } Bool DRI2HasSwapControl(ScreenPtr pScreen) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); return ds->ScheduleSwap && ds->GetMSC; } Bool 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 = DRI2GetScreenPrime(pScreen, prime_id); if (ds == NULL) return FALSE; 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; } static int DRI2AuthMagic (ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); if (ds == NULL) return -EINVAL; return (*ds->LegacyAuthMagic) (ds->fd, magic); } Bool DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds; DRI2ClientPtr dri2_client = dri2ClientPrivate(client); ScreenPtr primescreen; 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; } static int DRI2ConfigNotify(WindowPtr pWin, int x, int y, int w, int h, int bw, WindowPtr pSib) { DrawablePtr pDraw = (DrawablePtr) pWin; ScreenPtr pScreen = pDraw->pScreen; DRI2ScreenPtr ds = DRI2GetScreen(pScreen); DRI2DrawablePtr dd = DRI2GetDrawable(pDraw); int ret; if (ds->ConfigNotify) { pScreen->ConfigNotify = ds->ConfigNotify; ret = (*pScreen->ConfigNotify) (pWin, x, y, w, h, bw, pSib); ds->ConfigNotify = pScreen->ConfigNotify; pScreen->ConfigNotify = DRI2ConfigNotify; if (ret) return ret; } if (!dd || (dd->width == w && dd->height == h)) return Success; DRI2InvalidateDrawable(pDraw); return Success; } static void DRI2SetWindowPixmap(WindowPtr pWin, PixmapPtr pPix) { DrawablePtr pDraw = (DrawablePtr) pWin; ScreenPtr pScreen = pDraw->pScreen; DRI2ScreenPtr ds = DRI2GetScreen(pScreen); pScreen->SetWindowPixmap = ds->SetWindowPixmap; (*pScreen->SetWindowPixmap) (pWin, pPix); ds->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = DRI2SetWindowPixmap; DRI2InvalidateDrawableAll(pDraw); } #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; } #include "pci_ids/pci_id_driver_map.h" static char * dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); struct pci_device *pdev = NULL; int i, j; if (pEnt) pdev = xf86GetPciInfoForEntity(pEnt->index); /* For non-PCI devices, just assume that the 3D driver is named * the same as the kernel driver. This is currently true for vc4 * and msm (freedreno). */ if (!pdev) { drmVersionPtr version = drmGetVersion(info->fd); char *kernel_driver; if (!version) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] Couldn't drmGetVersion() on non-PCI device, " "no driver name found.\n"); return NULL; } kernel_driver = strndup(version->name, version->name_len); drmFreeVersion(version); return kernel_driver; } for (i = 0; driver_map[i].driver; i++) { if (pdev->vendor_id != driver_map[i].vendor_id) continue; if (driver_map[i].num_chips_ids == -1) return strdup(driver_map[i].driver); for (j = 0; j < driver_map[i].num_chips_ids; j++) { if (driver_map[i].chip_ids[j] == pdev->device_id) return strdup(driver_map[i].driver); } } xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] No driver mapping found for PCI device " "0x%04x / 0x%04x\n", pdev->vendor_id, pdev->device_id); return NULL; } Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) { DRI2ScreenPtr ds; const char *driverTypeNames[] = { "DRI", /* DRI2DriverDRI */ "VDPAU", /* DRI2DriverVDPAU */ }; unsigned int i; CARD8 cur_minor; if (info->version < 3) return FALSE; if (!xf86VGAarbiterAllowDRI(pScreen)) { xf86DrvMsg(pScreen->myNum, X_WARNING, "[DRI2] Direct rendering is not supported when VGA arb is necessary for the device\n"); return FALSE; } if (!dixRegisterPrivateKey(&dri2ScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&dri2WindowPrivateKeyRec, PRIVATE_WINDOW, 0)) return FALSE; 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; ds->screen = pScreen; ds->fd = info->fd; ds->deviceName = info->deviceName; dri2_major = 1; ds->CreateBuffer = info->CreateBuffer; ds->DestroyBuffer = info->DestroyBuffer; ds->CopyRegion = info->CopyRegion; if (info->version >= 4) { ds->ScheduleSwap = info->ScheduleSwap; ds->ScheduleWaitMSC = info->ScheduleWaitMSC; ds->GetMSC = info->GetMSC; cur_minor = 3; } else { cur_minor = 1; } if (info->version >= 8) { ds->AuthMagic = info->AuthMagic2; } if (info->version >= 5) { ds->LegacyAuthMagic = info->AuthMagic; } if (info->version >= 6) { ds->ReuseBufferNotify = info->ReuseBufferNotify; 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, call through LegacyAuthMagic */ 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->LegacyAuthMagic = drmAuthMagic; #else goto err_out; #endif } /* Initialize minor if needed and set to minimum provied by DDX */ if (!dri2_minor || dri2_minor > cur_minor) dri2_minor = cur_minor; if (info->version == 3 || info->numDrivers == 0) { /* Driver too old: use the old-style driverName field */ ds->numDrivers = info->driverName ? 1 : 2; ds->driverNames = malloc(ds->numDrivers * sizeof(*ds->driverNames)); if (!ds->driverNames) goto err_out; if (info->driverName) { ds->driverNames[0] = info->driverName; } else { ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info); if (!ds->driverNames[0]) return FALSE; } } else { ds->numDrivers = info->numDrivers; ds->driverNames = malloc(info->numDrivers * sizeof(*ds->driverNames)); if (!ds->driverNames) goto err_out; memcpy(ds->driverNames, info->driverNames, info->numDrivers * sizeof(*ds->driverNames)); } dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, ds); ds->ConfigNotify = pScreen->ConfigNotify; pScreen->ConfigNotify = DRI2ConfigNotify; ds->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = DRI2SetWindowPixmap; xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] Setup complete\n"); for (i = 0; i < sizeof(driverTypeNames) / sizeof(driverTypeNames[0]); i++) { if (i < ds->numDrivers && ds->driverNames[i]) { xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] %s driver: %s\n", driverTypeNames[i], ds->driverNames[i]); } } return TRUE; err_out: xf86DrvMsg(pScreen->myNum, X_WARNING, "[DRI2] Initialization failed for info version %d.\n", info->version); free(ds); return FALSE; } void DRI2CloseScreen(ScreenPtr pScreen) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); pScreen->ConfigNotify = ds->ConfigNotify; pScreen->SetWindowPixmap = ds->SetWindowPixmap; if (ds->prime_id) prime_id_allocate_bitmask &= ~(1 << ds->prime_id); free(ds->driverNames); free(ds); dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL); } /* Called by InitExtensions() */ Bool DRI2ModuleSetup(void) { dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable"); if (!dri2DrawableRes) return FALSE; return TRUE; } void DRI2Version(int *major, int *minor) { if (major != NULL) *major = 1; if (minor != NULL) *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; } xorg-server-1.17.1/hw/xfree86/x86emu/0000775000175100017510000000000012466505444014144 500000000000000xorg-server-1.17.1/hw/xfree86/x86emu/Makefile.am0000664000175100017510000000133212200102654016075 00000000000000if INT10_X86EMU noinst_LTLIBRARIES = libx86emu.la endif libx86emu_la_SOURCES = debug.c \ decode.c \ fpu.c \ ops2.c \ ops.c \ prim_ops.c \ sys.c \ x86emu.h AM_CPPFLAGS = AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = validate.c \ x86emu/debug.h \ x86emu/decode.h \ x86emu/fpu.h \ x86emu/fpu_regs.h \ x86emu/ops.h \ x86emu/prim_asm.h \ x86emu/prim_ops.h \ x86emu/prim_x86_gcc.h \ x86emu/regs.h \ x86emu/types.h \ x86emu/x86emui.h xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/0000775000175100017510000000000012466505444015300 500000000000000xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/fpu.h0000664000175100017510000000474012274325511016160 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for FPU instruction decoding. * ****************************************************************************/ #ifndef __X86EMU_FPU_H #define __X86EMU_FPU_H #ifdef __cplusplus extern "C" { /* Use "C" linkage when in C++ mode */ #endif /* these have to be defined, whether 8087 support compiled in or not. */ extern void x86emuOp_esc_coprocess_d8(u8 op1); extern void x86emuOp_esc_coprocess_d9(u8 op1); extern void x86emuOp_esc_coprocess_da(u8 op1); extern void x86emuOp_esc_coprocess_db(u8 op1); extern void x86emuOp_esc_coprocess_dc(u8 op1); extern void x86emuOp_esc_coprocess_dd(u8 op1); extern void x86emuOp_esc_coprocess_de(u8 op1); extern void x86emuOp_esc_coprocess_df(u8 op1); #ifdef __cplusplus } /* End of "C" linkage for C++ */ #endif #endif /* __X86EMU_FPU_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/fpu_regs.h0000664000175100017510000000731112274325511017175 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for FPU register definitions. * ****************************************************************************/ #ifndef __X86EMU_FPU_REGS_H #define __X86EMU_FPU_REGS_H #ifdef X86_FPU_SUPPORT #ifdef PACK #pragma PACK #endif /* Basic 8087 register can hold any of the following values: */ union x86_fpu_reg_u { s8 tenbytes[10]; double dval; float fval; s16 sval; s32 lval; }; struct x86_fpu_reg { union x86_fpu_reg_u reg; char tag; }; /* * Since we are not going to worry about the problems of aliasing * registers, every time a register is modified, its result type is * set in the tag fields for that register. If some operation * attempts to access the type in a way inconsistent with its current * storage format, then we flag the operation. If common, we'll * attempt the conversion. */ #define X86_FPU_VALID 0x80 #define X86_FPU_REGTYP(r) ((r) & 0x7F) #define X86_FPU_WORD 0x0 #define X86_FPU_SHORT 0x1 #define X86_FPU_LONG 0x2 #define X86_FPU_FLOAT 0x3 #define X86_FPU_DOUBLE 0x4 #define X86_FPU_LDBL 0x5 #define X86_FPU_BSD 0x6 #define X86_FPU_STKTOP 0 struct x86_fpu_registers { struct x86_fpu_reg x86_fpu_stack[8]; int x86_fpu_flags; int x86_fpu_config; /* rounding modes, etc. */ short x86_fpu_tos, x86_fpu_bos; }; #ifdef END_PACK #pragma END_PACK #endif /* * There are two versions of the following macro. * * One version is for opcode D9, for which there are more than 32 * instructions encoded in the second byte of the opcode. * * The other version, deals with all the other 7 i87 opcodes, for * which there are only 32 strings needed to describe the * instructions. */ #endif /* X86_FPU_SUPPORT */ #ifdef DEBUG #define DECODE_PRINTINSTR32(t,mod,rh,rl) \ DECODE_PRINTF(t[(mod<<3)+(rh)]); #define DECODE_PRINTINSTR256(t,mod,rh,rl) \ DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]); #else #define DECODE_PRINTINSTR32(t,mod,rh,rl) #define DECODE_PRINTINSTR256(t,mod,rh,rl) #endif #endif /* __X86EMU_FPU_REGS_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h0000664000175100017510000000603712274325511017657 00000000000000/**************************************************************************** * * Inline helpers for x86emu * * Copyright (C) 2008 Bart Trojanowski, Symbio Technologies, LLC * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: GNU C * Environment: GCC on i386 or x86-64 * Developer: Bart Trojanowski * * Description: This file defines a few x86 macros that can be used by the * emulator to execute native instructions. * * For PIC vs non-PIC code refer to: * http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well * ****************************************************************************/ #ifndef __X86EMU_PRIM_X86_GCC_H #define __X86EMU_PRIM_X86_GCC_H #include "x86emu/types.h" #if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__)) #error This file is intended to be used by gcc on i386 or x86-64 system #endif #if defined(__PIC__) && defined(__i386__) #define X86EMU_HAS_HW_CPUID 1 static inline void hw_cpuid(u32 * a, u32 * b, u32 * c, u32 * d) { __asm__ __volatile__("pushl %%ebx \n\t" "cpuid \n\t" "movl %%ebx, %1 \n\t" "popl %%ebx \n\t":"=a"(*a), "=r"(*b), "=c"(*c), "=d"(*d) :"a"(*a), "c"(*c) :"cc"); } #else /* ! (__PIC__ && __i386__) */ #define x86EMU_HAS_HW_CPUID 1 static inline void hw_cpuid(u32 * a, u32 * b, u32 * c, u32 * d) { __asm__ __volatile__("cpuid":"=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d) :"a"(*a), "c"(*c) :"cc"); } #endif /* __PIC__ && __i386__ */ #endif /* __X86EMU_PRIM_X86_GCC_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/x86emui.h0000664000175100017510000000734312414702051016667 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for system specific functions. These functions * are always compiled and linked in the OS depedent libraries, * and never in a binary portable driver. * ****************************************************************************/ #ifndef __X86EMU_X86EMUI_H #define __X86EMU_X86EMUI_H /* If we are compiling in C++ mode, we can compile some functions as * inline to increase performance (however the code size increases quite * dramatically in this case). */ #if defined(__cplusplus) #define _INLINE inline #else #define _INLINE static #endif /* Get rid of unused parameters in C++ compilation mode */ #ifdef __cplusplus #define X86EMU_UNUSED(v) #else #define X86EMU_UNUSED(v) v #endif #include "x86emu.h" #include "x86emu/regs.h" #include "x86emu/debug.h" #include "x86emu/decode.h" #include "x86emu/ops.h" #include "x86emu/prim_ops.h" #include "x86emu/fpu.h" #include "x86emu/fpu_regs.h" #ifndef NO_SYS_HEADERS #include #include #include /* avoid conflicts with Solaris sys/regset.h */ # if defined(__sun) && defined(CS) # undef CS # undef DS # undef SS # undef ES # undef FS # undef GS # endif #endif /* NO_SYS_HEADERS */ /*--------------------------- Inline Functions ----------------------------*/ #ifdef __cplusplus extern "C" { /* Use "C" linkage when in C++ mode */ #endif extern u8(X86APIP sys_rdb) (u32 addr); extern u16(X86APIP sys_rdw) (u32 addr); extern u32(X86APIP sys_rdl) (u32 addr); extern void (X86APIP sys_wrb) (u32 addr, u8 val); extern void (X86APIP sys_wrw) (u32 addr, u16 val); extern void (X86APIP sys_wrl) (u32 addr, u32 val); extern u8(X86APIP sys_inb) (X86EMU_pioAddr addr); extern u16(X86APIP sys_inw) (X86EMU_pioAddr addr); extern u32(X86APIP sys_inl) (X86EMU_pioAddr addr); extern void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val); extern void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val); extern void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val); #ifdef __cplusplus } /* End of "C" linkage for C++ */ #endif #endif /* __X86EMU_X86EMUI_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/debug.h0000664000175100017510000001711212274325511016451 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for debug definitions. * ****************************************************************************/ #ifndef __X86EMU_DEBUG_H #define __X86EMU_DEBUG_H /*---------------------- Macros and type definitions ----------------------*/ /* checks to be enabled for "runtime" */ #define CHECK_IP_FETCH_F 0x1 #define CHECK_SP_ACCESS_F 0x2 #define CHECK_MEM_ACCESS_F 0x4 /*using regular linear pointer */ #define CHECK_DATA_ACCESS_F 0x8 /*using segment:offset */ #ifdef DEBUG #define CHECK_IP_FETCH() (M.x86.check & CHECK_IP_FETCH_F) #define CHECK_SP_ACCESS() (M.x86.check & CHECK_SP_ACCESS_F) #define CHECK_MEM_ACCESS() (M.x86.check & CHECK_MEM_ACCESS_F) #define CHECK_DATA_ACCESS() (M.x86.check & CHECK_DATA_ACCESS_F) #else #define CHECK_IP_FETCH() #define CHECK_SP_ACCESS() #define CHECK_MEM_ACCESS() #define CHECK_DATA_ACCESS() #endif #ifdef DEBUG #define DEBUG_INSTRUMENT() (M.x86.debug & DEBUG_INSTRUMENT_F) #define DEBUG_DECODE() (M.x86.debug & DEBUG_DECODE_F) #define DEBUG_TRACE() (M.x86.debug & DEBUG_TRACE_F) #define DEBUG_STEP() (M.x86.debug & DEBUG_STEP_F) #define DEBUG_DISASSEMBLE() (M.x86.debug & DEBUG_DISASSEMBLE_F) #define DEBUG_BREAK() (M.x86.debug & DEBUG_BREAK_F) #define DEBUG_SVC() (M.x86.debug & DEBUG_SVC_F) #define DEBUG_SAVE_IP_CS() (M.x86.debug & DEBUG_SAVE_IP_CS_F) #define DEBUG_FS() (M.x86.debug & DEBUG_FS_F) #define DEBUG_PROC() (M.x86.debug & DEBUG_PROC_F) #define DEBUG_SYSINT() (M.x86.debug & DEBUG_SYSINT_F) #define DEBUG_TRACECALL() (M.x86.debug & DEBUG_TRACECALL_F) #define DEBUG_TRACECALLREGS() (M.x86.debug & DEBUG_TRACECALL_REGS_F) #define DEBUG_SYS() (M.x86.debug & DEBUG_SYS_F) #define DEBUG_MEM_TRACE() (M.x86.debug & DEBUG_MEM_TRACE_F) #define DEBUG_IO_TRACE() (M.x86.debug & DEBUG_IO_TRACE_F) #define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F) #else #define DEBUG_INSTRUMENT() 0 #define DEBUG_DECODE() 0 #define DEBUG_TRACE() 0 #define DEBUG_STEP() 0 #define DEBUG_DISASSEMBLE() 0 #define DEBUG_BREAK() 0 #define DEBUG_SVC() 0 #define DEBUG_SAVE_IP_CS() 0 #define DEBUG_FS() 0 #define DEBUG_PROC() 0 #define DEBUG_SYSINT() 0 #define DEBUG_TRACECALL() 0 #define DEBUG_TRACECALLREGS() 0 #define DEBUG_SYS() 0 #define DEBUG_MEM_TRACE() 0 #define DEBUG_IO_TRACE() 0 #define DEBUG_DECODE_NOPRINT() 0 #endif #ifdef DEBUG #define DECODE_PRINTF(x) if (DEBUG_DECODE()) \ x86emu_decode_printf(x) #define DECODE_PRINTF2(x,y) if (DEBUG_DECODE()) \ x86emu_decode_printf2(x,y) /* * The following allow us to look at the bytes of an instruction. The * first INCR_INSTRN_LEN, is called everytime bytes are consumed in * the decoding process. The SAVE_IP_CS is called initially when the * major opcode of the instruction is accessed. */ #define INC_DECODED_INST_LEN(x) \ if (DEBUG_DECODE()) \ x86emu_inc_decoded_inst_len(x) #define SAVE_IP_CS(x,y) \ if (DEBUG_DECODE() | DEBUG_TRACECALL() | DEBUG_BREAK() \ | DEBUG_IO_TRACE() | DEBUG_SAVE_IP_CS()) { \ M.x86.saved_cs = x; \ M.x86.saved_ip = y; \ } #else #define INC_DECODED_INST_LEN(x) #define DECODE_PRINTF(x) #define DECODE_PRINTF2(x,y) #define SAVE_IP_CS(x,y) #endif #ifdef DEBUG #define TRACE_REGS() \ if (DEBUG_DISASSEMBLE()) { \ x86emu_just_disassemble(); \ goto EndOfTheInstructionProcedure; \ } \ if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs() #else #define TRACE_REGS() #endif #ifdef DEBUG #define SINGLE_STEP() if (DEBUG_STEP()) x86emu_single_step() #else #define SINGLE_STEP() #endif #define TRACE_AND_STEP() \ TRACE_REGS(); \ SINGLE_STEP() #ifdef DEBUG #define START_OF_INSTR() #define END_OF_INSTR() EndOfTheInstructionProcedure: x86emu_end_instr(); #define END_OF_INSTR_NO_TRACE() x86emu_end_instr(); #else #define START_OF_INSTR() #define END_OF_INSTR() #define END_OF_INSTR_NO_TRACE() #endif #ifdef DEBUG #define CALL_TRACE(u,v,w,x,s) \ if (DEBUG_TRACECALLREGS()) \ x86emu_dump_regs(); \ if (DEBUG_TRACECALL()) \ printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x); #define RETURN_TRACE(n,u,v) \ if (DEBUG_TRACECALLREGS()) \ x86emu_dump_regs(); \ if (DEBUG_TRACECALL()) \ printk("%04x:%04x: %s\n",u,v,n); #else #define CALL_TRACE(u,v,w,x,s) #define RETURN_TRACE(n,u,v) #endif #ifdef DEBUG #define DB(x) x #else #define DB(x) #endif /*-------------------------- Function Prototypes --------------------------*/ #ifdef __cplusplus extern "C" { /* Use "C" linkage when in C++ mode */ #endif extern void x86emu_inc_decoded_inst_len(int x); extern void x86emu_decode_printf(const char *x); extern void x86emu_decode_printf2(const char *x, int y); extern void x86emu_just_disassemble(void); extern void x86emu_single_step(void); extern void x86emu_end_instr(void); extern void x86emu_dump_regs(void); extern void x86emu_dump_xregs(void); extern void x86emu_print_int_vect(u16 iv); extern void x86emu_instrument_instruction(void); extern void x86emu_check_ip_access(void); extern void x86emu_check_sp_access(void); extern void x86emu_check_mem_access(u32 p); extern void x86emu_check_data_access(uint s, uint o); #ifdef __cplusplus } /* End of "C" linkage for C++ */ #endif #endif /* __X86EMU_DEBUG_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/types.h0000664000175100017510000000503212274325511016525 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for x86 emulator type definitions. * ****************************************************************************/ #ifndef __X86EMU_TYPES_H #define __X86EMU_TYPES_H #ifndef NO_SYS_HEADERS #include #endif /* * The following kludge is an attempt to work around typedef conflicts with * . */ #define u8 x86emuu8 #define u16 x86emuu16 #define u32 x86emuu32 #define u64 x86emuu64 #define s8 x86emus8 #define s16 x86emus16 #define s32 x86emus32 #define s64 x86emus64 #define uint x86emuuint #define sint x86emusint /*---------------------- Macros and type definitions ----------------------*/ #include typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; typedef int8_t s8; typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; typedef unsigned int uint; typedef int sint; typedef u16 X86EMU_pioAddr; #endif /* __X86EMU_TYPES_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/prim_asm.h0000664000175100017510000007147012274325511017201 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: Watcom C++ 10.6 or later * Environment: Any * Developer: Kendall Bennett * * Description: Inline assembler versions of the primitive operand * functions for faster performance. At the moment this is * x86 inline assembler, but these functions could be replaced * with native inline assembler for each supported processor * platform. * ****************************************************************************/ #ifndef __X86EMU_PRIM_ASM_H #define __X86EMU_PRIM_ASM_H #ifdef __WATCOMC__ #ifndef VALIDATE #define __HAVE_INLINE_ASSEMBLER__ #endif u32 get_flags_asm(void); #pragma aux get_flags_asm = \ "pushf" \ "pop eax" \ value [eax] \ modify exact [eax]; u16 aaa_word_asm(u32 * flags, u16 d); #pragma aux aaa_word_asm = \ "push [edi]" \ "popf" \ "aaa" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] \ value [ax] \ modify exact [ax]; u16 aas_word_asm(u32 * flags, u16 d); #pragma aux aas_word_asm = \ "push [edi]" \ "popf" \ "aas" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] \ value [ax] \ modify exact [ax]; u16 aad_word_asm(u32 * flags, u16 d); #pragma aux aad_word_asm = \ "push [edi]" \ "popf" \ "aad" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] \ value [ax] \ modify exact [ax]; u16 aam_word_asm(u32 * flags, u8 d); #pragma aux aam_word_asm = \ "push [edi]" \ "popf" \ "aam" \ "pushf" \ "pop [edi]" \ parm [edi] [al] \ value [ax] \ modify exact [ax]; u8 adc_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux adc_byte_asm = \ "push [edi]" \ "popf" \ "adc al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 adc_word_asm(u32 * flags, u16 d, u16 s); #pragma aux adc_word_asm = \ "push [edi]" \ "popf" \ "adc ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 adc_long_asm(u32 * flags, u32 d, u32 s); #pragma aux adc_long_asm = \ "push [edi]" \ "popf" \ "adc eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; u8 add_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux add_byte_asm = \ "push [edi]" \ "popf" \ "add al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 add_word_asm(u32 * flags, u16 d, u16 s); #pragma aux add_word_asm = \ "push [edi]" \ "popf" \ "add ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 add_long_asm(u32 * flags, u32 d, u32 s); #pragma aux add_long_asm = \ "push [edi]" \ "popf" \ "add eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; u8 and_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux and_byte_asm = \ "push [edi]" \ "popf" \ "and al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 and_word_asm(u32 * flags, u16 d, u16 s); #pragma aux and_word_asm = \ "push [edi]" \ "popf" \ "and ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 and_long_asm(u32 * flags, u32 d, u32 s); #pragma aux and_long_asm = \ "push [edi]" \ "popf" \ "and eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; u8 cmp_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux cmp_byte_asm = \ "push [edi]" \ "popf" \ "cmp al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 cmp_word_asm(u32 * flags, u16 d, u16 s); #pragma aux cmp_word_asm = \ "push [edi]" \ "popf" \ "cmp ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 cmp_long_asm(u32 * flags, u32 d, u32 s); #pragma aux cmp_long_asm = \ "push [edi]" \ "popf" \ "cmp eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; u8 daa_byte_asm(u32 * flags, u8 d); #pragma aux daa_byte_asm = \ "push [edi]" \ "popf" \ "daa" \ "pushf" \ "pop [edi]" \ parm [edi] [al] \ value [al] \ modify exact [al]; u8 das_byte_asm(u32 * flags, u8 d); #pragma aux das_byte_asm = \ "push [edi]" \ "popf" \ "das" \ "pushf" \ "pop [edi]" \ parm [edi] [al] \ value [al] \ modify exact [al]; u8 dec_byte_asm(u32 * flags, u8 d); #pragma aux dec_byte_asm = \ "push [edi]" \ "popf" \ "dec al" \ "pushf" \ "pop [edi]" \ parm [edi] [al] \ value [al] \ modify exact [al]; u16 dec_word_asm(u32 * flags, u16 d); #pragma aux dec_word_asm = \ "push [edi]" \ "popf" \ "dec ax" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] \ value [ax] \ modify exact [ax]; u32 dec_long_asm(u32 * flags, u32 d); #pragma aux dec_long_asm = \ "push [edi]" \ "popf" \ "dec eax" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] \ value [eax] \ modify exact [eax]; u8 inc_byte_asm(u32 * flags, u8 d); #pragma aux inc_byte_asm = \ "push [edi]" \ "popf" \ "inc al" \ "pushf" \ "pop [edi]" \ parm [edi] [al] \ value [al] \ modify exact [al]; u16 inc_word_asm(u32 * flags, u16 d); #pragma aux inc_word_asm = \ "push [edi]" \ "popf" \ "inc ax" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] \ value [ax] \ modify exact [ax]; u32 inc_long_asm(u32 * flags, u32 d); #pragma aux inc_long_asm = \ "push [edi]" \ "popf" \ "inc eax" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] \ value [eax] \ modify exact [eax]; u8 or_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux or_byte_asm = \ "push [edi]" \ "popf" \ "or al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 or_word_asm(u32 * flags, u16 d, u16 s); #pragma aux or_word_asm = \ "push [edi]" \ "popf" \ "or ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 or_long_asm(u32 * flags, u32 d, u32 s); #pragma aux or_long_asm = \ "push [edi]" \ "popf" \ "or eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; u8 neg_byte_asm(u32 * flags, u8 d); #pragma aux neg_byte_asm = \ "push [edi]" \ "popf" \ "neg al" \ "pushf" \ "pop [edi]" \ parm [edi] [al] \ value [al] \ modify exact [al]; u16 neg_word_asm(u32 * flags, u16 d); #pragma aux neg_word_asm = \ "push [edi]" \ "popf" \ "neg ax" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] \ value [ax] \ modify exact [ax]; u32 neg_long_asm(u32 * flags, u32 d); #pragma aux neg_long_asm = \ "push [edi]" \ "popf" \ "neg eax" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] \ value [eax] \ modify exact [eax]; u8 not_byte_asm(u32 * flags, u8 d); #pragma aux not_byte_asm = \ "push [edi]" \ "popf" \ "not al" \ "pushf" \ "pop [edi]" \ parm [edi] [al] \ value [al] \ modify exact [al]; u16 not_word_asm(u32 * flags, u16 d); #pragma aux not_word_asm = \ "push [edi]" \ "popf" \ "not ax" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] \ value [ax] \ modify exact [ax]; u32 not_long_asm(u32 * flags, u32 d); #pragma aux not_long_asm = \ "push [edi]" \ "popf" \ "not eax" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] \ value [eax] \ modify exact [eax]; u8 rcl_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux rcl_byte_asm = \ "push [edi]" \ "popf" \ "rcl al,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [cl] \ value [al] \ modify exact [al cl]; u16 rcl_word_asm(u32 * flags, u16 d, u8 s); #pragma aux rcl_word_asm = \ "push [edi]" \ "popf" \ "rcl ax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [cl] \ value [ax] \ modify exact [ax cl]; u32 rcl_long_asm(u32 * flags, u32 d, u8 s); #pragma aux rcl_long_asm = \ "push [edi]" \ "popf" \ "rcl eax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [cl] \ value [eax] \ modify exact [eax cl]; u8 rcr_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux rcr_byte_asm = \ "push [edi]" \ "popf" \ "rcr al,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [cl] \ value [al] \ modify exact [al cl]; u16 rcr_word_asm(u32 * flags, u16 d, u8 s); #pragma aux rcr_word_asm = \ "push [edi]" \ "popf" \ "rcr ax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [cl] \ value [ax] \ modify exact [ax cl]; u32 rcr_long_asm(u32 * flags, u32 d, u8 s); #pragma aux rcr_long_asm = \ "push [edi]" \ "popf" \ "rcr eax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [cl] \ value [eax] \ modify exact [eax cl]; u8 rol_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux rol_byte_asm = \ "push [edi]" \ "popf" \ "rol al,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [cl] \ value [al] \ modify exact [al cl]; u16 rol_word_asm(u32 * flags, u16 d, u8 s); #pragma aux rol_word_asm = \ "push [edi]" \ "popf" \ "rol ax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [cl] \ value [ax] \ modify exact [ax cl]; u32 rol_long_asm(u32 * flags, u32 d, u8 s); #pragma aux rol_long_asm = \ "push [edi]" \ "popf" \ "rol eax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [cl] \ value [eax] \ modify exact [eax cl]; u8 ror_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux ror_byte_asm = \ "push [edi]" \ "popf" \ "ror al,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [cl] \ value [al] \ modify exact [al cl]; u16 ror_word_asm(u32 * flags, u16 d, u8 s); #pragma aux ror_word_asm = \ "push [edi]" \ "popf" \ "ror ax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [cl] \ value [ax] \ modify exact [ax cl]; u32 ror_long_asm(u32 * flags, u32 d, u8 s); #pragma aux ror_long_asm = \ "push [edi]" \ "popf" \ "ror eax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [cl] \ value [eax] \ modify exact [eax cl]; u8 shl_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux shl_byte_asm = \ "push [edi]" \ "popf" \ "shl al,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [cl] \ value [al] \ modify exact [al cl]; u16 shl_word_asm(u32 * flags, u16 d, u8 s); #pragma aux shl_word_asm = \ "push [edi]" \ "popf" \ "shl ax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [cl] \ value [ax] \ modify exact [ax cl]; u32 shl_long_asm(u32 * flags, u32 d, u8 s); #pragma aux shl_long_asm = \ "push [edi]" \ "popf" \ "shl eax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [cl] \ value [eax] \ modify exact [eax cl]; u8 shr_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux shr_byte_asm = \ "push [edi]" \ "popf" \ "shr al,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [cl] \ value [al] \ modify exact [al cl]; u16 shr_word_asm(u32 * flags, u16 d, u8 s); #pragma aux shr_word_asm = \ "push [edi]" \ "popf" \ "shr ax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [cl] \ value [ax] \ modify exact [ax cl]; u32 shr_long_asm(u32 * flags, u32 d, u8 s); #pragma aux shr_long_asm = \ "push [edi]" \ "popf" \ "shr eax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [cl] \ value [eax] \ modify exact [eax cl]; u8 sar_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux sar_byte_asm = \ "push [edi]" \ "popf" \ "sar al,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [cl] \ value [al] \ modify exact [al cl]; u16 sar_word_asm(u32 * flags, u16 d, u8 s); #pragma aux sar_word_asm = \ "push [edi]" \ "popf" \ "sar ax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [cl] \ value [ax] \ modify exact [ax cl]; u32 sar_long_asm(u32 * flags, u32 d, u8 s); #pragma aux sar_long_asm = \ "push [edi]" \ "popf" \ "sar eax,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [cl] \ value [eax] \ modify exact [eax cl]; u16 shld_word_asm(u32 * flags, u16 d, u16 fill, u8 s); #pragma aux shld_word_asm = \ "push [edi]" \ "popf" \ "shld ax,dx,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [dx] [cl] \ value [ax] \ modify exact [ax dx cl]; u32 shld_long_asm(u32 * flags, u32 d, u32 fill, u8 s); #pragma aux shld_long_asm = \ "push [edi]" \ "popf" \ "shld eax,edx,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [edx] [cl] \ value [eax] \ modify exact [eax edx cl]; u16 shrd_word_asm(u32 * flags, u16 d, u16 fill, u8 s); #pragma aux shrd_word_asm = \ "push [edi]" \ "popf" \ "shrd ax,dx,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [dx] [cl] \ value [ax] \ modify exact [ax dx cl]; u32 shrd_long_asm(u32 * flags, u32 d, u32 fill, u8 s); #pragma aux shrd_long_asm = \ "push [edi]" \ "popf" \ "shrd eax,edx,cl" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [edx] [cl] \ value [eax] \ modify exact [eax edx cl]; u8 sbb_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux sbb_byte_asm = \ "push [edi]" \ "popf" \ "sbb al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 sbb_word_asm(u32 * flags, u16 d, u16 s); #pragma aux sbb_word_asm = \ "push [edi]" \ "popf" \ "sbb ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 sbb_long_asm(u32 * flags, u32 d, u32 s); #pragma aux sbb_long_asm = \ "push [edi]" \ "popf" \ "sbb eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; u8 sub_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux sub_byte_asm = \ "push [edi]" \ "popf" \ "sub al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 sub_word_asm(u32 * flags, u16 d, u16 s); #pragma aux sub_word_asm = \ "push [edi]" \ "popf" \ "sub ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 sub_long_asm(u32 * flags, u32 d, u32 s); #pragma aux sub_long_asm = \ "push [edi]" \ "popf" \ "sub eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; void test_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux test_byte_asm = \ "push [edi]" \ "popf" \ "test al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ modify exact [al bl]; void test_word_asm(u32 * flags, u16 d, u16 s); #pragma aux test_word_asm = \ "push [edi]" \ "popf" \ "test ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ modify exact [ax bx]; void test_long_asm(u32 * flags, u32 d, u32 s); #pragma aux test_long_asm = \ "push [edi]" \ "popf" \ "test eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ modify exact [eax ebx]; u8 xor_byte_asm(u32 * flags, u8 d, u8 s); #pragma aux xor_byte_asm = \ "push [edi]" \ "popf" \ "xor al,bl" \ "pushf" \ "pop [edi]" \ parm [edi] [al] [bl] \ value [al] \ modify exact [al bl]; u16 xor_word_asm(u32 * flags, u16 d, u16 s); #pragma aux xor_word_asm = \ "push [edi]" \ "popf" \ "xor ax,bx" \ "pushf" \ "pop [edi]" \ parm [edi] [ax] [bx] \ value [ax] \ modify exact [ax bx]; u32 xor_long_asm(u32 * flags, u32 d, u32 s); #pragma aux xor_long_asm = \ "push [edi]" \ "popf" \ "xor eax,ebx" \ "pushf" \ "pop [edi]" \ parm [edi] [eax] [ebx] \ value [eax] \ modify exact [eax ebx]; void imul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s); #pragma aux imul_byte_asm = \ "push [edi]" \ "popf" \ "imul bl" \ "pushf" \ "pop [edi]" \ "mov [esi],ax" \ parm [edi] [esi] [al] [bl] \ modify exact [esi ax bl]; void imul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s); #pragma aux imul_word_asm = \ "push [edi]" \ "popf" \ "imul bx" \ "pushf" \ "pop [edi]" \ "mov [esi],ax" \ "mov [ecx],dx" \ parm [edi] [esi] [ecx] [ax] [bx]\ modify exact [esi edi ax bx dx]; void imul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s); #pragma aux imul_long_asm = \ "push [edi]" \ "popf" \ "imul ebx" \ "pushf" \ "pop [edi]" \ "mov [esi],eax" \ "mov [ecx],edx" \ parm [edi] [esi] [ecx] [eax] [ebx] \ modify exact [esi edi eax ebx edx]; void mul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s); #pragma aux mul_byte_asm = \ "push [edi]" \ "popf" \ "mul bl" \ "pushf" \ "pop [edi]" \ "mov [esi],ax" \ parm [edi] [esi] [al] [bl] \ modify exact [esi ax bl]; void mul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s); #pragma aux mul_word_asm = \ "push [edi]" \ "popf" \ "mul bx" \ "pushf" \ "pop [edi]" \ "mov [esi],ax" \ "mov [ecx],dx" \ parm [edi] [esi] [ecx] [ax] [bx]\ modify exact [esi edi ax bx dx]; void mul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s); #pragma aux mul_long_asm = \ "push [edi]" \ "popf" \ "mul ebx" \ "pushf" \ "pop [edi]" \ "mov [esi],eax" \ "mov [ecx],edx" \ parm [edi] [esi] [ecx] [eax] [ebx] \ modify exact [esi edi eax ebx edx]; void idiv_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s); #pragma aux idiv_byte_asm = \ "push [edi]" \ "popf" \ "idiv bl" \ "pushf" \ "pop [edi]" \ "mov [esi],al" \ "mov [ecx],ah" \ parm [edi] [esi] [ecx] [ax] [bl]\ modify exact [esi edi ax bl]; void idiv_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s); #pragma aux idiv_word_asm = \ "push [edi]" \ "popf" \ "idiv bx" \ "pushf" \ "pop [edi]" \ "mov [esi],ax" \ "mov [ecx],dx" \ parm [edi] [esi] [ecx] [ax] [dx] [bx]\ modify exact [esi edi ax dx bx]; void idiv_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s); #pragma aux idiv_long_asm = \ "push [edi]" \ "popf" \ "idiv ebx" \ "pushf" \ "pop [edi]" \ "mov [esi],eax" \ "mov [ecx],edx" \ parm [edi] [esi] [ecx] [eax] [edx] [ebx]\ modify exact [esi edi eax edx ebx]; void div_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s); #pragma aux div_byte_asm = \ "push [edi]" \ "popf" \ "div bl" \ "pushf" \ "pop [edi]" \ "mov [esi],al" \ "mov [ecx],ah" \ parm [edi] [esi] [ecx] [ax] [bl]\ modify exact [esi edi ax bl]; void div_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s); #pragma aux div_word_asm = \ "push [edi]" \ "popf" \ "div bx" \ "pushf" \ "pop [edi]" \ "mov [esi],ax" \ "mov [ecx],dx" \ parm [edi] [esi] [ecx] [ax] [dx] [bx]\ modify exact [esi edi ax dx bx]; void div_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s); #pragma aux div_long_asm = \ "push [edi]" \ "popf" \ "div ebx" \ "pushf" \ "pop [edi]" \ "mov [esi],eax" \ "mov [ecx],edx" \ parm [edi] [esi] [ecx] [eax] [edx] [ebx]\ modify exact [esi edi eax edx ebx]; #endif #endif /* __X86EMU_PRIM_ASM_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/prim_ops.h0000664000175100017510000001120412274325511017207 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for primitive operation functions. * ****************************************************************************/ #ifndef __X86EMU_PRIM_OPS_H #define __X86EMU_PRIM_OPS_H #ifdef __cplusplus extern "C" { /* Use "C" linkage when in C++ mode */ #endif u16 aaa_word(u16 d); u16 aas_word(u16 d); u16 aad_word(u16 d); u16 aam_word(u8 d); u8 adc_byte(u8 d, u8 s); u16 adc_word(u16 d, u16 s); u32 adc_long(u32 d, u32 s); u8 add_byte(u8 d, u8 s); u16 add_word(u16 d, u16 s); u32 add_long(u32 d, u32 s); u8 and_byte(u8 d, u8 s); u16 and_word(u16 d, u16 s); u32 and_long(u32 d, u32 s); u8 cmp_byte(u8 d, u8 s); u16 cmp_word(u16 d, u16 s); u32 cmp_long(u32 d, u32 s); u8 daa_byte(u8 d); u8 das_byte(u8 d); u8 dec_byte(u8 d); u16 dec_word(u16 d); u32 dec_long(u32 d); u8 inc_byte(u8 d); u16 inc_word(u16 d); u32 inc_long(u32 d); u8 or_byte(u8 d, u8 s); u16 or_word(u16 d, u16 s); u32 or_long(u32 d, u32 s); u8 neg_byte(u8 s); u16 neg_word(u16 s); u32 neg_long(u32 s); u8 not_byte(u8 s); u16 not_word(u16 s); u32 not_long(u32 s); u8 rcl_byte(u8 d, u8 s); u16 rcl_word(u16 d, u8 s); u32 rcl_long(u32 d, u8 s); u8 rcr_byte(u8 d, u8 s); u16 rcr_word(u16 d, u8 s); u32 rcr_long(u32 d, u8 s); u8 rol_byte(u8 d, u8 s); u16 rol_word(u16 d, u8 s); u32 rol_long(u32 d, u8 s); u8 ror_byte(u8 d, u8 s); u16 ror_word(u16 d, u8 s); u32 ror_long(u32 d, u8 s); u8 shl_byte(u8 d, u8 s); u16 shl_word(u16 d, u8 s); u32 shl_long(u32 d, u8 s); u8 shr_byte(u8 d, u8 s); u16 shr_word(u16 d, u8 s); u32 shr_long(u32 d, u8 s); u8 sar_byte(u8 d, u8 s); u16 sar_word(u16 d, u8 s); u32 sar_long(u32 d, u8 s); u16 shld_word(u16 d, u16 fill, u8 s); u32 shld_long(u32 d, u32 fill, u8 s); u16 shrd_word(u16 d, u16 fill, u8 s); u32 shrd_long(u32 d, u32 fill, u8 s); u8 sbb_byte(u8 d, u8 s); u16 sbb_word(u16 d, u16 s); u32 sbb_long(u32 d, u32 s); u8 sub_byte(u8 d, u8 s); u16 sub_word(u16 d, u16 s); u32 sub_long(u32 d, u32 s); void test_byte(u8 d, u8 s); void test_word(u16 d, u16 s); void test_long(u32 d, u32 s); u8 xor_byte(u8 d, u8 s); u16 xor_word(u16 d, u16 s); u32 xor_long(u32 d, u32 s); void imul_byte(u8 s); void imul_word(u16 s); void imul_long(u32 s); void imul_long_direct(u32 * res_lo, u32 * res_hi, u32 d, u32 s); void mul_byte(u8 s); void mul_word(u16 s); void mul_long(u32 s); void idiv_byte(u8 s); void idiv_word(u16 s); void idiv_long(u32 s); void div_byte(u8 s); void div_word(u16 s); void div_long(u32 s); void ins(int size); void outs(int size); u16 mem_access_word(int addr); void push_word(u16 w); void push_long(u32 w); u16 pop_word(void); u32 pop_long(void); void cpuid(void); #ifdef __cplusplus } /* End of "C" linkage for C++ */ #endif #endif /* __X86EMU_PRIM_OPS_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/ops.h0000664000175100017510000000362212274325511016165 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for operand decoding functions. * ****************************************************************************/ #ifndef __X86EMU_OPS_H #define __X86EMU_OPS_H extern void (*x86emu_optab[0x100]) (u8 op1); extern void (*x86emu_optab2[0x100]) (u8 op2); #endif /* __X86EMU_OPS_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/decode.h0000664000175100017510000000721412274325511016610 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for instruction decoding logic. * ****************************************************************************/ #ifndef __X86EMU_DECODE_H #define __X86EMU_DECODE_H /*---------------------- Macros and type definitions ----------------------*/ /* Instruction Decoding Stuff */ #define FETCH_DECODE_MODRM(mod,rh,rl) fetch_decode_modrm(&mod,&rh,&rl) #define DECODE_RM_BYTE_REGISTER(r) decode_rm_byte_register(r) #define DECODE_RM_WORD_REGISTER(r) decode_rm_word_register(r) #define DECODE_RM_LONG_REGISTER(r) decode_rm_long_register(r) #define DECODE_CLEAR_SEGOVR() M.x86.mode &= ~SYSMODE_CLRMASK /*-------------------------- Function Prototypes --------------------------*/ #ifdef __cplusplus extern "C" { /* Use "C" linkage when in C++ mode */ #endif void x86emu_intr_raise(u8 type); void fetch_decode_modrm(int *mod, int *regh, int *regl); u8 fetch_byte_imm(void); u16 fetch_word_imm(void); u32 fetch_long_imm(void); u8 fetch_data_byte(uint offset); u8 fetch_data_byte_abs(uint segment, uint offset); u16 fetch_data_word(uint offset); u16 fetch_data_word_abs(uint segment, uint offset); u32 fetch_data_long(uint offset); u32 fetch_data_long_abs(uint segment, uint offset); void store_data_byte(uint offset, u8 val); void store_data_byte_abs(uint segment, uint offset, u8 val); void store_data_word(uint offset, u16 val); void store_data_word_abs(uint segment, uint offset, u16 val); void store_data_long(uint offset, u32 val); void store_data_long_abs(uint segment, uint offset, u32 val); u8 *decode_rm_byte_register(int reg); u16 *decode_rm_word_register(int reg); u32 *decode_rm_long_register(int reg); u16 *decode_rm_seg_register(int reg); u32 decode_rm00_address(int rm); u32 decode_rm01_address(int rm); u32 decode_rm10_address(int rm); u32 decode_sib_address(int sib, int mod); #ifdef __cplusplus } /* End of "C" linkage for C++ */ #endif #endif /* __X86EMU_DECODE_H */ xorg-server-1.17.1/hw/xfree86/x86emu/x86emu/regs.h0000664000175100017510000002435712456571574016352 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for x86 register definitions. * ****************************************************************************/ #ifndef __X86EMU_REGS_H #define __X86EMU_REGS_H #include /*---------------------- Macros and type definitions ----------------------*/ #ifdef PACK #pragma PACK #endif /* * General EAX, EBX, ECX, EDX type registers. Note that for * portability, and speed, the issue of byte swapping is not addressed * in the registers. All registers are stored in the default format * available on the host machine. The only critical issue is that the * registers should line up EXACTLY in the same manner as they do in * the 386. That is: * * EAX & 0xff === AL * EAX & 0xffff == AX * * etc. The result is that alot of the calculations can then be * done using the native instruction set fully. */ #ifdef __BIG_ENDIAN__ typedef struct { u32 e_reg; } I32_reg_t; typedef struct { u16 filler0, x_reg; } I16_reg_t; typedef struct { u8 filler0, filler1, h_reg, l_reg; } I8_reg_t; #else /* !__BIG_ENDIAN__ */ typedef struct { u32 e_reg; } I32_reg_t; typedef struct { u16 x_reg; } I16_reg_t; typedef struct { u8 l_reg, h_reg; } I8_reg_t; #endif /* BIG_ENDIAN */ typedef union { I32_reg_t I32_reg; I16_reg_t I16_reg; I8_reg_t I8_reg; } i386_general_register; struct i386_general_regs { i386_general_register A, B, C, D; }; typedef struct i386_general_regs Gen_reg_t; struct i386_special_regs { i386_general_register SP, BP, SI, DI, IP; u32 FLAGS; }; /* * Segment registers here represent the 16 bit quantities * CS, DS, ES, SS. */ #if defined(__sun) && defined(CS) /* avoid conflicts with Solaris sys/regset.h */ # undef CS # undef DS # undef SS # undef ES # undef FS # undef GS #endif struct i386_segment_regs { u16 CS, DS, SS, ES, FS, GS; }; /* 8 bit registers */ #define R_AH gen.A.I8_reg.h_reg #define R_AL gen.A.I8_reg.l_reg #define R_BH gen.B.I8_reg.h_reg #define R_BL gen.B.I8_reg.l_reg #define R_CH gen.C.I8_reg.h_reg #define R_CL gen.C.I8_reg.l_reg #define R_DH gen.D.I8_reg.h_reg #define R_DL gen.D.I8_reg.l_reg /* 16 bit registers */ #define R_AX gen.A.I16_reg.x_reg #define R_BX gen.B.I16_reg.x_reg #define R_CX gen.C.I16_reg.x_reg #define R_DX gen.D.I16_reg.x_reg /* 32 bit extended registers */ #define R_EAX gen.A.I32_reg.e_reg #define R_EBX gen.B.I32_reg.e_reg #define R_ECX gen.C.I32_reg.e_reg #define R_EDX gen.D.I32_reg.e_reg /* special registers */ #define R_SP spc.SP.I16_reg.x_reg #define R_BP spc.BP.I16_reg.x_reg #define R_SI spc.SI.I16_reg.x_reg #define R_DI spc.DI.I16_reg.x_reg #define R_IP spc.IP.I16_reg.x_reg #define R_FLG spc.FLAGS /* special registers */ #define R_SP spc.SP.I16_reg.x_reg #define R_BP spc.BP.I16_reg.x_reg #define R_SI spc.SI.I16_reg.x_reg #define R_DI spc.DI.I16_reg.x_reg #define R_IP spc.IP.I16_reg.x_reg #define R_FLG spc.FLAGS /* special registers */ #define R_ESP spc.SP.I32_reg.e_reg #define R_EBP spc.BP.I32_reg.e_reg #define R_ESI spc.SI.I32_reg.e_reg #define R_EDI spc.DI.I32_reg.e_reg #define R_EIP spc.IP.I32_reg.e_reg #define R_EFLG spc.FLAGS /* segment registers */ #define R_CS seg.CS #define R_DS seg.DS #define R_SS seg.SS #define R_ES seg.ES #define R_FS seg.FS #define R_GS seg.GS /* flag conditions */ #define FB_CF 0x0001 /* CARRY flag */ #define FB_PF 0x0004 /* PARITY flag */ #define FB_AF 0x0010 /* AUX flag */ #define FB_ZF 0x0040 /* ZERO flag */ #define FB_SF 0x0080 /* SIGN flag */ #define FB_TF 0x0100 /* TRAP flag */ #define FB_IF 0x0200 /* INTERRUPT ENABLE flag */ #define FB_DF 0x0400 /* DIR flag */ #define FB_OF 0x0800 /* OVERFLOW flag */ /* 80286 and above always have bit#1 set */ #define F_ALWAYS_ON (0x0002) /* flag bits always on */ /* * Define a mask for only those flag bits we will ever pass back * (via PUSHF) */ #define F_MSK (FB_CF|FB_PF|FB_AF|FB_ZF|FB_SF|FB_TF|FB_IF|FB_DF|FB_OF) /* following bits masked in to a 16bit quantity */ #define F_CF 0x0001 /* CARRY flag */ #define F_PF 0x0004 /* PARITY flag */ #define F_AF 0x0010 /* AUX flag */ #define F_ZF 0x0040 /* ZERO flag */ #define F_SF 0x0080 /* SIGN flag */ #define F_TF 0x0100 /* TRAP flag */ #define F_IF 0x0200 /* INTERRUPT ENABLE flag */ #define F_DF 0x0400 /* DIR flag */ #define F_OF 0x0800 /* OVERFLOW flag */ #define TOGGLE_FLAG(flag) (M.x86.R_FLG ^= (flag)) #define SET_FLAG(flag) (M.x86.R_FLG |= (flag)) #define CLEAR_FLAG(flag) (M.x86.R_FLG &= ~(flag)) #define ACCESS_FLAG(flag) (M.x86.R_FLG & (flag)) #define CLEARALL_FLAG(m) (M.x86.R_FLG = 0) #define CONDITIONAL_SET_FLAG(COND,FLAG) \ if (COND) SET_FLAG(FLAG); else CLEAR_FLAG(FLAG) #define F_PF_CALC 0x010000 /* PARITY flag has been calced */ #define F_ZF_CALC 0x020000 /* ZERO flag has been calced */ #define F_SF_CALC 0x040000 /* SIGN flag has been calced */ #define F_ALL_CALC 0xff0000 /* All have been calced */ /* * Emulator machine state. * Segment usage control. */ #define SYSMODE_SEG_DS_SS 0x00000001 #define SYSMODE_SEGOVR_CS 0x00000002 #define SYSMODE_SEGOVR_DS 0x00000004 #define SYSMODE_SEGOVR_ES 0x00000008 #define SYSMODE_SEGOVR_FS 0x00000010 #define SYSMODE_SEGOVR_GS 0x00000020 #define SYSMODE_SEGOVR_SS 0x00000040 #define SYSMODE_PREFIX_REPE 0x00000080 #define SYSMODE_PREFIX_REPNE 0x00000100 #define SYSMODE_PREFIX_DATA 0x00000200 #define SYSMODE_PREFIX_ADDR 0x00000400 #define SYSMODE_INTR_PENDING 0x10000000 #define SYSMODE_EXTRN_INTR 0x20000000 #define SYSMODE_HALTED 0x40000000 #define SYSMODE_SEGMASK (SYSMODE_SEG_DS_SS | \ SYSMODE_SEGOVR_CS | \ SYSMODE_SEGOVR_DS | \ SYSMODE_SEGOVR_ES | \ SYSMODE_SEGOVR_FS | \ SYSMODE_SEGOVR_GS | \ SYSMODE_SEGOVR_SS) #define SYSMODE_CLRMASK (SYSMODE_SEG_DS_SS | \ SYSMODE_SEGOVR_CS | \ SYSMODE_SEGOVR_DS | \ SYSMODE_SEGOVR_ES | \ SYSMODE_SEGOVR_FS | \ SYSMODE_SEGOVR_GS | \ SYSMODE_SEGOVR_SS | \ SYSMODE_PREFIX_DATA | \ SYSMODE_PREFIX_ADDR) #define INTR_SYNCH 0x1 #define INTR_ASYNCH 0x2 #define INTR_HALTED 0x4 typedef struct { struct i386_general_regs gen; struct i386_special_regs spc; struct i386_segment_regs seg; /* * MODE contains information on: * REPE prefix 2 bits repe,repne * SEGMENT overrides 5 bits normal,DS,SS,CS,ES * Delayed flag set 3 bits (zero, signed, parity) * reserved 6 bits * interrupt # 8 bits instruction raised interrupt * BIOS video segregs 4 bits * Interrupt Pending 1 bits * Extern interrupt 1 bits * Halted 1 bits */ u32 mode; volatile int intr; /* mask of pending interrupts */ int debug; #ifdef DEBUG int check; u16 saved_ip; u16 saved_cs; int enc_pos; int enc_str_pos; char decode_buf[32]; /* encoded byte stream */ char decoded_buf[256]; /* disassembled strings */ #endif u8 intno; u8 __pad[3]; } X86EMU_regs; /**************************************************************************** REMARKS: Structure maintaining the emulator machine state. MEMBERS: mem_base - Base real mode memory for the emulator mem_size - Size of the real mode memory block for the emulator private - private data pointer x86 - X86 registers ****************************************************************************/ typedef struct { unsigned long mem_base; unsigned long mem_size; void *private; X86EMU_regs x86; } X86EMU_sysEnv; #ifdef END_PACK #pragma END_PACK #endif /*----------------------------- Global Variables --------------------------*/ #ifdef __cplusplus extern "C" { /* Use "C" linkage when in C++ mode */ #endif /* Global emulator machine state. * * We keep it global to avoid pointer dereferences in the code for speed. */ extern X86EMU_sysEnv _X86EMU_env; #define M _X86EMU_env /*-------------------------- Function Prototypes --------------------------*/ /* Function to log information at runtime */ void printk(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1, 2); #ifdef __cplusplus } /* End of "C" linkage for C++ */ #endif #endif /* __X86EMU_REGS_H */ xorg-server-1.17.1/hw/xfree86/x86emu/debug.c0000664000175100017510000003030012456571574015320 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: This file contains the code to handle debugging of the * emulator. * ****************************************************************************/ #include "x86emu/x86emui.h" #include #include #ifndef NO_SYS_HEADERS #include #include #endif /*----------------------------- Implementation ----------------------------*/ #ifdef DEBUG static void print_encoded_bytes(u16 s, u16 o); static void print_decoded_instruction(void); static int parse_line(char *s, int *ps, int *n); /* should look something like debug's output. */ void X86EMU_trace_regs(void) { if (DEBUG_TRACE()) { x86emu_dump_regs(); } if (DEBUG_DECODE() && !DEBUG_DECODE_NOPRINT()) { printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip); print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip); print_decoded_instruction(); } } void X86EMU_trace_xregs(void) { if (DEBUG_TRACE()) { x86emu_dump_xregs(); } } void x86emu_just_disassemble(void) { /* * This routine called if the flag DEBUG_DISASSEMBLE is set kind * of a hack! */ printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip); print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip); print_decoded_instruction(); } static void disassemble_forward(u16 seg, u16 off, int n) { X86EMU_sysEnv tregs; int i; u8 op1; /* * hack, hack, hack. What we do is use the exact machinery set up * for execution, except that now there is an additional state * flag associated with the "execution", and we are using a copy * of the register struct. All the major opcodes, once fully * decoded, have the following two steps: TRACE_REGS(r,m); * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to * the preprocessor. The TRACE_REGS macro expands to: * * if (debug&DEBUG_DISASSEMBLE) * {just_disassemble(); goto EndOfInstruction;} * if (debug&DEBUG_TRACE) trace_regs(r,m); * * ...... and at the last line of the routine. * * EndOfInstruction: end_instr(); * * Up to the point where TRACE_REG is expanded, NO modifications * are done to any register EXCEPT the IP register, for fetch and * decoding purposes. * * This was done for an entirely different reason, but makes a * nice way to get the system to help debug codes. */ tregs = M; tregs.x86.R_IP = off; tregs.x86.R_CS = seg; /* reset the decoding buffers */ tregs.x86.enc_str_pos = 0; tregs.x86.enc_pos = 0; /* turn on the "disassemble only, no execute" flag */ tregs.x86.debug |= DEBUG_DISASSEMBLE_F; /* DUMP NEXT n instructions to screen in straight_line fashion */ /* * This looks like the regular instruction fetch stream, except * that when this occurs, each fetched opcode, upon seeing the * DEBUG_DISASSEMBLE flag set, exits immediately after decoding * the instruction. XXX --- CHECK THAT MEM IS NOT AFFECTED!!! * Note the use of a copy of the register structure... */ for (i = 0; i < n; i++) { op1 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++)); (x86emu_optab[op1]) (op1); } /* end major hack mode. */ } void x86emu_check_ip_access(void) { /* NULL as of now */ } void x86emu_check_sp_access(void) { } void x86emu_check_mem_access(u32 dummy) { /* check bounds, etc */ } void x86emu_check_data_access(uint dummy1, uint dummy2) { /* check bounds, etc */ } void x86emu_inc_decoded_inst_len(int x) { M.x86.enc_pos += x; } void x86emu_decode_printf(const char *x) { sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", x); M.x86.enc_str_pos += strlen(x); } void x86emu_decode_printf2(const char *x, int y) { char temp[100]; snprintf(temp, sizeof(temp), x, y); sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", temp); M.x86.enc_str_pos += strlen(temp); } void x86emu_end_instr(void) { M.x86.enc_str_pos = 0; M.x86.enc_pos = 0; } static void print_encoded_bytes(u16 s, u16 o) { int i; char buf1[64]; for (i = 0; i < M.x86.enc_pos; i++) { sprintf(buf1 + 2 * i, "%02x", fetch_data_byte_abs(s, o + i)); } printk("%-20s", buf1); } static void print_decoded_instruction(void) { printk("%s", M.x86.decoded_buf); } void x86emu_print_int_vect(u16 iv) { u16 seg, off; if (iv > 256) return; seg = fetch_data_word_abs(0, iv * 4); off = fetch_data_word_abs(0, iv * 4 + 2); printk("%04x:%04x ", seg, off); } void X86EMU_dump_memory(u16 seg, u16 off, u32 amt) { u32 start = off & 0xfffffff0; u32 end = (off + 16) & 0xfffffff0; u32 i; u32 current; current = start; while (end <= off + amt) { printk("%04x:%04x ", seg, start); for (i = start; i < off; i++) printk(" "); for (; i < end; i++) printk("%02x ", fetch_data_byte_abs(seg, i)); printk("\n"); start = end; end = start + 16; } } void x86emu_single_step(void) { char s[1024]; int ps[10]; int ntok; int cmd; int done; int segment; int offset; static int breakpoint; static int noDecode = 1; char *p; if (DEBUG_BREAK()) { if (M.x86.saved_ip != breakpoint) { return; } else { M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F; M.x86.debug |= DEBUG_TRACE_F; M.x86.debug &= ~DEBUG_BREAK_F; print_decoded_instruction(); X86EMU_trace_regs(); } } done = 0; offset = M.x86.saved_ip; while (!done) { printk("-"); p = fgets(s, 1023, stdin); cmd = parse_line(s, ps, &ntok); switch (cmd) { case 'u': disassemble_forward(M.x86.saved_cs, (u16) offset, 10); break; case 'd': if (ntok == 2) { segment = M.x86.saved_cs; offset = ps[1]; X86EMU_dump_memory(segment, (u16) offset, 16); offset += 16; } else if (ntok == 3) { segment = ps[1]; offset = ps[2]; X86EMU_dump_memory(segment, (u16) offset, 16); offset += 16; } else { segment = M.x86.saved_cs; X86EMU_dump_memory(segment, (u16) offset, 16); offset += 16; } break; case 'c': M.x86.debug ^= DEBUG_TRACECALL_F; break; case 's': M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F; break; case 'r': X86EMU_trace_regs(); break; case 'x': X86EMU_trace_xregs(); break; case 'g': if (ntok == 2) { breakpoint = ps[1]; if (noDecode) { M.x86.debug |= DEBUG_DECODE_NOPRINT_F; } else { M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F; } M.x86.debug &= ~DEBUG_TRACE_F; M.x86.debug |= DEBUG_BREAK_F; done = 1; } break; case 'q': M.x86.debug |= DEBUG_EXIT; return; case 'P': noDecode = (noDecode) ? 0 : 1; printk("Toggled decoding to %s\n", (noDecode) ? "FALSE" : "TRUE"); break; case 't': case 0: done = 1; break; } } } int X86EMU_trace_on(void) { return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F; } int X86EMU_trace_off(void) { return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F); } static int parse_line(char *s, int *ps, int *n) { int cmd; *n = 0; while (*s == ' ' || *s == '\t') s++; ps[*n] = *s; switch (*s) { case '\n': *n += 1; return 0; default: cmd = *s; *n += 1; } while (1) { while (*s != ' ' && *s != '\t' && *s != '\n') s++; if (*s == '\n') return cmd; while (*s == ' ' || *s == '\t') s++; sscanf(s, "%x", &ps[*n]); *n += 1; } } #endif /* DEBUG */ void x86emu_dump_regs(void) { printk("\tAX=%04x ", M.x86.R_AX); printk("BX=%04x ", M.x86.R_BX); printk("CX=%04x ", M.x86.R_CX); printk("DX=%04x ", M.x86.R_DX); printk("SP=%04x ", M.x86.R_SP); printk("BP=%04x ", M.x86.R_BP); printk("SI=%04x ", M.x86.R_SI); printk("DI=%04x\n", M.x86.R_DI); printk("\tDS=%04x ", M.x86.R_DS); printk("ES=%04x ", M.x86.R_ES); printk("SS=%04x ", M.x86.R_SS); printk("CS=%04x ", M.x86.R_CS); printk("IP=%04x ", M.x86.R_IP); if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */ else printk("NV "); if (ACCESS_FLAG(F_DF)) printk("DN "); else printk("UP "); if (ACCESS_FLAG(F_IF)) printk("EI "); else printk("DI "); if (ACCESS_FLAG(F_SF)) printk("NG "); else printk("PL "); if (ACCESS_FLAG(F_ZF)) printk("ZR "); else printk("NZ "); if (ACCESS_FLAG(F_AF)) printk("AC "); else printk("NA "); if (ACCESS_FLAG(F_PF)) printk("PE "); else printk("PO "); if (ACCESS_FLAG(F_CF)) printk("CY "); else printk("NC "); printk("\n"); } void x86emu_dump_xregs(void) { printk("\tEAX=%08x ", M.x86.R_EAX); printk("EBX=%08x ", M.x86.R_EBX); printk("ECX=%08x ", M.x86.R_ECX); printk("EDX=%08x \n", M.x86.R_EDX); printk("\tESP=%08x ", M.x86.R_ESP); printk("EBP=%08x ", M.x86.R_EBP); printk("ESI=%08x ", M.x86.R_ESI); printk("EDI=%08x\n", M.x86.R_EDI); printk("\tDS=%04x ", M.x86.R_DS); printk("ES=%04x ", M.x86.R_ES); printk("SS=%04x ", M.x86.R_SS); printk("CS=%04x ", M.x86.R_CS); printk("EIP=%08x\n\t", M.x86.R_EIP); if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */ else printk("NV "); if (ACCESS_FLAG(F_DF)) printk("DN "); else printk("UP "); if (ACCESS_FLAG(F_IF)) printk("EI "); else printk("DI "); if (ACCESS_FLAG(F_SF)) printk("NG "); else printk("PL "); if (ACCESS_FLAG(F_ZF)) printk("ZR "); else printk("NZ "); if (ACCESS_FLAG(F_AF)) printk("AC "); else printk("NA "); if (ACCESS_FLAG(F_PF)) printk("PE "); else printk("PO "); if (ACCESS_FLAG(F_CF)) printk("CY "); else printk("NC "); printk("\n"); } xorg-server-1.17.1/hw/xfree86/x86emu/ops.c0000664000175100017510000127615412456571574015057 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: This file includes subroutines to implement the decoding * and emulation of all the x86 processor instructions. * * There are approximately 250 subroutines in here, which correspond * to the 256 byte-"opcodes" found on the 8086. The table which * dispatches this is found in the files optab.[ch]. * * Each opcode proc has a comment preceeding it which gives it's table * address. Several opcodes are missing (undefined) in the table. * * Each proc includes information for decoding (DECODE_PRINTF and * DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc * functions (START_OF_INSTR, END_OF_INSTR). * * Many of the procedures are *VERY* similar in coding. This has * allowed for a very large amount of code to be generated in a fairly * short amount of time (i.e. cut, paste, and modify). The result is * that much of the code below could have been folded into subroutines * for a large reduction in size of this file. The downside would be * that there would be a penalty in execution speed. The file could * also have been *MUCH* larger by inlining certain functions which * were called. This could have resulted even faster execution. The * prime directive I used to decide whether to inline the code or to * modularize it, was basically: 1) no unnecessary subroutine calls, * 2) no routines more than about 200 lines in size, and 3) modularize * any code that I might not get right the first time. The fetch_* * subroutines fall into the latter category. The The decode_* fall * into the second category. The coding of the "switch(mod){ .... }" * in many of the subroutines below falls into the first category. * Especially, the coding of {add,and,or,sub,...}_{byte,word} * subroutines are an especially glaring case of the third guideline. * Since so much of the code is cloned from other modules (compare * opcode #00 to opcode #01), making the basic operations subroutine * calls is especially important; otherwise mistakes in coding an * "add" would represent a nightmare in maintenance. * ****************************************************************************/ #include "x86emu/x86emui.h" /*----------------------------- Implementation ----------------------------*/ /**************************************************************************** PARAMETERS: op1 - Instruction op code REMARKS: Handles illegal opcodes. ****************************************************************************/ static void x86emuOp_illegal_op(u8 op1) { START_OF_INSTR(); if (M.x86.R_SP != 0) { DECODE_PRINTF("ILLEGAL X86 OPCODE\n"); TRACE_REGS(); DB(printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n", M.x86.R_CS, M.x86.R_IP - 1, op1)); HALT_SYS(); } else { /* If we get here, it means the stack pointer is back to zero * so we are just returning from an emulator service call * so therte is no need to display an error message. We trap * the emulator with an 0xF1 opcode to finish the service * call. */ X86EMU_halt_sys(); } END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x00 ****************************************************************************/ static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; u8 *destreg, *srcreg; u8 destval; START_OF_INSTR(); DECODE_PRINTF("ADD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x01 ****************************************************************************/ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("ADD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = add_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x02 ****************************************************************************/ static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("ADD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x03 ****************************************************************************/ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("ADD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_word(*destreg, srcval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = add_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x04 ****************************************************************************/ static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("ADD\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); M.x86.R_AL = add_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x05 ****************************************************************************/ static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("ADD\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("ADD\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = add_long(M.x86.R_EAX, srcval); } else { M.x86.R_AX = add_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x06 ****************************************************************************/ static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("PUSH\tES\n"); TRACE_AND_STEP(); push_word(M.x86.R_ES); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x07 ****************************************************************************/ static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("POP\tES\n"); TRACE_AND_STEP(); M.x86.R_ES = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x08 ****************************************************************************/ static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; START_OF_INSTR(); DECODE_PRINTF("OR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x09 ****************************************************************************/ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("OR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = or_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0a ****************************************************************************/ static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("OR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0b ****************************************************************************/ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("OR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_word(*destreg, srcval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = or_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0c ****************************************************************************/ static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("OR\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); M.x86.R_AL = or_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0d ****************************************************************************/ static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("OR\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("OR\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = or_long(M.x86.R_EAX, srcval); } else { M.x86.R_AX = or_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0e ****************************************************************************/ static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("PUSH\tCS\n"); TRACE_AND_STEP(); push_word(M.x86.R_CS); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f. Escape for two-byte opcode (286 or better) ****************************************************************************/ static void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1)) { u8 op2 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++)); INC_DECODED_INST_LEN(1); (*x86emu_optab2[op2]) (op2); } /**************************************************************************** REMARKS: Handles opcode 0x10 ****************************************************************************/ static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; START_OF_INSTR(); DECODE_PRINTF("ADC\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x11 ****************************************************************************/ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("ADC\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = adc_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x12 ****************************************************************************/ static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("ADC\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x13 ****************************************************************************/ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("ADC\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_word(*destreg, srcval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = adc_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x14 ****************************************************************************/ static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("ADC\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); M.x86.R_AL = adc_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x15 ****************************************************************************/ static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("ADC\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("ADC\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval); } else { M.x86.R_AX = adc_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x16 ****************************************************************************/ static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("PUSH\tSS\n"); TRACE_AND_STEP(); push_word(M.x86.R_SS); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x17 ****************************************************************************/ static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("POP\tSS\n"); TRACE_AND_STEP(); M.x86.R_SS = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x18 ****************************************************************************/ static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; START_OF_INSTR(); DECODE_PRINTF("SBB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x19 ****************************************************************************/ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("SBB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sbb_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x1a ****************************************************************************/ static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("SBB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x1b ****************************************************************************/ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("SBB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_word(*destreg, srcval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sbb_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x1c ****************************************************************************/ static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("SBB\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); M.x86.R_AL = sbb_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x1d ****************************************************************************/ static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("SBB\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("SBB\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval); } else { M.x86.R_AX = sbb_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x1e ****************************************************************************/ static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("PUSH\tDS\n"); TRACE_AND_STEP(); push_word(M.x86.R_DS); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x1f ****************************************************************************/ static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("POP\tDS\n"); TRACE_AND_STEP(); M.x86.R_DS = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x20 ****************************************************************************/ static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; START_OF_INSTR(); DECODE_PRINTF("AND\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x21 ****************************************************************************/ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("AND\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = and_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x22 ****************************************************************************/ static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("AND\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x23 ****************************************************************************/ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("AND\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_long(*destreg, srcval); break; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_word(*destreg, srcval); break; } case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = and_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x24 ****************************************************************************/ static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("AND\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); M.x86.R_AL = and_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x25 ****************************************************************************/ static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("AND\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("AND\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = and_long(M.x86.R_EAX, srcval); } else { M.x86.R_AX = and_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x26 ****************************************************************************/ static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("ES:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_SEGOVR_ES; /* * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4 * opcode subroutines we do not want to do this. */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x27 ****************************************************************************/ static void x86emuOp_daa(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("DAA\n"); TRACE_AND_STEP(); M.x86.R_AL = daa_byte(M.x86.R_AL); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x28 ****************************************************************************/ static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; START_OF_INSTR(); DECODE_PRINTF("SUB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x29 ****************************************************************************/ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("SUB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = sub_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x2a ****************************************************************************/ static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("SUB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x2b ****************************************************************************/ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("SUB\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_word(*destreg, srcval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = sub_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x2c ****************************************************************************/ static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("SUB\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); M.x86.R_AL = sub_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x2d ****************************************************************************/ static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("SUB\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("SUB\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval); } else { M.x86.R_AX = sub_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x2e ****************************************************************************/ static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("CS:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_SEGOVR_CS; /* note no DECODE_CLEAR_SEGOVR here. */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x2f ****************************************************************************/ static void x86emuOp_das(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("DAS\n"); TRACE_AND_STEP(); M.x86.R_AL = das_byte(M.x86.R_AL); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x30 ****************************************************************************/ static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; START_OF_INSTR(); DECODE_PRINTF("XOR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_byte(destval, *srcreg); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x31 ****************************************************************************/ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("XOR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_long(destval, *srcreg); store_data_long(destoffset, destval); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = xor_word(destval, *srcreg); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x32 ****************************************************************************/ static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("XOR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x33 ****************************************************************************/ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("XOR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_word(*destreg, srcval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = xor_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x34 ****************************************************************************/ static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("XOR\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); M.x86.R_AL = xor_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x35 ****************************************************************************/ static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XOR\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("XOR\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval); } else { M.x86.R_AX = xor_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x36 ****************************************************************************/ static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("SS:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_SEGOVR_SS; /* no DECODE_CLEAR_SEGOVR ! */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x37 ****************************************************************************/ static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("AAA\n"); TRACE_AND_STEP(); M.x86.R_AX = aaa_word(M.x86.R_AX); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x38 ****************************************************************************/ static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; u8 *destreg, *srcreg; u8 destval; START_OF_INSTR(); DECODE_PRINTF("CMP\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(destval, *srcreg); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(destval, *srcreg); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(destval, *srcreg); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x39 ****************************************************************************/ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("CMP\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(destval, *srcreg); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(destval, *srcreg); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(destval, *srcreg); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(destval, *srcreg); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(destval, *srcreg); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(destval, *srcreg); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x3a ****************************************************************************/ static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("CMP\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(*destreg, srcval); break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(*destreg, srcval); break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(*destreg, srcval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x3b ****************************************************************************/ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("CMP\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(*destreg, srcval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(*destreg, srcval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(*destreg, srcval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); cmp_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x3c ****************************************************************************/ static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 srcval; START_OF_INSTR(); DECODE_PRINTF("CMP\tAL,"); srcval = fetch_byte_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); cmp_byte(M.x86.R_AL, srcval); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x3d ****************************************************************************/ static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("CMP\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("CMP\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { cmp_long(M.x86.R_EAX, srcval); } else { cmp_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x3e ****************************************************************************/ static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("DS:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_SEGOVR_DS; /* NO DECODE_CLEAR_SEGOVR! */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x3f ****************************************************************************/ static void x86emuOp_aas(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("AAS\n"); TRACE_AND_STEP(); M.x86.R_AX = aas_word(M.x86.R_AX); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x40 ****************************************************************************/ static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tEAX\n"); } else { DECODE_PRINTF("INC\tAX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = inc_long(M.x86.R_EAX); } else { M.x86.R_AX = inc_word(M.x86.R_AX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x41 ****************************************************************************/ static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tECX\n"); } else { DECODE_PRINTF("INC\tCX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ECX = inc_long(M.x86.R_ECX); } else { M.x86.R_CX = inc_word(M.x86.R_CX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x42 ****************************************************************************/ static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tEDX\n"); } else { DECODE_PRINTF("INC\tDX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDX = inc_long(M.x86.R_EDX); } else { M.x86.R_DX = inc_word(M.x86.R_DX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x43 ****************************************************************************/ static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tEBX\n"); } else { DECODE_PRINTF("INC\tBX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBX = inc_long(M.x86.R_EBX); } else { M.x86.R_BX = inc_word(M.x86.R_BX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x44 ****************************************************************************/ static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tESP\n"); } else { DECODE_PRINTF("INC\tSP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESP = inc_long(M.x86.R_ESP); } else { M.x86.R_SP = inc_word(M.x86.R_SP); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x45 ****************************************************************************/ static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tEBP\n"); } else { DECODE_PRINTF("INC\tBP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBP = inc_long(M.x86.R_EBP); } else { M.x86.R_BP = inc_word(M.x86.R_BP); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x46 ****************************************************************************/ static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tESI\n"); } else { DECODE_PRINTF("INC\tSI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESI = inc_long(M.x86.R_ESI); } else { M.x86.R_SI = inc_word(M.x86.R_SI); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x47 ****************************************************************************/ static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tEDI\n"); } else { DECODE_PRINTF("INC\tDI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDI = inc_long(M.x86.R_EDI); } else { M.x86.R_DI = inc_word(M.x86.R_DI); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x48 ****************************************************************************/ static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tEAX\n"); } else { DECODE_PRINTF("DEC\tAX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = dec_long(M.x86.R_EAX); } else { M.x86.R_AX = dec_word(M.x86.R_AX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x49 ****************************************************************************/ static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tECX\n"); } else { DECODE_PRINTF("DEC\tCX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ECX = dec_long(M.x86.R_ECX); } else { M.x86.R_CX = dec_word(M.x86.R_CX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x4a ****************************************************************************/ static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tEDX\n"); } else { DECODE_PRINTF("DEC\tDX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDX = dec_long(M.x86.R_EDX); } else { M.x86.R_DX = dec_word(M.x86.R_DX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x4b ****************************************************************************/ static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tEBX\n"); } else { DECODE_PRINTF("DEC\tBX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBX = dec_long(M.x86.R_EBX); } else { M.x86.R_BX = dec_word(M.x86.R_BX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x4c ****************************************************************************/ static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tESP\n"); } else { DECODE_PRINTF("DEC\tSP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESP = dec_long(M.x86.R_ESP); } else { M.x86.R_SP = dec_word(M.x86.R_SP); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x4d ****************************************************************************/ static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tEBP\n"); } else { DECODE_PRINTF("DEC\tBP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBP = dec_long(M.x86.R_EBP); } else { M.x86.R_BP = dec_word(M.x86.R_BP); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x4e ****************************************************************************/ static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tESI\n"); } else { DECODE_PRINTF("DEC\tSI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESI = dec_long(M.x86.R_ESI); } else { M.x86.R_SI = dec_word(M.x86.R_SI); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x4f ****************************************************************************/ static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tEDI\n"); } else { DECODE_PRINTF("DEC\tDI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDI = dec_long(M.x86.R_EDI); } else { M.x86.R_DI = dec_word(M.x86.R_DI); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x50 ****************************************************************************/ static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tEAX\n"); } else { DECODE_PRINTF("PUSH\tAX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_EAX); } else { push_word(M.x86.R_AX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x51 ****************************************************************************/ static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tECX\n"); } else { DECODE_PRINTF("PUSH\tCX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_ECX); } else { push_word(M.x86.R_CX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x52 ****************************************************************************/ static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tEDX\n"); } else { DECODE_PRINTF("PUSH\tDX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_EDX); } else { push_word(M.x86.R_DX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x53 ****************************************************************************/ static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tEBX\n"); } else { DECODE_PRINTF("PUSH\tBX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_EBX); } else { push_word(M.x86.R_BX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x54 ****************************************************************************/ static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tESP\n"); } else { DECODE_PRINTF("PUSH\tSP\n"); } TRACE_AND_STEP(); /* Always push (E)SP, since we are emulating an i386 and above * processor. This is necessary as some BIOS'es use this to check * what type of processor is in the system. */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_ESP); } else { push_word((u16) (M.x86.R_SP)); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x55 ****************************************************************************/ static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tEBP\n"); } else { DECODE_PRINTF("PUSH\tBP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_EBP); } else { push_word(M.x86.R_BP); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x56 ****************************************************************************/ static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tESI\n"); } else { DECODE_PRINTF("PUSH\tSI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_ESI); } else { push_word(M.x86.R_SI); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x57 ****************************************************************************/ static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSH\tEDI\n"); } else { DECODE_PRINTF("PUSH\tDI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_EDI); } else { push_word(M.x86.R_DI); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x58 ****************************************************************************/ static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tEAX\n"); } else { DECODE_PRINTF("POP\tAX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = pop_long(); } else { M.x86.R_AX = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x59 ****************************************************************************/ static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tECX\n"); } else { DECODE_PRINTF("POP\tCX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ECX = pop_long(); } else { M.x86.R_CX = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x5a ****************************************************************************/ static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tEDX\n"); } else { DECODE_PRINTF("POP\tDX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDX = pop_long(); } else { M.x86.R_DX = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x5b ****************************************************************************/ static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tEBX\n"); } else { DECODE_PRINTF("POP\tBX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBX = pop_long(); } else { M.x86.R_BX = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x5c ****************************************************************************/ static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tESP\n"); } else { DECODE_PRINTF("POP\tSP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESP = pop_long(); } else { M.x86.R_SP = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x5d ****************************************************************************/ static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tEBP\n"); } else { DECODE_PRINTF("POP\tBP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBP = pop_long(); } else { M.x86.R_BP = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x5e ****************************************************************************/ static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tESI\n"); } else { DECODE_PRINTF("POP\tSI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESI = pop_long(); } else { M.x86.R_SI = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x5f ****************************************************************************/ static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POP\tEDI\n"); } else { DECODE_PRINTF("POP\tDI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDI = pop_long(); } else { M.x86.R_DI = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x60 ****************************************************************************/ static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSHAD\n"); } else { DECODE_PRINTF("PUSHA\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 old_sp = M.x86.R_ESP; push_long(M.x86.R_EAX); push_long(M.x86.R_ECX); push_long(M.x86.R_EDX); push_long(M.x86.R_EBX); push_long(old_sp); push_long(M.x86.R_EBP); push_long(M.x86.R_ESI); push_long(M.x86.R_EDI); } else { u16 old_sp = M.x86.R_SP; push_word(M.x86.R_AX); push_word(M.x86.R_CX); push_word(M.x86.R_DX); push_word(M.x86.R_BX); push_word(old_sp); push_word(M.x86.R_BP); push_word(M.x86.R_SI); push_word(M.x86.R_DI); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x61 ****************************************************************************/ static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POPAD\n"); } else { DECODE_PRINTF("POPA\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDI = pop_long(); M.x86.R_ESI = pop_long(); M.x86.R_EBP = pop_long(); M.x86.R_ESP += 4; /* skip ESP */ M.x86.R_EBX = pop_long(); M.x86.R_EDX = pop_long(); M.x86.R_ECX = pop_long(); M.x86.R_EAX = pop_long(); } else { M.x86.R_DI = pop_word(); M.x86.R_SI = pop_word(); M.x86.R_BP = pop_word(); M.x86.R_SP += 2; /* skip SP */ M.x86.R_BX = pop_word(); M.x86.R_DX = pop_word(); M.x86.R_CX = pop_word(); M.x86.R_AX = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /*opcode 0x62 ILLEGAL OP, calls x86emuOp_illegal_op() */ /*opcode 0x63 ILLEGAL OP, calls x86emuOp_illegal_op() */ /**************************************************************************** REMARKS: Handles opcode 0x64 ****************************************************************************/ static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("FS:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_SEGOVR_FS; /* * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4 * opcode subroutines we do not want to do this. */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x65 ****************************************************************************/ static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("GS:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_SEGOVR_GS; /* * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4 * opcode subroutines we do not want to do this. */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x66 - prefix for 32-bit register ****************************************************************************/ static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("DATA:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_PREFIX_DATA; /* note no DECODE_CLEAR_SEGOVR here. */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x67 - prefix for 32-bit address ****************************************************************************/ static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("ADDR:\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_PREFIX_ADDR; /* note no DECODE_CLEAR_SEGOVR here. */ END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x68 ****************************************************************************/ static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1)) { u32 imm; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { imm = fetch_long_imm(); } else { imm = fetch_word_imm(); } DECODE_PRINTF2("PUSH\t%x\n", imm); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(imm); } else { push_word((u16) imm); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x69 ****************************************************************************/ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("IMUL\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; s32 imm; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); imm = fetch_long_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; s16 imm; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); imm = fetch_word_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); res = (s16) srcval *(s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; s32 imm; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); imm = fetch_long_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; s16 imm; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); imm = fetch_word_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); res = (s16) srcval *(s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; s32 imm; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); imm = fetch_long_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; s16 imm; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); imm = fetch_word_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); res = (s16) srcval *(s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; u32 res_lo, res_hi; s32 imm; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); imm = fetch_long_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) * srcreg, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg, *srcreg; u32 res; s16 imm; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); imm = fetch_word_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); res = (s16) * srcreg * (s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x6a ****************************************************************************/ static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1)) { s16 imm; START_OF_INSTR(); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2("PUSH\t%d\n", imm); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long((s32) imm); } else { push_word(imm); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x6b ****************************************************************************/ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; s8 imm; START_OF_INSTR(); DECODE_PRINTF("IMUL\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); res = (s16) srcval *(s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); res = (s16) srcval *(s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); res = (s16) srcval *(s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) * srcreg, (s32) imm); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg, *srcreg; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); imm = fetch_byte_imm(); DECODE_PRINTF2(",%d\n", (s32) imm); res = (s16) * srcreg * (s16) imm; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x6c ****************************************************************************/ static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("INSB\n"); ins(1); TRACE_AND_STEP(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x6d ****************************************************************************/ static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INSD\n"); ins(4); } else { DECODE_PRINTF("INSW\n"); ins(2); } TRACE_AND_STEP(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x6e ****************************************************************************/ static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("OUTSB\n"); outs(1); TRACE_AND_STEP(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x6f ****************************************************************************/ static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("OUTSD\n"); outs(4); } else { DECODE_PRINTF("OUTSW\n"); outs(2); } TRACE_AND_STEP(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x70 ****************************************************************************/ static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if overflow flag is set */ START_OF_INSTR(); DECODE_PRINTF("JO\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (ACCESS_FLAG(F_OF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x71 ****************************************************************************/ static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if overflow is not set */ START_OF_INSTR(); DECODE_PRINTF("JNO\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (!ACCESS_FLAG(F_OF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x72 ****************************************************************************/ static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if carry flag is set. */ START_OF_INSTR(); DECODE_PRINTF("JB\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (ACCESS_FLAG(F_CF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x73 ****************************************************************************/ static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if carry flag is clear. */ START_OF_INSTR(); DECODE_PRINTF("JNB\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (!ACCESS_FLAG(F_CF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x74 ****************************************************************************/ static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if zero flag is set. */ START_OF_INSTR(); DECODE_PRINTF("JZ\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (ACCESS_FLAG(F_ZF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x75 ****************************************************************************/ static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if zero flag is clear. */ START_OF_INSTR(); DECODE_PRINTF("JNZ\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (!ACCESS_FLAG(F_ZF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x76 ****************************************************************************/ static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if carry flag is set or if the zero flag is set. */ START_OF_INSTR(); DECODE_PRINTF("JBE\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x77 ****************************************************************************/ static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if carry flag is clear and if the zero flag is clear */ START_OF_INSTR(); DECODE_PRINTF("JNBE\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x78 ****************************************************************************/ static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if sign flag is set */ START_OF_INSTR(); DECODE_PRINTF("JS\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (ACCESS_FLAG(F_SF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x79 ****************************************************************************/ static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if sign flag is clear */ START_OF_INSTR(); DECODE_PRINTF("JNS\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (!ACCESS_FLAG(F_SF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x7a ****************************************************************************/ static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if parity flag is set (even parity) */ START_OF_INSTR(); DECODE_PRINTF("JP\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (ACCESS_FLAG(F_PF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x7b ****************************************************************************/ static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; /* jump to byte offset if parity flag is clear (odd parity) */ START_OF_INSTR(); DECODE_PRINTF("JNP\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (!ACCESS_FLAG(F_PF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x7c ****************************************************************************/ static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; int sf, of; /* jump to byte offset if sign flag not equal to overflow flag. */ START_OF_INSTR(); DECODE_PRINTF("JL\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); sf = ACCESS_FLAG(F_SF) != 0; of = ACCESS_FLAG(F_OF) != 0; if (sf ^ of) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x7d ****************************************************************************/ static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; int sf, of; /* jump to byte offset if sign flag not equal to overflow flag. */ START_OF_INSTR(); DECODE_PRINTF("JNL\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); sf = ACCESS_FLAG(F_SF) != 0; of = ACCESS_FLAG(F_OF) != 0; /* note: inverse of above, but using == instead of xor. */ if (sf == of) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x7e ****************************************************************************/ static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; int sf, of; /* jump to byte offset if sign flag not equal to overflow flag or the zero flag is set */ START_OF_INSTR(); DECODE_PRINTF("JLE\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); sf = ACCESS_FLAG(F_SF) != 0; of = ACCESS_FLAG(F_OF) != 0; if ((sf ^ of) || ACCESS_FLAG(F_ZF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x7f ****************************************************************************/ static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1)) { s8 offset; u16 target; int sf, of; /* jump to byte offset if sign flag equal to overflow flag. and the zero flag is clear */ START_OF_INSTR(); DECODE_PRINTF("JNLE\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + (s16) offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); sf = ACCESS_FLAG(F_SF) != 0; of = ACCESS_FLAG(F_OF) != 0; if ((sf == of) && !ACCESS_FLAG(F_ZF)) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } static u8(*opc80_byte_operation[]) (u8 d, u8 s) = { add_byte, /* 00 */ or_byte, /* 01 */ adc_byte, /* 02 */ sbb_byte, /* 03 */ and_byte, /* 04 */ sub_byte, /* 05 */ xor_byte, /* 06 */ cmp_byte, /* 07 */ }; /**************************************************************************** REMARKS: Handles opcode 0x80 ****************************************************************************/ static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg; uint destoffset; u8 imm; u8 destval; /* * Weirdo special case instruction format. Part of the opcode * held below in "RH". Doubly nested case would result, except * that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ADD\t"); break; case 1: DECODE_PRINTF("OR\t"); break; case 2: DECODE_PRINTF("ADC\t"); break; case 3: DECODE_PRINTF("SBB\t"); break; case 4: DECODE_PRINTF("AND\t"); break; case 5: DECODE_PRINTF("SUB\t"); break; case 6: DECODE_PRINTF("XOR\t"); break; case 7: DECODE_PRINTF("CMP\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ switch (mod) { case 0: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc80_byte_operation[rh]) (destval, imm); if (rh != 7) store_data_byte(destoffset, destval); break; case 1: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc80_byte_operation[rh]) (destval, imm); if (rh != 7) store_data_byte(destoffset, destval); break; case 2: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc80_byte_operation[rh]) (destval, imm); if (rh != 7) store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc80_byte_operation[rh]) (*destreg, imm); if (rh != 7) *destreg = destval; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } static u16(*opc81_word_operation[]) (u16 d, u16 s) = { add_word, /*00 */ or_word, /*01 */ adc_word, /*02 */ sbb_word, /*03 */ and_word, /*04 */ sub_word, /*05 */ xor_word, /*06 */ cmp_word, /*07 */ }; static u32(*opc81_long_operation[]) (u32 d, u32 s) = { add_long, /*00 */ or_long, /*01 */ adc_long, /*02 */ sbb_long, /*03 */ and_long, /*04 */ sub_long, /*05 */ xor_long, /*06 */ cmp_long, /*07 */ }; /**************************************************************************** REMARKS: Handles opcode 0x81 ****************************************************************************/ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; /* * Weirdo special case instruction format. Part of the opcode * held below in "RH". Doubly nested case would result, except * that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ADD\t"); break; case 1: DECODE_PRINTF("OR\t"); break; case 2: DECODE_PRINTF("ADC\t"); break; case 3: DECODE_PRINTF("SBB\t"); break; case 4: DECODE_PRINTF("AND\t"); break; case 5: DECODE_PRINTF("SUB\t"); break; case 6: DECODE_PRINTF("XOR\t"); break; case 7: DECODE_PRINTF("CMP\t"); break; } } #endif /* * Know operation, decode the mod byte to find the addressing * mode. */ switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); imm = fetch_long_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_long_operation[rh]) (destval, imm); if (rh != 7) store_data_long(destoffset, destval); } else { u16 destval, imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); imm = fetch_word_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_word_operation[rh]) (destval, imm); if (rh != 7) store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); imm = fetch_long_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_long_operation[rh]) (destval, imm); if (rh != 7) store_data_long(destoffset, destval); } else { u16 destval, imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); imm = fetch_word_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_word_operation[rh]) (destval, imm); if (rh != 7) store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); imm = fetch_long_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_long_operation[rh]) (destval, imm); if (rh != 7) store_data_long(destoffset, destval); } else { u16 destval, imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); imm = fetch_word_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_word_operation[rh]) (destval, imm); if (rh != 7) store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 destval, imm; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); imm = fetch_long_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_long_operation[rh]) (*destreg, imm); if (rh != 7) *destreg = destval; } else { u16 *destreg; u16 destval, imm; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); imm = fetch_word_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); destval = (*opc81_word_operation[rh]) (*destreg, imm); if (rh != 7) *destreg = destval; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } static u8(*opc82_byte_operation[]) (u8 s, u8 d) = { add_byte, /*00 */ or_byte, /*01 *//*YYY UNUSED ???? */ adc_byte, /*02 */ sbb_byte, /*03 */ and_byte, /*04 *//*YYY UNUSED ???? */ sub_byte, /*05 */ xor_byte, /*06 *//*YYY UNUSED ???? */ cmp_byte, /*07 */ }; /**************************************************************************** REMARKS: Handles opcode 0x82 ****************************************************************************/ static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg; uint destoffset; u8 imm; u8 destval; /* * Weirdo special case instruction format. Part of the opcode * held below in "RH". Doubly nested case would result, except * that the decoded instruction Similar to opcode 81, except that * the immediate byte is sign extended to a word length. */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ADD\t"); break; case 1: DECODE_PRINTF("OR\t"); break; case 2: DECODE_PRINTF("ADC\t"); break; case 3: DECODE_PRINTF("SBB\t"); break; case 4: DECODE_PRINTF("AND\t"); break; case 5: DECODE_PRINTF("SUB\t"); break; case 6: DECODE_PRINTF("XOR\t"); break; case 7: DECODE_PRINTF("CMP\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ switch (mod) { case 0: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm00_address(rl); destval = fetch_data_byte(destoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc82_byte_operation[rh]) (destval, imm); if (rh != 7) store_data_byte(destoffset, destval); break; case 1: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm01_address(rl); destval = fetch_data_byte(destoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc82_byte_operation[rh]) (destval, imm); if (rh != 7) store_data_byte(destoffset, destval); break; case 2: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); destval = fetch_data_byte(destoffset); imm = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc82_byte_operation[rh]) (destval, imm); if (rh != 7) store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); imm = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc82_byte_operation[rh]) (*destreg, imm); if (rh != 7) *destreg = destval; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } static u16(*opc83_word_operation[]) (u16 s, u16 d) = { add_word, /*00 */ or_word, /*01 *//*YYY UNUSED ???? */ adc_word, /*02 */ sbb_word, /*03 */ and_word, /*04 *//*YYY UNUSED ???? */ sub_word, /*05 */ xor_word, /*06 *//*YYY UNUSED ???? */ cmp_word, /*07 */ }; static u32(*opc83_long_operation[]) (u32 s, u32 d) = { add_long, /*00 */ or_long, /*01 *//*YYY UNUSED ???? */ adc_long, /*02 */ sbb_long, /*03 */ and_long, /*04 *//*YYY UNUSED ???? */ sub_long, /*05 */ xor_long, /*06 *//*YYY UNUSED ???? */ cmp_long, /*07 */ }; /**************************************************************************** REMARKS: Handles opcode 0x83 ****************************************************************************/ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; /* * Weirdo special case instruction format. Part of the opcode * held below in "RH". Doubly nested case would result, except * that the decoded instruction Similar to opcode 81, except that * the immediate byte is sign extended to a word length. */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ADD\t"); break; case 1: DECODE_PRINTF("OR\t"); break; case 2: DECODE_PRINTF("ADC\t"); break; case 3: DECODE_PRINTF("SBB\t"); break; case 4: DECODE_PRINTF("AND\t"); break; case 5: DECODE_PRINTF("SUB\t"); break; case 6: DECODE_PRINTF("XOR\t"); break; case 7: DECODE_PRINTF("CMP\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm00_address(rl); destval = fetch_data_long(destoffset); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_long_operation[rh]) (destval, imm); if (rh != 7) store_data_long(destoffset, destval); } else { u16 destval, imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm00_address(rl); destval = fetch_data_word(destoffset); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_word_operation[rh]) (destval, imm); if (rh != 7) store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm01_address(rl); destval = fetch_data_long(destoffset); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_long_operation[rh]) (destval, imm); if (rh != 7) store_data_long(destoffset, destval); } else { u16 destval, imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm01_address(rl); destval = fetch_data_word(destoffset); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_word_operation[rh]) (destval, imm); if (rh != 7) store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm10_address(rl); destval = fetch_data_long(destoffset); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_long_operation[rh]) (destval, imm); if (rh != 7) store_data_long(destoffset, destval); } else { u16 destval, imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm10_address(rl); destval = fetch_data_word(destoffset); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_word_operation[rh]) (destval, imm); if (rh != 7) store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 destval, imm; destreg = DECODE_RM_LONG_REGISTER(rl); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_long_operation[rh]) (*destreg, imm); if (rh != 7) *destreg = destval; } else { u16 *destreg; u16 destval, imm; destreg = DECODE_RM_WORD_REGISTER(rl); imm = (s8) fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*opc83_word_operation[rh]) (*destreg, imm); if (rh != 7) *destreg = destval; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x84 ****************************************************************************/ static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; START_OF_INSTR(); DECODE_PRINTF("TEST\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_byte(destval, *srcreg); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_byte(destval, *srcreg); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_byte(destval, *srcreg); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_byte(*destreg, *srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x85 ****************************************************************************/ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("TEST\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_long(destval, *srcreg); } else { u16 destval; u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_word(destval, *srcreg); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_long(destval, *srcreg); } else { u16 destval; u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_word(destval, *srcreg); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_long(destval, *srcreg); } else { u16 destval; u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_word(destval, *srcreg); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_long(*destreg, *srcreg); } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); test_word(*destreg, *srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x86 ****************************************************************************/ static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; u8 destval; u8 tmp; START_OF_INSTR(); DECODE_PRINTF("XCHG\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_byte(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_byte(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_byte(destoffset); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = *destreg; *destreg = tmp; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x87 ****************************************************************************/ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("XCHG\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg; u32 destval, tmp; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_long(destoffset, destval); } else { u16 *srcreg; u16 destval, tmp; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg; u32 destval, tmp; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_long(destoffset, destval); } else { u16 *srcreg; u16 destval, tmp; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg; u32 destval, tmp; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_long(destoffset); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_long(destoffset, destval); } else { u16 *srcreg; u16 destval, tmp; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); destval = fetch_data_word(destoffset); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = destval; destval = tmp; store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; u32 tmp; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = *destreg; *destreg = tmp; } else { u16 *destreg, *srcreg; u16 tmp; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); tmp = *srcreg; *srcreg = *destreg; *destreg = tmp; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x88 ****************************************************************************/ static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_byte(destoffset, *srcreg); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_byte(destoffset, *srcreg); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_byte(destoffset, *srcreg); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x89 ****************************************************************************/ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u32 destoffset; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_long(destoffset, *srcreg); } else { u16 *srcreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_word(destoffset, *srcreg); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_long(destoffset, *srcreg); } else { u16 *srcreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_word(destoffset, *srcreg); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_long(destoffset, *srcreg); } else { u16 *srcreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); store_data_word(destoffset, *srcreg); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x8a ****************************************************************************/ static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg, *srcreg; uint srcoffset; u8 srcval; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 1: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 2: destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x8b ****************************************************************************/ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; } else { u16 *destreg, *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x8c ****************************************************************************/ static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u16 *destreg, *srcreg; uint destoffset; u16 destval; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); srcreg = decode_rm_seg_register(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = *srcreg; store_data_word(destoffset, destval); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); srcreg = decode_rm_seg_register(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = *srcreg; store_data_word(destoffset, destval); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); srcreg = decode_rm_seg_register(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = *srcreg; store_data_word(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcreg = decode_rm_seg_register(rh); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x8d ****************************************************************************/ static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("LEA\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_ADDR) { u32 *srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *srcreg = (u32) destoffset; } else { u16 *srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *srcreg = (u16) destoffset; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_ADDR) { u32 *srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *srcreg = (u32) destoffset; } else { u16 *srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *srcreg = (u16) destoffset; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_ADDR) { u32 *srcreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *srcreg = (u32) destoffset; } else { u16 *srcreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *srcreg = (u16) destoffset; } break; case 3: /* register to register */ /* undefined. Do nothing. */ break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x8e ****************************************************************************/ static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u16 *destreg, *srcreg; uint srcoffset; u16 srcval; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = decode_rm_seg_register(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 1: destreg = decode_rm_seg_register(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 2: destreg = decode_rm_seg_register(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 3: /* register to register */ destreg = decode_rm_seg_register(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; break; } /* * Clean up, and reset all the R_xSP pointers to the correct * locations. This is about 3x too much overhead (doing all the * segreg ptrs when only one is needed, but this instruction * *cannot* be that common, and this isn't too much work anyway. */ DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x8f ****************************************************************************/ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("POP\t"); FETCH_DECODE_MODRM(mod, rh, rl); if (rh != 0) { DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n"); HALT_SYS(); } switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = pop_long(); store_data_long(destoffset, destval); } else { u16 destval; destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = pop_word(); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = pop_long(); store_data_long(destoffset, destval); } else { u16 destval; destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = pop_word(); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = pop_long(); store_data_long(destoffset, destval); } else { u16 destval; destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); destval = pop_word(); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = pop_long(); } else { u16 *destreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = pop_word(); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x90 ****************************************************************************/ static void x86emuOp_nop(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("NOP\n"); TRACE_AND_STEP(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x91 ****************************************************************************/ static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1)) { u32 tmp; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XCHG\tEAX,ECX\n"); } else { DECODE_PRINTF("XCHG\tAX,CX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { tmp = M.x86.R_EAX; M.x86.R_EAX = M.x86.R_ECX; M.x86.R_ECX = tmp; } else { tmp = M.x86.R_AX; M.x86.R_AX = M.x86.R_CX; M.x86.R_CX = (u16) tmp; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x92 ****************************************************************************/ static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1)) { u32 tmp; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XCHG\tEAX,EDX\n"); } else { DECODE_PRINTF("XCHG\tAX,DX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { tmp = M.x86.R_EAX; M.x86.R_EAX = M.x86.R_EDX; M.x86.R_EDX = tmp; } else { tmp = M.x86.R_AX; M.x86.R_AX = M.x86.R_DX; M.x86.R_DX = (u16) tmp; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x93 ****************************************************************************/ static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1)) { u32 tmp; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XCHG\tEAX,EBX\n"); } else { DECODE_PRINTF("XCHG\tAX,BX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { tmp = M.x86.R_EAX; M.x86.R_EAX = M.x86.R_EBX; M.x86.R_EBX = tmp; } else { tmp = M.x86.R_AX; M.x86.R_AX = M.x86.R_BX; M.x86.R_BX = (u16) tmp; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x94 ****************************************************************************/ static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1)) { u32 tmp; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XCHG\tEAX,ESP\n"); } else { DECODE_PRINTF("XCHG\tAX,SP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { tmp = M.x86.R_EAX; M.x86.R_EAX = M.x86.R_ESP; M.x86.R_ESP = tmp; } else { tmp = M.x86.R_AX; M.x86.R_AX = M.x86.R_SP; M.x86.R_SP = (u16) tmp; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x95 ****************************************************************************/ static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1)) { u32 tmp; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XCHG\tEAX,EBP\n"); } else { DECODE_PRINTF("XCHG\tAX,BP\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { tmp = M.x86.R_EAX; M.x86.R_EAX = M.x86.R_EBP; M.x86.R_EBP = tmp; } else { tmp = M.x86.R_AX; M.x86.R_AX = M.x86.R_BP; M.x86.R_BP = (u16) tmp; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x96 ****************************************************************************/ static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1)) { u32 tmp; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XCHG\tEAX,ESI\n"); } else { DECODE_PRINTF("XCHG\tAX,SI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { tmp = M.x86.R_EAX; M.x86.R_EAX = M.x86.R_ESI; M.x86.R_ESI = tmp; } else { tmp = M.x86.R_AX; M.x86.R_AX = M.x86.R_SI; M.x86.R_SI = (u16) tmp; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x97 ****************************************************************************/ static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1)) { u32 tmp; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("XCHG\tEAX,EDI\n"); } else { DECODE_PRINTF("XCHG\tAX,DI\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { tmp = M.x86.R_EAX; M.x86.R_EAX = M.x86.R_EDI; M.x86.R_EDI = tmp; } else { tmp = M.x86.R_AX; M.x86.R_AX = M.x86.R_DI; M.x86.R_DI = (u16) tmp; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x98 ****************************************************************************/ static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("CWDE\n"); } else { DECODE_PRINTF("CBW\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { if (M.x86.R_AX & 0x8000) { M.x86.R_EAX |= 0xffff0000; } else { M.x86.R_EAX &= 0x0000ffff; } } else { if (M.x86.R_AL & 0x80) { M.x86.R_AH = 0xff; } else { M.x86.R_AH = 0x0; } } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x99 ****************************************************************************/ static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("CDQ\n"); } else { DECODE_PRINTF("CWD\n"); } DECODE_PRINTF("CWD\n"); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { if (M.x86.R_EAX & 0x80000000) { M.x86.R_EDX = 0xffffffff; } else { M.x86.R_EDX = 0x0; } } else { if (M.x86.R_AX & 0x8000) { M.x86.R_DX = 0xffff; } else { M.x86.R_DX = 0x0; } } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x9a ****************************************************************************/ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1)) { u32 farseg, faroff; START_OF_INSTR(); DECODE_PRINTF("CALL\t"); if (M.x86.mode & SYSMODE_PREFIX_DATA) { faroff = fetch_long_imm(); farseg = fetch_word_imm(); } else { faroff = fetch_word_imm(); farseg = fetch_word_imm(); } DECODE_PRINTF2("%04x:", farseg); DECODE_PRINTF2("%04x\n", faroff); CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR "); /* XXX * * Hooked interrupt vectors calling into our "BIOS" will cause * problems unless all intersegment stuff is checked for BIOS * access. Check needed here. For moment, let it alone. */ TRACE_AND_STEP(); push_word(M.x86.R_CS); M.x86.R_CS = farseg; if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_EIP); } else { push_word(M.x86.R_IP); } M.x86.R_EIP = faroff & 0xffff; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x9b ****************************************************************************/ static void x86emuOp_wait(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("WAIT"); TRACE_AND_STEP(); /* NADA. */ DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x9c ****************************************************************************/ static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1)) { u32 flags; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("PUSHFD\n"); } else { DECODE_PRINTF("PUSHF\n"); } TRACE_AND_STEP(); /* clear out *all* bits not representing flags, and turn on real bits */ flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON; if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(flags); } else { push_word((u16) flags); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x9d ****************************************************************************/ static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("POPFD\n"); } else { DECODE_PRINTF("POPF\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EFLG = pop_long(); } else { M.x86.R_FLG = pop_word(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x9e ****************************************************************************/ static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("SAHF\n"); TRACE_AND_STEP(); /* clear the lower bits of the flag register */ M.x86.R_FLG &= 0xffffff00; /* or in the AH register into the flags register */ M.x86.R_FLG |= M.x86.R_AH; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x9f ****************************************************************************/ static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("LAHF\n"); TRACE_AND_STEP(); M.x86.R_AH = (u8) (M.x86.R_FLG & 0xff); /*undocumented TC++ behavior??? Nope. It's documented, but you have too look real hard to notice it. */ M.x86.R_AH |= 0x2; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa0 ****************************************************************************/ static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1)) { u16 offset; START_OF_INSTR(); DECODE_PRINTF("MOV\tAL,"); offset = fetch_word_imm(); DECODE_PRINTF2("[%04x]\n", offset); TRACE_AND_STEP(); M.x86.R_AL = fetch_data_byte(offset); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa1 ****************************************************************************/ static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1)) { u16 offset; START_OF_INSTR(); offset = fetch_word_imm(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset); } else { DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = fetch_data_long(offset); } else { M.x86.R_AX = fetch_data_word(offset); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa2 ****************************************************************************/ static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1)) { u16 offset; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); offset = fetch_word_imm(); DECODE_PRINTF2("[%04x],AL\n", offset); TRACE_AND_STEP(); store_data_byte(offset, M.x86.R_AL); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa3 ****************************************************************************/ static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1)) { u16 offset; START_OF_INSTR(); offset = fetch_word_imm(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset); } else { DECODE_PRINTF2("MOV\t[%04x],AX\n", offset); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { store_data_long(offset, M.x86.R_EAX); } else { store_data_word(offset, M.x86.R_AX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa4 ****************************************************************************/ static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1)) { u8 val; u32 count; int inc; START_OF_INSTR(); DECODE_PRINTF("MOVS\tBYTE\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -1; else inc = 1; TRACE_AND_STEP(); count = 1; if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* move them until CX is ZERO. */ count = M.x86.R_CX; M.x86.R_CX = 0; M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } while (count--) { val = fetch_data_byte(M.x86.R_SI); store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, val); M.x86.R_SI += inc; M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa5 ****************************************************************************/ static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1)) { u32 val; int inc; u32 count; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOVS\tDWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -4; else inc = 4; } else { DECODE_PRINTF("MOVS\tWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -2; else inc = 2; } TRACE_AND_STEP(); count = 1; if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* move them until CX is ZERO. */ count = M.x86.R_CX; M.x86.R_CX = 0; M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } while (count--) { if (M.x86.mode & SYSMODE_PREFIX_DATA) { val = fetch_data_long(M.x86.R_SI); store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val); } else { val = fetch_data_word(M.x86.R_SI); store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16) val); } M.x86.R_SI += inc; M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa6 ****************************************************************************/ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1)) { s8 val1, val2; int inc; START_OF_INSTR(); DECODE_PRINTF("CMPS\tBYTE\n"); TRACE_AND_STEP(); if (ACCESS_FLAG(F_DF)) /* down */ inc = -1; else inc = 1; if (M.x86.mode & SYSMODE_PREFIX_REPE) { /* REPE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { val1 = fetch_data_byte(M.x86.R_SI); val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); cmp_byte(val1, val2); M.x86.R_CX -= 1; M.x86.R_SI += inc; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF) == 0) break; } M.x86.mode &= ~SYSMODE_PREFIX_REPE; } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { /* REPNE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { val1 = fetch_data_byte(M.x86.R_SI); val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); cmp_byte(val1, val2); M.x86.R_CX -= 1; M.x86.R_SI += inc; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF)) break; /* zero flag set means equal */ } M.x86.mode &= ~SYSMODE_PREFIX_REPNE; } else { val1 = fetch_data_byte(M.x86.R_SI); val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); cmp_byte(val1, val2); M.x86.R_SI += inc; M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa7 ****************************************************************************/ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1)) { u32 val1, val2; int inc; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("CMPS\tDWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -4; else inc = 4; } else { DECODE_PRINTF("CMPS\tWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -2; else inc = 2; } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_REPE) { /* REPE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { if (M.x86.mode & SYSMODE_PREFIX_DATA) { val1 = fetch_data_long(M.x86.R_SI); val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); cmp_long(val1, val2); } else { val1 = fetch_data_word(M.x86.R_SI); val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); cmp_word((u16) val1, (u16) val2); } M.x86.R_CX -= 1; M.x86.R_SI += inc; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF) == 0) break; } M.x86.mode &= ~SYSMODE_PREFIX_REPE; } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { /* REPNE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { if (M.x86.mode & SYSMODE_PREFIX_DATA) { val1 = fetch_data_long(M.x86.R_SI); val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); cmp_long(val1, val2); } else { val1 = fetch_data_word(M.x86.R_SI); val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); cmp_word((u16) val1, (u16) val2); } M.x86.R_CX -= 1; M.x86.R_SI += inc; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF)) break; /* zero flag set means equal */ } M.x86.mode &= ~SYSMODE_PREFIX_REPNE; } else { if (M.x86.mode & SYSMODE_PREFIX_DATA) { val1 = fetch_data_long(M.x86.R_SI); val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); cmp_long(val1, val2); } else { val1 = fetch_data_word(M.x86.R_SI); val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); cmp_word((u16) val1, (u16) val2); } M.x86.R_SI += inc; M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa8 ****************************************************************************/ static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1)) { int imm; START_OF_INSTR(); DECODE_PRINTF("TEST\tAL,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%04x\n", imm); TRACE_AND_STEP(); test_byte(M.x86.R_AL, (u8) imm); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xa9 ****************************************************************************/ static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("TEST\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("TEST\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { test_long(M.x86.R_EAX, srcval); } else { test_word(M.x86.R_AX, (u16) srcval); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xaa ****************************************************************************/ static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1)) { int inc; START_OF_INSTR(); DECODE_PRINTF("STOS\tBYTE\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -1; else inc = 1; TRACE_AND_STEP(); if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL); M.x86.R_CX -= 1; M.x86.R_DI += inc; } M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } else { store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL); M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xab ****************************************************************************/ static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1)) { int inc; u32 count; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("STOS\tDWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -4; else inc = 4; } else { DECODE_PRINTF("STOS\tWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -2; else inc = 2; } TRACE_AND_STEP(); count = 1; if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* move them until CX is ZERO. */ count = M.x86.R_CX; M.x86.R_CX = 0; M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } while (count--) { if (M.x86.mode & SYSMODE_PREFIX_DATA) { store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX); } else { store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX); } M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xac ****************************************************************************/ static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1)) { int inc; START_OF_INSTR(); DECODE_PRINTF("LODS\tBYTE\n"); TRACE_AND_STEP(); if (ACCESS_FLAG(F_DF)) /* down */ inc = -1; else inc = 1; if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { M.x86.R_AL = fetch_data_byte(M.x86.R_SI); M.x86.R_CX -= 1; M.x86.R_SI += inc; } M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } else { M.x86.R_AL = fetch_data_byte(M.x86.R_SI); M.x86.R_SI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xad ****************************************************************************/ static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1)) { int inc; u32 count; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("LODS\tDWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -4; else inc = 4; } else { DECODE_PRINTF("LODS\tWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -2; else inc = 2; } TRACE_AND_STEP(); count = 1; if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* move them until CX is ZERO. */ count = M.x86.R_CX; M.x86.R_CX = 0; M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } while (count--) { if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = fetch_data_long(M.x86.R_SI); } else { M.x86.R_AX = fetch_data_word(M.x86.R_SI); } M.x86.R_SI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xae ****************************************************************************/ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1)) { s8 val2; int inc; START_OF_INSTR(); DECODE_PRINTF("SCAS\tBYTE\n"); TRACE_AND_STEP(); if (ACCESS_FLAG(F_DF)) /* down */ inc = -1; else inc = 1; if (M.x86.mode & SYSMODE_PREFIX_REPE) { /* REPE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); cmp_byte(M.x86.R_AL, val2); M.x86.R_CX -= 1; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF) == 0) break; } M.x86.mode &= ~SYSMODE_PREFIX_REPE; } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { /* REPNE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); cmp_byte(M.x86.R_AL, val2); M.x86.R_CX -= 1; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF)) break; /* zero flag set means equal */ } M.x86.mode &= ~SYSMODE_PREFIX_REPNE; } else { val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); cmp_byte(M.x86.R_AL, val2); M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xaf ****************************************************************************/ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1)) { int inc; u32 val; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("SCAS\tDWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -4; else inc = 4; } else { DECODE_PRINTF("SCAS\tWORD\n"); if (ACCESS_FLAG(F_DF)) /* down */ inc = -2; else inc = 2; } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_REPE) { /* REPE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { if (M.x86.mode & SYSMODE_PREFIX_DATA) { val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); cmp_long(M.x86.R_EAX, val); } else { val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); cmp_word(M.x86.R_AX, (u16) val); } M.x86.R_CX -= 1; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF) == 0) break; } M.x86.mode &= ~SYSMODE_PREFIX_REPE; } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { /* REPNE */ /* move them until CX is ZERO. */ while (M.x86.R_CX != 0) { if (M.x86.mode & SYSMODE_PREFIX_DATA) { val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); cmp_long(M.x86.R_EAX, val); } else { val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); cmp_word(M.x86.R_AX, (u16) val); } M.x86.R_CX -= 1; M.x86.R_DI += inc; if (ACCESS_FLAG(F_ZF)) break; /* zero flag set means equal */ } M.x86.mode &= ~SYSMODE_PREFIX_REPNE; } else { if (M.x86.mode & SYSMODE_PREFIX_DATA) { val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); cmp_long(M.x86.R_EAX, val); } else { val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); cmp_word(M.x86.R_AX, (u16) val); } M.x86.R_DI += inc; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb0 ****************************************************************************/ static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tAL,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_AL = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb1 ****************************************************************************/ static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tCL,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_CL = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb2 ****************************************************************************/ static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tDL,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_DL = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb3 ****************************************************************************/ static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tBL,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_BL = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb4 ****************************************************************************/ static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tAH,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_AH = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb5 ****************************************************************************/ static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tCH,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_CH = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb6 ****************************************************************************/ static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tDH,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_DH = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb7 ****************************************************************************/ static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1)) { u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\tBH,"); imm = fetch_byte_imm(); DECODE_PRINTF2("%x\n", imm); TRACE_AND_STEP(); M.x86.R_BH = imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb8 ****************************************************************************/ static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tEAX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tAX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = srcval; } else { M.x86.R_AX = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xb9 ****************************************************************************/ static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tECX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tCX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ECX = srcval; } else { M.x86.R_CX = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xba ****************************************************************************/ static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tEDX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tDX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDX = srcval; } else { M.x86.R_DX = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xbb ****************************************************************************/ static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tEBX,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tBX,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBX = srcval; } else { M.x86.R_BX = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xbc ****************************************************************************/ static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tESP,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tSP,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESP = srcval; } else { M.x86.R_SP = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xbd ****************************************************************************/ static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tEBP,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tBP,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EBP = srcval; } else { M.x86.R_BP = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xbe ****************************************************************************/ static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tESI,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tSI,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ESI = srcval; } else { M.x86.R_SI = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xbf ****************************************************************************/ static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1)) { u32 srcval; START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("MOV\tEDI,"); srcval = fetch_long_imm(); } else { DECODE_PRINTF("MOV\tDI,"); srcval = fetch_word_imm(); } DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EDI = srcval; } else { M.x86.R_DI = (u16) srcval; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /* used by opcodes c0, d0, and d2. */ static u8(*opcD0_byte_operation[]) (u8 d, u8 s) = { rol_byte, ror_byte, rcl_byte, rcr_byte, shl_byte, shr_byte, shl_byte, /* sal_byte === shl_byte by definition */ sar_byte,}; /**************************************************************************** REMARKS: Handles opcode 0xc0 ****************************************************************************/ static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg; uint destoffset; u8 destval; u8 amt; /* * Yet another weirdo special case instruction format. Part of * the opcode held below in "RH". Doubly nested case would * result, except that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ROL\t"); break; case 1: DECODE_PRINTF("ROR\t"); break; case 2: DECODE_PRINTF("RCL\t"); break; case 3: DECODE_PRINTF("RCR\t"); break; case 4: DECODE_PRINTF("SHL\t"); break; case 5: DECODE_PRINTF("SHR\t"); break; case 6: DECODE_PRINTF("SAL\t"); break; case 7: DECODE_PRINTF("SAR\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ switch (mod) { case 0: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm00_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, amt); store_data_byte(destoffset, destval); break; case 1: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm01_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, amt); store_data_byte(destoffset, destval); break; case 2: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, amt); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (*destreg, amt); *destreg = destval; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /* used by opcodes c1, d1, and d3. */ static u16(*opcD1_word_operation[]) (u16 s, u8 d) = { rol_word, ror_word, rcl_word, rcr_word, shl_word, shr_word, shl_word, /* sal_byte === shl_byte by definition */ sar_word,}; /* used by opcodes c1, d1, and d3. */ static u32(*opcD1_long_operation[]) (u32 s, u8 d) = { rol_long, ror_long, rcl_long, rcr_long, shl_long, shr_long, shl_long, /* sal_byte === shl_byte by definition */ sar_long,}; /**************************************************************************** REMARKS: Handles opcode 0xc1 ****************************************************************************/ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; u8 amt; /* * Yet another weirdo special case instruction format. Part of * the opcode held below in "RH". Doubly nested case would * result, except that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ROL\t"); break; case 1: DECODE_PRINTF("ROR\t"); break; case 2: DECODE_PRINTF("RCL\t"); break; case 3: DECODE_PRINTF("RCR\t"); break; case 4: DECODE_PRINTF("SHL\t"); break; case 5: DECODE_PRINTF("SHR\t"); break; case 6: DECODE_PRINTF("SAL\t"); break; case 7: DECODE_PRINTF("SAR\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm00_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, amt); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm00_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, amt); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm01_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, amt); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm01_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, amt); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm10_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, amt); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm10_address(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, amt); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; destreg = DECODE_RM_LONG_REGISTER(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); TRACE_AND_STEP(); *destreg = (*opcD1_long_operation[rh]) (*destreg, amt); } else { u16 *destreg; destreg = DECODE_RM_WORD_REGISTER(rl); amt = fetch_byte_imm(); DECODE_PRINTF2(",%x\n", amt); TRACE_AND_STEP(); *destreg = (*opcD1_word_operation[rh]) (*destreg, amt); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc2 ****************************************************************************/ static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1)) { u16 imm; START_OF_INSTR(); DECODE_PRINTF("RET\t"); imm = fetch_word_imm(); DECODE_PRINTF2("%x\n", imm); RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip); TRACE_AND_STEP(); M.x86.R_IP = pop_word(); M.x86.R_SP += imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc3 ****************************************************************************/ static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("RET\n"); RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip); TRACE_AND_STEP(); M.x86.R_IP = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc4 ****************************************************************************/ static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rh, rl; u16 *dstreg; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("LES\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_ES = fetch_data_word(srcoffset + 2); break; case 1: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_ES = fetch_data_word(srcoffset + 2); break; case 2: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_ES = fetch_data_word(srcoffset + 2); break; case 3: /* register to register */ /* UNDEFINED! */ TRACE_AND_STEP(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc5 ****************************************************************************/ static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rh, rl; u16 *dstreg; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("LDS\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_DS = fetch_data_word(srcoffset + 2); break; case 1: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_DS = fetch_data_word(srcoffset + 2); break; case 2: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_DS = fetch_data_word(srcoffset + 2); break; case 3: /* register to register */ /* UNDEFINED! */ TRACE_AND_STEP(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc6 ****************************************************************************/ static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg; uint destoffset; u8 imm; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); if (rh != 0) { DECODE_PRINTF("ILLEGAL DECODE OF OPCODE c6\n"); HALT_SYS(); } switch (mod) { case 0: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm00_address(rl); imm = fetch_byte_imm(); DECODE_PRINTF2(",%2x\n", imm); TRACE_AND_STEP(); store_data_byte(destoffset, imm); break; case 1: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm01_address(rl); imm = fetch_byte_imm(); DECODE_PRINTF2(",%2x\n", imm); TRACE_AND_STEP(); store_data_byte(destoffset, imm); break; case 2: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); imm = fetch_byte_imm(); DECODE_PRINTF2(",%2x\n", imm); TRACE_AND_STEP(); store_data_byte(destoffset, imm); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); imm = fetch_byte_imm(); DECODE_PRINTF2(",%2x\n", imm); TRACE_AND_STEP(); *destreg = imm; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc7 ****************************************************************************/ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("MOV\t"); FETCH_DECODE_MODRM(mod, rh, rl); if (rh != 0) { DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n"); HALT_SYS(); } switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm00_address(rl); imm = fetch_long_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); store_data_long(destoffset, imm); } else { u16 imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm00_address(rl); imm = fetch_word_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); store_data_word(destoffset, imm); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm01_address(rl); imm = fetch_long_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); store_data_long(destoffset, imm); } else { u16 imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm01_address(rl); imm = fetch_word_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); store_data_word(destoffset, imm); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 imm; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm10_address(rl); imm = fetch_long_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); store_data_long(destoffset, imm); } else { u16 imm; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm10_address(rl); imm = fetch_word_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); store_data_word(destoffset, imm); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 imm; destreg = DECODE_RM_LONG_REGISTER(rl); imm = fetch_long_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); *destreg = imm; } else { u16 *destreg; u16 imm; destreg = DECODE_RM_WORD_REGISTER(rl); imm = fetch_word_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); *destreg = imm; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc8 ****************************************************************************/ static void x86emuOp_enter(u8 X86EMU_UNUSED(op1)) { u16 local, frame_pointer; u8 nesting; int i; START_OF_INSTR(); local = fetch_word_imm(); nesting = fetch_byte_imm(); DECODE_PRINTF2("ENTER %x\n", local); DECODE_PRINTF2(",%x\n", nesting); TRACE_AND_STEP(); push_word(M.x86.R_BP); frame_pointer = M.x86.R_SP; if (nesting > 0) { for (i = 1; i < nesting; i++) { M.x86.R_BP -= 2; push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP)); } push_word(frame_pointer); } M.x86.R_BP = frame_pointer; M.x86.R_SP = (u16) (M.x86.R_SP - local); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xc9 ****************************************************************************/ static void x86emuOp_leave(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("LEAVE\n"); TRACE_AND_STEP(); M.x86.R_SP = M.x86.R_BP; M.x86.R_BP = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xca ****************************************************************************/ static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1)) { u16 imm; START_OF_INSTR(); DECODE_PRINTF("RETF\t"); imm = fetch_word_imm(); DECODE_PRINTF2("%x\n", imm); RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip); TRACE_AND_STEP(); M.x86.R_IP = pop_word(); M.x86.R_CS = pop_word(); M.x86.R_SP += imm; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xcb ****************************************************************************/ static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("RETF\n"); RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip); TRACE_AND_STEP(); M.x86.R_IP = pop_word(); M.x86.R_CS = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xcc ****************************************************************************/ static void x86emuOp_int3(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("INT 3\n"); TRACE_AND_STEP(); if (_X86EMU_intrTab[3]) { (*_X86EMU_intrTab[3]) (3); } else { push_word((u16) M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); push_word(M.x86.R_CS); M.x86.R_CS = mem_access_word(3 * 4 + 2); push_word(M.x86.R_IP); M.x86.R_IP = mem_access_word(3 * 4); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xcd ****************************************************************************/ static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1)) { u8 intnum; START_OF_INSTR(); DECODE_PRINTF("INT\t"); intnum = fetch_byte_imm(); DECODE_PRINTF2("%x\n", intnum); TRACE_AND_STEP(); if (_X86EMU_intrTab[intnum]) { (*_X86EMU_intrTab[intnum]) (intnum); } else { push_word((u16) M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); push_word(M.x86.R_CS); M.x86.R_CS = mem_access_word(intnum * 4 + 2); push_word(M.x86.R_IP); M.x86.R_IP = mem_access_word(intnum * 4); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xce ****************************************************************************/ static void x86emuOp_into(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("INTO\n"); TRACE_AND_STEP(); if (ACCESS_FLAG(F_OF)) { if (_X86EMU_intrTab[4]) { (*_X86EMU_intrTab[4]) (4); } else { push_word((u16) M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); push_word(M.x86.R_CS); M.x86.R_CS = mem_access_word(4 * 4 + 2); push_word(M.x86.R_IP); M.x86.R_IP = mem_access_word(4 * 4); } } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xcf ****************************************************************************/ static void x86emuOp_iret(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("IRET\n"); TRACE_AND_STEP(); M.x86.R_IP = pop_word(); M.x86.R_CS = pop_word(); M.x86.R_FLG = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xd0 ****************************************************************************/ static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg; uint destoffset; u8 destval; /* * Yet another weirdo special case instruction format. Part of * the opcode held below in "RH". Doubly nested case would * result, except that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ROL\t"); break; case 1: DECODE_PRINTF("ROR\t"); break; case 2: DECODE_PRINTF("RCL\t"); break; case 3: DECODE_PRINTF("RCR\t"); break; case 4: DECODE_PRINTF("SHL\t"); break; case 5: DECODE_PRINTF("SHR\t"); break; case 6: DECODE_PRINTF("SAL\t"); break; case 7: DECODE_PRINTF("SAR\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ switch (mod) { case 0: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, 1); store_data_byte(destoffset, destval); break; case 1: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, 1); store_data_byte(destoffset, destval); break; case 2: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, 1); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(",1\n"); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (*destreg, 1); *destreg = destval; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xd1 ****************************************************************************/ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; /* * Yet another weirdo special case instruction format. Part of * the opcode held below in "RH". Doubly nested case would * result, except that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ROL\t"); break; case 1: DECODE_PRINTF("ROR\t"); break; case 2: DECODE_PRINTF("RCL\t"); break; case 3: DECODE_PRINTF("RCR\t"); break; case 4: DECODE_PRINTF("SHL\t"); break; case 5: DECODE_PRINTF("SHR\t"); break; case 6: DECODE_PRINTF("SAL\t"); break; case 7: DECODE_PRINTF("SAR\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, 1); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, 1); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, 1); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, 1); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, 1); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(",1\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, 1); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *destreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(",1\n"); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (*destreg, 1); *destreg = destval; } else { u16 destval; u16 *destreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(",1\n"); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (*destreg, 1); *destreg = destval; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xd2 ****************************************************************************/ static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg; uint destoffset; u8 destval; u8 amt; /* * Yet another weirdo special case instruction format. Part of * the opcode held below in "RH". Doubly nested case would * result, except that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ROL\t"); break; case 1: DECODE_PRINTF("ROR\t"); break; case 2: DECODE_PRINTF("RCL\t"); break; case 3: DECODE_PRINTF("RCR\t"); break; case 4: DECODE_PRINTF("SHL\t"); break; case 5: DECODE_PRINTF("SHR\t"); break; case 6: DECODE_PRINTF("SAL\t"); break; case 7: DECODE_PRINTF("SAR\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ amt = M.x86.R_CL; switch (mod) { case 0: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, amt); store_data_byte(destoffset, destval); break; case 1: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, amt); store_data_byte(destoffset, destval); break; case 2: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (destval, amt); store_data_byte(destoffset, destval); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = (*opcD0_byte_operation[rh]) (*destreg, amt); *destreg = destval; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xd3 ****************************************************************************/ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; u8 amt; /* * Yet another weirdo special case instruction format. Part of * the opcode held below in "RH". Doubly nested case would * result, except that the decoded instruction */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("ROL\t"); break; case 1: DECODE_PRINTF("ROR\t"); break; case 2: DECODE_PRINTF("RCL\t"); break; case 3: DECODE_PRINTF("RCR\t"); break; case 4: DECODE_PRINTF("SHL\t"); break; case 5: DECODE_PRINTF("SHR\t"); break; case 6: DECODE_PRINTF("SAL\t"); break; case 7: DECODE_PRINTF("SAR\t"); break; } } #endif /* know operation, decode the mod byte to find the addressing mode. */ amt = M.x86.R_CL; switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, amt); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, amt); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, amt); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, amt); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = (*opcD1_long_operation[rh]) (destval, amt); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("WORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(",CL\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = (*opcD1_word_operation[rh]) (destval, amt); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); *destreg = (*opcD1_long_operation[rh]) (*destreg, amt); } else { u16 *destreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); *destreg = (*opcD1_word_operation[rh]) (*destreg, amt); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xd4 ****************************************************************************/ static void x86emuOp_aam(u8 X86EMU_UNUSED(op1)) { u8 a; START_OF_INSTR(); DECODE_PRINTF("AAM\n"); a = fetch_byte_imm(); /* this is a stupid encoding. */ if (a != 10) { /* fix: add base decoding aam_word(u8 val, int base a) */ DECODE_PRINTF("ERROR DECODING AAM\n"); TRACE_REGS(); HALT_SYS(); } TRACE_AND_STEP(); /* note the type change here --- returning AL and AH in AX. */ M.x86.R_AX = aam_word(M.x86.R_AL); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xd5 ****************************************************************************/ static void x86emuOp_aad(u8 X86EMU_UNUSED(op1)) { u8 a; START_OF_INSTR(); DECODE_PRINTF("AAD\n"); a = fetch_byte_imm(); if (a != 10) { /* fix: add base decoding aad_word(u16 val, int base a) */ DECODE_PRINTF("ERROR DECODING AAM\n"); TRACE_REGS(); HALT_SYS(); } TRACE_AND_STEP(); M.x86.R_AX = aad_word(M.x86.R_AX); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /* opcode 0xd6 ILLEGAL OPCODE */ /**************************************************************************** REMARKS: Handles opcode 0xd7 ****************************************************************************/ static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1)) { u16 addr; START_OF_INSTR(); DECODE_PRINTF("XLAT\n"); TRACE_AND_STEP(); addr = (u16) (M.x86.R_BX + (u8) M.x86.R_AL); M.x86.R_AL = fetch_data_byte(addr); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /* instuctions D8 .. DF are in i87_ops.c */ /**************************************************************************** REMARKS: Handles opcode 0xe0 ****************************************************************************/ static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1)) { s16 ip; START_OF_INSTR(); DECODE_PRINTF("LOOPNE\t"); ip = (s8) fetch_byte_imm(); ip += (s16) M.x86.R_IP; DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); M.x86.R_CX -= 1; if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */ M.x86.R_IP = ip; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe1 ****************************************************************************/ static void x86emuOp_loope(u8 X86EMU_UNUSED(op1)) { s16 ip; START_OF_INSTR(); DECODE_PRINTF("LOOPE\t"); ip = (s8) fetch_byte_imm(); ip += (s16) M.x86.R_IP; DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); M.x86.R_CX -= 1; if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */ M.x86.R_IP = ip; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe2 ****************************************************************************/ static void x86emuOp_loop(u8 X86EMU_UNUSED(op1)) { s16 ip; START_OF_INSTR(); DECODE_PRINTF("LOOP\t"); ip = (s8) fetch_byte_imm(); ip += (s16) M.x86.R_IP; DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); M.x86.R_CX -= 1; if (M.x86.R_CX != 0) M.x86.R_IP = ip; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe3 ****************************************************************************/ static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1)) { u16 target; s8 offset; /* jump to byte offset if overflow flag is set */ START_OF_INSTR(); DECODE_PRINTF("JCXZ\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); if (M.x86.R_CX == 0) M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe4 ****************************************************************************/ static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) { u8 port; START_OF_INSTR(); DECODE_PRINTF("IN\t"); port = (u8) fetch_byte_imm(); DECODE_PRINTF2("%x,AL\n", port); TRACE_AND_STEP(); M.x86.R_AL = (*sys_inb) (port); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe5 ****************************************************************************/ static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1)) { u8 port; START_OF_INSTR(); DECODE_PRINTF("IN\t"); port = (u8) fetch_byte_imm(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF2("EAX,%x\n", port); } else { DECODE_PRINTF2("AX,%x\n", port); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = (*sys_inl) (port); } else { M.x86.R_AX = (*sys_inw) (port); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe6 ****************************************************************************/ static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1)) { u8 port; START_OF_INSTR(); DECODE_PRINTF("OUT\t"); port = (u8) fetch_byte_imm(); DECODE_PRINTF2("%x,AL\n", port); TRACE_AND_STEP(); (*sys_outb) (port, M.x86.R_AL); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe7 ****************************************************************************/ static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1)) { u8 port; START_OF_INSTR(); DECODE_PRINTF("OUT\t"); port = (u8) fetch_byte_imm(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF2("%x,EAX\n", port); } else { DECODE_PRINTF2("%x,AX\n", port); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { (*sys_outl) (port, M.x86.R_EAX); } else { (*sys_outw) (port, M.x86.R_AX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe8 ****************************************************************************/ static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1)) { s16 ip16 = 0; s32 ip32 = 0; START_OF_INSTR(); DECODE_PRINTF("CALL\t"); if (M.x86.mode & SYSMODE_PREFIX_DATA) { ip32 = (s32) fetch_long_imm(); ip32 += (s16) M.x86.R_IP; /* CHECK SIGN */ DECODE_PRINTF2("%04x\n", (u16) ip32); CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip32, ""); } else { ip16 = (s16) fetch_word_imm(); ip16 += (s16) M.x86.R_IP; /* CHECK SIGN */ DECODE_PRINTF2("%04x\n", (u16) ip16); CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip16, ""); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { push_long(M.x86.R_EIP); M.x86.R_EIP = ip32 & 0xffff; } else { push_word(M.x86.R_IP); M.x86.R_EIP = ip16; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xe9 ****************************************************************************/ static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1)) { u32 ip; START_OF_INSTR(); DECODE_PRINTF("JMP\t"); if (M.x86.mode & SYSMODE_PREFIX_DATA) { ip = (u32) fetch_long_imm(); ip += (u32) M.x86.R_EIP; DECODE_PRINTF2("%08x\n", (u32) ip); TRACE_AND_STEP(); M.x86.R_EIP = (u32) ip; } else { ip = (s16) fetch_word_imm(); ip += (s16) M.x86.R_IP; DECODE_PRINTF2("%04x\n", (u16) ip); TRACE_AND_STEP(); M.x86.R_IP = (u16) ip; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xea ****************************************************************************/ static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1)) { u16 cs; u32 ip; START_OF_INSTR(); DECODE_PRINTF("JMP\tFAR "); if (M.x86.mode & SYSMODE_PREFIX_DATA) { ip = fetch_long_imm(); } else { ip = fetch_word_imm(); } cs = fetch_word_imm(); DECODE_PRINTF2("%04x:", cs); DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); M.x86.R_EIP = ip & 0xffff; M.x86.R_CS = cs; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xeb ****************************************************************************/ static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1)) { u16 target; s8 offset; START_OF_INSTR(); DECODE_PRINTF("JMP\t"); offset = (s8) fetch_byte_imm(); target = (u16) (M.x86.R_IP + offset); DECODE_PRINTF2("%x\n", target); TRACE_AND_STEP(); M.x86.R_IP = target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xec ****************************************************************************/ static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("IN\tAL,DX\n"); TRACE_AND_STEP(); M.x86.R_AL = (*sys_inb) (M.x86.R_DX); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xed ****************************************************************************/ static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("IN\tEAX,DX\n"); } else { DECODE_PRINTF("IN\tAX,DX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_EAX = (*sys_inl) (M.x86.R_DX); } else { M.x86.R_AX = (*sys_inw) (M.x86.R_DX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xee ****************************************************************************/ static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("OUT\tDX,AL\n"); TRACE_AND_STEP(); (*sys_outb) (M.x86.R_DX, M.x86.R_AL); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xef ****************************************************************************/ static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("OUT\tDX,EAX\n"); } else { DECODE_PRINTF("OUT\tDX,AX\n"); } TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { (*sys_outl) (M.x86.R_DX, M.x86.R_EAX); } else { (*sys_outw) (M.x86.R_DX, M.x86.R_AX); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf0 ****************************************************************************/ static void x86emuOp_lock(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("LOCK:\n"); TRACE_AND_STEP(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /*opcode 0xf1 ILLEGAL OPERATION */ /**************************************************************************** REMARKS: Handles opcode 0xf2 ****************************************************************************/ static void x86emuOp_repne(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("REPNE\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_PREFIX_REPNE; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf3 ****************************************************************************/ static void x86emuOp_repe(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("REPE\n"); TRACE_AND_STEP(); M.x86.mode |= SYSMODE_PREFIX_REPE; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf4 ****************************************************************************/ static void x86emuOp_halt(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("HALT\n"); TRACE_AND_STEP(); HALT_SYS(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf5 ****************************************************************************/ static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1)) { /* complement the carry flag. */ START_OF_INSTR(); DECODE_PRINTF("CMC\n"); TRACE_AND_STEP(); TOGGLE_FLAG(F_CF); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf6 ****************************************************************************/ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; u8 *destreg; uint destoffset; u8 destval, srcval; /* long, drawn out code follows. Double switch for a total of 32 cases. */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: /* mod=00 */ switch (rh) { case 0: /* test byte imm */ DECODE_PRINTF("TEST\tBYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); srcval = fetch_byte_imm(); DECODE_PRINTF2("%02x\n", srcval); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); test_byte(destval, srcval); break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n"); HALT_SYS(); break; case 2: DECODE_PRINTF("NOT\tBYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = not_byte(destval); store_data_byte(destoffset, destval); break; case 3: DECODE_PRINTF("NEG\tBYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = neg_byte(destval); store_data_byte(destoffset, destval); break; case 4: DECODE_PRINTF("MUL\tBYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); mul_byte(destval); break; case 5: DECODE_PRINTF("IMUL\tBYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); imul_byte(destval); break; case 6: DECODE_PRINTF("DIV\tBYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); div_byte(destval); break; case 7: DECODE_PRINTF("IDIV\tBYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); idiv_byte(destval); break; } break; /* end mod==00 */ case 1: /* mod=01 */ switch (rh) { case 0: /* test byte imm */ DECODE_PRINTF("TEST\tBYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); srcval = fetch_byte_imm(); DECODE_PRINTF2("%02x\n", srcval); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); test_byte(destval, srcval); break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n"); HALT_SYS(); break; case 2: DECODE_PRINTF("NOT\tBYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = not_byte(destval); store_data_byte(destoffset, destval); break; case 3: DECODE_PRINTF("NEG\tBYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = neg_byte(destval); store_data_byte(destoffset, destval); break; case 4: DECODE_PRINTF("MUL\tBYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); mul_byte(destval); break; case 5: DECODE_PRINTF("IMUL\tBYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); imul_byte(destval); break; case 6: DECODE_PRINTF("DIV\tBYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); div_byte(destval); break; case 7: DECODE_PRINTF("IDIV\tBYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); idiv_byte(destval); break; } break; /* end mod==01 */ case 2: /* mod=10 */ switch (rh) { case 0: /* test byte imm */ DECODE_PRINTF("TEST\tBYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); srcval = fetch_byte_imm(); DECODE_PRINTF2("%02x\n", srcval); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); test_byte(destval, srcval); break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n"); HALT_SYS(); break; case 2: DECODE_PRINTF("NOT\tBYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = not_byte(destval); store_data_byte(destoffset, destval); break; case 3: DECODE_PRINTF("NEG\tBYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = neg_byte(destval); store_data_byte(destoffset, destval); break; case 4: DECODE_PRINTF("MUL\tBYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); mul_byte(destval); break; case 5: DECODE_PRINTF("IMUL\tBYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); imul_byte(destval); break; case 6: DECODE_PRINTF("DIV\tBYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); div_byte(destval); break; case 7: DECODE_PRINTF("IDIV\tBYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); idiv_byte(destval); break; } break; /* end mod==10 */ case 3: /* mod=11 */ switch (rh) { case 0: /* test byte imm */ DECODE_PRINTF("TEST\t"); destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF(","); srcval = fetch_byte_imm(); DECODE_PRINTF2("%02x\n", srcval); TRACE_AND_STEP(); test_byte(*destreg, srcval); break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n"); HALT_SYS(); break; case 2: DECODE_PRINTF("NOT\t"); destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = not_byte(*destreg); break; case 3: DECODE_PRINTF("NEG\t"); destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = neg_byte(*destreg); break; case 4: DECODE_PRINTF("MUL\t"); destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); mul_byte(*destreg); /*!!! */ break; case 5: DECODE_PRINTF("IMUL\t"); destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); imul_byte(*destreg); break; case 6: DECODE_PRINTF("DIV\t"); destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); div_byte(*destreg); break; case 7: DECODE_PRINTF("IDIV\t"); destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); idiv_byte(*destreg); break; } break; /* end mod==11 */ } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf7 ****************************************************************************/ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset; /* long, drawn out code follows. Double switch for a total of 32 cases. */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: /* mod=00 */ switch (rh) { case 0: /* test word imm */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, srcval; DECODE_PRINTF("TEST\tDWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); srcval = fetch_long_imm(); DECODE_PRINTF2("%x\n", srcval); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); test_long(destval, srcval); } else { u16 destval, srcval; DECODE_PRINTF("TEST\tWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); srcval = fetch_word_imm(); DECODE_PRINTF2("%x\n", srcval); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); test_word(destval, srcval); } break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n"); HALT_SYS(); break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("NOT\tDWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = not_long(destval); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("NOT\tWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = not_word(destval); store_data_word(destoffset, destval); } break; case 3: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("NEG\tDWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = neg_long(destval); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("NEG\tWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = neg_word(destval); store_data_word(destoffset, destval); } break; case 4: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("MUL\tDWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); mul_long(destval); } else { u16 destval; DECODE_PRINTF("MUL\tWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); mul_word(destval); } break; case 5: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("IMUL\tDWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); imul_long(destval); } else { u16 destval; DECODE_PRINTF("IMUL\tWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); imul_word(destval); } break; case 6: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DIV\tDWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); div_long(destval); } else { u16 destval; DECODE_PRINTF("DIV\tWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); div_word(destval); } break; case 7: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("IDIV\tDWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); idiv_long(destval); } else { u16 destval; DECODE_PRINTF("IDIV\tWORD PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); idiv_word(destval); } break; } break; /* end mod==00 */ case 1: /* mod=01 */ switch (rh) { case 0: /* test word imm */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, srcval; DECODE_PRINTF("TEST\tDWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); srcval = fetch_long_imm(); DECODE_PRINTF2("%x\n", srcval); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); test_long(destval, srcval); } else { u16 destval, srcval; DECODE_PRINTF("TEST\tWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); srcval = fetch_word_imm(); DECODE_PRINTF2("%x\n", srcval); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); test_word(destval, srcval); } break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n"); HALT_SYS(); break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("NOT\tDWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = not_long(destval); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("NOT\tWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = not_word(destval); store_data_word(destoffset, destval); } break; case 3: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("NEG\tDWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = neg_long(destval); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("NEG\tWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = neg_word(destval); store_data_word(destoffset, destval); } break; case 4: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("MUL\tDWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); mul_long(destval); } else { u16 destval; DECODE_PRINTF("MUL\tWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); mul_word(destval); } break; case 5: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("IMUL\tDWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); imul_long(destval); } else { u16 destval; DECODE_PRINTF("IMUL\tWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); imul_word(destval); } break; case 6: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DIV\tDWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); div_long(destval); } else { u16 destval; DECODE_PRINTF("DIV\tWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); div_word(destval); } break; case 7: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("IDIV\tDWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); idiv_long(destval); } else { u16 destval; DECODE_PRINTF("IDIV\tWORD PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); idiv_word(destval); } break; } break; /* end mod==01 */ case 2: /* mod=10 */ switch (rh) { case 0: /* test word imm */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval, srcval; DECODE_PRINTF("TEST\tDWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); srcval = fetch_long_imm(); DECODE_PRINTF2("%x\n", srcval); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); test_long(destval, srcval); } else { u16 destval, srcval; DECODE_PRINTF("TEST\tWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); srcval = fetch_word_imm(); DECODE_PRINTF2("%x\n", srcval); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); test_word(destval, srcval); } break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n"); HALT_SYS(); break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("NOT\tDWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = not_long(destval); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("NOT\tWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = not_word(destval); store_data_word(destoffset, destval); } break; case 3: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("NEG\tDWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); destval = neg_long(destval); store_data_long(destoffset, destval); } else { u16 destval; DECODE_PRINTF("NEG\tWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); destval = neg_word(destval); store_data_word(destoffset, destval); } break; case 4: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("MUL\tDWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); mul_long(destval); } else { u16 destval; DECODE_PRINTF("MUL\tWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); mul_word(destval); } break; case 5: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("IMUL\tDWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); imul_long(destval); } else { u16 destval; DECODE_PRINTF("IMUL\tWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); imul_word(destval); } break; case 6: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("DIV\tDWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); div_long(destval); } else { u16 destval; DECODE_PRINTF("DIV\tWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); div_word(destval); } break; case 7: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; DECODE_PRINTF("IDIV\tDWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_long(destoffset); TRACE_AND_STEP(); idiv_long(destval); } else { u16 destval; DECODE_PRINTF("IDIV\tWORD PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); destval = fetch_data_word(destoffset); TRACE_AND_STEP(); idiv_word(destval); } break; } break; /* end mod==10 */ case 3: /* mod=11 */ switch (rh) { case 0: /* test word imm */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; DECODE_PRINTF("TEST\t"); destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); srcval = fetch_long_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); test_long(*destreg, srcval); } else { u16 *destreg; u16 srcval; DECODE_PRINTF("TEST\t"); destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); srcval = fetch_word_imm(); DECODE_PRINTF2("%x\n", srcval); TRACE_AND_STEP(); test_word(*destreg, srcval); } break; case 1: DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n"); HALT_SYS(); break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; DECODE_PRINTF("NOT\t"); destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = not_long(*destreg); } else { u16 *destreg; DECODE_PRINTF("NOT\t"); destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = not_word(*destreg); } break; case 3: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; DECODE_PRINTF("NEG\t"); destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = neg_long(*destreg); } else { u16 *destreg; DECODE_PRINTF("NEG\t"); destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = neg_word(*destreg); } break; case 4: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; DECODE_PRINTF("MUL\t"); destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); mul_long(*destreg); /*!!! */ } else { u16 *destreg; DECODE_PRINTF("MUL\t"); destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); mul_word(*destreg); /*!!! */ } break; case 5: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; DECODE_PRINTF("IMUL\t"); destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); imul_long(*destreg); } else { u16 *destreg; DECODE_PRINTF("IMUL\t"); destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); imul_word(*destreg); } break; case 6: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; DECODE_PRINTF("DIV\t"); destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); div_long(*destreg); } else { u16 *destreg; DECODE_PRINTF("DIV\t"); destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); div_word(*destreg); } break; case 7: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; DECODE_PRINTF("IDIV\t"); destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); idiv_long(*destreg); } else { u16 *destreg; DECODE_PRINTF("IDIV\t"); destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); idiv_word(*destreg); } break; } break; /* end mod==11 */ } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf8 ****************************************************************************/ static void x86emuOp_clc(u8 X86EMU_UNUSED(op1)) { /* clear the carry flag. */ START_OF_INSTR(); DECODE_PRINTF("CLC\n"); TRACE_AND_STEP(); CLEAR_FLAG(F_CF); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xf9 ****************************************************************************/ static void x86emuOp_stc(u8 X86EMU_UNUSED(op1)) { /* set the carry flag. */ START_OF_INSTR(); DECODE_PRINTF("STC\n"); TRACE_AND_STEP(); SET_FLAG(F_CF); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xfa ****************************************************************************/ static void x86emuOp_cli(u8 X86EMU_UNUSED(op1)) { /* clear interrupts. */ START_OF_INSTR(); DECODE_PRINTF("CLI\n"); TRACE_AND_STEP(); CLEAR_FLAG(F_IF); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xfb ****************************************************************************/ static void x86emuOp_sti(u8 X86EMU_UNUSED(op1)) { /* enable interrupts. */ START_OF_INSTR(); DECODE_PRINTF("STI\n"); TRACE_AND_STEP(); SET_FLAG(F_IF); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xfc ****************************************************************************/ static void x86emuOp_cld(u8 X86EMU_UNUSED(op1)) { /* clear interrupts. */ START_OF_INSTR(); DECODE_PRINTF("CLD\n"); TRACE_AND_STEP(); CLEAR_FLAG(F_DF); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xfd ****************************************************************************/ static void x86emuOp_std(u8 X86EMU_UNUSED(op1)) { /* clear interrupts. */ START_OF_INSTR(); DECODE_PRINTF("STD\n"); TRACE_AND_STEP(); SET_FLAG(F_DF); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xfe ****************************************************************************/ static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1)) { int mod, rh, rl; u8 destval; uint destoffset; u8 *destreg; /* Yet another special case instruction. */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: DECODE_PRINTF("INC\t"); break; case 1: DECODE_PRINTF("DEC\t"); break; case 2: case 3: case 4: case 5: case 6: case 7: DECODE_PRINTF2("ILLEGAL OP MAJOR OP 0xFE MINOR OP %x \n", mod); HALT_SYS(); break; } } #endif switch (mod) { case 0: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); switch (rh) { case 0: /* inc word ptr ... */ destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = inc_byte(destval); store_data_byte(destoffset, destval); break; case 1: /* dec word ptr ... */ destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = dec_byte(destval); store_data_byte(destoffset, destval); break; } break; case 1: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); switch (rh) { case 0: destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = inc_byte(destval); store_data_byte(destoffset, destval); break; case 1: destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = dec_byte(destval); store_data_byte(destoffset, destval); break; } break; case 2: DECODE_PRINTF("BYTE PTR "); destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); switch (rh) { case 0: destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = inc_byte(destval); store_data_byte(destoffset, destval); break; case 1: destval = fetch_data_byte(destoffset); TRACE_AND_STEP(); destval = dec_byte(destval); store_data_byte(destoffset, destval); break; } break; case 3: destreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); switch (rh) { case 0: TRACE_AND_STEP(); *destreg = inc_byte(*destreg); break; case 1: TRACE_AND_STEP(); *destreg = dec_byte(*destreg); break; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0xff ****************************************************************************/ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1)) { int mod, rh, rl; uint destoffset = 0; u16 *destreg; u16 destval, destval2; /* Yet another special case instruction. */ START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("INC\tDWORD PTR "); } else { DECODE_PRINTF("INC\tWORD PTR "); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF("DEC\tDWORD PTR "); } else { DECODE_PRINTF("DEC\tWORD PTR "); } break; case 2: DECODE_PRINTF("CALL\t"); break; case 3: DECODE_PRINTF("CALL\tFAR "); break; case 4: DECODE_PRINTF("JMP\t"); break; case 5: DECODE_PRINTF("JMP\tFAR "); break; case 6: DECODE_PRINTF("PUSH\t"); break; case 7: DECODE_PRINTF("ILLEGAL DECODING OF OPCODE FF\t"); HALT_SYS(); break; } } #endif switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); switch (rh) { case 0: /* inc word ptr ... */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); destval32 = inc_long(destval32); store_data_long(destoffset, destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); destval16 = inc_word(destval16); store_data_word(destoffset, destval16); } break; case 1: /* dec word ptr ... */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); destval32 = dec_long(destval32); store_data_long(destoffset, destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); destval16 = dec_word(destval16); store_data_word(destoffset, destval16); } break; case 2: /* call word ptr ... */ destval = fetch_data_word(destoffset); TRACE_AND_STEP(); push_word(M.x86.R_IP); M.x86.R_IP = destval; break; case 3: /* call far ptr ... */ destval = fetch_data_word(destoffset); destval2 = fetch_data_word(destoffset + 2); TRACE_AND_STEP(); push_word(M.x86.R_CS); M.x86.R_CS = destval2; push_word(M.x86.R_IP); M.x86.R_IP = destval; break; case 4: /* jmp word ptr ... */ destval = fetch_data_word(destoffset); TRACE_AND_STEP(); M.x86.R_IP = destval; break; case 5: /* jmp far ptr ... */ destval = fetch_data_word(destoffset); destval2 = fetch_data_word(destoffset + 2); TRACE_AND_STEP(); M.x86.R_IP = destval; M.x86.R_CS = destval2; break; case 6: /* push word ptr ... */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); push_long(destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); push_word(destval16); } break; } break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); switch (rh) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); destval32 = inc_long(destval32); store_data_long(destoffset, destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); destval16 = inc_word(destval16); store_data_word(destoffset, destval16); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); destval32 = dec_long(destval32); store_data_long(destoffset, destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); destval16 = dec_word(destval16); store_data_word(destoffset, destval16); } break; case 2: /* call word ptr ... */ destval = fetch_data_word(destoffset); TRACE_AND_STEP(); push_word(M.x86.R_IP); M.x86.R_IP = destval; break; case 3: /* call far ptr ... */ destval = fetch_data_word(destoffset); destval2 = fetch_data_word(destoffset + 2); TRACE_AND_STEP(); push_word(M.x86.R_CS); M.x86.R_CS = destval2; push_word(M.x86.R_IP); M.x86.R_IP = destval; break; case 4: /* jmp word ptr ... */ destval = fetch_data_word(destoffset); TRACE_AND_STEP(); M.x86.R_IP = destval; break; case 5: /* jmp far ptr ... */ destval = fetch_data_word(destoffset); destval2 = fetch_data_word(destoffset + 2); TRACE_AND_STEP(); M.x86.R_IP = destval; M.x86.R_CS = destval2; break; case 6: /* push word ptr ... */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); push_long(destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); push_word(destval16); } break; } break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); switch (rh) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); destval32 = inc_long(destval32); store_data_long(destoffset, destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); destval16 = inc_word(destval16); store_data_word(destoffset, destval16); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); destval32 = dec_long(destval32); store_data_long(destoffset, destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); destval16 = dec_word(destval16); store_data_word(destoffset, destval16); } break; case 2: /* call word ptr ... */ destval = fetch_data_word(destoffset); TRACE_AND_STEP(); push_word(M.x86.R_IP); M.x86.R_IP = destval; break; case 3: /* call far ptr ... */ destval = fetch_data_word(destoffset); destval2 = fetch_data_word(destoffset + 2); TRACE_AND_STEP(); push_word(M.x86.R_CS); M.x86.R_CS = destval2; push_word(M.x86.R_IP); M.x86.R_IP = destval; break; case 4: /* jmp word ptr ... */ destval = fetch_data_word(destoffset); TRACE_AND_STEP(); M.x86.R_IP = destval; break; case 5: /* jmp far ptr ... */ destval = fetch_data_word(destoffset); destval2 = fetch_data_word(destoffset + 2); TRACE_AND_STEP(); M.x86.R_IP = destval; M.x86.R_CS = destval2; break; case 6: /* push word ptr ... */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval32; destval32 = fetch_data_long(destoffset); TRACE_AND_STEP(); push_long(destval32); } else { u16 destval16; destval16 = fetch_data_word(destoffset); TRACE_AND_STEP(); push_word(destval16); } break; } break; case 3: switch (rh) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg32; destreg32 = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg32 = inc_long(*destreg32); } else { u16 *destreg16; destreg16 = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg16 = inc_word(*destreg16); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg32; destreg32 = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg32 = dec_long(*destreg32); } else { u16 *destreg16; destreg16 = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg16 = dec_word(*destreg16); } break; case 2: /* call word ptr ... */ destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); push_word(M.x86.R_IP); M.x86.R_IP = *destreg; break; case 3: /* jmp far ptr ... */ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n"); TRACE_AND_STEP(); HALT_SYS(); break; case 4: /* jmp ... */ destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); M.x86.R_IP = (u16) (*destreg); break; case 5: /* jmp far ptr ... */ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n"); TRACE_AND_STEP(); HALT_SYS(); break; case 6: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg32; destreg32 = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); push_long(*destreg32); } else { u16 *destreg16; destreg16 = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); push_word(*destreg16); } break; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /*************************************************************************** * Single byte operation code table: **************************************************************************/ void (*x86emu_optab[256]) (u8) = { /* 0x00 */ x86emuOp_add_byte_RM_R, /* 0x01 */ x86emuOp_add_word_RM_R, /* 0x02 */ x86emuOp_add_byte_R_RM, /* 0x03 */ x86emuOp_add_word_R_RM, /* 0x04 */ x86emuOp_add_byte_AL_IMM, /* 0x05 */ x86emuOp_add_word_AX_IMM, /* 0x06 */ x86emuOp_push_ES, /* 0x07 */ x86emuOp_pop_ES, /* 0x08 */ x86emuOp_or_byte_RM_R, /* 0x09 */ x86emuOp_or_word_RM_R, /* 0x0a */ x86emuOp_or_byte_R_RM, /* 0x0b */ x86emuOp_or_word_R_RM, /* 0x0c */ x86emuOp_or_byte_AL_IMM, /* 0x0d */ x86emuOp_or_word_AX_IMM, /* 0x0e */ x86emuOp_push_CS, /* 0x0f */ x86emuOp_two_byte, /* 0x10 */ x86emuOp_adc_byte_RM_R, /* 0x11 */ x86emuOp_adc_word_RM_R, /* 0x12 */ x86emuOp_adc_byte_R_RM, /* 0x13 */ x86emuOp_adc_word_R_RM, /* 0x14 */ x86emuOp_adc_byte_AL_IMM, /* 0x15 */ x86emuOp_adc_word_AX_IMM, /* 0x16 */ x86emuOp_push_SS, /* 0x17 */ x86emuOp_pop_SS, /* 0x18 */ x86emuOp_sbb_byte_RM_R, /* 0x19 */ x86emuOp_sbb_word_RM_R, /* 0x1a */ x86emuOp_sbb_byte_R_RM, /* 0x1b */ x86emuOp_sbb_word_R_RM, /* 0x1c */ x86emuOp_sbb_byte_AL_IMM, /* 0x1d */ x86emuOp_sbb_word_AX_IMM, /* 0x1e */ x86emuOp_push_DS, /* 0x1f */ x86emuOp_pop_DS, /* 0x20 */ x86emuOp_and_byte_RM_R, /* 0x21 */ x86emuOp_and_word_RM_R, /* 0x22 */ x86emuOp_and_byte_R_RM, /* 0x23 */ x86emuOp_and_word_R_RM, /* 0x24 */ x86emuOp_and_byte_AL_IMM, /* 0x25 */ x86emuOp_and_word_AX_IMM, /* 0x26 */ x86emuOp_segovr_ES, /* 0x27 */ x86emuOp_daa, /* 0x28 */ x86emuOp_sub_byte_RM_R, /* 0x29 */ x86emuOp_sub_word_RM_R, /* 0x2a */ x86emuOp_sub_byte_R_RM, /* 0x2b */ x86emuOp_sub_word_R_RM, /* 0x2c */ x86emuOp_sub_byte_AL_IMM, /* 0x2d */ x86emuOp_sub_word_AX_IMM, /* 0x2e */ x86emuOp_segovr_CS, /* 0x2f */ x86emuOp_das, /* 0x30 */ x86emuOp_xor_byte_RM_R, /* 0x31 */ x86emuOp_xor_word_RM_R, /* 0x32 */ x86emuOp_xor_byte_R_RM, /* 0x33 */ x86emuOp_xor_word_R_RM, /* 0x34 */ x86emuOp_xor_byte_AL_IMM, /* 0x35 */ x86emuOp_xor_word_AX_IMM, /* 0x36 */ x86emuOp_segovr_SS, /* 0x37 */ x86emuOp_aaa, /* 0x38 */ x86emuOp_cmp_byte_RM_R, /* 0x39 */ x86emuOp_cmp_word_RM_R, /* 0x3a */ x86emuOp_cmp_byte_R_RM, /* 0x3b */ x86emuOp_cmp_word_R_RM, /* 0x3c */ x86emuOp_cmp_byte_AL_IMM, /* 0x3d */ x86emuOp_cmp_word_AX_IMM, /* 0x3e */ x86emuOp_segovr_DS, /* 0x3f */ x86emuOp_aas, /* 0x40 */ x86emuOp_inc_AX, /* 0x41 */ x86emuOp_inc_CX, /* 0x42 */ x86emuOp_inc_DX, /* 0x43 */ x86emuOp_inc_BX, /* 0x44 */ x86emuOp_inc_SP, /* 0x45 */ x86emuOp_inc_BP, /* 0x46 */ x86emuOp_inc_SI, /* 0x47 */ x86emuOp_inc_DI, /* 0x48 */ x86emuOp_dec_AX, /* 0x49 */ x86emuOp_dec_CX, /* 0x4a */ x86emuOp_dec_DX, /* 0x4b */ x86emuOp_dec_BX, /* 0x4c */ x86emuOp_dec_SP, /* 0x4d */ x86emuOp_dec_BP, /* 0x4e */ x86emuOp_dec_SI, /* 0x4f */ x86emuOp_dec_DI, /* 0x50 */ x86emuOp_push_AX, /* 0x51 */ x86emuOp_push_CX, /* 0x52 */ x86emuOp_push_DX, /* 0x53 */ x86emuOp_push_BX, /* 0x54 */ x86emuOp_push_SP, /* 0x55 */ x86emuOp_push_BP, /* 0x56 */ x86emuOp_push_SI, /* 0x57 */ x86emuOp_push_DI, /* 0x58 */ x86emuOp_pop_AX, /* 0x59 */ x86emuOp_pop_CX, /* 0x5a */ x86emuOp_pop_DX, /* 0x5b */ x86emuOp_pop_BX, /* 0x5c */ x86emuOp_pop_SP, /* 0x5d */ x86emuOp_pop_BP, /* 0x5e */ x86emuOp_pop_SI, /* 0x5f */ x86emuOp_pop_DI, /* 0x60 */ x86emuOp_push_all, /* 0x61 */ x86emuOp_pop_all, /* 0x62 */ x86emuOp_illegal_op, /* bound */ /* 0x63 */ x86emuOp_illegal_op, /* arpl */ /* 0x64 */ x86emuOp_segovr_FS, /* 0x65 */ x86emuOp_segovr_GS, /* 0x66 */ x86emuOp_prefix_data, /* 0x67 */ x86emuOp_prefix_addr, /* 0x68 */ x86emuOp_push_word_IMM, /* 0x69 */ x86emuOp_imul_word_IMM, /* 0x6a */ x86emuOp_push_byte_IMM, /* 0x6b */ x86emuOp_imul_byte_IMM, /* 0x6c */ x86emuOp_ins_byte, /* 0x6d */ x86emuOp_ins_word, /* 0x6e */ x86emuOp_outs_byte, /* 0x6f */ x86emuOp_outs_word, /* 0x70 */ x86emuOp_jump_near_O, /* 0x71 */ x86emuOp_jump_near_NO, /* 0x72 */ x86emuOp_jump_near_B, /* 0x73 */ x86emuOp_jump_near_NB, /* 0x74 */ x86emuOp_jump_near_Z, /* 0x75 */ x86emuOp_jump_near_NZ, /* 0x76 */ x86emuOp_jump_near_BE, /* 0x77 */ x86emuOp_jump_near_NBE, /* 0x78 */ x86emuOp_jump_near_S, /* 0x79 */ x86emuOp_jump_near_NS, /* 0x7a */ x86emuOp_jump_near_P, /* 0x7b */ x86emuOp_jump_near_NP, /* 0x7c */ x86emuOp_jump_near_L, /* 0x7d */ x86emuOp_jump_near_NL, /* 0x7e */ x86emuOp_jump_near_LE, /* 0x7f */ x86emuOp_jump_near_NLE, /* 0x80 */ x86emuOp_opc80_byte_RM_IMM, /* 0x81 */ x86emuOp_opc81_word_RM_IMM, /* 0x82 */ x86emuOp_opc82_byte_RM_IMM, /* 0x83 */ x86emuOp_opc83_word_RM_IMM, /* 0x84 */ x86emuOp_test_byte_RM_R, /* 0x85 */ x86emuOp_test_word_RM_R, /* 0x86 */ x86emuOp_xchg_byte_RM_R, /* 0x87 */ x86emuOp_xchg_word_RM_R, /* 0x88 */ x86emuOp_mov_byte_RM_R, /* 0x89 */ x86emuOp_mov_word_RM_R, /* 0x8a */ x86emuOp_mov_byte_R_RM, /* 0x8b */ x86emuOp_mov_word_R_RM, /* 0x8c */ x86emuOp_mov_word_RM_SR, /* 0x8d */ x86emuOp_lea_word_R_M, /* 0x8e */ x86emuOp_mov_word_SR_RM, /* 0x8f */ x86emuOp_pop_RM, /* 0x90 */ x86emuOp_nop, /* 0x91 */ x86emuOp_xchg_word_AX_CX, /* 0x92 */ x86emuOp_xchg_word_AX_DX, /* 0x93 */ x86emuOp_xchg_word_AX_BX, /* 0x94 */ x86emuOp_xchg_word_AX_SP, /* 0x95 */ x86emuOp_xchg_word_AX_BP, /* 0x96 */ x86emuOp_xchg_word_AX_SI, /* 0x97 */ x86emuOp_xchg_word_AX_DI, /* 0x98 */ x86emuOp_cbw, /* 0x99 */ x86emuOp_cwd, /* 0x9a */ x86emuOp_call_far_IMM, /* 0x9b */ x86emuOp_wait, /* 0x9c */ x86emuOp_pushf_word, /* 0x9d */ x86emuOp_popf_word, /* 0x9e */ x86emuOp_sahf, /* 0x9f */ x86emuOp_lahf, /* 0xa0 */ x86emuOp_mov_AL_M_IMM, /* 0xa1 */ x86emuOp_mov_AX_M_IMM, /* 0xa2 */ x86emuOp_mov_M_AL_IMM, /* 0xa3 */ x86emuOp_mov_M_AX_IMM, /* 0xa4 */ x86emuOp_movs_byte, /* 0xa5 */ x86emuOp_movs_word, /* 0xa6 */ x86emuOp_cmps_byte, /* 0xa7 */ x86emuOp_cmps_word, /* 0xa8 */ x86emuOp_test_AL_IMM, /* 0xa9 */ x86emuOp_test_AX_IMM, /* 0xaa */ x86emuOp_stos_byte, /* 0xab */ x86emuOp_stos_word, /* 0xac */ x86emuOp_lods_byte, /* 0xad */ x86emuOp_lods_word, /* 0xac */ x86emuOp_scas_byte, /* 0xad */ x86emuOp_scas_word, /* 0xb0 */ x86emuOp_mov_byte_AL_IMM, /* 0xb1 */ x86emuOp_mov_byte_CL_IMM, /* 0xb2 */ x86emuOp_mov_byte_DL_IMM, /* 0xb3 */ x86emuOp_mov_byte_BL_IMM, /* 0xb4 */ x86emuOp_mov_byte_AH_IMM, /* 0xb5 */ x86emuOp_mov_byte_CH_IMM, /* 0xb6 */ x86emuOp_mov_byte_DH_IMM, /* 0xb7 */ x86emuOp_mov_byte_BH_IMM, /* 0xb8 */ x86emuOp_mov_word_AX_IMM, /* 0xb9 */ x86emuOp_mov_word_CX_IMM, /* 0xba */ x86emuOp_mov_word_DX_IMM, /* 0xbb */ x86emuOp_mov_word_BX_IMM, /* 0xbc */ x86emuOp_mov_word_SP_IMM, /* 0xbd */ x86emuOp_mov_word_BP_IMM, /* 0xbe */ x86emuOp_mov_word_SI_IMM, /* 0xbf */ x86emuOp_mov_word_DI_IMM, /* 0xc0 */ x86emuOp_opcC0_byte_RM_MEM, /* 0xc1 */ x86emuOp_opcC1_word_RM_MEM, /* 0xc2 */ x86emuOp_ret_near_IMM, /* 0xc3 */ x86emuOp_ret_near, /* 0xc4 */ x86emuOp_les_R_IMM, /* 0xc5 */ x86emuOp_lds_R_IMM, /* 0xc6 */ x86emuOp_mov_byte_RM_IMM, /* 0xc7 */ x86emuOp_mov_word_RM_IMM, /* 0xc8 */ x86emuOp_enter, /* 0xc9 */ x86emuOp_leave, /* 0xca */ x86emuOp_ret_far_IMM, /* 0xcb */ x86emuOp_ret_far, /* 0xcc */ x86emuOp_int3, /* 0xcd */ x86emuOp_int_IMM, /* 0xce */ x86emuOp_into, /* 0xcf */ x86emuOp_iret, /* 0xd0 */ x86emuOp_opcD0_byte_RM_1, /* 0xd1 */ x86emuOp_opcD1_word_RM_1, /* 0xd2 */ x86emuOp_opcD2_byte_RM_CL, /* 0xd3 */ x86emuOp_opcD3_word_RM_CL, /* 0xd4 */ x86emuOp_aam, /* 0xd5 */ x86emuOp_aad, /* 0xd6 */ x86emuOp_illegal_op, /* Undocumented SETALC instruction */ /* 0xd7 */ x86emuOp_xlat, /* 0xd8 */ x86emuOp_esc_coprocess_d8, /* 0xd9 */ x86emuOp_esc_coprocess_d9, /* 0xda */ x86emuOp_esc_coprocess_da, /* 0xdb */ x86emuOp_esc_coprocess_db, /* 0xdc */ x86emuOp_esc_coprocess_dc, /* 0xdd */ x86emuOp_esc_coprocess_dd, /* 0xde */ x86emuOp_esc_coprocess_de, /* 0xdf */ x86emuOp_esc_coprocess_df, /* 0xe0 */ x86emuOp_loopne, /* 0xe1 */ x86emuOp_loope, /* 0xe2 */ x86emuOp_loop, /* 0xe3 */ x86emuOp_jcxz, /* 0xe4 */ x86emuOp_in_byte_AL_IMM, /* 0xe5 */ x86emuOp_in_word_AX_IMM, /* 0xe6 */ x86emuOp_out_byte_IMM_AL, /* 0xe7 */ x86emuOp_out_word_IMM_AX, /* 0xe8 */ x86emuOp_call_near_IMM, /* 0xe9 */ x86emuOp_jump_near_IMM, /* 0xea */ x86emuOp_jump_far_IMM, /* 0xeb */ x86emuOp_jump_byte_IMM, /* 0xec */ x86emuOp_in_byte_AL_DX, /* 0xed */ x86emuOp_in_word_AX_DX, /* 0xee */ x86emuOp_out_byte_DX_AL, /* 0xef */ x86emuOp_out_word_DX_AX, /* 0xf0 */ x86emuOp_lock, /* 0xf1 */ x86emuOp_illegal_op, /* 0xf2 */ x86emuOp_repne, /* 0xf3 */ x86emuOp_repe, /* 0xf4 */ x86emuOp_halt, /* 0xf5 */ x86emuOp_cmc, /* 0xf6 */ x86emuOp_opcF6_byte_RM, /* 0xf7 */ x86emuOp_opcF7_word_RM, /* 0xf8 */ x86emuOp_clc, /* 0xf9 */ x86emuOp_stc, /* 0xfa */ x86emuOp_cli, /* 0xfb */ x86emuOp_sti, /* 0xfc */ x86emuOp_cld, /* 0xfd */ x86emuOp_std, /* 0xfe */ x86emuOp_opcFE_byte_RM, /* 0xff */ x86emuOp_opcFF_word_RM, }; xorg-server-1.17.1/hw/xfree86/x86emu/ops2.c0000664000175100017510000027104112366220413015105 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: This file includes subroutines to implement the decoding * and emulation of all the x86 extended two-byte processor * instructions. * ****************************************************************************/ #include "x86emu/x86emui.h" #undef bswap_32 #define bswap_32(x) (((x & 0xff000000) >> 24) | \ ((x & 0x00ff0000) >> 8) | \ ((x & 0x0000ff00) << 8) | \ ((x & 0x000000ff) << 24)) /*----------------------------- Implementation ----------------------------*/ /**************************************************************************** PARAMETERS: op1 - Instruction op code REMARKS: Handles illegal opcodes. ****************************************************************************/ static void x86emuOp2_illegal_op(u8 op2) { START_OF_INSTR(); DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n"); TRACE_REGS(); printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n", M.x86.R_CS, M.x86.R_IP - 2, op2); HALT_SYS(); END_OF_INSTR(); } #define xorl(a,b) ((a) && !(b)) || (!(a) && (b)) /**************************************************************************** REMARKS: Handles opcode 0x0f,0x31 ****************************************************************************/ static void x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2)) { #ifdef __HAS_LONG_LONG__ static u64 counter = 0; #else static u32 counter = 0; #endif counter += 0x10000; /* read timestamp counter */ /* * Note that instead of actually trying to accurately measure this, we just * increase the counter by a fixed amount every time we hit one of these * instructions. Feel free to come up with a better method. */ START_OF_INSTR(); DECODE_PRINTF("RDTSC\n"); TRACE_AND_STEP(); #ifdef __HAS_LONG_LONG__ M.x86.R_EAX = counter & 0xffffffff; M.x86.R_EDX = counter >> 32; #else M.x86.R_EAX = counter; M.x86.R_EDX = 0; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0x80-0x8F ****************************************************************************/ static void x86emuOp2_long_jump(u8 op2) { s32 target; const char *name = NULL; int cond = 0; /* conditional jump to word offset. */ START_OF_INSTR(); switch (op2) { case 0x80: name = "JO\t"; cond = ACCESS_FLAG(F_OF); break; case 0x81: name = "JNO\t"; cond = !ACCESS_FLAG(F_OF); break; case 0x82: name = "JB\t"; cond = ACCESS_FLAG(F_CF); break; case 0x83: name = "JNB\t"; cond = !ACCESS_FLAG(F_CF); break; case 0x84: name = "JZ\t"; cond = ACCESS_FLAG(F_ZF); break; case 0x85: name = "JNZ\t"; cond = !ACCESS_FLAG(F_ZF); break; case 0x86: name = "JBE\t"; cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF); break; case 0x87: name = "JNBE\t"; cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)); break; case 0x88: name = "JS\t"; cond = ACCESS_FLAG(F_SF); break; case 0x89: name = "JNS\t"; cond = !ACCESS_FLAG(F_SF); break; case 0x8a: name = "JP\t"; cond = ACCESS_FLAG(F_PF); break; case 0x8b: name = "JNP\t"; cond = !ACCESS_FLAG(F_PF); break; case 0x8c: name = "JL\t"; cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)); break; case 0x8d: name = "JNL\t"; cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF))); break; case 0x8e: name = "JLE\t"; cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) || ACCESS_FLAG(F_ZF)); break; case 0x8f: name = "JNLE\t"; cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) || ACCESS_FLAG(F_ZF)); break; } DECODE_PRINTF(name); (void) name; target = (s16) fetch_word_imm(); target += (s16) M.x86.R_IP; DECODE_PRINTF2("%04x\n", target); TRACE_AND_STEP(); if (cond) M.x86.R_IP = (u16) target; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0x90-0x9F ****************************************************************************/ static void x86emuOp2_set_byte(u8 op2) { int mod, rl, rh; uint destoffset; u8 *destreg; const char *name = NULL; int cond = 0; START_OF_INSTR(); switch (op2) { case 0x90: name = "SETO\t"; cond = ACCESS_FLAG(F_OF); break; case 0x91: name = "SETNO\t"; cond = !ACCESS_FLAG(F_OF); break; case 0x92: name = "SETB\t"; cond = ACCESS_FLAG(F_CF); break; case 0x93: name = "SETNB\t"; cond = !ACCESS_FLAG(F_CF); break; case 0x94: name = "SETZ\t"; cond = ACCESS_FLAG(F_ZF); break; case 0x95: name = "SETNZ\t"; cond = !ACCESS_FLAG(F_ZF); break; case 0x96: name = "SETBE\t"; cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF); break; case 0x97: name = "SETNBE\t"; cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)); break; case 0x98: name = "SETS\t"; cond = ACCESS_FLAG(F_SF); break; case 0x99: name = "SETNS\t"; cond = !ACCESS_FLAG(F_SF); break; case 0x9a: name = "SETP\t"; cond = ACCESS_FLAG(F_PF); break; case 0x9b: name = "SETNP\t"; cond = !ACCESS_FLAG(F_PF); break; case 0x9c: name = "SETL\t"; cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)); break; case 0x9d: name = "SETNL\t"; cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)); break; case 0x9e: name = "SETLE\t"; cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) || ACCESS_FLAG(F_ZF)); break; case 0x9f: name = "SETNLE\t"; cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) || ACCESS_FLAG(F_ZF)); break; } DECODE_PRINTF(name); (void) name; FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); TRACE_AND_STEP(); store_data_byte(destoffset, cond ? 0x01 : 0x00); break; case 1: destoffset = decode_rm01_address(rl); TRACE_AND_STEP(); store_data_byte(destoffset, cond ? 0x01 : 0x00); break; case 2: destoffset = decode_rm10_address(rl); TRACE_AND_STEP(); store_data_byte(destoffset, cond ? 0x01 : 0x00); break; case 3: /* register to register */ destreg = DECODE_RM_BYTE_REGISTER(rl); TRACE_AND_STEP(); *destreg = cond ? 0x01 : 0x00; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xa0 ****************************************************************************/ static void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2)) { START_OF_INSTR(); DECODE_PRINTF("PUSH\tFS\n"); TRACE_AND_STEP(); push_word(M.x86.R_FS); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xa1 ****************************************************************************/ static void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2)) { START_OF_INSTR(); DECODE_PRINTF("POP\tFS\n"); TRACE_AND_STEP(); M.x86.R_FS = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: CPUID takes EAX/ECX as inputs, writes EAX/EBX/ECX/EDX as output Handles opcode 0x0f,0xa2 ****************************************************************************/ static void x86emuOp2_cpuid(u8 X86EMU_UNUSED(op2)) { START_OF_INSTR(); DECODE_PRINTF("CPUID\n"); TRACE_AND_STEP(); cpuid(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xa3 ****************************************************************************/ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; int bit, disp; START_OF_INSTR(); DECODE_PRINTF("BT\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval; u32 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF); } else { u16 srcval; u16 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval; u32 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF); } else { u16 srcval; u16 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval; u32 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF); } else { u16 srcval; u16 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg, *shiftreg; srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit), F_CF); } else { u16 *srcreg, *shiftreg; srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit), F_CF); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xa4 ****************************************************************************/ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint destoffset; u8 shift; START_OF_INSTR(); DECODE_PRINTF("SHLD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shld_long(destval, *shiftreg, shift); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shld_word(destval, *shiftreg, shift); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shld_long(destval, *shiftreg, shift); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shld_word(destval, *shiftreg, shift); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shld_long(destval, *shiftreg, shift); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shld_word(destval, *shiftreg, shift); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *shiftreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); *destreg = shld_long(*destreg, *shiftreg, shift); } else { u16 *destreg, *shiftreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); *destreg = shld_word(*destreg, *shiftreg, shift); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xa5 ****************************************************************************/ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("SHLD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shld_long(destval, *shiftreg, M.x86.R_CL); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shld_word(destval, *shiftreg, M.x86.R_CL); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shld_long(destval, *shiftreg, M.x86.R_CL); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shld_word(destval, *shiftreg, M.x86.R_CL); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shld_long(destval, *shiftreg, M.x86.R_CL); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shld_word(destval, *shiftreg, M.x86.R_CL); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *shiftreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); *destreg = shld_long(*destreg, *shiftreg, M.x86.R_CL); } else { u16 *destreg, *shiftreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); *destreg = shld_word(*destreg, *shiftreg, M.x86.R_CL); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xa8 ****************************************************************************/ static void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2)) { START_OF_INSTR(); DECODE_PRINTF("PUSH\tGS\n"); TRACE_AND_STEP(); push_word(M.x86.R_GS); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xa9 ****************************************************************************/ static void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2)) { START_OF_INSTR(); DECODE_PRINTF("POP\tGS\n"); TRACE_AND_STEP(); M.x86.R_GS = pop_word(); DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xab ****************************************************************************/ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; int bit, disp; START_OF_INSTR(); DECODE_PRINTF("BTS\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval | mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, srcval | mask); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval | mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, srcval | mask); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval | mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, srcval | mask); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg, *shiftreg; u32 mask; srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; mask = (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); *srcreg |= mask; } else { u16 *srcreg, *shiftreg; u16 mask; srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); *srcreg |= mask; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xac ****************************************************************************/ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint destoffset; u8 shift; START_OF_INSTR(); DECODE_PRINTF("SHLD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shrd_long(destval, *shiftreg, shift); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shrd_word(destval, *shiftreg, shift); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shrd_long(destval, *shiftreg, shift); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shrd_word(destval, *shiftreg, shift); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shrd_long(destval, *shiftreg, shift); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shrd_word(destval, *shiftreg, shift); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *shiftreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); *destreg = shrd_long(*destreg, *shiftreg, shift); } else { u16 *destreg, *shiftreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); shift = fetch_byte_imm(); DECODE_PRINTF2("%d\n", shift); TRACE_AND_STEP(); *destreg = shrd_word(*destreg, *shiftreg, shift); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xad ****************************************************************************/ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint destoffset; START_OF_INSTR(); DECODE_PRINTF("SHLD\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shrd_long(destval, *shiftreg, M.x86.R_CL); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shrd_word(destval, *shiftreg, M.x86.R_CL); store_data_word(destoffset, destval); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shrd_long(destval, *shiftreg, M.x86.R_CL); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shrd_word(destval, *shiftreg, M.x86.R_CL); store_data_word(destoffset, destval); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 destval; u32 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_long(destoffset); destval = shrd_long(destval, *shiftreg, M.x86.R_CL); store_data_long(destoffset, destval); } else { u16 destval; u16 *shiftreg; destoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); destval = fetch_data_word(destoffset); destval = shrd_word(destval, *shiftreg, M.x86.R_CL); store_data_word(destoffset, destval); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *shiftreg; destreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); *destreg = shrd_long(*destreg, *shiftreg, M.x86.R_CL); } else { u16 *destreg, *shiftreg; destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(",CL\n"); TRACE_AND_STEP(); *destreg = shrd_word(*destreg, *shiftreg, M.x86.R_CL); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xaf ****************************************************************************/ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("IMUL\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_long(srcoffset); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); TRACE_AND_STEP(); res = (s16) * destreg * (s16) srcval; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_long(srcoffset); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); TRACE_AND_STEP(); res = (s16) * destreg * (s16) srcval; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_long(srcoffset); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg; u16 srcval; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); TRACE_AND_STEP(); res = (s16) * destreg * (s16) srcval; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg, *srcreg; u32 res_lo, res_hi; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_LONG_REGISTER(rl); TRACE_AND_STEP(); imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) * srcreg); if (res_hi != 0) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u32) res_lo; } else { u16 *destreg, *srcreg; u32 res; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); res = (s16) * destreg * (s16) * srcreg; if (res > 0xFFFF) { SET_FLAG(F_CF); SET_FLAG(F_OF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } *destreg = (u16) res; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xb2 ****************************************************************************/ static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2)) { int mod, rh, rl; u16 *dstreg; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("LSS\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_SS = fetch_data_word(srcoffset + 2); break; case 1: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_SS = fetch_data_word(srcoffset + 2); break; case 2: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_SS = fetch_data_word(srcoffset + 2); break; case 3: /* register to register */ /* UNDEFINED! */ TRACE_AND_STEP(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xb3 ****************************************************************************/ static void x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; int bit, disp; START_OF_INSTR(); DECODE_PRINTF("BTR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval & ~mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, (u16) (srcval & ~mask)); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval & ~mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, (u16) (srcval & ~mask)); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval & ~mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, (u16) (srcval & ~mask)); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg, *shiftreg; u32 mask; srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; mask = (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); *srcreg &= ~mask; } else { u16 *srcreg, *shiftreg; u16 mask; srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); *srcreg &= ~mask; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xb4 ****************************************************************************/ static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2)) { int mod, rh, rl; u16 *dstreg; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("LFS\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_FS = fetch_data_word(srcoffset + 2); break; case 1: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_FS = fetch_data_word(srcoffset + 2); break; case 2: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_FS = fetch_data_word(srcoffset + 2); break; case 3: /* register to register */ /* UNDEFINED! */ TRACE_AND_STEP(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xb5 ****************************************************************************/ static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2)) { int mod, rh, rl; u16 *dstreg; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("LGS\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_GS = fetch_data_word(srcoffset + 2); break; case 1: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_GS = fetch_data_word(srcoffset + 2); break; case 2: dstreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *dstreg = fetch_data_word(srcoffset); M.x86.R_GS = fetch_data_word(srcoffset + 2); break; case 3: /* register to register */ /* UNDEFINED! */ TRACE_AND_STEP(); } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xb6 ****************************************************************************/ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("MOVZX\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_byte(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u8 *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; } else { u16 *destreg; u8 *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xb7 ****************************************************************************/ static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; u32 *destreg; u32 srcval; u16 *srcreg; START_OF_INSTR(); DECODE_PRINTF("MOVZX\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 1: destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 2: destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = fetch_data_word(srcoffset); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 3: /* register to register */ destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = *srcreg; break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xba ****************************************************************************/ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; int bit; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); switch (rh) { case 4: DECODE_PRINTF("BT\t"); break; case 5: DECODE_PRINTF("BTS\t"); break; case 6: DECODE_PRINTF("BTR\t"); break; case 7: DECODE_PRINTF("BTC\t"); break; default: DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n"); TRACE_REGS(); printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n", M.x86.R_CS, M.x86.R_IP - 3, op2, (mod << 6) | (rh << 3) | rl); HALT_SYS(); } switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u8 shift; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0x1F; srcval = fetch_data_long(srcoffset); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); switch (rh) { case 5: store_data_long(srcoffset, srcval | mask); break; case 6: store_data_long(srcoffset, srcval & ~mask); break; case 7: store_data_long(srcoffset, srcval ^ mask); break; default: break; } } else { u16 srcval, mask; u8 shift; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0xF; srcval = fetch_data_word(srcoffset); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); switch (rh) { case 5: store_data_word(srcoffset, srcval | mask); break; case 6: store_data_word(srcoffset, srcval & ~mask); break; case 7: store_data_word(srcoffset, srcval ^ mask); break; default: break; } } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u8 shift; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0x1F; srcval = fetch_data_long(srcoffset); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); switch (rh) { case 5: store_data_long(srcoffset, srcval | mask); break; case 6: store_data_long(srcoffset, srcval & ~mask); break; case 7: store_data_long(srcoffset, srcval ^ mask); break; default: break; } } else { u16 srcval, mask; u8 shift; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0xF; srcval = fetch_data_word(srcoffset); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); switch (rh) { case 5: store_data_word(srcoffset, srcval | mask); break; case 6: store_data_word(srcoffset, srcval & ~mask); break; case 7: store_data_word(srcoffset, srcval ^ mask); break; default: break; } } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u8 shift; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0x1F; srcval = fetch_data_long(srcoffset); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); switch (rh) { case 5: store_data_long(srcoffset, srcval | mask); break; case 6: store_data_long(srcoffset, srcval & ~mask); break; case 7: store_data_long(srcoffset, srcval ^ mask); break; default: break; } } else { u16 srcval, mask; u8 shift; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0xF; srcval = fetch_data_word(srcoffset); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); switch (rh) { case 5: store_data_word(srcoffset, srcval | mask); break; case 6: store_data_word(srcoffset, srcval & ~mask); break; case 7: store_data_word(srcoffset, srcval ^ mask); break; default: break; } } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg; u32 mask; u8 shift; srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0x1F; mask = (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); switch (rh) { case 5: *srcreg |= mask; break; case 6: *srcreg &= ~mask; break; case 7: *srcreg ^= mask; break; default: break; } } else { u16 *srcreg; u16 mask; u8 shift; srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shift = fetch_byte_imm(); TRACE_AND_STEP(); bit = shift & 0xF; mask = (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); switch (rh) { case 5: *srcreg |= mask; break; case 6: *srcreg &= ~mask; break; case 7: *srcreg ^= mask; break; default: break; } } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xbb ****************************************************************************/ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; int bit, disp; START_OF_INSTR(); DECODE_PRINTF("BTC\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval ^ mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, (u16) (srcval ^ mask)); } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval ^ mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, (u16) (srcval ^ mask)); } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, mask; u32 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; disp = (s16) * shiftreg >> 5; srcval = fetch_data_long(srcoffset + disp); mask = (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_long(srcoffset + disp, srcval ^ mask); } else { u16 srcval, mask; u16 *shiftreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; disp = (s16) * shiftreg >> 4; srcval = fetch_data_word(srcoffset + disp); mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(srcval & mask, F_CF); store_data_word(srcoffset + disp, (u16) (srcval ^ mask)); } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *srcreg, *shiftreg; u32 mask; srcreg = DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0x1F; mask = (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); *srcreg ^= mask; } else { u16 *srcreg, *shiftreg; u16 mask; srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); shiftreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); bit = *shiftreg & 0xF; mask = (u16) (0x1 << bit); CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF); *srcreg ^= mask; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xbc ****************************************************************************/ static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("BSF\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_long(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 32; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_word(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 16; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_long(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 32; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_word(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 16; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_long(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 32; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_word(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 16; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcval = *DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 32; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcval = *DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 0; *dstreg < 16; (*dstreg)++) if ((srcval >> *dstreg) & 1) break; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xbd ****************************************************************************/ static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("BSR\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_long(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 31; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcoffset = decode_rm00_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_word(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 15; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_long(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 31; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcoffset = decode_rm01_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_word(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 15; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_long(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 31; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcoffset = decode_rm10_address(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); srcval = fetch_data_word(srcoffset); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 15; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 srcval, *dstreg; srcval = *DECODE_RM_LONG_REGISTER(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_LONG_REGISTER(rh); TRACE_AND_STEP(); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 31; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } else { u16 srcval, *dstreg; srcval = *DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF(","); dstreg = DECODE_RM_WORD_REGISTER(rh); TRACE_AND_STEP(); CONDITIONAL_SET_FLAG(srcval == 0, F_ZF); for (*dstreg = 15; *dstreg > 0; (*dstreg)--) if ((srcval >> *dstreg) & 1) break; } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xbe ****************************************************************************/ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; START_OF_INSTR(); DECODE_PRINTF("MOVSX\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = (s32) ((s8) fetch_data_byte(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = (s16) ((s8) fetch_data_byte(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 1: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = (s32) ((s8) fetch_data_byte(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = (s16) ((s8) fetch_data_byte(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 2: if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u32 srcval; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = (s32) ((s8) fetch_data_byte(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } else { u16 *destreg; u16 srcval; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = (s16) ((s8) fetch_data_byte(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; } break; case 3: /* register to register */ if (M.x86.mode & SYSMODE_PREFIX_DATA) { u32 *destreg; u8 *srcreg; destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = (s32) ((s8) * srcreg); } else { u16 *destreg; u8 *srcreg; destreg = DECODE_RM_WORD_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_BYTE_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = (s16) ((s8) * srcreg); } break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /**************************************************************************** REMARKS: Handles opcode 0x0f,0xbf ****************************************************************************/ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2)) { int mod, rl, rh; uint srcoffset; u32 *destreg; u32 srcval; u16 *srcreg; START_OF_INSTR(); DECODE_PRINTF("MOVSX\t"); FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm00_address(rl); srcval = (s32) ((s16) fetch_data_word(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 1: destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm01_address(rl); srcval = (s32) ((s16) fetch_data_word(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 2: destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcoffset = decode_rm10_address(rl); srcval = (s32) ((s16) fetch_data_word(srcoffset)); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = srcval; break; case 3: /* register to register */ destreg = DECODE_RM_LONG_REGISTER(rh); DECODE_PRINTF(","); srcreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); *destreg = (s32) ((s16) * srcreg); break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /* Handles opcodes 0xc8-0xcf */ static void x86emuOp2_bswap(u8 X86EMU_UNUSED(op2)) { START_OF_INSTR(); DECODE_PRINTF("BSWAP\n"); TRACE_AND_STEP(); switch (op2) { case 0xc8: M.x86.R_EAX = bswap_32(M.x86.R_EAX); break; case 0xc9: M.x86.R_ECX = bswap_32(M.x86.R_ECX); break; case 0xca: M.x86.R_EDX = bswap_32(M.x86.R_EDX); break; case 0xcb: M.x86.R_EBX = bswap_32(M.x86.R_EBX); break; case 0xcc: M.x86.R_ESP = bswap_32(M.x86.R_ESP); break; case 0xcd: M.x86.R_EBP = bswap_32(M.x86.R_EBP); break; case 0xce: M.x86.R_ESI = bswap_32(M.x86.R_ESI); break; case 0xcf: M.x86.R_EDI = bswap_32(M.x86.R_EDI); break; default: /* can't happen */ break; } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } /*************************************************************************** * Double byte operation code table: **************************************************************************/ void (*x86emu_optab2[256]) (u8) = { /* 0x00 */ x86emuOp2_illegal_op, /* Group F (ring 0 PM) */ /* 0x01 */ x86emuOp2_illegal_op, /* Group G (ring 0 PM) */ /* 0x02 */ x86emuOp2_illegal_op, /* lar (ring 0 PM) */ /* 0x03 */ x86emuOp2_illegal_op, /* lsl (ring 0 PM) */ /* 0x04 */ x86emuOp2_illegal_op, /* 0x05 */ x86emuOp2_illegal_op, /* loadall (undocumented) */ /* 0x06 */ x86emuOp2_illegal_op, /* clts (ring 0 PM) */ /* 0x07 */ x86emuOp2_illegal_op, /* loadall (undocumented) */ /* 0x08 */ x86emuOp2_illegal_op, /* invd (ring 0 PM) */ /* 0x09 */ x86emuOp2_illegal_op, /* wbinvd (ring 0 PM) */ /* 0x0a */ x86emuOp2_illegal_op, /* 0x0b */ x86emuOp2_illegal_op, /* 0x0c */ x86emuOp2_illegal_op, /* 0x0d */ x86emuOp2_illegal_op, /* 0x0e */ x86emuOp2_illegal_op, /* 0x0f */ x86emuOp2_illegal_op, /* 0x10 */ x86emuOp2_illegal_op, /* 0x11 */ x86emuOp2_illegal_op, /* 0x12 */ x86emuOp2_illegal_op, /* 0x13 */ x86emuOp2_illegal_op, /* 0x14 */ x86emuOp2_illegal_op, /* 0x15 */ x86emuOp2_illegal_op, /* 0x16 */ x86emuOp2_illegal_op, /* 0x17 */ x86emuOp2_illegal_op, /* 0x18 */ x86emuOp2_illegal_op, /* 0x19 */ x86emuOp2_illegal_op, /* 0x1a */ x86emuOp2_illegal_op, /* 0x1b */ x86emuOp2_illegal_op, /* 0x1c */ x86emuOp2_illegal_op, /* 0x1d */ x86emuOp2_illegal_op, /* 0x1e */ x86emuOp2_illegal_op, /* 0x1f */ x86emuOp2_illegal_op, /* 0x20 */ x86emuOp2_illegal_op, /* mov reg32,creg (ring 0 PM) */ /* 0x21 */ x86emuOp2_illegal_op, /* mov reg32,dreg (ring 0 PM) */ /* 0x22 */ x86emuOp2_illegal_op, /* mov creg,reg32 (ring 0 PM) */ /* 0x23 */ x86emuOp2_illegal_op, /* mov dreg,reg32 (ring 0 PM) */ /* 0x24 */ x86emuOp2_illegal_op, /* mov reg32,treg (ring 0 PM) */ /* 0x25 */ x86emuOp2_illegal_op, /* 0x26 */ x86emuOp2_illegal_op, /* mov treg,reg32 (ring 0 PM) */ /* 0x27 */ x86emuOp2_illegal_op, /* 0x28 */ x86emuOp2_illegal_op, /* 0x29 */ x86emuOp2_illegal_op, /* 0x2a */ x86emuOp2_illegal_op, /* 0x2b */ x86emuOp2_illegal_op, /* 0x2c */ x86emuOp2_illegal_op, /* 0x2d */ x86emuOp2_illegal_op, /* 0x2e */ x86emuOp2_illegal_op, /* 0x2f */ x86emuOp2_illegal_op, /* 0x30 */ x86emuOp2_illegal_op, /* 0x31 */ x86emuOp2_rdtsc, /* 0x32 */ x86emuOp2_illegal_op, /* 0x33 */ x86emuOp2_illegal_op, /* 0x34 */ x86emuOp2_illegal_op, /* 0x35 */ x86emuOp2_illegal_op, /* 0x36 */ x86emuOp2_illegal_op, /* 0x37 */ x86emuOp2_illegal_op, /* 0x38 */ x86emuOp2_illegal_op, /* 0x39 */ x86emuOp2_illegal_op, /* 0x3a */ x86emuOp2_illegal_op, /* 0x3b */ x86emuOp2_illegal_op, /* 0x3c */ x86emuOp2_illegal_op, /* 0x3d */ x86emuOp2_illegal_op, /* 0x3e */ x86emuOp2_illegal_op, /* 0x3f */ x86emuOp2_illegal_op, /* 0x40 */ x86emuOp2_illegal_op, /* 0x41 */ x86emuOp2_illegal_op, /* 0x42 */ x86emuOp2_illegal_op, /* 0x43 */ x86emuOp2_illegal_op, /* 0x44 */ x86emuOp2_illegal_op, /* 0x45 */ x86emuOp2_illegal_op, /* 0x46 */ x86emuOp2_illegal_op, /* 0x47 */ x86emuOp2_illegal_op, /* 0x48 */ x86emuOp2_illegal_op, /* 0x49 */ x86emuOp2_illegal_op, /* 0x4a */ x86emuOp2_illegal_op, /* 0x4b */ x86emuOp2_illegal_op, /* 0x4c */ x86emuOp2_illegal_op, /* 0x4d */ x86emuOp2_illegal_op, /* 0x4e */ x86emuOp2_illegal_op, /* 0x4f */ x86emuOp2_illegal_op, /* 0x50 */ x86emuOp2_illegal_op, /* 0x51 */ x86emuOp2_illegal_op, /* 0x52 */ x86emuOp2_illegal_op, /* 0x53 */ x86emuOp2_illegal_op, /* 0x54 */ x86emuOp2_illegal_op, /* 0x55 */ x86emuOp2_illegal_op, /* 0x56 */ x86emuOp2_illegal_op, /* 0x57 */ x86emuOp2_illegal_op, /* 0x58 */ x86emuOp2_illegal_op, /* 0x59 */ x86emuOp2_illegal_op, /* 0x5a */ x86emuOp2_illegal_op, /* 0x5b */ x86emuOp2_illegal_op, /* 0x5c */ x86emuOp2_illegal_op, /* 0x5d */ x86emuOp2_illegal_op, /* 0x5e */ x86emuOp2_illegal_op, /* 0x5f */ x86emuOp2_illegal_op, /* 0x60 */ x86emuOp2_illegal_op, /* 0x61 */ x86emuOp2_illegal_op, /* 0x62 */ x86emuOp2_illegal_op, /* 0x63 */ x86emuOp2_illegal_op, /* 0x64 */ x86emuOp2_illegal_op, /* 0x65 */ x86emuOp2_illegal_op, /* 0x66 */ x86emuOp2_illegal_op, /* 0x67 */ x86emuOp2_illegal_op, /* 0x68 */ x86emuOp2_illegal_op, /* 0x69 */ x86emuOp2_illegal_op, /* 0x6a */ x86emuOp2_illegal_op, /* 0x6b */ x86emuOp2_illegal_op, /* 0x6c */ x86emuOp2_illegal_op, /* 0x6d */ x86emuOp2_illegal_op, /* 0x6e */ x86emuOp2_illegal_op, /* 0x6f */ x86emuOp2_illegal_op, /* 0x70 */ x86emuOp2_illegal_op, /* 0x71 */ x86emuOp2_illegal_op, /* 0x72 */ x86emuOp2_illegal_op, /* 0x73 */ x86emuOp2_illegal_op, /* 0x74 */ x86emuOp2_illegal_op, /* 0x75 */ x86emuOp2_illegal_op, /* 0x76 */ x86emuOp2_illegal_op, /* 0x77 */ x86emuOp2_illegal_op, /* 0x78 */ x86emuOp2_illegal_op, /* 0x79 */ x86emuOp2_illegal_op, /* 0x7a */ x86emuOp2_illegal_op, /* 0x7b */ x86emuOp2_illegal_op, /* 0x7c */ x86emuOp2_illegal_op, /* 0x7d */ x86emuOp2_illegal_op, /* 0x7e */ x86emuOp2_illegal_op, /* 0x7f */ x86emuOp2_illegal_op, /* 0x80 */ x86emuOp2_long_jump, /* 0x81 */ x86emuOp2_long_jump, /* 0x82 */ x86emuOp2_long_jump, /* 0x83 */ x86emuOp2_long_jump, /* 0x84 */ x86emuOp2_long_jump, /* 0x85 */ x86emuOp2_long_jump, /* 0x86 */ x86emuOp2_long_jump, /* 0x87 */ x86emuOp2_long_jump, /* 0x88 */ x86emuOp2_long_jump, /* 0x89 */ x86emuOp2_long_jump, /* 0x8a */ x86emuOp2_long_jump, /* 0x8b */ x86emuOp2_long_jump, /* 0x8c */ x86emuOp2_long_jump, /* 0x8d */ x86emuOp2_long_jump, /* 0x8e */ x86emuOp2_long_jump, /* 0x8f */ x86emuOp2_long_jump, /* 0x90 */ x86emuOp2_set_byte, /* 0x91 */ x86emuOp2_set_byte, /* 0x92 */ x86emuOp2_set_byte, /* 0x93 */ x86emuOp2_set_byte, /* 0x94 */ x86emuOp2_set_byte, /* 0x95 */ x86emuOp2_set_byte, /* 0x96 */ x86emuOp2_set_byte, /* 0x97 */ x86emuOp2_set_byte, /* 0x98 */ x86emuOp2_set_byte, /* 0x99 */ x86emuOp2_set_byte, /* 0x9a */ x86emuOp2_set_byte, /* 0x9b */ x86emuOp2_set_byte, /* 0x9c */ x86emuOp2_set_byte, /* 0x9d */ x86emuOp2_set_byte, /* 0x9e */ x86emuOp2_set_byte, /* 0x9f */ x86emuOp2_set_byte, /* 0xa0 */ x86emuOp2_push_FS, /* 0xa1 */ x86emuOp2_pop_FS, /* 0xa2 */ x86emuOp2_cpuid, /* 0xa3 */ x86emuOp2_bt_R, /* 0xa4 */ x86emuOp2_shld_IMM, /* 0xa5 */ x86emuOp2_shld_CL, /* 0xa6 */ x86emuOp2_illegal_op, /* 0xa7 */ x86emuOp2_illegal_op, /* 0xa8 */ x86emuOp2_push_GS, /* 0xa9 */ x86emuOp2_pop_GS, /* 0xaa */ x86emuOp2_illegal_op, /* 0xab */ x86emuOp2_bts_R, /* 0xac */ x86emuOp2_shrd_IMM, /* 0xad */ x86emuOp2_shrd_CL, /* 0xae */ x86emuOp2_illegal_op, /* 0xaf */ x86emuOp2_imul_R_RM, /* 0xb0 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */ /* 0xb1 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */ /* 0xb2 */ x86emuOp2_lss_R_IMM, /* 0xb3 */ x86emuOp2_btr_R, /* 0xb4 */ x86emuOp2_lfs_R_IMM, /* 0xb5 */ x86emuOp2_lgs_R_IMM, /* 0xb6 */ x86emuOp2_movzx_byte_R_RM, /* 0xb7 */ x86emuOp2_movzx_word_R_RM, /* 0xb8 */ x86emuOp2_illegal_op, /* 0xb9 */ x86emuOp2_illegal_op, /* 0xba */ x86emuOp2_btX_I, /* 0xbb */ x86emuOp2_btc_R, /* 0xbc */ x86emuOp2_bsf, /* 0xbd */ x86emuOp2_bsr, /* 0xbe */ x86emuOp2_movsx_byte_R_RM, /* 0xbf */ x86emuOp2_movsx_word_R_RM, /* 0xc0 */ x86emuOp2_illegal_op, /* TODO: xadd */ /* 0xc1 */ x86emuOp2_illegal_op, /* TODO: xadd */ /* 0xc2 */ x86emuOp2_illegal_op, /* 0xc3 */ x86emuOp2_illegal_op, /* 0xc4 */ x86emuOp2_illegal_op, /* 0xc5 */ x86emuOp2_illegal_op, /* 0xc6 */ x86emuOp2_illegal_op, /* 0xc7 */ x86emuOp2_illegal_op, /* 0xc8 */ x86emuOp2_bswap, /* 0xc9 */ x86emuOp2_bswap, /* 0xca */ x86emuOp2_bswap, /* 0xcb */ x86emuOp2_bswap, /* 0xcc */ x86emuOp2_bswap, /* 0xcd */ x86emuOp2_bswap, /* 0xce */ x86emuOp2_bswap, /* 0xcf */ x86emuOp2_bswap, /* 0xd0 */ x86emuOp2_illegal_op, /* 0xd1 */ x86emuOp2_illegal_op, /* 0xd2 */ x86emuOp2_illegal_op, /* 0xd3 */ x86emuOp2_illegal_op, /* 0xd4 */ x86emuOp2_illegal_op, /* 0xd5 */ x86emuOp2_illegal_op, /* 0xd6 */ x86emuOp2_illegal_op, /* 0xd7 */ x86emuOp2_illegal_op, /* 0xd8 */ x86emuOp2_illegal_op, /* 0xd9 */ x86emuOp2_illegal_op, /* 0xda */ x86emuOp2_illegal_op, /* 0xdb */ x86emuOp2_illegal_op, /* 0xdc */ x86emuOp2_illegal_op, /* 0xdd */ x86emuOp2_illegal_op, /* 0xde */ x86emuOp2_illegal_op, /* 0xdf */ x86emuOp2_illegal_op, /* 0xe0 */ x86emuOp2_illegal_op, /* 0xe1 */ x86emuOp2_illegal_op, /* 0xe2 */ x86emuOp2_illegal_op, /* 0xe3 */ x86emuOp2_illegal_op, /* 0xe4 */ x86emuOp2_illegal_op, /* 0xe5 */ x86emuOp2_illegal_op, /* 0xe6 */ x86emuOp2_illegal_op, /* 0xe7 */ x86emuOp2_illegal_op, /* 0xe8 */ x86emuOp2_illegal_op, /* 0xe9 */ x86emuOp2_illegal_op, /* 0xea */ x86emuOp2_illegal_op, /* 0xeb */ x86emuOp2_illegal_op, /* 0xec */ x86emuOp2_illegal_op, /* 0xed */ x86emuOp2_illegal_op, /* 0xee */ x86emuOp2_illegal_op, /* 0xef */ x86emuOp2_illegal_op, /* 0xf0 */ x86emuOp2_illegal_op, /* 0xf1 */ x86emuOp2_illegal_op, /* 0xf2 */ x86emuOp2_illegal_op, /* 0xf3 */ x86emuOp2_illegal_op, /* 0xf4 */ x86emuOp2_illegal_op, /* 0xf5 */ x86emuOp2_illegal_op, /* 0xf6 */ x86emuOp2_illegal_op, /* 0xf7 */ x86emuOp2_illegal_op, /* 0xf8 */ x86emuOp2_illegal_op, /* 0xf9 */ x86emuOp2_illegal_op, /* 0xfa */ x86emuOp2_illegal_op, /* 0xfb */ x86emuOp2_illegal_op, /* 0xfc */ x86emuOp2_illegal_op, /* 0xfd */ x86emuOp2_illegal_op, /* 0xfe */ x86emuOp2_illegal_op, /* 0xff */ x86emuOp2_illegal_op, }; xorg-server-1.17.1/hw/xfree86/x86emu/validate.c0000664000175100017510000012415012366220413016011 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: Watcom C 10.6 or later * Environment: 32-bit DOS * Developer: Kendall Bennett * * Description: Program to validate the x86 emulator library for * correctness. We run the emulator primitive operations * functions against the real x86 CPU, and compare the result * and flags to ensure correctness. * * We use inline assembler to compile and build this program. * ****************************************************************************/ #include #include #include #include #include "x86emu.h" #include "x86emu/prim_asm.h" /*-------------------------- Implementation -------------------------------*/ #define true 1 #define false 0 #define ALL_FLAGS (F_CF | F_PF | F_AF | F_ZF | F_SF | F_OF) #define VAL_START_BINARY(parm_type,res_type,dmax,smax,dincr,sincr) \ { \ parm_type d,s; \ res_type r,r_asm; \ ulong flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < dmax; d += dincr) { \ for (s = 0; s < smax; s += sincr) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { #define VAL_TEST_BINARY(name) \ r_asm = name##_asm(&flags,d,s); \ r = name(d,s); \ if (r != r_asm || M.x86.R_EFLG != flags) \ failed = true; \ if (failed || trace) { #define VAL_TEST_BINARY_VOID(name) \ name##_asm(&flags,d,s); \ name(d,s); \ r = r_asm = 0; \ if (M.x86.R_EFLG != flags) \ failed = true; \ if (failed || trace) { #define VAL_FAIL_BYTE_BYTE_BINARY(name) \ if (failed) \ printk("fail\n"); \ printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_FAIL_WORD_WORD_BINARY(name) \ if (failed) \ printk("fail\n"); \ printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_FAIL_LONG_LONG_BINARY(name) \ if (failed) \ printk("fail\n"); \ printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_END_BINARY() \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_BYTE_BYTE_BINARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1) \ VAL_TEST_BINARY(name) \ VAL_FAIL_BYTE_BYTE_BINARY(name) \ VAL_END_BINARY() #define VAL_WORD_WORD_BINARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \ VAL_TEST_BINARY(name) \ VAL_FAIL_WORD_WORD_BINARY(name) \ VAL_END_BINARY() #define VAL_LONG_LONG_BINARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \ VAL_TEST_BINARY(name) \ VAL_FAIL_LONG_LONG_BINARY(name) \ VAL_END_BINARY() #define VAL_VOID_BYTE_BINARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1) \ VAL_TEST_BINARY_VOID(name) \ VAL_FAIL_BYTE_BYTE_BINARY(name) \ VAL_END_BINARY() #define VAL_VOID_WORD_BINARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \ VAL_TEST_BINARY_VOID(name) \ VAL_FAIL_WORD_WORD_BINARY(name) \ VAL_END_BINARY() #define VAL_VOID_LONG_BINARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \ VAL_TEST_BINARY_VOID(name) \ VAL_FAIL_LONG_LONG_BINARY(name) \ VAL_END_BINARY() #define VAL_BYTE_ROTATE(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u8,u8,0xFF,8,1,1) \ VAL_TEST_BINARY(name) \ VAL_FAIL_BYTE_BYTE_BINARY(name) \ VAL_END_BINARY() #define VAL_WORD_ROTATE(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u16,u16,0xFF00,16,0x100,1) \ VAL_TEST_BINARY(name) \ VAL_FAIL_WORD_WORD_BINARY(name) \ VAL_END_BINARY() #define VAL_LONG_ROTATE(name) \ printk("Validating %s ... ", #name); \ VAL_START_BINARY(u32,u32,0xFF000000,32,0x1000000,1) \ VAL_TEST_BINARY(name) \ VAL_FAIL_LONG_LONG_BINARY(name) \ VAL_END_BINARY() #define VAL_START_TERNARY(parm_type,res_type,dmax,smax,dincr,sincr,maxshift)\ { \ parm_type d,s; \ res_type r,r_asm; \ u8 shift; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < dmax; d += dincr) { \ for (s = 0; s < smax; s += sincr) { \ for (shift = 0; shift < maxshift; shift += 1) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { #define VAL_TEST_TERNARY(name) \ r_asm = name##_asm(&flags,d,s,shift); \ r = name(d,s,shift); \ if (r != r_asm || M.x86.R_EFLG != flags) \ failed = true; \ if (failed || trace) { #define VAL_FAIL_WORD_WORD_TERNARY(name) \ if (failed) \ printk("fail\n"); \ printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n", \ r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n", \ r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_FAIL_LONG_LONG_TERNARY(name) \ if (failed) \ printk("fail\n"); \ printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n", \ r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n", \ r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_END_TERNARY() \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_WORD_ROTATE_DBL(name) \ printk("Validating %s ... ", #name); \ VAL_START_TERNARY(u16,u16,0xFF00,0xFF00,0x100,0x100,16) \ VAL_TEST_TERNARY(name) \ VAL_FAIL_WORD_WORD_TERNARY(name) \ VAL_END_TERNARY() #define VAL_LONG_ROTATE_DBL(name) \ printk("Validating %s ... ", #name); \ VAL_START_TERNARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000,32) \ VAL_TEST_TERNARY(name) \ VAL_FAIL_LONG_LONG_TERNARY(name) \ VAL_END_TERNARY() #define VAL_START_UNARY(parm_type,max,incr) \ { \ parm_type d,r,r_asm; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < max; d += incr) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { #define VAL_TEST_UNARY(name) \ r_asm = name##_asm(&flags,d); \ r = name(d); \ if (r != r_asm || M.x86.R_EFLG != flags) { \ failed = true; #define VAL_FAIL_BYTE_UNARY(name) \ printk("fail\n"); \ printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n", \ r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n", \ r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_FAIL_WORD_UNARY(name) \ printk("fail\n"); \ printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n", \ r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n", \ r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_FAIL_LONG_UNARY(name) \ printk("fail\n"); \ printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n", \ r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n", \ r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags)); #define VAL_END_UNARY() \ } \ M.x86.R_EFLG = inflags = flags = def_flags | ALL_FLAGS; \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_BYTE_UNARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_UNARY(u8,0xFF,0x1) \ VAL_TEST_UNARY(name) \ VAL_FAIL_BYTE_UNARY(name) \ VAL_END_UNARY() #define VAL_WORD_UNARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_UNARY(u16,0xFF00,0x100) \ VAL_TEST_UNARY(name) \ VAL_FAIL_WORD_UNARY(name) \ VAL_END_UNARY() #define VAL_WORD_BYTE_UNARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_UNARY(u16,0xFF,0x1) \ VAL_TEST_UNARY(name) \ VAL_FAIL_WORD_UNARY(name) \ VAL_END_UNARY() #define VAL_LONG_UNARY(name) \ printk("Validating %s ... ", #name); \ VAL_START_UNARY(u32,0xFF000000,0x1000000) \ VAL_TEST_UNARY(name) \ VAL_FAIL_LONG_UNARY(name) \ VAL_END_UNARY() #define VAL_BYTE_MUL(name) \ printk("Validating %s ... ", #name); \ { \ u8 d,s; \ u16 r,r_asm; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < 0xFF; d += 1) { \ for (s = 0; s < 0xFF; s += 1) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { \ name##_asm(&flags,&r_asm,d,s); \ M.x86.R_AL = d; \ name(s); \ r = M.x86.R_AX; \ if (r != r_asm || M.x86.R_EFLG != flags) \ failed = true; \ if (failed || trace) { \ if (failed) \ printk("fail\n"); \ printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_WORD_MUL(name) \ printk("Validating %s ... ", #name); \ { \ u16 d,s; \ u16 r_lo,r_asm_lo; \ u16 r_hi,r_asm_hi; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < 0xFF00; d += 0x100) { \ for (s = 0; s < 0xFF00; s += 0x100) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { \ name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s); \ M.x86.R_AX = d; \ name(s); \ r_lo = M.x86.R_AX; \ r_hi = M.x86.R_DX; \ if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\ failed = true; \ if (failed || trace) { \ if (failed) \ printk("fail\n"); \ printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \ r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \ r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_LONG_MUL(name) \ printk("Validating %s ... ", #name); \ { \ u32 d,s; \ u32 r_lo,r_asm_lo; \ u32 r_hi,r_asm_hi; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < 0xFF000000; d += 0x1000000) { \ for (s = 0; s < 0xFF000000; s += 0x1000000) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { \ name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s); \ M.x86.R_EAX = d; \ name(s); \ r_lo = M.x86.R_EAX; \ r_hi = M.x86.R_EDX; \ if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\ failed = true; \ if (failed || trace) { \ if (failed) \ printk("fail\n"); \ printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \ r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \ r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_BYTE_DIV(name) \ printk("Validating %s ... ", #name); \ { \ u16 d,s; \ u8 r_quot,r_rem,r_asm_quot,r_asm_rem; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < 0xFF00; d += 0x100) { \ for (s = 1; s < 0xFF; s += 1) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { \ M.x86.intr = 0; \ M.x86.R_AX = d; \ name(s); \ r_quot = M.x86.R_AL; \ r_rem = M.x86.R_AH; \ if (M.x86.intr & INTR_SYNCH) \ continue; \ name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,s); \ if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \ failed = true; \ if (failed || trace) { \ if (failed) \ printk("fail\n"); \ printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n", \ r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n", \ r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_WORD_DIV(name) \ printk("Validating %s ... ", #name); \ { \ u32 d,s; \ u16 r_quot,r_rem,r_asm_quot,r_asm_rem; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < 0xFF000000; d += 0x1000000) { \ for (s = 0x100; s < 0xFF00; s += 0x100) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { \ M.x86.intr = 0; \ M.x86.R_AX = d & 0xFFFF; \ M.x86.R_DX = d >> 16; \ name(s); \ r_quot = M.x86.R_AX; \ r_rem = M.x86.R_DX; \ if (M.x86.intr & INTR_SYNCH) \ continue; \ name##_asm(&flags,&r_asm_quot,&r_asm_rem,d & 0xFFFF,d >> 16,s);\ if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \ failed = true; \ if (failed || trace) { \ if (failed) \ printk("fail\n"); \ printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n", \ r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n", \ r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } #define VAL_LONG_DIV(name) \ printk("Validating %s ... ", #name); \ { \ u32 d,s; \ u32 r_quot,r_rem,r_asm_quot,r_asm_rem; \ u32 flags,inflags; \ int f,failed = false; \ char buf1[80],buf2[80]; \ for (d = 0; d < 0xFF000000; d += 0x1000000) { \ for (s = 0x100; s < 0xFF00; s += 0x100) { \ M.x86.R_EFLG = inflags = flags = def_flags; \ for (f = 0; f < 2; f++) { \ M.x86.intr = 0; \ M.x86.R_EAX = d; \ M.x86.R_EDX = 0; \ name(s); \ r_quot = M.x86.R_EAX; \ r_rem = M.x86.R_EDX; \ if (M.x86.intr & INTR_SYNCH) \ continue; \ name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,0,s); \ if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \ failed = true; \ if (failed || trace) { \ if (failed) \ printk("fail\n"); \ printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n", \ r_quot, r_rem, #name, 0, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \ printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n", \ r_asm_quot, r_asm_rem, #name"_asm", 0, d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \ } \ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (failed) \ break; \ } \ if (!failed) \ printk("passed\n"); \ } void printk(const char *fmt, ...) { va_list argptr; va_start(argptr, fmt); vfprintf(stdout, fmt, argptr); fflush(stdout); va_end(argptr); } char * print_flags(char *buf, ulong flags) { char *separator = ""; buf[0] = 0; if (flags & F_CF) { strcat(buf, separator); strcat(buf, "CF"); separator = ","; } if (flags & F_PF) { strcat(buf, separator); strcat(buf, "PF"); separator = ","; } if (flags & F_AF) { strcat(buf, separator); strcat(buf, "AF"); separator = ","; } if (flags & F_ZF) { strcat(buf, separator); strcat(buf, "ZF"); separator = ","; } if (flags & F_SF) { strcat(buf, separator); strcat(buf, "SF"); separator = ","; } if (flags & F_OF) { strcat(buf, separator); strcat(buf, "OF"); separator = ","; } if (separator[0] == 0) strcpy(buf, "None"); return buf; } int main(int argc) { ulong def_flags; int trace = false; if (argc > 1) trace = true; memset(&M, 0, sizeof(M)); def_flags = get_flags_asm() & ~ALL_FLAGS; VAL_WORD_UNARY(aaa_word); VAL_WORD_UNARY(aas_word); VAL_WORD_UNARY(aad_word); VAL_WORD_UNARY(aam_word); VAL_BYTE_BYTE_BINARY(adc_byte); VAL_WORD_WORD_BINARY(adc_word); VAL_LONG_LONG_BINARY(adc_long); VAL_BYTE_BYTE_BINARY(add_byte); VAL_WORD_WORD_BINARY(add_word); VAL_LONG_LONG_BINARY(add_long); VAL_BYTE_BYTE_BINARY(and_byte); VAL_WORD_WORD_BINARY(and_word); VAL_LONG_LONG_BINARY(and_long); VAL_BYTE_BYTE_BINARY(cmp_byte); VAL_WORD_WORD_BINARY(cmp_word); VAL_LONG_LONG_BINARY(cmp_long); VAL_BYTE_UNARY(daa_byte); VAL_BYTE_UNARY(das_byte); /* Fails for 0x9A (out of range anyway) */ VAL_BYTE_UNARY(dec_byte); VAL_WORD_UNARY(dec_word); VAL_LONG_UNARY(dec_long); VAL_BYTE_UNARY(inc_byte); VAL_WORD_UNARY(inc_word); VAL_LONG_UNARY(inc_long); VAL_BYTE_BYTE_BINARY(or_byte); VAL_WORD_WORD_BINARY(or_word); VAL_LONG_LONG_BINARY(or_long); VAL_BYTE_UNARY(neg_byte); VAL_WORD_UNARY(neg_word); VAL_LONG_UNARY(neg_long); VAL_BYTE_UNARY(not_byte); VAL_WORD_UNARY(not_word); VAL_LONG_UNARY(not_long); VAL_BYTE_ROTATE(rcl_byte); VAL_WORD_ROTATE(rcl_word); VAL_LONG_ROTATE(rcl_long); VAL_BYTE_ROTATE(rcr_byte); VAL_WORD_ROTATE(rcr_word); VAL_LONG_ROTATE(rcr_long); VAL_BYTE_ROTATE(rol_byte); VAL_WORD_ROTATE(rol_word); VAL_LONG_ROTATE(rol_long); VAL_BYTE_ROTATE(ror_byte); VAL_WORD_ROTATE(ror_word); VAL_LONG_ROTATE(ror_long); VAL_BYTE_ROTATE(shl_byte); VAL_WORD_ROTATE(shl_word); VAL_LONG_ROTATE(shl_long); VAL_BYTE_ROTATE(shr_byte); VAL_WORD_ROTATE(shr_word); VAL_LONG_ROTATE(shr_long); VAL_BYTE_ROTATE(sar_byte); VAL_WORD_ROTATE(sar_word); VAL_LONG_ROTATE(sar_long); VAL_WORD_ROTATE_DBL(shld_word); VAL_LONG_ROTATE_DBL(shld_long); VAL_WORD_ROTATE_DBL(shrd_word); VAL_LONG_ROTATE_DBL(shrd_long); VAL_BYTE_BYTE_BINARY(sbb_byte); VAL_WORD_WORD_BINARY(sbb_word); VAL_LONG_LONG_BINARY(sbb_long); VAL_BYTE_BYTE_BINARY(sub_byte); VAL_WORD_WORD_BINARY(sub_word); VAL_LONG_LONG_BINARY(sub_long); VAL_BYTE_BYTE_BINARY(xor_byte); VAL_WORD_WORD_BINARY(xor_word); VAL_LONG_LONG_BINARY(xor_long); VAL_VOID_BYTE_BINARY(test_byte); VAL_VOID_WORD_BINARY(test_word); VAL_VOID_LONG_BINARY(test_long); VAL_BYTE_MUL(imul_byte); VAL_WORD_MUL(imul_word); VAL_LONG_MUL(imul_long); VAL_BYTE_MUL(mul_byte); VAL_WORD_MUL(mul_word); VAL_LONG_MUL(mul_long); VAL_BYTE_DIV(idiv_byte); VAL_WORD_DIV(idiv_word); VAL_LONG_DIV(idiv_long); VAL_BYTE_DIV(div_byte); VAL_WORD_DIV(div_word); VAL_LONG_DIV(div_long); return 0; } xorg-server-1.17.1/hw/xfree86/x86emu/sys.c0000664000175100017510000003600312456571574015056 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: This file includes subroutines which are related to * programmed I/O and memory access. Included in this module * are default functions with limited usefulness. For real * uses these functions will most likely be overriden by the * user library. * ****************************************************************************/ #include "x86emu.h" #include "x86emu/x86emui.h" #include "x86emu/regs.h" #include "x86emu/debug.h" #include "x86emu/prim_ops.h" #ifndef NO_SYS_HEADERS #include #endif #ifdef __GNUC__ /* Define some packed structures to use with unaligned accesses */ struct __una_u64 { u64 x __attribute__ ((packed)); }; struct __una_u32 { u32 x __attribute__ ((packed)); }; struct __una_u16 { u16 x __attribute__ ((packed)); }; /* Elemental unaligned loads */ static __inline__ u64 ldq_u(u64 * p) { const struct __una_u64 *ptr = (const struct __una_u64 *) p; return ptr->x; } static __inline__ u32 ldl_u(u32 * p) { const struct __una_u32 *ptr = (const struct __una_u32 *) p; return ptr->x; } static __inline__ u16 ldw_u(u16 * p) { const struct __una_u16 *ptr = (const struct __una_u16 *) p; return ptr->x; } /* Elemental unaligned stores */ static __inline__ void stq_u(u64 val, u64 * p) { struct __una_u64 *ptr = (struct __una_u64 *) p; ptr->x = val; } static __inline__ void stl_u(u32 val, u32 * p) { struct __una_u32 *ptr = (struct __una_u32 *) p; ptr->x = val; } static __inline__ void stw_u(u16 val, u16 * p) { struct __una_u16 *ptr = (struct __una_u16 *) p; ptr->x = val; } #else /* !__GNUC__ */ static __inline__ u64 ldq_u(u64 * p) { u64 ret; memmove(&ret, p, sizeof(*p)); return ret; } static __inline__ u32 ldl_u(u32 * p) { u32 ret; memmove(&ret, p, sizeof(*p)); return ret; } static __inline__ u16 ldw_u(u16 * p) { u16 ret; memmove(&ret, p, sizeof(*p)); return ret; } static __inline__ void stq_u(u64 val, u64 * p) { u64 tmp = val; memmove(p, &tmp, sizeof(*p)); } static __inline__ void stl_u(u32 val, u32 * p) { u32 tmp = val; memmove(p, &tmp, sizeof(*p)); } static __inline__ void stw_u(u16 val, u16 * p) { u16 tmp = val; memmove(p, &tmp, sizeof(*p)); } #endif /* __GNUC__ */ /*------------------------- Global Variables ------------------------------*/ X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */ X86EMU_intrFuncs _X86EMU_intrTab[256]; /*----------------------------- Implementation ----------------------------*/ /**************************************************************************** PARAMETERS: addr - Emulator memory address to read RETURNS: Byte value read from emulator memory. REMARKS: Reads a byte value from the emulator memory. ****************************************************************************/ u8 X86API rdb(u32 addr) { u8 val; if (addr > M.mem_size - 1) { DB(printk("mem_read: address %#lx out of range!\n", addr); ) HALT_SYS(); } val = *(u8 *) (M.mem_base + addr); DB(if (DEBUG_MEM_TRACE()) printk("%#08x 1 -> %#x\n", addr, val);) return val; } /**************************************************************************** PARAMETERS: addr - Emulator memory address to read RETURNS: Word value read from emulator memory. REMARKS: Reads a word value from the emulator memory. ****************************************************************************/ u16 X86API rdw(u32 addr) { u16 val = 0; if (addr > M.mem_size - 2) { DB(printk("mem_read: address %#lx out of range!\n", addr); ) HALT_SYS(); } #ifdef __BIG_ENDIAN__ if (addr & 0x1) { val = (*(u8 *) (M.mem_base + addr) | (*(u8 *) (M.mem_base + addr + 1) << 8)); } else #endif val = ldw_u((u16 *) (M.mem_base + addr)); DB(if (DEBUG_MEM_TRACE()) printk("%#08x 2 -> %#x\n", addr, val);) return val; } /**************************************************************************** PARAMETERS: addr - Emulator memory address to read RETURNS: Long value read from emulator memory. REMARKS: Reads a long value from the emulator memory. ****************************************************************************/ u32 X86API rdl(u32 addr) { u32 val = 0; if (addr > M.mem_size - 4) { DB(printk("mem_read: address %#lx out of range!\n", addr); ) HALT_SYS(); } #ifdef __BIG_ENDIAN__ if (addr & 0x3) { val = (*(u8 *) (M.mem_base + addr + 0) | (*(u8 *) (M.mem_base + addr + 1) << 8) | (*(u8 *) (M.mem_base + addr + 2) << 16) | (*(u8 *) (M.mem_base + addr + 3) << 24)); } else #endif val = ldl_u((u32 *) (M.mem_base + addr)); DB(if (DEBUG_MEM_TRACE()) printk("%#08x 4 -> %#x\n", addr, val);) return val; } /**************************************************************************** PARAMETERS: addr - Emulator memory address to read val - Value to store REMARKS: Writes a byte value to emulator memory. ****************************************************************************/ void X86API wrb(u32 addr, u8 val) { DB(if (DEBUG_MEM_TRACE()) printk("%#08x 1 <- %#x\n", addr, val);) if (addr > M.mem_size - 1) { DB(printk("mem_write: address %#lx out of range!\n", addr); ) HALT_SYS(); } *(u8 *) (M.mem_base + addr) = val; } /**************************************************************************** PARAMETERS: addr - Emulator memory address to read val - Value to store REMARKS: Writes a word value to emulator memory. ****************************************************************************/ void X86API wrw(u32 addr, u16 val) { DB(if (DEBUG_MEM_TRACE()) printk("%#08x 2 <- %#x\n", addr, val);) if (addr > M.mem_size - 2) { DB(printk("mem_write: address %#lx out of range!\n", addr); ) HALT_SYS(); } #ifdef __BIG_ENDIAN__ if (addr & 0x1) { *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff; *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff; } else #endif stw_u(val, (u16 *) (M.mem_base + addr)); } /**************************************************************************** PARAMETERS: addr - Emulator memory address to read val - Value to store REMARKS: Writes a long value to emulator memory. ****************************************************************************/ void X86API wrl(u32 addr, u32 val) { DB(if (DEBUG_MEM_TRACE()) printk("%#08x 4 <- %#x\n", addr, val);) if (addr > M.mem_size - 4) { DB(printk("mem_write: address %#lx out of range!\n", addr); ) HALT_SYS(); } #ifdef __BIG_ENDIAN__ if (addr & 0x1) { *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff; *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff; *(u8 *) (M.mem_base + addr + 2) = (val >> 16) & 0xff; *(u8 *) (M.mem_base + addr + 3) = (val >> 24) & 0xff; } else #endif stl_u(val, (u32 *) (M.mem_base + addr)); } /**************************************************************************** PARAMETERS: addr - PIO address to read RETURN: 0 REMARKS: Default PIO byte read function. Doesn't perform real inb. ****************************************************************************/ static u8 X86API p_inb(X86EMU_pioAddr addr) { DB(if (DEBUG_IO_TRACE()) printk("inb %#04x \n", addr);) return 0; } /**************************************************************************** PARAMETERS: addr - PIO address to read RETURN: 0 REMARKS: Default PIO word read function. Doesn't perform real inw. ****************************************************************************/ static u16 X86API p_inw(X86EMU_pioAddr addr) { DB(if (DEBUG_IO_TRACE()) printk("inw %#04x \n", addr);) return 0; } /**************************************************************************** PARAMETERS: addr - PIO address to read RETURN: 0 REMARKS: Default PIO long read function. Doesn't perform real inl. ****************************************************************************/ static u32 X86API p_inl(X86EMU_pioAddr addr) { DB(if (DEBUG_IO_TRACE()) printk("inl %#04x \n", addr);) return 0; } /**************************************************************************** PARAMETERS: addr - PIO address to write val - Value to store REMARKS: Default PIO byte write function. Doesn't perform real outb. ****************************************************************************/ static void X86API p_outb(X86EMU_pioAddr addr, u8 val) { DB(if (DEBUG_IO_TRACE()) printk("outb %#02x -> %#04x \n", val, addr);) return; } /**************************************************************************** PARAMETERS: addr - PIO address to write val - Value to store REMARKS: Default PIO word write function. Doesn't perform real outw. ****************************************************************************/ static void X86API p_outw(X86EMU_pioAddr addr, u16 val) { DB(if (DEBUG_IO_TRACE()) printk("outw %#04x -> %#04x \n", val, addr);) return; } /**************************************************************************** PARAMETERS: addr - PIO address to write val - Value to store REMARKS: Default PIO ;ong write function. Doesn't perform real outl. ****************************************************************************/ static void X86API p_outl(X86EMU_pioAddr addr, u32 val) { DB(if (DEBUG_IO_TRACE()) printk("outl %#08x -> %#04x \n", val, addr);) return; } /*------------------------- Global Variables ------------------------------*/ u8(X86APIP sys_rdb) (u32 addr) = rdb; u16(X86APIP sys_rdw) (u32 addr) = rdw; u32(X86APIP sys_rdl) (u32 addr) = rdl; void (X86APIP sys_wrb) (u32 addr, u8 val) = wrb; void (X86APIP sys_wrw) (u32 addr, u16 val) = wrw; void (X86APIP sys_wrl) (u32 addr, u32 val) = wrl; u8(X86APIP sys_inb) (X86EMU_pioAddr addr) = p_inb; u16(X86APIP sys_inw) (X86EMU_pioAddr addr) = p_inw; u32(X86APIP sys_inl) (X86EMU_pioAddr addr) = p_inl; void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val) = p_outb; void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val) = p_outw; void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val) = p_outl; /*----------------------------- Setup -------------------------------------*/ /**************************************************************************** PARAMETERS: funcs - New memory function pointers to make active REMARKS: This function is used to set the pointers to functions which access memory space, allowing the user application to override these functions and hook them out as necessary for their application. ****************************************************************************/ void X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs) { sys_rdb = funcs->rdb; sys_rdw = funcs->rdw; sys_rdl = funcs->rdl; sys_wrb = funcs->wrb; sys_wrw = funcs->wrw; sys_wrl = funcs->wrl; } /**************************************************************************** PARAMETERS: funcs - New programmed I/O function pointers to make active REMARKS: This function is used to set the pointers to functions which access I/O space, allowing the user application to override these functions and hook them out as necessary for their application. ****************************************************************************/ void X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs) { sys_inb = funcs->inb; sys_inw = funcs->inw; sys_inl = funcs->inl; sys_outb = funcs->outb; sys_outw = funcs->outw; sys_outl = funcs->outl; } /**************************************************************************** PARAMETERS: funcs - New interrupt vector table to make active REMARKS: This function is used to set the pointers to functions which handle interrupt processing in the emulator, allowing the user application to hook interrupts as necessary for their application. Any interrupts that are not hooked by the user application, and reflected and handled internally in the emulator via the interrupt vector table. This allows the application to get control when the code being emulated executes specific software interrupts. ****************************************************************************/ void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]) { int i; for (i = 0; i < 256; i++) _X86EMU_intrTab[i] = NULL; if (funcs) { for (i = 0; i < 256; i++) _X86EMU_intrTab[i] = funcs[i]; } } /**************************************************************************** PARAMETERS: int - New software interrupt to prepare for REMARKS: This function is used to set up the emulator state to exceute a software interrupt. This can be used by the user application code to allow an interrupt to be hooked, examined and then reflected back to the emulator so that the code in the emulator will continue processing the software interrupt as per normal. This essentially allows system code to actively hook and handle certain software interrupts as necessary. ****************************************************************************/ void X86EMU_prepareForInt(int num) { push_word((u16) M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); push_word(M.x86.R_CS); M.x86.R_CS = mem_access_word(num * 4 + 2); push_word(M.x86.R_IP); M.x86.R_IP = mem_access_word(num * 4); M.x86.intr = 0; } xorg-server-1.17.1/hw/xfree86/x86emu/fpu.c0000664000175100017510000006476112366220413015025 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: This file contains the code to implement the decoding and * emulation of the FPU instructions. * ****************************************************************************/ #include "x86emu/x86emui.h" /*----------------------------- Implementation ----------------------------*/ /* opcode=0xd8 */ void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1)) { START_OF_INSTR(); DECODE_PRINTF("ESC D8\n"); DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } #ifdef DEBUG static const char *x86emu_fpu_op_d9_tab[] = { "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ", "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t", "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ", "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t", "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ", "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t", }; static const char *x86emu_fpu_op_d9_tab1[] = { "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FLD\t", "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t", "FNOP", "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9", "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t", "FCHS", "FABS", "ESC_D9", "ESC_D9", "FTST", "FXAM", "ESC_D9", "ESC_D9", "FLD1", "FLDL2T", "FLDL2E", "FLDPI", "FLDLG2", "FLDLN2", "FLDZ", "ESC_D9", "F2XM1", "FYL2X", "FPTAN", "FPATAN", "FXTRACT", "ESC_D9", "FDECSTP", "FINCSTP", "FPREM", "FYL2XP1", "FSQRT", "ESC_D9", "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9", }; #endif /* DEBUG */ /* opcode=0xd9 */ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset = 0; u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (mod != 3) { DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl); } else { DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]); } #endif switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); break; case 3: /* register to register */ stkelem = (u8) rl; if (rh < 4) { DECODE_PRINTF2("ST(%d)\n", stkelem); } else { DECODE_PRINTF("\n"); } break; } #ifdef X86EMU_FPU_PRESENT /* execute */ switch (mod) { case 3: switch (rh) { case 0: x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem); break; case 1: x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem); break; case 2: switch (rl) { case 0: x86emu_fpu_R_nop(); break; default: x86emu_fpu_illegal(); break; } case 3: x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem); break; case 4: switch (rl) { case 0: x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP); break; case 1: x86emu_fpu_R_fabs(X86EMU_FPU_STKTOP); break; case 4: x86emu_fpu_R_ftst(X86EMU_FPU_STKTOP); break; case 5: x86emu_fpu_R_fxam(X86EMU_FPU_STKTOP); break; default: /* 2,3,6,7 */ x86emu_fpu_illegal(); break; } break; case 5: switch (rl) { case 0: x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP); break; case 1: x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP); break; case 2: x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP); break; case 3: x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP); break; case 4: x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP); break; case 5: x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP); break; case 6: x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP); break; default: /* 7 */ x86emu_fpu_illegal(); break; } break; case 6: switch (rl) { case 0: x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP); break; case 1: x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP); break; case 2: x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP); break; case 3: x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP); break; case 4: x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP); break; case 5: x86emu_fpu_illegal(); break; case 6: x86emu_fpu_R_decstp(); break; case 7: x86emu_fpu_R_incstp(); break; } break; case 7: switch (rl) { case 0: x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP); break; case 1: x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP); break; case 2: x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP); break; case 3: x86emu_fpu_illegal(); break; case 4: x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP); break; case 5: x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP); break; case 6: case 7: default: x86emu_fpu_illegal(); break; } break; default: switch (rh) { case 0: x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset); break; case 1: x86emu_fpu_illegal(); break; case 2: x86emu_fpu_M_fst(X86EMU_FPU_FLOAT, destoffset); break; case 3: x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT, destoffset); break; case 4: x86emu_fpu_M_fldenv(X86EMU_FPU_WORD, destoffset); break; case 5: x86emu_fpu_M_fldcw(X86EMU_FPU_WORD, destoffset); break; case 6: x86emu_fpu_M_fstenv(X86EMU_FPU_WORD, destoffset); break; case 7: x86emu_fpu_M_fstcw(X86EMU_FPU_WORD, destoffset); break; } } } #else (void) destoffset; (void) stkelem; #endif /* X86EMU_FPU_PRESENT */ DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } #ifdef DEBUG static const char *x86emu_fpu_op_da_tab[] = { "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ", "FICOMP\tDWORD PTR ", "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ", "FIDIVR\tDWORD PTR ", "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ", "FICOMP\tDWORD PTR ", "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ", "FIDIVR\tDWORD PTR ", "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ", "FICOMP\tDWORD PTR ", "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ", "FIDIVR\tDWORD PTR ", "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ", }; #endif /* DEBUG */ /* opcode=0xda */ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset = 0; u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); break; case 3: /* register to register */ stkelem = (u8) rl; DECODE_PRINTF2("\tST(%d),ST\n", stkelem); break; } #ifdef X86EMU_FPU_PRESENT switch (mod) { case 3: x86emu_fpu_illegal(); break; default: switch (rh) { case 0: x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset); break; case 1: x86emu_fpu_M_imul(X86EMU_FPU_SHORT, destoffset); break; case 2: x86emu_fpu_M_icom(X86EMU_FPU_SHORT, destoffset); break; case 3: x86emu_fpu_M_icomp(X86EMU_FPU_SHORT, destoffset); break; case 4: x86emu_fpu_M_isub(X86EMU_FPU_SHORT, destoffset); break; case 5: x86emu_fpu_M_isubr(X86EMU_FPU_SHORT, destoffset); break; case 6: x86emu_fpu_M_idiv(X86EMU_FPU_SHORT, destoffset); break; case 7: x86emu_fpu_M_idivr(X86EMU_FPU_SHORT, destoffset); break; } } #else (void) destoffset; (void) stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } #ifdef DEBUG static const char *x86emu_fpu_op_db_tab[] = { "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ", "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ", "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ", "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ", "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ", "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ", }; #endif /* DEBUG */ /* opcode=0xdb */ void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); #ifdef DEBUG if (mod != 3) { DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl); } else if (rh == 4) { /* === 11 10 0 nnn */ switch (rl) { case 0: DECODE_PRINTF("FENI\n"); break; case 1: DECODE_PRINTF("FDISI\n"); break; case 2: DECODE_PRINTF("FCLEX\n"); break; case 3: DECODE_PRINTF("FINIT\n"); break; } } else { DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl)); } #endif /* DEBUG */ switch (mod) { case 0: destoffset = decode_rm00_address(rl); break; case 1: destoffset = decode_rm01_address(rl); break; case 2: destoffset = decode_rm10_address(rl); break; case 3: /* register to register */ break; } #ifdef X86EMU_FPU_PRESENT /* execute */ switch (mod) { case 3: switch (rh) { case 4: switch (rl) { case 0: x86emu_fpu_R_feni(); break; case 1: x86emu_fpu_R_fdisi(); break; case 2: x86emu_fpu_R_fclex(); break; case 3: x86emu_fpu_R_finit(); break; default: x86emu_fpu_illegal(); break; } break; default: x86emu_fpu_illegal(); break; } break; default: switch (rh) { case 0: x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset); break; case 1: x86emu_fpu_illegal(); break; case 2: x86emu_fpu_M_fist(X86EMU_FPU_SHORT, destoffset); break; case 3: x86emu_fpu_M_fistp(X86EMU_FPU_SHORT, destoffset); break; case 4: x86emu_fpu_illegal(); break; case 5: x86emu_fpu_M_fld(X86EMU_FPU_LDBL, destoffset); break; case 6: x86emu_fpu_illegal(); break; case 7: x86emu_fpu_M_fstp(X86EMU_FPU_LDBL, destoffset); break; } } #else (void) destoffset; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } #ifdef DEBUG static const char *x86emu_fpu_op_dc_tab[] = { "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ", "FCOMP\tQWORD PTR ", "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ", "FDIVR\tQWORD PTR ", "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ", "FCOMP\tQWORD PTR ", "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ", "FDIVR\tQWORD PTR ", "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ", "FCOMP\tQWORD PTR ", "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ", "FDIVR\tQWORD PTR ", "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t", "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t", }; #endif /* DEBUG */ /* opcode=0xdc */ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset = 0; u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); break; case 3: /* register to register */ stkelem = (u8) rl; DECODE_PRINTF2("\tST(%d),ST\n", stkelem); break; } #ifdef X86EMU_FPU_PRESENT /* execute */ switch (mod) { case 3: switch (rh) { case 0: x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP); break; case 1: x86emu_fpu_R_fmul(stkelem, X86EMU_FPU_STKTOP); break; case 2: x86emu_fpu_R_fcom(stkelem, X86EMU_FPU_STKTOP); break; case 3: x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP); break; case 4: x86emu_fpu_R_fsubr(stkelem, X86EMU_FPU_STKTOP); break; case 5: x86emu_fpu_R_fsub(stkelem, X86EMU_FPU_STKTOP); break; case 6: x86emu_fpu_R_fdivr(stkelem, X86EMU_FPU_STKTOP); break; case 7: x86emu_fpu_R_fdiv(stkelem, X86EMU_FPU_STKTOP); break; } break; default: switch (rh) { case 0: x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset); break; case 1: x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE, destoffset); break; case 2: x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE, destoffset); break; case 3: x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE, destoffset); break; case 4: x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE, destoffset); break; case 5: x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE, destoffset); break; case 6: x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE, destoffset); break; case 7: x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE, destoffset); break; } } #else (void) destoffset; (void) stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } #ifdef DEBUG static const char *x86emu_fpu_op_dd_tab[] = { "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ", "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t", "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ", "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t", "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ", "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t", "FFREE\t", "FXCH\t", "FST\t", "FSTP\t", "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,", }; #endif /* DEBUG */ /* opcode=0xdd */ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset = 0; u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); break; case 3: /* register to register */ stkelem = (u8) rl; DECODE_PRINTF2("\tST(%d),ST\n", stkelem); break; } #ifdef X86EMU_FPU_PRESENT switch (mod) { case 3: switch (rh) { case 0: x86emu_fpu_R_ffree(stkelem); break; case 1: x86emu_fpu_R_fxch(stkelem); break; case 2: x86emu_fpu_R_fst(stkelem); /* register version */ break; case 3: x86emu_fpu_R_fstp(stkelem); /* register version */ break; default: x86emu_fpu_illegal(); break; } break; default: switch (rh) { case 0: x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset); break; case 1: x86emu_fpu_illegal(); break; case 2: x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE, destoffset); break; case 3: x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE, destoffset); break; case 4: x86emu_fpu_M_frstor(X86EMU_FPU_WORD, destoffset); break; case 5: x86emu_fpu_illegal(); break; case 6: x86emu_fpu_M_fsave(X86EMU_FPU_WORD, destoffset); break; case 7: x86emu_fpu_M_fstsw(X86EMU_FPU_WORD, destoffset); break; } } #else (void) destoffset; (void) stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } #ifdef DEBUG static const char *x86emu_fpu_op_de_tab[] = { "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ", "FICOMP\tWORD PTR ", "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ", "FIDIVR\tWORD PTR ", "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ", "FICOMP\tWORD PTR ", "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ", "FIDIVR\tWORD PTR ", "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ", "FICOMP\tWORD PTR ", "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ", "FIDIVR\tWORD PTR ", "FADDP\t", "FMULP\t", "FCOMP\t", "FCOMPP\t", "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t", }; #endif /* DEBUG */ /* opcode=0xde */ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset = 0; u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); break; case 3: /* register to register */ stkelem = (u8) rl; DECODE_PRINTF2("\tST(%d),ST\n", stkelem); break; } #ifdef X86EMU_FPU_PRESENT switch (mod) { case 3: switch (rh) { case 0: x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP); break; case 1: x86emu_fpu_R_fmulp(stkelem, X86EMU_FPU_STKTOP); break; case 2: x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP); break; case 3: if (stkelem == 1) x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP); else x86emu_fpu_illegal(); break; case 4: x86emu_fpu_R_fsubrp(stkelem, X86EMU_FPU_STKTOP); break; case 5: x86emu_fpu_R_fsubp(stkelem, X86EMU_FPU_STKTOP); break; case 6: x86emu_fpu_R_fdivrp(stkelem, X86EMU_FPU_STKTOP); break; case 7: x86emu_fpu_R_fdivp(stkelem, X86EMU_FPU_STKTOP); break; } break; default: switch (rh) { case 0: x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset); break; case 1: x86emu_fpu_M_fimul(X86EMU_FPU_WORD, destoffset); break; case 2: x86emu_fpu_M_ficom(X86EMU_FPU_WORD, destoffset); break; case 3: x86emu_fpu_M_ficomp(X86EMU_FPU_WORD, destoffset); break; case 4: x86emu_fpu_M_fisub(X86EMU_FPU_WORD, destoffset); break; case 5: x86emu_fpu_M_fisubr(X86EMU_FPU_WORD, destoffset); break; case 6: x86emu_fpu_M_fidiv(X86EMU_FPU_WORD, destoffset); break; case 7: x86emu_fpu_M_fidivr(X86EMU_FPU_WORD, destoffset); break; } } #else (void) destoffset; (void) stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } #ifdef DEBUG static const char *x86emu_fpu_op_df_tab[] = { /* mod == 00 */ "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ", "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ", "FISTP\tQWORD PTR ", /* mod == 01 */ "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ", "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ", "FISTP\tQWORD PTR ", /* mod == 10 */ "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ", "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ", "FISTP\tQWORD PTR ", /* mod == 11 */ "FFREE\t", "FXCH\t", "FST\t", "FSTP\t", "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F," }; #endif /* DEBUG */ /* opcode=0xdf */ void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; uint destoffset = 0; u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl); switch (mod) { case 0: destoffset = decode_rm00_address(rl); DECODE_PRINTF("\n"); break; case 1: destoffset = decode_rm01_address(rl); DECODE_PRINTF("\n"); break; case 2: destoffset = decode_rm10_address(rl); DECODE_PRINTF("\n"); break; case 3: /* register to register */ stkelem = (u8) rl; DECODE_PRINTF2("\tST(%d)\n", stkelem); break; } #ifdef X86EMU_FPU_PRESENT switch (mod) { case 3: switch (rh) { case 0: x86emu_fpu_R_ffree(stkelem); break; case 1: x86emu_fpu_R_fxch(stkelem); break; case 2: x86emu_fpu_R_fst(stkelem); /* register version */ break; case 3: x86emu_fpu_R_fstp(stkelem); /* register version */ break; default: x86emu_fpu_illegal(); break; } break; default: switch (rh) { case 0: x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset); break; case 1: x86emu_fpu_illegal(); break; case 2: x86emu_fpu_M_fist(X86EMU_FPU_WORD, destoffset); break; case 3: x86emu_fpu_M_fistp(X86EMU_FPU_WORD, destoffset); break; case 4: x86emu_fpu_M_fbld(X86EMU_FPU_BSD, destoffset); break; case 5: x86emu_fpu_M_fild(X86EMU_FPU_LONG, destoffset); break; case 6: x86emu_fpu_M_fbstp(X86EMU_FPU_BSD, destoffset); break; case 7: x86emu_fpu_M_fistp(X86EMU_FPU_LONG, destoffset); break; } } #else (void) destoffset; (void) stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); } xorg-server-1.17.1/hw/xfree86/x86emu/x86emu.h0000664000175100017510000001635412274325511015372 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: Header file for public specific functions. * Any application linking against us should only * include this header * ****************************************************************************/ #ifndef __X86EMU_X86EMU_H #define __X86EMU_X86EMU_H #ifdef SCITECH #include "scitech.h" #define X86API _ASMAPI #define X86APIP _ASMAPIP typedef int X86EMU_pioAddr; #else #include "x86emu/types.h" #define X86API #define X86APIP * #endif #include "x86emu/regs.h" /*---------------------- Macros and type definitions ----------------------*/ #ifdef PACK #pragma PACK /* Don't pack structs with function pointers! */ #endif /**************************************************************************** REMARKS: Data structure containing ponters to programmed I/O functions used by the emulator. This is used so that the user program can hook all programmed I/O for the emulator to handled as necessary by the user program. By default the emulator contains simple functions that do not do access the hardware in any way. To allow the emualtor access the hardware, you will need to override the programmed I/O functions using the X86EMU_setupPioFuncs function. HEADER: x86emu.h MEMBERS: inb - Function to read a byte from an I/O port inw - Function to read a word from an I/O port inl - Function to read a dword from an I/O port outb - Function to write a byte to an I/O port outw - Function to write a word to an I/O port outl - Function to write a dword to an I/O port ****************************************************************************/ typedef struct { u8(X86APIP inb) (X86EMU_pioAddr addr); u16(X86APIP inw) (X86EMU_pioAddr addr); u32(X86APIP inl) (X86EMU_pioAddr addr); void (X86APIP outb) (X86EMU_pioAddr addr, u8 val); void (X86APIP outw) (X86EMU_pioAddr addr, u16 val); void (X86APIP outl) (X86EMU_pioAddr addr, u32 val); } X86EMU_pioFuncs; /**************************************************************************** REMARKS: Data structure containing ponters to memory access functions used by the emulator. This is used so that the user program can hook all memory access functions as necessary for the emulator. By default the emulator contains simple functions that only access the internal memory of the emulator. If you need specialised functions to handle access to different types of memory (ie: hardware framebuffer accesses and BIOS memory access etc), you will need to override this using the X86EMU_setupMemFuncs function. HEADER: x86emu.h MEMBERS: rdb - Function to read a byte from an address rdw - Function to read a word from an address rdl - Function to read a dword from an address wrb - Function to write a byte to an address wrw - Function to write a word to an address wrl - Function to write a dword to an address ****************************************************************************/ typedef struct { u8(X86APIP rdb) (u32 addr); u16(X86APIP rdw) (u32 addr); u32(X86APIP rdl) (u32 addr); void (X86APIP wrb) (u32 addr, u8 val); void (X86APIP wrw) (u32 addr, u16 val); void (X86APIP wrl) (u32 addr, u32 val); } X86EMU_memFuncs; /**************************************************************************** Here are the default memory read and write function in case they are needed as fallbacks. ***************************************************************************/ extern u8 X86API rdb(u32 addr); extern u16 X86API rdw(u32 addr); extern u32 X86API rdl(u32 addr); extern void X86API wrb(u32 addr, u8 val); extern void X86API wrw(u32 addr, u16 val); extern void X86API wrl(u32 addr, u32 val); #ifdef END_PACK #pragma END_PACK #endif /*--------------------- type definitions -----------------------------------*/ typedef void (X86APIP X86EMU_intrFuncs) (int num); extern X86EMU_intrFuncs _X86EMU_intrTab[256]; /*-------------------------- Function Prototypes --------------------------*/ #ifdef __cplusplus extern "C" { /* Use "C" linkage when in C++ mode */ #endif void X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs); void X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs); void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]); void X86EMU_prepareForInt(int num); /* decode.c */ void X86EMU_exec(void); void X86EMU_halt_sys(void); #ifdef DEBUG #define HALT_SYS() \ printk("halt_sys: file %s, line %d\n", __FILE__, __LINE__), \ X86EMU_halt_sys() #else #define HALT_SYS() X86EMU_halt_sys() #endif /* Debug options */ #define DEBUG_DECODE_F 0x000001 /* print decoded instruction */ #define DEBUG_TRACE_F 0x000002 /* dump regs before/after execution */ #define DEBUG_STEP_F 0x000004 #define DEBUG_DISASSEMBLE_F 0x000008 #define DEBUG_BREAK_F 0x000010 #define DEBUG_SVC_F 0x000020 #define DEBUG_SAVE_IP_CS_F 0x000040 #define DEBUG_FS_F 0x000080 #define DEBUG_PROC_F 0x000100 #define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */ #define DEBUG_TRACECALL_F 0x000400 #define DEBUG_INSTRUMENT_F 0x000800 #define DEBUG_MEM_TRACE_F 0x001000 #define DEBUG_IO_TRACE_F 0x002000 #define DEBUG_TRACECALL_REGS_F 0x004000 #define DEBUG_DECODE_NOPRINT_F 0x008000 #define DEBUG_EXIT 0x010000 #define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F) void X86EMU_trace_regs(void); void X86EMU_trace_xregs(void); void X86EMU_dump_memory(u16 seg, u16 off, u32 amt); int X86EMU_trace_on(void); int X86EMU_trace_off(void); #ifdef __cplusplus } /* End of "C" linkage for C++ */ #endif #endif /* __X86EMU_X86EMU_H */ xorg-server-1.17.1/hw/xfree86/x86emu/Makefile.in0000664000175100017510000006321312466505434016135 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/x86emu DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libx86emu_la_LIBADD = am_libx86emu_la_OBJECTS = debug.lo decode.lo fpu.lo ops2.lo ops.lo \ prim_ops.lo sys.lo libx86emu_la_OBJECTS = $(am_libx86emu_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 = @INT10_X86EMU_TRUE@am_libx86emu_la_rpath = 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 = $(libx86emu_la_SOURCES) DIST_SOURCES = $(libx86emu_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @INT10_X86EMU_TRUE@noinst_LTLIBRARIES = libx86emu.la libx86emu_la_SOURCES = debug.c \ decode.c \ fpu.c \ ops2.c \ ops.c \ prim_ops.c \ sys.c \ x86emu.h AM_CPPFLAGS = AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = validate.c \ x86emu/debug.h \ x86emu/decode.h \ x86emu/fpu.h \ x86emu/fpu_regs.h \ x86emu/ops.h \ x86emu/prim_asm.h \ x86emu/prim_ops.h \ x86emu/prim_x86_gcc.h \ x86emu/regs.h \ x86emu/types.h \ x86emu/x86emui.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/x86emu/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/x86emu/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libx86emu.la: $(libx86emu_la_OBJECTS) $(libx86emu_la_DEPENDENCIES) $(EXTRA_libx86emu_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libx86emu_la_rpath) $(libx86emu_la_OBJECTS) $(libx86emu_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ops.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ops2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prim_ops.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/xfree86/x86emu/decode.c0000664000175100017510000007747312366220413015462 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: This file includes subroutines which are related to * instruction decoding and accessess of immediate data via IP. etc. * ****************************************************************************/ #include #if defined(__sun) && defined(CS) /* avoid conflicts with Solaris sys/regset.h */ # undef CS # undef DS # undef SS # undef ES # undef FS # undef GS #endif #include "x86emu/x86emui.h" /*----------------------------- Implementation ----------------------------*/ /**************************************************************************** REMARKS: Handles any pending asychronous interrupts. ****************************************************************************/ static void x86emu_intr_handle(void) { u8 intno; if (M.x86.intr & INTR_SYNCH) { intno = M.x86.intno; if (_X86EMU_intrTab[intno]) { (*_X86EMU_intrTab[intno]) (intno); } else { push_word((u16) M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); push_word(M.x86.R_CS); M.x86.R_CS = mem_access_word(intno * 4 + 2); push_word(M.x86.R_IP); M.x86.R_IP = mem_access_word(intno * 4); M.x86.intr = 0; } } } /**************************************************************************** PARAMETERS: intrnum - Interrupt number to raise REMARKS: Raise the specified interrupt to be handled before the execution of the next instruction. ****************************************************************************/ void x86emu_intr_raise(u8 intrnum) { M.x86.intno = intrnum; M.x86.intr |= INTR_SYNCH; } /**************************************************************************** REMARKS: Main execution loop for the emulator. We return from here when the system halts, which is normally caused by a stack fault when we return from the original real mode call. ****************************************************************************/ void X86EMU_exec(void) { u8 op1; M.x86.intr = 0; DB(x86emu_end_instr(); ) for (;;) { DB(if (CHECK_IP_FETCH()) x86emu_check_ip_access();) /* If debugging, save the IP and CS values. */ SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP); INC_DECODED_INST_LEN(1); if (M.x86.intr) { if (M.x86.intr & INTR_HALTED) { DB(if (M.x86.R_SP != 0) { printk("halted\n"); X86EMU_trace_regs();} else { if (M.x86.debug) printk("Service completed successfully\n");} ) return; } if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) || !ACCESS_FLAG(F_IF)) { x86emu_intr_handle(); } } op1 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++)); (*x86emu_optab[op1]) (op1); if (M.x86.debug & DEBUG_EXIT) { M.x86.debug &= ~DEBUG_EXIT; return; } } } /**************************************************************************** REMARKS: Halts the system by setting the halted system flag. ****************************************************************************/ void X86EMU_halt_sys(void) { M.x86.intr |= INTR_HALTED; } /**************************************************************************** PARAMETERS: mod - Mod value from decoded byte regh - Reg h value from decoded byte regl - Reg l value from decoded byte REMARKS: Raise the specified interrupt to be handled before the execution of the next instruction. NOTE: Do not inline this function, as (*sys_rdb) is already inline! ****************************************************************************/ void fetch_decode_modrm(int *mod, int *regh, int *regl) { int fetched; DB(if (CHECK_IP_FETCH()) x86emu_check_ip_access();) fetched = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++)); INC_DECODED_INST_LEN(1); *mod = (fetched >> 6) & 0x03; *regh = (fetched >> 3) & 0x07; *regl = (fetched >> 0) & 0x07; } /**************************************************************************** RETURNS: Immediate byte value read from instruction queue REMARKS: This function returns the immediate byte from the instruction queue, and moves the instruction pointer to the next value. NOTE: Do not inline this function, as (*sys_rdb) is already inline! ****************************************************************************/ u8 fetch_byte_imm(void) { u8 fetched; DB(if (CHECK_IP_FETCH()) x86emu_check_ip_access();) fetched = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++)); INC_DECODED_INST_LEN(1); return fetched; } /**************************************************************************** RETURNS: Immediate word value read from instruction queue REMARKS: This function returns the immediate byte from the instruction queue, and moves the instruction pointer to the next value. NOTE: Do not inline this function, as (*sys_rdw) is already inline! ****************************************************************************/ u16 fetch_word_imm(void) { u16 fetched; DB(if (CHECK_IP_FETCH()) x86emu_check_ip_access();) fetched = (*sys_rdw) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP)); M.x86.R_IP += 2; INC_DECODED_INST_LEN(2); return fetched; } /**************************************************************************** RETURNS: Immediate lone value read from instruction queue REMARKS: This function returns the immediate byte from the instruction queue, and moves the instruction pointer to the next value. NOTE: Do not inline this function, as (*sys_rdw) is already inline! ****************************************************************************/ u32 fetch_long_imm(void) { u32 fetched; DB(if (CHECK_IP_FETCH()) x86emu_check_ip_access();) fetched = (*sys_rdl) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP)); M.x86.R_IP += 4; INC_DECODED_INST_LEN(4); return fetched; } /**************************************************************************** RETURNS: Value of the default data segment REMARKS: Inline function that returns the default data segment for the current instruction. On the x86 processor, the default segment is not always DS if there is no segment override. Address modes such as -3[BP] or 10[BP+SI] all refer to addresses relative to SS (ie: on the stack). So, at the minimum, all decodings of addressing modes would have to set/clear a bit describing whether the access is relative to DS or SS. That is the function of the cpu-state-varible M.x86.mode. There are several potential states: repe prefix seen (handled elsewhere) repne prefix seen (ditto) cs segment override ds segment override es segment override fs segment override gs segment override ss segment override ds/ss select (in absense of override) Each of the above 7 items are handled with a bit in the mode field. ****************************************************************************/ _INLINE u32 get_data_segment(void) { #define GET_SEGMENT(segment) switch (M.x86.mode & SYSMODE_SEGMASK) { case 0: /* default case: use ds register */ case SYSMODE_SEGOVR_DS: case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS: return M.x86.R_DS; case SYSMODE_SEG_DS_SS: /* non-overridden, use ss register */ return M.x86.R_SS; case SYSMODE_SEGOVR_CS: case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS: return M.x86.R_CS; case SYSMODE_SEGOVR_ES: case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS: return M.x86.R_ES; case SYSMODE_SEGOVR_FS: case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS: return M.x86.R_FS; case SYSMODE_SEGOVR_GS: case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS: return M.x86.R_GS; case SYSMODE_SEGOVR_SS: case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS: return M.x86.R_SS; default: #ifdef DEBUG printk("error: should not happen: multiple overrides.\n"); #endif HALT_SYS(); return 0; } } /**************************************************************************** PARAMETERS: offset - Offset to load data from RETURNS: Byte value read from the absolute memory location. NOTE: Do not inline this function as (*sys_rdX) is already inline! ****************************************************************************/ u8 fetch_data_byte(uint offset) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access((u16) get_data_segment(), offset); #endif return (*sys_rdb) ((get_data_segment() << 4) + offset); } /**************************************************************************** PARAMETERS: offset - Offset to load data from RETURNS: Word value read from the absolute memory location. NOTE: Do not inline this function as (*sys_rdX) is already inline! ****************************************************************************/ u16 fetch_data_word(uint offset) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access((u16) get_data_segment(), offset); #endif return (*sys_rdw) ((get_data_segment() << 4) + offset); } /**************************************************************************** PARAMETERS: offset - Offset to load data from RETURNS: Long value read from the absolute memory location. NOTE: Do not inline this function as (*sys_rdX) is already inline! ****************************************************************************/ u32 fetch_data_long(uint offset) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access((u16) get_data_segment(), offset); #endif return (*sys_rdl) ((get_data_segment() << 4) + offset); } /**************************************************************************** PARAMETERS: segment - Segment to load data from offset - Offset to load data from RETURNS: Byte value read from the absolute memory location. NOTE: Do not inline this function as (*sys_rdX) is already inline! ****************************************************************************/ u8 fetch_data_byte_abs(uint segment, uint offset) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access(segment, offset); #endif return (*sys_rdb) (((u32) segment << 4) + offset); } /**************************************************************************** PARAMETERS: segment - Segment to load data from offset - Offset to load data from RETURNS: Word value read from the absolute memory location. NOTE: Do not inline this function as (*sys_rdX) is already inline! ****************************************************************************/ u16 fetch_data_word_abs(uint segment, uint offset) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access(segment, offset); #endif return (*sys_rdw) (((u32) segment << 4) + offset); } /**************************************************************************** PARAMETERS: segment - Segment to load data from offset - Offset to load data from RETURNS: Long value read from the absolute memory location. NOTE: Do not inline this function as (*sys_rdX) is already inline! ****************************************************************************/ u32 fetch_data_long_abs(uint segment, uint offset) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access(segment, offset); #endif return (*sys_rdl) (((u32) segment << 4) + offset); } /**************************************************************************** PARAMETERS: offset - Offset to store data at val - Value to store REMARKS: Writes a word value to an segmented memory location. The segment used is the current 'default' segment, which may have been overridden. NOTE: Do not inline this function as (*sys_wrX) is already inline! ****************************************************************************/ void store_data_byte(uint offset, u8 val) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access((u16) get_data_segment(), offset); #endif (*sys_wrb) ((get_data_segment() << 4) + offset, val); } /**************************************************************************** PARAMETERS: offset - Offset to store data at val - Value to store REMARKS: Writes a word value to an segmented memory location. The segment used is the current 'default' segment, which may have been overridden. NOTE: Do not inline this function as (*sys_wrX) is already inline! ****************************************************************************/ void store_data_word(uint offset, u16 val) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access((u16) get_data_segment(), offset); #endif (*sys_wrw) ((get_data_segment() << 4) + offset, val); } /**************************************************************************** PARAMETERS: offset - Offset to store data at val - Value to store REMARKS: Writes a long value to an segmented memory location. The segment used is the current 'default' segment, which may have been overridden. NOTE: Do not inline this function as (*sys_wrX) is already inline! ****************************************************************************/ void store_data_long(uint offset, u32 val) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access((u16) get_data_segment(), offset); #endif (*sys_wrl) ((get_data_segment() << 4) + offset, val); } /**************************************************************************** PARAMETERS: segment - Segment to store data at offset - Offset to store data at val - Value to store REMARKS: Writes a byte value to an absolute memory location. NOTE: Do not inline this function as (*sys_wrX) is already inline! ****************************************************************************/ void store_data_byte_abs(uint segment, uint offset, u8 val) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access(segment, offset); #endif (*sys_wrb) (((u32) segment << 4) + offset, val); } /**************************************************************************** PARAMETERS: segment - Segment to store data at offset - Offset to store data at val - Value to store REMARKS: Writes a word value to an absolute memory location. NOTE: Do not inline this function as (*sys_wrX) is already inline! ****************************************************************************/ void store_data_word_abs(uint segment, uint offset, u16 val) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access(segment, offset); #endif (*sys_wrw) (((u32) segment << 4) + offset, val); } /**************************************************************************** PARAMETERS: segment - Segment to store data at offset - Offset to store data at val - Value to store REMARKS: Writes a long value to an absolute memory location. NOTE: Do not inline this function as (*sys_wrX) is already inline! ****************************************************************************/ void store_data_long_abs(uint segment, uint offset, u32 val) { #ifdef DEBUG if (CHECK_DATA_ACCESS()) x86emu_check_data_access(segment, offset); #endif (*sys_wrl) (((u32) segment << 4) + offset, val); } /**************************************************************************** PARAMETERS: reg - Register to decode RETURNS: Pointer to the appropriate register REMARKS: Return a pointer to the register given by the R/RM field of the modrm byte, for byte operands. Also enables the decoding of instructions. ****************************************************************************/ u8 * decode_rm_byte_register(int reg) { switch (reg) { case 0: DECODE_PRINTF("AL"); return &M.x86.R_AL; case 1: DECODE_PRINTF("CL"); return &M.x86.R_CL; case 2: DECODE_PRINTF("DL"); return &M.x86.R_DL; case 3: DECODE_PRINTF("BL"); return &M.x86.R_BL; case 4: DECODE_PRINTF("AH"); return &M.x86.R_AH; case 5: DECODE_PRINTF("CH"); return &M.x86.R_CH; case 6: DECODE_PRINTF("DH"); return &M.x86.R_DH; case 7: DECODE_PRINTF("BH"); return &M.x86.R_BH; } HALT_SYS(); return NULL; /* NOT REACHED OR REACHED ON ERROR */ } /**************************************************************************** PARAMETERS: reg - Register to decode RETURNS: Pointer to the appropriate register REMARKS: Return a pointer to the register given by the R/RM field of the modrm byte, for word operands. Also enables the decoding of instructions. ****************************************************************************/ u16 * decode_rm_word_register(int reg) { switch (reg) { case 0: DECODE_PRINTF("AX"); return &M.x86.R_AX; case 1: DECODE_PRINTF("CX"); return &M.x86.R_CX; case 2: DECODE_PRINTF("DX"); return &M.x86.R_DX; case 3: DECODE_PRINTF("BX"); return &M.x86.R_BX; case 4: DECODE_PRINTF("SP"); return &M.x86.R_SP; case 5: DECODE_PRINTF("BP"); return &M.x86.R_BP; case 6: DECODE_PRINTF("SI"); return &M.x86.R_SI; case 7: DECODE_PRINTF("DI"); return &M.x86.R_DI; } HALT_SYS(); return NULL; /* NOTREACHED OR REACHED ON ERROR */ } /**************************************************************************** PARAMETERS: reg - Register to decode RETURNS: Pointer to the appropriate register REMARKS: Return a pointer to the register given by the R/RM field of the modrm byte, for dword operands. Also enables the decoding of instructions. ****************************************************************************/ u32 * decode_rm_long_register(int reg) { switch (reg) { case 0: DECODE_PRINTF("EAX"); return &M.x86.R_EAX; case 1: DECODE_PRINTF("ECX"); return &M.x86.R_ECX; case 2: DECODE_PRINTF("EDX"); return &M.x86.R_EDX; case 3: DECODE_PRINTF("EBX"); return &M.x86.R_EBX; case 4: DECODE_PRINTF("ESP"); return &M.x86.R_ESP; case 5: DECODE_PRINTF("EBP"); return &M.x86.R_EBP; case 6: DECODE_PRINTF("ESI"); return &M.x86.R_ESI; case 7: DECODE_PRINTF("EDI"); return &M.x86.R_EDI; } HALT_SYS(); return NULL; /* NOTREACHED OR REACHED ON ERROR */ } /**************************************************************************** PARAMETERS: reg - Register to decode RETURNS: Pointer to the appropriate register REMARKS: Return a pointer to the register given by the R/RM field of the modrm byte, for word operands, modified from above for the weirdo special case of segreg operands. Also enables the decoding of instructions. ****************************************************************************/ u16 * decode_rm_seg_register(int reg) { switch (reg) { case 0: DECODE_PRINTF("ES"); return &M.x86.R_ES; case 1: DECODE_PRINTF("CS"); return &M.x86.R_CS; case 2: DECODE_PRINTF("SS"); return &M.x86.R_SS; case 3: DECODE_PRINTF("DS"); return &M.x86.R_DS; case 4: DECODE_PRINTF("FS"); return &M.x86.R_FS; case 5: DECODE_PRINTF("GS"); return &M.x86.R_GS; case 6: case 7: DECODE_PRINTF("ILLEGAL SEGREG"); break; } HALT_SYS(); return NULL; /* NOT REACHED OR REACHED ON ERROR */ } /* * * return offset from the SIB Byte */ u32 decode_sib_address(int sib, int mod) { u32 base = 0, i = 0, scale = 1; switch (sib & 0x07) { case 0: DECODE_PRINTF("[EAX]"); base = M.x86.R_EAX; break; case 1: DECODE_PRINTF("[ECX]"); base = M.x86.R_ECX; break; case 2: DECODE_PRINTF("[EDX]"); base = M.x86.R_EDX; break; case 3: DECODE_PRINTF("[EBX]"); base = M.x86.R_EBX; break; case 4: DECODE_PRINTF("[ESP]"); base = M.x86.R_ESP; M.x86.mode |= SYSMODE_SEG_DS_SS; break; case 5: if (mod == 0) { base = fetch_long_imm(); DECODE_PRINTF2("%08x", base); } else { DECODE_PRINTF("[EBP]"); base = M.x86.R_ESP; M.x86.mode |= SYSMODE_SEG_DS_SS; } break; case 6: DECODE_PRINTF("[ESI]"); base = M.x86.R_ESI; break; case 7: DECODE_PRINTF("[EDI]"); base = M.x86.R_EDI; break; } switch ((sib >> 3) & 0x07) { case 0: DECODE_PRINTF("[EAX"); i = M.x86.R_EAX; break; case 1: DECODE_PRINTF("[ECX"); i = M.x86.R_ECX; break; case 2: DECODE_PRINTF("[EDX"); i = M.x86.R_EDX; break; case 3: DECODE_PRINTF("[EBX"); i = M.x86.R_EBX; break; case 4: i = 0; break; case 5: DECODE_PRINTF("[EBP"); i = M.x86.R_EBP; break; case 6: DECODE_PRINTF("[ESI"); i = M.x86.R_ESI; break; case 7: DECODE_PRINTF("[EDI"); i = M.x86.R_EDI; break; } scale = 1 << ((sib >> 6) & 0x03); if (((sib >> 3) & 0x07) != 4) { if (scale == 1) { DECODE_PRINTF("]"); } else { DECODE_PRINTF2("*%d]", scale); } } return base + (i * scale); } /**************************************************************************** PARAMETERS: rm - RM value to decode RETURNS: Offset in memory for the address decoding REMARKS: Return the offset given by mod=00 addressing. Also enables the decoding of instructions. NOTE: The code which specifies the corresponding segment (ds vs ss) below in the case of [BP+..]. The assumption here is that at the point that this subroutine is called, the bit corresponding to SYSMODE_SEG_DS_SS will be zero. After every instruction except the segment override instructions, this bit (as well as any bits indicating segment overrides) will be clear. So if a SS access is needed, set this bit. Otherwise, DS access occurs (unless any of the segment override bits are set). ****************************************************************************/ u32 decode_rm00_address(int rm) { u32 offset; int sib; if (M.x86.mode & SYSMODE_PREFIX_ADDR) { /* 32-bit addressing */ switch (rm) { case 0: DECODE_PRINTF("[EAX]"); return M.x86.R_EAX; case 1: DECODE_PRINTF("[ECX]"); return M.x86.R_ECX; case 2: DECODE_PRINTF("[EDX]"); return M.x86.R_EDX; case 3: DECODE_PRINTF("[EBX]"); return M.x86.R_EBX; case 4: sib = fetch_byte_imm(); return decode_sib_address(sib, 0); case 5: offset = fetch_long_imm(); DECODE_PRINTF2("[%08x]", offset); return offset; case 6: DECODE_PRINTF("[ESI]"); return M.x86.R_ESI; case 7: DECODE_PRINTF("[EDI]"); return M.x86.R_EDI; } HALT_SYS(); } else { /* 16-bit addressing */ switch (rm) { case 0: DECODE_PRINTF("[BX+SI]"); return (M.x86.R_BX + M.x86.R_SI) & 0xffff; case 1: DECODE_PRINTF("[BX+DI]"); return (M.x86.R_BX + M.x86.R_DI) & 0xffff; case 2: DECODE_PRINTF("[BP+SI]"); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + M.x86.R_SI) & 0xffff; case 3: DECODE_PRINTF("[BP+DI]"); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + M.x86.R_DI) & 0xffff; case 4: DECODE_PRINTF("[SI]"); return M.x86.R_SI; case 5: DECODE_PRINTF("[DI]"); return M.x86.R_DI; case 6: offset = fetch_word_imm(); DECODE_PRINTF2("[%04x]", offset); return offset; case 7: DECODE_PRINTF("[BX]"); return M.x86.R_BX; } HALT_SYS(); } return 0; } /**************************************************************************** PARAMETERS: rm - RM value to decode RETURNS: Offset in memory for the address decoding REMARKS: Return the offset given by mod=01 addressing. Also enables the decoding of instructions. ****************************************************************************/ u32 decode_rm01_address(int rm) { int displacement = 0; int sib; /* Fetch disp8 if no SIB byte */ if (!((M.x86.mode & SYSMODE_PREFIX_ADDR) && (rm == 4))) displacement = (s8) fetch_byte_imm(); if (M.x86.mode & SYSMODE_PREFIX_ADDR) { /* 32-bit addressing */ switch (rm) { case 0: DECODE_PRINTF2("%d[EAX]", displacement); return M.x86.R_EAX + displacement; case 1: DECODE_PRINTF2("%d[ECX]", displacement); return M.x86.R_ECX + displacement; case 2: DECODE_PRINTF2("%d[EDX]", displacement); return M.x86.R_EDX + displacement; case 3: DECODE_PRINTF2("%d[EBX]", displacement); return M.x86.R_EBX + displacement; case 4: sib = fetch_byte_imm(); displacement = (s8) fetch_byte_imm(); DECODE_PRINTF2("%d", displacement); return decode_sib_address(sib, 1) + displacement; case 5: DECODE_PRINTF2("%d[EBP]", displacement); return M.x86.R_EBP + displacement; case 6: DECODE_PRINTF2("%d[ESI]", displacement); return M.x86.R_ESI + displacement; case 7: DECODE_PRINTF2("%d[EDI]", displacement); return M.x86.R_EDI + displacement; } HALT_SYS(); } else { /* 16-bit addressing */ switch (rm) { case 0: DECODE_PRINTF2("%d[BX+SI]", displacement); return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff; case 1: DECODE_PRINTF2("%d[BX+DI]", displacement); return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff; case 2: DECODE_PRINTF2("%d[BP+SI]", displacement); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff; case 3: DECODE_PRINTF2("%d[BP+DI]", displacement); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff; case 4: DECODE_PRINTF2("%d[SI]", displacement); return (M.x86.R_SI + displacement) & 0xffff; case 5: DECODE_PRINTF2("%d[DI]", displacement); return (M.x86.R_DI + displacement) & 0xffff; case 6: DECODE_PRINTF2("%d[BP]", displacement); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + displacement) & 0xffff; case 7: DECODE_PRINTF2("%d[BX]", displacement); return (M.x86.R_BX + displacement) & 0xffff; } HALT_SYS(); } return 0; /* SHOULD NOT HAPPEN */ } /**************************************************************************** PARAMETERS: rm - RM value to decode RETURNS: Offset in memory for the address decoding REMARKS: Return the offset given by mod=10 addressing. Also enables the decoding of instructions. ****************************************************************************/ u32 decode_rm10_address(int rm) { u32 displacement = 0; int sib; /* Fetch disp16 if 16-bit addr mode */ if (!(M.x86.mode & SYSMODE_PREFIX_ADDR)) displacement = (u16) fetch_word_imm(); else { /* Fetch disp32 if no SIB byte */ if (rm != 4) displacement = (u32) fetch_long_imm(); } if (M.x86.mode & SYSMODE_PREFIX_ADDR) { /* 32-bit addressing */ switch (rm) { case 0: DECODE_PRINTF2("%08x[EAX]", displacement); return M.x86.R_EAX + displacement; case 1: DECODE_PRINTF2("%08x[ECX]", displacement); return M.x86.R_ECX + displacement; case 2: DECODE_PRINTF2("%08x[EDX]", displacement); M.x86.mode |= SYSMODE_SEG_DS_SS; return M.x86.R_EDX + displacement; case 3: DECODE_PRINTF2("%08x[EBX]", displacement); return M.x86.R_EBX + displacement; case 4: sib = fetch_byte_imm(); displacement = (u32) fetch_long_imm(); DECODE_PRINTF2("%08x", displacement); return decode_sib_address(sib, 2) + displacement; break; case 5: DECODE_PRINTF2("%08x[EBP]", displacement); return M.x86.R_EBP + displacement; case 6: DECODE_PRINTF2("%08x[ESI]", displacement); return M.x86.R_ESI + displacement; case 7: DECODE_PRINTF2("%08x[EDI]", displacement); return M.x86.R_EDI + displacement; } HALT_SYS(); } else { /* 16-bit addressing */ switch (rm) { case 0: DECODE_PRINTF2("%04x[BX+SI]", displacement); return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff; case 1: DECODE_PRINTF2("%04x[BX+DI]", displacement); return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff; case 2: DECODE_PRINTF2("%04x[BP+SI]", displacement); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff; case 3: DECODE_PRINTF2("%04x[BP+DI]", displacement); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff; case 4: DECODE_PRINTF2("%04x[SI]", displacement); return (M.x86.R_SI + displacement) & 0xffff; case 5: DECODE_PRINTF2("%04x[DI]", displacement); return (M.x86.R_DI + displacement) & 0xffff; case 6: DECODE_PRINTF2("%04x[BP]", displacement); M.x86.mode |= SYSMODE_SEG_DS_SS; return (M.x86.R_BP + displacement) & 0xffff; case 7: DECODE_PRINTF2("%04x[BX]", displacement); return (M.x86.R_BX + displacement) & 0xffff; } HALT_SYS(); } return 0; /*NOTREACHED */ } xorg-server-1.17.1/hw/xfree86/x86emu/prim_ops.c0000664000175100017510000024156612456571574016104 00000000000000/**************************************************************************** * * Realmode X86 Emulator Library * * Copyright (C) 1996-1999 SciTech Software, Inc. * Copyright (C) David Mosberger-Tang * Copyright (C) 1999 Egbert Eich * * ======================================================================== * * 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 authors not be used * in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The authors makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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. * * ======================================================================== * * Language: ANSI C * Environment: Any * Developer: Kendall Bennett * * Description: This file contains the code to implement the primitive * machine operations used by the emulation code in ops.c * * Carry Chain Calculation * * This represents a somewhat expensive calculation which is * apparently required to emulate the setting of the OF and AF flag. * The latter is not so important, but the former is. The overflow * flag is the XOR of the top two bits of the carry chain for an * addition (similar for subtraction). Since we do not want to * simulate the addition in a bitwise manner, we try to calculate the * carry chain given the two operands and the result. * * So, given the following table, which represents the addition of two * bits, we can derive a formula for the carry chain. * * a b cin r cout * 0 0 0 0 0 * 0 0 1 1 0 * 0 1 0 1 0 * 0 1 1 0 1 * 1 0 0 1 0 * 1 0 1 0 1 * 1 1 0 0 1 * 1 1 1 1 1 * * Construction of table for cout: * * ab * r \ 00 01 11 10 * |------------------ * 0 | 0 1 1 1 * 1 | 0 0 1 0 * * By inspection, one gets: cc = ab + r'(a + b) * * That represents alot of operations, but NO CHOICE.... * * Borrow Chain Calculation. * * The following table represents the subtraction of two bits, from * which we can derive a formula for the borrow chain. * * a b bin r bout * 0 0 0 0 0 * 0 0 1 1 1 * 0 1 0 1 1 * 0 1 1 0 1 * 1 0 0 1 0 * 1 0 1 0 0 * 1 1 0 0 0 * 1 1 1 1 1 * * Construction of table for cout: * * ab * r \ 00 01 11 10 * |------------------ * 0 | 0 1 0 0 * 1 | 1 1 1 0 * * By inspection, one gets: bc = a'b + r(a' + b) * ****************************************************************************/ #include #define PRIM_OPS_NO_REDEFINE_ASM #include "x86emu/x86emui.h" #if defined(__GNUC__) #if defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__) #include "x86emu/prim_x86_gcc.h" #endif #endif /*------------------------- Global Variables ------------------------------*/ static u32 x86emu_parity_tab[8] = { 0x96696996, 0x69969669, 0x69969669, 0x96696996, 0x69969669, 0x96696996, 0x96696996, 0x69969669, }; #define PARITY(x) (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0) #define XOR2(x) (((x) ^ ((x)>>1)) & 0x1) /*----------------------------- Implementation ----------------------------*/ /**************************************************************************** REMARKS: Implements the AAA instruction and side effects. ****************************************************************************/ u16 aaa_word(u16 d) { u16 res; if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) { d += 0x6; d += 0x100; SET_FLAG(F_AF); SET_FLAG(F_CF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); } res = (u16) (d & 0xFF0F); CLEAR_FLAG(F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); return res; } /**************************************************************************** REMARKS: Implements the AAA instruction and side effects. ****************************************************************************/ u16 aas_word(u16 d) { u16 res; if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) { d -= 0x6; d -= 0x100; SET_FLAG(F_AF); SET_FLAG(F_CF); } else { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); } res = (u16) (d & 0xFF0F); CLEAR_FLAG(F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); return res; } /**************************************************************************** REMARKS: Implements the AAD instruction and side effects. ****************************************************************************/ u16 aad_word(u16 d) { u16 l; u8 hb, lb; hb = (u8) ((d >> 8) & 0xff); lb = (u8) ((d & 0xff)); l = (u16) ((lb + 10 * hb) & 0xFF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(l & 0x80, F_SF); CONDITIONAL_SET_FLAG(l == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF); return l; } /**************************************************************************** REMARKS: Implements the AAM instruction and side effects. ****************************************************************************/ u16 aam_word(u8 d) { u16 h, l; h = (u16) (d / 10); l = (u16) (d % 10); l |= (u16) (h << 8); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(l & 0x80, F_SF); CONDITIONAL_SET_FLAG(l == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF); return l; } /**************************************************************************** REMARKS: Implements the ADC instruction and side effects. ****************************************************************************/ u8 adc_byte(u8 d, u8 s) { register u32 res; /* all operands in native machine order */ register u32 cc; if (ACCESS_FLAG(F_CF)) res = 1 + d + s; else res = d + s; CONDITIONAL_SET_FLAG(res & 0x100, F_CF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (s & d) | ((~res) & (s | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return (u8) res; } /**************************************************************************** REMARKS: Implements the ADC instruction and side effects. ****************************************************************************/ u16 adc_word(u16 d, u16 s) { register u32 res; /* all operands in native machine order */ register u32 cc; if (ACCESS_FLAG(F_CF)) res = 1 + d + s; else res = d + s; CONDITIONAL_SET_FLAG(res & 0x10000, F_CF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (s & d) | ((~res) & (s | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return (u16) res; } /**************************************************************************** REMARKS: Implements the ADC instruction and side effects. ****************************************************************************/ u32 adc_long(u32 d, u32 s) { register u32 lo; /* all operands in native machine order */ register u32 hi; register u32 res; register u32 cc; if (ACCESS_FLAG(F_CF)) { lo = 1 + (d & 0xFFFF) + (s & 0xFFFF); res = 1 + d + s; } else { lo = (d & 0xFFFF) + (s & 0xFFFF); res = d + s; } hi = (lo >> 16) + (d >> 16) + (s >> 16); CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (s & d) | ((~res) & (s | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the ADD instruction and side effects. ****************************************************************************/ u8 add_byte(u8 d, u8 s) { register u32 res; /* all operands in native machine order */ register u32 cc; res = d + s; CONDITIONAL_SET_FLAG(res & 0x100, F_CF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (s & d) | ((~res) & (s | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return (u8) res; } /**************************************************************************** REMARKS: Implements the ADD instruction and side effects. ****************************************************************************/ u16 add_word(u16 d, u16 s) { register u32 res; /* all operands in native machine order */ register u32 cc; res = d + s; CONDITIONAL_SET_FLAG(res & 0x10000, F_CF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (s & d) | ((~res) & (s | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return (u16) res; } /**************************************************************************** REMARKS: Implements the ADD instruction and side effects. ****************************************************************************/ u32 add_long(u32 d, u32 s) { register u32 lo; /* all operands in native machine order */ register u32 hi; register u32 res; register u32 cc; lo = (d & 0xFFFF) + (s & 0xFFFF); res = d + s; hi = (lo >> 16) + (d >> 16) + (s >> 16); CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (s & d) | ((~res) & (s | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the AND instruction and side effects. ****************************************************************************/ u8 and_byte(u8 d, u8 s) { register u8 res; /* all operands in native machine order */ res = d & s; /* set the flags */ CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res), F_PF); return res; } /**************************************************************************** REMARKS: Implements the AND instruction and side effects. ****************************************************************************/ u16 and_word(u16 d, u16 s) { register u16 res; /* all operands in native machine order */ res = d & s; /* set the flags */ CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); return res; } /**************************************************************************** REMARKS: Implements the AND instruction and side effects. ****************************************************************************/ u32 and_long(u32 d, u32 s) { register u32 res; /* all operands in native machine order */ res = d & s; /* set the flags */ CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); return res; } /**************************************************************************** REMARKS: Implements the CMP instruction and side effects. ****************************************************************************/ u8 cmp_byte(u8 d, u8 s) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - s; CLEAR_FLAG(F_CF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return d; } /**************************************************************************** REMARKS: Implements the CMP instruction and side effects. ****************************************************************************/ u16 cmp_word(u16 d, u16 s) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return d; } /**************************************************************************** REMARKS: Implements the CMP instruction and side effects. ****************************************************************************/ u32 cmp_long(u32 d, u32 s) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return d; } /**************************************************************************** REMARKS: Implements the DAA instruction and side effects. ****************************************************************************/ u8 daa_byte(u8 d) { u32 res = d; if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) { res += 6; SET_FLAG(F_AF); } if (res > 0x9F || ACCESS_FLAG(F_CF)) { res += 0x60; SET_FLAG(F_CF); } CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); return (u8) res; } /**************************************************************************** REMARKS: Implements the DAS instruction and side effects. ****************************************************************************/ u8 das_byte(u8 d) { if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) { d -= 6; SET_FLAG(F_AF); } if (d > 0x9F || ACCESS_FLAG(F_CF)) { d -= 0x60; SET_FLAG(F_CF); } CONDITIONAL_SET_FLAG(d & 0x80, F_SF); CONDITIONAL_SET_FLAG(d == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF); return d; } /**************************************************************************** REMARKS: Implements the DEC instruction and side effects. ****************************************************************************/ u8 dec_byte(u8 d) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - 1; CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ /* based on sub_byte, uses s==1. */ bc = (res & (~d | 1)) | (~d & 1); /* carry flag unchanged */ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return (u8) res; } /**************************************************************************** REMARKS: Implements the DEC instruction and side effects. ****************************************************************************/ u16 dec_word(u16 d) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - 1; CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ /* based on the sub_byte routine, with s==1 */ bc = (res & (~d | 1)) | (~d & 1); /* carry flag unchanged */ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return (u16) res; } /**************************************************************************** REMARKS: Implements the DEC instruction and side effects. ****************************************************************************/ u32 dec_long(u32 d) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - 1; CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | 1)) | (~d & 1); /* carry flag unchanged */ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the INC instruction and side effects. ****************************************************************************/ u8 inc_byte(u8 d) { register u32 res; /* all operands in native machine order */ register u32 cc; res = d + 1; CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = ((1 & d) | (~res)) & (1 | d); CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return (u8) res; } /**************************************************************************** REMARKS: Implements the INC instruction and side effects. ****************************************************************************/ u16 inc_word(u16 d) { register u32 res; /* all operands in native machine order */ register u32 cc; res = d + 1; CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (1 & d) | ((~res) & (1 | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return (u16) res; } /**************************************************************************** REMARKS: Implements the INC instruction and side effects. ****************************************************************************/ u32 inc_long(u32 d) { register u32 res; /* all operands in native machine order */ register u32 cc; res = d + 1; CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the carry chain SEE NOTE AT TOP. */ cc = (1 & d) | ((~res) & (1 | d)); CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the OR instruction and side effects. ****************************************************************************/ u8 or_byte(u8 d, u8 s) { register u8 res; /* all operands in native machine order */ res = d | s; CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res), F_PF); return res; } /**************************************************************************** REMARKS: Implements the OR instruction and side effects. ****************************************************************************/ u16 or_word(u16 d, u16 s) { register u16 res; /* all operands in native machine order */ res = d | s; /* set the carry flag to be bit 8 */ CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); return res; } /**************************************************************************** REMARKS: Implements the OR instruction and side effects. ****************************************************************************/ u32 or_long(u32 d, u32 s) { register u32 res; /* all operands in native machine order */ res = d | s; /* set the carry flag to be bit 8 */ CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); return res; } /**************************************************************************** REMARKS: Implements the OR instruction and side effects. ****************************************************************************/ u8 neg_byte(u8 s) { register u8 res; register u8 bc; CONDITIONAL_SET_FLAG(s != 0, F_CF); res = (u8) - s; CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(res), F_PF); /* calculate the borrow chain --- modified such that d=0. substitutiing d=0 into bc= res&(~d|s)|(~d&s); (the one used for sub) and simplifying, since ~d=0xff..., ~d|s == 0xffff..., and res&0xfff... == res. Similarly ~d&s == s. So the simplified result is: */ bc = res | s; CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the OR instruction and side effects. ****************************************************************************/ u16 neg_word(u16 s) { register u16 res; register u16 bc; CONDITIONAL_SET_FLAG(s != 0, F_CF); res = (u16) - s; CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain --- modified such that d=0. substitutiing d=0 into bc= res&(~d|s)|(~d&s); (the one used for sub) and simplifying, since ~d=0xff..., ~d|s == 0xffff..., and res&0xfff... == res. Similarly ~d&s == s. So the simplified result is: */ bc = res | s; CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the OR instruction and side effects. ****************************************************************************/ u32 neg_long(u32 s) { register u32 res; register u32 bc; CONDITIONAL_SET_FLAG(s != 0, F_CF); res = (u32) - s; CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain --- modified such that d=0. substitutiing d=0 into bc= res&(~d|s)|(~d&s); (the one used for sub) and simplifying, since ~d=0xff..., ~d|s == 0xffff..., and res&0xfff... == res. Similarly ~d&s == s. So the simplified result is: */ bc = res | s; CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the NOT instruction and side effects. ****************************************************************************/ u8 not_byte(u8 s) { return ~s; } /**************************************************************************** REMARKS: Implements the NOT instruction and side effects. ****************************************************************************/ u16 not_word(u16 s) { return ~s; } /**************************************************************************** REMARKS: Implements the NOT instruction and side effects. ****************************************************************************/ u32 not_long(u32 s) { return ~s; } /**************************************************************************** REMARKS: Implements the RCL instruction and side effects. ****************************************************************************/ u8 rcl_byte(u8 d, u8 s) { register unsigned int res, cnt, mask, cf; /* s is the rotate distance. It varies from 0 - 8. */ /* have CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 want to rotate through the carry by "s" bits. We could loop, but that's inefficient. So the width is 9, and we split into three parts: The new carry flag (was B_n) the stuff in B_n-1 .. B_0 the stuff in B_7 .. B_n+1 The new rotate is done mod 9, and given this, for a rotation of n bits (mod 9) the new carry flag is then located n bits from the MSB. The low part is then shifted up cnt bits, and the high part is or'd in. Using CAPS for new values, and lowercase for the original values, this can be expressed as: IF n > 0 1) CF <- b_(8-n) 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 3) B_(n-1) <- cf 4) B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */ res = d; if ((cnt = s % 9) != 0) { /* extract the new CARRY FLAG. */ /* CF <- b_(8-n) */ cf = (d >> (8 - cnt)) & 0x1; /* get the low stuff which rotated into the range B_7 .. B_cnt */ /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 */ /* note that the right hand side done by the mask */ res = (d << cnt) & 0xff; /* now the high stuff which rotated around into the positions B_cnt-2 .. B_0 */ /* B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */ /* shift it downward, 7-(n-2) = 9-n positions. and mask off the result before or'ing in. */ mask = (1 << (cnt - 1)) - 1; res |= (d >> (9 - cnt)) & mask; /* if the carry flag was set, or it in. */ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */ /* B_(n-1) <- cf */ res |= 1 << (cnt - 1); } /* set the new carry flag, based on the variable "cf" */ CONDITIONAL_SET_FLAG(cf, F_CF); /* OVERFLOW is set *IFF* cnt==1, then it is the xor of CF and the most significant bit. Blecck. */ /* parenthesized this expression since it appears to be causing OF to be misset */ CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)), F_OF); } return (u8) res; } /**************************************************************************** REMARKS: Implements the RCL instruction and side effects. ****************************************************************************/ u16 rcl_word(u16 d, u8 s) { register unsigned int res, cnt, mask, cf; res = d; if ((cnt = s % 17) != 0) { cf = (d >> (16 - cnt)) & 0x1; res = (d << cnt) & 0xffff; mask = (1 << (cnt - 1)) - 1; res |= (d >> (17 - cnt)) & mask; if (ACCESS_FLAG(F_CF)) { res |= 1 << (cnt - 1); } CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)), F_OF); } return (u16) res; } /**************************************************************************** REMARKS: Implements the RCL instruction and side effects. ****************************************************************************/ u32 rcl_long(u32 d, u8 s) { register u32 res, cnt, mask, cf; res = d; if ((cnt = s % 33) != 0) { cf = (d >> (32 - cnt)) & 0x1; res = (d << cnt) & 0xffffffff; mask = (1 << (cnt - 1)) - 1; res |= (d >> (33 - cnt)) & mask; if (ACCESS_FLAG(F_CF)) { /* carry flag is set */ res |= 1 << (cnt - 1); } CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)), F_OF); } return res; } /**************************************************************************** REMARKS: Implements the RCR instruction and side effects. ****************************************************************************/ u8 rcr_byte(u8 d, u8 s) { u32 res, cnt; u32 mask, cf, ocf = 0; /* rotate right through carry */ /* s is the rotate distance. It varies from 0 - 8. d is the byte object rotated. have CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 The new rotate is done mod 9, and given this, for a rotation of n bits (mod 9) the new carry flag is then located n bits from the LSB. The low part is then shifted up cnt bits, and the high part is or'd in. Using CAPS for new values, and lowercase for the original values, this can be expressed as: IF n > 0 1) CF <- b_(n-1) 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) 3) B_(8-n) <- cf 4) B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */ res = d; if ((cnt = s % 9) != 0) { /* extract the new CARRY FLAG. */ /* CF <- b_(n-1) */ if (cnt == 1) { cf = d & 0x1; /* note hackery here. Access_flag(..) evaluates to either 0 if flag not set non-zero if flag is set. doing access_flag(..) != 0 casts that into either 0..1 in any representation of the flags register (i.e. packed bit array or unpacked.) */ ocf = ACCESS_FLAG(F_CF) != 0; } else cf = (d >> (cnt - 1)) & 0x1; /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */ /* note that the right hand side done by the mask This is effectively done by shifting the object to the right. The result must be masked, in case the object came in and was treated as a negative number. Needed??? */ mask = (1 << (8 - cnt)) - 1; res = (d >> cnt) & mask; /* now the high stuff which rotated around into the positions B_cnt-2 .. B_0 */ /* B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */ /* shift it downward, 7-(n-2) = 9-n positions. and mask off the result before or'ing in. */ res |= (d << (9 - cnt)); /* if the carry flag was set, or it in. */ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */ /* B_(8-n) <- cf */ res |= 1 << (8 - cnt); } /* set the new carry flag, based on the variable "cf" */ CONDITIONAL_SET_FLAG(cf, F_CF); /* OVERFLOW is set *IFF* cnt==1, then it is the xor of CF and the most significant bit. Blecck. */ /* parenthesized... */ if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)), F_OF); } } return (u8) res; } /**************************************************************************** REMARKS: Implements the RCR instruction and side effects. ****************************************************************************/ u16 rcr_word(u16 d, u8 s) { u32 res, cnt; u32 mask, cf, ocf = 0; /* rotate right through carry */ res = d; if ((cnt = s % 17) != 0) { if (cnt == 1) { cf = d & 0x1; ocf = ACCESS_FLAG(F_CF) != 0; } else cf = (d >> (cnt - 1)) & 0x1; mask = (1 << (16 - cnt)) - 1; res = (d >> cnt) & mask; res |= (d << (17 - cnt)); if (ACCESS_FLAG(F_CF)) { res |= 1 << (16 - cnt); } CONDITIONAL_SET_FLAG(cf, F_CF); if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)), F_OF); } } return (u16) res; } /**************************************************************************** REMARKS: Implements the RCR instruction and side effects. ****************************************************************************/ u32 rcr_long(u32 d, u8 s) { u32 res, cnt; u32 mask, cf, ocf = 0; /* rotate right through carry */ res = d; if ((cnt = s % 33) != 0) { if (cnt == 1) { cf = d & 0x1; ocf = ACCESS_FLAG(F_CF) != 0; } else cf = (d >> (cnt - 1)) & 0x1; mask = (1 << (32 - cnt)) - 1; res = (d >> cnt) & mask; if (cnt != 1) res |= (d << (33 - cnt)); if (ACCESS_FLAG(F_CF)) { /* carry flag is set */ res |= 1 << (32 - cnt); } CONDITIONAL_SET_FLAG(cf, F_CF); if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)), F_OF); } } return res; } /**************************************************************************** REMARKS: Implements the ROL instruction and side effects. ****************************************************************************/ u8 rol_byte(u8 d, u8 s) { register unsigned int res, cnt, mask; /* rotate left */ /* s is the rotate distance. It varies from 0 - 8. d is the byte object rotated. have CF B_7 ... B_0 The new rotate is done mod 8. Much simpler than the "rcl" or "rcr" operations. IF n > 0 1) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) 2) B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */ res = d; if ((cnt = s % 8) != 0) { /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) */ res = (d << cnt); /* B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */ mask = (1 << cnt) - 1; res |= (d >> (8 - cnt)) & mask; /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); /* OVERFLOW is set *IFF* s==1, then it is the xor of CF and the most significant bit. Blecck. */ CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 6) & 0x2)), F_OF); } if (s != 0) { /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); } return (u8) res; } /**************************************************************************** REMARKS: Implements the ROL instruction and side effects. ****************************************************************************/ u16 rol_word(u16 d, u8 s) { register unsigned int res, cnt, mask; res = d; if ((cnt = s % 16) != 0) { res = (d << cnt); mask = (1 << cnt) - 1; res |= (d >> (16 - cnt)) & mask; CONDITIONAL_SET_FLAG(res & 0x1, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 14) & 0x2)), F_OF); } if (s != 0) { /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); } return (u16) res; } /**************************************************************************** REMARKS: Implements the ROL instruction and side effects. ****************************************************************************/ u32 rol_long(u32 d, u8 s) { register u32 res, cnt, mask; res = d; if ((cnt = s % 32) != 0) { res = (d << cnt); mask = (1 << cnt) - 1; res |= (d >> (32 - cnt)) & mask; CONDITIONAL_SET_FLAG(res & 0x1, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2((res & 0x1) + ((res >> 30) & 0x2)), F_OF); } if (s != 0) { /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x1, F_CF); } return res; } /**************************************************************************** REMARKS: Implements the ROR instruction and side effects. ****************************************************************************/ u8 ror_byte(u8 d, u8 s) { register unsigned int res, cnt, mask; /* rotate right */ /* s is the rotate distance. It varies from 0 - 8. d is the byte object rotated. have B_7 ... B_0 The rotate is done mod 8. IF n > 0 1) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) 2) B_(7) .. B_(8-n) <- b_(n-1) .. b_(0) */ res = d; if ((cnt = s % 8) != 0) { /* not a typo, do nada if cnt==0 */ /* B_(7) .. B_(8-n) <- b_(n-1) .. b_(0) */ res = (d << (8 - cnt)); /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) */ mask = (1 << (8 - cnt)) - 1; res |= (d >> (cnt)) & mask; /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x80, F_CF); /* OVERFLOW is set *IFF* s==1, then it is the xor of the two most significant bits. Blecck. */ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF); } else if (s != 0) { /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x80, F_CF); } return (u8) res; } /**************************************************************************** REMARKS: Implements the ROR instruction and side effects. ****************************************************************************/ u16 ror_word(u16 d, u8 s) { register unsigned int res, cnt, mask; res = d; if ((cnt = s % 16) != 0) { res = (d << (16 - cnt)); mask = (1 << (16 - cnt)) - 1; res |= (d >> (cnt)) & mask; CONDITIONAL_SET_FLAG(res & 0x8000, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF); } else if (s != 0) { /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x8000, F_CF); } return (u16) res; } /**************************************************************************** REMARKS: Implements the ROR instruction and side effects. ****************************************************************************/ u32 ror_long(u32 d, u8 s) { register u32 res, cnt, mask; res = d; if ((cnt = s % 32) != 0) { res = (d << (32 - cnt)); mask = (1 << (32 - cnt)) - 1; res |= (d >> (cnt)) & mask; CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF); } else if (s != 0) { /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF); } return res; } /**************************************************************************** REMARKS: Implements the SHL instruction and side effects. ****************************************************************************/ u8 shl_byte(u8 d, u8 s) { unsigned int cnt, res, cf; if (s < 8) { cnt = s % 8; /* last bit shifted out goes into carry flag */ if (cnt > 0) { res = d << cnt; cf = d & (1 << (8 - cnt)); CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = (u8) d; } if (cnt == 1) { /* Needs simplification. */ CONDITIONAL_SET_FLAG((((res & 0x80) == 0x80) ^ (ACCESS_FLAG(F_CF) != 0)), /* was (M.x86.R_FLG&F_CF)==F_CF)), */ F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } return (u8) res; } /**************************************************************************** REMARKS: Implements the SHL instruction and side effects. ****************************************************************************/ u16 shl_word(u16 d, u8 s) { unsigned int cnt, res, cf; if (s < 16) { cnt = s % 16; if (cnt > 0) { res = d << cnt; cf = d & (1 << (16 - cnt)); CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = (u16) d; } if (cnt == 1) { CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^ (ACCESS_FLAG(F_CF) != 0)), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } return (u16) res; } /**************************************************************************** REMARKS: Implements the SHL instruction and side effects. ****************************************************************************/ u32 shl_long(u32 d, u8 s) { unsigned int cnt, res, cf; if (s < 32) { cnt = s % 32; if (cnt > 0) { res = d << cnt; cf = d & (1 << (32 - cnt)); CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = d; } if (cnt == 1) { CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^ (ACCESS_FLAG(F_CF) != 0)), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } return res; } /**************************************************************************** REMARKS: Implements the SHR instruction and side effects. ****************************************************************************/ u8 shr_byte(u8 d, u8 s) { unsigned int cnt, res, cf; if (s < 8) { cnt = s % 8; if (cnt > 0) { cf = d & (1 << (cnt - 1)); res = d >> cnt; CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = (u8) d; } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CONDITIONAL_SET_FLAG((d >> (s - 1)) & 0x1, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } return (u8) res; } /**************************************************************************** REMARKS: Implements the SHR instruction and side effects. ****************************************************************************/ u16 shr_word(u16 d, u8 s) { unsigned int cnt, res, cf; if (s < 16) { cnt = s % 16; if (cnt > 0) { cf = d & (1 << (cnt - 1)); res = d >> cnt; CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = d; } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); } return (u16) res; } /**************************************************************************** REMARKS: Implements the SHR instruction and side effects. ****************************************************************************/ u32 shr_long(u32 d, u8 s) { unsigned int cnt, res, cf; if (s < 32) { cnt = s % 32; if (cnt > 0) { cf = d & (1 << (cnt - 1)); res = d >> cnt; CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = d; } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); } return res; } /**************************************************************************** REMARKS: Implements the SAR instruction and side effects. ****************************************************************************/ u8 sar_byte(u8 d, u8 s) { unsigned int cnt, res, cf, mask, sf; res = d; sf = d & 0x80; cnt = s % 8; if (cnt > 0 && cnt < 8) { mask = (1 << (8 - cnt)) - 1; cf = d & (1 << (cnt - 1)); res = (d >> cnt) & mask; CONDITIONAL_SET_FLAG(cf, F_CF); if (sf) { res |= ~mask; } CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); } else if (cnt >= 8) { if (sf) { res = 0xff; SET_FLAG(F_CF); CLEAR_FLAG(F_ZF); SET_FLAG(F_SF); SET_FLAG(F_PF); } else { res = 0; CLEAR_FLAG(F_CF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); } } return (u8) res; } /**************************************************************************** REMARKS: Implements the SAR instruction and side effects. ****************************************************************************/ u16 sar_word(u16 d, u8 s) { unsigned int cnt, res, cf, mask, sf; sf = d & 0x8000; cnt = s % 16; res = d; if (cnt > 0 && cnt < 16) { mask = (1 << (16 - cnt)) - 1; cf = d & (1 << (cnt - 1)); res = (d >> cnt) & mask; CONDITIONAL_SET_FLAG(cf, F_CF); if (sf) { res |= ~mask; } CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else if (cnt >= 16) { if (sf) { res = 0xffff; SET_FLAG(F_CF); CLEAR_FLAG(F_ZF); SET_FLAG(F_SF); SET_FLAG(F_PF); } else { res = 0; CLEAR_FLAG(F_CF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); } } return (u16) res; } /**************************************************************************** REMARKS: Implements the SAR instruction and side effects. ****************************************************************************/ u32 sar_long(u32 d, u8 s) { u32 cnt, res, cf, mask, sf; sf = d & 0x80000000; cnt = s % 32; res = d; if (cnt > 0 && cnt < 32) { mask = (1 << (32 - cnt)) - 1; cf = d & (1 << (cnt - 1)); res = (d >> cnt) & mask; CONDITIONAL_SET_FLAG(cf, F_CF); if (sf) { res |= ~mask; } CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else if (cnt >= 32) { if (sf) { res = 0xffffffff; SET_FLAG(F_CF); CLEAR_FLAG(F_ZF); SET_FLAG(F_SF); SET_FLAG(F_PF); } else { res = 0; CLEAR_FLAG(F_CF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); } } return res; } /**************************************************************************** REMARKS: Implements the SHLD instruction and side effects. ****************************************************************************/ u16 shld_word(u16 d, u16 fill, u8 s) { unsigned int cnt, res, cf; if (s < 16) { cnt = s % 16; if (cnt > 0) { res = (d << cnt) | (fill >> (16 - cnt)); cf = d & (1 << (16 - cnt)); CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = d; } if (cnt == 1) { CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^ (ACCESS_FLAG(F_CF) != 0)), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } return (u16) res; } /**************************************************************************** REMARKS: Implements the SHLD instruction and side effects. ****************************************************************************/ u32 shld_long(u32 d, u32 fill, u8 s) { unsigned int cnt, res, cf; if (s < 32) { cnt = s % 32; if (cnt > 0) { res = (d << cnt) | (fill >> (32 - cnt)); cf = d & (1 << (32 - cnt)); CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = d; } if (cnt == 1) { CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^ (ACCESS_FLAG(F_CF) != 0)), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } return res; } /**************************************************************************** REMARKS: Implements the SHRD instruction and side effects. ****************************************************************************/ u16 shrd_word(u16 d, u16 fill, u8 s) { unsigned int cnt, res, cf; if (s < 16) { cnt = s % 16; if (cnt > 0) { cf = d & (1 << (cnt - 1)); res = (d >> cnt) | (fill << (16 - cnt)); CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = d; } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); } return (u16) res; } /**************************************************************************** REMARKS: Implements the SHRD instruction and side effects. ****************************************************************************/ u32 shrd_long(u32 d, u32 fill, u8 s) { unsigned int cnt, res, cf; if (s < 32) { cnt = s % 32; if (cnt > 0) { cf = d & (1 << (cnt - 1)); res = (d >> cnt) | (fill << (32 - cnt)); CONDITIONAL_SET_FLAG(cf, F_CF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = d; } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF); } else { CLEAR_FLAG(F_OF); } } else { res = 0; CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); } return res; } /**************************************************************************** REMARKS: Implements the SBB instruction and side effects. ****************************************************************************/ u8 sbb_byte(u8 d, u8 s) { register u32 res; /* all operands in native machine order */ register u32 bc; if (ACCESS_FLAG(F_CF)) res = d - s - 1; else res = d - s; CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return (u8) res; } /**************************************************************************** REMARKS: Implements the SBB instruction and side effects. ****************************************************************************/ u16 sbb_word(u16 d, u16 s) { register u32 res; /* all operands in native machine order */ register u32 bc; if (ACCESS_FLAG(F_CF)) res = d - s - 1; else res = d - s; CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return (u16) res; } /**************************************************************************** REMARKS: Implements the SBB instruction and side effects. ****************************************************************************/ u32 sbb_long(u32 d, u32 s) { register u32 res; /* all operands in native machine order */ register u32 bc; if (ACCESS_FLAG(F_CF)) res = d - s - 1; else res = d - s; CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the SUB instruction and side effects. ****************************************************************************/ u8 sub_byte(u8 d, u8 s) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return (u8) res; } /**************************************************************************** REMARKS: Implements the SUB instruction and side effects. ****************************************************************************/ u16 sub_word(u16 d, u16 s) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return (u16) res; } /**************************************************************************** REMARKS: Implements the SUB instruction and side effects. ****************************************************************************/ u32 sub_long(u32 d, u32 s) { register u32 res; /* all operands in native machine order */ register u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); return res; } /**************************************************************************** REMARKS: Implements the TEST instruction and side effects. ****************************************************************************/ void test_byte(u8 d, u8 s) { register u32 res; /* all operands in native machine order */ res = d & s; CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* AF == dont care */ CLEAR_FLAG(F_CF); } /**************************************************************************** REMARKS: Implements the TEST instruction and side effects. ****************************************************************************/ void test_word(u16 d, u16 s) { register u32 res; /* all operands in native machine order */ res = d & s; CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* AF == dont care */ CLEAR_FLAG(F_CF); } /**************************************************************************** REMARKS: Implements the TEST instruction and side effects. ****************************************************************************/ void test_long(u32 d, u32 s) { register u32 res; /* all operands in native machine order */ res = d & s; CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* AF == dont care */ CLEAR_FLAG(F_CF); } /**************************************************************************** REMARKS: Implements the XOR instruction and side effects. ****************************************************************************/ u8 xor_byte(u8 d, u8 s) { register u8 res; /* all operands in native machine order */ res = d ^ s; CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res), F_PF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); return res; } /**************************************************************************** REMARKS: Implements the XOR instruction and side effects. ****************************************************************************/ u16 xor_word(u16 d, u16 s) { register u16 res; /* all operands in native machine order */ res = d ^ s; CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); return res; } /**************************************************************************** REMARKS: Implements the XOR instruction and side effects. ****************************************************************************/ u32 xor_long(u32 d, u32 s) { register u32 res; /* all operands in native machine order */ res = d ^ s; CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); return res; } /**************************************************************************** REMARKS: Implements the IMUL instruction and side effects. ****************************************************************************/ void imul_byte(u8 s) { s16 res = (s16) ((s8) M.x86.R_AL * (s8) s); M.x86.R_AX = res; if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) || ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } } /**************************************************************************** REMARKS: Implements the IMUL instruction and side effects. ****************************************************************************/ void imul_word(u16 s) { s32 res = (s16) M.x86.R_AX * (s16) s; M.x86.R_AX = (u16) res; M.x86.R_DX = (u16) (res >> 16); if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) || ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } } /**************************************************************************** REMARKS: Implements the IMUL instruction and side effects. ****************************************************************************/ void imul_long_direct(u32 * res_lo, u32 * res_hi, u32 d, u32 s) { #ifdef __HAS_LONG_LONG__ s64 res = (s64) (s32) d * (s32) s; *res_lo = (u32) res; *res_hi = (u32) (res >> 32); #else u32 d_lo, d_hi, d_sign; u32 s_lo, s_hi, s_sign; u32 rlo_lo, rlo_hi, rhi_lo; if ((d_sign = d & 0x80000000) != 0) d = -d; d_lo = d & 0xFFFF; d_hi = d >> 16; if ((s_sign = s & 0x80000000) != 0) s = -s; s_lo = s & 0xFFFF; s_hi = s >> 16; rlo_lo = d_lo * s_lo; rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16); rhi_lo = d_hi * s_hi + (rlo_hi >> 16); *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF); *res_hi = rhi_lo; if (d_sign != s_sign) { d = ~*res_lo; s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16); *res_lo = ~*res_lo + 1; *res_hi = ~*res_hi + (s >> 16); } #endif } /**************************************************************************** REMARKS: Implements the IMUL instruction and side effects. ****************************************************************************/ void imul_long(u32 s) { imul_long_direct(&M.x86.R_EAX, &M.x86.R_EDX, M.x86.R_EAX, s); if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) || ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } } /**************************************************************************** REMARKS: Implements the MUL instruction and side effects. ****************************************************************************/ void mul_byte(u8 s) { u16 res = (u16) (M.x86.R_AL * s); M.x86.R_AX = res; if (M.x86.R_AH == 0) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } } /**************************************************************************** REMARKS: Implements the MUL instruction and side effects. ****************************************************************************/ void mul_word(u16 s) { u32 res = M.x86.R_AX * s; M.x86.R_AX = (u16) res; M.x86.R_DX = (u16) (res >> 16); if (M.x86.R_DX == 0) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } } /**************************************************************************** REMARKS: Implements the MUL instruction and side effects. ****************************************************************************/ void mul_long(u32 s) { #ifdef __HAS_LONG_LONG__ u64 res = (u64) M.x86.R_EAX * s; M.x86.R_EAX = (u32) res; M.x86.R_EDX = (u32) (res >> 32); #else u32 a, a_lo, a_hi; u32 s_lo, s_hi; u32 rlo_lo, rlo_hi, rhi_lo; a = M.x86.R_EAX; a_lo = a & 0xFFFF; a_hi = a >> 16; s_lo = s & 0xFFFF; s_hi = s >> 16; rlo_lo = a_lo * s_lo; rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16); rhi_lo = a_hi * s_hi + (rlo_hi >> 16); M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF); M.x86.R_EDX = rhi_lo; #endif if (M.x86.R_EDX == 0) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } } /**************************************************************************** REMARKS: Implements the IDIV instruction and side effects. ****************************************************************************/ void idiv_byte(u8 s) { s32 dvd, div, mod; dvd = (s16) M.x86.R_AX; if (s == 0) { x86emu_intr_raise(0); return; } div = dvd / (s8) s; mod = dvd % (s8) s; if (abs(div) > 0x7f) { x86emu_intr_raise(0); return; } M.x86.R_AL = (s8) div; M.x86.R_AH = (s8) mod; } /**************************************************************************** REMARKS: Implements the IDIV instruction and side effects. ****************************************************************************/ void idiv_word(u16 s) { s32 dvd, div, mod; dvd = (((s32) M.x86.R_DX) << 16) | M.x86.R_AX; if (s == 0) { x86emu_intr_raise(0); return; } div = dvd / (s16) s; mod = dvd % (s16) s; if (abs(div) > 0x7fff) { x86emu_intr_raise(0); return; } CLEAR_FLAG(F_CF); CLEAR_FLAG(F_SF); CONDITIONAL_SET_FLAG(div == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); M.x86.R_AX = (u16) div; M.x86.R_DX = (u16) mod; } /**************************************************************************** REMARKS: Implements the IDIV instruction and side effects. ****************************************************************************/ void idiv_long(u32 s) { #ifdef __HAS_LONG_LONG__ s64 dvd, div, mod; dvd = (((s64) M.x86.R_EDX) << 32) | M.x86.R_EAX; if (s == 0) { x86emu_intr_raise(0); return; } div = dvd / (s32) s; mod = dvd % (s32) s; if (abs(div) > 0x7fffffff) { x86emu_intr_raise(0); return; } #else s32 div = 0, mod; s32 h_dvd = M.x86.R_EDX; u32 l_dvd = M.x86.R_EAX; u32 abs_s = s & 0x7FFFFFFF; u32 abs_h_dvd = h_dvd & 0x7FFFFFFF; u32 h_s = abs_s >> 1; u32 l_s = abs_s << 31; int counter = 31; int carry; if (s == 0) { x86emu_intr_raise(0); return; } do { div <<= 1; carry = (l_dvd >= l_s) ? 0 : 1; if (abs_h_dvd < (h_s + carry)) { h_s >>= 1; l_s = abs_s << (--counter); continue; } else { abs_h_dvd -= (h_s + carry); l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1) : (l_dvd - l_s); h_s >>= 1; l_s = abs_s << (--counter); div |= 1; continue; } } while (counter > -1); /* overflow */ if (abs_h_dvd || (l_dvd > abs_s)) { x86emu_intr_raise(0); return; } /* sign */ div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000)); mod = l_dvd; #endif CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF); SET_FLAG(F_ZF); CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); M.x86.R_EAX = (u32) div; M.x86.R_EDX = (u32) mod; } /**************************************************************************** REMARKS: Implements the DIV instruction and side effects. ****************************************************************************/ void div_byte(u8 s) { u32 dvd, div, mod; dvd = M.x86.R_AX; if (s == 0) { x86emu_intr_raise(0); return; } div = dvd / (u8) s; mod = dvd % (u8) s; if (abs(div) > 0xff) { x86emu_intr_raise(0); return; } M.x86.R_AL = (u8) div; M.x86.R_AH = (u8) mod; } /**************************************************************************** REMARKS: Implements the DIV instruction and side effects. ****************************************************************************/ void div_word(u16 s) { u32 dvd, div, mod; dvd = (((u32) M.x86.R_DX) << 16) | M.x86.R_AX; if (s == 0) { x86emu_intr_raise(0); return; } div = dvd / (u16) s; mod = dvd % (u16) s; if (abs(div) > 0xffff) { x86emu_intr_raise(0); return; } CLEAR_FLAG(F_CF); CLEAR_FLAG(F_SF); CONDITIONAL_SET_FLAG(div == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); M.x86.R_AX = (u16) div; M.x86.R_DX = (u16) mod; } /**************************************************************************** REMARKS: Implements the DIV instruction and side effects. ****************************************************************************/ void div_long(u32 s) { #ifdef __HAS_LONG_LONG__ u64 dvd, div, mod; dvd = (((u64) M.x86.R_EDX) << 32) | M.x86.R_EAX; if (s == 0) { x86emu_intr_raise(0); return; } div = dvd / (u32) s; mod = dvd % (u32) s; if (abs(div) > 0xffffffff) { x86emu_intr_raise(0); return; } #else s32 div = 0, mod; s32 h_dvd = M.x86.R_EDX; u32 l_dvd = M.x86.R_EAX; u32 h_s = s; u32 l_s = 0; int counter = 32; int carry; if (s == 0) { x86emu_intr_raise(0); return; } do { div <<= 1; carry = (l_dvd >= l_s) ? 0 : 1; if (h_dvd < (h_s + carry)) { h_s >>= 1; l_s = s << (--counter); continue; } else { h_dvd -= (h_s + carry); l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1) : (l_dvd - l_s); h_s >>= 1; l_s = s << (--counter); div |= 1; continue; } } while (counter > -1); /* overflow */ if (h_dvd || (l_dvd > s)) { x86emu_intr_raise(0); return; } mod = l_dvd; #endif CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF); SET_FLAG(F_ZF); CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); M.x86.R_EAX = (u32) div; M.x86.R_EDX = (u32) mod; } /**************************************************************************** REMARKS: Implements the IN string instruction and side effects. ****************************************************************************/ void ins(int size) { int inc = size; if (ACCESS_FLAG(F_DF)) { inc = -size; } if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* in until CX is ZERO. */ u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ? M.x86.R_ECX : M.x86.R_CX); switch (size) { case 1: while (count--) { store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, (*sys_inb) (M.x86.R_DX)); M.x86.R_DI += inc; } break; case 2: while (count--) { store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (*sys_inw) (M.x86.R_DX)); M.x86.R_DI += inc; } break; case 4: while (count--) { store_data_long_abs(M.x86.R_ES, M.x86.R_DI, (*sys_inl) (M.x86.R_DX)); M.x86.R_DI += inc; break; } } M.x86.R_CX = 0; if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ECX = 0; } M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } else { switch (size) { case 1: store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, (*sys_inb) (M.x86.R_DX)); break; case 2: store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (*sys_inw) (M.x86.R_DX)); break; case 4: store_data_long_abs(M.x86.R_ES, M.x86.R_DI, (*sys_inl) (M.x86.R_DX)); break; } M.x86.R_DI += inc; } } /**************************************************************************** REMARKS: Implements the OUT string instruction and side effects. ****************************************************************************/ void outs(int size) { int inc = size; if (ACCESS_FLAG(F_DF)) { inc = -size; } if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { /* dont care whether REPE or REPNE */ /* out until CX is ZERO. */ u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ? M.x86.R_ECX : M.x86.R_CX); switch (size) { case 1: while (count--) { (*sys_outb) (M.x86.R_DX, fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI)); M.x86.R_SI += inc; } break; case 2: while (count--) { (*sys_outw) (M.x86.R_DX, fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI)); M.x86.R_SI += inc; } break; case 4: while (count--) { (*sys_outl) (M.x86.R_DX, fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI)); M.x86.R_SI += inc; break; } } M.x86.R_CX = 0; if (M.x86.mode & SYSMODE_PREFIX_DATA) { M.x86.R_ECX = 0; } M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); } else { switch (size) { case 1: (*sys_outb) (M.x86.R_DX, fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI)); break; case 2: (*sys_outw) (M.x86.R_DX, fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI)); break; case 4: (*sys_outl) (M.x86.R_DX, fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI)); break; } M.x86.R_SI += inc; } } /**************************************************************************** PARAMETERS: addr - Address to fetch word from REMARKS: Fetches a word from emulator memory using an absolute address. ****************************************************************************/ u16 mem_access_word(int addr) { DB(if (CHECK_MEM_ACCESS()) x86emu_check_mem_access(addr);) return (*sys_rdw) (addr); } /**************************************************************************** REMARKS: Pushes a word onto the stack. NOTE: Do not inline this, as (*sys_wrX) is already inline! ****************************************************************************/ void push_word(u16 w) { DB(if (CHECK_SP_ACCESS()) x86emu_check_sp_access();) M.x86.R_SP -= 2; (*sys_wrw) (((u32) M.x86.R_SS << 4) + M.x86.R_SP, w); } /**************************************************************************** REMARKS: Pushes a long onto the stack. NOTE: Do not inline this, as (*sys_wrX) is already inline! ****************************************************************************/ void push_long(u32 w) { DB(if (CHECK_SP_ACCESS()) x86emu_check_sp_access();) M.x86.R_SP -= 4; (*sys_wrl) (((u32) M.x86.R_SS << 4) + M.x86.R_SP, w); } /**************************************************************************** REMARKS: Pops a word from the stack. NOTE: Do not inline this, as (*sys_rdX) is already inline! ****************************************************************************/ u16 pop_word(void) { register u16 res; DB(if (CHECK_SP_ACCESS()) x86emu_check_sp_access();) res = (*sys_rdw) (((u32) M.x86.R_SS << 4) + M.x86.R_SP); M.x86.R_SP += 2; return res; } /**************************************************************************** REMARKS: Pops a long from the stack. NOTE: Do not inline this, as (*sys_rdX) is already inline! ****************************************************************************/ u32 pop_long(void) { register u32 res; DB(if (CHECK_SP_ACCESS()) x86emu_check_sp_access();) res = (*sys_rdl) (((u32) M.x86.R_SS << 4) + M.x86.R_SP); M.x86.R_SP += 4; return res; } /**************************************************************************** REMARKS: CPUID takes EAX/ECX as inputs, writes EAX/EBX/ECX/EDX as output ****************************************************************************/ void cpuid(void) { u32 feature = M.x86.R_EAX; #ifdef X86EMU_HAS_HW_CPUID /* If the platform allows it, we will base our values on the real * results from the CPUID instruction. We limit support to the * first two features, and the results of those are sanitized. */ if (feature <= 1) hw_cpuid(&M.x86.R_EAX, &M.x86.R_EBX, &M.x86.R_ECX, &M.x86.R_EDX); #endif switch (feature) { case 0: /* Regardless if we have real data from the hardware, the emulator * will only support upto feature 1, which we set in register EAX. * Registers EBX:EDX:ECX contain a string identifying the CPU. */ M.x86.R_EAX = 1; #ifndef X86EMU_HAS_HW_CPUID /* EBX:EDX:ECX = "GenuineIntel" */ M.x86.R_EBX = 0x756e6547; M.x86.R_EDX = 0x49656e69; M.x86.R_ECX = 0x6c65746e; #endif break; case 1: #ifndef X86EMU_HAS_HW_CPUID /* If we don't have x86 compatible hardware, we return values from an * Intel 486dx4; which was one of the first processors to have CPUID. */ M.x86.R_EAX = 0x00000480; M.x86.R_EBX = 0x00000000; M.x86.R_ECX = 0x00000000; M.x86.R_EDX = 0x00000002; /* VME */ #else /* In the case that we have hardware CPUID instruction, we make sure * that the features reported are limited to TSC and VME. */ M.x86.R_EDX &= 0x00000012; #endif break; default: /* Finally, we don't support any additional features. Most CPUs * return all zeros when queried for invalid or unsupported feature * numbers. */ M.x86.R_EAX = 0; M.x86.R_EBX = 0; M.x86.R_ECX = 0; M.x86.R_EDX = 0; break; } } xorg-server-1.17.1/hw/xfree86/dri/0000775000175100017510000000000012466505445013567 500000000000000xorg-server-1.17.1/hw/xfree86/dri/Makefile.am0000664000175100017510000000120612160102336015521 00000000000000noinst_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 \ dristruct.h \ sarea.h \ xf86dri.c sdk_HEADERS = dri.h sarea.h dristruct.h xorg-server-1.17.1/hw/xfree86/dri/sarea.h0000664000175100017510000000544112456571574014764 00000000000000/** * \file sarea.h * SAREA definitions. * * \author Kevin E. Martin * \author Jens Owen * \author Rickard E. (Rik) Faith */ /* * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _SAREA_H_ #define _SAREA_H_ #include "xf86drm.h" /* SAREA area needs to be at least a page */ #if defined(__alpha__) #define SAREA_MAX 0x2000 #elif defined(__ia64__) #define SAREA_MAX 0x10000 /* 64kB */ #else /* Intel 830M driver needs at least 8k SAREA */ #define SAREA_MAX 0x2000 #endif #define SAREA_MAX_DRAWABLES 256 #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 /** * SAREA per drawable information. * * \sa _XF86DRISAREA. */ typedef struct _XF86DRISAREADrawable { unsigned int stamp; unsigned int flags; } XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr; /** * SAREA frame information. * * \sa _XF86DRISAREA. */ typedef struct _XF86DRISAREAFrame { unsigned int x; unsigned int y; unsigned int width; unsigned int height; unsigned int fullscreen; } XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr; /** * SAREA definition. */ typedef struct _XF86DRISAREA { /** first thing is always the DRM locking structure */ drmLock lock; /** \todo Use readers/writer lock for drawable_lock */ drmLock drawable_lock; XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES]; XF86DRISAREAFrameRec frame; drm_context_t dummy_context; } XF86DRISAREARec, *XF86DRISAREAPtr; typedef struct _XF86DRILSAREA { drmLock lock; drmLock otherLocks[31]; } XF86DRILSAREARec, *XF86DRILSAREAPtr; #endif xorg-server-1.17.1/hw/xfree86/dri/dri.c0000664000175100017510000022722412456571574014447 00000000000000/************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* * Authors: * Jens Owen * Rickard E. (Rik) Faith * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include #include #include #include #include #include #include #include #include "xf86drm.h" #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" #include "extinit.h" #include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" #include "windowstr.h" #include "servermd.h" #define _XF86DRI_SERVER_ #include #include "swaprep.h" #include "xf86str.h" #include "dri.h" #include "sarea.h" #include "dristruct.h" #include "mi.h" #include "mipointer.h" #include "xf86_OSproc.h" #include "inputstr.h" #include "xf86VGAarbiter.h" #include "xf86Extensions.h" static int DRIEntPrivIndex = -1; static DevPrivateKeyRec DRIScreenPrivKeyRec; #define DRIScreenPrivKey (&DRIScreenPrivKeyRec) static DevPrivateKeyRec DRIWindowPrivKeyRec; #define DRIWindowPrivKey (&DRIWindowPrivKeyRec) static unsigned long DRIGeneration = 0; static unsigned int DRIDrawableValidationStamp = 0; static RESTYPE DRIDrawablePrivResType; static RESTYPE DRIContextPrivResType; static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv); drmServerInfo DRIDRMServerInfo; /* Wrapper just like xf86DrvMsg, but without the verbosity level checking. This will make it easy to turn off some messages later, based on verbosity level. */ /* * Since we're already referencing things from the XFree86 common layer in * this file, we'd might as well just call xf86VDrvMsgVerb, and have * consistent message formatting. The verbosity of these messages can be * easily changed here. */ #define DRI_MSG_VERBOSITY 1 static void DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); static void DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) { va_list ap; va_start(ap, format); xf86VDrvMsgVerb(scrnIndex, type, DRI_MSG_VERBOSITY, format, ap); va_end(ap); } static void DRIOpenDRMCleanup(DRIEntPrivPtr pDRIEntPriv) { if (pDRIEntPriv->pLSAREA != NULL) { drmUnmap(pDRIEntPriv->pLSAREA, pDRIEntPriv->sAreaSize); pDRIEntPriv->pLSAREA = NULL; } if (pDRIEntPriv->hLSAREA != 0) { drmRmMap(pDRIEntPriv->drmFD, pDRIEntPriv->hLSAREA); } if (pDRIEntPriv->drmFD >= 0) { drmClose(pDRIEntPriv->drmFD); pDRIEntPriv->drmFD = 0; } } int DRIMasterFD(ScrnInfoPtr pScrn) { return DRI_ENT_PRIV(pScrn)->drmFD; } void * DRIMasterSareaPointer(ScrnInfoPtr pScrn) { return DRI_ENT_PRIV(pScrn)->pLSAREA; } drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn) { return DRI_ENT_PRIV(pScrn)->hLSAREA; } Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn, unsigned long sAreaSize, const char *busID, const char *drmDriverName) { drmSetVersion saveSv, sv; Bool drmWasAvailable; DRIEntPrivPtr pDRIEntPriv; DRIEntPrivRec tmp; drmVersionPtr drmlibv; int drmlibmajor, drmlibminor; const char *openBusID; int count; int err; if (DRIEntPrivIndex == -1) DRIEntPrivIndex = xf86AllocateEntityPrivateIndex(); pDRIEntPriv = DRI_ENT_PRIV(pScrn); if (pDRIEntPriv && pDRIEntPriv->drmFD != -1) return TRUE; drmWasAvailable = drmAvailable(); memset(&tmp, 0, sizeof(tmp)); /* Check the DRM lib version. */ drmlibmajor = 1; drmlibminor = 0; drmlibv = drmGetLibVersion(-1); if (drmlibv != NULL) { drmlibmajor = drmlibv->version_major; drmlibminor = drmlibv->version_minor; drmFreeVersion(drmlibv); } /* Check if the libdrm can handle falling back to loading based on name * if a busid string is passed. */ openBusID = (drmlibmajor == 1 && drmlibminor >= 2) ? busID : NULL; tmp.drmFD = -1; sv.drm_di_major = 1; sv.drm_di_minor = 1; sv.drm_dd_major = -1; saveSv = sv; count = 10; while (count--) { tmp.drmFD = drmOpen(drmDriverName, openBusID); if (tmp.drmFD < 0) { DRIDrvMsg(-1, X_ERROR, "[drm] drmOpen failed.\n"); goto out_err; } err = drmSetInterfaceVersion(tmp.drmFD, &sv); if (err != -EPERM) break; sv = saveSv; drmClose(tmp.drmFD); tmp.drmFD = -1; usleep(100000); } if (tmp.drmFD <= 0) { DRIDrvMsg(-1, X_ERROR, "[drm] DRM was busy with another master.\n"); goto out_err; } if (!drmWasAvailable) { DRIDrvMsg(-1, X_INFO, "[drm] loaded kernel module for \"%s\" driver.\n", drmDriverName); } if (err != 0) { sv.drm_di_major = 1; sv.drm_di_minor = 0; } DRIDrvMsg(-1, X_INFO, "[drm] DRM interface version %d.%d\n", sv.drm_di_major, sv.drm_di_minor); if (sv.drm_di_major == 1 && sv.drm_di_minor >= 1) err = 0; else err = drmSetBusid(tmp.drmFD, busID); if (err) { DRIDrvMsg(-1, X_ERROR, "[drm] Could not set DRM device bus ID.\n"); goto out_err; } /* * Create a lock-containing sarea. */ if (drmAddMap(tmp.drmFD, 0, sAreaSize, DRM_SHM, DRM_CONTAINS_LOCK, &tmp.hLSAREA) < 0) { DRIDrvMsg(-1, X_INFO, "[drm] Could not create SAREA for DRM lock.\n"); tmp.hLSAREA = 0; goto out_err; } if (drmMap(tmp.drmFD, tmp.hLSAREA, sAreaSize, (drmAddressPtr) (&tmp.pLSAREA)) < 0) { DRIDrvMsg(-1, X_INFO, "[drm] Mapping SAREA for DRM lock failed.\n"); tmp.pLSAREA = NULL; goto out_err; } memset(tmp.pLSAREA, 0, sAreaSize); /* * Reserved contexts are handled by the first opened screen. */ tmp.resOwner = NULL; if (!pDRIEntPriv) pDRIEntPriv = xnfcalloc(sizeof(*pDRIEntPriv), 1); if (!pDRIEntPriv) { DRIDrvMsg(-1, X_INFO, "[drm] Failed to allocate memory for " "DRM device.\n"); goto out_err; } *pDRIEntPriv = tmp; xf86GetEntityPrivate((pScrn)->entityList[0], DRIEntPrivIndex)->ptr = pDRIEntPriv; DRIDrvMsg(-1, X_INFO, "[drm] DRM open master succeeded.\n"); return TRUE; out_err: DRIOpenDRMCleanup(&tmp); return FALSE; } static void DRIClipNotifyAllDrawables(ScreenPtr pScreen); static void dri_crtc_notify(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIClipNotifyAllDrawables(pScreen); xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify); xf86_crtc_notify(pScreen); pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen, dri_crtc_notify); } Bool DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) { DRIScreenPrivPtr pDRIPriv; drm_context_t *reserved; int reserved_count; int i; DRIEntPrivPtr pDRIEntPriv; 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) { DRIDrvMsg(pScreen->myNum, X_WARNING, "Direct rendering has been disabled.\n"); return FALSE; } if (!xf86VGAarbiterAllowDRI(pScreen)) { DRIDrvMsg(pScreen->myNum, X_WARNING, "Direct rendering is not supported when VGA arb is necessary for the device\n"); return FALSE; } #ifdef PANORAMIX /* * If Xinerama is on, don't allow DRI to initialise. It won't be usable * anyway. */ if (!noPanoramiXExtension) { DRIDrvMsg(pScreen->myNum, X_WARNING, "Direct rendering is not supported when Xinerama is enabled\n"); return FALSE; } #endif if (drm_server_inited == FALSE) { drmSetServerInfo(&DRIDRMServerInfo); drm_server_inited = TRUE; } if (!DRIOpenDRMMaster(pScrn, pDRIInfo->SAREASize, pDRIInfo->busIdString, pDRIInfo->drmDriverName)) return FALSE; pDRIEntPriv = DRI_ENT_PRIV(pScrn); if (DRIGeneration != serverGeneration) DRIGeneration = serverGeneration; if (!dixRegisterPrivateKey(&DRIScreenPrivKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&DRIWindowPrivKeyRec, PRIVATE_WINDOW, 0)) return FALSE; pDRIPriv = (DRIScreenPrivPtr) calloc(1, sizeof(DRIScreenPrivRec)); if (!pDRIPriv) { dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); return FALSE; } dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, pDRIPriv); pDRIPriv->drmFD = pDRIEntPriv->drmFD; pDRIPriv->directRenderingSupport = TRUE; pDRIPriv->pDriverInfo = pDRIInfo; pDRIPriv->nrWindows = 0; pDRIPriv->nrWindowsVisible = 0; pDRIPriv->fullscreen = NULL; pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx; pDRIPriv->createDummyCtxPriv = pDRIInfo->createDummyCtxPriv; pDRIPriv->grabbedDRILock = FALSE; pDRIPriv->drmSIGIOHandlerInstalled = FALSE; *pDRMFD = pDRIPriv->drmFD; if (pDRIEntPriv->sAreaGrabbed || pDRIInfo->allocSarea) { if (drmAddMap(pDRIPriv->drmFD, 0, pDRIPriv->pDriverInfo->SAREASize, DRM_SHM, 0, &pDRIPriv->hSAREA) < 0) { pDRIPriv->directRenderingSupport = FALSE; dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); drmClose(pDRIPriv->drmFD); DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] drmAddMap failed\n"); return FALSE; } DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] added %d byte SAREA at %p\n", (int) pDRIPriv->pDriverInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA); /* Backwards compat. */ if (drmMap(pDRIPriv->drmFD, pDRIPriv->hSAREA, pDRIPriv->pDriverInfo->SAREASize, (drmAddressPtr) (&pDRIPriv->pSAREA)) < 0) { pDRIPriv->directRenderingSupport = FALSE; dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); drmClose(pDRIPriv->drmFD); DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] drmMap failed\n"); return FALSE; } DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); } else { DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] Using the DRM lock " "SAREA also for drawables.\n"); pDRIPriv->hSAREA = pDRIEntPriv->hLSAREA; pDRIPriv->pSAREA = (XF86DRISAREAPtr) pDRIEntPriv->pLSAREA; pDRIEntPriv->sAreaGrabbed = TRUE; } pDRIPriv->hLSAREA = pDRIEntPriv->hLSAREA; pDRIPriv->pLSAREA = pDRIEntPriv->pLSAREA; if (!pDRIPriv->pDriverInfo->dontMapFrameBuffer) { if (drmAddMap(pDRIPriv->drmFD, (uintptr_t) pDRIPriv->pDriverInfo-> frameBufferPhysicalAddress, pDRIPriv->pDriverInfo->frameBufferSize, DRM_FRAME_BUFFER, 0, &pDRIPriv->pDriverInfo->hFrameBuffer) < 0) { pDRIPriv->directRenderingSupport = FALSE; dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize); drmClose(pDRIPriv->drmFD); DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] drmAddMap failed\n"); return FALSE; } DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n", (void *) (uintptr_t) pDRIPriv->pDriverInfo->hFrameBuffer); } else { DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer mapped by ddx driver\n"); } if (pDRIEntPriv->resOwner == NULL) { pDRIEntPriv->resOwner = pScreen; /* Add tags for reserved contexts */ if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, &reserved_count))) { int r; void *tag; for (r = 0; r < reserved_count; r++) { tag = DRICreateContextPrivFromHandle(pScreen, reserved[r], DRI_CONTEXT_RESERVED); drmAddContextTag(pDRIPriv->drmFD, reserved[r], tag); } drmFreeReservedContextList(reserved); DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] added %d reserved context%s for kernel\n", reserved_count, reserved_count > 1 ? "s" : ""); } } /* validate max drawable table entry set by driver */ if ((pDRIPriv->pDriverInfo->maxDrawableTableEntry <= 0) || (pDRIPriv->pDriverInfo->maxDrawableTableEntry > SAREA_MAX_DRAWABLES)) { DRIDrvMsg(pScreen->myNum, X_ERROR, "Invalid max drawable table size set by driver: %d\n", pDRIPriv->pDriverInfo->maxDrawableTableEntry); } /* Initialize drawable tables (screen private and SAREA) */ for (i = 0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { pDRIPriv->DRIDrawables[i] = NULL; pDRIPriv->pSAREA->drawableTable[i].stamp = 0; pDRIPriv->pSAREA->drawableTable[i].flags = 0; } pDRIPriv->pLockRefCount = &pDRIEntPriv->lockRefCount; pDRIPriv->pLockingContext = &pDRIEntPriv->lockingContext; if (!pDRIEntPriv->keepFDOpen) pDRIEntPriv->keepFDOpen = pDRIInfo->keepFDOpen; pDRIEntPriv->refCount++; /* Set up flags for DRICreateContextPriv */ switch (pDRIInfo->driverSwapMethod) { case DRI_KERNEL_SWAP: flags = DRI_CONTEXT_2DONLY; break; case DRI_HIDE_X_CONTEXT: flags = DRI_CONTEXT_PRESERVED; break; } if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, &pDRIPriv->myContext, flags))) { DRIDrvMsg(pScreen->myNum, X_ERROR, "failed to create server context\n"); return FALSE; } pDRIPriv->myContextPriv = pDRIContextPriv; DRIDrvMsg(pScreen->myNum, X_INFO, "X context handle = %p\n", (void *) (uintptr_t) pDRIPriv->myContext); /* Now that we have created the X server's context, we can grab the * hardware lock for the X server. */ DRILock(pScreen, 0); pDRIPriv->grabbedDRILock = TRUE; /* pointers so that we can prevent memory leaks later */ pDRIPriv->hiddenContextStore = NULL; pDRIPriv->partial3DContextStore = NULL; switch (pDRIInfo->driverSwapMethod) { case DRI_HIDE_X_CONTEXT: /* Server will handle 3D swaps, and hide 2D swaps from kernel. * Register server context as a preserved context. */ /* allocate memory for hidden context store */ pDRIPriv->hiddenContextStore = (void *) calloc(1, pDRIInfo->contextSize); if (!pDRIPriv->hiddenContextStore) { DRIDrvMsg(pScreen->myNum, X_ERROR, "failed to allocate hidden context\n"); DRIDestroyContextPriv(pDRIContextPriv); return FALSE; } /* allocate memory for partial 3D context store */ pDRIPriv->partial3DContextStore = (void *) calloc(1, pDRIInfo->contextSize); if (!pDRIPriv->partial3DContextStore) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] failed to allocate partial 3D context\n"); free(pDRIPriv->hiddenContextStore); DRIDestroyContextPriv(pDRIContextPriv); return FALSE; } /* save initial context store */ if (pDRIInfo->SwapContext) { (*pDRIInfo->SwapContext) (pScreen, DRI_NO_SYNC, DRI_2D_CONTEXT, pDRIPriv->hiddenContextStore, DRI_NO_CONTEXT, NULL); } /* fall through */ case DRI_SERVER_SWAP: /* For swap methods of DRI_SERVER_SWAP and DRI_HIDE_X_CONTEXT * setup signal handler for receiving swap requests from kernel */ if (!(pDRIPriv->drmSIGIOHandlerInstalled = drmInstallSIGIOHandler(pDRIPriv->drmFD, DRISwapContext))) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[drm] failed to setup DRM signal handler\n"); free(pDRIPriv->hiddenContextStore); free(pDRIPriv->partial3DContextStore); DRIDestroyContextPriv(pDRIContextPriv); return FALSE; } else { DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] installed DRM signal handler\n"); } default: break; } return TRUE; } Bool DRIFinishScreenInit(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; /* Wrap DRI support */ if (pDRIInfo->wrap.WindowExposures) { pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures; } pDRIPriv->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = DRIDestroyWindow; pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen, dri_crtc_notify); if (pDRIInfo->wrap.CopyWindow) { pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow; } if (pDRIInfo->wrap.ClipNotify) { pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify; } if (pDRIInfo->wrap.AdjustFrame) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame; } pDRIPriv->wrapped = TRUE; DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] installation complete\n"); return TRUE; } void DRICloseScreen(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIInfoPtr pDRIInfo; drm_context_t *reserved; int reserved_count; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DRIEntPrivPtr pDRIEntPriv = DRI_ENT_PRIV(pScrn); Bool closeMaster; if (pDRIPriv) { pDRIInfo = pDRIPriv->pDriverInfo; if (pDRIPriv->wrapped) { /* Unwrap DRI Functions */ if (pDRIInfo->wrap.WindowExposures) { pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; pDRIPriv->wrap.WindowExposures = NULL; } if (pDRIPriv->DestroyWindow) { pScreen->DestroyWindow = pDRIPriv->DestroyWindow; pDRIPriv->DestroyWindow = NULL; } xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify); if (pDRIInfo->wrap.CopyWindow) { pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; pDRIPriv->wrap.CopyWindow = NULL; } if (pDRIInfo->wrap.ClipNotify) { pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; pDRIPriv->wrap.ClipNotify = NULL; } if (pDRIInfo->wrap.AdjustFrame) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); scrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; pDRIPriv->wrap.AdjustFrame = NULL; } pDRIPriv->wrapped = FALSE; } if (pDRIPriv->drmSIGIOHandlerInstalled) { if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[drm] failed to remove DRM signal handler\n"); } } if (pDRIPriv->dummyCtxPriv && pDRIPriv->createDummyCtx) { DRIDestroyDummyContext(pScreen, pDRIPriv->createDummyCtxPriv); } if (!DRIDestroyContextPriv(pDRIPriv->myContextPriv)) { DRIDrvMsg(pScreen->myNum, X_ERROR, "failed to destroy server context\n"); } /* Remove tags for reserved contexts */ if (pDRIEntPriv->resOwner == pScreen) { pDRIEntPriv->resOwner = NULL; if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, &reserved_count))) { int i; for (i = 0; i < reserved_count; i++) { DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, reserved[i])); } drmFreeReservedContextList(reserved); DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] removed %d reserved context%s for kernel\n", reserved_count, reserved_count > 1 ? "s" : ""); } } /* Make sure signals get unblocked etc. */ drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext); pDRIPriv->pLockRefCount = NULL; closeMaster = (--pDRIEntPriv->refCount == 0) && !pDRIEntPriv->keepFDOpen; if (closeMaster || pDRIPriv->hSAREA != pDRIEntPriv->hLSAREA) { DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] unmapping %d bytes of SAREA %p at %p\n", (int) pDRIInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[drm] unable to unmap %d bytes" " of SAREA %p at %p\n", (int) pDRIInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); } } else { pDRIEntPriv->sAreaGrabbed = FALSE; } if (closeMaster || (pDRIEntPriv->drmFD != pDRIPriv->drmFD)) { drmClose(pDRIPriv->drmFD); if (pDRIEntPriv->drmFD == pDRIPriv->drmFD) { DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] Closed DRM master.\n"); pDRIEntPriv->drmFD = -1; } } free(pDRIPriv); dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL); } } #define DRM_MSG_VERBOSITY 3 static int dri_drm_debug_print(const char *format, va_list ap) _X_ATTRIBUTE_PRINTF(1,0); static int dri_drm_debug_print(const char *format, va_list ap) { xf86VDrvMsgVerb(-1, X_NONE, DRM_MSG_VERBOSITY, format, ap); return 0; } static void dri_drm_get_perms(gid_t * group, mode_t * mode) { *group = xf86ConfigDRI.group; *mode = xf86ConfigDRI.mode; } drmServerInfo DRIDRMServerInfo = { dri_drm_debug_print, xf86LoadKernelModule, dri_drm_get_perms, }; Bool DRIExtensionInit(void) { if (DRIGeneration != serverGeneration) { return FALSE; } DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete, "DRIDrawable"); DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete, "DRIContext"); if (!DRIDrawablePrivResType || !DRIContextPrivResType) return FALSE; RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL); return TRUE; } void DRIReset(void) { /* * This stub routine is called when the X Server recycles, resources * allocated by DRIExtensionInit need to be managed here. * * Currently this routine is a stub because all the interesting resources * are managed via the screen init process. */ } Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool *isCapable) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv) *isCapable = pDRIPriv->directRenderingSupport; else *isCapable = FALSE; return TRUE; } Bool DRIOpenConnection(ScreenPtr pScreen, drm_handle_t * hSAREA, char **busIdString) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); *hSAREA = pDRIPriv->hSAREA; *busIdString = pDRIPriv->pDriverInfo->busIdString; return TRUE; } Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE; return TRUE; } Bool DRICloseConnection(ScreenPtr pScreen) { return TRUE; } Bool DRIGetClientDriverName(ScreenPtr pScreen, int *ddxDriverMajorVersion, int *ddxDriverMinorVersion, int *ddxDriverPatchVersion, char **clientDriverName) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); *ddxDriverMajorVersion = pDRIPriv->pDriverInfo->ddxDriverMajorVersion; *ddxDriverMinorVersion = pDRIPriv->pDriverInfo->ddxDriverMinorVersion; *ddxDriverPatchVersion = pDRIPriv->pDriverInfo->ddxDriverPatchVersion; *clientDriverName = pDRIPriv->pDriverInfo->clientDriverName; return TRUE; } /* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper functions that layer on drmCreateContext and drmAddContextTag. DRICreateContextPriv always creates a kernel drm_context_t and then calls DRICreateContextPrivFromHandle to create a DRIContextPriv structure for DRI tracking. For the SIGIO handler, the drm_context_t is associated with DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv area and are passed to the kernel (if necessary). DRICreateContextPriv returns a pointer to newly allocated DRIContextPriv, and returns the kernel drm_context_t in pHWContext. */ DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen, drm_context_t * pHWContext, DRIContextFlags flags) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (drmCreateContext(pDRIPriv->drmFD, pHWContext)) { return NULL; } return DRICreateContextPrivFromHandle(pScreen, *pHWContext, flags); } DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen, drm_context_t hHWContext, DRIContextFlags flags) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIContextPrivPtr pDRIContextPriv; int contextPrivSize; contextPrivSize = sizeof(DRIContextPrivRec) + pDRIPriv->pDriverInfo->contextSize; if (!(pDRIContextPriv = calloc(1, contextPrivSize))) { return NULL; } pDRIContextPriv->pContextStore = (void *) (pDRIContextPriv + 1); drmAddContextTag(pDRIPriv->drmFD, hHWContext, pDRIContextPriv); pDRIContextPriv->hwContext = hHWContext; pDRIContextPriv->pScreen = pScreen; pDRIContextPriv->flags = flags; pDRIContextPriv->valid3D = FALSE; if (flags & DRI_CONTEXT_2DONLY) { if (drmSetContextFlags(pDRIPriv->drmFD, hHWContext, DRM_CONTEXT_2DONLY)) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[drm] failed to set 2D context flag\n"); DRIDestroyContextPriv(pDRIContextPriv); return NULL; } } if (flags & DRI_CONTEXT_PRESERVED) { if (drmSetContextFlags(pDRIPriv->drmFD, hHWContext, DRM_CONTEXT_PRESERVED)) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[drm] failed to set preserved flag\n"); DRIDestroyContextPriv(pDRIContextPriv); return NULL; } } return pDRIContextPriv; } Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv) { DRIScreenPrivPtr pDRIPriv; if (!pDRIContextPriv) return TRUE; pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); if (!(pDRIContextPriv->flags & DRI_CONTEXT_RESERVED)) { /* Don't delete reserved contexts from kernel area -- the kernel manages its reserved contexts itself. */ if (drmDestroyContext(pDRIPriv->drmFD, pDRIContextPriv->hwContext)) return FALSE; } /* Remove the tag last to prevent a race condition where the context has pending buffers. The context can't be re-used while in this thread, but buffers can be dispatched asynchronously. */ drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext); free(pDRIContextPriv); return TRUE; } static Bool DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIContextPrivPtr pDRIContextPriv; void *contextStore; if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, &pDRIPriv->pSAREA->dummy_context, 0))) { return FALSE; } contextStore = DRIGetContextStore(pDRIContextPriv); if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) { if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, NULL, pDRIPriv->pSAREA-> dummy_context, NULL, (DRIContextType) (long) contextStore)) { DRIDestroyContextPriv(pDRIContextPriv); return FALSE; } } pDRIPriv->dummyCtxPriv = pDRIContextPriv; return TRUE; } static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIContextPrivPtr pDRIContextPriv = pDRIPriv->dummyCtxPriv; void *contextStore; if (!pDRIContextPriv) return; if (pDRIPriv->pDriverInfo->DestroyContext && hasCtxPriv) { contextStore = DRIGetContextStore(pDRIContextPriv); pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, pDRIContextPriv->hwContext, (DRIContextType) (long) contextStore); } DRIDestroyContextPriv(pDRIPriv->dummyCtxPriv); pDRIPriv->dummyCtxPriv = NULL; } Bool DRICreateContext(ScreenPtr pScreen, VisualPtr visual, XID context, drm_context_t * pHWContext) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIContextPrivPtr pDRIContextPriv; void *contextStore; if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) { if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) { DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] Could not create dummy context\n"); return FALSE; } } if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) { return FALSE; } contextStore = DRIGetContextStore(pDRIContextPriv); if (pDRIPriv->pDriverInfo->CreateContext) { if (!((*pDRIPriv->pDriverInfo->CreateContext) (pScreen, NULL, *pHWContext, NULL, (DRIContextType) (long) contextStore))) { DRIDestroyContextPriv(pDRIContextPriv); return FALSE; } } /* track this in case the client dies before cleanup */ AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv); return TRUE; } Bool DRIDestroyContext(ScreenPtr pScreen, XID context) { FreeResourceByType(context, DRIContextPrivResType, FALSE); return TRUE; } /* DRIContextPrivDelete is called by the resource manager. */ Bool DRIContextPrivDelete(void *pResource, XID id) { DRIContextPrivPtr pDRIContextPriv = (DRIContextPrivPtr) pResource; DRIScreenPrivPtr pDRIPriv; void *contextStore; pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); if (pDRIPriv->pDriverInfo->DestroyContext) { contextStore = DRIGetContextStore(pDRIContextPriv); pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, pDRIContextPriv->hwContext, (DRIContextType) (long) contextStore); } return DRIDestroyContextPriv(pDRIContextPriv); } /* This walks the drawable timestamp array and invalidates all of them * in the case of transition from private to shared backbuffers. It's * not necessary for correctness, because DRIClipNotify gets called in * time to prevent any conflict, but the transition from * shared->private is sometimes missed if we don't do this. */ static void DRIClipNotifyAllDrawables(ScreenPtr pScreen) { int i; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); for (i = 0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++; } } static void DRITransitionToSharedBuffers(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; DRIClipNotifyAllDrawables(pScreen); if (pDRIInfo->TransitionSingleToMulti3D) pDRIInfo->TransitionSingleToMulti3D(pScreen); } static void DRITransitionToPrivateBuffers(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; DRIClipNotifyAllDrawables(pScreen); if (pDRIInfo->TransitionMultiToSingle3D) pDRIInfo->TransitionMultiToSingle3D(pScreen); } static void DRITransitionTo3d(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; DRIClipNotifyAllDrawables(pScreen); if (pDRIInfo->TransitionTo3d) pDRIInfo->TransitionTo3d(pScreen); } static void DRITransitionTo2d(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; DRIClipNotifyAllDrawables(pScreen); if (pDRIInfo->TransitionTo2d) pDRIInfo->TransitionTo2d(pScreen); } static int DRIDCNTreeTraversal(WindowPtr pWin, void *data) { DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); if (pDRIDrawablePriv) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (RegionNumRects(&pWin->clipList) > 0) { WindowPtr *pDRIWindows = (WindowPtr *) data; int i = 0; while (pDRIWindows[i]) i++; pDRIWindows[i] = pWin; pDRIPriv->nrWalked++; } if (pDRIPriv->nrWindows == pDRIPriv->nrWalked) return WT_STOPWALKING; } return WT_WALKCHILDREN; } static void DRIDriverClipNotify(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv->pDriverInfo->ClipNotify) { WindowPtr *pDRIWindows = calloc(sizeof(WindowPtr), pDRIPriv->nrWindows); DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; if (pDRIPriv->nrWindows > 0) { pDRIPriv->nrWalked = 0; TraverseTree(pScreen->root, DRIDCNTreeTraversal, (void *) pDRIWindows); } pDRIInfo->ClipNotify(pScreen, pDRIWindows, pDRIPriv->nrWindows); free(pDRIWindows); } } static void DRIIncreaseNumberVisible(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); switch (++pDRIPriv->nrWindowsVisible) { case 1: DRITransitionTo3d(pScreen); break; case 2: DRITransitionToSharedBuffers(pScreen); break; default: break; } DRIDriverClipNotify(pScreen); } static void DRIDecreaseNumberVisible(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); switch (--pDRIPriv->nrWindowsVisible) { case 0: DRITransitionTo2d(pScreen); break; case 1: DRITransitionToPrivateBuffers(pScreen); break; default: break; } DRIDriverClipNotify(pScreen); } Bool DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, drm_drawable_t * hHWDrawable) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIDrawablePrivPtr pDRIDrawablePriv; WindowPtr pWin; if (pDrawable->type == DRAWABLE_WINDOW) { pWin = (WindowPtr) pDrawable; if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { pDRIDrawablePriv->refCount++; if (!pDRIDrawablePriv->hwDrawable) { drmCreateDrawable(pDRIPriv->drmFD, &pDRIDrawablePriv->hwDrawable); } } else { /* allocate a DRI Window Private record */ if (!(pDRIDrawablePriv = malloc(sizeof(DRIDrawablePrivRec)))) { return FALSE; } /* Only create a drm_drawable_t once */ if (drmCreateDrawable(pDRIPriv->drmFD, &pDRIDrawablePriv->hwDrawable)) { free(pDRIDrawablePriv); return FALSE; } /* add it to the list of DRI drawables for this screen */ pDRIDrawablePriv->pScreen = pScreen; pDRIDrawablePriv->refCount = 1; pDRIDrawablePriv->drawableIndex = -1; pDRIDrawablePriv->nrects = RegionNumRects(&pWin->clipList); /* save private off of preallocated index */ dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, pDRIDrawablePriv); pDRIPriv->nrWindows++; if (pDRIDrawablePriv->nrects) DRIIncreaseNumberVisible(pScreen); } /* track this in case the client dies */ AddResource(FakeClientID(client->index), DRIDrawablePrivResType, (void *) (intptr_t) pDrawable->id); if (pDRIDrawablePriv->hwDrawable) { drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable, DRM_DRAWABLE_CLIPRECTS, RegionNumRects(&pWin->clipList), RegionRects(&pWin->clipList)); *hHWDrawable = pDRIDrawablePriv->hwDrawable; } } else if (pDrawable->type != DRAWABLE_PIXMAP) { /* PBuffer */ /* NOT_DONE */ return FALSE; } return TRUE; } static void DRIDrawablePrivDestroy(WindowPtr pWin) { DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); ScreenPtr pScreen; DRIScreenPrivPtr pDRIPriv; if (!pDRIDrawablePriv) return; pScreen = pWin->drawable.pScreen; pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIDrawablePriv->drawableIndex != -1) { /* bump stamp to force outstanding 3D requests to resync */ pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp = DRIDrawableValidationStamp++; /* release drawable table entry */ pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; } pDRIPriv->nrWindows--; if (pDRIDrawablePriv->nrects) DRIDecreaseNumberVisible(pScreen); drmDestroyDrawable(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable); free(pDRIDrawablePriv); dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, NULL); } static Bool DRIDestroyDrawableCB(void *value, XID id, void *data) { if (value == data) { /* This calls back DRIDrawablePrivDelete which frees private area */ FreeResourceByType(id, DRIDrawablePrivResType, FALSE); return TRUE; } return FALSE; } Bool DRIDestroyDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable) { if (pDrawable->type == DRAWABLE_WINDOW) { LookupClientResourceComplex(client, DRIDrawablePrivResType, DRIDestroyDrawableCB, (void *) (intptr_t) pDrawable->id); } else { /* pixmap (or for GLX 1.3, a PBuffer) */ /* NOT_DONE */ return FALSE; } return TRUE; } Bool DRIDrawablePrivDelete(void *pResource, XID id) { WindowPtr pWin; int rc; /* For DRIDrawablePrivResType, the XID is the client's fake ID. The * important XID is the value in pResource. */ id = (XID) (intptr_t) pResource; rc = dixLookupWindow(&pWin, id, serverClient, DixGetAttrAccess); if (rc == Success) { DRIDrawablePrivPtr pDRIDrwPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); if (!pDRIDrwPriv) return FALSE; if (--pDRIDrwPriv->refCount == 0) DRIDrawablePrivDestroy(pWin); return TRUE; } else { /* pixmap (or for GLX 1.3, a PBuffer) */ /* NOT_DONE */ return FALSE; } } Bool DRIGetDrawableInfo(ScreenPtr pScreen, DrawablePtr pDrawable, unsigned int *index, unsigned int *stamp, int *X, int *Y, int *W, int *H, int *numClipRects, drm_clip_rect_t ** pClipRects, int *backX, int *backY, int *numBackClipRects, drm_clip_rect_t ** pBackClipRects) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIDrawablePrivPtr pDRIDrawablePriv, pOldDrawPriv; WindowPtr pWin, pOldWin; int i; #if 0 printf("maxDrawableTableEntry = %d\n", pDRIPriv->pDriverInfo->maxDrawableTableEntry); #endif if (pDrawable->type == DRAWABLE_WINDOW) { pWin = (WindowPtr) pDrawable; if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { /* Manage drawable table */ if (pDRIDrawablePriv->drawableIndex == -1) { /* load SAREA table */ /* Search table for empty entry */ i = 0; while (i < pDRIPriv->pDriverInfo->maxDrawableTableEntry) { if (!(pDRIPriv->DRIDrawables[i])) { pDRIPriv->DRIDrawables[i] = pDrawable; pDRIDrawablePriv->drawableIndex = i; pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++; break; } i++; } /* Search table for oldest entry */ if (i == pDRIPriv->pDriverInfo->maxDrawableTableEntry) { unsigned int oldestStamp = ~0; int oldestIndex = 0; i = pDRIPriv->pDriverInfo->maxDrawableTableEntry; while (i--) { if (pDRIPriv->pSAREA->drawableTable[i].stamp < oldestStamp) { oldestIndex = i; oldestStamp = pDRIPriv->pSAREA->drawableTable[i].stamp; } } pDRIDrawablePriv->drawableIndex = oldestIndex; /* release oldest drawable table entry */ pOldWin = (WindowPtr) pDRIPriv->DRIDrawables[oldestIndex]; pOldDrawPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pOldWin); pOldDrawPriv->drawableIndex = -1; /* claim drawable table entry */ pDRIPriv->DRIDrawables[oldestIndex] = pDrawable; /* validate SAREA entry */ pDRIPriv->pSAREA->drawableTable[oldestIndex].stamp = DRIDrawableValidationStamp++; /* check for stamp wrap around */ if (oldestStamp > DRIDrawableValidationStamp) { /* walk SAREA table and invalidate all drawables */ for (i = 0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++; } } } /* If the driver wants to be notified when the index is * set for a drawable, let it know now. */ if (pDRIPriv->pDriverInfo->SetDrawableIndex) pDRIPriv->pDriverInfo->SetDrawableIndex(pWin, pDRIDrawablePriv-> drawableIndex); /* reinit drawable ID if window is visible */ if ((pWin->viewable) && (pDRIPriv->pDriverInfo->bufferRequests != DRI_NO_WINDOWS)) { (*pDRIPriv->pDriverInfo->InitBuffers) (pWin, &pWin->clipList, pDRIDrawablePriv-> drawableIndex); } } *index = pDRIDrawablePriv->drawableIndex; *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp; *X = (int) (pWin->drawable.x); *Y = (int) (pWin->drawable.y); *W = (int) (pWin->drawable.width); *H = (int) (pWin->drawable.height); *numClipRects = RegionNumRects(&pWin->clipList); *pClipRects = (drm_clip_rect_t *) RegionRects(&pWin->clipList); if (!*numClipRects && pDRIPriv->fullscreen) { /* use fake full-screen clip rect */ pDRIPriv->fullscreen_rect.x1 = *X; pDRIPriv->fullscreen_rect.y1 = *Y; pDRIPriv->fullscreen_rect.x2 = *X + *W; pDRIPriv->fullscreen_rect.y2 = *Y + *H; *numClipRects = 1; *pClipRects = &pDRIPriv->fullscreen_rect; } *backX = *X; *backY = *Y; if (pDRIPriv->nrWindowsVisible == 1 && *numClipRects) { /* Use a single cliprect. */ int x0 = *X; int y0 = *Y; int x1 = x0 + *W; int y1 = y0 + *H; if (x0 < 0) x0 = 0; if (y0 < 0) y0 = 0; if (x1 > pScreen->width) x1 = pScreen->width; if (y1 > pScreen->height) y1 = pScreen->height; if (y0 >= y1 || x0 >= x1) { *numBackClipRects = 0; *pBackClipRects = NULL; } else { pDRIPriv->private_buffer_rect.x1 = x0; pDRIPriv->private_buffer_rect.y1 = y0; pDRIPriv->private_buffer_rect.x2 = x1; pDRIPriv->private_buffer_rect.y2 = y1; *numBackClipRects = 1; *pBackClipRects = &(pDRIPriv->private_buffer_rect); } } else { /* Use the frontbuffer cliprects for back buffers. */ *numBackClipRects = 0; *pBackClipRects = 0; } } else { /* Not a DRIDrawable */ return FALSE; } } else { /* pixmap (or for GLX 1.3, a PBuffer) */ /* NOT_DONE */ return FALSE; } return TRUE; } Bool DRIGetDeviceInfo(ScreenPtr pScreen, drm_handle_t * hFrameBuffer, int *fbOrigin, int *fbSize, int *fbStride, int *devPrivateSize, void **pDevPrivate) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); *hFrameBuffer = pDRIPriv->pDriverInfo->hFrameBuffer; *fbOrigin = 0; *fbSize = pDRIPriv->pDriverInfo->frameBufferSize; *fbStride = pDRIPriv->pDriverInfo->frameBufferStride; *devPrivateSize = pDRIPriv->pDriverInfo->devPrivateSize; *pDevPrivate = pDRIPriv->pDriverInfo->devPrivate; return TRUE; } DRIInfoPtr DRICreateInfoRec(void) { DRIInfoPtr inforec = (DRIInfoPtr) calloc(1, sizeof(DRIInfoRec)); if (!inforec) return NULL; /* Initialize defaults */ inforec->busIdString = NULL; /* Wrapped function defaults */ inforec->wrap.WakeupHandler = DRIDoWakeupHandler; inforec->wrap.BlockHandler = DRIDoBlockHandler; inforec->wrap.WindowExposures = DRIWindowExposures; inforec->wrap.CopyWindow = DRICopyWindow; inforec->wrap.ClipNotify = DRIClipNotify; inforec->wrap.AdjustFrame = DRIAdjustFrame; inforec->TransitionTo2d = 0; inforec->TransitionTo3d = 0; inforec->SetDrawableIndex = 0; return inforec; } void DRIDestroyInfoRec(DRIInfoPtr DRIInfo) { free(DRIInfo->busIdString); free((char *) DRIInfo); } void DRIWakeupHandler(void *wakeupData, int result, void *pReadmask) { int i; for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler) (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, result, pReadmask); } } void DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) { int i; for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler) (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, pTimeout, pReadmask); } } void DRIDoWakeupHandler(ScreenPtr pScreen, unsigned long result, void *pReadmask) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRILock(pScreen, 0); if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { /* hide X context by swapping 2D component here */ (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, DRI_3D_SYNC, DRI_2D_CONTEXT, pDRIPriv->partial3DContextStore, DRI_2D_CONTEXT, pDRIPriv->hiddenContextStore); } } void DRIDoBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { /* hide X context by swapping 2D component here */ (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, DRI_2D_SYNC, DRI_NO_CONTEXT, NULL, DRI_2D_CONTEXT, pDRIPriv->partial3DContextStore); } if (pDRIPriv->windowsTouched) DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); pDRIPriv->windowsTouched = FALSE; DRIUnlock(pScreen); } void DRISwapContext(int drmFD, void *oldctx, void *newctx) { DRIContextPrivPtr oldContext = (DRIContextPrivPtr) oldctx; DRIContextPrivPtr newContext = (DRIContextPrivPtr) newctx; ScreenPtr pScreen = newContext->pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); void *oldContextStore = NULL; DRIContextType oldContextType; void *newContextStore = NULL; DRIContextType newContextType; DRISyncType syncType; #ifdef DEBUG static int count = 0; if (!newContext) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] Context Switch Error: oldContext=%x, newContext=%x\n", oldContext, newContext); return; } /* usefull for debugging, just print out after n context switches */ if (!count || !(count % 1)) { DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] Context switch %5d from %p/0x%08x (%d)\n", count, oldContext, oldContext ? oldContext->flags : 0, oldContext ? oldContext->hwContext : -1); DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] Context switch %5d to %p/0x%08x (%d)\n", count, newContext, newContext ? newContext->flags : 0, newContext ? newContext->hwContext : -1); } ++count; #endif if (!pDRIPriv->pDriverInfo->SwapContext) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] DDX driver missing context swap call back\n"); return; } if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { /* only 3D contexts are swapped in this case */ if (oldContext) { oldContextStore = DRIGetContextStore(oldContext); oldContext->valid3D = TRUE; oldContextType = DRI_3D_CONTEXT; } else { oldContextType = DRI_NO_CONTEXT; } newContextStore = DRIGetContextStore(newContext); if ((newContext->valid3D) && (newContext->hwContext != pDRIPriv->myContext)) { newContextType = DRI_3D_CONTEXT; } else { newContextType = DRI_2D_CONTEXT; } syncType = DRI_3D_SYNC; } else { /* default: driverSwapMethod == DRI_SERVER_SWAP */ /* optimize 2D context swaps */ if (newContext->flags & DRI_CONTEXT_2DONLY) { /* go from 3D context to 2D context and only save 2D * subset of 3D state */ oldContextStore = DRIGetContextStore(oldContext); oldContextType = DRI_2D_CONTEXT; newContextStore = DRIGetContextStore(newContext); newContextType = DRI_2D_CONTEXT; syncType = DRI_3D_SYNC; pDRIPriv->lastPartial3DContext = oldContext; } else if (oldContext->flags & DRI_CONTEXT_2DONLY) { if (pDRIPriv->lastPartial3DContext == newContext) { /* go from 2D context back to previous 3D context and * only restore 2D subset of previous 3D state */ oldContextStore = DRIGetContextStore(oldContext); oldContextType = DRI_2D_CONTEXT; newContextStore = DRIGetContextStore(newContext); newContextType = DRI_2D_CONTEXT; syncType = DRI_2D_SYNC; } else { /* go from 2D context to a different 3D context */ /* call DDX driver to do partial restore */ oldContextStore = DRIGetContextStore(oldContext); newContextStore = DRIGetContextStore(pDRIPriv->lastPartial3DContext); (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, DRI_2D_SYNC, DRI_2D_CONTEXT, oldContextStore, DRI_2D_CONTEXT, newContextStore); /* now setup for a complete 3D swap */ oldContextStore = newContextStore; oldContext->valid3D = TRUE; oldContextType = DRI_3D_CONTEXT; newContextStore = DRIGetContextStore(newContext); if ((newContext->valid3D) && (newContext->hwContext != pDRIPriv->myContext)) { newContextType = DRI_3D_CONTEXT; } else { newContextType = DRI_2D_CONTEXT; } syncType = DRI_NO_SYNC; } } else { /* now setup for a complete 3D swap */ oldContextStore = newContextStore; oldContext->valid3D = TRUE; oldContextType = DRI_3D_CONTEXT; newContextStore = DRIGetContextStore(newContext); if ((newContext->valid3D) && (newContext->hwContext != pDRIPriv->myContext)) { newContextType = DRI_3D_CONTEXT; } else { newContextType = DRI_2D_CONTEXT; } syncType = DRI_3D_SYNC; } } /* call DDX driver to perform the swap */ (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, syncType, oldContextType, oldContextStore, newContextType, newContextStore); } void * DRIGetContextStore(DRIContextPrivPtr context) { return ((void *) context->pContextStore); } void DRIWindowExposures(WindowPtr pWin, RegionPtr prgn) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); if (pDRIDrawablePriv) { (*pDRIPriv->pDriverInfo->InitBuffers) (pWin, prgn, pDRIDrawablePriv->drawableIndex); } /* call lower wrapped functions */ if (pDRIPriv && pDRIPriv->wrap.WindowExposures) { /* unwrap */ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; /* call lower layers */ (*pScreen->WindowExposures) (pWin, prgn); /* rewrap */ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; pScreen->WindowExposures = DRIWindowExposures; } } static int DRITreeTraversal(WindowPtr pWin, void *data) { DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); if (pDRIDrawablePriv) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (RegionNumRects(&(pWin->clipList)) > 0) { RegionPtr reg = (RegionPtr) data; RegionUnion(reg, reg, &(pWin->clipList)); pDRIPriv->nrWalked++; } if (pDRIPriv->nrWindows == pDRIPriv->nrWalked) return WT_STOPWALKING; } return WT_WALKCHILDREN; } Bool DRIDestroyWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); Bool retval = TRUE; DRIDrawablePrivDestroy(pWin); /* call lower wrapped functions */ if (pDRIPriv->DestroyWindow) { /* unwrap */ pScreen->DestroyWindow = pDRIPriv->DestroyWindow; /* call lower layers */ retval = (*pScreen->DestroyWindow) (pWin); /* rewrap */ pDRIPriv->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = DRIDestroyWindow; } return retval; } void DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (!pDRIPriv) return; if (pDRIPriv->nrWindowsVisible > 0) { RegionRec reg; RegionNull(®); pDRIPriv->nrWalked = 0; TraverseTree(pWin, DRITreeTraversal, (void *) (®)); if (RegionNotEmpty(®)) { RegionTranslate(®, ptOldOrg.x - pWin->drawable.x, ptOldOrg.y - pWin->drawable.y); RegionIntersect(®, ®, prgnSrc); /* The MoveBuffers interface is not ideal */ (*pDRIPriv->pDriverInfo->MoveBuffers) (pWin, ptOldOrg, ®, pDRIPriv->pDriverInfo-> ddxDrawableTableEntry); } RegionUninit(®); } /* call lower wrapped functions */ if (pDRIPriv->wrap.CopyWindow) { /* unwrap */ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; /* call lower layers */ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); /* rewrap */ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = DRICopyWindow; } } static void DRIGetSecs(long *secs, long *usecs) { struct timeval tv; gettimeofday(&tv, NULL); *secs = tv.tv_sec; *usecs = tv.tv_usec; } static unsigned long DRIComputeMilliSeconds(unsigned long s_secs, unsigned long s_usecs, unsigned long f_secs, unsigned long f_usecs) { if (f_usecs < s_usecs) { --f_secs; f_usecs += 1000000; } return (f_secs - s_secs) * 1000 + (f_usecs - s_usecs) / 1000; } static void DRISpinLockTimeout(drmLock * lock, int val, unsigned long timeout /* in mS */ ) { int count = 10000; #if !defined(__alpha__) && !defined(__powerpc__) char ret; #else int ret; #endif long s_secs, s_usecs; long f_secs, f_usecs; long msecs; long prev = 0; DRIGetSecs(&s_secs, &s_usecs); do { DRM_SPINLOCK_COUNT(lock, val, count, ret); if (!ret) return; /* Got lock */ DRIGetSecs(&f_secs, &f_usecs); msecs = DRIComputeMilliSeconds(s_secs, s_usecs, f_secs, f_usecs); if (msecs - prev < 250) count *= 2; /* Not more than 0.5S */ } while (msecs < timeout); /* Didn't get lock, so take it. The worst that can happen is that there is some garbage written to the wrong part of the framebuffer that a refresh will repair. That's undesirable, but better than locking the server. This should be a very rare event. */ DRM_SPINLOCK_TAKE(lock, val); } static void DRILockTree(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (!pDRIPriv) return; /* Restore the last known 3D context if the X context is hidden */ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, DRI_2D_SYNC, DRI_NO_CONTEXT, NULL, DRI_2D_CONTEXT, pDRIPriv->partial3DContextStore); } /* Call kernel to release lock */ DRIUnlock(pScreen); /* Grab drawable spin lock: a time out between 10 and 30 seconds is appropriate, since this should never time out except in the case of client death while the lock is being held. The timeout must be greater than any reasonable rendering time. */ DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs */ /* Call kernel flush outstanding buffers and relock */ DRILock(pScreen, DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH_ALL); /* Switch back to our 2D context if the X context is hidden */ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { /* hide X context by swapping 2D component here */ (*pDRIPriv->pDriverInfo->SwapContext) (pScreen, DRI_3D_SYNC, DRI_2D_CONTEXT, pDRIPriv->partial3DContextStore, DRI_2D_CONTEXT, pDRIPriv->hiddenContextStore); } } void DRIClipNotify(WindowPtr pWin, int dx, int dy) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIDrawablePrivPtr pDRIDrawablePriv; if (!pDRIPriv) return; if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { int nrects = RegionNumRects(&pWin->clipList); if (!pDRIPriv->windowsTouched) { DRILockTree(pScreen); pDRIPriv->windowsTouched = TRUE; } if (nrects && !pDRIDrawablePriv->nrects) DRIIncreaseNumberVisible(pScreen); else if (!nrects && pDRIDrawablePriv->nrects) DRIDecreaseNumberVisible(pScreen); else DRIDriverClipNotify(pScreen); pDRIDrawablePriv->nrects = nrects; pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp = DRIDrawableValidationStamp++; drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable, DRM_DRAWABLE_CLIPRECTS, nrects, RegionRects(&pWin->clipList)); } /* call lower wrapped functions */ if (pDRIPriv->wrap.ClipNotify) { /* unwrap */ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; /* call lower layers */ (*pScreen->ClipNotify) (pWin, dx, dy); /* rewrap */ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = DRIClipNotify; } } CARD32 DRIGetDrawableIndex(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); CARD32 index; if (pDRIDrawablePriv) { index = pDRIDrawablePriv->drawableIndex; } else { index = pDRIPriv->pDriverInfo->ddxDrawableTableEntry; } return index; } unsigned int DRIGetDrawableStamp(ScreenPtr pScreen, CARD32 drawable_index) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); return pDRIPriv->pSAREA->drawableTable[drawable_index].stamp; } void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); ErrorF("%s: %d\n", msg, pDRIPriv->pSAREA->drawable_lock.lock); } void DRILock(ScreenPtr pScreen, int flags) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (!pDRIPriv || !pDRIPriv->pLockRefCount) return; if (!*pDRIPriv->pLockRefCount) { DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext, flags); *pDRIPriv->pLockingContext = pDRIPriv->myContext; } else if (*pDRIPriv->pLockingContext != pDRIPriv->myContext) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] Locking deadlock.\n" "\tAlready locked with context %p,\n" "\ttrying to lock with context %p.\n", pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext); } (*pDRIPriv->pLockRefCount)++; } void DRIUnlock(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (!pDRIPriv || !pDRIPriv->pLockRefCount) return; if (*pDRIPriv->pLockRefCount > 0) { if (pDRIPriv->myContext != *pDRIPriv->pLockingContext) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] Unlocking inconsistency:\n" "\tContext %p trying to unlock lock held by context %p\n", pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext); } (*pDRIPriv->pLockRefCount)--; } else { DRIDrvMsg(pScreen->myNum, X_ERROR, "DRIUnlock called when not locked.\n"); return; } if (!*pDRIPriv->pLockRefCount) DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext); } void * DRIGetSAREAPrivate(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (!pDRIPriv) return 0; return (void *) (((char *) pDRIPriv->pSAREA) + sizeof(XF86DRISAREARec)); } drm_context_t DRIGetContext(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (!pDRIPriv) return 0; return pDRIPriv->myContext; } void DRIGetTexOffsetFuncs(ScreenPtr pScreen, DRITexOffsetStartProcPtr * texOffsetStartFunc, DRITexOffsetFinishProcPtr * texOffsetFinishFunc) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (!pDRIPriv) return; *texOffsetStartFunc = pDRIPriv->pDriverInfo->texOffsetStart; *texOffsetFinishFunc = pDRIPriv->pDriverInfo->texOffsetFinish; } /* This lets get at the unwrapped functions so that they can correctly * call the lowerlevel functions, and choose whether they will be * called at every level of recursion (eg in validatetree). */ DRIWrappedFuncsRec * DRIGetWrappedFuncs(ScreenPtr pScreen) { return &(DRI_SCREEN_PRIV(pScreen)->wrap); } /* note that this returns the library version, not the protocol version */ void DRIQueryVersion(int *majorVersion, int *minorVersion, int *patchVersion) { *majorVersion = DRIINFO_MAJOR_VERSION; *minorVersion = DRIINFO_MINOR_VERSION; *patchVersion = DRIINFO_PATCH_VERSION; } static void _DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y) { pDRIPriv->pSAREA->frame.x = x; pDRIPriv->pSAREA->frame.y = y; pDRIPriv->pSAREA->frame.width = pScrn->frameX1 - x + 1; pDRIPriv->pSAREA->frame.height = pScrn->frameY1 - y + 1; } void DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); int px, py; if (!pDRIPriv || !pDRIPriv->pSAREA) { DRIDrvMsg(pScrn->scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n", pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL); return; } if (pDRIPriv->fullscreen) { /* Fix up frame */ pScrn->frameX0 = pDRIPriv->pSAREA->frame.x; pScrn->frameY0 = pDRIPriv->pSAREA->frame.y; pScrn->frameX1 = pScrn->frameX0 + pDRIPriv->pSAREA->frame.width - 1; pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1; /* Fix up cursor */ miPointerGetPosition(inputInfo.pointer, &px, &py); if (px < pScrn->frameX0) px = pScrn->frameX0; if (px > pScrn->frameX1) px = pScrn->frameX1; if (py < pScrn->frameY0) py = pScrn->frameY0; if (py > pScrn->frameY1) py = pScrn->frameY1; pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE); return; } if (pDRIPriv->wrap.AdjustFrame) { /* unwrap */ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; /* call lower layers */ (*pScrn->AdjustFrame) (pScrn, x, y); /* rewrap */ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; pScrn->AdjustFrame = DRIAdjustFrame; } _DRIAdjustFrame(pScrn, pDRIPriv, x, y); } /* * DRIMoveBuffersHelper swaps the regions rects in place leaving you * a region with the rects in the order that you need to blit them, * but it is possibly (likely) an invalid region afterwards. If you * need to use the region again for anything you have to call * REGION_VALIDATE on it, or better yet, save a copy first. */ void DRIMoveBuffersHelper(ScreenPtr pScreen, int dx, int dy, int *xdir, int *ydir, RegionPtr reg) { BoxPtr extents, pbox, firstBox, lastBox; BoxRec tmpBox; int y, nbox; extents = RegionExtents(reg); nbox = RegionNumRects(reg); pbox = RegionRects(reg); if ((dy > 0) && (dy < (extents->y2 - extents->y1))) { *ydir = -1; if (nbox > 1) { firstBox = pbox; lastBox = pbox + nbox - 1; while ((unsigned long) firstBox < (unsigned long) lastBox) { tmpBox = *firstBox; *firstBox = *lastBox; *lastBox = tmpBox; firstBox++; lastBox--; } } } else *ydir = 1; if ((dx > 0) && (dx < (extents->x2 - extents->x1))) { *xdir = -1; if (nbox > 1) { firstBox = lastBox = pbox; y = pbox->y1; while (--nbox) { pbox++; if (pbox->y1 == y) lastBox++; else { while ((unsigned long) firstBox < (unsigned long) lastBox) { tmpBox = *firstBox; *firstBox = *lastBox; *lastBox = tmpBox; firstBox++; lastBox--; } firstBox = lastBox = pbox; y = pbox->y1; } } while ((unsigned long) firstBox < (unsigned long) lastBox) { tmpBox = *firstBox; *firstBox = *lastBox; *lastBox = tmpBox; firstBox++; lastBox--; } } } else *xdir = 1; } char * DRICreatePCIBusID(const struct pci_device *dev) { char *busID; if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", dev->domain, dev->bus, dev->dev, dev->func) == -1) return NULL; return busID; } static void drmSIGIOHandler(int interrupt, void *closure) { unsigned long key; void *value; ssize_t count; drm_ctx_t ctx; typedef void (*_drmCallback) (int, void *, void *); char buf[256]; drm_context_t old; drm_context_t new; void *oldctx; void *newctx; char *pt; drmHashEntry *entry; void *hash_table; hash_table = drmGetHashTable(); if (!hash_table) return; if (drmHashFirst(hash_table, &key, &value)) { entry = value; do { #if 0 fprintf(stderr, "Trying %d\n", entry->fd); #endif if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) { buf[count] = '\0'; #if 0 fprintf(stderr, "Got %s\n", buf); #endif for (pt = buf; *pt != ' '; ++pt); /* Find first space */ ++pt; old = strtol(pt, &pt, 0); new = strtol(pt, NULL, 0); oldctx = drmGetContextTag(entry->fd, old); newctx = drmGetContextTag(entry->fd, new); #if 0 fprintf(stderr, "%d %d %p %p\n", old, new, oldctx, newctx); #endif ((_drmCallback) entry->f) (entry->fd, oldctx, newctx); ctx.handle = new; ioctl(entry->fd, DRM_IOCTL_NEW_CTX, &ctx); } } while (drmHashNext(hash_table, &key, &value)); } } int drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *)) { drmHashEntry *entry; entry = drmGetEntry(fd); entry->f = f; return xf86InstallSIGIOHandler(fd, drmSIGIOHandler, 0); } int drmRemoveSIGIOHandler(int fd) { drmHashEntry *entry = drmGetEntry(fd); entry->f = NULL; return xf86RemoveSIGIOHandler(fd); } xorg-server-1.17.1/hw/xfree86/dri/xf86dri.c0000664000175100017510000004353412366220413015142 00000000000000/************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* * Authors: * Kevin E. Martin * Jens Owen * Rickard E. (Rik) Faith * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include #include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" #include "extinit.h" #include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" #include "servermd.h" #define _XF86DRI_SERVER_ #include #include "swaprep.h" #include "xf86str.h" #include "dri.h" #include "sarea.h" #include "dristruct.h" #include "xf86drm.h" #include "protocol-versions.h" #include "xf86Extensions.h" static int DRIErrorBase; static void XF86DRIResetProc(ExtensionEntry *extEntry); static unsigned char DRIReqCode = 0; /*ARGSUSED*/ static void XF86DRIResetProc(ExtensionEntry *extEntry) { DRIReset(); } static int ProcXF86DRIQueryVersion(register ClientPtr client) { 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); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); swapl(&rep.patchVersion); } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep); return Success; } static int ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) { xXF86DRIQueryDirectRenderingCapableReply rep; Bool isCapable; REQUEST(xXF86DRIQueryDirectRenderingCapableReq); REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!DRIQueryDirectRenderingCapable(screenInfo.screens[stuff->screen], &isCapable)) { return BadValue; } 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); swapl(&rep.length); } WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), &rep); return Success; } static int ProcXF86DRIOpenConnection(register ClientPtr client) { xXF86DRIOpenConnectionReply rep; drm_handle_t hSAREA; char *busIdString; CARD32 busIdStringLength = 0; REQUEST(xXF86DRIOpenConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!DRIOpenConnection(screenInfo.screens[stuff->screen], &hSAREA, &busIdString)) { return BadValue; } if (busIdString) busIdStringLength = strlen(busIdString); 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__) .hSAREAHigh = (CARD32) (hSAREA >> 32), #else .hSAREAHigh = 0 #endif }; WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep); if (busIdStringLength) WriteToClient(client, busIdStringLength, busIdString); return Success; } static int ProcXF86DRIAuthConnection(register ClientPtr client) { xXF86DRIAuthConnectionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .authenticated = 1 }; REQUEST(xXF86DRIAuthConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } 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), &rep); return Success; } static int ProcXF86DRICloseConnection(register ClientPtr client) { REQUEST(xXF86DRICloseConnectionReq); REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } DRICloseConnection(screenInfo.screens[stuff->screen]); return Success; } static int ProcXF86DRIGetClientDriverName(register ClientPtr client) { xXF86DRIGetClientDriverNameReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .clientDriverNameLength = 0 }; char *clientDriverName; REQUEST(xXF86DRIGetClientDriverNameReq); REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } DRIGetClientDriverName(screenInfo.screens[stuff->screen], (int *) &rep.ddxDriverMajorVersion, (int *) &rep.ddxDriverMinorVersion, (int *) &rep.ddxDriverPatchVersion, &clientDriverName); if (clientDriverName) rep.clientDriverNameLength = strlen(clientDriverName); rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.clientDriverNameLength)); WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep); if (rep.clientDriverNameLength) WriteToClient(client, rep.clientDriverNameLength, clientDriverName); return Success; } static int ProcXF86DRICreateContext(register ClientPtr client) { xXF86DRICreateContextReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; ScreenPtr pScreen; REQUEST(xXF86DRICreateContextReq); REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } pScreen = screenInfo.screens[stuff->screen]; if (!DRICreateContext(pScreen, NULL, stuff->context, (drm_context_t *) &rep.hHWContext)) { return BadValue; } WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep); return Success; } static int ProcXF86DRIDestroyContext(register ClientPtr client) { REQUEST(xXF86DRIDestroyContextReq); REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!DRIDestroyContext(screenInfo.screens[stuff->screen], stuff->context)) { return BadValue; } return Success; } static int ProcXF86DRICreateDrawable(ClientPtr client) { xXF86DRICreateDrawableReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; DrawablePtr pDrawable; int rc; REQUEST(xXF86DRICreateDrawableReq); REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } 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)) { return BadValue; } WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep); return Success; } static int ProcXF86DRIDestroyDrawable(register ClientPtr client) { REQUEST(xXF86DRIDestroyDrawableReq); DrawablePtr pDrawable; int rc; REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (!DRIDestroyDrawable(screenInfo.screens[stuff->screen], client, pDrawable)) { return BadValue; } return Success; } static int ProcXF86DRIGetDrawableInfo(register ClientPtr client) { xXF86DRIGetDrawableInfoReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; DrawablePtr pDrawable; int X, Y, W, H; drm_clip_rect_t *pClipRects, *pClippedRects; drm_clip_rect_t *pBackClipRects; int backX, backY, rc; REQUEST(xXF86DRIGetDrawableInfoReq); REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (!DRIGetDrawableInfo(screenInfo.screens[stuff->screen], pDrawable, (unsigned int *) &rep.drawableTableIndex, (unsigned int *) &rep.drawableTableStamp, (int *) &X, (int *) &Y, (int *) &W, (int *) &H, (int *) &rep.numClipRects, &pClipRects, &backX, &backY, (int *) &rep.numBackClipRects, &pBackClipRects)) { return BadValue; } rep.drawableX = X; rep.drawableY = Y; rep.drawableWidth = W; rep.drawableHeight = H; rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) - SIZEOF(xGenericReply)); rep.backX = backX; rep.backY = backY; if (rep.numBackClipRects) rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; pClippedRects = pClipRects; if (rep.numClipRects) { /* Clip cliprects to screen dimensions (redirected windows) */ pClippedRects = malloc(rep.numClipRects * sizeof(drm_clip_rect_t)); if (pClippedRects) { ScreenPtr pScreen = screenInfo.screens[stuff->screen]; int i, j; for (i = 0, j = 0; i < rep.numClipRects; i++) { pClippedRects[j].x1 = max(pClipRects[i].x1, 0); pClippedRects[j].y1 = max(pClipRects[i].y1, 0); pClippedRects[j].x2 = min(pClipRects[i].x2, pScreen->width); pClippedRects[j].y2 = min(pClipRects[i].y2, pScreen->height); if (pClippedRects[j].x1 < pClippedRects[j].x2 && pClippedRects[j].y1 < pClippedRects[j].y2) { j++; } } rep.numClipRects = j; } else { rep.numClipRects = 0; } rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; } rep.length = bytes_to_int32(rep.length); WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep); if (rep.numClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, pClippedRects); free(pClippedRects); } if (rep.numBackClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numBackClipRects, pBackClipRects); } return Success; } static int ProcXF86DRIGetDeviceInfo(register ClientPtr client) { xXF86DRIGetDeviceInfoReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; drm_handle_t hFrameBuffer; void *pDevPrivate; REQUEST(xXF86DRIGetDeviceInfoReq); REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!DRIGetDeviceInfo(screenInfo.screens[stuff->screen], &hFrameBuffer, (int *) &rep.framebufferOrigin, (int *) &rep.framebufferSize, (int *) &rep.framebufferStride, (int *) &rep.devPrivateSize, &pDevPrivate)) { return BadValue; } rep.hFrameBufferLow = (CARD32) (hFrameBuffer & 0xffffffff); #if defined(LONG64) && !defined(__linux__) rep.hFrameBufferHigh = (CARD32) (hFrameBuffer >> 32); #else rep.hFrameBufferHigh = 0; #endif if (rep.devPrivateSize) { rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.devPrivateSize)); } WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep); if (rep.length) { WriteToClient(client, rep.devPrivateSize, pDevPrivate); } return Success; } static int ProcXF86DRIDispatch(register ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XF86DRIQueryVersion: return ProcXF86DRIQueryVersion(client); case X_XF86DRIQueryDirectRenderingCapable: return ProcXF86DRIQueryDirectRenderingCapable(client); } if (!client->local) return DRIErrorBase + XF86DRIClientNotLocal; switch (stuff->data) { case X_XF86DRIOpenConnection: return ProcXF86DRIOpenConnection(client); case X_XF86DRICloseConnection: return ProcXF86DRICloseConnection(client); case X_XF86DRIGetClientDriverName: return ProcXF86DRIGetClientDriverName(client); case X_XF86DRICreateContext: return ProcXF86DRICreateContext(client); case X_XF86DRIDestroyContext: return ProcXF86DRIDestroyContext(client); case X_XF86DRICreateDrawable: return ProcXF86DRICreateDrawable(client); case X_XF86DRIDestroyDrawable: return ProcXF86DRIDestroyDrawable(client); case X_XF86DRIGetDrawableInfo: return ProcXF86DRIGetDrawableInfo(client); case X_XF86DRIGetDeviceInfo: return ProcXF86DRIGetDeviceInfo(client); case X_XF86DRIAuthConnection: return ProcXF86DRIAuthConnection(client); /* {Open,Close}FullScreen are deprecated now */ default: return BadRequest; } } static int SProcXF86DRIQueryVersion(register ClientPtr client) { REQUEST(xXF86DRIQueryVersionReq); swaps(&stuff->length); return ProcXF86DRIQueryVersion(client); } static int SProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) { REQUEST(xXF86DRIQueryDirectRenderingCapableReq); swaps(&stuff->length); swapl(&stuff->screen); return ProcXF86DRIQueryDirectRenderingCapable(client); } static int SProcXF86DRIDispatch(register ClientPtr client) { REQUEST(xReq); /* * Only local clients are allowed DRI access, but remote clients still need * these requests to find out cleanly. */ switch (stuff->data) { case X_XF86DRIQueryVersion: return SProcXF86DRIQueryVersion(client); case X_XF86DRIQueryDirectRenderingCapable: return SProcXF86DRIQueryDirectRenderingCapable(client); default: return DRIErrorBase + XF86DRIClientNotLocal; } } void XFree86DRIExtensionInit(void) { ExtensionEntry *extEntry; #ifdef XF86DRI_EVENTS EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent"); #endif if (DRIExtensionInit() && #ifdef XF86DRI_EVENTS EventType && ScreenPrivateIndex != -1 && #endif (extEntry = AddExtension(XF86DRINAME, XF86DRINumberEvents, XF86DRINumberErrors, ProcXF86DRIDispatch, SProcXF86DRIDispatch, XF86DRIResetProc, StandardMinorOpcode))) { DRIReqCode = (unsigned char) extEntry->base; DRIErrorBase = extEntry->errorBase; } } xorg-server-1.17.1/hw/xfree86/dri/Makefile.in0000664000175100017510000006635712466505432015571 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/dri DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libdri_la_LIBADD = 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 = 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 = $(libdri_la_SOURCES) DIST_SOURCES = $(libdri_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = 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 \ dristruct.h \ sarea.h \ xf86dri.c sdk_HEADERS = dri.h sarea.h dristruct.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/dri/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/dri/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libdri.la: $(libdri_la_OBJECTS) $(libdri_la_DEPENDENCIES) $(EXTRA_libdri_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdri_la_OBJECTS) $(libdri_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @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 $@ $< @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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/xfree86/dri/dri.h0000664000175100017510000003264612415504026014435 00000000000000/************************************************************************** Copyright 1998-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: * Jens Owen * */ /* Prototypes for DRI functions */ #ifndef _DRI_H_ #include #include "scrnintstr.h" #include "xf86dri.h" typedef int DRISyncType; #define DRI_NO_SYNC 0 #define DRI_2D_SYNC 1 #define DRI_3D_SYNC 2 typedef int DRIContextType; typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr; typedef enum _DRIContextFlags { DRI_CONTEXT_2DONLY = 0x01, DRI_CONTEXT_PRESERVED = 0x02, DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */ } DRIContextFlags; #define DRI_NO_CONTEXT 0 #define DRI_2D_CONTEXT 1 #define DRI_3D_CONTEXT 2 typedef int DRISwapMethod; #define DRI_HIDE_X_CONTEXT 0 #define DRI_SERVER_SWAP 1 #define DRI_KERNEL_SWAP 2 typedef int DRIWindowRequests; #define DRI_NO_WINDOWS 0 #define DRI_3D_WINDOWS_ONLY 1 #define DRI_ALL_WINDOWS 2 typedef void (*ClipNotifyPtr) (WindowPtr, int, int); typedef void (*AdjustFramePtr) (ScrnInfoPtr pScrn, int x, int y); /* * These functions can be wrapped by the DRI. Each of these have * generic default funcs (initialized in DRICreateInfoRec) and can be * overridden by the driver in its [driver]DRIScreenInit function. */ typedef struct { ScreenWakeupHandlerProcPtr WakeupHandler; ScreenBlockHandlerProcPtr BlockHandler; WindowExposuresProcPtr WindowExposures; CopyWindowProcPtr CopyWindow; ClipNotifyProcPtr ClipNotify; AdjustFramePtr AdjustFrame; } DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; /* * Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned * by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also * being used to version the XFree86-DRI protocol. Bugs #3066 and #3163 * showed that this was inadequate. The DRIInfoRec structure is now versioned * by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18. * * Revision history: * 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION. * 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION. * 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer. */ #define DRIINFO_MAJOR_VERSION 5 #define DRIINFO_MINOR_VERSION 4 #define DRIINFO_PATCH_VERSION 0 typedef unsigned long long (*DRITexOffsetStartProcPtr) (PixmapPtr pPix); typedef void (*DRITexOffsetFinishProcPtr) (PixmapPtr pPix); typedef struct { /* driver call back functions * * New fields should be added at the end for backwards compatibility. * Bump the DRIINFO patch number to indicate bugfixes. * Bump the DRIINFO minor number to indicate new fields. * Bump the DRIINFO major number to indicate binary-incompatible changes. */ Bool (*CreateContext) (ScreenPtr pScreen, VisualPtr visual, drm_context_t hHWContext, void *pVisualConfigPriv, DRIContextType context); void (*DestroyContext) (ScreenPtr pScreen, drm_context_t hHWContext, DRIContextType context); void (*SwapContext) (ScreenPtr pScreen, DRISyncType syncType, DRIContextType readContextType, void *readContextStore, DRIContextType writeContextType, void *writeContextStore); void (*InitBuffers) (WindowPtr pWin, RegionPtr prgn, CARD32 indx); void (*MoveBuffers) (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 indx); void (*TransitionTo3d) (ScreenPtr pScreen); void (*TransitionTo2d) (ScreenPtr pScreen); void (*SetDrawableIndex) (WindowPtr pWin, CARD32 indx); Bool (*OpenFullScreen) (ScreenPtr pScreen); Bool (*CloseFullScreen) (ScreenPtr pScreen); /* wrapped functions */ DRIWrappedFuncsRec wrap; /* device info */ char *drmDriverName; char *clientDriverName; char *busIdString; int ddxDriverMajorVersion; int ddxDriverMinorVersion; int ddxDriverPatchVersion; void *frameBufferPhysicalAddress; long frameBufferSize; long frameBufferStride; long SAREASize; int maxDrawableTableEntry; int ddxDrawableTableEntry; long contextSize; DRISwapMethod driverSwapMethod; DRIWindowRequests bufferRequests; int devPrivateSize; void *devPrivate; Bool createDummyCtx; Bool createDummyCtxPriv; /* New with DRI version 4.1.0 */ void (*TransitionSingleToMulti3D) (ScreenPtr pScreen); void (*TransitionMultiToSingle3D) (ScreenPtr pScreen); /* New with DRI version 5.1.0 */ void (*ClipNotify) (ScreenPtr pScreen, WindowPtr *ppWin, int num); /* New with DRI version 5.2.0 */ Bool allocSarea; Bool keepFDOpen; /* New with DRI version 5.3.0 */ DRITexOffsetStartProcPtr texOffsetStart; DRITexOffsetFinishProcPtr texOffsetFinish; /* New with DRI version 5.4.0 */ int dontMapFrameBuffer; drm_handle_t hFrameBuffer; /* Handle to framebuffer, either * mapped by DDX driver or DRI */ } DRIInfoRec, *DRIInfoPtr; extern _X_EXPORT Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn, unsigned long sAreaSize, const char *busID, const char *drmDriverName); extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD); extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen); extern Bool DRIExtensionInit(void); extern _X_EXPORT void DRIReset(void); extern _X_EXPORT Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool *isCapable); extern _X_EXPORT Bool DRIOpenConnection(ScreenPtr pScreen, drm_handle_t * hSAREA, char **busIdString); extern _X_EXPORT Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic); extern _X_EXPORT Bool DRICloseConnection(ScreenPtr pScreen); extern _X_EXPORT Bool DRIGetClientDriverName(ScreenPtr pScreen, int *ddxDriverMajorVersion, int *ddxDriverMinorVersion, int *ddxDriverPatchVersion, char **clientDriverName); extern _X_EXPORT Bool DRICreateContext(ScreenPtr pScreen, VisualPtr visual, XID context, drm_context_t * pHWContext); extern _X_EXPORT Bool DRIDestroyContext(ScreenPtr pScreen, XID context); extern _X_EXPORT Bool DRIContextPrivDelete(void *pResource, XID id); extern _X_EXPORT Bool DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, drm_drawable_t * hHWDrawable); extern _X_EXPORT Bool DRIDestroyDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable); extern _X_EXPORT Bool DRIDrawablePrivDelete(void *pResource, XID id); extern _X_EXPORT Bool DRIGetDrawableInfo(ScreenPtr pScreen, DrawablePtr pDrawable, unsigned int *indx, unsigned int *stamp, int *X, int *Y, int *W, int *H, int *numClipRects, drm_clip_rect_t ** pClipRects, int *backX, int *backY, int *numBackClipRects, drm_clip_rect_t ** pBackClipRects); extern _X_EXPORT Bool DRIGetDeviceInfo(ScreenPtr pScreen, drm_handle_t * hFrameBuffer, int *fbOrigin, int *fbSize, int *fbStride, int *devPrivateSize, void **pDevPrivate); extern _X_EXPORT DRIInfoPtr DRICreateInfoRec(void); extern _X_EXPORT void DRIDestroyInfoRec(DRIInfoPtr DRIInfo); extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen); extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, int result, void *pReadmask); extern _X_EXPORT void DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask); extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, unsigned long result, void *pReadmask); extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask); extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx); extern _X_EXPORT void *DRIGetContextStore(DRIContextPrivPtr context); extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin, RegionPtr prgn); extern _X_EXPORT Bool DRIDestroyWindow(WindowPtr pWin); extern _X_EXPORT void DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); extern _X_EXPORT void DRIClipNotify(WindowPtr pWin, int dx, int dy); extern _X_EXPORT CARD32 DRIGetDrawableIndex(WindowPtr pWin); extern _X_EXPORT void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg); extern _X_EXPORT void DRILock(ScreenPtr pScreen, int flags); extern _X_EXPORT void DRIUnlock(ScreenPtr pScreen); extern _X_EXPORT DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen); extern _X_EXPORT void *DRIGetSAREAPrivate(ScreenPtr pScreen); extern _X_EXPORT unsigned int DRIGetDrawableStamp(ScreenPtr pScreen, CARD32 drawable_index); extern _X_EXPORT DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen, drm_context_t * pHWContext, DRIContextFlags flags); extern _X_EXPORT DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen, drm_context_t hHWContext, DRIContextFlags flags); extern _X_EXPORT Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv); 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(ScrnInfoPtr pScrn, int x, int y); extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen, int dx, int dy, int *xdir, int *ydir, RegionPtr reg); extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo); extern _X_EXPORT int drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *)); extern _X_EXPORT int drmRemoveSIGIOHandler(int fd); extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn); extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); extern _X_EXPORT drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn); extern _X_EXPORT void DRIGetTexOffsetFuncs(ScreenPtr pScreen, DRITexOffsetStartProcPtr * texOffsetStartFunc, DRITexOffsetFinishProcPtr * texOffsetFinishFunc); #define _DRI_H_ #endif xorg-server-1.17.1/hw/xfree86/dri/dristruct.h0000664000175100017510000001100512274325511015667 00000000000000/************************************************************************** Copyright 1998-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: * Jens Owen * */ #ifndef DRI_STRUCT_H #define DRI_STRUCT_H #include "xf86drm.h" #include "xf86Crtc.h" #define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) ((DRIDrawablePrivPtr) \ dixLookupPrivate(&(pWin)->devPrivates, DRIWindowPrivKey)) #define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) ((DRIDrawablePrivPtr) \ dixLookupPrivate(&(pPix)->devPrivates, DRIWindowPrivKey)) typedef struct _DRIDrawablePrivRec { drm_drawable_t hwDrawable; int drawableIndex; ScreenPtr pScreen; int refCount; int nrects; } DRIDrawablePrivRec, *DRIDrawablePrivPtr; struct _DRIContextPrivRec { drm_context_t hwContext; ScreenPtr pScreen; Bool valid3D; DRIContextFlags flags; void **pContextStore; }; #define DRI_SCREEN_PRIV(pScreen) ((DRIScreenPrivPtr) \ (dixPrivateKeyRegistered(DRIScreenPrivKey) ? \ dixLookupPrivate(&(pScreen)->devPrivates, DRIScreenPrivKey) : NULL)) #define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ dixLookupPrivate(&screenInfo.screens[screenIndex]->devPrivates, \ DRIScreenPrivKey)) #define DRI_ENT_PRIV(pScrn) \ ((DRIEntPrivIndex < 0) ? \ NULL: \ ((DRIEntPrivPtr)(xf86GetEntityPrivate((pScrn)->entityList[0], \ DRIEntPrivIndex)->ptr))) typedef struct _DRIScreenPrivRec { Bool directRenderingSupport; int drmFD; /* File descriptor for /dev/video/? */ drm_handle_t hSAREA; /* Handle to SAREA, for mapping */ XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */ drm_context_t myContext; /* DDX Driver's context */ DRIContextPrivPtr myContextPriv; /* Pointer to server's private area */ DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */ void **hiddenContextStore; /* hidden X context */ void **partial3DContextStore; /* parital 3D context */ DRIInfoPtr pDriverInfo; int nrWindows; int nrWindowsVisible; int nrWalked; drm_clip_rect_t private_buffer_rect; /* management of private buffers */ DrawablePtr fullscreen; /* pointer to fullscreen drawable */ drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */ DRIWrappedFuncsRec wrap; DestroyWindowProcPtr DestroyWindow; DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES]; DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */ Bool createDummyCtx; Bool createDummyCtxPriv; Bool grabbedDRILock; Bool drmSIGIOHandlerInstalled; Bool wrapped; Bool windowsTouched; int lockRefCount; drm_handle_t hLSAREA; /* Handle to SAREA containing lock, for mapping */ XF86DRILSAREAPtr pLSAREA; /* Mapped pointer to SAREA containing lock */ int *pLockRefCount; int *pLockingContext; xf86_crtc_notify_proc_ptr xf86_crtc_notify; } DRIScreenPrivRec, *DRIScreenPrivPtr; typedef struct _DRIEntPrivRec { int drmFD; Bool drmOpened; Bool sAreaGrabbed; drm_handle_t hLSAREA; XF86DRILSAREAPtr pLSAREA; unsigned long sAreaSize; int lockRefCount; int lockingContext; ScreenPtr resOwner; Bool keepFDOpen; int refCount; } DRIEntPrivRec, *DRIEntPrivPtr; #endif /* DRI_STRUCT_H */ xorg-server-1.17.1/hw/xfree86/dixmods/0000775000175100017510000000000012466505445014460 500000000000000xorg-server-1.17.1/hw/xfree86/dixmods/Makefile.am0000664000175100017510000000274512323563340016432 00000000000000noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la if GLX GLXMODS = libglx.la endif module_LTLIBRARIES = libfb.la \ libwfb.la \ libshadow.la extsmoduledir = $(moduledir)/extensions extsmodule_LTLIBRARIES = $(GLXMODS) AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ AM_CPPFLAGS = @XORG_INCS@ \ -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow \ -I$(top_srcdir)/glx libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libfb_la_LIBADD = $(top_builddir)/fb/libfb.la libfb_la_SOURCES = fbmodule.c libfb_la_CFLAGS = $(AM_CFLAGS) libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la libwfb_la_SOURCES = fbmodule.c libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER 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 libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la if NO_UNDEFINED libglx_la_LIBADD += $(LIBDRM_LIBS) $(PIXMAN_LIBS) endif endif libglx_la_SOURCES = glxmodule.c 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 = $(AM_CFLAGS) libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c xorg-server-1.17.1/hw/xfree86/dixmods/xkbPrivate.c0000664000175100017510000000271712274325511016661 00000000000000 #ifdef HAVE_DIX_CONFIG_H #include #endif #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS #include #include "dixgrabs.h" #include "os.h" #include "xf86.h" int XkbDDXPrivate(DeviceIntPtr dev, KeyCode key, XkbAction *act) { XkbAnyAction *xf86act = &(act->any); char msgbuf[XkbAnyActionDataSize + 1]; if (xf86act->type == XkbSA_XFree86Private) { memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize); msgbuf[XkbAnyActionDataSize] = '\0'; if (strcasecmp(msgbuf, "-vmode") == 0) xf86ProcessActionEvent(ACTION_PREV_MODE, NULL); else if (strcasecmp(msgbuf, "+vmode") == 0) xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL); else if (strcasecmp(msgbuf, "prgrbs") == 0) { DeviceIntPtr tmp; xf86Msg(X_INFO, "Printing all currently active device grabs:\n"); for (tmp = inputInfo.devices; tmp; tmp = tmp->next) if (tmp->deviceGrab.grab) PrintDeviceGrabInfo(tmp); xf86Msg(X_INFO, "End list of active device grabs\n"); } else if (strcasecmp(msgbuf, "ungrab") == 0) UngrabAllDevices(FALSE); else if (strcasecmp(msgbuf, "clsgrb") == 0) UngrabAllDevices(TRUE); else if (strcasecmp(msgbuf, "prwins") == 0) PrintWindowTree(); } return 0; } xorg-server-1.17.1/hw/xfree86/dixmods/fbmodule.c0000664000175100017510000000365312366220413016334 00000000000000/* * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project shall * not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from the * XFree86 Project. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Module.h" #include "fb.h" static XF86ModuleVersionInfo VersRec = { #ifdef FB_ACCESS_WRAPPER "wfb", #else "fb", #endif MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 0, 0, ABI_CLASS_ANSIC, /* Only need the ansic layer */ ABI_ANSIC_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} /* signature, to be patched into the file by a tool */ }; _X_EXPORT XF86ModuleData FBPREFIX(ModuleData) = { &VersRec, NULL, NULL}; xorg-server-1.17.1/hw/xfree86/dixmods/xkbKillSrv.c0000664000175100017510000000342312456571574016646 00000000000000/************************************************************ Copyright (c) 1993 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 #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include #include #include "xf86.h" int XkbDDXTerminateServer(DeviceIntPtr dev, KeyCode key, XkbAction *act) { if (dev != inputInfo.keyboard) xf86ProcessActionEvent(ACTION_TERMINATE, NULL); return 0; } xorg-server-1.17.1/hw/xfree86/dixmods/glxmodule.c0000664000175100017510000000517212366220413016535 00000000000000/************************************************************************** Copyright 1998-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 * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Module.h" #include "xf86Priv.h" #include "xf86.h" #include "colormap.h" #include "micmap.h" #include "globals.h" #include "glxserver.h" #include "extinit.h" #include "glx_extinit.h" static MODULESETUPPROTO(glxSetup); static const ExtensionModule GLXExt[] = { { GlxExtensionInit, "GLX", &noGlxExtension }, }; static XF86ModuleVersionInfo VersRec = { "glx", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 0, 0, ABI_CLASS_EXTENSION, ABI_EXTENSION_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL }; static void * glxSetup(void *module, void *opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; __GLXprovider *provider; if (setupDone) { if (errmaj) *errmaj = LDR_ONCEONLY; return NULL; } setupDone = TRUE; xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n", xf86Info.aiglx ? "enabled" : "disabled"); if (xf86Info.aiglx) { provider = LoaderSymbol("__glXDRI2Provider"); if (provider) GlxPushProvider(provider); } LoadExtensionList(GLXExt, ARRAY_SIZE(GLXExt), FALSE); return module; } xorg-server-1.17.1/hw/xfree86/dixmods/Makefile.in0000664000175100017510000011231112466505432016440 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @AIGLX_DRI_LOADER_TRUE@am__append_1 = $(top_builddir)/glx/libglxdri.la @AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@am__append_2 = $(LIBDRM_LIBS) $(PIXMAN_LIBS) @NO_UNDEFINED_TRUE@am__append_3 = libfb.la subdir = hw/xfree86/dixmods DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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)$(moduledir)" LTLIBRARIES = $(extsmodule_LTLIBRARIES) $(module_LTLIBRARIES) \ $(noinst_LTLIBRARIES) 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 = libdixmods_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libdixmods_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ libfb_la_DEPENDENCIES = $(top_builddir)/fb/libfb.la am_libfb_la_OBJECTS = libfb_la-fbmodule.lo 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 = @AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@ $(am__DEPENDENCIES_1) libglx_la_DEPENDENCIES = $(top_builddir)/glx/libglx.la \ $(am__DEPENDENCIES_1) $(am__append_1) $(am__DEPENDENCIES_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) 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) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libshadow_la_LDFLAGS) $(LDFLAGS) -o $@ libwfb_la_DEPENDENCIES = $(top_builddir)/fb/libwfb.la am_libwfb_la_OBJECTS = libwfb_la-fbmodule.lo libwfb_la_OBJECTS = $(am_libwfb_la_OBJECTS) libwfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libwfb_la_CFLAGS) \ $(CFLAGS) $(libwfb_la_LDFLAGS) $(LDFLAGS) -o $@ libxorgxkb_la_LIBADD = am_libxorgxkb_la_OBJECTS = xkbVT.lo xkbPrivate.lo xkbKillSrv.lo libxorgxkb_la_OBJECTS = $(am_libxorgxkb_la_OBJECTS) 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 = $(libdixmods_la_SOURCES) $(libfb_la_SOURCES) \ $(libglx_la_SOURCES) $(libshadow_la_SOURCES) \ $(libwfb_la_SOURCES) $(libxorgxkb_la_SOURCES) DIST_SOURCES = $(libdixmods_la_SOURCES) $(libfb_la_SOURCES) \ $(libglx_la_SOURCES) $(libshadow_la_SOURCES) \ $(libwfb_la_SOURCES) $(libxorgxkb_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libdixmods.la libxorgxkb.la @GLX_TRUE@GLXMODS = libglx.la module_LTLIBRARIES = libfb.la \ libwfb.la \ libshadow.la extsmoduledir = $(moduledir)/extensions extsmodule_LTLIBRARIES = $(GLXMODS) AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ AM_CPPFLAGS = @XORG_INCS@ \ -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow \ -I$(top_srcdir)/glx libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libfb_la_LIBADD = $(top_builddir)/fb/libfb.la libfb_la_SOURCES = fbmodule.c libfb_la_CFLAGS = $(AM_CFLAGS) libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la libwfb_la_SOURCES = fbmodule.c libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER 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 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 = $(AM_CFLAGS) libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/dixmods/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } 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}; \ } 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}; \ } 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) 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) $(AM_V_CCLD)$(libwfb_la_LINK) -rpath $(moduledir) $(libwfb_la_OBJECTS) $(libwfb_la_LIBADD) $(LIBS) libxorgxkb.la: $(libxorgxkb_la_OBJECTS) $(libxorgxkb_la_DEPENDENCIES) $(EXTRA_libxorgxkb_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libxorgxkb_la_OBJECTS) $(libxorgxkb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @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-fbmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbmodule.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbVT.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 -o $@ $< .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 -o $@ `$(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 $@ $< libdixmods_la-miinitext.lo: $(top_srcdir)/mi/miinitext.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) $(libdixmods_la_CFLAGS) $(CFLAGS) -MT libdixmods_la-miinitext.lo -MD -MP -MF $(DEPDIR)/libdixmods_la-miinitext.Tpo -c -o libdixmods_la-miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdixmods_la-miinitext.Tpo $(DEPDIR)/libdixmods_la-miinitext.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/mi/miinitext.c' object='libdixmods_la-miinitext.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) $(libdixmods_la_CFLAGS) $(CFLAGS) -c -o libdixmods_la-miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c libfb_la-fbmodule.lo: fbmodule.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbmodule.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbmodule.Tpo -c -o libfb_la-fbmodule.lo `test -f 'fbmodule.c' || echo '$(srcdir)/'`fbmodule.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbmodule.Tpo $(DEPDIR)/libfb_la-fbmodule.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbmodule.c' object='libfb_la-fbmodule.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbmodule.lo `test -f 'fbmodule.c' || echo '$(srcdir)/'`fbmodule.c libwfb_la-fbmodule.lo: fbmodule.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbmodule.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbmodule.Tpo -c -o libwfb_la-fbmodule.lo `test -f 'fbmodule.c' || echo '$(srcdir)/'`fbmodule.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbmodule.Tpo $(DEPDIR)/libwfb_la-fbmodule.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbmodule.c' object='libwfb_la-fbmodule.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbmodule.lo `test -f 'fbmodule.c' || echo '$(srcdir)/'`fbmodule.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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: for dir in "$(DESTDIR)$(extsmoduledir)" "$(DESTDIR)$(moduledir)"; 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 \ clean-moduleLTLIBRARIES 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-extsmoduleLTLIBRARIES \ install-moduleLTLIBRARIES 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-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-extsmoduleLTLIBRARIES clean-generic clean-libtool \ clean-moduleLTLIBRARIES clean-noinstLTLIBRARIES cscopelist-am \ ctags ctags-am 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-moduleLTLIBRARIES 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 tags-am uninstall uninstall-am \ uninstall-extsmoduleLTLIBRARIES uninstall-moduleLTLIBRARIES # 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: xorg-server-1.17.1/hw/xfree86/dixmods/xkbVT.c0000664000175100017510000000417112456571574015612 00000000000000/************************************************************ Copyright (c) 1993 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 #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include #include #include "xf86.h" int XkbDDXSwitchScreen(DeviceIntPtr dev, KeyCode key, XkbAction *act) { int scrnnum = XkbSAScreen(&act->screen); if (act->screen.flags & XkbSA_SwitchApplication) { if (act->screen.flags & XkbSA_SwitchAbsolute) xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &scrnnum); else { if (scrnnum < 0) xf86ProcessActionEvent(ACTION_SWITCHSCREEN_PREV, NULL); else xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL); } } return 1; } xorg-server-1.17.1/hw/xfree86/dixmods/shmodule.c0000664000175100017510000000364312366220413016356 00000000000000/* * Copyright © 2000 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_XORG_CONFIG_H #include #endif #include "xf86Module.h" #include #include "scrnintstr.h" #include "windowstr.h" #include #include "dixfontstr.h" #include #include "mi.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" #include "shadow.h" static XF86ModuleVersionInfo VersRec = { "shadow", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 1, 0, ABI_CLASS_ANSIC, /* Only need the ansic layer */ ABI_ANSIC_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} /* signature, to be patched into the file by a tool */ }; _X_EXPORT XF86ModuleData shadowModuleData = { &VersRec, NULL, NULL }; xorg-server-1.17.1/hw/xfree86/xorgconf.cpp0000664000175100017510000004111712362011424015246 00000000000000# # Copyright (c) 1994-1998 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 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. # # $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $ # ********************************************************************** # This is a sample configuration file only, intended to illustrate # what a config file might look like. Refer to the xorg.conf(__filemansuffix__) # man page for details about the format of this file. # ********************************************************************** # The ordering of sections is not important in XFree86 4.0 and later, # nor in any Xorg release. # ********************************************************************** # Files section. This allows default font and module paths to be set # ********************************************************************** Section "Files" # Multiple FontPath entries are allowed (which are concatenated together), # as well as specifying multiple comma-separated entries in one FontPath # command (or a combination of both methods). # The default path is shown here. # FontPath DEFAULTFONTPATH # ModulePath can be used to set a search path for the X server modules. # The default path is shown here. # ModulePath MODULEPATH EndSection # ********************************************************************** # Module section -- this is an optional section which is used to specify # which run-time loadable modules to load when the X server starts up. # ********************************************************************** Section "Module" # This loads the DBE extension module. Load "dbe" # This loads the miscellaneous extensions module, and disables # initialisation of the XFree86-DGA extension within that module. SubSection "extmod" Option "omit xfree86-dga" EndSubSection EndSection # ********************************************************************** # Server flags section. This contains various server-wide Options. # ********************************************************************** Section "ServerFlags" # Uncomment this to cause a core dump at the spot where a signal is # received. This may leave the console in an unusable state, but may # provide a better stack trace in the core dump to aid in debugging # Option "NoTrapSignals" # Uncomment this to disable the VT switch sequence # (where n is 1 through 12). This allows clients to receive these key # events. # Option "DontVTSwitch" # Uncomment this to disable the server abort sequence # This allows clients to receive this key event. # Option "DontZap" "true" # Uncomment this to disable the / mode switching # sequences. This allows clients to receive these key events. # Option "DontZoom" # Uncomment this to disable tuning with the xvidtune client. With # it the client can still run and fetch card and monitor attributes, # but it will not be allowed to change them. If it tries it will # receive a protocol error. # Option "DisableVidModeExtension" # Uncomment this to enable the use of a non-local xvidtune client. # Option "AllowNonLocalXvidtune" # Set the basic blanking screen saver timeout. Option "BlankTime" "10" # 10 minutes # Set the DPMS timeouts. These are set here because they are global # rather than screen-specific. These settings alone don't enable DPMS. # It is enabled per-screen (or per-monitor), and even then only when # the driver supports it. Option "StandbyTime" "10" # 10 minutes Option "SuspendTime" "10" # 10 minutes Option "OffTime" "10" # 10 minutes EndSection # ********************************************************************** # Input devices # ********************************************************************** # ********************************************************************** # Core keyboard's InputDevice section # ********************************************************************** Section "InputDevice" Identifier "Keyboard1" Driver "kbd" # Set the keyboard auto repeat parameters. Not all platforms implement # this. Option "AutoRepeat" "500 5" # Specifiy which keyboard LEDs can be user-controlled (eg, with xset(1)). # Option "Xleds" "1 2 3" # To customise the XKB settings to suit your keyboard, modify the # lines below (which are the defaults). For example, for a European # keyboard, you will probably want to use one of: # # Option "XkbModel" "pc102" # Option "XkbModel" "pc105" # # If you have a Microsoft Natural keyboard, you can use: # # Option "XkbModel" "microsoft" # # If you have a US "windows" keyboard you will want: # # Option "XkbModel" "pc104" # # Then to change the language, change the Layout setting. # For example, a german layout can be obtained with: # # Option "XkbLayout" "de" # # or: # # Option "XkbLayout" "de" # Option "XkbVariant" "nodeadkeys" # # If you'd like to switch the positions of your capslock and # control keys, use: # # Option "XkbOptions" "ctrl:swapcaps" # These are the default XKB settings for xorg # # Option "XkbRules" "xorg" # Option "XkbModel" "pc105" # Option "XkbLayout" "us" # Option "XkbVariant" "" # Option "XkbOptions" "" EndSection # ********************************************************************** # Core Pointer's InputDevice section # ********************************************************************** Section "InputDevice" # Identifier and driver Identifier "Mouse1" Driver "mouse" # The mouse protocol and device. The device is normally set to /dev/mouse, # which is usually a symbolic link to the real device. Option "Protocol" "Microsoft" Option "Device" "/dev/mouse" # On platforms where PnP mouse detection is supported the following # protocol setting can be used when using a newer PnP mouse: # Option "Protocol" "Auto" # When using mouse connected to a PS/2 port (aka "MousePort"), set the # the protocol as follows. On some platforms some other settings may # be available. # Option "Protocol" "PS/2" # Baudrate and SampleRate are only for some older Logitech mice. In # almost every case these lines should be omitted. # Option "BaudRate" "9600" # Option "SampleRate" "150" # Emulate3Buttons is an option for 2-button mice # Emulate3Timeout is the timeout in milliseconds (default is 50ms) # Option "Emulate3Buttons" # Option "Emulate3Timeout" "50" # ChordMiddle is an option for some 3-button Logitech mice, or any # 3-button mouse where the middle button generates left+right button # events. # Option "ChordMiddle" EndSection Section "InputDevice" Identifier "Mouse2" Driver "mouse" Option "Protocol" "MouseMan" Option "Device" "/dev/mouse2" EndSection # Some examples of extended input devices # Section "InputDevice" # Identifier "spaceball" # Driver "magellan" # Option "Device" "/dev/cua0" # EndSection # # Section "InputDevice" # Identifier "spaceball2" # Driver "spaceorb" # Option "Device" "/dev/cua0" # EndSection # # Section "InputDevice" # Identifier "touchscreen0" # Driver "microtouch" # Option "Device" "/dev/ttyS0" # Option "MinX" "1412" # Option "MaxX" "15184" # Option "MinY" "15372" # Option "MaxY" "1230" # Option "ScreenNumber" "0" # Option "ReportingMode" "Scaled" # Option "ButtonNumber" "1" # Option "SendCoreEvents" # EndSection # # Section "InputDevice" # Identifier "touchscreen1" # Driver "elo2300" # Option "Device" "/dev/ttyS0" # Option "MinX" "231" # Option "MaxX" "3868" # Option "MinY" "3858" # Option "MaxY" "272" # Option "ScreenNumber" "0" # Option "ReportingMode" "Scaled" # Option "ButtonThreshold" "17" # Option "ButtonNumber" "1" # Option "SendCoreEvents" # EndSection # ********************************************************************** # Monitor section # ********************************************************************** # Any number of monitor sections may be present Section "Monitor" # The identifier line must be present. Identifier "Generic Monitor" # HorizSync is in kHz unless units are specified. # HorizSync may be a comma separated list of discrete values, or a # comma separated list of ranges of values. # NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S # USER MANUAL FOR THE CORRECT NUMBERS. # HorizSync 31.5 # typical for a single frequency fixed-sync monitor # HorizSync 30-64 # multisync # HorizSync 31.5, 35.2 # multiple fixed sync frequencies # HorizSync 15-25, 30-50 # multiple ranges of sync frequencies # VertRefresh is in Hz unless units are specified. # VertRefresh may be a comma separated list of discrete values, or a # comma separated list of ranges of values. # NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S # USER MANUAL FOR THE CORRECT NUMBERS. # VertRefresh 60 # typical for a single frequency fixed-sync monitor # VertRefresh 50-100 # multisync # VertRefresh 60, 65 # multiple fixed sync frequencies # VertRefresh 40-50, 80-100 # multiple ranges of sync frequencies # Modes can be specified in two formats. A compact one-line format, or # a multi-line format. # A generic VGA 640x480 mode (hsync = 31.5kHz, refresh = 60Hz) # These two are equivalent # ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525 Mode "640x480" DotClock 25.175 HTimings 640 664 760 800 VTimings 480 491 493 525 EndMode # These two are equivalent # ModeLine "1024x768i" 45 1024 1048 1208 1264 768 776 784 817 Interlace # Mode "1024x768i" # DotClock 45 # HTimings 1024 1048 1208 1264 # VTimings 768 776 784 817 # Flags "Interlace" # EndMode # If a monitor has DPMS support, that can be indicated here. This will # enable DPMS when the monitor is used with drivers that support it. # Option "dpms" # If a monitor requires that the sync signals be superimposed on the # green signal, the following option will enable this when used with # drivers that support it. Only a relatively small range of hardware # (and drivers) actually support this. # Option "sync on green" EndSection # ********************************************************************** # Graphics device section # ********************************************************************** # Any number of graphics device sections may be present Section "Device" # The Identifier must be present. Identifier "Generic VESA" # The Driver line must be present. When using run-time loadable driver # modules, this line instructs the server to load the specified driver # module. Even when not using loadable driver modules, this line # indicates which driver should interpret the information in this section. Driver "vesa" # The chipset line is optional in most cases. It can be used to override # the driver's chipset detection, and should not normally be specified. # Chipset "generic" # Various other lines can be specified to override the driver's automatic # detection code. In most cases they are not needed. # VideoRam 256 # Clocks 25.2 28.3 # The BusID line is used to specify which of possibly multiple devices # this section is intended for. When this line isn't present, a device # section can only match up with the primary video device. For PCI # devices a line like the following could be used. This line should not # normally be included unless there is more than one video device # intalled. # BusID "PCI:0:10:0" # Various option lines can be added here as required. Some options # are more appropriate in Screen sections, Display subsections or even # Monitor sections. # Option "hw cursor" "off" EndSection Section "Device" Identifier "any supported Trident chip" Driver "trident" EndSection Section "Device" Identifier "MGA Millennium I" Driver "mga" Option "hw cursor" "off" BusID "PCI:0:10:0" EndSection Section "Device" Identifier "MGA G200 AGP" Driver "mga" BusID "PCI:1:0:0" Option "pci retry" EndSection # ********************************************************************** # Screen sections. # ********************************************************************** # Any number of screen sections may be present. Each describes # the configuration of a single screen. A single specific screen section # may be specified from the X server command line with the "-screen" # option. Section "Screen" # The Identifier, Device and Monitor lines must be present Identifier "Screen 1" Device "Generic VESA" Monitor "Generic Monitor" # The favoured Depth and/or Bpp may be specified here DefaultDepth 8 SubSection "Display" Depth 8 Modes "640x480" ViewPort 0 0 Virtual 800 600 EndSubsection SubSection "Display" Depth 4 Modes "640x480" EndSubSection SubSection "Display" Depth 1 Modes "640x480" EndSubSection EndSection Section "Screen" Identifier "Screen MGA1" Device "MGA Millennium I" Monitor "Generic Monitor" Option "no accel" DefaultDepth 16 # DefaultDepth 24 SubSection "Display" Depth 8 Modes "1280x1024" Option "rgb bits" "8" Visual "StaticColor" EndSubSection SubSection "Display" Depth 16 Modes "1280x1024" EndSubSection SubSection "Display" Depth 24 Modes "1280x1024" EndSubSection EndSection Section "Screen" Identifier "Screen MGA2" Device "MGA G200 AGP" Monitor "Generic Monitor" DefaultDepth 8 SubSection "Display" Depth 8 Modes "1280x1024" Option "rgb bits" "8" Visual "StaticColor" EndSubSection EndSection # ********************************************************************** # ServerLayout sections. # ********************************************************************** # Any number of ServerLayout sections may be present. Each describes # the way multiple screens are organised. A specific ServerLayout # section may be specified from the X server command line with the # "-layout" option. In the absence of this, the first section is used. # When now ServerLayout section is present, the first Screen section # is used alone. Section "ServerLayout" # The Identifier line must be present Identifier "Main Layout" # Each Screen line specifies a Screen section name, and optionally # the relative position of other screens. The four names after # primary screen name are the screens to the top, bottom, left and right # of the primary screen. In this example, screen 2 is located to the # right of screen 1. Screen "Screen MGA 1" "" "" "" "Screen MGA 2" Screen "Screen MGA 2" "" "" "Screen MGA 1" "" # Each InputDevice line specifies an InputDevice section name and # optionally some options to specify the way the device is to be # used. Those options include "CorePointer", "CoreKeyboard" and # "SendCoreEvents". In this example, "Mouse1" is the core pointer, # and "Mouse2" is an extended input device that also generates core # pointer events (i.e., both mice will move the standard pointer). InputDevice "Mouse1" "CorePointer" InputDevice "Mouse2" "SendCoreEvents" InputDevice "Keyboard1" "CoreKeyboard" EndSection Section "ServerLayout" Identifier "another layout" Screen "Screen 1" Screen "Screen MGA 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection Section "ServerLayout" Identifier "simple layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection xorg-server-1.17.1/hw/xfree86/modes/0000775000175100017510000000000012466505445014120 500000000000000xorg-server-1.17.1/hw/xfree86/modes/Makefile.am0000664000175100017510000000122612414702051016056 00000000000000noinst_LTLIBRARIES = libxf86modes.la if DGA DGA_SRCS = xf86DiDGA.c endif libxf86modes_la_SOURCES = \ xf86Crtc.c \ xf86Crtc.h \ xf86Cursors.c \ xf86cvt.c \ xf86gtf.c \ xf86EdidModes.c \ xf86Modes.c \ xf86Modes.h \ xf86RandR12.c \ xf86RandR12.h \ xf86Rotate.c \ $(DGA_SRCS) AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ -I$(srcdir)/../vgahw -I$(srcdir)/../ramdac \ -I$(srcdir)/../dixmods/extmod sdk_HEADERS = \ xf86Crtc.h \ xf86Modes.h \ xf86RandR12.h AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) xorg-server-1.17.1/hw/xfree86/modes/xf86Cursors.c0000664000175100017510000005237612366220413016361 00000000000000/* * Copyright © 2007 Keith Packard * Copyright © 2010-2011 Aaron Plattner * * 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. */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include #include #include #include #include "xf86.h" #include "xf86DDC.h" #include "xf86Crtc.h" #include "xf86Modes.h" #include "xf86RandR12.h" #include "xf86CursorPriv.h" #include "X11/extensions/render.h" #include "X11/extensions/dpmsconst.h" #include "X11/Xatom.h" #include "picturestr.h" #include "cursorstr.h" #include "inputstr.h" /* * Returns the rotation being performed by the server. If the driver indicates * that it's handling the screen transform, then this returns RR_Rotate_0. */ static Rotation xf86_crtc_cursor_rotation(xf86CrtcPtr crtc) { if (crtc->driverIsPerformingTransform) return RR_Rotate_0; return crtc->rotation; } /* * Given a screen coordinate, rotate back to a cursor source coordinate */ static void xf86_crtc_rotate_coord(Rotation rotation, int width, int height, int x_dst, int y_dst, int *x_src, int *y_src) { int t; switch (rotation & 0xf) { case RR_Rotate_0: break; case RR_Rotate_90: t = x_dst; x_dst = height - y_dst - 1; y_dst = t; break; case RR_Rotate_180: x_dst = width - x_dst - 1; y_dst = height - y_dst - 1; break; case RR_Rotate_270: t = x_dst; x_dst = y_dst; y_dst = width - t - 1; break; } if (rotation & RR_Reflect_X) x_dst = width - x_dst - 1; if (rotation & RR_Reflect_Y) y_dst = height - y_dst - 1; *x_src = x_dst; *y_src = y_dst; } /* * Given a cursor source coordinate, rotate to a screen coordinate */ static void xf86_crtc_rotate_coord_back(Rotation rotation, int width, int height, int x_dst, int y_dst, int *x_src, int *y_src) { int t; if (rotation & RR_Reflect_X) x_dst = width - x_dst - 1; if (rotation & RR_Reflect_Y) y_dst = height - y_dst - 1; switch (rotation & 0xf) { case RR_Rotate_0: break; case RR_Rotate_90: t = x_dst; x_dst = y_dst; y_dst = width - t - 1; break; case RR_Rotate_180: x_dst = width - x_dst - 1; y_dst = height - y_dst - 1; break; case RR_Rotate_270: t = x_dst; x_dst = height - y_dst - 1; y_dst = t; break; } *x_src = x_dst; *y_src = y_dst; } struct cursor_bit { CARD8 *byte; char bitpos; }; /* * Convert an x coordinate to a position within the cursor bitmap */ static struct cursor_bit cursor_bitpos(CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask) { const int flags = cursor_info->Flags; const Bool interleaved = ! !(flags & (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64)); const int width = cursor_info->MaxWidth; const int height = cursor_info->MaxHeight; const int stride = interleaved ? width / 4 : width / 8; struct cursor_bit ret; image += y * stride; if (flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) mask = !mask; if (flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) x = (x & ~3) | (3 - (x & 3)); if (((flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) == 0) == (X_BYTE_ORDER == X_BIG_ENDIAN)) x = (x & ~7) | (7 - (x & 7)); if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1) x = (x << 1) + mask; else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8) x = ((x & ~7) << 1) | (mask << 3) | (x & 7); else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16) x = ((x & ~15) << 1) | (mask << 4) | (x & 15); else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32) x = ((x & ~31) << 1) | (mask << 5) | (x & 31); else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64) x = ((x & ~63) << 1) | (mask << 6) | (x & 63); else if (mask) image += stride * height; ret.byte = image + (x / 8); ret.bitpos = x & 7; return ret; } /* * Fetch one bit from a cursor bitmap */ static CARD8 get_bit(CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask) { struct cursor_bit bit = cursor_bitpos(image, cursor_info, x, y, mask); return (*bit.byte >> bit.bitpos) & 1; } /* * Set one bit in a cursor bitmap */ static void set_bit(CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask) { struct cursor_bit bit = cursor_bitpos(image, cursor_info, x, y, mask); *bit.byte |= 1 << bit.bitpos; } /* * Wrappers to deal with API compatibility with drivers that don't expose * load_cursor_*_check */ static inline Bool xf86_driver_has_load_cursor_image(xf86CrtcPtr crtc) { return crtc->funcs->load_cursor_image_check || crtc->funcs->load_cursor_image; } static inline Bool xf86_driver_has_load_cursor_argb(xf86CrtcPtr crtc) { return crtc->funcs->load_cursor_argb_check || crtc->funcs->load_cursor_argb; } static inline Bool xf86_driver_load_cursor_image(xf86CrtcPtr crtc, CARD8 *cursor_image) { if (crtc->funcs->load_cursor_image_check) return crtc->funcs->load_cursor_image_check(crtc, cursor_image); crtc->funcs->load_cursor_image(crtc, cursor_image); return TRUE; } static inline Bool xf86_driver_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *cursor_argb) { if (crtc->funcs->load_cursor_argb_check) return crtc->funcs->load_cursor_argb_check(crtc, cursor_argb); crtc->funcs->load_cursor_argb(crtc, cursor_argb); return TRUE; } /* * Load a two color cursor into a driver that supports only ARGB cursors */ static Bool xf86_crtc_convert_cursor_to_argb(xf86CrtcPtr crtc, unsigned char *src) { ScrnInfoPtr scrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; CARD32 *cursor_image = (CARD32 *) xf86_config->cursor_image; int x, y; int xin, yin; int flags = cursor_info->Flags; CARD32 bits; const Rotation rotation = xf86_crtc_cursor_rotation(crtc); #ifdef ARGB_CURSOR crtc->cursor_argb = FALSE; #endif for (y = 0; y < cursor_info->MaxHeight; y++) for (x = 0; x < cursor_info->MaxWidth; x++) { xf86_crtc_rotate_coord(rotation, cursor_info->MaxWidth, cursor_info->MaxHeight, x, y, &xin, &yin); if (get_bit(src, cursor_info, xin, yin, TRUE) == ((flags & HARDWARE_CURSOR_INVERT_MASK) == 0)) { if (get_bit(src, cursor_info, xin, yin, FALSE)) bits = xf86_config->cursor_fg; else bits = xf86_config->cursor_bg; } else bits = 0; cursor_image[y * cursor_info->MaxWidth + x] = bits; } return xf86_driver_load_cursor_argb(crtc, cursor_image); } /* * Set the colors for a two-color cursor (ignore for ARGB cursors) */ static void xf86_set_cursor_colors(ScrnInfoPtr scrn, int bg, int fg) { ScreenPtr screen = scrn->pScreen; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); CursorPtr cursor = xf86_config->cursor; int c; CARD8 *bits = cursor ? dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen) : NULL; /* Save ARGB versions of these colors */ xf86_config->cursor_fg = (CARD32) fg | 0xff000000; xf86_config->cursor_bg = (CARD32) bg | 0xff000000; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->enabled && !crtc->cursor_argb) { if (xf86_driver_has_load_cursor_image(crtc)) crtc->funcs->set_cursor_colors(crtc, bg, fg); else if (bits) xf86_crtc_convert_cursor_to_argb(crtc, bits); } } } static void xf86_crtc_hide_cursor(xf86CrtcPtr crtc) { if (crtc->cursor_shown) { crtc->funcs->hide_cursor(crtc); crtc->cursor_shown = FALSE; } } void xf86_hide_cursors(ScrnInfoPtr scrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; xf86_config->cursor_on = FALSE; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->enabled) xf86_crtc_hide_cursor(crtc); } } static void xf86_crtc_show_cursor(xf86CrtcPtr crtc) { if (!crtc->cursor_shown && crtc->cursor_in_range) { crtc->funcs->show_cursor(crtc); crtc->cursor_shown = TRUE; } } void xf86_show_cursors(ScrnInfoPtr scrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; xf86_config->cursor_on = TRUE; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->enabled) xf86_crtc_show_cursor(crtc); } } void xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y) { ScrnInfoPtr scrn = crtc->scrn; ScreenPtr screen = scrn->pScreen; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&screen->devPrivates, xf86CursorScreenKey); struct pict_f_vector v; int dx, dy; v.v[0] = (*x + ScreenPriv->HotX) + 0.5; v.v[1] = (*y + ScreenPriv->HotY) + 0.5; v.v[2] = 1; pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &v); /* cursor will have 0.5 added to it already so floor is sufficent */ *x = floor(v.v[0]); *y = floor(v.v[1]); /* * Transform position of cursor upper left corner */ xf86_crtc_rotate_coord_back(crtc->rotation, cursor_info->MaxWidth, cursor_info->MaxHeight, ScreenPriv->HotX, ScreenPriv->HotY, &dx, &dy); *x -= dx; *y -= dy; } static void xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr scrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; DisplayModePtr mode = &crtc->mode; Bool in_range; /* * Transform position of cursor on screen */ if (crtc->transform_in_use && !crtc->driverIsPerformingTransform) xf86CrtcTransformCursorPos(crtc, &x, &y); else { x -= crtc->x; y -= crtc->y; } /* * Disable the cursor when it is outside the viewport */ in_range = TRUE; if (x >= mode->HDisplay || y >= mode->VDisplay || x <= -cursor_info->MaxWidth || y <= -cursor_info->MaxHeight) { in_range = FALSE; x = 0; y = 0; } crtc->cursor_in_range = in_range; if (in_range) { crtc->funcs->set_cursor_position(crtc, x, y); xf86_crtc_show_cursor(crtc); } else xf86_crtc_hide_cursor(crtc); } static void xf86_set_cursor_position(ScrnInfoPtr scrn, int x, int y) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; /* undo what xf86HWCurs did to the coordinates */ x += scrn->frameX0; y += scrn->frameY0; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->enabled) xf86_crtc_set_cursor_position(crtc, x, y); } } /* * Load a two-color cursor into a crtc, performing rotation as needed */ static Bool xf86_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *src) { ScrnInfoPtr scrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; CARD8 *cursor_image; const Rotation rotation = xf86_crtc_cursor_rotation(crtc); #ifdef ARGB_CURSOR crtc->cursor_argb = FALSE; #endif if (rotation == RR_Rotate_0) cursor_image = src; else { int x, y; int xin, yin; int stride = cursor_info->MaxWidth >> 2; cursor_image = xf86_config->cursor_image; memset(cursor_image, 0, cursor_info->MaxHeight * stride); for (y = 0; y < cursor_info->MaxHeight; y++) for (x = 0; x < cursor_info->MaxWidth; x++) { xf86_crtc_rotate_coord(rotation, cursor_info->MaxWidth, cursor_info->MaxHeight, x, y, &xin, &yin); if (get_bit(src, cursor_info, xin, yin, FALSE)) set_bit(cursor_image, cursor_info, x, y, FALSE); if (get_bit(src, cursor_info, xin, yin, TRUE)) set_bit(cursor_image, cursor_info, x, y, TRUE); } } return xf86_driver_load_cursor_image(crtc, cursor_image); } /* * Load a cursor image into all active CRTCs */ static Bool xf86_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->enabled) { if (xf86_driver_has_load_cursor_image(crtc)) { if (!xf86_crtc_load_cursor_image(crtc, src)) return FALSE; } else if (xf86_driver_has_load_cursor_argb(crtc)) { if (!xf86_crtc_convert_cursor_to_argb(crtc, src)) return FALSE; } else return FALSE; } } return TRUE; } static Bool xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; cursor = RefCursor(cursor); if (xf86_config->cursor) FreeCursor(xf86_config->cursor, None); xf86_config->cursor = cursor; if (cursor->bits->width > cursor_info->MaxWidth || cursor->bits->height > cursor_info->MaxHeight) return FALSE; return TRUE; } static Bool xf86_use_hw_cursor_argb(ScreenPtr screen, CursorPtr cursor) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; cursor = RefCursor(cursor); if (xf86_config->cursor) FreeCursor(xf86_config->cursor, None); xf86_config->cursor = cursor; /* Make sure ARGB support is available */ if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0) return FALSE; if (cursor->bits->width > cursor_info->MaxWidth || cursor->bits->height > cursor_info->MaxHeight) return FALSE; return TRUE; } static Bool xf86_crtc_load_cursor_argb(xf86CrtcPtr crtc, CursorPtr cursor) { ScrnInfoPtr scrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; CARD32 *cursor_image = (CARD32 *) xf86_config->cursor_image; CARD32 *cursor_source = (CARD32 *) cursor->bits->argb; int x, y; int xin, yin; CARD32 bits; int source_width = cursor->bits->width; int source_height = cursor->bits->height; int image_width = cursor_info->MaxWidth; int image_height = cursor_info->MaxHeight; const Rotation rotation = xf86_crtc_cursor_rotation(crtc); for (y = 0; y < image_height; y++) for (x = 0; x < image_width; x++) { xf86_crtc_rotate_coord(rotation, image_width, image_height, x, y, &xin, &yin); if (xin < source_width && yin < source_height) bits = cursor_source[yin * source_width + xin]; else bits = 0; cursor_image[y * image_width + x] = bits; } return xf86_driver_load_cursor_argb(crtc, cursor_image); } static Bool xf86_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->enabled) if (!xf86_crtc_load_cursor_argb(crtc, cursor)) return FALSE; } return TRUE; } Bool xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info; cursor_info = xf86CreateCursorInfoRec(); if (!cursor_info) return FALSE; xf86_config->cursor_image = malloc(max_width * max_height * 4); if (!xf86_config->cursor_image) { xf86DestroyCursorInfoRec(cursor_info); return FALSE; } xf86_config->cursor_info = cursor_info; cursor_info->MaxWidth = max_width; cursor_info->MaxHeight = max_height; cursor_info->Flags = flags; cursor_info->SetCursorColors = xf86_set_cursor_colors; cursor_info->SetCursorPosition = xf86_set_cursor_position; cursor_info->LoadCursorImageCheck = xf86_load_cursor_image; cursor_info->HideCursor = xf86_hide_cursors; cursor_info->ShowCursor = xf86_show_cursors; cursor_info->UseHWCursor = xf86_use_hw_cursor; #ifdef ARGB_CURSOR if (flags & HARDWARE_CURSOR_ARGB) { cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb; cursor_info->LoadCursorARGBCheck = xf86_load_cursor_argb; } #endif xf86_config->cursor = NULL; xf86_hide_cursors(scrn); return xf86InitCursor(screen, cursor_info); } /** * Called when anything on the screen is reconfigured. * * Reloads cursor images as needed, then adjusts cursor positions * @note We assume that all hardware cursors to be loaded have already been * found to be usable by the hardware. */ void xf86_reload_cursors(ScreenPtr screen) { ScrnInfoPtr scrn; xf86CrtcConfigPtr xf86_config; xf86CursorInfoPtr cursor_info; CursorPtr cursor; int x, y; xf86CursorScreenPtr cursor_screen_priv; /* initial mode setting will not have set a screen yet. May be called before the devices are initialised. */ if (!screen || !inputInfo.pointer) return; cursor_screen_priv = dixLookupPrivate(&screen->devPrivates, xf86CursorScreenKey); /* return if HW cursor is inactive, to avoid displaying two cursors */ if (!cursor_screen_priv || !cursor_screen_priv->isUp) return; scrn = xf86ScreenToScrn(screen); xf86_config = XF86_CRTC_CONFIG_PTR(scrn); /* make sure the cursor code has been initialized */ cursor_info = xf86_config->cursor_info; if (!cursor_info) return; cursor = xf86_config->cursor; GetSpritePosition(inputInfo.pointer, &x, &y); if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) (*cursor_info->HideCursor) (scrn); if (cursor) { void *src = dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen); #ifdef ARGB_CURSOR if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info)) xf86DriverLoadCursorARGB(cursor_info, cursor); else if (src) #endif xf86DriverLoadCursorImage(cursor_info, src); x += scrn->frameX0 + cursor_screen_priv->HotX; y += scrn->frameY0 + cursor_screen_priv->HotY; (*cursor_info->SetCursorPosition) (scrn, x, y); } } /** * Clean up CRTC-based cursor code */ void xf86_cursors_fini(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); if (xf86_config->cursor_info) { xf86DestroyCursorInfoRec(xf86_config->cursor_info); xf86_config->cursor_info = NULL; } free(xf86_config->cursor_image); xf86_config->cursor_image = NULL; if (xf86_config->cursor) { FreeCursor(xf86_config->cursor, None); xf86_config->cursor = NULL; } } xorg-server-1.17.1/hw/xfree86/modes/xf86Modes.h0000664000175100017510000001066612274325511015774 00000000000000/* * Copyright © 2006 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt * */ #ifndef _XF86MODES_H_ #define _XF86MODES_H_ #include #include #include #include "xf86.h" #include "xorgVersion.h" #include "edid.h" #include "xf86Parser.h" extern _X_EXPORT double xf86ModeHSync(const DisplayModeRec * mode); extern _X_EXPORT double xf86ModeVRefresh(const DisplayModeRec * mode); extern _X_EXPORT unsigned int xf86ModeBandwidth(DisplayModePtr mode, int depth); extern _X_EXPORT int xf86ModeWidth(const DisplayModeRec * mode, Rotation rotation); extern _X_EXPORT int xf86ModeHeight(const DisplayModeRec * mode, Rotation rotation); extern _X_EXPORT DisplayModePtr xf86DuplicateMode(const DisplayModeRec * pMode); extern _X_EXPORT DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList); extern _X_EXPORT void xf86SetModeDefaultName(DisplayModePtr mode); extern _X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags); extern _X_EXPORT Bool xf86ModesEqual(const DisplayModeRec * pMode1, const DisplayModeRec * pMode2); extern _X_EXPORT void xf86PrintModeline(int scrnIndex, DisplayModePtr mode); extern _X_EXPORT DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new); extern _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); extern _X_EXPORT DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); extern _X_EXPORT DisplayModePtr xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins); extern _X_EXPORT Bool xf86ModeIsReduced(const DisplayModeRec * mode); extern _X_EXPORT void xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, int flags); extern _X_EXPORT void xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList, int *min, int *max, int n_ranges); extern _X_EXPORT void xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList, int maxX, int maxY, int maxPitch); extern _X_EXPORT void xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, MonPtr mon); extern _X_EXPORT void xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList, unsigned int bandwidth, int depth); extern _X_EXPORT void xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList); extern _X_EXPORT void xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr * modeList, Bool verbose); extern _X_EXPORT DisplayModePtr xf86PruneDuplicateModes(DisplayModePtr modes); extern _X_EXPORT void xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList); extern _X_EXPORT DisplayModePtr xf86GetMonitorModes(ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor); extern _X_EXPORT DisplayModePtr xf86GetDefaultModes(void); extern _X_EXPORT void xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec *mode); extern _X_EXPORT void xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC); #endif /* _XF86MODES_H_ */ xorg-server-1.17.1/hw/xfree86/modes/xf86cvt.c0000664000175100017510000002363312456571574015530 00000000000000/* * Copyright 2005-2006 Luc Verhaegen. * * 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. */ /* * The reason for having this function in a file of its own is * so that ../utils/cvt/cvt can link to it, and that xf86CVTMode * code is shared directly. */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include "xf86.h" #include "xf86Modes.h" #include /* * Generate a CVT standard mode from HDisplay, VDisplay and VRefresh. * * These calculations are stolen from the CVT calculation spreadsheet written * by Graham Loveridge. He seems to be claiming no copyright and there seems to * be no license attached to this. He apparently just wants to see his name * mentioned. * * This file can be found at http://www.vesa.org/Public/CVT/CVTd6r1.xls * * Comments and structure corresponds to the comments and structure of the xls. * This should ease importing of future changes to the standard (not very * likely though). * * About margins; i'm sure that they are to be the bit between HDisplay and * HBlankStart, HBlankEnd and HTotal, VDisplay and VBlankStart, VBlankEnd and * VTotal, where the overscan colour is shown. FB seems to call _all_ blanking * outside sync "margin" for some reason. Since we prefer seeing proper * blanking instead of the overscan colour, and since the Crtc* values will * probably get altered after us, we will disable margins altogether. With * these calculations, Margins will plainly expand H/VDisplay, and we don't * want that. -- libv * */ DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced) { DisplayModeRec *Mode = xnfcalloc(1, sizeof(DisplayModeRec)); /* 1) top/bottom margin size (% of height) - default: 1.8 */ #define CVT_MARGIN_PERCENTAGE 1.8 /* 2) character cell horizontal granularity (pixels) - default 8 */ #define CVT_H_GRANULARITY 8 /* 4) Minimum vertical porch (lines) - default 3 */ #define CVT_MIN_V_PORCH 3 /* 4) Minimum number of vertical back porch lines - default 6 */ #define CVT_MIN_V_BPORCH 6 /* Pixel Clock step (kHz) */ #define CVT_CLOCK_STEP 250 Bool Margins = FALSE; float VFieldRate, HPeriod; int HDisplayRnd, HMargin; int VDisplayRnd, VMargin, VSync; float Interlace; /* Please rename this */ char *tmp; /* CVT default is 60.0Hz */ if (!VRefresh) VRefresh = 60.0; /* 1. Required field rate */ if (Interlaced) VFieldRate = VRefresh * 2; else VFieldRate = VRefresh; /* 2. Horizontal pixels */ HDisplayRnd = HDisplay - (HDisplay % CVT_H_GRANULARITY); /* 3. Determine left and right borders */ if (Margins) { /* right margin is actually exactly the same as left */ HMargin = (((float) HDisplayRnd) * CVT_MARGIN_PERCENTAGE / 100.0); HMargin -= HMargin % CVT_H_GRANULARITY; } else HMargin = 0; /* 4. Find total active pixels */ Mode->HDisplay = HDisplayRnd + 2 * HMargin; /* 5. Find number of lines per field */ if (Interlaced) VDisplayRnd = VDisplay / 2; else VDisplayRnd = VDisplay; /* 6. Find top and bottom margins */ /* nope. */ if (Margins) /* top and bottom margins are equal again. */ VMargin = (((float) VDisplayRnd) * CVT_MARGIN_PERCENTAGE / 100.0); else VMargin = 0; Mode->VDisplay = VDisplay + 2 * VMargin; /* 7. Interlace */ if (Interlaced) Interlace = 0.5; else Interlace = 0.0; /* Determine VSync Width from aspect ratio */ if (!(VDisplay % 3) && ((VDisplay * 4 / 3) == HDisplay)) VSync = 4; else if (!(VDisplay % 9) && ((VDisplay * 16 / 9) == HDisplay)) VSync = 5; else if (!(VDisplay % 10) && ((VDisplay * 16 / 10) == HDisplay)) VSync = 6; else if (!(VDisplay % 4) && ((VDisplay * 5 / 4) == HDisplay)) VSync = 7; else if (!(VDisplay % 9) && ((VDisplay * 15 / 9) == HDisplay)) VSync = 7; else /* Custom */ VSync = 10; if (!Reduced) { /* simplified GTF calculation */ /* 4) Minimum time of vertical sync + back porch interval (µs) * default 550.0 */ #define CVT_MIN_VSYNC_BP 550.0 /* 3) Nominal HSync width (% of line period) - default 8 */ #define CVT_HSYNC_PERCENTAGE 8 float HBlankPercentage; int VSyncAndBackPorch, VBackPorch; int HBlank; /* 8. Estimated Horizontal period */ HPeriod = ((float) (1000000.0 / VFieldRate - CVT_MIN_VSYNC_BP)) / (VDisplayRnd + 2 * VMargin + CVT_MIN_V_PORCH + Interlace); /* 9. Find number of lines in sync + backporch */ if (((int) (CVT_MIN_VSYNC_BP / HPeriod) + 1) < (VSync + CVT_MIN_V_PORCH)) VSyncAndBackPorch = VSync + CVT_MIN_V_PORCH; else VSyncAndBackPorch = (int) (CVT_MIN_VSYNC_BP / HPeriod) + 1; /* 10. Find number of lines in back porch */ VBackPorch = VSyncAndBackPorch - VSync; (void) VBackPorch; /* 11. Find total number of lines in vertical field */ Mode->VTotal = VDisplayRnd + 2 * VMargin + VSyncAndBackPorch + Interlace + CVT_MIN_V_PORCH; /* 5) Definition of Horizontal blanking time limitation */ /* Gradient (%/kHz) - default 600 */ #define CVT_M_FACTOR 600 /* Offset (%) - default 40 */ #define CVT_C_FACTOR 40 /* Blanking time scaling factor - default 128 */ #define CVT_K_FACTOR 128 /* Scaling factor weighting - default 20 */ #define CVT_J_FACTOR 20 #define CVT_M_PRIME CVT_M_FACTOR * CVT_K_FACTOR / 256 #define CVT_C_PRIME (CVT_C_FACTOR - CVT_J_FACTOR) * CVT_K_FACTOR / 256 + \ CVT_J_FACTOR /* 12. Find ideal blanking duty cycle from formula */ HBlankPercentage = CVT_C_PRIME - CVT_M_PRIME * HPeriod / 1000.0; /* 13. Blanking time */ if (HBlankPercentage < 20) HBlankPercentage = 20; HBlank = Mode->HDisplay * HBlankPercentage / (100.0 - HBlankPercentage); HBlank -= HBlank % (2 * CVT_H_GRANULARITY); /* 14. Find total number of pixels in a line. */ Mode->HTotal = Mode->HDisplay + HBlank; /* Fill in HSync values */ Mode->HSyncEnd = Mode->HDisplay + HBlank / 2; Mode->HSyncStart = Mode->HSyncEnd - (Mode->HTotal * CVT_HSYNC_PERCENTAGE) / 100; Mode->HSyncStart += CVT_H_GRANULARITY - Mode->HSyncStart % CVT_H_GRANULARITY; /* Fill in VSync values */ Mode->VSyncStart = Mode->VDisplay + CVT_MIN_V_PORCH; Mode->VSyncEnd = Mode->VSyncStart + VSync; } else { /* Reduced blanking */ /* Minimum vertical blanking interval time (µs) - default 460 */ #define CVT_RB_MIN_VBLANK 460.0 /* Fixed number of clocks for horizontal sync */ #define CVT_RB_H_SYNC 32.0 /* Fixed number of clocks for horizontal blanking */ #define CVT_RB_H_BLANK 160.0 /* Fixed number of lines for vertical front porch - default 3 */ #define CVT_RB_VFPORCH 3 int VBILines; /* 8. Estimate Horizontal period. */ HPeriod = ((float) (1000000.0 / VFieldRate - CVT_RB_MIN_VBLANK)) / (VDisplayRnd + 2 * VMargin); /* 9. Find number of lines in vertical blanking */ VBILines = ((float) CVT_RB_MIN_VBLANK) / HPeriod + 1; /* 10. Check if vertical blanking is sufficient */ if (VBILines < (CVT_RB_VFPORCH + VSync + CVT_MIN_V_BPORCH)) VBILines = CVT_RB_VFPORCH + VSync + CVT_MIN_V_BPORCH; /* 11. Find total number of lines in vertical field */ Mode->VTotal = VDisplayRnd + 2 * VMargin + Interlace + VBILines; /* 12. Find total number of pixels in a line */ Mode->HTotal = Mode->HDisplay + CVT_RB_H_BLANK; /* Fill in HSync values */ Mode->HSyncEnd = Mode->HDisplay + CVT_RB_H_BLANK / 2; Mode->HSyncStart = Mode->HSyncEnd - CVT_RB_H_SYNC; /* Fill in VSync values */ Mode->VSyncStart = Mode->VDisplay + CVT_RB_VFPORCH; Mode->VSyncEnd = Mode->VSyncStart + VSync; } /* 15/13. Find pixel clock frequency (kHz for xf86) */ Mode->Clock = Mode->HTotal * 1000.0 / HPeriod; Mode->Clock -= Mode->Clock % CVT_CLOCK_STEP; /* 16/14. Find actual Horizontal Frequency (kHz) */ Mode->HSync = ((float) Mode->Clock) / ((float) Mode->HTotal); /* 17/15. Find actual Field rate */ Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / ((float) (Mode->HTotal * Mode->VTotal)); /* 18/16. Find actual vertical frame frequency */ /* ignore - just set the mode flag for interlaced */ if (Interlaced) Mode->VTotal *= 2; XNFasprintf(&tmp, "%dx%d", HDisplay, VDisplay); Mode->name = tmp; if (Reduced) Mode->Flags |= V_PHSYNC | V_NVSYNC; else Mode->Flags |= V_NHSYNC | V_PVSYNC; if (Interlaced) Mode->Flags |= V_INTERLACE; return Mode; } xorg-server-1.17.1/hw/xfree86/modes/xf86DiDGA.c0000664000175100017510000001355412366220413015564 00000000000000/* * 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. */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include "xf86.h" #include "xf86DDC.h" #include "xf86_OSproc.h" #include "dgaproc.h" #include "xf86Crtc.h" #include "xf86Modes.h" #include "gcstruct.h" #include "scrnintstr.h" #include "windowstr.h" static Bool xf86_dga_get_modes(ScreenPtr pScreen) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); DGAModePtr modes, mode; DisplayModePtr display_mode; int bpp = scrn->bitsPerPixel >> 3; int num; num = 0; display_mode = scrn->modes; while (display_mode) { num++; display_mode = display_mode->next; if (display_mode == scrn->modes) break; } if (!num) return FALSE; modes = malloc(num * sizeof(DGAModeRec)); if (!modes) return FALSE; num = 0; display_mode = scrn->modes; while (display_mode) { mode = modes + num++; mode->mode = display_mode; mode->flags = DGA_CONCURRENT_ACCESS; if (display_mode->Flags & V_DBLSCAN) mode->flags |= DGA_DOUBLESCAN; if (display_mode->Flags & V_INTERLACE) mode->flags |= DGA_INTERLACED; mode->byteOrder = scrn->imageByteOrder; mode->depth = scrn->depth; mode->bitsPerPixel = scrn->bitsPerPixel; mode->red_mask = scrn->mask.red; mode->green_mask = scrn->mask.green; mode->blue_mask = scrn->mask.blue; mode->visualClass = (bpp == 1) ? PseudoColor : TrueColor; mode->viewportWidth = display_mode->HDisplay; mode->viewportHeight = display_mode->VDisplay; mode->xViewportStep = (bpp == 3) ? 2 : 1; mode->yViewportStep = 1; mode->viewportFlags = DGA_FLIP_RETRACE; mode->offset = 0; mode->address = 0; mode->imageWidth = mode->viewportWidth; mode->imageHeight = mode->viewportHeight; mode->bytesPerScanline = (mode->imageWidth * scrn->bitsPerPixel) >> 3; mode->pixmapWidth = mode->imageWidth; mode->pixmapHeight = mode->imageHeight; mode->maxViewportX = 0; mode->maxViewportY = 0; display_mode = display_mode->next; if (display_mode == scrn->modes) break; } free(xf86_config->dga_modes); xf86_config->dga_nmode = num; xf86_config->dga_modes = modes; return TRUE; } static Bool xf86_dga_set_mode(ScrnInfoPtr scrn, DGAModePtr display_mode) { ScreenPtr pScreen = scrn->pScreen; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); if (!display_mode) { if (xf86_config->dga_save_mode) { xf86SwitchMode(pScreen, xf86_config->dga_save_mode); xf86_config->dga_save_mode = NULL; } } else { if (!xf86_config->dga_save_mode) { xf86_config->dga_save_mode = scrn->currentMode; xf86SwitchMode(pScreen, display_mode->mode); } } return TRUE; } static int xf86_dga_get_viewport(ScrnInfoPtr scrn) { return 0; } static void xf86_dga_set_viewport(ScrnInfoPtr scrn, int x, int y, int flags) { scrn->AdjustFrame(scrn, x, y); } static Bool xf86_dga_open_framebuffer(ScrnInfoPtr scrn, char **name, unsigned char **mem, int *size, int *offset, int *flags) { return FALSE; } static void xf86_dga_close_framebuffer(ScrnInfoPtr scrn) { } static DGAFunctionRec xf86_dga_funcs = { xf86_dga_open_framebuffer, xf86_dga_close_framebuffer, xf86_dga_set_mode, xf86_dga_set_viewport, xf86_dga_get_viewport, NULL, NULL, NULL, NULL }; Bool xf86DiDGAReInit(ScreenPtr pScreen) { return TRUE; } Bool _xf86_di_dga_reinit_internal(ScreenPtr pScreen) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); if (!DGAScreenAvailable(pScreen)) return TRUE; if (!xf86_dga_get_modes(pScreen)) return FALSE; return DGAReInitModes(pScreen, xf86_config->dga_modes, xf86_config->dga_nmode); } Bool xf86DiDGAInit(ScreenPtr pScreen, unsigned long dga_address) { return TRUE; } Bool _xf86_di_dga_init_internal(ScreenPtr pScreen) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86_config->dga_flags = 0; xf86_config->dga_address = 0; xf86_config->dga_width = 0; xf86_config->dga_height = 0; xf86_config->dga_stride = 0; if (!xf86_dga_get_modes(pScreen)) return FALSE; return DGAInit(pScreen, &xf86_dga_funcs, xf86_config->dga_modes, xf86_config->dga_nmode); } xorg-server-1.17.1/hw/xfree86/modes/xf86Modes.c0000664000175100017510000005407512366220413015766 00000000000000/* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include "xf86Modes.h" #include "xf86Priv.h" extern XF86ConfigPtr xf86configptr; /** * Calculates the horizontal sync rate of a mode. */ double xf86ModeHSync(const DisplayModeRec * mode) { double hsync = 0.0; if (mode->HSync > 0.0) hsync = mode->HSync; else if (mode->HTotal > 0) hsync = (float) mode->Clock / (float) mode->HTotal; return hsync; } /** * Calculates the vertical refresh rate of a mode. */ double xf86ModeVRefresh(const DisplayModeRec * mode) { double refresh = 0.0; if (mode->VRefresh > 0.0) refresh = mode->VRefresh; else if (mode->HTotal > 0 && mode->VTotal > 0) { refresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal; if (mode->Flags & V_INTERLACE) refresh *= 2.0; if (mode->Flags & V_DBLSCAN) refresh /= 2.0; if (mode->VScan > 1) refresh /= (float) (mode->VScan); } return refresh; } int xf86ModeWidth(const DisplayModeRec * mode, Rotation rotation) { switch (rotation & 0xf) { case RR_Rotate_0: case RR_Rotate_180: return mode->HDisplay; case RR_Rotate_90: case RR_Rotate_270: return mode->VDisplay; default: return 0; } } int xf86ModeHeight(const DisplayModeRec * mode, Rotation rotation) { switch (rotation & 0xf) { case RR_Rotate_0: case RR_Rotate_180: return mode->VDisplay; case RR_Rotate_90: case RR_Rotate_270: return mode->HDisplay; default: return 0; } } /** Calculates the memory bandwidth (in MiB/sec) of a mode. */ unsigned int xf86ModeBandwidth(DisplayModePtr mode, int depth) { float a_active, a_total, active_percent, pixels_per_second; int bytes_per_pixel = bits_to_bytes(depth); if (!mode->HTotal || !mode->VTotal || !mode->Clock) return 0; a_active = mode->HDisplay * mode->VDisplay; a_total = mode->HTotal * mode->VTotal; active_percent = a_active / a_total; pixels_per_second = active_percent * mode->Clock * 1000.0; return (unsigned int) (pixels_per_second * bytes_per_pixel / (1024 * 1024)); } /** Sets a default mode name of x on a mode. */ void xf86SetModeDefaultName(DisplayModePtr mode) { Bool interlaced = ! !(mode->Flags & V_INTERLACE); char *tmp; free((void *) mode->name); XNFasprintf(&tmp, "%dx%d%s", mode->HDisplay, mode->VDisplay, interlaced ? "i" : ""); mode->name = tmp; } /* * xf86SetModeCrtc * * Initialises the Crtc parameters for a mode. The initialisation includes * adjustments for interlaced and double scan modes. */ void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) { if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN)) return; p->CrtcHDisplay = p->HDisplay; p->CrtcHSyncStart = p->HSyncStart; p->CrtcHSyncEnd = p->HSyncEnd; p->CrtcHTotal = p->HTotal; p->CrtcHSkew = p->HSkew; p->CrtcVDisplay = p->VDisplay; p->CrtcVSyncStart = p->VSyncStart; p->CrtcVSyncEnd = p->VSyncEnd; p->CrtcVTotal = p->VTotal; if (p->Flags & V_INTERLACE) { if (adjustFlags & INTERLACE_HALVE_V) { p->CrtcVDisplay /= 2; p->CrtcVSyncStart /= 2; p->CrtcVSyncEnd /= 2; p->CrtcVTotal /= 2; } /* Force interlaced modes to have an odd VTotal */ /* maybe we should only do this when INTERLACE_HALVE_V is set? */ p->CrtcVTotal |= 1; } if (p->Flags & V_DBLSCAN) { p->CrtcVDisplay *= 2; p->CrtcVSyncStart *= 2; p->CrtcVSyncEnd *= 2; p->CrtcVTotal *= 2; } if (p->VScan > 1) { p->CrtcVDisplay *= p->VScan; p->CrtcVSyncStart *= p->VScan; p->CrtcVSyncEnd *= p->VScan; p->CrtcVTotal *= p->VScan; } p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay); p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal); p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay); p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal); p->CrtcHAdjusted = FALSE; 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. */ DisplayModePtr xf86DuplicateMode(const DisplayModeRec * pMode) { DisplayModePtr pNew; pNew = xnfalloc(sizeof(DisplayModeRec)); *pNew = *pMode; pNew->next = NULL; pNew->prev = NULL; if (pMode->name == NULL) xf86SetModeDefaultName(pNew); else pNew->name = xnfstrdup(pMode->name); return pNew; } /** * Duplicates every mode in the given list and returns a pointer to the first * mode. * * \param modeList doubly-linked mode list */ DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList) { DisplayModePtr first = NULL, last = NULL; DisplayModePtr mode; for (mode = modeList; mode != NULL; mode = mode->next) { DisplayModePtr new; new = xf86DuplicateMode(mode); /* Insert pNew into modeList */ if (last) { last->next = new; new->prev = last; } else { first = new; new->prev = NULL; } new->next = NULL; last = new; } return first; } /** * Returns true if the given modes should program to the same timings. * * This doesn't use Crtc values, as it might be used on ModeRecs without the * Crtc values set. So, it's assumed that the other numbers are enough. */ Bool xf86ModesEqual(const DisplayModeRec * pMode1, const DisplayModeRec * pMode2) { if (pMode1->Clock == pMode2->Clock && pMode1->HDisplay == pMode2->HDisplay && pMode1->HSyncStart == pMode2->HSyncStart && pMode1->HSyncEnd == pMode2->HSyncEnd && pMode1->HTotal == pMode2->HTotal && pMode1->HSkew == pMode2->HSkew && pMode1->VDisplay == pMode2->VDisplay && pMode1->VSyncStart == pMode2->VSyncStart && pMode1->VSyncEnd == pMode2->VSyncEnd && pMode1->VTotal == pMode2->VTotal && pMode1->VScan == pMode2->VScan && pMode1->Flags == pMode2->Flags) { return TRUE; } else { return FALSE; } } static void add(char **p, const char *new) { *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2); strcat(*p, " "); strcat(*p, new); } /** * Print out a modeline. * * The mode type bits are informational except for the capitalized U * and P bits which give sort order priority. Letter map: * * USERPREF, U, user preferred is set from the xorg.conf Monitor * Option "PreferredMode" or from the Screen Display Modes statement. * This unique modeline is moved to the head of the list after sorting. * * DRIVER, e, is set by the video driver, EDID or flat panel native. * * USERDEF, z, a configured zoom mode Ctrl+Alt+Keypad-{Plus,Minus}. * * DEFAULT, d, a compiled-in default. * * PREFERRED, P, driver preferred is set by the video device driver, * e.g. the EDID detailed timing modeline. This is a true sort * priority and multiple P modes form a sorted sublist at the list * head. * * BUILTIN, b, a hardware fixed CRTC mode. * * See modes/xf86Crtc.c: xf86ProbeOutputModes(). */ void xf86PrintModeline(int scrnIndex, DisplayModePtr mode) { char tmp[256]; char *flags = xnfcalloc(1, 1); #define TBITS 6 const char tchar[TBITS + 1] = "UezdPb"; int tbit[TBITS] = { M_T_USERPREF, M_T_DRIVER, M_T_USERDEF, M_T_DEFAULT, M_T_PREFERRED, M_T_BUILTIN }; char type[TBITS + 2]; /* +1 for leading space */ #undef TBITS int tlen = 0; if (mode->type) { int i; type[tlen++] = ' '; for (i = 0; tchar[i]; i++) if (mode->type & tbit[i]) type[tlen++] = tchar[i]; } type[tlen] = '\0'; if (mode->HSkew) { snprintf(tmp, 256, "hskew %i", mode->HSkew); add(&flags, tmp); } if (mode->VScan) { snprintf(tmp, 256, "vscan %i", mode->VScan); add(&flags, tmp); } if (mode->Flags & V_INTERLACE) add(&flags, "interlace"); if (mode->Flags & V_CSYNC) add(&flags, "composite"); if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan"); if (mode->Flags & V_BCAST) add(&flags, "bcast"); if (mode->Flags & V_PHSYNC) add(&flags, "+hsync"); if (mode->Flags & V_NHSYNC) add(&flags, "-hsync"); if (mode->Flags & V_PVSYNC) add(&flags, "+vsync"); if (mode->Flags & V_NVSYNC) add(&flags, "-vsync"); if (mode->Flags & V_PCSYNC) add(&flags, "+csync"); if (mode->Flags & V_NCSYNC) add(&flags, "-csync"); #if 0 if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2"); #endif xf86DrvMsg(scrnIndex, X_INFO, "Modeline \"%s\"x%.01f %6.2f %i %i %i %i %i %i %i %i%s" " (%.01f kHz%s)\n", mode->name, mode->VRefresh, mode->Clock / 1000., mode->HDisplay, mode->HSyncStart, mode->HSyncEnd, mode->HTotal, mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, mode->VTotal, flags, xf86ModeHSync(mode), type); free(flags); } /** * Marks as bad any modes with unsupported flags. * * \param modeList doubly-linked list of modes. * \param flags flags supported by the driver. * * \bug only V_INTERLACE and V_DBLSCAN are supported. Is that enough? */ void xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, int flags) { DisplayModePtr mode; if (flags == (V_INTERLACE | V_DBLSCAN)) return; for (mode = modeList; mode != NULL; mode = mode->next) { if (mode->Flags & V_INTERLACE && !(flags & V_INTERLACE)) mode->status = MODE_NO_INTERLACE; if (mode->Flags & V_DBLSCAN && !(flags & V_DBLSCAN)) mode->status = MODE_NO_DBLESCAN; } } /** * Marks as bad any modes extending beyond the given max X, Y, or pitch. * * \param modeList doubly-linked list of modes. */ void xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList, int maxX, int maxY, int maxPitch) { DisplayModePtr mode; if (maxPitch <= 0) maxPitch = MAXINT; if (maxX <= 0) maxX = MAXINT; if (maxY <= 0) maxY = MAXINT; for (mode = modeList; mode != NULL; mode = mode->next) { if ((xf86ModeWidth(mode, RR_Rotate_0) > maxPitch || xf86ModeWidth(mode, RR_Rotate_0) > maxX || xf86ModeHeight(mode, RR_Rotate_0) > maxY) && (xf86ModeWidth(mode, RR_Rotate_90) > maxPitch || xf86ModeWidth(mode, RR_Rotate_90) > maxX || xf86ModeHeight(mode, RR_Rotate_90) > maxY)) { if (xf86ModeWidth(mode, RR_Rotate_0) > maxPitch || xf86ModeWidth(mode, RR_Rotate_90) > maxPitch) mode->status = MODE_BAD_WIDTH; if (xf86ModeWidth(mode, RR_Rotate_0) > maxX || xf86ModeWidth(mode, RR_Rotate_90) > maxX) mode->status = MODE_VIRTUAL_X; if (xf86ModeHeight(mode, RR_Rotate_0) > maxY || xf86ModeHeight(mode, RR_Rotate_90) > maxY) mode->status = MODE_VIRTUAL_Y; } if (mode->next == modeList) break; } } /** * Marks as bad any modes that aren't supported by the given monitor's * hsync and vrefresh ranges. * * \param modeList doubly-linked list of modes. */ void xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, MonPtr mon) { DisplayModePtr mode; for (mode = modeList; mode != NULL; mode = mode->next) { Bool bad; int i; bad = TRUE; for (i = 0; i < mon->nHsync; i++) { if (xf86ModeHSync(mode) >= mon->hsync[i].lo * (1 - SYNC_TOLERANCE) && xf86ModeHSync(mode) <= mon->hsync[i].hi * (1 + SYNC_TOLERANCE)) { bad = FALSE; } } if (bad) mode->status = MODE_HSYNC; bad = TRUE; for (i = 0; i < mon->nVrefresh; i++) { if (xf86ModeVRefresh(mode) >= mon->vrefresh[i].lo * (1 - SYNC_TOLERANCE) && xf86ModeVRefresh(mode) <= mon->vrefresh[i].hi * (1 + SYNC_TOLERANCE)) { bad = FALSE; } } if (bad) mode->status = MODE_VSYNC; if (mode->next == modeList) break; } } /** * Marks as bad any modes extending beyond outside of the given clock ranges. * * \param modeList doubly-linked list of modes. * \param min pointer to minimums of clock ranges * \param max pointer to maximums of clock ranges * \param n_ranges number of ranges. */ void xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList, int *min, int *max, int n_ranges) { DisplayModePtr mode; int i; for (mode = modeList; mode != NULL; mode = mode->next) { Bool good = FALSE; for (i = 0; i < n_ranges; i++) { if (mode->Clock >= min[i] * (1 - SYNC_TOLERANCE) && mode->Clock <= max[i] * (1 + SYNC_TOLERANCE)) { good = TRUE; break; } } if (!good) mode->status = MODE_CLOCK_RANGE; } } /** * If the user has specified a set of mode names to use, mark as bad any modes * not listed. * * The user mode names specified are prefixes to names of modes, so "1024x768" * will match modes named "1024x768", "1024x768x75", "1024x768-good", but * "1024x768x75" would only match "1024x768x75" from that list. * * MODE_BAD is used as the rejection flag, for lack of a better flag. * * \param modeList doubly-linked list of modes. */ void xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList) { DisplayModePtr mode; if (pScrn->display->modes[0] == NULL) return; for (mode = modeList; mode != NULL; mode = mode->next) { int i; Bool good = FALSE; for (i = 0; pScrn->display->modes[i] != NULL; i++) { if (strncmp(pScrn->display->modes[i], mode->name, strlen(pScrn->display->modes[i])) == 0) { good = TRUE; break; } } if (!good) mode->status = MODE_BAD; } } /** * Marks as bad any modes exceeding the given bandwidth. * * \param modeList doubly-linked list of modes. * \param bandwidth bandwidth in MHz. * \param depth color depth. */ void xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList, unsigned int bandwidth, int depth) { DisplayModePtr mode; for (mode = modeList; mode != NULL; mode = mode->next) { if (xf86ModeBandwidth(mode, depth) > bandwidth) mode->status = MODE_BANDWIDTH; } } Bool xf86ModeIsReduced(const DisplayModeRec * mode) { if ((((mode->HDisplay * 5 / 4) & ~0x07) > mode->HTotal) && ((mode->HTotal - mode->HDisplay) == 160) && ((mode->HSyncEnd - mode->HDisplay) == 80) && ((mode->HSyncEnd - mode->HSyncStart) == 32) && ((mode->VSyncStart - mode->VDisplay) == 3)) return TRUE; return FALSE; } /** * Marks as bad any reduced-blanking modes. * * \param modeList doubly-linked list of modes. */ void xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList) { for (; modeList != NULL; modeList = modeList->next) if (xf86ModeIsReduced(modeList)) modeList->status = MODE_NO_REDUCED; } /** * Frees any modes from the list with a status other than MODE_OK. * * \param modeList pointer to a doubly-linked or circular list of modes. * \param verbose determines whether the reason for mode invalidation is * printed. */ void xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr * modeList, Bool verbose) { DisplayModePtr mode; for (mode = *modeList; mode != NULL;) { DisplayModePtr next = mode->next, first = *modeList; if (mode->status != MODE_OK) { if (verbose) { const char *type = ""; if (mode->type & M_T_BUILTIN) type = "built-in "; else if (mode->type & M_T_DEFAULT) type = "default "; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not using %smode \"%s\" (%s)\n", type, mode->name, xf86ModeStatusToString(mode->status)); } xf86DeleteMode(modeList, mode); } if (next == first) break; mode = next; } } /** * Adds the new mode into the mode list, and returns the new list * * \param modes doubly-linked mode list. */ DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new) { if (modes == NULL) return new; if (new) { DisplayModePtr mode = modes; while (mode->next) mode = mode->next; mode->next = new; new->prev = mode; } return modes; } /** * Build a mode list from a list of config file modes */ static DisplayModePtr xf86GetConfigModes(XF86ConfModeLinePtr conf_mode) { DisplayModePtr head = NULL, prev = NULL, mode; for (; conf_mode; conf_mode = (XF86ConfModeLinePtr) conf_mode->list.next) { mode = calloc(1, sizeof(DisplayModeRec)); if (!mode) continue; mode->name = xstrdup(conf_mode->ml_identifier); if (!mode->name) { free(mode); continue; } mode->type = 0; mode->Clock = conf_mode->ml_clock; mode->HDisplay = conf_mode->ml_hdisplay; mode->HSyncStart = conf_mode->ml_hsyncstart; mode->HSyncEnd = conf_mode->ml_hsyncend; mode->HTotal = conf_mode->ml_htotal; mode->VDisplay = conf_mode->ml_vdisplay; mode->VSyncStart = conf_mode->ml_vsyncstart; mode->VSyncEnd = conf_mode->ml_vsyncend; mode->VTotal = conf_mode->ml_vtotal; mode->Flags = conf_mode->ml_flags; mode->HSkew = conf_mode->ml_hskew; mode->VScan = conf_mode->ml_vscan; mode->prev = prev; mode->next = NULL; if (prev) prev->next = mode; else head = mode; prev = mode; } return head; } /** * Build a mode list from a monitor configuration */ DisplayModePtr xf86GetMonitorModes(ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor) { DisplayModePtr modes = NULL; XF86ConfModesLinkPtr modes_link; if (!conf_monitor) return NULL; /* * first we collect the mode lines from the UseModes directive */ for (modes_link = conf_monitor->mon_modes_sect_lst; modes_link; modes_link = modes_link->list.next) { /* If this modes link hasn't been resolved, go look it up now */ if (!modes_link->ml_modes) modes_link->ml_modes = xf86findModes(modes_link->ml_modes_str, xf86configptr->conf_modes_lst); if (modes_link->ml_modes) modes = xf86ModesAdd(modes, xf86GetConfigModes(modes_link->ml_modes-> mon_modeline_lst)); } return xf86ModesAdd(modes, xf86GetConfigModes(conf_monitor->mon_modeline_lst)); } /** * Build a mode list containing all of the default modes */ DisplayModePtr xf86GetDefaultModes(void) { DisplayModePtr head = NULL, mode; int i; for (i = 0; i < xf86NumDefaultModes; i++) { const DisplayModeRec *defMode = &xf86DefaultModes[i]; mode = xf86DuplicateMode(defMode); head = xf86ModesAdd(head, mode); } return head; } /* * Walk a mode list and prune out duplicates. Will preserve the preferred * mode of an otherwise-duplicate pair. * * Probably best to call this on lists that are all of a single class * (driver, default, user, etc.), otherwise, which mode gets deleted is * not especially well defined. * * Returns the new list. */ DisplayModePtr xf86PruneDuplicateModes(DisplayModePtr modes) { DisplayModePtr m, n, o; top: for (m = modes; m; m = m->next) { for (n = m->next; n; n = o) { o = n->next; if (xf86ModesEqual(m, n)) { if (n->type & M_T_PREFERRED) { xf86DeleteMode(&modes, m); goto top; } else xf86DeleteMode(&modes, n); } } } return modes; } xorg-server-1.17.1/hw/xfree86/modes/xf86EdidModes.c0000664000175100017510000015056412366220413016554 00000000000000/* * Copyright 2006 Luc Verhaegen. * Copyright 2008 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, 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 * 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. */ /** * @file This file covers code to convert a xf86MonPtr containing EDID-probed * information into a list of modes, including applying monitor-specific * quirks to fix broken EDID data. */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #define _PARSE_EDID_ #include "xf86.h" #include "xf86DDC.h" #include #include "property.h" #include "propertyst.h" #include "xf86Crtc.h" #include #include static void handle_detailed_rblank(struct detailed_monitor_section *det_mon, void *data) { if (det_mon->type == DS_RANGES) if (det_mon->section.ranges.supported_blanking & CVT_REDUCED) *(Bool *) data = TRUE; } static Bool xf86MonitorSupportsReducedBlanking(xf86MonPtr DDC) { /* EDID 1.4 explicitly defines RB support */ if (DDC->ver.revision >= 4) { Bool ret = FALSE; xf86ForEachDetailedBlock(DDC, handle_detailed_rblank, &ret); return ret; } /* For anything older, assume digital means RB support. Boo. */ if (DDC->features.input_type) return TRUE; return FALSE; } static Bool quirk_prefer_large_60(int scrnIndex, xf86MonPtr DDC) { /* Belinea 10 15 55 */ if (memcmp(DDC->vendor.name, "MAX", 4) == 0 && ((DDC->vendor.prod_id == 1516) || (DDC->vendor.prod_id == 0x77e))) return TRUE; /* Acer AL1706 */ if (memcmp(DDC->vendor.name, "ACR", 4) == 0 && DDC->vendor.prod_id == 44358) return TRUE; /* Bug #10814: Samsung SyncMaster 225BW */ if (memcmp(DDC->vendor.name, "SAM", 4) == 0 && DDC->vendor.prod_id == 596) return TRUE; /* Bug #10545: Samsung SyncMaster 226BW */ if (memcmp(DDC->vendor.name, "SAM", 4) == 0 && DDC->vendor.prod_id == 638) return TRUE; /* Acer F51 */ if (memcmp(DDC->vendor.name, "API", 4) == 0 && DDC->vendor.prod_id == 0x7602) return TRUE; return FALSE; } static Bool quirk_prefer_large_75(int scrnIndex, xf86MonPtr DDC) { /* Bug #11603: Funai Electronics PM36B */ if (memcmp(DDC->vendor.name, "FCM", 4) == 0 && DDC->vendor.prod_id == 13600) return TRUE; return FALSE; } static Bool quirk_detailed_h_in_cm(int scrnIndex, xf86MonPtr DDC) { /* Bug #11603: Funai Electronics PM36B */ if (memcmp(DDC->vendor.name, "FCM", 4) == 0 && DDC->vendor.prod_id == 13600) return TRUE; return FALSE; } static Bool quirk_detailed_v_in_cm(int scrnIndex, xf86MonPtr DDC) { /* Bug #11603: Funai Electronics PM36B */ if (memcmp(DDC->vendor.name, "FCM", 4) == 0 && DDC->vendor.prod_id == 13600) return TRUE; /* Bug #21000: LGPhilipsLCD LP154W01-TLAJ */ if (memcmp(DDC->vendor.name, "LPL", 4) == 0 && DDC->vendor.prod_id == 47360) return TRUE; /* Bug #10304: LGPhilipsLCD LP154W01-A5 */ if (memcmp(DDC->vendor.name, "LPL", 4) == 0 && DDC->vendor.prod_id == 0) return TRUE; /* Bug #24482: LGPhilipsLCD LP154W01-TLA1 */ if (memcmp(DDC->vendor.name, "LPL", 4) == 0 && DDC->vendor.prod_id == 0x2a00) return TRUE; /* Bug #28414: HP Compaq NC8430 LP154W01-TLA8 */ if (memcmp(DDC->vendor.name, "LPL", 4) == 0 && DDC->vendor.prod_id == 5750) return TRUE; /* Bug #21750: Samsung Syncmaster 2333HD */ if (memcmp(DDC->vendor.name, "SAM", 4) == 0 && DDC->vendor.prod_id == 1157) return TRUE; return FALSE; } static Bool quirk_detailed_use_maximum_size(int scrnIndex, xf86MonPtr DDC) { /* Bug #21324: Iiyama Vision Master 450 */ if (memcmp(DDC->vendor.name, "IVM", 4) == 0 && DDC->vendor.prod_id == 6400) return TRUE; /* Bug #41141: Acer Aspire One */ if (memcmp(DDC->vendor.name, "LGD", 4) == 0 && DDC->vendor.prod_id == 0x7f01) return TRUE; /* Sony Vaio Pro 13 */ if (memcmp(DDC->vendor.name, "MEI", 4) == 0 && DDC->vendor.prod_id == 0x96a2) return TRUE; return FALSE; } static Bool quirk_135_clock_too_high(int scrnIndex, xf86MonPtr DDC) { /* Envision Peripherals, Inc. EN-7100e. See bug #9550. */ if (memcmp(DDC->vendor.name, "EPI", 4) == 0 && DDC->vendor.prod_id == 59264) return TRUE; return FALSE; } static Bool quirk_first_detailed_preferred(int scrnIndex, xf86MonPtr DDC) { /* Philips 107p5 CRT. Reported on xorg@ with pastebin. */ if (memcmp(DDC->vendor.name, "PHL", 4) == 0 && DDC->vendor.prod_id == 57364) return TRUE; /* Proview AY765C 17" LCD. See bug #15160 */ if (memcmp(DDC->vendor.name, "PTS", 4) == 0 && DDC->vendor.prod_id == 765) return TRUE; /* ACR of some sort RH #284231 */ if (memcmp(DDC->vendor.name, "ACR", 4) == 0 && DDC->vendor.prod_id == 2423) return TRUE; /* Peacock Ergovision 19. See rh#492359 */ if (memcmp(DDC->vendor.name, "PEA", 4) == 0 && DDC->vendor.prod_id == 9003) return TRUE; return FALSE; } static Bool quirk_detailed_sync_pp(int scrnIndex, xf86MonPtr DDC) { /* Bug #12439: Samsung SyncMaster 205BW */ if (memcmp(DDC->vendor.name, "SAM", 4) == 0 && DDC->vendor.prod_id == 541) return TRUE; return FALSE; } /* This should probably be made more generic */ static Bool quirk_dvi_single_link(int scrnIndex, xf86MonPtr DDC) { /* Red Hat bug #453106: Apple 23" Cinema Display */ if (memcmp(DDC->vendor.name, "APL", 4) == 0 && DDC->vendor.prod_id == 0x921c) return TRUE; return FALSE; } typedef struct { Bool (*detect) (int scrnIndex, xf86MonPtr DDC); ddc_quirk_t quirk; const char *description; } ddc_quirk_map_t; static const ddc_quirk_map_t ddc_quirks[] = { { quirk_prefer_large_60, DDC_QUIRK_PREFER_LARGE_60, "Detailed timing is not preferred, use largest mode at 60Hz"}, { quirk_135_clock_too_high, DDC_QUIRK_135_CLOCK_TOO_HIGH, "Recommended 135MHz pixel clock is too high"}, { quirk_prefer_large_75, DDC_QUIRK_PREFER_LARGE_75, "Detailed timing is not preferred, use largest mode at 75Hz"}, { quirk_detailed_h_in_cm, DDC_QUIRK_DETAILED_H_IN_CM, "Detailed timings give horizontal size in cm."}, { quirk_detailed_v_in_cm, DDC_QUIRK_DETAILED_V_IN_CM, "Detailed timings give vertical size in cm."}, { quirk_detailed_use_maximum_size, DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE, "Use maximum size instead of detailed timing sizes."}, { quirk_first_detailed_preferred, DDC_QUIRK_FIRST_DETAILED_PREFERRED, "First detailed timing was not marked as preferred."}, { quirk_detailed_sync_pp, DDC_QUIRK_DETAILED_SYNC_PP, "Use +hsync +vsync for detailed timing."}, { quirk_dvi_single_link, DDC_QUIRK_DVI_SINGLE_LINK, "Forcing maximum pixel clock to single DVI link."}, { NULL, DDC_QUIRK_NONE, "No known quirks"}, }; /* * These more or less come from the DMT spec. The 720x400 modes are * inferred from historical 80x25 practice. The 640x480@67 and 832x624@75 * modes are old-school Mac modes. The EDID spec says the 1152x864@75 mode * should be 1152x870, again for the Mac, but instead we use the x864 DMT * mode. * * The DMT modes have been fact-checked; the rest are mild guesses. */ #define MODEPREFIX NULL, NULL, NULL, 0, M_T_DRIVER #define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 static const DisplayModeRec DDCEstablishedModes[17] = { {MODEPREFIX, 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@60Hz */ {MODEPREFIX, 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@56Hz */ {MODEPREFIX, 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@75Hz */ {MODEPREFIX, 31500, 640, 664, 704, 832, 0, 480, 489, 492, 520, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@72Hz */ {MODEPREFIX, 30240, 640, 704, 768, 864, 0, 480, 483, 486, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@67Hz */ {MODEPREFIX, 25175, 640, 656, 752, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@60Hz */ {MODEPREFIX, 35500, 720, 738, 846, 900, 0, 400, 421, 423, 449, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 720x400@88Hz */ {MODEPREFIX, 28320, 720, 738, 846, 900, 0, 400, 412, 414, 449, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 720x400@70Hz */ {MODEPREFIX, 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x1024@75Hz */ {MODEPREFIX, 78750, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1024x768@75Hz */ {MODEPREFIX, 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 1024x768@70Hz */ {MODEPREFIX, 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 1024x768@60Hz */ {MODEPREFIX, 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 772, 817, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX}, /* 1024x768@43Hz */ {MODEPREFIX, 57284, 832, 864, 928, 1152, 0, 624, 625, 628, 667, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 832x624@75Hz */ {MODEPREFIX, 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@75Hz */ {MODEPREFIX, 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@72Hz */ {MODEPREFIX, 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1152x864@75Hz */ }; static DisplayModePtr DDCModesFromEstablished(int scrnIndex, struct established_timings *timing, ddc_quirk_t quirks) { DisplayModePtr Modes = NULL, Mode = NULL; CARD32 bits = (timing->t1) | (timing->t2 << 8) | ((timing->t_manu & 0x80) << 9); int i; for (i = 0; i < 17; i++) { if (bits & (0x01 << i)) { Mode = xf86DuplicateMode(&DDCEstablishedModes[i]); Modes = xf86ModesAdd(Modes, Mode); } } return Modes; } /* Autogenerated from the DMT spec */ const DisplayModeRec DMTModes[] = { {MODEPREFIX, 31500, 640, 672, 736, 832, 0, 350, 382, 385, 445, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x350@85Hz */ {MODEPREFIX, 31500, 640, 672, 736, 832, 0, 400, 401, 404, 445, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 640x400@85Hz */ {MODEPREFIX, 35500, 720, 756, 828, 936, 0, 400, 401, 404, 446, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 720x400@85Hz */ {MODEPREFIX, 25175, 640, 656, 752, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@60Hz */ {MODEPREFIX, 31500, 640, 664, 704, 832, 0, 480, 489, 492, 520, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@72Hz */ {MODEPREFIX, 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@75Hz */ {MODEPREFIX, 36000, 640, 696, 752, 832, 0, 480, 481, 484, 509, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 640x480@85Hz */ {MODEPREFIX, 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@56Hz */ {MODEPREFIX, 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@60Hz */ {MODEPREFIX, 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@72Hz */ {MODEPREFIX, 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@75Hz */ {MODEPREFIX, 56250, 800, 832, 896, 1048, 0, 600, 601, 604, 631, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 800x600@85Hz */ {MODEPREFIX, 73250, 800, 848, 880, 960, 0, 600, 603, 607, 636, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 800x600@120Hz RB */ {MODEPREFIX, 33750, 848, 864, 976, 1088, 0, 480, 486, 494, 517, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 848x480@60Hz */ {MODEPREFIX, 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 772, 817, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX}, /* 1024x768@43Hz (interlaced) */ {MODEPREFIX, 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 1024x768@60Hz */ {MODEPREFIX, 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* 1024x768@70Hz */ {MODEPREFIX, 78750, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1024x768@75Hz */ {MODEPREFIX, 94500, 1024, 1072, 1168, 1376, 0, 768, 769, 772, 808, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1024x768@85Hz */ {MODEPREFIX, 115500, 1024, 1072, 1104, 1184, 0, 768, 771, 775, 813, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1024x768@120Hz RB */ {MODEPREFIX, 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1152x864@75Hz */ {MODEPREFIX, 68250, 1280, 1328, 1360, 1440, 0, 768, 771, 778, 790, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1280x768@60Hz RB */ {MODEPREFIX, 79500, 1280, 1344, 1472, 1664, 0, 768, 771, 778, 798, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x768@60Hz */ {MODEPREFIX, 102250, 1280, 1360, 1488, 1696, 0, 768, 771, 778, 805, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x768@75Hz */ {MODEPREFIX, 117500, 1280, 1360, 1496, 1712, 0, 768, 771, 778, 809, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x768@85Hz */ {MODEPREFIX, 140250, 1280, 1328, 1360, 1440, 0, 768, 771, 778, 813, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1280x768@120Hz RB */ {MODEPREFIX, 71000, 1280, 1328, 1360, 1440, 0, 800, 803, 809, 823, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1280x800@60Hz RB */ {MODEPREFIX, 83500, 1280, 1352, 1480, 1680, 0, 800, 803, 809, 831, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x800@60Hz */ {MODEPREFIX, 106500, 1280, 1360, 1488, 1696, 0, 800, 803, 809, 838, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x800@75Hz */ {MODEPREFIX, 122500, 1280, 1360, 1496, 1712, 0, 800, 803, 809, 843, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x800@85Hz */ {MODEPREFIX, 146250, 1280, 1328, 1360, 1440, 0, 800, 803, 809, 847, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1280x800@120Hz RB */ {MODEPREFIX, 108000, 1280, 1376, 1488, 1800, 0, 960, 961, 964, 1000, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x960@60Hz */ {MODEPREFIX, 148500, 1280, 1344, 1504, 1728, 0, 960, 961, 964, 1011, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x960@85Hz */ {MODEPREFIX, 175500, 1280, 1328, 1360, 1440, 0, 960, 963, 967, 1017, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1280x960@120Hz RB */ {MODEPREFIX, 108000, 1280, 1328, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x1024@60Hz */ {MODEPREFIX, 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x1024@75Hz */ {MODEPREFIX, 157500, 1280, 1344, 1504, 1728, 0, 1024, 1025, 1028, 1072, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1280x1024@85Hz */ {MODEPREFIX, 187250, 1280, 1328, 1360, 1440, 0, 1024, 1027, 1034, 1084, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1280x1024@120Hz RB */ {MODEPREFIX, 85500, 1360, 1424, 1536, 1792, 0, 768, 771, 777, 795, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1360x768@60Hz */ {MODEPREFIX, 148250, 1360, 1408, 1440, 1520, 0, 768, 771, 776, 813, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1360x768@120Hz RB */ {MODEPREFIX, 101000, 1400, 1448, 1480, 1560, 0, 1050, 1053, 1057, 1080, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1400x1050@60Hz RB */ {MODEPREFIX, 121750, 1400, 1488, 1632, 1864, 0, 1050, 1053, 1057, 1089, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1400x1050@60Hz */ {MODEPREFIX, 156000, 1400, 1504, 1648, 1896, 0, 1050, 1053, 1057, 1099, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1400x1050@75Hz */ {MODEPREFIX, 179500, 1400, 1504, 1656, 1912, 0, 1050, 1053, 1057, 1105, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1400x1050@85Hz */ {MODEPREFIX, 208000, 1400, 1448, 1480, 1560, 0, 1050, 1053, 1057, 1112, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1400x1050@120Hz RB */ {MODEPREFIX, 88750, 1440, 1488, 1520, 1600, 0, 900, 903, 909, 926, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1440x900@60Hz RB */ {MODEPREFIX, 106500, 1440, 1520, 1672, 1904, 0, 900, 903, 909, 934, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1440x900@60Hz */ {MODEPREFIX, 136750, 1440, 1536, 1688, 1936, 0, 900, 903, 909, 942, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1440x900@75Hz */ {MODEPREFIX, 157000, 1440, 1544, 1696, 1952, 0, 900, 903, 909, 948, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1440x900@85Hz */ {MODEPREFIX, 182750, 1440, 1488, 1520, 1600, 0, 900, 903, 909, 953, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1440x900@120Hz RB */ {MODEPREFIX, 162000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1600x1200@60Hz */ {MODEPREFIX, 175500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1600x1200@65Hz */ {MODEPREFIX, 189000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1600x1200@70Hz */ {MODEPREFIX, 202500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1600x1200@75Hz */ {MODEPREFIX, 229500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* 1600x1200@85Hz */ {MODEPREFIX, 268250, 1600, 1648, 1680, 1760, 0, 1200, 1203, 1207, 1271, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1600x1200@120Hz RB */ {MODEPREFIX, 119000, 1680, 1728, 1760, 1840, 0, 1050, 1053, 1059, 1080, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1680x1050@60Hz RB */ {MODEPREFIX, 146250, 1680, 1784, 1960, 2240, 0, 1050, 1053, 1059, 1089, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1680x1050@60Hz */ {MODEPREFIX, 187000, 1680, 1800, 1976, 2272, 0, 1050, 1053, 1059, 1099, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1680x1050@75Hz */ {MODEPREFIX, 214750, 1680, 1808, 1984, 2288, 0, 1050, 1053, 1059, 1105, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1680x1050@85Hz */ {MODEPREFIX, 245500, 1680, 1728, 1760, 1840, 0, 1050, 1053, 1059, 1112, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1680x1050@120Hz RB */ {MODEPREFIX, 204750, 1792, 1920, 2120, 2448, 0, 1344, 1345, 1348, 1394, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1792x1344@60Hz */ {MODEPREFIX, 261000, 1792, 1888, 2104, 2456, 0, 1344, 1345, 1348, 1417, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1792x1344@75Hz */ {MODEPREFIX, 333250, 1792, 1840, 1872, 1952, 0, 1344, 1347, 1351, 1423, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1792x1344@120Hz RB */ {MODEPREFIX, 218250, 1856, 1952, 2176, 2528, 0, 1392, 1393, 1396, 1439, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1856x1392@60Hz */ {MODEPREFIX, 288000, 1856, 1984, 2208, 2560, 0, 1392, 1393, 1396, 1500, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1856x1392@75Hz */ {MODEPREFIX, 356500, 1856, 1904, 1936, 2016, 0, 1392, 1395, 1399, 1474, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1856x1392@120Hz RB */ {MODEPREFIX, 154000, 1920, 1968, 2000, 2080, 0, 1200, 1203, 1209, 1235, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1920x1200@60Hz RB */ {MODEPREFIX, 193250, 1920, 2056, 2256, 2592, 0, 1200, 1203, 1209, 1245, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1920x1200@60Hz */ {MODEPREFIX, 245250, 1920, 2056, 2264, 2608, 0, 1200, 1203, 1209, 1255, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1920x1200@75Hz */ {MODEPREFIX, 281250, 1920, 2064, 2272, 2624, 0, 1200, 1203, 1209, 1262, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1920x1200@85Hz */ {MODEPREFIX, 317000, 1920, 1968, 2000, 2080, 0, 1200, 1203, 1209, 1271, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1920x1200@120Hz RB */ {MODEPREFIX, 234000, 1920, 2048, 2256, 2600, 0, 1440, 1441, 1444, 1500, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1920x1440@60Hz */ {MODEPREFIX, 297000, 1920, 2064, 2288, 2640, 0, 1440, 1441, 1444, 1500, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 1920x1440@75Hz */ {MODEPREFIX, 380500, 1920, 1968, 2000, 2080, 0, 1440, 1443, 1447, 1525, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 1920x1440@120Hz RB */ {MODEPREFIX, 268500, 2560, 2608, 2640, 2720, 0, 1600, 1603, 1609, 1646, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 2560x1600@60Hz RB */ {MODEPREFIX, 348500, 2560, 2752, 3032, 3504, 0, 1600, 1603, 1609, 1658, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 2560x1600@60Hz */ {MODEPREFIX, 443250, 2560, 2768, 3048, 3536, 0, 1600, 1603, 1609, 1672, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 2560x1600@75Hz */ {MODEPREFIX, 505250, 2560, 2768, 3048, 3536, 0, 1600, 1603, 1609, 1682, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX}, /* 2560x1600@85Hz */ {MODEPREFIX, 552750, 2560, 2608, 2640, 2720, 0, 1600, 1603, 1609, 1694, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX}, /* 2560x1600@120Hz RB */ }; #define LEVEL_DMT 0 #define LEVEL_GTF 1 #define LEVEL_CVT 2 static int MonitorStandardTimingLevel(xf86MonPtr DDC) { if (DDC->ver.revision >= 2) { if (DDC->ver.revision >= 4 && CVT_SUPPORTED(DDC->features.msc)) { return LEVEL_CVT; } return LEVEL_GTF; } return LEVEL_DMT; } static int ModeRefresh(const DisplayModeRec * mode) { return (int) (xf86ModeVRefresh(mode) + 0.5); } /* * If rb is not set, then we'll not consider reduced-blanking modes as * part of the DMT pool. For the 'standard' EDID mode descriptor there's * no way to specify whether the mode should be RB or not. */ DisplayModePtr FindDMTMode(int hsize, int vsize, int refresh, Bool rb) { int i; const DisplayModeRec *ret; for (i = 0; i < sizeof(DMTModes) / sizeof(DisplayModeRec); i++) { ret = &DMTModes[i]; if (!rb && xf86ModeIsReduced(ret)) continue; if (ret->HDisplay == hsize && ret->VDisplay == vsize && refresh == ModeRefresh(ret)) return xf86DuplicateMode(ret); } return NULL; } /* * Appendix B of the EDID 1.4 spec defines the right thing to do here. * If the timing given here matches a mode defined in the VESA DMT standard, * we _must_ use that. If the device supports CVT modes, then we should * generate a CVT timing. If both of the above fail, use GTF. * * There are some wrinkles here. EDID 1.1 and 1.0 sinks can't really * "support" GTF, since it wasn't a standard yet; so if they ask for a * timing in this section that isn't defined in DMT, returning a GTF mode * may not actually be valid. EDID 1.3 sinks often report support for * some CVT modes, but they are not required to support CVT timings for * modes in the standard timing descriptor, so we should _not_ treat them * as CVT-compliant (unless specified in an extension block I suppose). * * EDID 1.4 requires that all sink devices support both GTF and CVT timings * for modes in this section, but does say that CVT is preferred. */ static DisplayModePtr DDCModesFromStandardTiming(struct std_timings *timing, ddc_quirk_t quirks, int timing_level, Bool rb) { DisplayModePtr Modes = NULL, Mode = NULL; int i, hsize, vsize, refresh; for (i = 0; i < STD_TIMINGS; i++) { hsize = timing[i].hsize; vsize = timing[i].vsize; refresh = timing[i].refresh; /* HDTV hack, because you can't say 1366 */ if (refresh == 60 && ((hsize == 1360 && vsize == 765) || (hsize == 1368 && vsize == 769))) { Mode = xf86CVTMode(1366, 768, 60, FALSE, FALSE); Mode->HDisplay = 1366; Mode->HSyncStart--; Mode->HSyncEnd--; } else if (hsize && vsize && refresh) { Mode = FindDMTMode(hsize, vsize, refresh, rb); if (!Mode) { if (timing_level == LEVEL_CVT) /* pass rb here too? */ Mode = xf86CVTMode(hsize, vsize, refresh, FALSE, FALSE); else if (timing_level == LEVEL_GTF) Mode = xf86GTFMode(hsize, vsize, refresh, FALSE, FALSE); } } if (Mode) { Mode->type = M_T_DRIVER; Modes = xf86ModesAdd(Modes, Mode); } Mode = NULL; } return Modes; } static void DDCModeDoInterlaceQuirks(DisplayModePtr mode) { /* * EDID is delightfully ambiguous about how interlaced modes are to be * encoded. X's internal representation is of frame height, but some * HDTV detailed timings are encoded as field height. * * The format list here is from CEA, in frame size. Technically we * should be checking refresh rate too. Whatever. */ static const struct { int w, h; } cea_interlaced[] = { {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; for (i = 0; i < n_modes; i++) { if ((mode->HDisplay == cea_interlaced[i].w) && (mode->VDisplay == cea_interlaced[i].h / 2)) { mode->VDisplay *= 2; mode->VSyncStart *= 2; mode->VSyncEnd *= 2; mode->VTotal *= 2; mode->VTotal |= 1; } } mode->Flags |= V_INTERLACE; } /* * */ static DisplayModePtr DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, Bool preferred, ddc_quirk_t quirks) { DisplayModePtr Mode; /* * Refuse to create modes that are insufficiently large. 64 is a random * number, maybe the spec says something about what the minimum is. In * particular I see this frequently with _old_ EDID, 1.0 or so, so maybe * our parser is just being too aggresive there. */ if (timing->h_active < 64 || timing->v_active < 64) { xf86DrvMsg(scrnIndex, X_INFO, "%s: Ignoring tiny %dx%d mode\n", __func__, timing->h_active, timing->v_active); return NULL; } /* We don't do stereo */ if (timing->stereo) { xf86DrvMsg(scrnIndex, X_INFO, "%s: Ignoring: We don't handle stereo.\n", __func__); return NULL; } /* We only do seperate sync currently */ if (timing->sync != 0x03) { xf86DrvMsg(scrnIndex, X_INFO, "%s: %dx%d Warning: We only handle separate" " sync.\n", __func__, timing->h_active, timing->v_active); } Mode = xnfcalloc(1, sizeof(DisplayModeRec)); Mode->type = M_T_DRIVER; if (preferred) Mode->type |= M_T_PREFERRED; if ((quirks & DDC_QUIRK_135_CLOCK_TOO_HIGH) && timing->clock == 135000000) Mode->Clock = 108880; else Mode->Clock = timing->clock / 1000.0; Mode->HDisplay = timing->h_active; Mode->HSyncStart = timing->h_active + timing->h_sync_off; Mode->HSyncEnd = Mode->HSyncStart + timing->h_sync_width; Mode->HTotal = timing->h_active + timing->h_blanking; Mode->VDisplay = timing->v_active; Mode->VSyncStart = timing->v_active + timing->v_sync_off; Mode->VSyncEnd = Mode->VSyncStart + timing->v_sync_width; Mode->VTotal = timing->v_active + timing->v_blanking; /* perform basic check on the detail timing */ if (Mode->HSyncEnd > Mode->HTotal || Mode->VSyncEnd > Mode->VTotal) { free(Mode); return NULL; } /* We ignore h/v_size and h/v_border for now. */ if (timing->interlaced) DDCModeDoInterlaceQuirks(Mode); if (quirks & DDC_QUIRK_DETAILED_SYNC_PP) Mode->Flags |= V_PVSYNC | V_PHSYNC; else { if (timing->misc & 0x02) Mode->Flags |= V_PVSYNC; else Mode->Flags |= V_NVSYNC; if (timing->misc & 0x01) Mode->Flags |= V_PHSYNC; else Mode->Flags |= V_NHSYNC; } xf86SetModeDefaultName(Mode); return Mode; } static DisplayModePtr DDCModesFromCVT(int scrnIndex, struct cvt_timings *t) { DisplayModePtr modes = NULL; int i; for (i = 0; i < 4; i++) { if (t[i].height) { if (t[i].rates & 0x10) modes = xf86ModesAdd(modes, xf86CVTMode(t[i].width, t[i].height, 50, 0, 0)); if (t[i].rates & 0x08) modes = xf86ModesAdd(modes, xf86CVTMode(t[i].width, t[i].height, 60, 0, 0)); if (t[i].rates & 0x04) modes = xf86ModesAdd(modes, xf86CVTMode(t[i].width, t[i].height, 75, 0, 0)); if (t[i].rates & 0x02) modes = xf86ModesAdd(modes, xf86CVTMode(t[i].width, t[i].height, 85, 0, 0)); if (t[i].rates & 0x01) modes = xf86ModesAdd(modes, xf86CVTMode(t[i].width, t[i].height, 60, 1, 0)); } else break; } return modes; } static const struct { short w; short h; 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 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}, /* 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}, /* 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}, /* 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}, /* byte 11 */ {1920, 1200, 75, 0}, {1920, 1200, 85, 0}, {1920, 1440, 60, 0}, {1920, 1440, 75, 0}, /* fill up last byte */ {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, }; static DisplayModePtr DDCModesFromEstIII(unsigned char *est) { DisplayModePtr modes = NULL; int i, j, m; for (i = 0; i < 6; i++) { for (j = 7; j >= 0; j--) { if (est[i] & (1 << j)) { m = (i * 8) + (7 - j); if (EstIIIModes[m].w) modes = xf86ModesAdd(modes, FindDMTMode(EstIIIModes[m].w, EstIIIModes[m].h, EstIIIModes[m].r, EstIIIModes[m].rb)); } } } return modes; } /* * This is only valid when the sink claims to be continuous-frequency * but does not supply a detailed range descriptor. Such sinks are * arguably broken. Currently the mode validation code isn't aware of * this; the non-RANDR code even punts the decision of optional sync * range checking to the driver. Loss. */ static void DDCGuessRangesFromModes(int scrnIndex, MonPtr Monitor, DisplayModePtr Modes) { DisplayModePtr Mode = Modes; if (!Monitor || !Modes) return; /* set up the ranges for scanning through the modes */ Monitor->nHsync = 1; Monitor->hsync[0].lo = 1024.0; Monitor->hsync[0].hi = 0.0; Monitor->nVrefresh = 1; Monitor->vrefresh[0].lo = 1024.0; Monitor->vrefresh[0].hi = 0.0; while (Mode) { if (!Mode->HSync) Mode->HSync = ((float) Mode->Clock) / ((float) Mode->HTotal); if (!Mode->VRefresh) Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / ((float) (Mode->HTotal * Mode->VTotal)); if (Mode->HSync < Monitor->hsync[0].lo) Monitor->hsync[0].lo = Mode->HSync; if (Mode->HSync > Monitor->hsync[0].hi) Monitor->hsync[0].hi = Mode->HSync; if (Mode->VRefresh < Monitor->vrefresh[0].lo) Monitor->vrefresh[0].lo = Mode->VRefresh; if (Mode->VRefresh > Monitor->vrefresh[0].hi) Monitor->vrefresh[0].hi = Mode->VRefresh; Mode = Mode->next; } } ddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose) { ddc_quirk_t quirks; int i; quirks = DDC_QUIRK_NONE; for (i = 0; ddc_quirks[i].detect; i++) { if (ddc_quirks[i].detect(scrnIndex, DDC)) { if (verbose) { xf86DrvMsg(scrnIndex, X_INFO, " EDID quirk: %s\n", ddc_quirks[i].description); } quirks |= ddc_quirks[i].quirk; } } return quirks; } void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon, ddc_quirk_t quirks, int hsize, int vsize) { if (det_mon->type != DT) return; if (quirks & DDC_QUIRK_DETAILED_H_IN_CM) det_mon->section.d_timings.h_size *= 10; if (quirks & DDC_QUIRK_DETAILED_V_IN_CM) det_mon->section.d_timings.v_size *= 10; if (quirks & DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE) { det_mon->section.d_timings.h_size = 10 * hsize; det_mon->section.d_timings.v_size = 10 * vsize; } } /** * Applies monitor-specific quirks to the decoded EDID information. * * Note that some quirks applying to the mode list are still implemented in * xf86DDCGetModes. */ void xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC) { ddc_quirk_t quirks = xf86DDCDetectQuirks(scrnIndex, DDC, FALSE); int i; for (i = 0; i < DET_TIMINGS; i++) { xf86DetTimingApplyQuirks(DDC->det_mon + i, quirks, DDC->features.hsize, DDC->features.vsize); } } /** * Walks the modes list, finding the mode with the largest area which is * closest to the target refresh rate, and marks it as the only preferred mode. */ static void xf86DDCSetPreferredRefresh(int scrnIndex, DisplayModePtr modes, float target_refresh) { DisplayModePtr mode, best = modes; for (mode = modes; mode; mode = mode->next) { mode->type &= ~M_T_PREFERRED; if (mode == best) continue; if (mode->HDisplay * mode->VDisplay > best->HDisplay * best->VDisplay) { best = mode; continue; } if (mode->HDisplay * mode->VDisplay == best->HDisplay * best->VDisplay) { double mode_refresh = xf86ModeVRefresh(mode); double best_refresh = xf86ModeVRefresh(best); double mode_dist = fabs(mode_refresh - target_refresh); double best_dist = fabs(best_refresh - target_refresh); if (mode_dist < best_dist) { best = mode; continue; } } } if (best) best->type |= M_T_PREFERRED; } #define CEA_VIDEO_MODES_NUM 64 static const DisplayModeRec CEAVideoModes[CEA_VIDEO_MODES_NUM] = { {MODEPREFIX, 25175, 640, 656, 752, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 1:640x480@60Hz */ {MODEPREFIX, 27000, 720, 736, 798, 858, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 2:720x480@60Hz */ {MODEPREFIX, 27000, 720, 736, 798, 858, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 3:720x480@60Hz */ {MODEPREFIX, 74250, 1280, 1390, 1430, 1650, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 4: 1280x720@60Hz */ {MODEPREFIX, 74250, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1094, 1125, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 5:1920x1080i@60Hz */ {MODEPREFIX, 27000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 6:1440x480i@60Hz */ {MODEPREFIX, 27000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 7:1440x480i@60Hz */ {MODEPREFIX, 27000, 1440, 1478, 1602, 1716, 0, 240, 244, 247, 262, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 8:1440x240@60Hz */ {MODEPREFIX, 27000, 1440, 1478, 1602, 1716, 0, 240, 244, 247, 262, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 9:1440x240@60Hz */ {MODEPREFIX, 54000, 2880, 2956, 3204, 3432, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 10:2880x480i@60Hz */ {MODEPREFIX, 54000, 2880, 2956, 3204, 3432, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 11:2880x480i@60Hz */ {MODEPREFIX, 54000, 2880, 2956, 3204, 3432, 0, 240, 244, 247, 262, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 12:2880x240@60Hz */ {MODEPREFIX, 54000, 2880, 2956, 3204, 3432, 0, 240, 244, 247, 262, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 13:2880x240@60Hz */ {MODEPREFIX, 54000, 1440, 1472, 1596, 1716, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 14:1440x480@60Hz */ {MODEPREFIX, 54000, 1440, 1472, 1596, 1716, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 15:1440x480@60Hz */ {MODEPREFIX, 148500, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 16:1920x1080@60Hz */ {MODEPREFIX, 27000, 720, 732, 796, 864, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 17:720x576@50Hz */ {MODEPREFIX, 27000, 720, 732, 796, 864, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 18:720x576@50Hz */ {MODEPREFIX, 74250, 1280, 1720, 1760, 1980, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 19: 1280x720@50Hz */ {MODEPREFIX, 74250, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 20:1920x1080i@50Hz */ {MODEPREFIX, 27000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 21:1440x576i@50Hz */ {MODEPREFIX, 27000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 22:1440x576i@50Hz */ {MODEPREFIX, 27000, 1440, 1464, 1590, 1728, 0, 288, 290, 293, 312, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 23:1440x288@50Hz */ {MODEPREFIX, 27000, 1440, 1464, 1590, 1728, 0, 288, 290, 293, 312, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 24:1440x288@50Hz */ {MODEPREFIX, 54000, 2880, 2928, 3180, 3456, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 25:2880x576i@50Hz */ {MODEPREFIX, 54000, 2880, 2928, 3180, 3456, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 26:2880x576i@50Hz */ {MODEPREFIX, 54000, 2880, 2928, 3180, 3456, 0, 288, 290, 293, 312, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 27:2880x288@50Hz */ {MODEPREFIX, 54000, 2880, 2928, 3180, 3456, 0, 288, 290, 293, 312, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 28:2880x288@50Hz */ {MODEPREFIX, 54000, 1440, 1464, 1592, 1728, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 29:1440x576@50Hz */ {MODEPREFIX, 54000, 1440, 1464, 1592, 1728, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 30:1440x576@50Hz */ {MODEPREFIX, 148500, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 31:1920x1080@50Hz */ {MODEPREFIX, 74250, 1920, 2558, 2602, 2750, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 32:1920x1080@24Hz */ {MODEPREFIX, 74250, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 33:1920x1080@25Hz */ {MODEPREFIX, 74250, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 34:1920x1080@30Hz */ {MODEPREFIX, 108000, 2880, 2944, 3192, 3432, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 35:2880x480@60Hz */ {MODEPREFIX, 108000, 2880, 2944, 3192, 3432, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 36:2880x480@60Hz */ {MODEPREFIX, 108000, 2880, 2928, 3184, 3456, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 37:2880x576@50Hz */ {MODEPREFIX, 108000, 2880, 2928, 3184, 3456, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 38:2880x576@50Hz */ {MODEPREFIX, 72000, 1920, 1952, 2120, 2304, 0, 1080, 1126, 1136, 1250, 0, V_PHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 39:1920x1080i@50Hz */ {MODEPREFIX, 148500, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 40:1920x1080i@100Hz */ {MODEPREFIX, 148500, 1280, 1720, 1760, 1980, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 41:1280x720@100Hz */ {MODEPREFIX, 54000, 720, 732, 796, 864, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 42:720x576@100Hz */ {MODEPREFIX, 54000, 720, 732, 796, 864, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 43:720x576@100Hz */ {MODEPREFIX, 54000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 44:1440x576i@100Hz */ {MODEPREFIX, 54000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 45:1440x576i@100Hz */ {MODEPREFIX, 148500, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1094, 1125, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 46:1920x1080i@120Hz */ {MODEPREFIX, 148500, 1280, 1390, 1430, 1650, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 47:1280x720@120Hz */ {MODEPREFIX, 54000, 720, 736, 798, 858, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 48:720x480@120Hz */ {MODEPREFIX, 54000, 720, 736, 798, 858, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 49:720x480@120Hz */ {MODEPREFIX, 54000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 50:1440x480i@120Hz */ {MODEPREFIX, 54000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 51:1440x480i@120Hz */ {MODEPREFIX, 108000, 720, 732, 796, 864, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 52:720x576@200Hz */ {MODEPREFIX, 108000, 720, 732, 796, 864, 0, 576, 581, 586, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 53:720x576@200Hz */ {MODEPREFIX, 108000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 54:1440x576i@200Hz */ {MODEPREFIX, 108000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 55:1440x576i@200Hz */ {MODEPREFIX, 108000, 720, 736, 798, 858, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 56:720x480@240Hz */ {MODEPREFIX, 108000, 720, 736, 798, 858, 0, 480, 489, 495, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX}, /* VIC 57:720x480@240Hz */ {MODEPREFIX, 108000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 58:1440x480i@240 */ {MODEPREFIX, 108000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX}, /* VIC 59:1440x480i@240 */ {MODEPREFIX, 59400, 1280, 3040, 3080, 3300, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 60: 1280x720@24Hz */ {MODEPREFIX, 74250, 1280, 3700, 3740, 3960, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 61: 1280x720@25Hz */ {MODEPREFIX, 74250, 1280, 3040, 3080, 3300, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 62: 1280x720@30Hz */ {MODEPREFIX, 297000, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 63: 1920x1080@120Hz */ {MODEPREFIX, 297000, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX}, /* VIC 64:1920x1080@100Hz */ }; /* chose mode line by cea short video descriptor*/ static void handle_cea_svd(struct cea_video_block *video, void *data) { DisplayModePtr Mode; DisplayModePtr *Modes = (DisplayModePtr *) data; int vid; vid = video->video_code & 0x7f; if (vid < CEA_VIDEO_MODES_NUM) { Mode = xf86DuplicateMode(CEAVideoModes + vid); *Modes = xf86ModesAdd(*Modes, Mode); } } static DisplayModePtr DDCModesFromCEAExtension(int scrnIndex, xf86MonPtr mon_ptr) { DisplayModePtr Modes = NULL; xf86ForEachVideoBlock(mon_ptr, handle_cea_svd, &Modes); return Modes; } struct det_modes_parameter { xf86MonPtr DDC; ddc_quirk_t quirks; DisplayModePtr Modes; Bool rb; Bool preferred; int timing_level; }; static void handle_detailed_modes(struct detailed_monitor_section *det_mon, void *data) { DisplayModePtr Mode; struct det_modes_parameter *p = (struct det_modes_parameter *) data; xf86DetTimingApplyQuirks(det_mon, p->quirks, p->DDC->features.hsize, p->DDC->features.vsize); switch (det_mon->type) { case DT: Mode = DDCModeFromDetailedTiming(p->DDC->scrnIndex, &det_mon->section.d_timings, p->preferred, p->quirks); p->preferred = FALSE; p->Modes = xf86ModesAdd(p->Modes, Mode); break; case DS_STD_TIMINGS: Mode = DDCModesFromStandardTiming(det_mon->section.std_t, p->quirks, p->timing_level, p->rb); p->Modes = xf86ModesAdd(p->Modes, Mode); break; case DS_CVT: Mode = DDCModesFromCVT(p->DDC->scrnIndex, det_mon->section.cvt); p->Modes = xf86ModesAdd(p->Modes, Mode); break; case DS_EST_III: Mode = DDCModesFromEstIII(det_mon->section.est_iii); p->Modes = xf86ModesAdd(p->Modes, Mode); break; default: break; } } DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) { DisplayModePtr Modes = NULL, Mode; ddc_quirk_t quirks; Bool preferred, rb; int timing_level; struct det_modes_parameter p; xf86DrvMsg(scrnIndex, X_INFO, "EDID vendor \"%s\", prod id %d\n", DDC->vendor.name, DDC->vendor.prod_id); quirks = xf86DDCDetectQuirks(scrnIndex, DDC, TRUE); preferred = PREFERRED_TIMING_MODE(DDC->features.msc); if (DDC->ver.revision >= 4) preferred = TRUE; if (quirks & DDC_QUIRK_FIRST_DETAILED_PREFERRED) preferred = TRUE; if (quirks & (DDC_QUIRK_PREFER_LARGE_60 | DDC_QUIRK_PREFER_LARGE_75)) preferred = FALSE; rb = xf86MonitorSupportsReducedBlanking(DDC); timing_level = MonitorStandardTimingLevel(DDC); p.quirks = quirks; p.DDC = DDC; p.Modes = Modes; p.rb = rb; p.preferred = preferred; p.timing_level = timing_level; xf86ForEachDetailedBlock(DDC, handle_detailed_modes, &p); Modes = p.Modes; /* Add established timings */ Mode = DDCModesFromEstablished(scrnIndex, &DDC->timings1, quirks); Modes = xf86ModesAdd(Modes, Mode); /* Add standard timings */ Mode = DDCModesFromStandardTiming(DDC->timings2, quirks, timing_level, rb); Modes = xf86ModesAdd(Modes, Mode); /* Add cea-extension mode timings */ Mode = DDCModesFromCEAExtension(scrnIndex, DDC); Modes = xf86ModesAdd(Modes, Mode); if (quirks & DDC_QUIRK_PREFER_LARGE_60) xf86DDCSetPreferredRefresh(scrnIndex, Modes, 60); if (quirks & DDC_QUIRK_PREFER_LARGE_75) xf86DDCSetPreferredRefresh(scrnIndex, Modes, 75); Modes = xf86PruneDuplicateModes(Modes); return Modes; } struct det_mon_parameter { MonPtr Monitor; ddc_quirk_t quirks; Bool have_hsync; Bool have_vrefresh; Bool have_maxpixclock; }; static void handle_detailed_monset(struct detailed_monitor_section *det_mon, void *data) { int clock; struct det_mon_parameter *p = (struct det_mon_parameter *) data; int scrnIndex = ((xf86MonPtr) (p->Monitor->DDC))->scrnIndex; switch (det_mon->type) { case DS_RANGES: if (!p->have_hsync) { if (!p->Monitor->nHsync) xf86DrvMsg(scrnIndex, X_INFO, "Using EDID range info for horizontal sync\n"); p->Monitor->hsync[p->Monitor->nHsync].lo = det_mon->section.ranges.min_h; p->Monitor->hsync[p->Monitor->nHsync].hi = det_mon->section.ranges.max_h; p->Monitor->nHsync++; } else { xf86DrvMsg(scrnIndex, X_INFO, "Using hsync ranges from config file\n"); } if (!p->have_vrefresh) { if (!p->Monitor->nVrefresh) xf86DrvMsg(scrnIndex, X_INFO, "Using EDID range info for vertical refresh\n"); p->Monitor->vrefresh[p->Monitor->nVrefresh].lo = det_mon->section.ranges.min_v; p->Monitor->vrefresh[p->Monitor->nVrefresh].hi = det_mon->section.ranges.max_v; p->Monitor->nVrefresh++; } else { xf86DrvMsg(scrnIndex, X_INFO, "Using vrefresh ranges from config file\n"); } clock = det_mon->section.ranges.max_clock * 1000; if (p->quirks & DDC_QUIRK_DVI_SINGLE_LINK) clock = min(clock, 165000); if (!p->have_maxpixclock && clock > p->Monitor->maxPixClock) p->Monitor->maxPixClock = clock; break; default: break; } } /* * Fill out MonPtr with xf86MonPtr information. */ void xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) { DisplayModePtr Modes = NULL, Mode; struct det_mon_parameter p; if (!Monitor || !DDC) return; Monitor->DDC = DDC; if (Monitor->widthmm <= 0 || Monitor->heightmm <= 0) { Monitor->widthmm = 10 * DDC->features.hsize; Monitor->heightmm = 10 * DDC->features.vsize; } Monitor->reducedblanking = xf86MonitorSupportsReducedBlanking(DDC); Modes = xf86DDCGetModes(scrnIndex, DDC); /* Go through the detailed monitor sections */ p.Monitor = Monitor; p.quirks = xf86DDCDetectQuirks(scrnIndex, Monitor->DDC, FALSE); p.have_hsync = (Monitor->nHsync != 0); p.have_vrefresh = (Monitor->nVrefresh != 0); p.have_maxpixclock = (Monitor->maxPixClock != 0); xf86ForEachDetailedBlock(DDC, handle_detailed_monset, &p); if (Modes) { /* Print Modes */ xf86DrvMsg(scrnIndex, X_INFO, "Printing DDC gathered Modelines:\n"); Mode = Modes; while (Mode) { xf86PrintModeline(scrnIndex, Mode); Mode = Mode->next; } /* Do we still need ranges to be filled in? */ if (!Monitor->nHsync || !Monitor->nVrefresh) DDCGuessRangesFromModes(scrnIndex, Monitor, Modes); /* look for last Mode */ Mode = Modes; while (Mode->next) Mode = Mode->next; /* add to MonPtr */ if (Monitor->Modes) { Monitor->Last->next = Modes; Modes->prev = Monitor->Last; Monitor->Last = Mode; } else { Monitor->Modes = Modes; Monitor->Last = Mode; } } } xorg-server-1.17.1/hw/xfree86/modes/xf86RandR12.h0000664000175100017510000000442212274325511016067 00000000000000/* * 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. */ #ifndef _XF86_RANDR_H_ #define _XF86_RANDR_H_ #include #include extern _X_EXPORT Bool xf86RandR12CreateScreenResources(ScreenPtr pScreen); extern _X_EXPORT Bool xf86RandR12Init(ScreenPtr pScreen); extern _X_EXPORT void xf86RandR12CloseScreen(ScreenPtr pScreen); extern _X_EXPORT void xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotation); extern _X_EXPORT void xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms); extern _X_EXPORT Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize); extern _X_EXPORT Rotation xf86RandR12GetRotation(ScreenPtr pScreen); extern _X_EXPORT void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y); extern _X_EXPORT Bool xf86RandR12PreInit(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86RandR12TellChanged(ScreenPtr pScreen); #endif /* _XF86_RANDR_H_ */ xorg-server-1.17.1/hw/xfree86/modes/Makefile.in0000664000175100017510000007027012466505433016110 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/modes DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libxf86modes_la_LIBADD = am__libxf86modes_la_SOURCES_DIST = xf86Crtc.c xf86Crtc.h xf86Cursors.c \ xf86cvt.c xf86gtf.c xf86EdidModes.c xf86Modes.c xf86Modes.h \ xf86RandR12.c xf86RandR12.h xf86Rotate.c xf86DiDGA.c @DGA_TRUE@am__objects_1 = xf86DiDGA.lo am_libxf86modes_la_OBJECTS = xf86Crtc.lo xf86Cursors.lo xf86cvt.lo \ xf86gtf.lo xf86EdidModes.lo xf86Modes.lo xf86RandR12.lo \ xf86Rotate.lo $(am__objects_1) libxf86modes_la_OBJECTS = $(am_libxf86modes_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 = $(libxf86modes_la_SOURCES) DIST_SOURCES = $(am__libxf86modes_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 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libxf86modes.la @DGA_TRUE@DGA_SRCS = xf86DiDGA.c libxf86modes_la_SOURCES = \ xf86Crtc.c \ xf86Crtc.h \ xf86Cursors.c \ xf86cvt.c \ xf86gtf.c \ xf86EdidModes.c \ xf86Modes.c \ xf86Modes.h \ xf86RandR12.c \ xf86RandR12.h \ xf86Rotate.c \ $(DGA_SRCS) AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ -I$(srcdir)/../vgahw -I$(srcdir)/../ramdac \ -I$(srcdir)/../dixmods/extmod sdk_HEADERS = \ xf86Crtc.h \ xf86Modes.h \ xf86RandR12.h AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/modes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/modes/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libxf86modes.la: $(libxf86modes_la_OBJECTS) $(libxf86modes_la_DEPENDENCIES) $(EXTRA_libxf86modes_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libxf86modes_la_OBJECTS) $(libxf86modes_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Crtc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Cursors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DiDGA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86EdidModes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Modes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RandR12.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Rotate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86cvt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86gtf.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/xfree86/modes/xf86Rotate.c0000664000175100017510000004014012456256034016151 00000000000000/* * Copyright © 2006 Keith Packard * Copyright © 2011 Aaron Plattner * * 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. */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include #include #include #include "xf86.h" #include "xf86DDC.h" #include "windowstr.h" #include "xf86Crtc.h" #include "xf86Modes.h" #include "xf86RandR12.h" #include "X11/extensions/render.h" #include "X11/extensions/dpmsconst.h" #include "X11/Xatom.h" /* borrowed from composite extension, move to Render and publish? */ #define F(x) IntToxFixed(x) #define toF(x) ((float) (x) / 65536.0f) static void xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) { ScrnInfoPtr scrn = crtc->scrn; ScreenPtr screen = scrn->pScreen; WindowPtr root = screen->root; PixmapPtr dst_pixmap = crtc->rotatedPixmap; PictFormatPtr format = PictureWindowFormat(screen->root); int error; PicturePtr src, dst; int n = RegionNumRects(region); BoxPtr b = RegionRects(region); XID include_inferiors = IncludeInferiors; if (crtc->driverIsPerformingTransform) return; src = CreatePicture(None, &root->drawable, format, CPSubwindowMode, &include_inferiors, serverClient, &error); if (!src) return; dst = CreatePicture(None, &dst_pixmap->drawable, format, 0L, NULL, serverClient, &error); if (!dst) return; error = SetPictureTransform(src, &crtc->crtc_to_framebuffer); if (error) return; if (crtc->transform_in_use && crtc->filter) SetPicturePictFilter(src, crtc->filter, crtc->params, crtc->nparams); if (crtc->shadowClear) { CompositePicture(PictOpSrc, src, NULL, dst, 0, 0, 0, 0, 0, 0, crtc->mode.HDisplay, crtc->mode.VDisplay); crtc->shadowClear = FALSE; } else { while (n--) { BoxRec dst_box; dst_box = *b; dst_box.x1 -= crtc->filter_width >> 1; dst_box.x2 += crtc->filter_width >> 1; dst_box.y1 -= crtc->filter_height >> 1; dst_box.y2 += crtc->filter_height >> 1; pixman_f_transform_bounds(&crtc->f_framebuffer_to_crtc, &dst_box); CompositePicture(PictOpSrc, src, NULL, dst, dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1, dst_box.x2 - dst_box.x1, dst_box.y2 - dst_box.y1); b++; } } FreePicture(src, None); FreePicture(dst, None); } static void xf86CrtcDamageShadow(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; BoxRec damage_box; RegionRec damage_region; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); damage_box.x1 = 0; damage_box.x2 = crtc->mode.HDisplay; damage_box.y1 = 0; damage_box.y2 = crtc->mode.VDisplay; if (!pixman_transform_bounds(&crtc->crtc_to_framebuffer, &damage_box)) { damage_box.x1 = 0; damage_box.y1 = 0; damage_box.x2 = pScreen->width; damage_box.y2 = pScreen->height; } if (damage_box.x1 < 0) damage_box.x1 = 0; if (damage_box.y1 < 0) damage_box.y1 = 0; if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width; if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height; RegionInit(&damage_region, &damage_box, 1); DamageDamageRegion(&(*pScreen->GetScreenPixmap) (pScreen)->drawable, &damage_region); RegionUninit(&damage_region); crtc->shadowClear = TRUE; } static void xf86RotatePrepare(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int c; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->rotatedData && !crtc->rotatedPixmap) { crtc->rotatedPixmap = crtc->funcs->shadow_create(crtc, crtc->rotatedData, crtc->mode. HDisplay, crtc->mode. VDisplay); if (!xf86_config->rotation_damage_registered) { /* Hook damage to screen pixmap */ DamageRegister(&pScreen->root->drawable, xf86_config->rotation_damage); xf86_config->rotation_damage_registered = TRUE; EnableLimitedSchedulingLatency(); } xf86CrtcDamageShadow(crtc); } } } static Bool xf86RotateRedisplay(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); DamagePtr damage = xf86_config->rotation_damage; RegionPtr region; if (!damage) return FALSE; xf86RotatePrepare(pScreen); region = DamageRegion(damage); if (RegionNotEmpty(region)) { int c; 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; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (crtc->transform_in_use && crtc->enabled) { RegionRec crtc_damage; /* compute portion of damage that overlaps crtc */ RegionInit(&crtc_damage, &crtc->bounds, 1); RegionIntersect(&crtc_damage, &crtc_damage, region); /* update damaged region */ if (RegionNotEmpty(&crtc_damage)) xf86RotateCrtcRedisplay(crtc, &crtc_damage); RegionUninit(&crtc_damage); } } pScreen->SourceValidate = SourceValidate; DamageEmpty(damage); } return TRUE; } static void xf86RotateBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); /* Unwrap before redisplay in case the software * cursor layer wants to add its block handler to the * chain */ pScreen->BlockHandler = xf86_config->BlockHandler; xf86RotateRedisplay(pScreen); (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); /* Re-wrap if we still need this hook */ if (xf86_config->rotation_damage != NULL) { xf86_config->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = xf86RotateBlockHandler; } else xf86_config->BlockHandler = NULL; } void xf86RotateDestroy(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int c; /* Free memory from rotation */ if (crtc->rotatedPixmap || crtc->rotatedData) { crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap, crtc->rotatedData); crtc->rotatedPixmap = NULL; crtc->rotatedData = NULL; } for (c = 0; c < xf86_config->num_crtc; c++) if (xf86_config->crtc[c]->rotatedData) return; /* * Clean up damage structures when no crtcs are rotated */ if (xf86_config->rotation_damage) { /* Free damage structure */ if (xf86_config->rotation_damage_registered) { xf86_config->rotation_damage_registered = FALSE; DisableLimitedSchedulingLatency(); } DamageDestroy(xf86_config->rotation_damage); xf86_config->rotation_damage = NULL; } } void xf86RotateFreeShadow(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; if (crtc->rotatedPixmap || crtc->rotatedData) { crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap, crtc->rotatedData); crtc->rotatedPixmap = NULL; crtc->rotatedData = NULL; } } } void xf86RotateCloseScreen(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; /* This has already been destroyed when the root window was destroyed */ xf86_config->rotation_damage = NULL; for (c = 0; c < xf86_config->num_crtc; c++) xf86RotateDestroy(xf86_config->crtc[c]); } static Bool xf86CrtcFitsScreen(xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb) { ScrnInfoPtr pScrn = crtc->scrn; BoxRec b; /* 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; b.x1 = 0; b.y1 = 0; b.x2 = crtc->mode.HDisplay; b.y2 = crtc->mode.VDisplay; if (crtc_to_fb) pixman_f_transform_bounds(crtc_to_fb, &b); else { b.x1 += crtc->x; b.y1 += crtc->y; b.x2 += crtc->x; b.y2 += crtc->y; } return (0 <= b.x1 && b.x2 <= pScrn->virtualX && 0 <= b.y1 && b.y2 <= pScrn->virtualY); } Bool xf86CrtcRotate(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); ScreenPtr pScreen = xf86ScrnToScreen(pScrn); PictTransform crtc_to_fb; struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc; xFixed *new_params = NULL; int new_nparams = 0; PictFilterPtr new_filter = NULL; int new_width = 0; int new_height = 0; RRTransformPtr transform = NULL; Bool damage = FALSE; if (crtc->transformPresent) transform = &crtc->transform; if (!RRTransformCompute(crtc->x, crtc->y, crtc->mode.HDisplay, crtc->mode.VDisplay, crtc->rotation, transform, &crtc_to_fb, &f_crtc_to_fb, &f_fb_to_crtc) && xf86CrtcFitsScreen(crtc, &f_crtc_to_fb)) { /* * If the untranslated transformation is the identity, * disable the shadow buffer */ xf86RotateDestroy(crtc); crtc->transform_in_use = FALSE; free(new_params); new_params = NULL; new_nparams = 0; new_filter = NULL; new_width = 0; new_height = 0; } else { if (crtc->driverIsPerformingTransform) { xf86RotateDestroy(crtc); } else { /* * these are the size of the shadow pixmap, which * matches the mode, not the pre-rotated copy in the * frame buffer */ int width = crtc->mode.HDisplay; int height = crtc->mode.VDisplay; void *shadowData = crtc->rotatedData; PixmapPtr shadow = crtc->rotatedPixmap; int old_width = shadow ? shadow->drawable.width : 0; int old_height = shadow ? shadow->drawable.height : 0; /* Allocate memory for rotation */ if (old_width != width || old_height != height) { if (shadow || shadowData) { crtc->funcs->shadow_destroy(crtc, shadow, shadowData); crtc->rotatedPixmap = NULL; crtc->rotatedData = NULL; } shadowData = crtc->funcs->shadow_allocate(crtc, width, height); if (!shadowData) goto bail1; crtc->rotatedData = shadowData; /* shadow will be damaged in xf86RotatePrepare */ } else { /* mark shadowed area as damaged so it will be repainted */ damage = TRUE; } if (!xf86_config->rotation_damage) { /* Create damage structure */ xf86_config->rotation_damage = DamageCreate(NULL, NULL, DamageReportNone, TRUE, pScreen, pScreen); if (!xf86_config->rotation_damage) goto bail2; /* Wrap block handler */ if (!xf86_config->BlockHandler) { xf86_config->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = xf86RotateBlockHandler; } } if (0) { bail2: if (shadow || shadowData) { crtc->funcs->shadow_destroy(crtc, shadow, shadowData); crtc->rotatedPixmap = NULL; crtc->rotatedData = NULL; } bail1: if (old_width && old_height) crtc->rotatedPixmap = crtc->funcs->shadow_create(crtc, NULL, old_width, old_height); return FALSE; } } #ifdef RANDR_12_INTERFACE if (transform) { if (transform->nparams) { new_params = malloc(transform->nparams * sizeof(xFixed)); if (new_params) { memcpy(new_params, transform->params, transform->nparams * sizeof(xFixed)); new_nparams = transform->nparams; new_filter = transform->filter; } } else new_filter = transform->filter; if (new_filter) { new_width = new_filter->width; new_height = new_filter->height; } } #endif crtc->transform_in_use = TRUE; } crtc->crtc_to_framebuffer = crtc_to_fb; crtc->f_crtc_to_framebuffer = f_crtc_to_fb; crtc->f_framebuffer_to_crtc = f_fb_to_crtc; free(crtc->params); crtc->params = new_params; crtc->nparams = new_nparams; crtc->filter = new_filter; crtc->filter_width = new_width; crtc->filter_height = new_height; crtc->bounds.x1 = 0; crtc->bounds.x2 = crtc->mode.HDisplay; crtc->bounds.y1 = 0; crtc->bounds.y2 = crtc->mode.VDisplay; pixman_f_transform_bounds(&f_crtc_to_fb, &crtc->bounds); if (damage) xf86CrtcDamageShadow(crtc); /* All done */ return TRUE; } xorg-server-1.17.1/hw/xfree86/modes/xf86Crtc.c0000664000175100017510000031331012456571574015621 00000000000000/* * Copyright © 2006 Keith Packard * Copyright © 2008 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. */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include #include #include #include "xf86.h" #include "xf86DDC.h" #include "xf86Crtc.h" #include "xf86Modes.h" #include "xf86Priv.h" #include "xf86RandR12.h" #include "X11/extensions/render.h" #include "X11/extensions/dpmsconst.h" #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 /* * Initialize xf86CrtcConfig structure */ int xf86CrtcConfigPrivateIndex = -1; void xf86CrtcConfigInit(ScrnInfoPtr scrn, const xf86CrtcConfigFuncsRec * funcs) { xf86CrtcConfigPtr config; if (xf86CrtcConfigPrivateIndex == -1) xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); config = xnfcalloc(1, sizeof(xf86CrtcConfigRec)); config->funcs = funcs; config->compat_output = -1; scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config; } void xf86CrtcSetSizeRange(ScrnInfoPtr scrn, int minWidth, int minHeight, int maxWidth, int maxHeight) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); config->minWidth = minWidth; config->minHeight = minHeight; config->maxWidth = maxWidth; config->maxHeight = maxHeight; } /* * Crtc functions */ xf86CrtcPtr xf86CrtcCreate(ScrnInfoPtr scrn, const xf86CrtcFuncsRec * funcs) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc, *crtcs; crtc = calloc(sizeof(xf86CrtcRec), 1); if (!crtc) return NULL; crtc->version = XF86_CRTC_VERSION; crtc->scrn = scrn; crtc->funcs = funcs; #ifdef RANDR_12_INTERFACE crtc->randr_crtc = NULL; #endif crtc->rotation = RR_Rotate_0; crtc->desiredRotation = RR_Rotate_0; pixman_transform_init_identity(&crtc->crtc_to_framebuffer); pixman_f_transform_init_identity(&crtc->f_crtc_to_framebuffer); pixman_f_transform_init_identity(&crtc->f_framebuffer_to_crtc); crtc->filter = NULL; crtc->params = NULL; crtc->nparams = 0; crtc->filter_width = 0; crtc->filter_height = 0; crtc->transform_in_use = FALSE; crtc->transformPresent = FALSE; crtc->desiredTransformPresent = FALSE; memset(&crtc->bounds, '\0', sizeof(crtc->bounds)); /* Preallocate gamma at a sensible size. */ crtc->gamma_size = 256; crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof(CARD16)); if (!crtc->gamma_red) { free(crtc); return NULL; } crtc->gamma_green = crtc->gamma_red + crtc->gamma_size; crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size; if (xf86_config->crtc) crtcs = realloc(xf86_config->crtc, (xf86_config->num_crtc + 1) * sizeof(xf86CrtcPtr)); else crtcs = malloc((xf86_config->num_crtc + 1) * sizeof(xf86CrtcPtr)); if (!crtcs) { free(crtc->gamma_red); free(crtc); return NULL; } xf86_config->crtc = crtcs; xf86_config->crtc[xf86_config->num_crtc++] = crtc; return crtc; } void xf86CrtcDestroy(xf86CrtcPtr crtc) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); int c; (*crtc->funcs->destroy) (crtc); for (c = 0; c < xf86_config->num_crtc; c++) if (xf86_config->crtc[c] == crtc) { memmove(&xf86_config->crtc[c], &xf86_config->crtc[c + 1], ((xf86_config->num_crtc - (c + 1)) * sizeof(void *))); xf86_config->num_crtc--; break; } free(crtc->params); free(crtc->gamma_red); free(crtc); } /** * Return whether any outputs are connected to the specified pipe */ Bool xf86CrtcInUse(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int o; for (o = 0; o < xf86_config->num_output; o++) if (xf86_config->output[o]->crtc == crtc) return TRUE; return FALSE; } void xf86CrtcSetScreenSubpixelOrder(ScreenPtr pScreen) { int subpixel_order = SubPixelUnknown; Bool has_none = FALSE; ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int icrtc, o; for (icrtc = 0; icrtc < xf86_config->num_crtc; icrtc++) { xf86CrtcPtr crtc = xf86_config->crtc[icrtc]; for (o = 0; o < xf86_config->num_output; o++) { xf86OutputPtr output = xf86_config->output[o]; if (output->crtc == crtc) { switch (output->subpixel_order) { case SubPixelNone: has_none = TRUE; break; case SubPixelUnknown: break; default: subpixel_order = output->subpixel_order; break; } } if (subpixel_order != SubPixelUnknown) break; } if (subpixel_order != SubPixelUnknown) { static const int circle[4] = { SubPixelHorizontalRGB, SubPixelVerticalRGB, SubPixelHorizontalBGR, SubPixelVerticalBGR, }; int rotate; int sc; for (rotate = 0; rotate < 4; rotate++) if (crtc->rotation & (1 << rotate)) break; for (sc = 0; sc < 4; sc++) if (circle[sc] == subpixel_order) break; sc = (sc + rotate) & 0x3; if ((crtc->rotation & RR_Reflect_X) && !(sc & 1)) sc ^= 2; if ((crtc->rotation & RR_Reflect_Y) && (sc & 1)) sc ^= 2; subpixel_order = circle[sc]; break; } } if (subpixel_order == SubPixelUnknown && has_none) subpixel_order = SubPixelNone; PictureSetSubpixelOrder(pScreen, subpixel_order); } /** * Sets the given video mode on the given crtc */ Bool xf86CrtcSetModeTransform(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, RRTransformPtr transform, int x, int y) { ScrnInfoPtr scrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int i; Bool ret = FALSE; Bool didLock = FALSE; DisplayModePtr adjusted_mode; DisplayModeRec saved_mode; int saved_x, saved_y; Rotation saved_rotation; RRTransformRec saved_transform; Bool saved_transform_present; crtc->enabled = xf86CrtcInUse(crtc); /* We only hit this if someone explicitly sends a "disabled" modeset. */ if (!crtc->enabled) { /* Check everything for stuff that should be off. */ xf86DisableUnusedFunctions(scrn); return TRUE; } adjusted_mode = xf86DuplicateMode(mode); saved_mode = crtc->mode; saved_x = crtc->x; saved_y = crtc->y; saved_rotation = crtc->rotation; if (crtc->transformPresent) { RRTransformInit(&saved_transform); RRTransformCopy(&saved_transform, &crtc->transform); } saved_transform_present = crtc->transformPresent; /* Update crtc values up front so the driver can rely on them for mode * setting. */ crtc->mode = *mode; crtc->x = x; crtc->y = y; crtc->rotation = rotation; if (transform) { RRTransformCopy(&crtc->transform, transform); crtc->transformPresent = TRUE; } else crtc->transformPresent = FALSE; if (crtc->funcs->set_mode_major) { ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y); goto done; } didLock = crtc->funcs->lock(crtc); /* Pass our mode to the outputs and the CRTC to give them a chance to * adjust it according to limitations or output properties, and also * a chance to reject the mode entirely. */ for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->crtc != crtc) continue; if (!output->funcs->mode_fixup(output, mode, adjusted_mode)) { goto done; } } if (!crtc->funcs->mode_fixup(crtc, mode, adjusted_mode)) { goto done; } if (!xf86CrtcRotate(crtc)) goto done; /* Prepare the outputs and CRTCs before setting the mode. */ for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->crtc != crtc) continue; /* Disable the output as the first thing we do. */ output->funcs->prepare(output); } crtc->funcs->prepare(crtc); /* Set up the DPLL and any output state that needs to adjust or depend * on the DPLL. */ crtc->funcs->mode_set(crtc, mode, adjusted_mode, crtc->x, crtc->y); for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->crtc == crtc) output->funcs->mode_set(output, mode, adjusted_mode); } /* Only upload when needed, to avoid unneeded delays. */ if (!crtc->active && crtc->funcs->gamma_set) crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size); /* Now, enable the clocks, plane, pipe, and outputs that we set up. */ crtc->funcs->commit(crtc); for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->crtc == crtc) output->funcs->commit(output); } ret = TRUE; done: if (ret) { crtc->active = TRUE; if (scrn->pScreen) xf86CrtcSetScreenSubpixelOrder(scrn->pScreen); if (scrn->ModeSet) scrn->ModeSet(scrn); } else { crtc->x = saved_x; crtc->y = saved_y; crtc->rotation = saved_rotation; crtc->mode = saved_mode; if (saved_transform_present) RRTransformCopy(&crtc->transform, &saved_transform); crtc->transformPresent = saved_transform_present; } free((void *) adjusted_mode->name); free(adjusted_mode); if (didLock) crtc->funcs->unlock(crtc); return ret; } /** * Sets the given video mode on the given crtc, but without providing * a transform */ Bool xf86CrtcSetMode(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) { return xf86CrtcSetModeTransform(crtc, mode, rotation, NULL, x, y); } /** * Pans the screen, does not change the mode */ void xf86CrtcSetOrigin(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr scrn = crtc->scrn; crtc->x = x; crtc->y = y; if (crtc->funcs->set_origin) { if (!xf86CrtcRotate(crtc)) return; crtc->funcs->set_origin(crtc, x, y); if (scrn->ModeSet) scrn->ModeSet(scrn); } else xf86CrtcSetMode(crtc, &crtc->mode, crtc->rotation, x, y); } /* * Output functions */ extern XF86ConfigPtr xf86configptr; typedef enum { OPTION_PREFERRED_MODE, OPTION_ZOOM_MODES, OPTION_POSITION, OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF, OPTION_ENABLE, OPTION_DISABLE, OPTION_MIN_CLOCK, OPTION_MAX_CLOCK, OPTION_IGNORE, OPTION_ROTATE, OPTION_PANNING, OPTION_PRIMARY, OPTION_DEFAULT_MODES, } OutputOpts; static OptionInfoRec xf86OutputOptions[] = { {OPTION_PREFERRED_MODE, "PreferredMode", OPTV_STRING, {0}, FALSE}, {OPTION_ZOOM_MODES, "ZoomModes", OPTV_STRING, {0}, FALSE }, {OPTION_POSITION, "Position", OPTV_STRING, {0}, FALSE}, {OPTION_BELOW, "Below", OPTV_STRING, {0}, FALSE}, {OPTION_RIGHT_OF, "RightOf", OPTV_STRING, {0}, FALSE}, {OPTION_ABOVE, "Above", OPTV_STRING, {0}, FALSE}, {OPTION_LEFT_OF, "LeftOf", OPTV_STRING, {0}, FALSE}, {OPTION_ENABLE, "Enable", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE}, {OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE}, {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE}, {OPTION_PANNING, "Panning", OPTV_STRING, {0}, FALSE}, {OPTION_PRIMARY, "Primary", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DEFAULT_MODES, "DefaultModes", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; enum { OPTION_MODEDEBUG, }; static OptionInfoRec xf86DeviceOptions[] = { {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; static void xf86OutputSetMonitor(xf86OutputPtr output) { char *option_name; const char *monitor; if (!output->name) return; free(output->options); output->options = xnfalloc(sizeof(xf86OutputOptions)); memcpy(output->options, xf86OutputOptions, sizeof(xf86OutputOptions)); XNFasprintf(&option_name, "monitor-%s", output->name); monitor = xf86findOptionValue(output->scrn->options, option_name); if (!monitor) monitor = output->name; else xf86MarkOptionUsedByName(output->scrn->options, option_name); free(option_name); output->conf_monitor = xf86findMonitor(monitor, xf86configptr->conf_monitor_lst); /* * Find the monitor section of the screen and use that */ if (!output->conf_monitor && output->use_screen_monitor) output->conf_monitor = xf86findMonitor(output->scrn->monitor->id, xf86configptr->conf_monitor_lst); if (output->conf_monitor) { xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s using monitor section %s\n", output->name, output->conf_monitor->mon_identifier); xf86ProcessOptions(output->scrn->scrnIndex, output->conf_monitor->mon_option_lst, output->options); } else xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s has no monitor section\n", output->name); } static Bool xf86OutputEnabled(xf86OutputPtr output, Bool strict) { Bool enable, disable; /* check to see if this output was enabled in the config file */ if (xf86GetOptValBool(output->options, OPTION_ENABLE, &enable) && enable) { xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s enabled by config file\n", output->name); return TRUE; } /* or if this output was disabled in the config file */ if (xf86GetOptValBool(output->options, OPTION_DISABLE, &disable) && disable) { xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s disabled by config file\n", output->name); return FALSE; } /* If not, try to only light up the ones we know are connected */ if (strict) { enable = output->status == XF86OutputStatusConnected; } /* But if that fails, try to light up even outputs we're unsure of */ else { enable = output->status != XF86OutputStatusDisconnected; } xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s %sconnected\n", output->name, enable ? "" : "dis"); return enable; } static Bool xf86OutputIgnored(xf86OutputPtr output) { return xf86ReturnOptValBool(output->options, OPTION_IGNORE, FALSE); } static const char *direction[4] = { "normal", "left", "inverted", "right" }; static Rotation xf86OutputInitialRotation(xf86OutputPtr output) { const char *rotate_name = xf86GetOptValString(output->options, OPTION_ROTATE); int i; if (!rotate_name) { if (output->initial_rotation) return output->initial_rotation; return RR_Rotate_0; } for (i = 0; i < 4; i++) if (xf86nameCompare(direction[i], rotate_name) == 0) return 1 << i; return RR_Rotate_0; } xf86OutputPtr xf86OutputCreate(ScrnInfoPtr scrn, const xf86OutputFuncsRec * funcs, const char *name) { xf86OutputPtr output, *outputs; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int len; Bool primary; if (name) len = strlen(name) + 1; else len = 0; output = calloc(sizeof(xf86OutputRec) + len, 1); if (!output) return NULL; output->scrn = scrn; output->funcs = funcs; if (name) { output->name = (char *) (output + 1); strcpy(output->name, name); } output->subpixel_order = SubPixelUnknown; /* * Use the old per-screen monitor section for the first output */ output->use_screen_monitor = (xf86_config->num_output == 0); #ifdef RANDR_12_INTERFACE output->randr_output = NULL; #endif if (name) { xf86OutputSetMonitor(output); if (xf86OutputIgnored(output)) { free(output); return FALSE; } } if (xf86_config->output) outputs = realloc(xf86_config->output, (xf86_config->num_output + 1) * sizeof(xf86OutputPtr)); else outputs = malloc((xf86_config->num_output + 1) * sizeof(xf86OutputPtr)); if (!outputs) { free(output); return NULL; } xf86_config->output = outputs; if (xf86GetOptValBool(output->options, OPTION_PRIMARY, &primary) && primary) { memmove(xf86_config->output + 1, xf86_config->output, xf86_config->num_output * sizeof(xf86OutputPtr)); xf86_config->output[0] = output; } else { xf86_config->output[xf86_config->num_output] = output; } xf86_config->num_output++; return output; } Bool xf86OutputRename(xf86OutputPtr output, const char *name) { char *newname = strdup(name); if (!newname) return FALSE; /* so sorry... */ if (output->name && output->name != (char *) (output + 1)) free(output->name); output->name = newname; xf86OutputSetMonitor(output); if (xf86OutputIgnored(output)) return FALSE; return TRUE; } void xf86OutputUseScreenMonitor(xf86OutputPtr output, Bool use_screen_monitor) { if (use_screen_monitor != output->use_screen_monitor) { output->use_screen_monitor = use_screen_monitor; xf86OutputSetMonitor(output); } } void xf86OutputDestroy(xf86OutputPtr output) { ScrnInfoPtr scrn = output->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int o; (*output->funcs->destroy) (output); while (output->probed_modes) xf86DeleteMode(&output->probed_modes, output->probed_modes); for (o = 0; o < xf86_config->num_output; o++) if (xf86_config->output[o] == output) { memmove(&xf86_config->output[o], &xf86_config->output[o + 1], ((xf86_config->num_output - (o + 1)) * sizeof(void *))); xf86_config->num_output--; break; } if (output->name && output->name != (char *) (output + 1)) free(output->name); free(output); } /* * Called during CreateScreenResources to hook up RandR */ static Bool xf86CrtcCreateScreenResources(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); screen->CreateScreenResources = config->CreateScreenResources; if (!(*screen->CreateScreenResources) (screen)) return FALSE; if (!xf86RandR12CreateScreenResources(screen)) return FALSE; return TRUE; } /* * Clean up config on server reset */ static Bool xf86CrtcCloseScreen(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o, c; screen->CloseScreen = config->CloseScreen; xf86RotateCloseScreen(screen); xf86RandR12CloseScreen(screen); screen->CloseScreen(screen); for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; output->randr_output = NULL; } for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; crtc->randr_crtc = NULL; } /* detach any providers */ if (config->randr_provider) { RRProviderDestroy(config->randr_provider); config->randr_provider = NULL; } return TRUE; } /* * Called at ScreenInit time to set up */ #ifdef RANDR_13_INTERFACE int #else Bool #endif xf86CrtcScreenInit(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int c; /* Rotation */ xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n"); xf86DisableRandR(); /* Disable old RandR extension support */ xf86RandR12Init(screen); /* support all rotations if every crtc has the shadow alloc funcs */ for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create) break; } if (c == config->num_crtc) { xf86RandR12SetRotations(screen, RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270 | RR_Reflect_X | RR_Reflect_Y); xf86RandR12SetTransformSupport(screen, TRUE); } else { xf86RandR12SetRotations(screen, RR_Rotate_0); xf86RandR12SetTransformSupport(screen, FALSE); } /* Wrap CreateScreenResources so we can initialize the RandR code */ config->CreateScreenResources = screen->CreateScreenResources; screen->CreateScreenResources = xf86CrtcCreateScreenResources; config->CloseScreen = screen->CloseScreen; screen->CloseScreen = xf86CrtcCloseScreen; /* This might still be marked wrapped from a previous generation */ config->BlockHandler = NULL; #ifdef XFreeXDGA _xf86_di_dga_init_internal(screen); #endif #ifdef RANDR_13_INTERFACE return RANDR_INTERFACE_VERSION; #else return TRUE; #endif } static DisplayModePtr xf86DefaultMode(xf86OutputPtr output, int width, int height) { DisplayModePtr target_mode = NULL; DisplayModePtr mode; int target_diff = 0; int target_preferred = 0; int mm_height; mm_height = output->mm_height; if (!mm_height) mm_height = (768 * 25.4) / DEFAULT_DPI; /* * Pick a mode closest to DEFAULT_DPI */ for (mode = output->probed_modes; mode; mode = mode->next) { int dpi; int preferred = (((mode->type & M_T_PREFERRED) != 0) + ((mode->type & M_T_USERPREF) != 0)); int diff; if (xf86ModeWidth(mode, output->initial_rotation) > width || xf86ModeHeight(mode, output->initial_rotation) > height) continue; /* yes, use VDisplay here, not xf86ModeHeight */ dpi = (mode->VDisplay * 254) / (mm_height * 10); diff = dpi - DEFAULT_DPI; diff = diff < 0 ? -diff : diff; if (target_mode == NULL || (preferred > target_preferred) || (preferred == target_preferred && diff < target_diff)) { target_mode = mode; target_diff = diff; target_preferred = preferred; } } return target_mode; } static DisplayModePtr xf86ClosestMode(xf86OutputPtr output, DisplayModePtr match, Rotation match_rotation, int width, int height) { DisplayModePtr target_mode = NULL; DisplayModePtr mode; int target_diff = 0; /* * Pick a mode closest to the specified mode */ for (mode = output->probed_modes; mode; mode = mode->next) { int dx, dy; int diff; if (xf86ModeWidth(mode, output->initial_rotation) > width || xf86ModeHeight(mode, output->initial_rotation) > height) continue; /* exact matches are preferred */ if (output->initial_rotation == match_rotation && xf86ModesEqual(mode, match)) return mode; dx = xf86ModeWidth(match, match_rotation) - xf86ModeWidth(mode, output-> initial_rotation); dy = xf86ModeHeight(match, match_rotation) - xf86ModeHeight(mode, output-> initial_rotation); diff = dx * dx + dy * dy; if (target_mode == NULL || diff < target_diff) { target_mode = mode; target_diff = diff; } } return target_mode; } static DisplayModePtr xf86OutputHasPreferredMode(xf86OutputPtr output, int width, int height) { DisplayModePtr mode; for (mode = output->probed_modes; mode; mode = mode->next) { if (xf86ModeWidth(mode, output->initial_rotation) > width || xf86ModeHeight(mode, output->initial_rotation) > height) continue; if (mode->type & M_T_PREFERRED) return mode; } return NULL; } static DisplayModePtr xf86OutputHasUserPreferredMode(xf86OutputPtr output) { DisplayModePtr mode, first = output->probed_modes; for (mode = first; mode && mode->next != first; mode = mode->next) if (mode->type & M_T_USERPREF) return mode; return NULL; } static int xf86PickCrtcs(ScrnInfoPtr scrn, xf86CrtcPtr * best_crtcs, DisplayModePtr * modes, int n, int width, int height) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int c, o; xf86OutputPtr output; xf86CrtcPtr crtc; xf86CrtcPtr *crtcs; int best_score; int score; int my_score; if (n == config->num_output) return 0; output = config->output[n]; /* * Compute score with this output disabled */ best_crtcs[n] = NULL; best_score = xf86PickCrtcs(scrn, best_crtcs, modes, n + 1, width, height); if (modes[n] == NULL) return best_score; crtcs = malloc(config->num_output * sizeof(xf86CrtcPtr)); if (!crtcs) return best_score; my_score = 1; /* Score outputs that are known to be connected higher */ if (output->status == XF86OutputStatusConnected) my_score++; /* Score outputs with preferred modes higher */ if (xf86OutputHasPreferredMode(output, width, height)) my_score++; /* * Select a crtc for this output and * then attempt to configure the remaining * outputs */ for (c = 0; c < config->num_crtc; c++) { if ((output->possible_crtcs & (1 << c)) == 0) continue; crtc = config->crtc[c]; /* * Check to see if some other output is * using this crtc */ for (o = 0; o < n; o++) if (best_crtcs[o] == crtc) break; if (o < n) { /* * If the two outputs desire the same mode, * see if they can be cloned */ if (xf86ModesEqual(modes[o], modes[n]) && config->output[o]->initial_rotation == config->output[n]->initial_rotation && config->output[o]->initial_x == config->output[n]->initial_x && config->output[o]->initial_y == config->output[n]->initial_y) { if ((output->possible_clones & (1 << o)) == 0) continue; /* nope, try next CRTC */ } else continue; /* different modes, can't clone */ } crtcs[n] = crtc; memcpy(crtcs, best_crtcs, n * sizeof(xf86CrtcPtr)); score = my_score + xf86PickCrtcs(scrn, crtcs, modes, n + 1, width, height); if (score > best_score) { best_score = score; memcpy(best_crtcs, crtcs, config->num_output * sizeof(xf86CrtcPtr)); } } free(crtcs); return best_score; } /* * Compute the virtual size necessary to place all of the available * crtcs in the specified configuration. * * canGrow indicates that the driver can make the screen larger than its initial * configuration. If FALSE, this function will enlarge the screen to include * the largest available mode. */ static void xf86DefaultScreenLimits(ScrnInfoPtr scrn, int *widthp, int *heightp, Bool canGrow) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int width = 0, height = 0; int o; int c; int s; for (c = 0; c < config->num_crtc; c++) { int crtc_width = 0, crtc_height = 0; xf86CrtcPtr crtc = config->crtc[c]; if (crtc->enabled) { crtc_width = crtc->desiredX + xf86ModeWidth(&crtc->desiredMode, crtc->desiredRotation); crtc_height = crtc->desiredY + xf86ModeHeight(&crtc->desiredMode, crtc->desiredRotation); } if (!canGrow) { for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; for (s = 0; s < config->num_crtc; s++) if (output->possible_crtcs & (1 << s)) { DisplayModePtr mode; for (mode = output->probed_modes; mode; mode = mode->next) { if (mode->HDisplay > crtc_width) crtc_width = mode->HDisplay; if (mode->VDisplay > crtc_width) crtc_width = mode->VDisplay; if (mode->VDisplay > crtc_height) crtc_height = mode->VDisplay; if (mode->HDisplay > crtc_height) crtc_height = mode->HDisplay; } } } } if (crtc_width > width) width = crtc_width; if (crtc_height > height) height = crtc_height; } if (config->maxWidth && width > config->maxWidth) width = config->maxWidth; if (config->maxHeight && height > config->maxHeight) height = config->maxHeight; if (config->minWidth && width < config->minWidth) width = config->minWidth; if (config->minHeight && height < config->minHeight) height = config->minHeight; *widthp = width; *heightp = height; } #define POSITION_UNSET -100000 /* * check if the user configured any outputs at all * with either a position or a relative setting or a mode. */ static Bool xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr * modes) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o; Bool user_conf = FALSE; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; const char *position; const char *relative_name; OutputOpts relation; int r; static const OutputOpts relations[] = { OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF }; position = xf86GetOptValString(output->options, OPTION_POSITION); if (position) user_conf = TRUE; relation = 0; relative_name = NULL; for (r = 0; r < 4; r++) { relation = relations[r]; relative_name = xf86GetOptValString(output->options, relation); if (relative_name) break; } if (relative_name) user_conf = TRUE; modes[o] = xf86OutputHasUserPreferredMode(output); if (modes[o]) user_conf = TRUE; } return user_conf; } static Bool xf86InitialOutputPositions(ScrnInfoPtr scrn, DisplayModePtr * modes) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o; int min_x, min_y; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; output->initial_x = output->initial_y = POSITION_UNSET; } /* * Loop until all outputs are set */ for (;;) { Bool any_set = FALSE; Bool keep_going = FALSE; for (o = 0; o < config->num_output; o++) { static const OutputOpts relations[] = { OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF }; xf86OutputPtr output = config->output[o]; xf86OutputPtr relative; const char *relative_name; const char *position; OutputOpts relation; int r; if (output->initial_x != POSITION_UNSET) continue; position = xf86GetOptValString(output->options, OPTION_POSITION); /* * Absolute position wins */ if (position) { int x, y; if (sscanf(position, "%d %d", &x, &y) == 2) { output->initial_x = x; output->initial_y = y; } else { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Output %s position not of form \"x y\"\n", output->name); output->initial_x = output->initial_y = 0; } any_set = TRUE; continue; } /* * Next comes relative positions */ relation = 0; relative_name = NULL; for (r = 0; r < 4; r++) { relation = relations[r]; relative_name = xf86GetOptValString(output->options, relation); if (relative_name) break; } if (relative_name) { int or; relative = NULL; for (or = 0; or < config->num_output; or++) { xf86OutputPtr out_rel = config->output[or]; XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor; if (rel_mon) { if (xf86nameCompare(rel_mon->mon_identifier, relative_name) == 0) { relative = config->output[or]; break; } } if (strcmp(out_rel->name, relative_name) == 0) { relative = config->output[or]; break; } } if (!relative) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Cannot position output %s relative to unknown output %s\n", output->name, relative_name); output->initial_x = 0; output->initial_y = 0; any_set = TRUE; continue; } if (!modes[or]) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Cannot position output %s relative to output %s without modes\n", output->name, relative_name); output->initial_x = 0; output->initial_y = 0; any_set = TRUE; continue; } if (relative->initial_x == POSITION_UNSET) { keep_going = TRUE; continue; } output->initial_x = relative->initial_x; output->initial_y = relative->initial_y; switch (relation) { case OPTION_BELOW: output->initial_y += xf86ModeHeight(modes[or], relative->initial_rotation); break; case OPTION_RIGHT_OF: output->initial_x += xf86ModeWidth(modes[or], relative->initial_rotation); break; case OPTION_ABOVE: if (modes[o]) output->initial_y -= xf86ModeHeight(modes[o], output->initial_rotation); break; case OPTION_LEFT_OF: if (modes[o]) output->initial_x -= xf86ModeWidth(modes[o], output->initial_rotation); break; default: break; } any_set = TRUE; continue; } /* Nothing set, just stick them at 0,0 */ output->initial_x = 0; output->initial_y = 0; any_set = TRUE; } if (!keep_going) break; if (!any_set) { for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; if (output->initial_x == POSITION_UNSET) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Output position loop. Moving %s to 0,0\n", output->name); output->initial_x = output->initial_y = 0; break; } } } } /* * normalize positions */ min_x = 1000000; min_y = 1000000; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; if (output->initial_x < min_x) min_x = output->initial_x; if (output->initial_y < min_y) min_y = output->initial_y; } for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; output->initial_x -= min_x; output->initial_y -= min_y; } return TRUE; } static void xf86InitialPanning(ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; const char *panning = xf86GetOptValString(output->options, OPTION_PANNING); int width, height, left, top; int track_width, track_height, track_left, track_top; int brdr[4]; memset(&output->initialTotalArea, 0, sizeof(BoxRec)); memset(&output->initialTrackingArea, 0, sizeof(BoxRec)); memset(output->initialBorder, 0, 4 * sizeof(INT16)); if (!panning) continue; switch (sscanf(panning, "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d", &width, &height, &left, &top, &track_width, &track_height, &track_left, &track_top, &brdr[0], &brdr[1], &brdr[2], &brdr[3])) { case 12: output->initialBorder[0] = brdr[0]; output->initialBorder[1] = brdr[1]; output->initialBorder[2] = brdr[2]; output->initialBorder[3] = brdr[3]; /* fall through */ case 8: output->initialTrackingArea.x1 = track_left; output->initialTrackingArea.y1 = track_top; output->initialTrackingArea.x2 = track_left + track_width; output->initialTrackingArea.y2 = track_top + track_height; /* fall through */ case 4: output->initialTotalArea.x1 = left; output->initialTotalArea.y1 = top; /* fall through */ case 2: output->initialTotalArea.x2 = output->initialTotalArea.x1 + width; output->initialTotalArea.y2 = output->initialTotalArea.y1 + height; break; default: xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Broken panning specification '%s' for output %s in config file\n", panning, output->name); } } } /** Return - 0 + if a should be earlier, same or later than b in list */ static int xf86ModeCompare(DisplayModePtr a, DisplayModePtr b) { int diff; diff = ((b->type & M_T_PREFERRED) != 0) - ((a->type & M_T_PREFERRED) != 0); if (diff) return diff; diff = b->HDisplay * b->VDisplay - a->HDisplay * a->VDisplay; if (diff) return diff; diff = b->Clock - a->Clock; return diff; } /** * Insertion sort input in-place and return the resulting head */ static DisplayModePtr xf86SortModes(DisplayModePtr input) { DisplayModePtr output = NULL, i, o, n, *op, prev; /* sort by preferred status and pixel area */ while (input) { i = input; input = input->next; for (op = &output; (o = *op); op = &o->next) if (xf86ModeCompare(o, i) > 0) break; i->next = *op; *op = i; } /* prune identical modes */ for (o = output; o && (n = o->next); o = n) { if (!strcmp(o->name, n->name) && xf86ModesEqual(o, n)) { o->next = n->next; free((void *) n->name); free(n); n = o; } } /* hook up backward links */ prev = NULL; for (o = output; o; o = o->next) { o->prev = prev; prev = o; } return output; } static const char * preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output) { const char *preferred_mode = NULL; /* Check for a configured preference for a particular mode */ preferred_mode = xf86GetOptValString(output->options, OPTION_PREFERRED_MODE); if (preferred_mode) return preferred_mode; if (pScrn->display->modes && *pScrn->display->modes) preferred_mode = *pScrn->display->modes; return preferred_mode; } /** identify a token * args * *src a string with zero or more tokens, e.g. "tok0 tok1", * **token stores a pointer to the first token character, * *len stores the token length. * return * a pointer into src[] at the token terminating character, or * NULL if no token is found. */ static const char * gettoken(const char *src, const char **token, int *len) { const char *delim = " \t"; int skip; if (!src) return NULL; skip = strspn(src, delim); *token = &src[skip]; *len = strcspn(*token, delim); /* Support for backslash escaped delimiters could be implemented * here. */ /* (*token)[0] != '\0' <==> *len > 0 */ if (*len > 0) return &(*token)[*len]; else return NULL; } /** Check for a user configured zoom mode list, Option "ZoomModes": * * Section "Monitor" * Identifier "a21inch" * Option "ZoomModes" "1600x1200 1280x1024 1280x1024 640x480" * EndSection * * Each user mode name is searched for independently so the list * specification order is free. An output mode is matched at most * once, a mode with an already set M_T_USERDEF type bit is skipped. * Thus a repeat mode name specification matches the next output mode * with the same name. * * Ctrl+Alt+Keypad-{Plus,Minus} zooms {in,out} by selecting the * {next,previous} M_T_USERDEF mode in the screen modes list, itself * sorted toward lower dot area or lower dot clock frequency, see * modes/xf86Crtc.c: xf86SortModes() xf86SetScrnInfoModes(), and * common/xf86Cursor.c: xf86ZoomViewport(). */ static int processZoomModes(xf86OutputPtr output) { const char *zoom_modes; int count = 0; zoom_modes = xf86GetOptValString(output->options, OPTION_ZOOM_MODES); if (zoom_modes) { const char *token, *next; int len; next = gettoken(zoom_modes, &token, &len); while (next) { DisplayModePtr mode; for (mode = output->probed_modes; mode; mode = mode->next) if (!strncmp(token, mode->name, len) /* prefix match */ && mode->name[len] == '\0' /* equal length */ && !(mode->type & M_T_USERDEF)) { /* no rematch */ mode->type |= M_T_USERDEF; break; } count++; next = gettoken(next, &token, &len); } } return count; } static void GuessRangeFromModes(MonPtr mon, DisplayModePtr mode) { if (!mon || !mode) return; mon->nHsync = 1; mon->hsync[0].lo = 1024.0; mon->hsync[0].hi = 0.0; mon->nVrefresh = 1; mon->vrefresh[0].lo = 1024.0; mon->vrefresh[0].hi = 0.0; while (mode) { if (!mode->HSync) mode->HSync = ((float) mode->Clock) / ((float) mode->HTotal); if (!mode->VRefresh) mode->VRefresh = (1000.0 * ((float) mode->Clock)) / ((float) (mode->HTotal * mode->VTotal)); if (mode->HSync < mon->hsync[0].lo) mon->hsync[0].lo = mode->HSync; if (mode->HSync > mon->hsync[0].hi) mon->hsync[0].hi = mode->HSync; if (mode->VRefresh < mon->vrefresh[0].lo) mon->vrefresh[0].lo = mode->VRefresh; if (mode->VRefresh > mon->vrefresh[0].hi) mon->vrefresh[0].hi = mode->VRefresh; mode = mode->next; } /* stretch out the bottom to fit 640x480@60 */ if (mon->hsync[0].lo > 31.0) mon->hsync[0].lo = 31.0; if (mon->vrefresh[0].lo > 58.0) mon->vrefresh[0].lo = 58.0; } enum det_monrec_source { sync_config, sync_edid, sync_default }; struct det_monrec_parameter { MonRec *mon_rec; int *max_clock; Bool set_hsync; Bool set_vrefresh; enum det_monrec_source *sync_source; }; static void handle_detailed_monrec(struct detailed_monitor_section *det_mon, void *data) { struct det_monrec_parameter *p; p = (struct det_monrec_parameter *) data; if (det_mon->type == DS_RANGES) { struct monitor_ranges *ranges = &det_mon->section.ranges; if (p->set_hsync && ranges->max_h) { p->mon_rec->hsync[p->mon_rec->nHsync].lo = ranges->min_h; p->mon_rec->hsync[p->mon_rec->nHsync].hi = ranges->max_h; p->mon_rec->nHsync++; if (*p->sync_source == sync_default) *p->sync_source = sync_edid; } if (p->set_vrefresh && ranges->max_v) { p->mon_rec->vrefresh[p->mon_rec->nVrefresh].lo = ranges->min_v; p->mon_rec->vrefresh[p->mon_rec->nVrefresh].hi = ranges->max_v; p->mon_rec->nVrefresh++; if (*p->sync_source == sync_default) *p->sync_source = sync_edid; } if (ranges->max_clock * 1000 > *p->max_clock) *p->max_clock = ranges->max_clock * 1000; } } void xf86ProbeOutputModes(ScrnInfoPtr scrn, int maxX, int maxY) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o; /* When canGrow was TRUE in the initial configuration we have to * compare against the maximum values so that we don't drop modes. * When canGrow was FALSE, the maximum values would have been clamped * anyway. */ if (maxX == 0 || maxY == 0) { maxX = config->maxWidth; maxY = config->maxHeight; } /* Probe the list of modes for each output. */ for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; DisplayModePtr mode; DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL; const char *preferred_mode; xf86MonPtr edid_monitor; XF86ConfMonitorPtr conf_monitor; MonRec mon_rec; int min_clock = 0; int max_clock = 0; double clock; Bool add_default_modes; Bool debug_modes = config->debug_modes || xf86Initialising; enum det_monrec_source sync_source = sync_default; while (output->probed_modes != NULL) xf86DeleteMode(&output->probed_modes, output->probed_modes); /* * Check connection status */ output->status = (*output->funcs->detect) (output); if (output->status == XF86OutputStatusDisconnected && !xf86ReturnOptValBool(output->options, OPTION_ENABLE, FALSE)) { xf86OutputSetEDID(output, NULL); continue; } memset(&mon_rec, '\0', sizeof(mon_rec)); conf_monitor = output->conf_monitor; if (conf_monitor) { int i; for (i = 0; i < conf_monitor->mon_n_hsync; i++) { mon_rec.hsync[mon_rec.nHsync].lo = conf_monitor->mon_hsync[i].lo; mon_rec.hsync[mon_rec.nHsync].hi = conf_monitor->mon_hsync[i].hi; mon_rec.nHsync++; sync_source = sync_config; } for (i = 0; i < conf_monitor->mon_n_vrefresh; i++) { mon_rec.vrefresh[mon_rec.nVrefresh].lo = conf_monitor->mon_vrefresh[i].lo; mon_rec.vrefresh[mon_rec.nVrefresh].hi = conf_monitor->mon_vrefresh[i].hi; mon_rec.nVrefresh++; sync_source = sync_config; } config_modes = xf86GetMonitorModes(scrn, conf_monitor); } output_modes = (*output->funcs->get_modes) (output); /* * If the user has a preference, respect it. * Otherwise, don't second-guess the driver. */ if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES, &add_default_modes)) add_default_modes = (output_modes == NULL); edid_monitor = output->MonInfo; if (edid_monitor) { struct det_monrec_parameter p; struct disp_features *features = &edid_monitor->features; struct cea_data_block *hdmi_db; /* if display is not continuous-frequency, don't add default modes */ if (!GTF_SUPPORTED(features->msc)) add_default_modes = FALSE; p.mon_rec = &mon_rec; p.max_clock = &max_clock; p.set_hsync = mon_rec.nHsync == 0; p.set_vrefresh = mon_rec.nVrefresh == 0; p.sync_source = &sync_source; xf86ForEachDetailedBlock(edid_monitor, handle_detailed_monrec, &p); /* Look at the CEA HDMI vendor block for the max TMDS freq */ hdmi_db = xf86MonitorFindHDMIBlock(edid_monitor); if (hdmi_db && hdmi_db->len >= 7) { int tmds_freq = hdmi_db->u.vendor.hdmi.max_tmds_clock * 5000; xf86DrvMsg(scrn->scrnIndex, X_PROBED, "HDMI max TMDS frequency %dKHz\n", tmds_freq); if (tmds_freq > max_clock) max_clock = tmds_freq; } } if (xf86GetOptValFreq(output->options, OPTION_MIN_CLOCK, OPTUNITS_KHZ, &clock)) min_clock = (int) clock; if (xf86GetOptValFreq(output->options, OPTION_MAX_CLOCK, OPTUNITS_KHZ, &clock)) max_clock = (int) clock; /* If we still don't have a sync range, guess wildly */ if (!mon_rec.nHsync || !mon_rec.nVrefresh) GuessRangeFromModes(&mon_rec, output_modes); /* * These limits will end up setting a 1024x768@60Hz mode by default, * which seems like a fairly good mode to use when nothing else is * specified */ if (mon_rec.nHsync == 0) { mon_rec.hsync[0].lo = 31.0; mon_rec.hsync[0].hi = 55.0; mon_rec.nHsync = 1; } if (mon_rec.nVrefresh == 0) { mon_rec.vrefresh[0].lo = 58.0; mon_rec.vrefresh[0].hi = 62.0; mon_rec.nVrefresh = 1; } if (add_default_modes) default_modes = xf86GetDefaultModes(); /* * If this is not an RB monitor, remove RB modes from the default * pool. RB modes from the config or the monitor itself are fine. */ if (!mon_rec.reducedblanking) xf86ValidateModesReducedBlanking(scrn, default_modes); if (sync_source == sync_config) { /* * Check output and config modes against sync range from config file */ xf86ValidateModesSync(scrn, output_modes, &mon_rec); xf86ValidateModesSync(scrn, config_modes, &mon_rec); } /* * Check default modes against sync range */ xf86ValidateModesSync(scrn, default_modes, &mon_rec); /* * Check default modes against monitor max clock */ if (max_clock) { xf86ValidateModesClocks(scrn, default_modes, &min_clock, &max_clock, 1); xf86ValidateModesClocks(scrn, output_modes, &min_clock, &max_clock, 1); } output->probed_modes = NULL; output->probed_modes = xf86ModesAdd(output->probed_modes, config_modes); output->probed_modes = xf86ModesAdd(output->probed_modes, output_modes); output->probed_modes = xf86ModesAdd(output->probed_modes, default_modes); /* * Check all modes against max size, interlace, and doublescan */ if (maxX && maxY) xf86ValidateModesSize(scrn, output->probed_modes, maxX, maxY, 0); { int flags = (output->interlaceAllowed ? V_INTERLACE : 0) | (output->doubleScanAllowed ? V_DBLSCAN : 0); xf86ValidateModesFlags(scrn, output->probed_modes, flags); } /* * Check all modes against output */ for (mode = output->probed_modes; mode != NULL; mode = mode->next) if (mode->status == MODE_OK) mode->status = (*output->funcs->mode_valid) (output, mode); xf86PruneInvalidModes(scrn, &output->probed_modes, debug_modes); output->probed_modes = xf86SortModes(output->probed_modes); /* Check for a configured preference for a particular mode */ preferred_mode = preferredMode(scrn, output); if (preferred_mode) { for (mode = output->probed_modes; mode; mode = mode->next) { if (!strcmp(preferred_mode, mode->name)) { if (mode != output->probed_modes) { if (mode->prev) mode->prev->next = mode->next; if (mode->next) mode->next->prev = mode->prev; mode->next = output->probed_modes; output->probed_modes->prev = mode; mode->prev = NULL; output->probed_modes = mode; } mode->type |= (M_T_PREFERRED | M_T_USERPREF); break; } } } /* Ctrl+Alt+Keypad-{Plus,Minus} zoom mode: M_T_USERDEF mode type */ processZoomModes(output); output->initial_rotation = xf86OutputInitialRotation(output); if (debug_modes) { if (output->probed_modes != NULL) { xf86DrvMsg(scrn->scrnIndex, X_INFO, "Printing probed modes for output %s\n", output->name); } else { xf86DrvMsg(scrn->scrnIndex, X_INFO, "No remaining probed modes for output %s\n", output->name); } } for (mode = output->probed_modes; mode != NULL; mode = mode->next) { /* The code to choose the best mode per pipe later on will require * VRefresh to be set. */ mode->VRefresh = xf86ModeVRefresh(mode); xf86SetModeCrtc(mode, INTERLACE_HALVE_V); if (debug_modes) xf86PrintModeline(scrn->scrnIndex, mode); } } } /** * Copy one of the output mode lists to the ScrnInfo record */ static DisplayModePtr biggestMode(DisplayModePtr a, DisplayModePtr b) { int A, B; if (!a) return b; if (!b) return a; A = a->HDisplay * a->VDisplay; B = b->HDisplay * b->VDisplay; if (A > B) return a; return b; } static xf86OutputPtr SetCompatOutput(xf86CrtcConfigPtr config) { xf86OutputPtr output = NULL, test = NULL; DisplayModePtr maxmode = NULL, testmode, mode; int o, compat = -1, count, mincount = 0; if (config->num_output == 0) return NULL; /* Look for one that's definitely connected */ for (o = 0; o < config->num_output; o++) { test = config->output[o]; if (!test->crtc) continue; if (test->status != XF86OutputStatusConnected) continue; if (!test->probed_modes) continue; testmode = mode = test->probed_modes; for (count = 0; mode; mode = mode->next, count++) testmode = biggestMode(testmode, mode); if (!output) { output = test; compat = o; maxmode = testmode; mincount = count; } else if (maxmode == biggestMode(maxmode, testmode)) { output = test; compat = o; maxmode = testmode; mincount = count; } else if ((maxmode->HDisplay == testmode->HDisplay) && (maxmode->VDisplay == testmode->VDisplay) && count <= mincount) { output = test; compat = o; maxmode = testmode; mincount = count; } } /* If we didn't find one, take anything we can get */ if (!output) { for (o = 0; o < config->num_output; o++) { test = config->output[o]; if (!test->crtc) continue; if (!test->probed_modes) continue; if (!output) { output = test; compat = o; } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) { output = test; compat = o; } } } if (compat >= 0) { config->compat_output = compat; } 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; } void xf86SetScrnInfoModes(ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); xf86OutputPtr output; xf86CrtcPtr crtc; DisplayModePtr last, mode = NULL; output = SetCompatOutput(config); if (!output) return; /* punt */ crtc = output->crtc; /* Clear any existing modes from scrn->modes */ while (scrn->modes != NULL) xf86DeleteMode(&scrn->modes, scrn->modes); /* Set scrn->modes to the mode list for the 'compat' output */ scrn->modes = xf86DuplicateModes(scrn, output->probed_modes); if (crtc) { for (mode = scrn->modes; mode; mode = mode->next) if (xf86ModesEqual(mode, &crtc->desiredMode)) break; } if (!scrn->modes) { scrn->modes = xf86ModesAdd(scrn->modes, xf86CVTMode(scrn->display->virtualX, scrn->display->virtualY, 60, 0, 0)); } /* For some reason, scrn->modes is circular, unlike the other mode * lists. How great is that? */ for (last = scrn->modes; last && last->next; last = last->next); last->next = scrn->modes; scrn->modes->prev = last; if (mode) { while (scrn->modes != mode) scrn->modes = scrn->modes->next; } scrn->currentMode = scrn->modes; #ifdef XFreeXDGA if (scrn->pScreen) _xf86_di_dga_reinit_internal(scrn->pScreen); #endif } static Bool xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, Bool *enabled) { Bool any_enabled = FALSE; int o; /* * Don't bother enabling outputs on GPU screens: a client needs to attach * it to a source provider before setting a mode that scans out a shared * pixmap. */ if (scrn->is_gpu) return FALSE; for (o = 0; o < config->num_output; o++) any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE); if (!any_enabled) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "No outputs definitely connected, trying again...\n"); for (o = 0; o < config->num_output; o++) any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], FALSE); } return any_enabled; } static Bool nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index) { int o = *index; for (o++; o < config->num_output; o++) { if (enabled[o]) { *index = o; return TRUE; } } return FALSE; } static Bool aspectMatch(float a, float b) { return fabs(1 - (a / b)) < 0.05; } static DisplayModePtr nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect) { DisplayModePtr m = NULL; if (!o) return NULL; if (!last) m = o->probed_modes; else m = last->next; for (; m; m = m->next) if (aspectMatch(aspect, (float) m->HDisplay / (float) m->VDisplay)) return m; return NULL; } static DisplayModePtr bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) { int o = -1, p; DisplayModePtr mode = NULL, test = NULL, match = NULL; if (!nextEnabledOutput(config, enabled, &o)) return NULL; while ((mode = nextAspectMode(config->output[o], mode, aspect))) { test = mode; for (p = o; nextEnabledOutput(config, enabled, &p);) { test = xf86OutputFindClosestMode(config->output[p], mode); if (!test) break; if (test->HDisplay != mode->HDisplay || test->VDisplay != mode->VDisplay) { test = NULL; break; } } /* if we didn't match it on all outputs, try the next one */ if (!test) continue; /* if it's bigger than the last one, save it */ if (!match || (test->HDisplay > match->HDisplay)) match = test; } /* return the biggest one found */ return match; } static Bool xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, DisplayModePtr * modes, Bool *enabled, int width, int height) { int o, p; int max_pref_width = 0, max_pref_height = 0; DisplayModePtr *preferred, *preferred_match; Bool ret = FALSE; preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); /* Check if the preferred mode is available on all outputs */ for (p = -1; nextEnabledOutput(config, enabled, &p);) { Rotation r = config->output[p]->initial_rotation; DisplayModePtr mode; if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p], width, height))) { int pref_width = xf86ModeWidth(preferred[p], r); int pref_height = xf86ModeHeight(preferred[p], r); Bool all_match = TRUE; for (o = -1; nextEnabledOutput(config, enabled, &o);) { Bool match = FALSE; xf86OutputPtr output = config->output[o]; if (o == p) continue; /* * First see if the preferred mode matches on the next * output as well. This catches the common case of identical * monitors and makes sure they all have the same timings * and refresh. If that fails, we fall back to trying to * match just width & height. */ mode = xf86OutputHasPreferredMode(output, pref_width, pref_height); if (mode && xf86ModesEqual(mode, preferred[p])) { preferred[o] = mode; match = TRUE; } else { for (mode = output->probed_modes; mode; mode = mode->next) { Rotation ir = output->initial_rotation; if (xf86ModeWidth(mode, ir) == pref_width && xf86ModeHeight(mode, ir) == pref_height) { preferred[o] = mode; match = TRUE; } } } all_match &= match; } if (all_match && (pref_width * pref_height > max_pref_width * max_pref_height)) { for (o = -1; nextEnabledOutput(config, enabled, &o);) preferred_match[o] = preferred[o]; max_pref_width = pref_width; max_pref_height = pref_height; ret = TRUE; } } } /* * If there's no preferred mode, but only one monitor, pick the * 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++); if (i != 1) break; p = -1; nextEnabledOutput(config, enabled, &p); if (config->output[p]->mm_height) aspect = (float) config->output[p]->mm_width / (float) config->output[p]->mm_height; a = bestModeForAspect(config, enabled, 4.0/3.0); if (aspect) b = bestModeForAspect(config, enabled, aspect); preferred_match[p] = biggestMode(a, b); if (preferred_match[p]) ret = TRUE; } while (0); if (ret) { /* oh good, there is a match. stash the selected modes and return. */ memcpy(modes, preferred_match, config->num_output * sizeof(DisplayModePtr)); } free(preferred); free(preferred_match); return ret; } static Bool xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, DisplayModePtr * modes, Bool *enabled, int width, int height) { int o; float aspect = 0.0, *aspects; xf86OutputPtr output; Bool ret = FALSE; DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL; aspects = xnfcalloc(config->num_output, sizeof(float)); /* collect the aspect ratios */ for (o = -1; nextEnabledOutput(config, enabled, &o);) { output = config->output[o]; if (output->mm_height) aspects[o] = (float) output->mm_width / (float) output->mm_height; else aspects[o] = 4.0 / 3.0; } /* check that they're all the same */ for (o = -1; nextEnabledOutput(config, enabled, &o);) { output = config->output[o]; if (!aspect) { aspect = aspects[o]; } else if (!aspectMatch(aspect, aspects[o])) { goto no_aspect_match; } } /* if they're all 4:3, just skip ahead and save effort */ if (!aspectMatch(aspect, 4.0 / 3.0)) aspect_guess = bestModeForAspect(config, enabled, aspect); no_aspect_match: base_guess = bestModeForAspect(config, enabled, 4.0 / 3.0); guess = biggestMode(base_guess, aspect_guess); if (!guess) goto out; /* found a mode that works everywhere, now apply it */ for (o = -1; nextEnabledOutput(config, enabled, &o);) { modes[o] = xf86OutputFindClosestMode(config->output[o], guess); } ret = TRUE; out: free(aspects); return ret; } static Bool xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, DisplayModePtr * modes, Bool *enabled, int width, int height) { DisplayModePtr target_mode = NULL; Rotation target_rotation = RR_Rotate_0; DisplayModePtr default_mode; int default_preferred, target_preferred = 0, o; /* User preferred > preferred > other modes */ for (o = -1; nextEnabledOutput(config, enabled, &o);) { default_mode = xf86DefaultMode(config->output[o], width, height); if (!default_mode) continue; default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) + ((default_mode->type & M_T_USERPREF) != 0)); if (default_preferred > target_preferred || !target_mode) { target_mode = default_mode; target_preferred = default_preferred; target_rotation = config->output[o]->initial_rotation; config->compat_output = o; } } if (target_mode) modes[config->compat_output] = target_mode; /* Fill in other output modes */ for (o = -1; nextEnabledOutput(config, enabled, &o);) { if (!modes[o]) modes[o] = xf86ClosestMode(config->output[o], target_mode, target_rotation, width, height); } return target_mode != NULL; } static Bool xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, DisplayModePtr * modes, Bool *enabled, int width, int height) { int o; if (xf86UserConfiguredOutputs(scrn, modes)) return xf86TargetFallback(scrn, config, modes, enabled, width, height); for (o = -1; nextEnabledOutput(config, enabled, &o);) if (xf86OutputHasUserPreferredMode(config->output[o])) return xf86TargetFallback(scrn, config, modes, enabled, width, height); return FALSE; } static Bool xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, float gamma_blue) { int i, size = 256; CARD16 *red, *green, *blue; red = malloc(3 * size * sizeof(CARD16)); green = red + size; blue = green + size; /* Only cause warning if user wanted gamma to be set. */ if (!crtc->funcs->gamma_set && (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) { free(red); return FALSE; } else if (!crtc->funcs->gamma_set) { free(red); return TRUE; } /* At this early stage none of the randr-interface stuff is up. * So take the default gamma size for lack of something better. */ for (i = 0; i < size; i++) { if (gamma_red == 1.0) red[i] = i << 8; else red[i] = (CARD16) (pow((double) i / (double) (size - 1), 1. / (double) gamma_red) * (double) (size - 1) * 256); if (gamma_green == 1.0) green[i] = i << 8; else green[i] = (CARD16) (pow((double) i / (double) (size - 1), 1. / (double) gamma_green) * (double) (size - 1) * 256); if (gamma_blue == 1.0) blue[i] = i << 8; else blue[i] = (CARD16) (pow((double) i / (double) (size - 1), 1. / (double) gamma_blue) * (double) (size - 1) * 256); } /* Default size is 256, so anything else is failure. */ if (size != crtc->gamma_size) { free(red); return FALSE; } crtc->gamma_size = size; memcpy(crtc->gamma_red, red, crtc->gamma_size * sizeof(CARD16)); memcpy(crtc->gamma_green, green, crtc->gamma_size * sizeof(CARD16)); memcpy(crtc->gamma_blue, blue, crtc->gamma_size * sizeof(CARD16)); /* Do not set gamma now, delay until the crtc is activated. */ free(red); return TRUE; } static Bool xf86OutputSetInitialGamma(xf86OutputPtr output) { XF86ConfMonitorPtr mon = output->conf_monitor; float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; if (!mon) return TRUE; if (!output->crtc) return FALSE; /* Get configured values, where they exist. */ if (mon->mon_gamma_red >= GAMMA_MIN && mon->mon_gamma_red <= GAMMA_MAX) gamma_red = mon->mon_gamma_red; if (mon->mon_gamma_green >= GAMMA_MIN && mon->mon_gamma_green <= GAMMA_MAX) gamma_green = mon->mon_gamma_green; if (mon->mon_gamma_blue >= GAMMA_MIN && mon->mon_gamma_blue <= GAMMA_MAX) gamma_blue = mon->mon_gamma_blue; /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */ if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", output->name, gamma_red, gamma_green, gamma_blue); return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, gamma_blue); } else return TRUE; } /** * Construct default screen configuration * * Given auto-detected (and, eventually, configured) values, * construct a usable configuration for the system * * canGrow indicates that the driver can resize the screen to larger than its * initially configured size via the config->funcs->resize hook. If TRUE, this * function will set virtualX and virtualY to match the initial configuration * and leave config->max{Width,Height} alone. If FALSE, it will bloat * virtual[XY] to include the largest modes and set config->max{Width,Height} * accordingly. */ Bool xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o, c; xf86CrtcPtr *crtcs; DisplayModePtr *modes; Bool *enabled; int width, height; int i = scrn->scrnIndex; Bool have_outputs = TRUE; Bool ret; Bool success = FALSE; /* Set up the device options */ config->options = xnfalloc(sizeof(xf86DeviceOptions)); memcpy(config->options, xf86DeviceOptions, sizeof(xf86DeviceOptions)); xf86ProcessOptions(scrn->scrnIndex, scrn->options, config->options); config->debug_modes = xf86ReturnOptValBool(config->options, OPTION_MODEDEBUG, FALSE); if (scrn->display->virtualX && !scrn->is_gpu) width = scrn->display->virtualX; else width = config->maxWidth; if (scrn->display->virtualY && !scrn->is_gpu) height = scrn->display->virtualY; else height = config->maxHeight; xf86ProbeOutputModes(scrn, width, height); crtcs = xnfcalloc(config->num_output, sizeof(xf86CrtcPtr)); modes = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); enabled = xnfcalloc(config->num_output, sizeof(Bool)); ret = xf86CollectEnabledOutputs(scrn, config, enabled); if (ret == FALSE && canGrow) { if (!scrn->is_gpu) xf86DrvMsg(i, X_WARNING, "Unable to find connected outputs - setting %dx%d " "initial framebuffer\n", NO_OUTPUT_DEFAULT_WIDTH, NO_OUTPUT_DEFAULT_HEIGHT); have_outputs = FALSE; } else { if (xf86TargetUserpref(scrn, config, modes, enabled, width, height)) xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n"); else if (xf86TargetPreferred (scrn, config, modes, enabled, width, height)) xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n"); else if (xf86TargetAspect(scrn, config, modes, enabled, width, height)) xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n"); else if (xf86TargetFallback (scrn, config, modes, enabled, width, height)) xf86DrvMsg(i, X_INFO, "Using sloppy heuristic for initial modes\n"); else xf86DrvMsg(i, X_WARNING, "Unable to find initial modes\n"); } for (o = -1; nextEnabledOutput(config, enabled, &o);) { if (!modes[o]) xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Output %s enabled but has no modes\n", config->output[o]->name); else xf86DrvMsg(scrn->scrnIndex, X_INFO, "Output %s using initial mode %s\n", config->output[o]->name, modes[o]->name); } /* * Set the position of each output */ if (!xf86InitialOutputPositions(scrn, modes)) goto bailout; /* * Set initial panning of each output */ xf86InitialPanning(scrn); /* * Assign CRTCs to fit output configuration */ if (have_outputs && !xf86PickCrtcs(scrn, crtcs, modes, 0, width, height)) goto bailout; /* XXX override xf86 common frame computation code */ if (!scrn->is_gpu) { scrn->display->frameX0 = 0; scrn->display->frameY0 = 0; } for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; crtc->enabled = FALSE; memset(&crtc->desiredMode, '\0', sizeof(crtc->desiredMode)); /* Set default gamma for all crtc's. */ /* This is done to avoid problems later on with cloned outputs. */ xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0); } if (xf86_crtc_supports_gamma(scrn)) xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n"); /* * Set initial configuration */ for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; DisplayModePtr mode = modes[o]; xf86CrtcPtr crtc = crtcs[o]; if (mode && crtc) { xf86SaveModeContents(&crtc->desiredMode, mode); crtc->desiredRotation = output->initial_rotation; crtc->desiredX = output->initial_x; crtc->desiredY = output->initial_y; crtc->desiredTransformPresent = FALSE; crtc->enabled = TRUE; memcpy(&crtc->panningTotalArea, &output->initialTotalArea, sizeof(BoxRec)); memcpy(&crtc->panningTrackingArea, &output->initialTrackingArea, sizeof(BoxRec)); memcpy(crtc->panningBorder, output->initialBorder, 4 * sizeof(INT16)); output->crtc = crtc; if (!xf86OutputSetInitialGamma(output)) xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Initial gamma correction for output %s: failed.\n", output->name); } else { output->crtc = NULL; } } if (scrn->display->virtualX == 0 || scrn->is_gpu) { /* * Expand virtual size to cover the current config and potential mode * switches, if the driver can't enlarge the screen later. */ xf86DefaultScreenLimits(scrn, &width, &height, canGrow); if (have_outputs == FALSE) { if (width < NO_OUTPUT_DEFAULT_WIDTH && height < NO_OUTPUT_DEFAULT_HEIGHT) { width = NO_OUTPUT_DEFAULT_WIDTH; height = NO_OUTPUT_DEFAULT_HEIGHT; } } if (!scrn->is_gpu) { scrn->display->virtualX = width; scrn->display->virtualY = height; } } if (width > scrn->virtualX) scrn->virtualX = width; if (height > scrn->virtualY) scrn->virtualY = height; /* * Make sure the configuration isn't too small. */ if (width < config->minWidth || height < config->minHeight) goto bailout; /* * Limit the crtc config to virtual[XY] if the driver can't grow the * desktop. */ if (!canGrow) { xf86CrtcSetSizeRange(scrn, config->minWidth, config->minHeight, width, height); } xf86SetScrnInfoModes(scrn); success = TRUE; bailout: free(crtcs); free(modes); free(enabled); return success; } /* * Check the CRTC we're going to map each output to vs. it's current * CRTC. If they don't match, we have to disable the output and the CRTC * since the driver will have to re-route things. */ static void xf86PrepareOutputs(ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; #if RANDR_GET_CRTC_INTERFACE /* Disable outputs that are unused or will be re-routed */ if (!output->funcs->get_crtc || output->crtc != (*output->funcs->get_crtc) (output) || output->crtc == NULL) #endif (*output->funcs->dpms) (output, DPMSModeOff); } } static void xf86PrepareCrtcs(ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int c; for (c = 0; c < config->num_crtc; c++) { #if RANDR_GET_CRTC_INTERFACE xf86CrtcPtr crtc = config->crtc[c]; xf86OutputPtr output = NULL; uint32_t desired_outputs = 0, current_outputs = 0; int o; for (o = 0; o < config->num_output; o++) { output = config->output[o]; if (output->crtc == crtc) desired_outputs |= (1 << o); /* If we can't tell where it's mapped, force it off */ if (!output->funcs->get_crtc) { desired_outputs = 0; break; } if ((*output->funcs->get_crtc) (output) == crtc) current_outputs |= (1 << o); } /* * If mappings are different or the CRTC is unused, * we need to disable it */ if (desired_outputs != current_outputs || !desired_outputs) (*crtc->funcs->dpms) (crtc, DPMSModeOff); #else (*crtc->funcs->dpms) (crtc, DPMSModeOff); #endif } } /* * Using the desired mode information in each crtc, set * modes (used in EnterVT functions, or at server startup) */ Bool xf86SetDesiredModes(ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc = config->crtc[0]; int enabled = 0, failed = 0; int c; /* A driver with this hook will take care of this */ if (!crtc->funcs->set_mode_major) { xf86PrepareOutputs(scrn); xf86PrepareCrtcs(scrn); } for (c = 0; c < config->num_crtc; c++) { xf86OutputPtr output = NULL; int o; RRTransformPtr transform; crtc = config->crtc[c]; /* Skip disabled CRTCs */ if (!crtc->enabled) continue; if (xf86CompatOutput(scrn) && xf86CompatCrtc(scrn) == crtc) output = xf86CompatOutput(scrn); else { for (o = 0; o < config->num_output; o++) if (config->output[o]->crtc == crtc) { output = config->output[o]; break; } } /* paranoia */ if (!output) continue; /* Mark that we'll need to re-set the mode for sure */ memset(&crtc->mode, 0, sizeof(crtc->mode)); if (!crtc->desiredMode.CrtcHDisplay) { DisplayModePtr mode = xf86OutputFindClosestMode(output, scrn->currentMode); if (!mode) return FALSE; xf86SaveModeContents(&crtc->desiredMode, mode); crtc->desiredRotation = RR_Rotate_0; crtc->desiredTransformPresent = FALSE; crtc->desiredX = 0; crtc->desiredY = 0; } if (crtc->desiredTransformPresent) transform = &crtc->desiredTransform; else transform = NULL; if (xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation, transform, 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; ++failed; } } xf86DisableUnusedFunctions(scrn); return enabled != 0 || failed == 0; } /** * In the current world order, there are lists of modes per output, which may * or may not include the mode that was asked to be set by XFree86's mode * selection. Find the closest one, in the following preference order: * * - Equality * - Closer in size to the requested mode, but no larger * - Closer in refresh rate to the requested mode. */ DisplayModePtr xf86OutputFindClosestMode(xf86OutputPtr output, DisplayModePtr desired) { DisplayModePtr best = NULL, scan = NULL; for (scan = output->probed_modes; scan != NULL; scan = scan->next) { /* If there's an exact match, we're done. */ if (xf86ModesEqual(scan, desired)) { best = desired; break; } /* Reject if it's larger than the desired mode. */ if (scan->HDisplay > desired->HDisplay || scan->VDisplay > desired->VDisplay) { continue; } /* * If we haven't picked a best mode yet, use the first * one in the size range */ if (best == NULL) { best = scan; continue; } /* Find if it's closer to the right size than the current best * option. */ if ((scan->HDisplay > best->HDisplay && scan->VDisplay >= best->VDisplay) || (scan->HDisplay >= best->HDisplay && scan->VDisplay > best->VDisplay)) { best = scan; continue; } /* Find if it's still closer to the right refresh than the current * best resolution. */ if (scan->HDisplay == best->HDisplay && scan->VDisplay == best->VDisplay && (fabs(scan->VRefresh - desired->VRefresh) < fabs(best->VRefresh - desired->VRefresh))) { best = scan; } } return best; } /** * When setting a mode through XFree86-VidModeExtension or XFree86-DGA, * take the specified mode and apply it to the crtc connected to the compat * output. Then, find similar modes for the other outputs, as with the * InitialConfiguration code above. The goal is to clone the desired * mode across all outputs that are currently active. */ Bool xf86SetSingleMode(ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); Bool ok = TRUE; xf86OutputPtr compat_output; DisplayModePtr compat_mode = NULL; int c; /* * Let the compat output drive the final mode selection */ compat_output = xf86CompatOutput(pScrn); if (compat_output) compat_mode = xf86OutputFindClosestMode(compat_output, desired); if (compat_mode) desired = compat_mode; for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; DisplayModePtr crtc_mode = NULL; int o; if (!crtc->enabled) continue; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; DisplayModePtr output_mode; /* skip outputs not on this crtc */ if (output->crtc != crtc) continue; if (crtc_mode) { output_mode = xf86OutputFindClosestMode(output, crtc_mode); if (output_mode != crtc_mode) output->crtc = NULL; } else crtc_mode = xf86OutputFindClosestMode(output, desired); } if (!crtc_mode) { crtc->enabled = FALSE; continue; } if (!xf86CrtcSetModeTransform(crtc, crtc_mode, rotation, NULL, 0, 0)) ok = FALSE; else { xf86SaveModeContents(&crtc->desiredMode, crtc_mode); crtc->desiredRotation = rotation; crtc->desiredTransformPresent = FALSE; crtc->desiredX = 0; crtc->desiredY = 0; } } xf86DisableUnusedFunctions(pScrn); #ifdef RANDR_12_INTERFACE xf86RandR12TellChanged(pScrn->pScreen); #endif return ok; } /** * Set the DPMS power mode of all outputs and CRTCs. * * If the new mode is off, it will turn off outputs and then CRTCs. * Otherwise, it will affect CRTCs before outputs. */ void xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int i; if (!scrn->vtSema) return; if (mode == DPMSModeOff) { for (i = 0; i < config->num_output; i++) { xf86OutputPtr output = config->output[i]; if (output->crtc != NULL) (*output->funcs->dpms) (output, mode); } } for (i = 0; i < config->num_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; if (crtc->enabled) (*crtc->funcs->dpms) (crtc, mode); } if (mode != DPMSModeOff) { for (i = 0; i < config->num_output; i++) { xf86OutputPtr output = config->output[i]; if (output->crtc != NULL) (*output->funcs->dpms) (output, mode); } } } /** * Implement the screensaver by just calling down into the driver DPMS hooks. * * Even for monitors with no DPMS support, by the definition of our DPMS hooks, * the outputs will still get disabled (blanked). */ Bool xf86SaveScreen(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (xf86IsUnblank(mode)) xf86DPMSSet(pScrn, DPMSModeOn, 0); else xf86DPMSSet(pScrn, DPMSModeOff, 0); return TRUE; } /** * Disable all inactive crtcs and outputs */ void xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int o, c; for (o = 0; o < xf86_config->num_output; o++) { xf86OutputPtr output = xf86_config->output[o]; if (!output->crtc) (*output->funcs->dpms) (output, DPMSModeOff); } for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (!crtc->enabled) { crtc->funcs->dpms(crtc, DPMSModeOff); memset(&crtc->mode, 0, sizeof(crtc->mode)); xf86RotateDestroy(crtc); crtc->active = FALSE; } } if (pScrn->pScreen) xf86_crtc_notify(pScrn->pScreen); if (pScrn->ModeSet) pScrn->ModeSet(pScrn); } #ifdef RANDR_12_INTERFACE #define EDID_ATOM_NAME "EDID" /** * Set the RandR EDID property */ static void xf86OutputSetEDIDProperty(xf86OutputPtr output, void *data, int data_len) { Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE); /* This may get called before the RandR resources have been created */ if (output->randr_output == NULL) return; if (data_len != 0) { RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8, PropModeReplace, data_len, data, FALSE, TRUE); } else { RRDeleteOutputProperty(output->randr_output, edid_atom); } } #endif /* Pull out a phyiscal size from a detailed timing if available. */ struct det_phySize_parameter { xf86OutputPtr output; ddc_quirk_t quirks; Bool ret; }; static void handle_detailed_physical_size(struct detailed_monitor_section *det_mon, void *data) { struct det_phySize_parameter *p; p = (struct det_phySize_parameter *) data; if (p->ret == TRUE) return; xf86DetTimingApplyQuirks(det_mon, p->quirks, p->output->MonInfo->features.hsize, p->output->MonInfo->features.vsize); if (det_mon->type == DT && det_mon->section.d_timings.h_size != 0 && det_mon->section.d_timings.v_size != 0) { /* some sanity checking for aspect ratio: assume any h / v (or v / h) > 2.4 to be bogus. This would even include cinemascope */ if (((det_mon->section.d_timings.h_size * 5) < (det_mon->section.d_timings.v_size * 12)) && ((det_mon->section.d_timings.v_size * 5) < (det_mon->section.d_timings.h_size * 12))) { p->output->mm_width = det_mon->section.d_timings.h_size; p->output->mm_height = det_mon->section.d_timings.v_size; p->ret = TRUE; } else xf86DrvMsg(p->output->scrn->scrnIndex, X_WARNING, "Output %s: Strange aspect ratio (%i/%i), " "consider adding a quirk\n", p->output->name, det_mon->section.d_timings.h_size, det_mon->section.d_timings.v_size); } } /** * Set the EDID information for the specified output */ void xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon) { ScrnInfoPtr scrn = output->scrn; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); Bool debug_modes = config->debug_modes || xf86Initialising; #ifdef RANDR_12_INTERFACE int size; #endif free(output->MonInfo); output->MonInfo = edid_mon; output->mm_width = 0; output->mm_height = 0; if (debug_modes) { xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", output->name); xf86PrintEDID(edid_mon); } /* Set the DDC properties for the 'compat' output */ if (output == xf86CompatOutput(scrn)) xf86SetDDCproperties(scrn, edid_mon); #ifdef RANDR_12_INTERFACE /* Set the RandR output properties */ size = 0; if (edid_mon) { if (edid_mon->ver.version == 1) { size = 128; if (edid_mon->flags & EDID_COMPLETE_RAWDATA) size += edid_mon->no_sections * 128; } else if (edid_mon->ver.version == 2) size = 256; } xf86OutputSetEDIDProperty(output, edid_mon ? edid_mon->rawData : NULL, size); #endif if (edid_mon) { struct det_phySize_parameter p; p.output = output; p.quirks = xf86DDCDetectQuirks(scrn->scrnIndex, edid_mon, FALSE); p.ret = FALSE; xf86ForEachDetailedBlock(edid_mon, handle_detailed_physical_size, &p); /* if no mm size is available from a detailed timing, check the max size field */ if ((!output->mm_width || !output->mm_height) && (edid_mon->features.hsize && edid_mon->features.vsize)) { output->mm_width = edid_mon->features.hsize * 10; output->mm_height = edid_mon->features.vsize * 10; } } } /** * Return the list of modes supported by the EDID information * stored in 'output' */ DisplayModePtr xf86OutputGetEDIDModes(xf86OutputPtr output) { ScrnInfoPtr scrn = output->scrn; xf86MonPtr edid_mon = output->MonInfo; if (!edid_mon) return NULL; return xf86DDCGetModes(scrn->scrnIndex, edid_mon); } /* maybe we should care about DDC1? meh. */ xf86MonPtr xf86OutputGetEDID(xf86OutputPtr output, I2CBusPtr pDDCBus) { ScrnInfoPtr scrn = output->scrn; xf86MonPtr mon; mon = xf86DoEEDID(scrn, pDDCBus, TRUE); if (mon) xf86DDCApplyQuirks(scrn->scrnIndex, mon); return mon; } static const char *_xf86ConnectorNames[] = { "None", "VGA", "DVI-I", "DVI-D", "DVI-A", "Composite", "S-Video", "Component", "LFP", "Proprietary", "HDMI", "DisplayPort", }; const char * xf86ConnectorGetName(xf86ConnectorType connector) { return _xf86ConnectorNames[connector]; } static void x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) { dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1; dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2) dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; } static void x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) { if (crtc->enabled) { crtc_box->x1 = crtc->x; crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); crtc_box->y1 = crtc->y; crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); } else crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; } static int xf86_crtc_box_area(BoxPtr box) { return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); } #ifdef XV /* * Return the crtc covering 'box'. If two crtcs cover a portion of * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc * with greater coverage */ static xf86CrtcPtr xf86_covering_crtc(ScrnInfoPtr pScrn, BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcPtr crtc, best_crtc; int coverage, best_coverage; int c; BoxRec crtc_box, cover_box; best_crtc = NULL; best_coverage = 0; crtc_box_ret->x1 = 0; crtc_box_ret->x2 = 0; crtc_box_ret->y1 = 0; crtc_box_ret->y2 = 0; for (c = 0; c < xf86_config->num_crtc; c++) { crtc = xf86_config->crtc[c]; x86_crtc_box(crtc, &crtc_box); x86_crtc_box_intersect(&cover_box, &crtc_box, box); coverage = xf86_crtc_box_area(&cover_box); if (coverage && crtc == desired) { *crtc_box_ret = crtc_box; return crtc; } else if (coverage > best_coverage) { *crtc_box_ret = crtc_box; best_crtc = crtc; best_coverage = coverage; } } return best_crtc; } /* * For overlay video, compute the relevant CRTC and * clip video to that. * * returning FALSE means there was a memory failure of some kind, * not that the video shouldn't be displayed */ Bool xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, xf86CrtcPtr * crtc_ret, xf86CrtcPtr desired_crtc, BoxPtr dst, INT32 *xa, INT32 *xb, INT32 *ya, INT32 *yb, RegionPtr reg, INT32 width, INT32 height) { Bool ret; RegionRec crtc_region_local; RegionPtr crtc_region = reg; if (crtc_ret) { BoxRec crtc_box; xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst, desired_crtc, &crtc_box); if (crtc) { RegionInit(&crtc_region_local, &crtc_box, 1); crtc_region = &crtc_region_local; RegionIntersect(crtc_region, crtc_region, reg); } *crtc_ret = crtc; } ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb, crtc_region, width, height); if (crtc_region != reg) RegionUninit(&crtc_region_local); return ret; } #endif xf86_crtc_notify_proc_ptr xf86_wrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr new) { if (xf86CrtcConfigPrivateIndex != -1) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); xf86_crtc_notify_proc_ptr old; old = config->xf86_crtc_notify; config->xf86_crtc_notify = new; return old; } return NULL; } void xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) { if (xf86CrtcConfigPrivateIndex != -1) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); config->xf86_crtc_notify = old; } } void xf86_crtc_notify(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); if (config->xf86_crtc_notify) config->xf86_crtc_notify(screen); } Bool xf86_crtc_supports_gamma(ScrnInfoPtr pScrn) { if (xf86CrtcConfigPrivateIndex != -1) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcPtr crtc; /* for multiple drivers loaded we need this */ if (!xf86_config) return FALSE; if (xf86_config->num_crtc == 0) return FALSE; crtc = xf86_config->crtc[0]; return crtc->funcs->gamma_set != NULL; } 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; } } xorg-server-1.17.1/hw/xfree86/modes/xf86Crtc.h0000664000175100017510000006300312456571574015627 00000000000000/* * Copyright © 2006 Keith Packard * Copyright © 2011 Aaron Plattner * * 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. */ #ifndef _XF86CRTC_H_ #define _XF86CRTC_H_ #include #include "randrstr.h" #include "xf86Modes.h" #include "xf86Cursor.h" #include "xf86i2c.h" #include "damage.h" #include "picturestr.h" /* Compat definitions for older X Servers. */ #ifndef M_T_PREFERRED #define M_T_PREFERRED 0x08 #endif #ifndef M_T_DRIVER #define M_T_DRIVER 0x40 #endif #ifndef M_T_USERPREF #define M_T_USERPREF 0x80 #endif #ifndef HARDWARE_CURSOR_ARGB #define HARDWARE_CURSOR_ARGB 0x00004000 #endif typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr; typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr; /* define a standard for connector types */ typedef enum _xf86ConnectorType { XF86ConnectorNone, XF86ConnectorVGA, XF86ConnectorDVI_I, XF86ConnectorDVI_D, XF86ConnectorDVI_A, XF86ConnectorComposite, XF86ConnectorSvideo, XF86ConnectorComponent, XF86ConnectorLFP, XF86ConnectorProprietary, XF86ConnectorHDMI, XF86ConnectorDisplayPort, } xf86ConnectorType; typedef enum _xf86OutputStatus { XF86OutputStatusConnected, XF86OutputStatusDisconnected, XF86OutputStatusUnknown } xf86OutputStatus; typedef struct _xf86CrtcFuncs { /** * Turns the crtc on/off, or sets intermediate power levels if available. * * Unsupported intermediate modes drop to the lower power setting. If the * mode is DPMSModeOff, the crtc must be disabled sufficiently for it to * be safe to call mode_set. */ void (*dpms) (xf86CrtcPtr crtc, int mode); /** * Saves the crtc's state for restoration on VT switch. */ void (*save) (xf86CrtcPtr crtc); /** * Restore's the crtc's state at VT switch. */ void (*restore) (xf86CrtcPtr crtc); /** * Lock CRTC prior to mode setting, mostly for DRI. * Returns whether unlock is needed */ Bool (*lock) (xf86CrtcPtr crtc); /** * Unlock CRTC after mode setting, mostly for DRI */ void (*unlock) (xf86CrtcPtr crtc); /** * Callback to adjust the mode to be set in the CRTC. * * This allows a CRTC to adjust the clock or even the entire set of * timings, which is used for panels with fixed timings or for * buses with clock limitations. */ Bool (*mode_fixup) (xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode); /** * Prepare CRTC for an upcoming mode set. */ void (*prepare) (xf86CrtcPtr crtc); /** * Callback for setting up a video mode after fixups have been made. */ void (*mode_set) (xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode, int x, int y); /** * Commit mode changes to a CRTC */ void (*commit) (xf86CrtcPtr crtc); /* Set the color ramps for the CRTC to the given values. */ void (*gamma_set) (xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, int size); /** * Allocate the shadow area, delay the pixmap creation until needed */ void *(*shadow_allocate) (xf86CrtcPtr crtc, int width, int height); /** * Create shadow pixmap for rotation support */ PixmapPtr (*shadow_create) (xf86CrtcPtr crtc, void *data, int width, int height); /** * Destroy shadow pixmap */ void (*shadow_destroy) (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data); /** * Set cursor colors */ void (*set_cursor_colors) (xf86CrtcPtr crtc, int bg, int fg); /** * Set cursor position */ void (*set_cursor_position) (xf86CrtcPtr crtc, int x, int y); /** * Show cursor */ void (*show_cursor) (xf86CrtcPtr crtc); /** * Hide cursor */ void (*hide_cursor) (xf86CrtcPtr crtc); /** * Load monochrome image */ void (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image); Bool (*load_cursor_image_check) (xf86CrtcPtr crtc, CARD8 *image); /** * Load ARGB image */ void (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image); Bool (*load_cursor_argb_check) (xf86CrtcPtr crtc, CARD32 *image); /** * Clean up driver-specific bits of the crtc */ void (*destroy) (xf86CrtcPtr crtc); /** * Less fine-grained mode setting entry point for kernel modesetting */ Bool (*set_mode_major) (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y); /** * Callback for panning. Doesn't change the mode. * Added in ABI version 2 */ void (*set_origin) (xf86CrtcPtr crtc, int x, int y); /** */ Bool (*set_scanout_pixmap)(xf86CrtcPtr crtc, PixmapPtr pixmap); } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; #define XF86_CRTC_VERSION 5 struct _xf86Crtc { /** * ABI versioning */ int version; /** * Associated ScrnInfo */ ScrnInfoPtr scrn; /** * Desired state of this CRTC * * Set when this CRTC should be driving one or more outputs */ Bool enabled; /** * Active mode * * This reflects the mode as set in the CRTC currently * It will be cleared when the VT is not active or * during server startup */ DisplayModeRec mode; Rotation rotation; PixmapPtr rotatedPixmap; void *rotatedData; /** * Position on screen * * Locates this CRTC within the frame buffer */ int x, y; /** * Desired mode * * This is set to the requested mode, independent of * whether the VT is active. In particular, it receives * the startup configured mode and saves the active mode * on VT switch. */ DisplayModeRec desiredMode; Rotation desiredRotation; int desiredX, desiredY; /** crtc-specific functions */ const xf86CrtcFuncsRec *funcs; /** * Driver private * * Holds driver-private information */ void *driver_private; #ifdef RANDR_12_INTERFACE /** * RandR crtc * * When RandR 1.2 is available, this * points at the associated crtc object */ RRCrtcPtr randr_crtc; #else void *randr_crtc; #endif /** * Current cursor is ARGB */ Bool cursor_argb; /** * Track whether cursor is within CRTC range */ Bool cursor_in_range; /** * Track state of cursor associated with this CRTC */ Bool cursor_shown; /** * Current transformation matrix */ PictTransform crtc_to_framebuffer; /* framebuffer_to_crtc was removed in ABI 2 */ struct pict_f_transform f_crtc_to_framebuffer; /* ABI 2 */ struct pict_f_transform f_framebuffer_to_crtc; /* ABI 2 */ PictFilterPtr filter; /* ABI 2 */ xFixed *params; /* ABI 2 */ int nparams; /* ABI 2 */ int filter_width; /* ABI 2 */ int filter_height; /* ABI 2 */ Bool transform_in_use; RRTransformRec transform; /* ABI 2 */ Bool transformPresent; /* ABI 2 */ RRTransformRec desiredTransform; /* ABI 2 */ Bool desiredTransformPresent; /* ABI 2 */ /** * Bounding box in screen space */ BoxRec bounds; /** * Panning: * TotalArea: total panning area, larger than CRTC's size * TrackingArea: Area of the pointer for which the CRTC is panned * border: Borders of the displayed CRTC area which induces panning if the pointer reaches them * Added in ABI version 2 */ BoxRec panningTotalArea; BoxRec panningTrackingArea; INT16 panningBorder[4]; /** * Current gamma, especially useful after initial config. * Added in ABI version 3 */ CARD16 *gamma_red; CARD16 *gamma_green; CARD16 *gamma_blue; int gamma_size; /** * Actual state of this CRTC * * Set to TRUE after modesetting, set to FALSE if no outputs are connected * Added in ABI version 3 */ Bool active; /** * Clear the shadow */ Bool shadowClear; /** * Indicates that the driver is handling the transform, so the shadow * surface should be disabled. The driver writes this field before calling * xf86CrtcRotate to indicate that it is handling the transform (including * rotation and reflection). * * Setting this flag also causes the server to stop adjusting the cursor * image and position. * * Added in ABI version 4 */ Bool driverIsPerformingTransform; /* Added in ABI version 5 */ PixmapPtr current_scanout; }; typedef struct _xf86OutputFuncs { /** * Called to allow the output a chance to create properties after the * RandR objects have been created. */ void (*create_resources) (xf86OutputPtr output); /** * Turns the output on/off, or sets intermediate power levels if available. * * Unsupported intermediate modes drop to the lower power setting. If the * mode is DPMSModeOff, the output must be disabled, as the DPLL may be * disabled afterwards. */ void (*dpms) (xf86OutputPtr output, int mode); /** * Saves the output's state for restoration on VT switch. */ void (*save) (xf86OutputPtr output); /** * Restore's the output's state at VT switch. */ void (*restore) (xf86OutputPtr output); /** * Callback for testing a video mode for a given output. * * This function should only check for cases where a mode can't be supported * on the output specifically, and not represent generic CRTC limitations. * * \return MODE_OK if the mode is valid, or another MODE_* otherwise. */ int (*mode_valid) (xf86OutputPtr output, DisplayModePtr pMode); /** * Callback to adjust the mode to be set in the CRTC. * * This allows an output to adjust the clock or even the entire set of * timings, which is used for panels with fixed timings or for * buses with clock limitations. */ Bool (*mode_fixup) (xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode); /** * Callback for preparing mode changes on an output */ void (*prepare) (xf86OutputPtr output); /** * Callback for committing mode changes on an output */ void (*commit) (xf86OutputPtr output); /** * Callback for setting up a video mode after fixups have been made. * * This is only called while the output is disabled. The dpms callback * must be all that's necessary for the output, to turn the output on * after this function is called. */ void (*mode_set) (xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode); /** * Probe for a connected output, and return detect_status. */ xf86OutputStatus(*detect) (xf86OutputPtr output); /** * Query the device for the modes it provides. * * This function may also update MonInfo, mm_width, and mm_height. * * \return singly-linked list of modes or NULL if no modes found. */ DisplayModePtr(*get_modes) (xf86OutputPtr output); #ifdef RANDR_12_INTERFACE /** * Callback when an output's property has changed. */ Bool (*set_property) (xf86OutputPtr output, Atom property, RRPropertyValuePtr value); #endif #ifdef RANDR_13_INTERFACE /** * Callback to get an updated property value */ Bool (*get_property) (xf86OutputPtr output, Atom property); #endif #ifdef RANDR_GET_CRTC_INTERFACE /** * Callback to get current CRTC for a given output */ xf86CrtcPtr(*get_crtc) (xf86OutputPtr output); #endif /** * Clean up driver-specific bits of the output */ void (*destroy) (xf86OutputPtr output); } xf86OutputFuncsRec, *xf86OutputFuncsPtr; #define XF86_OUTPUT_VERSION 2 struct _xf86Output { /** * ABI versioning */ int version; /** * Associated ScrnInfo */ ScrnInfoPtr scrn; /** * Currently connected crtc (if any) * * If this output is not in use, this field will be NULL. */ xf86CrtcPtr crtc; /** * Possible CRTCs for this output as a mask of crtc indices */ CARD32 possible_crtcs; /** * Possible outputs to share the same CRTC as a mask of output indices */ CARD32 possible_clones; /** * Whether this output can support interlaced modes */ Bool interlaceAllowed; /** * Whether this output can support double scan modes */ Bool doubleScanAllowed; /** * List of available modes on this output. * * This should be the list from get_modes(), plus perhaps additional * compatible modes added later. */ DisplayModePtr probed_modes; /** * Options parsed from the related monitor section */ OptionInfoPtr options; /** * Configured monitor section */ XF86ConfMonitorPtr conf_monitor; /** * Desired initial position */ int initial_x, initial_y; /** * Desired initial rotation */ Rotation initial_rotation; /** * Current connection status * * This indicates whether a monitor is known to be connected * to this output or not, or whether there is no way to tell */ xf86OutputStatus status; /** EDID monitor information */ xf86MonPtr MonInfo; /** subpixel order */ int subpixel_order; /** Physical size of the currently attached output device. */ int mm_width, mm_height; /** Output name */ char *name; /** output-specific functions */ const xf86OutputFuncsRec *funcs; /** driver private information */ void *driver_private; /** Whether to use the old per-screen Monitor config section */ Bool use_screen_monitor; #ifdef RANDR_12_INTERFACE /** * RandR 1.2 output structure. * * When RandR 1.2 is available, this points at the associated * RandR output structure and is created when this output is created */ RROutputPtr randr_output; #else void *randr_output; #endif /** * Desired initial panning * Added in ABI version 2 */ BoxRec initialTotalArea; BoxRec initialTrackingArea; 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. * * The driver is responsible for updating scrn->virtualX and scrn->virtualY. * If the requested size cannot be set, the driver should leave those values * alone and return FALSE. * * A naive driver that cannot reallocate the screen may simply change * virtual[XY]. A more advanced driver will want to also change the * devPrivate.ptr and devKind of the screen pixmap, update any offscreen * pixmaps it may have moved, and change pScrn->displayWidth. */ Bool (*resize) (ScrnInfoPtr scrn, int width, int height); } xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr; typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen); typedef struct _xf86CrtcConfig { int num_output; xf86OutputPtr *output; /** * compat_output is used whenever we deal * with legacy code that only understands a single * output. pScrn->modes will be loaded from this output, * adjust frame will whack this output, etc. */ int compat_output; int num_crtc; xf86CrtcPtr *crtc; int minWidth, minHeight; int maxWidth, maxHeight; /* For crtc-based rotation */ DamagePtr rotation_damage; Bool rotation_damage_registered; /* DGA */ unsigned int dga_flags; unsigned long dga_address; DGAModePtr dga_modes; int dga_nmode; int dga_width, dga_height, dga_stride; DisplayModePtr dga_save_mode; const xf86CrtcConfigFuncsRec *funcs; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; /* Cursor information */ xf86CursorInfoPtr cursor_info; CursorPtr cursor; CARD8 *cursor_image; Bool cursor_on; CARD32 cursor_fg, cursor_bg; /** * Options parsed from the related device section */ OptionInfoPtr options; Bool debug_modes; /* wrap screen BlockHandler for rotation */ ScreenBlockHandlerProcPtr BlockHandler; /* 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; #define XF86_CRTC_CONFIG_PTR(p) ((xf86CrtcConfigPtr) ((p)->privates[xf86CrtcConfigPrivateIndex].ptr)) static _X_INLINE xf86OutputPtr xf86CompatOutput(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); return config->output[config->compat_output]; } static _X_INLINE xf86CrtcPtr xf86CompatCrtc(ScrnInfoPtr pScrn) { xf86OutputPtr compat_output = xf86CompatOutput(pScrn); if (!compat_output) return NULL; return compat_output->crtc; } static _X_INLINE RRCrtcPtr xf86CompatRRCrtc(ScrnInfoPtr pScrn) { xf86CrtcPtr compat_crtc = xf86CompatCrtc(pScrn); if (!compat_crtc) return NULL; return compat_crtc->randr_crtc; } /* * Initialize xf86CrtcConfig structure */ extern _X_EXPORT void xf86CrtcConfigInit(ScrnInfoPtr scrn, const xf86CrtcConfigFuncsRec * funcs); extern _X_EXPORT void xf86CrtcSetSizeRange(ScrnInfoPtr scrn, int minWidth, int minHeight, int maxWidth, int maxHeight); /* * Crtc functions */ extern _X_EXPORT xf86CrtcPtr xf86CrtcCreate(ScrnInfoPtr scrn, const xf86CrtcFuncsRec * funcs); extern _X_EXPORT void xf86CrtcDestroy(xf86CrtcPtr crtc); /** * Sets the given video mode on the given crtc */ extern _X_EXPORT Bool xf86CrtcSetModeTransform(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, RRTransformPtr transform, int x, int y); extern _X_EXPORT Bool xf86CrtcSetMode(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y); extern _X_EXPORT void xf86CrtcSetOrigin(xf86CrtcPtr crtc, int x, int y); /* * Assign crtc rotation during mode set */ extern _X_EXPORT Bool xf86CrtcRotate(xf86CrtcPtr crtc); /* * Clean up any rotation data, used when a crtc is turned off * as well as when rotation is disabled. */ extern _X_EXPORT void xf86RotateDestroy(xf86CrtcPtr crtc); /* * free shadow memory allocated for all crtcs */ extern _X_EXPORT void xf86RotateFreeShadow(ScrnInfoPtr pScrn); /* * Clean up rotation during CloseScreen */ extern _X_EXPORT void xf86RotateCloseScreen(ScreenPtr pScreen); /** * Return whether any output is assigned to the crtc */ extern _X_EXPORT Bool xf86CrtcInUse(xf86CrtcPtr crtc); /* * Output functions */ extern _X_EXPORT xf86OutputPtr xf86OutputCreate(ScrnInfoPtr scrn, const xf86OutputFuncsRec * funcs, const char *name); extern _X_EXPORT void xf86OutputUseScreenMonitor(xf86OutputPtr output, Bool use_screen_monitor); extern _X_EXPORT Bool xf86OutputRename(xf86OutputPtr output, const char *name); extern _X_EXPORT void xf86OutputDestroy(xf86OutputPtr output); extern _X_EXPORT void xf86ProbeOutputModes(ScrnInfoPtr pScrn, int maxX, int maxY); extern _X_EXPORT void xf86SetScrnInfoModes(ScrnInfoPtr pScrn); #ifdef RANDR_13_INTERFACE #define ScreenInitRetType int #else #define ScreenInitRetType Bool #endif extern _X_EXPORT ScreenInitRetType xf86CrtcScreenInit(ScreenPtr pScreen); extern _X_EXPORT Bool xf86InitialConfiguration(ScrnInfoPtr pScrn, Bool canGrow); extern _X_EXPORT void xf86DPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); extern _X_EXPORT Bool xf86SaveScreen(ScreenPtr pScreen, int mode); extern _X_EXPORT void xf86DisableUnusedFunctions(ScrnInfoPtr pScrn); extern _X_EXPORT DisplayModePtr xf86OutputFindClosestMode(xf86OutputPtr output, DisplayModePtr desired); extern _X_EXPORT Bool xf86SetSingleMode(ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation); /** * Set the EDID information for the specified output */ extern _X_EXPORT void xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon); /** * Return the list of modes supported by the EDID information * stored in 'output' */ extern _X_EXPORT DisplayModePtr xf86OutputGetEDIDModes(xf86OutputPtr output); extern _X_EXPORT xf86MonPtr xf86OutputGetEDID(xf86OutputPtr output, I2CBusPtr pDDCBus); /** * Initialize dga for this screen */ #ifdef XFreeXDGA extern _X_EXPORT Bool xf86DiDGAInit(ScreenPtr pScreen, unsigned long dga_address); /* this is the real function, used only internally */ _X_INTERNAL Bool _xf86_di_dga_init_internal(ScreenPtr pScreen); /** * Re-initialize dga for this screen (as when the set of modes changes) */ extern _X_EXPORT Bool xf86DiDGAReInit(ScreenPtr pScreen); #endif /* This is the real function, used only internally */ _X_INTERNAL Bool _xf86_di_dga_reinit_internal(ScreenPtr pScreen); /* * Set the subpixel order reported for the screen using * the information from the outputs */ extern _X_EXPORT void xf86CrtcSetScreenSubpixelOrder(ScreenPtr pScreen); /* * Get a standard string name for a connector type */ extern _X_EXPORT const char *xf86ConnectorGetName(xf86ConnectorType connector); /* * Using the desired mode information in each crtc, set * modes (used in EnterVT functions, or at server startup) */ extern _X_EXPORT Bool xf86SetDesiredModes(ScrnInfoPtr pScrn); /** * Initialize the CRTC-based cursor code. CRTC function vectors must * contain relevant cursor setting functions. * * Driver should call this from ScreenInit function */ extern _X_EXPORT Bool xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags); /** * Called when anything on the screen is reconfigured. * * Reloads cursor images as needed, then adjusts cursor positions. * * Driver should call this from crtc commit function. */ extern _X_EXPORT void xf86_reload_cursors(ScreenPtr screen); /** * Called from EnterVT to turn the cursors back on */ extern _X_EXPORT void xf86_show_cursors(ScrnInfoPtr scrn); /** * Called by the driver to turn cursors off */ extern _X_EXPORT void xf86_hide_cursors(ScrnInfoPtr scrn); /** * Clean up CRTC-based cursor code. Driver must call this at CloseScreen time. */ extern _X_EXPORT void xf86_cursors_fini(ScreenPtr screen); /** * Transform the cursor's coordinates based on the crtc transform. Normally * this is done by the server, but if crtc->driverIsPerformingTransform is TRUE, * then the server does not transform the cursor position automatically. */ extern _X_EXPORT void xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y); #ifdef XV /* * For overlay video, compute the relevant CRTC and * clip video to that. * wraps xf86XVClipVideoHelper() */ extern _X_EXPORT Bool xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, xf86CrtcPtr * crtc_ret, xf86CrtcPtr desired_crtc, BoxPtr dst, INT32 *xa, INT32 *xb, INT32 *ya, INT32 *yb, RegionPtr reg, INT32 width, INT32 height); #endif extern _X_EXPORT xf86_crtc_notify_proc_ptr xf86_wrap_crtc_notify(ScreenPtr pScreen, xf86_crtc_notify_proc_ptr new); extern _X_EXPORT void xf86_unwrap_crtc_notify(ScreenPtr pScreen, xf86_crtc_notify_proc_ptr old); extern _X_EXPORT void xf86_crtc_notify(ScreenPtr pScreen); /** * Gamma */ 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_ */ xorg-server-1.17.1/hw/xfree86/modes/xf86gtf.c0000664000175100017510000003202112456571574015503 00000000000000/* * gtf.c Generate mode timings using the GTF Timing Standard * * gcc gtf.c -o gtf -lm -Wall * * Copyright (c) 2001, Andy Ritger aritger@nvidia.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * o Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * o 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. * o Neither the name of NVIDIA 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 COPYRIGHT HOLDERS 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. * * This program is based on the Generalized Timing Formula(GTF TM) * Standard Version: 1.0, Revision: 1.0 * * The GTF Document contains the following Copyright information: * * Copyright (c) 1994, 1995, 1996 - Video Electronics Standards * Association. Duplication of this document within VESA member * companies for review purposes is permitted. All other rights * reserved. * * While every precaution has been taken in the preparation * of this standard, the Video Electronics Standards Association and * its contributors assume no responsibility for errors or omissions, * and make no warranties, expressed or implied, of functionality * of suitability for any purpose. The sample code contained within * this standard may be used without restriction. * * * * The GTF EXCEL(TM) SPREADSHEET, a sample (and the definitive) * implementation of the GTF Timing Standard, is available at: * * ftp://ftp.vesa.org/pub/GTF/GTF_V1R1.xls */ /* Ruthlessly converted to server code by Adam Jackson */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include "xf86.h" #include "xf86Modes.h" #include #define MARGIN_PERCENT 1.8 /* % of active vertical image */ #define CELL_GRAN 8.0 /* assumed character cell granularity */ #define MIN_PORCH 1 /* minimum front porch */ #define V_SYNC_RQD 3 /* width of vsync in lines */ #define H_SYNC_PERCENT 8.0 /* width of hsync as % of total line */ #define MIN_VSYNC_PLUS_BP 550.0 /* min time of vsync + back porch (microsec) */ #define M 600.0 /* blanking formula gradient */ #define C 40.0 /* blanking formula offset */ #define K 128.0 /* blanking formula scaling factor */ #define J 20.0 /* blanking formula scaling factor */ /* C' and M' are part of the Blanking Duty Cycle computation */ #define C_PRIME (((C - J) * K/256.0) + J) #define M_PRIME (K/256.0 * M) /* * xf86GTFMode() - as defined by the GTF Timing Standard, compute the * Stage 1 Parameters using the vertical refresh frequency. In other * words: input a desired resolution and desired refresh rate, and * output the GTF mode timings. * * XXX All the code is in place to compute interlaced modes, but I don't * feel like testing it right now. * * XXX margin computations are implemented but not tested (nor used by * XServer of fbset mode descriptions, from what I can tell). */ DisplayModePtr xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins) { DisplayModeRec *mode = xnfcalloc(1, sizeof(DisplayModeRec)); float h_pixels_rnd; float v_lines_rnd; float v_field_rate_rqd; float top_margin; float bottom_margin; float interlace; float h_period_est; float vsync_plus_bp; float v_back_porch; float total_v_lines; float v_field_rate_est; float h_period; float v_field_rate; float v_frame_rate; float left_margin; float right_margin; float total_active_pixels; float ideal_duty_cycle; float h_blank; float total_pixels; float pixel_freq; float h_freq; float h_sync; float h_front_porch; float v_odd_front_porch_lines; /* 1. In order to give correct results, the number of horizontal * pixels requested is first processed to ensure that it is divisible * by the character size, by rounding it to the nearest character * cell boundary: * * [H PIXELS RND] = ((ROUND([H PIXELS]/[CELL GRAN RND],0))*[CELLGRAN RND]) */ h_pixels_rnd = rint((float) h_pixels / CELL_GRAN) * CELL_GRAN; /* 2. If interlace is requested, the number of vertical lines assumed * by the calculation must be halved, as the computation calculates * the number of vertical lines per field. In either case, the * number of lines is rounded to the nearest integer. * * [V LINES RND] = IF([INT RQD?]="y", ROUND([V LINES]/2,0), * ROUND([V LINES],0)) */ v_lines_rnd = interlaced ? rint((float) v_lines) / 2.0 : rint((float) v_lines); /* 3. Find the frame rate required: * * [V FIELD RATE RQD] = IF([INT RQD?]="y", [I/P FREQ RQD]*2, * [I/P FREQ RQD]) */ v_field_rate_rqd = interlaced ? (freq * 2.0) : (freq); /* 4. Find number of lines in Top margin: * * [TOP MARGIN (LINES)] = IF([MARGINS RQD?]="Y", * ROUND(([MARGIN%]/100*[V LINES RND]),0), * 0) */ top_margin = margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0); /* 5. Find number of lines in Bottom margin: * * [BOT MARGIN (LINES)] = IF([MARGINS RQD?]="Y", * ROUND(([MARGIN%]/100*[V LINES RND]),0), * 0) */ bottom_margin = margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0); /* 6. If interlace is required, then set variable [INTERLACE]=0.5: * * [INTERLACE]=(IF([INT RQD?]="y",0.5,0)) */ interlace = interlaced ? 0.5 : 0.0; /* 7. Estimate the Horizontal period * * [H PERIOD EST] = ((1/[V FIELD RATE RQD]) - [MIN VSYNC+BP]/1000000) / * ([V LINES RND] + (2*[TOP MARGIN (LINES)]) + * [MIN PORCH RND]+[INTERLACE]) * 1000000 */ h_period_est = (((1.0 / v_field_rate_rqd) - (MIN_VSYNC_PLUS_BP / 1000000.0)) / (v_lines_rnd + (2 * top_margin) + MIN_PORCH + interlace) * 1000000.0); /* 8. Find the number of lines in V sync + back porch: * * [V SYNC+BP] = ROUND(([MIN VSYNC+BP]/[H PERIOD EST]),0) */ vsync_plus_bp = rint(MIN_VSYNC_PLUS_BP / h_period_est); /* 9. Find the number of lines in V back porch alone: * * [V BACK PORCH] = [V SYNC+BP] - [V SYNC RND] * * XXX is "[V SYNC RND]" a typo? should be [V SYNC RQD]? */ v_back_porch = vsync_plus_bp - V_SYNC_RQD; (void) v_back_porch; /* 10. Find the total number of lines in Vertical field period: * * [TOTAL V LINES] = [V LINES RND] + [TOP MARGIN (LINES)] + * [BOT MARGIN (LINES)] + [V SYNC+BP] + [INTERLACE] + * [MIN PORCH RND] */ total_v_lines = v_lines_rnd + top_margin + bottom_margin + vsync_plus_bp + interlace + MIN_PORCH; /* 11. Estimate the Vertical field frequency: * * [V FIELD RATE EST] = 1 / [H PERIOD EST] / [TOTAL V LINES] * 1000000 */ v_field_rate_est = 1.0 / h_period_est / total_v_lines * 1000000.0; /* 12. Find the actual horizontal period: * * [H PERIOD] = [H PERIOD EST] / ([V FIELD RATE RQD] / [V FIELD RATE EST]) */ h_period = h_period_est / (v_field_rate_rqd / v_field_rate_est); /* 13. Find the actual Vertical field frequency: * * [V FIELD RATE] = 1 / [H PERIOD] / [TOTAL V LINES] * 1000000 */ v_field_rate = 1.0 / h_period / total_v_lines * 1000000.0; /* 14. Find the Vertical frame frequency: * * [V FRAME RATE] = (IF([INT RQD?]="y", [V FIELD RATE]/2, [V FIELD RATE])) */ v_frame_rate = interlaced ? v_field_rate / 2.0 : v_field_rate; (void) v_frame_rate; /* 15. Find number of pixels in left margin: * * [LEFT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y", * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 / * [CELL GRAN RND]),0)) * [CELL GRAN RND], * 0)) */ left_margin = margins ? rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN : 0.0; /* 16. Find number of pixels in right margin: * * [RIGHT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y", * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 / * [CELL GRAN RND]),0)) * [CELL GRAN RND], * 0)) */ right_margin = margins ? rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN : 0.0; /* 17. Find total number of active pixels in image and left and right * margins: * * [TOTAL ACTIVE PIXELS] = [H PIXELS RND] + [LEFT MARGIN (PIXELS)] + * [RIGHT MARGIN (PIXELS)] */ total_active_pixels = h_pixels_rnd + left_margin + right_margin; /* 18. Find the ideal blanking duty cycle from the blanking duty cycle * equation: * * [IDEAL DUTY CYCLE] = [C'] - ([M']*[H PERIOD]/1000) */ ideal_duty_cycle = C_PRIME - (M_PRIME * h_period / 1000.0); /* 19. Find the number of pixels in the blanking time to the nearest * double character cell: * * [H BLANK (PIXELS)] = (ROUND(([TOTAL ACTIVE PIXELS] * * [IDEAL DUTY CYCLE] / * (100-[IDEAL DUTY CYCLE]) / * (2*[CELL GRAN RND])), 0)) * * (2*[CELL GRAN RND]) */ h_blank = rint(total_active_pixels * ideal_duty_cycle / (100.0 - ideal_duty_cycle) / (2.0 * CELL_GRAN)) * (2.0 * CELL_GRAN); /* 20. Find total number of pixels: * * [TOTAL PIXELS] = [TOTAL ACTIVE PIXELS] + [H BLANK (PIXELS)] */ total_pixels = total_active_pixels + h_blank; /* 21. Find pixel clock frequency: * * [PIXEL FREQ] = [TOTAL PIXELS] / [H PERIOD] */ pixel_freq = total_pixels / h_period; /* 22. Find horizontal frequency: * * [H FREQ] = 1000 / [H PERIOD] */ h_freq = 1000.0 / h_period; /* Stage 1 computations are now complete; I should really pass the results to another function and do the Stage 2 computations, but I only need a few more values so I'll just append the computations here for now */ /* 17. Find the number of pixels in the horizontal sync period: * * [H SYNC (PIXELS)] =(ROUND(([H SYNC%] / 100 * [TOTAL PIXELS] / * [CELL GRAN RND]),0))*[CELL GRAN RND] */ h_sync = rint(H_SYNC_PERCENT / 100.0 * total_pixels / CELL_GRAN) * CELL_GRAN; /* 18. Find the number of pixels in the horizontal front porch period: * * [H FRONT PORCH (PIXELS)] = ([H BLANK (PIXELS)]/2)-[H SYNC (PIXELS)] */ h_front_porch = (h_blank / 2.0) - h_sync; /* 36. Find the number of lines in the odd front porch period: * * [V ODD FRONT PORCH(LINES)]=([MIN PORCH RND]+[INTERLACE]) */ v_odd_front_porch_lines = MIN_PORCH + interlace; /* finally, pack the results in the mode struct */ mode->HDisplay = (int) (h_pixels_rnd); mode->HSyncStart = (int) (h_pixels_rnd + h_front_porch); mode->HSyncEnd = (int) (h_pixels_rnd + h_front_porch + h_sync); mode->HTotal = (int) (total_pixels); mode->VDisplay = (int) (v_lines_rnd); mode->VSyncStart = (int) (v_lines_rnd + v_odd_front_porch_lines); mode->VSyncEnd = (int) (v_lines_rnd + v_odd_front_porch_lines + V_SYNC_RQD); mode->VTotal = (int) (total_v_lines); mode->Clock = (int) (pixel_freq * 1000.0); mode->HSync = h_freq; mode->VRefresh = freq; xf86SetModeDefaultName(mode); mode->Flags = V_NHSYNC | V_PVSYNC; if (interlaced) { mode->VTotal *= 2; mode->Flags |= V_INTERLACE; } return mode; } xorg-server-1.17.1/hw/xfree86/modes/xf86RandR12.c0000664000175100017510000016636012456571574016112 00000000000000/* * Copyright © 2002 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 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. */ #ifdef HAVE_XORG_CONFIG_H #include #else #ifdef HAVE_CONFIG_H #include #endif #endif #include "xf86.h" #include "os.h" #include "globals.h" #include "xf86Modes.h" #include "xf86Priv.h" #include "xf86DDC.h" #include "mipointer.h" #include "windowstr.h" #include "inputstr.h" #include #include #include "xf86Crtc.h" #include "xf86RandR12.h" typedef struct _xf86RandR12Info { int virtualX; int virtualY; int mmWidth; int mmHeight; int maxX; int maxY; int pointerX; int pointerY; Rotation rotation; /* current mode */ Rotation supported_rotations; /* driver supported */ /* Used to wrap EnterVT so we can re-probe the outputs when a laptop unsuspends * (actually, any time that we switch back into our VT). * * See https://bugs.freedesktop.org/show_bug.cgi?id=21554 */ xf86EnterVTProc *orig_EnterVT; Bool panning; ConstrainCursorHarderProcPtr orig_ConstrainCursorHarder; } XF86RandRInfoRec, *XF86RandRInfoPtr; #ifdef RANDR_12_INTERFACE static Bool xf86RandR12Init12(ScreenPtr pScreen); static Bool xf86RandR12CreateScreenResources12(ScreenPtr pScreen); #endif static int xf86RandR12Generation; static DevPrivateKeyRec xf86RandR12KeyRec; static DevPrivateKey xf86RandR12Key; #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \ dixLookupPrivate(&(p)->devPrivates, xf86RandR12Key)) static int xf86RandR12ModeRefresh(DisplayModePtr mode) { if (mode->VRefresh) return (int) (mode->VRefresh + 0.5); else return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5); } /* Adapt panning area; return TRUE if panning area was valid without adaption */ static int xf86RandR13VerifyPanningArea(xf86CrtcPtr crtc, int screenWidth, int screenHeight) { int ret = TRUE; if (crtc->version < 2) return FALSE; if (crtc->panningTotalArea.x2 <= crtc->panningTotalArea.x1) { /* Panning in X is disabled */ if (crtc->panningTotalArea.x1 || crtc->panningTotalArea.x2) /* Illegal configuration -> fail/disable */ ret = FALSE; crtc->panningTotalArea.x1 = crtc->panningTotalArea.x2 = 0; crtc->panningTrackingArea.x1 = crtc->panningTrackingArea.x2 = 0; crtc->panningBorder[0] = crtc->panningBorder[2] = 0; } else { /* Panning in X is enabled */ if (crtc->panningTotalArea.x1 < 0) { /* Panning region outside screen -> move inside */ crtc->panningTotalArea.x2 -= crtc->panningTotalArea.x1; crtc->panningTotalArea.x1 = 0; ret = FALSE; } if (crtc->panningTotalArea.x2 < crtc->panningTotalArea.x1 + crtc->mode.HDisplay) { /* Panning region smaller than displayed area -> crop to displayed area */ crtc->panningTotalArea.x2 = crtc->panningTotalArea.x1 + crtc->mode.HDisplay; ret = FALSE; } if (crtc->panningTotalArea.x2 > screenWidth) { /* Panning region larger than screen -> move inside, then crop to screen */ crtc->panningTotalArea.x1 -= crtc->panningTotalArea.x2 - screenWidth; crtc->panningTotalArea.x2 = screenWidth; ret = FALSE; if (crtc->panningTotalArea.x1 < 0) crtc->panningTotalArea.x1 = 0; } if (crtc->panningBorder[0] + crtc->panningBorder[2] > crtc->mode.HDisplay) { /* Borders too large -> set to 0 */ crtc->panningBorder[0] = crtc->panningBorder[2] = 0; ret = FALSE; } } if (crtc->panningTotalArea.y2 <= crtc->panningTotalArea.y1) { /* Panning in Y is disabled */ if (crtc->panningTotalArea.y1 || crtc->panningTotalArea.y2) /* Illegal configuration -> fail/disable */ ret = FALSE; crtc->panningTotalArea.y1 = crtc->panningTotalArea.y2 = 0; crtc->panningTrackingArea.y1 = crtc->panningTrackingArea.y2 = 0; crtc->panningBorder[1] = crtc->panningBorder[3] = 0; } else { /* Panning in Y is enabled */ if (crtc->panningTotalArea.y1 < 0) { /* Panning region outside screen -> move inside */ crtc->panningTotalArea.y2 -= crtc->panningTotalArea.y1; crtc->panningTotalArea.y1 = 0; ret = FALSE; } if (crtc->panningTotalArea.y2 < crtc->panningTotalArea.y1 + crtc->mode.VDisplay) { /* Panning region smaller than displayed area -> crop to displayed area */ crtc->panningTotalArea.y2 = crtc->panningTotalArea.y1 + crtc->mode.VDisplay; ret = FALSE; } if (crtc->panningTotalArea.y2 > screenHeight) { /* Panning region larger than screen -> move inside, then crop to screen */ crtc->panningTotalArea.y1 -= crtc->panningTotalArea.y2 - screenHeight; crtc->panningTotalArea.y2 = screenHeight; ret = FALSE; if (crtc->panningTotalArea.y1 < 0) crtc->panningTotalArea.y1 = 0; } if (crtc->panningBorder[1] + crtc->panningBorder[3] > crtc->mode.VDisplay) { /* Borders too large -> set to 0 */ crtc->panningBorder[1] = crtc->panningBorder[3] = 0; ret = FALSE; } } return ret; } /* * The heart of the panning operation: * * Given a frame buffer position (fb_x, fb_y), * and a crtc position (crtc_x, crtc_y), * and a transform matrix which maps frame buffer to crtc, * compute a panning position (pan_x, pan_y) that * makes the resulting transform line those two up */ static void xf86ComputeCrtcPan(Bool transform_in_use, struct pixman_f_transform *m, double screen_x, double screen_y, double crtc_x, double crtc_y, int old_pan_x, int old_pan_y, int *new_pan_x, int *new_pan_y) { if (transform_in_use) { /* * Given the current transform, M, the current position * on the Screen, S, and the desired position on the CRTC, * C, compute a translation, T, such that: * * M T S = C * * where T is of the form * * | 1 0 dx | * | 0 1 dy | * | 0 0 1 | * * M T S = * | M00 Sx + M01 Sy + M00 dx + M01 dy + M02 | | Cx F | * | M10 Sx + M11 Sy + M10 dx + M11 dy + M12 | = | Cy F | * | M20 Sx + M21 Sy + M20 dx + M21 dy + M22 | | F | * * R = M S * * Cx F = M00 dx + M01 dy + R0 * Cy F = M10 dx + M11 dy + R1 * F = M20 dx + M21 dy + R2 * * Zero out dx, then dy * * F (Cx M10 - Cy M00) = * (M10 M01 - M00 M11) dy + M10 R0 - M00 R1 * F (M10 - Cy M20) = * (M10 M21 - M20 M11) dy + M10 R2 - M20 R1 * * F (Cx M11 - Cy M01) = * (M11 M00 - M01 M10) dx + M11 R0 - M01 R1 * F (M11 - Cy M21) = * (M11 M20 - M21 M10) dx + M11 R2 - M21 R1 * * Make some temporaries * * T = | Cx M10 - Cy M00 | * | Cx M11 - Cy M01 | * * U = | M10 M01 - M00 M11 | * | M11 M00 - M01 M10 | * * Q = | M10 R0 - M00 R1 | * | M11 R0 - M01 R1 | * * P = | M10 - Cy M20 | * | M11 - Cy M21 | * * W = | M10 M21 - M20 M11 | * | M11 M20 - M21 M10 | * * V = | M10 R2 - M20 R1 | * | M11 R2 - M21 R1 | * * Rewrite: * * F T0 = U0 dy + Q0 * F P0 = W0 dy + V0 * F T1 = U1 dx + Q1 * F P1 = W1 dx + V1 * * Solve for F (two ways) * * F (W0 T0 - U0 P0) = W0 Q0 - U0 V0 * * W0 Q0 - U0 V0 * F = ------------- * W0 T0 - U0 P0 * * F (W1 T1 - U1 P1) = W1 Q1 - U1 V1 * * W1 Q1 - U1 V1 * F = ------------- * W1 T1 - U1 P1 * * We'll use which ever solution works (denominator != 0) * * Finally, solve for dx and dy: * * dx = (F T1 - Q1) / U1 * dx = (F P1 - V1) / W1 * * dy = (F T0 - Q0) / U0 * dy = (F P0 - V0) / W0 */ double r[3]; double q[2], u[2], t[2], v[2], w[2], p[2]; double f; struct pict_f_vector d; int i; /* Get the un-normalized crtc coordinates again */ for (i = 0; i < 3; i++) r[i] = m->m[i][0] * screen_x + m->m[i][1] * screen_y + m->m[i][2]; /* Combine values into temporaries */ for (i = 0; i < 2; i++) { q[i] = m->m[1][i] * r[0] - m->m[0][i] * r[1]; u[i] = m->m[1][i] * m->m[0][1 - i] - m->m[0][i] * m->m[1][1 - i]; t[i] = m->m[1][i] * crtc_x - m->m[0][i] * crtc_y; v[i] = m->m[1][i] * r[2] - m->m[2][i] * r[1]; w[i] = m->m[1][i] * m->m[2][1 - i] - m->m[2][i] * m->m[1][1 - i]; p[i] = m->m[1][i] - m->m[2][i] * crtc_y; } /* Find a way to compute f */ f = 0; for (i = 0; i < 2; i++) { double a = w[i] * q[i] - u[i] * v[i]; double b = w[i] * t[i] - u[i] * p[i]; if (b != 0) { f = a / b; break; } } /* Solve for the resulting transform vector */ for (i = 0; i < 2; i++) { if (u[i]) d.v[1 - i] = (t[i] * f - q[i]) / u[i]; else if (w[1]) d.v[1 - i] = (p[i] * f - v[i]) / w[i]; else d.v[1 - i] = 0; } *new_pan_x = old_pan_x - floor(d.v[0] + 0.5); *new_pan_y = old_pan_y - floor(d.v[1] + 0.5); } else { *new_pan_x = screen_x - crtc_x; *new_pan_y = screen_y - crtc_y; } } static void xf86RandR13Pan(xf86CrtcPtr crtc, int x, int y) { int newX, newY; int width, height; Bool panned = FALSE; if (crtc->version < 2) return; if (!crtc->enabled || (crtc->panningTotalArea.x2 <= crtc->panningTotalArea.x1 && crtc->panningTotalArea.y2 <= crtc->panningTotalArea.y1)) return; newX = crtc->x; newY = crtc->y; width = crtc->mode.HDisplay; height = crtc->mode.VDisplay; if ((crtc->panningTrackingArea.x2 <= crtc->panningTrackingArea.x1 || (x >= crtc->panningTrackingArea.x1 && x < crtc->panningTrackingArea.x2)) && (crtc->panningTrackingArea.y2 <= crtc->panningTrackingArea.y1 || (y >= crtc->panningTrackingArea.y1 && y < crtc->panningTrackingArea.y2))) { struct pict_f_vector c; /* * Pre-clip the mouse position to the panning area so that we don't * push the crtc outside. This doesn't deal with changes to the * panning values, only mouse position changes. */ if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) { if (x < crtc->panningTotalArea.x1) x = crtc->panningTotalArea.x1; if (x >= crtc->panningTotalArea.x2) x = crtc->panningTotalArea.x2 - 1; } if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) { if (y < crtc->panningTotalArea.y1) y = crtc->panningTotalArea.y1; if (y >= crtc->panningTotalArea.y2) y = crtc->panningTotalArea.y2 - 1; } c.v[0] = x; c.v[1] = y; c.v[2] = 1.0; if (crtc->transform_in_use) { pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &c); } else { c.v[0] -= crtc->x; c.v[1] -= crtc->y; } if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) { if (c.v[0] < crtc->panningBorder[0]) { c.v[0] = crtc->panningBorder[0]; panned = TRUE; } if (c.v[0] >= width - crtc->panningBorder[2]) { c.v[0] = width - crtc->panningBorder[2] - 1; panned = TRUE; } } if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) { if (c.v[1] < crtc->panningBorder[1]) { c.v[1] = crtc->panningBorder[1]; panned = TRUE; } if (c.v[1] >= height - crtc->panningBorder[3]) { c.v[1] = height - crtc->panningBorder[3] - 1; panned = TRUE; } } if (panned) xf86ComputeCrtcPan(crtc->transform_in_use, &crtc->f_framebuffer_to_crtc, x, y, c.v[0], c.v[1], newX, newY, &newX, &newY); } /* * Ensure that the crtc is within the panning region. * * XXX This computation only works when we do not have a transform * in use. */ if (!crtc->transform_in_use) { /* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */ if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) { if (newX > crtc->panningTotalArea.x2 - width) newX = crtc->panningTotalArea.x2 - width; if (newX < crtc->panningTotalArea.x1) newX = crtc->panningTotalArea.x1; } if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) { if (newY > crtc->panningTotalArea.y2 - height) newY = crtc->panningTotalArea.y2 - height; if (newY < crtc->panningTotalArea.y1) newY = crtc->panningTotalArea.y1; } } if (newX != crtc->x || newY != crtc->y) xf86CrtcSetOrigin(crtc, newX, newY); } static Bool xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) { RRScreenSizePtr pSize; ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int maxX = 0, maxY = 0; *rotations = randrp->supported_rotations; if (randrp->virtualX == -1 || randrp->virtualY == -1) { randrp->virtualX = scrp->virtualX; randrp->virtualY = scrp->virtualY; } /* Re-probe the outputs for new monitors or modes */ if (scrp->vtSema) { xf86ProbeOutputModes(scrp, 0, 0); xf86SetScrnInfoModes(scrp); } for (mode = scrp->modes;; mode = mode->next) { int refresh = xf86RandR12ModeRefresh(mode); if (randrp->maxX == 0 || randrp->maxY == 0) { if (maxX < mode->HDisplay) maxX = mode->HDisplay; if (maxY < mode->VDisplay) maxY = mode->VDisplay; } pSize = RRRegisterSize(pScreen, mode->HDisplay, mode->VDisplay, randrp->mmWidth, randrp->mmHeight); if (!pSize) return FALSE; RRRegisterRate(pScreen, pSize, refresh); if (xf86ModesEqual(mode, scrp->currentMode)) { RRSetCurrentConfig(pScreen, randrp->rotation, refresh, pSize); } if (mode->next == scrp->modes) break; } if (randrp->maxX == 0 || randrp->maxY == 0) { randrp->maxX = maxX; randrp->maxY = maxY; } return TRUE; } static Bool xf86RandR12SetMode(ScreenPtr pScreen, DisplayModePtr mode, Bool useVirtual, int mmWidth, int mmHeight) { ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; int oldmmWidth = pScreen->mmWidth; int oldmmHeight = pScreen->mmHeight; WindowPtr pRoot = pScreen->root; DisplayModePtr currentMode = NULL; Bool ret = TRUE; if (pRoot) (*scrp->EnableDisableFBAccess) (scrp, FALSE); if (useVirtual) { scrp->virtualX = randrp->virtualX; scrp->virtualY = randrp->virtualY; } else { scrp->virtualX = mode->HDisplay; scrp->virtualY = mode->VDisplay; } if (randrp->rotation & (RR_Rotate_90 | RR_Rotate_270)) { /* If the screen is rotated 90 or 270 degrees, swap the sizes. */ pScreen->width = scrp->virtualY; pScreen->height = scrp->virtualX; pScreen->mmWidth = mmHeight; pScreen->mmHeight = mmWidth; } else { pScreen->width = scrp->virtualX; pScreen->height = scrp->virtualY; pScreen->mmWidth = mmWidth; pScreen->mmHeight = mmHeight; } if (scrp->currentMode == mode) { /* Save current mode */ currentMode = scrp->currentMode; /* Reset, just so we ensure the drivers SwitchMode is called */ scrp->currentMode = NULL; } /* * We know that if the driver failed to SwitchMode to the rotated * version, then it should revert back to it's prior mode. */ if (!xf86SwitchMode(pScreen, mode)) { ret = FALSE; scrp->virtualX = pScreen->width = oldWidth; scrp->virtualY = pScreen->height = oldHeight; pScreen->mmWidth = oldmmWidth; pScreen->mmHeight = oldmmHeight; scrp->currentMode = currentMode; } /* * Make sure the layout is correct */ xf86ReconfigureLayout(); /* * Make sure the whole screen is visible */ xf86SetViewport(pScreen, pScreen->width, pScreen->height); xf86SetViewport(pScreen, 0, 0); if (pRoot) (*scrp->EnableDisableFBAccess) (scrp, TRUE); return ret; } Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int pos[MAXDEVICES][2]; Bool useVirtual = FALSE; int maxX = 0, maxY = 0; Rotation oldRotation = randrp->rotation; DeviceIntPtr dev; Bool view_adjusted = FALSE; randrp->rotation = rotation; if (randrp->virtualX == -1 || randrp->virtualY == -1) { randrp->virtualX = scrp->virtualX; randrp->virtualY = scrp->virtualY; } for (dev = inputInfo.devices; dev; dev = dev->next) { if (!IsMaster(dev) && !IsFloating(dev)) continue; miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); } for (mode = scrp->modes;; mode = mode->next) { if (randrp->maxX == 0 || randrp->maxY == 0) { if (maxX < mode->HDisplay) maxX = mode->HDisplay; if (maxY < mode->VDisplay) maxY = mode->VDisplay; } if (mode->HDisplay == pSize->width && mode->VDisplay == pSize->height && (rate == 0 || xf86RandR12ModeRefresh(mode) == rate)) break; if (mode->next == scrp->modes) { if (pSize->width == randrp->virtualX && pSize->height == randrp->virtualY) { mode = scrp->modes; useVirtual = TRUE; break; } if (randrp->maxX == 0 || randrp->maxY == 0) { randrp->maxX = maxX; randrp->maxY = maxY; } return FALSE; } } if (randrp->maxX == 0 || randrp->maxY == 0) { randrp->maxX = maxX; randrp->maxY = maxY; } if (!xf86RandR12SetMode(pScreen, mode, useVirtual, pSize->mmWidth, pSize->mmHeight)) { randrp->rotation = oldRotation; return FALSE; } /* * Move the cursor back where it belongs; SwitchMode repositions it * FIXME: duplicated code, see modes/xf86RandR12.c */ for (dev = inputInfo.devices; dev; dev = dev->next) { if (!IsMaster(dev) && !IsFloating(dev)) continue; if (pScreen == miPointerGetScreen(dev)) { int px = pos[dev->id][0]; int py = pos[dev->id][1]; px = (px >= pScreen->width ? (pScreen->width - 1) : px); py = (py >= pScreen->height ? (pScreen->height - 1) : py); /* Setting the viewpoint makes only sense on one device */ if (!view_adjusted && IsMaster(dev)) { xf86SetViewport(pScreen, px, py); view_adjusted = TRUE; } (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE); } } return TRUE; } #define PANNING_ENABLED(crtc) \ ((crtc)->panningTotalArea.x2 > (crtc)->panningTotalArea.x1 || \ (crtc)->panningTotalArea.y2 > (crtc)->panningTotalArea.y1) static Bool xf86RandR12ScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, CARD32 mmWidth, CARD32 mmHeight) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); WindowPtr pRoot = pScreen->root; PixmapPtr pScrnPix; Bool ret = FALSE; int c; if (xf86RandR12Key) { if (randrp->virtualX == -1 || randrp->virtualY == -1) { randrp->virtualX = pScrn->virtualX; randrp->virtualY = pScrn->virtualY; } } if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); /* Let the driver update virtualX and virtualY */ if (!(*config->funcs->resize) (pScrn, width, height)) goto finish; ret = TRUE; /* Update panning information */ for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; if (PANNING_ENABLED (crtc)) { if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1) crtc->panningTotalArea.x2 += width - pScreen->width; if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1) crtc->panningTotalArea.y2 += height - pScreen->height; if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1) crtc->panningTrackingArea.x2 += width - pScreen->width; if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1) crtc->panningTrackingArea.y2 += height - pScreen->height; xf86RandR13VerifyPanningArea(crtc, width, height); xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY); } } pScrnPix = (*pScreen->GetScreenPixmap) (pScreen); pScreen->width = pScrnPix->drawable.width = width; pScreen->height = pScrnPix->drawable.height = height; randrp->mmWidth = pScreen->mmWidth = mmWidth; randrp->mmHeight = pScreen->mmHeight = mmHeight; xf86SetViewport(pScreen, pScreen->width - 1, pScreen->height - 1); xf86SetViewport(pScreen, 0, 0); finish: update_desktop_dimensions(); if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); #if RANDR_12_INTERFACE if (xf86RandR12Key && pScreen->root && ret) RRScreenSizeNotify(pScreen); #endif return ret; } Rotation xf86RandR12GetRotation(ScreenPtr pScreen) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); return randrp->rotation; } Bool xf86RandR12CreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config; XF86RandRInfoPtr randrp; int c; int width, height; int mmWidth, mmHeight; #ifdef PANORAMIX /* XXX disable RandR when using Xinerama */ if (!noPanoramiXExtension) return TRUE; #endif config = XF86_CRTC_CONFIG_PTR(pScrn); randrp = XF86RANDRINFO(pScreen); /* * Compute size of screen */ width = 0; height = 0; for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; int crtc_width = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); int crtc_height = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); if (crtc->enabled) { if (crtc_width > width) width = crtc_width; if (crtc_height > height) height = crtc_height; if (crtc->panningTotalArea.x2 > width) width = crtc->panningTotalArea.x2; if (crtc->panningTotalArea.y2 > height) height = crtc->panningTotalArea.y2; } } if (width && height) { /* * Compute physical size of screen */ if (monitorResolution) { mmWidth = width * 25.4 / monitorResolution; mmHeight = height * 25.4 / monitorResolution; } else { xf86OutputPtr output = xf86CompatOutput(pScrn); if (output && output->conf_monitor && (output->conf_monitor->mon_width > 0 && output->conf_monitor->mon_height > 0)) { /* * Prefer user configured DisplaySize */ mmWidth = output->conf_monitor->mon_width; mmHeight = output->conf_monitor->mon_height; } else { /* * Otherwise, just set the screen to DEFAULT_DPI */ mmWidth = width * 25.4 / DEFAULT_DPI; mmHeight = height * 25.4 / DEFAULT_DPI; } } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting screen physical size to %d x %d\n", mmWidth, mmHeight); /* * This is the initial setting of the screen size. * We have to pre-set it here, otherwise panning would be adapted * to the new screen size. */ pScreen->width = width; pScreen->height = height; xf86RandR12ScreenSetSize(pScreen, width, height, mmWidth, mmHeight); } if (xf86RandR12Key == NULL) return TRUE; if (randrp->virtualX == -1 || randrp->virtualY == -1) { randrp->virtualX = pScrn->virtualX; randrp->virtualY = pScrn->virtualY; } xf86CrtcSetScreenSubpixelOrder(pScreen); #if RANDR_12_INTERFACE if (xf86RandR12CreateScreenResources12(pScreen)) return TRUE; #endif return TRUE; } Bool xf86RandR12Init(ScreenPtr pScreen) { rrScrPrivPtr rp; XF86RandRInfoPtr randrp; #ifdef PANORAMIX /* XXX disable RandR when using Xinerama */ if (!noPanoramiXExtension) { if (xf86NumScreens == 1) noPanoramiXExtension = TRUE; else return TRUE; } #endif if (xf86RandR12Generation != serverGeneration) xf86RandR12Generation = serverGeneration; xf86RandR12Key = &xf86RandR12KeyRec; if (!dixRegisterPrivateKey(&xf86RandR12KeyRec, PRIVATE_SCREEN, 0)) return FALSE; randrp = malloc(sizeof(XF86RandRInfoRec)); if (!randrp) return FALSE; if (!RRScreenInit(pScreen)) { free(randrp); return FALSE; } rp = rrGetScrPriv(pScreen); rp->rrGetInfo = xf86RandR12GetInfo; rp->rrSetConfig = xf86RandR12SetConfig; randrp->virtualX = -1; randrp->virtualY = -1; randrp->mmWidth = pScreen->mmWidth; randrp->mmHeight = pScreen->mmHeight; randrp->rotation = RR_Rotate_0; /* initial rotated mode */ randrp->supported_rotations = RR_Rotate_0; randrp->maxX = randrp->maxY = 0; dixSetPrivate(&pScreen->devPrivates, xf86RandR12Key, randrp); #if RANDR_12_INTERFACE if (!xf86RandR12Init12(pScreen)) return FALSE; #endif return TRUE; } void xf86RandR12CloseScreen(ScreenPtr pScreen) { XF86RandRInfoPtr randrp; if (xf86RandR12Key == NULL) return; randrp = XF86RANDRINFO(pScreen); #if RANDR_12_INTERFACE xf86ScreenToScrn(pScreen)->EnterVT = randrp->orig_EnterVT; pScreen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder; #endif free(randrp); } void xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotations) { XF86RandRInfoPtr randrp; #if RANDR_12_INTERFACE ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int c; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); #endif if (xf86RandR12Key == NULL) return; randrp = XF86RANDRINFO(pScreen); #if RANDR_12_INTERFACE for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; RRCrtcSetRotations(crtc->randr_crtc, rotations); } #endif randrp->supported_rotations = rotations; } void xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) { #if RANDR_13_INTERFACE ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int c; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); #endif if (xf86RandR12Key == NULL) return; #if RANDR_13_INTERFACE for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; RRCrtcSetTransformSupport(crtc->randr_crtc, transforms); } #endif } void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); if (xf86RandR12Generation != serverGeneration || XF86RANDRINFO(pScreen)->virtualX == -1) { *x = pScrn->virtualX; *y = pScrn->virtualY; } else { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); *x = randrp->virtualX; *y = randrp->virtualY; } } #if RANDR_12_INTERFACE #define FLAG_BITS (RR_HSyncPositive | \ RR_HSyncNegative | \ RR_VSyncPositive | \ RR_VSyncNegative | \ RR_Interlace | \ RR_DoubleScan | \ RR_CSync | \ RR_CSyncPositive | \ RR_CSyncNegative | \ RR_HSkewPresent | \ RR_BCast | \ RR_PixelMultiplex | \ RR_DoubleClock | \ RR_ClockDivideBy2) static Bool xf86RandRModeMatches(RRModePtr randr_mode, DisplayModePtr mode) { #if 0 if (match_name) { /* check for same name */ int len = strlen(mode->name); if (randr_mode->mode.nameLength != len) return FALSE; if (memcmp(randr_mode->name, mode->name, len) != 0) return FALSE; } #endif /* check for same timings */ if (randr_mode->mode.dotClock / 1000 != mode->Clock) return FALSE; if (randr_mode->mode.width != mode->HDisplay) return FALSE; if (randr_mode->mode.hSyncStart != mode->HSyncStart) return FALSE; if (randr_mode->mode.hSyncEnd != mode->HSyncEnd) return FALSE; if (randr_mode->mode.hTotal != mode->HTotal) return FALSE; if (randr_mode->mode.hSkew != mode->HSkew) return FALSE; if (randr_mode->mode.height != mode->VDisplay) return FALSE; if (randr_mode->mode.vSyncStart != mode->VSyncStart) return FALSE; if (randr_mode->mode.vSyncEnd != mode->VSyncEnd) return FALSE; if (randr_mode->mode.vTotal != mode->VTotal) return FALSE; /* check for same flags (using only the XF86 valid flag bits) */ if ((randr_mode->mode.modeFlags & FLAG_BITS) != (mode->Flags & FLAG_BITS)) return FALSE; /* everything matches */ return TRUE; } static Bool xf86RandR12CrtcNotify(RRCrtcPtr randr_crtc) { ScreenPtr pScreen = randr_crtc->pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); RRModePtr randr_mode = NULL; int x; int y; Rotation rotation; int numOutputs; RROutputPtr *randr_outputs; RROutputPtr randr_output; xf86CrtcPtr crtc = randr_crtc->devPrivate; xf86OutputPtr output; int i, j; DisplayModePtr mode = &crtc->mode; Bool ret; randr_outputs = malloc(config->num_output * sizeof(RROutputPtr)); if (!randr_outputs) return FALSE; x = crtc->x; y = crtc->y; rotation = crtc->rotation; numOutputs = 0; randr_mode = NULL; for (i = 0; i < config->num_output; i++) { output = config->output[i]; if (output->crtc == crtc) { randr_output = output->randr_output; randr_outputs[numOutputs++] = randr_output; /* * We make copies of modes, so pointer equality * isn't sufficient */ for (j = 0; j < randr_output->numModes + randr_output->numUserModes; j++) { RRModePtr m = (j < randr_output->numModes ? randr_output-> modes[j] : randr_output->userModes[j - randr_output-> numModes]); if (xf86RandRModeMatches(m, mode)) { randr_mode = m; break; } } } } ret = RRCrtcNotify(randr_crtc, randr_mode, x, y, rotation, crtc->transformPresent ? &crtc->transform : NULL, numOutputs, randr_outputs); free(randr_outputs); return ret; } /* * Convert a RandR mode to a DisplayMode */ static void xf86RandRModeConvert(ScrnInfoPtr scrn, RRModePtr randr_mode, DisplayModePtr mode) { memset(mode, 0, sizeof(DisplayModeRec)); mode->status = MODE_OK; mode->Clock = randr_mode->mode.dotClock / 1000; mode->HDisplay = randr_mode->mode.width; mode->HSyncStart = randr_mode->mode.hSyncStart; mode->HSyncEnd = randr_mode->mode.hSyncEnd; mode->HTotal = randr_mode->mode.hTotal; mode->HSkew = randr_mode->mode.hSkew; mode->VDisplay = randr_mode->mode.height; mode->VSyncStart = randr_mode->mode.vSyncStart; mode->VSyncEnd = randr_mode->mode.vSyncEnd; mode->VTotal = randr_mode->mode.vTotal; mode->VScan = 0; mode->Flags = randr_mode->mode.modeFlags & FLAG_BITS; xf86SetModeCrtc(mode, scrn->adjustFlags); } static Bool xf86RandR12CrtcSet(ScreenPtr pScreen, RRCrtcPtr randr_crtc, RRModePtr randr_mode, int x, int y, Rotation rotation, int num_randr_outputs, RROutputPtr * randr_outputs) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcPtr crtc = randr_crtc->devPrivate; RRTransformPtr transform; Bool changed = FALSE; int o, ro; xf86CrtcPtr *save_crtcs; Bool save_enabled = crtc->enabled; if (!crtc->scrn->vtSema) return FALSE; save_crtcs = malloc(config->num_output * sizeof(xf86CrtcPtr)); if ((randr_mode != NULL) != crtc->enabled) changed = TRUE; else if (randr_mode && !xf86RandRModeMatches(randr_mode, &crtc->mode)) changed = TRUE; 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; else if (transform && memcmp(&transform->transform, &crtc->transform.transform, sizeof(transform->transform)) != 0) changed = TRUE; if (x != crtc->x || y != crtc->y) changed = TRUE; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; xf86CrtcPtr new_crtc; save_crtcs[o] = output->crtc; if (output->crtc == crtc) new_crtc = NULL; else new_crtc = output->crtc; for (ro = 0; ro < num_randr_outputs; ro++) if (output->randr_output == randr_outputs[ro]) { new_crtc = crtc; break; } if (new_crtc != output->crtc) { changed = TRUE; output->crtc = new_crtc; } } for (ro = 0; ro < num_randr_outputs; ro++) if (randr_outputs[ro]->pendingProperties) changed = TRUE; /* XXX need device-independent mode setting code through an API */ if (changed) { crtc->enabled = randr_mode != NULL; if (randr_mode) { DisplayModeRec mode; xf86RandRModeConvert(pScrn, randr_mode, &mode); if (!xf86CrtcSetModeTransform (crtc, &mode, rotation, transform, x, y)) { crtc->enabled = save_enabled; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; output->crtc = save_crtcs[o]; } free(save_crtcs); return FALSE; } xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height); xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY); randrp->panning = PANNING_ENABLED (crtc); /* * Save the last successful setting for EnterVT */ xf86SaveModeContents(&crtc->desiredMode, &mode); crtc->desiredRotation = rotation; crtc->current_scanout = randr_crtc->scanout_pixmap; if (transform) { crtc->desiredTransform = *transform; crtc->desiredTransformPresent = TRUE; } else crtc->desiredTransformPresent = FALSE; crtc->desiredX = x; crtc->desiredY = y; } xf86DisableUnusedFunctions(pScrn); } free(save_crtcs); return xf86RandR12CrtcNotify(randr_crtc); } static Bool xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) { xf86CrtcPtr crtc = randr_crtc->devPrivate; if (crtc->funcs->gamma_set == NULL) return FALSE; if (!crtc->scrn->vtSema) return TRUE; /* Realloc local gamma if needed. */ if (randr_crtc->gammaSize != crtc->gamma_size) { CARD16 *tmp_ptr; tmp_ptr = realloc(crtc->gamma_red, 3 * randr_crtc->gammaSize * sizeof(CARD16)); if (!tmp_ptr) return FALSE; crtc->gamma_red = tmp_ptr; crtc->gamma_green = crtc->gamma_red + randr_crtc->gammaSize; crtc->gamma_blue = crtc->gamma_green + randr_crtc->gammaSize; } crtc->gamma_size = randr_crtc->gammaSize; memcpy(crtc->gamma_red, randr_crtc->gammaRed, crtc->gamma_size * sizeof(CARD16)); memcpy(crtc->gamma_green, randr_crtc->gammaGreen, crtc->gamma_size * sizeof(CARD16)); memcpy(crtc->gamma_blue, randr_crtc->gammaBlue, crtc->gamma_size * sizeof(CARD16)); /* Only set it when the crtc is actually running. * Otherwise it will be set when it's activated. */ if (crtc->active) crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size); return TRUE; } static Bool xf86RandR12CrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) { xf86CrtcPtr crtc = randr_crtc->devPrivate; if (!crtc->gamma_size) return FALSE; if (!crtc->gamma_red || !crtc->gamma_green || !crtc->gamma_blue) return FALSE; /* Realloc randr gamma if needed. */ if (randr_crtc->gammaSize != crtc->gamma_size) { CARD16 *tmp_ptr; tmp_ptr = realloc(randr_crtc->gammaRed, 3 * crtc->gamma_size * sizeof(CARD16)); if (!tmp_ptr) return FALSE; randr_crtc->gammaRed = tmp_ptr; randr_crtc->gammaGreen = randr_crtc->gammaRed + crtc->gamma_size; randr_crtc->gammaBlue = randr_crtc->gammaGreen + crtc->gamma_size; } randr_crtc->gammaSize = crtc->gamma_size; memcpy(randr_crtc->gammaRed, crtc->gamma_red, crtc->gamma_size * sizeof(CARD16)); memcpy(randr_crtc->gammaGreen, crtc->gamma_green, crtc->gamma_size * sizeof(CARD16)); memcpy(randr_crtc->gammaBlue, crtc->gamma_blue, crtc->gamma_size * sizeof(CARD16)); return TRUE; } static Bool xf86RandR12OutputSetProperty(ScreenPtr pScreen, RROutputPtr randr_output, Atom property, RRPropertyValuePtr value) { xf86OutputPtr output = randr_output->devPrivate; /* If we don't have any property handler, then we don't care what the * user is setting properties to. */ if (output->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 output->funcs->set_property(output, property, value); } static Bool xf86RandR13OutputGetProperty(ScreenPtr pScreen, RROutputPtr randr_output, Atom property) { xf86OutputPtr output = randr_output->devPrivate; if (output->funcs->get_property == NULL) return TRUE; /* Should be safe even w/o vtSema */ return output->funcs->get_property(output, property); } static Bool xf86RandR12OutputValidateMode(ScreenPtr pScreen, RROutputPtr randr_output, RRModePtr randr_mode) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86OutputPtr output = randr_output->devPrivate; DisplayModeRec mode; xf86RandRModeConvert(pScrn, randr_mode, &mode); /* * This function may be called when vtSema is FALSE, so * the underlying function must either avoid touching the hardware * or return FALSE when vtSema is FALSE */ if (output->funcs->mode_valid(output, &mode) != MODE_OK) return FALSE; return TRUE; } static void xf86RandR12ModeDestroy(ScreenPtr pScreen, RRModePtr randr_mode) { } /** * Given a list of xf86 modes and a RandR Output object, construct * RandR modes and assign them to the output */ static Bool xf86RROutputSetModes(RROutputPtr randr_output, DisplayModePtr modes) { DisplayModePtr mode; RRModePtr *rrmodes = NULL; int nmode = 0; int npreferred = 0; Bool ret = TRUE; int pref; for (mode = modes; mode; mode = mode->next) nmode++; if (nmode) { rrmodes = malloc(nmode * sizeof(RRModePtr)); if (!rrmodes) return FALSE; nmode = 0; for (pref = 1; pref >= 0; pref--) { for (mode = modes; mode; mode = mode->next) { if ((pref != 0) == ((mode->type & M_T_PREFERRED) != 0)) { xRRModeInfo modeInfo; RRModePtr rrmode; modeInfo.nameLength = strlen(mode->name); modeInfo.width = mode->HDisplay; modeInfo.dotClock = mode->Clock * 1000; modeInfo.hSyncStart = mode->HSyncStart; modeInfo.hSyncEnd = mode->HSyncEnd; modeInfo.hTotal = mode->HTotal; modeInfo.hSkew = mode->HSkew; modeInfo.height = mode->VDisplay; modeInfo.vSyncStart = mode->VSyncStart; modeInfo.vSyncEnd = mode->VSyncEnd; modeInfo.vTotal = mode->VTotal; modeInfo.modeFlags = mode->Flags; rrmode = RRModeGet(&modeInfo, mode->name); if (rrmode) { rrmodes[nmode++] = rrmode; npreferred += pref; } } } } } ret = RROutputSetModes(randr_output, rrmodes, nmode, npreferred); free(rrmodes); return ret; } /* * Mirror the current mode configuration to RandR */ static Bool xf86RandR12SetInfo12(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); RROutputPtr *clones; RRCrtcPtr *crtcs; int ncrtc; int o, c, l; int nclone; clones = malloc(config->num_output * sizeof(RROutputPtr)); crtcs = malloc(config->num_crtc * sizeof(RRCrtcPtr)); for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; ncrtc = 0; for (c = 0; c < config->num_crtc; c++) if (output->possible_crtcs & (1 << c)) crtcs[ncrtc++] = config->crtc[c]->randr_crtc; if (!RROutputSetCrtcs(output->randr_output, crtcs, ncrtc)) { free(crtcs); free(clones); return FALSE; } RROutputSetPhysicalSize(output->randr_output, output->mm_width, output->mm_height); xf86RROutputSetModes(output->randr_output, output->probed_modes); switch (output->status) { case XF86OutputStatusConnected: RROutputSetConnection(output->randr_output, RR_Connected); break; case XF86OutputStatusDisconnected: RROutputSetConnection(output->randr_output, RR_Disconnected); break; case XF86OutputStatusUnknown: RROutputSetConnection(output->randr_output, RR_UnknownConnection); break; } RROutputSetSubpixelOrder(output->randr_output, output->subpixel_order); /* * Valid clones */ nclone = 0; for (l = 0; l < config->num_output; l++) { xf86OutputPtr clone = config->output[l]; if (l != o && (output->possible_clones & (1 << l))) clones[nclone++] = clone->randr_output; } if (!RROutputSetClones(output->randr_output, clones, nclone)) { free(crtcs); free(clones); return FALSE; } } free(crtcs); free(clones); return TRUE; } /* * Query the hardware for the current state, then mirror * that to RandR */ static Bool xf86RandR12GetInfo12(ScreenPtr pScreen, Rotation * rotations) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (!pScrn->vtSema) return TRUE; xf86ProbeOutputModes(pScrn, 0, 0); xf86SetScrnInfoModes(pScrn); return xf86RandR12SetInfo12(pScreen); } static Bool xf86RandR12CreateObjects12(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; int o; if (!RRInit()) return FALSE; /* * Configure crtcs */ for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; crtc->randr_crtc = RRCrtcCreate(pScreen, crtc); RRCrtcGammaSetSize(crtc->randr_crtc, 256); } /* * Configure outputs */ for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; output->randr_output = RROutputCreate(pScreen, output->name, strlen(output->name), output); if (output->funcs->create_resources != NULL) 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; } static Bool xf86RandR12CreateScreenResources12(ScreenPtr pScreen) { int c; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); if (xf86RandR12Key == NULL) return TRUE; for (c = 0; c < config->num_crtc; c++) xf86RandR12CrtcNotify(config->crtc[c]->randr_crtc); RRScreenSetSizeRange(pScreen, config->minWidth, config->minHeight, config->maxWidth, config->maxHeight); return TRUE; } /* * Something happened within the screen configuration due * to DGA, VidMode or hot key. Tell RandR */ void xf86RandR12TellChanged(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; if (xf86RandR12Key == NULL) return; xf86RandR12SetInfo12(pScreen); for (c = 0; c < config->num_crtc; c++) xf86RandR12CrtcNotify(config->crtc[c]->randr_crtc); RRTellChanged(pScreen); } static void xf86RandR12PointerMoved(ScrnInfoPtr pScrn, int x, int y) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int c; randrp->pointerX = x; randrp->pointerY = y; for (c = 0; c < config->num_crtc; c++) xf86RandR13Pan(config->crtc[c], x, y); } static Bool xf86RandR13GetPanning(ScreenPtr pScreen, RRCrtcPtr randr_crtc, BoxPtr totalArea, BoxPtr trackingArea, INT16 *border) { xf86CrtcPtr crtc = randr_crtc->devPrivate; if (crtc->version < 2) return FALSE; if (totalArea) memcpy(totalArea, &crtc->panningTotalArea, sizeof(BoxRec)); if (trackingArea) memcpy(trackingArea, &crtc->panningTrackingArea, sizeof(BoxRec)); if (border) memcpy(border, crtc->panningBorder, 4 * sizeof(INT16)); return TRUE; } static Bool xf86RandR13SetPanning(ScreenPtr pScreen, RRCrtcPtr randr_crtc, BoxPtr totalArea, BoxPtr trackingArea, INT16 *border) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); xf86CrtcPtr crtc = randr_crtc->devPrivate; BoxRec oldTotalArea; BoxRec oldTrackingArea; INT16 oldBorder[4]; Bool oldPanning = randrp->panning; if (crtc->version < 2) return FALSE; memcpy(&oldTotalArea, &crtc->panningTotalArea, sizeof(BoxRec)); memcpy(&oldTrackingArea, &crtc->panningTrackingArea, sizeof(BoxRec)); memcpy(oldBorder, crtc->panningBorder, 4 * sizeof(INT16)); if (totalArea) memcpy(&crtc->panningTotalArea, totalArea, sizeof(BoxRec)); if (trackingArea) memcpy(&crtc->panningTrackingArea, trackingArea, sizeof(BoxRec)); if (border) memcpy(crtc->panningBorder, border, 4 * sizeof(INT16)); if (xf86RandR13VerifyPanningArea(crtc, pScreen->width, pScreen->height)) { xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY); randrp->panning = PANNING_ENABLED (crtc); return TRUE; } else { /* Restore old settings */ memcpy(&crtc->panningTotalArea, &oldTotalArea, sizeof(BoxRec)); memcpy(&crtc->panningTrackingArea, &oldTrackingArea, sizeof(BoxRec)); memcpy(crtc->panningBorder, oldBorder, 4 * sizeof(INT16)); randrp->panning = oldPanning; return FALSE; } } /* * Compatibility with XF86VidMode's gamma changer. This necessarily clobbers * any per-crtc setup. You asked for it... */ static void gamma_to_ramp(float gamma, CARD16 *ramp, int size) { int i; for (i = 0; i < size; i++) { if (gamma == 1.0) ramp[i] = i | i << 8; else ramp[i] = (CARD16) (pow((double) i / (double) (size - 1), 1. / gamma) * (double) (size - 1) * 257); } } static int xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { CARD16 *points, *red, *green, *blue; RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); int size; if (!crtc) return Success; size = max(0, crtc->gammaSize); if (!size) return Success; points = calloc(size, 3 * sizeof(CARD16)); if (!points) return BadAlloc; red = points; green = points + size; blue = points + 2 * size; gamma_to_ramp(gamma.red, red, size); gamma_to_ramp(gamma.green, green, size); gamma_to_ramp(gamma.blue, blue, size); RRCrtcGammaSet(crtc, red, green, blue); free(points); pScrn->gamma = gamma; return Success; } static Bool xf86RandR12EnterVT(ScrnInfoPtr pScrn) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen); Bool ret; int i; if (randrp->orig_EnterVT) { pScrn->EnterVT = randrp->orig_EnterVT; ret = pScrn->EnterVT(pScrn); randrp->orig_EnterVT = pScrn->EnterVT; pScrn->EnterVT = xf86RandR12EnterVT; if (!ret) return FALSE; } /* reload gamma */ for (i = 0; i < rp->numCrtcs; i++) xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]); return RRGetInfo(pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */ } static void xf86DetachOutputGPU(ScreenPtr pScreen) { rrScrPrivPtr rp = rrGetScrPriv(pScreen); int i; /* make sure there are no attached shared scanout pixmaps first */ for (i = 0; i < rp->numCrtcs; i++) RRCrtcDetachScanoutPixmap(rp->crtcs[i]); DetachOutputGPU(pScreen); } static Bool xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen, RRProviderPtr provider, RRProviderPtr source_provider) { if (!source_provider) { if (provider->output_source) { ScreenPtr cmScreen = pScreen->current_master; xf86DetachOutputGPU(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; xf86DetachOutputGPU(pScreen); AttachUnboundGPU(cmScreen, pScreen); } provider->offload_sink = NULL; return TRUE; } if (provider->offload_sink == sink_provider) return TRUE; DetachUnboundGPU(pScreen); AttachOffloadGPU(sink_provider->pScreen, pScreen); provider->offload_sink = sink_provider; return TRUE; } static Bool xf86RandR14ProviderSetProperty(ScreenPtr pScreen, RRProviderPtr randr_provider, Atom property, RRPropertyValuePtr value) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); /* If we don't have any property handler, then we don't care what the * user is setting properties to. */ if (config->provider_funcs->set_property == NULL) return TRUE; /* * This function gets called even when vtSema is FALSE, as * drivers will need to remember the correct value to apply * when the VT switch occurs */ return config->provider_funcs->set_property(pScrn, property, value); } static Bool xf86RandR14ProviderGetProperty(ScreenPtr pScreen, RRProviderPtr randr_provider, Atom property) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); if (config->provider_funcs->get_property == NULL) return TRUE; /* Should be safe even w/o vtSema */ return config->provider_funcs->get_property(pScrn, property); } static Bool xf86CrtcSetScanoutPixmap(RRCrtcPtr randr_crtc, PixmapPtr pixmap) { xf86CrtcPtr crtc = randr_crtc->devPrivate; if (!crtc->funcs->set_scanout_pixmap) return FALSE; return crtc->funcs->set_scanout_pixmap(crtc, pixmap); } static void xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y) { XF86RandRInfoPtr randrp = XF86RANDRINFO(screen); if (randrp->panning) return; if (randrp->orig_ConstrainCursorHarder) { screen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder; screen->ConstrainCursorHarder(dev, screen, mode, x, y); screen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder; } } static 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; RRSetChanged(screen); } else if (config->randr_provider->output_source) { xf86DetachOutputGPU(screen); config->randr_provider->output_source = NULL; RRSetChanged(screen); } else if (screen->current_master) DetachUnboundGPU(screen); } config->randr_provider = NULL; } static Bool xf86RandR12Init12(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int i; rp->rrGetInfo = xf86RandR12GetInfo12; rp->rrScreenSetSize = xf86RandR12ScreenSetSize; rp->rrCrtcSet = xf86RandR12CrtcSet; rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma; rp->rrCrtcGetGamma = xf86RandR12CrtcGetGamma; rp->rrOutputSetProperty = xf86RandR12OutputSetProperty; rp->rrOutputValidateMode = xf86RandR12OutputValidateMode; #if RANDR_13_INTERFACE rp->rrOutputGetProperty = xf86RandR13OutputGetProperty; rp->rrGetPanning = xf86RandR13GetPanning; rp->rrSetPanning = xf86RandR13SetPanning; #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; randrp->orig_EnterVT = pScrn->EnterVT; pScrn->EnterVT = xf86RandR12EnterVT; randrp->panning = FALSE; randrp->orig_ConstrainCursorHarder = pScreen->ConstrainCursorHarder; pScreen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder; if (!xf86RandR12CreateObjects12(pScreen)) return FALSE; /* * Configure output modes */ if (!xf86RandR12SetInfo12(pScreen)) return FALSE; for (i = 0; i < rp->numCrtcs; i++) { xf86RandR12CrtcGetGamma(pScreen, rp->crtcs[i]); } return TRUE; } #endif Bool xf86RandR12PreInit(ScrnInfoPtr pScrn) { return TRUE; } xorg-server-1.17.1/hw/xfree86/utils/0000775000175100017510000000000012466505445014151 500000000000000xorg-server-1.17.1/hw/xfree86/utils/Makefile.am0000664000175100017510000000003712160102336016104 00000000000000SUBDIRS = \ gtf \ cvt \ man xorg-server-1.17.1/hw/xfree86/utils/man/0000775000175100017510000000000012466505445014724 500000000000000xorg-server-1.17.1/hw/xfree86/utils/man/Makefile.am0000664000175100017510000000007712160102336016663 00000000000000include $(top_srcdir)/manpages.am appman_PRE = cvt.man gtf.man xorg-server-1.17.1/hw/xfree86/utils/man/gtf.man0000664000175100017510000000237612160102336016110 00000000000000.TH GTF 1 __vendorversion__ .SH NAME gtf - calculate VESA GTF mode lines .SH SYNOPSIS .B gtf .I h-resolution .I v-resolution .I refresh .RB [ \-v | \-\-verbose ] .RB [ \-f | \-\-fbmode ] .RB [ \-x | \-\-xorgmode ] .SH DESCRIPTION .I Gtf 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 Xorg .B xorg.conf(__filemansuffix__) file, and mode parameters suitable for the Linux .B fbset(8) utility. .SH OPTIONS .TP 8 .BR \-v | \-\-verbose Enable verbose printouts This shows a trace for each step of the computation. .TP 8 .BR \-x | \-\-xorgmode 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" xorg.conf(__filemansuffix__), cvt(__appmansuffix__) .SH AUTHOR Andy Ritger. .PP This program is based on the Generalized Timing Formula (GTF(TM)) Standard Version: 1.0, Revision: 1.0. The GTF Excel(TM) spreadsheet, a sample (and the definitive) implementation of the GTF Timing Standard is available at . xorg-server-1.17.1/hw/xfree86/utils/man/Makefile.in0000664000175100017510000006235712466505434016724 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = hw/xfree86/utils/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man appman_PRE = cvt.man gtf.man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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/utils/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/utils/man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/xfree86/utils/man/cvt.man0000664000175100017510000000231212160102336016112 00000000000000.TH CVT 1 __vendorversion__ .SH NAME cvt - calculate VESA CVT mode lines .SH SYNOPSIS .B cvt .RB [ \-v | \-\-verbose ] .RB [ \-r | \-\-reduced ] .I h-resolution .I v-resolution .RB [ refresh ] .SH DESCRIPTION .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 Xorg .B xorg.conf(__filemansuffix__) . .SH OPTIONS .TP 8 .BR refresh Provide a vertical refresh rate in Hz. The CVT standard prefers either 50.0, 60.0, 75.0 or 85.0Hz. The default is 60.0Hz. .TP 8 .BR \-v | \-\-verbose Warn verbosely when a given mode does not completely correspond with CVT standards. .TP 8 .BR \-r | \-\-reduced 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" xorg.conf(__filemansuffix__), gtf(__appmansuffix__) .SH AUTHOR Luc Verhaegen. .PP This program is based on the Coordinated Video Timing sample implementation written by Graham Loveridge. This file is publicly available at . CVT is a VESA trademark. xorg-server-1.17.1/hw/xfree86/utils/Makefile.in0000664000175100017510000006255012466505433016143 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/utils DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = \ gtf \ cvt \ man all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(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/utils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/utils/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am 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: xorg-server-1.17.1/hw/xfree86/utils/gtf/0000775000175100017510000000000012466505445014731 500000000000000xorg-server-1.17.1/hw/xfree86/utils/gtf/Makefile.am0000664000175100017510000000234412160102336016667 00000000000000# Copyright (c) 2005, Oracle and/or its affiliates. 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 (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. # bin_PROGRAMS = gtf gtf_SOURCES = gtf.c gtf_CFLAGS = $(XORG_CFLAGS) gtf_LDADD = -lm xorg-server-1.17.1/hw/xfree86/utils/gtf/Makefile.in0000664000175100017510000007204712466505434016726 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (c) 2005, Oracle and/or its affiliates. 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 (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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ bin_PROGRAMS = gtf$(EXEEXT) subdir = hw/xfree86/utils/gtf DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_gtf_OBJECTS = gtf-gtf.$(OBJEXT) gtf_OBJECTS = $(am_gtf_OBJECTS) gtf_DEPENDENCIES = 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 = gtf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gtf_CFLAGS) $(CFLAGS) \ $(AM_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 = $(gtf_SOURCES) DIST_SOURCES = $(gtf_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ gtf_SOURCES = gtf.c gtf_CFLAGS = $(XORG_CFLAGS) gtf_LDADD = -lm all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/utils/gtf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/utils/gtf/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list gtf$(EXEEXT): $(gtf_OBJECTS) $(gtf_DEPENDENCIES) $(EXTRA_gtf_DEPENDENCIES) @rm -f gtf$(EXEEXT) $(AM_V_CCLD)$(gtf_LINK) $(gtf_OBJECTS) $(gtf_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtf-gtf.Po@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 -o $@ $< .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 -o $@ `$(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 $@ $< gtf-gtf.o: gtf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtf_CFLAGS) $(CFLAGS) -MT gtf-gtf.o -MD -MP -MF $(DEPDIR)/gtf-gtf.Tpo -c -o gtf-gtf.o `test -f 'gtf.c' || echo '$(srcdir)/'`gtf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gtf-gtf.Tpo $(DEPDIR)/gtf-gtf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gtf.c' object='gtf-gtf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtf_CFLAGS) $(CFLAGS) -c -o gtf-gtf.o `test -f 'gtf.c' || echo '$(srcdir)/'`gtf.c gtf-gtf.obj: gtf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtf_CFLAGS) $(CFLAGS) -MT gtf-gtf.obj -MD -MP -MF $(DEPDIR)/gtf-gtf.Tpo -c -o gtf-gtf.obj `if test -f 'gtf.c'; then $(CYGPATH_W) 'gtf.c'; else $(CYGPATH_W) '$(srcdir)/gtf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gtf-gtf.Tpo $(DEPDIR)/gtf-gtf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gtf.c' object='gtf-gtf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtf_CFLAGS) $(CFLAGS) -c -o gtf-gtf.obj `if test -f 'gtf.c'; then $(CYGPATH_W) 'gtf.c'; else $(CYGPATH_W) '$(srcdir)/gtf.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS 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-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ 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 tags-am uninstall uninstall-am uninstall-binPROGRAMS # 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: xorg-server-1.17.1/hw/xfree86/utils/gtf/gtf.c0000664000175100017510000005267012456571574015614 00000000000000/* gtf.c Generate mode timings using the GTF Timing Standard * * gcc gtf.c -o gtf -lm -Wall * * Copyright (c) 2001, Andy Ritger aritger@nvidia.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * o Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * o 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. * o Neither the name of NVIDIA 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 COPYRIGHT HOLDERS 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. * * * * This program is based on the Generalized Timing Formula(GTF TM) * Standard Version: 1.0, Revision: 1.0 * * The GTF Document contains the following Copyright information: * * Copyright (c) 1994, 1995, 1996 - Video Electronics Standards * Association. Duplication of this document within VESA member * companies for review purposes is permitted. All other rights * reserved. * * While every precaution has been taken in the preparation * of this standard, the Video Electronics Standards Association and * its contributors assume no responsibility for errors or omissions, * and make no warranties, expressed or implied, of functionality * of suitability for any purpose. The sample code contained within * this standard may be used without restriction. * * * * The GTF EXCEL(TM) SPREADSHEET, a sample (and the definitive) * implementation of the GTF Timing Standard, is available at: * * ftp://ftp.vesa.org/pub/GTF/GTF_V1R1.xls * * * * This program takes a desired resolution and vertical refresh rate, * and computes mode timings according to the GTF Timing Standard. * These mode timings can then be formatted as an XServer modeline * or a mode description for use by fbset(8). * * * * NOTES: * * The GTF allows for computation of "margins" (the visible border * surrounding the addressable video); on most non-overscan type * systems, the margin period is zero. I've implemented the margin * computations but not enabled it because 1) I don't really have * any experience with this, and 2) neither XServer modelines nor * fbset fb.modes provide an obvious way for margin timings to be * included in their mode descriptions (needs more investigation). * * The GTF provides for computation of interlaced mode timings; * I've implemented the computations but not enabled them, yet. * I should probably enable and test this at some point. * * * * TODO: * * o Add support for interlaced modes. * * o Implement the other portions of the GTF: compute mode timings * given either the desired pixel clock or the desired horizontal * frequency. * * o It would be nice if this were more general purpose to do things * outside the scope of the GTF: like generate double scan mode * timings, for example. * * o Printing digits to the right of the decimal point when the * digits are 0 annoys me. * * o Error checking. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #define MARGIN_PERCENT 1.8 /* % of active vertical image */ #define CELL_GRAN 8.0 /* assumed character cell granularity */ #define MIN_PORCH 1 /* minimum front porch */ #define V_SYNC_RQD 3 /* width of vsync in lines */ #define H_SYNC_PERCENT 8.0 /* width of hsync as % of total line */ #define MIN_VSYNC_PLUS_BP 550.0 /* min time of vsync + back porch (microsec) */ #define M 600.0 /* blanking formula gradient */ #define C 40.0 /* blanking formula offset */ #define K 128.0 /* blanking formula scaling factor */ #define J 20.0 /* blanking formula scaling factor */ /* C' and M' are part of the Blanking Duty Cycle computation */ #define C_PRIME (((C - J) * K/256.0) + J) #define M_PRIME (K/256.0 * M) /* struct definitions */ typedef struct __mode { int hr, hss, hse, hfl; int vr, vss, vse, vfl; float pclk, h_freq, v_freq; } mode; typedef struct __options { int x, y; int xorgmode, fbmode; float v_freq; } options; /* prototypes */ void print_value(int n, const char *name, float val); void print_xf86_mode(mode * m); void print_fb_mode(mode * m); mode *vert_refresh(int h_pixels, int v_lines, float freq, int interlaced, int margins); options *parse_command_line(int argc, char *argv[]); /* * print_value() - print the result of the named computation; this is * useful when comparing against the GTF EXCEL spreadsheet. */ int global_verbose = 0; void print_value(int n, const char *name, float val) { if (global_verbose) { printf("%2d: %-27s: %15f\n", n, name, val); } } /* print_xf86_mode() - print the XServer modeline, given mode timings. */ void print_xf86_mode(mode * m) { printf("\n"); printf(" # %dx%d @ %.2f Hz (GTF) hsync: %.2f kHz; pclk: %.2f MHz\n", m->hr, m->vr, m->v_freq, m->h_freq, m->pclk); printf(" Modeline \"%dx%d_%.2f\" %.2f" " %d %d %d %d" " %d %d %d %d" " -HSync +Vsync\n\n", m->hr, m->vr, m->v_freq, m->pclk, m->hr, m->hss, m->hse, m->hfl, m->vr, m->vss, m->vse, m->vfl); } /* * print_fb_mode() - print a mode description in fbset(8) format; * see the fb.modes(8) manpage. The timing description used in * this is rather odd; they use "left and right margin" to refer * to the portion of the hblank before and after the sync pulse * by conceptually wrapping the portion of the blank after the pulse * to infront of the visible region; ie: * * * Timing description I'm accustomed to: * * * * <--------1--------> <--2--> <--3--> <--4--> * _________ * |-------------------|_______| |_______ * * R SS SE FL * * 1: visible image * 2: blank before sync (aka front porch) * 3: sync pulse * 4: blank after sync (aka back porch) * R: Resolution * SS: Sync Start * SE: Sync End * FL: Frame Length * * * But the fb.modes format is: * * * <--4--> <--------1--------> <--2--> <--3--> * _________ * _______|-------------------|_______| | * * The fb.modes(8) manpage refers to <4> and <2> as the left and * right "margin" (as well as upper and lower margin in the vertical * direction) -- note that this has nothing to do with the term * "margin" used in the GTF Timing Standard. * * XXX always prints the 32 bit mode -- should I provide a command * line option to specify the bpp? It's simple enough for a user * to edit the mode description after it's generated. */ void print_fb_mode(mode * m) { printf("\n"); printf("mode \"%dx%d %.2fHz 32bit (GTF)\"\n", m->hr, m->vr, m->v_freq); printf(" # PCLK: %.2f MHz, H: %.2f kHz, V: %.2f Hz\n", m->pclk, m->h_freq, m->v_freq); printf(" geometry %d %d %d %d 32\n", m->hr, m->vr, m->hr, m->vr); printf(" timings %d %d %d %d %d %d %d\n", (int) rint(1000000.0 / m->pclk), /* pixclock in picoseconds */ m->hfl - m->hse, /* left margin (in pixels) */ m->hss - m->hr, /* right margin (in pixels) */ m->vfl - m->vse, /* upper margin (in pixel lines) */ m->vss - m->vr, /* lower margin (in pixel lines) */ m->hse - m->hss, /* horizontal sync length (pixels) */ m->vse - m->vss); /* vert sync length (pixel lines) */ printf(" hsync low\n"); printf(" vsync high\n"); printf("endmode\n\n"); } /* * vert_refresh() - as defined by the GTF Timing Standard, compute the * Stage 1 Parameters using the vertical refresh frequency. In other * words: input a desired resolution and desired refresh rate, and * output the GTF mode timings. * * XXX All the code is in place to compute interlaced modes, but I don't * feel like testing it right now. * * XXX margin computations are implemented but not tested (nor used by * XServer of fbset mode descriptions, from what I can tell). */ mode * vert_refresh(int h_pixels, int v_lines, float freq, int interlaced, int margins) { float h_pixels_rnd; float v_lines_rnd; float v_field_rate_rqd; float top_margin; float bottom_margin; float interlace; float h_period_est; float vsync_plus_bp; float v_back_porch; float total_v_lines; float v_field_rate_est; float h_period; float v_field_rate; float v_frame_rate; float left_margin; float right_margin; float total_active_pixels; float ideal_duty_cycle; float h_blank; float total_pixels; float pixel_freq; float h_freq; float h_sync; float h_front_porch; float v_odd_front_porch_lines; mode *m = (mode *) malloc(sizeof(mode)); /* 1. In order to give correct results, the number of horizontal * pixels requested is first processed to ensure that it is divisible * by the character size, by rounding it to the nearest character * cell boundary: * * [H PIXELS RND] = ((ROUND([H PIXELS]/[CELL GRAN RND],0))*[CELLGRAN RND]) */ h_pixels_rnd = rint((float) h_pixels / CELL_GRAN) * CELL_GRAN; print_value(1, "[H PIXELS RND]", h_pixels_rnd); /* 2. If interlace is requested, the number of vertical lines assumed * by the calculation must be halved, as the computation calculates * the number of vertical lines per field. In either case, the * number of lines is rounded to the nearest integer. * * [V LINES RND] = IF([INT RQD?]="y", ROUND([V LINES]/2,0), * ROUND([V LINES],0)) */ v_lines_rnd = interlaced ? rint((float) v_lines) / 2.0 : rint((float) v_lines); print_value(2, "[V LINES RND]", v_lines_rnd); /* 3. Find the frame rate required: * * [V FIELD RATE RQD] = IF([INT RQD?]="y", [I/P FREQ RQD]*2, * [I/P FREQ RQD]) */ v_field_rate_rqd = interlaced ? (freq * 2.0) : (freq); print_value(3, "[V FIELD RATE RQD]", v_field_rate_rqd); /* 4. Find number of lines in Top margin: * * [TOP MARGIN (LINES)] = IF([MARGINS RQD?]="Y", * ROUND(([MARGIN%]/100*[V LINES RND]),0), * 0) */ top_margin = margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0); print_value(4, "[TOP MARGIN (LINES)]", top_margin); /* 5. Find number of lines in Bottom margin: * * [BOT MARGIN (LINES)] = IF([MARGINS RQD?]="Y", * ROUND(([MARGIN%]/100*[V LINES RND]),0), * 0) */ bottom_margin = margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0); print_value(5, "[BOT MARGIN (LINES)]", bottom_margin); /* 6. If interlace is required, then set variable [INTERLACE]=0.5: * * [INTERLACE]=(IF([INT RQD?]="y",0.5,0)) */ interlace = interlaced ? 0.5 : 0.0; print_value(6, "[INTERLACE]", interlace); /* 7. Estimate the Horizontal period * * [H PERIOD EST] = ((1/[V FIELD RATE RQD]) - [MIN VSYNC+BP]/1000000) / * ([V LINES RND] + (2*[TOP MARGIN (LINES)]) + * [MIN PORCH RND]+[INTERLACE]) * 1000000 */ h_period_est = (((1.0 / v_field_rate_rqd) - (MIN_VSYNC_PLUS_BP / 1000000.0)) / (v_lines_rnd + (2 * top_margin) + MIN_PORCH + interlace) * 1000000.0); print_value(7, "[H PERIOD EST]", h_period_est); /* 8. Find the number of lines in V sync + back porch: * * [V SYNC+BP] = ROUND(([MIN VSYNC+BP]/[H PERIOD EST]),0) */ vsync_plus_bp = rint(MIN_VSYNC_PLUS_BP / h_period_est); print_value(8, "[V SYNC+BP]", vsync_plus_bp); /* 9. Find the number of lines in V back porch alone: * * [V BACK PORCH] = [V SYNC+BP] - [V SYNC RND] * * XXX is "[V SYNC RND]" a typo? should be [V SYNC RQD]? */ v_back_porch = vsync_plus_bp - V_SYNC_RQD; print_value(9, "[V BACK PORCH]", v_back_porch); /* 10. Find the total number of lines in Vertical field period: * * [TOTAL V LINES] = [V LINES RND] + [TOP MARGIN (LINES)] + * [BOT MARGIN (LINES)] + [V SYNC+BP] + [INTERLACE] + * [MIN PORCH RND] */ total_v_lines = v_lines_rnd + top_margin + bottom_margin + vsync_plus_bp + interlace + MIN_PORCH; print_value(10, "[TOTAL V LINES]", total_v_lines); /* 11. Estimate the Vertical field frequency: * * [V FIELD RATE EST] = 1 / [H PERIOD EST] / [TOTAL V LINES] * 1000000 */ v_field_rate_est = 1.0 / h_period_est / total_v_lines * 1000000.0; print_value(11, "[V FIELD RATE EST]", v_field_rate_est); /* 12. Find the actual horizontal period: * * [H PERIOD] = [H PERIOD EST] / ([V FIELD RATE RQD] / [V FIELD RATE EST]) */ h_period = h_period_est / (v_field_rate_rqd / v_field_rate_est); print_value(12, "[H PERIOD]", h_period); /* 13. Find the actual Vertical field frequency: * * [V FIELD RATE] = 1 / [H PERIOD] / [TOTAL V LINES] * 1000000 */ v_field_rate = 1.0 / h_period / total_v_lines * 1000000.0; print_value(13, "[V FIELD RATE]", v_field_rate); /* 14. Find the Vertical frame frequency: * * [V FRAME RATE] = (IF([INT RQD?]="y", [V FIELD RATE]/2, [V FIELD RATE])) */ v_frame_rate = interlaced ? v_field_rate / 2.0 : v_field_rate; print_value(14, "[V FRAME RATE]", v_frame_rate); /* 15. Find number of pixels in left margin: * * [LEFT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y", * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 / * [CELL GRAN RND]),0)) * [CELL GRAN RND], * 0)) */ left_margin = margins ? rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN : 0.0; print_value(15, "[LEFT MARGIN (PIXELS)]", left_margin); /* 16. Find number of pixels in right margin: * * [RIGHT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y", * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 / * [CELL GRAN RND]),0)) * [CELL GRAN RND], * 0)) */ right_margin = margins ? rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN : 0.0; print_value(16, "[RIGHT MARGIN (PIXELS)]", right_margin); /* 17. Find total number of active pixels in image and left and right * margins: * * [TOTAL ACTIVE PIXELS] = [H PIXELS RND] + [LEFT MARGIN (PIXELS)] + * [RIGHT MARGIN (PIXELS)] */ total_active_pixels = h_pixels_rnd + left_margin + right_margin; print_value(17, "[TOTAL ACTIVE PIXELS]", total_active_pixels); /* 18. Find the ideal blanking duty cycle from the blanking duty cycle * equation: * * [IDEAL DUTY CYCLE] = [C'] - ([M']*[H PERIOD]/1000) */ ideal_duty_cycle = C_PRIME - (M_PRIME * h_period / 1000.0); print_value(18, "[IDEAL DUTY CYCLE]", ideal_duty_cycle); /* 19. Find the number of pixels in the blanking time to the nearest * double character cell: * * [H BLANK (PIXELS)] = (ROUND(([TOTAL ACTIVE PIXELS] * * [IDEAL DUTY CYCLE] / * (100-[IDEAL DUTY CYCLE]) / * (2*[CELL GRAN RND])), 0)) * * (2*[CELL GRAN RND]) */ h_blank = rint(total_active_pixels * ideal_duty_cycle / (100.0 - ideal_duty_cycle) / (2.0 * CELL_GRAN)) * (2.0 * CELL_GRAN); print_value(19, "[H BLANK (PIXELS)]", h_blank); /* 20. Find total number of pixels: * * [TOTAL PIXELS] = [TOTAL ACTIVE PIXELS] + [H BLANK (PIXELS)] */ total_pixels = total_active_pixels + h_blank; print_value(20, "[TOTAL PIXELS]", total_pixels); /* 21. Find pixel clock frequency: * * [PIXEL FREQ] = [TOTAL PIXELS] / [H PERIOD] */ pixel_freq = total_pixels / h_period; print_value(21, "[PIXEL FREQ]", pixel_freq); /* 22. Find horizontal frequency: * * [H FREQ] = 1000 / [H PERIOD] */ h_freq = 1000.0 / h_period; print_value(22, "[H FREQ]", h_freq); /* Stage 1 computations are now complete; I should really pass the results to another function and do the Stage 2 computations, but I only need a few more values so I'll just append the computations here for now */ /* 17. Find the number of pixels in the horizontal sync period: * * [H SYNC (PIXELS)] =(ROUND(([H SYNC%] / 100 * [TOTAL PIXELS] / * [CELL GRAN RND]),0))*[CELL GRAN RND] */ h_sync = rint(H_SYNC_PERCENT / 100.0 * total_pixels / CELL_GRAN) * CELL_GRAN; print_value(17, "[H SYNC (PIXELS)]", h_sync); /* 18. Find the number of pixels in the horizontal front porch period: * * [H FRONT PORCH (PIXELS)] = ([H BLANK (PIXELS)]/2)-[H SYNC (PIXELS)] */ h_front_porch = (h_blank / 2.0) - h_sync; print_value(18, "[H FRONT PORCH (PIXELS)]", h_front_porch); /* 36. Find the number of lines in the odd front porch period: * * [V ODD FRONT PORCH(LINES)]=([MIN PORCH RND]+[INTERLACE]) */ v_odd_front_porch_lines = MIN_PORCH + interlace; print_value(36, "[V ODD FRONT PORCH(LINES)]", v_odd_front_porch_lines); /* finally, pack the results in the mode struct */ m->hr = (int) (h_pixels_rnd); m->hss = (int) (h_pixels_rnd + h_front_porch); m->hse = (int) (h_pixels_rnd + h_front_porch + h_sync); m->hfl = (int) (total_pixels); m->vr = (int) (v_lines_rnd); m->vss = (int) (v_lines_rnd + v_odd_front_porch_lines); m->vse = (int) (int) (v_lines_rnd + v_odd_front_porch_lines + V_SYNC_RQD); m->vfl = (int) (total_v_lines); m->pclk = pixel_freq; m->h_freq = h_freq; m->v_freq = freq; return m; } /* * parse_command_line() - parse the command line and return an * alloced structure containing the results. On error print usage * and return NULL. */ options * parse_command_line(int argc, char *argv[]) { int n; options *o = (options *) calloc(1, sizeof(options)); if (argc < 4) goto bad_option; o->x = atoi(argv[1]); o->y = atoi(argv[2]); o->v_freq = atof(argv[3]); /* XXX should check for errors in the above */ n = 4; while (n < argc) { if ((strcmp(argv[n], "-v") == 0) || (strcmp(argv[n], "--verbose") == 0)) { global_verbose = 1; } else if ((strcmp(argv[n], "-f") == 0) || (strcmp(argv[n], "--fbmode") == 0)) { o->fbmode = 1; } else if ((strcmp(argv[n], "-x") == 0) || (strcmp(argv[n], "--xorgmode") == 0) || (strcmp(argv[n], "--xf86mode") == 0)) { o->xorgmode = 1; } else { goto bad_option; } n++; } /* if neither xorgmode nor fbmode were requested, default to xorgmode */ if (!o->fbmode && !o->xorgmode) o->xorgmode = 1; return o; bad_option: fprintf(stderr, "\n"); fprintf(stderr, "usage: %s x y refresh [-v|--verbose] " "[-f|--fbmode] [-x|--xorgmode]\n", argv[0]); fprintf(stderr, "\n"); fprintf(stderr, " x : the desired horizontal " "resolution (required)\n"); fprintf(stderr, " y : the desired vertical " "resolution (required)\n"); fprintf(stderr, " refresh : the desired refresh " "rate (required)\n"); fprintf(stderr, " -v|--verbose : enable verbose printouts " "(traces each step of the computation)\n"); fprintf(stderr, " -f|--fbmode : output an fbset(8)-style mode " "description\n"); fprintf(stderr, " -x|--xorgmode : output an " __XSERVERNAME__ "-style mode " "description (this is the default\n" " if no mode description is requested)\n"); fprintf(stderr, "\n"); free(o); return NULL; } int main(int argc, char *argv[]) { mode *m; options *o; o = parse_command_line(argc, argv); if (!o) exit(1); m = vert_refresh(o->x, o->y, o->v_freq, 0, 0); if (!m) exit(1); if (o->xorgmode) print_xf86_mode(m); if (o->fbmode) print_fb_mode(m); return 0; } xorg-server-1.17.1/hw/xfree86/utils/cvt/0000775000175100017510000000000012466505445014745 500000000000000xorg-server-1.17.1/hw/xfree86/utils/cvt/Makefile.am0000664000175100017510000000270312200102654016700 00000000000000# Copyright (c) 2005, Oracle and/or its affiliates. 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 (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. # bin_PROGRAMS = cvt AM_CPPFLAGS = $(XORG_INCS) \ -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/modes \ -I$(top_srcdir)/hw/xfree86/parser # gah cvt_SOURCES = cvt.c \ $(top_srcdir)/hw/xfree86/modes/xf86cvt.c \ $(top_srcdir)/os/xprintf.c cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) xorg-server-1.17.1/hw/xfree86/utils/cvt/cvt.c0000664000175100017510000002051012366220413015607 00000000000000/* * Copyright 2005-2006 Luc Verhaegen. * * 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. * */ /* Standalone VESA CVT standard timing modelines generator. */ #include "xf86.h" #include "xf86Modes.h" /* FatalError implementation used by the server code we built in */ void FatalError(const char *f, ...) { va_list args; va_start(args, f); vfprintf(stderr, f, args); va_end(args); exit(1); } /* xnfalloc implementation used by the server code we built in */ void * XNFalloc(unsigned long n) { void *r; r = malloc(n); if (!r) { perror("malloc failed"); exit(1); } return r; } /* xnfcalloc implementation used by the server code we built in */ void * XNFcalloc(unsigned long n) { void *r; r = calloc(1, n); if (!r) { perror("calloc failed"); exit(1); } return r; } /* * Quickly check wether this is a CVT standard mode. */ static Bool CVTCheckStandard(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Verbose) { Bool IsCVT = TRUE; if ((!(VDisplay % 3) && ((VDisplay * 4 / 3) == HDisplay)) || (!(VDisplay % 9) && ((VDisplay * 16 / 9) == HDisplay)) || (!(VDisplay % 10) && ((VDisplay * 16 / 10) == HDisplay)) || (!(VDisplay % 4) && ((VDisplay * 5 / 4) == HDisplay)) || (!(VDisplay % 9) && ((VDisplay * 15 / 9) == HDisplay))); else { if (Verbose) fprintf(stderr, "Warning: Aspect Ratio is not CVT standard.\n"); IsCVT = FALSE; } if ((VRefresh != 50.0) && (VRefresh != 60.0) && (VRefresh != 75.0) && (VRefresh != 85.0)) { if (Verbose) fprintf(stderr, "Warning: Refresh Rate is not CVT standard " "(50, 60, 75 or 85Hz).\n"); IsCVT = FALSE; } return IsCVT; } /* * I'm not documenting --interlaced for obvious reasons, even though I did * implement it. I also can't deny having looked at gtf here. */ static void PrintUsage(char *Name) { fprintf(stderr, "\n"); fprintf(stderr, "usage: %s [-v|--verbose] [-r|--reduced] X Y [refresh]\n", Name); fprintf(stderr, "\n"); fprintf(stderr, " -v|--verbose : Warn about CVT standard adherance.\n"); fprintf(stderr, " -r|--reduced : Create a mode with reduced blanking " "(default: normal blanking).\n"); fprintf(stderr, " X : Desired horizontal resolution " "(multiple of 8, required).\n"); fprintf(stderr, " Y : Desired vertical resolution (required).\n"); fprintf(stderr, " refresh : Desired refresh rate (default: 60.0Hz).\n"); fprintf(stderr, "\n"); fprintf(stderr, "Calculates VESA CVT (Coordinated Video Timing) modelines" " for use with X.\n"); } /* * */ static void PrintComment(DisplayModeRec * Mode, Bool CVT, Bool Reduced) { printf("# %dx%d %.2f Hz ", Mode->HDisplay, Mode->VDisplay, Mode->VRefresh); if (CVT) { printf("(CVT %.2fM", ((float) Mode->HDisplay * Mode->VDisplay) / 1000000.0); if (!(Mode->VDisplay % 3) && ((Mode->VDisplay * 4 / 3) == Mode->HDisplay)) printf("3"); else if (!(Mode->VDisplay % 9) && ((Mode->VDisplay * 16 / 9) == Mode->HDisplay)) printf("9"); else if (!(Mode->VDisplay % 10) && ((Mode->VDisplay * 16 / 10) == Mode->HDisplay)) printf("A"); else if (!(Mode->VDisplay % 4) && ((Mode->VDisplay * 5 / 4) == Mode->HDisplay)) printf("4"); else if (!(Mode->VDisplay % 9) && ((Mode->VDisplay * 15 / 9) == Mode->HDisplay)) printf("9"); if (Reduced) printf("-R"); printf(") "); } else printf("(CVT) "); printf("hsync: %.2f kHz; ", Mode->HSync); printf("pclk: %.2f MHz", ((float) Mode->Clock) / 1000.0); printf("\n"); } /* * Originally grabbed from xf86Mode.c. * * Ignoring the actual Mode->name, as the user will want something solid * to grab hold of. */ static void PrintModeline(DisplayModePtr Mode, int HDisplay, int VDisplay, float VRefresh, Bool Reduced) { if (Reduced) printf("Modeline \"%dx%dR\" ", HDisplay, VDisplay); else printf("Modeline \"%dx%d_%.2f\" ", HDisplay, VDisplay, VRefresh); printf("%6.2f %i %i %i %i %i %i %i %i", Mode->Clock / 1000., Mode->HDisplay, Mode->HSyncStart, Mode->HSyncEnd, Mode->HTotal, Mode->VDisplay, Mode->VSyncStart, Mode->VSyncEnd, Mode->VTotal); if (Mode->Flags & V_INTERLACE) printf(" interlace"); if (Mode->Flags & V_PHSYNC) printf(" +hsync"); if (Mode->Flags & V_NHSYNC) printf(" -hsync"); if (Mode->Flags & V_PVSYNC) printf(" +vsync"); if (Mode->Flags & V_NVSYNC) printf(" -vsync"); printf("\n"); } /* * */ int main(int argc, char *argv[]) { DisplayModeRec *Mode; int HDisplay = 0, VDisplay = 0; float VRefresh = 0.0; Bool Reduced = FALSE, Verbose = FALSE, IsCVT; Bool Interlaced = FALSE; int n; if ((argc < 3) || (argc > 7)) { PrintUsage(argv[0]); return 1; } /* This doesn't filter out bad flags properly. Bad flags get passed down * to atoi/atof, which then return 0, so that these variables can get * filled next time round. So this is just a cosmetic problem. */ for (n = 1; n < argc; n++) { if (!strcmp(argv[n], "-r") || !strcmp(argv[n], "--reduced")) Reduced = TRUE; else if (!strcmp(argv[n], "-i") || !strcmp(argv[n], "--interlaced")) Interlaced = TRUE; else if (!strcmp(argv[n], "-v") || !strcmp(argv[n], "--verbose")) Verbose = TRUE; else if (!strcmp(argv[n], "-h") || !strcmp(argv[n], "--help")) { PrintUsage(argv[0]); return 0; } else if (!HDisplay) { HDisplay = atoi(argv[n]); if (!HDisplay) { PrintUsage(argv[0]); return 1; } } else if (!VDisplay) { VDisplay = atoi(argv[n]); if (!VDisplay) { PrintUsage(argv[0]); return 1; } } else if (!VRefresh) { VRefresh = atof(argv[n]); if (!VRefresh) { PrintUsage(argv[0]); return 1; } } else { PrintUsage(argv[0]); return 1; } } if (!HDisplay || !VDisplay) { PrintUsage(argv[0]); return 0; } /* Default to 60.0Hz */ if (!VRefresh) VRefresh = 60.0; /* Horizontal timing is always a multiple of 8: round up. */ if (HDisplay & 0x07) { HDisplay &= ~0x07; HDisplay += 8; } if (Reduced) { if ((VRefresh / 60.0) != floor(VRefresh / 60.0)) { fprintf(stderr, "\nERROR: Multiple of 60Hz refresh rate required for " " reduced blanking.\n"); PrintUsage(argv[0]); return 0; } } IsCVT = CVTCheckStandard(HDisplay, VDisplay, VRefresh, Reduced, Verbose); Mode = xf86CVTMode(HDisplay, VDisplay, VRefresh, Reduced, Interlaced); PrintComment(Mode, IsCVT, Reduced); PrintModeline(Mode, HDisplay, VDisplay, VRefresh, Reduced); return 0; } xorg-server-1.17.1/hw/xfree86/utils/cvt/Makefile.in0000664000175100017510000010264612466505434016741 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (c) 2005, Oracle and/or its affiliates. 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 (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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ bin_PROGRAMS = cvt$(EXEEXT) subdir = hw/xfree86/utils/cvt DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_cvt_OBJECTS = cvt-cvt.$(OBJEXT) cvt-xf86cvt.$(OBJEXT) \ cvt-xprintf.$(OBJEXT) cvt_OBJECTS = $(am_cvt_OBJECTS) cvt_LDADD = $(LDADD) 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 = cvt_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cvt_CFLAGS) $(CFLAGS) \ $(AM_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 = $(cvt_SOURCES) DIST_SOURCES = $(cvt_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CPPFLAGS = $(XORG_INCS) \ -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/modes \ -I$(top_srcdir)/hw/xfree86/parser # gah cvt_SOURCES = cvt.c \ $(top_srcdir)/hw/xfree86/modes/xf86cvt.c \ $(top_srcdir)/os/xprintf.c cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/utils/cvt/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/utils/cvt/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cvt$(EXEEXT): $(cvt_OBJECTS) $(cvt_DEPENDENCIES) $(EXTRA_cvt_DEPENDENCIES) @rm -f cvt$(EXEEXT) $(AM_V_CCLD)$(cvt_LINK) $(cvt_OBJECTS) $(cvt_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvt-cvt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvt-xf86cvt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvt-xprintf.Po@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 -o $@ $< .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 -o $@ `$(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 $@ $< cvt-cvt.o: cvt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -MT cvt-cvt.o -MD -MP -MF $(DEPDIR)/cvt-cvt.Tpo -c -o cvt-cvt.o `test -f 'cvt.c' || echo '$(srcdir)/'`cvt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cvt-cvt.Tpo $(DEPDIR)/cvt-cvt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cvt.c' object='cvt-cvt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -c -o cvt-cvt.o `test -f 'cvt.c' || echo '$(srcdir)/'`cvt.c cvt-cvt.obj: cvt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -MT cvt-cvt.obj -MD -MP -MF $(DEPDIR)/cvt-cvt.Tpo -c -o cvt-cvt.obj `if test -f 'cvt.c'; then $(CYGPATH_W) 'cvt.c'; else $(CYGPATH_W) '$(srcdir)/cvt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cvt-cvt.Tpo $(DEPDIR)/cvt-cvt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cvt.c' object='cvt-cvt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -c -o cvt-cvt.obj `if test -f 'cvt.c'; then $(CYGPATH_W) 'cvt.c'; else $(CYGPATH_W) '$(srcdir)/cvt.c'; fi` cvt-xf86cvt.o: $(top_srcdir)/hw/xfree86/modes/xf86cvt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -MT cvt-xf86cvt.o -MD -MP -MF $(DEPDIR)/cvt-xf86cvt.Tpo -c -o cvt-xf86cvt.o `test -f '$(top_srcdir)/hw/xfree86/modes/xf86cvt.c' || echo '$(srcdir)/'`$(top_srcdir)/hw/xfree86/modes/xf86cvt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cvt-xf86cvt.Tpo $(DEPDIR)/cvt-xf86cvt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/hw/xfree86/modes/xf86cvt.c' object='cvt-xf86cvt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -c -o cvt-xf86cvt.o `test -f '$(top_srcdir)/hw/xfree86/modes/xf86cvt.c' || echo '$(srcdir)/'`$(top_srcdir)/hw/xfree86/modes/xf86cvt.c cvt-xf86cvt.obj: $(top_srcdir)/hw/xfree86/modes/xf86cvt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -MT cvt-xf86cvt.obj -MD -MP -MF $(DEPDIR)/cvt-xf86cvt.Tpo -c -o cvt-xf86cvt.obj `if test -f '$(top_srcdir)/hw/xfree86/modes/xf86cvt.c'; then $(CYGPATH_W) '$(top_srcdir)/hw/xfree86/modes/xf86cvt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/hw/xfree86/modes/xf86cvt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cvt-xf86cvt.Tpo $(DEPDIR)/cvt-xf86cvt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/hw/xfree86/modes/xf86cvt.c' object='cvt-xf86cvt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -c -o cvt-xf86cvt.obj `if test -f '$(top_srcdir)/hw/xfree86/modes/xf86cvt.c'; then $(CYGPATH_W) '$(top_srcdir)/hw/xfree86/modes/xf86cvt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/hw/xfree86/modes/xf86cvt.c'; fi` cvt-xprintf.o: $(top_srcdir)/os/xprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -MT cvt-xprintf.o -MD -MP -MF $(DEPDIR)/cvt-xprintf.Tpo -c -o cvt-xprintf.o `test -f '$(top_srcdir)/os/xprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/os/xprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cvt-xprintf.Tpo $(DEPDIR)/cvt-xprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/os/xprintf.c' object='cvt-xprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -c -o cvt-xprintf.o `test -f '$(top_srcdir)/os/xprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/os/xprintf.c cvt-xprintf.obj: $(top_srcdir)/os/xprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -MT cvt-xprintf.obj -MD -MP -MF $(DEPDIR)/cvt-xprintf.Tpo -c -o cvt-xprintf.obj `if test -f '$(top_srcdir)/os/xprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/os/xprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/os/xprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cvt-xprintf.Tpo $(DEPDIR)/cvt-xprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/os/xprintf.c' object='cvt-xprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cvt_CFLAGS) $(CFLAGS) -c -o cvt-xprintf.obj `if test -f '$(top_srcdir)/os/xprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/os/xprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/os/xprintf.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS 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-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ 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 tags-am uninstall uninstall-am uninstall-binPROGRAMS # 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: xorg-server-1.17.1/hw/xfree86/xorg-wrapper.c0000664000175100017510000001774612456571574015556 00000000000000/* * Copyright © 2014 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. * * Author: Hans de Goede */ #include "dix-config.h" #include #include #include #include #include #include #include #include #include #include #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #endif #include #include #include /* For DRM_DEV_NAME */ #define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config" static const char *progname; enum { ROOT_ONLY, CONSOLE_ONLY, ANYBODY }; /* KISS non locale / LANG parsing isspace version */ static int is_space(char c) { return c == ' ' || c == '\t' || c == '\n'; } static char *strip(char *s) { int i; /* Strip leading whitespace */ while (s[0] && is_space(s[0])) s++; /* Strip trailing whitespace */ i = strlen(s) - 1; while (i >= 0 && is_space(s[i])) { s[i] = 0; i--; } return s; } static void parse_config(int *allowed, int *needs_root_rights) { FILE *f; char buf[1024]; char *stripped, *equals, *key, *value; int line = 0; f = fopen(CONFIG_FILE, "r"); if (!f) return; while (fgets(buf, sizeof(buf), f)) { line++; /* Skip comments and empty lines */ stripped = strip(buf); if (stripped[0] == '#' || stripped[0] == 0) continue; /* Split in a key + value pair */ equals = strchr(stripped, '='); if (!equals) { fprintf(stderr, "%s: Syntax error at %s line %d\n", progname, CONFIG_FILE, line); exit(1); } *equals = 0; key = strip(stripped); /* To remove trailing whitespace from key */ value = strip(equals + 1); /* To remove leading whitespace from val */ if (!key[0]) { fprintf(stderr, "%s: Missing key at %s line %d\n", progname, CONFIG_FILE, line); exit(1); } if (!value[0]) { fprintf(stderr, "%s: Missing value at %s line %d\n", progname, CONFIG_FILE, line); exit(1); } /* And finally process */ if (strcmp(key, "allowed_users") == 0) { if (strcmp(value, "rootonly") == 0) *allowed = ROOT_ONLY; else if (strcmp(value, "console") == 0) *allowed = CONSOLE_ONLY; else if (strcmp(value, "anybody") == 0) *allowed = ANYBODY; else { fprintf(stderr, "%s: Invalid value '%s' for 'allowed_users' at %s line %d\n", progname, value, CONFIG_FILE, line); exit(1); } } else if (strcmp(key, "needs_root_rights") == 0) { if (strcmp(value, "yes") == 0) *needs_root_rights = 1; else if (strcmp(value, "no") == 0) *needs_root_rights = 0; else if (strcmp(value, "auto") == 0) *needs_root_rights = -1; else { fprintf(stderr, "%s: Invalid value '%s' for 'needs_root_rights' at %s line %d\n", progname, value, CONFIG_FILE, line); exit(1); } } else if (strcmp(key, "nice_value") == 0) { /* Backward compatibility with older Debian Xwrapper, ignore */ } else { fprintf(stderr, "%s: Invalid key '%s' at %s line %d\n", key, progname, CONFIG_FILE, line); exit(1); } } fclose(f); } static int on_console(int fd) { #if defined(__linux__) struct stat st; int r; r = fstat(fd, &st); if (r == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) return 1; #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int idx; if (ioctl(fd, VT_GETINDEX, &idx) != -1) return 1; #else #warning This program needs porting to your kernel. static int seen; if (!seen) { fprintf(stderr, "%s: Unable to determine if running on a console\n", progname); seen = 1; } #endif return 0; } int main(int argc, char *argv[]) { struct drm_mode_card_res res; char buf[PATH_MAX]; int i, r, fd; int kms_cards = 0; int total_cards = 0; int allowed = CONSOLE_ONLY; int needs_root_rights = -1; progname = argv[0]; parse_config(&allowed, &needs_root_rights); /* For non root users check if they are allowed to run the X server */ if (getuid() != 0) { switch (allowed) { case ROOT_ONLY: /* Already checked above */ fprintf(stderr, "%s: Only root is allowed to run the X server\n", argv[0]); exit(1); break; case CONSOLE_ONLY: /* Some of stdin / stdout / stderr maybe redirected to a file */ for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) { if (on_console(i)) break; } if (i > STDERR_FILENO) { fprintf(stderr, "%s: Only console users are allowed to run the X server\n", argv[0]); exit(1); } break; case ANYBODY: break; } } /* Detect if we need root rights, except when overriden by the config */ if (needs_root_rights == -1) { for (i = 0; i < 16; i++) { snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, i); fd = open(buf, O_RDWR); if (fd == -1) continue; total_cards++; memset(&res, 0, sizeof(struct drm_mode_card_res)); r = ioctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res); if (r == 0 && res.count_connectors > 0) kms_cards++; close(fd); } } /* If we've found cards, and all cards support kms, drop root rights */ if (needs_root_rights == 0 || (total_cards && kms_cards == total_cards)) { gid_t realgid = getgid(); uid_t realuid = getuid(); if (setresgid(-1, realgid, realgid) != 0) { fprintf(stderr, "%s: Could not drop setgid privileges: %s\n", progname, strerror(errno)); exit(1); } if (setresuid(-1, realuid, realuid) != 0) { fprintf(stderr, "%s: Could not drop setuid privileges: %s\n", progname, strerror(errno)); exit(1); } } snprintf(buf, sizeof(buf), "%s/Xorg", SUID_WRAPPER_DIR); /* Check if the server is executable by our real uid */ if (access(buf, X_OK) != 0) { fprintf(stderr, "%s: Missing execute permissions for %s: %s\n", progname, buf, strerror(errno)); exit(1); } argv[0] = buf; (void) execv(argv[0], argv); fprintf(stderr, "%s: Failed to execute %s: %s\n", progname, buf, strerror(errno)); exit(1); } xorg-server-1.17.1/hw/xfree86/exa/0000775000175100017510000000000012466505445013566 500000000000000xorg-server-1.17.1/hw/xfree86/exa/Makefile.am0000664000175100017510000000053112200102654015516 00000000000000SUBDIRS = man module_LTLIBRARIES = libexa.la libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(srcdir)/../../../exa \ -I$(srcdir)/../../../miext/cw AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) libexa_la_SOURCES = \ examodule.c libexa_la_LIBADD = \ ../../../exa/libexa.la $(PIXMAN_LIBS) xorg-server-1.17.1/hw/xfree86/exa/examodule.c0000664000175100017510000001512212366220413015622 00000000000000/* * Copyright © 2006 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt * */ #ifdef HAVE_CONFIG_H #include #endif #include #include "exa_priv.h" #include "xf86str.h" #include "xf86.h" typedef struct _ExaXorgScreenPrivRec { CloseScreenProcPtr SavedCloseScreen; xf86EnableDisableFBAccessProc *SavedEnableDisableFBAccess; OptionInfoPtr options; } ExaXorgScreenPrivRec, *ExaXorgScreenPrivPtr; static DevPrivateKeyRec exaXorgScreenPrivateKeyRec; #define exaXorgScreenPrivateKey (&exaXorgScreenPrivateKeyRec) typedef enum { EXAOPT_MIGRATION_HEURISTIC, EXAOPT_NO_COMPOSITE, EXAOPT_NO_UTS, EXAOPT_NO_DFS, EXAOPT_OPTIMIZE_MIGRATION } EXAOpts; static const OptionInfoRec EXAOptions[] = { {EXAOPT_MIGRATION_HEURISTIC, "MigrationHeuristic", OPTV_ANYSTR, {0}, FALSE}, {EXAOPT_NO_COMPOSITE, "EXANoComposite", OPTV_BOOLEAN, {0}, FALSE}, {EXAOPT_NO_UTS, "EXANoUploadToScreen", OPTV_BOOLEAN, {0}, FALSE}, {EXAOPT_NO_DFS, "EXANoDownloadFromScreen", OPTV_BOOLEAN, {0}, FALSE}, {EXAOPT_OPTIMIZE_MIGRATION, "EXAOptimizeMigration", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; static Bool exaXorgCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey); pScreen->CloseScreen = pScreenPriv->SavedCloseScreen; pScrn->EnableDisableFBAccess = pScreenPriv->SavedEnableDisableFBAccess; free(pScreenPriv->options); free(pScreenPriv); return pScreen->CloseScreen(pScreen); } static void exaXorgEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey); if (!enable) exaEnableDisableFBAccess(pScreen, enable); if (pScreenPriv->SavedEnableDisableFBAccess) pScreenPriv->SavedEnableDisableFBAccess(pScrn, enable); if (enable) exaEnableDisableFBAccess(pScreen, enable); } /** * This will be called during exaDriverInit, giving us the chance to set options * and hook in our EnableDisableFBAccess. */ void exaDDXDriverInit(ScreenPtr pScreen) { ExaScreenPriv(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaXorgScreenPrivPtr pScreenPriv; if (!dixRegisterPrivateKey(&exaXorgScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return; pScreenPriv = calloc(1, sizeof(ExaXorgScreenPrivRec)); if (pScreenPriv == NULL) return; pScreenPriv->options = xnfalloc(sizeof(EXAOptions)); memcpy(pScreenPriv->options, EXAOptions, sizeof(EXAOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pScreenPriv->options); if (pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) { if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS) && pExaScr->info->offScreenBase < pExaScr->info->memorySize) { const char *heuristicName; heuristicName = xf86GetOptValString(pScreenPriv->options, EXAOPT_MIGRATION_HEURISTIC); if (heuristicName != NULL) { if (strcmp(heuristicName, "greedy") == 0) pExaScr->migration = ExaMigrationGreedy; else if (strcmp(heuristicName, "always") == 0) pExaScr->migration = ExaMigrationAlways; else if (strcmp(heuristicName, "smart") == 0) pExaScr->migration = ExaMigrationSmart; else { xf86DrvMsg(pScreen->myNum, X_WARNING, "EXA: unknown migration heuristic %s\n", heuristicName); } } } pExaScr->optimize_migration = xf86ReturnOptValBool(pScreenPriv->options, EXAOPT_OPTIMIZE_MIGRATION, TRUE); } if (xf86ReturnOptValBool(pScreenPriv->options, EXAOPT_NO_COMPOSITE, FALSE)) { xf86DrvMsg(pScreen->myNum, X_CONFIG, "EXA: Disabling Composite operation " "(RENDER acceleration)\n"); pExaScr->info->CheckComposite = NULL; pExaScr->info->PrepareComposite = NULL; } if (xf86ReturnOptValBool(pScreenPriv->options, EXAOPT_NO_UTS, FALSE)) { xf86DrvMsg(pScreen->myNum, X_CONFIG, "EXA: Disabling UploadToScreen\n"); pExaScr->info->UploadToScreen = NULL; } if (xf86ReturnOptValBool(pScreenPriv->options, EXAOPT_NO_DFS, FALSE)) { xf86DrvMsg(pScreen->myNum, X_CONFIG, "EXA: Disabling DownloadFromScreen\n"); pExaScr->info->DownloadFromScreen = NULL; } dixSetPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey, pScreenPriv); pScreenPriv->SavedEnableDisableFBAccess = pScrn->EnableDisableFBAccess; pScrn->EnableDisableFBAccess = exaXorgEnableDisableFBAccess; pScreenPriv->SavedCloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = exaXorgCloseScreen; } static XF86ModuleVersionInfo exaVersRec = { "exa", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, EXA_VERSION_MAJOR, EXA_VERSION_MINOR, EXA_VERSION_RELEASE, ABI_CLASS_VIDEODRV, /* requires the video driver ABI */ ABI_VIDEODRV_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData exaModuleData = { &exaVersRec, NULL, NULL }; xorg-server-1.17.1/hw/xfree86/exa/man/0000775000175100017510000000000012466505445014341 500000000000000xorg-server-1.17.1/hw/xfree86/exa/man/Makefile.am0000664000175100017510000000007212160102336016273 00000000000000include $(top_srcdir)/manpages.am driverman_PRE = exa.man xorg-server-1.17.1/hw/xfree86/exa/man/Makefile.in0000664000175100017510000006234412466505432016333 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = hw/xfree86/exa/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man driverman_PRE = exa.man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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/exa/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/exa/man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/xfree86/exa/man/exa.man0000664000175100017510000000340312160102336015512 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH EXA __drivermansuffix__ __vendorversion__ .SH NAME exa \- new 2D acceleration architecture for X.Org .SH DESCRIPTION .B EXA provides a simple API for video drivers to implement for 2D acceleration. It is a module loaded by drivers, and is not intended to be loaded on its own. See your driver's manual page for how to enable .BR EXA . .PP 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 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 Disables acceleration of the Composite operation, which is at the heart of the Render extension. Not related to the Composite extension. Default: No. .TP .BI "Option \*qEXANoUploadToScreen\*q \*q" boolean \*q Disables acceleration of uploading pixmap data to the framebuffer. Default: No. .TP .BI "Option \*qEXANoDownloadFromScreen\*q \*q" boolean \*q Disables acceleration of downloading of pixmap data from the framebuffer. .B NOTE: Not usable with drivers which rely on DownloadFromScreen succeeding. Default: No. .TP .BI "Option \*qMigrationHeuristic\*q \*q" anystr \*q Chooses an alternate pixmap migration heuristic, for debugging purposes. The 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 Xorg (__appmansuffix__), .BR xorg.conf(__filemansuffix__). .SH AUTHORS Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel D\(:anzer xorg-server-1.17.1/hw/xfree86/exa/Makefile.in0000664000175100017510000007717112466505432015564 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/exa DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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)" LTLIBRARIES = $(module_LTLIBRARIES) 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@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libexa_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libexa_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 = $(libexa_la_SOURCES) DIST_SOURCES = $(libexa_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = man module_LTLIBRARIES = libexa.la libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(srcdir)/../../../exa \ -I$(srcdir)/../../../miext/cw AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) libexa_la_SOURCES = \ examodule.c libexa_la_LIBADD = \ ../../../exa/libexa.la $(PIXMAN_LIBS) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/exa/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/exa/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libexa.la: $(libexa_la_OBJECTS) $(libexa_la_DEPENDENCIES) $(EXTRA_libexa_la_DEPENDENCIES) $(AM_V_CCLD)$(libexa_la_LINK) -rpath $(moduledir) $(libexa_la_OBJECTS) $(libexa_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/examodule.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 -o $@ $< .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 -o $@ `$(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 # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(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-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-moduleLTLIBRARIES cscopelist-am ctags ctags-am 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-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES # 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: xorg-server-1.17.1/hw/xfree86/parser/0000775000175100017510000000000012466505445014305 500000000000000xorg-server-1.17.1/hw/xfree86/parser/Makefile.am0000664000175100017510000000166112362011424016245 00000000000000if INSTALL_LIBXF86CONFIG noinst_LTLIBRARIES = libxf86config_internal.la lib_LTLIBRARIES = libxf86config.la LIBHEADERS = \ xf86Optrec.h \ xf86Parser.h else noinst_LTLIBRARIES = libxf86config_internal.la endif INTERNAL_SOURCES= \ Device.c \ Files.c \ Flags.c \ Input.c \ InputClass.c \ OutputClass.c \ Layout.c \ Module.c \ Video.c \ Monitor.c \ Pointer.c \ Screen.c \ Vendor.c \ read.c \ scan.c \ write.c \ DRI.c \ Extensions.c libxf86config_internal_la_SOURCES = \ $(INTERNAL_SOURCES) libxf86config_la_SOURCES = \ $(top_srcdir)/os/xprintf.c \ $(INTERNAL_SOURCES) libxf86config_la_CFLAGS = $(AM_CFLAGS) libxf86config_la_LDFLAGS = -static AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DDATADIR=\"$(datadir)\" EXTRA_DIST = \ Configint.h \ configProcs.h \ xf86Optrec.h \ xf86Parser.h \ xf86tokens.h sdk_HEADERS = \ xf86Parser.h \ xf86Optrec.h AM_CPPFLAGS = -I$(srcdir)/../common xorg-server-1.17.1/hw/xfree86/parser/DRI.c0000664000175100017510000000705712456571574015025 00000000000000/* DRI.c -- DRI Section in XF86Config file * Created: Fri Mar 19 08:40:22 1999 by faith@precisioninsight.com * Revised: Thu Jun 17 16:08:05 1999 by faith@precisioninsight.com * * 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, 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 * 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. * * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec DRITab[] = { {ENDSECTION, "endsection"}, {GROUP, "group"}, {MODE, "mode"}, {-1, ""}, }; #define CLEANUP xf86freeDRI XF86ConfDRIPtr xf86parseDRISection(void) { int token; parsePrologue(XF86ConfDRIPtr, XF86ConfDRIRec); /* Zero is a valid value for this. */ ptr->dri_group = -1; while ((token = xf86getToken(DRITab)) != ENDSECTION) { switch (token) { case GROUP: if ((token = xf86getSubToken(&(ptr->dri_comment))) == STRING) ptr->dri_group_name = xf86_lex_val.str; else if (token == NUMBER) ptr->dri_group = xf86_lex_val.num; else Error(GROUP_MSG); break; case MODE: if (xf86getSubToken(&(ptr->dri_comment)) != NUMBER) Error(NUMBER_MSG, "Mode"); if (xf86_lex_val.numType != PARSE_OCTAL) Error(MUST_BE_OCTAL_MSG, xf86_lex_val.num); ptr->dri_mode = xf86_lex_val.num; break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; case COMMENT: ptr->dri_comment = xf86addComment(ptr->dri_comment, xf86_lex_val.str); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG ErrorF("DRI section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printDRISection(FILE * cf, XF86ConfDRIPtr ptr) { if (ptr == NULL) return; fprintf(cf, "Section \"DRI\"\n"); if (ptr->dri_comment) fprintf(cf, "%s", ptr->dri_comment); if (ptr->dri_group_name) fprintf(cf, "\tGroup \"%s\"\n", ptr->dri_group_name); else if (ptr->dri_group >= 0) fprintf(cf, "\tGroup %d\n", ptr->dri_group); if (ptr->dri_mode) fprintf(cf, "\tMode 0%o\n", ptr->dri_mode); fprintf(cf, "EndSection\n\n"); } void xf86freeDRI(XF86ConfDRIPtr ptr) { if (ptr == NULL) return; TestFree(ptr->dri_comment); free(ptr); } xorg-server-1.17.1/hw/xfree86/parser/Video.c0000664000175100017510000002174412456571574015454 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec VideoPortTab[] = { {ENDSUBSECTION, "endsubsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, {-1, ""}, }; #define CLEANUP xf86freeVideoPortList static void xf86freeVideoPortList(XF86ConfVideoPortPtr ptr) { XF86ConfVideoPortPtr prev; while (ptr) { TestFree(ptr->vp_identifier); TestFree(ptr->vp_comment); xf86optionListFree(ptr->vp_option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } static XF86ConfVideoPortPtr xf86parseVideoPortSubSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfVideoPortPtr, XF86ConfVideoPortRec) while ((token = xf86getToken(VideoPortTab)) != ENDSUBSECTION) { switch (token) { case COMMENT: ptr->vp_comment = xf86addComment(ptr->vp_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->vp_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->vp_identifier = xf86_lex_val.str; has_ident = TRUE; break; case OPTION: ptr->vp_option_lst = xf86parseOption(ptr->vp_option_lst); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG printf("VideoPort subsection parsed\n"); #endif return ptr; } #undef CLEANUP static xf86ConfigSymTabRec VideoAdaptorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, {BOARD, "boardname"}, {BUSID, "busid"}, {DRIVER, "driver"}, {OPTION, "option"}, {SUBSECTION, "subsection"}, {-1, ""}, }; #define CLEANUP xf86freeVideoAdaptorList XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfVideoAdaptorPtr, XF86ConfVideoAdaptorRec) while ((token = xf86getToken(VideoAdaptorTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->va_comment = xf86addComment(ptr->va_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->va_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); ptr->va_identifier = xf86_lex_val.str; if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); has_ident = TRUE; break; case VENDOR: if (xf86getSubToken(&(ptr->va_comment)) != STRING) Error(QUOTE_MSG, "Vendor"); ptr->va_vendor = xf86_lex_val.str; break; case BOARD: if (xf86getSubToken(&(ptr->va_comment)) != STRING) Error(QUOTE_MSG, "Board"); ptr->va_board = xf86_lex_val.str; break; case BUSID: if (xf86getSubToken(&(ptr->va_comment)) != STRING) Error(QUOTE_MSG, "BusID"); ptr->va_busid = xf86_lex_val.str; break; case DRIVER: if (xf86getSubToken(&(ptr->va_comment)) != STRING) Error(QUOTE_MSG, "Driver"); ptr->va_driver = xf86_lex_val.str; break; case OPTION: ptr->va_option_lst = xf86parseOption(ptr->va_option_lst); break; case SUBSECTION: if (xf86getSubToken(&(ptr->va_comment)) != STRING) Error(QUOTE_MSG, "SubSection"); { HANDLE_LIST(va_port_lst, xf86parseVideoPortSubSection, XF86ConfVideoPortPtr); } break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("VideoAdaptor section parsed\n"); #endif return ptr; } void xf86printVideoAdaptorSection(FILE * cf, XF86ConfVideoAdaptorPtr ptr) { XF86ConfVideoPortPtr pptr; while (ptr) { fprintf(cf, "Section \"VideoAdaptor\"\n"); if (ptr->va_comment) fprintf(cf, "%s", ptr->va_comment); if (ptr->va_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->va_identifier); if (ptr->va_vendor) fprintf(cf, "\tVendorName \"%s\"\n", ptr->va_vendor); if (ptr->va_board) fprintf(cf, "\tBoardName \"%s\"\n", ptr->va_board); if (ptr->va_busid) fprintf(cf, "\tBusID \"%s\"\n", ptr->va_busid); if (ptr->va_driver) fprintf(cf, "\tDriver \"%s\"\n", ptr->va_driver); xf86printOptionList(cf, ptr->va_option_lst, 1); for (pptr = ptr->va_port_lst; pptr; pptr = pptr->list.next) { fprintf(cf, "\tSubSection \"VideoPort\"\n"); if (pptr->vp_comment) fprintf(cf, "%s", pptr->vp_comment); if (pptr->vp_identifier) fprintf(cf, "\t\tIdentifier \"%s\"\n", pptr->vp_identifier); xf86printOptionList(cf, pptr->vp_option_lst, 2); fprintf(cf, "\tEndSubSection\n"); } fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr) { XF86ConfVideoAdaptorPtr prev; while (ptr) { TestFree(ptr->va_identifier); TestFree(ptr->va_vendor); TestFree(ptr->va_board); TestFree(ptr->va_busid); TestFree(ptr->va_driver); TestFree(ptr->va_fwdref); TestFree(ptr->va_comment); xf86freeVideoPortList(ptr->va_port_lst); xf86optionListFree(ptr->va_option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident, XF86ConfVideoAdaptorPtr p) { while (p) { if (xf86nameCompare(ident, p->va_identifier) == 0) return p; p = p->list.next; } return NULL; } xorg-server-1.17.1/hw/xfree86/parser/Vendor.c0000664000175100017510000001631112456571574015635 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec VendorSubTab[] = { {ENDSUBSECTION, "endsubsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, {-1, ""}, }; #define CLEANUP xf86freeVendorSubList static XF86ConfVendSubPtr xf86parseVendorSubSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfVendSubPtr, XF86ConfVendSubRec) while ((token = xf86getToken(VendorSubTab)) != ENDSUBSECTION) { switch (token) { case COMMENT: ptr->vs_comment = xf86addComment(ptr->vs_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->vs_comment))) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->vs_identifier = xf86_lex_val.str; has_ident = TRUE; break; case OPTION: ptr->vs_option_lst = xf86parseOption(ptr->vs_option_lst); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG printf("Vendor subsection parsed\n"); #endif return ptr; } #undef CLEANUP static xf86ConfigSymTabRec VendorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, {SUBSECTION, "subsection"}, {-1, ""}, }; #define CLEANUP xf86freeVendorList XF86ConfVendorPtr xf86parseVendorSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfVendorPtr, XF86ConfVendorRec) while ((token = xf86getToken(VendorTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->vnd_comment = xf86addComment(ptr->vnd_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->vnd_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->vnd_identifier = xf86_lex_val.str; has_ident = TRUE; break; case OPTION: ptr->vnd_option_lst = xf86parseOption(ptr->vnd_option_lst); break; case SUBSECTION: if (xf86getSubToken(&(ptr->vnd_comment)) != STRING) Error(QUOTE_MSG, "SubSection"); { HANDLE_LIST(vnd_sub_lst, xf86parseVendorSubSection, XF86ConfVendSubPtr); } break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("Vendor section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr) { XF86ConfVendSubPtr pptr; while (ptr) { fprintf(cf, "Section \"Vendor\"\n"); if (ptr->vnd_comment) fprintf(cf, "%s", ptr->vnd_comment); if (ptr->vnd_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->vnd_identifier); xf86printOptionList(cf, ptr->vnd_option_lst, 1); for (pptr = ptr->vnd_sub_lst; pptr; pptr = pptr->list.next) { fprintf(cf, "\tSubSection \"Vendor\"\n"); if (pptr->vs_comment) fprintf(cf, "%s", pptr->vs_comment); if (pptr->vs_identifier) fprintf(cf, "\t\tIdentifier \"%s\"\n", pptr->vs_identifier); xf86printOptionList(cf, pptr->vs_option_lst, 2); fprintf(cf, "\tEndSubSection\n"); } fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeVendorList(XF86ConfVendorPtr p) { if (p == NULL) return; xf86freeVendorSubList(p->vnd_sub_lst); TestFree(p->vnd_identifier); TestFree(p->vnd_comment); xf86optionListFree(p->vnd_option_lst); free(p); } void xf86freeVendorSubList(XF86ConfVendSubPtr ptr) { XF86ConfVendSubPtr prev; while (ptr) { TestFree(ptr->vs_identifier); TestFree(ptr->vs_name); TestFree(ptr->vs_comment); xf86optionListFree(ptr->vs_option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } xorg-server-1.17.1/hw/xfree86/parser/Files.c0000664000175100017510000001666412456571574015455 00000000000000/* * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec FilesTab[] = { {ENDSECTION, "endsection"}, {FONTPATH, "fontpath"}, {MODULEPATH, "modulepath"}, {LOGFILEPATH, "logfile"}, {XKBDIR, "xkbdir"}, /* Obsolete keywords that aren't used but shouldn't cause errors: */ {OBSOLETE_TOKEN, "rgbpath"}, {OBSOLETE_TOKEN, "inputdevices"}, {-1, ""}, }; #define CLEANUP xf86freeFiles XF86ConfFilesPtr xf86parseFilesSection(void) { int i, j; int k, l; char *str; int token; parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec) while ((token = xf86getToken(FilesTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->file_comment = xf86addComment(ptr->file_comment, xf86_lex_val.str); break; case FONTPATH: if (xf86getSubToken(&(ptr->file_comment)) != STRING) Error(QUOTE_MSG, "FontPath"); j = FALSE; str = xf86_lex_val.str; if (ptr->file_fontpath == NULL) { ptr->file_fontpath = calloc(1, 1); i = strlen(str) + 1; } else { i = strlen(ptr->file_fontpath) + strlen(str) + 1; if (ptr->file_fontpath[strlen(ptr->file_fontpath) - 1] != ',') { i++; j = TRUE; } } ptr->file_fontpath = realloc(ptr->file_fontpath, i); if (j) strcat(ptr->file_fontpath, ","); strcat(ptr->file_fontpath, str); free(xf86_lex_val.str); break; case MODULEPATH: if (xf86getSubToken(&(ptr->file_comment)) != STRING) Error(QUOTE_MSG, "ModulePath"); l = FALSE; str = xf86_lex_val.str; if (ptr->file_modulepath == NULL) { ptr->file_modulepath = malloc(1); ptr->file_modulepath[0] = '\0'; k = strlen(str) + 1; } else { k = strlen(ptr->file_modulepath) + strlen(str) + 1; if (ptr->file_modulepath[strlen(ptr->file_modulepath) - 1] != ',') { k++; l = TRUE; } } ptr->file_modulepath = realloc(ptr->file_modulepath, k); if (l) strcat(ptr->file_modulepath, ","); strcat(ptr->file_modulepath, str); free(xf86_lex_val.str); break; case LOGFILEPATH: if (xf86getSubToken(&(ptr->file_comment)) != STRING) Error(QUOTE_MSG, "LogFile"); ptr->file_logfile = xf86_lex_val.str; break; case XKBDIR: if (xf86getSubToken(&(ptr->file_xkbdir)) != STRING) Error(QUOTE_MSG, "XkbDir"); ptr->file_xkbdir = xf86_lex_val.str; break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; case OBSOLETE_TOKEN: xf86parseError(OBSOLETE_MSG, xf86tokenString()); xf86getSubToken(&(ptr->file_comment)); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG printf("File section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printFileSection(FILE * cf, XF86ConfFilesPtr ptr) { char *p, *s; if (ptr == NULL) return; if (ptr->file_comment) fprintf(cf, "%s", ptr->file_comment); if (ptr->file_logfile) fprintf(cf, "\tLogFile \"%s\"\n", ptr->file_logfile); if (ptr->file_modulepath) { s = ptr->file_modulepath; p = index(s, ','); while (p) { *p = '\000'; fprintf(cf, "\tModulePath \"%s\"\n", s); *p = ','; s = p; s++; p = index(s, ','); } fprintf(cf, "\tModulePath \"%s\"\n", s); } if (ptr->file_fontpath) { s = ptr->file_fontpath; p = index(s, ','); while (p) { *p = '\000'; fprintf(cf, "\tFontPath \"%s\"\n", s); *p = ','; s = p; s++; p = index(s, ','); } fprintf(cf, "\tFontPath \"%s\"\n", s); } if (ptr->file_xkbdir) fprintf(cf, "\tXkbDir \"%s\"\n", ptr->file_xkbdir); } void xf86freeFiles(XF86ConfFilesPtr p) { if (p == NULL) return; TestFree(p->file_logfile); TestFree(p->file_modulepath); TestFree(p->file_fontpath); TestFree(p->file_comment); TestFree(p->file_xkbdir); free(p); } xorg-server-1.17.1/hw/xfree86/parser/InputClass.c0000664000175100017510000004001512366220413016442 00000000000000/* * Copyright (c) 2009 Dan Nicholson * * 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec InputClassTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, {DRIVER, "driver"}, {MATCH_PRODUCT, "matchproduct"}, {MATCH_VENDOR, "matchvendor"}, {MATCH_DEVICE_PATH, "matchdevicepath"}, {MATCH_OS, "matchos"}, {MATCH_PNPID, "matchpnpid"}, {MATCH_USBID, "matchusbid"}, {MATCH_DRIVER, "matchdriver"}, {MATCH_TAG, "matchtag"}, {MATCH_LAYOUT, "matchlayout"}, {MATCH_IS_KEYBOARD, "matchiskeyboard"}, {MATCH_IS_POINTER, "matchispointer"}, {MATCH_IS_JOYSTICK, "matchisjoystick"}, {MATCH_IS_TABLET, "matchistablet"}, {MATCH_IS_TOUCHPAD, "matchistouchpad"}, {MATCH_IS_TOUCHSCREEN, "matchistouchscreen"}, {-1, ""}, }; #define CLEANUP xf86freeInputClassList #define TOKEN_SEP "|" static void add_group_entry(struct xorg_list *head, char **values) { xf86MatchGroup *group; group = malloc(sizeof(*group)); if (group) { group->values = values; xorg_list_add(&group->entry, head); } } XF86ConfInputClassPtr xf86parseInputClassSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfInputClassPtr, XF86ConfInputClassRec) /* Initialize MatchGroup lists */ xorg_list_init(&ptr->match_product); xorg_list_init(&ptr->match_vendor); xorg_list_init(&ptr->match_device); xorg_list_init(&ptr->match_os); xorg_list_init(&ptr->match_pnpid); xorg_list_init(&ptr->match_usbid); xorg_list_init(&ptr->match_driver); xorg_list_init(&ptr->match_tag); xorg_list_init(&ptr->match_layout); while ((token = xf86getToken(InputClassTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->identifier = xf86_lex_val.str; has_ident = TRUE; break; case DRIVER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "Driver"); if (strcmp(xf86_lex_val.str, "keyboard") == 0) { ptr->driver = strdup("kbd"); free(xf86_lex_val.str); } else ptr->driver = xf86_lex_val.str; break; case OPTION: ptr->option_lst = xf86parseOption(ptr->option_lst); break; case MATCH_PRODUCT: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchProduct"); add_group_entry(&ptr->match_product, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_VENDOR: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchVendor"); add_group_entry(&ptr->match_vendor, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_DEVICE_PATH: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDevicePath"); add_group_entry(&ptr->match_device, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_OS: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchOS"); add_group_entry(&ptr->match_os, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_PNPID: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchPnPID"); add_group_entry(&ptr->match_pnpid, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_USBID: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchUSBID"); add_group_entry(&ptr->match_usbid, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_DRIVER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDriver"); add_group_entry(&ptr->match_driver, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_TAG: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchTag"); add_group_entry(&ptr->match_tag, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_LAYOUT: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchLayout"); add_group_entry(&ptr->match_layout, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case MATCH_IS_KEYBOARD: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsKeyboard"); ptr->is_keyboard.set = xf86getBoolValue(&ptr->is_keyboard.val, xf86_lex_val.str); free(xf86_lex_val.str); if (!ptr->is_keyboard.set) Error(BOOL_MSG, "MatchIsKeyboard"); break; case MATCH_IS_POINTER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsPointer"); ptr->is_pointer.set = xf86getBoolValue(&ptr->is_pointer.val, xf86_lex_val.str); free(xf86_lex_val.str); if (!ptr->is_pointer.set) Error(BOOL_MSG, "MatchIsPointer"); break; case MATCH_IS_JOYSTICK: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsJoystick"); ptr->is_joystick.set = xf86getBoolValue(&ptr->is_joystick.val, xf86_lex_val.str); free(xf86_lex_val.str); if (!ptr->is_joystick.set) Error(BOOL_MSG, "MatchIsJoystick"); break; case MATCH_IS_TABLET: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsTablet"); ptr->is_tablet.set = xf86getBoolValue(&ptr->is_tablet.val, xf86_lex_val.str); free(xf86_lex_val.str); if (!ptr->is_tablet.set) Error(BOOL_MSG, "MatchIsTablet"); break; case MATCH_IS_TOUCHPAD: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsTouchpad"); ptr->is_touchpad.set = xf86getBoolValue(&ptr->is_touchpad.val, xf86_lex_val.str); free(xf86_lex_val.str); if (!ptr->is_touchpad.set) Error(BOOL_MSG, "MatchIsTouchpad"); break; case MATCH_IS_TOUCHSCREEN: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsTouchscreen"); ptr->is_touchscreen.set = xf86getBoolValue(&ptr->is_touchscreen.val, xf86_lex_val.str); free(xf86_lex_val.str); if (!ptr->is_touchscreen.set) Error(BOOL_MSG, "MatchIsTouchscreen"); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("InputClass section parsed\n"); #endif return ptr; } void xf86printInputClassSection(FILE * cf, XF86ConfInputClassPtr ptr) { const xf86MatchGroup *group; char *const *cur; while (ptr) { fprintf(cf, "Section \"InputClass\"\n"); if (ptr->comment) fprintf(cf, "%s", ptr->comment); if (ptr->identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->identifier); if (ptr->driver) fprintf(cf, "\tDriver \"%s\"\n", ptr->driver); xorg_list_for_each_entry(group, &ptr->match_product, entry) { fprintf(cf, "\tMatchProduct \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_vendor, entry) { fprintf(cf, "\tMatchVendor \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_device, entry) { fprintf(cf, "\tMatchDevicePath \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_os, entry) { fprintf(cf, "\tMatchOS \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_pnpid, entry) { fprintf(cf, "\tMatchPnPID \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_usbid, entry) { fprintf(cf, "\tMatchUSBID \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_driver, entry) { fprintf(cf, "\tMatchDriver \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_tag, entry) { fprintf(cf, "\tMatchTag \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } xorg_list_for_each_entry(group, &ptr->match_layout, entry) { fprintf(cf, "\tMatchLayout \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } if (ptr->is_keyboard.set) fprintf(cf, "\tIsKeyboard \"%s\"\n", ptr->is_keyboard.val ? "yes" : "no"); if (ptr->is_pointer.set) fprintf(cf, "\tIsPointer \"%s\"\n", ptr->is_pointer.val ? "yes" : "no"); if (ptr->is_joystick.set) fprintf(cf, "\tIsJoystick \"%s\"\n", ptr->is_joystick.val ? "yes" : "no"); if (ptr->is_tablet.set) fprintf(cf, "\tIsTablet \"%s\"\n", ptr->is_tablet.val ? "yes" : "no"); if (ptr->is_touchpad.set) fprintf(cf, "\tIsTouchpad \"%s\"\n", ptr->is_touchpad.val ? "yes" : "no"); if (ptr->is_touchscreen.set) fprintf(cf, "\tIsTouchscreen \"%s\"\n", ptr->is_touchscreen.val ? "yes" : "no"); xf86printOptionList(cf, ptr->option_lst, 1); fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeInputClassList(XF86ConfInputClassPtr ptr) { XF86ConfInputClassPtr prev; while (ptr) { xf86MatchGroup *group, *next; char **list; TestFree(ptr->identifier); TestFree(ptr->driver); xorg_list_for_each_entry_safe(group, next, &ptr->match_product, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_vendor, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_device, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_os, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_pnpid, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_usbid, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_tag, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_layout, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } TestFree(ptr->comment); xf86optionListFree(ptr->option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } xorg-server-1.17.1/hw/xfree86/parser/Input.c0000664000175100017510000001431012456571574015474 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec InputTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, {DRIVER, "driver"}, {-1, ""}, }; #define CLEANUP xf86freeInputList XF86ConfInputPtr xf86parseInputSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfInputPtr, XF86ConfInputRec) while ((token = xf86getToken(InputTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->inp_comment = xf86addComment(ptr->inp_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->inp_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->inp_identifier = xf86_lex_val.str; has_ident = TRUE; break; case DRIVER: if (xf86getSubToken(&(ptr->inp_comment)) != STRING) Error(QUOTE_MSG, "Driver"); if (strcmp(xf86_lex_val.str, "keyboard") == 0) { ptr->inp_driver = strdup("kbd"); free(xf86_lex_val.str); } else ptr->inp_driver = xf86_lex_val.str; break; case OPTION: ptr->inp_option_lst = xf86parseOption(ptr->inp_option_lst); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("InputDevice section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printInputSection(FILE * cf, XF86ConfInputPtr ptr) { while (ptr) { fprintf(cf, "Section \"InputDevice\"\n"); if (ptr->inp_comment) fprintf(cf, "%s", ptr->inp_comment); if (ptr->inp_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->inp_identifier); if (ptr->inp_driver) fprintf(cf, "\tDriver \"%s\"\n", ptr->inp_driver); xf86printOptionList(cf, ptr->inp_option_lst, 1); fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeInputList(XF86ConfInputPtr ptr) { XF86ConfInputPtr prev; while (ptr) { TestFree(ptr->inp_identifier); TestFree(ptr->inp_driver); TestFree(ptr->inp_comment); xf86optionListFree(ptr->inp_option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } int xf86validateInput(XF86ConfigPtr p) { XF86ConfInputPtr input = p->conf_input_lst; while (input) { if (!input->inp_driver) { xf86validationError(UNDEFINED_INPUTDRIVER_MSG, input->inp_identifier); return FALSE; } input = input->list.next; } return TRUE; } XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p) { while (p) { if (xf86nameCompare(ident, p->inp_identifier) == 0) return p; p = p->list.next; } return NULL; } XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p) { while (p) { if (xf86nameCompare(driver, p->inp_driver) == 0) return p; p = p->list.next; } return NULL; } xorg-server-1.17.1/hw/xfree86/parser/scan.c0000664000175100017510000007515612456571574015340 00000000000000/* * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #if defined(_POSIX_SOURCE) #include #else #define _POSIX_SOURCE #include #undef _POSIX_SOURCE #endif /* _POSIX_SOURCE */ #if !defined(MAXHOSTNAMELEN) #define MAXHOSTNAMELEN 32 #endif /* !MAXHOSTNAMELEN */ /* For PATH_MAX */ #include "misc.h" #include "Configint.h" #include "xf86tokens.h" #define CONFIG_BUF_LEN 1024 #define CONFIG_MAX_FILES 64 static int StringToToken(const char *, xf86ConfigSymTabRec *); static struct { FILE *file; char *path; } configFiles[CONFIG_MAX_FILES]; static const char **builtinConfig = NULL; static int builtinIndex = 0; static int configPos = 0; /* current readers position */ static int configLineNo = 0; /* linenumber */ static char *configBuf, *configRBuf; /* buffer for lines */ static char *configSection = NULL; /* name of current section being parsed */ static int numFiles = 0; /* number of config files */ static int curFileIndex = 0; /* index of current config file */ static int pushToken = LOCK_TOKEN; static int eol_seen = 0; /* private state to handle comments */ LexRec xf86_lex_val; /* * xf86getNextLine -- * * read from the configFiles FILE stream until we encounter a new * line; this is effectively just a big wrapper for fgets(3). * * xf86getToken() assumes that we will read up to the next * newline; we need to grow configBuf and configRBuf as needed to * support that. */ static char * xf86getNextLine(void) { static int configBufLen = CONFIG_BUF_LEN; char *tmpConfigBuf, *tmpConfigRBuf; int c, i, pos = 0, eolFound = 0; char *ret = NULL; /* * reallocate the string if it was grown last time (i.e., is no * longer CONFIG_BUF_LEN); we malloc the new strings first, so * that if either of the mallocs fail, we can fall back on the * existing buffer allocations */ if (configBufLen != CONFIG_BUF_LEN) { tmpConfigBuf = malloc(CONFIG_BUF_LEN); tmpConfigRBuf = malloc(CONFIG_BUF_LEN); if (!tmpConfigBuf || !tmpConfigRBuf) { /* * at least one of the mallocs failed; keep the old buffers * and free any partial allocations */ free(tmpConfigBuf); free(tmpConfigRBuf); } else { /* * malloc succeeded; free the old buffers and use the new * buffers */ configBufLen = CONFIG_BUF_LEN; free(configBuf); free(configRBuf); configBuf = tmpConfigBuf; configRBuf = tmpConfigRBuf; } } /* read in another block of chars */ do { ret = fgets(configBuf + pos, configBufLen - pos - 1, configFiles[curFileIndex].file); if (!ret) { /* * if the file doesn't end in a newline, add one * and trigger another read */ if (pos != 0) { strcpy(&configBuf[pos], "\n"); ret = configBuf; } else break; } /* search for EOL in the new block of chars */ for (i = pos; i < (configBufLen - 1); i++) { c = configBuf[i]; if (c == '\0') break; if ((c == '\n') || (c == '\r')) { eolFound = 1; break; } } /* * if we didn't find EOL, then grow the string and * read in more */ if (!eolFound) { tmpConfigBuf = realloc(configBuf, configBufLen + CONFIG_BUF_LEN); tmpConfigRBuf = realloc(configRBuf, configBufLen + CONFIG_BUF_LEN); if (!tmpConfigBuf || !tmpConfigRBuf) { /* * at least one of the reallocations failed; use the * new allocation that succeeded, but we have to * fallback to the previous configBufLen size and use * the string we have, even though we don't have an * EOL */ if (tmpConfigBuf) configBuf = tmpConfigBuf; if (tmpConfigRBuf) configRBuf = tmpConfigRBuf; break; } else { /* reallocation succeeded */ configBuf = tmpConfigBuf; configRBuf = tmpConfigRBuf; pos = i; configBufLen += CONFIG_BUF_LEN; } } } while (!eolFound); return ret; } /* * xf86getToken -- * Read next Token from the config file. Handle the global variable * pushToken. */ int xf86getToken(xf86ConfigSymTabRec * tab) { int c, i; /* * First check whether pushToken has a different value than LOCK_TOKEN. * In this case rBuf[] contains a valid STRING/TOKEN/NUMBER. But in the * oth * case the next token must be read from the input. */ if (pushToken == EOF_TOKEN) return EOF_TOKEN; else if (pushToken == LOCK_TOKEN) { /* * eol_seen is only set for the first token after a newline. */ eol_seen = 0; c = configBuf[configPos]; /* * Get start of next Token. EOF is handled, * whitespaces are skipped. */ again: if (!c) { char *ret; if (numFiles > 0) ret = xf86getNextLine(); else { if (builtinConfig[builtinIndex] == NULL) ret = NULL; else { strlcpy(configBuf, builtinConfig[builtinIndex], CONFIG_BUF_LEN); ret = configBuf; builtinIndex++; } } if (ret == NULL) { /* * if necessary, move to the next file and * read the first line */ if (curFileIndex + 1 < numFiles) { curFileIndex++; configLineNo = 0; goto again; } else return pushToken = EOF_TOKEN; } configLineNo++; configPos = 0; eol_seen = 1; } i = 0; for (;;) { c = configBuf[configPos++]; configRBuf[i++] = c; switch (c) { case ' ': case '\t': case '\r': continue; case '\n': i = 0; continue; } break; } if (c == '\0') goto again; if (c == '#') { do { configRBuf[i++] = (c = configBuf[configPos++]); } while ((c != '\n') && (c != '\r') && (c != '\0')); configRBuf[i] = '\0'; /* XXX no private copy. * Use xf86addComment when setting a comment. */ xf86_lex_val.str = configRBuf; return COMMENT; } /* GJA -- handle '-' and ',' * Be careful: "-hsync" is a keyword. */ else if ((c == ',') && !isalpha(configBuf[configPos])) { return COMMA; } else if ((c == '-') && !isalpha(configBuf[configPos])) { return DASH; } /* * Numbers are returned immediately ... */ if (isdigit(c)) { int base; if (c == '0') if ((configBuf[configPos] == 'x') || (configBuf[configPos] == 'X')) { base = 16; xf86_lex_val.numType = PARSE_HEX; } else { base = 8; xf86_lex_val.numType = PARSE_OCTAL; } else { base = 10; xf86_lex_val.numType = PARSE_DECIMAL; } configRBuf[0] = c; i = 1; while (isdigit(c = configBuf[configPos++]) || (c == '.') || (c == 'x') || (c == 'X') || ((base == 16) && (((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F'))))) configRBuf[i++] = c; configPos--; /* GJA -- one too far */ configRBuf[i] = '\0'; xf86_lex_val.num = strtoul(configRBuf, NULL, 0); xf86_lex_val.realnum = atof(configRBuf); return NUMBER; } /* * All Strings START with a \" ... */ else if (c == '\"') { i = -1; do { configRBuf[++i] = (c = configBuf[configPos++]); } while ((c != '\"') && (c != '\n') && (c != '\r') && (c != '\0')); configRBuf[i] = '\0'; xf86_lex_val.str = malloc(strlen(configRBuf) + 1); strcpy(xf86_lex_val.str, configRBuf); /* private copy ! */ return STRING; } /* * ... and now we MUST have a valid token. The search is * handled later along with the pushed tokens. */ else { configRBuf[0] = c; i = 0; do { configRBuf[++i] = (c = configBuf[configPos++]); } while ((c != ' ') && (c != '\t') && (c != '\n') && (c != '\r') && (c != '\0') && (c != '#')); --configPos; configRBuf[i] = '\0'; i = 0; } } else { /* * Here we deal with pushed tokens. Reinitialize pushToken again. If * the pushed token was NUMBER || STRING return them again ... */ int temp = pushToken; pushToken = LOCK_TOKEN; if (temp == COMMA || temp == DASH) return temp; if (temp == NUMBER || temp == STRING) return temp; } /* * Joop, at last we have to lookup the token ... */ if (tab) { i = 0; while (tab[i].token != -1) if (xf86nameCompare(configRBuf, tab[i].name) == 0) return tab[i].token; else i++; } return ERROR_TOKEN; /* Error catcher */ } int xf86getSubToken(char **comment) { int token; for (;;) { token = xf86getToken(NULL); if (token == COMMENT) { if (comment) *comment = xf86addComment(*comment, xf86_lex_val.str); } else return token; } /*NOTREACHED*/} int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec * tab) { int token; for (;;) { token = xf86getToken(tab); if (token == COMMENT) { if (comment) *comment = xf86addComment(*comment, xf86_lex_val.str); } else return token; } /*NOTREACHED*/} void xf86unGetToken(int token) { pushToken = token; } char * xf86tokenString(void) { return configRBuf; } int xf86pathIsAbsolute(const char *path) { if (path && path[0] == '/') return 1; return 0; } /* A path is "safe" if it is relative and if it contains no ".." elements. */ int xf86pathIsSafe(const char *path) { if (xf86pathIsAbsolute(path)) return 0; /* Compare with ".." */ if (!strcmp(path, "..")) return 0; /* Look for leading "../" */ if (!strncmp(path, "../", 3)) return 0; /* Look for trailing "/.." */ if ((strlen(path) > 3) && !strcmp(path + strlen(path) - 3, "/..")) return 0; /* Look for "/../" */ if (strstr(path, "/../")) return 0; return 1; } /* * This function substitutes the following escape sequences: * * %A cmdline argument as an absolute path (must be absolute to match) * %R cmdline argument as a relative path * %S cmdline argument as a "safe" path (relative, and no ".." elements) * %X default config file name ("xorg.conf") * %H hostname * %E config file environment ($XORGCONFIG) as an absolute path * %F config file environment ($XORGCONFIG) as a relative path * %G config file environment ($XORGCONFIG) as a safe path * %P projroot * %C sysconfdir * %D datadir * %% % */ #ifndef XCONFIGFILE #define XCONFIGFILE "xorg.conf" #endif #ifndef XCONFIGDIR #define XCONFIGDIR "xorg.conf.d" #endif #ifndef XCONFIGSUFFIX #define XCONFIGSUFFIX ".conf" #endif #ifndef PROJECTROOT #define PROJECTROOT "/usr/X11R6" #endif #ifndef SYSCONFDIR #define SYSCONFDIR PROJECTROOT "/etc" #endif #ifndef DATADIR #define DATADIR PROJECTROOT "/share" #endif #ifndef XCONFENV #define XCONFENV "XORGCONFIG" #endif #define BAIL_OUT do { \ free(result); \ return NULL; \ } while (0) #define CHECK_LENGTH do { \ if (l > PATH_MAX) { \ BAIL_OUT; \ } \ } while (0) #define APPEND_STR(s) do { \ if (strlen(s) + l > PATH_MAX) { \ BAIL_OUT; \ } else { \ strcpy(result + l, s); \ l += strlen(s); \ } \ } while (0) static char * DoSubstitution(const char *template, const char *cmdline, const char *projroot, int *cmdlineUsed, int *envUsed, const char *XConfigFile) { char *result; int i, l; static const char *env = NULL; static char *hostname = NULL; if (!template) return NULL; if (cmdlineUsed) *cmdlineUsed = 0; if (envUsed) *envUsed = 0; result = malloc(PATH_MAX + 1); l = 0; for (i = 0; template[i]; i++) { if (template[i] != '%') { result[l++] = template[i]; CHECK_LENGTH; } else { switch (template[++i]) { case 'A': if (cmdline && xf86pathIsAbsolute(cmdline)) { APPEND_STR(cmdline); if (cmdlineUsed) *cmdlineUsed = 1; } else BAIL_OUT; break; case 'R': if (cmdline && !xf86pathIsAbsolute(cmdline)) { APPEND_STR(cmdline); if (cmdlineUsed) *cmdlineUsed = 1; } else BAIL_OUT; break; case 'S': if (cmdline && xf86pathIsSafe(cmdline)) { APPEND_STR(cmdline); if (cmdlineUsed) *cmdlineUsed = 1; } else BAIL_OUT; break; case 'X': APPEND_STR(XConfigFile); break; case 'H': if (!hostname) { if ((hostname = malloc(MAXHOSTNAMELEN + 1))) { if (gethostname(hostname, MAXHOSTNAMELEN) == 0) { hostname[MAXHOSTNAMELEN] = '\0'; } else { free(hostname); hostname = NULL; } } } if (hostname) APPEND_STR(hostname); break; case 'E': if (!env) env = getenv(XCONFENV); if (env && xf86pathIsAbsolute(env)) { APPEND_STR(env); if (envUsed) *envUsed = 1; } else BAIL_OUT; break; case 'F': if (!env) env = getenv(XCONFENV); if (env && !xf86pathIsAbsolute(env)) { APPEND_STR(env); if (envUsed) *envUsed = 1; } else BAIL_OUT; break; case 'G': if (!env) env = getenv(XCONFENV); if (env && xf86pathIsSafe(env)) { APPEND_STR(env); if (envUsed) *envUsed = 1; } else BAIL_OUT; break; case 'P': if (projroot && xf86pathIsAbsolute(projroot)) APPEND_STR(projroot); else BAIL_OUT; break; case 'C': APPEND_STR(SYSCONFDIR); break; case 'D': APPEND_STR(DATADIR); break; case '%': result[l++] = '%'; CHECK_LENGTH; break; default: fprintf(stderr, "invalid escape %%%c found in path template\n", template[i]); BAIL_OUT; break; } } } #ifdef DEBUG fprintf(stderr, "Converted `%s' to `%s'\n", template, result); #endif return result; } /* * Given some searching parameters, locate and open the xorg config file. */ static char * OpenConfigFile(const char *path, const char *cmdline, const char *projroot, const char *confname) { char *filepath = NULL; char *pathcopy; const char *template; int cmdlineUsed = 0; FILE *file = NULL; pathcopy = strdup(path); for (template = strtok(pathcopy, ","); template && !file; template = strtok(NULL, ",")) { filepath = DoSubstitution(template, cmdline, projroot, &cmdlineUsed, NULL, confname); if (!filepath) continue; if (cmdline && !cmdlineUsed) { free(filepath); filepath = NULL; continue; } file = fopen(filepath, "r"); if (!file) { free(filepath); filepath = NULL; } } free(pathcopy); if (file) { configFiles[numFiles].file = file; configFiles[numFiles].path = strdup(filepath); numFiles++; } return filepath; } /* * Match non-hidden files in the xorg config directory with a .conf * suffix. This filter is passed to scandir(3). */ static int ConfigFilter(const struct dirent *de) { const char *name = de->d_name; size_t len; size_t suflen = strlen(XCONFIGSUFFIX); if (!name || name[0] == '.') return 0; len = strlen(name); if (len <= suflen) return 0; if (strcmp(&name[len - suflen], XCONFIGSUFFIX) != 0) return 0; return 1; } static Bool AddConfigDirFiles(const char *dirpath, struct dirent **list, int num) { int i; Bool openedFile = FALSE; Bool warnOnce = FALSE; for (i = 0; i < num; i++) { char *path; FILE *file; if (numFiles >= CONFIG_MAX_FILES) { if (!warnOnce) { ErrorF("Maximum number of configuration " "files opened\n"); warnOnce = TRUE; } continue; } path = malloc(PATH_MAX + 1); snprintf(path, PATH_MAX + 1, "%s/%s", dirpath, list[i]->d_name); file = fopen(path, "r"); if (!file) { free(path); continue; } openedFile = TRUE; configFiles[numFiles].file = file; configFiles[numFiles].path = path; numFiles++; } return openedFile; } /* * Given some searching parameters, locate and open the xorg config * directory. The directory does not need to contain config files. */ static char * OpenConfigDir(const char *path, const char *cmdline, const char *projroot, const char *confname) { char *dirpath = NULL, *pathcopy; const char *template; Bool found = FALSE; int cmdlineUsed = 0; pathcopy = strdup(path); for (template = strtok(pathcopy, ","); template && !found; template = strtok(NULL, ",")) { struct dirent **list = NULL; int num; dirpath = DoSubstitution(template, cmdline, projroot, &cmdlineUsed, NULL, confname); if (!dirpath) continue; if (cmdline && !cmdlineUsed) { free(dirpath); dirpath = NULL; continue; } /* match files named *.conf */ num = scandir(dirpath, &list, ConfigFilter, alphasort); if (num < 0) { list = NULL; num = 0; } found = AddConfigDirFiles(dirpath, list, num); if (!found) { free(dirpath); dirpath = NULL; } while (num--) free(list[num]); free(list); } free(pathcopy); return dirpath; } /* * xf86initConfigFiles -- Setup global variables and buffers. */ void xf86initConfigFiles(void) { curFileIndex = 0; configPos = 0; configLineNo = 0; pushToken = LOCK_TOKEN; configBuf = malloc(CONFIG_BUF_LEN); configRBuf = malloc(CONFIG_BUF_LEN); configBuf[0] = '\0'; /* sanity ... */ } /* * xf86openConfigFile -- * * This function take a config file search path (optional), a command-line * specified file name (optional) and the ProjectRoot path (optional) and * locates and opens a config file based on that information. If a * command-line file name is specified, then this function fails if none * of the located files. * * The return value is a pointer to the actual name of the file that was * opened. When no file is found, the return value is NULL. The caller should * free() the returned value. * * The escape sequences allowed in the search path are defined above. * */ #ifndef DEFAULT_CONF_PATH #define DEFAULT_CONF_PATH "/etc/X11/%S," \ "%P/etc/X11/%S," \ "/etc/X11/%G," \ "%P/etc/X11/%G," \ "/etc/X11/%X-%M," \ "/etc/X11/%X," \ "/etc/%X," \ "%P/etc/X11/%X.%H," \ "%P/etc/X11/%X-%M," \ "%P/etc/X11/%X," \ "%P/lib/X11/%X.%H," \ "%P/lib/X11/%X-%M," \ "%P/lib/X11/%X" #endif char * xf86openConfigFile(const char *path, const char *cmdline, const char *projroot) { if (!path || !path[0]) path = DEFAULT_CONF_PATH; if (!projroot || !projroot[0]) projroot = PROJECTROOT; /* Search for a config file */ return OpenConfigFile(path, cmdline, projroot, XCONFIGFILE); } /* * xf86openConfigDirFiles -- * * This function take a config directory search path (optional), a * command-line specified directory name (optional) and the ProjectRoot path * (optional) and locates and opens a config directory based on that * information. If a command-line name is specified, then this function * fails if it is not found. * * The return value is a pointer to the actual name of the direcoty that was * opened. When no directory is found, the return value is NULL. The caller * should free() the returned value. * * The escape sequences allowed in the search path are defined above. * */ char * xf86openConfigDirFiles(const char *path, const char *cmdline, const char *projroot) { if (!path || !path[0]) path = DEFAULT_CONF_PATH; if (!projroot || !projroot[0]) projroot = PROJECTROOT; /* Search for the multiconf directory */ return OpenConfigDir(path, cmdline, projroot, XCONFIGDIR); } void xf86closeConfigFile(void) { int i; free(configRBuf); configRBuf = NULL; free(configBuf); configBuf = NULL; if (numFiles == 0) { builtinConfig = NULL; builtinIndex = 0; } for (i = 0; i < numFiles; i++) { fclose(configFiles[i].file); configFiles[i].file = NULL; free(configFiles[i].path); configFiles[i].path = NULL; } numFiles = 0; } void xf86setBuiltinConfig(const char *config[]) { builtinConfig = config; } void xf86parseError(const char *format, ...) { va_list ap; const char *filename = numFiles ? configFiles[curFileIndex].path : ""; ErrorF("Parse error on line %d of section %s in file %s\n\t", configLineNo, configSection, filename); va_start(ap, format); VErrorF(format, ap); va_end(ap); ErrorF("\n"); } void xf86validationError(const char *format, ...) { va_list ap; const char *filename = numFiles ? configFiles[curFileIndex].path : ""; ErrorF("Data incomplete in file %s\n\t", filename); va_start(ap, format); VErrorF(format, ap); va_end(ap); ErrorF("\n"); } void xf86setSection(const char *section) { free(configSection); configSection = strdup(section); } /* * xf86getToken -- * Lookup a string if it is actually a token in disguise. */ int xf86getStringToken(xf86ConfigSymTabRec * tab) { return StringToToken(xf86_lex_val.str, tab); } static int StringToToken(const char *str, xf86ConfigSymTabRec * tab) { int i; for (i = 0; tab[i].token != -1; i++) { if (!xf86nameCompare(tab[i].name, str)) return tab[i].token; } return ERROR_TOKEN; } /* * Compare two names. The characters '_', ' ', and '\t' are ignored * in the comparison. */ int xf86nameCompare(const char *s1, const char *s2) { char c1, c2; if (!s1 || *s1 == 0) { if (!s2 || *s2 == 0) return 0; else return 1; } while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') s1++; while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') s2++; c1 = (isupper(*s1) ? tolower(*s1) : *s1); c2 = (isupper(*s2) ? tolower(*s2) : *s2); while (c1 == c2) { if (c1 == '\0') return 0; s1++; s2++; while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') s1++; while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') s2++; c1 = (isupper(*s1) ? tolower(*s1) : *s1); c2 = (isupper(*s2) ? tolower(*s2) : *s2); } return c1 - c2; } char * xf86addComment(char *cur, const char *add) { char *str; const char *cstr; int len, curlen, iscomment, hasnewline = 0, insnewline, endnewline; if (add == NULL || add[0] == '\0') return cur; if (cur) { curlen = strlen(cur); if (curlen) hasnewline = cur[curlen - 1] == '\n'; eol_seen = 0; } else curlen = 0; cstr = add; iscomment = 0; while (*cstr) { if (*cstr != ' ' && *cstr != '\t') break; ++cstr; } iscomment = (*cstr == '#'); len = strlen(add); endnewline = add[len - 1] == '\n'; insnewline = eol_seen || (curlen && !hasnewline); if (insnewline) len++; if (!iscomment) len++; if (!endnewline) len++; /* Allocate + 1 char for '\0' terminator. */ str = realloc(cur, curlen + len + 1); if (!str) return cur; cur = str; if (insnewline) cur[curlen++] = '\n'; if (!iscomment) cur[curlen++] = '#'; strcpy(cur + curlen, add); if (!endnewline) strcat(cur, "\n"); return cur; } Bool xf86getBoolValue(Bool *val, const char *str) { if (!val || !str) return FALSE; if (*str == '\0') { *val = TRUE; } else { if (xf86nameCompare(str, "1") == 0) *val = TRUE; else if (xf86nameCompare(str, "on") == 0) *val = TRUE; else if (xf86nameCompare(str, "true") == 0) *val = TRUE; else if (xf86nameCompare(str, "yes") == 0) *val = TRUE; else if (xf86nameCompare(str, "0") == 0) *val = FALSE; else if (xf86nameCompare(str, "off") == 0) *val = FALSE; else if (xf86nameCompare(str, "false") == 0) *val = FALSE; else if (xf86nameCompare(str, "no") == 0) *val = FALSE; else return FALSE; } return TRUE; } xorg-server-1.17.1/hw/xfree86/parser/Configint.h0000664000175100017510000001735112456571574016332 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * Copyright (c) 1997-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * These definitions are used through out the configuration file parser, but * they should not be visible outside of the parser. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _Configint_h_ #define _Configint_h_ #include #include #include #include #include "xf86Parser.h" typedef enum { PARSE_DECIMAL, PARSE_OCTAL, PARSE_HEX } ParserNumType; typedef struct { int num; /* returned number */ char *str; /* private copy of the return-string */ double realnum; /* returned number as a real */ ParserNumType numType; /* used to enforce correct number formatting */ } LexRec, *LexPtr; extern LexRec xf86_lex_val; #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #include "configProcs.h" #include #define TestFree(a) if (a) { free ((void *) a); a = NULL; } #define parsePrologue(typeptr,typerec) typeptr ptr; \ if( (ptr=calloc(1,sizeof(typerec))) == NULL ) { return NULL; } #define HANDLE_RETURN(f,func)\ if ((ptr->f=func) == NULL)\ {\ CLEANUP (ptr);\ return NULL;\ } #define HANDLE_LIST(field,func,type)\ {\ type p = func ();\ if (p == NULL)\ {\ CLEANUP (ptr);\ return NULL;\ }\ else\ {\ ptr->field = (type) xf86addListItem ((glp) ptr->field, (glp) p);\ }\ } #define Error(...) do { \ xf86parseError (__VA_ARGS__); CLEANUP (ptr); return NULL; \ } while (0) /* * These are defines for error messages to promote consistency. * error messages are preceded by the line number, section and file name, * so these messages should be about the specific keyword and syntax in error. * To help limit namespace polution, end each with _MSG. * limit messages to 70 characters if possible. */ #define BAD_OPTION_MSG \ "The Option keyword requires 1 or 2 quoted strings to follow it." #define INVALID_KEYWORD_MSG \ "\"%s\" is not a valid keyword in this section." #define INVALID_SECTION_MSG \ "\"%s\" is not a valid section name." #define UNEXPECTED_EOF_MSG \ "Unexpected EOF. Missing EndSection keyword?" #define QUOTE_MSG \ "The %s keyword requires a quoted string to follow it." #define NUMBER_MSG \ "The %s keyword requires a number to follow it." #define POSITIVE_INT_MSG \ "The %s keyword requires a positive integer to follow it." #define BOOL_MSG \ "The %s keyword requires a boolean to follow it." #define ZAXISMAPPING_MSG \ "The ZAxisMapping keyword requires 2 positive numbers or X or Y to follow it." #define DACSPEED_MSG \ "The DacSpeed keyword must be followed by a list of up to %d numbers." #define DISPLAYSIZE_MSG \ "The DisplaySize keyword must be followed by the width and height in mm." #define HORIZSYNC_MSG \ "The HorizSync keyword must be followed by a list of numbers or ranges." #define VERTREFRESH_MSG \ "The VertRefresh keyword must be followed by a list of numbers or ranges." #define VIEWPORT_MSG \ "The Viewport keyword must be followed by an X and Y value." #define VIRTUAL_MSG \ "The Virtual keyword must be followed by a width and height value." #define WEIGHT_MSG \ "The Weight keyword must be followed by red, green and blue values." #define BLACK_MSG \ "The Black keyword must be followed by red, green and blue values." #define WHITE_MSG \ "The White keyword must be followed by red, green and blue values." #define SCREEN_MSG \ "The Screen keyword must be followed by an optional number, a screen name\n" \ "\tin quotes, and optional position/layout information." #define INVALID_SCR_MSG \ "Invalid Screen line." #define INPUTDEV_MSG \ "The InputDevice keyword must be followed by an input device name in quotes." #define INACTIVE_MSG \ "The Inactive keyword must be followed by a Device name in quotes." #define UNDEFINED_SCREEN_MSG \ "Undefined Screen \"%s\" referenced by ServerLayout \"%s\"." #define UNDEFINED_MODES_MSG \ "Undefined Modes Section \"%s\" referenced by Monitor \"%s\"." #define UNDEFINED_DEVICE_MSG \ "Undefined Device \"%s\" referenced by Screen \"%s\"." #define UNDEFINED_ADAPTOR_MSG \ "Undefined VideoAdaptor \"%s\" referenced by Screen \"%s\"." #define ADAPTOR_REF_TWICE_MSG \ "VideoAdaptor \"%s\" already referenced by Screen \"%s\"." #define UNDEFINED_DEVICE_LAY_MSG \ "Undefined Device \"%s\" referenced by ServerLayout \"%s\"." #define UNDEFINED_INPUT_MSG \ "Undefined InputDevice \"%s\" referenced by ServerLayout \"%s\"." #define NO_IDENT_MSG \ "This section must have an Identifier line." #define ONLY_ONE_MSG \ "This section must have only one of either %s line." #define UNDEFINED_INPUTDRIVER_MSG \ "InputDevice section \"%s\" must have a Driver line." #define INVALID_GAMMA_MSG \ "gamma correction value(s) expected\n either one value or three r/g/b values." #define GROUP_MSG \ "The Group keyword must be followed by either a group name in quotes or\n" \ "\ta numerical group id." #define MULTIPLE_MSG \ "Multiple \"%s\" lines." #define MUST_BE_OCTAL_MSG \ "The number \"%d\" given in this section must be in octal (0xxx) format." /* Warning messages */ #define OBSOLETE_MSG \ "Ignoring obsolete keyword \"%s\"." #endif /* _Configint_h_ */ xorg-server-1.17.1/hw/xfree86/parser/xf86Optrec.h0000664000175100017510000001071412456571574016356 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * Copyright (c) 1997-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file contains the Option Record that is passed between the Parser, * and Module setup procs. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _xf86Optrec_h_ #define _xf86Optrec_h_ #include #include #include "xf86Optionstr.h" #include extern _X_EXPORT XF86OptionPtr xf86addNewOption(XF86OptionPtr head, char *name, char *val); extern _X_EXPORT XF86OptionPtr xf86optionListDup(XF86OptionPtr opt); extern _X_EXPORT void xf86optionListFree(XF86OptionPtr opt); extern _X_EXPORT char *xf86optionName(XF86OptionPtr opt); extern _X_EXPORT char *xf86optionValue(XF86OptionPtr opt); extern _X_EXPORT XF86OptionPtr xf86newOption(char *name, char *value); extern _X_EXPORT XF86OptionPtr xf86nextOption(XF86OptionPtr list); extern _X_EXPORT XF86OptionPtr xf86findOption(XF86OptionPtr list, const char *name); extern _X_EXPORT const char *xf86findOptionValue(XF86OptionPtr list, const char *name); extern _X_EXPORT XF86OptionPtr xf86optionListCreate(const char **options, int count, int used); extern _X_EXPORT XF86OptionPtr xf86optionListMerge(XF86OptionPtr head, XF86OptionPtr tail); extern _X_EXPORT int xf86nameCompare(const char *s1, const char *s2); extern _X_EXPORT char *xf86uLongToString(unsigned long i); extern _X_EXPORT XF86OptionPtr xf86parseOption(XF86OptionPtr head); extern _X_EXPORT void xf86printOptionList(FILE * fp, XF86OptionPtr list, int tabs); #endif /* _xf86Optrec_h_ */ xorg-server-1.17.1/hw/xfree86/parser/Flags.c0000664000175100017510000003244012456571574015435 00000000000000/* * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" #include #include "Xprintf.h" #include "optionstr.h" static xf86ConfigSymTabRec ServerFlagsTab[] = { {ENDSECTION, "endsection"}, {NOTRAPSIGNALS, "notrapsignals"}, {DONTZAP, "dontzap"}, {DONTZOOM, "dontzoom"}, {DISABLEVIDMODE, "disablevidmodeextension"}, {ALLOWNONLOCAL, "allownonlocalxvidtune"}, {DISABLEMODINDEV, "disablemodindev"}, {MODINDEVALLOWNONLOCAL, "allownonlocalmodindev"}, {ALLOWMOUSEOPENFAIL, "allowmouseopenfail"}, {OPTION, "option"}, {BLANKTIME, "blanktime"}, {STANDBYTIME, "standbytime"}, {SUSPENDTIME, "suspendtime"}, {OFFTIME, "offtime"}, {DEFAULTLAYOUT, "defaultserverlayout"}, {-1, ""}, }; #define CLEANUP xf86freeFlags XF86ConfFlagsPtr xf86parseFlagsSection(void) { int token; parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec) while ((token = xf86getToken(ServerFlagsTab)) != ENDSECTION) { int hasvalue = FALSE; int strvalue = FALSE; int tokentype; switch (token) { case COMMENT: ptr->flg_comment = xf86addComment(ptr->flg_comment, xf86_lex_val.str); break; /* * these old keywords are turned into standard generic options. * we fall through here on purpose */ case DEFAULTLAYOUT: strvalue = TRUE; case BLANKTIME: case STANDBYTIME: case SUSPENDTIME: case OFFTIME: hasvalue = TRUE; case NOTRAPSIGNALS: case DONTZAP: case DONTZOOM: case DISABLEVIDMODE: case ALLOWNONLOCAL: case DISABLEMODINDEV: case MODINDEVALLOWNONLOCAL: case ALLOWMOUSEOPENFAIL: { int i = 0; while (ServerFlagsTab[i].token != -1) { char *tmp; if (ServerFlagsTab[i].token == token) { char *valstr = NULL; tmp = strdup(ServerFlagsTab[i].name); if (hasvalue) { tokentype = xf86getSubToken(&(ptr->flg_comment)); if (strvalue) { if (tokentype != STRING) Error(QUOTE_MSG, tmp); valstr = xf86_lex_val.str; } else { if (tokentype != NUMBER) Error(NUMBER_MSG, tmp); if (asprintf(&valstr, "%d", xf86_lex_val.num) == -1) valstr = NULL; } } ptr->flg_option_lst = xf86addNewOption (ptr->flg_option_lst, tmp, valstr); } i++; } } break; case OPTION: ptr->flg_option_lst = xf86parseOption(ptr->flg_option_lst); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG printf("Flags section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printServerFlagsSection(FILE * f, XF86ConfFlagsPtr flags) { XF86OptionPtr p; if ((!flags) || (!flags->flg_option_lst)) return; p = flags->flg_option_lst; fprintf(f, "Section \"ServerFlags\"\n"); if (flags->flg_comment) fprintf(f, "%s", flags->flg_comment); xf86printOptionList(f, p, 1); fprintf(f, "EndSection\n\n"); } static XF86OptionPtr addNewOption2(XF86OptionPtr head, char *name, char *_val, int used) { XF86OptionPtr new, old = NULL; /* Don't allow duplicates, free old strings */ if (head != NULL && (old = xf86findOption(head, name)) != NULL) { new = old; free(new->opt_name); free(new->opt_val); } else new = calloc(1, sizeof(*new)); new->opt_name = name; new->opt_val = _val; new->opt_used = used; if (old) return head; return ((XF86OptionPtr) xf86addListItem((glp) head, (glp) new)); } XF86OptionPtr xf86addNewOption(XF86OptionPtr head, char *name, char *_val) { return addNewOption2(head, name, _val, 0); } void xf86freeFlags(XF86ConfFlagsPtr flags) { if (flags == NULL) return; xf86optionListFree(flags->flg_option_lst); TestFree(flags->flg_comment); free(flags); } XF86OptionPtr xf86optionListDup(XF86OptionPtr opt) { XF86OptionPtr newopt = NULL; char *_val; while (opt) { _val = opt->opt_val ? strdup(opt->opt_val) : NULL; newopt = xf86addNewOption(newopt, strdup(opt->opt_name), _val); newopt->opt_used = opt->opt_used; if (opt->opt_comment) newopt->opt_comment = strdup(opt->opt_comment); opt = opt->list.next; } return newopt; } void xf86optionListFree(XF86OptionPtr opt) { XF86OptionPtr prev; while (opt) { TestFree(opt->opt_name); TestFree(opt->opt_val); TestFree(opt->opt_comment); prev = opt; opt = opt->list.next; free(prev); } } char * xf86optionName(XF86OptionPtr opt) { if (opt) return opt->opt_name; return 0; } char * xf86optionValue(XF86OptionPtr opt) { if (opt) return opt->opt_val; return 0; } XF86OptionPtr xf86newOption(char *name, char *value) { XF86OptionPtr opt; opt = calloc(1, sizeof(*opt)); if (!opt) return NULL; opt->opt_used = 0; opt->list.next = 0; opt->opt_name = name; opt->opt_val = value; return opt; } XF86OptionPtr xf86nextOption(XF86OptionPtr list) { if (!list) return NULL; return list->list.next; } /* * this function searches the given option list for the named option and * returns a pointer to the option rec if found. If not found, it returns * NULL */ XF86OptionPtr xf86findOption(XF86OptionPtr list, const char *name) { while (list) { if (xf86nameCompare(list->opt_name, name) == 0) return list; list = list->list.next; } return NULL; } /* * this function searches the given option list for the named option. If * found and the option has a parameter, a pointer to the parameter is * returned. If the option does not have a parameter an empty string is * returned. If the option is not found, a NULL is returned. */ const char * xf86findOptionValue(XF86OptionPtr list, const char *name) { XF86OptionPtr p = xf86findOption(list, name); if (p) { if (p->opt_val) return p->opt_val; else return ""; } return NULL; } XF86OptionPtr xf86optionListCreate(const char **options, int count, int used) { XF86OptionPtr p = NULL; char *t1, *t2; int i; if (count == -1) { for (count = 0; options[count]; count++); } if ((count % 2) != 0) { fprintf(stderr, "xf86optionListCreate: count must be an even number.\n"); return NULL; } for (i = 0; i < count; i += 2) { t1 = strdup(options[i]); t2 = strdup(options[i + 1]); p = addNewOption2(p, t1, t2, used); } return p; } /* the 2 given lists are merged. If an option with the same name is present in * both, the option from the user list - specified in the second argument - * is used. The end result is a single valid list of options. Duplicates * are freed, and the original lists are no longer guaranteed to be complete. */ XF86OptionPtr xf86optionListMerge(XF86OptionPtr head, XF86OptionPtr tail) { XF86OptionPtr a, b, ap = NULL, bp = NULL; a = tail; b = head; while (tail && b) { if (xf86nameCompare(a->opt_name, b->opt_name) == 0) { if (b == head) head = a; else bp->list.next = a; if (a == tail) tail = a->list.next; else ap->list.next = a->list.next; a->list.next = b->list.next; b->list.next = NULL; xf86optionListFree(b); b = a->list.next; bp = a; a = tail; ap = NULL; } else { ap = a; if (!(a = a->list.next)) { a = tail; bp = b; b = b->list.next; ap = NULL; } } } if (head) { for (a = head; a->list.next; a = a->list.next); a->list.next = tail; } else head = tail; return head; } char * xf86uLongToString(unsigned long i) { char *s; if (asprintf(&s, "%lu", i) == -1) return NULL; return s; } XF86OptionPtr xf86parseOption(XF86OptionPtr head) { XF86OptionPtr option, cnew, old; char *name, *comment = NULL; int token; if ((token = xf86getSubToken(&comment)) != STRING) { xf86parseError(BAD_OPTION_MSG); free(comment); return head; } name = xf86_lex_val.str; if ((token = xf86getSubToken(&comment)) == STRING) { option = xf86newOption(name, xf86_lex_val.str); option->opt_comment = comment; if ((token = xf86getToken(NULL)) == COMMENT) option->opt_comment = xf86addComment(option->opt_comment, xf86_lex_val.str); else xf86unGetToken(token); } else { option = xf86newOption(name, NULL); option->opt_comment = comment; if (token == COMMENT) option->opt_comment = xf86addComment(option->opt_comment, xf86_lex_val.str); else xf86unGetToken(token); } old = NULL; /* Don't allow duplicates */ if (head != NULL && (old = xf86findOption(head, name)) != NULL) { cnew = old; free(option->opt_name); TestFree(option->opt_val); TestFree(option->opt_comment); free(option); } else cnew = option; if (old == NULL) return ((XF86OptionPtr) xf86addListItem((glp) head, (glp) cnew)); return head; } void xf86printOptionList(FILE * fp, XF86OptionPtr list, int tabs) { int i; if (!list) return; while (list) { for (i = 0; i < tabs; i++) fputc('\t', fp); if (list->opt_val) fprintf(fp, "Option \"%s\" \"%s\"", list->opt_name, list->opt_val); else fprintf(fp, "Option \"%s\"", list->opt_name); if (list->opt_comment) fprintf(fp, "%s", list->opt_comment); else fputc('\n', fp); list = list->list.next; } } xorg-server-1.17.1/hw/xfree86/parser/Monitor.c0000664000175100017510000007210012456571574016025 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec MonitorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, {MODEL, "modelname"}, {USEMODES, "usemodes"}, {MODELINE, "modeline"}, {DISPLAYSIZE, "displaysize"}, {HORIZSYNC, "horizsync"}, {VERTREFRESH, "vertrefresh"}, {MODE, "mode"}, {GAMMA, "gamma"}, {OPTION, "option"}, {-1, ""}, }; static xf86ConfigSymTabRec ModesTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {MODELINE, "modeline"}, {MODE, "mode"}, {-1, ""}, }; static xf86ConfigSymTabRec TimingTab[] = { {TT_INTERLACE, "interlace"}, {TT_PHSYNC, "+hsync"}, {TT_NHSYNC, "-hsync"}, {TT_PVSYNC, "+vsync"}, {TT_NVSYNC, "-vsync"}, {TT_CSYNC, "composite"}, {TT_PCSYNC, "+csync"}, {TT_NCSYNC, "-csync"}, {TT_DBLSCAN, "doublescan"}, {TT_HSKEW, "hskew"}, {TT_BCAST, "bcast"}, {TT_VSCAN, "vscan"}, {-1, ""}, }; static xf86ConfigSymTabRec ModeTab[] = { {DOTCLOCK, "dotclock"}, {HTIMINGS, "htimings"}, {VTIMINGS, "vtimings"}, {FLAGS, "flags"}, {HSKEW, "hskew"}, {BCAST, "bcast"}, {VSCAN, "vscan"}, {ENDMODE, "endmode"}, {-1, ""}, }; #define CLEANUP xf86freeModeLineList static void xf86freeModeLineList(XF86ConfModeLinePtr ptr) { XF86ConfModeLinePtr prev; while (ptr) { TestFree(ptr->ml_identifier); TestFree(ptr->ml_comment); prev = ptr; ptr = ptr->list.next; free(prev); } } static XF86ConfModeLinePtr xf86parseModeLine(void) { int token; parsePrologue(XF86ConfModeLinePtr, XF86ConfModeLineRec) /* Identifier */ if (xf86getSubToken(&(ptr->ml_comment)) != STRING) Error("ModeLine identifier expected"); ptr->ml_identifier = xf86_lex_val.str; /* DotClock */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine dotclock expected"); ptr->ml_clock = (int) (xf86_lex_val.realnum * 1000.0 + 0.5); /* HDisplay */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine Hdisplay expected"); ptr->ml_hdisplay = xf86_lex_val.num; /* HSyncStart */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine HSyncStart expected"); ptr->ml_hsyncstart = xf86_lex_val.num; /* HSyncEnd */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine HSyncEnd expected"); ptr->ml_hsyncend = xf86_lex_val.num; /* HTotal */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine HTotal expected"); ptr->ml_htotal = xf86_lex_val.num; /* VDisplay */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine Vdisplay expected"); ptr->ml_vdisplay = xf86_lex_val.num; /* VSyncStart */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine VSyncStart expected"); ptr->ml_vsyncstart = xf86_lex_val.num; /* VSyncEnd */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine VSyncEnd expected"); ptr->ml_vsyncend = xf86_lex_val.num; /* VTotal */ if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("ModeLine VTotal expected"); ptr->ml_vtotal = xf86_lex_val.num; token = xf86getSubTokenWithTab(&(ptr->ml_comment), TimingTab); while ((token == TT_INTERLACE) || (token == TT_PHSYNC) || (token == TT_NHSYNC) || (token == TT_PVSYNC) || (token == TT_NVSYNC) || (token == TT_CSYNC) || (token == TT_PCSYNC) || (token == TT_NCSYNC) || (token == TT_DBLSCAN) || (token == TT_HSKEW) || (token == TT_VSCAN) || (token == TT_BCAST)) { switch (token) { case TT_INTERLACE: ptr->ml_flags |= XF86CONF_INTERLACE; break; case TT_PHSYNC: ptr->ml_flags |= XF86CONF_PHSYNC; break; case TT_NHSYNC: ptr->ml_flags |= XF86CONF_NHSYNC; break; case TT_PVSYNC: ptr->ml_flags |= XF86CONF_PVSYNC; break; case TT_NVSYNC: ptr->ml_flags |= XF86CONF_NVSYNC; break; case TT_CSYNC: ptr->ml_flags |= XF86CONF_CSYNC; break; case TT_PCSYNC: ptr->ml_flags |= XF86CONF_PCSYNC; break; case TT_NCSYNC: ptr->ml_flags |= XF86CONF_NCSYNC; break; case TT_DBLSCAN: ptr->ml_flags |= XF86CONF_DBLSCAN; break; case TT_HSKEW: if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error(NUMBER_MSG, "Hskew"); ptr->ml_hskew = xf86_lex_val.num; ptr->ml_flags |= XF86CONF_HSKEW; break; case TT_BCAST: ptr->ml_flags |= XF86CONF_BCAST; break; case TT_VSCAN: if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error(NUMBER_MSG, "Vscan"); ptr->ml_vscan = xf86_lex_val.num; ptr->ml_flags |= XF86CONF_VSCAN; break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } token = xf86getSubTokenWithTab(&(ptr->ml_comment), TimingTab); } xf86unGetToken(token); #ifdef DEBUG printf("ModeLine parsed\n"); #endif return ptr; } static XF86ConfModeLinePtr xf86parseVerboseMode(void) { int token, token2; int had_dotclock = 0, had_htimings = 0, had_vtimings = 0; parsePrologue(XF86ConfModeLinePtr, XF86ConfModeLineRec) if (xf86getSubToken(&(ptr->ml_comment)) != STRING) Error("Mode name expected"); ptr->ml_identifier = xf86_lex_val.str; while ((token = xf86getToken(ModeTab)) != ENDMODE) { switch (token) { case COMMENT: ptr->ml_comment = xf86addComment(ptr->ml_comment, xf86_lex_val.str); break; case DOTCLOCK: if ((token = xf86getSubToken(&(ptr->ml_comment))) != NUMBER) Error(NUMBER_MSG, "DotClock"); ptr->ml_clock = (int) (xf86_lex_val.realnum * 1000.0 + 0.5); had_dotclock = 1; break; case HTIMINGS: if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_hdisplay = xf86_lex_val.num; else Error("Horizontal display expected"); if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_hsyncstart = xf86_lex_val.num; else Error("Horizontal sync start expected"); if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_hsyncend = xf86_lex_val.num; else Error("Horizontal sync end expected"); if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_htotal = xf86_lex_val.num; else Error("Horizontal total expected"); had_htimings = 1; break; case VTIMINGS: if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_vdisplay = xf86_lex_val.num; else Error("Vertical display expected"); if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_vsyncstart = xf86_lex_val.num; else Error("Vertical sync start expected"); if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_vsyncend = xf86_lex_val.num; else Error("Vertical sync end expected"); if (xf86getSubToken(&(ptr->ml_comment)) == NUMBER) ptr->ml_vtotal = xf86_lex_val.num; else Error("Vertical total expected"); had_vtimings = 1; break; case FLAGS: token = xf86getSubToken(&(ptr->ml_comment)); if (token != STRING) Error(QUOTE_MSG, "Flags"); while (token == STRING) { token2 = xf86getStringToken(TimingTab); switch (token2) { case TT_INTERLACE: ptr->ml_flags |= XF86CONF_INTERLACE; break; case TT_PHSYNC: ptr->ml_flags |= XF86CONF_PHSYNC; break; case TT_NHSYNC: ptr->ml_flags |= XF86CONF_NHSYNC; break; case TT_PVSYNC: ptr->ml_flags |= XF86CONF_PVSYNC; break; case TT_NVSYNC: ptr->ml_flags |= XF86CONF_NVSYNC; break; case TT_CSYNC: ptr->ml_flags |= XF86CONF_CSYNC; break; case TT_PCSYNC: ptr->ml_flags |= XF86CONF_PCSYNC; break; case TT_NCSYNC: ptr->ml_flags |= XF86CONF_NCSYNC; break; case TT_DBLSCAN: ptr->ml_flags |= XF86CONF_DBLSCAN; break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error("Unknown flag string"); break; } token = xf86getSubToken(&(ptr->ml_comment)); } xf86unGetToken(token); break; case HSKEW: if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("Horizontal skew expected"); ptr->ml_flags |= XF86CONF_HSKEW; ptr->ml_hskew = xf86_lex_val.num; break; case VSCAN: if (xf86getSubToken(&(ptr->ml_comment)) != NUMBER) Error("Vertical scan count expected"); ptr->ml_flags |= XF86CONF_VSCAN; ptr->ml_vscan = xf86_lex_val.num; break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error("Unexepcted token in verbose \"Mode\" entry\n"); } } if (!had_dotclock) Error("the dotclock is missing"); if (!had_htimings) Error("the horizontal timings are missing"); if (!had_vtimings) Error("the vertical timings are missing"); #ifdef DEBUG printf("Verbose Mode parsed\n"); #endif return ptr; } #undef CLEANUP #define CLEANUP xf86freeMonitorList XF86ConfMonitorPtr xf86parseMonitorSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec) while ((token = xf86getToken(MonitorTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->mon_comment = xf86addComment(ptr->mon_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->mon_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->mon_identifier = xf86_lex_val.str; has_ident = TRUE; break; case VENDOR: if (xf86getSubToken(&(ptr->mon_comment)) != STRING) Error(QUOTE_MSG, "Vendor"); ptr->mon_vendor = xf86_lex_val.str; break; case MODEL: if (xf86getSubToken(&(ptr->mon_comment)) != STRING) Error(QUOTE_MSG, "ModelName"); ptr->mon_modelname = xf86_lex_val.str; break; case MODE: HANDLE_LIST(mon_modeline_lst, xf86parseVerboseMode, XF86ConfModeLinePtr); break; case MODELINE: HANDLE_LIST(mon_modeline_lst, xf86parseModeLine, XF86ConfModeLinePtr); break; case DISPLAYSIZE: if (xf86getSubToken(&(ptr->mon_comment)) != NUMBER) Error(DISPLAYSIZE_MSG); ptr->mon_width = xf86_lex_val.realnum; if (xf86getSubToken(&(ptr->mon_comment)) != NUMBER) Error(DISPLAYSIZE_MSG); ptr->mon_height = xf86_lex_val.realnum; break; case HORIZSYNC: if (xf86getSubToken(&(ptr->mon_comment)) != NUMBER) Error(HORIZSYNC_MSG); do { if (ptr->mon_n_hsync >= CONF_MAX_HSYNC) Error("Sorry. Too many horizontal sync intervals."); ptr->mon_hsync[ptr->mon_n_hsync].lo = xf86_lex_val.realnum; switch (token = xf86getSubToken(&(ptr->mon_comment))) { case COMMA: ptr->mon_hsync[ptr->mon_n_hsync].hi = ptr->mon_hsync[ptr->mon_n_hsync].lo; break; case DASH: if (xf86getSubToken(&(ptr->mon_comment)) != NUMBER || (float) xf86_lex_val.realnum < ptr->mon_hsync[ptr->mon_n_hsync].lo) Error(HORIZSYNC_MSG); ptr->mon_hsync[ptr->mon_n_hsync].hi = xf86_lex_val.realnum; if ((token = xf86getSubToken(&(ptr->mon_comment))) == COMMA) break; ptr->mon_n_hsync++; goto HorizDone; default: /* We cannot currently know if a '\n' was found, * or this is a real error */ ptr->mon_hsync[ptr->mon_n_hsync].hi = ptr->mon_hsync[ptr->mon_n_hsync].lo; ptr->mon_n_hsync++; goto HorizDone; } ptr->mon_n_hsync++; } while ((token = xf86getSubToken(&(ptr->mon_comment))) == NUMBER); HorizDone: xf86unGetToken(token); break; case VERTREFRESH: if (xf86getSubToken(&(ptr->mon_comment)) != NUMBER) Error(VERTREFRESH_MSG); do { ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo = xf86_lex_val.realnum; switch (token = xf86getSubToken(&(ptr->mon_comment))) { case COMMA: ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo; break; case DASH: if (xf86getSubToken(&(ptr->mon_comment)) != NUMBER || (float) xf86_lex_val.realnum < ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo) Error(VERTREFRESH_MSG); ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = xf86_lex_val.realnum; if ((token = xf86getSubToken(&(ptr->mon_comment))) == COMMA) break; ptr->mon_n_vrefresh++; goto VertDone; default: /* We cannot currently know if a '\n' was found, * or this is a real error */ ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo; ptr->mon_n_vrefresh++; goto VertDone; } if (ptr->mon_n_vrefresh >= CONF_MAX_VREFRESH) Error("Sorry. Too many vertical refresh intervals."); ptr->mon_n_vrefresh++; } while ((token = xf86getSubToken(&(ptr->mon_comment))) == NUMBER); VertDone: xf86unGetToken(token); break; case GAMMA: if (xf86getSubToken(&(ptr->mon_comment)) != NUMBER) { Error(INVALID_GAMMA_MSG); } else { ptr->mon_gamma_red = ptr->mon_gamma_green = ptr->mon_gamma_blue = xf86_lex_val.realnum; if (xf86getSubToken(&(ptr->mon_comment)) == NUMBER) { ptr->mon_gamma_green = xf86_lex_val.realnum; if (xf86getSubToken(&(ptr->mon_comment)) == NUMBER) { ptr->mon_gamma_blue = xf86_lex_val.realnum; } else { Error(INVALID_GAMMA_MSG); } } else xf86unGetToken(token); } break; case OPTION: ptr->mon_option_lst = xf86parseOption(ptr->mon_option_lst); break; case USEMODES: { XF86ConfModesLinkPtr mptr; if ((token = xf86getSubToken(&(ptr->mon_comment))) != STRING) Error(QUOTE_MSG, "UseModes"); /* add to the end of the list of modes sections referenced here */ mptr = calloc(1, sizeof(XF86ConfModesLinkRec)); mptr->list.next = NULL; mptr->ml_modes_str = xf86_lex_val.str; mptr->ml_modes = NULL; ptr->mon_modes_sect_lst = (XF86ConfModesLinkPtr) xf86addListItem((GenericListPtr) ptr->mon_modes_sect_lst, (GenericListPtr) mptr); } break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: xf86parseError(INVALID_KEYWORD_MSG, xf86tokenString()); CLEANUP(ptr); return NULL; break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("Monitor section parsed\n"); #endif return ptr; } #undef CLEANUP #define CLEANUP xf86freeModesList XF86ConfModesPtr xf86parseModesSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfModesPtr, XF86ConfModesRec) while ((token = xf86getToken(ModesTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->modes_comment = xf86addComment(ptr->modes_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->modes_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->modes_identifier = xf86_lex_val.str; has_ident = TRUE; break; case MODE: HANDLE_LIST(mon_modeline_lst, xf86parseVerboseMode, XF86ConfModeLinePtr); break; case MODELINE: HANDLE_LIST(mon_modeline_lst, xf86parseModeLine, XF86ConfModeLinePtr); break; default: xf86parseError(INVALID_KEYWORD_MSG, xf86tokenString()); CLEANUP(ptr); return NULL; break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("Modes section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printMonitorSection(FILE * cf, XF86ConfMonitorPtr ptr) { int i; XF86ConfModeLinePtr mlptr; XF86ConfModesLinkPtr mptr; while (ptr) { mptr = ptr->mon_modes_sect_lst; fprintf(cf, "Section \"Monitor\"\n"); if (ptr->mon_comment) fprintf(cf, "%s", ptr->mon_comment); if (ptr->mon_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->mon_identifier); if (ptr->mon_vendor) fprintf(cf, "\tVendorName \"%s\"\n", ptr->mon_vendor); if (ptr->mon_modelname) fprintf(cf, "\tModelName \"%s\"\n", ptr->mon_modelname); while (mptr) { fprintf(cf, "\tUseModes \"%s\"\n", mptr->ml_modes_str); mptr = mptr->list.next; } if (ptr->mon_width) fprintf(cf, "\tDisplaySize %d\t%d\n", ptr->mon_width, ptr->mon_height); for (i = 0; i < ptr->mon_n_hsync; i++) { fprintf(cf, "\tHorizSync %2.1f - %2.1f\n", ptr->mon_hsync[i].lo, ptr->mon_hsync[i].hi); } for (i = 0; i < ptr->mon_n_vrefresh; i++) { fprintf(cf, "\tVertRefresh %2.1f - %2.1f\n", ptr->mon_vrefresh[i].lo, ptr->mon_vrefresh[i].hi); } if (ptr->mon_gamma_red) { if (ptr->mon_gamma_red == ptr->mon_gamma_green && ptr->mon_gamma_red == ptr->mon_gamma_blue) { fprintf(cf, "\tGamma %.4g\n", ptr->mon_gamma_red); } else { fprintf(cf, "\tGamma %.4g %.4g %.4g\n", ptr->mon_gamma_red, ptr->mon_gamma_green, ptr->mon_gamma_blue); } } for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next) { fprintf(cf, "\tModeLine \"%s\" %2.1f ", mlptr->ml_identifier, mlptr->ml_clock / 1000.0); fprintf(cf, "%d %d %d %d %d %d %d %d", mlptr->ml_hdisplay, mlptr->ml_hsyncstart, mlptr->ml_hsyncend, mlptr->ml_htotal, mlptr->ml_vdisplay, mlptr->ml_vsyncstart, mlptr->ml_vsyncend, mlptr->ml_vtotal); if (mlptr->ml_flags & XF86CONF_PHSYNC) fprintf(cf, " +hsync"); if (mlptr->ml_flags & XF86CONF_NHSYNC) fprintf(cf, " -hsync"); if (mlptr->ml_flags & XF86CONF_PVSYNC) fprintf(cf, " +vsync"); if (mlptr->ml_flags & XF86CONF_NVSYNC) fprintf(cf, " -vsync"); if (mlptr->ml_flags & XF86CONF_INTERLACE) fprintf(cf, " interlace"); if (mlptr->ml_flags & XF86CONF_CSYNC) fprintf(cf, " composite"); if (mlptr->ml_flags & XF86CONF_PCSYNC) fprintf(cf, " +csync"); if (mlptr->ml_flags & XF86CONF_NCSYNC) fprintf(cf, " -csync"); if (mlptr->ml_flags & XF86CONF_DBLSCAN) fprintf(cf, " doublescan"); if (mlptr->ml_flags & XF86CONF_HSKEW) fprintf(cf, " hskew %d", mlptr->ml_hskew); if (mlptr->ml_flags & XF86CONF_BCAST) fprintf(cf, " bcast"); fprintf(cf, "\n"); } xf86printOptionList(cf, ptr->mon_option_lst, 1); fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86printModesSection(FILE * cf, XF86ConfModesPtr ptr) { XF86ConfModeLinePtr mlptr; while (ptr) { fprintf(cf, "Section \"Modes\"\n"); if (ptr->modes_comment) fprintf(cf, "%s", ptr->modes_comment); if (ptr->modes_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->modes_identifier); for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next) { fprintf(cf, "\tModeLine \"%s\" %2.1f ", mlptr->ml_identifier, mlptr->ml_clock / 1000.0); fprintf(cf, "%d %d %d %d %d %d %d %d", mlptr->ml_hdisplay, mlptr->ml_hsyncstart, mlptr->ml_hsyncend, mlptr->ml_htotal, mlptr->ml_vdisplay, mlptr->ml_vsyncstart, mlptr->ml_vsyncend, mlptr->ml_vtotal); if (mlptr->ml_flags & XF86CONF_PHSYNC) fprintf(cf, " +hsync"); if (mlptr->ml_flags & XF86CONF_NHSYNC) fprintf(cf, " -hsync"); if (mlptr->ml_flags & XF86CONF_PVSYNC) fprintf(cf, " +vsync"); if (mlptr->ml_flags & XF86CONF_NVSYNC) fprintf(cf, " -vsync"); if (mlptr->ml_flags & XF86CONF_INTERLACE) fprintf(cf, " interlace"); if (mlptr->ml_flags & XF86CONF_CSYNC) fprintf(cf, " composite"); if (mlptr->ml_flags & XF86CONF_PCSYNC) fprintf(cf, " +csync"); if (mlptr->ml_flags & XF86CONF_NCSYNC) fprintf(cf, " -csync"); if (mlptr->ml_flags & XF86CONF_DBLSCAN) fprintf(cf, " doublescan"); if (mlptr->ml_flags & XF86CONF_HSKEW) fprintf(cf, " hskew %d", mlptr->ml_hskew); if (mlptr->ml_flags & XF86CONF_VSCAN) fprintf(cf, " vscan %d", mlptr->ml_vscan); if (mlptr->ml_flags & XF86CONF_BCAST) fprintf(cf, " bcast"); if (mlptr->ml_comment) fprintf(cf, "%s", mlptr->ml_comment); else fprintf(cf, "\n"); } fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeMonitorList(XF86ConfMonitorPtr ptr) { XF86ConfMonitorPtr prev; while (ptr) { TestFree(ptr->mon_identifier); TestFree(ptr->mon_vendor); TestFree(ptr->mon_modelname); TestFree(ptr->mon_comment); xf86optionListFree(ptr->mon_option_lst); xf86freeModeLineList(ptr->mon_modeline_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } void xf86freeModesList(XF86ConfModesPtr ptr) { XF86ConfModesPtr prev; while (ptr) { TestFree(ptr->modes_identifier); TestFree(ptr->modes_comment); xf86freeModeLineList(ptr->mon_modeline_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p) { while (p) { if (xf86nameCompare(ident, p->mon_identifier) == 0) return p; p = p->list.next; } return NULL; } XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p) { while (p) { if (xf86nameCompare(ident, p->modes_identifier) == 0) return p; p = p->list.next; } return NULL; } XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p) { while (p) { if (xf86nameCompare(ident, p->ml_identifier) == 0) return p; p = p->list.next; } return NULL; } int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen) { XF86ConfMonitorPtr monitor = screen->scrn_monitor; XF86ConfModesLinkPtr modeslnk = monitor->mon_modes_sect_lst; XF86ConfModesPtr modes; while (modeslnk) { modes = xf86findModes(modeslnk->ml_modes_str, p->conf_modes_lst); if (!modes) { xf86validationError(UNDEFINED_MODES_MSG, modeslnk->ml_modes_str, screen->scrn_identifier); return FALSE; } modeslnk->ml_modes = modes; modeslnk = modeslnk->list.next; } return TRUE; } xorg-server-1.17.1/hw/xfree86/parser/read.c0000664000175100017510000002454412456571574015322 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec TopLevelTab[] = { {SECTION, "section"}, {-1, ""}, }; #define CLEANUP xf86freeConfig /* * This function resolves name references and reports errors if the named * objects cannot be found. */ static int xf86validateConfig(XF86ConfigPtr p) { if (!xf86validateScreen(p)) return FALSE; if (!xf86validateInput(p)) return FALSE; if (!xf86validateLayout(p)) return FALSE; return TRUE; } XF86ConfigPtr xf86readConfigFile(void) { int token; XF86ConfigPtr ptr = NULL; if ((ptr = calloc(1, sizeof(XF86ConfigRec))) == NULL) { return NULL; } while ((token = xf86getToken(TopLevelTab)) != EOF_TOKEN) { switch (token) { case COMMENT: ptr->conf_comment = xf86addComment(ptr->conf_comment, xf86_lex_val.str); break; case SECTION: if (xf86getSubToken(&(ptr->conf_comment)) != STRING) { xf86parseError(QUOTE_MSG, "Section"); CLEANUP(ptr); return NULL; } xf86setSection(xf86_lex_val.str); if (xf86nameCompare(xf86_lex_val.str, "files") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_RETURN(conf_files, xf86parseFilesSection()); } else if (xf86nameCompare(xf86_lex_val.str, "serverflags") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_RETURN(conf_flags, xf86parseFlagsSection()); } else if (xf86nameCompare(xf86_lex_val.str, "pointer") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_input_lst, xf86parsePointerSection, XF86ConfInputPtr); } else if (xf86nameCompare(xf86_lex_val.str, "videoadaptor") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_videoadaptor_lst, xf86parseVideoAdaptorSection, XF86ConfVideoAdaptorPtr); } else if (xf86nameCompare(xf86_lex_val.str, "device") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_device_lst, xf86parseDeviceSection, XF86ConfDevicePtr); } else if (xf86nameCompare(xf86_lex_val.str, "monitor") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_monitor_lst, xf86parseMonitorSection, XF86ConfMonitorPtr); } else if (xf86nameCompare(xf86_lex_val.str, "modes") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_modes_lst, xf86parseModesSection, XF86ConfModesPtr); } else if (xf86nameCompare(xf86_lex_val.str, "screen") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_screen_lst, xf86parseScreenSection, XF86ConfScreenPtr); } else if (xf86nameCompare(xf86_lex_val.str, "inputdevice") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_input_lst, xf86parseInputSection, XF86ConfInputPtr); } else if (xf86nameCompare(xf86_lex_val.str, "inputclass") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_inputclass_lst, xf86parseInputClassSection, XF86ConfInputClassPtr); } else if (xf86nameCompare(xf86_lex_val.str, "outputclass") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_outputclass_lst, xf86parseOutputClassSection, XF86ConfOutputClassPtr); } else if (xf86nameCompare(xf86_lex_val.str, "module") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_RETURN(conf_modules, xf86parseModuleSection()); } else if (xf86nameCompare(xf86_lex_val.str, "serverlayout") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_layout_lst, xf86parseLayoutSection, XF86ConfLayoutPtr); } else if (xf86nameCompare(xf86_lex_val.str, "vendor") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_LIST(conf_vendor_lst, xf86parseVendorSection, XF86ConfVendorPtr); } else if (xf86nameCompare(xf86_lex_val.str, "dri") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_RETURN(conf_dri, xf86parseDRISection()); } else if (xf86nameCompare(xf86_lex_val.str, "extensions") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; HANDLE_RETURN(conf_extensions, xf86parseExtensionsSection()); } else { free(xf86_lex_val.str); xf86_lex_val.str = NULL; Error(INVALID_SECTION_MSG, xf86tokenString()); } break; default: free(xf86_lex_val.str); xf86_lex_val.str = NULL; Error(INVALID_KEYWORD_MSG, xf86tokenString()); } } if (xf86validateConfig(ptr)) return ptr; else { CLEANUP(ptr); return NULL; } } #undef CLEANUP /* * adds an item to the end of the linked list. Any record whose first field * is a GenericListRec can be cast to this type and used with this function. * A pointer to the head of the list is returned to handle the addition of * the first item. */ GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr new) { GenericListPtr p = head; GenericListPtr last = NULL; while (p) { last = p; p = p->next; } if (last) { last->next = new; return head; } else return new; } /* * Test if one chained list contains the other. * In this case both list have the same endpoint (provided they don't loop) */ int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2) { GenericListPtr p = list_1; GenericListPtr last_1 = NULL, last_2 = NULL; while (p) { last_1 = p; p = p->next; } p = list_2; while (p) { last_2 = p; p = p->next; } return (!(last_1 == last_2)); } void xf86freeConfig(XF86ConfigPtr p) { if (p == NULL) return; xf86freeFiles(p->conf_files); xf86freeModules(p->conf_modules); xf86freeFlags(p->conf_flags); xf86freeMonitorList(p->conf_monitor_lst); xf86freeModesList(p->conf_modes_lst); xf86freeVideoAdaptorList(p->conf_videoadaptor_lst); xf86freeDeviceList(p->conf_device_lst); xf86freeScreenList(p->conf_screen_lst); xf86freeLayoutList(p->conf_layout_lst); xf86freeInputList(p->conf_input_lst); xf86freeVendorList(p->conf_vendor_lst); xf86freeDRI(p->conf_dri); xf86freeExtensions(p->conf_extensions); TestFree(p->conf_comment); free(p); } xorg-server-1.17.1/hw/xfree86/parser/OutputClass.c0000664000175100017510000001137312366220413016650 00000000000000/* * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE 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_XORG_CONFIG_H #include #endif #include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec OutputClassTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {DRIVER, "driver"}, {MATCH_DRIVER, "matchdriver"}, {-1, ""}, }; #define CLEANUP xf86freeOutputClassList #define TOKEN_SEP "|" static void add_group_entry(struct xorg_list *head, char **values) { xf86MatchGroup *group; group = malloc(sizeof(*group)); if (group) { group->values = values; xorg_list_add(&group->entry, head); } } XF86ConfOutputClassPtr xf86parseOutputClassSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfOutputClassPtr, XF86ConfOutputClassRec) /* Initialize MatchGroup lists */ xorg_list_init(&ptr->match_driver); while ((token = xf86getToken(OutputClassTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->identifier = xf86_lex_val.str; has_ident = TRUE; break; case DRIVER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "Driver"); else ptr->driver = xf86_lex_val.str; break; case MATCH_DRIVER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDriver"); add_group_entry(&ptr->match_driver, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); free(xf86_lex_val.str); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("OutputClass section parsed\n"); #endif return ptr; } void xf86printOutputClassSection(FILE * cf, XF86ConfOutputClassPtr ptr) { const xf86MatchGroup *group; char *const *cur; while (ptr) { fprintf(cf, "Section \"OutputClass\"\n"); if (ptr->comment) fprintf(cf, "%s", ptr->comment); if (ptr->identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->identifier); if (ptr->driver) fprintf(cf, "\tDriver \"%s\"\n", ptr->driver); xorg_list_for_each_entry(group, &ptr->match_driver, entry) { fprintf(cf, "\tMatchDriver \""); for (cur = group->values; *cur; cur++) fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, *cur); fprintf(cf, "\"\n"); } fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) { XF86ConfOutputClassPtr prev; while (ptr) { xf86MatchGroup *group, *next; char **list; TestFree(ptr->identifier); TestFree(ptr->comment); TestFree(ptr->driver); xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) free(*list); free(group); } prev = ptr; ptr = ptr->list.next; free(prev); } } xorg-server-1.17.1/hw/xfree86/parser/Device.c0000664000175100017510000003071412456571574015602 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec DeviceTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, {BOARD, "boardname"}, {CHIPSET, "chipset"}, {RAMDAC, "ramdac"}, {DACSPEED, "dacspeed"}, {CLOCKS, "clocks"}, {MATCHSEAT, "matchseat"}, {OPTION, "option"}, {VIDEORAM, "videoram"}, {BIOSBASE, "biosbase"}, {MEMBASE, "membase"}, {IOBASE, "iobase"}, {CLOCKCHIP, "clockchip"}, {CHIPID, "chipid"}, {CHIPREV, "chiprev"}, {CARD, "card"}, {DRIVER, "driver"}, {BUSID, "busid"}, {IRQ, "irq"}, {SCREEN, "screen"}, {-1, ""}, }; #define CLEANUP xf86freeDeviceList XF86ConfDevicePtr xf86parseDeviceSection(void) { int i; int has_ident = FALSE; int token; parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec) /* Zero is a valid value for these */ ptr->dev_chipid = -1; ptr->dev_chiprev = -1; ptr->dev_irq = -1; while ((token = xf86getToken(DeviceTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->dev_comment = xf86addComment(ptr->dev_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->dev_identifier = xf86_lex_val.str; has_ident = TRUE; break; case VENDOR: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "Vendor"); ptr->dev_vendor = xf86_lex_val.str; break; case BOARD: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "Board"); ptr->dev_board = xf86_lex_val.str; break; case CHIPSET: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "Chipset"); ptr->dev_chipset = xf86_lex_val.str; break; case CARD: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "Card"); ptr->dev_card = xf86_lex_val.str; break; case DRIVER: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "Driver"); ptr->dev_driver = xf86_lex_val.str; break; case RAMDAC: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "Ramdac"); ptr->dev_ramdac = xf86_lex_val.str; break; case DACSPEED: for (i = 0; i < CONF_MAXDACSPEEDS; i++) ptr->dev_dacSpeeds[i] = 0; if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) { Error(DACSPEED_MSG, CONF_MAXDACSPEEDS); } else { ptr->dev_dacSpeeds[0] = (int) (xf86_lex_val.realnum * 1000.0 + 0.5); for (i = 1; i < CONF_MAXDACSPEEDS; i++) { if (xf86getSubToken(&(ptr->dev_comment)) == NUMBER) ptr->dev_dacSpeeds[i] = (int) (xf86_lex_val.realnum * 1000.0 + 0.5); else { xf86unGetToken(token); break; } } } break; case VIDEORAM: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "VideoRam"); ptr->dev_videoram = xf86_lex_val.num; break; case BIOSBASE: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "BIOSBase"); ptr->dev_bios_base = xf86_lex_val.num; break; case MEMBASE: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "MemBase"); ptr->dev_mem_base = xf86_lex_val.num; break; case IOBASE: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "IOBase"); ptr->dev_io_base = xf86_lex_val.num; break; case CLOCKCHIP: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "ClockChip"); ptr->dev_clockchip = xf86_lex_val.str; break; case CHIPID: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "ChipID"); ptr->dev_chipid = xf86_lex_val.num; break; case CHIPREV: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "ChipRev"); ptr->dev_chiprev = xf86_lex_val.num; break; case CLOCKS: token = xf86getSubToken(&(ptr->dev_comment)); for (i = ptr->dev_clocks; token == NUMBER && i < CONF_MAXCLOCKS; i++) { ptr->dev_clock[i] = (int) (xf86_lex_val.realnum * 1000.0 + 0.5); token = xf86getSubToken(&(ptr->dev_comment)); } ptr->dev_clocks = i; xf86unGetToken(token); break; case MATCHSEAT: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "MatchSeat"); ptr->match_seat = xf86_lex_val.str; break; case OPTION: ptr->dev_option_lst = xf86parseOption(ptr->dev_option_lst); break; case BUSID: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "BusID"); ptr->dev_busid = xf86_lex_val.str; break; case IRQ: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(QUOTE_MSG, "IRQ"); ptr->dev_irq = xf86_lex_val.num; break; case SCREEN: if (xf86getSubToken(&(ptr->dev_comment)) != NUMBER) Error(NUMBER_MSG, "Screen"); ptr->dev_screen = xf86_lex_val.num; break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("Device section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printDeviceSection(FILE * cf, XF86ConfDevicePtr ptr) { int i; while (ptr) { fprintf(cf, "Section \"Device\"\n"); if (ptr->dev_comment) fprintf(cf, "%s", ptr->dev_comment); if (ptr->dev_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->dev_identifier); if (ptr->dev_driver) fprintf(cf, "\tDriver \"%s\"\n", ptr->dev_driver); if (ptr->dev_vendor) fprintf(cf, "\tVendorName \"%s\"\n", ptr->dev_vendor); if (ptr->dev_board) fprintf(cf, "\tBoardName \"%s\"\n", ptr->dev_board); if (ptr->dev_chipset) fprintf(cf, "\tChipSet \"%s\"\n", ptr->dev_chipset); if (ptr->dev_card) fprintf(cf, "\tCard \"%s\"\n", ptr->dev_card); if (ptr->dev_ramdac) fprintf(cf, "\tRamDac \"%s\"\n", ptr->dev_ramdac); if (ptr->dev_dacSpeeds[0] > 0) { fprintf(cf, "\tDacSpeed "); for (i = 0; i < CONF_MAXDACSPEEDS && ptr->dev_dacSpeeds[i] > 0; i++) fprintf(cf, "%g ", (double) (ptr->dev_dacSpeeds[i]) / 1000.0); fprintf(cf, "\n"); } if (ptr->dev_videoram) fprintf(cf, "\tVideoRam %d\n", ptr->dev_videoram); if (ptr->dev_bios_base) fprintf(cf, "\tBiosBase 0x%lx\n", ptr->dev_bios_base); if (ptr->dev_mem_base) fprintf(cf, "\tMemBase 0x%lx\n", ptr->dev_mem_base); if (ptr->dev_io_base) fprintf(cf, "\tIOBase 0x%lx\n", ptr->dev_io_base); if (ptr->dev_clockchip) fprintf(cf, "\tClockChip \"%s\"\n", ptr->dev_clockchip); if (ptr->dev_chipid != -1) fprintf(cf, "\tChipId 0x%x\n", ptr->dev_chipid); if (ptr->dev_chiprev != -1) fprintf(cf, "\tChipRev 0x%x\n", ptr->dev_chiprev); xf86printOptionList(cf, ptr->dev_option_lst, 1); if (ptr->dev_clocks > 0) { fprintf(cf, "\tClocks "); for (i = 0; i < ptr->dev_clocks; i++) fprintf(cf, "%.1f ", (double) ptr->dev_clock[i] / 1000.0); fprintf(cf, "\n"); } if (ptr->dev_busid) fprintf(cf, "\tBusID \"%s\"\n", ptr->dev_busid); if (ptr->dev_screen > 0) fprintf(cf, "\tScreen %d\n", ptr->dev_screen); if (ptr->dev_irq >= 0) fprintf(cf, "\tIRQ %d\n", ptr->dev_irq); fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeDeviceList(XF86ConfDevicePtr ptr) { XF86ConfDevicePtr prev; while (ptr) { TestFree(ptr->dev_identifier); TestFree(ptr->dev_vendor); TestFree(ptr->dev_board); TestFree(ptr->dev_chipset); TestFree(ptr->dev_card); TestFree(ptr->dev_driver); TestFree(ptr->dev_ramdac); TestFree(ptr->dev_clockchip); TestFree(ptr->dev_comment); xf86optionListFree(ptr->dev_option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p) { while (p) { if (xf86nameCompare(ident, p->dev_identifier) == 0) return p; p = p->list.next; } return NULL; } xorg-server-1.17.1/hw/xfree86/parser/Module.c0000664000175100017510000002064312456571574015630 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec SubModuleTab[] = { {ENDSUBSECTION, "endsubsection"}, {OPTION, "option"}, {-1, ""}, }; static xf86ConfigSymTabRec ModuleTab[] = { {ENDSECTION, "endsection"}, {LOAD, "load"}, {DISABLE, "disable"}, {LOAD_DRIVER, "loaddriver"}, {SUBSECTION, "subsection"}, {-1, ""}, }; #define CLEANUP xf86freeModules static XF86LoadPtr xf86parseModuleSubSection(XF86LoadPtr head, char *name) { int token; parsePrologue(XF86LoadPtr, XF86LoadRec) ptr->load_name = name; ptr->load_type = XF86_LOAD_MODULE; ptr->ignore = 0; ptr->load_opt = NULL; ptr->list.next = NULL; while ((token = xf86getToken(SubModuleTab)) != ENDSUBSECTION) { switch (token) { case COMMENT: ptr->load_comment = xf86addComment(ptr->load_comment, xf86_lex_val.str); break; case OPTION: ptr->load_opt = xf86parseOption(ptr->load_opt); break; case EOF_TOKEN: xf86parseError(UNEXPECTED_EOF_MSG); free(ptr); return NULL; default: xf86parseError(INVALID_KEYWORD_MSG, xf86tokenString()); free(ptr); return NULL; break; } } return ((XF86LoadPtr) xf86addListItem((glp) head, (glp) ptr)); } XF86ConfModulePtr xf86parseModuleSection(void) { int token; parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec) while ((token = xf86getToken(ModuleTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->mod_comment = xf86addComment(ptr->mod_comment, xf86_lex_val.str); break; case LOAD: if (xf86getSubToken(&(ptr->mod_comment)) != STRING) Error(QUOTE_MSG, "Load"); ptr->mod_load_lst = xf86addNewLoadDirective(ptr->mod_load_lst, xf86_lex_val.str, XF86_LOAD_MODULE, NULL); break; case DISABLE: if (xf86getSubToken(&(ptr->mod_comment)) != STRING) Error(QUOTE_MSG, "Disable"); ptr->mod_disable_lst = xf86addNewLoadDirective(ptr->mod_disable_lst, xf86_lex_val.str, XF86_DISABLE_MODULE, NULL); break; case LOAD_DRIVER: if (xf86getSubToken(&(ptr->mod_comment)) != STRING) Error(QUOTE_MSG, "LoadDriver"); ptr->mod_load_lst = xf86addNewLoadDirective(ptr->mod_load_lst, xf86_lex_val.str, XF86_LOAD_DRIVER, NULL); break; case SUBSECTION: if (xf86getSubToken(&(ptr->mod_comment)) != STRING) Error(QUOTE_MSG, "SubSection"); ptr->mod_load_lst = xf86parseModuleSubSection(ptr->mod_load_lst, xf86_lex_val.str); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG printf("Module section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printModuleSection(FILE * cf, XF86ConfModulePtr ptr) { XF86LoadPtr lptr; if (ptr == NULL) return; if (ptr->mod_comment) fprintf(cf, "%s", ptr->mod_comment); for (lptr = ptr->mod_load_lst; lptr; lptr = lptr->list.next) { switch (lptr->load_type) { case XF86_LOAD_MODULE: if (lptr->load_opt == NULL) { fprintf(cf, "\tLoad \"%s\"", lptr->load_name); if (lptr->load_comment) fprintf(cf, "%s", lptr->load_comment); else fputc('\n', cf); } else { fprintf(cf, "\tSubSection \"%s\"\n", lptr->load_name); if (lptr->load_comment) fprintf(cf, "%s", lptr->load_comment); xf86printOptionList(cf, lptr->load_opt, 2); fprintf(cf, "\tEndSubSection\n"); } break; case XF86_LOAD_DRIVER: fprintf(cf, "\tLoadDriver \"%s\"", lptr->load_name); if (lptr->load_comment) fprintf(cf, "%s", lptr->load_comment); else fputc('\n', cf); break; #if 0 default: fprintf(cf, "#\tUnknown type \"%s\"\n", lptr->load_name); break; #endif } } } XF86LoadPtr xf86addNewLoadDirective(XF86LoadPtr head, const char *name, int type, XF86OptionPtr opts) { XF86LoadPtr new; int token; new = calloc(1, sizeof(XF86LoadRec)); new->load_name = name; new->load_type = type; new->load_opt = opts; new->ignore = 0; new->list.next = NULL; if ((token = xf86getToken(NULL)) == COMMENT) new->load_comment = xf86addComment(new->load_comment, xf86_lex_val.str); else xf86unGetToken(token); return ((XF86LoadPtr) xf86addListItem((glp) head, (glp) new)); } void xf86freeModules(XF86ConfModulePtr ptr) { XF86LoadPtr lptr; XF86LoadPtr prev; if (ptr == NULL) return; lptr = ptr->mod_load_lst; while (lptr) { TestFree(lptr->load_name); TestFree(lptr->load_comment); prev = lptr; lptr = lptr->list.next; free(prev); } lptr = ptr->mod_disable_lst; while (lptr) { TestFree(lptr->load_name); TestFree(lptr->load_comment); prev = lptr; lptr = lptr->list.next; free(prev); } TestFree(ptr->mod_comment); free(ptr); } xorg-server-1.17.1/hw/xfree86/parser/configProcs.h0000664000175100017510000001315612362011424016640 00000000000000/* * Copyright (c) 1997-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* Private procs. Public procs are in xf86Parser.h and xf86Optrec.h */ /* exported functions are/were used by the X Server, and need to be * made public when installing libxf86config */ /* Device.c */ XF86ConfDevicePtr xf86parseDeviceSection(void); void xf86printDeviceSection(FILE * cf, XF86ConfDevicePtr ptr); void xf86freeDeviceList(XF86ConfDevicePtr ptr); int xf86validateDevice(XF86ConfigPtr p); /* Files.c */ XF86ConfFilesPtr xf86parseFilesSection(void); void xf86printFileSection(FILE * cf, XF86ConfFilesPtr ptr); void xf86freeFiles(XF86ConfFilesPtr p); /* Flags.c */ XF86ConfFlagsPtr xf86parseFlagsSection(void); void xf86printServerFlagsSection(FILE * f, XF86ConfFlagsPtr flags); void xf86freeFlags(XF86ConfFlagsPtr flags); /* Input.c */ XF86ConfInputPtr xf86parseInputSection(void); void xf86printInputSection(FILE * f, XF86ConfInputPtr ptr); void xf86freeInputList(XF86ConfInputPtr ptr); int xf86validateInput(XF86ConfigPtr p); /* InputClass.c */ XF86ConfInputClassPtr xf86parseInputClassSection(void); void xf86printInputClassSection(FILE * f, XF86ConfInputClassPtr ptr); void xf86freeInputClassList(XF86ConfInputClassPtr ptr); /* OutputClass.c */ XF86ConfOutputClassPtr xf86parseOutputClassSection(void); void xf86printOutputClassSection(FILE * f, XF86ConfOutputClassPtr ptr); void xf86freeOutputClassList(XF86ConfOutputClassPtr ptr); /* Layout.c */ XF86ConfLayoutPtr xf86parseLayoutSection(void); void xf86printLayoutSection(FILE * cf, XF86ConfLayoutPtr ptr); void xf86freeLayoutList(XF86ConfLayoutPtr ptr); int xf86validateLayout(XF86ConfigPtr p); /* Module.c */ XF86ConfModulePtr xf86parseModuleSection(void); void xf86printModuleSection(FILE * cf, XF86ConfModulePtr ptr); extern _X_EXPORT XF86LoadPtr xf86addNewLoadDirective(XF86LoadPtr head, const char *name, int type, XF86OptionPtr opts); void xf86freeModules(XF86ConfModulePtr ptr); /* Monitor.c */ XF86ConfMonitorPtr xf86parseMonitorSection(void); XF86ConfModesPtr xf86parseModesSection(void); void xf86printMonitorSection(FILE * cf, XF86ConfMonitorPtr ptr); void xf86printModesSection(FILE * cf, XF86ConfModesPtr ptr); extern _X_EXPORT void xf86freeMonitorList(XF86ConfMonitorPtr ptr); void xf86freeModesList(XF86ConfModesPtr ptr); int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen); /* Pointer.c */ XF86ConfInputPtr xf86parsePointerSection(void); /* Screen.c */ XF86ConfScreenPtr xf86parseScreenSection(void); void xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr); extern _X_EXPORT void xf86freeScreenList(XF86ConfScreenPtr ptr); void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr); void xf86freeDisplayList(XF86ConfDisplayPtr ptr); void xf86freeModeList(XF86ModePtr ptr); int xf86validateScreen(XF86ConfigPtr p); /* Vendor.c */ XF86ConfVendorPtr xf86parseVendorSection(void); void xf86freeVendorList(XF86ConfVendorPtr p); void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr); void xf86freeVendorSubList(XF86ConfVendSubPtr ptr); /* Video.c */ XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void); void xf86printVideoAdaptorSection(FILE * cf, XF86ConfVideoAdaptorPtr ptr); void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr); /* scan.c */ int xf86getToken(xf86ConfigSymTabRec * tab); int xf86getSubToken(char **comment); int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec * tab); void xf86unGetToken(int token); char *xf86tokenString(void); void xf86parseError(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); void xf86validationError(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); void xf86setSection(const char *section); int xf86getStringToken(xf86ConfigSymTabRec * tab); /* write.c */ /* DRI.c */ XF86ConfDRIPtr xf86parseDRISection(void); void xf86printDRISection(FILE * cf, XF86ConfDRIPtr ptr); void xf86freeDRI(XF86ConfDRIPtr ptr); /* Extensions.c */ XF86ConfExtensionsPtr xf86parseExtensionsSection(void); void xf86printExtensionsSection(FILE * cf, XF86ConfExtensionsPtr ptr); void xf86freeExtensions(XF86ConfExtensionsPtr ptr); #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef HAVE_XORG_CONFIG_H /* Externally provided functions */ void ErrorF(const char *f, ...); void VErrorF(const char *f, va_list args); #endif xorg-server-1.17.1/hw/xfree86/parser/write.c0000664000175100017510000001500012456571574015524 00000000000000/* * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" #include #include #include #include #include #if defined(HAVE_SETEUID) && defined(_POSIX_SAVED_IDS) && _POSIX_SAVED_IDS > 0 #define HAS_SAVED_IDS_AND_SETEUID #endif #if defined(WIN32) #define HAS_NO_UIDS #endif #ifdef HAS_NO_UIDS #define doWriteConfigFile xf86writeConfigFile #define Local /**/ #else #define Local static #endif Local int doWriteConfigFile(const char *filename, XF86ConfigPtr cptr) { FILE *cf; if ((cf = fopen(filename, "w")) == NULL) { return 0; } if (cptr->conf_comment) fprintf(cf, "%s\n", cptr->conf_comment); xf86printLayoutSection(cf, cptr->conf_layout_lst); if (cptr->conf_files != NULL) { fprintf(cf, "Section \"Files\"\n"); xf86printFileSection(cf, cptr->conf_files); fprintf(cf, "EndSection\n\n"); } if (cptr->conf_modules != NULL) { fprintf(cf, "Section \"Module\"\n"); xf86printModuleSection(cf, cptr->conf_modules); fprintf(cf, "EndSection\n\n"); } xf86printVendorSection(cf, cptr->conf_vendor_lst); xf86printServerFlagsSection(cf, cptr->conf_flags); xf86printInputSection(cf, cptr->conf_input_lst); xf86printInputClassSection(cf, cptr->conf_inputclass_lst); xf86printOutputClassSection(cf, cptr->conf_outputclass_lst); xf86printVideoAdaptorSection(cf, cptr->conf_videoadaptor_lst); xf86printModesSection(cf, cptr->conf_modes_lst); xf86printMonitorSection(cf, cptr->conf_monitor_lst); xf86printDeviceSection(cf, cptr->conf_device_lst); xf86printScreenSection(cf, cptr->conf_screen_lst); xf86printDRISection(cf, cptr->conf_dri); xf86printExtensionsSection(cf, cptr->conf_extensions); fclose(cf); return 1; } #ifndef HAS_NO_UIDS int xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr) { int ret; #if !defined(HAS_SAVED_IDS_AND_SETEUID) int pid, p; int status; void (*csig) (int); #else int ruid, euid; #endif if (getuid() != geteuid()) { #if !defined(HAS_SAVED_IDS_AND_SETEUID) /* Need to fork to change ruid without loosing euid */ csig = signal(SIGCHLD, SIG_DFL); switch ((pid = fork())) { case -1: ErrorF("xf86writeConfigFile(): fork failed (%s)\n", strerror(errno)); return 0; case 0: /* child */ if (setuid(getuid()) == -1) FatalError("xf86writeConfigFile(): " "setuid failed(%s)\n", strerror(errno)); ret = doWriteConfigFile(filename, cptr); exit(ret); break; default: /* parent */ do { p = waitpid(pid, &status, 0); } while (p == -1 && errno == EINTR); } signal(SIGCHLD, csig); if (p != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0) return 1; /* success */ else return 0; #else /* HAS_SAVED_IDS_AND_SETEUID */ ruid = getuid(); euid = geteuid(); if (seteuid(ruid) == -1) { ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n", ruid, strerror(errno)); return 0; } ret = doWriteConfigFile(filename, cptr); if (seteuid(euid) == -1) { ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n", euid, strerror(errno)); } return ret; #endif /* HAS_SAVED_IDS_AND_SETEUID */ } else { return doWriteConfigFile(filename, cptr); } } #endif /* !HAS_NO_UIDS */ xorg-server-1.17.1/hw/xfree86/parser/Makefile.in0000664000175100017510000015360312466505433016277 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/parser DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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)$(libdir)" "$(DESTDIR)$(sdkdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libxf86config_la_LIBADD = am__objects_1 = libxf86config_la-Device.lo libxf86config_la-Files.lo \ libxf86config_la-Flags.lo libxf86config_la-Input.lo \ libxf86config_la-InputClass.lo libxf86config_la-OutputClass.lo \ libxf86config_la-Layout.lo libxf86config_la-Module.lo \ libxf86config_la-Video.lo libxf86config_la-Monitor.lo \ libxf86config_la-Pointer.lo libxf86config_la-Screen.lo \ libxf86config_la-Vendor.lo libxf86config_la-read.lo \ libxf86config_la-scan.lo libxf86config_la-write.lo \ libxf86config_la-DRI.lo libxf86config_la-Extensions.lo am_libxf86config_la_OBJECTS = libxf86config_la-xprintf.lo \ $(am__objects_1) libxf86config_la_OBJECTS = $(am_libxf86config_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 = libxf86config_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libxf86config_la_CFLAGS) $(CFLAGS) \ $(libxf86config_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LIBXF86CONFIG_TRUE@am_libxf86config_la_rpath = -rpath \ @INSTALL_LIBXF86CONFIG_TRUE@ $(libdir) libxf86config_internal_la_LIBADD = am__objects_2 = Device.lo Files.lo Flags.lo Input.lo InputClass.lo \ OutputClass.lo Layout.lo Module.lo Video.lo Monitor.lo \ Pointer.lo Screen.lo Vendor.lo read.lo scan.lo write.lo DRI.lo \ Extensions.lo am_libxf86config_internal_la_OBJECTS = $(am__objects_2) libxf86config_internal_la_OBJECTS = \ $(am_libxf86config_internal_la_OBJECTS) @INSTALL_LIBXF86CONFIG_FALSE@am_libxf86config_internal_la_rpath = @INSTALL_LIBXF86CONFIG_TRUE@am_libxf86config_internal_la_rpath = 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 = $(libxf86config_la_SOURCES) \ $(libxf86config_internal_la_SOURCES) DIST_SOURCES = $(libxf86config_la_SOURCES) \ $(libxf86config_internal_la_SOURCES) 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @INSTALL_LIBXF86CONFIG_FALSE@noinst_LTLIBRARIES = libxf86config_internal.la @INSTALL_LIBXF86CONFIG_TRUE@noinst_LTLIBRARIES = libxf86config_internal.la @INSTALL_LIBXF86CONFIG_TRUE@lib_LTLIBRARIES = libxf86config.la @INSTALL_LIBXF86CONFIG_TRUE@LIBHEADERS = \ @INSTALL_LIBXF86CONFIG_TRUE@ xf86Optrec.h \ @INSTALL_LIBXF86CONFIG_TRUE@ xf86Parser.h INTERNAL_SOURCES = \ Device.c \ Files.c \ Flags.c \ Input.c \ InputClass.c \ OutputClass.c \ Layout.c \ Module.c \ Video.c \ Monitor.c \ Pointer.c \ Screen.c \ Vendor.c \ read.c \ scan.c \ write.c \ DRI.c \ Extensions.c libxf86config_internal_la_SOURCES = \ $(INTERNAL_SOURCES) libxf86config_la_SOURCES = \ $(top_srcdir)/os/xprintf.c \ $(INTERNAL_SOURCES) libxf86config_la_CFLAGS = $(AM_CFLAGS) libxf86config_la_LDFLAGS = -static AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DDATADIR=\"$(datadir)\" EXTRA_DIST = \ Configint.h \ configProcs.h \ xf86Optrec.h \ xf86Parser.h \ xf86tokens.h sdk_HEADERS = \ xf86Parser.h \ xf86Optrec.h AM_CPPFLAGS = -I$(srcdir)/../common all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/parser/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/parser/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_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}; \ } 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}; \ } libxf86config.la: $(libxf86config_la_OBJECTS) $(libxf86config_la_DEPENDENCIES) $(EXTRA_libxf86config_la_DEPENDENCIES) $(AM_V_CCLD)$(libxf86config_la_LINK) $(am_libxf86config_la_rpath) $(libxf86config_la_OBJECTS) $(libxf86config_la_LIBADD) $(LIBS) libxf86config_internal.la: $(libxf86config_internal_la_OBJECTS) $(libxf86config_internal_la_DEPENDENCIES) $(EXTRA_libxf86config_internal_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libxf86config_internal_la_rpath) $(libxf86config_internal_la_OBJECTS) $(libxf86config_internal_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DRI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Extensions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Files.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Flags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Input.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InputClass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Layout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OutputClass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Pointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Screen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Vendor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-DRI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Extensions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Files.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Flags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Input.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-InputClass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Layout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-OutputClass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Pointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Screen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Vendor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-scan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-xprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.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 -o $@ $< .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 -o $@ `$(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 $@ $< libxf86config_la-xprintf.lo: $(top_srcdir)/os/xprintf.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-xprintf.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-xprintf.Tpo -c -o libxf86config_la-xprintf.lo `test -f '$(top_srcdir)/os/xprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/os/xprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-xprintf.Tpo $(DEPDIR)/libxf86config_la-xprintf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/os/xprintf.c' object='libxf86config_la-xprintf.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-xprintf.lo `test -f '$(top_srcdir)/os/xprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/os/xprintf.c libxf86config_la-Device.lo: Device.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Device.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Device.Tpo -c -o libxf86config_la-Device.lo `test -f 'Device.c' || echo '$(srcdir)/'`Device.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Device.Tpo $(DEPDIR)/libxf86config_la-Device.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Device.c' object='libxf86config_la-Device.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Device.lo `test -f 'Device.c' || echo '$(srcdir)/'`Device.c libxf86config_la-Files.lo: Files.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Files.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Files.Tpo -c -o libxf86config_la-Files.lo `test -f 'Files.c' || echo '$(srcdir)/'`Files.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Files.Tpo $(DEPDIR)/libxf86config_la-Files.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Files.c' object='libxf86config_la-Files.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Files.lo `test -f 'Files.c' || echo '$(srcdir)/'`Files.c libxf86config_la-Flags.lo: Flags.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Flags.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Flags.Tpo -c -o libxf86config_la-Flags.lo `test -f 'Flags.c' || echo '$(srcdir)/'`Flags.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Flags.Tpo $(DEPDIR)/libxf86config_la-Flags.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Flags.c' object='libxf86config_la-Flags.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Flags.lo `test -f 'Flags.c' || echo '$(srcdir)/'`Flags.c libxf86config_la-Input.lo: Input.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Input.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Input.Tpo -c -o libxf86config_la-Input.lo `test -f 'Input.c' || echo '$(srcdir)/'`Input.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Input.Tpo $(DEPDIR)/libxf86config_la-Input.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Input.c' object='libxf86config_la-Input.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Input.lo `test -f 'Input.c' || echo '$(srcdir)/'`Input.c libxf86config_la-InputClass.lo: InputClass.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-InputClass.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-InputClass.Tpo -c -o libxf86config_la-InputClass.lo `test -f 'InputClass.c' || echo '$(srcdir)/'`InputClass.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-InputClass.Tpo $(DEPDIR)/libxf86config_la-InputClass.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='InputClass.c' object='libxf86config_la-InputClass.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-InputClass.lo `test -f 'InputClass.c' || echo '$(srcdir)/'`InputClass.c libxf86config_la-OutputClass.lo: OutputClass.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-OutputClass.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-OutputClass.Tpo -c -o libxf86config_la-OutputClass.lo `test -f 'OutputClass.c' || echo '$(srcdir)/'`OutputClass.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-OutputClass.Tpo $(DEPDIR)/libxf86config_la-OutputClass.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='OutputClass.c' object='libxf86config_la-OutputClass.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-OutputClass.lo `test -f 'OutputClass.c' || echo '$(srcdir)/'`OutputClass.c libxf86config_la-Layout.lo: Layout.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Layout.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Layout.Tpo -c -o libxf86config_la-Layout.lo `test -f 'Layout.c' || echo '$(srcdir)/'`Layout.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Layout.Tpo $(DEPDIR)/libxf86config_la-Layout.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Layout.c' object='libxf86config_la-Layout.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Layout.lo `test -f 'Layout.c' || echo '$(srcdir)/'`Layout.c libxf86config_la-Module.lo: Module.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Module.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Module.Tpo -c -o libxf86config_la-Module.lo `test -f 'Module.c' || echo '$(srcdir)/'`Module.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Module.Tpo $(DEPDIR)/libxf86config_la-Module.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Module.c' object='libxf86config_la-Module.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Module.lo `test -f 'Module.c' || echo '$(srcdir)/'`Module.c libxf86config_la-Video.lo: Video.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Video.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Video.Tpo -c -o libxf86config_la-Video.lo `test -f 'Video.c' || echo '$(srcdir)/'`Video.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Video.Tpo $(DEPDIR)/libxf86config_la-Video.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Video.c' object='libxf86config_la-Video.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Video.lo `test -f 'Video.c' || echo '$(srcdir)/'`Video.c libxf86config_la-Monitor.lo: Monitor.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Monitor.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Monitor.Tpo -c -o libxf86config_la-Monitor.lo `test -f 'Monitor.c' || echo '$(srcdir)/'`Monitor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Monitor.Tpo $(DEPDIR)/libxf86config_la-Monitor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Monitor.c' object='libxf86config_la-Monitor.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Monitor.lo `test -f 'Monitor.c' || echo '$(srcdir)/'`Monitor.c libxf86config_la-Pointer.lo: Pointer.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Pointer.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Pointer.Tpo -c -o libxf86config_la-Pointer.lo `test -f 'Pointer.c' || echo '$(srcdir)/'`Pointer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Pointer.Tpo $(DEPDIR)/libxf86config_la-Pointer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Pointer.c' object='libxf86config_la-Pointer.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Pointer.lo `test -f 'Pointer.c' || echo '$(srcdir)/'`Pointer.c libxf86config_la-Screen.lo: Screen.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Screen.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Screen.Tpo -c -o libxf86config_la-Screen.lo `test -f 'Screen.c' || echo '$(srcdir)/'`Screen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Screen.Tpo $(DEPDIR)/libxf86config_la-Screen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Screen.c' object='libxf86config_la-Screen.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Screen.lo `test -f 'Screen.c' || echo '$(srcdir)/'`Screen.c libxf86config_la-Vendor.lo: Vendor.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Vendor.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Vendor.Tpo -c -o libxf86config_la-Vendor.lo `test -f 'Vendor.c' || echo '$(srcdir)/'`Vendor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Vendor.Tpo $(DEPDIR)/libxf86config_la-Vendor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Vendor.c' object='libxf86config_la-Vendor.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Vendor.lo `test -f 'Vendor.c' || echo '$(srcdir)/'`Vendor.c libxf86config_la-read.lo: read.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-read.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-read.Tpo -c -o libxf86config_la-read.lo `test -f 'read.c' || echo '$(srcdir)/'`read.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-read.Tpo $(DEPDIR)/libxf86config_la-read.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='read.c' object='libxf86config_la-read.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-read.lo `test -f 'read.c' || echo '$(srcdir)/'`read.c libxf86config_la-scan.lo: scan.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-scan.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-scan.Tpo -c -o libxf86config_la-scan.lo `test -f 'scan.c' || echo '$(srcdir)/'`scan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-scan.Tpo $(DEPDIR)/libxf86config_la-scan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scan.c' object='libxf86config_la-scan.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-scan.lo `test -f 'scan.c' || echo '$(srcdir)/'`scan.c libxf86config_la-write.lo: write.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-write.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-write.Tpo -c -o libxf86config_la-write.lo `test -f 'write.c' || echo '$(srcdir)/'`write.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-write.Tpo $(DEPDIR)/libxf86config_la-write.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='write.c' object='libxf86config_la-write.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-write.lo `test -f 'write.c' || echo '$(srcdir)/'`write.c libxf86config_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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-DRI.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-DRI.Tpo -c -o libxf86config_la-DRI.lo `test -f 'DRI.c' || echo '$(srcdir)/'`DRI.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-DRI.Tpo $(DEPDIR)/libxf86config_la-DRI.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='DRI.c' object='libxf86config_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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-DRI.lo `test -f 'DRI.c' || echo '$(srcdir)/'`DRI.c libxf86config_la-Extensions.lo: Extensions.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Extensions.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Extensions.Tpo -c -o libxf86config_la-Extensions.lo `test -f 'Extensions.c' || echo '$(srcdir)/'`Extensions.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Extensions.Tpo $(DEPDIR)/libxf86config_la-Extensions.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Extensions.c' object='libxf86config_la-Extensions.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) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Extensions.lo `test -f 'Extensions.c' || echo '$(srcdir)/'`Extensions.c 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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(libdir)" "$(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-generic clean-libLTLIBRARIES 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-sdkHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES 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-libLTLIBRARIES uninstall-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am 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-libLTLIBRARIES \ 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 tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ 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: xorg-server-1.17.1/hw/xfree86/parser/xf86Parser.h0000664000175100017510000003554712456571574016371 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ /* * This file contains the external interfaces for the XFree86 configuration * file parser. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _xf86Parser_h_ #define _xf86Parser_h_ #include #include "xf86Optrec.h" #include "list.h" #define HAVE_PARSER_DECLS typedef struct { char *file_logfile; char *file_modulepath; char *file_fontpath; char *file_comment; char *file_xkbdir; } XF86ConfFilesRec, *XF86ConfFilesPtr; /* Values for load_type */ #define XF86_LOAD_MODULE 0 #define XF86_LOAD_DRIVER 1 #define XF86_DISABLE_MODULE 2 typedef struct { GenericListRec list; int load_type; const char *load_name; XF86OptionPtr load_opt; char *load_comment; int ignore; } XF86LoadRec, *XF86LoadPtr; typedef struct { XF86LoadPtr mod_load_lst; XF86LoadPtr mod_disable_lst; char *mod_comment; } XF86ConfModuleRec, *XF86ConfModulePtr; #define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard" #define CONF_IMPLICIT_POINTER "Implicit Core Pointer" #define XF86CONF_PHSYNC 0x0001 #define XF86CONF_NHSYNC 0x0002 #define XF86CONF_PVSYNC 0x0004 #define XF86CONF_NVSYNC 0x0008 #define XF86CONF_INTERLACE 0x0010 #define XF86CONF_DBLSCAN 0x0020 #define XF86CONF_CSYNC 0x0040 #define XF86CONF_PCSYNC 0x0080 #define XF86CONF_NCSYNC 0x0100 #define XF86CONF_HSKEW 0x0200 /* hskew provided */ #define XF86CONF_BCAST 0x0400 #define XF86CONF_VSCAN 0x1000 typedef struct { GenericListRec list; const char *ml_identifier; int ml_clock; int ml_hdisplay; int ml_hsyncstart; int ml_hsyncend; int ml_htotal; int ml_vdisplay; int ml_vsyncstart; int ml_vsyncend; int ml_vtotal; int ml_vscan; int ml_flags; int ml_hskew; char *ml_comment; } XF86ConfModeLineRec, *XF86ConfModeLinePtr; typedef struct { GenericListRec list; const char *vp_identifier; XF86OptionPtr vp_option_lst; char *vp_comment; } XF86ConfVideoPortRec, *XF86ConfVideoPortPtr; typedef struct { GenericListRec list; const char *va_identifier; const char *va_vendor; const char *va_board; const char *va_busid; const char *va_driver; XF86OptionPtr va_option_lst; XF86ConfVideoPortPtr va_port_lst; const char *va_fwdref; char *va_comment; } XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr; #define CONF_MAX_HSYNC 8 #define CONF_MAX_VREFRESH 8 typedef struct { float hi, lo; } parser_range; typedef struct { int red, green, blue; } parser_rgb; typedef struct { GenericListRec list; const char *modes_identifier; XF86ConfModeLinePtr mon_modeline_lst; char *modes_comment; } XF86ConfModesRec, *XF86ConfModesPtr; typedef struct { GenericListRec list; const char *ml_modes_str; XF86ConfModesPtr ml_modes; } XF86ConfModesLinkRec, *XF86ConfModesLinkPtr; typedef struct { GenericListRec list; const char *mon_identifier; const char *mon_vendor; char *mon_modelname; int mon_width; /* in mm */ int mon_height; /* in mm */ XF86ConfModeLinePtr mon_modeline_lst; int mon_n_hsync; parser_range mon_hsync[CONF_MAX_HSYNC]; int mon_n_vrefresh; parser_range mon_vrefresh[CONF_MAX_VREFRESH]; float mon_gamma_red; float mon_gamma_green; float mon_gamma_blue; XF86OptionPtr mon_option_lst; XF86ConfModesLinkPtr mon_modes_sect_lst; char *mon_comment; } XF86ConfMonitorRec, *XF86ConfMonitorPtr; #define CONF_MAXDACSPEEDS 4 #define CONF_MAXCLOCKS 128 typedef struct { GenericListRec list; const char *dev_identifier; const char *dev_vendor; const char *dev_board; const char *dev_chipset; const char *dev_busid; const char *dev_card; const char *dev_driver; const char *dev_ramdac; int dev_dacSpeeds[CONF_MAXDACSPEEDS]; int dev_videoram; unsigned long dev_bios_base; unsigned long dev_mem_base; unsigned long dev_io_base; const char *dev_clockchip; int dev_clocks; int dev_clock[CONF_MAXCLOCKS]; int dev_chipid; int dev_chiprev; int dev_irq; int dev_screen; XF86OptionPtr dev_option_lst; char *dev_comment; char *match_seat; } XF86ConfDeviceRec, *XF86ConfDevicePtr; typedef struct { GenericListRec list; const char *mode_name; } XF86ModeRec, *XF86ModePtr; typedef struct { GenericListRec list; int disp_frameX0; int disp_frameY0; int disp_virtualX; int disp_virtualY; int disp_depth; int disp_bpp; const char *disp_visual; parser_rgb disp_weight; parser_rgb disp_black; parser_rgb disp_white; XF86ModePtr disp_mode_lst; XF86OptionPtr disp_option_lst; char *disp_comment; } XF86ConfDisplayRec, *XF86ConfDisplayPtr; typedef struct { XF86OptionPtr flg_option_lst; char *flg_comment; } XF86ConfFlagsRec, *XF86ConfFlagsPtr; typedef struct { GenericListRec list; const char *al_adaptor_str; XF86ConfVideoAdaptorPtr al_adaptor; } XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr; typedef struct { GenericListRec list; const char *scrn_identifier; const char *scrn_obso_driver; int scrn_defaultdepth; int scrn_defaultbpp; int scrn_defaultfbbpp; const char *scrn_monitor_str; XF86ConfMonitorPtr scrn_monitor; const char *scrn_device_str; XF86ConfDevicePtr scrn_device; XF86ConfAdaptorLinkPtr scrn_adaptor_lst; XF86ConfDisplayPtr scrn_display_lst; XF86OptionPtr scrn_option_lst; char *scrn_comment; int scrn_virtualX, scrn_virtualY; char *match_seat; } XF86ConfScreenRec, *XF86ConfScreenPtr; typedef struct { GenericListRec list; char *inp_identifier; char *inp_driver; XF86OptionPtr inp_option_lst; char *inp_comment; } XF86ConfInputRec, *XF86ConfInputPtr; typedef struct { GenericListRec list; XF86ConfInputPtr iref_inputdev; char *iref_inputdev_str; XF86OptionPtr iref_option_lst; } XF86ConfInputrefRec, *XF86ConfInputrefPtr; typedef struct { Bool set; Bool val; } xf86TriState; typedef struct { struct xorg_list entry; char **values; } xf86MatchGroup; typedef struct { GenericListRec list; char *identifier; char *driver; struct xorg_list match_product; struct xorg_list match_vendor; struct xorg_list match_device; struct xorg_list match_os; struct xorg_list match_pnpid; struct xorg_list match_usbid; struct xorg_list match_driver; struct xorg_list match_tag; struct xorg_list match_layout; xf86TriState is_keyboard; xf86TriState is_pointer; xf86TriState is_joystick; xf86TriState is_tablet; xf86TriState is_touchpad; xf86TriState is_touchscreen; XF86OptionPtr option_lst; char *comment; } XF86ConfInputClassRec, *XF86ConfInputClassPtr; typedef struct { GenericListRec list; char *identifier; char *driver; struct xorg_list match_driver; char *comment; } XF86ConfOutputClassRec, *XF86ConfOutputClassPtr; /* Values for adj_where */ #define CONF_ADJ_OBSOLETE -1 #define CONF_ADJ_ABSOLUTE 0 #define CONF_ADJ_RIGHTOF 1 #define CONF_ADJ_LEFTOF 2 #define CONF_ADJ_ABOVE 3 #define CONF_ADJ_BELOW 4 #define CONF_ADJ_RELATIVE 5 typedef struct { GenericListRec list; int adj_scrnum; XF86ConfScreenPtr adj_screen; const char *adj_screen_str; XF86ConfScreenPtr adj_top; const char *adj_top_str; XF86ConfScreenPtr adj_bottom; const char *adj_bottom_str; XF86ConfScreenPtr adj_left; const char *adj_left_str; XF86ConfScreenPtr adj_right; const char *adj_right_str; int adj_where; int adj_x; int adj_y; const char *adj_refscreen; } XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr; typedef struct { GenericListRec list; const char *inactive_device_str; XF86ConfDevicePtr inactive_device; } XF86ConfInactiveRec, *XF86ConfInactivePtr; typedef struct { GenericListRec list; const char *lay_identifier; XF86ConfAdjacencyPtr lay_adjacency_lst; XF86ConfInactivePtr lay_inactive_lst; XF86ConfInputrefPtr lay_input_lst; XF86OptionPtr lay_option_lst; char *match_seat; char *lay_comment; } XF86ConfLayoutRec, *XF86ConfLayoutPtr; typedef struct { GenericListRec list; const char *vs_name; const char *vs_identifier; XF86OptionPtr vs_option_lst; char *vs_comment; } XF86ConfVendSubRec, *XF86ConfVendSubPtr; typedef struct { GenericListRec list; const char *vnd_identifier; XF86OptionPtr vnd_option_lst; XF86ConfVendSubPtr vnd_sub_lst; char *vnd_comment; } XF86ConfVendorRec, *XF86ConfVendorPtr; typedef struct { const char *dri_group_name; int dri_group; int dri_mode; char *dri_comment; } XF86ConfDRIRec, *XF86ConfDRIPtr; typedef struct { XF86OptionPtr ext_option_lst; char *extensions_comment; } XF86ConfExtensionsRec, *XF86ConfExtensionsPtr; typedef struct { XF86ConfFilesPtr conf_files; XF86ConfModulePtr conf_modules; XF86ConfFlagsPtr conf_flags; XF86ConfVideoAdaptorPtr conf_videoadaptor_lst; XF86ConfModesPtr conf_modes_lst; XF86ConfMonitorPtr conf_monitor_lst; XF86ConfDevicePtr conf_device_lst; XF86ConfScreenPtr conf_screen_lst; XF86ConfInputPtr conf_input_lst; XF86ConfInputClassPtr conf_inputclass_lst; XF86ConfOutputClassPtr conf_outputclass_lst; XF86ConfLayoutPtr conf_layout_lst; XF86ConfVendorPtr conf_vendor_lst; XF86ConfDRIPtr conf_dri; XF86ConfExtensionsPtr conf_extensions; char *conf_comment; } XF86ConfigRec, *XF86ConfigPtr; typedef struct { int token; /* id of the token */ const char *name; /* pointer to the LOWERCASED name */ } xf86ConfigSymTabRec, *xf86ConfigSymTabPtr; /* * prototypes for public functions */ extern void xf86initConfigFiles(void); extern char *xf86openConfigFile(const char *path, const char *cmdline, const char *projroot); extern char *xf86openConfigDirFiles(const char *path, const char *cmdline, const char *projroot); extern void xf86setBuiltinConfig(const char *config[]); extern XF86ConfigPtr xf86readConfigFile(void); extern void xf86closeConfigFile(void); extern void xf86freeConfig(XF86ConfigPtr p); extern int xf86writeConfigFile(const char *, XF86ConfigPtr); extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p); extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list); extern _X_EXPORT XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p); extern _X_EXPORT XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p); extern _X_EXPORT XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p); extern _X_EXPORT XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p); extern _X_EXPORT XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p); extern _X_EXPORT XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p); extern _X_EXPORT XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident, XF86ConfVideoAdaptorPtr p); extern int xf86layoutAddInputDevices(XF86ConfigPtr config, XF86ConfLayoutPtr layout); extern _X_EXPORT GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new); extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2); extern _X_EXPORT int xf86pathIsAbsolute(const char *path); extern _X_EXPORT int xf86pathIsSafe(const char *path); extern _X_EXPORT char *xf86addComment(char *cur, const char *add); extern _X_EXPORT Bool xf86getBoolValue(Bool *val, const char *str); #endif /* _xf86Parser_h_ */ xorg-server-1.17.1/hw/xfree86/parser/Pointer.c0000664000175100017510000002145512456571574016025 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" #include "Xprintf.h" static xf86ConfigSymTabRec PointerTab[] = { {PROTOCOL, "protocol"}, {EMULATE3, "emulate3buttons"}, {EM3TIMEOUT, "emulate3timeout"}, {ENDSUBSECTION, "endsubsection"}, {ENDSECTION, "endsection"}, {PDEVICE, "device"}, {PDEVICE, "port"}, {BAUDRATE, "baudrate"}, {SAMPLERATE, "samplerate"}, {CLEARDTR, "cleardtr"}, {CLEARRTS, "clearrts"}, {CHORDMIDDLE, "chordmiddle"}, {PRESOLUTION, "resolution"}, {DEVICE_NAME, "devicename"}, {ALWAYSCORE, "alwayscore"}, {PBUTTONS, "buttons"}, {ZAXISMAPPING, "zaxismapping"}, {-1, ""}, }; static xf86ConfigSymTabRec ZMapTab[] = { {XAXIS, "x"}, {YAXIS, "y"}, {-1, ""}, }; #define CLEANUP xf86freeInputList XF86ConfInputPtr xf86parsePointerSection(void) { char *s; unsigned long val1; int token; parsePrologue(XF86ConfInputPtr, XF86ConfInputRec) while ((token = xf86getToken(PointerTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->inp_comment = xf86addComment(ptr->inp_comment, xf86_lex_val.str); break; case PROTOCOL: if (xf86getSubToken(&(ptr->inp_comment)) != STRING) Error(QUOTE_MSG, "Protocol"); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("Protocol"), xf86_lex_val.str); break; case PDEVICE: if (xf86getSubToken(&(ptr->inp_comment)) != STRING) Error(QUOTE_MSG, "Device"); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("Device"), xf86_lex_val.str); break; case EMULATE3: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("Emulate3Buttons"), NULL); break; case EM3TIMEOUT: if (xf86getSubToken(&(ptr->inp_comment)) != NUMBER || xf86_lex_val.num < 0) Error(POSITIVE_INT_MSG, "Emulate3Timeout"); s = xf86uLongToString(xf86_lex_val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("Emulate3Timeout"), s); break; case CHORDMIDDLE: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("ChordMiddle"), NULL); break; case PBUTTONS: if (xf86getSubToken(&(ptr->inp_comment)) != NUMBER || xf86_lex_val.num < 0) Error(POSITIVE_INT_MSG, "Buttons"); s = xf86uLongToString(xf86_lex_val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("Buttons"), s); break; case BAUDRATE: if (xf86getSubToken(&(ptr->inp_comment)) != NUMBER || xf86_lex_val.num < 0) Error(POSITIVE_INT_MSG, "BaudRate"); s = xf86uLongToString(xf86_lex_val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("BaudRate"), s); break; case SAMPLERATE: if (xf86getSubToken(&(ptr->inp_comment)) != NUMBER || xf86_lex_val.num < 0) Error(POSITIVE_INT_MSG, "SampleRate"); s = xf86uLongToString(xf86_lex_val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("SampleRate"), s); break; case PRESOLUTION: if (xf86getSubToken(&(ptr->inp_comment)) != NUMBER || xf86_lex_val.num < 0) Error(POSITIVE_INT_MSG, "Resolution"); s = xf86uLongToString(xf86_lex_val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("Resolution"), s); break; case CLEARDTR: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("ClearDTR"), NULL); break; case CLEARRTS: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("ClearRTS"), NULL); break; case ZAXISMAPPING: switch (xf86getToken(ZMapTab)) { case NUMBER: if (xf86_lex_val.num < 0) Error(ZAXISMAPPING_MSG); val1 = xf86_lex_val.num; if (xf86getSubToken(&(ptr->inp_comment)) != NUMBER || xf86_lex_val.num < 0) { Error(ZAXISMAPPING_MSG); } if (asprintf(&s, "%lu %u", val1, xf86_lex_val.num) == -1) s = NULL; break; case XAXIS: s = strdup("x"); break; case YAXIS: s = strdup("y"); break; default: Error(ZAXISMAPPING_MSG); break; } ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("ZAxisMapping"), s); break; case ALWAYSCORE: break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } ptr->inp_identifier = strdup(CONF_IMPLICIT_POINTER); ptr->inp_driver = strdup("mouse"); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, strdup("CorePointer"), NULL); #ifdef DEBUG printf("Pointer section parsed\n"); #endif return ptr; } #undef CLEANUP xorg-server-1.17.1/hw/xfree86/parser/Screen.c0000664000175100017510000004556312456571574015632 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec DisplayTab[] = { {ENDSUBSECTION, "endsubsection"}, {MODES, "modes"}, {VIEWPORT, "viewport"}, {VIRTUAL, "virtual"}, {VISUAL, "visual"}, {BLACK_TOK, "black"}, {WHITE_TOK, "white"}, {DEPTH, "depth"}, {BPP, "fbbpp"}, {WEIGHT, "weight"}, {OPTION, "option"}, {-1, ""}, }; #define CLEANUP xf86freeDisplayList static XF86ConfDisplayPtr xf86parseDisplaySubSection(void) { int token; parsePrologue(XF86ConfDisplayPtr, XF86ConfDisplayRec) ptr->disp_black.red = ptr->disp_black.green = ptr->disp_black.blue = -1; ptr->disp_white.red = ptr->disp_white.green = ptr->disp_white.blue = -1; ptr->disp_frameX0 = ptr->disp_frameY0 = -1; while ((token = xf86getToken(DisplayTab)) != ENDSUBSECTION) { switch (token) { case COMMENT: ptr->disp_comment = xf86addComment(ptr->disp_comment, xf86_lex_val.str); break; case VIEWPORT: if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(VIEWPORT_MSG); ptr->disp_frameX0 = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(VIEWPORT_MSG); ptr->disp_frameY0 = xf86_lex_val.num; break; case VIRTUAL: if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(VIRTUAL_MSG); ptr->disp_virtualX = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(VIRTUAL_MSG); ptr->disp_virtualY = xf86_lex_val.num; break; case DEPTH: if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(NUMBER_MSG, "Display"); ptr->disp_depth = xf86_lex_val.num; break; case BPP: if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(NUMBER_MSG, "Display"); ptr->disp_bpp = xf86_lex_val.num; break; case VISUAL: if (xf86getSubToken(&(ptr->disp_comment)) != STRING) Error(QUOTE_MSG, "Display"); ptr->disp_visual = xf86_lex_val.str; break; case WEIGHT: if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(WEIGHT_MSG); ptr->disp_weight.red = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(WEIGHT_MSG); ptr->disp_weight.green = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(WEIGHT_MSG); ptr->disp_weight.blue = xf86_lex_val.num; break; case BLACK_TOK: if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(BLACK_MSG); ptr->disp_black.red = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(BLACK_MSG); ptr->disp_black.green = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(BLACK_MSG); ptr->disp_black.blue = xf86_lex_val.num; break; case WHITE_TOK: if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(WHITE_MSG); ptr->disp_white.red = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(WHITE_MSG); ptr->disp_white.green = xf86_lex_val.num; if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER) Error(WHITE_MSG); ptr->disp_white.blue = xf86_lex_val.num; break; case MODES: { XF86ModePtr mptr; while ((token = xf86getSubTokenWithTab(&(ptr->disp_comment), DisplayTab)) == STRING) { mptr = calloc(1, sizeof(XF86ModeRec)); mptr->mode_name = xf86_lex_val.str; mptr->list.next = NULL; ptr->disp_mode_lst = (XF86ModePtr) xf86addListItem((glp) ptr->disp_mode_lst, (glp) mptr); } xf86unGetToken(token); } break; case OPTION: ptr->disp_option_lst = xf86parseOption(ptr->disp_option_lst); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG printf("Display subsection parsed\n"); #endif return ptr; } #undef CLEANUP static xf86ConfigSymTabRec ScreenTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {MATCHSEAT, "matchseat"}, {OBSDRIVER, "driver"}, {MDEVICE, "device"}, {MONITOR, "monitor"}, {VIDEOADAPTOR, "videoadaptor"}, {SCREENNO, "screenno"}, {SUBSECTION, "subsection"}, {DEFAULTDEPTH, "defaultcolordepth"}, {DEFAULTDEPTH, "defaultdepth"}, {DEFAULTBPP, "defaultbpp"}, {DEFAULTFBBPP, "defaultfbbpp"}, {VIRTUAL, "virtual"}, {OPTION, "option"}, {-1, ""}, }; #define CLEANUP xf86freeScreenList XF86ConfScreenPtr xf86parseScreenSection(void) { int has_ident = FALSE; int has_driver = FALSE; int token; parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec) while ((token = xf86getToken(ScreenTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->scrn_comment = xf86addComment(ptr->scrn_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->scrn_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); ptr->scrn_identifier = xf86_lex_val.str; if (has_ident || has_driver) Error(ONLY_ONE_MSG, "Identifier or Driver"); has_ident = TRUE; break; case MATCHSEAT: if (xf86getSubToken(&(ptr->scrn_comment)) != STRING) Error(QUOTE_MSG, "MatchSeat"); ptr->match_seat = xf86_lex_val.str; break; case OBSDRIVER: if (xf86getSubToken(&(ptr->scrn_comment)) != STRING) Error(QUOTE_MSG, "Driver"); ptr->scrn_obso_driver = xf86_lex_val.str; if (has_ident || has_driver) Error(ONLY_ONE_MSG, "Identifier or Driver"); has_driver = TRUE; break; case DEFAULTDEPTH: if (xf86getSubToken(&(ptr->scrn_comment)) != NUMBER) Error(NUMBER_MSG, "DefaultDepth"); ptr->scrn_defaultdepth = xf86_lex_val.num; break; case DEFAULTBPP: if (xf86getSubToken(&(ptr->scrn_comment)) != NUMBER) Error(NUMBER_MSG, "DefaultBPP"); ptr->scrn_defaultbpp = xf86_lex_val.num; break; case DEFAULTFBBPP: if (xf86getSubToken(&(ptr->scrn_comment)) != NUMBER) Error(NUMBER_MSG, "DefaultFbBPP"); ptr->scrn_defaultfbbpp = xf86_lex_val.num; break; case MDEVICE: if (xf86getSubToken(&(ptr->scrn_comment)) != STRING) Error(QUOTE_MSG, "Device"); ptr->scrn_device_str = xf86_lex_val.str; break; case MONITOR: if (xf86getSubToken(&(ptr->scrn_comment)) != STRING) Error(QUOTE_MSG, "Monitor"); ptr->scrn_monitor_str = xf86_lex_val.str; break; case VIDEOADAPTOR: { XF86ConfAdaptorLinkPtr aptr; if (xf86getSubToken(&(ptr->scrn_comment)) != STRING) Error(QUOTE_MSG, "VideoAdaptor"); /* Don't allow duplicates */ for (aptr = ptr->scrn_adaptor_lst; aptr; aptr = (XF86ConfAdaptorLinkPtr) aptr->list.next) if (xf86nameCompare(xf86_lex_val.str, aptr->al_adaptor_str) == 0) break; if (aptr == NULL) { aptr = calloc(1, sizeof(XF86ConfAdaptorLinkRec)); aptr->list.next = NULL; aptr->al_adaptor_str = xf86_lex_val.str; ptr->scrn_adaptor_lst = (XF86ConfAdaptorLinkPtr) xf86addListItem((glp) ptr->scrn_adaptor_lst, (glp) aptr); } } break; case VIRTUAL: if (xf86getSubToken(&(ptr->scrn_comment)) != NUMBER) Error(VIRTUAL_MSG); ptr->scrn_virtualX = xf86_lex_val.num; if (xf86getSubToken(&(ptr->scrn_comment)) != NUMBER) Error(VIRTUAL_MSG); ptr->scrn_virtualY = xf86_lex_val.num; break; case OPTION: ptr->scrn_option_lst = xf86parseOption(ptr->scrn_option_lst); break; case SUBSECTION: if (xf86getSubToken(&(ptr->scrn_comment)) != STRING) Error(QUOTE_MSG, "SubSection"); { free(xf86_lex_val.str); HANDLE_LIST(scrn_display_lst, xf86parseDisplaySubSection, XF86ConfDisplayPtr); } break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident && !has_driver) Error(NO_IDENT_MSG); #ifdef DEBUG printf("Screen section parsed\n"); #endif return ptr; } void xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr) { XF86ConfAdaptorLinkPtr aptr; XF86ConfDisplayPtr dptr; XF86ModePtr mptr; while (ptr) { fprintf(cf, "Section \"Screen\"\n"); if (ptr->scrn_comment) fprintf(cf, "%s", ptr->scrn_comment); if (ptr->scrn_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->scrn_identifier); if (ptr->scrn_obso_driver) fprintf(cf, "\tDriver \"%s\"\n", ptr->scrn_obso_driver); if (ptr->scrn_device_str) fprintf(cf, "\tDevice \"%s\"\n", ptr->scrn_device_str); if (ptr->scrn_monitor_str) fprintf(cf, "\tMonitor \"%s\"\n", ptr->scrn_monitor_str); if (ptr->scrn_defaultdepth) fprintf(cf, "\tDefaultDepth %d\n", ptr->scrn_defaultdepth); if (ptr->scrn_defaultbpp) fprintf(cf, "\tDefaultBPP %d\n", ptr->scrn_defaultbpp); if (ptr->scrn_defaultfbbpp) fprintf(cf, "\tDefaultFbBPP %d\n", ptr->scrn_defaultfbbpp); xf86printOptionList(cf, ptr->scrn_option_lst, 1); for (aptr = ptr->scrn_adaptor_lst; aptr; aptr = aptr->list.next) { fprintf(cf, "\tVideoAdaptor \"%s\"\n", aptr->al_adaptor_str); } if (ptr->scrn_virtualX && ptr->scrn_virtualY) fprintf(cf, "\tVirtual %d %d\n", ptr->scrn_virtualX, ptr->scrn_virtualY); for (dptr = ptr->scrn_display_lst; dptr; dptr = dptr->list.next) { fprintf(cf, "\tSubSection \"Display\"\n"); if (dptr->disp_comment) fprintf(cf, "%s", dptr->disp_comment); if (dptr->disp_frameX0 >= 0 || dptr->disp_frameY0 >= 0) { fprintf(cf, "\t\tViewport %d %d\n", dptr->disp_frameX0, dptr->disp_frameY0); } if (dptr->disp_virtualX != 0 || dptr->disp_virtualY != 0) { fprintf(cf, "\t\tVirtual %d %d\n", dptr->disp_virtualX, dptr->disp_virtualY); } if (dptr->disp_depth) { fprintf(cf, "\t\tDepth %d\n", dptr->disp_depth); } if (dptr->disp_bpp) { fprintf(cf, "\t\tFbBPP %d\n", dptr->disp_bpp); } if (dptr->disp_visual) { fprintf(cf, "\t\tVisual \"%s\"\n", dptr->disp_visual); } if (dptr->disp_weight.red != 0) { fprintf(cf, "\t\tWeight %d %d %d\n", dptr->disp_weight.red, dptr->disp_weight.green, dptr->disp_weight.blue); } if (dptr->disp_black.red != -1) { fprintf(cf, "\t\tBlack 0x%04x 0x%04x 0x%04x\n", dptr->disp_black.red, dptr->disp_black.green, dptr->disp_black.blue); } if (dptr->disp_white.red != -1) { fprintf(cf, "\t\tWhite 0x%04x 0x%04x 0x%04x\n", dptr->disp_white.red, dptr->disp_white.green, dptr->disp_white.blue); } if (dptr->disp_mode_lst) { fprintf(cf, "\t\tModes "); } for (mptr = dptr->disp_mode_lst; mptr; mptr = mptr->list.next) { fprintf(cf, " \"%s\"", mptr->mode_name); } if (dptr->disp_mode_lst) { fprintf(cf, "\n"); } xf86printOptionList(cf, dptr->disp_option_lst, 2); fprintf(cf, "\tEndSubSection\n"); } fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } void xf86freeScreenList(XF86ConfScreenPtr ptr) { XF86ConfScreenPtr prev; while (ptr) { TestFree(ptr->scrn_identifier); TestFree(ptr->scrn_monitor_str); TestFree(ptr->scrn_device_str); TestFree(ptr->scrn_comment); xf86optionListFree(ptr->scrn_option_lst); xf86freeAdaptorLinkList(ptr->scrn_adaptor_lst); xf86freeDisplayList(ptr->scrn_display_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr) { XF86ConfAdaptorLinkPtr prev; while (ptr) { TestFree(ptr->al_adaptor_str); prev = ptr; ptr = ptr->list.next; free(prev); } } void xf86freeDisplayList(XF86ConfDisplayPtr ptr) { XF86ConfDisplayPtr prev; while (ptr) { xf86freeModeList(ptr->disp_mode_lst); xf86optionListFree(ptr->disp_option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } void xf86freeModeList(XF86ModePtr ptr) { XF86ModePtr prev; while (ptr) { TestFree(ptr->mode_name); prev = ptr; ptr = ptr->list.next; free(prev); } } int xf86validateScreen(XF86ConfigPtr p) { XF86ConfScreenPtr screen = p->conf_screen_lst; XF86ConfMonitorPtr monitor; XF86ConfAdaptorLinkPtr adaptor; while (screen) { if (screen->scrn_obso_driver && !screen->scrn_identifier) screen->scrn_identifier = screen->scrn_obso_driver; monitor = xf86findMonitor(screen->scrn_monitor_str, p->conf_monitor_lst); if (screen->scrn_monitor_str) { if (monitor) { screen->scrn_monitor = monitor; if (!xf86validateMonitor(p, screen)) return FALSE; } } screen->scrn_device = xf86findDevice(screen->scrn_device_str, p->conf_device_lst); adaptor = screen->scrn_adaptor_lst; while (adaptor) { adaptor->al_adaptor = xf86findVideoAdaptor(adaptor->al_adaptor_str, p->conf_videoadaptor_lst); if (!adaptor->al_adaptor) { xf86validationError(UNDEFINED_ADAPTOR_MSG, adaptor->al_adaptor_str, screen->scrn_identifier); return FALSE; } else if (adaptor->al_adaptor->va_fwdref) { xf86validationError(ADAPTOR_REF_TWICE_MSG, adaptor->al_adaptor_str, adaptor->al_adaptor->va_fwdref); return FALSE; } adaptor->al_adaptor->va_fwdref = strdup(screen->scrn_identifier); adaptor = adaptor->list.next; } screen = screen->list.next; } return TRUE; } XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p) { while (p) { if (xf86nameCompare(ident, p->scrn_identifier) == 0) return p; p = p->list.next; } return NULL; } xorg-server-1.17.1/hw/xfree86/parser/xf86tokens.h0000664000175100017510000001456512456571574016435 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _xf86_tokens_h #define _xf86_tokens_h /* Undefine symbols that some OSs might define */ #undef IOBASE /* * Each token should have a unique value regardless of the section * it is used in. */ typedef enum { /* errno-style tokens */ OBSOLETE_TOKEN = -5, EOF_TOKEN = -4, LOCK_TOKEN = -3, ERROR_TOKEN = -2, /* value type tokens */ NUMBER = 1, STRING, /* Tokens that can appear in many sections */ SECTION, SUBSECTION, ENDSECTION, ENDSUBSECTION, IDENTIFIER, VENDOR, DASH, COMMA, MATCHSEAT, OPTION, COMMENT, /* Frequency units */ HRZ, KHZ, MHZ, /* File tokens */ FONTPATH, MODULEPATH, LOGFILEPATH, XKBDIR, /* Server Flag tokens. These are deprecated in favour of generic Options */ NOTRAPSIGNALS, DONTZAP, DONTZOOM, DISABLEVIDMODE, ALLOWNONLOCAL, DISABLEMODINDEV, MODINDEVALLOWNONLOCAL, ALLOWMOUSEOPENFAIL, BLANKTIME, STANDBYTIME, SUSPENDTIME, OFFTIME, DEFAULTLAYOUT, /* Monitor tokens */ MODEL, MODELINE, DISPLAYSIZE, HORIZSYNC, VERTREFRESH, MODE, GAMMA, USEMODES, /* Modes tokens */ /* no new ones */ /* Mode tokens */ DOTCLOCK, HTIMINGS, VTIMINGS, FLAGS, HSKEW, BCAST, VSCAN, ENDMODE, /* Screen tokens */ OBSDRIVER, MDEVICE, MONITOR, SCREENNO, DEFAULTDEPTH, DEFAULTBPP, DEFAULTFBBPP, /* VideoAdaptor tokens */ VIDEOADAPTOR, /* Mode timing tokens */ TT_INTERLACE, TT_PHSYNC, TT_NHSYNC, TT_PVSYNC, TT_NVSYNC, TT_CSYNC, TT_PCSYNC, TT_NCSYNC, TT_DBLSCAN, TT_HSKEW, TT_BCAST, TT_VSCAN, /* Module tokens */ LOAD, LOAD_DRIVER, DISABLE, /* Device tokens */ DRIVER, CHIPSET, CLOCKS, VIDEORAM, BOARD, IOBASE, RAMDAC, DACSPEED, BIOSBASE, MEMBASE, CLOCKCHIP, CHIPID, CHIPREV, CARD, BUSID, IRQ, /* Keyboard tokens */ AUTOREPEAT, XLEDS, KPROTOCOL, XKBKEYMAP, XKBCOMPAT, XKBTYPES, XKBKEYCODES, XKBGEOMETRY, XKBSYMBOLS, XKBDISABLE, PANIX106, XKBRULES, XKBMODEL, XKBLAYOUT, XKBVARIANT, XKBOPTIONS, /* Obsolete keyboard tokens */ SERVERNUM, LEFTALT, RIGHTALT, SCROLLLOCK_TOK, RIGHTCTL, /* arguments for the above obsolete tokens */ CONF_KM_META, CONF_KM_COMPOSE, CONF_KM_MODESHIFT, CONF_KM_MODELOCK, CONF_KM_SCROLLLOCK, CONF_KM_CONTROL, /* Pointer tokens */ EMULATE3, BAUDRATE, SAMPLERATE, PRESOLUTION, CLEARDTR, CLEARRTS, CHORDMIDDLE, PROTOCOL, PDEVICE, EM3TIMEOUT, DEVICE_NAME, ALWAYSCORE, PBUTTONS, ZAXISMAPPING, /* Pointer Z axis mapping tokens */ XAXIS, YAXIS, /* Display tokens */ MODES, VIEWPORT, VIRTUAL, VISUAL, BLACK_TOK, WHITE_TOK, DEPTH, BPP, WEIGHT, /* Layout Tokens */ SCREEN, INACTIVE, INPUTDEVICE, /* Adjaceny Tokens */ RIGHTOF, LEFTOF, ABOVE, BELOW, RELATIVE, ABSOLUTE, /* Vendor Tokens */ VENDORNAME, /* DRI Tokens */ GROUP, /* InputClass Tokens */ MATCH_PRODUCT, MATCH_VENDOR, MATCH_DEVICE_PATH, MATCH_OS, MATCH_PNPID, MATCH_USBID, MATCH_DRIVER, MATCH_TAG, MATCH_LAYOUT, MATCH_IS_KEYBOARD, MATCH_IS_POINTER, MATCH_IS_JOYSTICK, MATCH_IS_TABLET, MATCH_IS_TOUCHPAD, MATCH_IS_TOUCHSCREEN } ParserTokens; #endif /* _xf86_tokens_h */ xorg-server-1.17.1/hw/xfree86/parser/Layout.c0000664000175100017510000004337112456571574015663 00000000000000/* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" #include #include "optionstr.h" /* Needed for auto server layout */ extern int xf86CheckBoolOption(void *optlist, const char *name, int deflt); static xf86ConfigSymTabRec LayoutTab[] = { {ENDSECTION, "endsection"}, {SCREEN, "screen"}, {IDENTIFIER, "identifier"}, {MATCHSEAT, "matchseat"}, {INACTIVE, "inactive"}, {INPUTDEVICE, "inputdevice"}, {OPTION, "option"}, {-1, ""}, }; static xf86ConfigSymTabRec AdjTab[] = { {RIGHTOF, "rightof"}, {LEFTOF, "leftof"}, {ABOVE, "above"}, {BELOW, "below"}, {RELATIVE, "relative"}, {ABSOLUTE, "absolute"}, {-1, ""}, }; #define CLEANUP xf86freeLayoutList XF86ConfLayoutPtr xf86parseLayoutSection(void) { int has_ident = FALSE; int token; parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec) while ((token = xf86getToken(LayoutTab)) != ENDSECTION) { switch (token) { case COMMENT: ptr->lay_comment = xf86addComment(ptr->lay_comment, xf86_lex_val.str); break; case IDENTIFIER: if (xf86getSubToken(&(ptr->lay_comment)) != STRING) Error(QUOTE_MSG, "Identifier"); if (has_ident == TRUE) Error(MULTIPLE_MSG, "Identifier"); ptr->lay_identifier = xf86_lex_val.str; has_ident = TRUE; break; case MATCHSEAT: if (xf86getSubToken(&(ptr->lay_comment)) != STRING) Error(QUOTE_MSG, "MatchSeat"); ptr->match_seat = xf86_lex_val.str; break; case INACTIVE: { XF86ConfInactivePtr iptr; iptr = calloc(1, sizeof(XF86ConfInactiveRec)); iptr->list.next = NULL; if (xf86getSubToken(&(ptr->lay_comment)) != STRING) { free(iptr); Error(INACTIVE_MSG); } iptr->inactive_device_str = xf86_lex_val.str; ptr->lay_inactive_lst = (XF86ConfInactivePtr) xf86addListItem((glp) ptr->lay_inactive_lst, (glp) iptr); } break; case SCREEN: { XF86ConfAdjacencyPtr aptr; int absKeyword = 0; aptr = calloc(1, sizeof(XF86ConfAdjacencyRec)); aptr->list.next = NULL; aptr->adj_scrnum = -1; aptr->adj_where = CONF_ADJ_OBSOLETE; aptr->adj_x = 0; aptr->adj_y = 0; aptr->adj_refscreen = NULL; if ((token = xf86getSubToken(&(ptr->lay_comment))) == NUMBER) aptr->adj_scrnum = xf86_lex_val.num; else xf86unGetToken(token); token = xf86getSubToken(&(ptr->lay_comment)); if (token != STRING) { free(aptr); Error(SCREEN_MSG); } aptr->adj_screen_str = xf86_lex_val.str; token = xf86getSubTokenWithTab(&(ptr->lay_comment), AdjTab); switch (token) { case RIGHTOF: aptr->adj_where = CONF_ADJ_RIGHTOF; break; case LEFTOF: aptr->adj_where = CONF_ADJ_LEFTOF; break; case ABOVE: aptr->adj_where = CONF_ADJ_ABOVE; break; case BELOW: aptr->adj_where = CONF_ADJ_BELOW; break; case RELATIVE: aptr->adj_where = CONF_ADJ_RELATIVE; break; case ABSOLUTE: aptr->adj_where = CONF_ADJ_ABSOLUTE; absKeyword = 1; break; case EOF_TOKEN: free(aptr); Error(UNEXPECTED_EOF_MSG); break; default: xf86unGetToken(token); token = xf86getSubToken(&(ptr->lay_comment)); if (token == STRING) aptr->adj_where = CONF_ADJ_OBSOLETE; else aptr->adj_where = CONF_ADJ_ABSOLUTE; } switch (aptr->adj_where) { case CONF_ADJ_ABSOLUTE: if (absKeyword) token = xf86getSubToken(&(ptr->lay_comment)); if (token == NUMBER) { aptr->adj_x = xf86_lex_val.num; token = xf86getSubToken(&(ptr->lay_comment)); if (token != NUMBER) { free(aptr); Error(INVALID_SCR_MSG); } aptr->adj_y = xf86_lex_val.num; } else { if (absKeyword) { free(aptr); Error(INVALID_SCR_MSG); } else xf86unGetToken(token); } break; case CONF_ADJ_RIGHTOF: case CONF_ADJ_LEFTOF: case CONF_ADJ_ABOVE: case CONF_ADJ_BELOW: case CONF_ADJ_RELATIVE: token = xf86getSubToken(&(ptr->lay_comment)); if (token != STRING) { free(aptr); Error(INVALID_SCR_MSG); } aptr->adj_refscreen = xf86_lex_val.str; if (aptr->adj_where == CONF_ADJ_RELATIVE) { token = xf86getSubToken(&(ptr->lay_comment)); if (token != NUMBER) { free(aptr); Error(INVALID_SCR_MSG); } aptr->adj_x = xf86_lex_val.num; token = xf86getSubToken(&(ptr->lay_comment)); if (token != NUMBER) { free(aptr); Error(INVALID_SCR_MSG); } aptr->adj_y = xf86_lex_val.num; } break; case CONF_ADJ_OBSOLETE: /* top */ aptr->adj_top_str = xf86_lex_val.str; /* bottom */ if (xf86getSubToken(&(ptr->lay_comment)) != STRING) { free(aptr); Error(SCREEN_MSG); } aptr->adj_bottom_str = xf86_lex_val.str; /* left */ if (xf86getSubToken(&(ptr->lay_comment)) != STRING) { free(aptr); Error(SCREEN_MSG); } aptr->adj_left_str = xf86_lex_val.str; /* right */ if (xf86getSubToken(&(ptr->lay_comment)) != STRING) { free(aptr); Error(SCREEN_MSG); } aptr->adj_right_str = xf86_lex_val.str; } ptr->lay_adjacency_lst = (XF86ConfAdjacencyPtr) xf86addListItem((glp) ptr->lay_adjacency_lst, (glp) aptr); } break; case INPUTDEVICE: { XF86ConfInputrefPtr iptr; iptr = calloc(1, sizeof(XF86ConfInputrefRec)); iptr->list.next = NULL; iptr->iref_option_lst = NULL; if (xf86getSubToken(&(ptr->lay_comment)) != STRING) { free(iptr); Error(INPUTDEV_MSG); } iptr->iref_inputdev_str = xf86_lex_val.str; while ((token = xf86getSubToken(&(ptr->lay_comment))) == STRING) { iptr->iref_option_lst = xf86addNewOption(iptr->iref_option_lst, xf86_lex_val.str, NULL); } xf86unGetToken(token); ptr->lay_input_lst = (XF86ConfInputrefPtr) xf86addListItem((glp) ptr->lay_input_lst, (glp) iptr); } break; case OPTION: ptr->lay_option_lst = xf86parseOption(ptr->lay_option_lst); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } if (!has_ident) Error(NO_IDENT_MSG); #ifdef DEBUG printf("Layout section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printLayoutSection(FILE * cf, XF86ConfLayoutPtr ptr) { XF86ConfAdjacencyPtr aptr; XF86ConfInactivePtr iptr; XF86ConfInputrefPtr inptr; XF86OptionPtr optr; while (ptr) { fprintf(cf, "Section \"ServerLayout\"\n"); if (ptr->lay_comment) fprintf(cf, "%s", ptr->lay_comment); if (ptr->lay_identifier) fprintf(cf, "\tIdentifier \"%s\"\n", ptr->lay_identifier); for (aptr = ptr->lay_adjacency_lst; aptr; aptr = aptr->list.next) { fprintf(cf, "\tScreen "); if (aptr->adj_scrnum >= 0) fprintf(cf, "%2d", aptr->adj_scrnum); else fprintf(cf, " "); fprintf(cf, " \"%s\"", aptr->adj_screen_str); switch (aptr->adj_where) { case CONF_ADJ_OBSOLETE: fprintf(cf, " \"%s\"", aptr->adj_top_str); fprintf(cf, " \"%s\"", aptr->adj_bottom_str); fprintf(cf, " \"%s\"", aptr->adj_right_str); fprintf(cf, " \"%s\"\n", aptr->adj_left_str); break; case CONF_ADJ_ABSOLUTE: if (aptr->adj_x != -1) fprintf(cf, " %d %d\n", aptr->adj_x, aptr->adj_y); else fprintf(cf, "\n"); break; case CONF_ADJ_RIGHTOF: fprintf(cf, " RightOf \"%s\"\n", aptr->adj_refscreen); break; case CONF_ADJ_LEFTOF: fprintf(cf, " LeftOf \"%s\"\n", aptr->adj_refscreen); break; case CONF_ADJ_ABOVE: fprintf(cf, " Above \"%s\"\n", aptr->adj_refscreen); break; case CONF_ADJ_BELOW: fprintf(cf, " Below \"%s\"\n", aptr->adj_refscreen); break; case CONF_ADJ_RELATIVE: fprintf(cf, " Relative \"%s\" %d %d\n", aptr->adj_refscreen, aptr->adj_x, aptr->adj_y); break; } } for (iptr = ptr->lay_inactive_lst; iptr; iptr = iptr->list.next) fprintf(cf, "\tInactive \"%s\"\n", iptr->inactive_device_str); for (inptr = ptr->lay_input_lst; inptr; inptr = inptr->list.next) { fprintf(cf, "\tInputDevice \"%s\"", inptr->iref_inputdev_str); for (optr = inptr->iref_option_lst; optr; optr = optr->list.next) { fprintf(cf, " \"%s\"", optr->opt_name); } fprintf(cf, "\n"); } xf86printOptionList(cf, ptr->lay_option_lst, 1); fprintf(cf, "EndSection\n\n"); ptr = ptr->list.next; } } static void xf86freeAdjacencyList(XF86ConfAdjacencyPtr ptr) { XF86ConfAdjacencyPtr prev; while (ptr) { TestFree(ptr->adj_screen_str); TestFree(ptr->adj_top_str); TestFree(ptr->adj_bottom_str); TestFree(ptr->adj_left_str); TestFree(ptr->adj_right_str); prev = ptr; ptr = ptr->list.next; free(prev); } } static void xf86freeInputrefList(XF86ConfInputrefPtr ptr) { XF86ConfInputrefPtr prev; while (ptr) { TestFree(ptr->iref_inputdev_str); xf86optionListFree(ptr->iref_option_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } void xf86freeLayoutList(XF86ConfLayoutPtr ptr) { XF86ConfLayoutPtr prev; while (ptr) { TestFree(ptr->lay_identifier); TestFree(ptr->lay_comment); xf86freeAdjacencyList(ptr->lay_adjacency_lst); xf86freeInputrefList(ptr->lay_input_lst); prev = ptr; ptr = ptr->list.next; free(prev); } } int xf86layoutAddInputDevices(XF86ConfigPtr config, XF86ConfLayoutPtr layout) { int count = 0; XF86ConfInputPtr input = config->conf_input_lst; XF86ConfInputrefPtr inptr; /* add all AutoServerLayout devices to the server layout */ while (input) { if (xf86CheckBoolOption (input->inp_option_lst, "AutoServerLayout", FALSE)) { XF86ConfInputrefPtr iref = layout->lay_input_lst; /* avoid duplicates if referenced but lists AutoServerLayout too */ while (iref) { if (strcmp(iref->iref_inputdev_str, input->inp_identifier) == 0) break; iref = iref->list.next; } if (!iref) { XF86ConfInputrefPtr iptr; iptr = calloc(1, sizeof(XF86ConfInputrefRec)); iptr->iref_inputdev_str = input->inp_identifier; layout->lay_input_lst = (XF86ConfInputrefPtr) xf86addListItem((glp) layout->lay_input_lst, (glp) iptr); count++; } } input = input->list.next; } inptr = layout->lay_input_lst; while (inptr) { input = xf86findInput(inptr->iref_inputdev_str, config->conf_input_lst); if (!input) { xf86validationError(UNDEFINED_INPUT_MSG, inptr->iref_inputdev_str, layout->lay_identifier); return -1; } else inptr->iref_inputdev = input; inptr = inptr->list.next; } return count; } int xf86validateLayout(XF86ConfigPtr p) { XF86ConfLayoutPtr layout = p->conf_layout_lst; XF86ConfAdjacencyPtr adj; XF86ConfInactivePtr iptr; XF86ConfScreenPtr screen; XF86ConfDevicePtr device; while (layout) { adj = layout->lay_adjacency_lst; while (adj) { /* the first one can't be "" but all others can */ screen = xf86findScreen(adj->adj_screen_str, p->conf_screen_lst); if (!screen) { xf86validationError(UNDEFINED_SCREEN_MSG, adj->adj_screen_str, layout->lay_identifier); return FALSE; } else adj->adj_screen = screen; adj = adj->list.next; } iptr = layout->lay_inactive_lst; while (iptr) { device = xf86findDevice(iptr->inactive_device_str, p->conf_device_lst); if (!device) { xf86validationError(UNDEFINED_DEVICE_LAY_MSG, iptr->inactive_device_str, layout->lay_identifier); return FALSE; } else iptr->inactive_device = device; iptr = iptr->list.next; } if (xf86layoutAddInputDevices(p, layout) == -1) return FALSE; layout = layout->list.next; } return TRUE; } XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list) { while (list) { if (xf86nameCompare(list->lay_identifier, name) == 0) return list; list = list->list.next; } return NULL; } xorg-server-1.17.1/hw/xfree86/parser/Extensions.c0000664000175100017510000000561012366220413016516 00000000000000/* * Copyright 2004 Red Hat Inc., Raleigh, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" static xf86ConfigSymTabRec ExtensionsTab[] = { {ENDSECTION, "endsection"}, {OPTION, "option"}, {-1, ""}, }; #define CLEANUP xf86freeExtensions XF86ConfExtensionsPtr xf86parseExtensionsSection(void) { int token; parsePrologue(XF86ConfExtensionsPtr, XF86ConfExtensionsRec); while ((token = xf86getToken(ExtensionsTab)) != ENDSECTION) { switch (token) { case OPTION: ptr->ext_option_lst = xf86parseOption(ptr->ext_option_lst); break; case EOF_TOKEN: Error(UNEXPECTED_EOF_MSG); break; case COMMENT: ptr->extensions_comment = xf86addComment(ptr->extensions_comment, xf86_lex_val.str); break; default: Error(INVALID_KEYWORD_MSG, xf86tokenString()); break; } } #ifdef DEBUG ErrorF("Extensions section parsed\n"); #endif return ptr; } #undef CLEANUP void xf86printExtensionsSection(FILE * cf, XF86ConfExtensionsPtr ptr) { XF86OptionPtr p; if (ptr == NULL || ptr->ext_option_lst == NULL) return; p = ptr->ext_option_lst; fprintf(cf, "Section \"Extensions\"\n"); if (ptr->extensions_comment) fprintf(cf, "%s", ptr->extensions_comment); xf86printOptionList(cf, p, 1); fprintf(cf, "EndSection\n\n"); } void xf86freeExtensions(XF86ConfExtensionsPtr ptr) { if (ptr == NULL) return; xf86optionListFree(ptr->ext_option_lst); TestFree(ptr->extensions_comment); free(ptr); } xorg-server-1.17.1/hw/xfree86/Xorg.sh.in0000664000175100017510000000042712456571574014621 00000000000000#!/bin/sh # # Execute Xorg.wrap if it exists otherwise execute Xorg directly. # This allows distros to put the suid wrapper in a separate package. basedir=@SUID_WRAPPER_DIR@ if [ -x "$basedir"/Xorg.wrap ]; then exec "$basedir"/Xorg.wrap "$@" else exec "$basedir"/Xorg "$@" fi xorg-server-1.17.1/hw/xfree86/doc/0000775000175100017510000000000012466505445013556 500000000000000xorg-server-1.17.1/hw/xfree86/doc/Makefile.am0000664000175100017510000000050212160102336015506 00000000000000 if ENABLE_DEVEL_DOCS if HAVE_XMLTO # Main DocBook/XML files (DOCTYPE book) docbook = ddxDesign.xml # Generate DocBook/XML output formats with or without stylesheets include $(top_srcdir)/devbook.am endif HAVE_XMLTO endif ENABLE_DEVEL_DOCS EXTRA_DIST = \ Registry \ exa-driver.txt \ README.DRIcomp \ README.modes xorg-server-1.17.1/hw/xfree86/doc/ddxDesign.xml0000664000175100017510000120400412372525300016116 00000000000000 %xorg-defs; %defs; Device"> Monitor"> Display"> InputDevice"> Screen"> ServerLayout"> Driver"> Module"> Identifier"> ServerFlags"> ] >
XFree86 DDX Design The XFree86 Project The X.Org Foundation JimGettys Updates for X11R6.7 &xserver.reldate; X Version 11, Release &fullrelvers; X Server Version &xserver.version; This document describes software undergoing continual evolution, and the interfaces described here are subject to change without notice. This document is intended to cover the interfaces as found in the xorg-server-&xserver.version; release, but is probably not completely in sync with the code base. Preface This document was originally the design spec for the DDX layer of the XFree86 4.0 X server. The X.Org Foundation adopted the XFree86 4.4rc2 version of that server as the basis of the Xorg server project, and has evolved the XFree86 DDX layer greatly since forking. This document thus covers only the current implementation of the XFree86 DDX as found in the Xorg server &xserver.version; release, and no longer matches the XFree86 server itself. The XFree86 Project's broad design principles for XFree86 4.0 were: keep it reasonable We cannot rewrite the complete server We don't want to re-invent the wheel keep it modular As many things as possible should go into modules The basic loader binary should be minimal A clean design with well defined layering is important DDX specific global variables are a nono The structure should be flexible enough to allow future extensions The structure should minimize duplication of common code keep important features in mind multiple screens, including multiple instances of drivers mixing different color depths and visuals on different and ideally even on the same screen better control of the PCI device used better config file parser get rid of all VGA compatibility assumptions While the XFree86 project had a goal of avoiding changes to the DIX layer unless they found major deficiencies there, to avoid divergence from the X.Org sample implementation they were integrating changes from, the X.Org developers now maintain both sides, and make changes where they are most appropriate. This document concentrates on the XFree86 DDX layer used in the Xorg server itself (the code found in hw/xfree86 in the source tree), and developers will also want to refer to the Xserver-spec documentation that covers the DIX layer routines common to all the X servers in the sample implementation. The xorg.conf File The xorg.conf file format is based on the XF86Config format from XFree86 4.4, which is in turn similar to the old XFree86 3.x XF86Config format, with the following changes: &k.device; section The &k.device; sections are similar to what they used to be, and describe hardware-specific information for a single video card. &k.device; Some new keywords are added: Driver "drivername" Specifies the name of the driver to be used for the card. This is mandatory. BusID "busslot" Specifies uniquely the location of the card on the bus. The purpose is to identify particular cards in a multi-headed configuration. The format of the argument is intentionally vague, and may be architecture dependent. For a PCI bus, it is something like "bus:slot:func". A &k.device; section is considered active if there is a reference to it in an active &k.screen; section. &k.screen; section The &k.screen; sections are similar to what they used to be. They no longer have a &k.driver; keyword, but an &k.identifier; keyword is added. (The &k.driver; keyword may be accepted in place of the &k.identifier; keyword for compatibility purposes.) The identifier can be used to identify which screen is to be active when multiple &k.screen; sections are present. It is possible to specify the active screen from the command line. A default is chosen in the absence of one being specified. A &k.screen; section is considered active if there is a reference to it either from the command line, or from an active &k.serverlayout; section. &k.inputdevice; section The &k.inputdevice; section is a new section that describes configuration information for input devices. It replaces the old Keyboard, Pointer and XInput sections. Like the &k.device; section, it has two mandatory keywords: &k.identifier; and &k.driver;. For compatibility purposes the old Keyboard and Pointer sections are converted by the parser into &k.inputdevice; sections as follows: Keyboard &k.identifier; "Implicit Core Keyboard" &k.driver; "kbd" Pointer &k.identifier; "Implicit Core Pointer" &k.driver; "mouse" An &k.inputdevice; section is considered active if there is a reference to it in an active &k.serverlayout; section. An &k.inputdevice; section may also be referenced implicitly if there is no &k.serverlayout; section, if the command line options is used, or if the &k.serverlayout; section doesn't reference any &k.inputdevice; sections. In this case, the first sections with drivers "kbd" and "mouse" are used as the core keyboard and pointer respectively. &k.serverlayout; section The &k.serverlayout; section is a new section that is used to identify which &k.screen; sections are to be used in a multi-headed configuration, and the relative layout of those screens. It also identifies which &k.inputdevice; sections are to be used. Each &k.serverlayout; section has an identifier, a list of &k.screen; section identifiers, and a list of &k.inputdevice; section identifiers. &k.serverflags; options may also be included in a &k.serverlayout; section, making it possible to override the global values in the &k.serverflags; section. A &k.serverlayout; section can be made active by being referenced on the command line. In the absence of this, a default will be chosen (the first one found). The screen names may optionally be followed by a number specifying the preferred screen number, and optionally by information specifying the physical positioning of the screen, either in absolute terms or relative to another screen (or screens). When no screen number is specified, they are numbered according to the order in which they are listed. The old (now obsolete) method of providing the positioning information is to give the names of the four adjacent screens. The order of these is top, bottom, left, right. Here is an example of a &k.serverlayout; section for two screens using the old method, with the second located to the right of the first: Section "ServerLayout" Identifier "Main Layout" Screen 0 "Screen 1" "" "" "" "Screen 2" Screen 1 "Screen 2" Screen "Screen 3" EndSection The preferred way of specifying the layout is to explicitly specify the screen's location in absolute terms or relative to another screen. In the absolute case, the upper left corner's coordinates are given after the Absolute keyword. If the coordinates are omitted, a value of (0,0) is assumed. An example of absolute positioning follows: Section "ServerLayout" Identifier "Main Layout" Screen 0 "Screen 1" Absolute 0 0 Screen 1 "Screen 2" Absolute 1024 0 Screen "Screen 3" Absolute 2048 0 EndSection In the relative case, the position is specified by either using one of the following keywords followed by the name of the reference screen: RightOf LeftOf Above Below Relative When the Relative keyword is used, the reference screen name is followed by the coordinates of the new screen's origin relative to reference screen. The following example shows how to use some of the relative positioning options. Section "ServerLayout" Identifier "Main Layout" Screen 0 "Screen 1" Screen 1 "Screen 2" RightOf "Screen 1" Screen "Screen 3" Relative "Screen 1" 2048 0 EndSection Options Options are used more extensively. They may appear in most sections now. Options related to drivers can be present in the &k.screen;, &k.device; and &k.monitor; sections and the &k.display; subsections. The order of precedence is &k.display;, &k.screen;, &k.monitor;, &k.device;. Options have been extended to allow an optional value to be specified in addition to the option name. For more details about options, see the Options section for details. Driver Interface The driver interface consists of a minimal set of entry points that are required based on the external events that the driver must react to. No non-essential structure is imposed on the way they are used beyond 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. Extensions and enhancements to framebuffer code are outside the scope of this document. This approach to the driver interface provides good flexibility, but does increase the complexity of drivers. To help address this, the XFree86 common layer provides a set of helper functions to take care of things that most drivers need. These helpers help minimise the amount of code duplication between drivers. The use of helper functions by drivers is however optional, though encouraged. The basic philosophy behind the helper functions is that they should be useful to many drivers, that they should balance this against the complexity of their interface. It is inevitable that some drivers may find some helpers unsuitable and need to provide their own code. Events that a driver needs to react to are: ScreenInit An initialisation function is called from the DIX layer for each screen at the start of each server generation. Enter VT The server takes control of the console. Leave VT The server releases control of the console. Mode Switch Change video mode. ViewPort change Change the origin of the physical view port. ScreenSaver state change Screen saver activation/deactivation. CloseScreen A close screen function is called from the DIX layer for each screen at the end of each server generation. In addition to these events, the following functions are required by the XFree86 common layer: Identify Print a driver identifying message. Probe This is how a driver identifies if there is any hardware present that it knows how to drive. PreInit Process information from the xorg.conf file, determine the full characteristics of the hardware, and determine if a valid configuration is present. The VidMode extension also requires: ValidMode Identify if a new mode is usable with the current configuration. The PreInit function (and/or helpers it calls) may also make use of the ValidMode function or something similar. Other extensions may require other entry points. The drivers will inform the common layer of these in such cases. Resource Access Control Introduction Graphics devices are accessed through ranges in I/O or memory space. While most modern graphics devices allow relocation of such ranges many of them still require the use of well established interfaces such as VGA memory and IO ranges or 8514/A IO ranges. With modern buses (like PCI) it is possible for multiple video devices to share access to these resources. The RAC (Resource Access Control) subsystem provides a mechanism for this. Terms and Definitions Bus Bus is ambiguous as it is used for different things: it may refer to physical incompatible extension connectors in a computer system. The RAC system knows two such systems: The ISA bus and the PCI bus. (On the software level EISA, MCA and VL buses are currently treated like ISA buses). Bus may also refer to logically different entities on a single bus system which are connected via bridges. A PCI system may have several distinct PCI buses connecting each other by PCI-PCI bridges or to the host CPU by HOST-PCI bridges. Systems that host more than one bus system link these together using bridges. Bridges are a concern to RAC as they might block or pass specific resources. PCI-PCI bridges may be set up to pass VGA resources to the secondary bus. PCI-ISA buses pass any resources not decoded on the primary PCI bus to the ISA bus. This way VGA resources (although exclusive on the ISA bus) can be shared by ISA and PCI cards. Currently HOST-PCI bridges are not yet handled by RAC as they require specific drivers. Entity The smallest independently addressable unit on a system bus is referred to as an entity. So far we know ISA and PCI entities. PCI entities can be located on the PCI bus by an unique ID consisting of the bus, card and function number. Resource Resource refers to a range of memory or I/O addresses an entity can decode. If a device is capable of disabling this decoding the resource is called sharable. For PCI devices a generic method is provided to control resource decoding. Other devices will have to provide a device specific function to control decoding. If the entity is capable of decoding this range at a different location this resource is considered relocatable. Resources which start at a specific address and occupy a single continuous range are called block resources. Alternatively resource addresses can be decoded in a way that they satisfy the conditions: address & mask == base and base & mask == base Resources addressed in such a way are called sparse resources. Server States The resource access control system knows two server states: the SETUP and the OPERATING state. The SETUP state is entered whenever a mode change takes place or the server exits or does VT switching. During this state all entity resources are under resource access control. During OPERATING state only those entities are controlled which actually have shared resources that conflict with others. Control Flow in the Server and Mandatory Driver Functions At the start of each server generation, main() (dix/main.c) calls the DDX function InitOutput(). This is the first place that the DDX gets control. InitOutput() is expected to fill in the global screenInfo struct, and one screenInfo.screen[] entry for each screen present. Here is what InitOutput() does: Parse the xorg.conf file This is done at the start of the first server generation only. The xorg.conf file is read in full, and the resulting information stored in data structures. None of the parsed information is processed at this point. The parser data structures are opaque to the video drivers and to most of the common layer code. The entire file is parsed first to remove any section ordering requirements. Initial processing of parsed information and command line options This is done at the start of the first server generation only. The initial processing is to determine paths like the ModulePath, etc, and to determine which &k.serverlayout;, &k.screen; and &k.device; sections are active. Enable port I/O access Port I/O access is controlled from the XFree86 common layer, and is all or nothing. It is enabled prior to calling driver probes, at the start of subsequent server generations, and when VT switching back to the Xserver. It is disabled at the end of server generations, and when VT switching away from the Xserver. The implementation details of this may vary on different platforms. General bus probe This is done at the start of the first server generation only. In the case of ix86 machines, this will be a general PCI probe. The full information obtained here will be available to the drivers. This information persists for the life of the Xserver. In the PCI case, the PCI information for all video cards found is available by calling xf86GetPciVideoInfo().
pciVideoPtr *xf86GetPciVideoInfo(void);
returns a pointer to a list of pointers to pciVideoRec entries, of which there is one for each detected PCI video card. The list is terminated with a NULL pointer. If no PCI video cards were detected, the return value is NULL.
After the bus probe, the resource broker is initialised.
Load initial set of modules This is done at the start of the first server generation only. The next set of modules loaded are those specified explicitly in the &k.module; section of the config file. The final set of initial modules are the driver modules referenced by the active &k.device; and &k.inputdevice; sections in the config file. Each of these modules is loaded exactly once. Register Video and Input Drivers This is done at the start of the first server generation only. When a driver module is loaded, the loader calls its Setup function. For video drivers, this function calls xf86AddDriver() to register the driver's DriverRec, which contains a small set of essential details and driver entry points required during the early phase of InitOutput(). xf86AddDriver() adds it to the global xf86DriverList[] array. The DriverRec contains the driver canonical name, the Identify(), Probe() and AvailableOptions() function entry points as well as a pointer to the driver's module (as returned from the loader when the driver was loaded) and a reference count which keeps track of how many screens are using the driver. The entry driver entry points are those required prior to the driver allocating and filling in its ScrnInfoRec. For a static server, the xf86DriverList[] array is initialised at build time, and the loading of modules is not done. A similar procedure is used for input drivers. The input driver's Setup function calls xf86AddInputDriver() to register the driver's InputDriverRec, which contains a small set of essential details and driver entry points required during the early phase of InitInput(). xf86AddInputDriver() adds it to the global xf86InputDriverList[] array. For a static server, the xf86InputDriverList[] array is initialised at build time. Both the xf86DriverList[] and xf86InputDriverList[] arrays have been initialised by the end of this stage. Once all the drivers are registered, their ChipIdentify() functions are called.
void ChipIdentify(int flags);
This is expected to print a message indicating the driver name, a short summary of what it supports, and a list of the chipset names that it supports. It may use the xf86PrintChipsets() helper to do this.
void xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips);
This function provides an easy way for a driver's ChipIdentify function to format the identification message.
Initialise Access Control This is done at the start of the first server generation only. The Resource Access Control (RAC) subsystem is initialised before calling any driver functions that may access hardware. All generic bus information is probed and saved (for restoration later). All (shared resource) video devices are disabled at the generic bus level, and a probe is done to find the primary video device. These devices remain disabled for the next step. Video Driver Probe This is done at the start of the first server generation only. The ChipProbe() function of each registered video driver is called.
Bool ChipProbe(DriverPtr drv, int flags);
The purpose of this is to identify all instances of hardware supported by the driver. The flags value is currently either 0, PROBE_DEFAULT or PROBE_DETECT. PROBE_DETECT is used if "-configure" or "-probe" command line arguments are given and indicates to the Probe() function that it should not configure the bus entities and that no xorg.conf information is available. The probe must find the active device sections that match the driver by calling xf86MatchDevice(). The number of matches found limits the maximum number of instances for this driver. If no matches are found, the function should return FALSE immediately. Devices that cannot be identified by using device-independent methods should be probed at this stage (keeping in mind that access to all resources that can be disabled in a device-independent way are disabled during this phase). The probe must be a minimal probe. It should just determine if there is a card present that the driver can drive. It should use the least intrusive probe methods possible. It must not do anything that is not essential, like probing for other details such as the amount of memory installed, etc. It is recommended that the xf86MatchPciInstances() helper function be used for identifying matching PCI devices, and similarly the xf86MatchIsaInstances() for ISA (non-PCI) devices (see the RAC section). These helpers also checks and claims the appropriate entity. When not using the helper, that should be done with xf86CheckPciSlot() and xf86ClaimPciSlot() for PCI devices and xf86ClaimIsaSlot() for ISA devices (see the RAC section). The probe must register all non-relocatable resources at this stage. If a resource conflict is found between exclusive resources the driver will fail immediately. This is usually best done with the xf86ConfigPciEntity() helper function for PCI and xf86ConfigIsaEntity() for ISA (see the RAC section). It is possible to register some entity specific functions with those helpers. When not using the helpers, the xf86AddEntityToScreen() xf86ClaimFixedResources() and xf86SetEntityFuncs() should be used instead (see the RAC section). If a chipset is specified in an active device section which the driver considers relevant (ie it has no driver specified, or the driver specified matches the driver doing the probe), the Probe must return FALSE if the chipset doesn't match one supported by the driver. If there are no active device sections that the driver considers relevant, it must return FALSE. Allocate a ScrnInfoRec for each active instance of the hardware found, and fill in the basic information, including the other driver entry points. This is best done with the xf86ConfigIsaEntity() helper function for ISA instances or xf86ConfigPciEntity() for PCI instances. These functions allocate a ScrnInfoRec for active entities. Optionally xf86AllocateScreen() function may also be used to allocate the ScrnInfoRec. Any of these functions take care of initialising fields to defined unused values. Claim the entities for each instance of the hardware found. This prevents other drivers from claiming the same hardware. Must leave hardware in the same state it found it in, and must not do any hardware initialisation. All detection can be overridden via the config file, and that parsed information is available to the driver at this stage. Returns TRUE if one or more instances are found, and FALSE otherwise.
int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist)
This function takes the name of the driver and returns via driversectlist a list of device sections that match the driver name. The function return value is the number of matches found. If a fatal error is encountered the return value is -1. The caller should use xfree() to free *driversectlist when it is no longer needed.
ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags)
This function allocates a new ScrnInfoRec in the xf86Screens[] array. This function is normally called by the video driver ChipProbe() functions. The return value is a pointer to the newly allocated ScrnInfoRec. The scrnIndex, origIndex, module and drv fields are initialised. The reference count in drv is incremented. The storage for any currently allocated privates pointers is also allocated and the privates field initialised (the privates data is of course not allocated or initialised). This function never returns on failure. If the allocation fails, the server exits with a fatal error. The flags value is not currently used, and should be set to zero.
At the completion of this, a list of ScrnInfoRecs have been allocated in the xf86Screens[] array, and the associated entities and fixed resources have been claimed. The following ScrnInfoRec fields must be initialised at this point: driverVersion driverName scrnIndex(*) origIndex(*) drv(*) module(*) name Probe PreInit ScreenInit EnterVT LeaveVT numEntities entityList access (*) These are initialised when the ScrnInfoRec is allocated, and not explicitly by the driver. The following ScrnInfoRec fields must be initialised if the driver is going to use them: SwitchMode AdjustFrame FreeScreen ValidMode
Matching Screens This is done at the start of the first server generation only. After the Probe phase is finished, there will be some number of ScrnInfoRecs. These are then matched with the active &k.screen; sections in the xorg.conf, and those not having an active &k.screen; section are deleted. If the number of remaining screens is 0, InitOutput() sets screenInfo.numScreens to 0 and returns. At this point the following fields of the ScrnInfoRecs must be initialised: confScreen Allocate non-conflicting resources This is done at the start of the first server generation only. Before calling the drivers again, the resource information collected from the Probe phase is processed. This includes checking the extent of PCI resources for the probed devices, and resolving any conflicts in the relocatable PCI resources. It also reports conflicts, checks bus routing issues, and anything else that is needed to enable the entities for the next phase. If any drivers registered an EntityInit() function during the Probe phase, then they are called here. Sort the Screens and pre-check Monitor Information This is done at the start of the first server generation only. The list of screens is sorted to match the ordering requested in the config file. The list of modes for each active monitor is checked against the monitor's parameters. Invalid modes are pruned. PreInit This is done at the start of the first server generation only. For each ScrnInfoRec, enable access to the screens entities and call the ChipPreInit() function.
Bool ChipPreInit(ScrnInfoRec screen, int flags);
The purpose of this function is to find out all the information required to determine if the configuration is usable, and to initialise those parts of the ScrnInfoRec that can be set once at the beginning of the first server generation. The number of entities registered for the screen should be checked against the expected number (most drivers expect only one). The entity information for each of them should be retrieved (with xf86GetEntityInfo()) and checked for the correct bus type and that none of the sharable resources registered during the Probe phase was rejected. Access to resources for the entities that can be controlled in a device-independent way are enabled before this function is called. If the driver needs to access any resources that it has disabled in an EntityInit() function that it registered, then it may enable them here providing that it disables them before this function returns. This includes probing for video memory, clocks, ramdac, and all other HW info that is needed. It includes determining the depth/bpp/visual and related info. It includes validating and determining the set of video modes that will be used (and anything that is required to determine that). This information should be determined in the least intrusive way possible. The state of the HW must remain unchanged by this function. Although video memory (including MMIO) may be mapped within this function, it must be unmapped before returning. Driver specific information should be stored in a structure hooked into the ScrnInfoRec's driverPrivate field. Any other modules which require persistent data (ie data that persists across server generations) should be initialised in this function, and they should allocate a privates index to hook their data into by calling xf86AllocateScrnInfoPrivateIndex(). The privates data is persistent. Helper functions for some of these things are provided at the XFree86 common level, and the driver can choose to make use of them. All additional resources that the screen needs must be registered here. This should be done with xf86RegisterResources(). If some of the fixed resources registered in the Probe phase are not needed or not decoded by the hardware when in the OPERATING server state, their status should be updated with xf86SetOperatingState(). Modules may be loaded at any point in this function, and all modules that the driver will need must be loaded before the end of this function. Either the xf86LoadSubModule() or the xf86LoadDrvSubModule() function should be used to load modules depending on whether a ScrnInfoRec has been set up. A driver may unload a module within this function if it was only needed temporarily, and the xf86UnloadSubModule() function should be used to do that. Otherwise there is no need to explicitly unload modules because the loader takes care of module dependencies and will unload submodules automatically if/when the driver module is unloaded. The bulk of the ScrnInfoRec fields should be filled out in this function. ChipPreInit() returns FALSE when the configuration is unusable in some way (unsupported depth, no valid modes, not enough video memory, etc), and TRUE if it is usable. It is expected that if the ChipPreInit() function returns TRUE, then the only reasons that subsequent stages in the driver might fail are lack or resources (like xalloc failures). All other possible reasons for failure should be determined by the ChipPreInit() function.
The ScrnInfoRecs for screens where the ChipPreInit() fails are removed. If none remain, InitOutput() sets screenInfo.numScreens to 0 and returns. At this point, further fields of the ScrnInfoRecs would normally be filled in. Most are not strictly mandatory, but many are required by other layers and/or helper functions that the driver may choose to use. The documentation for those layers and helper functions indicates which they require. The following fields of the ScrnInfoRecs should be filled in if the driver is going to use them: monitor display depth pixmapBPP bitsPerPixel weight (>8bpp only) mask (>8bpp only) offset (>8bpp only) rgbBits (8bpp only) gamma defaultVisual maxHValue maxVValue virtualX virtualY displayWidth frameX0 frameY0 frameX1 frameY1 zoomLocked modePool modes currentMode progClock (TRUE if clock is programmable) chipset ramdac clockchip numClocks (if not programmable) clock[] (if not programmable) videoRam biosBase memBase memClk driverPrivate chipID chipRev
pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name); and pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
Load a module that a driver depends on. This function loads the module name as a sub module of the driver. The return value is a handle identifying the new module. If the load fails, the return value will be NULL. If a driver needs to explicitly unload a module it has loaded in this way, the return value must be saved and passed to xf86UnloadSubModule() when unloading.
void xf86UnloadSubModule(pointer module);
Unloads the module referenced by module. module should be a pointer returned previously by xf86LoadSubModule() or xf86LoadDrvSubModule() .
Cleaning up Unused Drivers At this point it is known which screens will be in use, and which drivers are being used. Unreferenced drivers (and modules they may have loaded) are unloaded here. Consistency Checks The parameters that must be global to the server, like pixmap formats, bitmap bit order, bitmap scanline unit and image byte order are compared for each of the screens. If a mismatch is found, the server exits with an appropriate message. Check if Resource Control is Needed Determine if resource access control is needed. This is the case if more than one screen is used. If necessary the RAC wrapper module is loaded. AddScreen (ScreenInit) At this point, the valid screens are known. AddScreen() is called for each of them, passing ChipScreenInit() as the argument. AddScreen() is a DIX function that allocates a new screenInfo.screen[] entry (aka pScreen), and does some basic initialisation of it. It then calls the ChipScreenInit() function, with pScreen as one of its arguments. If ChipScreenInit() returns FALSE, AddScreen() returns -1. Otherwise it returns the index of the screen. AddScreen() should only fail because of programming errors or failure to allocate resources (like memory). All configuration problems should be detected BEFORE this point.
Bool ChipScreenInit(ScreenPtr pScreen, int argc, char **argv);
This is called at the start of each server generation. Fill in all of pScreen, possibly doing some of this by calling ScreenInit functions from other layers like mi, framebuffers (cfb, etc), and extensions. Decide which operations need to be placed under resource access control. The classes of operations are the frame buffer operations (RAC_FB), the pointer operations (RAC_CURSOR), the viewport change operations (RAC_VIEWPORT) and the colormap operations (RAC_COLORMAP). Any operation that requires resources which might be disabled during OPERATING state should be set to use RAC. This can be specified separately for memory and IO resources (the racMemFlags and racIoFlags fields of the ScrnInfoRec respectively). Map any video memory or other memory regions. Save the video card state. Enough state must be saved so that the original state can later be restored. Initialise the initial video mode. The ScrnInfoRec's vtSema field should be set to TRUE just prior to changing the video hardware's state.
The ChipScreenInit() function (or functions from other layers that it calls) should allocate entries in the ScreenRec's devPrivates area by calling AllocateScreenPrivateIndex() if it needs per-generation storage. Since the ScreenRec's devPrivates information is cleared for each server generation, this is the correct place to initialise it. After AddScreen() has successfully returned, the following ScrnInfoRec fields are initialised: pScreen racMemFlags racIoFlags The ChipScreenInit() function should initialise the CloseScreen and SaveScreen fields of pScreen. The old value of pScreen->CloseScreen should be saved as part of the driver's per-screen private data, allowing it to be called from ChipCloseScreen(). This means that the existing CloseScreen() function is wrapped.
Finalising RAC Initialisation After all the ChipScreenInit() functions have been called, each screen has registered its RAC requirements. This information is used to determine which shared resources are requested by more than one driver and set the access functions accordingly. This is done following these rules: The sharable resources registered by each entity are compared. If a resource is registered by more than one entity the entity will be marked to indicate that it needs to share this resources type (IO or MEM). A resource marked disabled during OPERATING state will be ignored entirely. A resource marked unused will only conflict with an overlapping resource of an other entity if the second is actually in use during OPERATING state. If an unused resource was found to conflict but the entity does not use any other resource of this type the entire resource type will be disabled for that entity. Finishing InitOutput() At this point InitOutput() is finished, and all the screens have been setup in their initial video mode. Mode Switching When a SwitchMode event is received, ChipSwitchMode() is called (when it exists):
Bool ChipSwitchMode(int index, DisplayModePtr mode);
Initialises the new mode for the screen identified by index;. The viewport may need to be adjusted also.
Changing Viewport When a Change Viewport event is received, ChipAdjustFrame() is called (when it exists):
void ChipAdjustFrame(int index, int x, int y);
Changes the viewport for the screen identified by index;. It should be noted that many chipsets impose restrictions on where the viewport may be placed in the virtual resolution, either for alignment reasons, or to prevent the start of the viewport from being positioned within a pixel (as can happen in a 24bpp mode). After calculating the value the chipset's panning registers need to be set to for non-DGA modes, this function should recalculate the ScrnInfoRec's frameX0, frameY0, frameX1 and frameY1 fields to correspond to that value. If this is not done, switching to another mode might cause the position of a hardware cursor to change.
VT Switching When a VT switch event is received, xf86VTSwitch() is called. xf86VTSwitch() does the following: On ENTER: enable port I/O access save and initialise the bus/resource state enter the SETUP server state calls ChipEnterVT() for each screen enter the OPERATING server state validate GCs Restore fb from saved pixmap for each screen Enable all input devices On LEAVE: Save fb to pixmap for each screen validate GCs enter the SETUP server state calls ChipLeaveVT() for each screen disable all input devices restore bus/resource state disables port I/O access
Bool ChipEnterVT(ScrnInfoPtr pScrn);
This function should initialise the current video mode and initialise the viewport, turn on the HW cursor if appropriate, etc. Should it re-save the video state before initialising the video mode?
void ChipLeaveVT(ScrnInfoPtr pScrn);
This function should restore the saved video state. If appropriate it should also turn off the HW cursor, and invalidate any pixmap/font caches.
Optionally, ChipLeaveVT() may also unmap memory regions. If so, ChipEnterVT() will need to remap them. Additionally, if an aperture used to access video memory is unmapped and remapped in this fashion, ChipEnterVT() will also need to notify the framebuffer layers of the aperture's new location in virtual memory. This is done with a call to the screen's ModifyPixmapHeader() function, as follows
(*pScreen->ModifyPixmapHeader)(pScrn->ppix, -1, -1, -1, -1, -1, NewApertureAddress);
where the ppix field in a ScrnInfoRec points to the pixmap used by the screen's SaveRestoreImage() function to hold the screen's contents while switched out.
Other layers may wrap the ChipEnterVT() and ChipLeaveVT() functions if they need to take some action when these events are received.
End of server generation At the end of each server generation, the DIX layer calls ChipCloseScreen() for each screen:
Bool ChipCloseScreen(int index, ScreenPtr pScreen);
This function should restore the saved video state and unmap the memory regions. It should also free per-screen data structures allocated by the driver. Note that the persistent data held in the ScrnInfoRec's driverPrivate field should not be freed here because it is needed by subsequent server generations. The ScrnInfoRec's vtSema field should be set to FALSE once the video HW state has been restored. Before freeing the per-screen driver data the saved CloseScreen value should be restored to pScreen->CloseScreen, and that function should be called after freeing the data.
Optional Driver Functions The functions outlined here can be called from the XFree86 common layer, but their presence is optional. Mode Validation When a mode validation helper supplied by the XFree86-common layer is being used, it can be useful to provide a function to check for hw specific mode constraints:
ModeStatus ChipValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags);
Check the passed mode for hw-specific constraints, and return the appropriate status value.
This function may also modify the effective timings and clock of the passed mode. These have been stored in the mode's Crtc* and SynthClock elements, and have already been adjusted for interlacing, doublescanning, multiscanning and clock multipliers and dividers. The function should not modify any other mode field, unless it wants to modify the mode timings reported to the user by xf86PrintModes(). The function is called once for every mode in the xorg.conf Monitor section assigned to the screen, with flags set to MODECHECK_INITIAL. It is subsequently called for every mode in the xorg.conf Display subsection assigned to the screen, with flags set to MODECHECK_FINAL. In the second case, the mode will have successfully passed all other tests. In addition, the ScrnInfoRec's virtualX, virtualY and displayWidth fields will have been set as if the mode to be validated were to be the last mode accepted. In effect, calls with MODECHECK_INITIAL are intended for checks that do not depend on any mode other than the one being validated, while calls with MODECHECK_FINAL are intended for checks that may involve more than one mode.
Free screen data When a screen is deleted prior to the completion of the ScreenInit phase the ChipFreeScreen() function is called when defined.
void ChipFreeScreen(ScrnInfoPtr pScrn);
Free any driver-allocated data that may have been allocated up to and including an unsuccessful ChipScreenInit() call. This would predominantly be data allocated by ChipPreInit() that persists across server generations. It would include the driverPrivate, and any privates entries that modules may have allocated.
Recommended driver functions The functions outlined here are for internal use by the driver only. They are entirely optional, and are never accessed directly from higher layers. The sample function declarations shown here are just examples. The interface (if any) used is up to the driver. Save Save the video state. This could be called from ChipScreenInit() and (possibly) ChipEnterVT().
void ChipSave(ScrnInfoPtr pScrn);
Saves the current state. This will only be saving pre-server states or states before returning to the server. There is only one current saved state per screen and it is stored in private storage in the screen.
Restore Restore the original video state. This could be called from the ChipLeaveVT() and ChipCloseScreen() functions.
void ChipRestore(ScrnInfoPtr pScrn);
Restores the saved state from the private storage. Usually only used for restoring text modes.
Initialise Mode Initialise a video mode. This could be called from the ChipScreenInit(), ChipSwitchMode() and ChipEnterVT() functions.
Bool ChipModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
Programs the hardware for the given video mode.
Data and Data Structures Command line data Command line options are typically global, and are stored in global variables. These variables are read-only and are available to drivers via a function call interface. Most of these command line values are processed via helper functions to ensure that they are treated consistently by all drivers. The other means of access is provided for cases where the supplied helper functions might not be appropriate. Some of them are: xf86Verbose verbosity level xf86Bpp -bpp from the command line xf86Depth -depth from the command line xf86Weight -weight from the command line xf86Gamma -{r,g,b,}gamma from the command line xf86FlipPixels -flippixels from the command line xf86ProbeOnly -probeonly from the command line defaultColorVisualClass -cc from the command line If we ever do allow for screen-specific command line options, we may need to rethink this. These can be accessed in a read-only manner by drivers with the following functions:
int xf86GetVerbosity();
Returns the value of xf86Verbose.
int xf86GetDepth();
Returns the command line setting. If not set on the command line, -1 is returned.
rgb xf86GetWeight();
Returns the command line setting. If not set on the command line, {0, 0, 0} is returned.
Gamma xf86GetGamma();
Returns the or , , command line settings. If not set on the command line, {0.0, 0.0, 0.0} is returned.
Bool xf86GetFlipPixels();
Returns TRUE if is present on the command line, and FALSE otherwise.
const char *xf86GetServerName();
Returns the name of the X server from the command line.
Data handling Config file data contains parts that are global, and parts that are Screen specific. All of it is parsed into data structures that neither the drivers or most other parts of the server need to know about. The global data is typically not required by drivers, and as such, most of it is stored in the private xf86InfoRec. The screen-specific data collected from the config file is stored in screen, device, display, monitor-specific data structures that are separate from the ScrnInfoRecs, with the appropriate elements/fields hooked into the ScrnInfoRecs as required. The screen config data is held in confScreenRec, device data in the GDevRec, monitor data in the MonRec, and display data in the DispRec. The XFree86 common layer's screen specific data (the actual data in use for each screen) is held in the ScrnInfoRecs. As has been outlined above, the ScrnInfoRecs are allocated at probe time, and it is the responsibility of the Drivers' Probe() and PreInit() functions to finish filling them in based on both data provided on the command line and data provided from the Config file. The precedence for this is:
command line -> config file -> probed/default data
For most things in this category there are helper functions that the drivers can use to ensure that the above precedence is consistently used. As well as containing screen-specific data that the XFree86 common layer (including essential parts of the server infrastructure as well as helper functions) needs to access, it also contains some data that drivers use internally. When considering whether to add a new field to the ScrnInfoRec, consider the balance between the convenience of things that lots of drivers need and the size/obscurity of the ScrnInfoRec. Per-screen driver specific data that cannot be accommodated with the static ScrnInfoRec fields is held in a driver-defined data structure, a pointer to which is assigned to the ScrnInfoRec's driverPrivate field. This is per-screen data that persists across server generations (as does the bulk of the static ScrnInfoRec data). It would typically also include the video card's saved state. 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. Once it has stabilised, the data structures and variables accessible to video drivers will be documented here. In the meantime, those things defined in the xf86.h and xf86str.h files are visible to video drivers. Things defined in xf86Priv.h and xf86Privstr.h are NOT intended to be visible to video drivers, and it is an error for a driver to include those files.
Accessing global data Some other global state information that the drivers may access via functions is as follows:
Bool xf86ServerIsExiting();
Returns TRUE if the server is at the end of a generation and is in the process of exiting, and FALSE otherwise.
Bool xf86ServerIsResetting();
Returns TRUE if the server is at the end of a generation and is in the process of resetting, and FALSE otherwise.
Bool xf86ServerIsInitialising();
Returns TRUE if the server is at the beginning of a generation and is in the process of initialising, and FALSE otherwise.
Bool xf86ServerIsOnlyProbing();
Returns TRUE if the -probeonly command line flag was specified, and FALSE otherwise.
Bool xf86CaughtSignal();
Returns TRUE if the server has caught a signal, and FALSE otherwise.
Allocating private data A driver and any module it uses may allocate per-screen private storage in either the ScreenRec (DIX level) or ScrnInfoRec (XFree86 common layer level). ScreenRec storage persists only for a single server generation, and ScrnInfoRec storage persists across generations for the lifetime of the server. The ScreenRec devPrivates data must be reallocated/initialised at the start of each new generation. This is normally done from the ChipScreenInit() function, and Init functions for other modules that it calls. Data allocated in this way should be freed by the driver's ChipCloseScreen() functions, and Close functions for other modules that it calls. A new devPrivates entry is allocated by calling the AllocateScreenPrivateIndex() function.
int AllocateScreenPrivateIndex();
This function allocates a new element in the devPrivates field of all currently existing ScreenRecs. The return value is the index of this new element in the devPrivates array. The devPrivates field is of type DevUnion: typedef union _DevUnion { pointer ptr; long val; unsigned long uval; pointer (*fptr)(void); } DevUnion; which allows the element to be used for any of the above types. It is commonly used as a pointer to data that the caller allocates after the new index has been allocated. This function will return -1 when there is an error allocating the new index.
The ScrnInfoRec privates data persists for the life of the server, so only needs to be allocated once. This should be done from the ChipPreInit() function, and Init functions for other modules that it calls. Data allocated in this way should be freed by the driver's ChipFreeScreen() functions, and Free functions for other modules that it calls. A new privates entry is allocated by calling the xf86AllocateScrnInfoPrivateIndex() function.
int xf86AllocateScrnInfoPrivateIndex();
This function allocates a new element in the privates field of all currently existing ScrnInfoRecs. The return value is the index of this new element in the privates array. The privates field is of type DevUnion: typedef union _DevUnion { pointer ptr; long val; unsigned long uval; pointer (*fptr)(void); } DevUnion; which allows the element to be used for any of the above types. It is commonly used as a pointer to data that the caller allocates after the new index has been allocated. This function will not return when there is an error allocating the new index. When there is an error it will cause the server to exit with a fatal error. The similar function for allocation privates in the ScreenRec (AllocateScreenPrivateIndex()) differs in this respect by returning -1 when the allocation fails.
Keeping Track of Bus Resources Theory of Operation The XFree86 common layer has knowledge of generic access control mechanisms for devices on certain bus systems (currently the PCI bus) as well as of methods to enable or disable access to the buses itself. Furthermore it can access information on resources decoded by these devices and if necessary modify it. When first starting the Xserver collects all this information, saves it for restoration, checks it for consistency, and if necessary, corrects it. Finally it disables all resources on a generic level prior to calling any driver function. When the Probe() function of each driver is called the device sections are matched against the devices found in the system. The driver may probe devices at this stage that cannot be identified by using device independent methods. Access to all resources that can be controlled in a device independent way is disabled. The Probe() function should register all non-relocatable resources at this stage. If a resource conflict is found between exclusive resources the driver will fail immediately. Optionally the driver might specify an EntityInit(), EntityLeave() and EntityEnter() function. EntityInit() can be used to disable any shared resources that are not controlled by the generic access control functions. It is called prior to the PreInit phase regardless if an entity is active or not. When calling the EntityInit(), EntityEnter() and EntityLeave() functions the common level will disable access to all other entities on a generic level. Since the common level has no knowledge of device specific methods to disable access to resources it cannot be guaranteed that certain resources are not decoded by any other entity until the EntityInit() or EntityEnter() phase is finished. Device drivers should therefore register all those resources which they are going to disable. If these resources are never to be used by any driver function they may be flagged ResInit so that they can be removed from the resource list after processing all EntityInit() functions. EntityEnter() should disable decoding of all resources which are not registered as exclusive and which are not handled by the generic access control in the common level. The difference to EntityInit() is that the latter one is only called once during lifetime of the server. It can therefore be used to set up variables prior to disabling resources. EntityLeave() should restore the original state when exiting the server or switching to a different VT. It also needs to disable device specific access functions if they need to be disabled on server exit or VT switch. The default state is to enable them before giving up the VT. In PreInit() phase each driver should check if any sharable resources it has registered during Probe() has been denied and take appropriate action which could simply be to fail. If it needs to access resources it has disabled during EntitySetup() it can do so provided it has registered these and will disable them before returning from PreInit(). This also applies to all other driver functions. Several functions are provided to request resource ranges, register these, correct PCI config space and add replacements for the generic access functions. Resources may be marked disabled or unused during OPERATING stage. Although these steps could also be performed in ScreenInit(), this is not desirable. Following PreInit() phase the common level determines if resource access control is needed. This is the case if more than one screen is used. If necessary the RAC wrapper module is loaded. In ScreenInit() the drivers can decide which operations need to be placed under RAC. Available are the frame buffer operations, the pointer operations and the colormap operations. Any operation that requires resources which might be disabled during OPERATING state should be set to use RAC. This can be specified separately for memory and IO resources. When ScreenInit() phase is done the common level will determine which shared resources are requested by more than one driver and set the access functions accordingly. This is done following these rules: The sharable resources registered by each entity are compared. If a resource is registered by more than one entity the entity will be marked to need to share this resources type (IO or MEM). A resource marked disabled during OPERATING state will be ignored entirely. A resource marked unused will only conflicts with an overlapping resource of an other entity if the second is actually in use during OPERATING state. If an unused resource was found to conflict however the entity does not use any other resource of this type the entire resource type will be disabled for that entity. The driver has the choice among different ways to control access to certain resources: It can rely on the generic access functions. This is probably the most common case. Here the driver only needs to register any resource it is going to use. It can replace the generic access functions by driver specific ones. This will mostly be used in cases where no generic access functions are available. In this case the driver has to make sure these resources are disabled when entering the PreInit() stage. Since the replacement functions are registered in PreInit() the driver will have to enable these resources itself if it needs to access them during this state. The driver can specify if the replacement functions can control memory and/or I/O resources separately. The driver can enable resources itself when it needs them. Each driver function enabling them needs to disable them before it will return. This should be used if a resource which can be controlled in a device dependent way is only required during SETUP state. This way it can be marked unused during OPERATING state. A resource which is decoded during OPERATING state however never accessed by the driver should be marked unused. Since access switching latencies are an issue during Xserver operation, the common level attempts to minimize the number of entities that need to be placed under RAC control. When a wrapped operation is called, the EnableAccess() function is called before control is passed on. EnableAccess() checks if a screen is under access control. If not it just establishes bus routing and returns. If the screen needs to be under access control, EnableAccess() determines which resource types (MEM, IO) are required. Then it tests if this access is already established. If so it simply returns. If not it disables the currently established access, fixes bus routing and enables access to all entities registered for this screen. Whenever a mode switch or a VT-switch is performed the common level will return to SETUP state. Resource Types Resource have certain properties. When registering resources each range is accompanied by a flag consisting of the ORed flags of the different properties the resource has. Each resource range may be classified according to its physical properties i.e., if it addresses memory (ResMem) or I/O space (ResIo), if it addresses a block (ResBlock) or sparse (ResSparse) range, its access properties. There are two known access properties: ResExclusive for resources which may not be shared with any other device and ResShared for resources which can be disabled and therefore can be shared. If it is necessary to test a resource against any type a generic access type ResAny is provided. If this is set the resource will conflict with any resource of a different entity intersecting its range. Further it can be specified that a resource is decoded however never used during any stage (ResUnused) or during OPERATING state (ResUnusedOpr). A resource only visible during the init functions (ie. EntityInit(), EntityEnter() and EntityLeave() should be registered with the flag ResInit. A resource that might conflict with background resource ranges may be flagged with ResBios. This might be useful when registering resources ranges that were assigned by the system Bios. Several predefined resource lists are available for VGA and 8514/A resources in common/xf86Resources.h. Available Functions The functions provided for resource management are listed in their order of use in the driver. Probe Phase In this phase each driver detects those resources it is able to drive, creates an entity record for each of them, registers non-relocatable resources and allocates screens and adds the resources to screens. Two helper functions are provided for matching device sections in the xorg.conf file to the devices:
int xf86MatchPciInstances(const char *driverName, int vendorID, SymTabPtr chipsets, PciChipsets *PCIchipsets, GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities);
This function finds matches between PCI cards that a driver supports and config file device sections. It is intended for use in the ChipProbe() function of drivers for PCI cards. Only probed PCI devices with a vendor ID matching vendorID are considered. devList and numDevs are typically those found from calling xf86MatchDevice(), and represent the active config file device sections relevant to the driver. PCIchipsets is a table that provides a mapping between the PCI device IDs, the driver's internal chipset tokens and a list of fixed resources. When a device section doesn't have a BusID entry it can only match the primary video device. Secondary devices are only matched with device sections that have a matching BusID entry. Once the preliminary matches have been found, a final match is confirmed by checking if the chipset override, ChipID override or probed PCI chipset type match one of those given in the chipsets and PCIchipsets lists. The PCIchipsets list includes a list of the PCI device IDs supported by the driver. The list should be terminated with an entry with PCI ID -1". The chipsets list is a table mapping the driver's internal chipset tokens to names, and should be terminated with a NULL entry. Only those entries with a corresponding entry in the PCIchipsets list are considered. The order of precedence is: config file chipset, config file ChipID, probed PCI device ID. In cases where a driver handles PCI chipsets with more than one vendor ID, it may set vendorID to 0, and OR each devID in the list with (the vendor ID << 16). Entity index numbers for confirmed matches are returned as an array via foundEntities. The PCI information, chipset token and device section for each match are found in the EntityInfoRec referenced by the indices. The function return value is the number of confirmed matches. A return value of -1 indicates an internal error. The returned foundEntities array should be freed by the driver with xfree() when it is no longer needed in cases where the return value is greater than zero.
int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets, IsaChipsets *ISAchipsets, DriverPtr drvp, FindIsaDevProc FindIsaDevice, GDevPtr *devList, int numDevs, int **foundEntities);
This function finds matches between ISA cards that a driver supports and config file device sections. It is intended for use in the ChipProbe() function of drivers for ISA cards. devList and numDevs are typically those found from calling xf86MatchDevice(), and represent the active config file device sections relevant to the driver. ISAchipsets is a table that provides a mapping between the driver's internal chipset tokens and the resource classes. FindIsaDevice is a driver-provided function that probes the hardware and returns the chipset token corresponding to what was detected, and -1 if nothing was detected. If the config file device section contains a chipset entry, then it is checked against the chipsets list. When no chipset entry is present, the FindIsaDevice function is called instead. Entity index numbers for confirmed matches are returned as an array via foundEntities. The chipset token and device section for each match are found in the EntityInfoRec referenced by the indices. The function return value is the number of confirmed matches. A return value of -1 indicates an internal error. The returned foundEntities array should be freed by the driver with xfree() when it is no longer needed in cases where the return value is greater than zero.
These two helper functions make use of several core functions that are available at the driver level:
Bool xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func);
Takes a BusID string, and if it is in the correct format, returns the PCI bus, device, func values that it indicates. The format of the string is expected to be "PCI:bus:device:func" where each of bus, device and func are decimal integers. The ":func" part may be omitted, and the func value assumed to be zero, but this isn't encouraged. The "PCI" prefix may also be omitted. The prefix "AGP" is currently equivalent to the "PCI" prefix. If the string isn't a valid PCI BusID, the return value is FALSE.
Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
Compares a BusID string with PCI bus, device, func values. If they match TRUE is returned, and FALSE if they don't.
Bool xf86ParseIsaBusString(const char *busID);
Compares a BusID string with the ISA bus ID string ("ISA" or "ISA:"). If they match TRUE is returned, and FALSE if they don't.
Bool xf86CheckPciSlot(int bus, int device, int func);
Checks if the PCI slot bus:device:func has been claimed. If so, it returns FALSE, and otherwise TRUE.
int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
This function is used to claim a PCI slot, allocate the associated entity record and initialise their data structures. The return value is the index of the newly allocated entity record, or -1 if the claim fails. This function should always succeed if xf86CheckPciSlot() returned TRUE for the same PCI slot.
Bool xf86IsPrimaryPci(void);
This function returns TRUE if the primary card is a PCI device, and FALSE otherwise.
int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
This allocates an entity record entity and initialise the data structures. The return value is the index of the newly allocated entity record.
Bool xf86IsPrimaryIsa(void);
This function returns TRUE if the primary card is an ISA (non-PCI) device, and FALSE otherwise.
Two helper functions are provided to aid configuring entities:
ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, PciChipsets *p_chip, resList res, EntityProc init, EntityProc enter, EntityProc leave, pointer private); ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, IsaChipsets *i_chip, resList res, EntityProc init, EntityProc enter, EntityProc leave, pointer private);
These functions are used to register the non-relocatable resources for an entity, and the optional entity-specific Init, Enter and Leave functions. Usually the list of fixed resources is obtained from the Isa/PciChipsets lists. However an additional list of resources may be passed. Generally this is not required. For active entities a ScrnInfoRec is allocated if the pScrn argument is NULL. The return value is TRUE when successful. The init, enter, leave functions are defined as follows:
typedef void (*EntityProc)(int entityIndex, pointer private);
They are passed the entity index and a pointer to a private scratch area. This can be set up during Probe() and its address can be passed to xf86ConfigIsaEntity() and xf86ConfigPciEntity() as the last argument.
These two helper functions make use of several core functions that are available at the driver level:
void xf86ClaimFixedResources(resList list, int entityIndex);
This function registers the non-relocatable resources which cannot be disabled and which therefore would cause the server to fail immediately if they were found to conflict. It also records non-relocatable but sharable resources for processing after the Probe() phase.
Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, pointer);
This function registers with an entity the init, enter, leave functions along with the pointer to their private area.
void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
This function associates the entity referenced by entityIndex with the screen.
PreInit Phase During this phase the remaining resources should be registered. PreInit() should call xf86GetEntityInfo() to obtain a pointer to an EntityInfoRec for each entity it is able to drive and check if any resource are listed in its resources field. If resources registered in the Probe phase have been rejected in the post-Probe phase (resources is non-NULL), then the driver should decide if it can continue without using these or if it should fail.
EntityInfoPtr xf86GetEntityInfo(int entityIndex);
This function returns a pointer to the EntityInfoRec referenced by entityIndex. The returned EntityInfoRec should be freed with xfree() when no longer needed.
Several functions are provided to simplify resource registration:
Bool xf86IsEntityPrimary(int entityIndex);
This function returns TRUE if the entity referenced by entityIndex is the primary display device (i.e., the one initialised at boot time and used in text mode).
Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn);
This function returns TRUE if the primary entity is registered with the screen referenced by pScrn.
pciVideoPtr xf86GetPciInfoForEntity(int entityIndex);
This function returns a pointer to the pciVideoRec for the specified entity. If the entity is not a PCI device, NULL is returned.
The primary function for registration of resources is:
resPtr xf86RegisterResources(int entityIndex, resList list, int access);
This function tries to register the resources in list. If list is NULL it tries to determine the resources automatically. This only works for entities that provide a generic way to read out the resource ranges they decode. So far this is only the case for PCI devices. By default the PCI resources are registered as shared (ResShared) if the driver wants to set a different access type it can do so by specifying the access flags in the third argument. A value of 0 means to use the default settings. If for any reason the resource broker is not able to register some of the requested resources the function will return a pointer to a list of the failed ones. In this case the driver may be able to move the resource to different locations. In case of PCI bus entities this is done by passing the list of failed resources to xf86ReallocatePciResources(). When the registration succeeds, the return value is NULL.
resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
This function takes a list of PCI resources that need to be reallocated and returns NULL when all relocations are successful. xf86RegisterResources() should be called again to register the relocated resources with the broker. If the reallocation fails, a list of the resources that could not be relocated is returned.
Two functions are provided to obtain a resource range of a given type:
resRange xf86GetBlock(long type, memType size, memType window_start, memType window_end, memType align_mask, resPtr avoid);
This function tries to find a block range of size size and type type in a window bound by window_start and window_end with the alignment specified in align_mask. Optionally a list of resource ranges which should be avoided within the window can be supplied. On failure a zero-length range of type ResEnd will be returned.
resRange xf86GetSparse(long type, memType fixed_bits, memType decode_mask, memType address_mask, resPtr avoid);
This function is like the previous one, but attempts to find a sparse range instead of a block range. Here three values have to be specified: the address_mask which marks all bits of the mask part of the address, the decode_mask which masks out the bits which are hardcoded and are therefore not available for relocation and the values of the fixed bits. The function tries to find a base that satisfies the given condition. If the function fails it will return a zero range of type ResEnd. Optionally it might be passed a list of resource ranges to avoid.
Some PCI devices are broken in the sense that they return invalid size information for a certain resource. In this case the driver can supply the correct size and make sure that the resource range allocated for the card is large enough to hold the address range decoded by the card. The function xf86FixPciResource() can be used to do this:
Bool xf86FixPciResource(int entityIndex, unsigned int prt, CARD32 alignment, long type);
This function fixes a PCI resource allocation. The prt parameter contains the number of the PCI base register that needs to be fixed (0-5, and 6 for the BIOS base register). The size is specified by the alignment. Since PCI resources need to span an integral range of size 2ˆn, the alignm ent also specifies the number of addresses that will be decoded. If the driver specifies a type mask it can override the default type for PCI resources which is ResShared. The resource broker needs to know that to find a matching resource range. This function should be called before calling xf86RegisterResources(). The return value is TRUE when the function succeeds.
Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base);
This function checks that the memory base address specified matches one of the PCI base address register values for the given PCI device. This is mostly used to check that an externally provided base address (e.g., from a config file) matches an actual value allocated to a device.
The driver may replace the generic access control functions for an entity. This is done with the xf86SetAccessFuncs():
void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs, xf86SetAccessFuncPtr oldFuncs); with: typedef struct { xf86AccessPtr mem; xf86AccessPtr io; xf86AccessPtr io_mem; } xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
The driver can pass three functions: one for I/O access, one for memory access and one for combined memory and I/O access. If the memory access and combined access functions are identical the common level assumes that the memory access cannot be controlled independently of I/O access, if the I/O access function and the combined access functions are the same it is assumed that I/O can not be controlled independently. If memory and I/O have to be controlled together all three values should be the same. If a non NULL value is passed as third argument it is interpreted as an address where to store the old access record. If the third argument is NULL it will be assumed that the generic access should be enabled before replacing the access functions. Otherwise it will be disabled. The driver may enable them itself using the returned values. It should do this from its replacement access functions as the generic access may be disabled by the common level on certain occasions. If replacement functions are specified they must control all resources of the specific type registered for the entity.
To find out if a specific resource range conflicts with another resource the xf86ChkConflict() function may be used:
memType xf86ChkConflict(resRange *rgp, int entityIndex);
This function checks if the resource range rgp of for the specified entity conflicts with with another resource. If a conflict is found, the address of the start of the conflict is returned. The return value is zero when there is no conflict.
The OPERATING state properties of previously registered fixed resources can be set with the xf86SetOperatingState() function:
resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
This function is used to set the status of a resource during OPERATING state. list holds a list to which mask is to be applied. The parameter mask may have the value ResUnusedOpr and ResDisableOpr. The first one should be used if a resource isn't used by the driver during OPERATING state although it is decoded by the device, while the latter one indicates that the resource is not decoded during OPERATING state. Note that the resource ranges have to match those specified during registration. If a range has been specified starting at A and ending at B and suppose C us a value satisfying A < C < B one may not specify the resource range (A,B) by splitting it into two ranges (A,C) and (C,B).
The following two functions are provided for special cases:
void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
This function may be used to remove an entity from a screen. This only makes sense if a screen has more than one entity assigned or the screen is to be deleted. No test is made if the screen has any entities left.
void xf86DeallocateResourcesForEntity(int entityIndex, long type);
This function deallocates all resources of a given type registered for a certain entity from the resource broker list.
ScreenInit Phase All that is required in this phase is to setup the RAC flags. Note that it is also permissible to set these flags up in the PreInit phase. The RAC flags are held in the racIoFlags and racMemFlags fields of the ScrnInfoRec for each screen. They specify which graphics operations might require the use of shared resources. This can be specified separately for memory and I/O resources. The available flags are defined in rac/xf86RAC.h. They are: RAC_FB for framebuffer operations (including hw acceleration) RAC_CURSOR for Cursor operations (??? I'm not sure if we need this for SW cursor it depends on which level the sw cursor is drawn) RAC_COLORMAP for colormap operations RAC_VIEWPORT for the call to ChipAdjustFrame() The flags are ORed together.
Config file <quote>Option</quote> entries Option entries are permitted in most sections and subsections of the config file. There are two forms of option entries: Option "option-name" A boolean option. Option "option-name" "option-value" An option with an arbitrary value. The option entries are handled by the parser, and a list of the parsed options is included with each of the appropriate data structures that the drivers have access to. The data structures used to hold the option information are opaque to the driver, and a driver must not access the option data directly. Instead, the common layer provides a set of functions that may be used to access, check and manipulate the option data. First, the low level option handling functions. In most cases drivers would not need to use these directly.
XF86OptionPtr xf86FindOption(XF86OptionPtr options, const char *name);
Takes a list of options and an option name, and returns a handle for the first option entry in the list matching the name. Returns NULL if no match is found.
const char *xf86FindOptionValue(XF86OptionPtr options, const char *name);
Takes a list of options and an option name, and returns the value associated with the first option entry in the list matching the name. If the matching option has no value, an empty string ("") is returned. Returns NULL if no match is found.
void xf86MarkOptionUsed(XF86OptionPtr option);
Takes a handle for an option, and marks that option as used.
void xf86MarkOptionUsedByName(XF86OptionPtr options, const char *name);
Takes a list of options and an option name and marks the first option entry in the list matching the name as used.
Next, the higher level functions that most drivers would use.
void xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts);
Collect the options from each of the config file sections used by the screen (pScrn) and return the merged list as pScrn->options. This function requires that pScrn->confScreen, pScrn->display, pScrn->monitor, pScrn->numEntities, and pScrn->entityList are initialised. extraOpts may optionally be set to an additional list of options to be combined with the others. The order of precedence for options is extraOpts, display, confScreen, monitor, device.
void xf86ProcessOptions(int scrnIndex, XF86OptionPtr options, OptionInfoPtr optinfo);
Processes a list of options according to the information in the array of OptionInfoRecs (optinfo). The resulting information is stored in the value fields of the appropriate optinfo entries. The found fields are set to TRUE when an option with a value of the correct type if found, and FALSE otherwise. The type field is used to determine the expected value type for each option. Each option in the list of options for which there is a name match (but not necessarily a value type match) is marked as used. Warning messages are printed when option values don't match the types specified in the optinfo data. NOTE: If this function is called before a driver's screen number is known (e.g., from the ChipProbe() function) a scrnIndex value of -1 should be used. NOTE 2: Given that this function stores into the OptionInfoRecs pointed to by optinfo, the caller should ensure the OptionInfoRecs are (re-)initialised before the call, especially if the caller expects to use the predefined option values as defaults. The OptionInfoRec is defined as follows: typedef struct { double freq; int units; } OptFrequency; typedef union { unsigned long num; char * str; double realnum; Bool bool; OptFrequency freq; } ValueUnion; typedef enum { OPTV_NONE = 0, OPTV_INTEGER, OPTV_STRING, /* a non-empty string */ OPTV_ANYSTR, /* Any string, including an empty one */ OPTV_REAL, OPTV_BOOLEAN, OPTV_PERCENT, OPTV_FREQ } OptionValueType; typedef enum { OPTUNITS_HZ = 1, OPTUNITS_KHZ, OPTUNITS_MHZ } OptFreqUnits; typedef struct { int token; const char* name; OptionValueType type; ValueUnion value; Bool found; } OptionInfoRec, *OptionInfoPtr; OPTV_FREQ can be used for options values that are frequencies. These values are a floating point number with an optional unit name appended. The unit name can be one of "Hz", "kHz", "k", "MHz", "M". The multiplier associated with the unit is stored in freq.units, and the scaled frequency is stored in freq.freq. When no unit is specified, freq.units is set to 0, and freq.freq is unscaled. OPTV_PERCENT can be used for option values that are specified in percent (e.g. "20%"). These values are a floating point number with a percent sign appended. If the percent sign is missing, the parser will fail to match the value. Typical usage is to setup an array of OptionInfoRecs with all fields initialised. The value and found fields get set by xf86ProcessOptions(). For cases where the value parsing is more complex, the driver should specify OPTV_STRING, and parse the string itself. An example of using this option handling is included in the Sample Driver section.
void xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr options);
Prints out warning messages for each option in the list of options that isn't marked as used. This is intended to show options that the driver hasn't recognised. It would normally be called near the end of the ChipScreenInit() function, but only when serverGeneration == 1
OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
Returns a pointer to the OptionInfoRec in table with a token field matching token. Returns NULL if no match is found.
Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
Returns the found field of the OptionInfoRec in table with a token field matching token. This can be used for options of all types. Note that for options of type OPTV_BOOLEAN, it isn't sufficient to check this to determine the value of the option. Returns FALSE if no match is found.
char *xf86GetOptValString(const OptionInfoRec *table, int token);
Returns the value.str field of the OptionInfoRec in table with a token field matching token. Returns NULL if no match is found.
Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
Returns via *value the value.num field of the OptionInfoRec in table with a token field matching token. *value is only changed when a match is found so it can be safely initialised with a default prior to calling this function. The function return value is as for xf86IsOptionSet().
Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
Like xf86GetOptValInteger(), except the value is treated as an unsigned long.
Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
Like xf86GetOptValInteger(), except that value.realnum is used.
Bool xf86GetOptValFreq(const OptionInfoRec *table, int token, OptFreqUnits expectedUnits, double *value);
Like xf86GetOptValInteger(), except that the value.freq data is returned. The frequency value is scaled to the units indicated by expectedUnits. The scaling is exact when the units were specified explicitly in the option's value. Otherwise, the expectedUnits field is used as a hint when doing the scaling. In this case, values larger than 1000 are assumed to have be specified in the next smallest units. For example, if the Option value is "10000" and expectedUnits is OPTUNITS_MHZ, the value returned is 10.
Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
This function is used to check boolean options (OPTV_BOOLEAN). If the function return value is FALSE, it means the option wasn't set. Otherwise *value is set to the boolean value indicated by the option's value. No option value is interpreted as TRUE. Option values meaning TRUE are "1", "yes", "on", "true", and option values meaning FALSE are "0", "no", "off", "false". Option names both with the "no" prefix in their names, and with that prefix removed are also checked and handled in the obvious way. *value is not changed when the option isn't present. It should normally be set to a default value before calling this function.
Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
This function is used to check boolean options (OPTV_BOOLEAN). If the option is set, its value is returned. If the options is not set, the default value specified by def is returned. The option interpretation is the same as for xf86GetOptValBool().
int xf86NameCmp(const char *s1, const char *s2);
This function should be used when comparing strings from the config file with expected values. It works like strcmp(), but is not case sensitive and space, tab, and _ characters are ignored in the comparison. The use of this function isn't restricted to parsing option values. It may be used anywhere where this functionality required.
Modules, Drivers, Include Files and Interface Issues NOTE: this section is incomplete. Include files The following include files are typically required by video drivers:
All drivers should include these: "xf86.h" "xf86_OSproc.h" "xf86_ansic.h" "xf86Resources.h" Wherever inb/outb (and related things) are used the following should be included: "compiler.h" Note: in drivers, this must be included after "xf86_ansic.h". Drivers that need to access the PCI config space need this: "xf86Pci.h" Drivers that initialise a SW cursor need this: "mipointer.h" All drivers using the mi colourmap code need this: "micmap.h" If a driver uses the vgahw module, it needs this: "vgaHW.h" Drivers supporting VGA or Hercules monochrome screens need: "xf1bpp.h" Drivers supporting VGA or EGC 16-colour screens need: "xf4bpp.h" Drivers using cfb need: #define PSZ 8 #include "cfb.h" #undef PSZ Drivers supporting bpp 16, 24 or 32 with cfb need one or more of: "cfb16.h" "cfb24.h" "cfb32.h" If a driver uses the fb manager, it needs this: "xf86fbman.h"
Non-driver modules should include "xf86_ansic.h" to get the correct wrapping of ANSI C/libc functions. All modules must NOT include any system include files, or the following: "xf86Priv.h" "xf86Privstr.h" "xf86_OSlib.h" "Xos.h" In addition, "xf86_libc.h" must not be included explicitly. It is included implicitly by "xf86_ansic.h".
Offscreen Memory Manager Management of offscreen video memory may be handled by the XFree86 framebuffer manager. Once the offscreen memory manager is running, drivers or extensions may allocate, free or resize areas of offscreen video memory using the following functions (definitions taken from xf86fbman.h): typedef struct _FBArea { ScreenPtr pScreen; BoxRec box; int granularity; void (*MoveAreaCallback)(struct _FBArea*, struct _FBArea*) void (*RemoveAreaCallback)(struct _FBArea*) DevUnion devPrivate; } FBArea, *FBAreaPtr; typedef void (*MoveAreaCallbackProcPtr)(FBAreaPtr from, FBAreaPtr to) typedef void (*RemoveAreaCallbackProcPtr)(FBAreaPtr) FBAreaPtr xf86AllocateOffscreenArea ( ScreenPtr pScreen, int width, int height, int granularity, MoveAreaCallbackProcPtr MoveAreaCallback, RemoveAreaCallbackProcPtr RemoveAreaCallback, pointer privData ) void xf86FreeOffscreenArea (FBAreaPtr area) Bool xf86ResizeOffscreenArea ( FBAreaPtr area int w, int h ) The function: Bool xf86FBManagerRunning(ScreenPtr pScreen); can be used by an extension to check if the driver has initialized the memory manager. The manager is not available if this returns FALSE and the functions above will all fail. xf86AllocateOffscreenArea() can be used to request a rectangle of dimensions width × height (in pixels) from unused offscreen memory. granularity specifies that the leftmost edge of the rectangle must lie on some multiple of granularity pixels. A granularity of zero means the same thing as a granularity of one - no alignment preference. A MoveAreaCallback can be provided to notify the requester when the offscreen area is moved. If no MoveAreaCallback is supplied then the area is considered to be immovable. The privData field will be stored in the manager's internal structure for that allocated area and will be returned to the requester in the FBArea passed via the MoveAreaCallback. An optional RemoveAreaCallback is provided. If the driver provides this it indicates that the area should be allocated with a lower priority. Such an area may be removed when a higher priority request (one that doesn't have a RemoveAreaCallback) is made. When this function is called, the driver will have an opportunity to do whatever cleanup it needs to do to deal with the loss of the area, but it must finish its cleanup before the function exits since the offscreen memory manager will free the area immediately after. xf86AllocateOffscreenArea() returns NULL if it was unable to allocate the requested area. When no longer needed, areas should be freed with xf86FreeOffscreenArea(). xf86ResizeOffscreenArea() resizes an existing FBArea. xf86ResizeOffscreenArea() returns TRUE if the resize was successful. If xf86ResizeOffscreenArea() returns FALSE, the original FBArea is left unmodified. Resizing an area maintains the area's original granularity, devPrivate, and MoveAreaCallback. xf86ResizeOffscreenArea() has considerably less overhead than freeing the old area then reallocating the new size, so it should be used whenever possible. The function: Bool xf86QueryLargestOffscreenArea( ScreenPtr pScreen, int *width, int *height, int granularity, int preferences, int priority ); is provided to query the width and height of the largest single FBArea allocatable given a particular priority. preferences can be one of the following to indicate whether width, height or area should be considered when determining which is the largest single FBArea available. FAVOR_AREA_THEN_WIDTH FAVOR_AREA_THEN_HEIGHT FAVOR_WIDTH_THEN_AREA FAVOR_HEIGHT_THEN_AREA priority is one of the following:
PRIORITY_LOW
Return the largest block available without stealing anyone else's space. This corresponds to the priority of allocating a FBArea when a RemoveAreaCallback is provided.
PRIORITY_NORMAL
Return the largest block available if it is acceptable to steal a lower priority area from someone. This corresponds to the priority of allocating a FBArea without providing a RemoveAreaCallback.
PRIORITY_EXTREME
Return the largest block available if all FBAreas that aren't locked down were expunged from memory first. This corresponds to any allocation made directly after a call to xf86PurgeUnlockedOffscreenAreas().
The function: Bool xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen); is provided as an extreme method to free up offscreen memory. This will remove all removable FBArea allocations. Initialization of the XFree86 framebuffer manager is done via Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox); FullBox represents the area of the framebuffer that the manager is allowed to manage. This is typically a box with a width of pScrn->displayWidth and a height of as many lines as 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.
Colormap Handling A generic colormap handling layer is provided within the XFree86 common layer. This layer takes care of most of the details, and only requires a function from the driver that loads the hardware palette when required. To use the colormap layer, a driver calls the xf86HandleColormaps() function.
Bool xf86HandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits, LoadPaletteFuncPtr loadPalette, SetOverscanFuncPtr setOverscan, unsigned int flags);
This function must be called after the default colormap has been initialised. The pScrn->gamma field must also be initialised, preferably by calling xf86SetGamma(). maxColors is the number of entries in the palette. sigRGBbits is the size in bits of each color component in the DAC's palette. loadPalette is a driver-provided function for loading a colormap into the hardware, and is described below. setOverscan is an optional function that may be provided when the overscan color is an index from the standard LUT and when it needs to be adjusted to keep it as close to black as possible. The setOverscan function programs the overscan index. It shouldn't normally be used for depths other than 8. setOverscan should be set to NULL when it isn't needed. flags may be set to the following (which may be ORed together): CMAP_PALETTED_TRUECOLOR the TrueColor visual is paletted and is just a special case of DirectColor. This flag is only valid for bpp > 8. CMAP_RELOAD_ON_MODE_SWITCH reload the colormap automatically after mode switches. This is useful for when the driver is resetting the hardware during mode switches and corrupting or erasing the hardware palette. CMAP_LOAD_EVEN_IF_OFFSCREEN reload the colormap even if the screen is switched out of the server's VC. The palette is not reloaded when the screen is switched back in, nor after mode switches. This is useful when the driver needs to keep track of palette changes. The colormap layer normally reloads the palette after VT enters so it is not necessary for the driver to save and restore the palette when switching VTs. The driver must, however, still save the initial palette during server start up and restore it during server exit.
void LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual);
LoadPalette() is a driver-provided function for loading a colormap into hardware. colors is the array of RGB values that represent the full colormap. indices is a list of index values into the colors array. These indices indicate the entries that need to be updated. numColors is the number of the indices to be updated.
void SetOverscan(ScrnInfoPtr pScrn, int overscan);
SetOverscan() is a driver-provided function for programming the overscan index. As described above, it is normally only appropriate for LUT modes where all colormap entries are available for the display, but where one of them is also used for the overscan (typically 8bpp for VGA compatible LUTs). It isn't required in cases where the overscan area is never visible.
DPMS Extension Support code for the DPMS extension is included in the XFree86 common layer. This code provides an interface between the main extension code, and a means for drivers to initialise DPMS when they support it. One function is available to drivers to do this initialisation, and it is always available, even when the DPMS extension is not supported by the core server (in which case it returns a failure result).
Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
This function registers a driver's DPMS level programming function set. It also checks pScrn->options for the "dpms" option, and when present marks DPMS as being enabled for that screen. The set function is called whenever the DPMS level changes, and is used to program the requested level. flags is currently not used, and should be 0. If the initialisation fails for any reason, including when there is no DPMS support in the core server, the function returns FALSE.
Drivers that implement DPMS support must provide the following function, that gets called when the DPMS level is changed:
void ChipDPMSSet(ScrnInfoPtr pScrn, int level, int flags);
Program the DPMS level specified by level. Valid values of level are DPMSModeOn, DPMSModeStandby, DPMSModeSuspend, DPMSModeOff. These values are defined in "extensions/dpms.h".
DGA Extension Drivers can support the XFree86 Direct Graphics Architecture (DGA) by filling out a structure of function pointers and a list of modes and passing them to DGAInit.
Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes, int num); /** The DGAModeRec **/ typedef struct { int num; DisplayModePtr mode; int flags; int imageWidth; int imageHeight; int pixmapWidth; int pixmapHeight; int bytesPerScanline; int byteOrder; int depth; int bitsPerPixel; unsigned long red_mask; unsigned long green_mask; unsigned long blue_mask; int viewportWidth; int viewportHeight; int xViewportStep; int yViewportStep; int maxViewportX; int maxViewportY; int viewportFlags; int offset; unsigned char *address; int reserved1; int reserved2; } DGAModeRec, *DGAModePtr; num Can be ignored. The DGA DDX will assign these numbers. mode A pointer to the DisplayModeRec for this mode. flags The following flags are defined and may be OR'd together: DGA_CONCURRENT_ACCESS Indicates that the driver supports concurrent graphics accelerator and linear framebuffer access. DGA_FILL_RECT DGA_BLIT_RECT DGA_BLIT_RECT_TRANS Indicates that the driver supports the FillRect, BlitRect or BlitTransRect functions in this mode. DGA_PIXMAP_AVAILABLE Indicates that Xlib may be used on the framebuffer. This flag will usually be set unless the driver wishes to prohibit this for some reason. DGA_INTERLACED DGA_DOUBLESCAN Indicates that these are interlaced or double scan modes. imageWidth imageHeight These are the dimensions of the linear framebuffer accessible by the client. pixmapWidth pixmapHeight These are the dimensions of the area of the framebuffer accessible by the graphics accelerator. bytesPerScanline Pitch of the framebuffer in bytes. byteOrder Usually the same as pScrn->imageByteOrder. depth The depth of the framebuffer in this mode. bitsPerPixel The number of bits per pixel in this mode. red_mask green_mask blue_mask The RGB masks for this mode, if applicable. viewportWidth viewportHeight Dimensions of the visible part of the framebuffer. Usually mode->HDisplay and mode->VDisplay. xViewportStep yViewportStep The granularity of x and y viewport positions that the driver supports in this mode. maxViewportX maxViewportY The maximum viewport position supported by the driver in this mode. viewportFlags The following may be OR'd together: DGA_FLIP_IMMEDIATE The driver supports immediate viewport changes. DGA_FLIP_RETRACE The driver supports viewport changes at retrace. offset The offset into the linear framebuffer that corresponds to pixel (0,0) for this mode. address The virtual address of the framebuffer as mapped by the driver. This is needed when DGA_PIXMAP_AVAILABLE is set. /** The DGAFunctionRec **/ typedef struct { Bool (*OpenFramebuffer)( ScrnInfoPtr pScrn, char **name, unsigned char **mem, int *size, int *offset, int *extra ); void (*CloseFramebuffer)(ScrnInfoPtr pScrn); Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode); void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags); int (*GetViewport)(ScrnInfoPtr pScrn); void (*Sync)(ScrnInfoPtr); void (*FillRect)( ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color ); void (*BlitRect)( ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx, int dsty ); void (*BlitTransRect)( ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long color ); } DGAFunctionRec, *DGAFunctionPtr;
Bool OpenFramebuffer (pScrn, name, mem, size, offset, extra);
OpenFramebuffer() should pass the client everything it needs to know to be able to open the framebuffer. These parameters are OS specific and their meanings are to be interpreted by an OS specific client library. name The name of the device to open or NULL if there is no special device to open. A NULL name tells the client that it should open whatever device one would usually open to access physical memory. mem The physical address of the start of the framebuffer. size The size of the framebuffer in bytes. offset Any offset into the device, if applicable. flags Any additional information that the client may need. Currently, only the DGA_NEED_ROOT flag is defined.
void CloseFramebuffer (pScrn);
CloseFramebuffer() merely informs the driver (if it even cares) that client no longer needs to access the framebuffer directly. This function is optional.
Bool SetMode (pScrn, pMode);
SetMode() tells the driver to initialize the mode passed to it. If pMode is NULL, then the driver should restore the original pre-DGA mode.
void SetViewport (pScrn, x, y, flags);
SetViewport() tells the driver to make the upper left-hand corner of the visible screen correspond to coordinate (x,y) on the framebuffer. flags currently defined are: DGA_FLIP_IMMEDIATE The viewport change should occur immediately. DGA_FLIP_RETRACE The viewport change should occur at the vertical retrace, but this function should return sooner if possible. The (x,y) locations will be passed as the client specified them, however, the driver is expected to round these locations down to the next supported location as specified by the xViewportStep and yViewportStep for the current mode.
int GetViewport (pScrn);
GetViewport() gets the current page flip status. Set bits in the returned int correspond to viewport change requests still pending. For instance, set bit zero if the last SetViewport request is still pending, bit one if the one before that is still pending, etc.
void Sync (pScrn);
This function should ensure that any graphics accelerator operations have finished. This function should not return until the graphics accelerator is idle.
void FillRect (pScrn, x, y, w, h, color);
This optional function should fill a rectangle w × h located at (x,y) in the given color.
void BlitRect (pScrn, srcx, srcy, w, h, dstx, dsty);
This optional function should copy an area w × h located at (srcx,srcy) to location (dstx,dsty). This function will need to handle copy directions as appropriate.
void BlitTransRect (pScrn, srcx, srcy, w, h, dstx, dsty, color);
This optional function is the same as BlitRect except that pixels in the source corresponding to the color key color should be skipped.
The XFree86 X Video Extension (Xv) Device Dependent Layer XFree86 offers the X Video Extension which allows clients to treat video as any another primitive and Put video into drawables. By default, the extension reports no video adaptors as being available since the DDX layer has not been initialized. The driver can initialize the DDX layer by filling out one or more XF86VideoAdaptorRecs as described later in this document and passing a list of XF86VideoAdaptorPtr pointers to the following function: Bool xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr *adaptPtrs, int num); After doing this, the extension will report video adaptors as being available, providing the data in their respective XF86VideoAdaptorRecs was valid. xf86XVScreenInit() copies data from the structure passed to it so the driver may free it after the initialization. At the moment, the DDX only supports rendering into Window drawables. Pixmap rendering will be supported after a sufficient survey of suitable hardware is completed. The XF86VideoAdaptorRec: typedef struct { unsigned int type; int flags; char *name; int nEncodings; XF86VideoEncodingPtr pEncodings; int nFormats; XF86VideoFormatPtr pFormats; int nPorts; DevUnion *pPortPrivates; int nAttributes; XF86AttributePtr pAttributes; int nImages; XF86ImagePtr pImages; PutVideoFuncPtr PutVideo; PutStillFuncPtr PutStill; GetVideoFuncPtr GetVideo; GetStillFuncPtr GetStill; StopVideoFuncPtr StopVideo; SetPortAttributeFuncPtr SetPortAttribute; GetPortAttributeFuncPtr GetPortAttribute; QueryBestSizeFuncPtr QueryBestSize; PutImageFuncPtr PutImage; QueryImageAttributesFuncPtr QueryImageAttributes; } XF86VideoAdaptorRec, *XF86VideoAdaptorPtr; Each adaptor will have its own XF86VideoAdaptorRec. The fields are as follows: type This can be any of the following flags OR'd together. XvInputMask XvOutputMask These refer to the target drawable and are similar to a Window's class. XvInputMask indicates that the adaptor can put video into a drawable. XvOutputMask indicates that the adaptor can get video from a drawable. XvVideoMask XvStillMask XvImageMask These indicate that the adaptor supports video, still or image primitives respectively. XvWindowMask XvPixmapMask These indicate the types of drawables the adaptor is capable of rendering into. At the moment, Pixmap rendering is not supported and the XvPixmapMask flag is ignored. flags Currently, the following flags are defined: VIDEO_OVERLAID_STILLS Implementing PutStill for hardware that does video as an overlay can be awkward since it's unclear how long to leave the video up for. When this flag is set, StopVideo will be called whenever the destination gets clipped or moved so that the still can be left up until then. VIDEO_OVERLAID_IMAGES Same as VIDEO_OVERLAID_STILLS but for images. VIDEO_CLIP_TO_VIEWPORT Indicates that the clip region passed to the driver functions should be clipped to the visible portion of the screen in the case where the viewport is smaller than the virtual desktop. name The name of the adaptor. nEncodings pEncodings The number of encodings the adaptor is capable of and pointer to the XF86VideoEncodingRec array. The XF86VideoEncodingRec is described later on. For drivers that only support XvImages there should be an encoding named "XV_IMAGE" and the width and height should specify the maximum size source image supported. nFormats pFormats The number of formats the adaptor is capable of and pointer to the XF86VideoFormatRec array. The XF86VideoFormatRec is described later on. nPorts pPortPrivates The number of ports is the number of separate data streams which the adaptor can handle simultaneously. If you have more than one port, the adaptor is expected to be able to render into more than one window at a time. pPortPrivates is an array of pointers or ints - one for each port. A port's private data will be passed to the driver any time the port is requested to do something like put the video or stop the video. In the case where there may be many ports, this enables the driver to know which port the request is intended for. Most commonly, this will contain a pointer to the data structure containing information about the port. In Xv, all ports on a particular adaptor are expected to be identical in their functionality. nAttributes pAttributes The number of attributes recognized by the adaptor and a pointer to the array of XF86AttributeRecs. The XF86AttributeRec is described later on. nImages pImages The number of XF86ImageRecs supported by the adaptor and a pointer to the array of XF86ImageRecs. The XF86ImageRec is described later on. PutVideo PutStill GetVideo GetStill StopVideo SetPortAttribute GetPortAttribute QueryBestSize PutImage QueryImageAttributes These functions define the DDX->driver interface. In each case, the pointer data is passed to the driver. This is the port private for that port as described above. All fields are required except under the following conditions: PutVideo, PutStill and the image routines PutImage and QueryImageAttributes are not required when the adaptor type does not contain XvInputMask. GetVideo and GetStill are not required when the adaptor type does not contain XvOutputMask. GetVideo and PutVideo are not required when the adaptor type does not contain XvVideoMask. GetStill and PutStill are not required when the adaptor type does not contain XvStillMask. PutImage and QueryImageAttributes are not required when the adaptor type does not contain XvImageMask. With the exception of QueryImageAttributes, these functions should return Success if the operation was completed successfully. They can return XvBadAlloc otherwise. QueryImageAttributes returns the size of the XvImage queried. ClipBoxes is an X-Y banded region identical to those used throughout the server. The clipBoxes represent the visible portions of the area determined by drw_x, drw_y, drw_w and drw_h in the Get/Put function. The boxes are in screen coordinates, are guaranteed not to overlap and an empty region will never be passed.
typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, pointer data );
This indicates that the driver should take a subsection vid_w by vid_h at location (vid_x,vid_y) from the video stream and direct it into the rectangle drw_w by drw_h at location (drw_x,drw_y) on the screen, scaling as necessary. Due to the large variations in capabilities of the various hardware expected to be used with this extension, it is not expected that all hardware will be able to do this exactly as described. In that case the driver should just do the best it can, scaling as closely to the target rectangle as it can without rendering outside of it. In the worst case, the driver can opt to just not turn on the video.
typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, pointer data );
This is same as PutVideo except that the driver should place only one frame from the stream on the screen.
typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, pointer data );
This is same as PutVideo except that the driver gets video from the screen and outputs it. The driver should do the best it can to get the requested dimensions correct without reading from an area larger than requested.
typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, pointer data );
This is the same as GetVideo except that the driver should place only one frame from the screen into the output stream.
typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, pointer data, Bool cleanup);
This indicates the driver should stop displaying the video. This is used to stop both input and output video. The cleanup field indicates that the video is being stopped because the client requested it to stop or because the server is exiting the current VT. In that case the driver should deallocate any offscreen memory areas (if there are any) being used to put the video to the screen. If cleanup is not set, the video is being stopped temporarily due to clipping or moving of the window, etc... and video will likely be restarted soon so the driver should not deallocate any offscreen areas associated with that port.
typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,INT32 value, pointer data); typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,INT32 *value, pointer data);
A port may have particular attributes such as hue, saturation, brightness or contrast. Xv clients set and get these attribute values by sending attribute strings (Atoms) to the server. Such requests end up at these driver functions. It is recommended that the driver provide at least the following attributes mentioned in the Xv client library docs: XV_ENCODING XV_HUE XV_SATURATION XV_BRIGHTNESS XV_CONTRAST but the driver may recognize as many atoms as it wishes. If a requested attribute is unknown by the driver it should return BadMatch. XV_ENCODING is the attribute intended to let the client specify which video encoding the particular port should be using (see the description of XF86VideoEncodingRec below). If the requested encoding is unsupported, the driver should return XvBadEncoding. If the value lies outside the advertised range BadValue may be returned. Success should be returned otherwise.
typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, pointer data);
QueryBestSize provides the client with a way to query what the destination dimensions would end up being if they were to request that an area vid_w by vid_h from the video stream be scaled to rectangle of drw_w by drw_h on the screen. Since it is not expected that all hardware will be able to get the target dimensions exactly, it is important that the driver provide this function.
typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int image, char *buf, short width, short height, Bool sync, RegionPtr clipBoxes, pointer data );
This is similar to PutStill except that the source of the video is not a port but the data stored in a system memory buffer at buf. The data is in the format indicated by the image descriptor and represents a source of size width by height. If sync is TRUE the driver should not return from this function until it is through reading the data from buf. Returning when sync is TRUE indicates that it is safe for the data at buf to be replaced, freed, or modified.
typedef int (* QueryImageAttributesFuncPtr)( ScrnInfoPtr pScrn, int image, short *width, short *height, int *pitches, int *offsets);
This function is called to let the driver specify how data for a particular image of size width by height should be stored. Sometimes only the size and corrected width and height are needed. In that case pitches and offsets are NULL. The size of the memory required for the image is returned by this function. The width and height of the requested image can be altered by the driver to reflect format limitations (such as component sampling periods that are larger than one). If pitches and offsets are not NULL, these will be arrays with as many elements in them as there are planes in the image format. The driver should specify the pitch (in bytes) of each scanline in the particular plane as well as the offset to that plane (in bytes) from the beginning of the image.
The XF86VideoEncodingRec:
typedef struct { int id; char *name; unsigned short width, height; XvRationalRec rate; } XF86VideoEncodingRec, *XF86VideoEncodingPtr;
The XF86VideoEncodingRec specifies what encodings the adaptor can support. Most of this data is just informational and for the client's benefit, and is what will be reported by XvQueryEncodings. The id field is expected to be a unique identifier to allow the client to request a certain encoding via the XV_ENCODING attribute string.
The XF86VideoFormatRec:
typedef struct { char depth; short class; } XF86VideoFormatRec, *XF86VideoFormatPtr;
This specifies what visuals the video is viewable in. depth is the depth of the visual (not bpp). class is the visual class such as TrueColor, DirectColor or PseudoColor. Initialization of an adaptor will fail if none of the visuals on that screen are supported.
The XF86AttributeRec:
typedef struct { int flags; int min_value; int max_value; char *name; } XF86AttributeListRec, *XF86AttributeListPtr;
Each adaptor may have an array of these advertising the attributes for its ports. Currently defined flags are XvGettable and XvSettable which may be OR'd together indicating that attribute is gettable or settable by the client. The min and max field specify the valid range for the value. Name is a text string describing the attribute by name.
The XF86ImageRec:
typedef struct { int id; int type; int byte_order; char guid[16]; int bits_per_pixel; int format; int num_planes; /* for RGB formats */ int depth; unsigned int red_mask; unsigned int green_mask; unsigned int blue_mask; /* for YUV formats */ unsigned int y_sample_bits; unsigned int u_sample_bits; unsigned int v_sample_bits; unsigned int horz_y_period; unsigned int horz_u_period; unsigned int horz_v_period; unsigned int vert_y_period; unsigned int vert_u_period; unsigned int vert_v_period; char component_order[32]; int scanline_order; } XF86ImageRec, *XF86ImagePtr;
XF86ImageRec describes how video source data is laid out in memory. The fields are as follows: id This is a unique descriptor for the format. It is often good to set this value to the FOURCC for the format when applicable. type This is XvRGB or XvYUV. byte_order This is LSBFirst or MSBFirst. guid This is the Globally Unique IDentifier for the format. When not applicable, all characters should be NULL. bits_per_pixel The number of bits taken up (but not necessarily used) by each pixel. Note that for some planar formats which have fractional bits per pixel (such as IF09) this number may be rounded _down_. format This is XvPlanar or XvPacked. num_planes The number of planes in planar formats. This should be set to one for packed formats. depth The significant bits per pixel in RGB formats (analgous to the depth of a pixmap format). red_mask green_mask blue_mask The red, green and blue bitmasks for packed RGB formats. y_sample_bits u_sample_bits v_sample_bits The y, u and v sample sizes (in bits). horz_y_period horz_u_period horz_v_period The y, u and v sampling periods in the horizontal direction. vert_y_period vert_u_period vert_v_period The y, u and v sampling periods in the vertical direction. component_order Uppercase ascii characters representing the order that samples are stored within packed formats. For planar formats this represents the ordering of the planes. Unused characters in the 32 byte string should be set to NULL. scanline_order This is XvTopToBottom or XvBottomToTop. Since some formats (particular some planar YUV formats) may not be completely defined by the parameters above, the guid, when available, should provide the most accurate description of the format.
The Loader This section describes the interfaces to the module loader. The loader interfaces can be divided into two groups: those that are only available to the XFree86 common layer, and those that are also available to modules. Loader Overview The loader is capable of loading modules in a range of object formats, and knowledge of these formats is built in to the loader. Knowledge of new object formats can be added to the loader in a straightforward manner. This makes it possible to provide OS-independent modules (for a given CPU architecture type). In addition to this, the loader can load modules via the OS-provided dlopen(3) service where available. Such modules are not platform independent, and the semantics of dlopen() on most systems results in significant limitations in the use of modules of this type. Support for dlopen() modules in the loader is primarily for experimental and development purposes. Symbols exported by the loader (on behalf of the core X server) to modules are determined at compile time. Only those symbols explicitly exported are available to modules. All external symbols of loaded modules are exported to other modules, and to the core X server. The loader can be requested to check for unresolved symbols at any time, and the action to be taken for unresolved symbols can be controlled by the caller of the loader. Typically the caller identifies which symbols can safely remain unresolved and which cannot. NOTE: Now that ISO-C allows pointers to functions and pointers to data to have different internal representations, some of the following interfaces will need to be revisited. Semi-private Loader Interface The following is the semi-private loader interface that is available to the XFree86 common layer.
void LoaderInit(void);
The LoaderInit() function initialises the loader, and it must be called once before calling any other loader functions. This function initialises the tables of exported symbols, and anything else that might need to be initialised.
void LoaderSetPath(const char *path);
The LoaderSetPath() function initialises a default module search path. This must be called if calls to other functions are to be made without explicitly specifying a module search path. The search path path must be a string of one or more comma separated absolute paths. Modules are expected to be located below these paths, possibly in subdirectories of these paths.
pointer LoadModule(const char *module, const char *path, const char **subdirlist, const char **patternlist, pointer options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin);
The LoadModule() function loads the module called module. The return value is a module handle, and may be used in future calls to the loader that require a reference to a loaded module. The module name module is normally the module's canonical name, which doesn't contain any directory path information, or any object/library file prefixes of suffixes. Currently a full pathname and/or filename is also accepted. This might change. The other parameters are: path An optional comma-separated list of module search paths. When NULL, the default search path is used. subdirlist An optional NULL terminated list of subdirectories to search. When NULL, the default built-in list is used (refer to stdSubdirs in loadmod.c). The default list is also substituted for entries in subdirlist with the value DEFAULT_LIST. This makes is possible to augment the default list instead of replacing it. Subdir elements must be relative, and must not contain "..". If any violate this requirement, the load fails. patternlist An optional NULL terminated list of POSIX regular expressions used to connect module filenames with canonical module names. Each regex should contain exactly one subexpression that corresponds to the canonical module name. When NULL, the default built-in list is used (refer to stdPatterns in loadmod.c). The default list is also substituted for entries in patternlist with the value DEFAULT_LIST. This makes it possible to augment the default list instead of replacing it. options An optional parameter that is passed to the newly loaded module's SetupProc function (if it has one). This argument is normally a NULL terminated list of Options, and must be interpreted that way by modules loaded directly by the XFree86 common layer. However, it may be used for application-specific parameter passing in other situations. modreq An optional XF86ModReqInfo* containing version/ABI/vendor information to requirements to check the newly loaded module against. The main purpose of this is to allow the loader to verify that a module of the correct type/version before running its SetupProc function. The XF86ModReqInfo struct is defined as follows: typedef struct { CARD8 majorversion; /* MAJOR_UNSPEC */ CARD8 minorversion; /* MINOR_UNSPEC */ CARD16 patchlevel; /* PATCH_UNSPEC */ const char * abiclass; /* ABI_CLASS_NONE */ CARD32 abiversion; /* ABI_VERS_UNSPEC */ const char * moduleclass; /* MOD_CLASS_NONE */ } XF86ModReqInfo; The information here is compared against the equivalent information in the module's XF86ModuleVersionInfo record (which is described below). The values in comments above indicate don't care settings for each of the fields. The comparisons made are as follows: majorversion Must match the module's majorversion exactly. minorversion The module's minor version must be no less than this value. This comparison is only made if majorversion is specified and matches. patchlevel The module's patchlevel must be no less than this value. This comparison is only made if minorversion is specified and matches. abiclass String must match the module's abiclass string. abiversion Must be consistent with the module's abiversion (major equal, minor no older). moduleclass String must match the module's moduleclass string. errmaj An optional pointer to a variable holding the major part or the error code. When provided, *errmaj is filled in when LoadModule() fails. errmin Like errmaj, but for the minor part of the error code.
void UnloadModule(pointer mod);
This function unloads the module referred to by the handle mod. All child modules are also unloaded recursively. This function must not be used to directly unload modules that are child modules (i.e., those that have been loaded with the LoadSubModule() described below).
Module Requirements Modules must provide information about themselves to the loader, and may optionally provide entry points for "setup" and "teardown" functions (those two functions are referred to here as SetupProc and TearDownProc). The module information is contained in the XF86ModuleVersionInfo struct, which is defined as follows: typedef struct { const char * modname; /* name of module, e.g. "foo" */ const char * vendor; /* vendor specific string */ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */ CARD32 _modinfo2_; /* infoarea with a binary editor/sign tool */ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */ CARD8 majorversion; /* module-specific major version */ CARD8 minorversion; /* module-specific minor version */ CARD16 patchlevel; /* module-specific patch level */ const char * abiclass; /* ABI class that the module uses */ CARD32 abiversion; /* ABI version */ const char * moduleclass; /* module class */ CARD32 checksum[4]; /* contains a digital signature of the */ /* version info structure */ } XF86ModuleVersionInfo; The fields are used as follows: modname The module's name. This field is currently only for informational purposes, but the loader may be modified in future to require it to match the module's canonical name. vendor The module vendor. This field is for informational purposes only. _modinfo1_ This field holds the first part of a signature that can be used to locate this structure in the binary. It should always be initialised to MODINFOSTRING1. _modinfo2_ This field holds the second part of a signature that can be used to locate this structure in the binary. It should always be initialised to MODINFOSTRING2. xf86version The XFree86 version against which the module was compiled. This is mostly for informational/diagnostic purposes. It should be initialised to XF86_VERSION_CURRENT, which is defined in xf86Version.h. majorversion The module-specific major version. For modules where this version is used for more than simply informational purposes, the major version should only change (be incremented) when ABI incompatibilities are introduced, or ABI components are removed. minorversion The module-specific minor version. For modules where this version is used for more than simply informational purposes, the minor version should only change (be incremented) when ABI additions are made in a backward compatible way. It should be reset to zero when the major version is increased. patchlevel The module-specific patch level. The patch level should increase with new revisions of the module where there are no ABI changes, and it should be reset to zero when the minor version is increased. abiclass The ABI class that the module requires. The class is specified as a string for easy extensibility. It should indicate which (if any) of the X server's built-in ABI classes that the module relies on, or a third-party ABI if appropriate. Built-in ABI classes currently defined are: ABI_CLASS_NONE no class ABI_CLASS_ANSIC only requires the ANSI C interfaces ABI_CLASS_VIDEODRV requires the video driver ABI ABI_CLASS_XINPUT requires the XInput driver ABI ABI_CLASS_EXTENSION requires the extension module ABI ABI_CLASS_FONT requires the font module ABI abiversion The version of abiclass that the module requires. The version consists of major and minor components. The major version must match and the minor version must be no newer than that provided by the server or parent module. Version identifiers for the built-in classes currently defined are: ABI_ANSIC_VERSION ABI_VIDEODRV_VERSION ABI_XINPUT_VERSION ABI_EXTENSION_VERSION ABI_FONT_VERSION moduleclass This is similar to the abiclass field, except that it defines the type of module rather than the ABI it requires. For example, although all video drivers require the video driver ABI, not all modules that require the video driver ABI are video drivers. This distinction can be made with the moduleclass. Currently pre-defined module classes are: MOD_CLASS_NONE MOD_CLASS_VIDEODRV MOD_CLASS_XINPUT MOD_CLASS_FONT MOD_CLASS_EXTENSION checksum Not currently used. The module version information, and the optional SetupProc and TearDownProc entry points are found by the loader by locating a data object in the module called "modnameModuleData", where "modname" is the canonical name of the module. Modules must contain such a data object, and it must be declared with global scope, be compile-time initialised, and is of the following type: typedef struct { XF86ModuleVersionInfo * vers; ModuleSetupProc setup; ModuleTearDownProc teardown; } XF86ModuleData; The vers parameter must be initialised to a pointer to a correctly initialised XF86ModuleVersionInfo struct. The other two parameter are optional, and should be initialised to NULL when not required. The other parameters are defined as
typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *); typedef void (*ModuleTearDownProc)(pointer); pointer SetupProc(pointer module, pointer options, int *errmaj, int *errmin);
When defined, this function is called by the loader after successfully loading a module. module is a handle for the newly loaded module, and maybe used by the SetupProc if it calls other loader functions that require a reference to it. The remaining arguments are those that were passed to the LoadModule() (or LoadSubModule()), and are described above. When the SetupProc is successful it must return a non-NULL value. The loader checks this, and if it is NULL it unloads the module and reports the failure to the caller of LoadModule(). If the SetupProc does things that need to be undone when the module is unloaded, it should define a TearDownProc, and return a pointer that the TearDownProc can use to undo what has been done. When a module is loaded multiple times, the SetupProc is called once for each time it is loaded.
void TearDownProc(pointer tearDownData);
When defined, this function is called when the loader unloads a module. The tearDownData parameter is the return value of the SetupProc() that was called when the module was loaded. The purpose of this function is to clean up before the module is unloaded (for example, by freeing allocated resources).
Public Loader Interface The following is the Loader interface that is available to any part of the server, and may also be used from within modules.
pointer LoadSubModule(pointer parent, const char *module, const char **subdirlist, const char **patternlist, pointer options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin);
This function is like the LoadModule() function described above, except that the module loaded is registered as a child of the calling module. The parent parameter is the calling module's handle. Modules loaded with this function are automatically unloaded when the parent module is unloaded. The other difference is that the path parameter may not be specified. The module search path used for modules loaded with this function is the default search path as initialised with LoaderSetPath().
void UnloadSubModule(pointer module);
This function unloads the module with handle module. If that module itself has children, they are also unloaded. It is like UnloadModule(), except that it is safe to use for unloading child modules.
pointer LoaderSymbol(const char *symbol);
This function returns the address of the symbol with name symbol. This may be used to locate a module entry point with a known name.
char **LoaderlistDirs(const char **subdirlist, const char **patternlist);
This function returns a NULL terminated list of canonical modules names for modules found in the default module search path. The subdirlist and patternlist parameters are as described above, and can be used to control the locations and names that are searched. If no modules are found, the return value is NULL. The returned list should be freed by calling LoaderFreeDirList() when it is no longer needed.
void LoaderFreeDirList(char **list);
This function frees a module list created by LoaderlistDirs().
void LoaderReqSymLists(const char **list0, ...);
This function allows the registration of required symbols with the loader. It is normally used by a caller of LoadSubModule(). If any symbols registered in this way are found to be unresolved when LoaderCheckUnresolved() is called then LoaderCheckUnresolved() will report a failure. The function takes one or more NULL terminated lists of symbols. The end of the argument list is indicated by a NULL argument.
void LoaderReqSymbols(const char *sym0, ...);
This function is like LoaderReqSymLists() except that its arguments are symbols rather than lists of symbols. This function is more convenient when single functions are to be registered, especially when the single function might depend on runtime factors. The end of the argument list is indicated by a NULL argument.
void LoaderRefSymLists(const char **list0, ...);
This function allows the registration of possibly unresolved symbols with the loader. When LoaderCheckUnresolved() is run it won't generate warnings for symbols registered in this way unless they were also registered as required symbols. The function takes one or more NULL terminated lists of symbols. The end of the argument list is indicated by a NULL argument.
void LoaderRefSymbols(const char *sym0, ...);
This function is like LoaderRefSymLists() except that its arguments are symbols rather than lists of symbols. This function is more convenient when single functions are to be registered, especially when the single function might depend on runtime factors. The end of the argument list is indicated by a NULL argument.
int LoaderCheckUnresolved(int delayflag);
This function checks for unresolved symbols. It generates warnings for unresolved symbols that have not been registered with LoaderRefSymLists(), and maps them to a dummy function. This behaviour may change in future. If unresolved symbols are found that have been registered with LoaderReqSymLists() or LoaderReqSymbols() then this function returns a non-zero value. If none of these symbols are unresolved the return value is zero, indicating success. The delayflag parameter should normally be set to LD_RESOLV_IFDONE.
LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin);
This function prints an error message that includes the text Failed to load module, the module name modname, a message specific to the errmaj value, and the value if errmin. If name is non-NULL, it is printed as an identifying prefix to the message (followed by a :).
Special Registration Functions The loader contains some functions for registering some classes of modules. These may be moved out of the loader at some point.
void LoadExtensionList(const ExtensionModule ext[]);
This registers the entry points for the extension array identified by ext. The ExtensionModule struct is defined as: typedef struct { InitExtension initFunc; char * name; Bool *disablePtr; } ExtensionModule;
Helper Functions This section describe helper functions that video driver might find useful. While video drivers are not required to use any of these to be considered compliant, the use of appropriate helpers is strongly encouraged to improve the consistency of driver behaviour. Functions for printing messages
ErrorF(const char *format, ...);
This is the basic function for writing to the error log (typically stderr and/or a log file). Video drivers should usually avoid using this directly in favour of the more specialised functions described below. This function is useful for printing messages while debugging a driver.
FatalError(const char *format, ...);
This prints a message and causes the Xserver to abort. It should rarely be used within a video driver, as most error conditions should be flagged by the return values of the driver functions. This allows the higher layers to decide how to proceed. In rare cases, this can be used within a driver if a fatal unexpected condition is found.
xf86ErrorF(const char *format, ...);
This is like ErrorF(), except that the message is only printed when the Xserver's verbosity level is set to the default (1) or higher. It means that the messages are not printed when the server is started with the flag. Typically this function would only be used for continuing messages started with one of the more specialised functions described below.
xf86ErrorFVerb(int verb, const char *format, ...);
Like xf86ErrorF(), except the minimum verbosity level for which the message is to be printed is given explicitly. Passing a verb value of zero means the message is always printed. A value higher than 1 can be used for information would normally not be needed, but which might be useful when diagnosing problems.
xf86Msg(MessageType type, const char *format, ...);
This is like xf86ErrorF(), except that the message is prefixed with a marker determined by the value of type. The marker is used to indicate the type of message (warning, error, probed value, config value, etc). Note the xf86Verbose value is ignored for messages of type X_ERROR. The marker values are: X_PROBED Value was probed. X_CONFIG Value was given in the config file. X_DEFAULT Value is a default. X_CMDLINE Value was given on the command line. X_NOTICE Notice. X_ERROR Error message. X_WARNING Warning message. X_INFO Informational message. X_NONE No prefix. X_NOT_IMPLEMENTED The message relates to functionality that is not yetimplemented.
xf86MsgVerb(MessageType type, int verb, const char *format, ...);
Like xf86Msg(), but with the verbosity level given explicitly.
xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...);
This is like xf86Msg() except that the driver's name (the name field of the ScrnInfoRec) followed by the scrnIndex in parentheses is printed following the prefix. This should be used by video drivers in most cases as it clearly indicates which driver/screen the message is for. If scrnIndex is negative, this function behaves exactly like xf86Msg(). NOTE: This function can only be used after the ScrnInfoRec and its name field have been allocated. Normally, this means that it can not be used before the END of the ChipProbe() function. Prior to that, use xf86Msg(), providing the driver's name explicitly. No screen number can be supplied at that point.
xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, ...);
Like xf86DrvMsg(), but with the verbosity level given explicitly.
Functions for setting values based on command line and config file
Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp, int depth24flags);
This function sets the depth, pixmapBPP and bitsPerPixel fields of the ScrnInfoRec. It also determines the defaults for display-wide attributes and pixmap formats the screen will support, and finds the Display subsection that matches the depth/bpp. This function should normally be called very early from the ChipPreInit() function. It requires that the confScreen field of the ScrnInfoRec be initialised prior to calling it. This is done by the XFree86 common layer prior to calling ChipPreInit(). The parameters passed are: depth driver's preferred default depth if no other is given. If zero, use the overall server default. bpp Same, but for the pixmap bpp. fbbpp Same, but for the framebuffer bpp. depth24flags Flags that indicate the level of 24/32bpp support and whether conversion between different framebuffer and pixmap formats is supported. The flags for this argument are defined as follows, and multiple flags may be ORed together: NoDepth24Support No depth 24 formats supported Support24bppFb 24bpp framebuffer supported Support32bppFb 32bpp framebuffer supported SupportConvert24to32 Can convert 24bpp pixmap to 32bpp fb SupportConvert32to24 Can convert 32bpp pixmap to 24bpp fb ForceConvert24to32 Force 24bpp pixmap to 32bpp fb conversion ForceConvert32to24 Force 32bpp pixmap to 24bpp fb conversion It uses the command line, config file, and default values in the correct order of precedence to determine the depth and bpp values. It is up to the driver to check the results to see that it supports them. If not the ChipPreInit() function should return FALSE. If only one of depth/bpp is given, the other is set to a reasonable (and consistent) default. If a driver finds that the initial depth24flags it uses later results in a fb format that requires more video memory than is available it may call this function a second time with a different depth24flags setting. On success, the return value is TRUE. On failure it prints an error message and returns FALSE. The following fields of the ScrnInfoRec are initialised by this function:
depth, bitsPerPixel, display, imageByteOrder, bitmapScanlinePad, bitmapScanlineUnit, bitmapBitOrder, numFormats, formats, fbFormat.
void xf86PrintDepthBpp(scrnInfoPtr scrp);
This function can be used to print out the depth and bpp settings. It should be called after the final call to xf86SetDepthBpp().
Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
This function sets the weight, mask, offset and rgbBits fields of the ScrnInfoRec. It would normally be called fairly early in the ChipPreInit() function for depths > 8bpp. It requires that the depth and display fields of the ScrnInfoRec be initialised prior to calling it. The parameters passed are: weight driver's preferred default weight if no other is given. If zero, use the overall server default. mask Same, but for mask. It uses the command line, config file, and default values in the correct order of precedence to determine the weight value. It derives the mask and offset values from the weight and the defaults. It is up to the driver to check the results to see that it supports them. If not the ChipPreInit() function should return FALSE. On success, this function prints a message showing the weight values selected, and returns TRUE. On failure it prints an error message and returns FALSE. The following fields of the ScrnInfoRec are initialised by this function:
weight, mask, offset.
Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
This function sets the defaultVisual field of the ScrnInfoRec. It would normally be called fairly early from the ChipPreInit() function. It requires that the depth and display fields of the ScrnInfoRec be initialised prior to calling it. The parameters passed are: visual driver's preferred default visual if no other is given. If -1, use the overall server default. It uses the command line, config file, and default values in the correct order of precedence to determine the default visual value. It is up to the driver to check the result to see that it supports it. If not the ChipPreInit() function should return FALSE. On success, this function prints a message showing the default visual selected, and returns TRUE. On failure it prints an error message and returns FALSE.
Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma);
This function sets the gamma field of the ScrnInfoRec. It would normally be called fairly early from the ChipPreInit() function in cases where the driver supports gamma correction. It requires that the monitor field of the ScrnInfoRec be initialised prior to calling it. The parameters passed are: gamma driver's preferred default gamma if no other is given. If zero (< 0.01), use the overall server default. It uses the command line, config file, and default values in the correct order of precedence to determine the gamma value. It is up to the driver to check the results to see that it supports them. If not the ChipPreInit() function should return FALSE. On success, this function prints a message showing the gamma value selected, and returns TRUE. On failure it prints an error message and returns FALSE.
void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
This function sets the xDpi and yDpi fields of the ScrnInfoRec. The driver can specify preferred defaults by setting x and y to non-zero values. The command line option overrides all other settings. Otherwise, if the DisplaySize entry is present in the screen's &k.monitor; config file section, it is used together with the virtual size to calculate the dpi values. This function should be called after all the mode resolution has been done.
void xf86SetBlackWhitePixels(ScrnInfoPtr pScrn);
This functions sets the blackPixel and whitePixel fields of the ScrnInfoRec according to whether or not the command line options is present.
const char *xf86GetVisualName(int visual);
Returns a printable string with the visual name matching the numerical visual class provided. If the value is outside the range of valid visual classes, NULL is returned.
Primary Mode functions The primary mode helper functions are those which would normally be used by a driver, unless it has unusual requirements which cannot be catered for the by the helpers.
int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int pitchInc, int minHeight, int maxHeight, int virtualX, int virtualY, unsigned long apertureSize, LookupModeFlags strategy);
This function basically selects the set of modes to use based on those available and the various constraints. It also sets some other related parameters. It is normally called near the end of the ChipPreInit() function. The parameters passed to the function are: availModes List of modes available for the monitor. modeNames List of mode names that the screen is requesting. clockRanges A list of clock ranges allowed by the driver. Each range includes whether interlaced or multiscan modes are supported for that range. See below for more on clockRanges. linePitches List of line pitches supported by the driver. This is optional and should be NULL when not used. minPitch Minimum line pitch supported by the driver. This must be supplied when linePitches is NULL, and is ignored otherwise. maxPitch Maximum line pitch supported by the driver. This is required when minPitch is required. pitchInc Granularity of horizontal pitch values as supported by the chipset. This is expressed in bits. This must be supplied. minHeight minimum virtual height allowed. If zero, no limit is imposed. maxHeight maximum virtual height allowed. If zero, no limit is imposed. virtualX If greater than zero, this is the virtual width value that will be used. Otherwise, the virtual width is chosen to be the smallest that can accommodate the modes selected. virtualY If greater than zero, this is the virtual height value that will be used. Otherwise, the virtual height is chosen to be the smallest that can accommodate the modes selected. apertureSize The size (in bytes) of the aperture used to access video memory. strategy The strategy to use when choosing from multiple modes with the same name. The options are: LOOKUP_DEFAULT ??? LOOKUP_BEST_REFRESH mode with best refresh rate LOOKUP_CLOSEST_CLOCK mode with closest matching clock LOOKUP_LIST_ORDER first usable mode in list The following options can also be combined (OR'ed) with one of the above: LOOKUP_CLKDIV2 Allow halved clocks LOOKUP_OPTIONAL_TOLERANCES Allow missing horizontal sync and/or vertical refresh ranges in the xorg.conf Monitor section LOOKUP_OPTIONAL_TOLERANCES should only be specified when the driver can ensure all modes it generates can sync on, or at least not damage, the monitor or digital flat panel. Horizontal sync and/or vertical refresh ranges specified by the user will still be honoured (and acted upon). This function requires that the following fields of the ScrnInfoRec are initialised prior to calling it: clock[] List of discrete clocks (when non-programmable) numClocks Number of discrete clocks (when non-programmable) progClock Whether the clock is programmable or not monitor Pointer to the applicable xorg.conf monitor section fdFormat Format of the screen buffer videoRam total video memory size (in bytes) maxHValue Maximum horizontal timing value allowed maxVValue Maximum vertical timing value allowed xInc Horizontal timing increment in pixels (defaults to 8) This function fills in the following ScrnInfoRec fields: modePool A subset of the modes available to the monitor which are compatible with the driver. modes One mode entry for each of the requested modes, with the status field of each filled in to indicate if the mode has been accepted or not. This list of modes is a circular list. virtualX The resulting virtual width. virtualY The resulting virtual height. displayWidth The resulting line pitch. virtualFrom Where the virtual size was determined from. The first stage of this function checks that the virtualX and virtualY values supplied (if greater than zero) are consistent with the line pitch and maxHeight limitations. If not, an error message is printed, and the return value is -1. The second stage sets up the mode pool, eliminating immediately any modes that exceed the driver's line pitch limits, and also the virtual width and height limits (if greater than zero). For each mode removed an informational message is printed at verbosity level 2. If the mode pool ends up being empty, a warning message is printed, and the return value is 0. The final stage is to lookup each mode name, and fill in the remaining parameters. If an error condition is encountered, a message is printed, and the return value is -1. Otherwise, the return value is the number of valid modes found (0 if none are found). Even if the supplied mode names include duplicates, no two names will ever match the same mode. Furthermore, if the supplied mode names do not yield a valid mode (including the case where no names are passed at all), the function will continue looking through the mode pool until it finds a mode that survives all checks, or until the mode pool is exhausted. A message is only printed by this function when a fundamental problem is found. It is intended that this function may be called more than once if there is more than one set of constraints that the driver can work within. If this function returns -1, the ChipPreInit() function should return FALSE. clockRanges is a linked list of clock ranges allowed by the driver. If a mode doesn't fit in any of the defined clockRanges, it is rejected. The first clockRange that matches all requirements is used. This structure needs to be initialized to NULL when allocated. clockRanges contains the following fields: minClock maxClock The lower and upper mode clock bounds for which the rest of the clockRange parameters apply. Since these are the mode clocks, they are not scaled with the ClockMulFactor and ClockDivFactor. It is up to the driver to adjust these values if they depend on the clock scaling factors. clockIndex (not used yet) -1 for programmable clocks interlaceAllowed TRUE if interlacing is allowed for this range doubleScanAllowed TRUE if doublescan or multiscan is allowed for this range ClockMulFactor ClockDivFactor Scaling factors that are applied to the mode clocks ONLY before selecting a clock index (when there is no programmable clock) or a SynthClock value. This is useful for drivers that support pixel multiplexing or that need to scale the clocks because of hardware restrictions (like sending 24bpp data to an 8 bit RAMDAC using a tripled clock). Note that these parameters describe what must be done to the mode clock to achieve the data transport clock between graphics controller and RAMDAC. For example for 2:1 pixel multiplexing, two pixels are sent to the RAMDAC on each clock. This allows the RAMDAC clock to be half of the actual pixel clock. Hence, ClockMulFactor=1 and ClockDivFactor=2. This means that the clock used for clock selection (ie, determining the correct clock index from the list of discrete clocks) or for the SynthClock field in case of a programmable clock is: (mode->Clock * ClockMulFactor) / ClockDivFactor. PrivFlags This field is copied into the mode->PrivFlags field when this clockRange is selected by xf86ValidateModes(). It allows the driver to find out what clock range was selected, so it knows it needs to set up pixel multiplexing or any other range-dependent feature. This field is purely driver-defined: it may contain flag bits, an index or anything else (as long as it is an INT). Note that the mode->SynthClock field is always filled in by xf86ValidateModes(): it will contain the data transport clock, which is the clock that will have to be programmed in the chip when it has a programmable clock, or the clock that will be picked from the clocks list when it is not a programmable one. Thus: mode->SynthClock = (mode->Clock * ClockMulFactor) / ClockDivFactor
void xf86PruneDriverModes(ScrnInfoPtr scrp);
This function deletes modes in the modes field of the ScrnInfoRec that have been marked as invalid. This is normally run after having run xf86ValidateModes() for the last time. For each mode that is deleted, a warning message is printed out indicating the reason for it being deleted.
void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
This function fills in the Crtc* fields for all the modes in the modes field of the ScrnInfoRec. The adjustFlags parameter determines how the vertical CRTC values are scaled for interlaced modes. They are halved if it is INTERLACE_HALVE_V. The vertical CRTC values are doubled for doublescan modes, and are further multiplied by the VScan value. This function is normally called after calling xf86PruneDriverModes().
void xf86PrintModes(ScrnInfoPtr scrp);
This function prints out the virtual size setting, and the line pitch being used. It also prints out two lines for each mode being used. The first line includes the mode's pixel clock, horizontal sync rate, refresh rate, and whether it is interlaced, doublescanned and/or multi-scanned. The second line is the mode's Modeline. This function is normally called after calling xf86SetCrtcForModes().
Secondary Mode functions The secondary mode helper functions are functions which are normally used by the primary mode helper functions, and which are not normally called directly by a driver. If a driver has unusual requirements and needs to do its own mode validation, it might be able to make use of some of these secondary mode helper functions.
int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2, int *divider);
This function returns the index of the closest clock to the frequency freq given (in kHz). It assumes that the number of clocks is greater than zero. It requires that the numClocks and clock fields of the ScrnInfoRec are initialised. The allowDiv2 field determines if the clocks can be halved. The *divider return value indicates whether clock division is used when determining the clock returned. This function is only for non-programmable clocks.
const char *xf86ModeStatusToString(ModeStatus status);
This function converts the status value to a descriptive printable string.
ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, ClockRangePtr clockRanges, LookupModeFlags strategy);
This function takes a pointer to a mode with the name filled in, and looks for a mode in the modePool list which matches. The parameters of the matching mode are filled in to *modep. The clockRanges and strategy parameters are as for the xf86ValidateModes() function above. This function requires the modePool, clock[], numClocks and progClock fields of the ScrnInfoRec to be initialised before being called. The return value is MODE_OK if a mode was found. Otherwise it indicates why a matching mode could not be found.
ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, ClockRangePtr clockRanges, LookupModeFlags strategy, int maxPitch, int virtualX, int virtualY);
This function checks the passed mode against some basic driver constraints. Apart from the ones passed explicitly, the maxHValue and maxVValue fields of the ScrnInfoRec are also used. If the ValidMode field of the ScrnInfoRec is set, that function is also called to check the mode. Next, the mode is checked against the monitor's constraints. If the mode is consistent with all constraints, the return value is MODE_OK. Otherwise the return value indicates which constraint wasn't met.
void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
This function deletes the mode given from the modeList. It never prints any messages, so it is up to the caller to print a message if required.
Functions for handling strings and tokens Tables associating strings and numerical tokens combined with the following functions provide a compact way of handling strings from the config file, and for converting tokens into printable strings. The table data structure is: typedef struct { int token; const char * name; } SymTabRec, *SymTabPtr; A table is an initialised array of SymTabRec. The tokens must be non-negative integers. Multiple names may be mapped to a single token. The table is terminated with an element with a token value of -1 and NULL for the name.
const char *xf86TokenToString(SymTabPtr table, int token);
This function returns the first string in table that matches token. If no match is found, NULL is returned (NOTE, older versions of this function would return the string "unknown" when no match is found).
int xf86StringToToken(SymTabPtr table, const char *string);
This function returns the first token in table that matches string. The xf86NameCmp() function is used to determine the match. If no match is found, -1 is returned.
Functions for finding which config file entries to use These functions can be used to select the appropriate config file entries that match the detected hardware. They are described above in the Probe and Available Functions sections. Probing discrete clocks on old hardware The xf86GetClocks() function may be used to assist in finding the discrete pixel clock values on older hardware.
void xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int), void (*ProtectRegs)(ScrnInfoPtr, Bool), void (*BlankScreen)(ScrnInfoPtr, Bool), int vertsyncreg, int maskval, int knownclkindex, int knownclkvalue);
This function uses a comparative sampling method to measure the discrete pixel clock values. The number of discrete clocks to measure is given by num. clockFunc is a function that selects the n'th clock. It should also save or restore any state affected by programming the clocks when the index passed is CLK_REG_SAVE or CLK_REG_RESTORE. ProtectRegs is a function that does whatever is required to protect the hardware state while selecting a new clock. BlankScreen is a function that blanks the screen. vertsyncreg and maskval are the register and bitmask to check for the presence of vertical sync pulses. knownclkindex and knownclkvalue are the index and value of a known clock. These are the known references on which the comparative measurements are based. The number of clocks probed is set in pScrn->numClocks, and the probed clocks are set in the pScrn->clock[] array. All of the clock values are in units of kHz.
void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
Print out the pixel clocks scrp->clock[]. from indicates whether the clocks were probed or from the config file.
Other helper functions
Bool xf86IsUnblank(int mode);
Returns TRUE when the screen saver mode specified by mode requires the screen be unblanked, and FALSE otherwise. The screen saver modes that require blanking are SCREEN_SAVER_ON and SCREEN_SAVER_CYCLE, and the screen saver modes that require unblanking are SCREEN_SAVER_OFF and SCREEN_SAVER_FORCER. Drivers may call this helper from their SaveScreen() function to interpret the screen saver modes.
The vgahw module The vgahw modules provides an interface for saving, restoring and programming the standard VGA registers, and for handling VGA colourmaps. Data Structures The public data structures used by the vgahw module are vgaRegRec and vgaHWRec. They are defined in vgaHW.h. General vgahw Functions
Bool vgaHWGetHWRec(ScrnInfoPtr pScrn);
This function allocates a vgaHWRec structure, and hooks it into the ScrnInfoRec's privates. Like all information hooked into the privates, it is persistent, and only needs to be allocated once per screen. This function should normally be called from the driver's ChipPreInit() function. The vgaHWRec is zero-allocated, and the following fields are explicitly initialised: ModeReg.DAC[] initialised with a default colourmap ModeReg.Attribute[0x11] initialised with the default overscan index ShowOverscan initialised according to the "ShowOverscan" option paletteEnabled initialised to FALSE cmapSaved initialised to FALSE pScrn initialised to pScrn In addition to the above, vgaHWSetStdFuncs() is called to initialise the register access function fields with the standard VGA set of functions. Once allocated, a pointer to the vgaHWRec can be obtained from the ScrnInfoPtr with the VGAHWPTR(pScrn) macro.
void vgaHWFreeHWRec(ScrnInfoPtr pScrn);
This function frees a vgaHWRec structure. It should be called from a driver's ChipFreeScreen() function.
Bool vgaHWSetRegCounts(ScrnInfoPtr pScrn, int numCRTC, int numSequencer, int numGraphics, int numAttribute);
This function allows the number of CRTC, Sequencer, Graphics and Attribute registers to be changed. This makes it possible for extended registers to be saved and restored with vgaHWSave() and vgaHWRestore(). This function should be called after a vgaHWRec has been allocated with vgaHWGetHWRec(). The default values are defined in vgaHW.h as follows: #define VGA_NUM_CRTC 25 #define VGA_NUM_SEQ 5 #define VGA_NUM_GFX 9 #define VGA_NUM_ATTR 21
Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src);
This function copies the contents of the VGA saved registers in src to dst. Note that it isn't possible to simply do this with memcpy() (or similar). This function returns TRUE unless there is a problem allocating space for the CRTC and related fields in dst.
void vgaHWSetStdFuncs(vgaHWPtr hwp);
This function initialises the register access function fields of hwp with the standard VGA set of functions. This is called by vgaHWGetHWRec(), so there is usually no need to call this explicitly. The register access functions are described below. If the registers are shadowed in some other port I/O space (for example a PCI I/O region), these functions can be used to access the shadowed registers if hwp->PIOOffset is initialised with offset, calculated in such a way that when the standard VGA I/O port value is added to it the correct offset into the PIO area results. This value is initialised to zero in vgaHWGetHWRec(). (Note: the PIOOffset functionality is present in XFree86 4.1.0 and later.)
void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset);
This function initialised the register access function fields of hwp with a generic MMIO set of functions. hwp->MMIOBase is initialised with base, which must be the virtual address that the start of MMIO area is mapped to. hwp->MMIOOffset is initialised with offset, which must be calculated in such a way that when the standard VGA I/O port value is added to it the correct offset into the MMIO area results. That means that these functions are only suitable when the VGA I/O ports are made available in a direct mapping to the MMIO space. If that is not the case, the driver will need to provide its own register access functions. The register access functions are described below.
Bool vgaHWMapMem(ScrnInfoPtr pScrn);
This function maps the VGA memory window. It requires that the vgaHWRec be allocated. If a driver requires non-default MapPhys or MapSize settings (the physical location and size of the VGA memory window) then those fields of the vgaHWRec must be initialised before calling this function. Otherwise, this function initialiases the default values of 0xA0000 for MapPhys and (64 * 1024) for MapSize. This function must be called before attempting to save or restore the VGA state. If the driver doesn't call it explicitly, the vgaHWSave() and vgaHWRestore() functions may call it if they need to access the VGA memory (in which case they will also call vgaHWUnmapMem() to unmap the VGA memory before exiting).
void vgaHWUnmapMem(ScrnInfoPtr pScrn);
This function unmaps the VGA memory window. It must only be called after the memory has been mapped. The Base field of the vgaHWRec field is set to NULL to indicate that the memory is no longer mapped.
void vgaHWGetIOBase(vgaHWPtr hwp);
This function initialises the IOBase field of the vgaHWRec. This function must be called before using any other functions that access the video hardware. A macro VGAHW_GET_IOBASE() is also available in vgaHW.h that returns the I/O base, and this may be used when the vgahw module is not loaded (for example, in the ChipProbe() function).
void vgaHWUnlock(vgaHWPtr hwp);
This function unlocks the VGA CRTC[0-7] registers, and must be called before attempting to write to those registers.
void vgaHWLock(vgaHWPtr hwp);
This function locks the VGA CRTC[0-7] registers.
void vgaHWEnable(vgaHWPtr hwp);
This function enables the VGA subsystem. (Note, this function is present in XFree86 4.1.0 and later.).
void vgaHWDisable(vgaHWPtr hwp);
This function disables the VGA subsystem. (Note, this function is present in XFree86 4.1.0 and later.).
void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags);
This function saves the VGA state. The state is written to the vgaRegRec pointed to by save. flags is set to one or more of the following flags ORed together: VGA_SR_MODE the mode setting registers are saved VGA_SR_FONTS the text mode font/text data is saved VGA_SR_CMAP the colourmap (LUT) is saved VGA_SR_ALL all of the above are saved The vgaHWRec and its IOBase fields must be initialised before this function is called. If VGA_SR_FONTS is set in flags, the VGA memory window must be mapped. If it isn't then vgaHWMapMem() will be called to map it, and vgaHWUnmapMem() will be called to unmap it afterwards. vgaHWSave() uses the three functions below in the order vgaHWSaveColormap(), vgaHWSaveMode(), vgaHWSaveFonts() to carry out the different save phases. It is undecided at this stage whether they will remain part of the vgahw module's public interface or not.
void vgaHWSaveMode(ScrnInfoPtr pScrn, vgaRegPtr save);
This function saves the VGA mode registers. They are saved to the vgaRegRec pointed to by save. The registers saved are: MiscOut CRTC[0-0x18] Attribute[0-0x14] Graphics[0-8] Sequencer[0-4] The number of registers actually saved may be modified by a prior call to vgaHWSetRegCounts().
void vgaHWSaveFonts(ScrnInfoPtr pScrn, vgaRegPtr save);
This function saves the text mode font and text data held in the video memory. If called while in a graphics mode, no save is done. The VGA memory window must be mapped with vgaHWMapMem() before to calling this function. On some platforms, one or more of the font/text plane saves may be no-ops. This is the case when the platform's VC driver already takes care of this.
void vgaHWSaveColormap(ScrnInfoPtr pScrn, vgaRegPtr save);
This function saves the VGA colourmap (LUT). Before saving it, it attempts to verify that the colourmap is readable. In rare cases where it isn't readable, a default colourmap is saved instead.
void vgaHWRestore(ScrnInfoPtr pScrn, vgaRegPtr restore, int flags);
This function programs the VGA state. The state programmed is that contained in the vgaRegRec pointed to by restore. flags is the same as described above for the vgaHWSave() function. The vgaHWRec and its IOBase fields must be initialised before this function is called. If VGA_SR_FONTS is set in flags, the VGA memory window must be mapped. If it isn't then vgaHWMapMem() will be called to map it, and vgaHWUnmapMem() will be called to unmap it afterwards. vgaHWRestore() uses the three functions below in the order vgaHWRestoreFonts(), vgaHWRestoreMode(), vgaHWRestoreColormap() to carry out the different restore phases. It is undecided at this stage whether they will remain part of the vgahw module's public interface or not.
void vgaHWRestoreMode(ScrnInfoPtr pScrn, vgaRegPtr restore);
This function restores the VGA mode registers. They are restored from the data in the vgaRegRec pointed to by restore. The registers restored are: MiscOut CRTC[0-0x18] Attribute[0-0x14] Graphics[0-8] Sequencer[0-4] The number of registers actually restored may be modified by a prior call to vgaHWSetRegCounts().
void vgaHWRestoreFonts(ScrnInfoPtr pScrn, vgaRegPtr restore);
This function restores the text mode font and text data to the video memory. The VGA memory window must be mapped with vgaHWMapMem() before to calling this function. On some platforms, one or more of the font/text plane restores may be no-ops. This is the case when the platform's VC driver already takes care of this.
void vgaHWRestoreColormap(ScrnInfoPtr pScrn, vgaRegPtr restore);
This function restores the VGA colourmap (LUT).
void vgaHWInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
This function fills in the vgaHWRec's ModeReg field with the values appropriate for programming the given video mode. It requires that the ScrnInfoRec's depth field is initialised, which determines how the registers are programmed.
void vgaHWSeqReset(vgaHWPtr hwp, Bool start);
Do a VGA sequencer reset. If start is TRUE, the reset is started. If start is FALSE, the reset is ended.
void vgaHWProtect(ScrnInfoPtr pScrn, Bool on);
This function protects VGA registers and memory from corruption during loads. It is typically called with on set to TRUE before programming, and with on set to FALSE after programming.
Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode);
This function blanks and unblanks the screen. It is blanked when mode is SCREEN_SAVER_ON or SCREEN_SAVER_CYCLE, and unblanked when mode is SCREEN_SAVER_OFF or SCREEN_SAVER_FORCER.
void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on);
This function blanks and unblanks the screen. It is blanked when on is FALSE, and unblanked when on is TRUE. This function is provided for use in cases where the ScrnInfoRec can't be derived from the ScreenRec (while probing for clocks, for example).
VGA Colormap Functions The vgahw module uses the standard colormap support (see the Colormap Handling section. This is initialised with the following function:
Bool vgaHWHandleColormaps(ScreenPtr pScreen);
VGA Register Access Functions The vgahw module abstracts access to the standard VGA registers by using a set of functions held in the vgaHWRec. When the vgaHWRec is created these function pointers are initialised with the set of standard VGA I/O register access functions. In addition to these, the vgahw module includes a basic set of MMIO register access functions, and the vgaHWRec function pointers can be initialised to these by calling the vgaHWSetMmioFuncs() function described above. Some drivers/platforms may require a different set of functions for VGA access. The access functions are described here.
void writeCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value);
Write value to CRTC register index.
CARD8 readCrtc(vgaHWPtr hwp, CARD8 index);
Return the value read from CRTC register index.
void writeGr(vgaHWPtr hwp, CARD8 index, CARD8 value);
Write value to Graphics Controller register index.
CARD8 readGR(vgaHWPtr hwp, CARD8 index);
Return the value read from Graphics Controller register index.
void writeSeq(vgaHWPtr hwp, CARD8 index, CARD8, value);
Write value to Sequencer register index.
CARD8 readSeq(vgaHWPtr hwp, CARD8 index);
Return the value read from Sequencer register index.
void writeAttr(vgaHWPtr hwp, CARD8 index, CARD8, value);
Write value to Attribute Controller register index. When writing out the index value this function should set bit 5 (0x20) according to the setting of hwp->paletteEnabled in order to preserve the palette access state. It should be cleared when hwp->paletteEnabled is TRUE and set when it is FALSE.
CARD8 readAttr(vgaHWPtr hwp, CARD8 index);
Return the value read from Attribute Controller register index. When writing out the index value this function should set bit 5 (0x20) according to the setting of hwp->paletteEnabled in order to preserve the palette access state. It should be cleared when hwp->paletteEnabled is TRUE and set when it is FALSE.
void writeMiscOut(vgaHWPtr hwp, CARD8 value);
Write value to the Miscellaneous Output register.
CARD8 readMiscOut(vgwHWPtr hwp);
Return the value read from the Miscellaneous Output register.
void enablePalette(vgaHWPtr hwp);
Clear the palette address source bit in the Attribute Controller index register and set hwp->paletteEnabled to TRUE.
void disablePalette(vgaHWPtr hwp);
Set the palette address source bit in the Attribute Controller index register and set hwp->paletteEnabled to FALSE.
void writeDacMask(vgaHWPtr hwp, CARD8 value);
Write value to the DAC Mask register.
CARD8 readDacMask(vgaHWptr hwp);
Return the value read from the DAC Mask register.
void writeDacReadAddress(vgaHWPtr hwp, CARD8 value);
Write value to the DAC Read Address register.
void writeDacWriteAddress(vgaHWPtr hwp, CARD8 value);
Write value to the DAC Write Address register.
void writeDacData(vgaHWPtr hwp, CARD8 value);
Write value to the DAC Data register.
CARD8 readDacData(vgaHWptr hwp);
Return the value read from the DAC Data register.
CARD8 readEnable(vgaHWptr hwp);
Return the value read from the VGA Enable register. (Note: This function is present in XFree86 4.1.0 and later.)
void writeEnable(vgaHWPtr hwp, CARD8 value);
Write value to the VGA Enable register. (Note: This function is present in XFree86 4.1.0 and later.)
Some notes about writing a driver NOTE: some parts of this are not up to date The following is an outline for writing a basic unaccelerated driver for a PCI video card with a linear mapped framebuffer, and which has a VGA core. It is includes some general information that is relevant to most drivers (even those which don't fit that basic description). The information here is based on the initial conversion of the Matrox Millennium driver to the new design. For a fleshing out and sample implementation of some of the bits outlined here, refer to that driver. Note that this is an example only. The approach used here will not be appropriate for all drivers. Each driver must reserve a unique driver name, and a string that is used to prefix all of its externally visible symbols. This is to avoid name space clashes when loading multiple drivers. The examples here are for the ZZZ driver, which uses the ZZZ or zzz prefix for its externally visible symbols. Include files All drivers normally include the following headers: "xf86.h" "xf86_OSproc.h" "xf86_ansic.h" "xf86Resources.h" Wherever inb/outb (and related things) are used the following should be included: "compiler.h" Note: in drivers, this must be included after "xf86_ansic.h". Drivers that need to access PCI vendor/device definitions need this: "xf86PciInfo.h" Drivers that need to access the PCI config space need this: "xf86Pci.h" Drivers using the mi banking wrapper need: "mibank.h" Drivers that initialise a SW cursor need this: "mipointer.h" All drivers using the mi colourmap code need this: "micmap.h" If a driver uses the vgahw module, it needs this: "vgaHW.h" Drivers supporting VGA or Hercules monochrome screens need: "xf1bpp.h" Drivers supporting VGA or EGC 16-colour screens need: "xf4bpp.h" Drivers using cfb need: #define PSZ 8 #include "cfb.h" #undef PSZ Drivers supporting bpp 16, 24 or 32 with cfb need one or more of: "cfb16.h" "cfb24.h" "cfb32.h" The driver's own header file: "zzz.h" Drivers must NOT include the following: "xf86Priv.h" "xf86Privstr.h" "xf86_libc.h" "xf86_OSlib.h" "Xos.h" any OS header Data structures and initialisation The following macros should be defined: #define VERSION <version-as-an-int> #define ZZZ_NAME "ZZZ" /* the name used to prefix messages */ #define ZZZ_DRIVER_NAME "zzz" /* the driver name as used in config file */ #define ZZZ_MAJOR_VERSION <int> #define ZZZ_MINOR_VERSION <int> #define ZZZ_PATCHLEVEL <int> NOTE: ZZZ_DRIVER_NAME should match the name of the driver module without things like the "lib" prefix, the "_drv" suffix or filename extensions. A DriverRec must be defined, which includes the functions required at the pre-probe phase. The name of this DriverRec must be an upper-case version of ZZZ_DRIVER_NAME (for the purposes of static linking). DriverRec ZZZ = { VERSION, ZZZ_DRIVER_NAME, ZZZIdentify, ZZZProbe, ZZZAvailableOptions, NULL, 0 }; Define list of supported chips and their matching ID: static SymTabRec ZZZChipsets[] = { { PCI_CHIP_ZZZ1234, "zzz1234a" }, { PCI_CHIP_ZZZ5678, "zzz5678a" }, { -1, NULL } }; The token field may be any integer value that the driver may use to uniquely identify the supported chipsets. For drivers that support only PCI devices using the PCI device IDs might be a natural choice, but this isn't mandatory. For drivers that support both PCI and other devices (like ISA), some other ID should probably used. When other IDs are used as the tokens it is recommended that the names be defined as an enum type. If the driver uses the xf86MatchPciInstances() helper (recommended for drivers that support PCI cards) a list that maps PCI IDs to chip IDs and fixed resources must be defined: static PciChipsets ZZZPciChipsets[] = { { PCI_CHIP_ZZZ1234, PCI_CHIP_ZZZ1234, RES_SHARED_VGA }, { PCI_CHIP_ZZZ5678, PCI_CHIP_ZZZ5678, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } } Define the XF86ModuleVersionInfo struct for the driver. This is required for the dynamically loaded version: static XF86ModuleVersionInfo zzzVersRec = { "zzz", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XF86_VERSION_CURRENT, ZZZ_MAJOR_VERSION, ZZZ_MINOR_VERSION, ZZZ_PATCHLEVEL, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_VIDEODRV, {0,0,0,0} }; Define a data structure to hold the driver's screen-specific data. This must be used instead of global variables. This would be defined in the "zzz.h" file, something like: typedef struct { type1 field1; type2 field2; int fooHack; Bool pciRetry; Bool noAccel; Bool hwCursor; CloseScreenProcPtr CloseScreen; OptionInfoPtr Options; ... } ZZZRec, *ZZZPtr; Define the list of config file Options that the driver accepts. For consistency between drivers those in the list of standard options should be used where appropriate before inventing new options. typedef enum { OPTION_FOO_HACK, OPTION_PCI_RETRY, OPTION_HW_CURSOR, OPTION_NOACCEL } ZZZOpts; static const OptionInfoRec ZZZOptions[] = { { OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; Functions SetupProc For dynamically loaded modules, a ModuleData variable is required. It is should be the name of the driver prepended to "ModuleData". A Setup() function is also required, which calls xf86AddDriver() to add the driver to the main list of drivers. static MODULESETUPPROTO(zzzSetup); XF86ModuleData zzzModuleData = { &zzzVersRec, zzzSetup, NULL }; static pointer zzzSetup(pointer module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; /* This module should be loaded only once, but check to be sure. */ if (!setupDone) { /* * Modules that this driver always requires may be loaded * here by calling LoadSubModule(). */ setupDone = TRUE; xf86AddDriver(&MGA, module, 0); /* * The return value must be non-NULL on success even though * there is no TearDownProc. */ return (pointer)1; } else { if (errmaj) *errmaj = LDR_ONCEONLY; return NULL; } } GetRec, FreeRec A function is usually required to allocate the driver's screen-specific data structure and hook it into the ScrnInfoRec's driverPrivate field. The ScrnInfoRec's driverPrivate is initialised to NULL, so it is easy to check if the initialisation has already been done. After allocating it, initialise the fields. By using xnfcalloc() to do the allocation it is zeroed, and if the allocation fails the server exits. NOTE: When allocating structures from inside the driver which are defined on the common level it is important to initialize the structure to zero. Only this guarantees that the server remains source compatible to future changes in common level structures. static Bool ZZZGetRec(ScrnInfoPtr pScrn) { if (pScrn->driverPrivate != NULL) return TRUE; pScrn->driverPrivate = xnfcalloc(sizeof(ZZZRec), 1); /* Initialise as required */ ... return TRUE; } Define a macro in "zzz.h" which gets a pointer to the ZZZRec when given pScrn: #define ZZZPTR(p) ((ZZZPtr)((p)->driverPrivate)) Define a function to free the above, setting it to NULL once it has been freed: static void ZZZFreeRec(ScrnInfoPtr pScrn) { if (pScrn->driverPrivate == NULL) return; xfree(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } Identify Define the Identify() function. It is run before the Probe, and typically prints out an identifying message, which might include the chipsets it supports. This function is mandatory: static void ZZZIdentify(int flags) { xf86PrintChipsets(ZZZ_NAME, "driver for ZZZ Tech chipsets", ZZZChipsets); } Probe Define the Probe() function. The purpose of this is to find all instances of the hardware that the driver supports, and for the ones not already claimed by another driver, claim the slot, and allocate a ScrnInfoRec. This should be a minimal probe, and it should under no circumstances leave the state of the hardware changed. Because a device is found, don't assume that it will be used. Don't do any initialisations other than the required ScrnInfoRec initialisations. Don't allocate any new data structures. This function is mandatory. NOTE: The xf86DrvMsg() functions cannot be used from the Probe. static Bool ZZZProbe(DriverPtr drv, int flags) { Bool foundScreen = FALSE; int numDevSections, numUsed; GDevPtr *devSections; int *usedChips; int i; /* * Find the config file Device sections that match this * driver, and return if there are none. */ if ((numDevSections = xf86MatchDevice(ZZZ_DRIVER_NAME, &devSections)) <= 0) { return FALSE; } /* * Since this is a PCI card, "probing" just amounts to checking * the PCI data that the server has already collected. If there * is none, return. * * Although the config file is allowed to override things, it * is reasonable to not allow it to override the detection * of no PCI video cards. * * The provided xf86MatchPciInstances() helper takes care of * the details. */ /* test if PCI bus present */ if (xf86GetPciVideoInfo()) { numUsed = xf86MatchPciInstances(ZZZ_NAME, PCI_VENDOR_ZZZ, ZZZChipsets, ZZZPciChipsets, devSections, numDevSections, drv, &usedChips); for (i = 0; i < numUsed; i++) { ScrnInfoPtr pScrn = NULL; if ((pScrn = xf86ConfigPciEntity(pScrn, flags, usedChips[i], ZZZPciChipsets, NULL, NULL, NULL, NULL, NULL))) { /* Allocate a ScrnInfoRec */ pScrn->driverVersion = VERSION; pScrn->driverName = ZZZ_DRIVER_NAME; pScrn->name = ZZZ_NAME; pScrn->Probe = ZZZProbe; pScrn->PreInit = ZZZPreInit; pScrn->ScreenInit = ZZZScreenInit; pScrn->SwitchMode = ZZZSwitchMode; pScrn->AdjustFrame = ZZZAdjustFrame; pScrn->EnterVT = ZZZEnterVT; pScrn->LeaveVT = ZZZLeaveVT; pScrn->FreeScreen = ZZZFreeScreen; pScrn->ValidMode = ZZZValidMode; foundScreen = TRUE; /* add screen to entity */ } } xfree(usedChips); } #ifdef HAS_ISA_DEVS /* * If the driver supports ISA hardware, the following block * can be included too. */ numUsed = xf86MatchIsaInstances(ZZZ_NAME, ZZZChipsets, ZZZIsaChipsets, drv, ZZZFindIsaDevice, devSections, numDevSections, &usedChips); for (i = 0; i < numUsed; i++) { ScrnInfoPtr pScrn = NULL; if ((pScrn = xf86ConfigIsaEntity(pScrn, flags, usedChips[i], ZZZIsaChipsets, NULL, NULL, NULL, NULL, NULL))) { pScrn->driverVersion = VERSION; pScrn->driverName = ZZZ_DRIVER_NAME; pScrn->name = ZZZ_NAME; pScrn->Probe = ZZZProbe; pScrn->PreInit = ZZZPreInit; pScrn->ScreenInit = ZZZScreenInit; pScrn->SwitchMode = ZZZSwitchMode; pScrn->AdjustFrame = ZZZAdjustFrame; pScrn->EnterVT = ZZZEnterVT; pScrn->LeaveVT = ZZZLeaveVT; pScrn->FreeScreen = ZZZFreeScreen; pScrn->ValidMode = ZZZValidMode; foundScreen = TRUE; } } xfree(usedChips); #endif /* HAS_ISA_DEVS */ xfree(devSections); return foundScreen; AvailableOptions Define the AvailableOptions() function. The purpose of this is to return the available driver options back to the -configure option, so that an xorg.conf file can be built and the user can see which options are available for them to use. PreInit Define the PreInit() function. The purpose of this is to find all the information required to determine if the configuration is usable, and to initialise those parts of the ScrnInfoRec that can be set once at the beginning of the first server generation. The information should be found in the least intrusive way possible. This function is mandatory. NOTES: The PreInit() function is only called once during the life of the X server (at the start of the first generation). Data allocated here must be of the type that persists for the life of the X server. This means that data that hooks into the ScrnInfoRec's privates field should be allocated here, but data that hooks into the ScreenRec's devPrivates field should not be allocated here. The driverPrivate field should also be allocated here. Although the ScrnInfoRec has been allocated before this function is called, the ScreenRec has not been allocated. That means that things requiring it cannot be used in this function. Very little of the ScrnInfoRec has been initialised when this function is called. It is important to get the order of doing things right in this function. static Bool ZZZPreInit(ScrnInfoPtr pScrn, int flags) { /* Fill in the monitor field */ pScrn->monitor = pScrn->confScreen->monitor; /* * If using the vgahw module, it will typically be loaded * here by calling xf86LoadSubModule(pScrn, "vgahw"); */ /* * Set the depth/bpp. Use the globally preferred depth/bpp. If the * driver has special default depth/bpp requirements, the defaults should * be specified here explicitly. * We support both 24bpp and 32bpp framebuffer layouts. * This sets pScrn->display also. */ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) { return FALSE; } else { if (depth/bpp isn't one we support) { print error message; return FALSE; } } /* Print out the depth/bpp that was set */ xf86PrintDepthBpp(pScrn); /* Set bits per RGB for 8bpp */ if (pScrn->depth <= 8) { /* Take into account a dac_6_bit option here */ pScrn->rgbBits = 6 or 8; } /* * xf86SetWeight() and xf86SetDefaultVisual() must be called * after pScrn->display is initialised. */ /* Set weight/mask/offset for depth > 8 */ if (pScrn->depth > 8) { if (!xf86SetWeight(pScrn, defaultWeight, defaultMask)) { return FALSE; } else { if (weight isn't one we support) { print error message; return FALSE; } } } /* Set the default visual. */ if (!xf86SetDefaultVisual(pScrn, -1)) { return FALSE; } else { if (visual isn't one we support) { print error message; return FALSE; } } /* If the driver supports gamma correction, set the gamma. */ if (!xf86SetGamma(pScrn, default_gamma)) { return FALSE; } /* This driver uses a programmable clock */ pScrn->progClock = TRUE; /* Allocate the ZZZRec driverPrivate */ if (!ZZZGetRec(pScrn)) { return FALSE; } pZzz = ZZZPTR(pScrn); /* Collect all of the option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* * Process the options based on the information in ZZZOptions. * The results are written to pZzz->Options. If all of the options * processing is done within this function a local variable "options" * can be used instead of pZzz->Options. */ if (!(pZzz->Options = xalloc(sizeof(ZZZOptions)))) return FALSE; (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options); /* * Set various fields of ScrnInfoRec and/or ZZZRec based on * the options found. */ from = X_DEFAULT; pZzz->hwCursor = FALSE; if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) { from = X_CONFIG; pZzz->hwCursor = TRUE; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pZzz->hwCursor ? "HW" : "SW"); if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) { pZzz->noAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } else { pZzz->noAccel = FALSE; } if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) { pZzz->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } pZzz->fooHack = 0; if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK, &pZzz->fooHack)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n", pZzz->fooHack); } /* * Find the PCI slot(s) that this screen claimed in the probe. * In this case, exactly one is expected, so complain otherwise. * Note in this case we're not interested in the card types so * that parameter is set to NULL. */ if ((i = xf86GetPciInfoForScreen(pScrn->scrnIndex, &pciList, NULL)) != 1) { print error message; ZZZFreeRec(pScrn); if (i > 0) xfree(pciList); return FALSE; } /* Note that pciList should be freed below when no longer needed */ /* * Determine the chipset, allowing config file chipset and * chipid values to override the probed information. The config * chipset value has precedence over its chipid value if both * are present. * * It isn't necessary to fill in pScrn->chipset if the driver * keeps track of the chipset in its ZZZRec. */ ... /* * Determine video memory, fb base address, I/O addresses, etc, * allowing the config file to override probed values. * * Set the appropriate pScrn fields (videoRam is probably the * most important one that other code might require), and * print out the settings. */ ... /* Initialise a clockRanges list. */ ... /* Set any other chipset specific things in the ZZZRec */ ... /* Select valid modes from those available */ i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, clockRanges, NULL, minPitch, maxPitch, rounding, minHeight, maxHeight, pScrn->display->virtualX, pScrn->display->virtualY, pScrn->videoRam * 1024, LOOKUP_BEST_REFRESH); if (i == -1) { ZZZFreeRec(pScrn); return FALSE; } /* Prune the modes marked as invalid */ xf86PruneDriverModes(pScrn); /* If no valid modes, return */ if (i == 0 || pScrn->modes == NULL) { print error message; ZZZFreeRec(pScrn); return FALSE; } /* * Initialise the CRTC fields for the modes. This driver expects * vertical values to be halved for interlaced modes. */ xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V); /* Set the current mode to the first in the list. */ pScrn->currentMode = pScrn->modes; /* Print the list of modes being used. */ xf86PrintModes(pScrn); /* Set the DPI */ xf86SetDpi(pScrn, 0, 0); /* Load bpp-specific modules */ switch (pScrn->bitsPerPixel) { case 1: mod = "xf1bpp"; break; case 4: mod = "xf4bpp"; break; case 8: mod = "cfb"; break; case 16: mod = "cfb16"; break; case 24: mod = "cfb24"; break; case 32: mod = "cfb32"; break; } if (mod && !xf86LoadSubModule(pScrn, mod)) ZZZFreeRec(pScrn); return FALSE; /* Done */ return TRUE; } MapMem, UnmapMem Define functions to map and unmap the video memory and any other memory apertures required. These functions are not mandatory, but it is often useful to have such functions. static Bool ZZZMapMem(ScrnInfoPtr pScrn) { /* Call xf86MapPciMem() to map each PCI memory area */ ... return TRUE or FALSE; } static Bool ZZZUnmapMem(ScrnInfoPtr pScrn) { /* Call xf86UnMapVidMem() to unmap each memory area */ ... return TRUE or FALSE; } Save, Restore Define functions to save and restore the original video state. These functions are not mandatory, but are often useful. static void ZZZSave(ScrnInfoPtr pScrn) { /* * Save state into per-screen data structures. * If using the vgahw module, vgaHWSave will typically be * called here. */ ... } static void ZZZRestore(ScrnInfoPtr pScrn) { /* * Restore state from per-screen data structures. * If using the vgahw module, vgaHWRestore will typically be * called here. */ ... } ModeInit Define a function to initialise a new video mode. This function isn't mandatory, but is often useful. static Bool ZZZModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { /* * Program a video mode. If using the vgahw module, * vgaHWInit and vgaRestore will typically be called here. * Once up to the point where there can't be a failure * set pScrn->vtSema to TRUE. */ ... } ScreenInit Define the ScreenInit() function. This is called at the start of each server generation, and should fill in as much of the ScreenRec as possible as well as any other data that is initialised once per generation. It should initialise the framebuffer layers it is using, and initialise the initial video mode. This function is mandatory. NOTE: The ScreenRec (pScreen) is passed to this driver, but it and the ScrnInfoRecs are not yet hooked into each other. This means that in this function, and functions it calls, one cannot be found from the other. static Bool ZZZScreenInit(ScreenPtr pScreen, int argc, char **argv) { /* Get the ScrnInfoRec */ pScrn = xf86ScreenToScrn(pScreen); /* * If using the vgahw module, its data structures and related * things are typically initialised/mapped here. */ /* Save the current video state */ ZZZSave(pScrn); /* Initialise the first mode */ ZZZModeInit(pScrn, pScrn->currentMode); /* Set the viewport if supported */ ZZZAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); /* * Setup the screen's visuals, and initialise the framebuffer * code. */ /* Reset the visual list */ miClearVisualTypes(); /* * Setup the visuals supported. This driver only supports * TrueColor for bpp > 8, so the default set of visuals isn't * acceptable. To deal with this, call miSetVisualTypes with * the appropriate visual mask. */ if (pScrn->bitsPerPixel > 8) { if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; } else { if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; } /* * Initialise the framebuffer. */ switch (pScrn->bitsPerPixel) { case 1: ret = xf1bppScreenInit(pScreen, FbBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth); break; case 4: ret = xf4bppScreenInit(pScreen, FbBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth); break; case 8: ret = cfbScreenInit(pScreen, FbBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth); break; case 16: ret = cfb16ScreenInit(pScreen, FbBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth); break; case 24: ret = cfb24ScreenInit(pScreen, FbBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth); break; case 32: ret = cfb32ScreenInit(pScreen, FbBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth); break; default: print a message about an internal error; ret = FALSE; break; } if (!ret) return FALSE; /* Override the default mask/offset settings */ if (pScrn->bitsPerPixel > 8) { for (i = 0, visual = pScreen->visuals; i < pScreen->numVisuals; i++, visual++) { if ((visual->class | DynamicClass) == DirectColor) { visual->offsetRed = pScrn->offset.red; visual->offsetGreen = pScrn->offset.green; visual->offsetBlue = pScrn->offset.blue; visual->redMask = pScrn->mask.red; visual->greenMask = pScrn->mask.green; visual->blueMask = pScrn->mask.blue; } } } /* * If banking is needed, initialise an miBankInfoRec (defined in * "mibank.h"), and call miInitializeBanking(). */ if (!miInitializeBanking(pScreen, pScrn->virtualX, pScrn->virtualY, pScrn->displayWidth, pBankInfo)) return FALSE; /* * Set initial black & white colourmap indices. */ xf86SetBlackWhitePixels(pScreen); /* * Install colourmap functions. */ ... /* * Initialise cursor functions. This example is for the mi * software cursor. */ miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); /* Initialise the default colourmap */ switch (pScrn->depth) { case 1: if (!xf1bppCreateDefColormap(pScreen)) return FALSE; break; case 4: if (!xf4bppCreateDefColormap(pScreen)) return FALSE; break; default: if (!cfbCreateDefColormap(pScreen)) return FALSE; break; } /* * Wrap the CloseScreen vector and set SaveScreen. */ ZZZPTR(pScrn)->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = ZZZCloseScreen; pScreen->SaveScreen = ZZZSaveScreen; /* Report any unused options (only for the first generation) */ if (serverGeneration == 1) { xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); } /* Done */ return TRUE; } SwitchMode Define the SwitchMode() function if mode switching is supported by the driver. static Bool ZZZSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { return ZZZModeInit(pScrn, mode); } AdjustFrame Define the AdjustFrame() function if the driver supports this. static void ZZZAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { /* Adjust the viewport */ } EnterVT, LeaveVT Define the EnterVT() and LeaveVT() functions. These functions are mandatory. static Bool ZZZEnterVT(ScrnInfoPtr pScrn) { return ZZZModeInit(pScrn, pScrn->currentMode); } static void ZZZLeaveVT(ScrnInfoPtr pScrn) { ZZZRestore(pScrn); } CloseScreen Define the CloseScreen() function: This function is mandatory. Note that it unwraps the previously wrapped pScreen->CloseScreen, and finishes by calling it. static Bool ZZZCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->vtSema) { ZZZRestore(pScrn); ZZZUnmapMem(pScrn); } pScrn->vtSema = FALSE; pScreen->CloseScreen = ZZZPTR(pScrn)->CloseScreen; return (*pScreen->CloseScreen)(pScreen); } SaveScreen Define the SaveScreen() function (the screen blanking function). When using the vgahw module, this will typically be: static Bool ZZZSaveScreen(ScreenPtr pScreen, int mode) { return vgaHWSaveScreen(pScreen, mode); } This function is mandatory. Before modifying any hardware register directly this function needs to make sure that the Xserver is active by checking if pScrn is non-NULL and for pScrn->vtSema == TRUE. FreeScreen Define the FreeScreen() function. This function is optional. It should be defined if the ScrnInfoRec driverPrivate field is used so that it can be freed when a screen is deleted by the common layer for reasons possibly beyond the driver's control. This function is not used in during normal (error free) operation. The per-generation data is freed by the CloseScreen() function. static void ZZZFreeScreen(ScrnInfoPtr pScrn) { /* * If the vgahw module is used vgaHWFreeHWRec() would be called * here. */ ZZZFreeRec(pScrn); }
xorg-server-1.17.1/hw/xfree86/doc/Registry0000664000175100017510000002657512406661137015243 00000000000000This is the XFree86 driver/module registry. To avoid name space clashes and to maintain some consistency between drivers the important name spaces are maintained here. 1. Module Names. Each module is required to have a unique name. Registered names are: GLcore acecad afb apm ark ati atimisc bitmap bt8xx calcomp cfb cfb16 cfb24 cfb32 chips cirrus citron cyrix dbe ddc digitaledge dmc dri drm dynapro elo2300 elographics extmod fb fbdev fbdevhw fi12x6 freetype glide glint glx hyperpen i128 i2c i740 i810 imstt int10 joystick keyboard layer magellan magictouch mfb mga microtouch mouse msp34xx mutouch neomagic newport nv pcidata penmount pex5 r128 radeon rac ramdac record rendition s3 s3virge savage shadow shadowfb siliconmotion sis spaceorb speedo summa sunbw2 suncg14 suncg3 suncg6 sunffb sunleo suntcx tdfx tga trident tseng type1 v4l vbe vesa vga vgahw vmware void wacom xaa xf1bpp xf24_32bpp xf4bpp xf8_16bpp xf8_32bpp xf8_32wid xie xtrap xtt 2. External Module Object Symbols. Each module is required to use a unique prefix or prefixes for all of its externally visible symbols. They should be unique without regard to case. Registered prefixes are: ati bt8xx cfb chips fi12x6 glide glint mfb mga msp34xx neo permedia tseng vga vgahw vmware xaa xf1bpp xf4bpp 3. Chipset Names. Each video driver is required to use a unique set of chipset names. Case, white space and underscore characters are ignored when comparing chipset names. All names listed here are in lower case with all white space and underscores removed. Registered chipset names are: ati ativga ct64200 ct64300 ct65520 ct65525 ct65530 ct65535 ct65540 ct65545 ct65546 ct65548 ct65550 ct65554 ct65555 ct68554 ct69000 et4000 et4000w32 et4000w32i et4000w32p et6000 et6100 generic ibmvga ibm8514 mach32 mach64 mach8 mga2064w mga1064sg mga2164w mga2164wagp neo2070 neo2090 neo2093 neo2097 neo2160 neo2200 tipm2 vgawonder voodoo 4. Option Names. Option names and their usage should be consistent between drivers. Case, white space and underscore characters are ignored when comparing option names. The prefix "no" may be added or removed from boolean option names. All names listed here are in their preferred user-visible form. Some registered option names are: Types are: B = boolean, O = set/unset (no value), I = integer, S = string, A = optional string, F = floating point number Q = frequency Scopes are: F = global flags, V = video driver, C = common (per screen), I = input drivers, X = XAA, Xv = Xv extension, M = misc. Names currently in use: Name Type Scope Description ---------------------------------------------------------------------------- AllowMouseOpenFail B F ignore mouse dev open failure AllowNonLocalModInDev B F allow non-local mod of input devs AllowNonLocalXvidtune B F allow non-local VidMode connections BlankTime I F Screen saver timeout (min) DisableModInDev B F disallow changing input devs DisableVidModeExtension B F disable VidMode extension DontVTSwitch B F disable Ctrl-Alt-Fn DontZap B F disable Ctrl-Alt-BS sequence DontZoom B F disable Ctrl-Alt-+/- NoTrapSignals B F don't trap signals OffTime I F Time before DPMS off mode active (min) PciProbe1 O F use PCI probe algorithm 1 PciProbe2 O F use PCI probe algorithm 2 PciForceConfig1 O F force PCI config type 1 PciForceConfig2 O F force PCI config type 2 Pixmap I F depth 24 pixmap size (24 or 32) StandbyTime I F Time before DPMS standby active (min) SuspendTime I F Time before DPMS suspend mode active (min) BackingStore B C Enable backing store DDC B C Enable/disable DDC DDC1 B C Enable/disable DDC1 DDC2 B C Enable/disable DDC2 DPMS O C Enable DPMS BaudRate I I Serial port baud rate ButtonNumber I I Button number (for touch screen?) ButtonThreshold I I ?? ClearDTR O I Clear serial port DTR ClearRTS O I Clear serial port RTS DataBits I I Serial port data bits DemandLoad O I ?? Device S I Device file name DeviceName S I Input device name FlowControl S I Serial flow control ("xon", "none") Floating B I Device initialised as floating HistorySize I I ?? MaxX I I Maximum X coordinate MaxY I I Maximum Y coordinate MinX I I Minimum X coordinate MinY I I Minimum Y coordinate Parity S I Serial port parity ("odd", "even", "none") ReportDelay I I ?? ReportingMode S I may be "raw" or "scaled" ScreenNumber I I Screen number (for touch screen) SendCoreEvents B I Send core events StopBits I I Serial port stop bits SwapXY B I Swap the X and Y axes UntouchDelay I I ?? Vmin I I Tty VMIN Vtime I I Tty VTIME 18BitBus B V ?? 8Plus16 B V Enable depth 8 + depth 16 with overlay 8Plus24 B V Enable depth 8 + depth 24 with overlay BlockWrite B V Enable/disable block write ColorKey I V Set the color key for overlay modes CompositeSync B V Composite sync CRTDisplay B V Force display on CRT, not LCD CRTScreen B V Display on CRT, not LCD (Obsolete) EarlyRasPrecharge O V Early RAS pre-charge FastDRAM O V Fast DRAM FifoAggressive O V Aggressive FIFO setting FifoConservative O V Conservative FIFO setting FifoModerate O V Moderate FIFO setting FireGL3000 B V Card is Diamond FireGL3000 FixPanelSize B V ?? FPClock8 Q V Flat panel clock for 8bpp fb (MHz) FPClock16 Q V Flat panel clock for 16bpp fb (MHz) FPClock24 Q V Flat panel clock for 24bpp fb (MHz) FPClock32 Q V Flat panel clock for 32bpp fb (MHz) FPMVRAM O V Fast page mode VRAM FramebufferWC B V Enable/disable WC for the framebuffer GlideDevice I V Selects which Voodoo board to use HiBitHigh O V High clock bit default to set HiBitLow O V High clock bit default to cleared HWClocks B V Enable/disable HW clocks HWCursor B V Enable/disable HW cursor LateRasPrecharge O V Late RAS pre-charge Legend O V Card is Legend ET4000 LCDCenter B V Enable/disable centering for LCD displays Linear B V Enable/disable linear framebuffer MCLK Q V Specify the current MCLK value (MHz) MedDRAM B V Medium speed DRAM MemCfg1 I V ?? MemCfg2 I V ?? MGASDRAM B V Mga card has SDRAM MMIO B V Enable/disable memory mapped I/O MMIOCache B V Enable/Disable MMIO cache MuxThreshold I V Multiplexing threshold (kHz) NoAccel B V Disable/enable acceleration NoClockChip B V ?? NoStretch B V Disable/enable stretching for LCD displays OnAtExit B V Leave video signal on when exiting server OverclockMem B V Enable memory overclocking Overlay A V Enable multi-depth/overlay. An optional string "M,N" may be specified, where M, N are the depths. PanelDisplay B V Force display on LCD PciBurst B V Enable/disable PCI burst mode PciRetry B V Enable/disable PCI retries ProbeClocks B V Force probe for non-programmable clocks ReferenceClock Q V Clock generator reference frequency RGBbits I V Number of significant bits per rgb Rotate S V Rotate the virtual display (CW or CCW) SetLCDClk Q V Set LCD clock (MHz) SetMclk Q V Set Memory Clock (MHz) ShadowFB B V Enable shadow framebuffer layer ShowCache B V Enable viewing of offscreen memory ShowOverscan O V Set the overscan area to a visible colour SlowDRAM O V Slow DRAM SlowEDODRAM O V Slow EDO DRAM STN B V STN screen type (??) SWCursor B V Enable/disable SW cursor SuspendHack B V ?? SyncOnGreen B V Enable/disable sync on green TurboQueue B V Enable/disable turbo queue UseFBDev B V Use the fbdev driver interface UseModeLine B V Use Modeline (??) W32Interleave B V ?? Buffers I Xv Number of buffers Device S Xv Device file name Expose B Xv Disable occlusion clipping (see DESIGN) FramesPerSec I Xv Max. refresh frequency XAA options. All are of type "O" and scope "X", and are self-explanatory XaaNoColor8x8PatternFillRect XaaNoColor8x8PatternFillTrap XaaNoCPUToScreenColorExpandFill XaaNoDashedBresenhamLine XaaNoDashedTwoPointLine XaaNoScreenToScreenCopy XaaNoImageReadRect XaaNoImageWriteRect XaaNoMono8x8PatternFillRect XaaNoMono8x8PatternFillTrap XaaNoOffscreenPixmaps XaaNoPixmapCache XaaNoScanlineCPUToScreenColorExpandFill XaaNoScanlineImageWriteRect XaaNoScreenToScreenColorExpandFill XaaNoSolidBresenhamLine XaaNoSolidFillRect XaaNoSolidFillTrap XaaNoSolidHorVertLine XaaNoSolidTwoPointLine Names used in previous versions: 16Clocks 8Clocks ClkDiv2 EDO VRAM ExternDisp ExtFramBuf FastVRAM FavorBitBlt InternDisp NoBitBlt NoFontCache NoImageBlt NoMemAccess NoPciDisconnect NoPixmapCache NoProgramClocks NoSplitXfer OverrideBIOS OverrideValidateMode ProgLcdModeRegs ProgLcdModeStretch SlowDRAMrefresh SlowVRAM SwapHiBit 5. Ramdac Names. Ramdac names should be consistent between drivers. Case, white space and underscore characters are ignored when comparing ramdac names. All names listed here are in lower case with all white space and underscores removed. 6. Clock Chip Names. Clock chip names should be consistent between drivers. Case, white space and underscore characters are ignored when comparing clock chip names. All names listed here are in lower case with all white space and underscores removed. $XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.18 2002/04/06 18:31:09 tsi Exp $ xorg-server-1.17.1/hw/xfree86/doc/exa-driver.txt0000664000175100017510000000601312160102336016264 00000000000000Adding EXA support to your X.Org video driver --------------------------------------------- EXA (for EXcellent Architecture or Ex-kaa aXeleration Architecture or whatever) aims to extend the life of the venerable XFree86 video drivers by introducing a new set of acceleration hooks that efficiently accelerate the X Render extension, including solid fills, blits within screen memory and to and from system memory, and Porter-Duff compositing and transform operations. Configuration ------------- Some drivers implement a per-instance useEXA flag to track whether EXA is active or not. Setting the flag can be done in the driver's Options parsing routine. Loading EXA ------------ EXA drivers in the XFree86 DDX should use the loadable module loader to load the EXA core. Careful versioning allows the EXA API to be extended without breaking the ABI for older versions of drivers. Example code for loading EXA: static const char *exaSymbols[] = { "exaDriverAlloc", "exaDriverInit", "exaDriverFini", "exaOffscreenAlloc", "exaOffscreenFree", "exaGetPixmapOffset", "exaGetPixmapPitch", "exaGetPixmapSize", "exaMarkSync", "exaWaitSync", NULL }; if (info->useEXA) { info->exaReq.majorversion = 2; info->exaReq.minorversion = 0; if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, &info->exaReq, &errmaj, &errmin)) { LoaderErrorMsg(NULL, "exa", errmaj, errmin); return FALSE; } xf86LoaderReqSymLists(exaSymbols, NULL); } EXA is then initialized using exaDriverAlloc and exaDriverInit. See doxygen documentation for getting started there. Further documentation ------------ The EXA driver interface and public API is documented using doxygen in xserver/xorg/exa/. To build the documentation, run: doxygen -g doxygen Doxyfile The resulting documentation will appear an html/index.html under the current directory. EXA initialization ------------------ Your driver's AccelInit routine must initialize an ExaDriverRec structure if EXA support is enabled, with appropriate error handling (i.e. NoAccel and NoXvideo should be set to true if EXA fails to initialize for whatever reason). The AccelInit routine also needs to make sure that there's enough offscreen memory for certain operations to function, like Xvideo, which should advertise a maximum size no larger than can be dealt with given the amount of offscreen memory available. EXA and Xv ---------- Video support becomes easier with EXA since AllocateFBMemory can use exaOffscreenAlloc directly, freeing a previous area if necessary and allocating a new one. Likewise, FreeFBMemory can call exaOffscreenFree. EXA teardown ------------ At screen close time, EXA drivers should call exaDriverFini with their screen pointer, free their EXADriver structure, and do any other necessary teardown. EXA misc. --------- In many drivers, DGA support will need to be changed to be aware of the new EXA support. Send updates and corrections to Jesse Barnes or just check them in if you have permission. xorg-server-1.17.1/hw/xfree86/doc/Makefile.in0000664000175100017510000005603112466505432015544 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # # Generate output formats for a single DocBook/XML with/without chapters # # Variables set by the calling Makefile: # noinst_DATA: developers docs are not installed # docbook: the main DocBook/XML file, no chapters, appendix or image files # chapters: all files pulled in by an XInclude statement and images. # # # This makefile is intended for Developers Documentation and is not installed. # Do not use for Users docs or Specs which need to be installed and require olink support # Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 # for an explanation on documents classification. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/devbook.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(am__dist_noinst_DATA_DIST) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_1 = $(docbook:.xml=.html) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@am__append_2 = $(docbook:.xml=.txt) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_3 = $(docbook:.xml=.pdf) $(docbook:.xml=.ps) subdir = hw/xfree86/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_noinst_DATA_DIST = ddxDesign.xml DATA = $(dist_noinst_DATA) $(noinst_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ # Main DocBook/XML files (DOCTYPE book) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@docbook = ddxDesign.xml # Developers documnetation is not installed @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@noinst_DATA = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_1) \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_2) \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_3) # DocBook/XML file with chapters, appendix and images it includes @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@dist_noinst_DATA = $(docbook) $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@FILTER_XMLTO = $(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_HTML_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_FO_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --stringparam img.src.path=$(abs_builddir)/ \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@CLEANFILES = $(noinst_DATA) # Generate DocBook/XML output formats with or without stylesheets EXTRA_DIST = \ Registry \ exa-driver.txt \ README.DRIcomp \ README.modes all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/devbook.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/doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/doc/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_srcdir)/devbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< # 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: xorg-server-1.17.1/hw/xfree86/doc/README.modes0000664000175100017510000004077412160102336015457 00000000000000 Multi-monitor Mode Setting APIs Keith Packard, SaveScreen and the core X screen saver will be implemented by disabling outputs and crtcs using their dpms functions. void xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) Pass this function to xf86DPMSInit and all DPMS mode switching will be managed by using the dpms functions provided by the Outputs and CRTCs. Bool xf86CrtcScreenInit (ScreenPtr screen) This function completes the screen initialization process for the crtc and output objects. Call it near the end of the ScreenInit function, after the frame buffer and acceleration layers have been added. 3.3 EnterVT functions Functions used during EnterVT, or whenever the current configuration needs to be applied to the hardware. Bool xf86SetDesiredModes (ScrnInfoPtr scrn) xf86InitialConfiguration selects the desired configuration at PreInit time; when the server finally hits ScreenInit, xf86SetDesiredModes is used by the driver to take that configuration and apply it to the hardware. In addition, successful mode selection at other times updates the configuration that will be used by this function, so LeaveVT/EnterVT pairs can simply invoke this and return to the previous configuration. 3.4 SwitchMode functions Functions called from the pScrn->SwitchMode hook, which is used by the XFree86-VidModeExtension and the keypad mode switch commands. Bool xf86SetSingleMode (ScrnInfoPtr scrn, DisplayModePtr desired, Rotation rotation) This function applies the specified mode to all active outputs. Which is to say, it picks reasonable modes for all active outputs, attempting to get the screen to the specified size while not breaking anything that is currently working. 3.7 get_modes functions Functions called during output->get_modes to help build lists of modes xf86MonPtr xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) This returns the EDID data structure for the 'output' using the I2C bus 'pDDCBus'. This has no effect on 'output' itself. void xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) Once the EDID data has been fetched, this call applies the EDID data to the output object, setting the physical size and also various properties, like the DDC root window property (when output is the 'compat' output), and the RandR 1.2 EDID output properties. DisplayModePtr xf86OutputGetEDIDModes (xf86OutputPtr output) Given an EDID data structure, this function computes a list of suitable modes. This function also applies a sequence of 'quirks' during this process so that the returned modes may not actually match the mode data present in the EDID data. 3.6 Other functions These remaining functions in the API can be used by the driver as needed. Bool xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) Applies a mode to a CRTC. All of the outputs which are currently using the specified CRTC are included in the mode setting process. 'x' and 'y' are the offset within the frame buffer that the crtc is placed at. No checking is done in this function to ensure that the mode is usable by the active outputs. void xf86ProbeOutputModes (ScrnInfoPtr pScrn, int maxX, int maxY) This discards the mode lists for all outputs, re-detects monitor presence and then acquires new mode lists for all monitors which are not disconnected. Monitor configuration data is used to modify the mode lists returned by the outputs. 'maxX' and 'maxY' limit the maximum size modes that will be returned. void xf86SetScrnInfoModes (ScrnInfoPtr pScrn) This copies the 'compat' output mode list into the pScrn modes list which is used by the XFree86-VidModeExtension and the keypad mode switching operations. The current 'desired' mode for the CRTC associated with the 'compat' output is placed first in this list to indicate the current mode. Usually, the driver won't need to call this function as xf86InitialConfiguration will do so automatically, as well as any RandR functions which reprobe for modes. However, if the driver reprobes for modes at other times using xf86ProbeOutputModes, this function needs to be called. Bool xf86DiDGAReInit (ScreenPtr pScreen) This is similar to xf86SetScrnInfoModes, but it applies the 'compat' output mode list to the set of modes advertised by the DGA extension; it needs to be called whenever xf86ProbeOutputModes is invoked. void xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) After any sequence of calls using xf86CrtcSetMode, this function cleans up any leftover Output and CRTC objects by disabling them, saving power. It is safe to call this whenever the server is running as it only disables objects which are not currently in use. 4. CRTC operations 4.1 CRTC functions These functions provide an abstract interface for the CRTC object; most manipulation of the CRTC object is done through these functions. void crtc->funcs->dpms (xf86CrtcPtr crtc, int mode) Where 'mode' is one of DPMSModeOff, DPMSModeSuspend, DPMSModeStandby or DPMSModeOn. This requests that the crtc go to the specified power state. When changing power states, the output dpms functions are invoked before the crtc dpms functions. void crtc->funcs->save (xf86CrtcPtr crtc) void crtc->funcs->restore (xf86CrtcPtr crtc) Preserve/restore any register contents related to the CRTC. These are strictly a convenience for the driver writer; if the existing driver has fully operation save/restore functions, you need not place any additional code here. In particular, the server itself never uses this function. Bool crtc->funcs->lock (xf86CrtcPtr crtc) void crtc->funcs->unlock (xf86CrtcPtr crtc) These functions are invoked around mode setting operations; the intent is that DRI locking be done here to prevent DRI applications from manipulating the hardware while the server is busy changing the output configuration. If the lock function returns FALSE, the unlock function will not be invoked. Bool crtc->funcs->mode_fixup (xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode) This call gives the CRTC a chance to see what mode will be set and to comment on the mode by changing 'adjusted_mode' as needed. This function shall not modify the state of the crtc hardware at all. If the CRTC cannot accept this mode, this function may return FALSE. void crtc->funcs->prepare (xf86CrtcPtr crtc) This call is made just before the mode is set to make the hardware ready for the operation. A usual function to perform here is to disable the crtc so that mode setting can occur with clocks turned off and outputs deactivated. void crtc->funcs->mode_set (xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode) This function applies the specified mode (possibly adjusted by the CRTC and/or Outputs). void crtc->funcs->commit (xf86CrtcPtr crtc) Once the mode has been applied to the CRTC and Outputs, this function is invoked to let the hardware turn things back on. void crtc->funcs->gamma_set (xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, int size) This function adjusts the gamma ramps for the specified crtc. void * crtc->funcs->shadow_allocate (xf86CrtcPtr crtc, int width, int height) This function allocates frame buffer space for a shadow frame buffer. When allocated, the crtc must scan from the shadow instead of the main frame buffer. This is used for rotation. The address returned is passed to the shadow_create function. This function should return NULL on failure. PixmapPtr crtc->funcs->shadow_create (xf86CrtcPtr crtc, void *data, int width, int height) This function creates a pixmap object that will be used as a shadow of the main frame buffer for CRTCs which are rotated or reflected. 'data' is the value returned by shadow_allocate. void crtc->funcs->shadow_destroy (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data) Destroys any associated shadow objects. If pPixmap is NULL, then a pixmap was not created, but 'data' may still be non-NULL indicating that the shadow had been allocated. void crtc->funcs->destroy (xf86CrtcPtr crtc) When a CRTC is destroyed (which only happens in error cases), this function can clean up any driver-specific data. 4.2 CRTC fields The CRTC object is not opaque; there are several fields of interest to the driver writer. struct _xf86Crtc { /** * Associated ScrnInfo */ ScrnInfoPtr scrn; /** * Active state of this CRTC * * Set when this CRTC is driving one or more outputs */ Bool enabled; /** Track whether cursor is within CRTC range */ Bool cursorInRange; /** Track state of cursor associated with this CRTC */ Bool cursorShown; /** * Active mode * * This reflects the mode as set in the CRTC currently * It will be cleared when the VT is not active or * during server startup */ DisplayModeRec mode; Rotation rotation; PixmapPtr rotatedPixmap; void *rotatedData; /** * Position on screen * * Locates this CRTC within the frame buffer */ int x, y; /** * Desired mode * * This is set to the requested mode, independent of * whether the VT is active. In particular, it receives * the startup configured mode and saves the active mode * on VT switch. */ DisplayModeRec desiredMode; Rotation desiredRotation; int desiredX, desiredY; /** crtc-specific functions */ const xf86CrtcFuncsRec *funcs; /** * Driver private * * Holds driver-private information */ void *driver_private; #ifdef RANDR_12_INTERFACE /** * RandR crtc * * When RandR 1.2 is available, this * points at the associated crtc object */ RRCrtcPtr randr_crtc; #else void *randr_crtc; #endif }; 5. Output functions. 6. Configuration Because the configuration file syntax is fixed, this was done by creating new "Driver" section options that hook specific outputs to specific "Monitor" sections in the file. The option: section of the form: Option "monitor-VGA" "My VGA Monitor" connects the VGA output of this driver to the "Monitor" section with Identifier "My VGA Monitor". All of the usual monitor options can now be placed in that "Monitor" section and will be applied to the VGA output configuration. xorg-server-1.17.1/hw/xfree86/doc/README.DRIcomp0000664000175100017510000005012112406661137015644 00000000000000 DRI Compilation Guide VA Linux Systems, Inc. Professional Services - Graphics. 21 April 2001 1. Preamble 1.1 Copyright Copyright 2000-2001 by VA Linux Systems, Inc. All Rights Reserved. Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies. 1.2 Trademarks OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics, Inc. Unix is a registered trademark of The Open Group. The `X' device and X Window System are trademarks of The Open Group. XFree86 is a trademark of The XFree86 Project. Linux is a registered trademark of Linus Torvalds. Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd. 3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter- active, Incorporated. Matrox is a registered trademark of Matrox Electronic Systems Ltd. ATI Rage and Radeon is a registered trademark of ATI Technolo- gies, Inc. All other trademarks mentioned are the property of their respec- tive owners. 2. Introduction This document describes how to download, compile and install the DRI. The DRI provides 3D graphics hardware acceleration for the XFree86 project. This information is intended for experienced Linux developers. Beginners are probably better off installing precompiled packages. Edits, corrections and updates to this document may be mailed to . Last updated on 13 February 2002 by Brian Paul. 3. Prerequisites You'll need the following: o An installation of XFree86 4.1 or later. The DRI tree has been pruned down to minimize its size. But in order to build the DRI tree you need to have recent X header files, etc. already installed. If you don't have XFree86 4.1 (or later) installed you can probably install it from RPMs (or another package format). Or, you can download XFree86 as sources and compile/install it yourself. o At least 200MB of free disk space. If you compile for debugging (the -g option) then you'll need about 600MB. o GCC compiler and related tools. o ssh (secure shell) if you're a DRI developer and don't want to use anonymous CVS download. o A 2.4.x Linux Kernel. See below for details. o FreeBSD support is not currently being maintained and may not work. The DRI 3D drivers generally work on systems with Intel or AMD CPUs. How- ever, limited support for Alpha and PowerPC support is underway. For 3dfx Voodoo hardware, you'll also need the Glide3 runtime library (libglide3-v3.so for Voodoo3 or libglide3-v5.so for Voodoo4/5). These can be downloaded from the DRI website. You can compile them yourself, but it's often a painful process. For Matrox G200/G400, Intel i810/i830 or ATI Rage128/Radeon hardware, you'll also need AGP support in your Linux kernel, either built-in or as a loadable module. 4. Linux Kernel Preparation Only the Linux 2.4.x kernels are currently supported by the DRI hardware drivers. 2.5.x kernels may work, but aren't tested. Most of the DRI drivers require AGP support and using Intel Pentium III SSE optimizations also requires an up-to-date Linux kernel. Configuring your kernel correctly is very important, as features such as SSE optimizations will be disabled if your kernel does not support them. Thus, if you have a Pentium III processor, you must configure your kernel for the Pentium III processor family. Building a new Linux kernel can be difficult for beginners but there are resources on the Internet to help. This document assumes experience with configuring, building and installing Linux kernels. Linux kernels can be downloaded from www.kernel.org Here are the basic steps for kernel setup. o Download the needed kernel and put it in /usr/src. Create a directory for the source and unpack it. For example: cd /usr/src rm -f linux mkdir linux-2.4.x ln -s linux-2.4.x linux bzcat linux-2.4.x.tar.bz2 | tar xf - It is critical that /usr/src/linux point to your new kernel sources, otherwise the kernel headers will not be used when building the DRI. This will almost certainly cause compilation problems. o Read /usr/src/linux/Documentation/Changes. This file lists the minimum requirements for all software packages required to build the kernel. You must upgrade at least gcc, make, binutils and modutils to at least the versions specified in this file. The other packages may not be needed. If you are upgrading from Linux 2.2.x you must upgrade your modutils package for Linux 2.4.x. o Configure your kernel. You might, for example, use make menuconfig and do the following: o Go to Code maturity level options o Enable Prompt for development and/or incomplete code/drivers o hit ESC to return to the top-level menu o Go to Processor type and features o Select your processor type from Processor Family o hit ESC to return to the top-level menu o Go to Character devices o Disable Direct Rendering Manager (XFree86 DRI support) since we'll use the DRI code from the XFree86/DRI tree and will compile it there. o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW) o Hit SPACE twice to build AGP support into the kernel o Enable all chipsets' support for AGP o Configure the rest of the kernel as required for your system (i.e. Eth- ernet, SCSI, etc) o Exit, saving your kernel configuration. o Edit your /etc/lilo.conf file. Make sure you have an image entry as follows (or similar): image=/boot/vmlinuz label=linux.2.4.x read-only root=/dev/hda1 The important part is that you have /boot/vmlinuz without a trailing version number. If this is the first entry in your /etc/lilo.conf AND you haven't set a default, then this will be your default kernel. o Compile the new kernel. cd /usr/src/linux-2.4.x make dep make bzImage make modules make modules_install make install Note that last make command will automatically run lilo for you. o Now reboot to use the new kernel. 5. CPU Architectures In general, nothing special has to be done to use the DRI on different CPU architectures. There are, however, a few optimizations that are CPU-depen- dent. Mesa will determine at runtime which CPU-dependent optimizations should be used and enable them where appropriate. 5.1 Intel Pentium III Features The Pentium III SSE instructions are used in optimized vertex transformation functions in the Mesa-based DRI drivers. On Linux, SSE requires a recent kernel (such as 2.4.0-test11 or later) both at compile time and runtime. 5.2 AMD 3DNow! Features AMD's 3DNow! instructions are used in optimized vertex transformation func- tions in the Mesa-based DRI drivers. 3DNow! is supported in most versions of Linux. 5.3 Alpha Features On newer Alpha processors a significant performance increase can be seen with the addition of the -mcpu= option to GCC. This option is dependent on the architecture of the processor. For example, -mcpu=ev6 will build specifi- cally for the EV6 based AXP's, giving both byte and word alignment access to the DRI/Mesa drivers. To enable this optimization edit your xc/config/host.def file and add the line: #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 Additional speed improvements to 3D rendering can be achieved by installing Compaq's Math Libraries (CPML) which can be obtained from http://www.sup- port.compaq.com/alpha-tools/software/index.html Once installed, you can add this line to your host.def to build with the CPML libraries: #define UseCompaqMathLibrary YES The host.def file is explained below. 6. Downloading the XFree86/DRI CVS Sources The DRI project is hosted by SourceForge. The DRI source code, which is a subset of the XFree86 source tree, is kept in a CVS repository there. The DRI CVS sources may be accessed either anonymously or as a registered SourceForge user. It's recommended that you become a registered SourceForge user so that you may submit non-anonymous bug reports and can participate in the mailing lists. 6.1 Anonymous CVS download: 1. Create a directory to store the CVS files: cd ~ mkdir DRI-CVS You could put your CVS directory in a different place but we'll use ~/DRI-CVS/ here. 2. Check out the CVS sources: cd ~/DRI-CVS cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login (hit ENTER when prompted for a password) cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc The -z3 flag causes compression to be used in order to reduce the down- load time. 6.2 Registered CVS download: 1. Create a directory to store the CVS files: cd ~ mkdir DRI-CVS You could put your CVS directory in a different place but we'll use ~/DRI-CVS/ here. 2. Set the CVS_RSH environment variable: setenv CVS_RSH ssh // if using csh or tcsh export CVS_RSH=ssh // if using sh or bash 3. Check out the CVS sources: cd ~/DRI-CVS cvs -z3 -d:ext:YOURID@cvs.dri.sourceforge.net:/cvsroot/dri co xc Replace YOURID with your CVS login name. You'll be prompted to enter your sourceforge password. The -z3 flag causes compression to be used in order to reduce the down- load time. 6.3 Updating your CVS sources In the future you'll want to occasionally update your local copy of the DRI source code to get the latest changes. This can be done with: cd ~/DRI-CVS cvs -z3 update -dA xc The -d flag causes any new subdirectories to be created and -A causes most recent trunk sources to be fetched, not branch sources. 7. Mesa Most of the DRI 3D drivers are based on Mesa (the free implementation of the OpenGL API). The relevant files from Mesa are already included in the XFree86/DRI source tree. There is no need to download or install the Mesa source files separately. Sometimes a newer version of Mesa will be available than the version included in XFree86/DRI. Upgrading Mesa within XFree86/DRI is not always straightfor- ward. It can be an error-prone undertaking, especially for beginners, and is not generally recommended. The DRI developers will upgrade Mesa when appro- priate. 8. Compiling the XFree86/DRI tree 8.1 Make a build tree Rather than placing object files and library files right in the source tree, they're instead put into a parallel build tree. The build tree is made with the lndir command: cd ~/DRI-CVS ln -s xc XFree40 mkdir build cd build lndir -silent -ignorelinks ../XFree40 The build tree will be populated with symbolic links which point back into the CVS source tree. Advanced users may have several build trees for compiling and testing with different options. 8.2 Edit the host.def file The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the XFree86 build process. You can change it to customize your build options or make adjustments for your particular system configuration The default host.def file will look something like this: #define DefaultCCOptions -Wall (i386) #define DefaultGcc2i386Opt -O2 (Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) #define LibraryCDebugFlags -O2 #define BuildServersOnly YES #define XF86CardDrivers vga tdfx mga ati i810 #define LinuxDistribution LinuxRedHat #define DefaultCCOptions -ansi GccWarningOptions -pipe #define BuildXF86DRI YES /* Optionally turn these on for debugging */ /* #define GlxBuiltInTdfx YES */ /* #define GlxBuiltInMga YES */ /* #define GlxBuiltInR128 YES */ /* #define GlxBuiltInRadeon YES */ /* #define DoLoadableServer NO */ #define SharedLibFont NO The ProjectRoot variable specifies where the XFree86 files will be installed. We recommend installing the DRI files over your existing XFree86 installation - it's generally safe to do and less error-prone. This policy is different than what we used to recommend. If XFree86 4.x is not installed in /usr/X11R6/ you'll have to add the follow- ing to the host.def file: #define ProjectRoot pathToYourXFree86installation Note the XF86CardDrivers line to be sure your card's driver is listed. If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following: #define MesaUse3DNow YES You don't have to be using an AMD processor in order to enable this option. The DRI will look for 3DNow! support and runtime and only enable it if appli- cable. If you want to enable SSE optimizations in Mesa and the DRI drivers, you must upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by both your processor and your operating system, but to build Mesa inside the DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If you enable SSE optimizations with an earlier version of the Linux kernel in /usr/src/linux, Mesa will not compile. You have been warned. If you do have a 2.4.x kernel, you should add the following: #define MesaUseSSE YES If you want to build the DRM kernel modules as part of the full build pro- cess, add the following: #define BuildXF86DRM YES Otherwise, you'll need to build them separately as described below. 8.3 Compilation To compile the complete DRI tree: cd ~/DRI-CVS/build/xc/ make World >& world.log Or if you want to watch the compilation progress: cd ~/DRI-CVS/build/xc/ make World >& world.log & tail -f world.log With the default compilation flags it's normal to get a lot of warnings dur- ing compilation. Building will take some time so you may want to go check your email or visit slashdot. WARNING: do not use the -j option with make. It's reported that it does not work with XFree86/DRI. 8.4 Check for compilation errors Using your text editor, examine world.log for errors by searching for the pattern ***. After fixing the errors, run make World again. Later, you might just compile parts of the source tree but it's important that the whole tree will build first. If you edited your host.def file to enable automatic building of the DRI ker- nel module(s), verify that they were built: cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel ls Otherwise, build them now by running cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel make -f Makefile.linux For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI Radeon, you should see radeon.o. For the Intel i810, you should see i810.o. If the DRI kernel module(s) failed to build you should verify that you're using the right version of the Linux kernel. The most recent kernels are not always supported. If your build machine is running a different version of the kernel than your target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel source tree. This can be fixed by explicitly setting the value of LINUXDIR. If the path to your kernel source is /usr/src/linux-2.4.x, cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN- UXDIR line. 8.5 DRI kernel module installation The DRI kernel modules will be in ~/DRI-CVS/build/xc/pro- grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/. To load the appropriate DRM module in your running kernel you can either use ismod and restart your X server or copy the kernel module to /lib/mod- ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X server. Make sure you first unload any older DRI kernel modules that might be already loaded. Note that some DRM modules require that the agpgart module be loaded first. 9. Normal Installation and Configuration Most users will want to install the new X server and use it in place of their old X server. This section explains how to do that. Developers, on the other hand, may just want to test the X server without actually installing it as their default server. If you want to do that, skip to the next section. 9.1 Installation Here are the installation commands: su cd ~/DRI-CVS/build/xc make install 9.2 Update the XF86Config File You may need to edit your XF86Config file to enable the DRI. The config file is usually installed as /etc/X11/XF86Config-4. See the DRI User Guide for details, but basically, you need to load the "glx" and "dri" modules and add a "DRI" section. On the DRI web site, in the resources section, you'll find example XF86Config files for a number of graphics cards. These configuration files also setup DRI options so it's highly recommended that you look at these examples. The XFree86 4.x server can generate a basic configuration file itself. Sim- ply do this: cd /usr/X11R6/bin ./XFree86 -configure A file named /root/XF86Config.new will be created. It should allow you to try your X server but you'll almost certainly have to edit it. For example, you should add HorizSync and VertRefresh options to the Monitor section and Modes options to the Screen section. Also, the ModulePath option in the Files section should be set to /usr/X11R6/lib/modules. 9.3 Start the New X Server The new X server should be ready to use now. Start your X server in your usual manner. Often times the startx command is used: startx 10. Testing the Server Without Installing It As mentioned at the start of section 9, developers may want to simply run the X server without installing it. This can save some time and allow you to keep a number of X servers available for testing. 10.1 Configuration As described in the preceding section, you'll need to create a configuration file for the new server. Put the XF86Config file in your ~/DRI- CVS/build/xc/programs/Xserver directory. Be sure the ModulePath option in your XF86Config file is set correctly. 10.2 A Startup Script A simple shell script can be used to start the X server. Here's an example. #!/bin/sh export DISPLAY=:0 ./XFree86 -xf86config XF86Config & \ sleep 2 fvwm2 & xset b off xmodmap -e "clear mod4" xsetroot -solid "#00306f" xterm -geometry 80x40+0+0 You might name this script start-dri. Put it in your ~/DRI-CVS/build/xc/pro- grams/Xserver directory. To test the server run the script: cd ~/DRI-CVS/build/xc/programs/Xserver ./start-dri For debugging, you may also want to capture the log messages printed by the server in a file. If you're using the C-shell: ./start-dri >& log 11. Where To Go From Here At this point your X server should be up and running with hardware-acceler- ated direct rendering. Please read the DRI User Guide for information about trouble shooting and how to use the DRI-enabled X server for 3D applications. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 dawes Exp $ xorg-server-1.17.1/hw/xfree86/fbdevhw/0000775000175100017510000000000012466505444014435 500000000000000xorg-server-1.17.1/hw/xfree86/fbdevhw/Makefile.am0000664000175100017510000000064712200102654016376 00000000000000SUBDIRS = man module_LTLIBRARIES = libfbdevhw.la libfbdevhw_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) if FBDEVHW libfbdevhw_la_SOURCES = fbdevhw.c else libfbdevhw_la_SOURCES = fbdevhwstub.c endif AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../i2c -I$(srcdir)/../modes -I$(srcdir)/../ddc -I$(srcdir)/../parser AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = fbdevhw.h EXTRA_DIST = fbpriv.h README xorg-server-1.17.1/hw/xfree86/fbdevhw/README0000664000175100017510000000100612160102336015212 00000000000000 This is a submodule to access linux framebuffer devices. It is supported to work as helper module (like vgahw) for the chipset drivers. There are functions for saving/restoring/setting video modes, set palette entries, and a few more helper functions. Some of them can be hooked directly into ScrnInfoRec. In ../drivers/fbdev is a "chipset" driver. It is a simple, non-accelerated and hardware-independent driver which works on top of this fbdevhw submodule. Gerd -- Gerd Knorr xorg-server-1.17.1/hw/xfree86/fbdevhw/fbpriv.h0000664000175100017510000002610212274325511016007 00000000000000/* * copyed from from linux kernel 2.2.4 * removed internal stuff (#ifdef __KERNEL__) */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _LINUX_FB_H #define _LINUX_FB_H #include /* Definitions of frame buffers */ #define FB_MAJOR 29 #define FB_MODES_SHIFT 5 /* 32 modes per framebuffer */ #define FB_NUM_MINORS 256 /* 256 Minors */ #define FB_MAX (FB_NUM_MINORS / (1 << FB_MODES_SHIFT)) #define GET_FB_IDX(node) (MINOR(node) >> FB_MODES_SHIFT) /* ioctls 0x46 is 'F' */ #define FBIOGET_VSCREENINFO 0x4600 #define FBIOPUT_VSCREENINFO 0x4601 #define FBIOGET_FSCREENINFO 0x4602 #define FBIOGETCMAP 0x4604 #define FBIOPUTCMAP 0x4605 #define FBIOPAN_DISPLAY 0x4606 /* 0x4607-0x460B are defined below */ /* #define FBIOGET_MONITORSPEC 0x460C */ /* #define FBIOPUT_MONITORSPEC 0x460D */ /* #define FBIOSWITCH_MONIBIT 0x460E */ #define FBIOGET_CON2FBMAP 0x460F #define FBIOPUT_CON2FBMAP 0x4610 #define FBIOBLANK 0x4611 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ #define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */ #define FB_TYPE_TEXT 3 /* Text/attributes */ #define FB_AUX_TEXT_MDA 0 /* Monochrome text */ #define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */ #define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */ #define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */ #define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */ #define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */ #define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */ #define FB_VISUAL_TRUECOLOR 2 /* True color */ #define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */ #define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */ #define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */ #define FB_ACCEL_NONE 0 /* no hardware accelerator */ #define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */ #define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */ #define FB_ACCEL_S3_TRIO64 3 /* Cybervision64 (S3 Trio64) */ #define FB_ACCEL_NCR_77C32BLT 4 /* RetinaZ3 (NCR 77C32BLT) */ #define FB_ACCEL_S3_VIRGE 5 /* Cybervision64/3D (S3 ViRGE) */ #define FB_ACCEL_ATI_MACH64GX 6 /* ATI Mach 64GX family */ #define FB_ACCEL_DEC_TGA 7 /* DEC 21030 TGA */ #define FB_ACCEL_ATI_MACH64CT 8 /* ATI Mach 64CT family */ #define FB_ACCEL_ATI_MACH64VT 9 /* ATI Mach 64CT family VT class */ #define FB_ACCEL_ATI_MACH64GT 10 /* ATI Mach 64CT family GT class */ #define FB_ACCEL_SUN_CREATOR 11 /* Sun Creator/Creator3D */ #define FB_ACCEL_SUN_CGSIX 12 /* Sun cg6 */ #define FB_ACCEL_SUN_LEO 13 /* Sun leo/zx */ #define FB_ACCEL_IMS_TWINTURBO 14 /* IMS Twin Turbo */ #define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dlabs Permedia 2 */ #define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium) */ #define FB_ACCEL_MATROX_MGA1064SG 17 /* Matrox MGA1064SG (Mystique) */ #define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */ #define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */ #define FB_ACCEL_MATROX_MGAG100 20 /* Matrox G100 (Productiva G100) */ #define FB_ACCEL_MATROX_MGAG200 21 /* Matrox G200 (Myst, Mill, ...) */ #define FB_ACCEL_SUN_CG14 22 /* Sun cgfourteen */ #define FB_ACCEL_SUN_BWTWO 23 /* Sun bwtwo */ #define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */ #define FB_ACCEL_SUN_TCX 25 /* Sun tcx */ #define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */ #define FB_ACCEL_NV3 27 /* nVidia RIVA 128 */ #define FB_ACCEL_NV4 28 /* nVidia RIVA TNT */ #define FB_ACCEL_NV5 29 /* nVidia RIVA TNT2 */ #define FB_ACCEL_CT_6555x 30 /* C&T 6555x */ #define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */ #define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */ struct fb_fix_screeninfo { char id[16]; /* identification string eg "TT Builtin" */ char *smem_start; /* Start of frame buffer mem */ /* (physical address) */ __u32 smem_len; /* Length of frame buffer mem */ __u32 type; /* see FB_TYPE_* */ __u32 type_aux; /* Interleave for interleaved Planes */ __u32 visual; /* see FB_VISUAL_* */ __u16 xpanstep; /* zero if no hardware panning */ __u16 ypanstep; /* zero if no hardware panning */ __u16 ywrapstep; /* zero if no hardware ywrap */ __u32 line_length; /* length of a line in bytes */ char *mmio_start; /* Start of Memory Mapped I/O */ /* (physical address) */ __u32 mmio_len; /* Length of Memory Mapped I/O */ __u32 accel; /* Type of acceleration available */ __u16 reserved[3]; /* Reserved for future compatibility */ }; /* Interpretation of offset for color fields: All offsets are from the right, * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you * can use the offset as right argument to <<). A pixel afterwards is a bit * stream and is written to video memory as that unmodified. This implies * big-endian byte order if bits_per_pixel is greater than 8. */ struct fb_bitfield { __u32 offset; /* beginning of bitfield */ __u32 length; /* length of bitfield */ __u32 msb_right; /* != 0 : Most significant bit is */ /* right */ }; #define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */ #define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl) */ #define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */ #define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */ #define FB_ACTIVATE_MASK 15 /* values */ #define FB_ACTIVATE_VBL 16 /* activate values on next vbl */ #define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */ #define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */ #define FB_ACCELF_TEXT 1 /* text mode acceleration */ #define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */ #define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */ #define FB_SYNC_EXT 4 /* external sync */ #define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */ #define FB_SYNC_BROADCAST 16 /* broadcast video timings */ /* vtotal = 144d/288n/576i => PAL */ /* vtotal = 121d/242n/484i => NTSC */ #define FB_SYNC_ON_GREEN 32 /* sync on green */ #define FB_VMODE_NONINTERLACED 0 /* non interlaced */ #define FB_VMODE_INTERLACED 1 /* interlaced */ #define FB_VMODE_DOUBLE 2 /* double scan */ #define FB_VMODE_MASK 255 #define FB_VMODE_YWRAP 256 /* ywrap instead of panning */ #define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */ #define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */ struct fb_var_screeninfo { __u32 xres; /* visible resolution */ __u32 yres; __u32 xres_virtual; /* virtual resolution */ __u32 yres_virtual; __u32 xoffset; /* offset from virtual to visible */ __u32 yoffset; /* resolution */ __u32 bits_per_pixel; /* guess what */ __u32 grayscale; /* != 0 Graylevels instead of colors */ struct fb_bitfield red; /* bitfield in fb mem if true color, */ struct fb_bitfield green; /* else only length is significant */ struct fb_bitfield blue; struct fb_bitfield transp; /* transparency */ __u32 nonstd; /* != 0 Non standard pixel format */ __u32 activate; /* see FB_ACTIVATE_* */ __u32 height; /* height of picture in mm */ __u32 width; /* width of picture in mm */ __u32 accel_flags; /* acceleration flags (hints) */ /* Timing: All values in pixclocks, except pixclock (of course) */ __u32 pixclock; /* pixel clock in ps (pico seconds) */ __u32 left_margin; /* time from sync to picture */ __u32 right_margin; /* time from picture to sync */ __u32 upper_margin; /* time from sync to picture */ __u32 lower_margin; __u32 hsync_len; /* length of horizontal sync */ __u32 vsync_len; /* length of vertical sync */ __u32 sync; /* see FB_SYNC_* */ __u32 vmode; /* see FB_VMODE_* */ __u32 reserved[6]; /* Reserved for future compatibility */ }; struct fb_cmap { __u32 start; /* First entry */ __u32 len; /* Number of entries */ __u16 *red; /* Red values */ __u16 *green; __u16 *blue; __u16 *transp; /* transparency, can be NULL */ }; struct fb_con2fbmap { __u32 console; __u32 framebuffer; }; struct fb_monspecs { __u32 hfmin; /* hfreq lower limit (Hz) */ __u32 hfmax; /* hfreq upper limit (Hz) */ __u16 vfmin; /* vfreq lower limit (Hz) */ __u16 vfmax; /* vfreq upper limit (Hz) */ unsigned dpms:1; /* supports DPMS */ }; #if 1 #define FBCMD_GET_CURRENTPAR 0xDEAD0005 #define FBCMD_SET_CURRENTPAR 0xDEAD8005 #endif #if 1 /* Preliminary */ /* * Hardware Cursor */ #define FBIOGET_FCURSORINFO 0x4607 #define FBIOGET_VCURSORINFO 0x4608 #define FBIOPUT_VCURSORINFO 0x4609 #define FBIOGET_CURSORSTATE 0x460A #define FBIOPUT_CURSORSTATE 0x460B struct fb_fix_cursorinfo { __u16 crsr_width; /* width and height of the cursor in */ __u16 crsr_height; /* pixels (zero if no cursor) */ __u16 crsr_xsize; /* cursor size in display pixels */ __u16 crsr_ysize; __u16 crsr_color1; /* colormap entry for cursor color1 */ __u16 crsr_color2; /* colormap entry for cursor color2 */ }; struct fb_var_cursorinfo { __u16 width; __u16 height; __u16 xspot; __u16 yspot; __u8 data[1]; /* field with [height][width] */ }; struct fb_cursorstate { __s16 xoffset; __s16 yoffset; __u16 mode; }; #define FB_CURSOR_OFF 0 #define FB_CURSOR_ON 1 #define FB_CURSOR_FLASH 2 #endif /* Preliminary */ #endif /* _LINUX_FB_H */ xorg-server-1.17.1/hw/xfree86/fbdevhw/man/0000775000175100017510000000000012466505444015210 500000000000000xorg-server-1.17.1/hw/xfree86/fbdevhw/man/Makefile.am0000664000175100017510000000007612160102336017147 00000000000000include $(top_srcdir)/manpages.am driverman_PRE = fbdevhw.man xorg-server-1.17.1/hw/xfree86/fbdevhw/man/fbdevhw.man0000664000175100017510000000167612160102336017244 00000000000000.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.1 2001/01/24 00:06:34 dawes Exp $ .TH FBDEVHW __drivermansuffix__ __vendorversion__ .SH NAME fbdevhw \- os-specific submodule for framebuffer device access .SH DESCRIPTION .B fbdevhw provides functions for talking to a framebuffer device. It is os-specific. It is a submodule used by other video drivers. A .B fbdevhw module is currently available for linux framebuffer devices. .PP 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" Xorg(__appmansuffix__), xorg.conf(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), fbdev(__drivermansuffix__) .SH AUTHORS Authors include: Gerd Knorr, based on the XF68_FBDev Server code (Martin Schaller, Geert Uytterhoeven). xorg-server-1.17.1/hw/xfree86/fbdevhw/man/Makefile.in0000664000175100017510000006236412466505432017205 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = hw/xfree86/fbdevhw/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man driverman_PRE = fbdevhw.man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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/fbdevhw/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/fbdevhw/man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/xfree86/fbdevhw/Makefile.in0000664000175100017510000010151212466505432016417 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/fbdevhw DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libfbdevhw_la_LIBADD = am__libfbdevhw_la_SOURCES_DIST = fbdevhwstub.c fbdevhw.c @FBDEVHW_FALSE@am_libfbdevhw_la_OBJECTS = fbdevhwstub.lo @FBDEVHW_TRUE@am_libfbdevhw_la_OBJECTS = fbdevhw.lo libfbdevhw_la_OBJECTS = $(am_libfbdevhw_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 = libfbdevhw_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libfbdevhw_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 = $(libfbdevhw_la_SOURCES) DIST_SOURCES = $(am__libfbdevhw_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 HEADERS = $(sdk_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = man module_LTLIBRARIES = libfbdevhw.la libfbdevhw_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) @FBDEVHW_FALSE@libfbdevhw_la_SOURCES = fbdevhwstub.c @FBDEVHW_TRUE@libfbdevhw_la_SOURCES = fbdevhw.c AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../i2c -I$(srcdir)/../modes -I$(srcdir)/../ddc -I$(srcdir)/../parser AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = fbdevhw.h EXTRA_DIST = fbpriv.h README all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/fbdevhw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/fbdevhw/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libfbdevhw.la: $(libfbdevhw_la_OBJECTS) $(libfbdevhw_la_DEPENDENCIES) $(EXTRA_libfbdevhw_la_DEPENDENCIES) $(AM_V_CCLD)$(libfbdevhw_la_LINK) -rpath $(moduledir) $(libfbdevhw_la_OBJECTS) $(libfbdevhw_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbdevhw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbdevhwstub.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 -o $@ $< .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 -o $@ `$(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) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sdkdir)"; 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-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-moduleLTLIBRARIES install-sdkHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-moduleLTLIBRARIES uninstall-sdkHEADERS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-moduleLTLIBRARIES cscopelist-am ctags ctags-am 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 installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES 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: xorg-server-1.17.1/hw/xfree86/fbdevhw/fbdevhw.h0000664000175100017510000000606612274325511016153 00000000000000 #ifndef _FBDEVHW_H_ #define _FBDEVHW_H_ #include "xf86str.h" #include "colormapst.h" #define FBDEVHW_PACKED_PIXELS 0 /* Packed Pixels */ #define FBDEVHW_PLANES 1 /* Non interleaved planes */ #define FBDEVHW_INTERLEAVED_PLANES 2 /* Interleaved planes */ #define FBDEVHW_TEXT 3 /* Text/attributes */ #define FBDEVHW_VGA_PLANES 4 /* EGA/VGA planes */ extern _X_EXPORT Bool fbdevHWGetRec(ScrnInfoPtr pScrn); extern _X_EXPORT void fbdevHWFreeRec(ScrnInfoPtr pScrn); extern _X_EXPORT int fbdevHWGetFD(ScrnInfoPtr pScrn); extern _X_EXPORT Bool fbdevHWProbe(struct pci_device *pPci, char *device, char **namep); extern _X_EXPORT Bool fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device); extern _X_EXPORT char *fbdevHWGetName(ScrnInfoPtr pScrn); extern _X_EXPORT int fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp); extern _X_EXPORT int fbdevHWGetLineLength(ScrnInfoPtr pScrn); extern _X_EXPORT int fbdevHWGetType(ScrnInfoPtr pScrn); extern _X_EXPORT int fbdevHWGetVidmem(ScrnInfoPtr pScrn); extern _X_EXPORT void *fbdevHWMapVidmem(ScrnInfoPtr pScrn); extern _X_EXPORT int fbdevHWLinearOffset(ScrnInfoPtr pScrn); extern _X_EXPORT Bool fbdevHWUnmapVidmem(ScrnInfoPtr pScrn); extern _X_EXPORT void *fbdevHWMapMMIO(ScrnInfoPtr pScrn); extern _X_EXPORT Bool fbdevHWUnmapMMIO(ScrnInfoPtr pScrn); extern _X_EXPORT void fbdevHWSetVideoModes(ScrnInfoPtr pScrn); extern _X_EXPORT DisplayModePtr fbdevHWGetBuildinMode(ScrnInfoPtr pScrn); extern _X_EXPORT void fbdevHWUseBuildinMode(ScrnInfoPtr pScrn); extern _X_EXPORT Bool fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); extern _X_EXPORT void fbdevHWSave(ScrnInfoPtr pScrn); extern _X_EXPORT void fbdevHWRestore(ScrnInfoPtr pScrn); extern _X_EXPORT void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual); extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, 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); extern _X_EXPORT xf86SwitchModeProc *fbdevHWSwitchModeWeak(void); extern _X_EXPORT xf86AdjustFrameProc *fbdevHWAdjustFrameWeak(void); extern _X_EXPORT xf86EnterVTProc *fbdevHWEnterVTWeak(void); extern _X_EXPORT xf86LeaveVTProc *fbdevHWLeaveVTWeak(void); extern _X_EXPORT xf86ValidModeProc *fbdevHWValidModeWeak(void); extern _X_EXPORT xf86DPMSSetProc *fbdevHWDPMSSetWeak(void); extern _X_EXPORT xf86LoadPaletteProc *fbdevHWLoadPaletteWeak(void); extern _X_EXPORT SaveScreenProcPtr fbdevHWSaveScreenWeak(void); #endif xorg-server-1.17.1/hw/xfree86/fbdevhw/fbdevhwstub.c0000664000175100017510000000551612366220413017040 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86cmap.h" #include "fbdevhw.h" /* Stubs for the static server on platforms that don't support fbdev */ Bool fbdevHWGetRec(ScrnInfoPtr pScrn) { return FALSE; } void fbdevHWFreeRec(ScrnInfoPtr pScrn) { } Bool fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) { return FALSE; } Bool fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device) { xf86Msg(X_ERROR, "fbdevhw is not available on this platform\n"); return FALSE; } char * fbdevHWGetName(ScrnInfoPtr pScrn) { return NULL; } int fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp) { return -1; } int fbdevHWGetLineLength(ScrnInfoPtr pScrn) { return -1; /* Should cause something spectacular... */ } int fbdevHWGetType(ScrnInfoPtr pScrn) { return -1; } int fbdevHWGetVidmem(ScrnInfoPtr pScrn) { return -1; } void fbdevHWSetVideoModes(ScrnInfoPtr pScrn) { } DisplayModePtr fbdevHWGetBuildinMode(ScrnInfoPtr pScrn) { return NULL; } void fbdevHWUseBuildinMode(ScrnInfoPtr pScrn) { } void * fbdevHWMapVidmem(ScrnInfoPtr pScrn) { return NULL; } int fbdevHWLinearOffset(ScrnInfoPtr pScrn) { return 0; } Bool fbdevHWUnmapVidmem(ScrnInfoPtr pScrn) { return FALSE; } void * fbdevHWMapMMIO(ScrnInfoPtr pScrn) { return NULL; } Bool fbdevHWUnmapMMIO(ScrnInfoPtr pScrn) { return FALSE; } Bool fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { return FALSE; } void fbdevHWSave(ScrnInfoPtr pScrn) { } void fbdevHWRestore(ScrnInfoPtr pScrn) { } void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { } ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { return MODE_ERROR; } Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { return FALSE; } void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { } Bool fbdevHWEnterVT(ScrnInfoPtr pScrn) { return FALSE; } void fbdevHWLeaveVT(ScrnInfoPtr pScrn) { } void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags) { } Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode) { return FALSE; } xf86SwitchModeProc * fbdevHWSwitchModeWeak(void) { return fbdevHWSwitchMode; } xf86AdjustFrameProc * fbdevHWAdjustFrameWeak(void) { return fbdevHWAdjustFrame; } xf86EnterVTProc * fbdevHWEnterVTWeak(void) { return fbdevHWEnterVT; } xf86LeaveVTProc * fbdevHWLeaveVTWeak(void) { return fbdevHWLeaveVT; } xf86ValidModeProc * fbdevHWValidModeWeak(void) { return fbdevHWValidMode; } xf86DPMSSetProc * fbdevHWDPMSSetWeak(void) { return fbdevHWDPMSSet; } xf86LoadPaletteProc * fbdevHWLoadPaletteWeak(void) { return fbdevHWLoadPalette; } SaveScreenProcPtr fbdevHWSaveScreenWeak(void) { return fbdevHWSaveScreen; } xorg-server-1.17.1/hw/xfree86/fbdevhw/fbdevhw.c0000664000175100017510000006163112456571574016163 00000000000000/* all driver need this */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Modes.h" #include "xf86_OSproc.h" /* pci stuff */ #include "xf86Pci.h" #include "xf86cmap.h" #include "fbdevhw.h" #include "fbpriv.h" #include "globals.h" #include #define PAGE_MASK (~(getpagesize() - 1)) static XF86ModuleVersionInfo fbdevHWVersRec = { "fbdevhw", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 0, 0, 2, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData fbdevhwModuleData = { &fbdevHWVersRec, NULL, NULL }; #include #include #include #include #include #include #include /* -------------------------------------------------------------------- */ /* our private data, and two functions to allocate/free this */ #define FBDEVHWPTRLVAL(p) (p)->privates[fbdevHWPrivateIndex].ptr #define FBDEVHWPTR(p) ((fbdevHWPtr)(FBDEVHWPTRLVAL(p))) static int fbdevHWPrivateIndex = -1; typedef struct { /* framebuffer device: filename (/dev/fb*), handle, more */ char *device; int fd; void *fbmem; unsigned int fbmem_len; unsigned int fboff; char *mmio; unsigned int mmio_len; /* current hardware state */ struct fb_fix_screeninfo fix; struct fb_var_screeninfo var; /* saved video mode */ struct fb_var_screeninfo saved_var; /* buildin video mode */ DisplayModeRec buildin; } fbdevHWRec, *fbdevHWPtr; Bool fbdevHWGetRec(ScrnInfoPtr pScrn) { if (fbdevHWPrivateIndex < 0) fbdevHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); if (FBDEVHWPTR(pScrn) != NULL) return TRUE; FBDEVHWPTRLVAL(pScrn) = xnfcalloc(sizeof(fbdevHWRec), 1); return TRUE; } void fbdevHWFreeRec(ScrnInfoPtr pScrn) { if (fbdevHWPrivateIndex < 0) return; free(FBDEVHWPTR(pScrn)); FBDEVHWPTRLVAL(pScrn) = NULL; } int fbdevHWGetFD(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr; fbdevHWGetRec(pScrn); fPtr = FBDEVHWPTR(pScrn); return fPtr->fd; } /* -------------------------------------------------------------------- */ /* some helpers for printing debug informations */ #if DEBUG static void print_fbdev_mode(char *txt, struct fb_var_screeninfo *var) { ErrorF("fbdev %s mode:\t%d %d %d %d %d %d %d %d %d %d %d:%d:%d\n", txt, var->pixclock, var->xres, var->right_margin, var->hsync_len, var->left_margin, var->yres, var->lower_margin, var->vsync_len, var->upper_margin, var->bits_per_pixel, var->red.length, var->green.length, var->blue.length); } static void print_xfree_mode(char *txt, DisplayModePtr mode) { ErrorF("xfree %s mode:\t%d %d %d %d %d %d %d %d %d\n", txt, mode->Clock, mode->HDisplay, mode->HSyncStart, mode->HSyncEnd, mode->HTotal, mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, mode->VTotal); } #endif /* -------------------------------------------------------------------- */ /* Convert timings between the XFree and the Frame Buffer Device */ static void xfree2fbdev_fblayout(ScrnInfoPtr pScrn, struct fb_var_screeninfo *var) { var->xres_virtual = pScrn->displayWidth ? pScrn->displayWidth : pScrn->virtualX; var->yres_virtual = pScrn->virtualY; var->bits_per_pixel = pScrn->bitsPerPixel; if (pScrn->defaultVisual == TrueColor || pScrn->defaultVisual == DirectColor) { var->red.length = pScrn->weight.red; var->green.length = pScrn->weight.green; var->blue.length = pScrn->weight.blue; } else { var->red.length = 8; var->green.length = 8; var->blue.length = 8; } } static void xfree2fbdev_timing(DisplayModePtr mode, struct fb_var_screeninfo *var) { var->xres = mode->HDisplay; var->yres = mode->VDisplay; if (var->xres_virtual < var->xres) var->xres_virtual = var->xres; if (var->yres_virtual < var->yres) var->yres_virtual = var->yres; var->xoffset = var->yoffset = 0; var->pixclock = mode->Clock ? 1000000000 / mode->Clock : 0; var->right_margin = mode->HSyncStart - mode->HDisplay; var->hsync_len = mode->HSyncEnd - mode->HSyncStart; var->left_margin = mode->HTotal - mode->HSyncEnd; var->lower_margin = mode->VSyncStart - mode->VDisplay; var->vsync_len = mode->VSyncEnd - mode->VSyncStart; var->upper_margin = mode->VTotal - mode->VSyncEnd; var->sync = 0; if (mode->Flags & V_PHSYNC) var->sync |= FB_SYNC_HOR_HIGH_ACT; if (mode->Flags & V_PVSYNC) var->sync |= FB_SYNC_VERT_HIGH_ACT; if (mode->Flags & V_PCSYNC) var->sync |= FB_SYNC_COMP_HIGH_ACT; if (mode->Flags & V_BCAST) var->sync |= FB_SYNC_BROADCAST; if (mode->Flags & V_INTERLACE) var->vmode = FB_VMODE_INTERLACED; else if (mode->Flags & V_DBLSCAN) var->vmode = FB_VMODE_DOUBLE; else var->vmode = FB_VMODE_NONINTERLACED; } static Bool fbdev_modes_equal(struct fb_var_screeninfo *set, struct fb_var_screeninfo *req) { return (set->xres_virtual >= req->xres_virtual && set->yres_virtual >= req->yres_virtual && set->bits_per_pixel == req->bits_per_pixel && set->red.length == req->red.length && set->green.length == req->green.length && set->blue.length == req->blue.length && set->xres == req->xres && set->yres == req->yres && set->right_margin == req->right_margin && set->hsync_len == req->hsync_len && set->left_margin == req->left_margin && set->lower_margin == req->lower_margin && set->vsync_len == req->vsync_len && set->upper_margin == req->upper_margin && set->sync == req->sync && set->vmode == req->vmode); } static void fbdev2xfree_timing(struct fb_var_screeninfo *var, DisplayModePtr mode) { mode->Clock = var->pixclock ? 1000000000 / var->pixclock : 0; mode->HDisplay = var->xres; mode->HSyncStart = mode->HDisplay + var->right_margin; mode->HSyncEnd = mode->HSyncStart + var->hsync_len; mode->HTotal = mode->HSyncEnd + var->left_margin; mode->VDisplay = var->yres; mode->VSyncStart = mode->VDisplay + var->lower_margin; mode->VSyncEnd = mode->VSyncStart + var->vsync_len; mode->VTotal = mode->VSyncEnd + var->upper_margin; mode->Flags = 0; mode->Flags |= var->sync & FB_SYNC_HOR_HIGH_ACT ? V_PHSYNC : V_NHSYNC; mode->Flags |= var->sync & FB_SYNC_VERT_HIGH_ACT ? V_PVSYNC : V_NVSYNC; mode->Flags |= var->sync & FB_SYNC_COMP_HIGH_ACT ? V_PCSYNC : V_NCSYNC; if (var->sync & FB_SYNC_BROADCAST) mode->Flags |= V_BCAST; if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) mode->Flags |= V_INTERLACE; else if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) mode->Flags |= V_DBLSCAN; mode->SynthClock = mode->Clock; mode->CrtcHDisplay = mode->HDisplay; mode->CrtcHSyncStart = mode->HSyncStart; mode->CrtcHSyncEnd = mode->HSyncEnd; mode->CrtcHTotal = mode->HTotal; mode->CrtcVDisplay = mode->VDisplay; mode->CrtcVSyncStart = mode->VSyncStart; mode->CrtcVSyncEnd = mode->VSyncEnd; mode->CrtcVTotal = mode->VTotal; mode->CrtcHAdjusted = FALSE; mode->CrtcVAdjusted = FALSE; } /* -------------------------------------------------------------------- */ /* open correct framebuffer device */ /** * Try to find the framebuffer device for a given PCI device */ static int fbdev_open_pci(struct pci_device *pPci, char **namep) { struct fb_fix_screeninfo fix; char filename[256]; int fd, i; for (i = 0; i < 8; i++) { snprintf(filename, sizeof(filename), "/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics/fb%d", pPci->domain, pPci->bus, pPci->dev, pPci->func, i); fd = open(filename, O_RDONLY, 0); if (fd < 0) { snprintf(filename, sizeof(filename), "/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics:fb%d", pPci->domain, pPci->bus, pPci->dev, pPci->func, i); fd = open(filename, O_RDONLY, 0); } if (fd >= 0) { close(fd); snprintf(filename, sizeof(filename), "/dev/fb%d", i); fd = open(filename, O_RDWR, 0); if (fd != -1) { if (ioctl(fd, FBIOGET_FSCREENINFO, (void *) &fix) != -1) { if (namep) { *namep = xnfalloc(16); strncpy(*namep, fix.id, 16); } return fd; } close(fd); } } } if (namep) *namep = NULL; xf86DrvMsg(-1, X_ERROR, "Unable to find a valid framebuffer device\n"); return -1; } static int fbdev_open(int scrnIndex, const char *dev, char **namep) { struct fb_fix_screeninfo fix; int fd; /* try argument (from XF86Config) first */ if (dev) { fd = open(dev, O_RDWR, 0); } else { /* second: environment variable */ dev = getenv("FRAMEBUFFER"); if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) { /* last try: default device */ dev = "/dev/fb0"; fd = open(dev, O_RDWR, 0); } } if (fd == -1) { xf86DrvMsg(scrnIndex, X_ERROR, "open %s: %s\n", dev, strerror(errno)); return -1; } if (namep) { if (-1 == ioctl(fd, FBIOGET_FSCREENINFO, (void *) (&fix))) { *namep = NULL; xf86DrvMsg(scrnIndex, X_ERROR, "FBIOGET_FSCREENINFO: %s\n", strerror(errno)); return -1; } else { *namep = xnfalloc(16); strncpy(*namep, fix.id, 16); } } return fd; } /* -------------------------------------------------------------------- */ Bool fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) { int fd; if (pPci) fd = fbdev_open_pci(pPci, namep); else fd = fbdev_open(-1, device, namep); if (-1 == fd) return FALSE; close(fd); return TRUE; } Bool fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device) { fbdevHWPtr fPtr; fbdevHWGetRec(pScrn); fPtr = FBDEVHWPTR(pScrn); /* open device */ if (pPci) fPtr->fd = fbdev_open_pci(pPci, NULL); else fPtr->fd = fbdev_open(pScrn->scrnIndex, device, NULL); if (-1 == fPtr->fd) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to open framebuffer device, consult warnings" " and/or errors above for possible reasons\n" "\t(you may have to look at the server log to see" " warnings)\n"); return FALSE; } /* get current fb device settings */ if (-1 == ioctl(fPtr->fd, FBIOGET_FSCREENINFO, (void *) (&fPtr->fix))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ioctl FBIOGET_FSCREENINFO: %s\n", strerror(errno)); return FALSE; } if (-1 == ioctl(fPtr->fd, FBIOGET_VSCREENINFO, (void *) (&fPtr->var))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ioctl FBIOGET_VSCREENINFO: %s\n", strerror(errno)); return FALSE; } /* we can use the current settings as "buildin mode" */ fbdev2xfree_timing(&fPtr->var, &fPtr->buildin); fPtr->buildin.name = "current"; fPtr->buildin.next = &fPtr->buildin; fPtr->buildin.prev = &fPtr->buildin; fPtr->buildin.type |= M_T_BUILTIN; return TRUE; } char * fbdevHWGetName(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); return fPtr->fix.id; } int fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (fbbpp) *fbbpp = fPtr->var.bits_per_pixel; if (fPtr->fix.visual == FB_VISUAL_TRUECOLOR || fPtr->fix.visual == FB_VISUAL_DIRECTCOLOR) return fPtr->var.red.length + fPtr->var.green.length + fPtr->var.blue.length; else return fPtr->var.bits_per_pixel; } int fbdevHWGetLineLength(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (fPtr->fix.line_length) return fPtr->fix.line_length; else return fPtr->var.xres_virtual * fPtr->var.bits_per_pixel / 8; } int fbdevHWGetType(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); return fPtr->fix.type; } int fbdevHWGetVidmem(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); return fPtr->fix.smem_len; } static Bool fbdevHWSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool check) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); struct fb_var_screeninfo req_var = fPtr->var, set_var; xfree2fbdev_fblayout(pScrn, &req_var); xfree2fbdev_timing(mode, &req_var); #if DEBUG print_xfree_mode("init", mode); print_fbdev_mode("init", &req_var); #endif set_var = req_var; if (check) set_var.activate = FB_ACTIVATE_TEST; if (0 != ioctl(fPtr->fd, FBIOPUT_VSCREENINFO, (void *) (&set_var))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOPUT_VSCREENINFO: %s\n", strerror(errno)); return FALSE; } if (!fbdev_modes_equal(&set_var, &req_var)) { if (!check) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOPUT_VSCREENINFO succeeded but modified " "mode\n"); #if DEBUG print_fbdev_mode("returned", &set_var); #endif return FALSE; } if (!check) fPtr->var = set_var; return TRUE; } void fbdevHWSetVideoModes(ScrnInfoPtr pScrn) { const char **modename; DisplayModePtr mode, this, last = pScrn->modes; if (NULL == pScrn->display->modes) return; pScrn->virtualX = pScrn->display->virtualX; pScrn->virtualY = pScrn->display->virtualY; for (modename = pScrn->display->modes; *modename != NULL; modename++) { for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next) { if (0 == strcmp(mode->name, *modename)) { if (fbdevHWSetMode(pScrn, mode, TRUE)) break; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tmode \"%s\" test failed\n", *modename); } } if (NULL == mode) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tmode \"%s\" not found\n", *modename); continue; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tmode \"%s\" ok\n", *modename); if (pScrn->virtualX < mode->HDisplay) pScrn->virtualX = mode->HDisplay; if (pScrn->virtualY < mode->VDisplay) pScrn->virtualY = mode->VDisplay; if (NULL == pScrn->modes) { this = pScrn->modes = xf86DuplicateMode(mode); this->next = this; this->prev = this; } else { this = xf86DuplicateMode(mode); this->next = pScrn->modes; this->prev = last; last->next = this; pScrn->modes->prev = this; } last = this; } } DisplayModePtr fbdevHWGetBuildinMode(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); return &fPtr->buildin; } void fbdevHWUseBuildinMode(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); pScrn->modes = &fPtr->buildin; pScrn->virtualX = pScrn->display->virtualX; pScrn->virtualY = pScrn->display->virtualY; if (pScrn->virtualX < fPtr->buildin.HDisplay) pScrn->virtualX = fPtr->buildin.HDisplay; if (pScrn->virtualY < fPtr->buildin.VDisplay) pScrn->virtualY = fPtr->buildin.VDisplay; } /* -------------------------------------------------------------------- */ static void calculateFbmem_len(fbdevHWPtr fPtr) { fPtr->fboff = (unsigned long) fPtr->fix.smem_start & ~PAGE_MASK; fPtr->fbmem_len = (fPtr->fboff + fPtr->fix.smem_len + ~PAGE_MASK) & PAGE_MASK; } void * fbdevHWMapVidmem(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (NULL == fPtr->fbmem) { calculateFbmem_len(fPtr); fPtr->fbmem = mmap(NULL, fPtr->fbmem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fPtr->fd, 0); if (-1 == (long) fPtr->fbmem) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "mmap fbmem: %s\n", strerror(errno)); fPtr->fbmem = NULL; } else { /* Perhaps we'd better add fboff to fbmem and return 0 in fbdevHWLinearOffset()? Of course we then need to mask fPtr->fbmem with PAGE_MASK in fbdevHWUnmapVidmem() as well. [geert] */ } } pScrn->memPhysBase = (unsigned long) fPtr->fix.smem_start & (unsigned long) (PAGE_MASK); pScrn->fbOffset = (unsigned long) fPtr->fix.smem_start & (unsigned long) (~PAGE_MASK); return fPtr->fbmem; } int fbdevHWLinearOffset(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); return fPtr->fboff; } Bool fbdevHWUnmapVidmem(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (NULL != fPtr->fbmem) { if (-1 == munmap(fPtr->fbmem, fPtr->fbmem_len)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "munmap fbmem: %s\n", strerror(errno)); fPtr->fbmem = NULL; } return TRUE; } void * fbdevHWMapMMIO(ScrnInfoPtr pScrn) { unsigned int mmio_off; fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (NULL == fPtr->mmio) { /* tell the kernel not to use accels to speed up console scrolling */ fPtr->var.accel_flags = 0; if (0 != ioctl(fPtr->fd, FBIOPUT_VSCREENINFO, (void *) (&fPtr->var))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOPUT_VSCREENINFO: %s\n", strerror(errno)); return FALSE; } mmio_off = (unsigned long) fPtr->fix.mmio_start & ~PAGE_MASK; fPtr->mmio_len = (mmio_off + fPtr->fix.mmio_len + ~PAGE_MASK) & PAGE_MASK; if (NULL == fPtr->fbmem) calculateFbmem_len(fPtr); fPtr->mmio = mmap(NULL, fPtr->mmio_len, PROT_READ | PROT_WRITE, MAP_SHARED, fPtr->fd, fPtr->fbmem_len); if (-1 == (long) fPtr->mmio) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "mmap mmio: %s\n", strerror(errno)); fPtr->mmio = NULL; } else fPtr->mmio += mmio_off; } return fPtr->mmio; } Bool fbdevHWUnmapMMIO(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (NULL != fPtr->mmio) { if (-1 == munmap((void *) ((unsigned long) fPtr->mmio & PAGE_MASK), fPtr->mmio_len)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "munmap mmio: %s\n", strerror(errno)); fPtr->mmio = NULL; /* FIXME: restore var.accel_flags [geert] */ } return TRUE; } /* -------------------------------------------------------------------- */ Bool fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); pScrn->vtSema = TRUE; /* set */ if (!fbdevHWSetMode(pScrn, mode, FALSE)) return FALSE; /* read back */ if (0 != ioctl(fPtr->fd, FBIOGET_FSCREENINFO, (void *) (&fPtr->fix))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOGET_FSCREENINFO: %s\n", strerror(errno)); return FALSE; } if (0 != ioctl(fPtr->fd, FBIOGET_VSCREENINFO, (void *) (&fPtr->var))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOGET_VSCREENINFO: %s\n", strerror(errno)); return FALSE; } if (pScrn->defaultVisual == TrueColor || pScrn->defaultVisual == DirectColor) { /* XXX: This is a hack, but it should be a NOP for all the setups that * worked before and actually seems to fix some others... */ pScrn->offset.red = fPtr->var.red.offset; pScrn->offset.green = fPtr->var.green.offset; pScrn->offset.blue = fPtr->var.blue.offset; pScrn->mask.red = ((1 << fPtr->var.red.length) - 1) << fPtr->var.red.offset; pScrn->mask.green = ((1 << fPtr->var.green.length) - 1) << fPtr->var.green.offset; pScrn->mask.blue = ((1 << fPtr->var.blue.length) - 1) << fPtr->var.blue.offset; } return TRUE; } /* -------------------------------------------------------------------- */ /* video mode save/restore */ void fbdevHWSave(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (0 != ioctl(fPtr->fd, FBIOGET_VSCREENINFO, (void *) (&fPtr->saved_var))) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOGET_VSCREENINFO: %s\n", strerror(errno)); } void fbdevHWRestore(ScrnInfoPtr pScrn) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (0 != ioctl(fPtr->fd, FBIOPUT_VSCREENINFO, (void *) (&fPtr->saved_var))) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOPUT_VSCREENINFO: %s\n", strerror(errno)); } /* -------------------------------------------------------------------- */ /* callback for xf86HandleColormaps */ void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); struct fb_cmap cmap; unsigned short red, green, blue; int i; cmap.len = 1; cmap.red = &red; cmap.green = &green; cmap.blue = &blue; cmap.transp = NULL; for (i = 0; i < numColors; i++) { cmap.start = indices[i]; red = (colors[indices[i]].red << 8) | colors[indices[i]].red; green = (colors[indices[i]].green << 8) | colors[indices[i]].green; blue = (colors[indices[i]].blue << 8) | colors[indices[i]].blue; if (-1 == ioctl(fPtr->fd, FBIOPUTCMAP, (void *) &cmap)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOPUTCMAP: %s\n", strerror(errno)); } } /* -------------------------------------------------------------------- */ /* these can be hooked directly into ScrnInfoRec */ ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { if (!fbdevHWSetMode(pScrn, mode, TRUE)) return MODE_BAD; return MODE_OK; } Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { if (!fbdevHWSetMode(pScrn, mode, FALSE)) return FALSE; return TRUE; } void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual || y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual) return; fPtr->var.xoffset = x; fPtr->var.yoffset = y; if (-1 == ioctl(fPtr->fd, FBIOPAN_DISPLAY, (void *) &fPtr->var)) xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 5, "FBIOPAN_DISPLAY: %s\n", strerror(errno)); } Bool fbdevHWEnterVT(ScrnInfoPtr pScrn) { if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) return FALSE; fbdevHWAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } void fbdevHWLeaveVT(ScrnInfoPtr pScrn) { fbdevHWRestore(pScrn); } void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags) { fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); unsigned long fbmode; if (!pScrn->vtSema) return; switch (mode) { case DPMSModeOn: fbmode = 0; break; case DPMSModeStandby: fbmode = 2; break; case DPMSModeSuspend: fbmode = 3; break; case DPMSModeOff: fbmode = 4; break; default: return; } if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) fbmode)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOBLANK: %s\n", strerror(errno)); } Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); unsigned long unblank; if (!pScrn->vtSema) return TRUE; unblank = xf86IsUnblank(mode); if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) (1 - unblank))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FBIOBLANK: %s\n", strerror(errno)); return FALSE; } return TRUE; } xf86SwitchModeProc * fbdevHWSwitchModeWeak(void) { return fbdevHWSwitchMode; } xf86AdjustFrameProc * fbdevHWAdjustFrameWeak(void) { return fbdevHWAdjustFrame; } xf86EnterVTProc * fbdevHWEnterVTWeak(void) { return fbdevHWEnterVT; } xf86LeaveVTProc * fbdevHWLeaveVTWeak(void) { return fbdevHWLeaveVT; } xf86ValidModeProc * fbdevHWValidModeWeak(void) { return fbdevHWValidMode; } xf86DPMSSetProc * fbdevHWDPMSSetWeak(void) { return fbdevHWDPMSSet; } xf86LoadPaletteProc * fbdevHWLoadPaletteWeak(void) { return fbdevHWLoadPalette; } SaveScreenProcPtr fbdevHWSaveScreenWeak(void) { return fbdevHWSaveScreen; } xorg-server-1.17.1/hw/xfree86/drivers/0000775000175100017510000000000012466505445014467 500000000000000xorg-server-1.17.1/hw/xfree86/drivers/Makefile.am0000664000175100017510000000010312406661137016430 00000000000000SUBDIRS = if XORG_DRIVER_MODESETTING SUBDIRS += modesetting endif xorg-server-1.17.1/hw/xfree86/drivers/modesetting/0000775000175100017510000000000012466505445017011 500000000000000xorg-server-1.17.1/hw/xfree86/drivers/modesetting/Makefile.am0000664000175100017510000000467012456571574021001 00000000000000# Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON 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. # this is obnoxious: # -module lets us name the module exactly how we want # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) $(UDEV_CFLAGS) $(CWARNFLAGS) AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(top_srcdir)/glamor \ -I$(srcdir)/../../ddc \ -I$(srcdir)/../../dri2 \ -I$(srcdir)/../../i2c \ -I$(srcdir)/../../modes \ -I$(srcdir)/../../parser \ -I$(srcdir)/../../ramdac \ $(NULL) modesetting_drv_la_LTLIBRARIES = modesetting_drv.la modesetting_drv_la_LDFLAGS = -module -avoid-version modesetting_drv_la_LIBADD = $(UDEV_LIBS) $(DRM_LIBS) modesetting_drv_ladir = @moduledir@/drivers modesetting_drv_la_SOURCES = \ dri2.c \ driver.c \ driver.h \ drmmode_display.c \ drmmode_display.h \ dumb_bo.c \ dumb_bo.h \ present.c \ vblank.c \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) driverman_PRE = modesetting.man driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) EXTRA_DIST = modesetting.man CLEANFILES = $(driverman_DATA) # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ xorg-server-1.17.1/hw/xfree86/drivers/modesetting/drmmode_display.h0000664000175100017510000001256512462701171022255 00000000000000/* * Copyright © 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Dave Airlie * */ #ifndef DRMMODE_DISPLAY_H #define DRMMODE_DISPLAY_H #include "xf86drmMode.h" #ifdef CONFIG_UDEV_KMS #include "libudev.h" #endif #include "dumb_bo.h" struct gbm_device; typedef struct { struct dumb_bo *dumb; #ifdef GLAMOR_HAS_GBM struct gbm_bo *gbm; #endif } drmmode_bo; typedef struct { int fd; unsigned fb_id; unsigned old_fb_id; drmModeResPtr mode_res; drmModeFBPtr mode_fb; int cpp; ScrnInfoPtr scrn; struct gbm_device *gbm; #ifdef CONFIG_UDEV_KMS struct udev_monitor *uevent_monitor; InputHandlerProc uevent_handler; #endif drmEventContext event_context; drmmode_bo front_bo; Bool sw_cursor; Bool glamor; Bool shadow_enable; void *shadow_fb; /** * A screen-sized pixmap when we're doing triple-buffered DRI2 * pageflipping. * * One is shared between all drawables that flip to the front * buffer, and it only gets reallocated when root pixmap size * changes. */ PixmapPtr triple_buffer_pixmap; /** The GEM name for triple_buffer_pixmap */ uint32_t triple_buffer_name; DevPrivateKeyRec pixmapPrivateKeyRec; } drmmode_rec, *drmmode_ptr; typedef struct { drmmode_ptr drmmode; drmModeCrtcPtr mode_crtc; uint32_t vblank_pipe; int dpms_mode; struct dumb_bo *cursor_bo; Bool cursor_up; uint16_t lut_r[256], lut_g[256], lut_b[256]; DamagePtr slave_damage; drmmode_bo rotate_bo; unsigned rotate_fb_id; /** * @{ MSC (vblank count) handling for the PRESENT extension. * * The kernel's vblank counters are 32 bits and apparently full of * lies, and we need to give a reliable 64-bit msc for GL, so we * have to track and convert to a userland-tracked 64-bit msc. */ int32_t vblank_offset; uint32_t msc_prev; uint64_t msc_high; /** @} */ } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; typedef struct { drmModePropertyPtr mode_prop; uint64_t value; int num_atoms; /* if range prop, num_atoms == 1; if enum prop, num_atoms == num_enums + 1 */ Atom *atoms; } drmmode_prop_rec, *drmmode_prop_ptr; typedef struct { drmmode_ptr drmmode; int output_id; drmModeConnectorPtr mode_output; drmModeEncoderPtr *mode_encoders; drmModePropertyBlobPtr edid_blob; int dpms_enum_id; int num_props; drmmode_prop_ptr props; int enc_mask; int enc_clone_mask; } drmmode_output_private_rec, *drmmode_output_private_ptr; typedef struct _msPixmapPriv { uint32_t fb_id; struct dumb_bo *backing_bo; /* if this pixmap is backed by a dumb bo */ } msPixmapPrivRec, *msPixmapPrivPtr; extern DevPrivateKeyRec msPixmapPrivateKeyRec; #define msPixmapPrivateKey (&msPixmapPrivateKeyRec) #define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec)) uint32_t drmmode_bo_get_handle(drmmode_bo *bo); Bool drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode); void *drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv); Bool drmmode_SetSlaveBO(PixmapPtr ppix, drmmode_ptr drmmode, int fd_handle, int pitch, int size); extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y); extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode); extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode); extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode); Bool drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); void *drmmode_map_front_bo(drmmode_ptr drmmode); Bool drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); void drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode, int *depth, int *bpp); #ifndef DRM_CAP_DUMB_PREFERRED_DEPTH #define DRM_CAP_DUMB_PREFERRED_DEPTH 3 #endif #ifndef DRM_CAP_DUMB_PREFER_SHADOW #define DRM_CAP_DUMB_PREFER_SHADOW 4 #endif #define MS_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #endif xorg-server-1.17.1/hw/xfree86/drivers/modesetting/drmmode_display.c0000664000175100017510000015250312462701171022245 00000000000000/* * Copyright © 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Dave Airlie * */ #ifdef HAVE_DIX_CONFIG_H #include "dix-config.h" #endif #include #include #include #include #include "dumb_bo.h" #include "xf86str.h" #include "X11/Xatom.h" #include "micmap.h" #include "xf86cmap.h" #include "xf86DDC.h" #include #include "xf86Crtc.h" #include "drmmode_display.h" #include #include #include "driver.h" static int drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo) { int ret; #ifdef GLAMOR_HAS_GBM if (bo->gbm) { gbm_bo_destroy(bo->gbm); bo->gbm = NULL; } #endif if (bo->dumb) { ret = dumb_bo_destroy(drmmode->fd, bo->dumb); if (ret == 0) bo->dumb = NULL; } return 0; } static uint32_t drmmode_bo_get_pitch(drmmode_bo *bo) { #ifdef GLAMOR_HAS_GBM if (bo->gbm) return gbm_bo_get_stride(bo->gbm); #endif return bo->dumb->pitch; } static Bool drmmode_bo_has_bo(drmmode_bo *bo) { #ifdef GLAMOR_HAS_GBM if (bo->gbm) return TRUE; #endif return bo->dumb != NULL; } uint32_t drmmode_bo_get_handle(drmmode_bo *bo) { #ifdef GLAMOR_HAS_GBM if (bo->gbm) return gbm_bo_get_handle(bo->gbm).u32; #endif return bo->dumb->handle; } static void * drmmode_bo_map(drmmode_ptr drmmode, drmmode_bo *bo) { int ret; #ifdef GLAMOR_HAS_GBM if (bo->gbm) return NULL; #endif if (bo->dumb->ptr) return bo->dumb->ptr; ret = dumb_bo_map(drmmode->fd, bo->dumb); if (ret) return NULL; return bo->dumb->ptr; } static Bool drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo, unsigned width, unsigned height, unsigned bpp) { #ifdef GLAMOR_HAS_GBM if (drmmode->glamor) { bo->gbm = gbm_bo_create(drmmode->gbm, width, height, GBM_FORMAT_ARGB8888, GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); return bo->gbm != NULL; } #endif bo->dumb = dumb_bo_create(drmmode->fd, width, height, bpp); return bo->dumb != NULL; } Bool drmmode_SetSlaveBO(PixmapPtr ppix, drmmode_ptr drmmode, int fd_handle, int pitch, int size) { msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); ppriv->backing_bo = dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size); if (!ppriv->backing_bo) return FALSE; close(fd_handle); return TRUE; } static void drmmode_ConvertFromKMode(ScrnInfoPtr scrn, drmModeModeInfo * kmode, DisplayModePtr mode) { memset(mode, 0, sizeof(DisplayModeRec)); mode->status = MODE_OK; mode->Clock = kmode->clock; mode->HDisplay = kmode->hdisplay; mode->HSyncStart = kmode->hsync_start; mode->HSyncEnd = kmode->hsync_end; mode->HTotal = kmode->htotal; mode->HSkew = kmode->hskew; mode->VDisplay = kmode->vdisplay; mode->VSyncStart = kmode->vsync_start; mode->VSyncEnd = kmode->vsync_end; mode->VTotal = kmode->vtotal; mode->VScan = kmode->vscan; mode->Flags = kmode->flags; //& FLAG_BITS; mode->name = strdup(kmode->name); if (kmode->type & DRM_MODE_TYPE_DRIVER) mode->type = M_T_DRIVER; if (kmode->type & DRM_MODE_TYPE_PREFERRED) mode->type |= M_T_PREFERRED; xf86SetModeCrtc(mode, scrn->adjustFlags); } static void drmmode_ConvertToKMode(ScrnInfoPtr scrn, drmModeModeInfo * kmode, DisplayModePtr mode) { memset(kmode, 0, sizeof(*kmode)); kmode->clock = mode->Clock; kmode->hdisplay = mode->HDisplay; kmode->hsync_start = mode->HSyncStart; kmode->hsync_end = mode->HSyncEnd; kmode->htotal = mode->HTotal; kmode->hskew = mode->HSkew; kmode->vdisplay = mode->VDisplay; kmode->vsync_start = mode->VSyncStart; kmode->vsync_end = mode->VSyncEnd; kmode->vtotal = mode->VTotal; kmode->vscan = mode->VScan; kmode->flags = mode->Flags; //& FLAG_BITS; if (mode->name) strncpy(kmode->name, mode->name, DRM_DISPLAY_MODE_LEN); kmode->name[DRM_DISPLAY_MODE_LEN - 1] = 0; } static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_crtc->dpms_mode = mode; } #if 0 static PixmapPtr create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int crtc_id) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); drmmode_crtc_private_ptr drmmode_crtc; ScreenPtr pScreen = pScrn->pScreen; PixmapPtr pixmap; struct radeon_bo *bo; drmModeFBPtr fbcon; struct drm_gem_flink flink; drmmode_crtc = xf86_config->crtc[crtc_id]->driver_private; fbcon = drmModeGetFB(drmmode->fd, drmmode_crtc->mode_crtc->buffer_id); if (fbcon == NULL) return NULL; flink.handle = fbcon->handle; if (ioctl(drmmode->fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't flink fbcon handle\n"); return NULL; } bo = radeon_bo_open(drmmode->bufmgr, flink.name, 0, 0, 0, 0); if (bo == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't allocate bo for fbcon handle\n"); return NULL; } pixmap = drmmode_create_bo_pixmap(pScreen, fbcon->width, fbcon->height, fbcon->depth, fbcon->bpp, fbcon->pitch, bo); if (!pixmap) return NULL; radeon_bo_unref(bo); drmModeFreeFB(fbcon); return pixmap; } #endif static Bool drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; int saved_x, saved_y; Rotation saved_rotation; DisplayModeRec saved_mode; uint32_t *output_ids; int output_count = 0; Bool ret = TRUE; int i; uint32_t fb_id; drmModeModeInfo kmode; int height; height = pScrn->virtualY; if (drmmode->fb_id == 0) { ret = drmModeAddFB(drmmode->fd, pScrn->virtualX, height, pScrn->depth, pScrn->bitsPerPixel, drmmode_bo_get_pitch(&drmmode->front_bo), drmmode_bo_get_handle(&drmmode->front_bo), &drmmode->fb_id); if (ret < 0) { ErrorF("failed to add fb %d\n", ret); return FALSE; } } saved_mode = crtc->mode; saved_x = crtc->x; saved_y = crtc->y; saved_rotation = crtc->rotation; if (mode) { crtc->mode = *mode; crtc->x = x; crtc->y = y; crtc->rotation = rotation; crtc->transformPresent = FALSE; } output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); if (!output_ids) { ret = FALSE; goto done; } if (mode) { for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; drmmode_output_private_ptr drmmode_output; if (output->crtc != crtc) continue; drmmode_output = output->driver_private; output_ids[output_count] = drmmode_output->mode_output->connector_id; output_count++; } if (!xf86CrtcRotate(crtc)) { goto done; } crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size); drmmode_ConvertToKMode(crtc->scrn, &kmode, mode); fb_id = drmmode->fb_id; if (crtc->randr_crtc->scanout_pixmap) { msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); fb_id = ppriv->fb_id; x = y = 0; } else if (drmmode_crtc->rotate_fb_id) { fb_id = drmmode_crtc->rotate_fb_id; x = y = 0; } ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, fb_id, x, y, output_ids, output_count, &kmode); if (ret) xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "failed to set mode: %s", strerror(-ret)); else ret = TRUE; if (crtc->scrn->pScreen) xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen); crtc->funcs->dpms(crtc, DPMSModeOn); /* go through all the outputs and force DPMS them back on? */ for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->crtc != crtc) continue; output->funcs->dpms(output, DPMSModeOn); } } #if 0 if (pScrn->pScreen && !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) xf86_reload_cursors(pScrn->pScreen); #endif done: if (!ret) { crtc->x = saved_x; crtc->y = saved_y; crtc->rotation = saved_rotation; crtc->mode = saved_mode; } #if defined(XF86_CRTC_VERSION) && XF86_CRTC_VERSION >= 3 else crtc->active = TRUE; #endif return ret; } static void drmmode_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) { } static void drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int y) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y); } static void drmmode_set_cursor(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle = drmmode_crtc->cursor_bo->handle; modesettingPtr ms = modesettingPTR(crtc->scrn); static Bool use_set_cursor2 = TRUE; int ret; if (use_set_cursor2) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); CursorPtr cursor = xf86_config->cursor; ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height, cursor->bits->xhot, cursor->bits->yhot); if (ret == -EINVAL) use_set_cursor2 = FALSE; else return; } ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height); if (ret) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; cursor_info->MaxWidth = cursor_info->MaxHeight = 0; drmmode_crtc->drmmode->sw_cursor = TRUE; /* fallback to swcursor */ } } static void drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) { modesettingPtr ms = modesettingPTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; int i; uint32_t *ptr; /* cursor should be mapped already */ ptr = (uint32_t *) (drmmode_crtc->cursor_bo->ptr); for (i = 0; i < ms->cursor_width * ms->cursor_height; i++) ptr[i] = image[i]; // cpu_to_le32(image[i]); if (drmmode_crtc->cursor_up) drmmode_set_cursor(crtc); } static void drmmode_hide_cursor(xf86CrtcPtr crtc) { modesettingPtr ms = modesettingPTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmmode_crtc->cursor_up = FALSE; drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, ms->cursor_width, ms->cursor_height); } static void drmmode_show_cursor(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_crtc->cursor_up = TRUE; drmmode_set_cursor(crtc); } static void drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t * red, uint16_t * green, uint16_t * blue, int size) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmModeCrtcSetGamma(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, size, red, green, blue); } static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; msPixmapPrivPtr ppriv; void *ptr; if (!ppix) { if (crtc->randr_crtc->scanout_pixmap) { ppriv = msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); drmModeRmFB(drmmode->fd, ppriv->fb_id); } if (drmmode_crtc->slave_damage) { DamageUnregister(drmmode_crtc->slave_damage); drmmode_crtc->slave_damage = NULL; } return TRUE; } ppriv = msGetPixmapPriv(drmmode, ppix); if (!drmmode_crtc->slave_damage) { drmmode_crtc->slave_damage = DamageCreate(NULL, NULL, DamageReportNone, TRUE, crtc->randr_crtc->pScreen, NULL); } ptr = drmmode_map_slave_bo(drmmode, ppriv); ppix->devPrivate.ptr = ptr; DamageRegister(&ppix->drawable, drmmode_crtc->slave_damage); if (ppriv->fb_id == 0) { drmModeAddFB(drmmode->fd, ppix->drawable.width, ppix->drawable.height, ppix->drawable.depth, ppix->drawable.bitsPerPixel, ppix->devKind, ppriv->backing_bo->handle, &ppriv->fb_id); } return TRUE; } static void * drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; int ret; if (!drmmode_create_bo(drmmode, &drmmode_crtc->rotate_bo, width, height, crtc->scrn->bitsPerPixel)) { xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "Couldn't allocate shadow memory for rotated CRTC\n"); return NULL; } ret = drmModeAddFB(drmmode->fd, width, height, crtc->scrn->depth, crtc->scrn->bitsPerPixel, drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo), drmmode_bo_get_handle(&drmmode_crtc->rotate_bo), &drmmode_crtc->rotate_fb_id); if (ret) { ErrorF("failed to add rotate fb\n"); drmmode_bo_destroy(drmmode, &drmmode_crtc->rotate_bo); return NULL; } #ifdef GLAMOR_HAS_GBM if (drmmode->gbm) return drmmode_crtc->rotate_bo.gbm; #endif return drmmode_crtc->rotate_bo.dumb; } static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int height, int depth, int bitsPerPixel, int devKind, void *pPixData) { PixmapPtr pixmap; /* width and height of 0 means don't allocate any pixmap data */ pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0); if (pixmap) { if ((*pScreen->ModifyPixmapHeader)(pixmap, width, height, depth, bitsPerPixel, devKind, pPixData)) return pixmap; (*pScreen->DestroyPixmap)(pixmap); } return NullPixmap; } static Bool drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo); static PixmapPtr drmmode_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) { ScrnInfoPtr scrn = crtc->scrn; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t rotate_pitch; PixmapPtr rotate_pixmap; void *pPixData = NULL; if (!data) { data = drmmode_shadow_allocate(crtc, width, height); if (!data) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't allocate shadow pixmap for rotated CRTC\n"); return NULL; } } if (!drmmode_bo_has_bo(&drmmode_crtc->rotate_bo)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't allocate shadow pixmap for rotated CRTC\n"); return NULL; } pPixData = drmmode_bo_map(drmmode, &drmmode_crtc->rotate_bo); rotate_pitch = drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo), rotate_pixmap = drmmode_create_pixmap_header(scrn->pScreen, width, height, scrn->depth, scrn->bitsPerPixel, rotate_pitch, pPixData); if (rotate_pixmap == NULL) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't allocate shadow pixmap for rotated CRTC\n"); return NULL; } drmmode_set_pixmap_bo(drmmode, rotate_pixmap, &drmmode_crtc->rotate_bo); return rotate_pixmap; } static void drmmode_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; if (rotate_pixmap) { drmmode_set_pixmap_bo(drmmode, rotate_pixmap, NULL); rotate_pixmap->drawable.pScreen->DestroyPixmap(rotate_pixmap); } if (data) { drmModeRmFB(drmmode->fd, drmmode_crtc->rotate_fb_id); drmmode_crtc->rotate_fb_id = 0; drmmode_bo_destroy(drmmode, &drmmode_crtc->rotate_bo); memset(&drmmode_crtc->rotate_bo, 0, sizeof drmmode_crtc->rotate_bo); } } static const xf86CrtcFuncsRec drmmode_crtc_funcs = { .dpms = drmmode_crtc_dpms, .set_mode_major = drmmode_set_mode_major, .set_cursor_colors = drmmode_set_cursor_colors, .set_cursor_position = drmmode_set_cursor_position, .show_cursor = drmmode_show_cursor, .hide_cursor = drmmode_hide_cursor, .load_cursor_argb = drmmode_load_cursor_argb, .gamma_set = drmmode_crtc_gamma_set, .destroy = NULL, /* XXX */ .set_scanout_pixmap = drmmode_set_scanout_pixmap, .shadow_allocate = drmmode_shadow_allocate, .shadow_create = drmmode_shadow_create, .shadow_destroy = drmmode_shadow_destroy, }; static uint32_t drmmode_crtc_vblank_pipe(int crtc_id) { if (crtc_id > 1) return crtc_id << DRM_VBLANK_HIGH_CRTC_SHIFT; else if (crtc_id > 0) return DRM_VBLANK_SECONDARY; else return 0; } static void drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) { xf86CrtcPtr crtc; drmmode_crtc_private_ptr drmmode_crtc; crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs); if (crtc == NULL) return; drmmode_crtc = xnfcalloc(sizeof(drmmode_crtc_private_rec), 1); drmmode_crtc->mode_crtc = drmModeGetCrtc(drmmode->fd, drmmode->mode_res->crtcs[num]); drmmode_crtc->drmmode = drmmode; drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num); crtc->driver_private = drmmode_crtc; } static xf86OutputStatus drmmode_output_detect(xf86OutputPtr output) { /* go to the hw and retrieve a new output struct */ drmmode_output_private_ptr drmmode_output = output->driver_private; drmmode_ptr drmmode = drmmode_output->drmmode; xf86OutputStatus status; drmModeFreeConnector(drmmode_output->mode_output); drmmode_output->mode_output = drmModeGetConnector(drmmode->fd, drmmode_output->output_id); if (!drmmode_output->mode_output) return XF86OutputStatusDisconnected; switch (drmmode_output->mode_output->connection) { case DRM_MODE_CONNECTED: status = XF86OutputStatusConnected; break; case DRM_MODE_DISCONNECTED: status = XF86OutputStatusDisconnected; break; default: case DRM_MODE_UNKNOWNCONNECTION: status = XF86OutputStatusUnknown; break; } return status; } static Bool drmmode_output_mode_valid(xf86OutputPtr output, DisplayModePtr pModes) { return MODE_OK; } static Bool has_panel_fitter(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; int i; /* Presume that if the output supports scaling, then we have a * panel fitter capable of adjust any mode to suit. */ for (i = 0; i < koutput->count_props; i++) { drmModePropertyPtr props; Bool found = FALSE; props = drmModeGetProperty(drmmode->fd, koutput->props[i]); if (props) { found = strcmp(props->name, "scaling mode") == 0; drmModeFreeProperty(props); } if (found) return TRUE; } return FALSE; } static DisplayModePtr drmmode_output_add_gtf_modes(xf86OutputPtr output, DisplayModePtr Modes) { xf86MonPtr mon = output->MonInfo; DisplayModePtr i, m, preferred = NULL; int max_x = 0, max_y = 0; float max_vrefresh = 0.0; if (mon && GTF_SUPPORTED(mon->features.msc)) return Modes; if (!has_panel_fitter(output)) return Modes; for (m = Modes; m; m = m->next) { if (m->type & M_T_PREFERRED) preferred = m; max_x = max(max_x, m->HDisplay); max_y = max(max_y, m->VDisplay); max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(m)); } max_vrefresh = max(max_vrefresh, 60.0); max_vrefresh *= (1 + SYNC_TOLERANCE); m = xf86GetDefaultModes(); xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0); for (i = m; i; i = i->next) { if (xf86ModeVRefresh(i) > max_vrefresh) i->status = MODE_VSYNC; if (preferred && i->HDisplay >= preferred->HDisplay && i->VDisplay >= preferred->VDisplay && xf86ModeVRefresh(i) >= xf86ModeVRefresh(preferred)) i->status = MODE_VSYNC; } xf86PruneInvalidModes(output->scrn, &m, FALSE); return xf86ModesAdd(Modes, m); } static DisplayModePtr drmmode_output_get_modes(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; int i; DisplayModePtr Modes = NULL, Mode; drmModePropertyPtr props; xf86MonPtr mon = NULL; if (!koutput) return NULL; /* look for an EDID property */ for (i = 0; i < koutput->count_props; i++) { props = drmModeGetProperty(drmmode->fd, koutput->props[i]); if (props && (props->flags & DRM_MODE_PROP_BLOB)) { if (!strcmp(props->name, "EDID")) { if (drmmode_output->edid_blob) drmModeFreePropertyBlob(drmmode_output->edid_blob); drmmode_output->edid_blob = drmModeGetPropertyBlob(drmmode->fd, koutput->prop_values[i]); } drmModeFreeProperty(props); } } if (drmmode_output->edid_blob) { mon = xf86InterpretEDID(output->scrn->scrnIndex, drmmode_output->edid_blob->data); if (mon && drmmode_output->edid_blob->length > 128) mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA; } xf86OutputSetEDID(output, mon); /* modes should already be available */ for (i = 0; i < koutput->count_modes; i++) { Mode = xnfalloc(sizeof(DisplayModeRec)); drmmode_ConvertFromKMode(output->scrn, &koutput->modes[i], Mode); Modes = xf86ModesAdd(Modes, Mode); } return drmmode_output_add_gtf_modes(output, Modes); } static void drmmode_output_destroy(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; int i; if (drmmode_output->edid_blob) drmModeFreePropertyBlob(drmmode_output->edid_blob); for (i = 0; i < drmmode_output->num_props; i++) { drmModeFreeProperty(drmmode_output->props[i].mode_prop); free(drmmode_output->props[i].atoms); } free(drmmode_output->props); for (i = 0; i < drmmode_output->mode_output->count_encoders; i++) { drmModeFreeEncoder(drmmode_output->mode_encoders[i]); } free(drmmode_output->mode_encoders); drmModeFreeConnector(drmmode_output->mode_output); free(drmmode_output); output->driver_private = NULL; } static void drmmode_output_dpms(xf86OutputPtr output, int mode) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; if (!koutput) return; drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, drmmode_output->dpms_enum_id, mode); return; } static Bool drmmode_property_ignore(drmModePropertyPtr prop) { if (!prop) return TRUE; /* ignore blob prop */ if (prop->flags & DRM_MODE_PROP_BLOB) return TRUE; /* ignore standard property */ if (!strcmp(prop->name, "EDID") || !strcmp(prop->name, "DPMS")) return TRUE; return FALSE; } static void drmmode_output_create_resources(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr mode_output = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; drmModePropertyPtr drmmode_prop; int i, j, err; drmmode_output->props = calloc(mode_output->count_props, sizeof(drmmode_prop_rec)); if (!drmmode_output->props) return; drmmode_output->num_props = 0; for (i = 0, j = 0; i < mode_output->count_props; i++) { drmmode_prop = drmModeGetProperty(drmmode->fd, mode_output->props[i]); if (drmmode_property_ignore(drmmode_prop)) { drmModeFreeProperty(drmmode_prop); continue; } drmmode_output->props[j].mode_prop = drmmode_prop; drmmode_output->props[j].value = mode_output->prop_values[i]; drmmode_output->num_props++; j++; } for (i = 0; i < drmmode_output->num_props; i++) { drmmode_prop_ptr p = &drmmode_output->props[i]; drmmode_prop = p->mode_prop; if (drmmode_prop->flags & DRM_MODE_PROP_RANGE) { INT32 prop_range[2]; INT32 value = p->value; p->num_atoms = 1; p->atoms = calloc(p->num_atoms, sizeof(Atom)); if (!p->atoms) continue; p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); prop_range[0] = drmmode_prop->values[0]; prop_range[1] = drmmode_prop->values[1]; err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], FALSE, TRUE, drmmode_prop-> flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, 2, prop_range); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRConfigureOutputProperty error, %d\n", err); } err = RRChangeOutputProperty(output->randr_output, p->atoms[0], XA_INTEGER, 32, PropModeReplace, 1, &value, FALSE, TRUE); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRChangeOutputProperty error, %d\n", err); } } else if (drmmode_prop->flags & DRM_MODE_PROP_ENUM) { p->num_atoms = drmmode_prop->count_enums + 1; p->atoms = calloc(p->num_atoms, sizeof(Atom)); if (!p->atoms) continue; p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); for (j = 1; j <= drmmode_prop->count_enums; j++) { struct drm_mode_property_enum *e = &drmmode_prop->enums[j - 1]; p->atoms[j] = MakeAtom(e->name, strlen(e->name), TRUE); } err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], FALSE, FALSE, drmmode_prop-> flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, p->num_atoms - 1, (INT32 *) &p->atoms[1]); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRConfigureOutputProperty error, %d\n", err); } for (j = 0; j < drmmode_prop->count_enums; j++) if (drmmode_prop->enums[j].value == p->value) break; /* there's always a matching value */ err = RRChangeOutputProperty(output->randr_output, p->atoms[0], XA_ATOM, 32, PropModeReplace, 1, &p->atoms[j + 1], FALSE, TRUE); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRChangeOutputProperty error, %d\n", err); } } } } static Bool drmmode_output_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmmode_ptr drmmode = drmmode_output->drmmode; int i; for (i = 0; i < drmmode_output->num_props; i++) { drmmode_prop_ptr p = &drmmode_output->props[i]; if (p->atoms[0] != property) continue; if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) { uint32_t val; if (value->type != XA_INTEGER || value->format != 32 || value->size != 1) return FALSE; val = *(uint32_t *) value->data; drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, p->mode_prop->prop_id, (uint64_t) val); return TRUE; } else if (p->mode_prop->flags & DRM_MODE_PROP_ENUM) { Atom atom; const char *name; int j; if (value->type != XA_ATOM || value->format != 32 || value->size != 1) return FALSE; memcpy(&atom, value->data, 4); name = NameForAtom(atom); /* search for matching name string, then set its value down */ for (j = 0; j < p->mode_prop->count_enums; j++) { if (!strcmp(p->mode_prop->enums[j].name, name)) { drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, p->mode_prop->prop_id, p->mode_prop->enums[j].value); return TRUE; } } } } return TRUE; } static Bool drmmode_output_get_property(xf86OutputPtr output, Atom property) { return TRUE; } static const xf86OutputFuncsRec drmmode_output_funcs = { .dpms = drmmode_output_dpms, .create_resources = drmmode_output_create_resources, .set_property = drmmode_output_set_property, .get_property = drmmode_output_get_property, .detect = drmmode_output_detect, .mode_valid = drmmode_output_mode_valid, .get_modes = drmmode_output_get_modes, .destroy = drmmode_output_destroy }; static int subpixel_conv_table[7] = { 0, SubPixelUnknown, SubPixelHorizontalRGB, SubPixelHorizontalBGR, SubPixelVerticalRGB, SubPixelVerticalBGR, SubPixelNone }; static const char *const output_names[] = { "None", "VGA", "DVI", "DVI", "DVI", "Composite", "S-video", "LVDS", "CTV", "DIN", "DisplayPort", "HDMI", "HDMI", "TV", "eDP", "Virtual", "DSI", }; static void drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) { xf86OutputPtr output; drmModeConnectorPtr koutput; drmModeEncoderPtr *kencoders = NULL; drmmode_output_private_ptr drmmode_output; drmModePropertyPtr props; char name[32]; int i; koutput = drmModeGetConnector(drmmode->fd, drmmode->mode_res->connectors[num]); if (!koutput) return; kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders); if (!kencoders) { goto out_free_encoders; } for (i = 0; i < koutput->count_encoders; i++) { kencoders[i] = drmModeGetEncoder(drmmode->fd, koutput->encoders[i]); if (!kencoders[i]) { goto out_free_encoders; } } /* need to do smart conversion here for compat with non-kms ATI driver */ if (koutput->connector_type >= MS_ARRAY_SIZE(output_names)) snprintf(name, 32, "Unknown-%d", koutput->connector_type_id - 1); else if (pScrn->is_gpu) snprintf(name, 32, "%s-%d-%d", output_names[koutput->connector_type], pScrn->scrnIndex - GPU_SCREEN_OFFSET + 1, koutput->connector_type_id - 1); else snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id - 1); output = xf86OutputCreate(pScrn, &drmmode_output_funcs, name); if (!output) { goto out_free_encoders; } drmmode_output = calloc(sizeof(drmmode_output_private_rec), 1); if (!drmmode_output) { xf86OutputDestroy(output); goto out_free_encoders; } drmmode_output->output_id = drmmode->mode_res->connectors[num]; drmmode_output->mode_output = koutput; drmmode_output->mode_encoders = kencoders; drmmode_output->drmmode = drmmode; output->mm_width = koutput->mmWidth; output->mm_height = koutput->mmHeight; output->subpixel_order = subpixel_conv_table[koutput->subpixel]; output->interlaceAllowed = TRUE; output->doubleScanAllowed = TRUE; output->driver_private = drmmode_output; output->possible_crtcs = 0x7f; for (i = 0; i < koutput->count_encoders; i++) { output->possible_crtcs &= kencoders[i]->possible_crtcs; } /* work out the possible clones later */ output->possible_clones = 0; for (i = 0; i < koutput->count_props; i++) { props = drmModeGetProperty(drmmode->fd, koutput->props[i]); if (props && (props->flags & DRM_MODE_PROP_ENUM)) { if (!strcmp(props->name, "DPMS")) { drmmode_output->dpms_enum_id = koutput->props[i]; drmModeFreeProperty(props); break; } drmModeFreeProperty(props); } } return; out_free_encoders: if (kencoders) { for (i = 0; i < koutput->count_encoders; i++) drmModeFreeEncoder(kencoders[i]); free(kencoders); } drmModeFreeConnector(koutput); } static uint32_t find_clones(ScrnInfoPtr scrn, xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private, clone_drmout; int i; xf86OutputPtr clone_output; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int index_mask = 0; if (drmmode_output->enc_clone_mask == 0) return index_mask; for (i = 0; i < xf86_config->num_output; i++) { clone_output = xf86_config->output[i]; clone_drmout = clone_output->driver_private; if (output == clone_output) continue; if (clone_drmout->enc_mask == 0) continue; if (drmmode_output->enc_clone_mask == clone_drmout->enc_mask) index_mask |= (1 << i); } return index_mask; } static void drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode) { int i, j; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; drmmode_output_private_ptr drmmode_output; drmmode_output = output->driver_private; drmmode_output->enc_clone_mask = 0xff; /* and all the possible encoder clones for this output together */ for (j = 0; j < drmmode_output->mode_output->count_encoders; j++) { int k; for (k = 0; k < drmmode->mode_res->count_encoders; k++) { if (drmmode->mode_res->encoders[k] == drmmode_output->mode_encoders[j]->encoder_id) drmmode_output->enc_mask |= (1 << k); } drmmode_output->enc_clone_mask &= drmmode_output->mode_encoders[j]->possible_clones; } } for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; output->possible_clones = find_clones(scrn, output); } } static Bool drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo) { #ifdef GLAMOR ScrnInfoPtr scrn = drmmode->scrn; if (!drmmode->glamor) return TRUE; if (bo == NULL) { glamor_egl_destroy_textured_pixmap(pixmap); return TRUE; } #ifdef GLAMOR_HAS_GBM if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed"); return FALSE; } #else if (!glamor_egl_create_textured_pixmap(pixmap, drmmode_bo_get_handle(&drmmode->front_bo), scrn->displayWidth * scrn->bitsPerPixel / 8)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "glamor_egl_create_textured_pixmap() failed\n"); return FALSE; } #endif #endif return TRUE; } Bool drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode) { ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn); PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen); if (!drmmode_set_pixmap_bo(drmmode, screen_pixmap, &drmmode->front_bo)) return FALSE; #ifdef GLAMOR if (drmmode->glamor) glamor_set_screen_pixmap(screen_pixmap, NULL); #endif return TRUE; } static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[0]->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmmode_bo old_front; Bool ret; ScreenPtr screen = xf86ScrnToScreen(scrn); uint32_t old_fb_id; int i, pitch, old_width, old_height, old_pitch; int cpp = (scrn->bitsPerPixel + 7) / 8; PixmapPtr ppix = screen->GetScreenPixmap(screen); void *new_pixels = NULL; if (scrn->virtualX == width && scrn->virtualY == height) return TRUE; xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allocate new frame buffer %dx%d stride\n", width, height); if (drmmode->triple_buffer_pixmap) { screen->DestroyPixmap(drmmode->triple_buffer_pixmap); drmmode->triple_buffer_pixmap = NULL; } old_width = scrn->virtualX; old_height = scrn->virtualY; old_pitch = drmmode_bo_get_pitch(&drmmode->front_bo); old_fb_id = drmmode->fb_id; old_front = drmmode->front_bo; if (!drmmode_create_bo(drmmode, &drmmode->front_bo, width, height, scrn->bitsPerPixel)) goto fail; pitch = drmmode_bo_get_pitch(&drmmode->front_bo); scrn->virtualX = width; scrn->virtualY = height; scrn->displayWidth = pitch / cpp; ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth, scrn->bitsPerPixel, pitch, drmmode_bo_get_handle(&drmmode->front_bo), &drmmode->fb_id); if (ret) goto fail; if (!drmmode->gbm) { new_pixels = drmmode_map_front_bo(drmmode); if (!new_pixels) goto fail; } if (drmmode->shadow_enable) { uint32_t size = scrn->displayWidth * scrn->virtualY * ((scrn->bitsPerPixel + 7) >> 3); new_pixels = calloc(1, size); if (new_pixels == NULL) goto fail; free(drmmode->shadow_fb); drmmode->shadow_fb = new_pixels; } screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch, new_pixels); if (!drmmode_glamor_handle_new_screen_pixmap(drmmode)) goto fail; for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; if (!crtc->enabled) continue; drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, crtc->x, crtc->y); } if (old_fb_id) { drmModeRmFB(drmmode->fd, old_fb_id); drmmode_bo_destroy(drmmode, &old_front); } return TRUE; fail: drmmode_bo_destroy(drmmode, &drmmode->front_bo); drmmode->front_bo = old_front; scrn->virtualX = old_width; scrn->virtualY = old_height; scrn->displayWidth = old_pitch / cpp; drmmode->fb_id = old_fb_id; return FALSE; } static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = { drmmode_xf86crtc_resize }; Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp) { int i; int ret; uint64_t value = 0; /* check for dumb capability */ ret = drmGetCap(drmmode->fd, DRM_CAP_DUMB_BUFFER, &value); if (ret > 0 || value != 1) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS doesn't support dumb interface\n"); return FALSE; } xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs); drmmode->scrn = pScrn; drmmode->cpp = cpp; drmmode->mode_res = drmModeGetResources(drmmode->fd); if (!drmmode->mode_res) return FALSE; xf86CrtcSetSizeRange(pScrn, 320, 200, drmmode->mode_res->max_width, drmmode->mode_res->max_height); for (i = 0; i < drmmode->mode_res->count_crtcs; i++) if (!xf86IsEntityShared(pScrn->entityList[0]) || pScrn->confScreen->device->screen == i) drmmode_crtc_init(pScrn, drmmode, i); for (i = 0; i < drmmode->mode_res->count_connectors; i++) drmmode_output_init(pScrn, drmmode, i); /* workout clones */ drmmode_clones_init(pScrn, drmmode); #if XF86_CRTC_VERSION >= 5 xf86ProviderSetup(pScrn, NULL, "modesetting"); #endif xf86InitialConfiguration(pScrn, TRUE); return TRUE; } void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); xf86OutputPtr output = config->output[config->compat_output]; xf86CrtcPtr crtc = output->crtc; if (crtc && crtc->enabled) { drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, x, y); } } Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; xf86OutputPtr output = NULL; int o; /* Skip disabled CRTCs */ if (!crtc->enabled) { drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0, NULL, 0, NULL); continue; } if (config->output[config->compat_output]->crtc == crtc) output = config->output[config->compat_output]; else { for (o = 0; o < config->num_output; o++) if (config->output[o]->crtc == crtc) { output = config->output[o]; break; } } /* paranoia */ if (!output) continue; /* Mark that we'll need to re-set the mode for sure */ memset(&crtc->mode, 0, sizeof(crtc->mode)); if (!crtc->desiredMode.CrtcHDisplay) { DisplayModePtr mode = xf86OutputFindClosestMode(output, pScrn->currentMode); if (!mode) return FALSE; crtc->desiredMode = *mode; crtc->desiredRotation = RR_Rotate_0; crtc->desiredX = 0; crtc->desiredY = 0; } if (!crtc->funcs-> set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, crtc->desiredX, crtc->desiredY)) return FALSE; } return TRUE; } static void drmmode_load_palette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); uint16_t lut_r[256], lut_g[256], lut_b[256]; int index, j, i; int c; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; for (i = 0; i < 256; i++) { lut_r[i] = drmmode_crtc->lut_r[i] << 6; lut_g[i] = drmmode_crtc->lut_g[i] << 6; lut_b[i] = drmmode_crtc->lut_b[i] << 6; } switch (pScrn->depth) { case 15: for (i = 0; i < numColors; i++) { index = indices[i]; for (j = 0; j < 8; j++) { lut_r[index * 8 + j] = colors[index].red << 6; lut_g[index * 8 + j] = colors[index].green << 6; lut_b[index * 8 + j] = colors[index].blue << 6; } } break; case 16: for (i = 0; i < numColors; i++) { index = indices[i]; if (i <= 31) { for (j = 0; j < 8; j++) { lut_r[index * 8 + j] = colors[index].red << 6; lut_b[index * 8 + j] = colors[index].blue << 6; } } for (j = 0; j < 4; j++) { lut_g[index * 4 + j] = colors[index].green << 6; } } break; default: for (i = 0; i < numColors; i++) { index = indices[i]; lut_r[index] = colors[index].red << 6; lut_g[index] = colors[index].green << 6; lut_b[index] = colors[index].blue << 6; } break; } /* Make the change through RandR */ if (crtc->randr_crtc) RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b); else crtc->funcs->gamma_set(crtc, lut_r, lut_g, lut_b, 256); } } Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) { xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0, "Initializing kms color map\n"); if (!miCreateDefColormap(pScreen)) return FALSE; /* all radeons support 10 bit CLUTs */ if (!xf86HandleColormaps(pScreen, 256, 10, drmmode_load_palette, NULL, CMAP_PALETTED_TRUECOLOR #if 0 /* This option messes up text mode! (eich@suse.de) */ | CMAP_LOAD_EVEN_IF_OFFSCREEN #endif | CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE; return TRUE; } #ifdef CONFIG_UDEV_KMS static void drmmode_handle_uevents(int fd, void *closure) { drmmode_ptr drmmode = closure; ScrnInfoPtr scrn = drmmode->scrn; struct udev_device *dev; dev = udev_monitor_receive_device(drmmode->uevent_monitor); if (!dev) return; RRGetInfo(xf86ScrnToScreen(scrn), TRUE); udev_device_unref(dev); } #endif void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode) { #ifdef CONFIG_UDEV_KMS struct udev *u; struct udev_monitor *mon; u = udev_new(); if (!u) return; mon = udev_monitor_new_from_netlink(u, "udev"); if (!mon) { udev_unref(u); return; } if (udev_monitor_filter_add_match_subsystem_devtype(mon, "drm", "drm_minor") < 0 || udev_monitor_enable_receiving(mon) < 0) { udev_monitor_unref(mon); udev_unref(u); return; } drmmode->uevent_handler = xf86AddGeneralHandler(udev_monitor_get_fd(mon), drmmode_handle_uevents, drmmode); drmmode->uevent_monitor = mon; #endif } void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode) { #ifdef CONFIG_UDEV_KMS if (drmmode->uevent_handler) { struct udev *u = udev_monitor_get_udev(drmmode->uevent_monitor); xf86RemoveGeneralHandler(drmmode->uevent_handler); udev_monitor_unref(drmmode->uevent_monitor); udev_unref(u); } #endif } /* create front and cursor BOs */ Bool drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { modesettingPtr ms = modesettingPTR(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int width; int height; int bpp = pScrn->bitsPerPixel; int i; int cpp = (bpp + 7) / 8; width = pScrn->virtualX; height = pScrn->virtualY; if (!drmmode_create_bo(drmmode, &drmmode->front_bo, width, height, bpp)) return FALSE; pScrn->displayWidth = drmmode_bo_get_pitch(&drmmode->front_bo) / cpp; width = ms->cursor_width; height = ms->cursor_height; bpp = 32; for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_crtc->cursor_bo = dumb_bo_create(drmmode->fd, width, height, bpp); } return TRUE; } void * drmmode_map_front_bo(drmmode_ptr drmmode) { return drmmode_bo_map(drmmode, &drmmode->front_bo); } void * drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv) { int ret; if (ppriv->backing_bo->ptr) return ppriv->backing_bo->ptr; ret = dumb_bo_map(drmmode->fd, ppriv->backing_bo); if (ret) return NULL; return ppriv->backing_bo->ptr; } Bool drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int i, ret; for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; ret = dumb_bo_map(drmmode->fd, drmmode_crtc->cursor_bo); if (ret) return FALSE; } return TRUE; } void drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int i; if (drmmode->fb_id) { drmModeRmFB(drmmode->fd, drmmode->fb_id); drmmode->fb_id = 0; } drmmode_bo_destroy(drmmode, &drmmode->front_bo); for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; dumb_bo_destroy(drmmode->fd, drmmode_crtc->cursor_bo); } } /* ugly workaround to see if we can create 32bpp */ void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int *depth, int *bpp) { drmModeResPtr mode_res; uint64_t value; struct dumb_bo *bo; uint32_t fb_id; int ret; /* 16 is fine */ ret = drmGetCap(drmmode->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &value); if (!ret && (value == 16 || value == 8)) { *depth = value; *bpp = value; return; } *depth = 24; mode_res = drmModeGetResources(drmmode->fd); if (!mode_res) return; if (mode_res->min_width == 0) mode_res->min_width = 1; if (mode_res->min_height == 0) mode_res->min_height = 1; /*create a bo */ bo = dumb_bo_create(drmmode->fd, mode_res->min_width, mode_res->min_height, 32); if (!bo) { *bpp = 24; goto out; } ret = drmModeAddFB(drmmode->fd, mode_res->min_width, mode_res->min_height, 24, 32, bo->pitch, bo->handle, &fb_id); if (ret) { *bpp = 24; dumb_bo_destroy(drmmode->fd, bo); goto out; } drmModeRmFB(drmmode->fd, fb_id); *bpp = 32; dumb_bo_destroy(drmmode->fd, bo); out: drmModeFreeResources(mode_res); return; } xorg-server-1.17.1/hw/xfree86/drivers/modesetting/driver.h0000664000175100017510000000757712462701171020403 00000000000000/* * Copyright 2008 Tungsten Graphics, 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 TUNGSTEN GRAPHICS 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. * * * Author: Alan Hourihane * */ #include #include #include #include #include #ifdef GLAMOR #define GLAMOR_FOR_XORG 1 #include "glamor.h" #ifdef GLAMOR_HAS_GBM #include #endif #endif #include "drmmode_display.h" #define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg); typedef struct { int lastInstance; int refCount; ScrnInfoPtr pScrn_1; ScrnInfoPtr pScrn_2; } EntRec, *EntPtr; typedef void (*ms_drm_handler_proc)(uint64_t frame, uint64_t usec, void *data); typedef void (*ms_drm_abort_proc)(void *data); /** * A tracked handler for an event that will hopefully be generated by * the kernel, and what to do when it is encountered. */ struct ms_drm_queue { struct xorg_list list; xf86CrtcPtr crtc; uint32_t seq; void *data; ScrnInfoPtr scrn; ms_drm_handler_proc handler; ms_drm_abort_proc abort; }; typedef struct _modesettingRec { int fd; EntPtr entityPrivate; int Chipset; EntityInfoPtr pEnt; #if XSERVER_LIBPCIACCESS struct pci_device *PciInfo; #else pciVideoPtr PciInfo; PCITAG PciTag; #endif Bool noAccel; CloseScreenProcPtr CloseScreen; /* Broken-out options. */ OptionInfoPtr Options; unsigned int SaveGeneration; CreateScreenResourcesProcPtr createScreenResources; ScreenBlockHandlerProcPtr BlockHandler; void *driver; drmmode_rec drmmode; drmEventContext event_context; DamagePtr damage; Bool dirty_enabled; uint32_t cursor_width, cursor_height; } modesettingRec, *modesettingPtr; #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc, void *data, ms_drm_handler_proc handler, ms_drm_abort_proc abort); void ms_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data); xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw); xf86CrtcPtr ms_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret); int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); uint32_t ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect); uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence); Bool ms_dri2_screen_init(ScreenPtr screen); void ms_dri2_close_screen(ScreenPtr screen); Bool ms_vblank_screen_init(ScreenPtr screen); void ms_vblank_close_screen(ScreenPtr screen); Bool ms_present_screen_init(ScreenPtr screen); xorg-server-1.17.1/hw/xfree86/drivers/modesetting/present.c0000664000175100017510000001404412462701171020546 00000000000000/* * Copyright © 2014 Intel Corporation * * 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. */ #ifdef HAVE_DIX_CONFIG_H #include "dix-config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "driver.h" #if 0 #define DebugPresent(x) ErrorF x #else #define DebugPresent(x) #endif struct ms_present_vblank_event { uint64_t event_id; }; static RRCrtcPtr ms_present_get_crtc(WindowPtr window) { xf86CrtcPtr xf86_crtc = ms_dri2_crtc_covering_drawable(&window->drawable); return xf86_crtc ? xf86_crtc->randr_crtc : NULL; } static int ms_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc) { xf86CrtcPtr xf86_crtc = crtc->devPrivate; return ms_get_crtc_ust_msc(xf86_crtc, ust, msc); } /* * Flush the DRM event queue when full; makes space for new events. */ static Bool ms_flush_drm_events(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); struct pollfd p = { .fd = ms->fd, .events = POLLIN }; int r; do { r = poll(&p, 1, 0); } while (r == -1 && (errno == EINTR || errno == EAGAIN)); if (r <= 0) return TRUE; return drmHandleEvent(ms->fd, &ms->event_context) >= 0; } /* * Called when the queued vblank event has occurred */ static void ms_present_vblank_handler(uint64_t msc, uint64_t usec, void *data) { struct ms_present_vblank_event *event = data; DebugPresent(("\t\tmh %lld msc %llu\n", (long long) event->event_id, (long long) msc)); present_event_notify(event->event_id, usec, msc); free(event); } /* * Called when the queued vblank is aborted */ static void ms_present_vblank_abort(void *data) { struct ms_present_vblank_event *event = data; DebugPresent(("\t\tma %lld\n", (long long) event->event_id)); free(event); } /* * Queue an event to report back to the Present extension when the specified * MSC has past */ static int ms_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) { xf86CrtcPtr xf86_crtc = crtc->devPrivate; ScreenPtr screen = crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; struct ms_present_vblank_event *event; drmVBlank vbl; int ret; uint32_t seq; event = calloc(sizeof(struct ms_present_vblank_event), 1); if (!event) return BadAlloc; event->event_id = event_id; seq = ms_drm_queue_alloc(xf86_crtc, event, ms_present_vblank_handler, ms_present_vblank_abort); if (!seq) { free(event); return BadAlloc; } vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; vbl.request.sequence = ms_crtc_msc_to_kernel_msc(xf86_crtc, msc); vbl.request.signal = seq; for (;;) { ret = drmWaitVBlank(ms->fd, &vbl); if (!ret) break; if (errno != EBUSY || !ms_flush_drm_events(screen)) return BadAlloc; } DebugPresent(("\t\tmq %lld seq %u msc %llu (hw msc %u)\n", (long long) event_id, seq, (long long) msc, vbl.request.sequence)); return Success; } static Bool ms_present_event_match(void *data, void *match_data) { struct ms_present_vblank_event *event = data; uint64_t *match = match_data; return *match == event->event_id; } /* * Remove a pending vblank event from the DRM queue so that it is not reported * to the extension */ static void ms_present_abort_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) { ScreenPtr screen = crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ms_drm_abort(scrn, ms_present_event_match, &event_id); } /* * Flush our batch buffer when requested by the Present extension. */ static void ms_present_flush(WindowPtr window) { #ifdef GLAMOR ScreenPtr screen = window->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); if (ms->drmmode.glamor) glamor_block_handler(screen); #endif } static present_screen_info_rec ms_present_screen_info = { .version = PRESENT_SCREEN_INFO_VERSION, .get_crtc = ms_present_get_crtc, .get_ust_msc = ms_present_get_ust_msc, .queue_vblank = ms_present_queue_vblank, .abort_vblank = ms_present_abort_vblank, .flush = ms_present_flush, .capabilities = PresentCapabilityNone, .check_flip = 0, .flip = 0, .unflip = 0, }; Bool ms_present_screen_init(ScreenPtr screen) { return present_screen_init(screen, &ms_present_screen_info); } xorg-server-1.17.1/hw/xfree86/drivers/modesetting/vblank.c0000664000175100017510000002635412462701171020352 00000000000000/* * Copyright © 2013 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. */ /** @file vblank.c * * Support for tracking the DRM's vblank events. */ #ifdef HAVE_DIX_CONFIG_H #include "dix-config.h" #endif #include #include #include #include #include "driver.h" #include "drmmode_display.h" /** * Tracking for outstanding events queued to the kernel. * * Each list entry is a struct ms_drm_queue, which has a uint32_t * value generated from drm_seq that identifies the event and a * reference back to the crtc/screen associated with the event. It's * done this way rather than in the screen because we want to be able * to drain the list of event handlers that should be called at server * regen time, even though we don't close the drm fd and have no way * to actually drain the kernel events. */ static struct xorg_list ms_drm_queue; static uint32_t ms_drm_seq; struct ms_pageflip { ScreenPtr screen; Bool crtc_for_msc_ust; }; static void ms_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) { dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1; dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; if (dest->x1 >= dest->x2) { dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; return; } dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; if (dest->y1 >= dest->y2) dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; } static void ms_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) { if (crtc->enabled) { crtc_box->x1 = crtc->x; crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); crtc_box->y1 = crtc->y; crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); } else crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; } static int ms_box_area(BoxPtr box) { return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1); } static Bool ms_crtc_on(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; return crtc->enabled && drmmode_crtc->dpms_mode == DPMSModeOn; } /* * Return the crtc covering 'box'. If two crtcs cover a portion of * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc * with greater coverage */ xf86CrtcPtr ms_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc, best_crtc; int coverage, best_coverage; int c; BoxRec crtc_box, cover_box; best_crtc = NULL; best_coverage = 0; crtc_box_ret->x1 = 0; crtc_box_ret->x2 = 0; crtc_box_ret->y1 = 0; crtc_box_ret->y2 = 0; for (c = 0; c < xf86_config->num_crtc; c++) { crtc = xf86_config->crtc[c]; /* If the CRTC is off, treat it as not covering */ if (!ms_crtc_on(crtc)) continue; ms_crtc_box(crtc, &crtc_box); ms_box_intersect(&cover_box, &crtc_box, box); coverage = ms_box_area(&cover_box); if (coverage && crtc == desired) { *crtc_box_ret = crtc_box; return crtc; } if (coverage > best_coverage) { *crtc_box_ret = crtc_box; best_crtc = crtc; best_coverage = coverage; } } return best_crtc; } xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw) { ScreenPtr pScreen = pDraw->pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); BoxRec box, crtcbox; box.x1 = pDraw->x; box.y1 = pDraw->y; box.x2 = box.x1 + pDraw->width; box.y2 = box.y1 + pDraw->height; return ms_covering_crtc(pScrn, &box, NULL, &crtcbox); } static Bool ms_get_kernel_ust_msc(xf86CrtcPtr crtc, uint32_t *msc, uint64_t *ust) { ScreenPtr screen = crtc->randr_crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmVBlank vbl; int ret; /* Get current count */ vbl.request.type = DRM_VBLANK_RELATIVE | drmmode_crtc->vblank_pipe; vbl.request.sequence = 0; vbl.request.signal = 0; ret = drmWaitVBlank(ms->fd, &vbl); if (ret) { *msc = 0; *ust = 0; return FALSE; } else { *msc = vbl.reply.sequence; *ust = (CARD64) vbl.reply.tval_sec * 1000000 + vbl.reply.tval_usec; return TRUE; } } /** * Convert a 32-bit kernel MSC sequence number to a 64-bit local sequence * number, adding in the vblank_offset and high 32 bits, and dealing * with 64-bit wrapping */ uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence) { drmmode_crtc_private_rec *drmmode_crtc = crtc->driver_private; sequence += drmmode_crtc->vblank_offset; if ((int32_t) (sequence - drmmode_crtc->msc_prev) < -0x40000000) drmmode_crtc->msc_high += 0x100000000L; drmmode_crtc->msc_prev = sequence; return drmmode_crtc->msc_high + sequence; } int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc) { uint32_t kernel_msc; if (!ms_get_kernel_ust_msc(crtc, &kernel_msc, ust)) return BadMatch; *msc = ms_kernel_msc_to_crtc_msc(crtc, kernel_msc); return Success; } #define MAX_VBLANK_OFFSET 1000 /** * Convert a 64-bit adjusted MSC value into a 32-bit kernel sequence number, * removing the high 32 bits and subtracting out the vblank_offset term. * * This also updates the vblank_offset when it notices that the value should * change. */ uint32_t ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect) { drmmode_crtc_private_rec *drmmode_crtc = crtc->driver_private; uint64_t msc; uint64_t ust; int64_t diff; if (ms_get_crtc_ust_msc(crtc, &ust, &msc) == Success) { diff = expect - msc; /* We're way off here, assume that the kernel has lost its mind * and smack the vblank back to something sensible */ if (diff < -MAX_VBLANK_OFFSET || MAX_VBLANK_OFFSET < diff) { drmmode_crtc->vblank_offset += (int32_t) diff; if (drmmode_crtc->vblank_offset > -MAX_VBLANK_OFFSET && drmmode_crtc->vblank_offset < MAX_VBLANK_OFFSET) drmmode_crtc->vblank_offset = 0; } } return (uint32_t) (expect - drmmode_crtc->vblank_offset); } /** * Check for pending DRM events and process them. */ static void ms_drm_wakeup_handler(void *data, int err, void *mask) { ScreenPtr screen = data; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); fd_set *read_mask = mask; if (data == NULL || err < 0) return; if (FD_ISSET(ms->fd, read_mask)) drmHandleEvent(ms->fd, &ms->event_context); } /* * Enqueue a potential drm response; when the associated response * appears, we've got data to pass to the handler from here */ uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc, void *data, ms_drm_handler_proc handler, ms_drm_abort_proc abort) { ScreenPtr screen = crtc->randr_crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct ms_drm_queue *q; q = calloc(1, sizeof(struct ms_drm_queue)); if (!q) return 0; if (!ms_drm_seq) ++ms_drm_seq; q->seq = ms_drm_seq++; q->scrn = scrn; q->crtc = crtc; q->data = data; q->handler = handler; q->abort = abort; xorg_list_add(&q->list, &ms_drm_queue); return q->seq; } /** * Abort one queued DRM entry, removing it * from the list, calling the abort function and * freeing the memory */ static void ms_drm_abort_one(struct ms_drm_queue *q) { xorg_list_del(&q->list); q->abort(q->data); free(q); } /** * Abort all queued entries on a specific scrn, used * when resetting the X server */ static void ms_drm_abort_scrn(ScrnInfoPtr scrn) { struct ms_drm_queue *q, *tmp; xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) { if (q->scrn == scrn) ms_drm_abort_one(q); } } /* * Externally usable abort function that uses a callback to match a single * queued entry to abort */ void ms_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data) { struct ms_drm_queue *q; xorg_list_for_each_entry(q, &ms_drm_queue, list) { if (match(q->data, match_data)) { ms_drm_abort_one(q); break; } } } /* * General DRM kernel handler. Looks for the matching sequence number in the * drm event queue and calls the handler for it. */ static void ms_drm_handler(int fd, uint32_t frame, uint32_t sec, uint32_t usec, void *user_ptr) { struct ms_drm_queue *q, *tmp; uint32_t user_data = (uint32_t) (intptr_t) user_ptr; xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) { if (q->seq == user_data) { uint64_t msc; msc = ms_kernel_msc_to_crtc_msc(q->crtc, frame); xorg_list_del(&q->list); q->handler(msc, (uint64_t) sec * 1000000 + usec, q->data); free(q); break; } } } Bool ms_vblank_screen_init(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); xorg_list_init(&ms_drm_queue); ms->event_context.version = DRM_EVENT_CONTEXT_VERSION; ms->event_context.vblank_handler = ms_drm_handler; ms->event_context.page_flip_handler = ms_drm_handler; /* We need to re-register the DRM fd for the synchronisation * feedback on every server generation, so perform the * registration within ScreenInit and not PreInit. */ AddGeneralSocket(ms->fd); RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, ms_drm_wakeup_handler, screen); return TRUE; } void ms_vblank_close_screen(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); ms_drm_abort_scrn(scrn); RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, ms_drm_wakeup_handler, screen); RemoveGeneralSocket(ms->fd); } xorg-server-1.17.1/hw/xfree86/drivers/modesetting/dumb_bo.c0000664000175100017510000000617312456571574020520 00000000000000/* * Copyright © 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Dave Airlie * */ #include "dumb_bo.h" #include #include #include #include #include #include #include struct dumb_bo * dumb_bo_create(int fd, const unsigned width, const unsigned height, const unsigned bpp) { struct drm_mode_create_dumb arg; struct dumb_bo *bo; int ret; bo = calloc(1, sizeof(*bo)); if (!bo) return NULL; memset(&arg, 0, sizeof(arg)); arg.width = width; arg.height = height; arg.bpp = bpp; ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg); if (ret) goto err_free; bo->handle = arg.handle; bo->size = arg.size; bo->pitch = arg.pitch; return bo; err_free: free(bo); return NULL; } int dumb_bo_map(int fd, struct dumb_bo *bo) { struct drm_mode_map_dumb arg; int ret; void *map; if (bo->ptr) { return 0; } memset(&arg, 0, sizeof(arg)); arg.handle = bo->handle; ret = drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); if (ret) return ret; map = mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, arg.offset); if (map == MAP_FAILED) return -errno; bo->ptr = map; return 0; } int dumb_bo_destroy(int fd, struct dumb_bo *bo) { struct drm_mode_destroy_dumb arg; int ret; if (bo->ptr) { munmap(bo->ptr, bo->size); bo->ptr = NULL; } memset(&arg, 0, sizeof(arg)); arg.handle = bo->handle; ret = drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &arg); if (ret) return -errno; free(bo); return 0; } struct dumb_bo * dumb_get_bo_from_fd(int fd, int handle, int pitch, int size) { struct dumb_bo *bo; int ret; bo = calloc(1, sizeof(*bo)); if (!bo) return NULL; ret = drmPrimeFDToHandle(fd, handle, &bo->handle); if (ret) { free(bo); return NULL; } bo->pitch = pitch; bo->size = size; return bo; } xorg-server-1.17.1/hw/xfree86/drivers/modesetting/Makefile.in0000664000175100017510000007666212466505432021013 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON 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. # this is obnoxious: # -module lets us name the module exactly how we want # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/drivers/modesetting DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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)$(modesetting_drv_ladir)" \ "$(DESTDIR)$(drivermandir)" LTLIBRARIES = $(modesetting_drv_la_LTLIBRARIES) am__DEPENDENCIES_1 = modesetting_drv_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_modesetting_drv_la_OBJECTS = dri2.lo driver.lo drmmode_display.lo \ dumb_bo.lo present.lo vblank.lo modesetting_drv_la_OBJECTS = $(am_modesetting_drv_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 = modesetting_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(modesetting_drv_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 = $(modesetting_drv_la_SOURCES) DIST_SOURCES = $(modesetting_drv_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(driverman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) $(UDEV_CFLAGS) $(CWARNFLAGS) AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(top_srcdir)/glamor \ -I$(srcdir)/../../ddc \ -I$(srcdir)/../../dri2 \ -I$(srcdir)/../../i2c \ -I$(srcdir)/../../modes \ -I$(srcdir)/../../parser \ -I$(srcdir)/../../ramdac \ $(NULL) modesetting_drv_la_LTLIBRARIES = modesetting_drv.la modesetting_drv_la_LDFLAGS = -module -avoid-version modesetting_drv_la_LIBADD = $(UDEV_LIBS) $(DRM_LIBS) modesetting_drv_ladir = @moduledir@/drivers modesetting_drv_la_SOURCES = \ dri2.c \ driver.c \ driver.h \ drmmode_display.c \ drmmode_display.h \ dumb_bo.c \ dumb_bo.h \ present.c \ vblank.c \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) driverman_PRE = modesetting.man driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) EXTRA_DIST = modesetting.man CLEANFILES = $(driverman_DATA) # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man all: all-am .SUFFIXES: .SUFFIXES: .$(DRIVER_MAN_SUFFIX) .man .c .lo .o .obj $(srcdir)/Makefile.in: $(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/drivers/modesetting/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/drivers/modesetting/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-modesetting_drv_laLTLIBRARIES: $(modesetting_drv_la_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(modesetting_drv_la_LTLIBRARIES)'; test -n "$(modesetting_drv_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)$(modesetting_drv_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(modesetting_drv_ladir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(modesetting_drv_ladir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(modesetting_drv_ladir)"; \ } uninstall-modesetting_drv_laLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(modesetting_drv_la_LTLIBRARIES)'; test -n "$(modesetting_drv_ladir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(modesetting_drv_ladir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(modesetting_drv_ladir)/$$f"; \ done clean-modesetting_drv_laLTLIBRARIES: -test -z "$(modesetting_drv_la_LTLIBRARIES)" || rm -f $(modesetting_drv_la_LTLIBRARIES) @list='$(modesetting_drv_la_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}; \ } modesetting_drv.la: $(modesetting_drv_la_OBJECTS) $(modesetting_drv_la_DEPENDENCIES) $(EXTRA_modesetting_drv_la_DEPENDENCIES) $(AM_V_CCLD)$(modesetting_drv_la_LINK) -rpath $(modesetting_drv_ladir) $(modesetting_drv_la_OBJECTS) $(modesetting_drv_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmmode_display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dumb_bo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vblank.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 -o $@ $< .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 -o $@ `$(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-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) $(DATA) installdirs: for dir in "$(DESTDIR)$(modesetting_drv_ladir)" "$(DESTDIR)$(drivermandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-modesetting_drv_laLTLIBRARIES 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-drivermanDATA \ install-modesetting_drv_laLTLIBRARIES 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-drivermanDATA \ uninstall-modesetting_drv_laLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-modesetting_drv_laLTLIBRARIES \ cscopelist-am ctags ctags-am 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-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-modesetting_drv_laLTLIBRARIES 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 tags-am uninstall uninstall-am uninstall-drivermanDATA \ uninstall-modesetting_drv_laLTLIBRARIES .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/xfree86/drivers/modesetting/dri2.c0000664000175100017510000006144512456571574017754 00000000000000/* * Copyright © 2013 Intel Corporation * Copyright © 2014 Broadcom * * 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. */ /** * @file dri2.c * * Implements generic support for DRI2 on KMS, using glamor pixmaps * for color buffer management (no support for other aux buffers), and * the DRM vblank ioctls. * * This doesn't implement pageflipping yet. */ #ifdef HAVE_DIX_CONFIG_H #include "dix-config.h" #endif #include #include "list.h" #include "xf86.h" #include "driver.h" #include "dri2.h" #ifdef GLAMOR enum ms_dri2_frame_event_type { MS_DRI2_QUEUE_SWAP, MS_DRI2_WAIT_MSC, }; typedef struct ms_dri2_frame_event { ScreenPtr screen; DrawablePtr drawable; ClientPtr client; enum ms_dri2_frame_event_type type; int frame; xf86CrtcPtr crtc; struct xorg_list drawable_resource, client_resource; /* for swaps & flips only */ DRI2SwapEventPtr event_complete; void *event_data; DRI2BufferPtr front; DRI2BufferPtr back; } ms_dri2_frame_event_rec, *ms_dri2_frame_event_ptr; typedef struct { int refcnt; PixmapPtr pixmap; } ms_dri2_buffer_private_rec, *ms_dri2_buffer_private_ptr; static DevPrivateKeyRec ms_dri2_client_key; static RESTYPE frame_event_client_type, frame_event_drawable_type; static int ms_dri2_server_generation; struct ms_dri2_resource { XID id; RESTYPE type; struct xorg_list list; }; static struct ms_dri2_resource * ms_get_resource(XID id, RESTYPE type) { struct ms_dri2_resource *resource; void *ptr; ptr = NULL; dixLookupResourceByType(&ptr, id, type, NULL, DixWriteAccess); if (ptr) return ptr; resource = malloc(sizeof(*resource)); if (resource == NULL) return NULL; if (!AddResource(id, type, resource)) { free(resource); return NULL; } resource->id = id; resource->type = type; xorg_list_init(&resource->list); return resource; } static inline PixmapPtr get_drawable_pixmap(DrawablePtr drawable) { ScreenPtr screen = drawable->pScreen; if (drawable->type == DRAWABLE_PIXMAP) return (PixmapPtr) drawable; else return screen->GetWindowPixmap((WindowPtr) drawable); } static PixmapPtr get_front_buffer(DrawablePtr drawable) { PixmapPtr pixmap; pixmap = get_drawable_pixmap(drawable); pixmap->refcnt++; return pixmap; } static DRI2Buffer2Ptr ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, unsigned int format) { ScreenPtr screen = drawable->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); DRI2Buffer2Ptr buffer; PixmapPtr pixmap; uint32_t size; uint16_t pitch; ms_dri2_buffer_private_ptr private; buffer = calloc(1, sizeof *buffer); if (buffer == NULL) return NULL; private = calloc(1, sizeof(*private)); if (private == NULL) { free(buffer); return NULL; } pixmap = NULL; if (attachment == DRI2BufferFrontLeft) pixmap = get_front_buffer(drawable); if (pixmap == NULL) { int pixmap_width = drawable->width; int pixmap_height = drawable->height; int pixmap_cpp = (format != 0) ? format : drawable->depth; /* Assume that non-color-buffers require special * device-specific handling. Mesa currently makes no requests * for non-color aux buffers. */ switch (attachment) { case DRI2BufferAccum: case DRI2BufferBackLeft: case DRI2BufferBackRight: case DRI2BufferFakeFrontLeft: case DRI2BufferFakeFrontRight: case DRI2BufferFrontLeft: case DRI2BufferFrontRight: break; case DRI2BufferStencil: case DRI2BufferDepth: case DRI2BufferDepthStencil: case DRI2BufferHiz: default: xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Request for DRI2 buffer attachment %d unsupported\n", attachment); free(private); free(buffer); return NULL; } pixmap = screen->CreatePixmap(screen, pixmap_width, pixmap_height, pixmap_cpp, 0); if (pixmap == NULL) { if (pixmap) screen->DestroyPixmap(pixmap); free(private); free(buffer); return NULL; } } buffer->attachment = attachment; buffer->cpp = pixmap->drawable.bitsPerPixel / 8; buffer->format = format; /* The buffer's flags field is unused by the client drivers in * Mesa currently. */ buffer->flags = 0; buffer->name = glamor_name_from_pixmap(pixmap, &pitch, &size); buffer->pitch = pitch; if (buffer->name == -1) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to get DRI2 name for pixmap\n"); screen->DestroyPixmap(pixmap); free(private); free(buffer); return NULL; } buffer->driverPrivate = private; private->refcnt = 1; private->pixmap = pixmap; return buffer; } static void ms_dri2_reference_buffer(DRI2Buffer2Ptr buffer) { if (buffer) { ms_dri2_buffer_private_ptr private = buffer->driverPrivate; private->refcnt++; } } static void ms_dri2_destroy_buffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) { if (!buffer) return; if (buffer->driverPrivate) { ms_dri2_buffer_private_ptr private = buffer->driverPrivate; if (--private->refcnt == 0) { ScreenPtr screen = private->pixmap->drawable.pScreen; screen->DestroyPixmap(private->pixmap); free(private); free(buffer); } } else { free(buffer); } } static void ms_dri2_copy_region(DrawablePtr drawable, RegionPtr pRegion, DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) { ms_dri2_buffer_private_ptr src_priv = sourceBuffer->driverPrivate; ms_dri2_buffer_private_ptr dst_priv = destBuffer->driverPrivate; PixmapPtr src_pixmap = src_priv->pixmap; PixmapPtr dst_pixmap = dst_priv->pixmap; ScreenPtr screen = drawable->pScreen; DrawablePtr src = (sourceBuffer->attachment == DRI2BufferFrontLeft) ? drawable : &src_pixmap->drawable; DrawablePtr dst = (destBuffer->attachment == DRI2BufferFrontLeft) ? drawable : &dst_pixmap->drawable; RegionPtr pCopyClip; GCPtr gc; gc = GetScratchGC(dst->depth, screen); if (!gc) return; pCopyClip = REGION_CREATE(screen, NULL, 0); REGION_COPY(screen, pCopyClip, pRegion); (*gc->funcs->ChangeClip) (gc, CT_REGION, pCopyClip, 0); ValidateGC(dst, gc); /* It's important that this copy gets submitted before the direct * rendering client submits rendering for the next frame, but we * don't actually need to submit right now. The client will wait * for the DRI2CopyRegion reply or the swap buffer event before * rendering, and we'll hit the flush callback chain before those * messages are sent. We submit our batch buffers from the flush * callback chain so we know that will happen before the client * tries to render again. */ gc->ops->CopyArea(src, dst, gc, 0, 0, drawable->width, drawable->height, 0, 0); FreeScratchGC(gc); } static uint64_t gettime_us(void) { struct timespec tv; if (clock_gettime(CLOCK_MONOTONIC, &tv)) return 0; return (uint64_t)tv.tv_sec * 1000000 + tv.tv_nsec / 1000; } /** * Get current frame count and frame count timestamp, based on drawable's * crtc. */ static int ms_dri2_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc) { int ret; xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); /* Drawable not displayed, make up a *monotonic* value */ if (crtc == NULL) { *ust = gettime_us(); *msc = 0; return TRUE; } ret = ms_get_crtc_ust_msc(crtc, ust, msc); if (ret) return FALSE; return TRUE; } static XID get_client_id(ClientPtr client) { XID *ptr = dixGetPrivateAddr(&client->devPrivates, &ms_dri2_client_key); if (*ptr == 0) *ptr = FakeClientID(client->index); return *ptr; } /* * Hook this frame event into the server resource * database so we can clean it up if the drawable or * client exits while the swap is pending */ static Bool ms_dri2_add_frame_event(ms_dri2_frame_event_ptr info) { struct ms_dri2_resource *resource; resource = ms_get_resource(get_client_id(info->client), frame_event_client_type); if (resource == NULL) return FALSE; xorg_list_add(&info->client_resource, &resource->list); resource = ms_get_resource(info->drawable->id, frame_event_drawable_type); if (resource == NULL) { xorg_list_del(&info->client_resource); return FALSE; } xorg_list_add(&info->drawable_resource, &resource->list); return TRUE; } static void ms_dri2_del_frame_event(ms_dri2_frame_event_rec *info) { xorg_list_del(&info->client_resource); xorg_list_del(&info->drawable_resource); if (info->front) ms_dri2_destroy_buffer(NULL, info->front); if (info->back) ms_dri2_destroy_buffer(NULL, info->back); free(info); } static void ms_dri2_blit_swap(DrawablePtr drawable, DRI2BufferPtr dst, DRI2BufferPtr src) { BoxRec box; RegionRec region; box.x1 = 0; box.y1 = 0; box.x2 = drawable->width; box.y2 = drawable->height; REGION_INIT(pScreen, ®ion, &box, 0); ms_dri2_copy_region(drawable, ®ion, dst, src); } static void ms_dri2_frame_event_handler(uint64_t msc, uint64_t usec, void *data) { ms_dri2_frame_event_ptr frame_info = data; DrawablePtr drawable = frame_info->drawable; ScreenPtr screen = frame_info->screen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); uint32_t tv_sec = usec / 1000000; uint32_t tv_usec = usec % 1000000; if (!drawable) { ms_dri2_del_frame_event(frame_info); return; } switch (frame_info->type) { case MS_DRI2_QUEUE_SWAP: ms_dri2_blit_swap(drawable, frame_info->front, frame_info->back); DRI2SwapComplete(frame_info->client, drawable, msc, tv_sec, tv_usec, DRI2_BLIT_COMPLETE, frame_info->client ? frame_info->event_complete : NULL, frame_info->event_data); break; case MS_DRI2_WAIT_MSC: if (frame_info->client) DRI2WaitMSCComplete(frame_info->client, drawable, msc, tv_sec, tv_usec); break; default: xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: unknown vblank event (type %d) received\n", __func__, frame_info->type); break; } ms_dri2_del_frame_event(frame_info); } static void ms_dri2_frame_event_abort(void *data) { ms_dri2_frame_event_ptr frame_info = data; ms_dri2_del_frame_event(frame_info); } /** * Request a DRM event when the requested conditions will be satisfied. * * We need to handle the event and ask the server to wake up the client when * we receive it. */ static int ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, CARD64 divisor, CARD64 remainder) { ScreenPtr screen = draw->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); ms_dri2_frame_event_ptr wait_info; drmVBlank vbl; int ret; xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); drmmode_crtc_private_ptr drmmode_crtc; CARD64 current_msc, current_ust, request_msc; uint32_t seq; /* Drawable not visible, return immediately */ if (!crtc) goto out_complete; drmmode_crtc = crtc->driver_private; wait_info = calloc(1, sizeof(*wait_info)); if (!wait_info) goto out_complete; wait_info->screen = screen; wait_info->drawable = draw; wait_info->client = client; wait_info->type = MS_DRI2_WAIT_MSC; if (!ms_dri2_add_frame_event(wait_info)) { free(wait_info); wait_info = NULL; goto out_complete; } /* Get current count */ ret = ms_get_crtc_ust_msc(crtc, ¤t_ust, ¤t_msc); /* * If divisor is zero, or current_msc is smaller than target_msc, * we just need to make sure target_msc passes before waking up the * client. */ if (divisor == 0 || current_msc < target_msc) { /* If target_msc already reached or passed, set it to * current_msc to ensure we return a reasonable value back * to the caller. This keeps the client from continually * sending us MSC targets from the past by forcibly updating * their count on this call. */ seq = ms_drm_queue_alloc(crtc, wait_info, ms_dri2_frame_event_handler, ms_dri2_frame_event_abort); if (!seq) goto out_free; if (current_msc >= target_msc) target_msc = current_msc; vbl.request.type = (DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe); vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, target_msc); vbl.request.signal = (unsigned long)seq; ret = drmWaitVBlank(ms->fd, &vbl); if (ret) { static int limit = 5; if (limit) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s:%d get vblank counter failed: %s\n", __FUNCTION__, __LINE__, strerror(errno)); limit--; } goto out_free; } wait_info->frame = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); DRI2BlockClient(client, draw); return TRUE; } /* * If we get here, target_msc has already passed or we don't have one, * so we queue an event that will satisfy the divisor/remainder equation. */ vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; request_msc = current_msc - (current_msc % divisor) + remainder; /* * If calculated remainder is larger than requested remainder, * it means we've passed the last point where * seq % divisor == remainder, so we need to wait for the next time * that will happen. */ if ((current_msc % divisor) >= remainder) request_msc += divisor; seq = ms_drm_queue_alloc(crtc, wait_info, ms_dri2_frame_event_handler, ms_dri2_frame_event_abort); if (!seq) goto out_free; vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc); vbl.request.signal = (unsigned long)seq; ret = drmWaitVBlank(ms->fd, &vbl); if (ret) { static int limit = 5; if (limit) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s:%d get vblank counter failed: %s\n", __FUNCTION__, __LINE__, strerror(errno)); limit--; } goto out_free; } wait_info->frame = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); DRI2BlockClient(client, draw); return TRUE; out_free: ms_dri2_del_frame_event(wait_info); out_complete: DRI2WaitMSCComplete(client, draw, target_msc, 0, 0); return TRUE; } /** * ScheduleSwap is responsible for requesting a DRM vblank event for * the appropriate frame, or executing the swap immediately if it * doesn't need to wait. * * When the swap is complete, the driver should call into the server so it * can send any swap complete events that have been requested. */ static int ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, DRI2BufferPtr back, CARD64 *target_msc, CARD64 divisor, CARD64 remainder, DRI2SwapEventPtr func, void *data) { ScreenPtr screen = draw->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); drmVBlank vbl; int ret; xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); drmmode_crtc_private_ptr drmmode_crtc; ms_dri2_frame_event_ptr frame_info = NULL; uint64_t current_msc, current_ust; uint64_t request_msc; uint32_t seq; /* Drawable not displayed... just complete the swap */ if (!crtc) goto blit_fallback; drmmode_crtc = crtc->driver_private; frame_info = calloc(1, sizeof(*frame_info)); if (!frame_info) goto blit_fallback; frame_info->screen = screen; frame_info->drawable = draw; frame_info->client = client; frame_info->event_complete = func; frame_info->event_data = data; frame_info->front = front; frame_info->back = back; frame_info->crtc = crtc; frame_info->type = MS_DRI2_QUEUE_SWAP; if (!ms_dri2_add_frame_event(frame_info)) { free(frame_info); frame_info = NULL; goto blit_fallback; } ms_dri2_reference_buffer(front); ms_dri2_reference_buffer(back); ret = ms_get_crtc_ust_msc(crtc, ¤t_ust, ¤t_msc); /* * If divisor is zero, or current_msc is smaller than target_msc * we just need to make sure target_msc passes before initiating * the swap. */ if (divisor == 0 || current_msc < *target_msc) { /* We need to use DRM_VBLANK_NEXTONMISS to avoid unreliable * timestamping later on. */ vbl.request.type = (DRM_VBLANK_ABSOLUTE | DRM_VBLANK_NEXTONMISS | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe); /* If target_msc already reached or passed, set it to * current_msc to ensure we return a reasonable value back * to the caller. This makes swap_interval logic more robust. */ if (current_msc >= *target_msc) *target_msc = current_msc; seq = ms_drm_queue_alloc(crtc, frame_info, ms_dri2_frame_event_handler, ms_dri2_frame_event_abort); if (!seq) goto blit_fallback; vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, *target_msc); vbl.request.signal = (unsigned long)seq; ret = drmWaitVBlank(ms->fd, &vbl); if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "divisor 0 get vblank counter failed: %s\n", strerror(errno)); goto blit_fallback; } *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); frame_info->frame = *target_msc; return TRUE; } /* * If we get here, target_msc has already passed or we don't have one, * and we need to queue an event that will satisfy the divisor/remainder * equation. */ vbl.request.type = (DRM_VBLANK_ABSOLUTE | DRM_VBLANK_NEXTONMISS | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe); request_msc = current_msc - (current_msc % divisor) + remainder; /* * If the calculated deadline vbl.request.sequence is smaller than * or equal to current_msc, it means we've passed the last point * when effective onset frame seq could satisfy * seq % divisor == remainder, so we need to wait for the next time * this will happen. * This comparison takes the DRM_VBLANK_NEXTONMISS delay into account. */ if (request_msc <= current_msc) request_msc += divisor; seq = ms_drm_queue_alloc(crtc, frame_info, ms_dri2_frame_event_handler, ms_dri2_frame_event_abort); if (!seq) goto blit_fallback; vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc); vbl.request.signal = (unsigned long)seq; ret = drmWaitVBlank(ms->fd, &vbl); if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "final get vblank counter failed: %s\n", strerror(errno)); goto blit_fallback; } *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); frame_info->frame = *target_msc; return TRUE; blit_fallback: ms_dri2_blit_swap(draw, front, back); DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data); if (frame_info) ms_dri2_del_frame_event(frame_info); *target_msc = 0; /* offscreen, so zero out target vblank count */ return TRUE; } static int ms_dri2_frame_event_client_gone(void *data, XID id) { struct ms_dri2_resource *resource = data; while (!xorg_list_is_empty(&resource->list)) { ms_dri2_frame_event_ptr info = xorg_list_first_entry(&resource->list, ms_dri2_frame_event_rec, client_resource); xorg_list_del(&info->client_resource); info->client = NULL; } free(resource); return Success; } static int ms_dri2_frame_event_drawable_gone(void *data, XID id) { struct ms_dri2_resource *resource = data; while (!xorg_list_is_empty(&resource->list)) { ms_dri2_frame_event_ptr info = xorg_list_first_entry(&resource->list, ms_dri2_frame_event_rec, drawable_resource); xorg_list_del(&info->drawable_resource); info->drawable = NULL; } free(resource); return Success; } static Bool ms_dri2_register_frame_event_resource_types(void) { frame_event_client_type = CreateNewResourceType(ms_dri2_frame_event_client_gone, "Frame Event Client"); if (!frame_event_client_type) return FALSE; frame_event_drawable_type = CreateNewResourceType(ms_dri2_frame_event_drawable_gone, "Frame Event Drawable"); if (!frame_event_drawable_type) return FALSE; return TRUE; } Bool ms_dri2_screen_init(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); DRI2InfoRec info; if (!glamor_supports_pixmap_import_export(screen)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "DRI2: glamor lacks support for pixmap import/export\n"); } if (!xf86LoaderCheckSymbol("DRI2Version")) return FALSE; if (!dixRegisterPrivateKey(&ms_dri2_client_key, PRIVATE_CLIENT, sizeof(XID))) return FALSE; if (serverGeneration != ms_dri2_server_generation) { ms_dri2_server_generation = serverGeneration; if (!ms_dri2_register_frame_event_resource_types()) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Cannot register DRI2 frame event resources\n"); return FALSE; } } memset(&info, '\0', sizeof(info)); info.fd = ms->fd; info.driverName = NULL; /* Compat field, unused. */ info.deviceName = drmGetDeviceNameFromFd(ms->fd); info.version = 4; info.CreateBuffer = ms_dri2_create_buffer; info.DestroyBuffer = ms_dri2_destroy_buffer; info.CopyRegion = ms_dri2_copy_region; info.ScheduleSwap = ms_dri2_schedule_swap; info.GetMSC = ms_dri2_get_msc; info.ScheduleWaitMSC = ms_dri2_schedule_wait_msc; /* These two will be filled in by dri2.c */ info.numDrivers = 0; info.driverNames = NULL; return DRI2ScreenInit(screen, &info); } void ms_dri2_close_screen(ScreenPtr screen) { DRI2CloseScreen(screen); } #endif /* GLAMOR */ xorg-server-1.17.1/hw/xfree86/drivers/modesetting/driver.c0000664000175100017510000010030212460477634020366 00000000000000/* * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2011 Dave Airlie * 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 TUNGSTEN GRAPHICS 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. * * * Original Author: Alan Hourihane * Rewrite: Dave Airlie * */ #ifdef HAVE_DIX_CONFIG_H #include "dix-config.h" #endif #include #include #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" #include "xf86Pci.h" #include "mipointer.h" #include "micmap.h" #include #include "fb.h" #include "edid.h" #include "xf86i2c.h" #include "xf86Crtc.h" #include "miscstruct.h" #include "dixstruct.h" #include "shadow.h" #include "xf86xv.h" #include #include #ifdef XSERVER_PLATFORM_BUS #include "xf86platformBus.h" #endif #if XSERVER_LIBPCIACCESS #include #endif #include "driver.h" static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y); static Bool CloseScreen(ScreenPtr pScreen); static Bool EnterVT(ScrnInfoPtr pScrn); static void Identify(int flags); static const OptionInfoRec *AvailableOptions(int chipid, int busid); static ModeStatus ValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); static void FreeScreen(ScrnInfoPtr pScrn); static void LeaveVT(ScrnInfoPtr pScrn); static Bool SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); static Bool ScreenInit(ScreenPtr pScreen, int argc, char **argv); static Bool PreInit(ScrnInfoPtr pScrn, int flags); static Bool Probe(DriverPtr drv, int flags); static Bool ms_pci_probe(DriverPtr driver, int entity_num, struct pci_device *device, intptr_t match_data); static Bool ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data); #ifdef XSERVER_LIBPCIACCESS static const struct pci_id_match ms_device_match[] = { { PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0x00030000, 0x00ff0000, 0}, {0, 0, 0}, }; #endif #ifdef XSERVER_PLATFORM_BUS static Bool ms_platform_probe(DriverPtr driver, int entity_num, int flags, struct xf86_platform_device *device, intptr_t match_data); #endif _X_EXPORT DriverRec modesetting = { 1, "modesetting", Identify, Probe, AvailableOptions, NULL, 0, ms_driver_func, ms_device_match, ms_pci_probe, #ifdef XSERVER_PLATFORM_BUS ms_platform_probe, #endif }; static SymTabRec Chipsets[] = { {0, "kms"}, {-1, NULL} }; typedef enum { OPTION_SW_CURSOR, OPTION_DEVICE_PATH, OPTION_SHADOW_FB, OPTION_ACCEL_METHOD, } modesettingOpts; static const OptionInfoRec Options[] = { {OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DEVICE_PATH, "kmsdev", OPTV_STRING, {0}, FALSE}, {OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; int modesettingEntityIndex = -1; static MODULESETUPPROTO(Setup); static XF86ModuleVersionInfo VersRec = { "modesetting", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_VIDEODRV, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData modesettingModuleData = { &VersRec, Setup, NULL }; static void * Setup(void *module, void *opts, int *errmaj, int *errmin) { static Bool setupDone = 0; /* This module should be loaded only once, but check to be sure. */ if (!setupDone) { setupDone = 1; xf86AddDriver(&modesetting, module, HaveDriverFuncs); /* * The return value must be non-NULL on success even though there * is no TearDownProc. */ return (void *) 1; } else { if (errmaj) *errmaj = LDR_ONCEONLY; return NULL; } } static void Identify(int flags) { xf86PrintChipsets("modesetting", "Driver for Modesetting Kernel Drivers", Chipsets); } static int open_hw(const char *dev) { int fd; if (dev) fd = open(dev, O_RDWR, 0); else { dev = getenv("KMSDEVICE"); if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) { dev = "/dev/dri/card0"; fd = open(dev, O_RDWR, 0); } } if (fd == -1) xf86DrvMsg(-1, X_ERROR, "open %s: %s\n", dev, strerror(errno)); return fd; } static int check_outputs(int fd) { drmModeResPtr res = drmModeGetResources(fd); int ret; if (!res) return FALSE; ret = res->count_connectors > 0; drmModeFreeResources(res); return ret; } static Bool probe_hw(const char *dev, struct xf86_platform_device *platform_dev) { int fd; #if XF86_PDEV_SERVER_FD if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) { fd = xf86_platform_device_odev_attributes(platform_dev)->fd; if (fd == -1) return FALSE; return check_outputs(fd); } #endif fd = open_hw(dev); if (fd != -1) { int ret = check_outputs(fd); close(fd); return ret; } return FALSE; } static char * ms_DRICreatePCIBusID(const struct pci_device *dev) { char *busID; if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", dev->domain, dev->bus, dev->dev, dev->func) == -1) return NULL; return busID; } static Bool probe_hw_pci(const char *dev, struct pci_device *pdev) { int ret = FALSE, fd = open_hw(dev); char *id, *devid; drmSetVersion sv; if (fd == -1) return FALSE; sv.drm_di_major = 1; sv.drm_di_minor = 4; sv.drm_dd_major = -1; sv.drm_dd_minor = -1; if (drmSetInterfaceVersion(fd, &sv)) { close(fd); return FALSE; } id = drmGetBusid(fd); devid = ms_DRICreatePCIBusID(pdev); if (id && devid && !strcmp(id, devid)) ret = check_outputs(fd); close(fd); free(id); free(devid); return ret; } static const OptionInfoRec * AvailableOptions(int chipid, int busid) { return Options; } static Bool ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data) { xorgHWFlags *flag; switch (op) { case GET_REQUIRED_HW_INTERFACES: flag = (CARD32 *) data; (*flag) = 0; return TRUE; case SUPPORTS_SERVER_FDS: return TRUE; default: return FALSE; } } static void ms_setup_scrn_hooks(ScrnInfoPtr scrn) { scrn->driverVersion = 1; scrn->driverName = "modesetting"; scrn->name = "modeset"; scrn->Probe = NULL; scrn->PreInit = PreInit; scrn->ScreenInit = ScreenInit; scrn->SwitchMode = SwitchMode; scrn->AdjustFrame = AdjustFrame; scrn->EnterVT = EnterVT; scrn->LeaveVT = LeaveVT; scrn->FreeScreen = FreeScreen; scrn->ValidMode = ValidMode; } #if XSERVER_LIBPCIACCESS static Bool ms_pci_probe(DriverPtr driver, int entity_num, struct pci_device *dev, intptr_t match_data) { ScrnInfoPtr scrn = NULL; scrn = xf86ConfigPciEntity(scrn, 0, entity_num, NULL, NULL, NULL, NULL, NULL, NULL); if (scrn) { const char *devpath; GDevPtr devSection = xf86GetDevFromEntity(scrn->entityList[0], scrn->entityInstanceList[0]); devpath = xf86FindOptionValue(devSection->options, "kmsdev"); if (probe_hw_pci(devpath, dev)) { ms_setup_scrn_hooks(scrn); xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "claimed PCI slot %d@%d:%d:%d\n", dev->bus, dev->domain, dev->dev, dev->func); xf86DrvMsg(scrn->scrnIndex, X_INFO, "using %s\n", devpath ? devpath : "default device"); } else scrn = NULL; } return scrn != NULL; } #endif #ifdef XSERVER_PLATFORM_BUS static Bool ms_platform_probe(DriverPtr driver, int entity_num, int flags, struct xf86_platform_device *dev, intptr_t match_data) { ScrnInfoPtr scrn = NULL; const char *path = xf86_platform_device_odev_attributes(dev)->path; int scr_flags = 0; if (flags & PLATFORM_PROBE_GPU_SCREEN) scr_flags = XF86_ALLOCATE_GPU_SCREEN; if (probe_hw(path, dev)) { scrn = xf86AllocateScreen(driver, scr_flags); xf86AddEntityToScreen(scrn, entity_num); ms_setup_scrn_hooks(scrn); xf86DrvMsg(scrn->scrnIndex, X_INFO, "using drv %s\n", path ? path : "default device"); } return scrn != NULL; } #endif static Bool Probe(DriverPtr drv, int flags) { int i, numDevSections; GDevPtr *devSections; Bool foundScreen = FALSE; const char *dev; ScrnInfoPtr scrn = NULL; /* For now, just bail out for PROBE_DETECT. */ if (flags & PROBE_DETECT) return FALSE; /* * Find the config file Device sections that match this * driver, and return if there are none. */ if ((numDevSections = xf86MatchDevice("modesetting", &devSections)) <= 0) { return FALSE; } for (i = 0; i < numDevSections; i++) { dev = xf86FindOptionValue(devSections[i]->options, "kmsdev"); if (probe_hw(dev, NULL)) { int entity; entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE); scrn = xf86ConfigFbEntity(scrn, 0, entity, NULL, NULL, NULL, NULL); } if (scrn) { foundScreen = TRUE; ms_setup_scrn_hooks(scrn); scrn->Probe = Probe; xf86DrvMsg(scrn->scrnIndex, X_INFO, "using %s\n", dev ? dev : "default device"); } } free(devSections); return foundScreen; } static Bool GetRec(ScrnInfoPtr pScrn) { if (pScrn->driverPrivate) return TRUE; pScrn->driverPrivate = xnfcalloc(sizeof(modesettingRec), 1); return TRUE; } static int dispatch_dirty_region(ScrnInfoPtr scrn, PixmapPtr pixmap, DamagePtr damage, int fb_id) { modesettingPtr ms = modesettingPTR(scrn); RegionPtr dirty = DamageRegion(damage); unsigned num_cliprects = REGION_NUM_RECTS(dirty); int ret = 0; if (num_cliprects) { drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip)); BoxPtr rect = REGION_RECTS(dirty); int i; if (!clip) return -ENOMEM; /* XXX no need for copy? */ for (i = 0; i < num_cliprects; i++, rect++) { clip[i].x1 = rect->x1; clip[i].y1 = rect->y1; clip[i].x2 = rect->x2; clip[i].y2 = rect->y2; } /* TODO query connector property to see if this is needed */ ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects); free(clip); DamageEmpty(damage); } return ret; } static void dispatch_dirty(ScreenPtr pScreen) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(scrn); PixmapPtr pixmap = pScreen->GetScreenPixmap(pScreen); int fb_id = ms->drmmode.fb_id; int ret; ret = dispatch_dirty_region(scrn, pixmap, ms->damage, fb_id); if (ret == -EINVAL || ret == -ENOSYS) { ms->dirty_enabled = FALSE; DamageUnregister(ms->damage); DamageDestroy(ms->damage); ms->damage = NULL; xf86DrvMsg(scrn->scrnIndex, X_INFO, "Disabling kernel dirty updates, not required.\n"); return; } } static void dispatch_dirty_crtc(ScrnInfoPtr scrn, xf86CrtcPtr crtc) { modesettingPtr ms = modesettingPTR(scrn); PixmapPtr pixmap = crtc->randr_crtc->scanout_pixmap; msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, pixmap); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; DamagePtr damage = drmmode_crtc->slave_damage; int fb_id = ppriv->fb_id; int ret; ret = dispatch_dirty_region(scrn, pixmap, damage, fb_id); if (ret) { } } static void dispatch_slave_dirty(ScreenPtr pScreen) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; if (!crtc->randr_crtc) continue; if (!crtc->randr_crtc->scanout_pixmap) continue; dispatch_dirty_crtc(scrn, crtc); } } static void msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); pScreen->BlockHandler = ms->BlockHandler; pScreen->BlockHandler(pScreen, pTimeout, pReadmask); ms->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = msBlockHandler; if (pScreen->isGPU) dispatch_slave_dirty(pScreen); else if (ms->dirty_enabled) dispatch_dirty(pScreen); } static void FreeRec(ScrnInfoPtr pScrn) { modesettingPtr ms; if (!pScrn) return; ms = modesettingPTR(pScrn); if (!ms) return; pScrn->driverPrivate = NULL; if (ms->fd > 0) { int ret; if (ms->pEnt->location.type == BUS_PCI) ret = drmClose(ms->fd); else #ifdef XF86_PDEV_SERVER_FD if (!(ms->pEnt->location.type == BUS_PLATFORM && (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))) #endif ret = close(ms->fd); (void) ret; } free(ms->Options); free(ms); } static void try_enable_glamor(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); const char *accel_method_str = xf86GetOptValString(ms->Options, OPTION_ACCEL_METHOD); Bool do_glamor = (!accel_method_str || strcmp(accel_method_str, "glamor") == 0); ms->drmmode.glamor = FALSE; #ifdef GLAMOR if (!do_glamor) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "glamor disabled\n"); return; } if (xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME)) { if (glamor_egl_init(pScrn, ms->fd)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "glamor initialized\n"); ms->drmmode.glamor = TRUE; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "glamor initialization failed\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to load glamor module.\n"); } #else if (do_glamor) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No glamor support in the X Server\n"); } #endif } #ifndef DRM_CAP_CURSOR_WIDTH #define DRM_CAP_CURSOR_WIDTH 0x8 #endif #ifndef DRM_CAP_CURSOR_HEIGHT #define DRM_CAP_CURSOR_HEIGHT 0x9 #endif static Bool PreInit(ScrnInfoPtr pScrn, int flags) { modesettingPtr ms; rgb defaultWeight = { 0, 0, 0 }; EntityInfoPtr pEnt; EntPtr msEnt = NULL; char *BusID = NULL; const char *devicename; uint64_t value = 0; int ret; int bppflags; int defaultdepth, defaultbpp; if (pScrn->numEntities != 1) return FALSE; pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if (flags & PROBE_DETECT) { return FALSE; } /* Allocate driverPrivate */ if (!GetRec(pScrn)) return FALSE; ms = modesettingPTR(pScrn); ms->SaveGeneration = -1; ms->pEnt = pEnt; pScrn->displayWidth = 640; /* default it */ /* Allocate an entity private if necessary */ if (xf86IsEntityShared(pScrn->entityList[0])) { msEnt = xf86GetEntityPrivate(pScrn->entityList[0], modesettingEntityIndex)->ptr; ms->entityPrivate = msEnt; } else ms->entityPrivate = NULL; if (xf86IsEntityShared(pScrn->entityList[0])) { if (xf86IsPrimInitDone(pScrn->entityList[0])) { /* do something */ } else { xf86SetPrimInitDone(pScrn->entityList[0]); } } pScrn->monitor = pScrn->confScreen->monitor; pScrn->progClock = TRUE; pScrn->rgbBits = 8; #if XSERVER_PLATFORM_BUS if (pEnt->location.type == BUS_PLATFORM) { #ifdef XF86_PDEV_SERVER_FD if (pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD) ms->fd = xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> fd; else #endif { char *path = xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> path; ms->fd = open_hw(path); } } else #endif if (pEnt->location.type == BUS_PCI) { ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); if (ms->PciInfo) { BusID = malloc(64); sprintf(BusID, "PCI:%d:%d:%d", #if XSERVER_LIBPCIACCESS ((ms->PciInfo->domain << 8) | ms->PciInfo->bus), ms->PciInfo->dev, ms->PciInfo->func #else ((pciConfigPtr) ms->PciInfo->thisCard)->busnum, ((pciConfigPtr) ms->PciInfo->thisCard)->devnum, ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum #endif ); } ms->fd = drmOpen(NULL, BusID); } else { devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev"); ms->fd = open_hw(devicename); } if (ms->fd < 0) return FALSE; ms->drmmode.fd = ms->fd; pScrn->capabilities = 0; #ifdef DRM_CAP_PRIME ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value); if (ret == 0) { if (value & DRM_PRIME_CAP_IMPORT) pScrn->capabilities |= RR_Capability_SinkOutput; } #endif drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); if (defaultdepth == 24 && defaultbpp == 24) bppflags = SupportConvert32to24 | Support24bppFb; else bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; if (!xf86SetDepthBpp (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags)) return FALSE; switch (pScrn->depth) { case 15: case 16: case 24: break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported by the driver\n", pScrn->depth); return FALSE; } xf86PrintDepthBpp(pScrn); /* Process the options */ xf86CollectOptions(pScrn, NULL); if (!(ms->Options = malloc(sizeof(Options)))) return FALSE; memcpy(ms->Options, Options, sizeof(Options)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options); if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) return FALSE; if (!xf86SetDefaultVisual(pScrn, -1)) return FALSE; if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, FALSE)) { ms->drmmode.sw_cursor = TRUE; } ms->cursor_width = 64; ms->cursor_height = 64; ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_WIDTH, &value); if (!ret) { ms->cursor_width = value; } ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_HEIGHT, &value); if (!ret) { ms->cursor_height = value; } try_enable_glamor(pScrn); if (ms->drmmode.glamor) { xf86LoadSubModule(pScrn, "dri2"); } else { Bool prefer_shadow = TRUE; ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); if (!ret) { prefer_shadow = !!value; } ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options, OPTION_SHADOW_FB, prefer_shadow); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ShadowFB: preferred %s, enabled %s\n", prefer_shadow ? "YES" : "NO", ms->drmmode.shadow_enable ? "YES" : "NO"); } if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n"); goto fail; } /* * If the driver can do gamma correction, it should call xf86SetGamma() here. */ { Gamma zeros = { 0.0, 0.0, 0.0 }; if (!xf86SetGamma(pScrn, zeros)) { return FALSE; } } if (pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); return FALSE; } pScrn->currentMode = pScrn->modes; /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); /* Load the required sub modules */ if (!xf86LoadSubModule(pScrn, "fb")) { return FALSE; } if (ms->drmmode.shadow_enable) { if (!xf86LoadSubModule(pScrn, "shadow")) { return FALSE; } } return TRUE; fail: return FALSE; } static void * msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) { ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(pScrn); int stride; stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8; *size = stride; return ((uint8_t *) ms->drmmode.front_bo.dumb->ptr + row * stride + offset); } static void msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { shadowUpdatePacked(pScreen, pBuf); } static Bool CreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); PixmapPtr rootPixmap; Bool ret; void *pixels = NULL; int err; pScreen->CreateScreenResources = ms->createScreenResources; ret = pScreen->CreateScreenResources(pScreen); pScreen->CreateScreenResources = CreateScreenResources; if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) return FALSE; if (!drmmode_glamor_handle_new_screen_pixmap(&ms->drmmode)) return FALSE; drmmode_uevent_init(pScrn, &ms->drmmode); if (!ms->drmmode.sw_cursor) drmmode_map_cursor_bos(pScrn, &ms->drmmode); if (!ms->drmmode.gbm) { pixels = drmmode_map_front_bo(&ms->drmmode); if (!pixels) return FALSE; } rootPixmap = pScreen->GetScreenPixmap(pScreen); if (ms->drmmode.shadow_enable) pixels = ms->drmmode.shadow_fb; if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels)) FatalError("Couldn't adjust screen pixmap\n"); if (ms->drmmode.shadow_enable) { if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, msShadowWindow, 0, 0)) return FALSE; } err = drmModeDirtyFB(ms->fd, ms->drmmode.fb_id, NULL, 0); if (err != -EINVAL && err != -ENOSYS) { ms->damage = DamageCreate(NULL, NULL, DamageReportNone, TRUE, pScreen, rootPixmap); if (ms->damage) { DamageRegister(&rootPixmap->drawable, ms->damage); ms->dirty_enabled = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Damage tracking initialized\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to create screen damage record\n"); return FALSE; } } return ret; } static Bool msShadowInit(ScreenPtr pScreen) { if (!shadowSetup(pScreen)) { return FALSE; } return TRUE; } static Bool msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) { ScreenPtr screen = ppix->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); Bool ret; int size = ppix->devKind * ppix->drawable.height; int ihandle = (int) (long) fd_handle; ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size); if (ret == FALSE) return ret; return TRUE; } static Bool SetMaster(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); int ret; #ifdef XF86_PDEV_SERVER_FD if (ms->pEnt->location.type == BUS_PLATFORM && (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) return TRUE; #endif ret = drmSetMaster(ms->fd); if (ret) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "drmSetMaster failed: %s\n", strerror(errno)); return ret == 0; } static Bool ScreenInit(ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); VisualPtr visual; pScrn->pScreen = pScreen; if (!SetMaster(pScrn)) return FALSE; #ifdef GLAMOR_HAS_GBM if (ms->drmmode.glamor) ms->drmmode.gbm = glamor_egl_get_gbm_device(pScreen); #endif /* HW dependent - FIXME */ pScrn->displayWidth = pScrn->virtualX; if (!drmmode_create_initial_bos(pScrn, &ms->drmmode)) return FALSE; if (ms->drmmode.shadow_enable) { ms->drmmode.shadow_fb = calloc(1, pScrn->displayWidth * pScrn->virtualY * ((pScrn->bitsPerPixel + 7) >> 3)); if (!ms->drmmode.shadow_fb) ms->drmmode.shadow_enable = FALSE; } miClearVisualTypes(); if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; if (!miSetPixmapDepths()) return FALSE; if (!dixRegisterScreenSpecificPrivateKey (pScreen, &ms->drmmode.pixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof(msPixmapPrivRec))) { return FALSE; } pScrn->memPhysBase = 0; pScrn->fbOffset = 0; if (!fbScreenInit(pScreen, NULL, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel)) return FALSE; if (pScrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; while (--visual >= pScreen->visuals) { if ((visual->class | DynamicClass) == DirectColor) { visual->offsetRed = pScrn->offset.red; visual->offsetGreen = pScrn->offset.green; visual->offsetBlue = pScrn->offset.blue; visual->redMask = pScrn->mask.red; visual->greenMask = pScrn->mask.green; visual->blueMask = pScrn->mask.blue; } } } fbPictureInit(pScreen, NULL, 0); #ifdef GLAMOR if (ms->drmmode.glamor) { if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN | GLAMOR_USE_SCREEN | GLAMOR_USE_PICTURE_SCREEN)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize glamor at ScreenInit() time.\n"); return FALSE; } } #endif if (ms->drmmode.shadow_enable && !msShadowInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "shadow fb init failed\n"); return FALSE; } ms->createScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = CreateScreenResources; xf86SetBlackWhitePixels(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); /* Need to extend HWcursor support to handle mask interleave */ if (!ms->drmmode.sw_cursor) xf86_cursors_init(pScreen, ms->cursor_width, ms->cursor_height, HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | HARDWARE_CURSOR_UPDATE_UNHIDDEN | HARDWARE_CURSOR_ARGB); /* Must force it before EnterVT, so we are in control of VT and * later memory should be bound when allocating, e.g rotate_mem */ pScrn->vtSema = TRUE; pScreen->SaveScreen = xf86SaveScreen; ms->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = CloseScreen; ms->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = msBlockHandler; pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking; if (!xf86CrtcScreenInit(pScreen)) return FALSE; if (!miCreateDefColormap(pScreen)) return FALSE; xf86DPMSInit(pScreen, xf86DPMSSet, 0); #ifdef GLAMOR if (ms->drmmode.glamor) { XF86VideoAdaptorPtr glamor_adaptor; glamor_adaptor = glamor_xv_init(pScreen, 16); if (glamor_adaptor != NULL) xf86XVScreenInit(pScreen, &glamor_adaptor, 1); else xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize XV support.\n"); } #endif if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); if (!ms_vblank_screen_init(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize vblank support.\n"); return FALSE; } #ifdef GLAMOR if (ms->drmmode.glamor) { if (!ms_dri2_screen_init(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the DRI2 extension.\n"); } if (!ms_present_screen_init(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the Present extension.\n"); } } #endif return EnterVT(pScrn); } static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y) { modesettingPtr ms = modesettingPTR(pScrn); drmmode_adjust_frame(pScrn, &ms->drmmode, x, y); } static void FreeScreen(ScrnInfoPtr pScrn) { FreeRec(pScrn); } static void LeaveVT(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); xf86_hide_cursors(pScrn); pScrn->vtSema = FALSE; #ifdef XF86_PDEV_SERVER_FD if (ms->pEnt->location.type == BUS_PLATFORM && (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) return; #endif drmDropMaster(ms->fd); } /* * This gets called when gaining control of the VT, and from ScreenInit(). */ static Bool EnterVT(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); pScrn->vtSema = TRUE; SetMaster(pScrn); if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) return FALSE; return TRUE; } static Bool SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { return xf86SetSingleMode(pScrn, mode, RR_Rotate_0); } static Bool CloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); #ifdef GLAMOR if (ms->drmmode.glamor) { ms_dri2_close_screen(pScreen); } #endif ms_vblank_close_screen(pScreen); if (ms->damage) { DamageUnregister(ms->damage); DamageDestroy(ms->damage); ms->damage = NULL; } if (ms->drmmode.shadow_enable) { shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); free(ms->drmmode.shadow_fb); ms->drmmode.shadow_fb = NULL; } drmmode_uevent_fini(pScrn, &ms->drmmode); drmmode_free_bos(pScrn, &ms->drmmode); if (pScrn->vtSema) { LeaveVT(pScrn); } pScreen->CreateScreenResources = ms->createScreenResources; pScreen->BlockHandler = ms->BlockHandler; pScrn->vtSema = FALSE; pScreen->CloseScreen = ms->CloseScreen; return (*pScreen->CloseScreen) (pScreen); } static ModeStatus ValidMode(ScrnInfoPtr arg, DisplayModePtr mode, Bool verbose, int flags) { return MODE_OK; } xorg-server-1.17.1/hw/xfree86/drivers/modesetting/modesetting.man0000664000175100017510000000361012415476677021760 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH MODESETTING __drivermansuffix__ __vendorversion__ .SH NAME modesetting \- video driver for framebuffer device .SH SYNOPSIS .nf .B "Section \*qDevice\*q" .BI " Identifier \*q" devname \*q .B " Driver \*qmodesetting\*q" .BI " BusID \*qpci:" bus : dev : func \*q \ \ ... .B EndSection .fi .SH DESCRIPTION .B modesetting is an __xservername__ driver for KMS devices. This is a non-accelerated driver, the following framebuffer depths are supported: 8, 15, 16, 24. All visual types are supported for depth 8, and TrueColor visual is supported for the other depths. RandR 1.2 is supported. .SH SUPPORTED HARDWARE The .B modesetting driver supports all hardware where a KMS driver is available. modesetting uses the Linux DRM KMS ioctls and dumb object create/map. .SH CONFIGURATION DETAILS Please refer to __xconfigfile__(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. .PP For this driver it is not required to specify modes in the screen section of the config file. The .B modesetting driver can pick up the currently used video mode from the kernel driver and will use it if there are no video modes configured. .PP For PCI boards you might have to add a BusID line to the Device section. See above for a sample line. .PP The following driver .B Options are supported: .TP .BI "Option \*qkmsdev\*q \*q" string \*q The framebuffer device to use. Default: /dev/dri/card0. .TP .BI "Option \*qShadowFB\*q \*q" boolean \*q Enable or disable use of the shadow framebuffer layer. Default: on. .TP .BI "Option \*qAccelMethod\*q \*q" string \*q One of \*qglamor\*q or \*qnone\*q. Default: glamor .TP .SH "SEE ALSO" __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .SH AUTHORS Authors include: Dave Airlie xorg-server-1.17.1/hw/xfree86/drivers/modesetting/dumb_bo.h0000664000175100017510000000322012456571574020513 00000000000000/* * Copyright © 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Dave Airlie * */ #ifndef DUMB_BO_H #define DUMB_BO_H #include struct dumb_bo { uint32_t handle; uint32_t size; void *ptr; uint32_t pitch; }; struct dumb_bo *dumb_bo_create(int fd, const unsigned width, const unsigned height, const unsigned bpp); int dumb_bo_map(int fd, struct dumb_bo *bo); int dumb_bo_destroy(int fd, struct dumb_bo *bo); struct dumb_bo *dumb_get_bo_from_fd(int fd, int handle, int pitch, int size); #endif xorg-server-1.17.1/hw/xfree86/drivers/Makefile.in0000664000175100017510000006264212466505432016462 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @XORG_DRIVER_MODESETTING_TRUE@am__append_1 = modesetting subdir = hw/xfree86/drivers DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = modesetting 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = $(am__append_1) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(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/drivers/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/drivers/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am 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: xorg-server-1.17.1/hw/xfree86/loader/0000775000175100017510000000000012466505445014257 500000000000000xorg-server-1.17.1/hw/xfree86/loader/Makefile.am0000664000175100017510000000071612200102654016214 00000000000000noinst_LTLIBRARIES = libloader.la AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \ -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \ -I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2 #AM_LDFLAGS = -r AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = \ loader.h \ loaderProcs.h libloader_la_SOURCES = \ loader.c \ loaderProcs.h \ loadmod.c \ os.c libloader_la_LIBADD = $(DLOPEN_LIBS) xorg-server-1.17.1/hw/xfree86/loader/os.c0000664000175100017510000000455112274325511014760 00000000000000/* * Copyright (c) 1999-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "loaderProcs.h" /* * OSNAME is a standard form of the OS name that may be used by the * loader and by OS-specific modules. OSNAME here is different from what's in * dix-config.h */ #undef OSNAME #if defined(__linux__) #define OSNAME "linux" #elif defined(__FreeBSD__) #define OSNAME "freebsd" #elif defined(__DragonFly__) #define OSNAME "dragonfly" #elif defined(__NetBSD__) #define OSNAME "netbsd" #elif defined(__OpenBSD__) #define OSNAME "openbsd" #elif defined(__GNU__) #define OSNAME "hurd" #elif defined(SVR4) && defined(sun) #define OSNAME "solaris" #elif defined(SVR5) #define OSNAME "svr5" #elif defined(SVR4) #define OSNAME "svr4" #else #define OSNAME "unknown" #endif /* Return the OS name, and run-time OS version */ void LoaderGetOS(const char **name, int *major, int *minor, int *teeny) { if (name) *name = OSNAME; /* reporting runtime versions isn't supported yet */ } xorg-server-1.17.1/hw/xfree86/loader/loader.h0000664000175100017510000000626212274325511015613 00000000000000/* * Copyright 1995-1998 by Metro Link, 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 Metro Link, Inc. not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Metro Link, Inc. makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL METRO LINK, INC. 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. */ /* * Copyright (c) 1997-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _LOADER_H #define _LOADER_H #include #include #include /* Compiled-in version information */ typedef struct { int xf86Version; int ansicVersion; int videodrvVersion; int xinputVersion; int extensionVersion; int fontVersion; } ModuleVersions; extern const ModuleVersions LoaderVersionInfo; extern unsigned long LoaderOptions; /* Internal Functions */ void *LoaderOpen(const char *, int *, int *); void *LoaderSymbolFromModule(void *, const char *); #endif /* _LOADER_H */ xorg-server-1.17.1/hw/xfree86/loader/Makefile.in0000664000175100017510000006207012466505432016245 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/loader DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = libloader_la_DEPENDENCIES = $(am__DEPENDENCIES_1) 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@) 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 = $(libloader_la_SOURCES) DIST_SOURCES = $(libloader_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libloader.la AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \ -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \ -I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2 #AM_LDFLAGS = -r AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = \ loader.h \ loaderProcs.h libloader_la_SOURCES = \ loader.c \ loaderProcs.h \ loadmod.c \ os.c libloader_la_LIBADD = $(DLOPEN_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/loader/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/loader/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libloader.la: $(libloader_la_OBJECTS) $(libloader_la_DEPENDENCIES) $(EXTRA_libloader_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libloader_la_OBJECTS) $(libloader_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loader.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@ .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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/xfree86/loader/loaderProcs.h0000664000175100017510000000751212274325511016621 00000000000000/* * Copyright 1995-1998 by Metro Link, 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 Metro Link, Inc. not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Metro Link, Inc. makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL METRO LINK, INC. 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. */ /* * Copyright (c) 1997-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _LOADERPROCS_H #define _LOADERPROCS_H #include "xf86Module.h" typedef struct module_desc { struct module_desc *child; struct module_desc *sib; struct module_desc *parent; char *name; char *path; void *handle; ModuleSetupProc SetupProc; ModuleTearDownProc TearDownProc; void *TearDownData; /* returned from SetupProc */ const XF86ModuleVersionInfo *VersionInfo; } ModuleDesc, *ModuleDescPtr; /* External API for the loader */ void LoaderInit(void); ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *, int *); ModuleDescPtr LoadModule(const char *, const char *, const char **, const char **, void *, const XF86ModReqInfo *, int *, int *); ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent); void UnloadDriver(ModuleDescPtr); void LoaderSetPath(const char *path); void LoaderUnload(const char *, void *); unsigned long LoaderGetModuleVersion(ModuleDescPtr mod); void LoaderResetOptions(void); void LoaderSetOptions(unsigned long); /* Options for LoaderSetOptions */ #define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001 #endif /* _LOADERPROCS_H */ xorg-server-1.17.1/hw/xfree86/loader/loadmod.c0000664000175100017510000011005712456571574015773 00000000000000/* * Copyright 1995-1998 by Metro Link, 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 Metro Link, Inc. not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Metro Link, Inc. makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL METRO LINK, INC. 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. */ /* * Copyright (c) 1997-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "os.h" /* For stat() and related stuff */ #define NO_OSLIB_PROTOTYPES #include "xf86_OSlib.h" #define LOADERDECLARATIONS #include "loaderProcs.h" #include "misc.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86Xinput.h" #include "loader.h" #include "xf86Optrec.h" #include #include #include #include typedef struct _pattern { const char *pattern; regex_t rex; } PatternRec, *PatternPtr; /* Prototypes for static functions */ static char *FindModule(const char *, const char *, const char **, PatternPtr); static Bool CheckVersion(const char *, XF86ModuleVersionInfo *, const XF86ModReqInfo *); static char *LoaderGetCanonicalName(const char *, PatternPtr); static void RemoveChild(ModuleDescPtr); const ModuleVersions LoaderVersionInfo = { XORG_VERSION_CURRENT, ABI_ANSIC_VERSION, ABI_VIDEODRV_VERSION, ABI_XINPUT_VERSION, ABI_EXTENSION_VERSION, ABI_FONT_VERSION }; static int ModuleDuplicated[] = { }; static void FreeStringList(char **paths) { char **p; if (!paths) return; for (p = paths; *p; p++) free(*p); free(paths); } static char **defaultPathList = NULL; static Bool PathIsAbsolute(const char *path) { return *path == '/'; } /* * Convert a comma-separated path into a NULL-terminated array of path * elements, rejecting any that are not full absolute paths, and appending * a '/' when it isn't already present. */ static char ** InitPathList(const char *path) { char *fullpath = NULL; char *elem = NULL; char **list = NULL, **save = NULL; int len; int addslash; int n = 0; if (!path) return defaultPathList; fullpath = strdup(path); if (!fullpath) return NULL; elem = strtok(fullpath, ","); while (elem) { if (PathIsAbsolute(elem)) { len = strlen(elem); addslash = (elem[len - 1] != '/'); if (addslash) len++; save = list; list = realloc(list, (n + 2) * sizeof(char *)); if (!list) { if (save) { save[n] = NULL; FreeStringList(save); } free(fullpath); return NULL; } list[n] = malloc(len + 1); if (!list[n]) { FreeStringList(list); free(fullpath); return NULL; } strcpy(list[n], elem); if (addslash) { list[n][len - 1] = '/'; list[n][len] = '\0'; } n++; } elem = strtok(NULL, ","); } if (list) list[n] = NULL; free(fullpath); return list; } static void FreePathList(char **pathlist) { if (pathlist && pathlist != defaultPathList) FreeStringList(pathlist); } void LoaderSetPath(const char *path) { if (!path) return; defaultPathList = InitPathList(path); } /* Standard set of module subdirectories to search, in order of preference */ static const char *stdSubdirs[] = { "", "input/", "drivers/", "extensions/", "internal/", NULL }; /* * Standard set of module name patterns to check, in order of preference * These are regular expressions (suitable for use with POSIX regex(3)). * * This list assumes that you're an ELFish platform and therefore your * shared libraries are named something.so. If we're ever nuts enough * 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,} }; static PatternPtr InitPatterns(const char **patternlist) { char errmsg[80]; int i, e; PatternPtr patterns = NULL; PatternPtr p = NULL; static int firstTime = 1; const char **s; if (firstTime) { /* precompile stdPatterns */ firstTime = 0; for (p = stdPatterns; p->pattern; p++) if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) { regerror(e, &p->rex, errmsg, sizeof(errmsg)); FatalError("InitPatterns: regcomp error for `%s': %s\n", p->pattern, errmsg); } } if (patternlist) { for (i = 0, s = patternlist; *s; i++, s++) if (*s == DEFAULT_LIST) i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1; patterns = malloc((i + 1) * sizeof(PatternRec)); if (!patterns) { return NULL; } for (i = 0, s = patternlist; *s; i++, s++) if (*s != DEFAULT_LIST) { p = patterns + i; p->pattern = *s; if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) { regerror(e, &p->rex, errmsg, sizeof(errmsg)); ErrorF("InitPatterns: regcomp error for `%s': %s\n", p->pattern, errmsg); i--; } } else { for (p = stdPatterns; p->pattern; p++, i++) patterns[i] = *p; if (p != stdPatterns) i--; } patterns[i].pattern = NULL; } else patterns = stdPatterns; return patterns; } static void FreePatterns(PatternPtr patterns) { if (patterns && patterns != stdPatterns) free(patterns); } static const char ** InitSubdirs(const char **subdirlist) { int i; const char **tmp_subdirlist = NULL; char **subdirs = NULL; const char **s, **stmp = NULL; const char *osname; const char *slash; int oslen = 0, len; Bool indefault; if (subdirlist == NULL) { subdirlist = tmp_subdirlist = malloc(2 * sizeof(char *)); if (subdirlist == NULL) return NULL; subdirlist[0] = DEFAULT_LIST; subdirlist[1] = NULL; } LoaderGetOS(&osname, NULL, NULL, NULL); oslen = strlen(osname); { /* Count number of entries and check for invalid paths */ for (i = 0, s = subdirlist; *s; i++, s++) { if (*s == DEFAULT_LIST) { i += sizeof(stdSubdirs) / sizeof(stdSubdirs[0]) - 1 - 1; } else { /* * Path validity check. Don't allow absolute paths, or * paths containing "..". To catch absolute paths on * platforms that use driver letters, don't allow the ':' * character to appear at all. */ if (**s == '/' || **s == '\\' || strchr(*s, ':') || strstr(*s, "..")) { xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s); free(tmp_subdirlist); return NULL; } } } subdirs = malloc((i * 2 + 1) * sizeof(char *)); if (!subdirs) { free(tmp_subdirlist); return NULL; } i = 0; s = subdirlist; indefault = FALSE; while (*s) { if (*s == DEFAULT_LIST) { /* Divert to the default list */ indefault = TRUE; stmp = ++s; s = stdSubdirs; } len = strlen(*s); if (**s && (*s)[len - 1] != '/') { slash = "/"; len++; } else slash = ""; len += oslen + 2; if (!(subdirs[i] = malloc(len))) { while (--i >= 0) free(subdirs[i]); free(subdirs); free(tmp_subdirlist); return NULL; } /* tack on the OS name */ sprintf(subdirs[i], "%s%s%s/", *s, slash, osname); i++; /* path as given */ subdirs[i] = strdup(*s); i++; s++; if (indefault && !s) { /* revert back to the main list */ indefault = FALSE; s = stmp; } } subdirs[i] = NULL; } free(tmp_subdirlist); return (const char **) subdirs; } static void FreeSubdirs(const char **subdirs) { const char **s; if (subdirs) { for (s = subdirs; *s; s++) free((char *) *s); free(subdirs); } } static char * FindModuleInSubdir(const char *dirpath, const char *module) { struct dirent *direntry = NULL; DIR *dir = NULL; char *ret = NULL, tmpBuf[PATH_MAX]; struct stat stat_buf; dir = opendir(dirpath); if (!dir) return NULL; while ((direntry = readdir(dir))) { if (direntry->d_name[0] == '.') continue; snprintf(tmpBuf, PATH_MAX, "%s%s/", dirpath, direntry->d_name); /* the stat with the appended / fails for normal files, and works for sub dirs fine, looks a bit strange in strace but does seem to work */ if ((stat(tmpBuf, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode)) { if ((ret = FindModuleInSubdir(tmpBuf, module))) break; 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; break; } } closedir(dir); return ret; } static char * FindModule(const char *module, const char *dirname, const char **subdirlist, PatternPtr patterns) { char buf[PATH_MAX + 1]; char *name = NULL; const char **subdirs = NULL; const char **s; if (strlen(dirname) > PATH_MAX) return NULL; subdirs = InitSubdirs(subdirlist); if (!subdirs) return NULL; for (s = subdirs; *s; s++) { if ((strlen(dirname) + strlen(*s)) > PATH_MAX) continue; strcpy(buf, dirname); strcat(buf, *s); if ((name = FindModuleInSubdir(buf, module))) break; } FreeSubdirs(subdirs); return name; } const char ** LoaderListDirs(const char **subdirlist, const char **patternlist) { char buf[PATH_MAX + 1]; char **pathlist; char **elem; const char **subdirs; const char **s; PatternPtr patterns = NULL; PatternPtr p; DIR *d; struct dirent *dp; regmatch_t match[2]; struct stat stat_buf; int len, dirlen; char *fp; char **listing = NULL; char **save; char **ret = NULL; int n = 0; if (!(pathlist = InitPathList(NULL))) return NULL; if (!(subdirs = InitSubdirs(subdirlist))) goto bail; if (!(patterns = InitPatterns(patternlist))) goto bail; for (elem = pathlist; *elem; elem++) { for (s = subdirs; *s; s++) { if ((dirlen = strlen(*elem) + strlen(*s)) > PATH_MAX) continue; strcpy(buf, *elem); strcat(buf, *s); fp = buf + dirlen; if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) && (d = opendir(buf))) { if (buf[dirlen - 1] != '/') { buf[dirlen++] = '/'; fp++; } while ((dp = readdir(d))) { if (dirlen + strlen(dp->d_name) > PATH_MAX) continue; strcpy(fp, dp->d_name); if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode))) continue; for (p = patterns; p->pattern; p++) { if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && match[1].rm_so != -1) { len = match[1].rm_eo - match[1].rm_so; save = listing; listing = realloc(listing, (n + 2) * sizeof(char *)); if (!listing) { if (save) { save[n] = NULL; FreeStringList(save); } closedir(d); goto bail; } listing[n] = malloc(len + 1); if (!listing[n]) { FreeStringList(listing); closedir(d); goto bail; } strncpy(listing[n], dp->d_name + match[1].rm_so, len); listing[n][len] = '\0'; n++; break; } } } closedir(d); } } } if (listing) listing[n] = NULL; ret = listing; bail: FreePatterns(patterns); FreeSubdirs(subdirs); FreePathList(pathlist); return (const char **) ret; } void LoaderFreeDirList(char **list) { FreeStringList(list); } static Bool CheckVersion(const char *module, XF86ModuleVersionInfo * data, const XF86ModReqInfo * req) { int vercode[4]; long ver = data->xf86version; MessageType errtype; xf86Msg(X_INFO, "Module %s: vendor=\"%s\"\n", data->modname ? data->modname : "UNKNOWN!", data->vendor ? data->vendor : "UNKNOWN!"); vercode[0] = ver / 10000000; vercode[1] = (ver / 100000) % 100; vercode[2] = (ver / 1000) % 100; vercode[3] = ver % 1000; xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]); if (vercode[3] != 0) xf86ErrorF(".%d", vercode[3]); xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion, data->minorversion, data->patchlevel); if (data->moduleclass) xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass); ver = -1; if (data->abiclass) { int abimaj, abimin; int vermaj, vermin; if (!strcmp(data->abiclass, ABI_CLASS_ANSIC)) ver = LoaderVersionInfo.ansicVersion; else if (!strcmp(data->abiclass, ABI_CLASS_VIDEODRV)) ver = LoaderVersionInfo.videodrvVersion; else if (!strcmp(data->abiclass, ABI_CLASS_XINPUT)) ver = LoaderVersionInfo.xinputVersion; else if (!strcmp(data->abiclass, ABI_CLASS_EXTENSION)) ver = LoaderVersionInfo.extensionVersion; else if (!strcmp(data->abiclass, ABI_CLASS_FONT)) ver = LoaderVersionInfo.fontVersion; abimaj = GET_ABI_MAJOR(data->abiversion); abimin = GET_ABI_MINOR(data->abiversion); xf86ErrorFVerb(2, "\tABI class: %s, version %d.%d\n", data->abiclass, abimaj, abimin); if (ver != -1) { vermaj = GET_ABI_MAJOR(ver); vermin = GET_ABI_MINOR(ver); if (abimaj != vermaj) { if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) errtype = X_WARNING; else errtype = X_ERROR; xf86MsgVerb(errtype, 0, "module ABI major version (%d) doesn't" " match the server's version (%d)\n", abimaj, vermaj); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } else if (abimin > vermin) { if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) errtype = X_WARNING; else errtype = X_ERROR; xf86MsgVerb(errtype, 0, "module ABI minor version (%d) is " "newer than the server's version " "(%d)\n", abimin, vermin); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } } } /* Check against requirements that the caller has specified */ if (req) { if (req->majorversion != MAJOR_UNSPEC) { if (data->majorversion != req->majorversion) { xf86MsgVerb(X_WARNING, 2, "module major version (%d) " "doesn't match required major version (%d)\n", data->majorversion, req->majorversion); return FALSE; } else if (req->minorversion != MINOR_UNSPEC) { if (data->minorversion < req->minorversion) { xf86MsgVerb(X_WARNING, 2, "module minor version (%d) " "is less than the required minor version (%d)\n", data->minorversion, req->minorversion); return FALSE; } else if (data->minorversion == req->minorversion && req->patchlevel != PATCH_UNSPEC) { if (data->patchlevel < req->patchlevel) { xf86MsgVerb(X_WARNING, 2, "module patch level (%d) " "is less than the required patch level (%d)\n", data->patchlevel, req->patchlevel); return FALSE; } } } } if (req->moduleclass) { if (!data->moduleclass || strcmp(req->moduleclass, data->moduleclass)) { xf86MsgVerb(X_WARNING, 2, "Module class (%s) doesn't match " "the required class (%s)\n", data->moduleclass ? data->moduleclass : "", req->moduleclass); return FALSE; } } else if (req->abiclass != ABI_CLASS_NONE) { if (!data->abiclass || strcmp(req->abiclass, data->abiclass)) { xf86MsgVerb(X_WARNING, 2, "ABI class (%s) doesn't match the " "required ABI class (%s)\n", data->abiclass ? data->abiclass : "", req->abiclass); return FALSE; } } if ((req->abiclass != ABI_CLASS_NONE) && req->abiversion != ABI_VERS_UNSPEC) { int reqmaj, reqmin, maj, min; reqmaj = GET_ABI_MAJOR(req->abiversion); reqmin = GET_ABI_MINOR(req->abiversion); maj = GET_ABI_MAJOR(data->abiversion); min = GET_ABI_MINOR(data->abiversion); if (maj != reqmaj) { xf86MsgVerb(X_WARNING, 2, "ABI major version (%d) doesn't " "match the required ABI major version (%d)\n", maj, reqmaj); return FALSE; } /* XXX Maybe this should be the other way around? */ if (min > reqmin) { xf86MsgVerb(X_WARNING, 2, "module ABI minor version (%d) " "is newer than that available (%d)\n", min, reqmin); return FALSE; } } } return TRUE; } static ModuleDescPtr AddSibling(ModuleDescPtr head, ModuleDescPtr new) { new->sib = head; return new; } void * LoadSubModule(void *_parent, const char *module, const char **subdirlist, const char **patternlist, void *options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { ModuleDescPtr submod; ModuleDescPtr parent = (ModuleDescPtr) _parent; xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module); if (PathIsAbsolute(module)) { xf86Msg(X_ERROR, "LoadSubModule: Absolute module path not permitted: \"%s\"\n", module); if (errmaj) *errmaj = LDR_BADUSAGE; if (errmin) *errmin = 0; return NULL; } submod = LoadModule(module, NULL, subdirlist, patternlist, options, modreq, errmaj, errmin); if (submod && submod != (ModuleDescPtr) 1) { parent->child = AddSibling(parent->child, submod); submod->parent = parent; } return submod; } static ModuleDescPtr NewModuleDesc(const char *name) { ModuleDescPtr mdp = calloc(1, sizeof(ModuleDesc)); if (mdp) mdp->name = xstrdup(name); return mdp; } ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent) { ModuleDescPtr ret; if (!mod) return NULL; ret = NewModuleDesc(mod->name); if (ret == NULL) return NULL; ret->handle = mod->handle; ret->SetupProc = mod->SetupProc; ret->TearDownProc = mod->TearDownProc; ret->TearDownData = ModuleDuplicated; ret->child = DuplicateModule(mod->child, ret); ret->sib = DuplicateModule(mod->sib, parent); ret->parent = parent; ret->VersionInfo = mod->VersionInfo; ret->path = strdup(mod->path); return ret; } static const char *compiled_in_modules[] = { "ddc", "i2c", "ramdac", "dbe", "record", "extmod", "dri", "dri2", #if DRI3 "dri3", #endif #if PRESENT "present", #endif NULL }; /* * LoadModule: load a module * * module The module name. Normally this is not a filename but the * module's "canonical name. A full pathname is, however, * also accepted. * path A comma separated list of module directories. * subdirlist A NULL terminated list of subdirectories to search. When * NULL, the default "stdSubdirs" list is used. The default * list is also substituted for entries with value DEFAULT_LIST. * patternlist A NULL terminated list of regular expressions used to find * module filenames. Each regex should contain exactly one * subexpression that corresponds to the canonical module name. * When NULL, the default "stdPatterns" list is used. The * default list is also substituted for entries with value * DEFAULT_LIST. * options A NULL terminated list of Options that are passed to the * module's SetupProc function. * modreq An optional XF86ModReqInfo* containing * version/ABI/vendor-ABI requirements to check for when * loading the module. The following fields of the * XF86ModReqInfo struct are checked: * majorversion - must match the module's majorversion exactly * minorversion - the module's minorversion must be >= this * patchlevel - the module's minorversion.patchlevel must be * >= this. Patchlevel is ignored when * minorversion is not set. * abiclass - (string) must match the module's abiclass * abiversion - must be consistent with the module's * abiversion (major equal, minor no older) * moduleclass - string must match the module's moduleclass * string * "don't care" values are ~0 for numbers, and NULL for strings * errmaj Major error return. * errmin Minor error return. * */ ModuleDescPtr LoadModule(const char *module, const char *path, const char **subdirlist, const char **patternlist, void *options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { XF86ModuleData *initdata = NULL; char **pathlist = NULL; char *found = NULL; char *name = NULL; char **path_elem = NULL; char *p = NULL; ModuleDescPtr ret = NULL; PatternPtr patterns = NULL; int noncanonical = 0; char *m = NULL; const char **cim; xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module); patterns = InitPatterns(patternlist); name = LoaderGetCanonicalName(module, patterns); noncanonical = (name && strcmp(module, name) != 0); if (noncanonical) { xf86ErrorFVerb(3, " (%s)\n", name); xf86MsgVerb(X_WARNING, 1, "LoadModule: given non-canonical module name \"%s\"\n", module); m = name; } else { xf86ErrorFVerb(3, "\n"); m = (char *) module; } for (cim = compiled_in_modules; *cim; cim++) if (!strcmp(m, *cim)) { xf86MsgVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m); ret = (ModuleDescPtr) 1; goto LoadModule_exit; } if (!name) { if (errmaj) *errmaj = LDR_BADUSAGE; if (errmin) *errmin = 0; goto LoadModule_fail; } ret = NewModuleDesc(name); if (!ret) { if (errmaj) *errmaj = LDR_NOMEM; if (errmin) *errmin = 0; goto LoadModule_fail; } pathlist = InitPathList(path); if (!pathlist) { /* This could be a malloc failure too */ if (errmaj) *errmaj = LDR_BADUSAGE; if (errmin) *errmin = 1; goto LoadModule_fail; } /* * if the module name is not a full pathname, we need to * check the elements in the path */ if (PathIsAbsolute(module)) found = xstrdup(module); path_elem = pathlist; while (!found && *path_elem != NULL) { found = FindModule(m, *path_elem, subdirlist, patterns); path_elem++; /* * When the module name isn't the canonical name, search for the * former if no match was found for the latter. */ if (!*path_elem && m == name) { path_elem = pathlist; m = (char *) module; } } /* * did we find the module? */ if (!found) { xf86Msg(X_WARNING, "Warning, couldn't open module %s\n", module); if (errmaj) *errmaj = LDR_NOENT; if (errmin) *errmin = 0; goto LoadModule_fail; } ret->handle = LoaderOpen(found, errmaj, errmin); if (ret->handle == NULL) goto LoadModule_fail; ret->path = strdup(found); /* drop any explicit suffix from the module name */ p = strchr(name, '.'); if (p) *p = '\0'; /* * now check if the special data object ModuleData is * present. */ if (asprintf(&p, "%sModuleData", name) == -1) { p = NULL; if (errmaj) *errmaj = LDR_NOMEM; if (errmin) *errmin = 0; goto LoadModule_fail; } initdata = LoaderSymbolFromModule(ret->handle, p); if (initdata) { ModuleSetupProc setup; ModuleTearDownProc teardown; XF86ModuleVersionInfo *vers; vers = initdata->vers; setup = initdata->setup; teardown = initdata->teardown; if (vers) { if (!CheckVersion(module, vers, modreq)) { if (errmaj) *errmaj = LDR_MISMATCH; if (errmin) *errmin = 0; goto LoadModule_fail; } } else { xf86Msg(X_ERROR, "LoadModule: Module %s does not supply" " version information\n", module); if (errmaj) *errmaj = LDR_INVALID; if (errmin) *errmin = 0; goto LoadModule_fail; } if (setup) ret->SetupProc = setup; if (teardown) ret->TearDownProc = teardown; ret->VersionInfo = vers; } else { /* no initdata, fail the load */ xf86Msg(X_ERROR, "LoadModule: Module %s does not have a %s " "data object.\n", module, p); if (errmaj) *errmaj = LDR_INVALID; if (errmin) *errmin = 0; goto LoadModule_fail; } if (ret->SetupProc) { ret->TearDownData = ret->SetupProc(ret, options, errmaj, errmin); if (!ret->TearDownData) { goto LoadModule_fail; } } else if (options) { xf86Msg(X_WARNING, "Module Options present, but no SetupProc " "available for %s\n", module); } goto LoadModule_exit; LoadModule_fail: UnloadModule(ret); ret = NULL; LoadModule_exit: FreePathList(pathlist); FreePatterns(patterns); free(found); free(name); free(p); return ret; } void UnloadModule(void *_mod) { ModuleDescPtr mod = _mod; if (mod == (ModuleDescPtr) 1) return; if (mod == NULL || mod->name == NULL) return; if (mod->parent) LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name); else LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name); if (mod->TearDownData != ModuleDuplicated) { if ((mod->TearDownProc) && (mod->TearDownData)) mod->TearDownProc(mod->TearDownData); LoaderUnload(mod->name, mod->handle); } if (mod->child) UnloadModule(mod->child); if (mod->sib) UnloadModule(mod->sib); free(mod->path); free(mod->name); free(mod); } void UnloadSubModule(void *_mod) { ModuleDescPtr mod = (ModuleDescPtr) _mod; /* Some drivers are calling us on built-in submodules, ignore them */ if (mod == (ModuleDescPtr) 1) return; RemoveChild(mod); UnloadModule(mod); } static void RemoveChild(ModuleDescPtr child) { ModuleDescPtr mdp; ModuleDescPtr prevsib; ModuleDescPtr parent; if (!child->parent) return; parent = child->parent; if (parent->child == child) { parent->child = child->sib; return; } prevsib = parent->child; mdp = prevsib->sib; while (mdp && mdp != child) { prevsib = mdp; mdp = mdp->sib; } if (mdp == child) prevsib->sib = child->sib; child->sib = NULL; return; } void LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin) { const char *msg; MessageType type = X_ERROR; switch (errmaj) { case LDR_NOERROR: msg = "no error"; break; case LDR_NOMEM: msg = "out of memory"; break; case LDR_NOENT: msg = "module does not exist"; break; case LDR_NOSUBENT: msg = "a required submodule could not be loaded"; break; case LDR_NOSPACE: msg = "too many modules"; break; case LDR_NOMODOPEN: msg = "open failed"; break; case LDR_UNKTYPE: msg = "unknown module type"; break; case LDR_NOLOAD: msg = "loader failed"; break; case LDR_ONCEONLY: msg = "already loaded"; type = X_INFO; break; case LDR_NOPORTOPEN: msg = "port open failed"; break; case LDR_NOHARDWARE: msg = "no hardware found"; break; case LDR_MISMATCH: msg = "module requirement mismatch"; break; case LDR_BADUSAGE: msg = "invalid argument(s) to LoadModule()"; break; case LDR_INVALID: msg = "invalid module"; break; case LDR_BADOS: msg = "module doesn't support this OS"; break; case LDR_MODSPECIFIC: msg = "module-specific error"; break; default: msg = "unknown error"; } if (name) xf86Msg(type, "%s: Failed to load module \"%s\" (%s, %d)\n", name, modname, msg, errmin); else xf86Msg(type, "Failed to load module \"%s\" (%s, %d)\n", modname, msg, errmin); } /* Given a module path or file name, return the module's canonical name */ static char * LoaderGetCanonicalName(const char *modname, PatternPtr patterns) { char *str; const char *s; int len; PatternPtr p; regmatch_t match[2]; /* Strip off any leading path */ s = strrchr(modname, '/'); if (s == NULL) s = modname; else s++; /* Find the first regex that is matched */ for (p = patterns; p->pattern; p++) if (regexec(&p->rex, s, 2, match, 0) == 0 && match[1].rm_so != -1) { len = match[1].rm_eo - match[1].rm_so; str = malloc(len + 1); if (!str) return NULL; strncpy(str, s + match[1].rm_so, len); str[len] = '\0'; return str; } /* If there is no match, return the whole name minus the leading path */ return strdup(s); } /* * Return the module version information. */ unsigned long LoaderGetModuleVersion(ModuleDescPtr mod) { if (!mod || mod == (ModuleDescPtr) 1 || !mod->VersionInfo) return 0; return MODULE_VERSION_NUMERIC(mod->VersionInfo->majorversion, mod->VersionInfo->minorversion, mod->VersionInfo->patchlevel); } xorg-server-1.17.1/hw/xfree86/loader/loader.c0000664000175100017510000001357112414702051015601 00000000000000/* * Copyright 1995-1998 by Metro Link, 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 Metro Link, Inc. not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Metro Link, Inc. makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL METRO LINK, INC. 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. */ /* * 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). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "os.h" #include "loader.h" #include "loaderProcs.h" #include "xf86.h" #include "xf86Priv.h" #ifdef HAVE_DLFCN_H #include #include #else #error i have no dynamic linker and i must scream #endif extern void *xorg_symbols[]; void LoaderInit(void) { xf86MsgVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols); xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n"); xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC, GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion), GET_ABI_MINOR(LoaderVersionInfo.ansicVersion)); xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV, GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion), GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion)); xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT, GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion), GET_ABI_MINOR(LoaderVersionInfo.xinputVersion)); xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION, GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion), GET_ABI_MINOR(LoaderVersionInfo.extensionVersion)); } /* Public Interface to the loader. */ void * LoaderOpen(const char *module, int *errmaj, int *errmin) { void *ret; #if defined(DEBUG) ErrorF("LoaderOpen(%s)\n", module); #endif xf86Msg(X_INFO, "Loading %s\n", module); if (!(ret = dlopen(module, RTLD_LAZY | RTLD_GLOBAL))) { xf86Msg(X_ERROR, "Failed to load %s: %s\n", module, dlerror()); if (errmaj) *errmaj = LDR_NOLOAD; if (errmin) *errmin = LDR_NOLOAD; return NULL; } return ret; } void * LoaderSymbol(const char *name) { static void *global_scope = NULL; void *p; p = dlsym(RTLD_DEFAULT, name); if (p != NULL) return p; if (!global_scope) global_scope = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); if (global_scope) return dlsym(global_scope, name); return NULL; } void * LoaderSymbolFromModule(void *handle, const char *name) { return dlsym(handle, name); } void LoaderUnload(const char *name, void *handle) { LogMessageVerbSigSafe(X_INFO, 1, "Unloading %s\n", name); if (handle) dlclose(handle); } unsigned long LoaderOptions = 0; void LoaderSetOptions(unsigned long opts) { LoaderOptions |= opts; } Bool LoaderShouldIgnoreABI(void) { return (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) != 0; } int LoaderGetABIVersion(const char *abiclass) { struct { 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} }; int i; for (i = 0; classes[i].name; i++) { if (!strcmp(classes[i].name, abiclass)) { return classes[i].version; } } return 0; } xorg-server-1.17.1/hw/xfree86/common/0000775000175100017510000000000012466505444014300 500000000000000xorg-server-1.17.1/hw/xfree86/common/Makefile.am0000664000175100017510000000545412456571574016272 00000000000000noinst_LTLIBRARIES = libcommon.la if XORG_BUS_PCI PCI_SOURCES = xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \ xf86VGAarbiterPriv.h endif if XORG_BUS_SPARC SBUS_SOURCES = xf86sbusBus.c endif if XV XVSOURCES = xf86xv.c xf86xvmc.c 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) $(PLATSOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) $(AM_V_GEN)cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@ $(AM_V_GEN)echo >> $@ BUILT_SOURCES = xf86DefModeSet.c AM_LDFLAGS = -r libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Cursor.c $(DGASOURCES) 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 xf86Extensions.h \ xf86Extensions.c $(XF86VMODESOURCES) \ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la AM_CPPFLAGS = $(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)/../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) $(DGA_SDK) xorgVersion.h \ xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \ xaarop.h DISTCLEANFILES = xf86Build.h CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = \ compiler.h \ fourcc.h \ vidmodeproc.h \ xf86.h \ xf86Bus.h \ xf86Config.h \ xf86InPriv.h \ xf86Module.h \ xf86Opt.h \ xf86PciInfo.h \ xf86Priv.h \ xf86Privstr.h \ xf86Xinput.h \ xf86cmap.h \ xf86fbman.h \ xf86pciBus.h \ xf86str.h \ xf86xv.h \ xf86xvmc.h \ xf86xvpriv.h \ xisb.h \ xorgVersion.h \ $(MODEDEFSOURCES) \ modeline2c.awk \ xf86VGAarbiter.h \ xf86VGAarbiterPriv.h \ $(DISTKBDSOURCES) \ xaarop.h if LNXACPI XORG_CFLAGS += -DHAVE_ACPI endif if NEED_DBUS XORG_CFLAGS += $(DBUS_CFLAGS) endif AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) xorg-server-1.17.1/hw/xfree86/common/xf86PciInfo.h0000664000175100017510000006124212456571574016447 00000000000000 /* * Copyright (c) 1995-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file contains macros for the PCI Vendor and Device IDs for video * cards plus a few other things that are needed in drivers or elsewhere. * This information is used in several ways: * 1. It is used by drivers and/or other code. * 2. It is used by the pciid2c.pl script to determine what vendor data to * include in the pcidata module that the X server loads. * 3. A side-effect of 2. affects how config-generation works for * otherwise "unknown" cards. * * Don't add entries here for vendors that don't make video cards, * or for non-video devices unless they're needed by a driver or elsewhere. * A comprehensive set of PCI vendor, device and subsystem data is * auto-generated from the ../etc/pci.ids file using the pciids2c.pl script, * and is used in scanpci utility. Don't modify the pci.ids file. If * new/corrected entries are required, add them to ../etc/extrapci.ids. */ #ifndef _XF86_PCIINFO_H #define _XF86_PCIINFO_H #warning "xf86PciInfo.h is deprecated. For greater compatibility, drivers should include necessary PCI IDs locally rather than relying on this file from xorg-server." /* PCI Pseudo Vendor */ #define PCI_VENDOR_GENERIC 0x00FF #define PCI_VENDOR_REAL3D 0x003D #define PCI_VENDOR_COMPAQ 0x0E11 #define PCI_VENDOR_ATI 0x1002 #define PCI_VENDOR_AVANCE 0x1005 #define PCI_VENDOR_TSENG 0x100C #define PCI_VENDOR_NS 0x100B #define PCI_VENDOR_WEITEK 0x100E #define PCI_VENDOR_VIDEOLOGIC 0x1010 #define PCI_VENDOR_DIGITAL 0x1011 #define PCI_VENDOR_CIRRUS 0x1013 #define PCI_VENDOR_AMD 0x1022 #define PCI_VENDOR_TRIDENT 0x1023 #define PCI_VENDOR_ALI 0x1025 #define PCI_VENDOR_DELL 0x1028 #define PCI_VENDOR_MATROX 0x102B #define PCI_VENDOR_CHIPSTECH 0x102C #define PCI_VENDOR_MIRO 0x1031 #define PCI_VENDOR_NEC 0x1033 #define PCI_VENDOR_SIS 0x1039 #define PCI_VENDOR_HP 0x103C #define PCI_VENDOR_SGS 0x104A #define PCI_VENDOR_TI 0x104C #define PCI_VENDOR_SONY 0x104D #define PCI_VENDOR_OAK 0x104E #define PCI_VENDOR_MOTOROLA 0x1057 #define PCI_VENDOR_NUMNINE 0x105D #define PCI_VENDOR_CYRIX 0x1078 #define PCI_VENDOR_SUN 0x108E #define PCI_VENDOR_DIAMOND 0x1092 #define PCI_VENDOR_BROOKTREE 0x109E #define PCI_VENDOR_NEOMAGIC 0x10C8 #define PCI_VENDOR_NVIDIA 0x10DE #define PCI_VENDOR_IMS 0x10E0 #define PCI_VENDOR_INTEGRAPHICS 0x10EA #define PCI_VENDOR_ALLIANCE 0x1142 #define PCI_VENDOR_RENDITION 0x1163 #define PCI_VENDOR_3DFX 0x121A #define PCI_VENDOR_SMI 0x126F #define PCI_VENDOR_TRITECH 0x1292 #define PCI_VENDOR_NVIDIA_SGS 0x12D2 #define PCI_VENDOR_VMWARE 0x15AD #define PCI_VENDOR_AST 0x1A03 #define PCI_VENDOR_3DLABS 0x3D3D #define PCI_VENDOR_AVANCE_2 0x4005 #define PCI_VENDOR_HERCULES 0x4843 #define PCI_VENDOR_S3 0x5333 #define PCI_VENDOR_INTEL 0x8086 #define PCI_VENDOR_ARK 0xEDD8 /* Generic */ #define PCI_CHIP_VGA 0x0000 #define PCI_CHIP_8514 0x0001 /* Real 3D */ #define PCI_CHIP_I740_PCI 0x00D1 /* Compaq */ #define PCI_CHIP_QV1280 0x3033 /* ATI */ #define PCI_CHIP_RV380_3150 0x3150 #define PCI_CHIP_RV380_3151 0x3151 #define PCI_CHIP_RV380_3152 0x3152 #define PCI_CHIP_RV380_3153 0x3153 #define PCI_CHIP_RV380_3154 0x3154 #define PCI_CHIP_RV380_3156 0x3156 #define PCI_CHIP_RV380_3E50 0x3E50 #define PCI_CHIP_RV380_3E51 0x3E51 #define PCI_CHIP_RV380_3E52 0x3E52 #define PCI_CHIP_RV380_3E53 0x3E53 #define PCI_CHIP_RV380_3E54 0x3E54 #define PCI_CHIP_RV380_3E56 0x3E56 #define PCI_CHIP_RS100_4136 0x4136 #define PCI_CHIP_RS200_4137 0x4137 #define PCI_CHIP_R300_AD 0x4144 #define PCI_CHIP_R300_AE 0x4145 #define PCI_CHIP_R300_AF 0x4146 #define PCI_CHIP_R300_AG 0x4147 #define PCI_CHIP_R350_AH 0x4148 #define PCI_CHIP_R350_AI 0x4149 #define PCI_CHIP_R350_AJ 0x414A #define PCI_CHIP_R350_AK 0x414B #define PCI_CHIP_RV350_AP 0x4150 #define PCI_CHIP_RV350_AQ 0x4151 #define PCI_CHIP_RV360_AR 0x4152 #define PCI_CHIP_RV350_AS 0x4153 #define PCI_CHIP_RV350_AT 0x4154 #define PCI_CHIP_RV350_4155 0x4155 #define PCI_CHIP_RV350_AV 0x4156 #define PCI_CHIP_MACH32 0x4158 #define PCI_CHIP_RS250_4237 0x4237 #define PCI_CHIP_R200_BB 0x4242 #define PCI_CHIP_R200_BC 0x4243 #define PCI_CHIP_RS100_4336 0x4336 #define PCI_CHIP_RS200_4337 0x4337 #define PCI_CHIP_MACH64CT 0x4354 #define PCI_CHIP_MACH64CX 0x4358 #define PCI_CHIP_RS250_4437 0x4437 #define PCI_CHIP_MACH64ET 0x4554 #define PCI_CHIP_MACH64GB 0x4742 #define PCI_CHIP_MACH64GD 0x4744 #define PCI_CHIP_MACH64GI 0x4749 #define PCI_CHIP_MACH64GL 0x474C #define PCI_CHIP_MACH64GM 0x474D #define PCI_CHIP_MACH64GN 0x474E #define PCI_CHIP_MACH64GO 0x474F #define PCI_CHIP_MACH64GP 0x4750 #define PCI_CHIP_MACH64GQ 0x4751 #define PCI_CHIP_MACH64GR 0x4752 #define PCI_CHIP_MACH64GS 0x4753 #define PCI_CHIP_MACH64GT 0x4754 #define PCI_CHIP_MACH64GU 0x4755 #define PCI_CHIP_MACH64GV 0x4756 #define PCI_CHIP_MACH64GW 0x4757 #define PCI_CHIP_MACH64GX 0x4758 #define PCI_CHIP_MACH64GY 0x4759 #define PCI_CHIP_MACH64GZ 0x475A #define PCI_CHIP_RV250_Id 0x4964 #define PCI_CHIP_RV250_Ie 0x4965 #define PCI_CHIP_RV250_If 0x4966 #define PCI_CHIP_RV250_Ig 0x4967 #define PCI_CHIP_R420_JH 0x4A48 #define PCI_CHIP_R420_JI 0x4A49 #define PCI_CHIP_R420_JJ 0x4A4A #define PCI_CHIP_R420_JK 0x4A4B #define PCI_CHIP_R420_JL 0x4A4C #define PCI_CHIP_R420_JM 0x4A4D #define PCI_CHIP_R420_JN 0x4A4E #define PCI_CHIP_R420_4A4F 0x4A4F #define PCI_CHIP_R420_JP 0x4A50 #define PCI_CHIP_R420_4A54 0x4A54 #define PCI_CHIP_R481_4B49 0x4B49 #define PCI_CHIP_R481_4B4A 0x4B4A #define PCI_CHIP_R481_4B4B 0x4B4B #define PCI_CHIP_R481_4B4C 0x4B4C #define PCI_CHIP_MACH64LB 0x4C42 #define PCI_CHIP_MACH64LD 0x4C44 #define PCI_CHIP_RAGE128LE 0x4C45 #define PCI_CHIP_RAGE128LF 0x4C46 #define PCI_CHIP_MACH64LG 0x4C47 #define PCI_CHIP_MACH64LI 0x4C49 #define PCI_CHIP_MACH64LM 0x4C4D #define PCI_CHIP_MACH64LN 0x4C4E #define PCI_CHIP_MACH64LP 0x4C50 #define PCI_CHIP_MACH64LQ 0x4C51 #define PCI_CHIP_MACH64LR 0x4C52 #define PCI_CHIP_MACH64LS 0x4C53 #define PCI_CHIP_RADEON_LW 0x4C57 #define PCI_CHIP_RADEON_LX 0x4C58 #define PCI_CHIP_RADEON_LY 0x4C59 #define PCI_CHIP_RADEON_LZ 0x4C5A #define PCI_CHIP_RV250_Ld 0x4C64 #define PCI_CHIP_RV250_Le 0x4C65 #define PCI_CHIP_RV250_Lf 0x4C66 #define PCI_CHIP_RV250_Lg 0x4C67 #define PCI_CHIP_RV250_Ln 0x4C6E #define PCI_CHIP_RAGE128MF 0x4D46 #define PCI_CHIP_RAGE128ML 0x4D4C #define PCI_CHIP_R300_ND 0x4E44 #define PCI_CHIP_R300_NE 0x4E45 #define PCI_CHIP_R300_NF 0x4E46 #define PCI_CHIP_R300_NG 0x4E47 #define PCI_CHIP_R350_NH 0x4E48 #define PCI_CHIP_R350_NI 0x4E49 #define PCI_CHIP_R360_NJ 0x4E4A #define PCI_CHIP_R350_NK 0x4E4B #define PCI_CHIP_RV350_NP 0x4E50 #define PCI_CHIP_RV350_NQ 0x4E51 #define PCI_CHIP_RV350_NR 0x4E52 #define PCI_CHIP_RV350_NS 0x4E53 #define PCI_CHIP_RV350_NT 0x4E54 #define PCI_CHIP_RV350_NV 0x4E56 #define PCI_CHIP_RAGE128PA 0x5041 #define PCI_CHIP_RAGE128PB 0x5042 #define PCI_CHIP_RAGE128PC 0x5043 #define PCI_CHIP_RAGE128PD 0x5044 #define PCI_CHIP_RAGE128PE 0x5045 #define PCI_CHIP_RAGE128PF 0x5046 #define PCI_CHIP_RAGE128PG 0x5047 #define PCI_CHIP_RAGE128PH 0x5048 #define PCI_CHIP_RAGE128PI 0x5049 #define PCI_CHIP_RAGE128PJ 0x504A #define PCI_CHIP_RAGE128PK 0x504B #define PCI_CHIP_RAGE128PL 0x504C #define PCI_CHIP_RAGE128PM 0x504D #define PCI_CHIP_RAGE128PN 0x504E #define PCI_CHIP_RAGE128PO 0x504F #define PCI_CHIP_RAGE128PP 0x5050 #define PCI_CHIP_RAGE128PQ 0x5051 #define PCI_CHIP_RAGE128PR 0x5052 #define PCI_CHIP_RAGE128PS 0x5053 #define PCI_CHIP_RAGE128PT 0x5054 #define PCI_CHIP_RAGE128PU 0x5055 #define PCI_CHIP_RAGE128PV 0x5056 #define PCI_CHIP_RAGE128PW 0x5057 #define PCI_CHIP_RAGE128PX 0x5058 #define PCI_CHIP_RADEON_QD 0x5144 #define PCI_CHIP_RADEON_QE 0x5145 #define PCI_CHIP_RADEON_QF 0x5146 #define PCI_CHIP_RADEON_QG 0x5147 #define PCI_CHIP_R200_QH 0x5148 #define PCI_CHIP_R200_QI 0x5149 #define PCI_CHIP_R200_QJ 0x514A #define PCI_CHIP_R200_QK 0x514B #define PCI_CHIP_R200_QL 0x514C #define PCI_CHIP_R200_QM 0x514D #define PCI_CHIP_R200_QN 0x514E #define PCI_CHIP_R200_QO 0x514F #define PCI_CHIP_RV200_QW 0x5157 #define PCI_CHIP_RV200_QX 0x5158 #define PCI_CHIP_RV100_QY 0x5159 #define PCI_CHIP_RV100_QZ 0x515A #define PCI_CHIP_RN50_515E 0x515E #define PCI_CHIP_RAGE128RE 0x5245 #define PCI_CHIP_RAGE128RF 0x5246 #define PCI_CHIP_RAGE128RG 0x5247 #define PCI_CHIP_RAGE128RK 0x524B #define PCI_CHIP_RAGE128RL 0x524C #define PCI_CHIP_RAGE128SE 0x5345 #define PCI_CHIP_RAGE128SF 0x5346 #define PCI_CHIP_RAGE128SG 0x5347 #define PCI_CHIP_RAGE128SH 0x5348 #define PCI_CHIP_RAGE128SK 0x534B #define PCI_CHIP_RAGE128SL 0x534C #define PCI_CHIP_RAGE128SM 0x534D #define PCI_CHIP_RAGE128SN 0x534E #define PCI_CHIP_RAGE128TF 0x5446 #define PCI_CHIP_RAGE128TL 0x544C #define PCI_CHIP_RAGE128TR 0x5452 #define PCI_CHIP_RAGE128TS 0x5453 #define PCI_CHIP_RAGE128TT 0x5454 #define PCI_CHIP_RAGE128TU 0x5455 #define PCI_CHIP_RV370_5460 0x5460 #define PCI_CHIP_RV370_5461 0x5461 #define PCI_CHIP_RV370_5462 0x5462 #define PCI_CHIP_RV370_5463 0x5463 #define PCI_CHIP_RV370_5464 0x5464 #define PCI_CHIP_RV370_5465 0x5465 #define PCI_CHIP_RV370_5466 0x5466 #define PCI_CHIP_RV370_5467 0x5467 #define PCI_CHIP_R423_UH 0x5548 #define PCI_CHIP_R423_UI 0x5549 #define PCI_CHIP_R423_UJ 0x554A #define PCI_CHIP_R423_UK 0x554B #define PCI_CHIP_R430_554C 0x554C #define PCI_CHIP_R430_554D 0x554D #define PCI_CHIP_R430_554E 0x554E #define PCI_CHIP_R430_554F 0x554F #define PCI_CHIP_R423_5550 0x5550 #define PCI_CHIP_R423_UQ 0x5551 #define PCI_CHIP_R423_UR 0x5552 #define PCI_CHIP_R423_UT 0x5554 #define PCI_CHIP_RV410_564A 0x564A #define PCI_CHIP_RV410_564B 0x564B #define PCI_CHIP_RV410_564F 0x564F #define PCI_CHIP_RV410_5652 0x5652 #define PCI_CHIP_RV410_5653 0x5653 #define PCI_CHIP_MACH64VT 0x5654 #define PCI_CHIP_MACH64VU 0x5655 #define PCI_CHIP_MACH64VV 0x5656 #define PCI_CHIP_RS300_5834 0x5834 #define PCI_CHIP_RS300_5835 0x5835 #define PCI_CHIP_RS300_5836 0x5836 #define PCI_CHIP_RS300_5837 0x5837 #define PCI_CHIP_RS480_5954 0x5954 #define PCI_CHIP_RS480_5955 0x5955 #define PCI_CHIP_RV280_5960 0x5960 #define PCI_CHIP_RV280_5961 0x5961 #define PCI_CHIP_RV280_5962 0x5962 #define PCI_CHIP_RV280_5964 0x5964 #define PCI_CHIP_RV280_5965 0x5965 #define PCI_CHIP_RN50_5969 0x5969 #define PCI_CHIP_RS482_5974 0x5974 #define PCI_CHIP_RS482_5975 0x5975 #define PCI_CHIP_RS400_5A41 0x5A41 #define PCI_CHIP_RS400_5A42 0x5A42 #define PCI_CHIP_RC410_5A61 0x5A61 #define PCI_CHIP_RC410_5A62 0x5A62 #define PCI_CHIP_RV370_5B60 0x5B60 #define PCI_CHIP_RV370_5B61 0x5B61 #define PCI_CHIP_RV370_5B62 0x5B62 #define PCI_CHIP_RV370_5B63 0x5B63 #define PCI_CHIP_RV370_5B64 0x5B64 #define PCI_CHIP_RV370_5B65 0x5B65 #define PCI_CHIP_RV370_5B66 0x5B66 #define PCI_CHIP_RV370_5B67 0x5B67 #define PCI_CHIP_RV280_5C61 0x5C61 #define PCI_CHIP_RV280_5C63 0x5C63 #define PCI_CHIP_R430_5D48 0x5D48 #define PCI_CHIP_R430_5D49 0x5D49 #define PCI_CHIP_R430_5D4A 0x5D4A #define PCI_CHIP_R480_5D4C 0x5D4C #define PCI_CHIP_R480_5D4D 0x5D4D #define PCI_CHIP_R480_5D4E 0x5D4E #define PCI_CHIP_R480_5D4F 0x5D4F #define PCI_CHIP_R480_5D50 0x5D50 #define PCI_CHIP_R480_5D52 0x5D52 #define PCI_CHIP_R423_5D57 0x5D57 #define PCI_CHIP_RV410_5E48 0x5E48 #define PCI_CHIP_RV410_5E4A 0x5E4A #define PCI_CHIP_RV410_5E4B 0x5E4B #define PCI_CHIP_RV410_5E4C 0x5E4C #define PCI_CHIP_RV410_5E4D 0x5E4D #define PCI_CHIP_RV410_5E4F 0x5E4F #define PCI_CHIP_RS350_7834 0x7834 #define PCI_CHIP_RS350_7835 0x7835 /* ASPEED Technology (AST) */ #define PCI_CHIP_AST2000 0x2000 /* Avance Logic */ #define PCI_CHIP_ALG2064 0x2064 #define PCI_CHIP_ALG2301 0x2301 #define PCI_CHIP_ALG2501 0x2501 /* Tseng */ #define PCI_CHIP_ET4000_W32P_A 0x3202 #define PCI_CHIP_ET4000_W32P_B 0x3205 #define PCI_CHIP_ET4000_W32P_D 0x3206 #define PCI_CHIP_ET4000_W32P_C 0x3207 #define PCI_CHIP_ET6000 0x3208 #define PCI_CHIP_ET6300 0x4702 /* Weitek */ #define PCI_CHIP_P9000 0x9001 #define PCI_CHIP_P9100 0x9100 /* Digital */ #define PCI_CHIP_DC21050 0x0001 #define PCI_CHIP_DEC21030 0x0004 #define PCI_CHIP_TGA2 0x000D /* Cirrus Logic */ #define PCI_CHIP_GD7548 0x0038 #define PCI_CHIP_GD7555 0x0040 #define PCI_CHIP_GD5430 0x00A0 #define PCI_CHIP_GD5434_4 0x00A4 #define PCI_CHIP_GD5434_8 0x00A8 #define PCI_CHIP_GD5436 0x00AC #define PCI_CHIP_GD5446 0x00B8 #define PCI_CHIP_GD5480 0x00BC #define PCI_CHIP_GD5462 0x00D0 #define PCI_CHIP_GD5464 0x00D4 #define PCI_CHIP_GD5464BD 0x00D5 #define PCI_CHIP_GD5465 0x00D6 #define PCI_CHIP_6729 0x1100 #define PCI_CHIP_6832 0x1110 #define PCI_CHIP_GD7542 0x1200 #define PCI_CHIP_GD7543 0x1202 #define PCI_CHIP_GD7541 0x1204 /* AMD */ #define PCI_CHIP_AMD761 0x700E /* Trident */ #define PCI_CHIP_2100 0x2100 #define PCI_CHIP_8400 0x8400 #define PCI_CHIP_8420 0x8420 #define PCI_CHIP_8500 0x8500 #define PCI_CHIP_8520 0x8520 #define PCI_CHIP_8600 0x8600 #define PCI_CHIP_8620 0x8620 #define PCI_CHIP_8820 0x8820 #define PCI_CHIP_9320 0x9320 #define PCI_CHIP_9388 0x9388 #define PCI_CHIP_9397 0x9397 #define PCI_CHIP_939A 0x939A #define PCI_CHIP_9420 0x9420 #define PCI_CHIP_9440 0x9440 #define PCI_CHIP_9520 0x9520 #define PCI_CHIP_9525 0x9525 #define PCI_CHIP_9540 0x9540 #define PCI_CHIP_9660 0x9660 #define PCI_CHIP_9750 0x9750 #define PCI_CHIP_9850 0x9850 #define PCI_CHIP_9880 0x9880 #define PCI_CHIP_9910 0x9910 /* ALI */ #define PCI_CHIP_M1435 0x1435 /* Matrox */ #define PCI_CHIP_MGA2085 0x0518 #define PCI_CHIP_MGA2064 0x0519 #define PCI_CHIP_MGA1064 0x051A #define PCI_CHIP_MGA2164 0x051B #define PCI_CHIP_MGA2164_AGP 0x051F #define PCI_CHIP_MGAG200_PCI 0x0520 #define PCI_CHIP_MGAG200 0x0521 #define PCI_CHIP_MGAG400 0x0525 #define PCI_CHIP_MGAG550 0x2527 #define PCI_CHIP_IMPRESSION 0x0D10 #define PCI_CHIP_MGAG100_PCI 0x1000 #define PCI_CHIP_MGAG100 0x1001 #define PCI_CARD_G400_TH 0x2179 #define PCI_CARD_MILL_G200_SD 0xFF00 #define PCI_CARD_PROD_G100_SD 0xFF01 #define PCI_CARD_MYST_G200_SD 0xFF02 #define PCI_CARD_MILL_G200_SG 0xFF03 #define PCI_CARD_MARV_G200_SD 0xFF04 /* Chips & Tech */ #define PCI_CHIP_65545 0x00D8 #define PCI_CHIP_65548 0x00DC #define PCI_CHIP_65550 0x00E0 #define PCI_CHIP_65554 0x00E4 #define PCI_CHIP_65555 0x00E5 #define PCI_CHIP_68554 0x00F4 #define PCI_CHIP_69000 0x00C0 #define PCI_CHIP_69030 0x0C30 /* Miro */ #define PCI_CHIP_ZR36050 0x5601 /* NEC */ #define PCI_CHIP_POWER_VR 0x0046 /* SiS */ #define PCI_CHIP_SG86C201 0x0001 #define PCI_CHIP_SG86C202 0x0002 #define PCI_CHIP_SG85C503 0x0008 #define PCI_CHIP_SIS5597 0x0200 /* Agregado por Carlos Duclos & Manuel Jander */ #define PCI_CHIP_SIS82C204 0x0204 #define PCI_CHIP_SG86C205 0x0205 #define PCI_CHIP_SG86C215 0x0215 #define PCI_CHIP_SG86C225 0x0225 #define PCI_CHIP_85C501 0x0406 #define PCI_CHIP_85C496 0x0496 #define PCI_CHIP_85C601 0x0601 #define PCI_CHIP_85C5107 0x5107 #define PCI_CHIP_85C5511 0x5511 #define PCI_CHIP_85C5513 0x5513 #define PCI_CHIP_SIS5571 0x5571 #define PCI_CHIP_SIS5597_2 0x5597 #define PCI_CHIP_SIS530 0x6306 #define PCI_CHIP_SIS6326 0x6326 #define PCI_CHIP_SIS7001 0x7001 #define PCI_CHIP_SIS300 0x0300 #define PCI_CHIP_SIS315H 0x0310 #define PCI_CHIP_SIS315PRO 0x0325 #define PCI_CHIP_SIS330 0x0330 #define PCI_CHIP_SIS630 0x6300 #define PCI_CHIP_SIS540 0x5300 #define PCI_CHIP_SIS550 0x5315 #define PCI_CHIP_SIS650 0x6325 #define PCI_CHIP_SIS730 0x7300 /* Hewlett-Packard */ #define PCI_CHIP_ELROY 0x1054 #define PCI_CHIP_ZX1_SBA 0x1229 #define PCI_CHIP_ZX1_IOC 0x122A #define PCI_CHIP_ZX1_LBA 0x122E /* a.k.a. Mercury */ #define PCI_CHIP_ZX1_AGP8 0x12B4 /* a.k.a. QuickSilver */ #define PCI_CHIP_ZX2_LBA 0x12EE #define PCI_CHIP_ZX2_SBA 0x4030 #define PCI_CHIP_ZX2_IOC 0x4031 #define PCI_CHIP_ZX2_PCIE 0x4037 /* SGS */ #define PCI_CHIP_STG2000 0x0008 #define PCI_CHIP_STG1764 0x0009 #define PCI_CHIP_KYROII 0x0010 /* Texas Instruments */ #define PCI_CHIP_TI_PERMEDIA 0x3D04 #define PCI_CHIP_TI_PERMEDIA2 0x3D07 /* Oak */ #define PCI_CHIP_OTI107 0x0107 /* Number Nine */ #define PCI_CHIP_I128 0x2309 #define PCI_CHIP_I128_2 0x2339 #define PCI_CHIP_I128_T2R 0x493D #define PCI_CHIP_I128_T2R4 0x5348 /* Sun */ #define PCI_CHIP_EBUS 0x1000 #define PCI_CHIP_HAPPY_MEAL 0x1001 #define PCI_CHIP_SIMBA 0x5000 #define PCI_CHIP_PSYCHO 0x8000 #define PCI_CHIP_SCHIZO 0x8001 #define PCI_CHIP_SABRE 0xA000 #define PCI_CHIP_HUMMINGBIRD 0xA001 /* BrookTree */ #define PCI_CHIP_BT848 0x0350 #define PCI_CHIP_BT849 0x0351 /* NVIDIA */ #define PCI_CHIP_NV1 0x0008 #define PCI_CHIP_DAC64 0x0009 #define PCI_CHIP_TNT 0x0020 #define PCI_CHIP_TNT2 0x0028 #define PCI_CHIP_UTNT2 0x0029 #define PCI_CHIP_VTNT2 0x002C #define PCI_CHIP_UVTNT2 0x002D #define PCI_CHIP_ITNT2 0x00A0 #define PCI_CHIP_GEFORCE_256 0x0100 #define PCI_CHIP_GEFORCE_DDR 0x0101 #define PCI_CHIP_QUADRO 0x0103 #define PCI_CHIP_GEFORCE2_MX 0x0110 #define PCI_CHIP_GEFORCE2_MX_100 0x0111 #define PCI_CHIP_GEFORCE2_GO 0x0112 #define PCI_CHIP_QUADRO2_MXR 0x0113 #define PCI_CHIP_GEFORCE2_GTS 0x0150 #define PCI_CHIP_GEFORCE2_TI 0x0151 #define PCI_CHIP_GEFORCE2_ULTRA 0x0152 #define PCI_CHIP_QUADRO2_PRO 0x0153 #define PCI_CHIP_GEFORCE4_MX_460 0x0170 #define PCI_CHIP_GEFORCE4_MX_440 0x0171 #define PCI_CHIP_GEFORCE4_MX_420 0x0172 #define PCI_CHIP_GEFORCE4_440_GO 0x0174 #define PCI_CHIP_GEFORCE4_420_GO 0x0175 #define PCI_CHIP_GEFORCE4_420_GO_M32 0x0176 #define PCI_CHIP_QUADRO4_500XGL 0x0178 #define PCI_CHIP_GEFORCE4_440_GO_M64 0x0179 #define PCI_CHIP_QUADRO4_200 0x017A #define PCI_CHIP_QUADRO4_550XGL 0x017B #define PCI_CHIP_QUADRO4_500_GOGL 0x017C #define PCI_CHIP_IGEFORCE2 0x01A0 #define PCI_CHIP_GEFORCE3 0x0200 #define PCI_CHIP_GEFORCE3_TI_200 0x0201 #define PCI_CHIP_GEFORCE3_TI_500 0x0202 #define PCI_CHIP_QUADRO_DCC 0x0203 #define PCI_CHIP_GEFORCE4_TI_4600 0x0250 #define PCI_CHIP_GEFORCE4_TI_4400 0x0251 #define PCI_CHIP_GEFORCE4_TI_4200 0x0253 #define PCI_CHIP_QUADRO4_900XGL 0x0258 #define PCI_CHIP_QUADRO4_750XGL 0x0259 #define PCI_CHIP_QUADRO4_700XGL 0x025B /* NVIDIA & SGS */ #define PCI_CHIP_RIVA128 0x0018 /* IMS */ #define PCI_CHIP_IMSTT128 0x9128 #define PCI_CHIP_IMSTT3D 0x9135 /* Alliance Semiconductor */ #define PCI_CHIP_AP6410 0x3210 #define PCI_CHIP_AP6422 0x6422 #define PCI_CHIP_AT24 0x6424 #define PCI_CHIP_AT3D 0x643D /* 3dfx Interactive */ #define PCI_CHIP_VOODOO_GRAPHICS 0x0001 #define PCI_CHIP_VOODOO2 0x0002 #define PCI_CHIP_BANSHEE 0x0003 #define PCI_CHIP_VOODOO3 0x0005 #define PCI_CHIP_VOODOO5 0x0009 #define PCI_CARD_VOODOO3_2000 0x0036 #define PCI_CARD_VOODOO3_3000 0x003A /* Rendition */ #define PCI_CHIP_V1000 0x0001 #define PCI_CHIP_V2x00 0x2000 /* 3Dlabs */ #define PCI_CHIP_300SX 0x0001 #define PCI_CHIP_500TX 0x0002 #define PCI_CHIP_DELTA 0x0003 #define PCI_CHIP_PERMEDIA 0x0004 #define PCI_CHIP_MX 0x0006 #define PCI_CHIP_PERMEDIA2 0x0007 #define PCI_CHIP_GAMMA 0x0008 #define PCI_CHIP_PERMEDIA2V 0x0009 #define PCI_CHIP_PERMEDIA3 0x000A #define PCI_CHIP_PERMEDIA4 0x000C #define PCI_CHIP_R4 0x000D #define PCI_CHIP_GAMMA2 0x000E #define PCI_CHIP_R4ALT 0x0011 /* S3 */ #define PCI_CHIP_PLATO 0x0551 #define PCI_CHIP_VIRGE 0x5631 #define PCI_CHIP_TRIO 0x8811 #define PCI_CHIP_AURORA64VP 0x8812 #define PCI_CHIP_TRIO64UVP 0x8814 #define PCI_CHIP_VIRGE_VX 0x883D #define PCI_CHIP_868 0x8880 #define PCI_CHIP_928 0x88B0 #define PCI_CHIP_864_0 0x88C0 #define PCI_CHIP_864_1 0x88C1 #define PCI_CHIP_964_0 0x88D0 #define PCI_CHIP_964_1 0x88D1 #define PCI_CHIP_968 0x88F0 #define PCI_CHIP_TRIO64V2_DXGX 0x8901 #define PCI_CHIP_PLATO_PX 0x8902 #define PCI_CHIP_Trio3D 0x8904 #define PCI_CHIP_VIRGE_DXGX 0x8A01 #define PCI_CHIP_VIRGE_GX2 0x8A10 #define PCI_CHIP_Trio3D_2X 0x8A13 #define PCI_CHIP_SAVAGE3D 0x8A20 #define PCI_CHIP_SAVAGE3D_MV 0x8A21 #define PCI_CHIP_SAVAGE4 0x8A22 #define PCI_CHIP_PROSAVAGE_PM 0x8A25 #define PCI_CHIP_PROSAVAGE_KM 0x8A26 #define PCI_CHIP_VIRGE_MX 0x8C01 #define PCI_CHIP_VIRGE_MXPLUS 0x8C02 #define PCI_CHIP_VIRGE_MXP 0x8C03 #define PCI_CHIP_SAVAGE_MX_MV 0x8C10 #define PCI_CHIP_SAVAGE_MX 0x8C11 #define PCI_CHIP_SAVAGE_IX_MV 0x8C12 #define PCI_CHIP_SAVAGE_IX 0x8C13 #define PCI_CHIP_SUPSAV_MX128 0x8C22 #define PCI_CHIP_SUPSAV_MX64 0x8C24 #define PCI_CHIP_SUPSAV_MX64C 0x8C26 #define PCI_CHIP_SUPSAV_IX128SDR 0x8C2A #define PCI_CHIP_SUPSAV_IX128DDR 0x8C2B #define PCI_CHIP_SUPSAV_IX64SDR 0x8C2C #define PCI_CHIP_SUPSAV_IX64DDR 0x8C2D #define PCI_CHIP_SUPSAV_IXCSDR 0x8C2E #define PCI_CHIP_SUPSAV_IXCDDR 0x8C2F #define PCI_CHIP_S3TWISTER_P 0x8D01 #define PCI_CHIP_S3TWISTER_K 0x8D02 #define PCI_CHIP_PROSAVAGE_DDR 0x8D03 #define PCI_CHIP_PROSAVAGE_DDRK 0x8D04 #define PCI_CHIP_SAVAGE2000 0x9102 /* ARK Logic */ #define PCI_CHIP_1000PV 0xA091 #define PCI_CHIP_2000PV 0xA099 #define PCI_CHIP_2000MT 0xA0A1 #define PCI_CHIP_2000MI 0xA0A9 /* Tritech Microelectronics */ #define PCI_CHIP_TR25202 0xFC02 /* Neomagic */ #define PCI_CHIP_NM2070 0x0001 #define PCI_CHIP_NM2090 0x0002 #define PCI_CHIP_NM2093 0x0003 #define PCI_CHIP_NM2097 0x0083 #define PCI_CHIP_NM2160 0x0004 #define PCI_CHIP_NM2200 0x0005 #define PCI_CHIP_NM2230 0x0025 #define PCI_CHIP_NM2360 0x0006 #define PCI_CHIP_NM2380 0x0016 /* Intel */ #define PCI_CHIP_I815_BRIDGE 0x1130 #define PCI_CHIP_I815 0x1132 #define PCI_CHIP_82801_P2P 0x244E #define PCI_CHIP_845_G_BRIDGE 0x2560 #define PCI_CHIP_845_G 0x2562 #define PCI_CHIP_I830_M_BRIDGE 0x3575 #define PCI_CHIP_I830_M 0x3577 #define PCI_CHIP_I810_BRIDGE 0x7120 #define PCI_CHIP_I810 0x7121 #define PCI_CHIP_I810_DC100_BRIDGE 0x7122 #define PCI_CHIP_I810_DC100 0x7123 #define PCI_CHIP_I810_E_BRIDGE 0x7124 #define PCI_CHIP_I810_E 0x7125 #define PCI_CHIP_I740_AGP 0x7800 #define PCI_CHIP_460GX_PXB 0x84CB #define PCI_CHIP_460GX_SAC 0x84E0 #define PCI_CHIP_460GX_GXB_2 0x84E2 /* PCI function 2 */ #define PCI_CHIP_460GX_WXB 0x84E6 #define PCI_CHIP_460GX_GXB_1 0x84EA /* PCI function 1 */ /* Silicon Motion Inc. */ #define PCI_CHIP_SMI910 0x0910 #define PCI_CHIP_SMI810 0x0810 #define PCI_CHIP_SMI820 0x0820 #define PCI_CHIP_SMI710 0x0710 #define PCI_CHIP_SMI712 0x0712 #define PCI_CHIP_SMI720 0x0720 #define PCI_CHIP_SMI731 0x0730 /* VMware */ #define PCI_CHIP_VMWARE0405 0x0405 #define PCI_CHIP_VMWARE0710 0x0710 #endif /* _XF86_PCIINFO_H */ xorg-server-1.17.1/hw/xfree86/common/xf86Init.c0000664000175100017510000014673312415504317016011 00000000000000/* * Loosely based on code bearing the following copyright: * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. */ /* * Copyright (c) 1992-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #undef HAS_UTSNAME #if !defined(WIN32) #define HAS_UTSNAME 1 #include #endif #include #include #include #include #include "input.h" #include "servermd.h" #include "windowstr.h" #include "scrnintstr.h" #include "site.h" #include "mi.h" #include "dbus-core.h" #include "systemd-logind.h" #include "loaderProcs.h" #ifdef XFreeXDGA #include "dgaproc.h" #endif #define XF86_OS_PRIVS #include "xf86.h" #include "xf86Priv.h" #include "xf86Config.h" #include "xf86_OSlib.h" #include "xf86cmap.h" #include "xorgVersion.h" #include "xf86Build.h" #include "mipointer.h" #include #include #include "xf86DDC.h" #include "xf86Xinput.h" #include "xf86InPriv.h" #include "picturestr.h" #include "xf86Bus.h" #ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" #endif #include "globals.h" #include "xserver-properties.h" #ifdef DPMSExtension #include #include "dpmsproc.h" #endif #include #ifdef XF86PM void (*xf86OSPMClose) (void) = NULL; #endif static Bool xorgHWOpenConsole = FALSE; /* Common pixmap formats */ static PixmapFormatRec formats[MAXFORMATS] = { {1, 1, BITMAP_SCANLINE_PAD}, {4, 8, BITMAP_SCANLINE_PAD}, {8, 8, BITMAP_SCANLINE_PAD}, {15, 16, BITMAP_SCANLINE_PAD}, {16, 16, BITMAP_SCANLINE_PAD}, {24, 32, BITMAP_SCANLINE_PAD}, {32, 32, BITMAP_SCANLINE_PAD}, }; static int numFormats = 7; static Bool formatsDone = FALSE; #ifndef OSNAME #define OSNAME " unknown" #endif #ifndef OSVENDOR #define OSVENDOR "" #endif #ifndef PRE_RELEASE #define PRE_RELEASE XORG_VERSION_SNAP #endif static void xf86PrintBanner(void) { #if PRE_RELEASE xf86ErrorFVerb(0, "\n" "This is a pre-release version of the X server from " XVENDORNAME ".\n" "It is not supported in any way.\n" "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" "Select the \"xorg\" product for bugs you find in this release.\n" "Before reporting bugs in pre-release versions please check the\n" "latest version in the X.Org Foundation git repository.\n" "See http://wiki.x.org/wiki/GitPage for git access instructions.\n"); #endif xf86ErrorFVerb(0, "\nX.Org X Server %d.%d.%d", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH); #if XORG_VERSION_SNAP > 0 xf86ErrorFVerb(0, ".%d", XORG_VERSION_SNAP); #endif #if XORG_VERSION_SNAP >= 900 /* When the minor number is 99, that signifies that the we are making * a release candidate for a major version. (X.0.0) * When the patch number is 99, that signifies that the we are making * a release candidate for a minor version. (X.Y.0) * When the patch number is < 99, then we are making a release * candidate for the next point release. (X.Y.Z) */ #if XORG_VERSION_MINOR >= 99 xf86ErrorFVerb(0, " (%d.0.0 RC %d)", XORG_VERSION_MAJOR + 1, XORG_VERSION_SNAP - 900); #elif XORG_VERSION_PATCH == 99 xf86ErrorFVerb(0, " (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1, XORG_VERSION_SNAP - 900); #else xf86ErrorFVerb(0, " (%d.%d.%d RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH + 1, XORG_VERSION_SNAP - 900); #endif #endif #ifdef XORG_CUSTOM_VERSION xf86ErrorFVerb(0, " (%s)", XORG_CUSTOM_VERSION); #endif #ifndef XORG_DATE #define XORG_DATE "Unknown" #endif xf86ErrorFVerb(0, "\nRelease Date: %s\n", XORG_DATE); xf86ErrorFVerb(0, "X Protocol Version %d, Revision %d\n", X_PROTOCOL, X_PROTOCOL_REVISION); xf86ErrorFVerb(0, "Build Operating System: %s %s\n", OSNAME, OSVENDOR); #ifdef HAS_UTSNAME { struct utsname name; /* Linux & BSD state that 0 is success, SysV (including Solaris, HP-UX, and Irix) and Single Unix Spec 3 just say that non-negative is success. All agree that failure is represented by a negative number. */ if (uname(&name) >= 0) { xf86ErrorFVerb(0, "Current Operating System: %s %s %s %s %s\n", name.sysname, name.nodename, name.release, name.version, name.machine); #ifdef linux do { char buf[80]; int fd = open("/proc/cmdline", O_RDONLY); if (fd != -1) { xf86ErrorFVerb(0, "Kernel command line: "); memset(buf, 0, 80); while (read(fd, buf, 80) > 0) { xf86ErrorFVerb(0, "%.80s", buf); memset(buf, 0, 80); } close(fd); } } while (0); #endif } } #endif #if defined(BUILD_DATE) && (BUILD_DATE > 19000000) { struct tm t; char buf[100]; memset(&t, 0, sizeof(t)); memset(buf, 0, sizeof(buf)); t.tm_mday = BUILD_DATE % 100; t.tm_mon = (BUILD_DATE / 100) % 100 - 1; t.tm_year = BUILD_DATE / 10000 - 1900; #if defined(BUILD_TIME) t.tm_sec = BUILD_TIME % 100; t.tm_min = (BUILD_TIME / 100) % 100; t.tm_hour = (BUILD_TIME / 10000) % 100; if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%S%p", &t)) xf86ErrorFVerb(0, "Build Date: %s\n", buf); #else if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) xf86ErrorFVerb(0, "Build Date: %s\n", buf); #endif } #endif #if defined(BUILDERSTRING) xf86ErrorFVerb(0, "%s \n", BUILDERSTRING); #endif xf86ErrorFVerb(0, "Current version of pixman: %s\n", pixman_version_string()); xf86ErrorFVerb(0, "\tBefore reporting problems, check " "" __VENDORDWEBSUPPORT__ "\n" "\tto make sure that you have the latest version.\n"); } Bool xf86PrivsElevated(void) { static Bool privsTested = FALSE; static Bool privsElevated = TRUE; if (!privsTested) { #if defined(WIN32) privsElevated = FALSE; #else if ((getuid() != geteuid()) || (getgid() != getegid())) { privsElevated = TRUE; } else { #if defined(HAVE_ISSETUGID) privsElevated = issetugid(); #elif defined(HAVE_GETRESUID) uid_t ruid, euid, suid; gid_t rgid, egid, sgid; if ((getresuid(&ruid, &euid, &suid) == 0) && (getresgid(&rgid, &egid, &sgid) == 0)) { privsElevated = (euid != suid) || (egid != sgid); } else { printf("Failed getresuid or getresgid"); /* Something went wrong, make defensive assumption */ privsElevated = TRUE; } #else if (getuid() == 0) { /* running as root: uid==euid==0 */ privsElevated = FALSE; } else { /* * If there are saved ID's the process might still be privileged * even though the above test succeeded. If issetugid() and * getresgid() aren't available, test this by trying to set * euid to 0. */ unsigned int oldeuid; oldeuid = geteuid(); if (seteuid(0) != 0) { privsElevated = FALSE; } else { if (seteuid(oldeuid) != 0) { FatalError("Failed to drop privileges. Exiting\n"); } privsElevated = TRUE; } } #endif } #endif privsTested = TRUE; } return privsElevated; } static Bool xf86CreateRootWindow(WindowPtr pWin) { int ret = TRUE; int err = Success; ScreenPtr pScreen = pWin->drawable.pScreen; RootWinPropPtr pProp; CreateWindowProcPtr create_window = (CreateWindowProcPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); DebugF("xf86CreateRootWindow(%p)\n", pWin); /* Unhook this function ... */ pScreen->CreateWindow = create_window; dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL); /* ... and call the previous CreateWindow fuction, if any */ if (NULL != pScreen->CreateWindow) { ret = (*pScreen->CreateWindow) (pWin); } /* Now do our stuff */ if (xf86RegisteredPropertiesTable != NULL) { if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) { for (pProp = xf86RegisteredPropertiesTable[pScreen->myNum]; pProp != NULL && err == Success; pProp = pProp->next) { Atom prop; prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE); err = dixChangeWindowProperty(serverClient, pWin, prop, pProp->type, pProp->format, PropModeReplace, pProp->size, pProp->data, FALSE); } /* Look at err */ ret &= (err == Success); } } return ret; } static void InstallSignalHandlers(void) { /* * Install signal handler for unexpected signals */ xf86Info.caughtSignal = FALSE; if (!xf86Info.notrapSignals) { OsRegisterSigWrapper(xf86SigWrapper); } else { signal(SIGSEGV, SIG_DFL); signal(SIGILL, SIG_DFL); #ifdef SIGEMT signal(SIGEMT, SIG_DFL); #endif signal(SIGFPE, SIG_DFL); signal(SIGBUS, SIG_DFL); signal(SIGSYS, SIG_DFL); signal(SIGXCPU, SIG_DFL); signal(SIGXFSZ, SIG_DFL); } } /* The memory storing the initial value of the XFree86_has_VT root window * property. This has to remain available until server start-up, so we just * use a global. */ static CARD32 HasVTValue = 1; /* * InitOutput -- * Initialize screenInfo for all actually accessible framebuffers. * That includes vt-manager setup, querying all possible devices and * collecting the pixmap formats. */ void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { int i, j, k, scr_index; const char **modulelist; void **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++; else xf86ServerName = argv[0]; xf86PrintBanner(); LogPrintMarkers(); if (xf86LogFile) { time_t t; const char *ct; t = time(NULL); ct = ctime(&t); xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s", xf86LogFile, ct); } /* Read and parse the config file */ if (!xf86DoConfigure && !xf86DoShowOptions) { switch (xf86HandleConfigFile(FALSE)) { case CONFIG_OK: break; case CONFIG_PARSE_ERROR: xf86Msg(X_ERROR, "Error parsing the config file\n"); return; case CONFIG_NOFILE: autoconfig = TRUE; break; } } InstallSignalHandlers(); /* Initialise the loader */ LoaderInit(); /* Tell the loader the default module search path */ LoaderSetPath(xf86ModulePath); if (xf86Info.ignoreABI) { LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); } if (xf86DoShowOptions) DoShowOptions(); dbus_core_init(); systemd_logind_init(); /* Do a general bus probe. This will be a PCI probe for x86 platforms */ xf86BusProbe(); if (xf86DoConfigure) DoConfigure(); if (autoconfig) { if (!xf86AutoConfig()) { xf86Msg(X_ERROR, "Auto configuration failed\n"); return; } } #ifdef XF86PM xf86OSPMClose = xf86OSPMOpen(); #endif xf86ExtensionInit(); /* Load all modules specified explicitly in the config file */ if ((modulelist = xf86ModulelistFromConfig(&optionlist))) { xf86LoadModules(modulelist, optionlist); free(modulelist); free(optionlist); } /* Load all driver modules specified in the config file */ /* If there aren't any specified in the config file, autoconfig them */ /* FIXME: Does not handle multiple active screen sections, but I'm not * sure if we really want to handle that case*/ configured_device = xf86ConfigLayout.screens->screen->device; if ((!configured_device) || (!configured_device->driver)) { if (!autoConfigDevice(configured_device)) { xf86Msg(X_ERROR, "Automatic driver configuration failed\n"); return; } } if ((modulelist = xf86DriverlistFromConfig())) { xf86LoadModules(modulelist, NULL); free(modulelist); } /* Load all input driver modules specified in the config file. */ if ((modulelist = xf86InputDriverlistFromConfig())) { xf86LoadModules(modulelist, NULL); free(modulelist); } /* * It is expected that xf86AddDriver()/xf86AddInputDriver will be * called for each driver as it is loaded. Those functions save the * module pointers for drivers. * XXX Nothing keeps track of them for other modules. */ /* XXX What do we do if not all of these could be loaded? */ /* * At this point, xf86DriverList[] is all filled in with entries for * each of the drivers to try and xf86NumDrivers has the number of * drivers. If there are none, return now. */ if (xf86NumDrivers == 0) { xf86Msg(X_ERROR, "No drivers available.\n"); return; } /* * Call each of the Identify functions and call the driverFunc to check * if HW access is required. The Identify functions print out some * identifying information, and anything else that might be * needed at this early stage. */ for (i = 0; i < xf86NumDrivers; i++) { xorgHWFlags flags = HW_IO; if (xf86DriverList[i]->Identify != NULL) xf86DriverList[i]->Identify(0); if (xf86DriverList[i]->driverFunc) xf86DriverList[i]->driverFunc(NULL, GET_REQUIRED_HW_INTERFACES, &flags); if (NEED_IO_ENABLED(flags)) want_hw_access = TRUE; /* Non-seat0 X servers should not open console */ if (!(flags & HW_SKIP_CONSOLE) && !ServerIsNotSeat0()) xorgHWOpenConsole = TRUE; } if (xorgHWOpenConsole) xf86OpenConsole(); else xf86Info.dontVTSwitch = TRUE; /* Enable full I/O access */ if (want_hw_access) xorgHWAccess = xf86EnableIO(); if (xf86BusConfig() == FALSE) return; xf86PostProbe(); /* * Sort the drivers to match the requested ording. Using a slow * bubble sort. */ for (j = 0; j < xf86NumScreens - 1; j++) { for (i = 0; i < xf86NumScreens - j - 1; i++) { if (xf86Screens[i + 1]->confScreen->screennum < xf86Screens[i]->confScreen->screennum) { ScrnInfoPtr tmpScrn = xf86Screens[i + 1]; xf86Screens[i + 1] = xf86Screens[i]; xf86Screens[i] = tmpScrn; } } } /* Fix up the indexes */ for (i = 0; i < xf86NumScreens; i++) { xf86Screens[i]->scrnIndex = i; } /* * Call the driver's PreInit()'s to complete initialisation for the first * generation. */ for (i = 0; i < xf86NumScreens; i++) { xf86VGAarbiterScrnInit(xf86Screens[i]); xf86VGAarbiterLock(xf86Screens[i]); if (xf86Screens[i]->PreInit && xf86Screens[i]->PreInit(xf86Screens[i], 0)) xf86Screens[i]->configured = TRUE; xf86VGAarbiterUnlock(xf86Screens[i]); } for (i = 0; i < xf86NumScreens; i++) if (!xf86Screens[i]->configured) 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. */ if (xf86NumScreens == 0) { xf86Msg(X_ERROR, "Screen(s) found, but none have a usable configuration.\n"); return; } for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->name == NULL) { char *tmp; XNFasprintf(&tmp, "screen%d", i); xf86Screens[i]->name = tmp; xf86MsgVerb(X_WARNING, 0, "Screen driver %d has no name set, using `%s'.\n", i, xf86Screens[i]->name); } } /* Remove (unload) drivers that are not required */ for (i = 0; i < xf86NumDrivers; i++) if (xf86DriverList[i] && xf86DriverList[i]->refCount <= 0) xf86DeleteDriver(i); /* * At this stage we know how many screens there are. */ for (i = 0; i < xf86NumScreens; i++) xf86InitViewport(xf86Screens[i]); /* * Collect all pixmap formats and check for conflicts at the display * level. Should we die here? Or just delete the offending screens? */ screenpix24 = Pix24DontCare; for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->imageByteOrder != xf86Screens[0]->imageByteOrder) FatalError("Inconsistent display bitmapBitOrder. Exiting\n"); if (xf86Screens[i]->bitmapScanlinePad != xf86Screens[0]->bitmapScanlinePad) FatalError ("Inconsistent display bitmapScanlinePad. Exiting\n"); if (xf86Screens[i]->bitmapScanlineUnit != xf86Screens[0]->bitmapScanlineUnit) FatalError ("Inconsistent display bitmapScanlineUnit. Exiting\n"); if (xf86Screens[i]->bitmapBitOrder != xf86Screens[0]->bitmapBitOrder) FatalError("Inconsistent display bitmapBitOrder. Exiting\n"); /* Determine the depth 24 pixmap format the screens would like */ if (xf86Screens[i]->pixmap24 != Pix24DontCare) { if (screenpix24 == Pix24DontCare) screenpix24 = xf86Screens[i]->pixmap24; else if (screenpix24 != xf86Screens[i]->pixmap24) FatalError ("Inconsistent depth 24 pixmap format. Exiting\n"); } } /* check if screenpix24 is consistent with the config/cmdline */ if (xf86Info.pixmap24 != Pix24DontCare) { pix24 = xf86Info.pixmap24; pix24From = xf86Info.pix24From; if (screenpix24 != Pix24DontCare && screenpix24 != xf86Info.pixmap24) pix24Fail = TRUE; } else if (screenpix24 != Pix24DontCare) { pix24 = screenpix24; pix24From = X_PROBED; } else pix24 = Pix24Use32; if (pix24Fail) FatalError("Screen(s) can't use the required depth 24 pixmap format" " (%d). Exiting\n", PIX24TOBPP(pix24)); /* Initialise the depth 24 format */ for (j = 0; j < numFormats && formats[j].depth != 24; j++); formats[j].bitsPerPixel = PIX24TOBPP(pix24); /* Collect additional formats */ for (i = 0; i < xf86NumScreens; i++) { for (j = 0; j < xf86Screens[i]->numFormats; j++) { for (k = 0;; k++) { if (k >= numFormats) { if (k >= MAXFORMATS) FatalError("Too many pixmap formats! Exiting\n"); formats[k] = xf86Screens[i]->formats[j]; numFormats++; break; } if (formats[k].depth == xf86Screens[i]->formats[j].depth) { if ((formats[k].bitsPerPixel == xf86Screens[i]->formats[j].bitsPerPixel) && (formats[k].scanlinePad == xf86Screens[i]->formats[j].scanlinePad)) break; FatalError("Inconsistent pixmap format for depth %d." " Exiting\n", formats[k].depth); } } } } formatsDone = TRUE; if (xf86Info.vtno >= 0) { #define VT_ATOM_NAME "XFree86_VT" Atom VTAtom = -1; Atom HasVTAtom = -1; CARD32 *VT = NULL; CARD32 *HasVT = &HasVTValue; int ret; /* This memory needs to stay available until the screen has been initialized, and we can create the property for real. */ if ((VT = malloc(sizeof(CARD32))) == NULL) { FatalError ("Unable to make VT property - out of memory. Exiting...\n"); } *VT = xf86Info.vtno; VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); HasVTAtom = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1, TRUE); for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; i++) { ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, VTAtom, XA_INTEGER, 32, 1, VT); if (ret == Success) ret = xf86RegisterRootWindowProperty(xf86Screens[i] ->scrnIndex, HasVTAtom, XA_INTEGER, 32, 1, HasVT); if (ret != Success) xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, "Failed to register VT properties\n"); } } if (SeatId) { Atom SeatAtom; SeatAtom = MakeAtom(SEAT_ATOM_NAME, sizeof(SEAT_ATOM_NAME) - 1, TRUE); for (i = 0; i < xf86NumScreens; i++) { int ret; ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, SeatAtom, XA_STRING, 8, strlen(SeatId) + 1, SeatId); if (ret != Success) { xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, "Failed to register seat property\n"); } } } /* If a screen uses depth 24, show what the pixmap format is */ for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->depth == 24) { xf86Msg(pix24From, "Depth 24 pixmap format is %d bpp\n", PIX24TOBPP(pix24)); break; } } } else { /* * serverGeneration != 1; some OSs have to do things here, too. */ if (xorgHWOpenConsole) xf86OpenConsole(); #ifdef XF86PM /* should we reopen it here? We need to deal with an already opened device. We could leave this to the OS layer. For now we simply close it here */ if (xf86OSPMClose) xf86OSPMClose(); if ((xf86OSPMClose = xf86OSPMOpen()) != NULL) xf86MsgVerb(X_INFO, 3, "APM registered successfully\n"); #endif /* Make sure full I/O access is enabled */ if (xorgHWAccess) xf86EnableIO(); } /* * Use the previously collected parts to setup pScreenInfo */ pScreenInfo->imageByteOrder = xf86Screens[0]->imageByteOrder; pScreenInfo->bitmapScanlinePad = xf86Screens[0]->bitmapScanlinePad; pScreenInfo->bitmapScanlineUnit = xf86Screens[0]->bitmapScanlineUnit; pScreenInfo->bitmapBitOrder = xf86Screens[0]->bitmapBitOrder; pScreenInfo->numPixmapFormats = numFormats; for (i = 0; i < numFormats; i++) pScreenInfo->formats[i] = formats[i]; /* Make sure the server's VT is active */ if (serverGeneration != 1) { xf86Resetting = TRUE; /* All screens are in the same state, so just check the first */ if (!xf86VTOwner()) { #ifdef HAS_USL_VTS ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); #endif xf86AccessEnter(); OsBlockSIGIO(); sigio_blocked = TRUE; } } for (i = 0; i < xf86NumScreens; i++) if (!xf86ColormapAllocatePrivates(xf86Screens[i])) FatalError("Cannot register DDX private keys"); if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) || !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]); /* * Almost everything uses these defaults, and many of those that * don't, will wrap them. */ xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess; #ifdef XFreeXDGA xf86Screens[i]->SetDGAMode = xf86SetDGAMode; #endif xf86Screens[i]->DPMSSet = NULL; xf86Screens[i]->LoadPalette = NULL; xf86Screens[i]->SetOverscan = NULL; xf86Screens[i]->DriverFunc = NULL; xf86Screens[i]->pScreen = NULL; scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv); xf86VGAarbiterUnlock(xf86Screens[i]); if (scr_index == i) { /* * Hook in our ScrnInfoRec, and initialise some other pScreen * fields. */ dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, xf86ScreenKey, xf86Screens[i]); xf86Screens[i]->pScreen = screenInfo.screens[scr_index]; /* The driver should set this, but make sure it is set anyway */ xf86Screens[i]->vtSema = TRUE; } else { /* This shouldn't normally happen */ FatalError("AddScreen/ScreenInit failed for driver %d\n", i); } DebugF("InitOutput - xf86Screens[%d]->pScreen = %p\n", i, xf86Screens[i]->pScreen); DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n", i, xf86Screens[i]->pScreen->CreateWindow); dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, xf86CreateRootWindowKey, xf86Screens[i]->pScreen->CreateWindow); xf86Screens[i]->pScreen->CreateWindow = xf86CreateRootWindow; if (PictureGetSubpixelOrder(xf86Screens[i]->pScreen) == SubPixelUnknown) { xf86MonPtr DDC = (xf86MonPtr) (xf86Screens[i]->monitor->DDC); PictureSetSubpixelOrder(xf86Screens[i]->pScreen, DDC ? (DDC->features.input_type ? SubPixelHorizontalRGB : SubPixelNone) : SubPixelUnknown); } #ifdef RANDR if (!xf86Info.disableRandR) xf86RandRInit(screenInfo.screens[scr_index]); xf86Msg(xf86Info.randRFrom, "RandR %s\n", xf86Info.disableRandR ? "disabled" : "enabled"); #endif } for (i = 0; i < xf86NumGPUScreens; i++) AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); xf86VGAarbiterWrapFunctions(); if (sigio_blocked) OsReleaseSIGIO(); xf86InitOrigins(); xf86Resetting = FALSE; xf86Initialising = FALSE; RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA, xf86Wakeup, NULL); } /** * Initialize all supported input devices present and referenced in the * xorg.conf. */ void InitInput(int argc, char **argv) { InputInfoPtr *pInfo; DeviceIntPtr dev; xf86Info.vtRequestsPending = FALSE; mieqInit(); /* Initialize all configured input devices */ for (pInfo = xf86ConfigLayout.inputs; pInfo && *pInfo; pInfo++) { (*pInfo)->options = xf86AddNewOption((*pInfo)->options, "driver", (*pInfo)->driver); (*pInfo)->options = xf86AddNewOption((*pInfo)->options, "identifier", (*pInfo)->name); /* If one fails, the others will too */ if (NewInputDeviceRequest((*pInfo)->options, NULL, &dev) == BadAlloc) break; } config_init(); } void CloseInput(void) { config_fini(); mieqFini(); } /* * OsVendorInit -- * OS/Vendor-specific initialisations. Called from OsInit(), which * is called by dix before establishing the well known sockets. */ void OsVendorInit(void) { static Bool beenHere = FALSE; signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ if (!beenHere) { umask(022); xf86LogInit(); } /* Set stderr to non-blocking. */ #ifndef O_NONBLOCK #if defined(FNDELAY) #define O_NONBLOCK FNDELAY #elif defined(O_NDELAY) #define O_NONBLOCK O_NDELAY #endif #ifdef O_NONBLOCK if (!beenHere) { if (xf86PrivsElevated()) { int status; status = fcntl(fileno(stderr), F_GETFL, 0); if (status != -1) { fcntl(fileno(stderr), F_SETFL, status | O_NONBLOCK); } } } #endif #endif beenHere = TRUE; } /* * ddxGiveUp -- * Device dependent cleanup. Called by by dix before normal server death. * For SYSV386 we must switch the terminal back to normal mode. No error- * checking here, since there should be restored as much as possible. */ void ddxGiveUp(enum ExitCode error) { int i; xf86VGAarbiterFini(); #ifdef XF86PM if (xf86OSPMClose) xf86OSPMClose(); xf86OSPMClose = NULL; #endif for (i = 0; i < xf86NumScreens; i++) { /* * zero all access functions to * trap calls when switched away. */ xf86Screens[i]->vtSema = FALSE; } #ifdef XFreeXDGA DGAShutdown(); #endif if (xorgHWOpenConsole) xf86CloseConsole(); systemd_logind_fini(); dbus_core_fini(); xf86CloseLog(error); /* If an unexpected signal was caught, dump a core for debugging */ if (xf86Info.caughtSignal) OsAbort(); } /* * AbortDDX -- * DDX - specific abort routine. Called by AbortServer(). The attempt is * made to restore all original setting of the displays. Also all devices * are closed. */ void AbortDDX(enum ExitCode error) { int i; OsBlockSIGIO(); /* * try to restore the original video state */ #ifdef DPMSExtension /* Turn screens back on */ if (DPMSPowerLevel != DPMSModeOn) DPMSSet(serverClient, DPMSModeOn); #endif if (xf86Screens) { for (i = 0; i < xf86NumScreens; i++) if (xf86Screens[i]->vtSema) { /* * if we are aborting before ScreenInit() has finished * we might not have been wrapped yet. Therefore enable * screen explicitely. */ xf86VGAarbiterLock(xf86Screens[i]); (xf86Screens[i]->LeaveVT) (xf86Screens[i]); xf86VGAarbiterUnlock(xf86Screens[i]); } } xf86AccessLeave(); /* * This is needed for an abnormal server exit, since the normal exit stuff * MUST also be performed (i.e. the vt must be left in a defined state) */ ddxGiveUp(error); } void OsVendorFatalError(const char *f, va_list args) { #ifdef VENDORSUPPORT ErrorFSigSafe("\nPlease refer to your Operating System Vendor support " "pages\nat %s for support on this crash.\n", VENDORSUPPORT); #else ErrorFSigSafe("\nPlease consult the " XVENDORNAME " support \n\t at " __VENDORDWEBSUPPORT__ "\n for help. \n"); #endif if (xf86LogFile && xf86LogFileWasOpened) ErrorFSigSafe("Please also check the log file at \"%s\" for additional " "information.\n", xf86LogFile); ErrorFSigSafe("\n"); } int xf86SetVerbosity(int verb) { int save = xf86Verbose; xf86Verbose = verb; LogSetParameter(XLOG_VERBOSITY, verb); return save; } int xf86SetLogVerbosity(int verb) { int save = xf86LogVerbose; xf86LogVerbose = verb; LogSetParameter(XLOG_FILE_VERBOSITY, verb); return save; } static void xf86PrintDefaultModulePath(void) { ErrorF("%s\n", DEFAULT_MODULE_PATH); } static void xf86PrintDefaultLibraryPath(void) { ErrorF("%s\n", DEFAULT_LIBRARY_PATH); } /* * ddxProcessArgument -- * Process device-dependent command line args. Returns 0 if argument is * not device dependent, otherwise Count of number of elements of argv * that are part of a device dependent commandline option. * */ /* ARGSUSED */ int ddxProcessArgument(int argc, char **argv, int i) { #define CHECK_FOR_REQUIRED_ARGUMENT() \ if (((i + 1) >= argc) || (!argv[i + 1])) { \ ErrorF("Required argument to %s not specified\n", argv[i]); \ UseMsg(); \ FatalError("Required argument to %s not specified\n", argv[i]); \ } /* First the options that are not allowed with elevated privileges */ if (!strcmp(argv[i], "-modulepath") || !strcmp(argv[i], "-logfile")) { if (xf86PrivsElevated()) { FatalError("The '%s' option cannot be used with " "elevated privileges.\n", argv[i]); } else if (!strcmp(argv[i], "-modulepath")) { char *mp; CHECK_FOR_REQUIRED_ARGUMENT(); mp = strdup(argv[i + 1]); if (!mp) FatalError("Can't allocate memory for ModulePath\n"); xf86ModulePath = mp; xf86ModPathFrom = X_CMDLINE; return 2; } else if (!strcmp(argv[i], "-logfile")) { char *lf; CHECK_FOR_REQUIRED_ARGUMENT(); lf = strdup(argv[i + 1]); if (!lf) FatalError("Can't allocate memory for LogFile\n"); xf86LogFile = lf; xf86LogFileFrom = X_CMDLINE; return 2; } } if (!strcmp(argv[i], "-config") || !strcmp(argv[i], "-xf86config")) { CHECK_FOR_REQUIRED_ARGUMENT(); if (xf86PrivsElevated() && !xf86PathIsSafe(argv[i + 1])) { FatalError("\nInvalid argument for %s\n" "\tWith elevated privileges, the file specified with %s must be\n" "\ta relative path and must not contain any \"..\" elements.\n" "\tUsing default " __XCONFIGFILE__ " search path.\n\n", argv[i], argv[i]); } xf86ConfigFile = argv[i + 1]; return 2; } if (!strcmp(argv[i], "-configdir")) { CHECK_FOR_REQUIRED_ARGUMENT(); if (xf86PrivsElevated() && !xf86PathIsSafe(argv[i + 1])) { FatalError("\nInvalid argument for %s\n" "\tWith elevated privileges, the file specified with %s must be\n" "\ta relative path and must not contain any \"..\" elements.\n" "\tUsing default " __XCONFIGDIR__ " search path.\n\n", argv[i], argv[i]); } xf86ConfigDir = argv[i + 1]; return 2; } if (!strcmp(argv[i], "-flipPixels")) { xf86FlipPixels = TRUE; return 1; } #ifdef XF86VIDMODE if (!strcmp(argv[i], "-disableVidMode")) { xf86VidModeDisabled = TRUE; return 1; } if (!strcmp(argv[i], "-allowNonLocalXvidtune")) { xf86VidModeAllowNonLocal = TRUE; return 1; } #endif if (!strcmp(argv[i], "-allowMouseOpenFail")) { xf86AllowMouseOpenFail = TRUE; return 1; } if (!strcmp(argv[i], "-ignoreABI")) { LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); return 1; } if (!strcmp(argv[i], "-verbose")) { if (++i < argc && argv[i]) { char *end; long val; val = strtol(argv[i], &end, 0); if (*end == '\0') { xf86SetVerbosity(val); return 2; } } xf86SetVerbosity(++xf86Verbose); return 1; } if (!strcmp(argv[i], "-logverbose")) { if (++i < argc && argv[i]) { char *end; long val; val = strtol(argv[i], &end, 0); if (*end == '\0') { xf86SetLogVerbosity(val); return 2; } } xf86SetLogVerbosity(++xf86LogVerbose); return 1; } if (!strcmp(argv[i], "-quiet")) { xf86SetVerbosity(-1); return 1; } if (!strcmp(argv[i], "-showconfig") || !strcmp(argv[i], "-version")) { xf86PrintBanner(); exit(0); } if (!strcmp(argv[i], "-showDefaultModulePath")) { xf86PrintDefaultModulePath(); exit(0); } if (!strcmp(argv[i], "-showDefaultLibPath")) { xf86PrintDefaultLibraryPath(); exit(0); } /* Notice the -fp flag, but allow it to pass to the dix layer */ if (!strcmp(argv[i], "-fp")) { xf86fpFlag = TRUE; return 0; } /* Notice the -bs flag, but allow it to pass to the dix layer */ if (!strcmp(argv[i], "-bs")) { xf86bsDisableFlag = TRUE; return 0; } /* Notice the +bs flag, but allow it to pass to the dix layer */ if (!strcmp(argv[i], "+bs")) { xf86bsEnableFlag = TRUE; return 0; } /* Notice the -s flag, but allow it to pass to the dix layer */ if (!strcmp(argv[i], "-s")) { xf86sFlag = TRUE; return 0; } if (!strcmp(argv[i], "-pixmap24")) { xf86Pix24 = Pix24Use24; return 1; } if (!strcmp(argv[i], "-pixmap32")) { xf86Pix24 = Pix24Use32; return 1; } if (!strcmp(argv[i], "-fbbpp")) { int bpp; CHECK_FOR_REQUIRED_ARGUMENT(); if (sscanf(argv[++i], "%d", &bpp) == 1) { xf86FbBpp = bpp; return 2; } else { ErrorF("Invalid fbbpp\n"); return 0; } } if (!strcmp(argv[i], "-depth")) { int depth; CHECK_FOR_REQUIRED_ARGUMENT(); if (sscanf(argv[++i], "%d", &depth) == 1) { xf86Depth = depth; return 2; } else { ErrorF("Invalid depth\n"); return 0; } } if (!strcmp(argv[i], "-weight")) { int red, green, blue; CHECK_FOR_REQUIRED_ARGUMENT(); if (sscanf(argv[++i], "%1d%1d%1d", &red, &green, &blue) == 3) { xf86Weight.red = red; xf86Weight.green = green; xf86Weight.blue = blue; return 2; } else { ErrorF("Invalid weighting\n"); return 0; } } if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") || !strcmp(argv[i], "-ggamma") || !strcmp(argv[i], "-bgamma")) { double gamma; CHECK_FOR_REQUIRED_ARGUMENT(); if (sscanf(argv[++i], "%lf", &gamma) == 1) { if (gamma < GAMMA_MIN || gamma > GAMMA_MAX) { ErrorF("gamma out of range, only %.2f <= gamma_value <= %.1f" " is valid\n", GAMMA_MIN, GAMMA_MAX); return 0; } if (!strcmp(argv[i - 1], "-gamma")) xf86Gamma.red = xf86Gamma.green = xf86Gamma.blue = gamma; else if (!strcmp(argv[i - 1], "-rgamma")) xf86Gamma.red = gamma; else if (!strcmp(argv[i - 1], "-ggamma")) xf86Gamma.green = gamma; else if (!strcmp(argv[i - 1], "-bgamma")) xf86Gamma.blue = gamma; return 2; } } if (!strcmp(argv[i], "-layout")) { CHECK_FOR_REQUIRED_ARGUMENT(); xf86LayoutName = argv[++i]; return 2; } if (!strcmp(argv[i], "-screen")) { CHECK_FOR_REQUIRED_ARGUMENT(); xf86ScreenName = argv[++i]; return 2; } if (!strcmp(argv[i], "-pointer")) { CHECK_FOR_REQUIRED_ARGUMENT(); xf86PointerName = argv[++i]; return 2; } if (!strcmp(argv[i], "-keyboard")) { CHECK_FOR_REQUIRED_ARGUMENT(); xf86KeyboardName = argv[++i]; return 2; } if (!strcmp(argv[i], "-nosilk")) { xf86silkenMouseDisableFlag = TRUE; return 1; } #ifdef HAVE_ACPI if (!strcmp(argv[i], "-noacpi")) { xf86acpiDisableFlag = TRUE; return 1; } #endif if (!strcmp(argv[i], "-configure")) { if (getuid() != 0 && geteuid() == 0) { ErrorF("The '-configure' option can only be used by root.\n"); exit(1); } xf86DoConfigure = TRUE; xf86AllowMouseOpenFail = TRUE; return 1; } if (!strcmp(argv[i], "-showopts")) { if (getuid() != 0 && geteuid() == 0) { ErrorF("The '-showopts' option can only be used by root.\n"); exit(1); } xf86DoShowOptions = TRUE; return 1; } #ifdef XSERVER_LIBPCIACCESS if (!strcmp(argv[i], "-isolateDevice")) { CHECK_FOR_REQUIRED_ARGUMENT(); if (strncmp(argv[++i], "PCI:", 4)) { FatalError("Bus types other than PCI not yet isolable\n"); } xf86PciIsolateDevice(argv[i]); return 2; } #endif /* Notice cmdline xkbdir, but pass to dix as well */ if (!strcmp(argv[i], "-xkbdir")) { xf86xkbdirFlag = TRUE; return 0; } if (!strcmp(argv[i], "-novtswitch")) { xf86Info.autoVTSwitch = FALSE; return 1; } if (!strcmp(argv[i], "-sharevts")) { xf86Info.ShareVTs = TRUE; return 1; } /* OS-specific processing */ return xf86ProcessArgument(argc, argv, i); } /* * ddxUseMsg -- * Print out correct use of device dependent commandline options. * Maybe the user now knows what really to do ... */ void ddxUseMsg(void) { ErrorF("\n"); ErrorF("\n"); ErrorF("Device Dependent Usage\n"); if (!xf86PrivsElevated()) { ErrorF("-modulepath paths specify the module search path\n"); ErrorF("-logfile file specify a log file name\n"); ErrorF("-configure probe for devices and write an " __XCONFIGFILE__ "\n"); ErrorF ("-showopts print available options for all installed drivers\n"); } ErrorF ("-config file specify a configuration file, relative to the\n"); ErrorF(" " __XCONFIGFILE__ " search path, only root can use absolute\n"); ErrorF ("-configdir dir specify a configuration directory, relative to the\n"); ErrorF(" " __XCONFIGDIR__ " search path, only root can use absolute\n"); ErrorF("-verbose [n] verbose startup messages\n"); ErrorF("-logverbose [n] verbose log messages\n"); ErrorF("-quiet minimal startup messages\n"); ErrorF("-pixmap24 use 24bpp pixmaps for depth 24\n"); ErrorF("-pixmap32 use 32bpp pixmaps for depth 24\n"); ErrorF("-fbbpp n set bpp for the framebuffer. Default: 8\n"); ErrorF("-depth n set colour depth. Default: 8\n"); ErrorF ("-gamma f set gamma value (0.1 < f < 10.0) Default: 1.0\n"); ErrorF("-rgamma f set gamma value for red phase\n"); ErrorF("-ggamma f set gamma value for green phase\n"); ErrorF("-bgamma f set gamma value for blue phase\n"); ErrorF ("-weight nnn set RGB weighting at 16 bpp. Default: 565\n"); ErrorF("-layout name specify the ServerLayout section name\n"); ErrorF("-screen name specify the Screen section name\n"); ErrorF ("-keyboard name specify the core keyboard InputDevice name\n"); ErrorF ("-pointer name specify the core pointer InputDevice name\n"); ErrorF("-nosilk disable Silken Mouse\n"); ErrorF("-flipPixels swap default black/white Pixel values\n"); #ifdef XF86VIDMODE ErrorF("-disableVidMode disable mode adjustments with xvidtune\n"); ErrorF ("-allowNonLocalXvidtune allow xvidtune to be run as a non-local client\n"); #endif ErrorF ("-allowMouseOpenFail start server even if the mouse can't be initialized\n"); ErrorF("-ignoreABI make module ABI mismatches non-fatal\n"); #ifdef XSERVER_LIBPCIACCESS ErrorF ("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n"); #endif ErrorF("-version show the server version\n"); ErrorF("-showDefaultModulePath show the server default module path\n"); ErrorF("-showDefaultLibPath show the server default library path\n"); ErrorF ("-novtswitch don't automatically switch VT at reset & exit\n"); ErrorF("-sharevts share VTs with another X server\n"); /* OS-specific usage */ xf86UseMsg(); ErrorF("\n"); } /* * xf86LoadModules iterates over a list that is being passed in. */ Bool xf86LoadModules(const char **list, void **optlist) { int errmaj, errmin; void *opt; int i; char *name; Bool failed = FALSE; if (!list) return TRUE; for (i = 0; list[i] != NULL; i++) { /* Normalise the module name */ name = xf86NormalizeName(list[i]); /* Skip empty names */ if (name == NULL || *name == '\0') { free(name); continue; } /* Replace obsolete keyboard driver with kbd */ if (!xf86NameCmp(name, "keyboard")) { strcpy(name, "kbd"); } if (optlist) opt = optlist[i]; else opt = NULL; if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) { LoaderErrorMsg(NULL, name, errmaj, errmin); failed = TRUE; } free(name); } return !failed; } /* Pixmap format stuff */ PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth) { int i; static PixmapFormatRec format; /* XXX not reentrant */ /* * When the formats[] list initialisation isn't complete, check the * depth 24 pixmap config/cmdline options and screen-specified formats. */ if (!formatsDone) { if (depth == 24) { Pix24Flags pix24 = Pix24DontCare; format.depth = 24; format.scanlinePad = BITMAP_SCANLINE_PAD; if (xf86Info.pixmap24 != Pix24DontCare) pix24 = xf86Info.pixmap24; else if (pScrn->pixmap24 != Pix24DontCare) pix24 = pScrn->pixmap24; if (pix24 == Pix24Use24) format.bitsPerPixel = 24; else format.bitsPerPixel = 32; return &format; } } for (i = 0; i < numFormats; i++) if (formats[i].depth == depth) break; if (i != numFormats) return &formats[i]; else if (!formatsDone) { /* Check for screen-specified formats */ for (i = 0; i < pScrn->numFormats; i++) if (pScrn->formats[i].depth == depth) break; if (i != pScrn->numFormats) return &pScrn->formats[i]; } return NULL; } int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth) { PixmapFormatPtr format; format = xf86GetPixFormat(pScrn, depth); if (format) return format->bitsPerPixel; else return 0; } #ifdef DDXBEFORERESET void ddxBeforeReset(void) { } #endif xorg-server-1.17.1/hw/xfree86/common/xf86Xinput.h0000664000175100017510000002432712456571574016412 00000000000000/* * 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 * copyright notice and this permission notice appear in supporting * documentation, and that the name of Frederic Lepied not be used in * 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. * * 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 * 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. * */ /* * Copyright (c) 2000-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifndef _xf86Xinput_h #define _xf86Xinput_h #include "xf86.h" #include "xf86str.h" #include "inputstr.h" #include #include #include "XIstubs.h" /* Input device flags */ #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 */ #define XI86_SERVER_FD 0x20 /* fd is managed by xserver */ /* Input device driver capabilities */ #define XI86_DRV_CAP_SERVER_FD 0x01 /* This holds the input driver entry and module information. */ typedef struct _InputDriverRec { int driverVersion; 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); void *module; const char **default_options; int capabilities; } InputDriverRec, *InputDriverPtr; /* This is to input devices what the ScrnInfoRec is to screens. */ struct _InputInfoRec { struct _InputInfoRec *next; char *name; char *driver; int flags; Bool (*device_control) (DeviceIntPtr device, int what); void (*read_input) (struct _InputInfoRec * local); int (*control_proc) (struct _InputInfoRec * local, xDeviceCtl * control); int (*switch_mode) (ClientPtr client, DeviceIntPtr dev, int mode); int (*set_device_valuators) (struct _InputInfoRec * local, int *valuators, int first_valuator, int num_valuators); int fd; int major; int minor; DeviceIntPtr dev; void *private; const char *type_name; InputDriverPtr drv; void *module; XF86OptionPtr options; InputAttributes *attrs; }; /* xf86Globals.c */ extern InputInfoPtr xf86InputDevs; /* xf86Xinput.c */ extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, ...); extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, const int *valuators); extern _X_EXPORT void xf86PostMotionEventM(DeviceIntPtr device, int is_absolute, const ValuatorMask *mask); extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, ...); extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, const int *valuators); extern _X_EXPORT void xf86PostProximityEventM(DeviceIntPtr device, int is_in, const ValuatorMask *mask); extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button, int is_down, int first_valuator, int num_valuators, ...); extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button, int is_down, int first_valuator, int num_valuators, const int *valuators); extern _X_EXPORT void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute, int button, int is_down, const ValuatorMask *mask); extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, int first_valuator, int num_valuators, ...); extern _X_EXPORT void xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, const ValuatorMask *mask); extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, int first_valuator, int num_valuators, const int *valuators); extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down); extern _X_EXPORT void xf86PostTouchEvent(DeviceIntPtr dev, uint32_t touchid, uint16_t type, uint32_t flags, const ValuatorMask *mask); extern _X_EXPORT InputInfoPtr xf86FirstLocalDevice(void); extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min); extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, XF86OptionPtr options); extern _X_EXPORT Bool xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval, int resolution, int min_res, int max_res, int mode); extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum); extern _X_EXPORT void xf86AddEnabledDevice(InputInfoPtr pInfo); extern _X_EXPORT void xf86RemoveEnabledDevice(InputInfoPtr pInfo); extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic); extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev); extern _X_EXPORT void xf86InputEnableVTProbe(void); /* not exported */ int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto); InputInfoPtr xf86AllocateInput(void); /* xf86Helper.c */ extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, void *module, int flags); extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex); extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name); extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name); extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags); extern _X_EXPORT void xf86MotionHistoryAllocate(InputInfoPtr pInfo); extern _X_EXPORT void xf86IDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(4, 5); extern _X_EXPORT void xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(3, 4); extern _X_EXPORT void xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, va_list args) _X_ATTRIBUTE_PRINTF(4, 0); /* xf86Option.c */ extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts); #endif /* _xf86Xinput_h */ xorg-server-1.17.1/hw/xfree86/common/xf86pciBus.h0000664000175100017510000000473612362011423016324 00000000000000 /* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _XF86_PCI_BUS_H #define _XF86_PCI_BUS_H void xf86PciProbe(void); Bool xf86PciAddMatchingDev(DriverPtr drvp); Bool xf86PciProbeDev(DriverPtr drvp); void xf86PciIsolateDevice(const char *argument); int xf86PciMatchDriver(char *matches[], int nmatches); 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)) int xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, char *matches[], int nmatches); int xf86VideoPtrToDriverList(struct pci_device *dev, char *returnList[], int returnListMax); #endif /* _XF86_PCI_BUS_H */ xorg-server-1.17.1/hw/xfree86/common/xf86PM.c0000664000175100017510000001537312366220413015412 00000000000000/* * Copyright (c) 2000-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86Xinput.h" #include "xf86_OSproc.h" int (*xf86PMGetEventFromOs) (int fd, pmEvent * events, int num) = NULL; pmWait (*xf86PMConfirmEventToOs) (int fd, pmEvent event) = NULL; static Bool suspended = FALSE; static int eventName(pmEvent event, const char **str) { switch (event) { case XF86_APM_SYS_STANDBY: *str = "System Standby Request"; return 0; case XF86_APM_SYS_SUSPEND: *str = "System Suspend Request"; return 0; case XF86_APM_CRITICAL_SUSPEND: *str = "Critical Suspend"; return 0; case XF86_APM_USER_STANDBY: *str = "User System Standby Request"; return 0; case XF86_APM_USER_SUSPEND: *str = "User System Suspend Request"; return 0; case XF86_APM_STANDBY_RESUME: *str = "System Standby Resume"; return 0; case XF86_APM_NORMAL_RESUME: *str = "Normal Resume System"; return 0; case XF86_APM_CRITICAL_RESUME: *str = "Critical Resume System"; return 0; case XF86_APM_LOW_BATTERY: *str = "Battery Low"; return 3; case XF86_APM_POWER_STATUS_CHANGE: *str = "Power Status Change"; return 3; case XF86_APM_UPDATE_TIME: *str = "Update Time"; return 3; case XF86_APM_CAPABILITY_CHANGED: *str = "Capability Changed"; return 3; case XF86_APM_STANDBY_FAILED: *str = "Standby Request Failed"; return 0; case XF86_APM_SUSPEND_FAILED: *str = "Suspend Request Failed"; return 0; default: *str = "Unknown Event"; return 0; } } static void suspend(pmEvent event, Bool undo) { int i; InputInfoPtr pInfo; for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE); } pInfo = xf86InputDevs; while (pInfo) { DisableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } OsBlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); else { xf86Screens[i]->LeaveVT(xf86Screens[i]); xf86Screens[i]->vtSema = FALSE; } } xf86AccessLeave(); } static void resume(pmEvent event, Bool undo) { int i; InputInfoPtr pInfo; xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); else { xf86Screens[i]->vtSema = TRUE; xf86Screens[i]->EnterVT(xf86Screens[i]); } } OsReleaseSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); } dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); pInfo = xf86InputDevs; while (pInfo) { EnableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } } static void DoApmEvent(pmEvent event, Bool undo) { int i; switch (event) { #if 0 case XF86_APM_SYS_STANDBY: case XF86_APM_USER_STANDBY: #endif case XF86_APM_SYS_SUSPEND: case XF86_APM_CRITICAL_SUSPEND: /*do we want to delay a critical suspend? */ case XF86_APM_USER_SUSPEND: /* should we do this ? */ if (!undo && !suspended) { suspend(event, undo); suspended = TRUE; } else if (undo && suspended) { resume(event, undo); suspended = FALSE; } break; #if 0 case XF86_APM_STANDBY_RESUME: #endif case XF86_APM_NORMAL_RESUME: case XF86_APM_CRITICAL_RESUME: if (suspended) { resume(event, undo); suspended = FALSE; } break; default: OsBlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) { xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); } } OsReleaseSIGIO(); break; } } #define MAX_NO_EVENTS 8 void xf86HandlePMEvents(int fd, void *data) { pmEvent events[MAX_NO_EVENTS]; int i, n; Bool wait = FALSE; if (!xf86PMGetEventFromOs) return; if ((n = xf86PMGetEventFromOs(fd, events, MAX_NO_EVENTS))) { do { for (i = 0; i < n; i++) { const char *str = NULL; int verb = eventName(events[i], &str); xf86MsgVerb(X_INFO, verb, "PM Event received: %s\n", str); DoApmEvent(events[i], FALSE); switch (xf86PMConfirmEventToOs(fd, events[i])) { case PM_WAIT: wait = TRUE; break; case PM_CONTINUE: wait = FALSE; break; case PM_FAILED: DoApmEvent(events[i], TRUE); wait = FALSE; break; default: break; } } if (wait) n = xf86PMGetEventFromOs(fd, events, MAX_NO_EVENTS); else break; } while (1); } } xorg-server-1.17.1/hw/xfree86/common/compiler.h0000664000175100017510000010167012456571574016216 00000000000000/* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * 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 Thomas Roell not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Thomas Roell makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THOMAS ROELL 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. * */ /* * Copyright (c) 1994-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifndef _COMPILER_H #define _COMPILER_H #if defined(__SUNPRO_C) #define DO_PROTOTYPES #endif /* Map Sun compiler platform defines to gcc-style used in the code */ #if defined(__amd64) && !defined(__amd64__) #define __amd64__ #endif #if defined(__i386) && !defined(__i386__) #define __i386__ #endif #if defined(__sparc) && !defined(__sparc__) #define __sparc__ #endif #if defined(__sparcv9) && !defined(__sparc64__) #define __sparc64__ #endif #ifndef _X_EXPORT #include #endif #include /* for uint*_t types */ /* Allow drivers to use the GCC-supported __inline__ and/or __inline. */ #ifndef __inline__ #if defined(__GNUC__) /* gcc has __inline__ */ #else #define __inline__ /**/ #endif #endif /* __inline__ */ #ifndef __inline #if defined(__GNUC__) /* gcc has __inline */ #else #define __inline /**/ #endif #endif /* __inline */ /* Support gcc's __FUNCTION__ for people using other compilers */ #if !defined(__GNUC__) && !defined(__FUNCTION__) #define __FUNCTION__ __func__ /* C99 */ #endif #if defined(DO_PROTOTYPES) #if !defined(__arm__) #if !defined(__sparc__) && !defined(__arm32__) && !defined(__nds32__) \ && !(defined(__alpha__) && defined(linux)) \ && !(defined(__ia64__) && defined(linux)) \ && !(defined(__mips64) && defined(linux)) \ extern _X_EXPORT void outb(unsigned short, unsigned char); extern _X_EXPORT void outw(unsigned short, unsigned short); extern _X_EXPORT void outl(unsigned short, unsigned int); extern _X_EXPORT unsigned int inb(unsigned short); extern _X_EXPORT unsigned int inw(unsigned short); extern _X_EXPORT unsigned int inl(unsigned short); #else /* __sparc__, __arm32__, __alpha__, __nds32__ */ extern _X_EXPORT void outb(unsigned long, unsigned char); extern _X_EXPORT void outw(unsigned long, unsigned short); extern _X_EXPORT void outl(unsigned long, unsigned int); 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); #endif /* _SUNPRO_C */ #endif /* __sparc__, __arm32__, __alpha__, __nds32__ */ #endif /* __arm__ */ #endif /* NO_INLINE || DO_PROTOTYPES */ #ifdef __GNUC__ #ifdef __i386__ #ifdef __SSE__ #define write_mem_barrier() __asm__ __volatile__ ("sfence" : : : "memory") #else #define write_mem_barrier() __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory") #endif #ifdef __SSE2__ #define mem_barrier() __asm__ __volatile__ ("mfence" : : : "memory") #else #define mem_barrier() __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory") #endif #elif defined __alpha__ #define mem_barrier() __asm__ __volatile__ ("mb" : : : "memory") #define write_mem_barrier() __asm__ __volatile__ ("wmb" : : : "memory") #elif defined __amd64__ #define mem_barrier() __asm__ __volatile__ ("mfence" : : : "memory") #define write_mem_barrier() __asm__ __volatile__ ("sfence" : : : "memory") #elif defined __ia64__ #ifndef __INTEL_COMPILER #define mem_barrier() __asm__ __volatile__ ("mf" : : : "memory") #define write_mem_barrier() __asm__ __volatile__ ("mf" : : : "memory") #else #include "ia64intrin.h" #define mem_barrier() __mf() #define write_mem_barrier() __mf() #endif #elif defined __mips__ /* Note: sync instruction requires MIPS II instruction set */ #define mem_barrier() \ __asm__ __volatile__( \ ".set push\n\t" \ ".set noreorder\n\t" \ ".set mips2\n\t" \ "sync\n\t" \ ".set pop" \ : /* no output */ \ : /* no input */ \ : "memory") #define write_mem_barrier() mem_barrier() #elif defined __powerpc__ #ifndef eieio #define eieio() __asm__ __volatile__ ("eieio" ::: "memory") #endif /* eieio */ #define mem_barrier() eieio() #define write_mem_barrier() eieio() #elif defined __sparc__ #define barrier() __asm__ __volatile__ (".word 0x8143e00a" : : : "memory") #define mem_barrier() /* XXX: nop for now */ #define write_mem_barrier() /* XXX: nop for now */ #endif #endif /* __GNUC__ */ #ifndef barrier #define barrier() #endif #ifndef mem_barrier #define mem_barrier() /* NOP */ #endif #ifndef write_mem_barrier #define write_mem_barrier() /* NOP */ #endif #ifdef __GNUC__ #if defined(__alpha__) #ifdef linux /* for Linux on Alpha, we use the LIBC _inx/_outx routines */ /* note that the appropriate setup via "ioperm" needs to be done */ /* *before* any inx/outx is done. */ extern _X_EXPORT void _outb(unsigned char val, unsigned long port); extern _X_EXPORT void _outw(unsigned short val, unsigned long port); extern _X_EXPORT void _outl(unsigned int val, unsigned long port); extern _X_EXPORT unsigned int _inb(unsigned long port); extern _X_EXPORT unsigned int _inw(unsigned long port); extern _X_EXPORT unsigned int _inl(unsigned long port); static __inline__ void outb(unsigned long port, unsigned char val) { _outb(val, port); } static __inline__ void outw(unsigned long port, unsigned short val) { _outw(val, port); } static __inline__ void outl(unsigned long port, unsigned int val) { _outl(val, port); } static __inline__ unsigned int inb(unsigned long port) { return _inb(port); } static __inline__ unsigned int inw(unsigned long port) { return _inw(port); } static __inline__ unsigned int inl(unsigned long port) { return _inl(port); } #endif /* linux */ #if (defined(__FreeBSD__) || defined(__OpenBSD__)) \ && !defined(DO_PROTOTYPES) /* for FreeBSD and OpenBSD on Alpha, we use the libio (resp. libalpha) */ /* inx/outx routines */ /* note that the appropriate setup via "ioperm" needs to be done */ /* *before* any inx/outx is done. */ extern _X_EXPORT void outb(unsigned int port, unsigned char val); extern _X_EXPORT void outw(unsigned int port, unsigned short val); extern _X_EXPORT void outl(unsigned int port, unsigned int val); extern _X_EXPORT unsigned char inb(unsigned int port); extern _X_EXPORT unsigned short inw(unsigned int port); extern _X_EXPORT unsigned int inl(unsigned int port); #endif /* (__FreeBSD__ || __OpenBSD__ ) && !DO_PROTOTYPES */ #if defined(__NetBSD__) #include #endif /* __NetBSD__ */ #elif defined(__amd64__) #include static __inline__ void outb(unsigned short port, unsigned char val) { __asm__ __volatile__("outb %0,%1"::"a"(val), "d"(port)); } static __inline__ void outw(unsigned short port, unsigned short val) { __asm__ __volatile__("outw %0,%1"::"a"(val), "d"(port)); } static __inline__ void outl(unsigned short port, unsigned int val) { __asm__ __volatile__("outl %0,%1"::"a"(val), "d"(port)); } static __inline__ unsigned int inb(unsigned short port) { unsigned char ret; __asm__ __volatile__("inb %1,%0":"=a"(ret):"d"(port)); return ret; } static __inline__ unsigned int inw(unsigned short port) { unsigned short ret; __asm__ __volatile__("inw %1,%0":"=a"(ret):"d"(port)); return ret; } static __inline__ unsigned int inl(unsigned short port) { unsigned int ret; __asm__ __volatile__("inl %1,%0":"=a"(ret):"d"(port)); return ret; } #elif defined(__sparc__) #ifndef ASI_PL #define ASI_PL 0x88 #endif static __inline__ void outb(unsigned long port, unsigned char val) { __asm__ __volatile__("stba %0, [%1] %2": /* No outputs */ :"r"(val), "r"(port), "i"(ASI_PL)); barrier(); } static __inline__ void outw(unsigned long port, unsigned short val) { __asm__ __volatile__("stha %0, [%1] %2": /* No outputs */ :"r"(val), "r"(port), "i"(ASI_PL)); barrier(); } static __inline__ void outl(unsigned long port, unsigned int val) { __asm__ __volatile__("sta %0, [%1] %2": /* No outputs */ :"r"(val), "r"(port), "i"(ASI_PL)); barrier(); } static __inline__ unsigned int inb(unsigned long port) { unsigned int ret; __asm__ __volatile__("lduba [%1] %2, %0":"=r"(ret) :"r"(port), "i"(ASI_PL)); return ret; } static __inline__ unsigned int inw(unsigned long port) { unsigned int ret; __asm__ __volatile__("lduha [%1] %2, %0":"=r"(ret) :"r"(port), "i"(ASI_PL)); return ret; } static __inline__ unsigned int inl(unsigned long port) { unsigned int ret; __asm__ __volatile__("lda [%1] %2, %0":"=r"(ret) :"r"(port), "i"(ASI_PL)); return ret; } static __inline__ unsigned char xf86ReadMmio8(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned char ret; __asm__ __volatile__("lduba [%1] %2, %0":"=r"(ret) :"r"(addr), "i"(ASI_PL)); return ret; } static __inline__ unsigned short xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned short ret; __asm__ __volatile__("lduh [%1], %0":"=r"(ret) :"r"(addr)); return ret; } static __inline__ unsigned short xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned short ret; __asm__ __volatile__("lduha [%1] %2, %0":"=r"(ret) :"r"(addr), "i"(ASI_PL)); return ret; } static __inline__ unsigned int xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned int ret; __asm__ __volatile__("ld [%1], %0":"=r"(ret) :"r"(addr)); return ret; } static __inline__ unsigned int xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned int ret; __asm__ __volatile__("lda [%1] %2, %0":"=r"(ret) :"r"(addr), "i"(ASI_PL)); return ret; } static __inline__ void xf86WriteMmio8(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("stba %0, [%1] %2": /* No outputs */ :"r"(val), "r"(addr), "i"(ASI_PL)); barrier(); } static __inline__ void xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("sth %0, [%1]": /* No outputs */ :"r"(val), "r"(addr)); barrier(); } static __inline__ void xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("stha %0, [%1] %2": /* No outputs */ :"r"(val), "r"(addr), "i"(ASI_PL)); barrier(); } static __inline__ void xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("st %0, [%1]": /* No outputs */ :"r"(val), "r"(addr)); barrier(); } static __inline__ void xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("sta %0, [%1] %2": /* No outputs */ :"r"(val), "r"(addr), "i"(ASI_PL)); barrier(); } #elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__)) #if defined(__arm32__) || defined(__mips64) #define PORT_SIZE long #else #define PORT_SIZE short #endif _X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */ static __inline__ void outb(unsigned PORT_SIZE port, unsigned char val) { *(volatile unsigned char *) (((unsigned PORT_SIZE) (port)) + IOPortBase) = val; } static __inline__ void outw(unsigned PORT_SIZE port, unsigned short val) { *(volatile unsigned short *) (((unsigned PORT_SIZE) (port)) + IOPortBase) = val; } static __inline__ void outl(unsigned PORT_SIZE port, unsigned int val) { *(volatile unsigned int *) (((unsigned PORT_SIZE) (port)) + IOPortBase) = val; } static __inline__ unsigned int inb(unsigned PORT_SIZE port) { return *(volatile unsigned char *) (((unsigned PORT_SIZE) (port)) + IOPortBase); } static __inline__ unsigned int inw(unsigned PORT_SIZE port) { return *(volatile unsigned short *) (((unsigned PORT_SIZE) (port)) + IOPortBase); } static __inline__ unsigned int inl(unsigned PORT_SIZE port) { return *(volatile unsigned int *) (((unsigned PORT_SIZE) (port)) + IOPortBase); } #if defined(__mips__) #ifdef linux /* don't mess with other OSs */ #if X_BYTE_ORDER == X_BIG_ENDIAN static __inline__ unsigned int xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned int ret; __asm__ __volatile__("lw %0, 0(%1)":"=r"(ret) :"r"(addr)); return ret; } static __inline__ void xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("sw %0, 0(%1)": /* No outputs */ :"r"(val), "r"(addr)); } #endif #endif /* !linux */ #endif /* __mips__ */ #elif defined(__powerpc__) #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) #endif extern _X_EXPORT volatile unsigned char *ioBase; static __inline__ unsigned char xf86ReadMmio8(__volatile__ void *base, const unsigned long offset) { register unsigned char val; __asm__ __volatile__("lbzx %0,%1,%2\n\t" "eieio":"=r"(val) :"b"(base), "r"(offset), "m"(*((volatile unsigned char *) base + offset))); return val; } static __inline__ unsigned short xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset) { register unsigned short val; __asm__ __volatile__("lhzx %0,%1,%2\n\t" "eieio":"=r"(val) :"b"(base), "r"(offset), "m"(*((volatile unsigned char *) base + offset))); return val; } static __inline__ unsigned short xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset) { register unsigned short val; __asm__ __volatile__("lhbrx %0,%1,%2\n\t" "eieio":"=r"(val) :"b"(base), "r"(offset), "m"(*((volatile unsigned char *) base + offset))); return val; } static __inline__ unsigned int xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset) { register unsigned int val; __asm__ __volatile__("lwzx %0,%1,%2\n\t" "eieio":"=r"(val) :"b"(base), "r"(offset), "m"(*((volatile unsigned char *) base + offset))); return val; } static __inline__ unsigned int xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset) { register unsigned int val; __asm__ __volatile__("lwbrx %0,%1,%2\n\t" "eieio":"=r"(val) :"b"(base), "r"(offset), "m"(*((volatile unsigned char *) base + offset))); return val; } static __inline__ void xf86WriteMmio8(__volatile__ void *base, const unsigned long offset, const unsigned char val) { __asm__ __volatile__("stbx %1,%2,%3\n\t":"=m" (*((volatile unsigned char *) base + offset)) :"r"(val), "b"(base), "r"(offset)); eieio(); } static __inline__ void xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset, const unsigned short val) { __asm__ __volatile__("sthbrx %1,%2,%3\n\t":"=m" (*((volatile unsigned char *) base + offset)) :"r"(val), "b"(base), "r"(offset)); eieio(); } static __inline__ void xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset, const unsigned short val) { __asm__ __volatile__("sthx %1,%2,%3\n\t":"=m" (*((volatile unsigned char *) base + offset)) :"r"(val), "b"(base), "r"(offset)); eieio(); } static __inline__ void xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset, const unsigned int val) { __asm__ __volatile__("stwbrx %1,%2,%3\n\t":"=m" (*((volatile unsigned char *) base + offset)) :"r"(val), "b"(base), "r"(offset)); eieio(); } static __inline__ void xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, const unsigned int val) { __asm__ __volatile__("stwx %1,%2,%3\n\t":"=m" (*((volatile unsigned char *) base + offset)) :"r"(val), "b"(base), "r"(offset)); eieio(); } static __inline__ void outb(unsigned short port, unsigned char value) { if (ioBase == MAP_FAILED) return; xf86WriteMmio8((void *) ioBase, port, value); } static __inline__ void outw(unsigned short port, unsigned short value) { if (ioBase == MAP_FAILED) return; xf86WriteMmio16Le((void *) ioBase, port, value); } static __inline__ void outl(unsigned short port, unsigned int value) { if (ioBase == MAP_FAILED) return; xf86WriteMmio32Le((void *) ioBase, port, value); } static __inline__ unsigned int inb(unsigned short port) { if (ioBase == MAP_FAILED) return 0; return xf86ReadMmio8((void *) ioBase, port); } static __inline__ unsigned int inw(unsigned short port) { if (ioBase == MAP_FAILED) return 0; return xf86ReadMmio16Le((void *) ioBase, port); } static __inline__ unsigned int inl(unsigned short port) { if (ioBase == MAP_FAILED) return 0; return xf86ReadMmio32Le((void *) ioBase, port); } #elif defined(__arm__) && defined(__linux__) /* for Linux on ARM, we use the LIBC inx/outx routines */ /* note that the appropriate setup via "ioperm" needs to be done */ /* *before* any inx/outx is done. */ #include static __inline__ void xf_outb(unsigned short port, unsigned char val) { outb(val, port); } static __inline__ void xf_outw(unsigned short port, unsigned short val) { outw(val, port); } static __inline__ void xf_outl(unsigned short port, unsigned int val) { outl(val, port); } #define outb xf_outb #define outw xf_outw #define outl xf_outl #elif defined(__nds32__) /* * Assume all port access are aligned. We need to revise this implementation * if there is unaligned port access. */ #define PORT_SIZE long static __inline__ unsigned char xf86ReadMmio8(__volatile__ void *base, const unsigned long offset) { return *(volatile unsigned char *) ((unsigned char *) base + offset); } static __inline__ void xf86WriteMmio8(__volatile__ void *base, const unsigned long offset, const unsigned int val) { *(volatile unsigned char *) ((unsigned char *) base + offset) = val; barrier(); } static __inline__ unsigned short xf86ReadMmio16Swap(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned short ret; __asm__ __volatile__("lhi %0, [%1];\n\t" "wsbh %0, %0;\n\t":"=r"(ret) :"r"(addr)); return ret; } static __inline__ unsigned short xf86ReadMmio16(__volatile__ void *base, const unsigned long offset) { return *(volatile unsigned short *) ((char *) base + offset); } static __inline__ void xf86WriteMmio16Swap(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("wsbh %0, %0;\n\t" "shi %0, [%1];\n\t": /* No outputs */ :"r"(val), "r"(addr)); barrier(); } static __inline__ void xf86WriteMmio16(__volatile__ void *base, const unsigned long offset, const unsigned int val) { *(volatile unsigned short *) ((unsigned char *) base + offset) = val; barrier(); } static __inline__ unsigned int xf86ReadMmio32Swap(__volatile__ void *base, const unsigned long offset) { unsigned long addr = ((unsigned long) base) + offset; unsigned int ret; __asm__ __volatile__("lwi %0, [%1];\n\t" "wsbh %0, %0;\n\t" "rotri %0, %0, 16;\n\t":"=r"(ret) :"r"(addr)); return ret; } static __inline__ unsigned int xf86ReadMmio32(__volatile__ void *base, const unsigned long offset) { return *(volatile unsigned int *) ((unsigned char *) base + offset); } static __inline__ void xf86WriteMmio32Swap(__volatile__ void *base, const unsigned long offset, const unsigned int val) { unsigned long addr = ((unsigned long) base) + offset; __asm__ __volatile__("wsbh %0, %0;\n\t" "rotri %0, %0, 16;\n\t" "swi %0, [%1];\n\t": /* No outputs */ :"r"(val), "r"(addr)); barrier(); } static __inline__ void xf86WriteMmio32(__volatile__ void *base, const unsigned long offset, const unsigned int val) { *(volatile unsigned int *) ((unsigned char *) base + offset) = val; barrier(); } #if defined(NDS32_MMIO_SWAP) static __inline__ void outb(unsigned PORT_SIZE port, unsigned char val) { xf86WriteMmio8(IOPortBase, port, val); } static __inline__ void outw(unsigned PORT_SIZE port, unsigned short val) { xf86WriteMmio16Swap(IOPortBase, port, val); } static __inline__ void outl(unsigned PORT_SIZE port, unsigned int val) { xf86WriteMmio32Swap(IOPortBase, port, val); } static __inline__ unsigned int inb(unsigned PORT_SIZE port) { return xf86ReadMmio8(IOPortBase, port); } static __inline__ unsigned int inw(unsigned PORT_SIZE port) { return xf86ReadMmio16Swap(IOPortBase, port); } static __inline__ unsigned int inl(unsigned PORT_SIZE port) { return xf86ReadMmio32Swap(IOPortBase, port); } #else /* !NDS32_MMIO_SWAP */ static __inline__ void outb(unsigned PORT_SIZE port, unsigned char val) { *(volatile unsigned char *) (((unsigned PORT_SIZE) (port))) = val; barrier(); } static __inline__ void outw(unsigned PORT_SIZE port, unsigned short val) { *(volatile unsigned short *) (((unsigned PORT_SIZE) (port))) = val; barrier(); } static __inline__ void outl(unsigned PORT_SIZE port, unsigned int val) { *(volatile unsigned int *) (((unsigned PORT_SIZE) (port))) = val; barrier(); } static __inline__ unsigned int inb(unsigned PORT_SIZE port) { return *(volatile unsigned char *) (((unsigned PORT_SIZE) (port))); } static __inline__ unsigned int inw(unsigned PORT_SIZE port) { return *(volatile unsigned short *) (((unsigned PORT_SIZE) (port))); } static __inline__ unsigned int inl(unsigned PORT_SIZE port) { return *(volatile unsigned int *) (((unsigned PORT_SIZE) (port))); } #endif /* NDS32_MMIO_SWAP */ #elif defined(__i386__) || defined(__ia64__) static __inline__ void outb(unsigned short port, unsigned char val) { __asm__ __volatile__("out%B0 (%1)"::"a"(val), "d"(port)); } static __inline__ void outw(unsigned short port, unsigned short val) { __asm__ __volatile__("out%W0 (%1)"::"a"(val), "d"(port)); } static __inline__ void outl(unsigned short port, unsigned int val) { __asm__ __volatile__("out%L0 (%1)"::"a"(val), "d"(port)); } static __inline__ unsigned int inb(unsigned short port) { unsigned char ret; __asm__ __volatile__("in%B0 (%1)":"=a"(ret):"d"(port)); return ret; } static __inline__ unsigned int inw(unsigned short port) { unsigned short ret; __asm__ __volatile__("in%W0 (%1)":"=a"(ret):"d"(port)); return ret; } static __inline__ unsigned int inl(unsigned short port) { unsigned int ret; __asm__ __volatile__("in%L0 (%1)":"=a"(ret):"d"(port)); return ret; } #endif /* arch madness */ #else /* !GNUC */ #if defined(__STDC__) && (__STDC__ == 1) #ifndef asm #define asm __asm #endif #endif #if !defined(__SUNPRO_C) #include #endif #endif /* __GNUC__ */ #if !defined(MMIO_IS_BE) && \ (defined(SPARC_MMIO_IS_BE) || defined(PPC_MMIO_IS_BE)) #define MMIO_IS_BE #endif #ifdef __alpha__ /* entry points for Mmio memory access routines */ extern _X_EXPORT int (*xf86ReadMmio8) (void *, unsigned long); extern _X_EXPORT int (*xf86ReadMmio16) (void *, unsigned long); #ifndef STANDALONE_MMIO extern _X_EXPORT int (*xf86ReadMmio32) (void *, unsigned long); #else /* Some DRI 3D drivers need MMIO_IN32. */ static __inline__ int xf86ReadMmio32(void *Base, unsigned long Offset) { mem_barrier(); return *(volatile unsigned int *) ((unsigned long) Base + (Offset)); } #endif extern _X_EXPORT void (*xf86WriteMmio8) (int, void *, unsigned long); extern _X_EXPORT void (*xf86WriteMmio16) (int, void *, unsigned long); extern _X_EXPORT void (*xf86WriteMmio32) (int, void *, unsigned long); extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); /* Some macros to hide the system dependencies for MMIO accesses */ /* Changed to kill noise generated by gcc's -Wcast-align */ #define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset) #define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset) #ifndef STANDALONE_MMIO #define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset) #else #define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) #endif #define MMIO_OUT32(base, offset, val) \ do { \ write_mem_barrier(); \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \ } while (0) #define MMIO_OUT8(base, offset, val) \ (*xf86WriteMmio8)((CARD8)(val), base, offset) #define MMIO_OUT16(base, offset, val) \ (*xf86WriteMmio16)((CARD16)(val), base, offset) #elif defined(__powerpc__) || defined(__sparc__) /* * we provide byteswapping and no byteswapping functions here * with byteswapping as default, * drivers that don't need byteswapping should define MMIO_IS_BE */ #define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) #define MMIO_OUT8(base, offset, val) \ xf86WriteMmio8(base, offset, (CARD8)(val)) #if defined(MMIO_IS_BE) /* No byteswapping */ #define MMIO_IN16(base, offset) xf86ReadMmio16Be(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32Be(base, offset) #define MMIO_OUT16(base, offset, val) \ xf86WriteMmio16Be(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32Be(base, offset, (CARD32)(val)) #else /* byteswapping is the default */ #define MMIO_IN16(base, offset) xf86ReadMmio16Le(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32Le(base, offset) #define MMIO_OUT16(base, offset, val) \ xf86WriteMmio16Le(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32Le(base, offset, (CARD32)(val)) #endif #elif defined(__nds32__) /* * we provide byteswapping and no byteswapping functions here * with no byteswapping as default; when endianness of CPU core * and I/O devices don't match, byte swapping is necessary * drivers that need byteswapping should define NDS32_MMIO_SWAP */ #define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) #define MMIO_OUT8(base, offset, val) \ xf86WriteMmio8(base, offset, (CARD8)(val)) #if defined(NDS32_MMIO_SWAP) /* byteswapping */ #define MMIO_IN16(base, offset) xf86ReadMmio16Swap(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32Swap(base, offset) #define MMIO_OUT16(base, offset, val) \ xf86WriteMmio16Swap(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32Swap(base, offset, (CARD32)(val)) #else /* no byteswapping is the default */ #define MMIO_IN16(base, offset) xf86ReadMmio16(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) #define MMIO_OUT16(base, offset, val) \ xf86WriteMmio16(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32(base, offset, (CARD32)(val)) #endif #else /* !__alpha__ && !__powerpc__ && !__sparc__ */ #define MMIO_IN8(base, offset) \ *(volatile CARD8 *)(((CARD8*)(base)) + (offset)) #define MMIO_IN16(base, offset) \ *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) #define MMIO_IN32(base, offset) \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) #define MMIO_OUT8(base, offset, val) \ *(volatile CARD8 *)(((CARD8*)(base)) + (offset)) = (val) #define MMIO_OUT16(base, offset, val) \ *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) = (val) #define MMIO_OUT32(base, offset, val) \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val) #endif /* __alpha__ */ /* * With Intel, the version in os-support/misc/SlowBcopy.s is used. * This avoids port I/O during the copy (which causes problems with * some hardware). */ #ifdef __alpha__ #define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count) #define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count) #else /* __alpha__ */ #define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count) #define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count) #endif /* __alpha__ */ #endif /* _COMPILER_H */ xorg-server-1.17.1/hw/xfree86/common/xf86pciBus.c0000664000175100017510000013210612366751547016336 00000000000000/* * 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). */ /* * This file contains the interfaces to the bus-specific code */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include #include "os.h" #include "Pci.h" #include "xf86.h" #include "xf86Priv.h" #include "dirent.h" /* DIR, FILE type definitions */ /* Bus-specific headers */ #include "xf86Bus.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" #define PCI_VENDOR_GENERIC 0x00FF /* Bus-specific globals */ int pciSlotClaimed = 0; #define PCIINFOCLASSES(c) \ ( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \ || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \ || ((((c) & 0x00ffff00) \ == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) \ || ((((c) & 0x00ffff00) \ == ((PCI_CLASS_PROCESSOR << 16) | (PCI_SUBCLASS_PROCESSOR_COPROC << 8)))) ) /* * PCI classes that have messages printed always. The others are only * have a message printed when the vendor/dev IDs are recognised. */ #define PCIALWAYSPRINTCLASSES(c) \ ( (((c) & 0x00ffff00) \ == ((PCI_CLASS_PREHISTORIC << 16) | (PCI_SUBCLASS_PREHISTORIC_VGA << 8))) \ || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \ || ((((c) & 0x00ffff00) \ == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) ) #define IS_VGA(c) \ (((c) & 0x00ffff00) \ == ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8))) static struct pci_slot_match xf86IsolateDevice = { PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0 }; /* * xf86Bus.c interface */ void xf86PciProbe(void) { int i = 0, k; int num = 0; struct pci_device *info; struct pci_device_iterator *iter; struct pci_device **xf86PciVideoInfo = NULL; if (!xf86scanpci()) { xf86PciVideoInfo = NULL; return; } iter = pci_slot_match_iterator_create(&xf86IsolateDevice); while ((info = pci_device_next(iter)) != NULL) { if (PCIINFOCLASSES(info->device_class)) { num++; xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo, (sizeof(struct pci_device *) * (num + 1))); xf86PciVideoInfo[num] = NULL; xf86PciVideoInfo[num - 1] = info; pci_device_probe(info); if (primaryBus.type == BUS_NONE && pci_device_is_boot_vga(info)) { primaryBus.type = BUS_PCI; primaryBus.id.pci = info; } info->user_data = 0; } } free(iter); /* If we haven't found a primary device try a different heuristic */ if (primaryBus.type == BUS_NONE && num) { for (i = 0; i < num; i++) { uint16_t command; info = xf86PciVideoInfo[i]; pci_device_cfg_read_u16(info, &command, 4); if ((command & PCI_CMD_MEM_ENABLE) && ((num == 1) || IS_VGA(info->device_class))) { if (primaryBus.type == BUS_NONE) { primaryBus.type = BUS_PCI; primaryBus.id.pci = info; } else { xf86Msg(X_NOTICE, "More than one possible primary device found\n"); primaryBus.type ^= (BusType) (-1); } } } } /* Print a summary of the video devices found */ for (k = 0; k < num; k++) { const char *prim = " "; Bool memdone = FALSE, iodone = FALSE; info = xf86PciVideoInfo[k]; if (!PCIALWAYSPRINTCLASSES(info->device_class)) continue; if (xf86IsPrimaryPci(info)) prim = "*"; xf86Msg(X_PROBED, "PCI:%s(%u:%u:%u:%u) %04x:%04x:%04x:%04x ", prim, info->domain, info->bus, info->dev, info->func, info->vendor_id, info->device_id, info->subvendor_id, info->subdevice_id); xf86ErrorF("rev %d", info->revision); for (i = 0; i < 6; i++) { struct pci_mem_region *r = &info->regions[i]; if (r->size && !r->is_IO) { if (!memdone) { xf86ErrorF(", Mem @ "); memdone = TRUE; } else xf86ErrorF(", "); xf86ErrorF("0x%08lx/%ld", (long) r->base_addr, (long) r->size); } } for (i = 0; i < 6; i++) { struct pci_mem_region *r = &info->regions[i]; if (r->size && r->is_IO) { if (!iodone) { xf86ErrorF(", I/O @ "); iodone = TRUE; } else xf86ErrorF(", "); xf86ErrorF("0x%08lx/%ld", (long) r->base_addr, (long) r->size); } } if (info->rom_size) { xf86ErrorF(", BIOS @ 0x\?\?\?\?\?\?\?\?/%ld", (long) info->rom_size); } xf86ErrorF("\n"); } free(xf86PciVideoInfo); } /* * If the slot requested is already in use, return -1. * Otherwise, claim the slot for the screen requesting it. */ int xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp, int chipset, GDevPtr dev, Bool active) { EntityPtr p = NULL; int num; if (xf86CheckPciSlot(d)) { num = xf86AllocateEntity(); p = xf86Entities[num]; p->driver = drvp; p->chipset = chipset; p->bus.type = BUS_PCI; p->bus.id.pci = d; p->active = active; p->inUse = FALSE; if (dev) xf86AddDevToEntity(num, dev); pciSlotClaimed++; return num; } else return -1; } /* * Unclaim PCI slot, e.g. if probing failed, so that a different driver can claim. */ void xf86UnclaimPciSlot(struct pci_device *d, GDevPtr dev) { int i; for (i = 0; i < xf86NumEntities; i++) { const EntityPtr p = xf86Entities[i]; 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; } } } /* * Parse a BUS ID string, and return the PCI bus parameters if it was * in the correct format for a PCI bus id. */ Bool xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func) { /* * The format is assumed to be "bus[@domain]:device[:func]", where domain, * bus, device and func are decimal integers. domain and func may be * omitted and assumed to be zero, although doing this isn't encouraged. */ char *p, *s, *d; const char *id; int i; if (StringToBusType(busID, &id) != BUS_PCI) return FALSE; s = xstrdup(id); p = strtok(s, ":"); if (p == NULL || *p == 0) { free(s); return FALSE; } d = strpbrk(p, "@"); if (d != NULL) { *(d++) = 0; for (i = 0; d[i] != 0; i++) { if (!isdigit(d[i])) { free(s); return FALSE; } } } for (i = 0; p[i] != 0; i++) { if (!isdigit(p[i])) { free(s); return FALSE; } } *bus = atoi(p); if (d != NULL && *d != 0) *bus += atoi(d) << 8; p = strtok(NULL, ":"); if (p == NULL || *p == 0) { free(s); return FALSE; } for (i = 0; p[i] != 0; i++) { if (!isdigit(p[i])) { free(s); return FALSE; } } *device = atoi(p); *func = 0; p = strtok(NULL, ":"); if (p == NULL || *p == 0) { free(s); return TRUE; } for (i = 0; p[i] != 0; i++) { if (!isdigit(p[i])) { free(s); return FALSE; } } *func = atoi(p); free(s); return TRUE; } /* * Compare a BUS ID string with a PCI bus id. Return TRUE if they match. */ Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func) { int ibus, idevice, ifunc; if (xf86ParsePciBusString(busID, &ibus, &idevice, &ifunc)) { return bus == ibus && device == idevice && func == ifunc; } else { return FALSE; } } /* * xf86IsPrimaryPci() -- return TRUE if primary device * is PCI and bus, dev and func numbers match. */ Bool xf86IsPrimaryPci(struct pci_device *pPci) { 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; } /* * xf86GetPciInfoForEntity() -- Get the pciVideoRec of entity. */ struct pci_device * xf86GetPciInfoForEntity(int entityIndex) { EntityPtr p; if (entityIndex >= xf86NumEntities) return NULL; p = xf86Entities[entityIndex]; 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; } /* * xf86CheckPciMemBase() checks that the memory base value matches one of the * PCI base address register values for the given PCI device. */ Bool xf86CheckPciMemBase(struct pci_device *pPci, memType base) { int i; for (i = 0; i < 6; i++) if (base == pPci->regions[i].base_addr) return TRUE; return FALSE; } /* * Check if the slot requested is free. If it is already in use, return FALSE. */ Bool xf86CheckPciSlot(const struct pci_device *d) { int i; for (i = 0; i < xf86NumEntities; i++) { const EntityPtr p = xf86Entities[i]; 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; } #define END_OF_MATCHES(m) \ (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0)) Bool xf86PciAddMatchingDev(DriverPtr drvp) { const struct pci_id_match *const devices = drvp->supported_devices; int j; struct pci_device *pPci; struct pci_device_iterator *iter; int numFound = 0; iter = pci_id_match_iterator_create(NULL); while ((pPci = pci_device_next(iter)) != NULL) { /* Determine if this device is supported by the driver. If it is, * add it to the list of devices to configure. */ for (j = 0; !END_OF_MATCHES(devices[j]); j++) { if (PCI_ID_COMPARE(devices[j].vendor_id, pPci->vendor_id) && PCI_ID_COMPARE(devices[j].device_id, pPci->device_id) && ((devices[j].device_class_mask & pPci->device_class) == devices[j].device_class)) { if (xf86CheckPciSlot(pPci)) { GDevPtr pGDev = xf86AddBusDeviceToConfigure(drvp->driverName, BUS_PCI, pPci, -1); if (pGDev != NULL) { /* After configure pass 1, chipID and chipRev are * treated as over-rides, so clobber them here. */ pGDev->chipID = -1; pGDev->chipRev = -1; } numFound++; } break; } } } pci_iterator_destroy(iter); return numFound != 0; } Bool xf86PciProbeDev(DriverPtr drvp) { int i, j; struct pci_device *pPci; Bool foundScreen = FALSE; const struct pci_id_match *const devices = drvp->supported_devices; GDevPtr *devList; const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList); for (i = 0; i < numDevs; i++) { struct pci_device_iterator *iter; unsigned device_id; /* Find the pciVideoRec associated with this device section. */ iter = pci_id_match_iterator_create(NULL); while ((pPci = pci_device_next(iter)) != NULL) { if (devList[i]->busID && *devList[i]->busID) { if (xf86ComparePciBusString(devList[i]->busID, ((pPci->domain << 8) | pPci->bus), pPci->dev, pPci->func)) { break; } } else if (xf86IsPrimaryPci(pPci)) { break; } } pci_iterator_destroy(iter); if (pPci == NULL) { continue; } device_id = (devList[i]->chipID > 0) ? devList[i]->chipID : pPci->device_id; /* Once the pciVideoRec is found, determine if the device is supported * by the driver. If it is, probe it! */ for (j = 0; !END_OF_MATCHES(devices[j]); j++) { if (PCI_ID_COMPARE(devices[j].vendor_id, pPci->vendor_id) && PCI_ID_COMPARE(devices[j].device_id, device_id) && ((devices[j].device_class_mask & pPci->device_class) == devices[j].device_class)) { int entry; /* Allow the same entity to be used more than once for * devices with multiple screens per entity. This assumes * implicitly that there will be a screen == 0 instance. * * FIXME Need to make sure that two different drivers don't * FIXME claim the same screen > 0 instance. */ if ((devList[i]->screen == 0) && !xf86CheckPciSlot(pPci)) continue; DebugF("%s: card at %d:%d:%d is claimed by a Device section\n", drvp->driverName, pPci->bus, pPci->dev, pPci->func); /* Allocate an entry in the lists to be returned */ entry = xf86ClaimPciSlot(pPci, drvp, device_id, devList[i], devList[i]->active); if ((entry == -1) && (devList[i]->screen > 0)) { unsigned k; for (k = 0; k < xf86NumEntities; k++) { EntityPtr pEnt = xf86Entities[k]; if (pEnt->bus.type != BUS_PCI) continue; if (pEnt->bus.id.pci == pPci) { entry = k; xf86AddDevToEntity(k, devList[i]); break; } } } if (entry != -1) { if ((*drvp->PciProbe) (drvp, entry, pPci, devices[j].match_data)) { foundScreen = TRUE; } else xf86UnclaimPciSlot(pPci, devList[i]); } break; } } } free(devList); return foundScreen; } void xf86PciIsolateDevice(const char *argument) { int bus, device, func; if (sscanf(argument, "PCI:%d:%d:%d", &bus, &device, &func) == 3) { xf86IsolateDevice.domain = PCI_DOM_FROM_BUS(bus); xf86IsolateDevice.bus = PCI_BUS_NO_DOMAIN(bus); xf86IsolateDevice.dev = device; xf86IsolateDevice.func = func; } else FatalError("Invalid isolated device specification\n"); } static Bool pciDeviceHasBars(struct pci_device *pci) { int i; for (i = 0; i < 6; i++) if (pci->regions[i].size) return TRUE; if (pci->rom_size) return TRUE; return FALSE; } struct Inst { struct pci_device *pci; GDevPtr dev; Bool foundHW; /* PCIid in list of supported chipsets */ Bool claimed; /* BusID matches with a device section */ int chip; int screen; }; /** * Find set of unclaimed devices matching a given vendor ID. * * Used by drivers to find as yet unclaimed devices matching the specified * vendor ID. * * \param driverName Name of the driver. This is used to find Device * sections in the config file. * \param vendorID PCI vendor ID of associated devices. If zero, then * the true vendor ID must be encoded in the \c PCIid * fields of the \c PCIchipsets entries. * \param chipsets Symbol table used to associate chipset names with * PCI IDs. * \param devList List of Device sections parsed from the config file. * \param numDevs Number of entries in \c devList. * \param drvp Pointer the driver's control structure. * \param foundEntities Returned list of entity indicies associated with the * driver. * * \returns * The number of elements in returned in \c foundEntities on success or zero * on failure. * * \todo * This function does a bit more than short description says. Fill in some * more of the details of its operation. * * \todo * The \c driverName parameter is redundant. It is the same as * \c DriverRec::driverName. In a future version of this function, remove * that parameter. */ int xf86MatchPciInstances(const char *driverName, int vendorID, SymTabPtr chipsets, PciChipsets * PCIchipsets, GDevPtr * devList, int numDevs, DriverPtr drvp, int **foundEntities) { int i, j; struct pci_device *pPci; struct pci_device_iterator *iter; struct Inst *instances = NULL; int numClaimedInstances = 0; int allocatedInstances = 0; int numFound = 0; SymTabRec *c; PciChipsets *id; int *retEntities = NULL; *foundEntities = NULL; /* Each PCI device will contribute at least one entry. Each device * section can contribute at most one entry. The sum of the two is * guaranteed to be larger than the maximum possible number of entries. * Do this calculation and memory allocation once now to eliminate the * need for realloc calls inside the loop. */ if (!(xf86DoConfigure && xf86DoConfigurePass1)) { unsigned max_entries = numDevs; iter = pci_slot_match_iterator_create(NULL); while ((pPci = pci_device_next(iter)) != NULL) { max_entries++; } pci_iterator_destroy(iter); instances = xnfalloc(max_entries * sizeof(struct Inst)); } iter = pci_slot_match_iterator_create(NULL); while ((pPci = pci_device_next(iter)) != NULL) { unsigned device_class = pPci->device_class; Bool foundVendor = FALSE; /* Convert the pre-PCI 2.0 device class for a VGA adapter to the * 2.0 version of the same class. */ if (device_class == 0x00000101) { device_class = 0x00030000; } /* Find PCI devices that match the given vendor ID. The vendor ID is * either specified explicitly as a parameter to the function or * implicitly encoded in the high bits of id->PCIid. * * The first device with a matching vendor is recorded, even if the * device ID doesn't match. This is done because the Device section * in the xorg.conf file can over-ride the device ID. A matching PCI * ID might not be found now, but after the device ID over-ride is * applied there /might/ be a match. */ for (id = PCIchipsets; id->PCIid != -1; id++) { const unsigned vendor_id = ((id->PCIid & 0xFFFF0000) >> 16) | vendorID; const unsigned device_id = (id->PCIid & 0x0000FFFF); const unsigned match_class = 0x00030000 | id->PCIid; if ((vendor_id == pPci->vendor_id) || ((vendorID == PCI_VENDOR_GENERIC) && (match_class == device_class))) { if (!foundVendor && (instances != NULL)) { ++allocatedInstances; instances[allocatedInstances - 1].pci = pPci; instances[allocatedInstances - 1].dev = NULL; instances[allocatedInstances - 1].claimed = FALSE; instances[allocatedInstances - 1].foundHW = FALSE; instances[allocatedInstances - 1].screen = 0; } foundVendor = TRUE; if ((device_id == pPci->device_id) || ((vendorID == PCI_VENDOR_GENERIC) && (match_class == device_class))) { if (instances != NULL) { instances[allocatedInstances - 1].foundHW = TRUE; instances[allocatedInstances - 1].chip = id->numChipset; } if (xf86DoConfigure && xf86DoConfigurePass1) { if (xf86CheckPciSlot(pPci)) { GDevPtr pGDev = xf86AddBusDeviceToConfigure(drvp->driverName, BUS_PCI, pPci, -1); if (pGDev) { /* After configure pass 1, chipID and chipRev * are treated as over-rides, so clobber them * here. */ pGDev->chipID = -1; pGDev->chipRev = -1; } numFound++; } } else { numFound++; } break; } } } } pci_iterator_destroy(iter); /* In "probe only" or "configure" mode (signaled by instances being NULL), * our work is done. Return the number of detected devices. */ if (instances == NULL) { return numFound; } /* * This may be debatable, but if no PCI devices with a matching vendor * type is found, return zero now. It is probably not desirable to * allow the config file to override this. */ if (allocatedInstances <= 0) { free(instances); return 0; } DebugF("%s instances found: %d\n", driverName, allocatedInstances); /* * Check for devices that need duplicated instances. This is required * when there is more than one screen per entity. * * XXX This currently doesn't work for cases where the BusID isn't * specified explicitly in the config file. */ for (j = 0; j < numDevs; j++) { if (devList[j]->screen > 0 && devList[j]->busID && *devList[j]->busID) { for (i = 0; i < allocatedInstances; i++) { pPci = instances[i].pci; if (xf86ComparePciBusString(devList[j]->busID, PCI_MAKE_BUS(pPci->domain, pPci->bus), pPci->dev, pPci->func)) { allocatedInstances++; instances[allocatedInstances - 1] = instances[i]; instances[allocatedInstances - 1].screen = devList[j]->screen; numFound++; break; } } } } for (i = 0; i < allocatedInstances; i++) { GDevPtr dev = NULL; GDevPtr devBus = NULL; pPci = instances[i].pci; for (j = 0; j < numDevs; j++) { if (devList[j]->busID && *devList[j]->busID) { if (xf86ComparePciBusString(devList[j]->busID, PCI_MAKE_BUS(pPci->domain, pPci->bus), pPci->dev, pPci->func) && devList[j]->screen == instances[i].screen) { if (devBus) xf86MsgVerb(X_WARNING, 0, "%s: More than one matching Device section for " "instances\n\t(BusID: %s) found: %s\n", driverName, devList[j]->busID, devList[j]->identifier); else devBus = devList[j]; } } else { /* * if device section without BusID is found * only assign to it to the primary device. */ if (xf86IsPrimaryPci(pPci)) { xf86Msg(X_PROBED, "Assigning device section with no busID" " to primary device\n"); if (dev || devBus) xf86MsgVerb(X_WARNING, 0, "%s: More than one matching Device section " "found: %s\n", driverName, devList[j]->identifier); else dev = devList[j]; } } } if (devBus) dev = devBus; /* busID preferred */ if (!dev) { if (xf86CheckPciSlot(pPci) && pciDeviceHasBars(pPci)) { xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " "for instance (BusID PCI:%u@%u:%u:%u) found\n", driverName, pPci->domain, pPci->bus, pPci->dev, pPci->func); } } else { numClaimedInstances++; instances[i].claimed = TRUE; instances[i].dev = dev; } } DebugF("%s instances found: %d\n", driverName, numClaimedInstances); /* * Now check that a chipset or chipID override in the device section * is valid. Chipset has precedence over chipID. * If chipset is not valid ignore BusSlot completely. */ for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) { MessageType from = X_PROBED; if (!instances[i].claimed) { continue; } if (instances[i].dev->chipset) { for (c = chipsets; c->token >= 0; c++) { if (xf86NameCmp(c->name, instances[i].dev->chipset) == 0) break; } if (c->token == -1) { instances[i].claimed = FALSE; numClaimedInstances--; xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device " "section \"%s\" isn't valid for this driver\n", driverName, instances[i].dev->chipset, instances[i].dev->identifier); } else { instances[i].chip = c->token; for (id = PCIchipsets; id->numChipset >= 0; id++) { if (id->numChipset == instances[i].chip) break; } if (id->numChipset >= 0) { xf86Msg(X_CONFIG, "Chipset override: %s\n", instances[i].dev->chipset); from = X_CONFIG; } else { instances[i].claimed = FALSE; numClaimedInstances--; xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device " "section \"%s\" isn't a valid PCI chipset\n", driverName, instances[i].dev->chipset, instances[i].dev->identifier); } } } else if (instances[i].dev->chipID > 0) { for (id = PCIchipsets; id->numChipset >= 0; id++) { if (id->PCIid == instances[i].dev->chipID) break; } if (id->numChipset == -1) { instances[i].claimed = FALSE; numClaimedInstances--; xf86MsgVerb(X_WARNING, 0, "%s: ChipID 0x%04X in Device " "section \"%s\" isn't valid for this driver\n", driverName, instances[i].dev->chipID, instances[i].dev->identifier); } else { instances[i].chip = id->numChipset; xf86Msg(X_CONFIG, "ChipID override: 0x%04X\n", instances[i].dev->chipID); from = X_CONFIG; } } else if (!instances[i].foundHW) { /* * This means that there was no override and the PCI chipType * doesn't match one that is supported */ instances[i].claimed = FALSE; numClaimedInstances--; } if (instances[i].claimed == TRUE) { for (c = chipsets; c->token >= 0; c++) { if (c->token == instances[i].chip) break; } xf86Msg(from, "Chipset %s found\n", c->name); } } /* * Of the claimed instances, check that another driver hasn't already * claimed its slot. */ numFound = 0; for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) { if (!instances[i].claimed) continue; pPci = instances[i].pci; /* * Allow the same entity to be used more than once for devices with * multiple screens per entity. This assumes implicitly that there * will be a screen == 0 instance. * * XXX Need to make sure that two different drivers don't claim * the same screen > 0 instance. */ if (instances[i].screen == 0 && !xf86CheckPciSlot(pPci)) continue; DebugF("%s: card at %d:%d:%d is claimed by a Device section\n", driverName, pPci->bus, pPci->dev, pPci->func); /* Allocate an entry in the lists to be returned */ numFound++; retEntities = xnfrealloc(retEntities, numFound * sizeof(int)); retEntities[numFound - 1] = xf86ClaimPciSlot(pPci, drvp, instances[i].chip, instances[i].dev, instances[i].dev->active); if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) { for (j = 0; j < xf86NumEntities; j++) { EntityPtr pEnt = xf86Entities[j]; if (pEnt->bus.type != BUS_PCI) continue; if (pEnt->bus.id.pci == pPci) { retEntities[numFound - 1] = j; xf86AddDevToEntity(j, instances[i].dev); break; } } } } free(instances); if (numFound > 0) { *foundEntities = retEntities; } return numFound; } /* * xf86ConfigPciEntityInactive() -- This function can be used * to configure an inactive entity as well as to reconfigure an * previously active entity inactive. If the entity has been * assigned to a screen before it will be removed. If p_chip is * non-NULL all static resources listed there will be registered. */ static void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets * p_chip, EntityProc init, EntityProc enter, EntityProc leave, void *private) { ScrnInfoPtr pScrn; if ((pScrn = xf86FindScreenForEntity(pEnt->index))) xf86RemoveEntityFromScreen(pScrn, pEnt->index); /* shared resources are only needed when entity is active: remove */ xf86SetEntityFuncs(pEnt->index, init, enter, leave, private); } ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, PciChipsets * p_chip, void *dummy, EntityProc init, EntityProc enter, EntityProc leave, void *private) { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return pScrn; if (!(pEnt->location.type == BUS_PCI) || !xf86GetPciInfoForEntity(entityIndex)) { free(pEnt); return pScrn; } if (!pEnt->active) { xf86ConfigPciEntityInactive(pEnt, p_chip, init, enter, leave, private); free(pEnt); return pScrn; } if (!pScrn) pScrn = xf86AllocateScreen(pEnt->driver, scrnFlag); if (xf86IsEntitySharable(entityIndex)) { xf86SetEntityShared(entityIndex); } xf86AddEntityToScreen(pScrn, entityIndex); if (xf86IsEntityShared(entityIndex)) { return pScrn; } free(pEnt); xf86SetEntityFuncs(entityIndex, init, enter, leave, private); return pScrn; } int xf86VideoPtrToDriverList(struct pci_device *dev, char *returnList[], int returnListMax) { int i; /* Add more entries here if we ever return more than 4 drivers for any device */ const char *driverList[5] = { NULL, NULL, NULL, NULL, NULL }; switch (dev->vendor_id) { /* AMD Geode LX */ case 0x1022: if (dev->device_id == 0x2081) driverList[0] = "geode"; break; /* older Geode products acquired by AMD still carry an NSC vendor_id */ case 0x100b: if (dev->device_id == 0x0030) { /* NSC Geode GX2 specifically */ driverList[0] = "geode"; /* GX2 support started its life in the NSC tree and was later forked by AMD for GEODE so we keep it as a backup */ driverList[1] = "nsc"; } else /* other NSC variant e.g. 0x0104 (SC1400), 0x0504 (SCx200) */ driverList[0] = "nsc"; break; /* Cyrix Geode GX1 */ case 0x1078: if (dev->device_id == 0x0104) driverList[0] = "cyrix"; break; case 0x1142: driverList[0] = "apm"; break; case 0xedd8: driverList[0] = "ark"; break; case 0x1a03: driverList[0] = "ast"; break; case 0x1002: driverList[0] = "ati"; break; case 0x102c: driverList[0] = "chips"; break; case 0x1013: driverList[0] = "cirrus"; break; case 0x3d3d: driverList[0] = "glint"; break; case 0x105d: driverList[0] = "i128"; break; case 0x8086: 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: driverList[0] = "mga"; break; case 0x10c8: driverList[0] = "neomagic"; break; case 0x10de: case 0x12d2: { int idx = 0; #ifdef __linux__ driverList[idx++] = "nouveau"; #endif driverList[idx++] = "nv"; break; } case 0x1106: driverList[0] = "openchrome"; break; case 0x1b36: driverList[0] = "qxl"; break; case 0x1163: driverList[0] = "rendition"; break; case 0x5333: switch (dev->device_id) { case 0x88d0: case 0x88d1: case 0x88f0: case 0x8811: case 0x8812: case 0x8814: case 0x8901: driverList[0] = "s3"; break; case 0x5631: case 0x883d: case 0x8a01: case 0x8a10: case 0x8c01: case 0x8c03: case 0x8904: case 0x8a13: driverList[0] = "s3virge"; break; default: driverList[0] = "savage"; break; } break; case 0x1039: driverList[0] = "sis"; break; case 0x126f: driverList[0] = "siliconmotion"; break; case 0x121a: if (dev->device_id < 0x0003) driverList[0] = "voodoo"; else driverList[0] = "tdfx"; break; case 0x1011: driverList[0] = "tga"; break; case 0x1023: driverList[0] = "trident"; break; case 0x100c: driverList[0] = "tseng"; break; case 0x80ee: driverList[0] = "vboxvideo"; break; case 0x15ad: driverList[0] = "vmware"; break; case 0x18ca: if (dev->device_id == 0x47) driverList[0] = "xgixp"; else driverList[0] = "xgi"; break; default: break; } for (i = 0; (i < returnListMax) && (driverList[i] != NULL); i++) { returnList[i] = xnfstrdup(driverList[i]); } return i; /* Number of entries added */ } #ifdef __linux__ static int xchomp(char *line) { size_t len = 0; if (!line) { return 1; } len = strlen(line); if (line[len - 1] == '\n' && len > 0) { line[len - 1] = '\0'; } return 0; } /* This function is used to provide a workaround for binary drivers that * 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 */ int xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, char *matches[], int nmatches) { DIR *idsdir; FILE *fp; struct dirent *direntry; char *line = NULL; size_t len; ssize_t read; char path_name[256], vendor_str[5], chip_str[5]; uint16_t vendor, chip; int i = 0, j; idsdir = opendir(PCI_TXT_IDS_PATH); if (!idsdir) return 0; xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", PCI_TXT_IDS_PATH); direntry = readdir(idsdir); /* Read the directory */ while (direntry) { if (direntry->d_name[0] == '.') { direntry = readdir(idsdir); continue; } len = strlen(direntry->d_name); /* A tiny bit of sanity checking. We should probably do better */ if (strncmp(&(direntry->d_name[len - 4]), ".ids", 4) == 0) { /* We need the full path name to open the file */ snprintf(path_name, sizeof(path_name), "%s/%s", PCI_TXT_IDS_PATH, direntry->d_name); fp = fopen(path_name, "r"); if (fp == NULL) { xf86Msg(X_ERROR, "Could not open %s for reading. Exiting.\n", path_name); goto end; } /* Read the file */ #ifdef __GLIBC__ while ((read = getline(&line, &len, fp)) != -1) { #else while ((line = fgetln(fp, &len)) != (char *) NULL) { #endif /* __GLIBC __ */ xchomp(line); if (isdigit(line[0])) { strlcpy(vendor_str, line, sizeof(vendor_str)); vendor = (int) strtol(vendor_str, NULL, 16); if ((strlen(&line[4])) == 0) { chip_str[0] = '\0'; chip = -1; } else { /* Handle trailing whitespace */ if (isspace(line[4])) { chip_str[0] = '\0'; chip = -1; } else { /* Ok, it's a real ID */ strlcpy(chip_str, &line[4], sizeof(chip_str)); chip = (int) strtol(chip_str, NULL, 16); } } if (vendor == match_vendor && chip == match_chip) { matches[i] = (char *) malloc(sizeof(char) * strlen(direntry->d_name) - 3); if (!matches[i]) { xf86Msg(X_ERROR, "Could not allocate space for the module name. Exiting.\n"); goto end; } /* hack off the .ids suffix. This should guard * against other problems, but it will end up * taking off anything after the first '.' */ for (j = 0; j < (strlen(direntry->d_name) - 3); j++) { if (direntry->d_name[j] == '.') { matches[i][j] = '\0'; break; } else { matches[i][j] = direntry->d_name[j]; } } xf86Msg(X_INFO, "Matched %s from file name %s\n", matches[i], direntry->d_name); i++; } } else { /* TODO Handle driver overrides here */ } } fclose(fp); } direntry = readdir(idsdir); } end: free(line); closedir(idsdir); return i; } #endif /* __linux__ */ /** * @return The numbers of found devices that match with the current system * drivers. */ int xf86PciMatchDriver(char *matches[], int nmatches) { int i = 0; struct pci_device *info = NULL; struct pci_device_iterator *iter; /* Find the primary device, and get some information about it. */ iter = pci_slot_match_iterator_create(NULL); while ((info = pci_device_next(iter)) != NULL) { if (xf86IsPrimaryPci(info)) { break; } } pci_iterator_destroy(iter); #ifdef __linux__ if (info) i += xf86MatchDriverFromFiles(info->vendor_id, info->device_id, matches, nmatches); #endif if ((info != NULL) && (i < nmatches)) { i += xf86VideoPtrToDriverList(info, &(matches[i]), nmatches - i); } return i; } Bool xf86PciConfigure(void *busData, struct pci_device *pDev) { struct pci_device *pVideo = NULL; pVideo = (struct pci_device *) busData; if (pDev && (pDev->domain == pVideo->domain) && (pDev->bus == pVideo->bus) && (pDev->dev == pVideo->dev) && (pDev->func == pVideo->func)) return 0; return 1; } void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, GDevRec * GDev, int *chipset) { char busnum[8]; char *tmp; pVideo = (struct pci_device *) busData; if (pVideo->bus < 256) snprintf(busnum, sizeof(busnum), "%d", pVideo->bus); else snprintf(busnum, sizeof(busnum), "%d@%d", pVideo->bus & 0x00ff, pVideo->bus >> 8); XNFasprintf(&tmp, "PCI:%s:%d:%d", busnum, pVideo->dev, pVideo->func); GDev->busID = tmp; GDev->chipID = pVideo->device_id; GDev->chipRev = pVideo->revision; if (*chipset < 0) *chipset = (pVideo->vendor_id << 16) | pVideo->device_id; } xorg-server-1.17.1/hw/xfree86/common/xf86sbusBus.c0000664000175100017510000005514712366220413016527 00000000000000/* * SBUS bus-specific code. * * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com) * * 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 * JAKUB JELINEK 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_XORG_CONFIG_H #include #endif #include #include #include #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86cmap.h" #include "xf86Bus.h" #include "xf86sbusBus.h" #include "xf86Sbus.h" Bool sbusSlotClaimed = FALSE; static int xf86nSbusInfo; static void CheckSbusDevice(const char *device, int fbNum) { int fd, i; struct fbgattr fbattr; sbusDevicePtr psdp; fd = open(device, O_RDONLY, 0); if (fd < 0) return; memset(&fbattr, 0, sizeof(fbattr)); if (ioctl(fd, FBIOGATTR, &fbattr) < 0) { if (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0) { close(fd); return; } } close(fd); for (i = 0; sbusDeviceTable[i].devId; i++) if (sbusDeviceTable[i].fbType == fbattr.fbtype.fb_type) break; if (!sbusDeviceTable[i].devId) return; xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (++xf86nSbusInfo + 1)); xf86SbusInfo[xf86nSbusInfo] = NULL; xf86SbusInfo[xf86nSbusInfo - 1] = psdp = xnfcalloc(sizeof(sbusDevice), 1); psdp->devId = sbusDeviceTable[i].devId; psdp->fbNum = fbNum; psdp->device = xnfstrdup(device); psdp->width = fbattr.fbtype.fb_width; psdp->height = fbattr.fbtype.fb_height; psdp->fd = -1; } void xf86SbusProbe(void) { int i, useProm = 0; char fbDevName[32]; sbusDevicePtr psdp, *psdpp; xf86SbusInfo = malloc(sizeof(psdp)); *xf86SbusInfo = NULL; for (i = 0; i < 32; i++) { snprintf(fbDevName, sizeof(fbDevName), "/dev/fb%d", i); CheckSbusDevice(fbDevName, i); } if (sparcPromInit() >= 0) { useProm = 1; sparcPromAssignNodes(); } for (psdpp = xf86SbusInfo; (psdp = *psdpp); psdpp++) { for (i = 0; sbusDeviceTable[i].devId; i++) if (sbusDeviceTable[i].devId == psdp->devId) psdp->descr = sbusDeviceTable[i].descr; /* * If we can use PROM information and found the PROM node for this * device, we can tell more about the card. */ if (useProm && psdp->node.node) { char *prop, *promPath; int len, chiprev, vmsize; switch (psdp->devId) { case SBUS_DEVICE_MGX: prop = sparcPromGetProperty(&psdp->node, "fb_size", &len); if (prop && len == 4 && *(int *) prop == 0x400000) psdp->descr = "Quantum 3D MGXplus with 4M VRAM"; break; case SBUS_DEVICE_CG6: chiprev = 0; vmsize = 0; prop = sparcPromGetProperty(&psdp->node, "chiprev", &len); if (prop && len == 4) chiprev = *(int *) prop; prop = sparcPromGetProperty(&psdp->node, "vmsize", &len); if (prop && len == 4) vmsize = *(int *) prop; switch (chiprev) { case 1: case 2: case 3: case 4: psdp->descr = "Sun Double width GX"; break; case 5: case 6: case 7: case 8: case 9: psdp->descr = "Sun Single width GX"; break; case 11: switch (vmsize) { case 2: psdp->descr = "Sun Turbo GX with 1M VSIMM"; break; case 4: psdp->descr = "Sun Turbo GX Plus"; break; default: psdp->descr = "Sun Turbo GX"; break; } } break; case SBUS_DEVICE_CG14: prop = sparcPromGetProperty(&psdp->node, "reg", &len); vmsize = 0; if (prop && !(len % 12) && len > 0) vmsize = *(int *) (prop + len - 4); switch (vmsize) { case 0x400000: psdp->descr = "Sun SX with 4M VSIMM"; break; case 0x800000: psdp->descr = "Sun SX with 8M VSIMM"; break; } break; case SBUS_DEVICE_LEO: prop = sparcPromGetProperty(&psdp->node, "model", &len); if (prop && len > 0 && !strstr(prop, "501-2503")) psdp->descr = "Sun Turbo ZX"; break; case SBUS_DEVICE_TCX: if (sparcPromGetBool(&psdp->node, "tcx-8-bit")) psdp->descr = "Sun TCX (8bit)"; else psdp->descr = "Sun TCX (S24)"; break; case SBUS_DEVICE_FFB: prop = sparcPromGetProperty(&psdp->node, "name", &len); chiprev = 0; prop = sparcPromGetProperty(&psdp->node, "board_type", &len); if (prop && len == 4) chiprev = *(int *) prop; if (strstr(prop, "afb")) { if (chiprev == 3) psdp->descr = "Sun|Elite3D-M6 Horizontal"; } else { switch (chiprev) { case 0x08: psdp->descr = "Sun FFB 67MHz Creator"; break; case 0x0b: psdp->descr = "Sun FFB 67MHz Creator 3D"; break; case 0x1b: psdp->descr = "Sun FFB 75MHz Creator 3D"; break; case 0x20: case 0x28: psdp->descr = "Sun FFB2 Vertical Creator"; break; case 0x23: case 0x2b: psdp->descr = "Sun FFB2 Vertical Creator 3D"; break; case 0x30: psdp->descr = "Sun FFB2+ Vertical Creator"; break; case 0x33: psdp->descr = "Sun FFB2+ Vertical Creator 3D"; break; case 0x40: case 0x48: psdp->descr = "Sun FFB2 Horizontal Creator"; break; case 0x43: case 0x4b: psdp->descr = "Sun FFB2 Horizontal Creator 3D"; break; } } break; } xf86Msg(X_PROBED, "SBUS:(0x%08x) %s", psdp->node.node, psdp->descr); promPath = sparcPromNode2Pathname(&psdp->node); if (promPath) { xf86ErrorF(" at %s", promPath); free(promPath); } } else xf86Msg(X_PROBED, "SBUS: %s", psdp->descr); xf86ErrorF("\n"); } if (useProm) sparcPromClose(); } /* * Parse a BUS ID string, and return the SBUS bus parameters if it was * in the correct format for a SBUS bus id. */ Bool xf86ParseSbusBusString(const char *busID, int *fbNum) { /* * The format is assumed to be one of: * "fbN", e.g. "fb1", which means the device corresponding to /dev/fbN * "nameN", e.g. "cgsix0", which means Nth instance of card NAME * "/prompath", e.g. "/sbus@0,10001000/cgsix@3,0" which is PROM pathname * to the device. */ const char *id; int i, len; if (StringToBusType(busID, &id) != BUS_SBUS) return FALSE; if (*id != '/') { if (!strncmp(id, "fb", 2)) { if (!isdigit(id[2])) return FALSE; *fbNum = atoi(id + 2); return TRUE; } else { sbusDevicePtr *psdpp; int devId; for (i = 0, len = 0; sbusDeviceTable[i].devId; i++) { len = strlen(sbusDeviceTable[i].promName); if (!strncmp(sbusDeviceTable[i].promName, id, len) && isdigit(id[len])) break; } devId = sbusDeviceTable[i].devId; if (!devId) return FALSE; i = atoi(id + len); for (psdpp = xf86SbusInfo; *psdpp; ++psdpp) { if ((*psdpp)->devId != devId) continue; if (!i) { *fbNum = (*psdpp)->fbNum; return TRUE; } i--; } } return FALSE; } if (sparcPromInit() >= 0) { i = sparcPromPathname2Node(id); sparcPromClose(); if (i) { sbusDevicePtr *psdpp; for (psdpp = xf86SbusInfo; *psdpp; ++psdpp) { if ((*psdpp)->node.node == i) { *fbNum = (*psdpp)->fbNum; return TRUE; } } } } return FALSE; } /* * Compare a BUS ID string with a SBUS bus id. Return TRUE if they match. */ Bool xf86CompareSbusBusString(const char *busID, int fbNum) { int iFbNum; if (xf86ParseSbusBusString(busID, &iFbNum)) { return fbNum == iFbNum; } else { return FALSE; } } /* * Check if the slot requested is free. If it is already in use, return FALSE. */ Bool xf86CheckSbusSlot(int fbNum) { int i; EntityPtr p; for (i = 0; i < xf86NumEntities; i++) { p = xf86Entities[i]; /* Check if this SBUS slot is taken */ if (p->bus.type == BUS_SBUS && p->bus.id.sbus.fbNum == fbNum) return FALSE; } return TRUE; } /* * If the slot requested is already in use, return -1. * Otherwise, claim the slot for the screen requesting it. */ int xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp, GDevPtr dev, Bool active) { EntityPtr p = NULL; int num; if (xf86CheckSbusSlot(psdp->fbNum)) { num = xf86AllocateEntity(); p = xf86Entities[num]; p->driver = drvp; p->chipset = -1; p->bus.type = BUS_SBUS; xf86AddDevToEntity(num, dev); p->bus.id.sbus.fbNum = psdp->fbNum; p->active = active; p->inUse = FALSE; sbusSlotClaimed = TRUE; return num; } else return -1; } int xf86MatchSbusInstances(const char *driverName, int sbusDevId, GDevPtr * devList, int numDevs, DriverPtr drvp, int **foundEntities) { int i, j; sbusDevicePtr psdp, *psdpp; int numClaimedInstances = 0; int allocatedInstances = 0; int numFound = 0; GDevPtr devBus = NULL; GDevPtr dev = NULL; int *retEntities = NULL; int useProm = 0; struct Inst { sbusDevicePtr sbus; GDevPtr dev; Bool claimed; /* BusID matches with a device section */ } *instances = NULL; *foundEntities = NULL; for (psdpp = xf86SbusInfo, psdp = *psdpp; psdp; psdp = *++psdpp) { if (psdp->devId != sbusDevId) continue; if (psdp->fd == -2) continue; ++allocatedInstances; instances = xnfrealloc(instances, allocatedInstances * sizeof(struct Inst)); instances[allocatedInstances - 1].sbus = psdp; instances[allocatedInstances - 1].dev = NULL; instances[allocatedInstances - 1].claimed = FALSE; numFound++; } /* * This may be debatable, but if no SBUS devices with a matching vendor * type is found, return zero now. It is probably not desirable to * allow the config file to override this. */ if (allocatedInstances <= 0) { free(instances); return 0; } if (sparcPromInit() >= 0) useProm = 1; if (xf86DoConfigure && xf86DoConfigurePass1) { GDevPtr pGDev; int actualcards = 0; for (i = 0; i < allocatedInstances; i++) { actualcards++; pGDev = xf86AddBusDeviceToConfigure(drvp->driverName, BUS_SBUS, instances[i].sbus, -1); if (pGDev) { /* * XF86Match???Instances() treat chipID and chipRev as * overrides, so clobber them here. */ pGDev->chipID = pGDev->chipRev = -1; } } free(instances); if (useProm) sparcPromClose(); return actualcards; } DebugF("%s instances found: %d\n", driverName, allocatedInstances); for (i = 0; i < allocatedInstances; i++) { char *promPath = NULL; psdp = instances[i].sbus; devBus = NULL; dev = NULL; if (useProm && psdp->node.node) promPath = sparcPromNode2Pathname(&psdp->node); for (j = 0; j < numDevs; j++) { if (devList[j]->busID && *devList[j]->busID) { if (xf86CompareSbusBusString(devList[j]->busID, psdp->fbNum)) { if (devBus) xf86MsgVerb(X_WARNING, 0, "%s: More than one matching Device section for " "instance (BusID: %s) found: %s\n", driverName, devList[j]->identifier, devList[j]->busID); else devBus = devList[j]; } } else { if (!dev && !devBus) { if (promPath) xf86Msg(X_PROBED, "Assigning device section with no busID to SBUS:%s\n", promPath); else xf86Msg(X_PROBED, "Assigning device section with no busID to SBUS:fb%d\n", psdp->fbNum); dev = devList[j]; } else xf86MsgVerb(X_WARNING, 0, "%s: More than one matching Device section " "found: %s\n", driverName, devList[j]->identifier); } } if (devBus) dev = devBus; /* busID preferred */ if (!dev && psdp->fd != -2) { if (promPath) { xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " "for instance (BusID SBUS:%s) found\n", driverName, promPath); } else xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " "for instance (BusID SBUS:fb%d) found\n", driverName, psdp->fbNum); } else if (dev) { numClaimedInstances++; instances[i].claimed = TRUE; instances[i].dev = dev; } free(promPath); } DebugF("%s instances found: %d\n", driverName, numClaimedInstances); /* * Of the claimed instances, check that another driver hasn't already * claimed its slot. */ numFound = 0; for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) { if (!instances[i].claimed) continue; psdp = instances[i].sbus; if (!xf86CheckSbusSlot(psdp->fbNum)) continue; DebugF("%s: card at fb%d %08x is claimed by a Device section\n", driverName, psdp->fbNum, psdp->node.node); /* Allocate an entry in the lists to be returned */ numFound++; retEntities = xnfrealloc(retEntities, numFound * sizeof(int)); retEntities[numFound - 1] = xf86ClaimSbusSlot(psdp, drvp, instances[i].dev, instances[i].dev->active ? TRUE : FALSE); } free(instances); if (numFound > 0) { *foundEntities = retEntities; } if (useProm) sparcPromClose(); return numFound; } /* * xf86GetSbusInfoForEntity() -- Get the sbusDevicePtr of entity. */ sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex) { sbusDevicePtr *psdpp; EntityPtr p = xf86Entities[entityIndex]; if (entityIndex >= xf86NumEntities || p->bus.type != BUS_SBUS) return NULL; for (psdpp = xf86SbusInfo; *psdpp != NULL; psdpp++) { if (p->bus.id.sbus.fbNum == (*psdpp)->fbNum) return *psdpp; } return NULL; } int xf86GetEntityForSbusInfo(sbusDevicePtr psdp) { int i; for (i = 0; i < xf86NumEntities; i++) { EntityPtr p = xf86Entities[i]; if (p->bus.type != BUS_SBUS) continue; if (p->bus.id.sbus.fbNum == psdp->fbNum) return i; } return -1; } void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp) { DisplayModePtr mode; mode = xnfcalloc(sizeof(DisplayModeRec), 1); mode->name = "current"; mode->next = mode; mode->prev = mode; mode->type = M_T_BUILTIN; mode->Clock = 100000000; mode->HDisplay = psdp->width; mode->HSyncStart = psdp->width; mode->HSyncEnd = psdp->width; mode->HTotal = psdp->width; mode->VDisplay = psdp->height; mode->VSyncStart = psdp->height; mode->VSyncEnd = psdp->height; mode->VTotal = psdp->height; mode->SynthClock = mode->Clock; mode->CrtcHDisplay = mode->HDisplay; mode->CrtcHSyncStart = mode->HSyncStart; mode->CrtcHSyncEnd = mode->HSyncEnd; mode->CrtcHTotal = mode->HTotal; mode->CrtcVDisplay = mode->VDisplay; mode->CrtcVSyncStart = mode->VSyncStart; mode->CrtcVSyncEnd = mode->VSyncEnd; mode->CrtcVTotal = mode->VTotal; mode->CrtcHAdjusted = FALSE; mode->CrtcVAdjusted = FALSE; pScrn->modes = mode; pScrn->virtualX = psdp->width; pScrn->virtualY = psdp->height; } static DevPrivateKeyRec sbusPaletteKeyRec; #define sbusPaletteKey (&sbusPaletteKeyRec) typedef struct _sbusCmap { sbusDevicePtr psdp; CloseScreenProcPtr CloseScreen; Bool origCmapValid; unsigned char origRed[16]; unsigned char origGreen[16]; unsigned char origBlue[16]; } sbusCmapRec, *sbusCmapPtr; #define SBUSCMAPPTR(pScreen) ((sbusCmapPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, sbusPaletteKey)) static void xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { int i, index; sbusCmapPtr cmap; struct fbcmap fbcmap; unsigned char *data; cmap = SBUSCMAPPTR(pScrn->pScreen); if (!cmap) return; fbcmap.count = 0; fbcmap.index = indices[0]; fbcmap.red = data = malloc(numColors * 3); if (!data) return; fbcmap.green = data + numColors; fbcmap.blue = fbcmap.green + numColors; for (i = 0; i < numColors; i++) { index = indices[i]; if (fbcmap.count && index != fbcmap.index + fbcmap.count) { ioctl(cmap->psdp->fd, FBIOPUTCMAP, &fbcmap); fbcmap.count = 0; fbcmap.index = index; } fbcmap.red[fbcmap.count] = colors[index].red; fbcmap.green[fbcmap.count] = colors[index].green; fbcmap.blue[fbcmap.count++] = colors[index].blue; } ioctl(cmap->psdp->fd, FBIOPUTCMAP, &fbcmap); free(data); } static Bool xf86SbusCmapCloseScreen(ScreenPtr pScreen) { sbusCmapPtr cmap; struct fbcmap fbcmap; cmap = SBUSCMAPPTR(pScreen); if (cmap->origCmapValid) { fbcmap.index = 0; fbcmap.count = 16; fbcmap.red = cmap->origRed; fbcmap.green = cmap->origGreen; fbcmap.blue = cmap->origBlue; ioctl(cmap->psdp->fd, FBIOPUTCMAP, &fbcmap); } pScreen->CloseScreen = cmap->CloseScreen; free(cmap); return (*pScreen->CloseScreen) (pScreen); } Bool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp) { sbusCmapPtr cmap; struct fbcmap fbcmap; unsigned char data[2]; if (!dixRegisterPrivateKey(sbusPaletteKey, PRIVATE_SCREEN, 0)) FatalError("Cannot register sbus private key"); cmap = xnfcalloc(1, sizeof(sbusCmapRec)); dixSetPrivate(&pScreen->devPrivates, sbusPaletteKey, cmap); cmap->psdp = psdp; fbcmap.index = 0; fbcmap.count = 16; fbcmap.red = cmap->origRed; fbcmap.green = cmap->origGreen; fbcmap.blue = cmap->origBlue; if (ioctl(psdp->fd, FBIOGETCMAP, &fbcmap) >= 0) cmap->origCmapValid = TRUE; fbcmap.index = 0; fbcmap.count = 2; fbcmap.red = data; fbcmap.green = data; fbcmap.blue = data; if (pScreen->whitePixel == 0) { data[0] = 255; data[1] = 0; } else { data[0] = 0; data[1] = 255; } ioctl(psdp->fd, FBIOPUTCMAP, &fbcmap); cmap->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86SbusCmapCloseScreen; return xf86HandleColormaps(pScreen, 256, 8, xf86SbusCmapLoadPalette, NULL, 0); } Bool xf86SbusConfigure(void *busData, sbusDevicePtr sBus) { if (sBus && sBus->fbNum == ((sbusDevicePtr) busData)->fbNum) return 0; return 1; } void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev) { char *promPath = NULL; sBus = (sbusDevicePtr) busData; GDev->identifier = sBus->descr; if (sparcPromInit() >= 0) { promPath = sparcPromNode2Pathname(&sBus->node); sparcPromClose(); } if (promPath) { XNFasprintf(&GDev->busID, "SBUS:%s", promPath); free(promPath); } else { XNFasprintf(&GDev->busID, "SBUS:fb%d", sBus->fbNum); } } xorg-server-1.17.1/hw/xfree86/common/xisb.h0000664000175100017510000000503112274325511015325 00000000000000/* * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ #ifndef _xisb_H_ #define _xisb_H_ #include /****************************************************************************** * Definitions * structs, typedefs, #defines, enums *****************************************************************************/ typedef struct _XISBuffer { int fd; int trace; int block_duration; ssize_t current; /* bytes read */ ssize_t end; ssize_t buffer_size; unsigned char *buf; } XISBuffer; /****************************************************************************** * Declarations * variables: use xisb_LOC in front * of globals. * put locals in the .c file. *****************************************************************************/ extern _X_EXPORT XISBuffer *XisbNew(int fd, ssize_t size); extern _X_EXPORT void XisbFree(XISBuffer * b); extern _X_EXPORT int XisbRead(XISBuffer * b); extern _X_EXPORT ssize_t XisbWrite(XISBuffer * b, unsigned char *msg, ssize_t len); extern _X_EXPORT void XisbTrace(XISBuffer * b, int trace); extern _X_EXPORT void XisbBlockDuration(XISBuffer * b, int block_duration); /* * DO NOT PUT ANYTHING AFTER THIS ENDIF */ #endif xorg-server-1.17.1/hw/xfree86/common/xf86VGAarbiterPriv.h0000664000175100017510000003115312362011462017722 00000000000000/* * Copyright (c) 2009 Tiago Vignatti * * 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. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include #include "colormapst.h" #include "scrnintstr.h" #include "screenint.h" #include "gcstruct.h" #include "pixmapstr.h" #include "pixmap.h" #include "windowstr.h" #include "window.h" #include "xf86str.h" #include "mipointer.h" #include "mipointrst.h" #include "picturestr.h" #define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x; pScreen->x = y;} #define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x #define SCREEN_PRIV() ((VGAarbiterScreenPtr) dixLookupPrivate(&(pScreen)->devPrivates, VGAarbiterScreenKey)) #define SCREEN_PROLOG(x) (pScreen->x = SCREEN_PRIV()->x) #define SCREEN_EPILOG(x,y) do { \ SCREEN_PRIV()->x = pScreen->x; \ pScreen->x = y; \ } while (0) #define WRAP_PICT(x,y) if (ps) {pScreenPriv->x = ps->x;\ ps->x = y;} #define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;} #define PICTURE_PROLOGUE(field) ps->field = \ ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \ VGAarbiterScreenKey))->field #define PICTURE_EPILOGUE(field, wrap) ps->field = wrap #define WRAP_SCREEN_INFO(x,y) do {pScreenPriv->x = pScrn->x; pScrn->x = y;} while(0) #define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x #define SPRITE_PROLOG miPointerScreenPtr PointPriv = \ (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, \ miPointerScreenKey); VGAarbiterScreenPtr pScreenPriv = \ ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \ VGAarbiterScreenKey)); PointPriv->spriteFuncs = pScreenPriv->miSprite; #define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\ PointPriv->spriteFuncs = &VGAarbiterSpriteFuncs; #define WRAP_SPRITE do { pScreenPriv->miSprite = PointPriv->spriteFuncs;\ PointPriv->spriteFuncs = &VGAarbiterSpriteFuncs; \ } while (0) #define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite #define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\ pGCPriv->wrapFuncs = (x)->funcs; (x)->ops = &VGAarbiterGCOps;\ (x)->funcs = &VGAarbiterGCFuncs; #define GC_UNWRAP(x) VGAarbiterGCPtr pGCPriv = \ (VGAarbiterGCPtr)dixLookupPrivate(&(x)->devPrivates, VGAarbiterGCKey);\ (x)->ops = pGCPriv->wrapOps; (x)->funcs = pGCPriv->wrapFuncs; static inline void VGAGet(ScreenPtr pScreen) { pci_device_vgaarb_set_target(xf86ScreenToScrn(pScreen)->vgaDev); pci_device_vgaarb_lock(); } static inline void VGAPut(void) { pci_device_vgaarb_unlock(); } typedef struct _VGAarbiterScreen { CreateGCProcPtr CreateGC; CloseScreenProcPtr CloseScreen; ScreenBlockHandlerProcPtr BlockHandler; ScreenWakeupHandlerProcPtr WakeupHandler; GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; SourceValidateProcPtr SourceValidate; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; CreatePixmapProcPtr CreatePixmap; SaveScreenProcPtr SaveScreen; /* Colormap */ StoreColorsProcPtr StoreColors; /* Cursor */ DisplayCursorProcPtr DisplayCursor; RealizeCursorProcPtr RealizeCursor; UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; SetCursorPositionProcPtr SetCursorPosition; void (*AdjustFrame) (ScrnInfoPtr, int, int); Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); Bool (*EnterVT) (ScrnInfoPtr); void (*LeaveVT) (ScrnInfoPtr); void (*FreeScreen) (ScrnInfoPtr); miPointerSpriteFuncPtr miSprite; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; CompositeRectsProcPtr CompositeRects; } VGAarbiterScreenRec, *VGAarbiterScreenPtr; typedef struct _VGAarbiterGC { const GCOps *wrapOps; const GCFuncs *wrapFuncs; } VGAarbiterGCRec, *VGAarbiterGCPtr; /* Screen funcs */ static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask); static void VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, void *pReadmask); 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); static void VGAarbiterGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); static void VGAarbiterSourceValidate(DrawablePtr pDrawable, int x, int y, int width, int height, unsigned int subWindowMode); static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); static void VGAarbiterClearToBackground(WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures); static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned int usage_hint); static Bool VGAarbiterCreateGC(GCPtr pGC); static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank); static void VGAarbiterStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs); static void VGAarbiterRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, Bool displayed); static Bool VGAarbiterRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static Bool VGAarbiterUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static Bool VGAarbiterDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); static Bool VGAarbiterSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent); 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, DrawablePtr pDraw); static void VGAarbiterChangeGC(GCPtr pGC, unsigned long mask); static void VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void VGAarbiterDestroyGC(GCPtr pGC); static void VGAarbiterChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); static void VGAarbiterDestroyClip(GCPtr pGC); static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc); /* GC ops */ static void VGAarbiterFillSpans(DrawablePtr pDraw, GC * pGC, int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted); static void VGAarbiterSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc, register DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); static void VGAarbiterPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage); static RegionPtr VGAarbiterCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GC * pGC, int srcx, int srcy, int width, int height, int dstx, int dsty); static RegionPtr VGAarbiterCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bitPlane); static void VGAarbiterPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode, int npt, xPoint * pptInit); static void VGAarbiterPolylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit); static void VGAarbiterPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSeg); static void VGAarbiterPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRectsInit, xRectangle *pRectsInit); static void VGAarbiterPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs); static void VGAarbiterFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, int mode, int count, DDXPointPtr ptsIn); static void VGAarbiterPolyFillRect(DrawablePtr pDraw, GCPtr pGC, int nrectFill, xRectangle *prectInit); static void VGAarbiterPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs); static int VGAarbiterPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars); static int VGAarbiterPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void VGAarbiterImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars); static void VGAarbiterImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void VGAarbiterImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); static void VGAarbiterPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); static void VGAarbiterPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg); /* miSpriteFuncs */ static Bool VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur); static Bool VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur); static void VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y); static void VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); static Bool VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen); static void VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); static void VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); static void VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); static void VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects); xorg-server-1.17.1/hw/xfree86/common/xisb.c0000664000175100017510000001206712366220413015324 00000000000000/* * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ /* X Input Serial Buffer routines for use in any XInput driver that accesses a serial device. */ /***************************************************************************** * Standard Headers ****************************************************************************/ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include #include "xisb.h" /***************************************************************************** * Local Headers ****************************************************************************/ /***************************************************************************** * Variables without includable headers ****************************************************************************/ /***************************************************************************** * Local Variables ****************************************************************************/ /***************************************************************************** * Function Definitions ****************************************************************************/ XISBuffer * XisbNew(int fd, ssize_t size) { XISBuffer *b; b = malloc(sizeof(XISBuffer)); if (!b) return NULL; b->buf = malloc((sizeof(unsigned char) * size)); if (!b->buf) { free(b); return NULL; } b->fd = fd; b->trace = 0; b->block_duration = 0; b->current = 1; /* force it to be past the end to trigger initial read */ b->end = 0; b->buffer_size = size; return b; } void XisbFree(XISBuffer * b) { free(b->buf); free(b); } int XisbRead(XISBuffer * b) { int ret; if (b->current >= b->end) { if (b->block_duration >= 0) { if (xf86WaitForInput(b->fd, b->block_duration) < 1) return -1; } else { /* * automatically clear it so if XisbRead is called in a loop * the next call will make sure there is data with select and * thus prevent a blocking read */ b->block_duration = 0; } ret = xf86ReadSerial(b->fd, b->buf, b->buffer_size); switch (ret) { case 0: return -1; /* timeout */ case -1: return -2; /* error */ default: b->end = ret; b->current = 0; break; } } if (b->trace) ErrorF("read 0x%02x (%c)\n", b->buf[b->current], isprint(b->buf[b->current]) ? b->buf[b->current] : '.'); return b->buf[b->current++]; } /* the only purpose of this function is to provide output tracing */ ssize_t XisbWrite(XISBuffer * b, unsigned char *msg, ssize_t len) { if (b->trace) { int i = 0; for (i = 0; i < len; i++) ErrorF("\t\twrote 0x%02x (%c)\n", msg[i], msg[i]); } return (xf86WriteSerial(b->fd, msg, len)); } /* turn tracing of this buffer on (1) or off (0) */ void XisbTrace(XISBuffer * b, int trace) { b->trace = trace; } /* * specify a block_duration of -1 when you know the buffer's fd is ready to * read. After a read, it is automatically set to 0 so that the next read * will use check to select for data and prevent a block. * It is the caller's responsibility to set the block_duration to -1 if it * knows that there is data to read (because the main select loop triggered * the read) and want's to avoid the unnecessary overhead of the select call * * a zero or positive block duration will cause the select to block for the * give duration in usecs. */ void XisbBlockDuration(XISBuffer * b, int block_duration) { b->block_duration = block_duration; } xorg-server-1.17.1/hw/xfree86/common/xf86platformBus.h0000664000175100017510000001301712375515627017410 00000000000000/* * 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; int flags; }; /* xf86_platform_device flags */ #define XF86_PDEV_UNOWNED 0x01 #define XF86_PDEV_SERVER_FD 0x02 #define XF86_PDEV_PAUSED 0x04 #ifdef XSERVER_PLATFORM_BUS int xf86platformProbe(void); int xf86platformProbeDev(DriverPtr drvp); extern int xf86_num_platform_devices; extern struct xf86_platform_device *xf86_platform_devices; extern int xf86_add_platform_device(struct OdevAttributes *attribs, Bool unowned); extern int xf86_remove_platform_device(int dev_index); extern Bool xf86_get_platform_device_unowned(int index); extern int xf86platformAddDevice(int index); extern void xf86platformRemoveDevice(int index); static inline struct OdevAttributes * xf86_platform_device_odev_attributes(struct xf86_platform_device *device) { return device->attribs; } static inline struct OdevAttributes * xf86_platform_odev_attributes(int index) { struct xf86_platform_device *device = &xf86_platform_devices[index]; return device->attribs; } #ifndef _XORG_CONFIG_H_ /* * Define the legacy API only for external builds */ /* 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 /* Server managed FD */ #define ODEV_ATTRIB_FD 4 /* Major number of the device node pointed to by ODEV_ATTRIB_PATH */ #define ODEV_ATTRIB_MAJOR 5 /* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */ #define ODEV_ATTRIB_MINOR 6 /* kernel driver name */ #define ODEV_ATTRIB_DRIVER 7 /* Protect against a mismatch attribute type by generating a compiler * error using a negative array size when an incorrect attribute is * passed */ #define _ODEV_ATTRIB_IS_STRING(x) ((x) == ODEV_ATTRIB_PATH || \ (x) == ODEV_ATTRIB_SYSPATH || \ (x) == ODEV_ATTRIB_BUSID || \ (x) == ODEV_ATTRIB_DRIVER) #define _ODEV_ATTRIB_STRING_CHECK(x) ((int (*)[_ODEV_ATTRIB_IS_STRING(x)-1]) 0) static inline char * _xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0]) { switch (attrib) { case ODEV_ATTRIB_PATH: return xf86_platform_device_odev_attributes(device)->path; case ODEV_ATTRIB_SYSPATH: return xf86_platform_device_odev_attributes(device)->syspath; case ODEV_ATTRIB_BUSID: return xf86_platform_device_odev_attributes(device)->busid; case ODEV_ATTRIB_DRIVER: return xf86_platform_device_odev_attributes(device)->driver; default: assert(FALSE); return NULL; } } #define xf86_get_platform_device_attrib(device, attrib) _xf86_get_platform_device_attrib(device,attrib,_ODEV_ATTRIB_STRING_CHECK(attrib)) #define _ODEV_ATTRIB_IS_INT(x) ((x) == ODEV_ATTRIB_FD || (x) == ODEV_ATTRIB_MAJOR || (x) == ODEV_ATTRIB_MINOR) #define _ODEV_ATTRIB_INT_DEFAULT(x) ((x) == ODEV_ATTRIB_FD ? -1 : 0) #define _ODEV_ATTRIB_DEFAULT_CHECK(x,def) (_ODEV_ATTRIB_INT_DEFAULT(x) == (def)) #define _ODEV_ATTRIB_INT_CHECK(x,def) ((int (*)[_ODEV_ATTRIB_IS_INT(x)*_ODEV_ATTRIB_DEFAULT_CHECK(x,def)-1]) 0) static inline int _xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0]) { switch (attrib) { case ODEV_ATTRIB_FD: return xf86_platform_device_odev_attributes(device)->fd; case ODEV_ATTRIB_MAJOR: return xf86_platform_device_odev_attributes(device)->major; case ODEV_ATTRIB_MINOR: return xf86_platform_device_odev_attributes(device)->minor; default: assert(FALSE); return 0; } } #define xf86_get_platform_device_int_attrib(device, attrib, def) _xf86_get_platform_device_int_attrib(device,attrib,_ODEV_ATTRIB_INT_CHECK(attrib,def)) #endif extern _X_EXPORT Bool xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid); extern _X_EXPORT int xf86PlatformMatchDriver(char *matches[], int nmatches); extern void xf86platformVTProbe(void); extern void xf86platformPrimary(void); #endif #endif xorg-server-1.17.1/hw/xfree86/common/xf86DPMS.c0000664000175100017510000001365312366220413015640 00000000000000/* * 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). */ /* * This file contains the DPMS functions required by the extension. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "globals.h" #include "windowstr.h" #include "xf86.h" #include "xf86Priv.h" #ifdef DPMSExtension #include #include "dpmsproc.h" #endif #ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" #endif #ifdef DPMSExtension static DevPrivateKeyRec DPMSKeyRec; static DevPrivateKey DPMSKey; static Bool DPMSClose(ScreenPtr pScreen); static int DPMSCount = 0; #endif Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) { #ifdef DPMSExtension ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DPMSPtr pDPMS; void *DPMSOpt; MessageType enabled_from; DPMSKey = &DPMSKeyRec; if (!dixRegisterPrivateKey(&DPMSKeyRec, PRIVATE_SCREEN, sizeof(DPMSRec))) return FALSE; pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); pScrn->DPMSSet = set; pDPMS->Flags = flags; DPMSOpt = xf86FindOption(pScrn->options, "dpms"); if (DPMSDisabledSwitch) { enabled_from = X_CMDLINE; DPMSEnabled = FALSE; } else if (DPMSOpt) { enabled_from = X_CONFIG; DPMSEnabled = xf86CheckBoolOption(pScrn->options, "dpms", FALSE); xf86MarkOptionUsed(DPMSOpt); } else { enabled_from = X_DEFAULT; DPMSEnabled = TRUE; } if (DPMSEnabled) xf86DrvMsg(pScreen->myNum, enabled_from, "DPMS enabled\n"); pDPMS->Enabled = DPMSEnabled; pDPMS->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = DPMSClose; DPMSCount++; return TRUE; #else return FALSE; #endif } #ifdef DPMSExtension static Bool DPMSClose(ScreenPtr pScreen) { DPMSPtr pDPMS; ScrnInfoPtr pScrn; /* This shouldn't happen */ if (DPMSKey == NULL) return FALSE; pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); /* This shouldn't happen */ if (!pDPMS) 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 (pScrn->vtSema && pScrn->DPMSSet) { pScrn->DPMSSet(pScrn, DPMSModeOn, 0); } if (--DPMSCount == 0) DPMSKey = NULL; 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); } } /* * DPMSSet -- * Device dependent DPMS mode setting hook. This is called whenever * the DPMS mode is to be changed. */ int DPMSSet(ClientPtr client, int level) { int rc, i; DPMSPowerLevel = level; if (DPMSKey == NULL) return Success; if (level != DPMSModeOn) { if (xf86IsUnblank(screenIsSaved)) { rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive); if (rc != Success) return rc; } } else if (!xf86IsUnblank(screenIsSaved)) { rc = dixSaveScreens(client, SCREEN_SAVER_OFF, ScreenSaverReset); if (rc != Success) return rc; } /* For each screen, set the DPMS level */ for (i = 0; i < xf86NumScreens; i++) { 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. */ Bool DPMSSupported(void) { int i; if (DPMSKey == NULL) { return FALSE; } /* For each screen, check if DPMS is supported */ for (i = 0; i < xf86NumScreens; i++) { if (DPMSSupportedOnScreen(xf86Screens[i])) return TRUE; } for (i = 0; i < xf86NumGPUScreens; i++) { if (DPMSSupportedOnScreen(xf86GPUScreens[i])) return TRUE; } return FALSE; } #endif /* DPMSExtension */ xorg-server-1.17.1/hw/xfree86/common/fourcc.h0000664000175100017510000001027712274325511015651 00000000000000 /* * Copyright (c) 2000-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* This header file contains listings of STANDARD guids for video formats. Please do not place non-registered, or incomplete entries in this file. A list of some popular fourcc's are at: http://www.webartz.com/fourcc/ For an explanation of fourcc <-> guid mappings see RFC2361. */ #ifndef _XF86_FOURCC_H_ #define _XF86_FOURCC_H_ 1 #define FOURCC_YUY2 0x32595559 #define XVIMAGE_YUY2 \ { \ FOURCC_YUY2, \ XvYUV, \ LSBFirst, \ {'Y','U','Y','2', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 16, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 1, 1, \ {'Y','U','Y','V', \ 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}, \ XvTopToBottom \ } #define FOURCC_YV12 0x32315659 #define XVIMAGE_YV12 \ { \ FOURCC_YV12, \ XvYUV, \ LSBFirst, \ {'Y','V','1','2', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 12, \ XvPlanar, \ 3, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 2, 2, \ {'Y','V','U', \ 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}, \ XvTopToBottom \ } #define FOURCC_I420 0x30323449 #define XVIMAGE_I420 \ { \ FOURCC_I420, \ XvYUV, \ LSBFirst, \ {'I','4','2','0', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 12, \ XvPlanar, \ 3, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 2, 2, \ {'Y','U','V', \ 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}, \ XvTopToBottom \ } #define FOURCC_UYVY 0x59565955 #define XVIMAGE_UYVY \ { \ FOURCC_UYVY, \ XvYUV, \ LSBFirst, \ {'U','Y','V','Y', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 16, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 1, 1, \ {'U','Y','V','Y', \ 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}, \ XvTopToBottom \ } #define FOURCC_IA44 0x34344149 #define XVIMAGE_IA44 \ { \ FOURCC_IA44, \ XvYUV, \ LSBFirst, \ {'I','A','4','4', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 8, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 1, 1, \ 1, 1, 1, \ {'A','I', \ 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}, \ XvTopToBottom \ } #define FOURCC_AI44 0x34344941 #define XVIMAGE_AI44 \ { \ FOURCC_AI44, \ XvYUV, \ LSBFirst, \ {'A','I','4','4', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 8, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 1, 1, \ 1, 1, 1, \ {'I','A', \ 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}, \ XvTopToBottom \ } #endif /* _XF86_FOURCC_H_ */ xorg-server-1.17.1/hw/xfree86/common/xf86DGA.c0000664000175100017510000016603612366220413015474 00000000000000/* * 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 * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). * * Written by Mark Vojkovich */ /* * 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" #include "dgaproc.h" #include #include "colormapst.h" #include "pixmapstr.h" #include "inputstr.h" #include "globals.h" #include "servermd.h" #include "micmap.h" #include "xkbsrv.h" #include "xf86Xinput.h" #include "exglobals.h" #include "exevents.h" #include "eventstr.h" #include "eventconvert.h" #include "xf86Extensions.h" #include "mi.h" #include "misc.h" #include "dixstruct.h" #include "dixevents.h" #include "extnsionst.h" #include "cursorstr.h" #include "scrnintstr.h" #include "swaprep.h" #include "dgaproc.h" #include "protocol-versions.h" #include #define DGA_PROTOCOL_OLD_SUPPORT 1 static DevPrivateKeyRec DGAScreenKeyRec; #define DGAScreenKeyRegistered dixPrivateKeyRegistered(&DGAScreenKeyRec) static Bool mieq_installed; static Bool DGACloseScreen(ScreenPtr pScreen); static void DGADestroyColormap(ColormapPtr pmap); static void DGAInstallColormap(ColormapPtr pmap); static void DGAUninstallColormap(ColormapPtr pmap); static void DGAHandleEvent(int screen_num, InternalEvent *event, DeviceIntPtr device); static void DGACopyModeInfo(DGAModePtr mode, XDGAModePtr xmode); static unsigned char DGAReqCode = 0; static int DGAErrorBase; static int DGAEventBase; #define DGA_GET_SCREEN_PRIV(pScreen) ((DGAScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, &DGAScreenKeyRec)) typedef struct _FakedVisualList { Bool free; VisualPtr pVisual; struct _FakedVisualList *next; } FakedVisualList; typedef struct { ScrnInfoPtr pScrn; int numModes; DGAModePtr modes; CloseScreenProcPtr CloseScreen; DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; UninstallColormapProcPtr UninstallColormap; DGADevicePtr current; DGAFunctionPtr funcs; int input; ClientPtr client; int pixmapMode; FakedVisualList *fakedVisuals; ColormapPtr dgaColormap; ColormapPtr savedColormap; Bool grabMouse; Bool grabKeyboard; } DGAScreenRec, *DGAScreenPtr; Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes, int num) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DGAScreenPtr pScreenPriv; int i; if (!funcs || !funcs->SetMode || !funcs->OpenFramebuffer) return FALSE; if (!modes || num <= 0) return FALSE; if (!dixRegisterPrivateKey(&DGAScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (!pScreenPriv) { if (!(pScreenPriv = (DGAScreenPtr) malloc(sizeof(DGAScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, &DGAScreenKeyRec, pScreenPriv); pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = DGACloseScreen; pScreenPriv->DestroyColormap = pScreen->DestroyColormap; pScreen->DestroyColormap = DGADestroyColormap; pScreenPriv->InstallColormap = pScreen->InstallColormap; pScreen->InstallColormap = DGAInstallColormap; pScreenPriv->UninstallColormap = pScreen->UninstallColormap; pScreen->UninstallColormap = DGAUninstallColormap; } pScreenPriv->pScrn = pScrn; pScreenPriv->numModes = num; pScreenPriv->modes = modes; pScreenPriv->current = NULL; pScreenPriv->funcs = funcs; pScreenPriv->input = 0; pScreenPriv->client = NULL; pScreenPriv->fakedVisuals = NULL; pScreenPriv->dgaColormap = NULL; pScreenPriv->savedColormap = NULL; pScreenPriv->grabMouse = FALSE; pScreenPriv->grabKeyboard = FALSE; for (i = 0; i < num; i++) modes[i].num = i + 1; #ifdef PANORAMIX if (!noPanoramiXExtension) for (i = 0; i < num; i++) modes[i].flags &= ~DGA_PIXMAP_AVAILABLE; #endif return TRUE; } /* DGAReInitModes allows the driver to re-initialize * the DGA mode list. */ Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num) { DGAScreenPtr pScreenPriv; int i; /* No DGA? Ignore call (but don't make it look like it failed) */ if (!DGAScreenKeyRegistered) return TRUE; pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); /* Same as above */ if (!pScreenPriv) return TRUE; /* Can't do this while DGA is active */ if (pScreenPriv->current) return FALSE; /* Quick sanity check */ if (!num) modes = NULL; else if (!modes) num = 0; pScreenPriv->numModes = num; pScreenPriv->modes = modes; /* This practically disables DGA. So be it. */ if (!num) return TRUE; for (i = 0; i < num; i++) modes[i].num = i + 1; #ifdef PANORAMIX if (!noPanoramiXExtension) for (i = 0; i < num; i++) modes[i].flags &= ~DGA_PIXMAP_AVAILABLE; #endif return TRUE; } static void FreeMarkedVisuals(ScreenPtr pScreen) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); FakedVisualList *prev, *curr, *tmp; if (!pScreenPriv->fakedVisuals) return; prev = NULL; curr = pScreenPriv->fakedVisuals; while (curr) { if (curr->free) { tmp = curr; curr = curr->next; if (prev) prev->next = curr; else pScreenPriv->fakedVisuals = curr; free(tmp->pVisual); free(tmp); } else { prev = curr; curr = curr->next; } } } static Bool DGACloseScreen(ScreenPtr pScreen) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (mieq_installed) { mieqSetHandler(ET_DGAEvent, NULL); mieq_installed = FALSE; } FreeMarkedVisuals(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->DestroyColormap = pScreenPriv->DestroyColormap; pScreen->InstallColormap = pScreenPriv->InstallColormap; pScreen->UninstallColormap = pScreenPriv->UninstallColormap; /* DGAShutdown() should have ensured that no DGA screen were active by here */ free(pScreenPriv); return ((*pScreen->CloseScreen) (pScreen)); } static void DGADestroyColormap(ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); VisualPtr pVisual = pmap->pVisual; if (pScreenPriv->fakedVisuals) { FakedVisualList *curr = pScreenPriv->fakedVisuals; while (curr) { if (curr->pVisual == pVisual) { /* We can't get rid of them yet since FreeColormap still needs the pVisual during the cleanup */ curr->free = TRUE; break; } curr = curr->next; } } if (pScreenPriv->DestroyColormap) { pScreen->DestroyColormap = pScreenPriv->DestroyColormap; (*pScreen->DestroyColormap) (pmap); pScreen->DestroyColormap = DGADestroyColormap; } } static void DGAInstallColormap(ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (pScreenPriv->current && pScreenPriv->dgaColormap) { if (pmap != pScreenPriv->dgaColormap) { pScreenPriv->savedColormap = pmap; pmap = pScreenPriv->dgaColormap; } } pScreen->InstallColormap = pScreenPriv->InstallColormap; (*pScreen->InstallColormap) (pmap); pScreen->InstallColormap = DGAInstallColormap; } static void DGAUninstallColormap(ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (pScreenPriv->current && pScreenPriv->dgaColormap) { if (pmap == pScreenPriv->dgaColormap) { pScreenPriv->dgaColormap = NULL; } } pScreen->UninstallColormap = pScreenPriv->UninstallColormap; (*pScreen->UninstallColormap) (pmap); pScreen->UninstallColormap = DGAUninstallColormap; } int xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); DGAScreenPtr pScreenPriv; DGADevicePtr device; PixmapPtr pPix = NULL; DGAModePtr pMode = NULL; /* First check if DGAInit was successful on this screen */ if (!DGAScreenKeyRegistered) return BadValue; pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (!pScreenPriv) return BadValue; if (!num) { if (pScreenPriv->current) { PixmapPtr oldPix = pScreenPriv->current->pPix; if (oldPix) { if (oldPix->drawable.id) FreeResource(oldPix->drawable.id, RT_NONE); else (*pScreen->DestroyPixmap) (oldPix); } free(pScreenPriv->current); pScreenPriv->current = NULL; pScrn->vtSema = TRUE; (*pScreenPriv->funcs->SetMode) (pScrn, NULL); if (pScreenPriv->savedColormap) { (*pScreen->InstallColormap) (pScreenPriv->savedColormap); pScreenPriv->savedColormap = NULL; } pScreenPriv->dgaColormap = NULL; (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); FreeMarkedVisuals(pScreen); } pScreenPriv->grabMouse = FALSE; pScreenPriv->grabKeyboard = FALSE; return Success; } if (!pScrn->vtSema && !pScreenPriv->current) /* Really switched away */ return BadAlloc; if ((num > 0) && (num <= pScreenPriv->numModes)) pMode = &(pScreenPriv->modes[num - 1]); else return BadValue; if (!(device = (DGADevicePtr) malloc(sizeof(DGADeviceRec)))) return BadAlloc; if (!pScreenPriv->current) { Bool oldVTSema = pScrn->vtSema; pScrn->vtSema = FALSE; /* kludge until we rewrite VT switching */ (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); pScrn->vtSema = oldVTSema; } if (!(*pScreenPriv->funcs->SetMode) (pScrn, pMode)) { free(device); return BadAlloc; } pScrn->currentMode = pMode->mode; if (!pScreenPriv->current && !pScreenPriv->input) { /* if it's multihead we need to warp the cursor off of our screen so it doesn't get trapped */ } pScrn->vtSema = FALSE; if (pScreenPriv->current) { PixmapPtr oldPix = pScreenPriv->current->pPix; if (oldPix) { if (oldPix->drawable.id) FreeResource(oldPix->drawable.id, RT_NONE); else (*pScreen->DestroyPixmap) (oldPix); } free(pScreenPriv->current); pScreenPriv->current = NULL; } if (pMode->flags & DGA_PIXMAP_AVAILABLE) { if ((pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, pMode->depth, 0))) { (*pScreen->ModifyPixmapHeader) (pPix, pMode->pixmapWidth, pMode->pixmapHeight, pMode->depth, pMode->bitsPerPixel, pMode->bytesPerScanline, (void *) (pMode->address)); } } devRet->mode = device->mode = pMode; devRet->pPix = device->pPix = pPix; pScreenPriv->current = device; pScreenPriv->pixmapMode = FALSE; pScreenPriv->grabMouse = TRUE; pScreenPriv->grabKeyboard = TRUE; if (!mieq_installed) { mieqSetHandler(ET_DGAEvent, DGAHandleEvent); mieq_installed = TRUE; } return Success; } /*********** exported ones ***************/ void DGASetInputMode(int index, Bool keyboard, Bool mouse) { ScreenPtr pScreen = screenInfo.screens[index]; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (pScreenPriv) { pScreenPriv->grabMouse = mouse; pScreenPriv->grabKeyboard = keyboard; if (!mieq_installed) { mieqSetHandler(ET_DGAEvent, DGAHandleEvent); mieq_installed = TRUE; } } } Bool DGAChangePixmapMode(int index, int *x, int *y, int mode) { DGAScreenPtr pScreenPriv; DGADevicePtr pDev; DGAModePtr pMode; PixmapPtr pPix; if (!DGAScreenKeyRegistered) return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (!pScreenPriv || !pScreenPriv->current || !pScreenPriv->current->pPix) return FALSE; pDev = pScreenPriv->current; pPix = pDev->pPix; pMode = pDev->mode; if (mode) { int shift = 2; if (*x > (pMode->pixmapWidth - pMode->viewportWidth)) *x = pMode->pixmapWidth - pMode->viewportWidth; if (*y > (pMode->pixmapHeight - pMode->viewportHeight)) *y = pMode->pixmapHeight - pMode->viewportHeight; switch (xf86Screens[index]->bitsPerPixel) { case 16: shift = 1; break; case 32: shift = 0; break; default: break; } if (BITMAP_SCANLINE_PAD == 64) shift++; *x = (*x >> shift) << shift; pPix->drawable.x = *x; pPix->drawable.y = *y; pPix->drawable.width = pMode->viewportWidth; pPix->drawable.height = pMode->viewportHeight; } else { pPix->drawable.x = 0; pPix->drawable.y = 0; pPix->drawable.width = pMode->pixmapWidth; pPix->drawable.height = pMode->pixmapHeight; } pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; pScreenPriv->pixmapMode = mode; return TRUE; } Bool DGAScreenAvailable(ScreenPtr pScreen) { if (!DGAScreenKeyRegistered) return FALSE; if (DGA_GET_SCREEN_PRIV(pScreen)) return TRUE; return FALSE; } Bool DGAAvailable(int index) { ScreenPtr pScreen; assert(index < MAXSCREENS); pScreen = screenInfo.screens[index]; return DGAScreenAvailable(pScreen); } Bool DGAActive(int index) { DGAScreenPtr pScreenPriv; if (!DGAScreenKeyRegistered) return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (pScreenPriv && pScreenPriv->current) return TRUE; return FALSE; } /* Called by the event code in case the server is abruptly terminated */ void DGAShutdown(void) { ScrnInfoPtr pScrn; int i; if (!DGAScreenKeyRegistered) return; for (i = 0; i < screenInfo.numScreens; i++) { pScrn = xf86Screens[i]; (void) (*pScrn->SetDGAMode) (pScrn, 0, NULL); } } /* Called by the extension to initialize a mode */ int DGASetMode(int index, int num, XDGAModePtr mode, PixmapPtr *pPix) { ScrnInfoPtr pScrn = xf86Screens[index]; DGADeviceRec device; int ret; /* We rely on the extension to check that DGA is available */ ret = (*pScrn->SetDGAMode) (pScrn, num, &device); if ((ret == Success) && num) { DGACopyModeInfo(device.mode, mode); *pPix = device.pPix; } return ret; } /* Called from the extension to let the DDX know which events are requested */ void DGASelectInput(int index, ClientPtr client, long mask) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is available */ pScreenPriv->client = client; pScreenPriv->input = mask; } int DGAGetViewportStatus(int index) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is active */ if (!pScreenPriv->funcs->GetViewport) return 0; return (*pScreenPriv->funcs->GetViewport) (pScreenPriv->pScrn); } int DGASetViewport(int index, int x, int y, int mode) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (pScreenPriv->funcs->SetViewport) (*pScreenPriv->funcs->SetViewport) (pScreenPriv->pScrn, x, y, mode); return Success; } static int BitsClear(CARD32 data) { int bits = 0; CARD32 mask; for (mask = 1; mask; mask <<= 1) { if (!(data & mask)) bits++; else break; } return bits; } int DGACreateColormap(int index, ClientPtr client, int id, int mode, int alloc) { ScreenPtr pScreen = screenInfo.screens[index]; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); FakedVisualList *fvlp; VisualPtr pVisual; DGAModePtr pMode; ColormapPtr pmap; if (!mode || (mode > pScreenPriv->numModes)) return BadValue; if ((alloc != AllocNone) && (alloc != AllocAll)) return BadValue; pMode = &(pScreenPriv->modes[mode - 1]); if (!(pVisual = malloc(sizeof(VisualRec)))) return BadAlloc; pVisual->vid = FakeClientID(0); pVisual->class = pMode->visualClass; pVisual->nplanes = pMode->depth; pVisual->ColormapEntries = 1 << pMode->depth; pVisual->bitsPerRGBValue = (pMode->depth + 2) / 3; switch (pVisual->class) { case PseudoColor: case GrayScale: case StaticGray: pVisual->bitsPerRGBValue = 8; /* not quite */ pVisual->redMask = 0; pVisual->greenMask = 0; pVisual->blueMask = 0; pVisual->offsetRed = 0; pVisual->offsetGreen = 0; pVisual->offsetBlue = 0; break; case DirectColor: case TrueColor: pVisual->ColormapEntries = 1 << pVisual->bitsPerRGBValue; /* fall through */ case StaticColor: pVisual->redMask = pMode->red_mask; pVisual->greenMask = pMode->green_mask; pVisual->blueMask = pMode->blue_mask; pVisual->offsetRed = BitsClear(pVisual->redMask); pVisual->offsetGreen = BitsClear(pVisual->greenMask); pVisual->offsetBlue = BitsClear(pVisual->blueMask); } if (!(fvlp = malloc(sizeof(FakedVisualList)))) { free(pVisual); return BadAlloc; } fvlp->free = FALSE; fvlp->pVisual = pVisual; fvlp->next = pScreenPriv->fakedVisuals; pScreenPriv->fakedVisuals = fvlp; LEGAL_NEW_RESOURCE(id, client); return CreateColormap(id, pScreen, pVisual, &pmap, alloc, client->index); } /* Called by the extension to install a colormap on DGA active screens */ void DGAInstallCmap(ColormapPtr cmap) { ScreenPtr pScreen = cmap->pScreen; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); /* We rely on the extension to check that DGA is active */ if (!pScreenPriv->dgaColormap) pScreenPriv->savedColormap = GetInstalledmiColormap(pScreen); pScreenPriv->dgaColormap = cmap; (*pScreen->InstallColormap) (cmap); } int DGASync(int index) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is active */ if (pScreenPriv->funcs->Sync) (*pScreenPriv->funcs->Sync) (pScreenPriv->pScrn); return Success; } int DGAFillRect(int index, int x, int y, int w, int h, unsigned long color) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is active */ if (pScreenPriv->funcs->FillRect && (pScreenPriv->current->mode->flags & DGA_FILL_RECT)) { (*pScreenPriv->funcs->FillRect) (pScreenPriv->pScrn, x, y, w, h, color); return Success; } return BadMatch; } int DGABlitRect(int index, int srcx, int srcy, int w, int h, int dstx, int dsty) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is active */ if (pScreenPriv->funcs->BlitRect && (pScreenPriv->current->mode->flags & DGA_BLIT_RECT)) { (*pScreenPriv->funcs->BlitRect) (pScreenPriv->pScrn, srcx, srcy, w, h, dstx, dsty); return Success; } return BadMatch; } int DGABlitTransRect(int index, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long color) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is active */ if (pScreenPriv->funcs->BlitTransRect && (pScreenPriv->current->mode->flags & DGA_BLIT_RECT_TRANS)) { (*pScreenPriv->funcs->BlitTransRect) (pScreenPriv->pScrn, srcx, srcy, w, h, dstx, dsty, color); return Success; } return BadMatch; } int DGAGetModes(int index) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is available */ return pScreenPriv->numModes; } int DGAGetModeInfo(int index, XDGAModePtr mode, int num) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is available */ if ((num <= 0) || (num > pScreenPriv->numModes)) return BadValue; DGACopyModeInfo(&(pScreenPriv->modes[num - 1]), mode); return Success; } static void DGACopyModeInfo(DGAModePtr mode, XDGAModePtr xmode) { DisplayModePtr dmode = mode->mode; xmode->num = mode->num; xmode->name = dmode->name; xmode->VSync_num = (int) (dmode->VRefresh * 1000.0); xmode->VSync_den = 1000; xmode->flags = mode->flags; xmode->imageWidth = mode->imageWidth; xmode->imageHeight = mode->imageHeight; xmode->pixmapWidth = mode->pixmapWidth; xmode->pixmapHeight = mode->pixmapHeight; xmode->bytesPerScanline = mode->bytesPerScanline; xmode->byteOrder = mode->byteOrder; xmode->depth = mode->depth; xmode->bitsPerPixel = mode->bitsPerPixel; xmode->red_mask = mode->red_mask; xmode->green_mask = mode->green_mask; xmode->blue_mask = mode->blue_mask; xmode->visualClass = mode->visualClass; xmode->viewportWidth = mode->viewportWidth; xmode->viewportHeight = mode->viewportHeight; xmode->xViewportStep = mode->xViewportStep; xmode->yViewportStep = mode->yViewportStep; xmode->maxViewportX = mode->maxViewportX; xmode->maxViewportY = mode->maxViewportY; xmode->viewportFlags = mode->viewportFlags; xmode->reserved1 = mode->reserved1; xmode->reserved2 = mode->reserved2; xmode->offset = mode->offset; if (dmode->Flags & V_INTERLACE) xmode->flags |= DGA_INTERLACED; if (dmode->Flags & V_DBLSCAN) xmode->flags |= DGA_DOUBLESCAN; } Bool DGAVTSwitch(void) { ScreenPtr pScreen; int i; for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; /* Alternatively, this could send events to DGA clients */ if (DGAScreenKeyRegistered) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (pScreenPriv && pScreenPriv->current) return FALSE; } } return TRUE; } Bool DGAStealKeyEvent(DeviceIntPtr dev, int index, int key_code, int is_down) { DGAScreenPtr pScreenPriv; DGAEvent event; if (!DGAScreenKeyRegistered) /* no DGA */ return FALSE; if (key_code < 8 || key_code > 255) return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */ return FALSE; 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; } Bool DGAStealMotionEvent(DeviceIntPtr dev, int index, int dx, int dy) { DGAScreenPtr pScreenPriv; DGAEvent event; if (!DGAScreenKeyRegistered) /* no DGA */ return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */ return FALSE; 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; } Bool DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down) { DGAScreenPtr pScreenPriv; DGAEvent event; if (!DGAScreenKeyRegistered) /* no DGA */ return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (!pScreenPriv || !pScreenPriv->grabMouse) return FALSE; 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; } /* We have the power to steal or modify events that are about to get queued */ #define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ static Mask filters[] = { NoSuchEvent, /* 0 */ NoSuchEvent, /* 1 */ KeyPressMask, /* KeyPress */ KeyReleaseMask, /* KeyRelease */ ButtonPressMask, /* ButtonPress */ ButtonReleaseMask, /* ButtonRelease */ PointerMotionMask, /* MotionNotify (initial state) */ }; static void 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 = { .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 = { .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; /* If the DGA client has selected input, then deliver based on the usual filter */ TryClientEvents(pScreenPriv->client, keybd, (xEvent *) &de, 1, filters[ev.type], pScreenPriv->input, 0); } else { /* If the keyboard is actively grabbed, deliver a grabbed core event */ if (keybd->deviceGrab.grab && !keybd->deviceGrab.fromPassiveGrab) { ev.detail.key = event->detail; ev.time = event->time; ev.root_x = event->dx; ev.root_y = event->dy; ev.corestate = event->state; ev.deviceid = keybd->id; DeliverGrabbedEvent((InternalEvent *) &ev, keybd, FALSE); } } } static void DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse) { ButtonClassPtr butc = mouse->button; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); 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 }; 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) { 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; /* If the DGA client has selected input, then deliver based on the usual filter */ TryClientEvents(pScreenPriv->client, mouse, (xEvent *) &de, 1, filters[coreEquiv], pScreenPriv->input, 0); } else { /* If the pointer is actively grabbed, deliver a grabbed core event */ if (mouse->deviceGrab.grab && !mouse->deviceGrab.fromPassiveGrab) { ev.detail.button = event->detail; ev.time = event->time; ev.root_x = event->dx; ev.root_y = event->dy; ev.corestate = event->state; /* DGA is core only, so valuators.data doesn't actually matter. * Mask must be set for EventToCore to create motion events. */ SetBit(ev.valuators.mask, 0); SetBit(ev.valuators.mask, 1); DeliverGrabbedEvent((InternalEvent *) &ev, mouse, FALSE); } } } Bool DGAOpenFramebuffer(int index, char **name, unsigned char **mem, int *size, int *offset, int *flags) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is available */ return (*pScreenPriv->funcs->OpenFramebuffer) (pScreenPriv->pScrn, name, mem, size, offset, flags); } void DGACloseFramebuffer(int index) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is available */ if (pScreenPriv->funcs->CloseFramebuffer) (*pScreenPriv->funcs->CloseFramebuffer) (pScreenPriv->pScrn); } /* For DGA 1.0 backwards compatibility only */ int DGAGetOldDGAMode(int index) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); ScrnInfoPtr pScrn = pScreenPriv->pScrn; DGAModePtr mode; int i, w, h, p; /* We rely on the extension to check that DGA is available */ w = pScrn->currentMode->HDisplay; h = pScrn->currentMode->VDisplay; p = pad_to_int32(pScrn->displayWidth * bits_to_bytes(pScrn->bitsPerPixel)); for (i = 0; i < pScreenPriv->numModes; i++) { mode = &(pScreenPriv->modes[i]); if ((mode->viewportWidth == w) && (mode->viewportHeight == h) && (mode->bytesPerScanline == p) && (mode->bitsPerPixel == pScrn->bitsPerPixel) && (mode->depth == pScrn->depth)) { return mode->num; } } return 0; } static void DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device) { DGAEvent *event = &ev->dga_event; ScreenPtr pScreen = screenInfo.screens[screen_num]; DGAScreenPtr pScreenPriv; /* no DGA */ if (!DGAScreenKeyRegistered || noXFree86DGAExtension) return; pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); /* DGA not initialized on this screen */ if (!pScreenPriv) return; switch (event->subtype) { case KeyPress: case KeyRelease: DGAProcessKeyboardEvent(pScreen, event, device); break; case MotionNotify: case ButtonPress: case ButtonRelease: DGAProcessPointerEvent(pScreen, event, device); break; default: break; } } static void XDGAResetProc(ExtensionEntry * extEntry); static void DGAClientStateChange(CallbackListPtr *, void *, void *); 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, void *nulldata, void *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, (void *) (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((void **) &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((void **) &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); } } xorg-server-1.17.1/hw/xfree86/common/xf86Priv.h0000664000175100017510000001312312274325511016015 00000000000000/* * Copyright (c) 1997-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file contains declarations for private XFree86 functions and variables, * and definitions of private macros. * * "private" means not available to video drivers. */ #ifndef _XF86PRIV_H #define _XF86PRIV_H #include "xf86Privstr.h" #include "propertyst.h" #include "input.h" /* * Parameters set ONLY from the command line options * The global state of these things is held in xf86InfoRec (when appropriate). */ extern _X_EXPORT const char *xf86ConfigFile; extern _X_EXPORT const char *xf86ConfigDir; extern _X_EXPORT Bool xf86AllowMouseOpenFail; #ifdef XF86VIDMODE extern _X_EXPORT Bool xf86VidModeDisabled; extern _X_EXPORT Bool xf86VidModeAllowNonLocal; #endif extern _X_EXPORT Bool xf86fpFlag; extern _X_EXPORT Bool xf86sFlag; extern _X_EXPORT Bool xf86bsEnableFlag; extern _X_EXPORT Bool xf86bsDisableFlag; extern _X_EXPORT Bool xf86silkenMouseDisableFlag; extern _X_EXPORT Bool xf86xkbdirFlag; #ifdef HAVE_ACPI extern _X_EXPORT Bool xf86acpiDisableFlag; #endif extern _X_EXPORT char *xf86LayoutName; extern _X_EXPORT char *xf86ScreenName; extern _X_EXPORT char *xf86PointerName; extern _X_EXPORT char *xf86KeyboardName; extern _X_EXPORT int xf86FbBpp; extern _X_EXPORT int xf86Depth; extern _X_EXPORT Pix24Flags xf86Pix24; extern _X_EXPORT rgb xf86Weight; extern _X_EXPORT Bool xf86FlipPixels; extern _X_EXPORT Gamma xf86Gamma; extern _X_EXPORT const char *xf86ServerName; /* Other parameters */ extern _X_EXPORT xf86InfoRec xf86Info; extern _X_EXPORT const char *xf86ModulePath; extern _X_EXPORT MessageType xf86ModPathFrom; extern _X_EXPORT const char *xf86LogFile; extern _X_EXPORT MessageType xf86LogFileFrom; extern _X_EXPORT Bool xf86LogFileWasOpened; extern _X_EXPORT serverLayoutRec xf86ConfigLayout; extern _X_EXPORT DriverPtr *xf86DriverList; extern _X_EXPORT int xf86NumDrivers; extern _X_EXPORT Bool xf86Resetting; extern _X_EXPORT Bool xf86Initialising; 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 RootWinPropPtr *xf86RegisteredPropertiesTable; extern ScrnInfoPtr *xf86GPUScreens; /* List of pointers to ScrnInfoRecs */ extern int xf86NumGPUScreens; #ifndef DEFAULT_VERBOSE #define DEFAULT_VERBOSE 0 #endif #ifndef DEFAULT_LOG_VERBOSE #define DEFAULT_LOG_VERBOSE 3 #endif #ifndef DEFAULT_DPI #define DEFAULT_DPI 96 #endif /* Function Prototypes */ #ifndef _NO_XF86_PROTOTYPES /* xf86Bus.c */ extern _X_EXPORT Bool xf86BusConfig(void); 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(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev); extern _X_EXPORT void xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev); /* xf86Config.c */ extern _X_EXPORT Bool xf86PathIsSafe(const char *path); /* xf86DefaultModes */ extern _X_EXPORT const DisplayModeRec xf86DefaultModes[]; extern _X_EXPORT const int xf86NumDefaultModes; /* xf86Configure.c */ extern _X_EXPORT void DoConfigure(void) _X_NORETURN; extern _X_EXPORT void DoShowOptions(void) _X_NORETURN; /* xf86Events.c */ extern _X_EXPORT void xf86Wakeup(void *blockData, int err, void *pReadmask); extern _X_HIDDEN int xf86SigWrapper(int signo); extern _X_EXPORT void xf86HandlePMEvents(int fd, void *data); extern _X_EXPORT int (*xf86PMGetEventFromOs) (int fd, pmEvent * events, int num); extern _X_EXPORT pmWait (*xf86PMConfirmEventToOs) (int fd, pmEvent event); /* xf86Helper.c */ extern _X_EXPORT void xf86LogInit(void); extern _X_EXPORT void xf86CloseLog(enum ExitCode error); /* xf86Init.c */ extern _X_EXPORT Bool xf86LoadModules(const char **list, void **optlist); extern _X_EXPORT int xf86SetVerbosity(int verb); extern _X_EXPORT int xf86SetLogVerbosity(int verb); extern _X_EXPORT Bool xf86CallDriverProbe(struct _DriverRec *drv, Bool detect_only); extern _X_EXPORT Bool xf86PrivsElevated(void); #endif /* _NO_XF86_PROTOTYPES */ #endif /* _XF86PRIV_H */ xorg-server-1.17.1/hw/xfree86/common/xf86Opt.h0000664000175100017510000001773712365516566015673 00000000000000 /* * Copyright (c) 1998-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* Option handling things that ModuleSetup procs can use */ #ifndef _XF86_OPT_H_ #define _XF86_OPT_H_ #include "xf86Optionstr.h" typedef struct { double freq; int units; } OptFrequency; typedef union { unsigned long num; const char *str; double realnum; Bool bool; OptFrequency freq; } ValueUnion; typedef enum { OPTV_NONE = 0, OPTV_INTEGER, OPTV_STRING, /* a non-empty string */ OPTV_ANYSTR, /* Any string, including an empty one */ OPTV_REAL, OPTV_BOOLEAN, OPTV_PERCENT, OPTV_FREQ } OptionValueType; typedef enum { OPTUNITS_HZ = 1, OPTUNITS_KHZ, OPTUNITS_MHZ } OptFreqUnits; typedef struct { int token; const char *name; OptionValueType type; ValueUnion value; Bool found; } OptionInfoRec, *OptionInfoPtr; extern _X_EXPORT int xf86SetIntOption(XF86OptionPtr optlist, const char *name, int deflt); extern _X_EXPORT double xf86SetRealOption(XF86OptionPtr optlist, const char *name, double deflt); extern _X_EXPORT char *xf86SetStrOption(XF86OptionPtr optlist, const char *name, const char *deflt); extern _X_EXPORT int xf86SetBoolOption(XF86OptionPtr list, const char *name, int deflt); extern _X_EXPORT double xf86SetPercentOption(XF86OptionPtr list, const char *name, double deflt); extern _X_EXPORT int xf86CheckIntOption(XF86OptionPtr optlist, const char *name, int deflt); extern _X_EXPORT double xf86CheckRealOption(XF86OptionPtr optlist, const char *name, double deflt); extern _X_EXPORT char *xf86CheckStrOption(XF86OptionPtr optlist, 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, const char *name, double deflt); extern _X_EXPORT XF86OptionPtr xf86AddNewOption(XF86OptionPtr head, const char *name, const char *val); extern _X_EXPORT XF86OptionPtr xf86NewOption(char *name, char *value); extern _X_EXPORT XF86OptionPtr xf86NextOption(XF86OptionPtr list); extern _X_EXPORT XF86OptionPtr xf86OptionListCreate(const char **options, int count, int used); extern _X_EXPORT XF86OptionPtr xf86OptionListMerge(XF86OptionPtr head, XF86OptionPtr tail); extern _X_EXPORT XF86OptionPtr xf86OptionListDuplicate(XF86OptionPtr list); extern _X_EXPORT void xf86OptionListFree(XF86OptionPtr opt); extern _X_EXPORT char *xf86OptionName(XF86OptionPtr opt); extern _X_EXPORT char *xf86OptionValue(XF86OptionPtr opt); extern _X_EXPORT void xf86OptionListReport(XF86OptionPtr parm); extern _X_EXPORT XF86OptionPtr xf86FindOption(XF86OptionPtr options, const char *name); extern _X_EXPORT const char *xf86FindOptionValue(XF86OptionPtr options, const char *name); extern _X_EXPORT void xf86MarkOptionUsed(XF86OptionPtr option); extern _X_EXPORT void xf86MarkOptionUsedByName(XF86OptionPtr options, const char *name); extern _X_EXPORT Bool xf86CheckIfOptionUsed(XF86OptionPtr option); extern _X_EXPORT Bool xf86CheckIfOptionUsedByName(XF86OptionPtr options, const char *name); extern _X_EXPORT void xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr options); extern _X_EXPORT void xf86ProcessOptions(int scrnIndex, XF86OptionPtr options, OptionInfoPtr optinfo); extern _X_EXPORT OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec * table, int token); extern _X_EXPORT const char *xf86TokenToOptName(const OptionInfoRec * table, int token); extern _X_EXPORT Bool xf86IsOptionSet(const OptionInfoRec * table, int token); extern _X_EXPORT const char *xf86GetOptValString(const OptionInfoRec * table, int token); extern _X_EXPORT Bool xf86GetOptValInteger(const OptionInfoRec * table, int token, int *value); extern _X_EXPORT Bool xf86GetOptValULong(const OptionInfoRec * table, int token, unsigned long *value); extern _X_EXPORT Bool xf86GetOptValReal(const OptionInfoRec * table, int token, double *value); extern _X_EXPORT Bool xf86GetOptValFreq(const OptionInfoRec * table, int token, OptFreqUnits expectedUnits, double *value); extern _X_EXPORT Bool xf86GetOptValBool(const OptionInfoRec * table, int token, Bool *value); extern _X_EXPORT Bool xf86ReturnOptValBool(const OptionInfoRec * table, int token, Bool def); extern _X_EXPORT int xf86NameCmp(const char *s1, const char *s2); extern _X_EXPORT char *xf86NormalizeName(const char *s); extern _X_EXPORT XF86OptionPtr xf86ReplaceIntOption(XF86OptionPtr optlist, const char *name, const int val); extern _X_EXPORT XF86OptionPtr xf86ReplaceRealOption(XF86OptionPtr optlist, const char *name, const double val); extern _X_EXPORT XF86OptionPtr xf86ReplaceBoolOption(XF86OptionPtr optlist, const char *name, const Bool val); extern _X_EXPORT XF86OptionPtr xf86ReplacePercentOption(XF86OptionPtr optlist, const char *name, const double val); extern _X_EXPORT XF86OptionPtr xf86ReplaceStrOption(XF86OptionPtr optlist, const char *name, const char *val); #endif xorg-server-1.17.1/hw/xfree86/common/xf86fbBus.c0000664000175100017510000000534212366220413016132 00000000000000/* * Copyright (c) 2000-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file contains the interfaces to the bus-specific code */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86Bus.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" Bool fbSlotClaimed = FALSE; int 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; #endif #if defined(__sparc__) || defined (__sparc64__) if (sbusSlotClaimed) return -1; #endif num = xf86AllocateEntity(); p = xf86Entities[num]; p->driver = drvp; p->chipset = 0; p->bus.type = BUS_NONE; p->active = active; p->inUse = FALSE; xf86AddDevToEntity(num, dev); fbSlotClaimed = TRUE; return num; } /* * Get the list of FB "slots" claimed by a screen */ int xf86GetFbInfoForScreen(int scrnIndex) { int num = 0; int i; EntityPtr p; for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) { p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]]; if (p->bus.type == BUS_NONE) { num++; } } return num; } xorg-server-1.17.1/hw/xfree86/common/modeline2c.awk0000664000175100017510000000661412160102336016734 00000000000000#!/usr/bin/awk -f # # Copyright (c) 2007 Joerg Sonnenberger . # All rights reserved. # # Based on Perl script by Dirk Hohndel. # # 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. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 # COPYRIGHT HOLDERS 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. # # Usage: modeline2c.awk < modefile > xf86DefModeSet.c # BEGIN { flagsdict[""] = "0" flagsdict["+hsync +vsync"] = "V_PHSYNC | V_PVSYNC" flagsdict["+hsync -vsync"] = "V_PHSYNC | V_NVSYNC" flagsdict["-hsync +vsync"] = "V_NHSYNC | V_PVSYNC" flagsdict["-hsync -vsync"] = "V_NHSYNC | V_NVSYNC" flagsdict["+hsync +vsync interlace"] = "V_PHSYNC | V_PVSYNC | V_INTERLACE" flagsdict["+hsync -vsync interlace"] = "V_PHSYNC | V_NVSYNC | V_INTERLACE" flagsdict["-hsync +vsync interlace"] = "V_NHSYNC | V_PVSYNC | V_INTERLACE" flagsdict["-hsync -vsync interlace"] = "V_NHSYNC | V_NVSYNC | V_INTERLACE" print "/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at" print " * modeline2c.awk */" print "" print "/*" print " * Author: Joerg Sonnenberger " print " * Based on Perl script from Dirk Hohndel " print " */" print "" print "#ifdef HAVE_XORG_CONFIG_H" print "#include " print "#endif" print "" print "#include \"xf86.h\"" print "#include \"xf86Config.h\"" print "#include \"xf86Priv.h\"" print "#include \"xf86_OSlib.h\"" print "" print "#include \"globals.h\"" print "" print "#define MODEPREFIX NULL, NULL, NULL, MODE_OK, M_T_DEFAULT" print "#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0" print "" print "const DisplayModeRec xf86DefaultModes [] = {" modeline = "\t{MODEPREFIX,%d, %d,%d,%d,%d,0, %d,%d,%d,%d,0, %s, MODESUFFIX},\n" modeline_data = "^[a-zA-Z]+[ \t]+[^ \t]+[ \t0-9.]+" } /^[mM][oO][dD][eE][lL][iI][nN][eE]/ { flags = $0 gsub(modeline_data, "", flags) flags = tolower(flags) printf(modeline, $3 * 1000, $4, $5, $6, $7, $8, $9, $10, $11, flagsdict[flags]) # Half-width double scanned modes printf(modeline, $3 * 500, $4/2, $5/2, $6/2, $7/2, $8/2, $9/2, $10/2, $11/2, flagsdict[flags] " | V_DBLSCAN") } /^#/ { print "/*" substr($0, 2) " */" } END { print "};" printf "const int xf86NumDefaultModes = sizeof(xf86DefaultModes) / sizeof(DisplayModeRec);" } xorg-server-1.17.1/hw/xfree86/common/xorgVersion.h0000664000175100017510000000420012274325511016702 00000000000000 /* * Copyright (c) 2004, X.Org Foundation * * 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 XORG_VERSION_H #define XORG_VERSION_H #ifndef XORG_VERSION_CURRENT #error #endif #define XORG_VERSION_NUMERIC(major,minor,patch,snap,dummy) \ (((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap) #define XORG_GET_MAJOR_VERSION(vers) ((vers) / 10000000) #define XORG_GET_MINOR_VERSION(vers) (((vers) % 10000000) / 100000) #define XORG_GET_PATCH_VERSION(vers) (((vers) % 100000) / 1000) #define XORG_GET_SNAP_VERSION(vers) ((vers) % 1000) #define XORG_VERSION_MAJOR XORG_GET_MAJOR_VERSION(XORG_VERSION_CURRENT) #define XORG_VERSION_MINOR XORG_GET_MINOR_VERSION(XORG_VERSION_CURRENT) #define XORG_VERSION_PATCH XORG_GET_PATCH_VERSION(XORG_VERSION_CURRENT) #define XORG_VERSION_SNAP XORG_GET_SNAP_VERSION(XORG_VERSION_CURRENT) #endif xorg-server-1.17.1/hw/xfree86/common/xf86xv.c0000664000175100017510000016606412432306326015541 00000000000000/* * XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com) */ /* * Copyright (c) 1998-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include #include #include "scrnintstr.h" #include "regionstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "mivalidate.h" #include "validate.h" #include "resource.h" #include "gcstruct.h" #include "dixstruct.h" #include #include #include "xvdix.h" #include "xf86xvpriv.h" /* XvAdaptorRec fields */ static int xf86XVPutVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVPutStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVGetVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVGetStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVStopVideo(XvPortPtr, DrawablePtr); static int xf86XVSetPortAttribute(XvPortPtr, Atom, INT32); static int xf86XVGetPortAttribute(XvPortPtr, Atom, INT32 *); static int xf86XVQueryBestSize(XvPortPtr, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); static int xf86XVPutImage(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); static int xf86XVQueryImageAttributes(XvPortPtr, XvImagePtr, CARD16 *, CARD16 *, int *, int *); /* ScreenRec fields */ static Bool xf86XVDestroyWindow(WindowPtr pWin); static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1); static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind); static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); static Bool xf86XVCloseScreen(ScreenPtr); #define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1) /* ScrnInfoRec functions */ static Bool xf86XVEnterVT(ScrnInfoPtr); static void xf86XVLeaveVT(ScrnInfoPtr); static void xf86XVAdjustFrame(ScrnInfoPtr, int x, int y); static void xf86XVModeSet(ScrnInfoPtr pScrn); /* misc */ static Bool xf86XVInitAdaptors(ScreenPtr, XF86VideoAdaptorPtr *, int); static DevPrivateKeyRec XF86XVWindowKeyRec; #define XF86XVWindowKey (&XF86XVWindowKeyRec) /* dixmain.c XvScreenPtr screen private */ DevPrivateKey XF86XvScreenKey; /** xf86xv.c XF86XVScreenPtr screen private */ static DevPrivateKeyRec XF86XVScreenPrivateKey; static unsigned long PortResource = 0; #define GET_XV_SCREEN(pScreen) \ ((XvScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XF86XvScreenKey)) #define GET_XF86XV_SCREEN(pScreen) \ ((XF86XVScreenPtr)(dixGetPrivate(&pScreen->devPrivates, &XF86XVScreenPrivateKey))) #define GET_XF86XV_WINDOW(pWin) \ ((XF86XVWindowPtr)dixLookupPrivate(&(pWin)->devPrivates, XF86XVWindowKey)) static xf86XVInitGenericAdaptorPtr *GenDrivers = NULL; static int NumGenDrivers = 0; int xf86XVRegisterGenericAdaptorDriver(xf86XVInitGenericAdaptorPtr InitFunc) { xf86XVInitGenericAdaptorPtr *newdrivers; newdrivers = realloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) * (1 + NumGenDrivers)); if (!newdrivers) return 0; GenDrivers = newdrivers; GenDrivers[NumGenDrivers++] = InitFunc; return 1; } int xf86XVListGenericAdaptors(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr ** adaptors) { int i, j, n, num; XF86VideoAdaptorPtr *DrivAdap, *new; num = 0; *adaptors = NULL; /* * The v4l driver registers itself first, but can use surfaces registered * by other drivers. So, call the v4l driver last. */ for (i = NumGenDrivers; --i >= 0;) { DrivAdap = NULL; n = (*GenDrivers[i]) (pScrn, &DrivAdap); if (0 == n) continue; new = realloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num + n)); if (NULL == new) continue; *adaptors = new; for (j = 0; j < n; j++, num++) (*adaptors)[num] = DrivAdap[j]; } return num; } /**************** Offscreen surface stuff *******************/ typedef struct { XF86OffscreenImagePtr images; int num; } OffscreenImageRec; static DevPrivateKeyRec OffscreenPrivateKeyRec; #define OffscreenPrivateKey (&OffscreenPrivateKeyRec) #define GetOffscreenImage(pScreen) ((OffscreenImageRec *) dixLookupPrivate(&(pScreen)->devPrivates, OffscreenPrivateKey)) Bool xf86XVRegisterOffscreenImages(ScreenPtr pScreen, XF86OffscreenImagePtr images, int num) { OffscreenImageRec *OffscreenImage; /* This function may be called before xf86XVScreenInit, so there's * no better place than this to call dixRegisterPrivateKey to ensure we * have space reserved. After the first call it is a no-op. */ if (!dixRegisterPrivateKey (OffscreenPrivateKey, PRIVATE_SCREEN, sizeof(OffscreenImageRec)) || !(OffscreenImage = GetOffscreenImage(pScreen))) /* Every X.org driver assumes this function always succeeds, so * just die on allocation failure. */ FatalError ("Could not allocate private storage for XV offscreen images.\n"); OffscreenImage->num = num; OffscreenImage->images = images; return TRUE; } XF86OffscreenImagePtr xf86XVQueryOffscreenImages(ScreenPtr pScreen, int *num) { OffscreenImageRec *OffscreenImage = GetOffscreenImage(pScreen); *num = OffscreenImage->num; return OffscreenImage->images; } XF86VideoAdaptorPtr xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn) { return calloc(1, sizeof(XF86VideoAdaptorRec)); } void xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr) { free(ptr); } Bool xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) { ScrnInfoPtr pScrn; XF86XVScreenPtr ScreenPriv; if (num <= 0 || noXvExtension) return FALSE; if (Success != XvScreenInit(pScreen)) return FALSE; if (!dixRegisterPrivateKey(&XF86XVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; if (!dixRegisterPrivateKey(&XF86XVScreenPrivateKey, PRIVATE_SCREEN, 0)) return FALSE; XF86XvScreenKey = XvGetScreenKey(); PortResource = XvGetRTPort(); ScreenPriv = malloc(sizeof(XF86XVScreenRec)); dixSetPrivate(&pScreen->devPrivates, &XF86XVScreenPrivateKey, ScreenPriv); if (!ScreenPriv) return FALSE; pScrn = xf86ScreenToScrn(pScreen); ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; ScreenPriv->PostValidateTree = PostValidateTreeUndefined; ScreenPriv->ClipNotify = pScreen->ClipNotify; ScreenPriv->CloseScreen = pScreen->CloseScreen; ScreenPriv->EnterVT = pScrn->EnterVT; ScreenPriv->LeaveVT = pScrn->LeaveVT; ScreenPriv->AdjustFrame = pScrn->AdjustFrame; ScreenPriv->ModeSet = pScrn->ModeSet; pScreen->DestroyWindow = xf86XVDestroyWindow; pScreen->WindowExposures = xf86XVWindowExposures; pScreen->ClipNotify = xf86XVClipNotify; pScreen->CloseScreen = xf86XVCloseScreen; pScrn->EnterVT = xf86XVEnterVT; pScrn->LeaveVT = xf86XVLeaveVT; if (pScrn->AdjustFrame) pScrn->AdjustFrame = xf86XVAdjustFrame; pScrn->ModeSet = xf86XVModeSet; if (!xf86XVInitAdaptors(pScreen, adaptors, num)) return FALSE; return TRUE; } static void xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; if (pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; XvPortRecPrivatePtr pPriv; for (i = 0; i < pAdaptor->nPorts; i++, pPort++) { pPriv = (XvPortRecPrivatePtr) pPort->devPriv.ptr; if (pPriv) { if (pPriv->clientClip) RegionDestroy(pPriv->clientClip); if (pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); if (pPriv->ckeyFilled) RegionDestroy(pPriv->ckeyFilled); free(pPriv); } } } XvFreeAdaptor(pAdaptor); } static Bool xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number) { XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XF86VideoAdaptorPtr adaptorPtr; XvAdaptorPtr pAdaptor, pa; XvAdaptorRecPrivatePtr adaptorPriv; int na, numAdaptor; XvPortRecPrivatePtr portPriv; XvPortPtr pPort, pp; int numPort; XF86VideoFormatPtr formatPtr; XvFormatPtr pFormat, pf; int numFormat, totFormat; XF86VideoEncodingPtr encodingPtr; XvEncodingPtr pEncode, pe; int numVisuals; VisualPtr pVisual; int i; pxvs->nAdaptors = 0; pxvs->pAdaptors = NULL; if (!(pAdaptor = calloc(number, sizeof(XvAdaptorRec)))) return FALSE; for (pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) { adaptorPtr = infoPtr[na]; if (!adaptorPtr->StopVideo || !adaptorPtr->SetPortAttribute || !adaptorPtr->GetPortAttribute || !adaptorPtr->QueryBestSize) continue; /* client libs expect at least one encoding */ if (!adaptorPtr->nEncodings || !adaptorPtr->pEncodings) continue; pa->type = adaptorPtr->type; if (!adaptorPtr->PutVideo && !adaptorPtr->GetVideo) pa->type &= ~XvVideoMask; if (!adaptorPtr->PutStill && !adaptorPtr->GetStill) pa->type &= ~XvStillMask; if (!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes) pa->type &= ~XvImageMask; if (!adaptorPtr->PutVideo && !adaptorPtr->PutImage && !adaptorPtr->PutStill) pa->type &= ~XvInputMask; if (!adaptorPtr->GetVideo && !adaptorPtr->GetStill) pa->type &= ~XvOutputMask; if (!(adaptorPtr->type & (XvPixmapMask | XvWindowMask))) continue; if (!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask))) continue; pa->pScreen = pScreen; pa->ddPutVideo = xf86XVPutVideo; pa->ddPutStill = xf86XVPutStill; pa->ddGetVideo = xf86XVGetVideo; pa->ddGetStill = xf86XVGetStill; pa->ddStopVideo = xf86XVStopVideo; pa->ddPutImage = xf86XVPutImage; pa->ddSetPortAttribute = xf86XVSetPortAttribute; pa->ddGetPortAttribute = xf86XVGetPortAttribute; pa->ddQueryBestSize = xf86XVQueryBestSize; pa->ddQueryImageAttributes = xf86XVQueryImageAttributes; pa->name = strdup(adaptorPtr->name); if (adaptorPtr->nEncodings && (pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) { for (pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0; i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++) { pe->id = encodingPtr->id; pe->pScreen = pScreen; pe->name = strdup(encodingPtr->name); pe->width = encodingPtr->width; pe->height = encodingPtr->height; pe->rate.numerator = encodingPtr->rate.numerator; pe->rate.denominator = encodingPtr->rate.denominator; } pa->nEncodings = adaptorPtr->nEncodings; pa->pEncodings = pEncode; } if (adaptorPtr->nImages && (pa->pImages = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { memcpy(pa->pImages, adaptorPtr->pImages, adaptorPtr->nImages * sizeof(XvImageRec)); pa->nImages = adaptorPtr->nImages; } if (adaptorPtr->nAttributes && (pa->pAttributes = calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { memcpy(pa->pAttributes, adaptorPtr->pAttributes, adaptorPtr->nAttributes * sizeof(XvAttributeRec)); for (i = 0; i < adaptorPtr->nAttributes; i++) { pa->pAttributes[i].name = strdup(adaptorPtr->pAttributes[i].name); } pa->nAttributes = adaptorPtr->nAttributes; } totFormat = adaptorPtr->nFormats; if (!(pFormat = calloc(totFormat, sizeof(XvFormatRec)))) { xf86XVFreeAdaptor(pa); continue; } for (pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats; i < adaptorPtr->nFormats; i++, formatPtr++) { numVisuals = pScreen->numVisuals; pVisual = pScreen->visuals; while (numVisuals--) { if ((pVisual->class == formatPtr->class) && (pVisual->nplanes == formatPtr->depth)) { if (numFormat >= totFormat) { void *moreSpace; totFormat *= 2; moreSpace = realloc(pFormat, totFormat * sizeof(XvFormatRec)); if (!moreSpace) break; pFormat = moreSpace; pf = pFormat + numFormat; } pf->visual = pVisual->vid; pf->depth = formatPtr->depth; pf++; numFormat++; } pVisual++; } } pa->nFormats = numFormat; pa->pFormats = pFormat; if (!numFormat) { xf86XVFreeAdaptor(pa); continue; } if (!(adaptorPriv = calloc(1, sizeof(XvAdaptorRecPrivate)))) { xf86XVFreeAdaptor(pa); continue; } adaptorPriv->flags = adaptorPtr->flags; adaptorPriv->PutVideo = adaptorPtr->PutVideo; adaptorPriv->PutStill = adaptorPtr->PutStill; adaptorPriv->GetVideo = adaptorPtr->GetVideo; adaptorPriv->GetStill = adaptorPtr->GetStill; adaptorPriv->StopVideo = adaptorPtr->StopVideo; adaptorPriv->SetPortAttribute = adaptorPtr->SetPortAttribute; adaptorPriv->GetPortAttribute = adaptorPtr->GetPortAttribute; adaptorPriv->QueryBestSize = adaptorPtr->QueryBestSize; adaptorPriv->QueryImageAttributes = adaptorPtr->QueryImageAttributes; adaptorPriv->PutImage = adaptorPtr->PutImage; adaptorPriv->ReputImage = adaptorPtr->ReputImage; /* image/still */ pa->devPriv.ptr = (void *) adaptorPriv; if (!(pPort = calloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { xf86XVFreeAdaptor(pa); continue; } for (pp = pPort, i = 0, numPort = 0; i < adaptorPtr->nPorts; i++) { if (!(pp->id = FakeClientID(0))) continue; if (!(portPriv = calloc(1, sizeof(XvPortRecPrivate)))) continue; if (!AddResource(pp->id, PortResource, pp)) { free(portPriv); continue; } pp->pAdaptor = pa; pp->pNotify = (XvPortNotifyPtr) NULL; pp->pDraw = (DrawablePtr) NULL; pp->client = (ClientPtr) NULL; pp->grab.client = (ClientPtr) NULL; pp->time = currentTime; pp->devPriv.ptr = portPriv; portPriv->pScrn = pScrn; portPriv->AdaptorRec = adaptorPriv; portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr; pp++; numPort++; } pa->nPorts = numPort; pa->pPorts = pPort; if (!numPort) { xf86XVFreeAdaptor(pa); continue; } pa->base_id = pPort->id; pa++; numAdaptor++; } if (numAdaptor) { pxvs->nAdaptors = numAdaptor; pxvs->pAdaptors = pAdaptor; } else { free(pAdaptor); return FALSE; } return TRUE; } /* Video should be clipped to the intersection of the window cliplist and the client cliplist specified in the GC for which the video was initialized. When we need to reclip a window, the GC that started the video may not even be around anymore. That's why we save the client clip from the GC when the video is initialized. We then use xf86XVUpdateCompositeClip to calculate the new composite clip when we need it. This is different from what DEC did. They saved the GC and used it's clip list when they needed to reclip the window, even if the client clip was different from the one the video was initialized with. If the original GC was destroyed, they had to stop the video. I like the new method better (MArk). This function only works for windows. Will need to rewrite when (if) we support pixmap rendering. */ static void xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) { RegionPtr pregWin, pCompositeClip; WindowPtr pWin; Bool freeCompClip = FALSE; if (portPriv->pCompositeClip) return; pWin = (WindowPtr) portPriv->pDraw; /* get window clip list */ if (portPriv->subWindowMode == IncludeInferiors) { pregWin = NotClippedByChildren(pWin); freeCompClip = TRUE; } else pregWin = &pWin->clipList; if (!portPriv->clientClip) { portPriv->pCompositeClip = pregWin; portPriv->FreeCompositeClip = freeCompClip; return; } pCompositeClip = RegionCreate(NullBox, 1); RegionCopy(pCompositeClip, portPriv->clientClip); RegionTranslate(pCompositeClip, portPriv->pDraw->x, portPriv->pDraw->y); RegionIntersect(pCompositeClip, pregWin, pCompositeClip); portPriv->pCompositeClip = pCompositeClip; portPriv->FreeCompositeClip = TRUE; if (freeCompClip) { RegionDestroy(pregWin); } } /* Save the current clientClip and update the CompositeClip whenever we have a fresh GC */ static void xf86XVCopyClip(XvPortRecPrivatePtr portPriv, GCPtr pGC) { /* copy the new clip if it exists */ if (pGC->clientClip) { if (!portPriv->clientClip) portPriv->clientClip = RegionCreate(NullBox, 1); /* Note: this is in window coordinates */ RegionCopy(portPriv->clientClip, pGC->clientClip); RegionTranslate(portPriv->clientClip, pGC->clipOrg.x, pGC->clipOrg.y); } else if (portPriv->clientClip) { /* free the old clientClip */ RegionDestroy(portPriv->clientClip); portPriv->clientClip = NULL; } /* get rid of the old clip list */ if (portPriv->pCompositeClip && portPriv->FreeCompositeClip) { RegionDestroy(portPriv->pCompositeClip); } portPriv->pCompositeClip = pGC->pCompositeClip; portPriv->FreeCompositeClip = FALSE; portPriv->subWindowMode = pGC->subWindowMode; } static void xf86XVCopyCompositeClip(XvPortRecPrivatePtr portPriv, GCPtr pGC, DrawablePtr pDraw) { if (!portPriv->clientClip) portPriv->clientClip = RegionCreate(NullBox, 1); /* Keep the original GC composite clip around for ReputImage */ RegionCopy(portPriv->clientClip, pGC->pCompositeClip); RegionTranslate(portPriv->clientClip, -pDraw->x, -pDraw->y); /* get rid of the old clip list */ if (portPriv->pCompositeClip && portPriv->FreeCompositeClip) RegionDestroy(portPriv->pCompositeClip); portPriv->pCompositeClip = pGC->pCompositeClip; portPriv->FreeCompositeClip = FALSE; portPriv->subWindowMode = pGC->subWindowMode; } static int xf86XVRegetVideo(XvPortRecPrivatePtr portPriv) { RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; xf86XVUpdateCompositeClip(portPriv); /* translate the video region to the screen */ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x; WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ RegionInit(&WinRegion, &WinBox, 1); RegionNull(&ClipRegion); RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* that's all if it's totally obscured */ if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } ret = (*portPriv->AdaptorRec->GetVideo) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, portPriv->vid_w, portPriv->vid_h, portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr, portPriv->pDraw); if (ret == Success) portPriv->isOn = XV_ON; CLIP_VIDEO_BAILOUT: if ((clippedAway || (ret != Success)) && portPriv->isOn == XV_ON) { (*portPriv->AdaptorRec->StopVideo) (portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int xf86XVReputVideo(XvPortRecPrivatePtr portPriv) { RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; xf86XVUpdateCompositeClip(portPriv); /* translate the video region to the screen */ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x; WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ RegionInit(&WinRegion, &WinBox, 1); RegionNull(&ClipRegion); RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } /* that's all if it's totally obscured */ if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } ret = (*portPriv->AdaptorRec->PutVideo) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, portPriv->vid_w, portPriv->vid_h, portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr, portPriv->pDraw); if (ret == Success) portPriv->isOn = XV_ON; CLIP_VIDEO_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } /* Reput image/still */ static int xf86XVReputImage(XvPortRecPrivatePtr portPriv) { RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; xf86XVUpdateCompositeClip(portPriv); /* the clip can get smaller over time */ RegionCopy(portPriv->clientClip, portPriv->pCompositeClip); RegionTranslate(portPriv->clientClip, -portPriv->pDraw->x, -portPriv->pDraw->y); /* translate the video region to the screen */ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x; WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ RegionInit(&WinRegion, &WinBox, 1); RegionNull(&ClipRegion); RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } /* that's all if it's totally obscured */ if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } ret = (*portPriv->AdaptorRec->ReputImage) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, portPriv->vid_w, portPriv->vid_h, portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr, portPriv->pDraw); portPriv->isOn = (ret == Success) ? XV_ON : XV_OFF; CLIP_VIDEO_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int xf86XVReputAllVideo(WindowPtr pWin, void *data) { XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); while (WinPriv) { if (WinPriv->PortRec->type == XvInputMask) xf86XVReputVideo(WinPriv->PortRec); else xf86XVRegetVideo(WinPriv->PortRec); WinPriv = WinPriv->next; } return WT_WALKCHILDREN; } static int xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { XF86XVWindowPtr winPriv, PrivRoot; winPriv = PrivRoot = GET_XF86XV_WINDOW(pWin); /* Enlist our port in the window private */ while (winPriv) { if (winPriv->PortRec == portPriv) /* we're already listed */ break; winPriv = winPriv->next; } if (!winPriv) { winPriv = calloc(1, sizeof(XF86XVWindowRec)); if (!winPriv) return BadAlloc; winPriv->PortRec = portPriv; winPriv->next = PrivRoot; dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, winPriv); } portPriv->pDraw = (DrawablePtr) pWin; return Success; } static void xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { XF86XVWindowPtr winPriv, prevPriv = NULL; winPriv = GET_XF86XV_WINDOW(pWin); while (winPriv) { if (winPriv->PortRec == portPriv) { if (prevPriv) prevPriv->next = winPriv->next; else dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, winPriv->next); free(winPriv); break; } prevPriv = winPriv; winPriv = winPriv->next; } portPriv->pDraw = NULL; if (portPriv->ckeyFilled) { RegionDestroy(portPriv->ckeyFilled); portPriv->ckeyFilled = NULL; } portPriv->clipChanged = FALSE; } static void xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv, WindowPtr pWin, Bool visible) { if (!visible) { if (pPriv->isOn == XV_ON) { (*pPriv->AdaptorRec->StopVideo) (pPriv->pScrn, pPriv->DevPriv.ptr, FALSE); pPriv->isOn = XV_PENDING; } if (!pPriv->type) /* overlaid still/image */ xf86XVRemovePortFromWindow(pWin, pPriv); return; } switch (pPriv->type) { case XvInputMask: xf86XVReputVideo(pPriv); break; case XvOutputMask: xf86XVRegetVideo(pPriv); break; default: /* overlaid still/image */ if (pPriv->AdaptorRec->ReputImage) xf86XVReputImage(pPriv); break; } } static void xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XvAdaptorPtr pa; int c, i; for (c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) { XvPortPtr pPort = pa->pPorts; for (i = pa->nPorts; i > 0; i--, pPort++) { XvPortRecPrivatePtr pPriv = (XvPortRecPrivatePtr) pPort->devPriv.ptr; WindowPtr pWin = (WindowPtr) pPriv->pDraw; Bool visible; if (pPriv->isOn == XV_OFF || !pWin) continue; if (onlyChanged && !pPriv->clipChanged) continue; visible = pWin->visibility == VisibilityUnobscured || pWin->visibility == VisibilityPartiallyObscured; /* * Stop and remove still/images if * ReputImage isn't supported. */ if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) visible = FALSE; xf86XVReputOrStopPort(pPriv, pWin, visible); pPriv->clipChanged = FALSE; } } } /**** ScreenRec fields ****/ static Bool xf86XVDestroyWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XF86XVWindowPtr tmp, WinPriv = GET_XF86XV_WINDOW(pWin); int ret; while (WinPriv) { XvPortRecPrivatePtr pPriv = WinPriv->PortRec; if (pPriv->isOn > XV_OFF) { (*pPriv->AdaptorRec->StopVideo) (pPriv->pScrn, pPriv->DevPriv.ptr, TRUE); pPriv->isOn = XV_OFF; } pPriv->pDraw = NULL; tmp = WinPriv; WinPriv = WinPriv->next; free(tmp); } dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, NULL); pScreen->DestroyWindow = ScreenPriv->DestroyWindow; ret = (*pScreen->DestroyWindow) (pWin); pScreen->DestroyWindow = xf86XVDestroyWindow; return ret; } static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind) { ScreenPtr pScreen; XF86XVScreenPtr ScreenPriv; ScrnInfoPtr pScrn; if (pWin) pScreen = pWin->drawable.pScreen; else pScreen = pLayerWin->drawable.pScreen; ScreenPriv = GET_XF86XV_SCREEN(pScreen); pScrn = xf86ScreenToScrn(pScreen); xf86XVReputOrStopAllPorts(pScrn, TRUE); pScreen->PostValidateTree = ScreenPriv->PostValidateTree; if (pScreen->PostValidateTree) { (*pScreen->PostValidateTree) (pWin, pLayerWin, kind); } ScreenPriv->PostValidateTree = PostValidateTreeUndefined; } static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1) { ScreenPtr pScreen = pWin->drawable.pScreen; XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); XvPortRecPrivatePtr pPriv; Bool AreasExposed; AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1)); pScreen->WindowExposures = ScreenPriv->WindowExposures; (*pScreen->WindowExposures) (pWin, reg1); pScreen->WindowExposures = xf86XVWindowExposures; /* filter out XClearWindow/Area */ if (!pWin->valdata) return; while (WinPriv) { Bool visible = TRUE; pPriv = WinPriv->PortRec; /* * Stop and remove still/images if areas were exposed and * ReputImage isn't supported. */ if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) visible = !AreasExposed; /* * Subtract exposed areas from overlaid image to match textured video * behavior. */ if (!pPriv->type && pPriv->clientClip) RegionSubtract(pPriv->clientClip, pPriv->clientClip, reg1); if (visible && pPriv->ckeyFilled) { RegionRec tmp; RegionNull(&tmp); RegionCopy(&tmp, reg1); RegionTranslate(&tmp, pWin->drawable.x, pWin->drawable.y); RegionSubtract(pPriv->ckeyFilled, pPriv->ckeyFilled, &tmp); } WinPriv = WinPriv->next; xf86XVReputOrStopPort(pPriv, pWin, visible); pPriv->clipChanged = FALSE; } } static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy) { ScreenPtr pScreen = pWin->drawable.pScreen; XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); XvPortRecPrivatePtr pPriv; while (WinPriv) { pPriv = WinPriv->PortRec; if (pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; pPriv->clipChanged = TRUE; if (ScreenPriv->PostValidateTree == PostValidateTreeUndefined) { ScreenPriv->PostValidateTree = pScreen->PostValidateTree; pScreen->PostValidateTree = xf86XVPostValidateTree; } WinPriv = WinPriv->next; } if (ScreenPriv->ClipNotify) { pScreen->ClipNotify = ScreenPriv->ClipNotify; (*pScreen->ClipNotify) (pWin, dx, dy); pScreen->ClipNotify = xf86XVClipNotify; } } /**** Required XvScreenRec fields ****/ static Bool xf86XVCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XvAdaptorPtr pa; int c; if (!ScreenPriv) return TRUE; pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; pScreen->CloseScreen = ScreenPriv->CloseScreen; pScrn->EnterVT = ScreenPriv->EnterVT; pScrn->LeaveVT = ScreenPriv->LeaveVT; pScrn->AdjustFrame = ScreenPriv->AdjustFrame; pScrn->ModeSet = ScreenPriv->ModeSet; for (c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) { xf86XVFreeAdaptor(pa); } free(pxvs->pAdaptors); free(ScreenPriv); return pScreen->CloseScreen(pScreen); } /**** ScrnInfoRec fields ****/ static Bool xf86XVEnterVT(ScrnInfoPtr pScrn) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); Bool ret; pScrn->EnterVT = ScreenPriv->EnterVT; ret = (*ScreenPriv->EnterVT) (pScrn); ScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = xf86XVEnterVT; if (ret) WalkTree(pScreen, xf86XVReputAllVideo, 0); return ret; } static void xf86XVLeaveVT(ScrnInfoPtr pScrn) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XvAdaptorPtr pAdaptor; XvPortPtr pPort; XvPortRecPrivatePtr pPriv; int i, j; for (i = 0; i < pxvs->nAdaptors; i++) { pAdaptor = &pxvs->pAdaptors[i]; for (j = 0; j < pAdaptor->nPorts; j++) { pPort = &pAdaptor->pPorts[j]; pPriv = (XvPortRecPrivatePtr) pPort->devPriv.ptr; if (pPriv->isOn > XV_OFF) { (*pPriv->AdaptorRec->StopVideo) (pPriv->pScrn, pPriv->DevPriv.ptr, TRUE); pPriv->isOn = XV_OFF; if (pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; if (!pPriv->type && pPriv->pDraw) { /* still */ xf86XVRemovePortFromWindow((WindowPtr) pPriv->pDraw, pPriv); } } } } pScrn->LeaveVT = ScreenPriv->LeaveVT; (*ScreenPriv->LeaveVT) (pScrn); ScreenPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = xf86XVLeaveVT; } static void xf86XVAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); if (ScreenPriv->AdjustFrame) { pScrn->AdjustFrame = ScreenPriv->AdjustFrame; (*pScrn->AdjustFrame) (pScrn, x, y); pScrn->AdjustFrame = xf86XVAdjustFrame; } xf86XVReputOrStopAllPorts(pScrn, FALSE); } static void xf86XVModeSet(ScrnInfoPtr pScrn) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv; /* Can be called before pScrn->pScreen is set */ if (!pScreen) return; ScreenPriv = GET_XF86XV_SCREEN(pScreen); if (ScreenPriv->ModeSet) { pScrn->ModeSet = ScreenPriv->ModeSet; (*pScrn->ModeSet) (pScrn); pScrn->ModeSet = xf86XVModeSet; } xf86XVReputOrStopAllPorts(pScrn, FALSE); } /**** XvAdaptorRec fields ****/ static int xf86XVPutVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); int result; /* No dumping video to pixmaps... For now anyhow */ if (pDraw->type != DRAWABLE_WINDOW) { pPort->pDraw = (DrawablePtr) NULL; return BadAlloc; } /* If we are changing windows, unregister our port in the old window */ if (portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); /* Register our port with the new window */ result = xf86XVEnlistPortInWindow((WindowPtr) pDraw, portPriv); if (result != Success) return result; portPriv->type = XvInputMask; /* save a copy of these parameters */ portPriv->vid_x = vid_x; portPriv->vid_y = vid_y; portPriv->vid_w = vid_w; portPriv->vid_h = vid_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; /* make sure we have the most recent copy of the clientClip */ xf86XVCopyClip(portPriv, pGC); /* To indicate to the DI layer that we were successful */ pPort->pDraw = pDraw; if (!portPriv->pScrn->vtSema) return Success; /* Success ? */ return (xf86XVReputVideo(portPriv)); } static int xf86XVPutStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; if (!portPriv->pScrn->vtSema) return Success; /* Success ? */ WinBox.x1 = pDraw->x + drw_x; WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; xf86XVCopyCompositeClip(portPriv, pGC, pDraw); RegionInit(&WinRegion, &WinBox, 1); RegionNull(&ClipRegion); RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } if (portPriv->pDraw) { xf86XVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); } if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_STILL_BAILOUT; } ret = (*portPriv->AdaptorRec->PutStill) (portPriv->pScrn, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, &ClipRegion, portPriv->DevPriv.ptr, pDraw); if ((ret == Success) && (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_STILLS)) { xf86XVEnlistPortInWindow((WindowPtr) pDraw, portPriv); portPriv->isOn = XV_ON; portPriv->vid_x = vid_x; portPriv->vid_y = vid_y; portPriv->vid_w = vid_w; portPriv->vid_h = vid_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should not be reput once it's removed */ pPort->pDraw = pDraw; /* make sure we can get stop requests */ } PUT_STILL_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int xf86XVGetVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); int result; /* No pixmaps... For now anyhow */ if (pDraw->type != DRAWABLE_WINDOW) { pPort->pDraw = (DrawablePtr) NULL; return BadAlloc; } /* If we are changing windows, unregister our port in the old window */ if (portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); /* Register our port with the new window */ result = xf86XVEnlistPortInWindow((WindowPtr) pDraw, portPriv); if (result != Success) return result; portPriv->type = XvOutputMask; /* save a copy of these parameters */ portPriv->vid_x = vid_x; portPriv->vid_y = vid_y; portPriv->vid_w = vid_w; portPriv->vid_h = vid_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; /* make sure we have the most recent copy of the clientClip */ xf86XVCopyClip(portPriv, pGC); /* To indicate to the DI layer that we were successful */ pPort->pDraw = pDraw; if (!portPriv->pScrn->vtSema) return Success; /* Success ? */ return (xf86XVRegetVideo(portPriv)); } static int xf86XVGetStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; if (!portPriv->pScrn->vtSema) return Success; /* Success ? */ WinBox.x1 = pDraw->x + drw_x; WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; RegionInit(&WinRegion, &WinBox, 1); RegionNull(&ClipRegion); RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if (portPriv->pDraw) { xf86XVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); } if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto GET_STILL_BAILOUT; } ret = (*portPriv->AdaptorRec->GetStill) (portPriv->pScrn, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, &ClipRegion, portPriv->DevPriv.ptr, pDraw); GET_STILL_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int xf86XVStopVideo(XvPortPtr pPort, DrawablePtr pDraw) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; xf86XVRemovePortFromWindow((WindowPtr) pDraw, portPriv); if (!portPriv->pScrn->vtSema) return Success; /* Success ? */ /* Must free resources. */ if (portPriv->isOn > XV_OFF) { (*portPriv->AdaptorRec->StopVideo) (portPriv->pScrn, portPriv->DevPriv.ptr, TRUE); portPriv->isOn = XV_OFF; } return Success; } static int xf86XVSetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); return ((*portPriv->AdaptorRec->SetPortAttribute) (portPriv->pScrn, attribute, value, portPriv->DevPriv.ptr)); } static int xf86XVGetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 *p_value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); return ((*portPriv->AdaptorRec->GetPortAttribute) (portPriv->pScrn, attribute, p_value, portPriv->DevPriv.ptr)); } static int xf86XVQueryBestSize(XvPortPtr pPort, CARD8 motion, CARD16 vid_w, CARD16 vid_h, CARD16 drw_w, CARD16 drw_h, unsigned int *p_w, unsigned int *p_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); (*portPriv->AdaptorRec->QueryBestSize) (portPriv->pScrn, (Bool) motion, vid_w, vid_h, drw_w, drw_h, p_w, p_h, portPriv->DevPriv.ptr); return Success; } static int xf86XVPutImage(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 src_x, INT16 src_y, CARD16 src_w, CARD16 src_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h, XvImagePtr format, unsigned char *data, Bool sync, CARD16 width, CARD16 height) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; if (!portPriv->pScrn->vtSema) return Success; /* Success ? */ xf86XVCopyCompositeClip(portPriv, pGC, pDraw); WinBox.x1 = pDraw->x + drw_x; WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; RegionInit(&WinRegion, &WinBox, 1); RegionNull(&ClipRegion); RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } /* If we are changing windows, unregister our port in the old window */ if (portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); /* Register our port with the new window */ ret = xf86XVEnlistPortInWindow((WindowPtr) pDraw, portPriv); if (ret != Success) goto PUT_IMAGE_BAILOUT; if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_IMAGE_BAILOUT; } ret = (*portPriv->AdaptorRec->PutImage) (portPriv->pScrn, src_x, src_y, WinBox.x1, WinBox.y1, src_w, src_h, drw_w, drw_h, format->id, data, width, height, sync, &ClipRegion, portPriv->DevPriv.ptr, pDraw); if ((ret == Success) && (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) { portPriv->isOn = XV_ON; portPriv->vid_x = src_x; portPriv->vid_y = src_y; portPriv->vid_w = src_w; portPriv->vid_h = src_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should not be reput once it's removed */ pPort->pDraw = pDraw; /* make sure we can get stop requests */ } PUT_IMAGE_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int xf86XVQueryImageAttributes(XvPortPtr pPort, XvImagePtr format, CARD16 *width, CARD16 *height, int *pitches, int *offsets) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); return (*portPriv->AdaptorRec->QueryImageAttributes) (portPriv->pScrn, format->id, width, height, pitches, offsets); } void xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes) { ScreenPtr pScreen = pDraw->pScreen; if (!xf86ScreenToScrn(pScreen)->vtSema) return; XvFillColorKey(pDraw, key, fillboxes); } void xf86XVFillKeyHelper(ScreenPtr pScreen, CARD32 key, RegionPtr fillboxes) { xf86XVFillKeyHelperDrawable(&pScreen->root->drawable, key, fillboxes); } void xf86XVFillKeyHelperPort(DrawablePtr pDraw, void *data, CARD32 key, RegionPtr clipboxes, Bool fillEverything) { WindowPtr pWin = (WindowPtr) pDraw; XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); XvPortRecPrivatePtr portPriv = NULL; RegionRec reg; RegionPtr fillboxes; while (WinPriv) { XvPortRecPrivatePtr pPriv = WinPriv->PortRec; if (data == pPriv->DevPriv.ptr) { portPriv = pPriv; break; } WinPriv = WinPriv->next; } if (!portPriv) return; if (!portPriv->ckeyFilled) portPriv->ckeyFilled = RegionCreate(NULL, 0); if (!fillEverything) { RegionNull(®); fillboxes = ® RegionSubtract(fillboxes, clipboxes, portPriv->ckeyFilled); if (!RegionNotEmpty(fillboxes)) goto out; } else fillboxes = clipboxes; RegionCopy(portPriv->ckeyFilled, clipboxes); xf86XVFillKeyHelperDrawable(pDraw, key, fillboxes); out: if (!fillEverything) RegionUninit(®); } /* xf86XVClipVideoHelper - Takes the dst box in standard X BoxRec form (top and left edges inclusive, bottom and right exclusive). The new dst box is returned. The source boundaries are given (x1, y1 inclusive, x2, y2 exclusive) and returned are the new source boundaries in 16.16 fixed point. */ Bool xf86XVClipVideoHelper(BoxPtr dst, INT32 *xa, INT32 *xb, INT32 *ya, INT32 *yb, RegionPtr reg, INT32 width, INT32 height) { double xsw, xdw, ysw, ydw; INT32 delta; BoxPtr extents = RegionExtents(reg); int diff; xsw = (*xb - *xa) << 16; xdw = dst->x2 - dst->x1; ysw = (*yb - *ya) << 16; ydw = dst->y2 - dst->y1; *xa <<= 16; *xb <<= 16; *ya <<= 16; *yb <<= 16; diff = extents->x1 - dst->x1; if (diff > 0) { dst->x1 = extents->x1; *xa += (diff * xsw) / xdw; } diff = dst->x2 - extents->x2; if (diff > 0) { dst->x2 = extents->x2; *xb -= (diff * xsw) / xdw; } diff = extents->y1 - dst->y1; if (diff > 0) { dst->y1 = extents->y1; *ya += (diff * ysw) / ydw; } diff = dst->y2 - extents->y2; if (diff > 0) { dst->y2 = extents->y2; *yb -= (diff * ysw) / ydw; } if (*xa < 0) { diff = (((-*xa) * xdw) + xsw - 1) / xsw; dst->x1 += diff; *xa += (diff * xsw) / xdw; } delta = *xb - (width << 16); if (delta > 0) { diff = ((delta * xdw) + xsw - 1) / xsw; dst->x2 -= diff; *xb -= (diff * xsw) / xdw; } if (*xa >= *xb) return FALSE; if (*ya < 0) { diff = (((-*ya) * ydw) + ysw - 1) / ysw; dst->y1 += diff; *ya += (diff * ysw) / ydw; } delta = *yb - (height << 16); if (delta > 0) { diff = ((delta * ydw) + ysw - 1) / ysw; dst->y2 -= diff; *yb -= (diff * ysw) / ydw; } if (*ya >= *yb) return FALSE; if ((dst->x1 > extents->x1) || (dst->x2 < extents->x2) || (dst->y1 > extents->y1) || (dst->y2 < extents->y2)) { RegionRec clipReg; RegionInit(&clipReg, dst, 1); RegionIntersect(reg, reg, &clipReg); RegionUninit(&clipReg); } return TRUE; } void xf86XVCopyYUV12ToPacked(const void *srcy, const void *srcv, const void *srcu, void *dst, int srcPitchy, int srcPitchuv, int dstPitch, int h, int w) { CARD32 *Dst; const CARD8 *Y, *U, *V; int i, j; w >>= 1; for (j = 0; j < h; j++) { Dst = dst; Y = srcy; V = srcv; U = srcu; i = w; while (i >= 4) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24); Dst[1] = Y[2] | (Y[3] << 16) | (U[1] << 8) | (V[1] << 24); Dst[2] = Y[4] | (Y[5] << 16) | (U[2] << 8) | (V[2] << 24); Dst[3] = Y[6] | (Y[7] << 16) | (U[3] << 8) | (V[3] << 24); #else /* This assumes a little-endian framebuffer */ Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | V[0]; Dst[1] = (Y[2] << 24) | (Y[3] << 8) | (U[1] << 16) | V[1]; Dst[2] = (Y[4] << 24) | (Y[5] << 8) | (U[2] << 16) | V[2]; Dst[3] = (Y[6] << 24) | (Y[7] << 8) | (U[3] << 16) | V[3]; #endif Dst += 4; Y += 8; V += 4; U += 4; i -= 4; } while (i--) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24); #else /* This assumes a little-endian framebuffer */ Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | V[0]; #endif Dst++; Y += 2; V++; U++; } dst = (CARD8 *) dst + dstPitch; srcy = (const CARD8 *) srcy + srcPitchy; if (j & 1) { srcu = (const CARD8 *) srcu + srcPitchuv; srcv = (const CARD8 *) srcv + srcPitchuv; } } } void xf86XVCopyPacked(const void *src, void *dst, int srcPitch, int dstPitch, int h, int w) { const CARD32 *Src; CARD32 *Dst; int i; w >>= 1; while (--h >= 0) { do { Dst = dst; Src = src; i = w; while (i >= 4) { Dst[0] = Src[0]; Dst[1] = Src[1]; Dst[2] = Src[2]; Dst[3] = Src[3]; Dst += 4; Src += 4; i -= 4; } if (!i) break; Dst[0] = Src[0]; if (i == 1) break; Dst[1] = Src[1]; if (i == 2) break; Dst[2] = Src[2]; } while (0); src = (const CARD8 *) src + srcPitch; dst = (CARD8 *) dst + dstPitch; } } xorg-server-1.17.1/hw/xfree86/common/xf86Privstr.h0000664000175100017510000001201112414702051016533 00000000000000 /* * 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). */ /* * This file contains definitions of the private XFree86 data structures/types. * None of the data structures here should be used by video drivers. */ #ifndef _XF86PRIVSTR_H #define _XF86PRIVSTR_H #include "xf86str.h" typedef enum { XF86_GlxVisualsMinimal, XF86_GlxVisualsTypical, XF86_GlxVisualsAll, } XF86_GlxVisuals; /* * xf86InfoRec contains global parameters which the video drivers never * need to access. Global parameters which the video drivers do need * should be individual globals. */ typedef struct { int consoleFd; int vtno; /* event handler part */ int lastEventTime; Bool vtRequestsPending; #ifdef sun int vtPendingNum; #endif Bool dontVTSwitch; Bool autoVTSwitch; Bool ShareVTs; Bool dontZap; Bool dontZoom; Bool notrapSignals; /* don't exit cleanly - die at fault */ Bool caughtSignal; /* graphics part */ ScreenPtr currentScreen; #if defined(CSRG_BASED) || defined(__FreeBSD_kernel__) int consType; /* Which console driver? */ #endif /* Other things */ Bool allowMouseOpenFail; Bool vidModeEnabled; /* VidMode extension enabled */ Bool vidModeAllowNonLocal; /* allow non-local VidMode * connections */ Bool miscModInDevEnabled; /* Allow input devices to be * changed */ Bool miscModInDevAllowNonLocal; Bool useSIGIO; /* Use SIGIO for handling input device events */ Pix24Flags pixmap24; MessageType pix24From; Bool pmFlag; Bool disableRandR; MessageType randRFrom; Bool aiglx; MessageType aiglxFrom; XF86_GlxVisuals glxVisuals; MessageType glxVisualsFrom; Bool useDefaultFontPath; Bool ignoreABI; Bool forceInputDevices; /* force xorg.conf or built-in input devices */ Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */ Bool autoEnableDevices; /* Whether to enable, or let the client * control. */ Bool dri2; MessageType dri2From; Bool autoAddGPU; } xf86InfoRec, *xf86InfoPtr; #ifdef DPMSExtension /* Private info for DPMS */ typedef struct { CloseScreenProcPtr CloseScreen; Bool Enabled; int Flags; } DPMSRec, *DPMSPtr; #endif #ifdef XF86VIDMODE /* Private info for Video Mode Extentsion */ typedef struct { DisplayModePtr First; DisplayModePtr Next; int Flags; CloseScreenProcPtr CloseScreen; } VidModeRec, *VidModePtr; #endif /* Information for root window properties. */ typedef struct _RootWinProp { struct _RootWinProp *next; const char *name; Atom type; short format; long size; void *data; } RootWinProp, *RootWinPropPtr; /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ #define XLED1 ((unsigned long) 0x00000001) #define XLED2 ((unsigned long) 0x00000002) #define XLED3 ((unsigned long) 0x00000004) #define XLED4 ((unsigned long) 0x00000008) #define XCAPS ((unsigned long) 0x20000000) #define XNUM ((unsigned long) 0x40000000) #define XSCR ((unsigned long) 0x80000000) #define XCOMP ((unsigned long) 0x00008000) /* BSD console driver types (consType) */ #if defined(CSRG_BASED) || defined(__FreeBSD_kernel__) #define PCCONS 0 #define CODRV011 1 #define CODRV01X 2 #define SYSCONS 8 #define PCVT 16 #define WSCONS 32 #endif /* Root window property to tell clients whether our VT is currently active. * Name chosen to match the "XFree86_VT" property. */ #define HAS_VT_ATOM_NAME "XFree86_has_VT" #endif /* _XF86PRIVSTR_H */ xorg-server-1.17.1/hw/xfree86/common/xf86AutoConfig.c0000664000175100017510000003031612456571574017147 00000000000000/* * Copyright 2003 by David H. Dawes. * Copyright 2003 by X-Oz Technologies. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). * * Author: David Dawes . */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "xf86Config.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86platformBus.h" #include "xf86pciBus.h" #ifdef __sparc__ #include "xf86sbusBus.h" #endif #ifdef sun #include #include #endif /* Sections for the default built-in configuration. */ #define BUILTIN_DEVICE_NAME \ "\"Builtin Default %s Device %d\"" #define BUILTIN_DEVICE_SECTION_PRE \ "Section \"Device\"\n" \ "\tIdentifier\t" BUILTIN_DEVICE_NAME "\n" \ "\tDriver\t\"%s\"\n" #define BUILTIN_DEVICE_SECTION_POST \ "EndSection\n\n" #define BUILTIN_DEVICE_SECTION \ BUILTIN_DEVICE_SECTION_PRE \ BUILTIN_DEVICE_SECTION_POST #define BUILTIN_SCREEN_NAME \ "\"Builtin Default %s Screen %d\"" #define BUILTIN_SCREEN_SECTION \ "Section \"Screen\"\n" \ "\tIdentifier\t" BUILTIN_SCREEN_NAME "\n" \ "\tDevice\t" BUILTIN_DEVICE_NAME "\n" \ "EndSection\n\n" #define BUILTIN_LAYOUT_SECTION_PRE \ "Section \"ServerLayout\"\n" \ "\tIdentifier\t\"Builtin Default Layout\"\n" #define BUILTIN_LAYOUT_SCREEN_LINE \ "\tScreen\t" BUILTIN_SCREEN_NAME "\n" #define BUILTIN_LAYOUT_SECTION_POST \ "EndSection\n\n" static const char **builtinConfig = NULL; static int builtinLines = 0; static void listPossibleVideoDrivers(char *matches[], int nmatches); /* * A built-in config file is stored as an array of strings, with each string * representing a single line. AppendToConfig() breaks up the string "s" * into lines, and appends those lines it to builtinConfig. */ static void AppendToList(const char *s, const char ***list, int *lines) { char *str, *newstr, *p; str = xnfstrdup(s); for (p = strtok(str, "\n"); p; p = strtok(NULL, "\n")) { (*lines)++; *list = xnfrealloc(*list, (*lines + 1) * sizeof(**list)); newstr = xnfalloc(strlen(p) + 2); strcpy(newstr, p); strcat(newstr, "\n"); (*list)[*lines - 1] = newstr; (*list)[*lines] = NULL; } free(str); } static void FreeList(const char ***list, int *lines) { int i; for (i = 0; i < *lines; i++) { free((char *) ((*list)[i])); } free(*list); *list = NULL; *lines = 0; } static void FreeConfig(void) { FreeList(&builtinConfig, &builtinLines); } static void AppendToConfig(const char *s) { AppendToList(s, &builtinConfig, &builtinLines); } Bool xf86AutoConfig(void) { char *deviceList[20]; char **p; const char **cp; char buf[1024]; ConfigStatus ret; listPossibleVideoDrivers(deviceList, 20); for (p = deviceList; *p; p++) { snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p); AppendToConfig(buf); snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0); AppendToConfig(buf); } AppendToConfig(BUILTIN_LAYOUT_SECTION_PRE); for (p = deviceList; *p; p++) { snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, *p, 0); AppendToConfig(buf); } AppendToConfig(BUILTIN_LAYOUT_SECTION_POST); for (p = deviceList; *p; p++) { free(*p); } xf86MsgVerb(X_DEFAULT, 0, "Using default built-in configuration (%d lines)\n", builtinLines); xf86MsgVerb(X_DEFAULT, 3, "--- Start of built-in configuration ---\n"); for (cp = builtinConfig; *cp; cp++) xf86ErrorFVerb(3, "\t%s", *cp); xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n"); xf86initConfigFiles(); xf86setBuiltinConfig(builtinConfig); ret = xf86HandleConfigFile(TRUE); FreeConfig(); if (ret != CONFIG_OK) xf86Msg(X_ERROR, "Error parsing the built-in default configuration.\n"); return ret == CONFIG_OK; } static void listPossibleVideoDrivers(char *matches[], int nmatches) { int i; for (i = 0; i < nmatches; i++) { matches[i] = NULL; } 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 && (i < (nmatches - 1))) { struct vis_identifier visid; const char *cp; int iret; SYSCALL(iret = ioctl(xf86Info.consoleFd, VIS_GETIDENTIFIER, &visid)); if (iret < 0) { int fbfd; fbfd = open(xf86SolarisFbDev, O_RDONLY); if (fbfd >= 0) { SYSCALL(iret = ioctl(fbfd, VIS_GETIDENTIFIER, &visid)); close(fbfd); } } if (iret < 0) { xf86Msg(X_WARNING, "could not get frame buffer identifier from %s\n", xf86SolarisFbDev); } else { xf86Msg(X_PROBED, "console driver: %s\n", visid.name); /* Special case from before the general case was set */ if (strcmp(visid.name, "NVDAnvda") == 0) { matches[i++] = xnfstrdup("nvidia"); } /* General case - split into vendor name (initial all-caps prefix) & driver name (rest of the string). */ if (strcmp(visid.name, "SUNWtext") != 0) { for (cp = visid.name; (*cp != '\0') && isupper(*cp); cp++) { /* find end of all uppercase vendor section */ } if ((cp != visid.name) && (*cp != '\0')) { char *driverName = xnfstrdup(cp); char *vendorName = xnfstrdup(visid.name); vendorName[cp - visid.name] = '\0'; matches[i++] = vendorName; matches[i++] = driverName; } } } } #endif #ifdef __sparc__ if (i < (nmatches - 1)) { char *sbusDriver = sparcDriverName(); if (sbusDriver) matches[i++] = xnfstrdup(sbusDriver); } #endif #ifdef XSERVER_LIBPCIACCESS if (i < (nmatches - 1)) i += xf86PciMatchDriver(&matches[i], nmatches - i); #endif #if defined(__linux__) matches[i++] = xnfstrdup("modesetting"); #endif #if !defined(sun) /* Fallback to platform default frame buffer driver */ if (i < (nmatches - 1)) { #if !defined(__linux__) && defined(__sparc__) matches[i++] = xnfstrdup("wsfb"); #else matches[i++] = xnfstrdup("fbdev"); #endif } #endif /* !sun */ /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { #if defined(__i386__) || defined(__amd64__) || defined(__hurd__) matches[i++] = xnfstrdup("vesa"); #elif defined(__sparc__) && !defined(sun) matches[i++] = xnfstrdup("sunffb"); #endif } } /* copy a screen section and enter the desired driver * and insert it at i in the list of screens */ static Bool copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) { confScreenPtr nscreen; GDevPtr cptr = NULL; char *identifier; nscreen = malloc(sizeof(confScreenRec)); if (!nscreen) return FALSE; memcpy(nscreen, oscreen, sizeof(confScreenRec)); cptr = malloc(sizeof(GDevRec)); if (!cptr) { free(nscreen); return FALSE; } memcpy(cptr, odev, sizeof(GDevRec)); if (asprintf(&identifier, "Autoconfigured Video Device %s", driver) == -1) { free(cptr); free(nscreen); return FALSE; } cptr->driver = driver; cptr->identifier = identifier; xf86ConfigLayout.screens[i].screen = nscreen; /* now associate the new driver entry with the new screen entry */ xf86ConfigLayout.screens[i].screen->device = cptr; cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; return TRUE; } GDevPtr autoConfigDevice(GDevPtr preconf_device) { GDevPtr ptr = NULL; char *matches[20]; /* If we have more than 20 drivers we're in trouble */ int num_matches = 0, num_screens = 0, i; screenLayoutPtr slp; if (!xf86configptr) { return NULL; } /* If there's a configured section with no driver chosen, use it */ if (preconf_device) { ptr = preconf_device; } else { ptr = calloc(1, sizeof(GDevRec)); if (!ptr) { return NULL; } ptr->chipID = -1; ptr->chipRev = -1; ptr->irq = -1; ptr->active = TRUE; ptr->claimed = FALSE; ptr->identifier = "Autoconfigured Video Device"; ptr->driver = NULL; } if (!ptr->driver) { /* get all possible video drivers and count them */ listPossibleVideoDrivers(matches, 20); for (; matches[num_matches]; num_matches++) { xf86Msg(X_DEFAULT, "Matched %s as autoconfigured driver %d\n", matches[num_matches], num_matches); } slp = xf86ConfigLayout.screens; if (slp) { /* count the number of screens and make space for * a new screen for each additional possible driver * minus one for the already existing first one * plus one for the terminating NULL */ for (; slp[num_screens].screen; num_screens++); xf86ConfigLayout.screens = xnfcalloc(num_screens + num_matches, sizeof(screenLayoutRec)); xf86ConfigLayout.screens[0] = slp[0]; /* do the first match and set that for the original first screen */ ptr->driver = matches[0]; if (!xf86ConfigLayout.screens[0].screen->device) { xf86ConfigLayout.screens[0].screen->device = ptr; ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; } /* for each other driver found, copy the first screen, insert it * into the list of screens and set the driver */ i = 0; while (i++ < num_matches) { if (!copyScreen(slp[0].screen, ptr, i, matches[i])) return NULL; } /* shift the rest of the original screen list * to the end of the current screen list * * TODO Handle rest of multiple screen sections */ for (i = 1; i < num_screens; i++) { xf86ConfigLayout.screens[i + num_matches] = slp[i]; } xf86ConfigLayout.screens[num_screens + num_matches - 1].screen = NULL; free(slp); } else { /* layout does not have any screens, not much to do */ ptr->driver = matches[0]; for (i = 1; matches[i]; i++) { if (matches[i] != matches[0]) { free(matches[i]); } } } } xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n"); return ptr; } xorg-server-1.17.1/hw/xfree86/common/xf86vmode.c0000664000175100017510000021137112456571574016225 00000000000000 /* Copyright 1995 Kaleb S. KEITHLEY 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 Kaleb S. KEITHLEY 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 Kaleb S. KEITHLEY shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Kaleb S. KEITHLEY */ /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" #include "xf86Extensions.h" #include "scrnintstr.h" #include "servermd.h" #include #include "swaprep.h" #include "xf86.h" #include "vidmodeproc.h" #include "globals.h" #include "protocol-versions.h" #define DEFAULT_XF86VIDMODE_VERBOSITY 3 static int VidModeErrorBase; static DevPrivateKeyRec VidModeClientPrivateKeyRec; #define VidModeClientPrivateKey (&VidModeClientPrivateKeyRec) /* This holds the client's version information */ typedef struct { int major; int minor; } VidModePrivRec, *VidModePrivPtr; #define VM_GETPRIV(c) ((VidModePrivPtr) \ dixLookupPrivate(&(c)->devPrivates, VidModeClientPrivateKey)) #define VM_SETPRIV(c,p) \ dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p) #if 0 static unsigned char XF86VidModeReqCode = 0; #endif /* The XF86VIDMODE_EVENTS code is far from complete */ #ifdef XF86VIDMODE_EVENTS static int XF86VidModeEventBase = 0; static void SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * /* from */ , xXF86VidModeNotifyEvent * /* to */ ); static RESTYPE EventType; /* resource type for event masks */ typedef struct _XF86VidModeEvent *XF86VidModeEventPtr; typedef struct _XF86VidModeEvent { XF86VidModeEventPtr next; ClientPtr client; ScreenPtr screen; XID resource; CARD32 mask; } XF86VidModeEventRec; static int XF86VidModeFreeEvents(); typedef struct _XF86VidModeScreenPrivate { XF86VidModeEventPtr events; Bool hasWindow; } XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr; static DevPrivateKeyRec ScreenPrivateKeyRec; #define ScreenPrivateKey (&ScreenPrivateKeyRec) #define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \ dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey)) #define SetScreenPrivate(s,v) \ dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v) #define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s) #define New(t) (malloc(sizeof (t))) #endif #ifdef DEBUG #define DEBUG_P(x) ErrorF(x"\n"); #else #define DEBUG_P(x) /**/ #endif static int ClientMajorVersion(ClientPtr client) { VidModePrivPtr pPriv; pPriv = VM_GETPRIV(client); if (!pPriv) return 0; else return pPriv->major; } #ifdef XF86VIDMODE_EVENTS static void CheckScreenPrivate(pScreen) ScreenPtr pScreen; { SetupScreen(pScreen); if (!pPriv) return; if (!pPriv->events && !pPriv->hasWindow) { free(pPriv); SetScreenPrivate(pScreen, NULL); } } static XF86VidModeScreenPrivatePtr MakeScreenPrivate(pScreen) ScreenPtr pScreen; { SetupScreen(pScreen); if (pPriv) return pPriv; pPriv = New(XF86VidModeScreenPrivateRec); if (!pPriv) return 0; pPriv->events = 0; pPriv->hasWindow = FALSE; SetScreenPrivate(pScreen, pPriv); return pPriv; } static unsigned long getEventMask(ScreenPtr pScreen, ClientPtr client) { SetupScreen(pScreen); XF86VidModeEventPtr pEv; if (!pPriv) return 0; for (pEv = pPriv->events; pEv; pEv = pEv->next) if (pEv->client == client) return pEv->mask; return 0; } static Bool setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask) { SetupScreen(pScreen); XF86VidModeEventPtr pEv, *pPrev; if (getEventMask(pScreen, client) == mask) return TRUE; if (!pPriv) { pPriv = MakeScreenPrivate(pScreen); if (!pPriv) return FALSE; } for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next) if (pEv->client == client) break; if (mask == 0) { *pPrev = pEv->next; free(pEv); CheckScreenPrivate(pScreen); } else { if (!pEv) { pEv = New(ScreenSaverEventRec); if (!pEv) { CheckScreenPrivate(pScreen); return FALSE; } *pPrev = pEv; pEv->next = NULL; pEv->client = client; pEv->screen = pScreen; pEv->resource = FakeClientID(client->index); } pEv->mask = mask; } return TRUE; } static int XF86VidModeFreeEvents(void *value, XID id) { XF86VidModeEventPtr pOld = (XF86VidModeEventPtr) value; ScreenPtr pScreen = pOld->screen; SetupScreen(pScreen); XF86VidModeEventPtr pEv, *pPrev; if (!pPriv) return TRUE; for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next) if (pEv == pOld) break; if (!pEv) return TRUE; *pPrev = pEv->next; free(pEv); CheckScreenPrivate(pScreen); return TRUE; } static void SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced) { XF86VidModeScreenPrivatePtr pPriv; unsigned long mask; xXF86VidModeNotifyEvent ev; int kind; UpdateCurrentTimeIf(); mask = XF86VidModeNotifyMask; pScreen = screenInfo.screens[pScreen->myNum]; pPriv = GetScreenPrivate(pScreen); if (!pPriv) return; kind = XF86VidModeModeChange; for (pEv = pPriv->events; pEv; pEv = pEv->next) { 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) { to->type = from->type; to->state = from->state; cpswaps(from->sequenceNumber, to->sequenceNumber); cpswapl(from->timestamp, to->timestamp); cpswapl(from->root, to->root); to->kind = from->kind; to->forced = from->forced; } #endif static int ProcXF86VidModeQueryVersion(ClientPtr client) { 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); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), &rep); return Success; } static int ProcXF86VidModeGetModeLine(ClientPtr client) { REQUEST(xXF86VidModeGetModeLineReq); xXF86VidModeGetModeLineReply rep = { .type = X_Reply, .sequenceNumber = client->sequence }; void *mode; int dotClock; int ver; DEBUG_P("XF86VidModeGetModeline"); ver = ClientMajorVersion(client); REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq); if (ver < 2) { rep.length = bytes_to_int32(SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xGenericReply)); } else { rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xGenericReply)); } if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; rep.dotclock = dotClock; rep.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY); rep.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART); rep.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND); rep.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL); rep.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW); rep.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY); rep.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART); rep.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND); rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL); rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("GetModeLine - scrn: %d clock: %ld\n", stuff->screen, (unsigned long) rep.dotclock); ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", rep.hdisplay, rep.hsyncstart, rep.hsyncend, rep.htotal); ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", rep.vdisplay, rep.vsyncstart, rep.vsyncend, rep.vtotal, (unsigned long) rep.flags); } /* * Older servers sometimes had server privates that the VidMode * extention made available. So to be compatiable pretend that * there are no server privates to pass to the client */ rep.privsize = 0; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.dotclock); swaps(&rep.hdisplay); swaps(&rep.hsyncstart); swaps(&rep.hsyncend); swaps(&rep.htotal); swaps(&rep.hskew); swaps(&rep.vdisplay); swaps(&rep.vsyncstart); swaps(&rep.vsyncend); swaps(&rep.vtotal); swapl(&rep.flags); swapl(&rep.privsize); } if (ver < 2) { 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), &rep); } return Success; } static int ProcXF86VidModeGetAllModeLines(ClientPtr client) { REQUEST(xXF86VidModeGetAllModeLinesReq); xXF86VidModeGetAllModeLinesReply rep; void *mode; int modecount, dotClock; int ver; DEBUG_P("XF86VidModeGetAllModelines"); REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; ver = ClientMajorVersion(client); modecount = VidModeGetNumOfModes(stuff->screen); if (modecount < 1) return VidModeErrorBase + XF86VidModeExtensionDisabled; if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) return BadValue; 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; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.modecount); } WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), &rep); do { 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); swaps(&mdinf.hsyncstart); swaps(&mdinf.hsyncend); swaps(&mdinf.htotal); swapl(&mdinf.hskew); swaps(&mdinf.vdisplay); swaps(&mdinf.vsyncstart); swaps(&mdinf.vsyncend); swaps(&mdinf.vtotal); swapl(&mdinf.flags); swapl(&mdinf.privsize); } if (ver < 2) { 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), &mdinf); } } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); return Success; } #define MODEMATCH(mode,stuff) \ (VidModeGetModeValue(mode, VIDMODE_H_DISPLAY) == stuff->hdisplay \ && VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART) == stuff->hsyncstart \ && VidModeGetModeValue(mode, VIDMODE_H_SYNCEND) == stuff->hsyncend \ && VidModeGetModeValue(mode, VIDMODE_H_TOTAL) == stuff->htotal \ && VidModeGetModeValue(mode, VIDMODE_V_DISPLAY) == stuff->vdisplay \ && VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART) == stuff->vsyncstart \ && VidModeGetModeValue(mode, VIDMODE_V_SYNCEND) == stuff->vsyncend \ && VidModeGetModeValue(mode, VIDMODE_V_TOTAL) == stuff->vtotal \ && VidModeGetModeValue(mode, VIDMODE_FLAGS) == stuff->flags ) static int ProcXF86VidModeAddModeLine(ClientPtr client) { REQUEST(xXF86VidModeAddModeLineReq); xXF86OldVidModeAddModeLineReq *oldstuff = (xXF86OldVidModeAddModeLineReq *) client->requestBuffer; xXF86VidModeAddModeLineReq newstuff; void *mode; int len; int dotClock; int ver; DEBUG_P("XF86VidModeAddModeline"); ver = ClientMajorVersion(client); if (ver < 2) { /* convert from old format */ stuff = &newstuff; stuff->length = oldstuff->length; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay; stuff->hsyncstart = oldstuff->hsyncstart; stuff->hsyncend = oldstuff->hsyncend; stuff->htotal = oldstuff->htotal; stuff->hskew = 0; stuff->vdisplay = oldstuff->vdisplay; stuff->vsyncstart = oldstuff->vsyncstart; stuff->vsyncend = oldstuff->vsyncend; stuff->vtotal = oldstuff->vtotal; stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; stuff->after_dotclock = oldstuff->after_dotclock; stuff->after_hdisplay = oldstuff->after_hdisplay; stuff->after_hsyncstart = oldstuff->after_hsyncstart; stuff->after_hsyncend = oldstuff->after_hsyncend; stuff->after_htotal = oldstuff->after_htotal; stuff->after_hskew = 0; stuff->after_vdisplay = oldstuff->after_vdisplay; stuff->after_vsyncstart = oldstuff->after_vsyncstart; stuff->after_vsyncend = oldstuff->after_vsyncend; stuff->after_vtotal = oldstuff->after_vtotal; stuff->after_flags = oldstuff->after_flags; } if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("AddModeLine - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock); ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal, (unsigned long) stuff->flags); ErrorF(" after - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->after_dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->after_hdisplay, stuff->after_hsyncstart, stuff->after_hsyncend, stuff->after_htotal); ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->after_vdisplay, stuff->after_vsyncstart, stuff->after_vsyncend, stuff->after_vtotal, (unsigned long) stuff->after_flags); } if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeAddModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeAddModeLineReq)); } if (len != stuff->privsize) return BadLength; if (stuff->screen >= screenInfo.numScreens) return BadValue; if (stuff->hsyncstart < stuff->hdisplay || stuff->hsyncend < stuff->hsyncstart || stuff->htotal < stuff->hsyncend || stuff->vsyncstart < stuff->vdisplay || stuff->vsyncend < stuff->vsyncstart || stuff->vtotal < stuff->vsyncend) return BadValue; if (stuff->after_hsyncstart < stuff->after_hdisplay || stuff->after_hsyncend < stuff->after_hsyncstart || stuff->after_htotal < stuff->after_hsyncend || stuff->after_vsyncstart < stuff->after_vdisplay || stuff->after_vsyncend < stuff->after_vsyncstart || stuff->after_vtotal < stuff->after_vsyncend) return BadValue; if (stuff->after_htotal != 0 || stuff->after_vtotal != 0) { Bool found = FALSE; if (VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) { do { if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) && MODEMATCH(mode, stuff)) { found = TRUE; break; } } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); } if (!found) return BadValue; } mode = VidModeCreateMode(); if (mode == NULL) return BadValue; VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock); VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart); VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend); VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal); VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew); VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay); VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart); VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend); VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal); VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags); if (stuff->privsize) ErrorF("AddModeLine - Privates in request have been ignored\n"); /* Check that the mode is consistent with the monitor specs */ switch (VidModeCheckModeForMonitor(stuff->screen, mode)) { case MODE_OK: break; case MODE_HSYNC: case MODE_H_ILLEGAL: free(mode); return VidModeErrorBase + XF86VidModeBadHTimings; case MODE_VSYNC: case MODE_V_ILLEGAL: free(mode); return VidModeErrorBase + XF86VidModeBadVTimings; default: free(mode); return VidModeErrorBase + XF86VidModeModeUnsuitable; } /* Check that the driver is happy with the mode */ if (VidModeCheckModeForDriver(stuff->screen, mode) != MODE_OK) { free(mode); return VidModeErrorBase + XF86VidModeModeUnsuitable; } VidModeSetCrtcForMode(stuff->screen, mode); VidModeAddModeline(stuff->screen, mode); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("AddModeLine - Succeeded\n"); return Success; } static int ProcXF86VidModeDeleteModeLine(ClientPtr client) { REQUEST(xXF86VidModeDeleteModeLineReq); xXF86OldVidModeDeleteModeLineReq *oldstuff = (xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer; xXF86VidModeDeleteModeLineReq newstuff; void *mode; int len, dotClock; int ver; DEBUG_P("XF86VidModeDeleteModeline"); ver = ClientMajorVersion(client); if (ver < 2) { /* convert from old format */ stuff = &newstuff; stuff->length = oldstuff->length; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay; stuff->hsyncstart = oldstuff->hsyncstart; stuff->hsyncend = oldstuff->hsyncend; stuff->htotal = oldstuff->htotal; stuff->hskew = 0; stuff->vdisplay = oldstuff->vdisplay; stuff->vsyncstart = oldstuff->vsyncstart; stuff->vsyncend = oldstuff->vsyncend; stuff->vtotal = oldstuff->vtotal; stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("DeleteModeLine - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); ErrorF (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal, (unsigned long) stuff->flags); } if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeDeleteModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeDeleteModeLineReq)); } if (len != stuff->privsize) { if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, " "len = %d, length = %d\n", (unsigned long) client->req_len, (int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2, (unsigned long) stuff->privsize, len, stuff->length); } return BadLength; } if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("Checking against clock: %d (%d)\n", VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", VidModeGetModeValue(mode, VIDMODE_H_DISPLAY), VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART), VidModeGetModeValue(mode, VIDMODE_H_SYNCEND), VidModeGetModeValue(mode, VIDMODE_H_TOTAL)); ErrorF (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", VidModeGetModeValue(mode, VIDMODE_V_DISPLAY), VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART), VidModeGetModeValue(mode, VIDMODE_V_SYNCEND), VidModeGetModeValue(mode, VIDMODE_V_TOTAL), VidModeGetModeValue(mode, VIDMODE_FLAGS)); } if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) && MODEMATCH(mode, stuff)) return BadValue; if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) return BadValue; do { if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("Checking against clock: %d (%d)\n", VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", VidModeGetModeValue(mode, VIDMODE_H_DISPLAY), VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART), VidModeGetModeValue(mode, VIDMODE_H_SYNCEND), VidModeGetModeValue(mode, VIDMODE_H_TOTAL)); ErrorF (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", VidModeGetModeValue(mode, VIDMODE_V_DISPLAY), VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART), VidModeGetModeValue(mode, VIDMODE_V_SYNCEND), VidModeGetModeValue(mode, VIDMODE_V_TOTAL), VidModeGetModeValue(mode, VIDMODE_FLAGS)); } if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) && MODEMATCH(mode, stuff)) { VidModeDeleteModeline(stuff->screen, mode); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("DeleteModeLine - Succeeded\n"); return Success; } } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); return BadValue; } static int ProcXF86VidModeModModeLine(ClientPtr client) { REQUEST(xXF86VidModeModModeLineReq); xXF86OldVidModeModModeLineReq *oldstuff = (xXF86OldVidModeModModeLineReq *) client->requestBuffer; xXF86VidModeModModeLineReq newstuff; void *mode, *modetmp; int len, dotClock; int ver; DEBUG_P("XF86VidModeModModeline"); ver = ClientMajorVersion(client); if (ver < 2) { /* convert from old format */ stuff = &newstuff; stuff->length = oldstuff->length; stuff->screen = oldstuff->screen; stuff->hdisplay = oldstuff->hdisplay; stuff->hsyncstart = oldstuff->hsyncstart; stuff->hsyncend = oldstuff->hsyncend; stuff->htotal = oldstuff->htotal; stuff->hskew = 0; stuff->vdisplay = oldstuff->vdisplay; stuff->vsyncstart = oldstuff->vsyncstart; stuff->vsyncend = oldstuff->vsyncend; stuff->vtotal = oldstuff->vtotal; stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n", (int) stuff->screen, stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal, (unsigned long) stuff->flags); } if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeModModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeModModeLineReq)); } if (len != stuff->privsize) return BadLength; if (stuff->hsyncstart < stuff->hdisplay || stuff->hsyncend < stuff->hsyncstart || stuff->htotal < stuff->hsyncend || stuff->vsyncstart < stuff->vdisplay || stuff->vsyncend < stuff->vsyncstart || stuff->vtotal < stuff->vsyncend) return BadValue; if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; modetmp = VidModeCreateMode(); VidModeCopyMode(mode, modetmp); VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart); VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend); VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal); VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew); VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay); VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart); VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend); VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal); VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags); if (stuff->privsize) ErrorF("ModModeLine - Privates in request have been ignored\n"); /* Check that the mode is consistent with the monitor specs */ switch (VidModeCheckModeForMonitor(stuff->screen, modetmp)) { case MODE_OK: break; case MODE_HSYNC: case MODE_H_ILLEGAL: free(modetmp); return VidModeErrorBase + XF86VidModeBadHTimings; case MODE_VSYNC: case MODE_V_ILLEGAL: free(modetmp); return VidModeErrorBase + XF86VidModeBadVTimings; default: free(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } /* Check that the driver is happy with the mode */ if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) { free(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } free(modetmp); VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart); VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend); VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal); VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew); VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay); VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart); VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend); VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal); VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags); VidModeSetCrtcForMode(stuff->screen, mode); VidModeSwitchMode(stuff->screen, mode); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("ModModeLine - Succeeded\n"); return Success; } static int ProcXF86VidModeValidateModeLine(ClientPtr client) { REQUEST(xXF86VidModeValidateModeLineReq); xXF86OldVidModeValidateModeLineReq *oldstuff = (xXF86OldVidModeValidateModeLineReq *) client->requestBuffer; xXF86VidModeValidateModeLineReq newstuff; xXF86VidModeValidateModeLineReply rep; void *mode, *modetmp = NULL; int len, status, dotClock; int ver; DEBUG_P("XF86VidModeValidateModeline"); ver = ClientMajorVersion(client); if (ver < 2) { /* convert from old format */ stuff = &newstuff; stuff->length = oldstuff->length; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay; stuff->hsyncstart = oldstuff->hsyncstart; stuff->hsyncend = oldstuff->hsyncend; stuff->htotal = oldstuff->htotal; stuff->hskew = 0; stuff->vdisplay = oldstuff->vdisplay; stuff->vsyncstart = oldstuff->vsyncstart; stuff->vsyncend = oldstuff->vsyncend; stuff->vtotal = oldstuff->vtotal; stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("ValidateModeLine - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); ErrorF (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal, (unsigned long) stuff->flags); } if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeValidateModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq); len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeValidateModeLineReq)); } if (len != stuff->privsize) return BadLength; if (stuff->screen >= screenInfo.numScreens) return BadValue; status = MODE_OK; if (stuff->hsyncstart < stuff->hdisplay || stuff->hsyncend < stuff->hsyncstart || stuff->htotal < stuff->hsyncend || stuff->vsyncstart < stuff->vdisplay || stuff->vsyncend < stuff->vsyncstart || stuff->vtotal < stuff->vsyncend) { status = MODE_BAD; goto status_reply; } if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; modetmp = VidModeCreateMode(); VidModeCopyMode(mode, modetmp); VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart); VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend); VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal); VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew); VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay); VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart); VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend); VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal); VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags); if (stuff->privsize) ErrorF("ValidateModeLine - Privates in request have been ignored\n"); /* Check that the mode is consistent with the monitor specs */ if ((status = VidModeCheckModeForMonitor(stuff->screen, modetmp)) != MODE_OK) goto status_reply; /* Check that the driver is happy with the mode */ status = VidModeCheckModeForDriver(stuff->screen, modetmp); status_reply: free(modetmp); 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), &rep); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status); return Success; } static int ProcXF86VidModeSwitchMode(ClientPtr client) { REQUEST(xXF86VidModeSwitchModeReq); DEBUG_P("XF86VidModeSwitchMode"); REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; VidModeZoomViewport(stuff->screen, (short) stuff->zoom); return Success; } static int ProcXF86VidModeSwitchToMode(ClientPtr client) { REQUEST(xXF86VidModeSwitchToModeReq); xXF86OldVidModeSwitchToModeReq *oldstuff = (xXF86OldVidModeSwitchToModeReq *) client->requestBuffer; xXF86VidModeSwitchToModeReq newstuff; void *mode; int len, dotClock; int ver; DEBUG_P("XF86VidModeSwitchToMode"); ver = ClientMajorVersion(client); if (ver < 2) { /* convert from old format */ stuff = &newstuff; stuff->length = oldstuff->length; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay; stuff->hsyncstart = oldstuff->hsyncstart; stuff->hsyncend = oldstuff->hsyncend; stuff->htotal = oldstuff->htotal; stuff->hskew = 0; stuff->vdisplay = oldstuff->vdisplay; stuff->vsyncstart = oldstuff->vsyncstart; stuff->vsyncend = oldstuff->vsyncend; stuff->vtotal = oldstuff->vtotal; stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("SwitchToMode - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); ErrorF (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal, (unsigned long) stuff->flags); } if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeSwitchToModeReq); len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeSwitchToModeReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeSwitchToModeReq); len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeSwitchToModeReq)); } if (len != stuff->privsize) return BadLength; if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) && MODEMATCH(mode, stuff)) return Success; if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) return BadValue; do { if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("Checking against clock: %d (%d)\n", VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", VidModeGetModeValue(mode, VIDMODE_H_DISPLAY), VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART), VidModeGetModeValue(mode, VIDMODE_H_SYNCEND), VidModeGetModeValue(mode, VIDMODE_H_TOTAL)); ErrorF (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", VidModeGetModeValue(mode, VIDMODE_V_DISPLAY), VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART), VidModeGetModeValue(mode, VIDMODE_V_SYNCEND), VidModeGetModeValue(mode, VIDMODE_V_TOTAL), VidModeGetModeValue(mode, VIDMODE_FLAGS)); } if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) && MODEMATCH(mode, stuff)) { if (!VidModeSwitchMode(stuff->screen, mode)) return BadValue; if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("SwitchToMode - Succeeded\n"); return Success; } } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); return BadValue; } static int ProcXF86VidModeLockModeSwitch(ClientPtr client) { REQUEST(xXF86VidModeLockModeSwitchReq); REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq); DEBUG_P("XF86VidModeLockModeSwitch"); if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeLockZoom(stuff->screen, (short) stuff->lock)) return VidModeErrorBase + XF86VidModeZoomLocked; return Success; } static int ProcXF86VidModeGetMonitor(ClientPtr client) { REQUEST(xXF86VidModeGetMonitorReq); xXF86VidModeGetMonitorReply rep = { .type = X_Reply, .sequenceNumber = client->sequence }; CARD32 *hsyncdata, *vsyncdata; int i, nHsync, nVrefresh; void *monitor; DEBUG_P("XF86VidModeGetMonitor"); REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeGetMonitor(stuff->screen, &monitor)) return BadValue; nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i; nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i; if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr) rep.vendorLength = strlen((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr); else rep.vendorLength = 0; if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr) rep.modelLength = strlen((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr); else rep.modelLength = 0; rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetMonitorReply) - SIZEOF(xGenericReply) + (nHsync + nVrefresh) * sizeof(CARD32) + pad_to_int32(rep.vendorLength) + pad_to_int32(rep.modelLength)); rep.nhsync = nHsync; rep.nvsync = nVrefresh; hsyncdata = malloc(nHsync * sizeof(CARD32)); if (!hsyncdata) { return BadAlloc; } vsyncdata = malloc(nVrefresh * sizeof(CARD32)); if (!vsyncdata) { free(hsyncdata); return BadAlloc; } for (i = 0; i < nHsync; i++) { hsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_HSYNC_LO, i)).f | (unsigned short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_HSYNC_HI, i)).f << 16; } for (i = 0; i < nVrefresh; i++) { vsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VREFRESH_LO, i)).f | (unsigned short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VREFRESH_HI, i)).f << 16; } if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } 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, (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr); if (rep.modelLength) WriteToClient(client, rep.modelLength, (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr); free(hsyncdata); free(vsyncdata); return Success; } static int ProcXF86VidModeGetViewPort(ClientPtr client) { REQUEST(xXF86VidModeGetViewPortReq); xXF86VidModeGetViewPortReply rep; int x, y; DEBUG_P("XF86VidModeGetViewPort"); REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; VidModeGetViewPort(stuff->screen, &x, &y); rep = (xXF86VidModeGetViewPortReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .x = x, .y = y }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.x); swapl(&rep.y); } WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), &rep); return Success; } static int ProcXF86VidModeSetViewPort(ClientPtr client) { REQUEST(xXF86VidModeSetViewPortReq); DEBUG_P("XF86VidModeSetViewPort"); REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y)) return BadValue; return Success; } static int ProcXF86VidModeGetDotClocks(ClientPtr client) { REQUEST(xXF86VidModeGetDotClocksReq); xXF86VidModeGetDotClocksReply rep; int n; int numClocks; CARD32 dotclock; int *Clocks = NULL; Bool ClockProg; DEBUG_P("XF86VidModeGetDotClocks"); REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg); 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 = calloc(numClocks, sizeof(int)); if (!Clocks) return BadValue; if (!VidModeGetClocks(stuff->screen, Clocks)) { free(Clocks); return BadValue; } } if (ClockProg) { rep.flags |= CLKFLAG_PROGRAMABLE; } if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.clocks); swapl(&rep.maxclocks); swapl(&rep.flags); } WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), &rep); if (!ClockProg) { for (n = 0; n < numClocks; n++) { dotclock = *Clocks++; if (client->swapped) { WriteSwappedDataToClient(client, 4, (char *) &dotclock); } else { WriteToClient(client, 4, &dotclock); } } } free(Clocks); return Success; } static int ProcXF86VidModeSetGamma(ClientPtr client) { REQUEST(xXF86VidModeSetGammaReq); DEBUG_P("XF86VidModeSetGamma"); REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeSetGamma(stuff->screen, ((float) stuff->red) / 10000., ((float) stuff->green) / 10000., ((float) stuff->blue) / 10000.)) return BadValue; return Success; } static int ProcXF86VidModeGetGamma(ClientPtr client) { REQUEST(xXF86VidModeGetGammaReq); xXF86VidModeGetGammaReply rep; float red, green, blue; DEBUG_P("XF86VidModeGetGamma"); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!VidModeGetGamma(stuff->screen, &red, &green, &blue)) return BadValue; 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); swapl(&rep.red); swapl(&rep.green); swapl(&rep.blue); } WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), &rep); return Success; } static int ProcXF86VidModeSetGammaRamp(ClientPtr client) { CARD16 *r, *g, *b; int length; REQUEST(xXF86VidModeSetGammaRampReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; if (stuff->size != VidModeGetGammaRampSize(stuff->screen)) return BadValue; length = (stuff->size + 1) & ~1; REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length * 6); r = (CARD16 *) &stuff[1]; g = r + length; b = g + length; if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b)) return BadValue; return Success; } static int ProcXF86VidModeGetGammaRamp(ClientPtr client) { CARD16 *ramp = NULL; int length; size_t ramplen = 0; xXF86VidModeGetGammaRampReply rep; REQUEST(xXF86VidModeGetGammaRampReq); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; if (stuff->size != VidModeGetGammaRampSize(stuff->screen)) return BadValue; length = (stuff->size + 1) & ~1; if (stuff->size) { ramplen = length * 3 * sizeof(CARD16); if (!(ramp = malloc(ramplen))) return BadAlloc; if (!VidModeGetGammaRamp(stuff->screen, stuff->size, ramp, ramp + length, ramp + (length * 2))) { free(ramp); return BadValue; } } 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), &rep); if (stuff->size) { WriteToClient(client, ramplen, ramp); free(ramp); } return Success; } static int ProcXF86VidModeGetGammaRampSize(ClientPtr client) { xXF86VidModeGetGammaRampSizeReply rep; REQUEST(xXF86VidModeGetGammaRampSizeReq); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); if (stuff->screen >= screenInfo.numScreens) return BadValue; 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), &rep); return Success; } static int ProcXF86VidModeGetPermissions(ClientPtr client) { 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; if (xf86GetVidModeEnabled() && (xf86GetVidModeAllowNonLocal() || client->local)) { rep.permissions |= XF86VM_WRITE_PERMISSION; } if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.permissions); } WriteToClient(client, sizeof(xXF86VidModeGetPermissionsReply), &rep); return Success; } static int ProcXF86VidModeSetClientVersion(ClientPtr client) { REQUEST(xXF86VidModeSetClientVersionReq); VidModePrivPtr pPriv; DEBUG_P("XF86VidModeSetClientVersion"); REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq); if ((pPriv = VM_GETPRIV(client)) == NULL) { pPriv = malloc(sizeof(VidModePrivRec)); if (!pPriv) return BadAlloc; VM_SETPRIV(client, pPriv); } pPriv->major = stuff->major; pPriv->minor = stuff->minor; return Success; } static int ProcXF86VidModeDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XF86VidModeQueryVersion: return ProcXF86VidModeQueryVersion(client); case X_XF86VidModeGetModeLine: return ProcXF86VidModeGetModeLine(client); case X_XF86VidModeGetMonitor: return ProcXF86VidModeGetMonitor(client); case X_XF86VidModeGetAllModeLines: return ProcXF86VidModeGetAllModeLines(client); case X_XF86VidModeValidateModeLine: return ProcXF86VidModeValidateModeLine(client); case X_XF86VidModeGetViewPort: return ProcXF86VidModeGetViewPort(client); case X_XF86VidModeGetDotClocks: return ProcXF86VidModeGetDotClocks(client); case X_XF86VidModeSetClientVersion: return ProcXF86VidModeSetClientVersion(client); case X_XF86VidModeGetGamma: return ProcXF86VidModeGetGamma(client); case X_XF86VidModeGetGammaRamp: return ProcXF86VidModeGetGammaRamp(client); case X_XF86VidModeGetGammaRampSize: return ProcXF86VidModeGetGammaRampSize(client); case X_XF86VidModeGetPermissions: return ProcXF86VidModeGetPermissions(client); default: if (!xf86GetVidModeEnabled()) return VidModeErrorBase + XF86VidModeExtensionDisabled; if (xf86GetVidModeAllowNonLocal() || client->local) { switch (stuff->data) { case X_XF86VidModeAddModeLine: return ProcXF86VidModeAddModeLine(client); case X_XF86VidModeDeleteModeLine: return ProcXF86VidModeDeleteModeLine(client); case X_XF86VidModeModModeLine: return ProcXF86VidModeModModeLine(client); case X_XF86VidModeSwitchMode: return ProcXF86VidModeSwitchMode(client); case X_XF86VidModeSwitchToMode: return ProcXF86VidModeSwitchToMode(client); case X_XF86VidModeLockModeSwitch: return ProcXF86VidModeLockModeSwitch(client); case X_XF86VidModeSetViewPort: return ProcXF86VidModeSetViewPort(client); case X_XF86VidModeSetGamma: return ProcXF86VidModeSetGamma(client); case X_XF86VidModeSetGammaRamp: return ProcXF86VidModeSetGammaRamp(client); default: return BadRequest; } } else return VidModeErrorBase + XF86VidModeClientNotLocal; } } static int SProcXF86VidModeQueryVersion(ClientPtr client) { REQUEST(xXF86VidModeQueryVersionReq); swaps(&stuff->length); return ProcXF86VidModeQueryVersion(client); } static int SProcXF86VidModeGetModeLine(ClientPtr client) { REQUEST(xXF86VidModeGetModeLineReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq); swaps(&stuff->screen); return ProcXF86VidModeGetModeLine(client); } static int SProcXF86VidModeGetAllModeLines(ClientPtr client) { REQUEST(xXF86VidModeGetAllModeLinesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq); swaps(&stuff->screen); return ProcXF86VidModeGetAllModeLines(client); } static int SProcXF86VidModeAddModeLine(ClientPtr client) { xXF86OldVidModeAddModeLineReq *oldstuff = (xXF86OldVidModeAddModeLineReq *) client->requestBuffer; int ver; REQUEST(xXF86VidModeAddModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq); swapl(&oldstuff->screen); swaps(&oldstuff->hdisplay); swaps(&oldstuff->hsyncstart); swaps(&oldstuff->hsyncend); swaps(&oldstuff->htotal); swaps(&oldstuff->vdisplay); swaps(&oldstuff->vsyncstart); swaps(&oldstuff->vsyncend); swaps(&oldstuff->vtotal); swapl(&oldstuff->flags); swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq); swapl(&stuff->screen); swaps(&stuff->hdisplay); swaps(&stuff->hsyncstart); swaps(&stuff->hsyncend); swaps(&stuff->htotal); swaps(&stuff->hskew); swaps(&stuff->vdisplay); swaps(&stuff->vsyncstart); swaps(&stuff->vsyncend); swaps(&stuff->vtotal); swapl(&stuff->flags); swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeAddModeLine(client); } static int SProcXF86VidModeDeleteModeLine(ClientPtr client) { xXF86OldVidModeDeleteModeLineReq *oldstuff = (xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer; int ver; REQUEST(xXF86VidModeDeleteModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq); swapl(&oldstuff->screen); swaps(&oldstuff->hdisplay); swaps(&oldstuff->hsyncstart); swaps(&oldstuff->hsyncend); swaps(&oldstuff->htotal); swaps(&oldstuff->vdisplay); swaps(&oldstuff->vsyncstart); swaps(&oldstuff->vsyncend); swaps(&oldstuff->vtotal); swapl(&oldstuff->flags); swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq); swapl(&stuff->screen); swaps(&stuff->hdisplay); swaps(&stuff->hsyncstart); swaps(&stuff->hsyncend); swaps(&stuff->htotal); swaps(&stuff->hskew); swaps(&stuff->vdisplay); swaps(&stuff->vsyncstart); swaps(&stuff->vsyncend); swaps(&stuff->vtotal); swapl(&stuff->flags); swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeDeleteModeLine(client); } static int SProcXF86VidModeModModeLine(ClientPtr client) { xXF86OldVidModeModModeLineReq *oldstuff = (xXF86OldVidModeModModeLineReq *) client->requestBuffer; int ver; REQUEST(xXF86VidModeModModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq); swapl(&oldstuff->screen); swaps(&oldstuff->hdisplay); swaps(&oldstuff->hsyncstart); swaps(&oldstuff->hsyncend); swaps(&oldstuff->htotal); swaps(&oldstuff->vdisplay); swaps(&oldstuff->vsyncstart); swaps(&oldstuff->vsyncend); swaps(&oldstuff->vtotal); swapl(&oldstuff->flags); swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq); swapl(&stuff->screen); swaps(&stuff->hdisplay); swaps(&stuff->hsyncstart); swaps(&stuff->hsyncend); swaps(&stuff->htotal); swaps(&stuff->hskew); swaps(&stuff->vdisplay); swaps(&stuff->vsyncstart); swaps(&stuff->vsyncend); swaps(&stuff->vtotal); swapl(&stuff->flags); swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeModModeLine(client); } static int SProcXF86VidModeValidateModeLine(ClientPtr client) { xXF86OldVidModeValidateModeLineReq *oldstuff = (xXF86OldVidModeValidateModeLineReq *) client->requestBuffer; int ver; REQUEST(xXF86VidModeValidateModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq); swapl(&oldstuff->screen); swaps(&oldstuff->hdisplay); swaps(&oldstuff->hsyncstart); swaps(&oldstuff->hsyncend); swaps(&oldstuff->htotal); swaps(&oldstuff->vdisplay); swaps(&oldstuff->vsyncstart); swaps(&oldstuff->vsyncend); swaps(&oldstuff->vtotal); swapl(&oldstuff->flags); swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq); swapl(&stuff->screen); swaps(&stuff->hdisplay); swaps(&stuff->hsyncstart); swaps(&stuff->hsyncend); swaps(&stuff->htotal); swaps(&stuff->hskew); swaps(&stuff->vdisplay); swaps(&stuff->vsyncstart); swaps(&stuff->vsyncend); swaps(&stuff->vtotal); swapl(&stuff->flags); swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeValidateModeLine(client); } static int SProcXF86VidModeSwitchMode(ClientPtr client) { REQUEST(xXF86VidModeSwitchModeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq); swaps(&stuff->screen); swaps(&stuff->zoom); return ProcXF86VidModeSwitchMode(client); } static int SProcXF86VidModeSwitchToMode(ClientPtr client) { REQUEST(xXF86VidModeSwitchToModeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq); swapl(&stuff->screen); return ProcXF86VidModeSwitchToMode(client); } static int SProcXF86VidModeLockModeSwitch(ClientPtr client) { REQUEST(xXF86VidModeLockModeSwitchReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq); swaps(&stuff->screen); swaps(&stuff->lock); return ProcXF86VidModeLockModeSwitch(client); } static int SProcXF86VidModeGetMonitor(ClientPtr client) { REQUEST(xXF86VidModeGetMonitorReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq); swaps(&stuff->screen); return ProcXF86VidModeGetMonitor(client); } static int SProcXF86VidModeGetViewPort(ClientPtr client) { REQUEST(xXF86VidModeGetViewPortReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq); swaps(&stuff->screen); return ProcXF86VidModeGetViewPort(client); } static int SProcXF86VidModeSetViewPort(ClientPtr client) { REQUEST(xXF86VidModeSetViewPortReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq); swaps(&stuff->screen); swapl(&stuff->x); swapl(&stuff->y); return ProcXF86VidModeSetViewPort(client); } static int SProcXF86VidModeGetDotClocks(ClientPtr client) { REQUEST(xXF86VidModeGetDotClocksReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq); swaps(&stuff->screen); return ProcXF86VidModeGetDotClocks(client); } static int SProcXF86VidModeSetClientVersion(ClientPtr client) { REQUEST(xXF86VidModeSetClientVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq); swaps(&stuff->major); swaps(&stuff->minor); return ProcXF86VidModeSetClientVersion(client); } static int SProcXF86VidModeSetGamma(ClientPtr client) { REQUEST(xXF86VidModeSetGammaReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq); swaps(&stuff->screen); swapl(&stuff->red); swapl(&stuff->green); swapl(&stuff->blue); return ProcXF86VidModeSetGamma(client); } static int SProcXF86VidModeGetGamma(ClientPtr client) { REQUEST(xXF86VidModeGetGammaReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq); swaps(&stuff->screen); return ProcXF86VidModeGetGamma(client); } static int SProcXF86VidModeSetGammaRamp(ClientPtr client) { int length; REQUEST(xXF86VidModeSetGammaRampReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq); swaps(&stuff->size); swaps(&stuff->screen); length = ((stuff->size + 1) & ~1) * 6; REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length); SwapRestS(stuff); return ProcXF86VidModeSetGammaRamp(client); } static int SProcXF86VidModeGetGammaRamp(ClientPtr client) { REQUEST(xXF86VidModeGetGammaRampReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); swaps(&stuff->size); swaps(&stuff->screen); return ProcXF86VidModeGetGammaRamp(client); } static int SProcXF86VidModeGetGammaRampSize(ClientPtr client) { REQUEST(xXF86VidModeGetGammaRampSizeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); swaps(&stuff->screen); return ProcXF86VidModeGetGammaRampSize(client); } static int SProcXF86VidModeGetPermissions(ClientPtr client) { REQUEST(xXF86VidModeGetPermissionsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq); swaps(&stuff->screen); return ProcXF86VidModeGetPermissions(client); } static int SProcXF86VidModeDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_XF86VidModeQueryVersion: return SProcXF86VidModeQueryVersion(client); case X_XF86VidModeGetModeLine: return SProcXF86VidModeGetModeLine(client); case X_XF86VidModeGetMonitor: return SProcXF86VidModeGetMonitor(client); case X_XF86VidModeGetAllModeLines: return SProcXF86VidModeGetAllModeLines(client); case X_XF86VidModeGetViewPort: return SProcXF86VidModeGetViewPort(client); case X_XF86VidModeValidateModeLine: return SProcXF86VidModeValidateModeLine(client); case X_XF86VidModeGetDotClocks: return SProcXF86VidModeGetDotClocks(client); case X_XF86VidModeSetClientVersion: return SProcXF86VidModeSetClientVersion(client); case X_XF86VidModeGetGamma: return SProcXF86VidModeGetGamma(client); case X_XF86VidModeGetGammaRamp: return SProcXF86VidModeGetGammaRamp(client); case X_XF86VidModeGetGammaRampSize: return SProcXF86VidModeGetGammaRampSize(client); case X_XF86VidModeGetPermissions: return SProcXF86VidModeGetPermissions(client); default: if (!xf86GetVidModeEnabled()) return VidModeErrorBase + XF86VidModeExtensionDisabled; if (xf86GetVidModeAllowNonLocal() || client->local) { switch (stuff->data) { case X_XF86VidModeAddModeLine: return SProcXF86VidModeAddModeLine(client); case X_XF86VidModeDeleteModeLine: return SProcXF86VidModeDeleteModeLine(client); case X_XF86VidModeModModeLine: return SProcXF86VidModeModModeLine(client); case X_XF86VidModeSwitchMode: return SProcXF86VidModeSwitchMode(client); case X_XF86VidModeSwitchToMode: return SProcXF86VidModeSwitchToMode(client); case X_XF86VidModeLockModeSwitch: return SProcXF86VidModeLockModeSwitch(client); case X_XF86VidModeSetViewPort: return SProcXF86VidModeSetViewPort(client); case X_XF86VidModeSetGamma: return SProcXF86VidModeSetGamma(client); case X_XF86VidModeSetGammaRamp: return SProcXF86VidModeSetGammaRamp(client); default: return BadRequest; } } else return VidModeErrorBase + XF86VidModeClientNotLocal; } } void XFree86VidModeExtensionInit(void) { ExtensionEntry *extEntry; ScreenPtr pScreen; int i; Bool enabled = FALSE; DEBUG_P("XFree86VidModeExtensionInit"); if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0)) return; #ifdef XF86VIDMODE_EVENTS if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return; #endif #ifdef XF86VIDMODE_EVENTS EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent"); #endif for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; if (VidModeExtensionInit(pScreen)) enabled = TRUE; } /* This means that the DDX doesn't want the vidmode extension enabled */ if (!enabled) return; if ( #ifdef XF86VIDMODE_EVENTS EventType && #endif (extEntry = AddExtension(XF86VIDMODENAME, XF86VidModeNumberEvents, XF86VidModeNumberErrors, ProcXF86VidModeDispatch, SProcXF86VidModeDispatch, NULL, StandardMinorOpcode))) { #if 0 XF86VidModeReqCode = (unsigned char) extEntry->base; #endif VidModeErrorBase = extEntry->errorBase; #ifdef XF86VIDMODE_EVENTS XF86VidModeEventBase = extEntry->eventBase; EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr) SXF86VidModeNotifyEvent; #endif } } xorg-server-1.17.1/hw/xfree86/common/xf86Events.c0000664000175100017510000005165312366751547016364 00000000000000/* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * 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 Thomas Roell not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Thomas Roell makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THOMAS ROELL 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. * */ /* * Copyright (c) 1994-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* [JCH-96/01/21] Extended std reverse map to four buttons. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "misc.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSlib.h" #include #ifdef XFreeXDGA #include "dgaproc.h" #endif #include #include #include "inputstr.h" #include "xf86Xinput.h" #include "mi.h" #include "mipointer.h" #include "xkbsrv.h" #include "xkbstr.h" #ifdef DPMSExtension #include #include "dpmsproc.h" #endif #include "xf86platformBus.h" #include "systemd-logind.h" /* * This is a toggling variable: * FALSE = No VT switching keys have been pressed last time around * TRUE = Possible VT switch Pending * (DWH - 12/2/93) * * This has been generalised to work with Linux and *BSD+syscons (DHD) */ Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for *BSD and for avoiding VT switches when using the DRI automatic full screen mode.*/ extern fd_set EnabledDevices; #ifdef XF86PM extern void (*xf86OSPMClose) (void); #endif static void xf86VTSwitch(void); /* * Allow arbitrary drivers or other XFree86 code to register with our main * Wakeup handler. */ typedef struct x_IHRec { int fd; InputHandlerProc ihproc; void *data; Bool enabled; Bool is_input; struct x_IHRec *next; } IHRec, *IHPtr; static IHPtr InputHandlers = NULL; Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) { return TRUE; } /* * TimeSinceLastInputEvent -- * Function used for screensaver purposes by the os module. Returns the * time in milliseconds since there last was any input. */ int TimeSinceLastInputEvent(void) { if (xf86Info.lastEventTime == 0) { xf86Info.lastEventTime = GetTimeInMillis(); } return GetTimeInMillis() - xf86Info.lastEventTime; } /* * SetTimeSinceLastInputEvent -- * Set the lastEventTime to now. */ void SetTimeSinceLastInputEvent(void) { xf86Info.lastEventTime = GetTimeInMillis(); } /* * ProcessInputEvents -- * Retrieve all waiting input events and pass them to DIX in their * correct chronological order. Only reads from the system pointer * and keyboard. */ void ProcessInputEvents(void) { int x, y; mieqProcessInputEvents(); /* FIXME: This is a problem if we have multiple pointers */ miPointerGetPosition(inputInfo.pointer, &x, &y); xf86SetViewport(xf86Info.currentScreen, x, y); } /* * Handle keyboard events that cause some kind of "action" * (i.e., server termination, video mode changes, VT switches, etc.) */ void xf86ProcessActionEvent(ActionEvent action, void *arg) { DebugF("ProcessActionEvent(%d,%x)\n", (int) action, arg); switch (action) { case ACTION_TERMINATE: if (!xf86Info.dontZap) { xf86Msg(X_INFO, "Server zapped. Shutting down.\n"); #ifdef XFreeXDGA DGAShutdown(); #endif GiveUp(0); } break; case ACTION_NEXT_MODE: if (!xf86Info.dontZoom) xf86ZoomViewport(xf86Info.currentScreen, 1); break; case ACTION_PREV_MODE: if (!xf86Info.dontZoom) xf86ZoomViewport(xf86Info.currentScreen, -1); break; case ACTION_SWITCHSCREEN: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { int vtno = *((int *) arg); if (vtno != xf86Info.vtno) { if (!xf86VTActivate(vtno)) { ErrorF("Failed to switch from vt%02d to vt%02d: %s\n", xf86Info.vtno, vtno, strerror(errno)); } } } break; case ACTION_SWITCHSCREEN_NEXT: if (VTSwitchEnabled && !xf86Info.dontVTSwitch) { if (!xf86VTActivate(xf86Info.vtno + 1)) { /* If first try failed, assume this is the last VT and * try wrapping around to the first vt. */ if (!xf86VTActivate(1)) { ErrorF("Failed to switch from vt%02d to next vt: %s\n", xf86Info.vtno, strerror(errno)); } } } break; case ACTION_SWITCHSCREEN_PREV: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) { if (!xf86VTActivate(xf86Info.vtno - 1)) { /* Don't know what the maximum VT is, so can't wrap around */ ErrorF("Failed to switch from vt%02d to previous vt: %s\n", xf86Info.vtno, strerror(errno)); } } break; default: break; } } /* * xf86Wakeup -- * Os wakeup handler. */ /* ARGSUSED */ void xf86Wakeup(void *blockData, int err, void *pReadmask) { fd_set *LastSelectMask = (fd_set *) pReadmask; fd_set devicesWithInput; InputInfoPtr pInfo; if (err >= 0) { XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices); if (XFD_ANYSET(&devicesWithInput)) { pInfo = xf86InputDevs; while (pInfo) { if (pInfo->read_input && pInfo->fd >= 0 && (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) { OsBlockSIGIO(); /* * Remove the descriptior from the set because more than one * device may share the same file descriptor. */ FD_CLR(pInfo->fd, &devicesWithInput); pInfo->read_input(pInfo); OsReleaseSIGIO(); } pInfo = pInfo->next; } } } if (err >= 0) { /* we don't want the handlers called if select() */ IHPtr ih, ih_tmp; /* returned with an error condition, do we? */ 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); } } } if (xf86VTSwitchPending()) xf86VTSwitch(); } /* * xf86SigioReadInput -- * signal handler for the SIGIO signal. */ static void xf86SigioReadInput(int fd, void *closure) { int errno_save = errno; InputInfoPtr pInfo = closure; pInfo->read_input(pInfo); errno = errno_save; } /* * xf86AddEnabledDevice -- * */ void xf86AddEnabledDevice(InputInfoPtr pInfo) { if (!xf86InstallSIGIOHandler(pInfo->fd, xf86SigioReadInput, pInfo)) { AddEnabledDevice(pInfo->fd); } } /* * xf86RemoveEnabledDevice -- * */ void xf86RemoveEnabledDevice(InputInfoPtr pInfo) { if (!xf86RemoveSIGIOHandler(pInfo->fd)) { RemoveEnabledDevice(pInfo->fd); } } static int *xf86SignalIntercept = NULL; void xf86InterceptSignals(int *signo) { if ((xf86SignalIntercept = signo)) *signo = -1; } static void (*xf86SigIllHandler) (void) = NULL; void xf86InterceptSigIll(void (*sigillhandler) (void)) { xf86SigIllHandler = sigillhandler; } /* * xf86SigWrapper -- * Catch unexpected signals and exit or continue cleanly. */ int xf86SigWrapper(int signo) { if ((signo == SIGILL) && xf86SigIllHandler) { (*xf86SigIllHandler) (); return 0; /* continue */ } if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) { *xf86SignalIntercept = signo; return 0; /* continue */ } xf86Info.caughtSignal = TRUE; return 1; /* abort */ } /* * xf86PrintBacktrace -- * Print a stack backtrace for debugging purposes. */ void xf86PrintBacktrace(void) { xorg_backtrace(); } static void xf86ReleaseKeys(DeviceIntPtr pDev) { KeyClassPtr keyc; int i; if (!pDev || !pDev->key) return; keyc = pDev->key; /* * Hmm... here is the biggest hack of every time ! * It may be possible that a switch-vt procedure has finished BEFORE * you released all keys neccessary to do this. That peculiar behavior * can fool the X-server pretty much, cause it assumes that some keys * were not released. TWM may stuck alsmost completly.... * OK, what we are doing here is after returning from the vt-switch * exeplicitely unrelease all keyboard keys before the input-devices * are reenabled. */ for (i = keyc->xkbInfo->desc->min_key_code; i < keyc->xkbInfo->desc->max_key_code; i++) { if (key_is_down(pDev, i, KEY_POSTED)) { OsBlockSIGIO(); QueueKeyboardEvents(pDev, KeyRelease, i, NULL); OsReleaseSIGIO(); } } } void xf86DisableInputDeviceForVTSwitch(InputInfoPtr pInfo) { if (!pInfo->dev) return; if (!pInfo->dev->enabled) pInfo->flags |= XI86_DEVICE_DISABLED; xf86ReleaseKeys(pInfo->dev); ProcessInputEvents(); DisableDevice(pInfo->dev, TRUE); } void xf86EnableInputDeviceForVTSwitch(InputInfoPtr pInfo) { if (pInfo->dev && (pInfo->flags & XI86_DEVICE_DISABLED) == 0) EnableDevice(pInfo->dev, TRUE); pInfo->flags &= ~XI86_DEVICE_DISABLED; } /* * xf86UpdateHasVTProperty -- * Update a flag property on the root window to say whether the server VT * is currently the active one as some clients need to know this. */ static void xf86UpdateHasVTProperty(Bool hasVT) { Atom property_name; int32_t value = hasVT ? 1 : 0; int i; property_name = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1, FALSE); if (property_name == BAD_RESOURCE) FatalError("Failed to retrieve \"HAS_VT\" atom\n"); for (i = 0; i < xf86NumScreens; i++) { ChangeWindowProperty(xf86ScrnToScreen(xf86Screens[i])->root, property_name, XA_INTEGER, 32, PropModeReplace, 1, &value, TRUE); } } void xf86VTLeave(void) { int i; InputInfoPtr pInfo; IHPtr ih; DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n", BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE)); #ifdef DPMSExtension if (DPMSPowerLevel != DPMSModeOn) DPMSSet(serverClient, DPMSModeOn); #endif for (i = 0; i < xf86NumScreens; i++) { if (!(dispatchException & DE_TERMINATE)) if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE); } /* * Keep the order: Disable Device > LeaveVT * EnterVT > EnableDevice */ for (ih = InputHandlers; ih; ih = ih->next) { if (ih->is_input) xf86DisableInputHandler(ih); else xf86DisableGeneralHandler(ih); } for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) xf86DisableInputDeviceForVTSwitch(pInfo); OsBlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) xf86Screens[i]->LeaveVT(xf86Screens[i]); for (i = 0; i < xf86NumGPUScreens; i++) xf86GPUScreens[i]->LeaveVT(xf86GPUScreens[i]); xf86AccessLeave(); /* We need this here, otherwise */ if (!xf86VTSwitchAway()) goto switch_failed; #ifdef XF86PM if (xf86OSPMClose) xf86OSPMClose(); xf86OSPMClose = NULL; #endif for (i = 0; i < xf86NumScreens; i++) { /* * zero all access functions to * trap calls when switched away. */ xf86Screens[i]->vtSema = FALSE; } if (xorgHWAccess) xf86DisableIO(); xf86UpdateHasVTProperty(FALSE); return; switch_failed: DebugF("xf86VTSwitch: Leave failed\n"); xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { 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) (xf86Screens[i], TRUE); } } dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) xf86EnableInputDeviceForVTSwitch(pInfo); for (ih = InputHandlers; ih; ih = ih->next) { if (ih->is_input) xf86EnableInputHandler(ih); else xf86EnableGeneralHandler(ih); } OsReleaseSIGIO(); } void xf86VTEnter(void) { int i; InputInfoPtr pInfo; IHPtr ih; DebugF("xf86VTSwitch: Entering\n"); if (!xf86VTSwitchTo()) return; #ifdef XF86PM xf86OSPMClose = xf86OSPMOpen(); #endif if (xorgHWAccess) xf86EnableIO(); xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { xf86Screens[i]->vtSema = TRUE; 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) (xf86Screens[i], TRUE); } /* Turn screen saver off when switching back */ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); /* If we use systemd-logind it will enable input devices for us */ if (!systemd_logind_controls_session()) for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) xf86EnableInputDeviceForVTSwitch(pInfo); for (ih = InputHandlers; ih; ih = ih->next) { if (ih->is_input) xf86EnableInputHandler(ih); else xf86EnableGeneralHandler(ih); } #ifdef XSERVER_PLATFORM_BUS /* check for any new output devices */ xf86platformVTProbe(); #endif xf86UpdateHasVTProperty(TRUE); OsReleaseSIGIO(); } /* * xf86VTSwitch -- * Handle requests for switching the vt. */ static void xf86VTSwitch(void) { DebugF("xf86VTSwitch()\n"); #ifdef XFreeXDGA if (!DGAVTSwitch()) return; #endif /* * Since all screens are currently all in the same state it is sufficient * check the first. This might change in future. * * VTLeave is always handled here (VT_PROCESS guarantees this is safe), * if we use systemd_logind xf86VTEnter() gets called by systemd-logind.c * once it has resumed all drm nodes. */ if (xf86VTOwner()) xf86VTLeave(); else if (!systemd_logind_controls_session()) xf86VTEnter(); } /* Input handler registration */ static void * addInputHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih; if (fd < 0 || !proc) return NULL; ih = calloc(sizeof(*ih), 1); if (!ih) return NULL; ih->fd = fd; ih->ihproc = proc; ih->data = data; ih->enabled = TRUE; ih->next = InputHandlers; InputHandlers = ih; return ih; } void * xf86AddInputHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih = addInputHandler(fd, proc, data); if (ih) { AddEnabledDevice(fd); ih->is_input = TRUE; } return ih; } void * xf86AddGeneralHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih = addInputHandler(fd, proc, data); if (ih) AddGeneralSocket(fd); return ih; } /** * Set the handler for the console's fd. Replaces (and returns) the previous * handler or NULL, whichever appropriate. * proc may be NULL if the server should not handle events on the console. */ InputHandlerProc xf86SetConsoleHandler(InputHandlerProc proc, void *data) { static IHPtr handler = NULL; InputHandlerProc old_proc = NULL; if (handler) { old_proc = handler->ihproc; xf86RemoveGeneralHandler(handler); } handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data); return old_proc; } static void removeInputHandler(IHPtr ih) { IHPtr p; if (ih == InputHandlers) InputHandlers = ih->next; else { p = InputHandlers; while (p && p->next != ih) p = p->next; if (ih) p->next = ih->next; } free(ih); } int xf86RemoveInputHandler(void *handler) { IHPtr ih; int fd; if (!handler) return -1; ih = handler; fd = ih->fd; if (ih->fd >= 0) RemoveEnabledDevice(ih->fd); removeInputHandler(ih); return fd; } int xf86RemoveGeneralHandler(void *handler) { IHPtr ih; int fd; if (!handler) return -1; ih = handler; fd = ih->fd; if (ih->fd >= 0) RemoveGeneralSocket(ih->fd); removeInputHandler(ih); return fd; } void xf86DisableInputHandler(void *handler) { IHPtr ih; if (!handler) return; ih = handler; ih->enabled = FALSE; if (ih->fd >= 0) RemoveEnabledDevice(ih->fd); } void xf86DisableGeneralHandler(void *handler) { IHPtr ih; if (!handler) return; ih = handler; ih->enabled = FALSE; if (ih->fd >= 0) RemoveGeneralSocket(ih->fd); } void xf86EnableInputHandler(void *handler) { IHPtr ih; if (!handler) return; ih = handler; ih->enabled = TRUE; if (ih->fd >= 0) AddEnabledDevice(ih->fd); } void xf86EnableGeneralHandler(void *handler) { IHPtr ih; if (!handler) return; ih = handler; ih->enabled = TRUE; if (ih->fd >= 0) AddGeneralSocket(ih->fd); } /* * As used currently by the DRI, the return value is ignored. */ Bool xf86EnableVTSwitch(Bool new) { static Bool def = TRUE; Bool old; old = VTSwitchEnabled; if (!new) { /* Disable VT switching */ def = VTSwitchEnabled; VTSwitchEnabled = FALSE; } else { /* Restore VT switching to default */ VTSwitchEnabled = def; } return old; } void DDXRingBell(int volume, int pitch, int duration) { xf86OSRingBell(volume, pitch, duration); } Bool xf86VTOwner(void) { /* at system startup xf86Screens[0] won't be set - but we will own the VT */ if (xf86NumScreens == 0) return TRUE; return xf86Screens[0]->vtSema; } xorg-server-1.17.1/hw/xfree86/common/xf86Module.h0000664000175100017510000002107712432306326016330 00000000000000/* * 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). */ /* * This file contains the parts of the loader interface that are visible * to modules. This is the only loader-related header that modules should * include. * * It should include a bare minimum of other headers. * * Longer term, the module/loader code should probably live directly under * Xserver/. * * XXX This file arguably belongs in xfree86/loader/. */ #ifndef _XF86MODULE_H #define _XF86MODULE_H #include "misc.h" #include "extension.h" #ifndef NULL #define NULL ((void *)0) #endif typedef enum { LD_RESOLV_IFDONE = 0, /* only check if no more delays pending */ LD_RESOLV_NOW = 1, /* finish one delay step */ LD_RESOLV_FORCE = 2 /* force checking... */ } LoaderResolveOptions; #define DEFAULT_LIST ((char *)-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" #define ABI_CLASS_VIDEODRV "X.Org Video Driver" #define ABI_CLASS_XINPUT "X.Org XInput driver" #define ABI_CLASS_EXTENSION "X.Org Server Extension" #define ABI_CLASS_FONT "X.Org Font Renderer" #define ABI_MINOR_MASK 0x0000FFFF #define ABI_MAJOR_MASK 0xFFFF0000 #define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK) #define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16) #define SET_ABI_VERSION(maj, min) \ ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK)) /* * ABI versions. Each version has a major and minor revision. Modules * using lower minor revisions must work with servers of a higher minor * revision. There is no compatibility between different major revisions. * Whenever the ABI_ANSIC_VERSION is changed, the others must also be * changed. The minor revision mask is 0x0000FFFF and the major revision * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(19, 0) #define ABI_XINPUT_VERSION SET_ABI_VERSION(21, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 #define MODINFOSTRING2 0x10dc023a #ifndef MODULEVENDORSTRING #define MODULEVENDORSTRING "X.Org Foundation" #endif /* Error return codes for errmaj. New codes must only be added at the end. */ typedef enum { LDR_NOERROR = 0, LDR_NOMEM, /* memory allocation failed */ LDR_NOENT, /* Module file does not exist */ LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */ LDR_NOSPACE, /* internal module array full */ LDR_NOMODOPEN, /* module file could not be opened (check errmin) */ LDR_UNKTYPE, /* file is not a recognized module type */ LDR_NOLOAD, /* type specific loader failed */ LDR_ONCEONLY, /* Module should only be loaded once (not an error) */ LDR_NOPORTOPEN, /* could not open port (check errmin) */ LDR_NOHARDWARE, /* could not query/initialize the hardware device */ LDR_MISMATCH, /* the module didn't match the spec'd requirments */ LDR_BADUSAGE, /* LoadModule is called with bad arguments */ LDR_INVALID, /* The module doesn't have a valid ModuleData object */ LDR_BADOS, /* The module doesn't support the OS */ LDR_MODSPECIFIC /* A module-specific error in the SetupProc */ } LoaderErrorCode; /* * Some common module classes. The moduleclass can be used to identify * that modules loaded are of the correct type. This is a finer * classification than the ABI classes even though the default set of * classes have the same names. For example, not all modules that require * the video driver ABI are themselves video drivers. */ #define MOD_CLASS_NONE NULL #define MOD_CLASS_VIDEODRV "X.Org Video Driver" #define MOD_CLASS_XINPUT "X.Org XInput Driver" #define MOD_CLASS_FONT "X.Org Font Renderer" #define MOD_CLASS_EXTENSION "X.Org Server Extension" /* This structure is expected to be returned by the initfunc */ typedef struct { const char *modname; /* name of module, e.g. "foo" */ const char *vendor; /* vendor specific string */ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */ CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */ CARD8 majorversion; /* module-specific major version */ CARD8 minorversion; /* module-specific minor version */ CARD16 patchlevel; /* module-specific patch level */ const char *abiclass; /* ABI class that the module uses */ CARD32 abiversion; /* ABI version */ const char *moduleclass; /* module class description */ CARD32 checksum[4]; /* contains a digital signature of the */ /* version info structure */ } XF86ModuleVersionInfo; /* * This structure can be used to callers of LoadModule and LoadSubModule to * specify version and/or ABI requirements. */ typedef struct { CARD8 majorversion; /* module-specific major version */ CARD8 minorversion; /* moudle-specific minor version */ CARD16 patchlevel; /* module-specific patch level */ const char *abiclass; /* ABI class that the module uses */ CARD32 abiversion; /* ABI version */ const char *moduleclass; /* module class */ } XF86ModReqInfo; /* values to indicate unspecified fields in XF86ModReqInfo. */ #define MAJOR_UNSPEC 0xFF #define MINOR_UNSPEC 0xFF #define PATCH_UNSPEC 0xFFFF #define ABI_VERS_UNSPEC 0xFFFFFFFF #define MODULE_VERSION_NUMERIC(maj, min, patch) \ ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF)) #define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF) #define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF) #define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF) #define INITARGS void /* Prototypes for Loader functions that are exported to modules */ extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **, const char **, void *, const XF86ModReqInfo *, int *, int *); extern _X_EXPORT void UnloadSubModule(void *); extern _X_EXPORT void UnloadModule(void *); extern _X_EXPORT void *LoaderSymbol(const char *); extern _X_EXPORT const 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 LoaderGetOS(const char **name, int *major, int *minor, int *teeny); extern _X_EXPORT Bool LoaderShouldIgnoreABI(void); extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass); typedef void *(*ModuleSetupProc) (void *, void *, int *, int *); typedef void (*ModuleTearDownProc) (void *); #define MODULESETUPPROTO(func) void *func(void *, void *, int*, int*) #define MODULETEARDOWNPROTO(func) void func(void *) typedef struct { XF86ModuleVersionInfo *vers; ModuleSetupProc setup; ModuleTearDownProc teardown; } XF86ModuleData; #endif /* _XF86STR_H */ xorg-server-1.17.1/hw/xfree86/common/xaarop.h0000664000175100017510000001465012274325511015661 00000000000000#ifndef _XAAROP_H #define _XAAROP_H #define ROP_DST 0x00000001 #define ROP_SRC 0x00000002 #define ROP_PAT 0x00000004 #define ROP_0 0x00 #define ROP_DPSoon 0x01 #define ROP_DPSona 0x02 #define ROP_PSon 0x03 #define ROP_SDPona 0x04 #define ROP_DPon 0x05 #define ROP_PDSxnon 0x06 #define ROP_PDSaon 0x07 #define ROP_SDPnaa 0x08 #define ROP_PDSxon 0x09 #define ROP_DPna 0x0A #define ROP_PSDnaon 0x0B #define ROP_SPna 0x0C #define ROP_PDSnaon 0x0D #define ROP_PDSonon 0x0E #define ROP_Pn 0x0F #define ROP_PDSona 0x10 #define ROP_DSon 0x11 #define ROP_SDPxnon 0x12 #define ROP_SDPaon 0x13 #define ROP_DPSxnon 0x14 #define ROP_DPSaon 0x15 #define ROP_PSDPSanaxx 0x16 #define ROP_SSPxDSxaxn 0x17 #define ROP_SPxPDxa 0x18 #define ROP_SDPSanaxn 0x19 #define ROP_PDSPaox 0x1A #define ROP_SDPSxaxn 0x1B #define ROP_PSDPaox 0x1C #define ROP_DSPDxaxn 0x1D #define ROP_PDSox 0x1E #define ROP_PDSoan 0x1F #define ROP_DPSnaa 0x20 #define ROP_SDPxon 0x21 #define ROP_DSna 0x22 #define ROP_SPDnaon 0x23 #define ROP_SPxDSxa 0x24 #define ROP_PDSPanaxn 0x25 #define ROP_SDPSaox 0x26 #define ROP_SDPSxnox 0x27 #define ROP_DPSxa 0x28 #define ROP_PSDPSaoxxn 0x29 #define ROP_DPSana 0x2A #define ROP_SSPxPDxaxn 0x2B #define ROP_SPDSoax 0x2C #define ROP_PSDnox 0x2D #define ROP_PSDPxox 0x2E #define ROP_PSDnoan 0x2F #define ROP_PSna 0x30 #define ROP_SDPnaon 0x31 #define ROP_SDPSoox 0x32 #define ROP_Sn 0x33 #define ROP_SPDSaox 0x34 #define ROP_SPDSxnox 0x35 #define ROP_SDPox 0x36 #define ROP_SDPoan 0x37 #define ROP_PSDPoax 0x38 #define ROP_SPDnox 0x39 #define ROP_SPDSxox 0x3A #define ROP_SPDnoan 0x3B #define ROP_PSx 0x3C #define ROP_SPDSonox 0x3D #define ROP_SPDSnaox 0x3E #define ROP_PSan 0x3F #define ROP_PSDnaa 0x40 #define ROP_DPSxon 0x41 #define ROP_SDxPDxa 0x42 #define ROP_SPDSanaxn 0x43 #define ROP_SDna 0x44 #define ROP_DPSnaon 0x45 #define ROP_DSPDaox 0x46 #define ROP_PSDPxaxn 0x47 #define ROP_SDPxa 0x48 #define ROP_PDSPDaoxxn 0x49 #define ROP_DPSDoax 0x4A #define ROP_PDSnox 0x4B #define ROP_SDPana 0x4C #define ROP_SSPxDSxoxn 0x4D #define ROP_PDSPxox 0x4E #define ROP_PDSnoan 0x4F #define ROP_PDna 0x50 #define ROP_DSPnaon 0x51 #define ROP_DPSDaox 0x52 #define ROP_SPDSxaxn 0x53 #define ROP_DPSonon 0x54 #define ROP_Dn 0x55 #define ROP_DPSox 0x56 #define ROP_DPSoan 0x57 #define ROP_PDSPoax 0x58 #define ROP_DPSnox 0x59 #define ROP_DPx 0x5A #define ROP_DPSDonox 0x5B #define ROP_DPSDxox 0x5C #define ROP_DPSnoan 0x5D #define ROP_DPSDnaox 0x5E #define ROP_DPan 0x5F #define ROP_PDSxa 0x60 #define ROP_DSPDSaoxxn 0x61 #define ROP_DSPDoax 0x62 #define ROP_SDPnox 0x63 #define ROP_SDPSoax 0x64 #define ROP_DSPnox 0x65 #define ROP_DSx 0x66 #define ROP_SDPSonox 0x67 #define ROP_DSPDSonoxxn 0x68 #define ROP_PDSxxn 0x69 #define ROP_DPSax 0x6A #define ROP_PSDPSoaxxn 0x6B #define ROP_SDPax 0x6C #define ROP_PDSPDoaxxn 0x6D #define ROP_SDPSnoax 0x6E #define ROP_PDSxnan 0x6F #define ROP_PDSana 0x70 #define ROP_SSDxPDxaxn 0x71 #define ROP_SDPSxox 0x72 #define ROP_SDPnoan 0x73 #define ROP_DSPDxox 0x74 #define ROP_DSPnoan 0x75 #define ROP_SDPSnaox 0x76 #define ROP_DSan 0x77 #define ROP_PDSax 0x78 #define ROP_DSPDSoaxxn 0x79 #define ROP_DPSDnoax 0x7A #define ROP_SDPxnan 0x7B #define ROP_SPDSnoax 0x7C #define ROP_DPSxnan 0x7D #define ROP_SPxDSxo 0x7E #define ROP_DPSaan 0x7F #define ROP_DPSaa 0x80 #define ROP_SPxDSxon 0x81 #define ROP_DPSxna 0x82 #define ROP_SPDSnoaxn 0x83 #define ROP_SDPxna 0x84 #define ROP_PDSPnoaxn 0x85 #define ROP_DSPDSoaxx 0x86 #define ROP_PDSaxn 0x87 #define ROP_DSa 0x88 #define ROP_SDPSnaoxn 0x89 #define ROP_DSPnoa 0x8A #define ROP_DSPDxoxn 0x8B #define ROP_SDPnoa 0x8C #define ROP_SDPSxoxn 0x8D #define ROP_SSDxPDxax 0x8E #define ROP_PDSanan 0x8F #define ROP_PDSxna 0x90 #define ROP_SDPSnoaxn 0x91 #define ROP_DPSDPoaxx 0x92 #define ROP_SPDaxn 0x93 #define ROP_PSDPSoaxx 0x94 #define ROP_DPSaxn 0x95 #define ROP_DPSxx 0x96 #define ROP_PSDPSonoxx 0x97 #define ROP_SDPSonoxn 0x98 #define ROP_DSxn 0x99 #define ROP_DPSnax 0x9A #define ROP_SDPSoaxn 0x9B #define ROP_SPDnax 0x9C #define ROP_DSPDoaxn 0x9D #define ROP_DSPDSaoxx 0x9E #define ROP_PDSxan 0x9F #define ROP_DPa 0xA0 #define ROP_PDSPnaoxn 0xA1 #define ROP_DPSnoa 0xA2 #define ROP_DPSDxoxn 0xA3 #define ROP_PDSPonoxn 0xA4 #define ROP_PDxn 0xA5 #define ROP_DSPnax 0xA6 #define ROP_PDSPoaxn 0xA7 #define ROP_DPSoa 0xA8 #define ROP_DPSoxn 0xA9 #define ROP_D 0xAA #define ROP_DPSono 0xAB #define ROP_SPDSxax 0xAC #define ROP_DPSDaoxn 0xAD #define ROP_DSPnao 0xAE #define ROP_DPno 0xAF #define ROP_PDSnoa 0xB0 #define ROP_PDSPxoxn 0xB1 #define ROP_SSPxDSxox 0xB2 #define ROP_SDPanan 0xB3 #define ROP_PSDnax 0xB4 #define ROP_DPSDoaxn 0xB5 #define ROP_DPSDPaoxx 0xB6 #define ROP_SDPxan 0xB7 #define ROP_PSDPxax 0xB8 #define ROP_DSPDaoxn 0xB9 #define ROP_DPSnao 0xBA #define ROP_DSno 0xBB #define ROP_SPDSanax 0xBC #define ROP_SDxPDxan 0xBD #define ROP_DPSxo 0xBE #define ROP_DPSano 0xBF #define ROP_Psa 0xC0 #define ROP_SPDSnaoxn 0xC1 #define ROP_SPDSonoxn 0xC2 #define ROP_PSxn 0xC3 #define ROP_SPDnoa 0xC4 #define ROP_SPDSxoxn 0xC5 #define ROP_SDPnax 0xC6 #define ROP_PSDPoaxn 0xC7 #define ROP_SDPoa 0xC8 #define ROP_SPDoxn 0xC9 #define ROP_DPSDxax 0xCA #define ROP_SPDSaoxn 0xCB #define ROP_S 0xCC #define ROP_SDPono 0xCD #define ROP_SDPnao 0xCE #define ROP_SPno 0xCF #define ROP_PSDnoa 0xD0 #define ROP_PSDPxoxn 0xD1 #define ROP_PDSnax 0xD2 #define ROP_SPDSoaxn 0xD3 #define ROP_SSPxPDxax 0xD4 #define ROP_DPSanan 0xD5 #define ROP_PSDPSaoxx 0xD6 #define ROP_DPSxan 0xD7 #define ROP_PDSPxax 0xD8 #define ROP_SDPSaoxn 0xD9 #define ROP_DPSDanax 0xDA #define ROP_SPxDSxan 0xDB #define ROP_SPDnao 0xDC #define ROP_SDno 0xDD #define ROP_SDPxo 0xDE #define ROP_SDPano 0xDF #define ROP_PDSoa 0xE0 #define ROP_PDSoxn 0xE1 #define ROP_DSPDxax 0xE2 #define ROP_PSDPaoxn 0xE3 #define ROP_SDPSxax 0xE4 #define ROP_PDSPaoxn 0xE5 #define ROP_SDPSanax 0xE6 #define ROP_SPxPDxan 0xE7 #define ROP_SSPxDSxax 0xE8 #define ROP_DSPDSanaxxn 0xE9 #define ROP_DPSao 0xEA #define ROP_DPSxno 0xEB #define ROP_SDPao 0xEC #define ROP_SDPxno 0xED #define ROP_DSo 0xEE #define ROP_SDPnoo 0xEF #define ROP_P 0xF0 #define ROP_PDSono 0xF1 #define ROP_PDSnao 0xF2 #define ROP_PSno 0xF3 #define ROP_PSDnao 0xF4 #define ROP_PDno 0xF5 #define ROP_PDSxo 0xF6 #define ROP_PDSano 0xF7 #define ROP_PDSao 0xF8 #define ROP_PDSxno 0xF9 #define ROP_DPo 0xFA #define ROP_DPSnoo 0xFB #define ROP_PSo 0xFC #define ROP_PSDnoo 0xFD #define ROP_DPSoo 0xFE #define ROP_1 0xFF #define NO_SRC_ROP(rop) \ ((rop == GXnoop) || (rop == GXset) || (rop == GXclear) || (rop == GXinvert)) #endif /* _XAAROP_H */ xorg-server-1.17.1/hw/xfree86/common/xf86Bus.h0000664000175100017510000000475212274325511015636 00000000000000/* * 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). */ /* * This file contains definitions of the bus-related data structures/types. * Everything contained here is private to xf86Bus.c. In particular the * video drivers must not include this file. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _XF86_BUS_H #define _XF86_BUS_H #include "xf86pciBus.h" #if defined(__sparc__) || defined(__sparc) #include "xf86sbusBus.h" #endif #include "xf86platformBus.h" typedef struct { DriverPtr driver; int chipset; int entityProp; EntityProc entityInit; EntityProc entityEnter; EntityProc entityLeave; void *private; Bool active; Bool inUse; BusRec bus; int lastScrnFlag; DevUnion *entityPrivates; int numInstances; GDevPtr *devices; } EntityRec, *EntityPtr; #define ACCEL_IS_SHARABLE 0x100 #define IS_SHARED_ACCEL 0x200 #define SA_PRIM_INIT_DONE 0x400 extern EntityPtr *xf86Entities; extern int xf86NumEntities; extern BusRec primaryBus; int xf86AllocateEntity(void); BusType StringToBusType(const char *busID, const char **retID); #endif /* _XF86_BUS_H */ xorg-server-1.17.1/hw/xfree86/common/xf86cmap.c0000664000175100017510000011077112456571574016035 00000000000000/* * Copyright (c) 1998-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4) #include #else #define _XOPEN_SOURCE /* to get prototype for pow on some systems */ #include #undef _XOPEN_SOURCE #endif #include #include "misc.h" #include #include "colormapst.h" #include "scrnintstr.h" #include "resource.h" #include "xf86.h" #include "xf86_OSproc.h" #include "xf86str.h" #include "micmap.h" #include "xf86Crtc.h" #ifdef XFreeXDGA #include #include "dgaproc.h" #endif #include "xf86cmap.h" #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \ ((CMapScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, CMapScreenKey))->field) #define SCREEN_EPILOGUE(pScreen, field, wrapper)\ ((pScreen)->field = wrapper) #define LOAD_PALETTE(pmap) \ ((pmap == GetInstalledmiColormap(pmap->pScreen)) && \ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || \ xf86ScreenToScrn(pmap->pScreen)->vtSema || pScreenPriv->isDGAmode)) typedef struct _CMapLink { ColormapPtr cmap; struct _CMapLink *next; } CMapLink, *CMapLinkPtr; typedef struct { CloseScreenProcPtr CloseScreen; CreateColormapProcPtr CreateColormap; DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; StoreColorsProcPtr StoreColors; Bool (*EnterVT) (ScrnInfoPtr); Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); int (*SetDGAMode) (ScrnInfoPtr, int, DGADevicePtr); xf86ChangeGammaProc *ChangeGamma; int maxColors; int sigRGBbits; int gammaElements; LOCO *gamma; int *PreAllocIndices; CMapLinkPtr maps; unsigned int flags; Bool isDGAmode; } CMapScreenRec, *CMapScreenPtr; typedef struct { int numColors; LOCO *colors; Bool recalculate; int overscan; } CMapColormapRec, *CMapColormapPtr; static DevPrivateKeyRec CMapScreenKeyRec; #define CMapScreenKeyRegistered dixPrivateKeyRegistered(&CMapScreenKeyRec) #define CMapScreenKey (&CMapScreenKeyRec) static DevPrivateKeyRec CMapColormapKeyRec; #define CMapColormapKey (&CMapColormapKeyRec) static void CMapInstallColormap(ColormapPtr); static void CMapStoreColors(ColormapPtr, int, xColorItem *); static Bool CMapCloseScreen(ScreenPtr); static Bool CMapCreateColormap(ColormapPtr); static void CMapDestroyColormap(ColormapPtr); static Bool CMapEnterVT(ScrnInfoPtr); static Bool CMapSwitchMode(ScrnInfoPtr, DisplayModePtr); #ifdef XFreeXDGA static int CMapSetDGAMode(ScrnInfoPtr, int, DGADevicePtr); #endif static int CMapChangeGamma(ScrnInfoPtr, Gamma); static void ComputeGamma(ScrnInfoPtr, CMapScreenPtr); static Bool CMapAllocateColormapPrivate(ColormapPtr); static void CMapRefreshColors(ColormapPtr, int, int *); static void CMapSetOverscan(ColormapPtr, int, int *); static void CMapReinstallMap(ColormapPtr); static void CMapUnwrapScreen(ScreenPtr pScreen); Bool xf86ColormapAllocatePrivates(ScrnInfoPtr pScrn) { /* If we support a better colormap system, then pretend we succeeded. */ if (xf86_crtc_supports_gamma(pScrn)) return TRUE; if (!dixRegisterPrivateKey(&CMapScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!dixRegisterPrivateKey(&CMapColormapKeyRec, PRIVATE_COLORMAP, 0)) return FALSE; return TRUE; } Bool xf86HandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits, xf86LoadPaletteProc * loadPalette, xf86SetOverscanProc * setOverscan, unsigned int flags) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ColormapPtr pDefMap = NULL; CMapScreenPtr pScreenPriv; LOCO *gamma; int *indices; int elements; /* If we support a better colormap system, then pretend we succeeded. */ if (xf86_crtc_supports_gamma(pScrn)) return TRUE; if (!maxColors || !sigRGBbits || !loadPalette) return FALSE; elements = 1 << sigRGBbits; if (!(gamma = malloc(elements * sizeof(LOCO)))) return FALSE; if (!(indices = malloc(maxColors * sizeof(int)))) { free(gamma); return FALSE; } if (!(pScreenPriv = malloc(sizeof(CMapScreenRec)))) { free(gamma); free(indices); return FALSE; } dixSetPrivate(&pScreen->devPrivates, &CMapScreenKeyRec, pScreenPriv); pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreenPriv->CreateColormap = pScreen->CreateColormap; pScreenPriv->DestroyColormap = pScreen->DestroyColormap; pScreenPriv->InstallColormap = pScreen->InstallColormap; pScreenPriv->StoreColors = pScreen->StoreColors; pScreen->CloseScreen = CMapCloseScreen; pScreen->CreateColormap = CMapCreateColormap; pScreen->DestroyColormap = CMapDestroyColormap; pScreen->InstallColormap = CMapInstallColormap; pScreen->StoreColors = CMapStoreColors; pScrn->LoadPalette = loadPalette; pScrn->SetOverscan = setOverscan; pScreenPriv->maxColors = maxColors; pScreenPriv->sigRGBbits = sigRGBbits; pScreenPriv->gammaElements = elements; pScreenPriv->gamma = gamma; pScreenPriv->PreAllocIndices = indices; pScreenPriv->maps = NULL; pScreenPriv->flags = flags; pScreenPriv->isDGAmode = FALSE; pScreenPriv->EnterVT = pScrn->EnterVT; pScreenPriv->SwitchMode = pScrn->SwitchMode; pScreenPriv->SetDGAMode = pScrn->SetDGAMode; pScreenPriv->ChangeGamma = pScrn->ChangeGamma; if (!(flags & CMAP_LOAD_EVEN_IF_OFFSCREEN)) { pScrn->EnterVT = CMapEnterVT; if ((flags & CMAP_RELOAD_ON_MODE_SWITCH) && pScrn->SwitchMode) pScrn->SwitchMode = CMapSwitchMode; } #ifdef XFreeXDGA pScrn->SetDGAMode = CMapSetDGAMode; #endif pScrn->ChangeGamma = CMapChangeGamma; ComputeGamma(pScrn, pScreenPriv); /* get the default map */ dixLookupResourceByType((void **) &pDefMap, pScreen->defColormap, RT_COLORMAP, serverClient, DixInstallAccess); if (!CMapAllocateColormapPrivate(pDefMap)) { CMapUnwrapScreen(pScreen); return FALSE; } /* Force the initial map to be loaded */ SetInstalledmiColormap(pScreen, NULL); CMapInstallColormap(pDefMap); return TRUE; } /**** Screen functions ****/ static Bool CMapCloseScreen(ScreenPtr pScreen) { CMapUnwrapScreen(pScreen); return (*pScreen->CloseScreen) (pScreen); } static Bool CMapColormapUseMax(VisualPtr pVisual, CMapScreenPtr pScreenPriv) { if (pVisual->nplanes > 16) return TRUE; return ((1 << pVisual->nplanes) > pScreenPriv->maxColors); } static Bool CMapAllocateColormapPrivate(ColormapPtr pmap) { CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pmap->pScreen->devPrivates, CMapScreenKey); CMapColormapPtr pColPriv; CMapLinkPtr pLink; int numColors; LOCO *colors; if (CMapColormapUseMax(pmap->pVisual, pScreenPriv)) numColors = pmap->pVisual->ColormapEntries; else numColors = 1 << pmap->pVisual->nplanes; if (!(colors = malloc(numColors * sizeof(LOCO)))) return FALSE; if (!(pColPriv = malloc(sizeof(CMapColormapRec)))) { free(colors); return FALSE; } dixSetPrivate(&pmap->devPrivates, CMapColormapKey, pColPriv); pColPriv->numColors = numColors; pColPriv->colors = colors; pColPriv->recalculate = TRUE; pColPriv->overscan = -1; /* add map to list */ pLink = malloc(sizeof(CMapLink)); if (pLink) { pLink->cmap = pmap; pLink->next = pScreenPriv->maps; pScreenPriv->maps = pLink; } return TRUE; } static Bool CMapCreateColormap(ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); Bool ret = FALSE; pScreen->CreateColormap = pScreenPriv->CreateColormap; if ((*pScreen->CreateColormap) (pmap)) { if (CMapAllocateColormapPrivate(pmap)) ret = TRUE; } pScreen->CreateColormap = CMapCreateColormap; return ret; } static void CMapDestroyColormap(ColormapPtr cmap) { ScreenPtr pScreen = cmap->pScreen; CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); CMapColormapPtr pColPriv = (CMapColormapPtr) dixLookupPrivate(&cmap->devPrivates, CMapColormapKey); CMapLinkPtr prevLink = NULL, pLink = pScreenPriv->maps; if (pColPriv) { free(pColPriv->colors); free(pColPriv); } /* remove map from list */ while (pLink) { if (pLink->cmap == cmap) { if (prevLink) prevLink->next = pLink->next; else pScreenPriv->maps = pLink->next; free(pLink); break; } prevLink = pLink; pLink = pLink->next; } if (pScreenPriv->DestroyColormap) { pScreen->DestroyColormap = pScreenPriv->DestroyColormap; (*pScreen->DestroyColormap) (cmap); pScreen->DestroyColormap = CMapDestroyColormap; } } static void CMapStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs) { ScreenPtr pScreen = pmap->pScreen; VisualPtr pVisual = pmap->pVisual; CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); int *indices = pScreenPriv->PreAllocIndices; int num = ndef; /* At the moment this isn't necessary since there's nobody below us */ pScreen->StoreColors = pScreenPriv->StoreColors; (*pScreen->StoreColors) (pmap, ndef, pdefs); pScreen->StoreColors = CMapStoreColors; /* should never get here for these */ if ((pVisual->class == TrueColor) || (pVisual->class == StaticColor) || (pVisual->class == StaticGray)) return; if (pVisual->class == DirectColor) { CMapColormapPtr pColPriv = (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey); int i; if (CMapColormapUseMax(pVisual, pScreenPriv)) { int index; num = 0; while (ndef--) { if (pdefs[ndef].flags & DoRed) { index = (pdefs[ndef].pixel & pVisual->redMask) >> pVisual->offsetRed; i = num; while (i--) if (indices[i] == index) break; if (i == -1) indices[num++] = index; } if (pdefs[ndef].flags & DoGreen) { index = (pdefs[ndef].pixel & pVisual->greenMask) >> pVisual->offsetGreen; i = num; while (i--) if (indices[i] == index) break; if (i == -1) indices[num++] = index; } if (pdefs[ndef].flags & DoBlue) { index = (pdefs[ndef].pixel & pVisual->blueMask) >> pVisual->offsetBlue; i = num; while (i--) if (indices[i] == index) break; if (i == -1) indices[num++] = index; } } } else { /* not really as overkill as it seems */ num = pColPriv->numColors; for (i = 0; i < pColPriv->numColors; i++) indices[i] = i; } } else { while (ndef--) indices[ndef] = pdefs[ndef].pixel; } CMapRefreshColors(pmap, num, indices); } static void CMapInstallColormap(ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); if (pmap == GetInstalledmiColormap(pmap->pScreen)) return; pScreen->InstallColormap = pScreenPriv->InstallColormap; (*pScreen->InstallColormap) (pmap); pScreen->InstallColormap = CMapInstallColormap; /* Important. We let the lower layers, namely DGA, overwrite the choice of Colormap to install */ if (GetInstalledmiColormap(pmap->pScreen)) pmap = GetInstalledmiColormap(pmap->pScreen); if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && (pmap->pVisual->class == TrueColor) && CMapColormapUseMax(pmap->pVisual, pScreenPriv)) return; if (LOAD_PALETTE(pmap)) CMapReinstallMap(pmap); } /**** ScrnInfoRec functions ****/ static Bool CMapEnterVT(ScrnInfoPtr pScrn) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); Bool ret; CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); pScrn->EnterVT = pScreenPriv->EnterVT; ret = (*pScreenPriv->EnterVT) (pScrn); pScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = CMapEnterVT; if (ret) { if (GetInstalledmiColormap(pScreen)) CMapReinstallMap(GetInstalledmiColormap(pScreen)); return TRUE; } return FALSE; } static Bool CMapSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); if ((*pScreenPriv->SwitchMode) (pScrn, mode)) { if (GetInstalledmiColormap(pScreen)) CMapReinstallMap(GetInstalledmiColormap(pScreen)); return TRUE; } return FALSE; } #ifdef XFreeXDGA static int CMapSetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr dev) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); int ret; ret = (*pScreenPriv->SetDGAMode) (pScrn, num, dev); pScreenPriv->isDGAmode = DGAActive(pScrn->scrnIndex); if (!pScreenPriv->isDGAmode && GetInstalledmiColormap(pScreen) && xf86ScreenToScrn(pScreen)->vtSema) CMapReinstallMap(GetInstalledmiColormap(pScreen)); return ret; } #endif /**** Utilities ****/ static void CMapReinstallMap(ColormapPtr pmap) { CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pmap->pScreen->devPrivates, CMapScreenKey); CMapColormapPtr cmapPriv = (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey); ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen); int i = cmapPriv->numColors; int *indices = pScreenPriv->PreAllocIndices; while (i--) indices[i] = i; if (cmapPriv->recalculate) CMapRefreshColors(pmap, cmapPriv->numColors, indices); else { (*pScrn->LoadPalette) (pScrn, cmapPriv->numColors, indices, cmapPriv->colors, pmap->pVisual); if (pScrn->SetOverscan) { #ifdef DEBUGOVERSCAN ErrorF("SetOverscan() called from CMapReinstallMap\n"); #endif pScrn->SetOverscan(pScrn, cmapPriv->overscan); } } cmapPriv->recalculate = FALSE; } static void CMapRefreshColors(ColormapPtr pmap, int defs, int *indices) { CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pmap->pScreen->devPrivates, CMapScreenKey); CMapColormapPtr pColPriv = (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey); VisualPtr pVisual = pmap->pVisual; ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen); int numColors, i; LOCO *gamma, *colors; EntryPtr entry; int reds, greens, blues, maxValue, index, shift; numColors = pColPriv->numColors; shift = 16 - pScreenPriv->sigRGBbits; maxValue = (1 << pScreenPriv->sigRGBbits) - 1; gamma = pScreenPriv->gamma; colors = pColPriv->colors; reds = pVisual->redMask >> pVisual->offsetRed; greens = pVisual->greenMask >> pVisual->offsetGreen; blues = pVisual->blueMask >> pVisual->offsetBlue; switch (pVisual->class) { case StaticGray: for (i = 0; i < numColors; i++) { index = (i + 1) * maxValue / numColors; colors[i].red = gamma[index].red; colors[i].green = gamma[index].green; colors[i].blue = gamma[index].blue; } break; case TrueColor: if (CMapColormapUseMax(pVisual, pScreenPriv)) { for (i = 0; i <= reds; i++) colors[i].red = gamma[i * maxValue / reds].red; for (i = 0; i <= greens; i++) colors[i].green = gamma[i * maxValue / greens].green; for (i = 0; i <= blues; i++) colors[i].blue = gamma[i * maxValue / blues].blue; break; } for (i = 0; i < numColors; i++) { colors[i].red = gamma[((i >> pVisual->offsetRed) & reds) * maxValue / reds].red; colors[i].green = gamma[((i >> pVisual->offsetGreen) & greens) * maxValue / greens].green; colors[i].blue = gamma[((i >> pVisual->offsetBlue) & blues) * maxValue / blues].blue; } break; case StaticColor: case PseudoColor: case GrayScale: for (i = 0; i < defs; i++) { index = indices[i]; entry = (EntryPtr) &pmap->red[index]; if (entry->fShared) { colors[index].red = gamma[entry->co.shco.red->color >> shift].red; colors[index].green = gamma[entry->co.shco.green->color >> shift].green; colors[index].blue = gamma[entry->co.shco.blue->color >> shift].blue; } else { colors[index].red = gamma[entry->co.local.red >> shift].red; colors[index].green = gamma[entry->co.local.green >> shift].green; colors[index].blue = gamma[entry->co.local.blue >> shift].blue; } } break; case DirectColor: if (CMapColormapUseMax(pVisual, pScreenPriv)) { for (i = 0; i < defs; i++) { index = indices[i]; if (index <= reds) colors[index].red = gamma[pmap->red[index].co.local.red >> shift].red; if (index <= greens) colors[index].green = gamma[pmap->green[index].co.local.green >> shift].green; if (index <= blues) colors[index].blue = gamma[pmap->blue[index].co.local.blue >> shift].blue; } break; } for (i = 0; i < defs; i++) { index = indices[i]; colors[index].red = gamma[pmap->red[(index >> pVisual-> offsetRed) & reds].co.local. red >> shift].red; colors[index].green = gamma[pmap->green[(index >> pVisual->offsetGreen) & greens].co. local.green >> shift].green; colors[index].blue = gamma[pmap->blue[(index >> pVisual->offsetBlue) & blues].co. local.blue >> shift].blue; } break; } if (LOAD_PALETTE(pmap)) (*pScrn->LoadPalette) (pScrn, defs, indices, colors, pmap->pVisual); if (pScrn->SetOverscan) CMapSetOverscan(pmap, defs, indices); } static Bool CMapCompareColors(LOCO * color1, LOCO * color2) { /* return TRUE if the color1 is "closer" to black than color2 */ #ifdef DEBUGOVERSCAN ErrorF("#%02x%02x%02x vs #%02x%02x%02x (%d vs %d)\n", color1->red, color1->green, color1->blue, color2->red, color2->green, color2->blue, color1->red + color1->green + color1->blue, color2->red + color2->green + color2->blue); #endif return (color1->red + color1->green + color1->blue < color2->red + color2->green + color2->blue); } static void CMapSetOverscan(ColormapPtr pmap, int defs, int *indices) { CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pmap->pScreen->devPrivates, CMapScreenKey); CMapColormapPtr pColPriv = (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey); ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen); VisualPtr pVisual = pmap->pVisual; int i; LOCO *colors; int index; Bool newOverscan = FALSE; int overscan, tmpOverscan; colors = pColPriv->colors; overscan = pColPriv->overscan; /* * Search for a new overscan index in the following cases: * * - The index hasn't yet been initialised.  In this case search * for an index that is black or a close match to black. * * - The colour of the old index is changed. In this case search * all indices for a black or close match to black. * * - The colour of the old index wasn't black. In this case only * search the indices that were changed for a better match to black. */ switch (pVisual->class) { case StaticGray: case TrueColor: /* Should only come here once. Initialise the overscan index to 0 */ overscan = 0; newOverscan = TRUE; break; case StaticColor: /* * Only come here once, but search for the overscan in the same way * as for the other cases. */ case DirectColor: case PseudoColor: case GrayScale: if (overscan < 0 || overscan > pScreenPriv->maxColors - 1) { /* Uninitialised */ newOverscan = TRUE; } else { /* Check if the overscan was changed */ for (i = 0; i < defs; i++) { index = indices[i]; if (index == overscan) { newOverscan = TRUE; break; } } } if (newOverscan) { /* The overscan is either uninitialised or it has been changed */ if (overscan < 0 || overscan > pScreenPriv->maxColors - 1) tmpOverscan = pScreenPriv->maxColors - 1; else tmpOverscan = overscan; /* search all entries for a close match to black */ for (i = pScreenPriv->maxColors - 1; i >= 0; i--) { if (colors[i].red == 0 && colors[i].green == 0 && colors[i].blue == 0) { overscan = i; #ifdef DEBUGOVERSCAN ErrorF("Black found at index 0x%02x\n", i); #endif break; } else { #ifdef DEBUGOVERSCAN ErrorF("0x%02x: ", i); #endif if (CMapCompareColors(&colors[i], &colors[tmpOverscan])) { tmpOverscan = i; #ifdef DEBUGOVERSCAN ErrorF("possible \"Black\" at index 0x%02x\n", i); #endif } } } if (i < 0) overscan = tmpOverscan; } else { /* Check of the old overscan wasn't black */ if (colors[overscan].red != 0 || colors[overscan].green != 0 || colors[overscan].blue != 0) { int oldOverscan = tmpOverscan = overscan; /* See of there is now a better match */ for (i = 0; i < defs; i++) { index = indices[i]; if (colors[index].red == 0 && colors[index].green == 0 && colors[index].blue == 0) { overscan = index; #ifdef DEBUGOVERSCAN ErrorF("Black found at index 0x%02x\n", index); #endif break; } else { #ifdef DEBUGOVERSCAN ErrorF("0x%02x: ", index); #endif if (CMapCompareColors(&colors[index], &colors[tmpOverscan])) { tmpOverscan = index; #ifdef DEBUGOVERSCAN ErrorF("possible \"Black\" at index 0x%02x\n", index); #endif } } } if (i == defs) overscan = tmpOverscan; if (overscan != oldOverscan) newOverscan = TRUE; } } break; } if (newOverscan) { pColPriv->overscan = overscan; if (LOAD_PALETTE(pmap)) { #ifdef DEBUGOVERSCAN ErrorF("SetOverscan() called from CmapSetOverscan\n"); #endif pScrn->SetOverscan(pScrn, overscan); } } } static void CMapUnwrapScreen(ScreenPtr pScreen) { CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->CreateColormap = pScreenPriv->CreateColormap; pScreen->DestroyColormap = pScreenPriv->DestroyColormap; pScreen->InstallColormap = pScreenPriv->InstallColormap; pScreen->StoreColors = pScreenPriv->StoreColors; pScrn->EnterVT = pScreenPriv->EnterVT; pScrn->SwitchMode = pScreenPriv->SwitchMode; pScrn->SetDGAMode = pScreenPriv->SetDGAMode; pScrn->ChangeGamma = pScreenPriv->ChangeGamma; free(pScreenPriv->gamma); free(pScreenPriv->PreAllocIndices); free(pScreenPriv); } static void ComputeGamma(ScrnInfoPtr pScrn, CMapScreenPtr priv) { int elements = priv->gammaElements - 1; double RedGamma, GreenGamma, BlueGamma; int i; #ifndef DONT_CHECK_GAMMA /* This check is to catch drivers that are not initialising pScrn->gamma */ if (pScrn->gamma.red < GAMMA_MIN || pScrn->gamma.red > GAMMA_MAX || pScrn->gamma.green < GAMMA_MIN || pScrn->gamma.green > GAMMA_MAX || pScrn->gamma.blue < GAMMA_MIN || pScrn->gamma.blue > GAMMA_MAX) { xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 0, "The %s driver didn't call xf86SetGamma() to initialise\n" "\tthe gamma values.\n", pScrn->driverName); xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 0, "PLEASE FIX THE `%s' DRIVER!\n", pScrn->driverName); pScrn->gamma.red = 1.0; pScrn->gamma.green = 1.0; pScrn->gamma.blue = 1.0; } #endif RedGamma = 1.0 / (double) pScrn->gamma.red; GreenGamma = 1.0 / (double) pScrn->gamma.green; BlueGamma = 1.0 / (double) pScrn->gamma.blue; for (i = 0; i <= elements; i++) { if (RedGamma == 1.0) priv->gamma[i].red = i; else priv->gamma[i].red = (CARD16) (pow((double) i / (double) elements, RedGamma) * (double) elements + 0.5); if (GreenGamma == 1.0) priv->gamma[i].green = i; else priv->gamma[i].green = (CARD16) (pow((double) i / (double) elements, GreenGamma) * (double) elements + 0.5); if (BlueGamma == 1.0) priv->gamma[i].blue = i; else priv->gamma[i].blue = (CARD16) (pow((double) i / (double) elements, BlueGamma) * (double) elements + 0.5); } } int CMapChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { int ret = Success; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapColormapPtr pColPriv; CMapScreenPtr pScreenPriv; CMapLinkPtr pLink; /* Is this sufficient checking ? */ if (!CMapScreenKeyRegistered) return BadImplementation; pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); if (!pScreenPriv) return BadImplementation; if (gamma.red < GAMMA_MIN || gamma.red > GAMMA_MAX || gamma.green < GAMMA_MIN || gamma.green > GAMMA_MAX || gamma.blue < GAMMA_MIN || gamma.blue > GAMMA_MAX) return BadValue; pScrn->gamma.red = gamma.red; pScrn->gamma.green = gamma.green; pScrn->gamma.blue = gamma.blue; ComputeGamma(pScrn, pScreenPriv); /* mark all colormaps on this screen */ pLink = pScreenPriv->maps; while (pLink) { pColPriv = (CMapColormapPtr) dixLookupPrivate(&pLink->cmap->devPrivates, CMapColormapKey); pColPriv->recalculate = TRUE; pLink = pLink->next; } if (GetInstalledmiColormap(pScreen) && ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || pScrn->vtSema || pScreenPriv->isDGAmode)) { ColormapPtr pMap = GetInstalledmiColormap(pScreen); if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && (pMap->pVisual->class == TrueColor) && CMapColormapUseMax(pMap->pVisual, pScreenPriv)) { /* if the current map doesn't have a palette look for another map to change the gamma on. */ pLink = pScreenPriv->maps; while (pLink) { if (pLink->cmap->pVisual->class == PseudoColor) break; pLink = pLink->next; } if (pLink) { /* need to trick CMapRefreshColors() into thinking this is the currently installed map */ SetInstalledmiColormap(pScreen, pLink->cmap); CMapReinstallMap(pLink->cmap); SetInstalledmiColormap(pScreen, pMap); } } else CMapReinstallMap(pMap); } pScrn->ChangeGamma = pScreenPriv->ChangeGamma; if (pScrn->ChangeGamma) ret = pScrn->ChangeGamma(pScrn, gamma); pScrn->ChangeGamma = CMapChangeGamma; return ret; } static void ComputeGammaRamp(CMapScreenPtr priv, unsigned short *red, unsigned short *green, unsigned short *blue) { int elements = priv->gammaElements; LOCO *entry = priv->gamma; int shift = 16 - priv->sigRGBbits; while (elements--) { entry->red = *(red++) >> shift; entry->green = *(green++) >> shift; entry->blue = *(blue++) >> shift; entry++; } } int xf86ChangeGammaRamp(ScreenPtr pScreen, int size, unsigned short *red, unsigned short *green, unsigned short *blue) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapColormapPtr pColPriv; CMapScreenPtr pScreenPriv; CMapLinkPtr pLink; if (xf86_crtc_supports_gamma(pScrn)) { RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); if (crtc) { if (crtc->gammaSize != size) return BadValue; RRCrtcGammaSet(crtc, red, green, blue); return Success; } } if (!CMapScreenKeyRegistered) return BadImplementation; pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); if (!pScreenPriv) return BadImplementation; if (pScreenPriv->gammaElements != size) return BadValue; ComputeGammaRamp(pScreenPriv, red, green, blue); /* mark all colormaps on this screen */ pLink = pScreenPriv->maps; while (pLink) { pColPriv = (CMapColormapPtr) dixLookupPrivate(&pLink->cmap->devPrivates, CMapColormapKey); pColPriv->recalculate = TRUE; pLink = pLink->next; } if (GetInstalledmiColormap(pScreen) && ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || pScrn->vtSema || pScreenPriv->isDGAmode)) { ColormapPtr pMap = GetInstalledmiColormap(pScreen); if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && (pMap->pVisual->class == TrueColor) && CMapColormapUseMax(pMap->pVisual, pScreenPriv)) { /* if the current map doesn't have a palette look for another map to change the gamma on. */ pLink = pScreenPriv->maps; while (pLink) { if (pLink->cmap->pVisual->class == PseudoColor) break; pLink = pLink->next; } if (pLink) { /* need to trick CMapRefreshColors() into thinking this is the currently installed map */ SetInstalledmiColormap(pScreen, pLink->cmap); CMapReinstallMap(pLink->cmap); SetInstalledmiColormap(pScreen, pMap); } } else CMapReinstallMap(pMap); } return Success; } int xf86GetGammaRampSize(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; if (xf86_crtc_supports_gamma(pScrn)) { RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); if (crtc) return crtc->gammaSize; } if (!CMapScreenKeyRegistered) return 0; pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); if (!pScreenPriv) return 0; return pScreenPriv->gammaElements; } int xf86GetGammaRamp(ScreenPtr pScreen, int size, unsigned short *red, unsigned short *green, unsigned short *blue) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; LOCO *entry; int shift, sigbits; if (xf86_crtc_supports_gamma(pScrn)) { RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); if (crtc) { if (crtc->gammaSize < size) return BadValue; if (!RRCrtcGammaGet(crtc)) return BadImplementation; memcpy(red, crtc->gammaRed, size * sizeof(*red)); memcpy(green, crtc->gammaGreen, size * sizeof(*green)); memcpy(blue, crtc->gammaBlue, size * sizeof(*blue)); return Success; } } if (!CMapScreenKeyRegistered) return BadImplementation; pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); if (!pScreenPriv) return BadImplementation; if (size > pScreenPriv->gammaElements) return BadValue; entry = pScreenPriv->gamma; sigbits = pScreenPriv->sigRGBbits; while (size--) { *red = entry->red << (16 - sigbits); *green = entry->green << (16 - sigbits); *blue = entry->blue << (16 - sigbits); shift = sigbits; while (shift < 16) { *red |= *red >> shift; *green |= *green >> shift; *blue |= *blue >> shift; shift += sigbits; } red++; green++; blue++; entry++; } return Success; } int xf86ChangeGamma(ScreenPtr pScreen, Gamma gamma) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->ChangeGamma) return (*pScrn->ChangeGamma) (pScrn, gamma); return BadImplementation; } xorg-server-1.17.1/hw/xfree86/common/extramodes0000664000175100017510000000213612160102336016300 00000000000000// // Extra modes to include as default modes in the X server. // // $XFree86: xc/programs/Xserver/hw/xfree86/etc/extramodes,v 1.5 2002/06/05 19:43:05 dawes Exp $ // # 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz ModeLine "832x624" 57.284 832 864 928 1152 624 625 628 667 -Hsync -Vsync # 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz ModeLine "1400x1050" 122.0 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync # 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz ModeLine "1400x1050" 155.8 1400 1464 1784 1912 1050 1052 1064 1090 +hsync +vsync # 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz Modeline "1920x1440" 341.35 1920 2072 2288 2656 1440 1441 1444 1512 -hsync +vsync # 2048x1536 @ 60Hz (VESA GTF) hsync: 95.3kHz Modeline "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -hsync +vsync # 2048x1536 @ 75Hz (VESA GTF) hsync: 120.2kHz Modeline "2048x1536" 340.48 2048 2216 2440 2832 1536 1537 1540 1603 -hsync +vsync # 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz Modeline "2048x1536" 388.04 2048 2216 2440 2832 1536 1537 1540 1612 -hsync +vsync xorg-server-1.17.1/hw/xfree86/common/xf86fbman.c0000664000175100017510000011726612456571574016206 00000000000000 /* * Copyright (c) 1998-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "misc.h" #include "xf86.h" #include #include "scrnintstr.h" #include "regionstr.h" #include "xf86fbman.h" /* #define DEBUG */ static DevPrivateKeyRec xf86FBManagerKeyRec; static DevPrivateKey xf86FBManagerKey; Bool xf86RegisterOffscreenManager(ScreenPtr pScreen, FBManagerFuncsPtr funcs) { xf86FBManagerKey = &xf86FBManagerKeyRec; if (!dixRegisterPrivateKey(&xf86FBManagerKeyRec, PRIVATE_SCREEN, 0)) return FALSE; dixSetPrivate(&pScreen->devPrivates, xf86FBManagerKey, funcs); return TRUE; } Bool xf86FBManagerRunning(ScreenPtr pScreen) { if (xf86FBManagerKey == NULL) return FALSE; if (!dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey)) return FALSE; return TRUE; } Bool xf86RegisterFreeBoxCallback(ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, void *devPriv) { FBManagerFuncsPtr funcs; if (xf86FBManagerKey == NULL) return FALSE; if (!(funcs = (FBManagerFuncsPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey))) return FALSE; return (*funcs->RegisterFreeBoxCallback) (pScreen, FreeBoxCallback, devPriv); } FBAreaPtr xf86AllocateOffscreenArea(ScreenPtr pScreen, int w, int h, int gran, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, void *privData) { FBManagerFuncsPtr funcs; if (xf86FBManagerKey == NULL) return NULL; if (!(funcs = (FBManagerFuncsPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey))) return NULL; return (*funcs->AllocateOffscreenArea) (pScreen, w, h, gran, moveCB, removeCB, privData); } FBLinearPtr xf86AllocateOffscreenLinear(ScreenPtr pScreen, int length, int gran, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr removeCB, void *privData) { FBManagerFuncsPtr funcs; if (xf86FBManagerKey == NULL) return NULL; if (!(funcs = (FBManagerFuncsPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey))) return NULL; return (*funcs->AllocateOffscreenLinear) (pScreen, length, gran, moveCB, removeCB, privData); } void xf86FreeOffscreenArea(FBAreaPtr area) { FBManagerFuncsPtr funcs; if (!area) return; if (xf86FBManagerKey == NULL) return; if (! (funcs = (FBManagerFuncsPtr) dixLookupPrivate(&area->pScreen->devPrivates, xf86FBManagerKey))) return; (*funcs->FreeOffscreenArea) (area); return; } void xf86FreeOffscreenLinear(FBLinearPtr linear) { FBManagerFuncsPtr funcs; if (!linear) return; if (xf86FBManagerKey == NULL) return; if (! (funcs = (FBManagerFuncsPtr) dixLookupPrivate(&linear->pScreen->devPrivates, xf86FBManagerKey))) return; (*funcs->FreeOffscreenLinear) (linear); return; } Bool xf86ResizeOffscreenArea(FBAreaPtr resize, int w, int h) { FBManagerFuncsPtr funcs; if (!resize) return FALSE; if (xf86FBManagerKey == NULL) return FALSE; if (! (funcs = (FBManagerFuncsPtr) dixLookupPrivate(&resize->pScreen->devPrivates, xf86FBManagerKey))) return FALSE; return (*funcs->ResizeOffscreenArea) (resize, w, h); } Bool xf86ResizeOffscreenLinear(FBLinearPtr resize, int size) { FBManagerFuncsPtr funcs; if (!resize) return FALSE; if (xf86FBManagerKey == NULL) return FALSE; if (! (funcs = (FBManagerFuncsPtr) dixLookupPrivate(&resize->pScreen->devPrivates, xf86FBManagerKey))) return FALSE; return (*funcs->ResizeOffscreenLinear) (resize, size); } Bool xf86QueryLargestOffscreenArea(ScreenPtr pScreen, int *w, int *h, int gran, int preferences, int severity) { FBManagerFuncsPtr funcs; *w = 0; *h = 0; if (xf86FBManagerKey == NULL) return FALSE; if (!(funcs = (FBManagerFuncsPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey))) return FALSE; return (*funcs->QueryLargestOffscreenArea) (pScreen, w, h, gran, preferences, severity); } Bool xf86QueryLargestOffscreenLinear(ScreenPtr pScreen, int *size, int gran, int severity) { FBManagerFuncsPtr funcs; *size = 0; if (xf86FBManagerKey == NULL) return FALSE; if (!(funcs = (FBManagerFuncsPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey))) return FALSE; return (*funcs->QueryLargestOffscreenLinear) (pScreen, size, gran, severity); } Bool xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen) { FBManagerFuncsPtr funcs; if (xf86FBManagerKey == NULL) return FALSE; if (!(funcs = (FBManagerFuncsPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey))) return FALSE; return (*funcs->PurgeOffscreenAreas) (pScreen); } /************************************************************\ Below is a specific implementation of an offscreen manager. \************************************************************/ static DevPrivateKeyRec xf86FBScreenKeyRec; #define xf86FBScreenKey (&xf86FBScreenKeyRec) typedef struct _FBLink { FBArea area; struct _FBLink *next; } FBLink, *FBLinkPtr; typedef struct _FBLinearLink { FBLinear linear; int free; /* need to add free here as FBLinear is publicly accessible */ FBAreaPtr area; /* only used if allocation came from XY area */ struct _FBLinearLink *next; } FBLinearLink, *FBLinearLinkPtr; typedef struct { ScreenPtr pScreen; RegionPtr InitialBoxes; RegionPtr FreeBoxes; FBLinkPtr UsedAreas; int NumUsedAreas; FBLinearLinkPtr LinearAreas; CloseScreenProcPtr CloseScreen; int NumCallbacks; FreeBoxCallbackProcPtr *FreeBoxesUpdateCallback; DevUnion *devPrivates; } FBManager, *FBManagerPtr; static void SendCallFreeBoxCallbacks(FBManagerPtr offman) { int i = offman->NumCallbacks; while (i--) { (*offman->FreeBoxesUpdateCallback[i]) (offman->pScreen, offman->FreeBoxes, offman->devPrivates[i].ptr); } } static Bool localRegisterFreeBoxCallback(ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, void *devPriv) { FBManagerPtr offman; FreeBoxCallbackProcPtr *newCallbacks; DevUnion *newPrivates; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); newCallbacks = realloc(offman->FreeBoxesUpdateCallback, sizeof(FreeBoxCallbackProcPtr) * (offman->NumCallbacks + 1)); if (!newCallbacks) return FALSE; else offman->FreeBoxesUpdateCallback = newCallbacks; newPrivates = realloc(offman->devPrivates, sizeof(DevUnion) * (offman->NumCallbacks + 1)); if (!newPrivates) return FALSE; else offman->devPrivates = newPrivates; offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback; offman->devPrivates[offman->NumCallbacks].ptr = devPriv; offman->NumCallbacks++; SendCallFreeBoxCallbacks(offman); return TRUE; } static FBAreaPtr AllocateArea(FBManagerPtr offman, int w, int h, int granularity, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, void *privData) { ScreenPtr pScreen = offman->pScreen; FBLinkPtr link = NULL; FBAreaPtr area = NULL; RegionRec NewReg; int i, x = 0, num; BoxPtr boxp; if (granularity <= 1) granularity = 0; boxp = RegionRects(offman->FreeBoxes); num = RegionNumRects(offman->FreeBoxes); /* look through the free boxes */ for (i = 0; i < num; i++, boxp++) { x = boxp->x1; if (granularity > 1) x = ((x + granularity - 1) / granularity) * granularity; if (((boxp->y2 - boxp->y1) < h) || ((boxp->x2 - x) < w)) continue; link = malloc(sizeof(FBLink)); if (!link) return NULL; area = &(link->area); link->next = offman->UsedAreas; offman->UsedAreas = link; offman->NumUsedAreas++; break; } /* try to boot a removeable one out if we are not expendable ourselves */ if (!area && !removeCB) { link = offman->UsedAreas; while (link) { if (!link->area.RemoveAreaCallback) { link = link->next; continue; } boxp = &(link->area.box); x = boxp->x1; if (granularity > 1) x = ((x + granularity - 1) / granularity) * granularity; if (((boxp->y2 - boxp->y1) < h) || ((boxp->x2 - x) < w)) { link = link->next; continue; } /* bye, bye */ (*link->area.RemoveAreaCallback) (&link->area); RegionInit(&NewReg, &(link->area.box), 1); RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &NewReg); RegionUninit(&NewReg); area = &(link->area); break; } } if (area) { area->pScreen = pScreen; area->granularity = granularity; area->box.x1 = x; area->box.x2 = x + w; area->box.y1 = boxp->y1; area->box.y2 = boxp->y1 + h; area->MoveAreaCallback = moveCB; area->RemoveAreaCallback = removeCB; area->devPrivate.ptr = privData; RegionInit(&NewReg, &(area->box), 1); RegionSubtract(offman->FreeBoxes, offman->FreeBoxes, &NewReg); RegionUninit(&NewReg); } return area; } static FBAreaPtr localAllocateOffscreenArea(ScreenPtr pScreen, int w, int h, int gran, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, void *privData) { FBManagerPtr offman; FBAreaPtr area = NULL; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); if ((area = AllocateArea(offman, w, h, gran, moveCB, removeCB, privData))) SendCallFreeBoxCallbacks(offman); return area; } static void localFreeOffscreenArea(FBAreaPtr area) { FBManagerPtr offman; FBLinkPtr pLink, pLinkPrev = NULL; RegionRec FreedRegion; ScreenPtr pScreen; pScreen = area->pScreen; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); pLink = offman->UsedAreas; if (!pLink) return; while (&(pLink->area) != area) { pLinkPrev = pLink; pLink = pLink->next; if (!pLink) return; } /* put the area back into the pool */ RegionInit(&FreedRegion, &(pLink->area.box), 1); RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedRegion); RegionUninit(&FreedRegion); if (pLinkPrev) pLinkPrev->next = pLink->next; else offman->UsedAreas = pLink->next; free(pLink); offman->NumUsedAreas--; SendCallFreeBoxCallbacks(offman); } static Bool localResizeOffscreenArea(FBAreaPtr resize, int w, int h) { FBManagerPtr offman; ScreenPtr pScreen; BoxRec OrigArea; RegionRec FreedReg; FBAreaPtr area = NULL; FBLinkPtr pLink, newLink, pLinkPrev = NULL; pScreen = resize->pScreen; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); /* find this link */ if (!(pLink = offman->UsedAreas)) return FALSE; while (&(pLink->area) != resize) { pLinkPrev = pLink; pLink = pLink->next; if (!pLink) return FALSE; } OrigArea.x1 = resize->box.x1; OrigArea.x2 = resize->box.x2; OrigArea.y1 = resize->box.y1; OrigArea.y2 = resize->box.y2; /* if it's smaller, this is easy */ if ((w <= (resize->box.x2 - resize->box.x1)) && (h <= (resize->box.y2 - resize->box.y1))) { RegionRec NewReg; resize->box.x2 = resize->box.x1 + w; resize->box.y2 = resize->box.y1 + h; if ((resize->box.y2 == OrigArea.y2) && (resize->box.x2 == OrigArea.x2)) return TRUE; RegionInit(&FreedReg, &OrigArea, 1); RegionInit(&NewReg, &(resize->box), 1); RegionSubtract(&FreedReg, &FreedReg, &NewReg); RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg); RegionUninit(&FreedReg); RegionUninit(&NewReg); SendCallFreeBoxCallbacks(offman); return TRUE; } /* otherwise we remove the old region */ RegionInit(&FreedReg, &OrigArea, 1); RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg); /* remove the old link */ if (pLinkPrev) pLinkPrev->next = pLink->next; else offman->UsedAreas = pLink->next; /* and try to add a new one */ if ((area = AllocateArea(offman, w, h, resize->granularity, resize->MoveAreaCallback, resize->RemoveAreaCallback, resize->devPrivate.ptr))) { /* copy data over to our link and replace the new with old */ memcpy(resize, area, sizeof(FBArea)); pLinkPrev = NULL; newLink = offman->UsedAreas; while (&(newLink->area) != area) { pLinkPrev = newLink; newLink = newLink->next; } if (pLinkPrev) pLinkPrev->next = newLink->next; else offman->UsedAreas = newLink->next; pLink->next = offman->UsedAreas; offman->UsedAreas = pLink; free(newLink); /* AllocateArea added one but we really only exchanged one */ offman->NumUsedAreas--; } else { /* reinstate the old region */ RegionSubtract(offman->FreeBoxes, offman->FreeBoxes, &FreedReg); RegionUninit(&FreedReg); pLink->next = offman->UsedAreas; offman->UsedAreas = pLink; return FALSE; } RegionUninit(&FreedReg); SendCallFreeBoxCallbacks(offman); return TRUE; } static Bool localQueryLargestOffscreenArea(ScreenPtr pScreen, int *width, int *height, int granularity, int preferences, int severity) { FBManagerPtr offman; RegionPtr newRegion = NULL; BoxPtr pbox; int nbox; int x, w, h, area, oldArea; *width = *height = oldArea = 0; if (granularity <= 1) granularity = 0; if ((preferences < 0) || (preferences > 3)) return FALSE; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); if (severity < 0) severity = 0; if (severity > 2) severity = 2; switch (severity) { case 2: if (offman->NumUsedAreas) { FBLinkPtr pLink; RegionRec tmpRegion; newRegion = RegionCreate(NULL, 1); RegionCopy(newRegion, offman->InitialBoxes); pLink = offman->UsedAreas; while (pLink) { if (!pLink->area.RemoveAreaCallback) { RegionInit(&tmpRegion, &(pLink->area.box), 1); RegionSubtract(newRegion, newRegion, &tmpRegion); RegionUninit(&tmpRegion); } pLink = pLink->next; } nbox = RegionNumRects(newRegion); pbox = RegionRects(newRegion); break; } case 1: if (offman->NumUsedAreas) { FBLinkPtr pLink; RegionRec tmpRegion; newRegion = RegionCreate(NULL, 1); RegionCopy(newRegion, offman->FreeBoxes); pLink = offman->UsedAreas; while (pLink) { if (pLink->area.RemoveAreaCallback) { RegionInit(&tmpRegion, &(pLink->area.box), 1); RegionAppend(newRegion, &tmpRegion); RegionUninit(&tmpRegion); } pLink = pLink->next; } nbox = RegionNumRects(newRegion); pbox = RegionRects(newRegion); break; } default: nbox = RegionNumRects(offman->FreeBoxes); pbox = RegionRects(offman->FreeBoxes); break; } while (nbox--) { x = pbox->x1; if (granularity > 1) x = ((x + granularity - 1) / granularity) * granularity; w = pbox->x2 - x; h = pbox->y2 - pbox->y1; area = w * h; if (w > 0) { Bool gotIt = FALSE; switch (preferences) { case FAVOR_AREA_THEN_WIDTH: if ((area > oldArea) || ((area == oldArea) && (w > *width))) gotIt = TRUE; break; case FAVOR_AREA_THEN_HEIGHT: if ((area > oldArea) || ((area == oldArea) && (h > *height))) gotIt = TRUE; break; case FAVOR_WIDTH_THEN_AREA: if ((w > *width) || ((w == *width) && (area > oldArea))) gotIt = TRUE; break; case FAVOR_HEIGHT_THEN_AREA: if ((h > *height) || ((h == *height) && (area > oldArea))) gotIt = TRUE; break; } if (gotIt) { *width = w; *height = h; oldArea = area; } } pbox++; } if (newRegion) RegionDestroy(newRegion); return TRUE; } static Bool localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen) { FBManagerPtr offman; FBLinkPtr pLink, tmp, pPrev = NULL; RegionRec FreedRegion; Bool anyUsed = FALSE; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); pLink = offman->UsedAreas; if (!pLink) return TRUE; while (pLink) { if (pLink->area.RemoveAreaCallback) { (*pLink->area.RemoveAreaCallback) (&pLink->area); RegionInit(&FreedRegion, &(pLink->area.box), 1); RegionAppend(offman->FreeBoxes, &FreedRegion); RegionUninit(&FreedRegion); if (pPrev) pPrev->next = pLink->next; else offman->UsedAreas = pLink->next; tmp = pLink; pLink = pLink->next; free(tmp); offman->NumUsedAreas--; anyUsed = TRUE; } else { pPrev = pLink; pLink = pLink->next; } } if (anyUsed) { RegionValidate(offman->FreeBoxes, &anyUsed); SendCallFreeBoxCallbacks(offman); } return TRUE; } static void LinearMoveCBWrapper(FBAreaPtr from, FBAreaPtr to) { /* this will never get called */ } static void LinearRemoveCBWrapper(FBAreaPtr area) { FBManagerPtr offman; FBLinearLinkPtr pLink, pLinkPrev = NULL; ScreenPtr pScreen = area->pScreen; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); pLink = offman->LinearAreas; if (!pLink) return; while (pLink->area != area) { pLinkPrev = pLink; pLink = pLink->next; if (!pLink) return; } /* give the user the callback it is expecting */ (*pLink->linear.RemoveLinearCallback) (&(pLink->linear)); if (pLinkPrev) pLinkPrev->next = pLink->next; else offman->LinearAreas = pLink->next; free(pLink); } static void DumpDebug(FBLinearLinkPtr pLink) { #ifdef DEBUG if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n"); while (pLink) { ErrorF(" Offset:%08x, Size:%08x, %s,%s\n", pLink->linear.offset, pLink->linear.size, pLink->free ? "Free" : "Used", pLink->area ? "Area" : "Linear"); pLink = pLink->next; } #endif } static FBLinearPtr AllocateLinear(FBManagerPtr offman, int size, int granularity, void *privData) { ScreenPtr pScreen = offman->pScreen; FBLinearLinkPtr linear = NULL; FBLinearLinkPtr newlink = NULL; int offset, end; if (size <= 0) return NULL; if (!offman->LinearAreas) return NULL; linear = offman->LinearAreas; while (linear) { /* Make sure we get a free area that's not an XY fallback case */ if (!linear->area && linear->free) { offset = linear->linear.offset; if (granularity > 1) offset = ((offset + granularity - 1) / granularity) * granularity; end = offset + size; if (end <= (linear->linear.offset + linear->linear.size)) break; } linear = linear->next; } if (!linear) return NULL; /* break left */ if (offset > linear->linear.offset) { newlink = malloc(sizeof(FBLinearLink)); if (!newlink) return NULL; newlink->area = NULL; newlink->linear.offset = offset; newlink->linear.size = linear->linear.size - (offset - linear->linear.offset); newlink->free = 1; newlink->next = linear->next; linear->linear.size -= newlink->linear.size; linear->next = newlink; linear = newlink; } /* break right */ if (size < linear->linear.size) { newlink = malloc(sizeof(FBLinearLink)); if (!newlink) return NULL; newlink->area = NULL; newlink->linear.offset = offset + size; newlink->linear.size = linear->linear.size - size; newlink->free = 1; newlink->next = linear->next; linear->linear.size = size; linear->next = newlink; } /* p = middle block */ linear->linear.granularity = granularity; linear->free = 0; linear->linear.pScreen = pScreen; linear->linear.MoveLinearCallback = NULL; linear->linear.RemoveLinearCallback = NULL; linear->linear.devPrivate.ptr = NULL; DumpDebug(offman->LinearAreas); return &(linear->linear); } static FBLinearPtr localAllocateOffscreenLinear(ScreenPtr pScreen, int length, int gran, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr removeCB, void *privData) { FBManagerPtr offman; FBLinearLinkPtr link; FBAreaPtr area; FBLinearPtr linear = NULL; BoxPtr extents; int w, h, pitch; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); /* Try to allocate from linear memory first...... */ DebugF("ALLOCATING LINEAR\n"); if ((linear = AllocateLinear(offman, length, gran, privData))) return linear; DebugF("NOPE, ALLOCATING AREA\n"); if (!(link = malloc(sizeof(FBLinearLink)))) return NULL; /* No linear available, so try and pinch some from the XY areas */ extents = RegionExtents(offman->InitialBoxes); pitch = extents->x2 - extents->x1; if (gran > 1) { if (gran > pitch) { /* we can't match the specified alignment with XY allocations */ free(link); return NULL; } if (pitch % gran) { /* pitch and granularity aren't a perfect match, let's allocate * a bit more so we can align later on */ length += gran - 1; } } if (length < pitch) { /* special case */ w = length; h = 1; } else { w = pitch; h = (length + pitch - 1) / pitch; } if ((area = localAllocateOffscreenArea(pScreen, w, h, gran, moveCB ? LinearMoveCBWrapper : NULL, removeCB ? LinearRemoveCBWrapper : NULL, privData))) { link->area = area; link->free = 0; link->next = offman->LinearAreas; offman->LinearAreas = link; linear = &(link->linear); linear->pScreen = pScreen; linear->size = h * w; linear->offset = (pitch * area->box.y1) + area->box.x1; if (gran > 1) linear->offset = ((linear->offset + gran - 1) / gran) * gran; linear->granularity = gran; linear->MoveLinearCallback = moveCB; linear->RemoveLinearCallback = removeCB; linear->devPrivate.ptr = privData; } else free(link); DumpDebug(offman->LinearAreas); return linear; } static void localFreeOffscreenLinear(FBLinearPtr linear) { FBManagerPtr offman; FBLinearLinkPtr pLink, pLinkPrev = NULL; ScreenPtr pScreen = linear->pScreen; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); pLink = offman->LinearAreas; if (!pLink) return; while (&(pLink->linear) != linear) { pLinkPrev = pLink; pLink = pLink->next; if (!pLink) return; } if (pLink->area) { /* really an XY area */ DebugF("FREEING AREA\n"); localFreeOffscreenArea(pLink->area); if (pLinkPrev) pLinkPrev->next = pLink->next; else offman->LinearAreas = pLink->next; free(pLink); DumpDebug(offman->LinearAreas); return; } pLink->free = 1; if (pLink->next && pLink->next->free) { FBLinearLinkPtr p = pLink->next; pLink->linear.size += p->linear.size; pLink->next = p->next; free(p); } if (pLinkPrev) { if (pLinkPrev->next && pLinkPrev->next->free && !pLinkPrev->area) { FBLinearLinkPtr p = pLinkPrev->next; pLinkPrev->linear.size += p->linear.size; pLinkPrev->next = p->next; free(p); } } DebugF("FREEING LINEAR\n"); DumpDebug(offman->LinearAreas); } static Bool localResizeOffscreenLinear(FBLinearPtr resize, int length) { FBManagerPtr offman; FBLinearLinkPtr pLink; ScreenPtr pScreen = resize->pScreen; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); pLink = offman->LinearAreas; if (!pLink) return FALSE; while (&(pLink->linear) != resize) { pLink = pLink->next; if (!pLink) return FALSE; } /* This could actually be alot smarter and try to move allocations from XY to linear when available. For now if it was XY, we keep it XY */ if (pLink->area) { /* really an XY area */ BoxPtr extents; int pitch, w, h; extents = RegionExtents(offman->InitialBoxes); pitch = extents->x2 - extents->x1; if (length < pitch) { /* special case */ w = length; h = 1; } else { w = pitch; h = (length + pitch - 1) / pitch; } if (localResizeOffscreenArea(pLink->area, w, h)) { resize->size = h * w; resize->offset = (pitch * pLink->area->box.y1) + pLink->area->box.x1; return TRUE; } } else { /* TODO!!!! resize the linear area */ } return FALSE; } static Bool localQueryLargestOffscreenLinear(ScreenPtr pScreen, int *size, int gran, int priority) { FBManagerPtr offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); FBLinearLinkPtr pLink; FBLinearLinkPtr pLinkRet; *size = 0; pLink = offman->LinearAreas; if (pLink && !pLink->area) { pLinkRet = pLink; while (pLink) { if (pLink->free) { if (pLink->linear.size > pLinkRet->linear.size) pLinkRet = pLink; } pLink = pLink->next; } if (pLinkRet->free) { *size = pLinkRet->linear.size; return TRUE; } } else { int w, h; if (localQueryLargestOffscreenArea(pScreen, &w, &h, gran, FAVOR_WIDTH_THEN_AREA, priority)) { BoxPtr extents; extents = RegionExtents(offman->InitialBoxes); if ((extents->x2 - extents->x1) == w) *size = w * h; return TRUE; } } return FALSE; } static FBManagerFuncs xf86FBManFuncs = { localAllocateOffscreenArea, localFreeOffscreenArea, localResizeOffscreenArea, localQueryLargestOffscreenArea, localRegisterFreeBoxCallback, localAllocateOffscreenLinear, localFreeOffscreenLinear, localResizeOffscreenLinear, localQueryLargestOffscreenLinear, localPurgeUnlockedOffscreenAreas }; static Bool xf86FBCloseScreen(ScreenPtr pScreen) { FBLinkPtr pLink, tmp; FBLinearLinkPtr pLinearLink, tmp2; FBManagerPtr offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); pScreen->CloseScreen = offman->CloseScreen; pLink = offman->UsedAreas; while (pLink) { tmp = pLink; pLink = pLink->next; free(tmp); } pLinearLink = offman->LinearAreas; while (pLinearLink) { tmp2 = pLinearLink; pLinearLink = pLinearLink->next; free(tmp2); } RegionDestroy(offman->InitialBoxes); RegionDestroy(offman->FreeBoxes); free(offman->FreeBoxesUpdateCallback); free(offman->devPrivates); free(offman); dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL); return (*pScreen->CloseScreen) (pScreen); } Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); RegionRec ScreenRegion; RegionRec FullRegion; BoxRec ScreenBox; Bool ret; ScreenBox.x1 = 0; ScreenBox.y1 = 0; ScreenBox.x2 = pScrn->virtualX; ScreenBox.y2 = pScrn->virtualY; if ((FullBox->x1 > ScreenBox.x1) || (FullBox->y1 > ScreenBox.y1) || (FullBox->x2 < ScreenBox.x2) || (FullBox->y2 < ScreenBox.y2)) { return FALSE; } if (FullBox->y2 < FullBox->y1) return FALSE; if (FullBox->x2 < FullBox->x1) return FALSE; RegionInit(&ScreenRegion, &ScreenBox, 1); RegionInit(&FullRegion, FullBox, 1); RegionSubtract(&FullRegion, &FullRegion, &ScreenRegion); ret = xf86InitFBManagerRegion(pScreen, &FullRegion); RegionUninit(&ScreenRegion); RegionUninit(&FullRegion); return ret; } Bool xf86InitFBManagerArea(ScreenPtr pScreen, int PixelArea, int Verbosity) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xRectangle Rect[3]; RegionPtr pRegion, pScreenRegion; int nRect; Bool ret = FALSE; if (PixelArea < (pScrn->displayWidth * pScrn->virtualY)) return FALSE; Rect[0].x = Rect[0].y = 0; Rect[0].width = pScrn->displayWidth; Rect[0].height = PixelArea / pScrn->displayWidth; nRect = 1; /* Add a possible partial scanline */ if ((Rect[1].height = Rect[1].width = PixelArea % pScrn->displayWidth)) { Rect[1].x = 0; Rect[1].y = Rect[0].height; Rect[1].height = 1; nRect++; } /* Factor out virtual resolution */ pRegion = RegionFromRects(nRect, Rect, 0); if (pRegion) { if (!RegionNar(pRegion)) { Rect[2].x = Rect[2].y = 0; Rect[2].width = pScrn->virtualX; Rect[2].height = pScrn->virtualY; pScreenRegion = RegionFromRects(1, &Rect[2], 0); if (pScreenRegion) { if (!RegionNar(pScreenRegion)) { RegionSubtract(pRegion, pRegion, pScreenRegion); ret = xf86InitFBManagerRegion(pScreen, pRegion); if (ret && xf86GetVerbosity() >= Verbosity) { int scrnIndex = pScrn->scrnIndex; xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity, "Largest offscreen areas (with overlaps):\n"); if (Rect[2].width < Rect[0].width) { xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity, "\t%d x %d rectangle at %d,0\n", Rect[0].width - Rect[2].width, Rect[0].height, Rect[2].width); } if (Rect[2].width < Rect[1].width) { xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity, "\t%d x %d rectangle at %d,0\n", Rect[1].width - Rect[2].width, Rect[0].height + Rect[1].height, Rect[2].width); } if (Rect[2].height < Rect[0].height) { xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity, "\t%d x %d rectangle at 0,%d\n", Rect[0].width, Rect[0].height - Rect[2].height, Rect[2].height); } if (Rect[1].height) { xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity, "\t%d x %d rectangle at 0,%d\n", Rect[1].width, Rect[0].height - Rect[2].height + Rect[1].height, Rect[2].height); } } } RegionDestroy(pScreenRegion); } } RegionDestroy(pRegion); } return ret; } Bool xf86InitFBManagerRegion(ScreenPtr pScreen, RegionPtr FullRegion) { FBManagerPtr offman; if (RegionNil(FullRegion)) return FALSE; if (!dixRegisterPrivateKey(&xf86FBScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!xf86RegisterOffscreenManager(pScreen, &xf86FBManFuncs)) return FALSE; offman = malloc(sizeof(FBManager)); if (!offman) return FALSE; dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, offman); offman->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86FBCloseScreen; offman->InitialBoxes = RegionCreate(NULL, 1); offman->FreeBoxes = RegionCreate(NULL, 1); RegionCopy(offman->InitialBoxes, FullRegion); RegionCopy(offman->FreeBoxes, FullRegion); offman->pScreen = pScreen; offman->UsedAreas = NULL; offman->LinearAreas = NULL; offman->NumUsedAreas = 0; offman->NumCallbacks = 0; offman->FreeBoxesUpdateCallback = NULL; offman->devPrivates = NULL; return TRUE; } Bool xf86InitFBManagerLinear(ScreenPtr pScreen, int offset, int size) { FBManagerPtr offman; FBLinearLinkPtr link; FBLinearPtr linear; if (size <= 0) return FALSE; /* we expect people to have called the Area setup first for pixmap cache */ if (!dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey)) return FALSE; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); offman->LinearAreas = malloc(sizeof(FBLinearLink)); if (!offman->LinearAreas) return FALSE; link = offman->LinearAreas; link->area = NULL; link->next = NULL; link->free = 1; linear = &(link->linear); linear->pScreen = pScreen; linear->size = size; linear->offset = offset; linear->granularity = 0; linear->MoveLinearCallback = NULL; linear->RemoveLinearCallback = NULL; linear->devPrivate.ptr = NULL; return TRUE; } /* This is an implementation specific function and should disappear after the next release. People should use the real linear functions instead */ FBAreaPtr xf86AllocateLinearOffscreenArea(ScreenPtr pScreen, int length, int gran, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, void *privData) { FBManagerFuncsPtr funcs; FBManagerPtr offman; BoxPtr extents; int w, h; if (xf86FBManagerKey == NULL) return NULL; if (!(funcs = (FBManagerFuncsPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBManagerKey))) return NULL; offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); extents = RegionExtents(offman->InitialBoxes); w = extents->x2 - extents->x1; if (gran > 1) { if (gran > w) return NULL; if (w % gran) length += gran - 1; } if (length <= w) { /* special case */ h = 1; w = length; } else { h = (length + w - 1) / w; } return (*funcs->AllocateOffscreenArea) (pScreen, w, h, gran, moveCB, removeCB, privData); } xorg-server-1.17.1/hw/xfree86/common/xf86Xinput.c0000664000175100017510000013216712456571574016407 00000000000000/* * 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 * copyright notice and this permission notice appear in supporting * documentation, and that the name of Frederic Lepied not be used in * 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. * * 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 * 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. * */ /* * Copyright (c) 2000-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * 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_XORG_CONFIG_H #include #endif #include #include #include #include #include #include "xf86.h" #include "xf86Priv.h" #include "xf86Config.h" #include "xf86Xinput.h" #include "xf86Optrec.h" #include "mipointer.h" #include "extinit.h" #include "loaderProcs.h" #include "systemd-logind.h" #include "exevents.h" /* AddInputDevice */ #include "exglobals.h" #include "eventstr.h" #include "inpututils.h" #include "optionstr.h" #include /* InputClassMatches */ #ifdef HAVE_FNMATCH_H #include #endif #ifdef HAVE_SYS_UTSNAME_H #include #endif #include #include /* for int64_t */ #include #include #include #ifdef HAVE_SYS_MKDEV_H #include /* for major() & minor() on Solaris */ #endif #include "mi.h" #include /* dix pointer acceleration */ #include #ifdef XFreeXDGA #include "dgaproc.h" #endif #include "xkbsrv.h" /* Valuator verification macro */ #define XI_VERIFY_VALUATORS(num_valuators) \ if (num_valuators > MAX_VALUATORS) { \ xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \ " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \ return; \ } static int xf86InputDevicePostInit(DeviceIntPtr dev); static InputInfoPtr *new_input_devices; static int new_input_devices_count; /** * Eval config and modify DeviceVelocityRec accordingly */ static void ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list, DeviceVelocityPtr s) { int tempi; float tempf; Atom float_prop = XIGetKnownProperty(XATOM_FLOAT); Atom prop; if (!s) return; /* common settings (available via device properties) */ tempf = xf86SetRealOption(list, "ConstantDeceleration", 1.0); if (tempf > 1.0) { xf86Msg(X_CONFIG, "%s: (accel) constant deceleration by %.1f\n", devname, tempf); prop = XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION); XIChangeDeviceProperty(pDev, prop, float_prop, 32, PropModeReplace, 1, &tempf, FALSE); } tempf = xf86SetRealOption(list, "AdaptiveDeceleration", 1.0); if (tempf > 1.0) { xf86Msg(X_CONFIG, "%s: (accel) adaptive deceleration by %.1f\n", devname, tempf); prop = XIGetKnownProperty(ACCEL_PROP_ADAPTIVE_DECELERATION); XIChangeDeviceProperty(pDev, prop, float_prop, 32, PropModeReplace, 1, &tempf, FALSE); } /* select profile by number */ tempi = xf86SetIntOption(list, "AccelerationProfile", s->statistics.profile_number); prop = XIGetKnownProperty(ACCEL_PROP_PROFILE_NUMBER); if (XIChangeDeviceProperty(pDev, prop, XA_INTEGER, 32, PropModeReplace, 1, &tempi, FALSE) == Success) { xf86Msg(X_CONFIG, "%s: (accel) acceleration profile %i\n", devname, tempi); } else { xf86Msg(X_CONFIG, "%s: (accel) acceleration profile %i is unknown\n", devname, tempi); } /* set scaling */ tempf = xf86SetRealOption(list, "ExpectedRate", 0); prop = XIGetKnownProperty(ACCEL_PROP_VELOCITY_SCALING); if (tempf > 0) { tempf = 1000.0 / tempf; XIChangeDeviceProperty(pDev, prop, float_prop, 32, PropModeReplace, 1, &tempf, FALSE); } else { tempf = xf86SetRealOption(list, "VelocityScale", s->corr_mul); XIChangeDeviceProperty(pDev, prop, float_prop, 32, PropModeReplace, 1, &tempf, FALSE); } tempi = xf86SetIntOption(list, "VelocityTrackerCount", -1); if (tempi > 1) InitTrackers(s, tempi); s->initial_range = xf86SetIntOption(list, "VelocityInitialRange", s->initial_range); s->max_diff = xf86SetRealOption(list, "VelocityAbsDiff", s->max_diff); tempf = xf86SetRealOption(list, "VelocityRelDiff", -1); if (tempf >= 0) { xf86Msg(X_CONFIG, "%s: (accel) max rel. velocity difference: %.1f%%\n", devname, tempf * 100.0); s->max_rel_diff = tempf; } /* Configure softening. If const deceleration is used, this is expected * to provide better subpixel information so we enable * softening by default only if ConstantDeceleration is not used */ s->use_softening = xf86SetBoolOption(list, "Softening", s->const_acceleration == 1.0); s->average_accel = xf86SetBoolOption(list, "AccelerationProfileAveraging", s->average_accel); s->reset_time = xf86SetIntOption(list, "VelocityReset", s->reset_time); } static void ApplyAccelerationSettings(DeviceIntPtr dev) { int scheme, i; DeviceVelocityPtr pVel; InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; char *schemeStr; if (dev->valuator && dev->ptrfeed) { schemeStr = xf86SetStrOption(pInfo->options, "AccelerationScheme", ""); scheme = dev->valuator->accelScheme.number; if (!xf86NameCmp(schemeStr, "predictable")) scheme = PtrAccelPredictable; if (!xf86NameCmp(schemeStr, "lightweight")) scheme = PtrAccelLightweight; if (!xf86NameCmp(schemeStr, "none")) scheme = PtrAccelNoOp; /* reinit scheme if needed */ if (dev->valuator->accelScheme.number != scheme) { if (dev->valuator->accelScheme.AccelCleanupProc) { dev->valuator->accelScheme.AccelCleanupProc(dev); } if (InitPointerAccelerationScheme(dev, scheme)) { xf86Msg(X_CONFIG, "%s: (accel) selected scheme %s/%i\n", pInfo->name, schemeStr, scheme); } else { xf86Msg(X_CONFIG, "%s: (accel) could not init scheme %s\n", pInfo->name, schemeStr); scheme = dev->valuator->accelScheme.number; } } else { xf86Msg(X_CONFIG, "%s: (accel) keeping acceleration scheme %i\n", pInfo->name, scheme); } free(schemeStr); /* process special configuration */ switch (scheme) { case PtrAccelPredictable: pVel = GetDevicePredictableAccelData(dev); ProcessVelocityConfiguration(dev, pInfo->name, pInfo->options, pVel); break; } i = xf86SetIntOption(pInfo->options, "AccelerationNumerator", dev->ptrfeed->ctrl.num); if (i >= 0) dev->ptrfeed->ctrl.num = i; i = xf86SetIntOption(pInfo->options, "AccelerationDenominator", dev->ptrfeed->ctrl.den); if (i > 0) dev->ptrfeed->ctrl.den = i; i = xf86SetIntOption(pInfo->options, "AccelerationThreshold", dev->ptrfeed->ctrl.threshold); if (i >= 0) dev->ptrfeed->ctrl.threshold = i; xf86Msg(X_CONFIG, "%s: (accel) acceleration factor: %.3f\n", pInfo->name, ((float) dev->ptrfeed->ctrl.num) / ((float) dev->ptrfeed->ctrl.den)); xf86Msg(X_CONFIG, "%s: (accel) acceleration threshold: %i\n", pInfo->name, dev->ptrfeed->ctrl.threshold); } } static void ApplyTransformationMatrix(DeviceIntPtr dev) { InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; char *str; int rc; float matrix[9] = { 0 }; if (!dev->valuator) return; str = xf86SetStrOption(pInfo->options, "TransformationMatrix", NULL); if (!str) return; rc = sscanf(str, "%f %f %f %f %f %f %f %f %f", &matrix[0], &matrix[1], &matrix[2], &matrix[3], &matrix[4], &matrix[5], &matrix[6], &matrix[7], &matrix[8]); if (rc != 9) { xf86Msg(X_ERROR, "%s: invalid format for transformation matrix. Ignoring configuration.\n", pInfo->name); return; } XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_TRANSFORM), XIGetKnownProperty(XATOM_FLOAT), 32, PropModeReplace, 9, matrix, FALSE); } /*********************************************************************** * * xf86ProcessCommonOptions -- * * Process global options. * *********************************************************************** */ void xf86ProcessCommonOptions(InputInfoPtr pInfo, XF86OptionPtr list) { if (xf86SetBoolOption(list, "Floating", 0) || !xf86SetBoolOption(list, "AlwaysCore", 1) || !xf86SetBoolOption(list, "SendCoreEvents", 1) || !xf86SetBoolOption(list, "CorePointer", 1) || !xf86SetBoolOption(list, "CoreKeyboard", 1)) { xf86Msg(X_CONFIG, "%s: doesn't report core events\n", pInfo->name); } else { pInfo->flags |= XI86_ALWAYS_CORE; xf86Msg(X_CONFIG, "%s: always reports core events\n", pInfo->name); } } /*********************************************************************** * * xf86ActivateDevice -- * * Initialize an input device. * * Returns TRUE on success, or FALSE otherwise. *********************************************************************** */ static DeviceIntPtr xf86ActivateDevice(InputInfoPtr pInfo) { DeviceIntPtr dev; Atom atom; dev = AddInputDevice(serverClient, pInfo->device_control, TRUE); if (dev == NULL) { xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n", pInfo->name); pInfo->dev = NULL; return NULL; } atom = MakeAtom(pInfo->type_name, strlen(pInfo->type_name), TRUE); AssignTypeAndName(dev, atom, pInfo->name); dev->public.devicePrivate = pInfo; pInfo->dev = dev; dev->coreEvents = pInfo->flags & XI86_ALWAYS_CORE; dev->type = SLAVE; dev->spriteInfo->spriteOwner = FALSE; dev->config_info = xf86SetStrOption(pInfo->options, "config_info", NULL); if (serverGeneration == 1) xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s, id %d)\n", pInfo->name, pInfo->type_name, dev->id); return dev; } /**************************************************************************** * * Caller: ProcXSetDeviceMode * * Change the mode of an extension device. * This function is used to change the mode of a device from reporting * relative motion to reporting absolute positional information, and * vice versa. * The default implementation below is that no such devices are supported. * *********************************************************************** */ int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) { InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; if (pInfo->switch_mode) { return (*pInfo->switch_mode) (client, dev, mode); } else return BadMatch; } /*********************************************************************** * * Caller: ProcXSetDeviceValuators * * Set the value of valuators on an extension input device. * This function is used to set the initial value of valuators on * those input devices that are capable of reporting either relative * motion or an absolute position, and allow an initial position to be set. * The default implementation below is that no such devices are supported. * *********************************************************************** */ int SetDeviceValuators(ClientPtr client, DeviceIntPtr dev, int *valuators, int first_valuator, int num_valuators) { InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; if (pInfo->set_device_valuators) return (*pInfo->set_device_valuators) (pInfo, valuators, first_valuator, num_valuators); return BadMatch; } /*********************************************************************** * * Caller: ProcXChangeDeviceControl * * Change the specified device controls on an extension input device. * *********************************************************************** */ int ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, xDeviceCtl * control) { InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; if (!pInfo->control_proc) { switch (control->control) { case DEVICE_CORE: case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: return BadMatch; case DEVICE_RESOLUTION: case DEVICE_ENABLE: return Success; default: return BadMatch; } } else { return (*pInfo->control_proc) (pInfo, control); } } /* * Get the operating system name from uname and store it statically to avoid * repeating the system call each time MatchOS is checked. */ static const char * HostOS(void) { #ifdef HAVE_SYS_UTSNAME_H struct utsname name; static char host_os[sizeof(name.sysname)] = ""; if (*host_os == '\0') { if (uname(&name) >= 0) strlcpy(host_os, name.sysname, sizeof(host_os)); else { strlcpy(host_os, "unknown", sizeof(host_os)); } } return host_os; #else return ""; #endif } static int match_substring(const char *attr, const char *pattern) { return (strstr(attr, pattern)) ? 0 : -1; } #ifdef HAVE_FNMATCH_H static int match_pattern(const char *attr, const char *pattern) { return fnmatch(pattern, attr, 0); } #else #define match_pattern match_substring #endif #ifdef HAVE_FNMATCH_H static int match_path_pattern(const char *attr, const char *pattern) { return fnmatch(pattern, attr, FNM_PATHNAME); } #else #define match_path_pattern match_substring #endif /* * If no Layout section is found, xf86ServerLayout.id becomes "(implicit)" * It is convenient that "" in patterns means "no explicit layout" */ static int match_string_implicit(const char *attr, const char *pattern) { if (strlen(pattern)) { return strcmp(attr, pattern); } else { return strcmp(attr, "(implicit)"); } } /* * Match an attribute against a list of NULL terminated arrays of patterns. * If a pattern in each list entry is matched, return TRUE. */ static Bool MatchAttrToken(const char *attr, struct xorg_list *patterns, int (*compare) (const char *attr, const char *pattern)) { const xf86MatchGroup *group; /* If there are no patterns, accept the match */ if (xorg_list_is_empty(patterns)) return TRUE; /* If there are patterns but no attribute, reject the match */ if (!attr) return FALSE; /* * Otherwise, iterate the list of patterns ensuring each entry has a * match. Each list entry is a separate Match line of the same type. */ xorg_list_for_each_entry(group, patterns, entry) { char *const *cur; Bool match = FALSE; for (cur = group->values; *cur; cur++) if ((*compare) (attr, *cur) == 0) { match = TRUE; break; } if (!match) return FALSE; } /* All the entries in the list matched the attribute */ return TRUE; } /* * Classes without any Match statements match all devices. Otherwise, all * statements must match. */ static Bool InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev, const InputAttributes * attrs) { /* MatchProduct substring */ if (!MatchAttrToken (attrs->product, &iclass->match_product, match_substring)) return FALSE; /* MatchVendor substring */ if (!MatchAttrToken(attrs->vendor, &iclass->match_vendor, match_substring)) return FALSE; /* MatchDevicePath pattern */ if (!MatchAttrToken (attrs->device, &iclass->match_device, match_path_pattern)) return FALSE; /* MatchOS case-insensitive string */ if (!MatchAttrToken(HostOS(), &iclass->match_os, strcasecmp)) return FALSE; /* MatchPnPID pattern */ if (!MatchAttrToken(attrs->pnp_id, &iclass->match_pnpid, match_pattern)) return FALSE; /* MatchUSBID pattern */ if (!MatchAttrToken(attrs->usb_id, &iclass->match_usbid, match_pattern)) return FALSE; /* MatchDriver string */ if (!MatchAttrToken(idev->driver, &iclass->match_driver, strcmp)) return FALSE; /* * MatchTag string * See if any of the device's tags match any of the MatchTag tokens. */ if (!xorg_list_is_empty(&iclass->match_tag)) { char *const *tag; Bool match; if (!attrs->tags) return FALSE; for (tag = attrs->tags, match = FALSE; *tag; tag++) { if (MatchAttrToken(*tag, &iclass->match_tag, strcmp)) { match = TRUE; break; } } if (!match) return FALSE; } /* MatchLayout string */ if (!xorg_list_is_empty(&iclass->match_layout)) { if (!MatchAttrToken(xf86ConfigLayout.id, &iclass->match_layout, match_string_implicit)) return FALSE; } /* MatchIs* booleans */ if (iclass->is_keyboard.set && iclass->is_keyboard.val != ! !(attrs->flags & ATTR_KEYBOARD)) return FALSE; if (iclass->is_pointer.set && iclass->is_pointer.val != ! !(attrs->flags & ATTR_POINTER)) return FALSE; if (iclass->is_joystick.set && iclass->is_joystick.val != ! !(attrs->flags & ATTR_JOYSTICK)) return FALSE; if (iclass->is_tablet.set && iclass->is_tablet.val != ! !(attrs->flags & ATTR_TABLET)) return FALSE; if (iclass->is_touchpad.set && iclass->is_touchpad.val != ! !(attrs->flags & ATTR_TOUCHPAD)) return FALSE; if (iclass->is_touchscreen.set && iclass->is_touchscreen.val != ! !(attrs->flags & ATTR_TOUCHSCREEN)) return FALSE; return TRUE; } /* * Merge in any InputClass configurations. Options in each InputClass * section have more priority than the original device configuration as * well as any previous InputClass sections. */ static int MergeInputClasses(const InputInfoPtr idev, const InputAttributes * attrs) { XF86ConfInputClassPtr cl; XF86OptionPtr classopts; for (cl = xf86configptr->conf_inputclass_lst; cl; cl = cl->list.next) { if (!InputClassMatches(cl, idev, attrs)) continue; /* Collect class options and driver settings */ classopts = xf86optionListDup(cl->option_lst); if (cl->driver) { free((void *) idev->driver); idev->driver = xstrdup(cl->driver); if (!idev->driver) { xf86Msg(X_ERROR, "Failed to allocate memory while merging " "InputClass configuration"); return BadAlloc; } classopts = xf86ReplaceStrOption(classopts, "driver", idev->driver); } /* Apply options to device with InputClass settings preferred. */ xf86Msg(X_CONFIG, "%s: Applying InputClass \"%s\"\n", idev->name, cl->identifier); idev->options = xf86optionListMerge(idev->options, classopts); } return Success; } /* * Iterate the list of classes and look for Option "Ignore". Return the * value of the last matching class and holler when returning TRUE. */ static Bool IgnoreInputClass(const InputInfoPtr idev, const InputAttributes * attrs) { XF86ConfInputClassPtr cl; Bool ignore = FALSE; const char *ignore_class; for (cl = xf86configptr->conf_inputclass_lst; cl; cl = cl->list.next) { if (!InputClassMatches(cl, idev, attrs)) continue; if (xf86findOption(cl->option_lst, "Ignore")) { ignore = xf86CheckBoolOption(cl->option_lst, "Ignore", FALSE); ignore_class = cl->identifier; } } if (ignore) xf86Msg(X_CONFIG, "%s: Ignoring device from InputClass \"%s\"\n", idev->name, ignore_class); return ignore; } InputInfoPtr xf86AllocateInput(void) { InputInfoPtr pInfo; pInfo = calloc(sizeof(*pInfo), 1); if (!pInfo) return NULL; pInfo->fd = -1; pInfo->type_name = "UNKNOWN"; return pInfo; } /* Append InputInfoRec to the tail of xf86InputDevs. */ static void xf86AddInput(InputDriverPtr drv, InputInfoPtr pInfo) { InputInfoPtr *prev = NULL; pInfo->drv = drv; pInfo->module = DuplicateModule(drv->module, NULL); for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next); *prev = pInfo; pInfo->next = NULL; xf86CollectInputOptions(pInfo, (const char **) drv->default_options); xf86OptionListReport(pInfo->options); xf86ProcessCommonOptions(pInfo, pInfo->options); } /* * Remove an entry from xf86InputDevs and free all the device's information. */ void xf86DeleteInput(InputInfoPtr pInp, int flags) { /* First check if the inputdev is valid. */ if (pInp == NULL) return; if (pInp->module) UnloadModule(pInp->module); /* This should *really* be handled in drv->UnInit(dev) call instead, but * if the driver forgets about it make sure we free it or at least crash * with flying colors */ free(pInp->private); FreeInputAttributes(pInp->attrs); if (pInp->flags & XI86_SERVER_FD) systemd_logind_release_fd(pInp->major, pInp->minor, pInp->fd); /* Remove the entry from the list. */ if (pInp == xf86InputDevs) xf86InputDevs = pInp->next; else { InputInfoPtr p = xf86InputDevs; while (p && p->next != pInp) p = p->next; if (p) p->next = pInp->next; /* Else the entry wasn't in the xf86InputDevs list (ignore this). */ } free((void *) pInp->driver); free((void *) pInp->name); xf86optionListFree(pInp->options); free(pInp); } /* * Apply backend-specific initialization. Invoked after ActivateDevice(), * i.e. after the driver successfully completed DEVICE_INIT and the device * is advertised. * @param dev the device * @return Success or an error code */ static int xf86InputDevicePostInit(DeviceIntPtr dev) { ApplyAccelerationSettings(dev); ApplyTransformationMatrix(dev); return Success; } static void xf86stat(const char *path, int *maj, int *min) { struct stat st; if (stat(path, &st) == -1) return; *maj = major(st.st_rdev); *min = minor(st.st_rdev); } /** * Create a new input device, activate and enable it. * * Possible return codes: * BadName .. a bad driver name was supplied. * BadImplementation ... The driver does not have a PreInit function. This * is a driver bug. * BadMatch .. device initialization failed. * BadAlloc .. too many input devices * * @param idev The device, already set up with identifier, driver, and the * options. * @param pdev Pointer to the new device, if Success was reported. * @param enable Enable the device after activating it. * * @return Success or an error code */ _X_INTERNAL int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) { InputDriverPtr drv = NULL; DeviceIntPtr dev = NULL; Bool paused; int rval; const char *path; /* Memory leak for every attached device if we don't * test if the module is already loaded first */ drv = xf86LookupInputDriver(pInfo->driver); if (!drv) if (xf86LoadOneModule(pInfo->driver, NULL)) drv = xf86LookupInputDriver(pInfo->driver); if (!drv) { xf86Msg(X_ERROR, "No input driver matching `%s'\n", pInfo->driver); rval = BadName; goto unwind; } path = xf86CheckStrOption(pInfo->options, "Device", NULL); if (path && pInfo->major == 0 && pInfo->minor == 0) xf86stat(path, &pInfo->major, &pInfo->minor); if (path && (drv->capabilities & XI86_DRV_CAP_SERVER_FD)){ int fd = systemd_logind_take_fd(pInfo->major, pInfo->minor, path, &paused); if (fd != -1) { if (paused) { /* Put on new_input_devices list for delayed probe */ new_input_devices = xnfrealloc(new_input_devices, sizeof(pInfo) * (new_input_devices_count + 1)); new_input_devices[new_input_devices_count] = pInfo; new_input_devices_count++; systemd_logind_release_fd(pInfo->major, pInfo->minor, fd); return BadMatch; } pInfo->fd = fd; pInfo->flags |= XI86_SERVER_FD; pInfo->options = xf86ReplaceIntOption(pInfo->options, "fd", fd); } } xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName, pInfo->name); if (!drv->PreInit) { xf86Msg(X_ERROR, "Input driver `%s' has no PreInit function (ignoring)\n", drv->driverName); rval = BadImplementation; goto unwind; } xf86AddInput(drv, pInfo); rval = drv->PreInit(drv, pInfo, 0); if (rval != Success) { xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, pInfo->name); goto unwind; } if (!(dev = xf86ActivateDevice(pInfo))) { rval = BadAlloc; goto unwind; } rval = ActivateDevice(dev, TRUE); if (rval != Success) { xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); RemoveDevice(dev, TRUE); goto unwind; } rval = xf86InputDevicePostInit(dev); if (rval != Success) { xf86Msg(X_ERROR, "Couldn't post-init device \"%s\"\n", pInfo->name); RemoveDevice(dev, TRUE); goto unwind; } /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86VTOwner()) { OsBlockSignals(); EnableDevice(dev, TRUE); if (!dev->enabled) { OsReleaseSignals(); xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); RemoveDevice(dev, TRUE); rval = BadMatch; goto unwind; } /* send enter/leave event, update sprite window */ CheckMotion(NULL, dev); OsReleaseSignals(); } *pdev = dev; return Success; unwind: if (pInfo) { if (drv && drv->UnInit) drv->UnInit(drv, pInfo, 0); else xf86DeleteInput(pInfo, 0); } return rval; } int NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *pdev) { InputInfoPtr pInfo = NULL; InputOption *option = NULL; int rval = Success; int is_auto = 0; pInfo = xf86AllocateInput(); if (!pInfo) return BadAlloc; nt_list_for_each_entry(option, options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); if (strcasecmp(key, "driver") == 0) { if (pInfo->driver) { rval = BadRequest; goto unwind; } pInfo->driver = xstrdup(value); if (!pInfo->driver) { rval = BadAlloc; goto unwind; } } if (strcasecmp(key, "name") == 0 || strcasecmp(key, "identifier") == 0) { if (pInfo->name) { rval = BadRequest; goto unwind; } pInfo->name = xstrdup(value); if (!pInfo->name) { rval = BadAlloc; goto unwind; } } if (strcmp(key, "_source") == 0 && (strcmp(value, "server/hal") == 0 || strcmp(value, "server/udev") == 0 || strcmp(value, "server/wscons") == 0)) { is_auto = 1; if (!xf86Info.autoAddDevices) { rval = BadMatch; goto unwind; } } if (strcmp(key, "major") == 0) pInfo->major = atoi(value); if (strcmp(key, "minor") == 0) pInfo->minor = atoi(value); } nt_list_for_each_entry(option, options, list.next) { /* Copy option key/value strings from the provided list */ pInfo->options = xf86AddNewOption(pInfo->options, input_option_get_key(option), input_option_get_value(option)); } /* Apply InputClass settings */ if (attrs) { if (IgnoreInputClass(pInfo, attrs)) { rval = BadIDChoice; goto unwind; } rval = MergeInputClasses(pInfo, attrs); if (rval != Success) goto unwind; pInfo->attrs = DuplicateInputAttributes(attrs); } if (!pInfo->name) { xf86Msg(X_INFO, "No identifier specified, ignoring this device.\n"); rval = BadRequest; goto unwind; } if (!pInfo->driver) { xf86Msg(X_INFO, "No input driver specified, ignoring this device.\n"); xf86Msg(X_INFO, "This device may have been added with another device file.\n"); rval = BadRequest; goto unwind; } rval = xf86NewInputDevice(pInfo, pdev, (!is_auto || (is_auto && xf86Info.autoEnableDevices))); return rval; unwind: if (is_auto && !xf86Info.autoAddDevices) xf86Msg(X_INFO, "AutoAddDevices is off - not adding device.\n"); xf86DeleteInput(pInfo, 0); return rval; } void DeleteInputDeviceRequest(DeviceIntPtr pDev) { InputInfoPtr pInfo = (InputInfoPtr) pDev->public.devicePrivate; InputDriverPtr drv = NULL; Bool isMaster = IsMaster(pDev); if (pInfo) /* need to get these before RemoveDevice */ drv = pInfo->drv; OsBlockSignals(); RemoveDevice(pDev, TRUE); if (!isMaster && pInfo != NULL) { if (drv->UnInit) drv->UnInit(drv, pInfo, 0); else xf86DeleteInput(pInfo, 0); } OsReleaseSignals(); } /* * convenient functions to post events */ void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, ...) { va_list var; int i = 0; ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_zero(&mask); va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); xf86PostMotionEventM(device, is_absolute, &mask); } void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, const int *valuators) { ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); xf86PostMotionEventM(device, is_absolute, &mask); } static int xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute, const ValuatorMask *mask) { int stolen = 0; #if XFreeXDGA ScreenPtr scr = NULL; int idx = 0, i; /* The evdev driver may not always send all axes across. */ if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) { scr = miPointerGetScreen(device); if (scr) { int dx = 0, dy = 0; idx = scr->myNum; if (valuator_mask_isset(mask, 0)) { dx = valuator_mask_get(mask, 0); if (is_absolute) dx -= device->last.valuators[0]; } if (valuator_mask_isset(mask, 1)) { dy = valuator_mask_get(mask, 1); if (is_absolute) dy -= device->last.valuators[1]; } if (DGAStealMotionEvent(device, idx, dx, dy)) stolen = 1; } } for (i = 2; i < valuator_mask_size(mask); i++) { AxisInfoPtr ax; double incr; int val, button; if (i >= device->valuator->numAxes) break; if (!valuator_mask_isset(mask, i)) continue; ax = &device->valuator->axes[i]; if (ax->scroll.type == SCROLL_TYPE_NONE) continue; if (!scr) { scr = miPointerGetScreen(device); if (!scr) break; idx = scr->myNum; } incr = ax->scroll.increment; val = valuator_mask_get(mask, i); if (ax->scroll.type == SCROLL_TYPE_VERTICAL) { if (incr * val < 0) button = 4; /* up */ else button = 5; /* down */ } else { /* SCROLL_TYPE_HORIZONTAL */ if (incr * val < 0) button = 6; /* left */ else button = 7; /* right */ } if (DGAStealButtonEvent(device, idx, button, 1) && DGAStealButtonEvent(device, idx, button, 0)) stolen = 1; } #endif return stolen; } void xf86PostMotionEventM(DeviceIntPtr device, int is_absolute, const ValuatorMask *mask) { int flags = 0; if (xf86CheckMotionEvent4DGA(device, is_absolute, mask)) return; if (valuator_mask_num_valuators(mask) > 0) { if (is_absolute) flags = POINTER_ABSOLUTE; else flags = POINTER_RELATIVE | POINTER_ACCELERATE; } QueuePointerEvents(device, MotionNotify, 0, flags, mask); } void xf86PostProximityEvent(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, ...) { va_list var; int i; ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_zero(&mask); va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); xf86PostProximityEventM(device, is_in, &mask); } void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, const int *valuators) { ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); xf86PostProximityEventM(device, is_in, &mask); } void xf86PostProximityEventM(DeviceIntPtr device, int is_in, const ValuatorMask *mask) { QueueProximityEvents(device, is_in ? ProximityIn : ProximityOut, mask); } void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button, int is_down, int first_valuator, int num_valuators, ...) { va_list var; ValuatorMask mask; int i = 0; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_zero(&mask); va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); xf86PostButtonEventM(device, is_absolute, button, is_down, &mask); } void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button, int is_down, int first_valuator, int num_valuators, const int *valuators) { ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); xf86PostButtonEventM(device, is_absolute, button, is_down, &mask); } void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute, int button, int is_down, const ValuatorMask *mask) { int flags = 0; if (valuator_mask_num_valuators(mask) > 0) { if (is_absolute) flags = POINTER_ABSOLUTE; else flags = POINTER_RELATIVE | POINTER_ACCELERATE; } #if XFreeXDGA if (miPointerGetScreen(device)) { int index = miPointerGetScreen(device)->myNum; if (DGAStealButtonEvent(device, index, button, is_down)) return; } #endif QueuePointerEvents(device, is_down ? ButtonPress : ButtonRelease, button, flags, mask); } void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, int first_valuator, int num_valuators, ...) { va_list var; int i = 0; ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_zero(&mask); va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask); } void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, int first_valuator, int num_valuators, const int *valuators) { ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask); } void xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, const ValuatorMask *mask) { #if XFreeXDGA DeviceIntPtr pointer; /* Some pointers send key events, paired device is wrong then. */ pointer = GetMaster(device, POINTER_OR_FLOAT); if (miPointerGetScreen(pointer)) { int index = miPointerGetScreen(pointer)->myNum; if (DGAStealKeyEvent(device, index, key_code, is_down)) return; } #endif QueueKeyboardEvents(device, is_down ? KeyPress : KeyRelease, key_code, mask); } void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down) { ValuatorMask mask; valuator_mask_zero(&mask); xf86PostKeyEventM(device, key_code, is_down, 0, &mask); } InputInfoPtr 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) * to_min - scaled lowest dimension * from_max - highest raw value from touch screen calibration * from_min - lowest raw value from touch screen calibration * * This function is the same for X or Y coordinates. * You may have to reverse the high and low values to compensate for * different orgins on the touch screen vs X. * * e.g. to scale from device coordinates into screen coordinates, call * xf86ScaleAxis(x, 0, screen_width, dev_min, dev_max); */ int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min) { int X; int64_t to_width = to_max - to_min; int64_t from_width = from_max - from_min; if (from_width) { X = (int) (((to_width * (Cx - from_min)) / from_width) + to_min); } else { X = 0; ErrorF("Divide by Zero in xf86ScaleAxis\n"); } if (X > to_max) X = to_max; if (X < to_min) X = to_min; return X; } Bool xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval, int resolution, int min_res, int max_res, int mode) { if (!dev || !dev->valuator) return FALSE; return InitValuatorAxisStruct(dev, axnum, label, minval, maxval, resolution, min_res, max_res, mode); } /* * Set the valuator values to be in sync with dix/event.c * DefineInitialRootWindow(). */ void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) { if (axnum == 0) { dev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; dev->last.valuators[0] = dev->valuator->axisVal[0]; } else if (axnum == 1) { dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; dev->last.valuators[1] = dev->valuator->axisVal[1]; } } /** * Deactivate a device. Call this function from the driver if you receive a * read error or something else that spoils your day. * 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 xf86DisableDevice(DeviceIntPtr dev, Bool panic) { if (!panic) { DisableDevice(dev, TRUE); } else { SendDevicePresenceEvent(dev->id, DeviceUnrecoverable); DeleteInputDeviceRequest(dev); } } /** * 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. */ void xf86EnableDevice(DeviceIntPtr dev) { EnableDevice(dev, TRUE); } /** * Post a touch event with optional valuators. If this is the first touch in * the sequence, at least x & y valuators must be provided. The driver is * responsible for maintaining the correct event sequence (TouchBegin, TouchUpdate, * TouchEnd). Submitting an update or end event for a unregistered touchid will * result in errors. * Touch IDs may be reused by the driver but only after a TouchEnd has been * submitted for that touch ID. * * @param dev The device to post the event for * @param touchid The touchid of the current touch event. Must be an * existing ID for TouchUpdate or TouchEnd events * @param type One of XI_TouchBegin, XI_TouchUpdate, XI_TouchEnd * @param flags Flags for this event * @param The valuator mask with all valuators set for this event. */ void xf86PostTouchEvent(DeviceIntPtr dev, uint32_t touchid, uint16_t type, uint32_t flags, const ValuatorMask *mask) { QueueTouchEvents(dev, type, touchid, flags, mask); } void xf86InputEnableVTProbe(void) { int i, is_auto = 0; InputOption *option = NULL; DeviceIntPtr pdev; for (i = 0; i < new_input_devices_count; i++) { InputInfoPtr pInfo = new_input_devices[i]; is_auto = 0; nt_list_for_each_entry(option, pInfo->options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); if (strcmp(key, "_source") == 0 && (strcmp(value, "server/hal") == 0 || strcmp(value, "server/udev") == 0 || strcmp(value, "server/wscons") == 0)) is_auto = 1; } xf86NewInputDevice(pInfo, &pdev, (!is_auto || (is_auto && xf86Info.autoEnableDevices))); } new_input_devices_count = 0; } /* end of xf86Xinput.c */ xorg-server-1.17.1/hw/xfree86/common/xf86Build.h.in0000664000175100017510000000010012274325511016530 00000000000000#define BUILD_DATE @BUILD_DATE@ #define BUILD_TIME @BUILD_TIME@ xorg-server-1.17.1/hw/xfree86/common/xf86platformBus.c0000664000175100017510000004211512456571574017407 00000000000000/* * 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 "systemd-logind.h" #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Priv.h" #include "xf86str.h" #include "xf86Bus.h" #include "Pci.h" #include "xf86platformBus.h" #include "xf86Config.h" #include "randrstr.h" int platformSlotClaimed; int xf86_num_platform_devices; struct xf86_platform_device *xf86_platform_devices; int xf86_add_platform_device(struct OdevAttributes *attribs, Bool unowned) { 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_platform_devices[xf86_num_platform_devices].flags = unowned ? XF86_PDEV_UNOWNED : 0; xf86_num_platform_devices++; return 0; } int xf86_remove_platform_device(int dev_index) { int j; config_odev_free_attributes(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_get_platform_device_unowned(int index) { return (xf86_platform_devices[index].flags & XF86_PDEV_UNOWNED) ? TRUE : FALSE; } struct xf86_platform_device * xf86_find_platform_device_by_devnum(int major, int minor) { int i, attr_major, attr_minor; for (i = 0; i < xf86_num_platform_devices; i++) { attr_major = xf86_platform_odev_attributes(i)->major; attr_minor = xf86_platform_odev_attributes(i)->minor; if (attr_major == major && attr_minor == minor) return &xf86_platform_devices[i]; } 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; } static Bool MatchToken(const char *value, struct xorg_list *patterns, int (*compare)(const char *, const char *)) { const xf86MatchGroup *group; /* If there are no patterns, accept the match */ if (xorg_list_is_empty(patterns)) return TRUE; /* If there are patterns but no attribute, reject the match */ if (!value) return FALSE; /* * Otherwise, iterate the list of patterns ensuring each entry has a * match. Each list entry is a separate Match line of the same type. */ xorg_list_for_each_entry(group, patterns, entry) { Bool match = FALSE; char *const *cur; for (cur = group->values; *cur; cur++) { if ((*compare)(value, *cur) == 0) { match = TRUE; break; } } if (!match) return FALSE; } /* All the entries in the list matched the attribute */ return TRUE; } static Bool OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) { char *driver = xf86_platform_odev_attributes(index)->driver; if (!MatchToken(driver, &oclass->match_driver, strcmp)) return FALSE; return TRUE; } static int xf86OutputClassDriverList(int index, char *matches[], int nmatches) { XF86ConfOutputClassPtr cl; int i = 0; if (nmatches == 0) return 0; for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { if (OutputClassMatches(cl, index)) { char *path = xf86_platform_odev_attributes(index)->path; xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n", cl->identifier, path); xf86Msg(X_NONE, "\tloading driver: %s\n", cl->driver); matches[i++] = xstrdup(cl->driver); } if (i >= nmatches) break; } return i; } /** * @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; j += xf86OutputClassDriverList(i, &matches[j], nmatches - j); info = xf86_platform_devices[i].pdev; #ifdef __linux__ if (info) j += xf86MatchDriverFromFiles(info->vendor_id, info->device_id, &matches[j], nmatches - j); #endif 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_platform_odev_attributes(i)->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 && gdev->screen == 0 && !xf86_check_platform_slot(dev)) return FALSE; entity = xf86ClaimPlatformSlot(dev, drvp, 0, gdev, gdev ? gdev->active : 0); if ((entity == -1) && gdev && (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 ((dev->flags & XF86_PDEV_SERVER_FD) && (!drvp->driverFunc || !drvp->driverFunc(NULL, SUPPORTS_SERVER_FDS, NULL))) { systemd_logind_release_fd(dev->attribs->major, dev->attribs->minor, dev->attribs->fd); dev->attribs->fd = -1; dev->flags &= ~XF86_PDEV_SERVER_FD; } 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 (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; screenLayoutPtr layout; static const 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; doPlatformProbe(&xf86_platform_devices[index], drvp, NULL, PLATFORM_PROBE_GPU_SCREEN, 0); 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); if (xf86GPUScreens[i]->pScreen->CreateScreenResources && !(*xf86GPUScreens[i]->pScreen->CreateScreenResources) (xf86GPUScreens[i]->pScreen)) { RemoveGPUScreen(xf86GPUScreens[i]->pScreen); xf86DeleteScreen(xf86GPUScreens[i]); xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL); xf86NumGPUScreens = old_screens; return -1; } /* attach unbound to 0 protocol screen */ AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); RRResourcesChanged(xf86Screens[0]->pScreen); RRTellChanged(xf86Screens[0]->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); RRResourcesChanged(xf86Screens[0]->pScreen); RRTellChanged(xf86Screens[0]->pScreen); out: return; } /* called on return from VT switch to find any new devices */ void xf86platformVTProbe(void) { int i; for (i = 0; i < xf86_num_platform_devices; i++) { if (!(xf86_platform_devices[i].flags & XF86_PDEV_UNOWNED)) continue; xf86_platform_devices[i].flags &= ~XF86_PDEV_UNOWNED; xf86PlatformReprobeDevice(i, xf86_platform_devices[i].attribs); } } void xf86platformPrimary(void) { /* use the first platform device as a fallback */ if (primaryBus.type == BUS_NONE) { xf86Msg(X_INFO, "no primary bus or device found\n"); if (xf86_num_platform_devices > 0) { primaryBus.id.plat = &xf86_platform_devices[0]; primaryBus.type = BUS_PLATFORM; xf86Msg(X_NONE, "\tfalling back to %s\n", primaryBus.id.plat->attribs->syspath); } } } #endif xorg-server-1.17.1/hw/xfree86/common/xf86Option.c0000664000175100017510000005722412366220413016347 00000000000000/* * Copyright (c) 1998-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * Author: David Dawes * * This file includes public option handling functions. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include "os.h" #include "xf86.h" #include "xf86Opt.h" #include "xf86Xinput.h" #include "xf86Optrec.h" #include "xf86Parser.h" #include "optionstr.h" static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, Bool markUsed); /* * xf86CollectOptions collects the options from each of the config file * sections used by the screen and puts the combined list in pScrn->options. * This function requires that the following have been initialised: * * pScrn->confScreen * pScrn->Entities[i]->device * pScrn->display * pScrn->monitor * * The extraOpts parameter may optionally contain a list of additional options * to include. * * The order of precedence for options is: * * extraOpts, display, confScreen, monitor, device */ void xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts) { XF86OptionPtr tmp; XF86OptionPtr extras = (XF86OptionPtr) extraOpts; GDevPtr device; int i; pScrn->options = NULL; for (i = pScrn->numEntities - 1; i >= 0; i--) { device = xf86GetDevFromEntity(pScrn->entityList[i], pScrn->entityInstanceList[i]); if (device && device->options) { tmp = xf86optionListDup(device->options); if (pScrn->options) xf86optionListMerge(pScrn->options, tmp); else pScrn->options = tmp; } } if (pScrn->monitor->options) { tmp = xf86optionListDup(pScrn->monitor->options); if (pScrn->options) pScrn->options = xf86optionListMerge(pScrn->options, tmp); else pScrn->options = tmp; } if (pScrn->confScreen->options) { tmp = xf86optionListDup(pScrn->confScreen->options); if (pScrn->options) pScrn->options = xf86optionListMerge(pScrn->options, tmp); else pScrn->options = tmp; } if (pScrn->display->options) { tmp = xf86optionListDup(pScrn->display->options); if (pScrn->options) pScrn->options = xf86optionListMerge(pScrn->options, tmp); else pScrn->options = tmp; } if (extras) { tmp = xf86optionListDup(extras); if (pScrn->options) pScrn->options = xf86optionListMerge(pScrn->options, tmp); else pScrn->options = tmp; } } /* * xf86CollectInputOptions collects extra options for an InputDevice (other * than those added by the config backend). * The options are merged into the existing ones and thus take precedence * over the others. */ void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts) { if (defaultOpts) { XF86OptionPtr tmp = xf86optionListCreate(defaultOpts, -1, 0); if (pInfo->options) pInfo->options = xf86optionListMerge(tmp, pInfo->options); else pInfo->options = tmp; } } /** * Duplicate the option list passed in. The returned pointer will be a newly * allocated option list and must be freed by the caller. */ XF86OptionPtr xf86OptionListDuplicate(XF86OptionPtr options) { XF86OptionPtr o = NULL; while (options) { o = xf86AddNewOption(o, xf86OptionName(options), xf86OptionValue(options)); options = xf86nextOption(options); } return o; } /* Created for new XInput stuff -- essentially extensions to the parser */ static int LookupIntOption(XF86OptionPtr optlist, const char *name, int deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_INTEGER; if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.num; return deflt; } static double LookupRealOption(XF86OptionPtr optlist, const char *name, double deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_REAL; if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.realnum; return deflt; } static char * LookupStrOption(XF86OptionPtr optlist, const char *name, const char *deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_STRING; if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.str; if (deflt) return strdup(deflt); else return NULL; } static int LookupBoolOption(XF86OptionPtr optlist, const char *name, int deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_BOOLEAN; if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.bool; return deflt; } static double LookupPercentOption(XF86OptionPtr optlist, const char *name, double deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_PERCENT; if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.realnum; return deflt; } /* These xf86Set* functions are intended for use by non-screen specific code */ int xf86SetIntOption(XF86OptionPtr optlist, const char *name, int deflt) { return LookupIntOption(optlist, name, deflt, TRUE); } double xf86SetRealOption(XF86OptionPtr optlist, const char *name, double deflt) { return LookupRealOption(optlist, name, deflt, TRUE); } char * xf86SetStrOption(XF86OptionPtr optlist, const char *name, const char *deflt) { return LookupStrOption(optlist, name, deflt, TRUE); } int xf86SetBoolOption(XF86OptionPtr optlist, const char *name, int deflt) { return LookupBoolOption(optlist, name, deflt, TRUE); } double xf86SetPercentOption(XF86OptionPtr optlist, const char *name, double deflt) { return LookupPercentOption(optlist, name, deflt, TRUE); } /* * These are like the Set*Option functions, but they don't mark the options * as used. */ int xf86CheckIntOption(XF86OptionPtr optlist, const char *name, int deflt) { return LookupIntOption(optlist, name, deflt, FALSE); } double xf86CheckRealOption(XF86OptionPtr optlist, const char *name, double deflt) { return LookupRealOption(optlist, name, deflt, FALSE); } char * xf86CheckStrOption(XF86OptionPtr optlist, const char *name, const char *deflt) { return LookupStrOption(optlist, name, deflt, FALSE); } int xf86CheckBoolOption(XF86OptionPtr optlist, const char *name, int deflt) { return LookupBoolOption(optlist, name, deflt, FALSE); } double xf86CheckPercentOption(XF86OptionPtr optlist, const char *name, double deflt) { return LookupPercentOption(optlist, name, deflt, FALSE); } /* * xf86AddNewOption() has the required property of replacing the option value * if the option is already present. */ XF86OptionPtr xf86ReplaceIntOption(XF86OptionPtr optlist, const char *name, const int val) { char tmp[16]; snprintf(tmp, sizeof(tmp), "%i", val); return xf86AddNewOption(optlist, name, tmp); } XF86OptionPtr xf86ReplaceRealOption(XF86OptionPtr optlist, const char *name, const double val) { char tmp[32]; snprintf(tmp, sizeof(tmp), "%f", val); return xf86AddNewOption(optlist, name, tmp); } XF86OptionPtr xf86ReplaceBoolOption(XF86OptionPtr optlist, const char *name, const Bool val) { return xf86AddNewOption(optlist, name, val ? "True" : "False"); } XF86OptionPtr xf86ReplacePercentOption(XF86OptionPtr optlist, const char *name, const double val) { char tmp[16]; snprintf(tmp, sizeof(tmp), "%lf%%", val); return xf86AddNewOption(optlist, name, tmp); } XF86OptionPtr xf86ReplaceStrOption(XF86OptionPtr optlist, const char *name, const char *val) { return xf86AddNewOption(optlist, name, val); } XF86OptionPtr xf86AddNewOption(XF86OptionPtr head, const char *name, const char *val) { /* XXX These should actually be allocated in the parser library. */ char *tmp = val ? strdup(val) : NULL; char *tmp_name = strdup(name); return xf86addNewOption(head, tmp_name, tmp); } XF86OptionPtr xf86NewOption(char *name, char *value) { return xf86newOption(name, value); } XF86OptionPtr xf86NextOption(XF86OptionPtr list) { return xf86nextOption(list); } XF86OptionPtr xf86OptionListCreate(const char **options, int count, int used) { return xf86optionListCreate(options, count, used); } XF86OptionPtr xf86OptionListMerge(XF86OptionPtr head, XF86OptionPtr tail) { return xf86optionListMerge(head, tail); } void xf86OptionListFree(XF86OptionPtr opt) { xf86optionListFree(opt); } char * xf86OptionName(XF86OptionPtr opt) { return xf86optionName(opt); } char * xf86OptionValue(XF86OptionPtr opt) { return xf86optionValue(opt); } void xf86OptionListReport(XF86OptionPtr parm) { XF86OptionPtr opts = parm; while (opts) { if (xf86optionValue(opts)) xf86ErrorFVerb(5, "\tOption \"%s\" \"%s\"\n", xf86optionName(opts), xf86optionValue(opts)); else xf86ErrorFVerb(5, "\tOption \"%s\"\n", xf86optionName(opts)); opts = xf86nextOption(opts); } } /* End of XInput-caused section */ XF86OptionPtr xf86FindOption(XF86OptionPtr options, const char *name) { return xf86findOption(options, name); } const char * xf86FindOptionValue(XF86OptionPtr options, const char *name) { return xf86findOptionValue(options, name); } void xf86MarkOptionUsed(XF86OptionPtr option) { if (option != NULL) option->opt_used = TRUE; } void xf86MarkOptionUsedByName(XF86OptionPtr options, const char *name) { XF86OptionPtr opt; opt = xf86findOption(options, name); if (opt != NULL) opt->opt_used = TRUE; } Bool xf86CheckIfOptionUsed(XF86OptionPtr option) { if (option != NULL) return option->opt_used; else return FALSE; } Bool xf86CheckIfOptionUsedByName(XF86OptionPtr options, const char *name) { XF86OptionPtr opt; opt = xf86findOption(options, name); if (opt != NULL) return opt->opt_used; else return FALSE; } void xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr opt) { while (opt) { if (opt->opt_name && !opt->opt_used) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" is not used\n", opt->opt_name); } opt = opt->list.next; } } static Bool GetBoolValue(OptionInfoPtr p, const char *s) { return xf86getBoolValue(&p->value.bool, s); } static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, Bool markUsed) { const char *s; char *end; Bool wasUsed = FALSE; if ((s = xf86findOptionValue(options, p->name)) != NULL) { if (markUsed) { wasUsed = xf86CheckIfOptionUsedByName(options, p->name); xf86MarkOptionUsedByName(options, p->name); } switch (p->type) { case OPTV_INTEGER: if (*s == '\0') { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires an integer value\n", p->name); } p->found = FALSE; } else { p->value.num = strtoul(s, &end, 0); if (*end == '\0') { p->found = TRUE; } else { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires an integer value\n", p->name); } p->found = FALSE; } } break; case OPTV_STRING: if (*s == '\0') { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a string value\n", p->name); } p->found = FALSE; } else { p->value.str = s; p->found = TRUE; } break; case OPTV_ANYSTR: p->value.str = s; p->found = TRUE; break; case OPTV_REAL: if (*s == '\0') { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a floating point " "value\n", p->name); } p->found = FALSE; } else { p->value.realnum = strtod(s, &end); if (*end == '\0') { p->found = TRUE; } else { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a floating point " "value\n", p->name); } p->found = FALSE; } } break; case OPTV_BOOLEAN: if (GetBoolValue(p, s)) { p->found = TRUE; } else { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a boolean value\n", p->name); } p->found = FALSE; } break; case OPTV_PERCENT: { char tmp = 0; /* awkward match, but %% doesn't increase the match counter, * hence 100 looks the same as 100% to the caller of sccanf */ if (sscanf(s, "%lf%c", &p->value.realnum, &tmp) != 2 || tmp != '%') { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a percent value\n", p->name); } p->found = FALSE; } else { p->found = TRUE; } } break; case OPTV_FREQ: if (*s == '\0') { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a frequency value\n", p->name); } p->found = FALSE; } else { double freq = strtod(s, &end); int units = 0; if (end != s) { p->found = TRUE; if (!xf86NameCmp(end, "Hz")) units = 1; else if (!xf86NameCmp(end, "kHz") || !xf86NameCmp(end, "k")) units = 1000; else if (!xf86NameCmp(end, "MHz") || !xf86NameCmp(end, "M")) units = 1000000; else { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a frequency value\n", p->name); } p->found = FALSE; } if (p->found) freq *= (double) units; } else { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a frequency value\n", p->name); } p->found = FALSE; } if (p->found) { p->value.freq.freq = freq; p->value.freq.units = units; } } break; case OPTV_NONE: /* Should never get here */ p->found = FALSE; break; } if (p->found && markUsed) { int verb = 2; if (wasUsed) verb = 4; xf86DrvMsgVerb(scrnIndex, X_CONFIG, verb, "Option \"%s\"", p->name); if (!(p->type == OPTV_BOOLEAN && *s == 0)) { xf86ErrorFVerb(verb, " \"%s\"", s); } xf86ErrorFVerb(verb, "\n"); } } else if (p->type == OPTV_BOOLEAN) { /* Look for matches with options with or without a "No" prefix. */ char *n, *newn; OptionInfoRec opt; n = xf86NormalizeName(p->name); if (!n) { p->found = FALSE; return FALSE; } if (strncmp(n, "no", 2) == 0) { newn = n + 2; } else { free(n); if (asprintf(&n, "No%s", p->name) == -1) { p->found = FALSE; return FALSE; } newn = n; } if ((s = xf86findOptionValue(options, newn)) != NULL) { if (markUsed) xf86MarkOptionUsedByName(options, newn); if (GetBoolValue(&opt, s)) { p->value.bool = !opt.value.bool; p->found = TRUE; } else { xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a boolean value\n", newn); p->found = FALSE; } } else { p->found = FALSE; } if (p->found && markUsed) { xf86DrvMsgVerb(scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn); if (*s != 0) { xf86ErrorFVerb(2, " \"%s\"", s); } xf86ErrorFVerb(2, "\n"); } free(n); } else { p->found = FALSE; } return p->found; } void xf86ProcessOptions(int scrnIndex, XF86OptionPtr options, OptionInfoPtr optinfo) { OptionInfoPtr p; for (p = optinfo; p->name != NULL; p++) { ParseOptionValue(scrnIndex, options, p, TRUE); } } OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec * table, int token) { const OptionInfoRec *p, *match = NULL, *set = NULL; if (!table) { ErrorF("xf86TokenToOptinfo: table is NULL\n"); return NULL; } for (p = table; p->token >= 0; p++) { if (p->token == token) { match = p; if (p->found) set = p; } } if (set) return (OptionInfoPtr) set; else if (match) return (OptionInfoPtr) match; else return NULL; } const char * xf86TokenToOptName(const OptionInfoRec * table, int token) { const OptionInfoRec *p; p = xf86TokenToOptinfo(table, token); return p ? p->name : NULL; } Bool xf86IsOptionSet(const OptionInfoRec * table, int token) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); return p && p->found; } const char * xf86GetOptValString(const OptionInfoRec * table, int token) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); if (p && p->found) return p->value.str; else return NULL; } Bool xf86GetOptValInteger(const OptionInfoRec * table, int token, int *value) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); if (p && p->found) { *value = p->value.num; return TRUE; } else return FALSE; } Bool xf86GetOptValULong(const OptionInfoRec * table, int token, unsigned long *value) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); if (p && p->found) { *value = p->value.num; return TRUE; } else return FALSE; } Bool xf86GetOptValReal(const OptionInfoRec * table, int token, double *value) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); if (p && p->found) { *value = p->value.realnum; return TRUE; } else return FALSE; } Bool xf86GetOptValFreq(const OptionInfoRec * table, int token, OptFreqUnits expectedUnits, double *value) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); if (p && p->found) { if (p->value.freq.units > 0) { /* Units give, so the scaling is known. */ switch (expectedUnits) { case OPTUNITS_HZ: *value = p->value.freq.freq; break; case OPTUNITS_KHZ: *value = p->value.freq.freq / 1000.0; break; case OPTUNITS_MHZ: *value = p->value.freq.freq / 1000000.0; break; } } else { /* No units given, so try to guess the scaling. */ switch (expectedUnits) { case OPTUNITS_HZ: *value = p->value.freq.freq; break; case OPTUNITS_KHZ: if (p->value.freq.freq > 1000.0) *value = p->value.freq.freq / 1000.0; else *value = p->value.freq.freq; break; case OPTUNITS_MHZ: if (p->value.freq.freq > 1000000.0) *value = p->value.freq.freq / 1000000.0; else if (p->value.freq.freq > 1000.0) *value = p->value.freq.freq / 1000.0; else *value = p->value.freq.freq; } } return TRUE; } else return FALSE; } Bool xf86GetOptValBool(const OptionInfoRec * table, int token, Bool *value) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); if (p && p->found) { *value = p->value.bool; return TRUE; } else return FALSE; } Bool xf86ReturnOptValBool(const OptionInfoRec * table, int token, Bool def) { OptionInfoPtr p; p = xf86TokenToOptinfo(table, token); if (p && p->found) { return p->value.bool; } else return def; } int xf86NameCmp(const char *s1, const char *s2) { return xf86nameCompare(s1, s2); } char * xf86NormalizeName(const char *s) { char *ret, *q; const char *p; if (s == NULL) return NULL; ret = malloc(strlen(s) + 1); for (p = s, q = ret; *p != 0; p++) { switch (*p) { case '_': case ' ': case '\t': continue; default: if (isupper(*p)) *q++ = tolower(*p); else *q++ = *p; } } *q = '\0'; return ret; } xorg-server-1.17.1/hw/xfree86/common/xf86RandR.c0000664000175100017510000003220712366751547016120 00000000000000/* * * Copyright © 2002 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 "os.h" #include "globals.h" #include "xf86.h" #include "xf86str.h" #include "xf86Priv.h" #include "xf86DDC.h" #include "mipointer.h" #include #include "inputstr.h" typedef struct _xf86RandRInfo { CloseScreenProcPtr CloseScreen; int virtualX; int virtualY; int mmWidth; int mmHeight; Rotation rotation; } XF86RandRInfoRec, *XF86RandRInfoPtr; static DevPrivateKeyRec xf86RandRKeyRec; static DevPrivateKey xf86RandRKey; #define XF86RANDRINFO(p) ((XF86RandRInfoPtr)dixLookupPrivate(&(p)->devPrivates, xf86RandRKey)) static int xf86RandRModeRefresh(DisplayModePtr mode) { if (mode->VRefresh) return (int) (mode->VRefresh + 0.5); else if (mode->Clock == 0) return 0; else return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5); } static Bool xf86RandRGetInfo(ScreenPtr pScreen, Rotation * rotations) { RRScreenSizePtr pSize; ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int refresh0 = 60; xorgRRModeMM RRModeMM; *rotations = RR_Rotate_0; for (mode = scrp->modes; mode != NULL; mode = mode->next) { int refresh = xf86RandRModeRefresh(mode); if (mode == scrp->modes) refresh0 = refresh; RRModeMM.mode = mode; RRModeMM.virtX = randrp->virtualX; RRModeMM.virtY = randrp->virtualY; RRModeMM.mmWidth = randrp->mmWidth; RRModeMM.mmHeight = randrp->mmHeight; if (scrp->DriverFunc) { (*scrp->DriverFunc) (scrp, RR_GET_MODE_MM, &RRModeMM); } pSize = RRRegisterSize(pScreen, mode->HDisplay, mode->VDisplay, RRModeMM.mmWidth, RRModeMM.mmHeight); if (!pSize) return FALSE; RRRegisterRate(pScreen, pSize, refresh); if (mode == scrp->currentMode && mode->HDisplay == scrp->virtualX && mode->VDisplay == scrp->virtualY) RRSetCurrentConfig(pScreen, randrp->rotation, refresh, pSize); if (mode->next == scrp->modes) break; } if (scrp->currentMode->HDisplay != randrp->virtualX || scrp->currentMode->VDisplay != randrp->virtualY) { mode = scrp->modes; RRModeMM.mode = NULL; RRModeMM.virtX = randrp->virtualX; RRModeMM.virtY = randrp->virtualY; RRModeMM.mmWidth = randrp->mmWidth; RRModeMM.mmHeight = randrp->mmHeight; if (scrp->DriverFunc) { (*scrp->DriverFunc) (scrp, RR_GET_MODE_MM, &RRModeMM); } pSize = RRRegisterSize(pScreen, randrp->virtualX, randrp->virtualY, RRModeMM.mmWidth, RRModeMM.mmHeight); if (!pSize) return FALSE; RRRegisterRate(pScreen, pSize, refresh0); if (scrp->virtualX == randrp->virtualX && scrp->virtualY == randrp->virtualY) { RRSetCurrentConfig(pScreen, randrp->rotation, refresh0, pSize); } } /* If there is driver support for randr, let it set our supported rotations */ if (scrp->DriverFunc) { xorgRRRotation RRRotation; RRRotation.RRRotations = *rotations; if (!(*scrp->DriverFunc) (scrp, RR_GET_INFO, &RRRotation)) return TRUE; *rotations = RRRotation.RRRotations; } return TRUE; } static Bool xf86RandRSetMode(ScreenPtr pScreen, DisplayModePtr mode, Bool useVirtual, int mmWidth, int mmHeight) { ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; int oldmmWidth = pScreen->mmWidth; int oldmmHeight = pScreen->mmHeight; int oldVirtualX = scrp->virtualX; int oldVirtualY = scrp->virtualY; WindowPtr pRoot = pScreen->root; Bool ret = TRUE; if (pRoot && scrp->vtSema) (*scrp->EnableDisableFBAccess) (scrp, FALSE); if (useVirtual) { scrp->virtualX = randrp->virtualX; scrp->virtualY = randrp->virtualY; } else { scrp->virtualX = mode->HDisplay; scrp->virtualY = mode->VDisplay; } /* * The DIX forgets the physical dimensions we passed into RRRegisterSize, so * reconstruct them if possible. */ if (scrp->DriverFunc) { xorgRRModeMM RRModeMM; RRModeMM.mode = mode; RRModeMM.virtX = scrp->virtualX; RRModeMM.virtY = scrp->virtualY; RRModeMM.mmWidth = mmWidth; RRModeMM.mmHeight = mmHeight; (*scrp->DriverFunc) (scrp, RR_GET_MODE_MM, &RRModeMM); mmWidth = RRModeMM.mmWidth; mmHeight = RRModeMM.mmHeight; } if (randrp->rotation & (RR_Rotate_90 | RR_Rotate_270)) { /* If the screen is rotated 90 or 270 degrees, swap the sizes. */ pScreen->width = scrp->virtualY; pScreen->height = scrp->virtualX; pScreen->mmWidth = mmHeight; pScreen->mmHeight = mmWidth; } else { pScreen->width = scrp->virtualX; pScreen->height = scrp->virtualY; pScreen->mmWidth = mmWidth; pScreen->mmHeight = mmHeight; } if (!xf86SwitchMode(pScreen, mode)) { pScreen->width = oldWidth; pScreen->height = oldHeight; pScreen->mmWidth = oldmmWidth; pScreen->mmHeight = oldmmHeight; scrp->virtualX = oldVirtualX; scrp->virtualY = oldVirtualY; ret = FALSE; } /* * Make sure the layout is correct */ xf86ReconfigureLayout(); if (scrp->vtSema) { /* * Make sure the whole screen is visible */ xf86SetViewport (pScreen, pScreen->width, pScreen->height); xf86SetViewport (pScreen, 0, 0); if (pRoot) (*scrp->EnableDisableFBAccess) (scrp, TRUE); } return ret; } static Bool xf86RandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int pos[MAXDEVICES][2]; Bool useVirtual = FALSE; Rotation oldRotation = randrp->rotation; DeviceIntPtr dev; Bool view_adjusted = FALSE; for (dev = inputInfo.devices; dev; dev = dev->next) { if (!IsMaster(dev) && !IsFloating(dev)) continue; miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); } for (mode = scrp->modes;; mode = mode->next) { if (mode->HDisplay == pSize->width && mode->VDisplay == pSize->height && (rate == 0 || xf86RandRModeRefresh(mode) == rate)) break; if (mode->next == scrp->modes) { if (pSize->width == randrp->virtualX && pSize->height == randrp->virtualY) { mode = scrp->modes; useVirtual = TRUE; break; } return FALSE; } } if (randrp->rotation != rotation) { /* Have the driver do its thing. */ if (scrp->DriverFunc) { xorgRRRotation RRRotation; RRRotation.RRConfig.rotation = rotation; RRRotation.RRConfig.rate = rate; RRRotation.RRConfig.width = pSize->width; RRRotation.RRConfig.height = pSize->height; /* * Currently we need to rely on HW support for rotation. */ if (!(*scrp->DriverFunc) (scrp, RR_SET_CONFIG, &RRRotation)) return FALSE; } else return FALSE; randrp->rotation = rotation; } if (!xf86RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth, pSize->mmHeight)) { if (randrp->rotation != oldRotation) { /* Have the driver undo its thing. */ if (scrp->DriverFunc) { xorgRRRotation RRRotation; RRRotation.RRConfig.rotation = oldRotation; RRRotation.RRConfig.rate = xf86RandRModeRefresh(scrp->currentMode); RRRotation.RRConfig.width = scrp->virtualX; RRRotation.RRConfig.height = scrp->virtualY; (*scrp->DriverFunc) (scrp, RR_SET_CONFIG, &RRRotation); } randrp->rotation = oldRotation; } return FALSE; } update_desktop_dimensions(); /* * Move the cursor back where it belongs; SwitchMode repositions it * FIXME: duplicated code, see modes/xf86RandR12.c */ for (dev = inputInfo.devices; dev; dev = dev->next) { if (!IsMaster(dev) && !IsFloating(dev)) continue; if (pScreen == miPointerGetScreen(dev)) { int px = pos[dev->id][0]; int py = pos[dev->id][1]; px = (px >= pScreen->width ? (pScreen->width - 1) : px); py = (py >= pScreen->height ? (pScreen->height - 1) : py); /* Setting the viewpoint makes only sense on one device */ if (!view_adjusted && IsMaster(dev)) { xf86SetViewport(pScreen, px, py); view_adjusted = TRUE; } (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE); } } return TRUE; } /* * Reset size back to original */ static Bool xf86RandRCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); scrp->virtualX = pScreen->width = randrp->virtualX; scrp->virtualY = pScreen->height = randrp->virtualY; scrp->currentMode = scrp->modes; pScreen->CloseScreen = randrp->CloseScreen; free(randrp); dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL); return (*pScreen->CloseScreen) (pScreen); } Rotation xf86GetRotation(ScreenPtr pScreen) { if (xf86RandRKey == NULL) return RR_Rotate_0; return XF86RANDRINFO(pScreen)->rotation; } /* Function to change RandR's idea of the virtual screen size */ Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen, int newvirtX, int newvirtY, int newmmWidth, int newmmHeight, Bool resetMode) { XF86RandRInfoPtr randrp; if (xf86RandRKey == NULL) return FALSE; randrp = XF86RANDRINFO(pScreen); if (randrp == NULL) return FALSE; if (newvirtX > 0) randrp->virtualX = newvirtX; if (newvirtY > 0) randrp->virtualY = newvirtY; if (newmmWidth > 0) randrp->mmWidth = newmmWidth; if (newmmHeight > 0) randrp->mmHeight = newmmHeight; /* This is only for during server start */ if (resetMode) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); return (xf86RandRSetMode(pScreen, pScrn->currentMode, TRUE, pScreen->mmWidth, pScreen->mmHeight)); } return TRUE; } Bool xf86RandRInit(ScreenPtr pScreen) { rrScrPrivPtr rp; XF86RandRInfoPtr randrp; ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); #ifdef PANORAMIX /* XXX disable RandR when using Xinerama */ if (!noPanoramiXExtension) return TRUE; #endif xf86RandRKey = &xf86RandRKeyRec; if (!dixRegisterPrivateKey(&xf86RandRKeyRec, PRIVATE_SCREEN, 0)) return FALSE; randrp = malloc(sizeof(XF86RandRInfoRec)); if (!randrp) return FALSE; if (!RRScreenInit(pScreen)) { free(randrp); return FALSE; } rp = rrGetScrPriv(pScreen); rp->rrGetInfo = xf86RandRGetInfo; rp->rrSetConfig = xf86RandRSetConfig; randrp->virtualX = scrp->virtualX; randrp->virtualY = scrp->virtualY; randrp->mmWidth = pScreen->mmWidth; randrp->mmHeight = pScreen->mmHeight; randrp->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86RandRCloseScreen; randrp->rotation = RR_Rotate_0; dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, randrp); return TRUE; } xorg-server-1.17.1/hw/xfree86/common/xf86Bus.c0000664000175100017510000004362512456571574015651 00000000000000/* * 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). */ /* * This file contains the interfaces to the bus-specific code */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" /* Bus-specific headers */ #include "xf86Bus.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" #ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" #endif /* Entity data */ EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */ int xf86NumEntities = 0; static int xf86EntityPrivateCount = 0; BusRec primaryBus = { BUS_NONE, {0} }; /** * Call the driver's correct probe function. * * If the driver implements the \c DriverRec::PciProbe entry-point and an * appropriate PCI device (with matching Device section in the xorg.conf file) * is found, it is called. If \c DriverRec::PciProbe or no devices can be * successfully probed with it (e.g., only non-PCI devices are available), * the driver's \c DriverRec::Probe function is called. * * \param drv Driver to probe * * \return * If a device can be successfully probed by the driver, \c TRUE is * returned. Otherwise, \c FALSE is returned. */ Bool xf86CallDriverProbe(DriverPtr drv, Bool detect_only) { Bool foundScreen = FALSE; #ifdef XSERVER_PLATFORM_BUS if (drv->platformProbe != NULL) { foundScreen = xf86platformProbeDev(drv); } if (ServerIsNotSeat0() && foundScreen) return foundScreen; #endif #ifdef XSERVER_LIBPCIACCESS if (!foundScreen && (drv->PciProbe != NULL)) { if (xf86DoConfigure && xf86DoConfigurePass1) { assert(detect_only); foundScreen = xf86PciAddMatchingDev(drv); } else { assert(!detect_only); foundScreen = xf86PciProbeDev(drv); } } #endif if (!foundScreen && (drv->Probe != NULL)) { xf86Msg(X_WARNING, "Falling back to old probe method for %s\n", drv->driverName); foundScreen = (*drv->Probe) (drv, (detect_only) ? PROBE_DETECT : PROBE_DEFAULT); } return foundScreen; } /** * @return TRUE if all buses are configured and set up correctly and FALSE * otherwise. */ Bool xf86BusConfig(void) { screenLayoutPtr layout; int i, j; /* * 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++) { xf86CallDriverProbe(xf86DriverList[i], FALSE); } /* If nothing was detected, return now */ if (xf86NumScreens == 0) { xf86Msg(X_ERROR, "No devices detected.\n"); return FALSE; } xf86VGAarbiterInit(); /* * Match up the screens found by the probes against those specified * in the config file. Remove the ones that won't be used. Sort * them in the order specified. * * What is the best way to do this? * * For now, go through the screens allocated by the probes, and * look for screen config entry which refers to the same device * section as picked out by the probe. * */ for (i = 0; i < xf86NumScreens; i++) { for (layout = xf86ConfigLayout.screens; layout->screen != NULL; layout++) { Bool found = FALSE; for (j = 0; j < xf86Screens[i]->numEntities; j++) { GDevPtr dev = xf86GetDevFromEntity(xf86Screens[i]->entityList[j], xf86Screens[i]->entityInstanceList[j]); if (dev == layout->screen->device) { /* A match has been found */ xf86Screens[i]->confScreen = layout->screen; found = TRUE; break; } } if (found) break; } if (layout->screen == NULL) { /* No match found */ xf86Msg(X_ERROR, "Screen %d deleted because of no matching config section.\n", i); 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, "Device(s) detected, but none match those in the config file.\n"); return FALSE; } return TRUE; } /* * Call the bus probes relevant to the architecture. * * The only one available so far is for PCI and SBUS. */ void xf86BusProbe(void) { #ifdef XSERVER_PLATFORM_BUS xf86platformProbe(); if (ServerIsNotSeat0() && xf86_num_platform_devices > 0) return; #endif #ifdef XSERVER_LIBPCIACCESS xf86PciProbe(); #endif #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) xf86SbusProbe(); #endif #ifdef XSERVER_PLATFORM_BUS xf86platformPrimary(); #endif } /* * Determine what bus type the busID string represents. The start of the * bus-dependent part of the string is returned as retID. */ BusType StringToBusType(const char *busID, const char **retID) { char *p, *s; BusType ret = BUS_NONE; /* If no type field, Default to PCI */ if (isdigit(busID[0])) { if (retID) *retID = busID; return BUS_PCI; } s = xstrdup(busID); p = strtok(s, ":"); if (p == NULL || *p == 0) { free(s); return BUS_NONE; } if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp")) 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; free(s); return ret; } int xf86AllocateEntity(void) { xf86NumEntities++; xf86Entities = xnfrealloc(xf86Entities, sizeof(EntityPtr) * xf86NumEntities); xf86Entities[xf86NumEntities - 1] = xnfcalloc(1, sizeof(EntityRec)); xf86Entities[xf86NumEntities - 1]->entityPrivates = xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1); return xf86NumEntities - 1; } Bool xf86IsEntityPrimary(int entityIndex) { EntityPtr pEnt = xf86Entities[entityIndex]; #ifdef XSERVER_LIBPCIACCESS if (primaryBus.type == BUS_PLATFORM && pEnt->bus.type == BUS_PCI) return MATCH_PCI_DEVICES(pEnt->bus.id.pci, primaryBus.id.plat->pdev); #endif if (primaryBus.type != pEnt->bus.type) return FALSE; switch (pEnt->bus.type) { case BUS_PCI: 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; } } Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, void *private) { if (entityIndex >= xf86NumEntities) return FALSE; xf86Entities[entityIndex]->entityInit = init; xf86Entities[entityIndex]->entityEnter = enter; xf86Entities[entityIndex]->entityLeave = leave; xf86Entities[entityIndex]->private = private; return TRUE; } Bool xf86DriverHasEntities(DriverPtr drvp) { int i; for (i = 0; i < xf86NumEntities; i++) { if (xf86Entities[i]->driver == drvp) return TRUE; } return FALSE; } void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex) { if (entityIndex == -1) return; if (xf86Entities[entityIndex]->inUse && !(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL)) { ErrorF("Requested Entity already in use!\n"); return; } pScrn->numEntities++; pScrn->entityList = xnfrealloc(pScrn->entityList, pScrn->numEntities * sizeof(int)); pScrn->entityList[pScrn->numEntities - 1] = entityIndex; xf86Entities[entityIndex]->inUse = TRUE; pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList, pScrn->numEntities * sizeof(int)); pScrn->entityInstanceList[pScrn->numEntities - 1] = 0; } void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, int instance) { int i; if (entityIndex == -1 || entityIndex >= xf86NumEntities) return; for (i = 0; i < pScrn->numEntities; i++) { if (pScrn->entityList[i] == entityIndex) { pScrn->entityInstanceList[i] = instance; break; } } } /* * XXX This needs to be updated for the case where a single entity may have * instances associated with more than one screen. */ ScrnInfoPtr xf86FindScreenForEntity(int entityIndex) { int i, j; if (entityIndex == -1) return NULL; if (xf86Screens) { for (i = 0; i < xf86NumScreens; i++) { for (j = 0; j < xf86Screens[i]->numEntities; j++) { if (xf86Screens[i]->entityList[j] == entityIndex) return xf86Screens[i]; } } } return NULL; } void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex) { int i; for (i = 0; i < pScrn->numEntities; i++) { if (pScrn->entityList[i] == entityIndex) { for (i++; i < pScrn->numEntities; i++) pScrn->entityList[i - 1] = pScrn->entityList[i]; pScrn->numEntities--; xf86Entities[entityIndex]->inUse = FALSE; break; } } } /* * xf86ClearEntityListForScreen() - called when a screen is deleted * to mark it's entities unused. Called by xf86DeleteScreen(). */ void xf86ClearEntityListForScreen(ScrnInfoPtr pScrn) { int i, entityIndex; if (pScrn->entityList == NULL || pScrn->numEntities == 0) return; for (i = 0; i < pScrn->numEntities; i++) { entityIndex = pScrn->entityList[i]; xf86Entities[entityIndex]->inUse = FALSE; /* disable resource: call the disable function */ } free(pScrn->entityList); free(pScrn->entityInstanceList); pScrn->entityList = NULL; pScrn->entityInstanceList = NULL; } /* * Add an extra device section (GDevPtr) to an entity. */ void xf86AddDevToEntity(int entityIndex, GDevPtr dev) { EntityPtr pEnt; if (entityIndex >= xf86NumEntities) return; pEnt = xf86Entities[entityIndex]; pEnt->numInstances++; pEnt->devices = xnfrealloc(pEnt->devices, pEnt->numInstances * sizeof(GDevPtr)); pEnt->devices[pEnt->numInstances - 1] = 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 * remains invisible to the driver. */ EntityInfoPtr xf86GetEntityInfo(int entityIndex) { EntityInfoPtr pEnt; int i; if (entityIndex == -1) return NULL; if (entityIndex >= xf86NumEntities) return NULL; pEnt = xnfcalloc(1, sizeof(EntityInfoRec)); pEnt->index = entityIndex; pEnt->location = xf86Entities[entityIndex]->bus; pEnt->active = xf86Entities[entityIndex]->active; pEnt->chipset = xf86Entities[entityIndex]->chipset; pEnt->driver = xf86Entities[entityIndex]->driver; if ((xf86Entities[entityIndex]->devices) && (xf86Entities[entityIndex]->devices[0])) { for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) if (xf86Entities[entityIndex]->devices[i]->screen == 0) break; pEnt->device = xf86Entities[entityIndex]->devices[i]; } else pEnt->device = NULL; return pEnt; } int xf86GetNumEntityInstances(int entityIndex) { if (entityIndex >= xf86NumEntities) return -1; return xf86Entities[entityIndex]->numInstances; } GDevPtr xf86GetDevFromEntity(int entityIndex, int instance) { int i; /* We might not use AddDevtoEntity */ if ((!xf86Entities[entityIndex]->devices) || (!xf86Entities[entityIndex]->devices[0])) return NULL; if (entityIndex >= xf86NumEntities || instance >= xf86Entities[entityIndex]->numInstances) return NULL; for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) if (xf86Entities[entityIndex]->devices[i]->screen == instance) break; return xf86Entities[entityIndex]->devices[i]; } /* * xf86AccessEnter() -- gets called to save the text mode VGA IO * resources when reentering the server after a VT switch. */ void xf86AccessEnter(void) { int i; for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityEnter) xf86Entities[i]->entityEnter(i, xf86Entities[i]->private); } void xf86AccessLeave(void) { int i; for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityLeave) xf86Entities[i]->entityLeave(i, xf86Entities[i]->private); } /* * xf86PostProbe() -- Allocate all non conflicting resources * This function gets called by xf86Init(). */ void xf86PostProbe(void) { int i; if (fbSlotClaimed && ( #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) sbusSlotClaimed || #endif #ifdef XSERVER_PLATFORM_BUS platformSlotClaimed || #endif #ifdef XSERVER_LIBPCIACCESS pciSlotClaimed #else TRUE #endif )) FatalError("Cannot run in framebuffer mode. Please specify busIDs " " for all framebuffer devices\n"); for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityInit) xf86Entities[i]->entityInit(i, xf86Entities[i]->private); } int xf86GetLastScrnFlag(int entityIndex) { if (entityIndex < xf86NumEntities) { return xf86Entities[entityIndex]->lastScrnFlag; } else { return -1; } } void xf86SetLastScrnFlag(int entityIndex, int scrnIndex) { if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->lastScrnFlag = scrnIndex; } } Bool xf86IsEntityShared(int entityIndex) { if (entityIndex < xf86NumEntities) { if (xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) { return TRUE; } } return FALSE; } void xf86SetEntityShared(int entityIndex) { if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp |= IS_SHARED_ACCEL; } } Bool xf86IsEntitySharable(int entityIndex) { if (entityIndex < xf86NumEntities) { if (xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) { return TRUE; } } return FALSE; } void xf86SetEntitySharable(int entityIndex) { if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp |= ACCEL_IS_SHARABLE; } } Bool xf86IsPrimInitDone(int entityIndex) { if (entityIndex < xf86NumEntities) { if (xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) { return TRUE; } } return FALSE; } void xf86SetPrimInitDone(int entityIndex) { if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp |= SA_PRIM_INIT_DONE; } } void xf86ClearPrimInitDone(int entityIndex) { if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp &= ~SA_PRIM_INIT_DONE; } } /* * Allocate a private in the entities. */ int xf86AllocateEntityPrivateIndex(void) { int idx, i; EntityPtr pEnt; DevUnion *nprivs; idx = xf86EntityPrivateCount++; for (i = 0; i < xf86NumEntities; i++) { pEnt = xf86Entities[i]; nprivs = xnfrealloc(pEnt->entityPrivates, xf86EntityPrivateCount * sizeof(DevUnion)); /* Zero the new private */ memset(&nprivs[idx], 0, sizeof(DevUnion)); pEnt->entityPrivates = nprivs; } return idx; } DevUnion * xf86GetEntityPrivate(int entityIndex, int privIndex) { if (entityIndex >= xf86NumEntities || privIndex >= xf86EntityPrivateCount) return NULL; return &(xf86Entities[entityIndex]->entityPrivates[privIndex]); } xorg-server-1.17.1/hw/xfree86/common/xf86xv.h0000664000175100017510000002177412414702051015537 00000000000000 /* * Copyright (c) 1998-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifndef _XF86XV_H_ #define _XF86XV_H_ #include "xvdix.h" #include "xf86str.h" #define VIDEO_OVERLAID_IMAGES 0x00000004 #define VIDEO_OVERLAID_STILLS 0x00000008 /* * Usage of VIDEO_CLIP_TO_VIEWPORT is not recommended. * It can make reput behaviour inconsistent. */ #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 typedef XvImageRec XF86ImageRec, *XF86ImagePtr; typedef struct { ScrnInfoPtr pScrn; int id; unsigned short width, height; int *pitches; /* bytes */ int *offsets; /* in bytes from start of framebuffer */ DevUnion devPrivate; } XF86SurfaceRec, *XF86SurfacePtr; typedef int (*PutVideoFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*PutStillFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*GetVideoFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*GetStillFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef void (*StopVideoFuncPtr) (ScrnInfoPtr pScrn, void *data, Bool Exit); typedef int (*SetPortAttributeFuncPtr) (ScrnInfoPtr pScrn, Atom attribute, INT32 value, void *data); typedef int (*GetPortAttributeFuncPtr) (ScrnInfoPtr pScrn, Atom attribute, INT32 *value, void *data); typedef void (*QueryBestSizeFuncPtr) (ScrnInfoPtr pScrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, void *data); typedef int (*PutImageFuncPtr) (ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int image, unsigned char *buf, short width, short height, Bool Sync, RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*ReputImageFuncPtr) (ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*QueryImageAttributesFuncPtr) (ScrnInfoPtr pScrn, int image, unsigned short *width, unsigned short *height, int *pitches, int *offsets); typedef enum { XV_OFF, XV_PENDING, XV_ON } XvStatus; /*** this is what the driver needs to fill out ***/ typedef struct { int id; const char *name; unsigned short width, height; XvRationalRec rate; } XF86VideoEncodingRec, *XF86VideoEncodingPtr; typedef struct { char depth; short class; } XF86VideoFormatRec, *XF86VideoFormatPtr; typedef XvAttributeRec XF86AttributeRec, *XF86AttributePtr; typedef struct { unsigned int type; int flags; const char *name; int nEncodings; XF86VideoEncodingPtr pEncodings; int nFormats; XF86VideoFormatPtr pFormats; int nPorts; DevUnion *pPortPrivates; int nAttributes; XF86AttributePtr pAttributes; int nImages; XF86ImagePtr pImages; PutVideoFuncPtr PutVideo; PutStillFuncPtr PutStill; GetVideoFuncPtr GetVideo; GetStillFuncPtr GetStill; StopVideoFuncPtr StopVideo; SetPortAttributeFuncPtr SetPortAttribute; GetPortAttributeFuncPtr GetPortAttribute; QueryBestSizeFuncPtr QueryBestSize; PutImageFuncPtr PutImage; ReputImageFuncPtr ReputImage; /* image/still */ QueryImageAttributesFuncPtr QueryImageAttributes; } XF86VideoAdaptorRec, *XF86VideoAdaptorPtr; typedef struct { XF86ImagePtr image; int flags; int (*alloc_surface) (ScrnInfoPtr pScrn, int id, unsigned short width, unsigned short height, XF86SurfacePtr surface); int (*free_surface) (XF86SurfacePtr surface); int (*display) (XF86SurfacePtr surface, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes); int (*stop) (XF86SurfacePtr surface); int (*getAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 *value); int (*setAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 value); int max_width; int max_height; int num_attributes; XF86AttributePtr attributes; } XF86OffscreenImageRec, *XF86OffscreenImagePtr; extern _X_EXPORT Bool xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * Adaptors, int num); typedef int (*xf86XVInitGenericAdaptorPtr) (ScrnInfoPtr pScrn, XF86VideoAdaptorPtr ** Adaptors); extern _X_EXPORT int xf86XVRegisterGenericAdaptorDriver(xf86XVInitGenericAdaptorPtr InitFunc); extern _X_EXPORT int xf86XVListGenericAdaptors(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr ** Adaptors); extern _X_EXPORT Bool xf86XVRegisterOffscreenImages(ScreenPtr pScreen, XF86OffscreenImagePtr images, int num); extern _X_EXPORT XF86OffscreenImagePtr xf86XVQueryOffscreenImages(ScreenPtr pScreen, int *num); extern _X_EXPORT XF86VideoAdaptorPtr xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr); extern _X_EXPORT void xf86XVFillKeyHelper(ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes); extern _X_EXPORT void xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes); extern _X_EXPORT void xf86XVFillKeyHelperPort(DrawablePtr pDraw, void *data, CARD32 key, RegionPtr clipboxes, Bool fillEverything); extern _X_EXPORT Bool xf86XVClipVideoHelper(BoxPtr dst, INT32 *xa, INT32 *xb, INT32 *ya, INT32 *yb, RegionPtr reg, INT32 width, INT32 height); extern _X_EXPORT void xf86XVCopyYUV12ToPacked(const void *srcy, const void *srcv, const void *srcu, void *dst, int srcPitchy, int srcPitchuv, int dstPitch, int h, int w); extern _X_EXPORT void xf86XVCopyPacked(const void *src, void *dst, int srcPitch, int dstPitch, int h, int w); #endif /* _XF86XV_H_ */ xorg-server-1.17.1/hw/xfree86/common/xf86VGAarbiter.h0000664000175100017510000000365112274325511017070 00000000000000/* * Copyright (c) 2009 Tiago Vignatti * * 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. */ #ifndef __XF86VGAARBITER_H #define __XF86VGAARBITER_H #include "screenint.h" #include "misc.h" #include "xf86.h" /* Functions */ extern void xf86VGAarbiterInit(void); extern void xf86VGAarbiterFini(void); void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn); extern Bool xf86VGAarbiterWrapFunctions(void); extern void xf86VGAarbiterLock(ScrnInfoPtr pScrn); extern void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn); /* allow a driver to remove itself from arbiter - really should be * done in the kernel though */ extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc); /* DRI and arbiter are really not possible together, * you really want to remove the card from arbitration if you can */ extern _X_EXPORT Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen); #endif /* __XF86VGAARBITER_H */ xorg-server-1.17.1/hw/xfree86/common/xf86Mode.c0000664000175100017510000022107712456571574016003 00000000000000/* * 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). */ /* * LCM() and scanLineWidth() are: * * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * 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 Marc Aurele La France not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Marc Aurele La France makes no representations * about the suitability of this software for any purpose. It is provided * "as-is" without express or implied warranty. * * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL MARC AURELE LA FRANCE 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. * * Copyright 1990,91,92,93 by Thomas Roell, Germany. * Copyright 1991,92,93 by SGCS (Snitily Graphics Consulting Services), USA. * * 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 Thomas Roell nor * SGCS be used in advertising or publicity pertaining to distribution * of the software without specific, written prior permission. * Thomas Roell nor SGCS makes no representations about the suitability * of this software for any purpose. It is provided "as is" without * express or implied warranty. * * THOMAS ROELL AND SGCS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR SGCS 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: Dirk Hohndel * David Dawes * Marc La France * ... and others * * This file includes helper functions for mode related things. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86Modes.h" #include "os.h" #include "servermd.h" #include "globals.h" #include "xf86.h" #include "xf86Priv.h" #include "edid.h" static void printModeRejectMessage(int index, DisplayModePtr p, int status) { const char *type; if (p->type & M_T_BUILTIN) type = "built-in "; else if (p->type & M_T_DEFAULT) type = "default "; else if (p->type & M_T_DRIVER) type = "driver "; else type = ""; xf86DrvMsg(index, X_INFO, "Not using %smode \"%s\" (%s)\n", type, p->name, xf86ModeStatusToString(status)); } /* * xf86GetNearestClock -- * Find closest clock to given frequency (in kHz). This assumes the * number of clocks is greater than zero. */ int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2, int DivFactor, int MulFactor, int *divider) { int nearestClock = 0, nearestDiv = 1; int minimumGap = abs(freq - scrp->clock[0]); int i, j, k, gap; if (allowDiv2) k = 2; else k = 1; /* Must set this here in case the best match is scrp->clock[0] */ if (divider != NULL) *divider = 0; for (i = 0; i < scrp->numClocks; i++) { for (j = 1; j <= k; j++) { gap = abs((freq * j) - ((scrp->clock[i] * DivFactor) / MulFactor)); if ((gap < minimumGap) || ((gap == minimumGap) && (j < nearestDiv))) { minimumGap = gap; nearestClock = i; nearestDiv = j; if (divider != NULL) *divider = (j - 1) * V_CLKDIV2; } } } return nearestClock; } /* * xf86ModeStatusToString * * Convert a ModeStatus value to a printable message */ const char * xf86ModeStatusToString(ModeStatus status) { switch (status) { case MODE_OK: return "Mode OK"; case MODE_HSYNC: return "hsync out of range"; case MODE_VSYNC: return "vrefresh out of range"; case MODE_H_ILLEGAL: return "illegal horizontal timings"; case MODE_V_ILLEGAL: return "illegal vertical timings"; case MODE_BAD_WIDTH: return "width requires unsupported line pitch"; case MODE_NOMODE: return "no mode of this name"; case MODE_NO_INTERLACE: return "interlace mode not supported"; case MODE_NO_DBLESCAN: return "doublescan mode not supported"; case MODE_NO_VSCAN: return "multiscan mode not supported"; case MODE_MEM: return "insufficient memory for mode"; case MODE_VIRTUAL_X: return "width too large for virtual size"; case MODE_VIRTUAL_Y: return "height too large for virtual size"; case MODE_MEM_VIRT: return "insufficient memory given virtual size"; case MODE_NOCLOCK: return "no clock available for mode"; case MODE_CLOCK_HIGH: return "mode clock too high"; case MODE_CLOCK_LOW: return "mode clock too low"; case MODE_CLOCK_RANGE: return "bad mode clock/interlace/doublescan"; case MODE_BAD_HVALUE: return "horizontal timing out of range"; case MODE_BAD_VVALUE: return "vertical timing out of range"; case MODE_BAD_VSCAN: return "VScan value out of range"; case MODE_HSYNC_NARROW: return "horizontal sync too narrow"; case MODE_HSYNC_WIDE: return "horizontal sync too wide"; case MODE_HBLANK_NARROW: return "horizontal blanking too narrow"; case MODE_HBLANK_WIDE: return "horizontal blanking too wide"; case MODE_VSYNC_NARROW: return "vertical sync too narrow"; case MODE_VSYNC_WIDE: return "vertical sync too wide"; case MODE_VBLANK_NARROW: return "vertical blanking too narrow"; case MODE_VBLANK_WIDE: return "vertical blanking too wide"; case MODE_PANEL: return "exceeds panel dimensions"; case MODE_INTERLACE_WIDTH: return "width too large for interlaced mode"; case MODE_ONE_WIDTH: return "all modes must have the same width"; case MODE_ONE_HEIGHT: return "all modes must have the same height"; case MODE_ONE_SIZE: return "all modes must have the same resolution"; case MODE_NO_REDUCED: return "monitor doesn't support reduced blanking"; case MODE_BANDWIDTH: return "mode requires too much memory bandwidth"; case MODE_BAD: return "unknown reason"; case MODE_ERROR: return "internal error"; default: return "unknown"; } } /* * xf86ShowClockRanges() -- Print the clock ranges allowed * and the clock values scaled by ClockMulFactor and ClockDivFactor */ void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges) { ClockRangePtr cp; int MulFactor = 1; int DivFactor = 1; int i, j; int scaledClock; for (cp = clockRanges; cp != NULL; cp = cp->next) { DivFactor = max(1, cp->ClockDivFactor); MulFactor = max(1, cp->ClockMulFactor); if (scrp->progClock) { if (cp->minClock) { if (cp->maxClock) { xf86DrvMsg(scrp->scrnIndex, X_INFO, "Clock range: %6.2f to %6.2f MHz\n", (double) cp->minClock / 1000.0, (double) cp->maxClock / 1000.0); } else { xf86DrvMsg(scrp->scrnIndex, X_INFO, "Minimum clock: %6.2f MHz\n", (double) cp->minClock / 1000.0); } } else { if (cp->maxClock) { xf86DrvMsg(scrp->scrnIndex, X_INFO, "Maximum clock: %6.2f MHz\n", (double) cp->maxClock / 1000.0); } } } else if (DivFactor > 1 || MulFactor > 1) { j = 0; for (i = 0; i < scrp->numClocks; i++) { scaledClock = (scrp->clock[i] * DivFactor) / MulFactor; if (scaledClock >= cp->minClock && scaledClock <= cp->maxClock) { if ((j % 8) == 0) { if (j > 0) xf86ErrorF("\n"); xf86DrvMsg(scrp->scrnIndex, X_INFO, "scaled clocks:"); } xf86ErrorF(" %6.2f", (double) scaledClock / 1000.0); j++; } } xf86ErrorF("\n"); } } } static Bool modeInClockRange(ClockRangePtr cp, DisplayModePtr p) { return ((p->Clock >= cp->minClock) && (p->Clock <= cp->maxClock) && (cp->interlaceAllowed || !(p->Flags & V_INTERLACE)) && (cp->doubleScanAllowed || ((p->VScan <= 1) && !(p->Flags & V_DBLSCAN)))); } /* * xf86FindClockRangeForMode() [... like the name says ...] */ static ClockRangePtr xf86FindClockRangeForMode(ClockRangePtr clockRanges, DisplayModePtr p) { ClockRangePtr cp; for (cp = clockRanges;; cp = cp->next) if (!cp || modeInClockRange(cp, p)) return cp; } /* * xf86HandleBuiltinMode() - handles built-in modes */ static ModeStatus xf86HandleBuiltinMode(ScrnInfoPtr scrp, DisplayModePtr p, DisplayModePtr modep, ClockRangePtr clockRanges, Bool allowDiv2) { ClockRangePtr cp; int extraFlags = 0; int MulFactor = 1; int DivFactor = 1; int clockIndex; /* Reject previously rejected modes */ if (p->status != MODE_OK) return p->status; /* Reject previously considered modes */ if (p->prev) return MODE_NOMODE; if ((p->type & M_T_CLOCK_C) == M_T_CLOCK_C) { /* Check clock is in range */ cp = xf86FindClockRangeForMode(clockRanges, p); if (cp == NULL) { modep->type = p->type; p->status = MODE_CLOCK_RANGE; return MODE_CLOCK_RANGE; } DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; if (!scrp->progClock) { clockIndex = xf86GetNearestClock(scrp, p->Clock, allowDiv2, cp->ClockDivFactor, cp->ClockMulFactor, &extraFlags); modep->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor; modep->ClockIndex = clockIndex; modep->SynthClock = scrp->clock[clockIndex]; if (extraFlags & V_CLKDIV2) { modep->Clock /= 2; modep->SynthClock /= 2; } } else { modep->Clock = p->Clock; modep->ClockIndex = -1; modep->SynthClock = (modep->Clock * MulFactor) / DivFactor; } modep->PrivFlags = cp->PrivFlags; } else { if (!scrp->progClock) { modep->Clock = p->Clock; modep->ClockIndex = p->ClockIndex; modep->SynthClock = p->SynthClock; } else { modep->Clock = p->Clock; modep->ClockIndex = -1; modep->SynthClock = p->SynthClock; } modep->PrivFlags = p->PrivFlags; } modep->type = p->type; modep->HDisplay = p->HDisplay; modep->HSyncStart = p->HSyncStart; modep->HSyncEnd = p->HSyncEnd; modep->HTotal = p->HTotal; modep->HSkew = p->HSkew; modep->VDisplay = p->VDisplay; modep->VSyncStart = p->VSyncStart; modep->VSyncEnd = p->VSyncEnd; modep->VTotal = p->VTotal; modep->VScan = p->VScan; modep->Flags = p->Flags | extraFlags; modep->CrtcHDisplay = p->CrtcHDisplay; modep->CrtcHBlankStart = p->CrtcHBlankStart; modep->CrtcHSyncStart = p->CrtcHSyncStart; modep->CrtcHSyncEnd = p->CrtcHSyncEnd; modep->CrtcHBlankEnd = p->CrtcHBlankEnd; modep->CrtcHTotal = p->CrtcHTotal; modep->CrtcHSkew = p->CrtcHSkew; modep->CrtcVDisplay = p->CrtcVDisplay; modep->CrtcVBlankStart = p->CrtcVBlankStart; modep->CrtcVSyncStart = p->CrtcVSyncStart; modep->CrtcVSyncEnd = p->CrtcVSyncEnd; modep->CrtcVBlankEnd = p->CrtcVBlankEnd; modep->CrtcVTotal = p->CrtcVTotal; modep->CrtcHAdjusted = p->CrtcHAdjusted; modep->CrtcVAdjusted = p->CrtcVAdjusted; modep->HSync = p->HSync; modep->VRefresh = p->VRefresh; modep->Private = p->Private; modep->PrivSize = p->PrivSize; p->prev = modep; return MODE_OK; } /* * xf86LookupMode * * This function returns a mode from the given list which matches the * given name. When multiple modes with the same name are available, * the method of picking the matching mode is determined by the * strategy selected. * * This function takes the following parameters: * scrp ScrnInfoPtr * modep pointer to the returned mode, which must have the name * field filled in. * clockRanges a list of clock ranges. This is optional when all the * modes are built-in modes. * strategy how to decide which mode to use from multiple modes with * the same name * * In addition, the following fields from the ScrnInfoRec are used: * modePool the list of monitor modes compatible with the driver * clocks a list of discrete clocks * numClocks number of discrete clocks * progClock clock is programmable * * If a mode was found, its values are filled in to the area pointed to * by modep, If a mode was not found the return value indicates the * reason. */ ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, ClockRangePtr clockRanges, LookupModeFlags strategy) { DisplayModePtr p, bestMode = NULL; ClockRangePtr cp; int i, k, gap, minimumGap = CLOCK_TOLERANCE + 1; double refresh, bestRefresh = 0.0; Bool found = FALSE; int extraFlags = 0; int clockIndex = -1; int MulFactor = 1; int DivFactor = 1; int ModePrivFlags = 0; ModeStatus status = MODE_NOMODE; Bool allowDiv2 = (strategy & LOOKUP_CLKDIV2) != 0; int n; const int types[] = { M_T_BUILTIN | M_T_PREFERRED, M_T_BUILTIN, M_T_USERDEF | M_T_PREFERRED, M_T_USERDEF, M_T_DRIVER | M_T_PREFERRED, M_T_DRIVER, 0 }; const int ntypes = sizeof(types) / sizeof(int); strategy &= ~(LOOKUP_CLKDIV2 | LOOKUP_OPTIONAL_TOLERANCES); /* Some sanity checking */ if (scrp == NULL || scrp->modePool == NULL || (!scrp->progClock && scrp->numClocks == 0)) { ErrorF("xf86LookupMode: called with invalid scrnInfoRec\n"); return MODE_ERROR; } if (modep == NULL || modep->name == NULL) { ErrorF("xf86LookupMode: called with invalid modep\n"); return MODE_ERROR; } for (cp = clockRanges; cp != NULL; cp = cp->next) { /* DivFactor and MulFactor must be > 0 */ cp->ClockDivFactor = max(1, cp->ClockDivFactor); cp->ClockMulFactor = max(1, cp->ClockMulFactor); } /* Scan the mode pool for matching names */ for (n = 0; n < ntypes; n++) { int type = types[n]; for (p = scrp->modePool; p != NULL; p = p->next) { /* scan through the modes in the sort order above */ if ((p->type & type) != type) continue; if (strcmp(p->name, modep->name) == 0) { /* Skip over previously rejected modes */ if (p->status != MODE_OK) { if (!found) status = p->status; continue; } /* Skip over previously considered modes */ if (p->prev) continue; if (p->type & M_T_BUILTIN) { return xf86HandleBuiltinMode(scrp, p, modep, clockRanges, allowDiv2); } /* Check clock is in range */ cp = xf86FindClockRangeForMode(clockRanges, p); if (cp == NULL) { /* * XXX Could do more here to provide a more detailed * reason for not finding a mode. */ p->status = MODE_CLOCK_RANGE; if (!found) status = MODE_CLOCK_RANGE; continue; } /* * If programmable clock and strategy is not * LOOKUP_BEST_REFRESH, the required mode has been found, * otherwise record the refresh and continue looking. */ if (scrp->progClock) { found = TRUE; if (strategy != LOOKUP_BEST_REFRESH) { bestMode = p; DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; ModePrivFlags = cp->PrivFlags; break; } refresh = xf86ModeVRefresh(p); if (p->Flags & V_INTERLACE) refresh /= INTERLACE_REFRESH_WEIGHT; if (refresh > bestRefresh) { bestMode = p; DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; ModePrivFlags = cp->PrivFlags; bestRefresh = refresh; } continue; } /* * Clock is in range, so if it is not a programmable clock, find * a matching clock. */ i = xf86GetNearestClock(scrp, p->Clock, allowDiv2, cp->ClockDivFactor, cp->ClockMulFactor, &k); /* * If the clock is too far from the requested clock, this * mode is no good. */ if (k & V_CLKDIV2) gap = abs((p->Clock * 2) - ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor)); else gap = abs(p->Clock - ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor)); if (gap > minimumGap) { p->status = MODE_NOCLOCK; if (!found) status = MODE_NOCLOCK; continue; } found = TRUE; if (strategy == LOOKUP_BEST_REFRESH) { refresh = xf86ModeVRefresh(p); if (p->Flags & V_INTERLACE) refresh /= INTERLACE_REFRESH_WEIGHT; if (refresh > bestRefresh) { bestMode = p; DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; ModePrivFlags = cp->PrivFlags; extraFlags = k; clockIndex = i; bestRefresh = refresh; } continue; } if (strategy == LOOKUP_CLOSEST_CLOCK) { if (gap < minimumGap) { bestMode = p; DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; ModePrivFlags = cp->PrivFlags; extraFlags = k; clockIndex = i; minimumGap = gap; } continue; } /* * If strategy is neither LOOKUP_BEST_REFRESH or * LOOKUP_CLOSEST_CLOCK the required mode has been found. */ bestMode = p; DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; ModePrivFlags = cp->PrivFlags; extraFlags = k; clockIndex = i; break; } } if (found) break; } if (!found || bestMode == NULL) return status; /* Fill in the mode parameters */ if (scrp->progClock) { modep->Clock = bestMode->Clock; modep->ClockIndex = -1; modep->SynthClock = (modep->Clock * MulFactor) / DivFactor; } else { modep->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor; modep->ClockIndex = clockIndex; modep->SynthClock = scrp->clock[clockIndex]; if (extraFlags & V_CLKDIV2) { modep->Clock /= 2; modep->SynthClock /= 2; } } modep->type = bestMode->type; modep->PrivFlags = ModePrivFlags; modep->HDisplay = bestMode->HDisplay; modep->HSyncStart = bestMode->HSyncStart; modep->HSyncEnd = bestMode->HSyncEnd; modep->HTotal = bestMode->HTotal; modep->HSkew = bestMode->HSkew; modep->VDisplay = bestMode->VDisplay; modep->VSyncStart = bestMode->VSyncStart; modep->VSyncEnd = bestMode->VSyncEnd; modep->VTotal = bestMode->VTotal; modep->VScan = bestMode->VScan; modep->Flags = bestMode->Flags | extraFlags; modep->CrtcHDisplay = bestMode->CrtcHDisplay; modep->CrtcHBlankStart = bestMode->CrtcHBlankStart; modep->CrtcHSyncStart = bestMode->CrtcHSyncStart; modep->CrtcHSyncEnd = bestMode->CrtcHSyncEnd; modep->CrtcHBlankEnd = bestMode->CrtcHBlankEnd; modep->CrtcHTotal = bestMode->CrtcHTotal; modep->CrtcHSkew = bestMode->CrtcHSkew; modep->CrtcVDisplay = bestMode->CrtcVDisplay; modep->CrtcVBlankStart = bestMode->CrtcVBlankStart; modep->CrtcVSyncStart = bestMode->CrtcVSyncStart; modep->CrtcVSyncEnd = bestMode->CrtcVSyncEnd; modep->CrtcVBlankEnd = bestMode->CrtcVBlankEnd; modep->CrtcVTotal = bestMode->CrtcVTotal; modep->CrtcHAdjusted = bestMode->CrtcHAdjusted; modep->CrtcVAdjusted = bestMode->CrtcVAdjusted; modep->HSync = bestMode->HSync; modep->VRefresh = bestMode->VRefresh; modep->Private = bestMode->Private; modep->PrivSize = bestMode->PrivSize; bestMode->prev = modep; return MODE_OK; } /* * xf86CheckModeForMonitor * * This function takes a mode and monitor description, and determines * if the mode is valid for the monitor. */ ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor) { int i; /* Sanity checks */ if (mode == NULL || monitor == NULL) { ErrorF("xf86CheckModeForMonitor: called with invalid parameters\n"); return MODE_ERROR; } DebugF("xf86CheckModeForMonitor(%p %s, %p %s)\n", mode, mode->name, monitor, monitor->id); /* Some basic mode validity checks */ if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart || mode->HSyncStart >= mode->HSyncEnd || mode->HSyncEnd >= mode->HTotal) return MODE_H_ILLEGAL; if (0 >= mode->VDisplay || mode->VDisplay > mode->VSyncStart || mode->VSyncStart >= mode->VSyncEnd || mode->VSyncEnd >= mode->VTotal) return MODE_V_ILLEGAL; if (monitor->nHsync > 0) { /* Check hsync against the allowed ranges */ float hsync = xf86ModeHSync(mode); for (i = 0; i < monitor->nHsync; i++) if ((hsync > monitor->hsync[i].lo * (1.0 - SYNC_TOLERANCE)) && (hsync < monitor->hsync[i].hi * (1.0 + SYNC_TOLERANCE))) break; /* Now see whether we ran out of sync ranges without finding a match */ if (i == monitor->nHsync) return MODE_HSYNC; } if (monitor->nVrefresh > 0) { /* Check vrefresh against the allowed ranges */ float vrefrsh = xf86ModeVRefresh(mode); for (i = 0; i < monitor->nVrefresh; i++) if ((vrefrsh > monitor->vrefresh[i].lo * (1.0 - SYNC_TOLERANCE)) && (vrefrsh < monitor->vrefresh[i].hi * (1.0 + SYNC_TOLERANCE))) break; /* Now see whether we ran out of refresh ranges without finding a match */ if (i == monitor->nVrefresh) return MODE_VSYNC; } /* Force interlaced modes to have an odd VTotal */ if (mode->Flags & V_INTERLACE) mode->CrtcVTotal = mode->VTotal |= 1; /* * This code stops cvt -r modes, and only cvt -r modes, from hitting 15y+ * old CRTs which might, when there is a lot of solar flare activity and * when the celestial bodies are unfavourably aligned, implode trying to * sync to it. It's called "Protecting the user from doing anything stupid". * -- libv */ if (xf86ModeIsReduced(mode)) { if (!monitor->reducedblanking && !(mode->type & M_T_DRIVER)) return MODE_NO_REDUCED; } if ((monitor->maxPixClock) && (mode->Clock > monitor->maxPixClock)) return MODE_CLOCK_HIGH; return MODE_OK; } /* * xf86CheckModeSize * * An internal routine to check if a mode fits in video memory. This tries to * avoid overflows that would otherwise occur when video memory size is greater * than 256MB. */ static Bool xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y) { int bpp = scrp->fbFormat.bitsPerPixel, pad = scrp->fbFormat.scanlinePad; int lineWidth, lastWidth; if (scrp->depth == 4) pad *= 4; /* 4 planes */ /* Sanity check */ if ((w < 0) || (x < 0) || (y <= 0)) return FALSE; lineWidth = (((w * bpp) + pad - 1) / pad) * pad; lastWidth = x * bpp; /* * At this point, we need to compare * * (lineWidth * (y - 1)) + lastWidth * * against * * scrp->videoRam * (1024 * 8) * * These are bit quantities. To avoid overflows, do the comparison in * terms of BITMAP_SCANLINE_PAD units. This assumes BITMAP_SCANLINE_PAD * is a power of 2. We currently use 32, which limits us to a video * memory size of 8GB. */ lineWidth = (lineWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD; lastWidth = (lastWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD; if ((lineWidth * (y - 1) + lastWidth) > (scrp->videoRam * ((1024 * 8) / BITMAP_SCANLINE_PAD))) return FALSE; return TRUE; } /* * xf86InitialCheckModeForDriver * * This function checks if a mode satisfies a driver's initial requirements: * - mode size fits within the available pixel area (memory) * - width lies within the range of supported line pitches * - mode size fits within virtual size (if fixed) * - horizontal timings are in range * * This function takes the following parameters: * scrp ScrnInfoPtr * mode mode to check * maxPitch (optional) maximum line pitch * virtualX (optional) virtual width requested * virtualY (optional) virtual height requested * * In addition, the following fields from the ScrnInfoRec are used: * monitor pointer to structure for monitor section * fbFormat pixel format for the framebuffer * videoRam video memory size (in kB) * maxHValue maximum horizontal timing value * maxVValue maximum vertical timing value */ ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, ClockRangePtr clockRanges, LookupModeFlags strategy, int maxPitch, int virtualX, int virtualY) { ClockRangePtr cp; ModeStatus status; Bool allowDiv2 = (strategy & LOOKUP_CLKDIV2) != 0; int i, needDiv2; /* Sanity checks */ if (!scrp || !mode || !clockRanges) { ErrorF("xf86InitialCheckModeForDriver: " "called with invalid parameters\n"); return MODE_ERROR; } DebugF("xf86InitialCheckModeForDriver(%p, %p %s, %p, 0x%x, %d, %d, %d)\n", scrp, mode, mode->name, clockRanges, strategy, maxPitch, virtualX, virtualY); /* Some basic mode validity checks */ if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart || mode->HSyncStart >= mode->HSyncEnd || mode->HSyncEnd >= mode->HTotal) return MODE_H_ILLEGAL; if (0 >= mode->VDisplay || mode->VDisplay > mode->VSyncStart || mode->VSyncStart >= mode->VSyncEnd || mode->VSyncEnd >= mode->VTotal) return MODE_V_ILLEGAL; if (!xf86CheckModeSize(scrp, mode->HDisplay, mode->HDisplay, mode->VDisplay)) return MODE_MEM; if (maxPitch > 0 && mode->HDisplay > maxPitch) return MODE_BAD_WIDTH; if (virtualX > 0 && mode->HDisplay > virtualX) return MODE_VIRTUAL_X; if (virtualY > 0 && mode->VDisplay > virtualY) return MODE_VIRTUAL_Y; if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue) return MODE_BAD_HVALUE; if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue) return MODE_BAD_VVALUE; /* * The use of the DisplayModeRec's Crtc* and SynthClock elements below is * provisional, in that they are later reused by the driver at mode-set * time. Here, they are temporarily enlisted to contain the mode timings * as seen by the CRT or panel (rather than the CRTC). The driver's * ValidMode() is allowed to modify these so it can deal with such things * as mode stretching and/or centering. The driver should >NOT< modify the * user-supplied values as these are reported back when mode validation is * said and done. */ /* * NOTE: We (ab)use the mode->Crtc* values here to store timing * information for the calculation of Hsync and Vrefresh. Before * these values are calculated the driver is given the opportunity * to either set these HSync and VRefresh itself or modify the timing * values. * The difference to the final calculation is small but imortand: * here we pass the flag INTERLACE_HALVE_V regardless if the driver * sets it or not. This way our calculation of VRefresh has the same * effect as if we do if (flags & V_INTERLACE) refresh *= 2.0 * This dual use of the mode->Crtc* values will certainly create * confusion and is bad software design. However since it's part of * the driver API it's hard to change. */ if (scrp->ValidMode) { xf86SetModeCrtc(mode, INTERLACE_HALVE_V); cp = xf86FindClockRangeForMode(clockRanges, mode); if (!cp) return MODE_CLOCK_RANGE; if (cp->ClockMulFactor < 1) cp->ClockMulFactor = 1; if (cp->ClockDivFactor < 1) cp->ClockDivFactor = 1; /* * XXX The effect of clock dividers and multipliers on the monitor's * pixel clock needs to be verified. */ if (scrp->progClock) { mode->SynthClock = mode->Clock; } else { i = xf86GetNearestClock(scrp, mode->Clock, allowDiv2, cp->ClockDivFactor, cp->ClockMulFactor, &needDiv2); mode->SynthClock = (scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor; if (needDiv2 & V_CLKDIV2) mode->SynthClock /= 2; } status = (*scrp->ValidMode) (scrp, mode, FALSE, MODECHECK_INITIAL); if (status != MODE_OK) return status; if (mode->HSync <= 0.0) mode->HSync = (float) mode->SynthClock / (float) mode->CrtcHTotal; if (mode->VRefresh <= 0.0) mode->VRefresh = (mode->SynthClock * 1000.0) / (mode->CrtcHTotal * mode->CrtcVTotal); } mode->HSync = xf86ModeHSync(mode); mode->VRefresh = xf86ModeVRefresh(mode); /* Assume it is OK */ return MODE_OK; } /* * xf86CheckModeForDriver * * This function is for checking modes while the server is running (for * use mainly by the VidMode extension). * * This function checks if a mode satisfies a driver's requirements: * - width lies within the line pitch * - mode size fits within virtual size * - horizontal/vertical timings are in range * * This function takes the following parameters: * scrp ScrnInfoPtr * mode mode to check * flags not (currently) used * * In addition, the following fields from the ScrnInfoRec are used: * maxHValue maximum horizontal timing value * maxVValue maximum vertical timing value * virtualX virtual width * virtualY virtual height * clockRanges allowable clock ranges */ ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags) { ClockRangePtr cp; int i, k, gap, minimumGap = CLOCK_TOLERANCE + 1; int extraFlags = 0; int clockIndex = -1; int MulFactor = 1; int DivFactor = 1; int ModePrivFlags = 0; ModeStatus status = MODE_NOMODE; /* Some sanity checking */ if (scrp == NULL || (!scrp->progClock && scrp->numClocks == 0)) { ErrorF("xf86CheckModeForDriver: called with invalid scrnInfoRec\n"); return MODE_ERROR; } if (mode == NULL) { ErrorF("xf86CheckModeForDriver: called with invalid modep\n"); return MODE_ERROR; } /* Check the mode size */ if (mode->HDisplay > scrp->virtualX) return MODE_VIRTUAL_X; if (mode->VDisplay > scrp->virtualY) return MODE_VIRTUAL_Y; if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue) return MODE_BAD_HVALUE; if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue) return MODE_BAD_VVALUE; for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) { /* DivFactor and MulFactor must be > 0 */ cp->ClockDivFactor = max(1, cp->ClockDivFactor); cp->ClockMulFactor = max(1, cp->ClockMulFactor); } if (scrp->progClock) { /* Check clock is in range */ for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) { if (modeInClockRange(cp, mode)) break; } if (cp == NULL) { return MODE_CLOCK_RANGE; } /* * If programmable clock the required mode has been found */ DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; ModePrivFlags = cp->PrivFlags; } else { status = MODE_CLOCK_RANGE; /* Check clock is in range */ for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) { if (modeInClockRange(cp, mode)) { /* * Clock is in range, so if it is not a programmable clock, * find a matching clock. */ i = xf86GetNearestClock(scrp, mode->Clock, 0, cp->ClockDivFactor, cp->ClockMulFactor, &k); /* * If the clock is too far from the requested clock, this * mode is no good. */ if (k & V_CLKDIV2) gap = abs((mode->Clock * 2) - ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor)); else gap = abs(mode->Clock - ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor)); if (gap > minimumGap) { status = MODE_NOCLOCK; continue; } DivFactor = cp->ClockDivFactor; MulFactor = cp->ClockMulFactor; ModePrivFlags = cp->PrivFlags; extraFlags = k; clockIndex = i; break; } } if (cp == NULL) return status; } /* Fill in the mode parameters */ if (scrp->progClock) { mode->ClockIndex = -1; mode->SynthClock = (mode->Clock * MulFactor) / DivFactor; } else { mode->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor; mode->ClockIndex = clockIndex; mode->SynthClock = scrp->clock[clockIndex]; if (extraFlags & V_CLKDIV2) { mode->Clock /= 2; mode->SynthClock /= 2; } } mode->PrivFlags = ModePrivFlags; return MODE_OK; } static int inferVirtualSize(ScrnInfoPtr scrp, DisplayModePtr modes, int *vx, int *vy) { float aspect = 0.0; MonPtr mon = scrp->monitor; xf86MonPtr DDC; int x = 0, y = 0; DisplayModePtr mode; if (!mon) return 0; DDC = mon->DDC; if (DDC && DDC->ver.revision >= 4) { /* For 1.4, we might actually get native pixel format. How novel. */ if (PREFERRED_TIMING_MODE(DDC->features.msc)) { for (mode = modes; mode; mode = mode->next) { if (mode->type & (M_T_DRIVER | M_T_PREFERRED)) { x = mode->HDisplay; y = mode->VDisplay; goto found; } } } /* * Even if we don't, we might get aspect ratio from extra CVT info * or from the monitor size fields. TODO. */ } /* * Technically this triggers if either is zero. That wasn't legal * before EDID 1.4, but right now we'll get that wrong. TODO. */ if (!aspect) { if (!mon->widthmm || !mon->heightmm) aspect = 4.0 / 3.0; else aspect = (float) mon->widthmm / (float) mon->heightmm; } /* find the largest M_T_DRIVER mode with that aspect ratio */ for (mode = modes; mode; mode = mode->next) { float mode_aspect, metaspect; if (!(mode->type & (M_T_DRIVER | M_T_USERDEF))) continue; mode_aspect = (float) mode->HDisplay / (float) mode->VDisplay; metaspect = aspect / mode_aspect; /* 5% slop or so, since we only get size in centimeters */ if (fabs(1.0 - metaspect) < 0.05) { if ((mode->HDisplay > x) && (mode->VDisplay > y)) { x = mode->HDisplay; y = mode->VDisplay; } } } if (!x || !y) { xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Unable to estimate virtual size\n"); return 0; } found: *vx = x; *vy = y; xf86DrvMsg(scrp->scrnIndex, X_INFO, "Estimated virtual size for aspect ratio %.4f is %dx%d\n", aspect, *vx, *vy); return 1; } /* Least common multiple */ static unsigned int LCM(unsigned int x, unsigned int y) { unsigned int m = x, n = y, o; while ((o = m % n)) { m = n; n = o; } return (x / n) * y; } /* * Given various screen attributes, determine the minimum scanline width such * that each scanline is server and DDX padded and any pixels with imbedded * bank boundaries are off-screen. This function returns -1 if such a width * cannot exist. */ static int scanLineWidth(unsigned int xsize, /* pixels */ unsigned int ysize, /* pixels */ unsigned int width, /* pixels */ unsigned long BankSize, /* char's */ PixmapFormatRec * pBankFormat, unsigned int nWidthUnit /* bits */ ) { unsigned long nBitsPerBank, nBitsPerScanline, nBitsPerScanlinePadUnit; unsigned long minBitsPerScanline, maxBitsPerScanline; /* Sanity checks */ if (!nWidthUnit || !pBankFormat) return -1; nBitsPerBank = BankSize * 8; if (nBitsPerBank % pBankFormat->scanlinePad) return -1; if (xsize > width) width = xsize; nBitsPerScanlinePadUnit = LCM(pBankFormat->scanlinePad, nWidthUnit); nBitsPerScanline = (((width * pBankFormat->bitsPerPixel) + nBitsPerScanlinePadUnit - 1) / nBitsPerScanlinePadUnit) * nBitsPerScanlinePadUnit; width = nBitsPerScanline / pBankFormat->bitsPerPixel; if (!xsize || !(nBitsPerBank % pBankFormat->bitsPerPixel)) return (int) width; /* * Scanlines will be server-pad aligned at this point. They will also be * a multiple of nWidthUnit bits long. Ensure that pixels with imbedded * bank boundaries are off-screen. * * It seems reasonable to limit total frame buffer size to 1/16 of the * theoretical maximum address space size. On a machine with 32-bit * addresses (to 8-bit quantities) this turns out to be 256MB. Not only * does this provide a simple limiting condition for the loops below, but * it also prevents unsigned long wraparounds. */ if (!ysize) return -1; minBitsPerScanline = xsize * pBankFormat->bitsPerPixel; if (minBitsPerScanline > nBitsPerBank) return -1; if (ysize == 1) return (int) width; maxBitsPerScanline = (((unsigned long) (-1) >> 1) - minBitsPerScanline) / (ysize - 1); while (nBitsPerScanline <= maxBitsPerScanline) { unsigned long BankBase, BankUnit; BankUnit = ((nBitsPerBank + nBitsPerScanline - 1) / nBitsPerBank) * nBitsPerBank; if (!(BankUnit % nBitsPerScanline)) return (int) width; for (BankBase = BankUnit;; BankBase += nBitsPerBank) { unsigned long x, y; y = BankBase / nBitsPerScanline; if (y >= ysize) return (int) width; x = BankBase % nBitsPerScanline; if (!(x % pBankFormat->bitsPerPixel)) continue; if (x < minBitsPerScanline) { /* * Skip ahead certain widths by dividing the excess scanline * amongst the y's. */ y *= nBitsPerScanlinePadUnit; nBitsPerScanline += ((x + y - 1) / y) * nBitsPerScanlinePadUnit; width = nBitsPerScanline / pBankFormat->bitsPerPixel; break; } if (BankBase != BankUnit) continue; if (!(nBitsPerScanline % x)) return (int) width; BankBase = ((nBitsPerScanline - minBitsPerScanline) / (nBitsPerScanline - x)) * BankUnit; } } return -1; } /* * xf86ValidateModes * * This function takes a set of mode names, modes and limiting conditions, * and selects a set of modes and parameters based on those conditions. * * This function takes the following parameters: * scrp ScrnInfoPtr * availModes the list of modes available for the monitor * modeNames (optional) list of mode names that the screen is requesting * clockRanges a list of clock ranges * linePitches (optional) a list of line pitches * minPitch (optional) minimum line pitch (in pixels) * maxPitch (optional) maximum line pitch (in pixels) * pitchInc (mandatory) pitch increment (in bits) * minHeight (optional) minimum virtual height (in pixels) * maxHeight (optional) maximum virtual height (in pixels) * virtualX (optional) virtual width requested (in pixels) * virtualY (optional) virtual height requested (in pixels) * apertureSize size of video aperture (in bytes) * strategy how to decide which mode to use from multiple modes with * the same name * * In addition, the following fields from the ScrnInfoRec are used: * clocks a list of discrete clocks * numClocks number of discrete clocks * progClock clock is programmable * monitor pointer to structure for monitor section * fbFormat format of the framebuffer * videoRam video memory size * maxHValue maximum horizontal timing value * maxVValue maximum vertical timing value * xInc horizontal timing increment (defaults to 8 pixels) * * The function fills in the following ScrnInfoRec fields: * modePool A subset of the modes available to the monitor which * are compatible with the driver. * modes one mode entry for each of the requested modes, with the * status field filled in to indicate if the mode has been * accepted or not. * virtualX the resulting virtual width * virtualY the resulting virtual height * displayWidth the resulting line pitch * * The function's return value is the number of matching modes found, or -1 * if an unrecoverable error was encountered. */ int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int pitchInc, int minHeight, int maxHeight, int virtualX, int virtualY, int apertureSize, LookupModeFlags strategy) { DisplayModePtr p, q, r, new, last, *endp; int i, numModes = 0; ModeStatus status; int linePitch = -1, virtX = 0, virtY = 0; int newLinePitch, newVirtX, newVirtY; int modeSize; /* in pixels */ Bool validateAllDefaultModes = FALSE; Bool userModes = FALSE; int saveType; PixmapFormatRec *BankFormat; ClockRangePtr cp; int numTimings = 0; range hsync[MAX_HSYNC]; range vrefresh[MAX_VREFRESH]; Bool inferred_virtual = FALSE; DebugF ("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n", scrp, availModes, modeNames, clockRanges, linePitches, minPitch, maxPitch, pitchInc, minHeight, maxHeight, virtualX, virtualY, apertureSize, strategy); /* Some sanity checking */ if (scrp == NULL || scrp->name == NULL || !scrp->monitor || (!scrp->progClock && scrp->numClocks == 0)) { ErrorF("xf86ValidateModes: called with invalid scrnInfoRec\n"); return -1; } if (linePitches != NULL && linePitches[0] <= 0) { ErrorF("xf86ValidateModes: called with invalid linePitches\n"); return -1; } if (pitchInc <= 0) { ErrorF("xf86ValidateModes: called with invalid pitchInc\n"); return -1; } if ((virtualX > 0) != (virtualY > 0)) { ErrorF("xf86ValidateModes: called with invalid virtual resolution\n"); return -1; } /* * If requested by the driver, allow missing hsync and/or vrefresh ranges * in the monitor section. */ if (strategy & LOOKUP_OPTIONAL_TOLERANCES) { strategy &= ~LOOKUP_OPTIONAL_TOLERANCES; } else { const char *type = ""; Bool specified = FALSE; if (scrp->monitor->nHsync <= 0) { if (numTimings > 0) { scrp->monitor->nHsync = numTimings; for (i = 0; i < numTimings; i++) { scrp->monitor->hsync[i].lo = hsync[i].lo; scrp->monitor->hsync[i].hi = hsync[i].hi; } } else { scrp->monitor->hsync[0].lo = 31.5; scrp->monitor->hsync[0].hi = 48.0; scrp->monitor->nHsync = 1; } type = "default "; } else { specified = TRUE; } for (i = 0; i < scrp->monitor->nHsync; i++) { if (scrp->monitor->hsync[i].lo == scrp->monitor->hsync[i].hi) xf86DrvMsg(scrp->scrnIndex, X_INFO, "%s: Using %shsync value of %.2f kHz\n", scrp->monitor->id, type, scrp->monitor->hsync[i].lo); else xf86DrvMsg(scrp->scrnIndex, X_INFO, "%s: Using %shsync range of %.2f-%.2f kHz\n", scrp->monitor->id, type, scrp->monitor->hsync[i].lo, scrp->monitor->hsync[i].hi); } type = ""; if (scrp->monitor->nVrefresh <= 0) { if (numTimings > 0) { scrp->monitor->nVrefresh = numTimings; for (i = 0; i < numTimings; i++) { scrp->monitor->vrefresh[i].lo = vrefresh[i].lo; scrp->monitor->vrefresh[i].hi = vrefresh[i].hi; } } else { scrp->monitor->vrefresh[0].lo = 50; scrp->monitor->vrefresh[0].hi = 70; scrp->monitor->nVrefresh = 1; } type = "default "; } else { specified = TRUE; } for (i = 0; i < scrp->monitor->nVrefresh; i++) { if (scrp->monitor->vrefresh[i].lo == scrp->monitor->vrefresh[i].hi) xf86DrvMsg(scrp->scrnIndex, X_INFO, "%s: Using %svrefresh value of %.2f Hz\n", scrp->monitor->id, type, scrp->monitor->vrefresh[i].lo); else xf86DrvMsg(scrp->scrnIndex, X_INFO, "%s: Using %svrefresh range of %.2f-%.2f Hz\n", scrp->monitor->id, type, scrp->monitor->vrefresh[i].lo, scrp->monitor->vrefresh[i].hi); } type = ""; if (!scrp->monitor->maxPixClock && !specified) { type = "default "; scrp->monitor->maxPixClock = 65000.0; } if (scrp->monitor->maxPixClock) { xf86DrvMsg(scrp->scrnIndex, X_INFO, "%s: Using %smaximum pixel clock of %.2f MHz\n", scrp->monitor->id, type, (float) scrp->monitor->maxPixClock / 1000.0); } } /* * Store the clockRanges for later use by the VidMode extension. */ nt_list_for_each_entry(cp, clockRanges, next) { ClockRangePtr newCR = xnfalloc(sizeof(ClockRange)); memcpy(newCR, cp, sizeof(ClockRange)); newCR->next = NULL; if (scrp->clockRanges == NULL) scrp->clockRanges = newCR; else nt_list_append(newCR, scrp->clockRanges, ClockRange, next); } /* Determine which pixmap format to pass to scanLineWidth() */ if (scrp->depth > 4) BankFormat = &scrp->fbFormat; else BankFormat = xf86GetPixFormat(scrp, 1); /* >not< scrp->depth! */ if (scrp->xInc <= 0) scrp->xInc = 8; /* Suitable for VGA and others */ #define _VIRTUALX(x) ((((x) + scrp->xInc - 1) / scrp->xInc) * scrp->xInc) /* * Determine maxPitch if it wasn't given explicitly. Note linePitches * always takes precedence if is non-NULL. In that case the minPitch and * maxPitch values passed are ignored. */ if (linePitches) { minPitch = maxPitch = linePitches[0]; for (i = 1; linePitches[i] > 0; i++) { if (linePitches[i] > maxPitch) maxPitch = linePitches[i]; if (linePitches[i] < minPitch) minPitch = linePitches[i]; } } /* Initial check of virtual size against other constraints */ scrp->virtualFrom = X_PROBED; /* * Initialise virtX and virtY if the values are fixed. */ if (virtualY > 0) { if (maxHeight > 0 && virtualY > maxHeight) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Virtual height (%d) is too large for the hardware " "(max %d)\n", virtualY, maxHeight); return -1; } if (minHeight > 0 && virtualY < minHeight) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Virtual height (%d) is too small for the hardware " "(min %d)\n", virtualY, minHeight); return -1; } virtualX = _VIRTUALX(virtualX); if (linePitches != NULL) { for (i = 0; linePitches[i] != 0; i++) { if ((linePitches[i] >= virtualX) && (linePitches[i] == scanLineWidth(virtualX, virtualY, linePitches[i], apertureSize, BankFormat, pitchInc))) { linePitch = linePitches[i]; break; } } } else { linePitch = scanLineWidth(virtualX, virtualY, minPitch, apertureSize, BankFormat, pitchInc); } if ((linePitch < minPitch) || (linePitch > maxPitch)) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Virtual width (%d) is too large for the hardware " "(max %d)\n", virtualX, maxPitch); return -1; } if (!xf86CheckModeSize(scrp, linePitch, virtualX, virtualY)) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Virtual size (%dx%d) (pitch %d) exceeds video memory\n", virtualX, virtualY, linePitch); return -1; } virtX = virtualX; virtY = virtualY; scrp->virtualFrom = X_CONFIG; } else if (!modeNames || !*modeNames) { /* No virtual size given in the config, try to infer */ /* XXX this doesn't take m{in,ax}Pitch into account; oh well */ inferred_virtual = inferVirtualSize(scrp, availModes, &virtX, &virtY); if (inferred_virtual) linePitch = scanLineWidth(virtX, virtY, minPitch, apertureSize, BankFormat, pitchInc); } /* Print clock ranges and scaled clocks */ xf86ShowClockRanges(scrp, clockRanges); /* * If scrp->modePool hasn't been setup yet, set it up now. This allows the * modes that the driver definitely can't use to be weeded out early. Note * that a modePool mode's prev field is used to hold a pointer to the * member of the scrp->modes list for which a match was considered. */ if (scrp->modePool == NULL) { q = NULL; for (p = availModes; p != NULL; p = p->next) { status = xf86InitialCheckModeForDriver(scrp, p, clockRanges, strategy, maxPitch, virtX, virtY); if (status == MODE_OK) { status = xf86CheckModeForMonitor(p, scrp->monitor); } if (status == MODE_OK) { new = xnfalloc(sizeof(DisplayModeRec)); *new = *p; new->next = NULL; if (!q) { scrp->modePool = new; } else { q->next = new; } new->prev = NULL; q = new; q->name = xnfstrdup(p->name); q->status = MODE_OK; } else { printModeRejectMessage(scrp->scrnIndex, p, status); } } if (scrp->modePool == NULL) { xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Mode pool is empty\n"); return 0; } } else { for (p = scrp->modePool; p != NULL; p = p->next) { p->prev = NULL; p->status = MODE_OK; } } /* * Allocate one entry in scrp->modes for each named mode. */ while (scrp->modes) xf86DeleteMode(&scrp->modes, scrp->modes); endp = &scrp->modes; last = NULL; if (modeNames != NULL) { for (i = 0; modeNames[i] != NULL; i++) { userModes = TRUE; new = xnfcalloc(1, sizeof(DisplayModeRec)); new->prev = last; new->type = M_T_USERDEF; new->name = xnfstrdup(modeNames[i]); if (new->prev) new->prev->next = new; *endp = last = new; endp = &new->next; } } /* Lookup each mode */ #ifdef RANDR if (!xf86Info.disableRandR #ifdef PANORAMIX && noPanoramiXExtension #endif ) validateAllDefaultModes = TRUE; #endif for (p = scrp->modes;; p = p->next) { Bool repeat; /* * If the supplied mode names don't produce a valid mode, scan through * unconsidered modePool members until one survives validation. This * is done in decreasing order by mode pixel area. */ if (p == NULL) { if ((numModes > 0) && !validateAllDefaultModes) break; validateAllDefaultModes = TRUE; r = NULL; modeSize = 0; for (q = scrp->modePool; q != NULL; q = q->next) { if ((q->prev == NULL) && (q->status == MODE_OK)) { /* * Deal with the case where this mode wasn't considered * because of a builtin mode of the same name. */ for (p = scrp->modes; p != NULL; p = p->next) { if ((p->status != MODE_OK) && !strcmp(p->name, q->name)) break; } if (p != NULL) q->prev = p; else { /* * A quick check to not allow default modes with * horizontal timing parameters that CRTs may have * problems with. */ if (!scrp->monitor->reducedblanking && (q->type & M_T_DEFAULT) && ((double) q->HTotal / (double) q->HDisplay) < 1.15) continue; if (modeSize < (q->HDisplay * q->VDisplay)) { r = q; modeSize = q->HDisplay * q->VDisplay; } } } } if (r == NULL) break; p = xnfcalloc(1, sizeof(DisplayModeRec)); p->prev = last; p->name = xnfstrdup(r->name); if (!userModes) p->type = M_T_USERDEF; if (p->prev) p->prev->next = p; *endp = last = p; endp = &p->next; } repeat = FALSE; lookupNext: if (repeat && ((status = p->status) != MODE_OK)) printModeRejectMessage(scrp->scrnIndex, p, status); saveType = p->type; status = xf86LookupMode(scrp, p, clockRanges, strategy); if (repeat && status == MODE_NOMODE) continue; if (status != MODE_OK) printModeRejectMessage(scrp->scrnIndex, p, status); if (status == MODE_ERROR) { ErrorF("xf86ValidateModes: " "unexpected result from xf86LookupMode()\n"); return -1; } if (status != MODE_OK) { if (p->status == MODE_OK) p->status = status; continue; } p->type |= saveType; repeat = TRUE; newLinePitch = linePitch; newVirtX = virtX; newVirtY = virtY; /* * Don't let non-user defined modes increase the virtual size */ if (!(p->type & M_T_USERDEF) && (numModes > 0)) { if (p->HDisplay > virtX) { p->status = MODE_VIRTUAL_X; goto lookupNext; } if (p->VDisplay > virtY) { p->status = MODE_VIRTUAL_Y; goto lookupNext; } } /* * Adjust virtual width and height if the mode is too large for the * current values and if they are not fixed. */ if (virtualX <= 0 && p->HDisplay > newVirtX) newVirtX = _VIRTUALX(p->HDisplay); if (virtualY <= 0 && p->VDisplay > newVirtY) { if (maxHeight > 0 && p->VDisplay > maxHeight) { p->status = MODE_VIRTUAL_Y; /* ? */ goto lookupNext; } newVirtY = p->VDisplay; } /* * If virtual resolution is to be increased, revalidate it. */ if ((virtX != newVirtX) || (virtY != newVirtY)) { if (linePitches != NULL) { newLinePitch = -1; for (i = 0; linePitches[i] != 0; i++) { if ((linePitches[i] >= newVirtX) && (linePitches[i] >= linePitch) && (linePitches[i] == scanLineWidth(newVirtX, newVirtY, linePitches[i], apertureSize, BankFormat, pitchInc))) { newLinePitch = linePitches[i]; break; } } } else { if (linePitch < minPitch) linePitch = minPitch; newLinePitch = scanLineWidth(newVirtX, newVirtY, linePitch, apertureSize, BankFormat, pitchInc); } if ((newLinePitch < minPitch) || (newLinePitch > maxPitch)) { p->status = MODE_BAD_WIDTH; goto lookupNext; } /* * Check that the pixel area required by the new virtual height * and line pitch isn't too large. */ if (!xf86CheckModeSize(scrp, newLinePitch, newVirtX, newVirtY)) { p->status = MODE_MEM_VIRT; goto lookupNext; } } if (scrp->ValidMode) { /* * Give the driver a final say, passing it the proposed virtual * geometry. */ scrp->virtualX = newVirtX; scrp->virtualY = newVirtY; scrp->displayWidth = newLinePitch; p->status = (scrp->ValidMode) (scrp, p, FALSE, MODECHECK_FINAL); if (p->status != MODE_OK) { goto lookupNext; } } /* Mode has passed all the tests */ virtX = newVirtX; virtY = newVirtY; linePitch = newLinePitch; p->status = MODE_OK; numModes++; } /* * If we estimated the virtual size above, we may have filtered away all * the modes that maximally match that size; scan again to find out and * fix up if so. */ if (inferred_virtual) { int vx = 0, vy = 0; for (p = scrp->modes; p; p = p->next) { if (p->HDisplay > vx && p->VDisplay > vy) { vx = p->HDisplay; vy = p->VDisplay; } } if (vx < virtX || vy < virtY) { const int types[] = { M_T_BUILTIN | M_T_PREFERRED, M_T_BUILTIN, M_T_DRIVER | M_T_PREFERRED, M_T_DRIVER, 0 }; const int ntypes = sizeof(types) / sizeof(int); int n; /* * We did not find the estimated virtual size. So now we want to * find the largest mode available, but we want to search in the * modes in the order of "types" listed above. */ for (n = 0; n < ntypes; n++) { int type = types[n]; vx = 0; vy = 0; for (p = scrp->modes; p; p = p->next) { /* scan through the modes in the sort order above */ if ((p->type & type) != type) continue; if (p->HDisplay > vx && p->VDisplay > vy) { vx = p->HDisplay; vy = p->VDisplay; } } if (vx && vy) /* Found one */ break; } xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Shrinking virtual size estimate from %dx%d to %dx%d\n", virtX, virtY, vx, vy); virtX = _VIRTUALX(vx); virtY = vy; for (p = scrp->modes; p; p = p->next) { if (numModes > 0) { if (p->HDisplay > virtX) p->status = MODE_VIRTUAL_X; if (p->VDisplay > virtY) p->status = MODE_VIRTUAL_Y; if (p->status != MODE_OK) { numModes--; printModeRejectMessage(scrp->scrnIndex, p, p->status); } } } if (linePitches != NULL) { for (i = 0; linePitches[i] != 0; i++) { if ((linePitches[i] >= virtX) && (linePitches[i] == scanLineWidth(virtX, virtY, linePitches[i], apertureSize, BankFormat, pitchInc))) { linePitch = linePitches[i]; break; } } } else { linePitch = scanLineWidth(virtX, virtY, minPitch, apertureSize, BankFormat, pitchInc); } } } /* Update the ScrnInfoRec parameters */ scrp->virtualX = virtX; scrp->virtualY = virtY; scrp->displayWidth = linePitch; if (numModes <= 0) return 0; /* Make the mode list into a circular list by joining up the ends */ p = scrp->modes; while (p->next != NULL) p = p->next; /* p is now the last mode on the list */ p->next = scrp->modes; scrp->modes->prev = p; if (minHeight > 0 && virtY < minHeight) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Virtual height (%d) is too small for the hardware " "(min %d)\n", virtY, minHeight); return -1; } return numModes; } /* * xf86DeleteMode * * This function removes a mode from a list of modes. * * There are different types of mode lists: * * - singly linked linear lists, ending in NULL * - doubly linked linear lists, starting and ending in NULL * - doubly linked circular lists * */ void xf86DeleteMode(DisplayModePtr * modeList, DisplayModePtr mode) { /* Catch the easy/insane cases */ if (modeList == NULL || *modeList == NULL || mode == NULL) return; /* If the mode is at the start of the list, move the start of the list */ if (*modeList == mode) *modeList = mode->next; /* If mode is the only one on the list, set the list to NULL */ if ((mode == mode->prev) && (mode == mode->next)) { *modeList = NULL; } else { if ((mode->prev != NULL) && (mode->prev->next == mode)) mode->prev->next = mode->next; if ((mode->next != NULL) && (mode->next->prev == mode)) mode->next->prev = mode->prev; } free((void *) mode->name); free(mode); } /* * xf86PruneDriverModes * * Remove modes from the driver's mode list which have been marked as * invalid. */ void xf86PruneDriverModes(ScrnInfoPtr scrp) { DisplayModePtr first, p, n; p = scrp->modes; if (p == NULL) return; do { if (!(first = scrp->modes)) return; n = p->next; if (p->status != MODE_OK) { xf86DeleteMode(&(scrp->modes), p); } p = n; } while (p != NULL && p != first); /* modePool is no longer needed, turf it */ while (scrp->modePool) { /* * A modePool mode's prev field is used to hold a pointer to the * member of the scrp->modes list for which a match was considered. * Clear that pointer first, otherwise xf86DeleteMode might get * confused */ scrp->modePool->prev = NULL; xf86DeleteMode(&scrp->modePool, scrp->modePool); } } /* * xf86SetCrtcForModes * * Goes through the screen's mode list, and initialises the Crtc * parameters for each mode. The initialisation includes adjustments * for interlaced and double scan modes. */ void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags) { DisplayModePtr p; /* * Store adjustFlags for use with the VidMode extension. There is an * implicit assumption here that SetCrtcForModes is called once. */ scrp->adjustFlags = adjustFlags; p = scrp->modes; if (p == NULL) return; do { xf86SetModeCrtc(p, adjustFlags); DebugF("%sMode %s: %d (%d) %d %d (%d) %d %d (%d) %d %d (%d) %d\n", (p->type & M_T_DEFAULT) ? "Default " : "", p->name, p->CrtcHDisplay, p->CrtcHBlankStart, p->CrtcHSyncStart, p->CrtcHSyncEnd, p->CrtcHBlankEnd, p->CrtcHTotal, p->CrtcVDisplay, p->CrtcVBlankStart, p->CrtcVSyncStart, p->CrtcVSyncEnd, p->CrtcVBlankEnd, p->CrtcVTotal); p = p->next; } while (p != NULL && p != scrp->modes); } void xf86PrintModes(ScrnInfoPtr scrp) { DisplayModePtr p; float hsync, refresh = 0; const char *desc, *desc2, *prefix, *uprefix; if (scrp == NULL) return; xf86DrvMsg(scrp->scrnIndex, scrp->virtualFrom, "Virtual size is %dx%d " "(pitch %d)\n", scrp->virtualX, scrp->virtualY, scrp->displayWidth); p = scrp->modes; if (p == NULL) return; do { desc = desc2 = ""; hsync = xf86ModeHSync(p); refresh = xf86ModeVRefresh(p); if (p->Flags & V_INTERLACE) { desc = " (I)"; } if (p->Flags & V_DBLSCAN) { desc = " (D)"; } if (p->VScan > 1) { desc2 = " (VScan)"; } if (p->type & M_T_BUILTIN) prefix = "Built-in mode"; else if (p->type & M_T_DEFAULT) prefix = "Default mode"; else if (p->type & M_T_DRIVER) prefix = "Driver mode"; else prefix = "Mode"; if (p->type & M_T_USERDEF) uprefix = "*"; else uprefix = " "; if (hsync == 0 || refresh == 0) { if (p->name) xf86DrvMsg(scrp->scrnIndex, X_CONFIG, "%s%s \"%s\"\n", uprefix, prefix, p->name); else xf86DrvMsg(scrp->scrnIndex, X_PROBED, "%s%s %dx%d (unnamed)\n", uprefix, prefix, p->HDisplay, p->VDisplay); } else if (p->Clock == p->SynthClock) { xf86DrvMsg(scrp->scrnIndex, X_CONFIG, "%s%s \"%s\": %.1f MHz, %.1f kHz, %.1f Hz%s%s\n", uprefix, prefix, p->name, p->Clock / 1000.0, hsync, refresh, desc, desc2); } else { xf86DrvMsg(scrp->scrnIndex, X_CONFIG, "%s%s \"%s\": %.1f MHz (scaled from %.1f MHz), " "%.1f kHz, %.1f Hz%s%s\n", uprefix, prefix, p->name, p->Clock / 1000.0, p->SynthClock / 1000.0, hsync, refresh, desc, desc2); } if (hsync != 0 && refresh != 0) xf86PrintModeline(scrp->scrnIndex, p); p = p->next; } while (p != NULL && p != scrp->modes); } xorg-server-1.17.1/hw/xfree86/common/xf86VGAarbiter.c0000664000175100017510000006575512366222771017106 00000000000000/* * This code was stolen from RAC and adapted to control the legacy vga * interface. * * * Copyright (c) 2007 Paulo R. Zanoni, Tiago Vignatti * * 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. * */ #include "xorg-config.h" #include "xf86VGAarbiter.h" #include "xf86VGAarbiterPriv.h" #include "xf86Bus.h" #include "xf86Priv.h" #include "pciaccess.h" static GCFuncs VGAarbiterGCFuncs = { VGAarbiterValidateGC, VGAarbiterChangeGC, VGAarbiterCopyGC, VGAarbiterDestroyGC, VGAarbiterChangeClip, VGAarbiterDestroyClip, VGAarbiterCopyClip }; static GCOps VGAarbiterGCOps = { VGAarbiterFillSpans, VGAarbiterSetSpans, VGAarbiterPutImage, VGAarbiterCopyArea, VGAarbiterCopyPlane, VGAarbiterPolyPoint, VGAarbiterPolylines, VGAarbiterPolySegment, VGAarbiterPolyRectangle, VGAarbiterPolyArc, VGAarbiterFillPolygon, VGAarbiterPolyFillRect, VGAarbiterPolyFillArc, VGAarbiterPolyText8, VGAarbiterPolyText16, VGAarbiterImageText8, VGAarbiterImageText16, VGAarbiterImageGlyphBlt, VGAarbiterPolyGlyphBlt, VGAarbiterPushPixels, }; static miPointerSpriteFuncRec VGAarbiterSpriteFuncs = { VGAarbiterSpriteRealizeCursor, VGAarbiterSpriteUnrealizeCursor, VGAarbiterSpriteSetCursor, VGAarbiterSpriteMoveCursor, VGAarbiterDeviceCursorInitialize, VGAarbiterDeviceCursorCleanup }; static DevPrivateKeyRec VGAarbiterScreenKeyRec; #define VGAarbiterScreenKey (&VGAarbiterScreenKeyRec) static DevPrivateKeyRec VGAarbiterGCKeyRec; #define VGAarbiterGCKey (&VGAarbiterGCKeyRec) static int vga_no_arb = 0; void xf86VGAarbiterInit(void) { if (pci_device_vgaarb_init() != 0) { vga_no_arb = 1; xf86Msg(X_WARNING, "VGA arbiter: cannot open kernel arbiter, no multi-card support\n"); } } void xf86VGAarbiterFini(void) { if (vga_no_arb) return; pci_device_vgaarb_fini(); } void xf86VGAarbiterLock(ScrnInfoPtr pScrn) { if (vga_no_arb) return; pci_device_vgaarb_set_target(pScrn->vgaDev); pci_device_vgaarb_lock(); } void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) { if (vga_no_arb) return; pci_device_vgaarb_unlock(); } Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { int vga_count; int rsrc_decodes; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (vga_no_arb) return TRUE; pci_device_vgaarb_get_info(pScrn->vgaDev, &vga_count, &rsrc_decodes); if (vga_count > 1) { if (rsrc_decodes) { return FALSE; } } return TRUE; } void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) { struct pci_device *dev; EntityPtr pEnt; if (vga_no_arb) return; pEnt = xf86Entities[pScrn->entityList[0]]; if (pEnt->bus.type != BUS_PCI) return; dev = pEnt->bus.id.pci; pScrn->vgaDev = dev; } void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc) { if (vga_no_arb) return; pci_device_vgaarb_set_target(pScrn->vgaDev); pci_device_vgaarb_decodes(rsrc); } Bool xf86VGAarbiterWrapFunctions(void) { ScrnInfoPtr pScrn; VGAarbiterScreenPtr pScreenPriv; miPointerScreenPtr PointPriv; PictureScreenPtr ps; ScreenPtr pScreen; int vga_count, i; if (vga_no_arb) return FALSE; /* * we need to wrap the arbiter if we have more than * one VGA card - hotplug cries. */ pci_device_vgaarb_get_info(NULL, &vga_count, NULL); if (vga_count < 2 || !xf86Screens) return FALSE; xf86Msg(X_INFO, "Found %d VGA devices: arbiter wrapping enabled\n", vga_count); for (i = 0; i < xf86NumScreens; i++) { pScreen = xf86Screens[i]->pScreen; ps = GetPictureScreenIfSet(pScreen); pScrn = xf86ScreenToScrn(pScreen); PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); if (!dixRegisterPrivateKey (&VGAarbiterGCKeyRec, PRIVATE_GC, sizeof(VGAarbiterGCRec))) return FALSE; if (!dixRegisterPrivateKey(&VGAarbiterScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!(pScreenPriv = malloc(sizeof(VGAarbiterScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, VGAarbiterScreenKey, pScreenPriv); WRAP_SCREEN(CloseScreen, VGAarbiterCloseScreen); WRAP_SCREEN(SaveScreen, VGAarbiterSaveScreen); WRAP_SCREEN(WakeupHandler, VGAarbiterWakeupHandler); WRAP_SCREEN(BlockHandler, VGAarbiterBlockHandler); WRAP_SCREEN(CreateGC, VGAarbiterCreateGC); WRAP_SCREEN(GetImage, VGAarbiterGetImage); WRAP_SCREEN(GetSpans, VGAarbiterGetSpans); WRAP_SCREEN(SourceValidate, VGAarbiterSourceValidate); WRAP_SCREEN(CopyWindow, VGAarbiterCopyWindow); WRAP_SCREEN(ClearToBackground, VGAarbiterClearToBackground); WRAP_SCREEN(CreatePixmap, VGAarbiterCreatePixmap); WRAP_SCREEN(StoreColors, VGAarbiterStoreColors); WRAP_SCREEN(DisplayCursor, VGAarbiterDisplayCursor); WRAP_SCREEN(RealizeCursor, VGAarbiterRealizeCursor); WRAP_SCREEN(UnrealizeCursor, VGAarbiterUnrealizeCursor); WRAP_SCREEN(RecolorCursor, VGAarbiterRecolorCursor); WRAP_SCREEN(SetCursorPosition, VGAarbiterSetCursorPosition); WRAP_PICT(Composite, VGAarbiterComposite); WRAP_PICT(Glyphs, VGAarbiterGlyphs); WRAP_PICT(CompositeRects, VGAarbiterCompositeRects); WRAP_SCREEN_INFO(AdjustFrame, VGAarbiterAdjustFrame); WRAP_SCREEN_INFO(SwitchMode, VGAarbiterSwitchMode); WRAP_SCREEN_INFO(EnterVT, VGAarbiterEnterVT); WRAP_SCREEN_INFO(LeaveVT, VGAarbiterLeaveVT); WRAP_SCREEN_INFO(FreeScreen, VGAarbiterFreeScreen); WRAP_SPRITE; } return TRUE; } /* Screen funcs */ static Bool VGAarbiterCloseScreen(ScreenPtr pScreen) { Bool val; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); miPointerScreenPtr PointPriv = (miPointerScreenPtr) dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); UNWRAP_SCREEN(CreateGC); UNWRAP_SCREEN(CloseScreen); UNWRAP_SCREEN(GetImage); UNWRAP_SCREEN(GetSpans); UNWRAP_SCREEN(SourceValidate); UNWRAP_SCREEN(CopyWindow); UNWRAP_SCREEN(ClearToBackground); UNWRAP_SCREEN(SaveScreen); UNWRAP_SCREEN(StoreColors); UNWRAP_SCREEN(DisplayCursor); UNWRAP_SCREEN(RealizeCursor); UNWRAP_SCREEN(UnrealizeCursor); UNWRAP_SCREEN(RecolorCursor); UNWRAP_SCREEN(SetCursorPosition); UNWRAP_PICT(Composite); UNWRAP_PICT(Glyphs); UNWRAP_PICT(CompositeRects); UNWRAP_SCREEN_INFO(AdjustFrame); UNWRAP_SCREEN_INFO(SwitchMode); UNWRAP_SCREEN_INFO(EnterVT); UNWRAP_SCREEN_INFO(LeaveVT); UNWRAP_SCREEN_INFO(FreeScreen); UNWRAP_SPRITE; free((void *) pScreenPriv); xf86VGAarbiterLock(xf86ScreenToScrn(pScreen)); val = (*pScreen->CloseScreen) (pScreen); xf86VGAarbiterUnlock(xf86ScreenToScrn(pScreen)); return val; } static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { SCREEN_PROLOG(BlockHandler); VGAGet(pScreen); pScreen->BlockHandler(pScreen, pTimeout, pReadmask); VGAPut(); SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler); } static void VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, void *pReadmask) { SCREEN_PROLOG(WakeupHandler); VGAGet(pScreen); pScreen->WakeupHandler(pScreen, result, pReadmask); VGAPut(); SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler); } static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine) { ScreenPtr pScreen = pDrawable->pScreen; SCREEN_PROLOG(GetImage); VGAGet(pScreen); (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); VGAPut(); SCREEN_EPILOG(GetImage, VGAarbiterGetImage); } static void VGAarbiterGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart) { ScreenPtr pScreen = pDrawable->pScreen; SCREEN_PROLOG(GetSpans); VGAGet(pScreen); (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); VGAPut(); SCREEN_EPILOG(GetSpans, VGAarbiterGetSpans); } static void VGAarbiterSourceValidate(DrawablePtr pDrawable, int x, int y, int width, int height, unsigned int subWindowMode) { ScreenPtr pScreen = pDrawable->pScreen; SCREEN_PROLOG(SourceValidate); VGAGet(pScreen); if (pScreen->SourceValidate) (*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode); VGAPut(); SCREEN_EPILOG(SourceValidate, VGAarbiterSourceValidate); } static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWin->drawable.pScreen; SCREEN_PROLOG(CopyWindow); VGAGet(pScreen); (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); VGAPut(); SCREEN_EPILOG(CopyWindow, VGAarbiterCopyWindow); } static void VGAarbiterClearToBackground(WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures) { ScreenPtr pScreen = pWin->drawable.pScreen; SCREEN_PROLOG(ClearToBackground); VGAGet(pScreen); (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures); VGAPut(); SCREEN_EPILOG(ClearToBackground, VGAarbiterClearToBackground); } static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { PixmapPtr pPix; SCREEN_PROLOG(CreatePixmap); VGAGet(pScreen); pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); VGAPut(); SCREEN_EPILOG(CreatePixmap, VGAarbiterCreatePixmap); return pPix; } static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank) { Bool val; SCREEN_PROLOG(SaveScreen); VGAGet(pScreen); val = (*pScreen->SaveScreen) (pScreen, unblank); VGAPut(); SCREEN_EPILOG(SaveScreen, VGAarbiterSaveScreen); return val; } static void VGAarbiterStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs) { ScreenPtr pScreen = pmap->pScreen; SCREEN_PROLOG(StoreColors); VGAGet(pScreen); (*pScreen->StoreColors) (pmap, ndef, pdefs); VGAPut(); SCREEN_EPILOG(StoreColors, VGAarbiterStoreColors); } static void VGAarbiterRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) { SCREEN_PROLOG(RecolorCursor); VGAGet(pScreen); (*pScreen->RecolorCursor) (pDev, pScreen, pCurs, displayed); VGAPut(); SCREEN_EPILOG(RecolorCursor, VGAarbiterRecolorCursor); } static Bool VGAarbiterRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { Bool val; SCREEN_PROLOG(RealizeCursor); VGAGet(pScreen); val = (*pScreen->RealizeCursor) (pDev, pScreen, pCursor); VGAPut(); SCREEN_EPILOG(RealizeCursor, VGAarbiterRealizeCursor); return val; } static Bool VGAarbiterUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { Bool val; SCREEN_PROLOG(UnrealizeCursor); VGAGet(pScreen); val = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor); VGAPut(); SCREEN_EPILOG(UnrealizeCursor, VGAarbiterUnrealizeCursor); return val; } static Bool VGAarbiterDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { Bool val; SCREEN_PROLOG(DisplayCursor); VGAGet(pScreen); val = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); VGAPut(); SCREEN_EPILOG(DisplayCursor, VGAarbiterDisplayCursor); return val; } static Bool VGAarbiterSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent) { Bool val; SCREEN_PROLOG(SetCursorPosition); VGAGet(pScreen); val = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); VGAPut(); SCREEN_EPILOG(SetCursorPosition, VGAarbiterSetCursorPosition); return val; } static void VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); (*pScreenPriv->AdjustFrame) (pScrn, x, y); VGAPut(); } static Bool VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { Bool val; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); val = (*pScreenPriv->SwitchMode) (pScrn, mode); VGAPut(); return val; } static Bool VGAarbiterEnterVT(ScrnInfoPtr pScrn) { Bool val; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); pScrn->EnterVT = pScreenPriv->EnterVT; val = (*pScrn->EnterVT) (pScrn); pScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = VGAarbiterEnterVT; VGAPut(); return val; } static void VGAarbiterLeaveVT(ScrnInfoPtr pScrn) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); pScrn->LeaveVT = pScreenPriv->LeaveVT; (*pScreenPriv->LeaveVT) (pScrn); pScreenPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = VGAarbiterLeaveVT; VGAPut(); } static void VGAarbiterFreeScreen(ScrnInfoPtr pScrn) { ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); (*pScreenPriv->FreeScreen) (pScrn); VGAPut(); } static Bool VGAarbiterCreateGC(GCPtr pGC) { ScreenPtr pScreen = pGC->pScreen; VGAarbiterGCPtr pGCPriv = (VGAarbiterGCPtr) dixLookupPrivate(&pGC->devPrivates, VGAarbiterGCKey); Bool ret; SCREEN_PROLOG(CreateGC); ret = (*pScreen->CreateGC) (pGC); GC_WRAP(pGC); SCREEN_EPILOG(CreateGC, VGAarbiterCreateGC); return ret; } /* GC funcs */ static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) { GC_UNWRAP(pGC); (*pGC->funcs->ValidateGC) (pGC, changes, pDraw); GC_WRAP(pGC); } static void VGAarbiterDestroyGC(GCPtr pGC) { GC_UNWRAP(pGC); (*pGC->funcs->DestroyGC) (pGC); GC_WRAP(pGC); } static void VGAarbiterChangeGC(GCPtr pGC, unsigned long mask) { GC_UNWRAP(pGC); (*pGC->funcs->ChangeGC) (pGC, mask); GC_WRAP(pGC); } static void VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) { GC_UNWRAP(pGCDst); (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); GC_WRAP(pGCDst); } static void VGAarbiterChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { GC_UNWRAP(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); GC_WRAP(pGC); } static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc) { GC_UNWRAP(pgcDst); (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); GC_WRAP(pgcDst); } static void VGAarbiterDestroyClip(GCPtr pGC) { GC_UNWRAP(pGC); (*pGC->funcs->DestroyClip) (pGC); GC_WRAP(pGC); } /* GC Ops */ static void VGAarbiterFillSpans(DrawablePtr pDraw, GC * pGC, int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc, register DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PutImage) (pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage); VGAPut(); GC_WRAP(pGC); } static RegionPtr VGAarbiterCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GC * pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { RegionPtr ret; ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); ret = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, width, height, dstx, dsty); VGAPut(); GC_WRAP(pGC); return ret; } static RegionPtr VGAarbiterCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bitPlane) { RegionPtr ret; ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); ret = (*pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); VGAPut(); GC_WRAP(pGC); return ret; } static void VGAarbiterPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode, int npt, xPoint * pptInit) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PolyPoint) (pDraw, pGC, mode, npt, pptInit); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPolylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->Polylines) (pDraw, pGC, mode, npt, pptInit); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSeg) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PolySegment) (pDraw, pGC, nseg, pSeg); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PolyRectangle) (pDraw, pGC, nRectsInit, pRectsInit); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PolyArc) (pDraw, pGC, narcs, parcs); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, int mode, int count, DDXPointPtr ptsIn) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPolyFillRect(DrawablePtr pDraw, GCPtr pGC, int nrectFill, xRectangle *prectInit) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PolyFillRect) (pDraw, pGC, nrectFill, prectInit); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, parcs); VGAPut(); GC_WRAP(pGC); } static int VGAarbiterPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) { int ret; ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); ret = (*pGC->ops->PolyText8) (pDraw, pGC, x, y, count, chars); VGAPut(); GC_WRAP(pGC); return ret; } static int VGAarbiterPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars) { int ret; ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); ret = (*pGC->ops->PolyText16) (pDraw, pGC, x, y, count, chars); VGAPut(); GC_WRAP(pGC); return ret; } static void VGAarbiterImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->ImageText8) (pDraw, pGC, x, y, count, chars); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->ImageText16) (pDraw, pGC, x, y, count, chars); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase); VGAPut(); GC_WRAP(pGC); } static void VGAarbiterPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg) { ScreenPtr pScreen = pGC->pScreen; GC_UNWRAP(pGC); VGAGet(pScreen); (*pGC->ops->PushPixels) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); VGAPut(); GC_WRAP(pGC); } /* miSpriteFuncs */ static Bool VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) { Bool val; SPRITE_PROLOG; VGAGet(pScreen); val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur); VGAPut(); SPRITE_EPILOG; return val; } static Bool VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) { Bool val; SPRITE_PROLOG; VGAGet(pScreen); val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur); VGAPut(); SPRITE_EPILOG; return val; } static void VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y) { SPRITE_PROLOG; VGAGet(pScreen); PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y); VGAPut(); SPRITE_EPILOG; } static void VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { SPRITE_PROLOG; VGAGet(pScreen); PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y); VGAPut(); SPRITE_EPILOG; } static Bool VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) { Bool val; SPRITE_PROLOG; VGAGet(pScreen); val = PointPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen); VGAPut(); SPRITE_EPILOG; return val; } static void VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { SPRITE_PROLOG; VGAGet(pScreen); PointPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen); VGAPut(); SPRITE_EPILOG; } static void VGAarbiterComposite(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; PictureScreenPtr ps = GetPictureScreen(pScreen); PICTURE_PROLOGUE(Composite); VGAGet(pScreen); (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); VGAPut(); PICTURE_EPILOGUE(Composite, VGAarbiterComposite); } static void VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); PICTURE_PROLOGUE(Glyphs); VGAGet(pScreen); (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); VGAPut(); PICTURE_EPILOGUE(Glyphs, VGAarbiterGlyphs); } static void VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects) { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); PICTURE_PROLOGUE(CompositeRects); VGAGet(pScreen); (*ps->CompositeRects) (op, pDst, color, nRect, rects); VGAPut(); PICTURE_EPILOGUE(CompositeRects, VGAarbiterCompositeRects); } xorg-server-1.17.1/hw/xfree86/common/xf86InPriv.h0000664000175100017510000000322012274325511016301 00000000000000 /* * Copyright (c) 1999 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _xf86InPriv_h #define _xf86InPriv_h /* xf86Globals.c */ extern InputDriverPtr *xf86InputDriverList; extern int xf86NumInputDrivers; #endif /* _xf86InPriv_h */ xorg-server-1.17.1/hw/xfree86/common/Makefile.in0000664000175100017510000010363012466505431016264 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @LNXACPI_TRUE@am__append_1 = -DHAVE_ACPI @NEED_DBUS_TRUE@am__append_2 = $(DBUS_CFLAGS) subdir = hw/xfree86/common DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/xf86Build.h.in $(top_srcdir)/depcomp \ $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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 = xf86Build.h CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcommon_la_DEPENDENCIES = $(top_builddir)/config/libconfig.la 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 xf86Extensions.h \ xf86Extensions.c xf86vmode.c xf86xv.c xf86xvmc.c xf86fbBus.c \ xf86noBus.c xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \ xf86VGAarbiterPriv.h xf86sbusBus.c xf86platformBus.c \ xf86RandR.c @DGA_TRUE@am__objects_1 = xf86DGA.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 \ 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) 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 = $(libcommon_la_SOURCES) $(nodist_libcommon_la_SOURCES) DIST_SOURCES = $(am__libcommon_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 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 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/||"`;; \ *) 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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@ $(am__append_1) $(am__append_2) XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libcommon.la @XORG_BUS_PCI_TRUE@PCI_SOURCES = xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \ @XORG_BUS_PCI_TRUE@ xf86VGAarbiterPriv.h @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) $(PLATSOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes BUILT_SOURCES = xf86DefModeSet.c AM_LDFLAGS = -r libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Cursor.c $(DGASOURCES) 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 xf86Extensions.h \ xf86Extensions.c $(XF86VMODESOURCES) \ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la AM_CPPFLAGS = $(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)/../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) $(DGA_SDK) xorgVersion.h \ xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \ xaarop.h DISTCLEANFILES = xf86Build.h CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = \ compiler.h \ fourcc.h \ vidmodeproc.h \ xf86.h \ xf86Bus.h \ xf86Config.h \ xf86InPriv.h \ xf86Module.h \ xf86Opt.h \ xf86PciInfo.h \ xf86Priv.h \ xf86Privstr.h \ xf86Xinput.h \ xf86cmap.h \ xf86fbman.h \ xf86pciBus.h \ xf86str.h \ xf86xv.h \ xf86xvmc.h \ xf86xvpriv.h \ xisb.h \ xorgVersion.h \ $(MODEDEFSOURCES) \ modeline2c.awk \ xf86VGAarbiter.h \ xf86VGAarbiterPriv.h \ $(DISTKBDSOURCES) \ xaarop.h AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/common/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(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 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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}; \ } libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86AutoConfig.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Bus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Configure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DGA.Plo@am__quote@ @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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Mode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Option.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86PM.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RandR.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86VGAarbiter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86VidMode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Xinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86cmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86fbBus.Plo@am__quote@ @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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xorgHelper.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sdkdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) 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-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-sdkHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am uninstall-sdkHEADERS xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) $(AM_V_GEN)cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@ $(AM_V_GEN)echo >> $@ # 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: xorg-server-1.17.1/hw/xfree86/common/xf86.h0000664000175100017510000004312012366751547015172 00000000000000/* * 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). */ /* * This file contains declarations for public XFree86 functions and variables, * and definitions of public macros. * * "public" means available to video drivers. */ #ifndef _XF86_H #define _XF86_H #if HAVE_XORG_CONFIG_H #include #elif HAVE_DIX_CONFIG_H #include #endif #include "xf86str.h" #include "xf86Opt.h" #include #include #ifdef RANDR #include #endif #include "propertyst.h" /* General parameters */ 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; #define xf86ScreenKey (&xf86ScreenKeyRec) extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec; #define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec) extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern _X_EXPORT const unsigned char byte_reversed[256]; 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) xf86ScreenToScrn(p) #define XF86FLIP_PIXELS() \ do { \ if (xf86GetFlipPixels()) { \ pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \ pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \ } \ while (0) #define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE") #define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \ (((p) == Pix24Use32) ? 32 : 0)) /* Function Prototypes */ #ifndef _NO_XF86_PROTOTYPES /* PCI related */ #ifdef XSERVER_LIBPCIACCESS #include 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 *, 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, int device, int func); extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device *pPci); extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device *pPci, memType base); extern _X_EXPORT struct pci_device *xf86GetPciInfoForEntity(int entityIndex); extern _X_EXPORT int xf86MatchPciInstances(const char *driverName, int vendorID, SymTabPtr chipsets, PciChipsets * PCIchipsets, GDevPtr * devList, int numDevs, DriverPtr drvp, int **foundEntities); extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, PciChipsets * p_chip, void *dummy, EntityProc init, EntityProc enter, EntityProc leave, void *private); #else #define xf86VGAarbiterInit() do {} while (0) #define xf86VGAarbiterFini() do {} while (0) #define xf86VGAarbiterLock(x) do {} while (0) #define xf86VGAarbiterUnlock(x) do {} while (0) #define xf86VGAarbiterScrnInit(x) do {} while (0) #define xf86VGAarbiterDeviceDecodes() do {} while (0) #define xf86VGAarbiterWrapFunctions() do {} while (0) #endif /* xf86Bus.c */ extern _X_EXPORT int xf86GetFbInfoForScreen(int scrnIndex); extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); extern _X_EXPORT Bool xf86DriverHasEntities(DriverPtr drvp); extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex); extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, int instance); extern _X_EXPORT int xf86GetNumEntityInstances(int entityIndex); extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance); extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex); extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex); extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, void *); extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex); extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex); extern _X_EXPORT void xf86SetLastScrnFlag(int entityIndex, int scrnIndex); extern _X_EXPORT Bool xf86IsEntityShared(int entityIndex); extern _X_EXPORT void xf86SetEntityShared(int entityIndex); extern _X_EXPORT Bool xf86IsEntitySharable(int entityIndex); extern _X_EXPORT void xf86SetEntitySharable(int entityIndex); extern _X_EXPORT Bool xf86IsPrimInitDone(int entityIndex); extern _X_EXPORT void xf86SetPrimInitDone(int entityIndex); extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex); extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void); extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex); /* xf86Configure.c */ extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset); /* xf86Cursor.c */ extern _X_EXPORT void xf86LockZoom(ScreenPtr pScreen, int lock); extern _X_EXPORT void xf86InitViewport(ScrnInfoPtr pScr); extern _X_EXPORT void xf86SetViewport(ScreenPtr pScreen, int x, int y); extern _X_EXPORT void xf86ZoomViewport(ScreenPtr pScreen, int zoom); extern _X_EXPORT Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode); extern _X_EXPORT void *xf86GetPointerScreenFuncs(void); extern _X_EXPORT void xf86InitOrigins(void); extern _X_EXPORT void xf86ReconfigureLayout(void); /* xf86DPMS.c */ extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags); /* xf86DGA.c */ #ifdef XFreeXDGA extern _X_EXPORT Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes, int num); extern _X_EXPORT Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num); extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode; #endif /* xf86Events.c */ typedef struct _InputInfoRec *InputInfoPtr; extern _X_EXPORT void SetTimeSinceLastInputEvent(void); extern _X_EXPORT void *xf86AddInputHandler(int fd, InputHandlerProc proc, void *data); extern _X_EXPORT int xf86RemoveInputHandler(void *handler); extern _X_EXPORT void xf86DisableInputHandler(void *handler); extern _X_EXPORT void xf86EnableInputHandler(void *handler); extern _X_EXPORT void *xf86AddGeneralHandler(int fd, InputHandlerProc proc, void *data); extern _X_EXPORT int xf86RemoveGeneralHandler(void *handler); extern _X_EXPORT void xf86DisableGeneralHandler(void *handler); extern _X_EXPORT void xf86EnableGeneralHandler(void *handler); extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc handler, void *data); extern _X_EXPORT void xf86InterceptSignals(int *signo); extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void)); extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new); extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg); extern _X_EXPORT void xf86PrintBacktrace(void); extern _X_EXPORT Bool xf86VTOwner(void); extern _X_EXPORT void xf86VTLeave(void); extern _X_EXPORT void xf86VTEnter(void); extern _X_EXPORT void xf86EnableInputDeviceForVTSwitch(InputInfoPtr pInfo); extern _X_EXPORT void xf86DisableInputDeviceForVTSwitch(InputInfoPtr pInfo); /* xf86Helper.c */ extern _X_EXPORT void xf86AddDriver(DriverPtr driver, void *module, int flags); extern _X_EXPORT void xf86DeleteDriver(int drvIndex); extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, 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); extern _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp, int depth24flags); extern _X_EXPORT void xf86PrintDepthBpp(ScrnInfoPtr scrp); extern _X_EXPORT Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask); 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(ScrnInfoPtr pScrn, Bool enable); extern _X_EXPORT void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, va_list args) _X_ATTRIBUTE_PRINTF(4, 0); extern _X_EXPORT void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(4, 5); extern _X_EXPORT void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(3, 4); extern _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(3, 4); extern _X_EXPORT void xf86Msg(MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern _X_EXPORT void xf86ErrorFVerb(int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern _X_EXPORT void xf86ErrorF(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); extern _X_EXPORT const char * xf86TokenToString(SymTabPtr table, int token); extern _X_EXPORT int xf86StringToToken(SymTabPtr table, const char *string); extern _X_EXPORT void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from); extern _X_EXPORT void xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips); extern _X_EXPORT int xf86MatchDevice(const char *drivername, GDevPtr ** driversectlist); extern _X_EXPORT const char * xf86GetVisualName(int visual); extern _X_EXPORT int xf86GetVerbosity(void); extern _X_EXPORT Pix24Flags xf86GetPix24(void); extern _X_EXPORT int xf86GetDepth(void); extern _X_EXPORT rgb xf86GetWeight(void); extern _X_EXPORT Gamma xf86GetGamma(void); extern _X_EXPORT Bool xf86GetFlipPixels(void); extern _X_EXPORT const char * xf86GetServerName(void); extern _X_EXPORT Bool xf86ServerIsExiting(void); extern _X_EXPORT Bool xf86ServerIsResetting(void); extern _X_EXPORT Bool xf86ServerIsInitialising(void); extern _X_EXPORT Bool xf86ServerIsOnlyDetecting(void); extern _X_EXPORT Bool xf86CaughtSignal(void); extern _X_EXPORT Bool xf86GetVidModeAllowNonLocal(void); extern _X_EXPORT Bool xf86GetVidModeEnabled(void); extern _X_EXPORT Bool xf86GetModInDevAllowNonLocal(void); extern _X_EXPORT Bool xf86GetModInDevEnabled(void); extern _X_EXPORT Bool xf86GetAllowMouseOpenFail(void); extern _X_EXPORT void xf86DisableRandR(void); extern _X_EXPORT CARD32 xorgGetVersion(void); extern _X_EXPORT CARD32 xf86GetModuleVersion(void *module); extern _X_EXPORT void * xf86LoadDrvSubModule(DriverPtr drv, const char *name); extern _X_EXPORT void * xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name); extern _X_EXPORT void * xf86LoadOneModule(const char *name, void *optlist); extern _X_EXPORT void xf86UnloadSubModule(void *mod); extern _X_EXPORT Bool xf86LoaderCheckSymbol(const char *name); extern _X_EXPORT void xf86SetBackingStore(ScreenPtr pScreen); extern _X_EXPORT void xf86SetSilkenMouse(ScreenPtr pScreen); extern _X_EXPORT void * xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name, const char **adaptor_name, void **adaptor_options); extern _X_EXPORT void xf86GetOS(const char **name, int *major, int *minor, int *teeny); extern _X_EXPORT ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, void *private); extern _X_EXPORT Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn); extern _X_EXPORT int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, int format, unsigned long len, void *value); extern _X_EXPORT Bool xf86IsUnblank(int mode); /* xf86Init.c */ extern _X_EXPORT PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth); extern _X_EXPORT int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth); /* xf86Mode.c */ extern _X_EXPORT int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2, int DivFactor, int MulFactor, int *divider); extern _X_EXPORT const char * xf86ModeStatusToString(ModeStatus status); extern _X_EXPORT ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, ClockRangePtr clockRanges, LookupModeFlags strategy); extern _X_EXPORT ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor); extern _X_EXPORT ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, ClockRangePtr clockRanges, LookupModeFlags strategy, int maxPitch, int virtualX, int virtualY); extern _X_EXPORT ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags); extern _X_EXPORT int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int minHeight, int maxHeight, int pitchInc, int virtualX, int virtualY, int apertureSize, LookupModeFlags strategy); extern _X_EXPORT void xf86DeleteMode(DisplayModePtr * modeList, DisplayModePtr mode); extern _X_EXPORT void xf86PruneDriverModes(ScrnInfoPtr scrp); extern _X_EXPORT void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags); extern _X_EXPORT void xf86PrintModes(ScrnInfoPtr scrp); extern _X_EXPORT void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges); /* xf86Option.c */ extern _X_EXPORT void xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts); /* xf86RandR.c */ #ifdef RANDR extern _X_EXPORT Bool xf86RandRInit(ScreenPtr pScreen); extern _X_EXPORT Rotation xf86GetRotation(ScreenPtr pScreen); extern _X_EXPORT Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen, int newvirtX, int newvirtY, int newmmWidth, int newmmHeight, Bool resetMode); #endif /* xf86Extensions.c */ extern void xf86ExtensionInit(void); /* 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 */ xorg-server-1.17.1/hw/xfree86/common/xf86cmap.h0000664000175100017510000000520312274325511016015 00000000000000 /* * Copyright (c) 1998-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifndef _XF86CMAP_H #define _XF86CMAP_H #include "xf86str.h" #include "colormapst.h" #define CMAP_PALETTED_TRUECOLOR 0x0000001 #define CMAP_RELOAD_ON_MODE_SWITCH 0x0000002 #define CMAP_LOAD_EVEN_IF_OFFSCREEN 0x0000004 extern _X_EXPORT Bool xf86HandleColormaps(ScreenPtr pScreen, int maxCol, int sigRGBbits, xf86LoadPaletteProc * loadPalette, xf86SetOverscanProc * setOverscan, unsigned int flags); extern _X_EXPORT Bool xf86ColormapAllocatePrivates(ScrnInfoPtr pScrn); extern _X_EXPORT int xf86ChangeGamma(ScreenPtr pScreen, Gamma newGamma); extern _X_EXPORT int xf86ChangeGammaRamp(ScreenPtr pScreen, int size, unsigned short *red, unsigned short *green, unsigned short *blue); extern _X_EXPORT int xf86GetGammaRampSize(ScreenPtr pScreen); extern _X_EXPORT int xf86GetGammaRamp(ScreenPtr pScreen, int size, unsigned short *red, unsigned short *green, unsigned short *blue); #endif /* _XF86CMAP_H */ xorg-server-1.17.1/hw/xfree86/common/xf86fbman.h0000664000175100017510000001526712274325511016173 00000000000000 /* * Copyright (c) 1998-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifndef _XF86FBMAN_H #define _XF86FBMAN_H #include "scrnintstr.h" #include "regionstr.h" #define FAVOR_AREA_THEN_WIDTH 0 #define FAVOR_AREA_THEN_HEIGHT 1 #define FAVOR_WIDTH_THEN_AREA 2 #define FAVOR_HEIGHT_THEN_AREA 3 #define PRIORITY_LOW 0 #define PRIORITY_NORMAL 1 #define PRIORITY_EXTREME 2 typedef struct _FBArea { ScreenPtr pScreen; BoxRec box; int granularity; void (*MoveAreaCallback) (struct _FBArea *, struct _FBArea *); void (*RemoveAreaCallback) (struct _FBArea *); DevUnion devPrivate; } FBArea, *FBAreaPtr; typedef struct _FBLinear { ScreenPtr pScreen; int size; int offset; int granularity; void (*MoveLinearCallback) (struct _FBLinear *, struct _FBLinear *); void (*RemoveLinearCallback) (struct _FBLinear *); DevUnion devPrivate; } FBLinear, *FBLinearPtr; typedef void (*FreeBoxCallbackProcPtr) (ScreenPtr, RegionPtr, void *); typedef void (*MoveAreaCallbackProcPtr) (FBAreaPtr, FBAreaPtr); typedef void (*RemoveAreaCallbackProcPtr) (FBAreaPtr); typedef void (*MoveLinearCallbackProcPtr) (FBLinearPtr, FBLinearPtr); typedef void (*RemoveLinearCallbackProcPtr) (FBLinearPtr); typedef struct { FBAreaPtr(*AllocateOffscreenArea) (ScreenPtr pScreen, int w, int h, int granularity, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, void *privData); void (*FreeOffscreenArea) (FBAreaPtr area); Bool (*ResizeOffscreenArea) (FBAreaPtr area, int w, int h); Bool (*QueryLargestOffscreenArea) (ScreenPtr pScreen, int *width, int *height, int granularity, int preferences, int priority); Bool (*RegisterFreeBoxCallback) (ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, void *devPriv); /* linear functions */ FBLinearPtr(*AllocateOffscreenLinear) (ScreenPtr pScreen, int size, int granularity, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr removeCB, void *privData); void (*FreeOffscreenLinear) (FBLinearPtr area); Bool (*ResizeOffscreenLinear) (FBLinearPtr area, int size); Bool (*QueryLargestOffscreenLinear) (ScreenPtr pScreen, int *size, int granularity, int priority); Bool (*PurgeOffscreenAreas) (ScreenPtr); } FBManagerFuncs, *FBManagerFuncsPtr; extern _X_EXPORT Bool xf86RegisterOffscreenManager(ScreenPtr pScreen, FBManagerFuncsPtr funcs); extern _X_EXPORT Bool xf86InitFBManagerRegion(ScreenPtr pScreen, RegionPtr ScreenRegion); extern _X_EXPORT Bool xf86InitFBManagerArea(ScreenPtr pScreen, int PixalArea, int Verbosity); extern _X_EXPORT Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox); extern _X_EXPORT Bool xf86InitFBManagerLinear(ScreenPtr pScreen, int offset, int size); extern _X_EXPORT Bool xf86FBManagerRunning(ScreenPtr pScreen); extern _X_EXPORT FBAreaPtr xf86AllocateOffscreenArea(ScreenPtr pScreen, int w, int h, int granularity, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, void *privData); extern _X_EXPORT FBAreaPtr xf86AllocateLinearOffscreenArea(ScreenPtr pScreen, int length, int granularity, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, void *privData); extern _X_EXPORT FBLinearPtr xf86AllocateOffscreenLinear(ScreenPtr pScreen, int length, int granularity, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr removeCB, void *privData); extern _X_EXPORT void xf86FreeOffscreenArea(FBAreaPtr area); extern _X_EXPORT void xf86FreeOffscreenLinear(FBLinearPtr area); extern _X_EXPORT Bool xf86ResizeOffscreenArea(FBAreaPtr resize, int w, int h); extern _X_EXPORT Bool xf86ResizeOffscreenLinear(FBLinearPtr resize, int size); extern _X_EXPORT Bool xf86RegisterFreeBoxCallback(ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, void *devPriv); extern _X_EXPORT Bool xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen); extern _X_EXPORT Bool xf86QueryLargestOffscreenArea(ScreenPtr pScreen, int *width, int *height, int granularity, int preferences, int priority); extern _X_EXPORT Bool xf86QueryLargestOffscreenLinear(ScreenPtr pScreen, int *size, int granularity, int priority); #endif /* _XF86FBMAN_H */ xorg-server-1.17.1/hw/xfree86/common/xf86xvmc.c0000664000175100017510000001704012366220413016044 00000000000000 /* * Copyright (c) 2001-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include #include #include "scrnintstr.h" #include "resource.h" #include "dixstruct.h" #include "xf86xvpriv.h" #include "xf86xvmc.h" typedef struct { CloseScreenProcPtr CloseScreen; int num_adaptors; XF86MCAdaptorPtr *adaptors; XvMCAdaptorPtr dixinfo; } xf86XvMCScreenRec, *xf86XvMCScreenPtr; static DevPrivateKeyRec XF86XvMCScreenKeyRec; #define XF86XvMCScreenKey (&XF86XvMCScreenKeyRec) #define XF86XVMC_GET_PRIVATE(pScreen) (xf86XvMCScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, XF86XvMCScreenKey) static int xf86XvMCCreateContext(XvPortPtr pPort, XvMCContextPtr pContext, int *num_priv, CARD32 **priv) { xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); pContext->port_priv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateContext) (pScrn, pContext, num_priv, priv); } static void xf86XvMCDestroyContext(XvMCContextPtr pContext) { xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num]->DestroyContext) (pScrn, pContext); } static int xf86XvMCCreateSurface(XvMCSurfacePtr pSurface, int *num_priv, CARD32 **priv) { XvMCContextPtr pContext = pSurface->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateSurface) (pScrn, pSurface, num_priv, priv); } static void xf86XvMCDestroySurface(XvMCSurfacePtr pSurface) { XvMCContextPtr pContext = pSurface->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySurface) (pScrn, pSurface); } static int xf86XvMCCreateSubpicture(XvMCSubpicturePtr pSubpicture, int *num_priv, CARD32 **priv) { XvMCContextPtr pContext = pSubpicture->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); return (*pScreenPriv->adaptors[pContext->adapt_num]-> CreateSubpicture) (pScrn, pSubpicture, num_priv, priv); } static void xf86XvMCDestroySubpicture(XvMCSubpicturePtr pSubpicture) { XvMCContextPtr pContext = pSubpicture->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySubpicture) (pScrn, pSubpicture); } static Bool xf86XvMCCloseScreen(ScreenPtr pScreen) { xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; free(pScreenPriv->dixinfo); free(pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } Bool xf86XvMCScreenInit(ScreenPtr pScreen, int num_adaptors, XF86MCAdaptorPtr * adaptors) { XvMCAdaptorPtr pAdapt; xf86XvMCScreenPtr pScreenPriv; XvScreenPtr pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XF86XvScreenKey); int i, j; if (noXvExtension) return FALSE; if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors))) return FALSE; if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) { free(pAdapt); return FALSE; } if (!(pScreenPriv = malloc(sizeof(xf86XvMCScreenRec)))) { free(pAdapt); return FALSE; } dixSetPrivate(&pScreen->devPrivates, XF86XvMCScreenKey, pScreenPriv); pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86XvMCCloseScreen; pScreenPriv->num_adaptors = num_adaptors; pScreenPriv->adaptors = adaptors; pScreenPriv->dixinfo = pAdapt; for (i = 0; i < num_adaptors; i++) { pAdapt[i].xv_adaptor = NULL; for (j = 0; j < pxvs->nAdaptors; j++) { if (!strcmp((*adaptors)->name, pxvs->pAdaptors[j].name)) { pAdapt[i].xv_adaptor = &(pxvs->pAdaptors[j]); break; } } if (!pAdapt[i].xv_adaptor) { /* no adaptor by that name */ free(pAdapt); return FALSE; } pAdapt[i].num_surfaces = (*adaptors)->num_surfaces; pAdapt[i].surfaces = (XvMCSurfaceInfoPtr *) ((*adaptors)->surfaces); pAdapt[i].num_subpictures = (*adaptors)->num_subpictures; pAdapt[i].subpictures = (XvImagePtr *) ((*adaptors)->subpictures); pAdapt[i].CreateContext = xf86XvMCCreateContext; pAdapt[i].DestroyContext = xf86XvMCDestroyContext; pAdapt[i].CreateSurface = xf86XvMCCreateSurface; pAdapt[i].DestroySurface = xf86XvMCDestroySurface; pAdapt[i].CreateSubpicture = xf86XvMCCreateSubpicture; pAdapt[i].DestroySubpicture = xf86XvMCDestroySubpicture; adaptors++; } if (Success != XvMCScreenInit(pScreen, num_adaptors, pAdapt)) return FALSE; return TRUE; } XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec(void) { return calloc(1, sizeof(XF86MCAdaptorRec)); } void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor) { free(adaptor); } xorg-server-1.17.1/hw/xfree86/common/xf86noBus.c0000664000175100017510000000406512366220413016160 00000000000000/* * Copyright (c) 2000-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file contains the interfaces to the bus-specific code */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86Bus.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) { EntityPtr p; int num; num = xf86AllocateEntity(); p = xf86Entities[num]; p->driver = drvp; p->chipset = 0; p->bus.type = BUS_NONE; p->active = active; p->inUse = FALSE; xf86AddDevToEntity(num, dev); return num; } xorg-server-1.17.1/hw/xfree86/common/xf86Extensions.c0000664000175100017510000000727212366220413017234 00000000000000/* * 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; /* 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) { load_extension_config(); LoadExtensionList(extensionModules, ARRAY_SIZE(extensionModules), TRUE); } xorg-server-1.17.1/hw/xfree86/common/xf86xvpriv.h0000664000175100017510000000607412414702051016434 00000000000000 /* * Copyright (c) 2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifndef _XF86XVPRIV_H_ #define _XF86XVPRIV_H_ #include "xf86xv.h" #include "privates.h" /*** These are DDX layer privates ***/ extern _X_EXPORT DevPrivateKey XF86XvScreenKey; typedef struct { DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; PostValidateTreeProcPtr PostValidateTree; void (*AdjustFrame) (ScrnInfoPtr, int, int); Bool (*EnterVT) (ScrnInfoPtr); void (*LeaveVT) (ScrnInfoPtr); xf86ModeSetProc *ModeSet; CloseScreenProcPtr CloseScreen; } XF86XVScreenRec, *XF86XVScreenPtr; typedef struct { int flags; PutVideoFuncPtr PutVideo; PutStillFuncPtr PutStill; GetVideoFuncPtr GetVideo; GetStillFuncPtr GetStill; StopVideoFuncPtr StopVideo; SetPortAttributeFuncPtr SetPortAttribute; GetPortAttributeFuncPtr GetPortAttribute; QueryBestSizeFuncPtr QueryBestSize; PutImageFuncPtr PutImage; ReputImageFuncPtr ReputImage; QueryImageAttributesFuncPtr QueryImageAttributes; } XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr; typedef struct { ScrnInfoPtr pScrn; DrawablePtr pDraw; unsigned char type; unsigned int subWindowMode; RegionPtr clientClip; RegionPtr ckeyFilled; RegionPtr pCompositeClip; Bool FreeCompositeClip; XvAdaptorRecPrivatePtr AdaptorRec; XvStatus isOn; Bool clipChanged; int vid_x, vid_y, vid_w, vid_h; int drw_x, drw_y, drw_w, drw_h; DevUnion DevPriv; } XvPortRecPrivate, *XvPortRecPrivatePtr; typedef struct _XF86XVWindowRec { XvPortRecPrivatePtr PortRec; struct _XF86XVWindowRec *next; } XF86XVWindowRec, *XF86XVWindowPtr; #endif /* _XF86XVPRIV_H_ */ xorg-server-1.17.1/hw/xfree86/common/xf86sbusBus.h0000664000175100017510000001062212274325511016524 00000000000000/* * SBUS bus-specific declarations * * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com) * * 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 * JAKUB JELINEK 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 _XF86_SBUSBUS_H #define _XF86_SBUSBUS_H #include "xf86str.h" #define SBUS_DEVICE_BW2 0x0001 #define SBUS_DEVICE_CG2 0x0002 #define SBUS_DEVICE_CG3 0x0003 #define SBUS_DEVICE_CG4 0x0004 #define SBUS_DEVICE_CG6 0x0005 #define SBUS_DEVICE_CG8 0x0006 #define SBUS_DEVICE_CG12 0x0007 #define SBUS_DEVICE_CG14 0x0008 #define SBUS_DEVICE_LEO 0x0009 #define SBUS_DEVICE_TCX 0x000a #define SBUS_DEVICE_FFB 0x000b #define SBUS_DEVICE_GT 0x000c #define SBUS_DEVICE_MGX 0x000d typedef struct sbus_prom_node { int node; /* Because of misdesigned openpromio */ int cookie[2]; } sbusPromNode, *sbusPromNodePtr; typedef struct sbus_device { int devId; int fbNum; int fd; int width, height; sbusPromNode node; const char *descr; const char *device; } sbusDevice, *sbusDevicePtr; struct sbus_devtable { int devId; int fbType; const char *promName; const char *driverName; const char *descr; }; extern _X_EXPORT void xf86SbusProbe(void); extern _X_EXPORT sbusDevicePtr *xf86SbusInfo; extern _X_EXPORT struct sbus_devtable sbusDeviceTable[]; extern _X_EXPORT int xf86MatchSbusInstances(const char *driverName, int sbusDevId, GDevPtr * devList, int numDevs, DriverPtr drvp, int **foundEntities); extern _X_EXPORT sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex); extern _X_EXPORT int xf86GetEntityForSbusInfo(sbusDevicePtr psdp); extern _X_EXPORT void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp); extern _X_EXPORT void *xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size); extern _X_EXPORT void xf86UnmapSbusMem(sbusDevicePtr psdp, void *addr, unsigned long size); extern _X_EXPORT void xf86SbusHideOsHwCursor(sbusDevicePtr psdp); extern _X_EXPORT void xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg); extern _X_EXPORT Bool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp); extern _X_EXPORT int promRootNode; extern _X_EXPORT int promGetSibling(int node); extern _X_EXPORT int promGetChild(int node); extern _X_EXPORT char *promGetProperty(const char *prop, int *lenp); extern _X_EXPORT int promGetBool(const char *prop); extern _X_EXPORT int sparcPromInit(void); extern _X_EXPORT void sparcPromClose(void); extern _X_EXPORT char *sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp); extern _X_EXPORT int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop); extern _X_EXPORT void sparcPromAssignNodes(void); extern _X_EXPORT char *sparcPromNode2Pathname(sbusPromNodePtr pnode); extern _X_EXPORT int sparcPromPathname2Node(const char *pathName); extern _X_EXPORT char *sparcDriverName(void); extern Bool xf86SbusConfigure(void *busData, sbusDevicePtr sBus); extern void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev); #endif /* _XF86_SBUSBUS_H */ xorg-server-1.17.1/hw/xfree86/common/xorgHelper.c0000664000175100017510000000055512366220413016475 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "servermd.h" #include "pixmapstr.h" #include "windowstr.h" #include "propertyst.h" #include "gcstruct.h" #include "loaderProcs.h" #include "xf86.h" #include "xf86Priv.h" #include "xorgVersion.h" CARD32 xorgGetVersion(void) { return XORG_VERSION_CURRENT; } xorg-server-1.17.1/hw/xfree86/common/xf86str.h0000664000175100017510000007043312456571574015732 00000000000000 /* * 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). */ /* * This file contains definitions of the public XFree86 data structures/types. * Any data structures that video drivers need to access should go here. */ #ifndef _XF86STR_H #define _XF86STR_H #include "misc.h" #include "input.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "colormapst.h" #include "xf86Module.h" #include "xf86Opt.h" /** * Integer type that is of the size of the addressable memory (machine size). * On most platforms \c uintptr_t will suffice. However, on some mixed * 32-bit / 64-bit platforms, such as 32-bit binaries on 64-bit PowerPC, this * must be 64-bits. */ #include #if defined(__powerpc__) typedef uint64_t memType; #else typedef uintptr_t memType; #endif /* Video mode flags */ typedef enum { V_PHSYNC = 0x0001, V_NHSYNC = 0x0002, V_PVSYNC = 0x0004, V_NVSYNC = 0x0008, V_INTERLACE = 0x0010, V_DBLSCAN = 0x0020, V_CSYNC = 0x0040, V_PCSYNC = 0x0080, V_NCSYNC = 0x0100, V_HSKEW = 0x0200, /* hskew provided */ V_BCAST = 0x0400, V_PIXMUX = 0x1000, V_DBLCLK = 0x2000, V_CLKDIV2 = 0x4000 } ModeFlags; typedef enum { INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */ } CrtcAdjustFlags; /* Flags passed to ChipValidMode() */ typedef enum { MODECHECK_INITIAL = 0, MODECHECK_FINAL = 1 } ModeCheckFlags; /* These are possible return values for xf86CheckMode() and ValidMode() */ typedef enum { MODE_OK = 0, /* Mode OK */ MODE_HSYNC, /* hsync out of range */ MODE_VSYNC, /* vsync out of range */ MODE_H_ILLEGAL, /* mode has illegal horizontal timings */ MODE_V_ILLEGAL, /* mode has illegal horizontal timings */ MODE_BAD_WIDTH, /* requires an unsupported linepitch */ MODE_NOMODE, /* no mode with a maching name */ MODE_NO_INTERLACE, /* interlaced mode not supported */ MODE_NO_DBLESCAN, /* doublescan mode not supported */ MODE_NO_VSCAN, /* multiscan mode not supported */ MODE_MEM, /* insufficient video memory */ MODE_VIRTUAL_X, /* mode width too large for specified virtual size */ MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */ MODE_MEM_VIRT, /* insufficient video memory given virtual size */ MODE_NOCLOCK, /* no fixed clock available */ MODE_CLOCK_HIGH, /* clock required is too high */ MODE_CLOCK_LOW, /* clock required is too low */ MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */ MODE_BAD_HVALUE, /* horizontal timing was out of range */ MODE_BAD_VVALUE, /* vertical timing was out of range */ MODE_BAD_VSCAN, /* VScan value out of range */ MODE_HSYNC_NARROW, /* horizontal sync too narrow */ MODE_HSYNC_WIDE, /* horizontal sync too wide */ MODE_HBLANK_NARROW, /* horizontal blanking too narrow */ MODE_HBLANK_WIDE, /* horizontal blanking too wide */ MODE_VSYNC_NARROW, /* vertical sync too narrow */ MODE_VSYNC_WIDE, /* vertical sync too wide */ MODE_VBLANK_NARROW, /* vertical blanking too narrow */ MODE_VBLANK_WIDE, /* vertical blanking too wide */ MODE_PANEL, /* exceeds panel dimensions */ MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */ MODE_ONE_WIDTH, /* only one width is supported */ MODE_ONE_HEIGHT, /* only one height is supported */ MODE_ONE_SIZE, /* only one resolution is supported */ MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */ MODE_BANDWIDTH, /* mode requires too much memory bandwidth */ MODE_BAD = -2, /* unspecified reason */ MODE_ERROR = -1 /* error condition */ } ModeStatus; /* * The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN. * Preferred will bubble a mode to the top within a set. */ #define M_T_BUILTIN 0x01 /* built-in mode */ #define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */ #define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */ #define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C) /* built-in mode - configure CRTC and clock */ #define M_T_PREFERRED 0x08 /* preferred mode within a set */ #define M_T_DEFAULT 0x10 /* (VESA) default modes */ #define M_T_USERDEF 0x20 /* One of the modes from the config file */ #define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */ #define M_T_USERPREF 0x80 /* mode preferred by the user config */ /* Video mode */ typedef struct _DisplayModeRec { struct _DisplayModeRec *prev; struct _DisplayModeRec *next; const char *name; /* identifier for the mode */ ModeStatus status; int type; /* These are the values that the user sees/provides */ int Clock; /* pixel clock freq (kHz) */ int HDisplay; /* horizontal timing */ int HSyncStart; int HSyncEnd; int HTotal; int HSkew; int VDisplay; /* vertical timing */ int VSyncStart; int VSyncEnd; int VTotal; int VScan; int Flags; /* These are the values the hardware uses */ int ClockIndex; int SynthClock; /* Actual clock freq to * be programmed (kHz) */ int CrtcHDisplay; int CrtcHBlankStart; int CrtcHSyncStart; int CrtcHSyncEnd; int CrtcHBlankEnd; int CrtcHTotal; int CrtcHSkew; int CrtcVDisplay; int CrtcVBlankStart; int CrtcVSyncStart; int CrtcVSyncEnd; int CrtcVBlankEnd; int CrtcVTotal; Bool CrtcHAdjusted; Bool CrtcVAdjusted; int PrivSize; INT32 *Private; int PrivFlags; float HSync, VRefresh; } DisplayModeRec, *DisplayModePtr; /* The monitor description */ #define MAX_HSYNC 8 #define MAX_VREFRESH 8 typedef struct { float hi, lo; } range; typedef struct { CARD32 red, green, blue; } rgb; typedef struct { float red, green, blue; } Gamma; /* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */ #define GAMMA_MAX 10.0 #define GAMMA_MIN (1.0 / GAMMA_MAX) #define GAMMA_ZERO (GAMMA_MIN / 100.0) typedef struct { const char *id; const char *vendor; const char *model; int nHsync; range hsync[MAX_HSYNC]; int nVrefresh; range vrefresh[MAX_VREFRESH]; DisplayModePtr Modes; /* Start of the monitor's mode list */ DisplayModePtr Last; /* End of the monitor's mode list */ Gamma gamma; /* Gamma of the monitor */ int widthmm; int heightmm; void *options; void *DDC; Bool reducedblanking; /* Allow CVT reduced blanking modes? */ int maxPixClock; /* in kHz, like mode->Clock */ } MonRec, *MonPtr; /* the list of clock ranges */ typedef struct x_ClockRange { struct x_ClockRange *next; int minClock; /* (kHz) */ int maxClock; /* (kHz) */ int clockIndex; /* -1 for programmable clocks */ Bool interlaceAllowed; Bool doubleScanAllowed; int ClockMulFactor; int ClockDivFactor; int PrivFlags; } ClockRange, *ClockRangePtr; /* * The driverFunc. xorgDriverFuncOp specifies the action driver should * perform. If requested option is not supported function should return * FALSE. pointer can be used to pass arguments to the function or * to return data to the caller. */ typedef struct _ScrnInfoRec *ScrnInfoPtr; /* do not change order */ typedef enum { RR_GET_INFO, RR_SET_CONFIG, RR_GET_MODE_MM, GET_REQUIRED_HW_INTERFACES = 10, SUPPORTS_SERVER_FDS = 11, } xorgDriverFuncOp; typedef Bool xorgDriverFuncProc(ScrnInfoPtr, xorgDriverFuncOp, void *); /* RR_GET_INFO, RR_SET_CONFIG */ typedef struct { int rotation; int rate; int width; int height; } xorgRRConfig; typedef union { short RRRotations; xorgRRConfig RRConfig; } xorgRRRotation, *xorgRRRotationPtr; /* RR_GET_MODE_MM */ typedef struct { DisplayModePtr mode; int virtX; int virtY; int mmWidth; int mmHeight; } xorgRRModeMM, *xorgRRModeMMPtr; /* GET_REQUIRED_HW_INTERFACES */ #define HW_IO 1 #define HW_MMIO 2 #define HW_SKIP_CONSOLE 4 #define NEED_IO_ENABLED(x) (x & HW_IO) typedef CARD32 xorgHWFlags; /* * The driver list struct. This contains the information required for each * driver before a ScrnInfoRec has been allocated. */ struct _DriverRec; typedef struct { int driverVersion; const char *driverName; void (*Identify) (int flags); Bool (*Probe) (struct _DriverRec * drv, int flags); const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype); void *module; int refCount; } DriverRec1; struct _SymTabRec; struct _PciChipsets; struct pci_device; struct xf86_platform_device; typedef struct _DriverRec { int driverVersion; const char *driverName; void (*Identify) (int flags); Bool (*Probe) (struct _DriverRec * drv, int flags); const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype); void *module; int refCount; xorgDriverFuncProc *driverFunc; const struct pci_id_match *supported_devices; Bool (*PciProbe) (struct _DriverRec * drv, int entity_num, struct pci_device * dev, intptr_t match_data); Bool (*platformProbe) (struct _DriverRec * drv, int entity_num, int flags, struct xf86_platform_device * dev, intptr_t match_data); } DriverRec, *DriverPtr; /* * platform probe flags */ #define PLATFORM_PROBE_GPU_SCREEN 1 /* * AddDriver flags */ #define HaveDriverFuncs 1 /* * These are the private bus types. New types can be added here. Types * required for the public interface should be added to xf86str.h, with * function prototypes added to xf86.h. */ /* Tolerate prior #include */ #if defined(linux) #undef BUS_NONE #undef BUS_PCI #undef BUS_SBUS #undef BUS_PLATFORM #undef BUS_last #endif typedef enum { BUS_NONE, BUS_PCI, BUS_SBUS, BUS_PLATFORM, BUS_last /* Keep last */ } BusType; typedef struct { int fbNum; } SbusBusId; typedef struct _bus { BusType type; union { struct pci_device *pci; SbusBusId sbus; struct xf86_platform_device *plat; } id; } BusRec, *BusPtr; #define MAXCLOCKS 128 typedef enum { DAC_BPP8 = 0, DAC_BPP16, DAC_BPP24, DAC_BPP32, MAXDACSPEEDS } DacSpeedIndex; typedef struct { const char *identifier; const char *vendor; const char *board; const char *chipset; const char *ramdac; const char *driver; struct _confscreenrec *myScreenSection; Bool claimed; int dacSpeeds[MAXDACSPEEDS]; int numclocks; int clock[MAXCLOCKS]; const char *clockchip; const char *busID; Bool active; Bool inUse; int videoRam; unsigned long BiosBase; /* Base address of video BIOS */ unsigned long MemBase; /* Frame buffer base address */ unsigned long IOBase; int chipID; int chipRev; void *options; int irq; int screen; /* For multi-CRTC cards */ } GDevRec, *GDevPtr; typedef struct { int frameX0; int frameY0; int virtualX; int virtualY; int depth; int fbbpp; rgb weight; rgb blackColour; rgb whiteColour; int defaultVisual; const char **modes; void *options; } DispRec, *DispPtr; typedef struct _confxvportrec { const char *identifier; void *options; } confXvPortRec, *confXvPortPtr; typedef struct _confxvadaptrec { const char *identifier; int numports; confXvPortPtr ports; void *options; } confXvAdaptorRec, *confXvAdaptorPtr; typedef struct _confscreenrec { const char *id; int screennum; int defaultdepth; int defaultbpp; int defaultfbbpp; MonPtr monitor; GDevPtr device; int numdisplays; DispPtr displays; int numxvadaptors; confXvAdaptorPtr xvadaptors; void *options; } confScreenRec, *confScreenPtr; typedef enum { PosObsolete = -1, PosAbsolute = 0, PosRightOf, PosLeftOf, PosAbove, PosBelow, PosRelative } PositionType; typedef struct _screenlayoutrec { confScreenPtr screen; const char *topname; confScreenPtr top; const char *bottomname; confScreenPtr bottom; const char *leftname; confScreenPtr left; const char *rightname; confScreenPtr right; PositionType where; int x; int y; const char *refname; confScreenPtr refscreen; } screenLayoutRec, *screenLayoutPtr; typedef struct _InputInfoRec InputInfoRec; typedef struct _serverlayoutrec { const char *id; screenLayoutPtr screens; GDevPtr inactives; InputInfoRec **inputs; /* NULL terminated */ void *options; } serverLayoutRec, *serverLayoutPtr; typedef struct _confdribufferrec { int count; int size; enum { XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */ } flags; } confDRIBufferRec, *confDRIBufferPtr; typedef struct _confdrirec { int group; int mode; int bufs_count; confDRIBufferRec *bufs; } confDRIRec, *confDRIPtr; /* These values should be adjusted when new fields are added to ScrnInfoRec */ #define NUM_RESERVED_INTS 16 #define NUM_RESERVED_POINTERS 14 #define NUM_RESERVED_FUNCS 10 typedef void *(*funcPointer) (void); /* flags for depth 24 pixmap options */ typedef enum { Pix24DontCare = 0, Pix24Use24, Pix24Use32 } Pix24Flags; /* Power management events: so far we only support APM */ typedef enum { XF86_APM_UNKNOWN = -1, XF86_APM_SYS_STANDBY, XF86_APM_SYS_SUSPEND, XF86_APM_CRITICAL_SUSPEND, XF86_APM_USER_STANDBY, XF86_APM_USER_SUSPEND, XF86_APM_STANDBY_RESUME, XF86_APM_NORMAL_RESUME, XF86_APM_CRITICAL_RESUME, XF86_APM_LOW_BATTERY, XF86_APM_POWER_STATUS_CHANGE, XF86_APM_UPDATE_TIME, XF86_APM_CAPABILITY_CHANGED, XF86_APM_STANDBY_FAILED, XF86_APM_SUSPEND_FAILED } pmEvent; typedef enum { PM_WAIT, PM_CONTINUE, PM_FAILED, PM_NONE } pmWait; typedef struct _PciChipsets { /** * Key used to match this device with its name in an array of * \c SymTabRec. */ int numChipset; /** * This value is quirky. Depending on the driver, it can take on one of * three meanings. In drivers that have exactly one vendor ID (e.g., * radeon, mga, i810) the low 16-bits are the device ID. * * In drivers that can have multiple vendor IDs (e.g., the glint driver * can have either 3dlabs' ID or TI's ID, the i740 driver can have either * Intel's ID or Real3D's ID, etc.) the low 16-bits are the device ID and * the high 16-bits are the vendor ID. * * In drivers that don't have a specific vendor (e.g., vga) contains the * device ID for either the generic VGA or generic 8514 devices. This * turns out to be the same as the subclass and programming interface * value (e.g., the full 24-bit class for the VGA device is 0x030000 (or * 0x000101) and for 8514 is 0x030001). */ int PCIid; /* dummy place holders for drivers to build against old/new servers */ #define RES_UNDEFINED NULL #define RES_EXCLUSIVE_VGA NULL #define RES_SHARED_VGA NULL void *dummy; } PciChipsets; /* Entity properties */ typedef void (*EntityProc) (int entityIndex, void *private); typedef struct _entityInfo { int index; BusRec location; int chipset; Bool active; GDevPtr device; DriverPtr driver; } EntityInfoRec, *EntityInfoPtr; /* DGA */ typedef struct { int num; /* A unique identifier for the mode (num > 0) */ DisplayModePtr mode; int flags; /* DGA_CONCURRENT_ACCESS, etc... */ int imageWidth; /* linear accessible portion (pixels) */ int imageHeight; int pixmapWidth; /* Xlib accessible portion (pixels) */ int pixmapHeight; /* both fields ignored if no concurrent access */ int bytesPerScanline; int byteOrder; /* MSBFirst, LSBFirst */ int depth; int bitsPerPixel; unsigned long red_mask; unsigned long green_mask; unsigned long blue_mask; short visualClass; int viewportWidth; int viewportHeight; int xViewportStep; /* viewport position granularity */ int yViewportStep; int maxViewportX; /* max viewport origin */ int maxViewportY; int viewportFlags; /* types of page flipping possible */ int offset; /* offset into physical memory */ unsigned char *address; /* server's mapped framebuffer */ int reserved1; int reserved2; } DGAModeRec, *DGAModePtr; typedef struct { DGAModePtr mode; PixmapPtr pPix; } DGADeviceRec, *DGADevicePtr; /* * Flags for driver Probe() functions. */ #define PROBE_DEFAULT 0x00 #define PROBE_DETECT 0x01 #define PROBE_TRYHARD 0x02 /* * Driver entry point types */ typedef Bool xf86ProbeProc(DriverPtr, int); typedef Bool xf86PreInitProc(ScrnInfoPtr, int); 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); typedef void xf86ModeSetProc(ScrnInfoPtr); /* * ScrnInfoRec * * There is one of these for each screen, and it holds all the screen-specific * information. * * Note: the size and layout must be kept the same across versions. New * fields are to be added in place of the "reserved*" fields. No fields * are to be dependent on compile-time defines. */ typedef struct _ScrnInfoRec { int driverVersion; const char *driverName; /* canonical name used in */ /* the config file */ ScreenPtr pScreen; /* Pointer to the ScreenRec */ int scrnIndex; /* Number of this screen */ Bool configured; /* Is this screen valid */ int origIndex; /* initial number assigned to * this screen before * finalising the number of * available screens */ /* Display-wide screenInfo values needed by this screen */ int imageByteOrder; int bitmapScanlineUnit; int bitmapScanlinePad; int bitmapBitOrder; int numFormats; PixmapFormatRec formats[MAXFORMATS]; PixmapFormatRec fbFormat; int bitsPerPixel; /* fb bpp */ Pix24Flags pixmap24; /* pixmap pref for depth 24 */ int depth; /* depth of default visual */ MessageType depthFrom; /* set from config? */ MessageType bitsPerPixelFrom; /* set from config? */ rgb weight; /* r/g/b weights */ rgb mask; /* rgb masks */ rgb offset; /* rgb offsets */ int rgbBits; /* Number of bits in r/g/b */ Gamma gamma; /* Gamma of the monitor */ int defaultVisual; /* default visual class */ int maxHValue; /* max horizontal timing */ int maxVValue; /* max vertical timing value */ int virtualX; /* Virtual width */ int virtualY; /* Virtual height */ int xInc; /* Horizontal timing increment */ MessageType virtualFrom; /* set from config? */ int displayWidth; /* memory pitch */ int frameX0; /* viewport position */ int frameY0; int frameX1; int frameY1; int zoomLocked; /* Disallow mode changes */ DisplayModePtr modePool; /* list of compatible modes */ DisplayModePtr modes; /* list of actual modes */ DisplayModePtr currentMode; /* current mode * This was previously * overloaded with the modes * field, which is a pointer * into a circular list */ confScreenPtr confScreen; /* Screen config info */ MonPtr monitor; /* Monitor information */ DispPtr display; /* Display information */ int *entityList; /* List of device entities */ int numEntities; int widthmm; /* physical display dimensions * in mm */ int heightmm; int xDpi; /* width DPI */ int yDpi; /* height DPI */ const char *name; /* Name to prefix messages */ void *driverPrivate; /* Driver private area */ DevUnion *privates; /* Other privates can hook in * here */ DriverPtr drv; /* xf86DriverList[] entry */ void *module; /* Pointer to module head */ int colorKey; int overlayFlags; /* Some of these may be moved out of here into the driver private area */ const char *chipset; /* chipset name */ const char *ramdac; /* ramdac name */ const char *clockchip; /* clock name */ Bool progClock; /* clock is programmable */ int numClocks; /* number of clocks */ int clock[MAXCLOCKS]; /* list of clock frequencies */ int videoRam; /* amount of video ram (kb) */ unsigned long biosBase; /* Base address of video BIOS */ unsigned long memPhysBase; /* Physical address of FB */ unsigned long fbOffset; /* Offset of FB in the above */ int memClk; /* memory clock */ Bool flipPixels; /* swap default black/white */ void *options; int chipID; int chipRev; /* Allow screens to be enabled/disabled individually */ Bool vtSema; /* hw cursor moves at SIGIO time */ Bool silkenMouse; /* Storage for clockRanges and adjustFlags for use with the VidMode ext */ ClockRangePtr clockRanges; int adjustFlags; /* * These can be used when the minor ABI version is incremented. * The NUM_* parameters must be reduced appropriately to keep the * structure size and alignment unchanged. */ int reservedInt[NUM_RESERVED_INTS]; int *entityInstanceList; struct pci_device *vgaDev; void *reservedPtr[NUM_RESERVED_POINTERS]; /* * Driver entry points. * */ xf86ProbeProc *Probe; xf86PreInitProc *PreInit; xf86ScreenInitProc *ScreenInit; xf86SwitchModeProc *SwitchMode; xf86AdjustFrameProc *AdjustFrame; xf86EnterVTProc *EnterVT; xf86LeaveVTProc *LeaveVT; xf86FreeScreenProc *FreeScreen; xf86ValidModeProc *ValidMode; xf86EnableDisableFBAccessProc *EnableDisableFBAccess; xf86SetDGAModeProc *SetDGAMode; xf86ChangeGammaProc *ChangeGamma; xf86PointerMovedProc *PointerMoved; xf86PMEventProc *PMEvent; xf86DPMSSetProc *DPMSSet; xf86LoadPaletteProc *LoadPalette; xf86SetOverscanProc *SetOverscan; xorgDriverFuncProc *DriverFunc; xf86ModeSetProc *ModeSet; /* * This can be used when the minor ABI version is incremented. * The NUM_* parameter must be reduced appropriately to keep the * structure size and alignment unchanged. */ funcPointer reservedFuncs[NUM_RESERVED_FUNCS]; Bool is_gpu; uint32_t capabilities; } ScrnInfoRec; typedef struct { Bool (*OpenFramebuffer) (ScrnInfoPtr pScrn, char **name, unsigned char **mem, int *size, int *offset, int *extra); void (*CloseFramebuffer) (ScrnInfoPtr pScrn); Bool (*SetMode) (ScrnInfoPtr pScrn, DGAModePtr pMode); void (*SetViewport) (ScrnInfoPtr pScrn, int x, int y, int flags); int (*GetViewport) (ScrnInfoPtr pScrn); void (*Sync) (ScrnInfoPtr); void (*FillRect) (ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color); void (*BlitRect) (ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx, int dsty); void (*BlitTransRect) (ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long color); } DGAFunctionRec, *DGAFunctionPtr; typedef struct _SymTabRec { int token; /* id of the token */ const char *name; /* token name */ } SymTabRec, *SymTabPtr; /* flags for xf86LookupMode */ typedef enum { LOOKUP_DEFAULT = 0, /* Use default mode lookup method */ LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */ LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */ LOOKUP_LIST_ORDER, /* Pick first useful mode in list */ LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */ LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */ } LookupModeFlags; #define NoDepth24Support 0x00 #define Support24bppFb 0x01 /* 24bpp framebuffer supported */ #define Support32bppFb 0x02 /* 32bpp framebuffer supported */ #define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */ #define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */ #define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */ #define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */ /* For DPMS */ typedef void (*DPMSSetProcPtr) (ScrnInfoPtr, int, int); /* Input handler proc */ typedef void (*InputHandlerProc) (int fd, void *data); /* These are used by xf86GetClocks */ #define CLK_REG_SAVE -1 #define CLK_REG_RESTORE -2 /* * misc constants */ #define INTERLACE_REFRESH_WEIGHT 1.5 #define SYNC_TOLERANCE 0.01 /* 1 percent */ #define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */ #define OVERLAY_8_32_DUALFB 0x00000001 #define OVERLAY_8_24_DUALFB 0x00000002 #define OVERLAY_8_16_DUALFB 0x00000004 #define OVERLAY_8_32_PLANAR 0x00000008 /* Values of xf86Info.mouseFlags */ #define MF_CLEAR_DTR 1 #define MF_CLEAR_RTS 2 /* Action Events */ typedef enum { ACTION_TERMINATE = 0, /* Terminate Server */ ACTION_NEXT_MODE = 10, /* Switch to next video mode */ ACTION_PREV_MODE, ACTION_SWITCHSCREEN = 100, /* VT switch */ ACTION_SWITCHSCREEN_NEXT, ACTION_SWITCHSCREEN_PREV, } ActionEvent; #endif /* _XF86STR_H */ xorg-server-1.17.1/hw/xfree86/common/xf86Config.h0000664000175100017510000000455612274325511016314 00000000000000 /* * Copyright (c) 1997-2000 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _xf86_config_h #define _xf86_config_h #include "xf86Optrec.h" #include "xf86Parser.h" #include "xf86str.h" #ifdef HAVE_PARSER_DECLS /* * global structure that holds the result of parsing the config file */ extern _X_EXPORT XF86ConfigPtr xf86configptr; #endif typedef enum _ConfigStatus { CONFIG_OK = 0, CONFIG_PARSE_ERROR, CONFIG_NOFILE } ConfigStatus; typedef struct _ModuleDefault { const char *name; Bool toLoad; XF86OptionPtr load_opt; } ModuleDefault; /* * prototypes */ const char **xf86ModulelistFromConfig(void ***); const char **xf86DriverlistFromConfig(void); const char **xf86DriverlistFromCompile(void); const char **xf86InputDriverlistFromConfig(void); Bool xf86BuiltinInputDriver(const char *); ConfigStatus xf86HandleConfigFile(Bool); Bool xf86AutoConfig(void); GDevPtr autoConfigDevice(GDevPtr preconf_device); #endif /* _xf86_config_h */ xorg-server-1.17.1/hw/xfree86/common/xf86Configure.c0000664000175100017510000006512712456571574017042 00000000000000/* * Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales. * * 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 Alan Hourihane not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Alan Hourihane makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL ALAN HOURIHANE 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. * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86Config.h" #include "xf86_OSlib.h" #include "xf86Priv.h" #define IN_XSERVER #include "Configint.h" #include "xf86DDC.h" #include "xf86pciBus.h" #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) #include "xf86Bus.h" #include "xf86Sbus.h" #endif #include "misc.h" typedef struct _DevToConfig { GDevRec GDev; struct pci_device *pVideo; #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) sbusDevicePtr sVideo; #endif int iDriver; } DevToConfigRec, *DevToConfigPtr; static DevToConfigPtr DevToConfig = NULL; static int nDevToConfig = 0, CurrentDriver; xf86MonPtr ConfiguredMonitor; Bool xf86DoConfigurePass1 = TRUE; static Bool foundMouse = FALSE; #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) static const char *DFLT_MOUSE_DEV = "/dev/sysmouse"; static const char *DFLT_MOUSE_PROTO = "auto"; #elif defined(linux) static const char *DFLT_MOUSE_DEV = "/dev/input/mice"; static const char *DFLT_MOUSE_PROTO = "auto"; #elif defined(WSCONS_SUPPORT) static const char *DFLT_MOUSE_DEV = "/dev/wsmouse"; static const char *DFLT_MOUSE_PROTO = "wsmouse"; #else static const char *DFLT_MOUSE_DEV = "/dev/mouse"; static const char *DFLT_MOUSE_PROTO = "auto"; #endif /* * This is called by the driver, either through xf86Match???Instances() or * directly. We allocate a GDevRec and fill it in as much as we can, letting * the caller fill in the rest and/or change it as it sees fit. */ GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset) { int ret, i, j; char *lower_driver; if (!xf86DoConfigure || !xf86DoConfigurePass1) return NULL; /* Check for duplicates */ for (i = 0; i < nDevToConfig; i++) { switch (bus) { #ifdef XSERVER_LIBPCIACCESS case BUS_PCI: ret = xf86PciConfigure(busData, DevToConfig[i].pVideo); break; #endif #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: ret = xf86SbusConfigure(busData, DevToConfig[i].sVideo); break; #endif default: return NULL; } if (ret == 0) goto out; } /* Allocate new structure occurrence */ i = nDevToConfig++; DevToConfig = xnfrealloc(DevToConfig, nDevToConfig * sizeof(DevToConfigRec)); memset(DevToConfig + i, 0, sizeof(DevToConfigRec)); DevToConfig[i].GDev.chipID = DevToConfig[i].GDev.chipRev = DevToConfig[i].GDev.irq = -1; DevToConfig[i].iDriver = CurrentDriver; /* Fill in what we know, converting the driver name to lower case */ lower_driver = xnfalloc(strlen(driver) + 1); for (j = 0; (lower_driver[j] = tolower(driver[j])); j++); DevToConfig[i].GDev.driver = lower_driver; switch (bus) { #ifdef XSERVER_LIBPCIACCESS case BUS_PCI: DevToConfig[i].pVideo = busData; xf86PciConfigureNewDev(busData, DevToConfig[i].pVideo, &DevToConfig[i].GDev, &chipset); break; #endif #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: DevToConfig[i].sVideo = busData; xf86SbusConfigureNewDev(busData, DevToConfig[i].sVideo, &DevToConfig[i].GDev); break; #endif default: break; } /* Get driver's available options */ if (xf86DriverList[CurrentDriver]->AvailableOptions) DevToConfig[i].GDev.options = (OptionInfoPtr) (*xf86DriverList[CurrentDriver]->AvailableOptions) (chipset, bus); return &DevToConfig[i].GDev; out: return NULL; } static XF86ConfInputPtr configureInputSection(void) { XF86ConfInputPtr mouse = NULL; parsePrologue(XF86ConfInputPtr, XF86ConfInputRec) ptr->inp_identifier = xnfstrdup("Keyboard0"); ptr->inp_driver = xnfstrdup("kbd"); ptr->list.next = NULL; /* Crude mechanism to auto-detect mouse (os dependent) */ { int fd; fd = open(DFLT_MOUSE_DEV, 0); if (fd != -1) { foundMouse = TRUE; close(fd); } } mouse = calloc(1, sizeof(XF86ConfInputRec)); mouse->inp_identifier = xnfstrdup("Mouse0"); mouse->inp_driver = xnfstrdup("mouse"); mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, xnfstrdup("Protocol"), xnfstrdup(DFLT_MOUSE_PROTO)); mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, xnfstrdup("Device"), xnfstrdup(DFLT_MOUSE_DEV)); mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, xnfstrdup("ZAxisMapping"), xnfstrdup("4 5 6 7")); ptr = (XF86ConfInputPtr) xf86addListItem((glp) ptr, (glp) mouse); return ptr; } static XF86ConfScreenPtr configureScreenSection(int screennum) { int i; int depths[] = { 1, 4, 8, 15, 16, 24 /*, 32 */ }; char *tmp; parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec) XNFasprintf(&tmp, "Screen%d", screennum); ptr->scrn_identifier = tmp; XNFasprintf(&tmp, "Monitor%d", screennum); ptr->scrn_monitor_str = tmp; XNFasprintf(&tmp, "Card%d", screennum); ptr->scrn_device_str = tmp; for (i = 0; i < sizeof(depths) / sizeof(depths[0]); i++) { XF86ConfDisplayPtr conf_display; conf_display = calloc(1, sizeof(XF86ConfDisplayRec)); conf_display->disp_depth = depths[i]; conf_display->disp_black.red = conf_display->disp_white.red = -1; conf_display->disp_black.green = conf_display->disp_white.green = -1; conf_display->disp_black.blue = conf_display->disp_white.blue = -1; ptr->scrn_display_lst = (XF86ConfDisplayPtr) xf86addListItem((glp) ptr-> scrn_display_lst, (glp) conf_display); } return ptr; } static const char * optionTypeToString(OptionValueType type) { switch (type) { case OPTV_NONE: return ""; case OPTV_INTEGER: return ""; case OPTV_STRING: return ""; case OPTV_ANYSTR: return "[]"; case OPTV_REAL: return ""; case OPTV_BOOLEAN: return "[]"; case OPTV_FREQ: return ""; case OPTV_PERCENT: return ""; default: return ""; } } static XF86ConfDevicePtr configureDeviceSection(int screennum) { OptionInfoPtr p; int i = 0; char *identifier; parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec) /* Move device info to parser structure */ if (asprintf(&identifier, "Card%d", screennum) == -1) identifier = NULL; ptr->dev_identifier = identifier; ptr->dev_chipset = DevToConfig[screennum].GDev.chipset; ptr->dev_busid = DevToConfig[screennum].GDev.busID; ptr->dev_driver = DevToConfig[screennum].GDev.driver; ptr->dev_ramdac = DevToConfig[screennum].GDev.ramdac; for (i = 0; (i < MAXDACSPEEDS) && (i < CONF_MAXDACSPEEDS); i++) ptr->dev_dacSpeeds[i] = DevToConfig[screennum].GDev.dacSpeeds[i]; ptr->dev_videoram = DevToConfig[screennum].GDev.videoRam; ptr->dev_bios_base = DevToConfig[screennum].GDev.BiosBase; ptr->dev_mem_base = DevToConfig[screennum].GDev.MemBase; ptr->dev_io_base = DevToConfig[screennum].GDev.IOBase; ptr->dev_clockchip = DevToConfig[screennum].GDev.clockchip; for (i = 0; (i < MAXCLOCKS) && (i < DevToConfig[screennum].GDev.numclocks); i++) ptr->dev_clock[i] = DevToConfig[screennum].GDev.clock[i]; ptr->dev_clocks = i; ptr->dev_chipid = DevToConfig[screennum].GDev.chipID; ptr->dev_chiprev = DevToConfig[screennum].GDev.chipRev; ptr->dev_irq = DevToConfig[screennum].GDev.irq; /* Make sure older drivers don't segv */ if (DevToConfig[screennum].GDev.options) { /* Fill in the available driver options for people to use */ const char *descrip = " ### Available Driver options are:-\n" " ### Values: : integer, : float, " ": \"True\"/\"False\",\n" " ### : \"String\", : \" Hz/kHz/MHz\",\n" " ### : \"%\"\n" " ### [arg]: arg optional\n"; ptr->dev_comment = xnfstrdup(descrip); if (ptr->dev_comment) { for (p = DevToConfig[screennum].GDev.options; p->name != NULL; p++) { char *p_e; const char *prefix = " #Option "; const char *middle = " \t# "; const char *suffix = "\n"; const char *opttype = optionTypeToString(p->type); char *optname; int len = strlen(ptr->dev_comment) + strlen(prefix) + strlen(middle) + strlen(suffix) + 1; if (asprintf(&optname, "\"%s\"", p->name) == -1) break; len += max(20, strlen(optname)); len += strlen(opttype); ptr->dev_comment = realloc(ptr->dev_comment, len); if (!ptr->dev_comment) break; p_e = ptr->dev_comment + strlen(ptr->dev_comment); sprintf(p_e, "%s%-20s%s%s%s", prefix, optname, middle, opttype, suffix); free(optname); } } } return ptr; } static XF86ConfLayoutPtr configureLayoutSection(void) { int scrnum = 0; parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec) ptr->lay_identifier = "X.org Configured"; { XF86ConfInputrefPtr iptr; iptr = malloc(sizeof(XF86ConfInputrefRec)); iptr->list.next = NULL; iptr->iref_option_lst = NULL; iptr->iref_inputdev_str = xnfstrdup("Mouse0"); iptr->iref_option_lst = xf86addNewOption(iptr->iref_option_lst, xnfstrdup("CorePointer"), NULL); ptr->lay_input_lst = (XF86ConfInputrefPtr) xf86addListItem((glp) ptr->lay_input_lst, (glp) iptr); } { XF86ConfInputrefPtr iptr; iptr = malloc(sizeof(XF86ConfInputrefRec)); iptr->list.next = NULL; iptr->iref_option_lst = NULL; iptr->iref_inputdev_str = xnfstrdup("Keyboard0"); iptr->iref_option_lst = xf86addNewOption(iptr->iref_option_lst, xnfstrdup("CoreKeyboard"), NULL); ptr->lay_input_lst = (XF86ConfInputrefPtr) xf86addListItem((glp) ptr->lay_input_lst, (glp) iptr); } for (scrnum = 0; scrnum < nDevToConfig; scrnum++) { XF86ConfAdjacencyPtr aptr; char *tmp; aptr = malloc(sizeof(XF86ConfAdjacencyRec)); aptr->list.next = NULL; aptr->adj_x = 0; aptr->adj_y = 0; aptr->adj_scrnum = scrnum; XNFasprintf(&tmp, "Screen%d", scrnum); aptr->adj_screen_str = tmp; if (scrnum == 0) { aptr->adj_where = CONF_ADJ_ABSOLUTE; aptr->adj_refscreen = NULL; } else { aptr->adj_where = CONF_ADJ_RIGHTOF; XNFasprintf(&tmp, "Screen%d", scrnum - 1); aptr->adj_refscreen = tmp; } ptr->lay_adjacency_lst = (XF86ConfAdjacencyPtr) xf86addListItem((glp) ptr->lay_adjacency_lst, (glp) aptr); } return ptr; } static XF86ConfFlagsPtr configureFlagsSection(void) { parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec) return ptr; } static XF86ConfModulePtr configureModuleSection(void) { const char **elist, **el; /* Find the list of extension & font modules. */ const char *esubdirs[] = { "extensions", "fonts", NULL }; parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec) elist = LoaderListDirs(esubdirs, NULL); if (elist) { for (el = elist; *el; el++) { XF86LoadPtr module; module = calloc(1, sizeof(XF86LoadRec)); module->load_name = *el; ptr->mod_load_lst = (XF86LoadPtr) xf86addListItem((glp) ptr-> mod_load_lst, (glp) module); } free(elist); } return ptr; } static XF86ConfFilesPtr configureFilesSection(void) { parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec) if (xf86ModulePath) ptr->file_modulepath = xnfstrdup(xf86ModulePath); if (defaultFontPath) ptr->file_fontpath = xnfstrdup(defaultFontPath); return ptr; } static XF86ConfMonitorPtr configureMonitorSection(int screennum) { char *tmp; parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec) XNFasprintf(&tmp, "Monitor%d", screennum); ptr->mon_identifier = tmp; ptr->mon_vendor = xnfstrdup("Monitor Vendor"); ptr->mon_modelname = xnfstrdup("Monitor Model"); return ptr; } /* Initialize Configure Monitor from Detailed Timing Block */ static void handle_detailed_input(struct detailed_monitor_section *det_mon, void *data) { XF86ConfMonitorPtr ptr = (XF86ConfMonitorPtr) data; switch (det_mon->type) { case DS_NAME: ptr->mon_modelname = realloc(ptr->mon_modelname, strlen((char *) (det_mon->section.name)) + 1); strcpy(ptr->mon_modelname, (char *) (det_mon->section.name)); break; case DS_RANGES: ptr->mon_hsync[ptr->mon_n_hsync].lo = det_mon->section.ranges.min_h; ptr->mon_hsync[ptr->mon_n_hsync].hi = det_mon->section.ranges.max_h; ptr->mon_n_vrefresh = 1; ptr->mon_vrefresh[ptr->mon_n_hsync].lo = det_mon->section.ranges.min_v; ptr->mon_vrefresh[ptr->mon_n_hsync].hi = det_mon->section.ranges.max_v; ptr->mon_n_hsync++; default: break; } } static XF86ConfMonitorPtr configureDDCMonitorSection(int screennum) { int len, mon_width, mon_height; #define displaySizeMaxLen 80 char displaySize_string[displaySizeMaxLen]; int displaySizeLen; char *tmp; parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec) XNFasprintf(&tmp, "Monitor%d", screennum); ptr->mon_identifier = tmp; ptr->mon_vendor = xnfstrdup(ConfiguredMonitor->vendor.name); XNFasprintf(&ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id); /* features in centimetres, we want millimetres */ mon_width = 10 * ConfiguredMonitor->features.hsize; mon_height = 10 * ConfiguredMonitor->features.vsize; #ifdef CONFIGURE_DISPLAYSIZE ptr->mon_width = mon_width; ptr->mon_height = mon_height; #else if (mon_width && mon_height) { /* when values available add DisplaySize option AS A COMMENT */ displaySizeLen = snprintf(displaySize_string, displaySizeMaxLen, "\t#DisplaySize\t%5d %5d\t# mm\n", mon_width, mon_height); if (displaySizeLen > 0 && displaySizeLen < displaySizeMaxLen) { if (ptr->mon_comment) { len = strlen(ptr->mon_comment); } else { len = 0; } if ((ptr->mon_comment = realloc(ptr->mon_comment, len + strlen(displaySize_string) + 1))) { strcpy(ptr->mon_comment + len, displaySize_string); } } } #endif /* def CONFIGURE_DISPLAYSIZE */ xf86ForEachDetailedBlock(ConfiguredMonitor, handle_detailed_input, ptr); if (ConfiguredMonitor->features.dpms) { ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xnfstrdup("DPMS"), NULL); } return ptr; } void DoConfigure(void) { int i, j, screennum = -1; const char *home = NULL; char filename[PATH_MAX]; const char *addslash = ""; XF86ConfigPtr xf86config = NULL; const char **vlist, **vl; int *dev2screen; vlist = xf86DriverlistFromCompile(); if (!vlist) { ErrorF("Missing output drivers. Configuration failed.\n"); goto bail; } ErrorF("List of video drivers:\n"); for (vl = vlist; *vl; vl++) ErrorF("\t%s\n", *vl); /* Load all the drivers that were found. */ xf86LoadModules(vlist, NULL); free(vlist); 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++) { Bool found_screen; DriverRec *const drv = xf86DriverList[CurrentDriver]; found_screen = xf86CallDriverProbe(drv, TRUE); if (found_screen && drv->Identify) { (*drv->Identify) (0); } } if (nDevToConfig <= 0) { ErrorF("No devices to configure. Configuration failed.\n"); goto bail; } /* Add device, monitor and screen sections for detected devices */ for (screennum = 0; screennum < nDevToConfig; screennum++) { XF86ConfDevicePtr device_ptr; XF86ConfMonitorPtr monitor_ptr; XF86ConfScreenPtr screen_ptr; device_ptr = configureDeviceSection(screennum); xf86config->conf_device_lst = (XF86ConfDevicePtr) xf86addListItem((glp) xf86config-> conf_device_lst, (glp) device_ptr); monitor_ptr = configureMonitorSection(screennum); xf86config->conf_monitor_lst = (XF86ConfMonitorPtr) xf86addListItem((glp) xf86config->conf_monitor_lst, (glp) monitor_ptr); screen_ptr = configureScreenSection(screennum); xf86config->conf_screen_lst = (XF86ConfScreenPtr) xf86addListItem((glp) xf86config-> conf_screen_lst, (glp) screen_ptr); } xf86config->conf_files = configureFilesSection(); xf86config->conf_modules = configureModuleSection(); xf86config->conf_flags = configureFlagsSection(); xf86config->conf_videoadaptor_lst = NULL; xf86config->conf_modes_lst = NULL; xf86config->conf_vendor_lst = NULL; xf86config->conf_dri = NULL; xf86config->conf_input_lst = configureInputSection(); xf86config->conf_layout_lst = configureLayoutSection(); home = getenv("HOME"); if ((home == NULL) || (home[0] == '\0')) { home = "/"; } else { /* Determine if trailing slash is present or needed */ int l = strlen(home); if (home[l - 1] != '/') { addslash = "/"; } } snprintf(filename, sizeof(filename), "%s%s" XF86CONFIGFILE ".new", home, addslash); if (xf86writeConfigFile(filename, xf86config) == 0) { xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n", filename, strerror(errno)); goto bail; } xf86DoConfigurePass1 = FALSE; /* Try to get DDC information filled in */ xf86ConfigFile = filename; if (xf86HandleConfigFile(FALSE) != CONFIG_OK) { goto bail; } xf86DoConfigurePass1 = FALSE; dev2screen = xnfcalloc(1, xf86NumDrivers * sizeof(int)); { Bool *driverProbed = xnfcalloc(1, xf86NumDrivers * sizeof(Bool)); for (screennum = 0; screennum < nDevToConfig; screennum++) { int k, l, n, oldNumScreens; i = DevToConfig[screennum].iDriver; if (driverProbed[i]) continue; driverProbed[i] = TRUE; oldNumScreens = xf86NumScreens; xf86CallDriverProbe(xf86DriverList[i], FALSE); /* reorder */ k = screennum > 0 ? screennum : 1; for (l = oldNumScreens; l < xf86NumScreens; l++) { /* is screen primary? */ Bool primary = FALSE; for (n = 0; n < xf86Screens[l]->numEntities; n++) { if (xf86IsEntityPrimary(xf86Screens[l]->entityList[n])) { dev2screen[0] = l; primary = TRUE; break; } } if (primary) continue; /* not primary: assign it to next device of same driver */ /* * NOTE: we assume that devices in DevToConfig * and xf86Screens[] have the same order except * for the primary device which always comes first. */ for (; k < nDevToConfig; k++) { if (DevToConfig[k].iDriver == i) { dev2screen[k++] = l; break; } } } } free(driverProbed); } if (nDevToConfig != xf86NumScreens) { ErrorF("Number of created screens does not match number of detected" " devices.\n Configuration failed.\n"); goto bail; } xf86PostProbe(); for (j = 0; j < xf86NumScreens; j++) { xf86Screens[j]->scrnIndex = j; } xf86freeMonitorList(xf86config->conf_monitor_lst); xf86config->conf_monitor_lst = NULL; xf86freeScreenList(xf86config->conf_screen_lst); xf86config->conf_screen_lst = NULL; for (j = 0; j < xf86NumScreens; j++) { XF86ConfMonitorPtr monitor_ptr; XF86ConfScreenPtr screen_ptr; ConfiguredMonitor = NULL; if ((*xf86Screens[dev2screen[j]]->PreInit) (xf86Screens[dev2screen[j]], PROBE_DETECT) && ConfiguredMonitor) { monitor_ptr = configureDDCMonitorSection(j); } else { monitor_ptr = configureMonitorSection(j); } screen_ptr = configureScreenSection(j); xf86config->conf_monitor_lst = (XF86ConfMonitorPtr) xf86addListItem((glp) xf86config->conf_monitor_lst, (glp) monitor_ptr); xf86config->conf_screen_lst = (XF86ConfScreenPtr) xf86addListItem((glp) xf86config-> conf_screen_lst, (glp) screen_ptr); } if (xf86writeConfigFile(filename, xf86config) == 0) { xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n", filename, strerror(errno)); goto bail; } ErrorF("\n"); if (!foundMouse) { ErrorF("\n" __XSERVERNAME__ " is not able to detect your mouse.\n" "Edit the file and correct the Device.\n"); } else { ErrorF("\n" __XSERVERNAME__ " detected your mouse at device %s.\n" "Please check your config if the mouse is still not\n" "operational, as by default " __XSERVERNAME__ " tries to autodetect\n" "the protocol.\n", DFLT_MOUSE_DEV); } if (xf86NumScreens > 1) { ErrorF("\n" __XSERVERNAME__ " has configured a multihead system, please check your config.\n"); } ErrorF("\nYour %s file is %s\n\n", XF86CONFIGFILE, filename); ErrorF("To test the server, run 'X -config %s'\n\n", filename); bail: OsCleanup(TRUE); AbortDDX(EXIT_ERR_CONFIGURE); fflush(stderr); exit(0); } /* Xorg -showopts: * For each driver module installed, print out the list * of options and their argument types, then exit * * Author: Marcus Schaefer, ms@suse.de */ void DoShowOptions(void) { int i = 0; const char **vlist = NULL; char *pSymbol = 0; XF86ModuleData *initData = 0; if (!(vlist = xf86DriverlistFromCompile())) { ErrorF("Missing output drivers\n"); goto bail; } xf86LoadModules(vlist, 0); free(vlist); for (i = 0; i < xf86NumDrivers; i++) { if (xf86DriverList[i]->AvailableOptions) { const OptionInfoRec *pOption = (*xf86DriverList[i]->AvailableOptions) (0, 0); if (!pOption) { ErrorF("(EE) Couldn't read option table for %s driver\n", xf86DriverList[i]->driverName); continue; } XNFasprintf(&pSymbol, "%sModuleData", xf86DriverList[i]->driverName); initData = LoaderSymbol(pSymbol); if (initData) { XF86ModuleVersionInfo *vers = initData->vers; const OptionInfoRec *p; ErrorF("Driver[%d]:%s[%s] {\n", i, xf86DriverList[i]->driverName, vers->vendor); for (p = pOption; p->name != NULL; p++) { ErrorF("\t%s:%s\n", p->name, optionTypeToString(p->type)); } ErrorF("}\n"); } } } bail: OsCleanup(TRUE); AbortDDX(EXIT_ERR_DRIVERS); fflush(stderr); exit(0); } xorg-server-1.17.1/hw/xfree86/common/xf86xvmc.h0000664000175100017510000001316212456571574016073 00000000000000 /* * Copyright (c) 2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifndef _XF86XVMC_H #define _XF86XVMC_H #include "xvmcext.h" #include "xf86xv.h" typedef struct { int num_xvimages; int *xvimage_ids; /* reference the subpictures in the XF86MCAdaptorRec */ } XF86MCImageIDList; typedef struct { int surface_type_id; /* Driver generated. Must be unique on the port */ int chroma_format; int color_description; /* no longer used */ unsigned short max_width; unsigned short max_height; unsigned short subpicture_max_width; unsigned short subpicture_max_height; int mc_type; int flags; XF86MCImageIDList *compatible_subpictures; /* can be null, if none */ } XF86MCSurfaceInfoRec, *XF86MCSurfaceInfoPtr; /* xf86XvMCCreateContextProc DIX will fill everything out in the context except the driver_priv. The port_priv holds the private data specified for the port when Xv was initialized by the driver. The driver may store whatever it wants in driver_priv and edit the width, height and flags. If the driver wants to return something to the client it can allocate space in priv and specify the number of 32 bit words in num_priv. This must be dynamically allocated space because DIX will free it after it passes it to the client. */ typedef int (*xf86XvMCCreateContextProcPtr) (ScrnInfoPtr pScrn, XvMCContextPtr context, int *num_priv, CARD32 **priv); typedef void (*xf86XvMCDestroyContextProcPtr) (ScrnInfoPtr pScrn, XvMCContextPtr context); /* xf86XvMCCreateSurfaceProc DIX will fill everything out in the surface except the driver_priv. The driver may store whatever it wants in driver_priv. The driver may pass data back to the client in the same manner as the xf86XvMCCreateContextProc. */ typedef int (*xf86XvMCCreateSurfaceProcPtr) (ScrnInfoPtr pScrn, XvMCSurfacePtr surface, int *num_priv, CARD32 **priv); typedef void (*xf86XvMCDestroySurfaceProcPtr) (ScrnInfoPtr pScrn, XvMCSurfacePtr surface); /* xf86XvMCCreateSubpictureProc DIX will fill everything out in the subpicture except the driver_priv, num_palette_entries, entry_bytes and component_order. The driver may store whatever it wants in driver_priv and edit the width and height. If it is a paletted subpicture the driver needs to fill out the num_palette_entries, entry_bytes and component_order. These are not communicated to the client until the time the surface is created. The driver may pass data back to the client in the same manner as the xf86XvMCCreateContextProc. */ typedef int (*xf86XvMCCreateSubpictureProcPtr) (ScrnInfoPtr pScrn, XvMCSubpicturePtr subpicture, int *num_priv, CARD32 **priv); typedef void (*xf86XvMCDestroySubpictureProcPtr) (ScrnInfoPtr pScrn, XvMCSubpicturePtr subpicture); typedef struct { const char *name; int num_surfaces; XF86MCSurfaceInfoPtr *surfaces; int num_subpictures; XF86ImagePtr *subpictures; xf86XvMCCreateContextProcPtr CreateContext; xf86XvMCDestroyContextProcPtr DestroyContext; xf86XvMCCreateSurfaceProcPtr CreateSurface; xf86XvMCDestroySurfaceProcPtr DestroySurface; xf86XvMCCreateSubpictureProcPtr CreateSubpicture; xf86XvMCDestroySubpictureProcPtr DestroySubpicture; } XF86MCAdaptorRec, *XF86MCAdaptorPtr; /* xf86XvMCScreenInit Unlike Xv, the adaptor data is not copied from this structure. This structure's data is used so it must stick around for the life of the server. Note that it's an array of pointers not an array of structures. */ extern _X_EXPORT Bool xf86XvMCScreenInit(ScreenPtr pScreen, int num_adaptors, XF86MCAdaptorPtr * adaptors); extern _X_EXPORT XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec(void); extern _X_EXPORT void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor); #endif /* _XF86XVMC_H */ xorg-server-1.17.1/hw/xfree86/common/xf86Globals.c0000664000175100017510000001512012414702051016444 00000000000000 /* * 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). */ /* * This file contains all the XFree86 global variables. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "windowstr.h" #include "propertyst.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86Parser.h" #include "xf86Xinput.h" #include "xf86InPriv.h" #include "xf86Config.h" /* Globals that video drivers may access */ 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, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, }; /* Globals that input drivers may access */ InputInfoPtr xf86InputDevs = NULL; /* Globals that video drivers may not access */ xf86InfoRec xf86Info = { .consoleFd = -1, .vtno = -1, .lastEventTime = -1, .vtRequestsPending = FALSE, #ifdef sun .vtPendingNum = -1, #endif .dontVTSwitch = FALSE, .autoVTSwitch = TRUE, .ShareVTs = FALSE, .dontZap = FALSE, .dontZoom = FALSE, .notrapSignals = FALSE, .caughtSignal = FALSE, .currentScreen = NULL, #ifdef CSRG_BASED .consType = -1, #endif .allowMouseOpenFail = FALSE, .vidModeEnabled = TRUE, .vidModeAllowNonLocal = FALSE, .miscModInDevEnabled = TRUE, .miscModInDevAllowNonLocal = FALSE, .pixmap24 = Pix24DontCare, .pix24From = X_DEFAULT, .pmFlag = TRUE, .disableRandR = FALSE, .randRFrom = X_DEFAULT, #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) .forceInputDevices = FALSE, .autoAddDevices = TRUE, .autoEnableDevices = TRUE, #else .forceInputDevices = TRUE, .autoAddDevices = FALSE, .autoEnableDevices = FALSE, #endif #if defined(CONFIG_UDEV_KMS) .autoAddGPU = TRUE, #else .autoAddGPU = FALSE, #endif }; const char *xf86ConfigFile = NULL; const char *xf86ConfigDir = NULL; const char *xf86ModulePath = DEFAULT_MODULE_PATH; MessageType xf86ModPathFrom = X_DEFAULT; const char *xf86LogFile = DEFAULT_LOGDIR "/" DEFAULT_LOGPREFIX; MessageType xf86LogFileFrom = X_DEFAULT; Bool xf86LogFileWasOpened = FALSE; serverLayoutRec xf86ConfigLayout = { NULL, }; confDRIRec xf86ConfigDRI = { 0, }; XF86ConfigPtr xf86configptr = NULL; Bool xf86Resetting = FALSE; Bool xf86Initialising = FALSE; Bool xf86DoConfigure = FALSE; Bool xf86DoShowOptions = FALSE; DriverPtr *xf86DriverList = NULL; int xf86NumDrivers = 0; InputDriverPtr *xf86InputDriverList = NULL; int xf86NumInputDrivers = 0; int xf86NumScreens = 0; int xf86NumGPUScreens = 0; const char *xf86VisualNames[] = { "StaticGray", "GrayScale", "StaticColor", "PseudoColor", "TrueColor", "DirectColor" }; /* Parameters set only from the command line */ const char *xf86ServerName = "no-name"; Bool xf86fpFlag = FALSE; Bool xf86sFlag = FALSE; Bool xf86bsEnableFlag = FALSE; Bool xf86bsDisableFlag = FALSE; Bool xf86silkenMouseDisableFlag = FALSE; Bool xf86xkbdirFlag = FALSE; #ifdef HAVE_ACPI Bool xf86acpiDisableFlag = FALSE; #endif char *xf86LayoutName = NULL; char *xf86ScreenName = NULL; char *xf86PointerName = NULL; char *xf86KeyboardName = NULL; int xf86Verbose = DEFAULT_VERBOSE; int xf86LogVerbose = DEFAULT_LOG_VERBOSE; int xf86FbBpp = -1; Pix24Flags xf86Pix24 = Pix24DontCare; int xf86Depth = -1; rgb xf86Weight = { 0, 0, 0 }; Bool xf86FlipPixels = FALSE; Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; Bool xf86AllowMouseOpenFail = FALSE; #ifdef XF86VIDMODE Bool xf86VidModeDisabled = FALSE; Bool xf86VidModeAllowNonLocal = FALSE; #endif RootWinPropPtr *xf86RegisteredPropertiesTable = NULL; Bool xorgHWAccess = FALSE; xorg-server-1.17.1/hw/xfree86/common/xf86VidMode.c0000664000175100017510000003730412366220413016423 00000000000000/* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file contains the VidMode functions required by the extension. * These have been added to avoid the need for the higher level extension * code to access the private XFree86 data structures directly. Wherever * possible this code uses the functions in xf86Mode.c to do the work, * so that two version of code that do similar things don't have to be * maintained. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #ifdef XF86VIDMODE #include "vidmodeproc.h" #include "xf86cmap.h" static DevPrivateKeyRec VidModeKeyRec; static DevPrivateKey VidModeKey; static int VidModeCount = 0; static Bool VidModeClose(ScreenPtr pScreen); #define VMPTR(p) ((VidModePtr)dixLookupPrivate(&(p)->devPrivates, VidModeKey)) #endif Bool VidModeExtensionInit(ScreenPtr pScreen) { #ifdef XF86VIDMODE VidModePtr pVidMode; if (!xf86GetVidModeEnabled()) { DebugF("!xf86GetVidModeEnabled()\n"); return FALSE; } VidModeKey = &VidModeKeyRec; if (!dixRegisterPrivateKey(&VidModeKeyRec, PRIVATE_SCREEN, 0)) return FALSE; pVidMode = calloc(sizeof(VidModeRec), 1); if (!pVidMode) return FALSE; dixSetPrivate(&pScreen->devPrivates, VidModeKey, pVidMode); pVidMode->Flags = 0; pVidMode->Next = NULL; pVidMode->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = VidModeClose; VidModeCount++; return TRUE; #else DebugF("no vidmode extension\n"); return FALSE; #endif } #ifdef XF86VIDMODE static Bool VidModeClose(ScreenPtr pScreen) { VidModePtr pVidMode = VMPTR(pScreen); /* This shouldn't happen */ if (!pVidMode) return FALSE; pScreen->CloseScreen = pVidMode->CloseScreen; if (--VidModeCount == 0) { free(dixLookupPrivate(&pScreen->devPrivates, VidModeKey)); dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL); VidModeKey = NULL; } return pScreen->CloseScreen(pScreen); } Bool VidModeAvailable(int scrnIndex) { ScrnInfoPtr pScrn; VidModePtr pVidMode; if (VidModeKey == NULL) { DebugF("VidModeKey == NULL\n"); return FALSE; } pScrn = xf86Screens[scrnIndex]; if (pScrn == NULL) { DebugF("pScrn == NULL\n"); return FALSE; } pVidMode = VMPTR(pScrn->pScreen); if (pVidMode) return TRUE; else { DebugF("pVidMode == NULL\n"); return FALSE; } } Bool VidModeGetCurrentModeline(int scrnIndex, void **mode, int *dotClock) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; if (pScrn->currentMode) { *mode = (void *) (pScrn->currentMode); *dotClock = pScrn->currentMode->Clock; return TRUE; } return FALSE; } int VidModeGetDotClock(int scrnIndex, int Clock) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return 0; pScrn = xf86Screens[scrnIndex]; if ((pScrn->progClock) || (Clock >= MAXCLOCKS)) return Clock; else return pScrn->clock[Clock]; } int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return 0; pScrn = xf86Screens[scrnIndex]; if (pScrn->progClock) { *progClock = TRUE; return 0; } else { *progClock = FALSE; return pScrn->numClocks; } } Bool VidModeGetClocks(int scrnIndex, int *Clocks) { ScrnInfoPtr pScrn; int i; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; if (pScrn->progClock) return FALSE; for (i = 0; i < pScrn->numClocks; i++) *Clocks++ = pScrn->clock[i]; return TRUE; } Bool VidModeGetFirstModeline(int scrnIndex, void **mode, int *dotClock) { ScrnInfoPtr pScrn; VidModePtr pVidMode; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; if (pScrn->modes == NULL) return FALSE; pVidMode = VMPTR(pScrn->pScreen); pVidMode->First = pScrn->modes; pVidMode->Next = pVidMode->First->next; if (pVidMode->First->status == MODE_OK) { *mode = (void *) (pVidMode->First); *dotClock = VidModeGetDotClock(scrnIndex, pVidMode->First->Clock); return TRUE; } return VidModeGetNextModeline(scrnIndex, mode, dotClock); } Bool VidModeGetNextModeline(int scrnIndex, void **mode, int *dotClock) { ScrnInfoPtr pScrn; VidModePtr pVidMode; DisplayModePtr p; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; pVidMode = VMPTR(pScrn->pScreen); for (p = pVidMode->Next; p != NULL && p != pVidMode->First; p = p->next) { if (p->status == MODE_OK) { pVidMode->Next = p->next; *mode = (void *) p; *dotClock = VidModeGetDotClock(scrnIndex, p->Clock); return TRUE; } } return FALSE; } Bool VidModeDeleteModeline(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return FALSE; pScrn = xf86Screens[scrnIndex]; xf86DeleteMode(&(pScrn->modes), (DisplayModePtr) mode); return TRUE; } Bool VidModeZoomViewport(int scrnIndex, int zoom) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; xf86ZoomViewport(pScrn->pScreen, zoom); return TRUE; } Bool VidModeSetViewPort(int scrnIndex, int x, int y) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; pScrn->frameX0 = min(max(x, 0), pScrn->virtualX - pScrn->currentMode->HDisplay); pScrn->frameX1 = pScrn->frameX0 + pScrn->currentMode->HDisplay - 1; pScrn->frameY0 = min(max(y, 0), pScrn->virtualY - pScrn->currentMode->VDisplay); pScrn->frameY1 = pScrn->frameY0 + pScrn->currentMode->VDisplay - 1; if (pScrn->AdjustFrame != NULL) (pScrn->AdjustFrame) (pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } Bool VidModeGetViewPort(int scrnIndex, int *x, int *y) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; *x = pScrn->frameX0; *y = pScrn->frameY0; return TRUE; } Bool VidModeSwitchMode(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; DisplayModePtr pTmpMode; Bool retval; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; /* save in case we fail */ pTmpMode = pScrn->currentMode; /* Force a mode switch */ pScrn->currentMode = NULL; retval = xf86SwitchMode(pScrn->pScreen, mode); /* we failed: restore it */ if (retval == FALSE) pScrn->currentMode = pTmpMode; return retval; } Bool VidModeLockZoom(int scrnIndex, Bool lock) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; if (xf86Info.dontZoom) return FALSE; xf86LockZoom(pScrn->pScreen, lock); return TRUE; } Bool VidModeGetMonitor(int scrnIndex, void **monitor) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; *monitor = (void *) (pScrn->monitor); return TRUE; } ModeStatus VidModeCheckModeForMonitor(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return MODE_ERROR; pScrn = xf86Screens[scrnIndex]; return xf86CheckModeForMonitor((DisplayModePtr) mode, pScrn->monitor); } ModeStatus VidModeCheckModeForDriver(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return MODE_ERROR; pScrn = xf86Screens[scrnIndex]; return xf86CheckModeForDriver(pScrn, (DisplayModePtr) mode, 0); } void VidModeSetCrtcForMode(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; DisplayModePtr ScreenModes; if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return; /* Ugly hack so that the xf86Mode.c function can be used without change */ pScrn = xf86Screens[scrnIndex]; ScreenModes = pScrn->modes; pScrn->modes = (DisplayModePtr) mode; xf86SetCrtcForModes(pScrn, pScrn->adjustFlags); pScrn->modes = ScreenModes; return; } Bool VidModeAddModeline(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; if ((mode == NULL) || (!VidModeAvailable(scrnIndex))) return FALSE; pScrn = xf86Screens[scrnIndex]; ((DisplayModePtr) mode)->name = strdup(""); /* freed by deletemode */ ((DisplayModePtr) mode)->status = MODE_OK; ((DisplayModePtr) mode)->next = pScrn->modes->next; ((DisplayModePtr) mode)->prev = pScrn->modes; pScrn->modes->next = (DisplayModePtr) mode; if (((DisplayModePtr) mode)->next != NULL) ((DisplayModePtr) mode)->next->prev = (DisplayModePtr) mode; return TRUE; } int VidModeGetNumOfModes(int scrnIndex) { void *mode = NULL; int dotClock = 0, nummodes = 0; if (!VidModeGetFirstModeline(scrnIndex, &mode, &dotClock)) return nummodes; do { nummodes++; if (!VidModeGetNextModeline(scrnIndex, &mode, &dotClock)) return nummodes; } while (TRUE); } Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue) { ScrnInfoPtr pScrn; Gamma gamma; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; gamma.red = red; gamma.green = green; gamma.blue = blue; if (xf86ChangeGamma(pScrn->pScreen, gamma) != Success) return FALSE; else return TRUE; } Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; *red = pScrn->gamma.red; *green = pScrn->gamma.green; *blue = pScrn->gamma.blue; return TRUE; } Bool VidModeSetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; xf86ChangeGammaRamp(pScrn->pScreen, size, r, g, b); return TRUE; } Bool VidModeGetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b) { ScrnInfoPtr pScrn; if (!VidModeAvailable(scrnIndex)) return FALSE; pScrn = xf86Screens[scrnIndex]; xf86GetGammaRamp(pScrn->pScreen, size, r, g, b); return TRUE; } int VidModeGetGammaRampSize(int scrnIndex) { if (!VidModeAvailable(scrnIndex)) return 0; return xf86GetGammaRampSize(xf86Screens[scrnIndex]->pScreen); } void * VidModeCreateMode(void) { DisplayModePtr mode; mode = malloc(sizeof(DisplayModeRec)); if (mode != NULL) { mode->name = ""; mode->VScan = 1; /* divides refresh rate. default = 1 */ mode->Private = NULL; mode->next = mode; mode->prev = mode; } return mode; } void VidModeCopyMode(void *modefrom, void *modeto) { memcpy(modeto, modefrom, sizeof(DisplayModeRec)); } int VidModeGetModeValue(void *mode, int valtyp) { int ret = 0; switch (valtyp) { case VIDMODE_H_DISPLAY: ret = ((DisplayModePtr) mode)->HDisplay; break; case VIDMODE_H_SYNCSTART: ret = ((DisplayModePtr) mode)->HSyncStart; break; case VIDMODE_H_SYNCEND: ret = ((DisplayModePtr) mode)->HSyncEnd; break; case VIDMODE_H_TOTAL: ret = ((DisplayModePtr) mode)->HTotal; break; case VIDMODE_H_SKEW: ret = ((DisplayModePtr) mode)->HSkew; break; case VIDMODE_V_DISPLAY: ret = ((DisplayModePtr) mode)->VDisplay; break; case VIDMODE_V_SYNCSTART: ret = ((DisplayModePtr) mode)->VSyncStart; break; case VIDMODE_V_SYNCEND: ret = ((DisplayModePtr) mode)->VSyncEnd; break; case VIDMODE_V_TOTAL: ret = ((DisplayModePtr) mode)->VTotal; break; case VIDMODE_FLAGS: ret = ((DisplayModePtr) mode)->Flags; break; case VIDMODE_CLOCK: ret = ((DisplayModePtr) mode)->Clock; break; } return ret; } void VidModeSetModeValue(void *mode, int valtyp, int val) { switch (valtyp) { case VIDMODE_H_DISPLAY: ((DisplayModePtr) mode)->HDisplay = val; break; case VIDMODE_H_SYNCSTART: ((DisplayModePtr) mode)->HSyncStart = val; break; case VIDMODE_H_SYNCEND: ((DisplayModePtr) mode)->HSyncEnd = val; break; case VIDMODE_H_TOTAL: ((DisplayModePtr) mode)->HTotal = val; break; case VIDMODE_H_SKEW: ((DisplayModePtr) mode)->HSkew = val; break; case VIDMODE_V_DISPLAY: ((DisplayModePtr) mode)->VDisplay = val; break; case VIDMODE_V_SYNCSTART: ((DisplayModePtr) mode)->VSyncStart = val; break; case VIDMODE_V_SYNCEND: ((DisplayModePtr) mode)->VSyncEnd = val; break; case VIDMODE_V_TOTAL: ((DisplayModePtr) mode)->VTotal = val; break; case VIDMODE_FLAGS: ((DisplayModePtr) mode)->Flags = val; break; case VIDMODE_CLOCK: ((DisplayModePtr) mode)->Clock = val; break; } return; } vidMonitorValue VidModeGetMonitorValue(void *monitor, int valtyp, int indx) { vidMonitorValue ret = { NULL, }; switch (valtyp) { case VIDMODE_MON_VENDOR: ret.ptr = (((MonPtr) monitor)->vendor); break; case VIDMODE_MON_MODEL: ret.ptr = (((MonPtr) monitor)->model); break; case VIDMODE_MON_NHSYNC: ret.i = ((MonPtr) monitor)->nHsync; break; case VIDMODE_MON_NVREFRESH: ret.i = ((MonPtr) monitor)->nVrefresh; break; case VIDMODE_MON_HSYNC_LO: ret.f = (100.0 * ((MonPtr) monitor)->hsync[indx].lo); break; case VIDMODE_MON_HSYNC_HI: ret.f = (100.0 * ((MonPtr) monitor)->hsync[indx].hi); break; case VIDMODE_MON_VREFRESH_LO: ret.f = (100.0 * ((MonPtr) monitor)->vrefresh[indx].lo); break; case VIDMODE_MON_VREFRESH_HI: ret.f = (100.0 * ((MonPtr) monitor)->vrefresh[indx].hi); break; } return ret; } #endif /* XF86VIDMODE */ xorg-server-1.17.1/hw/xfree86/common/xf86Config.c0000664000175100017510000023443212456571574016323 00000000000000/* * Loosely based on code bearing the following copyright: * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. */ /* * Copyright 1992-2003 by The XFree86 Project, Inc. * Copyright 1997 by Metro Link, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * * Authors: * Dirk Hohndel * David Dawes * Marc La France * Egbert Eich * ... and others */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifdef XF86DRI #include #include #endif #include "xf86.h" #include "xf86Modes.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "xf86Config.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "configProcs.h" #include "globals.h" #include "extension.h" #include "xf86pciBus.h" #include "xf86Xinput.h" #include "xkbsrv.h" #include "picture.h" /* * These paths define the way the config file search is done. The escape * sequences are documented in parser/scan.c. */ #ifndef ALL_CONFIGPATH #define ALL_CONFIGPATH "%A," "%R," \ "/etc/X11/%R," "%P/etc/X11/%R," \ "%E," "%F," \ "/etc/X11/%F," "%P/etc/X11/%F," \ "/etc/X11/%X," "/etc/%X," \ "%P/etc/X11/%X.%H," \ "%P/etc/X11/%X," \ "%P/lib/X11/%X.%H," \ "%P/lib/X11/%X" #endif #ifndef RESTRICTED_CONFIGPATH #define RESTRICTED_CONFIGPATH "/etc/X11/%S," "%P/etc/X11/%S," \ "/etc/X11/%G," "%P/etc/X11/%G," \ "/etc/X11/%X," "/etc/%X," \ "%P/etc/X11/%X.%H," \ "%P/etc/X11/%X," \ "%P/lib/X11/%X.%H," \ "%P/lib/X11/%X" #endif #ifndef ALL_CONFIGDIRPATH #define ALL_CONFIGDIRPATH "%A," "%R," \ "/etc/X11/%R," "%C/X11/%R," \ "/etc/X11/%X," "%C/X11/%X" #endif #ifndef RESTRICTED_CONFIGDIRPATH #define RESTRICTED_CONFIGDIRPATH "/etc/X11/%R," "%C/X11/%R," \ "/etc/X11/%X," "%C/X11/%X" #endif #ifndef SYS_CONFIGDIRPATH #define SYS_CONFIGDIRPATH "%D/X11/%X" #endif #ifndef PROJECTROOT #define PROJECTROOT "/usr/X11R6" #endif static ModuleDefault ModuleDefaults[] = { #ifdef GLXEXT {.name = "glx",.toLoad = TRUE,.load_opt = NULL}, #endif #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} }; /* Forward declarations */ static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, MessageType from); static Bool configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor); static Bool configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active); static Bool configInput(InputInfoPtr pInfo, XF86ConfInputPtr conf_input, MessageType from); static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display); static Bool addDefaultModes(MonPtr monitorp); #ifdef XF86DRI static void configDRI(XF86ConfDRIPtr drip); #endif static void configExtensions(XF86ConfExtensionsPtr conf_ext); /* * xf86GetPathElem -- * Extract a single element from the font path string starting at * pnt. The font path element will be returned, and pnt will be * updated to point to the start of the next element, or set to * NULL if there are no more. */ static char * xf86GetPathElem(char **pnt) { char *p1; p1 = *pnt; *pnt = index(*pnt, ','); if (*pnt != NULL) { **pnt = '\0'; *pnt += 1; } return p1; } /* * xf86ValidateFontPath -- * Validates the user-specified font path. Each element that * begins with a '/' is checked to make sure the directory exists. * If the directory exists, the existence of a file named 'fonts.dir' * is checked. If either check fails, an error is printed and the * element is removed from the font path. */ #define DIR_FILE "/fonts.dir" static char * xf86ValidateFontPath(char *path) { char *next, *tmp_path, *out_pnt, *path_elem, *p1, *dir_elem; struct stat stat_buf; int flag; int dirlen; tmp_path = calloc(1, strlen(path) + 1); out_pnt = tmp_path; path_elem = NULL; next = path; while (next != NULL) { path_elem = xf86GetPathElem(&next); if (*path_elem == '/') { dir_elem = xnfcalloc(1, strlen(path_elem) + 1); if ((p1 = strchr(path_elem, ':')) != 0) dirlen = p1 - path_elem; else dirlen = strlen(path_elem); strlcpy(dir_elem, path_elem, dirlen + 1); flag = stat(dir_elem, &stat_buf); if (flag == 0) if (!S_ISDIR(stat_buf.st_mode)) flag = -1; if (flag != 0) { xf86Msg(X_WARNING, "The directory \"%s\" does not exist.\n", dir_elem); xf86ErrorF("\tEntry deleted from font path.\n"); free(dir_elem); continue; } else { XNFasprintf(&p1, "%s%s", dir_elem, DIR_FILE); flag = stat(p1, &stat_buf); if (flag == 0) if (!S_ISREG(stat_buf.st_mode)) flag = -1; free(p1); if (flag != 0) { xf86Msg(X_WARNING, "`fonts.dir' not found (or not valid) in \"%s\".\n", dir_elem); xf86ErrorF("\tEntry deleted from font path.\n"); xf86ErrorF("\t(Run 'mkfontdir' on \"%s\").\n", dir_elem); free(dir_elem); continue; } } free(dir_elem); } /* * Either an OK directory, or a font server name. So add it to * the path. */ if (out_pnt != tmp_path) *out_pnt++ = ','; strcat(out_pnt, path_elem); out_pnt += strlen(path_elem); } return tmp_path; } #define FIND_SUITABLE(pointertype, listhead, ptr) \ do { \ pointertype _l, _p; \ \ for (_l = (listhead), _p = NULL; !_p && _l; _l = (pointertype)_l->list.next) { \ if (!_l->match_seat || (SeatId && xf86nameCompare(_l->match_seat, SeatId) == 0)) \ _p = _l; \ } \ \ (ptr) = _p; \ } while(0) /* * use the datastructure that the parser provides and pick out the parts * that we need at this point */ const char ** xf86ModulelistFromConfig(void ***optlist) { int count = 0, i = 0; const char **modulearray; const char *ignore[] = { "GLcore", "speedo", "bitmap", "drm", "freetype", "type1", NULL }; void **optarray; XF86LoadPtr modp; Bool found; /* * make sure the config file has been parsed and that we have a * ModulePath set; if no ModulePath was given, use the default * ModulePath */ if (xf86configptr == NULL) { xf86Msg(X_ERROR, "Cannot access global config data structure\n"); return NULL; } if (xf86configptr->conf_modules) { /* Walk the disable list and let people know what we've parsed to * not be loaded */ modp = xf86configptr->conf_modules->mod_disable_lst; while (modp) { xf86Msg(X_WARNING, "\"%s\" will not be loaded unless you've specified it to be loaded elsewhere.\n", modp->load_name); modp = (XF86LoadPtr) modp->list.next; } /* * Walk the default settings table. For each module listed to be * loaded, make sure it's in the mod_load_lst. If it's not, make * sure it's not in the mod_no_load_lst. If it's not disabled, * append it to mod_load_lst */ for (i = 0; ModuleDefaults[i].name != NULL; i++) { if (ModuleDefaults[i].toLoad == FALSE) { xf86Msg(X_WARNING, "\"%s\" is not to be loaded by default. Skipping.\n", ModuleDefaults[i].name); continue; } found = FALSE; modp = xf86configptr->conf_modules->mod_load_lst; while (modp) { if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) { xf86Msg(X_INFO, "\"%s\" will be loaded. This was enabled by default and also specified in the config file.\n", ModuleDefaults[i].name); found = TRUE; break; } modp = (XF86LoadPtr) modp->list.next; } if (found == FALSE) { modp = xf86configptr->conf_modules->mod_disable_lst; while (modp) { if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) { xf86Msg(X_INFO, "\"%s\" will be loaded even though the default is to disable it.\n", ModuleDefaults[i].name); found = TRUE; break; } modp = (XF86LoadPtr) modp->list.next; } } if (found == FALSE) { XF86LoadPtr ptr = (XF86LoadPtr) xf86configptr->conf_modules; xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name); } } } else { xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec)); for (i = 0; ModuleDefaults[i].name != NULL; i++) { if (ModuleDefaults[i].toLoad == TRUE) { XF86LoadPtr ptr = (XF86LoadPtr) xf86configptr->conf_modules; xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); } } } /* * Walk the list of modules in the "Module" section to determine how * many we have. */ modp = xf86configptr->conf_modules->mod_load_lst; while (modp) { for (i = 0; ignore[i]; i++) { if (strcmp(modp->load_name, ignore[i]) == 0) modp->ignore = 1; } if (!modp->ignore) count++; modp = (XF86LoadPtr) modp->list.next; } /* * allocate the memory and walk the list again to fill in the pointers */ modulearray = xnfalloc((count + 1) * sizeof(char *)); optarray = xnfalloc((count + 1) * sizeof(void *)); count = 0; if (xf86configptr->conf_modules) { modp = xf86configptr->conf_modules->mod_load_lst; while (modp) { if (!modp->ignore) { modulearray[count] = modp->load_name; optarray[count] = modp->load_opt; count++; } modp = (XF86LoadPtr) modp->list.next; } } modulearray[count] = NULL; optarray[count] = NULL; if (optlist) *optlist = optarray; else free(optarray); return modulearray; } const char ** xf86DriverlistFromConfig(void) { int count = 0; int j; const char **modulearray; screenLayoutPtr slp; /* * make sure the config file has been parsed and that we have a * ModulePath set; if no ModulePath was given, use the default * ModulePath */ if (xf86configptr == NULL) { xf86Msg(X_ERROR, "Cannot access global config data structure\n"); return NULL; } /* * Walk the list of driver lines in active "Device" sections to * determine now many implicitly loaded modules there are. * */ if (xf86ConfigLayout.screens) { slp = xf86ConfigLayout.screens; while ((slp++)->screen) { count++; } } /* * Handle the set of inactive "Device" sections. */ j = 0; while (xf86ConfigLayout.inactives[j++].identifier) count++; if (count == 0) return NULL; /* * allocate the memory and walk the list again to fill in the pointers */ modulearray = xnfalloc((count + 1) * sizeof(char *)); count = 0; slp = xf86ConfigLayout.screens; while (slp->screen) { modulearray[count] = slp->screen->device->driver; count++; slp++; } j = 0; while (xf86ConfigLayout.inactives[j].identifier) modulearray[count++] = xf86ConfigLayout.inactives[j++].driver; modulearray[count] = NULL; /* Remove duplicates */ for (count = 0; modulearray[count] != NULL; count++) { int i; for (i = 0; i < count; i++) if (xf86NameCmp(modulearray[i], modulearray[count]) == 0) { modulearray[count] = ""; break; } } return modulearray; } const char ** xf86InputDriverlistFromConfig(void) { int count = 0; const char **modulearray; InputInfoPtr *idp; /* * make sure the config file has been parsed and that we have a * ModulePath set; if no ModulePath was given, use the default * ModulePath */ if (xf86configptr == NULL) { xf86Msg(X_ERROR, "Cannot access global config data structure\n"); return NULL; } /* * Walk the list of driver lines in active "InputDevice" sections to * determine now many implicitly loaded modules there are. */ if (xf86ConfigLayout.inputs) { idp = xf86ConfigLayout.inputs; while (*idp) { count++; idp++; } } if (count == 0) return NULL; /* * allocate the memory and walk the list again to fill in the pointers */ modulearray = xnfalloc((count + 1) * sizeof(char *)); count = 0; idp = xf86ConfigLayout.inputs; while (idp && *idp) { modulearray[count] = (*idp)->driver; count++; idp++; } modulearray[count] = NULL; /* Remove duplicates */ for (count = 0; modulearray[count] != NULL; count++) { int i; for (i = 0; i < count; i++) if (xf86NameCmp(modulearray[i], modulearray[count]) == 0) { modulearray[count] = ""; break; } } return modulearray; } static void fixup_video_driver_list(const char **drivers) { static const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; const char **end, **drv; const char *x; int i; /* walk to the end of the list */ for (end = drivers; *end && **end; end++); end--; /* * for each of the fallback drivers, if we find it in the list, * swap it with the last available non-fallback driver. */ for (i = 0; fallback[i]; i++) { for (drv = drivers; drv != end; drv++) { if (strstr(*drv, fallback[i])) { x = *drv; *drv = *end; *end = x; end--; break; } } } } static const char ** GenerateDriverlist(const char *dirname) { const char **ret; const char *subdirs[] = { dirname, NULL }; static const char *patlist[] = { "(.*)_drv\\.so", NULL }; ret = LoaderListDirs(subdirs, patlist); /* fix up the probe order for video drivers */ if (strstr(dirname, "drivers") && ret != NULL) fixup_video_driver_list(ret); return ret; } const char ** xf86DriverlistFromCompile(void) { static const char **driverlist = NULL; if (!driverlist) driverlist = GenerateDriverlist("drivers"); return driverlist; } static void configFiles(XF86ConfFilesPtr fileconf) { MessageType pathFrom; Bool must_copy; int size, countDirs; char *temp_path, *log_buf, *start, *end; /* FontPath */ must_copy = TRUE; temp_path = defaultFontPath ? (char *) defaultFontPath : (char *) ""; if (xf86fpFlag) pathFrom = X_CMDLINE; else if (fileconf && fileconf->file_fontpath) { pathFrom = X_CONFIG; if (xf86Info.useDefaultFontPath) { char *new_font_path; if (asprintf(&new_font_path, "%s%s%s", fileconf->file_fontpath, *temp_path ? "," : "", temp_path) == -1) new_font_path = NULL; else must_copy = FALSE; defaultFontPath = new_font_path; } else defaultFontPath = fileconf->file_fontpath; } else pathFrom = X_DEFAULT; temp_path = defaultFontPath ? (char *) defaultFontPath : (char *) ""; /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */ temp_path = must_copy ? xnfstrdup(defaultFontPath) : (char *) defaultFontPath; defaultFontPath = xf86ValidateFontPath(temp_path); free(temp_path); /* make fontpath more readable in the logfiles */ countDirs = 1; temp_path = (char *) defaultFontPath; while ((temp_path = index(temp_path, ',')) != NULL) { countDirs++; temp_path++; } log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1); temp_path = log_buf; start = (char *) defaultFontPath; while ((end = index(start, ',')) != NULL) { size = (end - start) + 1; *(temp_path++) = '\t'; strncpy(temp_path, start, size); temp_path += size; *(temp_path++) = '\n'; start += size; } /* copy last entry */ *(temp_path++) = '\t'; strcpy(temp_path, start); xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf); free(log_buf); /* ModulePath */ if (fileconf) { if (xf86ModPathFrom != X_CMDLINE && fileconf->file_modulepath) { xf86ModulePath = fileconf->file_modulepath; xf86ModPathFrom = X_CONFIG; } } xf86Msg(xf86ModPathFrom, "ModulePath set to \"%s\"\n", xf86ModulePath); if (!xf86xkbdirFlag && fileconf && fileconf->file_xkbdir) { XkbBaseDirectory = fileconf->file_xkbdir; xf86Msg(X_CONFIG, "XKB base directory set to \"%s\"\n", XkbBaseDirectory); } #if 0 /* LogFile */ /* * XXX The problem with this is that the log file is already open. * One option might be to copy the exiting contents to the new location. * and re-open it. The down side is that the default location would * already have been overwritten. Another option would be to start with * unique temporary location, then copy it once the correct name is known. * A problem with this is what happens if the server exits before that * happens. */ if (xf86LogFileFrom == X_DEFAULT && fileconf->file_logfile) { xf86LogFile = fileconf->file_logfile; xf86LogFileFrom = X_CONFIG; } #endif return; } typedef enum { FLAG_NOTRAPSIGNALS, FLAG_DONTVTSWITCH, FLAG_DONTZAP, FLAG_DONTZOOM, FLAG_DISABLEVIDMODE, FLAG_ALLOWNONLOCAL, FLAG_ALLOWMOUSEOPENFAIL, FLAG_SAVER_BLANKTIME, FLAG_DPMS_STANDBYTIME, FLAG_DPMS_SUSPENDTIME, FLAG_DPMS_OFFTIME, FLAG_PIXMAP, FLAG_NOPM, FLAG_XINERAMA, FLAG_LOG, FLAG_RENDER_COLORMAP_MODE, FLAG_RANDR, FLAG_AIGLX, FLAG_IGNORE_ABI, FLAG_ALLOW_EMPTY_INPUT, FLAG_USE_DEFAULT_FONT_PATH, FLAG_AUTO_ADD_DEVICES, FLAG_AUTO_ENABLE_DEVICES, FLAG_GLX_VISUALS, FLAG_DRI2, FLAG_USE_SIGIO, FLAG_AUTO_ADD_GPU, } FlagValues; /** * NOTE: the last value for each entry is NOT the default. It is set to TRUE * if the parser found the option in the config file. */ static OptionInfoRec FlagOptions[] = { {FLAG_NOTRAPSIGNALS, "NoTrapSignals", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_DONTVTSWITCH, "DontVTSwitch", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_DONTZAP, "DontZap", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_DONTZOOM, "DontZoom", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_DISABLEVIDMODE, "DisableVidModeExtension", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_ALLOWNONLOCAL, "AllowNonLocalXvidtune", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_ALLOWMOUSEOPENFAIL, "AllowMouseOpenFail", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_SAVER_BLANKTIME, "BlankTime", OPTV_INTEGER, {0}, FALSE}, {FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER, {0}, FALSE}, {FLAG_DPMS_SUSPENDTIME, "SuspendTime", OPTV_INTEGER, {0}, FALSE}, {FLAG_DPMS_OFFTIME, "OffTime", OPTV_INTEGER, {0}, FALSE}, {FLAG_PIXMAP, "Pixmap", OPTV_INTEGER, {0}, FALSE}, {FLAG_NOPM, "NoPM", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_XINERAMA, "Xinerama", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_LOG, "Log", OPTV_STRING, {0}, FALSE}, {FLAG_RENDER_COLORMAP_MODE, "RenderColormapMode", OPTV_STRING, {0}, FALSE}, {FLAG_RANDR, "RandR", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_AUTO_ADD_DEVICES, "AutoAddDevices", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_AUTO_ENABLE_DEVICES, "AutoEnableDevices", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_GLX_VISUALS, "GlxVisuals", OPTV_STRING, {0}, FALSE}, {FLAG_DRI2, "DRI2", OPTV_BOOLEAN, {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}, }; static void configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) { XF86OptionPtr optp, tmp; int i; Pix24Flags pix24 = Pix24DontCare; Bool value; MessageType from; const char *s; XkbRMLVOSet set; const char *rules; /* * Merge the ServerLayout and ServerFlags options. The former have * precedence over the latter. */ optp = NULL; if (flagsconf && flagsconf->flg_option_lst) optp = xf86optionListDup(flagsconf->flg_option_lst); if (layoutopts) { tmp = xf86optionListDup(layoutopts); if (optp) optp = xf86optionListMerge(optp, tmp); else optp = tmp; } xf86ProcessOptions(-1, optp, FlagOptions); xf86GetOptValBool(FlagOptions, FLAG_NOTRAPSIGNALS, &xf86Info.notrapSignals); xf86GetOptValBool(FlagOptions, FLAG_DONTVTSWITCH, &xf86Info.dontVTSwitch); xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap); xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom); xf86GetOptValBool(FlagOptions, FLAG_IGNORE_ABI, &xf86Info.ignoreABI); if (xf86Info.ignoreABI) { xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); } if (xf86SIGIOSupported()) { xf86Info.useSIGIO = xf86ReturnOptValBool(FlagOptions, FLAG_USE_SIGIO, USE_SIGIO_BY_DEFAULT); if (xf86IsOptionSet(FlagOptions, FLAG_USE_SIGIO)) { from = X_CONFIG; } else { from = X_DEFAULT; } if (!xf86Info.useSIGIO) { xf86Msg(from, "Disabling SIGIO handlers for input devices\n"); } else if (from == X_CONFIG) { xf86Msg(from, "Enabling SIGIO handlers for input devices\n"); } } else { xf86Info.useSIGIO = FALSE; } if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, &xf86Info.autoAddDevices); from = X_CONFIG; } else { from = X_DEFAULT; } xf86Msg(from, "%sutomatically adding devices\n", xf86Info.autoAddDevices ? "A" : "Not a"); if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ENABLE_DEVICES)) { xf86GetOptValBool(FlagOptions, FLAG_AUTO_ENABLE_DEVICES, &xf86Info.autoEnableDevices); from = X_CONFIG; } else { from = X_DEFAULT; } 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 * checked. */ #ifdef XF86VIDMODE if (xf86GetOptValBool(FlagOptions, FLAG_DISABLEVIDMODE, &value)) xf86Info.vidModeEnabled = !value; if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWNONLOCAL, &value)) xf86Info.vidModeAllowNonLocal = value; #endif if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWMOUSEOPENFAIL, &value)) xf86Info.allowMouseOpenFail = value; xf86Info.pmFlag = TRUE; if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value)) xf86Info.pmFlag = !value; { if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) { if (!xf86NameCmp(s, "flush")) { xf86Msg(X_CONFIG, "Flushing logfile enabled\n"); LogSetParameter(XLOG_FLUSH, TRUE); } else if (!xf86NameCmp(s, "sync")) { xf86Msg(X_CONFIG, "Syncing logfile enabled\n"); LogSetParameter(XLOG_FLUSH, TRUE); LogSetParameter(XLOG_SYNC, TRUE); } else { xf86Msg(X_WARNING, "Unknown Log option\n"); } } } { if ((s = xf86GetOptValString(FlagOptions, FLAG_RENDER_COLORMAP_MODE))) { int policy = PictureParseCmapPolicy(s); if (policy == PictureCmapPolicyInvalid) xf86Msg(X_WARNING, "Unknown colormap policy \"%s\"\n", s); else { xf86Msg(X_CONFIG, "Render colormap policy set to %s\n", s); PictureCmapPolicy = policy; } } } #ifdef RANDR xf86Info.disableRandR = FALSE; xf86Info.randRFrom = X_DEFAULT; if (xf86GetOptValBool(FlagOptions, FLAG_RANDR, &value)) { xf86Info.disableRandR = !value; xf86Info.randRFrom = X_CONFIG; } #endif xf86Info.aiglx = TRUE; xf86Info.aiglxFrom = X_DEFAULT; if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { xf86Info.aiglx = value; xf86Info.aiglxFrom = X_CONFIG; } #ifdef GLXEXT xf86Info.glxVisuals = XF86_GlxVisualsTypical; xf86Info.glxVisualsFrom = X_DEFAULT; if ((s = xf86GetOptValString(FlagOptions, FLAG_GLX_VISUALS))) { if (!xf86NameCmp(s, "minimal")) { xf86Info.glxVisuals = XF86_GlxVisualsMinimal; } else if (!xf86NameCmp(s, "typical")) { xf86Info.glxVisuals = XF86_GlxVisualsTypical; } else if (!xf86NameCmp(s, "all")) { xf86Info.glxVisuals = XF86_GlxVisualsAll; } else { xf86Msg(X_WARNING, "Unknown GlxVisuals option\n"); } } if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { xf86Info.aiglx = value; xf86Info.aiglxFrom = X_CONFIG; } #endif /* if we're not hotplugging, force some input devices to exist */ xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices); /* when forcing input devices, we use kbd. otherwise evdev, so use the * evdev rules set. */ #if defined(linux) if (!xf86Info.forceInputDevices) rules = "evdev"; else #endif rules = "base"; /* Xkb default options. */ XkbInitRules(&set, rules, "pc105", "us", NULL, NULL); XkbSetRulesDflts(&set); XkbFreeRMLVOSet(&set, FALSE); xf86Info.useDefaultFontPath = TRUE; if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) { xf86Info.useDefaultFontPath = value; } /* Make sure that timers don't overflow CARD32's after multiplying */ #define MAX_TIME_IN_MIN (0x7fffffff / MILLI_PER_MIN) i = -1; xf86GetOptValInteger(FlagOptions, FLAG_SAVER_BLANKTIME, &i); if ((i >= 0) && (i < MAX_TIME_IN_MIN)) ScreenSaverTime = defaultScreenSaverTime = i * MILLI_PER_MIN; else if (i != -1) ErrorF("BlankTime value %d outside legal range of 0 - %d minutes\n", i, MAX_TIME_IN_MIN); #ifdef DPMSExtension i = -1; xf86GetOptValInteger(FlagOptions, FLAG_DPMS_STANDBYTIME, &i); if ((i >= 0) && (i < MAX_TIME_IN_MIN)) DPMSStandbyTime = i * MILLI_PER_MIN; else if (i != -1) ErrorF("StandbyTime value %d outside legal range of 0 - %d minutes\n", i, MAX_TIME_IN_MIN); i = -1; xf86GetOptValInteger(FlagOptions, FLAG_DPMS_SUSPENDTIME, &i); if ((i >= 0) && (i < MAX_TIME_IN_MIN)) DPMSSuspendTime = i * MILLI_PER_MIN; else if (i != -1) ErrorF("SuspendTime value %d outside legal range of 0 - %d minutes\n", i, MAX_TIME_IN_MIN); i = -1; xf86GetOptValInteger(FlagOptions, FLAG_DPMS_OFFTIME, &i); if ((i >= 0) && (i < MAX_TIME_IN_MIN)) DPMSOffTime = i * MILLI_PER_MIN; else if (i != -1) ErrorF("OffTime value %d outside legal range of 0 - %d minutes\n", i, MAX_TIME_IN_MIN); #endif i = -1; xf86GetOptValInteger(FlagOptions, FLAG_PIXMAP, &i); switch (i) { case 24: pix24 = Pix24Use24; break; case 32: pix24 = Pix24Use32; break; case -1: break; default: ErrorF("Pixmap option's value (%d) must be 24 or 32\n", i); break; } if (xf86Pix24 != Pix24DontCare) { xf86Info.pixmap24 = xf86Pix24; xf86Info.pix24From = X_CMDLINE; } else if (pix24 != Pix24DontCare) { xf86Info.pixmap24 = pix24; xf86Info.pix24From = X_CONFIG; } else { xf86Info.pixmap24 = Pix24DontCare; xf86Info.pix24From = X_DEFAULT; } #ifdef PANORAMIX from = X_DEFAULT; if (!noPanoramiXExtension) from = X_CMDLINE; else if (xf86GetOptValBool(FlagOptions, FLAG_XINERAMA, &value)) { noPanoramiXExtension = !value; from = X_CONFIG; } if (!noPanoramiXExtension) xf86Msg(from, "Xinerama: enabled\n"); #endif #ifdef DRI2 xf86Info.dri2 = FALSE; xf86Info.dri2From = X_DEFAULT; if (xf86GetOptValBool(FlagOptions, FLAG_DRI2, &value)) { xf86Info.dri2 = value; xf86Info.dri2From = X_CONFIG; } #endif } Bool xf86DRI2Enabled(void) { return xf86Info.dri2; } /** * Search for the pInfo in the null-terminated list given and remove (and * free) it if present. All other devices are moved forward. */ static void freeDevice(InputInfoPtr * list, InputInfoPtr pInfo) { InputInfoPtr *devs; for (devs = list; devs && *devs; devs++) { if (*devs == pInfo) { free(*devs); for (; devs && *devs; devs++) devs[0] = devs[1]; break; } } } /** * Append pInfo to the null-terminated list, allocating space as necessary. * pInfo is used as the last element. */ static InputInfoPtr * addDevice(InputInfoPtr * list, InputInfoPtr pInfo) { InputInfoPtr *devs; int count = 1; for (devs = list; devs && *devs; devs++) count++; list = xnfrealloc(list, (count + 1) * sizeof(InputInfoPtr)); list[count] = NULL; list[count - 1] = pInfo; return list; } /* * Locate the core input devices. These can be specified/located in * the following ways, in order of priority: * * 1. The InputDevices named by the -pointer and -keyboard command line * options. * 2. The "CorePointer" and "CoreKeyboard" InputDevices referred to by * the active ServerLayout. * 3. The first InputDevices marked as "CorePointer" and "CoreKeyboard". * 4. The first InputDevices that use 'keyboard' or 'kbd' and a valid mouse * driver (mouse, synaptics, evdev, vmmouse, void) * 5. Default devices with an empty (default) configuration. These defaults * will reference the 'mouse' and 'keyboard' drivers. */ static Bool checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) { InputInfoPtr corePointer = NULL, coreKeyboard = NULL; Bool foundPointer = FALSE, foundKeyboard = FALSE; const char *pointerMsg = NULL, *keyboardMsg = NULL; InputInfoPtr *devs, /* iterator */ indp; InputInfoPtr Pointer, Keyboard; XF86ConfInputPtr confInput; XF86ConfInputRec defPtr, defKbd; MessageType from = X_DEFAULT; const char *mousedrivers[] = { "mouse", "synaptics", "evdev", "vmmouse", "void", NULL }; /* * First check if a core pointer or core keyboard have been specified * in the active ServerLayout. If more than one is specified for either, * remove the core attribute from the later ones. */ for (devs = servlayoutp->inputs; devs && *devs; devs++) { indp = *devs; if (indp->options && xf86CheckBoolOption(indp->options, "CorePointer", FALSE)) { if (!corePointer) { corePointer = indp; } } if (indp->options && xf86CheckBoolOption(indp->options, "CoreKeyboard", FALSE)) { if (!coreKeyboard) { coreKeyboard = indp; } } } confInput = NULL; /* 1. Check for the -pointer command line option. */ if (xf86PointerName) { confInput = xf86findInput(xf86PointerName, xf86configptr->conf_input_lst); if (!confInput) { xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n", xf86PointerName); return FALSE; } from = X_CMDLINE; /* * If one was already specified in the ServerLayout, it needs to be * removed. */ if (corePointer) { freeDevice(servlayoutp->inputs, corePointer); corePointer = NULL; } foundPointer = TRUE; } /* 2. ServerLayout-specified core pointer. */ if (corePointer) { foundPointer = TRUE; from = X_CONFIG; } /* 3. First core pointer device. */ if (!foundPointer && (xf86Info.forceInputDevices || implicitLayout)) { XF86ConfInputPtr p; for (p = xf86configptr->conf_input_lst; p; p = p->list.next) { if (p->inp_option_lst && xf86CheckBoolOption(p->inp_option_lst, "CorePointer", FALSE)) { confInput = p; foundPointer = TRUE; from = X_DEFAULT; pointerMsg = "first core pointer device"; break; } } } /* 4. First pointer with an allowed mouse driver. */ if (!foundPointer && xf86Info.forceInputDevices) { const char **driver = mousedrivers; confInput = xf86findInput(CONF_IMPLICIT_POINTER, xf86configptr->conf_input_lst); while (*driver && !confInput) { confInput = xf86findInputByDriver(*driver, xf86configptr->conf_input_lst); driver++; } if (confInput) { foundPointer = TRUE; from = X_DEFAULT; pointerMsg = "first mouse device"; } } /* 5. Built-in default. */ if (!foundPointer && xf86Info.forceInputDevices) { memset(&defPtr, 0, sizeof(defPtr)); defPtr.inp_identifier = strdup(""); defPtr.inp_driver = strdup("mouse"); confInput = &defPtr; foundPointer = TRUE; from = X_DEFAULT; pointerMsg = "default mouse configuration"; } /* Add the core pointer device to the layout, and set it to Core. */ if (foundPointer && confInput) { Pointer = xf86AllocateInput(); if (Pointer) foundPointer = configInput(Pointer, confInput, from); if (foundPointer) { Pointer->options = xf86AddNewOption(Pointer->options, "CorePointer", "on"); Pointer->options = xf86AddNewOption(Pointer->options, "driver", confInput->inp_driver); Pointer->options = xf86AddNewOption(Pointer->options, "identifier", confInput->inp_identifier); servlayoutp->inputs = addDevice(servlayoutp->inputs, Pointer); } } if (!foundPointer && xf86Info.forceInputDevices) { /* This shouldn't happen. */ xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n"); xf86DeleteInput(Pointer, 0); return FALSE; } confInput = NULL; /* 1. Check for the -keyboard command line option. */ if (xf86KeyboardName) { confInput = xf86findInput(xf86KeyboardName, xf86configptr->conf_input_lst); if (!confInput) { xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n", xf86KeyboardName); return FALSE; } from = X_CMDLINE; /* * If one was already specified in the ServerLayout, it needs to be * removed. */ if (coreKeyboard) { freeDevice(servlayoutp->inputs, coreKeyboard); coreKeyboard = NULL; } foundKeyboard = TRUE; } /* 2. ServerLayout-specified core keyboard. */ if (coreKeyboard) { foundKeyboard = TRUE; from = X_CONFIG; } /* 3. First core keyboard device. */ if (!foundKeyboard && (xf86Info.forceInputDevices || implicitLayout)) { XF86ConfInputPtr p; for (p = xf86configptr->conf_input_lst; p; p = p->list.next) { if (p->inp_option_lst && xf86CheckBoolOption(p->inp_option_lst, "CoreKeyboard", FALSE)) { confInput = p; foundKeyboard = TRUE; from = X_DEFAULT; keyboardMsg = "first core keyboard device"; break; } } } /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */ if (!foundKeyboard && xf86Info.forceInputDevices) { confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD, xf86configptr->conf_input_lst); if (!confInput) { confInput = xf86findInputByDriver("kbd", xf86configptr->conf_input_lst); } if (confInput) { foundKeyboard = TRUE; from = X_DEFAULT; keyboardMsg = "first keyboard device"; } } /* 5. Built-in default. */ if (!foundKeyboard && xf86Info.forceInputDevices) { memset(&defKbd, 0, sizeof(defKbd)); defKbd.inp_identifier = strdup(""); defKbd.inp_driver = strdup("kbd"); confInput = &defKbd; foundKeyboard = TRUE; keyboardMsg = "default keyboard configuration"; from = X_DEFAULT; } /* Add the core keyboard device to the layout, and set it to Core. */ if (foundKeyboard && confInput) { Keyboard = xf86AllocateInput(); if (Keyboard) foundKeyboard = configInput(Keyboard, confInput, from); if (foundKeyboard) { Keyboard->options = xf86AddNewOption(Keyboard->options, "CoreKeyboard", "on"); Keyboard->options = xf86AddNewOption(Keyboard->options, "driver", confInput->inp_driver); Keyboard->options = xf86AddNewOption(Keyboard->options, "identifier", confInput->inp_identifier); servlayoutp->inputs = addDevice(servlayoutp->inputs, Keyboard); } } if (!foundKeyboard && xf86Info.forceInputDevices) { /* This shouldn't happen. */ xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n"); xf86DeleteInput(Keyboard, 0); return FALSE; } if (pointerMsg) { if (implicitLayout) xf86Msg(X_DEFAULT, "No Layout section. Using the %s.\n", pointerMsg); else xf86Msg(X_DEFAULT, "The core pointer device wasn't specified " "explicitly in the layout.\n" "\tUsing the %s.\n", pointerMsg); } if (keyboardMsg) { if (implicitLayout) xf86Msg(X_DEFAULT, "No Layout section. Using the %s.\n", keyboardMsg); else xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified " "explicitly in the layout.\n" "\tUsing the %s.\n", keyboardMsg); } if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) { #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) const char *config_backend; #if defined(CONFIG_HAL) config_backend = "HAL"; #elif defined(CONFIG_UDEV) config_backend = "udev"; #else config_backend = "wscons"; #endif xf86Msg(X_INFO, "The server relies on %s to provide the list of " "input devices.\n\tIf no devices become available, " "reconfigure %s or disable AutoAddDevices.\n", config_backend, config_backend); #else xf86Msg(X_WARNING, "Hotplugging requested but the server was " "compiled without a config backend. " "No input devices were configured, the server " "will start without any input devices.\n"); #endif } return TRUE; } typedef enum { LAYOUT_ISOLATEDEVICE, LAYOUT_SINGLECARD } LayoutValues; static OptionInfoRec LayoutOptions[] = { {LAYOUT_ISOLATEDEVICE, "IsolateDevice", OPTV_STRING, {0}, FALSE}, {LAYOUT_SINGLECARD, "SingleCard", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; static Bool configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp) { XF86ConfInputrefPtr irp; InputInfoPtr *indp; int count = 0; /* * Count the number of input devices. */ irp = layout->lay_input_lst; while (irp) { count++; irp = (XF86ConfInputrefPtr) irp->list.next; } DebugF("Found %d input devices in the layout section %s\n", count, layout->lay_identifier); indp = xnfcalloc((count + 1), sizeof(InputInfoPtr)); indp[count] = NULL; irp = layout->lay_input_lst; count = 0; while (irp) { indp[count] = xf86AllocateInput(); if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) { do { free(indp[count]); } while (count--); free(indp); return FALSE; } indp[count]->options = xf86OptionListMerge(indp[count]->options, irp->iref_option_lst); count++; irp = (XF86ConfInputrefPtr) irp->list.next; } servlayoutp->inputs = indp; return TRUE; } /* * figure out which layout is active, which screens are used in that layout, * which drivers and monitors are used in these screens */ static Bool configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, char *default_layout) { XF86ConfAdjacencyPtr adjp; XF86ConfInactivePtr idp; int saved_count, count = 0; int scrnum; XF86ConfLayoutPtr l; MessageType from; screenLayoutPtr slp; GDevPtr gdp; int i = 0, j; if (!servlayoutp) return FALSE; /* * which layout section is the active one? * * If there is a -layout command line option, use that one, otherwise * pick the first one. */ from = X_DEFAULT; if (xf86LayoutName != NULL) from = X_CMDLINE; else if (default_layout) { xf86LayoutName = default_layout; from = X_CONFIG; } if (xf86LayoutName != NULL) { if ((l = xf86findLayout(xf86LayoutName, conf_layout)) == NULL) { xf86Msg(X_ERROR, "No ServerLayout section called \"%s\"\n", xf86LayoutName); return FALSE; } conf_layout = l; } xf86Msg(from, "ServerLayout \"%s\"\n", conf_layout->lay_identifier); adjp = conf_layout->lay_adjacency_lst; /* * we know that each screen is referenced exactly once on the left side * of a layout statement in the Layout section. So to allocate the right * size for the array we do a quick walk of the list to figure out how * many sections we have */ while (adjp) { count++; adjp = (XF86ConfAdjacencyPtr) adjp->list.next; } DebugF("Found %d screens in the layout section %s", count, conf_layout->lay_identifier); if (!count) /* alloc enough storage even if no screen is specified */ count = 1; slp = xnfcalloc(1, (count + 1) * sizeof(screenLayoutRec)); slp[count].screen = NULL; /* * now that we have storage, loop over the list again and fill in our * data structure; at this point we do not fill in the adjacency * information as it is not clear if we need it at all */ adjp = conf_layout->lay_adjacency_lst; count = 0; while (adjp) { slp[count].screen = xnfcalloc(1, sizeof(confScreenRec)); if (adjp->adj_scrnum < 0) scrnum = count; else scrnum = adjp->adj_scrnum; if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum, X_CONFIG)) { do { free(slp[count].screen); } while (count--); free(slp); return FALSE; } slp[count].x = adjp->adj_x; slp[count].y = adjp->adj_y; slp[count].refname = adjp->adj_refscreen; switch (adjp->adj_where) { case CONF_ADJ_OBSOLETE: slp[count].where = PosObsolete; slp[count].topname = adjp->adj_top_str; slp[count].bottomname = adjp->adj_bottom_str; slp[count].leftname = adjp->adj_left_str; slp[count].rightname = adjp->adj_right_str; break; case CONF_ADJ_ABSOLUTE: slp[count].where = PosAbsolute; break; case CONF_ADJ_RIGHTOF: slp[count].where = PosRightOf; break; case CONF_ADJ_LEFTOF: slp[count].where = PosLeftOf; break; case CONF_ADJ_ABOVE: slp[count].where = PosAbove; break; case CONF_ADJ_BELOW: slp[count].where = PosBelow; break; case CONF_ADJ_RELATIVE: slp[count].where = PosRelative; break; } count++; adjp = (XF86ConfAdjacencyPtr) adjp->list.next; } /* No screen was specified in the layout. take the first one from the * config file, or - if it is NULL - configScreen autogenerates one for * us */ if (!count) { XF86ConfScreenPtr screen; FIND_SUITABLE (XF86ConfScreenPtr, xf86configptr->conf_screen_lst, screen); slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); if (!configScreen(slp[0].screen, screen, 0, X_CONFIG)) { free(slp[0].screen); free(slp); return FALSE; } } /* XXX Need to tie down the upper left screen. */ /* Fill in the refscreen and top/bottom/left/right values */ for (i = 0; i < count; i++) { for (j = 0; j < count; j++) { if (slp[i].refname && strcmp(slp[i].refname, slp[j].screen->id) == 0) { slp[i].refscreen = slp[j].screen; } if (slp[i].topname && strcmp(slp[i].topname, slp[j].screen->id) == 0) { slp[i].top = slp[j].screen; } if (slp[i].bottomname && strcmp(slp[i].bottomname, slp[j].screen->id) == 0) { slp[i].bottom = slp[j].screen; } if (slp[i].leftname && strcmp(slp[i].leftname, slp[j].screen->id) == 0) { slp[i].left = slp[j].screen; } if (slp[i].rightname && strcmp(slp[i].rightname, slp[j].screen->id) == 0) { slp[i].right = slp[j].screen; } } if (slp[i].where != PosObsolete && slp[i].where != PosAbsolute && !slp[i].refscreen) { xf86Msg(X_ERROR, "Screen %s doesn't exist: deleting placement\n", slp[i].refname); slp[i].where = PosAbsolute; slp[i].x = 0; slp[i].y = 0; } } if (!count) saved_count = 1; else saved_count = count; /* * Count the number of inactive devices. */ count = 0; idp = conf_layout->lay_inactive_lst; while (idp) { count++; idp = (XF86ConfInactivePtr) idp->list.next; } DebugF("Found %d inactive devices in the layout section %s\n", count, conf_layout->lay_identifier); gdp = xnfalloc((count + 1) * sizeof(GDevRec)); gdp[count].identifier = NULL; idp = conf_layout->lay_inactive_lst; count = 0; while (idp) { if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) goto bail; count++; idp = (XF86ConfInactivePtr) idp->list.next; } if (!configInputDevices(conf_layout, servlayoutp)) goto bail; servlayoutp->id = conf_layout->lay_identifier; servlayoutp->screens = slp; servlayoutp->inactives = gdp; servlayoutp->options = conf_layout->lay_option_lst; from = X_DEFAULT; return TRUE; bail: do { free(slp[saved_count].screen); } while (saved_count--); free(slp); free(gdp); return FALSE; } /* * No layout section, so find the first Screen section and set that up as * the only active screen. */ static Bool configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, XF86ConfigPtr conf_ptr) { MessageType from; XF86ConfScreenPtr s; screenLayoutPtr slp; InputInfoPtr *indp; XF86ConfLayoutRec layout; if (!servlayoutp) return FALSE; /* * which screen section is the active one? * * If there is a -screen option, use that one, otherwise use the first * one. */ from = X_CONFIG; if (xf86ScreenName != NULL) { if ((s = xf86findScreen(xf86ScreenName, conf_screen)) == NULL) { xf86Msg(X_ERROR, "No Screen section called \"%s\"\n", xf86ScreenName); return FALSE; } conf_screen = s; from = X_CMDLINE; } /* We have exactly one screen */ slp = xnfcalloc(1, 2 * sizeof(screenLayoutRec)); slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); slp[1].screen = NULL; if (!configScreen(slp[0].screen, conf_screen, 0, from)) { free(slp); return FALSE; } servlayoutp->id = "(implicit)"; servlayoutp->screens = slp; servlayoutp->inactives = xnfcalloc(1, sizeof(GDevRec)); servlayoutp->options = NULL; memset(&layout, 0, sizeof(layout)); layout.lay_identifier = servlayoutp->id; if (xf86layoutAddInputDevices(conf_ptr, &layout) > 0) { if (!configInputDevices(&layout, servlayoutp)) return FALSE; from = X_DEFAULT; } else { /* Set up an empty input device list, then look for some core devices. */ indp = xnfalloc(sizeof(InputInfoPtr)); *indp = NULL; servlayoutp->inputs = indp; } return TRUE; } static Bool configXvAdaptor(confXvAdaptorPtr adaptor, XF86ConfVideoAdaptorPtr conf_adaptor) { int count = 0; XF86ConfVideoPortPtr conf_port; xf86Msg(X_CONFIG, "| |-->VideoAdaptor \"%s\"\n", conf_adaptor->va_identifier); adaptor->identifier = conf_adaptor->va_identifier; adaptor->options = conf_adaptor->va_option_lst; if (conf_adaptor->va_busid || conf_adaptor->va_driver) { xf86Msg(X_CONFIG, "| | Unsupported device type, skipping entry\n"); return FALSE; } /* * figure out how many videoport subsections there are and fill them in */ conf_port = conf_adaptor->va_port_lst; while (conf_port) { count++; conf_port = (XF86ConfVideoPortPtr) conf_port->list.next; } adaptor->ports = xnfalloc((count) * sizeof(confXvPortRec)); adaptor->numports = count; count = 0; conf_port = conf_adaptor->va_port_lst; while (conf_port) { adaptor->ports[count].identifier = conf_port->vp_identifier; adaptor->ports[count].options = conf_port->vp_option_lst; count++; conf_port = (XF86ConfVideoPortPtr) conf_port->list.next; } return TRUE; } static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, MessageType from) { int count = 0; XF86ConfDisplayPtr dispptr; XF86ConfAdaptorLinkPtr conf_adaptor; Bool defaultMonitor = FALSE; XF86ConfScreenRec local_conf_screen; if (!conf_screen) { memset(&local_conf_screen, 0, sizeof(local_conf_screen)); conf_screen = &local_conf_screen; conf_screen->scrn_identifier = "Default Screen Section"; xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n"); } xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier, scrnum); /* * now we fill in the elements of the screen */ screenp->id = conf_screen->scrn_identifier; screenp->screennum = scrnum; screenp->defaultdepth = conf_screen->scrn_defaultdepth; screenp->defaultbpp = conf_screen->scrn_defaultbpp; screenp->defaultfbbpp = conf_screen->scrn_defaultfbbpp; screenp->monitor = xnfcalloc(1, sizeof(MonRec)); /* If no monitor is specified, create a default one. */ if (!conf_screen->scrn_monitor) { XF86ConfMonitorRec defMon; memset(&defMon, 0, sizeof(defMon)); defMon.mon_identifier = ""; if (!configMonitor(screenp->monitor, &defMon)) return FALSE; defaultMonitor = TRUE; } else { if (!configMonitor(screenp->monitor, conf_screen->scrn_monitor)) return FALSE; } /* Configure the device. If there isn't one configured, attach to the * first inactive one that we can configure. If there's none that work, * set it to NULL so that the section can be autoconfigured later */ screenp->device = xnfcalloc(1, sizeof(GDevRec)); if ((!conf_screen->scrn_device) && (xf86configptr->conf_device_lst)) { FIND_SUITABLE (XF86ConfDevicePtr, xf86configptr->conf_device_lst, conf_screen->scrn_device); xf86Msg(X_DEFAULT, "No device specified for screen \"%s\".\n" "\tUsing the first device section listed.\n", screenp->id); } if (configDevice(screenp->device, conf_screen->scrn_device, TRUE)) { screenp->device->myScreenSection = screenp; } else { screenp->device = NULL; } screenp->options = conf_screen->scrn_option_lst; /* * figure out how many display subsections there are and fill them in */ dispptr = conf_screen->scrn_display_lst; while (dispptr) { count++; dispptr = (XF86ConfDisplayPtr) dispptr->list.next; } screenp->displays = xnfalloc((count) * sizeof(DispRec)); screenp->numdisplays = count; /* Fill in the default Virtual size, if any */ if (conf_screen->scrn_virtualX && conf_screen->scrn_virtualY) { for (count = 0, dispptr = conf_screen->scrn_display_lst; dispptr; dispptr = (XF86ConfDisplayPtr) dispptr->list.next, count++) { screenp->displays[count].virtualX = conf_screen->scrn_virtualX; screenp->displays[count].virtualY = conf_screen->scrn_virtualY; } } /* Now do the per-Display Virtual sizes */ count = 0; dispptr = conf_screen->scrn_display_lst; while (dispptr) { configDisplay(&(screenp->displays[count]), dispptr); count++; dispptr = (XF86ConfDisplayPtr) dispptr->list.next; } /* * figure out how many videoadaptor references there are and fill them in */ conf_adaptor = conf_screen->scrn_adaptor_lst; while (conf_adaptor) { count++; conf_adaptor = (XF86ConfAdaptorLinkPtr) conf_adaptor->list.next; } screenp->xvadaptors = xnfalloc((count) * sizeof(confXvAdaptorRec)); screenp->numxvadaptors = 0; conf_adaptor = conf_screen->scrn_adaptor_lst; while (conf_adaptor) { if (configXvAdaptor(&(screenp->xvadaptors[screenp->numxvadaptors]), conf_adaptor->al_adaptor)) screenp->numxvadaptors++; conf_adaptor = (XF86ConfAdaptorLinkPtr) conf_adaptor->list.next; } if (defaultMonitor) { xf86Msg(X_DEFAULT, "No monitor specified for screen \"%s\".\n" "\tUsing a default monitor configuration.\n", screenp->id); } return TRUE; } typedef enum { MON_REDUCEDBLANKING, MON_MAX_PIX_CLOCK, } MonitorValues; static OptionInfoRec MonitorOptions[] = { {MON_REDUCEDBLANKING, "ReducedBlanking", OPTV_BOOLEAN, {0}, FALSE}, {MON_MAX_PIX_CLOCK, "MaxPixClock", OPTV_FREQ, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; static Bool configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) { int count; DisplayModePtr mode, last = NULL; XF86ConfModeLinePtr cmodep; XF86ConfModesPtr modes; XF86ConfModesLinkPtr modeslnk = conf_monitor->mon_modes_sect_lst; Gamma zeros = { 0.0, 0.0, 0.0 }; float badgamma = 0.0; double maxPixClock; xf86Msg(X_CONFIG, "| |-->Monitor \"%s\"\n", conf_monitor->mon_identifier); monitorp->id = conf_monitor->mon_identifier; monitorp->vendor = conf_monitor->mon_vendor; monitorp->model = conf_monitor->mon_modelname; monitorp->Modes = NULL; monitorp->Last = NULL; monitorp->gamma = zeros; monitorp->widthmm = conf_monitor->mon_width; monitorp->heightmm = conf_monitor->mon_height; monitorp->reducedblanking = FALSE; monitorp->maxPixClock = 0; monitorp->options = conf_monitor->mon_option_lst; /* * fill in the monitor structure */ for (count = 0; count < conf_monitor->mon_n_hsync && count < MAX_HSYNC; count++) { monitorp->hsync[count].hi = conf_monitor->mon_hsync[count].hi; monitorp->hsync[count].lo = conf_monitor->mon_hsync[count].lo; } monitorp->nHsync = count; for (count = 0; count < conf_monitor->mon_n_vrefresh && count < MAX_VREFRESH; count++) { monitorp->vrefresh[count].hi = conf_monitor->mon_vrefresh[count].hi; monitorp->vrefresh[count].lo = conf_monitor->mon_vrefresh[count].lo; } monitorp->nVrefresh = count; /* * first we collect the mode lines from the UseModes directive */ while (modeslnk) { modes = xf86findModes(modeslnk->ml_modes_str, xf86configptr->conf_modes_lst); modeslnk->ml_modes = modes; /* now add the modes found in the modes section to the list of modes for this monitor unless it has been added before because we are reusing the same section for another screen */ if (xf86itemNotSublist((GenericListPtr) conf_monitor->mon_modeline_lst, (GenericListPtr) modes->mon_modeline_lst)) { conf_monitor->mon_modeline_lst = (XF86ConfModeLinePtr) xf86addListItem((GenericListPtr) conf_monitor->mon_modeline_lst, (GenericListPtr) modes->mon_modeline_lst); } modeslnk = modeslnk->list.next; } /* * we need to hook in the mode lines now * here both data structures use lists, only our internal one * is double linked */ cmodep = conf_monitor->mon_modeline_lst; while (cmodep) { mode = xnfcalloc(1, sizeof(DisplayModeRec)); mode->type = 0; mode->Clock = cmodep->ml_clock; mode->HDisplay = cmodep->ml_hdisplay; mode->HSyncStart = cmodep->ml_hsyncstart; mode->HSyncEnd = cmodep->ml_hsyncend; mode->HTotal = cmodep->ml_htotal; mode->VDisplay = cmodep->ml_vdisplay; mode->VSyncStart = cmodep->ml_vsyncstart; mode->VSyncEnd = cmodep->ml_vsyncend; mode->VTotal = cmodep->ml_vtotal; mode->Flags = cmodep->ml_flags; mode->HSkew = cmodep->ml_hskew; mode->VScan = cmodep->ml_vscan; mode->name = xnfstrdup(cmodep->ml_identifier); if (last) { mode->prev = last; last->next = mode; } else { /* * this is the first mode */ monitorp->Modes = mode; mode->prev = NULL; } last = mode; cmodep = (XF86ConfModeLinePtr) cmodep->list.next; } if (last) { last->next = NULL; } monitorp->Last = last; /* add the (VESA) default modes */ if (!addDefaultModes(monitorp)) return FALSE; if (conf_monitor->mon_gamma_red > GAMMA_ZERO) monitorp->gamma.red = conf_monitor->mon_gamma_red; if (conf_monitor->mon_gamma_green > GAMMA_ZERO) monitorp->gamma.green = conf_monitor->mon_gamma_green; if (conf_monitor->mon_gamma_blue > GAMMA_ZERO) monitorp->gamma.blue = conf_monitor->mon_gamma_blue; /* Check that the gamma values are within range */ if (monitorp->gamma.red > GAMMA_ZERO && (monitorp->gamma.red < GAMMA_MIN || monitorp->gamma.red > GAMMA_MAX)) { badgamma = monitorp->gamma.red; } else if (monitorp->gamma.green > GAMMA_ZERO && (monitorp->gamma.green < GAMMA_MIN || monitorp->gamma.green > GAMMA_MAX)) { badgamma = monitorp->gamma.green; } else if (monitorp->gamma.blue > GAMMA_ZERO && (monitorp->gamma.blue < GAMMA_MIN || monitorp->gamma.blue > GAMMA_MAX)) { badgamma = monitorp->gamma.blue; } if (badgamma > GAMMA_ZERO) { ErrorF("Gamma value %.f is out of range (%.2f - %.1f)\n", badgamma, GAMMA_MIN, GAMMA_MAX); return FALSE; } xf86ProcessOptions(-1, monitorp->options, MonitorOptions); xf86GetOptValBool(MonitorOptions, MON_REDUCEDBLANKING, &monitorp->reducedblanking); if (xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ, &maxPixClock) == TRUE) { monitorp->maxPixClock = (int) maxPixClock; } return TRUE; } static int lookupVisual(const char *visname) { int i; if (!visname || !*visname) return -1; for (i = 0; i <= DirectColor; i++) { if (!xf86nameCompare(visname, xf86VisualNames[i])) break; } if (i <= DirectColor) return i; return -1; } static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display) { int count = 0; XF86ModePtr modep; displayp->frameX0 = conf_display->disp_frameX0; displayp->frameY0 = conf_display->disp_frameY0; displayp->virtualX = conf_display->disp_virtualX; displayp->virtualY = conf_display->disp_virtualY; displayp->depth = conf_display->disp_depth; displayp->fbbpp = conf_display->disp_bpp; displayp->weight.red = conf_display->disp_weight.red; displayp->weight.green = conf_display->disp_weight.green; displayp->weight.blue = conf_display->disp_weight.blue; displayp->blackColour.red = conf_display->disp_black.red; displayp->blackColour.green = conf_display->disp_black.green; displayp->blackColour.blue = conf_display->disp_black.blue; displayp->whiteColour.red = conf_display->disp_white.red; displayp->whiteColour.green = conf_display->disp_white.green; displayp->whiteColour.blue = conf_display->disp_white.blue; displayp->options = conf_display->disp_option_lst; if (conf_display->disp_visual) { displayp->defaultVisual = lookupVisual(conf_display->disp_visual); if (displayp->defaultVisual == -1) { ErrorF("Invalid visual name: \"%s\"\n", conf_display->disp_visual); return FALSE; } } else { displayp->defaultVisual = -1; } /* * now hook in the modes */ modep = conf_display->disp_mode_lst; while (modep) { count++; modep = (XF86ModePtr) modep->list.next; } displayp->modes = xnfalloc((count + 1) * sizeof(char *)); modep = conf_display->disp_mode_lst; count = 0; while (modep) { displayp->modes[count] = modep->mode_name; count++; modep = (XF86ModePtr) modep->list.next; } displayp->modes[count] = NULL; return TRUE; } static Bool configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) { int i; if (!conf_device) { return FALSE; } if (active) xf86Msg(X_CONFIG, "| |-->Device \"%s\"\n", conf_device->dev_identifier); else xf86Msg(X_CONFIG, "|-->Inactive Device \"%s\"\n", conf_device->dev_identifier); devicep->identifier = conf_device->dev_identifier; devicep->vendor = conf_device->dev_vendor; devicep->board = conf_device->dev_board; devicep->chipset = conf_device->dev_chipset; devicep->ramdac = conf_device->dev_ramdac; devicep->driver = conf_device->dev_driver; devicep->active = active; devicep->videoRam = conf_device->dev_videoram; devicep->BiosBase = conf_device->dev_bios_base; devicep->MemBase = conf_device->dev_mem_base; devicep->IOBase = conf_device->dev_io_base; devicep->clockchip = conf_device->dev_clockchip; devicep->busID = conf_device->dev_busid; devicep->chipID = conf_device->dev_chipid; devicep->chipRev = conf_device->dev_chiprev; devicep->options = conf_device->dev_option_lst; devicep->irq = conf_device->dev_irq; devicep->screen = conf_device->dev_screen; for (i = 0; i < MAXDACSPEEDS; i++) { if (i < CONF_MAXDACSPEEDS) devicep->dacSpeeds[i] = conf_device->dev_dacSpeeds[i]; else devicep->dacSpeeds[i] = 0; } devicep->numclocks = conf_device->dev_clocks; if (devicep->numclocks > MAXCLOCKS) devicep->numclocks = MAXCLOCKS; for (i = 0; i < devicep->numclocks; i++) { devicep->clock[i] = conf_device->dev_clock[i]; } devicep->claimed = FALSE; return TRUE; } #ifdef XF86DRI static void configDRI(XF86ConfDRIPtr drip) { struct group *grp; xf86ConfigDRI.group = -1; xf86ConfigDRI.mode = 0; if (drip) { if (drip->dri_group_name) { if ((grp = getgrnam(drip->dri_group_name))) xf86ConfigDRI.group = grp->gr_gid; } else { if (drip->dri_group >= 0) xf86ConfigDRI.group = drip->dri_group; } xf86ConfigDRI.mode = drip->dri_mode; } } #endif static void configExtensions(XF86ConfExtensionsPtr conf_ext) { XF86OptionPtr o; if (conf_ext && conf_ext->ext_option_lst) { for (o = conf_ext->ext_option_lst; o; o = xf86NextOption(o)) { char *name = xf86OptionName(o); char *val = xf86OptionValue(o); char *n; Bool enable = TRUE; /* Handle "No" */ n = xf86NormalizeName(name); if (strncmp(n, "no", 2) == 0) { name += 2; enable = FALSE; } if (!val || xf86NameCmp(val, "enable") == 0 || xf86NameCmp(val, "enabled") == 0 || xf86NameCmp(val, "on") == 0 || xf86NameCmp(val, "1") == 0 || xf86NameCmp(val, "yes") == 0 || xf86NameCmp(val, "true") == 0) { /* NOTHING NEEDED -- enabling is handled below */ } else if (xf86NameCmp(val, "disable") == 0 || xf86NameCmp(val, "disabled") == 0 || xf86NameCmp(val, "off") == 0 || xf86NameCmp(val, "0") == 0 || xf86NameCmp(val, "no") == 0 || xf86NameCmp(val, "false") == 0) { enable = !enable; } else { xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val); free(n); continue; } if (EnableDisableExtension(name, enable)) { xf86Msg(X_CONFIG, "Extension \"%s\" is %s\n", name, enable ? "enabled" : "disabled"); } else { xf86Msg(X_WARNING, "Ignoring unrecognized extension \"%s\"\n", name); } free(n); } } } static Bool configInput(InputInfoPtr inputp, XF86ConfInputPtr conf_input, MessageType from) { xf86Msg(from, "|-->Input Device \"%s\"\n", conf_input->inp_identifier); inputp->name = conf_input->inp_identifier; inputp->driver = conf_input->inp_driver; inputp->options = conf_input->inp_option_lst; inputp->attrs = NULL; return TRUE; } static Bool modeIsPresent(DisplayModePtr mode, MonPtr monitorp) { DisplayModePtr knownmodes = monitorp->Modes; /* all I can think of is a linear search... */ while (knownmodes != NULL) { if (!strcmp(mode->name, knownmodes->name) && !(knownmodes->type & M_T_DEFAULT)) return TRUE; knownmodes = knownmodes->next; } return FALSE; } static Bool addDefaultModes(MonPtr monitorp) { DisplayModePtr mode; DisplayModePtr last = monitorp->Last; int i = 0; for (i = 0; i < xf86NumDefaultModes; i++) { mode = xf86DuplicateMode(&xf86DefaultModes[i]); if (!modeIsPresent(mode, monitorp)) { monitorp->Modes = xf86ModesAdd(monitorp->Modes, mode); last = mode; } else { free(mode); } } monitorp->Last = last; return TRUE; } static void checkInput(serverLayoutPtr layout, Bool implicit_layout) { checkCoreInputDevices(layout, implicit_layout); /* Unless we're forcing input devices, disable mouse/kbd devices in the * config. Otherwise the same physical device is added multiple times, * leading to duplicate events. */ if (!xf86Info.forceInputDevices && layout->inputs) { InputInfoPtr *dev = layout->inputs; BOOL warned = FALSE; while (*dev) { if (strcmp((*dev)->driver, "kbd") == 0 || strcmp((*dev)->driver, "mouse") == 0 || strcmp((*dev)->driver, "vmmouse") == 0) { InputInfoPtr *current; if (!warned) { xf86Msg(X_WARNING, "Hotplugging is on, devices using " "drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n"); warned = TRUE; } xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->name); current = dev; free(*dev); *dev = NULL; do { *current = *(current + 1); current++; } while (*current); } else dev++; } } } /* * load the config file and fill the global data structure */ ConfigStatus xf86HandleConfigFile(Bool autoconfig) { const char *scanptr; Bool singlecard = 0; Bool implicit_layout = FALSE; XF86ConfLayoutPtr layout; if (!autoconfig) { char *filename, *dirname, *sysdirname; const char *filesearch, *dirsearch; MessageType filefrom = X_DEFAULT; MessageType dirfrom = X_DEFAULT; if (!xf86PrivsElevated()) { filesearch = ALL_CONFIGPATH; dirsearch = ALL_CONFIGDIRPATH; } else { filesearch = RESTRICTED_CONFIGPATH; dirsearch = RESTRICTED_CONFIGDIRPATH; } if (xf86ConfigFile) filefrom = X_CMDLINE; if (xf86ConfigDir) dirfrom = X_CMDLINE; xf86initConfigFiles(); sysdirname = xf86openConfigDirFiles(SYS_CONFIGDIRPATH, NULL, PROJECTROOT); dirname = xf86openConfigDirFiles(dirsearch, xf86ConfigDir, PROJECTROOT); filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT); if (filename) { xf86MsgVerb(filefrom, 0, "Using config file: \"%s\"\n", filename); xf86ConfigFile = xnfstrdup(filename); } else { if (xf86ConfigFile) xf86Msg(X_ERROR, "Unable to locate/open config file: \"%s\"\n", xf86ConfigFile); } if (dirname) { xf86MsgVerb(dirfrom, 0, "Using config directory: \"%s\"\n", dirname); xf86ConfigDir = xnfstrdup(dirname); } else { if (xf86ConfigDir) xf86Msg(X_ERROR, "Unable to locate/open config directory: \"%s\"\n", xf86ConfigDir); } if (sysdirname) xf86MsgVerb(X_DEFAULT, 0, "Using system config directory \"%s\"\n", sysdirname); if (!filename && !dirname && !sysdirname) return CONFIG_NOFILE; free(filename); free(dirname); free(sysdirname); } if ((xf86configptr = xf86readConfigFile()) == NULL) { xf86Msg(X_ERROR, "Problem parsing the config file\n"); return CONFIG_PARSE_ERROR; } xf86closeConfigFile(); /* Initialise a few things. */ /* * now we convert part of the information contained in the parser * structures into our own structures. * The important part here is to figure out which Screen Sections * in the XF86Config file are active so that we can piece together * the modes that we need later down the road. * And while we are at it, we'll decode the rest of the stuff as well */ /* First check if a layout section is present, and if it is valid. */ FIND_SUITABLE(XF86ConfLayoutPtr, xf86configptr->conf_layout_lst, layout); if (layout == NULL || xf86ScreenName != NULL) { XF86ConfScreenPtr screen; if (xf86ScreenName == NULL) { xf86Msg(X_DEFAULT, "No Layout section. Using the first Screen section.\n"); } FIND_SUITABLE (XF86ConfScreenPtr, xf86configptr->conf_screen_lst, screen); if (!configImpliedLayout(&xf86ConfigLayout, screen, xf86configptr)) { xf86Msg(X_ERROR, "Unable to determine the screen layout\n"); return CONFIG_PARSE_ERROR; } implicit_layout = TRUE; } else { if (xf86configptr->conf_flags != NULL) { char *dfltlayout = NULL; void *optlist = xf86configptr->conf_flags->flg_option_lst; if (optlist && xf86FindOption(optlist, "defaultserverlayout")) dfltlayout = xf86SetStrOption(optlist, "defaultserverlayout", NULL); if (!configLayout(&xf86ConfigLayout, layout, dfltlayout)) { xf86Msg(X_ERROR, "Unable to determine the screen layout\n"); return CONFIG_PARSE_ERROR; } } else { if (!configLayout(&xf86ConfigLayout, layout, NULL)) { xf86Msg(X_ERROR, "Unable to determine the screen layout\n"); return CONFIG_PARSE_ERROR; } } } xf86ProcessOptions(-1, xf86ConfigLayout.options, LayoutOptions); #ifdef XSERVER_LIBPCIACCESS if ((scanptr = xf86GetOptValString(LayoutOptions, LAYOUT_ISOLATEDEVICE))) { ; /* IsolateDevice specified; overrides SingleCard */ } else { xf86GetOptValBool(LayoutOptions, LAYOUT_SINGLECARD, &singlecard); if (singlecard) scanptr = xf86ConfigLayout.screens->screen->device->busID; } if (scanptr) { if (strncmp(scanptr, "PCI:", 4) != 0) { xf86Msg(X_WARNING, "Bus types other than PCI not yet isolable.\n" "\tIgnoring IsolateDevice option.\n"); } else xf86PciIsolateDevice(scanptr); } #endif /* Now process everything else */ configServerFlags(xf86configptr->conf_flags, xf86ConfigLayout.options); configFiles(xf86configptr->conf_files); configExtensions(xf86configptr->conf_extensions); #ifdef XF86DRI configDRI(xf86configptr->conf_dri); #endif checkInput(&xf86ConfigLayout, implicit_layout); /* * Handle some command line options that can override some of the * ServerFlags settings. */ #ifdef XF86VIDMODE if (xf86VidModeDisabled) xf86Info.vidModeEnabled = FALSE; if (xf86VidModeAllowNonLocal) xf86Info.vidModeAllowNonLocal = TRUE; #endif if (xf86AllowMouseOpenFail) xf86Info.allowMouseOpenFail = TRUE; return CONFIG_OK; } Bool xf86PathIsSafe(const char *path) { return (xf86pathIsSafe(path) != 0); } xorg-server-1.17.1/hw/xfree86/common/xf86Cursor.c0000664000175100017510000006233312366751547016372 00000000000000/* * Copyright (c) 1994-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "input.h" #include "cursor.h" #include "mipointer.h" #include "scrnintstr.h" #include "globals.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSproc.h" #include #include "xf86Xinput.h" #ifdef XFreeXDGA #include "dgaproc.h" #endif typedef struct _xf86EdgeRec { short screen; short start; short end; DDXPointRec offset; struct _xf86EdgeRec *next; } xf86EdgeRec, *xf86EdgePtr; typedef struct { xf86EdgePtr left, right, up, down; } xf86ScreenLayoutRec, *xf86ScreenLayoutPtr; 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(ScrnInfoPtr pScrn, int x, int y); static miPointerScreenFuncRec xf86PointerScreenFuncs = { xf86CursorOffScreen, xf86CrossScreen, xf86WarpCursor, }; static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS]; /* * xf86InitViewport -- * Initialize paning & zooming parameters, so that a driver must only * check what resolutions are possible and whether the virtual area * is valid if specified. */ void xf86InitViewport(ScrnInfoPtr pScr) { pScr->PointerMoved = xf86PointerMoved; /* * Compute the initial Viewport if necessary */ if (pScr->display) { if (pScr->display->frameX0 < 0) { pScr->frameX0 = (pScr->virtualX - pScr->modes->HDisplay) / 2; pScr->frameY0 = (pScr->virtualY - pScr->modes->VDisplay) / 2; } else { pScr->frameX0 = pScr->display->frameX0; pScr->frameY0 = pScr->display->frameY0; } } pScr->frameX1 = pScr->frameX0 + pScr->modes->HDisplay - 1; pScr->frameY1 = pScr->frameY0 + pScr->modes->VDisplay - 1; /* * Now adjust the initial Viewport, so it lies within the virtual area */ if (pScr->frameX1 >= pScr->virtualX) { pScr->frameX0 = pScr->virtualX - pScr->modes->HDisplay; pScr->frameX1 = pScr->frameX0 + pScr->modes->HDisplay - 1; } if (pScr->frameY1 >= pScr->virtualY) { pScr->frameY0 = pScr->virtualY - pScr->modes->VDisplay; pScr->frameY1 = pScr->frameY0 + pScr->modes->VDisplay - 1; } } /* * xf86SetViewport -- * Scroll the visual part of the screen so the pointer is visible. */ void xf86SetViewport(ScreenPtr pScreen, int x, int y) { ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); (*pScr->PointerMoved) (pScr, x, y); } static void xf86PointerMoved(ScrnInfoPtr pScr, int x, int y) { Bool frameChanged = FALSE; /* * check wether (x,y) belongs to the visual part of the screen * if not, change the base of the displayed frame accoring */ if (pScr->frameX0 > x) { pScr->frameX0 = x; pScr->frameX1 = x + pScr->currentMode->HDisplay - 1; frameChanged = TRUE; } if (pScr->frameX1 < x) { pScr->frameX1 = x + 1; pScr->frameX0 = x - pScr->currentMode->HDisplay + 1; frameChanged = TRUE; } if (pScr->frameY0 > y) { pScr->frameY0 = y; pScr->frameY1 = y + pScr->currentMode->VDisplay - 1; frameChanged = TRUE; } if (pScr->frameY1 < y) { pScr->frameY1 = y; pScr->frameY0 = y - pScr->currentMode->VDisplay + 1; frameChanged = TRUE; } if (frameChanged && pScr->AdjustFrame != NULL) pScr->AdjustFrame(pScr, pScr->frameX0, pScr->frameY0); } /* * xf86LockZoom -- * Enable/disable ZoomViewport */ void xf86LockZoom(ScreenPtr pScreen, Bool lock) { ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); pScr->zoomLocked = lock; } /* * xf86SwitchMode -- * This is called by both keyboard processing and the VidMode extension to * set a new mode. */ Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) { ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); ScreenPtr pCursorScreen; Bool Switched; int px, py; DeviceIntPtr dev, it; if (!pScr->vtSema || !mode || !pScr->SwitchMode) return FALSE; #ifdef XFreeXDGA if (DGAActive(pScr->scrnIndex)) return FALSE; #endif if (mode == pScr->currentMode) return TRUE; if (mode->HDisplay > pScr->virtualX || mode->VDisplay > pScr->virtualY) return FALSE; /* Let's take an educated guess for which pointer to take here. And about as educated as it gets is to take the first pointer we find. */ for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsPointerDevice(dev) && dev->spriteInfo->spriteOwner) break; } pCursorScreen = miPointerGetScreen(dev); if (pScreen == pCursorScreen) miPointerGetPosition(dev, &px, &py); OsBlockSIGIO(); Switched = (*pScr->SwitchMode) (pScr, mode); if (Switched) { pScr->currentMode = mode; /* * Adjust frame for new display size. * Frame is centered around cursor position if cursor is on same screen. */ if (pScreen == pCursorScreen) pScr->frameX0 = px - (mode->HDisplay / 2) + 1; else pScr->frameX0 = (pScr->frameX0 + pScr->frameX1 + 1 - mode->HDisplay) / 2; if (pScr->frameX0 < 0) pScr->frameX0 = 0; pScr->frameX1 = pScr->frameX0 + mode->HDisplay - 1; if (pScr->frameX1 >= pScr->virtualX) { pScr->frameX0 = pScr->virtualX - mode->HDisplay; pScr->frameX1 = pScr->virtualX - 1; } if (pScreen == pCursorScreen) pScr->frameY0 = py - (mode->VDisplay / 2) + 1; else pScr->frameY0 = (pScr->frameY0 + pScr->frameY1 + 1 - mode->VDisplay) / 2; if (pScr->frameY0 < 0) pScr->frameY0 = 0; pScr->frameY1 = pScr->frameY0 + mode->VDisplay - 1; if (pScr->frameY1 >= pScr->virtualY) { pScr->frameY0 = pScr->virtualY - mode->VDisplay; pScr->frameY1 = pScr->virtualY - 1; } } OsReleaseSIGIO(); if (pScr->AdjustFrame) (*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: * - center around the first pointer * - move all other pointers to the nearest edge on the screen (or leave * them unmodified if they are within the boundaries). */ if (pScreen == pCursorScreen) { xf86WarpCursor(dev, pScreen, px, py); } for (it = inputInfo.devices; it; it = it->next) { if (it == dev) continue; if (IsPointerDevice(it) && it->spriteInfo->spriteOwner) { pCursorScreen = miPointerGetScreen(it); if (pScreen == pCursorScreen) { miPointerGetPosition(it, &px, &py); if (px < pScr->frameX0) px = pScr->frameX0; else if (px > pScr->frameX1) px = pScr->frameX1; if (py < pScr->frameY0) py = pScr->frameY0; else if (py > pScr->frameY1) py = pScr->frameY1; xf86WarpCursor(it, pScreen, px, py); } } } return Switched; } /* * xf86ZoomViewport -- * Reinitialize the visual part of the screen for another mode. */ void xf86ZoomViewport(ScreenPtr pScreen, int zoom) { ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); DisplayModePtr mode; if (pScr->zoomLocked || !(mode = pScr->currentMode)) return; do { if (zoom > 0) mode = mode->next; else mode = mode->prev; } while (mode != pScr->currentMode && !(mode->type & M_T_USERDEF)); (void) xf86SwitchMode(pScreen, mode); } static xf86EdgePtr FindEdge(xf86EdgePtr edge, int val) { while (edge && (edge->end <= val)) edge = edge->next; if (edge && (edge->start <= val)) return edge; return NULL; } /* * xf86CursorOffScreen -- * Check whether it is necessary to switch to another screen */ static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y) { xf86EdgePtr edge; int tmp; if (screenInfo.numScreens == 1) return FALSE; if (*x < 0) { tmp = *y; if (tmp < 0) tmp = 0; if (tmp >= (*pScreen)->height) tmp = (*pScreen)->height - 1; if ((edge = xf86ScreenLayout[(*pScreen)->myNum].left)) edge = FindEdge(edge, tmp); if (!edge) *x = 0; else { *x += edge->offset.x; *y += edge->offset.y; *pScreen = xf86Screens[edge->screen]->pScreen; } } if (*x >= (*pScreen)->width) { tmp = *y; if (tmp < 0) tmp = 0; if (tmp >= (*pScreen)->height) tmp = (*pScreen)->height - 1; if ((edge = xf86ScreenLayout[(*pScreen)->myNum].right)) edge = FindEdge(edge, tmp); if (!edge) *x = (*pScreen)->width - 1; else { *x += edge->offset.x; *y += edge->offset.y; *pScreen = xf86Screens[edge->screen]->pScreen; } } if (*y < 0) { tmp = *x; if (tmp < 0) tmp = 0; if (tmp >= (*pScreen)->width) tmp = (*pScreen)->width - 1; if ((edge = xf86ScreenLayout[(*pScreen)->myNum].up)) edge = FindEdge(edge, tmp); if (!edge) *y = 0; else { *x += edge->offset.x; *y += edge->offset.y; *pScreen = xf86Screens[edge->screen]->pScreen; } } if (*y >= (*pScreen)->height) { tmp = *x; if (tmp < 0) tmp = 0; if (tmp >= (*pScreen)->width) tmp = (*pScreen)->width - 1; if ((edge = xf86ScreenLayout[(*pScreen)->myNum].down)) edge = FindEdge(edge, tmp); if (!edge) *y = (*pScreen)->height - 1; else { *x += edge->offset.x; *y += edge->offset.y; (*pScreen) = xf86Screens[edge->screen]->pScreen; } } return TRUE; } /* * xf86CrossScreen -- * Switch to another screen * * Currently nothing special happens, but mi assumes the CrossScreen * method exists. */ static void xf86CrossScreen(ScreenPtr pScreen, Bool entering) { } /* * xf86WarpCursor -- * Warp possible to another screen */ /* ARGSUSED */ static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { OsBlockSIGIO(); miPointerWarpCursor(pDev, pScreen, x, y); xf86Info.currentScreen = pScreen; OsReleaseSIGIO(); } void * xf86GetPointerScreenFuncs(void) { return (void *) &xf86PointerScreenFuncs; } static xf86EdgePtr AddEdge(xf86EdgePtr edge, short min, short max, short dx, short dy, short screen) { xf86EdgePtr pEdge = edge, pPrev = NULL, pNew; while (1) { while (pEdge && (min >= pEdge->end)) { pPrev = pEdge; pEdge = pEdge->next; } if (!pEdge) { if (!(pNew = malloc(sizeof(xf86EdgeRec)))) break; pNew->screen = screen; pNew->start = min; pNew->end = max; pNew->offset.x = dx; pNew->offset.y = dy; pNew->next = NULL; if (pPrev) pPrev->next = pNew; else edge = pNew; break; } else if (min < pEdge->start) { if (!(pNew = malloc(sizeof(xf86EdgeRec)))) break; pNew->screen = screen; pNew->start = min; pNew->offset.x = dx; pNew->offset.y = dy; pNew->next = pEdge; if (pPrev) pPrev->next = pNew; else edge = pNew; if (max <= pEdge->start) { pNew->end = max; break; } else { pNew->end = pEdge->start; min = pEdge->end; } } else min = pEdge->end; pPrev = pEdge; pEdge = pEdge->next; if (max <= min) break; } return edge; } static void FillOutEdge(xf86EdgePtr pEdge, int limit) { xf86EdgePtr pNext; int diff; if (pEdge->start > 0) pEdge->start = 0; while ((pNext = pEdge->next)) { diff = pNext->start - pEdge->end; if (diff > 0) { pEdge->end += diff >> 1; pNext->start -= diff - (diff >> 1); } pEdge = pNext; } if (pEdge->end < limit) pEdge->end = limit; } /* * xf86InitOrigins() can deal with a maximum of 32 screens * on 32 bit architectures, 64 on 64 bit architectures. */ void xf86InitOrigins(void) { unsigned long screensLeft, prevScreensLeft, mask; screenLayoutPtr screen; ScreenPtr pScreen, refScreen; int x1, x2, y1, y2, left, right, top, bottom; int i, j, ref, minX, minY, min, max; xf86ScreenLayoutPtr pLayout; Bool OldStyleConfig = FALSE; memset(xf86ScreenLayout, 0, MAXSCREENS * sizeof(xf86ScreenLayoutRec)); screensLeft = prevScreensLeft = (1 << xf86NumScreens) - 1; while (1) { for (mask = screensLeft, i = 0; mask; mask >>= 1, i++) { if (!(mask & 1L)) continue; screen = &xf86ConfigLayout.screens[i]; if (screen->refscreen != NULL && screen->refscreen->screennum >= xf86NumScreens) { screensLeft &= ~(1 << i); xf86Msg(X_WARNING, "Not including screen \"%s\" in origins calculation.\n", screen->screen->id); continue; } pScreen = xf86Screens[i]->pScreen; switch (screen->where) { case PosObsolete: OldStyleConfig = TRUE; pLayout = &xf86ScreenLayout[i]; /* force edge lists */ if (screen->left) { ref = screen->left->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } pLayout->left = AddEdge(pLayout->left, 0, pScreen->height, xf86Screens[ref]->pScreen->width, 0, ref); } if (screen->right) { ref = screen->right->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } pLayout->right = AddEdge(pLayout->right, 0, pScreen->height, -pScreen->width, 0, ref); } if (screen->top) { ref = screen->top->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } pLayout->up = AddEdge(pLayout->up, 0, pScreen->width, 0, xf86Screens[ref]->pScreen->height, ref); } if (screen->bottom) { ref = screen->bottom->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } pLayout->down = AddEdge(pLayout->down, 0, pScreen->width, 0, -pScreen->height, ref); } /* we could also try to place it based on those relative locations if we wanted to */ screen->x = screen->y = 0; /* FALLTHROUGH */ case PosAbsolute: pScreen->x = screen->x; pScreen->y = screen->y; screensLeft &= ~(1 << i); break; case PosRelative: ref = screen->refscreen->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } if (screensLeft & (1 << ref)) break; refScreen = xf86Screens[ref]->pScreen; pScreen->x = refScreen->x + screen->x; pScreen->y = refScreen->y + screen->y; screensLeft &= ~(1 << i); break; case PosRightOf: ref = screen->refscreen->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } if (screensLeft & (1 << ref)) break; refScreen = xf86Screens[ref]->pScreen; pScreen->x = refScreen->x + refScreen->width; pScreen->y = refScreen->y; screensLeft &= ~(1 << i); break; case PosLeftOf: ref = screen->refscreen->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } if (screensLeft & (1 << ref)) break; refScreen = xf86Screens[ref]->pScreen; pScreen->x = refScreen->x - pScreen->width; pScreen->y = refScreen->y; screensLeft &= ~(1 << i); break; case PosBelow: ref = screen->refscreen->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } if (screensLeft & (1 << ref)) break; refScreen = xf86Screens[ref]->pScreen; pScreen->x = refScreen->x; pScreen->y = refScreen->y + refScreen->height; screensLeft &= ~(1 << i); break; case PosAbove: ref = screen->refscreen->screennum; if (!xf86Screens[ref] || !xf86Screens[ref]->pScreen) { ErrorF("Referenced uninitialized screen in Layout!\n"); break; } if (screensLeft & (1 << ref)) break; refScreen = xf86Screens[ref]->pScreen; pScreen->x = refScreen->x; pScreen->y = refScreen->y - pScreen->height; screensLeft &= ~(1 << i); break; default: ErrorF("Illegal placement keyword in Layout!\n"); break; } } if (!screensLeft) break; if (screensLeft == prevScreensLeft) { /* All the remaining screens are referencing each other. Assign a value to one of them and go through again */ i = 0; while (!((1 << i) & screensLeft)) { i++; } ref = xf86ConfigLayout.screens[i].refscreen->screennum; xf86Screens[ref]->pScreen->x = xf86Screens[ref]->pScreen->y = 0; screensLeft &= ~(1 << ref); } prevScreensLeft = screensLeft; } /* justify the topmost and leftmost to (0,0) */ minX = xf86Screens[0]->pScreen->x; minY = xf86Screens[0]->pScreen->y; for (i = 1; i < xf86NumScreens; i++) { if (xf86Screens[i]->pScreen->x < minX) minX = xf86Screens[i]->pScreen->x; if (xf86Screens[i]->pScreen->y < minY) minY = xf86Screens[i]->pScreen->y; } if (minX || minY) { for (i = 0; i < xf86NumScreens; i++) { xf86Screens[i]->pScreen->x -= minX; xf86Screens[i]->pScreen->y -= minY; } } /* Create the edge lists */ if (!OldStyleConfig) { for (i = 0; i < xf86NumScreens; i++) { pLayout = &xf86ScreenLayout[i]; pScreen = xf86Screens[i]->pScreen; left = pScreen->x; right = left + pScreen->width; top = pScreen->y; bottom = top + pScreen->height; for (j = 0; j < xf86NumScreens; j++) { if (i == j) continue; refScreen = xf86Screens[j]->pScreen; x1 = refScreen->x; x2 = x1 + refScreen->width; y1 = refScreen->y; y2 = y1 + refScreen->height; if ((bottom > y1) && (top < y2)) { min = y1 - top; if (min < 0) min = 0; max = pScreen->height - (bottom - y2); if (max > pScreen->height) max = pScreen->height; if (((left - 1) >= x1) && ((left - 1) < x2)) pLayout->left = AddEdge(pLayout->left, min, max, pScreen->x - refScreen->x, pScreen->y - refScreen->y, j); if ((right >= x1) && (right < x2)) pLayout->right = AddEdge(pLayout->right, min, max, pScreen->x - refScreen->x, pScreen->y - refScreen->y, j); } if ((left < x2) && (right > x1)) { min = x1 - left; if (min < 0) min = 0; max = pScreen->width - (right - x2); if (max > pScreen->width) max = pScreen->width; if (((top - 1) >= y1) && ((top - 1) < y2)) pLayout->up = AddEdge(pLayout->up, min, max, pScreen->x - refScreen->x, pScreen->y - refScreen->y, j); if ((bottom >= y1) && (bottom < y2)) pLayout->down = AddEdge(pLayout->down, min, max, pScreen->x - refScreen->x, pScreen->y - refScreen->y, j); } } } } if (!OldStyleConfig) { for (i = 0; i < xf86NumScreens; i++) { pLayout = &xf86ScreenLayout[i]; pScreen = xf86Screens[i]->pScreen; if (pLayout->left) FillOutEdge(pLayout->left, pScreen->height); if (pLayout->right) FillOutEdge(pLayout->right, pScreen->height); if (pLayout->up) FillOutEdge(pLayout->up, pScreen->width); if (pLayout->down) FillOutEdge(pLayout->down, pScreen->width); } } update_desktop_dimensions(); } void xf86ReconfigureLayout(void) { int i; for (i = 0; i < MAXSCREENS; i++) { xf86ScreenLayoutPtr sl = &xf86ScreenLayout[i]; /* we don't have to zero these, xf86InitOrigins() takes care of that */ free(sl->left); free(sl->right); free(sl->up); free(sl->down); } xf86InitOrigins(); } xorg-server-1.17.1/hw/xfree86/common/vesamodes0000664000175100017510000001070512160102336016114 00000000000000// // Default modes distilled from // "VESA and Industry Standards and Guide for Computer Display Monitor // Timing", version 1.0, revision 0.8, adopted September 17, 1998. // // $XFree86: xc/programs/Xserver/hw/xfree86/etc/vesamodes,v 1.3 1999/11/16 03:28:03 tsi Exp $ # 640x350 @ 85Hz (VESA) hsync: 37.9kHz ModeLine "640x350" 31.5 640 672 736 832 350 382 385 445 +hsync -vsync # 640x400 @ 85Hz (VESA) hsync: 37.9kHz ModeLine "640x400" 31.5 640 672 736 832 400 401 404 445 -hsync +vsync # 720x400 @ 85Hz (VESA) hsync: 37.9kHz ModeLine "720x400" 35.5 720 756 828 936 400 401 404 446 -hsync +vsync # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz ModeLine "640x480" 25.175 640 656 752 800 480 490 492 525 -hsync -vsync # 640x480 @ 72Hz (VESA) hsync: 37.9kHz ModeLine "640x480" 31.5 640 664 704 832 480 489 492 520 -hsync -vsync # 640x480 @ 75Hz (VESA) hsync: 37.5kHz ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync # 640x480 @ 85Hz (VESA) hsync: 43.3kHz ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync # 800x600 @ 56Hz (VESA) hsync: 35.2kHz ModeLine "800x600" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync # 800x600 @ 60Hz (VESA) hsync: 37.9kHz ModeLine "800x600" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync # 800x600 @ 72Hz (VESA) hsync: 48.1kHz ModeLine "800x600" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync # 800x600 @ 75Hz (VESA) hsync: 46.9kHz ModeLine "800x600" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync # 800x600 @ 85Hz (VESA) hsync: 53.7kHz ModeLine "800x600" 56.3 800 832 896 1048 600 601 604 631 +hsync +vsync # 1024x768i @ 43Hz (industry standard) hsync: 35.5kHz ModeLine "1024x768" 44.9 1024 1032 1208 1264 768 768 776 817 +hsync +vsync Interlace # 1024x768 @ 60Hz (VESA) hsync: 48.4kHz ModeLine "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync # 1024x768 @ 70Hz (VESA) hsync: 56.5kHz ModeLine "1024x768" 75.0 1024 1048 1184 1328 768 771 777 806 -hsync -vsync # 1024x768 @ 75Hz (VESA) hsync: 60.0kHz ModeLine "1024x768" 78.75 1024 1040 1136 1312 768 769 772 800 +hsync +vsync # 1024x768 @ 85Hz (VESA) hsync: 68.7kHz ModeLine "1024x768" 94.5 1024 1072 1168 1376 768 769 772 808 +hsync +vsync # 1152x864 @ 75Hz (VESA) hsync: 67.5kHz ModeLine "1152x864" 108.0 1152 1216 1344 1600 864 865 868 900 +hsync +vsync # 1280x960 @ 60Hz (VESA) hsync: 60.0kHz ModeLine "1280x960" 108.0 1280 1376 1488 1800 960 961 964 1000 +hsync +vsync # 1280x960 @ 85Hz (VESA) hsync: 85.9kHz ModeLine "1280x960" 148.5 1280 1344 1504 1728 960 961 964 1011 +hsync +vsync # 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz ModeLine "1280x1024" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync # 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz ModeLine "1280x1024" 135.0 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync # 1280x1024 @ 85Hz (VESA) hsync: 91.1kHz ModeLine "1280x1024" 157.5 1280 1344 1504 1728 1024 1025 1028 1072 +hsync +vsync # 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz ModeLine "1600x1200" 162.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync # 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz ModeLine "1600x1200" 175.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync # 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz ModeLine "1600x1200" 189.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync # 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz ModeLine "1600x1200" 202.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync # 1600x1200 @ 85Hz (VESA) hsync: 106.3kHz ModeLine "1600x1200" 229.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync # 1792x1344 @ 60Hz (VESA) hsync: 83.6kHz ModeLine "1792x1344" 204.8 1792 1920 2120 2448 1344 1345 1348 1394 -hsync +vsync # 1792x1344 @ 75Hz (VESA) hsync: 106.3kHz ModeLine "1792x1344" 261.0 1792 1888 2104 2456 1344 1345 1348 1417 -hsync +vsync # 1856x1392 @ 60Hz (VESA) hsync: 86.3kHz ModeLine "1856x1392" 218.3 1856 1952 2176 2528 1392 1393 1396 1439 -hsync +vsync # 1856x1392 @ 75Hz (VESA) hsync: 112.5kHz ModeLine "1856x1392" 288.0 1856 1984 2208 2560 1392 1393 1396 1500 -hsync +vsync # 1920x1440 @ 60Hz (VESA) hsync: 90.0kHz ModeLine "1920x1440" 234.0 1920 2048 2256 2600 1440 1441 1444 1500 -hsync +vsync # 1920x1440 @ 75Hz (VESA) hsync: 112.5kHz ModeLine "1920x1440" 297.0 1920 2064 2288 2640 1440 1441 1444 1500 -hsync +vsync xorg-server-1.17.1/hw/xfree86/common/dgaproc.h0000664000175100017510000000740412274325511016005 00000000000000 #ifndef __DGAPROC_H #define __DGAPROC_H #include #include "pixmap.h" #define DGA_CONCURRENT_ACCESS 0x00000001 #define DGA_FILL_RECT 0x00000002 #define DGA_BLIT_RECT 0x00000004 #define DGA_BLIT_RECT_TRANS 0x00000008 #define DGA_PIXMAP_AVAILABLE 0x00000010 #define DGA_INTERLACED 0x00010000 #define DGA_DOUBLESCAN 0x00020000 #define DGA_FLIP_IMMEDIATE 0x00000001 #define DGA_FLIP_RETRACE 0x00000002 #define DGA_COMPLETED 0x00000000 #define DGA_PENDING 0x00000001 #define DGA_NEED_ROOT 0x00000001 typedef struct { int num; /* A unique identifier for the mode (num > 0) */ const char *name; /* name of mode given in the XF86Config */ int VSync_num; int VSync_den; int flags; /* DGA_CONCURRENT_ACCESS, etc... */ int imageWidth; /* linear accessible portion (pixels) */ int imageHeight; int pixmapWidth; /* Xlib accessible portion (pixels) */ int pixmapHeight; /* both fields ignored if no concurrent access */ int bytesPerScanline; int byteOrder; /* MSBFirst, LSBFirst */ int depth; int bitsPerPixel; unsigned long red_mask; unsigned long green_mask; unsigned long blue_mask; short visualClass; int viewportWidth; int viewportHeight; int xViewportStep; /* viewport position granularity */ int yViewportStep; int maxViewportX; /* max viewport origin */ int maxViewportY; int viewportFlags; /* types of page flipping possible */ int offset; int reserved1; int reserved2; } XDGAModeRec, *XDGAModePtr; /* DDX interface */ extern _X_EXPORT int DGASetMode(int Index, int num, XDGAModePtr mode, PixmapPtr *pPix); extern _X_EXPORT void DGASetInputMode(int Index, Bool keyboard, Bool mouse); 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); extern _X_EXPORT int DGAGetViewportStatus(int Index); extern _X_EXPORT int DGASync(int Index); extern _X_EXPORT int DGAFillRect(int Index, int x, int y, int w, int h, unsigned long color); extern _X_EXPORT int DGABlitRect(int Index, int srcx, int srcy, int w, int h, int dstx, int dsty); extern _X_EXPORT int DGABlitTransRect(int Index, int srcx, int srcy, int w, int h, int dstx, int dsty, unsigned long color); extern _X_EXPORT int DGASetViewport(int Index, int x, int y, int mode); extern _X_EXPORT int DGAGetModes(int Index); extern _X_EXPORT int DGAGetOldDGAMode(int Index); extern _X_EXPORT int DGAGetModeInfo(int Index, XDGAModePtr mode, int num); extern _X_EXPORT Bool DGAVTSwitch(void); extern _X_EXPORT Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index, int button, int is_down); extern _X_EXPORT Bool DGAStealMotionEvent(DeviceIntPtr dev, int Index, int dx, int dy); extern _X_EXPORT Bool DGAStealKeyEvent(DeviceIntPtr dev, int Index, int key_code, int is_down); extern _X_EXPORT Bool DGAOpenFramebuffer(int Index, char **name, unsigned char **mem, int *size, int *offset, int *flags); extern _X_EXPORT void DGACloseFramebuffer(int Index); 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); #endif /* __DGAPROC_H */ xorg-server-1.17.1/hw/xfree86/common/xf86Optionstr.h0000664000175100017510000000273712274325511017107 00000000000000/* * Copyright © 2011 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. * */ #ifndef XF86OPTIONSTR_H #define XF86OPTIONSTR_H #include "list.h" /* * All options are stored using this data type. */ typedef struct _XF86OptionRec { GenericListRec list; const char *opt_name; const char *opt_val; int opt_used; const char *opt_comment; } XF86OptionRec; typedef struct _InputOption *XF86OptionPtr; #endif xorg-server-1.17.1/hw/xfree86/common/xf86Helper.c0000664000175100017510000015542512366220413016320 00000000000000/* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * Authors: Dirk Hohndel * David Dawes * ... and others * * This file includes the helper functions that the server provides for * different drivers. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "servermd.h" #include "pixmapstr.h" #include "windowstr.h" #include "propertyst.h" #include "gcstruct.h" #include "loaderProcs.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "micmap.h" #include "xf86DDC.h" #include "xf86Xinput.h" #include "xf86InPriv.h" #include "mivalidate.h" #include "xf86Crtc.h" /* For xf86GetClocks */ #if defined(CSRG_BASED) || defined(__GNU__) #define HAS_SETPRIORITY #include #endif static int xf86ScrnInfoPrivateCount = 0; /* Add a pointer to a new DriverRec to xf86DriverList */ void xf86AddDriver(DriverPtr driver, void *module, int flags) { /* Don't add null entries */ if (!driver) return; if (xf86DriverList == NULL) xf86NumDrivers = 0; xf86NumDrivers++; xf86DriverList = xnfrealloc(xf86DriverList, xf86NumDrivers * sizeof(DriverPtr)); xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec)); if (flags & HaveDriverFuncs) *xf86DriverList[xf86NumDrivers - 1] = *driver; else { (void) memset(xf86DriverList[xf86NumDrivers - 1], 0, sizeof(DriverRec)); (void) memcpy(xf86DriverList[xf86NumDrivers - 1], driver, sizeof(DriverRec1)); } xf86DriverList[xf86NumDrivers - 1]->module = module; xf86DriverList[xf86NumDrivers - 1]->refCount = 0; } void xf86DeleteDriver(int drvIndex) { if (xf86DriverList[drvIndex] && (!xf86DriverHasEntities(xf86DriverList[drvIndex]))) { if (xf86DriverList[drvIndex]->module) UnloadModule(xf86DriverList[drvIndex]->module); free(xf86DriverList[drvIndex]); xf86DriverList[drvIndex] = NULL; } } /* Add a pointer to a new InputDriverRec to xf86InputDriverList */ void xf86AddInputDriver(InputDriverPtr driver, void *module, int flags) { /* Don't add null entries */ if (!driver) return; if (xf86InputDriverList == NULL) xf86NumInputDrivers = 0; xf86NumInputDrivers++; xf86InputDriverList = xnfrealloc(xf86InputDriverList, xf86NumInputDrivers * sizeof(InputDriverPtr)); xf86InputDriverList[xf86NumInputDrivers - 1] = xnfalloc(sizeof(InputDriverRec)); *xf86InputDriverList[xf86NumInputDrivers - 1] = *driver; xf86InputDriverList[xf86NumInputDrivers - 1]->module = module; } void xf86DeleteInputDriver(int drvIndex) { if (xf86InputDriverList[drvIndex] && xf86InputDriverList[drvIndex]->module) UnloadModule(xf86InputDriverList[drvIndex]->module); free(xf86InputDriverList[drvIndex]); xf86InputDriverList[drvIndex] = NULL; } InputDriverPtr xf86LookupInputDriver(const char *name) { int i; for (i = 0; i < xf86NumInputDrivers; i++) { if (xf86InputDriverList[i] && xf86InputDriverList[i]->driverName && xf86NameCmp(name, xf86InputDriverList[i]->driverName) == 0) return xf86InputDriverList[i]; } return NULL; } InputInfoPtr xf86LookupInput(const char *name) { InputInfoPtr p; for (p = xf86InputDevs; p != NULL; p = p->next) { if (strcmp(name, p->name) == 0) return p; } return NULL; } /* Allocate a new ScrnInfoRec in xf86Screens */ ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags) { int i; ScrnInfoPtr pScrn; if (flags & XF86_ALLOCATE_GPU_SCREEN) { if (xf86GPUScreens == NULL) xf86NumGPUScreens = 0; i = xf86NumGPUScreens++; xf86GPUScreens = xnfrealloc(xf86GPUScreens, xf86NumGPUScreens * sizeof(ScrnInfoPtr)); xf86GPUScreens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1); pScrn = xf86GPUScreens[i]; pScrn->scrnIndex = i + GPU_SCREEN_OFFSET; /* Changes when a screen is removed */ pScrn->is_gpu = TRUE; } else { if (xf86Screens == NULL) xf86NumScreens = 0; i = xf86NumScreens++; xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr)); xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1); pScrn = xf86Screens[i]; pScrn->scrnIndex = i; /* Changes when a screen is removed */ } pScrn->origIndex = pScrn->scrnIndex; /* This never changes */ pScrn->privates = xnfcalloc(sizeof(DevUnion), xf86ScrnInfoPrivateCount); /* * EnableDisableFBAccess now gets initialized in InitOutput() * pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess; */ pScrn->drv = drv; drv->refCount++; pScrn->module = DuplicateModule(drv->module, NULL); pScrn->DriverFunc = drv->driverFunc; return pScrn; } /* * Remove an entry from xf86Screens. Ideally it should free all allocated * data. To do this properly may require a driver hook. */ void xf86DeleteScreen(ScrnInfoPtr pScrn) { int i; int scrnIndex; Bool is_gpu = FALSE; if (!pScrn) return; 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; } scrnIndex = pScrn->scrnIndex; /* If a FreeScreen function is defined, call it here */ if (pScrn->FreeScreen != NULL) pScrn->FreeScreen(pScrn); while (pScrn->modes) xf86DeleteMode(&pScrn->modes, pScrn->modes); while (pScrn->modePool) xf86DeleteMode(&pScrn->modePool, pScrn->modePool); xf86OptionListFree(pScrn->options); if (pScrn->module) UnloadModule(pScrn->module); if (pScrn->drv) pScrn->drv->refCount--; free(pScrn->privates); xf86ClearEntityListForScreen(pScrn); free(pScrn); /* Move the other entries down, updating their scrnIndex fields */ 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 */ } } } /* * Allocate a private in ScrnInfoRec. */ int xf86AllocateScrnInfoPrivateIndex(void) { int idx, i; ScrnInfoPtr pScr; DevUnion *nprivs; idx = xf86ScrnInfoPrivateCount++; for (i = 0; i < xf86NumScreens; i++) { pScr = xf86Screens[i]; nprivs = xnfrealloc(pScr->privates, xf86ScrnInfoPrivateCount * sizeof(DevUnion)); /* Zero the new private */ 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; } Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad) { int i; if (pScrn->numFormats >= MAXFORMATS) return FALSE; if (bpp <= 0) { if (depth == 1) bpp = 1; else if (depth <= 8) bpp = 8; else if (depth <= 16) bpp = 16; else if (depth <= 32) bpp = 32; else return FALSE; } if (pad <= 0) pad = BITMAP_SCANLINE_PAD; i = pScrn->numFormats++; pScrn->formats[i].depth = depth; pScrn->formats[i].bitsPerPixel = bpp; pScrn->formats[i].scanlinePad = pad; return TRUE; } /* * Set the depth we are using based on (in the following order of preference): * - values given on the command line * - values given in the config file * - values provided by the driver * - an overall default when nothing else is given * * Also find a Display subsection matching the depth/bpp found. * * Sets the following ScrnInfoRec fields: * bitsPerPixel, pixmap24, depth, display, imageByteOrder, * bitmapScanlinePad, bitmapScanlineUnit, bitmapBitOrder, numFormats, * formats, fbFormat. */ /* Can the screen handle 24 bpp pixmaps */ #define DO_PIX24(f) ((f & Support24bppFb) || \ ((f & Support32bppFb) && (f & SupportConvert24to32))) /* Can the screen handle 32 bpp pixmaps */ #define DO_PIX32(f) ((f & Support32bppFb) || \ ((f & Support24bppFb) && (f & SupportConvert32to24))) /* Does the screen prefer 32bpp fb for 24bpp pixmaps */ #define CHOOSE32FOR24(f) ((f & Support32bppFb) && (f & SupportConvert24to32) \ && (f & PreferConvert24to32)) /* Does the screen prefer 24bpp fb for 32bpp pixmaps */ #define CHOOSE24FOR32(f) ((f & Support24bppFb) && (f & SupportConvert32to24) \ && (f & PreferConvert32to24)) /* Can the screen handle 32bpp pixmaps for 24bpp fb */ #define DO_PIX32FOR24(f) ((f & Support24bppFb) && (f & SupportConvert32to24)) /* Can the screen handle 24bpp pixmaps for 32bpp fb */ #define DO_PIX24FOR32(f) ((f & Support32bppFb) && (f & SupportConvert24to32)) #ifndef GLOBAL_DEFAULT_DEPTH #define GLOBAL_DEFAULT_DEPTH 24 #endif Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, int depth24flags) { int i; DispPtr disp; Pix24Flags pix24 = xf86Info.pixmap24; Bool nomatch = FALSE; scrp->bitsPerPixel = -1; scrp->depth = -1; scrp->pixmap24 = Pix24DontCare; scrp->bitsPerPixelFrom = X_DEFAULT; scrp->depthFrom = X_DEFAULT; if (xf86FbBpp > 0) { scrp->bitsPerPixel = xf86FbBpp; scrp->bitsPerPixelFrom = X_CMDLINE; } if (xf86Depth > 0) { scrp->depth = xf86Depth; scrp->depthFrom = X_CMDLINE; } if (xf86FbBpp < 0 && xf86Depth < 0) { if (scrp->confScreen->defaultfbbpp > 0) { scrp->bitsPerPixel = scrp->confScreen->defaultfbbpp; scrp->bitsPerPixelFrom = X_CONFIG; } if (scrp->confScreen->defaultdepth > 0) { scrp->depth = scrp->confScreen->defaultdepth; scrp->depthFrom = X_CONFIG; } if (scrp->confScreen->defaultfbbpp <= 0 && scrp->confScreen->defaultdepth <= 0) { /* * Check for DefaultDepth and DefaultFbBpp options in the * Device sections. */ GDevPtr device; Bool found = FALSE; for (i = 0; i < scrp->numEntities; i++) { device = xf86GetDevFromEntity(scrp->entityList[i], scrp->entityInstanceList[i]); if (device && device->options) { if (xf86FindOption(device->options, "DefaultDepth")) { scrp->depth = xf86SetIntOption(device->options, "DefaultDepth", -1); scrp->depthFrom = X_CONFIG; found = TRUE; } if (xf86FindOption(device->options, "DefaultFbBpp")) { scrp->bitsPerPixel = xf86SetIntOption(device->options, "DefaultFbBpp", -1); scrp->bitsPerPixelFrom = X_CONFIG; found = TRUE; } } if (found) break; } } } /* If none of these is set, pick a default */ if (scrp->bitsPerPixel < 0 && scrp->depth < 0) { if (fbbpp > 0 || depth > 0) { if (fbbpp > 0) scrp->bitsPerPixel = fbbpp; if (depth > 0) scrp->depth = depth; } else { scrp->depth = GLOBAL_DEFAULT_DEPTH; } } /* If any are not given, determine a default for the others */ if (scrp->bitsPerPixel < 0) { /* The depth must be set */ if (scrp->depth > -1) { if (scrp->depth == 1) scrp->bitsPerPixel = 1; else if (scrp->depth <= 4) scrp->bitsPerPixel = 4; else if (scrp->depth <= 8) scrp->bitsPerPixel = 8; else if (scrp->depth <= 16) scrp->bitsPerPixel = 16; else if (scrp->depth <= 24) { /* * Figure out if a choice is possible based on the depth24 * and pix24 flags. */ /* Check pix24 first */ if (pix24 != Pix24DontCare) { if (pix24 == Pix24Use32) { if (DO_PIX32(depth24flags)) { if (CHOOSE24FOR32(depth24flags)) scrp->bitsPerPixel = 24; else scrp->bitsPerPixel = 32; } else { nomatch = TRUE; } } else if (pix24 == Pix24Use24) { if (DO_PIX24(depth24flags)) { if (CHOOSE32FOR24(depth24flags)) scrp->bitsPerPixel = 32; else scrp->bitsPerPixel = 24; } else { nomatch = TRUE; } } } else { if (DO_PIX32(depth24flags)) { if (CHOOSE24FOR32(depth24flags)) scrp->bitsPerPixel = 24; else scrp->bitsPerPixel = 32; } else if (DO_PIX24(depth24flags)) { if (CHOOSE32FOR24(depth24flags)) scrp->bitsPerPixel = 32; else scrp->bitsPerPixel = 24; } } } else if (scrp->depth <= 32) scrp->bitsPerPixel = 32; else { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Specified depth (%d) is greater than 32\n", scrp->depth); return FALSE; } } else { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "xf86SetDepthBpp: internal error: depth and fbbpp" " are both not set\n"); return FALSE; } if (scrp->bitsPerPixel < 0) { if (nomatch) xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Driver can't support depth 24 pixmap format (%d)\n", PIX24TOBPP(pix24)); else if ((depth24flags & (Support24bppFb | Support32bppFb)) == NoDepth24Support) xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Driver can't support depth 24\n"); else xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Can't find fbbpp for depth 24\n"); return FALSE; } scrp->bitsPerPixelFrom = X_PROBED; } if (scrp->depth <= 0) { /* bitsPerPixel is already set */ switch (scrp->bitsPerPixel) { case 32: scrp->depth = 24; break; default: /* 1, 4, 8, 16 and 24 */ scrp->depth = scrp->bitsPerPixel; break; } scrp->depthFrom = X_PROBED; } /* Sanity checks */ if (scrp->depth < 1 || scrp->depth > 32) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Specified depth (%d) is not in the range 1-32\n", scrp->depth); return FALSE; } switch (scrp->bitsPerPixel) { case 1: case 4: case 8: case 16: case 24: case 32: break; default: xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Specified fbbpp (%d) is not a permitted value\n", scrp->bitsPerPixel); return FALSE; } if (scrp->depth > scrp->bitsPerPixel) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Specified depth (%d) is greater than the fbbpp (%d)\n", scrp->depth, scrp->bitsPerPixel); return FALSE; } /* set scrp->pixmap24 if the driver isn't flexible */ if (scrp->bitsPerPixel == 24 && !DO_PIX32FOR24(depth24flags)) { scrp->pixmap24 = Pix24Use24; } if (scrp->bitsPerPixel == 32 && !DO_PIX24FOR32(depth24flags)) { scrp->pixmap24 = Pix24Use32; } /* * Find the Display subsection matching the depth/fbbpp and initialise * scrp->display with it. */ for (i = 0, disp = scrp->confScreen->displays; i < scrp->confScreen->numdisplays; i++, disp++) { if ((disp->depth == scrp->depth && disp->fbbpp == scrp->bitsPerPixel) || (disp->depth == scrp->depth && disp->fbbpp <= 0) || (disp->fbbpp == scrp->bitsPerPixel && disp->depth <= 0)) { scrp->display = disp; break; } } /* * If an exact match can't be found, see if there is one with no * depth or fbbpp specified. */ if (i == scrp->confScreen->numdisplays) { for (i = 0, disp = scrp->confScreen->displays; i < scrp->confScreen->numdisplays; i++, disp++) { if (disp->depth <= 0 && disp->fbbpp <= 0) { scrp->display = disp; break; } } } /* * If all else fails, create a default one. */ if (i == scrp->confScreen->numdisplays) { scrp->confScreen->numdisplays++; scrp->confScreen->displays = xnfrealloc(scrp->confScreen->displays, scrp->confScreen->numdisplays * sizeof(DispRec)); xf86DrvMsg(scrp->scrnIndex, X_INFO, "Creating default Display subsection in Screen section\n" "\t\"%s\" for depth/fbbpp %d/%d\n", scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel); memset(&scrp->confScreen->displays[i], 0, sizeof(DispRec)); scrp->confScreen->displays[i].blackColour.red = -1; scrp->confScreen->displays[i].blackColour.green = -1; scrp->confScreen->displays[i].blackColour.blue = -1; scrp->confScreen->displays[i].whiteColour.red = -1; scrp->confScreen->displays[i].whiteColour.green = -1; scrp->confScreen->displays[i].whiteColour.blue = -1; scrp->confScreen->displays[i].defaultVisual = -1; scrp->confScreen->displays[i].modes = xnfalloc(sizeof(char *)); scrp->confScreen->displays[i].modes[0] = NULL; scrp->confScreen->displays[i].depth = depth; scrp->confScreen->displays[i].fbbpp = fbbpp; scrp->display = &scrp->confScreen->displays[i]; } /* * Setup defaults for the display-wide attributes the framebuffer will * need. These defaults should eventually be set globally, and not * dependent on the screens. */ scrp->imageByteOrder = IMAGE_BYTE_ORDER; scrp->bitmapScanlinePad = BITMAP_SCANLINE_PAD; if (scrp->depth < 8) { /* Planar modes need these settings */ scrp->bitmapScanlineUnit = 8; scrp->bitmapBitOrder = MSBFirst; } else { scrp->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; scrp->bitmapBitOrder = BITMAP_BIT_ORDER; } /* * If an unusual depth is required, add it to scrp->formats. The formats * for the common depths are handled globally in InitOutput */ switch (scrp->depth) { case 1: case 4: case 8: case 15: case 16: case 24: /* Common depths. Nothing to do for them */ break; default: if (!xf86AddPixFormat(scrp, scrp->depth, 0, 0)) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Can't add pixmap format for depth %d\n", scrp->depth); return FALSE; } } /* Initialise the framebuffer format for this screen */ scrp->fbFormat.depth = scrp->depth; scrp->fbFormat.bitsPerPixel = scrp->bitsPerPixel; scrp->fbFormat.scanlinePad = BITMAP_SCANLINE_PAD; return TRUE; } /* * Print out the selected depth and bpp. */ void xf86PrintDepthBpp(ScrnInfoPtr scrp) { xf86DrvMsg(scrp->scrnIndex, scrp->depthFrom, "Depth %d, ", scrp->depth); xf86Msg(scrp->bitsPerPixelFrom, "framebuffer bpp %d\n", scrp->bitsPerPixel); } /* * xf86SetWeight sets scrp->weight, scrp->mask, scrp->offset, and for depths * greater than MAX_PSEUDO_DEPTH also scrp->rgbBits. */ Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask) { MessageType weightFrom = X_DEFAULT; scrp->weight.red = 0; scrp->weight.green = 0; scrp->weight.blue = 0; if (xf86Weight.red > 0 && xf86Weight.green > 0 && xf86Weight.blue > 0) { scrp->weight = xf86Weight; weightFrom = X_CMDLINE; } else if (scrp->display->weight.red > 0 && scrp->display->weight.green > 0 && scrp->display->weight.blue > 0) { scrp->weight = scrp->display->weight; weightFrom = X_CONFIG; } else if (weight.red > 0 && weight.green > 0 && weight.blue > 0) { scrp->weight = weight; } else { switch (scrp->depth) { case 1: case 4: case 8: scrp->weight.red = scrp->weight.green = scrp->weight.blue = scrp->rgbBits; break; case 15: scrp->weight.red = scrp->weight.green = scrp->weight.blue = 5; break; case 16: scrp->weight.red = scrp->weight.blue = 5; scrp->weight.green = 6; break; case 18: scrp->weight.red = scrp->weight.green = scrp->weight.blue = 6; break; case 24: scrp->weight.red = scrp->weight.green = scrp->weight.blue = 8; break; case 30: scrp->weight.red = scrp->weight.green = scrp->weight.blue = 10; break; } } if (scrp->weight.red) xf86DrvMsg(scrp->scrnIndex, weightFrom, "RGB weight %d%d%d\n", (int) scrp->weight.red, (int) scrp->weight.green, (int) scrp->weight.blue); if (scrp->depth > MAX_PSEUDO_DEPTH && (scrp->depth != scrp->weight.red + scrp->weight.green + scrp->weight.blue)) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Weight given (%d%d%d) is inconsistent with the " "depth (%d)\n", (int) scrp->weight.red, (int) scrp->weight.green, (int) scrp->weight.blue, scrp->depth); return FALSE; } if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->weight.red) { /* * XXX Does this even mean anything for TrueColor visuals? * If not, we shouldn't even be setting it here. However, this * matches the behaviour of 3.x versions of XFree86. */ scrp->rgbBits = scrp->weight.red; if (scrp->weight.green > scrp->rgbBits) scrp->rgbBits = scrp->weight.green; if (scrp->weight.blue > scrp->rgbBits) scrp->rgbBits = scrp->weight.blue; } /* Set the mask and offsets */ if (mask.red == 0 || mask.green == 0 || mask.blue == 0) { /* Default to a setting common to PC hardware */ scrp->offset.red = scrp->weight.green + scrp->weight.blue; scrp->offset.green = scrp->weight.blue; scrp->offset.blue = 0; scrp->mask.red = ((1 << scrp->weight.red) - 1) << scrp->offset.red; scrp->mask.green = ((1 << scrp->weight.green) - 1) << scrp->offset.green; scrp->mask.blue = (1 << scrp->weight.blue) - 1; } else { /* Initialise to the values passed */ scrp->mask.red = mask.red; scrp->mask.green = mask.green; scrp->mask.blue = mask.blue; scrp->offset.red = ffs(mask.red); scrp->offset.green = ffs(mask.green); scrp->offset.blue = ffs(mask.blue); } return TRUE; } Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual) { MessageType visualFrom = X_DEFAULT; if (defaultColorVisualClass >= 0) { scrp->defaultVisual = defaultColorVisualClass; visualFrom = X_CMDLINE; } else if (scrp->display->defaultVisual >= 0) { scrp->defaultVisual = scrp->display->defaultVisual; visualFrom = X_CONFIG; } else if (visual >= 0) { scrp->defaultVisual = visual; } else { if (scrp->depth == 1) scrp->defaultVisual = StaticGray; else if (scrp->depth == 4) scrp->defaultVisual = StaticColor; else if (scrp->depth <= MAX_PSEUDO_DEPTH) scrp->defaultVisual = PseudoColor; else scrp->defaultVisual = TrueColor; } switch (scrp->defaultVisual) { case StaticGray: case GrayScale: case StaticColor: case PseudoColor: case TrueColor: case DirectColor: xf86DrvMsg(scrp->scrnIndex, visualFrom, "Default visual is %s\n", xf86VisualNames[scrp->defaultVisual]); return TRUE; default: xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Invalid default visual class (%d)\n", scrp->defaultVisual); return FALSE; } } #define TEST_GAMMA(g) \ (g).red > GAMMA_ZERO || (g).green > GAMMA_ZERO || (g).blue > GAMMA_ZERO #define SET_GAMMA(g) \ (g) > GAMMA_ZERO ? (g) : 1.0 Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma) { MessageType from = X_DEFAULT; #if 0 xf86MonPtr DDC = (xf86MonPtr) (scrp->monitor->DDC); #endif if (TEST_GAMMA(xf86Gamma)) { from = X_CMDLINE; scrp->gamma.red = SET_GAMMA(xf86Gamma.red); scrp->gamma.green = SET_GAMMA(xf86Gamma.green); scrp->gamma.blue = SET_GAMMA(xf86Gamma.blue); } else if (TEST_GAMMA(scrp->monitor->gamma)) { from = X_CONFIG; scrp->gamma.red = SET_GAMMA(scrp->monitor->gamma.red); scrp->gamma.green = SET_GAMMA(scrp->monitor->gamma.green); scrp->gamma.blue = SET_GAMMA(scrp->monitor->gamma.blue); #if 0 } else if (DDC && DDC->features.gamma > GAMMA_ZERO) { from = X_PROBED; scrp->gamma.red = SET_GAMMA(DDC->features.gamma); scrp->gamma.green = SET_GAMMA(DDC->features.gamma); scrp->gamma.blue = SET_GAMMA(DDC->features.gamma); /* EDID structure version 2 gives optional seperate red, green & blue gamma values * in bytes 0x57-0x59 */ #endif } else if (TEST_GAMMA(gamma)) { scrp->gamma.red = SET_GAMMA(gamma.red); scrp->gamma.green = SET_GAMMA(gamma.green); scrp->gamma.blue = SET_GAMMA(gamma.blue); } else { scrp->gamma.red = 1.0; scrp->gamma.green = 1.0; scrp->gamma.blue = 1.0; } /* Pretend we succeeded if we support better a gamma system. * This avoids a confusing message. */ if (xf86_crtc_supports_gamma(scrp)) return TRUE; xf86DrvMsg(scrp->scrnIndex, from, "Using gamma correction (%.1f, %.1f, %.1f)\n", scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue); return TRUE; } #undef TEST_GAMMA #undef SET_GAMMA /* * Set the DPI from the command line option. XXX should allow it to be * calculated from the widthmm/heightmm values. */ #undef MMPERINCH #define MMPERINCH 25.4 void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y) { MessageType from = X_DEFAULT; xf86MonPtr DDC = (xf86MonPtr) (pScrn->monitor->DDC); int ddcWidthmm, ddcHeightmm; int widthErr, heightErr; /* XXX Maybe there is no need for widthmm/heightmm in ScrnInfoRec */ pScrn->widthmm = pScrn->monitor->widthmm; pScrn->heightmm = pScrn->monitor->heightmm; if (DDC && (DDC->features.hsize > 0 && DDC->features.vsize > 0)) { /* DDC gives display size in mm for individual modes, * but cm for monitor */ ddcWidthmm = DDC->features.hsize * 10; /* 10mm in 1cm */ ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */ } else { ddcWidthmm = ddcHeightmm = 0; } if (monitorResolution > 0) { pScrn->xDpi = monitorResolution; pScrn->yDpi = monitorResolution; from = X_CMDLINE; } else if (pScrn->widthmm > 0 || pScrn->heightmm > 0) { from = X_CONFIG; if (pScrn->widthmm > 0) { pScrn->xDpi = (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm); } if (pScrn->heightmm > 0) { pScrn->yDpi = (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm); } if (pScrn->xDpi > 0 && pScrn->yDpi <= 0) pScrn->yDpi = pScrn->xDpi; if (pScrn->yDpi > 0 && pScrn->xDpi <= 0) pScrn->xDpi = pScrn->yDpi; xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n", pScrn->widthmm, pScrn->heightmm); /* Warn if config and probe disagree about display size */ if (ddcWidthmm && ddcHeightmm) { if (pScrn->widthmm > 0) { widthErr = abs(ddcWidthmm - pScrn->widthmm); } else { widthErr = 0; } if (pScrn->heightmm > 0) { heightErr = abs(ddcHeightmm - pScrn->heightmm); } else { heightErr = 0; } if (widthErr > 10 || heightErr > 10) { /* Should include config file name for monitor here */ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n", ddcWidthmm, ddcHeightmm, pScrn->widthmm, pScrn->heightmm); } } } else if (ddcWidthmm && ddcHeightmm) { from = X_PROBED; xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n", ddcWidthmm, ddcHeightmm); pScrn->widthmm = ddcWidthmm; pScrn->heightmm = ddcHeightmm; if (pScrn->widthmm > 0) { pScrn->xDpi = (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm); } if (pScrn->heightmm > 0) { pScrn->yDpi = (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm); } if (pScrn->xDpi > 0 && pScrn->yDpi <= 0) pScrn->yDpi = pScrn->xDpi; if (pScrn->yDpi > 0 && pScrn->xDpi <= 0) pScrn->xDpi = pScrn->yDpi; } else { if (x > 0) pScrn->xDpi = x; else pScrn->xDpi = DEFAULT_DPI; if (y > 0) pScrn->yDpi = y; else pScrn->yDpi = DEFAULT_DPI; } xf86DrvMsg(pScrn->scrnIndex, from, "DPI set to (%d, %d)\n", pScrn->xDpi, pScrn->yDpi); } #undef MMPERINCH void xf86SetBlackWhitePixels(ScreenPtr pScreen) { if (xf86FlipPixels) { pScreen->whitePixel = 0; pScreen->blackPixel = 1; } else { pScreen->whitePixel = 1; pScreen->blackPixel = 0; } } /* * Function to enable/disable access to the frame buffer * * This is used when VT switching and when entering/leaving DGA direct mode. * * This has been rewritten again to eliminate the saved pixmap. The * devPrivate field in the screen pixmap is set to NULL to catch code * accidentally referencing the frame buffer while the X server is not * supposed to touch it. * * Here, we exchange the pixmap private data, rather than the pixmaps * themselves to avoid having to find and change any references to the screen * pixmap such as GC's, window privates etc. This also means that this code * does not need to know exactly how the pixmap pixels are accessed. Further, * this exchange is >not< done through the screen's ModifyPixmapHeader() * vector. This means the called frame buffer code layers can determine * whether they are switched in or out by keeping track of the root pixmap's * private data, and therefore don't need to access pScrnInfo->vtSema. */ void xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable) { ScreenPtr pScreen = pScrnInfo->pScreen; if (enable) { /* * Restore all of the clip lists on the screen */ if (!xf86Resetting) SetRootClip(pScreen, TRUE); } else { /* * Empty all of the clip lists on the screen */ SetRootClip(pScreen, FALSE); } } /* Print driver messages in the standard format of () (): */ void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, va_list args) { /* Prefix the scrnIndex name to the format string. */ if (scrnIndex >= 0 && scrnIndex < xf86NumScreens && 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); } /* Print driver messages, with verbose level specified directly */ void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, ...) { va_list ap; va_start(ap, format); xf86VDrvMsgVerb(scrnIndex, type, verb, format, ap); va_end(ap); } /* Print driver messages, with verbose level of 1 (default) */ void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) { va_list ap; va_start(ap, format); xf86VDrvMsgVerb(scrnIndex, type, 1, format, ap); va_end(ap); } /* Print input driver messages in the standard format of () : : */ void xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, va_list args) { const char *driverName = NULL; const char *deviceName = NULL; /* Prefix driver and device names to formatted message. */ if (dev) { deviceName = dev->name; if (dev->drv) driverName = dev->drv->driverName; } LogHdrMessageVerb(type, verb, format, args, "%s: %s: ", driverName, deviceName); } /* Print input driver message, with verbose level specified directly */ void xf86IDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, ...) { va_list ap; va_start(ap, format); xf86VIDrvMsgVerb(dev, type, verb, format, ap); va_end(ap); } /* Print input driver messages, with verbose level of 1 (default) */ void xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...) { va_list ap; va_start(ap, format); xf86VIDrvMsgVerb(dev, type, 1, format, ap); va_end(ap); } /* Print non-driver messages with verbose level specified directly */ void xf86MsgVerb(MessageType type, int verb, const char *format, ...) { va_list ap; va_start(ap, format); LogVMessageVerb(type, verb, format, ap); va_end(ap); } /* Print non-driver messages with verbose level of 1 (default) */ void xf86Msg(MessageType type, const char *format, ...) { va_list ap; va_start(ap, format); LogVMessageVerb(type, 1, format, ap); va_end(ap); } /* Just like ErrorF, but with the verbose level checked */ void xf86ErrorFVerb(int verb, const char *format, ...) { va_list ap; va_start(ap, format); if (xf86Verbose >= verb || xf86LogVerbose >= verb) LogVWrite(verb, format, ap); va_end(ap); } /* Like xf86ErrorFVerb, but with an implied verbose level of 1 */ void xf86ErrorF(const char *format, ...) { va_list ap; va_start(ap, format); if (xf86Verbose >= 1 || xf86LogVerbose >= 1) LogVWrite(1, format, ap); va_end(ap); } /* Note temporarily modifies the passed in buffer! */ static void xf86_mkdir_p(char *path) { char *sep = path; while ((sep = strchr(sep + 1, '/'))) { *sep = 0; (void)mkdir(path, 0777); *sep = '/'; } (void)mkdir(path, 0777); } void xf86LogInit(void) { char *env, *lf = NULL; char buf[PATH_MAX]; #define LOGSUFFIX ".log" #define LOGOLDSUFFIX ".old" /* Get the log file name */ if (xf86LogFileFrom == X_DEFAULT) { /* When not running as root, we won't be able to write to /var/log */ if (geteuid() != 0) { if ((env = getenv("XDG_DATA_HOME"))) snprintf(buf, sizeof(buf), "%s/%s", env, DEFAULT_XDG_DATA_HOME_LOGDIR); else if ((env = getenv("HOME"))) snprintf(buf, sizeof(buf), "%s/%s/%s", env, DEFAULT_XDG_DATA_HOME, DEFAULT_XDG_DATA_HOME_LOGDIR); if (env) { xf86_mkdir_p(buf); strlcat(buf, "/" DEFAULT_LOGPREFIX, sizeof(buf)); xf86LogFile = buf; } } /* Append the display number and ".log" */ if (asprintf(&lf, "%s%%s" LOGSUFFIX, xf86LogFile) == -1) FatalError("Cannot allocate space for the log file name\n"); xf86LogFile = lf; } xf86LogFile = LogInit(xf86LogFile, LOGOLDSUFFIX); xf86LogFileWasOpened = TRUE; xf86SetVerbosity(xf86Verbose); xf86SetLogVerbosity(xf86LogVerbose); #undef LOGSUFFIX #undef LOGOLDSUFFIX free(lf); } void xf86CloseLog(enum ExitCode error) { LogClose(error); } /* * Drivers can use these for using their own SymTabRecs. */ const char * xf86TokenToString(SymTabPtr table, int token) { int i; for (i = 0; table[i].token >= 0 && table[i].token != token; i++); if (table[i].token < 0) return NULL; else return table[i].name; } int xf86StringToToken(SymTabPtr table, const char *string) { int i; if (string == NULL) return -1; for (i = 0; table[i].token >= 0 && xf86NameCmp(string, table[i].name); i++); return table[i].token; } /* * helper to display the clocks found on a card */ void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from) { int j; xf86DrvMsg(scrp->scrnIndex, from, "Pixel clocks available:"); for (j = 0; j < scrp->numClocks; j++) { if ((j % 4) == 0) { xf86ErrorF("\n"); xf86DrvMsg(scrp->scrnIndex, from, "pixel clocks:"); } xf86ErrorF(" %7.3f", (double) scrp->clock[j] / 1000.0); } xf86ErrorF("\n"); } /* * This prints out the driver identify message, including the names of * the supported chipsets. * * XXX This makes assumptions about the line width, etc. Maybe we could * use a more general "pretty print" function for messages. */ void xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips) { int len, i; len = 6 + strlen(drvname) + 2 + strlen(drvmsg) + 2; xf86Msg(X_INFO, "%s: %s:", drvname, drvmsg); for (i = 0; chips[i].name != NULL; i++) { if (i != 0) { xf86ErrorF(","); len++; } if (len + 2 + strlen(chips[i].name) < 78) { xf86ErrorF(" "); len++; } else { xf86ErrorF("\n\t"); len = 8; } xf86ErrorF("%s", chips[i].name); len += strlen(chips[i].name); } xf86ErrorF("\n"); } int xf86MatchDevice(const char *drivername, GDevPtr ** sectlist) { GDevPtr gdp, *pgdp = NULL; confScreenPtr screensecptr; int i, j; if (sectlist) *sectlist = NULL; /* * This can happen when running Xorg -showopts and a module like ati * or vmware tries to load its submodules when xf86ConfigLayout is empty */ if (!xf86ConfigLayout.screens) return 0; /* * This is a very important function that matches the device sections * as they show up in the config file with the drivers that the server * loads at run time. * * ChipProbe can call * int xf86MatchDevice(char * drivername, GDevPtr ** sectlist) * with its driver name. The function allocates an array of GDevPtr and * returns this via sectlist and returns the number of elements in * this list as return value. 0 means none found, -1 means fatal error. * * It can figure out which of the Device sections to use for which card * (using things like the Card statement, etc). For single headed servers * there will of course be just one such Device section. */ i = 0; /* * first we need to loop over all the Screens sections to get to all * 'active' device sections */ for (j = 0; xf86ConfigLayout.screens[j].screen != NULL; j++) { screensecptr = xf86ConfigLayout.screens[j].screen; if ((screensecptr->device->driver != NULL) && (xf86NameCmp(screensecptr->device->driver, drivername) == 0) && (!screensecptr->device->claimed)) { /* * we have a matching driver that wasn't claimed, yet */ pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); pgdp[i++] = screensecptr->device; } } /* Then handle the inactive devices */ j = 0; while (xf86ConfigLayout.inactives[j].identifier) { gdp = &xf86ConfigLayout.inactives[j]; if (gdp->driver && !gdp->claimed && !xf86NameCmp(gdp->driver, drivername)) { /* we have a matching driver that wasn't claimed yet */ pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); pgdp[i++] = gdp; } j++; } /* * make the array NULL terminated and return its address */ if (i) pgdp[i] = NULL; if (sectlist) *sectlist = pgdp; else free(pgdp); return i; } const char * xf86GetVisualName(int visual) { if (visual < 0 || visual > DirectColor) return NULL; return xf86VisualNames[visual]; } int xf86GetVerbosity(void) { return max(xf86Verbose, xf86LogVerbose); } Pix24Flags xf86GetPix24(void) { return xf86Info.pixmap24; } int xf86GetDepth(void) { return xf86Depth; } rgb xf86GetWeight(void) { return xf86Weight; } Gamma xf86GetGamma(void) { return xf86Gamma; } Bool xf86GetFlipPixels(void) { return xf86FlipPixels; } const char * xf86GetServerName(void) { return xf86ServerName; } Bool xf86ServerIsExiting(void) { return (dispatchException & DE_TERMINATE) == DE_TERMINATE; } Bool xf86ServerIsResetting(void) { return xf86Resetting; } Bool xf86ServerIsInitialising(void) { return xf86Initialising; } Bool xf86ServerIsOnlyDetecting(void) { return xf86DoConfigure; } Bool xf86CaughtSignal(void) { return xf86Info.caughtSignal; } Bool xf86GetVidModeAllowNonLocal(void) { return xf86Info.vidModeAllowNonLocal; } Bool xf86GetVidModeEnabled(void) { return xf86Info.vidModeEnabled; } Bool xf86GetModInDevAllowNonLocal(void) { return xf86Info.miscModInDevAllowNonLocal; } Bool xf86GetModInDevEnabled(void) { return xf86Info.miscModInDevEnabled; } Bool xf86GetAllowMouseOpenFail(void) { return xf86Info.allowMouseOpenFail; } void xf86DisableRandR(void) { xf86Info.disableRandR = TRUE; xf86Info.randRFrom = X_PROBED; } CARD32 xf86GetModuleVersion(void *module) { return (CARD32) LoaderGetModuleVersion(module); } void * xf86LoadDrvSubModule(DriverPtr drv, const char *name) { void *ret; int errmaj = 0, errmin = 0; ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL, &errmaj, &errmin); if (!ret) LoaderErrorMsg(NULL, name, errmaj, errmin); return ret; } void * xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name) { void *ret; int errmaj = 0, errmin = 0; ret = LoadSubModule(pScrn->module, name, NULL, NULL, NULL, NULL, &errmaj, &errmin); if (!ret) LoaderErrorMsg(pScrn->name, name, errmaj, errmin); return ret; } /* * xf86LoadOneModule loads a single module. */ void * xf86LoadOneModule(const char *name, void *opt) { int errmaj, errmin; char *Name; void *mod; if (!name) return NULL; /* Normalise the module name */ Name = xf86NormalizeName(name); /* Skip empty names */ if (Name == NULL) return NULL; if (*Name == '\0') { free(Name); return NULL; } mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin); if (!mod) LoaderErrorMsg(NULL, Name, errmaj, errmin); free(Name); return mod; } void xf86UnloadSubModule(void *mod) { UnloadSubModule(mod); } Bool xf86LoaderCheckSymbol(const char *name) { return LoaderSymbol(name) != NULL; } typedef enum { OPTION_BACKING_STORE } BSOpts; static const OptionInfoRec BSOptions[] = { {OPTION_BACKING_STORE, "BackingStore", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; void xf86SetBackingStore(ScreenPtr pScreen) { Bool useBS = FALSE; MessageType from = X_DEFAULT; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); OptionInfoPtr options; options = xnfalloc(sizeof(BSOptions)); (void) memcpy(options, BSOptions, sizeof(BSOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); /* check for commandline option here */ if (xf86bsEnableFlag) { from = X_CMDLINE; useBS = TRUE; } else if (xf86bsDisableFlag) { from = X_CMDLINE; useBS = FALSE; } else { if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS)) from = X_CONFIG; #ifdef COMPOSITE if (from != X_CONFIG) useBS = xf86ReturnOptValBool(options, OPTION_BACKING_STORE, !noCompositeExtension); #endif } free(options); pScreen->backingStoreSupport = useBS ? WhenMapped : NotUseful; if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n", useBS ? "enabled" : "disabled"); } typedef enum { OPTION_SILKEN_MOUSE } SMOpts; static const OptionInfoRec SMOptions[] = { {OPTION_SILKEN_MOUSE, "SilkenMouse", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; void xf86SetSilkenMouse(ScreenPtr pScreen) { Bool useSM = TRUE; MessageType from = X_DEFAULT; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); OptionInfoPtr options; options = xnfalloc(sizeof(SMOptions)); (void) memcpy(options, SMOptions, sizeof(SMOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); /* check for commandline option here */ /* disable if screen shares resources */ /* TODO VGA arb disable silken mouse */ if (xf86silkenMouseDisableFlag) { from = X_CMDLINE; useSM = FALSE; } else { if (xf86GetOptValBool(options, OPTION_SILKEN_MOUSE, &useSM)) from = X_CONFIG; } free(options); /* * XXX quick hack to report correctly for OSs that can't do SilkenMouse * yet. Should handle this differently so that alternate async methods * work correctly with this too. */ pScrn->silkenMouse = useSM && xf86Info.useSIGIO && xf86SIGIOSupported(); if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n", pScrn->silkenMouse ? "enabled" : "disabled"); } /* Wrote this function for the PM2 Xv driver, preliminary. */ void * xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, const char *port_name, const char **adaptor_name, void **adaptor_options) { confXvAdaptorPtr adaptor; int i; if (adaptor_index >= pScrn->confScreen->numxvadaptors) { if (adaptor_name) *adaptor_name = NULL; if (adaptor_options) *adaptor_options = NULL; return NULL; } adaptor = &pScrn->confScreen->xvadaptors[adaptor_index]; if (adaptor_name) *adaptor_name = adaptor->identifier; if (adaptor_options) *adaptor_options = adaptor->options; for (i = 0; i < adaptor->numports; i++) if (!xf86NameCmp(adaptor->ports[i].identifier, port_name)) return adaptor->ports[i].options; return NULL; } /* Rather than duplicate loader's get OS function, just include it directly */ #define LoaderGetOS xf86GetOS #include "loader/os.c" static void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, EntityProc enter, EntityProc leave, void *private) { ScrnInfoPtr pScrn; if ((pScrn = xf86FindScreenForEntity(pEnt->index))) xf86RemoveEntityFromScreen(pScrn, pEnt->index); xf86SetEntityFuncs(pEnt->index, init, enter, leave, private); } ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, void *private) { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return pScrn; if (!(pEnt->location.type == BUS_NONE)) { free(pEnt); return pScrn; } if (!pEnt->active) { xf86ConfigFbEntityInactive(pEnt, init, enter, leave, private); free(pEnt); return pScrn; } if (!pScrn) pScrn = xf86AllocateScreen(pEnt->driver, scrnFlag); xf86AddEntityToScreen(pScrn, entityIndex); xf86SetEntityFuncs(entityIndex, init, enter, leave, private); free(pEnt); return pScrn; } Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn) { int i; for (i = 0; i < pScrn->numEntities; i++) { if (xf86IsEntityPrimary(i)) return TRUE; } return FALSE; } int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, int format, unsigned long len, void *value) { RootWinPropPtr pNewProp = NULL, pRegProp; Bool existing = FALSE; DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n", ScrnIndex, property, type, format, len, value); if (ScrnIndex < 0 || ScrnIndex >= xf86NumScreens) { return BadMatch; } if (xf86RegisteredPropertiesTable && xf86RegisteredPropertiesTable[ScrnIndex]) { for (pNewProp = xf86RegisteredPropertiesTable[ScrnIndex]; pNewProp; pNewProp = pNewProp->next) { if (strcmp(pNewProp->name, NameForAtom(property)) == 0) break; } } if (!pNewProp) { if ((pNewProp = (RootWinPropPtr) malloc(sizeof(RootWinProp))) == NULL) { return BadAlloc; } /* * We will put this property at the end of the list so that * the changes are made in the order they were requested. */ pNewProp->next = NULL; } else { free((void *) pNewProp->name); existing = TRUE; } pNewProp->name = xnfstrdup(NameForAtom(property)); pNewProp->type = type; pNewProp->format = format; pNewProp->size = len; pNewProp->data = value; DebugF("new property filled\n"); if (xf86RegisteredPropertiesTable == NULL) { DebugF("creating xf86RegisteredPropertiesTable[] size %d\n", xf86NumScreens); xf86RegisteredPropertiesTable = xnfcalloc(sizeof(RootWinProp), xf86NumScreens); } DebugF("xf86RegisteredPropertiesTable %p\n", (void *) xf86RegisteredPropertiesTable); DebugF("xf86RegisteredPropertiesTable[%d] %p\n", ScrnIndex, (void *) xf86RegisteredPropertiesTable[ScrnIndex]); if (!existing) { if (xf86RegisteredPropertiesTable[ScrnIndex] == NULL) { xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp; } else { pRegProp = xf86RegisteredPropertiesTable[ScrnIndex]; while (pRegProp->next != NULL) { DebugF("- next %p\n", (void *) pRegProp); pRegProp = pRegProp->next; } pRegProp->next = pNewProp; } } DebugF("xf86RegisterRootWindowProperty succeeded\n"); return Success; } Bool xf86IsUnblank(int mode) { switch (mode) { case SCREEN_SAVER_OFF: case SCREEN_SAVER_FORCER: return TRUE; case SCREEN_SAVER_ON: case SCREEN_SAVER_CYCLE: return FALSE; default: xf86MsgVerb(X_WARNING, 0, "Unexpected save screen mode: %d\n", mode); return TRUE; } } void 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(); } xorg-server-1.17.1/hw/xfree86/common/vidmodeproc.h0000664000175100017510000000657612274325511016712 00000000000000 /* Prototypes for DGA functions that the DDX must provide */ #ifdef HAVE_DIX_CONFIG_H #include #endif #ifndef _VIDMODEPROC_H_ #define _VIDMODEPROC_H_ typedef enum { VIDMODE_H_DISPLAY, VIDMODE_H_SYNCSTART, VIDMODE_H_SYNCEND, VIDMODE_H_TOTAL, VIDMODE_H_SKEW, VIDMODE_V_DISPLAY, VIDMODE_V_SYNCSTART, VIDMODE_V_SYNCEND, VIDMODE_V_TOTAL, VIDMODE_FLAGS, VIDMODE_CLOCK } VidModeSelectMode; typedef enum { VIDMODE_MON_VENDOR, VIDMODE_MON_MODEL, VIDMODE_MON_NHSYNC, VIDMODE_MON_NVREFRESH, VIDMODE_MON_HSYNC_LO, VIDMODE_MON_HSYNC_HI, VIDMODE_MON_VREFRESH_LO, VIDMODE_MON_VREFRESH_HI } VidModeSelectMonitor; typedef union { const void *ptr; int i; float f; } vidMonitorValue; extern Bool VidModeExtensionInit(ScreenPtr pScreen); extern _X_EXPORT Bool VidModeAvailable(int scrnIndex); extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, void **mode, int *dotClock); extern _X_EXPORT Bool VidModeGetFirstModeline(int scrnIndex, void **mode, int *dotClock); extern _X_EXPORT Bool VidModeGetNextModeline(int scrnIndex, void **mode, int *dotClock); extern _X_EXPORT Bool VidModeDeleteModeline(int scrnIndex, void *mode); extern _X_EXPORT Bool VidModeZoomViewport(int scrnIndex, int zoom); extern _X_EXPORT Bool VidModeGetViewPort(int scrnIndex, int *x, int *y); extern _X_EXPORT Bool VidModeSetViewPort(int scrnIndex, int x, int y); extern _X_EXPORT Bool VidModeSwitchMode(int scrnIndex, void *mode); extern _X_EXPORT Bool VidModeLockZoom(int scrnIndex, Bool lock); extern _X_EXPORT Bool VidModeGetMonitor(int scrnIndex, void **monitor); extern _X_EXPORT int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock); extern _X_EXPORT Bool VidModeGetClocks(int scrnIndex, int *Clocks); extern _X_EXPORT ModeStatus VidModeCheckModeForMonitor(int scrnIndex, void *mode); extern _X_EXPORT ModeStatus VidModeCheckModeForDriver(int scrnIndex, void *mode); extern _X_EXPORT void VidModeSetCrtcForMode(int scrnIndex, void *mode); extern _X_EXPORT Bool VidModeAddModeline(int scrnIndex, void *mode); extern _X_EXPORT int VidModeGetDotClock(int scrnIndex, int Clock); extern _X_EXPORT int VidModeGetNumOfModes(int scrnIndex); extern _X_EXPORT Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue); extern _X_EXPORT Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue); extern _X_EXPORT void *VidModeCreateMode(void); extern _X_EXPORT void VidModeCopyMode(void *modefrom, void *modeto); extern _X_EXPORT int VidModeGetModeValue(void *mode, int valtyp); extern _X_EXPORT void VidModeSetModeValue(void *mode, int valtyp, int val); extern _X_EXPORT vidMonitorValue VidModeGetMonitorValue(void *monitor, int valtyp, int indx); extern _X_EXPORT Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); extern _X_EXPORT Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); extern _X_EXPORT int VidModeGetGammaRampSize(int scrnIndex); #endif xorg-server-1.17.1/hw/xfree86/common/xf86Extensions.h0000664000175100017510000000353512274325511017242 00000000000000/* * 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 xorg-server-1.17.1/hw/xfree86/os-support/0000775000175100017510000000000012466505445015144 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/xf86_OSproc.h0000664000175100017510000002122112456571574017320 00000000000000/* * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany * Copyright 1992 by David Dawes * Copyright 1992 by Jim Tsillas * Copyright 1992 by Rich Murphey * Copyright 1992 by Robert Baron * Copyright 1992 by Orest Zborowski * Copyright 1993 by Vrije Universiteit, The Netherlands * Copyright 1993 by David Wexelblat * Copyright 1994, 1996 by Holger Veit * Copyright 1994-2003 by 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 names of the above listed copyright holders * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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. * */ /* * The ARM32 code here carries the following copyright: * * Copyright 1997 * Digital Equipment Corporation. All rights reserved. * This software is furnished under license and may be used and copied only in * accordance with the following terms and conditions. Subject to these * conditions, you may download, copy, install, use, modify and distribute * this software in source and/or binary form. No title or ownership is * transferred hereby. * * 1) Any source code used, modified or distributed must reproduce and retain * this copyright notice and list of conditions as they appear in the * source file. * * 2) No right is granted to use any trade name, trademark, or logo of Digital * Equipment Corporation. Neither the "Digital Equipment Corporation" * name nor any trademark or logo of Digital Equipment Corporation may be * used to endorse or promote products derived from this software without * the prior written permission of Digital Equipment Corporation. * * 3) This software is provided "AS-IS" and any express or implied warranties, * including but not limited to, any implied warranties of merchantability, * fitness for a particular purpose, or non-infringement are disclaimed. * In no event shall DIGITAL be liable for any damages whatsoever, and in * particular, DIGITAL shall not be liable for special, indirect, * consequential, or incidental damages or damages for lost profits, loss * of revenue or loss of use, whether such damages arise in contract, * negligence, tort, under statute, in equity, at law or otherwise, even * if advised of the possibility of such damage. * */ #ifndef _XF86_OSPROC_H #define _XF86_OSPROC_H /* * The actual prototypes have been pulled into this seperate file so * that they can can be used without pulling in all of the OS specific * stuff like sys/stat.h, etc. This casues problem for loadable modules. */ /* * OS-independent modem state flags for xf86SetSerialModemState() and * xf86GetSerialModemState(). */ #define XF86_M_LE 0x001 /* line enable */ #define XF86_M_DTR 0x002 /* data terminal ready */ #define XF86_M_RTS 0x004 /* request to send */ #define XF86_M_ST 0x008 /* secondary transmit */ #define XF86_M_SR 0x010 /* secondary receive */ #define XF86_M_CTS 0x020 /* clear to send */ #define XF86_M_CAR 0x040 /* carrier detect */ #define XF86_M_RNG 0x080 /* ring */ #define XF86_M_DSR 0x100 /* data set ready */ #ifndef NO_OSLIB_PROTOTYPES /* * This is to prevent re-entrancy to FatalError() when aborting. * Anything that can be called as a result of AbortDDX() should use this * instead of FatalError(). */ #define xf86FatalError(a, b) \ if (dispatchException & DE_TERMINATE) { \ ErrorF(a, b); \ ErrorF("\n"); \ return; \ } else FatalError(a, b) /***************************************************************************/ /* Prototypes */ /***************************************************************************/ #include #include "opaque.h" #include "xf86Optionstr.h" _XFUNCPROTOBEGIN /* public functions */ extern _X_EXPORT Bool xf86EnableIO(void); extern _X_EXPORT void xf86DisableIO(void); #ifdef __NetBSD__ extern _X_EXPORT void xf86SetTVOut(int); extern _X_EXPORT void xf86SetRGBOut(void); #endif extern _X_EXPORT void xf86OSRingBell(int, int, int); extern _X_EXPORT void xf86SetReallySlowBcopy(void); extern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int); extern _X_EXPORT int xf86OpenSerial(XF86OptionPtr options); extern _X_EXPORT int xf86SetSerial(int fd, XF86OptionPtr options); extern _X_EXPORT int xf86SetSerialSpeed(int fd, int speed); extern _X_EXPORT int xf86ReadSerial(int fd, void *buf, int count); extern _X_EXPORT int xf86WriteSerial(int fd, const void *buf, int count); extern _X_EXPORT int xf86CloseSerial(int fd); extern _X_EXPORT int xf86FlushInput(int fd); extern _X_EXPORT int xf86WaitForInput(int fd, int timeout); extern _X_EXPORT int xf86SerialSendBreak(int fd, int duration); extern _X_EXPORT int xf86SetSerialModemState(int fd, int state); extern _X_EXPORT int xf86GetSerialModemState(int fd); extern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits); extern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits); extern _X_EXPORT int xf86LoadKernelModule(const char *pathname); /* AGP GART interface */ typedef struct _AgpInfo { CARD32 bridgeId; CARD32 agpMode; unsigned long base; unsigned long size; unsigned long totalPages; unsigned long systemPages; unsigned long usedPages; } AgpInfo, *AgpInfoPtr; extern _X_EXPORT Bool xf86AgpGARTSupported(void); extern _X_EXPORT AgpInfoPtr xf86GetAGPInfo(int screenNum); extern _X_EXPORT Bool xf86AcquireGART(int screenNum); extern _X_EXPORT Bool xf86ReleaseGART(int screenNum); extern _X_EXPORT int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type, unsigned long *physical); extern _X_EXPORT Bool xf86DeallocateGARTMemory(int screenNum, int key); extern _X_EXPORT Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset); extern _X_EXPORT Bool xf86UnbindGARTMemory(int screenNum, int key); extern _X_EXPORT Bool xf86EnableAGP(int screenNum, CARD32 mode); extern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum); /* These routines are in shared/sigio.c and are not loaded as part of the module. These routines are small, and the code if very POSIX-signal (or OS-signal) specific, so it seemed better to provide more complex wrappers than to wrap each individual function called. */ extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *); extern _X_EXPORT int xf86RemoveSIGIOHandler(int fd); extern _X_EXPORT int xf86BlockSIGIO(void); extern _X_EXPORT void xf86UnblockSIGIO(int); extern _X_EXPORT void xf86AssertBlockedSIGIO(char *); extern _X_EXPORT Bool xf86SIGIOSupported(void); #ifdef XF86_OS_PRIVS typedef void (*PMClose) (void); extern _X_EXPORT void xf86OpenConsole(void); extern _X_EXPORT void xf86CloseConsole(void); extern _X_HIDDEN Bool xf86VTActivate(int vtno); extern _X_EXPORT Bool xf86VTSwitchPending(void); extern _X_EXPORT Bool xf86VTSwitchAway(void); extern _X_EXPORT Bool xf86VTSwitchTo(void); extern _X_EXPORT void xf86VTRequest(int sig); extern _X_EXPORT int xf86ProcessArgument(int, char **, int); extern _X_EXPORT void xf86UseMsg(void); extern _X_EXPORT PMClose xf86OSPMOpen(void); extern _X_EXPORT void xf86InitVidMem(void); #endif /* XF86_OS_PRIVS */ #ifdef XSERVER_PLATFORM_BUS #include "hotplug.h" void xf86PlatformDeviceProbe(struct OdevAttributes *attribs); void xf86PlatformReprobeDevice(int index, struct OdevAttributes *attribs); #endif _XFUNCPROTOEND #endif /* NO_OSLIB_PROTOTYPES */ #endif /* _XF86_OSPROC_H */ xorg-server-1.17.1/hw/xfree86/os-support/Makefile.am0000664000175100017510000000114212160102336017075 00000000000000SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS) DIST_SUBDIRS = bsd bus misc linux solaris stub hurd sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h EXTRA_DIST = int10Defines.h xf86OSpriv.h # to get the grouping semantics right, you have to glom these three together # as one library, otherwise libtool will actively defeat your attempts to # list them multiple times on the link line. noinst_LTLIBRARIES = libxorgos.la libxorgos_la_SOURCES = libxorgos_la_LIBADD = @XORG_OS_SUBDIR@/lib@XORG_OS_SUBDIR@.la \ bus/libbus.la \ misc/libmisc.la AM_CFLAGS = $(DIX_CFLAGS) xorg-server-1.17.1/hw/xfree86/os-support/xf86OSpriv.h0000664000175100017510000000324012406661137017165 00000000000000/* * Copyright (c) 1999-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_XORG_CONFIG_H #include #endif #ifndef _XF86OSPRIV_H #define _XF86OSPRIV_H typedef struct { Bool initialised; } VidMemInfo, *VidMemInfoPtr; void xf86OSInitVidMem(VidMemInfoPtr); #endif /* _XF86OSPRIV_H */ xorg-server-1.17.1/hw/xfree86/os-support/bsd/0000775000175100017510000000000012466505445015714 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/bsd/Makefile.am0000664000175100017510000000251212406661137017663 00000000000000noinst_LTLIBRARIES = libbsd.la # APM support. if BSD_KQUEUE_APM APM_SOURCES = $(srcdir)/bsd_kqueue_apm.c else if BSD_APM APM_SOURCES = $(srcdir)/bsd_apm.c else APM_SOURCES = $(srcdir)/../shared/pm_noop.c endif endif if FREEBSD_KLDLOAD KMOD_SOURCES = bsd_kmod.c else KMOD_SOURCES = $(srcdir)/../shared/kmod_noop.c endif if AGP AGP_SOURCES = $(srcdir)/../linux/lnx_agp.c else AGP_SOURCES = $(srcdir)/../shared/agp_noop.c endif if ALPHA_VIDEO # Cheat here and piggyback other alpha bits on ALPHA_VIDEO. ARCH_SOURCES = \ alpha_video.c \ bsd_ev56.c endif if ARM_VIDEO ARCH_SOURCES = arm_video.c endif if I386_VIDEO ARCH_SOURCES = i386_video.c endif if PPC_VIDEO ARCH_SOURCES = ppc_video.c endif if SPARC64_VIDEO # Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO. ARCH_SOURCES = \ sparc64_video.c \ $(srcdir)/../shared/ioperm_noop.c endif # FIXME: NetBSD Aperture defines (configure.ac) AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) libbsd_la_SOURCES = \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ $(srcdir)/../shared/vidmem.c \ bsd_VTsw.c \ bsd_init.c \ bsd_bell.c \ $(ARCH_SOURCES) \ $(AGP_SOURCES) \ $(APM_SOURCES) \ $(AXP_SOURCES) \ $(DRI_SOURCES) \ $(KMOD_SOURCES) \ $(RES_SOURCES) # FIXME: Add these files to the build as needed EXTRA_DIST = \ memrange.h xorg-server-1.17.1/hw/xfree86/os-support/bsd/bsd_init.c0000664000175100017510000005051312456571574017604 00000000000000/* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat * * 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 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 * 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 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "compiler.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include #include #include #include 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; #endif #ifdef PCCONS_SUPPORT /* Stock 0.1 386bsd pccons console driver interface */ #define PCCONS_CONSOLE_DEV1 "/dev/ttyv0" #define PCCONS_CONSOLE_DEV2 "/dev/vga" #define PCCONS_CONSOLE_MODE O_RDWR|O_NDELAY #endif #ifdef SYSCONS_SUPPORT /* The FreeBSD 1.1 version syscons driver uses /dev/ttyv0 */ #define SYSCONS_CONSOLE_DEV1 "/dev/ttyv0" #define SYSCONS_CONSOLE_DEV2 "/dev/vga" #define SYSCONS_CONSOLE_MODE O_RDWR|O_NDELAY #endif #ifdef PCVT_SUPPORT /* Hellmuth Michaelis' pcvt driver */ #ifndef __OpenBSD__ #define PCVT_CONSOLE_DEV "/dev/ttyv0" #else #define PCVT_CONSOLE_DEV "/dev/ttyC0" #endif #define PCVT_CONSOLE_MODE O_RDWR|O_NDELAY #endif #if defined(WSCONS_SUPPORT) && defined(__NetBSD__) /* NetBSD's new console driver */ #define WSCONS_PCVT_COMPAT_CONSOLE_DEV "/dev/ttyE0" #endif #ifdef __GLIBC__ #define setpgrp setpgid #endif #define CHECK_DRIVER_MSG \ "Check your kernel's console driver configuration and /dev entries" static char *supported_drivers[] = { #ifdef PCCONS_SUPPORT "pccons (with X support)", #endif #ifdef SYSCONS_SUPPORT "syscons", #endif #ifdef PCVT_SUPPORT "pcvt", #endif #ifdef WSCONS_SUPPORT "wscons", #endif }; /* * Functions to probe for the existance of a supported console driver. * Any function returns either a valid file descriptor (driver probed * succesfully), -1 (driver not found), or uses FatalError() if the * driver was found but proved to not support the required mode to run * an X server. */ typedef int (*xf86ConsOpen_t) (void); #ifdef PCCONS_SUPPORT static int xf86OpenPccons(void); #endif /* PCCONS_SUPPORT */ #ifdef SYSCONS_SUPPORT static int xf86OpenSyscons(void); #endif /* SYSCONS_SUPPORT */ #ifdef PCVT_SUPPORT static int xf86OpenPcvt(void); #endif /* PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT static int xf86OpenWScons(void); #endif /* * The sequence of the driver probes is important; start with the * driver that is best distinguishable, and end with the most generic * driver. (Otherwise, pcvt would also probe as syscons, and either * pcvt or syscons might succesfully probe as pccons.) */ static xf86ConsOpen_t xf86ConsTab[] = { #ifdef PCVT_SUPPORT xf86OpenPcvt, #endif #ifdef SYSCONS_SUPPORT xf86OpenSyscons, #endif #ifdef PCCONS_SUPPORT xf86OpenPccons, #endif #ifdef WSCONS_SUPPORT xf86OpenWScons, #endif (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 vtmode_t vtmode; #endif if (serverGeneration == 1) { /* check if we are run with euid==0 */ if (geteuid() != 0) { FatalError("xf86OpenConsole: Server must be suid root"); } 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) { FatalError("%s: CONSOLE_X_MODE_ON failed (%s)\n%s", "xf86OpenConsole", strerror(errno), CHECK_DRIVER_MSG); } /* * Hack to prevent keyboard hanging when syslogd closes * /dev/console */ if ((devConsoleFd = open("/dev/console", O_WRONLY, 0)) < 0) { xf86Msg(X_WARNING, "xf86OpenConsole: couldn't open /dev/console (%s)\n", strerror(errno)); } break; #endif #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: /* 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); i = atof(uts.release) * 100; 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) { if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) != 0) { xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); } sleep(1); } #endif acquire_vt: if (!xf86Info.ShareVTs) { /* * now get the VT */ SYSCALL(result = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno)); if (result != 0) { xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); } SYSCALL(result = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno)); if (result != 0) { xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n"); } signal(SIGUSR1, xf86VTRequest); vtmode.mode = VT_PROCESS; vtmode.relsig = SIGUSR1; vtmode.acqsig = SIGUSR1; vtmode.frsig = SIGUSR1; if (ioctl(xf86Info.consoleFd, VT_SETMODE, &vtmode) < 0) { FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed"); } #if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL) if (ioctl(xf86Info.consoleFd, KDENABIO, 0) < 0) { FatalError("xf86OpenConsole: KDENABIO failed (%s)", strerror(errno)); } #endif if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed"); } } else { /* xf86Info.ShareVTs */ close(xf86Info.consoleFd); } break; #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT case WSCONS: /* Nothing to do */ break; #endif } } else { /* serverGeneration != 1 */ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (!xf86Info.ShareVTs && (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)) { if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) { xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); } } #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ } return; } #ifdef PCCONS_SUPPORT static int 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) { 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); } xf86Info.consType = PCCONS; xf86Msg(X_PROBED, "Using pccons driver with X support\n"); } return fd; } #endif /* PCCONS_SUPPORT */ #ifdef SYSCONS_SUPPORT static int xf86OpenSyscons() { int fd = -1; vtmode_t vtmode; char vtname[12]; long syscons_version; MessageType from; /* Check for syscons */ if ((fd = open(SYSCONS_CONSOLE_DEV1, SYSCONS_CONSOLE_MODE, 0)) >= 0 || (fd = open(SYSCONS_CONSOLE_DEV2, SYSCONS_CONSOLE_MODE, 0)) >= 0) { if (ioctl(fd, VT_GETMODE, &vtmode) >= 0) { /* Get syscons version */ if (ioctl(fd, CONS_GETVERS, &syscons_version) < 0) { syscons_version = 0; } xf86Info.vtno = VTnum; from = X_CMDLINE; #ifdef VT_GETACTIVE if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0) initialVT = -1; #endif if (xf86Info.ShareVTs) xf86Info.vtno = initialVT; if (xf86Info.vtno == -1) { /* * For old syscons versions (<0x100), VT_OPENQRY returns * the current VT rather than the next free VT. In this * case, the server gets started on the current VT instead * of the next free VT. */ #if 0 /* check for the fixed VT_OPENQRY */ if (syscons_version >= 0x100) { #endif if (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) { /* No free VTs */ 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; } 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); snprintf(vtname, sizeof(vtname), "/dev/ttyv%01x", xf86Info.vtno - 1); 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); } else { /* VT_GETMODE failed, probably not syscons */ close(fd); fd = -1; } } return fd; } #endif /* SYSCONS_SUPPORT */ #ifdef PCVT_SUPPORT static int xf86OpenPcvt() { /* This looks much like syscons, since pcvt is API compatible */ int fd = -1; vtmode_t vtmode; char vtname[12], *vtprefix; struct pcvtid pcvt_version; #ifndef __OpenBSD__ vtprefix = "/dev/ttyv"; #else vtprefix = "/dev/ttyC"; #endif fd = open(PCVT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0); #ifdef WSCONS_PCVT_COMPAT_CONSOLE_DEV if (fd < 0) { fd = open(WSCONS_PCVT_COMPAT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0); vtprefix = "/dev/ttyE"; } #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); } 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; } else { FatalError("%s: Cannot find a free VT", "xf86OpenPcvt"); } } } 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; #ifdef WSCONS_SUPPORT xf86Msg(X_PROBED, "Using wscons driver on %s in pcvt compatibility mode " "(version %d.%d)\n", vtname, pcvt_version.rmajor, pcvt_version.rminor); #else xf86Msg(X_PROBED, "Using pcvt driver (version %d.%d)\n", pcvt_version.rmajor, pcvt_version.rminor); #endif } else { /* Not pcvt */ close(fd); fd = -1; } } return fd; } #endif /* PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT static int xf86OpenWScons() { int fd = -1; int mode = WSDISPLAYIO_MODE_MAPPED; int i; char ttyname[16]; /* XXX Is this ok? */ for (i = 0; i < 8; i++) { #if defined(__NetBSD__) snprintf(ttyname, sizeof(ttyname), "/dev/ttyE%d", i); #elif defined(__OpenBSD__) snprintf(ttyname, sizeof(ttyname), "/dev/ttyC%x", i); #endif 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); } xf86Info.consType = WSCONS; xf86Msg(X_PROBED, "Using wscons driver\n"); } return fd; } #endif /* WSCONS_SUPPORT */ void xf86CloseConsole() { #if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) struct vt_mode VT; #endif if (xf86Info.ShareVTs) return; switch (xf86Info.consType) { #ifdef PCCONS_SUPPORT case PCCONS: ioctl(xf86Info.consoleFd, CONSOLE_X_MODE_OFF, 0); break; #endif /* PCCONS_SUPPORT */ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode */ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) { 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 (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0) { xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)", strerror(errno)); } #endif if (initialVT != -1) ioctl(xf86Info.consoleFd, VT_ACTIVATE, initialVT); break; #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT case WSCONS: { int mode = WSDISPLAYIO_MODE_EMUL; ioctl(xf86Info.consoleFd, WSDISPLAYIO_SMODE, &mode); break; } #endif } close(xf86Info.consoleFd); #ifdef PCCONS_SUPPORT if (devConsoleFd >= 0) close(devConsoleFd); #endif return; } int xf86ProcessArgument(int argc, char *argv[], int i) { /* * Keep server from detaching from controlling tty. This is useful * when debugging (so the server can receive keyboard signals. */ if (!strcmp(argv[i], "-keeptty")) { KeepTty = TRUE; return 1; } #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) { UseMsg(); VTnum = -1; return 0; } return 1; } #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ return 0; } void xf86UseMsg() { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) ErrorF("vtXX use the specified VT number (1-12)\n"); #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ ErrorF("-keeptty "); ErrorF("don't detach controlling tty (for debugging only)\n"); return; } xorg-server-1.17.1/hw/xfree86/os-support/bsd/bsd_kmod.c0000664000175100017510000000114112366220413017543 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include #include "xf86_OSproc.h" /* * Load a FreeBSD kernel module. * This is used by the DRI/DRM to load a DRM kernel module when * the X server starts. It could be used for other purposes in the future. * Input: * modName - name of the kernel module (Ex: "tdfx") * Return: * 0 for failure, 1 for success */ int xf86LoadKernelModule(const char *modName) { if (kldload(modName) != -1) return 1; else return 0; } xorg-server-1.17.1/hw/xfree86/os-support/bsd/bsd_apm.c0000664000175100017510000000650612456571574017421 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" #include "xf86_OSlib.h" #include #define APM_DEVICE "/dev/apm" static void *APMihPtr = NULL; static void bsdCloseAPM(void); 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}, #ifdef APM_CAPABILITY_CHANGE {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; #define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0])) static pmEvent bsdToXF86(int type) { int i; for (i = 0; i < numApmEvents; i++) { if (type == bsdToXF86Array[i].apmBsd) { return bsdToXF86Array[i].xf86; } } return XF86_APM_UNKNOWN; } /* * APM events can be requested direclty from /dev/apm */ static int bsdPMGetEventFromOS(int fd, pmEvent * events, int num) { struct apm_event_info bsdEvent; int i; for (i = 0; i < num; i++) { if (ioctl(fd, APM_IOC_NEXTEVENT, &bsdEvent) < 0) { if (errno != EAGAIN) { xf86Msg(X_WARNING, "bsdPMGetEventFromOS: APM_IOC_NEXTEVENT" " %s\n", strerror(errno)); } break; } events[i] = bsdToXF86(bsdEvent.type); } return i; } /* * XXX This won't work on /dev/apm ! * We should either use /dev/apm_ctl (and kill apmd(8)) * or talk to apmd (but its protocol is not publically available)... */ static pmWait bsdPMConfirmEventToOs(int fd, pmEvent event) { switch (event) { case XF86_APM_SYS_STANDBY: case XF86_APM_USER_STANDBY: if (ioctl(fd, APM_IOC_STANDBY, NULL) == 0) return PM_WAIT; /* should we stop the Xserver in standby, too? */ else return PM_NONE; case XF86_APM_SYS_SUSPEND: case XF86_APM_CRITICAL_SUSPEND: case XF86_APM_USER_SUSPEND: if (ioctl(fd, APM_IOC_SUSPEND, NULL) == 0) return PM_WAIT; else return PM_NONE; case XF86_APM_STANDBY_RESUME: case XF86_APM_NORMAL_RESUME: case XF86_APM_CRITICAL_RESUME: case XF86_APM_STANDBY_FAILED: case XF86_APM_SUSPEND_FAILED: return PM_CONTINUE; default: return PM_NONE; } } PMClose xf86OSPMOpen(void) { int fd; if (APMihPtr || !xf86Info.pmFlag) { return NULL; } if ((fd = open(APM_DEVICE, O_RDWR)) == -1) { return NULL; } xf86PMGetEventFromOs = bsdPMGetEventFromOS; xf86PMConfirmEventToOs = bsdPMConfirmEventToOs; APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL); return bsdCloseAPM; } static void bsdCloseAPM(void) { int fd; if (APMihPtr) { fd = xf86RemoveGeneralHandler(APMihPtr); close(fd); APMihPtr = NULL; } } xorg-server-1.17.1/hw/xfree86/os-support/bsd/bsd_bell.c0000664000175100017510000000475712456571574017570 00000000000000/* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Dawes * * 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 names of Rich Murphey and David Dawes * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Rich Murphey and * David Dawes 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 DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID DAWES 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 #if defined (SYSCONS_SUPPORT) #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" void xf86OSRingBell(int loudness, int pitch, int duration) { #ifdef WSCONS_SUPPORT struct wskbd_bell_data wsb; #endif if (loudness && pitch) { #ifdef PCCONS_SUPPORT int data[2]; #endif switch (xf86Info.consType) { #ifdef PCCONS_SUPPORT case PCCONS: data[0] = pitch; data[1] = (duration * loudness) / 50; ioctl(xf86Info.consoleFd, CONSOLE_X_BELL, data); break; #endif #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | (((unsigned long) duration * loudness / 50) << 16)); break; #endif #if defined (WSCONS_SUPPORT) case WSCONS: wsb.which = WSKBD_BELL_DOALL; wsb.pitch = pitch; wsb.period = duration; wsb.volume = loudness; ioctl(xf86Info.consoleFd, WSKBDIO_COMPLEXBELL, &wsb); break; #endif } } } xorg-server-1.17.1/hw/xfree86/os-support/bsd/arm_video.c0000664000175100017510000001367012456571574017761 00000000000000/* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat * * 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 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 * 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 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ /* * The ARM32 code here carries the following copyright: * * Copyright 1997 * Digital Equipment Corporation. All rights reserved. * This software is furnished under license and may be used and copied only in * accordance with the following terms and conditions. Subject to these * conditions, you may download, copy, install, use, modify and distribute * this software in source and/or binary form. No title or ownership is * transferred hereby. * * 1) Any source code used, modified or distributed must reproduce and retain * this copyright notice and list of conditions as they appear in the * source file. * * 2) No right is granted to use any trade name, trademark, or logo of Digital * Equipment Corporation. Neither the "Digital Equipment Corporation" * name nor any trademark or logo of Digital Equipment Corporation may be * used to endorse or promote products derived from this software without * the prior written permission of Digital Equipment Corporation. * * 3) This software is provided "AS-IS" and any express or implied warranties, * including but not limited to, any implied warranties of merchantability, * fitness for a particular purpose, or non-infringement are disclaimed. * In no event shall DIGITAL be liable for any damages whatsoever, and in * particular, DIGITAL shall not be liable for special, indirect, * consequential, or incidental damages or damages for lost profits, loss * of revenue or loss of use, whether such damages arise in contract, * negligence, tort, under statute, in equity, at law or otherwise, even * if advised of the possibility of such damage. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" #if defined(__NetBSD__) && !defined(MAP_FILE) #define MAP_FLAGS MAP_SHARED #else #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif #define BUS_BASE 0L #define BUS_BASE_BWX 0L /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ static int devMemFd = -1; /* * Check if /dev/mem can be mmap'd. If it can't print a warning when * "warn" is TRUE. */ static void checkDevMem(Bool warn) { static Bool devMemChecked = FALSE; int fd; void *base; if (devMemChecked) return; devMemChecked = TRUE; 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); if (base != MAP_FAILED) { munmap((caddr_t) base, 4096); devMemFd = fd; return; } else { /* This should not happen */ if (warn) { xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", DEV_MEM, strerror(errno)); } return; } } if (warn) { xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n", DEV_MEM, strerror(errno)); } return; } void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { checkDevMem(TRUE); pVidMem->initialised = TRUE; } #ifdef USE_DEV_IO static int IoFd = -1; Bool xf86EnableIO() { if (IoFd >= 0) return TRUE; if ((IoFd = open("/dev/io", O_RDWR)) == -1) { xf86Msg(X_WARNING, "xf86EnableIO: " "Failed to open /dev/io for extended I/O\n"); return FALSE; } return TRUE; } void xf86DisableIO() { if (IoFd < 0) return; close(IoFd); IoFd = -1; return; } #endif #if defined(USE_ARC_MMAP) || defined(__arm32__) Bool xf86EnableIO() { int fd; void *base; if (ExtendedEnabled) return TRUE; if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) { /* Try to map a page at the pccons I/O space */ base = (void *) mmap((caddr_t) 0, 65536, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t) 0x0000); if (base != (void *) -1) { IOPortBase = base; } else { xf86Msg(X_WARNING, "EnableIO: failed to mmap %s (%s)\n", "/dev/ttyC0", strerror(errno)); return FALSE; } } else { xf86Msg("EnableIO: failed to open %s (%s)\n", "/dev/ttyC0", strerror(errno)); return FALSE; } ExtendedEnabled = TRUE; return TRUE; } void xf86DisableIO() { return; } #endif /* USE_ARC_MMAP */ xorg-server-1.17.1/hw/xfree86/os-support/bsd/sparc64_video.c0000664000175100017510000000340412456571574020456 00000000000000/* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat * * 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 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 * 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 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/bsd/bsd_ev56.c0000664000175100017510000000341312366751547017423 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "input.h" #include "scrnintstr.h" #include "compiler.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" #include /* * The following functions are used only on EV56 and greater CPUs, * and the assembler requires going to EV56 mode in order to emit * these instructions. */ __asm(".arch ev56"); int readDense8(void *Base, register unsigned long Offset); int readDense16(void *Base, register unsigned long Offset); int readDense32(void *Base, register unsigned long Offset); void writeDense8(int Value, void *Base, register unsigned long Offset); void writeDense16(int Value, void *Base, register unsigned long Offset); void writeDense32(int Value, void *Base, register unsigned long Offset); int readDense8(void *Base, register unsigned long Offset) { mem_barrier(); return (alpha_ldbu((void *) ((unsigned long) Base + (Offset)))); } int readDense16(void *Base, register unsigned long Offset) { mem_barrier(); return (alpha_ldwu((void *) ((unsigned long) Base + (Offset)))); } int readDense32(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } void writeDense8(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); alpha_stb((void *) ((unsigned long) Base + (Offset)), Value); } void writeDense16(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); alpha_stw((void *) ((unsigned long) Base + (Offset)), Value); } void writeDense32(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; } xorg-server-1.17.1/hw/xfree86/os-support/bsd/ppc_video.c0000664000175100017510000000506612456571574017764 00000000000000/* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat * * 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 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 * 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 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" #include "bus/Pci.h" /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ #ifdef __OpenBSD__ #define DEV_MEM "/dev/xf86" #endif Bool xf86EnableIO(void); void xf86DisableIO(void); void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; xf86EnableIO(); } volatile unsigned char *ioBase = MAP_FAILED; Bool xf86EnableIO() { int fd = xf86Info.consoleFd; xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); if (ioBase == MAP_FAILED) { ioBase = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xf2000000); xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %08x\n", ioBase); if (ioBase == MAP_FAILED) { xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n"); return FALSE; } } return TRUE; } void xf86DisableIO() { if (ioBase != MAP_FAILED) { munmap(__UNVOLATILE(ioBase), 0x10000); ioBase = MAP_FAILED; } } xorg-server-1.17.1/hw/xfree86/os-support/bsd/Makefile.in0000664000175100017510000011572012466505433017704 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/os-support/bsd DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libbsd_la_LIBADD = am__libbsd_la_SOURCES_DIST = $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c $(srcdir)/../shared/vidmem.c \ bsd_VTsw.c bsd_init.c bsd_bell.c alpha_video.c bsd_ev56.c \ arm_video.c i386_video.c ppc_video.c sparc64_video.c \ $(srcdir)/../shared/ioperm_noop.c \ $(srcdir)/../shared/agp_noop.c $(srcdir)/../linux/lnx_agp.c \ $(srcdir)/../shared/pm_noop.c $(srcdir)/bsd_apm.c \ $(srcdir)/bsd_kqueue_apm.c $(srcdir)/../shared/kmod_noop.c \ bsd_kmod.c @ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_FALSE@@PPC_VIDEO_FALSE@@SPARC64_VIDEO_TRUE@am__objects_1 = sparc64_video.lo \ @ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_FALSE@@PPC_VIDEO_FALSE@@SPARC64_VIDEO_TRUE@ ioperm_noop.lo @ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_FALSE@@PPC_VIDEO_TRUE@am__objects_1 = ppc_video.lo @ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_TRUE@am__objects_1 = i386_video.lo @ALPHA_VIDEO_FALSE@@ARM_VIDEO_TRUE@am__objects_1 = arm_video.lo @ALPHA_VIDEO_TRUE@am__objects_1 = alpha_video.lo bsd_ev56.lo @AGP_FALSE@am__objects_2 = agp_noop.lo @AGP_TRUE@am__objects_2 = lnx_agp.lo @BSD_APM_FALSE@@BSD_KQUEUE_APM_FALSE@am__objects_3 = pm_noop.lo @BSD_APM_TRUE@@BSD_KQUEUE_APM_FALSE@am__objects_3 = bsd_apm.lo @BSD_KQUEUE_APM_TRUE@am__objects_3 = bsd_kqueue_apm.lo @FREEBSD_KLDLOAD_FALSE@am__objects_4 = kmod_noop.lo @FREEBSD_KLDLOAD_TRUE@am__objects_4 = bsd_kmod.lo am_libbsd_la_OBJECTS = posix_tty.lo sigio.lo vidmem.lo bsd_VTsw.lo \ bsd_init.lo bsd_bell.lo $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) libbsd_la_OBJECTS = $(am_libbsd_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 = $(libbsd_la_SOURCES) DIST_SOURCES = $(am__libbsd_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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libbsd.la @BSD_APM_FALSE@@BSD_KQUEUE_APM_FALSE@APM_SOURCES = $(srcdir)/../shared/pm_noop.c @BSD_APM_TRUE@@BSD_KQUEUE_APM_FALSE@APM_SOURCES = $(srcdir)/bsd_apm.c # APM support. @BSD_KQUEUE_APM_TRUE@APM_SOURCES = $(srcdir)/bsd_kqueue_apm.c @FREEBSD_KLDLOAD_FALSE@KMOD_SOURCES = $(srcdir)/../shared/kmod_noop.c @FREEBSD_KLDLOAD_TRUE@KMOD_SOURCES = bsd_kmod.c @AGP_FALSE@AGP_SOURCES = $(srcdir)/../shared/agp_noop.c @AGP_TRUE@AGP_SOURCES = $(srcdir)/../linux/lnx_agp.c # Cheat here and piggyback other alpha bits on ALPHA_VIDEO. @ALPHA_VIDEO_TRUE@ARCH_SOURCES = \ @ALPHA_VIDEO_TRUE@ alpha_video.c \ @ALPHA_VIDEO_TRUE@ bsd_ev56.c @ARM_VIDEO_TRUE@ARCH_SOURCES = arm_video.c @I386_VIDEO_TRUE@ARCH_SOURCES = i386_video.c @PPC_VIDEO_TRUE@ARCH_SOURCES = ppc_video.c # Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO. @SPARC64_VIDEO_TRUE@ARCH_SOURCES = \ @SPARC64_VIDEO_TRUE@ sparc64_video.c \ @SPARC64_VIDEO_TRUE@ $(srcdir)/../shared/ioperm_noop.c # FIXME: NetBSD Aperture defines (configure.ac) AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) libbsd_la_SOURCES = \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ $(srcdir)/../shared/vidmem.c \ bsd_VTsw.c \ bsd_init.c \ bsd_bell.c \ $(ARCH_SOURCES) \ $(AGP_SOURCES) \ $(APM_SOURCES) \ $(AXP_SOURCES) \ $(DRI_SOURCES) \ $(KMOD_SOURCES) \ $(RES_SOURCES) # FIXME: Add these files to the build as needed EXTRA_DIST = \ memrange.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/os-support/bsd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/bsd/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libbsd.la: $(libbsd_la_OBJECTS) $(libbsd_la_DEPENDENCIES) $(EXTRA_libbsd_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libbsd_la_OBJECTS) $(libbsd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agp_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arm_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_VTsw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_apm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_ev56.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_kmod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_kqueue_apm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmod_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_agp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix_tty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc64_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.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 -o $@ $< .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 -o $@ `$(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 $@ $< posix_tty.lo: $(srcdir)/../shared/posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -MT posix_tty.lo -MD -MP -MF $(DEPDIR)/posix_tty.Tpo -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/posix_tty.Tpo $(DEPDIR)/posix_tty.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/posix_tty.c' object='posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c sigio.lo: $(srcdir)/../shared/sigio.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) $(AM_CFLAGS) $(CFLAGS) -MT sigio.lo -MD -MP -MF $(DEPDIR)/sigio.Tpo -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sigio.Tpo $(DEPDIR)/sigio.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/sigio.c' object='sigio.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) $(AM_CFLAGS) $(CFLAGS) -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c vidmem.lo: $(srcdir)/../shared/vidmem.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) $(AM_CFLAGS) $(CFLAGS) -MT vidmem.lo -MD -MP -MF $(DEPDIR)/vidmem.Tpo -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vidmem.Tpo $(DEPDIR)/vidmem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/vidmem.c' object='vidmem.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) $(AM_CFLAGS) $(CFLAGS) -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c ioperm_noop.lo: $(srcdir)/../shared/ioperm_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT ioperm_noop.lo -MD -MP -MF $(DEPDIR)/ioperm_noop.Tpo -c -o ioperm_noop.lo `test -f '$(srcdir)/../shared/ioperm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/ioperm_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ioperm_noop.Tpo $(DEPDIR)/ioperm_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/ioperm_noop.c' object='ioperm_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o ioperm_noop.lo `test -f '$(srcdir)/../shared/ioperm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/ioperm_noop.c agp_noop.lo: $(srcdir)/../shared/agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT agp_noop.lo -MD -MP -MF $(DEPDIR)/agp_noop.Tpo -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/agp_noop.Tpo $(DEPDIR)/agp_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/agp_noop.c' object='agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c lnx_agp.lo: $(srcdir)/../linux/lnx_agp.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) $(AM_CFLAGS) $(CFLAGS) -MT lnx_agp.lo -MD -MP -MF $(DEPDIR)/lnx_agp.Tpo -c -o lnx_agp.lo `test -f '$(srcdir)/../linux/lnx_agp.c' || echo '$(srcdir)/'`$(srcdir)/../linux/lnx_agp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lnx_agp.Tpo $(DEPDIR)/lnx_agp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../linux/lnx_agp.c' object='lnx_agp.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) $(AM_CFLAGS) $(CFLAGS) -c -o lnx_agp.lo `test -f '$(srcdir)/../linux/lnx_agp.c' || echo '$(srcdir)/'`$(srcdir)/../linux/lnx_agp.c pm_noop.lo: $(srcdir)/../shared/pm_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT pm_noop.lo -MD -MP -MF $(DEPDIR)/pm_noop.Tpo -c -o pm_noop.lo `test -f '$(srcdir)/../shared/pm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/pm_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pm_noop.Tpo $(DEPDIR)/pm_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/pm_noop.c' object='pm_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o pm_noop.lo `test -f '$(srcdir)/../shared/pm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/pm_noop.c bsd_apm.lo: $(srcdir)/bsd_apm.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) $(AM_CFLAGS) $(CFLAGS) -MT bsd_apm.lo -MD -MP -MF $(DEPDIR)/bsd_apm.Tpo -c -o bsd_apm.lo `test -f '$(srcdir)/bsd_apm.c' || echo '$(srcdir)/'`$(srcdir)/bsd_apm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bsd_apm.Tpo $(DEPDIR)/bsd_apm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/bsd_apm.c' object='bsd_apm.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) $(AM_CFLAGS) $(CFLAGS) -c -o bsd_apm.lo `test -f '$(srcdir)/bsd_apm.c' || echo '$(srcdir)/'`$(srcdir)/bsd_apm.c bsd_kqueue_apm.lo: $(srcdir)/bsd_kqueue_apm.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) $(AM_CFLAGS) $(CFLAGS) -MT bsd_kqueue_apm.lo -MD -MP -MF $(DEPDIR)/bsd_kqueue_apm.Tpo -c -o bsd_kqueue_apm.lo `test -f '$(srcdir)/bsd_kqueue_apm.c' || echo '$(srcdir)/'`$(srcdir)/bsd_kqueue_apm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bsd_kqueue_apm.Tpo $(DEPDIR)/bsd_kqueue_apm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/bsd_kqueue_apm.c' object='bsd_kqueue_apm.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) $(AM_CFLAGS) $(CFLAGS) -c -o bsd_kqueue_apm.lo `test -f '$(srcdir)/bsd_kqueue_apm.c' || echo '$(srcdir)/'`$(srcdir)/bsd_kqueue_apm.c kmod_noop.lo: $(srcdir)/../shared/kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT kmod_noop.lo -MD -MP -MF $(DEPDIR)/kmod_noop.Tpo -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/kmod_noop.Tpo $(DEPDIR)/kmod_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/kmod_noop.c' object='kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/xfree86/os-support/bsd/memrange.h0000664000175100017510000000401312274325511017565 00000000000000/* * Memory range attribute operations, peformed on /dev/mem */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _MEMRANGE_H #define _MEMRANGE_H /* Memory range attributes */ #define MDF_UNCACHEABLE (1<<0) /* region not cached */ #define MDF_WRITECOMBINE (1<<1) /* region supports "write combine" * action */ #define MDF_WRITETHROUGH (1<<2) /* write-through cached */ #define MDF_WRITEBACK (1<<3) /* write-back cached */ #define MDF_WRITEPROTECT (1<<4) /* read-only region */ #define MDF_ATTRMASK (0x00ffffff) #define MDF_FIXBASE (1<<24) /* fixed base */ #define MDF_FIXLEN (1<<25) /* fixed length */ #define MDF_FIRMWARE (1<<26) /* set by firmware (XXX not useful?) */ #define MDF_ACTIVE (1<<27) /* currently active */ #define MDF_BOGUS (1<<28) /* we don't like it */ #define MDF_FIXACTIVE (1<<29) /* can't be turned off */ #define MDF_BUSY (1<<30) /* range is in use */ struct mem_range_desc { u_int64_t mr_base; u_int64_t mr_len; int mr_flags; char mr_owner[8]; }; struct mem_range_op { struct mem_range_desc *mo_desc; int mo_arg[2]; #define MEMRANGE_SET_UPDATE 0 #define MEMRANGE_SET_REMOVE 1 /* XXX want a flag that says "set and undo when I exit" */ }; #define MEMRANGE_GET _IOWR('m', 50, struct mem_range_op) #define MEMRANGE_SET _IOW('m', 51, struct mem_range_op) #ifdef _KERNEL struct mem_range_softc; struct mem_range_ops { void (*init) __P((struct mem_range_softc * sc)); int (*set) __P((struct mem_range_softc * sc, struct mem_range_desc * mrd, int *arg)); void (*initAP) __P((struct mem_range_softc * sc)); }; struct mem_range_softc { struct mem_range_ops *mr_op; int mr_cap; int mr_ndesc; struct mem_range_desc *mr_desc; }; extern struct mem_range_softc mem_range_softc; extern int mem_range_attr_get __P((struct mem_range_desc * mrd, int *arg)); extern int mem_range_attr_set __P((struct mem_range_desc * mrd, int *arg)); extern void mem_range_AP_init __P((void)); #endif #endif xorg-server-1.17.1/hw/xfree86/os-support/bsd/i386_video.c0000664000175100017510000002062412456571574017670 00000000000000/* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat * * 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 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 * 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 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include #include #include "xf86_OSlib.h" #include "xf86OSpriv.h" #if defined(__NetBSD__) && !defined(MAP_FILE) #define MAP_FLAGS MAP_SHARED #else #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif #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" #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" #endif /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ static Bool useDevMem = FALSE; static int devMemFd = -1; #ifdef HAS_APERTURE_DRV #define DEV_APERTURE "/dev/xf86" #endif /* * Check if /dev/mem can be mmap'd. If it can't print a warning when * "warn" is TRUE. */ static void checkDevMem(Bool warn) { static Bool devMemChecked = FALSE; int fd; void *base; if (devMemChecked) return; devMemChecked = TRUE; 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); if (base != MAP_FAILED) { munmap((caddr_t) base, 4096); devMemFd = fd; useDevMem = TRUE; return; } else { /* This should not happen */ if (warn) { xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", DEV_MEM, strerror(errno)); } useDevMem = FALSE; return; } } #ifndef HAS_APERTURE_DRV if (warn) { xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n", DEV_MEM, strerror(errno)); } useDevMem = FALSE; return; #else /* Failed to open /dev/mem, try the aperture driver */ 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; useDevMem = TRUE; xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n", DEV_APERTURE); return; } else { if (warn) { xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", DEV_APERTURE, strerror(errno)); } } } else { if (warn) { #ifndef __OpenBSD__ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno)); #else /* __OpenBSD__ */ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno), SYSCTL_MSG); #endif /* __OpenBSD__ */ } } useDevMem = FALSE; return; #endif } void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { checkDevMem(TRUE); pci_system_init_dev_mem(devMemFd); pVidMem->initialised = TRUE; } #ifdef USE_I386_IOPL /***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ static Bool ExtendedEnabled = FALSE; Bool xf86EnableIO() { if (ExtendedEnabled) return TRUE; if (i386_iopl(TRUE) < 0) { #ifndef __OpenBSD__ 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", "xf86EnableIO", SYSCTL_MSG); #endif return FALSE; } ExtendedEnabled = TRUE; return TRUE; } void xf86DisableIO() { if (!ExtendedEnabled) return; i386_iopl(FALSE); ExtendedEnabled = FALSE; return; } #endif /* USE_I386_IOPL */ #ifdef USE_AMD64_IOPL /***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ static Bool ExtendedEnabled = FALSE; Bool xf86EnableIO() { if (ExtendedEnabled) return TRUE; if (amd64_iopl(TRUE) < 0) { #ifndef __OpenBSD__ 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", "xf86EnableIO", SYSCTL_MSG); #endif return FALSE; } ExtendedEnabled = TRUE; return TRUE; } void xf86DisableIO() { if (!ExtendedEnabled) return; if (amd64_iopl(FALSE) == 0) { ExtendedEnabled = FALSE; } /* Otherwise, the X server has revoqued its root uid, and thus cannot give up IO privileges any more */ return; } #endif /* USE_AMD64_IOPL */ #ifdef USE_DEV_IO static int IoFd = -1; Bool xf86EnableIO() { if (IoFd >= 0) return TRUE; if ((IoFd = open("/dev/io", O_RDWR)) == -1) { xf86Msg(X_WARNING, "xf86EnableIO: " "Failed to open /dev/io for extended I/O"); return FALSE; } return TRUE; } void xf86DisableIO() { if (IoFd < 0) return; close(IoFd); IoFd = -1; return; } #endif #ifdef __NetBSD__ /***************************************************************************/ /* Set TV output mode */ /***************************************************************************/ void 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; #endif /* PCCONS_SUPPORT */ default: FatalError("Xf86SetTVOut: Unsupported console"); break; } return; } void 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; #endif /* PCCONS_SUPPORT */ default: FatalError("Xf86SetTVOut: Unsupported console"); break; } return; } #endif xorg-server-1.17.1/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c0000664000175100017510000001313312456571574020772 00000000000000/* * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project * shall not be used in advertising or otherwise to promote the sale, use * or other dealings in this Software without prior written authorization * from the XFree86 Project. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" #include "xf86_OSlib.h" #include #include #define _PATH_APM_SOCKET "/var/run/apmdev" #define _PATH_APM_DEV "/dev/apm" #define _PATH_APM_CTLDEV "/dev/apmctl" static void *APMihPtr = NULL; static int devFd = -1; static int ctlFd = -1; static void bsdCloseAPM(void); 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}, #ifdef APM_CAPABILITY_CHANGE {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; #define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0])) static pmEvent bsdToXF86(int type) { int i; for (i = 0; i < numApmEvents; i++) { if (type == bsdToXF86Array[i].apmBsd) { return bsdToXF86Array[i].xf86; } } return XF86_APM_UNKNOWN; } /* * APM events can be requested direclty from /dev/apm */ static int bsdPMGetEventFromOS(int kq, pmEvent * events, int num) { struct kevent ev; int i, result; struct timespec ts = { 0, 0 }; for (i = 0; i < num; i++) { result = kevent(kq, NULL, 0, &ev, 1, &ts); if (result == 0 || APM_EVENT_TYPE(ev.data) == APM_NOEVENT) { /* no event */ break; } else if (result < 0) { xf86Msg(X_WARNING, "bsdPMGetEventFromOS: kevent returns" " %s\n", strerror(errno)); break; } events[i] = bsdToXF86(APM_EVENT_TYPE(ev.data)); } return i; } /* * If apmd(8) is running, he will get the events and handle them, * so, we've nothing to do here. * Otherwise, opening /dev/apmctl will succeed and we have to send the * confirmations to /dev/apmctl. */ static pmWait bsdPMConfirmEventToOs(int dummyfd, pmEvent event) { if (ctlFd < 0) { if ((ctlFd = open(_PATH_APM_CTLDEV, O_RDWR)) < 0) { return PM_NONE; } } /* apmctl open succeedeed */ switch (event) { case XF86_APM_SYS_STANDBY: case XF86_APM_USER_STANDBY: if (ioctl(ctlFd, APM_IOC_STANDBY, NULL) == 0) return PM_WAIT; /* should we stop the Xserver in standby, too? */ else return PM_NONE; case XF86_APM_SYS_SUSPEND: case XF86_APM_CRITICAL_SUSPEND: case XF86_APM_USER_SUSPEND: if (ioctl(ctlFd, APM_IOC_SUSPEND, NULL) == 0) return PM_WAIT; else return PM_NONE; break; case XF86_APM_STANDBY_RESUME: case XF86_APM_NORMAL_RESUME: case XF86_APM_CRITICAL_RESUME: case XF86_APM_STANDBY_FAILED: case XF86_APM_SUSPEND_FAILED: return PM_CONTINUE; break; default: return PM_NONE; } } PMClose xf86OSPMOpen(void) { int kq; struct kevent ev; if (APMihPtr || !xf86Info.pmFlag) { return NULL; } if ((devFd = open(_PATH_APM_DEV, O_RDONLY)) == -1) { return NULL; } if ((kq = kqueue()) <= 0) { close(devFd); return NULL; } EV_SET(&ev, devFd, EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR, 0, 0, NULL); if (kevent(kq, &ev, 1, NULL, 0, NULL) < 0) { close(devFd); return NULL; } xf86PMGetEventFromOs = bsdPMGetEventFromOS; xf86PMConfirmEventToOs = bsdPMConfirmEventToOs; APMihPtr = xf86AddGeneralHandler(kq, xf86HandlePMEvents, NULL); return bsdCloseAPM; } static void bsdCloseAPM(void) { int kq; if (APMihPtr) { kq = xf86RemoveGeneralHandler(APMihPtr); close(devFd); devFd = -1; close(kq); if (ctlFd >= 0) { close(ctlFd); ctlFd = -1; } APMihPtr = NULL; } } xorg-server-1.17.1/hw/xfree86/os-support/bsd/alpha_video.c0000664000175100017510000001527312456571574020270 00000000000000/* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat * * 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 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 * 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 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include #ifndef __NetBSD__ #include #endif #include "xf86_OSlib.h" #include "xf86OSpriv.h" #if defined(__NetBSD__) && !defined(MAP_FILE) #define MAP_FLAGS MAP_SHARED #else #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif #ifndef __NetBSD__ extern unsigned long dense_base(void); #else /* __NetBSD__ */ static struct alpha_bus_window *abw; static int abw_count = -1; static void init_abw(void) { if (abw_count < 0) { abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw); if (abw_count <= 0) FatalError("init_abw: alpha_bus_getwindows failed\n"); } } static unsigned long dense_base(void) { if (abw_count < 0) 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 */ return abw[0].abw_abst.abst_sys_start; } #endif /* __NetBSD__ */ #define BUS_BASE dense_base() /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ #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" #endif static int devMemFd = -1; #ifdef HAS_APERTURE_DRV #define DEV_APERTURE "/dev/xf86" #endif /* * Check if /dev/mem can be mmap'd. If it can't print a warning when * "warn" is TRUE. */ static void checkDevMem(Bool warn) { static Bool devMemChecked = FALSE; int fd; void *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 + BUS_BASE); if (base != MAP_FAILED) { munmap((caddr_t) base, 4096); devMemFd = fd; xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n", DEV_APERTURE); return; } else { if (warn) { xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", DEV_APERTURE, strerror(errno)); } } } #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); if (base != MAP_FAILED) { munmap((caddr_t) base, 4096); devMemFd = fd; return; } else { if (warn) { xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", DEV_MEM, strerror(errno)); } } } if (warn) { #ifndef HAS_APERTURE_DRV xf86Msg(X_WARNING, "checkDevMem: failed to open/mmap %s (%s)\n", DEV_MEM, strerror(errno)); #else #ifndef __OpenBSD__ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" "\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__ */ #endif xf86ErrorF("\tlinear framebuffer access unavailable\n"); } return; } void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { checkDevMem(TRUE); pVidMem->initialised = TRUE; } #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) extern int ioperm(unsigned long from, unsigned long num, int on); Bool xf86EnableIO() { if (!ioperm(0, 65536, TRUE)) return TRUE; return FALSE; } void xf86DisableIO() { return; } #endif /* __FreeBSD_kernel__ || __OpenBSD__ */ #ifdef USE_ALPHA_PIO Bool xf86EnableIO() { alpha_pci_io_enable(1); return TRUE; } void xf86DisableIO() { alpha_pci_io_enable(0); } #endif /* USE_ALPHA_PIO */ extern int readDense8(void *Base, register unsigned long Offset); extern int readDense16(void *Base, register unsigned long Offset); extern int readDense32(void *Base, register unsigned long Offset); extern void writeDense8(int Value, void *Base, register unsigned long Offset); extern void writeDense16(int Value, void *Base, register unsigned long Offset); extern void writeDense32(int Value, void *Base, register unsigned long Offset); void (*xf86WriteMmio8) (int Value, void *Base, unsigned long Offset) = writeDense8; void (*xf86WriteMmio16) (int Value, void *Base, unsigned long Offset) = writeDense16; void (*xf86WriteMmio32) (int Value, void *Base, unsigned long Offset) = writeDense32; int (*xf86ReadMmio8) (void *Base, unsigned long Offset) = readDense8; int (*xf86ReadMmio16) (void *Base, unsigned long Offset) = readDense16; int (*xf86ReadMmio32) (void *Base, unsigned long Offset) = readDense32; xorg-server-1.17.1/hw/xfree86/os-support/bsd/bsd_VTsw.c0000664000175100017510000000565112366220413017526 00000000000000/* * Derived from VTsw_usl.c which is * Copyright 1993 by David Wexelblat * by S_ren Schmidt (sos@login.dkuug.dk) * * 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 David Wexelblat not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. David Wexelblat makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL 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. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" /* * Handle the VT-switching interface for OSs that use USL-style ioctl()s * (the bsd, sysv, sco, and linux subdirs). */ /* * This function is the signal handler for the VT-switching signal. It * is only referenced inside the OS-support layer. */ void xf86VTRequest(int sig) { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { xf86Info.vtRequestsPending = TRUE; } #endif return; } Bool xf86VTSwitchPending() { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { return xf86Info.vtRequestsPending ? TRUE : FALSE; } #endif return FALSE; } Bool xf86VTSwitchAway() { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) return FALSE; else return TRUE; } #endif return FALSE; } Bool xf86VTSwitchTo() { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) return FALSE; else return TRUE; } #endif return TRUE; } Bool xf86VTActivate(int vtno) { if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) { return FALSE; } return TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/linux/0000775000175100017510000000000012466505445016303 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/linux/Makefile.am0000664000175100017510000000177312406661137020262 00000000000000noinst_LTLIBRARIES = liblinux.la if LINUX_ALPHA noinst_LTLIBRARIES += liblinuxev56.la liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56 liblinuxev56_la_SOURCES = lnx_ev56.c endif if LNXACPI ACPI_SRCS = lnx_acpi.c lnx_apm.c XORG_CFLAGS += -DHAVE_ACPI endif if LNXAPM APM_SRCS = lnx_apm.c XORG_CFLAGS += -DHAVE_APM endif if SYSTEMD_LOGIND LOGIND_SRCS = systemd-logind.c XORG_CFLAGS += $(DBUS_CFLAGS) endif liblinux_la_SOURCES = lnx_init.c lnx_video.c \ lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigio.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ $(LOGIND_SRCS) AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) if LINUX_ALPHA liblinux_la_LIBADD = liblinuxev56.la endif xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_agp.c0000664000175100017510000002275012456571574020032 00000000000000/* * Abstraction of the AGP GART interface. * * This version is for Linux and Free/Open/NetBSD. * * Copyright © 2000 VA Linux Systems, Inc. * Copyright © 2001 The XFree86 Project, Inc. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" #if defined(linux) #include #include #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) #include #include #endif #ifndef AGP_DEVICE #define AGP_DEVICE "/dev/agpgart" #endif /* AGP page size is independent of the host page size. */ #ifndef AGP_PAGE_SIZE #define AGP_PAGE_SIZE 4096 #endif #define AGPGART_MAJOR_VERSION 0 #define AGPGART_MINOR_VERSION 99 static int gartFd = -1; static int acquiredScreen = -1; static Bool initDone = FALSE; /* * Close /dev/agpgart. This frees all associated memory allocated during * this server generation. */ Bool xf86GARTCloseScreen(int screenNum) { if (gartFd != -1) { close(gartFd); acquiredScreen = -1; gartFd = -1; initDone = FALSE; } return TRUE; } /* * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called. */ static Bool GARTInit(int screenNum) { struct _agp_info agpinf; if (initDone) return gartFd != -1; initDone = TRUE; if (gartFd == -1) gartFd = open(AGP_DEVICE, O_RDWR, 0); else return FALSE; if (gartFd == -1) { xf86DrvMsg(screenNum, X_ERROR, "GARTInit: Unable to open " AGP_DEVICE " (%s)\n", strerror(errno)); return FALSE; } xf86AcquireGART(-1); /* Check the kernel driver version. */ if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) { xf86DrvMsg(screenNum, X_ERROR, "GARTInit: AGPIOC_INFO failed (%s)\n", strerror(errno)); close(gartFd); gartFd = -1; return FALSE; } xf86ReleaseGART(-1); #if defined(linux) /* Per Dave Jones, every effort will be made to keep the * agpgart interface backwards compatible, so allow all * future versions. */ if ( #if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */ agpinf.version.major < AGPGART_MAJOR_VERSION || #endif (agpinf.version.major == AGPGART_MAJOR_VERSION && agpinf.version.minor < AGPGART_MINOR_VERSION)) { xf86DrvMsg(screenNum, X_ERROR, "GARTInit: Kernel agpgart driver version is not current" " (%d.%d vs %d.%d)\n", agpinf.version.major, agpinf.version.minor, AGPGART_MAJOR_VERSION, AGPGART_MINOR_VERSION); close(gartFd); gartFd = -1; return FALSE; } #endif return TRUE; } Bool xf86AgpGARTSupported(void) { return GARTInit(-1); } AgpInfoPtr xf86GetAGPInfo(int screenNum) { struct _agp_info agpinf; AgpInfoPtr info; if (!GARTInit(screenNum)) return NULL; if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) { xf86DrvMsg(screenNum, X_ERROR, "xf86GetAGPInfo: Failed to allocate AgpInfo\n"); return NULL; } memset((char *) &agpinf, 0, sizeof(agpinf)); if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) { xf86DrvMsg(screenNum, X_ERROR, "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n", strerror(errno)); return NULL; } info->bridgeId = agpinf.bridge_id; info->agpMode = agpinf.agp_mode; info->base = agpinf.aper_base; info->size = agpinf.aper_size; info->totalPages = agpinf.pg_total; info->systemPages = agpinf.pg_system; info->usedPages = agpinf.pg_used; xf86DrvMsg(screenNum, X_INFO, "Kernel reported %zu total, %zu used\n", agpinf.pg_total, agpinf.pg_used); return info; } /* * XXX If multiple screens can acquire the GART, should we have a reference * count instead of using acquiredScreen? */ Bool xf86AcquireGART(int screenNum) { if (screenNum != -1 && !GARTInit(screenNum)) return FALSE; if (screenNum == -1 || acquiredScreen != screenNum) { if (ioctl(gartFd, AGPIOC_ACQUIRE, 0) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86AcquireGART: AGPIOC_ACQUIRE failed (%s)\n", strerror(errno)); return FALSE; } acquiredScreen = screenNum; } return TRUE; } Bool xf86ReleaseGART(int screenNum) { if (screenNum != -1 && !GARTInit(screenNum)) return FALSE; if (acquiredScreen == screenNum) { /* * The FreeBSD agp driver removes allocations on release. * The Linux driver doesn't. xf86ReleaseGART() is expected * to give up access to the GART, but not to remove any * allocations. */ #if !defined(linux) if (screenNum == -1) #endif { if (ioctl(gartFd, AGPIOC_RELEASE, 0) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86ReleaseGART: AGPIOC_RELEASE failed (%s)\n", strerror(errno)); return FALSE; } acquiredScreen = -1; } return TRUE; } return FALSE; } int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type, unsigned long *physical) { struct _agp_allocate alloc; int pages; /* * Allocates "size" bytes of GART memory (rounds up to the next * page multiple) or type "type". A handle (key) for the allocated * memory is returned. On error, the return value is -1. */ if (!GARTInit(screenNum) || acquiredScreen != screenNum) return -1; pages = (size / AGP_PAGE_SIZE); if (size % AGP_PAGE_SIZE != 0) pages++; /* XXX check for pages == 0? */ alloc.pg_count = pages; alloc.type = type; if (ioctl(gartFd, AGPIOC_ALLOCATE, &alloc) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86AllocateGARTMemory: " "allocation of %d pages failed\n\t(%s)\n", pages, strerror(errno)); return -1; } if (physical) *physical = alloc.physical; return alloc.key; } Bool xf86DeallocateGARTMemory(int screenNum, int key) { if (!GARTInit(screenNum) || acquiredScreen != screenNum) return FALSE; if (acquiredScreen != screenNum) { xf86DrvMsg(screenNum, X_ERROR, "xf86UnbindGARTMemory: AGP not acquired by this screen\n"); return FALSE; } #ifdef __linux__ if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *) (uintptr_t) key) != 0) { #else if (ioctl(gartFd, AGPIOC_DEALLOCATE, &key) != 0) { #endif xf86DrvMsg(screenNum, X_WARNING, "xf86DeAllocateGARTMemory: " "deallocation gart memory with key %d failed\n\t(%s)\n", key, strerror(errno)); return FALSE; } return TRUE; } /* Bind GART memory with "key" at "offset" */ Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset) { struct _agp_bind bind; int pageOffset; if (!GARTInit(screenNum) || acquiredScreen != screenNum) return FALSE; if (acquiredScreen != screenNum) { xf86DrvMsg(screenNum, X_ERROR, "xf86BindGARTMemory: AGP not acquired by this screen\n"); return FALSE; } if (offset % AGP_PAGE_SIZE != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: " "offset (0x%lx) is not page-aligned (%d)\n", offset, AGP_PAGE_SIZE); return FALSE; } pageOffset = offset / AGP_PAGE_SIZE; xf86DrvMsgVerb(screenNum, X_INFO, 3, "xf86BindGARTMemory: bind key %d at 0x%08lx " "(pgoffset %d)\n", key, offset, pageOffset); bind.pg_start = pageOffset; bind.key = key; if (ioctl(gartFd, AGPIOC_BIND, &bind) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: " "binding of gart memory with key %d\n" "\tat offset 0x%lx failed (%s)\n", key, offset, strerror(errno)); return FALSE; } return TRUE; } /* Unbind GART memory with "key" */ Bool xf86UnbindGARTMemory(int screenNum, int key) { struct _agp_unbind unbind; if (!GARTInit(screenNum) || acquiredScreen != screenNum) return FALSE; if (acquiredScreen != screenNum) { xf86DrvMsg(screenNum, X_ERROR, "xf86UnbindGARTMemory: AGP not acquired by this screen\n"); return FALSE; } unbind.priority = 0; unbind.key = key; if (ioctl(gartFd, AGPIOC_UNBIND, &unbind) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86UnbindGARTMemory: " "unbinding of gart memory with key %d " "failed (%s)\n", key, strerror(errno)); return FALSE; } xf86DrvMsgVerb(screenNum, X_INFO, 3, "xf86UnbindGARTMemory: unbind key %d\n", key); return TRUE; } /* XXX Interface may change. */ Bool xf86EnableAGP(int screenNum, CARD32 mode) { agp_setup setup; if (!GARTInit(screenNum) || acquiredScreen != screenNum) return FALSE; setup.agp_mode = mode; if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: " "AGPIOC_SETUP with mode %ld failed (%s)\n", (unsigned long) mode, strerror(errno)); return FALSE; } return TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_ev56.c0000664000175100017510000000274012366751547020045 00000000000000/* This file has to be built with -mcpu=ev56 */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "compiler.h" int readDense8(void *Base, register unsigned long Offset); int readDense16(void *Base, register unsigned long Offset); int readDense32(void *Base, register unsigned long Offset); void writeDense8(int Value, void *Base, register unsigned long Offset); void writeDense16(int Value, void *Base, register unsigned long Offset); void writeDense32(int Value, void *Base, register unsigned long Offset); int readDense8(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD8 *) ((unsigned long) Base + (Offset)); } int readDense16(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD16 *) ((unsigned long) Base + (Offset)); } int readDense32(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } void writeDense8(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD8 *) ((unsigned long) Base + (Offset)) = Value; } void writeDense16(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD16 *) ((unsigned long) Base + (Offset)) = Value; } void writeDense32(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; } xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_platform.c0000664000175100017510000001275112366220413021066 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #ifdef XSERVER_PLATFORM_BUS #include #include #include #include #include /* Linux platform device support */ #include "xf86_OSproc.h" #include "xf86.h" #include "xf86platformBus.h" #include "xf86Bus.h" #include "hotplug.h" #include "systemd-logind.h" static Bool get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) { drmSetVersion sv; drmVersionPtr v; char *buf; int major, minor, fd; int err = 0; Bool paused, server_fd = FALSE; major = attribs->major; minor = attribs->minor; fd = systemd_logind_take_fd(major, minor, path, &paused); if (fd != -1) { if (paused) { LogMessage(X_ERROR, "Error systemd-logind returned paused fd for drm node\n"); systemd_logind_release_fd(major, minor, -1); return FALSE; } attribs->fd = fd; server_fd = TRUE; } if (fd == -1) 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 */ err = drmSetInterfaceVersion(fd, &sv); if (err) { xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n", path, strerror(-err)); goto out; } /* for a delayed probe we've already added the device */ if (delayed_index == -1) { xf86_add_platform_device(attribs, FALSE); delayed_index = xf86_num_platform_devices - 1; } if (server_fd) xf86_platform_devices[delayed_index].flags |= XF86_PDEV_SERVER_FD; buf = drmGetBusid(fd); xf86_platform_odev_attributes(delayed_index)->busid = XNFstrdup(buf); drmFreeBusid(buf); v = drmGetVersion(fd); if (!v) { xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path); goto out; } xf86_platform_odev_attributes(delayed_index)->driver = XNFstrdup(v->name); drmFreeVersion(v); out: if (!server_fd) close(fd); return (err == 0); } Bool xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid) { const char *syspath = device->attribs->syspath; BusType bustype; const char *id; 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 xf86PlatformReprobeDevice(int index, struct OdevAttributes *attribs) { Bool ret; char *dpath = attribs->path; ret = get_drm_info(attribs, dpath, index); if (ret == FALSE) { xf86_remove_platform_device(index); return; } ret = xf86platformAddDevice(index); if (ret == -1) xf86_remove_platform_device(index); } void xf86PlatformDeviceProbe(struct OdevAttributes *attribs) { int i; char *path = attribs->path; Bool ret; if (!path) goto out_free; for (i = 0; i < xf86_num_platform_devices; i++) { char *dpath = xf86_platform_odev_attributes(i)->path; if (dpath && !strcmp(path, dpath)) break; } if (i != xf86_num_platform_devices) goto out_free; LogMessage(X_INFO, "xfree86: Adding drm device (%s)\n", path); if (!xf86VTOwner()) { /* if we don't currently own the VT then don't probe the device, just mark it as unowned for later use */ xf86_add_platform_device(attribs, TRUE); return; } ret = get_drm_info(attribs, path, -1); if (ret == FALSE) goto out_free; return; out_free: config_odev_free_attributes(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; if (xf86_get_platform_device_unowned(xf86_num_platform_devices - 1) == TRUE) 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) { int index; char *syspath = attribs->syspath; if (!syspath) goto out; for (index = 0; index < xf86_num_platform_devices; index++) { char *dspath = xf86_platform_odev_attributes(index)->syspath; if (dspath && !strcmp(syspath, dspath)) break; } if (index == xf86_num_platform_devices) goto out; ErrorF("xf86: remove device %d %s\n", index, syspath); if (xf86_get_platform_device_unowned(index) == TRUE) xf86_remove_platform_device(index); else xf86platformRemoveDevice(index); out: config_odev_free_attributes(attribs); } #endif xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_acpi.c0000664000175100017510000001041412366220413020150 00000000000000#ifdef HAVE_XORG_CONFIG_H #include "xorg-config.h" #endif #include "os.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" #include #include #include #include #include #include #include #define ACPI_SOCKET "/var/run/acpid.socket" #define ACPI_VIDEO_NOTIFY_SWITCH 0x80 #define ACPI_VIDEO_NOTIFY_PROBE 0x81 #define ACPI_VIDEO_NOTIFY_CYCLE 0x82 #define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83 #define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84 #define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x85 #define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86 #define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87 #define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x88 #define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x89 #define ACPI_VIDEO_HEAD_INVALID (~0u - 1) #define ACPI_VIDEO_HEAD_END (~0u) static void lnxCloseACPI(void); static void *ACPIihPtr = NULL; PMClose lnxACPIOpen(void); /* in milliseconds */ #define ACPI_REOPEN_DELAY 1000 static CARD32 lnxACPIReopen(OsTimerPtr timer, CARD32 time, void *arg) { if (lnxACPIOpen()) { TimerFree(timer); return 0; } return ACPI_REOPEN_DELAY; } #define LINE_LENGTH 80 static int lnxACPIGetEventFromOs(int fd, pmEvent * events, int num) { char ev[LINE_LENGTH]; int n; memset(ev, 0, LINE_LENGTH); do { n = read(fd, ev, LINE_LENGTH); } while ((n == -1) && (errno == EAGAIN || errno == EINTR)); if (n <= 0) { lnxCloseACPI(); TimerSet(NULL, 0, ACPI_REOPEN_DELAY, lnxACPIReopen, NULL); return 0; } /* FIXME: this only processes the first read ACPI event & might break * with interrupted reads. */ /* Check that we have a video event */ if (!strncmp(ev, "video", 5)) { char *GFX = NULL; char *notify = NULL; char *data = NULL; /* doesn't appear to be used in the kernel */ unsigned long int notify_l; strtok(ev, " "); if (!(GFX = strtok(NULL, " "))) return 0; #if 0 ErrorF("GFX: %s\n", GFX); #endif if (!(notify = strtok(NULL, " "))) return 0; notify_l = strtoul(notify, NULL, 16); #if 0 ErrorF("notify: 0x%lx\n", notify_l); #endif if (!(data = strtok(NULL, " "))) return 0; #if 0 data_l = strtoul(data, NULL, 16); ErrorF("data: 0x%lx\n", data_l); #endif /* Differentiate between events */ switch (notify_l) { case ACPI_VIDEO_NOTIFY_SWITCH: case ACPI_VIDEO_NOTIFY_CYCLE: case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: events[0] = XF86_APM_CAPABILITY_CHANGED; return 1; case ACPI_VIDEO_NOTIFY_PROBE: return 0; default: return 0; } } return 0; } static pmWait lnxACPIConfirmEventToOs(int fd, pmEvent event) { /* No ability to send back to the kernel in ACPI */ switch (event) { default: return PM_NONE; } } PMClose lnxACPIOpen(void) { int fd; struct sockaddr_un addr; int r = -1; static int warned = 0; DebugF("ACPI: OSPMOpen called\n"); if (ACPIihPtr || !xf86Info.pmFlag) return NULL; DebugF("ACPI: Opening device\n"); if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) > -1) { memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strcpy(addr.sun_path, ACPI_SOCKET); if ((r = connect(fd, (struct sockaddr *) &addr, sizeof(addr))) == -1) { if (!warned) xf86MsgVerb(X_WARNING, 3, "Open ACPI failed (%s) (%s)\n", ACPI_SOCKET, strerror(errno)); warned = 1; shutdown(fd, 2); close(fd); return NULL; } } xf86PMGetEventFromOs = lnxACPIGetEventFromOs; xf86PMConfirmEventToOs = lnxACPIConfirmEventToOs; ACPIihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL); xf86MsgVerb(X_INFO, 3, "Open ACPI successful (%s)\n", ACPI_SOCKET); warned = 0; return lnxCloseACPI; } static void lnxCloseACPI(void) { int fd; DebugF("ACPI: Closing device\n"); if (ACPIihPtr) { fd = xf86RemoveGeneralHandler(ACPIihPtr); shutdown(fd, 2); close(fd); ACPIihPtr = NULL; } } xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_apm.c0000664000175100017510000001162612366220413020017 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" #ifdef HAVE_ACPI extern PMClose lnxACPIOpen(void); #endif #ifdef HAVE_APM #include #include #include #include #include #include #include #define APM_PROC "/proc/apm" #define APM_DEVICE "/dev/apm_bios" #ifndef APM_STANDBY_FAILED #define APM_STANDBY_FAILED 0xf000 #endif #ifndef APM_SUSPEND_FAILED #define APM_SUSPEND_FAILED 0xf001 #endif static PMClose lnxAPMOpen(void); static void lnxCloseAPM(void); static void *APMihPtr = NULL; 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}, #if defined(APM_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} #endif }; #define numApmEvents (sizeof(LinuxToXF86) / sizeof(LinuxToXF86[0])) /* * APM is still under construction. * I'm not sure if the places where I initialize/deinitialize * apm is correct. Also I don't know what to do in SETUP state. * This depends if wakeup gets called in this situation, too. * Also we need to check if the action that is taken on an * event is reasonable. */ static int lnxPMGetEventFromOs(int fd, pmEvent * events, int num) { int i, j, n; apm_event_t linuxEvents[8]; if ((n = read(fd, linuxEvents, num * sizeof(apm_event_t))) == -1) return 0; n /= sizeof(apm_event_t); if (n > num) n = num; for (i = 0; i < n; i++) { for (j = 0; j < numApmEvents; j++) if (LinuxToXF86[j].apmLinux == linuxEvents[i]) { events[i] = LinuxToXF86[j].xf86; break; } if (j == numApmEvents) events[i] = XF86_APM_UNKNOWN; } return n; } static pmWait lnxPMConfirmEventToOs(int fd, pmEvent event) { switch (event) { case XF86_APM_SYS_STANDBY: case XF86_APM_USER_STANDBY: if (ioctl(fd, APM_IOC_STANDBY, NULL)) return PM_FAILED; return PM_CONTINUE; case XF86_APM_SYS_SUSPEND: case XF86_APM_CRITICAL_SUSPEND: case XF86_APM_USER_SUSPEND: if (ioctl(fd, APM_IOC_SUSPEND, NULL)) { /* I believe this is wrong (EE) EBUSY is sent when a device refuses to be suspended. In this case we still need to undo everything we have done to suspend ourselves or we will stay in suspended state forever. */ if (errno == EBUSY) return PM_CONTINUE; else return PM_FAILED; } return PM_CONTINUE; case XF86_APM_STANDBY_RESUME: case XF86_APM_NORMAL_RESUME: case XF86_APM_CRITICAL_RESUME: case XF86_APM_STANDBY_FAILED: case XF86_APM_SUSPEND_FAILED: return PM_CONTINUE; default: return PM_NONE; } } #endif // HAVE_APM PMClose xf86OSPMOpen(void) { PMClose ret = NULL; #ifdef HAVE_ACPI /* Favour ACPI over APM, but only when enabled */ if (!xf86acpiDisableFlag) ret = lnxACPIOpen(); if (!ret) #endif #ifdef HAVE_APM ret = lnxAPMOpen(); #endif return ret; } #ifdef HAVE_APM static PMClose lnxAPMOpen(void) { int fd, pfd; DebugF("APM: OSPMOpen called\n"); if (APMihPtr || !xf86Info.pmFlag) return NULL; DebugF("APM: Opening device\n"); if ((fd = open(APM_DEVICE, O_RDWR)) > -1) { if (access(APM_PROC, R_OK) || ((pfd = open(APM_PROC, O_RDONLY)) == -1)) { xf86MsgVerb(X_WARNING, 3, "Cannot open APM (%s) (%s)\n", APM_PROC, strerror(errno)); close(fd); return NULL; } else close(pfd); xf86PMGetEventFromOs = lnxPMGetEventFromOs; xf86PMConfirmEventToOs = lnxPMConfirmEventToOs; APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL); xf86MsgVerb(X_INFO, 3, "Open APM successful\n"); return lnxCloseAPM; } return NULL; } static void lnxCloseAPM(void) { int fd; DebugF("APM: Closing device\n"); if (APMihPtr) { fd = xf86RemoveGeneralHandler(APMihPtr); close(fd); APMihPtr = NULL; } } #endif // HAVE_APM xorg-server-1.17.1/hw/xfree86/os-support/linux/systemd-logind.c0000664000175100017510000004613512456571574021347 00000000000000/* * Copyright © 2013 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. * * Author: Hans de Goede */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "os.h" #include "dbus-core.h" #include "xf86.h" #include "xf86platformBus.h" #include "xf86Xinput.h" #include "systemd-logind.h" #define DBUS_TIMEOUT 500 /* Wait max 0.5 seconds */ struct systemd_logind_info { DBusConnection *conn; char *session; Bool active; Bool vt_active; }; static struct systemd_logind_info logind_info; static InputInfoPtr systemd_logind_find_info_ptr_by_devnum(InputInfoPtr start, int major, int minor) { InputInfoPtr pInfo; for (pInfo = start; pInfo; pInfo = pInfo->next) if (pInfo->major == major && pInfo->minor == minor && (pInfo->flags & XI86_SERVER_FD)) return pInfo; return NULL; } static void systemd_logind_set_input_fd_for_all_devs(int major, int minor, int fd, Bool enable) { InputInfoPtr pInfo; pInfo = systemd_logind_find_info_ptr_by_devnum(xf86InputDevs, major, minor); while (pInfo) { pInfo->fd = fd; pInfo->options = xf86ReplaceIntOption(pInfo->options, "fd", fd); if (enable) xf86EnableInputDeviceForVTSwitch(pInfo); pInfo = systemd_logind_find_info_ptr_by_devnum(pInfo->next, major, minor); } } int systemd_logind_take_fd(int _major, int _minor, const char *path, Bool *paused_ret) { struct systemd_logind_info *info = &logind_info; InputInfoPtr pInfo; DBusError error; DBusMessage *msg = NULL; DBusMessage *reply = NULL; dbus_int32_t major = _major; dbus_int32_t minor = _minor; dbus_bool_t paused; int fd = -1; if (!info->session || major == 0) return -1; /* logind does not support mouse devs (with evdev we don't need them) */ if (strstr(path, "mouse")) return -1; /* Check if we already have an InputInfo entry with this major, minor * (shared device-nodes happen ie with Wacom tablets). */ pInfo = systemd_logind_find_info_ptr_by_devnum(xf86InputDevs, major, minor); if (pInfo) { LogMessage(X_INFO, "systemd-logind: returning pre-existing fd for %s %u:%u\n", path, major, minor); *paused_ret = FALSE; return pInfo->fd; } dbus_error_init(&error); msg = dbus_message_new_method_call("org.freedesktop.login1", info->session, "org.freedesktop.login1.Session", "TakeDevice"); if (!msg) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } if (!dbus_message_append_args(msg, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, DBUS_TIMEOUT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: failed to take device %s: %s\n", path, error.message); goto cleanup; } if (!dbus_message_get_args(reply, &error, DBUS_TYPE_UNIX_FD, &fd, DBUS_TYPE_BOOLEAN, &paused, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: TakeDevice %s: %s\n", path, error.message); goto cleanup; } *paused_ret = paused; LogMessage(X_INFO, "systemd-logind: got fd for %s %u:%u fd %d paused %d\n", path, major, minor, fd, paused); cleanup: if (msg) dbus_message_unref(msg); if (reply) dbus_message_unref(reply); dbus_error_free(&error); return fd; } void systemd_logind_release_fd(int _major, int _minor, int fd) { struct systemd_logind_info *info = &logind_info; InputInfoPtr pInfo; DBusError error; DBusMessage *msg = NULL; DBusMessage *reply = NULL; dbus_int32_t major = _major; dbus_int32_t minor = _minor; int matches = 0; if (!info->session || major == 0) goto close; /* Only release the fd if there is only 1 InputInfo left for this major * and minor, otherwise other InputInfo's are still referencing the fd. */ pInfo = systemd_logind_find_info_ptr_by_devnum(xf86InputDevs, major, minor); while (pInfo) { matches++; pInfo = systemd_logind_find_info_ptr_by_devnum(pInfo->next, major, minor); } if (matches > 1) { LogMessage(X_INFO, "systemd-logind: not releasing fd for %u:%u, still in use\n", major, minor); return; } LogMessage(X_INFO, "systemd-logind: releasing fd for %u:%u\n", major, minor); dbus_error_init(&error); msg = dbus_message_new_method_call("org.freedesktop.login1", info->session, "org.freedesktop.login1.Session", "ReleaseDevice"); if (!msg) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } if (!dbus_message_append_args(msg, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, DBUS_TIMEOUT, &error); if (!reply) LogMessage(X_ERROR, "systemd-logind: failed to release device: %s\n", error.message); cleanup: if (msg) dbus_message_unref(msg); if (reply) dbus_message_unref(reply); dbus_error_free(&error); close: if (fd != -1) close(fd); } int systemd_logind_controls_session(void) { return logind_info.session ? 1 : 0; } void systemd_logind_vtenter(void) { struct systemd_logind_info *info = &logind_info; InputInfoPtr pInfo; int i; if (!info->session) return; /* Not using systemd-logind */ if (!info->active) return; /* Session not active */ if (info->vt_active) return; /* Already did vtenter */ for (i = 0; i < xf86_num_platform_devices; i++) { if (xf86_platform_devices[i].flags & XF86_PDEV_PAUSED) break; } if (i != xf86_num_platform_devices) return; /* Some drm nodes are still paused wait for resume */ xf86VTEnter(); info->vt_active = TRUE; /* Activate any input devices which were resumed before the drm nodes */ for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) if ((pInfo->flags & XI86_SERVER_FD) && pInfo->fd != -1) xf86EnableInputDeviceForVTSwitch(pInfo); /* Do delayed input probing, this must be done after the above enabling */ xf86InputEnableVTProbe(); } static void systemd_logind_ack_pause(struct systemd_logind_info *info, dbus_int32_t minor, dbus_int32_t major) { DBusError error; DBusMessage *msg = NULL; DBusMessage *reply = NULL; dbus_error_init(&error); msg = dbus_message_new_method_call("org.freedesktop.login1", info->session, "org.freedesktop.login1.Session", "PauseDeviceComplete"); if (!msg) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } if (!dbus_message_append_args(msg, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, DBUS_TIMEOUT, &error); if (!reply) LogMessage(X_ERROR, "systemd-logind: failed to ack pause: %s\n", error.message); cleanup: if (msg) dbus_message_unref(msg); if (reply) dbus_message_unref(reply); dbus_error_free(&error); } static DBusHandlerResult message_filter(DBusConnection * connection, DBusMessage * message, void *data) { struct systemd_logind_info *info = data; struct xf86_platform_device *pdev = NULL; InputInfoPtr pInfo = NULL; int ack = 0, pause = 0, fd = -1; DBusError error; dbus_int32_t major, minor; char *pause_str; dbus_error_init(&error); if (dbus_message_is_signal(message, "org.freedesktop.DBus", "NameOwnerChanged")) { char *name, *old_owner, *new_owner; dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner, DBUS_TYPE_INVALID); if (dbus_error_is_set(&error)) { LogMessage(X_ERROR, "systemd-logind: NameOwnerChanged: %s\n", error.message); dbus_error_free(&error); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } if (name && strcmp(name, "org.freedesktop.login1") == 0) FatalError("systemd-logind disappeared (stopped/restarted?)\n"); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } if (strcmp(dbus_message_get_path(message), info->session) != 0) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; if (dbus_message_is_signal(message, "org.freedesktop.login1.Session", "PauseDevice")) { if (!dbus_message_get_args(message, &error, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_STRING, &pause_str, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: PauseDevice: %s\n", error.message); dbus_error_free(&error); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } if (strcmp(pause_str, "pause") == 0) { pause = 1; ack = 1; } else if (strcmp(pause_str, "force") == 0) { pause = 1; } else if (strcmp(pause_str, "gone") == 0) { /* Device removal is handled through udev */ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } else { LogMessage(X_WARNING, "systemd-logind: unknown pause type: %s\n", pause_str); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } } else if (dbus_message_is_signal(message, "org.freedesktop.login1.Session", "ResumeDevice")) { if (!dbus_message_get_args(message, &error, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_UNIX_FD, &fd, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: ResumeDevice: %s\n", error.message); dbus_error_free(&error); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } } else return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; LogMessage(X_INFO, "systemd-logind: got %s for %u:%u\n", pause ? "pause" : "resume", major, minor); pdev = xf86_find_platform_device_by_devnum(major, minor); if (!pdev) pInfo = systemd_logind_find_info_ptr_by_devnum(xf86InputDevs, major, minor); if (!pdev && !pInfo) { LogMessage(X_WARNING, "systemd-logind: could not find dev %u:%u\n", major, minor); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } if (pause) { /* Our VT_PROCESS usage guarantees we've already given up the vt */ info->active = info->vt_active = FALSE; /* Note the actual vtleave has already been handled by xf86Events.c */ if (pdev) pdev->flags |= XF86_PDEV_PAUSED; else { close(pInfo->fd); systemd_logind_set_input_fd_for_all_devs(major, minor, -1, FALSE); } if (ack) systemd_logind_ack_pause(info, major, minor); } else { /* info->vt_active gets set by systemd_logind_vtenter() */ info->active = TRUE; if (pdev) pdev->flags &= ~XF86_PDEV_PAUSED; else systemd_logind_set_input_fd_for_all_devs(major, minor, fd, info->vt_active); /* Always call vtenter(), in case there are only legacy video devs */ systemd_logind_vtenter(); } return DBUS_HANDLER_RESULT_HANDLED; } static void connect_hook(DBusConnection *connection, void *data) { struct systemd_logind_info *info = data; DBusError error; DBusMessage *msg = NULL; DBusMessage *reply = NULL; dbus_int32_t arg; char *session = NULL; dbus_error_init(&error); msg = dbus_message_new_method_call("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "GetSessionByPID"); if (!msg) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } arg = getpid(); if (!dbus_message_append_args(msg, DBUS_TYPE_UINT32, &arg, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } reply = dbus_connection_send_with_reply_and_block(connection, msg, DBUS_TIMEOUT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: failed to get session: %s\n", error.message); goto cleanup; } dbus_message_unref(msg); if (!dbus_message_get_args(reply, &error, DBUS_TYPE_OBJECT_PATH, &session, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: GetSessionByPID: %s\n", error.message); goto cleanup; } session = XNFstrdup(session); dbus_message_unref(reply); reply = NULL; msg = dbus_message_new_method_call("org.freedesktop.login1", session, "org.freedesktop.login1.Session", "TakeControl"); if (!msg) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } arg = FALSE; /* Don't forcibly take over over the session */ if (!dbus_message_append_args(msg, DBUS_TYPE_BOOLEAN, &arg, DBUS_TYPE_INVALID)) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } reply = dbus_connection_send_with_reply_and_block(connection, msg, DBUS_TIMEOUT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: TakeControl failed: %s\n", error.message); goto cleanup; } dbus_bus_add_match(connection, "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus'", &error); if (dbus_error_is_set(&error)) { LogMessage(X_ERROR, "systemd-logind: could not add match: %s\n", error.message); goto cleanup; } /* * HdG: This is not useful with systemd <= 208 since the signal only * contains invalidated property names there, rather than property, val * pairs as it should. Instead we just use the first resume / pause now. */ #if 0 snprintf(match, sizeof(match), "type='signal',sender='org.freedesktop.login1',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path='%s'", session); dbus_bus_add_match(connection, match, &error); if (dbus_error_is_set(&error)) { LogMessage(X_ERROR, "systemd-logind: could not add match: %s\n", error.message); goto cleanup; } #endif if (!dbus_connection_add_filter(connection, message_filter, info, NULL)) { LogMessage(X_ERROR, "systemd-logind: could not add filter: %s\n", error.message); goto cleanup; } LogMessage(X_INFO, "systemd-logind: took control of session %s\n", session); info->conn = connection; info->session = session; info->vt_active = info->active = TRUE; /* The server owns the vt during init */ session = NULL; cleanup: free(session); if (msg) dbus_message_unref(msg); if (reply) dbus_message_unref(reply); dbus_error_free(&error); } static void systemd_logind_release_control(struct systemd_logind_info *info) { DBusError error; DBusMessage *msg = NULL; DBusMessage *reply = NULL; dbus_error_init(&error); msg = dbus_message_new_method_call("org.freedesktop.login1", info->session, "org.freedesktop.login1.Session", "ReleaseControl"); if (!msg) { LogMessage(X_ERROR, "systemd-logind: out of memory\n"); goto cleanup; } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, DBUS_TIMEOUT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: ReleaseControl failed: %s\n", error.message); goto cleanup; } cleanup: if (msg) dbus_message_unref(msg); if (reply) dbus_message_unref(reply); dbus_error_free(&error); } static void disconnect_hook(void *data) { struct systemd_logind_info *info = data; free(info->session); info->session = NULL; info->conn = NULL; } static struct dbus_core_hook core_hook = { .connect = connect_hook, .disconnect = disconnect_hook, .data = &logind_info, }; int systemd_logind_init(void) { return dbus_core_add_hook(&core_hook); } void systemd_logind_fini(void) { if (logind_info.session) systemd_logind_release_control(&logind_info); dbus_core_remove_hook(&core_hook); } xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_kmod.c0000664000175100017510000000566612456571574020224 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include #include "xf86_OSlib.h" #include "xf86.h" #define MODPROBE_PATH_FILE "/proc/sys/kernel/modprobe" #define MAX_PATH 1024 #if 0 /* XFree86 #defines execl to be the xf86execl() function which does * a fork AND exec. We don't want that. We want the regular, * standard execl(). */ #ifdef execl #undef execl #endif #endif /* * Load a Linux kernel module. * This is used by the DRI/DRM to load a DRM kernel module when * the X server starts. It could be used for other purposes in the future. * Input: * modName - name of the kernel module (Ex: "tdfx") * Return: * 0 for failure, 1 for success */ int xf86LoadKernelModule(const char *modName) { char mpPath[MAX_PATH] = ""; int fd = -1, status; pid_t pid; /* get the path to the modprobe program */ fd = open(MODPROBE_PATH_FILE, O_RDONLY); if (fd >= 0) { int count = read(fd, mpPath, MAX_PATH - 1); if (count <= 0) { mpPath[0] = 0; } else if (mpPath[count - 1] == '\n') { mpPath[count - 1] = 0; /* replaces \n with \0 */ } close(fd); /* if this worked, mpPath will be "/sbin/modprobe" or similar. */ } if (mpPath[0] == 0) { /* we failed to get the path from the system, use a default */ strcpy(mpPath, "/sbin/modprobe"); } /* now fork/exec the modprobe command */ /* * It would be good to capture stdout/stderr so that it can be directed * to the log file. modprobe errors currently are missing from the log * file. */ switch (pid = fork()) { case 0: /* child */ /* change real/effective user ID to 0/0 as we need to * preinstall agpgart module for some DRM modules */ if (setreuid(0, 0)) { xf86Msg(X_WARNING, "LoadKernelModule: " "Setting of real/effective user Id to 0/0 failed"); } setenv("PATH", "/sbin", 1); execl(mpPath, "modprobe", modName, NULL); xf86Msg(X_WARNING, "LoadKernelModule %s\n", strerror(errno)); exit(EXIT_FAILURE); /* if we get here the child's exec failed */ break; case -1: /* fork failed */ return 0; default: /* fork worked */ { /* XXX we loop over waitpid() because it sometimes fails on * the first attempt. Don't know why! */ int count = 0, p; do { p = waitpid(pid, &status, 0); } while (p == -1 && count++ < 4); if (p == -1) { return 0; } if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { return 1; /* success! */ } else { return 0; } } } /* never get here */ return 0; } xorg-server-1.17.1/hw/xfree86/os-support/linux/Makefile.in0000664000175100017510000010201212466505433020261 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @LINUX_ALPHA_TRUE@am__append_1 = liblinuxev56.la @LNXACPI_TRUE@am__append_2 = -DHAVE_ACPI @LNXAPM_TRUE@am__append_3 = -DHAVE_APM @SYSTEMD_LOGIND_TRUE@am__append_4 = $(DBUS_CFLAGS) subdir = hw/xfree86/os-support/linux DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) @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 lnx_platform.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 systemd-logind.c @LNXACPI_TRUE@am__objects_1 = lnx_acpi.lo lnx_apm.lo @LNXAPM_TRUE@am__objects_2 = lnx_apm.lo @SYSTEMD_LOGIND_TRUE@am__objects_3 = systemd-logind.lo am_liblinux_la_OBJECTS = lnx_init.lo lnx_video.lo lnx_agp.lo \ lnx_kmod.lo lnx_bell.lo lnx_platform.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@) am__v_lt_0 = --silent am__v_lt_1 = liblinuxev56_la_LIBADD = am__liblinuxev56_la_SOURCES_DIST = lnx_ev56.c @LINUX_ALPHA_TRUE@am_liblinuxev56_la_OBJECTS = \ @LINUX_ALPHA_TRUE@ liblinuxev56_la-lnx_ev56.lo liblinuxev56_la_OBJECTS = $(am_liblinuxev56_la_OBJECTS) liblinuxev56_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(liblinuxev56_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ @LINUX_ALPHA_TRUE@am_liblinuxev56_la_rpath = 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 = $(liblinux_la_SOURCES) $(liblinuxev56_la_SOURCES) DIST_SOURCES = $(am__liblinux_la_SOURCES_DIST) \ $(am__liblinuxev56_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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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@ $(am__append_2) $(am__append_3) \ $(am__append_4) XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = liblinux.la $(am__append_1) @LINUX_ALPHA_TRUE@liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56 @LINUX_ALPHA_TRUE@liblinuxev56_la_SOURCES = lnx_ev56.c @LNXACPI_TRUE@ACPI_SRCS = lnx_acpi.c lnx_apm.c @LNXAPM_TRUE@APM_SRCS = lnx_apm.c @SYSTEMD_LOGIND_TRUE@LOGIND_SRCS = systemd-logind.c liblinux_la_SOURCES = lnx_init.c lnx_video.c \ lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigio.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ $(LOGIND_SRCS) AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) @LINUX_ALPHA_TRUE@liblinux_la_LIBADD = liblinuxev56.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/os-support/linux/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/linux/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } liblinux.la: $(liblinux_la_OBJECTS) $(liblinux_la_DEPENDENCIES) $(EXTRA_liblinux_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(liblinux_la_OBJECTS) $(liblinux_la_LIBADD) $(LIBS) liblinuxev56.la: $(liblinuxev56_la_OBJECTS) $(liblinuxev56_la_DEPENDENCIES) $(EXTRA_liblinuxev56_la_DEPENDENCIES) $(AM_V_CCLD)$(liblinuxev56_la_LINK) $(am_liblinuxev56_la_rpath) $(liblinuxev56_la_OBJECTS) $(liblinuxev56_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_usl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblinuxev56_la-lnx_ev56.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_acpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_agp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_apm.Plo@am__quote@ @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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systemd-logind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.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 -o $@ $< .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 -o $@ `$(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 $@ $< VTsw_usl.lo: $(srcdir)/../shared/VTsw_usl.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) $(AM_CFLAGS) $(CFLAGS) -MT VTsw_usl.lo -MD -MP -MF $(DEPDIR)/VTsw_usl.Tpo -c -o VTsw_usl.lo `test -f '$(srcdir)/../shared/VTsw_usl.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_usl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/VTsw_usl.Tpo $(DEPDIR)/VTsw_usl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/VTsw_usl.c' object='VTsw_usl.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) $(AM_CFLAGS) $(CFLAGS) -c -o VTsw_usl.lo `test -f '$(srcdir)/../shared/VTsw_usl.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_usl.c posix_tty.lo: $(srcdir)/../shared/posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -MT posix_tty.lo -MD -MP -MF $(DEPDIR)/posix_tty.Tpo -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/posix_tty.Tpo $(DEPDIR)/posix_tty.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/posix_tty.c' object='posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c vidmem.lo: $(srcdir)/../shared/vidmem.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) $(AM_CFLAGS) $(CFLAGS) -MT vidmem.lo -MD -MP -MF $(DEPDIR)/vidmem.Tpo -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vidmem.Tpo $(DEPDIR)/vidmem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/vidmem.c' object='vidmem.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) $(AM_CFLAGS) $(CFLAGS) -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c sigio.lo: $(srcdir)/../shared/sigio.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) $(AM_CFLAGS) $(CFLAGS) -MT sigio.lo -MD -MP -MF $(DEPDIR)/sigio.Tpo -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sigio.Tpo $(DEPDIR)/sigio.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/sigio.c' object='sigio.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) $(AM_CFLAGS) $(CFLAGS) -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c liblinuxev56_la-lnx_ev56.lo: lnx_ev56.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) $(liblinuxev56_la_CFLAGS) $(CFLAGS) -MT liblinuxev56_la-lnx_ev56.lo -MD -MP -MF $(DEPDIR)/liblinuxev56_la-lnx_ev56.Tpo -c -o liblinuxev56_la-lnx_ev56.lo `test -f 'lnx_ev56.c' || echo '$(srcdir)/'`lnx_ev56.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblinuxev56_la-lnx_ev56.Tpo $(DEPDIR)/liblinuxev56_la-lnx_ev56.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lnx_ev56.c' object='liblinuxev56_la-lnx_ev56.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) $(liblinuxev56_la_CFLAGS) $(CFLAGS) -c -o liblinuxev56_la-lnx_ev56.lo `test -f 'lnx_ev56.c' || echo '$(srcdir)/'`lnx_ev56.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_video.c0000664000175100017510000001245512406661137020360 00000000000000/* * Copyright 1992 by Orest Zborowski * Copyright 1993 by David Wexelblat * * 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 names of Orest Zborowski and David Wexelblat * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Orest Zborowski * and David Wexelblat make no representations about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. * * OREST ZBOROWSKI AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI 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. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include "input.h" #include "scrnintstr.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" static Bool ExtendedEnabled = FALSE; #ifdef __ia64__ #include "compiler.h" #include #elif !defined(__powerpc__) && \ !defined(__mc68000__) && \ !defined(__sparc__) && \ !defined(__mips__) && \ !defined(__nds32__) && \ !defined(__arm__) && \ !defined(__aarch64__) && \ !defined(__arc__) && \ !defined(__xtensa__) /* * Due to conflicts with "compiler.h", don't rely on to declare * these. */ extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on); extern int iopl(int __level); #endif /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; } /***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ #if defined(__powerpc__) volatile unsigned char *ioBase = NULL; #ifndef __NR_pciconfig_iobase #define __NR_pciconfig_iobase 200 #endif static Bool hwEnableIO(void) { int fd; 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); } close(fd); 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)) { ErrorF("xf86EnableIOPorts: failed to set IOPL for I/O (%s)\n", strerror(errno)); return FALSE; } #if !defined(__alpha__) /* XXX: this is actually not trapping anything because of iopl(3) * above */ ioperm(0x40, 4, 0); /* trap access to the timer chip */ ioperm(0x60, 4, 0); /* trap access to the keyboard controller */ #endif 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; hwDisableIO(); ExtendedEnabled = FALSE; } #if defined (__alpha__) extern int readDense8(void *Base, register unsigned long Offset); extern int readDense16(void *Base, register unsigned long Offset); extern int readDense32(void *Base, register unsigned long Offset); extern void writeDense8(int Value, void *Base, register unsigned long Offset); extern void writeDense16(int Value, void *Base, register unsigned long Offset); extern void writeDense32(int Value, void *Base, register unsigned long Offset); void (*xf86WriteMmio8) (int Value, void *Base, unsigned long Offset) = writeDense8; void (*xf86WriteMmio16) (int Value, void *Base, unsigned long Offset) = writeDense16; void (*xf86WriteMmio32) (int Value, void *Base, unsigned long Offset) = writeDense32; int (*xf86ReadMmio8) (void *Base, unsigned long Offset) = readDense8; int (*xf86ReadMmio16) (void *Base, unsigned long Offset) = readDense16; int (*xf86ReadMmio32) (void *Base, unsigned long Offset) = readDense32; #endif /* __alpha__ */ xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_bell.c0000664000175100017510000000316612366220413020160 00000000000000/* * Copyright © 2006 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 #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSproc.h" void xf86OSRingBell(int loudness, int pitch, int duration) { if (xf86Info.consoleFd == -1 || !pitch || !loudness) return; ioctl(xf86Info.consoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | (((unsigned long) duration * loudness / 50) << 16)); } xorg-server-1.17.1/hw/xfree86/os-support/linux/int10/0000775000175100017510000000000012466505444017235 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/linux/int10/vm86/0000775000175100017510000000000012466505444020035 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c0000664000175100017510000002174612366220413022137 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" #include "compiler.h" #define _INT10_PRIVATE #include "xf86int10.h" #define REG pInt #ifdef _VM86_LINUX #include "int10Defines.h" static int vm86_rep(struct vm86_struct *ptr); static struct vm86_struct vm86_s; Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt) { #define VM86S ((struct vm86_struct *)pInt->cpuRegs) pInt->cpuRegs = &vm86_s; VM86S->flags = 0; VM86S->screen_bitmap = 0; VM86S->cpu_type = CPU_586; memset(&VM86S->int_revectored, 0xff, sizeof(VM86S->int_revectored)); memset(&VM86S->int21_revectored, 0xff, sizeof(VM86S->int21_revectored)); return TRUE; } /* get the linear address */ #define LIN_PREF_SI ((pref_seg << 4) + X86_SI) #define LWECX ((prefix66 ^ prefix67) ? X86_ECX : X86_CX) #define LWECX_ZERO {if (prefix66 ^ prefix67) X86_ECX = 0; else X86_CX = 0;} #define DF (1 << 10) /* vm86 fault handling */ static Bool vm86_GP_fault(xf86Int10InfoPtr pInt) { unsigned char *csp, *lina; CARD32 org_eip; int pref_seg; int done, is_rep, prefix66, prefix67; csp = lina = SEG_ADR((unsigned char *), X86_CS, IP); is_rep = 0; prefix66 = prefix67 = 0; pref_seg = -1; /* eat up prefixes */ done = 0; do { switch (MEM_RB(pInt, (int) csp++)) { case 0x66: /* operand prefix */ prefix66 = 1; break; case 0x67: /* address prefix */ prefix67 = 1; break; case 0x2e: /* CS */ pref_seg = X86_CS; break; case 0x3e: /* DS */ pref_seg = X86_DS; break; case 0x26: /* ES */ pref_seg = X86_ES; break; case 0x36: /* SS */ pref_seg = X86_SS; break; case 0x65: /* GS */ pref_seg = X86_GS; break; case 0x64: /* FS */ pref_seg = X86_FS; break; case 0xf0: /* lock */ break; case 0xf2: /* repnz */ case 0xf3: /* rep */ is_rep = 1; break; default: done = 1; } } while (!done); csp--; /* oops one too many */ org_eip = X86_EIP; X86_IP += (csp - lina); switch (MEM_RB(pInt, (int) csp)) { case 0x6c: /* insb */ /* NOTE: ES can't be overwritten; prefixes 66,67 should use esi,edi,ecx * but is anyone using extended regs in real mode? */ /* WARNING: no test for DI wrapping! */ X86_EDI += port_rep_inb(pInt, X86_DX, SEG_EADR((CARD32), X86_ES, DI), X86_FLAGS & DF, is_rep ? LWECX : 1); if (is_rep) LWECX_ZERO; X86_IP++; break; case 0x6d: /* (rep) insw / insd */ /* NOTE: ES can't be overwritten */ /* WARNING: no test for _DI wrapping! */ if (prefix66) { X86_DI += port_rep_inl(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI), X86_EFLAGS & DF, is_rep ? LWECX : 1); } else { X86_DI += port_rep_inw(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI), X86_FLAGS & DF, is_rep ? LWECX : 1); } if (is_rep) LWECX_ZERO; X86_IP++; break; case 0x6e: /* (rep) outsb */ if (pref_seg < 0) pref_seg = X86_DS; /* WARNING: no test for _SI wrapping! */ X86_SI += port_rep_outb(pInt, X86_DX, (CARD32) LIN_PREF_SI, X86_FLAGS & DF, is_rep ? LWECX : 1); if (is_rep) LWECX_ZERO; X86_IP++; break; case 0x6f: /* (rep) outsw / outsd */ if (pref_seg < 0) pref_seg = X86_DS; /* WARNING: no test for _SI wrapping! */ if (prefix66) { X86_SI += port_rep_outl(pInt, X86_DX, (CARD32) LIN_PREF_SI, X86_EFLAGS & DF, is_rep ? LWECX : 1); } else { X86_SI += port_rep_outw(pInt, X86_DX, (CARD32) LIN_PREF_SI, X86_FLAGS & DF, is_rep ? LWECX : 1); } if (is_rep) LWECX_ZERO; X86_IP++; break; case 0xe5: /* inw xx, inl xx */ if (prefix66) X86_EAX = x_inl(csp[1]); else X86_AX = x_inw(csp[1]); X86_IP += 2; break; case 0xe4: /* inb xx */ X86_AL = x_inb(csp[1]); X86_IP += 2; break; case 0xed: /* inw dx, inl dx */ if (prefix66) X86_EAX = x_inl(X86_DX); else X86_AX = x_inw(X86_DX); X86_IP += 1; break; case 0xec: /* inb dx */ X86_AL = x_inb(X86_DX); X86_IP += 1; break; case 0xe7: /* outw xx */ if (prefix66) x_outl(csp[1], X86_EAX); else x_outw(csp[1], X86_AX); X86_IP += 2; break; case 0xe6: /* outb xx */ x_outb(csp[1], X86_AL); X86_IP += 2; break; case 0xef: /* outw dx */ if (prefix66) x_outl(X86_DX, X86_EAX); else x_outw(X86_DX, X86_AX); X86_IP += 1; break; case 0xee: /* outb dx */ x_outb(X86_DX, X86_AL); X86_IP += 1; break; case 0xf4: DebugF("hlt at %p\n", lina); return FALSE; case 0x0f: 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->pScrn->scrnIndex, X_ERROR, "unknown reason for exception\n"); op0ferr: dump_registers(pInt); stack_trace(pInt); dump_code(pInt); xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "cannot continue\n"); return FALSE; } /* end of switch() */ return TRUE; } static int do_vm86(xf86Int10InfoPtr pInt) { int retval, signo; xf86InterceptSignals(&signo); retval = vm86_rep(VM86S); xf86InterceptSignals(NULL); if (signo >= 0) { xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86() syscall generated signal %d.\n", signo); dump_registers(pInt); dump_code(pInt); stack_trace(pInt); return 0; } switch (VM86_TYPE(retval)) { case VM86_UNKNOWN: if (!vm86_GP_fault(pInt)) return 0; break; case VM86_STI: xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86_sti :-((\n"); dump_registers(pInt); dump_code(pInt); stack_trace(pInt); return 0; case VM86_INTx: pInt->num = VM86_ARG(retval); if (!int_handler(pInt)) { xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval)); dump_registers(pInt); dump_code(pInt); stack_trace(pInt); return 0; } /* I'm not sure yet what to do if we can handle ints */ break; case VM86_SIGNAL: return 1; /* * 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->pScrn->scrnIndex, X_WARNING, "received signal\n"); return 0; default: 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); stack_trace(pInt); return 0; } return 1; } void xf86ExecX86int10(xf86Int10InfoPtr pInt) { int sig = setup_int(pInt); if (int_handler(pInt)) while (do_vm86(pInt)) { }; finish_int(pInt, sig); } static int vm86_rep(struct vm86_struct *ptr) { int __res; #ifdef __PIC__ /* When compiling with -fPIC, we can't use asm constraint "b" because %ebx is already taken by gcc. */ __asm__ __volatile__("pushl %%ebx\n\t" "push %%gs\n\t" "movl %2,%%ebx\n\t" "movl %1,%%eax\n\t" "int $0x80\n\t" "pop %%gs\n\t" "popl %%ebx":"=a"(__res) :"n"((int) 113), "r"((struct vm86_struct *) ptr)); #else __asm__ __volatile__("push %%gs\n\t" "int $0x80\n\t" "pop %%gs":"=a"(__res):"a"((int) 113), "b"((struct vm86_struct *) ptr)); #endif if (__res < 0) { errno = -__res; __res = -1; } else errno = 0; return __res; } #endif xorg-server-1.17.1/hw/xfree86/os-support/linux/int10/linux.c0000664000175100017510000003742012406661137020462 00000000000000/* * linux specific part of the int10 module * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2008 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" #include "compiler.h" #define _INT10_PRIVATE #include "xf86int10.h" #ifdef __sparc__ #define DEV_MEM "/dev/fb" #else #define DEV_MEM "/dev/mem" #endif #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1) #define SHMERRORPTR (void *)(-1) #include #include #include #include #include #include #include static int counter = 0; static unsigned long int10Generation = 0; static CARD8 read_b(xf86Int10InfoPtr pInt, int addr); static CARD16 read_w(xf86Int10InfoPtr pInt, int addr); static CARD32 read_l(xf86Int10InfoPtr pInt, int addr); static void write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val); static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val); static void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val); int10MemRec linuxMem = { read_b, read_w, read_l, write_b, write_w, write_l }; typedef struct { int lowMem; int highMem; char *base; char *base_high; char *alloc; } linuxInt10Priv; #if defined DoSubModules typedef enum { INT10_NOT_LOADED, INT10_LOADED_VM86, INT10_LOADED_X86EMU, INT10_LOAD_FAILED } Int10LinuxSubModuleState; static Int10LinuxSubModuleState loadedSubModule = INT10_NOT_LOADED; static Int10LinuxSubModuleState int10LinuxLoadSubModule(ScrnInfoPtr pScrn); #endif /* DoSubModules */ static Bool readLegacy(struct pci_device *dev, unsigned char *buf, int base, int len) { void *map; if (!pci_device_map_legacy(dev, base, len, 0, &map)) return FALSE; memcpy(buf, map, len); pci_device_unmap_legacy(dev, man, len); return TRUE; } xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags) { xf86Int10InfoPtr pInt = NULL; int screen; int fd; static void *vidMem = NULL; static void *sysMem = NULL; void *vMem = NULL; void *options = NULL; int low_mem; int high_mem = -1; char *base = SHMERRORPTR; char *base_high = SHMERRORPTR; int pagesize; memType cs; legacyVGARec vga; Bool videoBiosMapped = FALSE; ScrnInfoPtr pScrn; if (int10Generation != serverGeneration) { counter = 0; int10Generation = serverGeneration; } pScrn = xf86FindScreenForEntity(entityIndex); screen = pScrn->scrnIndex; options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); return NULL; } #if defined DoSubModules if (loadedSubModule == INT10_NOT_LOADED) loadedSubModule = int10LinuxLoadSubModule(pScrn); if (loadedSubModule == INT10_LOAD_FAILED) return NULL; #endif if ((!vidMem) || (!sysMem)) { if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) { if (!sysMem) { DebugF("Mapping sys bios area\n"); if ((sysMem = mmap((void *) (SYS_BIOS), BIOS_SIZE, PROT_READ | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, SYS_BIOS)) == MAP_FAILED) { xf86DrvMsg(screen, X_ERROR, "Cannot map SYS BIOS\n"); close(fd); goto error0; } } if (!vidMem) { DebugF("Mapping VRAM area\n"); if ((vidMem = mmap((void *) (V_RAM), VRAM_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, V_RAM)) == MAP_FAILED) { xf86DrvMsg(screen, X_ERROR, "Cannot map V_RAM\n"); close(fd); goto error0; } } close(fd); } else { xf86DrvMsg(screen, X_ERROR, "Cannot open %s\n", DEV_MEM); goto error0; } } pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec)); pInt->pScrn = pScrn; pInt->entityIndex = entityIndex; pInt->dev = xf86GetPciInfoForEntity(entityIndex); if (!xf86Int10ExecSetup(pInt)) goto error0; pInt->mem = &linuxMem; pagesize = getpagesize(); pInt->private = (void *) xnfcalloc(1, sizeof(linuxInt10Priv)); ((linuxInt10Priv *) pInt->private)->alloc = (void *) xnfcalloc(1, ALLOC_ENTRIES(pagesize)); if (!xf86IsEntityPrimary(entityIndex)) { DebugF("Mapping high memory area\n"); if ((high_mem = shmget(counter++, HIGH_MEM_SIZE, IPC_CREAT | SHM_R | SHM_W)) == -1) { if (errno == ENOSYS) xf86DrvMsg(screen, X_ERROR, "shmget error\n Please reconfigure" " your kernel to include System V IPC support\n"); else xf86DrvMsg(screen, X_ERROR, "shmget(highmem) error: %s\n", strerror(errno)); goto error1; } } else { DebugF("Mapping Video BIOS\n"); videoBiosMapped = TRUE; if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) { if ((vMem = mmap((void *) (V_BIOS), SYS_BIOS - V_BIOS, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, V_BIOS)) == MAP_FAILED) { xf86DrvMsg(screen, X_ERROR, "Cannot map V_BIOS\n"); close(fd); goto error1; } close(fd); } else goto error1; } ((linuxInt10Priv *) pInt->private)->highMem = high_mem; DebugF("Mapping 640kB area\n"); if ((low_mem = shmget(counter++, V_RAM, IPC_CREAT | SHM_R | SHM_W)) == -1) { xf86DrvMsg(screen, X_ERROR, "shmget(lowmem) error: %s\n", strerror(errno)); goto error2; } ((linuxInt10Priv *) pInt->private)->lowMem = low_mem; base = shmat(low_mem, 0, 0); if (base == SHMERRORPTR) { xf86DrvMsg(screen, X_ERROR, "shmat(low_mem) error: %s\n", strerror(errno)); goto error3; } ((linuxInt10Priv *) pInt->private)->base = base; if (high_mem > -1) { base_high = shmat(high_mem, 0, 0); if (base_high == SHMERRORPTR) { xf86DrvMsg(screen, X_ERROR, "shmat(high_mem) error: %s\n", strerror(errno)); goto error3; } ((linuxInt10Priv *) pInt->private)->base_high = base_high; } else ((linuxInt10Priv *) pInt->private)->base_high = NULL; if (!MapCurrentInt10(pInt)) goto error3; Int10Current = pInt; DebugF("Mapping int area\n"); /* note: yes, we really are writing the 0 page here */ if (!readLegacy(pInt->dev, (unsigned char *) 0, 0, LOW_PAGE_SIZE)) { xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n"); goto error3; } DebugF("done\n"); /* * Read in everything between V_BIOS and SYS_BIOS as some system BIOSes * have executable code there. Note that xf86ReadBIOS() can only bring in * 64K bytes at a time. */ if (!videoBiosMapped) { memset((void *) V_BIOS, 0, SYS_BIOS - V_BIOS); DebugF("Reading BIOS\n"); for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE) if (!readLegacy(pInt->dev, (void *)cs, cs, V_BIOS_SIZE)) xf86DrvMsg(screen, X_WARNING, "Unable to retrieve all of segment 0x%06lX.\n", (long) cs); DebugF("done\n"); } if (xf86IsEntityPrimary(entityIndex) && !(initPrimary(options))) { if (!xf86int10GetBiosSegment(pInt, NULL)) goto error3; set_return_trap(pInt); #ifdef _PC pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH); if (!(pInt->Flags & SET_BIOS_SCRATCH)) pInt->Flags &= ~RESTORE_BIOS_SCRATCH; xf86Int10SaveRestoreBIOSVars(pInt, TRUE); #endif } else { const BusType location_type = xf86int10GetBiosLocationType(pInt); switch (location_type) { case BUS_PCI:{ int err; struct pci_device *rom_device = xf86GetPciInfoForEntity(pInt->entityIndex); pci_device_enable(rom_device); err = pci_device_read_rom(rom_device, (unsigned char *) (V_BIOS)); if (err) { xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (%s)\n", strerror(err)); goto error3; } pInt->BIOSseg = V_BIOS >> 4; break; } default: goto error3; } pInt->num = 0xe6; reset_int_vect(pInt); set_return_trap(pInt); LockLegacyVGA(pInt, &vga); xf86ExecX86int10(pInt); UnlockLegacyVGA(pInt, &vga); } #ifdef DEBUG dprint(0xc0000, 0x20); #endif free(options); return pInt; error3: if (base_high) shmdt(base_high); shmdt(base); shmdt(0); if (base_high) shmdt((char *) HIGH_MEM); shmctl(low_mem, IPC_RMID, NULL); Int10Current = NULL; error2: if (high_mem > -1) shmctl(high_mem, IPC_RMID, NULL); error1: if (vMem) munmap(vMem, SYS_BIOS - V_BIOS); free(((linuxInt10Priv *) pInt->private)->alloc); free(pInt->private); error0: free(options); free(pInt); return NULL; } Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { void *addr; int fd = -1; if (Int10Current) { shmdt(0); if (((linuxInt10Priv *) Int10Current->private)->highMem >= 0) shmdt((char *) HIGH_MEM); else munmap((void *) V_BIOS, (SYS_BIOS - V_BIOS)); } addr = shmat(((linuxInt10Priv *) pInt->private)->lowMem, (char *) 1, SHM_RND); if (addr == SHMERRORPTR) { 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->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->pScrn->scrnIndex, X_ERROR, "Cannot shmat() high memory\n"); 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->pScrn->scrnIndex, X_ERROR, "Cannot set EXEC bit on high memory: %s\n", strerror(errno)); } else { if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) { if (mmap((void *) (V_BIOS), SYS_BIOS - V_BIOS, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, V_BIOS) == MAP_FAILED) { xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot map V_BIOS\n"); close(fd); return FALSE; } } else { xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM); return FALSE; } close(fd); } return TRUE; } void xf86FreeInt10(xf86Int10InfoPtr pInt) { if (!pInt) return; #ifdef _PC xf86Int10SaveRestoreBIOSVars(pInt, FALSE); #endif if (Int10Current == pInt) { shmdt(0); if (((linuxInt10Priv *) pInt->private)->highMem >= 0) shmdt((char *) HIGH_MEM); else munmap((void *) V_BIOS, (SYS_BIOS - V_BIOS)); Int10Current = NULL; } if (((linuxInt10Priv *) pInt->private)->base_high) shmdt(((linuxInt10Priv *) pInt->private)->base_high); shmdt(((linuxInt10Priv *) pInt->private)->base); shmctl(((linuxInt10Priv *) pInt->private)->lowMem, IPC_RMID, NULL); if (((linuxInt10Priv *) pInt->private)->highMem >= 0) shmctl(((linuxInt10Priv *) pInt->private)->highMem, IPC_RMID, NULL); free(((linuxInt10Priv *) pInt->private)->alloc); free(pInt->private); free(pInt); } void * xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off) { int pagesize = getpagesize(); int num_pages = ALLOC_ENTRIES(pagesize); int i, j; for (i = 0; i < (num_pages - num); i++) { if (((linuxInt10Priv *) pInt->private)->alloc[i] == 0) { for (j = i; j < (num + i); j++) if ((((linuxInt10Priv *) pInt->private)->alloc[j] != 0)) break; if (j == (num + i)) break; else i = i + num; } } if (i == (num_pages - num)) return NULL; for (j = i; j < (i + num); j++) ((linuxInt10Priv *) pInt->private)->alloc[j] = 1; *off = (i + 1) * pagesize; return ((linuxInt10Priv *) pInt->private)->base + ((i + 1) * pagesize); } void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num) { int pagesize = getpagesize(); int first = (((unsigned long) pbase - (unsigned long) ((linuxInt10Priv *) pInt->private)->base) / pagesize) - 1; int i; for (i = first; i < (first + num); i++) ((linuxInt10Priv *) pInt->private)->alloc[i] = 0; } static CARD8 read_b(xf86Int10InfoPtr pInt, int addr) { return *((CARD8 *) (memType) addr); } static CARD16 read_w(xf86Int10InfoPtr pInt, int addr) { return *((CARD16 *) (memType) addr); } static CARD32 read_l(xf86Int10InfoPtr pInt, int addr) { return *((CARD32 *) (memType) addr); } static void write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val) { *((CARD8 *) (memType) addr) = val; } static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val) { *((CARD16 *) (memType) addr) = val; } static void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val) { *((CARD32 *) (memType) addr) = val; } void * xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr) { if (addr < V_RAM) return ((linuxInt10Priv *) pInt->private)->base + addr; else if (addr < V_BIOS) return (void *) (memType) addr; else if (addr < SYS_BIOS) { if (((linuxInt10Priv *) pInt->private)->base_high) return (void *) (((linuxInt10Priv *) pInt->private)->base_high - V_BIOS + addr); else return (void *) (memType) addr; } else return (void *) (memType) addr; } #if defined DoSubModules static Bool vm86_tst(void) { int __res; #ifdef __PIC__ /* When compiling with -fPIC, we can't use asm constraint "b" because %ebx is already taken by gcc. */ __asm__ __volatile__("pushl %%ebx\n\t" "movl %2,%%ebx\n\t" "movl %1,%%eax\n\t" "int $0x80\n\t" "popl %%ebx":"=a"(__res) :"n"((int) 113), "r"(NULL)); #else __asm__ __volatile__("int $0x80\n\t":"=a"(__res):"a"((int) 113), "b"((struct vm86_struct *) NULL)); #endif if (__res < 0 && __res == -ENOSYS) return FALSE; return TRUE; } static Int10LinuxSubModuleState int10LinuxLoadSubModule(ScrnInfoPtr pScrn) { if (vm86_tst()) { if (xf86LoadSubModule(pScrn, "vm86")) return INT10_LOADED_VM86; } if (xf86LoadSubModule(pScrn, "x86emu")) return INT10_LOADED_X86EMU; return INT10_LOAD_FAILED; } #endif /* DoSubModules */ xorg-server-1.17.1/hw/xfree86/os-support/linux/lnx_init.c0000664000175100017510000002627012406737373020223 00000000000000/* * Copyright 1992 by Orest Zborowski * Copyright 1993 by David Wexelblat * * 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 names of Orest Zborowski and David Wexelblat * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Orest Zborowski * and David Wexelblat make no representations about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. * * OREST ZBOROWSKI AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI 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. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "compiler.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include #ifndef K_OFF #define K_OFF 0x4 #endif #ifndef KDSKBMUTE #define KDSKBMUTE 0x4B51 #endif static Bool KeepTty = FALSE; static int activeVT = -1; static char vtname[11]; static struct termios tty_attr; /* tty state to restore */ static int tty_mode; /* kbd mode to restore */ static void drain_console(int fd, void *closure) { errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } } static void switch_to(int vt, const char *from) { int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); if (ret < 0) FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno)); SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" void xf86OpenConsole(void) { int i, fd = -1, ret, current_vt = -1; struct vt_mode VT; struct vt_stat vts; struct stat st; MessageType from = X_PROBED; const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL }; const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL }; if (serverGeneration == 1) { /* * setup the virtual terminal manager */ if (xf86Info.vtno != -1) { from = X_CMDLINE; } else { i = 0; while (tty0[i] != NULL) { if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0) break; i++; } if (fd < 0) FatalError("xf86OpenConsole: Cannot open /dev/tty0 (%s)\n", strerror(errno)); if (xf86Info.ShareVTs) { SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts)); if (ret < 0) FatalError("xf86OpenConsole: Cannot find the current" " VT (%s)\n", strerror(errno)); xf86Info.vtno = vts.v_active; } else { SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno)); if (ret < 0) FatalError("xf86OpenConsole: Cannot find a free VT: " "%s\n", strerror(errno)); if (xf86Info.vtno == -1) FatalError("xf86OpenConsole: Cannot find a free VT\n"); } close(fd); } xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno); /* Some of stdin / stdout / stderr maybe redirected to a file */ for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) { ret = fstat(i, &st); if (ret == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) { current_vt = minor(st.st_rdev); break; } } if (!KeepTty && current_vt == xf86Info.vtno) { xf86Msg(X_PROBED, "controlling tty is VT number %d, auto-enabling KeepTty\n", current_vt); KeepTty = TRUE; } if (!KeepTty) { pid_t ppid = getppid(); pid_t ppgid; ppgid = getpgid(ppid); /* * change to parent process group that pgid != pid so * that setsid() doesn't fail and we become process * group leader */ if (setpgid(0, ppgid) < 0) xf86Msg(X_WARNING, "xf86OpenConsole: setpgid failed: %s\n", strerror(errno)); /* become process group leader */ if ((setsid() < 0)) xf86Msg(X_WARNING, "xf86OpenConsole: setsid failed: %s\n", strerror(errno)); } i = 0; while (vcs[i] != NULL) { snprintf(vtname, sizeof(vtname), vcs[i], xf86Info.vtno); /* /dev/tty1-64 */ if ((xf86Info.consoleFd = open(vtname, O_RDWR | O_NDELAY, 0)) >= 0) break; i++; } if (xf86Info.consoleFd < 0) FatalError("xf86OpenConsole: Cannot open virtual console" " %d (%s)\n", xf86Info.vtno, strerror(errno)); /* * Linux doesn't switch to an active vt after the last close of a vt, * so we do this ourselves by remembering which is active now. */ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts)); if (ret < 0) xf86Msg(X_WARNING, "xf86OpenConsole: VT_GETSTATE failed: %s\n", strerror(errno)); else activeVT = vts.v_active; #if 0 if (!KeepTty) { /* * Detach from the controlling tty to avoid char loss */ if ((i = open("/dev/tty", O_RDWR)) >= 0) { SYSCALL(ioctl(i, TIOCNOTTY, 0)); close(i); } } #endif if (!xf86Info.ShareVTs) { struct termios nTty; /* * now get the VT. This _must_ succeed, or else fail completely. */ switch_to(xf86Info.vtno, "xf86OpenConsole"); SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); if (ret < 0) FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", strerror(errno)); signal(SIGUSR1, xf86VTRequest); VT.mode = VT_PROCESS; VT.relsig = SIGUSR1; VT.acqsig = SIGUSR1; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT)); if (ret < 0) FatalError ("xf86OpenConsole: VT_SETMODE VT_PROCESS failed: %s\n", strerror(errno)); SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS)); if (ret < 0) FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n", strerror(errno)); tcgetattr(xf86Info.consoleFd, &tty_attr); SYSCALL(ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode)); /* disable kernel special keys and buffering, new style */ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMUTE, 1)); if (ret < 0) { /* disable kernel special keys and buffering, old style */ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_OFF)); if (ret < 0) { /* 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)); /* ... and drain events, else the kernel gets angry */ xf86SetConsoleHandler(drain_console, NULL); } } nTty = tty_attr; nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); nTty.c_oflag = 0; nTty.c_cflag = CREAD | CS8; nTty.c_lflag = 0; nTty.c_cc[VTIME] = 0; nTty.c_cc[VMIN] = 1; cfsetispeed(&nTty, 9600); cfsetospeed(&nTty, 9600); tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty); } } else { /* serverGeneration != 1 */ if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch) { /* now get the VT */ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } } #pragma GCC diagnostic pop void xf86CloseConsole(void) { struct vt_mode VT; int ret; if (xf86Info.ShareVTs) { close(xf86Info.consoleFd); return; } /* * unregister the drain_console handler * - what to do if someone else changed it in the meantime? */ xf86SetConsoleHandler(NULL, NULL); /* Back to text mode ... */ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT)); if (ret < 0) 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); SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); if (ret < 0) xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n", strerror(errno)); else { /* set dflt vt handling */ VT.mode = VT_AUTO; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT)); if (ret < 0) xf86Msg(X_WARNING, "xf86CloseConsole: VT_SETMODE failed: %s\n", strerror(errno)); } if (xf86Info.autoVTSwitch) { /* * Perform a switch back to the active VT when we were started */ if (activeVT >= 0) { switch_to(activeVT, "xf86CloseConsole"); activeVT = -1; } } close(xf86Info.consoleFd); /* make the vt-manager happy */ } int xf86ProcessArgument(int argc, char *argv[], int i) { /* * Keep server from detaching from controlling tty. This is useful * when debugging (so the server can receive keyboard signals. */ if (!strcmp(argv[i], "-keeptty")) { KeepTty = TRUE; return 1; } if ((argv[i][0] == 'v') && (argv[i][1] == 't')) { if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0) { UseMsg(); xf86Info.vtno = -1; return 0; } return 1; } return 0; } void xf86UseMsg(void) { ErrorF("vtXX use the specified VT number\n"); ErrorF("-keeptty "); ErrorF("don't detach controlling tty (for debugging only)\n"); } xorg-server-1.17.1/hw/xfree86/os-support/xf86_OSlib.h0000664000175100017510000002764412456571574017142 00000000000000/* * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany * Copyright 1992 by David Dawes * Copyright 1992 by Jim Tsillas * Copyright 1992 by Rich Murphey * Copyright 1992 by Robert Baron * Copyright 1992 by Orest Zborowski * Copyright 1993 by Vrije Universiteit, The Netherlands * Copyright 1993 by David Wexelblat * Copyright 1994, 1996 by Holger Veit * Copyright 1997 by Takis Psarogiannakopoulos * Copyright 1994-2003 by 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 names of the above listed copyright holders * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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. * */ /* * The ARM32 code here carries the following copyright: * * Copyright 1997 * Digital Equipment Corporation. All rights reserved. * This software is furnished under license and may be used and copied only in * accordance with the following terms and conditions. Subject to these * conditions, you may download, copy, install, use, modify and distribute * this software in source and/or binary form. No title or ownership is * transferred hereby. * * 1) Any source code used, modified or distributed must reproduce and retain * this copyright notice and list of conditions as they appear in the * source file. * * 2) No right is granted to use any trade name, trademark, or logo of Digital * Equipment Corporation. Neither the "Digital Equipment Corporation" * name nor any trademark or logo of Digital Equipment Corporation may be * used to endorse or promote products derived from this software without * the prior written permission of Digital Equipment Corporation. * * 3) This software is provided "AS-IS" and any express or implied warranties, * including but not limited to, any implied warranties of merchantability, * fitness for a particular purpose, or non-infringement are disclaimed. * In no event shall DIGITAL be liable for any damages whatsoever, and in * particular, DIGITAL shall not be liable for special, indirect, * consequential, or incidental damages or damages for lost profits, loss * of revenue or loss of use, whether such damages arise in contract, * negligence, tort, under statute, in equity, at law or otherwise, even * if advised of the possibility of such damage. * */ /* * This is private, and should not be included by any drivers. Drivers * may include xf86_OSproc.h to get prototypes for public interfaces. */ #ifndef _XF86_OSLIB_H #define _XF86_OSLIB_H #include #include #include #include #include /**************************************************************************/ /* SYSV386 (SVR3, SVR4), including Solaris */ /**************************************************************************/ #if (defined(SYSV) || defined(SVR4)) && \ (defined(sun) || defined(__i386__)) #include #include #include #include #include #include #if defined(_NEED_SYSI86) #if !(defined (sun) && defined (SVR4)) #include #include #include #endif #include #include #if defined(SVR4) && !defined(sun) #include #endif /* SVR4 && !sun */ /* V86SC_IOPL was moved to on Solaris 7 and later */ #if !defined(V86SC_IOPL) /* Solaris 7 or later? */ #include /* Nope */ #endif #if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) #include #endif #endif /* _NEED_SYSI86 */ #if defined(HAS_SVR3_MMAPDRV) #include #if !defined(_NEED_SYSI86) #include #include #endif #include /* MMAP driver header */ #endif #if !defined(sun) || defined(HAVE_SYS_VT_H) #define HAS_USL_VTS #endif #if !defined(sun) #include #endif #if defined(HAS_USL_VTS) #if !defined(sun) #include #endif #include #include extern _X_HIDDEN void xf86VTAcquire(int); extern _X_HIDDEN void xf86VTRelease(int); #endif #if defined(sun) #include extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; #include #include /* undefine symbols from we don't need that conflict with enum definitions in parser/xf86tokens.h */ #undef STRING #undef LEFTALT #undef RIGHTALT #define LED_CAP LED_CAPS_LOCK #define LED_NUM LED_NUM_LOCK #define LED_SCR LED_SCROLL_LOCK #define LED_COMP LED_COMPOSE #endif /* sun */ #if !defined(VT_ACKACQ) #define VT_ACKACQ 2 #endif /* !VT_ACKACQ */ #if defined(SVR4) #include #if !(defined(sun) && defined (SVR4)) #define DEV_MEM "/dev/pmem" #endif #define CLEARDTR_SUPPORT #define POSIX_TTY #endif /* SVR4 */ #endif /* (SYSV || SVR4) */ /**************************************************************************/ /* Linux or Glibc-based system */ /**************************************************************************/ #if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__) #include #include #include #include #include #ifdef __linux__ #include #else /* __GLIBC__ */ #include #endif #ifdef __sparc__ #include #endif #include #include #include #ifdef __linux__ #define HAS_USL_VTS #include #include #define LDGMAP GIO_SCRNMAP #define LDSMAP PIO_SCRNMAP #define LDNMAP LDSMAP #define CLEARDTR_SUPPORT #endif #define POSIX_TTY #endif /* __linux__ || __GLIBC__ */ /**************************************************************************/ /* 386BSD and derivatives, BSD/386 */ /**************************************************************************/ #if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__)) #undef __386BSD__ #endif #ifdef CSRG_BASED #include #include #include #define termio termios #define POSIX_TTY #include #include #include #include #endif /* CSRG_BASED */ /**************************************************************************/ /* Kernel of *BSD */ /**************************************************************************/ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) #include #if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version) #define __FreeBSD_kernel_version __FreeBSD_version #endif #if !defined(LINKKIT) /* Don't need this stuff for the Link Kit */ #ifdef SYSCONS_SUPPORT #define COMPAT_SYSCONS #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000) #include #include #else #include #endif /* FreeBSD 4.1 RELEASE or lator */ #else #include #endif #endif /* SYSCONS_SUPPORT */ #if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__) #if !defined(SYSCONS_SUPPORT) /* no syscons, so include pcvt specific header file */ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #else #include #endif /* __FreeBSD_kernel__ */ #else /* pcvt and syscons: hard-code the ID magic */ #define VGAPCVTID _IOWR('V',113, struct pcvtid) struct pcvtid { char name[16]; int rmajor, rminor; }; #endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */ #endif /* PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT #include #include #endif /* WSCONS_SUPPORT */ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #include #endif /* Include these definitions in case ioctl_pc.h didn't get included */ #ifndef CONSOLE_X_MODE_ON #define CONSOLE_X_MODE_ON _IO('t',121) #endif #ifndef CONSOLE_X_MODE_OFF #define CONSOLE_X_MODE_OFF _IO('t',122) #endif #ifndef CONSOLE_X_BELL #define CONSOLE_X_BELL _IOW('t',123,int[2]) #endif #ifndef CONSOLE_X_TV_ON #define CONSOLE_X_TV_ON _IOW('t',155,int) #define XMODE_RGB 0 #define XMODE_NTSC 1 #define XMODE_PAL 2 #define XMODE_SECAM 3 #endif #ifndef CONSOLE_X_TV_OFF #define CONSOLE_X_TV_OFF _IO('t',156) #endif #ifndef CONSOLE_GET_LINEAR_INFO #define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info) #endif #ifndef CONSOLE_GET_IO_INFO #define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info) #endif #ifndef CONSOLE_GET_MEM_INFO #define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info) #endif #endif /* !LINKKIT */ #if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL) #include #endif #define CLEARDTR_SUPPORT #endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */ /**************************************************************************/ /* IRIX */ /**************************************************************************/ /**************************************************************************/ /* Generic */ /**************************************************************************/ #include /* May need to adjust this for other OSs */ /* For PATH_MAX */ #include "misc.h" /* * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere, * and it's safe, so just do it. */ #if !defined(O_NDELAY) && defined(O_NONBLOCK) #define O_NDELAY O_NONBLOCK #endif /* !O_NDELAY && O_NONBLOCK */ #if !defined(MAXHOSTNAMELEN) #define MAXHOSTNAMELEN 32 #endif /* !MAXHOSTNAMELEN */ #if defined(_POSIX_SOURCE) #include #else #define _POSIX_SOURCE #include #undef _POSIX_SOURCE #endif /* _POSIX_SOURCE */ #ifndef DEV_MEM #define DEV_MEM "/dev/mem" #endif #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) #endif #define SYSCALL(call) while(((call) == -1) && (errno == EINTR)) #define XF86_OS_PRIVS #include "xf86_OSproc.h" #endif /* _XF86_OSLIB_H */ xorg-server-1.17.1/hw/xfree86/os-support/stub/0000775000175100017510000000000012466505445016121 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/stub/Makefile.am0000664000175100017510000000067212406661137020075 00000000000000noinst_LTLIBRARIES = libstub.la AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) libstub_la_SOURCES = \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/agp_noop.c \ $(srcdir)/../shared/ioperm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/pm_noop.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ stub_bell.c \ stub_init.c \ stub_video.c xorg-server-1.17.1/hw/xfree86/os-support/stub/stub_init.c0000664000175100017510000000037112366220413020172 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86_OSlib.h" void xf86OpenConsole(void) { } void xf86CloseConsole(void) { } int xf86ProcessArgument(int argc, char *argv[], int i) { return 0; } void xf86UseMsg(void) { } xorg-server-1.17.1/hw/xfree86/os-support/stub/Makefile.in0000664000175100017510000010374512466505433020115 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/os-support/stub DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libstub_la_LIBADD = am_libstub_la_OBJECTS = VTsw_noop.lo agp_noop.lo ioperm_noop.lo \ kmod_noop.lo pm_noop.lo vidmem.lo posix_tty.lo sigio.lo \ stub_bell.lo stub_init.lo stub_video.lo libstub_la_OBJECTS = $(am_libstub_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 = $(libstub_la_SOURCES) DIST_SOURCES = $(libstub_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libstub.la AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) libstub_la_SOURCES = \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/agp_noop.c \ $(srcdir)/../shared/ioperm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/pm_noop.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ stub_bell.c \ stub_init.c \ stub_video.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/os-support/stub/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/stub/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libstub.la: $(libstub_la_OBJECTS) $(libstub_la_DEPENDENCIES) $(EXTRA_libstub_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libstub_la_OBJECTS) $(libstub_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agp_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmod_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm_noop.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.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 -o $@ $< .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 -o $@ `$(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 $@ $< VTsw_noop.lo: $(srcdir)/../shared/VTsw_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT VTsw_noop.lo -MD -MP -MF $(DEPDIR)/VTsw_noop.Tpo -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/VTsw_noop.Tpo $(DEPDIR)/VTsw_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/VTsw_noop.c' object='VTsw_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c agp_noop.lo: $(srcdir)/../shared/agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT agp_noop.lo -MD -MP -MF $(DEPDIR)/agp_noop.Tpo -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/agp_noop.Tpo $(DEPDIR)/agp_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/agp_noop.c' object='agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c ioperm_noop.lo: $(srcdir)/../shared/ioperm_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT ioperm_noop.lo -MD -MP -MF $(DEPDIR)/ioperm_noop.Tpo -c -o ioperm_noop.lo `test -f '$(srcdir)/../shared/ioperm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/ioperm_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ioperm_noop.Tpo $(DEPDIR)/ioperm_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/ioperm_noop.c' object='ioperm_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o ioperm_noop.lo `test -f '$(srcdir)/../shared/ioperm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/ioperm_noop.c kmod_noop.lo: $(srcdir)/../shared/kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT kmod_noop.lo -MD -MP -MF $(DEPDIR)/kmod_noop.Tpo -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/kmod_noop.Tpo $(DEPDIR)/kmod_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/kmod_noop.c' object='kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c pm_noop.lo: $(srcdir)/../shared/pm_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT pm_noop.lo -MD -MP -MF $(DEPDIR)/pm_noop.Tpo -c -o pm_noop.lo `test -f '$(srcdir)/../shared/pm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/pm_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pm_noop.Tpo $(DEPDIR)/pm_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/pm_noop.c' object='pm_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o pm_noop.lo `test -f '$(srcdir)/../shared/pm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/pm_noop.c vidmem.lo: $(srcdir)/../shared/vidmem.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) $(AM_CFLAGS) $(CFLAGS) -MT vidmem.lo -MD -MP -MF $(DEPDIR)/vidmem.Tpo -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vidmem.Tpo $(DEPDIR)/vidmem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/vidmem.c' object='vidmem.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) $(AM_CFLAGS) $(CFLAGS) -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c posix_tty.lo: $(srcdir)/../shared/posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -MT posix_tty.lo -MD -MP -MF $(DEPDIR)/posix_tty.Tpo -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/posix_tty.Tpo $(DEPDIR)/posix_tty.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/posix_tty.c' object='posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c sigio.lo: $(srcdir)/../shared/sigio.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) $(AM_CFLAGS) $(CFLAGS) -MT sigio.lo -MD -MP -MF $(DEPDIR)/sigio.Tpo -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sigio.Tpo $(DEPDIR)/sigio.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/sigio.c' object='sigio.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) $(AM_CFLAGS) $(CFLAGS) -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/xfree86/os-support/stub/stub_bell.c0000664000175100017510000000022312366220413020141 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86_OSlib.h" void xf86OSRingBell(int loudness, int pitch, int duration) { } xorg-server-1.17.1/hw/xfree86/os-support/stub/stub_video.c0000664000175100017510000000031212366220413020330 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86_OSlib.h" #include "xf86OSpriv.h" void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; return; } xorg-server-1.17.1/hw/xfree86/os-support/int10Defines.h0000664000175100017510000000552412274325511017463 00000000000000/* * Copyright (c) 2000-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _INT10DEFINES_H_ #define _INT10DEFINES_H_ 1 #ifdef _VM86_LINUX #include #define CPU_R(type,name,num) \ (((type *)&(((struct vm86_struct *)REG->cpuRegs)->regs.name))[num]) #define CPU_RD(name,num) CPU_R(CARD32,name,num) #define CPU_RW(name,num) CPU_R(CARD16,name,num) #define CPU_RB(name,num) CPU_R(CARD8,name,num) #define X86_EAX CPU_RD(eax,0) #define X86_EBX CPU_RD(ebx,0) #define X86_ECX CPU_RD(ecx,0) #define X86_EDX CPU_RD(edx,0) #define X86_ESI CPU_RD(esi,0) #define X86_EDI CPU_RD(edi,0) #define X86_EBP CPU_RD(ebp,0) #define X86_EIP CPU_RD(eip,0) #define X86_ESP CPU_RD(esp,0) #define X86_EFLAGS CPU_RD(eflags,0) #define X86_FLAGS CPU_RW(eflags,0) #define X86_AX CPU_RW(eax,0) #define X86_BX CPU_RW(ebx,0) #define X86_CX CPU_RW(ecx,0) #define X86_DX CPU_RW(edx,0) #define X86_SI CPU_RW(esi,0) #define X86_DI CPU_RW(edi,0) #define X86_BP CPU_RW(ebp,0) #define X86_IP CPU_RW(eip,0) #define X86_SP CPU_RW(esp,0) #define X86_CS CPU_RW(cs,0) #define X86_DS CPU_RW(ds,0) #define X86_ES CPU_RW(es,0) #define X86_SS CPU_RW(ss,0) #define X86_FS CPU_RW(fs,0) #define X86_GS CPU_RW(gs,0) #define X86_AL CPU_RB(eax,0) #define X86_BL CPU_RB(ebx,0) #define X86_CL CPU_RB(ecx,0) #define X86_DL CPU_RB(edx,0) #define X86_AH CPU_RB(eax,1) #define X86_BH CPU_RB(ebx,1) #define X86_CH CPU_RB(ecx,1) #define X86_DH CPU_RB(edx,1) #elif defined(_X86EMU) #include "xf86x86emu.h" #endif #endif xorg-server-1.17.1/hw/xfree86/os-support/solaris/0000775000175100017510000000000012466505445016620 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/solaris/Makefile.am0000664000175100017510000000173212200102654020554 00000000000000if SOLARIS_VT VTSW_SRC = sun_VTsw.c else VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c endif if AGP AGP_SRC = sun_agp.c else AGP_SRC = $(srcdir)/../shared/agp_noop.c endif SOLARIS_INOUT_SRC = solaris-@SOLARIS_INOUT_ARCH@.S DISTCLEANFILES = solaris-@SOLARIS_INOUT_ARCH@.il solaris-@SOLARIS_INOUT_ARCH@.il: solaris-@SOLARIS_INOUT_ARCH@.S $(CPP) -P -DINLINE_ASM $(srcdir)/solaris-@SOLARIS_INOUT_ARCH@.S > $@ noinst_LTLIBRARIES = libsolaris.la libsolaris_la_SOURCES = sun_init.c \ sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ $(srcdir)/../shared/vidmem.c \ $(VTSW_SRC) nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) sdk_HEADERS = nodist_sdk_HEADERS = solaris-@SOLARIS_INOUT_ARCH@.il AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \ apSolaris.shar sun_inout.s xorg-server-1.17.1/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S0000664000175100017510000000757712160102336022627 00000000000000/* Copyright (c) 2004, Oracle and/or its affiliates. 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 (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 INLINE_ASM #define FUNCTION_START(f,n) .inline f,n #define FUNCTION_END(f) .end #else #define _ASM #include #define FUNCTION_START(f,n) ENTRY(f) #define FUNCTION_END(f) retl; nop; SET_SIZE(f) #endif /* Converted from common/compiler.h gcc inline format to Sun cc inline * format by Kenjiro Tsuji * * The value 0x88 means ASI_PRIMARY_LITTLE. * The store or load to/from the address space will be done * as little-endian. In the original xrog code, the value * is defined as the macro ASI_PL. * * In the original xorg code, "membar #StoreStore|#StoreLoad" * is directly implemented as an instruction "0x8143e00a". * */ FUNCTION_START(outb, 0) stba %o1, [%o0] 0x88 membar #StoreStore|#StoreLoad FUNCTION_END(outb) FUNCTION_START(outw, 0) stha %o1, [%o0] 0x88 membar #StoreStore|#StoreLoad FUNCTION_END(outw) FUNCTION_START(outl, 0) sta %o1, [%o0] 0x88 membar #StoreStore|#StoreLoad FUNCTION_END(outl) FUNCTION_START(inb, 0) lduba [%o0] 0x88, %o0 FUNCTION_END(inb) FUNCTION_START(inw, 0) lduha [%o0] 0x88, %o0 FUNCTION_END(inw) FUNCTION_START(inl, 0) lda [%o0] 0x88, %o0 FUNCTION_END(inl) FUNCTION_START(xf86ReadMmio8, 0) lduba [%o0 + %o1] 0x88, %o0 FUNCTION_END(xf86ReadMmio8) FUNCTION_START(xf86ReadMmio16Be, 0) lduh [%o0 + %o1], %o0 FUNCTION_END(xf86ReadMmio16Be) FUNCTION_START(xf86ReadMmio16Le, 0) lduha [%o0 + %o1] 0x88, %o0 FUNCTION_END(xf86ReadMmio16Le) FUNCTION_START(xf86ReadMmio32Be, 0) ld [%o0 + %o1], %o0 FUNCTION_END(xf86ReadMmio32Be) FUNCTION_START(xf86ReadMmio32Le, 0) lda [%o0 + %o1] 0x88, %o0 FUNCTION_END(xf86ReadMmio32Le) FUNCTION_START(xf86WriteMmio8, 0) stba %o2, [%o0 + %o1] 0x88 membar #StoreStore|#StoreLoad FUNCTION_END(xf86WriteMmio8) FUNCTION_START(xf86WriteMmio16Be, 0) sth %o2, [%o0 + %o1] membar #StoreStore|#StoreLoad FUNCTION_END(xf86WriteMmio16Be) FUNCTION_START(xf86WriteMmio16Le, 0) stha %o2, [%o0 + %o1] 0x88 membar #StoreStore|#StoreLoad FUNCTION_END(xf86WriteMmio16Le) FUNCTION_START(xf86WriteMmio32Be, 0) st %o2, [%o0 + %o1] membar #StoreStore|#StoreLoad FUNCTION_END(xf86WriteMmio32Be) FUNCTION_START(xf86WriteMmio32Le, 0) sta %o2, [%o0 + %o1] 0x88 membar #StoreStore|#StoreLoad FUNCTION_END(xf86WriteMmio32Le) FUNCTION_START(xf86WriteMmio8NB, 0) add %o0, %o1, %o0 stba %o2, [%o0] 0x88 FUNCTION_END(xf86WriteMmio8NB) FUNCTION_START(xf86WriteMmio16BeNB, 0) sth %o2, [%o0 + %o1] FUNCTION_END(xf86WriteMmio16BeNB) FUNCTION_START(xf86WriteMmio16LeNB, 0) stha %o2, [%o0 + %o1] 0x88 FUNCTION_END(xf86WriteMmio16LeNB) FUNCTION_START(xf86WriteMmio32BeNB, 0) st %o2, [%o0 + %o1] FUNCTION_END(xf86WriteMmio32BeNB) FUNCTION_START(xf86WriteMmio32LeNB, 0) sta %o2, [%o0 + %o1] 0x88 FUNCTION_END(xf86WriteMmio32LeNB) xorg-server-1.17.1/hw/xfree86/os-support/solaris/sun_init.c0000664000175100017510000002725212456571574020551 00000000000000/* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany * Copyright 1993 by David Wexelblat * Copyright 1999 by David Holland * * 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 names 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, AND 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. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #ifdef HAVE_SYS_KD_H #include #endif /* * Applications see VT number as consecutive integers starting from 1. * VT number VT device * ------------------------------------------------------- * 1 : /dev/vt/0 (Alt + Ctrl + F1) * 2 : /dev/vt/2 (Alt + Ctrl + F2) * 3 : /dev/vt/3 (Alt + Ctrl + F3) * ... ... */ #define CONSOLE_VTNO 1 #define SOL_CONSOLE_DEV "/dev/console" static Bool KeepTty = FALSE; static Bool UseConsole = FALSE; #ifdef HAS_USL_VTS static int VTnum = -1; static int xf86StartVT = -1; static int vtEnabled = 0; #endif /* Device to open as xf86Info.consoleFd */ static char consoleDev[PATH_MAX] = "/dev/fb"; /* Set by -dev argument on CLI Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */ _X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb"; static void switch_to(int vt, const char *from) { int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); if (ret != 0) xf86Msg(X_WARNING, "%s: VT_ACTIVATE failed: %s\n", from, strerror(errno)); SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret != 0) xf86Msg(X_WARNING, "%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); } void xf86OpenConsole(void) { int i; #ifdef HAS_USL_VTS int fd; struct vt_mode VT; struct vt_stat vtinfo; MessageType from = X_PROBED; #endif if (serverGeneration == 1) { /* Check if we're run with euid==0 */ if (geteuid() != 0) FatalError("xf86OpenConsole: Server must be suid root\n"); #ifdef HAS_USL_VTS /* * Setup the virtual terminal manager */ if ((fd = open("/dev/vt/0", O_RDWR, 0)) == -1) { xf86ErrorF("xf86OpenConsole: Cannot open /dev/vt/0 (%s)\n", strerror(errno)); vtEnabled = 0; } else { if (ioctl(fd, VT_ENABLED, &vtEnabled) < 0) { xf86ErrorF("xf86OpenConsole: VT_ENABLED failed (%s)\n", strerror(errno)); vtEnabled = 0; } } #endif /* HAS_USL_VTS */ if (UseConsole) { strlcpy(consoleDev, SOL_CONSOLE_DEV, sizeof(consoleDev)); #ifdef HAS_USL_VTS xf86Info.vtno = CONSOLE_VTNO; if (vtEnabled == 0) { xf86StartVT = 0; } else { if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0) FatalError ("xf86OpenConsole: Cannot determine current VT\n"); xf86StartVT = vtinfo.v_active; } #endif /* HAS_USL_VTS */ goto OPENCONSOLE; } #ifdef HAS_USL_VTS if (vtEnabled == 0) { /* VT not enabled - kernel too old or Sparc platforms without visual_io support */ xf86Msg(from, "VT infrastructure is not available\n"); xf86StartVT = 0; xf86Info.vtno = 0; strlcpy(consoleDev, xf86SolarisFbDev, sizeof(consoleDev)); goto OPENCONSOLE; } if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0) FatalError("xf86OpenConsole: Cannot determine current VT\n"); xf86StartVT = vtinfo.v_active; if (VTnum != -1) { xf86Info.vtno = VTnum; from = X_CMDLINE; } else if (xf86Info.ShareVTs) { xf86Info.vtno = vtinfo.v_active; from = X_CMDLINE; } else { if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || (xf86Info.vtno == -1)) { FatalError("xf86OpenConsole: Cannot find a free VT\n"); } } xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno); snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno); if (fd != -1) { close(fd); } #endif /* HAS_USL_VTS */ OPENCONSOLE: if (!KeepTty) setpgrp(); if (((xf86Info.consoleFd = open(consoleDev, O_RDWR | O_NDELAY, 0)) < 0)) FatalError("xf86OpenConsole: Cannot open %s (%s)\n", consoleDev, strerror(errno)); /* Change ownership of the vt or console */ chown(consoleDev, getuid(), getgid()); #ifdef HAS_USL_VTS if (xf86Info.ShareVTs) return; if (vtEnabled) { /* * Now get the VT */ switch_to(xf86Info.vtno, "xf86OpenConsole"); #ifdef VT_SET_CONSUSER /* added in snv_139 */ if (strcmp(display, "0") == 0) if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0) xf86Msg(X_WARNING, "xf86OpenConsole: VT_SET_CONSUSER failed\n"); #endif if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) FatalError("xf86OpenConsole: VT_GETMODE failed\n"); OsSignal(SIGUSR1, xf86VTAcquire); OsSignal(SIGUSR2, xf86VTRelease); VT.mode = VT_PROCESS; VT.acqsig = SIGUSR1; VT.relsig = SIGUSR2; if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0) xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n"); } #endif #ifdef KDSETMODE SYSCALL(i = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS)); if (i < 0) { xf86Msg(X_WARNING, "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n", consoleDev, strerror(errno)); } #endif } else { /* serverGeneration != 1 */ #ifdef HAS_USL_VTS if (vtEnabled && !xf86Info.ShareVTs) { /* * Now re-get the VT */ if (xf86Info.autoVTSwitch) switch_to(xf86Info.vtno, "xf86OpenConsole"); #ifdef VT_SET_CONSUSER /* added in snv_139 */ if (strcmp(display, "0") == 0) if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0) xf86Msg(X_WARNING, "xf86OpenConsole: VT_SET_CONSUSER failed\n"); #endif /* * If the server doesn't have the VT when the reset occurs, * this is to make sure we don't continue until the activate * signal is received. */ if (!xf86VTOwner()) sleep(5); } #endif /* HAS_USL_VTS */ } } void xf86CloseConsole(void) { #ifdef HAS_USL_VTS struct vt_mode VT; #endif #if !defined(__i386__) && !defined(__i386) && !defined(__x86) if (!xf86DoConfigure) { int fd; /* * Wipe out framebuffer just like the non-SI Xsun server does. This * could be improved by saving framebuffer contents in * xf86OpenConsole() above and restoring them here. Also, it's unclear * at this point whether this should be done for all framebuffers in * the system, rather than only the console. */ if ((fd = open(xf86SolarisFbDev, O_RDWR, 0)) < 0) { xf86Msg(X_WARNING, "xf86CloseConsole(): unable to open framebuffer (%s)\n", strerror(errno)); } else { struct fbgattr fbattr; if ((ioctl(fd, FBIOGATTR, &fbattr) < 0) && (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0)) { xf86Msg(X_WARNING, "xf86CloseConsole(): unable to retrieve framebuffer" " attributes (%s)\n", strerror(errno)); } else { void *fbdata; fbdata = mmap(NULL, fbattr.fbtype.fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (fbdata == MAP_FAILED) { xf86Msg(X_WARNING, "xf86CloseConsole(): unable to mmap framebuffer" " (%s)\n", strerror(errno)); } else { memset(fbdata, 0, fbattr.fbtype.fb_size); munmap(fbdata, fbattr.fbtype.fb_size); } } close(fd); } } #endif #ifdef KDSETMODE /* Reset the display back to text mode */ SYSCALL(ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT)); #endif #ifdef HAS_USL_VTS if (vtEnabled) { if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) { VT.mode = VT_AUTO; /* Set default vt handling */ ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); } /* Activate the VT that X was started on */ if (xf86Info.autoVTSwitch) switch_to(xf86StartVT, "xf86CloseConsole"); } #endif /* HAS_USL_VTS */ close(xf86Info.consoleFd); } int xf86ProcessArgument(int argc, char **argv, int i) { /* * Keep server from detaching from controlling tty. This is useful when * debugging, so the server can receive keyboard signals. */ if (!strcmp(argv[i], "-keeptty")) { KeepTty = TRUE; return 1; } /* * Use /dev/console as the console device. */ if (!strcmp(argv[i], "-C")) { UseConsole = TRUE; return 1; } #ifdef HAS_USL_VTS if ((argv[i][0] == 'v') && (argv[i][1] == 't')) { if (sscanf(argv[i], "vt%d", &VTnum) == 0) { UseMsg(); VTnum = -1; return 0; } return 1; } #endif /* HAS_USL_VTS */ if ((i + 1) < argc) { if (!strcmp(argv[i], "-dev")) { strlcpy(xf86SolarisFbDev, argv[i + 1], sizeof(xf86SolarisFbDev)); return 2; } } return 0; } void xf86UseMsg(void) { #ifdef HAS_USL_VTS ErrorF("vtX Use the specified VT number\n"); #endif ErrorF("-dev Framebuffer device\n"); ErrorF("-keeptty Don't detach controlling tty\n"); ErrorF(" (for debugging only)\n"); ErrorF("-C Use /dev/console as the console device\n"); } xorg-server-1.17.1/hw/xfree86/os-support/solaris/sun_bell.c0000664000175100017510000001320412366220413020473 00000000000000/* Copyright (c) 2004-2005, Oracle and/or its affiliates. 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 (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_XORG_CONFIG_H #include #endif #include #include #include #include #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #define BELL_RATE 48000 /* Samples per second */ #define BELL_HZ 50 /* Fraction of a second i.e. 1/x */ #define BELL_MS (1000/BELL_HZ) /* MS */ #define BELL_SAMPLES (BELL_RATE / BELL_HZ) #define BELL_MIN 3 /* Min # of repeats */ #define AUDIO_DEVICE "/dev/audio" void xf86OSRingBell(int loudness, int pitch, int duration) { static short samples[BELL_SAMPLES]; static short silence[BELL_SAMPLES]; /* "The Sound of Silence" */ static int lastFreq; int cnt; int i; int written; int repeats; int freq; audio_info_t audioInfo; struct iovec iov[IOV_MAX]; int iovcnt; double ampl, cyclen, phase; int audioFD; if ((loudness <= 0) || (pitch <= 0) || (duration <= 0)) { return; } lastFreq = 0; memset(silence, 0, sizeof(silence)); audioFD = open(AUDIO_DEVICE, O_WRONLY | O_NONBLOCK); if (audioFD == -1) { xf86Msg(X_ERROR, "Bell: cannot open audio device \"%s\": %s\n", AUDIO_DEVICE, strerror(errno)); return; } freq = pitch; freq = min(freq, (BELL_RATE / 2) - 1); freq = max(freq, 2 * BELL_HZ); /* * Ensure full waves per buffer */ freq -= freq % BELL_HZ; if (freq != lastFreq) { lastFreq = freq; ampl = 16384.0; cyclen = (double) freq / (double) BELL_RATE; phase = 0.0; for (i = 0; i < BELL_SAMPLES; i++) { samples[i] = (short) (ampl * sin(2.0 * M_PI * phase)); phase += cyclen; if (phase >= 1.0) phase -= 1.0; } } repeats = (duration + (BELL_MS / 2)) / BELL_MS; repeats = max(repeats, BELL_MIN); loudness = max(0, loudness); loudness = min(loudness, 100); #ifdef DEBUG ErrorF("BELL : freq %d volume %d duration %d repeats %d\n", freq, loudness, duration, repeats); #endif AUDIO_INITINFO(&audioInfo); audioInfo.play.encoding = AUDIO_ENCODING_LINEAR; audioInfo.play.sample_rate = BELL_RATE; audioInfo.play.channels = 2; audioInfo.play.precision = 16; audioInfo.play.gain = min(AUDIO_MAX_GAIN, AUDIO_MAX_GAIN * loudness / 100); if (ioctl(audioFD, AUDIO_SETINFO, &audioInfo) < 0) { xf86Msg(X_ERROR, "Bell: AUDIO_SETINFO failed on audio device \"%s\": %s\n", AUDIO_DEVICE, strerror(errno)); close(audioFD); return; } iovcnt = 0; for (cnt = 0; cnt <= repeats; cnt++) { if (cnt == repeats) { /* Insert a bit of silence so that multiple beeps are distinct and * not compressed into a single tone. */ iov[iovcnt].iov_base = (char *) silence; iov[iovcnt++].iov_len = sizeof(silence); } else { iov[iovcnt].iov_base = (char *) samples; iov[iovcnt++].iov_len = sizeof(samples); } if ((iovcnt >= IOV_MAX) || (cnt == repeats)) { written = writev(audioFD, iov, iovcnt); if ((written < ((int) (sizeof(samples) * iovcnt)))) { /* audio buffer was full! */ int naptime; if (written == -1) { if (errno != EAGAIN) { xf86Msg(X_ERROR, "Bell: writev failed on audio device \"%s\": %s\n", AUDIO_DEVICE, strerror(errno)); close(audioFD); return; } i = iovcnt; } else { i = ((sizeof(samples) * iovcnt) - written) / sizeof(samples); } cnt -= i; /* sleep a little to allow audio buffer to drain */ naptime = BELL_MS * i; poll(NULL, 0, naptime); i = ((sizeof(samples) * iovcnt) - written) % sizeof(samples); iovcnt = 0; if ((written != -1) && (i > 0)) { iov[iovcnt].iov_base = ((char *) samples) + i; iov[iovcnt++].iov_len = sizeof(samples) - i; } } else { iovcnt = 0; } } } close(audioFD); return; } xorg-server-1.17.1/hw/xfree86/os-support/solaris/apSolaris.shar0000664000175100017510000004113212160102336021334 00000000000000#!/bin/sh # # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # Made on Sun Jun 25 20:24:59 CEST 2006 by Martin Bochnig at martux.org # # This archive contains: # # ./aperture # # ./aperture/Makefile # ./aperture/Makefile.amd64 # ./aperture/Makefile.sparcv9 # ./aperture/README # ./aperture/aperture.c # ./aperture/aperture.conf # ./aperture/devlink.tab # echo c - ./aperture mkdir -p ./aperture > /dev/null 2>&1 # echo x - ./aperture/Makefile sed 's/^X//' >./aperture/Makefile << 'END-of-./aperture/Makefile' X# X# File: makefile for aperture Framebuffer Driver X# Author: Doug Anson (danson@lgc.com) X# Date: 2/15/94 X# Modified: David Holland (davidh@use.com) X# Date: 2/23/94 X# - Changed name, and debugging structure X# Modified: Marc Aurele La France (tsi@xfree86.org) X# Date: 2001.06.08 X# - SPARC support, cleanup and turf aptest. X# X# >>NOTE<< Have a look at Makefile.sparcv9 for specifics. X# X# Modified: Martin Bochnig (martin@martux.org) X# Date: 2006.06.24 X# - Slightly modified to also build on Solaris 10 and 11. X# - amd64 64 bit kernel support X# - cosmetical changes to also support sun4v, not only sun4u X# X# >>NOTE<< Have a look at Makefile.amd64 for amd64 specifics. X# X# GNU gcc compiler XCC=gcc XCFLGS=-fno-builtin -Wall -O3 X X# X# SUNWspro compiler X#CC=/opt/SUNWspro/bin/cc X#CFLGS=-Xa -xnolib -xO3 X X# X# Debug error reporting X#DEBUG_FLG= X#DEBUG_FLG=-DAPERTURE_DEBUG X X# X# Files and object declarations XKERNEL_FLGS=-D_KERNEL -DSUNDDI XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG) XCFILES= aperture.c XOBJS= aperture.o XDRIVER= aperture X X# X# Make rules Xall: $(DRIVER) X X$(DRIVER): $(OBJS) X @if [ -f "Makefile.`isainfo -k`" ]; then \ X make -f Makefile.`isainfo -k` $(DRIVER); \ X else \ X rm -f $(DRIVER); \ X ld -r -o $(DRIVER) $(OBJS); \ X fi X Xinstall: $(DRIVER) X @if [ -f "Makefile.`isainfo -k`" ]; then \ X make -f Makefile.`isainfo -k` install; \ X else \ X cp aperture.conf /kernel/drv; \ X cp $(DRIVER) /kernel/drv; \ X fi X Xadd_drv: X @if [ -f "Makefile.`isainfo -k`" ]; then \ X make -f Makefile.`isainfo -k` add_drv; \ X else \ X add_drv aperture; \ X fi X Xclean: X rm -f *% *.BAK $(OBJS) $(DRIVER) core X X.SUFFIXES: .i X X.c.i: X $(CC) -E $(CFLAGS) $*.c > $@ X X.c.o: X @if [ -f "Makefile.`isainfo -k`" ]; then \ X make -f Makefile.`isainfo -k` $@; \ X else \ X rm -f $@; \ X $(CC) -c $(CFLAGS) $*.c -o $@; \ X fi END-of-./aperture/Makefile echo x - ./aperture/Makefile.amd64 sed 's/^X//' >./aperture/Makefile.amd64 << 'END-of-./aperture/Makefile.amd64' X# X# File: Makefile for aperture Framebuffer Driver X# Author: Doug Anson (danson@lgc.com) X# Date: 2/15/94 X# Modified: David Holland (davidh@use.com) X# Date: 2/23/94 X# - Changed name, and debugging structure X# Modified: Marc Aurele La France (tsi@xfree86.org) X# Date: 2001.06.08 X# - SPARC support, cleanup and turf aptest. X# Modified: Martin Bochnig (martin@martux.org) X# - amd64 64 bit kernel support, cosmetics and also X# supporting sun4v (and arbitrary sparcv9) platforms X# as well as SunOS 5.10 or higher now X# - Changed name X# X X# X# GNU gcc compiler, version 3.2 or later X# XCC=gcc XCFLGS=-fno-builtin -Wall -O3 -m64 -mcmodel=kernel X X# X# SUNWspro compiler (untested, might not properly work for amd64 here) X#CC=/opt/SUNWspro/bin/cc X#CFLGS=-Xa -xarch=v9 -xnolib -xO3 X X# X# Debug error reporting X#DEBUG_FLG= X#DEBUG_FLG=-DAPERTURE_DEBUG X X# X# Files and object declarations XKERNEL_FLGS=-D_KERNEL -DSUNDDI XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG) XCFILES= aperture.c XOBJS= aperture.o XDRIVER= aperture X X# X# Make rules Xall: $(DRIVER) X X$(DRIVER): $(OBJS) X rm -f $(DRIVER) X ld -r -o $(DRIVER) $(OBJS) X Xinstall: $(DRIVER) X cp aperture.conf /kernel/drv X cp $(DRIVER) /kernel/drv/amd64 X Xadd_drv: X add_drv aperture X Xclean: X rm -f *% *.BAK $(OBJS) $(DRIVER) core X X.SUFFIXES: .i X X.c.i: X $(CC) -E $(CFLAGS) $*.c > $@ END-of-./aperture/Makefile.amd64 echo x - ./aperture/Makefile.sparcv9 sed 's/^X//' >./aperture/Makefile.sparcv9 << 'END-of-./aperture/Makefile.sparcv9' X# X# File: makefile for aperture Framebuffer Driver X# Author: Doug Anson (danson@lgc.com) X# Date: 2/15/94 X# Modified: David Holland (davidh@use.com) X# Date: 2/23/94 X# - Changed name, and debugging structure X# Modified: Marc Aurele La France (tsi@xfree86.org) X# Date: 2001.06.08 X# - SPARC support, cleanup and turf aptest. X# Modified: Martin Bochnig (martin@martux.org) X# Date: 2006.06.24 X# - Changed name for generic sparcv9 support X# - updated to better work with Solaris 10 and 11 X# X X# X# GNU gcc compiler, version 3.2 or later X# XCC=gcc XCFLGS=-fno-builtin -Wall -O3 -m64 X X# X# SUNWspro compiler X#CC=/opt/SUNWspro/bin/cc X#CFLGS=-Xa -xarch=v9 -xnolib -xO3 X X# X# Debug error reporting X#DEBUG_FLG= X#DEBUG_FLG=-DAPERTURE_DEBUG X X# X# Files and object declarations XKERNEL_FLGS=-D_KERNEL -DSUNDDI XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG) XCFILES= aperture.c XOBJS= aperture.o XDRIVER= aperture X X# X# Make rules Xall: $(DRIVER) X X$(DRIVER): $(OBJS) X rm -f $(DRIVER) X ld -r -o $(DRIVER) $(OBJS) X Xinstall: $(DRIVER) X cp aperture.conf /kernel/drv X cp $(DRIVER) /kernel/drv/sparcv9 X Xadd_drv: X add_drv aperture X Xclean: X rm -f *% *.BAK $(OBJS) $(DRIVER) core X X.SUFFIXES: .i X X.c.i: X $(CC) -E $(CFLAGS) $*.c > $@ END-of-./aperture/Makefile.sparcv9 echo x - ./aperture/README sed 's/^X//' >./aperture/README << 'END-of-./aperture/README' XFramebuffer aperture driver. X XThis driver was written to provide a device that, unlike /dev/mem, allows Xmmap()'ing of ranges beyond installed memory. X XThe original x86-based version of this driver was the collaborative work of XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since Xbeen rewritten to also work on sparc machines and - later on - also on sparcv9 Xand recently amd64 64 bit kernels. XIt flawlessly compiles and installs on Solaris 10 and 11 now. X X XInstallation instructions: X X1) Check the Makefile, for appropriate CC, and CFLAGS definitions. Compiling X with APERTURE_DEBUG defined means the driver will generate reams of X debugging output. You'll probably want to leave this off... X X2) Type 'make' (or 'gmake'). Both the driver and test program should compile X without any problems. No warning messages should be generated. X X3) Become 'root'. X X4) Type 'make install' and 'make add_drv'. The screen should look something X like this: X X # make install X cp aperture aperture.conf /kernel/drv X # make add_drv X add_drv aperture X X On a sparcv9 machine this will mention the /kernel/drv/sparcv9 directory X instead of /kernel/drv. Similarily /kernel/drv/amd64 should be used on amd64. X X This installs the driver to the system. X X5) While as root modify the file /etc/devlink.tab, adding these lines: X X# The following entry is for the framebuffer driver Xtype=ddi_pseudo;name=aperture fbs/\M0 X X Add that line exactly as shown. You may also simply add the X contents of the devlink.tab file supplied to /etc/devlink.tab. X It contains the lines as well. (Yes, that is a tab between X aperture and fbs, not spaces - very important) X X6) Perform a reconfiguration boot of the system. X X # touch /reconfigure X # init 6 X XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org. END-of-./aperture/README echo x - ./aperture/aperture.c sed 's/^X//' >./aperture/aperture.c << 'END-of-./aperture/aperture.c' X/* X * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. X * X * Permission is hereby granted, free of charge, to any person obtaining a copy X * of this software and associated documentation files (the "Software"), to X * deal in the Software without restriction, including without limitation the X * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or X * sell copies of the Software, and to permit persons to whom the Software is X * furnished to do so, subject to the following conditions: X * X * The above copyright notice and this permission notice shall be included in X * all copies or substantial portions of the Software. X * X * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR X * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, X * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER X * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN X * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. X * X * Except as contained in this notice, the name of the XFree86 Project shall X * not be used in advertising or otherwise to promote the sale, use or other X * dealings in this Software without prior written authorization from the X * XFree86 Project. X */ X X/* X * Aperture driver for Solaris. X */ X X/* X * Modified: Martin Bochnig (martin@martux.org) X * Log: Commented out obsolete kernel interfaces DDI_IDENTIFIED and DDI_NOT_IDENTIFIED X * not supported by SunOS 5.10 or higher anymore, X * see http://docs.sun.com/app/docs/doc/819-2255/6n4ibnffr?a=view X */ X X#include X#include X#include X#include X#include X#include X X#define DEV_IDENT "aperture" X#define DEV_BANNER "XFree86 aperture driver" X X#ifndef D_64BIT X#define D_64BIT 0 X#endif X X#ifndef NULL X#define NULL ((void *)0) X#endif X X/* X * open(9E) X */ X/*ARGSUSED*/ Xstatic int Xaperture_open X( X#ifdef __STDC__ X dev_t *devp, X int flag, X int typ, X struct cred *cred X#endif X) X#ifndef __STDC__ X dev_t *devp; X int flag; X int typ; X struct cred *cred; X#endif X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n"); X X#endif X X if ((typ != OTYP_CHR) || (getminor(*devp))) X error = EINVAL; X else X error = 0; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error); X X#endif X X return error; X} X X/* X * mmap(9E) X */ X/*ARGSUSED*/ Xstatic int Xaperture_mmap X( X#ifdef __STDC__ X dev_t dev, X off_t off, X int prot X#endif X) X#ifndef __STDC__ X dev_t dev; X off_t off; X int prot; X#endif X{ X pfn_t pf; X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off); X X#endif X X pf = btop((unsigned long)off); X X /* Deal with mmap(9E) interface limits */ X error = (int)pf; X if ((error < 0) || (pf != (pfn_t)error)) X error = -1; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error); X X#endif X X return error; X} X Xstatic struct cb_ops aperture_cb_ops = X{ X aperture_open, /* open */ X nulldev, /* close */ X nodev, /* strategy */ X nodev, /* print */ X nodev, /* dump */ X nodev, /* read */ X nodev, /* write */ X nodev, /* ioctl */ X nodev, /* devmap */ X aperture_mmap, /* mmap */ X ddi_segmap, /* segmap */ X nochpoll, /* poll */ X ddi_prop_op, /* cb_prop_op */ X 0, /* streamtab */ X D_NEW | D_MP | D_64BIT /* Driver compatibility flag */ X}; X X Xstatic dev_info_t *aperture_dip; /* private copy of devinfo pointer */ X X/* X * getinfo(9E) X */ X/*ARGSUSED*/ Xstatic int Xaperture_getinfo X( X#ifdef __STDC__ X dev_info_t *dip, X ddi_info_cmd_t infocmd, X void *arg, X void **result X#endif X) X#ifndef __STDC__ X dev_info_t *dip; X ddi_info_cmd_t infocmd; X void *arg; X void **result; X#endif X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n"); X X#endif X X switch (infocmd) { X case DDI_INFO_DEVT2DEVINFO: X *result = aperture_dip; X error = DDI_SUCCESS; X break; X case DDI_INFO_DEVT2INSTANCE: X *result = NULL; X error = DDI_SUCCESS; X break; X default: X error = DDI_FAILURE; X } X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error); X X#endif X X return error; X} X X/* X * identify(9E) X */ X/*ARGSUSED*/ Xstatic int Xaperture_identify X( X#ifdef __STDC__ X dev_info_t *dip X#endif X) X#ifndef __STDC__ X dev_info_t *dip; X#endif X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n"); X X#endif X X if (strcmp(ddi_get_name(dip), DEV_IDENT)) X error = 1 /* DDI_NOT_IDENTIFIED obsolete since SunOS 5.10 */ ; X else X error = 2 /* DDI_IDENTIFIED obsolete since SunOS 5.10 */ ; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error); X X#endif X X return error; X} X X/* X * attach(9E) X */ X/*ARGSUSED*/ Xstatic int Xaperture_attach X( X#ifdef __STDC__ X dev_info_t *dip, X ddi_attach_cmd_t cmd X#endif X) X#ifndef __STDC__ X dev_info_t *dip; X ddi_attach_cmd_t cmd; X#endif X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n"); X X#endif X X if (cmd != DDI_ATTACH) X { X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n"); X X#endif X X error = DDI_FAILURE; X } X else X { X error = ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR, X (minor_t)ddi_get_instance(dip), X NULL, 0 /* NODESPECIFIC_DEV obsolete since SunOS 5.10 */ ); X X if (error == DDI_SUCCESS) X { X aperture_dip = dip; X ddi_report_dev(dip); X } X } X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error); X X#endif X X return error; X} X X/* X * detach(9E) X */ Xstatic int Xaperture_detach X( X#ifdef __STDC__ X dev_info_t *dip, X ddi_detach_cmd_t cmd X#endif X) X#ifndef __STDC__ X dev_info_t *dip; X ddi_detach_cmd_t cmd; X#endif X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n"); X X#endif X X if (cmd != DDI_DETACH) X { X error = DDI_FAILURE; X } X else X { X ddi_remove_minor_node(dip, NULL); X aperture_dip = NULL; X error = DDI_SUCCESS; X } X X#if APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error); X X#endif X X return error; X} X X Xstatic struct dev_ops aperture_ops = X{ X DEVO_REV, /* revision */ X 0, /* refcnt */ X aperture_getinfo, /* getinfo */ X aperture_identify, /* identify */ X nulldev, /* probe */ X aperture_attach, /* attach */ X aperture_detach, /* detach */ X nodev, /* reset */ X &aperture_cb_ops, /* driver operations */ X NULL /* bus operations */ X}; X X Xstatic struct modldrv modldrv = X{ X &mod_driverops, /* mod_ops structure pointer */ X DEV_BANNER, /* driver banner string */ X &aperture_ops, /* dev_ops structure pointer */ X}; X X Xstatic struct modlinkage modlinkage = X{ X MODREV_1, /* module API revision */ X { X &modldrv, /* module driver structure pointer */ X NULL /* list termination */ X } X}; X X X/* X * _init(9E) X */ Xint X_init X( X#ifdef __STDC__ X void X#endif X) X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n"); X X#endif X X error = mod_install(&modlinkage); X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error); X X#endif X X return error; X} X X/* X * _info(9E) X */ Xint X_info X( X#ifdef __STDC__ X struct modinfo *modinfop X#endif X) X#ifndef __STDC__ X struct modinfo *modinfop; X#endif X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n"); X X#endif X X error = mod_info(&modlinkage, modinfop); X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error); X X#endif X X return error; X} X X/* X * _fini(9E) X */ Xint X_fini X( X#ifdef __STDC__ X void X#endif X) X{ X int error; X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n"); X X#endif X X error = mod_remove(&modlinkage); X X#ifdef APERTURE_DEBUG X X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error); X X#endif X X return error; X} END-of-./aperture/aperture.c echo x - ./aperture/aperture.conf sed 's/^X//' >./aperture/aperture.conf << 'END-of-./aperture/aperture.conf' X# X# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com X# X# File: aperture.conf X# Author: Doug Anson (danson@lgc.com) X# X# Modified: David Holland (davidh@use.com) X# Log: Change comments 02/23/94 X# Change defaults/comments 09/25/94 X# X# Modified: Marc Aurele La France (tsi@xfree86.org) X# Log: SPARC changes 2001.09 X# X# Purpose: This conf file is used by the aperture driver. X# Xname="aperture" parent="pseudo"; END-of-./aperture/aperture.conf echo x - ./aperture/devlink.tab sed 's/^X//' >./aperture/devlink.tab << 'END-of-./aperture/devlink.tab' X# The following entry is for the aperture driver Xtype=ddi_pseudo;name=aperture fbs/\M0 END-of-./aperture/devlink.tab exit xorg-server-1.17.1/hw/xfree86/os-support/solaris/sun_VTsw.c0000664000175100017510000000621012366220413020457 00000000000000/* * Copyright (c) 2009, Oracle and/or its affiliates. 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 (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_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include #include /* * Handle the VT-switching interface for Solaris/OpenSolaris */ static int xf86VTPruneDoor = 0; void xf86VTRelease(int sig) { if (xf86Info.vtPendingNum == -1) { xf86VTPruneDoor = 1; xf86Info.vtRequestsPending = TRUE; return; } ioctl(xf86Info.consoleFd, VT_RELDISP, 1); xf86Info.vtPendingNum = -1; return; } void xf86VTAcquire(int sig) { xf86Info.vtRequestsPending = TRUE; return; } Bool xf86VTSwitchPending(void) { return xf86Info.vtRequestsPending ? TRUE : FALSE; } Bool xf86VTSwitchAway(void) { int door_fd; vt_cmd_arg_t vt_door_arg; door_arg_t door_arg; xf86Info.vtRequestsPending = FALSE; if (xf86VTPruneDoor) { xf86VTPruneDoor = 0; ioctl(xf86Info.consoleFd, VT_RELDISP, 1); return TRUE; } vt_door_arg.vt_ev = VT_EV_HOTKEYS; vt_door_arg.vt_num = xf86Info.vtPendingNum; door_arg.data_ptr = (char *) &vt_door_arg; door_arg.data_size = sizeof(vt_cmd_arg_t); door_arg.rbuf = NULL; door_arg.rsize = 0; door_arg.desc_ptr = NULL; door_arg.desc_num = 0; if ((door_fd = open(VT_DAEMON_DOOR_FILE, O_RDONLY)) < 0) return FALSE; if (door_call(door_fd, &door_arg) != 0) { close(door_fd); return FALSE; } close(door_fd); return TRUE; } Bool xf86VTSwitchTo(void) { xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) { return FALSE; } else { return TRUE; } } Bool xf86VTActivate(int vtno) { struct vt_stat state; if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0) return FALSE; if ((state.v_state & (1 << vtno)) == 0) return FALSE; xf86Info.vtRequestsPending = TRUE; xf86Info.vtPendingNum = vtno; return TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/solaris/sun_inout.s0000664000175100017510000000603612160102336020733 00000000000000/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $ / / Copyright 1994-2001 The XFree86 Project, Inc. All Rights Reserved. / / Permission is hereby granted, free of charge, to any person obtaining a copy / of this software and associated documentation files (the "Software"), to deal / in the Software without restriction, including without limitation the rights / to use, copy, modify, merge, publish, distribute, sublicense, and/or sell / copies of the Software, and to permit persons to whom the Software is / furnished to do so, subject to the following conditions: / / The above copyright notice and this permission notice shall be included in / all copies or substantial portions of the Software. / / THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR / IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, / FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE / XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER / IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN / CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. / / Except as contained in this notice, the name of the XFree86 Project shall not / be used in advertising or otherwise to promote the sale, use or other / dealings in this Software without prior written authorization from the / XFree86 Project. / / / File: sun_inout.s / / Purpose: Provide inb(), inw(), inl(), outb(), outw(), outl() functions / for Solaris x86 using the ProWorks compiler by SunPro / / Author: Installed into XFree86 SuperProbe by Doug Anson (danson@lgc.com) / Portions donated to XFree86 by Steve Dever (Steve.Dever@Eng.Sun.Com) / / Synopsis: (c callable external declarations) / extern unsigned char inb(int port); / extern unsigned short inw(int port); / extern unsigned long inl(int port); / extern void outb(int port, unsigned char value); / extern void outw(int port, unsigned short value); / extern void outl(int port, unsigned long value); / .file "sunos_inout.s" .text .globl inb .globl inw .globl inl .globl outb .globl outw .globl outl / / unsigned char inb(int port); / .align 4 inb: movl 4(%esp),%edx subl %eax,%eax inb (%dx) ret .type inb,@function .size inb,.-inb / / unsigned short inw(int port); / .align 4 inw: movl 4(%esp),%edx subl %eax,%eax inw (%dx) ret .type inw,@function .size inw,.-inw / / unsigned long inl(int port); / .align 4 inl: movl 4(%esp),%edx inl (%dx) ret .type inl,@function .size inl,.-inl / / void outb(int port, unsigned char value); / .align 4 outb: movl 4(%esp),%edx movl 8(%esp),%eax outb (%dx) ret .type outb,@function .size outb,.-outb / / void outw(int port, unsigned short value); / .align 4 outw: movl 4(%esp),%edx movl 8(%esp),%eax outw (%dx) ret .type outw,@function .size outw,.-outw / / void outl(int port, unsigned long value); / .align 4 outl: movl 4(%esp),%edx movl 8(%esp),%eax outl (%dx) ret .type outl,@function .size outl,.-outl xorg-server-1.17.1/hw/xfree86/os-support/solaris/sun_agp.c0000664000175100017510000002136012366220413020326 00000000000000/* * Abstraction of the AGP GART interface. * * This version is for Solaris. * * Copyright © 2000 VA Linux Systems, Inc. * Copyright © 2001 The XFree86 Project, Inc. */ /* Copyright (c) 2005, Oracle and/or its affiliates. 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 (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_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86_OSproc.h" #include #include #include #include #include /* AGP page size is independent of the host page size. */ #ifndef AGP_PAGE_SIZE #define AGP_PAGE_SIZE 4096 #endif static int gartFd = -1; static int acquiredScreen = -1; static Bool initDone = FALSE; /* * Close /dev/agpgart. This frees all associated memory allocated during * this server generation. */ Bool xf86GARTCloseScreen(int screenNum) { if (gartFd != -1) { close(gartFd); acquiredScreen = -1; gartFd = -1; initDone = FALSE; xf86DrvMsg(screenNum, X_INFO, "xf86GARTCloseScreen: device closed successfully\n"); } return TRUE; } /* * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called. */ static Bool GARTInit(int screenNum) { if (initDone) return gartFd != -1; if (gartFd == -1) gartFd = open(AGP_DEVICE, O_RDWR); else return FALSE; if (gartFd == -1) { xf86DrvMsg(screenNum, X_ERROR, "GARTInit: Unable to open " AGP_DEVICE " (%s)\n", strerror(errno)); return FALSE; } initDone = TRUE; xf86DrvMsg(screenNum, X_INFO, "GARTInit: " AGP_DEVICE " opened successfully\n"); return TRUE; } Bool xf86AgpGARTSupported(void) { return (GARTInit(-1)); } AgpInfoPtr xf86GetAGPInfo(int screenNum) { agp_info_t agpinf; AgpInfoPtr info; if (!GARTInit(screenNum)) return NULL; if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) { xf86DrvMsg(screenNum, X_ERROR, "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n", strerror(errno)); return NULL; } if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) { xf86DrvMsg(screenNum, X_ERROR, "xf86GetAGPInfo: Failed to allocate AgpInfo\n"); return NULL; } info->bridgeId = agpinf.agpi_devid; info->agpMode = agpinf.agpi_mode; info->base = agpinf.agpi_aperbase; info->size = agpinf.agpi_apersize; info->totalPages = (unsigned long) agpinf.agpi_pgtotal; info->systemPages = (unsigned long) agpinf.agpi_pgsystem; info->usedPages = (unsigned long) agpinf.agpi_pgused; return info; } Bool xf86AcquireGART(int screenNum) { if (!GARTInit(screenNum)) return FALSE; if (acquiredScreen != screenNum) { if (ioctl(gartFd, AGPIOC_ACQUIRE, 0) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86AcquireGART: AGPIOC_ACQUIRE failed (%s)\n", strerror(errno)); return FALSE; } acquiredScreen = screenNum; xf86DrvMsg(screenNum, X_INFO, "xf86AcquireGART: AGPIOC_ACQUIRE succeeded\n"); } return TRUE; } Bool xf86ReleaseGART(int screenNum) { if (!GARTInit(screenNum)) return FALSE; if (acquiredScreen == screenNum) { /* * The FreeBSD agp driver removes allocations on release. * The Solaris driver doesn't. xf86ReleaseGART() is expected * to give up access to the GART, but not to remove any * allocations. */ if (ioctl(gartFd, AGPIOC_RELEASE, 0) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86ReleaseGART: AGPIOC_RELEASE failed (%s)\n", strerror(errno)); return FALSE; } acquiredScreen = -1; xf86DrvMsg(screenNum, X_INFO, "xf86ReleaseGART: AGPIOC_RELEASE succeeded\n"); return TRUE; } return FALSE; } int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type, unsigned long *physical) { agp_allocate_t alloc; int pages; /* * Allocates "size" bytes of GART memory (rounds up to the next * page multiple) or type "type". A handle (key) for the allocated * memory is returned. On error, the return value is -1. * "size" should be larger than 0, or AGPIOC_ALLOCATE ioctl will * return error. */ if (!GARTInit(screenNum) || (acquiredScreen != screenNum)) return -1; pages = (size / AGP_PAGE_SIZE); if (size % AGP_PAGE_SIZE != 0) pages++; alloc.agpa_pgcount = pages; alloc.agpa_type = type; if (ioctl(gartFd, AGPIOC_ALLOCATE, &alloc) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86AllocateGARTMemory: " "allocation of %d pages failed\n\t(%s)\n", pages, strerror(errno)); return -1; } if (physical) *physical = (unsigned long) alloc.agpa_physical; return alloc.agpa_key; } Bool xf86DeallocateGARTMemory(int screenNum, int key) { if (!GARTInit(screenNum) || (acquiredScreen != screenNum)) return FALSE; if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *) (uintptr_t) key) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86DeAllocateGARTMemory: " "deallocation of gart memory with key %d failed\n" "\t(%s)\n", key, strerror(errno)); return FALSE; } return TRUE; } /* Bind GART memory with "key" at "offset" */ Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset) { agp_bind_t bind; int pageOffset; if (!GARTInit(screenNum) || (acquiredScreen != screenNum)) return FALSE; if (offset % AGP_PAGE_SIZE != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: " "offset (0x%lx) is not page-aligned (%d)\n", offset, AGP_PAGE_SIZE); return FALSE; } pageOffset = offset / AGP_PAGE_SIZE; xf86DrvMsgVerb(screenNum, X_INFO, 3, "xf86BindGARTMemory: bind key %d at 0x%08lx " "(pgoffset %d)\n", key, offset, pageOffset); bind.agpb_pgstart = pageOffset; bind.agpb_key = key; if (ioctl(gartFd, AGPIOC_BIND, &bind) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: " "binding of gart memory with key %d\n" "\tat offset 0x%lx failed (%s)\n", key, offset, strerror(errno)); return FALSE; } return TRUE; } /* Unbind GART memory with "key" */ Bool xf86UnbindGARTMemory(int screenNum, int key) { agp_unbind_t unbind; if (!GARTInit(screenNum) || (acquiredScreen != screenNum)) return FALSE; unbind.agpu_pri = 0; unbind.agpu_key = key; if (ioctl(gartFd, AGPIOC_UNBIND, &unbind) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86UnbindGARTMemory: " "unbinding of gart memory with key %d " "failed (%s)\n", key, strerror(errno)); return FALSE; } xf86DrvMsgVerb(screenNum, X_INFO, 3, "xf86UnbindGARTMemory: unbind key %d\n", key); return TRUE; } /* XXX Interface may change. */ Bool xf86EnableAGP(int screenNum, CARD32 mode) { agp_setup_t setup; if (!GARTInit(screenNum) || (acquiredScreen != screenNum)) return FALSE; setup.agps_mode = mode; if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: " "AGPIOC_SETUP with mode %x failed (%s)\n", (unsigned int) mode, strerror(errno)); return FALSE; } return TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/solaris/solaris-ia32.S0000664000175100017510000000365512160102336021064 00000000000000/ Copyright (c) 2004, Oracle and/or its affiliates. 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 (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 INLINE_ASM #define FUNCTION_START(f,n) .inline f,n #define FUNCTION_END(f) .end #else #define _ASM #include #define FUNCTION_START(f,n) ENTRY(f) #define FUNCTION_END(f) ret; SET_SIZE(f) #endif FUNCTION_START(inb,4) movl (%esp), %edx xorl %eax, %eax inb (%dx) FUNCTION_END(inb) FUNCTION_START(inw,4) movl (%esp), %edx xorl %eax, %eax inw (%dx) FUNCTION_END(inw) FUNCTION_START(inl,4) movl (%esp), %edx xorl %eax, %eax inl (%dx) FUNCTION_END(inl) FUNCTION_START(outb,8) movl (%esp), %edx movl 4(%esp), %eax outb (%dx) FUNCTION_END(outb) FUNCTION_START(outw,8) movl (%esp), %edx movl 4(%esp), %eax outw (%dx) FUNCTION_END(outw) FUNCTION_START(outl,8) movl (%esp), %edx movl 4(%esp), %eax outl (%dx) FUNCTION_END(outl) xorg-server-1.17.1/hw/xfree86/os-support/solaris/solaris-amd64.S0000664000175100017510000000363012160102336021232 00000000000000/ Copyright (c) 2005, Oracle and/or its affiliates. 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 (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 INLINE_ASM #define FUNCTION_START(f,n) .inline f,n #define FUNCTION_END(f) .end #else #define _ASM #include #define FUNCTION_START(f,n) ENTRY(f) #define FUNCTION_END(f) ret; SET_SIZE(f) #endif FUNCTION_START(inb,4) movq %rdi, %rdx xorq %rax, %rax inb (%dx) FUNCTION_END(inb) FUNCTION_START(inw,4) movq %rdi, %rdx xorq %rax, %rax inw (%dx) FUNCTION_END(inw) FUNCTION_START(inl,4) movq %rdi, %rdx xorq %rax, %rax inl (%dx) FUNCTION_END(inl) FUNCTION_START(outb,8) movq %rdi, %rdx movq %rsi, %rax outb (%dx) FUNCTION_END(outb) FUNCTION_START(outw,8) movq %rdi, %rdx movq %rsi, %rax outw (%dx) FUNCTION_END(outw) FUNCTION_START(outl,8) movq %rdi, %rdx movq %rsi, %rax outl (%dx) FUNCTION_END(outl) xorg-server-1.17.1/hw/xfree86/os-support/solaris/sun_vid.c0000664000175100017510000000775212406661137020361 00000000000000/* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany * Copyright 1993 by David Wexelblat * Copyright 1999 by David Holland * * 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 names 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. * */ /* Copyright (c) 2008, Oracle and/or its affiliates. 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 (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_XORG_CONFIG_H #include #endif #include /* get __x86 definition if not set by compiler */ #if defined(__i386__) || defined(__i386) || defined(__x86) #define _NEED_SYSI86 #endif #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" #include /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ _X_HIDDEN void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; } /***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ #if defined(__i386__) || defined(__i386) || defined(__x86) static Bool ExtendedEnabled = FALSE; #endif Bool xf86EnableIO(void) { #if defined(__i386__) || defined(__i386) || defined(__x86) if (ExtendedEnabled) return TRUE; if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) { xf86Msg(X_WARNING, "xf86EnableIOPorts: Failed to set IOPL for I/O\n"); return FALSE; } ExtendedEnabled = TRUE; #endif /* i386 */ return TRUE; } void xf86DisableIO(void) { #if defined(__i386__) || defined(__i386) || defined(__x86) if (!ExtendedEnabled) return; sysi86(SI86V86, V86SC_IOPL, 0); ExtendedEnabled = FALSE; #endif /* i386 */ } xorg-server-1.17.1/hw/xfree86/os-support/solaris/Makefile.in0000664000175100017510000011434512466505433020612 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/os-support/solaris DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libsolaris_la_LIBADD = am__libsolaris_la_SOURCES_DIST = sun_init.c sun_vid.c sun_bell.c \ $(srcdir)/../shared/agp_noop.c sun_agp.c sun_apm.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/posix_tty.c $(srcdir)/../shared/sigio.c \ $(srcdir)/../shared/vidmem.c $(srcdir)/../shared/VTsw_noop.c \ sun_VTsw.c @AGP_FALSE@am__objects_1 = agp_noop.lo @AGP_TRUE@am__objects_1 = sun_agp.lo @SOLARIS_VT_FALSE@am__objects_2 = VTsw_noop.lo @SOLARIS_VT_TRUE@am__objects_2 = sun_VTsw.lo am_libsolaris_la_OBJECTS = sun_init.lo sun_vid.lo sun_bell.lo \ $(am__objects_1) sun_apm.lo kmod_noop.lo posix_tty.lo sigio.lo \ vidmem.lo $(am__objects_2) am__objects_3 = solaris-@SOLARIS_INOUT_ARCH@.lo nodist_libsolaris_la_OBJECTS = $(am__objects_3) libsolaris_la_OBJECTS = $(am_libsolaris_la_OBJECTS) \ $(nodist_libsolaris_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 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CCASFLAGS) $(CCASFLAGS) AM_V_CPPAS = $(am__v_CPPAS_@AM_V@) am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@) am__v_CPPAS_0 = @echo " CPPAS " $@; am__v_CPPAS_1 = 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 = $(libsolaris_la_SOURCES) $(nodist_libsolaris_la_SOURCES) DIST_SOURCES = $(am__libsolaris_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 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)" "$(DESTDIR)$(sdkdir)" HEADERS = $(nodist_sdk_HEADERS) $(sdk_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @SOLARIS_VT_FALSE@VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c @SOLARIS_VT_TRUE@VTSW_SRC = sun_VTsw.c @AGP_FALSE@AGP_SRC = $(srcdir)/../shared/agp_noop.c @AGP_TRUE@AGP_SRC = sun_agp.c SOLARIS_INOUT_SRC = solaris-@SOLARIS_INOUT_ARCH@.S DISTCLEANFILES = solaris-@SOLARIS_INOUT_ARCH@.il noinst_LTLIBRARIES = libsolaris.la libsolaris_la_SOURCES = sun_init.c \ sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ $(srcdir)/../shared/vidmem.c \ $(VTSW_SRC) nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) sdk_HEADERS = nodist_sdk_HEADERS = solaris-@SOLARIS_INOUT_ARCH@.il AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \ apSolaris.shar sun_inout.s all: all-am .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj $(srcdir)/Makefile.in: $(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/os-support/solaris/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/solaris/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libsolaris.la: $(libsolaris_la_OBJECTS) $(libsolaris_la_DEPENDENCIES) $(EXTRA_libsolaris_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libsolaris_la_OBJECTS) $(libsolaris_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agp_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmod_noop.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solaris-@SOLARIS_INOUT_ARCH@.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_VTsw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_agp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_apm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_vid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.Plo@am__quote@ .S.o: @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $< .S.obj: @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .S.lo: @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $< .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 -o $@ $< .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 -o $@ `$(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 $@ $< agp_noop.lo: $(srcdir)/../shared/agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT agp_noop.lo -MD -MP -MF $(DEPDIR)/agp_noop.Tpo -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/agp_noop.Tpo $(DEPDIR)/agp_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/agp_noop.c' object='agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c kmod_noop.lo: $(srcdir)/../shared/kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT kmod_noop.lo -MD -MP -MF $(DEPDIR)/kmod_noop.Tpo -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/kmod_noop.Tpo $(DEPDIR)/kmod_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/kmod_noop.c' object='kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c posix_tty.lo: $(srcdir)/../shared/posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -MT posix_tty.lo -MD -MP -MF $(DEPDIR)/posix_tty.Tpo -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/posix_tty.Tpo $(DEPDIR)/posix_tty.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/posix_tty.c' object='posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c sigio.lo: $(srcdir)/../shared/sigio.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) $(AM_CFLAGS) $(CFLAGS) -MT sigio.lo -MD -MP -MF $(DEPDIR)/sigio.Tpo -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sigio.Tpo $(DEPDIR)/sigio.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/sigio.c' object='sigio.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) $(AM_CFLAGS) $(CFLAGS) -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c vidmem.lo: $(srcdir)/../shared/vidmem.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) $(AM_CFLAGS) $(CFLAGS) -MT vidmem.lo -MD -MP -MF $(DEPDIR)/vidmem.Tpo -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vidmem.Tpo $(DEPDIR)/vidmem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/vidmem.c' object='vidmem.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) $(AM_CFLAGS) $(CFLAGS) -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c VTsw_noop.lo: $(srcdir)/../shared/VTsw_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT VTsw_noop.lo -MD -MP -MF $(DEPDIR)/VTsw_noop.Tpo -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/VTsw_noop.Tpo $(DEPDIR)/VTsw_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/VTsw_noop.c' object='VTsw_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_sdkHEADERS: $(nodist_sdk_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_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-nodist_sdkHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_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) 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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(sdkdir)" "$(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-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-nodist_sdkHEADERS 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-nodist_sdkHEADERS uninstall-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-nodist_sdkHEADERS \ 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 tags-am uninstall \ uninstall-am uninstall-nodist_sdkHEADERS uninstall-sdkHEADERS solaris-@SOLARIS_INOUT_ARCH@.il: solaris-@SOLARIS_INOUT_ARCH@.S $(CPP) -P -DINLINE_ASM $(srcdir)/solaris-@SOLARIS_INOUT_ARCH@.S > $@ # 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: xorg-server-1.17.1/hw/xfree86/os-support/solaris/sun_apm.c0000664000175100017510000001602712456571574020361 00000000000000/* Based on hw/xfree86/os-support/bsd/bsd_apm.c which bore no explicit * copyright notice, so is covered by the following notice: * * 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, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project shall * not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from the * XFree86 Project. */ /* Copyright (c) 2005, Oracle and/or its affiliates. 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 (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_XORG_CONFIG_H #include #endif #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" #include "xf86_OSlib.h" #ifndef PLEASE_FIX_THIS #define APM_STANDBY_REQ 0xa01 #define APM_SUSPEND_REQ 0xa02 #define APM_NORMAL_RESUME 0xa03 #define APM_CRIT_RESUME 0xa04 #define APM_BATTERY_LOW 0xa05 #define APM_POWER_CHANGE 0xa06 #define APM_UPDATE_TIME 0xa07 #define APM_CRIT_SUSPEND_REQ 0xa08 #define APM_USER_STANDBY_REQ 0xa09 #define APM_USER_SUSPEND_REQ 0xa0a #define APM_SYS_STANDBY_RESUME 0xa0b #define APM_IOC_NEXTEVENT 0xa0c #define APM_IOC_RESUME 0xa0d #define APM_IOC_SUSPEND 0xa0e #define APM_IOC_STANDBY 0xa0f #endif typedef struct apm_event_info { int type; } apm_event_info; /* This may be replaced with a better device name very soon... */ #define APM_DEVICE "/dev/srn" #define APM_DEVICE1 "/dev/apm" static void *APMihPtr = NULL; static void sunCloseAPM(void); 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}, #ifdef APM_CAPABILITY_CHANGE {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; #define numApmEvents (sizeof(sunToXF86Array) / sizeof(sunToXF86Array[0])) static pmEvent sunToXF86(int type) { int i; for (i = 0; i < numApmEvents; i++) { if (type == sunToXF86Array[i].apmBsd) { return sunToXF86Array[i].xf86; } } return XF86_APM_UNKNOWN; } /* * APM events can be requested direclty from /dev/apm */ static int sunPMGetEventFromOS(int fd, pmEvent * events, int num) { struct apm_event_info sunEvent; int i; for (i = 0; i < num; i++) { if (ioctl(fd, APM_IOC_NEXTEVENT, &sunEvent) < 0) { if (errno != EAGAIN) { xf86Msg(X_WARNING, "sunPMGetEventFromOS: APM_IOC_NEXTEVENT" " %s\n", strerror(errno)); } break; } events[i] = sunToXF86(sunEvent.type); } xf86Msg(X_WARNING, "Got some events\n"); return i; } static pmWait sunPMConfirmEventToOs(int fd, pmEvent event) { switch (event) { /* XXX: NOT CURRENTLY RETURNED FROM OS */ case XF86_APM_SYS_STANDBY: case XF86_APM_USER_STANDBY: if (ioctl(fd, APM_IOC_STANDBY, NULL) == 0) return PM_WAIT; /* should we stop the Xserver in standby, too? */ else return PM_NONE; case XF86_APM_SYS_SUSPEND: case XF86_APM_CRITICAL_SUSPEND: case XF86_APM_USER_SUSPEND: xf86Msg(X_WARNING, "Got SUSPENDED\n"); if (ioctl(fd, APM_IOC_SUSPEND, NULL) == 0) return PM_CONTINUE; else { xf86Msg(X_WARNING, "sunPMConfirmEventToOs: APM_IOC_SUSPEND" " %s\n", strerror(errno)); return PM_FAILED; } case XF86_APM_STANDBY_RESUME: case XF86_APM_NORMAL_RESUME: case XF86_APM_CRITICAL_RESUME: case XF86_APM_STANDBY_FAILED: case XF86_APM_SUSPEND_FAILED: xf86Msg(X_WARNING, "Got RESUME\n"); if (ioctl(fd, APM_IOC_RESUME, NULL) == 0) return PM_CONTINUE; else { xf86Msg(X_WARNING, "sunPMConfirmEventToOs: APM_IOC_RESUME" " %s\n", strerror(errno)); return PM_FAILED; } default: return PM_NONE; } } PMClose xf86OSPMOpen(void) { int fd; if (APMihPtr || !xf86Info.pmFlag) { return NULL; } if ((fd = open(APM_DEVICE, O_RDWR)) == -1) { if ((fd = open(APM_DEVICE1, O_RDWR)) == -1) { return NULL; } } xf86PMGetEventFromOs = sunPMGetEventFromOS; xf86PMConfirmEventToOs = sunPMConfirmEventToOs; APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL); return sunCloseAPM; } static void sunCloseAPM(void) { int fd; if (APMihPtr) { fd = xf86RemoveGeneralHandler(APMihPtr); close(fd); APMihPtr = NULL; } } xorg-server-1.17.1/hw/xfree86/os-support/bus/0000775000175100017510000000000012466505445015735 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/bus/Makefile.am0000664000175100017510000000063212200102654017667 00000000000000noinst_LTLIBRARIES = libbus.la sdk_HEADERS = xf86Pci.h PCI_SOURCES = if XORG_BUS_PCI PCI_SOURCES += Pci.c Pci.h endif if XORG_BUS_BSDPCI PCI_SOURCES += bsd_pci.c endif if XORG_BUS_SPARC PLATFORM_SOURCES = Sbus.c sdk_HEADERS += xf86Sbus.h endif libbus_la_SOURCES = $(PCI_SOURCES) $(PLATFORM_SOURCES) nobus.c AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) EXTRA_DIST = $(sdk_HEADERS) xorg-server-1.17.1/hw/xfree86/os-support/bus/bsd_pci.c0000664000175100017510000000331312366220413017410 00000000000000/* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Eric Anholt * */ /** * @file bsd_pci.c * * This is a trivial implementation of the remaining PCI support hooks in the * X Server that is unaware of domains. * * Most of even this should go away once drivers are converted and the * old interfaces are confirmed to all be obsolete. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "compiler.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "Pci.h" #include "pciaccess.h" void osPciInit(void) { xf86InitVidMem(); } xorg-server-1.17.1/hw/xfree86/os-support/bus/xf86Sbus.h0000664000175100017510000000401612274325511017446 00000000000000/* * Platform specific SBUS and OpenPROM access declarations. * * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com) * * 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 * JAKUB JELINEK 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_XORG_CONFIG_H #include #endif #ifndef _XF86_SBUS_H #define _XF86_SBUS_H #if defined(linux) #include #include #include #include #elif defined(SVR4) #include #include #elif defined(__OpenBSD__) && defined(__sparc64__) /* XXX */ #elif defined(CSRG_BASED) #if defined(__FreeBSD__) #include #include #include #else #include #endif #else #include #endif #ifndef FBTYPE_SUNGP3 #define FBTYPE_SUNGP3 -1 #endif #ifndef FBTYPE_MDICOLOR #define FBTYPE_MDICOLOR -1 #endif #ifndef FBTYPE_SUNLEO #define FBTYPE_SUNLEO -1 #endif #ifndef FBTYPE_TCXCOLOR #define FBTYPE_TCXCOLOR -1 #endif #ifndef FBTYPE_CREATOR #define FBTYPE_CREATOR -1 #endif #endif /* _XF86_SBUS_H */ xorg-server-1.17.1/hw/xfree86/os-support/bus/Pci.c0000664000175100017510000001573412366220413016532 00000000000000/* * Copyright 1998 by Concurrent Computer Corporation * * 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 Concurrent Computer * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Concurrent Computer Corporation makes no representations * about the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. * * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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. * * Copyright 1998 by Metro Link Incorporated * * 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 Metro Link * Incorporated not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Metro Link Incorporated makes no representations * about the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. * * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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. * * This software is derived from the original XFree86 PCI code * which includes the following copyright notices as well: * * Copyright 1995 by Robin Cutshaw * * 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 names of the above listed copyright holder(s) * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed * copyright holder(s) make(s) no representations about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. * * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. * * This code is also based heavily on the code in FreeBSD-current, which was * written by Wolfgang Stanglmeier, and contains the following copyright: * * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR 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. * */ /* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "Pci.h" Bool xf86scanpci(void) { Bool success = FALSE; success = (pci_system_init() == 0); /* choose correct platform/OS specific PCI init routine */ osPciInit(); return success; } xorg-server-1.17.1/hw/xfree86/os-support/bus/Makefile.in0000664000175100017510000006706612466505433017736 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @XORG_BUS_PCI_TRUE@am__append_1 = Pci.c Pci.h @XORG_BUS_BSDPCI_TRUE@am__append_2 = bsd_pci.c @XORG_BUS_SPARC_TRUE@am__append_3 = xf86Sbus.h subdir = hw/xfree86/os-support/bus DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__sdk_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libbus_la_LIBADD = am__libbus_la_SOURCES_DIST = Pci.c Pci.h bsd_pci.c Sbus.c nobus.c @XORG_BUS_PCI_TRUE@am__objects_1 = Pci.lo @XORG_BUS_BSDPCI_TRUE@am__objects_2 = bsd_pci.lo am__objects_3 = $(am__objects_1) $(am__objects_2) @XORG_BUS_SPARC_TRUE@am__objects_4 = Sbus.lo am_libbus_la_OBJECTS = $(am__objects_3) $(am__objects_4) nobus.lo libbus_la_OBJECTS = $(am_libbus_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 = $(libbus_la_SOURCES) DIST_SOURCES = $(am__libbus_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 am__sdk_HEADERS_DIST = xf86Pci.h xf86Sbus.h 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libbus.la sdk_HEADERS = xf86Pci.h $(am__append_3) PCI_SOURCES = $(am__append_1) $(am__append_2) @XORG_BUS_SPARC_TRUE@PLATFORM_SOURCES = Sbus.c libbus_la_SOURCES = $(PCI_SOURCES) $(PLATFORM_SOURCES) nobus.c AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) EXTRA_DIST = $(sdk_HEADERS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/os-support/bus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/bus/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libbus.la: $(libbus_la_OBJECTS) $(libbus_la_DEPENDENCIES) $(EXTRA_libbus_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libbus_la_OBJECTS) $(libbus_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Pci.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Sbus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_pci.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nobus.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/xfree86/os-support/bus/Pci.h0000664000175100017510000001476212274325511016542 00000000000000/* * Copyright 1998 by Concurrent Computer Corporation * * 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 Concurrent Computer * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Concurrent Computer Corporation makes no representations * about the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. * * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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. * * Copyright 1998 by Metro Link Incorporated * * 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 Metro Link * Incorporated not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Metro Link Incorporated makes no representations * about the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. * * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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. * * This file is derived in part from the original xf86_PCI.h that included * following copyright message: * * Copyright 1995 by Robin Cutshaw * * 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 names of the above listed copyright holder(s) * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed * copyright holder(s) make(s) no representations about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. * * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. * */ /* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file has the private Pci definitions. The public ones are imported * from xf86Pci.h. Drivers should not use this file. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _PCI_H #define _PCI_H 1 #include "xf86Pci.h" /* * Global Definitions */ #if (defined(__alpha__) || defined(__ia64__)) && defined (linux) #define PCI_DOM_MASK 0x01fful #else #define PCI_DOM_MASK 0x0ffu #endif #ifndef PCI_DOM_MASK #define PCI_DOM_MASK 0x0ffu #endif #define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu) /* * "b" contains an optional domain number. */ #define PCI_MAKE_TAG(b,d,f) ((((b) & (PCI_DOMBUS_MASK)) << 16) | \ (((d) & 0x00001fu) << 11) | \ (((f) & 0x000007u) << 8)) #define PCI_MAKE_BUS(d,b) ((((d) & (PCI_DOM_MASK)) << 8) | ((b) & 0xffu)) #define PCI_DOM_FROM_BUS(bus) (((bus) >> 8) & (PCI_DOM_MASK)) #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu) #define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u) #if defined(linux) #define osPciInit(x) do {} while (0) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || \ defined(__DragonFly__) || defined(__sun) || defined(__GNU__) extern void osPciInit(void); #else #error No PCI support available for this architecture/OS combination #endif #endif /* _PCI_H */ xorg-server-1.17.1/hw/xfree86/os-support/bus/Sbus.c0000664000175100017510000005041312366220413016724 00000000000000/* * SBUS and OpenPROM access functions. * * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com) * * 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 * JAKUB JELINEK 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_XORG_CONFIG_H #include #endif #include #include #include #include #include #include #ifdef sun #include #endif #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86sbusBus.h" #include "xf86Sbus.h" int promRootNode; static int promFd = -1; static int promCurrentNode; static int promOpenCount = 0; static int promP1275 = -1; #define MAX_PROP 128 #define MAX_VAL (4096-128-4) static struct openpromio *promOpio; sbusDevicePtr *xf86SbusInfo = NULL; struct sbus_devtable sbusDeviceTable[] = { {SBUS_DEVICE_BW2, FBTYPE_SUN2BW, "bwtwo", "sunbw2", "Sun Monochrome (bwtwo)"}, {SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, "cgtwo", NULL, "Sun Color2 (cgtwo)"}, {SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, "cgthree", "suncg3", "Sun Color3 (cgthree)"}, {SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, "cgfour", NULL, "Sun Color4 (cgfour)"}, {SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, "cgsix", "suncg6", "Sun GX"}, {SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, "cgeight", NULL, "Sun CG8/RasterOps"}, {SBUS_DEVICE_CG12, FBTYPE_SUNGP3, "cgtwelve", NULL, "Sun GS (cgtwelve)"}, {SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, "cgfourteen", "suncg14", "Sun SX"}, {SBUS_DEVICE_GT, FBTYPE_SUNGT, "gt", NULL, "Sun Graphics Tower"}, {SBUS_DEVICE_MGX, -1, "mgx", NULL, "Quantum 3D MGXplus"}, {SBUS_DEVICE_LEO, FBTYPE_SUNLEO, "leo", "sunleo", "Sun ZX or Turbo ZX"}, {SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, "tcx", "suntcx", "Sun TCX"}, {SBUS_DEVICE_FFB, FBTYPE_CREATOR, "ffb", "sunffb", "Sun FFB"}, {SBUS_DEVICE_FFB, FBTYPE_CREATOR, "afb", "sunffb", "Sun Elite3D"}, {0, 0, NULL} }; int promGetSibling(int node) { promOpio->oprom_size = sizeof(int); if (node == -1) return 0; *(int *) promOpio->oprom_array = node; if (ioctl(promFd, OPROMNEXT, promOpio) < 0) return 0; promCurrentNode = *(int *) promOpio->oprom_array; return *(int *) promOpio->oprom_array; } int promGetChild(int node) { promOpio->oprom_size = sizeof(int); if (!node || node == -1) return 0; *(int *) promOpio->oprom_array = node; if (ioctl(promFd, OPROMCHILD, promOpio) < 0) return 0; promCurrentNode = *(int *) promOpio->oprom_array; return *(int *) promOpio->oprom_array; } char * promGetProperty(const char *prop, int *lenp) { promOpio->oprom_size = MAX_VAL; strcpy(promOpio->oprom_array, prop); if (ioctl(promFd, OPROMGETPROP, promOpio) < 0) return 0; if (lenp) *lenp = promOpio->oprom_size; return promOpio->oprom_array; } int promGetBool(const char *prop) { promOpio->oprom_size = 0; *(int *) promOpio->oprom_array = 0; for (;;) { promOpio->oprom_size = MAX_PROP; if (ioctl(promFd, OPROMNXTPROP, promOpio) < 0) return 0; if (!promOpio->oprom_size) return 0; if (!strcmp(promOpio->oprom_array, prop)) return 1; } } #define PROM_NODE_SIBLING 0x01 #define PROM_NODE_PREF 0x02 #define PROM_NODE_SBUS 0x04 #define PROM_NODE_EBUS 0x08 #define PROM_NODE_PCI 0x10 static int promSetNode(sbusPromNodePtr pnode) { int node; if (!pnode->node || pnode->node == -1) return -1; if (pnode->cookie[0] & PROM_NODE_SIBLING) node = promGetSibling(pnode->cookie[1]); else node = promGetChild(pnode->cookie[1]); if (pnode->node != node) return -1; return 0; } static void promIsP1275(void) { #ifdef linux FILE *f; char buffer[1024]; if (promP1275 != -1) return; promP1275 = 0; f = fopen("/proc/cpuinfo", "r"); if (!f) return; while (fgets(buffer, 1024, f) != NULL) if (!strncmp(buffer, "type", 4) && strstr(buffer, "sun4u")) { promP1275 = 1; break; } fclose(f); #elif defined(sun) struct utsname buffer; if ((uname(&buffer) >= 0) && !strcmp(buffer.machine, "sun4u")) promP1275 = TRUE; else promP1275 = FALSE; #elif defined(__FreeBSD__) promP1275 = TRUE; #else #error Missing promIsP1275() function for this OS #endif } void sparcPromClose(void) { if (promOpenCount > 1) { promOpenCount--; return; } if (promFd != -1) { close(promFd); promFd = -1; } free(promOpio); promOpio = NULL; promOpenCount = 0; } int sparcPromInit(void) { if (promOpenCount) { promOpenCount++; return 0; } promFd = open("/dev/openprom", O_RDONLY, 0); if (promFd == -1) return -1; promOpio = (struct openpromio *) malloc(4096); if (!promOpio) { sparcPromClose(); return -1; } promRootNode = promGetSibling(0); if (!promRootNode) { sparcPromClose(); return -1; } promIsP1275(); promOpenCount++; return 0; } char * sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp) { if (promSetNode(pnode)) return NULL; return promGetProperty(prop, lenp); } int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop) { if (promSetNode(pnode)) return 0; return promGetBool(prop); } static char * promWalkGetDriverName(int node, int oldnode) { int nextnode; int len; char *prop; int devId, i; prop = promGetProperty("device_type", &len); if (prop && (len > 0)) do { if (!strcmp(prop, "display")) { prop = promGetProperty("name", &len); if (!prop || len <= 0) break; while ((*prop >= 'A' && *prop <= 'Z') || *prop == ',') prop++; for (i = 0; sbusDeviceTable[i].devId; i++) if (!strcmp(prop, sbusDeviceTable[i].promName)) break; devId = sbusDeviceTable[i].devId; if (!devId) break; if (sbusDeviceTable[i].driverName) return sbusDeviceTable[i].driverName; } } while (0); nextnode = promGetChild(node); if (nextnode) { char *name; name = promWalkGetDriverName(nextnode, node); if (name) return name; } nextnode = promGetSibling(node); if (nextnode) return promWalkGetDriverName(nextnode, node); return NULL; } char * sparcDriverName(void) { char *name; if (sparcPromInit() < 0) return NULL; promGetSibling(0); name = promWalkGetDriverName(promRootNode, 0); sparcPromClose(); return name; } static void promWalkAssignNodes(int node, int oldnode, int flags, sbusDevicePtr * devicePtrs) { int nextnode; int len, sbus = flags & PROM_NODE_SBUS; char *prop; int devId, i, j; sbusPromNode pNode, pNode2; prop = promGetProperty("device_type", &len); if (prop && (len > 0)) do { if (!strcmp(prop, "display")) { prop = promGetProperty("name", &len); if (!prop || len <= 0) break; while ((*prop >= 'A' && *prop <= 'Z') || *prop == ',') prop++; for (i = 0; sbusDeviceTable[i].devId; i++) if (!strcmp(prop, sbusDeviceTable[i].promName)) break; devId = sbusDeviceTable[i].devId; if (!devId) break; if (!sbus) { if (devId == SBUS_DEVICE_FFB) { /* * All /SUNW,ffb outside of SBUS tree come before all * /SUNW,afb outside of SBUS tree in Linux. */ if (!strcmp(prop, "afb")) flags |= PROM_NODE_PREF; } else if (devId != SBUS_DEVICE_CG14) break; } for (i = 0; i < 32; i++) { if (!devicePtrs[i] || devicePtrs[i]->devId != devId) continue; if (devicePtrs[i]->node.node) { if ((devicePtrs[i]->node. cookie[0] & ~PROM_NODE_SIBLING) <= (flags & ~PROM_NODE_SIBLING)) continue; for (j = i + 1, pNode = devicePtrs[i]->node; j < 32; j++) { if (!devicePtrs[j] || devicePtrs[j]->devId != devId) continue; pNode2 = devicePtrs[j]->node; devicePtrs[j]->node = pNode; pNode = pNode2; } } devicePtrs[i]->node.node = node; devicePtrs[i]->node.cookie[0] = flags; devicePtrs[i]->node.cookie[1] = oldnode; break; } break; } } while (0); prop = promGetProperty("name", &len); if (prop && len > 0) { if (!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) sbus = PROM_NODE_SBUS; } nextnode = promGetChild(node); if (nextnode) promWalkAssignNodes(nextnode, node, sbus, devicePtrs); nextnode = promGetSibling(node); if (nextnode) promWalkAssignNodes(nextnode, node, PROM_NODE_SIBLING | sbus, devicePtrs); } void sparcPromAssignNodes(void) { sbusDevicePtr psdp, *psdpp; int n, holes = 0, i, j; FILE *f; sbusDevicePtr devicePtrs[32]; memset(devicePtrs, 0, sizeof(devicePtrs)); for (psdpp = xf86SbusInfo, n = 0; (psdp = *psdpp); psdpp++, n++) { if (psdp->fbNum != n) holes = 1; devicePtrs[psdp->fbNum] = psdp; } if (holes && (f = fopen("/proc/fb", "r")) != NULL) { /* We could not open one of fb devices, check /proc/fb to see what * were the types of the cards missed. */ char buffer[64]; int fbNum, devId; static struct { 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}, }; while (fscanf(f, "%d %63s\n", &fbNum, buffer) == 2) { for (i = 0; procFbPrefixes[i].devId; i++) if (!strncmp(procFbPrefixes[i].prefix, buffer, strlen(procFbPrefixes[i].prefix))) break; devId = procFbPrefixes[i].devId; if (!devId) continue; if (devicePtrs[fbNum]) { if (devicePtrs[fbNum]->devId != devId) xf86ErrorF("Inconsistent /proc/fb with FBIOGATTR\n"); } else if (!devicePtrs[fbNum]) { devicePtrs[fbNum] = psdp = xnfcalloc(sizeof(sbusDevice), 1); psdp->devId = devId; psdp->fbNum = fbNum; psdp->fd = -2; } } fclose(f); } promGetSibling(0); promWalkAssignNodes(promRootNode, 0, PROM_NODE_PREF, devicePtrs); for (i = 0, j = 0; i < 32; i++) if (devicePtrs[i] && devicePtrs[i]->fbNum == -1) j++; xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (n + j + 1)); for (i = 0, psdpp = xf86SbusInfo; i < 32; i++) if (devicePtrs[i]) { if (devicePtrs[i]->fbNum == -1) { memmove(psdpp + 1, psdpp, sizeof(psdpp) * (n + 1)); *psdpp = devicePtrs[i]; } else n--; } } static char * promGetReg(int type) { char *prop; int len; static char regstr[40]; regstr[0] = 0; prop = promGetProperty("reg", &len); if (prop && len >= 4) { unsigned int *reg = (unsigned int *) prop; if (!promP1275 || (type == PROM_NODE_SBUS) || (type == PROM_NODE_EBUS)) snprintf(regstr, sizeof(regstr), "@%x,%x", reg[0], reg[1]); else if (type == PROM_NODE_PCI) { if ((reg[0] >> 8) & 7) snprintf(regstr, sizeof(regstr), "@%x,%x", (reg[0] >> 11) & 0x1f, (reg[0] >> 8) & 7); else snprintf(regstr, sizeof(regstr), "@%x", (reg[0] >> 11) & 0x1f); } else if (len == 4) snprintf(regstr, sizeof(regstr), "@%x", reg[0]); else { unsigned int regs[2]; /* Things get more complicated on UPA. If upa-portid exists, then address is @upa-portid,second-int-in-reg, otherwise it is @first-int-in-reg/16,second-int-in-reg (well, probably upa-portid always exists, but just to be safe). */ memcpy(regs, reg, sizeof(regs)); prop = promGetProperty("upa-portid", &len); if (prop && len == 4) { reg = (unsigned int *) prop; snprintf(regstr, sizeof(regstr), "@%x,%x", reg[0], regs[1]); } else snprintf(regstr, sizeof(regstr), "@%x,%x", regs[0] >> 4, regs[1]); } } return regstr; } static int promWalkNode2Pathname(char *path, int parent, int node, int searchNode, int type) { int nextnode; int len, ntype = type; char *prop, *p; prop = promGetProperty("name", &len); *path = '/'; if (!prop || len <= 0) return 0; if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type) ntype = PROM_NODE_SBUS; else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI) ntype = PROM_NODE_EBUS; else if (!strcmp(prop, "pci") && !type) ntype = PROM_NODE_PCI; strcpy(path + 1, prop); p = promGetReg(type); if (*p) strcat(path, p); if (node == searchNode) return 1; nextnode = promGetChild(node); if (nextnode && promWalkNode2Pathname(strchr(path, 0), node, nextnode, searchNode, ntype)) return 1; nextnode = promGetSibling(node); if (nextnode && promWalkNode2Pathname(path, parent, nextnode, searchNode, type)) return 1; return 0; } char * sparcPromNode2Pathname(sbusPromNodePtr pnode) { char *ret; if (!pnode->node) return NULL; ret = malloc(4096); if (!ret) return NULL; if (promWalkNode2Pathname (ret, promRootNode, promGetChild(promRootNode), pnode->node, 0)) return ret; free(ret); return NULL; } static int promWalkPathname2Node(char *name, char *regstr, int parent, int type) { int len, node, ret; char *prop, *p; for (;;) { prop = promGetProperty("name", &len); if (!prop || len <= 0) return 0; if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type) type = PROM_NODE_SBUS; else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI) type = PROM_NODE_EBUS; else if (!strcmp(prop, "pci") && !type) type = PROM_NODE_PCI; for (node = promGetChild(parent); node; node = promGetSibling(node)) { prop = promGetProperty("name", &len); if (!prop || len <= 0) continue; if (*name && strcmp(name, prop)) continue; if (*regstr) { p = promGetReg(type); if (!*p || strcmp(p + 1, regstr)) continue; } break; } if (!node) { for (node = promGetChild(parent); node; node = promGetSibling(node)) { ret = promWalkPathname2Node(name, regstr, node, type); if (ret) return ret; } return 0; } name = strchr(regstr, 0) + 1; if (!*name) return node; p = strchr(name, '/'); if (p) *p = 0; else p = strchr(name, 0); regstr = strchr(name, '@'); if (regstr) *regstr++ = 0; else regstr = p; if (name == regstr) return 0; parent = node; } } int sparcPromPathname2Node(const char *pathName) { int i; char *name, *regstr, *p; i = strlen(pathName); name = malloc(i + 2); if (!name) return 0; strcpy(name, pathName); name[i + 1] = 0; if (name[0] != '/') { free(name); return 0; } p = strchr(name + 1, '/'); if (p) *p = 0; else p = strchr(name, 0); regstr = strchr(name, '@'); if (regstr) *regstr++ = 0; else regstr = p; if (name + 1 == regstr) { free(name); return 0; } promGetSibling(0); i = promWalkPathname2Node(name + 1, regstr, promRootNode, 0); free(name); return i; } void * xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size) { void *ret; unsigned long pagemask = getpagesize() - 1; unsigned long off = offset & ~pagemask; unsigned long len = ((offset + size + pagemask) & ~pagemask) - off; if (psdp->fd == -1) { psdp->fd = open(psdp->device, O_RDWR); if (psdp->fd == -1) return NULL; } else if (psdp->fd < 0) return NULL; ret = (void *) mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, psdp->fd, off); if (ret == (void *) -1) { ret = (void *) mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, psdp->fd, off); } if (ret == (void *) -1) return NULL; return (char *) ret + (offset - off); } void xf86UnmapSbusMem(sbusDevicePtr psdp, void *addr, unsigned long size) { unsigned long mask = getpagesize() - 1; unsigned long base = (unsigned long) addr & ~mask; unsigned long len = (((unsigned long) addr + size + mask) & ~mask) - base; munmap((void *) base, len); } /* Tell OS that we are driving the HW cursor ourselves. */ void xf86SbusHideOsHwCursor(sbusDevicePtr psdp) { struct fbcursor fbcursor; unsigned char zeros[8]; memset(&fbcursor, 0, sizeof(fbcursor)); memset(&zeros, 0, sizeof(zeros)); fbcursor.cmap.count = 2; fbcursor.cmap.red = zeros; fbcursor.cmap.green = zeros; fbcursor.cmap.blue = zeros; fbcursor.image = (char *) zeros; fbcursor.mask = (char *) zeros; fbcursor.size.x = 32; fbcursor.size.y = 1; fbcursor.set = FB_CUR_SETALL; ioctl(psdp->fd, FBIOSCURSOR, &fbcursor); } /* Set HW cursor colormap. */ void xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg) { struct fbcursor fbcursor; unsigned char red[2], green[2], blue[2]; memset(&fbcursor, 0, sizeof(fbcursor)); red[0] = bg >> 16; green[0] = bg >> 8; blue[0] = bg; red[1] = fg >> 16; green[1] = fg >> 8; blue[1] = fg; fbcursor.cmap.count = 2; fbcursor.cmap.red = red; fbcursor.cmap.green = green; fbcursor.cmap.blue = blue; fbcursor.set = FB_CUR_SETCMAP; ioctl(psdp->fd, FBIOSCURSOR, &fbcursor); } xorg-server-1.17.1/hw/xfree86/os-support/bus/xf86Pci.h0000664000175100017510000002235712366751547017273 00000000000000/* * Copyright 1998 by Concurrent Computer Corporation * * 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 Concurrent Computer * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Concurrent Computer Corporation makes no representations * about the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. * * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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. * * Copyright 1998 by Metro Link Incorporated * * 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 Metro Link * Incorporated not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Metro Link Incorporated makes no representations * about the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. * * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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. * * This file is derived in part from the original xf86_PCI.h that included * following copyright message: * * Copyright 1995 by Robin Cutshaw * * 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 names of the above listed copyright holder(s) * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed * copyright holder(s) make(s) no representations about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. * * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. * */ /* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * This file contains just the public interface to the PCI code. * Drivers should use this file rather than Pci.h. */ #ifndef _XF86PCI_H #define _XF86PCI_H 1 #include #include #include "misc.h" #include /* * PCI cfg space definitions (e.g. stuff right out of the PCI spec) */ /* Device identification register */ #define PCI_ID_REG 0x00 /* Command and status register */ #define PCI_CMD_STAT_REG 0x04 #define PCI_CMD_BASE_REG 0x10 #define PCI_CMD_BIOS_REG 0x30 #define PCI_CMD_MASK 0xffff #define PCI_CMD_IO_ENABLE 0x01 #define PCI_CMD_MEM_ENABLE 0x02 #define PCI_CMD_MASTER_ENABLE 0x04 #define PCI_CMD_SPECIAL_ENABLE 0x08 #define PCI_CMD_INVALIDATE_ENABLE 0x10 #define PCI_CMD_PALETTE_ENABLE 0x20 #define PCI_CMD_PARITY_ENABLE 0x40 #define PCI_CMD_STEPPING_ENABLE 0x80 #define PCI_CMD_SERR_ENABLE 0x100 #define PCI_CMD_BACKTOBACK_ENABLE 0x200 #define PCI_CMD_BIOS_ENABLE 0x01 /* base class */ #define PCI_CLASS_REG 0x08 #define PCI_CLASS_MASK 0xff000000 #define PCI_CLASS_SHIFT 24 #define PCI_CLASS_EXTRACT(x) \ (((x) & PCI_CLASS_MASK) >> PCI_CLASS_SHIFT) /* base class values */ #define PCI_CLASS_PREHISTORIC 0x00 #define PCI_CLASS_MASS_STORAGE 0x01 #define PCI_CLASS_NETWORK 0x02 #define PCI_CLASS_DISPLAY 0x03 #define PCI_CLASS_MULTIMEDIA 0x04 #define PCI_CLASS_MEMORY 0x05 #define PCI_CLASS_BRIDGE 0x06 #define PCI_CLASS_COMMUNICATIONS 0x07 #define PCI_CLASS_SYSPERIPH 0x08 #define PCI_CLASS_INPUT 0x09 #define PCI_CLASS_DOCKING 0x0a #define PCI_CLASS_PROCESSOR 0x0b #define PCI_CLASS_SERIALBUS 0x0c #define PCI_CLASS_WIRELESS 0x0d #define PCI_CLASS_I2O 0x0e #define PCI_CLASS_SATELLITE 0x0f #define PCI_CLASS_CRYPT 0x10 #define PCI_CLASS_DATA_ACQUISTION 0x11 #define PCI_CLASS_UNDEFINED 0xff /* sub class */ #define PCI_SUBCLASS_MASK 0x00ff0000 #define PCI_SUBCLASS_SHIFT 16 #define PCI_SUBCLASS_EXTRACT(x) \ (((x) & PCI_SUBCLASS_MASK) >> PCI_SUBCLASS_SHIFT) /* Sub class values */ /* 0x00 prehistoric subclasses */ #define PCI_SUBCLASS_PREHISTORIC_MISC 0x00 #define PCI_SUBCLASS_PREHISTORIC_VGA 0x01 /* 0x03 display subclasses */ #define PCI_SUBCLASS_DISPLAY_VGA 0x00 #define PCI_SUBCLASS_DISPLAY_XGA 0x01 #define PCI_SUBCLASS_DISPLAY_MISC 0x80 /* 0x04 multimedia subclasses */ #define PCI_SUBCLASS_MULTIMEDIA_VIDEO 0x00 #define PCI_SUBCLASS_MULTIMEDIA_AUDIO 0x01 #define PCI_SUBCLASS_MULTIMEDIA_MISC 0x80 /* 0x06 bridge subclasses */ #define PCI_SUBCLASS_BRIDGE_HOST 0x00 #define PCI_SUBCLASS_BRIDGE_ISA 0x01 #define PCI_SUBCLASS_BRIDGE_EISA 0x02 #define PCI_SUBCLASS_BRIDGE_MC 0x03 #define PCI_SUBCLASS_BRIDGE_PCI 0x04 #define PCI_SUBCLASS_BRIDGE_PCMCIA 0x05 #define PCI_SUBCLASS_BRIDGE_NUBUS 0x06 #define PCI_SUBCLASS_BRIDGE_CARDBUS 0x07 #define PCI_SUBCLASS_BRIDGE_RACEWAY 0x08 #define PCI_SUBCLASS_BRIDGE_MISC 0x80 #define PCI_IF_BRIDGE_PCI_SUBTRACTIVE 0x01 /* 0x0b processor subclasses */ #define PCI_SUBCLASS_PROCESSOR_386 0x00 #define PCI_SUBCLASS_PROCESSOR_486 0x01 #define PCI_SUBCLASS_PROCESSOR_PENTIUM 0x02 #define PCI_SUBCLASS_PROCESSOR_ALPHA 0x10 #define PCI_SUBCLASS_PROCESSOR_POWERPC 0x20 #define PCI_SUBCLASS_PROCESSOR_MIPS 0x30 #define PCI_SUBCLASS_PROCESSOR_COPROC 0x40 /* PCI-PCI bridge mapping registers */ #define PCI_PCI_BRIDGE_BUS_REG 0x18 #define PCI_SUBORDINATE_BUS_MASK 0x00ff0000 #define PCI_SECONDARY_BUS_MASK 0x0000ff00 #define PCI_PRIMARY_BUS_MASK 0x000000ff #define PCI_PCI_BRIDGE_IO_REG 0x1c #define PCI_PCI_BRIDGE_MEM_REG 0x20 #define PCI_PCI_BRIDGE_PMEM_REG 0x24 #define PCI_PCI_BRIDGE_CONTROL_REG 0x3E #define PCI_PCI_BRIDGE_PARITY_EN 0x01 #define PCI_PCI_BRIDGE_SERR_EN 0x02 #define PCI_PCI_BRIDGE_ISA_EN 0x04 #define PCI_PCI_BRIDGE_VGA_EN 0x08 #define PCI_PCI_BRIDGE_MASTER_ABORT_EN 0x20 #define PCI_PCI_BRIDGE_SECONDARY_RESET 0x40 #define PCI_PCI_BRIDGE_FAST_B2B_EN 0x80 /* Subsystem identification register */ #define PCI_SUBSYSTEM_ID_REG 0x2c /* User defined cfg space regs */ #define PCI_REG_USERCONFIG 0x40 #define PCI_OPTION_REG 0x40 /* * Typedefs, etc... */ /* Public PCI access functions */ extern _X_EXPORT Bool xf86scanpci(void); #endif /* _XF86PCI_H */ xorg-server-1.17.1/hw/xfree86/os-support/bus/nobus.c0000664000175100017510000000012612366220413017132 00000000000000void __noop_to_appease_ar__(void); void __noop_to_appease_ar__(void) { return; } xorg-server-1.17.1/hw/xfree86/os-support/hurd/0000775000175100017510000000000012466505445016106 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/hurd/Makefile.am0000664000175100017510000000067012406661137020060 00000000000000noinst_LTLIBRARIES = libhurd.la libhurd_la_SOURCES = hurd_bell.c hurd_init.c \ hurd_video.c \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigiostubs.c \ $(srcdir)/../shared/pm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/agp_noop.c AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) xorg-server-1.17.1/hw/xfree86/os-support/hurd/hurd_init.c0000664000175100017510000000445312366220413020151 00000000000000/* * Copyright 1997,1998 by UCHIYAMA Yasushi * * 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 UCHIYAMA Yasushi not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. UCHIYAMA Yasushi makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL UCHIYAMA YASUSHI 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 "input.h" #include "scrnintstr.h" #include "compiler.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include #include #include #include #include #include #include int xf86ProcessArgument(int argc, char **argv, int i) { return 0; } void xf86UseMsg() { return; } void xf86OpenConsole() { if (serverGeneration == 1) { kern_return_t err; mach_port_t device; int fd; err = get_privileged_ports(NULL, &device); if (err) { errno = err; FatalError("xf86KbdInit can't get_privileged_ports. (%s)\n", strerror(errno)); } mach_port_deallocate(mach_task_self(), device); if ((fd = open("/dev/kbd", O_RDONLY | O_NONBLOCK)) < 0) { fprintf(stderr, "Cannot open keyboard (%s)\n", strerror(errno)); exit(1); } xf86Info.consoleFd = fd; } return; } void xf86CloseConsole() { close(xf86Info.consoleFd); return; } xorg-server-1.17.1/hw/xfree86/os-support/hurd/hurd_bell.c0000664000175100017510000000254112366220413020120 00000000000000/* * Copyright © 2006 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 "xf86.h" #include "xf86Priv.h" void xf86OSRingBell(int loudness, int pitch, int duration) { return; } xorg-server-1.17.1/hw/xfree86/os-support/hurd/hurd_video.c0000664000175100017510000000545312456571574020336 00000000000000/* * Copyright 1997, 1998 by UCHIYAMA Yasushi * * 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 UCHIYAMA Yasushi not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. UCHIYAMA Yasushi makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL UCHIYAMA YASUSHI 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 #include #include #include #include "input.h" #include "scrnintstr.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" /************************************************************************** * Video Memory Mapping section ***************************************************************************/ /************************************************************************** * I/O Permissions section ***************************************************************************/ /* * Due to conflicts with "compiler.h", don't rely on to declare * this. */ extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on); Bool xf86EnableIO() { if (ioperm(0, 0x10000, 1)) { FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno)); return FALSE; } #if 0 /* * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these * ports, and the int10 wrapper is not emulating them. (Note that it's * effectively what happens in the Linux variant too, as iopl() is used * there, making the ioperm() meaningless.) * * Reenable this when int10 gets fixed. */ ioperm(0x40, 4, 0); /* trap access to the timer chip */ ioperm(0x60, 4, 0); /* trap access to the keyboard controller */ #endif return TRUE; } void xf86DisableIO() { ioperm(0, 0x10000, 0); return; } void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/hurd/Makefile.in0000664000175100017510000010161112466505433020070 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/os-support/hurd DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libhurd_la_LIBADD = am_libhurd_la_OBJECTS = hurd_bell.lo hurd_init.lo hurd_video.lo \ VTsw_noop.lo posix_tty.lo vidmem.lo sigiostubs.lo pm_noop.lo \ kmod_noop.lo agp_noop.lo libhurd_la_OBJECTS = $(am_libhurd_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 = $(libhurd_la_SOURCES) DIST_SOURCES = $(libhurd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libhurd.la libhurd_la_SOURCES = hurd_bell.c hurd_init.c \ hurd_video.c \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigiostubs.c \ $(srcdir)/../shared/pm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/agp_noop.c AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/os-support/hurd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/hurd/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libhurd.la: $(libhurd_la_OBJECTS) $(libhurd_la_DEPENDENCIES) $(EXTRA_libhurd_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libhurd_la_OBJECTS) $(libhurd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agp_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmod_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix_tty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigiostubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.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 -o $@ $< .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 -o $@ `$(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 $@ $< VTsw_noop.lo: $(srcdir)/../shared/VTsw_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT VTsw_noop.lo -MD -MP -MF $(DEPDIR)/VTsw_noop.Tpo -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/VTsw_noop.Tpo $(DEPDIR)/VTsw_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/VTsw_noop.c' object='VTsw_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c posix_tty.lo: $(srcdir)/../shared/posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -MT posix_tty.lo -MD -MP -MF $(DEPDIR)/posix_tty.Tpo -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/posix_tty.Tpo $(DEPDIR)/posix_tty.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/posix_tty.c' object='posix_tty.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) $(AM_CFLAGS) $(CFLAGS) -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c vidmem.lo: $(srcdir)/../shared/vidmem.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) $(AM_CFLAGS) $(CFLAGS) -MT vidmem.lo -MD -MP -MF $(DEPDIR)/vidmem.Tpo -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/vidmem.Tpo $(DEPDIR)/vidmem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/vidmem.c' object='vidmem.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) $(AM_CFLAGS) $(CFLAGS) -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c sigiostubs.lo: $(srcdir)/../shared/sigiostubs.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) $(AM_CFLAGS) $(CFLAGS) -MT sigiostubs.lo -MD -MP -MF $(DEPDIR)/sigiostubs.Tpo -c -o sigiostubs.lo `test -f '$(srcdir)/../shared/sigiostubs.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigiostubs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sigiostubs.Tpo $(DEPDIR)/sigiostubs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/sigiostubs.c' object='sigiostubs.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) $(AM_CFLAGS) $(CFLAGS) -c -o sigiostubs.lo `test -f '$(srcdir)/../shared/sigiostubs.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigiostubs.c pm_noop.lo: $(srcdir)/../shared/pm_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT pm_noop.lo -MD -MP -MF $(DEPDIR)/pm_noop.Tpo -c -o pm_noop.lo `test -f '$(srcdir)/../shared/pm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/pm_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pm_noop.Tpo $(DEPDIR)/pm_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/pm_noop.c' object='pm_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o pm_noop.lo `test -f '$(srcdir)/../shared/pm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/pm_noop.c kmod_noop.lo: $(srcdir)/../shared/kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT kmod_noop.lo -MD -MP -MF $(DEPDIR)/kmod_noop.Tpo -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/kmod_noop.Tpo $(DEPDIR)/kmod_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/kmod_noop.c' object='kmod_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c agp_noop.lo: $(srcdir)/../shared/agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT agp_noop.lo -MD -MP -MF $(DEPDIR)/agp_noop.Tpo -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/agp_noop.Tpo $(DEPDIR)/agp_noop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/agp_noop.c' object='agp_noop.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) $(AM_CFLAGS) $(CFLAGS) -c -o agp_noop.lo `test -f '$(srcdir)/../shared/agp_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/agp_noop.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/xfree86/os-support/misc/0000775000175100017510000000000012466505445016077 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/misc/Makefile.am0000664000175100017510000000030512200102654020026 00000000000000 noinst_LTLIBRARIES = libmisc.la libmisc_la_SOURCES = SlowBcopy.c #AM_LDFLAGS = -r AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS) xorg-server-1.17.1/hw/xfree86/os-support/misc/SlowBcopy.c0000664000175100017510000000464012456571574020115 00000000000000/******************************************************************************* for Alpha Linux *******************************************************************************/ /* * Create a dependency that should be immune from the effect of register * renaming as is commonly seen in superscalar processors. This should * insert a minimum of 100-ns delays between reads/writes at clock rates * up to 100 MHz---GGL * * Slowbcopy(char *src, char *dst, int count) * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "compiler.h" static int really_slow_bcopy; void xf86SetReallySlowBcopy(void) { really_slow_bcopy = 1; } #if defined(__i386__) || defined(__amd64__) static void xf86_really_slow_bcopy(unsigned char *src, unsigned char *dst, int len) { while (len--) { *dst++ = *src++; outb(0x80, 0x00); } } #endif /* The outb() isn't needed on my machine, but who knows ... -- ost */ void xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) { #if defined(__i386__) || defined(__amd64__) if (really_slow_bcopy) { xf86_really_slow_bcopy(src, dst, len); return; } #endif while (len--) *dst++ = *src++; } #ifdef __alpha__ #ifdef linux unsigned long _bus_base(void); #define useSparse() (!_bus_base()) #define SPARSE (7) #else #define useSparse() 0 #define SPARSE 0 #endif void xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count) { if (useSparse()) { unsigned long addr; long result; addr = (unsigned long) src; while (count) { result = *(volatile int *) addr; result >>= ((addr >> SPARSE) & 3) * 8; *dst++ = (unsigned char) (0xffUL & result); addr += 1 << SPARSE; count--; outb(0x80, 0x00); } } else xf86SlowBcopy(src, dst, count); } void xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count) { if (useSparse()) { unsigned long addr; addr = (unsigned long) dst; while (count) { *(volatile unsigned int *) addr = (unsigned short) (*src) * 0x01010101; src++; addr += 1 << SPARSE; count--; outb(0x80, 0x00); } } else xf86SlowBcopy(src, dst, count); } #endif xorg-server-1.17.1/hw/xfree86/os-support/misc/Makefile.in0000664000175100017510000006114712466505433020072 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/os-support/misc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libmisc_la_LIBADD = am_libmisc_la_OBJECTS = SlowBcopy.lo libmisc_la_OBJECTS = $(am_libmisc_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 = $(libmisc_la_SOURCES) DIST_SOURCES = $(libmisc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libmisc.la libmisc_la_SOURCES = SlowBcopy.c #AM_LDFLAGS = -r AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/os-support/misc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/misc/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libmisc.la: $(libmisc_la_OBJECTS) $(libmisc_la_DEPENDENCIES) $(EXTRA_libmisc_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libmisc_la_OBJECTS) $(libmisc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SlowBcopy.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/xfree86/os-support/Makefile.in0000664000175100017510000007365412466505433017145 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/os-support DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libxorgos_la_DEPENDENCIES = @XORG_OS_SUBDIR@/lib@XORG_OS_SUBDIR@.la \ bus/libbus.la misc/libmisc.la am_libxorgos_la_OBJECTS = libxorgos_la_OBJECTS = $(am_libxorgos_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 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 = $(libxorgos_la_SOURCES) DIST_SOURCES = $(libxorgos_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 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) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS) DIST_SUBDIRS = bsd bus misc linux solaris stub hurd sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h EXTRA_DIST = int10Defines.h xf86OSpriv.h # to get the grouping semantics right, you have to glom these three together # as one library, otherwise libtool will actively defeat your attempts to # list them multiple times on the link line. noinst_LTLIBRARIES = libxorgos.la libxorgos_la_SOURCES = libxorgos_la_LIBADD = @XORG_OS_SUBDIR@/lib@XORG_OS_SUBDIR@.la \ bus/libbus.la \ misc/libmisc.la AM_CFLAGS = $(DIX_CFLAGS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(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/os-support/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/os-support/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libxorgos.la: $(libxorgos_la_OBJECTS) $(libxorgos_la_DEPENDENCIES) $(EXTRA_libxorgos_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libxorgos_la_OBJECTS) $(libxorgos_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c 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) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sdkdir)"; 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-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-sdkHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-sdkHEADERS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am 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-sdkHEADERS install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/xfree86/os-support/shared/0000775000175100017510000000000012466505445016412 500000000000000xorg-server-1.17.1/hw/xfree86/os-support/shared/kmod_noop.c0000664000175100017510000000313512366220413020451 00000000000000/* * 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_XORG_CONFIG_H #include #endif #include "xf86_OSproc.h" int xf86LoadKernelModule(const char *pathname) { (void) pathname; return 0; /* failure */ } xorg-server-1.17.1/hw/xfree86/os-support/shared/vidmem.c0000664000175100017510000000361412406661137017756 00000000000000/* * Copyright (c) 1993-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "input.h" #include "scrnintstr.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" /* * This file contains the common part of the video memory mapping functions */ static VidMemInfo vidMemInfo = { FALSE, }; void xf86InitVidMem(void) { if (!vidMemInfo.initialised) { memset(&vidMemInfo, 0, sizeof(VidMemInfo)); xf86OSInitVidMem(&vidMemInfo); } } xorg-server-1.17.1/hw/xfree86/os-support/shared/VTsw_usl.c0000664000175100017510000000444212366220413020254 00000000000000/* * Copyright 1993 by David Wexelblat * * 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 David Wexelblat not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. David Wexelblat makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL 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. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" /* * Handle the VT-switching interface for OSs that use USL-style ioctl()s * (the sysv, sco, and linux subdirs). */ /* * This function is the signal handler for the VT-switching signal. It * is only referenced inside the OS-support layer. */ void xf86VTRequest(int sig) { signal(sig, (void (*)(int)) xf86VTRequest); xf86Info.vtRequestsPending = TRUE; return; } Bool xf86VTSwitchPending(void) { return xf86Info.vtRequestsPending ? TRUE : FALSE; } Bool xf86VTSwitchAway(void) { xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) return FALSE; else return TRUE; } Bool xf86VTSwitchTo(void) { xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) return FALSE; else return TRUE; } Bool xf86VTActivate(int vtno) { #ifdef VT_ACTIVATE if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) { return FALSE; } #endif return TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/shared/VTsw_noop.c0000664000175100017510000000306412366220413020423 00000000000000/* * Copyright 1993 by David Wexelblat * * 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 David Wexelblat not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. David Wexelblat makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL 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. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" /* * No-op functions for OSs without VTs */ Bool xf86VTSwitchPending(void) { return FALSE; } Bool xf86VTSwitchAway(void) { return FALSE; } Bool xf86VTSwitchTo(void) { return TRUE; } Bool xf86VTActivate(int vtno) { return TRUE; } xorg-server-1.17.1/hw/xfree86/os-support/shared/sigiostubs.c0000664000175100017510000000366312366220413020665 00000000000000/* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) { return 0; } int xf86RemoveSIGIOHandler(int fd) { return 0; } int xf86BlockSIGIO(void) { return 0; } void xf86UnblockSIGIO(int wasset) { } void xf86AssertBlockedSIGIO(char *where) { } /* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */ Bool xf86SIGIOSupported() { return FALSE; } xorg-server-1.17.1/hw/xfree86/os-support/shared/pm_noop.c0000664000175100017510000000327212366220413020135 00000000000000/* * 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). */ /* Stubs for the OS-support layer power-management functions. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" PMClose xf86OSPMOpen(void) { return NULL; } xorg-server-1.17.1/hw/xfree86/os-support/shared/ioperm_noop.c0000664000175100017510000000302212456571574021026 00000000000000/* * Copyright 1993 by David Wexelblat * * 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 David Wexelblat not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. David Wexelblat makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL 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. * */ /* * Some platforms don't bother with I/O permissions, * or the permissions are implicit with opening/enabling the console. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" Bool xf86EnableIO(void) { return TRUE; } void xf86DisableIO(void) { return; } xorg-server-1.17.1/hw/xfree86/os-support/shared/posix_tty.c0000664000175100017510000003372012366220413020531 00000000000000/* * Copyright 1993-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 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. */ /* * * Copyright (c) 1997 Metro Link Incorporated * * 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" static int GetBaud(int baudrate) { #ifdef B300 if (baudrate == 300) return B300; #endif #ifdef B1200 if (baudrate == 1200) return B1200; #endif #ifdef B2400 if (baudrate == 2400) return B2400; #endif #ifdef B4800 if (baudrate == 4800) return B4800; #endif #ifdef B9600 if (baudrate == 9600) return B9600; #endif #ifdef B19200 if (baudrate == 19200) return B19200; #endif #ifdef B38400 if (baudrate == 38400) return B38400; #endif #ifdef B57600 if (baudrate == 57600) return B57600; #endif #ifdef B115200 if (baudrate == 115200) return B115200; #endif #ifdef B230400 if (baudrate == 230400) return B230400; #endif #ifdef B460800 if (baudrate == 460800) return B460800; #endif return 0; } int xf86OpenSerial(XF86OptionPtr options) { struct termios t; int fd, i; char *dev; dev = xf86SetStrOption(options, "Device", NULL); if (!dev) { xf86Msg(X_ERROR, "xf86OpenSerial: No Device specified.\n"); return -1; } fd = xf86CheckIntOption(options, "fd", -1); if (fd == -1) SYSCALL(fd = open(dev, O_RDWR | O_NONBLOCK)); if (fd == -1) { xf86Msg(X_ERROR, "xf86OpenSerial: Cannot open device %s\n\t%s.\n", dev, strerror(errno)); free(dev); return -1; } 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); 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_cc[VMIN] = 1; t.c_cc[VTIME] = 0; SYSCALL(tcsetattr(fd, TCSANOW, &t)); if (xf86SetSerial(fd, options) == -1) { SYSCALL(close(fd)); free(dev); return -1; } SYSCALL(i = fcntl(fd, F_GETFL, 0)); if (i == -1) { SYSCALL(close(fd)); free(dev); return -1; } i &= ~O_NONBLOCK; SYSCALL(i = fcntl(fd, F_SETFL, i)); if (i == -1) { SYSCALL(close(fd)); free(dev); return -1; } free(dev); return fd; } int xf86SetSerial(int fd, XF86OptionPtr options) { struct termios t; int val; const char *s; int baud, r; if (fd < 0) return -1; /* Don't try to set parameters for non-tty devices. */ if (!isatty(fd)) return 0; SYSCALL(tcgetattr(fd, &t)); if ((val = xf86SetIntOption(options, "BaudRate", 0))) { if ((baud = GetBaud(val))) { cfsetispeed(&t, baud); cfsetospeed(&t, baud); } else { xf86Msg(X_ERROR, "Invalid Option BaudRate value: %d\n", val); return -1; } } if ((val = xf86SetIntOption(options, "StopBits", 0))) { switch (val) { case 1: t.c_cflag &= ~(CSTOPB); break; case 2: t.c_cflag |= CSTOPB; break; default: xf86Msg(X_ERROR, "Invalid Option StopBits value: %d\n", val); return -1; break; } } if ((val = xf86SetIntOption(options, "DataBits", 0))) { switch (val) { case 5: t.c_cflag &= ~(CSIZE); t.c_cflag |= CS5; break; case 6: t.c_cflag &= ~(CSIZE); t.c_cflag |= CS6; break; case 7: t.c_cflag &= ~(CSIZE); t.c_cflag |= CS7; break; case 8: t.c_cflag &= ~(CSIZE); t.c_cflag |= CS8; break; default: xf86Msg(X_ERROR, "Invalid Option DataBits value: %d\n", val); return -1; break; } } if ((s = xf86SetStrOption(options, "Parity", NULL))) { if (xf86NameCmp(s, "Odd") == 0) { t.c_cflag |= PARENB | PARODD; } else if (xf86NameCmp(s, "Even") == 0) { t.c_cflag |= PARENB; t.c_cflag &= ~(PARODD); } else if (xf86NameCmp(s, "None") == 0) { t.c_cflag &= ~(PARENB); } else { xf86Msg(X_ERROR, "Invalid Option Parity value: %s\n", s); return -1; } } if ((val = xf86SetIntOption(options, "Vmin", -1)) != -1) { t.c_cc[VMIN] = val; } if ((val = xf86SetIntOption(options, "Vtime", -1)) != -1) { t.c_cc[VTIME] = val; } if ((s = xf86SetStrOption(options, "FlowControl", NULL))) { xf86MarkOptionUsedByName(options, "FlowControl"); if (xf86NameCmp(s, "Xoff") == 0) { t.c_iflag |= IXOFF; } else if (xf86NameCmp(s, "Xon") == 0) { t.c_iflag |= IXON; } else if (xf86NameCmp(s, "XonXoff") == 0) { t.c_iflag |= IXON | IXOFF; } else if (xf86NameCmp(s, "None") == 0) { t.c_iflag &= ~(IXON | IXOFF); } else { xf86Msg(X_ERROR, "Invalid Option FlowControl value: %s\n", s); return -1; } } if ((xf86SetBoolOption(options, "ClearDTR", FALSE))) { #ifdef CLEARDTR_SUPPORT #if defined(TIOCMBIC) val = TIOCM_DTR; SYSCALL(ioctl(fd, TIOCMBIC, &val)); #else SYSCALL(ioctl(fd, TIOCCDTR, NULL)); #endif #else xf86Msg(X_WARNING, "Option ClearDTR not supported on this OS\n"); return -1; #endif xf86MarkOptionUsedByName(options, "ClearDTR"); } if ((xf86SetBoolOption(options, "ClearRTS", FALSE))) { xf86Msg(X_WARNING, "Option ClearRTS not supported on this OS\n"); return -1; xf86MarkOptionUsedByName(options, "ClearRTS"); } SYSCALL(r = tcsetattr(fd, TCSANOW, &t)); return r; } int xf86SetSerialSpeed(int fd, int speed) { struct termios t; int baud, r; if (fd < 0) return -1; /* Don't try to set parameters for non-tty devices. */ if (!isatty(fd)) return 0; SYSCALL(tcgetattr(fd, &t)); if ((baud = GetBaud(speed))) { cfsetispeed(&t, baud); cfsetospeed(&t, baud); } else { xf86Msg(X_ERROR, "Invalid Option BaudRate value: %d\n", speed); return -1; } SYSCALL(r = tcsetattr(fd, TCSANOW, &t)); return r; } int xf86ReadSerial(int fd, void *buf, int count) { int r; int i; SYSCALL(r = read(fd, buf, count)); DebugF("ReadingSerial: 0x%x", (unsigned char) *(((unsigned char *) buf))); for (i = 1; i < r; i++) DebugF(", 0x%x", (unsigned char) *(((unsigned char *) buf) + i)); DebugF("\n"); return r; } int xf86WriteSerial(int fd, const void *buf, int count) { int r; int i; DebugF("WritingSerial: 0x%x", (unsigned char) *(((unsigned char *) buf))); for (i = 1; i < count; i++) DebugF(", 0x%x", (unsigned char) *(((unsigned char *) buf) + i)); DebugF("\n"); SYSCALL(r = write(fd, buf, count)); return r; } int xf86CloseSerial(int fd) { int r; SYSCALL(r = close(fd)); return r; } int xf86WaitForInput(int fd, int timeout) { fd_set readfds; struct timeval to; int r; FD_ZERO(&readfds); if (fd >= 0) { FD_SET(fd, &readfds); } to.tv_sec = timeout / 1000000; to.tv_usec = timeout % 1000000; if (fd >= 0) { SYSCALL(r = select(FD_SETSIZE, &readfds, NULL, NULL, &to)); } else { SYSCALL(r = select(FD_SETSIZE, NULL, NULL, NULL, &to)); } xf86ErrorFVerb(9, "select returned %d\n", r); return r; } int xf86SerialSendBreak(int fd, int duration) { int r; SYSCALL(r = tcsendbreak(fd, duration)); return r; } int xf86FlushInput(int fd) { fd_set fds; struct timeval timeout; /* this needs to be big enough to flush an evdev event. */ char c[256]; DebugF("FlushingSerial\n"); if (tcflush(fd, TCIFLUSH) == 0) return 0; timeout.tv_sec = 0; timeout.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); while (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) { if (read(fd, &c, sizeof(c)) < 1) return 0; FD_ZERO(&fds); FD_SET(fd, &fds); } return 0; } static struct states { int xf; int os; } modemStates[] = { #ifdef TIOCM_LE { XF86_M_LE, TIOCM_LE}, #endif #ifdef TIOCM_DTR { XF86_M_DTR, TIOCM_DTR}, #endif #ifdef TIOCM_RTS { XF86_M_RTS, TIOCM_RTS}, #endif #ifdef TIOCM_ST { XF86_M_ST, TIOCM_ST}, #endif #ifdef TIOCM_SR { XF86_M_SR, TIOCM_SR}, #endif #ifdef TIOCM_CTS { XF86_M_CTS, TIOCM_CTS}, #endif #ifdef TIOCM_CAR { XF86_M_CAR, TIOCM_CAR}, #elif defined(TIOCM_CD) { XF86_M_CAR, TIOCM_CD}, #endif #ifdef TIOCM_RNG { XF86_M_RNG, TIOCM_RNG}, #elif defined(TIOCM_RI) { XF86_M_CAR, TIOCM_RI}, #endif #ifdef TIOCM_DSR { XF86_M_DSR, TIOCM_DSR}, #endif }; static int numStates = sizeof(modemStates) / sizeof(modemStates[0]); static int xf2osState(int state) { int i; int ret = 0; for (i = 0; i < numStates; i++) if (state & modemStates[i].xf) ret |= modemStates[i].os; return ret; } static int os2xfState(int state) { int i; int ret = 0; for (i = 0; i < numStates; i++) if (state & modemStates[i].os) ret |= modemStates[i].xf; return ret; } static int getOsStateMask(void) { int i; int ret = 0; for (i = 0; i < numStates; i++) ret |= modemStates[i].os; return ret; } static int osStateMask = 0; int xf86SetSerialModemState(int fd, int state) { int ret; int s; if (fd < 0) return -1; /* Don't try to set parameters for non-tty devices. */ if (!isatty(fd)) return 0; #ifndef TIOCMGET return -1; #else if (!osStateMask) osStateMask = getOsStateMask(); state = xf2osState(state); SYSCALL((ret = ioctl(fd, TIOCMGET, &s))); if (ret < 0) return -1; s &= ~osStateMask; s |= state; SYSCALL((ret = ioctl(fd, TIOCMSET, &s))); if (ret < 0) return -1; else return 0; #endif } int xf86GetSerialModemState(int fd) { int ret; int s; if (fd < 0) return -1; /* Don't try to set parameters for non-tty devices. */ if (!isatty(fd)) return 0; #ifndef TIOCMGET return -1; #else SYSCALL((ret = ioctl(fd, TIOCMGET, &s))); if (ret < 0) return -1; return os2xfState(s); #endif } int xf86SerialModemSetBits(int fd, int bits) { int ret; int s; if (fd < 0) return -1; /* Don't try to set parameters for non-tty devices. */ if (!isatty(fd)) return 0; #ifndef TIOCMGET return -1; #else s = xf2osState(bits); SYSCALL((ret = ioctl(fd, TIOCMBIS, &s))); return ret; #endif } int xf86SerialModemClearBits(int fd, int bits) { int ret; int s; if (fd < 0) return -1; /* Don't try to set parameters for non-tty devices. */ if (!isatty(fd)) return 0; #ifndef TIOCMGET return -1; #else s = xf2osState(bits); SYSCALL((ret = ioctl(fd, TIOCMBIC, &s))); return ret; #endif } xorg-server-1.17.1/hw/xfree86/os-support/shared/sigio.c0000664000175100017510000002065212456571574017622 00000000000000/* sigio.c -- Support for SIGIO handler installation and removal * Created: Thu Jun 3 15:39:18 1999 by faith@precisioninsight.com * * 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, 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 * 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: Rickard E. (Rik) Faith */ /* * Copyright (c) 2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "inputstr.h" #ifdef HAVE_STROPTS_H #include #endif #ifdef MAXDEVICES /* MAXDEVICES represents the maximimum number of input devices usable * at the same time plus one entry for DRM support. */ #define MAX_FUNCS (MAXDEVICES + 1) #else #define MAX_FUNCS 16 #endif typedef struct _xf86SigIOFunc { void (*f) (int, void *); int fd; void *closure; } Xf86SigIOFunc; static Xf86SigIOFunc xf86SigIOFuncs[MAX_FUNCS]; static int xf86SigIOMax; static int xf86SigIOMaxFd; static fd_set xf86SigIOMask; /* * SIGIO gives no way of discovering which fd signalled, select * to discover */ static void xf86SIGIO(int sig) { int i; fd_set ready; struct timeval to; int save_errno = errno; /* do not clobber the global errno */ int r; inSignalContext = TRUE; ready = xf86SigIOMask; to.tv_sec = 0; to.tv_usec = 0; SYSCALL(r = select(xf86SigIOMaxFd, &ready, 0, 0, &to)); for (i = 0; r > 0 && i < xf86SigIOMax; i++) if (xf86SigIOFuncs[i].f && FD_ISSET(xf86SigIOFuncs[i].fd, &ready)) { (*xf86SigIOFuncs[i].f) (xf86SigIOFuncs[i].fd, xf86SigIOFuncs[i].closure); r--; } if (r > 0) { xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r); } /* restore global errno */ errno = save_errno; inSignalContext = FALSE; } static int xf86IsPipe(int fd) { struct stat buf; if (fstat(fd, &buf) < 0) return 0; return S_ISFIFO(buf.st_mode); } int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) { struct sigaction sa; struct sigaction osa; int i; int installed = FALSE; if (!xf86Info.useSIGIO) return 0; for (i = 0; i < MAX_FUNCS; i++) { if (!xf86SigIOFuncs[i].f) { if (xf86IsPipe(fd)) return 0; 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", fd, strerror(errno)); } else { if (fcntl(fd, F_SETOWN, getpid()) == -1) { xf86Msg(X_WARNING, "fcntl(%d, F_SETOWN): %s\n", fd, strerror(errno)); } else { installed = TRUE; } } #endif #ifdef I_SETSIG /* System V Streams - used on Solaris for input devices */ if (!installed && isastream(fd)) { if (ioctl(fd, I_SETSIG, S_INPUT | S_ERROR | S_HANGUP) == -1) { xf86Msg(X_WARNING, "fcntl(%d, I_SETSIG): %s\n", fd, strerror(errno)); } else { installed = TRUE; } } #endif if (!installed) { OsReleaseSIGIO(); return 0; } sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGIO); sa.sa_flags = 0; sa.sa_handler = xf86SIGIO; sigaction(SIGIO, &sa, &osa); xf86SigIOFuncs[i].fd = fd; xf86SigIOFuncs[i].closure = closure; xf86SigIOFuncs[i].f = f; if (i >= xf86SigIOMax) xf86SigIOMax = i + 1; if (fd >= xf86SigIOMaxFd) xf86SigIOMaxFd = fd + 1; FD_SET(fd, &xf86SigIOMask); OsReleaseSIGIO(); return 1; } /* Allow overwriting of the closure and callback */ else if (xf86SigIOFuncs[i].fd == fd) { xf86SigIOFuncs[i].closure = closure; xf86SigIOFuncs[i].f = f; return 1; } } return 0; } int xf86RemoveSIGIOHandler(int fd) { struct sigaction sa; struct sigaction osa; int i; int max; int maxfd; int ret; if (!xf86Info.useSIGIO) return 0; max = 0; maxfd = -1; ret = 0; for (i = 0; i < MAX_FUNCS; i++) { if (xf86SigIOFuncs[i].f) { if (xf86SigIOFuncs[i].fd == fd) { xf86SigIOFuncs[i].f = 0; xf86SigIOFuncs[i].fd = 0; xf86SigIOFuncs[i].closure = 0; FD_CLR(fd, &xf86SigIOMask); ret = 1; } else { max = i + 1; if (xf86SigIOFuncs[i].fd >= maxfd) maxfd = xf86SigIOFuncs[i].fd + 1; } } } if (ret) { #ifdef O_ASYNC fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_ASYNC); #endif #ifdef I_SETSIG if (isastream(fd)) { if (ioctl(fd, I_SETSIG, 0) == -1) { xf86Msg(X_WARNING, "fcntl(%d, I_SETSIG, 0): %s\n", fd, strerror(errno)); } } #endif xf86SigIOMax = max; xf86SigIOMaxFd = maxfd; if (!max) { sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGIO); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; sigaction(SIGIO, &sa, &osa); } } return ret; } int xf86BlockSIGIO(void) { return OsBlockSIGIO(); } void xf86UnblockSIGIO(int wasset) { OsReleaseSIGIO(); } void xf86AssertBlockedSIGIO(char *where) { sigset_t set, old; sigemptyset(&set); sigprocmask(SIG_BLOCK, &set, &old); if (!sigismember(&old, SIGIO)) xf86Msg(X_ERROR, "SIGIO not blocked at %s\n", where); } /* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */ int xf86SIGIOSupported(void) { return 1; } xorg-server-1.17.1/hw/xfree86/os-support/shared/agp_noop.c0000664000175100017510000000462112366220413020267 00000000000000/* * Copyright (c) 2000-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ /* * Abstraction of the AGP GART interface. Stubs for platforms without * AGP GART support. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" Bool xf86GARTCloseScreen(int screenNum) { return FALSE; } Bool xf86AgpGARTSupported(void) { return FALSE; } AgpInfoPtr xf86GetAGPInfo(int screenNum) { return NULL; } Bool xf86AcquireGART(int screenNum) { return FALSE; } Bool xf86ReleaseGART(int screenNum) { return FALSE; } int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type, unsigned long *physical) { return -1; } Bool xf86DeallocateGARTMemory(int screenNum, int key) { return FALSE; } Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset) { return FALSE; } Bool xf86UnbindGARTMemory(int screenNum, int key) { return FALSE; } Bool xf86EnableAGP(int screenNum, CARD32 mode) { return FALSE; } xorg-server-1.17.1/hw/xfree86/shadowfb/0000775000175100017510000000000012466505445014606 500000000000000xorg-server-1.17.1/hw/xfree86/shadowfb/Makefile.am0000664000175100017510000000044112200102654016536 00000000000000module_LTLIBRARIES = libshadowfb.la 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 AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) xorg-server-1.17.1/hw/xfree86/shadowfb/shadowfb.h0000664000175100017510000000231712456571574016504 00000000000000 #ifndef _SHADOWFB_H #define _SHADOWFB_H #include "xf86str.h" /* * User defined callback function. Passed a pointer to the ScrnInfo struct, * the number of dirty rectangles, and a pointer to the first dirty rectangle * in the array. */ typedef void (*RefreshAreaFuncPtr) (ScrnInfoPtr, int, BoxPtr); /* * ShadowFBInit initializes the shadowfb subsystem. refreshArea is a pointer * to a user supplied callback function. This function will be called after * any operation that modifies the framebuffer. The newly dirtied rectangles * are passed to the callback. * * Returns FALSE in the event of an error. */ extern _X_EXPORT Bool ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea); /* * ShadowFBInit2 is a more featureful refinement of the original shadowfb. * ShadowFBInit2 allows you to specify two callbacks, one to be called * immediately before an operation that modifies the framebuffer, and another * to be called immediately after. * * Returns FALSE in the event of an error */ extern _X_EXPORT Bool ShadowFBInit2(ScreenPtr pScreen, RefreshAreaFuncPtr preRefreshArea, RefreshAreaFuncPtr postRefreshArea); #endif /* _SHADOWFB_H */ xorg-server-1.17.1/hw/xfree86/shadowfb/Makefile.in0000664000175100017510000007062512466505433016602 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/shadowfb DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) 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@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libshadowfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libshadowfb_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 = $(libshadowfb_la_SOURCES) DIST_SOURCES = $(libshadowfb_la_SOURCES) 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ module_LTLIBRARIES = libshadowfb.la 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 AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/shadowfb/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/shadowfb/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libshadowfb.la: $(libshadowfb_la_OBJECTS) $(libshadowfb_la_DEPENDENCIES) $(EXTRA_libshadowfb_la_DEPENDENCIES) $(AM_V_CCLD)$(libshadowfb_la_LINK) -rpath $(moduledir) $(libshadowfb_la_OBJECTS) $(libshadowfb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfbmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-moduleLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am uninstall \ uninstall-am uninstall-moduleLTLIBRARIES 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: xorg-server-1.17.1/hw/xfree86/shadowfb/sfbmodule.c0000664000175100017510000000100212366220413016627 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Module.h" static XF86ModuleVersionInfo VersRec = { "shadowfb", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 0, 0, ABI_CLASS_ANSIC, /* Only need the ansic layer */ ABI_ANSIC_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} /* signature, to be patched into the file by a tool */ }; _X_EXPORT XF86ModuleData shadowfbModuleData = { &VersRec, NULL, NULL }; xorg-server-1.17.1/hw/xfree86/shadowfb/shadow.c0000664000175100017510000001071512366220413016147 00000000000000/* Copyright (C) 1999. The XFree86 Project Inc. Copyright 2014 Red Hat, Inc. Written by Mark Vojkovich (mvojkovi@ucsd.edu) Pre-fb-write callbacks and RENDER support - Nolan Leake (nolan@vmware.com) */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "misc.h" #include "pixmapstr.h" #include "input.h" #include #include "mi.h" #include "scrnintstr.h" #include "windowstr.h" #include "gcstruct.h" #include "dixfontstr.h" #include #include "xf86.h" #include "xf86str.h" #include "shadowfb.h" #include "picturestr.h" static Bool ShadowCloseScreen(ScreenPtr pScreen); static Bool ShadowCreateRootWindow(WindowPtr pWin); typedef struct { ScrnInfoPtr pScrn; RefreshAreaFuncPtr preRefresh; RefreshAreaFuncPtr postRefresh; CloseScreenProcPtr CloseScreen; CreateWindowProcPtr CreateWindow; } ShadowScreenRec, *ShadowScreenPtr; static DevPrivateKeyRec ShadowScreenKeyRec; static ShadowScreenPtr shadowfbGetScreenPrivate(ScreenPtr pScreen) { return dixLookupPrivate(&(pScreen)->devPrivates, &ShadowScreenKeyRec); } Bool ShadowFBInit2(ScreenPtr pScreen, RefreshAreaFuncPtr preRefreshArea, RefreshAreaFuncPtr postRefreshArea) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ShadowScreenPtr pPriv; if (!preRefreshArea && !postRefreshArea) return FALSE; if (!dixRegisterPrivateKey(&ShadowScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; if (!(pPriv = (ShadowScreenPtr) malloc(sizeof(ShadowScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, &ShadowScreenKeyRec, pPriv); pPriv->pScrn = pScrn; pPriv->preRefresh = preRefreshArea; pPriv->postRefresh = postRefreshArea; pPriv->CloseScreen = pScreen->CloseScreen; pPriv->CreateWindow = pScreen->CreateWindow; pScreen->CloseScreen = ShadowCloseScreen; pScreen->CreateWindow = ShadowCreateRootWindow; return TRUE; } Bool ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea) { return ShadowFBInit2(pScreen, NULL, refreshArea); } /* * Note that we don't do DamageEmpty, or indeed look at the region inside the * DamagePtr at all. This is an optimization, believe it or not. The * incoming RegionPtr is the new damage, and if we were to empty the region * miext/damage would just have to waste time reallocating and re-unioning * it every time, whereas if we leave it around the union gets fast-pathed * away. */ static void shadowfbReportPre(DamagePtr damage, RegionPtr reg, void *closure) { ShadowScreenPtr pPriv = closure; if (!pPriv->pScrn->vtSema) return; pPriv->preRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg)); } static void shadowfbReportPost(DamagePtr damage, RegionPtr reg, void *closure) { ShadowScreenPtr pPriv = closure; if (!pPriv->pScrn->vtSema) return; pPriv->postRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg)); } static Bool ShadowCreateRootWindow(WindowPtr pWin) { Bool ret; ScreenPtr pScreen = pWin->drawable.pScreen; ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen); /* paranoia */ if (pWin != pScreen->root) ErrorF("ShadowCreateRootWindow called unexpectedly\n"); /* call down, but don't hook ourselves back in; we know the first time * we're called it's for the root window. */ pScreen->CreateWindow = pPriv->CreateWindow; ret = pScreen->CreateWindow(pWin); /* this might look like it leaks, but the damage code reaps listeners * when their drawable disappears. */ if (ret) { DamagePtr damage; if (pPriv->preRefresh) { damage = DamageCreate(shadowfbReportPre, NULL, DamageReportRawRegion, TRUE, pScreen, pPriv); DamageRegister(&pWin->drawable, damage); } if (pPriv->postRefresh) { damage = DamageCreate(shadowfbReportPost, NULL, DamageReportRawRegion, TRUE, pScreen, pPriv); DamageSetReportAfterOp(damage, TRUE); DamageRegister(&pWin->drawable, damage); } } return ret; } static Bool ShadowCloseScreen(ScreenPtr pScreen) { ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen); pScreen->CloseScreen = pPriv->CloseScreen; free(pPriv); return (*pScreen->CloseScreen) (pScreen); } xorg-server-1.17.1/hw/xfree86/glamor_egl/0000775000175100017510000000000012466505445015121 500000000000000xorg-server-1.17.1/hw/xfree86/glamor_egl/Makefile.am0000664000175100017510000000307612362107455017075 00000000000000# Copyright © 2013 Intel Corporation # # 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. module_LTLIBRARIES = libglamoregl.la libglamoregl_la_SOURCES = \ $(top_srcdir)/glamor/glamor_egl.c \ $(top_srcdir)/glamor/glamor_eglmodule.c \ glamor_xf86_xv.c \ $() libglamoregl_la_LDFLAGS = \ -avoid-version \ $(GBM_LIBS) \ $() libglamoregl_la_LIBADD = \ $(top_builddir)/glamor/libglamor.la \ $() AM_CPPFLAGS = $(XORG_INCS) \ -I$(top_srcdir)/dri3 \ -I$(top_srcdir)/glamor \ $() AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(GLAMOR_CFLAGS) $(GBM_CFLAGS) xorg-server-1.17.1/hw/xfree86/glamor_egl/Makefile.in0000664000175100017510000007616612466505432017122 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright © 2013 Intel Corporation # # 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. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/glamor_egl DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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)" LTLIBRARIES = $(module_LTLIBRARIES) libglamoregl_la_DEPENDENCIES = $(top_builddir)/glamor/libglamor.la am_libglamoregl_la_OBJECTS = glamor_egl.lo glamor_eglmodule.lo \ glamor_xf86_xv.lo libglamoregl_la_OBJECTS = $(am_libglamoregl_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 = libglamoregl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libglamoregl_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 = $(libglamoregl_la_SOURCES) DIST_SOURCES = $(libglamoregl_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ module_LTLIBRARIES = libglamoregl.la libglamoregl_la_SOURCES = \ $(top_srcdir)/glamor/glamor_egl.c \ $(top_srcdir)/glamor/glamor_eglmodule.c \ glamor_xf86_xv.c \ $() libglamoregl_la_LDFLAGS = \ -avoid-version \ $(GBM_LIBS) \ $() libglamoregl_la_LIBADD = \ $(top_builddir)/glamor/libglamor.la \ $() AM_CPPFLAGS = $(XORG_INCS) \ -I$(top_srcdir)/dri3 \ -I$(top_srcdir)/glamor \ $() AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(GLAMOR_CFLAGS) $(GBM_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/glamor_egl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/glamor_egl/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libglamoregl.la: $(libglamoregl_la_OBJECTS) $(libglamoregl_la_DEPENDENCIES) $(EXTRA_libglamoregl_la_DEPENDENCIES) $(AM_V_CCLD)$(libglamoregl_la_LINK) -rpath $(moduledir) $(libglamoregl_la_OBJECTS) $(libglamoregl_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_egl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_eglmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_xf86_xv.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 -o $@ $< .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 -o $@ `$(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 $@ $< glamor_egl.lo: $(top_srcdir)/glamor/glamor_egl.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) $(AM_CFLAGS) $(CFLAGS) -MT glamor_egl.lo -MD -MP -MF $(DEPDIR)/glamor_egl.Tpo -c -o glamor_egl.lo `test -f '$(top_srcdir)/glamor/glamor_egl.c' || echo '$(srcdir)/'`$(top_srcdir)/glamor/glamor_egl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/glamor_egl.Tpo $(DEPDIR)/glamor_egl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/glamor/glamor_egl.c' object='glamor_egl.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) $(AM_CFLAGS) $(CFLAGS) -c -o glamor_egl.lo `test -f '$(top_srcdir)/glamor/glamor_egl.c' || echo '$(srcdir)/'`$(top_srcdir)/glamor/glamor_egl.c glamor_eglmodule.lo: $(top_srcdir)/glamor/glamor_eglmodule.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) $(AM_CFLAGS) $(CFLAGS) -MT glamor_eglmodule.lo -MD -MP -MF $(DEPDIR)/glamor_eglmodule.Tpo -c -o glamor_eglmodule.lo `test -f '$(top_srcdir)/glamor/glamor_eglmodule.c' || echo '$(srcdir)/'`$(top_srcdir)/glamor/glamor_eglmodule.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/glamor_eglmodule.Tpo $(DEPDIR)/glamor_eglmodule.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/glamor/glamor_eglmodule.c' object='glamor_eglmodule.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) $(AM_CFLAGS) $(CFLAGS) -c -o glamor_eglmodule.lo `test -f '$(top_srcdir)/glamor/glamor_eglmodule.c' || echo '$(srcdir)/'`$(top_srcdir)/glamor/glamor_eglmodule.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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: for dir in "$(DESTDIR)$(moduledir)"; 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-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-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 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-moduleLTLIBRARIES cscopelist-am ctags \ ctags-am 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-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES # 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: xorg-server-1.17.1/hw/xfree86/glamor_egl/glamor_xf86_xv.c0000664000175100017510000001335712372525300020053 00000000000000/* * Copyright © 2013 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 (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Authors: * Dave Airlie * * some code is derived from the xf86-video-ati radeon driver, mainly * the calculations. */ /** @file glamor_xf86_xv.c * * This implements the XF86 XV interface, and calls into glamor core * for its support of the suspiciously similar XF86 and Kdrive * device-dependent XV interfaces. */ #ifdef HAVE_DIX_CONFIG_H #include #endif #define GLAMOR_FOR_XORG #include "glamor_priv.h" #include #include "fourcc.h" #define NUM_FORMATS 3 static XF86VideoFormatRec Formats[NUM_FORMATS] = { {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; static void glamor_xf86_xv_stop_video(ScrnInfoPtr pScrn, void *data, Bool cleanup) { if (!cleanup) return; glamor_xv_stop_video(data); } static int glamor_xf86_xv_set_port_attribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, void *data) { return glamor_xv_set_port_attribute(data, attribute, value); } static int glamor_xf86_xv_get_port_attribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value, void *data) { return glamor_xv_get_port_attribute(data, attribute, value); } static void glamor_xf86_xv_query_best_size(ScrnInfoPtr pScrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, void *data) { *p_w = drw_w; *p_h = drw_h; } static int glamor_xf86_xv_query_image_attributes(ScrnInfoPtr pScrn, int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets) { return glamor_xv_query_image_attributes(id, w, h, pitches, offsets); } static int glamor_xf86_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, unsigned char *buf, short width, short height, Bool sync, RegionPtr clipBoxes, void *data, DrawablePtr pDrawable) { return glamor_xv_put_image(data, pDrawable, src_x, src_y, drw_x, drw_y, src_w, src_h, drw_w, drw_h, id, buf, width, height, sync, clipBoxes); } static XF86VideoEncodingRec DummyEncodingGLAMOR[1] = { { 0, "XV_IMAGE", 8192, 8192, {1, 1} } }; XF86VideoAdaptorPtr glamor_xv_init(ScreenPtr screen, int num_texture_ports) { glamor_port_private *port_priv; XF86VideoAdaptorPtr adapt; int i; glamor_xv_core_init(screen); adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + num_texture_ports * (sizeof(glamor_port_private) + sizeof(DevUnion))); if (adapt == NULL) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = 0; adapt->name = "GLAMOR Textured Video"; adapt->nEncodings = 1; adapt->pEncodings = DummyEncodingGLAMOR; adapt->nFormats = NUM_FORMATS; adapt->pFormats = Formats; adapt->nPorts = num_texture_ports; adapt->pPortPrivates = (DevUnion *) (&adapt[1]); adapt->pAttributes = glamor_xv_attributes; adapt->nAttributes = glamor_xv_num_attributes; port_priv = (glamor_port_private *) (&adapt->pPortPrivates[num_texture_ports]); adapt->pImages = glamor_xv_images; adapt->nImages = glamor_xv_num_images; adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = glamor_xf86_xv_stop_video; adapt->SetPortAttribute = glamor_xf86_xv_set_port_attribute; adapt->GetPortAttribute = glamor_xf86_xv_get_port_attribute; adapt->QueryBestSize = glamor_xf86_xv_query_best_size; adapt->PutImage = glamor_xf86_xv_put_image; adapt->ReputImage = NULL; adapt->QueryImageAttributes = glamor_xf86_xv_query_image_attributes; for (i = 0; i < num_texture_ports; i++) { glamor_port_private *pPriv = &port_priv[i]; pPriv->brightness = 0; pPriv->contrast = 0; pPriv->saturation = 0; pPriv->hue = 0; pPriv->gamma = 1000; pPriv->transform_index = 0; REGION_NULL(pScreen, &pPriv->clip); adapt->pPortPrivates[i].ptr = (void *) (pPriv); } return adapt; } xorg-server-1.17.1/hw/xfree86/vbe/0000775000175100017510000000000012466505445013565 500000000000000xorg-server-1.17.1/hw/xfree86/vbe/Makefile.am0000664000175100017510000000067012200102654015521 00000000000000module_LTLIBRARIES = libvbe.la 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 AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../modes -I$(srcdir)/../parser \ -I$(srcdir)/../int10 xorg-server-1.17.1/hw/xfree86/vbe/vbe_module.c0000664000175100017510000000073412366220413015762 00000000000000#ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86str.h" #include "vbe.h" static XF86ModuleVersionInfo vbeVersRec = { "vbe", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 1, 0, ABI_CLASS_VIDEODRV, /* needs the video driver ABI */ ABI_VIDEODRV_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData vbeModuleData = { &vbeVersRec, NULL, NULL }; xorg-server-1.17.1/hw/xfree86/vbe/vbeModes.c0000664000175100017510000003771612366220413015417 00000000000000#define DEBUG_VERB 2 /* * Copyright © 2002 David Dawes * * 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 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 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 author(s). * * Authors: David Dawes * */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "xf86.h" #include "vbe.h" #include "vbeModes.h" static int GetDepthFlag(vbeInfoPtr pVbe, int id) { VbeModeInfoBlock *mode; int bpp; if ((mode = VBEGetModeInfo(pVbe, id)) == NULL) return 0; if (VBE_MODE_USABLE(mode, 0)) { int depth; if (VBE_MODE_COLOR(mode)) { depth = mode->RedMaskSize + mode->GreenMaskSize + mode->BlueMaskSize; } else { depth = 1; } bpp = mode->BitsPerPixel; VBEFreeModeInfo(mode); mode = NULL; switch (depth) { case 1: return V_DEPTH_1; case 4: return V_DEPTH_4; case 8: return V_DEPTH_8; case 15: return V_DEPTH_15; case 16: return V_DEPTH_16; case 24: switch (bpp) { case 24: return V_DEPTH_24_24; case 32: return V_DEPTH_24_32; } } } if (mode) VBEFreeModeInfo(mode); return 0; } /* * Find supported mode depths. */ int VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock * vbe, int *flags24, int modeTypes) { int i = 0; int depths = 0; if (modeTypes & V_MODETYPE_VBE) { while (vbe->VideoModePtr[i] != 0xffff) { depths |= GetDepthFlag(pVbe, vbe->VideoModePtr[i++]); } } /* * XXX This possibly only works with VBE 3.0 and later. */ if (modeTypes & V_MODETYPE_VGA) { for (i = 0; i < 0x7F; i++) { depths |= GetDepthFlag(pVbe, i); } } if (flags24) { if (depths & V_DEPTH_24_24) *flags24 |= Support24bppFb; if (depths & V_DEPTH_24_32) *flags24 |= Support32bppFb; } return depths; } static DisplayModePtr CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock * vbe, int id, int flags) { CARD16 major; VbeModeInfoBlock *mode; DisplayModePtr pMode; VbeModeInfoData *data; Bool modeOK = FALSE; major = (unsigned) (vbe->VESAVersion >> 8); if ((mode = VBEGetModeInfo(pVbe, id)) == NULL) return NULL; /* Does the mode match the depth/bpp? */ /* Some BIOS's set BitsPerPixel to 15 instead of 16 for 15/16 */ if (VBE_MODE_USABLE(mode, flags) && ((pScrn->bitsPerPixel == 1 && !VBE_MODE_COLOR(mode)) || (mode->BitsPerPixel > 8 && (mode->RedMaskSize + mode->GreenMaskSize + mode->BlueMaskSize) == pScrn->depth && mode->BitsPerPixel == pScrn->bitsPerPixel) || (mode->BitsPerPixel == 15 && pScrn->depth == 15) || (mode->BitsPerPixel <= 8 && mode->BitsPerPixel == pScrn->bitsPerPixel))) { modeOK = TRUE; xf86ErrorFVerb(DEBUG_VERB, "*"); } xf86ErrorFVerb(DEBUG_VERB, "Mode: %x (%dx%d)\n", id, mode->XResolution, mode->YResolution); xf86ErrorFVerb(DEBUG_VERB, " ModeAttributes: 0x%x\n", mode->ModeAttributes); xf86ErrorFVerb(DEBUG_VERB, " WinAAttributes: 0x%x\n", mode->WinAAttributes); xf86ErrorFVerb(DEBUG_VERB, " WinBAttributes: 0x%x\n", mode->WinBAttributes); xf86ErrorFVerb(DEBUG_VERB, " WinGranularity: %d\n", mode->WinGranularity); xf86ErrorFVerb(DEBUG_VERB, " WinSize: %d\n", mode->WinSize); xf86ErrorFVerb(DEBUG_VERB, " WinASegment: 0x%x\n", mode->WinASegment); xf86ErrorFVerb(DEBUG_VERB, " WinBSegment: 0x%x\n", mode->WinBSegment); xf86ErrorFVerb(DEBUG_VERB, " WinFuncPtr: 0x%lx\n", (unsigned long) mode->WinFuncPtr); xf86ErrorFVerb(DEBUG_VERB, " BytesPerScanline: %d\n", mode->BytesPerScanline); xf86ErrorFVerb(DEBUG_VERB, " XResolution: %d\n", mode->XResolution); xf86ErrorFVerb(DEBUG_VERB, " YResolution: %d\n", mode->YResolution); xf86ErrorFVerb(DEBUG_VERB, " XCharSize: %d\n", mode->XCharSize); xf86ErrorFVerb(DEBUG_VERB, " YCharSize: %d\n", mode->YCharSize); xf86ErrorFVerb(DEBUG_VERB, " NumberOfPlanes: %d\n", mode->NumberOfPlanes); xf86ErrorFVerb(DEBUG_VERB, " BitsPerPixel: %d\n", mode->BitsPerPixel); xf86ErrorFVerb(DEBUG_VERB, " NumberOfBanks: %d\n", mode->NumberOfBanks); xf86ErrorFVerb(DEBUG_VERB, " MemoryModel: %d\n", mode->MemoryModel); xf86ErrorFVerb(DEBUG_VERB, " BankSize: %d\n", mode->BankSize); xf86ErrorFVerb(DEBUG_VERB, " NumberOfImages: %d\n", mode->NumberOfImages); xf86ErrorFVerb(DEBUG_VERB, " RedMaskSize: %d\n", mode->RedMaskSize); xf86ErrorFVerb(DEBUG_VERB, " RedFieldPosition: %d\n", mode->RedFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " GreenMaskSize: %d\n", mode->GreenMaskSize); xf86ErrorFVerb(DEBUG_VERB, " GreenFieldPosition: %d\n", mode->GreenFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " BlueMaskSize: %d\n", mode->BlueMaskSize); xf86ErrorFVerb(DEBUG_VERB, " BlueFieldPosition: %d\n", mode->BlueFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " RsvdMaskSize: %d\n", mode->RsvdMaskSize); xf86ErrorFVerb(DEBUG_VERB, " RsvdFieldPosition: %d\n", mode->RsvdFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " DirectColorModeInfo: %d\n", mode->DirectColorModeInfo); if (major >= 2) { xf86ErrorFVerb(DEBUG_VERB, " PhysBasePtr: 0x%lx\n", (unsigned long) mode->PhysBasePtr); if (major >= 3) { xf86ErrorFVerb(DEBUG_VERB, " LinBytesPerScanLine: %d\n", mode->LinBytesPerScanLine); xf86ErrorFVerb(DEBUG_VERB, " BnkNumberOfImagePages: %d\n", mode->BnkNumberOfImagePages); xf86ErrorFVerb(DEBUG_VERB, " LinNumberOfImagePages: %d\n", mode->LinNumberOfImagePages); xf86ErrorFVerb(DEBUG_VERB, " LinRedMaskSize: %d\n", mode->LinRedMaskSize); xf86ErrorFVerb(DEBUG_VERB, " LinRedFieldPosition: %d\n", mode->LinRedFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " LinGreenMaskSize: %d\n", mode->LinGreenMaskSize); xf86ErrorFVerb(DEBUG_VERB, " LinGreenFieldPosition: %d\n", mode->LinGreenFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " LinBlueMaskSize: %d\n", mode->LinBlueMaskSize); xf86ErrorFVerb(DEBUG_VERB, " LinBlueFieldPosition: %d\n", mode->LinBlueFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " LinRsvdMaskSize: %d\n", mode->LinRsvdMaskSize); xf86ErrorFVerb(DEBUG_VERB, " LinRsvdFieldPosition: %d\n", mode->LinRsvdFieldPosition); xf86ErrorFVerb(DEBUG_VERB, " MaxPixelClock: %ld\n", (unsigned long) mode->MaxPixelClock); } } if (!modeOK) { VBEFreeModeInfo(mode); return NULL; } pMode = xnfcalloc(sizeof(DisplayModeRec), 1); pMode->status = MODE_OK; pMode->type = M_T_BUILTIN; /* for adjust frame */ pMode->HDisplay = mode->XResolution; pMode->VDisplay = mode->YResolution; data = xnfcalloc(sizeof(VbeModeInfoData), 1); data->mode = id; data->data = mode; pMode->PrivSize = sizeof(VbeModeInfoData); pMode->Private = (INT32 *) data; pMode->next = NULL; return pMode; } /* * Check the available BIOS modes, and extract those that match the * requirements into the modePool. Note: modePool is a NULL-terminated * list. */ DisplayModePtr VBEGetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock * vbe, int modeTypes) { DisplayModePtr pMode, p = NULL, modePool = NULL; int i = 0; if (modeTypes & V_MODETYPE_VBE) { while (vbe->VideoModePtr[i] != 0xffff) { int id = vbe->VideoModePtr[i++]; if ((pMode = CheckMode(pScrn, pVbe, vbe, id, modeTypes)) != NULL) { ModeStatus status = MODE_OK; /* Check the mode against a specified virtual size (if any) */ if (pScrn->display->virtualX > 0 && pMode->HDisplay > pScrn->display->virtualX) { status = MODE_VIRTUAL_X; } if (pScrn->display->virtualY > 0 && pMode->VDisplay > pScrn->display->virtualY) { status = MODE_VIRTUAL_Y; } if (status != MODE_OK) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not using mode \"%dx%d\" (%s)\n", pMode->HDisplay, pMode->VDisplay, xf86ModeStatusToString(status)); } else { if (p == NULL) { modePool = pMode; } else { p->next = pMode; } pMode->prev = NULL; p = pMode; } } } } if (modeTypes & V_MODETYPE_VGA) { for (i = 0; i < 0x7F; i++) { if ((pMode = CheckMode(pScrn, pVbe, vbe, i, modeTypes)) != NULL) { ModeStatus status = MODE_OK; /* Check the mode against a specified virtual size (if any) */ if (pScrn->display->virtualX > 0 && pMode->HDisplay > pScrn->display->virtualX) { status = MODE_VIRTUAL_X; } if (pScrn->display->virtualY > 0 && pMode->VDisplay > pScrn->display->virtualY) { status = MODE_VIRTUAL_Y; } if (status != MODE_OK) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not using mode \"%dx%d\" (%s)\n", pMode->HDisplay, pMode->VDisplay, xf86ModeStatusToString(status)); } else { if (p == NULL) { modePool = pMode; } else { p->next = pMode; } pMode->prev = NULL; p = pMode; } } } } return modePool; } void VBESetModeNames(DisplayModePtr pMode) { if (!pMode) return; do { if (!pMode->name) { /* Catch "bad" modes. */ if (pMode->HDisplay > 10000 || pMode->HDisplay < 0 || pMode->VDisplay > 10000 || pMode->VDisplay < 0) { pMode->name = strdup("BADMODE"); } else { char *tmp; XNFasprintf(&tmp, "%dx%d", pMode->HDisplay, pMode->VDisplay); pMode->name = tmp; } } pMode = pMode->next; } while (pMode); } /* * Go through the monitor modes and selecting the best set of * parameters for each BIOS mode. Note: This is only supported in * VBE version 3.0 or later. */ void VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe) { DisplayModePtr pMode; VbeModeInfoData *data; pMode = pScrn->modes; do { DisplayModePtr p, best = NULL; ModeStatus status; for (p = pScrn->monitor->Modes; p != NULL; p = p->next) { if ((p->HDisplay != pMode->HDisplay) || (p->VDisplay != pMode->VDisplay) || (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) continue; /* XXX could support the various V_ flags */ status = xf86CheckModeForMonitor(p, pScrn->monitor); if (status != MODE_OK) continue; if (!best || (p->Clock > best->Clock)) best = p; } if (best) { int clock; data = (VbeModeInfoData *) pMode->Private; pMode->HSync = (float) best->Clock * 1000.0 / best->HTotal + 0.5; pMode->VRefresh = pMode->HSync / best->VTotal + 0.5; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Attempting to use %dHz refresh for mode \"%s\" (%x)\n", (int) pMode->VRefresh, pMode->name, data->mode); data->block = calloc(sizeof(VbeCRTCInfoBlock), 1); data->block->HorizontalTotal = best->HTotal; data->block->HorizontalSyncStart = best->HSyncStart; data->block->HorizontalSyncEnd = best->HSyncEnd; data->block->VerticalTotal = best->VTotal; data->block->VerticalSyncStart = best->VSyncStart; data->block->VerticalSyncEnd = best->VSyncEnd; data->block->Flags = ((best->Flags & V_NHSYNC) ? CRTC_NHSYNC : 0) | ((best->Flags & V_NVSYNC) ? CRTC_NVSYNC : 0); data->block->PixelClock = best->Clock * 1000; /* XXX May not have this. */ clock = VBEGetPixelClock(pVbe, data->mode, data->block->PixelClock); DebugF("Setting clock %.2fMHz, closest is %.2fMHz\n", (double) data->block->PixelClock / 1000000.0, (double) clock / 1000000.0); if (clock) data->block->PixelClock = clock; data->mode |= (1 << 11); data->block->RefreshRate = ((double) (data->block->PixelClock) / (double) (best->HTotal * best->VTotal)) * 100; } pMode = pMode->next; } while (pMode != pScrn->modes); } /* * These wrappers are to allow (temporary) funtionality divergences. */ int VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int pitchInc, int minHeight, int maxHeight, int virtualX, int virtualY, int apertureSize, LookupModeFlags strategy) { return xf86ValidateModes(scrp, availModes, modeNames, clockRanges, linePitches, minPitch, maxPitch, pitchInc, minHeight, maxHeight, virtualX, virtualY, apertureSize, strategy); } void VBEPrintModes(ScrnInfoPtr scrp) { xf86PrintModes(scrp); } xorg-server-1.17.1/hw/xfree86/vbe/vbe.h0000664000175100017510000003001612456571574014437 00000000000000 /* * XFree86 vbe module * Copyright 2000 Egbert Eich * * The mode query/save/set/restore functions from the vesa driver * have been moved here. * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com) * Authors: Paulo César Pereira de Andrade */ #ifndef _VBE_H #define _VBE_H #include "xf86int10.h" #include "xf86DDC.h" typedef enum { DDC_UNCHECKED, DDC_NONE, DDC_1, DDC_2, DDC_1_2 } ddc_lvl; typedef struct { xf86Int10InfoPtr pInt10; int version; void *memory; int real_mode_base; int num_pages; Bool init_int10; ddc_lvl ddc; Bool ddc_blank; } vbeInfoRec, *vbeInfoPtr; #define VBE_VERSION_MAJOR(x) *((CARD8*)(&x) + 1) #define VBE_VERSION_MINOR(x) (CARD8)(x) extern _X_EXPORT vbeInfoPtr VBEInit(xf86Int10InfoPtr pInt, int entityIndex); extern _X_EXPORT vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags); extern _X_EXPORT void vbeFree(vbeInfoPtr pVbe); extern _X_EXPORT xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, void *pDDCModule); #pragma pack(1) typedef struct vbeControllerInfoBlock { CARD8 VbeSignature[4]; CARD16 VbeVersion; CARD32 OemStringPtr; CARD8 Capabilities[4]; CARD32 VideoModePtr; CARD16 TotalMem; CARD16 OemSoftwareRev; CARD32 OemVendorNamePtr; CARD32 OemProductNamePtr; CARD32 OemProductRevPtr; CARD8 Scratch[222]; CARD8 OemData[256]; } vbeControllerInfoRec, *vbeControllerInfoPtr; #if defined(__GNUC__) || defined(__USLC__) || defined(__SUNPRO_C) #pragma pack() /* All GCC versions recognise this syntax */ #else #pragma pack(0) #endif #if !( defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) ) #define __attribute__(a) #endif typedef struct _VbeInfoBlock VbeInfoBlock; typedef struct _VbeModeInfoBlock VbeModeInfoBlock; typedef struct _VbeCRTCInfoBlock VbeCRTCInfoBlock; /* * INT 0 */ struct _VbeInfoBlock { /* VESA 1.2 fields */ CARD8 VESASignature[4]; /* VESA */ CARD16 VESAVersion; /* Higher byte major, lower byte minor */ /*CARD32 */ char *OEMStringPtr; /* Pointer to OEM string */ CARD8 Capabilities[4]; /* Capabilities of the video environment */ /*CARD32 */ CARD16 *VideoModePtr; /* pointer to supported Super VGA modes */ CARD16 TotalMemory; /* Number of 64kb memory blocks on board */ /* if not VESA 2, 236 scratch bytes follow (256 bytes total size) */ /* VESA 2 fields */ CARD16 OemSoftwareRev; /* VBE implementation Software revision */ /*CARD32 */ char *OemVendorNamePtr; /* Pointer to Vendor Name String */ /*CARD32 */ char *OemProductNamePtr; /* Pointer to Product Name String */ /*CARD32 */ char *OemProductRevPtr; /* Pointer to Product Revision String */ CARD8 Reserved[222]; /* Reserved for VBE implementation */ CARD8 OemData[256]; /* Data Area for OEM Strings */ } __attribute__ ((packed)); /* Return Super VGA Information */ extern _X_EXPORT VbeInfoBlock *VBEGetVBEInfo(vbeInfoPtr pVbe); extern _X_EXPORT void VBEFreeVBEInfo(VbeInfoBlock * block); /* * INT 1 */ struct _VbeModeInfoBlock { CARD16 ModeAttributes; /* mode attributes */ CARD8 WinAAttributes; /* window A attributes */ CARD8 WinBAttributes; /* window B attributes */ CARD16 WinGranularity; /* window granularity */ CARD16 WinSize; /* window size */ CARD16 WinASegment; /* window A start segment */ CARD16 WinBSegment; /* window B start segment */ CARD32 WinFuncPtr; /* real mode pointer to window function */ CARD16 BytesPerScanline; /* bytes per scanline */ /* Mandatory information for VBE 1.2 and above */ CARD16 XResolution; /* horizontal resolution in pixels or characters */ CARD16 YResolution; /* vertical resolution in pixels or characters */ CARD8 XCharSize; /* character cell width in pixels */ CARD8 YCharSize; /* character cell height in pixels */ CARD8 NumberOfPlanes; /* number of memory planes */ CARD8 BitsPerPixel; /* bits per pixel */ CARD8 NumberOfBanks; /* number of banks */ CARD8 MemoryModel; /* memory model type */ CARD8 BankSize; /* bank size in KB */ CARD8 NumberOfImages; /* number of images */ CARD8 Reserved; /* 1 *//* reserved for page function */ /* Direct color fields (required for direct/6 and YUV/7 memory models) */ CARD8 RedMaskSize; /* size of direct color red mask in bits */ CARD8 RedFieldPosition; /* bit position of lsb of red mask */ CARD8 GreenMaskSize; /* size of direct color green mask in bits */ CARD8 GreenFieldPosition; /* bit position of lsb of green mask */ CARD8 BlueMaskSize; /* size of direct color blue mask in bits */ CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */ CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */ CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */ CARD8 DirectColorModeInfo; /* direct color mode attributes */ /* Mandatory information for VBE 2.0 and above */ CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */ CARD32 Reserved32; /* 0 *//* Reserved - always set to 0 */ CARD16 Reserved16; /* 0 *//* Reserved - always set to 0 */ /* Mandatory information for VBE 3.0 and above */ CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */ CARD8 BnkNumberOfImagePages; /* number of images for banked modes */ CARD8 LinNumberOfImagePages; /* number of images for linear modes */ CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */ CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */ CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */ CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */ CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */ CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */ CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */ CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */ CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */ CARD8 Reserved2[189]; /* remainder of VbeModeInfoBlock */ } __attribute__ ((packed)); /* Return VBE Mode Information */ extern _X_EXPORT VbeModeInfoBlock *VBEGetModeInfo(vbeInfoPtr pVbe, int mode); extern _X_EXPORT void VBEFreeModeInfo(VbeModeInfoBlock * block); /* * INT2 */ #define CRTC_DBLSCAN (1<<0) #define CRTC_INTERLACE (1<<1) #define CRTC_NHSYNC (1<<2) #define CRTC_NVSYNC (1<<3) struct _VbeCRTCInfoBlock { CARD16 HorizontalTotal; /* Horizontal total in pixels */ CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */ CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */ CARD16 VerticalTotal; /* Vertical total in lines */ CARD16 VerticalSyncStart; /* Vertical sync start in lines */ CARD16 VerticalSyncEnd; /* Vertical sync end in lines */ CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */ CARD32 PixelClock; /* Pixel clock in units of Hz */ CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */ CARD8 Reserved[40]; /* remainder of ModeInfoBlock */ } __attribute__ ((packed)); /* VbeCRTCInfoBlock is in the VESA 3.0 specs */ extern _X_EXPORT Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock * crtc); /* * INT 3 */ extern _X_EXPORT Bool VBEGetVBEMode(vbeInfoPtr pVbe, int *mode); /* * INT 4 */ /* Save/Restore Super VGA video state */ /* function values are (values stored in VESAPtr): * 0 := query & allocate amount of memory to save state * 1 := save state * 2 := restore state * * function 0 called automatically if function 1 called without * a previous call to function 0. */ typedef enum { MODE_QUERY, MODE_SAVE, MODE_RESTORE } vbeSaveRestoreFunction; extern _X_EXPORT Bool VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction fuction, void **memory, int *size, int *real_mode_pages); /* * INT 5 */ extern _X_EXPORT Bool VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window); /* * INT 6 */ typedef enum { SCANWID_SET, SCANWID_GET, SCANWID_SET_BYTES, SCANWID_GET_MAX } vbeScanwidthCommand; #define VBESetLogicalScanline(pVbe, width) \ VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, width, \ NULL, NULL, NULL) #define VBESetLogicalScanlineBytes(pVbe, width) \ VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET_BYTES, width, \ NULL, NULL, NULL) #define VBEGetLogicalScanline(pVbe, pixels, bytes, max) \ VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET, 0, \ pixels, bytes, max) #define VBEGetMaxLogicalScanline(pVbe, pixels, bytes, max) \ VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, 0, \ pixels, bytes, max) extern _X_EXPORT Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe, vbeScanwidthCommand command, int width, int *pixels, int *bytes, int *max); /* * INT 7 */ /* 16 bit code */ extern _X_EXPORT Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace); extern _X_EXPORT Bool VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y); /* * INT 8 */ /* if bits is 0, then it is a GET */ extern _X_EXPORT int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits); /* * INT 9 */ /* * If getting a palette, the data argument is not used. It will return * the data. * If setting a palette, it will return the pointer received on success, * NULL on failure. */ extern _X_EXPORT CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num, CARD32 *data, Bool secondary, Bool wait_retrace); #define VBEFreePaletteData(data) free(data) /* * INT A */ typedef struct _VBEpmi { int seg_tbl; int tbl_off; int tbl_len; } VBEpmi; extern _X_EXPORT VBEpmi *VBEGetVBEpmi(vbeInfoPtr pVbe); #define VESAFreeVBEpmi(pmi) free(pmi) /* high level helper functions */ typedef struct _vbeModeInfoRec { int width; int height; int bpp; int n; struct _vbeModeInfoRec *next; } vbeModeInfoRec, *vbeModeInfoPtr; typedef struct { CARD8 *state; CARD8 *pstate; int statePage; int stateSize; int stateMode; } vbeSaveRestoreRec, *vbeSaveRestorePtr; extern _X_EXPORT void VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr, vbeSaveRestoreFunction function); extern _X_EXPORT int VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int Clock); extern _X_EXPORT Bool VBEDPMSSet(vbeInfoPtr pVbe, int mode); struct vbePanelID { short hsize; short vsize; short fptype; char redbpp; char greenbpp; char bluebpp; char reservedbpp; int reserved_offscreen_mem_size; int reserved_offscreen_mem_pointer; char reserved[14]; }; extern _X_EXPORT void VBEInterpretPanelID(ScrnInfoPtr pScrn, struct vbePanelID *data); extern _X_EXPORT struct vbePanelID *VBEReadPanelID(vbeInfoPtr pVbe); #endif xorg-server-1.17.1/hw/xfree86/vbe/vbeModes.h0000664000175100017510000000755212274325511015422 00000000000000/* * Copyright © 2002 David Dawes * * 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 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 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 author(s). * * Authors: David Dawes * */ #ifndef _VBE_MODES_H /* * This is intended to be stored in the DisplayModeRec's private area. * It includes all the information necessary to VBE information. */ typedef struct _VbeModeInfoData { int mode; VbeModeInfoBlock *data; VbeCRTCInfoBlock *block; } VbeModeInfoData; #define V_DEPTH_1 0x001 #define V_DEPTH_4 0x002 #define V_DEPTH_8 0x004 #define V_DEPTH_15 0x008 #define V_DEPTH_16 0x010 #define V_DEPTH_24_24 0x020 #define V_DEPTH_24_32 0x040 #define V_DEPTH_24 (V_DEPTH_24_24 | V_DEPTH_24_32) #define V_DEPTH_30 0x080 #define V_DEPTH_32 0x100 #define VBE_MODE_SUPPORTED(m) (((m)->ModeAttributes & 0x01) != 0) #define VBE_MODE_COLOR(m) (((m)->ModeAttributes & 0x08) != 0) #define VBE_MODE_GRAPHICS(m) (((m)->ModeAttributes & 0x10) != 0) #define VBE_MODE_VGA(m) (((m)->ModeAttributes & 0x40) == 0) #define VBE_MODE_LINEAR(m) (((m)->ModeAttributes & 0x80) != 0 && \ ((m)->PhysBasePtr != 0)) #define VBE_MODE_USABLE(m, f) (VBE_MODE_SUPPORTED(m) || \ (f & V_MODETYPE_BAD)) && \ VBE_MODE_GRAPHICS(m) && \ (VBE_MODE_VGA(m) || VBE_MODE_LINEAR(m)) #define V_MODETYPE_VBE 0x01 #define V_MODETYPE_VGA 0x02 #define V_MODETYPE_BAD 0x04 extern _X_EXPORT int VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock * vbe, int *flags24, int modeTypes); extern _X_EXPORT DisplayModePtr VBEGetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock * vbe, int modeTypes); extern _X_EXPORT void VBESetModeNames(DisplayModePtr pMode); extern _X_EXPORT void VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe); /* * Note: These are alternatives to the standard helpers. They should * usually just wrap the standard helpers. */ extern _X_EXPORT int VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int pitchInc, int minHeight, int maxHeight, int virtualX, int virtualY, int apertureSize, LookupModeFlags strategy); extern _X_EXPORT void VBEPrintModes(ScrnInfoPtr scrp); #endif /* VBE_MODES_H */ xorg-server-1.17.1/hw/xfree86/vbe/Makefile.in0000664000175100017510000007103312466505434015554 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/vbe DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) @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@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libvbe_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libvbe_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 = $(libvbe_la_SOURCES) DIST_SOURCES = $(libvbe_la_SOURCES) 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ module_LTLIBRARIES = libvbe.la 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) AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../modes -I$(srcdir)/../parser \ -I$(srcdir)/../int10 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/vbe/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/vbe/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libvbe.la: $(libvbe_la_OBJECTS) $(libvbe_la_DEPENDENCIES) $(EXTRA_libvbe_la_DEPENDENCIES) $(AM_V_CCLD)$(libvbe_la_LINK) -rpath $(moduledir) $(libvbe_la_OBJECTS) $(libvbe_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vbe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vbeModes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vbe_module.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-moduleLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am uninstall \ uninstall-am uninstall-moduleLTLIBRARIES 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: xorg-server-1.17.1/hw/xfree86/vbe/vbe.c0000664000175100017510000007401712456571574014443 00000000000000 /* * XFree86 vbe module * Copyright 2000 Egbert Eich * * The mode query/save/set/restore functions from the vesa driver * have been moved here. * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com) * Authors: Paulo César Pereira de Andrade */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86Modes.h" #include "vbe.h" #include #define VERSION(x) VBE_VERSION_MAJOR(x),VBE_VERSION_MINOR(x) #if X_BYTE_ORDER == X_LITTLE_ENDIAN #define B_O16(x) (x) #define B_O32(x) (x) #else #define B_O16(x) ((((x) & 0xff) << 8) | (((x) & 0xff) >> 8)) #define B_O32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) \ | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24)) #endif #define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00) #define FARP(p) (((unsigned)(p & 0xffff0000) >> 12) | (p & 0xffff)) #define R16(v) ((v) & 0xffff) static unsigned char *vbeReadEDID(vbeInfoPtr pVbe); static Bool vbeProbeDDC(vbeInfoPtr pVbe); static const char vbeVersionString[] = "VBE2"; vbeInfoPtr VBEInit(xf86Int10InfoPtr pInt, int entityIndex) { return VBEExtendedInit(pInt, entityIndex, 0); } vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags) { int RealOff; void *page = NULL; ScrnInfoPtr pScrn = xf86FindScreenForEntity(entityIndex); vbeControllerInfoPtr vbe = NULL; Bool init_int10 = FALSE; vbeInfoPtr vip = NULL; int screen; if (!pScrn) return NULL; screen = pScrn->scrnIndex; if (!pInt) { if (!xf86LoadSubModule(pScrn, "int10")) goto error; xf86DrvMsg(screen, X_INFO, "initializing int10\n"); pInt = xf86ExtendedInitInt10(entityIndex, Flags); if (!pInt) goto error; init_int10 = TRUE; } page = xf86Int10AllocPages(pInt, 1, &RealOff); if (!page) goto error; vbe = (vbeControllerInfoPtr) page; memcpy(vbe->VbeSignature, vbeVersionString, 4); pInt->ax = 0x4F00; pInt->es = SEG_ADDR(RealOff); pInt->di = SEG_OFF(RealOff); pInt->num = 0x10; xf86ExecX86int10(pInt); if ((pInt->ax & 0xff) != 0x4f) { xf86DrvMsgVerb(screen, X_INFO, 3, "VESA BIOS not detected\n"); goto error; } switch (pInt->ax & 0xff00) { case 0: xf86DrvMsg(screen, X_INFO, "VESA BIOS detected\n"); break; case 0x100: xf86DrvMsg(screen, X_INFO, "VESA BIOS function failed\n"); goto error; case 0x200: xf86DrvMsg(screen, X_INFO, "VESA BIOS not supported\n"); goto error; case 0x300: xf86DrvMsg(screen, X_INFO, "VESA BIOS not supported in current mode\n"); goto error; default: xf86DrvMsg(screen, X_INFO, "Invalid\n"); goto error; } xf86DrvMsgVerb(screen, X_INFO, 4, "VbeVersion is %d, OemStringPtr is 0x%08lx,\n" "\tOemVendorNamePtr is 0x%08lx, OemProductNamePtr is 0x%08lx,\n" "\tOemProductRevPtr is 0x%08lx\n", vbe->VbeVersion, (unsigned long) vbe->OemStringPtr, (unsigned long) vbe->OemVendorNamePtr, (unsigned long) vbe->OemProductNamePtr, (unsigned long) vbe->OemProductRevPtr); xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE Version %i.%i\n", VERSION(vbe->VbeVersion)); xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE Total Mem: %i kB\n", vbe->TotalMem * 64); xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE OEM: %s\n", (CARD8 *) xf86int10Addr(pInt, L_ADD(vbe->OemStringPtr))); if (B_O16(vbe->VbeVersion) >= 0x200) { xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE OEM Software Rev: %i.%i\n", VERSION(vbe->OemSoftwareRev)); if (vbe->OemVendorNamePtr) xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE OEM Vendor: %s\n", (CARD8 *) xf86int10Addr(pInt, L_ADD(vbe-> OemVendorNamePtr))); if (vbe->OemProductNamePtr) xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE OEM Product: %s\n", (CARD8 *) xf86int10Addr(pInt, L_ADD(vbe-> OemProductNamePtr))); if (vbe->OemProductRevPtr) xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE OEM Product Rev: %s\n", (CARD8 *) xf86int10Addr(pInt, L_ADD(vbe-> OemProductRevPtr))); } vip = (vbeInfoPtr) xnfalloc(sizeof(vbeInfoRec)); vip->version = B_O16(vbe->VbeVersion); vip->pInt10 = pInt; vip->ddc = DDC_UNCHECKED; vip->memory = page; vip->real_mode_base = RealOff; vip->num_pages = 1; vip->init_int10 = init_int10; return vip; error: if (page) xf86Int10FreePages(pInt, page, 1); if (init_int10) xf86FreeInt10(pInt); return NULL; } void vbeFree(vbeInfoPtr pVbe) { if (!pVbe) return; xf86Int10FreePages(pVbe->pInt10, pVbe->memory, pVbe->num_pages); /* If we have initalized int10 we ought to free it, too */ if (pVbe->init_int10) xf86FreeInt10(pVbe->pInt10); free(pVbe); return; } static Bool vbeProbeDDC(vbeInfoPtr pVbe) { const char *ddc_level; int screen = pVbe->pInt10->pScrn->scrnIndex; if (pVbe->ddc == DDC_NONE) return FALSE; if (pVbe->ddc != DDC_UNCHECKED) return TRUE; pVbe->pInt10->ax = 0x4F15; pVbe->pInt10->bx = 0; pVbe->pInt10->cx = 0; pVbe->pInt10->es = 0; pVbe->pInt10->di = 0; pVbe->pInt10->num = 0x10; xf86ExecX86int10(pVbe->pInt10); if ((pVbe->pInt10->ax & 0xff) != 0x4f) { xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC not supported\n"); pVbe->ddc = DDC_NONE; return FALSE; } switch ((pVbe->pInt10->ax >> 8) & 0xff) { case 0: xf86DrvMsg(screen, X_INFO, "VESA VBE DDC supported\n"); switch (pVbe->pInt10->bx & 0x3) { case 0: ddc_level = " none"; pVbe->ddc = DDC_NONE; break; case 1: ddc_level = " 1"; pVbe->ddc = DDC_1; break; case 2: ddc_level = " 2"; pVbe->ddc = DDC_2; break; case 3: ddc_level = " 1 + 2"; pVbe->ddc = DDC_1_2; break; default: ddc_level = ""; pVbe->ddc = DDC_NONE; break; } xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC Level%s\n", ddc_level); if (pVbe->pInt10->bx & 0x4) { xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC Screen blanked" "for data transfer\n"); pVbe->ddc_blank = TRUE; } else pVbe->ddc_blank = FALSE; xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC transfer in appr. %x sec.\n", (pVbe->pInt10->bx >> 8) & 0xff); } return TRUE; } typedef enum { VBEOPT_NOVBE, VBEOPT_NODDC } VBEOpts; static const OptionInfoRec VBEOptions[] = { {VBEOPT_NOVBE, "NoVBE", OPTV_BOOLEAN, {0}, FALSE}, {VBEOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; static unsigned char * vbeReadEDID(vbeInfoPtr pVbe) { int RealOff = pVbe->real_mode_base; void *page = pVbe->memory; unsigned char *tmp = NULL; Bool novbe = FALSE; Bool noddc = FALSE; ScrnInfoPtr pScrn = pVbe->pInt10->pScrn; int screen = pScrn->scrnIndex; OptionInfoPtr options; if (!page) return NULL; options = xnfalloc(sizeof(VBEOptions)); (void) memcpy(options, VBEOptions, sizeof(VBEOptions)); xf86ProcessOptions(screen, pScrn->options, options); xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe); xf86GetOptValBool(options, VBEOPT_NODDC, &noddc); free(options); if (novbe || noddc) return NULL; if (!vbeProbeDDC(pVbe)) goto error; memset(page, 0, sizeof(vbeInfoPtr)); strcpy(page, vbeVersionString); pVbe->pInt10->ax = 0x4F15; pVbe->pInt10->bx = 0x01; pVbe->pInt10->cx = 0; pVbe->pInt10->dx = 0; pVbe->pInt10->es = SEG_ADDR(RealOff); pVbe->pInt10->di = SEG_OFF(RealOff); pVbe->pInt10->num = 0x10; xf86ExecX86int10(pVbe->pInt10); if ((pVbe->pInt10->ax & 0xff) != 0x4f) { xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC invalid\n"); goto error; } switch (pVbe->pInt10->ax & 0xff00) { case 0x0: xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC read successfully\n"); tmp = (unsigned char *) xnfalloc(128); memcpy(tmp, page, 128); break; case 0x100: xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC read failed\n"); break; default: xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE DDC unkown failure %i\n", pVbe->pInt10->ax & 0xff00); break; } error: return tmp; } xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, void *unused) { unsigned char *DDC_data = NULL; if (!pVbe) return NULL; if (pVbe->version < 0x200) return NULL; DDC_data = vbeReadEDID(pVbe); if (!DDC_data) return NULL; return xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data); } #define GET_UNALIGNED2(x) \ ((*(CARD16*)(x)) | (*(((CARD16*)(x) + 1))) << 16) VbeInfoBlock * VBEGetVBEInfo(vbeInfoPtr pVbe) { VbeInfoBlock *block = NULL; int i, pStr, pModes; char *str; CARD16 major, *modes; memset(pVbe->memory, 0, sizeof(VbeInfoBlock)); /* Input: AH := 4Fh Super VGA support AL := 00h Return Super VGA information ES:DI := Pointer to buffer Output: AX := status (All other registers are preserved) */ ((char *) pVbe->memory)[0] = 'V'; ((char *) pVbe->memory)[1] = 'B'; ((char *) pVbe->memory)[2] = 'E'; ((char *) pVbe->memory)[3] = '2'; pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f00; pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base); pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base); xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return NULL; block = calloc(sizeof(VbeInfoBlock), 1); block->VESASignature[0] = ((char *) pVbe->memory)[0]; block->VESASignature[1] = ((char *) pVbe->memory)[1]; block->VESASignature[2] = ((char *) pVbe->memory)[2]; block->VESASignature[3] = ((char *) pVbe->memory)[3]; block->VESAVersion = *(CARD16 *) (((char *) pVbe->memory) + 4); major = (unsigned) block->VESAVersion >> 8; pStr = GET_UNALIGNED2((((char *) pVbe->memory) + 6)); str = xf86int10Addr(pVbe->pInt10, FARP(pStr)); block->OEMStringPtr = strdup(str); block->Capabilities[0] = ((char *) pVbe->memory)[10]; block->Capabilities[1] = ((char *) pVbe->memory)[11]; block->Capabilities[2] = ((char *) pVbe->memory)[12]; block->Capabilities[3] = ((char *) pVbe->memory)[13]; pModes = GET_UNALIGNED2((((char *) pVbe->memory) + 14)); modes = xf86int10Addr(pVbe->pInt10, FARP(pModes)); i = 0; while (modes[i] != 0xffff) i++; block->VideoModePtr = malloc(sizeof(CARD16) * (i + 1)); memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i); block->VideoModePtr[i] = 0xffff; block->TotalMemory = *(CARD16 *) (((char *) pVbe->memory) + 18); if (major < 2) memcpy(&block->OemSoftwareRev, ((char *) pVbe->memory) + 20, 236); else { block->OemSoftwareRev = *(CARD16 *) (((char *) pVbe->memory) + 20); pStr = GET_UNALIGNED2((((char *) pVbe->memory) + 22)); str = xf86int10Addr(pVbe->pInt10, FARP(pStr)); block->OemVendorNamePtr = strdup(str); pStr = GET_UNALIGNED2((((char *) pVbe->memory) + 26)); str = xf86int10Addr(pVbe->pInt10, FARP(pStr)); block->OemProductNamePtr = strdup(str); pStr = GET_UNALIGNED2((((char *) pVbe->memory) + 30)); str = xf86int10Addr(pVbe->pInt10, FARP(pStr)); block->OemProductRevPtr = strdup(str); memcpy(&block->Reserved, ((char *) pVbe->memory) + 34, 222); memcpy(&block->OemData, ((char *) pVbe->memory) + 256, 256); } return block; } void VBEFreeVBEInfo(VbeInfoBlock * block) { free(block->OEMStringPtr); free(block->VideoModePtr); if (((unsigned) block->VESAVersion >> 8) >= 2) { free(block->OemVendorNamePtr); free(block->OemProductNamePtr); free(block->OemProductRevPtr); } free(block); } Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock * block) { /* Input: AH := 4Fh Super VGA support AL := 02h Set Super VGA video mode BX := Video mode D0-D8 := Mode number D9-D10 := Reserved (must be 0) D11 := 0 Use current default refresh rate := 1 Use user specified CRTC values for refresh rate D12-13 Reserved for VBE/AF (must be 0) D14 := 0 Use windowed frame buffer model := 1 Use linear/flat frame buffer model D15 := 0 Clear video memory := 1 Don't clear video memory ES:DI := Pointer to VbeCRTCInfoBlock structure Output: AX = Status (All other registers are preserved) */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f02; pVbe->pInt10->bx = mode; if (block) { pVbe->pInt10->bx |= 1 << 11; memcpy(pVbe->memory, block, sizeof(VbeCRTCInfoBlock)); pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base); pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base); } else pVbe->pInt10->bx &= ~(1 << 11); xf86ExecX86int10(pVbe->pInt10); return (R16(pVbe->pInt10->ax) == 0x4f); } Bool VBEGetVBEMode(vbeInfoPtr pVbe, int *mode) { /* Input: AH := 4Fh Super VGA support AL := 03h Return current video mode Output: AX := Status BX := Current video mode (All other registers are preserved) */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f03; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) == 0x4f) { *mode = R16(pVbe->pInt10->bx); return TRUE; } return FALSE; } VbeModeInfoBlock * VBEGetModeInfo(vbeInfoPtr pVbe, int mode) { VbeModeInfoBlock *block = NULL; memset(pVbe->memory, 0, sizeof(VbeModeInfoBlock)); /* Input: AH := 4Fh Super VGA support AL := 01h Return Super VGA mode information CX := Super VGA video mode (mode number must be one of those returned by Function 0) ES:DI := Pointer to buffer Output: AX := status (All other registers are preserved) */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f01; pVbe->pInt10->cx = mode; pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base); pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base); xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return NULL; block = malloc(sizeof(VbeModeInfoBlock)); if (block) memcpy(block, pVbe->memory, sizeof(*block)); return block; } void VBEFreeModeInfo(VbeModeInfoBlock * block) { free(block); } Bool VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function, void **memory, int *size, int *real_mode_pages) { /* Input: AH := 4Fh Super VGA support AL := 04h Save/restore Super VGA video state DL := 00h Return save/restore state buffer size CX := Requested states D0 = Save/restore video hardware state D1 = Save/restore video BIOS data state D2 = Save/restore video DAC state D3 = Save/restore Super VGA state Output: AX = Status BX = Number of 64-byte blocks to hold the state buffer (All other registers are preserved) Input: AH := 4Fh Super VGA support AL := 04h Save/restore Super VGA video state DL := 01h Save Super VGA video state CX := Requested states (see above) ES:BX := Pointer to buffer Output: AX := Status (All other registers are preserved) Input: AH := 4Fh Super VGA support AL := 04h Save/restore Super VGA video state DL := 02h Restore Super VGA video state CX := Requested states (see above) ES:BX := Pointer to buffer Output: AX := Status (All other registers are preserved) */ if ((pVbe->version & 0xff00) > 0x100) { int screen = pVbe->pInt10->pScrn->scrnIndex; if (function == MODE_QUERY || (function == MODE_SAVE && !*memory)) { /* Query amount of memory to save state */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f04; pVbe->pInt10->dx = 0; pVbe->pInt10->cx = 0x000f; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return FALSE; if (function == MODE_SAVE) { int npages = (R16(pVbe->pInt10->bx) * 64) / 4096 + 1; if ((*memory = xf86Int10AllocPages(pVbe->pInt10, npages, real_mode_pages)) == NULL) { xf86DrvMsg(screen, X_ERROR, "Cannot allocate memory to save SVGA state.\n"); return FALSE; } } *size = pVbe->pInt10->bx * 64; } /* Save/Restore Super VGA state */ if (function != MODE_QUERY) { if (!*memory) return FALSE; pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f04; switch (function) { case MODE_SAVE: pVbe->pInt10->dx = 1; break; case MODE_RESTORE: pVbe->pInt10->dx = 2; break; case MODE_QUERY: return FALSE; } pVbe->pInt10->cx = 0x000f; pVbe->pInt10->es = SEG_ADDR(*real_mode_pages); pVbe->pInt10->bx = SEG_OFF(*real_mode_pages); xf86ExecX86int10(pVbe->pInt10); return (R16(pVbe->pInt10->ax) == 0x4f); } } return TRUE; } Bool VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window) { /* Input: AH := 4Fh Super VGA support AL := 05h Output: */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f05; pVbe->pInt10->bx = window; pVbe->pInt10->dx = iBank; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return FALSE; return TRUE; } Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe, vbeScanwidthCommand command, int width, int *pixels, int *bytes, int *max) { if (command < SCANWID_SET || command > SCANWID_GET_MAX) return FALSE; /* Input: AX := 4F06h VBE Set/Get Logical Scan Line Length BL := 00h Set Scan Line Length in Pixels := 01h Get Scan Line Length := 02h Set Scan Line Length in Bytes := 03h Get Maximum Scan Line Length CX := If BL=00h Desired Width in Pixels If BL=02h Desired Width in Bytes (Ignored for Get Functions) Output: AX := VBE Return Status BX := Bytes Per Scan Line CX := Actual Pixels Per Scan Line (truncated to nearest complete pixel) DX := Maximum Number of Scan Lines */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f06; pVbe->pInt10->bx = command; if (command == SCANWID_SET || command == SCANWID_SET_BYTES) pVbe->pInt10->cx = width; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return FALSE; if (command == SCANWID_GET || command == SCANWID_GET_MAX) { if (pixels) *pixels = R16(pVbe->pInt10->cx); if (bytes) *bytes = R16(pVbe->pInt10->bx); if (max) *max = R16(pVbe->pInt10->dx); } return TRUE; } Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace) { pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f07; pVbe->pInt10->bx = wait_retrace ? 0x80 : 0x00; pVbe->pInt10->cx = x; pVbe->pInt10->dx = y; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return FALSE; return TRUE; } Bool VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y) { pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f07; pVbe->pInt10->bx = 0x01; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return FALSE; *x = pVbe->pInt10->cx; *y = pVbe->pInt10->dx; return TRUE; } int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits) { /* Input: AX := 4F08h VBE Set/Get Palette Format BL := 00h Set DAC Palette Format := 01h Get DAC Palette Format BH := Desired bits of color per primary (Set DAC Palette Format only) Output: AX := VBE Return Status BH := Current number of bits of color per primary */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f08; if (!bits) pVbe->pInt10->bx = 0x01; else pVbe->pInt10->bx = (bits & 0x00ff) << 8; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return 0; return (bits != 0 ? bits : (pVbe->pInt10->bx >> 8) & 0x00ff); } CARD32 * VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num, CARD32 *data, Bool secondary, Bool wait_retrace) { /* Input: (16-bit) AX := 4F09h VBE Load/Unload Palette Data BL := 00h Set Palette Data := 01h Get Palette Data := 02h Set Secondary Palette Data := 03h Get Secondary Palette Data := 80h Set Palette Data during Vertical Retrace CX := Number of palette registers to update (to a maximum of 256) DX := First of the palette registers to update (start) ES:DI := Table of palette values (see below for format) Output: AX := VBE Return Status Input: (32-bit) BL := 00h Set Palette Data := 80h Set Palette Data during Vertical Retrace CX := Number of palette registers to update (to a maximum of 256) DX := First of the palette registers to update (start) ES:EDI := Table of palette values (see below for format) DS := Selector for memory mapped registers */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f09; if (!secondary) pVbe->pInt10->bx = set && wait_retrace ? 0x80 : set ? 0 : 1; else pVbe->pInt10->bx = set ? 2 : 3; pVbe->pInt10->cx = num; pVbe->pInt10->dx = first; pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base); pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base); if (set) memcpy(pVbe->memory, data, num * sizeof(CARD32)); xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return NULL; if (set) return data; data = malloc(num * sizeof(CARD32)); memcpy(data, pVbe->memory, num * sizeof(CARD32)); return data; } VBEpmi * VBEGetVBEpmi(vbeInfoPtr pVbe) { VBEpmi *pmi; /* Input: AH := 4Fh Super VGA support AL := 0Ah Protected Mode Interface BL := 00h Return Protected Mode Table Output: AX := Status ES := Real Mode Segment of Table DI := Offset of Table CX := Lenght of Table including protected mode code in bytes (for copying purposes) (All other registers are preserved) */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f0a; pVbe->pInt10->bx = 0; pVbe->pInt10->di = 0; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return NULL; pmi = malloc(sizeof(VBEpmi)); pmi->seg_tbl = R16(pVbe->pInt10->es); pmi->tbl_off = R16(pVbe->pInt10->di); pmi->tbl_len = R16(pVbe->pInt10->cx); return pmi; } #if 0 vbeModeInfoPtr VBEBuildVbeModeList(vbeInfoPtr pVbe, VbeInfoBlock * vbe) { vbeModeInfoPtr ModeList = NULL; int i = 0; while (vbe->VideoModePtr[i] != 0xffff) { vbeModeInfoPtr m; VbeModeInfoBlock *mode; int id = vbe->VideoModePtr[i++]; int bpp; if ((mode = VBEGetModeInfo(pVbe, id)) == NULL) continue; bpp = mode->BitsPerPixel; m = xnfcalloc(sizeof(vbeModeInfoRec), 1); m->width = mode->XResolution; m->height = mode->YResolution; m->bpp = bpp; m->n = id; m->next = ModeList; 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); ModeList = m; VBEFreeModeInfo(mode); } return ModeList; } unsigned short VBECalcVbeModeIndex(vbeModeInfoPtr m, DisplayModePtr mode, int bpp) { while (m) { if (bpp == m->bpp && mode->HDisplay == m->width && mode->VDisplay == m->height) return m->n; m = m->next; } return 0; } #endif void VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr, vbeSaveRestoreFunction function) { Bool SaveSucc = FALSE; if (VBE_VERSION_MAJOR(pVbe->version) > 1 && (function == MODE_SAVE || vbe_sr->pstate)) { if (function == MODE_RESTORE) memcpy(vbe_sr->state, vbe_sr->pstate, vbe_sr->stateSize); ErrorF("VBESaveRestore\n"); if ((VBESaveRestore(pVbe, function, (void *) &vbe_sr->state, &vbe_sr->stateSize, &vbe_sr->statePage))) { if (function == MODE_SAVE) { SaveSucc = TRUE; vbe_sr->stateMode = -1; /* invalidate */ /* don't rely on the memory not being touched */ if (vbe_sr->pstate == NULL) vbe_sr->pstate = malloc(vbe_sr->stateSize); memcpy(vbe_sr->pstate, vbe_sr->state, vbe_sr->stateSize); } ErrorF("VBESaveRestore done with success\n"); return; } ErrorF("VBESaveRestore done\n"); } if (function == MODE_SAVE && !SaveSucc) (void) VBEGetVBEMode(pVbe, &vbe_sr->stateMode); if (function == MODE_RESTORE && vbe_sr->stateMode != -1) VBESetVBEMode(pVbe, vbe_sr->stateMode, NULL); } int VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int clock) { /* Input: AX := 4F0Bh VBE Get Pixel Clock BL := 00h Get Pixel Clock ECX := pixel clock in units of Hz DX := mode number Output: AX := VBE Return Status ECX := Closest pixel clock */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f0b; pVbe->pInt10->bx = 0x00; pVbe->pInt10->cx = clock; pVbe->pInt10->dx = mode; xf86ExecX86int10(pVbe->pInt10); if (R16(pVbe->pInt10->ax) != 0x4f) return 0; return pVbe->pInt10->cx; } Bool VBEDPMSSet(vbeInfoPtr pVbe, int mode) { /* Input: AX := 4F10h DPMS BL := 01h Set Display Power State BH := requested power state Output: AX := VBE Return Status */ pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x4f10; pVbe->pInt10->bx = 0x01; switch (mode) { case DPMSModeOn: break; case DPMSModeStandby: pVbe->pInt10->bx |= 0x100; break; case DPMSModeSuspend: pVbe->pInt10->bx |= 0x200; break; case DPMSModeOff: pVbe->pInt10->bx |= 0x400; break; } xf86ExecX86int10(pVbe->pInt10); return (R16(pVbe->pInt10->ax) == 0x4f); } void VBEInterpretPanelID(ScrnInfoPtr pScrn, struct vbePanelID *data) { DisplayModePtr mode; const float PANEL_HZ = 60.0; if (!data) return; 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(pScrn->scrnIndex, X_INFO, "...which I refuse to believe\n"); return; } mode = xf86CVTMode(data->hsize, data->vsize, PANEL_HZ, 1, 0); pScrn->monitor->nHsync = 1; pScrn->monitor->hsync[0].lo = 29.37; pScrn->monitor->hsync[0].hi = (float) mode->Clock / (float) mode->HTotal; pScrn->monitor->nVrefresh = 1; pScrn->monitor->vrefresh[0].lo = 56.0; pScrn->monitor->vrefresh[0].hi = (float) mode->Clock * 1000.0 / (float) mode->HTotal / (float) mode->VTotal; if (pScrn->monitor->vrefresh[0].hi < 59.47) pScrn->monitor->vrefresh[0].hi = 59.47; free(mode); } struct vbePanelID * VBEReadPanelID(vbeInfoPtr pVbe) { int RealOff = pVbe->real_mode_base; void *page = pVbe->memory; void *tmp = NULL; int screen = pVbe->pInt10->pScrn->scrnIndex; pVbe->pInt10->ax = 0x4F11; pVbe->pInt10->bx = 0x01; pVbe->pInt10->cx = 0; pVbe->pInt10->dx = 0; pVbe->pInt10->es = SEG_ADDR(RealOff); pVbe->pInt10->di = SEG_OFF(RealOff); pVbe->pInt10->num = 0x10; xf86ExecX86int10(pVbe->pInt10); if ((pVbe->pInt10->ax & 0xff) != 0x4f) { xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE PanelID invalid\n"); goto error; } switch (pVbe->pInt10->ax & 0xff00) { case 0x0: xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE PanelID read successfully\n"); tmp = xnfalloc(32); memcpy(tmp, page, 32); break; case 0x100: xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE PanelID read failed\n"); break; default: xf86DrvMsgVerb(screen, X_INFO, 3, "VESA VBE PanelID unknown failure %i\n", pVbe->pInt10->ax & 0xff00); break; } error: return tmp; } xorg-server-1.17.1/hw/xfree86/man/0000775000175100017510000000000012466505445013564 500000000000000xorg-server-1.17.1/hw/xfree86/man/Makefile.am0000664000175100017510000000035712343161174015534 00000000000000include $(top_srcdir)/manpages.am appman_PRE = Xorg.man fileman_PRE = xorg.conf.man xorg.conf.d.man if SUID_WRAPPER appman_PRE += Xorg.wrap.man fileman_PRE += Xwrapper.config.man else EXTRA_DIST += Xorg.wrap.man Xwrapper.config.man endif xorg-server-1.17.1/hw/xfree86/man/Xwrapper.config.man0000664000175100017510000000006312343161174017243 00000000000000.so man__appmansuffix__/Xorg.wrap.__appmansuffix__ xorg-server-1.17.1/hw/xfree86/man/Xorg.wrap.man0000664000175100017510000000626212456571574016103 00000000000000.\" Xwrapper.wrap.__appmansuffix__ .\" .\" Copyright 2014 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. .\" .\" 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. .\" .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH Xorg.wrap __appmansuffix__ __xorgversion__ .SH NAME Xorg.wrap \- Xorg X server binary wrapper .SH DESCRIPTION The Xorg X server may need root rights to function properly. To start the Xorg X server with these rights your system is using a suid root wrapper installed as __suid_wrapper_dir__/Xorg.wrap which will execute the real X server which is installed as __suid_wrapper_dir__/Xorg. .PP By default Xorg.wrap will autodetect if root rights are necessary, and if not it will drop its elevated rights before starting the real X server. By default Xorg.wrap will only allow executing the real X server from login sessions on a physical console. .SH CONFIG FILE Xorg.wrap's default behavior can be overridden from the \fI__sysconfdir__/X11/Xwrapper.config\fP config file. Lines starting with a \fB#\fP in Xwrapper.config are considered comments and will be ignored. Any other non empty lines must take the form of \fBkey\fP = \fIvalue\fP. .TP 8 \fBallowed_users\fP = \fIrootonly\fP|\fIconsole\fP|\fIanybody\fP Specify which users may start the X server through the wrapper. Use \fIrootonly\fP to only allow root, use \fIconsole\fP to only allow users logged into a physical console, and use \fIanybody\fP to allow anybody. The default is \fIconsole\fP. .TP 8 \fBneeds_root_rights\fP = \fIyes\fP|\fIno\fP|\fIauto\fP Configure if the wrapper should drop its elevated (root) rights before starting the X server. Use \fIyes\fP to force execution as root, \fIno\fP to force execution with all suid rights dropped, and \fIauto\fP to letter the wrapper auto-detect. The default is \fIauto\fP. .PP When auto-detecting the wrapper will drop rights if kms graphics are available and not drop them if no kms graphics are detected. If a system has multiple graphics cards and some are not kms capable auto-detection may fail, in this case manual configuration should be used. .SH "SEE ALSO" Xorg X server information: \fIXorg\fP(1) xorg-server-1.17.1/hw/xfree86/man/xorg.conf.man0000664000175100017510000022330412414702051016071 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH xorg.conf __filemansuffix__ __vendorversion__ .SH NAME xorg.conf, __xconfigdir__ \- configuration files for Xorg X server .SH INTRODUCTION .B Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters: command line options, environment variables, the 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 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 Xorg uses a configuration file called .I xorg.conf and files ending in the suffix .I .conf from the directory .I __xconfigdir__ for its initial setup. The .I xorg.conf configuration file is searched for in the following places when the server is started as a normal user: .PP .RS 4 .nf .IR /etc/X11/ .IR __projectroot__/etc/X11/ .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG .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 where .I is a relative path (with no \(lq..\(rq components) specified with the .B \-config command line option, .B $XORGCONFIG is the relative path (with no \(lq..\(rq components) specified by that environment variable, and .I is the machine's hostname as reported by .BR gethostname (__libmansuffix__). .PP When the Xorg server is started by the \(lqroot\(rq user, the config file search locations are as follows: .PP .RS 4 .nf .IR /etc/X11/ .IR __projectroot__/etc/X11/ .B $XORGCONFIG .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG .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 where .I is the path specified with the .B \-config command line option (which may be absolute or relative), .B $XORGCONFIG is the path specified by that environment variable (absolute or relative), .B $HOME is the path specified by that environment variable (usually the home directory), and .I is the machine's hostname as reported by .BR gethostname (__libmansuffix__). .PP Additional configuration files are searched for in the following directories when the server is started as a normal user: .PP .RS 4 .nf .IR /etc/X11/ .IR __sysconfdir__/X11/ .I /etc/X11/__xconfigdir__ .I __sysconfdir__/X11/__xconfigdir__ .fi .RE .PP where .I is a relative path (with no \(lq..\(rq components) specified with the .B \-configdir command line option. .PP When the Xorg server is started by the \(lqroot\(rq user, the config directory search locations are as follows: .PP .RS 4 .nf .IR /etc/X11/ .IR __sysconfdir__/X11/ .I /etc/X11/__xconfigdir__ .I __sysconfdir__/X11/__xconfigdir__ .fi .RE .PP where .I is the path specified with the .B \-configdir command line option (which may be absolute or relative). .PP Finally, configuration files will also be searched for in a directory reserved for system use. This is to separate configuration files from the vendor or 3rd party packages from those of local administration. These files are found in the following directory: .PP .RS 4 .nf .I __datadir__/X11/__xconfigdir__ .fi .RE .PP The .I xorg.conf and .I __xconfigdir__ files are composed of a number of sections which may be present in any order, or omitted to use default configuration values. Each section has the form: .PP .RS 4 .nf .BI "Section \*q" SectionName \*q .RI " " SectionEntry ... .B EndSection .fi .RE .PP The section names are: .PP .RS 4 .nf .BR "Files " "File pathnames" .BR "ServerFlags " "Server flags" .BR "Module " "Dynamic module loading" .BR "Extensions " "Extension enabling" .BR "InputDevice " "Input device description" .BR "InputClass " "Input class description" .BR "OutputClass " "Output class description" .BR "Device " "Graphics device description" .BR "VideoAdaptor " "Xv video adaptor description" .BR "Monitor " "Monitor description" .BR "Modes " "Video modes descriptions" .BR "Screen " "Screen configuration" .BR "ServerLayout " "Overall layout" .BR "DRI " "DRI\-specific configuration" .BR "Vendor " "Vendor\-specific configuration" .fi .RE .PP The following obsolete section names are still recognised for compatibility purposes. In new config files, the .B InputDevice section should be used instead. .PP .RS 4 .nf .BR "Keyboard " "Keyboard configuration" .BR "Pointer " "Pointer/mouse configuration" .fi .RE .PP The old .B XInput section is no longer recognised. .PP The .B ServerLayout sections are at the highest level. They bind together the input and output devices that will be used in a session. The input devices are described in the .B InputDevice sections. Output devices usually consist of multiple independent components (e.g., a graphics board and a monitor). These multiple components are bound together in the .B Screen sections, and it is these that are referenced by the .B ServerLayout section. Each .B Screen section binds together a graphics board and a monitor. The graphics boards are described in the .B Device sections, and the monitors are described in the .B Monitor sections. .PP Config file keywords are case\-insensitive, and \(lq_\(rq characters are ignored. Most strings (including .B Option names) are also case-insensitive, and insensitive to white space and \(lq_\(rq characters. .PP Each config file entry usually takes up a single line in the file. They consist of a keyword, which is possibly followed by one or more arguments, with the number and types of the arguments depending on the keyword. The argument types are: .PP .RS 4 .nf .BR "Integer " "an integer number in decimal, hex or octal" .BR "Real " "a floating point number" .BR "String " "a string enclosed in double quote marks (\*q)" .fi .RE .PP Note: hex integer values must be prefixed with \(lq0x\(rq, and octal values with \(lq0\(rq. .PP A special keyword called .B Option may be used to provide free\-form data to various components of the server. The .B Option keyword takes either one or two string arguments. The first is the option name, and the optional second argument is the option value. Some commonly used option value types include: .PP .RS 4 .nf .BR "Integer " "an integer number in decimal, hex or octal" .BR "Real " "a floating point number" .BR "String " "a sequence of characters" .BR "Boolean " "a boolean value (see below)" .BR "Frequency " "a frequency value (see below)" .fi .RE .PP Note that .I all .B Option values, not just strings, must be enclosed in quotes. .PP Boolean options may optionally have a value specified. When no value is specified, the option's value is .BR TRUE . The following boolean option values are recognised as .BR TRUE : .PP .RS 4 .BR 1 , .BR on , .BR true , .B yes .RE .PP and the following boolean option values are recognised as .BR FALSE : .PP .RS 4 .BR 0 , .BR off , .BR false , .B no .RE .PP If an option name is prefixed with .RB \*q No \*q, then the option value is negated. .PP Example: the following option entries are equivalent: .PP .RS 4 .nf .B "Option \*qAccel\*q \*qOff\*q" .B "Option \*qNoAccel\*q" .B "Option \*qNoAccel\*q \*qOn\*q" .B "Option \*qAccel\*q \*qfalse\*q" .B "Option \*qAccel\*q \*qno\*q" .fi .RE .PP Frequency option values consist of a real number that is optionally followed by one of the following frequency units: .PP .RS 4 .BR Hz , .BR k , .BR kHz , .BR M , .B MHz .RE .PP When the unit name is omitted, the correct units will be determined from the value and the expectations of the appropriate range of the value. It is recommended that the units always be specified when using frequency option values to avoid any errors in determining the value. .SH "FILES SECTION" The .B Files 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 Xorg (__appmansuffix__)). The command line settings override the values specified in the config file. The .B Files section is optional, as are all of the entries that may appear in it. .PP 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 Xorg server searches for font databases. Multiple .B FontPath entries may be specified, and they will be concatenated to build up the fontpath used by the server. Font path elements can be absolute directory paths, catalogue directories or a font server identifier. The formats of the later two are explained below: .PP .RS 7 Catalogue directories: .PP .RS 4 Catalogue directories can be specified using the prefix \fBcatalogue:\fR before the directory name. The directory can then be populated with symlinks pointing to the real font directories, using the following syntax in the symlink name: .PP .RS 4 .IR : [attribute]: pri= .RE .PP where .I is an alphanumeric identifier, .I [attribute] is an attribute which will be passed to the underlying FPE and .I is a number used to order the fontfile FPEs. Examples: .PP .RS 4 .nf .I 75dpi:unscaled:pri=20 -> /usr/share/X11/fonts/75dpi .I gscript:pri=60 -> /usr/share/fonts/default/ghostscript .I misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc .fi .PP .RE .RE .RE .PP .RS 7 Font server identifiers: .PP .RS 4 Font server identifiers have the form: .RS 4 .PP .IR / : .RE .PP where .I is the transport type to use to connect to the font server (e.g., .B unix for UNIX\-domain sockets or .B tcp for a TCP/IP connection), .I is the hostname of the machine running the font server, and .I is the port number that the font server is listening on (usually 7100). .RE .PP When this entry is not specified in the config file, the server falls back to the compiled\-in default font path, which contains the following font path elements (which can be set inside a catalogue directory): .PP .RS 4 .nf .I __datadir__/fonts/X11/misc/ .I __datadir__/fonts/X11/TTF/ .I __datadir__/fonts/X11/OTF/ .I __datadir__/fonts/X11/Type1/ .I __datadir__/fonts/X11/100dpi/ .I __datadir__/fonts/X11/75dpi/ .fi .RE .PP Font path elements that are found to be invalid are removed from the font path when the server starts up. .RE .TP 7 .BI "ModulePath \*q" path \*q 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 entries may be specified, and they will be concatenated to build the module search path used by the server. The default module path is .PP .RS 11 __modulepath__ .RE .\" The LogFile keyword is not currently implemented .ig .TP 7 .BI "LogFile \*q" path \*q sets the name of the Xorg server log file. The default log file name when running as root is .PP .RS 11 .RI __logdir__/Xorg. .log .RE and for non root it is .RS 11 .RI $XDG_DATA_HOME/xorg/Xorg. .log .RE .PP .RS 7 where .I is the display number for the Xorg server. .. .TP 7 .BI "XkbDir \*q" path \*q sets the base directory for keyboard layout files. The .B \-xkbdir command line option can be used to override this. The default directory is .PP .RS 11 __xkbdir__ .RE .SH "SERVERFLAGS SECTION" In addition to options specific to this section (described below), the .B ServerFlags section is used to specify some global Xorg server options. All of the entries in this section are .BR Options , although for compatibility purposes some of the old style entries are still recognised. Those old style entries are not documented here, and using them is discouraged. The .B ServerFlags section is optional, as are the entries that may be specified in it. .PP .B Options specified in this section (with the exception of the .B \*qDefaultServerLayout\*q .BR Option ) may be overridden by .B Options specified in the active .B ServerLayout section. Options with command line equivalents are overridden when their command line equivalent is used. The options recognised by this section are: .TP 7 .BI "Option \*qDefaultServerLayout\*q \*q" layout\-id \*q This specifies the default .B ServerLayout section to use in the absence of the .B \-layout command line option. .TP 7 .BI "Option \*qNoTrapSignals\*q \*q" boolean \*q This prevents the Xorg server from trapping a range of unexpected fatal signals and exiting cleanly. 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 Xorg server problem and know how to deal with the consequences. .TP 7 .BI "Option \*qUseSIGIO\*q \*q" boolean \*q 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 Xorg server, or working around a specific bug until it is fixed, and understand the consequences. .TP 7 .BI "Option \*qDontVTSwitch\*q \*q" boolean \*q This disallows the use of the .BI Ctrl+Alt+F n sequence (where .RI F n refers to one of the numbered function keys). That sequence is normally used to switch to another \*qvirtual terminal\*q on operating systems that have this feature. When this option is enabled, that key sequence has no special meaning and is passed to clients. Default: off. .TP 7 .BI "Option \*qDontZap\*q \*q" boolean \*q 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 Xorg server. When this option is enabled, the action has no effect. Default: off. .TP 7 .BI "Option \*qDontZoom\*q \*q" boolean \*q This disallows the use of the .B Ctrl+Alt+Keypad\-Plus and .B Ctrl+Alt+Keypad\-Minus sequences. These sequences allows you to switch between video modes. When this option is enabled, those key sequences have no special meaning and are passed to clients. Default: off. .TP 7 .BI "Option \*qDisableVidModeExtension\*q \*q" boolean \*q This disables the parts of the VidMode extension used by the xvidtune client that can be used to change the video modes. Default: the VidMode extension is enabled. .TP 7 .BI "Option \*qAllowNonLocalXvidtune\*q \*q" boolean \*q This allows the xvidtune client (and other clients that use the VidMode extension) to connect from another host. Default: off. .TP 7 .BI "Option \*qAllowMouseOpenFail\*q \*q" boolean \*q This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__) drivers to not report failure if the mouse device can't be opened/initialised. It has no effect on the evdev(__drivermansuffix__) or other drivers. Default: false. .TP 7 .BI "Option \*qBlankTime\*q \*q" time \*q sets the inactivity timeout for the .B blank phase of the screensaver. .I time is in minutes. This is equivalent to the Xorg server's .B \-s flag, and the value can be changed at run\-time with .BR xset(__appmansuffix__). Default: 10 minutes. .TP 7 .BI "Option \*qStandbyTime\*q \*q" time \*q sets the inactivity timeout for the .B standby phase of DPMS mode. .I time is in minutes, and the value can be changed at run\-time with .BR xset(__appmansuffix__). Default: 10 minutes. This is only suitable for VESA DPMS compatible monitors, and may not be supported by all video drivers. It is only enabled for screens that have the .B \*qDPMS\*q option set (see the MONITOR section below). .TP 7 .BI "Option \*qSuspendTime\*q \*q" time \*q sets the inactivity timeout for the .B suspend phase of DPMS mode. .I time is in minutes, and the value can be changed at run\-time with .BR xset(__appmansuffix__). Default: 10 minutes. This is only suitable for VESA DPMS compatible monitors, and may not be supported by all video drivers. It is only enabled for screens that have the .B \*qDPMS\*q option set (see the MONITOR section below). .TP 7 .BI "Option \*qOffTime\*q \*q" time \*q sets the inactivity timeout for the .B off phase of DPMS mode. .I time is in minutes, and the value can be changed at run\-time with .BR xset(__appmansuffix__). Default: 10 minutes. This is only suitable for VESA DPMS compatible monitors, and may not be supported by all video drivers. It is only enabled for screens that have the .B \*qDPMS\*q option set (see the MONITOR section below). .TP 7 .BI "Option \*qPixmap\*q \*q" bpp \*q This sets the pixmap format to use for depth 24. Allowed values for .I bpp are 24 and 32. Default: 32 unless driver constraints don't allow this (which is rare). Note: some clients don't behave well when this value is set to 24. .TP 7 .BI "Option \*qNoPM\*q \*q" boolean \*q Disables something to do with power management events. Default: PM enabled on platforms that support it. .TP 7 .BI "Option \*qXinerama\*q \*q" boolean \*q enable or disable XINERAMA extension. Default is disabled. .TP 7 .BI "Option \*qAIGLX\*q \*q" boolean \*q enable or disable AIGLX. AIGLX is enabled by default. .TP 7 .BI "Option \*qDRI2\*q \*q" boolean \*q enable or disable DRI2. DRI2 is disabled by default. .TP 7 .BI "Option \*qGlxVisuals\*q \*q" string \*q This option controls how many GLX visuals the GLX modules sets up. The default value is .BR "typical" , which will setup up a typical subset of the GLXFBConfigs provided by the driver as GLX visuals. Other options are .BR "minimal" , which will set up the minimal set allowed by the GLX specification and .BR "all" which will setup GLX visuals for all GLXFBConfigs. .TP 7 .BI "Option \*qUseDefaultFontPath\*q \*q" boolean \*q Include the default font path even if other paths are specified in xorg.conf. If enabled, other font paths are included as well. Enabled by default. .TP 7 .BI "Option \*qIgnoreABI\*q \*q" boolean \*q Allow modules built for a different, potentially incompatible version of the X server to load. Disabled by default. .TP 7 .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q If this option is disabled, then no devices will be added from the HAL or udev backends. Enabled by default. .TP 7 .BI "Option \*qAutoEnableDevices\*q \*q" boolean \*q If this option is disabled, then the devices will be added (and the DevicePresenceNotify event sent), but not enabled, thus leaving policy up to the client. Enabled by default. .TP 7 .BI "Option \*qAutoAddGPU\*q \*q" boolean \*q If this option is disabled, then no GPU devices will be added from the udev backend. Enabled by default. (May need to be disabled to setup Xinerama). .TP 7 .BI "Option \*qLog\*q \*q" string \*q This option controls whether the log is flushed and/or synced to disk after each message. Possible values are .B flush or .BR sync . Unset by default. .SH "MODULE SECTION" The .B Module 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. The .B Module section is optional, as are all of the entries that may be specified in it. .PP Entries in this section may be in two forms. The first and most commonly used form is an entry that uses the .B Load keyword, as described here: .TP 7 .BI "Load \*q" modulename \*q This instructs the server to load the module called .IR modulename . 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 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: .PP .RS 4 .B "Load \*qdri\*q" .RE .RE .TP 7 .BI "Disable \*q" modulename \*q This instructs the server to not load the module called .IR modulename . Some modules are loaded by default in the server, and this overrides that default. If a .B Load instruction is given for the same module, it overrides the .B Disable instruction and the module is loaded. The module name given should be the module's standard name, not the module file name. As with the .B Load instruction, the standard name is case-sensitive, and does not include the "lib" prefix, or the ".a", ".o", or ".so" suffixes. .PP The second form of entry is a .BR SubSection, with the subsection name being the module name, and the contents of the .B SubSection being .B Options that are passed to the module when it is loaded. .PP Example: the extmod module (which contains a miscellaneous group of server extensions) can be loaded, with the XFree86\-DGA extension disabled by using the following entry: .PP .RS 4 .nf .B "SubSection \*qextmod\*q" .B " Option \*qomit XFree86\-DGA\*q" .B EndSubSection .fi .RE .PP Modules are searched for in each directory specified in the .B ModulePath search path, and in the drivers, extensions, input, internal, and multimedia subdirectories of each of those directories. In addition to this, operating system specific subdirectories of all the above are searched first if they exist. .PP To see what extension modules are available, check the extensions subdirectory under: .PP .RS 4 .nf __modulepath__ .fi .RE .PP The \(lqextmod\(rq, \(lqdbe\(rq, \(lqdri\(rq, \(lqdri2\(rq, \(lqglx\(rq, and \(lqrecord\(rq extension modules are loaded automatically, if they are present, unless disabled with \*qDisable\*q entries. It is recommended that at very least the \(lqextmod\(rq extension module be loaded. If it isn't, some commonly used server extensions (like the SHAPE extension) will not be available. .SH "EXTENSIONS SECTION" The .B Extensions section is used to specify which X11 protocol extensions should be enabled or disabled. The .B Extensions section is optional, as are all of the entries that may be specified in it. .PP Entries in this section are listed as Option statements with the name of the extension as the first argument, and a boolean value as the second. The extension name is case\-sensitive, and matches the form shown in the output of \*qXorg -extension ?\*q. .PP .RS 7 Example: the MIT-SHM extension can be disabled with the following entry: .PP .RS 4 .nf .B "Section \*qExtensions\*q" .B " Option \*qMIT-SHM\*q \*qDisable\*q" .B "EndSection" .fi .RE .RE .SH "INPUTDEVICE SECTION" The config file may have multiple .B InputDevice sections. Recent X servers employ HAL or udev backends for input device enumeration and input hotplugging. It is usually not necessary to provide .B InputDevice sections in the xorg.conf if hotplugging is in use (i.e. AutoAddDevices is enabled). If hotplugging is enabled, .B InputDevice sections using the .B mouse, kbd and .B vmmouse driver will be ignored. .PP If hotplugging is disabled, there will normally be at least two: one for the core (primary) keyboard and one for the core pointer. If either of these two is missing, a default configuration for the missing ones will be used. In the absence of an explicitly specified core input device, the first .B InputDevice marked as .B CorePointer (or .BR CoreKeyboard ) is used. If there is no match there, the first .B InputDevice that uses the \(lqmouse\(rq (or \(lqkbd\(rq) driver is used. The final fallback is to use built\-in default configurations. Currently the default configuration may not work as expected on all platforms. .PP .B InputDevice sections have the following format: .PP .RS 4 .nf .B "Section \*qInputDevice\*q" .BI " Identifier \*q" name \*q .BI " Driver \*q" inputdriver \*q .I " options" .I " ..." .B "EndSection" .fi .RE .PP The .B Identifier and .B Driver entries are required in all .B InputDevice sections. All other entries are optional. .PP The .B Identifier entry specifies the unique name for this input device. The .B Driver entry specifies the name of the driver to use for this input device. When using the loadable server, the input driver module .RI \*q inputdriver \*q will be loaded for each active .B InputDevice section. An .B InputDevice section is considered active if it is referenced by an active .B ServerLayout section, if it is referenced by the .B \-keyboard or .B \-pointer command line options, or if it is selected implicitly as the core pointer or keyboard device in the absence of such explicit references. The most commonly used input drivers are .BR evdev (__drivermansuffix__) on Linux systems, and .BR kbd (__drivermansuffix__) and .BR mousedrv (__drivermansuffix__) on other platforms. .PP .PP .B InputDevice sections recognise some driver\-independent .BR Options , which are described here. See the individual input driver manual pages for a description of the device\-specific options. .TP 7 .BI "Option \*qAutoServerLayout\*q \*q" boolean \*q Always add the device to the ServerLayout section used by this instance of the server. This affects implied layouts as well as explicit layouts specified in the configuration and/or on the command line. .TP 7 .BI "Option \*qCorePointer\*q" Deprecated, see .B Floating .TP 7 .BI "Option \*qCoreKeyboard\*q" Deprecated, see .B Floating .TP 7 .BI "Option \*qAlwaysCore\*q \*q" boolean \*q Deprecated, see .B Floating .TP 7 .BI "Option \*qSendCoreEvents\*q \*q" boolean \*q Deprecated, see .B Floating .TP 7 .BI "Option \*qFloating\*q \*q" boolean \*q When enabled, the input device is set up floating and does not report events through any master device or control a cursor. The device is only available to clients using the X Input Extension API. This option is disabled by default. The options .B CorePointer, .B CoreKeyboard, .B AlwaysCore, and .B SendCoreEvents, are the inverse of option .B Floating (i.e. .B SendCoreEvents \*qon\*q is equivalent to .B Floating \*qoff\*q ). This option controls the startup behavior only, a device may be reattached or set floating at runtime. .TP 7 .BI "Option \*qTransformationMatrix\*q \*q" a " " b " " c " " d " " e " " f " " g " " h " " i \*q Specifies the 3x3 transformation matrix for absolute input devices. The input device will be bound to the area given in the matrix. In most configurations, "a" and "e" specify the width and height of the area the device is bound to, and "c" and "f" specify the x and y offset of the area. The value range is 0 to 1, where 1 represents the width or height of all root windows together, 0.5 represents half the area, etc. The values represent a 3x3 matrix, with the first, second and third group of three values representing the first, second and third row of the matrix, respectively. The identity matrix is "1 0 0 0 1 0 0 0 1". .SS POINTER ACCELERATION For pointing devices, the following options control how the pointer is accelerated or decelerated with respect to physical device motion. Most of these can be adjusted at runtime, see the xinput(1) man page for details. Only the most important acceleration options are discussed here. .TP 7 .BI "Option \*qAccelerationProfile\*q \*q" integer \*q Select the profile. In layman's terms, the profile constitutes the "feeling" of the acceleration. More formally, it defines how the transfer function (actual acceleration as a function of current device velocity and acceleration controls) is constructed. This is mainly a matter of personal preference. .PP .RS 6 .nf .B " 0 classic (mostly compatible)" .B "-1 none (only constant deceleration is applied)" .B " 1 device-dependent" .B " 2 polynomial (polynomial function)" .B " 3 smooth linear (soft knee, then linear)" .B " 4 simple (normal when slow, otherwise accelerated)" .B " 5 power (power function)" .B " 6 linear (more speed, more acceleration)" .B " 7 limited (like linear, but maxes out at threshold)" .fi .RE .TP 7 .BI "Option \*qConstantDeceleration\*q \*q" real \*q Makes the pointer go .B deceleration times slower than normal. Most useful for high-resolution devices. A value between 0 and 1 will speed up the pointer. .TP 7 .BI "Option \*qAdaptiveDeceleration\*q \*q" real \*q Allows to actually decelerate the pointer when going slow. At most, it will be .B adaptive deceleration times slower. Enables precise pointer placement without sacrificing speed. .TP 7 .BI "Option \*qAccelerationScheme\*q \*q" string \*q Selects the scheme, which is the underlying algorithm. .PP .RS 7 .nf .B "predictable default algorithm (behaving more predictable)" .B "lightweight old acceleration code (as specified in the X protocol spec)" .B "none no acceleration or deceleration" .fi .RE .TP 7 .BI "Option \*qAccelerationNumerator\*q \*q" integer \*q .TP 7 .BI "Option \*qAccelerationDenominator\*q \*q" integer \*q Set numerator and denominator of the acceleration factor. The acceleration factor is a rational which, together with threshold, can be used to tweak profiles to suit the users needs. The .B simple and .B limited profiles use it directly (i.e. they accelerate by the factor), for other profiles it should hold that a higher acceleration factor leads to a faster pointer. Typically, 1 is unaccelerated and values up to 5 are sensible. .TP 7 .BI "Option \*qAccelerationThreshold\*q \*q" integer \*q Set the threshold, which is roughly the velocity (usually device units per 10 ms) required for acceleration to become effective. The precise effect varies with the profile however. .SH "INPUTCLASS SECTION" The config file may have multiple .B InputClass sections. These sections are optional and are used to provide configuration for a class of input devices as they are automatically added. An input device can match more than one .B InputClass section. Each class can override settings from a previous class, so it is best to arrange the sections with the most generic matches first. .PP .B InputClass sections have the following format: .PP .RS 4 .nf .B "Section \*qInputClass\*q" .BI " Identifier \*q" name \*q .I " entries" .I " ..." .I " options" .I " ..." .B "EndSection" .fi .RE .PP The .B Identifier entry is required in all .B InputClass sections. All other entries are optional. .PP The .B Identifier entry specifies the unique name for this input class. The .B Driver entry specifies the name of the driver to use for this input device. After all classes have been examined, the .RI \*q inputdriver \*q module from the first .B Driver entry will be enabled when using the loadable server. .PP When an input device is automatically added, its characteristics are checked against all .B InputClass sections. Each section can contain optional entries to narrow the match of the class. If none of the optional entries appear, the .B InputClass section is generic and will match any input device. If more than one of these entries appear, they all must match for the configuration to apply. .PP There are two types of match entries used in .B InputClass sections. The first allows various tokens to be matched against attributes of the device. An entry can be constructed to match attributes from different devices by separating arguments with a '|' character. Multiple entries of the same type may be supplied to add multiple matching conditions on the same attribute. For example: .PP .RS 4 .nf .B "Section \*qInputClass\*q" .B " Identifier \*qMy Class\*q" .B " # product string must contain example and .B " # either gizmo or gadget .B " MatchProduct \*qexample\*q .B " MatchProduct \*qgizmo|gadget\*q .I " ..." .B "EndSection" .fi .RE .TP 7 .BI "MatchProduct \*q" matchproduct \*q This entry can be used to check if the substring .RI \*q matchproduct \*q occurs in the device's product name. .TP 7 .BI "MatchVendor \*q" matchvendor \*q This entry can be used to check if the substring .RI \*q matchvendor \*q occurs in the device's vendor name. .TP 7 .BI "MatchDevicePath \*q" matchdevice \*q This entry can be used to check if the device file matches the .RI \*q matchdevice \*q pathname pattern. .TP 7 .BI "MatchOS \*q" matchos \*q This entry can be used to check if the operating system matches the case-insensitive .RI \*q matchos \*q string. This entry is only supported on platforms providing the .BR uname (2) system call. .TP 7 .BI "MatchPnPID \*q" matchpnp \*q The device's Plug and Play (PnP) ID can be checked against the .RI \*q matchpnp \*q shell wildcard pattern. .TP 7 .BI "MatchUSBID \*q" matchusb \*q The device's USB ID can be checked against the .RI \*q matchusb \*q shell wildcard pattern. The ID is constructed as lowercase hexadecimal numbers separated by a ':'. This is the same format as the .BR lsusb (8) program. .TP 7 .BI "MatchDriver \*q" matchdriver \*q Check the case-sensitive string .RI \*q matchdriver \*q against the currently configured driver of the device. Ordering of sections using this entry is important since it will not match unless the driver has been set by the config backend or a previous .B InputClass section. .TP 7 .BI "MatchTag \*q" matchtag \*q This entry can be used to check if tags assigned by the config backend matches the .RI \*q matchtag \*q pattern. A match is found if at least one of the tags given in .RI \*q matchtag \*q matches at least one of the tags assigned by the backend. .TP 7 .BI "MatchLayout \*q" matchlayout \*q Check the case-sensitive string .RI \*q matchlayout \*q against the currently active .B ServerLayout section. The empty string "" matches an implicit layout which appears if no named .B ServerLayout sections have been found. .PP The second type of entry is used to match device types. These entries take a boolean argument similar to .B Option entries. .TP 7 .BI "MatchIsKeyboard \*q" bool \*q .TP 7 .BI "MatchIsPointer \*q" bool \*q .TP 7 .BI "MatchIsJoystick \*q" bool \*q .TP 7 .BI "MatchIsTablet \*q" bool \*q .TP 7 .BI "MatchIsTouchpad \*q" bool \*q .TP 7 .BI "MatchIsTouchscreen \*q" bool \*q .PP When an input device has been matched to the .B InputClass section, any .B Option entries are applied to the device. One .B InputClass specific .B Option is recognized. See the .B InputDevice section above for a description of the remaining .B Option entries. .TP 7 .BI "Option \*qIgnore\*q \*q" boolean \*q This optional entry specifies that the device should be ignored entirely, and not added to the server. This can be useful when the device is handled by another program and no X events should be generated. .SH "OUTPUTCLASS SECTION" The config file may have multiple .B OutputClass sections. These sections are optional and are used to provide configuration for a class of output devices as they are automatically added. An output device can match more than one .B OutputClass section. Each class can override settings from a previous class, so it is best to arrange the sections with the most generic matches first. .PP .B OutputClass sections have the following format: .PP .RS 4 .nf .B "Section \*qOutputClass\*q" .BI " Identifier \*q" name \*q .I " entries" .I " ..." .B "EndSection" .fi .RE .PP The .B Identifier entry is required in all .B OutputClass sections. All other entries are optional. .PP The .B Identifier entry specifies the unique name for this output class. The .B Driver entry specifies the name of the driver to use for this output device. After all classes have been examined, the .RI \*q outputdriver \*q module from the first .B Driver entry will be enabled when using the loadable server. .PP When an output device is automatically added, its characteristics are checked against all .B OutputClass sections. Each section can contain optional entries to narrow the match of the class. If none of the optional entries appear, the .B OutputClass section is generic and will match any output device. If more than one of these entries appear, they all must match for the configuration to apply. .PP The following list of tokens can be matched against attributes of the device. An entry can be constructed to match attributes from different devices by separating arguments with a '|' character. .PP For example: .PP .RS 4 .nf .B "Section \*qOutputClass\*q" .B " Identifier \*qMy Class\*q" .B " # kernel driver must be either foo or bar .B " MatchDriver \*qfoo|bar\*q .I " ..." .B "EndSection" .fi .RE .TP 7 .BI "MatchDriver \*q" matchdriver \*q Check the case-sensitive string .RI \*q matchdriver \*q against the kernel driver of the device. .SH "DEVICE SECTION" The config file may have multiple .B Device sections. There must be at least one, for the video card being used. .PP .B Device sections have the following format: .PP .RS 4 .nf .B "Section \*qDevice\*q" .BI " Identifier \*q" name \*q .BI " Driver \*q" driver \*q .I " entries" .I " ..." .B "EndSection" .fi .RE .PP The .B Identifier and .B Driver entries are required in all .B Device sections. All other entries are optional. .PP The .B Identifier entry specifies the unique name for this graphics device. The .B Driver entry specifies the name of the driver to use for this graphics device. When using the loadable server, the driver module .RI \*q driver \*q will be loaded for each active .B Device section. A .B Device section is considered active if it is referenced by an active .B Screen section. .PP .B Device sections recognise some driver\-independent entries and .BR Options , which are described here. Not all drivers make use of these driver\-independent entries, and many of those that do don't require them to be specified because the information is auto\-detected. See the individual graphics driver manual pages for further information about this, and for a description of the device\-specific options. Note that most of the .B Options listed here (but not the other entries) may be specified in the .B Screen section instead of here in the .B Device section. .TP 7 .BI "BusID \*q" bus\-id \*q This specifies the bus location of the graphics card. For PCI/AGP cards, the .I bus\-id string has the form .BI PCI: bus : device : function (e.g., \(lqPCI:1:0:0\(rq might be appropriate for an AGP card). This field is usually optional in single-head configurations when using the primary graphics card. In multi-head configurations, or when using a secondary graphics card in a single-head configuration, this entry is mandatory. Its main purpose is to make an unambiguous connection between the device section and the hardware it is representing. This information can usually be found by running the pciaccess tool scanpci. .TP 7 .BI "Screen " number This option is mandatory for cards where a single PCI entity can drive more than one display (i.e., multiple CRTCs sharing a single graphics accelerator and video memory). One .B Device section is required for each head, and this parameter determines which head each of the .B Device sections applies to. The legal values of .I number range from 0 to one less than the total number of heads per entity. Most drivers require that the primary screen (0) be present. .TP 7 .BI "Chipset \*q" chipset \*q This usually optional entry specifies the chipset used on the graphics board. In most cases this entry is not required because the drivers will probe the hardware to determine the chipset type. Don't specify it unless the driver-specific documentation recommends that you do. .TP 7 .BI "Ramdac \*q" ramdac\-type \*q This optional entry specifies the type of RAMDAC used on the graphics board. This is only used by a few of the drivers, and in most cases it is not required because the drivers will probe the hardware to determine the RAMDAC type where possible. Don't specify it unless the driver-specific documentation recommends that you do. .TP 7 .BI "DacSpeed " speed .TP 7 .BI "DacSpeed " "speed\-8 speed\-16 speed\-24 speed\-32" This optional entry specifies the RAMDAC speed rating (which is usually printed on the RAMDAC chip). The speed is in MHz. When one value is given, it applies to all framebuffer pixel sizes. When multiple values are given, they apply to the framebuffer pixel sizes 8, 16, 24 and 32 respectively. This is not used by many drivers, and only needs to be specified when the speed rating of the RAMDAC is different from the defaults built in to driver, or when the driver can't auto-detect the correct defaults. Don't specify it unless the driver-specific documentation recommends that you do. .TP 7 .BI "Clocks " "clock ..." specifies the pixel that are on your graphics board. The clocks are in MHz, and may be specified as a floating point number. The value is stored internally to the nearest kHz. The ordering of the clocks is important. It must match the order in which they are selected on the graphics board. Multiple .B Clocks lines may be specified, and each is concatenated to form the list. Most drivers do not use this entry, and it is only required for some older boards with non-programmable clocks. Don't specify this entry unless the driver-specific documentation explicitly recommends that you do. .TP .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 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 Xorg server probes the graphics board to determine this quantity. The driver-specific documentation should indicate when it might be needed. .TP 7 .BI "BiosBase " "baseaddress" This optional entry specifies the base address of the video BIOS for the VGA board. This address is normally auto-detected, and should only be specified if the driver-specific documentation recommends it. .TP 7 .BI "MemBase " "baseaddress" This optional entry specifies the memory base address of a graphics board's linear frame buffer. This entry is not used by many drivers, and it should only be specified if the driver-specific documentation recommends it. .TP 7 .BI "IOBase " "baseaddress" This optional entry specifies the IO base address. This entry is not used by many drivers, and it should only be specified if the driver-specific documentation recommends it. .TP 7 .BI "ChipID " "id" This optional entry specifies a numerical ID representing the chip type. For PCI cards, it is usually the device ID. This can be used to override the auto-detection, but that should only be done when the driver-specific documentation recommends it. .TP 7 .BI "ChipRev " "rev" This optional entry specifies the chip revision number. This can be used to override the auto-detection, but that should only be done when the driver-specific documentation recommends it. .TP 7 .BI "MatchSeat " "seat\-id" Only apply this .B Device section if X server was started with .B -seat .I seat\-id option. .TP 7 .BI "Option \*qModeDebug\*q \*q" boolean \*q Enable printing of additional debugging information about modesetting to the server log. .ig .TP 7 This optional entry allows an IRQ number to be specified. .. .TP 7 .B Options Option flags may be specified in the .B Device sections. These include driver\-specific options and driver\-independent options. The former are described in the driver\-specific documentation. Some of the latter are described below in the section about the .B Screen section, and they may also be included here. .SH "VIDEOADAPTOR SECTION" Nobody wants to say how this works. Maybe nobody knows ... .SH "MONITOR SECTION" The config file may have multiple .B Monitor sections. There should normally be at least one, for the monitor being used, but a default configuration will be created when one isn't specified. .PP .B Monitor sections have the following format: .PP .RS 4 .nf .B "Section \*qMonitor\*q" .BI " Identifier \*q" name \*q .I " entries" .I " ..." .B "EndSection" .fi .RE .PP The only mandatory entry in a .B Monitor section is the .B Identifier entry. .PP The .B Identifier entry specifies the unique name for this monitor. The .B Monitor section may be used to provide information about the specifications of the monitor, monitor-specific .BR Options , and information about the video modes to use with the monitor. .PP With RandR 1.2-enabled drivers, monitor sections may be tied to specific outputs of the video card. Using the name of the output defined by the video driver plus the identifier of a monitor section, one associates a monitor section with an output by adding an option to the Device section in the following format: .BI "Option \*qMonitor-" outputname "\*q \*q" monitorsection \*q (for example, .B Option \*qMonitor-VGA\*q \*qVGA monitor\*q for a VGA output) .PP In the absence of specific association of monitor sections to outputs, if a monitor section is present the server will associate it with an output to preserve compatibility for previous single-head configurations. .PP Specifying video modes is optional because the server will use the DDC or other information provided by the monitor to automatically configure the list of modes available. When modes are specified explicitly in the .B Monitor section (with the .BR Mode , .BR ModeLine , or .B UseModes keywords), built-in modes with the same names are not included. Built-in modes with different names are, however, still implicitly included, when they meet the requirements of the monitor. .PP The entries that may be used in .B Monitor sections are described below. .TP 7 .BI "VendorName \*q" vendor \*q This optional entry specifies the monitor's manufacturer. .TP 7 .BI "ModelName \*q" model \*q This optional entry specifies the monitor's model. .TP 7 .BI "HorizSync " "horizsync\-range" gives the range(s) of horizontal sync frequencies supported by the monitor. .I horizsync\-range may be a comma separated list of either discrete values or ranges of values. A range of values is two values separated by a dash. By default the values are in units of kHz. They may be specified in MHz or Hz if .B MHz or .B Hz is added to the end of the line. 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. .TP 7 .BI "VertRefresh " "vertrefresh\-range" gives the range(s) of vertical refresh frequencies supported by the monitor. .I vertrefresh\-range may be a comma separated list of either discrete values or ranges of values. A range of values is two values separated by a dash. By default the values are in units of Hz. They may be specified in MHz or kHz if .B MHz or .B kHz is added to the end of the line. 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. .TP 7 .BI "DisplaySize " "width height" This optional entry gives the width and height, in millimetres, of the picture area of the monitor. If given this is used to calculate the horizontal and vertical pitch (DPI) of the screen. .TP 7 .BI "Gamma " "gamma\-value" .TP 7 .BI "Gamma " "red\-gamma green\-gamma blue\-gamma" This is an optional entry that can be used to specify the gamma correction for the monitor. It may be specified as either a single value or as three separate RGB values. The values should be in the range 0.1 to 10.0, and the default is 1.0. Not all drivers are capable of using this information. .TP 7 .BI "UseModes \*q" modesection\-id \*q Include the set of modes listed in the .B Modes section called .IR modesection\-id. This makes all of the modes defined in that section available for use by this monitor. .TP 7 .BI "Mode \*q" name \*q This is an optional multi-line entry that can be used to provide definitions for video modes for the monitor. In most cases this isn't necessary because the built-in set of VESA standard modes will be sufficient. The .B Mode keyword indicates the start of a multi-line video mode description. The mode description is terminated with the .B EndMode keyword. The mode description consists of the following entries: .RS 7 .TP 4 .BI "DotClock " clock is the dot (pixel) clock rate to be used for the mode. .TP 4 .BI "HTimings " "hdisp hsyncstart hsyncend htotal" specifies the horizontal timings for the mode. .TP 4 .BI "VTimings " "vdisp vsyncstart vsyncend vtotal" specifies the vertical timings for the mode. .TP 4 .BI "Flags \*q" flag \*q " ..." specifies an optional set of mode flags, each of which is a separate string in double quotes. .B \*qInterlace\*q indicates that the mode is interlaced. .B \*qDoubleScan\*q indicates a mode where each scanline is doubled. .B \*q+HSync\*q and .B \*q\-HSync\*q can be used to select the polarity of the HSync signal. .B \*q+VSync\*q and .B \*q\-VSync\*q can be used to select the polarity of the VSync signal. .B \*qComposite\*q can be used to specify composite sync on hardware where this is supported. Additionally, on some hardware, .B \*q+CSync\*q and .B \*q\-CSync\*q may be used to select the composite sync polarity. .TP 4 .BI "HSkew " hskew specifies the number of pixels (towards the right edge of the screen) by which the display enable signal is to be skewed. Not all drivers use this information. This option might become necessary to override the default value supplied by the server (if any). \(lqRoving\(rq horizontal lines indicate this value needs to be increased. If the last few pixels on a scan line appear on the left of the screen, this value should be decreased. .TP 4 .BI "VScan " vscan specifies the number of times each scanline is painted on the screen. Not all drivers use this information. Values less than 1 are treated as 1, which is the default. Generally, the .B \*qDoubleScan\*q .B Flag mentioned above doubles this value. .RE .TP 7 .BI "ModeLine \*q" name \*q " mode\-description" This entry is a more compact version of the .B Mode entry, and it also can be used to specify video modes for the monitor. This is a single line format for specifying video modes. In most cases this isn't necessary because the built\-in set of VESA standard modes will be sufficient. .PP .RS 7 The .I mode\-description is in four sections, the first three of which are mandatory. The first is the dot (pixel) clock. This is a single number specifying the pixel clock rate for the mode in MHz. The second section is a list of four numbers specifying the horizontal timings. These numbers are the .IR hdisp , .IR hsyncstart , .IR hsyncend , and .I htotal values. The third section is a list of four numbers specifying the vertical timings. These numbers are the .IR vdisp , .IR vsyncstart , .IR vsyncend , and .I vtotal values. The final section is a list of flags specifying other characteristics of the mode. .B Interlace indicates that the mode is interlaced. .B DoubleScan indicates a mode where each scanline is doubled. .B +HSync and .B \-HSync can be used to select the polarity of the HSync signal. .B +VSync and .B \-VSync can be used to select the polarity of the VSync signal. .B Composite can be used to specify composite sync on hardware where this is supported. Additionally, on some hardware, .B +CSync and .B \-CSync may be used to select the composite sync polarity. The .B HSkew and .B VScan options mentioned above in the .B Mode entry description can also be used here. .RE .TP 7 .BI "Option \*qDPMS\*q \*q" bool \*q This option controls whether the server should enable the DPMS extension for power management for this screen. The default is to enable the extension. .TP 7 .BI "Option \*qSyncOnGreen\*q \*q" bool \*q This option controls whether the video card should drive the sync signal on the green color pin. Not all cards support this option, and most monitors do not require it. The default is off. .TP 7 .BI "Option \*qPrimary\*q \*q" bool \*q This optional entry specifies that the monitor should be treated as the primary monitor. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qPreferredMode\*q \*q" name \*q This optional entry specifies a mode to be marked as the preferred initial mode of the monitor. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qZoomModes\*q \*q" name " " name " " ... \*q This optional entry specifies modes to be marked as zoom modes. It is possible to switch to the next and previous mode via .BR Ctrl+Alt+Keypad\-Plus " and " Ctrl+Alt+Keypad\-Minus . All these keypad available modes are selected from the screen mode list. This list is a copy of the compatibility output monitor mode list. Since this output is the output connected to the lowest dot-area monitor, as determined from its largest size mode, that monitor defines the available zoom modes. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qPosition\*q \*q" x " " y \*q This optional entry specifies the position of the monitor within the X screen. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qLeftOf\*q \*q" output \*q This optional entry specifies that the monitor should be positioned to the left of the output (not monitor) of the given name. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qRightOf\*q \*q" output \*q This optional entry specifies that the monitor should be positioned to the right of the output (not monitor) of the given name. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qAbove\*q \*q" output \*q This optional entry specifies that the monitor should be positioned above the output (not monitor) of the given name. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qBelow\*q \*q" output \*q This optional entry specifies that the monitor should be positioned below the output (not monitor) of the given name. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qEnable\*q \*q" bool \*q This optional entry specifies whether the monitor should be turned on at startup. By default, the server will attempt to enable all connected monitors. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qDefaultModes\*q \*q" bool \*q This optional entry specifies whether the server should add supported default modes to the list of modes offered on this monitor. By default, the server will add default modes; you should only disable this if you can guarantee that EDID will be available at all times, or if you have added custom modelines which the server can use. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qMinClock\*q \*q" frequency \*q This optional entry specifies the minimum dot clock, in kHz, that is supported by the monitor. .TP 7 .BI "Option \*qMaxClock\*q \*q" frequency \*q This optional entry specifies the maximum dot clock, in kHz, that is supported by the monitor. .TP 7 .BI "Option \*qIgnore\*q \*q" bool \*q This optional entry specifies that the monitor should be ignored entirely, and not reported through RandR. This is useful if the hardware reports the presence of outputs that don't exist. (RandR 1.2-supporting drivers only) .TP 7 .BI "Option \*qRotate\*q \*q" rotation \*q This optional entry specifies the initial rotation of the given monitor. Valid values for rotation are \*qnormal\*q, \*qleft\*q, \*qright\*q, and \*qinverted\*q. (RandR 1.2-supporting drivers only) .SH "MODES SECTION" The config file may have multiple .B Modes sections, or none. These sections provide a way of defining sets of video modes independently of the .B Monitor sections. .B Monitor sections may include the definitions provided in these sections by using the .B UseModes keyword. In most cases the .B Modes sections are not necessary because the built\-in set of VESA standard modes will be sufficient. .PP .B Modes sections have the following format: .PP .RS 4 .nf .B "Section \*qModes\*q" .BI " Identifier \*q" name \*q .I " entries" .I " ..." .B "EndSection" .fi .RE .PP The .B Identifier entry specifies the unique name for this set of mode descriptions. The other entries permitted in .B Modes sections are the .B Mode and .B ModeLine entries that are described above in the .B Monitor section. .SH "SCREEN SECTION" The config file may have multiple .B Screen sections. There must be at least one, for the \(lqscreen\(rq being used. A \(lqscreen\(rq represents the binding of a graphics device .RB ( Device section) and a monitor .RB ( Monitor section). A .B Screen section is considered \(lqactive\(rq if it is referenced by an active .B ServerLayout section or by the .B \-screen command line option. If neither of those is present, the first .B Screen section found in the config file is considered the active one. .PP .B Screen sections have the following format: .PP .RS 4 .nf .B "Section \*qScreen\*q" .BI " Identifier \*q" name \*q .BI " Device \*q" devid \*q .BI " Monitor \*q" monid \*q .I " entries" .I " ..." .BI " SubSection \*qDisplay\*q" .I " entries" .I " ... .B " EndSubSection" .I " ..." .B "EndSection" .fi .RE .PP The .B Identifier entry is mandatory. All others are optional. .PP The .B Identifier entry specifies the unique name for this screen. The .B Screen section provides information specific to the whole screen, including screen\-specific .BR Options . In multi\-head configurations, there will be multiple active .B Screen sections, one for each head. The entries available for this section are: .TP 7 .BI "Device \*q" device\-id \*q This entry specifies the .B Device 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 of a .B Device section in the config file. .TP 7 .BI "Monitor \*q" monitor\-id \*q specifies which monitor description is to be used for this screen. If a .B Monitor name is not specified, a default configuration is used. Currently the default configuration may not function as expected on all platforms. .TP 7 .BI "VideoAdaptor \*q" xv\-id \*q specifies an optional Xv video adaptor description to be used with this screen. .TP 7 .BI "DefaultDepth " depth specifies which color depth the server should use by default. The .B \-depth command line option can be used to override this. If neither is specified, the default depth is driver\-specific, but in most cases is 8. .TP 7 .BI "DefaultFbBpp " bpp specifies which framebuffer layout to use by default. The .B \-fbbpp command line option can be used to override this. In most cases the driver will chose the best default value for this. The only case where there is even a choice in this value is for depth 24, where some hardware supports both a packed 24 bit framebuffer layout and a sparse 32 bit framebuffer layout. .TP 7 .BI "MatchSeat " "seat\-id" Only apply this .B Screen section if X server was started with .B -seat .I seat\-id option. .TP 7 .B Options Various .B Option flags may be specified in the .B Screen section. Some are driver\-specific and are described in the driver documentation. 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 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 below. Note that disabling an operation will have no effect if the operation is not accelerated (whether due to lack of support in the hardware or in the driver). .TP 7 .BI "Option \*qInitPrimary\*q \*q" boolean \*q Use the Int10 module to initialize the primary graphics card. Normally, only secondary cards are soft-booted using the Int10 module, as the primary card has already been initialized by the BIOS at boot time. Default: false. .TP 7 .BI "Option \*qNoInt10\*q \*q" boolean \*q Disables the Int10 module, a module that uses the int10 call to the BIOS of the graphics card to initialize it. Default: false. .PP Each .B Screen section may optionally contain one or more .B Display subsections. Those subsections provide depth/fbbpp specific configuration information, and the one chosen depends on the depth and/or fbbpp that is being used for the screen. The .B Display subsection format is described in the section below. .SH "DISPLAY SUBSECTION" Each .B Screen section may have multiple .B Display subsections. The \(lqactive\(rq .B Display subsection is the first that matches the depth and/or fbbpp values being used, or failing that, the first that has neither a depth or fbbpp value specified. The .B Display subsections are optional. When there isn't one that matches the depth and/or fbbpp values being used, all the parameters that can be specified here fall back to their defaults. .PP .B Display subsections have the following format: .PP .RS 4 .nf .B " SubSection \*qDisplay\*q" .BI " Depth " depth .I " entries" .I " ..." .B " EndSubSection" .fi .RE .TP 7 .BI "Depth " depth This entry specifies what colour depth the .B Display subsection is to be used for. This entry is usually specified, but it may be omitted to create a match\-all .B Display subsection or when wishing to match only against the .B FbBpp parameter. The range of .I depth values that are allowed depends on the driver. Most drivers support 8, 15, 16 and 24. Some also support 1 and/or 4, and some may support other values (like 30). Note: .I depth means the number of bits in a pixel that are actually used to determine the pixel colour. 32 is not a valid .I depth value. Most hardware that uses 32 bits per pixel only uses 24 of them to hold the colour information, which means that the colour depth is 24, not 32. .TP 7 .BI "FbBpp " bpp This entry specifies the framebuffer format this .B Display subsection is to be used for. This entry is only needed when providing depth 24 configurations that allow a choice between a 24 bpp packed framebuffer format and a 32bpp sparse framebuffer format. In most cases this entry should not be used. .TP 7 .BI "Weight " "red\-weight green\-weight blue\-weight" This optional entry specifies the relative RGB weighting to be used for a screen is being used at depth 16 for drivers that allow multiple formats. This may also be specified from the command line with the .B \-weight option (see .BR Xorg(__appmansuffix__)). .TP 7 .BI "Virtual " "xdim ydim" This optional entry specifies the virtual screen resolution to be used. .I xdim must be a multiple of either 8 or 16 for most drivers, and a multiple of 32 when running in monochrome mode. The given value will be rounded down if this is not the case. Video modes which are too large for the specified virtual size will be rejected. If this entry is not present, the virtual screen resolution will be set to accommodate all the valid video modes given in the .B Modes entry. Some drivers/hardware combinations do not support virtual screens. Refer to the appropriate driver\-specific documentation for details. .TP 7 .BI "ViewPort " "x0 y0" This optional entry sets the upper left corner of the initial display. This is only relevant when the virtual screen resolution is different from the resolution of the initial video mode. If this entry is not given, then the initial display will be centered in the virtual display area. .TP 7 .BI "Modes \*q" mode\-name \*q " ..." This optional entry specifies the list of video modes to use. Each .I mode\-name specified must be in double quotes. They must correspond to those specified or referenced in the appropriate .B Monitor section (including implicitly referenced built\-in VESA standard modes). The server will delete modes from this list which don't satisfy various requirements. The first valid mode in this list will be the default display mode for startup. The list of valid modes is converted internally into a circular list. It is possible to switch to the next mode with .B Ctrl+Alt+Keypad\-Plus and to the previous mode with .BR Ctrl+Alt+Keypad\-Minus . When this entry is omitted, the valid modes referenced by the appropriate .B Monitor section will be used. If the .B Monitor section contains no modes, then the selection will be taken from the built-in VESA standard modes. .TP 7 .BI "Visual \*q" visual\-name \*q This optional entry sets the default root visual type. This may also be specified from the command line (see the .BR Xserver(__appmansuffix__) man page). The visual types available for depth 8 are (default is .BR PseudoColor ): .PP .RS 11 .nf .B StaticGray .B GrayScale .B StaticColor .B PseudoColor .B TrueColor .B DirectColor .fi .RE .PP .RS 7 The visual type available for the depths 15, 16 and 24 are (default is .BR TrueColor ): .PP .RS 4 .nf .B TrueColor .B DirectColor .fi .RE .PP Not all drivers support .B DirectColor at these depths. .PP The visual types available for the depth 4 are (default is .BR StaticColor ): .PP .RS 4 .nf .B StaticGray .B GrayScale .B StaticColor .B PseudoColor .fi .RE .PP The visual type available for the depth 1 (monochrome) is .BR StaticGray . .RE .TP 7 .BI "Black " "red green blue" This optional entry allows the \(lqblack\(rq colour to be specified. This is only supported at depth 1. The default is black. .TP 7 .BI "White " "red green blue" This optional entry allows the \(lqwhite\(rq colour to be specified. This is only supported at depth 1. The default is white. .TP 7 .B Options Option flags may be specified in the .B Display subsections. These may include driver\-specific options and driver\-independent options. The former are described in the driver\-specific documentation. Some of the latter are described above in the section about the .B Screen section, and they may also be included here. .SH "SERVERLAYOUT SECTION" The config file may have multiple .B ServerLayout sections. A \(lqserver layout\(rq represents the binding of one or more screens .RB ( Screen sections) and one or more input devices .RB ( InputDevice sections) to form a complete configuration. In multi\-head configurations, it also specifies the relative layout of the heads. A .B ServerLayout section is considered \(lqactive\(rq if it is referenced by the .B \-layout command line option or by an .B "Option \*qDefaultServerLayout\*q" entry in the .B ServerFlags section (the former takes precedence over the latter). If those options are not used, the first .B ServerLayout section found in the config file is considered the active one. If no .B ServerLayout sections are present, the single active screen and two active (core) input devices are selected as described in the relevant sections above. .PP .B ServerLayout sections have the following format: .PP .RS 4 .nf .B "Section \*qServerLayout\*q" .BI " Identifier \*q" name \*q .BI " Screen \*q" screen\-id \*q .I " ..." .BI " InputDevice \*q" idev\-id \*q .I " ..." .I " options" .I " ..." .B "EndSection" .fi .RE .PP Each .B ServerLayout section must have an .B Identifier entry and at least one .B Screen entry. .PP The .B Identifier entry specifies the unique name for this server layout. The .B ServerLayout section provides information specific to the whole session, including session\-specific .BR Options . The .B ServerFlags options (described above) may be specified here, and ones given here override those given in the .B ServerFlags section. .PP The entries that may be used in this section are described here. .TP 7 .BI "Screen " "screen\-num" " \*qscreen\-id\*q " "position\-information" One of these entries must be given for each screen being used in a session. The .I screen\-id field is mandatory, and specifies the .B Screen section being referenced. The .I screen\-num field is optional, and may be used to specify the screen number in multi\-head configurations. When this field is omitted, the screens will be numbered in the order that they are listed in. The numbering starts from 0, and must be consecutive. The .I position\-information field describes the way multiple screens are positioned. There are a number of different ways that this information can be provided: .RS 7 .TP 4 .I "x y" .TP 4 .BI "Absolute " "x y" These both specify that the upper left corner's coordinates are .RI ( x , y ). The .B Absolute keyword is optional. Some older versions of XFree86 (4.2 and earlier) don't recognise the .B Absolute keyword, so it's safest to just specify the coordinates without it. .TP 4 .BI "RightOf \*q" screen\-id \*q .TP 4 .BI "LeftOf \*q" screen\-id \*q .TP 4 .BI "Above \*q" screen\-id \*q .TP 4 .BI "Below \*q" screen\-id \*q .TP 4 .BI "Relative \*q" screen\-id \*q " x y" These give the screen's location relative to another screen. The first four position the screen immediately to the right, left, above or below the other screen. When positioning to the right or left, the top edges are aligned. When positioning above or below, the left edges are aligned. The .B Relative form specifies the offset of the screen's origin (upper left corner) relative to the origin of another screen. .RE .TP 7 .BI "InputDevice \*q" idev\-id "\*q \*q" option \*q " ..." One of these entries should be given for each input device being used in a session. Normally at least two are required, one each for the core pointer and keyboard devices. If either of those is missing, suitable .B InputDevice entries are searched for using the method described above in the .B INPUTDEVICE section. The .I idev\-id field is mandatory, and specifies the name of the .B InputDevice section being referenced. Multiple .I option fields may be specified, each in double quotes. The options permitted here are any that may also be given in the .B InputDevice sections. Normally only session\-specific input device options would be used here. The most commonly used options are: .PP .RS 11 .nf .B \*qCorePointer\*q .B \*qCoreKeyboard\*q .B \*qSendCoreEvents\*q .fi .RE .PP .RS 7 and the first two should normally be used to indicate the core pointer and core keyboard devices respectively. .RE .TP 7 .BI "MatchSeat " "seat\-id" Only apply this .B ServerLayout section if X server was started with .B -seat .I seat\-id option. .TP 7 .B Options In addition to the following, any option permitted in the .B ServerFlags section may also be specified here. When the same option appears in both places, the value given here overrides the one given in the .B ServerFlags section. .TP 7 .BI "Option \*qIsolateDevice\*q \*q" bus\-id \*q Restrict device resets to the specified .IR bus\-id . See the .B BusID option (described in .BR "DEVICE SECTION" , above) for the format of the .I bus\-id parameter. This option overrides .BR SingleCard , if specified. At present, only PCI devices can be isolated in this manner. .TP 7 .BI "Option \*qSingleCard\*q \*q" boolean \*q As .BR IsolateDevice , except that the bus ID of the first device in the layout is used. .PP Here is an example of a .B ServerLayout section for a dual headed configuration with two mice: .PP .RS 4 .nf .B "Section \*qServerLayout\*q" .B " Identifier \*qLayout 1\*q" .B " Screen \*qMGA 1\*q" .B " Screen \*qMGA 2\*q RightOf \*qMGA 1\*q" .B " InputDevice \*qKeyboard 1\*q \*qCoreKeyboard\*q" .B " InputDevice \*qMouse 1\*q \*qCorePointer\*q" .B " InputDevice \*qMouse 2\*q \*qSendCoreEvents\*q" .B " Option \*qBlankTime\*q \*q5\*q" .B "EndSection" .fi .RE .SH "DRI SECTION" This optional section is used to provide some information for the Direct Rendering Infrastructure. Details about the format of this section can be found on-line at .IR . .SH "VENDOR SECTION" The optional .B Vendor section may be used to provide vendor\-specific configuration information. Multiple .B Vendor sections may be present, and they may contain an .B Identifier entry and multiple .B Option flags. The data therein is not used in this release. .PP .SH "SEE ALSO" General: .BR X (__miscmansuffix__), .BR Xserver (__appmansuffix__), .BR Xorg (__appmansuffix__), .BR cvt (__appmansuffix__), .BR gtf (__appmansuffix__). .PP .B "Not all modules or interfaces are available on all platforms." .PP Display drivers: .BR apm (__drivermansuffix__), .BR ati (__drivermansuffix__), .BR chips (__drivermansuffix__), .BR cirrus (__drivermansuffix__), .BR cyrix (__drivermansuffix__), .BR fbdev (__drivermansuffix__), .BR glide (__drivermansuffix__), .BR glint (__drivermansuffix__), .BR i128 (__drivermansuffix__), .BR i740 (__drivermansuffix__), .BR imstt (__drivermansuffix__), .BR intel (__drivermansuffix__), .BR mga (__drivermansuffix__), .BR neomagic (__drivermansuffix__), .BR nv (__drivermansuffix__), .BR openchrome (__drivermansuffix__), .BR r128 (__drivermansuffix__), .BR radeon (__drivermansuffix__), .BR rendition (__drivermansuffix__), .BR savage (__drivermansuffix__), .BR s3virge (__drivermansuffix__), .BR siliconmotion (__drivermansuffix__), .BR sis (__drivermansuffix__), .BR sisusb (__drivermansuffix__), .BR sunbw2 (__drivermansuffix__), .BR suncg14 (__drivermansuffix__), .BR suncg3 (__drivermansuffix__), .BR suncg6 (__drivermansuffix__), .BR sunffb (__drivermansuffix__), .BR sunleo (__drivermansuffix__), .BR suntcx (__drivermansuffix__), .BR tdfx (__drivermansuffix__), .\" .BR tga (__drivermansuffix__), .BR trident (__drivermansuffix__), .BR tseng (__drivermansuffix__), .BR vesa (__drivermansuffix__), .BR vmware (__drivermansuffix__), .BR voodoo (__drivermansuffix__), .BR wsfb (__drivermansuffix__), .BR xgi (__drivermansuffix__), .BR xgixp (__drivermansuffix__). .PP Input drivers: .BR acecad (__drivermansuffix__), .BR citron (__drivermansuffix__), .BR elographics (__drivermansuffix__), .BR evdev (__drivermansuffix__), .BR fpit (__drivermansuffix__), .BR joystick (__drivermansuffix__), .BR kbd (__drivermansuffix__), .BR mousedrv (__drivermansuffix__), .BR mutouch (__drivermansuffix__), .BR penmount (__drivermansuffix__), .BR synaptics (__drivermansuffix__), .BR vmmouse (__drivermansuffix__), .BR void (__drivermansuffix__), .BR wacom (__drivermansuffix__). .PP Other modules and interfaces: .BR exa (__drivermansuffix__), .BR fbdevhw (__drivermansuffix__), .\" .BR shadowfb (__drivermansuffix__), .BR v4l (__drivermansuffix__). .br .SH AUTHORS This manual page was largely rewritten by David Dawes .IR . xorg-server-1.17.1/hw/xfree86/man/Makefile.in0000664000175100017510000006274012466505433015557 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am @SUID_WRAPPER_TRUE@am__append_1 = Xorg.wrap.man @SUID_WRAPPER_TRUE@am__append_2 = Xwrapper.config.man @SUID_WRAPPER_FALSE@am__append_3 = Xorg.wrap.man Xwrapper.config.man subdir = hw/xfree86/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) \ $(am__append_3) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man appman_PRE = Xorg.man $(am__append_1) fileman_PRE = xorg.conf.man xorg.conf.d.man $(am__append_2) all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/xfree86/man/Xorg.man0000664000175100017510000005252112323563340015113 00000000000000.\" $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 Xorg __appmansuffix__ __vendorversion__ .SH NAME Xorg - X11R7 X server .SH SYNOPSIS .B Xorg .RI [\fB:\fP display ] .RI [ option .IR ... ] .SH DESCRIPTION .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. .PP This work was derived by the X.Org Foundation from the XFree86 Project's .I "XFree86\ 4.4rc2" release. The XFree86 release was originally derived from .I "X386\ 1.2" by Thomas Roell which was contributed to X11R5 by Snitily Graphics Consulting Service. .SH PLATFORMS .PP .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, SPARC and PowerPC. The most widely supported operating systems are the free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD, OpenBSD, and Solaris. Commercial UNIX operating systems such as UnixWare are also supported. Other supported operating systems include GNU Hurd. Mac OS X is supported with the Xquartz(__appmansuffix__) X server. Win32/Cygwin is supported with the XWin(__appmansuffix__) X server. .PP .SH "NETWORK CONNECTIONS" .B Xorg supports connections made using the following reliable byte-streams: .TP 4 .I "Local" On most platforms, the "Local" connection type is a UNIX-domain socket. 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 Xorg listens on port .RI 6000+ n , where .I n is the display number. This connection type can be disabled with the .B \-nolisten option (see the Xserver(1) man page for details). .SH "ENVIRONMENT VARIABLES" For operating systems that support local connections other than Unix Domain sockets (SVR3 and SVR4), there is a compiled-in list specifying the order in which local connections should be attempted. This list can be overridden by the .I XLOCAL environment variable described below. If the display name indicates a best-choice connection should be made (e.g. .BR :0.0 ), each connection mechanism is tried until a connection succeeds or no more mechanisms are available. Note: for these OSs, the Unix Domain socket connection is treated differently from the other local connection types. To use it the connection must be made to .BR unix:0.0 . .PP The .I XLOCAL environment variable should contain a list of one more more of the following: .PP .RS 8 .nf NAMED PTS SCO ISC .fi .RE .PP which represent SVR4 Named Streams pipe, Old-style USL Streams pipe, SCO XSight Streams pipe, and ISC Streams pipe, respectively. You can select a single mechanism (e.g. .IR XLOCAL=NAMED ), or an ordered list (e.g. \fIXLOCAL="NAMED:PTS:SCO"\fP). his variable overrides the compiled-in defaults. For SVR4 it is recommended that .I NAMED be the first preference connection. The default setting is .IR PTS:NAMED:ISC:SCO . .PP To globally override the compiled-in defaults, you should define (and export if using .B sh or .BR ksh ) .I XLOCAL globally. If you use startx(1) or xinit(1), the definition should be at the top of your .I .xinitrc file. If you use xdm(1), the definitions should be early on in the .I __projectroot__/lib/X11/xdm/Xsession script. .SH OPTIONS .B Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters: command line options, environment variables, the 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 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 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 Xorg accepts the following command line switches: .TP 8 .BI vt XX .I XX specifies the Virtual Terminal device number which .B Xorg will use. Without this option, .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. .TP .B \-allowMouseOpenFail Allow the server to start up even if the mouse device can't be opened or initialised. This is equivalent to the .B AllowMouseOpenFail 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 xorg.conf(__filemansuffix__) file option. By default non-local connections are not allowed. .TP 8 .BI \-bgamma " value" Set the blue gamma correction. .I value must be between 0.1 and 10. The default is 1.0. Not all drivers support this. See also the .BR \-gamma , .BR \-rgamma , and .B \-ggamma options. .TP 8 .BI \-bpp " n" No longer supported. Use .B \-depth to set the color depth, and use .B \-fbbpp if you really need to force a non-default framebuffer (hardware) pixel format. .TP 8 .BI \-config " file" Read the server configuration from .IR file . This option will work for any file when the server is run as root (i.e, with real-uid 0), or for files relative to a directory in the config search path for all other users. .TP 8 .BI \-configdir " directory" Read the server configuration files from .IR directory . This option will work for any directory when the server is run as root (i.e, with real-uid 0), or for directories relative to a directory in the config directory search path for all other users. .TP 8 .B \-configure When this option is specified, the .B Xorg server loads all video driver modules, probes for available hardware, 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 is run as root (i.e, with real-uid 0). .TP 8 .BI "\-crt /dev/tty" XX SCO only. This is the same as the .B vt option, and is provided for compatibility with the native SCO X server. .TP 8 .BI \-depth " n" Sets the default color depth. Legal values are 1, 4, 8, 15, 16, and 24. Not all drivers support all values. .TP 8 .B \-disableVidMode 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 xorg.conf(__filemansuffix__) file option. .TP 8 .B \-fbbpp \fIn\fP Sets the number of framebuffer bits per pixel. You should only set this if you're sure it's necessary; normally the server can deduce the correct value from .B \-depth above. Useful if you want to run a depth 24 configuration with a 24 bpp framebuffer rather than the (possibly default) 32 bpp framebuffer (or vice versa). Legal values are 1, 8, 16, 24, 32. Not all drivers support all values. .TP 8 .B \-flipPixels Swap the default values for the black and white pixels. .TP 8 .BI \-gamma " value" Set the gamma correction. .I value must be between 0.1 and 10. The default is 1.0. This value is applied equally to the R, G and B values. Those values can be set independently with the .BR \-rgamma , .BR \-bgamma , and .B \-ggamma options. Not all drivers support this. .TP 8 .BI \-ggamma " value" Set the green gamma correction. .I value must be between 0.1 and 10. The default is 1.0. Not all drivers support this. See also the .BR \-gamma , .BR \-rgamma , and .B \-bgamma options. .TP 8 .B \-ignoreABI The .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 that the server does not have. When this option is specified, mismatches like this are downgraded from fatal errors to warnings. This option should be used with care. .TP 8 .B \-isolateDevice \fIbus\-id\fP Restrict device resets to the device at .IR bus\-id . The .I bus\-id string has the form .IB bustype : bus : device : function (e.g., \(oqPCI:1:0:0\(cq). At present, only isolation of PCI devices is supported; i.e., this option is ignored if .I bustype is anything other than \(oqPCI\(cq. .TP 8 .B \-keeptty Prevent the server from detaching its initial controlling terminal. 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 xorg.conf(__filemansuffix__) file .B InputDevice section called .I keyboard-name as the core keyboard. This option is ignored when the .B Layout section specifies a core keyboard. In the absence of both a Layout section and this option, the first relevant .B InputDevice section is used for the core keyboard. .TP 8 .BI \-layout " layout-name" Use the xorg.conf(__filemansuffix__) file .B Layout section called .IR layout-name . By default the first .B Layout section is used. .TP 8 .BI \-logfile " filename" Use the file called .I filename as the .B Xorg server log file. The default log file when running as root is .BI __logdir__/Xorg. n .log and for non root it is .BI $XDG_DATA_HOME/xorg/Xorg. n .log where .I n is the display number of the .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 Xorg server log file. If the .I n value isn't supplied, each occurrence of this option increments the log file verbosity level. When the .I n value is supplied, the log file verbosity level is set to that value. The default log file verbosity level is 3. .TP 8 .BI \-modulepath " searchpath" Set the module search path to .IR searchpath . .I searchpath is a comma separated list of directories to search for .B Xorg server modules. This option is only available when the server is run as root (i.e, with real-uid 0). .TP 8 .B \-nosilk Disable Silken Mouse support. .TP 8 .B \-novtswitch Disable the automatic switching on X server reset and shutdown to the VT that was active when the server started, if supported by the OS. .TP 8 .B \-pixmap24 Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel. The default is usually 32 bits per pixel. There is normally little 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 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 xorg.conf(__filemansuffix__) file option. .TP 8 .BI \-pointer " pointer-name" Use the xorg.conf(__filemansuffix__) file .B InputDevice section called .I pointer-name as the core pointer. This option is ignored when the .B Layout section specifies a core pointer. In the absence of both a Layout section and this option, the first relevant .B InputDevice section is used for the core pointer. .TP 8 .B \-quiet Suppress most informational messages at startup. The verbosity level is set to zero. .TP 8 .BI \-rgamma " value" Set the red gamma correction. .I value must be between 0.1 and 10. The default is 1.0. Not all drivers support this. See also the .BR \-gamma , .BR \-bgamma , and .B \-ggamma options. .TP 8 .B \-sharevts Share virtual terminals with another X server, if supported by the OS. .TP 8 .BI \-screen " screen-name" Use the xorg.conf(__filemansuffix__) file .B Screen section called .IR screen-name . By default the screens referenced by the default .B Layout section are used, or the first .B Screen section when there are no .B Layout sections. .TP 8 .B \-showconfig This is the same as the .B \-version option, and is included for compatibility reasons. It may be removed in a future release, so the .B \-version option should be used instead. .TP 8 .B \-showDefaultModulePath Print out the default module path the server was compiled with. .TP 8 .B \-showDefaultLibPath Print out the path libraries should be installed to. .TP 8 .B \-showopts For each driver module installed, print out the list of options and their argument types. .TP 8 .BI \-weight " nnn" Set RGB weighting at 16 bpp. The default is 565. This applies only to those drivers which support 16 bpp. .TP 8 .BR \-verbose " [\fIn\fP]" Sets the verbosity level for information printed on stderr. If the .I n value isn't supplied, each occurrence of this option increments the verbosity level. When the .I n value is supplied, the verbosity level is set to that value. The default verbosity level is 0. .TP 8 .B \-version Print out the server version, patchlevel, release date, the operating system/platform it was built on, and whether it includes module loader support. .SH "KEYBOARD" .PP The .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 depend on the XKB keymap loaded by a particular keyboard device and may or may not be available on a given configuration. .PP The following key combinations are commonly part of the default XKEYBOARD keymap. .TP 8 .B Ctrl+Alt+Backspace Immediately kills the server -- no questions asked. It can be disabled by setting the .B DontZap xorg.conf(__filemansuffix__) file option to a TRUE value. .PP .RS 8 It should be noted that zapping is triggered by the .B Terminate_Server action in the keyboard map. This action is not part of the default keymaps but can be enabled with the XKB option .B \*qterminate:ctrl_alt_bksp\*q. .RE .TP 8 .B Ctrl+Alt+Keypad-Plus Change video mode to next one specified in the configuration file. This can be disabled with the .B DontZoom 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 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 xorg.conf(__filemansuffix__) file option. .SH CONFIGURATION .B Xorg typically uses a configuration file called .B xorg.conf and configuration files with the suffix .I .conf in a directory called .B __xconfigdir__ for its initial setup. Refer to the xorg.conf(__filemansuffix__) manual page for information about the format of this file. .PP .B Xorg has a mechanism for automatically generating a built-in configuration at run-time when no .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 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 be generated at run-time. .PP The second is to have "safe" fallbacks for most configuration information. This maximises the likelihood that the .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 Xorg is work in progress. It is currently aimed at the most popular hardware and software platforms supported by Xorg. Enhancements are planned for future releases. .SH FILES The .B Xorg server config files can be found in a range of locations. These are documented fully in the xorg.conf(__filemansuffix__) manual page. The most commonly used locations are shown here. .TP 30 .B /etc/X11/xorg.conf Server configuration file. .TP 30 .B /etc/X11/xorg.conf-4 Server configuration file. .TP 30 .B /etc/xorg.conf Server configuration file. .TP 30 .B __projectroot__/etc/xorg.conf Server configuration file. .TP 30 .B __projectroot__/lib/X11/xorg.conf Server configuration file. .TP 30 .B /etc/X11/__xconfigdir__ Server configuration directory. .TP 30 .B /etc/X11/__xconfigdir__-4 Server configuration directory. .TP 30 .B /etc/__xconfigdir__ Server configuration directory. .TP 30 .B __projectroot__/etc/__xconfigdir__ Server configuration directory. .TP 30 .B __projectroot__/lib/X11/__xconfigdir__ Server configuration directory. .TP 30 .BI __logdir__/Xorg. n .log Server log file for display .IR n . .TP 30 .B __projectroot__/bin/\(** Client binaries. .TP 30 .B __projectroot__/include/\(** Header files. .TP 30 .B __projectroot__/lib/\(** Libraries. .TP 30 .B __datadir__/fonts/X11/\(** Fonts. .TP 30 .B __projectroot__/share/X11/XErrorDB Client error message database. .TP 30 .B __projectroot__/lib/X11/app-defaults/\(** Client resource specifications. .TP 30 .B __mandir__/man?/\(** Manual pages. .TP 30 .BI /etc/X n .hosts Initial access control list for display .IR n . .SH "SEE ALSO" X(__miscmansuffix__), Xserver(__appmansuffix__), xdm(__appmansuffix__), xinit(__appmansuffix__), xorg.conf(__filemansuffix__), xvidtune(__appmansuffix__), xkeyboard-config (__miscmansuffix__), apm(__drivermansuffix__), ati(__drivermansuffix__), chips(__drivermansuffix__), cirrus(__drivermansuffix__), cyrix(__drivermansuffix__), fbdev(__drivermansuffix__), glide(__drivermansuffix__), glint(__drivermansuffix__), i128(__drivermansuffix__), i740(__drivermansuffix__), imstt(__drivermansuffix__), intel(__drivermansuffix__), mga(__drivermansuffix__), neomagic(__drivermansuffix__), nsc(__drivermansuffix__), nv(__drivermansuffix__), openchrome (__drivermansuffix__), r128(__drivermansuffix__), rendition(__drivermansuffix__), s3virge(__drivermansuffix__), siliconmotion(__drivermansuffix__), sis(__drivermansuffix__), sunbw2(__drivermansuffix__), suncg14(__drivermansuffix__), suncg3(__drivermansuffix__), suncg6(__drivermansuffix__), sunffb(__drivermansuffix__), sunleo(__drivermansuffix__), suntcx(__drivermansuffix__), tdfx(__drivermansuffix__), tga(__drivermansuffix__), trident(__drivermansuffix__), tseng(__drivermansuffix__), v4l(__drivermansuffix__), vesa(__drivermansuffix__), vmware(__drivermansuffix__), .br Web site .IR . .SH AUTHORS 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 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 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. .PP XFree86 was later integrated in the then X Consortium's X11R6 release by a group of dedicated XFree86 developers, including the following: .PP .RS 4 .nf Stuart Anderson \fIanderson@metrolink.com\fP Doug Anson \fIdanson@lgc.com\fP Gertjan Akkerman \fIakkerman@dutiba.twi.tudelft.nl\fP Mike Bernson \fImike@mbsun.mlb.org\fP Robin Cutshaw \fIrobin@XFree86.org\fP David Dawes \fIdawes@XFree86.org\fP Marc Evans \fImarc@XFree86.org\fP Pascal Haible \fIhaible@izfm.uni-stuttgart.de\fP Matthieu Herrb \fIMatthieu.Herrb@laas.fr\fP Dirk Hohndel \fIhohndel@XFree86.org\fP David Holland \fIdavidh@use.com\fP Alan Hourihane \fIalanh@fairlite.demon.co.uk\fP Jeffrey Hsu \fIhsu@soda.berkeley.edu\fP Glenn Lai \fIglenn@cs.utexas.edu\fP Ted Lemon \fImellon@ncd.com\fP Rich Murphey \fIrich@XFree86.org\fP Hans Nasten \fInasten@everyware.se\fP Mark Snitily \fImark@sgcs.com\fP Randy Terbush \fIrandyt@cse.unl.edu\fP Jon Tombs \fItombs@XFree86.org\fP Kees Verstoep \fIversto@cs.vu.nl\fP Paul Vixie \fIpaul@vix.com\fP Mark Weaver \fIMark_Weaver@brown.edu\fP David Wexelblat \fIdwex@XFree86.org\fP Philip Wheatley \fIPhilip.Wheatley@ColumbiaSC.NCR.COM\fP Thomas Wolfram \fIwolf@prz.tu-berlin.de\fP Orest Zborowski \fIorestz@eskimo.com\fP .fi .RE .PP 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 \fI\fP. .SH LEGAL .PP .B Xorg is copyright software, provided under licenses that permit modification and redistribution in source and binary form without fee. .B Xorg is copyright by numerous authors and contributors from around the world. Licensing information can be found at .IR . Refer to the source code for specific copyright notices. .PP .B XFree86(TM) is a trademark of The XFree86 Project, Inc. .PP .B X11(TM) and .B X Window System(TM) are trademarks of The Open Group. xorg-server-1.17.1/hw/xfree86/man/xorg.conf.d.man0000664000175100017510000000006512274325511016316 00000000000000.so man__filemansuffix__/xorg.conf.__filemansuffix__ xorg-server-1.17.1/hw/xfree86/ramdac/0000775000175100017510000000000012466505445014240 500000000000000xorg-server-1.17.1/hw/xfree86/ramdac/Makefile.am0000664000175100017510000000056412200102654016176 00000000000000noinst_LTLIBRARIES = libramdac.la libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c sdk_HEADERS = BT.h IBM.h TI.h xf86Cursor.h xf86RamDac.h EXTRA_DIST = BTPriv.h IBMPriv.h TIPriv.h xf86CursorPriv.h xf86RamDacPriv.h \ CURSOR.NOTES AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) xorg-server-1.17.1/hw/xfree86/ramdac/xf86RamDac.c0000664000175100017510000000721312366220413016156 00000000000000/* * Copyright 1998 by Alan Hourihane, Wigan, England. * * 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 Alan Hourihane not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Alan Hourihane makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL ALAN HOURIHANE 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: Alan Hourihane, * * Generic RAMDAC access routines. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86_OSproc.h" #include "xf86RamDacPriv.h" int RamDacHWPrivateIndex = -1; int RamDacScreenPrivateIndex = -1; RamDacRecPtr RamDacCreateInfoRec(void) { RamDacRecPtr infoRec; infoRec = calloc(1, sizeof(RamDacRec)); return infoRec; } RamDacHelperRecPtr RamDacHelperCreateInfoRec(void) { RamDacHelperRecPtr infoRec; infoRec = calloc(1, sizeof(RamDacHelperRec)); return infoRec; } void RamDacDestroyInfoRec(RamDacRecPtr infoRec) { free(infoRec); } void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr infoRec) { free(infoRec); } Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv) { RamDacScreenRecPtr ramdacScrPtr; /* * make sure the RamDacRec is allocated */ if (!RamDacGetRec(pScrn)) return FALSE; ramdacScrPtr = ((RamDacScreenRecPtr) (pScrn)->privates[RamDacGetScreenIndex()].ptr); ramdacScrPtr->RamDacRec = ramdacPriv; return TRUE; } void RamDacGetRecPrivate(void) { if (RamDacHWPrivateIndex < 0) RamDacHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); if (RamDacScreenPrivateIndex < 0) RamDacScreenPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); return; } Bool RamDacGetRec(ScrnInfoPtr scrp) { RamDacGetRecPrivate(); /* * New privates are always set to NULL, so we can check if the allocation * has already been done. */ if (scrp->privates[RamDacHWPrivateIndex].ptr != NULL) return TRUE; if (scrp->privates[RamDacScreenPrivateIndex].ptr != NULL) return TRUE; scrp->privates[RamDacHWPrivateIndex].ptr = xnfcalloc(sizeof(RamDacHWRec), 1); scrp->privates[RamDacScreenPrivateIndex].ptr = xnfcalloc(sizeof(RamDacScreenRec), 1); return TRUE; } void RamDacFreeRec(ScrnInfoPtr pScrn) { RamDacHWRecPtr ramdacHWPtr; RamDacScreenRecPtr ramdacScrPtr; if (RamDacHWPrivateIndex < 0) return; if (RamDacScreenPrivateIndex < 0) return; ramdacHWPtr = RAMDACHWPTR(pScrn); ramdacScrPtr = ((RamDacScreenRecPtr) (pScrn)->privates[RamDacGetScreenIndex()].ptr); free(ramdacHWPtr); ramdacHWPtr = NULL; free(ramdacScrPtr); ramdacScrPtr = NULL; } int RamDacGetHWIndex(void) { return RamDacHWPrivateIndex; } int RamDacGetScreenIndex(void) { return RamDacScreenPrivateIndex; } xorg-server-1.17.1/hw/xfree86/ramdac/IBM.h0000664000175100017510000003670212274325511014737 00000000000000 #include extern _X_EXPORT RamDacHelperRecPtr IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs); extern _X_EXPORT void IBMramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void IBMramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void IBMramdac526SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void IBMramdac640SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT unsigned long IBMramdac526CalculateMNPCForClock(unsigned long RefClock, unsigned long ReqClock, char IsPixClock, unsigned long MinClock, unsigned long MaxClock, unsigned long *rM, unsigned long *rN, unsigned long *rP, unsigned long *rC); extern _X_EXPORT unsigned long IBMramdac640CalculateMNPCForClock(unsigned long RefClock, unsigned long ReqClock, char IsPixClock, unsigned long MinClock, unsigned long MaxClock, unsigned long *rM, unsigned long *rN, unsigned long *rP, unsigned long *rC); extern _X_EXPORT void IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr); extern _X_EXPORT void IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr); typedef void IBMramdac526SetBppProc(ScrnInfoPtr, RamDacRegRecPtr); extern _X_EXPORT IBMramdac526SetBppProc *IBMramdac526SetBppWeak(void); #define IBM524_RAMDAC ((VENDOR_IBM << 16) | 0x00) #define IBM524A_RAMDAC ((VENDOR_IBM << 16) | 0x01) #define IBM525_RAMDAC ((VENDOR_IBM << 16) | 0x02) #define IBM526_RAMDAC ((VENDOR_IBM << 16) | 0x03) #define IBM526DB_RAMDAC ((VENDOR_IBM << 16) | 0x04) #define IBM528_RAMDAC ((VENDOR_IBM << 16) | 0x05) #define IBM528A_RAMDAC ((VENDOR_IBM << 16) | 0x06) #define IBM624_RAMDAC ((VENDOR_IBM << 16) | 0x07) #define IBM624DB_RAMDAC ((VENDOR_IBM << 16) | 0x08) #define IBM640_RAMDAC ((VENDOR_IBM << 16) | 0x09) /* * IBM Ramdac registers */ #define IBMRGB_REF_FREQ_1 14.31818 #define IBMRGB_REF_FREQ_2 50.00000 #define IBMRGB_rev 0x00 #define IBMRGB_id 0x01 #define IBMRGB_misc_clock 0x02 #define IBMRGB_sync 0x03 #define IBMRGB_hsync_pos 0x04 #define IBMRGB_pwr_mgmt 0x05 #define IBMRGB_dac_op 0x06 #define IBMRGB_pal_ctrl 0x07 #define IBMRGB_sysclk 0x08 /* not RGB525 */ #define IBMRGB_pix_fmt 0x0a #define IBMRGB_8bpp 0x0b #define IBMRGB_16bpp 0x0c #define IBMRGB_24bpp 0x0d #define IBMRGB_32bpp 0x0e #define IBMRGB_pll_ctrl1 0x10 #define IBMRGB_pll_ctrl2 0x11 #define IBMRGB_pll_ref_div_fix 0x14 #define IBMRGB_sysclk_ref_div 0x15 /* not RGB525 */ #define IBMRGB_sysclk_vco_div 0x16 /* not RGB525 */ /* #define IBMRGB_f0 0x20 */ #define IBMRGB_sysclk_n 0x15 #define IBMRGB_sysclk_m 0x16 #define IBMRGB_sysclk_p 0x17 #define IBMRGB_sysclk_c 0x18 #define IBMRGB_m0 0x20 #define IBMRGB_n0 0x21 #define IBMRGB_p0 0x22 #define IBMRGB_c0 0x23 #define IBMRGB_m1 0x24 #define IBMRGB_n1 0x25 #define IBMRGB_p1 0x26 #define IBMRGB_c1 0x27 #define IBMRGB_m2 0x28 #define IBMRGB_n2 0x29 #define IBMRGB_p2 0x2a #define IBMRGB_c2 0x2b #define IBMRGB_m3 0x2c #define IBMRGB_n3 0x2d #define IBMRGB_p3 0x2e #define IBMRGB_c3 0x2f #define IBMRGB_curs 0x30 #define IBMRGB_curs_xl 0x31 #define IBMRGB_curs_xh 0x32 #define IBMRGB_curs_yl 0x33 #define IBMRGB_curs_yh 0x34 #define IBMRGB_curs_hot_x 0x35 #define IBMRGB_curs_hot_y 0x36 #define IBMRGB_curs_col1_r 0x40 #define IBMRGB_curs_col1_g 0x41 #define IBMRGB_curs_col1_b 0x42 #define IBMRGB_curs_col2_r 0x43 #define IBMRGB_curs_col2_g 0x44 #define IBMRGB_curs_col2_b 0x45 #define IBMRGB_curs_col3_r 0x46 #define IBMRGB_curs_col3_g 0x47 #define IBMRGB_curs_col3_b 0x48 #define IBMRGB_border_col_r 0x60 #define IBMRGB_border_col_g 0x61 #define IBMRGB_botder_col_b 0x62 #define IBMRGB_key 0x68 #define IBMRGB_key_mask 0x6C #define IBMRGB_misc1 0x70 #define IBMRGB_misc2 0x71 #define IBMRGB_misc3 0x72 #define IBMRGB_misc4 0x73 /* not RGB525 */ #define IBMRGB_key_control 0x78 #define IBMRGB_dac_sense 0x82 #define IBMRGB_misr_r 0x84 #define IBMRGB_misr_g 0x86 #define IBMRGB_misr_b 0x88 #define IBMRGB_pll_vco_div_in 0x8e #define IBMRGB_pll_ref_div_in 0x8f #define IBMRGB_vram_mask_0 0x90 #define IBMRGB_vram_mask_1 0x91 #define IBMRGB_vram_mask_2 0x92 #define IBMRGB_vram_mask_3 0x93 #define IBMRGB_curs_array 0x100 /* Constants rgb525.h */ /* RGB525_REVISION_LEVEL */ #define RGB525_PRODUCT_REV_LEVEL 0xf0 /* RGB525_ID */ #define RGB525_PRODUCT_ID 0x01 /* RGB525_MISC_CTRL_1 */ #define MISR_CNTL_ENABLE 0x80 #define VMSK_CNTL_ENABLE 0x40 #define PADR_RDMT_RDADDR 0x0 #define PADR_RDMT_PAL_STATE 0x20 #define SENS_DSAB_DISABLE 0x10 #define SENS_SEL_BIT3 0x0 #define SENS_SEL_BIT7 0x08 #define VRAM_SIZE_32 0x0 #define VRAM_SIZE_64 0x01 /* RGB525_MISC_CTRL_2 */ #define PCLK_SEL_LCLK 0x0 #define PCLK_SEL_PLL 0x40 #define PCLK_SEL_EXT 0x80 #define INTL_MODE_ENABLE 0x20 #define BLANK_CNTL_ENABLE 0x10 #define COL_RES_6BIT 0x0 #define COL_RES_8BIT 0x04 #define PORT_SEL_VGA 0x0 #define PORT_SEL_VRAM 0x01 /* RGB525_MISC_CTRL_3 */ #define SWAP_RB 0x80 #define SWAP_WORD_LOHI 0x0 #define SWAP_WORD_HILO 0x10 #define SWAP_NIB_HILO 0x0 #define SWAP_NIB_LOHI 0x02 /* RGB525_MISC_CLK_CTRL */ #define DDOT_CLK_ENABLE 0x0 #define DDOT_CLK_DISABLE 0x80 #define SCLK_ENABLE 0x0 #define SCLK_DISABLE 0x40 #define B24P_DDOT_PLL 0x0 #define B24P_DDOT_SCLK 0x20 #define DDOT_DIV_PLL_1 0x0 #define DDOT_DIV_PLL_2 0x02 #define DDOT_DIV_PLL_4 0x04 #define DDOT_DIV_PLL_8 0x06 #define DDOT_DIV_PLL_16 0x08 #define PLL_DISABLE 0x0 #define PLL_ENABLE 0x01 /* RGB525_SYNC_CTRL */ #define DLY_CNTL_ADD 0x0 #define DLY_SYNC_NOADD 0x80 #define CSYN_INVT_DISABLE 0x0 #define CSYN_INVT_ENABLE 0x40 #define VSYN_INVT_DISABLE 0x0 #define VSYN_INVT_ENABLE 0x20 #define HSYN_INVT_DISABLE 0x0 #define HSYN_INVT_ENABLE 0x10 #define VSYN_CNTL_NORMAL 0x0 #define VSYN_CNTL_HIGH 0x04 #define VSYN_CNTL_LOW 0x08 #define VSYN_CNTL_DISABLE 0x0C #define HSYN_CNTL_NORMAL 0x0 #define HSYN_CNTL_HIGH 0x01 #define HSYN_CNTL_LOW 0x02 #define HSYN_CNTL_DISABLE 0x03 /* RGB525_HSYNC_CTRL */ #define HSYN_POS(n) (n) /* RGB525_POWER_MANAGEMENT */ #define SCLK_PWR_NORMAL 0x0 #define SCLK_PWR_DISABLE 0x10 #define DDOT_PWR_NORMAL 0x0 #define DDOT_PWR_DISABLE 0x08 #define SYNC_PWR_NORMAL 0x0 #define SYNC_PWR_DISABLE 0x04 #define ICLK_PWR_NORMAL 0x0 #define ICLK_PWR_DISABLE 0x02 #define DAC_PWR_NORMAL 0x0 #define DAC_PWR_DISABLE 0x01 /* RGB525_DAC_OPERATION */ #define SOG_DISABLE 0x0 #define SOG_ENABLE 0x08 #define BRB_NORMAL 0x0 #define BRB_ALWAYS 0x04 #define DSR_DAC_SLOW 0x02 #define DSR_DAC_FAST 0x0 #define DPE_DISABLE 0x0 #define DPE_ENABLE 0x01 /* RGB525_PALETTE_CTRL */ #define SIXBIT_LINEAR_ENABLE 0x0 #define SIXBIT_LINEAR_DISABLE 0x80 #define PALETTE_PARITION(n) (n) /* RGB525_PIXEL_FORMAT */ #define PIXEL_FORMAT_4BPP 0x02 #define PIXEL_FORMAT_8BPP 0x03 #define PIXEL_FORMAT_16BPP 0x04 #define PIXEL_FORMAT_24BPP 0x05 #define PIXEL_FORMAT_32BPP 0x06 /* RGB525_8BPP_CTRL */ #define B8_DCOL_INDIRECT 0x0 #define B8_DCOL_DIRECT 0x01 /* RGB525_16BPP_CTRL */ #define B16_DCOL_INDIRECT 0x0 #define B16_DCOL_DYNAMIC 0x40 #define B16_DCOL_DIRECT 0xC0 #define B16_POL_FORCE_BYPASS 0x0 #define B16_POL_FORCE_LOOKUP 0x20 #define B16_ZIB 0x0 #define B16_LINEAR 0x04 #define B16_555 0x0 #define B16_565 0x02 #define B16_SPARSE 0x0 #define B16_CONTIGUOUS 0x01 /* RGB525_24BPP_CTRL */ #define B24_DCOL_INDIRECT 0x0 #define B24_DCOL_DIRECT 0x01 /* RGB525_32BPP_CTRL */ #define B32_POL_FORCE_BYPASS 0x0 #define B32_POL_FORCE_LOOKUP 0x04 #define B32_DCOL_INDIRECT 0x0 #define B32_DCOL_DYNAMIC 0x01 #define B32_DCOL_DIRECT 0x03 /* RGB525_PLL_CTRL_1 */ #define REF_SRC_REFCLK 0x0 #define REF_SRC_EXTCLK 0x10 #define PLL_EXT_FS_3_0 0x0 #define PLL_EXT_FS_2_0 0x01 #define PLL_CNTL2_3_0 0x02 #define PLL_CNTL2_2_0 0x03 /* RGB525_PLL_CTRL_2 */ #define PLL_INT_FS_3_0(n) (n) #define PLL_INT_FS_2_0(n) (n) /* RGB525_PLL_REF_DIV_COUNT */ #define REF_DIV_COUNT(n) (n) /* RGB525_F0 - RGB525_F15 */ #define VCO_DIV_COUNT(n) (n) /* RGB525_PLL_REFCLK values */ #define RGB525_PLL_REFCLK_MHz(n) ((n)/2) /* RGB525_CURSOR_CONTROL */ #define SMLC_PART_0 0x0 #define SMLC_PART_1 0x40 #define SMLC_PART_2 0x80 #define SMLC_PART_3 0xC0 #define PIX_ORDER_RL 0x0 #define PIX_ORDER_LR 0x20 #define LOC_READ_LAST 0x0 #define LOC_READ_ACTUAL 0x10 #define UPDT_CNTL_DELAYED 0x0 #define UPDT_CNTL_IMMEDIATE 0x08 #define CURSOR_SIZE_32 0x0 #define CURSOR_SIZE_64 0x40 #define CURSOR_MODE_OFF 0x0 #define CURSOR_MODE_3_COLOR 0x01 #define CURSOR_MODE_2_COLOR_HL 0x02 #define CURSOR_MODE_2_COLOR 0x03 /* RGB525_REVISION_LEVEL */ #define REVISION_LEVEL 0xF0 /* predefined */ /* RGB525_ID */ #define ID_CODE 0x01 /* predefined */ /* MISR status */ #define RGB525_MISR_DONE 0x01 /* the IBMRGB640 is rather different from the rest of the RAMDACs, so we define a completely new set of register names for it */ #define RGB640_SER_07_00 0x02 #define RGB640_SER_15_08 0x03 #define RGB640_SER_23_16 0x04 #define RGB640_SER_31_24 0x05 #define RGB640_SER_WID_03_00 0x06 #define RGB640_SER_WID_07_04 0x07 #define RGB640_SER_MODE 0x08 #define IBM640_SER_2_1 0x00 #define IBM640_SER_4_1 0x01 #define IBM640_SER_8_1 0x02 #define IBM640_SER_16_1 0x03 #define IBM640_SER_16_3 0x05 #define IBM640_SER_5_1 0x06 #define RGB640_PIXEL_INTERLEAVE 0x09 #define RGB640_MISC_CONF 0x0a #define IBM640_PCLK 0x00 #define IBM640_PCLK_2 0x40 #define IBM640_PCLK_4 0x80 #define IBM640_PCLK_8 0xc0 #define IBM640_PSIZE10 0x10 #define IBM640_LCI 0x08 #define IBM640_WIDCTL_MASK 0x07 #define RGB640_VGA_CONTROL 0x0b #define IBM640_RDBK 0x04 #define IBM640_PSIZE8 0x02 #define IBM640_VRAM 0x01 #define RGB640_DAC_CONTROL 0x0d #define IBM640_MONO 0x08 #define IBM640_DACENBL 0x04 #define IBM640_SHUNT 0x02 #define IBM640_SLOWSLEW 0x01 #define RGB640_OUTPUT_CONTROL 0x0e #define IBM640_RDAI 0x04 #define IBM640_WDAI 0x02 #define IBM640_WATCTL 0x01 #define RGB640_SYNC_CONTROL 0x0f #define IBM640_PWR 0x20 #define IBM640_VSP 0x10 #define IBM640_HSP 0x08 #define IBM640_CSE 0x04 #define IBM640_CSG 0x02 #define IBM640_BPE 0x01 #define RGB640_PLL_N 0x10 #define RGB640_PLL_M 0x11 #define RGB640_PLL_P 0x12 #define RGB640_PLL_CTL 0x13 #define IBM640_PLL_EN 0x04 #define IBM640_PLL_HIGH 0x10 #define IBM640_PLL_LOW 0x01 #define RGB640_AUX_PLL_CTL 0x17 #define IBM640_AUXPLL 0x04 #define IBM640_AUX_HI 0x02 #define IBM640_AUX_LO 0x01 #define RGB640_CHROMA_KEY0 0x20 #define RGB640_CHROMA_MASK0 0x21 #define RGB640_CURS_X_LOW 0x40 #define RGB640_CURS_X_HIGH 0x41 #define RGB640_CURS_Y_LOW 0x42 #define RGB640_CURS_Y_HIGH 0x43 #define RGB640_CURS_OFFSETX 0x44 #define RGB640_CURS_OFFSETY 0x45 #define RGB640_CURSOR_CONTROL 0x4B #define IBM640_CURS_OFF 0x00 #define IBM640_CURS_MODE0 0x01 #define IBM640_CURS_MODE1 0x02 #define IBM640_CURS_MODE2 0x03 #define IBM640_CURS_ADV 0x04 #define RGB640_CROSSHAIR_CONTROL 0x57 #define RGB640_VRAM_MASK0 0xf0 #define RGB640_VRAM_MASK1 0xf1 #define RGB640_VRAM_MASK2 0xf2 #define RGB640_DIAGS 0xfa #define RGB640_CURS_WRITE 0x1000 #define RGB640_CURS_COL0 0x4800 #define RGB640_CURS_COL1 0x4801 #define RGB640_CURS_COL2 0x4802 #define RGB640_CURS_COL3 0x4803 xorg-server-1.17.1/hw/xfree86/ramdac/xf86HWCurs.c0000664000175100017510000003707712456571574016236 00000000000000 #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 "cursorstr.h" #include "mi.h" #include "mipointer.h" #include "xf86CursorPriv.h" #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 /* Cursors might be only 32 wide. Give'em a chance */ #define SCANLINE CARD32 #define CUR_BITMAP_SCANLINE_PAD 32 #define CUR_LOG2_BITMAP_PAD 5 #define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w) #else #define SCANLINE CARD64 #define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD #define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD #define REVERSE_BIT_ORDER(w) xf86CARD64ReverseBits(w) static CARD64 xf86CARD64ReverseBits(CARD64 w); static CARD64 xf86CARD64ReverseBits(CARD64 w) { unsigned char *p = (unsigned char *) &w; p[0] = byte_reversed[p[0]]; p[1] = byte_reversed[p[1]]; p[2] = byte_reversed[p[2]]; p[3] = byte_reversed[p[3]]; p[4] = byte_reversed[p[4]]; p[5] = byte_reversed[p[5]]; p[6] = byte_reversed[p[6]]; p[7] = byte_reversed[p[7]]; return w; } #endif #else #define SCANLINE CARD32 #define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD #define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD #define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w) #endif /* BITMAP_SCANLINE_PAD == 64 */ static unsigned char *RealizeCursorInterleave0(xf86CursorInfoPtr, CursorPtr); static unsigned char *RealizeCursorInterleave1(xf86CursorInfoPtr, CursorPtr); static unsigned char *RealizeCursorInterleave8(xf86CursorInfoPtr, CursorPtr); static unsigned char *RealizeCursorInterleave16(xf86CursorInfoPtr, CursorPtr); static unsigned char *RealizeCursorInterleave32(xf86CursorInfoPtr, CursorPtr); static unsigned char *RealizeCursorInterleave64(xf86CursorInfoPtr, CursorPtr); Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) { if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0)) return FALSE; /* These are required for now */ if (!infoPtr->SetCursorPosition || !xf86DriverHasLoadCursorImage(infoPtr) || !infoPtr->HideCursor || !infoPtr->ShowCursor || !infoPtr->SetCursorColors) return FALSE; if (infoPtr->RealizeCursor) { /* Don't overwrite a driver provided Realize Cursor function */ } else if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 & infoPtr->Flags) { infoPtr->RealizeCursor = RealizeCursorInterleave1; } else if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 & infoPtr->Flags) { infoPtr->RealizeCursor = RealizeCursorInterleave8; } else if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 & infoPtr->Flags) { infoPtr->RealizeCursor = RealizeCursorInterleave16; } else if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 & infoPtr->Flags) { infoPtr->RealizeCursor = RealizeCursorInterleave32; } else if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 & infoPtr->Flags) { infoPtr->RealizeCursor = RealizeCursorInterleave64; } else { /* not interleaved */ infoPtr->RealizeCursor = RealizeCursorInterleave0; } infoPtr->pScrn = xf86ScreenToScrn(pScreen); return TRUE; } Bool xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; unsigned char *bits; if (pCurs == NullCursor) { (*infoPtr->HideCursor) (infoPtr->pScrn); return TRUE; } bits = dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen); x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX; y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY; #ifdef ARGB_CURSOR if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr)) #endif if (!bits) { bits = (*infoPtr->RealizeCursor) (infoPtr, pCurs); dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, bits); } if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) (*infoPtr->HideCursor) (infoPtr->pScrn); #ifdef ARGB_CURSOR if (pCurs->bits->argb && xf86DriverHasLoadCursorARGB(infoPtr)) { if (!xf86DriverLoadCursorARGB (infoPtr, pCurs)) return FALSE; } else #endif if (bits) if (!xf86DriverLoadCursorImage (infoPtr, bits)) return FALSE; xf86RecolorCursor(pScreen, pCurs, 1); (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); (*infoPtr->ShowCursor) (infoPtr->pScrn); return TRUE; } void xf86SetTransparentCursor(ScreenPtr pScreen) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; if (!ScreenPriv->transparentData) ScreenPriv->transparentData = (*infoPtr->RealizeCursor) (infoPtr, NullCursor); if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) (*infoPtr->HideCursor) (infoPtr->pScrn); if (ScreenPriv->transparentData) xf86DriverLoadCursorImage (infoPtr, ScreenPriv->transparentData); (*infoPtr->ShowCursor) (infoPtr->pScrn); } void xf86MoveCursor(ScreenPtr pScreen, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX; y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY; (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); } void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; #ifdef ARGB_CURSOR /* recoloring isn't applicable to ARGB cursors and drivers shouldn't have to ignore SetCursorColors requests */ if (pCurs->bits->argb) return; #endif if (ScreenPriv->PalettedCursor) { xColorItem sourceColor, maskColor; ColormapPtr pmap = ScreenPriv->pInstalledMap; if (!pmap) return; sourceColor.red = pCurs->foreRed; sourceColor.green = pCurs->foreGreen; sourceColor.blue = pCurs->foreBlue; FakeAllocColor(pmap, &sourceColor); maskColor.red = pCurs->backRed; maskColor.green = pCurs->backGreen; maskColor.blue = pCurs->backBlue; FakeAllocColor(pmap, &maskColor); FakeFreeColor(pmap, sourceColor.pixel); FakeFreeColor(pmap, maskColor.pixel); (*infoPtr->SetCursorColors) (infoPtr->pScrn, maskColor.pixel, sourceColor.pixel); } else { /* Pass colors in 8-8-8 RGB format */ (*infoPtr->SetCursorColors) (infoPtr->pScrn, (pCurs->backBlue >> 8) | ((pCurs->backGreen >> 8) << 8) | ((pCurs->backRed >> 8) << 16), (pCurs->foreBlue >> 8) | ((pCurs->foreGreen >> 8) << 8) | ((pCurs->foreRed >> 8) << 16) ); } } /* These functions assume that MaxWidth is a multiple of 32 */ static unsigned char * RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) { SCANLINE *SrcS, *SrcM, *DstS, *DstM; SCANLINE *pSrc, *pMsk; unsigned char *mem; int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2; int SrcPitch, DstPitch, Pitch, y, x; /* how many words are in the source or mask */ int words = size / (CUR_BITMAP_SCANLINE_PAD / 4); if (!(mem = calloc(1, size))) return NULL; if (pCurs == NullCursor) { if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) { DstM = (SCANLINE *) mem; if (!(infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK)) DstM += words; memset(DstM, -1, words * sizeof(SCANLINE)); } return mem; } /* SrcPitch == the number of scanlines wide the cursor image is */ SrcPitch = (pCurs->bits->width + (BITMAP_SCANLINE_PAD - 1)) >> CUR_LOG2_BITMAP_PAD; /* DstPitch is the width of the hw cursor in scanlines */ DstPitch = infoPtr->MaxWidth >> CUR_LOG2_BITMAP_PAD; Pitch = SrcPitch < DstPitch ? SrcPitch : DstPitch; SrcS = (SCANLINE *) pCurs->bits->source; SrcM = (SCANLINE *) pCurs->bits->mask; DstS = (SCANLINE *) mem; DstM = DstS + words; if (infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) { SCANLINE *tmp; tmp = DstS; DstS = DstM; DstM = tmp; } if (infoPtr->Flags & HARDWARE_CURSOR_AND_SOURCE_WITH_MASK) { for (y = pCurs->bits->height, pSrc = DstS, pMsk = DstM; y--; pSrc += DstPitch, pMsk += DstPitch, SrcS += SrcPitch, SrcM += SrcPitch) { for (x = 0; x < Pitch; x++) { pSrc[x] = SrcS[x] & SrcM[x]; pMsk[x] = SrcM[x]; } } } else { for (y = pCurs->bits->height, pSrc = DstS, pMsk = DstM; y--; pSrc += DstPitch, pMsk += DstPitch, SrcS += SrcPitch, SrcM += SrcPitch) { for (x = 0; x < Pitch; x++) { pSrc[x] = SrcS[x]; pMsk[x] = SrcM[x]; } } } if (infoPtr->Flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) { int count = size; unsigned char *pntr1 = (unsigned char *) DstS; unsigned char *pntr2 = (unsigned char *) DstM; unsigned char a, b; while (count) { a = *pntr1; b = *pntr2; *pntr1 = ((a & 0xF0) >> 4) | ((a & 0x0F) << 4); *pntr2 = ((b & 0xF0) >> 4) | ((b & 0x0F) << 4); pntr1++; pntr2++; count -= 2; } } /* * Must be _after_ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK to avoid wiping * out entire source mask. */ if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) { int count = words; SCANLINE *pntr = DstM; while (count--) { *pntr = ~(*pntr); pntr++; } } if (infoPtr->Flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) { for (y = pCurs->bits->height, pSrc = DstS, pMsk = DstM; y--; pSrc += DstPitch, pMsk += DstPitch) { for (x = 0; x < Pitch; x++) { pSrc[x] = REVERSE_BIT_ORDER(pSrc[x]); pMsk[x] = REVERSE_BIT_ORDER(pMsk[x]); } } } return mem; } static unsigned char * RealizeCursorInterleave1(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) { unsigned char *DstS, *DstM; unsigned char *pntr; unsigned char *mem, *mem2; int count; int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2; /* Realize the cursor without interleaving */ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; if (!(mem = calloc(1, size))) { free(mem2); return NULL; } /* 1 bit interleave */ DstS = mem2; DstM = DstS + (size >> 1); pntr = mem; count = size; while (count) { *pntr++ = ((*DstS & 0x01)) | ((*DstM & 0x01) << 1) | ((*DstS & 0x02) << 1) | ((*DstM & 0x02) << 2) | ((*DstS & 0x04) << 2) | ((*DstM & 0x04) << 3) | ((*DstS & 0x08) << 3) | ((*DstM & 0x08) << 4); *pntr++ = ((*DstS & 0x10) >> 4) | ((*DstM & 0x10) >> 3) | ((*DstS & 0x20) >> 3) | ((*DstM & 0x20) >> 2) | ((*DstS & 0x40) >> 2) | ((*DstM & 0x40) >> 1) | ((*DstS & 0x80) >> 1) | ((*DstM & 0x80)); DstS++; DstM++; count -= 2; } /* Free the uninterleaved cursor */ free(mem2); return mem; } static unsigned char * RealizeCursorInterleave8(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) { unsigned char *DstS, *DstM; unsigned char *pntr; unsigned char *mem, *mem2; int count; int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2; /* Realize the cursor without interleaving */ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; if (!(mem = calloc(1, size))) { free(mem2); return NULL; } /* 8 bit interleave */ DstS = mem2; DstM = DstS + (size >> 1); pntr = mem; count = size; while (count) { *pntr++ = *DstS++; *pntr++ = *DstM++; count -= 2; } /* Free the uninterleaved cursor */ free(mem2); return mem; } static unsigned char * RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) { unsigned short *DstS, *DstM; unsigned short *pntr; unsigned char *mem, *mem2; int count; int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2; /* Realize the cursor without interleaving */ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; if (!(mem = calloc(1, size))) { free(mem2); return NULL; } /* 16 bit interleave */ DstS = (void *) mem2; DstM = DstS + (size >> 2); pntr = (void *) mem; count = (size >> 1); while (count) { *pntr++ = *DstS++; *pntr++ = *DstM++; count -= 2; } /* Free the uninterleaved cursor */ free(mem2); return mem; } static unsigned char * RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) { CARD32 *DstS, *DstM; CARD32 *pntr; unsigned char *mem, *mem2; int count; int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2; /* Realize the cursor without interleaving */ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; if (!(mem = calloc(1, size))) { free(mem2); return NULL; } /* 32 bit interleave */ DstS = (void *) mem2; DstM = DstS + (size >> 3); pntr = (void *) mem; count = (size >> 2); while (count) { *pntr++ = *DstS++; *pntr++ = *DstM++; count -= 2; } /* Free the uninterleaved cursor */ free(mem2); return mem; } static unsigned char * RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) { CARD32 *DstS, *DstM; CARD32 *pntr; unsigned char *mem, *mem2; int count; int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2; /* Realize the cursor without interleaving */ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs))) return NULL; if (!(mem = calloc(1, size))) { free(mem2); return NULL; } /* 64 bit interleave */ DstS = (void *) mem2; DstM = DstS + (size >> 3); pntr = (void *) mem; count = (size >> 2); while (count) { *pntr++ = *DstS++; *pntr++ = *DstS++; *pntr++ = *DstM++; *pntr++ = *DstM++; count -= 4; } /* Free the uninterleaved cursor */ free(mem2); return mem; } xorg-server-1.17.1/hw/xfree86/ramdac/xf86RamDacCmap.c0000664000175100017510000000474212366751547017004 00000000000000/* * Copyright 1998 by Alan Hourihane, Wigan, England. * * 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 Alan Hourihane not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Alan Hourihane makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL ALAN HOURIHANE 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: Alan Hourihane, * * Generic RAMDAC access to colormaps. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "windowstr.h" #include "mipointer.h" #include "micmap.h" #include "xf86.h" #include "colormapst.h" #include "xf86RamDacPriv.h" void RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { RamDacRecPtr hwp = RAMDACSCRPTR(pScrn); int i, index; for (i = 0; i < numColors; i++) { index = indices[i]; (*hwp->WriteAddress) (pScrn, index); (*hwp->WriteData) (pScrn, colors[index].red); (*hwp->WriteData) (pScrn, colors[index].green); (*hwp->WriteData) (pScrn, colors[index].blue); } } Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits, unsigned int flags) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); RamDacRecPtr hwp = RAMDACSCRPTR(pScrn); if (hwp->LoadPalette == NULL) return xf86HandleColormaps(pScreen, maxColors, sigRGBbits, RamDacLoadPalette, NULL, flags); else return xf86HandleColormaps(pScreen, maxColors, sigRGBbits, hwp->LoadPalette, NULL, flags); } xorg-server-1.17.1/hw/xfree86/ramdac/BTPriv.h0000664000175100017510000000051112274325511015463 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include "BT.h" typedef struct { const char *DeviceName; } xf86BTramdacInfo; extern xf86BTramdacInfo BTramdacDeviceInfo[]; #ifdef INIT_BT_RAMDAC_INFO xf86BTramdacInfo BTramdacDeviceInfo[] = { {"AT&T 20C504"}, {"AT&T 20C505"}, {"BT485/484"} }; #endif xorg-server-1.17.1/hw/xfree86/ramdac/xf86RamDac.h0000664000175100017510000000560012456571574016202 00000000000000 #ifndef _XF86RAMDAC_H #define _XF86RAMDAC_H 1 #include "colormapst.h" #include "xf86Cursor.h" /* Define unique vendor codes for RAMDAC's */ #define VENDOR_IBM 0x0000 #define VENDOR_BT 0x0001 #define VENDOR_TI 0x0002 typedef struct _RamDacRegRec { /* This is probably the nastiest assumption, we allocate 1024 slots for * ramdac registers, should be enough. I've checked IBM and TVP series * and they seem o.k * Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME */ unsigned short DacRegs[0x400]; /* register set */ unsigned char DAC[0x300]; /* colour map */ Bool Overlay; } RamDacRegRec, *RamDacRegRecPtr; typedef struct _RamDacHWRegRec { RamDacRegRec SavedReg; RamDacRegRec ModeReg; } RamDacHWRec, *RamDacHWRecPtr; typedef struct _RamDacRec { CARD32 RamDacType; void (*LoadPalette) (ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual); unsigned char (*ReadDAC) (ScrnInfoPtr pScrn, CARD32); void (*WriteDAC) (ScrnInfoPtr pScrn, CARD32, unsigned char, unsigned char); void (*WriteAddress) (ScrnInfoPtr pScrn, CARD32); void (*WriteData) (ScrnInfoPtr pScrn, unsigned char); void (*ReadAddress) (ScrnInfoPtr pScrn, CARD32); unsigned char (*ReadData) (ScrnInfoPtr pScrn); } RamDacRec, *RamDacRecPtr; typedef struct _RamDacHelperRec { CARD32 RamDacType; void (*Restore) (ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg); void (*Save) (ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg); void (*SetBpp) (ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg); void (*HWCursorInit) (xf86CursorInfoPtr infoPtr); } RamDacHelperRec, *RamDacHelperRecPtr; #define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr)) typedef struct _RamdacScreenRec { RamDacRecPtr RamDacRec; } RamDacScreenRec, *RamDacScreenRecPtr; #define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec extern _X_EXPORT int RamDacHWPrivateIndex; extern _X_EXPORT int RamDacScreenPrivateIndex; typedef struct { int token; } RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr; extern _X_EXPORT RamDacRecPtr RamDacCreateInfoRec(void); extern _X_EXPORT RamDacHelperRecPtr RamDacHelperCreateInfoRec(void); extern _X_EXPORT void RamDacDestroyInfoRec(RamDacRecPtr RamDacRec); extern _X_EXPORT void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr RamDacRec); extern _X_EXPORT Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec); extern _X_EXPORT Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits, unsigned int flags); extern _X_EXPORT void RamDacFreeRec(ScrnInfoPtr pScrn); extern _X_EXPORT int RamDacGetHWIndex(void); #endif /* _XF86RAMDAC_H */ xorg-server-1.17.1/hw/xfree86/ramdac/IBMPriv.h0000664000175100017510000000073712274325511015577 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include "IBM.h" typedef struct { const char *DeviceName; } xf86IBMramdacInfo; extern xf86IBMramdacInfo IBMramdacDeviceInfo[]; #ifdef INIT_IBM_RAMDAC_INFO xf86IBMramdacInfo IBMramdacDeviceInfo[] = { {"IBM 524"}, {"IBM 524A"}, {"IBM 525"}, {"IBM 526"}, {"IBM 526DB(DoubleBuffer)"}, {"IBM 528"}, {"IBM 528A"}, {"IBM 624"}, {"IBM 624DB(DoubleBuffer)"}, {"IBM 640"} }; #endif xorg-server-1.17.1/hw/xfree86/ramdac/TI.c0000664000175100017510000006503412456571574014655 00000000000000/* * Copyright 1998 by Alan Hourihane, Wigan, England. * * 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 Alan Hourihane not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Alan Hourihane makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL ALAN HOURIHANE 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: Alan Hourihane, * * Modified from IBM.c to support TI RAMDAC routines * by Jens Owen, . */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Cursor.h" #define INIT_TI_RAMDAC_INFO #include "TIPriv.h" #include "xf86RamDacPriv.h" /* The following values are in kHz */ #define TI_MIN_VCO_FREQ 110000 #define TI_MAX_VCO_FREQ 220000 unsigned long TIramdacCalculateMNPForClock(unsigned long RefClock, /* In 100Hz units */ unsigned long ReqClock, /* In 100Hz units */ char IsPixClock, /* boolean, is this the pixel or the sys clock */ unsigned long MinClock, /* Min VCO rating */ unsigned long MaxClock, /* Max VCO rating */ unsigned long *rM, /* M Out */ unsigned long *rN, /* N Out */ unsigned long *rP /* Min P In, P Out */ ) { unsigned long n, p; unsigned long best_m = 0, best_n = 0; double VCO, IntRef = (double) RefClock; double m_err, inc_m, calc_m; unsigned long ActualClock; /* Make sure that MinClock <= ReqClock <= MaxClock */ if (ReqClock < MinClock) ReqClock = MinClock; if (ReqClock > MaxClock) ReqClock = MaxClock; /* * ActualClock = VCO / 2 ^ p * Choose p so that TI_MIN_VCO_FREQ <= VCO <= TI_MAX_VCO_FREQ * Note that since TI_MAX_VCO_FREQ = 2 * TI_MIN_VCO_FREQ * we don't have to bother checking for this maximum limit. */ VCO = (double) ReqClock; for (p = 0; p < 3 && VCO < TI_MIN_VCO_FREQ; (p)++) VCO *= 2.0; /* * We avoid doing multiplications by ( 65 - n ), * and add an increment instead - this keeps any error small. */ inc_m = VCO / (IntRef * 8.0); /* Initial value of calc_m for the loop */ calc_m = inc_m + inc_m + inc_m; /* Initial amount of error for an integer - impossibly large */ m_err = 2.0; /* Search for the closest INTEGER value of ( 65 - m ) */ for (n = 3; n <= 25; (n)++, calc_m += inc_m) { /* Ignore values of ( 65 - m ) which we can't use */ if (calc_m < 3.0 || calc_m > 64.0) continue; /* * Pick the closest INTEGER (has smallest fractional part). * The optimizer should clean this up for us. */ if ((calc_m - (int) calc_m) < m_err) { m_err = calc_m - (int) calc_m; best_m = (int) calc_m; best_n = n; } } /* 65 - ( 65 - x ) = x */ *rM = 65 - best_m; *rN = 65 - best_n; *rP = p; /* Now all the calculations can be completed */ VCO = 8.0 * IntRef * best_m / best_n; ActualClock = VCO / (1 << p); DebugF("f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n", ActualClock, VCO, *rN, *rM, *rP); return ActualClock; } void TIramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg) { int i; unsigned long status; /* Here we pass a short, so that we can evaluate a mask too * So that the mask is the high byte and the data the low byte * Order is important */ TIRESTORE(TIDAC_latch_ctrl); TIRESTORE(TIDAC_true_color_ctrl); TIRESTORE(TIDAC_multiplex_ctrl); TIRESTORE(TIDAC_clock_select); TIRESTORE(TIDAC_palette_page); TIRESTORE(TIDAC_general_ctrl); TIRESTORE(TIDAC_misc_ctrl); /* 0x2A & 0x2B are reserved */ TIRESTORE(TIDAC_key_over_low); TIRESTORE(TIDAC_key_over_high); TIRESTORE(TIDAC_key_red_low); TIRESTORE(TIDAC_key_red_high); TIRESTORE(TIDAC_key_green_low); TIRESTORE(TIDAC_key_green_high); TIRESTORE(TIDAC_key_blue_low); TIRESTORE(TIDAC_key_blue_high); TIRESTORE(TIDAC_key_ctrl); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_clock_ctrl, 0, 0x30); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_clock_ctrl, 0, 0x38); TIRESTORE(TIDAC_clock_ctrl); TIRESTORE(TIDAC_sense_test); TIRESTORE(TIDAC_ind_curs_ctrl); /* only restore clocks if they were valid to begin with */ if (ramdacReg->DacRegs[TIDAC_PIXEL_VALID]) { /* Reset pixel clock */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0x22); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_pixel_data, 0, 0x3c); /* Restore N, M & P values for pixel clocks */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_pixel_data, 0, ramdacReg->DacRegs[TIDAC_PIXEL_N]); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_pixel_data, 0, ramdacReg->DacRegs[TIDAC_PIXEL_M]); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_pixel_data, 0, ramdacReg->DacRegs[TIDAC_PIXEL_P]); /* wait for pixel clock to lock */ i = 1000000; do { status = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_pixel_data); } while ((!(status & 0x40)) && (--i)); if (!(status & 0x40)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Pixel clock setup timed out\n"); return; } } if (ramdacReg->DacRegs[TIDAC_LOOP_VALID]) { /* Reset loop clock */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0x22); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_loop_data, 0, 0x70); /* Restore N, M & P values for pixel clocks */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_loop_data, 0, ramdacReg->DacRegs[TIDAC_LOOP_N]); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_loop_data, 0, ramdacReg->DacRegs[TIDAC_LOOP_M]); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_loop_data, 0, ramdacReg->DacRegs[TIDAC_LOOP_P]); /* wait for loop clock to lock */ i = 1000000; do { status = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_loop_data); } while ((!(status & 0x40)) && (--i)); if (!(status & 0x40)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Loop clock setup timed out\n"); return; } } /* restore palette */ (*ramdacPtr->WriteAddress) (pScrn, 0); #ifndef NOT_DONE for (i = 0; i < 768; i++) (*ramdacPtr->WriteData) (pScrn, ramdacReg->DAC[i]); #else (*ramdacPtr->WriteData) (pScrn, 0); (*ramdacPtr->WriteData) (pScrn, 0); (*ramdacPtr->WriteData) (pScrn, 0); for (i = 0; i < 765; i++) (*ramdacPtr->WriteData) (pScrn, 0xff); #endif } void TIramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg) { int i; (*ramdacPtr->ReadAddress) (pScrn, 0); for (i = 0; i < 768; i++) ramdacReg->DAC[i] = (*ramdacPtr->ReadData) (pScrn); /* Read back N,M and P values for pixel clock */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0); ramdacReg->DacRegs[TIDAC_PIXEL_N] = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_pixel_data); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0x11); ramdacReg->DacRegs[TIDAC_PIXEL_M] = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_pixel_data); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0x22); ramdacReg->DacRegs[TIDAC_PIXEL_P] = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_pixel_data); /* Read back N,M and P values for loop clock */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0); ramdacReg->DacRegs[TIDAC_LOOP_N] = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_loop_data); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0x11); ramdacReg->DacRegs[TIDAC_LOOP_M] = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_loop_data); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_pll_addr, 0, 0x22); ramdacReg->DacRegs[TIDAC_LOOP_P] = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_pll_loop_data); /* Order is important */ TISAVE(TIDAC_latch_ctrl); TISAVE(TIDAC_true_color_ctrl); TISAVE(TIDAC_multiplex_ctrl); TISAVE(TIDAC_clock_select); TISAVE(TIDAC_palette_page); TISAVE(TIDAC_general_ctrl); TISAVE(TIDAC_misc_ctrl); /* 0x2A & 0x2B are reserved */ TISAVE(TIDAC_key_over_low); TISAVE(TIDAC_key_over_high); TISAVE(TIDAC_key_red_low); TISAVE(TIDAC_key_red_high); TISAVE(TIDAC_key_green_low); TISAVE(TIDAC_key_green_high); TISAVE(TIDAC_key_blue_low); TISAVE(TIDAC_key_blue_high); TISAVE(TIDAC_key_ctrl); TISAVE(TIDAC_clock_ctrl); TISAVE(TIDAC_sense_test); TISAVE(TIDAC_ind_curs_ctrl); } RamDacHelperRecPtr TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); RamDacHelperRecPtr ramdacHelperPtr = NULL; Bool RamDacIsSupported = FALSE; int TIramdac_ID = -1; int i; unsigned char id, rev, rev2, id2; /* read ID and revision */ rev = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_rev); id = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_id); /* check if ID and revision are read only */ (*ramdacPtr->WriteDAC) (pScrn, ~rev, 0, TIDAC_rev); (*ramdacPtr->WriteDAC) (pScrn, ~id, 0, TIDAC_id); rev2 = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_rev); id2 = (*ramdacPtr->ReadDAC) (pScrn, TIDAC_id); switch (id) { case TIDAC_TVP_3030_ID: if (id == id2 && rev == rev2) /* check for READ ONLY */ TIramdac_ID = TI3030_RAMDAC; break; case TIDAC_TVP_3026_ID: if (id == id2 && rev == rev2) /* check for READ ONLY */ TIramdac_ID = TI3026_RAMDAC; break; } (*ramdacPtr->WriteDAC) (pScrn, rev, 0, TIDAC_rev); (*ramdacPtr->WriteDAC) (pScrn, id, 0, TIDAC_id); if (TIramdac_ID == -1) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Cannot determine TI RAMDAC type, aborting\n"); return NULL; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Attached RAMDAC is %s\n", TIramdacDeviceInfo[TIramdac_ID & 0xFFFF].DeviceName); } for (i = 0; ramdacs[i].token != -1; i++) { if (ramdacs[i].token == TIramdac_ID) RamDacIsSupported = TRUE; } if (!RamDacIsSupported) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "This TI RAMDAC is NOT supported by this driver, aborting\n"); return NULL; } ramdacHelperPtr = RamDacHelperCreateInfoRec(); switch (TIramdac_ID) { case TI3030_RAMDAC: ramdacHelperPtr->SetBpp = TIramdac3030SetBpp; ramdacHelperPtr->HWCursorInit = TIramdacHWCursorInit; break; case TI3026_RAMDAC: ramdacHelperPtr->SetBpp = TIramdac3026SetBpp; ramdacHelperPtr->HWCursorInit = TIramdacHWCursorInit; break; } ramdacPtr->RamDacType = TIramdac_ID; ramdacHelperPtr->RamDacType = TIramdac_ID; ramdacHelperPtr->Save = TIramdacSave; ramdacHelperPtr->Restore = TIramdacRestore; return ramdacHelperPtr; } void TIramdac3026SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg) { switch (pScrn->bitsPerPixel) { case 32: /* order is important */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x46; ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x5c; ramdacReg->DacRegs[TIDAC_clock_select] = 0x05; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) { ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x01; } ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; case 24: /* order is important */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x56; ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x58; ramdacReg->DacRegs[TIDAC_clock_select] = 0x25; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; case 16: /* order is important */ #if 0 /* Matrox driver uses this */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x07; #else ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; #endif if (pScrn->depth == 16) { ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x45; } else { ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x44; } #if 0 /* Matrox driver uses this */ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x50; ramdacReg->DacRegs[TIDAC_clock_select] = 0x15; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00; #else ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x54; ramdacReg->DacRegs[TIDAC_clock_select] = 0x05; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10; #endif ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; case 8: /* order is important */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x80; ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x4c; ramdacReg->DacRegs[TIDAC_clock_select] = 0x05; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x1C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0x00; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x00; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; } } void TIramdac3030SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg) { switch (pScrn->bitsPerPixel) { case 32: /* order is important */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x46; ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x5D; ramdacReg->DacRegs[TIDAC_clock_select] = 0x05; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) { ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x01; } ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; case 24: /* order is important */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x56; ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x58; ramdacReg->DacRegs[TIDAC_clock_select] = 0x25; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; case 16: /* order is important */ #if 0 /* Matrox driver uses this */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x07; #else ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; #endif if (pScrn->depth == 16) { ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x45; } else { ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x44; } #if 0 /* Matrox driver uses this */ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x50; ramdacReg->DacRegs[TIDAC_clock_select] = 0x15; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00; #else ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x55; ramdacReg->DacRegs[TIDAC_clock_select] = 0x85; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10; #endif ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; case 8: /* order is important */ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06; ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x80; ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x4d; ramdacReg->DacRegs[TIDAC_clock_select] = 0x05; ramdacReg->DacRegs[TIDAC_palette_page] = 0x00; ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10; ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x1C; /* 0x2A & 0x2B are reserved */ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF; ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF; ramdacReg->DacRegs[TIDAC_key_blue_low] = 0x00; ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00; ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x00; ramdacReg->DacRegs[TIDAC_sense_test] = 0x00; ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00; break; } } static void TIramdacShowCursor(ScrnInfoPtr pScrn) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); /* Enable cursor - X11 mode */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_ind_curs_ctrl, 0, 0x03); } static void TIramdacHideCursor(ScrnInfoPtr pScrn) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); /* Disable cursor - X11 mode */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_ind_curs_ctrl, 0, 0x00); } static void TIramdacSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); x += 64; y += 64; (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_XLOW, 0, x & 0xff); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_XHIGH, 0, (x >> 8) & 0x0f); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_YLOW, 0, y & 0xff); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_YHIGH, 0, (y >> 8) & 0x0f); } static void TIramdacSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); /* Background color */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_WRITE_ADDR, 0, 1); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_COLOR, 0, ((bg & 0x00ff0000) >> 16)); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_COLOR, 0, ((bg & 0x0000ff00) >> 8)); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_COLOR, 0, (bg & 0x000000ff)); /* Foreground color */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_WRITE_ADDR, 0, 2); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_COLOR, 0, ((fg & 0x00ff0000) >> 16)); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_COLOR, 0, ((fg & 0x0000ff00) >> 8)); (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_COLOR, 0, (fg & 0x000000ff)); } static Bool TIramdacLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); int i = 1024; /* reset A9,A8 */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_ind_curs_ctrl, 0, 0x00); /* reset cursor RAM load address A7..A0 */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_INDEX, 0x00, 0x00); while (i--) { /* NOT_DONE: might need a delay here */ (*ramdacPtr->WriteDAC) (pScrn, TIDAC_CURS_RAM_DATA, 0, *(src++)); } return TRUE; } static Bool TIramdacUseHWCursor(ScreenPtr pScr, CursorPtr pCurs) { return TRUE; } void TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr) { infoPtr->MaxWidth = 64; infoPtr->MaxHeight = 64; infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED; infoPtr->SetCursorColors = TIramdacSetCursorColors; infoPtr->SetCursorPosition = TIramdacSetCursorPosition; infoPtr->LoadCursorImageCheck = TIramdacLoadCursorImage; infoPtr->HideCursor = TIramdacHideCursor; infoPtr->ShowCursor = TIramdacShowCursor; infoPtr->UseHWCursor = TIramdacUseHWCursor; } void TIramdacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { RamDacRecPtr hwp = RAMDACSCRPTR(pScrn); int i, index, shift; if (pScrn->depth == 16) { for (i = 0; i < numColors; i++) { index = indices[i]; (*hwp->WriteAddress) (pScrn, index << 2); (*hwp->WriteData) (pScrn, colors[index >> 1].red); (*hwp->WriteData) (pScrn, colors[index].green); (*hwp->WriteData) (pScrn, colors[index >> 1].blue); if (index <= 31) { (*hwp->WriteAddress) (pScrn, index << 3); (*hwp->WriteData) (pScrn, colors[index].red); (*hwp->WriteData) (pScrn, colors[(index << 1) + 1].green); (*hwp->WriteData) (pScrn, colors[index].blue); } } } else { shift = (pScrn->depth == 15) ? 3 : 0; for (i = 0; i < numColors; i++) { index = indices[i]; (*hwp->WriteAddress) (pScrn, index << shift); (*hwp->WriteData) (pScrn, colors[index].red); (*hwp->WriteData) (pScrn, colors[index].green); (*hwp->WriteData) (pScrn, colors[index].blue); } } } TIramdacLoadPaletteProc * TIramdacLoadPaletteWeak(void) { return TIramdacLoadPalette; } xorg-server-1.17.1/hw/xfree86/ramdac/TI.h0000664000175100017510000001013612274325511014635 00000000000000 #include extern _X_EXPORT unsigned long TIramdacCalculateMNPForClock(unsigned long RefClock, unsigned long ReqClock, char IsPixClock, unsigned long MinClock, unsigned long MaxClock, unsigned long *rM, unsigned long *rN, unsigned long *rP); extern _X_EXPORT RamDacHelperRecPtr TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs); extern _X_EXPORT void TIramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void TIramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void TIramdac3026SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void TIramdac3030SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr); extern _X_EXPORT void TIramdacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual); typedef void TIramdacLoadPaletteProc(ScrnInfoPtr, int, int *, LOCO *, VisualPtr); extern _X_EXPORT TIramdacLoadPaletteProc *TIramdacLoadPaletteWeak(void); #define TI3030_RAMDAC (VENDOR_TI << 16) | 0x00 #define TI3026_RAMDAC (VENDOR_TI << 16) | 0x01 /* * TI Ramdac registers */ #define TIDAC_rev 0x01 #define TIDAC_ind_curs_ctrl 0x06 #define TIDAC_byte_router_ctrl 0x07 #define TIDAC_latch_ctrl 0x0f #define TIDAC_true_color_ctrl 0x18 #define TIDAC_multiplex_ctrl 0x19 #define TIDAC_clock_select 0x1a #define TIDAC_palette_page 0x1c #define TIDAC_general_ctrl 0x1d #define TIDAC_misc_ctrl 0x1e #define TIDAC_pll_addr 0x2c #define TIDAC_pll_pixel_data 0x2d #define TIDAC_pll_memory_data 0x2e #define TIDAC_pll_loop_data 0x2f #define TIDAC_key_over_low 0x30 #define TIDAC_key_over_high 0x31 #define TIDAC_key_red_low 0x32 #define TIDAC_key_red_high 0x33 #define TIDAC_key_green_low 0x34 #define TIDAC_key_green_high 0x35 #define TIDAC_key_blue_low 0x36 #define TIDAC_key_blue_high 0x37 #define TIDAC_key_ctrl 0x38 #define TIDAC_clock_ctrl 0x39 #define TIDAC_sense_test 0x3a #define TIDAC_test_mode_data 0x3b #define TIDAC_crc_remain_lsb 0x3c #define TIDAC_crc_remain_msb 0x3d #define TIDAC_crc_bit_select 0x3e #define TIDAC_id 0x3f /* These are pll values that are accessed via TIDAC_pll_pixel_data */ #define TIDAC_PIXEL_N 0x80 #define TIDAC_PIXEL_M 0x81 #define TIDAC_PIXEL_P 0x82 #define TIDAC_PIXEL_VALID 0x83 /* These are pll values that are accessed via TIDAC_pll_loop_data */ #define TIDAC_LOOP_N 0x90 #define TIDAC_LOOP_M 0x91 #define TIDAC_LOOP_P 0x92 #define TIDAC_LOOP_VALID 0x93 /* Direct mapping addresses */ #define TIDAC_INDEX 0xa0 #define TIDAC_PALETTE_DATA 0xa1 #define TIDAC_READ_MASK 0xa2 #define TIDAC_READ_ADDR 0xa3 #define TIDAC_CURS_WRITE_ADDR 0xa4 #define TIDAC_CURS_COLOR 0xa5 #define TIDAC_CURS_READ_ADDR 0xa7 #define TIDAC_CURS_CTL 0xa9 #define TIDAC_INDEXED_DATA 0xaa #define TIDAC_CURS_RAM_DATA 0xab #define TIDAC_CURS_XLOW 0xac #define TIDAC_CURS_XHIGH 0xad #define TIDAC_CURS_YLOW 0xae #define TIDAC_CURS_YHIGH 0xaf #define TIDAC_sw_reset 0xff /* Constants */ #define TIDAC_TVP_3026_ID 0x26 #define TIDAC_TVP_3030_ID 0x30 xorg-server-1.17.1/hw/xfree86/ramdac/xf86Cursor.h0000664000175100017510000000570212362011424016306 00000000000000 #ifndef _XF86CURSOR_H #define _XF86CURSOR_H #include "xf86str.h" #include "mipointer.h" typedef struct _xf86CursorInfoRec { ScrnInfoPtr pScrn; int Flags; int MaxWidth; int MaxHeight; void (*SetCursorColors) (ScrnInfoPtr pScrn, int bg, int fg); void (*SetCursorPosition) (ScrnInfoPtr pScrn, int x, int y); void (*LoadCursorImage) (ScrnInfoPtr pScrn, unsigned char *bits); Bool (*LoadCursorImageCheck) (ScrnInfoPtr pScrn, unsigned char *bits); void (*HideCursor) (ScrnInfoPtr pScrn); void (*ShowCursor) (ScrnInfoPtr pScrn); unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr); Bool (*UseHWCursor) (ScreenPtr, CursorPtr); #ifdef ARGB_CURSOR Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr); void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr); Bool (*LoadCursorARGBCheck) (ScrnInfoPtr, CursorPtr); #endif } xf86CursorInfoRec, *xf86CursorInfoPtr; static inline Bool xf86DriverHasLoadCursorImage(xf86CursorInfoPtr infoPtr) { return infoPtr->LoadCursorImageCheck || infoPtr->LoadCursorImage; } static inline Bool xf86DriverLoadCursorImage(xf86CursorInfoPtr infoPtr, unsigned char *bits) { if(infoPtr->LoadCursorImageCheck) return infoPtr->LoadCursorImageCheck(infoPtr->pScrn, bits); infoPtr->LoadCursorImage(infoPtr->pScrn, bits); return TRUE; } static inline Bool xf86DriverHasLoadCursorARGB(xf86CursorInfoPtr infoPtr) { return infoPtr->LoadCursorARGBCheck || infoPtr->LoadCursorARGB; } static inline Bool xf86DriverLoadCursorARGB(xf86CursorInfoPtr infoPtr, CursorPtr pCursor) { if(infoPtr->LoadCursorARGBCheck) return infoPtr->LoadCursorARGBCheck(infoPtr->pScrn, pCursor); infoPtr->LoadCursorARGB(infoPtr->pScrn, pCursor); return TRUE; } extern _X_EXPORT Bool xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr); extern _X_EXPORT xf86CursorInfoPtr xf86CreateCursorInfoRec(void); extern _X_EXPORT void xf86DestroyCursorInfoRec(xf86CursorInfoPtr); extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on); #define HARDWARE_CURSOR_INVERT_MASK 0x00000001 #define HARDWARE_CURSOR_AND_SOURCE_WITH_MASK 0x00000002 #define HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK 0x00000004 #define HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED 0x00000008 #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 0x00000010 #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 0x00000020 #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 0x00000040 #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 0x00000080 #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 0x00000100 #define HARDWARE_CURSOR_TRUECOLOR_AT_8BPP 0x00000200 #define HARDWARE_CURSOR_BIT_ORDER_MSBFIRST 0x00000400 #define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800 #define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000 #define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000 #ifdef ARGB_CURSOR #define HARDWARE_CURSOR_ARGB 0x00004000 #endif #endif /* _XF86CURSOR_H */ xorg-server-1.17.1/hw/xfree86/ramdac/BT.c0000664000175100017510000001227712366220413014626 00000000000000/* * Copyright 1998 by Alan Hourihane, Wigan, England. * * 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 Alan Hourihane not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Alan Hourihane makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL ALAN HOURIHANE 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: Alan Hourihane, * * BT RAMDAC routines. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86_OSproc.h" #define INIT_BT_RAMDAC_INFO #include "BTPriv.h" #include "xf86RamDacPriv.h" void BTramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg) { int i; /* Here we pass a short, so that we can evaluate a mask too */ /* So that the mask is the high byte and the data the low byte */ /* Just the command/status registers */ for (i = 0x06; i < 0x0A; i++) (*ramdacPtr->WriteDAC) (pScrn, i, (ramdacReg->DacRegs[i] & 0xFF00) >> 8, ramdacReg->DacRegs[i]); } void BTramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg) { int i; (*ramdacPtr->ReadAddress) (pScrn, 0); /* Start at index 0 */ for (i = 0; i < 768; i++) ramdacReg->DAC[i] = (*ramdacPtr->ReadData) (pScrn); /* Just the command/status registers */ for (i = 0x06; i < 0x0A; i++) ramdacReg->DacRegs[i] = (*ramdacPtr->ReadDAC) (pScrn, i); } RamDacHelperRecPtr BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs /*, RamDacRecPtr ramdacPtr */ ) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); Bool RamDacIsSupported = FALSE; RamDacHelperRecPtr ramdacHelperPtr = NULL; int BTramdac_ID = -1; int i, status, cmd0; /* Save COMMAND Register 0 */ cmd0 = (*ramdacPtr->ReadDAC) (pScrn, BT_COMMAND_REG_0); /* Ensure were going to access the STATUS Register on next read */ (*ramdacPtr->WriteDAC) (pScrn, BT_COMMAND_REG_0, 0x7F, 0x00); status = (*ramdacPtr->ReadDAC) (pScrn, BT_STATUS_REG); switch (status) { case 0x40: BTramdac_ID = ATT20C504_RAMDAC; break; case 0xD0: BTramdac_ID = ATT20C505_RAMDAC; break; default: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Unknown BT RAMDAC type (0x%x), assuming BT485\n", status); case 0x80: case 0x90: case 0xA0: case 0xB0: case 0x28: /* This is for the DEC TGA - Questionable ? */ BTramdac_ID = BT485_RAMDAC; break; } /* Restore COMMAND Register 0 */ (*ramdacPtr->WriteDAC) (pScrn, BT_COMMAND_REG_0, 0x00, cmd0); if (BTramdac_ID == -1) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Cannot determine BT RAMDAC type, aborting\n"); return NULL; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Attached RAMDAC is %s\n", BTramdacDeviceInfo[BTramdac_ID & 0xFFFF].DeviceName); } for (i = 0; ramdacs[i].token != -1; i++) { if (ramdacs[i].token == BTramdac_ID) RamDacIsSupported = TRUE; } if (!RamDacIsSupported) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "This BT RAMDAC is NOT supported by this driver, aborting\n"); return NULL; } ramdacHelperPtr = RamDacHelperCreateInfoRec(); switch (BTramdac_ID) { case BT485_RAMDAC: ramdacHelperPtr->SetBpp = BTramdacSetBpp; break; } ramdacPtr->RamDacType = BTramdac_ID; ramdacHelperPtr->RamDacType = BTramdac_ID; ramdacHelperPtr->Save = BTramdacSave; ramdacHelperPtr->Restore = BTramdacRestore; return ramdacHelperPtr; } void BTramdacSetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg) { /* We need to deal with Direct Colour visuals for 8bpp and other * good stuff for colours */ switch (pScrn->bitsPerPixel) { case 32: ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x10; break; case 24: ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x10; break; case 16: ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x38; break; case 15: ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x30; break; case 8: ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x40; break; case 4: ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x60; break; } } xorg-server-1.17.1/hw/xfree86/ramdac/TIPriv.h0000664000175100017510000000113212274325511015472 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include "TI.h" typedef struct { const char *DeviceName; } xf86TIramdacInfo; extern xf86TIramdacInfo TIramdacDeviceInfo[]; #ifdef INIT_TI_RAMDAC_INFO xf86TIramdacInfo TIramdacDeviceInfo[] = { {"TI TVP3030"}, {"TI TVP3026"} }; #endif #define TISAVE(_reg) do { \ ramdacReg->DacRegs[_reg] = (*ramdacPtr->ReadDAC)(pScrn, _reg); \ } while (0) #define TIRESTORE(_reg) do { \ (*ramdacPtr->WriteDAC)(pScrn, _reg, \ (ramdacReg->DacRegs[_reg] & 0xFF00) >> 8, \ ramdacReg->DacRegs[_reg]); \ } while (0) xorg-server-1.17.1/hw/xfree86/ramdac/Makefile.in0000664000175100017510000006666512466505433016245 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/ramdac DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libramdac_la_LIBADD = am_libramdac_la_OBJECTS = xf86RamDac.lo xf86RamDacCmap.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@) 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 = $(libramdac_la_SOURCES) DIST_SOURCES = $(libramdac_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libramdac.la libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c sdk_HEADERS = BT.h IBM.h TI.h xf86Cursor.h xf86RamDac.h EXTRA_DIST = BTPriv.h IBMPriv.h TIPriv.h xf86CursorPriv.h xf86RamDacPriv.h \ CURSOR.NOTES AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) AM_CPPFLAGS = $(XORG_INCS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/ramdac/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/ramdac/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libramdac.la: $(libramdac_la_OBJECTS) $(libramdac_la_DEPENDENCIES) $(EXTRA_libramdac_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libramdac_la_OBJECTS) $(libramdac_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @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)/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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RamDacCmap.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/xfree86/ramdac/BT.h0000664000175100017510000000240512274325511014626 00000000000000 #include "xf86RamDac.h" extern _X_EXPORT RamDacHelperRecPtr BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs); extern _X_EXPORT void BTramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void BTramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec); extern _X_EXPORT void BTramdacSetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec); #define ATT20C504_RAMDAC (VENDOR_BT << 16) | 0x00 #define ATT20C505_RAMDAC (VENDOR_BT << 16) | 0x01 #define BT485_RAMDAC (VENDOR_BT << 16) | 0x02 /* * BT registers */ #define BT_WRITE_ADDR 0x00 #define BT_RAMDAC_DATA 0x01 #define BT_PIXEL_MASK 0x02 #define BT_READ_ADDR 0x03 #define BT_CURS_WR_ADDR 0x04 #define BT_CURS_DATA 0x05 #define BT_COMMAND_REG_0 0x06 #define BT_CURS_RD_ADDR 0x07 #define BT_COMMAND_REG_1 0x08 #define BT_COMMAND_REG_2 0x09 #define BT_STATUS_REG 0x0A #define BT_CURS_RAM_DATA 0x0B #define BT_CURS_X_LOW 0x0C #define BT_CURS_X_HIGH 0x0D #define BT_CURS_Y_LOW 0x0E #define BT_CURS_Y_HIGH 0x0F xorg-server-1.17.1/hw/xfree86/ramdac/xf86CursorPriv.h0000664000175100017510000000264712323563340017162 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef _XF86CURSORPRIV_H #define _XF86CURSORPRIV_H #include "xf86Cursor.h" #include "mipointrst.h" typedef struct { Bool SWCursor; Bool isUp; Bool showTransparent; short HotX; short HotY; short x; short y; CursorPtr CurrentCursor, CursorToRestore; xf86CursorInfoPtr CursorInfoPtr; CloseScreenProcPtr CloseScreen; RecolorCursorProcPtr RecolorCursor; InstallColormapProcPtr InstallColormap; QueryBestSizeProcPtr QueryBestSize; miPointerSpriteFuncPtr spriteFuncs; Bool PalettedCursor; ColormapPtr pInstalledMap; Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); xf86EnableDisableFBAccessProc *EnableDisableFBAccess; CursorPtr SavedCursor; /* Number of requests to force HW cursor */ int ForceHWCursorCount; Bool HWCursorForced; void *transparentData; } xf86CursorScreenRec, *xf86CursorScreenPtr; Bool xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y); void xf86SetTransparentCursor(ScreenPtr pScreen); void xf86MoveCursor(ScreenPtr pScreen, int x, int y); void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed); Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr); extern _X_EXPORT DevPrivateKeyRec xf86CursorScreenKeyRec; #define xf86CursorScreenKey (&xf86CursorScreenKeyRec) #endif /* _XF86CURSORPRIV_H */ xorg-server-1.17.1/hw/xfree86/ramdac/CURSOR.NOTES0000664000175100017510000001542012160102336015770 00000000000000 CURSOR.NOTES This file describes how to add hardware cursor support to a chipset driver. Though the cursor support itself is in the ramdac module, cursor management is separate from the rest of the module. 1) CURSOR INITIALIZATION AND SHUTDOWN All relevant prototypes and defines are in xf86Cursor.h. To initialize the cursor, the driver should allocate an xf86CursorInfoRec via xf86CreateCursorInfoRec(), fill it out as described later in this document and pass it to xf86InitCursor(). xf86InitCursor() must be called _after_ the software cursor initialization (usually miDCInitialize). When shutting down, the driver should free the xf86CursorInfoRec structure in its CloseScreen function via xf86DestroyCursorInfoRec(). 2) FILLING OUT THE xf86CursorInfoRec The driver informs the ramdac module of it's hardware cursor capablities by filling out an xf86CursorInfoRec structure and passing it to xf86InitCursor(). The xf86CursorInfoRec contains the following function pointers: /**** These functions are required ****/ void ShowCursor(ScrnInfoPtr pScrn) ShowCursor should display the current cursor. void HideCursor(ScrnInfoPtr pScrn) HideCursor should hide the current cursor. void SetCursorPosition(ScrnInfoPtr pScrn, int x, int y) Set the cursor position to (x,y). X and/or y may be negative indicating that the cursor image is partially offscreen on the left and/or top edges of the screen. It is up to the driver to trap for this and deal with that situation. void SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) Set the cursor foreground and background colors. In 8bpp, fg and bg are indicies into the current colormap unless the HARDWARE_CURSOR_TRUECOLOR_AT_8BPP flag is set. In that case and in all other bpps the fg and bg are in 8-8-8 RGB format. void LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits) LoadCursorImage is how the hardware cursor bits computed by the RealizeCursor function will be passed to the driver when the cursor shape needs to be changed. /**** These functions are optional ****/ unsigned char* RealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) If RealizeCursor is not provided by the driver, one will be provided for you based on the Flags field described below. The driver must provide this function if the hardware cursor format is not one of the common ones supported by this module. Bool UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) If the driver is unable to use a hardware cursor for reasons other than the cursor being larger than the maximum specified in the MaxWidth or MaxHeight field below, it can supply the UseHWCursor function. If UseHWCursor is provided by the driver, it will be called whenever the cursor shape changes or the video mode changes. This is useful for when the hardware cursor cannot be used in interlaced or doublescan modes. /**** The following fields are required ****/ MaxWidth MaxHeight These indicate the largest sized cursor that can be a hardware cursor. It will fall back to a software cursor when a cursor exceeding this size needs to be used. Flags /* Color related flags */ HARDWARE_CURSOR_TRUECOLOR_AT_8BPP This indicates that the colors passed to the SetCursorColors function should not be in 8-8-8 RGB format in 8bpp but rather, they should be the pixel values from the current colormap. /* Cursor data loading flags */ HARDWARE_CURSOR_SHOW_TRANSPARENT The HideCursor entry will normally be called instead of displaying a completely transparent cursor, or when a switch to a software cursor needs to occur. This flag prevents this behaviour, thus causing the LoadCursorImage entry to be called with transparent cursor data. NOTE: If you use this flag and provide your own RealizeCursor() entry, ensure this entry returns transparent cursor data when called with a NULL pCurs parameter. HARDWARE_CURSOR_UPDATE_UNHIDDEN This flag prevents the HideCursor call that would normally occur just before the LoadCursorImage entry is to be called to load a new hardware cursor image. /* Cursor data packing flags */ Hardware cursor data consists of two pieces, a source and a mask. The mask is a bitmap indicating which parts of the cursor are transparent and which parts are drawn. The source is a bitmap indicating which parts of the non-transparent portion of the the cursor should be painted in the foreground color and which should be painted in the background color. HARDWARE_CURSOR_INVERT_MASK By default, set bits indicate the opaque part of the mask bitmap and clear bits indicate the transparent part. If your hardware wants this the opposite way, this flag will invert the mask. HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK By default, RealizeCursor will store the source first and then the mask. If the hardware needs this order reversed then this flag should be set. HARDWARE_CURSOR_AND_SOURCE_WITH_MASK This flag will have the module logical AND the source with the mask to make sure there are no source bits set if the corresponding mask bits aren't set. Some hardware will not care if source bits are set where there are supposed to be transparent areas, but some hardware will interpret this as a third cursor color or similar. That type of hardware will need this flag set. HARDWARE_CURSOR_BIT_ORDER_MSBFIRST By default, it is assumed that the least significant bit in each byte corresponds to the leftmost pixel on the screen. If your hardware has this reversed you should set this flag. HARDWARE_CURSOR_NIBBLE_SWAPPED If your hardware requires byte swapping of the hardware cursor, enable this option. /* Source-Mask interleaving flags */ By default the source and mask data are inlined (source first unless the HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK flag is set). Some hardware will require the source and mask to be interleaved, that is, X number of source bits should packed and then X number of mask bits repeating until the entire pattern is stored. The following flags describe the bit interleave. HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED This one is the default. The following are for interleaved cursors. HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 And once again, if your hardware requires something different than these packing styles, your driver can supply its own RealizeCursor function. $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES,v 1.4tsi Exp $ xorg-server-1.17.1/hw/xfree86/ramdac/IBM.c0000664000175100017510000005326012456571574014746 00000000000000/* * Copyright 1998 by Alan Hourihane, Wigan, England. * * 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 Alan Hourihane not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Alan Hourihane makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL ALAN HOURIHANE 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: Alan Hourihane, * * IBM RAMDAC routines. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Cursor.h" #define INIT_IBM_RAMDAC_INFO #include "IBMPriv.h" #include "xf86RamDacPriv.h" #define INITIALFREQERR 100000 unsigned long IBMramdac640CalculateMNPCForClock(unsigned long RefClock, /* In 100Hz units */ unsigned long ReqClock, /* In 100Hz units */ char IsPixClock, /* boolean, is this the pixel or the sys clock */ unsigned long MinClock, /* Min VCO rating */ unsigned long MaxClock, /* Max VCO rating */ unsigned long *rM, /* M Out */ unsigned long *rN, /* N Out */ unsigned long *rP, /* Min P In, P Out */ unsigned long *rC /* C Out */ ) { unsigned long M, N, P, iP = *rP; unsigned long IntRef, VCO, Clock; long freqErr, lowestFreqErr = INITIALFREQERR; unsigned long ActualClock = 0; for (N = 0; N <= 63; N++) { IntRef = RefClock / (N + 1); if (IntRef < 10000) break; /* IntRef needs to be >= 1MHz */ for (M = 2; M <= 127; M++) { VCO = IntRef * (M + 1); if ((VCO < MinClock) || (VCO > MaxClock)) continue; for (P = iP; P <= 4; P++) { if (P != 0) Clock = (RefClock * (M + 1)) / ((N + 1) * 2 * P); else Clock = (RefClock * (M + 1)) / (N + 1); freqErr = (Clock - ReqClock); if (freqErr < 0) { /* PixelClock gets rounded up always so monitor reports correct frequency. */ if (IsPixClock) continue; freqErr = -freqErr; } if (freqErr < lowestFreqErr) { *rM = M; *rN = N; *rP = P; *rC = (VCO <= 1280000 ? 1 : 2); ActualClock = Clock; lowestFreqErr = freqErr; /* Return if we found an exact match */ if (freqErr == 0) return ActualClock; } } } } return ActualClock; } unsigned long IBMramdac526CalculateMNPCForClock(unsigned long RefClock, /* In 100Hz units */ unsigned long ReqClock, /* In 100Hz units */ char IsPixClock, /* boolean, is this the pixel or the sys clock */ unsigned long MinClock, /* Min VCO rating */ unsigned long MaxClock, /* Max VCO rating */ unsigned long *rM, /* M Out */ unsigned long *rN, /* N Out */ unsigned long *rP, /* Min P In, P Out */ unsigned long *rC /* C Out */ ) { unsigned long M, N, P, iP = *rP; unsigned long IntRef, VCO, Clock; long freqErr, lowestFreqErr = INITIALFREQERR; unsigned long ActualClock = 0; for (N = 0; N <= 63; N++) { IntRef = RefClock / (N + 1); if (IntRef < 10000) break; /* IntRef needs to be >= 1MHz */ for (M = 0; M <= 63; M++) { VCO = IntRef * (M + 1); if ((VCO < MinClock) || (VCO > MaxClock)) continue; for (P = iP; P <= 4; P++) { if (P) Clock = (RefClock * (M + 1)) / ((N + 1) * 2 * P); else Clock = VCO; freqErr = (Clock - ReqClock); if (freqErr < 0) { /* PixelClock gets rounded up always so monitor reports correct frequency. */ if (IsPixClock) continue; freqErr = -freqErr; } if (freqErr < lowestFreqErr) { *rM = M; *rN = N; *rP = P; *rC = (VCO <= 1280000 ? 1 : 2); ActualClock = Clock; lowestFreqErr = freqErr; /* Return if we found an exact match */ if (freqErr == 0) return ActualClock; } } } } return ActualClock; } void IBMramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg) { int i, maxreg, dacreg; switch (ramdacPtr->RamDacType) { case IBM640_RAMDAC: maxreg = 0x300; dacreg = 1024; break; default: maxreg = 0x100; dacreg = 768; break; } /* Here we pass a short, so that we can evaluate a mask too */ /* So that the mask is the high byte and the data the low byte */ for (i = 0; i < maxreg; i++) (*ramdacPtr->WriteDAC) (pScrn, i, (ramdacReg->DacRegs[i] & 0xFF00) >> 8, ramdacReg->DacRegs[i]); (*ramdacPtr->WriteAddress) (pScrn, 0); for (i = 0; i < dacreg; i++) (*ramdacPtr->WriteData) (pScrn, ramdacReg->DAC[i]); } void IBMramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg) { int i, maxreg, dacreg; switch (ramdacPtr->RamDacType) { case IBM640_RAMDAC: maxreg = 0x300; dacreg = 1024; break; default: maxreg = 0x100; dacreg = 768; break; } (*ramdacPtr->ReadAddress) (pScrn, 0); for (i = 0; i < dacreg; i++) ramdacReg->DAC[i] = (*ramdacPtr->ReadData) (pScrn); for (i = 0; i < maxreg; i++) ramdacReg->DacRegs[i] = (*ramdacPtr->ReadDAC) (pScrn, i); } RamDacHelperRecPtr IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs /* , RamDacRecPtr ramdacPtr */ ) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); RamDacHelperRecPtr ramdacHelperPtr = NULL; Bool RamDacIsSupported = FALSE; int IBMramdac_ID = -1; int i; unsigned char id, rev, id2, rev2; /* read ID and revision */ rev = (*ramdacPtr->ReadDAC) (pScrn, IBMRGB_rev); id = (*ramdacPtr->ReadDAC) (pScrn, IBMRGB_id); /* check if ID and revision are read only */ (*ramdacPtr->WriteDAC) (pScrn, ~rev, 0, IBMRGB_rev); (*ramdacPtr->WriteDAC) (pScrn, ~id, 0, IBMRGB_id); rev2 = (*ramdacPtr->ReadDAC) (pScrn, IBMRGB_rev); id2 = (*ramdacPtr->ReadDAC) (pScrn, IBMRGB_id); switch (id) { case 0x30: if (rev == 0xc0) IBMramdac_ID = IBM624_RAMDAC; if (rev == 0x80) IBMramdac_ID = IBM624DB_RAMDAC; break; case 0x12: if (rev == 0x1c) IBMramdac_ID = IBM640_RAMDAC; break; case 0x01: IBMramdac_ID = IBM525_RAMDAC; break; case 0x02: if (rev == 0xf0) IBMramdac_ID = IBM524_RAMDAC; if (rev == 0xe0) IBMramdac_ID = IBM524A_RAMDAC; if (rev == 0xc0) IBMramdac_ID = IBM526_RAMDAC; if (rev == 0x80) IBMramdac_ID = IBM526DB_RAMDAC; break; } if (id == 1 || id == 2) { if (id == id2 && rev == rev2) { /* IBM RGB52x found */ /* check for 128bit VRAM -> RGB528 */ if (((*ramdacPtr->ReadDAC) (pScrn, IBMRGB_misc1) & 0x03) == 0x03) { IBMramdac_ID = IBM528_RAMDAC; /* 128bit DAC found */ if (rev == 0xe0) IBMramdac_ID = IBM528A_RAMDAC; } } } (*ramdacPtr->WriteDAC) (pScrn, rev, 0, IBMRGB_rev); (*ramdacPtr->WriteDAC) (pScrn, id, 0, IBMRGB_id); if (IBMramdac_ID == -1) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Cannot determine IBM RAMDAC type, aborting\n"); return NULL; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Attached RAMDAC is %s\n", IBMramdacDeviceInfo[IBMramdac_ID & 0xFFFF].DeviceName); } for (i = 0; ramdacs[i].token != -1; i++) { if (ramdacs[i].token == IBMramdac_ID) RamDacIsSupported = TRUE; } if (!RamDacIsSupported) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "This IBM RAMDAC is NOT supported by this driver, aborting\n"); return NULL; } ramdacHelperPtr = RamDacHelperCreateInfoRec(); switch (IBMramdac_ID) { case IBM526_RAMDAC: case IBM526DB_RAMDAC: ramdacHelperPtr->SetBpp = IBMramdac526SetBpp; ramdacHelperPtr->HWCursorInit = IBMramdac526HWCursorInit; break; case IBM640_RAMDAC: ramdacHelperPtr->SetBpp = IBMramdac640SetBpp; ramdacHelperPtr->HWCursorInit = IBMramdac640HWCursorInit; break; } ramdacPtr->RamDacType = IBMramdac_ID; ramdacHelperPtr->RamDacType = IBMramdac_ID; ramdacHelperPtr->Save = IBMramdacSave; ramdacHelperPtr->Restore = IBMramdacRestore; return ramdacHelperPtr; } void IBMramdac526SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg) { ramdacReg->DacRegs[IBMRGB_key_control] = 0x00; /* Disable Chroma Key */ switch (pScrn->bitsPerPixel) { case 32: ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_32BPP; ramdacReg->DacRegs[IBMRGB_32bpp] = B32_DCOL_DIRECT; ramdacReg->DacRegs[IBMRGB_24bpp] = 0; ramdacReg->DacRegs[IBMRGB_16bpp] = 0; ramdacReg->DacRegs[IBMRGB_8bpp] = 0; if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) { ramdacReg->DacRegs[IBMRGB_key_control] = 0x01; /* Enable Key */ ramdacReg->DacRegs[IBMRGB_key] = 0xFF; ramdacReg->DacRegs[IBMRGB_key_mask] = 0xFF; } break; case 24: ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_24BPP; ramdacReg->DacRegs[IBMRGB_32bpp] = 0; ramdacReg->DacRegs[IBMRGB_24bpp] = B24_DCOL_DIRECT; ramdacReg->DacRegs[IBMRGB_16bpp] = 0; ramdacReg->DacRegs[IBMRGB_8bpp] = 0; break; case 16: if (pScrn->depth == 16) { ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_16BPP; ramdacReg->DacRegs[IBMRGB_32bpp] = 0; ramdacReg->DacRegs[IBMRGB_24bpp] = 0; ramdacReg->DacRegs[IBMRGB_16bpp] = B16_DCOL_DIRECT | B16_LINEAR | B16_CONTIGUOUS | B16_565; ramdacReg->DacRegs[IBMRGB_8bpp] = 0; } else { ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_16BPP; ramdacReg->DacRegs[IBMRGB_32bpp] = 0; ramdacReg->DacRegs[IBMRGB_24bpp] = 0; ramdacReg->DacRegs[IBMRGB_16bpp] = B16_DCOL_DIRECT | B16_LINEAR | B16_CONTIGUOUS | B16_555; ramdacReg->DacRegs[IBMRGB_8bpp] = 0; } break; case 8: ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_8BPP; ramdacReg->DacRegs[IBMRGB_32bpp] = 0; ramdacReg->DacRegs[IBMRGB_24bpp] = 0; ramdacReg->DacRegs[IBMRGB_16bpp] = 0; ramdacReg->DacRegs[IBMRGB_8bpp] = B8_DCOL_INDIRECT; break; case 4: ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_4BPP; ramdacReg->DacRegs[IBMRGB_32bpp] = 0; ramdacReg->DacRegs[IBMRGB_24bpp] = 0; ramdacReg->DacRegs[IBMRGB_16bpp] = 0; ramdacReg->DacRegs[IBMRGB_8bpp] = 0; } } IBMramdac526SetBppProc * IBMramdac526SetBppWeak(void) { return IBMramdac526SetBpp; } void IBMramdac640SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg) { unsigned char bpp = 0x00; unsigned char overlaybpp = 0x00; unsigned char offset = 0x00; unsigned char dispcont = 0x44; ramdacReg->DacRegs[RGB640_SER_WID_03_00] = 0x00; ramdacReg->DacRegs[RGB640_SER_WID_07_04] = 0x00; ramdacReg->DacRegs[RGB640_DIAGS] = 0x07; switch (pScrn->depth) { case 8: ramdacReg->DacRegs[RGB640_SER_07_00] = 0x00; ramdacReg->DacRegs[RGB640_SER_15_08] = 0x00; ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00; ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00; ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_16_1; /*16:1 Mux */ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */ bpp = 0x03; break; case 15: ramdacReg->DacRegs[RGB640_SER_07_00] = 0x10; ramdacReg->DacRegs[RGB640_SER_15_08] = 0x11; ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00; ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00; ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_8_1; /* 8:1 Mux */ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */ bpp = 0x0E; break; case 16: ramdacReg->DacRegs[RGB640_SER_07_00] = 0x10; ramdacReg->DacRegs[RGB640_SER_15_08] = 0x11; ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00; ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00; ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_8_1; /* 8:1 Mux */ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */ bpp = 0x05; break; case 24: ramdacReg->DacRegs[RGB640_SER_07_00] = 0x30; ramdacReg->DacRegs[RGB640_SER_15_08] = 0x31; ramdacReg->DacRegs[RGB640_SER_23_16] = 0x32; ramdacReg->DacRegs[RGB640_SER_31_24] = 0x33; ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_4_1; /* 4:1 Mux */ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */ bpp = 0x09; if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) { ramdacReg->DacRegs[RGB640_SER_WID_07_04] = 0x04; ramdacReg->DacRegs[RGB640_CHROMA_KEY0] = 0xFF; ramdacReg->DacRegs[RGB640_CHROMA_MASK0] = 0xFF; offset = 0x04; overlaybpp = 0x04; dispcont = 0x48; } break; case 30: /* 10 bit dac */ ramdacReg->DacRegs[RGB640_SER_07_00] = 0x30; ramdacReg->DacRegs[RGB640_SER_15_08] = 0x31; ramdacReg->DacRegs[RGB640_SER_23_16] = 0x32; ramdacReg->DacRegs[RGB640_SER_31_24] = 0x33; ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_4_1; /* 4:1 Mux */ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PSIZE10 | IBM640_PCLK_8; /* pll / 8 */ bpp = 0x0D; break; } { int i; for (i = 0x100; i < 0x140; i += 4) { /* Initialize FrameBuffer Window Attribute Table */ ramdacReg->DacRegs[i + 0] = bpp; ramdacReg->DacRegs[i + 1] = offset; ramdacReg->DacRegs[i + 2] = 0x00; ramdacReg->DacRegs[i + 3] = 0x00; /* Initialize Overlay Window Attribute Table */ ramdacReg->DacRegs[i + 0x100] = overlaybpp; ramdacReg->DacRegs[i + 0x101] = 0x00; ramdacReg->DacRegs[i + 0x102] = 0x00; ramdacReg->DacRegs[i + 0x103] = dispcont; } } } static void IBMramdac526ShowCursor(ScrnInfoPtr pScrn) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); /* Enable cursor - X11 mode */ (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs, 0x00, 0x07); } static void IBMramdac640ShowCursor(ScrnInfoPtr pScrn) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); /* Enable cursor - mode2 (x11 mode) */ (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURSOR_CONTROL, 0x00, 0x0B); (*ramdacPtr->WriteDAC) (pScrn, RGB640_CROSSHAIR_CONTROL, 0x00, 0x00); } static void IBMramdac526HideCursor(ScrnInfoPtr pScrn) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); /* Disable cursor - X11 mode */ (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs, 0x00, 0x24); } static void IBMramdac640HideCursor(ScrnInfoPtr pScrn) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); /* Disable cursor - mode2 (x11 mode) */ (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURSOR_CONTROL, 0x00, 0x08); } static void IBMramdac526SetCursorPosition(ScrnInfoPtr pScrn, int x, int y) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); x += 64; y += 64; (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_hot_x, 0x00, 0x3f); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_hot_y, 0x00, 0x3f); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_xl, 0x00, x & 0xff); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_xh, 0x00, (x >> 8) & 0xf); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_yl, 0x00, y & 0xff); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_yh, 0x00, (y >> 8) & 0xf); } static void IBMramdac640SetCursorPosition(ScrnInfoPtr pScrn, int x, int y) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); x += 64; y += 64; (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_OFFSETX, 0x00, 0x3f); (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_OFFSETY, 0x00, 0x3f); (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_X_LOW, 0x00, x & 0xff); (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_X_HIGH, 0x00, (x >> 8) & 0xf); (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_Y_LOW, 0x00, y & 0xff); (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_Y_HIGH, 0x00, (y >> 8) & 0xf); } static void IBMramdac526SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_col1_r, 0x00, bg >> 16); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_col1_g, 0x00, bg >> 8); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_col1_b, 0x00, bg); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_col2_r, 0x00, fg >> 16); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_col2_g, 0x00, fg >> 8); (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_col2_b, 0x00, fg); } static void IBMramdac640SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_COL0, 0x00, 0); (*ramdacPtr->WriteData) (pScrn, fg >> 16); (*ramdacPtr->WriteData) (pScrn, fg >> 8); (*ramdacPtr->WriteData) (pScrn, fg); (*ramdacPtr->WriteData) (pScrn, bg >> 16); (*ramdacPtr->WriteData) (pScrn, bg >> 8); (*ramdacPtr->WriteData) (pScrn, bg); (*ramdacPtr->WriteData) (pScrn, fg >> 16); (*ramdacPtr->WriteData) (pScrn, fg >> 8); (*ramdacPtr->WriteData) (pScrn, fg); (*ramdacPtr->WriteData) (pScrn, bg >> 16); (*ramdacPtr->WriteData) (pScrn, bg >> 8); (*ramdacPtr->WriteData) (pScrn, bg); } static Bool IBMramdac526LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); int i; /* * Output the cursor data. The realize function has put the planes into * their correct order, so we can just blast this out. */ for (i = 0; i < 1024; i++) (*ramdacPtr->WriteDAC) (pScrn, IBMRGB_curs_array + i, 0x00, (*src++)); return TRUE; } static Bool IBMramdac640LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) { RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); int i; /* * Output the cursor data. The realize function has put the planes into * their correct order, so we can just blast this out. */ for (i = 0; i < 1024; i++) (*ramdacPtr->WriteDAC) (pScrn, RGB640_CURS_WRITE + i, 0x00, (*src++)); return TRUE; } static Bool IBMramdac526UseHWCursor(ScreenPtr pScr, CursorPtr pCurs) { return TRUE; } static Bool IBMramdac640UseHWCursor(ScreenPtr pScr, CursorPtr pCurs) { return TRUE; } void IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr) { infoPtr->MaxWidth = 64; infoPtr->MaxHeight = 64; infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1; infoPtr->SetCursorColors = IBMramdac526SetCursorColors; infoPtr->SetCursorPosition = IBMramdac526SetCursorPosition; infoPtr->LoadCursorImageCheck = IBMramdac526LoadCursorImage; infoPtr->HideCursor = IBMramdac526HideCursor; infoPtr->ShowCursor = IBMramdac526ShowCursor; infoPtr->UseHWCursor = IBMramdac526UseHWCursor; } void IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr) { infoPtr->MaxWidth = 64; infoPtr->MaxHeight = 64; infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1; infoPtr->SetCursorColors = IBMramdac640SetCursorColors; infoPtr->SetCursorPosition = IBMramdac640SetCursorPosition; infoPtr->LoadCursorImageCheck = IBMramdac640LoadCursorImage; infoPtr->HideCursor = IBMramdac640HideCursor; infoPtr->ShowCursor = IBMramdac640ShowCursor; infoPtr->UseHWCursor = IBMramdac640UseHWCursor; } xorg-server-1.17.1/hw/xfree86/ramdac/xf86Cursor.c0000664000175100017510000004001412456571574016321 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86CursorPriv.h" #include "colormapst.h" #include "cursorstr.h" /* FIXME: This was added with the ABI change of the miPointerSpriteFuncs for * MPX. * inputInfo is needed to pass the core pointer as the default argument into * the cursor functions. * * Externing inputInfo is not the nice way to do it but it works. */ #include "inputstr.h" DevPrivateKeyRec xf86CursorScreenKeyRec; /* sprite functions */ static Bool xf86CursorRealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); static Bool xf86CursorUnrealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr); static void xf86CursorSetCursor(DeviceIntPtr, ScreenPtr, CursorPtr, int, int); static void xf86CursorMoveCursor(DeviceIntPtr, ScreenPtr, int, int); static Bool xf86DeviceCursorInitialize(DeviceIntPtr, ScreenPtr); static void xf86DeviceCursorCleanup(DeviceIntPtr, ScreenPtr); static miPointerSpriteFuncRec xf86CursorSpriteFuncs = { xf86CursorRealizeCursor, xf86CursorUnrealizeCursor, xf86CursorSetCursor, xf86CursorMoveCursor, xf86DeviceCursorInitialize, xf86DeviceCursorCleanup }; /* Screen functions */ static void xf86CursorInstallColormap(ColormapPtr); static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr, CursorPtr, Bool); static Bool xf86CursorCloseScreen(ScreenPtr); static void xf86CursorQueryBestSize(int, unsigned short *, unsigned short *, ScreenPtr); /* ScrnInfoRec functions */ static void xf86CursorEnableDisableFBAccess(ScrnInfoPtr, Bool); static Bool xf86CursorSwitchMode(ScrnInfoPtr, DisplayModePtr); Bool xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CursorScreenPtr ScreenPriv; miPointerScreenPtr PointPriv; if (!xf86InitHardwareCursor(pScreen, infoPtr)) return FALSE; if (!dixRegisterPrivateKey(&xf86CursorScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; ScreenPriv = calloc(1, sizeof(xf86CursorScreenRec)); if (!ScreenPriv) return FALSE; dixSetPrivate(&pScreen->devPrivates, xf86CursorScreenKey, ScreenPriv); ScreenPriv->SWCursor = TRUE; ScreenPriv->isUp = FALSE; ScreenPriv->CurrentCursor = NULL; ScreenPriv->CursorInfoPtr = infoPtr; ScreenPriv->PalettedCursor = FALSE; ScreenPriv->pInstalledMap = NULL; ScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86CursorCloseScreen; ScreenPriv->QueryBestSize = pScreen->QueryBestSize; pScreen->QueryBestSize = xf86CursorQueryBestSize; ScreenPriv->RecolorCursor = pScreen->RecolorCursor; pScreen->RecolorCursor = xf86CursorRecolorCursor; if ((infoPtr->pScrn->bitsPerPixel == 8) && !(infoPtr->Flags & HARDWARE_CURSOR_TRUECOLOR_AT_8BPP)) { ScreenPriv->InstallColormap = pScreen->InstallColormap; pScreen->InstallColormap = xf86CursorInstallColormap; ScreenPriv->PalettedCursor = TRUE; } PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); ScreenPriv->showTransparent = PointPriv->showTransparent; if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT) PointPriv->showTransparent = TRUE; else PointPriv->showTransparent = FALSE; ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; PointPriv->spriteFuncs = &xf86CursorSpriteFuncs; ScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess; ScreenPriv->SwitchMode = pScrn->SwitchMode; ScreenPriv->ForceHWCursorCount = 0; ScreenPriv->HWCursorForced = FALSE; pScrn->EnableDisableFBAccess = xf86CursorEnableDisableFBAccess; if (pScrn->SwitchMode) pScrn->SwitchMode = xf86CursorSwitchMode; return TRUE; } /***** Screen functions *****/ static Bool xf86CursorCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); miPointerScreenPtr PointPriv = (miPointerScreenPtr) dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (ScreenPriv->isUp && pScrn->vtSema) xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y); if (ScreenPriv->CurrentCursor) FreeCursor(ScreenPriv->CurrentCursor, None); pScreen->CloseScreen = ScreenPriv->CloseScreen; pScreen->QueryBestSize = ScreenPriv->QueryBestSize; pScreen->RecolorCursor = ScreenPriv->RecolorCursor; if (ScreenPriv->InstallColormap) pScreen->InstallColormap = ScreenPriv->InstallColormap; PointPriv->spriteFuncs = ScreenPriv->spriteFuncs; PointPriv->showTransparent = ScreenPriv->showTransparent; pScrn->EnableDisableFBAccess = ScreenPriv->EnableDisableFBAccess; pScrn->SwitchMode = ScreenPriv->SwitchMode; free(ScreenPriv->transparentData); free(ScreenPriv); return (*pScreen->CloseScreen) (pScreen); } static void xf86CursorQueryBestSize(int class, unsigned short *width, unsigned short *height, ScreenPtr pScreen) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (class == CursorShape) { if (*width > ScreenPriv->CursorInfoPtr->MaxWidth) *width = ScreenPriv->CursorInfoPtr->MaxWidth; if (*height > ScreenPriv->CursorInfoPtr->MaxHeight) *height = ScreenPriv->CursorInfoPtr->MaxHeight; } else (*ScreenPriv->QueryBestSize) (class, width, height, pScreen); } static void xf86CursorInstallColormap(ColormapPtr pMap) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pMap->pScreen->devPrivates, xf86CursorScreenKey); ScreenPriv->pInstalledMap = pMap; (*ScreenPriv->InstallColormap) (pMap); } static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (!displayed) return; if (ScreenPriv->SWCursor) (*ScreenPriv->RecolorCursor) (pDev, pScreen, pCurs, displayed); else xf86RecolorCursor(pScreen, pCurs, displayed); } /***** ScrnInfoRec functions *********/ static void xf86CursorEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable) { DeviceIntPtr pDev = inputInfo.pointer; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (!enable && ScreenPriv->CurrentCursor != NullCursor) { CursorPtr currentCursor = ScreenPriv->CurrentCursor; xf86CursorSetCursor(pDev, pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y); ScreenPriv->isUp = FALSE; ScreenPriv->SWCursor = TRUE; ScreenPriv->SavedCursor = currentCursor; } if (ScreenPriv->EnableDisableFBAccess) (*ScreenPriv->EnableDisableFBAccess) (pScrn, enable); if (enable && ScreenPriv->SavedCursor) { /* * Re-set current cursor so drivers can react to FB access having been * temporarily disabled. */ xf86CursorSetCursor(pDev, pScreen, ScreenPriv->SavedCursor, ScreenPriv->x, ScreenPriv->y); ScreenPriv->SavedCursor = NULL; } } static Bool xf86CursorSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { Bool ret; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (ScreenPriv->isUp) { xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y); ScreenPriv->isUp = FALSE; } ret = (*ScreenPriv->SwitchMode) (pScrn, mode); /* * Cannot restore cursor here because the new frame[XY][01] haven't been * calculated yet. However, because the hardware cursor was removed above, * ensure the cursor is repainted by miPointerWarpCursor(). */ ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor; miPointerSetWaitForUpdate(pScreen, FALSE); /* Force cursor repaint */ return ret; } /****** miPointerSpriteFunctions *******/ static Bool xf86CursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (CursorRefCount(pCurs) <= 1) dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, NULL); return (*ScreenPriv->spriteFuncs->RealizeCursor) (pDev, pScreen, pCurs); } static Bool xf86CursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (CursorRefCount(pCurs) <= 1) { free(dixLookupScreenPrivate (&pCurs->devPrivates, CursorScreenKey, pScreen)); dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, NULL); } return (*ScreenPriv->spriteFuncs->UnrealizeCursor) (pDev, pScreen, pCurs); } static void xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */ if (ScreenPriv->SWCursor || !(GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer)) (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, NullCursor, x, y); else if (ScreenPriv->isUp) { xf86SetCursor(pScreen, NullCursor, x, y); ScreenPriv->isUp = FALSE; } if (ScreenPriv->CurrentCursor) FreeCursor(ScreenPriv->CurrentCursor, None); ScreenPriv->CurrentCursor = NullCursor; return; } /* only update for VCP, otherwise we get cursor jumps when removing a sprite. The second cursor is never HW rendered anyway. */ if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer) { CursorPtr cursor = RefCursor(pCurs); if (ScreenPriv->CurrentCursor) FreeCursor(ScreenPriv->CurrentCursor, None); ScreenPriv->CurrentCursor = cursor; ScreenPriv->x = x; ScreenPriv->y = y; ScreenPriv->CursorToRestore = NULL; ScreenPriv->HotX = cursor->bits->xhot; ScreenPriv->HotY = cursor->bits->yhot; if (!infoPtr->pScrn->vtSema) { ScreenPriv->SavedCursor = cursor; return; } if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) && (ScreenPriv->ForceHWCursorCount || (( #ifdef ARGB_CURSOR cursor->bits->argb && infoPtr->UseHWCursorARGB && (*infoPtr->UseHWCursorARGB)(pScreen, cursor)) || (cursor->bits->argb == 0 && #endif (cursor->bits->height <= infoPtr->MaxHeight) && (cursor->bits->width <= infoPtr->MaxWidth) && (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) { if (ScreenPriv->SWCursor) /* remove the SW cursor */ (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, NullCursor, x, y); if (xf86SetCursor(pScreen, cursor, x, y)) { ScreenPriv->SWCursor = FALSE; ScreenPriv->isUp = TRUE; miPointerSetWaitForUpdate(pScreen, !infoPtr->pScrn->silkenMouse); return; } } miPointerSetWaitForUpdate(pScreen, TRUE); if (ScreenPriv->isUp) { /* Remove the HW cursor, or make it transparent */ if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT) { xf86SetTransparentCursor(pScreen); } else { xf86SetCursor(pScreen, NullCursor, x, y); ScreenPriv->isUp = FALSE; } } if (!ScreenPriv->SWCursor) ScreenPriv->SWCursor = TRUE; } if (pCurs->bits->emptyMask && !ScreenPriv->showTransparent) pCurs = NullCursor; (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCurs, x, y); } static void xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); /* only update coordinate state for first sprite, otherwise we get jumps when removing a sprite. The second sprite is never HW rendered anyway */ if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer) { ScreenPriv->x = x; ScreenPriv->y = y; if (ScreenPriv->CursorToRestore) xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CursorToRestore, x, y); else if (ScreenPriv->SWCursor) (*ScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y); else if (ScreenPriv->isUp) xf86MoveCursor(pScreen, x, y); } else (*ScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y); } void xf86ForceHWCursor(ScreenPtr pScreen, Bool on) { DeviceIntPtr pDev = inputInfo.pointer; xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); if (on) { if (ScreenPriv->ForceHWCursorCount++ == 0) { if (ScreenPriv->SWCursor && ScreenPriv->CurrentCursor) { ScreenPriv->HWCursorForced = TRUE; xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CurrentCursor, ScreenPriv->x, ScreenPriv->y); } else ScreenPriv->HWCursorForced = FALSE; } } else { if (--ScreenPriv->ForceHWCursorCount == 0) { if (ScreenPriv->HWCursorForced && ScreenPriv->CurrentCursor) xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CurrentCursor, ScreenPriv->x, ScreenPriv->y); } } } xf86CursorInfoPtr xf86CreateCursorInfoRec(void) { return calloc(1, sizeof(xf86CursorInfoRec)); } void xf86DestroyCursorInfoRec(xf86CursorInfoPtr infoPtr) { free(infoPtr); } /** * New cursor has been created. Do your initalizations here. */ static Bool xf86DeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) { int ret; xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); /* Init SW cursor */ ret = (*ScreenPriv->spriteFuncs->DeviceCursorInitialize) (pDev, pScreen); return ret; } /** * Cursor has been removed. Clean up after yourself. */ static void xf86DeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); /* Clean up SW cursor */ (*ScreenPriv->spriteFuncs->DeviceCursorCleanup) (pDev, pScreen); } xorg-server-1.17.1/hw/xfree86/ramdac/xf86RamDacPriv.h0000664000175100017510000000052212274325511017023 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86RamDac.h" #include "xf86cmap.h" void RamDacGetRecPrivate(void); Bool RamDacGetRec(ScrnInfoPtr pScrn); int RamDacGetScreenIndex(void); void RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual); xorg-server-1.17.1/hw/xfree86/Makefile.in0000664000175100017510000011427612466505431015004 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ bin_PROGRAMS = Xorg$(EXEEXT) @SUID_WRAPPER_TRUE@wrap_PROGRAMS = Xorg.wrap$(EXEEXT) subdir = hw/xfree86 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/Xorg.sh.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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 = Xorg.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(wrapdir)" PROGRAMS = $(bin_PROGRAMS) $(wrap_PROGRAMS) nodist_Xorg_OBJECTS = sdksyms.$(OBJEXT) Xorg_OBJECTS = $(nodist_Xorg_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ loader/libloader.la common/libcommon.la \ os-support/libxorgos.la parser/libxf86config_internal.la \ dixmods/libdixmods.la modes/libxf86modes.la \ ramdac/libramdac.la ddc/libddc.la i2c/libi2c.la \ $(am__DEPENDENCIES_1) dixmods/libxorgxkb.la $(DRI_LIB) \ $(DRI2_LIB) $(DRI3_LIB) $(top_builddir)/miext/sync/libsync.la \ $(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 am__v_lt_1 = Xorg_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(Xorg_LDFLAGS) $(LDFLAGS) -o $@ am__Xorg_wrap_SOURCES_DIST = xorg-wrapper.c @SUID_WRAPPER_TRUE@am_Xorg_wrap_OBJECTS = xorg-wrapper.$(OBJEXT) Xorg_wrap_OBJECTS = $(am_Xorg_wrap_OBJECTS) Xorg_wrap_LDADD = $(LDADD) 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 = $(nodist_Xorg_SOURCES) $(Xorg_wrap_SOURCES) DIST_SOURCES = $(am__Xorg_wrap_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @DRI_TRUE@DRI_SUBDIR = dri @DRI_TRUE@DRI_LIB = dri/libdri.la @DRI2_TRUE@DRI2_SUBDIR = dri2 @DRI2_TRUE@DRI2_LIB = dri2/libdri2.la @DRI3_TRUE@DRI3_BUILDDIR = $(top_builddir)/dri3 @DRI3_TRUE@DRI3_LIB = $(DRI3_BUILDDIR)/libdri3.la @GLAMOR_EGL_TRUE@GLAMOR_EGL_SUBDIR = glamor_egl @XF86UTILS_TRUE@XF86UTILS_SUBDIR = utils @VGAHW_TRUE@VGAHW_SUBDIR = vgahw @VBE_TRUE@VBE_SUBDIR = vbe @INT10MODULE_TRUE@INT10_SUBDIR = int10 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 \ $(GLAMOR_EGL_SUBDIR) drivers DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ parser ramdac shadowfb vbe vgahw \ loader dixmods dri dri2 exa modes \ utils doc man glamor_egl drivers nodist_Xorg_SOURCES = sdksyms.c AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \ -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \ -I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3 LOCAL_LIBS = \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ loader/libloader.la \ common/libcommon.la \ os-support/libxorgos.la \ parser/libxf86config_internal.la \ dixmods/libdixmods.la \ modes/libxf86modes.la \ ramdac/libramdac.la \ ddc/libddc.la \ i2c/libi2c.la \ $(XORG_LIBS) \ dixmods/libxorgxkb.la \ $(DRI_LIB) \ $(DRI2_LIB) \ $(DRI3_LIB) \ $(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la Xorg_LDADD = \ $(LOCAL_LIBS) \ $(XORG_SYS_LIBS) \ $(XSERVER_SYS_LIBS) Xorg_DEPENDENCIES = $(LOCAL_LIBS) Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) @SUID_WRAPPER_TRUE@wrapdir = $(SUID_WRAPPER_DIR) @SUID_WRAPPER_TRUE@Xorg_wrap_SOURCES = xorg-wrapper.c BUILT_SOURCES = xorg.conf.example DISTCLEANFILES = xorg.conf.example EXTRA_DIST = xorgconf.cpp sdksyms.sh # Use variables from XORG_MANPAGE_SECTIONS and X Server configuration # Do not include manpages.am as values are not appropriate for rc files CONF_SUBSTS = -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' \ -e 's|MODULEPATH|$(DEFAULT_MODULE_PATH)|g' \ -e 's|DEFAULTFONTPATH|$(COMPILEDDEFAULTFONTPATH)|g' CLEANFILES = sdksyms.c sdksyms.dep Xorg.sh SDKSYMS_DEP = sdksyms.dep all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): Xorg.sh: $(top_builddir)/config.status $(srcdir)/Xorg.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-wrapPROGRAMS: $(wrap_PROGRAMS) @$(NORMAL_INSTALL) @list='$(wrap_PROGRAMS)'; test -n "$(wrapdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(wrapdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(wrapdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(wrapdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(wrapdir)$$dir" || exit $$?; \ } \ ; done uninstall-wrapPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(wrap_PROGRAMS)'; test -n "$(wrapdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(wrapdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(wrapdir)" && rm -f $$files clean-wrapPROGRAMS: @list='$(wrap_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list Xorg$(EXEEXT): $(Xorg_OBJECTS) $(Xorg_DEPENDENCIES) $(EXTRA_Xorg_DEPENDENCIES) @rm -f Xorg$(EXEEXT) $(AM_V_CCLD)$(Xorg_LINK) $(Xorg_OBJECTS) $(Xorg_LDADD) $(LIBS) Xorg.wrap$(EXEEXT): $(Xorg_wrap_OBJECTS) $(Xorg_wrap_DEPENDENCIES) $(EXTRA_Xorg_wrap_DEPENDENCIES) @rm -f Xorg.wrap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(Xorg_wrap_OBJECTS) $(Xorg_wrap_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdksyms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xorg-wrapper.Po@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 -o $@ $< .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 -o $@ `$(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 # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(wrapdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-wrapPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-wrapPROGRAMS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-local \ uninstall-wrapPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) all check install install-am \ install-exec-am install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ clean-wrapPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-wrapPROGRAMS installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-hook uninstall-local uninstall-wrapPROGRAMS # Without logdir, X will post an error on the terminal and will not start install-data-local: $(AM_V_GEN)$(MKDIR_P) $(DESTDIR)$(logdir) @CYGWIN_TRUE@ $(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a install-exec-hook: (cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg$(EXEEXT) X) @INSTALL_SETUID_TRUE@ chown root $(DESTDIR)$(bindir)/Xorg @INSTALL_SETUID_TRUE@ chmod u+s $(DESTDIR)$(bindir)/Xorg @SUID_WRAPPER_TRUE@ $(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR) @SUID_WRAPPER_TRUE@ mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg @SUID_WRAPPER_TRUE@ ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg @SUID_WRAPPER_TRUE@ -chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap uninstall-local: @CYGWIN_TRUE@ $(AM_V_at)rm -f $(DESTDIR)$(libdir)/libXorg.exe.a uninstall-hook: $(AM_V_at)rm -f $(DESTDIR)$(bindir)/X xorg.conf.example: xorgconf.cpp $(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $(srcdir)/xorgconf.cpp > $@ relink: $(AM_V_at)rm -f Xorg$(EXEEXT) && $(MAKE) Xorg$(EXEEXT) sdksyms.dep sdksyms.c: sdksyms.sh $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) -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: xorg-server-1.17.1/hw/xfree86/sdksyms.sh0000775000175100017510000001677312432306326014771 00000000000000#!/bin/sh cat > sdksyms.c << EOF /* This file is automatically generated by sdksyms.sh. */ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #ifdef HAVE_XORG_CONFIG_H #include #endif /* These must be included first */ #include "misc.h" #include "miscstruct.h" /* render/Makefile.am */ #include "picture.h" #include "mipict.h" #include "glyphstr.h" #include "picturestr.h" /* fb/Makefile.am -- module */ /* #include "fb.h" #include "fbrop.h" #include "fboverlay.h" #include "wfbrename.h" #include "fbpict.h" */ /* miext/shadow/Makefile.am -- module */ /* #include "shadow.h" */ /* miext/damage/Makefile.am */ #include "damage.h" #include "damagestr.h" /* miext/sync/Makefile.am */ #include "misync.h" #include "misyncstr.h" #if HAVE_XSHMFENCE #include "misyncshm.h" #endif /* 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 #include "shmint.h" #endif #include "syncsdk.h" #if XINERAMA # include "panoramiXsrv.h" # include "panoramiX.h" #endif /* hw/xfree86/int10/Makefile.am -- module */ /* #include "xf86int10.h" */ /* hw/xfree86/i2c/Makefile.am -- "mostly" modules */ #include "xf86i2c.h" /* #include "bt829.h" #include "fi1236.h" #include "msp3430.h" #include "tda8425.h" #include "tda9850.h" #include "tda9885.h" #include "uda1380.h" #include "i2c_def.h" */ /* hw/xfree86/modes/Makefile.am */ #include "xf86Crtc.h" #include "xf86Modes.h" #include "xf86RandR12.h" /* #include "xf86Rename.h" */ /* hw/xfree86/ddc/Makefile.am */ #include "edid.h" #include "xf86DDC.h" /* hw/xfree86/dri2/Makefile.am -- module */ #if DRI2 # include "dri2.h" #endif # include "dri3.h" /* hw/xfree86/vgahw/Makefile.am -- module */ /* #include "vgaHW.h" */ /* hw/xfree86/fbdevhw/Makefile.am -- module */ /* #include "fbdevhw.h" */ /* hw/xfree86/common/Makefile.am */ #include "compiler.h" #include "fourcc.h" #include "xf86.h" #include "xf86Module.h" #include "xf86Opt.h" #ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" #endif #include "xf86Priv.h" #include "xf86Privstr.h" #include "xf86cmap.h" #include "xf86fbman.h" #include "xf86str.h" #include "xf86Xinput.h" #include "xisb.h" #if XV # include "xf86xv.h" # include "xf86xvmc.h" # include "xf86xvpriv.h" #endif #if XF86VIDMODE # include "vidmodeproc.h" #endif #include "xorgVersion.h" #if defined(__sparc__) || defined(__sparc) # include "xf86sbusBus.h" #endif /* hw/xfree86/ramdac/Makefile.am */ #include "BT.h" #include "IBM.h" #include "TI.h" #include "xf86Cursor.h" #include "xf86RamDac.h" /* hw/xfree86/shadowfb/Makefile.am -- module */ /* #include "shadowfb.h" */ /* hw/xfree86/os-support/solaris/Makefile.am */ #if defined(sun386) # include "agpgart.h" #endif /* hw/xfree86/os-support/Makefile.am */ #include "xf86_OSproc.h" #include "xf86_OSlib.h" /* hw/xfree86/os-support/bus/Makefile.am */ #ifdef XSERVER_LIBPCIACCESS # include "xf86Pci.h" #endif #if defined(__sparc__) || defined(__sparc) # include "xf86Sbus.h" #endif /* hw/xfree86/dixmods/extmod/Makefile.am -- module */ #ifdef XFreeXDGA #include "dgaproc.h" #endif /* hw/xfree86/parser/Makefile.am */ #include "xf86Parser.h" #include "xf86Optrec.h" /* hw/xfree86/vbe/Makefile.am -- module */ /* #include "vbe.h" #include "vbeModes.h" */ /* hw/xfree86/dri/Makefile.am -- module */ #if XF86DRI # include "dri.h" # include "sarea.h" # include "dristruct.h" #endif /* mi/Makefile.am */ #include "micmap.h" #include "miline.h" #include "mipointer.h" #include "mi.h" #include "migc.h" #include "mipointrst.h" #include "mizerarc.h" #include "micoord.h" #include "mifillarc.h" #include "mistruct.h" #include "mioverlay.h" /* randr/Makefile.am */ #include "randrstr.h" #include "rrtransform.h" /* dbe/Makefile.am -- module */ #ifdef DBE #include "dbestruct.h" #endif /* exa/Makefile.am -- module */ /* #include "exa.h" */ #ifdef COMPOSITE #include "compositeext.h" #endif /* xfixes/Makefile.am */ #include "xfixes.h" /* include/Makefile.am */ #include "XIstubs.h" #include "Xprintf.h" #include "closestr.h" #include "closure.h" #include "colormap.h" #include "colormapst.h" #include "hotplug.h" #include "client.h" #include "cursor.h" #include "cursorstr.h" #include "dix.h" #include "dixaccess.h" #include "dixevents.h" #define _FONTPROTO_H #include "dixfont.h" #include "dixfontstr.h" #include "dixfontstubs.h" #include "dixgrabs.h" #include "dixstruct.h" #include "exevents.h" #include "extension.h" #include "extnsionst.h" #include "gc.h" #include "gcstruct.h" #include "globals.h" #include "input.h" #include "inputstr.h" /* already included */ /* #include "misc.h" #include "miscstruct.h" */ #include "opaque.h" #include "os.h" #include "pixmap.h" #include "pixmapstr.h" #include "privates.h" #include "property.h" #include "propertyst.h" #include "ptrveloc.h" #include "region.h" #include "regionstr.h" #include "registry.h" #include "resource.h" #include "rgb.h" #include "screenint.h" #include "scrnintstr.h" #include "selection.h" #include "servermd.h" #include "site.h" #include "swaprep.h" #include "swapreq.h" #include "validate.h" #include "window.h" #include "windowstr.h" #include "xace.h" #include "xkbfile.h" #include "xkbsrv.h" #include "xkbstr.h" #include "xkbrules.h" #include "xserver-properties.h" EOF topdir=$1 shift LC_ALL=C export LC_ALL ${CPP:-cpp} "$@" sdksyms.c > /dev/null || exit $? ${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir ' BEGIN { sdk = 0; print("/*"); print(" * These symbols are referenced to ensure they"); print(" * will be available in the X Server binary."); print(" */"); printf("/* topdir=%s */\n", topdir); print("_X_HIDDEN void *xorg_symbols[] = {"); printf("sdksyms.c:") > "sdksyms.dep"; } /^# [0-9]+ "/ { # Process text after a include in a relative path or when the # processed file has a basename matching $top_srcdir. # Note that indexing starts at 1; 0 means no match, and there # is a starting ". sdk = $3 !~ /^"\// || index($3, topdir) == 2; if (sdk && $3 ~ /\.h"$/) { # remove quotes gsub(/"/, "", $3); line = $2; header = $3; if (! headers[$3]) { printf(" \\\n %s", $3) >> "sdksyms.dep"; headers[$3] = 1; } } next; } /^extern[ ]/ { if (sdk) { n = 3; # skip attribute, if any while ($n ~ /^(__attribute__|__global)/ || # skip modifiers, if any $n ~ /^\*?(unsigned|const|volatile|struct|_X_EXPORT)$/ || # skip pointer $n ~ /^[a-zA-Z0-9_]*\*$/) n++; # type specifier may not be set, as in # extern _X_EXPORT unsigned name(...) if ($n !~ /[^a-zA-Z0-9_]/) n++; # go back if we are at the parameter list already if ($n ~ /^[(]([^*].*)?$/) n--; # match # extern _X_EXPORT type (* name[])(...) if ($n ~ /^[^a-zA-Z0-9_]+$/) n++; # match # extern _X_EXPORT const name *const ... if ($n ~ /^([^a-zA-Z0-9_]+)?const$/) n++; # actual name may be in the next line, as in # extern _X_EXPORT type # possibly ending with a * # name(...) if ($n == "" || $n ~ /^\*+$/) { getline; n = 1; # indent may have inserted a blank link if ($0 == "") getline; } # dont modify $0 or $n symbol = $n; # remove starting non word chars sub(/^[^a-zA-Z0-9_]+/, "",symbol); # remove from first non word to end of line sub(/[^a-zA-Z0-9_].*/, "", symbol); #print; printf(" (void *) &%-50s /* %s:%s */\n", symbol ",", header, line); } } { line++; } END { print("};"); print("") >> "sdksyms.dep"; }' > _sdksyms.c STATUS=$? cat _sdksyms.c >> sdksyms.c rm _sdksyms.c [ $? != 0 ] && exit $? exit $STATUS xorg-server-1.17.1/hw/xfree86/vgahw/0000775000175100017510000000000012466505445014125 500000000000000xorg-server-1.17.1/hw/xfree86/vgahw/Makefile.am0000664000175100017510000000043212366751547016105 00000000000000module_LTLIBRARIES = libvgahw.la libvgahw_la_LDFLAGS = -avoid-version libvgahw_la_LIBADD = $(PCIACCESS_LIBS) libvgahw_la_SOURCES = vgaHW.c vgaHWmodule.c AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = vgaHW.h xorg-server-1.17.1/hw/xfree86/vgahw/vgaHW.h0000664000175100017510000002237212456571574015245 00000000000000 /* * Copyright (c) 1997,1998 The XFree86 Project, Inc. * * Loosely based on code bearing the following copyright: * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * Author: Dirk Hohndel */ #ifndef _VGAHW_H #define _VGAHW_H #include #include "misc.h" #include "input.h" #include "scrnintstr.h" #include "colormapst.h" #include "xf86str.h" #include "xf86Pci.h" #include "xf86DDC.h" #include "globals.h" #include extern _X_EXPORT int vgaHWGetIndex(void); /* * access macro */ #define VGAHWPTR(p) ((vgaHWPtr)((p)->privates[vgaHWGetIndex()].ptr)) /* Standard VGA registers */ #define VGA_ATTR_INDEX 0x3C0 #define VGA_ATTR_DATA_W 0x3C0 #define VGA_ATTR_DATA_R 0x3C1 #define VGA_IN_STAT_0 0x3C2 /* read */ #define VGA_MISC_OUT_W 0x3C2 /* write */ #define VGA_ENABLE 0x3C3 #define VGA_SEQ_INDEX 0x3C4 #define VGA_SEQ_DATA 0x3C5 #define VGA_DAC_MASK 0x3C6 #define VGA_DAC_READ_ADDR 0x3C7 #define VGA_DAC_WRITE_ADDR 0x3C8 #define VGA_DAC_DATA 0x3C9 #define VGA_FEATURE_R 0x3CA /* read */ #define VGA_MISC_OUT_R 0x3CC /* read */ #define VGA_GRAPH_INDEX 0x3CE #define VGA_GRAPH_DATA 0x3CF #define VGA_IOBASE_MONO 0x3B0 #define VGA_IOBASE_COLOR 0x3D0 #define VGA_CRTC_INDEX_OFFSET 0x04 #define VGA_CRTC_DATA_OFFSET 0x05 #define VGA_IN_STAT_1_OFFSET 0x0A /* read */ #define VGA_FEATURE_W_OFFSET 0x0A /* write */ /* default number of VGA registers stored internally */ #define VGA_NUM_CRTC 25 #define VGA_NUM_SEQ 5 #define VGA_NUM_GFX 9 #define VGA_NUM_ATTR 21 /* Flags for vgaHWSave() and vgaHWRestore() */ #define VGA_SR_MODE 0x01 #define VGA_SR_FONTS 0x02 #define VGA_SR_CMAP 0x04 #define VGA_SR_ALL (VGA_SR_MODE | VGA_SR_FONTS | VGA_SR_CMAP) /* Defaults for the VGA memory window */ #define VGA_DEFAULT_PHYS_ADDR 0xA0000 #define VGA_DEFAULT_MEM_SIZE (64 * 1024) /* * vgaRegRec contains settings of standard VGA registers. */ typedef struct { unsigned char MiscOutReg; /* */ unsigned char *CRTC; /* Crtc Controller */ unsigned char *Sequencer; /* Video Sequencer */ unsigned char *Graphics; /* Video Graphics */ unsigned char *Attribute; /* Video Atribute */ unsigned char DAC[768]; /* Internal Colorlookuptable */ unsigned char numCRTC; /* number of CRTC registers, def=VGA_NUM_CRTC */ unsigned char numSequencer; /* number of seq registers, def=VGA_NUM_SEQ */ unsigned char numGraphics; /* number of gfx registers, def=VGA_NUM_GFX */ unsigned char numAttribute; /* number of attr registers, def=VGA_NUM_ATTR */ } vgaRegRec, *vgaRegPtr; typedef struct _vgaHWRec *vgaHWPtr; typedef void (*vgaHWWriteIndexProcPtr) (vgaHWPtr hwp, CARD8 indx, CARD8 value); typedef CARD8 (*vgaHWReadIndexProcPtr) (vgaHWPtr hwp, CARD8 indx); typedef void (*vgaHWWriteProcPtr) (vgaHWPtr hwp, CARD8 value); typedef CARD8 (*vgaHWReadProcPtr) (vgaHWPtr hwp); typedef void (*vgaHWMiscProcPtr) (vgaHWPtr hwp); /* * vgaHWRec contains per-screen information required by the vgahw module. * * Note, the palette referred to by the paletteEnabled, enablePalette and * disablePalette is the 16-entry (+overscan) EGA-compatible palette accessed * via the first 17 attribute registers and not the main 8-bit palette. */ typedef struct _vgaHWRec { void *Base; /* Address of "VGA" memory */ int MapSize; /* Size of "VGA" memory */ unsigned long MapPhys; /* phys location of VGA mem */ int IOBase; /* I/O Base address */ CARD8 *MMIOBase; /* Pointer to MMIO start */ int MMIOOffset; /* base + offset + vgareg = mmioreg */ void *FontInfo1; /* save area for fonts in plane 2 */ void *FontInfo2; /* save area for fonts in plane 3 */ void *TextInfo; /* save area for text */ vgaRegRec SavedReg; /* saved registers */ vgaRegRec ModeReg; /* register settings for current mode */ Bool ShowOverscan; Bool paletteEnabled; Bool cmapSaved; ScrnInfoPtr pScrn; vgaHWWriteIndexProcPtr writeCrtc; vgaHWReadIndexProcPtr readCrtc; vgaHWWriteIndexProcPtr writeGr; vgaHWReadIndexProcPtr readGr; vgaHWReadProcPtr readST00; vgaHWReadProcPtr readST01; vgaHWReadProcPtr readFCR; vgaHWWriteProcPtr writeFCR; vgaHWWriteIndexProcPtr writeAttr; vgaHWReadIndexProcPtr readAttr; vgaHWWriteIndexProcPtr writeSeq; vgaHWReadIndexProcPtr readSeq; vgaHWWriteProcPtr writeMiscOut; vgaHWReadProcPtr readMiscOut; vgaHWMiscProcPtr enablePalette; vgaHWMiscProcPtr disablePalette; vgaHWWriteProcPtr writeDacMask; vgaHWReadProcPtr readDacMask; vgaHWWriteProcPtr writeDacWriteAddr; vgaHWWriteProcPtr writeDacReadAddr; vgaHWWriteProcPtr writeDacData; vgaHWReadProcPtr readDacData; void *ddc; struct pci_io_handle *io; vgaHWReadProcPtr readEnable; vgaHWWriteProcPtr writeEnable; struct pci_device *dev; } vgaHWRec; /* Some macros that VGA drivers can use in their ChipProbe() function */ #define OVERSCAN 0x11 /* Index of OverScan register */ /* Flags that define how overscan correction should take place */ #define KGA_FIX_OVERSCAN 1 /* overcan correction required */ #define KGA_ENABLE_ON_ZERO 2 /* if possible enable display at beginning */ /* of next scanline/frame */ #define KGA_BE_TOT_DEC 4 /* always fix problem by setting blank end */ /* to total - 1 */ #define BIT_PLANE 3 /* Which plane we write to in mono mode */ #define BITS_PER_GUN 6 #define COLORMAP_SIZE 256 #define DACDelay(hw) \ do { \ (hw)->readST01((hw)); \ (hw)->readST01((hw)); \ } while (0) /* Function Prototypes */ /* vgaHW.c */ typedef void vgaHWProtectProc(ScrnInfoPtr, Bool); typedef void vgaHWBlankScreenProc(ScrnInfoPtr, Bool); extern _X_EXPORT void vgaHWSetStdFuncs(vgaHWPtr hwp); extern _X_EXPORT void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset); extern _X_EXPORT void vgaHWProtect(ScrnInfoPtr pScrn, Bool on); extern _X_EXPORT vgaHWProtectProc *vgaHWProtectWeak(void); extern _X_EXPORT Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode); extern _X_EXPORT void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on); extern _X_EXPORT vgaHWBlankScreenProc *vgaHWBlankScreenWeak(void); extern _X_EXPORT void vgaHWSeqReset(vgaHWPtr hwp, Bool start); extern _X_EXPORT void vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore); extern _X_EXPORT void vgaHWRestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore); extern _X_EXPORT void vgaHWRestoreColormap(ScrnInfoPtr scrninfp, vgaRegPtr restore); extern _X_EXPORT void vgaHWRestore(ScrnInfoPtr scrninfp, vgaRegPtr restore, int flags); extern _X_EXPORT void vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save); extern _X_EXPORT void vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save); extern _X_EXPORT void vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save); extern _X_EXPORT void vgaHWSave(ScrnInfoPtr scrninfp, vgaRegPtr save, int flags); extern _X_EXPORT Bool vgaHWInit(ScrnInfoPtr scrnp, DisplayModePtr mode); extern _X_EXPORT Bool vgaHWSetRegCounts(ScrnInfoPtr scrp, int numCRTC, int numSequencer, int numGraphics, int numAttribute); extern _X_EXPORT Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src); extern _X_EXPORT Bool vgaHWGetHWRec(ScrnInfoPtr scrp); extern _X_EXPORT void vgaHWFreeHWRec(ScrnInfoPtr scrp); extern _X_EXPORT Bool vgaHWMapMem(ScrnInfoPtr scrp); extern _X_EXPORT void vgaHWUnmapMem(ScrnInfoPtr scrp); extern _X_EXPORT void vgaHWGetIOBase(vgaHWPtr hwp); extern _X_EXPORT void vgaHWLock(vgaHWPtr hwp); extern _X_EXPORT void vgaHWUnlock(vgaHWPtr hwp); extern _X_EXPORT void vgaHWEnable(vgaHWPtr hwp); extern _X_EXPORT void vgaHWDisable(vgaHWPtr hwp); extern _X_EXPORT void vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); extern _X_EXPORT Bool vgaHWHandleColormaps(ScreenPtr pScreen); extern _X_EXPORT void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed); extern _X_EXPORT CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags); extern _X_EXPORT CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags); extern _X_EXPORT Bool vgaHWAllocDefaultRegs(vgaRegPtr regp); extern _X_EXPORT DDC1SetSpeedProc vgaHWddc1SetSpeedWeak(void); extern _X_EXPORT SaveScreenProcPtr vgaHWSaveScreenWeak(void); extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc) (ScrnInfoPtr, int), void (*ProtectRegs) (ScrnInfoPtr, Bool), void (*BlankScreen) (ScrnInfoPtr, Bool), unsigned long vertsyncreg, int maskval, int knownclkindex, int knownclkvalue); #endif /* _VGAHW_H */ xorg-server-1.17.1/hw/xfree86/vgahw/vgaHWmodule.c0000664000175100017510000000070712366220413016423 00000000000000/* * Copyright 1998 by The XFree86 Project, Inc */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86Module.h" static XF86ModuleVersionInfo VersRec = { "vgahw", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 0, 1, 0, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData vgahwModuleData = { &VersRec, NULL, NULL }; xorg-server-1.17.1/hw/xfree86/vgahw/Makefile.in0000664000175100017510000007053112466505434016116 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/vgahw DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = libvgahw_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libvgahw_la_OBJECTS = vgaHW.lo vgaHWmodule.lo libvgahw_la_OBJECTS = $(am_libvgahw_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 = libvgahw_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libvgahw_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 = $(libvgahw_la_SOURCES) DIST_SOURCES = $(libvgahw_la_SOURCES) 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ module_LTLIBRARIES = libvgahw.la libvgahw_la_LDFLAGS = -avoid-version libvgahw_la_LIBADD = $(PCIACCESS_LIBS) libvgahw_la_SOURCES = vgaHW.c vgaHWmodule.c AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = vgaHW.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/vgahw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/vgahw/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libvgahw.la: $(libvgahw_la_OBJECTS) $(libvgahw_la_DEPENDENCIES) $(EXTRA_libvgahw_la_DEPENDENCIES) $(AM_V_CCLD)$(libvgahw_la_LINK) -rpath $(moduledir) $(libvgahw_la_OBJECTS) $(libvgahw_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vgaHW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vgaHWmodule.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-moduleLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am uninstall \ uninstall-am uninstall-moduleLTLIBRARIES 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: xorg-server-1.17.1/hw/xfree86/vgahw/vgaHW.c0000664000175100017510000016022012456571574015233 00000000000000 /* * * Copyright 1991-1999 by The XFree86 Project, Inc. * * Loosely based on code bearing the following copyright: * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * */ #define _NEED_SYSI86 #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include #include #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include "vgaHW.h" #include "compiler.h" #include "xf86cmap.h" #include "Pci.h" #ifndef SAVE_FONT1 #define SAVE_FONT1 1 #endif /* * These used to be OS-specific, which made this module have an undesirable * OS dependency. Define them by default for all platforms. */ #ifndef NEED_SAVED_CMAP #define NEED_SAVED_CMAP #endif #ifndef SAVE_TEXT #define SAVE_TEXT 1 #endif #ifndef SAVE_FONT2 #define SAVE_FONT2 1 #endif /* bytes per plane to save for text */ #define TEXT_AMOUNT 16384 /* bytes per plane to save for font data */ #define FONT_AMOUNT (8*8192) #if 0 /* Override all of these for now */ #undef SAVE_FONT1 #define SAVE_FONT1 1 #undef SAVE_FONT2 #define SAVE_FONT2 1 #undef SAVE_TEST #define SAVE_TEST 1 #undef FONT_AMOUNT #define FONT_AMOUNT 65536 #undef TEXT_AMOUNT #define TEXT_AMOUNT 65536 #endif /* DAC indices for white and black */ #define WHITE_VALUE 0x3F #define BLACK_VALUE 0x00 #define OVERSCAN_VALUE 0x01 /* Use a private definition of this here */ #undef VGAHWPTR #define VGAHWPTRLVAL(p) (p)->privates[vgaHWPrivateIndex].ptr #define VGAHWPTR(p) ((vgaHWPtr)(VGAHWPTRLVAL(p))) static int vgaHWPrivateIndex = -1; #define DAC_TEST_MASK 0x3F #ifdef NEED_SAVED_CMAP /* This default colourmap is used only when it can't be read from the VGA */ static CARD8 defaultDAC[768] = { 0, 0, 0, 0, 0, 42, 0, 42, 0, 0, 42, 42, 42, 0, 0, 42, 0, 42, 42, 21, 0, 42, 42, 42, 21, 21, 21, 21, 21, 63, 21, 63, 21, 21, 63, 63, 63, 21, 21, 63, 21, 63, 63, 63, 21, 63, 63, 63, 0, 0, 0, 5, 5, 5, 8, 8, 8, 11, 11, 11, 14, 14, 14, 17, 17, 17, 20, 20, 20, 24, 24, 24, 28, 28, 28, 32, 32, 32, 36, 36, 36, 40, 40, 40, 45, 45, 45, 50, 50, 50, 56, 56, 56, 63, 63, 63, 0, 0, 63, 16, 0, 63, 31, 0, 63, 47, 0, 63, 63, 0, 63, 63, 0, 47, 63, 0, 31, 63, 0, 16, 63, 0, 0, 63, 16, 0, 63, 31, 0, 63, 47, 0, 63, 63, 0, 47, 63, 0, 31, 63, 0, 16, 63, 0, 0, 63, 0, 0, 63, 16, 0, 63, 31, 0, 63, 47, 0, 63, 63, 0, 47, 63, 0, 31, 63, 0, 16, 63, 31, 31, 63, 39, 31, 63, 47, 31, 63, 55, 31, 63, 63, 31, 63, 63, 31, 55, 63, 31, 47, 63, 31, 39, 63, 31, 31, 63, 39, 31, 63, 47, 31, 63, 55, 31, 63, 63, 31, 55, 63, 31, 47, 63, 31, 39, 63, 31, 31, 63, 31, 31, 63, 39, 31, 63, 47, 31, 63, 55, 31, 63, 63, 31, 55, 63, 31, 47, 63, 31, 39, 63, 45, 45, 63, 49, 45, 63, 54, 45, 63, 58, 45, 63, 63, 45, 63, 63, 45, 58, 63, 45, 54, 63, 45, 49, 63, 45, 45, 63, 49, 45, 63, 54, 45, 63, 58, 45, 63, 63, 45, 58, 63, 45, 54, 63, 45, 49, 63, 45, 45, 63, 45, 45, 63, 49, 45, 63, 54, 45, 63, 58, 45, 63, 63, 45, 58, 63, 45, 54, 63, 45, 49, 63, 0, 0, 28, 7, 0, 28, 14, 0, 28, 21, 0, 28, 28, 0, 28, 28, 0, 21, 28, 0, 14, 28, 0, 7, 28, 0, 0, 28, 7, 0, 28, 14, 0, 28, 21, 0, 28, 28, 0, 21, 28, 0, 14, 28, 0, 7, 28, 0, 0, 28, 0, 0, 28, 7, 0, 28, 14, 0, 28, 21, 0, 28, 28, 0, 21, 28, 0, 14, 28, 0, 7, 28, 14, 14, 28, 17, 14, 28, 21, 14, 28, 24, 14, 28, 28, 14, 28, 28, 14, 24, 28, 14, 21, 28, 14, 17, 28, 14, 14, 28, 17, 14, 28, 21, 14, 28, 24, 14, 28, 28, 14, 24, 28, 14, 21, 28, 14, 17, 28, 14, 14, 28, 14, 14, 28, 17, 14, 28, 21, 14, 28, 24, 14, 28, 28, 14, 24, 28, 14, 21, 28, 14, 17, 28, 20, 20, 28, 22, 20, 28, 24, 20, 28, 26, 20, 28, 28, 20, 28, 28, 20, 26, 28, 20, 24, 28, 20, 22, 28, 20, 20, 28, 22, 20, 28, 24, 20, 28, 26, 20, 28, 28, 20, 26, 28, 20, 24, 28, 20, 22, 28, 20, 20, 28, 20, 20, 28, 22, 20, 28, 24, 20, 28, 26, 20, 28, 28, 20, 26, 28, 20, 24, 28, 20, 22, 28, 0, 0, 16, 4, 0, 16, 8, 0, 16, 12, 0, 16, 16, 0, 16, 16, 0, 12, 16, 0, 8, 16, 0, 4, 16, 0, 0, 16, 4, 0, 16, 8, 0, 16, 12, 0, 16, 16, 0, 12, 16, 0, 8, 16, 0, 4, 16, 0, 0, 16, 0, 0, 16, 4, 0, 16, 8, 0, 16, 12, 0, 16, 16, 0, 12, 16, 0, 8, 16, 0, 4, 16, 8, 8, 16, 10, 8, 16, 12, 8, 16, 14, 8, 16, 16, 8, 16, 16, 8, 14, 16, 8, 12, 16, 8, 10, 16, 8, 8, 16, 10, 8, 16, 12, 8, 16, 14, 8, 16, 16, 8, 14, 16, 8, 12, 16, 8, 10, 16, 8, 8, 16, 8, 8, 16, 10, 8, 16, 12, 8, 16, 14, 8, 16, 16, 8, 14, 16, 8, 12, 16, 8, 10, 16, 11, 11, 16, 12, 11, 16, 13, 11, 16, 15, 11, 16, 16, 11, 16, 16, 11, 15, 16, 11, 13, 16, 11, 12, 16, 11, 11, 16, 12, 11, 16, 13, 11, 16, 15, 11, 16, 16, 11, 15, 16, 11, 13, 16, 11, 12, 16, 11, 11, 16, 11, 11, 16, 12, 11, 16, 13, 11, 16, 15, 11, 16, 16, 11, 15, 16, 11, 13, 16, 11, 12, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #endif /* NEED_SAVED_CMAP */ /* * Standard VGA versions of the register access functions. */ static void stdWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value) { pci_io_write8(hwp->io, hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index); pci_io_write8(hwp->io, hwp->IOBase + VGA_CRTC_DATA_OFFSET, value); } static CARD8 stdReadCrtc(vgaHWPtr hwp, CARD8 index) { pci_io_write8(hwp->io, hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index); return pci_io_read8(hwp->io, hwp->IOBase + VGA_CRTC_DATA_OFFSET); } static void stdWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value) { pci_io_write8(hwp->io, VGA_GRAPH_INDEX, index); pci_io_write8(hwp->io, VGA_GRAPH_DATA, value); } static CARD8 stdReadGr(vgaHWPtr hwp, CARD8 index) { pci_io_write8(hwp->io, VGA_GRAPH_INDEX, index); return pci_io_read8(hwp->io, VGA_GRAPH_DATA); } static void stdWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value) { pci_io_write8(hwp->io, VGA_SEQ_INDEX, index); pci_io_write8(hwp->io, VGA_SEQ_DATA, value); } static CARD8 stdReadSeq(vgaHWPtr hwp, CARD8 index) { pci_io_write8(hwp->io, VGA_SEQ_INDEX, index); return pci_io_read8(hwp->io, VGA_SEQ_DATA); } static CARD8 stdReadST00(vgaHWPtr hwp) { return pci_io_read8(hwp->io, VGA_IN_STAT_0); } static CARD8 stdReadST01(vgaHWPtr hwp) { return pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET); } static CARD8 stdReadFCR(vgaHWPtr hwp) { return pci_io_read8(hwp->io, VGA_FEATURE_R); } static void stdWriteFCR(vgaHWPtr hwp, CARD8 value) { pci_io_write8(hwp->io, hwp->IOBase + VGA_FEATURE_W_OFFSET, value); } static void stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) { if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET); pci_io_write8(hwp->io, VGA_ATTR_INDEX, index); pci_io_write8(hwp->io, VGA_ATTR_DATA_W, value); } static CARD8 stdReadAttr(vgaHWPtr hwp, CARD8 index) { if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET); pci_io_write8(hwp->io, VGA_ATTR_INDEX, index); return pci_io_read8(hwp->io, VGA_ATTR_DATA_R); } static void stdWriteMiscOut(vgaHWPtr hwp, CARD8 value) { pci_io_write8(hwp->io, VGA_MISC_OUT_W, value); } static CARD8 stdReadMiscOut(vgaHWPtr hwp) { return pci_io_read8(hwp->io, VGA_MISC_OUT_R); } static void stdEnablePalette(vgaHWPtr hwp) { (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET); pci_io_write8(hwp->io, VGA_ATTR_INDEX, 0x00); hwp->paletteEnabled = TRUE; } static void stdDisablePalette(vgaHWPtr hwp) { (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET); pci_io_write8(hwp->io, VGA_ATTR_INDEX, 0x20); hwp->paletteEnabled = FALSE; } static void stdWriteDacMask(vgaHWPtr hwp, CARD8 value) { pci_io_write8(hwp->io, VGA_DAC_MASK, value); } static CARD8 stdReadDacMask(vgaHWPtr hwp) { return pci_io_read8(hwp->io, VGA_DAC_MASK); } static void stdWriteDacReadAddr(vgaHWPtr hwp, CARD8 value) { pci_io_write8(hwp->io, VGA_DAC_READ_ADDR, value); } static void stdWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value) { pci_io_write8(hwp->io, VGA_DAC_WRITE_ADDR, value); } static void stdWriteDacData(vgaHWPtr hwp, CARD8 value) { pci_io_write8(hwp->io, VGA_DAC_DATA, value); } static CARD8 stdReadDacData(vgaHWPtr hwp) { return pci_io_read8(hwp->io, VGA_DAC_DATA); } static CARD8 stdReadEnable(vgaHWPtr hwp) { return pci_io_read8(hwp->io, VGA_ENABLE); } static void stdWriteEnable(vgaHWPtr hwp, CARD8 value) { pci_io_write8(hwp->io, VGA_ENABLE, value); } void vgaHWSetStdFuncs(vgaHWPtr hwp) { hwp->writeCrtc = stdWriteCrtc; hwp->readCrtc = stdReadCrtc; hwp->writeGr = stdWriteGr; hwp->readGr = stdReadGr; hwp->readST00 = stdReadST00; hwp->readST01 = stdReadST01; hwp->readFCR = stdReadFCR; hwp->writeFCR = stdWriteFCR; hwp->writeAttr = stdWriteAttr; hwp->readAttr = stdReadAttr; hwp->writeSeq = stdWriteSeq; hwp->readSeq = stdReadSeq; hwp->writeMiscOut = stdWriteMiscOut; hwp->readMiscOut = stdReadMiscOut; hwp->enablePalette = stdEnablePalette; hwp->disablePalette = stdDisablePalette; hwp->writeDacMask = stdWriteDacMask; hwp->readDacMask = stdReadDacMask; hwp->writeDacWriteAddr = stdWriteDacWriteAddr; hwp->writeDacReadAddr = stdWriteDacReadAddr; hwp->writeDacData = stdWriteDacData; hwp->readDacData = stdReadDacData; hwp->readEnable = stdReadEnable; hwp->writeEnable = stdWriteEnable; hwp->io = pci_legacy_open_io(hwp->dev, 0, 64 * 1024); } /* * MMIO versions of the register access functions. These require * hwp->MemBase to be set in such a way that when the standard VGA port * adderss is added the correct memory address results. */ #define minb(p) MMIO_IN8(hwp->MMIOBase, (hwp->MMIOOffset + (p))) #define moutb(p,v) MMIO_OUT8(hwp->MMIOBase, (hwp->MMIOOffset + (p)),(v)) static void mmioWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value) { moutb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index); moutb(hwp->IOBase + VGA_CRTC_DATA_OFFSET, value); } static CARD8 mmioReadCrtc(vgaHWPtr hwp, CARD8 index) { moutb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index); return minb(hwp->IOBase + VGA_CRTC_DATA_OFFSET); } static void mmioWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value) { moutb(VGA_GRAPH_INDEX, index); moutb(VGA_GRAPH_DATA, value); } static CARD8 mmioReadGr(vgaHWPtr hwp, CARD8 index) { moutb(VGA_GRAPH_INDEX, index); return minb(VGA_GRAPH_DATA); } static void mmioWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value) { moutb(VGA_SEQ_INDEX, index); moutb(VGA_SEQ_DATA, value); } static CARD8 mmioReadSeq(vgaHWPtr hwp, CARD8 index) { moutb(VGA_SEQ_INDEX, index); return minb(VGA_SEQ_DATA); } static CARD8 mmioReadST00(vgaHWPtr hwp) { return minb(VGA_IN_STAT_0); } static CARD8 mmioReadST01(vgaHWPtr hwp) { return minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); } static CARD8 mmioReadFCR(vgaHWPtr hwp) { return minb(VGA_FEATURE_R); } static void mmioWriteFCR(vgaHWPtr hwp, CARD8 value) { moutb(hwp->IOBase + VGA_FEATURE_W_OFFSET, value); } static void mmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) { if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, index); moutb(VGA_ATTR_DATA_W, value); } static CARD8 mmioReadAttr(vgaHWPtr hwp, CARD8 index) { if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, index); return minb(VGA_ATTR_DATA_R); } static void mmioWriteMiscOut(vgaHWPtr hwp, CARD8 value) { moutb(VGA_MISC_OUT_W, value); } static CARD8 mmioReadMiscOut(vgaHWPtr hwp) { return minb(VGA_MISC_OUT_R); } static void mmioEnablePalette(vgaHWPtr hwp) { (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, 0x00); hwp->paletteEnabled = TRUE; } static void mmioDisablePalette(vgaHWPtr hwp) { (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, 0x20); hwp->paletteEnabled = FALSE; } static void mmioWriteDacMask(vgaHWPtr hwp, CARD8 value) { moutb(VGA_DAC_MASK, value); } static CARD8 mmioReadDacMask(vgaHWPtr hwp) { return minb(VGA_DAC_MASK); } static void mmioWriteDacReadAddr(vgaHWPtr hwp, CARD8 value) { moutb(VGA_DAC_READ_ADDR, value); } static void mmioWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value) { moutb(VGA_DAC_WRITE_ADDR, value); } static void mmioWriteDacData(vgaHWPtr hwp, CARD8 value) { moutb(VGA_DAC_DATA, value); } static CARD8 mmioReadDacData(vgaHWPtr hwp) { return minb(VGA_DAC_DATA); } static CARD8 mmioReadEnable(vgaHWPtr hwp) { return minb(VGA_ENABLE); } static void mmioWriteEnable(vgaHWPtr hwp, CARD8 value) { moutb(VGA_ENABLE, value); } void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset) { hwp->writeCrtc = mmioWriteCrtc; hwp->readCrtc = mmioReadCrtc; hwp->writeGr = mmioWriteGr; hwp->readGr = mmioReadGr; hwp->readST00 = mmioReadST00; hwp->readST01 = mmioReadST01; hwp->readFCR = mmioReadFCR; hwp->writeFCR = mmioWriteFCR; hwp->writeAttr = mmioWriteAttr; hwp->readAttr = mmioReadAttr; hwp->writeSeq = mmioWriteSeq; hwp->readSeq = mmioReadSeq; hwp->writeMiscOut = mmioWriteMiscOut; hwp->readMiscOut = mmioReadMiscOut; hwp->enablePalette = mmioEnablePalette; hwp->disablePalette = mmioDisablePalette; hwp->writeDacMask = mmioWriteDacMask; hwp->readDacMask = mmioReadDacMask; hwp->writeDacWriteAddr = mmioWriteDacWriteAddr; hwp->writeDacReadAddr = mmioWriteDacReadAddr; hwp->writeDacData = mmioWriteDacData; hwp->readDacData = mmioReadDacData; hwp->MMIOBase = base; hwp->MMIOOffset = offset; hwp->readEnable = mmioReadEnable; hwp->writeEnable = mmioWriteEnable; } /* * vgaHWProtect -- * Protect VGA registers and memory from corruption during loads. */ void vgaHWProtect(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); unsigned char tmp; if (pScrn->vtSema) { if (on) { /* * Turn off screen and disable sequencer. */ tmp = hwp->readSeq(hwp, 0x01); vgaHWSeqReset(hwp, TRUE); /* start synchronous reset */ hwp->writeSeq(hwp, 0x01, tmp | 0x20); /* disable the display */ hwp->enablePalette(hwp); } else { /* * Reenable sequencer, then turn on screen. */ tmp = hwp->readSeq(hwp, 0x01); hwp->writeSeq(hwp, 0x01, tmp & ~0x20); /* reenable display */ vgaHWSeqReset(hwp, FALSE); /* clear synchronousreset */ hwp->disablePalette(hwp); } } } vgaHWProtectProc * vgaHWProtectWeak(void) { return vgaHWProtect; } /* * vgaHWBlankScreen -- blank the screen. */ void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); unsigned char scrn; scrn = hwp->readSeq(hwp, 0x01); if (on) { scrn &= ~0x20; /* enable screen */ } else { scrn |= 0x20; /* blank screen */ } vgaHWSeqReset(hwp, TRUE); hwp->writeSeq(hwp, 0x01, scrn); /* change mode */ vgaHWSeqReset(hwp, FALSE); } vgaHWBlankScreenProc * vgaHWBlankScreenWeak(void) { return vgaHWBlankScreen; } /* * vgaHWSaveScreen -- blank the screen. */ Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = NULL; Bool on; if (pScreen != NULL) pScrn = xf86ScreenToScrn(pScreen); on = xf86IsUnblank(mode); #if 0 if (on) SetTimeSinceLastInputEvent(); #endif if ((pScrn != NULL) && pScrn->vtSema) { vgaHWBlankScreen(pScrn, on); } return TRUE; } /* * vgaHWDPMSSet -- Sets VESA Display Power Management Signaling (DPMS) Mode * * This generic VGA function can only set the Off and On modes. If the * Standby and Suspend modes are to be supported, a chip specific replacement * for this function must be written. */ void vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags) { unsigned char seq1 = 0, crtc17 = 0; vgaHWPtr hwp = VGAHWPTR(pScrn); if (!pScrn->vtSema) return; switch (PowerManagementMode) { case DPMSModeOn: /* Screen: On; HSync: On, VSync: On */ seq1 = 0x00; crtc17 = 0x80; break; case DPMSModeStandby: /* Screen: Off; HSync: Off, VSync: On -- Not Supported */ seq1 = 0x20; crtc17 = 0x80; break; case DPMSModeSuspend: /* Screen: Off; HSync: On, VSync: Off -- Not Supported */ seq1 = 0x20; crtc17 = 0x80; break; case DPMSModeOff: /* Screen: Off; HSync: Off, VSync: Off */ seq1 = 0x20; crtc17 = 0x00; break; } hwp->writeSeq(hwp, 0x00, 0x01); /* Synchronous Reset */ seq1 |= hwp->readSeq(hwp, 0x01) & ~0x20; hwp->writeSeq(hwp, 0x01, seq1); crtc17 |= hwp->readCrtc(hwp, 0x17) & ~0x80; usleep(10000); hwp->writeCrtc(hwp, 0x17, crtc17); hwp->writeSeq(hwp, 0x00, 0x03); /* End Reset */ } /* * vgaHWSeqReset * perform a sequencer reset. */ void vgaHWSeqReset(vgaHWPtr hwp, Bool start) { if (start) hwp->writeSeq(hwp, 0x00, 0x01); /* Synchronous Reset */ else hwp->writeSeq(hwp, 0x00, 0x03); /* End Reset */ } void vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore) { #if SAVE_TEXT || SAVE_FONT1 || SAVE_FONT2 vgaHWPtr hwp = VGAHWPTR(scrninfp); int savedIOBase; unsigned char miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4; Bool doMap = FALSE; /* If nothing to do, return now */ if (!hwp->FontInfo1 && !hwp->FontInfo2 && !hwp->TextInfo) return; if (hwp->Base == NULL) { doMap = TRUE; if (!vgaHWMapMem(scrninfp)) { xf86DrvMsg(scrninfp->scrnIndex, X_ERROR, "vgaHWRestoreFonts: vgaHWMapMem() failed\n"); return; } } /* save the registers that are needed here */ miscOut = hwp->readMiscOut(hwp); attr10 = hwp->readAttr(hwp, 0x10); gr1 = hwp->readGr(hwp, 0x01); gr3 = hwp->readGr(hwp, 0x03); gr4 = hwp->readGr(hwp, 0x04); gr5 = hwp->readGr(hwp, 0x05); gr6 = hwp->readGr(hwp, 0x06); gr8 = hwp->readGr(hwp, 0x08); seq2 = hwp->readSeq(hwp, 0x02); seq4 = hwp->readSeq(hwp, 0x04); /* save hwp->IOBase and temporarily set it for colour mode */ savedIOBase = hwp->IOBase; hwp->IOBase = VGA_IOBASE_COLOR; /* Force into colour mode */ hwp->writeMiscOut(hwp, miscOut | 0x01); vgaHWBlankScreen(scrninfp, FALSE); /* * here we temporarily switch to 16 colour planar mode, to simply * copy the font-info and saved text. * * BUG ALERT: The (S)VGA's segment-select register MUST be set correctly! */ #if 0 hwp->writeAttr(hwp, 0x10, 0x01); /* graphics mode */ #endif hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */ if (scrninfp->depth == 4) { /* GJA */ hwp->writeGr(hwp, 0x03, 0x00); /* don't rotate, write unmodified */ hwp->writeGr(hwp, 0x08, 0xFF); /* write all bits in a byte */ hwp->writeGr(hwp, 0x01, 0x00); /* all planes come from CPU */ } #if SAVE_FONT1 if (hwp->FontInfo1) { hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */ slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT); } #endif #if SAVE_FONT2 if (hwp->FontInfo2) { hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */ slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT); } #endif #if SAVE_TEXT if (hwp->TextInfo) { hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */ slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT); hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */ hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */ slowbcopy_tobus((unsigned char *) hwp->TextInfo + TEXT_AMOUNT, hwp->Base, TEXT_AMOUNT); } #endif vgaHWBlankScreen(scrninfp, TRUE); /* restore the registers that were changed */ hwp->writeMiscOut(hwp, miscOut); hwp->writeAttr(hwp, 0x10, attr10); hwp->writeGr(hwp, 0x01, gr1); hwp->writeGr(hwp, 0x03, gr3); hwp->writeGr(hwp, 0x04, gr4); hwp->writeGr(hwp, 0x05, gr5); hwp->writeGr(hwp, 0x06, gr6); hwp->writeGr(hwp, 0x08, gr8); hwp->writeSeq(hwp, 0x02, seq2); hwp->writeSeq(hwp, 0x04, seq4); hwp->IOBase = savedIOBase; if (doMap) vgaHWUnmapMem(scrninfp); #endif /* SAVE_TEXT || SAVE_FONT1 || SAVE_FONT2 */ } void vgaHWRestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore) { vgaHWPtr hwp = VGAHWPTR(scrninfp); int i; if (restore->MiscOutReg & 0x01) hwp->IOBase = VGA_IOBASE_COLOR; else hwp->IOBase = VGA_IOBASE_MONO; hwp->writeMiscOut(hwp, restore->MiscOutReg); for (i = 1; i < restore->numSequencer; i++) hwp->writeSeq(hwp, i, restore->Sequencer[i]); /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 of CRTC[17] */ hwp->writeCrtc(hwp, 17, restore->CRTC[17] & ~0x80); for (i = 0; i < restore->numCRTC; i++) hwp->writeCrtc(hwp, i, restore->CRTC[i]); for (i = 0; i < restore->numGraphics; i++) hwp->writeGr(hwp, i, restore->Graphics[i]); hwp->enablePalette(hwp); for (i = 0; i < restore->numAttribute; i++) hwp->writeAttr(hwp, i, restore->Attribute[i]); hwp->disablePalette(hwp); } void vgaHWRestoreColormap(ScrnInfoPtr scrninfp, vgaRegPtr restore) { vgaHWPtr hwp = VGAHWPTR(scrninfp); int i; #if 0 hwp->enablePalette(hwp); #endif hwp->writeDacMask(hwp, 0xFF); hwp->writeDacWriteAddr(hwp, 0x00); for (i = 0; i < 768; i++) { hwp->writeDacData(hwp, restore->DAC[i]); DACDelay(hwp); } hwp->disablePalette(hwp); } /* * vgaHWRestore -- * restore the VGA state */ void vgaHWRestore(ScrnInfoPtr scrninfp, vgaRegPtr restore, int flags) { if (flags & VGA_SR_MODE) vgaHWRestoreMode(scrninfp, restore); if (flags & VGA_SR_FONTS) vgaHWRestoreFonts(scrninfp, restore); if (flags & VGA_SR_CMAP) vgaHWRestoreColormap(scrninfp, restore); } void vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save) { #if SAVE_TEXT || SAVE_FONT1 || SAVE_FONT2 vgaHWPtr hwp = VGAHWPTR(scrninfp); int savedIOBase; unsigned char miscOut, attr10, gr4, gr5, gr6, seq2, seq4; Bool doMap = FALSE; if (hwp->Base == NULL) { doMap = TRUE; if (!vgaHWMapMem(scrninfp)) { xf86DrvMsg(scrninfp->scrnIndex, X_ERROR, "vgaHWSaveFonts: vgaHWMapMem() failed\n"); return; } } /* If in graphics mode, don't save anything */ attr10 = hwp->readAttr(hwp, 0x10); if (attr10 & 0x01) return; /* save the registers that are needed here */ miscOut = hwp->readMiscOut(hwp); gr4 = hwp->readGr(hwp, 0x04); gr5 = hwp->readGr(hwp, 0x05); gr6 = hwp->readGr(hwp, 0x06); seq2 = hwp->readSeq(hwp, 0x02); seq4 = hwp->readSeq(hwp, 0x04); /* save hwp->IOBase and temporarily set it for colour mode */ savedIOBase = hwp->IOBase; hwp->IOBase = VGA_IOBASE_COLOR; /* Force into colour mode */ hwp->writeMiscOut(hwp, miscOut | 0x01); vgaHWBlankScreen(scrninfp, FALSE); /* * get the character sets, and text screen if required */ /* * Here we temporarily switch to 16 colour planar mode, to simply * copy the font-info * * BUG ALERT: The (S)VGA's segment-select register MUST be set correctly! */ #if 0 hwp->writeAttr(hwp, 0x10, 0x01); /* graphics mode */ #endif hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */ #if SAVE_FONT1 if (hwp->FontInfo1 || (hwp->FontInfo1 = malloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */ slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT); } #endif /* SAVE_FONT1 */ #if SAVE_FONT2 if (hwp->FontInfo2 || (hwp->FontInfo2 = malloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */ slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT); } #endif /* SAVE_FONT2 */ #if SAVE_TEXT if (hwp->TextInfo || (hwp->TextInfo = malloc(2 * TEXT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */ slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT); hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */ hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */ slowbcopy_frombus(hwp->Base, (unsigned char *) hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT); } #endif /* SAVE_TEXT */ /* Restore clobbered registers */ hwp->writeAttr(hwp, 0x10, attr10); hwp->writeSeq(hwp, 0x02, seq2); hwp->writeSeq(hwp, 0x04, seq4); hwp->writeGr(hwp, 0x04, gr4); hwp->writeGr(hwp, 0x05, gr5); hwp->writeGr(hwp, 0x06, gr6); hwp->writeMiscOut(hwp, miscOut); hwp->IOBase = savedIOBase; vgaHWBlankScreen(scrninfp, TRUE); if (doMap) vgaHWUnmapMem(scrninfp); #endif /* SAVE_TEXT || SAVE_FONT1 || SAVE_FONT2 */ } void vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save) { vgaHWPtr hwp = VGAHWPTR(scrninfp); int i; save->MiscOutReg = hwp->readMiscOut(hwp); if (save->MiscOutReg & 0x01) hwp->IOBase = VGA_IOBASE_COLOR; else hwp->IOBase = VGA_IOBASE_MONO; for (i = 0; i < save->numCRTC; i++) { save->CRTC[i] = hwp->readCrtc(hwp, i); DebugF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]); } hwp->enablePalette(hwp); for (i = 0; i < save->numAttribute; i++) { save->Attribute[i] = hwp->readAttr(hwp, i); DebugF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]); } hwp->disablePalette(hwp); for (i = 0; i < save->numGraphics; i++) { save->Graphics[i] = hwp->readGr(hwp, i); DebugF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]); } for (i = 1; i < save->numSequencer; i++) { save->Sequencer[i] = hwp->readSeq(hwp, i); DebugF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]); } } void vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save) { vgaHWPtr hwp = VGAHWPTR(scrninfp); Bool readError = FALSE; int i; #ifdef NEED_SAVED_CMAP /* * Some ET4000 chips from 1991 have a HW bug that prevents the reading * of the color lookup table. Mask rev 9042EAI is known to have this bug. * * If the colourmap is not readable, we set the saved map to a default * map (taken from Ferraro's "Programmer's Guide to the EGA and VGA * Cards" 2nd ed). */ /* Only save it once */ if (hwp->cmapSaved) return; #if 0 hwp->enablePalette(hwp); #endif hwp->writeDacMask(hwp, 0xFF); /* * check if we can read the lookup table */ hwp->writeDacReadAddr(hwp, 0x00); for (i = 0; i < 6; i++) { save->DAC[i] = hwp->readDacData(hwp); switch (i % 3) { case 0: DebugF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]); break; case 1: DebugF("0x%02x, ", save->DAC[i]); break; case 2: DebugF("0x%02x\n", save->DAC[i]); } } /* * Check if we can read the palette - * use foreground color to prevent flashing. */ hwp->writeDacWriteAddr(hwp, 0x01); for (i = 3; i < 6; i++) hwp->writeDacData(hwp, ~save->DAC[i] & DAC_TEST_MASK); hwp->writeDacReadAddr(hwp, 0x01); for (i = 3; i < 6; i++) { if (hwp->readDacData(hwp) != (~save->DAC[i] & DAC_TEST_MASK)) readError = TRUE; } hwp->writeDacWriteAddr(hwp, 0x01); for (i = 3; i < 6; i++) hwp->writeDacData(hwp, save->DAC[i]); if (readError) { /* * save the default lookup table */ memmove(save->DAC, defaultDAC, 768); xf86DrvMsg(scrninfp->scrnIndex, X_WARNING, "Cannot read colourmap from VGA. Will restore with default\n"); } else { /* save the colourmap */ hwp->writeDacReadAddr(hwp, 0x02); for (i = 6; i < 768; i++) { save->DAC[i] = hwp->readDacData(hwp); DACDelay(hwp); switch (i % 3) { case 0: DebugF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]); break; case 1: DebugF("0x%02x, ", save->DAC[i]); break; case 2: DebugF("0x%02x\n", save->DAC[i]); } } } hwp->disablePalette(hwp); hwp->cmapSaved = TRUE; #endif } /* * vgaHWSave -- * save the current VGA state */ void vgaHWSave(ScrnInfoPtr scrninfp, vgaRegPtr save, int flags) { if (save == NULL) return; if (flags & VGA_SR_CMAP) vgaHWSaveColormap(scrninfp, save); if (flags & VGA_SR_MODE) vgaHWSaveMode(scrninfp, save); if (flags & VGA_SR_FONTS) vgaHWSaveFonts(scrninfp, save); } /* * vgaHWInit -- * Handle the initialization, etc. of a screen. * Return FALSE on failure. */ Bool vgaHWInit(ScrnInfoPtr scrninfp, DisplayModePtr mode) { unsigned int i; vgaHWPtr hwp; vgaRegPtr regp; int depth = scrninfp->depth; /* * make sure the vgaHWRec is allocated */ if (!vgaHWGetHWRec(scrninfp)) return FALSE; hwp = VGAHWPTR(scrninfp); regp = &hwp->ModeReg; /* * compute correct Hsync & Vsync polarity */ if ((mode->Flags & (V_PHSYNC | V_NHSYNC)) && (mode->Flags & (V_PVSYNC | V_NVSYNC))) { regp->MiscOutReg = 0x23; if (mode->Flags & V_NHSYNC) regp->MiscOutReg |= 0x40; if (mode->Flags & V_NVSYNC) regp->MiscOutReg |= 0x80; } else { int VDisplay = mode->VDisplay; if (mode->Flags & V_DBLSCAN) VDisplay *= 2; if (mode->VScan > 1) VDisplay *= mode->VScan; if (VDisplay < 400) regp->MiscOutReg = 0xA3; /* +hsync -vsync */ else if (VDisplay < 480) regp->MiscOutReg = 0x63; /* -hsync +vsync */ else if (VDisplay < 768) regp->MiscOutReg = 0xE3; /* -hsync -vsync */ else regp->MiscOutReg = 0x23; /* +hsync +vsync */ } regp->MiscOutReg |= (mode->ClockIndex & 0x03) << 2; /* * Time Sequencer */ if (depth == 4) regp->Sequencer[0] = 0x02; else regp->Sequencer[0] = 0x00; if (mode->Flags & V_CLKDIV2) regp->Sequencer[1] = 0x09; else regp->Sequencer[1] = 0x01; if (depth == 1) regp->Sequencer[2] = 1 << BIT_PLANE; else regp->Sequencer[2] = 0x0F; regp->Sequencer[3] = 0x00; /* Font select */ if (depth < 8) regp->Sequencer[4] = 0x06; /* Misc */ else regp->Sequencer[4] = 0x0E; /* Misc */ /* * CRTC Controller */ regp->CRTC[0] = (mode->CrtcHTotal >> 3) - 5; regp->CRTC[1] = (mode->CrtcHDisplay >> 3) - 1; regp->CRTC[2] = (mode->CrtcHBlankStart >> 3) - 1; regp->CRTC[3] = (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F) | 0x80; i = (((mode->CrtcHSkew << 2) + 0x10) & ~0x1F); if (i < 0x80) regp->CRTC[3] |= i; regp->CRTC[4] = (mode->CrtcHSyncStart >> 3); regp->CRTC[5] = ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2) | (((mode->CrtcHSyncEnd >> 3)) & 0x1F); regp->CRTC[6] = (mode->CrtcVTotal - 2) & 0xFF; regp->CRTC[7] = (((mode->CrtcVTotal - 2) & 0x100) >> 8) | (((mode->CrtcVDisplay - 1) & 0x100) >> 7) | ((mode->CrtcVSyncStart & 0x100) >> 6) | (((mode->CrtcVBlankStart - 1) & 0x100) >> 5) | 0x10 | (((mode->CrtcVTotal - 2) & 0x200) >> 4) | (((mode->CrtcVDisplay - 1) & 0x200) >> 3) | ((mode->CrtcVSyncStart & 0x200) >> 2); regp->CRTC[8] = 0x00; regp->CRTC[9] = (((mode->CrtcVBlankStart - 1) & 0x200) >> 4) | 0x40; if (mode->Flags & V_DBLSCAN) regp->CRTC[9] |= 0x80; if (mode->VScan >= 32) regp->CRTC[9] |= 0x1F; else if (mode->VScan > 1) regp->CRTC[9] |= mode->VScan - 1; regp->CRTC[10] = 0x00; regp->CRTC[11] = 0x00; regp->CRTC[12] = 0x00; regp->CRTC[13] = 0x00; regp->CRTC[14] = 0x00; regp->CRTC[15] = 0x00; regp->CRTC[16] = mode->CrtcVSyncStart & 0xFF; regp->CRTC[17] = (mode->CrtcVSyncEnd & 0x0F) | 0x20; regp->CRTC[18] = (mode->CrtcVDisplay - 1) & 0xFF; regp->CRTC[19] = scrninfp->displayWidth >> 4; /* just a guess */ regp->CRTC[20] = 0x00; regp->CRTC[21] = (mode->CrtcVBlankStart - 1) & 0xFF; regp->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF; if (depth < 8) regp->CRTC[23] = 0xE3; else regp->CRTC[23] = 0xC3; regp->CRTC[24] = 0xFF; vgaHWHBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO); vgaHWVBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO); /* * Theory resumes here.... */ /* * Graphics Display Controller */ regp->Graphics[0] = 0x00; regp->Graphics[1] = 0x00; regp->Graphics[2] = 0x00; regp->Graphics[3] = 0x00; if (depth == 1) { regp->Graphics[4] = BIT_PLANE; regp->Graphics[5] = 0x00; } else { regp->Graphics[4] = 0x00; if (depth == 4) regp->Graphics[5] = 0x02; else regp->Graphics[5] = 0x40; } regp->Graphics[6] = 0x05; /* only map 64k VGA memory !!!! */ regp->Graphics[7] = 0x0F; regp->Graphics[8] = 0xFF; if (depth == 1) { /* Initialise the Mono map according to which bit-plane gets used */ Bool flipPixels = xf86GetFlipPixels(); for (i = 0; i < 16; i++) if (((i & (1 << BIT_PLANE)) != 0) != flipPixels) regp->Attribute[i] = WHITE_VALUE; else regp->Attribute[i] = BLACK_VALUE; regp->Attribute[16] = 0x01; /* -VGA2- *//* wrong for the ET4000 */ if (!hwp->ShowOverscan) regp->Attribute[OVERSCAN] = OVERSCAN_VALUE; /* -VGA2- */ } else { regp->Attribute[0] = 0x00; /* standard colormap translation */ regp->Attribute[1] = 0x01; regp->Attribute[2] = 0x02; regp->Attribute[3] = 0x03; regp->Attribute[4] = 0x04; regp->Attribute[5] = 0x05; regp->Attribute[6] = 0x06; regp->Attribute[7] = 0x07; regp->Attribute[8] = 0x08; regp->Attribute[9] = 0x09; regp->Attribute[10] = 0x0A; regp->Attribute[11] = 0x0B; regp->Attribute[12] = 0x0C; regp->Attribute[13] = 0x0D; regp->Attribute[14] = 0x0E; regp->Attribute[15] = 0x0F; if (depth == 4) regp->Attribute[16] = 0x81; /* wrong for the ET4000 */ else regp->Attribute[16] = 0x41; /* wrong for the ET4000 */ /* Attribute[17] (overscan) initialised in vgaHWGetHWRec() */ } regp->Attribute[18] = 0x0F; regp->Attribute[19] = 0x00; regp->Attribute[20] = 0x00; return TRUE; } /* * OK, so much for theory. Now, let's deal with the >real< world... * * The above CRTC settings are precise in theory, except that many, if not * most, VGA clones fail to reset the blanking signal when the character or * line counter reaches [HV]Total. In this case, the signal is only * unblanked when the counter reaches [HV]BlankEnd (mod 64, 128 or 256 as * the case may be) at the start of the >next< scanline or frame, which * means only part of the screen shows. This affects how null overscans * are to be implemented on such adapters. * * Henceforth, VGA cores that implement this broken, but unfortunately * common, behaviour are to be designated as KGA's, in honour of Koen * Gadeyne, whose zeal to eliminate overscans (read: fury) set in motion * a series of events that led to the discovery of this problem. * * Some VGA's are KGA's only in the horizontal, or only in the vertical, * some in both, others in neither. Don't let anyone tell you there is * such a thing as a VGA "standard"... And, thank the Creator for the fact * that Hilbert spaces are not yet implemented in this industry. * * The following implements a trick suggested by David Dawes. This sets * [HV]BlankEnd to zero if the blanking interval does not already contain a * 0-point, and decrements it by one otherwise. In the latter case, this * will produce a left and/or top overscan which the colourmap code will * (still) need to ensure is as close to black as possible. This will make * the behaviour consistent across all chipsets, while allowing all * chipsets to display the entire screen. Non-KGA drivers can ignore the * following in their own copy of this code. * * -- TSI @ UQV, 1998.08.21 */ CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags) { int nExtBits = (nBits < 6) ? 0 : nBits - 6; CARD32 ExtBits; CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 6; regp->CRTC[3] = (regp->CRTC[3] & ~0x1F) | (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F); regp->CRTC[5] = (regp->CRTC[5] & ~0x80) | ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2); ExtBits = ((mode->CrtcHBlankEnd >> 3) - 1) & ExtBitMask; /* First the horizontal case */ if ((Flags & KGA_FIX_OVERSCAN) && ((mode->CrtcHBlankEnd >> 3) == (mode->CrtcHTotal >> 3))) { int i = (regp->CRTC[3] & 0x1F) | ((regp->CRTC[5] & 0x80) >> 2) | ExtBits; if (Flags & KGA_ENABLE_ON_ZERO) { if ((i-- > (((mode->CrtcHBlankStart >> 3) - 1) & (0x3F | ExtBitMask))) && (mode->CrtcHBlankEnd == mode->CrtcHTotal)) i = 0; } else if (Flags & KGA_BE_TOT_DEC) i--; regp->CRTC[3] = (regp->CRTC[3] & ~0x1F) | (i & 0x1F); regp->CRTC[5] = (regp->CRTC[5] & ~0x80) | ((i << 2) & 0x80); ExtBits = i & ExtBitMask; } return ExtBits >> 6; } /* * The vertical case is a little trickier. Some VGA's ignore bit 0x80 of * CRTC[22]. Also, in some cases, a zero CRTC[22] will still blank the * very first scanline in a double- or multi-scanned mode. This last case * needs further investigation. */ CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags) { CARD32 ExtBits; CARD32 nExtBits = (nBits < 8) ? 0 : (nBits - 8); CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 8; /* If width is not known nBits should be 0. In this * case BitMask is set to 0 so we can check for it. */ CARD32 BitMask = (nBits < 7) ? 0 : ((1 << nExtBits) - 1); int VBlankStart = (mode->CrtcVBlankStart - 1) & 0xFF; regp->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF; ExtBits = (mode->CrtcVBlankEnd - 1) & ExtBitMask; if ((Flags & KGA_FIX_OVERSCAN) && (mode->CrtcVBlankEnd == mode->CrtcVTotal)) /* Null top overscan */ { int i = regp->CRTC[22] | ExtBits; if (Flags & KGA_ENABLE_ON_ZERO) { if (((BitMask && ((i & BitMask) > (VBlankStart & BitMask))) || ((i > VBlankStart) && /* 8-bit case */ ((i & 0x7F) > (VBlankStart & 0x7F)))) && /* 7-bit case */ !(regp->CRTC[9] & 0x9F)) /* 1 scanline/row */ i = 0; else i = (i - 1); } else if (Flags & KGA_BE_TOT_DEC) i = (i - 1); regp->CRTC[22] = i & 0xFF; ExtBits = i & 0xFF00; } return ExtBits >> 8; } /* * these are some more hardware specific helpers, formerly in vga.c */ static void vgaHWGetHWRecPrivate(void) { if (vgaHWPrivateIndex < 0) vgaHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); return; } static void vgaHWFreeRegs(vgaRegPtr regp) { free(regp->CRTC); regp->CRTC = regp->Sequencer = regp->Graphics = regp->Attribute = NULL; regp->numCRTC = regp->numSequencer = regp->numGraphics = regp->numAttribute = 0; } static Bool vgaHWAllocRegs(vgaRegPtr regp) { unsigned char *buf; if ((regp->numCRTC + regp->numSequencer + regp->numGraphics + regp->numAttribute) == 0) return FALSE; buf = calloc(regp->numCRTC + regp->numSequencer + regp->numGraphics + regp->numAttribute, 1); if (!buf) return FALSE; regp->CRTC = buf; regp->Sequencer = regp->CRTC + regp->numCRTC; regp->Graphics = regp->Sequencer + regp->numSequencer; regp->Attribute = regp->Graphics + regp->numGraphics; return TRUE; } Bool vgaHWAllocDefaultRegs(vgaRegPtr regp) { regp->numCRTC = VGA_NUM_CRTC; regp->numSequencer = VGA_NUM_SEQ; regp->numGraphics = VGA_NUM_GFX; regp->numAttribute = VGA_NUM_ATTR; return vgaHWAllocRegs(regp); } Bool vgaHWSetRegCounts(ScrnInfoPtr scrp, int numCRTC, int numSequencer, int numGraphics, int numAttribute) { #define VGAHWMINNUM(regtype) \ ((newMode.num##regtype < regp->num##regtype) ? \ (newMode.num##regtype) : (regp->num##regtype)) #define VGAHWCOPYREGSET(regtype) \ memcpy (newMode.regtype, regp->regtype, VGAHWMINNUM(regtype)) vgaRegRec newMode, newSaved; vgaRegPtr regp; regp = &VGAHWPTR(scrp)->ModeReg; memcpy(&newMode, regp, sizeof(vgaRegRec)); /* allocate space for new registers */ regp = &newMode; regp->numCRTC = numCRTC; regp->numSequencer = numSequencer; regp->numGraphics = numGraphics; regp->numAttribute = numAttribute; if (!vgaHWAllocRegs(regp)) return FALSE; regp = &VGAHWPTR(scrp)->SavedReg; memcpy(&newSaved, regp, sizeof(vgaRegRec)); regp = &newSaved; regp->numCRTC = numCRTC; regp->numSequencer = numSequencer; regp->numGraphics = numGraphics; regp->numAttribute = numAttribute; if (!vgaHWAllocRegs(regp)) { vgaHWFreeRegs(&newMode); return FALSE; } /* allocations succeeded, copy register data into new space */ regp = &VGAHWPTR(scrp)->ModeReg; VGAHWCOPYREGSET(CRTC); VGAHWCOPYREGSET(Sequencer); VGAHWCOPYREGSET(Graphics); VGAHWCOPYREGSET(Attribute); regp = &VGAHWPTR(scrp)->SavedReg; VGAHWCOPYREGSET(CRTC); VGAHWCOPYREGSET(Sequencer); VGAHWCOPYREGSET(Graphics); VGAHWCOPYREGSET(Attribute); /* free old register arrays */ regp = &VGAHWPTR(scrp)->ModeReg; vgaHWFreeRegs(regp); memcpy(regp, &newMode, sizeof(vgaRegRec)); regp = &VGAHWPTR(scrp)->SavedReg; vgaHWFreeRegs(regp); memcpy(regp, &newSaved, sizeof(vgaRegRec)); return TRUE; #undef VGAHWMINNUM #undef VGAHWCOPYREGSET } Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src) { vgaHWFreeRegs(dst); memcpy(dst, src, sizeof(vgaRegRec)); if (!vgaHWAllocRegs(dst)) return FALSE; memcpy(dst->CRTC, src->CRTC, src->numCRTC); memcpy(dst->Sequencer, src->Sequencer, src->numSequencer); memcpy(dst->Graphics, src->Graphics, src->numGraphics); memcpy(dst->Attribute, src->Attribute, src->numAttribute); return TRUE; } Bool vgaHWGetHWRec(ScrnInfoPtr scrp) { vgaRegPtr regp; vgaHWPtr hwp; int i; /* * Let's make sure that the private exists and allocate one. */ vgaHWGetHWRecPrivate(); /* * New privates are always set to NULL, so we can check if the allocation * has already been done. */ if (VGAHWPTR(scrp)) return TRUE; hwp = VGAHWPTRLVAL(scrp) = xnfcalloc(sizeof(vgaHWRec), 1); regp = &VGAHWPTR(scrp)->ModeReg; if ((!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->SavedReg)) || (!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->ModeReg))) { free(hwp); return FALSE; } if (scrp->bitsPerPixel == 1) { rgb blackColour = scrp->display->blackColour, whiteColour = scrp->display->whiteColour; if (blackColour.red > 0x3F) blackColour.red = 0x3F; if (blackColour.green > 0x3F) blackColour.green = 0x3F; if (blackColour.blue > 0x3F) blackColour.blue = 0x3F; if (whiteColour.red > 0x3F) whiteColour.red = 0x3F; if (whiteColour.green > 0x3F) whiteColour.green = 0x3F; if (whiteColour.blue > 0x3F) whiteColour.blue = 0x3F; if ((blackColour.red == whiteColour.red) && (blackColour.green == whiteColour.green) && (blackColour.blue == whiteColour.blue)) { blackColour.red ^= 0x3F; blackColour.green ^= 0x3F; blackColour.blue ^= 0x3F; } /* * initialize default colormap for monochrome */ for (i = 0; i < 3; i++) regp->DAC[i] = 0x00; for (i = 3; i < 768; i++) regp->DAC[i] = 0x3F; i = BLACK_VALUE * 3; regp->DAC[i++] = blackColour.red; regp->DAC[i++] = blackColour.green; regp->DAC[i] = blackColour.blue; i = WHITE_VALUE * 3; regp->DAC[i++] = whiteColour.red; regp->DAC[i++] = whiteColour.green; regp->DAC[i] = whiteColour.blue; i = OVERSCAN_VALUE * 3; regp->DAC[i++] = 0x00; regp->DAC[i++] = 0x00; regp->DAC[i] = 0x00; } else { /* Set all colours to black */ for (i = 0; i < 768; i++) regp->DAC[i] = 0x00; /* ... and the overscan */ if (scrp->depth >= 4) regp->Attribute[OVERSCAN] = 0xFF; } if (xf86FindOption(scrp->confScreen->options, "ShowOverscan")) { xf86MarkOptionUsedByName(scrp->confScreen->options, "ShowOverscan"); xf86DrvMsg(scrp->scrnIndex, X_CONFIG, "Showing overscan area\n"); regp->DAC[765] = 0x3F; regp->DAC[766] = 0x00; regp->DAC[767] = 0x3F; regp->Attribute[OVERSCAN] = 0xFF; hwp->ShowOverscan = TRUE; } else hwp->ShowOverscan = FALSE; hwp->paletteEnabled = FALSE; hwp->cmapSaved = FALSE; hwp->MapSize = 0; hwp->pScrn = scrp; hwp->dev = xf86GetPciInfoForEntity(scrp->entityList[0]); return TRUE; } void vgaHWFreeHWRec(ScrnInfoPtr scrp) { if (vgaHWPrivateIndex >= 0) { vgaHWPtr hwp = VGAHWPTR(scrp); if (!hwp) return; pci_device_close_io(hwp->dev, hwp->io); free(hwp->FontInfo1); free(hwp->FontInfo2); free(hwp->TextInfo); vgaHWFreeRegs(&hwp->ModeReg); vgaHWFreeRegs(&hwp->SavedReg); free(hwp); VGAHWPTRLVAL(scrp) = NULL; } } Bool vgaHWMapMem(ScrnInfoPtr scrp) { vgaHWPtr hwp = VGAHWPTR(scrp); if (hwp->Base) return TRUE; /* If not set, initialise with the defaults */ if (hwp->MapSize == 0) hwp->MapSize = VGA_DEFAULT_MEM_SIZE; if (hwp->MapPhys == 0) hwp->MapPhys = VGA_DEFAULT_PHYS_ADDR; /* * Map as VIDMEM_MMIO_32BIT because WC * is bad when there is page flipping. * XXX This is not correct but we do it * for now. */ DebugF("Mapping VGAMem\n"); pci_device_map_legacy(hwp->dev, hwp->MapPhys, hwp->MapSize, PCI_DEV_MAP_FLAG_WRITABLE, &hwp->Base); return hwp->Base != NULL; } void vgaHWUnmapMem(ScrnInfoPtr scrp) { vgaHWPtr hwp = VGAHWPTR(scrp); if (hwp->Base == NULL) return; DebugF("Unmapping VGAMem\n"); pci_device_unmap_legacy(hwp->dev, hwp->Base, hwp->MapSize); hwp->Base = NULL; } int vgaHWGetIndex(void) { return vgaHWPrivateIndex; } void vgaHWGetIOBase(vgaHWPtr hwp) { hwp->IOBase = (hwp->readMiscOut(hwp) & 0x01) ? VGA_IOBASE_COLOR : VGA_IOBASE_MONO; xf86DrvMsgVerb(hwp->pScrn->scrnIndex, X_INFO, 3, "vgaHWGetIOBase: hwp->IOBase is 0x%04x\n", hwp->IOBase); } void vgaHWLock(vgaHWPtr hwp) { /* Protect CRTC[0-7] */ hwp->writeCrtc(hwp, 0x11, hwp->readCrtc(hwp, 0x11) | 0x80); } void vgaHWUnlock(vgaHWPtr hwp) { /* Unprotect CRTC[0-7] */ hwp->writeCrtc(hwp, 0x11, hwp->readCrtc(hwp, 0x11) & ~0x80); } void vgaHWEnable(vgaHWPtr hwp) { hwp->writeEnable(hwp, hwp->readEnable(hwp) | 0x01); } void vgaHWDisable(vgaHWPtr hwp) { hwp->writeEnable(hwp, hwp->readEnable(hwp) & ~0x01); } static void vgaHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { vgaHWPtr hwp = VGAHWPTR(pScrn); int i, index; for (i = 0; i < numColors; i++) { index = indices[i]; hwp->writeDacWriteAddr(hwp, index); DACDelay(hwp); hwp->writeDacData(hwp, colors[index].red); DACDelay(hwp); hwp->writeDacData(hwp, colors[index].green); DACDelay(hwp); hwp->writeDacData(hwp, colors[index].blue); DACDelay(hwp); } /* This shouldn't be necessary, but we'll play safe. */ hwp->disablePalette(hwp); } static void vgaHWSetOverscan(ScrnInfoPtr pScrn, int overscan) { vgaHWPtr hwp = VGAHWPTR(pScrn); if (overscan < 0 || overscan > 255) return; hwp->enablePalette(hwp); hwp->writeAttr(hwp, OVERSCAN, overscan); #ifdef DEBUGOVERSCAN { int ov = hwp->readAttr(hwp, OVERSCAN); int red, green, blue; hwp->writeDacReadAddr(hwp, ov); red = hwp->readDacData(hwp); green = hwp->readDacData(hwp); blue = hwp->readDacData(hwp); ErrorF("Overscan index is 0x%02x, colours are #%02x%02x%02x\n", ov, red, green, blue); } #endif hwp->disablePalette(hwp); } Bool vgaHWHandleColormaps(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->depth > 1 && pScrn->depth <= 8) { return xf86HandleColormaps(pScreen, 1 << pScrn->depth, pScrn->rgbBits, vgaHWLoadPalette, pScrn->depth > 4 ? vgaHWSetOverscan : NULL, CMAP_RELOAD_ON_MODE_SWITCH); } return TRUE; } /* ----------------------- DDC support ------------------------*/ /* * Adjust v_active, v_blank, v_sync, v_sync_end, v_blank_end, v_total * to read out EDID at a faster rate. Allowed maximum is 25kHz with * 20 usec v_sync active. Set positive v_sync polarity, turn off lightpen * readback, enable access to cr00-cr07. */ /* vertical timings */ #define DISPLAY_END 0x04 #define BLANK_START DISPLAY_END #define SYNC_START BLANK_START #define SYNC_END 0x09 #define BLANK_END SYNC_END #define V_TOTAL BLANK_END /* this function doesn't have to be reentrant for our purposes */ struct _vgaDdcSave { unsigned char cr03; unsigned char cr06; unsigned char cr07; unsigned char cr09; unsigned char cr10; unsigned char cr11; unsigned char cr12; unsigned char cr15; unsigned char cr16; unsigned char msr; }; void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed) { vgaHWPtr hwp = VGAHWPTR(pScrn); unsigned char tmp; struct _vgaDdcSave *save; switch (speed) { case DDC_FAST: if (hwp->ddc != NULL) break; hwp->ddc = xnfcalloc(sizeof(struct _vgaDdcSave), 1); save = (struct _vgaDdcSave *) hwp->ddc; /* Lightpen register disable - allow access to cr10 & 11; just in case */ save->cr03 = hwp->readCrtc(hwp, 0x03); hwp->writeCrtc(hwp, 0x03, (save->cr03 | 0x80)); save->cr12 = hwp->readCrtc(hwp, 0x12); hwp->writeCrtc(hwp, 0x12, DISPLAY_END); save->cr15 = hwp->readCrtc(hwp, 0x15); hwp->writeCrtc(hwp, 0x15, BLANK_START); save->cr10 = hwp->readCrtc(hwp, 0x10); hwp->writeCrtc(hwp, 0x10, SYNC_START); save->cr11 = hwp->readCrtc(hwp, 0x11); /* unprotect group 1 registers; just in case ... */ hwp->writeCrtc(hwp, 0x11, ((save->cr11 & 0x70) | SYNC_END)); save->cr16 = hwp->readCrtc(hwp, 0x16); hwp->writeCrtc(hwp, 0x16, BLANK_END); save->cr06 = hwp->readCrtc(hwp, 0x06); hwp->writeCrtc(hwp, 0x06, V_TOTAL); /* all values have less than 8 bit - mask out 9th and 10th bits */ save->cr09 = hwp->readCrtc(hwp, 0x09); hwp->writeCrtc(hwp, 0x09, (save->cr09 & 0xDF)); save->cr07 = hwp->readCrtc(hwp, 0x07); hwp->writeCrtc(hwp, 0x07, (save->cr07 & 0x10)); /* vsync polarity negativ & ensure a 25MHz clock */ save->msr = hwp->readMiscOut(hwp); hwp->writeMiscOut(hwp, ((save->msr & 0xF3) | 0x80)); break; case DDC_SLOW: if (hwp->ddc == NULL) break; save = (struct _vgaDdcSave *) hwp->ddc; hwp->writeMiscOut(hwp, save->msr); hwp->writeCrtc(hwp, 0x07, save->cr07); tmp = hwp->readCrtc(hwp, 0x09); hwp->writeCrtc(hwp, 0x09, ((save->cr09 & 0x20) | (tmp & 0xDF))); hwp->writeCrtc(hwp, 0x06, save->cr06); hwp->writeCrtc(hwp, 0x16, save->cr16); hwp->writeCrtc(hwp, 0x11, save->cr11); hwp->writeCrtc(hwp, 0x10, save->cr10); hwp->writeCrtc(hwp, 0x15, save->cr15); hwp->writeCrtc(hwp, 0x12, save->cr12); hwp->writeCrtc(hwp, 0x03, save->cr03); free(save); hwp->ddc = NULL; break; default: break; } } DDC1SetSpeedProc vgaHWddc1SetSpeedWeak(void) { return vgaHWddc1SetSpeed; } SaveScreenProcPtr vgaHWSaveScreenWeak(void) { return vgaHWSaveScreen; } /* * xf86GetClocks -- get the dot-clocks via a BIG BAD hack ... */ void xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc) (ScrnInfoPtr, int), void (*ProtectRegs) (ScrnInfoPtr, Bool), void (*BlankScreen) (ScrnInfoPtr, Bool), unsigned long vertsyncreg, int maskval, int knownclkindex, int knownclkvalue) { register int status = vertsyncreg; unsigned long i, cnt, rcnt, sync; vgaHWPtr hwp = VGAHWPTR(pScrn); /* First save registers that get written on */ (*ClockFunc) (pScrn, CLK_REG_SAVE); if (num > MAXCLOCKS) num = MAXCLOCKS; for (i = 0; i < num; i++) { if (ProtectRegs) (*ProtectRegs) (pScrn, TRUE); if (!(*ClockFunc) (pScrn, i)) { pScrn->clock[i] = -1; continue; } if (ProtectRegs) (*ProtectRegs) (pScrn, FALSE); if (BlankScreen) (*BlankScreen) (pScrn, FALSE); usleep(50000); /* let VCO stabilise */ cnt = 0; sync = 200000; while ((pci_io_read8(hwp->io, status) & maskval) == 0x00) if (sync-- == 0) goto finish; /* Something appears to be happening, so reset sync count */ sync = 200000; while ((pci_io_read8(hwp->io, status) & maskval) == maskval) if (sync-- == 0) goto finish; /* Something appears to be happening, so reset sync count */ sync = 200000; while ((pci_io_read8(hwp->io, status) & maskval) == 0x00) if (sync-- == 0) goto finish; for (rcnt = 0; rcnt < 5; rcnt++) { while (!(pci_io_read8(hwp->io, status) & maskval)) cnt++; while ((pci_io_read8(hwp->io, status) & maskval)) cnt++; } finish: pScrn->clock[i] = cnt ? cnt : -1; if (BlankScreen) (*BlankScreen) (pScrn, TRUE); } for (i = 0; i < num; i++) { if (i != knownclkindex) { if (pScrn->clock[i] == -1) { pScrn->clock[i] = 0; } else { pScrn->clock[i] = (int) (0.5 + (((float) knownclkvalue) * pScrn->clock[knownclkindex]) / (pScrn->clock[i])); /* Round to nearest 10KHz */ pScrn->clock[i] += 5; pScrn->clock[i] /= 10; pScrn->clock[i] *= 10; } } } pScrn->clock[knownclkindex] = knownclkvalue; pScrn->numClocks = num; /* Restore registers that were written on */ (*ClockFunc) (pScrn, CLK_REG_RESTORE); } xorg-server-1.17.1/hw/xfree86/ddc/0000775000175100017510000000000012466505444013542 500000000000000xorg-server-1.17.1/hw/xfree86/ddc/Makefile.am0000664000175100017510000000036712200102654015502 00000000000000sdk_HEADERS = edid.h xf86DDC.h noinst_LTLIBRARIES = libddc.la libddc_la_SOURCES = ddc.c interpret_edid.c print_edid.c ddcProperty.c AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../i2c AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = DDC.HOWTO xorg-server-1.17.1/hw/xfree86/ddc/print_edid.c0000664000175100017510000004641712456571574015771 00000000000000/* * Copyright 1998 by Egbert Eich * Copyright 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * print_edid.c: print out all information retrieved from display device */ #ifdef HAVE_XORG_CONFIG_H #include #endif /* XXX kinda gross */ #define _PARSE_EDID_ #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include "xf86DDC.h" #include "edid.h" #define EDID_WIDTH 16 static void print_vendor(int scrnIndex, struct vendor *c) { xf86DrvMsg(scrnIndex, X_INFO, "Manufacturer: %s Model: %x Serial#: %u\n", (char *) &c->name, c->prod_id, c->serial); xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week); } static void print_version(int scrnIndex, struct edid_version *c) { xf86DrvMsg(scrnIndex, X_INFO, "EDID Version: %u.%u\n", c->version, c->revision); } static const char *digital_interfaces[] = { "undefined", "DVI", "HDMI-a", "HDMI-b", "MDDI", "DisplayPort", "unknown" }; static void print_input_features(int scrnIndex, struct disp_features *c, struct edid_version *v) { if (DIGITAL(c->input_type)) { xf86DrvMsg(scrnIndex, X_INFO, "Digital Display Input\n"); if (v->revision == 2 || v->revision == 3) { if (DFP1(c->input_dfp)) xf86DrvMsg(scrnIndex, X_INFO, "DFP 1.x compatible TMDS\n"); } else if (v->revision >= 4) { int interface = c->input_interface; int bpc = c->input_bpc; if (interface > 6) interface = 6; /* unknown */ if (bpc == 0 || bpc == 7) xf86DrvMsg(scrnIndex, X_INFO, "Undefined color depth\n"); else xf86DrvMsg(scrnIndex, X_INFO, "%d bits per channel\n", bpc * 2 + 4); xf86DrvMsg(scrnIndex, X_INFO, "Digital interface is %s\n", digital_interfaces[interface]); } } else { xf86DrvMsg(scrnIndex, X_INFO, "Analog Display Input, "); xf86ErrorF("Input Voltage Level: "); switch (c->input_voltage) { case V070: xf86ErrorF("0.700/0.300 V\n"); break; case V071: xf86ErrorF("0.714/0.286 V\n"); break; case V100: xf86ErrorF("1.000/0.400 V\n"); break; case V007: xf86ErrorF("0.700/0.700 V\n"); break; default: xf86ErrorF("undefined\n"); } if (SIG_SETUP(c->input_setup)) xf86DrvMsg(scrnIndex, X_INFO, "Signal levels configurable\n"); xf86DrvMsg(scrnIndex, X_INFO, "Sync:"); if (SEP_SYNC(c->input_sync)) xf86ErrorF(" Separate"); if (COMP_SYNC(c->input_sync)) xf86ErrorF(" Composite"); if (SYNC_O_GREEN(c->input_sync)) xf86ErrorF(" SyncOnGreen"); if (SYNC_SERR(c->input_sync)) xf86ErrorF("Serration on. " "V.Sync Pulse req. if CompSync or SyncOnGreen\n"); else xf86ErrorF("\n"); } } static void print_dpms_features(int scrnIndex, struct disp_features *c, struct edid_version *v) { if (c->dpms) { xf86DrvMsg(scrnIndex, X_INFO, "DPMS capabilities:"); if (DPMS_STANDBY(c->dpms)) xf86ErrorF(" StandBy"); if (DPMS_SUSPEND(c->dpms)) xf86ErrorF(" Suspend"); if (DPMS_OFF(c->dpms)) xf86ErrorF(" Off"); } else xf86DrvMsg(scrnIndex, X_INFO, "No DPMS capabilities specified"); if (!c->input_type) { /* analog */ switch (c->display_type) { case DISP_MONO: xf86ErrorF("; Monochorome/GrayScale Display\n"); break; case DISP_RGB: xf86ErrorF("; RGB/Color Display\n"); break; case DISP_MULTCOLOR: xf86ErrorF("; Non RGB Multicolor Display\n"); break; default: xf86ErrorF("\n"); break; } } else { int enc = c->display_type; xf86ErrorF("\n"); xf86DrvMsg(scrnIndex, X_INFO, "Supported color encodings: " "RGB 4:4:4 %s%s\n", enc & DISP_YCRCB444 ? "YCrCb 4:4:4 " : "", enc & DISP_YCRCB422 ? "YCrCb 4:2:2" : ""); } if (STD_COLOR_SPACE(c->msc)) xf86DrvMsg(scrnIndex, X_INFO, "Default color space is primary color space\n"); if (PREFERRED_TIMING_MODE(c->msc) || v->revision >= 4) { xf86DrvMsg(scrnIndex, X_INFO, "First detailed timing is preferred mode\n"); if (v->revision >= 4) xf86DrvMsg(scrnIndex, X_INFO, "Preferred mode is native pixel format and refresh rate\n"); } else if (v->revision == 3) { xf86DrvMsg(scrnIndex, X_INFO, "First detailed timing not preferred " "mode in violation of standard!\n"); } if (v->revision >= 4) { if (GFT_SUPPORTED(c->msc)) { xf86DrvMsg(scrnIndex, X_INFO, "Display is continuous-frequency\n"); } } else { if (GFT_SUPPORTED(c->msc)) xf86DrvMsg(scrnIndex, X_INFO, "GTF timings supported\n"); } } static void print_whitepoint(int scrnIndex, struct disp_features *disp) { xf86DrvMsg(scrnIndex, X_INFO, "redX: %.3f redY: %.3f ", disp->redx, disp->redy); xf86ErrorF("greenX: %.3f greenY: %.3f\n", disp->greenx, disp->greeny); xf86DrvMsg(scrnIndex, X_INFO, "blueX: %.3f blueY: %.3f ", disp->bluex, disp->bluey); xf86ErrorF("whiteX: %.3f whiteY: %.3f\n", disp->whitex, disp->whitey); } static void print_display(int scrnIndex, struct disp_features *disp, struct edid_version *v) { print_input_features(scrnIndex, disp, v); if (disp->hsize && disp->vsize) { xf86DrvMsg(scrnIndex, X_INFO, "Max Image Size [cm]: "); xf86ErrorF("horiz.: %i ", disp->hsize); xf86ErrorF("vert.: %i\n", disp->vsize); } else if (v->revision >= 4 && (disp->hsize || disp->vsize)) { if (disp->hsize) xf86DrvMsg(scrnIndex, X_INFO, "Aspect ratio: %.2f (landscape)\n", (disp->hsize + 99) / 100.0); if (disp->vsize) xf86DrvMsg(scrnIndex, X_INFO, "Aspect ratio: %.2f (portrait)\n", 100.0 / (float) (disp->vsize + 99)); } else { xf86DrvMsg(scrnIndex, X_INFO, "Indeterminate output size\n"); } if (!disp->gamma && v->revision >= 1.4) xf86DrvMsg(scrnIndex, X_INFO, "Gamma defined in extension block\n"); else xf86DrvMsg(scrnIndex, X_INFO, "Gamma: %.2f\n", disp->gamma); print_dpms_features(scrnIndex, disp, v); print_whitepoint(scrnIndex, disp); } static void print_established_timings(int scrnIndex, struct established_timings *t) { unsigned char c; if (t->t1 || t->t2 || t->t_manu) xf86DrvMsg(scrnIndex, X_INFO, "Supported established timings:\n"); c = t->t1; if (c & 0x80) xf86DrvMsg(scrnIndex, X_INFO, "720x400@70Hz\n"); if (c & 0x40) xf86DrvMsg(scrnIndex, X_INFO, "720x400@88Hz\n"); if (c & 0x20) xf86DrvMsg(scrnIndex, X_INFO, "640x480@60Hz\n"); if (c & 0x10) xf86DrvMsg(scrnIndex, X_INFO, "640x480@67Hz\n"); if (c & 0x08) xf86DrvMsg(scrnIndex, X_INFO, "640x480@72Hz\n"); if (c & 0x04) xf86DrvMsg(scrnIndex, X_INFO, "640x480@75Hz\n"); if (c & 0x02) xf86DrvMsg(scrnIndex, X_INFO, "800x600@56Hz\n"); if (c & 0x01) xf86DrvMsg(scrnIndex, X_INFO, "800x600@60Hz\n"); c = t->t2; if (c & 0x80) xf86DrvMsg(scrnIndex, X_INFO, "800x600@72Hz\n"); if (c & 0x40) xf86DrvMsg(scrnIndex, X_INFO, "800x600@75Hz\n"); if (c & 0x20) xf86DrvMsg(scrnIndex, X_INFO, "832x624@75Hz\n"); if (c & 0x10) xf86DrvMsg(scrnIndex, X_INFO, "1024x768@87Hz (interlaced)\n"); if (c & 0x08) xf86DrvMsg(scrnIndex, X_INFO, "1024x768@60Hz\n"); if (c & 0x04) xf86DrvMsg(scrnIndex, X_INFO, "1024x768@70Hz\n"); if (c & 0x02) xf86DrvMsg(scrnIndex, X_INFO, "1024x768@75Hz\n"); if (c & 0x01) xf86DrvMsg(scrnIndex, X_INFO, "1280x1024@75Hz\n"); c = t->t_manu; if (c & 0x80) xf86DrvMsg(scrnIndex, X_INFO, "1152x864@75Hz\n"); xf86DrvMsg(scrnIndex, X_INFO, "Manufacturer's mask: %X\n", c & 0x7F); } static void print_std_timings(int scrnIndex, struct std_timings *t) { int i; char done = 0; for (i = 0; i < STD_TIMINGS; i++) { if (t[i].hsize > 256) { /* sanity check */ if (!done) { xf86DrvMsg(scrnIndex, X_INFO, "Supported standard timings:\n"); done = 1; } xf86DrvMsg(scrnIndex, X_INFO, "#%i: hsize: %i vsize %i refresh: %i vid: %i\n", i, t[i].hsize, t[i].vsize, t[i].refresh, t[i].id); } } } static void print_cvt_timings(int si, struct cvt_timings *t) { int i; for (i = 0; i < 4; i++) { if (t[i].height) { xf86DrvMsg(si, X_INFO, "%dx%d @ %s%s%s%s%s Hz\n", t[i].width, t[i].height, t[i].rates & 0x10 ? "50," : "", t[i].rates & 0x08 ? "60," : "", t[i].rates & 0x04 ? "75," : "", t[i].rates & 0x02 ? "85," : "", t[i].rates & 0x01 ? "60RB" : ""); } else break; } } static void print_detailed_timings(int scrnIndex, struct detailed_timings *t) { if (t->clock > 15000000) { /* sanity check */ xf86DrvMsg(scrnIndex, X_INFO, "Supported detailed timing:\n"); xf86DrvMsg(scrnIndex, X_INFO, "clock: %.1f MHz ", t->clock / 1000000.0); xf86ErrorF("Image Size: %i x %i mm\n", t->h_size, t->v_size); xf86DrvMsg(scrnIndex, X_INFO, "h_active: %i h_sync: %i h_sync_end %i h_blank_end %i ", t->h_active, t->h_sync_off + t->h_active, t->h_sync_off + t->h_sync_width + t->h_active, t->h_active + t->h_blanking); xf86ErrorF("h_border: %i\n", t->h_border); xf86DrvMsg(scrnIndex, X_INFO, "v_active: %i v_sync: %i v_sync_end %i v_blanking: %i ", t->v_active, t->v_sync_off + t->v_active, t->v_sync_off + t->v_sync_width + t->v_active, t->v_active + t->v_blanking); xf86ErrorF("v_border: %i\n", t->v_border); if (IS_STEREO(t->stereo)) { xf86DrvMsg(scrnIndex, X_INFO, "Stereo: "); if (IS_RIGHT_STEREO(t->stereo)) { if (!t->stereo_1) xf86ErrorF("right channel on sync\n"); else xf86ErrorF("left channel on sync\n"); } else if (IS_LEFT_STEREO(t->stereo)) { if (!t->stereo_1) xf86ErrorF("right channel on even line\n"); else xf86ErrorF("left channel on evel line\n"); } if (IS_4WAY_STEREO(t->stereo)) { if (!t->stereo_1) xf86ErrorF("4-way interleaved\n"); else xf86ErrorF("side-by-side interleaved"); } } } } /* This function handle all detailed patchs, * including EDID and EDID-extension */ struct det_print_parameter { xf86MonPtr m; int index; ddc_quirk_t quirks; }; static void handle_detailed_print(struct detailed_monitor_section *det_mon, void *data) { int j, scrnIndex; struct det_print_parameter *p; p = (struct det_print_parameter *) data; scrnIndex = p->m->scrnIndex; xf86DetTimingApplyQuirks(det_mon, p->quirks, p->m->features.hsize, p->m->features.vsize); switch (det_mon->type) { case DT: print_detailed_timings(scrnIndex, &det_mon->section.d_timings); break; case DS_SERIAL: xf86DrvMsg(scrnIndex, X_INFO, "Serial No: %s\n", det_mon->section.serial); break; case DS_ASCII_STR: xf86DrvMsg(scrnIndex, X_INFO, " %s\n", det_mon->section.ascii_data); break; case DS_NAME: xf86DrvMsg(scrnIndex, X_INFO, "Monitor name: %s\n", det_mon->section.name); break; case DS_RANGES: { struct monitor_ranges *r = &det_mon->section.ranges; xf86DrvMsg(scrnIndex, X_INFO, "Ranges: V min: %i V max: %i Hz, H min: %i H max: %i kHz,", r->min_v, r->max_v, r->min_h, r->max_h); if (r->max_clock_khz != 0) { xf86ErrorF(" PixClock max %i kHz\n", r->max_clock_khz); if (r->maxwidth) xf86DrvMsg(scrnIndex, X_INFO, "Maximum pixel width: %d\n", r->maxwidth); xf86DrvMsg(scrnIndex, X_INFO, "Supported aspect ratios:"); if (r->supported_aspect & SUPPORTED_ASPECT_4_3) xf86ErrorF(" 4:3%s", r->preferred_aspect == PREFERRED_ASPECT_4_3 ? "*" : ""); if (r->supported_aspect & SUPPORTED_ASPECT_16_9) xf86ErrorF(" 16:9%s", r->preferred_aspect == PREFERRED_ASPECT_16_9 ? "*" : ""); if (r->supported_aspect & SUPPORTED_ASPECT_16_10) xf86ErrorF(" 16:10%s", r->preferred_aspect == PREFERRED_ASPECT_16_10 ? "*" : ""); if (r->supported_aspect & SUPPORTED_ASPECT_5_4) xf86ErrorF(" 5:4%s", r->preferred_aspect == PREFERRED_ASPECT_5_4 ? "*" : ""); if (r->supported_aspect & SUPPORTED_ASPECT_15_9) xf86ErrorF(" 15:9%s", r->preferred_aspect == PREFERRED_ASPECT_15_9 ? "*" : ""); xf86ErrorF("\n"); xf86DrvMsg(scrnIndex, X_INFO, "Supported blankings:"); if (r->supported_blanking & CVT_STANDARD) xf86ErrorF(" standard"); if (r->supported_blanking & CVT_REDUCED) xf86ErrorF(" reduced"); xf86ErrorF("\n"); xf86DrvMsg(scrnIndex, X_INFO, "Supported scalings:"); if (r->supported_scaling & SCALING_HSHRINK) xf86ErrorF(" hshrink"); if (r->supported_scaling & SCALING_HSTRETCH) xf86ErrorF(" hstretch"); if (r->supported_scaling & SCALING_VSHRINK) xf86ErrorF(" vshrink"); if (r->supported_scaling & SCALING_VSTRETCH) xf86ErrorF(" vstretch"); xf86ErrorF("\n"); if (r->preferred_refresh) xf86DrvMsg(scrnIndex, X_INFO, "Preferred refresh rate: %d\n", r->preferred_refresh); else xf86DrvMsg(scrnIndex, X_INFO, "Buggy monitor, no preferred " "refresh rate given\n"); } else if (r->max_clock != 0) { xf86ErrorF(" PixClock max %i MHz\n", r->max_clock); } else { xf86ErrorF("\n"); } if (r->gtf_2nd_f > 0) xf86DrvMsg(scrnIndex, X_INFO, " 2nd GTF parameters: f: %i kHz " "c: %i m: %i k %i j %i\n", r->gtf_2nd_f, r->gtf_2nd_c, r->gtf_2nd_m, r->gtf_2nd_k, r->gtf_2nd_j); break; } case DS_STD_TIMINGS: for (j = 0; j < 5; j++) xf86DrvMsg(scrnIndex, X_INFO, "#%i: hsize: %i vsize %i refresh: %i " "vid: %i\n", p->index, det_mon->section.std_t[j].hsize, det_mon->section.std_t[j].vsize, det_mon->section.std_t[j].refresh, det_mon->section.std_t[j].id); break; case DS_WHITE_P: for (j = 0; j < 2; j++) if (det_mon->section.wp[j].index != 0) xf86DrvMsg(scrnIndex, X_INFO, "White point %i: whiteX: %f, whiteY: %f; gamma: %f\n", det_mon->section.wp[j].index, det_mon->section.wp[j].white_x, det_mon->section.wp[j].white_y, det_mon->section.wp[j].white_gamma); break; case DS_CMD: xf86DrvMsg(scrnIndex, X_INFO, "Color management data: (not decoded)\n"); break; case DS_CVT: xf86DrvMsg(scrnIndex, X_INFO, "CVT 3-byte-code modes:\n"); print_cvt_timings(scrnIndex, det_mon->section.cvt); break; case DS_EST_III: xf86DrvMsg(scrnIndex, X_INFO, "Established timings III: (not decoded)\n"); break; case DS_DUMMY: default: break; } if (det_mon->type >= DS_VENDOR && det_mon->type <= DS_VENDOR_MAX) { xf86DrvMsg(scrnIndex, X_INFO, "Unknown vendor-specific block %hx\n", det_mon->type - DS_VENDOR); } p->index = p->index + 1; } static void print_number_sections(int scrnIndex, int num) { if (num) xf86DrvMsg(scrnIndex, X_INFO, "Number of EDID sections to follow: %i\n", num); } xf86MonPtr xf86PrintEDID(xf86MonPtr m) { CARD16 i, j, n; char buf[EDID_WIDTH * 2 + 1]; struct det_print_parameter p; if (!m) return NULL; print_vendor(m->scrnIndex, &m->vendor); print_version(m->scrnIndex, &m->ver); print_display(m->scrnIndex, &m->features, &m->ver); print_established_timings(m->scrnIndex, &m->timings1); print_std_timings(m->scrnIndex, m->timings2); p.m = m; p.index = 0; p.quirks = xf86DDCDetectQuirks(m->scrnIndex, m, FALSE); xf86ForEachDetailedBlock(m, handle_detailed_print, &p); print_number_sections(m->scrnIndex, m->no_sections); /* extension block section stuff */ xf86DrvMsg(m->scrnIndex, X_INFO, "EDID (in hex):\n"); n = 128; if (m->flags & EDID_COMPLETE_RAWDATA) n += m->no_sections * 128; for (i = 0; i < n; i += j) { for (j = 0; j < EDID_WIDTH; ++j) { sprintf(&buf[j * 2], "%02x", m->rawData[i + j]); } xf86DrvMsg(m->scrnIndex, X_INFO, "\t%s\n", buf); } return m; } xorg-server-1.17.1/hw/xfree86/ddc/xf86DDC.h0000664000175100017510000000641612456571574014756 00000000000000 /* xf86DDC.h * * This file contains all information to interpret a standard EDIC block * transmitted by a display device via DDC (Display Data Channel). So far * there is no information to deal with optional EDID blocks. * DDC is a Trademark of VESA (Video Electronics Standard Association). * * Copyright 1998 by Egbert Eich */ #ifndef XF86_DDC_H #define XF86_DDC_H #include "edid.h" #include "xf86i2c.h" #include "xf86str.h" /* speed up / slow down */ typedef enum { DDC_SLOW, DDC_FAST } xf86ddcSpeed; typedef void (*DDC1SetSpeedProc) (ScrnInfoPtr, xf86ddcSpeed); extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed, unsigned int (*DDC1Read) (ScrnInfoPtr) ); extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus); extern _X_EXPORT xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool); extern _X_EXPORT xf86MonPtr xf86PrintEDID(xf86MonPtr monPtr); extern _X_EXPORT xf86MonPtr xf86InterpretEDID(int screenIndex, Uchar * block); extern _X_EXPORT xf86MonPtr xf86InterpretEEDID(int screenIndex, Uchar * block); extern _X_EXPORT void xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC); extern _X_EXPORT Bool xf86SetDDCproperties(ScrnInfoPtr pScreen, xf86MonPtr DDC); extern _X_EXPORT Bool xf86MonitorIsHDMI(xf86MonPtr mon); extern _X_EXPORT DisplayModePtr FindDMTMode(int hsize, int vsize, int refresh, Bool rb); extern _X_EXPORT const DisplayModeRec DMTModes[]; /* * Quirks to work around broken EDID data from various monitors. */ typedef enum { DDC_QUIRK_NONE = 0, /* First detailed mode is bogus, prefer largest mode at 60hz */ DDC_QUIRK_PREFER_LARGE_60 = 1 << 0, /* 135MHz clock is too high, drop a bit */ DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1, /* Prefer the largest mode at 75 Hz */ DDC_QUIRK_PREFER_LARGE_75 = 1 << 2, /* Convert detailed timing's horizontal from units of cm to mm */ DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3, /* Convert detailed timing's vertical from units of cm to mm */ DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4, /* Detailed timing descriptors have bogus size values, so just take the * maximum size and use that. */ DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5, /* Monitor forgot to set the first detailed is preferred bit. */ DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6, /* use +hsync +vsync for detailed mode */ DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7, /* Force single-link DVI bandwidth limit */ DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8, } ddc_quirk_t; typedef void (*handle_detailed_fn) (struct detailed_monitor_section *, void *); void xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn, void *data); ddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose); void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon, ddc_quirk_t quirks, int hsize, int vsize); typedef void (*handle_video_fn) (struct cea_video_block *, void *); void xf86ForEachVideoBlock(xf86MonPtr, handle_video_fn, void *); struct cea_data_block *xf86MonitorFindHDMIBlock(xf86MonPtr mon); #endif xorg-server-1.17.1/hw/xfree86/ddc/interpret_edid.c0000664000175100017510000005032612366220413016622 00000000000000/* * Copyright 1998 by Egbert Eich * Copyright 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * interpret_edid.c: interpret a primary EDID block */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #define _PARSE_EDID_ #include "xf86DDC.h" #include static void get_vendor_section(Uchar *, struct vendor *); static void get_version_section(Uchar *, struct edid_version *); static void get_display_section(Uchar *, struct disp_features *, struct edid_version *); static void get_established_timing_section(Uchar *, struct established_timings *); static void get_std_timing_section(Uchar *, struct std_timings *, struct edid_version *); static void fetch_detailed_block(Uchar * c, struct edid_version *ver, struct detailed_monitor_section *det_mon); static void get_dt_md_section(Uchar *, struct edid_version *, struct detailed_monitor_section *det_mon); static void copy_string(Uchar *, Uchar *); static void get_dst_timing_section(Uchar *, struct std_timings *, struct edid_version *); static void get_monitor_ranges(Uchar *, struct monitor_ranges *); static void get_whitepoint_section(Uchar *, struct whitePoints *); static void get_detailed_timing_section(Uchar *, struct detailed_timings *); static Bool validate_version(int scrnIndex, struct edid_version *); static void find_ranges_section(struct detailed_monitor_section *det, void *ranges) { if (det->type == DS_RANGES && det->section.ranges.max_clock) *(struct monitor_ranges **) ranges = &det->section.ranges; } static void find_max_detailed_clock(struct detailed_monitor_section *det, void *ret) { if (det->type == DT) { *(int *) ret = max(*((int *) ret), det->section.d_timings.clock); } } static void handle_edid_quirks(xf86MonPtr m) { struct monitor_ranges *ranges = NULL; /* * max_clock is only encoded in EDID in tens of MHz, so occasionally we * find a monitor claiming a max of 160 with a mode requiring 162, or * similar. Strictly we should refuse to round up too far, but let's * see how well this works. */ /* Try to find Monitor Range and max clock, then re-set range value */ xf86ForEachDetailedBlock(m, find_ranges_section, &ranges); if (ranges && ranges->max_clock) { int clock = 0; xf86ForEachDetailedBlock(m, find_max_detailed_clock, &clock); if (clock && (ranges->max_clock * 1e6 < clock)) { xf86Msg(X_WARNING, "EDID timing clock %.2f exceeds claimed max " "%dMHz, fixing\n", clock / 1.0e6, ranges->max_clock); ranges->max_clock = (clock + 999999) / 1e6; } } } struct det_hv_parameter { int real_hsize; int real_vsize; float target_aspect; }; static void handle_detailed_hvsize(struct detailed_monitor_section *det_mon, void *data) { struct det_hv_parameter *p = (struct det_hv_parameter *) data; float timing_aspect; if (det_mon->type == DT) { struct detailed_timings *timing; timing = &det_mon->section.d_timings; if (!timing->v_size) return; timing_aspect = (float) timing->h_size / timing->v_size; if (fabs(1 - (timing_aspect / p->target_aspect)) < 0.05) { p->real_hsize = max(p->real_hsize, timing->h_size); p->real_vsize = max(p->real_vsize, timing->v_size); } } } static void encode_aspect_ratio(xf86MonPtr m) { /* * some monitors encode the aspect ratio instead of the physical size. * try to find the largest detailed timing that matches that aspect * ratio and use that to fill in the feature section. */ if ((m->features.hsize == 16 && m->features.vsize == 9) || (m->features.hsize == 16 && m->features.vsize == 10) || (m->features.hsize == 4 && m->features.vsize == 3) || (m->features.hsize == 5 && m->features.vsize == 4)) { struct det_hv_parameter p; p.real_hsize = 0; p.real_vsize = 0; p.target_aspect = (float) m->features.hsize / m->features.vsize; xf86ForEachDetailedBlock(m, handle_detailed_hvsize, &p); if (!p.real_hsize || !p.real_vsize) { m->features.hsize = m->features.vsize = 0; } else if ((m->features.hsize * 10 == p.real_hsize) && (m->features.vsize * 10 == p.real_vsize)) { /* exact match is just unlikely, should do a better check though */ m->features.hsize = m->features.vsize = 0; } else { /* convert mm to cm */ m->features.hsize = (p.real_hsize + 5) / 10; m->features.vsize = (p.real_vsize + 5) / 10; } xf86Msg(X_INFO, "Quirked EDID physical size to %dx%d cm\n", m->features.hsize, m->features.vsize); } } xf86MonPtr xf86InterpretEDID(int scrnIndex, Uchar * block) { xf86MonPtr m; if (!block) return NULL; if (!(m = xnfcalloc(sizeof(xf86Monitor), 1))) return NULL; m->scrnIndex = scrnIndex; m->rawData = block; get_vendor_section(SECTION(VENDOR_SECTION, block), &m->vendor); get_version_section(SECTION(VERSION_SECTION, block), &m->ver); if (!validate_version(scrnIndex, &m->ver)) goto error; get_display_section(SECTION(DISPLAY_SECTION, block), &m->features, &m->ver); get_established_timing_section(SECTION(ESTABLISHED_TIMING_SECTION, block), &m->timings1); get_std_timing_section(SECTION(STD_TIMING_SECTION, block), m->timings2, &m->ver); get_dt_md_section(SECTION(DET_TIMING_SECTION, block), &m->ver, m->det_mon); m->no_sections = (int) *(char *) SECTION(NO_EDID, block); handle_edid_quirks(m); encode_aspect_ratio(m); return m; error: free(m); return NULL; } static int get_cea_detail_timing(Uchar * blk, xf86MonPtr mon, struct detailed_monitor_section *det_mon) { int dt_num; int dt_offset = ((struct cea_ext_body *) blk)->dt_offset; dt_num = 0; if (dt_offset < CEA_EXT_MIN_DATA_OFFSET) return dt_num; for (; dt_offset < (CEA_EXT_MAX_DATA_OFFSET - DET_TIMING_INFO_LEN) && dt_num < CEA_EXT_DET_TIMING_NUM; _NEXT_DT_MD_SECTION(dt_offset)) { fetch_detailed_block(blk + dt_offset, &mon->ver, det_mon + dt_num); dt_num = dt_num + 1; } return dt_num; } static void handle_cea_detail_block(Uchar * ext, xf86MonPtr mon, handle_detailed_fn fn, void *data) { int i; struct detailed_monitor_section det_mon[CEA_EXT_DET_TIMING_NUM]; int det_mon_num; det_mon_num = get_cea_detail_timing(ext, mon, det_mon); for (i = 0; i < det_mon_num; i++) fn(det_mon + i, data); } void xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn fn, void *data) { int i; Uchar *ext; if (mon == NULL) return; for (i = 0; i < DET_TIMINGS; i++) fn(mon->det_mon + i, data); for (i = 0; i < mon->no_sections; i++) { ext = mon->rawData + EDID1_LEN * (i + 1); switch (ext[EXT_TAG]) { case CEA_EXT: handle_cea_detail_block(ext, mon, fn, data); break; case VTB_EXT: case DI_EXT: case LS_EXT: case MI_EXT: break; } } } static struct cea_data_block * extract_cea_data_block(Uchar * ext, int data_type) { struct cea_ext_body *cea; struct cea_data_block *data_collection; struct cea_data_block *data_end; cea = (struct cea_ext_body *) ext; if (cea->dt_offset <= CEA_EXT_MIN_DATA_OFFSET) return NULL; data_collection = &cea->data_collection; data_end = (struct cea_data_block *) (cea->dt_offset + ext); for (; data_collection < data_end;) { if (data_type == data_collection->tag) { return data_collection; } data_collection = (void *) ((unsigned char *) data_collection + data_collection->len + 1); } return NULL; } static void handle_cea_video_block(Uchar * ext, handle_video_fn fn, void *data) { struct cea_video_block *video; struct cea_video_block *video_end; struct cea_data_block *data_collection; data_collection = extract_cea_data_block(ext, CEA_VIDEO_BLK); if (data_collection == NULL) return; video = &data_collection->u.video; video_end = (struct cea_video_block *) ((Uchar *) video + data_collection->len); for (; video < video_end; video = video + 1) { fn(video, data); } } void xf86ForEachVideoBlock(xf86MonPtr mon, handle_video_fn fn, void *data) { int i; Uchar *ext; if (mon == NULL) return; for (i = 0; i < mon->no_sections; i++) { ext = mon->rawData + EDID1_LEN * (i + 1); switch (ext[EXT_TAG]) { case CEA_EXT: handle_cea_video_block(ext, fn, data); break; case VTB_EXT: case DI_EXT: case LS_EXT: case MI_EXT: break; } } } static Bool cea_db_offsets(Uchar *cea, int *start, int *end) { /* Data block offset in CEA extension block */ *start = CEA_EXT_MIN_DATA_OFFSET; *end = cea[2]; if (*end == 0) *end = CEA_EXT_MAX_DATA_OFFSET; if (*end < CEA_EXT_MIN_DATA_OFFSET || *end > CEA_EXT_MAX_DATA_OFFSET) return FALSE; return TRUE; } static int cea_db_len(Uchar *db) { return db[0] & 0x1f; } static int cea_db_tag(Uchar *db) { return db[0] >> 5; } typedef void (*handle_cea_db_fn) (Uchar *, void *); static void cea_for_each_db(xf86MonPtr mon, handle_cea_db_fn fn, void *data) { int i; if (!mon) return; if (!(mon->flags & EDID_COMPLETE_RAWDATA)) return; if (!mon->no_sections) return; if (!mon->rawData) return; for (i = 0; i < mon->no_sections; i++) { int start, end, offset; Uchar *ext; ext = mon->rawData + EDID1_LEN * (i + 1); if (ext[EXT_TAG] != CEA_EXT) continue; if (!cea_db_offsets(ext, &start, &end)) continue; for (offset = start; offset < end && offset + cea_db_len(&ext[offset]) < end; offset += cea_db_len(&ext[offset]) + 1) fn(&ext[offset], data); } } struct find_hdmi_block_data { struct cea_data_block *hdmi; }; static void find_hdmi_block(Uchar *db, void *data) { struct find_hdmi_block_data *result = data; int oui; if (cea_db_tag(db) != CEA_VENDOR_BLK) return; if (cea_db_len(db) < 5) return; oui = (db[3] << 16) | (db[2] << 8) | db[1]; if (oui == IEEE_ID_HDMI) result->hdmi = (struct cea_data_block *)db; } struct cea_data_block *xf86MonitorFindHDMIBlock(xf86MonPtr mon) { struct find_hdmi_block_data result = { NULL }; cea_for_each_db(mon, find_hdmi_block, &result); return result.hdmi; } xf86MonPtr xf86InterpretEEDID(int scrnIndex, Uchar * block) { xf86MonPtr m; m = xf86InterpretEDID(scrnIndex, block); if (!m) return NULL; /* extension parse */ return m; } static void get_vendor_section(Uchar * c, struct vendor *r) { r->name[0] = L1; r->name[1] = L2; r->name[2] = L3; r->name[3] = '\0'; r->prod_id = PROD_ID; r->serial = SERIAL_NO; r->week = WEEK; r->year = YEAR; } static void get_version_section(Uchar * c, struct edid_version *r) { r->version = VERSION; r->revision = REVISION; } static void get_display_section(Uchar * c, struct disp_features *r, struct edid_version *v) { r->input_type = INPUT_TYPE; if (!DIGITAL(r->input_type)) { r->input_voltage = INPUT_VOLTAGE; r->input_setup = SETUP; r->input_sync = SYNC; } else if (v->revision == 2 || v->revision == 3) { r->input_dfp = DFP; } else if (v->revision >= 4) { r->input_bpc = BPC; r->input_interface = DIGITAL_INTERFACE; } r->hsize = HSIZE_MAX; r->vsize = VSIZE_MAX; r->gamma = GAMMA; r->dpms = DPMS; r->display_type = DISPLAY_TYPE; r->msc = MSC; r->redx = REDX; r->redy = REDY; r->greenx = GREENX; r->greeny = GREENY; r->bluex = BLUEX; r->bluey = BLUEY; r->whitex = WHITEX; r->whitey = WHITEY; } static void get_established_timing_section(Uchar * c, struct established_timings *r) { r->t1 = T1; r->t2 = T2; r->t_manu = T_MANU; } static void get_cvt_timing_section(Uchar * c, struct cvt_timings *r) { int i; for (i = 0; i < 4; i++) { if (c[0] && c[1] && c[2]) { r[i].height = (c[0] + ((c[1] & 0xF0) << 8) + 1) * 2; switch (c[1] & 0xc0) { case 0x00: r[i].width = r[i].height * 4 / 3; break; case 0x40: r[i].width = r[i].height * 16 / 9; break; case 0x80: r[i].width = r[i].height * 16 / 10; break; case 0xc0: r[i].width = r[i].height * 15 / 9; break; } switch (c[2] & 0x60) { case 0x00: r[i].rate = 50; break; case 0x20: r[i].rate = 60; break; case 0x40: r[i].rate = 75; break; case 0x60: r[i].rate = 85; break; } r[i].rates = c[2] & 0x1f; } else { return; } c += 3; } } static void get_std_timing_section(Uchar * c, struct std_timings *r, struct edid_version *v) { int i; for (i = 0; i < STD_TIMINGS; i++) { if (VALID_TIMING) { r[i].hsize = HSIZE1; VSIZE1(r[i].vsize); r[i].refresh = REFRESH_R; r[i].id = STD_TIMING_ID; } else { r[i].hsize = r[i].vsize = r[i].refresh = r[i].id = 0; } NEXT_STD_TIMING; } } static const unsigned char empty_block[18]; static void fetch_detailed_block(Uchar * c, struct edid_version *ver, struct detailed_monitor_section *det_mon) { if (ver->version == 1 && ver->revision >= 1 && IS_MONITOR_DESC) { switch (MONITOR_DESC_TYPE) { case SERIAL_NUMBER: det_mon->type = DS_SERIAL; copy_string(c, det_mon->section.serial); break; case ASCII_STR: det_mon->type = DS_ASCII_STR; copy_string(c, det_mon->section.ascii_data); break; case MONITOR_RANGES: det_mon->type = DS_RANGES; get_monitor_ranges(c, &det_mon->section.ranges); break; case MONITOR_NAME: det_mon->type = DS_NAME; copy_string(c, det_mon->section.name); break; case ADD_COLOR_POINT: det_mon->type = DS_WHITE_P; get_whitepoint_section(c, det_mon->section.wp); break; case ADD_STD_TIMINGS: det_mon->type = DS_STD_TIMINGS; get_dst_timing_section(c, det_mon->section.std_t, ver); break; case COLOR_MANAGEMENT_DATA: det_mon->type = DS_CMD; break; case CVT_3BYTE_DATA: det_mon->type = DS_CVT; get_cvt_timing_section(c, det_mon->section.cvt); break; case ADD_EST_TIMINGS: det_mon->type = DS_EST_III; memcpy(det_mon->section.est_iii, c + 6, 6); break; case ADD_DUMMY: det_mon->type = DS_DUMMY; break; default: det_mon->type = DS_UNKOWN; break; } if (c[3] <= 0x0F && memcmp(c, empty_block, sizeof(empty_block))) { det_mon->type = DS_VENDOR + c[3]; } } else { det_mon->type = DT; get_detailed_timing_section(c, &det_mon->section.d_timings); } } static void get_dt_md_section(Uchar * c, struct edid_version *ver, struct detailed_monitor_section *det_mon) { int i; for (i = 0; i < DET_TIMINGS; i++) { fetch_detailed_block(c, ver, det_mon + i); NEXT_DT_MD_SECTION; } } static void copy_string(Uchar * c, Uchar * s) { int i; c = c + 5; for (i = 0; (i < 13 && *c != 0x0A); i++) *(s++) = *(c++); *s = 0; while (i-- && (*--s == 0x20)) *s = 0; } static void get_dst_timing_section(Uchar * c, struct std_timings *t, struct edid_version *v) { int j; c = c + 5; for (j = 0; j < 5; j++) { t[j].hsize = HSIZE1; VSIZE1(t[j].vsize); t[j].refresh = REFRESH_R; t[j].id = STD_TIMING_ID; NEXT_STD_TIMING; } } static void get_monitor_ranges(Uchar * c, struct monitor_ranges *r) { r->min_v = MIN_V; r->max_v = MAX_V; r->min_h = MIN_H; r->max_h = MAX_H; r->max_clock = 0; if (MAX_CLOCK != 0xff) /* is specified? */ r->max_clock = MAX_CLOCK * 10 + 5; if (HAVE_2ND_GTF) { r->gtf_2nd_f = F_2ND_GTF; r->gtf_2nd_c = C_2ND_GTF; r->gtf_2nd_m = M_2ND_GTF; r->gtf_2nd_k = K_2ND_GTF; r->gtf_2nd_j = J_2ND_GTF; } else { r->gtf_2nd_f = 0; } if (HAVE_CVT) { r->max_clock_khz = MAX_CLOCK_KHZ; r->max_clock = r->max_clock_khz / 1000; r->maxwidth = MAXWIDTH; r->supported_aspect = SUPPORTED_ASPECT; r->preferred_aspect = PREFERRED_ASPECT; r->supported_blanking = SUPPORTED_BLANKING; r->supported_scaling = SUPPORTED_SCALING; r->preferred_refresh = PREFERRED_REFRESH; } else { r->max_clock_khz = 0; } } static void get_whitepoint_section(Uchar * c, struct whitePoints *wp) { wp[0].white_x = WHITEX1; wp[0].white_y = WHITEY1; wp[1].white_x = WHITEX2; wp[1].white_y = WHITEY2; wp[0].index = WHITE_INDEX1; wp[1].index = WHITE_INDEX2; wp[0].white_gamma = WHITE_GAMMA1; wp[1].white_gamma = WHITE_GAMMA2; } static void get_detailed_timing_section(Uchar * c, struct detailed_timings *r) { r->clock = PIXEL_CLOCK; r->h_active = H_ACTIVE; r->h_blanking = H_BLANK; r->v_active = V_ACTIVE; r->v_blanking = V_BLANK; r->h_sync_off = H_SYNC_OFF; r->h_sync_width = H_SYNC_WIDTH; r->v_sync_off = V_SYNC_OFF; r->v_sync_width = V_SYNC_WIDTH; r->h_size = H_SIZE; r->v_size = V_SIZE; r->h_border = H_BORDER; r->v_border = V_BORDER; r->interlaced = INTERLACED; r->stereo = STEREO; r->stereo_1 = STEREO1; r->sync = SYNC_T; r->misc = MISC; } #define MAX_EDID_MINOR 4 static Bool validate_version(int scrnIndex, struct edid_version *r) { if (r->version != 1) { xf86DrvMsg(scrnIndex, X_ERROR, "Unknown EDID version %d\n", r->version); return FALSE; } if (r->revision > MAX_EDID_MINOR) xf86DrvMsg(scrnIndex, X_WARNING, "Assuming version 1.%d is compatible with 1.%d\n", r->revision, MAX_EDID_MINOR); return TRUE; } /* * Returns true if HDMI, false if definitely not or unknown. */ Bool xf86MonitorIsHDMI(xf86MonPtr mon) { return xf86MonitorFindHDMIBlock(mon) != NULL; } xorg-server-1.17.1/hw/xfree86/ddc/Makefile.in0000664000175100017510000006603712466505432015540 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/ddc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libddc_la_LIBADD = am_libddc_la_OBJECTS = ddc.lo interpret_edid.lo print_edid.lo \ ddcProperty.lo libddc_la_OBJECTS = $(am_libddc_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 = $(libddc_la_SOURCES) DIST_SOURCES = $(libddc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = edid.h xf86DDC.h noinst_LTLIBRARIES = libddc.la libddc_la_SOURCES = ddc.c interpret_edid.c print_edid.c ddcProperty.c AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../i2c AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = DDC.HOWTO all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/ddc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/ddc/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libddc.la: $(libddc_la_OBJECTS) $(libddc_la_DEPENDENCIES) $(EXTRA_libddc_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libddc_la_OBJECTS) $(libddc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddcProperty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interpret_edid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_edid.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/xfree86/ddc/ddcProperty.c0000664000175100017510000000515712366220413016122 00000000000000/* * Copyright 2006 Luc Verhaegen. * * 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 * 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_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86DDC.h" #include #include "property.h" #include "propertyst.h" #include #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" static void edidMakeAtom(int i, const char *name, CARD8 *data, int size) { Atom atom; unsigned char *atom_data; if (!(atom_data = malloc(size * sizeof(CARD8)))) return; atom = MakeAtom(name, strlen(name), TRUE); memcpy(atom_data, data, size); xf86RegisterRootWindowProperty(i, atom, XA_INTEGER, 8, size, atom_data); } static void addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) { int scrnIndex = pScrn->scrnIndex; if (DDC->flags & MONITOR_DISPLAYID) { /* Don't bother, use RANDR already */ return; } else if (DDC->ver.version == 1) { int size = 128 + (DDC->flags & EDID_COMPLETE_RAWDATA ? DDC->no_sections * 128 : 0); edidMakeAtom(scrnIndex, EDID1_ATOM_NAME, DDC->rawData, size); } else { xf86DrvMsg(scrnIndex, X_PROBED, "unexpected EDID version %d.%d\n", DDC->ver.version, DDC->ver.revision); return; } } Bool xf86SetDDCproperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) { if (!pScrn || !pScrn->monitor || !DDC) return FALSE; if (DDC->flags & MONITOR_DISPLAYID); else xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC); addRootWindowProperties(pScrn, DDC); return TRUE; } xorg-server-1.17.1/hw/xfree86/ddc/ddc.c0000664000175100017510000002671212456571574014376 00000000000000/* xf86DDC.c * * Copyright 1998,1999 by Egbert Eich */ /* * A note on terminology. DDC1 is the original dumb serial protocol, and * can only do up to 128 bytes of EDID. DDC2 is I2C-encapsulated and * introduces extension blocks. EDID is the old display identification * block, DisplayID is the new one. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include "xf86DDC.h" #include #define RETRIES 4 typedef enum { DDCOPT_NODDC1, DDCOPT_NODDC2, DDCOPT_NODDC } DDCOpts; static const OptionInfoRec DDCOptions[] = { {DDCOPT_NODDC1, "NoDDC1", OPTV_BOOLEAN, {0}, FALSE}, {DDCOPT_NODDC2, "NoDDC2", OPTV_BOOLEAN, {0}, FALSE}, {DDCOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; /* DDC1 */ static int find_start(unsigned int *ptr) { unsigned int comp[9], test[9]; int i, j; for (i = 0; i < 9; i++) { comp[i] = *(ptr++); test[i] = 1; } for (i = 0; i < 127; i++) { for (j = 0; j < 9; j++) { test[j] = test[j] & !(comp[j] ^ *(ptr++)); } } for (i = 0; i < 9; i++) if (test[i]) return i + 1; return -1; } static unsigned char * find_header(unsigned char *block) { unsigned char *ptr, *head_ptr, *end; unsigned char header[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }; ptr = block; end = block + EDID1_LEN; while (ptr < end) { int i; head_ptr = ptr; for (i = 0; i < 8; i++) { if (header[i] != *(head_ptr++)) break; if (head_ptr == end) head_ptr = block; } if (i == 8) break; ptr++; } if (ptr == end) return NULL; return ptr; } static unsigned char * resort(unsigned char *s_block) { unsigned char *d_new, *d_ptr, *d_end, *s_ptr, *s_end; unsigned char tmp; s_ptr = find_header(s_block); if (!s_ptr) return NULL; s_end = s_block + EDID1_LEN; d_new = malloc(EDID1_LEN); if (!d_new) return NULL; d_end = d_new + EDID1_LEN; for (d_ptr = d_new; d_ptr < d_end; d_ptr++) { tmp = *(s_ptr++); *d_ptr = tmp; if (s_ptr == s_end) s_ptr = s_block; } free(s_block); return d_new; } static int DDC_checksum(const unsigned char *block, int len) { int i, result = 0; int not_null = 0; for (i = 0; i < len; i++) { not_null |= block[i]; result += block[i]; } #ifdef DEBUG if (result & 0xFF) ErrorF("DDC checksum not correct\n"); if (!not_null) ErrorF("DDC read all Null\n"); #endif /* catch the trivial case where all bytes are 0 */ if (!not_null) return 1; return result & 0xFF; } static unsigned char * GetEDID_DDC1(unsigned int *s_ptr) { unsigned char *d_block, *d_pos; unsigned int *s_pos, *s_end; int s_start; int i, j; s_start = find_start(s_ptr); if (s_start == -1) return NULL; s_end = s_ptr + NUM; s_pos = s_ptr + s_start; d_block = malloc(EDID1_LEN); if (!d_block) return NULL; d_pos = d_block; for (i = 0; i < EDID1_LEN; i++) { for (j = 0; j < 8; j++) { *d_pos <<= 1; if (*s_pos) { *d_pos |= 0x01; } s_pos++; if (s_pos == s_end) s_pos = s_ptr; }; s_pos++; if (s_pos == s_end) s_pos = s_ptr; d_pos++; } free(s_ptr); if (d_block && DDC_checksum(d_block, EDID1_LEN)) { free(d_block); return NULL; } return (resort(d_block)); } /* fetch entire EDID record; DDC bit needs to be masked */ static unsigned int * FetchEDID_DDC1(register ScrnInfoPtr pScrn, register unsigned int (*read_DDC) (ScrnInfoPtr)) { int count = NUM; unsigned int *ptr, *xp; ptr = xp = malloc(sizeof(int) * NUM); if (!ptr) return NULL; do { /* wait for next retrace */ *xp = read_DDC(pScrn); xp++; } while (--count); return ptr; } /* test if DDC1 return 0 if not */ static Bool TestDDC1(ScrnInfoPtr pScrn, unsigned int (*read_DDC) (ScrnInfoPtr)) { int old, count; old = read_DDC(pScrn); count = HEADER * BITS_PER_BYTE; do { /* wait for next retrace */ if (old != read_DDC(pScrn)) break; } while (count--); return count; } /* * read EDID record , pass it to callback function to interpret. * callback function will store it for further use by calling * function; it will also decide if we need to reread it */ static unsigned char * EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed, unsigned int (*read_DDC) (ScrnInfoPtr)) { unsigned char *EDID_block = NULL; int count = RETRIES; if (!read_DDC) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "chipset doesn't support DDC1\n"); return NULL; }; if (TestDDC1(pScrn, read_DDC) == -1) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "No DDC signal\n"); return NULL; }; if (DDCSpeed) DDCSpeed(pScrn, DDC_FAST); do { EDID_block = GetEDID_DDC1(FetchEDID_DDC1(pScrn, read_DDC)); count--; } while (!EDID_block && count); if (DDCSpeed) DDCSpeed(pScrn, DDC_SLOW); return EDID_block; } /** * Attempts to probe the monitor for EDID information, if NoDDC and NoDDC1 are * unset. EDID information blocks are interpreted and the results returned in * an xf86MonPtr. * * This function does not affect the list of modes used by drivers -- it is up * to the driver to decide policy on what to do with EDID information. * * @return pointer to a new xf86MonPtr containing the EDID information. * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed, unsigned int (*DDC1Read) (ScrnInfoPtr)) { unsigned char *EDID_block = NULL; xf86MonPtr tmp = NULL; /* Default DDC and DDC1 to enabled. */ Bool noddc = FALSE, noddc1 = FALSE; OptionInfoPtr options; options = xnfalloc(sizeof(DDCOptions)); (void) memcpy(options, DDCOptions, sizeof(DDCOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); xf86GetOptValBool(options, DDCOPT_NODDC1, &noddc1); free(options); if (noddc || noddc1) return NULL; OsBlockSignals(); EDID_block = EDIDRead_DDC1(pScrn, DDC1SetSpeed, DDC1Read); OsReleaseSignals(); if (EDID_block) { tmp = xf86InterpretEDID(pScrn->scrnIndex, EDID_block); } #ifdef DEBUG else ErrorF("No EDID block returned\n"); if (!tmp) ErrorF("Cannot interpret EDID block\n"); #endif return tmp; } /* DDC2 */ static I2CDevPtr DDC2MakeDevice(I2CBusPtr pBus, int address, const char *name) { I2CDevPtr dev = NULL; if (!(dev = xf86I2CFindDev(pBus, address))) { dev = xf86CreateI2CDevRec(); dev->DevName = name; dev->SlaveAddr = address; dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */ dev->StartTimeout = 550; dev->BitTimeout = 40; dev->AcknTimeout = 40; dev->pI2CBus = pBus; if (!xf86I2CDevInit(dev)) { xf86DrvMsg(pBus->scrnIndex, X_PROBED, "No DDC2 device\n"); return NULL; } } return dev; } static I2CDevPtr DDC2Init(I2CBusPtr pBus) { I2CDevPtr dev = NULL; /* * Slow down the bus so that older monitors don't * miss things. */ pBus->RiseFallTime = 20; dev = DDC2MakeDevice(pBus, 0x00A0, "ddc2"); if (xf86I2CProbeAddress(pBus, 0x0060)) DDC2MakeDevice(pBus, 0x0060, "E-EDID segment register"); return dev; } /* Mmmm, smell the hacks */ static void EEDIDStop(I2CDevPtr d) { } /* block is the EDID block number. a segment is two blocks. */ static Bool DDC2Read(I2CDevPtr dev, int block, unsigned char *R_Buffer) { unsigned char W_Buffer[1]; int i, segment; I2CDevPtr seg; void (*stop) (I2CDevPtr); for (i = 0; i < RETRIES; i++) { /* Stop bits reset the segment pointer to 0, so be careful here. */ segment = block >> 1; if (segment) { Bool b; if (!(seg = xf86I2CFindDev(dev->pI2CBus, 0x0060))) return FALSE; W_Buffer[0] = segment; stop = dev->pI2CBus->I2CStop; dev->pI2CBus->I2CStop = EEDIDStop; b = xf86I2CWriteRead(seg, W_Buffer, 1, NULL, 0); dev->pI2CBus->I2CStop = stop; if (!b) { dev->pI2CBus->I2CStop(dev); continue; } } W_Buffer[0] = (block & 0x01) * EDID1_LEN; if (xf86I2CWriteRead(dev, W_Buffer, 1, R_Buffer, EDID1_LEN)) { if (!DDC_checksum(R_Buffer, EDID1_LEN)) return TRUE; } } return FALSE; } /** * Attempts to probe the monitor for EDID information, if NoDDC and NoDDC2 are * unset. EDID information blocks are interpreted and the results returned in * an xf86MonPtr. Unlike xf86DoEDID_DDC[12](), this function will return * the complete EDID data, including all extension blocks, if the 'complete' * parameter is TRUE; * * This function does not affect the list of modes used by drivers -- it is up * to the driver to decide policy on what to do with EDID information. * * @return pointer to a new xf86MonPtr containing the EDID information. * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool complete) { unsigned char *EDID_block = NULL; xf86MonPtr tmp = NULL; I2CDevPtr dev = NULL; /* Default DDC and DDC2 to enabled. */ Bool noddc = FALSE, noddc2 = FALSE; OptionInfoPtr options; options = malloc(sizeof(DDCOptions)); if (!options) return NULL; memcpy(options, DDCOptions, sizeof(DDCOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2); free(options); if (noddc || noddc2) return NULL; if (!(dev = DDC2Init(pBus))) return NULL; EDID_block = calloc(1, EDID1_LEN); if (!EDID_block) return NULL; if (DDC2Read(dev, 0, EDID_block)) { int i, n = EDID_block[0x7e]; if (complete && n) { EDID_block = realloc(EDID_block, EDID1_LEN * (1 + n)); for (i = 0; i < n; i++) DDC2Read(dev, i + 1, EDID_block + (EDID1_LEN * (1 + i))); } tmp = xf86InterpretEEDID(pScrn->scrnIndex, EDID_block); } if (tmp && complete) tmp->flags |= MONITOR_EDID_COMPLETE_RAWDATA; return tmp; } /** * Attempts to probe the monitor for EDID information, if NoDDC and NoDDC2 are * unset. EDID information blocks are interpreted and the results returned in * an xf86MonPtr. * * This function does not affect the list of modes used by drivers -- it is up * to the driver to decide policy on what to do with EDID information. * * @return pointer to a new xf86MonPtr containing the EDID information. * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus) { return xf86DoEEDID(pScrn, pBus, FALSE); } xorg-server-1.17.1/hw/xfree86/ddc/edid.h0000664000175100017510000004533712456571574014562 00000000000000/* * edid.h: defines to parse an EDID block * * This file contains all information to interpret a standard EDIC block * transmitted by a display device via DDC (Display Data Channel). So far * there is no information to deal with optional EDID blocks. * DDC is a Trademark of VESA (Video Electronics Standard Association). * * Copyright 1998 by Egbert Eich */ #ifndef _EDID_H_ #define _EDID_H_ #include #ifndef _X_EXPORT #include #endif /* read complete EDID record */ #define EDID1_LEN 128 #define BITS_PER_BYTE 9 #define NUM BITS_PER_BYTE*EDID1_LEN #define HEADER 6 #define STD_TIMINGS 8 #define DET_TIMINGS 4 #ifdef _PARSE_EDID_ /* header: 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 */ #define HEADER_SECTION 0 #define HEADER_LENGTH 8 /* vendor section */ #define VENDOR_SECTION (HEADER_SECTION + HEADER_LENGTH) #define V_MANUFACTURER 0 #define V_PROD_ID (V_MANUFACTURER + 2) #define V_SERIAL (V_PROD_ID + 2) #define V_WEEK (V_SERIAL + 4) #define V_YEAR (V_WEEK + 1) #define VENDOR_LENGTH (V_YEAR + 1) /* EDID version */ #define VERSION_SECTION (VENDOR_SECTION + VENDOR_LENGTH) #define V_VERSION 0 #define V_REVISION (V_VERSION + 1) #define VERSION_LENGTH (V_REVISION + 1) /* display information */ #define DISPLAY_SECTION (VERSION_SECTION + VERSION_LENGTH) #define D_INPUT 0 #define D_HSIZE (D_INPUT + 1) #define D_VSIZE (D_HSIZE + 1) #define D_GAMMA (D_VSIZE + 1) #define FEAT_S (D_GAMMA + 1) #define D_RG_LOW (FEAT_S + 1) #define D_BW_LOW (D_RG_LOW + 1) #define D_REDX (D_BW_LOW + 1) #define D_REDY (D_REDX + 1) #define D_GREENX (D_REDY + 1) #define D_GREENY (D_GREENX + 1) #define D_BLUEX (D_GREENY + 1) #define D_BLUEY (D_BLUEX + 1) #define D_WHITEX (D_BLUEY + 1) #define D_WHITEY (D_WHITEX + 1) #define DISPLAY_LENGTH (D_WHITEY + 1) /* supported VESA and other standard timings */ #define ESTABLISHED_TIMING_SECTION (DISPLAY_SECTION + DISPLAY_LENGTH) #define E_T1 0 #define E_T2 (E_T1 + 1) #define E_TMANU (E_T2 + 1) #define E_TIMING_LENGTH (E_TMANU + 1) /* non predefined standard timings supported by display */ #define STD_TIMING_SECTION (ESTABLISHED_TIMING_SECTION + E_TIMING_LENGTH) #define STD_TIMING_INFO_LEN 2 #define STD_TIMING_INFO_NUM STD_TIMINGS #define STD_TIMING_LENGTH (STD_TIMING_INFO_LEN * STD_TIMING_INFO_NUM) /* detailed timing info of non standard timings */ #define DET_TIMING_SECTION (STD_TIMING_SECTION + STD_TIMING_LENGTH) #define DET_TIMING_INFO_LEN 18 #define MONITOR_DESC_LEN DET_TIMING_INFO_LEN #define DET_TIMING_INFO_NUM DET_TIMINGS #define DET_TIMING_LENGTH (DET_TIMING_INFO_LEN * DET_TIMING_INFO_NUM) /* number of EDID sections to follow */ #define NO_EDID (DET_TIMING_SECTION + DET_TIMING_LENGTH) /* one byte checksum */ #define CHECKSUM (NO_EDID + 1) #if (CHECKSUM != (EDID1_LEN - 1)) #error "EDID1 length != 128!" #endif #define SECTION(x,y) (Uchar *)(x + y) #define GET_ARRAY(y) ((Uchar *)(c + y)) #define GET(y) *(Uchar *)(c + y) /* extract information from vendor section */ #define _PROD_ID(x) x[0] + (x[1] << 8); #define PROD_ID _PROD_ID(GET_ARRAY(V_PROD_ID)) #define _SERIAL_NO(x) x[0] + (x[1] << 8) + (x[2] << 16) + (x[3] << 24) #define SERIAL_NO _SERIAL_NO(GET_ARRAY(V_SERIAL)) #define _YEAR(x) (x & 0xFF) + 1990 #define YEAR _YEAR(GET(V_YEAR)) #define WEEK GET(V_WEEK) & 0xFF #define _L1(x) ((x[0] & 0x7C) >> 2) + '@' #define _L2(x) ((x[0] & 0x03) << 3) + ((x[1] & 0xE0) >> 5) + '@' #define _L3(x) (x[1] & 0x1F) + '@'; #define L1 _L1(GET_ARRAY(V_MANUFACTURER)) #define L2 _L2(GET_ARRAY(V_MANUFACTURER)) #define L3 _L3(GET_ARRAY(V_MANUFACTURER)) /* extract information from version section */ #define VERSION GET(V_VERSION) #define REVISION GET(V_REVISION) /* extract information from display section */ #define _INPUT_TYPE(x) ((x & 0x80) >> 7) #define INPUT_TYPE _INPUT_TYPE(GET(D_INPUT)) #define _INPUT_VOLTAGE(x) ((x & 0x60) >> 5) #define INPUT_VOLTAGE _INPUT_VOLTAGE(GET(D_INPUT)) #define _SETUP(x) ((x & 0x10) >> 4) #define SETUP _SETUP(GET(D_INPUT)) #define _SYNC(x) (x & 0x0F) #define SYNC _SYNC(GET(D_INPUT)) #define _DFP(x) (x & 0x01) #define DFP _DFP(GET(D_INPUT)) #define _BPC(x) ((x & 0x70) >> 4) #define BPC _BPC(GET(D_INPUT)) #define _DIGITAL_INTERFACE(x) (x & 0x0F) #define DIGITAL_INTERFACE _DIGITAL_INTERFACE(GET(D_INPUT)) #define _GAMMA(x) (x == 0xff ? 0.0 : ((x + 100.0)/100.0)) #define GAMMA _GAMMA(GET(D_GAMMA)) #define HSIZE_MAX GET(D_HSIZE) #define VSIZE_MAX GET(D_VSIZE) #define _DPMS(x) ((x & 0xE0) >> 5) #define DPMS _DPMS(GET(FEAT_S)) #define _DISPLAY_TYPE(x) ((x & 0x18) >> 3) #define DISPLAY_TYPE _DISPLAY_TYPE(GET(FEAT_S)) #define _MSC(x) (x & 0x7) #define MSC _MSC(GET(FEAT_S)) /* color characteristics */ #define CC_L(x,y) ((x & (0x03 << y)) >> y) #define CC_H(x) (x << 2) #define I_CC(x,y,z) CC_H(y) | CC_L(x,z) #define F_CC(x) ((x)/1024.0) #define REDX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDX)),6)) #define REDY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDY)),4)) #define GREENX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENX)),2)) #define GREENY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENY)),0)) #define BLUEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEX)),6)) #define BLUEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEY)),4)) #define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2)) #define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0)) /* extract information from standard timing section */ #define T1 GET(E_T1) #define T2 GET(E_T2) #define T_MANU GET(E_TMANU) /* extract information from estabished timing section */ #define _VALID_TIMING(x) !(((x[0] == 0x01) && (x[1] == 0x01)) \ || ((x[0] == 0x00) && (x[1] == 0x00)) \ || ((x[0] == 0x20) && (x[1] == 0x20)) ) #define VALID_TIMING _VALID_TIMING(c) #define _HSIZE1(x) ((x[0] + 31) * 8) #define HSIZE1 _HSIZE1(c) #define RATIO(x) ((x[1] & 0xC0) >> 6) #define RATIO1_1 0 /* EDID Ver. 1.3 redefined this */ #define RATIO16_10 RATIO1_1 #define RATIO4_3 1 #define RATIO5_4 2 #define RATIO16_9 3 #define _VSIZE1(x,y,r) switch(RATIO(x)){ \ case RATIO1_1: y = ((v->version > 1 || v->revision > 2) \ ? (_HSIZE1(x) * 10) / 16 : _HSIZE1(x)); break; \ case RATIO4_3: y = _HSIZE1(x) * 3 / 4; break; \ case RATIO5_4: y = _HSIZE1(x) * 4 / 5; break; \ case RATIO16_9: y = _HSIZE1(x) * 9 / 16; break; \ } #define VSIZE1(x) _VSIZE1(c,x,v) #define _REFRESH_R(x) (x[1] & 0x3F) + 60 #define REFRESH_R _REFRESH_R(c) #define _ID_LOW(x) x[0] #define ID_LOW _ID_LOW(c) #define _ID_HIGH(x) (x[1] << 8) #define ID_HIGH _ID_HIGH(c) #define STD_TIMING_ID (ID_LOW | ID_HIGH) #define _NEXT_STD_TIMING(x) (x = (x + STD_TIMING_INFO_LEN)) #define NEXT_STD_TIMING _NEXT_STD_TIMING(c) /* EDID Ver. >= 1.2 */ /** * Returns true if the pointer is the start of a monitor descriptor block * instead of a detailed timing descriptor. * * Checking the reserved pad fields for zeroes fails on some monitors with * broken empty ASCII strings. Only the first two bytes are reliable. */ #define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0) #define IS_MONITOR_DESC _IS_MONITOR_DESC(c) #define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000 #define PIXEL_CLOCK _PIXEL_CLOCK(c) #define _H_ACTIVE(x) (x[2] + ((x[4] & 0xF0) << 4)) #define H_ACTIVE _H_ACTIVE(c) #define _H_BLANK(x) (x[3] + ((x[4] & 0x0F) << 8)) #define H_BLANK _H_BLANK(c) #define _V_ACTIVE(x) (x[5] + ((x[7] & 0xF0) << 4)) #define V_ACTIVE _V_ACTIVE(c) #define _V_BLANK(x) (x[6] + ((x[7] & 0x0F) << 8)) #define V_BLANK _V_BLANK(c) #define _H_SYNC_OFF(x) (x[8] + ((x[11] & 0xC0) << 2)) #define H_SYNC_OFF _H_SYNC_OFF(c) #define _H_SYNC_WIDTH(x) (x[9] + ((x[11] & 0x30) << 4)) #define H_SYNC_WIDTH _H_SYNC_WIDTH(c) #define _V_SYNC_OFF(x) ((x[10] >> 4) + ((x[11] & 0x0C) << 2)) #define V_SYNC_OFF _V_SYNC_OFF(c) #define _V_SYNC_WIDTH(x) ((x[10] & 0x0F) + ((x[11] & 0x03) << 4)) #define V_SYNC_WIDTH _V_SYNC_WIDTH(c) #define _H_SIZE(x) (x[12] + ((x[14] & 0xF0) << 4)) #define H_SIZE _H_SIZE(c) #define _V_SIZE(x) (x[13] + ((x[14] & 0x0F) << 8)) #define V_SIZE _V_SIZE(c) #define _H_BORDER(x) (x[15]) #define H_BORDER _H_BORDER(c) #define _V_BORDER(x) (x[16]) #define V_BORDER _V_BORDER(c) #define _INTERLACED(x) ((x[17] & 0x80) >> 7) #define INTERLACED _INTERLACED(c) #define _STEREO(x) ((x[17] & 0x60) >> 5) #define STEREO _STEREO(c) #define _STEREO1(x) (x[17] & 0x1) #define STEREO1 _STEREO(c) #define _SYNC_T(x) ((x[17] & 0x18) >> 3) #define SYNC_T _SYNC_T(c) #define _MISC(x) ((x[17] & 0x06) >> 1) #define MISC _MISC(c) #define _MONITOR_DESC_TYPE(x) x[3] #define MONITOR_DESC_TYPE _MONITOR_DESC_TYPE(c) #define SERIAL_NUMBER 0xFF #define ASCII_STR 0xFE #define MONITOR_RANGES 0xFD #define _MIN_V_OFFSET(x) ((!!(x[4] & 0x01)) * 255) #define _MAX_V_OFFSET(x) ((!!(x[4] & 0x02)) * 255) #define _MIN_H_OFFSET(x) ((!!(x[4] & 0x04)) * 255) #define _MAX_H_OFFSET(x) ((!!(x[4] & 0x08)) * 255) #define _MIN_V(x) x[5] #define MIN_V (_MIN_V(c) + _MIN_V_OFFSET(c)) #define _MAX_V(x) x[6] #define MAX_V (_MAX_V(c) + _MAX_V_OFFSET(c)) #define _MIN_H(x) x[7] #define MIN_H (_MIN_H(c) + _MIN_H_OFFSET(c)) #define _MAX_H(x) x[8] #define MAX_H (_MAX_H(c) + _MAX_H_OFFSET(c)) #define _MAX_CLOCK(x) x[9] #define MAX_CLOCK _MAX_CLOCK(c) #define _HAVE_2ND_GTF(x) (x[10] == 0x02) #define HAVE_2ND_GTF _HAVE_2ND_GTF(c) #define _F_2ND_GTF(x) (x[12] * 2) #define F_2ND_GTF _F_2ND_GTF(c) #define _C_2ND_GTF(x) (x[13] / 2) #define C_2ND_GTF _C_2ND_GTF(c) #define _M_2ND_GTF(x) (x[14] + (x[15] << 8)) #define M_2ND_GTF _M_2ND_GTF(c) #define _K_2ND_GTF(x) (x[16]) #define K_2ND_GTF _K_2ND_GTF(c) #define _J_2ND_GTF(x) (x[17] / 2) #define J_2ND_GTF _J_2ND_GTF(c) #define _HAVE_CVT(x) (x[10] == 0x04) #define HAVE_CVT _HAVE_CVT(c) #define _MAX_CLOCK_KHZ(x) (x[12] >> 2) #define MAX_CLOCK_KHZ (MAX_CLOCK * 10000) - (_MAX_CLOCK_KHZ(c) * 250) #define _MAXWIDTH(x) ((x[13] == 0 ? 0 : x[13] + ((x[12] & 0x03) << 8)) * 8) #define MAXWIDTH _MAXWIDTH(c) #define _SUPPORTED_ASPECT(x) x[14] #define SUPPORTED_ASPECT _SUPPORTED_ASPECT(c) #define SUPPORTED_ASPECT_4_3 0x80 #define SUPPORTED_ASPECT_16_9 0x40 #define SUPPORTED_ASPECT_16_10 0x20 #define SUPPORTED_ASPECT_5_4 0x10 #define SUPPORTED_ASPECT_15_9 0x08 #define _PREFERRED_ASPECT(x) ((x[15] & 0xe0) >> 5) #define PREFERRED_ASPECT _PREFERRED_ASPECT(c) #define PREFERRED_ASPECT_4_3 0 #define PREFERRED_ASPECT_16_9 1 #define PREFERRED_ASPECT_16_10 2 #define PREFERRED_ASPECT_5_4 3 #define PREFERRED_ASPECT_15_9 4 #define _SUPPORTED_BLANKING(x) ((x[15] & 0x18) >> 3) #define SUPPORTED_BLANKING _SUPPORTED_BLANKING(c) #define CVT_STANDARD 0x01 #define CVT_REDUCED 0x02 #define _SUPPORTED_SCALING(x) ((x[16] & 0xf0) >> 4) #define SUPPORTED_SCALING _SUPPORTED_SCALING(c) #define SCALING_HSHRINK 0x08 #define SCALING_HSTRETCH 0x04 #define SCALING_VSHRINK 0x02 #define SCALING_VSTRETCH 0x01 #define _PREFERRED_REFRESH(x) x[17] #define PREFERRED_REFRESH _PREFERRED_REFRESH(c) #define MONITOR_NAME 0xFC #define ADD_COLOR_POINT 0xFB #define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2)) #define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0)) #define _WHITEX_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 1)),2)) #define _WHITEY_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 2)),0)) #define _WHITE_INDEX1(x) x[5] #define WHITE_INDEX1 _WHITE_INDEX1(c) #define _WHITE_INDEX2(x) x[10] #define WHITE_INDEX2 _WHITE_INDEX2(c) #define WHITEX1 _WHITEX_ADD(c,6) #define WHITEY1 _WHITEY_ADD(c,6) #define WHITEX2 _WHITEX_ADD(c,12) #define WHITEY2 _WHITEY_ADD(c,12) #define _WHITE_GAMMA1(x) _GAMMA(x[9]) #define WHITE_GAMMA1 _WHITE_GAMMA1(c) #define _WHITE_GAMMA2(x) _GAMMA(x[14]) #define WHITE_GAMMA2 _WHITE_GAMMA2(c) #define ADD_STD_TIMINGS 0xFA #define COLOR_MANAGEMENT_DATA 0xF9 #define CVT_3BYTE_DATA 0xF8 #define ADD_EST_TIMINGS 0xF7 #define ADD_DUMMY 0x10 #define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN)) #define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION(c) #endif /* _PARSE_EDID_ */ /* input type */ #define DIGITAL(x) x /* DFP */ #define DFP1(x) x /* input voltage level */ #define V070 0 /* 0.700V/0.300V */ #define V071 1 /* 0.714V/0.286V */ #define V100 2 /* 1.000V/0.400V */ #define V007 3 /* 0.700V/0.000V */ /* Signal level setup */ #define SIG_SETUP(x) (x) /* sync characteristics */ #define SEP_SYNC(x) (x & 0x08) #define COMP_SYNC(x) (x & 0x04) #define SYNC_O_GREEN(x) (x & 0x02) #define SYNC_SERR(x) (x & 0x01) /* DPMS features */ #define DPMS_STANDBY(x) (x & 0x04) #define DPMS_SUSPEND(x) (x & 0x02) #define DPMS_OFF(x) (x & 0x01) /* display type, analog */ #define DISP_MONO 0 #define DISP_RGB 1 #define DISP_MULTCOLOR 2 /* display color encodings, digital */ #define DISP_YCRCB444 0x01 #define DISP_YCRCB422 0x02 /* Msc stuff EDID Ver > 1.1 */ #define STD_COLOR_SPACE(x) (x & 0x4) #define PREFERRED_TIMING_MODE(x) (x & 0x2) #define GFT_SUPPORTED(x) (x & 0x1) #define GTF_SUPPORTED(x) (x & 0x1) #define CVT_SUPPORTED(x) (x & 0x1) /* detailed timing misc */ #define IS_INTERLACED(x) (x) #define IS_STEREO(x) (x) #define IS_RIGHT_STEREO(x) (x & 0x01) #define IS_LEFT_STEREO(x) (x & 0x02) #define IS_4WAY_STEREO(x) (x & 0x03) #define IS_RIGHT_ON_SYNC(x) IS_RIGHT_STEREO(x) #define IS_LEFT_ON_SYNC(x) IS_LEFT_STEREO(x) typedef unsigned int Uint; typedef unsigned char Uchar; struct vendor { char name[4]; int prod_id; Uint serial; int week; int year; }; struct edid_version { int version; int revision; }; struct disp_features { unsigned int input_type:1; unsigned int input_voltage:2; unsigned int input_setup:1; unsigned int input_sync:5; unsigned int input_dfp:1; unsigned int input_bpc:3; unsigned int input_interface:4; /* 15 bit hole */ int hsize; int vsize; float gamma; unsigned int dpms:3; unsigned int display_type:2; unsigned int msc:3; float redx; float redy; float greenx; float greeny; float bluex; float bluey; float whitex; float whitey; }; struct established_timings { Uchar t1; Uchar t2; Uchar t_manu; }; struct std_timings { int hsize; int vsize; int refresh; CARD16 id; }; struct detailed_timings { int clock; int h_active; int h_blanking; int v_active; int v_blanking; int h_sync_off; int h_sync_width; int v_sync_off; int v_sync_width; int h_size; int v_size; int h_border; int v_border; unsigned int interlaced:1; unsigned int stereo:2; unsigned int sync:2; unsigned int misc:2; unsigned int stereo_1:1; }; #define DT 0 #define DS_SERIAL 0xFF #define DS_ASCII_STR 0xFE #define DS_NAME 0xFC #define DS_RANGES 0xFD #define DS_WHITE_P 0xFB #define DS_STD_TIMINGS 0xFA #define DS_CMD 0xF9 #define DS_CVT 0xF8 #define DS_EST_III 0xF7 #define DS_DUMMY 0x10 #define DS_UNKOWN 0x100 /* type is an int */ #define DS_VENDOR 0x101 #define DS_VENDOR_MAX 0x110 struct monitor_ranges { int min_v; int max_v; int min_h; int max_h; int max_clock; /* in mhz */ int gtf_2nd_f; int gtf_2nd_c; int gtf_2nd_m; int gtf_2nd_k; int gtf_2nd_j; int max_clock_khz; int maxwidth; /* in pixels */ char supported_aspect; char preferred_aspect; char supported_blanking; char supported_scaling; int preferred_refresh; /* in hz */ }; struct whitePoints { int index; float white_x; float white_y; float white_gamma; }; struct cvt_timings { int width; int height; int rate; int rates; }; /* * Be careful when adding new sections; this structure can't grow, it's * embedded in the middle of xf86Monitor which is ABI. Sizes below are * in bytes, for ILP32 systems. If all else fails just copy the section * literally like serial and friends. */ struct detailed_monitor_section { int type; union { struct detailed_timings d_timings; /* 56 */ Uchar serial[13]; Uchar ascii_data[13]; Uchar name[13]; struct monitor_ranges ranges; /* 56 */ struct std_timings std_t[5]; /* 80 */ struct whitePoints wp[2]; /* 32 */ /* color management data */ struct cvt_timings cvt[4]; /* 64 */ Uchar est_iii[6]; /* 6 */ } section; /* max: 80 */ }; /* flags */ #define MONITOR_EDID_COMPLETE_RAWDATA 0x01 /* old, don't use */ #define EDID_COMPLETE_RAWDATA 0x01 #define MONITOR_DISPLAYID 0x02 /* * For DisplayID devices, only the scrnIndex, flags, and rawData fields * are meaningful. For EDID, they all are. */ typedef struct { int scrnIndex; struct vendor vendor; struct edid_version ver; struct disp_features features; struct established_timings timings1; struct std_timings timings2[8]; struct detailed_monitor_section det_mon[4]; unsigned long flags; int no_sections; Uchar *rawData; } xf86Monitor, *xf86MonPtr; extern _X_EXPORT xf86MonPtr ConfiguredMonitor; #define EXT_TAG 0 #define EXT_REV 1 #define CEA_EXT 0x02 #define VTB_EXT 0x10 #define DI_EXT 0x40 #define LS_EXT 0x50 #define MI_EXT 0x60 #define CEA_EXT_MIN_DATA_OFFSET 4 #define CEA_EXT_MAX_DATA_OFFSET 127 #define CEA_EXT_DET_TIMING_NUM 6 #define IEEE_ID_HDMI 0x000C03 #define CEA_AUDIO_BLK 1 #define CEA_VIDEO_BLK 2 #define CEA_VENDOR_BLK 3 #define CEA_SPEAKER_ALLOC_BLK 4 #define CEA_VESA_DTC_BLK 5 #define VENDOR_SUPPORT_AI(x) ((x) >> 7) #define VENDOR_SUPPORT_DC_48bit(x) ( ( (x) >> 6) & 0x01) #define VENDOR_SUPPORT_DC_36bit(x) ( ( (x) >> 5) & 0x01) #define VENDOR_SUPPORT_DC_30bit(x) ( ( (x) >> 4) & 0x01) #define VENDOR_SUPPORT_DC_Y444(x) ( ( (x) >> 3) & 0x01) #define VENDOR_LATENCY_PRESENT(x) ( (x) >> 7) #define VENDOR_LATENCY_PRESENT_I(x) ( ( (x) >> 6) & 0x01) #define HDMI_MAX_TMDS_UNIT (5000) struct cea_video_block { Uchar video_code; }; struct cea_audio_block_descriptor { Uchar audio_code[3]; }; struct cea_audio_block { struct cea_audio_block_descriptor descriptor[10]; }; struct cea_vendor_block_hdmi { Uchar portB:4; Uchar portA:4; Uchar portD:4; Uchar portC:4; Uchar support_flags; Uchar max_tmds_clock; Uchar latency_present; Uchar video_latency; Uchar audio_latency; Uchar interlaced_video_latency; Uchar interlaced_audio_latency; }; struct cea_vendor_block { unsigned char ieee_id[3]; union { struct cea_vendor_block_hdmi hdmi; /* any other vendor blocks we know about */ }; }; struct cea_speaker_block { Uchar FLR:1; Uchar LFE:1; Uchar FC:1; Uchar RLR:1; Uchar RC:1; Uchar FLRC:1; Uchar RLRC:1; Uchar FLRW:1; Uchar FLRH:1; Uchar TC:1; Uchar FCH:1; Uchar Resv:5; Uchar ResvByte; }; struct cea_data_block { Uchar len:5; Uchar tag:3; union { struct cea_video_block video; struct cea_audio_block audio; struct cea_vendor_block vendor; struct cea_speaker_block speaker; } u; }; struct cea_ext_body { Uchar tag; Uchar rev; Uchar dt_offset; Uchar flags; struct cea_data_block data_collection; }; #endif /* _EDID_H_ */ xorg-server-1.17.1/hw/xfree86/ddc/DDC.HOWTO0000664000175100017510000000723612160102336014666 00000000000000 DDC.HOWTO This file describes how to add DDC support to a chipset driver. 1) DDC INITIALIZATION When implementing DDC in the driver one has the choice between DDC1 and DDC2. DDC1 data is continuously transmitted by a DDC1 capable display device. The data is send serially over a data line; the Vsync signal serves as clock. Only one EDID 1.x data block can be transmitted using DDC1. Since transmission of an EDID1 block using a regular Vsync frequency would take up several seconds the driver can increase the Vsync frequency to up to 25 kHz as soon as it detects DDC1 activity on the data line. DDC2 data is transmitted using the I2C protocol. This requires an additional clock line. DDC2 is capable of transmitting EDID1 and EDID2 block as well as a VDIF block on display devices that support these. Display devices switch into the DDC2 mode as soon as they detect activity on the DDC clock line. Once the are in DDC2 mode they stop transmitting DDC1 signals until the next power cycle. Some graphics chipset configurations which are not capable of DDC2 might still be able to read DDC1 data. Where available DDC2 it is preferable. All relevant prototypes and defines are in xf86DDC.h. DDC2 additionally requires I2C support. The I2C prototypes are in xf86i2c.h. DDC1 Support: The driver has to provide a read function which waits for the end of the next Vsync signal and reads in and returns the status of the DDC line: unsigned int XXX_ddc1Read(ScrnInfoPtr pScrn) Additionally a function is required to increase the Vsync frequency to max. 25 kHz. void XXX_ddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed) If the speed argument is DDC_FAST the function should increase the Vsync frequency on DDC_SLOW it should restore the original value. For convenience a generic ddc1SetSpeed() function is provided in the vga module for VGA-like chipsets. void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, sf86ddcSpeed speed). To read out the DDC1 data the driver should call xf86MonPtr xf86DoEDID_DDC1(int scrnIndex, void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed), unsigned int (*DDC1Read)(ScrnInfoPtr)) in PreInit(). DDC1SetSpeed is a pointer to the SetSpeed() function, DDC1Read has to point to the DDC1 read function. The function will return a pointer to the xf86Monitor structure which contains all information retrieved by DDC. NULL will be returned on failure. DDC2 Support To read out DDC2 information I2C has to be initialized first. (See documentation for the i2c module). The function xf86MonPtr xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) is provided to read out and process DDC2 data. A pointer to the I2CBusRec of the appropriate I2C Bus has to be passed as the second argument. The function will return a pointer to the xf86Monitor structure which contains all information retrieved by DDC. NULL will be returned on failure. Printing monitor parameters To print out the information contained in the xf86Monitor structure the function xf86MonPtr xf86PrintEDID(xf86MonPtr monitor) is provided. Further processing of the xf86Monitor structure is not yet implemented. However, it is planned to use the information about video modes, gamma values etc. Therefore it is strongly recommended to read out DDC data before any video mode processing is done. $XFree86: xc/programs/Xserver/hw/xfree86/ddc/DDC.HOWTO,v 1.2 1998/12/06 13:30:39 dawes Exp $ xorg-server-1.17.1/hw/xfree86/int10/0000775000175100017510000000000012466505444013743 500000000000000xorg-server-1.17.1/hw/xfree86/int10/Makefile.am0000664000175100017510000000201412200102654015672 00000000000000module_LTLIBRARIES = libint10.la sdk_HEADERS = xf86int10.h EXTRA_CFLAGS = libint10_la_LDFLAGS = -avoid-version libint10_la_LIBADD = $(PCIACCESS_LIBS) COMMON_SOURCES = \ helper_exec.c \ helper_mem.c \ xf86int10.c \ xf86int10module.c if I386_VIDEO I386_VIDEO_CFLAGS = -D_PC endif AM_CPPFLAGS = $(XORG_INCS) if INT10_VM86 AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS) libint10_la_SOURCES = \ $(COMMON_SOURCES) \ $(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c \ $(srcdir)/../os-support/linux/int10/linux.c endif if INT10_X86EMU AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_X86EMU -DNO_SYS_HEADERS \ $(XORG_CFLAGS) $(EXTRA_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS += -I$(srcdir)/../x86emu libint10_la_SOURCES = \ $(COMMON_SOURCES) \ xf86x86emu.c \ generic.c \ x86emu.c endif if INT10_STUB AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS) libint10_la_SOURCES = stub.c xf86int10module.c endif EXTRA_DIST = xf86x86emu.h INT10.HOWTO xorg-server-1.17.1/hw/xfree86/int10/helper_exec.c0000664000175100017510000005170512366220413016307 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich * * Part of this code was inspired by the VBIOS POSTing code in DOSEMU * developed by the "DOSEMU-Development-Team" */ /* * To debug port accesses define PRINT_PORT to 1. * Note! You also have to comment out ioperm() * in xf86EnableIO(). Otherwise we won't trap * on PIO. */ #ifdef HAVE_XORG_CONFIG_H #include #endif #define PRINT_PORT 0 #include #include #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" #define _INT10_PRIVATE #include "int10Defines.h" #include "xf86int10.h" #include "Pci.h" #ifdef _X86EMU #include "x86emu/x86emui.h" #else #define DEBUG_IO_TRACE() 0 #endif #include static int pciCfg1in(uint16_t addr, uint32_t *val); static int pciCfg1out(uint16_t addr, uint32_t val); static int pciCfg1inw(uint16_t addr, uint16_t *val); static int pciCfg1outw(uint16_t addr, uint16_t val); static int pciCfg1inb(uint16_t addr, uint8_t *val); static int pciCfg1outb(uint16_t addr, uint8_t val); #if defined (_PC) static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set); #endif #define REG pInt int setup_int(xf86Int10InfoPtr pInt) { if (pInt != Int10Current) { if (!MapCurrentInt10(pInt)) return -1; Int10Current = pInt; } X86_EAX = (uint32_t) pInt->ax; X86_EBX = (uint32_t) pInt->bx; X86_ECX = (uint32_t) pInt->cx; X86_EDX = (uint32_t) pInt->dx; X86_ESI = (uint32_t) pInt->si; X86_EDI = (uint32_t) pInt->di; X86_EBP = (uint32_t) pInt->bp; X86_ESP = 0x1000; X86_SS = pInt->stackseg >> 4; X86_EIP = 0x0600; X86_CS = 0x0; /* address of 'hlt' */ X86_DS = 0x40; /* standard pc ds */ X86_ES = pInt->es; X86_FS = 0; X86_GS = 0; X86_EFLAGS = X86_IF_MASK | X86_IOPL_MASK; #if defined (_PC) if (pInt->Flags & SET_BIOS_SCRATCH) SetResetBIOSVars(pInt, TRUE); #endif OsBlockSignals(); return 0; } void finish_int(xf86Int10InfoPtr pInt, int sig) { OsReleaseSignals(); pInt->ax = (uint32_t) X86_EAX; pInt->bx = (uint32_t) X86_EBX; pInt->cx = (uint32_t) X86_ECX; pInt->dx = (uint32_t) X86_EDX; pInt->si = (uint32_t) X86_ESI; pInt->di = (uint32_t) X86_EDI; pInt->es = (uint16_t) X86_ES; pInt->bp = (uint32_t) X86_EBP; pInt->flags = (uint32_t) X86_FLAGS; #if defined (_PC) if (pInt->Flags & RESTORE_BIOS_SCRATCH) SetResetBIOSVars(pInt, FALSE); #endif } /* general software interrupt handler */ uint32_t getIntVect(xf86Int10InfoPtr pInt, int num) { return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4); } void pushw(xf86Int10InfoPtr pInt, uint16_t val) { X86_ESP -= 2; MEM_WW(pInt, ((uint32_t) X86_SS << 4) + X86_SP, val); } int run_bios_int(int num, xf86Int10InfoPtr pInt) { uint32_t eflags; #ifndef _PC /* check if bios vector is initialized */ if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ? */ if (num == 21 && X86_AH == 0x4e) { xf86DrvMsg(pInt->pScrn->scrnIndex, X_NOTICE, "Failing Find-Matching-File on non-PC" " (int 21, func 4e)\n"); X86_AX = 2; SET_FLAG(F_CF); return 1; } else { xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "Ignoring int 0x%02x call\n", num); if (xf86GetVerbosity() > 3) { dump_registers(pInt); stack_trace(pInt); } return 1; } } #endif #ifdef PRINT_INT ErrorF("calling card BIOS at: "); #endif eflags = X86_EFLAGS; #if 0 eflags = eflags | IF_MASK; X86_EFLAGS = X86_EFLAGS & ~(VIF_MASK | TF_MASK | IF_MASK | NT_MASK); #endif pushw(pInt, eflags); pushw(pInt, X86_CS); pushw(pInt, X86_IP); X86_CS = MEM_RW(pInt, (num << 2) + 2); X86_IP = MEM_RW(pInt, num << 2); #ifdef PRINT_INT ErrorF("0x%x:%lx\n", X86_CS, X86_EIP); #endif return 1; } /* Debugging stuff */ void dump_code(xf86Int10InfoPtr pInt) { int i; uint32_t lina = SEG_ADR((uint32_t), X86_CS, IP); xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", (unsigned) lina); for (i = 0; i < 0x10; i++) xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i)); xf86ErrorFVerb(3, "\n"); for (; i < 0x20; i++) xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i)); xf86ErrorFVerb(3, "\n"); } void dump_registers(xf86Int10InfoPtr pInt) { 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->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->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->pScrn->scrnIndex, X_INFO, 3, "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n", (unsigned long) X86_EIP, (unsigned long) X86_EFLAGS); } void stack_trace(xf86Int10InfoPtr pInt) { int i = 0; unsigned long stack = SEG_ADR((uint32_t), X86_SS, SP); unsigned long tail = (uint32_t) ((X86_SS << 4) + 0x1000); if (stack >= tail) return; xf86MsgVerb(X_INFO, 3, "stack at 0x%8.8lx:\n", stack); for (; stack < tail; stack++) { xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, stack)); i = (i + 1) % 0x10; if (!i) xf86ErrorFVerb(3, "\n"); } if (i) xf86ErrorFVerb(3, "\n"); } int port_rep_inb(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -1 : 1; uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_insb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { MEM_WB(pInt, dst, x_inb(port)); dst += inc; } return dst - base; } int port_rep_inw(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -2 : 2; uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_insw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { MEM_WW(pInt, dst, x_inw(port)); dst += inc; } return dst - base; } int port_rep_inl(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -4 : 4; uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_insl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { MEM_WL(pInt, dst, x_inl(port)); dst += inc; } return dst - base; } int port_rep_outb(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -1 : 1; uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_outb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { x_outb(port, MEM_RB(pInt, dst)); dst += inc; } return dst - base; } int port_rep_outw(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -2 : 2; uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_outw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { x_outw(port, MEM_RW(pInt, dst)); dst += inc; } return dst - base; } int port_rep_outl(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -4 : 4; uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_outl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { x_outl(port, MEM_RL(pInt, dst)); dst += inc; } return dst - base; } uint8_t x_inb(uint16_t port) { uint8_t val; if (port == 0x40) { Int10Current->inb40time++; val = (uint8_t) (Int10Current->inb40time >> ((Int10Current->inb40time & 1) << 3)); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" inb(%#x) = %2.2x\n", port, val); #ifdef __NOT_YET__ } else if (port < 0x0100) { /* Don't interfere with mainboard */ val = 0; xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "inb 0x%4.4x\n", port); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); stack_trace(Int10Current); } #endif /* __NOT_YET__ */ } else if (!pciCfg1inb(port, &val)) { val = pci_io_read8(Int10Current->io, port); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" inb(%#x) = %2.2x\n", port, val); } return val; } uint16_t x_inw(uint16_t port) { uint16_t val; if (port == 0x5c) { struct timeval tv; /* * Emulate a PC's timer. Typical resolution is 3.26 usec. * Approximate this by dividing by 3. */ X_GETTIMEOFDAY(&tv); val = (uint16_t) (tv.tv_usec / 3); } else if (!pciCfg1inw(port, &val)) { val = pci_io_read16(Int10Current->io, port); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" inw(%#x) = %4.4x\n", port, val); } return val; } void x_outb(uint16_t port, uint8_t val) { if ((port == 0x43) && (val == 0)) { struct timeval tv; /* * Emulate a PC's timer 0. Such timers typically have a resolution of * some .838 usec per tick, but this can only provide 1 usec per tick. * (Not that this matters much, given inherent emulation delays.) Use * the bottom bit as a byte select. See inb(0x40) above. */ X_GETTIMEOFDAY(&tv); Int10Current->inb40time = (uint16_t) (tv.tv_usec | 1); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" outb(%#x, %2.2x)\n", port, val); #ifdef __NOT_YET__ } else if (port < 0x0100) { /* Don't interfere with mainboard */ xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "outb 0x%4.4x,0x%2.2x\n", port, val); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); stack_trace(Int10Current); } #endif /* __NOT_YET__ */ } else if (!pciCfg1outb(port, val)) { if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" outb(%#x, %2.2x)\n", port, val); pci_io_write8(Int10Current->io, port, val); } } void x_outw(uint16_t port, uint16_t val) { if (!pciCfg1outw(port, val)) { if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" outw(%#x, %4.4x)\n", port, val); pci_io_write16(Int10Current->io, port, val); } } uint32_t x_inl(uint16_t port) { uint32_t val; if (!pciCfg1in(port, &val)) { val = pci_io_read32(Int10Current->io, port); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, (unsigned) val); } return val; } void x_outl(uint16_t port, uint32_t val) { if (!pciCfg1out(port, val)) { if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, (unsigned) val); pci_io_write32(Int10Current->io, port, val); } } uint8_t Mem_rb(uint32_t addr) { return (*Int10Current->mem->rb) (Int10Current, addr); } uint16_t Mem_rw(uint32_t addr) { return (*Int10Current->mem->rw) (Int10Current, addr); } uint32_t Mem_rl(uint32_t addr) { return (*Int10Current->mem->rl) (Int10Current, addr); } void Mem_wb(uint32_t addr, uint8_t val) { (*Int10Current->mem->wb) (Int10Current, addr, val); } void Mem_ww(uint32_t addr, uint16_t val) { (*Int10Current->mem->ww) (Int10Current, addr, val); } void Mem_wl(uint32_t addr, uint32_t val) { (*Int10Current->mem->wl) (Int10Current, addr, val); } static uint32_t PciCfg1Addr = 0; #define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK)) #define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK)) #define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11) #define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8) #define PCI_OFFSET(x) ((x) & 0x000000ff) #define PCI_TAG(x) ((x) & 0x7fffff00) static struct pci_device * pci_device_for_cfg_address(uint32_t addr) { struct pci_device *dev = NULL; uint32_t tag = PCI_TAG(addr); struct pci_slot_match slot_match = { .domain = PCI_DOM_FROM_TAG(tag), .bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(tag)), .dev = PCI_DEV_FROM_TAG(tag), .func = PCI_FUNC_FROM_TAG(tag), .match_data = 0 }; struct pci_device_iterator *iter = pci_slot_match_iterator_create(&slot_match); if (iter) dev = pci_device_next(iter); pci_iterator_destroy(iter); return dev; } static int pciCfg1in(uint16_t addr, uint32_t *val) { if (addr == 0xCF8) { *val = PciCfg1Addr; return 1; } if (addr == 0xCFC) { pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr), (uint32_t *) val, PCI_OFFSET(PciCfg1Addr)); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", (unsigned) PciCfg1Addr, (unsigned) *val); return 1; } return 0; } static int pciCfg1out(uint16_t addr, uint32_t val) { if (addr == 0xCF8) { PciCfg1Addr = val; return 1; } if (addr == 0xCFC) { if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", (unsigned) PciCfg1Addr, (unsigned) val); pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr)); return 1; } return 0; } static int pciCfg1inw(uint16_t addr, uint16_t *val) { int shift; if ((addr >= 0xCF8) && (addr <= 0xCFB)) { shift = (addr - 0xCF8) * 8; *val = (PciCfg1Addr >> shift) & 0xffff; return 1; } if ((addr >= 0xCFC) && (addr <= 0xCFF)) { const unsigned offset = addr - 0xCFC; pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", (unsigned) (PciCfg1Addr + offset), (unsigned) *val); return 1; } return 0; } static int pciCfg1outw(uint16_t addr, uint16_t val) { int shift; if ((addr >= 0xCF8) && (addr <= 0xCFB)) { shift = (addr - 0xCF8) * 8; PciCfg1Addr &= ~(0xffff << shift); PciCfg1Addr |= ((uint32_t) val) << shift; return 1; } if ((addr >= 0xCFC) && (addr <= 0xCFF)) { const unsigned offset = addr - 0xCFC; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", (unsigned) (PciCfg1Addr + offset), (unsigned) val); pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); return 1; } return 0; } static int pciCfg1inb(uint16_t addr, uint8_t *val) { int shift; if ((addr >= 0xCF8) && (addr <= 0xCFB)) { shift = (addr - 0xCF8) * 8; *val = (PciCfg1Addr >> shift) & 0xff; return 1; } if ((addr >= 0xCFC) && (addr <= 0xCFF)) { const unsigned offset = addr - 0xCFC; pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", (unsigned) (PciCfg1Addr + offset), (unsigned) *val); return 1; } return 0; } static int pciCfg1outb(uint16_t addr, uint8_t val) { int shift; if ((addr >= 0xCF8) && (addr <= 0xCFB)) { shift = (addr - 0xCF8) * 8; PciCfg1Addr &= ~(0xff << shift); PciCfg1Addr |= ((uint32_t) val) << shift; return 1; } if ((addr >= 0xCFC) && (addr <= 0xCFF)) { const unsigned offset = addr - 0xCFC; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", (unsigned) (PciCfg1Addr + offset), (unsigned) val); pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); return 1; } return 0; } uint8_t bios_checksum(const uint8_t *start, int size) { uint8_t sum = 0; while (size-- > 0) sum += *start++; return sum; } /* * Lock/Unlock legacy VGA. Some Bioses try to be very clever and make * an attempt to detect a legacy ISA card. If they find one they might * act very strange: for example they might configure the card as a * monochrome card. This might cause some drivers to choke. * To avoid this we attempt legacy VGA by writing to all know VGA * disable registers before we call the BIOS initialization and * restore the original values afterwards. In beween we hold our * breath. To get to a (possibly exising) ISA card need to disable * our current PCI card. */ /* * This is just for booting: we just want to catch pure * legacy vga therefore we don't worry about mmio etc. * This stuff should really go into vgaHW.c. However then * the driver would have to load the vga-module prior to * doing int10. */ void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga) { vga->save_msr = pci_io_read8(pInt->io, 0x03CC); vga->save_vse = pci_io_read8(pInt->io, 0x03C3); #ifndef __ia64__ vga->save_46e8 = pci_io_read8(pInt->io, 0x46E8); #endif vga->save_pos102 = pci_io_read8(pInt->io, 0x0102); pci_io_write8(pInt->io, 0x03C2, ~(uint8_t) 0x03 & vga->save_msr); pci_io_write8(pInt->io, 0x03C3, ~(uint8_t) 0x01 & vga->save_vse); #ifndef __ia64__ pci_io_write8(pInt->io, 0x46E8, ~(uint8_t) 0x08 & vga->save_46e8); #endif pci_io_write8(pInt->io, 0x0102, ~(uint8_t) 0x01 & vga->save_pos102); } void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga) { pci_io_write8(pInt->io, 0x0102, vga->save_pos102); #ifndef __ia64__ pci_io_write8(pInt->io, 0x46E8, vga->save_46e8); #endif pci_io_write8(pInt->io, 0x03C3, vga->save_vse); pci_io_write8(pInt->io, 0x03C2, vga->save_msr); } #if defined (_PC) static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set) { int pagesize = getpagesize(); unsigned char *base; int i; if (pci_device_map_legacy (pInt->dev, 0, pagesize, PCI_DEV_MAP_FLAG_WRITABLE, (void **) &base)) return; /* eek */ if (set) { for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++) MEM_WW(pInt, i, *(base + i)); } else { for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++) *(base + i) = MEM_RW(pInt, i); } pci_device_unmap_legacy(pInt->dev, base, pagesize); } void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save) { int pagesize = getpagesize(); unsigned char *base; int i; if (!xf86IsEntityPrimary(pInt->entityIndex) || (!save && !pInt->BIOSScratch)) return; if (pci_device_map_legacy (pInt->dev, 0, pagesize, PCI_DEV_MAP_FLAG_WRITABLE, (void **) &base)) return; /* eek */ base += BIOS_SCRATCH_OFF; if (save) { if ((pInt->BIOSScratch = xnfalloc(BIOS_SCRATCH_LEN))) for (i = 0; i < BIOS_SCRATCH_LEN; i++) *(((char *) pInt->BIOSScratch + i)) = *(base + i); } else { if (pInt->BIOSScratch) { for (i = 0; i < BIOS_SCRATCH_LEN; i++) *(base + i) = *(pInt->BIOSScratch + i); free(pInt->BIOSScratch); pInt->BIOSScratch = NULL; } } pci_device_unmap_legacy(pInt->dev, base - BIOS_SCRATCH_OFF, pagesize); } #endif xf86Int10InfoPtr xf86InitInt10(int entityIndex) { return xf86ExtendedInitInt10(entityIndex, 0); } xorg-server-1.17.1/hw/xfree86/int10/x86emu.c0000664000175100017510000000027612366220413015155 00000000000000 #ifdef HAVE_XORG_CONFIG_H #include #endif #include "debug.c" #include "decode.c" #include "fpu.c" #include "ops.c" #include "ops2.c" #include "prim_ops.c" #include "sys.c" xorg-server-1.17.1/hw/xfree86/int10/stub.c0000664000175100017510000000202412366220413014767 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86str.h" #include "xf86_OSproc.h" #define _INT10_PRIVATE #include "xf86int10.h" xf86Int10InfoPtr xf86InitInt10(int entityIndex) { return xf86ExtendedInitInt10(entityIndex, 0); } xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags) { return NULL; } Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { return FALSE; } void xf86FreeInt10(xf86Int10InfoPtr pInt) { return; } void * xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off) { *off = 0; return NULL; } void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num) { return; } Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt) { return FALSE; } void xf86ExecX86int10(xf86Int10InfoPtr pInt) { return; } void * xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr) { return 0; } xorg-server-1.17.1/hw/xfree86/int10/xf86x86emu.c0000664000175100017510000000305412366220413015666 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" #define _INT10_PRIVATE #include "xf86int10.h" #include "int10Defines.h" #define M _X86EMU_env static void x86emu_do_int(int num) { Int10Current->num = num; if (!int_handler(Int10Current)) { X86EMU_halt_sys(); } } void xf86ExecX86int10(xf86Int10InfoPtr pInt) { int sig = setup_int(pInt); if (sig < 0) return; if (int_handler(pInt)) { X86EMU_exec(); } finish_int(pInt, sig); } Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt) { int i; X86EMU_intrFuncs intFuncs[256]; X86EMU_pioFuncs pioFuncs = { .inb = x_inb, .inw = x_inw, .inl = x_inl, .outb = x_outb, .outw = x_outw, .outl = x_outl }; X86EMU_memFuncs memFuncs = { (&Mem_rb), (&Mem_rw), (&Mem_rl), (&Mem_wb), (&Mem_ww), (&Mem_wl) }; X86EMU_setupMemFuncs(&memFuncs); pInt->cpuRegs = &M; M.mem_base = 0; M.mem_size = 1024 * 1024 + 1024; X86EMU_setupPioFuncs(&pioFuncs); for (i = 0; i < 256; i++) intFuncs[i] = x86emu_do_int; X86EMU_setupIntrFuncs(intFuncs); return TRUE; } void printk(const char *fmt, ...) { va_list argptr; va_start(argptr, fmt); VErrorF(fmt, argptr); va_end(argptr); } xorg-server-1.17.1/hw/xfree86/int10/xf86int10.h0000664000175100017510000001477112274325511015505 00000000000000 /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifndef _XF86INT10_H #define _XF86INT10_H #include #include #include "xf86Pci.h" #define SEG_ADDR(x) (((x) >> 4) & 0x00F000) #define SEG_OFF(x) ((x) & 0x0FFFF) #define SET_BIOS_SCRATCH 0x1 #define RESTORE_BIOS_SCRATCH 0x2 /* int10 info structure */ typedef struct { int entityIndex; uint16_t BIOSseg; uint16_t inb40time; ScrnInfoPtr pScrn; void *cpuRegs; char *BIOSScratch; int Flags; void *private; struct _int10Mem *mem; int num; int ax; int bx; int cx; int dx; int si; int di; int es; int bp; int flags; int stackseg; struct pci_device *dev; struct pci_io_handle *io; } xf86Int10InfoRec, *xf86Int10InfoPtr; typedef struct _int10Mem { uint8_t (*rb) (xf86Int10InfoPtr, int); uint16_t (*rw) (xf86Int10InfoPtr, int); uint32_t (*rl) (xf86Int10InfoPtr, int); void (*wb) (xf86Int10InfoPtr, int, uint8_t); void (*ww) (xf86Int10InfoPtr, int, uint16_t); void (*wl) (xf86Int10InfoPtr, int, uint32_t); } int10MemRec, *int10MemPtr; typedef struct { uint8_t save_msr; uint8_t save_pos102; uint8_t save_vse; uint8_t save_46e8; } legacyVGARec, *legacyVGAPtr; /* OS dependent functions */ extern _X_EXPORT xf86Int10InfoPtr xf86InitInt10(int entityIndex); extern _X_EXPORT xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags); extern _X_EXPORT void xf86FreeInt10(xf86Int10InfoPtr pInt); extern _X_EXPORT void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off); extern _X_EXPORT void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num); extern _X_EXPORT void *xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr); /* x86 executor related functions */ extern _X_EXPORT void xf86ExecX86int10(xf86Int10InfoPtr pInt); #ifdef _INT10_PRIVATE #define I_S_DEFAULT_INT_VECT 0xFF065 #define SYS_SIZE 0x100000 #define SYS_BIOS 0xF0000 #if 1 #define BIOS_SIZE 0x10000 #else /* a bug in DGUX requires this - let's try it */ #define BIOS_SIZE (0x10000 - 1) #endif #define LOW_PAGE_SIZE 0x600 #define V_RAM 0xA0000 #define VRAM_SIZE 0x20000 #define V_BIOS_SIZE 0x10000 #define V_BIOS 0xC0000 #define BIOS_SCRATCH_OFF 0x449 #define BIOS_SCRATCH_END 0x466 #define BIOS_SCRATCH_LEN (BIOS_SCRATCH_END - BIOS_SCRATCH_OFF + 1) #define HIGH_MEM V_BIOS #define HIGH_MEM_SIZE (SYS_BIOS - HIGH_MEM) #define SEG_ADR(type, seg, reg) type((seg << 4) + (X86_##reg)) #define SEG_EADR(type, seg, reg) type((seg << 4) + (X86_E##reg)) #define X86_TF_MASK 0x00000100 #define X86_IF_MASK 0x00000200 #define X86_IOPL_MASK 0x00003000 #define X86_NT_MASK 0x00004000 #define X86_VM_MASK 0x00020000 #define X86_AC_MASK 0x00040000 #define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */ #define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */ #define X86_ID_MASK 0x00200000 #define MEM_RB(name, addr) (*name->mem->rb)(name, addr) #define MEM_RW(name, addr) (*name->mem->rw)(name, addr) #define MEM_RL(name, addr) (*name->mem->rl)(name, addr) #define MEM_WB(name, addr, val) (*name->mem->wb)(name, addr, val) #define MEM_WW(name, addr, val) (*name->mem->ww)(name, addr, val) #define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val) /* OS dependent functions */ extern _X_EXPORT Bool MapCurrentInt10(xf86Int10InfoPtr pInt); /* x86 executor related functions */ extern _X_EXPORT Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt); /* int.c */ extern _X_EXPORT xf86Int10InfoPtr Int10Current; int int_handler(xf86Int10InfoPtr pInt); /* helper_exec.c */ int setup_int(xf86Int10InfoPtr pInt); void finish_int(xf86Int10InfoPtr, int sig); uint32_t getIntVect(xf86Int10InfoPtr pInt, int num); void pushw(xf86Int10InfoPtr pInt, uint16_t val); int run_bios_int(int num, xf86Int10InfoPtr pInt); void dump_code(xf86Int10InfoPtr pInt); void dump_registers(xf86Int10InfoPtr pInt); void stack_trace(xf86Int10InfoPtr pInt); uint8_t bios_checksum(const uint8_t *start, int size); void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); #if defined (_PC) extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save); #endif int port_rep_inb(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_inw(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_inl(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_outb(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_outw(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_outl(xf86Int10InfoPtr pInt, uint16_t port, uint32_t base, int d_f, uint32_t count); uint8_t x_inb(uint16_t port); uint16_t x_inw(uint16_t port); void x_outb(uint16_t port, uint8_t val); void x_outw(uint16_t port, uint16_t val); uint32_t x_inl(uint16_t port); void x_outl(uint16_t port, uint32_t val); uint8_t Mem_rb(uint32_t addr); uint16_t Mem_rw(uint32_t addr); uint32_t Mem_rl(uint32_t addr); void Mem_wb(uint32_t addr, uint8_t val); void Mem_ww(uint32_t addr, uint16_t val); void Mem_wl(uint32_t addr, uint32_t val); /* helper_mem.c */ void setup_int_vect(xf86Int10InfoPtr pInt); int setup_system_bios(void *base_addr); void reset_int_vect(xf86Int10InfoPtr pInt); void set_return_trap(xf86Int10InfoPtr pInt); extern _X_EXPORT void *xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex); Bool int10skip(const void *options); Bool int10_check_bios(int scrnIndex, int codeSeg, const unsigned char *vbiosMem); Bool initPrimary(const void *options); extern _X_EXPORT BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt); extern _X_EXPORT Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base); #ifdef DEBUG void dprint(unsigned long start, unsigned long size); #endif #endif /* _INT10_PRIVATE */ #endif /* _XF86INT10_H */ xorg-server-1.17.1/hw/xfree86/int10/INT10.HOWTO0000664000175100017510000003426312160102336015270 00000000000000 INT10 X86 Real Mode executor ============================= PRELIMINARY INT10 is a XFree86 module for soft-booting and executing real mode int10 BIOS calls. The BIOS call code is largely untested, yet. 1. Usage ======== To use the int10 module in a driver the header file xfree86/os-support/int10/xf86int10.h must be included. a. Initialization ----------------- The int10-executer gets initialized by calling: xf86Int10InfoPtr xf86InitInt10(int entityIndex); The function will soft-boot any non-primary device and return a pointer to a xf86Int10InfoRec on success. If anything fails or if int10 execution is disabled by an option in the device section NULL will be returned. The driver should store this pointer for later calls to other int10 module functions. b. Memory allocation -------------------- To allocate memory in the real mode execution environment void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off); can be called. It allocates num consecutive pagesize chunks. It returns the address of the allocated area. off is set to its offset in the real mode memory space. void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num); Is used to free num pages beginning at pbase. c. Doing int10 BIOS calls ------------------------- The BIOS call is executed by calling: void xf86ExecX86int10(xf86Int10InfoPtr pInt); The number of the interrupt (normally 10) and the initial values of the ax, bx, cx, dx, si, di and es x86-CPU registers can be set in the xf86Int10InfoRec passed to the function. On return this structure contains the exit values of the registers listed above and the CPU flag register. d. De-initializing ----------------- If no further int10 calls are required for a certain chipset the driver should call: void xf86FreeInt10(xf86Int10InfoPtr pInt); to free the memory allocated for real mode int10 calls. 2. Porting issues ================= The int10 real mode executor is designed to run on top of various x86 CPU emulators as well as in vm86 mode of a real x86 CPU. If used with a CPU emulator the emulator and CPU specific interfaces can be held separate thus requiring minimal efforts to port the int10 module to new platforms. Currently an interface to the x86emu real mode emulator is provided. Since details of setting up and running the vm86 mode is platform dependent both the platform dependent environment and the emulation layer have to be ported. Several helper functions are provided for that. A CPU emulator should meet certain requirements to be usable for the INT10 executor: 1. It must trap calls to intXX instructions and pass execution to an external function which is allowed to modify CPU registers including the instruction pointer (IP) before returning to the emulator for continuing execution. When the external function is called the IP must point to the instruction past the intXX call. 2. The emulator should use externally provided functions to handle PIO. 3. The emulator should be able to use externally provided functions to access memory from the real mode memory environment. Note, that the vm86 mode usually requires one hunk of consecutive memory starting at address 0 in the process virtual memory space. Thus if this mode is to be used, the OS environment has to be able to provide that, ie. it must be able to remap the processes virtual memory space onto itself. If the emulator is able to handle memory access thru externally provided functions the real mode process memory can be located anywhere in the processes virtual memory. It does not even have to be consecutive. 4. The executor should terminate on encountering a 'hlt' instruction. Functions to implement: To simplify development the code has been split into a general setup part and an emulator specific one. A generic setup code is provided in generic.c. It should be usable with any emulator satisfying the conditions mentioned above. Therefore the following section on int10 setup may be skipped when porting int10 to new emulator. If the vm86() is to be used no memory access functions can be used. Therefore the layout of the real mode memory image has to meet certain requirements. Therefore when porting to other platforms a new setup code may have to be designed, too. The following section will give guidelines how this may be done. A sample implementation using SysV IPC to map the appropriate real mode memory image to address 0 in virtual address space just prior to execution may be found in xfree86/os-support/linux/int10/linux.c. On non-PC like platforms emulation of certain PC features such as initialization of BIOS int vectors, sys_BIOS constants or PCI config method 1 can be turned on by defining _PC. I. Setup Code ------------- This sets up the real mode memory image, calls the emulator to POST the chipset if required and maintains memory allocations in real mode address space. 1. xf86Int10InfoPtr xf86InitInt10(int entityIndex); This function should first find the screen assigned to the entity carrying entitiyIndex and then call Bool int10skip(ScrnInfoPtr pScrn) to find out if the user has requested not to initialize int10. If so xf86InitInt10() should return NULL. Otherwise an xf86Int10InfoRec should be allocated. This structure contains the following fields: a. int entityIndex - index of the entity whose BIOS is to be executed. b. int scrnIndex - index of the screen assigned the entity. c. pointer cpuRegs - pointer to a emulator/vm86-mode private structure. May hold cpu register values for the emulator. d. CARD16 BIOSseg - Video BIOS segment address. e. pointer private - pointer to a os specific data structure. f. struct _int10Mem* - pointer to a structure to hold the memory access functions for use by an emulator. g. int num - number of the int to be called. h. int ax..es,flags - CPU register values to pass to int-call. The Init function should initialize a-f. To initialize the emulator specific execute environment the function Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt) should be called. If this function returns FALSE any already allocated memory should be freed and xf86Int10Init(0 should exit returning NULL. If the platform has a PC like system BIOS it may be copied to or mapped into memory locations SYS_BIOS to SYS_SIZE-1 of the real mode memory environment of this process. Otherwise the helper function: int setup_system_bios(CARD32 base_addr); may be called to set up a rudimentary system BIOS sufficient to be used to boot video BIOSes. base_addr specifies the virtual address corresponding to SYS_BIOS in the real mode environment. If a PC-like int vector and BIOS data area is available it should be copied to 0 to LOW_PAGE_SIZE of the entities real mode environment. In this case the video interrupt related entries should be reset for all non-primary cards by calling: void reset_int_vect(xf86Int10InfoPtr pInt); To initialize the correct video BIOS entry points the BIOS must be warm-booted. If no PC-like int vector is available one can be set up by calling void setup_int_vect(xf86Int10InfoPtr pInt); In this case the video BIOS has to be warm-booted always. If the video BIOS for this entity has been installed during boot it may be mapped (or copied) directly to the correct address in the real mode memory environment. Otherwise int mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address); should be called to copy the BIOS image from PCI ROM. 'address' specifies the address this image should be copied to. Sufficient space to hold an entire BIOS image should be allocated prior to calling mapPciRom(). This function will return the size of the BIOS image in bytes if it was able to successfully copy the image and 0 otherwise. To create a well defined point to exit the softbooter void set_return_trap(xf86Int10Ptr pInt); may be called. It sets up a 'hlt' instruction in the emulator memory just above the BIOS variable area. Before entering real mode execution this address will be pushed onto the return stack. If the BIOS needs to be warm-booted this should be done before leaving xf86InitInt10() by setting num in the xf86Int10InfoRec to 0xe6 and calling void xf86ExecX86int10(xf86Int10IfoPtr pInt); The implementation of this function will be discussed below. This function should be wrapped by calls to void LockLegacyVGA(screen, legacyVGAPtr vga); and void UnlockLegacyVGA(screen, legacyVGAPtr vga); The struct vga is used to hold the state of the legacy VGA access registers if a legacy VGA device exists. xf86InitInt10() should return a pointer to the xf86Int10InfoRec allocated. 2. Bool MapCurrentInt10(xf86Int10InfoPtr pInt); In case a platform specific mapping has to be performed to map the memory allocated for the real mode memory environment into a specific location prior to executing the x86 real mode code a function Bool MapCurrentInt10(xf86Int10InfoPtr pInt); has to be provided. It will be called by a helper function whenever the active entity changes. If the vm86 mode is used it is most likely that the 1MB real mode memory space located somewhere in the processes virtual memory will have to be remapped to address 0 of the virtual memory space. 3. void xf86FreeInt10(xf86Int10InfoPtr pInt); To free all memory allocated for video BIOS calls of a specific entity the function void xf86FreeInt10(xf86Int10InfoPtr pInt); should be provided. If the entity to be freed was mapped by MapCurrentInt10() this mapping needs to be undone also. 4. void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off) void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num) xf86Int10AllocPages() should allocate 'num' consecutive page-size chunks of memory. In real mode memory space this range needs to occupy consecutive addresses, too. The function must return the address of this memory. The offset in real mode memory needs to be returned in 'off'. If no block of 'num' pages are available the function should return NULL. xf86Int10FreePages() will free the 'num' pages starting at 'pbase'. 'num' is equal to the number of pages allocated by a single xf86Int10AllocatePages() call. 'pbase' is the address of the range previously returned by xf86Int10AllocatePages(). II. Emulator specific functions ------------------------------- 1. Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt); This function will be called from xf86InitInt10(). It may be used to set up the static emulator specific part of the real mode environment. On success it should return TRUE. 2. xf86ExecX86int10(xf86Int10InfoPtr pInt); This function gets called to execute an int call. It may call the helper function: void setup_int(xf86Int10InfoPrt pInt); to copy the register values to the emulator specific locations and to set up the non-static real mode execution environment. On return from setup_int() 'Int10Current' holds a pointer to the current xf86Int10InfoRec. It should start execution by calling Bool int_handler(xf86Int10InfoPtr pInt); and if this function returns TRUE it should call whatever necessary to continue execution until a 'hlt' instruction is encountered. To copy the resulting register values back to the xf86Int10InfoRec structure void finish_int(xf86Int10InfoPtr pInt); should be called. Helper functions are provided to aid the implementation of a vm86 call: Bool vm86_GP_fault(xf86Int10InfoPtr pInt); This function handles instructions which cause a vm86 call to trap. PIO access is handled by the in/out calls as defined in compiler.h. Optionally the PIO instructions can be logged by defining PRINT_PORT in xf86int10.h. This is meant for debugging purposes. Unknown instructions and 'hlt' cause vm86_GP_fault() to return FALSE. Otherwise TRUE is returned. Note: This function is currently based on the Linux vm86 call. It might have to be modified or even rewritten for other OS. So your milage may vary. Functions to dump memory, code, xf86 CPU register values and stack are also provided. Take a look at helper.c To view a memory range the function void dprint(unsigned long start, unsigned long size) is provided. The use should be self explanatory. Register and memory access functions are provided in helper_mem.c. The PIO register access functions can trap access to PCI config space access register (config method 1) if _PC is not defined. A header file 'defines.h' is required to define OS/emulator specific ways to access memory and xf86 CPU registers: Defines need to be provided for memory byte/work/long read/write access (MEM_RB(name,addr),MEM_RW(name,addr),MEM_RL(name,addr), MEM_WB(name,addr,val),MEM_WL(name,addr,val),MEM_WL(name,addr,val)) of the real mode memory environment. 'name' will contain a pointer to the current xf86Int10InfoRec. Currently defines are available for vm86-mode under Linux and x86emu. They may be activated by defining _X86EMU or _VM86_LINUX respectively. Note: Emulators usually are not able to pass this pointer when calling memory access functions. In this case a global variable should be defined which can hold this pointer. This variable can be set in MapCurrentInt10(). It also must be set in xf86InitInt10() if this function calls the memory access functions either directly or by calling xf86ExecX86int10(pInt). Defines to access the emulator specific xf86 CPU register locations are also required: X86_EAX,...,X86_EFLAGS for access of the full 32 bit registers, X86_AX...X86_FLAGS for access of the 16 bit registers and XF86_AL,XF86_BL,XF86_CL,XF86_DL to access the lower byte of the AX,BX,CX and DX register. $XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.2 2000/02/08 13:13:22 eich Exp $ xorg-server-1.17.1/hw/xfree86/int10/Makefile.in0000664000175100017510000010171312466505432015730 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @INT10_X86EMU_TRUE@am__append_1 = -I$(srcdir)/../x86emu subdir = hw/xfree86/int10 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) am__DEPENDENCIES_1 = libint10_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libint10_la_SOURCES_DIST = stub.c xf86int10module.c helper_exec.c \ helper_mem.c xf86int10.c \ $(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c \ $(srcdir)/../os-support/linux/int10/linux.c xf86x86emu.c \ generic.c x86emu.c am__objects_1 = helper_exec.lo helper_mem.lo xf86int10.lo \ xf86int10module.lo @INT10_STUB_FALSE@@INT10_VM86_FALSE@@INT10_X86EMU_TRUE@am_libint10_la_OBJECTS = $(am__objects_1) \ @INT10_STUB_FALSE@@INT10_VM86_FALSE@@INT10_X86EMU_TRUE@ xf86x86emu.lo \ @INT10_STUB_FALSE@@INT10_VM86_FALSE@@INT10_X86EMU_TRUE@ generic.lo \ @INT10_STUB_FALSE@@INT10_VM86_FALSE@@INT10_X86EMU_TRUE@ x86emu.lo @INT10_STUB_FALSE@@INT10_VM86_TRUE@am_libint10_la_OBJECTS = \ @INT10_STUB_FALSE@@INT10_VM86_TRUE@ $(am__objects_1) \ @INT10_STUB_FALSE@@INT10_VM86_TRUE@ linux_vm86.lo linux.lo @INT10_STUB_TRUE@am_libint10_la_OBJECTS = stub.lo xf86int10module.lo libint10_la_OBJECTS = $(am_libint10_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 = libint10_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libint10_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 = $(libint10_la_SOURCES) DIST_SOURCES = $(am__libint10_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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ module_LTLIBRARIES = libint10.la sdk_HEADERS = xf86int10.h EXTRA_CFLAGS = libint10_la_LDFLAGS = -avoid-version libint10_la_LIBADD = $(PCIACCESS_LIBS) COMMON_SOURCES = \ helper_exec.c \ helper_mem.c \ xf86int10.c \ xf86int10module.c @I386_VIDEO_TRUE@I386_VIDEO_CFLAGS = -D_PC AM_CPPFLAGS = $(XORG_INCS) $(am__append_1) @INT10_STUB_TRUE@AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS) @INT10_VM86_TRUE@AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS) @INT10_X86EMU_TRUE@AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_X86EMU -DNO_SYS_HEADERS \ @INT10_X86EMU_TRUE@ $(XORG_CFLAGS) $(EXTRA_CFLAGS) $(DIX_CFLAGS) @INT10_STUB_TRUE@libint10_la_SOURCES = stub.c xf86int10module.c @INT10_VM86_TRUE@libint10_la_SOURCES = \ @INT10_VM86_TRUE@ $(COMMON_SOURCES) \ @INT10_VM86_TRUE@ $(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c \ @INT10_VM86_TRUE@ $(srcdir)/../os-support/linux/int10/linux.c @INT10_X86EMU_TRUE@libint10_la_SOURCES = \ @INT10_X86EMU_TRUE@ $(COMMON_SOURCES) \ @INT10_X86EMU_TRUE@ xf86x86emu.c \ @INT10_X86EMU_TRUE@ generic.c \ @INT10_X86EMU_TRUE@ x86emu.c EXTRA_DIST = xf86x86emu.h INT10.HOWTO all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/int10/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/int10/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libint10.la: $(libint10_la_OBJECTS) $(libint10_la_DEPENDENCIES) $(EXTRA_libint10_la_DEPENDENCIES) $(AM_V_CCLD)$(libint10_la_LINK) -rpath $(moduledir) $(libint10_la_OBJECTS) $(libint10_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper_exec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper_mem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux_vm86.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x86emu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86int10.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86int10module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86x86emu.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 -o $@ $< .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 -o $@ `$(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 $@ $< linux_vm86.lo: $(srcdir)/../os-support/linux/int10/vm86/linux_vm86.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) $(AM_CFLAGS) $(CFLAGS) -MT linux_vm86.lo -MD -MP -MF $(DEPDIR)/linux_vm86.Tpo -c -o linux_vm86.lo `test -f '$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c' || echo '$(srcdir)/'`$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/linux_vm86.Tpo $(DEPDIR)/linux_vm86.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c' object='linux_vm86.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) $(AM_CFLAGS) $(CFLAGS) -c -o linux_vm86.lo `test -f '$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c' || echo '$(srcdir)/'`$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c linux.lo: $(srcdir)/../os-support/linux/int10/linux.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) $(AM_CFLAGS) $(CFLAGS) -MT linux.lo -MD -MP -MF $(DEPDIR)/linux.Tpo -c -o linux.lo `test -f '$(srcdir)/../os-support/linux/int10/linux.c' || echo '$(srcdir)/'`$(srcdir)/../os-support/linux/int10/linux.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/linux.Tpo $(DEPDIR)/linux.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../os-support/linux/int10/linux.c' object='linux.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) $(AM_CFLAGS) $(CFLAGS) -c -o linux.lo `test -f '$(srcdir)/../os-support/linux/int10/linux.c' || echo '$(srcdir)/'`$(srcdir)/../os-support/linux/int10/linux.c 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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-moduleLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am uninstall \ uninstall-am uninstall-moduleLTLIBRARIES 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: xorg-server-1.17.1/hw/xfree86/int10/helper_mem.c0000664000175100017510000002123012366220413016127 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" #include "xf86Pci.h" #define _INT10_PRIVATE #if 0 #include "int10Defines.h" #endif #include "xf86int10.h" #define REG pInt typedef enum { OPT_NOINT10, OPT_INIT_PRIMARY, } INT10Opts; static const OptionInfoRec INT10Options[] = { {OPT_NOINT10, "NoINT10", OPTV_BOOLEAN, {0}, FALSE}, {OPT_INIT_PRIMARY, "InitPrimary", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; #ifdef DEBUG void dprint(unsigned long start, unsigned long size) { int i, j; char *c = (char *) start; for (j = 0; j < (size >> 4); j++) { char *d = c; ErrorF("\n0x%lx: ", (unsigned long) c); for (i = 0; i < 16; i++) ErrorF("%2.2x ", (unsigned char) (*(c++))); c = d; for (i = 0; i < 16; i++) { ErrorF("%c", ((((CARD8) (*c)) > 32) && (((CARD8) (*c)) < 128)) ? (unsigned char) (*(c)) : '.'); c++; } } ErrorF("\n"); } #endif #ifndef _PC /* * here we are really paranoid about faking a "real" * BIOS. Most of this information was pulled from * dosemu. */ void setup_int_vect(xf86Int10InfoPtr pInt) { int i; /* let the int vects point to the SYS_BIOS seg */ for (i = 0; i < 0x80; i++) { MEM_WW(pInt, i << 2, 0); MEM_WW(pInt, (i << 2) + 2, SYS_BIOS >> 4); } reset_int_vect(pInt); /* font tables default location (int 1F) */ MEM_WW(pInt, 0x1f << 2, 0xfa6e); /* int 11 default location (Get Equipment Configuration) */ MEM_WW(pInt, 0x11 << 2, 0xf84d); /* int 12 default location (Get Conventional Memory Size) */ MEM_WW(pInt, 0x12 << 2, 0xf841); /* int 15 default location (I/O System Extensions) */ MEM_WW(pInt, 0x15 << 2, 0xf859); /* int 1A default location (RTC, PCI and others) */ MEM_WW(pInt, 0x1a << 2, 0xff6e); /* int 05 default location (Bound Exceeded) */ MEM_WW(pInt, 0x05 << 2, 0xff54); /* int 08 default location (Double Fault) */ MEM_WW(pInt, 0x08 << 2, 0xfea5); /* int 13 default location (Disk) */ MEM_WW(pInt, 0x13 << 2, 0xec59); /* int 0E default location (Page Fault) */ MEM_WW(pInt, 0x0e << 2, 0xef57); /* int 17 default location (Parallel Port) */ MEM_WW(pInt, 0x17 << 2, 0xefd2); /* fdd table default location (int 1e) */ MEM_WW(pInt, 0x1e << 2, 0xefc7); /* Set Equipment flag to VGA */ i = MEM_RB(pInt, 0x0410) & 0xCF; MEM_WB(pInt, 0x0410, i); /* XXX Perhaps setup more of the BDA here. See also int42(0x00). */ } #endif int setup_system_bios(void *base_addr) { char *base = (char *) base_addr; /* * we trap the "industry standard entry points" to the BIOS * and all other locations by filling them with "hlt" * TODO: implement hlt-handler for these */ memset(base, 0xf4, 0x10000); /* set bios date */ strcpy(base + 0x0FFF5, "06/11/99"); /* set up eisa ident string */ strcpy(base + 0x0FFD9, "PCI_ISA"); /* write system model id for IBM-AT */ *((unsigned char *) (base + 0x0FFFE)) = 0xfc; return 1; } void reset_int_vect(xf86Int10InfoPtr pInt) { /* * This table is normally located at 0xF000:0xF0A4. However, int 0x42, * function 0 (Mode Set) expects it (or a copy) somewhere in the bottom * 64kB. Note that because this data doesn't survive POST, int 0x42 should * only be used during EGA/VGA BIOS initialisation. */ static const CARD8 VideoParms[] = { /* Timing for modes 0x00 & 0x01 */ 0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, /* Timing for modes 0x02 & 0x03 */ 0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, /* Timing for modes 0x04, 0x05 & 0x06 */ 0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x70, 0x02, 0x01, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, /* Timing for mode 0x07 */ 0x61, 0x50, 0x52, 0x0f, 0x19, 0x06, 0x19, 0x19, 0x02, 0x0d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, /* Display page lengths in little endian order */ 0x00, 0x08, /* Modes 0x00 and 0x01 */ 0x00, 0x10, /* Modes 0x02 and 0x03 */ 0x00, 0x40, /* Modes 0x04 and 0x05 */ 0x00, 0x40, /* Modes 0x06 and 0x07 */ /* Number of columns for each mode */ 40, 40, 80, 80, 40, 40, 80, 80, /* CGA Mode register value for each mode */ 0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29, /* Padding */ 0x00, 0x00, 0x00, 0x00 }; int i; for (i = 0; i < sizeof(VideoParms); i++) MEM_WB(pInt, i + (0x1000 - sizeof(VideoParms)), VideoParms[i]); MEM_WW(pInt, 0x1d << 2, 0x1000 - sizeof(VideoParms)); MEM_WW(pInt, (0x1d << 2) + 2, 0); MEM_WW(pInt, 0x10 << 2, 0xf065); MEM_WW(pInt, (0x10 << 2) + 2, SYS_BIOS >> 4); MEM_WW(pInt, 0x42 << 2, 0xf065); MEM_WW(pInt, (0x42 << 2) + 2, SYS_BIOS >> 4); MEM_WW(pInt, 0x6D << 2, 0xf065); MEM_WW(pInt, (0x6D << 2) + 2, SYS_BIOS >> 4); } void set_return_trap(xf86Int10InfoPtr pInt) { /* * Here we set the exit condition: We return when we encounter * 'hlt' (=0xf4), which we locate at address 0x600 in x86 memory. */ MEM_WB(pInt, 0x0600, 0xf4); /* * Allocate a segment for the stack */ xf86Int10AllocPages(pInt, 1, &pInt->stackseg); } void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex) { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); OptionInfoPtr options = NULL; if (pEnt->device) { void *configOptions = NULL; /* Check if xf86CollectOptions() has already been called */ if (((pEnt->index < 0) || !pScrn || !(configOptions = pScrn->options)) && pEnt->device) configOptions = pEnt->device->options; if (configOptions) { if (!(options = (OptionInfoPtr) malloc(sizeof(INT10Options)))) return NULL; (void) memcpy(options, INT10Options, sizeof(INT10Options)); xf86ProcessOptions(pScrn->scrnIndex, configOptions, options); } } free(pEnt); return options; } Bool int10skip(const void *options) { Bool noint10 = FALSE; if (!options) return FALSE; xf86GetOptValBool(options, OPT_NOINT10, &noint10); return noint10; } Bool int10_check_bios(int scrnIndex, int codeSeg, const unsigned char *vbiosMem) { int size; if ((codeSeg & 0x1f) || /* Not 512-byte aligned otherwise */ ((codeSeg << 4) < V_BIOS) || ((codeSeg << 4) >= SYS_SIZE)) return FALSE; if ((*vbiosMem != 0x55) || (*(vbiosMem + 1) != 0xAA) || !*(vbiosMem + 2)) return FALSE; size = *(vbiosMem + 2) * 512; if ((size + (codeSeg << 4)) > SYS_SIZE) return FALSE; if (bios_checksum(vbiosMem, size)) xf86DrvMsg(scrnIndex, X_INFO, "Bad V_BIOS checksum\n"); return TRUE; } Bool initPrimary(const void *options) { Bool initPrimary = FALSE; if (!options) return FALSE; xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary); return initPrimary; } BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt) { BusType location_type; EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex); location_type = pEnt->location.type; free(pEnt); return location_type; } #define CHECK_V_SEGMENT_RANGE(x) \ if (((x) << 4) < V_BIOS) { \ xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, \ "V_BIOS address 0x%lx out of range\n", \ (unsigned long)(x) << 4); \ return FALSE; \ } Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base) { unsigned i; int cs = ~0; int segments[4]; segments[0] = MEM_RW(pInt, (0x10 << 2) + 2); segments[1] = MEM_RW(pInt, (0x42 << 2) + 2); segments[2] = V_BIOS >> 4; segments[3] = ~0; for (i = 0; segments[i] != ~0; i++) { unsigned char *vbiosMem; cs = segments[i]; CHECK_V_SEGMENT_RANGE(cs); vbiosMem = (unsigned char *) base + (cs << 4); if (int10_check_bios(pInt->pScrn->scrnIndex, cs, vbiosMem)) { break; } } if (segments[i] == ~0) { xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "No V_BIOS found\n"); return FALSE; } xf86DrvMsg(pInt->pScrn->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", (unsigned long) cs); pInt->BIOSseg = cs; return TRUE; } xorg-server-1.17.1/hw/xfree86/int10/xf86int10module.c0000664000175100017510000000152212366220413016671 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "xf86str.h" #include "xf86Pci.h" #include "xf86int10.h" #ifndef MOD_NAME #define MOD_NAME int10 #endif #define stringify(x) #x #define STRING(x) stringify(x) #define concat(x,y) x ## y #define combine(a,b) concat(a,b) #define NAME(x) combine(MOD_NAME,x) static XF86ModuleVersionInfo NAME(VersRec) = { STRING(NAME()), MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 0, 0, ABI_CLASS_VIDEODRV, /* needs the video driver ABI */ ABI_VIDEODRV_VERSION, MOD_CLASS_NONE, { 0, 0, 0, 0} }; _X_EXPORT XF86ModuleData NAME(ModuleData) = { &NAME(VersRec), NULL, NULL}; xorg-server-1.17.1/hw/xfree86/int10/generic.c0000664000175100017510000002761112406661137015446 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" #define _INT10_PRIVATE #include "xf86int10.h" #include "int10Defines.h" #include "Pci.h" #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1) #include /* needed for memmove */ static __inline__ uint32_t ldl_u(uint32_t * p) { uint32_t ret; memmove(&ret, p, sizeof(*p)); return ret; } static __inline__ uint16_t ldw_u(uint16_t * p) { uint16_t ret; memmove(&ret, p, sizeof(*p)); return ret; } static __inline__ void stl_u(uint32_t val, uint32_t * p) { uint32_t tmp = val; memmove(p, &tmp, sizeof(*p)); } static __inline__ void stw_u(uint16_t val, uint16_t * p) { uint16_t tmp = val; memmove(p, &tmp, sizeof(*p)); } static uint8_t read_b(xf86Int10InfoPtr pInt, int addr); static uint16_t read_w(xf86Int10InfoPtr pInt, int addr); static uint32_t read_l(xf86Int10InfoPtr pInt, int addr); static void write_b(xf86Int10InfoPtr pInt, int addr, uint8_t val); static void write_w(xf86Int10InfoPtr pInt, int addr, uint16_t val); static void write_l(xf86Int10InfoPtr pInt, int addr, uint32_t val); /* * the emulator cannot pass a pointer to the current xf86Int10InfoRec * to the memory access functions therefore store it here. */ typedef struct { int shift; int entries; void *base; void *vRam; int highMemory; void *sysMem; char *alloc; } genericInt10Priv; #define INTPriv(x) ((genericInt10Priv*)x->private) int10MemRec genericMem = { read_b, read_w, read_l, write_b, write_w, write_l }; static void MapVRam(xf86Int10InfoPtr pInt); static void UnmapVRam(xf86Int10InfoPtr pInt); #ifdef _PC #define GET_HIGH_BASE(x) (((V_BIOS + (x) + getpagesize() - 1)/getpagesize()) \ * getpagesize()) #endif static void *sysMem = NULL; static Bool readIntVec(struct pci_device *dev, unsigned char *buf, int len) { void *map; if (!pci_device_map_legacy(dev, 0, len, 0, &map)) return FALSE; memcpy(buf, map, len); pci_device_unmap_legacy(dev, map, len); return TRUE; } xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags) { xf86Int10InfoPtr pInt; void *base = 0; void *vbiosMem = 0; void *options = NULL; legacyVGARec vga; ScrnInfoPtr pScrn; pScrn = xf86FindScreenForEntity(entityIndex); options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); return NULL; } pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec)); pInt->entityIndex = entityIndex; if (!xf86Int10ExecSetup(pInt)) goto error0; pInt->mem = &genericMem; pInt->private = (void *) xnfcalloc(1, sizeof(genericInt10Priv)); INTPriv(pInt)->alloc = (void *) xnfcalloc(1, ALLOC_ENTRIES(getpagesize())); pInt->pScrn = pScrn; base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS); /* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like * FIXME: an error */ pInt->dev = xf86GetPciInfoForEntity(entityIndex); /* * we need to map video RAM MMIO as some chipsets map mmio * registers into this range. */ MapVRam(pInt); #ifdef _PC if (!sysMem) pci_device_map_legacy(pInt->dev, V_BIOS, BIOS_SIZE + SYS_BIOS - V_BIOS, PCI_DEV_MAP_FLAG_WRITABLE, &sysMem); INTPriv(pInt)->sysMem = sysMem; if (!readIntVec(pInt->dev, base, LOW_PAGE_SIZE)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read int vect\n"); goto error1; } /* * Retrieve everything between V_BIOS and SYS_BIOS as some system BIOSes * have executable code there. */ memset((char *) base + V_BIOS, 0, SYS_BIOS - V_BIOS); INTPriv(pInt)->highMemory = V_BIOS; if (xf86IsEntityPrimary(entityIndex) && !(initPrimary(options))) { if (!xf86int10GetBiosSegment(pInt, (unsigned char *) sysMem - V_BIOS)) goto error1; set_return_trap(pInt); pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH); if (!(pInt->Flags & SET_BIOS_SCRATCH)) pInt->Flags &= ~RESTORE_BIOS_SCRATCH; xf86Int10SaveRestoreBIOSVars(pInt, TRUE); } else { const BusType location_type = xf86int10GetBiosLocationType(pInt); int bios_location = V_BIOS; reset_int_vect(pInt); set_return_trap(pInt); switch (location_type) { case BUS_PCI:{ int err; struct pci_device *rom_device = xf86GetPciInfoForEntity(pInt->entityIndex); vbiosMem = (unsigned char *) base + bios_location; err = pci_device_read_rom(rom_device, vbiosMem); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (3) %s\n", strerror(err)); goto error1; } INTPriv(pInt)->highMemory = GET_HIGH_BASE(rom_device->rom_size); break; } default: goto error1; } pInt->BIOSseg = V_BIOS >> 4; pInt->num = 0xe6; LockLegacyVGA(pInt, &vga); xf86ExecX86int10(pInt); UnlockLegacyVGA(pInt, &vga); } #else if (!sysMem) { sysMem = xnfalloc(BIOS_SIZE); setup_system_bios(sysMem); } INTPriv(pInt)->sysMem = sysMem; setup_int_vect(pInt); set_return_trap(pInt); /* Retrieve the entire legacy video BIOS segment. This can be upto * 128KiB. */ vbiosMem = (char *) base + V_BIOS; memset(vbiosMem, 0, 2 * V_BIOS_SIZE); 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"); } /* * If this adapter is the primary, use its post-init BIOS (if we can find * it). */ { int bios_location = V_BIOS; Bool done = FALSE; vbiosMem = (unsigned char *) base + bios_location; if (xf86IsEntityPrimary(entityIndex)) { if (int10_check_bios(pScrn->scrnIndex, bios_location >> 4, vbiosMem)) done = TRUE; else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No legacy BIOS found -- trying PCI\n"); } if (!done) { int err; struct pci_device *rom_device = xf86GetPciInfoForEntity(pInt->entityIndex); err = pci_device_read_rom(rom_device, vbiosMem); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (5) %s\n", strerror(err)); goto error1; } } } pInt->BIOSseg = V_BIOS >> 4; pInt->num = 0xe6; LockLegacyVGA(pInt, &vga); xf86ExecX86int10(pInt); UnlockLegacyVGA(pInt, &vga); #endif free(options); return pInt; error1: free(base); UnmapVRam(pInt); free(INTPriv(pInt)->alloc); free(pInt->private); error0: free(pInt); free(options); return NULL; } static void MapVRam(xf86Int10InfoPtr pInt) { int pagesize = getpagesize(); int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize; pci_device_map_legacy(pInt->dev, V_RAM, size, PCI_DEV_MAP_FLAG_WRITABLE, &(INTPriv(pInt)->vRam)); pInt->io = pci_legacy_open_io(pInt->dev, 0, 64 * 1024); } static void UnmapVRam(xf86Int10InfoPtr pInt) { int pagesize = getpagesize(); int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize; pci_device_unmap_legacy(pInt->dev, INTPriv(pInt)->vRam, size); pci_device_close_io(pInt->dev, pInt->io); pInt->io = NULL; } Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { /* nothing to do here */ return TRUE; } void xf86FreeInt10(xf86Int10InfoPtr pInt) { if (!pInt) return; #if defined (_PC) xf86Int10SaveRestoreBIOSVars(pInt, FALSE); #endif if (Int10Current == pInt) Int10Current = NULL; free(INTPriv(pInt)->base); UnmapVRam(pInt); free(INTPriv(pInt)->alloc); free(pInt->private); free(pInt); } void * xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off) { int pagesize = getpagesize(); int num_pages = ALLOC_ENTRIES(pagesize); int i, j; for (i = 0; i < (num_pages - num); i++) { if (INTPriv(pInt)->alloc[i] == 0) { for (j = i; j < (num + i); j++) if (INTPriv(pInt)->alloc[j] != 0) break; if (j == (num + i)) break; i += num; } } if (i == (num_pages - num)) return NULL; for (j = i; j < (i + num); j++) INTPriv(pInt)->alloc[j] = 1; *off = (i + 1) * pagesize; return (char *) INTPriv(pInt)->base + *off; } void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num) { int pagesize = getpagesize(); int first = (((char *) pbase - (char *) INTPriv(pInt)->base) / pagesize) - 1; int i; for (i = first; i < (first + num); i++) INTPriv(pInt)->alloc[i] = 0; } #define OFF(addr) ((addr) & 0xffff) #if defined _PC #define HIGH_OFFSET (INTPriv(pInt)->highMemory) #define HIGH_BASE V_BIOS #else #define HIGH_OFFSET SYS_BIOS #define HIGH_BASE SYS_BIOS #endif #define SYS(addr) ((addr) >= HIGH_OFFSET) #define V_ADDR(addr) \ (SYS(addr) ? ((char*)INTPriv(pInt)->sysMem) + (addr - HIGH_BASE) \ : (((char*)(INTPriv(pInt)->base) + addr))) #define VRAM_ADDR(addr) (addr - V_RAM) #define VRAM_BASE (INTPriv(pInt)->vRam) #define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE))) #define V_ADDR_RB(addr) \ (VRAM(addr)) ? MMIO_IN8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr)) \ : *(uint8_t*) V_ADDR(addr) #define V_ADDR_RW(addr) \ (VRAM(addr)) ? MMIO_IN16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr)) \ : ldw_u((void *)V_ADDR(addr)) #define V_ADDR_RL(addr) \ (VRAM(addr)) ? MMIO_IN32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr)) \ : ldl_u((void *)V_ADDR(addr)) #define V_ADDR_WB(addr,val) \ if(VRAM(addr)) \ MMIO_OUT8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr),val); \ else \ *(uint8_t*) V_ADDR(addr) = val; #define V_ADDR_WW(addr,val) \ if(VRAM(addr)) \ MMIO_OUT16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr),val); \ else \ stw_u((val),(void *)(V_ADDR(addr))); #define V_ADDR_WL(addr,val) \ if (VRAM(addr)) \ MMIO_OUT32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr),val); \ else \ stl_u(val,(void *)(V_ADDR(addr))); static uint8_t read_b(xf86Int10InfoPtr pInt, int addr) { return V_ADDR_RB(addr); } static uint16_t read_w(xf86Int10InfoPtr pInt, int addr) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN if (OFF(addr + 1) > 0) return V_ADDR_RW(addr); #endif return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8); } static uint32_t read_l(xf86Int10InfoPtr pInt, int addr) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN if (OFF(addr + 3) > 2) return V_ADDR_RL(addr); #endif return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8) | (V_ADDR_RB(addr + 2) << 16) | (V_ADDR_RB(addr + 3) << 24); } static void write_b(xf86Int10InfoPtr pInt, int addr, uint8_t val) { V_ADDR_WB(addr, val); } static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN if (OFF(addr + 1) > 0) { V_ADDR_WW(addr, val); } #endif V_ADDR_WB(addr, val); V_ADDR_WB(addr + 1, val >> 8); } static void write_l(xf86Int10InfoPtr pInt, int addr, uint32_t val) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN if (OFF(addr + 3) > 2) { V_ADDR_WL(addr, val); } #endif V_ADDR_WB(addr, val); V_ADDR_WB(addr + 1, val >> 8); V_ADDR_WB(addr + 2, val >> 16); V_ADDR_WB(addr + 3, val >> 24); } void * xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr) { return V_ADDR(addr); } xorg-server-1.17.1/hw/xfree86/int10/xf86x86emu.h0000664000175100017510000000231212274325511015672 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #ifndef XF86X86EMU_H_ #define XF86X86EMU_H_ #include #define M _X86EMU_env #define X86_EAX M.x86.R_EAX #define X86_EBX M.x86.R_EBX #define X86_ECX M.x86.R_ECX #define X86_EDX M.x86.R_EDX #define X86_ESI M.x86.R_ESI #define X86_EDI M.x86.R_EDI #define X86_EBP M.x86.R_EBP #define X86_EIP M.x86.R_EIP #define X86_ESP M.x86.R_ESP #define X86_EFLAGS M.x86.R_EFLG #define X86_FLAGS M.x86.R_FLG #define X86_AX M.x86.R_AX #define X86_BX M.x86.R_BX #define X86_CX M.x86.R_CX #define X86_DX M.x86.R_DX #define X86_SI M.x86.R_SI #define X86_DI M.x86.R_DI #define X86_BP M.x86.R_BP #define X86_IP M.x86.R_IP #define X86_SP M.x86.R_SP #define X86_CS M.x86.R_CS #define X86_DS M.x86.R_DS #define X86_ES M.x86.R_ES #define X86_SS M.x86.R_SS #define X86_FS M.x86.R_FS #define X86_GS M.x86.R_GS #define X86_AL M.x86.R_AL #define X86_BL M.x86.R_BL #define X86_CL M.x86.R_CL #define X86_DL M.x86.R_DL #define X86_AH M.x86.R_AH #define X86_BH M.x86.R_BH #define X86_CH M.x86.R_CH #define X86_DH M.x86.R_DH #endif xorg-server-1.17.1/hw/xfree86/int10/xf86int10.c0000664000175100017510000007717512366220413015504 00000000000000/* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include "xf86.h" #include "compiler.h" #define _INT10_PRIVATE #include "xf86int10.h" #include "int10Defines.h" #include "Pci.h" #define REG pInt xf86Int10InfoPtr Int10Current = NULL; static int int1A_handler(xf86Int10InfoPtr pInt); #ifndef _PC static int int42_handler(xf86Int10InfoPtr pInt); #endif static int intE6_handler(xf86Int10InfoPtr pInt); static struct pci_device *findPci(xf86Int10InfoPtr pInt, unsigned short bx); static CARD32 pciSlotBX(const struct pci_device *pvp); int int_handler(xf86Int10InfoPtr pInt) { int num = pInt->num; int ret = 0; switch (num) { #ifndef _PC case 0x10: case 0x42: case 0x6D: if (getIntVect(pInt, num) == I_S_DEFAULT_INT_VECT) ret = int42_handler(pInt); break; #endif case 0x1A: ret = int1A_handler(pInt); break; case 0xe6: ret = intE6_handler(pInt); break; default: break; } if (!ret) ret = run_bios_int(num, pInt); if (!ret) { xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num); dump_registers(pInt); stack_trace(pInt); } return ret; } #ifndef _PC /* * This is derived from a number of PC system BIOS'es. The intent here is to * provide very primitive video support, before an EGA/VGA BIOS installs its * own interrupt vector. Here, "Ignored" calls should remain so. "Not * Implemented" denotes functionality that can be implemented should the need * arise. What are "Not Implemented" throughout are video memory accesses. * Also, very little input validity checking is done here. */ static int int42_handler(xf86Int10InfoPtr pInt) { switch (X86_AH) { case 0x00: /* Set Video Mode */ /* Enter: AL = video mode number */ /* Leave: Nothing */ /* Implemented (except for clearing the screen) */ { /* Localise */ unsigned int ioport; int i; CARD16 int1d, regvals, tmp; CARD8 mode, cgamode, cgacolour; /* * Ignore all mode numbers but 0x00-0x13. Some systems also ignore * 0x0B and 0x0C, but don't do that here. */ if (X86_AL > 0x13) break; /* * You didn't think that was really the mode set, did you? There * are only so many slots in the video parameter table... */ mode = X86_AL; ioport = 0x03D4; switch (MEM_RB(pInt, 0x0410) & 0x30) { case 0x30: /* MDA */ mode = 0x07; /* Force mode to 0x07 */ ioport = 0x03B4; break; case 0x10: /* CGA 40x25 */ if (mode >= 0x07) mode = 0x01; break; case 0x20: /* CGA 80x25 (MCGA?) */ if (mode >= 0x07) mode = 0x03; break; case 0x00: /* EGA/VGA */ if (mode >= 0x07) /* Don't try MDA timings */ mode = 0x01; /* !?!?! */ break; } /* Locate data in video parameter table */ int1d = MEM_RW(pInt, 0x1d << 2); regvals = ((mode >> 1) << 4) + int1d; cgacolour = 0x30; if (mode == 0x06) { regvals -= 0x10; cgacolour = 0x3F; } /** Update BIOS Data Area **/ /* Video mode */ MEM_WB(pInt, 0x0449, mode); /* Columns */ tmp = MEM_RB(pInt, mode + int1d + 0x48); MEM_WW(pInt, 0x044A, tmp); /* Page length */ tmp = MEM_RW(pInt, (mode & 0x06) + int1d + 0x40); MEM_WW(pInt, 0x044C, tmp); /* Start Address */ MEM_WW(pInt, 0x044E, 0); /* Cursor positions, one for each display page */ for (i = 0x0450; i < 0x0460; i += 2) MEM_WW(pInt, i, 0); /* Cursor start & end scanlines */ tmp = MEM_RB(pInt, regvals + 0x0B); MEM_WB(pInt, 0x0460, tmp); tmp = MEM_RB(pInt, regvals + 0x0A); MEM_WB(pInt, 0x0461, tmp); /* Current display page number */ MEM_WB(pInt, 0x0462, 0); /* CRTC I/O address */ MEM_WW(pInt, 0x0463, ioport); /* CGA Mode register value */ cgamode = MEM_RB(pInt, mode + int1d + 0x50); MEM_WB(pInt, 0x0465, cgamode); /* CGA Colour register value */ MEM_WB(pInt, 0x0466, cgacolour); /* Rows */ MEM_WB(pInt, 0x0484, (25 - 1)); /* Program the mode */ pci_io_write8(pInt->io, ioport + 4, cgamode & 0x37); /* Turn off screen */ for (i = 0; i < 0x10; i++) { tmp = MEM_RB(pInt, regvals + i); pci_io_write8(pInt->io, ioport, i); pci_io_write8(pInt->io, ioport + 1, tmp); } pci_io_write8(pInt->io, ioport + 5, cgacolour); /* Select colour mode */ pci_io_write8(pInt->io, ioport + 4, cgamode); /* Turn on screen */ } break; case 0x01: /* Set Cursor Type */ /* Enter: CH = starting line for cursor */ /* CL = ending line for cursor */ /* Leave: Nothing */ /* Implemented */ { /* Localise */ unsigned int ioport = MEM_RW(pInt, 0x0463); MEM_WB(pInt, 0x0460, X86_CL); MEM_WB(pInt, 0x0461, X86_CH); pci_io_write8(pInt->io, ioport, 0x0A); pci_io_write8(pInt->io, ioport + 1, X86_CH); pci_io_write8(pInt->io, ioport, 0x0B); pci_io_write8(pInt->io, ioport + 1, X86_CL); } break; case 0x02: /* Set Cursor Position */ /* Enter: BH = display page number */ /* DH = row */ /* DL = column */ /* Leave: Nothing */ /* Implemented */ { /* Localise */ unsigned int ioport; CARD16 offset; MEM_WB(pInt, (X86_BH << 1) + 0x0450, X86_DL); MEM_WB(pInt, (X86_BH << 1) + 0x0451, X86_DH); if (X86_BH != MEM_RB(pInt, 0x0462)) break; offset = (X86_DH * MEM_RW(pInt, 0x044A)) + X86_DL; offset += MEM_RW(pInt, 0x044E) << 1; ioport = MEM_RW(pInt, 0x0463); pci_io_write8(pInt->io, ioport, 0x0E); pci_io_write8(pInt->io, ioport + 1, offset >> 8); pci_io_write8(pInt->io, ioport, 0x0F); pci_io_write8(pInt->io, ioport + 1, offset & 0xFF); } break; case 0x03: /* Get Cursor Position */ /* Enter: BH = display page number */ /* Leave: CH = starting line for cursor */ /* CL = ending line for cursor */ /* DH = row */ /* DL = column */ /* Implemented */ { /* Localise */ X86_CL = MEM_RB(pInt, 0x0460); X86_CH = MEM_RB(pInt, 0x0461); X86_DL = MEM_RB(pInt, (X86_BH << 1) + 0x0450); X86_DH = MEM_RB(pInt, (X86_BH << 1) + 0x0451); } break; case 0x04: /* Get Light Pen Position */ /* Enter: Nothing */ /* Leave: AH = 0x01 (down/triggered) or 0x00 (not) */ /* BX = pixel column */ /* CX = pixel row */ /* DH = character row */ /* DL = character column */ /* Not Implemented */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x04) -- Get Light Pen Position\n", pInt->num); if (xf86GetVerbosity() > 3) { dump_registers(pInt); stack_trace(pInt); } X86_AH = X86_BX = X86_CX = X86_DX = 0; } break; case 0x05: /* Set Display Page */ /* Enter: AL = display page number */ /* Leave: Nothing */ /* Implemented */ { /* Localise */ unsigned int ioport = MEM_RW(pInt, 0x0463); CARD16 start; CARD8 x, y; /* Calculate new start address */ MEM_WB(pInt, 0x0462, X86_AL); start = X86_AL * MEM_RW(pInt, 0x044C); MEM_WW(pInt, 0x044E, start); start <<= 1; /* Update start address */ pci_io_write8(pInt->io, ioport, 0x0C); pci_io_write8(pInt->io, ioport + 1, start >> 8); pci_io_write8(pInt->io, ioport, 0x0D); pci_io_write8(pInt->io, ioport + 1, start & 0xFF); /* Switch cursor position */ y = MEM_RB(pInt, (X86_AL << 1) + 0x0450); x = MEM_RB(pInt, (X86_AL << 1) + 0x0451); start += (y * MEM_RW(pInt, 0x044A)) + x; /* Update cursor position */ pci_io_write8(pInt->io, ioport, 0x0E); pci_io_write8(pInt->io, ioport + 1, start >> 8); pci_io_write8(pInt->io, ioport, 0x0F); pci_io_write8(pInt->io, ioport + 1, start & 0xFF); } break; case 0x06: /* Initialise or Scroll Window Up */ /* Enter: AL = lines to scroll up */ /* BH = attribute for blank */ /* CH = upper y of window */ /* CL = left x of window */ /* DH = lower y of window */ /* DL = right x of window */ /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x06) -- Initialise or Scroll Window Up\n", pInt->num); 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); if (xf86GetVerbosity() > 3) { dump_registers(pInt); stack_trace(pInt); } } break; case 0x07: /* Initialise or Scroll Window Down */ /* Enter: AL = lines to scroll down */ /* BH = attribute for blank */ /* CH = upper y of window */ /* CL = left x of window */ /* DH = lower y of window */ /* DL = right x of window */ /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x07) -- Initialise or Scroll Window Down\n", pInt->num); 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); if (xf86GetVerbosity() > 3) { dump_registers(pInt); stack_trace(pInt); } } break; case 0x08: /* Read Character and Attribute at Cursor */ /* Enter: BH = display page number */ /* Leave: AH = attribute */ /* AL = character */ /* Not Implemented */ { /* Localise */ 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->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "BH=0x%2.2x\n", X86_BH); if (xf86GetVerbosity() > 3) { dump_registers(pInt); stack_trace(pInt); } X86_AX = 0; } break; case 0x09: /* Write Character and Attribute at Cursor */ /* Enter: AL = character */ /* BH = display page number */ /* BL = attribute (text) or colour (graphics) */ /* CX = replication count */ /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ 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->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) { dump_registers(pInt); stack_trace(pInt); } } break; case 0x0a: /* Write Character at Cursor */ /* Enter: AL = character */ /* BH = display page number */ /* BL = colour */ /* CX = replication count */ /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0A) -- Write Character at Cursor\n", pInt->num); 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) { dump_registers(pInt); stack_trace(pInt); } } break; case 0x0b: /* Set Palette, Background or Border */ /* Enter: BH = 0x00 or 0x01 */ /* BL = colour or palette (respectively) */ /* Leave: Nothing */ /* Implemented */ { /* Localise */ unsigned int ioport = MEM_RW(pInt, 0x0463) + 5; CARD8 cgacolour = MEM_RB(pInt, 0x0466); if (X86_BH) { cgacolour &= 0xDF; cgacolour |= (X86_BL & 0x01) << 5; } else { cgacolour &= 0xE0; cgacolour |= X86_BL & 0x1F; } MEM_WB(pInt, 0x0466, cgacolour); pci_io_write8(pInt->io, ioport, cgacolour); } break; case 0x0c: /* Write Graphics Pixel */ /* Enter: AL = pixel value */ /* BH = display page number */ /* CX = column */ /* DX = row */ /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0C) -- Write Graphics Pixel\n", pInt->num); 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) { dump_registers(pInt); stack_trace(pInt); } } break; case 0x0d: /* Read Graphics Pixel */ /* Enter: BH = display page number */ /* CX = column */ /* DX = row */ /* Leave: AL = pixel value */ /* Not Implemented */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0D) -- Read Graphics Pixel\n", pInt->num); 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) { dump_registers(pInt); stack_trace(pInt); } X86_AL = 0; } break; case 0x0e: /* Write Character in Teletype Mode */ /* Enter: AL = character */ /* BH = display page number */ /* BL = foreground colour */ /* Leave: Nothing */ /* Not Implemented */ /* WARNING: Emulation of BEL characters will require */ /* emulation of RTC and PC speaker I/O. */ /* Also, this recurses through int 0x10 */ /* which might or might not have been */ /* installed yet. */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0E) -- Write Character in Teletype Mode\n", pInt->num); 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) { dump_registers(pInt); stack_trace(pInt); } } break; case 0x0f: /* Get Video Mode */ /* Enter: Nothing */ /* Leave: AH = number of columns */ /* AL = video mode number */ /* BH = display page number */ /* Implemented */ { /* Localise */ X86_AH = MEM_RW(pInt, 0x044A); X86_AL = MEM_RB(pInt, 0x0449); X86_BH = MEM_RB(pInt, 0x0462); } break; case 0x10: /* Colour Control (subfunction in AL) */ /* Enter: Various */ /* Leave: Various */ /* Ignored */ break; case 0x11: /* Font Control (subfunction in AL) */ /* Enter: Various */ /* Leave: Various */ /* Ignored */ break; case 0x12: /* Miscellaneous (subfunction in BL) */ /* Enter: Various */ /* Leave: Various */ /* Ignored. Previous code here optionally allowed */ /* the enabling and disabling of VGA, but no system */ /* BIOS I've come across actually implements it. */ break; case 0x13: /* Write String in Teletype Mode */ /* Enter: AL = write mode */ /* BL = attribute (if (AL & 0x02) == 0) */ /* CX = string length */ /* DH = row */ /* DL = column */ /* ES:BP = string segment:offset */ /* Leave: Nothing */ /* Not Implemented */ /* WARNING: Emulation of BEL characters will require */ /* emulation of RTC and PC speaker I/O. */ /* Also, this recurses through int 0x10 */ /* which might or might not have been */ /* installed yet. */ { /* Localise */ xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x13) -- Write String in Teletype Mode\n", pInt->num); 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); if (xf86GetVerbosity() > 3) { dump_registers(pInt); stack_trace(pInt); } } break; default: /* Various extensions */ /* Enter: Various */ /* Leave: Various */ /* Ignored */ break; } return 1; } #endif #define SUCCESSFUL 0x00 #define DEVICE_NOT_FOUND 0x86 #define BAD_REGISTER_NUMBER 0x87 #ifdef SHOW_ALL_DEVICES /** * These functions are meant to be used by the PCI BIOS emulation. Some * BIOSes need to see if there are \b other chips of the same type around so * by setting \c exclude one PCI device can be explicitely excluded, if * required. */ static struct pci_device * do_find(const struct pci_id_match *m, char n, const struct pci_device *exclude) { struct pci_device *dev; struct pci_device_iterator *iter; n++; iter = pci_id_match_iterator_create(m); while ((dev = pci_device_next(iter)) != NULL) { if ((dev != exclude) && !(--n)) { break; } } pci_iterator_destroy(iter); return dev; } static struct pci_device * find_pci_device_vendor(CARD16 vendorID, CARD16 deviceID, char n, const struct pci_device *exclude) { struct pci_id_match m; m.vendor_id = vendorID; m.device_id = deviceID; m.subvendor_id = PCI_MATCH_ANY; m.subdevice_id = PCI_MATCH_ANY; m.device_class = 0; m.device_class_mask = 0; return do_find(&m, n, exclude); } static struct pci_device * find_pci_class(CARD8 intf, CARD8 subClass, CARD16 _class, char n, const struct pci_device *exclude) { struct pci_id_match m; m.vendor_id = PCI_MATCH_ANY; m.device_id = PCI_MATCH_ANY; m.subvendor_id = PCI_MATCH_ANY; m.subdevice_id = PCI_MATCH_ANY; m.device_class = (((uint32_t) _class) << 16) | (((uint32_t) subClass) << 8) | intf; m.device_class_mask = 0x00ffffff; return do_find(&m, n, exclude); } #endif /* * Return the last bus number in the same domain as dev. Only look at the * one domain since this is going into %cl, and VGA I/O is per-domain anyway. */ static int int1A_last_bus_number(struct pci_device *dev) { struct pci_device *d; struct pci_slot_match m = { dev->domain, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY }; struct pci_device_iterator *iter; int i = 0; iter = pci_slot_match_iterator_create(&m); while ((d = pci_device_next(iter))) if (d->bus > i) i = d->bus; pci_iterator_destroy(iter); return i; } static int int1A_handler(xf86Int10InfoPtr pInt) { struct pci_device *const pvp = xf86GetPciInfoForEntity(pInt->entityIndex); struct pci_device *dev; if (pvp == NULL) return 0; /* oops */ #ifdef PRINT_INT ErrorF("int 0x1a: ax=0x%x bx=0x%x cx=0x%x dx=0x%x di=0x%x es=0x%x\n", X86_EAX, X86_EBX, X86_ECX, X86_EDX, X86_EDI, X86_ESI); #endif switch (X86_AX) { case 0xb101: X86_EAX &= 0xFF00; /* no config space/special cycle support */ X86_EDX = 0x20494350; /* " ICP" */ X86_EBX = 0x0210; /* Version 2.10 */ X86_ECX &= 0xFF00; X86_ECX |= int1A_last_bus_number(pvp); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ #ifdef PRINT_INT ErrorF("ax=0x%x dx=0x%x bx=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_EDX, X86_EBX, X86_ECX, X86_EFLAGS); #endif return 1; case 0xb102: if ((X86_DX == pvp->vendor_id) && (X86_CX == pvp->device_id) && (X86_ESI == 0)) { X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ X86_EBX = pciSlotBX(pvp); } #ifdef SHOW_ALL_DEVICES else if ((dev = find_pci_device_vendor(X86_EDX, X86_ECX, X86_ESI, pvp))) { X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ X86_EBX = pciSlotBX(dev); } #endif else { X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x bx=0x%x flags=0x%x\n", X86_EAX, X86_EBX, X86_EFLAGS); #endif return 1; case 0xb103: if ((X86_ECX & 0x00FFFFFF) == pvp->device_class) { X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EBX = pciSlotBX(pvp); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ } #ifdef SHOW_ALL_DEVICES else if ((dev = find_pci_class(X86_CL, X86_CH, (X86_ECX & 0xffff0000) >> 16, X86_ESI, pvp))) { X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ X86_EBX = pciSlotBX(dev); } #endif else { X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS); #endif return 1; case 0xb108: if ((dev = findPci(pInt, X86_EBX)) != NULL) { pci_device_cfg_read_u8(dev, &X86_CL, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ } else { X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS); #endif return 1; case 0xb109: if ((dev = findPci(pInt, X86_EBX)) != NULL) { pci_device_cfg_read_u16(dev, &X86_CX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ } else { X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS); #endif return 1; case 0xb10a: if ((dev = findPci(pInt, X86_EBX)) != NULL) { pci_device_cfg_read_u32(dev, &X86_ECX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ } else { X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS); #endif return 1; case 0xb10b: if ((dev = findPci(pInt, X86_EBX)) != NULL) { pci_device_cfg_write_u8(dev, X86_CL, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ } else { X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS); #endif return 1; case 0xb10c: if ((dev = findPci(pInt, X86_EBX)) != NULL) { pci_device_cfg_write_u16(dev, X86_CX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ } else { X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS); #endif return 1; case 0xb10d: if ((dev = findPci(pInt, X86_EBX)) != NULL) { pci_device_cfg_write_u32(dev, X86_ECX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ } else { X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ } #ifdef PRINT_INT ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS); #endif return 1; default: xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x1a subfunction\n"); dump_registers(pInt); if (xf86GetVerbosity() > 3) stack_trace(pInt); return 0; } } static struct pci_device * findPci(xf86Int10InfoPtr pInt, unsigned short bx) { const unsigned bus = (bx >> 8) & 0x00FF; const unsigned dev = (bx >> 3) & 0x001F; const unsigned func = (bx) & 0x0007; return pci_device_find_by_slot(pInt->dev->domain, bus, dev, func); } static CARD32 pciSlotBX(const struct pci_device *pvp) { return ((pvp->bus << 8) & 0x00FF00) | (pvp->dev << 3) | (pvp->func); } /* * handle initialization */ static int intE6_handler(xf86Int10InfoPtr pInt) { struct pci_device *pvp; if ((pvp = xf86GetPciInfoForEntity(pInt->entityIndex))) X86_AX = (pvp->bus << 8) | (pvp->dev << 3) | (pvp->func & 0x7); pushw(pInt, X86_CS); pushw(pInt, X86_IP); X86_CS = pInt->BIOSseg; X86_EIP = 0x0003; X86_ES = 0; /* standard pc es */ return 1; } xorg-server-1.17.1/hw/xfree86/i2c/0000775000175100017510000000000012466505444013465 500000000000000xorg-server-1.17.1/hw/xfree86/i2c/Makefile.am0000664000175100017510000000024712366751547015452 00000000000000noinst_LTLIBRARIES = libi2c.la libi2c_la_SOURCES = xf86i2c.c AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = xf86i2c.h i2c_def.h xorg-server-1.17.1/hw/xfree86/i2c/xf86i2c.h0000664000175100017510000001020612456571574014754 00000000000000/* * Copyright (C) 1998 Itai Nahshon, Michael Schimek */ #ifndef _XF86I2C_H #define _XF86I2C_H #include "regionstr.h" #include "xf86.h" typedef unsigned char I2CByte; typedef unsigned short I2CSlaveAddr; typedef struct _I2CBusRec *I2CBusPtr; typedef struct _I2CDevRec *I2CDevPtr; /* I2C masters have to register themselves */ typedef struct _I2CBusRec { char *BusName; int scrnIndex; ScrnInfoPtr pScrn; void (*I2CUDelay) (I2CBusPtr b, int usec); void (*I2CPutBits) (I2CBusPtr b, int scl, int sda); void (*I2CGetBits) (I2CBusPtr b, int *scl, int *sda); /* Look at the generic routines to see how these functions should behave. */ Bool (*I2CStart) (I2CBusPtr b, int timeout); Bool (*I2CAddress) (I2CDevPtr d, I2CSlaveAddr); void (*I2CStop) (I2CDevPtr d); Bool (*I2CPutByte) (I2CDevPtr d, I2CByte data); Bool (*I2CGetByte) (I2CDevPtr d, I2CByte * data, Bool); DevUnion DriverPrivate; int HoldTime; /* 1 / bus clock frequency, 5 or 2 usec */ int BitTimeout; /* usec */ int ByteTimeout; /* usec */ int AcknTimeout; /* usec */ int StartTimeout; /* usec */ int RiseFallTime; /* usec */ I2CDevPtr FirstDev; I2CBusPtr NextBus; Bool (*I2CWriteRead) (I2CDevPtr d, I2CByte * WriteBuffer, int nWrite, I2CByte * ReadBuffer, int nRead); } I2CBusRec; #define CreateI2CBusRec xf86CreateI2CBusRec extern _X_EXPORT I2CBusPtr xf86CreateI2CBusRec(void); #define DestroyI2CBusRec xf86DestroyI2CBusRec extern _X_EXPORT void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too); #define I2CBusInit xf86I2CBusInit extern _X_EXPORT Bool xf86I2CBusInit(I2CBusPtr pI2CBus); extern _X_EXPORT I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name); extern _X_EXPORT int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr ** pppI2CBus); /* I2C slave devices */ typedef struct _I2CDevRec { const char *DevName; int BitTimeout; /* usec */ int ByteTimeout; /* usec */ int AcknTimeout; /* usec */ int StartTimeout; /* usec */ I2CSlaveAddr SlaveAddr; I2CBusPtr pI2CBus; I2CDevPtr NextDev; DevUnion DriverPrivate; } I2CDevRec; #define CreateI2CDevRec xf86CreateI2CDevRec extern _X_EXPORT I2CDevPtr xf86CreateI2CDevRec(void); extern _X_EXPORT void xf86DestroyI2CDevRec(I2CDevPtr pI2CDev, Bool unalloc); #define I2CDevInit xf86I2CDevInit extern _X_EXPORT Bool xf86I2CDevInit(I2CDevPtr pI2CDev); extern _X_EXPORT I2CDevPtr xf86I2CFindDev(I2CBusPtr, I2CSlaveAddr); /* See descriptions of these functions in xf86i2c.c */ #define I2CProbeAddress xf86I2CProbeAddress extern _X_EXPORT Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr); #define I2C_WriteRead xf86I2CWriteRead extern _X_EXPORT Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte * WriteBuffer, int nWrite, I2CByte * ReadBuffer, int nRead); #define xf86I2CRead(d, rb, nr) xf86I2CWriteRead(d, NULL, 0, rb, nr) extern _X_EXPORT Bool xf86I2CReadStatus(I2CDevPtr d, I2CByte * pbyte); extern _X_EXPORT Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte * pbyte); extern _X_EXPORT Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte * pbyte, int n); extern _X_EXPORT Bool xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword); #define xf86I2CWrite(d, wb, nw) xf86I2CWriteRead(d, wb, nw, NULL, 0) extern _X_EXPORT Bool xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte); extern _X_EXPORT Bool xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr, I2CByte * WriteBuffer, int nWrite); extern _X_EXPORT Bool xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word); extern _X_EXPORT Bool xf86I2CWriteVec(I2CDevPtr d, I2CByte * vec, int nValues); #endif /*_XF86I2C_H */ xorg-server-1.17.1/hw/xfree86/i2c/xf86i2c.c0000664000175100017510000005470112456571574014757 00000000000000/* * Copyright (C) 1998 Itai Nahshon, Michael Schimek * * The original code was derived from and inspired by * the I2C driver from the Linux kernel. * (c) 1998 Gerd Knorr */ #ifdef HAVE_XORG_CONFIG_H #include #endif #include #include #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include #include #include #include "scrnintstr.h" #include "regionstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "validate.h" #include "resource.h" #include "gcstruct.h" #include "dixstruct.h" #include "xf86i2c.h" #define I2C_TIMEOUT(x) /*(x)*/ /* Report timeouts */ #define I2C_TRACE(x) /*(x)*/ /* Report progress */ /* This is the default I2CUDelay function if not supplied by the driver. * High level I2C interfaces implementing the bus protocol in hardware * should supply this function too. * * Delay execution at least usec microseconds. * All values 0 to 1e6 inclusive must be expected. */ static void I2CUDelay(I2CBusPtr b, int usec) { struct timeval begin, cur; long d_secs, d_usecs; long diff; if (usec > 0) { X_GETTIMEOFDAY(&begin); do { /* It would be nice to use {xf86}usleep, * but usleep (1) takes >10000 usec ! */ X_GETTIMEOFDAY(&cur); d_secs = (cur.tv_sec - begin.tv_sec); d_usecs = (cur.tv_usec - begin.tv_usec); diff = d_secs * 1000000 + d_usecs; } while (diff >= 0 && diff < (usec + 1)); } } /* Most drivers will register just with GetBits/PutBits functions. * The following functions implement a software I2C protocol * by using the promitive functions given by the driver. * ================================================================ * * It is assumed that there is just one master on the I2C bus, therefore * there is no explicit test for conflits. */ #define RISEFALLTIME 2 /* usec, actually 300 to 1000 ns according to the i2c specs */ /* Some devices will hold SCL low to slow down the bus or until * ready for transmission. * * This condition will be noticed when the master tries to raise * the SCL line. You can set the timeout to zero if the slave device * does not support this clock synchronization. */ static Bool I2CRaiseSCL(I2CBusPtr b, int sda, int timeout) { int i, scl; b->I2CPutBits(b, 1, sda); b->I2CUDelay(b, b->RiseFallTime); for (i = timeout; i > 0; i -= b->RiseFallTime) { b->I2CGetBits(b, &scl, &sda); if (scl) break; b->I2CUDelay(b, b->RiseFallTime); } if (i <= 0) { I2C_TIMEOUT(ErrorF ("[I2CRaiseSCL(<%s>, %d, %d) timeout]", b->BusName, sda, timeout)); return FALSE; } return TRUE; } /* Send a start signal on the I2C bus. The start signal notifies * devices that a new transaction is initiated by the bus master. * * The start signal is always followed by a slave address. * Slave addresses are 8+ bits. The first 7 bits identify the * device and the last bit signals if this is a read (1) or * write (0) operation. * * There may be more than one start signal on one transaction. * This happens for example on some devices that allow reading * of registers. First send a start bit followed by the device * address (with the last bit 0) and the register number. Then send * a new start bit with the device address (with the last bit 1) * and then read the value from the device. * * Note this is function does not implement a multiple master * arbitration procedure. */ static Bool I2CStart(I2CBusPtr b, int timeout) { if (!I2CRaiseSCL(b, 1, timeout)) return FALSE; b->I2CPutBits(b, 1, 0); b->I2CUDelay(b, b->HoldTime); b->I2CPutBits(b, 0, 0); b->I2CUDelay(b, b->HoldTime); I2C_TRACE(ErrorF("\ni2c: <")); return TRUE; } /* This is the default I2CStop function if not supplied by the driver. * * Signal devices on the I2C bus that a transaction on the * bus has finished. There may be more than one start signal * on a transaction but only one stop signal. */ static void I2CStop(I2CDevPtr d) { I2CBusPtr b = d->pI2CBus; b->I2CPutBits(b, 0, 0); b->I2CUDelay(b, b->RiseFallTime); b->I2CPutBits(b, 1, 0); b->I2CUDelay(b, b->HoldTime); b->I2CPutBits(b, 1, 1); b->I2CUDelay(b, b->HoldTime); I2C_TRACE(ErrorF(">\n")); } /* Write/Read a single bit to/from a device. * Return FALSE if a timeout occurs. */ static Bool I2CWriteBit(I2CBusPtr b, int sda, int timeout) { Bool r; b->I2CPutBits(b, 0, sda); b->I2CUDelay(b, b->RiseFallTime); r = I2CRaiseSCL(b, sda, timeout); b->I2CUDelay(b, b->HoldTime); b->I2CPutBits(b, 0, sda); b->I2CUDelay(b, b->HoldTime); return r; } static Bool I2CReadBit(I2CBusPtr b, int *psda, int timeout) { Bool r; int scl; r = I2CRaiseSCL(b, 1, timeout); b->I2CUDelay(b, b->HoldTime); b->I2CGetBits(b, &scl, psda); b->I2CPutBits(b, 0, 1); b->I2CUDelay(b, b->HoldTime); return r; } /* This is the default I2CPutByte function if not supplied by the driver. * * A single byte is sent to the device. * The function returns FALSE if a timeout occurs, you should send * a stop condition afterwards to reset the bus. * * A timeout occurs, * if the slave pulls SCL to slow down the bus more than ByteTimeout usecs, * or slows down the bus for more than BitTimeout usecs for each bit, * or does not send an ACK bit (0) to acknowledge the transmission within * AcknTimeout usecs, but a NACK (1) bit. * * AcknTimeout must be at least b->HoldTime, the other timeouts can be * zero according to the comment on I2CRaiseSCL. */ static Bool I2CPutByte(I2CDevPtr d, I2CByte data) { Bool r; int i, scl, sda; I2CBusPtr b = d->pI2CBus; if (!I2CWriteBit(b, (data >> 7) & 1, d->ByteTimeout)) return FALSE; for (i = 6; i >= 0; i--) if (!I2CWriteBit(b, (data >> i) & 1, d->BitTimeout)) return FALSE; b->I2CPutBits(b, 0, 1); b->I2CUDelay(b, b->RiseFallTime); r = I2CRaiseSCL(b, 1, b->HoldTime); if (r) { for (i = d->AcknTimeout; i > 0; i -= b->HoldTime) { b->I2CUDelay(b, b->HoldTime); b->I2CGetBits(b, &scl, &sda); if (sda == 0) break; } if (i <= 0) { I2C_TIMEOUT(ErrorF("[I2CPutByte(<%s>, 0x%02x, %d, %d, %d) timeout]", b->BusName, data, d->BitTimeout, d->ByteTimeout, d->AcknTimeout)); r = FALSE; } I2C_TRACE(ErrorF("W%02x%c ", (int) data, sda ? '-' : '+')); } b->I2CPutBits(b, 0, 1); b->I2CUDelay(b, b->HoldTime); return r; } /* This is the default I2CGetByte function if not supplied by the driver. * * A single byte is read from the device. * The function returns FALSE if a timeout occurs, you should send * a stop condition afterwards to reset the bus. * * A timeout occurs, * if the slave pulls SCL to slow down the bus more than ByteTimeout usecs, * or slows down the bus for more than b->BitTimeout usecs for each bit. * * ByteTimeout must be at least b->HoldTime, the other timeouts can be * zero according to the comment on I2CRaiseSCL. * * For the byte in a sequence the acknowledge bit NACK (1), * otherwise ACK (0) will be sent. */ static Bool I2CGetByte(I2CDevPtr d, I2CByte * data, Bool last) { int i, sda; I2CBusPtr b = d->pI2CBus; b->I2CPutBits(b, 0, 1); b->I2CUDelay(b, b->RiseFallTime); if (!I2CReadBit(b, &sda, d->ByteTimeout)) return FALSE; *data = (sda > 0) << 7; for (i = 6; i >= 0; i--) if (!I2CReadBit(b, &sda, d->BitTimeout)) return FALSE; else *data |= (sda > 0) << i; if (!I2CWriteBit(b, last ? 1 : 0, d->BitTimeout)) return FALSE; I2C_TRACE(ErrorF("R%02x%c ", (int) *data, last ? '+' : '-')); return TRUE; } /* This is the default I2CAddress function if not supplied by the driver. * * It creates the start condition, followed by the d->SlaveAddr. * Higher level functions must call this routine rather than * I2CStart/PutByte because a hardware I2C master may not be able * to send a slave address without a start condition. * * The same timeouts apply as with I2CPutByte and additional a * StartTimeout, similar to the ByteTimeout but for the start * condition. * * In case of a timeout, the bus is left in a clean idle condition. * I. e. you *must not* send a Stop. If this function succeeds, you *must*. * * The slave address format is 16 bit, with the legacy _8_bit_ slave address * in the least significant byte. This is, the slave address must include the * R/_W flag as least significant bit. * * The most significant byte of the address will be sent _after_ the LSB, * but only if the LSB indicates: * a) an 11 bit address, this is LSB = 1111 0xxx. * b) a 'general call address', this is LSB = 0000 000x - see the I2C specs * for more. */ static Bool I2CAddress(I2CDevPtr d, I2CSlaveAddr addr) { if (I2CStart(d->pI2CBus, d->StartTimeout)) { if (I2CPutByte(d, addr & 0xFF)) { if ((addr & 0xF8) != 0xF0 && (addr & 0xFE) != 0x00) return TRUE; if (I2CPutByte(d, (addr >> 8) & 0xFF)) return TRUE; } I2CStop(d); } return FALSE; } /* These are the hardware independent I2C helper functions. * ======================================================== */ /* Function for probing. Just send the slave address * and return true if the device responds. The slave address * must have the lsb set to reflect a read (1) or write (0) access. * Don't expect a read- or write-only device will respond otherwise. */ Bool xf86I2CProbeAddress(I2CBusPtr b, I2CSlaveAddr addr) { int r; I2CDevRec d; d.DevName = "Probing"; d.BitTimeout = b->BitTimeout; d.ByteTimeout = b->ByteTimeout; d.AcknTimeout = b->AcknTimeout; d.StartTimeout = b->StartTimeout; d.SlaveAddr = addr; d.pI2CBus = b; d.NextDev = NULL; r = b->I2CAddress(&d, addr); if (r) b->I2CStop(&d); return r; } /* All functions below are related to devices and take the * slave address and timeout values from an I2CDevRec. They * return FALSE in case of an error (presumably a timeout). */ /* General purpose read and write function. * * 1st, if nWrite > 0 * Send a start condition * Send the slave address (1 or 2 bytes) with write flag * Write n bytes from WriteBuffer * 2nd, if nRead > 0 * Send a start condition [again] * Send the slave address (1 or 2 bytes) with read flag * Read n bytes to ReadBuffer * 3rd, if a Start condition has been successfully sent, * Send a Stop condition. * * The functions exits immediately when an error occures, * not proceeding any data left. However, step 3 will * be executed anyway to leave the bus in clean idle state. */ static Bool I2CWriteRead(I2CDevPtr d, I2CByte * WriteBuffer, int nWrite, I2CByte * ReadBuffer, int nRead) { Bool r = TRUE; I2CBusPtr b = d->pI2CBus; int s = 0; if (r && nWrite > 0) { r = b->I2CAddress(d, d->SlaveAddr & ~1); if (r) { for (; nWrite > 0; WriteBuffer++, nWrite--) if (!(r = b->I2CPutByte(d, *WriteBuffer))) break; s++; } } if (r && nRead > 0) { r = b->I2CAddress(d, d->SlaveAddr | 1); if (r) { for (; nRead > 0; ReadBuffer++, nRead--) if (!(r = b->I2CGetByte(d, ReadBuffer, nRead == 1))) break; s++; } } if (s) b->I2CStop(d); return r; } /* wrapper - for compatibility and convinience */ Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte * WriteBuffer, int nWrite, I2CByte * ReadBuffer, int nRead) { I2CBusPtr b = d->pI2CBus; return b->I2CWriteRead(d, WriteBuffer, nWrite, ReadBuffer, nRead); } /* Read a byte, the only readable register of a device. */ Bool xf86I2CReadStatus(I2CDevPtr d, I2CByte * pbyte) { return xf86I2CWriteRead(d, NULL, 0, pbyte, 1); } /* Read a byte from one of the registers determined by its sub-address. */ Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte * pbyte) { return xf86I2CWriteRead(d, &subaddr, 1, pbyte, 1); } /* Read bytes from subsequent registers determined by the * sub-address of the first register. */ Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte * pbyte, int n) { return xf86I2CWriteRead(d, &subaddr, 1, pbyte, n); } /* Read a word (high byte, then low byte) from one of the registers * determined by its sub-address. */ Bool xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword) { I2CByte rb[2]; if (!xf86I2CWriteRead(d, &subaddr, 1, rb, 2)) return FALSE; *pword = (rb[0] << 8) | rb[1]; return TRUE; } /* Write a byte to one of the registers determined by its sub-address. */ Bool xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte) { I2CByte wb[2]; wb[0] = subaddr; wb[1] = byte; return xf86I2CWriteRead(d, wb, 2, NULL, 0); } /* Write bytes to subsequent registers determined by the * sub-address of the first register. */ Bool xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr, I2CByte * WriteBuffer, int nWrite) { I2CBusPtr b = d->pI2CBus; Bool r = TRUE; if (nWrite > 0) { r = b->I2CAddress(d, d->SlaveAddr & ~1); if (r) { if ((r = b->I2CPutByte(d, subaddr))) for (; nWrite > 0; WriteBuffer++, nWrite--) if (!(r = b->I2CPutByte(d, *WriteBuffer))) break; b->I2CStop(d); } } return r; } /* Write a word (high byte, then low byte) to one of the registers * determined by its sub-address. */ Bool xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word) { I2CByte wb[3]; wb[0] = subaddr; wb[1] = word >> 8; wb[2] = word & 0xFF; return xf86I2CWriteRead(d, wb, 3, NULL, 0); } /* Write a vector of bytes to not adjacent registers. This vector is, * 1st byte sub-address, 2nd byte value, 3rd byte sub-address asf. * This function is intended to initialize devices. Note this function * exits immediately when an error occurs, some registers may * remain uninitialized. */ Bool xf86I2CWriteVec(I2CDevPtr d, I2CByte * vec, int nValues) { I2CBusPtr b = d->pI2CBus; Bool r = TRUE; int s = 0; if (nValues > 0) { for (; nValues > 0; nValues--, vec += 2) { if (!(r = b->I2CAddress(d, d->SlaveAddr & ~1))) break; s++; if (!(r = b->I2CPutByte(d, vec[0]))) break; if (!(r = b->I2CPutByte(d, vec[1]))) break; } if (s > 0) b->I2CStop(d); } return r; } /* Administrative functions. * ========================= */ /* Allocates an I2CDevRec for you and initializes with propper defaults * you may modify before calling xf86I2CDevInit. Your I2CDevRec must * contain at least a SlaveAddr, and a pI2CBus pointer to the bus this * device shall be linked to. * * See function I2CAddress for the slave address format. Always set * the least significant bit, indicating a read or write access, to zero. */ I2CDevPtr xf86CreateI2CDevRec(void) { return calloc(1, sizeof(I2CDevRec)); } /* Unlink an I2C device. If you got the I2CDevRec from xf86CreateI2CDevRec * you should set to free it. */ void xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc) { if (d) { I2CDevPtr *p; /* Remove this from the list of active I2C devices. */ for (p = &d->pI2CBus->FirstDev; *p != NULL; p = &(*p)->NextDev) if (*p == d) { *p = (*p)->NextDev; break; } xf86DrvMsg(d->pI2CBus->scrnIndex, X_INFO, "I2C device \"%s:%s\" removed.\n", d->pI2CBus->BusName, d->DevName); if (unalloc) free(d); } } /* I2C transmissions are related to an I2CDevRec you must link to a * previously registered bus (see xf86I2CBusInit) before attempting * to read and write data. You may call xf86I2CProbeAddress first to * see if the device in question is present on this bus. * * xf86I2CDevInit will not allocate an I2CBusRec for you, instead you * may enter a pointer to a statically allocated I2CDevRec or the (modified) * result of xf86CreateI2CDevRec. * * If you don't specify timeouts for the device (n <= 0), it will inherit * the bus-wide defaults. The function returns TRUE on success. */ Bool xf86I2CDevInit(I2CDevPtr d) { I2CBusPtr b; if (d == NULL || (b = d->pI2CBus) == NULL || (d->SlaveAddr & 1) || xf86I2CFindDev(b, d->SlaveAddr) != NULL) return FALSE; if (d->BitTimeout <= 0) d->BitTimeout = b->BitTimeout; if (d->ByteTimeout <= 0) d->ByteTimeout = b->ByteTimeout; if (d->AcknTimeout <= 0) d->AcknTimeout = b->AcknTimeout; if (d->StartTimeout <= 0) d->StartTimeout = b->StartTimeout; d->NextDev = b->FirstDev; b->FirstDev = d; xf86DrvMsg(b->scrnIndex, X_INFO, "I2C device \"%s:%s\" registered at address 0x%02X.\n", b->BusName, d->DevName, d->SlaveAddr); return TRUE; } I2CDevPtr xf86I2CFindDev(I2CBusPtr b, I2CSlaveAddr addr) { I2CDevPtr d; if (b) { for (d = b->FirstDev; d != NULL; d = d->NextDev) if (d->SlaveAddr == addr) return d; } return NULL; } static I2CBusPtr I2CBusList; /* Allocates an I2CBusRec for you and initializes with propper defaults * you may modify before calling xf86I2CBusInit. Your I2CBusRec must * contain at least a BusName, a scrnIndex (or -1), and a complete set * of either high or low level I2C function pointers. You may pass * bus-wide timeouts, otherwise inplausible values will be replaced * with safe defaults. */ I2CBusPtr xf86CreateI2CBusRec(void) { I2CBusPtr b; b = (I2CBusPtr) calloc(1, sizeof(I2CBusRec)); if (b != NULL) { b->scrnIndex = -1; b->pScrn = NULL; b->HoldTime = 5; /* 100 kHz bus */ b->BitTimeout = 5; b->ByteTimeout = 5; b->AcknTimeout = 5; b->StartTimeout = 5; b->RiseFallTime = RISEFALLTIME; } return b; } /* Unregister an I2C bus. If you got the I2CBusRec from xf86CreateI2CBusRec * you should set to free it. If you set , the function * xf86DestroyI2CDevRec will be called for all devices linked to the bus * first, passing down the option. */ void xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too) { if (b) { I2CBusPtr *p; /* Remove this from the list of active I2C buses */ for (p = &I2CBusList; *p != NULL; p = &(*p)->NextBus) if (*p == b) { *p = (*p)->NextBus; break; } if (b->FirstDev != NULL) { if (devs_too) { I2CDevPtr d; while ((d = b->FirstDev) != NULL) { b->FirstDev = d->NextDev; xf86DestroyI2CDevRec(d, unalloc); } } else { if (unalloc) { xf86Msg(X_ERROR, "i2c bug: Attempt to remove I2C bus \"%s\", " "but device list is not empty.\n", b->BusName); return; } } } xf86DrvMsg(b->scrnIndex, X_INFO, "I2C bus \"%s\" removed.\n", b->BusName); if (unalloc) free(b); } } /* I2C masters have to register themselves using this function. * It will not allocate an I2CBusRec for you, instead you may enter * a pointer to a statically allocated I2CBusRec or the (modified) * result of xf86CreateI2CBusRec. Returns TRUE on success. * * At this point there won't be any traffic on the I2C bus. */ Bool xf86I2CBusInit(I2CBusPtr b) { /* I2C buses must be identified by a unique scrnIndex * and name. If scrnIndex is unspecified (a negative value), * then the name must be unique throughout the server. */ if (b->BusName == NULL || xf86I2CFindBus(b->scrnIndex, b->BusName) != NULL) return FALSE; /* If the high level functions are not * supplied, use the generic functions. * In this case we need the low-level * function. */ if (b->I2CWriteRead == NULL) { b->I2CWriteRead = I2CWriteRead; if (b->I2CPutBits == NULL || b->I2CGetBits == NULL) { if (b->I2CPutByte == NULL || b->I2CGetByte == NULL || b->I2CAddress == NULL || b->I2CStart == NULL || b->I2CStop == NULL) return FALSE; } else { b->I2CPutByte = I2CPutByte; b->I2CGetByte = I2CGetByte; b->I2CAddress = I2CAddress; b->I2CStop = I2CStop; b->I2CStart = I2CStart; } } if (b->I2CUDelay == NULL) b->I2CUDelay = I2CUDelay; if (b->HoldTime < 2) b->HoldTime = 5; if (b->BitTimeout <= 0) b->BitTimeout = b->HoldTime; if (b->ByteTimeout <= 0) b->ByteTimeout = b->HoldTime; if (b->AcknTimeout <= 0) b->AcknTimeout = b->HoldTime; if (b->StartTimeout <= 0) b->StartTimeout = b->HoldTime; /* Put new bus on list. */ b->NextBus = I2CBusList; I2CBusList = b; xf86DrvMsg(b->scrnIndex, X_INFO, "I2C bus \"%s\" initialized.\n", b->BusName); return TRUE; } I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name) { I2CBusPtr p; if (name != NULL) for (p = I2CBusList; p != NULL; p = p->NextBus) if (scrnIndex < 0 || p->scrnIndex == scrnIndex) if (!strcmp(p->BusName, name)) return p; return NULL; } /* * Return an array of I2CBusPtr's related to a screen. The caller is * responsible for freeing the array. */ int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr ** pppI2CBus) { I2CBusPtr pI2CBus; int n = 0; if (pppI2CBus) *pppI2CBus = NULL; for (pI2CBus = I2CBusList; pI2CBus; pI2CBus = pI2CBus->NextBus) { if ((pI2CBus->scrnIndex >= 0) && (pI2CBus->scrnIndex != scrnIndex)) continue; n++; if (!pppI2CBus) continue; *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr)); (*pppI2CBus)[n - 1] = pI2CBus; } return n; } xorg-server-1.17.1/hw/xfree86/i2c/i2c_def.h0000664000175100017510000000011212274325511015033 00000000000000#ifndef __I2C_DEF_H__ #define __I2C_DEF_H__ #include "xf86i2c.h" #endif xorg-server-1.17.1/hw/xfree86/i2c/Makefile.in0000664000175100017510000006530012466505432015453 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/i2c DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(sdk_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libi2c_la_LIBADD = am_libi2c_la_OBJECTS = xf86i2c.lo libi2c_la_OBJECTS = $(am_libi2c_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 = $(libi2c_la_SOURCES) DIST_SOURCES = $(libi2c_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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 = libi2c.la libi2c_la_SOURCES = xf86i2c.c AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = xf86i2c.h i2c_def.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/i2c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/xfree86/i2c/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libi2c.la: $(libi2c_la_OBJECTS) $(libi2c_la_DEPENDENCIES) $(EXTRA_libi2c_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libi2c_la_OBJECTS) $(libi2c_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86i2c.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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)$(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-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-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-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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-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 tags-am uninstall uninstall-am 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: xorg-server-1.17.1/hw/kdrive/0000775000175100017510000000000012466505446013007 500000000000000xorg-server-1.17.1/hw/kdrive/Makefile.am0000664000175100017510000000071712160102336014746 00000000000000if BUILD_KDRIVEFBDEVLIB FBDEV_SUBDIRS = fbdev endif if XFAKESERVER XFAKE_SUBDIRS = fake endif if XEPHYR XEPHYR_SUBDIRS = ephyr endif if KDRIVELINUX LINUX_SUBDIRS = linux endif SERVER_SUBDIRS = \ $(FBDEV_SUBDIRS) \ $(XEPHYR_SUBDIRS) \ $(XFAKE_SUBDIRS) SUBDIRS = \ src \ $(LINUX_SUBDIRS) \ $(SERVER_SUBDIRS) DIST_SUBDIRS = fbdev ephyr src linux fake relink: $(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done xorg-server-1.17.1/hw/kdrive/fake/0000775000175100017510000000000012466505446013715 500000000000000xorg-server-1.17.1/hw/kdrive/fake/Makefile.am0000664000175100017510000000070112200102654015643 00000000000000AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ noinst_LTLIBRARIES = libfake.la bin_PROGRAMS = Xfake libfake_la_SOURCES = \ fake.c \ kbd.c \ os.c \ mouse.c \ fake.h Xfake_SOURCES = \ fakeinit.c Xfake_LDADD = \ libfake.la \ @KDRIVE_LIBS@ Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) Xfake_DEPENDENCIES = \ libfake.la \ @KDRIVE_LOCAL_LIBS@ relink: $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) xorg-server-1.17.1/hw/kdrive/fake/os.c0000664000175100017510000000302712366220413014407 00000000000000/* * Copyright © 2004 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_CONFIG_H #include #endif #include "fake.h" static int FakeInit(void) { return 1; } static void FakeEnable(void) { } static Bool FakeSpecialKey(KeySym sym) { return FALSE; } static void FakeDisable(void) { } static void FakeFini(void) { } KdOsFuncs FakeOsFuncs = { FakeInit, FakeEnable, FakeSpecialKey, FakeDisable, FakeFini, 0 }; xorg-server-1.17.1/hw/kdrive/fake/fake.h0000664000175100017510000000600212274325511014700 00000000000000/* * Copyright © 2004 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. */ #ifndef _FBDEV_H_ #define _FBDEV_H_ #include #include #include "kdrive.h" #ifdef RANDR #include "randrstr.h" #endif typedef struct _fakePriv { CARD8 *base; int bytes_per_line; } FakePriv; typedef struct _fakeScrPriv { Rotation randr; Bool shadow; } FakeScrPriv; extern KdCardFuncs fakeFuncs; Bool fakeInitialize(KdCardInfo * card, FakePriv * priv); Bool fakeCardInit(KdCardInfo * card); Bool fakeScreenInit(KdScreenInfo * screen); Bool fakeScreenInitialize(KdScreenInfo * screen, FakeScrPriv * scrpriv); Bool fakeInitScreen(ScreenPtr pScreen); Bool fakeFinishInitScreen(ScreenPtr pScreen); Bool fakeCreateResources(ScreenPtr pScreen); void fakePreserve(KdCardInfo * card); Bool fakeEnable(ScreenPtr pScreen); Bool fakeDPMS(ScreenPtr pScreen, int mode); void fakeDisable(ScreenPtr pScreen); void fakeRestore(KdCardInfo * card); void fakeScreenFini(KdScreenInfo * screen); void fakeCardFini(KdCardInfo * card); void fakeGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs); void fakePutColors(ScreenPtr pScreen, int n, xColorItem * pdefs); Bool fakeMapFramebuffer(KdScreenInfo * screen); void *fakeWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure); void fakeSetScreenSizes(ScreenPtr pScreen); Bool fakeUnmapFramebuffer(KdScreenInfo * screen); Bool fakeSetShadow(ScreenPtr pScreen); Bool fakeCreateColormap(ColormapPtr pmap); #ifdef RANDR Bool fakeRandRGetInfo(ScreenPtr pScreen, Rotation * rotations); Bool fakeRandRSetConfig(ScreenPtr pScreen, Rotation randr, int rate, RRScreenSizePtr pSize); Bool fakeRandRInit(ScreenPtr pScreen); #endif extern KdPointerDriver FakePointerDriver; extern KdKeyboardDriver FakeKeyboardDriver; extern KdOsFuncs FakeOsFuncs; #endif /* _FBDEV_H_ */ xorg-server-1.17.1/hw/kdrive/fake/kbd.c0000664000175100017510000000367212366220413014534 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include "fake.h" #include #define FAKE_WIDTH 2 static Status FakeKeyboardInit(KdKeyboardInfo * ki) { ki->minScanCode = 8; ki->maxScanCode = 255; return Success; } static Status FakeKeyboardEnable(KdKeyboardInfo * ki) { return Success; } static void FakeKeyboardDisable(KdKeyboardInfo * ki) { return; } static void FakeKeyboardFini(KdKeyboardInfo * ki) { } static void FakeKeyboardLeds(KdKeyboardInfo * ki, int leds) { } static void FakeKeyboardBell(KdKeyboardInfo * ki, int volume, int frequency, int duration) { } KdKeyboardDriver FakeKeyboardDriver = { "fake", FakeKeyboardInit, FakeKeyboardEnable, FakeKeyboardLeds, FakeKeyboardBell, FakeKeyboardDisable, FakeKeyboardFini, NULL, }; xorg-server-1.17.1/hw/kdrive/fake/fake.c0000664000175100017510000002454712366220413014706 00000000000000/* * Copyright © 2004 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_CONFIG_H #include #endif #include "fake.h" extern int KdTsPhyScreen; Bool fakeInitialize(KdCardInfo * card, FakePriv * priv) { priv->base = 0; priv->bytes_per_line = 0; return TRUE; } Bool fakeCardInit(KdCardInfo * card) { FakePriv *priv; priv = (FakePriv *) malloc(sizeof(FakePriv)); if (!priv) return FALSE; if (!fakeInitialize(card, priv)) { free(priv); return FALSE; } card->driver = priv; return TRUE; } Bool fakeScreenInitialize(KdScreenInfo * screen, FakeScrPriv * scrpriv) { if (!screen->width || !screen->height) { screen->width = 1024; screen->height = 768; screen->rate = 72; } if (screen->width <= 0) screen->width = 1; if (screen->height <= 0) screen->height = 1; if (!screen->fb.depth) screen->fb.depth = 16; if (screen->fb.depth <= 8) { screen->fb.visuals = ((1 << StaticGray) | (1 << GrayScale) | (1 << StaticColor) | (1 << PseudoColor) | (1 << TrueColor) | (1 << DirectColor)); } else { screen->fb.visuals = (1 << TrueColor); #define Mask(o,l) (((1 << l) - 1) << o) if (screen->fb.depth <= 15) { screen->fb.depth = 15; screen->fb.bitsPerPixel = 16; screen->fb.redMask = Mask (10, 5); screen->fb.greenMask = Mask (5, 5); screen->fb.blueMask = Mask (0, 5); } else if (screen->fb.depth <= 16) { screen->fb.depth = 16; screen->fb.bitsPerPixel = 16; screen->fb.redMask = Mask (11, 5); screen->fb.greenMask = Mask (5, 6); screen->fb.blueMask = Mask (0, 5); } else { screen->fb.depth = 24; screen->fb.bitsPerPixel = 32; screen->fb.redMask = Mask (16, 8); screen->fb.greenMask = Mask (8, 8); screen->fb.blueMask = Mask (0, 8); } } scrpriv->randr = screen->randr; return fakeMapFramebuffer(screen); } Bool fakeScreenInit(KdScreenInfo * screen) { FakeScrPriv *scrpriv; scrpriv = calloc(1, sizeof(FakeScrPriv)); if (!scrpriv) return FALSE; screen->driver = scrpriv; if (!fakeScreenInitialize(screen, scrpriv)) { screen->driver = 0; free(scrpriv); return FALSE; } return TRUE; } void * fakeWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) { KdScreenPriv(pScreen); FakePriv *priv = pScreenPriv->card->driver; if (!pScreenPriv->enabled) return 0; *size = priv->bytes_per_line; return priv->base + row * priv->bytes_per_line; } Bool fakeMapFramebuffer(KdScreenInfo * screen) { FakeScrPriv *scrpriv = screen->driver; KdPointerMatrix m; FakePriv *priv = screen->card->driver; if (scrpriv->randr != RR_Rotate_0) scrpriv->shadow = TRUE; else scrpriv->shadow = FALSE; KdComputePointerMatrix(&m, scrpriv->randr, screen->width, screen->height); KdSetPointerMatrix(&m); priv->bytes_per_line = ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2; free(priv->base); priv->base = malloc(priv->bytes_per_line * screen->height); if (scrpriv->shadow) { if (!KdShadowFbAlloc (screen, scrpriv->randr & (RR_Rotate_90 | RR_Rotate_270))) return FALSE; } else { screen->fb.byteStride = priv->bytes_per_line; screen->fb.pixelStride = (priv->bytes_per_line * 8 / screen->fb.bitsPerPixel); screen->fb.frameBuffer = (CARD8 *) (priv->base); } return TRUE; } void fakeSetScreenSizes(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FakeScrPriv *scrpriv = screen->driver; if (scrpriv->randr & (RR_Rotate_0 | RR_Rotate_180)) { pScreen->width = screen->width; pScreen->height = screen->height; pScreen->mmWidth = screen->width_mm; pScreen->mmHeight = screen->height_mm; } else { pScreen->width = screen->width; pScreen->height = screen->height; pScreen->mmWidth = screen->height_mm; pScreen->mmHeight = screen->width_mm; } } Bool fakeUnmapFramebuffer(KdScreenInfo * screen) { FakePriv *priv = screen->card->driver; KdShadowFbFree(screen); free(priv->base); priv->base = NULL; return TRUE; } Bool fakeSetShadow(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FakeScrPriv *scrpriv = screen->driver; ShadowUpdateProc update; ShadowWindowProc window; window = fakeWindowLinear; update = 0; if (scrpriv->randr) update = shadowUpdateRotatePacked; else update = shadowUpdatePacked; return KdShadowSet(pScreen, scrpriv->randr, update, window); } #ifdef RANDR Bool fakeRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FakeScrPriv *scrpriv = screen->driver; RRScreenSizePtr pSize; Rotation randr; int n; *rotations = RR_Rotate_All | RR_Reflect_All; for (n = 0; n < pScreen->numDepths; n++) if (pScreen->allowedDepths[n].numVids) break; if (n == pScreen->numDepths) return FALSE; pSize = RRRegisterSize(pScreen, screen->width, screen->height, screen->width_mm, screen->height_mm); randr = KdSubRotation(scrpriv->randr, screen->randr); RRSetCurrentConfig(pScreen, randr, 0, pSize); return TRUE; } Bool fakeRandRSetConfig(ScreenPtr pScreen, Rotation randr, int rate, RRScreenSizePtr pSize) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FakeScrPriv *scrpriv = screen->driver; Bool wasEnabled = pScreenPriv->enabled; FakeScrPriv oldscr; int oldwidth; int oldheight; int oldmmwidth; int oldmmheight; int newwidth, newheight; if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) { newwidth = pSize->width; newheight = pSize->height; } else { newwidth = pSize->height; newheight = pSize->width; } if (wasEnabled) KdDisableScreen(pScreen); oldscr = *scrpriv; oldwidth = screen->width; oldheight = screen->height; oldmmwidth = pScreen->mmWidth; oldmmheight = pScreen->mmHeight; /* * Set new configuration */ scrpriv->randr = KdAddRotation(screen->randr, randr); fakeUnmapFramebuffer(screen); if (!fakeMapFramebuffer(screen)) goto bail4; KdShadowUnset(screen->pScreen); if (!fakeSetShadow(screen->pScreen)) goto bail4; fakeSetScreenSizes(screen->pScreen); /* * Set frame buffer mapping */ (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen), pScreen->width, pScreen->height, screen->fb.depth, screen->fb.bitsPerPixel, screen->fb.byteStride, screen->fb.frameBuffer); /* set the subpixel order */ KdSetSubpixelOrder(pScreen, scrpriv->randr); if (wasEnabled) KdEnableScreen(pScreen); return TRUE; bail4: fakeUnmapFramebuffer(screen); *scrpriv = oldscr; (void) fakeMapFramebuffer(screen); pScreen->width = oldwidth; pScreen->height = oldheight; pScreen->mmWidth = oldmmwidth; pScreen->mmHeight = oldmmheight; if (wasEnabled) KdEnableScreen(pScreen); return FALSE; } Bool fakeRandRInit(ScreenPtr pScreen) { rrScrPrivPtr pScrPriv; if (!RRScreenInit(pScreen)) return FALSE; pScrPriv = rrGetScrPriv(pScreen); pScrPriv->rrGetInfo = fakeRandRGetInfo; pScrPriv->rrSetConfig = fakeRandRSetConfig; return TRUE; } #endif Bool fakeCreateColormap(ColormapPtr pmap) { return fbInitializeColormap(pmap); } Bool fakeInitScreen(ScreenPtr pScreen) { #ifdef TOUCHSCREEN KdTsPhyScreen = pScreen->myNum; #endif pScreen->CreateColormap = fakeCreateColormap; return TRUE; } Bool fakeFinishInitScreen(ScreenPtr pScreen) { if (!shadowSetup(pScreen)) return FALSE; #ifdef RANDR if (!fakeRandRInit(pScreen)) return FALSE; #endif return TRUE; } Bool fakeCreateResources(ScreenPtr pScreen) { return fakeSetShadow(pScreen); } void fakePreserve(KdCardInfo * card) { } Bool fakeEnable(ScreenPtr pScreen) { return TRUE; } Bool fakeDPMS(ScreenPtr pScreen, int mode) { return TRUE; } void fakeDisable(ScreenPtr pScreen) { } void fakeRestore(KdCardInfo * card) { } void fakeScreenFini(KdScreenInfo * screen) { } void fakeCardFini(KdCardInfo * card) { FakePriv *priv = card->driver; free(priv->base); free(priv); } void fakeGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs) { while (n--) { pdefs->red = 0; pdefs->green = 0; pdefs->blue = 0; pdefs++; } } void fakePutColors(ScreenPtr pScreen, int n, xColorItem * pdefs) { } xorg-server-1.17.1/hw/kdrive/fake/mouse.c0000664000175100017510000000335012366220413015115 00000000000000/* * Copyright © 2004 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_CONFIG_H #include #endif #include #include #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" static Status MouseInit(KdPointerInfo * pi) { return Success; } static Status MouseEnable(KdPointerInfo * pi) { return Success; } static void MouseDisable(KdPointerInfo * pi) { return; } static void MouseFini(KdPointerInfo * pi) { return; } KdPointerDriver FakePointerDriver = { "fake", MouseInit, MouseEnable, MouseDisable, MouseFini, }; xorg-server-1.17.1/hw/kdrive/fake/fakeinit.c0000664000175100017510000000620612366220413015562 00000000000000/* * Copyright © 2004 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_CONFIG_H #include #endif #include "fake.h" void InitCard(char *name) { KdCardInfoAdd(&fakeFuncs, 0); } void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { KdInitOutput(pScreenInfo, argc, argv); } void InitInput(int argc, char **argv) { KdPointerInfo *pi; KdKeyboardInfo *ki; pi = KdNewPointer(); if (!pi) return; pi->driver = &FakePointerDriver; KdAddPointer(pi); ki = KdNewKeyboard(); if (!ki) return; ki->driver = &FakeKeyboardDriver; KdAddKeyboard(ki); KdInitInput(); } void CloseInput(void) { KdCloseInput(); } #ifdef DDXBEFORERESET void ddxBeforeReset(void) { } #endif void ddxUseMsg(void) { KdUseMsg(); } int ddxProcessArgument(int argc, char **argv, int i) { return KdProcessArgument(argc, argv, i); } void OsVendorInit(void) { KdOsInit(&FakeOsFuncs); } KdCardFuncs fakeFuncs = { fakeCardInit, /* cardinit */ fakeScreenInit, /* scrinit */ fakeInitScreen, /* initScreen */ fakeFinishInitScreen, /* finishInitScreen */ fakeCreateResources, /* createRes */ fakePreserve, /* preserve */ fakeEnable, /* enable */ fakeDPMS, /* dpms */ fakeDisable, /* disable */ fakeRestore, /* restore */ fakeScreenFini, /* scrfini */ fakeCardFini, /* cardfini */ 0, /* initCursor */ 0, /* enableCursor */ 0, /* disableCursor */ 0, /* finiCursor */ 0, /* recolorCursor */ 0, /* initAccel */ 0, /* enableAccel */ 0, /* disableAccel */ 0, /* finiAccel */ fakeGetColors, /* getColors */ fakePutColors, /* putColors */ }; xorg-server-1.17.1/hw/kdrive/fake/Makefile.in0000664000175100017510000006734312466505431015711 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ bin_PROGRAMS = Xfake$(EXEEXT) subdir = hw/kdrive/fake DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libfake_la_LIBADD = am_libfake_la_OBJECTS = fake.lo kbd.lo os.lo mouse.lo libfake_la_OBJECTS = $(am_libfake_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__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_Xfake_OBJECTS = fakeinit.$(OBJEXT) Xfake_OBJECTS = $(am_Xfake_OBJECTS) Xfake_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(Xfake_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 = $(libfake_la_SOURCES) $(Xfake_SOURCES) DIST_SOURCES = $(libfake_la_SOURCES) $(Xfake_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ noinst_LTLIBRARIES = libfake.la libfake_la_SOURCES = \ fake.c \ kbd.c \ os.c \ mouse.c \ fake.h Xfake_SOURCES = \ fakeinit.c Xfake_LDADD = \ libfake.la \ @KDRIVE_LIBS@ Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) Xfake_DEPENDENCIES = \ libfake.la \ @KDRIVE_LOCAL_LIBS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/kdrive/fake/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/kdrive/fake/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libfake.la: $(libfake_la_OBJECTS) $(libfake_la_DEPENDENCIES) $(EXTRA_libfake_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libfake_la_OBJECTS) $(libfake_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list Xfake$(EXEEXT): $(Xfake_OBJECTS) $(Xfake_DEPENDENCIES) $(EXTRA_Xfake_DEPENDENCIES) @rm -f Xfake$(EXEEXT) $(AM_V_CCLD)$(Xfake_LINK) $(Xfake_OBJECTS) $(Xfake_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fakeinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kbd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mouse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS 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-binPROGRAMS 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-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS 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 tags-am uninstall uninstall-am uninstall-binPROGRAMS relink: $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) # 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: xorg-server-1.17.1/hw/kdrive/linux/0000775000175100017510000000000012466505446014146 500000000000000xorg-server-1.17.1/hw/kdrive/linux/Makefile.am0000664000175100017510000000062112200102654016075 00000000000000AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H noinst_LTLIBRARIES = liblinux.la liblinux_la_SOURCES = liblinux_la_SOURCES += linux.c if KDRIVE_KBD liblinux_la_SOURCES += keyboard.c endif if KDRIVE_EVDEV liblinux_la_SOURCES += evdev.c endif if KDRIVE_MOUSE liblinux_la_SOURCES += mouse.c ms.c ps2.c endif if TSLIB liblinux_la_SOURCES += tslib.c endif xorg-server-1.17.1/hw/kdrive/linux/evdev.c0000664000175100017510000003023712366220413015333 00000000000000/* * Copyright © 2004 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_CONFIG_H #include #endif #include #include #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" #define NUM_EVENTS 128 #define ABS_UNSET -65535 #define BITS_PER_LONG (sizeof(long) * 8) #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) #define ISBITSET(x,y) ((x)[LONG(y)] & BIT(y)) #define OFF(x) ((x)%BITS_PER_LONG) #define LONG(x) ((x)/BITS_PER_LONG) #define BIT(x) (1 << OFF(x)) typedef struct _kevdev { /* current device state */ int rel[REL_MAX + 1]; int abs[ABS_MAX + 1]; int prevabs[ABS_MAX + 1]; long key[NBITS(KEY_MAX + 1)]; /* supported device info */ long relbits[NBITS(REL_MAX + 1)]; long absbits[NBITS(ABS_MAX + 1)]; long keybits[NBITS(KEY_MAX + 1)]; struct input_absinfo absinfo[ABS_MAX + 1]; int max_rel; int max_abs; int fd; } Kevdev; static void EvdevPtrBtn(KdPointerInfo * pi, struct input_event *ev) { int flags = KD_MOUSE_DELTA | pi->buttonState; if (ev->code >= BTN_MOUSE && ev->code < BTN_JOYSTICK) { switch (ev->code) { case BTN_LEFT: if (ev->value == 1) flags |= KD_BUTTON_1; else flags &= ~KD_BUTTON_1; break; case BTN_MIDDLE: if (ev->value == 1) flags |= KD_BUTTON_2; else flags &= ~KD_BUTTON_2; break; case BTN_RIGHT: if (ev->value == 1) flags |= KD_BUTTON_3; else flags &= ~KD_BUTTON_3; break; default: /* Unknow button */ break; } KdEnqueuePointerEvent(pi, flags, 0, 0, 0); } } static void EvdevPtrMotion(KdPointerInfo * pi, struct input_event *ev) { Kevdev *ke = pi->driverPrivate; int i; int flags = KD_MOUSE_DELTA | pi->buttonState; for (i = 0; i <= ke->max_rel; i++) if (ke->rel[i]) { int a; for (a = 0; a <= ke->max_rel; a++) { if (ISBITSET(ke->relbits, a)) { if (a == 0) KdEnqueuePointerEvent(pi, flags, ke->rel[a], 0, 0); else if (a == 1) KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0); } ke->rel[a] = 0; } break; } for (i = 0; i < ke->max_abs; i++) if (ke->abs[i] != ke->prevabs[i]) { int a; ErrorF("abs"); for (a = 0; a <= ke->max_abs; a++) { if (ISBITSET(ke->absbits, a)) ErrorF(" %d=%d", a, ke->abs[a]); ke->prevabs[a] = ke->abs[a]; } ErrorF("\n"); break; } if (ev->code == REL_WHEEL) { for (i = 0; i < abs(ev->value); i++) { if (ev->value > 0) flags |= KD_BUTTON_4; else flags |= KD_BUTTON_5; KdEnqueuePointerEvent(pi, flags, 0, 0, 0); if (ev->value > 0) flags &= ~KD_BUTTON_4; else flags &= ~KD_BUTTON_5; KdEnqueuePointerEvent(pi, flags, 0, 0, 0); } } } static void EvdevPtrRead(int evdevPort, void *closure) { KdPointerInfo *pi = closure; Kevdev *ke = pi->driverPrivate; int i; struct input_event events[NUM_EVENTS]; int n; n = read(evdevPort, &events, NUM_EVENTS * sizeof(struct input_event)); if (n <= 0) { if (errno == ENODEV) DeleteInputDeviceRequest(pi->dixdev); return; } n /= sizeof(struct input_event); for (i = 0; i < n; i++) { switch (events[i].type) { case EV_SYN: break; case EV_KEY: EvdevPtrBtn(pi, &events[i]); break; case EV_REL: ke->rel[events[i].code] += events[i].value; EvdevPtrMotion(pi, &events[i]); break; case EV_ABS: ke->abs[events[i].code] = events[i].value; EvdevPtrMotion(pi, &events[i]); break; } } } const char *kdefaultEvdev[] = { "/dev/input/event0", "/dev/input/event1", "/dev/input/event2", "/dev/input/event3", }; #define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0])) static Status EvdevPtrInit(KdPointerInfo * pi) { int i; int fd; if (!pi->path) { for (i = 0; i < NUM_DEFAULT_EVDEV; i++) { fd = open(kdefaultEvdev[i], 2); if (fd >= 0) { pi->path = strdup(kdefaultEvdev[i]); break; } } } else { fd = open(pi->path, O_RDWR); if (fd < 0) { ErrorF("Failed to open evdev device %s\n", pi->path); return BadMatch; } } close(fd); pi->name = strdup("Evdev mouse"); return Success; } static Status EvdevPtrEnable(KdPointerInfo * pi) { int fd; unsigned long ev[NBITS(EV_MAX)]; Kevdev *ke; if (!pi || !pi->path) return BadImplementation; fd = open(pi->path, 2); if (fd < 0) return BadMatch; if (ioctl(fd, EVIOCGRAB, 1) < 0) perror("Grabbing evdev mouse device failed"); if (ioctl(fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) { perror("EVIOCGBIT 0"); close(fd); return BadMatch; } ke = calloc(1, sizeof(Kevdev)); if (!ke) { close(fd); return BadAlloc; } if (ISBITSET(ev, EV_KEY)) { if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(ke->keybits)), ke->keybits) < 0) { perror("EVIOCGBIT EV_KEY"); free(ke); close(fd); return BadMatch; } } if (ISBITSET(ev, EV_REL)) { if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(ke->relbits)), ke->relbits) < 0) { perror("EVIOCGBIT EV_REL"); free(ke); close(fd); return BadMatch; } for (ke->max_rel = REL_MAX; ke->max_rel >= 0; ke->max_rel--) if (ISBITSET(ke->relbits, ke->max_rel)) break; } if (ISBITSET(ev, EV_ABS)) { int i; if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(ke->absbits)), ke->absbits) < 0) { perror("EVIOCGBIT EV_ABS"); free(ke); close(fd); return BadMatch; } for (ke->max_abs = ABS_MAX; ke->max_abs >= 0; ke->max_abs--) if (ISBITSET(ke->absbits, ke->max_abs)) break; for (i = 0; i <= ke->max_abs; i++) { if (ISBITSET(ke->absbits, i)) if (ioctl(fd, EVIOCGABS(i), &ke->absinfo[i]) < 0) { perror("EVIOCGABS"); break; } ke->prevabs[i] = ABS_UNSET; } if (i <= ke->max_abs) { free(ke); close(fd); return BadValue; } } if (!KdRegisterFd(fd, EvdevPtrRead, pi)) { free(ke); close(fd); return BadAlloc; } pi->driverPrivate = ke; ke->fd = fd; return Success; } static void EvdevPtrDisable(KdPointerInfo * pi) { Kevdev *ke; ke = pi->driverPrivate; if (!pi || !pi->driverPrivate) return; KdUnregisterFd(pi, ke->fd, TRUE); if (ioctl(ke->fd, EVIOCGRAB, 0) < 0) perror("Ungrabbing evdev mouse device failed"); free(ke); pi->driverPrivate = 0; } static void EvdevPtrFini(KdPointerInfo * pi) { } /* * Evdev keyboard functions */ static void readMapping(KdKeyboardInfo * ki) { if (!ki) return; ki->minScanCode = 0; ki->maxScanCode = 247; } static void EvdevKbdRead(int evdevPort, void *closure) { KdKeyboardInfo *ki = closure; struct input_event events[NUM_EVENTS]; int i, n; n = read(evdevPort, &events, NUM_EVENTS * sizeof(struct input_event)); if (n <= 0) { if (errno == ENODEV) DeleteInputDeviceRequest(ki->dixdev); return; } n /= sizeof(struct input_event); for (i = 0; i < n; i++) { if (events[i].type == EV_KEY) KdEnqueueKeyboardEvent(ki, events[i].code, !events[i].value); /* FIXME: must implement other types of events else ErrorF("Event type (%d) not delivered\n", events[i].type); */ } } static Status EvdevKbdInit(KdKeyboardInfo * ki) { int fd; if (!ki->path) { ErrorF("Couldn't find evdev device path\n"); return BadValue; } else { fd = open(ki->path, O_RDWR); if (fd < 0) { ErrorF("Failed to open evdev device %s\n", ki->path); return BadMatch; } } close(fd); ki->name = strdup("Evdev keyboard"); readMapping(ki); return Success; } static Status EvdevKbdEnable(KdKeyboardInfo * ki) { unsigned long ev[NBITS(EV_MAX)]; Kevdev *ke; int fd; if (!ki || !ki->path) return BadImplementation; fd = open(ki->path, O_RDWR); if (fd < 0) return BadMatch; if (ioctl(fd, EVIOCGRAB, 1) < 0) perror("Grabbing evdev keyboard device failed"); if (ioctl(fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) { perror("EVIOCGBIT 0"); close(fd); return BadMatch; } ke = calloc(1, sizeof(Kevdev)); if (!ke) { close(fd); return BadAlloc; } if (!KdRegisterFd(fd, EvdevKbdRead, ki)) { free(ke); close(fd); return BadAlloc; } ki->driverPrivate = ke; ke->fd = fd; return Success; } static void EvdevKbdLeds(KdKeyboardInfo * ki, int leds) { /* struct input_event event; Kevdev *ke; ki->driverPrivate = ke; memset(&event, 0, sizeof(event)); event.type = EV_LED; event.code = LED_CAPSL; event.value = leds & (1 << 0) ? 1 : 0; write(ke->fd, (char *) &event, sizeof(event)); event.type = EV_LED; event.code = LED_NUML; event.value = leds & (1 << 1) ? 1 : 0; write(ke->fd, (char *) &event, sizeof(event)); event.type = EV_LED; event.code = LED_SCROLLL; event.value = leds & (1 << 2) ? 1 : 0; write(ke->fd, (char *) &event, sizeof(event)); event.type = EV_LED; event.code = LED_COMPOSE; event.value = leds & (1 << 3) ? 1 : 0; write(ke->fd, (char *) &event, sizeof(event)); */ } static void EvdevKbdBell(KdKeyboardInfo * ki, int volume, int frequency, int duration) { } static void EvdevKbdDisable(KdKeyboardInfo * ki) { Kevdev *ke; ke = ki->driverPrivate; if (!ki || !ki->driverPrivate) return; KdUnregisterFd(ki, ke->fd, TRUE); if (ioctl(ke->fd, EVIOCGRAB, 0) < 0) perror("Ungrabbing evdev keyboard device failed"); free(ke); ki->driverPrivate = 0; } static void EvdevKbdFini(KdKeyboardInfo * ki) { } KdPointerDriver LinuxEvdevMouseDriver = { "evdev", EvdevPtrInit, EvdevPtrEnable, EvdevPtrDisable, EvdevPtrFini, NULL, }; KdKeyboardDriver LinuxEvdevKeyboardDriver = { "evdev", EvdevKbdInit, EvdevKbdEnable, EvdevKbdLeds, EvdevKbdBell, EvdevKbdDisable, EvdevKbdFini, NULL, }; xorg-server-1.17.1/hw/kdrive/linux/ms.c0000664000175100017510000001052612366220413014640 00000000000000/* Copyright (c) 2001 by Juliusz Chroboczek Copyright (c) 1999 by Keith Packard 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. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" static int MsReadBytes(int fd, char *buf, int len, int min) { int n, tot; fd_set set; struct timeval tv; tot = 0; while (len) { n = read(fd, buf, len); if (n > 0) { tot += n; buf += n; len -= n; } if (tot % min == 0) break; FD_ZERO(&set); FD_SET(fd, &set); tv.tv_sec = 0; tv.tv_usec = 100 * 1000; n = select(fd + 1, &set, 0, 0, &tv); if (n <= 0) break; } return tot; } static void MsRead(int port, void *closure) { unsigned char buf[3 * 200]; unsigned char *b; int n; int dx, dy; unsigned long flags; while ((n = MsReadBytes(port, (char *) buf, sizeof(buf), 3)) > 0) { b = buf; while (n >= 3) { flags = KD_MOUSE_DELTA; if (b[0] & 0x20) flags |= KD_BUTTON_1; if (b[0] & 0x10) flags |= KD_BUTTON_3; dx = (char) (((b[0] & 0x03) << 6) | (b[1] & 0x3F)); dy = (char) (((b[0] & 0x0C) << 4) | (b[2] & 0x3F)); n -= 3; b += 3; KdEnqueuePointerEvent(closure, flags, dx, dy, 0); } } } static Status MsInit(KdPointerInfo * pi) { if (!pi) return BadImplementation; if (!pi->path || strcmp(pi->path, "auto")) pi->path = strdup("/dev/mouse"); if (!pi->name) pi->name = strdup("Microsoft protocol mouse"); return Success; } static Status MsEnable(KdPointerInfo * pi) { int port; struct termios t; int ret; port = open(pi->path, O_RDWR | O_NONBLOCK); if (port < 0) { ErrorF("Couldn't open %s (%d)\n", pi->path, (int) errno); return 0; } else if (port == 0) { ErrorF("Opening %s returned 0! Please complain to Keith.\n", pi->path); goto bail; } if (!isatty(port)) { ErrorF("%s is not a tty\n", pi->path); goto bail; } ret = tcgetattr(port, &t); if (ret < 0) { ErrorF("Couldn't tcgetattr(%s): %d\n", pi->path, errno); goto bail; } t.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXOFF); t.c_oflag &= ~OPOST; t.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); t.c_cflag &= ~(CSIZE | PARENB); t.c_cflag |= CS8 | CLOCAL | CSTOPB; cfsetispeed(&t, B1200); cfsetospeed(&t, B1200); t.c_cc[VMIN] = 1; t.c_cc[VTIME] = 0; ret = tcsetattr(port, TCSANOW, &t); if (ret < 0) { ErrorF("Couldn't tcsetattr(%s): %d\n", pi->path, errno); goto bail; } if (KdRegisterFd(port, MsRead, pi)) return TRUE; pi->driverPrivate = (void *) (intptr_t) port; return Success; bail: close(port); return BadMatch; } static void MsDisable(KdPointerInfo * pi) { KdUnregisterFd(pi, (int) (intptr_t) pi->driverPrivate, TRUE); } static void MsFini(KdPointerInfo * pi) { } KdPointerDriver MsMouseDriver = { "ms", MsInit, MsEnable, MsDisable, MsFini, NULL, }; xorg-server-1.17.1/hw/kdrive/linux/keyboard.c0000664000175100017510000006545212366220413016031 00000000000000/* * Copyright © 1999 Keith Packard * XKB integration © 2006 Nokia Corporation, author: Tomas Frydrych * * LinuxKeyboardRead() XKB code based on xf86KbdLnx.c: * Copyright © 1990,91 by Thomas Roell, Dinkelscherben, Germany. * Copyright © 1994-2001 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #ifdef HAVE_CONFIG_H #include #endif #include "kdrive.h" #include #include #define XK_PUBLISHING #include #include #include extern int LinuxConsoleFd; static const KeySym linux_to_x[256] = { NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, XK_Escape, NoSymbol, NoSymbol, NoSymbol, NoSymbol, XK_space, XK_exclam, XK_quotedbl, XK_numbersign, XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, XK_parenleft, XK_parenright, XK_asterisk, XK_plus, XK_comma, XK_minus, XK_period, XK_slash, XK_0, XK_1, XK_2, XK_3, XK_4, XK_5, XK_6, XK_7, XK_8, XK_9, XK_colon, XK_semicolon, XK_less, XK_equal, XK_greater, XK_question, XK_at, XK_A, XK_B, XK_C, XK_D, XK_E, XK_F, XK_G, XK_H, XK_I, XK_J, XK_K, XK_L, XK_M, XK_N, XK_O, XK_P, XK_Q, XK_R, XK_S, XK_T, XK_U, XK_V, XK_W, XK_X, XK_Y, XK_Z, XK_bracketleft, XK_backslash, XK_bracketright, XK_asciicircum, XK_underscore, XK_grave, XK_a, XK_b, XK_c, XK_d, XK_e, XK_f, XK_g, XK_h, XK_i, XK_j, XK_k, XK_l, XK_m, XK_n, XK_o, XK_p, XK_q, XK_r, XK_s, XK_t, XK_u, XK_v, XK_w, XK_x, XK_y, XK_z, XK_braceleft, XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, XK_nobreakspace, XK_exclamdown, XK_cent, XK_sterling, XK_currency, XK_yen, XK_brokenbar, XK_section, XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft, XK_notsign, XK_hyphen, XK_registered, XK_macron, XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior, XK_acute, XK_mu, XK_paragraph, XK_periodcentered, XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright, XK_onequarter, XK_onehalf, XK_threequarters, XK_questiondown, XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde, XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla, XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis, XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis, XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute, XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply, XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp, XK_agrave, XK_aacute, XK_acircumflex, XK_atilde, XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla, XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis, XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde, XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division, XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex, XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis }; /* * Getting a keycode from scancode * * With XKB * -------- * * We have to enqueue keyboard events using standard X keycodes which correspond * to AT scancode + 8; this means that we need to translate the Linux scancode * provided by the kernel to an AT scancode -- this translation is not linear * and requires that we use a LUT. * * * Without XKB * ----------- * * We can use custom keycodes, which makes things simpler; we define our custom * keycodes as Linux scancodes + KD_KEY_OFFSET */ /* This LUT translates AT scancodes into Linux ones -- the keymap we create for the core X keyboard protocol has to be AT-scancode based so that it corresponds to the Xkb keymap. */ #if 0 static unsigned char at2lnx[] = { 0x0, /* no valid scancode */ 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */ 0x03, /* KEY_2 */ 0x04, /* KEY_3 */ 0x05, /* KEY_4 */ 0x06, /* KEY_5 */ 0x07, /* KEY_6 */ 0x08, /* KEY_7 */ 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */ 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */ 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */ 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */ 0x11, /* KEY_W */ 0x12, /* KEY_E */ 0x13, /* KEY_R */ 0x14, /* KEY_T */ 0x15, /* KEY_Y */ 0x16, /* KEY_U */ 0x17, /* KEY_I */ 0x18, /* KEY_O */ 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */ 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */ 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */ 0x1f, /* KEY_S */ 0x20, /* KEY_D */ 0x21, /* KEY_F */ 0x22, /* KEY_G */ 0x23, /* KEY_H */ 0x24, /* KEY_J */ 0x25, /* KEY_K */ 0x26, /* KEY_L */ 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */ 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */ 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */ 0x2d, /* KEY_X */ 0x2e, /* KEY_C */ 0x2f, /* KEY_V */ 0x30, /* KEY_B */ 0x31, /* KEY_N */ 0x32, /* KEY_M */ 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */ 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */ 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */ 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */ 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */ 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */ 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */ 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */ 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */ 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */ 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */ 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */ 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */ 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */ 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */ 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */ 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */ 0x00, /* 0x55 */ 0x56, /* KEY_Less */ 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */ 0x66, /* KEY_Home */ 0x67, /* KEY_Up */ 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */ 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */ 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */ 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */ 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */ 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */ 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */ 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */ 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */ 0x7A, /* KEY_Menu/FOCUS_PF11 */ 0x00, /* 0x6e */ 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */ 0x00, /* 0x71 */ 0x00, /* 0x72 */ 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */ 0x00, /* 0x75 */ 0x00, /* 0x76 */ 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */ 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */ 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */ 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */ 0x00, /* 0x7f */ }; #define NUM_AT_KEYS (sizeof(at2lnx)/sizeof(at2lnx[0])) #define LNX_KEY_INDEX(n) n < NUM_AT_KEYS ? at2lnx[n] : 0 static unsigned char tbl[KD_MAX_WIDTH] = { 0, 1 << KG_SHIFT, (1 << KG_ALTGR), (1 << KG_ALTGR) | (1 << KG_SHIFT) }; #endif static void readKernelMapping(KdKeyboardInfo * ki) { #if 0 KeySym *k; int i, j; struct kbentry kbe; int minKeyCode, maxKeyCode; int row; int fd; if (!ki) return; fd = LinuxConsoleFd; minKeyCode = NR_KEYS; maxKeyCode = 0; row = 0; ki->keySyms.mapWidth = KD_MAX_WIDTH; for (i = 0; i < NR_KEYS && row < KD_MAX_LENGTH; ++i) { kbe.kb_index = LNX_KEY_INDEX(i); k = ki->keySyms.map + row * ki->keySyms.mapWidth; for (j = 0; j < ki->keySyms.mapWidth; ++j) { unsigned short kval; k[j] = NoSymbol; kbe.kb_table = tbl[j]; kbe.kb_value = 0; if (ioctl(fd, KDGKBENT, &kbe)) continue; kval = KVAL(kbe.kb_value); switch (KTYP(kbe.kb_value)) { case KT_LATIN: case KT_LETTER: k[j] = linux_to_x[kval]; break; case KT_FN: if (kval <= 19) k[j] = XK_F1 + kval; else switch (kbe.kb_value) { case K_FIND: k[j] = XK_Home; /* or XK_Find */ break; case K_INSERT: k[j] = XK_Insert; break; case K_REMOVE: k[j] = XK_Delete; break; case K_SELECT: k[j] = XK_End; /* or XK_Select */ break; case K_PGUP: k[j] = XK_Prior; break; case K_PGDN: k[j] = XK_Next; break; case K_HELP: k[j] = XK_Help; break; case K_DO: k[j] = XK_Execute; break; case K_PAUSE: k[j] = XK_Pause; break; case K_MACRO: k[j] = XK_Menu; break; default: break; } break; case KT_SPEC: switch (kbe.kb_value) { case K_ENTER: k[j] = XK_Return; break; case K_BREAK: k[j] = XK_Break; break; case K_CAPS: k[j] = XK_Caps_Lock; break; case K_NUM: k[j] = XK_Num_Lock; break; case K_HOLD: k[j] = XK_Scroll_Lock; break; case K_COMPOSE: k[j] = XK_Multi_key; break; default: break; } break; case KT_PAD: switch (kbe.kb_value) { case K_PPLUS: k[j] = XK_KP_Add; break; case K_PMINUS: k[j] = XK_KP_Subtract; break; case K_PSTAR: k[j] = XK_KP_Multiply; break; case K_PSLASH: k[j] = XK_KP_Divide; break; case K_PENTER: k[j] = XK_KP_Enter; break; case K_PCOMMA: k[j] = XK_KP_Separator; break; case K_PDOT: k[j] = XK_KP_Decimal; break; case K_PPLUSMINUS: k[j] = XK_KP_Subtract; break; default: if (kval <= 9) k[j] = XK_KP_0 + kval; break; } break; /* * KT_DEAD keys are for accelerated diacritical creation. */ case KT_DEAD: switch (kbe.kb_value) { case K_DGRAVE: k[j] = XK_dead_grave; break; case K_DACUTE: k[j] = XK_dead_acute; break; case K_DCIRCM: k[j] = XK_dead_circumflex; break; case K_DTILDE: k[j] = XK_dead_tilde; break; case K_DDIERE: k[j] = XK_dead_diaeresis; break; } break; case KT_CUR: switch (kbe.kb_value) { case K_DOWN: k[j] = XK_Down; break; case K_LEFT: k[j] = XK_Left; break; case K_RIGHT: k[j] = XK_Right; break; case K_UP: k[j] = XK_Up; break; } break; case KT_SHIFT: switch (kbe.kb_value) { case K_ALTGR: k[j] = XK_Mode_switch; break; case K_ALT: k[j] = (kbe.kb_index == 0x64 ? XK_Alt_R : XK_Alt_L); break; case K_CTRL: k[j] = (kbe.kb_index == 0x61 ? XK_Control_R : XK_Control_L); break; case K_CTRLL: k[j] = XK_Control_L; break; case K_CTRLR: k[j] = XK_Control_R; break; case K_SHIFT: k[j] = (kbe.kb_index == 0x36 ? XK_Shift_R : XK_Shift_L); break; case K_SHIFTL: k[j] = XK_Shift_L; break; case K_SHIFTR: k[j] = XK_Shift_R; break; default: break; } break; /* * KT_ASCII keys accumulate a 3 digit decimal number that gets * emitted when the shift state changes. We can't emulate that. */ case KT_ASCII: break; case KT_LOCK: if (kbe.kb_value == K_SHIFTLOCK) k[j] = XK_Shift_Lock; break; #ifdef KT_X case KT_X: /* depends on new keyboard symbols in file linux/keyboard.h */ if (kbe.kb_value == K_XMENU) k[j] = XK_Menu; if (kbe.kb_value == K_XTELEPHONE) k[j] = XK_telephone; break; #endif #ifdef KT_XF case KT_XF: /* special linux keysyms which map directly to XF86 keysyms */ k[j] = (kbe.kb_value & 0xFF) + 0x1008FF00; break; #endif default: break; } if (i < minKeyCode) minKeyCode = i; if (i > maxKeyCode) maxKeyCode = i; } if (minKeyCode == NR_KEYS) continue; if (k[3] == k[2]) k[3] = NoSymbol; if (k[2] == k[1]) k[2] = NoSymbol; if (k[1] == k[0]) k[1] = NoSymbol; if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; if (k[3] == k[0] && k[2] == k[1] && k[2] == NoSymbol) k[3] = NoSymbol; row++; } ki->minScanCode = minKeyCode; ki->maxScanCode = maxKeyCode; #endif } /* * We need these to handle extended scancodes correctly (I could just use the * numbers below, but this makes the code more readable */ /* The prefix codes */ #define KEY_Prefix0 /* special 0x60 */ 96 #define KEY_Prefix1 /* special 0x61 */ 97 /* The raw scancodes */ #define KEY_Enter /* Enter 0x1c */ 28 #define KEY_LCtrl /* Ctrl(left) 0x1d */ 29 #define KEY_Slash /* / (Slash) ? 0x35 */ 53 #define KEY_KP_Multiply /* * 0x37 */ 55 #define KEY_Alt /* Alt(left) 0x38 */ 56 #define KEY_F3 /* F3 0x3d */ 61 #define KEY_F4 /* F4 0x3e */ 62 #define KEY_F5 /* F5 0x3f */ 63 #define KEY_F6 /* F6 0x40 */ 64 #define KEY_F7 /* F7 0x41 */ 65 #define KEY_ScrollLock /* ScrollLock 0x46 */ 70 #define KEY_KP_7 /* 7 Home 0x47 */ 71 #define KEY_KP_8 /* 8 Up 0x48 */ 72 #define KEY_KP_9 /* 9 PgUp 0x49 */ 73 #define KEY_KP_Minus /* - (Minus) 0x4a */ 74 #define KEY_KP_4 /* 4 Left 0x4b */ 75 #define KEY_KP_5 /* 5 0x4c */ 76 #define KEY_KP_6 /* 6 Right 0x4d */ 77 #define KEY_KP_Plus /* + (Plus) 0x4e */ 78 #define KEY_KP_1 /* 1 End 0x4f */ 79 #define KEY_KP_2 /* 2 Down 0x50 */ 80 #define KEY_KP_3 /* 3 PgDown 0x51 */ 81 #define KEY_KP_0 /* 0 Insert 0x52 */ 82 #define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83 #define KEY_Home /* Home 0x59 */ 89 #define KEY_Up /* Up 0x5a */ 90 #define KEY_PgUp /* PgUp 0x5b */ 91 #define KEY_Left /* Left 0x5c */ 92 #define KEY_Begin /* Begin 0x5d */ 93 #define KEY_Right /* Right 0x5e */ 94 #define KEY_End /* End 0x5f */ 95 #define KEY_Down /* Down 0x60 */ 96 #define KEY_PgDown /* PgDown 0x61 */ 97 #define KEY_Insert /* Insert 0x62 */ 98 #define KEY_Delete /* Delete 0x63 */ 99 #define KEY_KP_Enter /* Enter 0x64 */ 100 #define KEY_RCtrl /* Ctrl(right) 0x65 */ 101 #define KEY_Pause /* Pause 0x66 */ 102 #define KEY_Print /* Print 0x67 */ 103 #define KEY_KP_Divide /* Divide 0x68 */ 104 #define KEY_AltLang /* AtlLang(right) 0x69 */ 105 #define KEY_Break /* Break 0x6a */ 106 #define KEY_LMeta /* Left Meta 0x6b */ 107 #define KEY_RMeta /* Right Meta 0x6c */ 108 #define KEY_Menu /* Menu 0x6d */ 109 #define KEY_F13 /* F13 0x6e */ 110 #define KEY_F14 /* F14 0x6f */ 111 #define KEY_F15 /* F15 0x70 */ 112 #define KEY_F16 /* F16 0x71 */ 113 #define KEY_F17 /* F17 0x72 */ 114 #define KEY_KP_DEC /* KP_DEC 0x73 */ 115 static void LinuxKeyboardRead(int fd, void *closure) { unsigned char buf[256], *b; int n; unsigned char prefix = 0, scancode = 0; while ((n = read(fd, buf, sizeof(buf))) > 0) { b = buf; while (n--) { /* * With xkb we use RAW mode for reading the console, which allows us * process extended scancodes. * * See if this is a prefix extending the following keycode */ if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0)) { prefix = KEY_Prefix0; /* swallow this up */ b++; continue; } else if (!prefix && ((b[0] & 0x7f) == KEY_Prefix1)) { prefix = KEY_Prefix1; /* swallow this up */ b++; continue; } scancode = b[0] & 0x7f; switch (prefix) { /* from xf86Events.c */ case KEY_Prefix0: { switch (scancode) { case KEY_KP_7: scancode = KEY_Home; break; /* curs home */ case KEY_KP_8: scancode = KEY_Up; break; /* curs up */ case KEY_KP_9: scancode = KEY_PgUp; break; /* curs pgup */ case KEY_KP_4: scancode = KEY_Left; break; /* curs left */ case KEY_KP_5: scancode = KEY_Begin; break; /* curs begin */ case KEY_KP_6: scancode = KEY_Right; break; /* curs right */ case KEY_KP_1: scancode = KEY_End; break; /* curs end */ case KEY_KP_2: scancode = KEY_Down; break; /* curs down */ case KEY_KP_3: scancode = KEY_PgDown; break; /* curs pgdown */ case KEY_KP_0: scancode = KEY_Insert; break; /* curs insert */ case KEY_KP_Decimal: scancode = KEY_Delete; break; /* curs delete */ case KEY_Enter: scancode = KEY_KP_Enter; break; /* keypad enter */ case KEY_LCtrl: scancode = KEY_RCtrl; break; /* right ctrl */ case KEY_KP_Multiply: scancode = KEY_Print; break; /* print */ case KEY_Slash: scancode = KEY_KP_Divide; break; /* keyp divide */ case KEY_Alt: scancode = KEY_AltLang; break; /* right alt */ case KEY_ScrollLock: scancode = KEY_Break; break; /* curs break */ case 0x5b: scancode = KEY_LMeta; break; case 0x5c: scancode = KEY_RMeta; break; case 0x5d: scancode = KEY_Menu; break; case KEY_F3: scancode = KEY_F13; break; case KEY_F4: scancode = KEY_F14; break; case KEY_F5: scancode = KEY_F15; break; case KEY_F6: scancode = KEY_F16; break; case KEY_F7: scancode = KEY_F17; break; case KEY_KP_Plus: scancode = KEY_KP_DEC; break; /* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6) */ case 0x2A: case 0x36: b++; prefix = 0; continue; default: /* * "Internet" keyboards are generating lots of new * codes. Let them pass. There is little consistency * between them, so don't bother with symbolic names at * this level. */ scancode += 0x78; } break; } case KEY_Prefix1: { /* we do no handle these */ b++; prefix = 0; continue; } default: /* should not happen */ case 0: /* do nothing */ ; } prefix = 0; KdEnqueueKeyboardEvent(closure, scancode, b[0] & 0x80); b++; } } } static int LinuxKbdTrans; static struct termios LinuxTermios; static Status LinuxKeyboardEnable(KdKeyboardInfo * ki) { struct termios nTty; unsigned char buf[256]; int n; int fd; if (!ki) return !Success; fd = LinuxConsoleFd; ki->driverPrivate = (void *) (intptr_t) fd; ioctl(fd, KDGKBMODE, &LinuxKbdTrans); tcgetattr(fd, &LinuxTermios); ioctl(fd, KDSKBMODE, K_RAW); nTty = LinuxTermios; nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); nTty.c_oflag = 0; nTty.c_cflag = CREAD | CS8; nTty.c_lflag = 0; nTty.c_cc[VTIME] = 0; nTty.c_cc[VMIN] = 1; cfsetispeed(&nTty, 9600); cfsetospeed(&nTty, 9600); tcsetattr(fd, TCSANOW, &nTty); /* * Flush any pending keystrokes */ while ((n = read(fd, buf, sizeof(buf))) > 0); KdRegisterFd(fd, LinuxKeyboardRead, ki); return Success; } static void LinuxKeyboardDisable(KdKeyboardInfo * ki) { int fd; if (!ki) return; fd = (int) (intptr_t) ki->driverPrivate; KdUnregisterFd(ki, fd, FALSE); ioctl(fd, KDSKBMODE, LinuxKbdTrans); tcsetattr(fd, TCSANOW, &LinuxTermios); } static Status LinuxKeyboardInit(KdKeyboardInfo * ki) { if (!ki) return !Success; free(ki->path); ki->path = strdup("console"); free(ki->name); ki->name = strdup("Linux console keyboard"); readKernelMapping(ki); return Success; } static void LinuxKeyboardLeds(KdKeyboardInfo * ki, int leds) { if (!ki) return; ioctl((int) (intptr_t) ki->driverPrivate, KDSETLED, leds & 7); } KdKeyboardDriver LinuxKeyboardDriver = { "keyboard", .Init = LinuxKeyboardInit, .Enable = LinuxKeyboardEnable, .Leds = LinuxKeyboardLeds, .Disable = LinuxKeyboardDisable, }; xorg-server-1.17.1/hw/kdrive/linux/ps2.c0000664000175100017510000001016612366220413014725 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" static int Ps2ReadBytes(int fd, char *buf, int len, int min) { int n, tot; fd_set set; struct timeval tv; tot = 0; while (len) { n = read(fd, buf, len); if (n > 0) { tot += n; buf += n; len -= n; } if (tot % min == 0) break; FD_ZERO(&set); FD_SET(fd, &set); tv.tv_sec = 0; tv.tv_usec = 100 * 1000; n = select(fd + 1, &set, 0, 0, &tv); if (n <= 0) break; } return tot; } const char *Ps2Names[] = { "/dev/psaux", /* "/dev/mouse", */ "/dev/input/mice", }; #define NUM_PS2_NAMES (sizeof (Ps2Names) / sizeof (Ps2Names[0])) static void Ps2Read(int ps2Port, void *closure) { unsigned char buf[3 * 200]; unsigned char *b; int n; int dx, dy; unsigned long flags; unsigned long left_button = KD_BUTTON_1; unsigned long right_button = KD_BUTTON_3; #undef SWAP_USB #ifdef SWAP_USB if (id == 2) { left_button = KD_BUTTON_3; right_button = KD_BUTTON_1; } #endif while ((n = Ps2ReadBytes(ps2Port, (char *) buf, sizeof(buf), 3)) > 0) { b = buf; while (n >= 3) { flags = KD_MOUSE_DELTA; if (b[0] & 4) flags |= KD_BUTTON_2; if (b[0] & 2) flags |= right_button; if (b[0] & 1) flags |= left_button; dx = b[1]; if (b[0] & 0x10) dx -= 256; dy = b[2]; if (b[0] & 0x20) dy -= 256; dy = -dy; n -= 3; b += 3; KdEnqueuePointerEvent(closure, flags, dx, dy, 0); } } } static Status Ps2Init(KdPointerInfo * pi) { int ps2Port, i; if (!pi->path) { for (i = 0; i < NUM_PS2_NAMES; i++) { ps2Port = open(Ps2Names[i], 0); if (ps2Port >= 0) { pi->path = strdup(Ps2Names[i]); break; } } } else { ps2Port = open(pi->path, 0); } if (ps2Port < 0) return BadMatch; close(ps2Port); if (!pi->name) pi->name = strdup("PS/2 Mouse"); return Success; } static Status Ps2Enable(KdPointerInfo * pi) { int fd; if (!pi) return BadImplementation; fd = open(pi->path, 0); if (fd < 0) return BadMatch; if (!KdRegisterFd(fd, Ps2Read, pi)) { close(fd); return BadAlloc; } pi->driverPrivate = (void *) (intptr_t) fd; return Success; } static void Ps2Disable(KdPointerInfo * pi) { KdUnregisterFd(pi, (int) (intptr_t) pi->driverPrivate, TRUE); } static void Ps2Fini(KdPointerInfo * pi) { } KdPointerDriver Ps2MouseDriver = { "ps2", Ps2Init, Ps2Enable, Ps2Disable, Ps2Fini, NULL, }; xorg-server-1.17.1/hw/kdrive/linux/mouse.c0000664000175100017510000006024112366220413015350 00000000000000/* * Copyright © 2001 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_CONFIG_H #include #endif #include #include #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" #undef DEBUG #undef DEBUG_BYTES #define KBUFIO_SIZE 256 #define MOUSE_TIMEOUT 100 typedef struct _kbufio { int fd; unsigned char buf[KBUFIO_SIZE]; int avail; int used; } Kbufio; static Bool MouseWaitForReadable(int fd, int timeout) { fd_set set; struct timeval tv, *tp; int n; CARD32 done; done = GetTimeInMillis() + timeout; for (;;) { FD_ZERO(&set); FD_SET(fd, &set); if (timeout == -1) tp = 0; else { tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout % 1000) * 1000; tp = &tv; } n = select(fd + 1, &set, 0, 0, tp); if (n > 0) return TRUE; if (n < 0 && (errno == EAGAIN || errno == EINTR)) { timeout = (int) (done - GetTimeInMillis()); if (timeout > 0) continue; } break; } return FALSE; } static int MouseReadByte(Kbufio * b, int timeout) { int n; if (b->avail <= b->used) { if (timeout && !MouseWaitForReadable(b->fd, timeout)) { #ifdef DEBUG_BYTES ErrorF("\tTimeout %d\n", timeout); #endif return -1; } n = read(b->fd, b->buf, KBUFIO_SIZE); if (n <= 0) return -1; b->avail = n; b->used = 0; } #ifdef DEBUG_BYTES ErrorF("\tget %02x\n", b->buf[b->used]); #endif return b->buf[b->used++]; } #if NOTUSED static int MouseFlush(Kbufio * b, char *buf, int size) { CARD32 now = GetTimeInMillis(); CARD32 done = now + 100; int c; int n = 0; while ((c = MouseReadByte(b, done - now)) != -1) { if (buf) { if (n == size) { memmove(buf, buf + 1, size - 1); n--; } buf[n++] = c; } now = GetTimeInMillis(); if ((INT32) (now - done) >= 0) break; } return n; } static int MousePeekByte(Kbufio * b, int timeout) { int c; c = MouseReadByte(b, timeout); if (c != -1) --b->used; return c; } #endif /* NOTUSED */ static Bool MouseWaitForWritable(int fd, int timeout) { fd_set set; struct timeval tv, *tp; int n; FD_ZERO(&set); FD_SET(fd, &set); if (timeout == -1) tp = 0; else { tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout % 1000) * 1000; tp = &tv; } n = select(fd + 1, 0, &set, 0, tp); if (n > 0) return TRUE; return FALSE; } static Bool MouseWriteByte(int fd, unsigned char c, int timeout) { int ret; #ifdef DEBUG_BYTES ErrorF("\tput %02x\n", c); #endif for (;;) { ret = write(fd, &c, 1); if (ret == 1) return TRUE; if (ret == 0) return FALSE; if (errno != EWOULDBLOCK) return FALSE; if (!MouseWaitForWritable(fd, timeout)) return FALSE; } } static Bool MouseWriteBytes(int fd, unsigned char *c, int n, int timeout) { while (n--) if (!MouseWriteByte(fd, *c++, timeout)) return FALSE; return TRUE; } #define MAX_MOUSE 10 /* maximum length of mouse protocol */ #define MAX_SKIP 16 /* number of error bytes before switching */ #define MAX_VALID 4 /* number of valid packets before accepting */ typedef struct _kmouseProt { const char *name; Bool (*Complete) (KdPointerInfo * pi, unsigned char *ev, int ne); int (*Valid) (KdPointerInfo * pi, unsigned char *ev, int ne); Bool (*Parse) (KdPointerInfo * pi, unsigned char *ev, int ne); Bool (*Init) (KdPointerInfo * pi); unsigned char headerMask, headerValid; unsigned char dataMask, dataValid; Bool tty; unsigned int c_iflag; unsigned int c_oflag; unsigned int c_lflag; unsigned int c_cflag; unsigned int speed; unsigned char *init; unsigned long state; } KmouseProt; typedef enum _kmouseStage { MouseBroken, MouseTesting, MouseWorking } KmouseStage; typedef struct _kmouse { Kbufio iob; const KmouseProt *prot; int i_prot; KmouseStage stage; /* protocol verification stage */ Bool tty; /* mouse device is a tty */ int valid; /* sequential valid events */ int tested; /* bytes scanned during Testing phase */ int invalid; /* total invalid bytes for this protocol */ unsigned long state; /* private per protocol, init to prot->state */ } Kmouse; static int mouseValid(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; const KmouseProt *prot = km->prot; int i; for (i = 0; i < ne; i++) if ((ev[i] & prot->headerMask) == prot->headerValid) break; if (i != 0) return i; for (i = 1; i < ne; i++) if ((ev[i] & prot->dataMask) != prot->dataValid) return -1; return 0; } static Bool threeComplete(KdPointerInfo * pi, unsigned char *ev, int ne) { return ne == 3; } static Bool fourComplete(KdPointerInfo * pi, unsigned char *ev, int ne) { return ne == 4; } static Bool fiveComplete(KdPointerInfo * pi, unsigned char *ev, int ne) { return ne == 5; } static Bool MouseReasonable(KdPointerInfo * pi, unsigned long flags, int dx, int dy) { Kmouse *km = pi->driverPrivate; if (km->stage == MouseWorking) return TRUE; if (dx < -50 || dx > 50) { #ifdef DEBUG ErrorF("Large X %d\n", dx); #endif return FALSE; } if (dy < -50 || dy > 50) { #ifdef DEBUG ErrorF("Large Y %d\n", dy); #endif return FALSE; } return TRUE; } /* * Standard PS/2 mouse protocol */ static Bool ps2Parse(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; int dx, dy, dz; unsigned long flags; unsigned long flagsrelease = 0; flags = KD_MOUSE_DELTA; if (ev[0] & 4) flags |= KD_BUTTON_2; if (ev[0] & 2) flags |= KD_BUTTON_3; if (ev[0] & 1) flags |= KD_BUTTON_1; if (ne > 3) { dz = (int) (signed char) ev[3]; if (dz < 0) { flags |= KD_BUTTON_4; flagsrelease = KD_BUTTON_4; } else if (dz > 0) { flags |= KD_BUTTON_5; flagsrelease = KD_BUTTON_5; } } dx = ev[1]; if (ev[0] & 0x10) dx -= 256; dy = ev[2]; if (ev[0] & 0x20) dy -= 256; dy = -dy; if (!MouseReasonable(pi, flags, dx, dy)) return FALSE; if (km->stage == MouseWorking) { KdEnqueuePointerEvent(pi, flags, dx, dy, 0); if (flagsrelease) { flags &= ~flagsrelease; KdEnqueuePointerEvent(pi, flags, dx, dy, 0); } } return TRUE; } static Bool ps2Init(KdPointerInfo * pi); static const KmouseProt ps2Prot = { "ps/2", threeComplete, mouseValid, ps2Parse, ps2Init, 0x08, 0x08, 0x00, 0x00, FALSE }; static const KmouseProt imps2Prot = { "imps/2", fourComplete, mouseValid, ps2Parse, ps2Init, 0x08, 0x08, 0x00, 0x00, FALSE }; static const KmouseProt exps2Prot = { "exps/2", fourComplete, mouseValid, ps2Parse, ps2Init, 0x08, 0x08, 0x00, 0x00, FALSE }; /* * Once the mouse is known to speak ps/2 protocol, go and find out * what advanced capabilities it has and turn them on */ /* these extracted from FreeBSD 4.3 sys/dev/kbd/atkbdcreg.h */ /* aux device commands (sent to KBD_DATA_PORT) */ #define PSMC_SET_SCALING11 0x00e6 #define PSMC_SET_SCALING21 0x00e7 #define PSMC_SET_RESOLUTION 0x00e8 #define PSMC_SEND_DEV_STATUS 0x00e9 #define PSMC_SET_STREAM_MODE 0x00ea #define PSMC_SEND_DEV_DATA 0x00eb #define PSMC_SET_REMOTE_MODE 0x00f0 #define PSMC_SEND_DEV_ID 0x00f2 #define PSMC_SET_SAMPLING_RATE 0x00f3 #define PSMC_ENABLE_DEV 0x00f4 #define PSMC_DISABLE_DEV 0x00f5 #define PSMC_SET_DEFAULTS 0x00f6 #define PSMC_RESET_DEV 0x00ff /* PSMC_SET_RESOLUTION argument */ #define PSMD_RES_LOW 0 /* typically 25ppi */ #define PSMD_RES_MEDIUM_LOW 1 /* typically 50ppi */ #define PSMD_RES_MEDIUM_HIGH 2 /* typically 100ppi (default) */ #define PSMD_RES_HIGH 3 /* typically 200ppi */ #define PSMD_MAX_RESOLUTION PSMD_RES_HIGH /* PSMC_SET_SAMPLING_RATE */ #define PSMD_MAX_RATE 255 /* FIXME: not sure if it's possible */ /* aux device ID */ #define PSM_MOUSE_ID 0 #define PSM_BALLPOINT_ID 2 #define PSM_INTELLI_ID 3 #define PSM_EXPLORER_ID 4 #define PSM_4DMOUSE_ID 6 #define PSM_4DPLUS_ID 8 static unsigned char ps2_init[] = { PSMC_ENABLE_DEV, 0, }; #define NINIT_PS2 1 static unsigned char wheel_3button_init[] = { PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 100, PSMC_SET_SAMPLING_RATE, 80, PSMC_SEND_DEV_ID, 0, }; #define NINIT_IMPS2 4 static unsigned char wheel_5button_init[] = { PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 100, PSMC_SET_SAMPLING_RATE, 80, PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 80, PSMC_SEND_DEV_ID, 0 }; #define NINIT_EXPS2 7 static unsigned char intelli_init[] = { PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 100, PSMC_SET_SAMPLING_RATE, 80, 0 }; #define NINIT_INTELLI 3 static int ps2SkipInit(KdPointerInfo * pi, int ninit, Bool ret_next) { Kmouse *km = pi->driverPrivate; int c = -1; Bool waiting; waiting = FALSE; while (ninit || ret_next) { c = MouseReadByte(&km->iob, MOUSE_TIMEOUT); if (c == -1) break; /* look for ACK */ if (c == 0xfa) { ninit--; if (ret_next) waiting = TRUE; } /* look for packet start -- not the response */ else if ((c & 0x08) == 0x08) waiting = FALSE; else if (waiting) break; } return c; } static Bool ps2Init(KdPointerInfo * pi) { Kmouse *km = pi->driverPrivate; int id; unsigned char *init; int ninit; /* Send Intellimouse initialization sequence */ MouseWriteBytes(km->iob.fd, intelli_init, strlen((char *) intelli_init), 100); /* * Send ID command */ if (!MouseWriteByte(km->iob.fd, PSMC_SEND_DEV_ID, 100)) return FALSE; id = ps2SkipInit(pi, 0, TRUE); switch (id) { case 3: init = wheel_3button_init; ninit = NINIT_IMPS2; km->prot = &imps2Prot; break; case 4: init = wheel_5button_init; ninit = NINIT_EXPS2; km->prot = &exps2Prot; break; default: init = ps2_init; ninit = NINIT_PS2; km->prot = &ps2Prot; break; } if (init) MouseWriteBytes(km->iob.fd, init, strlen((char *) init), 100); /* * Flush out the available data to eliminate responses to the * initialization string. Make sure any partial event is * skipped */ (void) ps2SkipInit(pi, ninit, FALSE); return TRUE; } static Bool busParse(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; int dx, dy; unsigned long flags; flags = KD_MOUSE_DELTA; dx = (signed char) ev[1]; dy = -(signed char) ev[2]; if ((ev[0] & 4) == 0) flags |= KD_BUTTON_1; if ((ev[0] & 2) == 0) flags |= KD_BUTTON_2; if ((ev[0] & 1) == 0) flags |= KD_BUTTON_3; if (!MouseReasonable(pi, flags, dx, dy)) return FALSE; if (km->stage == MouseWorking) KdEnqueuePointerEvent(pi, flags, dx, dy, 0); return TRUE; } static const KmouseProt busProt = { "bus", threeComplete, mouseValid, busParse, 0, 0xf8, 0x00, 0x00, 0x00, FALSE }; /* * Standard MS serial protocol, three bytes */ static Bool msParse(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; int dx, dy; unsigned long flags; flags = KD_MOUSE_DELTA; if (ev[0] & 0x20) flags |= KD_BUTTON_1; if (ev[0] & 0x10) flags |= KD_BUTTON_3; dx = (signed char) (((ev[0] & 0x03) << 6) | (ev[1] & 0x3F)); dy = (signed char) (((ev[0] & 0x0C) << 4) | (ev[2] & 0x3F)); if (!MouseReasonable(pi, flags, dx, dy)) return FALSE; if (km->stage == MouseWorking) KdEnqueuePointerEvent(pi, flags, dx, dy, 0); return TRUE; } static const KmouseProt msProt = { "ms", threeComplete, mouseValid, msParse, 0, 0xc0, 0x40, 0xc0, 0x00, TRUE, IGNPAR, 0, 0, CS7 | CSTOPB | CREAD | CLOCAL, B1200, }; /* * Logitech mice send 3 or 4 bytes, the only way to tell is to look at the * first byte of a synchronized protocol stream and see if it's got * any bits turned on that can't occur in that fourth byte */ static Bool logiComplete(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; if ((ev[0] & 0x40) == 0x40) return ne == 3; if (km->stage != MouseBroken && (ev[0] & ~0x23) == 0) return ne == 1; return FALSE; } static int logiValid(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; const KmouseProt *prot = km->prot; int i; for (i = 0; i < ne; i++) { if ((ev[i] & 0x40) == 0x40) break; if (km->stage != MouseBroken && (ev[i] & ~0x23) == 0) break; } if (i != 0) return i; for (i = 1; i < ne; i++) if ((ev[i] & prot->dataMask) != prot->dataValid) return -1; return 0; } static Bool logiParse(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; int dx, dy; unsigned long flags; flags = KD_MOUSE_DELTA; if (ne == 3) { if (ev[0] & 0x20) flags |= KD_BUTTON_1; if (ev[0] & 0x10) flags |= KD_BUTTON_3; dx = (signed char) (((ev[0] & 0x03) << 6) | (ev[1] & 0x3F)); dy = (signed char) (((ev[0] & 0x0C) << 4) | (ev[2] & 0x3F)); flags |= km->state & KD_BUTTON_2; } else { if (ev[0] & 0x20) flags |= KD_BUTTON_2; dx = 0; dy = 0; flags |= km->state & (KD_BUTTON_1 | KD_BUTTON_3); } if (!MouseReasonable(pi, flags, dx, dy)) return FALSE; if (km->stage == MouseWorking) KdEnqueuePointerEvent(pi, flags, dx, dy, 0); return TRUE; } static const KmouseProt logiProt = { "logitech", logiComplete, logiValid, logiParse, 0, 0xc0, 0x40, 0xc0, 0x00, TRUE, IGNPAR, 0, 0, CS7 | CSTOPB | CREAD | CLOCAL, B1200, }; /* * Mouse systems protocol, 5 bytes */ static Bool mscParse(KdPointerInfo * pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; int dx, dy; unsigned long flags; flags = KD_MOUSE_DELTA; if (!(ev[0] & 0x4)) flags |= KD_BUTTON_1; if (!(ev[0] & 0x2)) flags |= KD_BUTTON_2; if (!(ev[0] & 0x1)) flags |= KD_BUTTON_3; dx = (signed char) (ev[1]) + (signed char) (ev[3]); dy = -((signed char) (ev[2]) + (signed char) (ev[4])); if (!MouseReasonable(pi, flags, dx, dy)) return FALSE; if (km->stage == MouseWorking) KdEnqueuePointerEvent(pi, flags, dx, dy, 0); return TRUE; } static const KmouseProt mscProt = { "msc", fiveComplete, mouseValid, mscParse, 0, 0xf8, 0x80, 0x00, 0x00, TRUE, IGNPAR, 0, 0, CS8 | CSTOPB | CREAD | CLOCAL, B1200, }; /* * Use logitech before ms -- they're the same except that * logitech sometimes has a fourth byte */ static const KmouseProt *kmouseProts[] = { &ps2Prot, &imps2Prot, &exps2Prot, &busProt, &logiProt, &msProt, &mscProt, }; #define NUM_PROT (sizeof (kmouseProts) / sizeof (kmouseProts[0])) static void MouseInitProtocol(Kmouse * km) { int ret; struct termios t; if (km->prot->tty) { ret = tcgetattr(km->iob.fd, &t); if (ret >= 0) { t.c_iflag = km->prot->c_iflag; t.c_oflag = km->prot->c_oflag; t.c_lflag = km->prot->c_lflag; t.c_cflag = km->prot->c_cflag; cfsetispeed(&t, km->prot->speed); cfsetospeed(&t, km->prot->speed); ret = tcsetattr(km->iob.fd, TCSANOW, &t); } } km->stage = MouseBroken; km->valid = 0; km->tested = 0; km->invalid = 0; km->state = km->prot->state; } static void MouseFirstProtocol(Kmouse * km, const char *prot) { if (prot) { for (km->i_prot = 0; km->i_prot < NUM_PROT; km->i_prot++) if (!strcmp(prot, kmouseProts[km->i_prot]->name)) break; if (km->i_prot == NUM_PROT) { int i; ErrorF("Unknown mouse protocol \"%s\". Pick one of:", prot); for (i = 0; i < NUM_PROT; i++) ErrorF(" %s", kmouseProts[i]->name); ErrorF("\n"); } else { km->prot = kmouseProts[km->i_prot]; if (km->tty && !km->prot->tty) ErrorF ("Mouse device is serial port, protocol %s is not serial protocol\n", prot); else if (!km->tty && km->prot->tty) ErrorF ("Mouse device is not serial port, protocol %s is serial protocol\n", prot); } } if (!km->prot) { for (km->i_prot = 0; kmouseProts[km->i_prot]->tty != km->tty; km->i_prot++); km->prot = kmouseProts[km->i_prot]; } MouseInitProtocol(km); } static void MouseNextProtocol(Kmouse * km) { do { if (!km->prot) km->i_prot = 0; else if (++km->i_prot == NUM_PROT) km->i_prot = 0; km->prot = kmouseProts[km->i_prot]; } while (km->prot->tty != km->tty); MouseInitProtocol(km); ErrorF("Switching to mouse protocol \"%s\"\n", km->prot->name); } static void MouseRead(int mousePort, void *closure) { KdPointerInfo *pi = closure; Kmouse *km = pi->driverPrivate; unsigned char event[MAX_MOUSE]; int ne; int c; int i; int timeout; timeout = 0; ne = 0; for (;;) { c = MouseReadByte(&km->iob, timeout); if (c == -1) { if (ne) { km->invalid += ne + km->tested; km->valid = 0; km->tested = 0; km->stage = MouseBroken; } break; } event[ne++] = c; i = (*km->prot->Valid) (pi, event, ne); if (i != 0) { #ifdef DEBUG ErrorF("Mouse protocol %s broken %d of %d bytes bad\n", km->prot->name, i > 0 ? i : ne, ne); #endif if (i > 0 && i < ne) { ne -= i; memmove(event, event + i, ne); } else { i = ne; ne = 0; } km->invalid += i + km->tested; km->valid = 0; km->tested = 0; if (km->stage == MouseWorking) km->i_prot--; km->stage = MouseBroken; if (km->invalid > MAX_SKIP) { MouseNextProtocol(km); ne = 0; } timeout = 0; } else { if ((*km->prot->Complete) (pi, event, ne)) { if ((*km->prot->Parse) (pi, event, ne)) { switch (km->stage) { case MouseBroken: #ifdef DEBUG ErrorF("Mouse protocol %s seems OK\n", km->prot->name); #endif /* do not zero invalid to accumulate invalid bytes */ km->valid = 0; km->tested = 0; km->stage = MouseTesting; /* fall through ... */ case MouseTesting: km->valid++; km->tested += ne; if (km->valid > MAX_VALID) { #ifdef DEBUG ErrorF("Mouse protocol %s working\n", km->prot->name); #endif km->stage = MouseWorking; km->invalid = 0; km->tested = 0; km->valid = 0; if (km->prot->Init && !(*km->prot->Init) (pi)) km->stage = MouseBroken; } break; case MouseWorking: break; } } else { km->invalid += ne + km->tested; km->valid = 0; km->tested = 0; km->stage = MouseBroken; } ne = 0; timeout = 0; } else timeout = MOUSE_TIMEOUT; } } } int MouseInputType; const char *kdefaultMouse[] = { "/dev/input/mice", "/dev/mouse", "/dev/psaux", "/dev/adbmouse", "/dev/ttyS0", "/dev/ttyS1", }; #define NUM_DEFAULT_MOUSE (sizeof (kdefaultMouse) / sizeof (kdefaultMouse[0])) static Status MouseInit(KdPointerInfo * pi) { int i; int fd; Kmouse *km; if (!pi) return BadImplementation; if (!pi->path || strcmp(pi->path, "auto") == 0) { for (i = 0; i < NUM_DEFAULT_MOUSE; i++) { fd = open(kdefaultMouse[i], 2); if (fd >= 0) { pi->path = strdup(kdefaultMouse[i]); break; } } } else { fd = open(pi->path, 2); } if (fd < 0) return BadMatch; close(fd); km = (Kmouse *) malloc(sizeof(Kmouse)); if (km) { km->iob.avail = km->iob.used = 0; MouseFirstProtocol(km, pi->protocol ? pi->protocol : "exps/2"); /* MouseFirstProtocol sets state to MouseBroken for later protocol * checks. Skip these checks if a protocol was supplied */ if (pi->protocol) km->state = MouseWorking; km->i_prot = 0; km->tty = isatty(fd); km->iob.fd = -1; pi->driverPrivate = km; } else { close(fd); return BadAlloc; } return Success; } static Status MouseEnable(KdPointerInfo * pi) { Kmouse *km; if (!pi || !pi->driverPrivate || !pi->path) return BadImplementation; km = pi->driverPrivate; km->iob.fd = open(pi->path, 2); if (km->iob.fd < 0) return BadMatch; if (!KdRegisterFd(km->iob.fd, MouseRead, pi)) { close(km->iob.fd); return BadAlloc; } return Success; } static void MouseDisable(KdPointerInfo * pi) { Kmouse *km; if (!pi || !pi->driverPrivate) return; km = pi->driverPrivate; KdUnregisterFd(pi, km->iob.fd, TRUE); } static void MouseFini(KdPointerInfo * pi) { free(pi->driverPrivate); pi->driverPrivate = NULL; } KdPointerDriver LinuxMouseDriver = { "mouse", MouseInit, MouseEnable, MouseDisable, MouseFini, NULL, }; xorg-server-1.17.1/hw/kdrive/linux/linux.c0000664000175100017510000002366512366220413015370 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include "kdrive.h" #include #include #include #include #include #include #include #include #ifdef KDRIVE_MOUSE extern KdPointerDriver LinuxMouseDriver; extern KdPointerDriver Ps2MouseDriver; extern KdPointerDriver MsMouseDriver; #endif #ifdef TSLIB extern KdPointerDriver TsDriver; #endif #ifdef KDRIVE_EVDEV extern KdPointerDriver LinuxEvdevMouseDriver; extern KdKeyboardDriver LinuxEvdevKeyboardDriver; #endif #ifdef KDRIVE_KBD extern KdKeyboardDriver LinuxKeyboardDriver; #endif static int vtno; int LinuxConsoleFd; int LinuxApmFd = -1; static int activeVT; static Bool enabled; static void LinuxVTRequest(int sig) { kdSwitchPending = TRUE; } /* Check before chowning -- this avoids touching the file system */ static void LinuxCheckChown(const char *file) { struct stat st; __uid_t u; __gid_t g; int r; if (stat(file, &st) < 0) return; u = getuid(); g = getgid(); if (st.st_uid != u || st.st_gid != g) { r = chown(file, u, g); (void) r; } } static int LinuxInit(void) { int fd = -1; char vtname[11]; struct vt_stat vts; LinuxConsoleFd = -1; /* check if we're run with euid==0 */ if (geteuid() != 0) { FatalError("LinuxInit: Server must be suid root\n"); } if (kdVirtualTerminal >= 0) vtno = kdVirtualTerminal; else { if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { FatalError("LinuxInit: Cannot open /dev/tty0 (%s)\n", strerror(errno)); } if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) { FatalError("xf86OpenConsole: Cannot find a free VT\n"); } close(fd); } snprintf(vtname, sizeof(vtname), "/dev/tty%d", vtno); /* /dev/tty1-64 */ if ((LinuxConsoleFd = open(vtname, O_RDWR | O_NDELAY, 0)) < 0) { FatalError("LinuxInit: Cannot open %s (%s)\n", vtname, strerror(errno)); } /* change ownership of the vt */ LinuxCheckChown(vtname); /* * the current VT device we're running on is not "console", we want * to grab all consoles too * * Why is this needed? */ LinuxCheckChown("/dev/tty0"); /* * Linux doesn't switch to an active vt after the last close of a vt, * so we do this ourselves by remembering which is active now. */ memset(&vts, '\0', sizeof(vts)); /* valgrind */ if (ioctl(LinuxConsoleFd, VT_GETSTATE, &vts) == 0) { activeVT = vts.v_active; } return 1; } static void LinuxSetSwitchMode(int mode) { struct sigaction act; struct vt_mode VT; if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) < 0) { FatalError("LinuxInit: VT_GETMODE failed\n"); } if (mode == VT_PROCESS) { act.sa_handler = LinuxVTRequest; sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(SIGUSR1, &act, 0); VT.mode = mode; VT.relsig = SIGUSR1; VT.acqsig = SIGUSR1; } else { act.sa_handler = SIG_IGN; sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(SIGUSR1, &act, 0); VT.mode = mode; VT.relsig = 0; VT.acqsig = 0; } if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0) { FatalError("LinuxInit: VT_SETMODE failed\n"); } } static void LinuxApmBlock(void *blockData, OSTimePtr pTimeout, void *pReadmask) { } static Bool LinuxApmRunning; static void LinuxApmWakeup(void *blockData, int result, void *pReadmask) { fd_set *readmask = (fd_set *) pReadmask; if (result > 0 && LinuxApmFd >= 0 && FD_ISSET(LinuxApmFd, readmask)) { apm_event_t event; Bool running = LinuxApmRunning; int cmd = APM_IOC_SUSPEND; while (read(LinuxApmFd, &event, sizeof(event)) == sizeof(event)) { switch (event) { case APM_SYS_STANDBY: case APM_USER_STANDBY: running = FALSE; cmd = APM_IOC_STANDBY; break; case APM_SYS_SUSPEND: case APM_USER_SUSPEND: case APM_CRITICAL_SUSPEND: running = FALSE; cmd = APM_IOC_SUSPEND; break; case APM_NORMAL_RESUME: case APM_CRITICAL_RESUME: case APM_STANDBY_RESUME: running = TRUE; break; } } if (running && !LinuxApmRunning) { KdResume(); LinuxApmRunning = TRUE; } else if (!running && LinuxApmRunning) { KdSuspend(); LinuxApmRunning = FALSE; ioctl(LinuxApmFd, cmd, 0); } } } #ifdef FNONBLOCK #define NOBLOCK FNONBLOCK #else #define NOBLOCK FNDELAY #endif static void LinuxEnable(void) { if (enabled) return; if (kdSwitchPending) { kdSwitchPending = FALSE; ioctl(LinuxConsoleFd, VT_RELDISP, VT_ACKACQ); } /* * Open the APM driver */ LinuxApmFd = open("/dev/apm_bios", 2); if (LinuxApmFd < 0 && errno == ENOENT) LinuxApmFd = open("/dev/misc/apm_bios", 2); if (LinuxApmFd >= 0) { LinuxApmRunning = TRUE; fcntl(LinuxApmFd, F_SETFL, fcntl(LinuxApmFd, F_GETFL) | NOBLOCK); RegisterBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); AddEnabledDevice(LinuxApmFd); } /* * now get the VT */ LinuxSetSwitchMode(VT_AUTO); if (ioctl(LinuxConsoleFd, VT_ACTIVATE, vtno) != 0) { FatalError("LinuxInit: VT_ACTIVATE failed\n"); } if (ioctl(LinuxConsoleFd, VT_WAITACTIVE, vtno) != 0) { FatalError("LinuxInit: VT_WAITACTIVE failed\n"); } LinuxSetSwitchMode(VT_PROCESS); if (ioctl(LinuxConsoleFd, KDSETMODE, KD_GRAPHICS) < 0) { FatalError("LinuxInit: KDSETMODE KD_GRAPHICS failed\n"); } enabled = TRUE; } static void LinuxDisable(void) { ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ if (kdSwitchPending) { kdSwitchPending = FALSE; ioctl(LinuxConsoleFd, VT_RELDISP, 1); } enabled = FALSE; if (LinuxApmFd >= 0) { RemoveBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); RemoveEnabledDevice(LinuxApmFd); close(LinuxApmFd); LinuxApmFd = -1; } } static void LinuxFini(void) { struct vt_mode VT; struct vt_stat vts; int fd; if (LinuxConsoleFd < 0) return; if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) != -1) { VT.mode = VT_AUTO; ioctl(LinuxConsoleFd, VT_SETMODE, &VT); /* set dflt vt handling */ } memset(&vts, '\0', sizeof(vts)); /* valgrind */ ioctl(LinuxConsoleFd, VT_GETSTATE, &vts); if (vtno == vts.v_active) { /* * Find a legal VT to switch to, either the one we started from * or the lowest active one that isn't ours */ if (activeVT < 0 || activeVT == vts.v_active || !(vts.v_state & (1 << activeVT))) { for (activeVT = 1; activeVT < 16; activeVT++) if (activeVT != vtno && (vts.v_state & (1 << activeVT))) break; if (activeVT == 16) activeVT = -1; } /* * Perform a switch back to the active VT when we were started */ if (activeVT >= -1) { ioctl(LinuxConsoleFd, VT_ACTIVATE, activeVT); ioctl(LinuxConsoleFd, VT_WAITACTIVE, activeVT); activeVT = -1; } } close(LinuxConsoleFd); /* make the vt-manager happy */ LinuxConsoleFd = -1; fd = open("/dev/tty0", O_RDWR | O_NDELAY, 0); if (fd >= 0) { memset(&vts, '\0', sizeof(vts)); /* valgrind */ ioctl(fd, VT_GETSTATE, &vts); if (ioctl(fd, VT_DISALLOCATE, vtno) < 0) fprintf(stderr, "Can't deallocate console %d %s\n", vtno, strerror(errno)); close(fd); } return; } void KdOsAddInputDrivers(void) { #ifdef KDRIVE_MOUSE KdAddPointerDriver(&LinuxMouseDriver); KdAddPointerDriver(&MsMouseDriver); KdAddPointerDriver(&Ps2MouseDriver); #endif #ifdef TSLIB KdAddPointerDriver(&TsDriver); #endif #ifdef KDRIVE_EVDEV KdAddPointerDriver(&LinuxEvdevMouseDriver); KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); #endif #ifdef KDRIVE_KBD KdAddKeyboardDriver(&LinuxKeyboardDriver); #endif } static void LinuxBell(int volume, int pitch, int duration) { if (volume && pitch) ioctl(LinuxConsoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | (((unsigned long) duration * volume / 50) << 16)); } KdOsFuncs LinuxFuncs = { .Init = LinuxInit, .Enable = LinuxEnable, .Disable = LinuxDisable, .Fini = LinuxFini, .Bell = LinuxBell, }; void OsVendorInit(void) { KdOsInit(&LinuxFuncs); } xorg-server-1.17.1/hw/kdrive/linux/Makefile.in0000664000175100017510000006302012466505431016126 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @KDRIVE_KBD_TRUE@am__append_1 = keyboard.c @KDRIVE_EVDEV_TRUE@am__append_2 = evdev.c @KDRIVE_MOUSE_TRUE@am__append_3 = mouse.c ms.c ps2.c @TSLIB_TRUE@am__append_4 = tslib.c subdir = hw/kdrive/linux DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) liblinux_la_LIBADD = am__liblinux_la_SOURCES_DIST = linux.c keyboard.c evdev.c mouse.c ms.c \ ps2.c tslib.c @KDRIVE_KBD_TRUE@am__objects_1 = keyboard.lo @KDRIVE_EVDEV_TRUE@am__objects_2 = evdev.lo @KDRIVE_MOUSE_TRUE@am__objects_3 = mouse.lo ms.lo ps2.lo @TSLIB_TRUE@am__objects_4 = tslib.lo am_liblinux_la_OBJECTS = linux.lo $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) liblinux_la_OBJECTS = $(am_liblinux_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 = $(liblinux_la_SOURCES) DIST_SOURCES = $(am__liblinux_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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H noinst_LTLIBRARIES = liblinux.la liblinux_la_SOURCES = linux.c $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/kdrive/linux/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/kdrive/linux/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } liblinux.la: $(liblinux_la_OBJECTS) $(liblinux_la_DEPENDENCIES) $(EXTRA_liblinux_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(liblinux_la_OBJECTS) $(liblinux_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mouse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ms.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tslib.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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/kdrive/linux/tslib.c0000664000175100017510000001266412366220413015343 00000000000000/* * TSLIB based touchscreen driver for KDrive * Porting to new input API and event queueing by Daniel Stone. * Derived from ts.c by Keith Packard * Derived from ps2.c by Jim Gettys * * Copyright © 1999 Keith Packard * Copyright © 2000 Compaq Computer Corporation * Copyright © 2002 MontaVista Software Inc. * Copyright © 2005 OpenedHand Ltd. * Copyright © 2006 Nokia Corporation * * 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 authors and/or copyright holders * not be used in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. The authors and/or * 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 AUTHORS AND/OR COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE AUTHORS AND/OR 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. */ #ifdef HAVE_KDRIVE_CONFIG_H #include #endif #include #include #include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" #include #include #include #include struct TslibPrivate { int fd; int lastx, lasty; struct tsdev *tsDev; void (*raw_event_hook) (int x, int y, int pressure, void *closure); void *raw_event_closure; int phys_screen; }; static void TsRead(int fd, void *closure) { KdPointerInfo *pi = closure; struct TslibPrivate *private = pi->driverPrivate; struct ts_sample event; long x = 0, y = 0; unsigned long flags; if (private->raw_event_hook) { while (ts_read_raw(private->tsDev, &event, 1) == 1) private->raw_event_hook(event.x, event.y, event.pressure, private->raw_event_closure); return; } while (ts_read(private->tsDev, &event, 1) == 1) { if (event.pressure) { flags = KD_BUTTON_1; /* * Here we test for the touch screen driver actually being on the * touch screen, if it is we send absolute coordinates. If not, * then we send delta's so that we can track the entire vga screen. */ if (KdCurScreen == private->phys_screen) { x = event.x; y = event.y; } else { flags |= KD_MOUSE_DELTA; if ((private->lastx == 0) || (private->lasty == 0)) { x = event.x; y = event.y; } else { x = event.x - private->lastx; y = event.y - private->lasty; } } private->lastx = event.x; private->lasty = event.y; } else { flags = 0; x = private->lastx; y = private->lasty; } KdEnqueuePointerEvent(pi, flags, x, y, event.pressure); } } static Status TslibEnable(KdPointerInfo * pi) { struct TslibPrivate *private = pi->driverPrivate; private->raw_event_hook = NULL; private->raw_event_closure = NULL; if (!pi->path) { pi->path = strdup("/dev/input/touchscreen0"); ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", pi->path); } private->tsDev = ts_open(pi->path, 0); if (!private->tsDev) { ErrorF("[tslib/TslibEnable] failed to open %s\n", pi->path); return BadAlloc; } if (ts_config(private->tsDev)) { ErrorF("[tslib/TslibEnable] failed to load configuration\n"); ts_close(private->tsDev); private->tsDev = NULL; return BadValue; } private->fd = ts_fd(private->tsDev); KdRegisterFd(private->fd, TsRead, pi); return Success; } static void TslibDisable(KdPointerInfo * pi) { struct TslibPrivate *private = pi->driverPrivate; if (private->fd) KdUnregisterFd(pi, private->fd, TRUE); if (private->tsDev) ts_close(private->tsDev); private->fd = 0; private->tsDev = NULL; } static Status TslibInit(KdPointerInfo * pi) { struct TslibPrivate *private = NULL; if (!pi || !pi->dixdev) return !Success; pi->driverPrivate = (struct TslibPrivate *) calloc(sizeof(struct TslibPrivate), 1); if (!pi->driverPrivate) return !Success; private = pi->driverPrivate; /* hacktastic */ private->phys_screen = 0; pi->nAxes = 3; pi->name = strdup("Touchscreen"); pi->inputClass = KD_TOUCHSCREEN; return Success; } static void TslibFini(KdPointerInfo * pi) { free(pi->driverPrivate); pi->driverPrivate = NULL; } KdPointerDriver TsDriver = { "tslib", TslibInit, TslibEnable, TslibDisable, TslibFini, NULL, }; xorg-server-1.17.1/hw/kdrive/fbdev/0000775000175100017510000000000012466505446014075 500000000000000xorg-server-1.17.1/hw/kdrive/fbdev/Makefile.am0000664000175100017510000000070012200102654016022 00000000000000AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ noinst_LTLIBRARIES = libfbdev.la libfbdev_la_SOURCES = \ fbdev.c \ fbdev.h if KDRIVEFBDEV bin_PROGRAMS = Xfbdev Xfbdev_SOURCES = \ fbinit.c Xfbdev_LDADD = \ libfbdev.la \ @KDRIVE_LIBS@ Xfbdev_DEPENDENCIES = \ libfbdev.la \ $(KDRIVE_PURE_LIBS) Xfbdev_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) relink: $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) endif xorg-server-1.17.1/hw/kdrive/fbdev/fbinit.c0000664000175100017510000000614112366220413015421 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include void InitCard(char *name) { KdCardInfoAdd(&fbdevFuncs, 0); } void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { KdInitOutput(pScreenInfo, argc, argv); } void InitInput(int argc, char **argv) { KdOsAddInputDrivers(); KdInitInput(); } void CloseInput(void) { KdCloseInput(); } void ddxUseMsg(void) { KdUseMsg(); ErrorF("\nXfbdev Device Usage:\n"); ErrorF ("-fb path Framebuffer device to use. Defaults to /dev/fb0\n"); ErrorF("\n"); } int ddxProcessArgument(int argc, char **argv, int i) { if (!strcmp(argv[i], "-fb")) { if (i + 1 < argc) { fbdevDevicePath = argv[i + 1]; return 2; } UseMsg(); exit(1); } return KdProcessArgument(argc, argv, i); } KdCardFuncs fbdevFuncs = { fbdevCardInit, /* cardinit */ fbdevScreenInit, /* scrinit */ fbdevInitScreen, /* initScreen */ fbdevFinishInitScreen, /* finishInitScreen */ fbdevCreateResources, /* createRes */ fbdevPreserve, /* preserve */ fbdevEnable, /* enable */ fbdevDPMS, /* dpms */ fbdevDisable, /* disable */ fbdevRestore, /* restore */ fbdevScreenFini, /* scrfini */ fbdevCardFini, /* cardfini */ 0, /* initCursor */ 0, /* enableCursor */ 0, /* disableCursor */ 0, /* finiCursor */ 0, /* recolorCursor */ 0, /* initAccel */ 0, /* enableAccel */ 0, /* disableAccel */ 0, /* finiAccel */ fbdevGetColors, /* getColors */ fbdevPutColors, /* putColors */ }; xorg-server-1.17.1/hw/kdrive/fbdev/fbdev.h0000664000175100017510000000465312274325511015252 00000000000000/* * Copyright © 1999 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. */ #ifndef _FBDEV_H_ #define _FBDEV_H_ #include #include #include #include #include "kdrive.h" #ifdef RANDR #include "randrstr.h" #endif typedef struct _fbdevPriv { struct fb_var_screeninfo var; struct fb_fix_screeninfo fix; __u16 red[256]; __u16 green[256]; __u16 blue[256]; int fd; char *fb; char *fb_base; } FbdevPriv; typedef struct _fbdevScrPriv { Rotation randr; Bool shadow; } FbdevScrPriv; extern KdCardFuncs fbdevFuncs; extern const char *fbdevDevicePath; Bool fbdevCardInit(KdCardInfo * card); Bool fbdevScreenInit(KdScreenInfo * screen); Bool fbdevInitScreen(ScreenPtr pScreen); Bool fbdevFinishInitScreen(ScreenPtr pScreen); Bool fbdevCreateResources(ScreenPtr pScreen); void fbdevPreserve(KdCardInfo * card); Bool fbdevEnable(ScreenPtr pScreen); Bool fbdevDPMS(ScreenPtr pScreen, int mode); void fbdevDisable(ScreenPtr pScreen); void fbdevRestore(KdCardInfo * card); void fbdevScreenFini(KdScreenInfo * screen); void fbdevCardFini(KdCardInfo * card); void fbdevGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs); void fbdevPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs); Bool fbdevMapFramebuffer(KdScreenInfo * screen); #endif /* _FBDEV_H_ */ xorg-server-1.17.1/hw/kdrive/fbdev/fbdev.c0000664000175100017510000005716212366220413015245 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include "fbdev.h" #include #include extern int KdTsPhyScreen; const char *fbdevDevicePath = NULL; static Bool fbdevInitialize(KdCardInfo * card, FbdevPriv * priv) { unsigned long off; if (fbdevDevicePath == NULL) fbdevDevicePath = "/dev/fb0"; if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0) { ErrorF("Error opening framebuffer %s: %s\n", fbdevDevicePath, strerror(errno)); return FALSE; } /* quiet valgrind */ memset(&priv->fix, '\0', sizeof(priv->fix)); if (ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix) < 0) { perror("Error with /dev/fb ioctl FIOGET_FSCREENINFO"); close(priv->fd); return FALSE; } /* quiet valgrind */ memset(&priv->var, '\0', sizeof(priv->var)); if (ioctl(priv->fd, FBIOGET_VSCREENINFO, &priv->var) < 0) { perror("Error with /dev/fb ioctl FIOGET_VSCREENINFO"); close(priv->fd); return FALSE; } priv->fb_base = (char *) mmap((caddr_t) NULL, priv->fix.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, priv->fd, 0); if (priv->fb_base == (char *) -1) { perror("ERROR: mmap framebuffer fails!"); close(priv->fd); return FALSE; } off = (unsigned long) priv->fix.smem_start % (unsigned long) getpagesize(); priv->fb = priv->fb_base + off; return TRUE; } Bool fbdevCardInit(KdCardInfo * card) { FbdevPriv *priv; priv = (FbdevPriv *) malloc(sizeof(FbdevPriv)); if (!priv) return FALSE; if (!fbdevInitialize(card, priv)) { free(priv); return FALSE; } card->driver = priv; return TRUE; } static Pixel fbdevMakeContig(Pixel orig, Pixel others) { Pixel low; low = lowbit(orig) >> 1; while (low && (others & low) == 0) { orig |= low; low >>= 1; } return orig; } static Bool fbdevModeSupported(KdScreenInfo * screen, const KdMonitorTiming * t) { return TRUE; } static void fbdevConvertMonitorTiming(const KdMonitorTiming * t, struct fb_var_screeninfo *var) { memset(var, 0, sizeof(struct fb_var_screeninfo)); var->xres = t->horizontal; var->yres = t->vertical; var->xres_virtual = t->horizontal; var->yres_virtual = t->vertical; var->xoffset = 0; var->yoffset = 0; var->pixclock = t->clock ? 1000000000 / t->clock : 0; var->left_margin = t->hbp; var->right_margin = t->hfp; var->upper_margin = t->vbp; var->lower_margin = t->vfp; var->hsync_len = t->hblank - t->hfp - t->hbp; var->vsync_len = t->vblank - t->vfp - t->vbp; var->sync = 0; var->vmode = 0; if (t->hpol == KdSyncPositive) var->sync |= FB_SYNC_HOR_HIGH_ACT; if (t->vpol == KdSyncPositive) var->sync |= FB_SYNC_VERT_HIGH_ACT; } static Bool fbdevScreenInitialize(KdScreenInfo * screen, FbdevScrPriv * scrpriv) { FbdevPriv *priv = screen->card->driver; Pixel allbits; int depth; Bool gray; struct fb_var_screeninfo var; const KdMonitorTiming *t; int k; k = ioctl(priv->fd, FBIOGET_VSCREENINFO, &var); if (!screen->width || !screen->height) { if (k >= 0) { screen->width = var.xres; screen->height = var.yres; } else { screen->width = 1024; screen->height = 768; } screen->rate = 103; /* FIXME: should get proper value from fb driver */ } if (!screen->fb.depth) { if (k >= 0) screen->fb.depth = var.bits_per_pixel; else screen->fb.depth = 16; } if ((screen->width != var.xres) || (screen->height != var.yres)) { t = KdFindMode(screen, fbdevModeSupported); screen->rate = t->rate; screen->width = t->horizontal; screen->height = t->vertical; /* Now try setting the mode */ if (k < 0 || (t->horizontal != var.xres || t->vertical != var.yres)) fbdevConvertMonitorTiming(t, &var); } var.activate = FB_ACTIVATE_NOW; var.bits_per_pixel = screen->fb.depth; var.nonstd = 0; var.grayscale = 0; k = ioctl(priv->fd, FBIOPUT_VSCREENINFO, &var); if (k < 0) { fprintf(stderr, "error: %s\n", strerror(errno)); return FALSE; } /* Re-get the "fixed" parameters since they might have changed */ k = ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix); if (k < 0) perror("FBIOGET_FSCREENINFO"); /* Now get the new screeninfo */ ioctl(priv->fd, FBIOGET_VSCREENINFO, &priv->var); depth = priv->var.bits_per_pixel; gray = priv->var.grayscale; /* Calculate fix.line_length if it's zero */ if (!priv->fix.line_length) priv->fix.line_length = (priv->var.xres_virtual * depth + 7) / 8; switch (priv->fix.visual) { case FB_VISUAL_MONO01: case FB_VISUAL_MONO10: screen->fb.visuals = (1 << StaticGray); break; case FB_VISUAL_PSEUDOCOLOR: screen->fb.visuals = (1 << StaticGray); if (priv->var.bits_per_pixel == 1) { /* Override to monochrome, to have preallocated black/white */ priv->fix.visual = FB_VISUAL_MONO01; } else if (gray) { /* could also support GrayScale, but what's the point? */ } else { screen->fb.visuals = ((1 << StaticGray) | (1 << GrayScale) | (1 << StaticColor) | (1 << PseudoColor) | (1 << TrueColor) | (1 << DirectColor)); } screen->fb.blueMask = 0x00; screen->fb.greenMask = 0x00; screen->fb.redMask = 0x00; break; case FB_VISUAL_STATIC_PSEUDOCOLOR: if (gray) { screen->fb.visuals = (1 << StaticGray); } else { screen->fb.visuals = (1 << StaticColor); } screen->fb.blueMask = 0x00; screen->fb.greenMask = 0x00; screen->fb.redMask = 0x00; break; case FB_VISUAL_TRUECOLOR: case FB_VISUAL_DIRECTCOLOR: screen->fb.visuals = (1 << TrueColor); #define Mask(o,l) (((1 << l) - 1) << o) screen->fb.redMask = Mask (priv->var.red.offset, priv->var.red.length); screen->fb.greenMask = Mask (priv->var.green.offset, priv->var.green.length); screen->fb.blueMask = Mask (priv->var.blue.offset, priv->var.blue.length); /* * This is a kludge so that Render will work -- fill in the gaps * in the pixel */ screen->fb.redMask = fbdevMakeContig(screen->fb.redMask, screen->fb.greenMask | screen->fb.blueMask); screen->fb.greenMask = fbdevMakeContig(screen->fb.greenMask, screen->fb.redMask | screen->fb.blueMask); screen->fb.blueMask = fbdevMakeContig(screen->fb.blueMask, screen->fb.redMask | screen->fb.greenMask); allbits = screen->fb.redMask | screen->fb.greenMask | screen->fb.blueMask; depth = 32; while (depth && !(allbits & (1 << (depth - 1)))) depth--; break; default: return FALSE; break; } screen->fb.depth = depth; screen->fb.bitsPerPixel = priv->var.bits_per_pixel; scrpriv->randr = screen->randr; return fbdevMapFramebuffer(screen); } Bool fbdevScreenInit(KdScreenInfo * screen) { FbdevScrPriv *scrpriv; scrpriv = calloc(1, sizeof(FbdevScrPriv)); if (!scrpriv) return FALSE; screen->driver = scrpriv; if (!fbdevScreenInitialize(screen, scrpriv)) { screen->driver = 0; free(scrpriv); return FALSE; } return TRUE; } static void * fbdevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) { KdScreenPriv(pScreen); FbdevPriv *priv = pScreenPriv->card->driver; if (!pScreenPriv->enabled) return 0; *size = priv->fix.line_length; return (CARD8 *) priv->fb + row * priv->fix.line_length + offset; } static void * fbdevWindowAfb(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) { KdScreenPriv(pScreen); FbdevPriv *priv = pScreenPriv->card->driver; if (!pScreenPriv->enabled) return 0; /* offset to next plane */ *size = priv->var.yres_virtual * priv->fix.line_length; return (CARD8 *) priv->fb + row * priv->fix.line_length + offset; } Bool fbdevMapFramebuffer(KdScreenInfo * screen) { FbdevScrPriv *scrpriv = screen->driver; KdPointerMatrix m; FbdevPriv *priv = screen->card->driver; if (scrpriv->randr != RR_Rotate_0 || priv->fix.type != FB_TYPE_PACKED_PIXELS) scrpriv->shadow = TRUE; else scrpriv->shadow = FALSE; KdComputePointerMatrix(&m, scrpriv->randr, screen->width, screen->height); KdSetPointerMatrix(&m); screen->width = priv->var.xres; screen->height = priv->var.yres; if (scrpriv->shadow) { if (!KdShadowFbAlloc(screen, scrpriv->randr & (RR_Rotate_90 | RR_Rotate_270))) return FALSE; } else { screen->fb.byteStride = priv->fix.line_length; screen->fb.pixelStride = (priv->fix.line_length * 8 / priv->var.bits_per_pixel); screen->fb.frameBuffer = (CARD8 *) (priv->fb); } return TRUE; } static void fbdevSetScreenSizes(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FbdevScrPriv *scrpriv = screen->driver; FbdevPriv *priv = screen->card->driver; if (scrpriv->randr & (RR_Rotate_0 | RR_Rotate_180)) { pScreen->width = priv->var.xres; pScreen->height = priv->var.yres; pScreen->mmWidth = screen->width_mm; pScreen->mmHeight = screen->height_mm; } else { pScreen->width = priv->var.yres; pScreen->height = priv->var.xres; pScreen->mmWidth = screen->height_mm; pScreen->mmHeight = screen->width_mm; } } static Bool fbdevUnmapFramebuffer(KdScreenInfo * screen) { KdShadowFbFree(screen); return TRUE; } static Bool fbdevSetShadow(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FbdevScrPriv *scrpriv = screen->driver; FbdevPriv *priv = screen->card->driver; ShadowUpdateProc update; ShadowWindowProc window; int useYX = 0; #ifdef __arm__ /* Use variant copy routines that always read left to right in the shadow framebuffer. Reading vertical strips is exceptionally slow on XScale due to cache effects. */ useYX = 1; #endif window = fbdevWindowLinear; update = 0; switch (priv->fix.type) { case FB_TYPE_PACKED_PIXELS: if (scrpriv->randr) if (priv->var.bits_per_pixel == 16) { switch (scrpriv->randr) { case RR_Rotate_90: if (useYX) update = shadowUpdateRotate16_90YX; else update = shadowUpdateRotate16_90; break; case RR_Rotate_180: update = shadowUpdateRotate16_180; break; case RR_Rotate_270: if (useYX) update = shadowUpdateRotate16_270YX; else update = shadowUpdateRotate16_270; break; default: update = shadowUpdateRotate16; break; } } else update = shadowUpdateRotatePacked; else update = shadowUpdatePacked; break; case FB_TYPE_PLANES: window = fbdevWindowAfb; switch (priv->var.bits_per_pixel) { case 4: update = shadowUpdateAfb4; break; case 8: update = shadowUpdateAfb8; break; default: FatalError("Bitplanes with bpp %u are not yet supported\n", priv->var.bits_per_pixel); } break; case FB_TYPE_INTERLEAVED_PLANES: if (priv->fix.type_aux == 2) { switch (priv->var.bits_per_pixel) { case 4: update = shadowUpdateIplan2p4; break; case 8: update = shadowUpdateIplan2p8; break; default: FatalError("Atari interleaved bitplanes with bpp %u are not yet supported\n", priv->var.bits_per_pixel); } } else { FatalError("Interleaved bitplanes with interleave %u are not yet supported\n", priv->fix.type_aux); } break; case FB_TYPE_TEXT: FatalError("Text frame buffers are not yet supported\n"); break; case FB_TYPE_VGA_PLANES: FatalError("VGA planes are not yet supported\n"); break; default: FatalError("Unsupported frame buffer type %u\n", priv->fix.type); break; } return KdShadowSet(pScreen, scrpriv->randr, update, window); } #ifdef RANDR static Bool fbdevRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FbdevScrPriv *scrpriv = screen->driver; RRScreenSizePtr pSize; Rotation randr; int n; *rotations = RR_Rotate_All | RR_Reflect_All; for (n = 0; n < pScreen->numDepths; n++) if (pScreen->allowedDepths[n].numVids) break; if (n == pScreen->numDepths) return FALSE; pSize = RRRegisterSize(pScreen, screen->width, screen->height, screen->width_mm, screen->height_mm); randr = KdSubRotation(scrpriv->randr, screen->randr); RRSetCurrentConfig(pScreen, randr, 0, pSize); return TRUE; } static Bool fbdevRandRSetConfig(ScreenPtr pScreen, Rotation randr, int rate, RRScreenSizePtr pSize) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; FbdevScrPriv *scrpriv = screen->driver; Bool wasEnabled = pScreenPriv->enabled; FbdevScrPriv oldscr; int oldwidth; int oldheight; int oldmmwidth; int oldmmheight; int newwidth, newheight, newmmwidth, newmmheight; if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) { newwidth = pSize->width; newheight = pSize->height; newmmwidth = pSize->mmWidth; newmmheight = pSize->mmHeight; } else { newwidth = pSize->height; newheight = pSize->width; newmmwidth = pSize->mmHeight; newmmheight = pSize->mmWidth; } if (wasEnabled) KdDisableScreen(pScreen); oldscr = *scrpriv; oldwidth = screen->width; oldheight = screen->height; oldmmwidth = pScreen->mmWidth; oldmmheight = pScreen->mmHeight; /* * Set new configuration */ scrpriv->randr = KdAddRotation(screen->randr, randr); pScreen->width = newwidth; pScreen->height = newheight; pScreen->mmWidth = newmmwidth; pScreen->mmHeight = newmmheight; fbdevUnmapFramebuffer(screen); if (!fbdevMapFramebuffer(screen)) goto bail4; KdShadowUnset(screen->pScreen); if (!fbdevSetShadow(screen->pScreen)) goto bail4; fbdevSetScreenSizes(screen->pScreen); /* * Set frame buffer mapping */ (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen), pScreen->width, pScreen->height, screen->fb.depth, screen->fb.bitsPerPixel, screen->fb.byteStride, screen->fb.frameBuffer); /* set the subpixel order */ KdSetSubpixelOrder(pScreen, scrpriv->randr); if (wasEnabled) KdEnableScreen(pScreen); return TRUE; bail4: fbdevUnmapFramebuffer(screen); *scrpriv = oldscr; (void) fbdevMapFramebuffer(screen); pScreen->width = oldwidth; pScreen->height = oldheight; pScreen->mmWidth = oldmmwidth; pScreen->mmHeight = oldmmheight; if (wasEnabled) KdEnableScreen(pScreen); return FALSE; } static Bool fbdevRandRInit(ScreenPtr pScreen) { rrScrPrivPtr pScrPriv; if (!RRScreenInit(pScreen)) return FALSE; pScrPriv = rrGetScrPriv(pScreen); pScrPriv->rrGetInfo = fbdevRandRGetInfo; pScrPriv->rrSetConfig = fbdevRandRSetConfig; return TRUE; } #endif static Bool fbdevCreateColormap(ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; KdScreenPriv(pScreen); FbdevPriv *priv = pScreenPriv->card->driver; VisualPtr pVisual; int i; int nent; xColorItem *pdefs; switch (priv->fix.visual) { case FB_VISUAL_MONO01: pScreen->whitePixel = 0; pScreen->blackPixel = 1; pmap->red[0].co.local.red = 65535; pmap->red[0].co.local.green = 65535; pmap->red[0].co.local.blue = 65535; pmap->red[1].co.local.red = 0; pmap->red[1].co.local.green = 0; pmap->red[1].co.local.blue = 0; return TRUE; case FB_VISUAL_MONO10: pScreen->blackPixel = 0; pScreen->whitePixel = 1; pmap->red[0].co.local.red = 0; pmap->red[0].co.local.green = 0; pmap->red[0].co.local.blue = 0; pmap->red[1].co.local.red = 65535; pmap->red[1].co.local.green = 65535; pmap->red[1].co.local.blue = 65535; return TRUE; case FB_VISUAL_STATIC_PSEUDOCOLOR: pVisual = pmap->pVisual; nent = pVisual->ColormapEntries; pdefs = malloc(nent * sizeof(xColorItem)); if (!pdefs) return FALSE; for (i = 0; i < nent; i++) pdefs[i].pixel = i; fbdevGetColors(pScreen, nent, pdefs); for (i = 0; i < nent; i++) { pmap->red[i].co.local.red = pdefs[i].red; pmap->red[i].co.local.green = pdefs[i].green; pmap->red[i].co.local.blue = pdefs[i].blue; } free(pdefs); return TRUE; default: return fbInitializeColormap(pmap); } } Bool fbdevInitScreen(ScreenPtr pScreen) { #ifdef TOUCHSCREEN KdTsPhyScreen = pScreen->myNum; #endif pScreen->CreateColormap = fbdevCreateColormap; return TRUE; } Bool fbdevFinishInitScreen(ScreenPtr pScreen) { if (!shadowSetup(pScreen)) return FALSE; #ifdef RANDR if (!fbdevRandRInit(pScreen)) return FALSE; #endif return TRUE; } Bool fbdevCreateResources(ScreenPtr pScreen) { return fbdevSetShadow(pScreen); } void fbdevPreserve(KdCardInfo * card) { } static int fbdevUpdateFbColormap(FbdevPriv * priv, int minidx, int maxidx) { struct fb_cmap cmap; cmap.start = minidx; cmap.len = maxidx - minidx + 1; cmap.red = &priv->red[minidx]; cmap.green = &priv->green[minidx]; cmap.blue = &priv->blue[minidx]; cmap.transp = 0; return ioctl(priv->fd, FBIOPUTCMAP, &cmap); } Bool fbdevEnable(ScreenPtr pScreen) { KdScreenPriv(pScreen); FbdevPriv *priv = pScreenPriv->card->driver; int k; priv->var.activate = FB_ACTIVATE_NOW | FB_CHANGE_CMAP_VBL; /* display it on the LCD */ k = ioctl(priv->fd, FBIOPUT_VSCREENINFO, &priv->var); if (k < 0) { perror("FBIOPUT_VSCREENINFO"); return FALSE; } if (priv->fix.visual == FB_VISUAL_DIRECTCOLOR) { int i; for (i = 0; i < (1 << priv->var.red.length) || i < (1 << priv->var.green.length) || i < (1 << priv->var.blue.length); i++) { priv->red[i] = i * 65535 / ((1 << priv->var.red.length) - 1); priv->green[i] = i * 65535 / ((1 << priv->var.green.length) - 1); priv->blue[i] = i * 65535 / ((1 << priv->var.blue.length) - 1); } fbdevUpdateFbColormap(priv, 0, i); } return TRUE; } Bool fbdevDPMS(ScreenPtr pScreen, int mode) { KdScreenPriv(pScreen); FbdevPriv *priv = pScreenPriv->card->driver; static int oldmode = -1; if (mode == oldmode) return TRUE; #ifdef FBIOPUT_POWERMODE if (ioctl(priv->fd, FBIOPUT_POWERMODE, &mode) >= 0) { oldmode = mode; return TRUE; } #endif #ifdef FBIOBLANK if (ioctl(priv->fd, FBIOBLANK, mode ? mode + 1 : 0) >= 0) { oldmode = mode; return TRUE; } #endif return FALSE; } void fbdevDisable(ScreenPtr pScreen) { } void fbdevRestore(KdCardInfo * card) { } void fbdevScreenFini(KdScreenInfo * screen) { } void fbdevCardFini(KdCardInfo * card) { FbdevPriv *priv = card->driver; munmap(priv->fb_base, priv->fix.smem_len); close(priv->fd); free(priv); } /* * Retrieve actual colormap and return selected n entries in pdefs. */ void fbdevGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs) { KdScreenPriv(pScreen); FbdevPriv *priv = pScreenPriv->card->driver; struct fb_cmap cmap; int p; int k; int min, max; min = 256; max = 0; for (k = 0; k < n; k++) { if (pdefs[k].pixel < min) min = pdefs[k].pixel; if (pdefs[k].pixel > max) max = pdefs[k].pixel; } cmap.start = min; cmap.len = max - min + 1; cmap.red = &priv->red[min]; cmap.green = &priv->green[min]; cmap.blue = &priv->blue[min]; cmap.transp = 0; k = ioctl(priv->fd, FBIOGETCMAP, &cmap); if (k < 0) { perror("can't get colormap"); return; } while (n--) { p = pdefs->pixel; pdefs->red = priv->red[p]; pdefs->green = priv->green[p]; pdefs->blue = priv->blue[p]; pdefs++; } } /* * Change colormap by updating n entries described in pdefs. */ void fbdevPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs) { KdScreenPriv(pScreen); FbdevPriv *priv = pScreenPriv->card->driver; int p; int min, max; min = 256; max = 0; while (n--) { p = pdefs->pixel; priv->red[p] = pdefs->red; priv->green[p] = pdefs->green; priv->blue[p] = pdefs->blue; if (p < min) min = p; if (p > max) max = p; pdefs++; } fbdevUpdateFbColormap(priv, min, max); } xorg-server-1.17.1/hw/kdrive/fbdev/Makefile.in0000664000175100017510000006743412466505431016072 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ @KDRIVEFBDEV_TRUE@bin_PROGRAMS = Xfbdev$(EXEEXT) subdir = hw/kdrive/fbdev DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libfbdev_la_LIBADD = am_libfbdev_la_OBJECTS = fbdev.lo libfbdev_la_OBJECTS = $(am_libfbdev_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__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__Xfbdev_SOURCES_DIST = fbinit.c @KDRIVEFBDEV_TRUE@am_Xfbdev_OBJECTS = fbinit.$(OBJEXT) Xfbdev_OBJECTS = $(am_Xfbdev_OBJECTS) Xfbdev_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(Xfbdev_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 = $(libfbdev_la_SOURCES) $(Xfbdev_SOURCES) DIST_SOURCES = $(libfbdev_la_SOURCES) $(am__Xfbdev_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ noinst_LTLIBRARIES = libfbdev.la libfbdev_la_SOURCES = \ fbdev.c \ fbdev.h @KDRIVEFBDEV_TRUE@Xfbdev_SOURCES = \ @KDRIVEFBDEV_TRUE@ fbinit.c @KDRIVEFBDEV_TRUE@Xfbdev_LDADD = \ @KDRIVEFBDEV_TRUE@ libfbdev.la \ @KDRIVEFBDEV_TRUE@ @KDRIVE_LIBS@ @KDRIVEFBDEV_TRUE@Xfbdev_DEPENDENCIES = \ @KDRIVEFBDEV_TRUE@ libfbdev.la \ @KDRIVEFBDEV_TRUE@ $(KDRIVE_PURE_LIBS) @KDRIVEFBDEV_TRUE@Xfbdev_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/kdrive/fbdev/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/kdrive/fbdev/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libfbdev.la: $(libfbdev_la_OBJECTS) $(libfbdev_la_DEPENDENCIES) $(EXTRA_libfbdev_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libfbdev_la_OBJECTS) $(libfbdev_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list Xfbdev$(EXEEXT): $(Xfbdev_OBJECTS) $(Xfbdev_DEPENDENCIES) $(EXTRA_Xfbdev_DEPENDENCIES) @rm -f Xfbdev$(EXEEXT) $(AM_V_CCLD)$(Xfbdev_LINK) $(Xfbdev_OBJECTS) $(Xfbdev_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbinit.Po@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 -o $@ $< .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 -o $@ `$(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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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) $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS 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-binPROGRAMS 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-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS 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 tags-am uninstall uninstall-am uninstall-binPROGRAMS @KDRIVEFBDEV_TRUE@relink: @KDRIVEFBDEV_TRUE@ $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) # 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: xorg-server-1.17.1/hw/kdrive/ephyr/0000775000175100017510000000000012466505446014136 500000000000000xorg-server-1.17.1/hw/kdrive/ephyr/Makefile.am0000664000175100017510000000444312406661137016111 00000000000000# Copyright © 2013 Intel Corporation # # 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. SUBDIRS = man AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ \ @XEPHYR_INCS@ \ @XEPHYR_CFLAGS@ \ -I$(top_srcdir) \ -I$(top_srcdir)/glamor \ -I$(top_srcdir)/exa if XV XV_SRCS = ephyrvideo.c endif if GLAMOR if XV GLAMOR_XV_SRCS = ephyr_glamor_xv.c endif GLAMOR_SRCS = \ ephyr_glamor_glx.c \ ephyr_glamor_glx.h \ $(GLAMOR_XV_SRCS) \ $() endif if DRI DRI_SRCS = \ ephyrdriext.c \ ephyrdriext.h \ ephyrdri.c \ ephyrdri.h \ ephyrglxext.c \ ephyrglxext.h \ ephyrhostglx.c \ ephyrhostglx.h \ $() endif bin_PROGRAMS = Xephyr Xephyr_SOURCES = \ ephyr.c \ ephyr.h \ ephyrlog.h \ ephyr_draw.c \ os.c \ ephyrinit.c \ ephyrcursor.c \ hostx.c \ hostx.h \ $(XV_SRCS) \ $(DRI_SRCS) \ $(GLAMOR_SRCS) \ $() if GLAMOR AM_CPPFLAGS += $(XLIB_CFLAGS) XEPHYR_GLAMOR_LIB = \ $(top_builddir)/glamor/libglamor.la \ $(top_builddir)/glamor/libglamor_egl_stubs.la \ $() endif Xephyr_LDADD = \ $(top_builddir)/exa/libexa.la \ $(XEPHYR_GLAMOR_LIB) \ @KDRIVE_LIBS@ \ @XEPHYR_LIBS@ Xephyr_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@ $(XEPHYR_GLAMOR_LIB) Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) relink: $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) xorg-server-1.17.1/hw/kdrive/ephyr/README0000664000175100017510000000402412160102336014714 00000000000000Xephyr README ============= What Is It ? ============ Xephyr is a a kdrive server that outputs to a window on a pre-existing 'host' X display. Think Xnest but with support for modern extensions like composite, damage and randr. Unlike Xnest which is an X proxy, i.e. limited to the capabilities of the host X server, Xephyr is a real X server which uses the host X server window as "framebuffer" via fast SHM XImages. It also has support for 'visually' debugging what the server is painting. How To Use ========== You probably want to run like; Xephyr :1 -ac -screen 800x600 & Then set DISPLAY=:1 and run whatever X apps you like. Use 'xrandr' to change to orientation/size. There is a '-parent' switch which works just like Xnests ( for use with things like matchbox-nest - http://matchbox.handhelds.org ). There is also a '-host-cursor' switch to set 'cursor acceleration' - The host's cursor is reused. This is only really there to aid debugging by avoiding server paints for the cursor. Performance improvement is negiable. Send a SIGUSR1 to the server ( eg kill -USR1 `pidof Xephyr` ) to toggle the debugging mode. In this mode red rectangles are painted to screen areas getting painted before painting the actual content. The delay between this can be altered by setting a XEPHYR_PAUSE env var to a value in micro seconds. Caveats ======= - Depth is limited to being the same as the host. *Update* As of 8/11/2004. Xephyr can now do 8bpp & 16bpp on 24bpp host. - Rotated displays are currently updated via full blits. This is slower than a normal oprientated display. Debug mode will therefor not be of much use rotated. - The '-host-cursor' cursor is static in its appearence. - The build gets a warning about 'nanosleep'. I think the various '-D' build flags are causing this. I havn't figured as yet how to work round it. It doesn't appear to break anything however. - Keyboard handling is basic but works. - Mouse button 5 probably wont work. Matthew Allum 2004 xorg-server-1.17.1/hw/kdrive/ephyr/ephyr_glamor_glx.c0000664000175100017510000002440312416430610017550 00000000000000/* * Copyright © 2013 Intel Corporation * * 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. */ /** @file ephyr_glamor_glx.c * * Separate file for hiding Xlib and GLX-using parts of xephyr from * the rest of the server-struct-aware build. */ #include #include #include #undef Xcalloc #undef Xrealloc #undef Xfree #include #include #include #include #include "ephyr_glamor_glx.h" #include "os.h" #include /** @{ * * global state for Xephyr with glamor. * * Xephyr can render with multiple windows, but all the windows have * to be on the same X connection and all have to have the same * visual. */ static Display *dpy; static XVisualInfo *visual_info; static GLXFBConfig fb_config; Bool ephyr_glamor_gles2; /** @} */ /** * Per-screen state for Xephyr with glamor. */ struct ephyr_glamor { GLXContext ctx; Window win; GLXWindow glx_win; GLuint tex; GLuint texture_shader; GLuint texture_shader_position_loc; GLuint texture_shader_texcoord_loc; /* Size of the window that we're rendering to. */ unsigned width, height; }; static GLint ephyr_glamor_compile_glsl_prog(GLenum type, const char *source) { GLint ok; GLint prog; prog = glCreateShader(type); glShaderSource(prog, 1, (const GLchar **) &source, NULL); glCompileShader(prog); glGetShaderiv(prog, GL_COMPILE_STATUS, &ok); if (!ok) { GLchar *info; GLint size; glGetShaderiv(prog, GL_INFO_LOG_LENGTH, &size); info = malloc(size); if (info) { glGetShaderInfoLog(prog, size, NULL, info); ErrorF("Failed to compile %s: %s\n", type == GL_FRAGMENT_SHADER ? "FS" : "VS", info); ErrorF("Program source:\n%s", source); free(info); } else ErrorF("Failed to get shader compilation info.\n"); FatalError("GLSL compile failure\n"); } return prog; } static GLuint ephyr_glamor_build_glsl_prog(GLuint vs, GLuint fs) { GLint ok; GLuint prog; prog = glCreateProgram(); glAttachShader(prog, vs); glAttachShader(prog, fs); glLinkProgram(prog); glGetProgramiv(prog, GL_LINK_STATUS, &ok); if (!ok) { GLchar *info; GLint size; glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &size); info = malloc(size); glGetProgramInfoLog(prog, size, NULL, info); ErrorF("Failed to link: %s\n", info); FatalError("GLSL link failure\n"); } return prog; } static void ephyr_glamor_setup_texturing_shader(struct ephyr_glamor *glamor) { const char *vs_source = "attribute vec2 texcoord;\n" "attribute vec2 position;\n" "varying vec2 t;\n" "\n" "void main()\n" "{\n" " t = texcoord;\n" " gl_Position = vec4(position, 0, 1);\n" "}\n"; const char *fs_source = "#ifdef GL_ES\n" "precision mediump float;\n" "#endif\n" "\n" "varying vec2 t;\n" "uniform sampler2D s; /* initially 0 */\n" "\n" "void main()\n" "{\n" " gl_FragColor = texture2D(s, t);\n" "}\n"; GLuint fs, vs, prog; vs = ephyr_glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source); fs = ephyr_glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, fs_source); prog = ephyr_glamor_build_glsl_prog(vs, fs); glamor->texture_shader = prog; glamor->texture_shader_position_loc = glGetAttribLocation(prog, "position"); assert(glamor->texture_shader_position_loc != -1); glamor->texture_shader_texcoord_loc = glGetAttribLocation(prog, "texcoord"); assert(glamor->texture_shader_texcoord_loc != -1); } xcb_connection_t * ephyr_glamor_connect(void) { dpy = XOpenDisplay(NULL); if (!dpy) return NULL; XSetEventQueueOwner(dpy, XCBOwnsEventQueue); return XGetXCBConnection(dpy); } void ephyr_glamor_set_texture(struct ephyr_glamor *glamor, uint32_t tex) { glamor->tex = tex; } void ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, struct pixman_region16 *damage) { /* Redraw the whole screen, since glXSwapBuffers leaves the back * buffer undefined. */ static const float position[] = { -1, -1, 1, -1, 1, 1, -1, 1, }; static const float texcoords[] = { 0, 1, 1, 1, 1, 0, 0, 0, }; glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx); glBindFramebuffer(GL_FRAMEBUFFER, 0); glUseProgram(glamor->texture_shader); glViewport(0, 0, glamor->width, glamor->height); glVertexAttribPointer(glamor->texture_shader_position_loc, 2, GL_FLOAT, FALSE, 0, position); glVertexAttribPointer(glamor->texture_shader_texcoord_loc, 2, GL_FLOAT, FALSE, 0, texcoords); glEnableVertexAttribArray(glamor->texture_shader_position_loc); glEnableVertexAttribArray(glamor->texture_shader_texcoord_loc); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, glamor->tex); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableVertexAttribArray(glamor->texture_shader_position_loc); glDisableVertexAttribArray(glamor->texture_shader_texcoord_loc); glXSwapBuffers(dpy, glamor->glx_win); } /** * Xlib-based handling of xcb events for glamor. * * We need to let the Xlib event filtering run on the event so that * Mesa's dri2_glx.c userspace event mangling gets run, and we * correctly get our invalidate events propagated into the driver. */ void ephyr_glamor_process_event(xcb_generic_event_t *xev) { uint32_t response_type = xev->response_type & 0x7f; /* Note the types on wire_to_event: there's an Xlib XEvent (with * the broken types) that it returns, and a protocol xEvent that * it inspects. */ Bool (*wire_to_event)(Display *dpy, XEvent *ret, xEvent *event); XLockDisplay(dpy); /* Set the event handler to NULL to get access to the current one. */ wire_to_event = XESetWireToEvent(dpy, response_type, NULL); if (wire_to_event) { XEvent processed_event; /* OK they had an event handler. Plug it back in, and call * through to it. */ XESetWireToEvent(dpy, response_type, wire_to_event); xev->sequence = LastKnownRequestProcessed(dpy); wire_to_event(dpy, &processed_event, (xEvent *)xev); } XUnlockDisplay(dpy); } struct ephyr_glamor * ephyr_glamor_glx_screen_init(xcb_window_t win) { GLXContext ctx; struct ephyr_glamor *glamor; GLXWindow glx_win; glamor = calloc(1, sizeof(struct ephyr_glamor)); if (!glamor) { FatalError("malloc"); return NULL; } glx_win = glXCreateWindow(dpy, fb_config, win, NULL); if (ephyr_glamor_gles2) { static const int context_attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 2, GLX_CONTEXT_MINOR_VERSION_ARB, 0, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES_PROFILE_BIT_EXT, 0, }; if (epoxy_has_glx_extension(dpy, DefaultScreen(dpy), "GLX_EXT_create_context_es2_profile")) { ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True, context_attribs); } else { FatalError("Xephyr -glamor_gles2 rquires " "GLX_EXT_create_context_es2_profile\n"); } } else { ctx = glXCreateContext(dpy, visual_info, NULL, True); } if (ctx == NULL) FatalError("glXCreateContext failed\n"); if (!glXMakeCurrent(dpy, glx_win, ctx)) FatalError("glXMakeCurrent failed\n"); glamor->ctx = ctx; glamor->win = win; glamor->glx_win = glx_win; ephyr_glamor_setup_texturing_shader(glamor); return glamor; } void ephyr_glamor_glx_screen_fini(struct ephyr_glamor *glamor) { glXMakeCurrent(dpy, None, NULL); glXDestroyContext(dpy, glamor->ctx); glXDestroyWindow(dpy, glamor->glx_win); free(glamor); } xcb_visualtype_t * ephyr_glamor_get_visual(void) { xcb_screen_t *xscreen = xcb_aux_get_screen(XGetXCBConnection(dpy), DefaultScreen(dpy)); int attribs[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, 1, None }; int event_base = 0, error_base = 0, nelements; GLXFBConfig *fbconfigs; if (!glXQueryExtension (dpy, &error_base, &event_base)) FatalError("Couldn't find GLX extension\n"); fbconfigs = glXChooseFBConfig(dpy, DefaultScreen(dpy), attribs, &nelements); if (!nelements) FatalError("Couldn't choose an FBConfig\n"); fb_config = fbconfigs[0]; free(fbconfigs); visual_info = glXGetVisualFromFBConfig(dpy, fb_config); if (visual_info == NULL) FatalError("Couldn't get RGB visual\n"); return xcb_aux_find_visual_by_id(xscreen, visual_info->visualid); } void ephyr_glamor_set_window_size(struct ephyr_glamor *glamor, unsigned width, unsigned height) { if (!glamor) return; glamor->width = width; glamor->height = height; } xorg-server-1.17.1/hw/kdrive/ephyr/ephyrvideo.c0000664000175100017510000012117512456571574016413 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "ephyrlog.h" #include "kdrive.h" #include "kxv.h" #include "ephyr.h" #include "hostx.h" struct _EphyrXVPriv { xcb_xv_query_adaptors_reply_t *host_adaptors; KdVideoAdaptorPtr adaptors; int num_adaptors; }; typedef struct _EphyrXVPriv EphyrXVPriv; struct _EphyrPortPriv { int port_number; KdVideoAdaptorPtr current_adaptor; EphyrXVPriv *xv_priv; unsigned char *image_buf; int image_buf_size; int image_id; int drw_x, drw_y, drw_w, drw_h; int src_x, src_y, src_w, src_h; int image_width, image_height; }; typedef struct _EphyrPortPriv EphyrPortPriv; static Bool ephyrLocalAtomToHost(int a_local_atom, int *a_host_atom); static EphyrXVPriv *ephyrXVPrivNew(void); static void ephyrXVPrivDelete(EphyrXVPriv * a_this); static Bool ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this); static Bool ephyrXVPrivSetAdaptorsHooks(EphyrXVPriv * a_this); static Bool ephyrXVPrivRegisterAdaptors(EphyrXVPriv * a_this, ScreenPtr a_screen); static Bool ephyrXVPrivIsAttrValueValid(XvAttributePtr a_attrs, int a_attrs_len, const char *a_attr_name, int a_attr_value, Bool *a_is_valid); static Bool ephyrXVPrivGetImageBufSize(int a_port_id, int a_image_id, unsigned short a_width, unsigned short a_height, int *a_size); static Bool ephyrXVPrivSaveImageToPortPriv(EphyrPortPriv * a_port_priv, const unsigned char *a_image, int a_image_len); static void ephyrStopVideo(KdScreenInfo * a_info, void *a_xv_priv, Bool a_exit); static int ephyrSetPortAttribute(KdScreenInfo * a_info, Atom a_attr_name, int a_attr_value, void *a_port_priv); static int ephyrGetPortAttribute(KdScreenInfo * a_screen_info, Atom a_attr_name, int *a_attr_value, void *a_port_priv); static void ephyrQueryBestSize(KdScreenInfo * a_info, Bool a_motion, short a_src_w, short a_src_h, short a_drw_w, short a_drw_h, unsigned int *a_prefered_w, unsigned int *a_prefered_h, void *a_port_priv); static int ephyrPutImage(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_src_x, short a_src_y, short a_drw_x, short a_drw_y, short a_src_w, short a_src_h, short a_drw_w, short a_drw_h, int a_id, unsigned char *a_buf, short a_width, short a_height, Bool a_sync, RegionPtr a_clipping_region, void *a_port_priv); static int ephyrReputImage(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_drw_x, short a_drw_y, RegionPtr a_clipping_region, void *a_port_priv); static int ephyrPutVideo(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clip_region, void *a_port_priv); static int ephyrGetVideo(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clip_region, void *a_port_priv); static int ephyrPutStill(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clip_region, void *a_port_priv); static int ephyrGetStill(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clip_region, void *a_port_priv); static int ephyrQueryImageAttributes(KdScreenInfo * a_info, int a_id, unsigned short *a_w, unsigned short *a_h, int *a_pitches, int *a_offsets); static int s_base_port_id; /************** * * ************/ static Bool adaptor_has_flags(const xcb_xv_adaptor_info_t *adaptor, uint32_t flags) { return (adaptor->type & flags) == flags; } static Bool ephyrLocalAtomToHost(int a_local_atom, int *a_host_atom) { xcb_connection_t *conn = hostx_get_xcbconn(); xcb_intern_atom_cookie_t cookie; xcb_intern_atom_reply_t *reply; const char *atom_name = NULL; EPHYR_RETURN_VAL_IF_FAIL(a_host_atom, FALSE); if (!ValidAtom(a_local_atom)) return FALSE; atom_name = NameForAtom(a_local_atom); if (!atom_name) return FALSE; cookie = xcb_intern_atom(conn, FALSE, strlen(atom_name), atom_name); reply = xcb_intern_atom_reply(conn, cookie, NULL); if (!reply || reply->atom == None) { EPHYR_LOG_ERROR("no atom for string %s defined in host X\n", atom_name); return FALSE; } *a_host_atom = reply->atom; free(reply); return TRUE; } /************** * * ************/ Bool ephyrInitVideo(ScreenPtr pScreen) { Bool is_ok = FALSE; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; static EphyrXVPriv *xv_priv; EPHYR_LOG("enter\n"); if (screen->fb.bitsPerPixel == 8) { EPHYR_LOG_ERROR("8 bits depth not supported\n"); return FALSE; } if (!xv_priv) { xv_priv = ephyrXVPrivNew(); } if (!xv_priv) { EPHYR_LOG_ERROR("failed to create xv_priv\n"); goto out; } if (!ephyrXVPrivRegisterAdaptors(xv_priv, pScreen)) { EPHYR_LOG_ERROR("failed to register adaptors\n"); goto out; } is_ok = TRUE; out: return is_ok; } static EphyrXVPriv * ephyrXVPrivNew(void) { EphyrXVPriv *xv_priv = NULL; EPHYR_LOG("enter\n"); xv_priv = calloc(1, sizeof(EphyrXVPriv)); if (!xv_priv) { EPHYR_LOG_ERROR("failed to create EphyrXVPriv\n"); goto error; } if (!ephyrXVPrivQueryHostAdaptors(xv_priv)) { EPHYR_LOG_ERROR("failed to query the host x for xv properties\n"); goto error; } if (!ephyrXVPrivSetAdaptorsHooks(xv_priv)) { EPHYR_LOG_ERROR("failed to set xv_priv hooks\n"); goto error; } EPHYR_LOG("leave\n"); return xv_priv; error: if (xv_priv) { ephyrXVPrivDelete(xv_priv); xv_priv = NULL; } return NULL; } static void ephyrXVPrivDelete(EphyrXVPriv * a_this) { EPHYR_LOG("enter\n"); if (!a_this) return; if (a_this->host_adaptors) { free(a_this->host_adaptors); a_this->host_adaptors = NULL; } free(a_this->adaptors); a_this->adaptors = NULL; free(a_this); EPHYR_LOG("leave\n"); } static Bool translate_video_encodings(KdVideoAdaptorPtr adaptor, xcb_xv_adaptor_info_t *host_adaptor) { xcb_connection_t *conn = hostx_get_xcbconn(); int i; xcb_xv_query_encodings_cookie_t cookie; xcb_xv_query_encodings_reply_t *reply; xcb_xv_encoding_info_iterator_t encoding_it; cookie = xcb_xv_query_encodings(conn, host_adaptor->base_id); reply = xcb_xv_query_encodings_reply(conn, cookie, NULL); if (!reply) return FALSE; adaptor->nEncodings = reply->num_encodings; adaptor->pEncodings = calloc(adaptor->nEncodings, sizeof(*adaptor->pEncodings)); if (!adaptor->pEncodings) { free(reply); return FALSE; } encoding_it = xcb_xv_query_encodings_info_iterator(reply); for (i = 0; i < adaptor->nEncodings; i++) { xcb_xv_encoding_info_t *encoding_info = encoding_it.data; KdVideoEncodingPtr encoding = &adaptor->pEncodings[i]; encoding->id = encoding_info->encoding; encoding->name = strndup(xcb_xv_encoding_info_name(encoding_info), encoding_info->name_size); encoding->width = encoding_info->width; encoding->height = encoding_info->height; encoding->rate.numerator = encoding_info->rate.numerator; encoding->rate.denominator = encoding_info->rate.denominator; xcb_xv_encoding_info_next(&encoding_it); } free(reply); return TRUE; } static Bool translate_xv_attributes(KdVideoAdaptorPtr adaptor, xcb_xv_adaptor_info_t *host_adaptor) { xcb_connection_t *conn = hostx_get_xcbconn(); int i = 0; xcb_xv_attribute_info_iterator_t it; xcb_xv_query_port_attributes_cookie_t cookie = xcb_xv_query_port_attributes(conn, host_adaptor->base_id); xcb_xv_query_port_attributes_reply_t *reply = xcb_xv_query_port_attributes_reply(conn, cookie, NULL); if (!reply) return FALSE; adaptor->nAttributes = reply->num_attributes; adaptor->pAttributes = calloc(reply->num_attributes, sizeof(*adaptor->pAttributes)); if (!adaptor->pAttributes) { EPHYR_LOG_ERROR("failed to allocate attributes\n"); free(reply); return FALSE; } it = xcb_xv_query_port_attributes_attributes_iterator(reply); for (i = 0; i < reply->num_attributes; i++) { XvAttributePtr attribute = &adaptor->pAttributes[i]; attribute->flags = it.data->flags; attribute->min_value = it.data->min; attribute->max_value = it.data->max; attribute->name = strndup(xcb_xv_attribute_info_name(it.data), it.data->size); /* make sure atoms of attrs names are created in xephyr */ MakeAtom(xcb_xv_attribute_info_name(it.data), it.data->size, TRUE); xcb_xv_attribute_info_next(&it); } free(reply); return TRUE; } static Bool translate_xv_image_formats(KdVideoAdaptorPtr adaptor, xcb_xv_adaptor_info_t *host_adaptor) { xcb_connection_t *conn = hostx_get_xcbconn(); int i = 0; xcb_xv_list_image_formats_cookie_t cookie = xcb_xv_list_image_formats(conn, host_adaptor->base_id); xcb_xv_list_image_formats_reply_t *reply = xcb_xv_list_image_formats_reply(conn, cookie, NULL); xcb_xv_image_format_info_t *formats; if (!reply) return FALSE; adaptor->nImages = reply->num_formats; adaptor->pImages = calloc(reply->num_formats, sizeof(XvImageRec)); if (!adaptor->pImages) { free(reply); return FALSE; } formats = xcb_xv_list_image_formats_format(reply); for (i = 0; i < reply->num_formats; i++) { XvImagePtr image = &adaptor->pImages[i]; image->id = formats[i].id; image->type = formats[i].type; image->byte_order = formats[i].byte_order; memcpy(image->guid, formats[i].guid, 16); image->bits_per_pixel = formats[i].bpp; image->format = formats[i].format; image->num_planes = formats[i].num_planes; image->depth = formats[i].depth; image->red_mask = formats[i].red_mask; image->green_mask = formats[i].green_mask; image->blue_mask = formats[i].blue_mask; image->y_sample_bits = formats[i].y_sample_bits; image->u_sample_bits = formats[i].u_sample_bits; image->v_sample_bits = formats[i].v_sample_bits; image->horz_y_period = formats[i].vhorz_y_period; image->horz_u_period = formats[i].vhorz_u_period; image->horz_v_period = formats[i].vhorz_v_period; image->vert_y_period = formats[i].vvert_y_period; image->vert_u_period = formats[i].vvert_u_period; image->vert_v_period = formats[i].vvert_v_period; memcpy(image->component_order, formats[i].vcomp_order, 32); image->scanline_order = formats[i].vscanline_order; } free(reply); return TRUE; } static Bool ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this) { xcb_connection_t *conn = hostx_get_xcbconn(); xcb_screen_t *xscreen = xcb_aux_get_screen(conn, hostx_get_screen()); int base_port_id = 0, i = 0, port_priv_offset = 0; Bool is_ok = FALSE; xcb_generic_error_t *e = NULL; xcb_xv_adaptor_info_iterator_t it; EPHYR_RETURN_VAL_IF_FAIL(a_this, FALSE); EPHYR_LOG("enter\n"); { xcb_xv_query_adaptors_cookie_t cookie = xcb_xv_query_adaptors(conn, xscreen->root); a_this->host_adaptors = xcb_xv_query_adaptors_reply(conn, cookie, &e); if (e) { free(e); EPHYR_LOG_ERROR("failed to query host adaptors\n"); goto out; } } if (a_this->host_adaptors) a_this->num_adaptors = a_this->host_adaptors->num_adaptors; if (a_this->num_adaptors < 0) { EPHYR_LOG_ERROR("failed to get number of host adaptors\n"); goto out; } EPHYR_LOG("host has %d adaptors\n", a_this->num_adaptors); /* * copy what we can from adaptors into a_this->adaptors */ if (a_this->num_adaptors) { a_this->adaptors = calloc(a_this->num_adaptors, sizeof(KdVideoAdaptorRec)); if (!a_this->adaptors) { EPHYR_LOG_ERROR("failed to create internal adaptors\n"); goto out; } } it = xcb_xv_query_adaptors_info_iterator(a_this->host_adaptors); for (i = 0; i < a_this->num_adaptors; i++) { xcb_xv_adaptor_info_t *cur_host_adaptor = it.data; xcb_xv_format_t *format = xcb_xv_adaptor_info_formats(cur_host_adaptor); int j = 0; a_this->adaptors[i].nPorts = cur_host_adaptor->num_ports; if (a_this->adaptors[i].nPorts <= 0) { EPHYR_LOG_ERROR("Could not find any port of adaptor %d\n", i); continue; } a_this->adaptors[i].type = cur_host_adaptor->type; a_this->adaptors[i].type |= XvWindowMask; a_this->adaptors[i].flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; a_this->adaptors[i].name = strndup(xcb_xv_adaptor_info_name(cur_host_adaptor), cur_host_adaptor->name_size); if (!a_this->adaptors[i].name) a_this->adaptors[i].name = strdup("Xephyr Video Overlay"); base_port_id = cur_host_adaptor->base_id; if (base_port_id < 0) { EPHYR_LOG_ERROR("failed to get port id for adaptor %d\n", i); continue; } if (!s_base_port_id) s_base_port_id = base_port_id; if (!translate_video_encodings(&a_this->adaptors[i], cur_host_adaptor)) { EPHYR_LOG_ERROR("failed to get encodings for port port id %d," " adaptors %d\n", base_port_id, i); continue; } a_this->adaptors[i].nFormats = cur_host_adaptor->num_formats; a_this->adaptors[i].pFormats = calloc(cur_host_adaptor->num_formats, sizeof(*a_this->adaptors[i].pFormats)); for (j = 0; j < cur_host_adaptor->num_formats; j++) { xcb_visualtype_t *visual = xcb_aux_find_visual_by_id(xscreen, format[j].visual); a_this->adaptors[i].pFormats[j].depth = format[j].depth; a_this->adaptors[i].pFormats[j].class = visual->_class; } a_this->adaptors[i].pPortPrivates = calloc(a_this->adaptors[i].nPorts, sizeof(DevUnion) + sizeof(EphyrPortPriv)); 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]. pPortPrivates[port_priv_offset]; EphyrPortPriv *port_priv = &port_privs_base[j]; port_priv->port_number = base_port_id + j; port_priv->current_adaptor = &a_this->adaptors[i]; port_priv->xv_priv = a_this; a_this->adaptors[i].pPortPrivates[j].ptr = port_priv; } if (!translate_xv_attributes(&a_this->adaptors[i], cur_host_adaptor)) { { EPHYR_LOG_ERROR("failed to get port attribute " "for adaptor %d\n", i); continue; } } if (!translate_xv_image_formats(&a_this->adaptors[i], cur_host_adaptor)) { EPHYR_LOG_ERROR("failed to get image formats " "for adaptor %d\n", i); continue; } xcb_xv_adaptor_info_next(&it); } is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } static Bool ephyrXVPrivSetAdaptorsHooks(EphyrXVPriv * a_this) { int i = 0; xcb_xv_adaptor_info_iterator_t it; EPHYR_RETURN_VAL_IF_FAIL(a_this, FALSE); EPHYR_LOG("enter\n"); it = xcb_xv_query_adaptors_info_iterator(a_this->host_adaptors); for (i = 0; i < a_this->num_adaptors; i++) { xcb_xv_adaptor_info_t *cur_host_adaptor = it.data; a_this->adaptors[i].ReputImage = ephyrReputImage; a_this->adaptors[i].StopVideo = ephyrStopVideo; a_this->adaptors[i].SetPortAttribute = ephyrSetPortAttribute; a_this->adaptors[i].GetPortAttribute = ephyrGetPortAttribute; a_this->adaptors[i].QueryBestSize = ephyrQueryBestSize; a_this->adaptors[i].QueryImageAttributes = ephyrQueryImageAttributes; if (adaptor_has_flags(cur_host_adaptor, XCB_XV_TYPE_IMAGE_MASK | XCB_XV_TYPE_INPUT_MASK)) a_this->adaptors[i].PutImage = ephyrPutImage; if (adaptor_has_flags(cur_host_adaptor, XCB_XV_TYPE_VIDEO_MASK | XCB_XV_TYPE_INPUT_MASK)) a_this->adaptors[i].PutVideo = ephyrPutVideo; if (adaptor_has_flags(cur_host_adaptor, XCB_XV_TYPE_VIDEO_MASK | XCB_XV_TYPE_OUTPUT_MASK)) a_this->adaptors[i].GetVideo = ephyrGetVideo; if (adaptor_has_flags(cur_host_adaptor, XCB_XV_TYPE_STILL_MASK | XCB_XV_TYPE_INPUT_MASK)) a_this->adaptors[i].PutStill = ephyrPutStill; if (adaptor_has_flags(cur_host_adaptor, XCB_XV_TYPE_STILL_MASK | XCB_XV_TYPE_OUTPUT_MASK)) a_this->adaptors[i].GetStill = ephyrGetStill; } EPHYR_LOG("leave\n"); return TRUE; } static Bool ephyrXVPrivRegisterAdaptors(EphyrXVPriv * a_this, ScreenPtr a_screen) { Bool is_ok = FALSE; EPHYR_RETURN_VAL_IF_FAIL(a_this && a_screen, FALSE); EPHYR_LOG("enter\n"); if (!a_this->num_adaptors) goto out; if (!KdXVScreenInit(a_screen, a_this->adaptors, a_this->num_adaptors)) { EPHYR_LOG_ERROR("failed to register adaptors\n"); goto out; } EPHYR_LOG("there are %d registered adaptors\n", a_this->num_adaptors); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } static Bool ephyrXVPrivIsAttrValueValid(XvAttributePtr a_attrs, int a_attrs_len, const char *a_attr_name, int a_attr_value, Bool *a_is_valid) { int i = 0; EPHYR_RETURN_VAL_IF_FAIL(a_attrs && a_attr_name && a_is_valid, FALSE); for (i = 0; i < a_attrs_len; i++) { if (a_attrs[i].name && strcmp(a_attrs[i].name, a_attr_name)) continue; if (a_attrs[i].min_value > a_attr_value || a_attrs[i].max_value < a_attr_value) { *a_is_valid = FALSE; EPHYR_LOG_ERROR("attribute was not valid\n" "value:%d. min:%d. max:%d\n", a_attr_value, a_attrs[i].min_value, a_attrs[i].max_value); } else { *a_is_valid = TRUE; } return TRUE; } return FALSE; } static Bool ephyrXVPrivGetImageBufSize(int a_port_id, int a_image_id, unsigned short a_width, unsigned short a_height, int *a_size) { xcb_connection_t *conn = hostx_get_xcbconn(); xcb_xv_query_image_attributes_cookie_t cookie; xcb_xv_query_image_attributes_reply_t *reply; Bool is_ok = FALSE; EPHYR_RETURN_VAL_IF_FAIL(a_size, FALSE); EPHYR_LOG("enter\n"); cookie = xcb_xv_query_image_attributes(conn, a_port_id, a_image_id, a_width, a_height); reply = xcb_xv_query_image_attributes_reply(conn, cookie, NULL); if (!reply) goto out; *a_size = reply->data_size; is_ok = TRUE; free(reply); out: EPHYR_LOG("leave\n"); return is_ok; } static Bool ephyrXVPrivSaveImageToPortPriv(EphyrPortPriv * a_port_priv, const unsigned char *a_image_buf, int a_image_len) { Bool is_ok = FALSE; EPHYR_LOG("enter\n"); if (a_port_priv->image_buf_size < a_image_len) { unsigned char *buf = NULL; buf = realloc(a_port_priv->image_buf, a_image_len); if (!buf) { EPHYR_LOG_ERROR("failed to realloc image buffer\n"); goto out; } a_port_priv->image_buf = buf; a_port_priv->image_buf_size = a_image_len; } memmove(a_port_priv->image_buf, a_image_buf, a_image_len); is_ok = TRUE; out: return is_ok; EPHYR_LOG("leave\n"); } static void ephyrStopVideo(KdScreenInfo * a_info, void *a_port_priv, Bool a_exit) { xcb_connection_t *conn = hostx_get_xcbconn(); EphyrPortPriv *port_priv = a_port_priv; EphyrScrPriv *scrpriv = a_info->driver; EPHYR_RETURN_IF_FAIL(port_priv); EPHYR_LOG("enter\n"); xcb_xv_stop_video(conn, port_priv->port_number, scrpriv->win); EPHYR_LOG("leave\n"); } static int ephyrSetPortAttribute(KdScreenInfo * a_info, Atom a_attr_name, int a_attr_value, void *a_port_priv) { xcb_connection_t *conn = hostx_get_xcbconn(); int res = Success, host_atom = 0; EphyrPortPriv *port_priv = a_port_priv; Bool is_attr_valid = FALSE; EPHYR_RETURN_VAL_IF_FAIL(port_priv, BadMatch); EPHYR_RETURN_VAL_IF_FAIL(port_priv->current_adaptor, BadMatch); EPHYR_RETURN_VAL_IF_FAIL(port_priv->current_adaptor->pAttributes, BadMatch); EPHYR_RETURN_VAL_IF_FAIL(port_priv->current_adaptor->nAttributes, BadMatch); EPHYR_RETURN_VAL_IF_FAIL(ValidAtom(a_attr_name), BadMatch); EPHYR_LOG("enter, portnum:%d, atomid:%d, attr_name:%s, attr_val:%d\n", port_priv->port_number, (int) a_attr_name, NameForAtom(a_attr_name), a_attr_value); if (!ephyrLocalAtomToHost(a_attr_name, &host_atom)) { EPHYR_LOG_ERROR("failed to convert local atom to host atom\n"); res = BadMatch; goto out; } if (!ephyrXVPrivIsAttrValueValid(port_priv->current_adaptor->pAttributes, port_priv->current_adaptor->nAttributes, NameForAtom(a_attr_name), a_attr_value, &is_attr_valid)) { EPHYR_LOG_ERROR("failed to validate attribute %s\n", NameForAtom(a_attr_name)); /* res = BadMatch ; goto out ; */ } if (!is_attr_valid) { EPHYR_LOG_ERROR("attribute %s is not valid\n", NameForAtom(a_attr_name)); /* res = BadMatch ; goto out ; */ } xcb_xv_set_port_attribute(conn, port_priv->port_number, host_atom, a_attr_value); xcb_flush(conn); res = Success; out: EPHYR_LOG("leave\n"); return res; } static int ephyrGetPortAttribute(KdScreenInfo * a_screen_info, Atom a_attr_name, int *a_attr_value, void *a_port_priv) { xcb_connection_t *conn = hostx_get_xcbconn(); int res = Success, host_atom = 0; EphyrPortPriv *port_priv = a_port_priv; xcb_generic_error_t *e; xcb_xv_get_port_attribute_cookie_t cookie; xcb_xv_get_port_attribute_reply_t *reply; EPHYR_RETURN_VAL_IF_FAIL(port_priv, BadMatch); EPHYR_RETURN_VAL_IF_FAIL(ValidAtom(a_attr_name), BadMatch); EPHYR_LOG("enter, portnum:%d, atomid:%d, attr_name:%s\n", port_priv->port_number, (int) a_attr_name, NameForAtom(a_attr_name)); if (!ephyrLocalAtomToHost(a_attr_name, &host_atom)) { EPHYR_LOG_ERROR("failed to convert local atom to host atom\n"); res = BadMatch; goto out; } cookie = xcb_xv_get_port_attribute(conn, port_priv->port_number, host_atom); reply = xcb_xv_get_port_attribute_reply(conn, cookie, &e); if (e) { EPHYR_LOG_ERROR ("XvGetPortAttribute() failed: %d \n", e->error_code); free(e); res = BadMatch; goto out; } *a_attr_value = reply->value; free(reply); res = Success; out: EPHYR_LOG("leave\n"); return res; } static void ephyrQueryBestSize(KdScreenInfo * a_info, Bool a_motion, short a_src_w, short a_src_h, short a_drw_w, short a_drw_h, unsigned int *a_prefered_w, unsigned int *a_prefered_h, void *a_port_priv) { xcb_connection_t *conn = hostx_get_xcbconn(); EphyrPortPriv *port_priv = a_port_priv; xcb_xv_query_best_size_cookie_t cookie = xcb_xv_query_best_size(conn, port_priv->port_number, a_src_w, a_src_h, a_drw_w, a_drw_h, a_motion); xcb_xv_query_best_size_reply_t *reply = xcb_xv_query_best_size_reply(conn, cookie, NULL); EPHYR_LOG("enter: frame (%dx%d), drw (%dx%d)\n", a_src_w, a_src_h, a_drw_w, a_drw_h); if (!reply) { EPHYR_LOG_ERROR ("XvQueryBestSize() failed\n"); return; } *a_prefered_w = reply->actual_width; *a_prefered_h = reply->actual_height; EPHYR_LOG("actual (%dx%d)\n", *a_prefered_w, *a_prefered_h); free(reply); EPHYR_LOG("leave\n"); } static Bool ephyrHostXVPutImage(KdScreenInfo * a_info, EphyrPortPriv *port_priv, int a_image_id, int a_drw_x, int a_drw_y, int a_drw_w, int a_drw_h, int a_src_x, int a_src_y, int a_src_w, int a_src_h, int a_image_width, int a_image_height, unsigned char *a_buf, BoxPtr a_clip_rects, int a_clip_rect_nums) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_gcontext_t gc; Bool is_ok = TRUE; xcb_rectangle_t *rects = NULL; int data_len, width, height; xcb_xv_query_image_attributes_cookie_t image_attr_cookie; xcb_xv_query_image_attributes_reply_t *image_attr_reply; EPHYR_RETURN_VAL_IF_FAIL(a_buf, FALSE); EPHYR_LOG("enter, num_clip_rects: %d\n", a_clip_rect_nums); image_attr_cookie = xcb_xv_query_image_attributes(conn, port_priv->port_number, a_image_id, a_image_width, a_image_height); image_attr_reply = xcb_xv_query_image_attributes_reply(conn, image_attr_cookie, NULL); if (!image_attr_reply) goto out; data_len = image_attr_reply->data_size; width = image_attr_reply->width; height = image_attr_reply->height; free(image_attr_reply); gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, scrpriv->win, 0, NULL); if (a_clip_rect_nums) { int i = 0; rects = calloc(a_clip_rect_nums, sizeof(xcb_rectangle_t)); for (i=0; i < a_clip_rect_nums; i++) { rects[i].x = a_clip_rects[i].x1; rects[i].y = a_clip_rects[i].y1; rects[i].width = a_clip_rects[i].x2 - a_clip_rects[i].x1; rects[i].height = a_clip_rects[i].y2 - a_clip_rects[i].y1; EPHYR_LOG("(x,y,w,h): (%d,%d,%d,%d)\n", rects[i].x, rects[i].y, rects[i].width, rects[i].height); } xcb_set_clip_rectangles(conn, XCB_CLIP_ORDERING_YX_BANDED, gc, 0, 0, a_clip_rect_nums, rects); free(rects); } xcb_xv_put_image(conn, port_priv->port_number, scrpriv->win, gc, a_image_id, a_src_x, a_src_y, a_src_w, a_src_h, a_drw_x, a_drw_y, a_drw_w, a_drw_h, width, height, data_len, a_buf); xcb_free_gc(conn, gc); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } static int ephyrPutImage(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_src_x, short a_src_y, short a_drw_x, short a_drw_y, short a_src_w, short a_src_h, short a_drw_w, short a_drw_h, int a_id, unsigned char *a_buf, short a_width, short a_height, Bool a_sync, RegionPtr a_clipping_region, void *a_port_priv) { EphyrPortPriv *port_priv = a_port_priv; Bool is_ok = FALSE; int result = BadImplementation, image_size = 0; EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue); EPHYR_RETURN_VAL_IF_FAIL(a_drawable, BadValue); EPHYR_LOG("enter\n"); if (!ephyrHostXVPutImage(a_info, port_priv, a_id, a_drw_x, a_drw_y, a_drw_w, a_drw_h, a_src_x, a_src_y, a_src_w, a_src_h, a_width, a_height, a_buf, RegionRects(a_clipping_region), RegionNumRects(a_clipping_region))) { EPHYR_LOG_ERROR("EphyrHostXVPutImage() failed\n"); goto out; } /* * Now save the image so that we can resend it to host it * later, in ReputImage. */ if (!ephyrXVPrivGetImageBufSize(port_priv->port_number, a_id, a_width, a_height, &image_size)) { EPHYR_LOG_ERROR("failed to get image size\n"); /*this is a minor error so we won't get bail out abruptly */ is_ok = FALSE; } else { is_ok = TRUE; } if (is_ok) { if (!ephyrXVPrivSaveImageToPortPriv(port_priv, a_buf, image_size)) { is_ok = FALSE; } else { port_priv->image_id = a_id; port_priv->drw_x = a_drw_x; port_priv->drw_y = a_drw_y; port_priv->drw_w = a_drw_w; port_priv->drw_h = a_drw_h; port_priv->src_x = a_src_x; port_priv->src_y = a_src_y; port_priv->src_w = a_src_w; port_priv->src_h = a_src_h; port_priv->image_width = a_width; port_priv->image_height = a_height; } } if (!is_ok) { if (port_priv->image_buf) { free(port_priv->image_buf); port_priv->image_buf = NULL; port_priv->image_buf_size = 0; } } result = Success; out: EPHYR_LOG("leave\n"); return result; } static int ephyrReputImage(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_drw_x, short a_drw_y, RegionPtr a_clipping_region, void *a_port_priv) { EphyrPortPriv *port_priv = a_port_priv; int result = BadImplementation; EPHYR_RETURN_VAL_IF_FAIL(a_info->pScreen, FALSE); EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue); EPHYR_LOG("enter\n"); if (!port_priv->image_buf_size || !port_priv->image_buf) { EPHYR_LOG_ERROR("has null image buf in cache\n"); goto out; } if (!ephyrHostXVPutImage(a_info, port_priv, port_priv->image_id, a_drw_x, a_drw_y, port_priv->drw_w, port_priv->drw_h, port_priv->src_x, port_priv->src_y, port_priv->src_w, port_priv->src_h, port_priv->image_width, port_priv->image_height, port_priv->image_buf, RegionRects(a_clipping_region), RegionNumRects(a_clipping_region))) { EPHYR_LOG_ERROR("ephyrHostXVPutImage() failed\n"); goto out; } result = Success; out: EPHYR_LOG("leave\n"); return result; } static int ephyrPutVideo(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_gcontext_t gc; EphyrPortPriv *port_priv = a_port_priv; EPHYR_RETURN_VAL_IF_FAIL(a_info->pScreen, BadValue); EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue); EPHYR_LOG("enter\n"); gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, scrpriv->win, 0, NULL); xcb_xv_put_video(conn, port_priv->port_number, scrpriv->win, gc, a_vid_x, a_vid_y, a_vid_w, a_vid_h, a_drw_x, a_drw_y, a_drw_w, a_drw_h); xcb_free_gc(conn, gc); EPHYR_LOG("leave\n"); return Success; } static int ephyrGetVideo(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_gcontext_t gc; EphyrPortPriv *port_priv = a_port_priv; EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue); EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue); EPHYR_LOG("enter\n"); gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, scrpriv->win, 0, NULL); xcb_xv_get_video(conn, port_priv->port_number, scrpriv->win, gc, a_vid_x, a_vid_y, a_vid_w, a_vid_h, a_drw_x, a_drw_y, a_drw_w, a_drw_h); xcb_free_gc(conn, gc); EPHYR_LOG("leave\n"); return Success; } static int ephyrPutStill(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_gcontext_t gc; EphyrPortPriv *port_priv = a_port_priv; EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue); EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue); EPHYR_LOG("enter\n"); gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, scrpriv->win, 0, NULL); xcb_xv_put_still(conn, port_priv->port_number, scrpriv->win, gc, a_vid_x, a_vid_y, a_vid_w, a_vid_h, a_drw_x, a_drw_y, a_drw_w, a_drw_h); xcb_free_gc(conn, gc); EPHYR_LOG("leave\n"); return Success; } static int ephyrGetStill(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_vid_x, short a_vid_y, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_gcontext_t gc; EphyrPortPriv *port_priv = a_port_priv; EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue); EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue); EPHYR_LOG("enter\n"); gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, scrpriv->win, 0, NULL); xcb_xv_get_still(conn, port_priv->port_number, scrpriv->win, gc, a_vid_x, a_vid_y, a_vid_w, a_vid_h, a_drw_x, a_drw_y, a_drw_w, a_drw_h); xcb_free_gc(conn, gc); EPHYR_LOG("leave\n"); return Success; } static int ephyrQueryImageAttributes(KdScreenInfo * a_info, int a_id, unsigned short *a_w, unsigned short *a_h, int *a_pitches, int *a_offsets) { xcb_connection_t *conn = hostx_get_xcbconn(); xcb_xv_query_image_attributes_cookie_t cookie; xcb_xv_query_image_attributes_reply_t *reply; int image_size = 0; EPHYR_RETURN_VAL_IF_FAIL(a_w && a_h, FALSE); EPHYR_LOG("enter: dim (%dx%d), pitches: %p, offsets: %p\n", *a_w, *a_h, a_pitches, a_offsets); cookie = xcb_xv_query_image_attributes(conn, s_base_port_id, a_id, *a_w, *a_h); reply = xcb_xv_query_image_attributes_reply(conn, cookie, NULL); if (!reply) goto out; *a_w = reply->width; *a_h = reply->height; if (a_pitches && a_offsets) { memcpy(a_pitches, xcb_xv_query_image_attributes_pitches(reply), reply->num_planes << 2); memcpy(a_offsets, xcb_xv_query_image_attributes_offsets(reply), reply->num_planes << 2); } image_size = reply->data_size; free(reply); EPHYR_LOG("image size: %d, dim (%dx%d)\n", image_size, *a_w, *a_h); out: EPHYR_LOG("leave\n"); return image_size; } xorg-server-1.17.1/hw/kdrive/ephyr/ephyrglxext.h0000664000175100017510000000272612456571574016625 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifndef __EPHYR_GLXEXT_H__ #define __EPHYR_GLXEXT_H__ #include Bool ephyrHijackGLXExtension(void); #endif /*__EPHYR_GLXEXT_H__*/ xorg-server-1.17.1/hw/kdrive/ephyr/os.c0000664000175100017510000000324012456571574014646 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2004 Nokia * * 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 Nokia not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Nokia makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL NOKIA 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_CONFIG_H #include #endif #include "ephyr.h" extern void processScreenArg(const char *screen_size, char *parent_id); static int EphyrInit(void) { /* * make sure at least one screen * has been added to the system. */ if (!KdCardInfoLast()) { processScreenArg("640x480", NULL); } return hostx_init(); } KdOsFuncs EphyrOsFuncs = { .Init = EphyrInit, .pollEvents = ephyrPoll, }; xorg-server-1.17.1/hw/kdrive/ephyr/ephyrdriext.c0000664000175100017510000012176512456571574016611 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * This file is heavily copied from hw/xfree86/dri/xf86dri.c * * Authors: * Dodji Seketeli */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #define _XF86DRI_SERVER_ #include #include #include #include #include #include "misc.h" #include "privates.h" #include "dixstruct.h" #include "extnsionst.h" #include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" #include "windowstr.h" #include "servermd.h" #include "swaprep.h" #include "ephyrdri.h" #include "ephyrdriext.h" #include "hostx.h" #define _HAVE_XALLOC_DECLS #include "ephyrlog.h" #include "protocol-versions.h" typedef struct { int foo; } EphyrDRIWindowPrivRec; typedef EphyrDRIWindowPrivRec *EphyrDRIWindowPrivPtr; typedef struct { CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; MoveWindowProcPtr MoveWindow; PositionWindowProcPtr PositionWindow; ClipNotifyProcPtr ClipNotify; } EphyrDRIScreenPrivRec; typedef EphyrDRIScreenPrivRec *EphyrDRIScreenPrivPtr; static int DRIErrorBase; static Bool ephyrDRIScreenInit(ScreenPtr a_screen); static Bool ephyrDRICreateWindow(WindowPtr a_win); static Bool ephyrDRIDestroyWindow(WindowPtr a_win); static void ephyrDRIMoveWindow(WindowPtr a_win, int a_x, int a_y, WindowPtr a_siblings, VTKind a_kind); static Bool ephyrDRIPositionWindow(WindowPtr a_win, int x, int y); static void ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y); static Bool EphyrMirrorHostVisuals(ScreenPtr a_screen); static Bool destroyHostPeerWindow(const WindowPtr a_win); static Bool findWindowPairFromLocal(WindowPtr a_local, EphyrWindowPair ** a_pair); static unsigned char DRIReqCode = 0; static DevPrivateKeyRec ephyrDRIWindowKeyRec; #define ephyrDRIWindowKey (&ephyrDRIWindowKeyRec) static DevPrivateKeyRec ephyrDRIScreenKeyRec; #define ephyrDRIScreenKey (&ephyrDRIScreenKeyRec) #define GET_EPHYR_DRI_WINDOW_PRIV(win) ((EphyrDRIWindowPrivPtr) \ dixLookupPrivate(&(win)->devPrivates, ephyrDRIWindowKey)) #define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \ dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey)) static Bool ephyrDRIScreenInit(ScreenPtr a_screen) { Bool is_ok = FALSE; EphyrDRIScreenPrivPtr screen_priv = NULL; EPHYR_RETURN_VAL_IF_FAIL(a_screen, FALSE); screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(a_screen); EPHYR_RETURN_VAL_IF_FAIL(screen_priv, FALSE); screen_priv->CreateWindow = a_screen->CreateWindow; screen_priv->DestroyWindow = a_screen->DestroyWindow; screen_priv->MoveWindow = a_screen->MoveWindow; screen_priv->PositionWindow = a_screen->PositionWindow; screen_priv->ClipNotify = a_screen->ClipNotify; a_screen->CreateWindow = ephyrDRICreateWindow; a_screen->DestroyWindow = ephyrDRIDestroyWindow; a_screen->MoveWindow = ephyrDRIMoveWindow; a_screen->PositionWindow = ephyrDRIPositionWindow; a_screen->ClipNotify = ephyrDRIClipNotify; is_ok = TRUE; return is_ok; } static Bool ephyrDRICreateWindow(WindowPtr a_win) { Bool is_ok = FALSE; ScreenPtr screen = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); screen = a_win->drawable.pScreen; EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->CreateWindow, FALSE); EPHYR_LOG("enter. win:%p\n", a_win); screen->CreateWindow = screen_priv->CreateWindow; is_ok = (*screen->CreateWindow) (a_win); screen->CreateWindow = ephyrDRICreateWindow; if (is_ok) { dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); } return is_ok; } static Bool ephyrDRIDestroyWindow(WindowPtr a_win) { Bool is_ok = FALSE; ScreenPtr screen = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); screen = a_win->drawable.pScreen; EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->DestroyWindow, FALSE); screen->DestroyWindow = screen_priv->DestroyWindow; if (screen->DestroyWindow) { is_ok = (*screen->DestroyWindow) (a_win); } screen->DestroyWindow = ephyrDRIDestroyWindow; if (is_ok) { EphyrDRIWindowPrivPtr win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); if (win_priv) { destroyHostPeerWindow(a_win); free(win_priv); dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); EPHYR_LOG("destroyed the remote peer window\n"); } } return is_ok; } static void ephyrDRIMoveWindow(WindowPtr a_win, int a_x, int a_y, WindowPtr a_siblings, VTKind a_kind) { ScreenPtr screen = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EphyrDRIWindowPrivPtr win_priv = NULL; EphyrWindowPair *pair = NULL; EphyrBox geo; int x = 0, y = 0; /*coords relative to parent window */ EPHYR_RETURN_IF_FAIL(a_win); EPHYR_LOG("enter\n"); screen = a_win->drawable.pScreen; EPHYR_RETURN_IF_FAIL(screen); screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); EPHYR_RETURN_IF_FAIL(screen_priv && screen_priv->MoveWindow); screen->MoveWindow = screen_priv->MoveWindow; if (screen->MoveWindow) { (*screen->MoveWindow) (a_win, a_x, a_y, a_siblings, a_kind); } screen->MoveWindow = ephyrDRIMoveWindow; EPHYR_LOG("window: %p\n", a_win); if (!a_win->parent) { EPHYR_LOG("cannot move root window\n"); return; } win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); if (!win_priv) { EPHYR_LOG("not a DRI peered window\n"); return; } if (!findWindowPairFromLocal(a_win, &pair) || !pair) { EPHYR_LOG_ERROR("failed to get window pair\n"); return; } /*compute position relative to parent window */ x = a_win->drawable.x - a_win->parent->drawable.x; y = a_win->drawable.y - a_win->parent->drawable.y; /*set the geometry to pass to hostx_set_window_geometry */ memset(&geo, 0, sizeof(geo)); geo.x = x; geo.y = y; geo.width = a_win->drawable.width; geo.height = a_win->drawable.height; hostx_set_window_geometry(pair->remote, &geo); } static Bool ephyrDRIPositionWindow(WindowPtr a_win, int a_x, int a_y) { Bool is_ok = FALSE; ScreenPtr screen = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EphyrDRIWindowPrivPtr win_priv = NULL; EphyrWindowPair *pair = NULL; EphyrBox geo; EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); EPHYR_LOG("enter\n"); screen = a_win->drawable.pScreen; EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->PositionWindow, FALSE); screen->PositionWindow = screen_priv->PositionWindow; if (screen->PositionWindow) { (*screen->PositionWindow) (a_win, a_x, a_y); } screen->PositionWindow = ephyrDRIPositionWindow; EPHYR_LOG("window: %p\n", a_win); win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); if (!win_priv) { EPHYR_LOG("not a DRI peered window\n"); is_ok = TRUE; goto out; } if (!findWindowPairFromLocal(a_win, &pair) || !pair) { EPHYR_LOG_ERROR("failed to get window pair\n"); goto out; } /*set the geometry to pass to hostx_set_window_geometry */ memset(&geo, 0, sizeof(geo)); geo.x = a_x; geo.y = a_y; geo.width = a_win->drawable.width; geo.height = a_win->drawable.height; hostx_set_window_geometry(pair->remote, &geo); is_ok = TRUE; out: EPHYR_LOG("leave. is_ok:%d\n", is_ok); /*do cleanup here */ return is_ok; } static void ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y) { ScreenPtr screen = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EphyrDRIWindowPrivPtr win_priv = NULL; EphyrWindowPair *pair = NULL; EphyrRect *rects = NULL; int i = 0; EPHYR_RETURN_IF_FAIL(a_win); EPHYR_LOG("enter\n"); screen = a_win->drawable.pScreen; EPHYR_RETURN_IF_FAIL(screen); screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); EPHYR_RETURN_IF_FAIL(screen_priv && screen_priv->ClipNotify); screen->ClipNotify = screen_priv->ClipNotify; if (screen->ClipNotify) { (*screen->ClipNotify) (a_win, a_x, a_y); } screen->ClipNotify = ephyrDRIClipNotify; EPHYR_LOG("window: %p\n", a_win); win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); if (!win_priv) { EPHYR_LOG("not a DRI peered window\n"); goto out; } if (!findWindowPairFromLocal(a_win, &pair) || !pair) { EPHYR_LOG_ERROR("failed to get window pair\n"); goto out; } rects = calloc(RegionNumRects(&a_win->clipList), sizeof(EphyrRect)); for (i = 0; i < RegionNumRects(&a_win->clipList); i++) { memmove(&rects[i], &RegionRects(&a_win->clipList)[i], sizeof(EphyrRect)); rects[i].x1 -= a_win->drawable.x; rects[i].x2 -= a_win->drawable.x; rects[i].y1 -= a_win->drawable.y; rects[i].y2 -= a_win->drawable.y; } /* * push the clipping region of this window * to the peer window in the host */ hostx_set_window_bounding_rectangles (pair->remote, rects, RegionNumRects(&a_win->clipList)); out: free(rects); rects = NULL; EPHYR_LOG("leave.\n"); /*do cleanup here */ } /** * Duplicates a visual of a_screen * In screen a_screen, for depth a_depth, find a visual which * bitsPerRGBValue and colormap size equal * a_bits_per_rgb_values and a_colormap_entries. * The ID of that duplicated visual is set to a_new_id. * That duplicated visual is then added to the list of visuals * of the screen. */ static Bool EphyrDuplicateVisual(unsigned int a_screen, short a_depth, short a_class, short a_bits_per_rgb_values, short a_colormap_entries, unsigned int a_red_mask, unsigned int a_green_mask, unsigned int a_blue_mask, unsigned int a_new_id) { Bool is_ok = FALSE, found_visual = FALSE, found_depth = FALSE; ScreenPtr screen = NULL; VisualRec new_visual, *new_visuals = NULL; int i = 0; EPHYR_LOG("enter\n"); if (a_screen >= screenInfo.numScreens) { EPHYR_LOG_ERROR("bad screen number\n"); goto out; } memset(&new_visual, 0, sizeof(VisualRec)); /*get the screen pointed to by a_screen */ screen = screenInfo.screens[a_screen]; EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); /* * In that screen, first look for an existing visual that has the * same characteristics as those passed in parameter * to this function and copy it. */ for (i = 0; i < screen->numVisuals; i++) { if (screen->visuals[i].bitsPerRGBValue == a_bits_per_rgb_values && screen->visuals[i].ColormapEntries == a_colormap_entries) { /*copy the visual found */ memcpy(&new_visual, &screen->visuals[i], sizeof(new_visual)); new_visual.vid = a_new_id; new_visual.class = a_class; new_visual.redMask = a_red_mask; new_visual.greenMask = a_green_mask; new_visual.blueMask = a_blue_mask; found_visual = TRUE; EPHYR_LOG("found a visual that matches visual id: %d\n", a_new_id); break; } } if (!found_visual) { EPHYR_LOG("did not find any visual matching %d\n", a_new_id); goto out; } /* * be prepare to extend screen->visuals to add new_visual to it */ new_visuals = calloc(screen->numVisuals + 1, sizeof(VisualRec)); memmove(new_visuals, screen->visuals, screen->numVisuals * sizeof(VisualRec)); memmove(&new_visuals[screen->numVisuals], &new_visual, sizeof(VisualRec)); /* * Now, in that same screen, update the screen->allowedDepths member. * In that array, each element represents the visuals applicable to * a given depth. So we need to add an entry matching the new visual * that we are going to add to screen->visuals */ for (i = 0; i < screen->numDepths; i++) { VisualID *vids = NULL; DepthPtr cur_depth = NULL; /*find the entry matching a_depth */ if (screen->allowedDepths[i].depth != a_depth) continue; cur_depth = &screen->allowedDepths[i]; /* * extend the list of visual IDs in that entry, * so to add a_new_id in there. */ vids = realloc(cur_depth->vids, (cur_depth->numVids + 1) * sizeof(VisualID)); if (!vids) { EPHYR_LOG_ERROR("failed to realloc numids\n"); goto out; } vids[cur_depth->numVids] = a_new_id; /* * Okay now commit our change. * Do really update screen->allowedDepths[i] */ cur_depth->numVids++; cur_depth->vids = vids; found_depth = TRUE; } if (!found_depth) { EPHYR_LOG_ERROR("failed to update screen[%d]->allowedDepth\n", a_screen); goto out; } /* * Commit our change to screen->visuals */ free(screen->visuals); screen->visuals = new_visuals; screen->numVisuals++; new_visuals = NULL; is_ok = TRUE; out: free(new_visuals); new_visuals = NULL; EPHYR_LOG("leave\n"); return is_ok; } /** * Duplicates the visuals of the host X server. * This is necessary to have visuals that have the same * ID as those of the host X. It is important to have that for * GLX. */ static Bool EphyrMirrorHostVisuals(ScreenPtr a_screen) { Bool is_ok = FALSE; EphyrHostVisualInfo *visuals = NULL; int nb_visuals = 0, i = 0; EPHYR_LOG("enter\n"); if (!hostx_get_visuals_info(&visuals, &nb_visuals)) { EPHYR_LOG_ERROR("failed to get host visuals\n"); goto out; } for (i = 0; i < nb_visuals; i++) { if (!EphyrDuplicateVisual(a_screen->myNum, visuals[i].depth, visuals[i].class, visuals[i].bits_per_rgb, visuals[i].colormap_size, visuals[i].red_mask, visuals[i].green_mask, visuals[i].blue_mask, visuals[i].visualid)) { EPHYR_LOG_ERROR("failed to duplicate host visual %d\n", (int) visuals[i].visualid); } } is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } static int ProcXF86DRIQueryVersion(register ClientPtr client) { 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"); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); swapl(&rep.patchVersion); } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep); EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) { xXF86DRIQueryDirectRenderingCapableReply rep; Bool isCapable; REQUEST(xXF86DRIQueryDirectRenderingCapableReq); REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!ephyrDRIQueryDirectRenderingCapable(stuff->screen, &isCapable)) { return BadValue; } 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); swapl(&rep.length); } WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), &rep); EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIOpenConnection(register ClientPtr client) { xXF86DRIOpenConnectionReply rep; drm_handle_t hSAREA; char *busIdString = NULL; CARD32 busIdStringLength = 0; REQUEST(xXF86DRIOpenConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!ephyrDRIOpenConnection(stuff->screen, &hSAREA, &busIdString)) { return BadValue; } if (busIdString) busIdStringLength = strlen(busIdString); rep = (xXF86DRIOpenConnectionReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) + pad_to_int32(busIdStringLength)), .hSAREALow = (CARD32) (hSAREA & 0xffffffff), #if defined(LONG64) && !defined(__linux__) .hSAREAHigh = (CARD32) (hSAREA >> 32), #else .hSAREAHigh = 0, #endif .busIdStringLength = busIdStringLength }; WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep); if (busIdStringLength) WriteToClient(client, busIdStringLength, busIdString); free(busIdString); EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIAuthConnection(register ClientPtr client) { xXF86DRIAuthConnectionReply rep; REQUEST(xXF86DRIAuthConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } 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), &rep); EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRICloseConnection(register ClientPtr client) { REQUEST(xXF86DRICloseConnectionReq); REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } /* DRICloseConnection( screenInfo.screens[stuff->screen]); */ EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIGetClientDriverName(register ClientPtr client) { xXF86DRIGetClientDriverNameReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .clientDriverNameLength = 0 }; char *clientDriverName; REQUEST(xXF86DRIGetClientDriverNameReq); REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } ephyrDRIGetClientDriverName(stuff->screen, (int *) &rep.ddxDriverMajorVersion, (int *) &rep.ddxDriverMinorVersion, (int *) &rep.ddxDriverPatchVersion, &clientDriverName); if (clientDriverName) rep.clientDriverNameLength = strlen(clientDriverName); rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.clientDriverNameLength)); WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep); if (rep.clientDriverNameLength) WriteToClient(client, rep.clientDriverNameLength, clientDriverName); EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRICreateContext(register ClientPtr client) { xXF86DRICreateContextReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; ScreenPtr pScreen; VisualPtr visual; int i = 0; REQUEST(xXF86DRICreateContextReq); REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } pScreen = screenInfo.screens[stuff->screen]; visual = pScreen->visuals; /* Find the requested X visual */ for (i = 0; i < pScreen->numVisuals; i++, visual++) if (visual->vid == stuff->visual) break; if (i == pScreen->numVisuals) { /* No visual found */ return BadValue; } if (!ephyrDRICreateContext(stuff->screen, stuff->visual, stuff->context, (drm_context_t *) &rep.hHWContext)) { return BadValue; } WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep); EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIDestroyContext(register ClientPtr client) { REQUEST(xXF86DRIDestroyContextReq); REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!ephyrDRIDestroyContext(stuff->screen, stuff->context)) { return BadValue; } EPHYR_LOG("leave\n"); return Success; } static Bool getWindowVisual(const WindowPtr a_win, VisualPtr * a_visual) { int i = 0, visual_id = 0; EPHYR_RETURN_VAL_IF_FAIL(a_win && a_win->drawable.pScreen && a_win->drawable.pScreen->visuals, FALSE); visual_id = wVisual(a_win); for (i = 0; i < a_win->drawable.pScreen->numVisuals; i++) { if (a_win->drawable.pScreen->visuals[i].vid == visual_id) { *a_visual = &a_win->drawable.pScreen->visuals[i]; return TRUE; } } return FALSE; } #define NUM_WINDOW_PAIRS 256 static EphyrWindowPair window_pairs[NUM_WINDOW_PAIRS]; static Bool appendWindowPairToList(WindowPtr a_local, int a_remote) { int i = 0; EPHYR_RETURN_VAL_IF_FAIL(a_local, FALSE); EPHYR_LOG("(local,remote):(%p, %d)\n", a_local, a_remote); for (i = 0; i < NUM_WINDOW_PAIRS; i++) { if (window_pairs[i].local == NULL) { window_pairs[i].local = a_local; window_pairs[i].remote = a_remote; return TRUE; } } return FALSE; } static Bool findWindowPairFromLocal(WindowPtr a_local, EphyrWindowPair ** a_pair) { int i = 0; EPHYR_RETURN_VAL_IF_FAIL(a_pair && a_local, FALSE); for (i = 0; i < NUM_WINDOW_PAIRS; i++) { if (window_pairs[i].local == a_local) { *a_pair = &window_pairs[i]; EPHYR_LOG("found (%p, %d)\n", (*a_pair)->local, (*a_pair)->remote); return TRUE; } } return FALSE; } Bool findWindowPairFromRemote(int a_remote, EphyrWindowPair ** a_pair) { int i = 0; EPHYR_RETURN_VAL_IF_FAIL(a_pair, FALSE); for (i = 0; i < NUM_WINDOW_PAIRS; i++) { if (window_pairs[i].remote == a_remote) { *a_pair = &window_pairs[i]; EPHYR_LOG("found (%p, %d)\n", (*a_pair)->local, (*a_pair)->remote); return TRUE; } } return FALSE; } static Bool createHostPeerWindow(const WindowPtr a_win, int *a_peer_win) { Bool is_ok = FALSE; VisualPtr visual = NULL; EphyrBox geo; EPHYR_RETURN_VAL_IF_FAIL(a_win && a_peer_win, FALSE); EPHYR_RETURN_VAL_IF_FAIL(a_win->drawable.pScreen, FALSE); EPHYR_LOG("enter. a_win '%p'\n", a_win); if (!getWindowVisual(a_win, &visual)) { EPHYR_LOG_ERROR("failed to get window visual\n"); goto out; } if (!visual) { EPHYR_LOG_ERROR("failed to create visual\n"); goto out; } memset(&geo, 0, sizeof(geo)); geo.x = a_win->drawable.x; geo.y = a_win->drawable.y; geo.width = a_win->drawable.width; geo.height = a_win->drawable.height; if (!hostx_create_window(a_win->drawable.pScreen->myNum, &geo, visual->vid, a_peer_win)) { EPHYR_LOG_ERROR("failed to create host peer window\n"); goto out; } if (!appendWindowPairToList(a_win, *a_peer_win)) { EPHYR_LOG_ERROR("failed to append window to pair list\n"); goto out; } is_ok = TRUE; out: EPHYR_LOG("leave:remote win%d\n", *a_peer_win); return is_ok; } static Bool destroyHostPeerWindow(const WindowPtr a_win) { Bool is_ok = FALSE; EphyrWindowPair *pair = NULL; EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); EPHYR_LOG("enter\n"); if (!findWindowPairFromLocal(a_win, &pair) || !pair) { EPHYR_LOG_ERROR("failed to find peer to local window\n"); goto out; } hostx_destroy_window(pair->remote); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } static int ProcXF86DRICreateDrawable(ClientPtr client) { xXF86DRICreateDrawableReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; DrawablePtr drawable = NULL; WindowPtr window = NULL; EphyrWindowPair *pair = NULL; EphyrDRIWindowPrivPtr win_priv = NULL; int rc = 0, remote_win = 0; REQUEST(xXF86DRICreateDrawableReq); REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (drawable->type != DRAWABLE_WINDOW) { EPHYR_LOG_ERROR("non drawable windows are not yet supported\n"); return BadImplementation; } EPHYR_LOG("lookedup drawable %p\n", drawable); window = (WindowPtr) drawable; if (findWindowPairFromLocal(window, &pair) && pair) { remote_win = pair->remote; EPHYR_LOG("found window '%p' paire with remote '%d'\n", window, remote_win); } else if (!createHostPeerWindow(window, &remote_win)) { EPHYR_LOG_ERROR("failed to create host peer window\n"); return BadAlloc; } if (!ephyrDRICreateDrawable(stuff->screen, remote_win, (drm_drawable_t *) &rep.hHWDrawable)) { EPHYR_LOG_ERROR("failed to create dri drawable\n"); return BadValue; } win_priv = GET_EPHYR_DRI_WINDOW_PRIV(window); if (!win_priv) { win_priv = calloc(1, sizeof(EphyrDRIWindowPrivRec)); if (!win_priv) { EPHYR_LOG_ERROR("failed to allocate window private\n"); return BadAlloc; } dixSetPrivate(&window->devPrivates, ephyrDRIWindowKey, win_priv); EPHYR_LOG("paired window '%p' with remote '%d'\n", window, remote_win); } WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep); EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIDestroyDrawable(register ClientPtr client) { DrawablePtr drawable = NULL; WindowPtr window = NULL; EphyrWindowPair *pair = NULL; int rc = 0; REQUEST(xXF86DRIDestroyDrawableReq); REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (drawable->type != DRAWABLE_WINDOW) { EPHYR_LOG_ERROR("non drawable windows are not yet supported\n"); return BadImplementation; } window = (WindowPtr) drawable; if (!findWindowPairFromLocal(window, &pair) && pair) { EPHYR_LOG_ERROR("failed to find pair window\n"); return BadImplementation; } if (!ephyrDRIDestroyDrawable(stuff->screen, pair->remote /*drawable in host x */ )) { EPHYR_LOG_ERROR("failed to destroy dri drawable\n"); return BadImplementation; } pair->local = NULL; pair->remote = 0; EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIGetDrawableInfo(register ClientPtr client) { xXF86DRIGetDrawableInfoReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; DrawablePtr drawable; WindowPtr window = NULL; EphyrWindowPair *pair = NULL; int X = 0, Y = 0, W = 0, H = 0, backX = 0, backY = 0, rc = 0, i = 0; drm_clip_rect_t *clipRects = NULL; drm_clip_rect_t *backClipRects = NULL; REQUEST(xXF86DRIGetDrawableInfoReq); REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success || !drawable) { EPHYR_LOG_ERROR("could not get drawable\n"); return rc; } if (drawable->type != DRAWABLE_WINDOW) { EPHYR_LOG_ERROR("non windows type drawables are not yes supported\n"); return BadImplementation; } window = (WindowPtr) drawable; memset(&pair, 0, sizeof(pair)); if (!findWindowPairFromLocal(window, &pair) || !pair) { EPHYR_LOG_ERROR("failed to find remote peer drawable\n"); return BadMatch; } EPHYR_LOG("clip list of xephyr gl drawable:\n"); for (i = 0; i < RegionNumRects(&window->clipList); i++) { EPHYR_LOG("x1:%d, y1:%d, x2:%d, y2:%d\n", RegionRects(&window->clipList)[i].x1, RegionRects(&window->clipList)[i].y1, RegionRects(&window->clipList)[i].x2, RegionRects(&window->clipList)[i].y2); } if (!ephyrDRIGetDrawableInfo(stuff->screen, pair->remote /*the drawable in hostx */ , (unsigned int *) &rep.drawableTableIndex, (unsigned int *) &rep.drawableTableStamp, (int *) &X, (int *) &Y, (int *) &W, (int *) &H, (int *) &rep.numClipRects, &clipRects, &backX, &backY, (int *) &rep.numBackClipRects, &backClipRects)) { return BadValue; } EPHYR_LOG("num clip rects:%d, num back clip rects:%d\n", (int) rep.numClipRects, (int) rep.numBackClipRects); rep.drawableX = X; rep.drawableY = Y; rep.drawableWidth = W; rep.drawableHeight = H; rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) - SIZEOF(xGenericReply)); rep.backX = backX; rep.backY = backY; if (rep.numClipRects) { if (clipRects) { ScreenPtr pScreen = screenInfo.screens[stuff->screen]; EPHYR_LOG("clip list of host gl drawable:\n"); for (i = 0; i < rep.numClipRects; i++) { clipRects[i].x1 = max(clipRects[i].x1, 0); clipRects[i].y1 = max(clipRects[i].y1, 0); clipRects[i].x2 = min(clipRects[i].x2, pScreen->width + clipRects[i].x1); clipRects[i].y2 = min(clipRects[i].y2, pScreen->width + clipRects[i].y1); EPHYR_LOG("x1:%d, y1:%d, x2:%d, y2:%d\n", clipRects[i].x1, clipRects[i].y1, clipRects[i].x2, clipRects[i].y2); } } else { rep.numClipRects = 0; } } else { EPHYR_LOG("got zero host gl drawable clipping rects\n"); } rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; backClipRects = clipRects; rep.numBackClipRects = rep.numClipRects; if (rep.numBackClipRects) rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; EPHYR_LOG("num host clip rects:%d\n", (int) rep.numClipRects); EPHYR_LOG("num host back clip rects:%d\n", (int) rep.numBackClipRects); rep.length = bytes_to_int32(rep.length); WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep); if (rep.numClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, clipRects); } if (rep.numBackClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numBackClipRects, backClipRects); } free(clipRects); clipRects = NULL; EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIGetDeviceInfo(register ClientPtr client) { xXF86DRIGetDeviceInfoReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0 }; drm_handle_t hFrameBuffer; void *pDevPrivate; REQUEST(xXF86DRIGetDeviceInfoReq); REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); EPHYR_LOG("enter\n"); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!ephyrDRIGetDeviceInfo(stuff->screen, &hFrameBuffer, (int *) &rep.framebufferOrigin, (int *) &rep.framebufferSize, (int *) &rep.framebufferStride, (int *) &rep.devPrivateSize, &pDevPrivate)) { return BadValue; } rep.hFrameBufferLow = (CARD32) (hFrameBuffer & 0xffffffff); #if defined(LONG64) && !defined(__linux__) rep.hFrameBufferHigh = (CARD32) (hFrameBuffer >> 32); #else rep.hFrameBufferHigh = 0; #endif if (rep.devPrivateSize) { rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.devPrivateSize)); } WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep); if (rep.length) { WriteToClient(client, rep.devPrivateSize, pDevPrivate); } EPHYR_LOG("leave\n"); return Success; } static int ProcXF86DRIDispatch(register ClientPtr client) { REQUEST(xReq); EPHYR_LOG("enter\n"); switch (stuff->data) { case X_XF86DRIQueryVersion:{ EPHYR_LOG("leave\n"); return ProcXF86DRIQueryVersion(client); } case X_XF86DRIQueryDirectRenderingCapable:{ EPHYR_LOG("leave\n"); return ProcXF86DRIQueryDirectRenderingCapable(client); } } if (!client->local) return DRIErrorBase + XF86DRIClientNotLocal; switch (stuff->data) { case X_XF86DRIOpenConnection:{ EPHYR_LOG("leave\n"); return ProcXF86DRIOpenConnection(client); } case X_XF86DRICloseConnection:{ EPHYR_LOG("leave\n"); return ProcXF86DRICloseConnection(client); } case X_XF86DRIGetClientDriverName:{ EPHYR_LOG("leave\n"); return ProcXF86DRIGetClientDriverName(client); } case X_XF86DRICreateContext:{ EPHYR_LOG("leave\n"); return ProcXF86DRICreateContext(client); } case X_XF86DRIDestroyContext:{ EPHYR_LOG("leave\n"); return ProcXF86DRIDestroyContext(client); } case X_XF86DRICreateDrawable:{ EPHYR_LOG("leave\n"); return ProcXF86DRICreateDrawable(client); } case X_XF86DRIDestroyDrawable:{ EPHYR_LOG("leave\n"); return ProcXF86DRIDestroyDrawable(client); } case X_XF86DRIGetDrawableInfo:{ EPHYR_LOG("leave\n"); return ProcXF86DRIGetDrawableInfo(client); } case X_XF86DRIGetDeviceInfo:{ EPHYR_LOG("leave\n"); return ProcXF86DRIGetDeviceInfo(client); } case X_XF86DRIAuthConnection:{ EPHYR_LOG("leave\n"); return ProcXF86DRIAuthConnection(client); } /* {Open,Close}FullScreen are deprecated now */ default:{ EPHYR_LOG("leave\n"); return BadRequest; } } } static int SProcXF86DRIQueryVersion(register ClientPtr client) { REQUEST(xXF86DRIQueryVersionReq); swaps(&stuff->length); return ProcXF86DRIQueryVersion(client); } static int SProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) { REQUEST(xXF86DRIQueryDirectRenderingCapableReq); swaps(&stuff->length); swapl(&stuff->screen); return ProcXF86DRIQueryDirectRenderingCapable(client); } static int SProcXF86DRIDispatch(register ClientPtr client) { REQUEST(xReq); EPHYR_LOG("enter\n"); /* * Only local clients are allowed DRI access, but remote clients still need * these requests to find out cleanly. */ switch (stuff->data) { case X_XF86DRIQueryVersion:{ EPHYR_LOG("leave\n"); return SProcXF86DRIQueryVersion(client); } case X_XF86DRIQueryDirectRenderingCapable:{ EPHYR_LOG("leave\n"); return SProcXF86DRIQueryDirectRenderingCapable(client); } default:{ EPHYR_LOG("leave\n"); return DRIErrorBase + XF86DRIClientNotLocal; } } } Bool ephyrDRIExtensionInit(ScreenPtr a_screen) { Bool is_ok = FALSE; ExtensionEntry *extEntry = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EPHYR_LOG("enter\n"); if (!host_has_extension(&xcb_xf86dri_id)) { EPHYR_LOG("host does not have DRI extension\n"); goto out; } EPHYR_LOG("host X does have DRI extension\n"); if (!host_has_extension(&xcb_shape_id)) { EPHYR_LOG("host does not have XShape extension\n"); goto out; } EPHYR_LOG("host X does have XShape extension\n"); #ifdef XF86DRI_EVENTS EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvents"); if (!EventType) { EPHYR_LOG_ERROR("failed to register DRI event resource type\n"); goto out; } #endif if ((extEntry = AddExtension(XF86DRINAME, XF86DRINumberEvents, XF86DRINumberErrors, ProcXF86DRIDispatch, SProcXF86DRIDispatch, NULL, StandardMinorOpcode))) { DRIReqCode = (unsigned char) extEntry->base; DRIErrorBase = extEntry->errorBase; } else { EPHYR_LOG_ERROR("failed to register DRI extension\n"); goto out; } if (!dixRegisterPrivateKey(&ephyrDRIScreenKeyRec, PRIVATE_SCREEN, 0)) goto out; if (!dixRegisterPrivateKey(&ephyrDRIWindowKeyRec, PRIVATE_WINDOW, 0)) goto out; screen_priv = calloc(1, sizeof(EphyrDRIScreenPrivRec)); if (!screen_priv) { EPHYR_LOG_ERROR("failed to allocate screen_priv\n"); goto out; } dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv); if (!ephyrDRIScreenInit(a_screen)) { EPHYR_LOG_ERROR("ephyrDRIScreenInit() failed\n"); goto out; } EphyrMirrorHostVisuals(a_screen); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } xorg-server-1.17.1/hw/kdrive/ephyr/ephyrcursor.c0000664000175100017510000001711712406661137016610 00000000000000/* * Copyright © 2014 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. * * Author: * Adam Jackson */ #ifdef HAVE_CONFIG_H #include #endif #include "ephyr.h" #include "ephyrlog.h" #include "hostx.h" #include "cursorstr.h" #include #include static DevPrivateKeyRec ephyrCursorPrivateKey; typedef struct _ephyrCursor { xcb_cursor_t cursor; } ephyrCursorRec, *ephyrCursorPtr; static ephyrCursorPtr ephyrGetCursor(CursorPtr cursor) { return dixGetPrivateAddr(&cursor->devPrivates, &ephyrCursorPrivateKey); } static void ephyrRealizeCoreCursor(EphyrScrPriv *scr, CursorPtr cursor) { ephyrCursorPtr hw = ephyrGetCursor(cursor); xcb_connection_t *conn = hostx_get_xcbconn(); xcb_pixmap_t source, mask; xcb_image_t *image; xcb_gcontext_t gc; int w = cursor->bits->width, h = cursor->bits->height; uint32_t gcmask = XCB_GC_FUNCTION | XCB_GC_PLANE_MASK | XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_CLIP_MASK; uint32_t val[] = { XCB_GX_COPY, /* function */ ~0, /* planemask */ 1L, /* foreground */ 0L, /* background */ None, /* clipmask */ }; source = xcb_generate_id(conn); mask = xcb_generate_id(conn); xcb_create_pixmap(conn, 1, source, scr->win, w, h); xcb_create_pixmap(conn, 1, mask, scr->win, w, h); gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, source, gcmask, val); image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_XY_BITMAP, 1, NULL, ~0, NULL); image->data = cursor->bits->source; xcb_image_put(conn, source, gc, image, 0, 0, 0); xcb_image_destroy(image); image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_XY_BITMAP, 1, NULL, ~0, NULL); image->data = cursor->bits->mask; xcb_image_put(conn, mask, gc, image, 0, 0, 0); xcb_image_destroy(image); xcb_free_gc(conn, gc); hw->cursor = xcb_generate_id(conn); xcb_create_cursor(conn, hw->cursor, source, mask, cursor->foreRed, cursor->foreGreen, cursor->foreBlue, cursor->backRed, cursor->backGreen, cursor->backBlue, cursor->bits->xhot, cursor->bits->yhot); xcb_free_pixmap(conn, source); xcb_free_pixmap(conn, mask); } #ifdef ARGB_CURSOR static xcb_render_pictformat_t get_argb_format(void) { static xcb_render_pictformat_t format; if (format == None) { xcb_connection_t *conn = hostx_get_xcbconn(); xcb_render_query_pict_formats_cookie_t cookie; xcb_render_query_pict_formats_reply_t *formats; cookie = xcb_render_query_pict_formats(conn); formats = xcb_render_query_pict_formats_reply(conn, cookie, NULL); format = xcb_render_util_find_standard_format(formats, XCB_PICT_STANDARD_ARGB_32)->id; free(formats); } return format; } static void ephyrRealizeARGBCursor(EphyrScrPriv *scr, CursorPtr cursor) { ephyrCursorPtr hw = ephyrGetCursor(cursor); xcb_connection_t *conn = hostx_get_xcbconn(); xcb_gcontext_t gc; xcb_pixmap_t source; xcb_render_picture_t picture; xcb_image_t *image; int w = cursor->bits->width, h = cursor->bits->height; /* dix' storage is PICT_a8r8g8b8 */ source = xcb_generate_id(conn); xcb_create_pixmap(conn, 32, source, scr->win, w, h); gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, source, 0, NULL); image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_Z_PIXMAP, 32, NULL, ~0, NULL); image->data = (void *)cursor->bits->argb; xcb_image_put(conn, source, gc, image, 0, 0, 0); xcb_free_gc(conn, gc); xcb_image_destroy(image); picture = xcb_generate_id(conn); xcb_render_create_picture(conn, picture, source, get_argb_format(), 0, NULL); xcb_free_pixmap(conn, source); hw->cursor = xcb_generate_id(conn); xcb_render_create_cursor(conn, hw->cursor, picture, cursor->bits->xhot, cursor->bits->yhot); xcb_render_free_picture(conn, picture); } static Bool can_argb_cursor(void) { static const xcb_render_query_version_reply_t *v; if (!v) v = xcb_render_util_query_version(hostx_get_xcbconn()); return v->major_version == 0 && v->minor_version >= 5; } #endif static Bool ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor) { KdScreenPriv(screen); KdScreenInfo *kscr = pScreenPriv->screen; EphyrScrPriv *scr = kscr->driver; #ifdef ARGB_CURSOR if (cursor->bits->argb && can_argb_cursor()) ephyrRealizeARGBCursor(scr, cursor); else #endif { ephyrRealizeCoreCursor(scr, cursor); } return TRUE; } static Bool ephyrUnrealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor) { ephyrCursorPtr hw = ephyrGetCursor(cursor); if (hw->cursor) { xcb_free_cursor(hostx_get_xcbconn(), hw->cursor); hw->cursor = None; } return TRUE; } static void ephyrSetCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor, int x, int y) { KdScreenPriv(screen); KdScreenInfo *kscr = pScreenPriv->screen; EphyrScrPriv *scr = kscr->driver; uint32_t attr = None; if (cursor) attr = ephyrGetCursor(cursor)->cursor; else attr = hostx_get_empty_cursor(); xcb_change_window_attributes(hostx_get_xcbconn(), scr->win, XCB_CW_CURSOR, &attr); xcb_flush(hostx_get_xcbconn()); } static void ephyrMoveCursor(DeviceIntPtr dev, ScreenPtr screen, int x, int y) { } static Bool ephyrDeviceCursorInitialize(DeviceIntPtr dev, ScreenPtr screen) { return TRUE; } static void ephyrDeviceCursorCleanup(DeviceIntPtr dev, ScreenPtr screen) { } miPointerSpriteFuncRec EphyrPointerSpriteFuncs = { ephyrRealizeCursor, ephyrUnrealizeCursor, ephyrSetCursor, ephyrMoveCursor, ephyrDeviceCursorInitialize, ephyrDeviceCursorCleanup }; Bool ephyrCursorInit(ScreenPtr screen) { if (!dixRegisterPrivateKey(&ephyrCursorPrivateKey, PRIVATE_CURSOR_BITS, sizeof(ephyrCursorRec))) return FALSE; miPointerInitialize(screen, &EphyrPointerSpriteFuncs, &ephyrPointerScreenFuncs, FALSE); return TRUE; } xorg-server-1.17.1/hw/kdrive/ephyr/ephyr_glamor_xv.c0000664000175100017510000001250412372525300017414 00000000000000/* * Copyright © 2014 Intel Corporation * * 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_CONFIG_H #include #endif #include "kdrive.h" #include "kxv.h" #include "ephyr.h" #include "glamor_priv.h" #include #include "fourcc.h" #define NUM_FORMATS 3 static KdVideoFormatRec Formats[NUM_FORMATS] = { {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; static void ephyr_glamor_xv_stop_video(KdScreenInfo *screen, void *data, Bool cleanup) { if (!cleanup) return; glamor_xv_stop_video(data); } static int ephyr_glamor_xv_set_port_attribute(KdScreenInfo *screen, Atom attribute, INT32 value, void *data) { return glamor_xv_set_port_attribute(data, attribute, value); } static int ephyr_glamor_xv_get_port_attribute(KdScreenInfo *screen, Atom attribute, INT32 *value, void *data) { return glamor_xv_get_port_attribute(data, attribute, value); } static void ephyr_glamor_xv_query_best_size(KdScreenInfo *screen, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, void *data) { *p_w = drw_w; *p_h = drw_h; } static int ephyr_glamor_xv_query_image_attributes(KdScreenInfo *screen, int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets) { return glamor_xv_query_image_attributes(id, w, h, pitches, offsets); } static int ephyr_glamor_xv_put_image(KdScreenInfo *screen, DrawablePtr pDrawable, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, unsigned char *buf, short width, short height, Bool sync, RegionPtr clipBoxes, void *data) { return glamor_xv_put_image(data, pDrawable, src_x, src_y, drw_x, drw_y, src_w, src_h, drw_w, drw_h, id, buf, width, height, sync, clipBoxes); } void ephyr_glamor_xv_init(ScreenPtr screen) { KdVideoAdaptorRec *adaptor; glamor_port_private *port_privates; KdVideoEncodingRec encoding = { 0, "XV_IMAGE", /* These sizes should probably be GL_MAX_TEXTURE_SIZE instead * of 2048, but our context isn't set up yet. */ 2048, 2048, {1, 1} }; int i; glamor_xv_core_init(screen); adaptor = xnfcalloc(1, sizeof(*adaptor)); adaptor->name = "glamor textured video"; adaptor->type = XvWindowMask | XvInputMask | XvImageMask; adaptor->flags = 0; adaptor->nEncodings = 1; adaptor->pEncodings = &encoding; adaptor->pFormats = Formats; adaptor->nFormats = NUM_FORMATS; adaptor->nPorts = 16; /* Some absurd number */ port_privates = xnfcalloc(adaptor->nPorts, sizeof(glamor_port_private)); adaptor->pPortPrivates = xnfcalloc(adaptor->nPorts, sizeof(glamor_port_private *)); for (i = 0; i < adaptor->nPorts; i++) { adaptor->pPortPrivates[i].ptr = &port_privates[i]; glamor_xv_init_port(&port_privates[i]); } adaptor->pAttributes = glamor_xv_attributes; adaptor->nAttributes = glamor_xv_num_attributes; adaptor->pImages = glamor_xv_images; adaptor->nImages = glamor_xv_num_images; adaptor->StopVideo = ephyr_glamor_xv_stop_video; adaptor->SetPortAttribute = ephyr_glamor_xv_set_port_attribute; adaptor->GetPortAttribute = ephyr_glamor_xv_get_port_attribute; adaptor->QueryBestSize = ephyr_glamor_xv_query_best_size; adaptor->PutImage = ephyr_glamor_xv_put_image; adaptor->QueryImageAttributes = ephyr_glamor_xv_query_image_attributes; KdXVScreenInit(screen, adaptor, 1); } xorg-server-1.17.1/hw/kdrive/ephyr/ephyrhostglx.c0000664000175100017510000003566512456571574017005 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * a lots of the content of this file has been adapted from the mesa source * code. * Authors: * Dodji Seketeli */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "ephyrhostglx.h" #define _HAVE_XALLOC_DECLS #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, EPHYR_GET_VISUAL_CONFIGS }; static Bool ephyrHostGLXGetVisualConfigsInternal (enum VisualConfRequestType a_type, xcb_glx_get_visual_configs_reply_t *reply, int32_t a_screen, int32_t *a_num_visuals, int32_t *a_num_props, int32_t *a_props_buf_size, int32_t **a_props_buf); Bool ephyrHostGLXQueryVersion(int *a_major, int *a_minor) { Bool is_ok = FALSE; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_glx_query_version_cookie_t cookie; xcb_glx_query_version_reply_t *reply; 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; } /* Send the glXQueryVersion request */ cookie = xcb_glx_query_version(conn, 2, 1); reply = xcb_glx_query_version_reply(conn, cookie, NULL); if (!reply) goto out; *a_major = reply->major_version; *a_minor = reply->minor_version; free(reply); EPHYR_LOG("major:%d, minor:%d\n", *a_major, *a_minor); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } Bool ephyrHostGLXGetString(int a_context_tag, int a_string_name, char **a_string) { Bool is_ok = FALSE; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_glx_get_string_cookie_t cookie; xcb_glx_get_string_reply_t *reply; EPHYR_RETURN_VAL_IF_FAIL(conn && a_string, FALSE); EPHYR_LOG("enter\n"); cookie = xcb_glx_get_string(conn, a_context_tag, a_string_name); reply = xcb_glx_get_string_reply(conn, cookie, NULL); if (!reply) goto out; *a_string = malloc(reply->n + 1); memcpy(*a_string, xcb_glx_get_string_string(reply), reply->n); (*a_string)[reply->n] = '\0'; free(reply); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } Bool ephyrHostGLXQueryServerString(int a_screen_number, int a_string_name, char **a_string) { Bool is_ok = FALSE; xcb_connection_t *conn = hostx_get_xcbconn(); int default_screen = hostx_get_screen(); xcb_glx_query_server_string_cookie_t cookie; xcb_glx_query_server_string_reply_t *reply; EPHYR_RETURN_VAL_IF_FAIL(conn && a_string, FALSE); EPHYR_LOG("enter\n"); cookie = xcb_glx_query_server_string(conn, default_screen, a_string_name); reply = xcb_glx_query_server_string_reply(conn, cookie, NULL); if (!reply) goto out; *a_string = malloc(reply->str_len + 1); memcpy(*a_string, xcb_glx_query_server_string_string(reply), reply->str_len); (*a_string)[reply->str_len] = '\0'; free(reply); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } static Bool ephyrHostGLXGetVisualConfigsInternal(enum VisualConfRequestType a_type, xcb_glx_get_visual_configs_reply_t *reply, int32_t a_screen, int32_t * a_num_visuals, int32_t * a_num_props, int32_t * a_props_buf_size, int32_t ** a_props_buf) { Bool is_ok = FALSE; int num_props = 0, num_visuals = 0, props_buf_size = 0; int props_per_visual_size = 0; int32_t *props_buf = NULL; if (!reply->num_visuals) { EPHYR_LOG_ERROR("screen does not support GL rendering\n"); goto out; } num_visuals = reply->num_visuals; num_props = reply->num_properties; if (a_type != EPHYR_GET_VISUAL_CONFIGS) { num_props *= 2; } props_per_visual_size = num_props * sizeof(uint32_t); props_buf_size = props_per_visual_size * reply->num_visuals; props_buf = malloc(props_buf_size); if (!props_buf) goto out; memcpy(props_buf, xcb_glx_get_visual_configs_property_list(reply), props_buf_size); *a_num_visuals = num_visuals; *a_num_props = reply->num_properties; *a_props_buf_size = props_buf_size; *a_props_buf = props_buf; is_ok = TRUE; out: return is_ok; } Bool ephyrHostGLXGetVisualConfigs(int32_t a_screen, int32_t * a_num_visuals, int32_t * a_num_props, int32_t * a_props_buf_size, int32_t ** a_props_buf) { Bool is_ok = FALSE; xcb_glx_get_visual_configs_cookie_t cookie; xcb_glx_get_visual_configs_reply_t *reply; xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); EPHYR_LOG("enter\n"); cookie = xcb_glx_get_visual_configs(conn, screen); reply = xcb_glx_get_visual_configs_reply(conn, cookie, NULL); if (!reply) goto out; is_ok = ephyrHostGLXGetVisualConfigsInternal (EPHYR_GET_VISUAL_CONFIGS, reply, a_screen, a_num_visuals, a_num_props, a_props_buf_size, a_props_buf); out: free(reply); EPHYR_LOG("leave:%d\n", is_ok); return is_ok; } Bool ephyrHostGLXVendorPrivGetFBConfigsSGIX(int a_screen, int32_t * a_num_visuals, int32_t * a_num_props, int32_t * a_props_buf_size, int32_t ** a_props_buf) { Bool is_ok=FALSE; xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); xcb_glx_vendor_private_with_reply_cookie_t cookie; union { xcb_glx_vendor_private_with_reply_reply_t *vprep; xcb_glx_get_visual_configs_reply_t *rep; } reply; EPHYR_LOG("enter\n"); cookie = xcb_glx_vendor_private_with_reply(conn, X_GLXvop_GetFBConfigsSGIX, 0, 4, (uint8_t *)&screen); reply.vprep = xcb_glx_vendor_private_with_reply_reply(conn, cookie, NULL); if (!reply.vprep) goto out; is_ok = ephyrHostGLXGetVisualConfigsInternal (EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX, reply.rep, a_screen, a_num_visuals, a_num_props, a_props_buf_size, a_props_buf); out: free(reply.vprep); EPHYR_LOG("leave\n"); return is_ok; } Bool ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, const char *a_extension_list) { xcb_connection_t *conn = hostx_get_xcbconn(); int size; EPHYR_RETURN_VAL_IF_FAIL(conn && a_extension_list, FALSE); size = strlen (a_extension_list) + 1; xcb_glx_client_info(conn, a_major, a_minor, size, a_extension_list); return TRUE; } Bool ephyrHostGLXCreateContext(int a_screen, int a_generic_id, int a_context_id, int a_share_list_ctxt_id, int a_render_type, Bool a_direct, int code) { xcb_connection_t *conn = hostx_get_xcbconn(); Bool is_ok = FALSE; int remote_context_id = 0; 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", remote_context_id); goto out; } switch (code) { case X_GLXCreateContext: { xcb_glx_create_context(conn, remote_context_id, a_generic_id, hostx_get_screen(), a_share_list_ctxt_id, a_direct); } case X_GLXCreateNewContext: { xcb_glx_create_new_context(conn, remote_context_id, a_generic_id, hostx_get_screen(), a_render_type, a_share_list_ctxt_id, a_direct); } default: /* This should never be reached !*/ EPHYR_LOG("Internal error! Invalid CreateContext code!\n"); } is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } Bool ephyrHostDestroyContext(int a_ctxt_id) { xcb_connection_t *conn = hostx_get_xcbconn(); Bool is_ok = FALSE; int remote_ctxt_id = 0; EPHYR_LOG("enter:%d\n", a_ctxt_id); if (!hostx_get_resource_id_peer(a_ctxt_id, &remote_ctxt_id)) { EPHYR_LOG_ERROR("failed to get remote glx ctxt id\n"); goto out; } EPHYR_LOG("host context id:%d\n", remote_ctxt_id); xcb_glx_destroy_context(conn, remote_ctxt_id); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } Bool ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, int a_glx_ctxt_id, int a_old_ctxt_tag, int *a_ctxt_tag) { xcb_connection_t *conn = hostx_get_xcbconn(); Bool is_ok = FALSE; int remote_glx_ctxt_id = 0; EPHYR_RETURN_VAL_IF_FAIL(a_ctxt_tag, FALSE); 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 (!hostx_get_resource_id_peer(a_glx_ctxt_id, &remote_glx_ctxt_id)) { EPHYR_LOG_ERROR("failed to get remote glx ctxt id\n"); goto out; } /* 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) { xcb_glx_make_current_cookie_t cookie; xcb_glx_make_current_reply_t *reply; cookie = xcb_glx_make_current(conn, a_drawable, remote_glx_ctxt_id, a_old_ctxt_tag); reply = xcb_glx_make_current_reply(conn, cookie, NULL); if (!reply) goto out; *a_ctxt_tag = reply->context_tag; free(reply); } else if (glx_major > 1 || glx_minor >= 3) { xcb_glx_make_context_current_cookie_t cookie; xcb_glx_make_context_current_reply_t *reply; cookie = xcb_glx_make_context_current(conn, a_old_ctxt_tag, a_drawable, a_readable, remote_glx_ctxt_id); reply = xcb_glx_make_context_current_reply(conn, cookie, NULL); if (!reply) goto out; *a_ctxt_tag = reply->context_tag; free(reply); } else { xcb_glx_vendor_private_with_reply_cookie_t cookie; xcb_glx_vendor_private_with_reply_reply_t *reply; uint32_t data[3] = { a_drawable, a_readable, remote_glx_ctxt_id, }; EPHYR_LOG("enter\n"); cookie = xcb_glx_vendor_private_with_reply(conn, X_GLXvop_MakeCurrentReadSGI, a_old_ctxt_tag, sizeof(data), (uint8_t *)data); reply = xcb_glx_vendor_private_with_reply_reply(conn, cookie, NULL); *a_ctxt_tag = reply->retval; free(reply); } EPHYR_LOG("context tag:%d\n", *a_ctxt_tag); is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } Bool ephyrHostGetIntegerValue(int a_current_context_tag, int a_int, int *a_val) { xcb_connection_t *conn = hostx_get_xcbconn(); Bool is_ok = FALSE; int size = 0; xcb_glx_get_integerv_cookie_t cookie; xcb_glx_get_integerv_reply_t *reply; EPHYR_RETURN_VAL_IF_FAIL(a_val, FALSE); EPHYR_LOG("enter\n"); cookie = xcb_glx_get_integerv(conn, a_current_context_tag, a_int); reply = xcb_glx_get_integerv_reply(conn, cookie, NULL); if (!reply) goto out; size = reply->n; if (!size) { EPHYR_LOG_ERROR("X_GLsop_GetIngerv failed\n"); goto out; } *a_val = reply->datum; is_ok = TRUE; out: free(reply); EPHYR_LOG("leave\n"); return is_ok; } Bool ephyrHostIsContextDirect(int a_ctxt_id, int *a_is_direct) { Bool is_ok = FALSE; xcb_connection_t *conn = hostx_get_xcbconn(); xcb_glx_is_direct_cookie_t cookie; xcb_glx_is_direct_reply_t *reply = NULL; int remote_glx_ctxt_id = 0; EPHYR_LOG("enter\n"); if (!hostx_get_resource_id_peer (a_ctxt_id, &remote_glx_ctxt_id)) { EPHYR_LOG_ERROR ("failed to get remote glx ctxt id\n"); goto out; } /* Send the glXIsDirect request */ cookie = xcb_glx_is_direct(conn, remote_glx_ctxt_id); reply = xcb_glx_is_direct_reply(conn, cookie, NULL); if (!reply) { EPHYR_LOG_ERROR("fail in reading reply from host\n"); goto out; } *a_is_direct = reply->is_direct; is_ok = TRUE; out: free(reply); EPHYR_LOG("leave\n"); return is_ok; } xorg-server-1.17.1/hw/kdrive/ephyr/ephyrdri.h0000664000175100017510000000652512456571574016071 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifndef __EPHYRDRI_H__ #define __EPHYRDRI_H__ #include Bool ephyrDRIQueryDirectRenderingCapable(int a_screen, Bool *a_is_capable); Bool ephyrDRIOpenConnection(int screen, drm_handle_t * a_sarea, char **a_bus_id_string); Bool ephyrDRIAuthConnection(int a_screen, drm_magic_t a_magic); Bool ephyrDRICloseConnection(int a_screen); Bool ephyrDRIGetClientDriverName(int a_screen, int *a_ddx_driver_major_version, int *a_ddx_driver_minor_version, int *a_ddx_driver_patch_version, char **a_client_driver_name); Bool ephyrDRICreateContext(int a_screen, int a_visual_id, CARD32 ctx_id, drm_context_t * a_hw_ctx); Bool ephyrDRIDestroyContext(int a_screen, int a_context_id); Bool ephyrDRICreateDrawable(int a_screen, int a_drawable, drm_drawable_t * a_hw_drawable); Bool ephyrDRIDestroyDrawable(int a_screen, int a_drawable); Bool ephyrDRIGetDrawableInfo(int a_screen, int /*Drawable */ a_drawable, unsigned int *a_index, unsigned int *a_stamp, int *a_x, int *a_y, int *a_w, int *a_h, int *a_num_clip_rects, drm_clip_rect_t ** a_clip_rects, int *a_back_x, int *a_back_y, int *num_back_clip_rects, drm_clip_rect_t ** a_back_clip_rects); Bool ephyrDRIGetDeviceInfo(int a_screen, drm_handle_t * a_frame_buffer, int *a_fb_origin, int *a_fb_size, int *a_fb_stride, int *a_dev_private_size, void **a_dev_private); #endif /*__EPHYRDRI_H__*/ xorg-server-1.17.1/hw/kdrive/ephyr/ephyrdriext.h0000664000175100017510000000313312456571574016602 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifndef __EPHYRDRIEXT_H__ #define __EPHYRDRIEXT_H__ typedef struct { WindowPtr local; int remote; } EphyrWindowPair; Bool ephyrDRIExtensionInit(ScreenPtr a_screen); Bool findWindowPairFromRemote(int a_remote, EphyrWindowPair ** a_pair); #endif /*__EPHYRDRIEXT_H__*/ xorg-server-1.17.1/hw/kdrive/ephyr/hostx.h0000664000175100017510000001203212456571574015376 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2004 Nokia * * 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 Nokia not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Nokia makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL NOKIA 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. */ #ifndef _XLIBS_STUFF_H_ #define _XLIBS_STUFF_H_ #include #include #include #include #include "ephyr.h" #define EPHYR_WANT_DEBUG 0 #if (EPHYR_WANT_DEBUG) #define EPHYR_DBG(x, a...) \ fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a) #else #define EPHYR_DBG(x, a...) do {} while (0) #endif typedef struct EphyrHostXVars EphyrHostXVars; typedef struct { int minKeyCode; int maxKeyCode; } EphyrKeySyms; typedef struct { VisualID visualid; int screen; int depth; int class; unsigned long red_mask; unsigned long green_mask; unsigned long blue_mask; int colormap_size; int bits_per_rgb; } EphyrHostVisualInfo; typedef struct { int x, y; int width, height; int visualid; } EphyrHostWindowAttributes; typedef struct { int x, y, width, height; } EphyrBox; typedef struct { short x1, y1, x2, y2; } EphyrRect; int hostx_want_screen_geometry(KdScreenInfo *screen, int *width, int *height, int *x, int *y); int hostx_want_host_cursor(void); void hostx_use_sw_cursor(void); xcb_cursor_t hostx_get_empty_cursor(void); void hostx_get_output_geometry(const char *output, int *x, int *y, int *width, int *height); void hostx_use_fullscreen(void); int hostx_want_fullscreen(void); int hostx_want_preexisting_window(KdScreenInfo *screen); void hostx_use_preexisting_window(unsigned long win_id); void hostx_use_resname(char *name, int fromcmd); void hostx_set_title(char *name); void hostx_handle_signal(int signum); int hostx_init(void); void hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Bool use_geometry, const char *output); void hostx_set_display_name(char *name); void hostx_set_screen_number(KdScreenInfo *screen, int number); void hostx_set_win_title(KdScreenInfo *screen, const char *extra_text); int hostx_get_depth(void); int hostx_get_server_depth(KdScreenInfo *screen); int hostx_get_bpp(KdScreenInfo *screen); void hostx_get_visual_masks(KdScreenInfo *screen, CARD32 *rmsk, CARD32 *gmsk, CARD32 *bmsk); void hostx_set_cmap_entry(ScreenPtr pScreen, unsigned char idx, unsigned char r, unsigned char g, unsigned char b); void *hostx_screen_init(KdScreenInfo *screen, int x, int y, int width, int height, int buffer_height, int *bytes_per_line, int *bits_per_pixel); void hostx_paint_rect(KdScreenInfo *screen, int sx, int sy, int dx, int dy, int width, int height); void hostx_load_keymap(void); xcb_connection_t * hostx_get_xcbconn(void); int hostx_get_screen(void); int hostx_get_window(int a_screen_number); int hostx_get_window_attributes(int a_window, EphyrHostWindowAttributes * a_attr); int hostx_get_visuals_info(EphyrHostVisualInfo ** a_visuals, int *a_num_entries); int hostx_create_window(int a_screen_number, EphyrBox * a_geometry, int a_visual_id, int *a_host_win /*out parameter */ ); int hostx_destroy_window(int a_win); int hostx_set_window_geometry(int a_win, EphyrBox * a_geo); int hostx_set_window_bounding_rectangles(int a_window, EphyrRect * a_rects, int a_num_rects); int host_has_extension(xcb_extension_t *extension); #ifdef XF86DRI int hostx_lookup_peer_window(void *a_local_window, int *a_host_peer /*out parameter */ ); int hostx_allocate_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id); int hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id); int hostx_has_dri(void); int hostx_has_glx(void); #endif /* XF86DRI */ #endif /*_XLIBS_STUFF_H_*/ xorg-server-1.17.1/hw/kdrive/ephyr/ephyrdri.c0000664000175100017510000002773012456571574016065 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "hostx.h" #include "ephyrdri.h" #define _HAVE_XALLOC_DECLS #include "ephyrlog.h" #include "dixstruct.h" #include "pixmapstr.h" #ifndef TRUE #define TRUE 1 #endif /*TRUE*/ #ifndef FALSE #define FALSE 0 #endif /*FALSE*/ Bool ephyrDRIQueryDirectRenderingCapable(int a_screen, Bool *a_is_capable) { xcb_connection_t *conn = hostx_get_xcbconn(); Bool is_ok = FALSE; xcb_xf86dri_query_direct_rendering_capable_cookie_t cookie; xcb_xf86dri_query_direct_rendering_capable_reply_t *reply; EPHYR_RETURN_VAL_IF_FAIL(a_is_capable, FALSE); EPHYR_LOG("enter\n"); cookie = xcb_xf86dri_query_direct_rendering_capable(conn, hostx_get_screen()); reply = xcb_xf86dri_query_direct_rendering_capable_reply(conn, cookie, NULL); if (reply) { is_ok = TRUE; *a_is_capable = reply->is_capable; free(reply); } EPHYR_LOG("leave. is_capable:%d, is_ok=%d\n", *a_is_capable, is_ok); return is_ok; } Bool ephyrDRIOpenConnection(int a_screen, drm_handle_t * a_sarea, char **a_bus_id_string) { xcb_connection_t *conn = hostx_get_xcbconn(); Bool is_ok = FALSE; xcb_xf86dri_open_connection_cookie_t cookie; xcb_xf86dri_open_connection_reply_t *reply; EPHYR_RETURN_VAL_IF_FAIL(a_bus_id_string, FALSE); EPHYR_LOG("enter. screen:%d\n", a_screen); cookie = xcb_xf86dri_open_connection(conn, hostx_get_screen()); reply = xcb_xf86dri_open_connection_reply(conn, cookie, NULL); if (!reply) goto out; *a_sarea = reply->sarea_handle_low; if (sizeof(drm_handle_t) == 8) { int shift = 32; *a_sarea |= ((drm_handle_t) reply->sarea_handle_high) << shift; } *a_bus_id_string = malloc(reply->bus_id_len + 1); if (!*a_bus_id_string) goto out; memcpy(*a_bus_id_string, xcb_xf86dri_open_connection_bus_id(reply), reply->bus_id_len); *a_bus_id_string[reply->bus_id_len] = '\0'; is_ok = TRUE; out: free(reply); EPHYR_LOG("leave. bus_id_string:%s, is_ok:%d\n", *a_bus_id_string, is_ok); return is_ok; } Bool ephyrDRIAuthConnection(int a_screen, drm_magic_t a_magic) { xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); xcb_xf86dri_auth_connection_cookie_t cookie; xcb_xf86dri_auth_connection_reply_t *reply; Bool is_ok = FALSE; EPHYR_LOG("enter\n"); cookie = xcb_xf86dri_auth_connection(conn, screen, a_magic); reply = xcb_xf86dri_auth_connection_reply(conn, cookie, NULL); is_ok = reply->authenticated; free(reply); EPHYR_LOG("leave. is_ok:%d\n", is_ok); return is_ok; } Bool ephyrDRICloseConnection(int a_screen) { xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); EPHYR_LOG("enter\n"); xcb_xf86dri_close_connection(conn, screen); EPHYR_LOG("leave\n"); return TRUE; } Bool ephyrDRIGetClientDriverName(int a_screen, int *a_ddx_driver_major_version, int *a_ddx_driver_minor_version, int *a_ddx_driver_patch_version, char **a_client_driver_name) { xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); xcb_xf86dri_get_client_driver_name_cookie_t cookie; xcb_xf86dri_get_client_driver_name_reply_t *reply; Bool is_ok = FALSE; EPHYR_RETURN_VAL_IF_FAIL(a_ddx_driver_major_version && a_ddx_driver_minor_version && a_ddx_driver_patch_version && a_client_driver_name, FALSE); EPHYR_LOG("enter\n"); cookie = xcb_xf86dri_get_client_driver_name(conn, screen); reply = xcb_xf86dri_get_client_driver_name_reply(conn, cookie, NULL); if (!reply) goto out; *a_ddx_driver_major_version = reply->client_driver_major_version; *a_ddx_driver_minor_version = reply->client_driver_minor_version; *a_ddx_driver_patch_version = reply->client_driver_patch_version; *a_client_driver_name = malloc(reply->client_driver_name_len + 1); if (!*a_client_driver_name) goto out; memcpy(*a_client_driver_name, xcb_xf86dri_get_client_driver_name_client_driver_name(reply), reply->client_driver_name_len); (*a_client_driver_name)[reply->client_driver_name_len] = '\0'; is_ok = TRUE; EPHYR_LOG("major:%d, minor:%d, patch:%d, name:%s\n", *a_ddx_driver_major_version, *a_ddx_driver_minor_version, *a_ddx_driver_patch_version, *a_client_driver_name); out: free(reply); EPHYR_LOG("leave:%d\n", is_ok); return is_ok; } Bool ephyrDRICreateContext(int a_screen, int a_visual_id, CARD32 ctxt_id, drm_context_t * a_hw_ctxt) { xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); Bool is_ok = FALSE; xcb_xf86dri_create_context_cookie_t cookie; xcb_xf86dri_create_context_reply_t *reply; ctxt_id = xcb_generate_id(conn); EPHYR_LOG("enter. screen:%d, visual:%d\n", a_screen, a_visual_id); cookie = xcb_xf86dri_create_context(conn, screen, a_visual_id, ctxt_id); reply = xcb_xf86dri_create_context_reply(conn, cookie, NULL); if (!reply) goto out; *a_hw_ctxt = reply->hw_context; is_ok = TRUE; out: free(reply); EPHYR_LOG("leave:%d\n", is_ok); return is_ok; } Bool ephyrDRIDestroyContext(int a_screen, int a_context_id) { xcb_connection_t *conn = hostx_get_xcbconn (); int screen = hostx_get_screen(); EPHYR_LOG("enter\n"); xcb_xf86dri_destroy_context(conn, screen, a_context_id); EPHYR_LOG("leave\n"); return TRUE; } Bool ephyrDRICreateDrawable(int a_screen, int a_drawable, drm_drawable_t * a_hw_drawable) { Bool is_ok = FALSE; xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); xcb_xf86dri_create_drawable_cookie_t cookie; xcb_xf86dri_create_drawable_reply_t *reply; EPHYR_LOG("enter\n"); cookie = xcb_xf86dri_create_drawable(conn, screen, a_drawable); reply = xcb_xf86dri_create_drawable_reply(conn, cookie, NULL); if (!reply) goto out; *a_hw_drawable = reply->hw_drawable_handle; is_ok = TRUE; out: free(reply); EPHYR_LOG("leave. is_ok:%d\n", is_ok); return is_ok; } Bool ephyrDRIDestroyDrawable(int a_screen, int a_drawable) { EPHYR_LOG("enter\n"); EPHYR_LOG_ERROR("not implemented yet\n"); EPHYR_LOG("leave\n"); return FALSE; } Bool ephyrDRIGetDrawableInfo(int a_screen, int a_drawable, unsigned int *a_index, unsigned int *a_stamp, int *a_x, int *a_y, int *a_w, int *a_h, int *a_num_clip_rects, drm_clip_rect_t ** a_clip_rects, int *a_back_x, int *a_back_y, int *a_num_back_clip_rects, drm_clip_rect_t ** a_back_clip_rects) { Bool is_ok = FALSE; xcb_connection_t *conn = hostx_get_xcbconn(); int screen = hostx_get_screen(); xcb_xf86dri_get_drawable_info_cookie_t cookie; xcb_xf86dri_get_drawable_info_reply_t *reply = NULL; EphyrHostWindowAttributes attrs; EPHYR_RETURN_VAL_IF_FAIL(a_x && a_y && a_w && a_h && a_num_clip_rects, FALSE); EPHYR_LOG("enter\n"); memset(&attrs, 0, sizeof(attrs)); if (!hostx_get_window_attributes(a_drawable, &attrs)) { EPHYR_LOG_ERROR("failed to query host window attributes\n"); goto out; } cookie = xcb_xf86dri_get_drawable_info(conn, screen, a_drawable); reply = xcb_xf86dri_get_drawable_info_reply(conn, cookie, NULL); if (!reply) { EPHYR_LOG_ERROR ("XF86DRIGetDrawableInfo ()\n"); goto out; } *a_index = reply->drawable_table_index; *a_stamp = reply->drawable_table_stamp; *a_x = reply->drawable_origin_X; *a_y = reply->drawable_origin_Y; *a_w = reply->drawable_size_W; *a_h = reply->drawable_size_H; *a_num_clip_rects = reply->num_clip_rects; *a_clip_rects = calloc(*a_num_clip_rects, sizeof(drm_clip_rect_t)); memcpy(*a_clip_rects, xcb_xf86dri_get_drawable_info_clip_rects(reply), *a_num_clip_rects * sizeof(drm_clip_rect_t)); EPHYR_LOG("host x,y,w,h: (%d,%d,%d,%d)\n", *a_x, *a_y, *a_w, *a_h); if (*a_num_clip_rects) { free(*a_back_clip_rects); *a_back_clip_rects = calloc(*a_num_clip_rects, sizeof(drm_clip_rect_t)); memmove(*a_back_clip_rects, *a_clip_rects, *a_num_clip_rects * sizeof(drm_clip_rect_t)); *a_num_back_clip_rects = *a_num_clip_rects; } EPHYR_LOG("num back clip rects:%d, num clip rects:%d\n", *a_num_clip_rects, *a_num_back_clip_rects); *a_back_x = *a_x; *a_back_y = *a_y; *a_w = attrs.width; *a_h = attrs.height; is_ok = TRUE; out: EPHYR_LOG("leave. index:%d, stamp:%d, x,y:(%d,%d), w,y:(%d,%d)\n", *a_index, *a_stamp, *a_x, *a_y, *a_w, *a_h); free(reply); return is_ok; } Bool ephyrDRIGetDeviceInfo(int a_screen, drm_handle_t * a_frame_buffer, int *a_fb_origin, int *a_fb_size, int *a_fb_stride, int *a_dev_private_size, void **a_dev_private) { Bool is_ok = FALSE; xcb_connection_t *conn = hostx_get_xcbconn (); int screen = hostx_get_screen(); xcb_xf86dri_get_device_info_cookie_t cookie; xcb_xf86dri_get_device_info_reply_t *reply; EPHYR_RETURN_VAL_IF_FAIL(conn, FALSE); EPHYR_LOG("enter\n"); cookie = xcb_xf86dri_get_device_info(conn, screen); reply = xcb_xf86dri_get_device_info_reply(conn, cookie, NULL); if (!reply) goto out; *a_frame_buffer = reply->framebuffer_handle_low; if (sizeof(drm_handle_t) == 8) { int shift = 32; *a_frame_buffer |= ((drm_handle_t)reply->framebuffer_handle_high) << shift; } *a_fb_origin = reply->framebuffer_origin_offset; *a_fb_size = reply->framebuffer_size; *a_fb_stride = reply->framebuffer_stride; *a_dev_private_size = reply->device_private_size; *a_dev_private = calloc(reply->device_private_size, 1); if (!*a_dev_private) goto out; memcpy(*a_dev_private, xcb_xf86dri_get_device_info_device_private(reply), reply->device_private_size); is_ok = TRUE; out: free(reply); EPHYR_LOG("leave:%d\n", is_ok); return is_ok; } xorg-server-1.17.1/hw/kdrive/ephyr/ephyr_glamor_glx.h0000664000175100017510000000456612403440762017572 00000000000000/* * Copyright © 2013 Intel Corporation * * 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. */ /** * ephyr_glamor_glx.h * * Prototypes exposed by ephyr_glamor_glx.c, without including any * server headers. */ #include #include "dix-config.h" struct ephyr_glamor; struct pixman_region16; xcb_connection_t * ephyr_glamor_connect(void); void ephyr_glamor_set_texture(struct ephyr_glamor *ephyr_glamor, uint32_t tex); xcb_visualtype_t * ephyr_glamor_get_visual(void); struct ephyr_glamor * ephyr_glamor_glx_screen_init(xcb_window_t win); void ephyr_glamor_glx_screen_fini(struct ephyr_glamor *glamor); #ifdef GLAMOR void ephyr_glamor_set_window_size(struct ephyr_glamor *glamor, unsigned width, unsigned height); void ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, struct pixman_region16 *damage); void ephyr_glamor_process_event(xcb_generic_event_t *xev); #else /* !GLAMOR */ static inline void ephyr_glamor_set_window_size(struct ephyr_glamor *glamor, unsigned width, unsigned height) { } static inline void ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, struct pixman_region16 *damage) { } static inline void ephyr_glamor_process_event(xcb_generic_event_t *xev) { } #endif /* !GLAMOR */ xorg-server-1.17.1/hw/kdrive/ephyr/ephyr.c0000664000175100017510000011324412456571574015362 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2004 Nokia * * 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 Nokia not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Nokia makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL NOKIA 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_CONFIG_H #include #endif #include #include #include "ephyr.h" #include "inputstr.h" #include "scrnintstr.h" #include "ephyrlog.h" #ifdef XF86DRI #include #include "ephyrdri.h" #include "ephyrdriext.h" #include "ephyrglxext.h" #endif /* XF86DRI */ #ifdef GLAMOR #include "glamor.h" #endif #include "ephyr_glamor_glx.h" #include "xkbsrv.h" extern int KdTsPhyScreen; extern Bool ephyr_glamor; KdKeyboardInfo *ephyrKbd; KdPointerInfo *ephyrMouse; EphyrKeySyms ephyrKeySyms; Bool ephyrNoDRI = FALSE; Bool ephyrNoXV = FALSE; static int mouseState = 0; static Rotation ephyrRandr = RR_Rotate_0; typedef struct _EphyrInputPrivate { Bool enabled; } EphyrKbdPrivate, EphyrPointerPrivate; Bool EphyrWantGrayScale = 0; Bool EphyrWantResize = 0; Bool EphyrWantNoHostGrab = 0; Bool host_has_extension(xcb_extension_t *extension) { const xcb_query_extension_reply_t *rep; rep = xcb_get_extension_data(hostx_get_xcbconn(), extension); return rep && rep->present; } Bool ephyrInitialize(KdCardInfo * card, EphyrPriv * priv) { OsSignal(SIGUSR1, hostx_handle_signal); priv->base = 0; priv->bytes_per_line = 0; return TRUE; } Bool ephyrCardInit(KdCardInfo * card) { EphyrPriv *priv; priv = (EphyrPriv *) malloc(sizeof(EphyrPriv)); if (!priv) return FALSE; if (!ephyrInitialize(card, priv)) { free(priv); return FALSE; } card->driver = priv; return TRUE; } Bool ephyrScreenInitialize(KdScreenInfo *screen) { EphyrScrPriv *scrpriv = screen->driver; int x = 0, y = 0; int width = 640, height = 480; CARD32 redMask, greenMask, blueMask; if (hostx_want_screen_geometry(screen, &width, &height, &x, &y) || !screen->width || !screen->height) { screen->width = width; screen->height = height; screen->x = x; screen->y = y; } if (EphyrWantGrayScale) screen->fb.depth = 8; if (screen->fb.depth && screen->fb.depth != hostx_get_depth()) { if (screen->fb.depth < hostx_get_depth() && (screen->fb.depth == 24 || screen->fb.depth == 16 || screen->fb.depth == 8)) { scrpriv->server_depth = screen->fb.depth; } else ErrorF ("\nXephyr: requested screen depth not supported, setting to match hosts.\n"); } screen->fb.depth = hostx_get_server_depth(screen); screen->rate = 72; if (screen->fb.depth <= 8) { if (EphyrWantGrayScale) screen->fb.visuals = ((1 << StaticGray) | (1 << GrayScale)); else screen->fb.visuals = ((1 << StaticGray) | (1 << GrayScale) | (1 << StaticColor) | (1 << PseudoColor) | (1 << TrueColor) | (1 << DirectColor)); screen->fb.redMask = 0x00; screen->fb.greenMask = 0x00; screen->fb.blueMask = 0x00; screen->fb.depth = 8; screen->fb.bitsPerPixel = 8; } else { screen->fb.visuals = (1 << TrueColor); if (screen->fb.depth <= 15) { screen->fb.depth = 15; screen->fb.bitsPerPixel = 16; } else if (screen->fb.depth <= 16) { screen->fb.depth = 16; screen->fb.bitsPerPixel = 16; } else if (screen->fb.depth <= 24) { screen->fb.depth = 24; screen->fb.bitsPerPixel = 32; } else if (screen->fb.depth <= 30) { screen->fb.depth = 30; screen->fb.bitsPerPixel = 32; } else { ErrorF("\nXephyr: Unsupported screen depth %d\n", screen->fb.depth); return FALSE; } hostx_get_visual_masks(screen, &redMask, &greenMask, &blueMask); screen->fb.redMask = (Pixel) redMask; screen->fb.greenMask = (Pixel) greenMask; screen->fb.blueMask = (Pixel) blueMask; } scrpriv->randr = screen->randr; return ephyrMapFramebuffer(screen); } void * ephyrWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) { KdScreenPriv(pScreen); EphyrPriv *priv = pScreenPriv->card->driver; if (!pScreenPriv->enabled) return 0; *size = priv->bytes_per_line; return priv->base + row * priv->bytes_per_line + offset; } /** * Figure out display buffer size. If fakexa is enabled, allocate a larger * buffer so that fakexa has space to put offscreen pixmaps. */ int ephyrBufferHeight(KdScreenInfo * screen) { int buffer_height; if (ephyrFuncs.initAccel == NULL) buffer_height = screen->height; else buffer_height = 3 * screen->height; return buffer_height; } Bool ephyrMapFramebuffer(KdScreenInfo * screen) { EphyrScrPriv *scrpriv = screen->driver; EphyrPriv *priv = screen->card->driver; KdPointerMatrix m; int buffer_height; EPHYR_LOG("screen->width: %d, screen->height: %d index=%d", screen->width, screen->height, screen->mynum); /* * Use the rotation last applied to ourselves (in the Xephyr case the fb * coordinate system moves independently of the pointer coordiante system). */ KdComputePointerMatrix(&m, ephyrRandr, screen->width, screen->height); KdSetPointerMatrix(&m); buffer_height = ephyrBufferHeight(screen); priv->base = hostx_screen_init(screen, screen->x, screen->y, screen->width, screen->height, buffer_height, &priv->bytes_per_line, &screen->fb.bitsPerPixel); if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) { scrpriv->shadow = FALSE; screen->fb.byteStride = priv->bytes_per_line; screen->fb.pixelStride = screen->width; screen->fb.frameBuffer = (CARD8 *) (priv->base); } else { /* Rotated/Reflected so we need to use shadow fb */ scrpriv->shadow = TRUE; EPHYR_LOG("allocing shadow"); KdShadowFbAlloc(screen, scrpriv->randr & (RR_Rotate_90 | RR_Rotate_270)); } return TRUE; } void ephyrSetScreenSizes(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; if (scrpriv->randr & (RR_Rotate_0 | RR_Rotate_180)) { pScreen->width = screen->width; pScreen->height = screen->height; pScreen->mmWidth = screen->width_mm; pScreen->mmHeight = screen->height_mm; } else { pScreen->width = screen->height; pScreen->height = screen->width; pScreen->mmWidth = screen->height_mm; pScreen->mmHeight = screen->width_mm; } } Bool ephyrUnmapFramebuffer(KdScreenInfo * screen) { EphyrScrPriv *scrpriv = screen->driver; if (scrpriv->shadow) KdShadowFbFree(screen); /* Note, priv->base will get freed when XImage recreated */ return TRUE; } void ephyrShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EPHYR_LOG("slow paint"); /* FIXME: Slow Rotated/Reflected updates could be much * much faster efficiently updating via tranforming * pBuf->pDamage regions */ shadowUpdateRotatePacked(pScreen, pBuf); hostx_paint_rect(screen, 0, 0, 0, 0, screen->width, screen->height); } static void ephyrInternalDamageRedisplay(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; RegionPtr pRegion; if (!scrpriv || !scrpriv->pDamage) return; pRegion = DamageRegion(scrpriv->pDamage); if (RegionNotEmpty(pRegion)) { int nbox; BoxPtr pbox; if (ephyr_glamor) { ephyr_glamor_damage_redisplay(scrpriv->glamor, pRegion); } else { nbox = RegionNumRects(pRegion); pbox = RegionRects(pRegion); while (nbox--) { hostx_paint_rect(screen, pbox->x1, pbox->y1, pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; } } DamageEmpty(scrpriv->pDamage); } } static void ephyrInternalDamageBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) { ScreenPtr pScreen = (ScreenPtr) data; ephyrInternalDamageRedisplay(pScreen); } static void ephyrInternalDamageWakeupHandler(void *data, int i, void *LastSelectMask) { /* FIXME: Not needed ? */ } Bool ephyrSetInternalDamage(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; PixmapPtr pPixmap = NULL; scrpriv->pDamage = DamageCreate((DamageReportFunc) 0, (DamageDestroyFunc) 0, DamageReportNone, TRUE, pScreen, pScreen); if (!RegisterBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, ephyrInternalDamageWakeupHandler, (void *) pScreen)) return FALSE; pPixmap = (*pScreen->GetScreenPixmap) (pScreen); DamageRegister(&pPixmap->drawable, scrpriv->pDamage); return TRUE; } void ephyrUnsetInternalDamage(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; DamageDestroy(scrpriv->pDamage); RemoveBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, ephyrInternalDamageWakeupHandler, (void *) pScreen); } #ifdef RANDR Bool ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; RRScreenSizePtr pSize; Rotation randr; int n = 0; 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} }; EPHYR_LOG("mark"); *rotations = RR_Rotate_All | RR_Reflect_All; if (!hostx_want_preexisting_window(screen) && !hostx_want_fullscreen()) { /* only if no -parent switch */ while (sizes[n].width != 0 && sizes[n].height != 0) { RRRegisterSize(pScreen, sizes[n].width, sizes[n].height, (sizes[n].width * screen->width_mm) / screen->width, (sizes[n].height * screen->height_mm) / screen->height); n++; } } pSize = RRRegisterSize(pScreen, screen->width, screen->height, screen->width_mm, screen->height_mm); randr = KdSubRotation(scrpriv->randr, screen->randr); RRSetCurrentConfig(pScreen, randr, 0, pSize); return TRUE; } Bool ephyrRandRSetConfig(ScreenPtr pScreen, Rotation randr, int rate, RRScreenSizePtr pSize) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; Bool wasEnabled = pScreenPriv->enabled; EphyrScrPriv oldscr; int oldwidth, oldheight, oldmmwidth, oldmmheight; Bool oldshadow; int newwidth, newheight; if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) { newwidth = pSize->width; newheight = pSize->height; } else { newwidth = pSize->height; newheight = pSize->width; } if (wasEnabled) KdDisableScreen(pScreen); oldscr = *scrpriv; oldwidth = screen->width; oldheight = screen->height; oldmmwidth = pScreen->mmWidth; oldmmheight = pScreen->mmHeight; oldshadow = scrpriv->shadow; /* * Set new configuration */ /* * We need to store the rotation value for pointer coords transformation; * though initially the pointer and fb rotation are identical, when we map * the fb, the screen will be reinitialized and return into an unrotated * state (presumably the HW is taking care of the rotation of the fb), but the * pointer still needs to be transformed. */ ephyrRandr = KdAddRotation(screen->randr, randr); scrpriv->randr = ephyrRandr; ephyrUnmapFramebuffer(screen); screen->width = newwidth; screen->height = newheight; if (!ephyrMapFramebuffer(screen)) goto bail4; /* FIXME below should go in own call */ if (oldshadow) KdShadowUnset(screen->pScreen); else ephyrUnsetInternalDamage(screen->pScreen); if (scrpriv->shadow) { if (!KdShadowSet(screen->pScreen, scrpriv->randr, ephyrShadowUpdate, ephyrWindowLinear)) goto bail4; } else { /* Without shadow fb ( non rotated ) we need * to use damage to efficiently update display * via signal regions what to copy from 'fb'. */ if (!ephyrSetInternalDamage(screen->pScreen)) goto bail4; } ephyrSetScreenSizes(screen->pScreen); /* * Set frame buffer mapping */ (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen), pScreen->width, pScreen->height, screen->fb.depth, screen->fb.bitsPerPixel, screen->fb.byteStride, screen->fb.frameBuffer); /* set the subpixel order */ KdSetSubpixelOrder(pScreen, scrpriv->randr); if (wasEnabled) KdEnableScreen(pScreen); RRScreenSizeNotify(pScreen); return TRUE; bail4: EPHYR_LOG("bailed"); ephyrUnmapFramebuffer(screen); *scrpriv = oldscr; (void) ephyrMapFramebuffer(screen); pScreen->width = oldwidth; pScreen->height = oldheight; pScreen->mmWidth = oldmmwidth; pScreen->mmHeight = oldmmheight; if (wasEnabled) KdEnableScreen(pScreen); return FALSE; } Bool ephyrRandRInit(ScreenPtr pScreen) { rrScrPrivPtr pScrPriv; if (!RRScreenInit(pScreen)) return FALSE; pScrPriv = rrGetScrPriv(pScreen); pScrPriv->rrGetInfo = ephyrRandRGetInfo; 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 ephyrCreateColormap(ColormapPtr pmap) { return fbInitializeColormap(pmap); } Bool ephyrInitScreen(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EPHYR_LOG("pScreen->myNum:%d\n", pScreen->myNum); hostx_set_screen_number(screen, pScreen->myNum); if (EphyrWantNoHostGrab) { hostx_set_win_title(screen, "xephyr"); } else { hostx_set_win_title(screen, "(ctrl+shift grabs mouse and keyboard)"); } pScreen->CreateColormap = ephyrCreateColormap; #ifdef XV if (!ephyrNoXV) { if (ephyr_glamor) ephyr_glamor_xv_init(pScreen); else if (!ephyrInitVideo(pScreen)) { EPHYR_LOG_ERROR("failed to initialize xvideo\n"); } else { EPHYR_LOG("initialized xvideo okay\n"); } } #endif /*XV*/ #ifdef XF86DRI if (!ephyrNoDRI && !host_has_extension(&xcb_xf86dri_id)) { EPHYR_LOG("host x does not support DRI. Disabling DRI forwarding\n"); ephyrNoDRI = TRUE; } if (!ephyrNoDRI) { ephyrDRIExtensionInit(pScreen); ephyrHijackGLXExtension(); } #endif return TRUE; } Bool ephyrFinishInitScreen(ScreenPtr pScreen) { /* FIXME: Calling this even if not using shadow. * Seems harmless enough. But may be safer elsewhere. */ if (!shadowSetup(pScreen)) return FALSE; #ifdef RANDR if (!ephyrRandRInit(pScreen)) return FALSE; #endif return TRUE; } /** * Called by kdrive after calling down the * pScreen->CreateScreenResources() chain, this gives us a chance to * make any pixmaps after the screen and all extensions have been * initialized. */ Bool ephyrCreateResources(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EPHYR_LOG("mark pScreen=%p mynum=%d shadow=%d", pScreen, pScreen->myNum, scrpriv->shadow); if (scrpriv->shadow) return KdShadowSet(pScreen, scrpriv->randr, ephyrShadowUpdate, ephyrWindowLinear); else { #ifdef GLAMOR if (ephyr_glamor) ephyr_glamor_create_screen_resources(pScreen); #endif return ephyrSetInternalDamage(pScreen); } } void ephyrPreserve(KdCardInfo * card) { } Bool ephyrEnable(ScreenPtr pScreen) { return TRUE; } Bool ephyrDPMS(ScreenPtr pScreen, int mode) { return TRUE; } void ephyrDisable(ScreenPtr pScreen) { } void ephyrRestore(KdCardInfo * card) { } void ephyrScreenFini(KdScreenInfo * screen) { EphyrScrPriv *scrpriv = screen->driver; if (scrpriv->shadow) { KdShadowFbFree(screen); } } void ephyrCloseScreen(ScreenPtr pScreen) { ephyrUnsetInternalDamage(pScreen); } /* * Port of Mark McLoughlin's Xnest fix for focus in + modifier bug. * See https://bugs.freedesktop.org/show_bug.cgi?id=3030 */ void ephyrUpdateModifierState(unsigned int state) { DeviceIntPtr pDev = inputInfo.keyboard; KeyClassPtr keyc = pDev->key; int i; CARD8 mask; int xkb_state; if (!pDev) return; xkb_state = XkbStateFieldFromRec(&pDev->key->xkbInfo->state); state = state & 0xff; if (xkb_state == state) return; for (i = 0, mask = 1; i < 8; i++, mask <<= 1) { int key; /* Modifier is down, but shouldn't be */ if ((xkb_state & mask) && !(state & mask)) { int count = keyc->modifierKeyCount[i]; for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { if (mask == XCB_MOD_MASK_LOCK) { KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); } else if (key_is_down(pDev, key, KEY_PROCESSED)) KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); if (--count == 0) break; } } /* Modifier shoud be down, but isn't */ if (!(xkb_state & mask) && (state & mask)) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); if (mask == XCB_MOD_MASK_LOCK) KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); break; } } } static Bool ephyrCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) { return FALSE; } static void ephyrCrossScreen(ScreenPtr pScreen, Bool entering) { } ScreenPtr ephyrCursorScreen; /* screen containing the cursor */ static void ephyrWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { OsBlockSIGIO(); ephyrCursorScreen = pScreen; miPointerWarpCursor(inputInfo.pointer, pScreen, x, y); OsReleaseSIGIO(); } miPointerScreenFuncRec ephyrPointerScreenFuncs = { ephyrCursorOffScreen, ephyrCrossScreen, ephyrWarpCursor, }; #ifdef XF86DRI /** * find if the remote window denoted by a_remote * is paired with an internal Window within the Xephyr server. * If the remove window is paired with an internal window, send an * expose event to the client insterested in the internal window expose event. * * Pairing happens when a drawable inside Xephyr is associated with * a GL surface in a DRI environment. * Look at the function ProcXF86DRICreateDrawable in ephyrdriext.c to * know a paired window is created. * * This is useful to make GL drawables (only windows for now) handle * expose events and send those events to clients. */ static void ephyrExposePairedWindow(int a_remote) { EphyrWindowPair *pair = NULL; RegionRec reg; ScreenPtr screen; if (!findWindowPairFromRemote(a_remote, &pair)) { EPHYR_LOG("did not find a pair for this window\n"); return; } screen = pair->local->drawable.pScreen; RegionNull(®); RegionCopy(®, &pair->local->clipList); screen->WindowExposures(pair->local, ®); RegionUninit(®); } #endif /* XF86DRI */ static KdScreenInfo * screen_from_window(Window w) { int i = 0; for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; KdPrivScreenPtr kdscrpriv = KdGetScreenPriv(pScreen); KdScreenInfo *screen = kdscrpriv->screen; EphyrScrPriv *scrpriv = screen->driver; if (scrpriv->win == w || scrpriv->peer_win == w || scrpriv->win_pre_existing == w) { return screen; } } return NULL; } static void ephyrProcessErrorEvent(xcb_generic_event_t *xev) { xcb_generic_error_t *e = (xcb_generic_error_t *)xev; FatalError("X11 error\n" "Error code: %hhu\n" "Sequence number: %hu\n" "Major code: %hhu\tMinor code: %hu\n" "Error value: %u\n", e->error_code, e->sequence, e->major_code, e->minor_code, e->resource_id); } static void ephyrProcessExpose(xcb_generic_event_t *xev) { xcb_expose_event_t *expose = (xcb_expose_event_t *)xev; KdScreenInfo *screen = screen_from_window(expose->window); EphyrScrPriv *scrpriv = screen->driver; /* Wait for the last expose event in a series of cliprects * to actually paint our screen. */ if (expose->count != 0) return; if (scrpriv) { hostx_paint_rect(scrpriv->screen, 0, 0, 0, 0, scrpriv->win_width, scrpriv->win_height); } else { EPHYR_LOG_ERROR("failed to get host screen\n"); #ifdef XF86DRI /* * We only receive expose events when the expose event * have be generated for a drawable that is a host X * window managed by Xephyr. Host X windows managed by * Xephyr exists for instance when Xephyr is asked to * create a GL drawable in a DRI environment. */ ephyrExposePairedWindow(expose->window); #endif /* XF86DRI */ } } static void ephyrProcessMouseMotion(xcb_generic_event_t *xev) { xcb_motion_notify_event_t *motion = (xcb_motion_notify_event_t *)xev; KdScreenInfo *screen = screen_from_window(motion->event); if (!ephyrMouse || !((EphyrPointerPrivate *) ephyrMouse->driverPrivate)->enabled) { EPHYR_LOG("skipping mouse motion:%d\n", screen->pScreen->myNum); return; } if (ephyrCursorScreen != screen->pScreen) { EPHYR_LOG("warping mouse cursor. " "cur_screen%d, motion_screen:%d\n", ephyrCursorScreen, screen->pScreen->myNum); ephyrWarpCursor(inputInfo.pointer, screen->pScreen, motion->event_x, motion->event_y); } else { int x = 0, y = 0; #ifdef XF86DRI EphyrWindowPair *pair = NULL; #endif EPHYR_LOG("enqueuing mouse motion:%d\n", screen->pScreen->myNum); x = motion->event_x; y = motion->event_y; EPHYR_LOG("initial (x,y):(%d,%d)\n", x, y); #ifdef XF86DRI EPHYR_LOG("is this window peered by a gl drawable ?\n"); if (findWindowPairFromRemote(motion->event, &pair)) { EPHYR_LOG("yes, it is peered\n"); x += pair->local->drawable.x; y += pair->local->drawable.y; } else { EPHYR_LOG("no, it is not peered\n"); } EPHYR_LOG("final (x,y):(%d,%d)\n", x, y); #endif /* convert coords into desktop-wide coordinates. * fill_pointer_events will convert that back to * per-screen coordinates where needed */ x += screen->pScreen->x; y += screen->pScreen->y; KdEnqueuePointerEvent(ephyrMouse, mouseState | KD_POINTER_DESKTOP, x, y, 0); } } static void ephyrProcessButtonPress(xcb_generic_event_t *xev) { xcb_button_press_event_t *button = (xcb_button_press_event_t *)xev; if (!ephyrMouse || !((EphyrPointerPrivate *) ephyrMouse->driverPrivate)->enabled) { EPHYR_LOG("skipping mouse press:%d\n", screen_from_window(button->event)->pScreen->myNum); return; } ephyrUpdateModifierState(button->state); /* This is a bit hacky. will break for button 5 ( defined as 0x10 ) * Check KD_BUTTON defines in kdrive.h */ mouseState |= 1 << (button->detail - 1); EPHYR_LOG("enqueuing mouse press:%d\n", screen_from_window(button->event)->pScreen->myNum); KdEnqueuePointerEvent(ephyrMouse, mouseState | KD_MOUSE_DELTA, 0, 0, 0); } static void ephyrProcessButtonRelease(xcb_generic_event_t *xev) { xcb_button_press_event_t *button = (xcb_button_press_event_t *)xev; if (!ephyrMouse || !((EphyrPointerPrivate *) ephyrMouse->driverPrivate)->enabled) { return; } ephyrUpdateModifierState(button->state); mouseState &= ~(1 << (button->detail - 1)); EPHYR_LOG("enqueuing mouse release:%d\n", screen_from_window(button->event)->pScreen->myNum); KdEnqueuePointerEvent(ephyrMouse, mouseState | KD_MOUSE_DELTA, 0, 0, 0); } /* Xephyr wants ctrl+shift to grab the window, but that conflicts with ctrl+alt+shift key combos. Remember the modifier state on key presses and releases, if mod1 is pressed, we need ctrl, shift and mod1 released before we allow a shift-ctrl grab activation. note: a key event contains the mask _before_ the current key takes effect, so mod1_was_down will be reset on the first key press after all three were released, not on the last release. That'd require some more effort. */ static int ephyrUpdateGrabModifierState(int state) { static int mod1_was_down = 0; if ((state & (XCB_MOD_MASK_CONTROL|XCB_MOD_MASK_SHIFT|XCB_MOD_MASK_1)) == 0) mod1_was_down = 0; else if (state & XCB_MOD_MASK_1) mod1_was_down = 1; return mod1_was_down; } static void ephyrProcessKeyPress(xcb_generic_event_t *xev) { xcb_key_press_event_t *key = (xcb_key_press_event_t *)xev; if (!ephyrKbd || !((EphyrKbdPrivate *) ephyrKbd->driverPrivate)->enabled) { return; } ephyrUpdateGrabModifierState(key->state); ephyrUpdateModifierState(key->state); KdEnqueueKeyboardEvent(ephyrKbd, key->detail, FALSE); } static void ephyrProcessKeyRelease(xcb_generic_event_t *xev) { xcb_connection_t *conn = hostx_get_xcbconn(); xcb_key_release_event_t *key = (xcb_key_release_event_t *)xev; static xcb_key_symbols_t *keysyms; static int grabbed_screen = -1; int mod1_down = ephyrUpdateGrabModifierState(key->state); if (!keysyms) keysyms = xcb_key_symbols_alloc(conn); if (!EphyrWantNoHostGrab && (((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_L || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_R) && (key->state & XCB_MOD_MASK_CONTROL)) || ((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_L || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_R) && (key->state & XCB_MOD_MASK_SHIFT)))) { KdScreenInfo *screen = screen_from_window(key->event); EphyrScrPriv *scrpriv = screen->driver; if (grabbed_screen != -1) { xcb_ungrab_keyboard(conn, XCB_TIME_CURRENT_TIME); xcb_ungrab_pointer(conn, XCB_TIME_CURRENT_TIME); grabbed_screen = -1; hostx_set_win_title(screen, "(ctrl+shift grabs mouse and keyboard)"); } else if (!mod1_down) { /* Attempt grab */ xcb_grab_keyboard_cookie_t kbgrabc = xcb_grab_keyboard(conn, TRUE, scrpriv->win, XCB_TIME_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); xcb_grab_keyboard_reply_t *kbgrabr; xcb_grab_pointer_cookie_t pgrabc = xcb_grab_pointer(conn, TRUE, scrpriv->win, 0, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, scrpriv->win, XCB_NONE, XCB_TIME_CURRENT_TIME); xcb_grab_pointer_reply_t *pgrabr; kbgrabr = xcb_grab_keyboard_reply(conn, kbgrabc, NULL); if (!kbgrabr || kbgrabr->status != XCB_GRAB_STATUS_SUCCESS) { xcb_discard_reply(conn, pgrabc.sequence); xcb_ungrab_pointer(conn, XCB_TIME_CURRENT_TIME); } else { pgrabr = xcb_grab_pointer_reply(conn, pgrabc, NULL); if (!pgrabr || pgrabr->status != XCB_GRAB_STATUS_SUCCESS) { xcb_ungrab_keyboard(conn, XCB_TIME_CURRENT_TIME); } else { grabbed_screen = scrpriv->mynum; hostx_set_win_title (screen, "(ctrl+shift releases mouse and keyboard)"); } } } } if (!ephyrKbd || !((EphyrKbdPrivate *) ephyrKbd->driverPrivate)->enabled) { return; } /* Still send the release event even if above has happened server * will get confused with just an up event. Maybe it would be * better to just block shift+ctrls getting to kdrive all * together. */ ephyrUpdateModifierState(key->state); KdEnqueueKeyboardEvent(ephyrKbd, key->detail, TRUE); } static void ephyrProcessConfigureNotify(xcb_generic_event_t *xev) { xcb_configure_notify_event_t *configure = (xcb_configure_notify_event_t *)xev; KdScreenInfo *screen = screen_from_window(configure->window); EphyrScrPriv *scrpriv = screen->driver; if (!scrpriv || (scrpriv->win_pre_existing == None && !EphyrWantResize)) { return; } #ifdef RANDR ephyrResizeScreen(screen->pScreen, configure->width, configure->height); #endif /* RANDR */ } void ephyrPoll(void) { xcb_connection_t *conn = hostx_get_xcbconn(); while (TRUE) { xcb_generic_event_t *xev = xcb_poll_for_event(conn); if (!xev) { /* If our XCB connection has died (for example, our window was * closed), exit now. */ if (xcb_connection_has_error(conn)) { CloseWellKnownConnections(); OsCleanup(1); exit(1); } break; } switch (xev->response_type & 0x7f) { case 0: ephyrProcessErrorEvent(xev); break; case XCB_EXPOSE: ephyrProcessExpose(xev); break; case XCB_MOTION_NOTIFY: ephyrProcessMouseMotion(xev); break; case XCB_KEY_PRESS: ephyrProcessKeyPress(xev); break; case XCB_KEY_RELEASE: ephyrProcessKeyRelease(xev); break; case XCB_BUTTON_PRESS: ephyrProcessButtonPress(xev); break; case XCB_BUTTON_RELEASE: ephyrProcessButtonRelease(xev); break; case XCB_CONFIGURE_NOTIFY: ephyrProcessConfigureNotify(xev); break; } if (ephyr_glamor) ephyr_glamor_process_event(xev); free(xev); } } void ephyrCardFini(KdCardInfo * card) { EphyrPriv *priv = card->driver; free(priv); } void ephyrGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs) { /* XXX Not sure if this is right */ EPHYR_LOG("mark"); while (n--) { pdefs->red = 0; pdefs->green = 0; pdefs->blue = 0; pdefs++; } } void ephyrPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; int min, max, p; /* XXX Not sure if this is right */ min = 256; max = 0; while (n--) { p = pdefs->pixel; if (p < min) min = p; if (p > max) max = p; hostx_set_cmap_entry(pScreen, p, pdefs->red >> 8, pdefs->green >> 8, pdefs->blue >> 8); pdefs++; } if (scrpriv->pDamage) { BoxRec box; RegionRec region; box.x1 = 0; box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; RegionInit(®ion, &box, 1); DamageReportDamage(scrpriv->pDamage, ®ion); RegionUninit(®ion); } } /* Mouse calls */ static Status MouseInit(KdPointerInfo * pi) { pi->driverPrivate = (EphyrPointerPrivate *) calloc(sizeof(EphyrPointerPrivate), 1); ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = FALSE; pi->nAxes = 3; pi->nButtons = 32; free(pi->name); pi->name = strdup("Xephyr virtual mouse"); /* * Must transform pointer coords since the pointer position * relative to the Xephyr window is controlled by the host server and * remains constant regardless of any rotation applied to the Xephyr screen. */ pi->transformCoordinates = TRUE; ephyrMouse = pi; return Success; } static Status MouseEnable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = TRUE; return Success; } static void MouseDisable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = FALSE; return; } static void MouseFini(KdPointerInfo * pi) { ephyrMouse = NULL; return; } KdPointerDriver EphyrMouseDriver = { "ephyr", MouseInit, MouseEnable, MouseDisable, MouseFini, NULL, }; /* Keyboard */ static Status EphyrKeyboardInit(KdKeyboardInfo * ki) { ki->driverPrivate = (EphyrKbdPrivate *) calloc(sizeof(EphyrKbdPrivate), 1); hostx_load_keymap(); if (!ephyrKeySyms.minKeyCode) { ErrorF("Couldn't load keymap from host\n"); return BadAlloc; } ki->minScanCode = ephyrKeySyms.minKeyCode; ki->maxScanCode = ephyrKeySyms.maxKeyCode; free(ki->name); ki->name = strdup("Xephyr virtual keyboard"); ephyrKbd = ki; return Success; } static Status EphyrKeyboardEnable(KdKeyboardInfo * ki) { ((EphyrKbdPrivate *) ki->driverPrivate)->enabled = TRUE; return Success; } static void EphyrKeyboardDisable(KdKeyboardInfo * ki) { ((EphyrKbdPrivate *) ki->driverPrivate)->enabled = FALSE; } static void EphyrKeyboardFini(KdKeyboardInfo * ki) { ephyrKbd = NULL; return; } static void EphyrKeyboardLeds(KdKeyboardInfo * ki, int leds) { } static void EphyrKeyboardBell(KdKeyboardInfo * ki, int volume, int frequency, int duration) { } KdKeyboardDriver EphyrKeyboardDriver = { "ephyr", EphyrKeyboardInit, EphyrKeyboardEnable, EphyrKeyboardLeds, EphyrKeyboardBell, EphyrKeyboardDisable, EphyrKeyboardFini, NULL, }; xorg-server-1.17.1/hw/kdrive/ephyr/ephyr.h0000664000175100017510000001307312456571574015366 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2004 Nokia * * 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 Nokia not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Nokia makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL NOKIA 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. */ #ifndef _EPHYR_H_ #define _EPHYR_H_ #include #include #include #include #include #include "os.h" /* for OsSignal() */ #include "kdrive.h" #include "hostx.h" #include "exa.h" #ifdef RANDR #include "randrstr.h" #endif #include "damage.h" typedef struct _ephyrPriv { CARD8 *base; int bytes_per_line; } EphyrPriv; typedef struct _ephyrFakexaPriv { ExaDriverPtr exa; Bool is_synced; /* The following are arguments and other information from Prepare* calls * which are stored for use in the inner calls. */ int op; PicturePtr pSrcPicture, pMaskPicture, pDstPicture; void *saved_ptrs[3]; PixmapPtr pDst, pSrc, pMask; GCPtr pGC; } EphyrFakexaPriv; typedef struct _ephyrScrPriv { /* ephyr server info */ Rotation randr; Bool shadow; DamagePtr pDamage; EphyrFakexaPriv *fakexa; /* Host X window info */ xcb_window_t win; xcb_window_t win_pre_existing; /* Set via -parent option like xnest */ xcb_window_t peer_win; /* Used for GL; should be at most one */ xcb_image_t *ximg; Bool win_explicit_position; int win_x, win_y; int win_width, win_height; int server_depth; const char *output; /* Set via -output option */ unsigned char *fb_data; /* only used when host bpp != server bpp */ xcb_shm_segment_info_t shminfo; KdScreenInfo *screen; int mynum; /* Screen number */ unsigned long cmap[256]; /** * Per-screen Xlib-using state for glamor (private to * ephyr_glamor_glx.c) */ struct ephyr_glamor *glamor; } EphyrScrPriv; extern KdCardFuncs ephyrFuncs; extern KdKeyboardInfo *ephyrKbd; extern KdPointerInfo *ephyrMouse; extern miPointerScreenFuncRec ephyrPointerScreenFuncs; Bool ephyrInitialize(KdCardInfo * card, EphyrPriv * priv); Bool ephyrCardInit(KdCardInfo * card); Bool ephyrScreenInitialize(KdScreenInfo *screen); Bool ephyrInitScreen(ScreenPtr pScreen); Bool ephyrFinishInitScreen(ScreenPtr pScreen); Bool ephyrCreateResources(ScreenPtr pScreen); void ephyrPreserve(KdCardInfo * card); Bool ephyrEnable(ScreenPtr pScreen); Bool ephyrDPMS(ScreenPtr pScreen, int mode); void ephyrDisable(ScreenPtr pScreen); void ephyrRestore(KdCardInfo * card); void ephyrScreenFini(KdScreenInfo * screen); void ephyrCloseScreen(ScreenPtr pScreen); void ephyrCardFini(KdCardInfo * card); void ephyrGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs); void ephyrPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs); Bool ephyrMapFramebuffer(KdScreenInfo * screen); void *ephyrWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure); void ephyrSetScreenSizes(ScreenPtr pScreen); Bool ephyrUnmapFramebuffer(KdScreenInfo * screen); void ephyrUnsetInternalDamage(ScreenPtr pScreen); Bool ephyrSetInternalDamage(ScreenPtr pScreen); Bool ephyrCreateColormap(ColormapPtr pmap); void ephyrPoll(void); #ifdef RANDR Bool ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations); Bool ephyrRandRSetConfig(ScreenPtr pScreen, Rotation randr, int rate, RRScreenSizePtr pSize); Bool ephyrRandRInit(ScreenPtr pScreen); void ephyrShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf); #endif void ephyrUpdateModifierState(unsigned int state); extern KdPointerDriver EphyrMouseDriver; extern KdKeyboardDriver EphyrKeyboardDriver; extern KdOsFuncs EphyrOsFuncs; extern Bool ephyrCursorInit(ScreenPtr pScreen); extern int ephyrBufferHeight(KdScreenInfo * screen); /* ephyr_draw.c */ Bool ephyrDrawInit(ScreenPtr pScreen); void ephyrDrawEnable(ScreenPtr pScreen); void ephyrDrawDisable(ScreenPtr pScreen); void ephyrDrawFini(ScreenPtr pScreen); /* hostx.c glamor support */ Bool ephyr_glamor_init(ScreenPtr pScreen); Bool ephyr_glamor_create_screen_resources(ScreenPtr pScreen); void ephyr_glamor_enable(ScreenPtr pScreen); void ephyr_glamor_disable(ScreenPtr pScreen); void ephyr_glamor_fini(ScreenPtr pScreen); void ephyr_glamor_host_paint_rect(ScreenPtr pScreen); /*ephyvideo.c*/ Bool ephyrInitVideo(ScreenPtr pScreen); /* ephyr_glamor_xv.c */ #ifdef GLAMOR void ephyr_glamor_xv_init(ScreenPtr screen); #else /* !GLAMOR */ static inline void ephyr_glamor_xv_init(ScreenPtr screen) { } #endif /* !GLAMOR */ #endif xorg-server-1.17.1/hw/kdrive/ephyr/ephyrglxext.c0000664000175100017510000006340712456571574016623 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifdef HAVE_CONFIG_H #include #endif #include #include "extnsionst.h" #include "ephyrglxext.h" #include "ephyrhostglx.h" #define _HAVE_XALLOC_DECLS #include "ephyrlog.h" #include #include "glx/glxserver.h" #include "glx/indirect_table.h" #include "glx/indirect_util.h" #include "glx/unpack.h" #include "hostx.h" #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif int ephyrGLXQueryVersion(__GLXclientState * cl, GLbyte * pc); int ephyrGLXQueryVersionSwap(__GLXclientState * cl, GLbyte * pc); int ephyrGLXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc); int ephyrGLXGetVisualConfigsSwap(__GLXclientState * cl, GLbyte * pc); int ephyrGLXClientInfo(__GLXclientState * cl, GLbyte * pc); int ephyrGLXClientInfoSwap(__GLXclientState * cl, GLbyte * pc); int ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXQueryServerStringSwap(__GLXclientState * a_cl, GLbyte * a_pc); 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); int ephyrGLXGetIntegervSwap(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXIsDirect(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXIsDirectSwap(__GLXclientState * a_cl, GLbyte * a_pc); Bool ephyrHijackGLXExtension(void) { const void *(*dispatch_functions)[2]; if (!host_has_extension(&xcb_glx_id)) { EPHYR_LOG("host X does not have GLX\n"); return FALSE; } EPHYR_LOG("host X does have GLX\n"); if (!Single_dispatch_info.dispatch_functions) { EPHYR_LOG_ERROR("could not get dispatch functions table\n"); return FALSE; } /* * hijack some single entry point dispatch functions */ dispatch_functions = Single_dispatch_info.dispatch_functions; EPHYR_RETURN_VAL_IF_FAIL(dispatch_functions, FALSE); dispatch_functions[X_GLXQueryVersion][0] = ephyrGLXQueryVersion; dispatch_functions[X_GLXQueryVersion][1] = ephyrGLXQueryVersionSwap; dispatch_functions[X_GLXGetVisualConfigs][0] = ephyrGLXGetVisualConfigs; dispatch_functions[X_GLXGetVisualConfigs][1] = ephyrGLXGetVisualConfigsSwap; dispatch_functions[X_GLXClientInfo][0] = ephyrGLXClientInfo; dispatch_functions[X_GLXClientInfo][1] = ephyrGLXClientInfoSwap; dispatch_functions[X_GLXQueryServerString][0] = ephyrGLXQueryServerString; dispatch_functions[X_GLXQueryServerString][1] = ephyrGLXQueryServerStringSwap; 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; dispatch_functions[X_GLXMakeCurrent][0] = ephyrGLXMakeCurrent; dispatch_functions[X_GLXMakeCurrent][1] = ephyrGLXMakeCurrentSwap; dispatch_functions[X_GLXIsDirect][0] = ephyrGLXIsDirect; dispatch_functions[X_GLXIsDirect][1] = ephyrGLXIsDirectSwap; dispatch_functions[73][0] = ephyrGLXGetString; dispatch_functions[73][1] = ephyrGLXGetStringSwap; 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; } /********************* * implementation of * hijacked GLX entry * points ********************/ int ephyrGLXQueryVersion(__GLXclientState * a_cl, GLbyte * a_pc) { ClientPtr client = a_cl->client; xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc; xGLXQueryVersionReply reply; int major, minor; int res = BadImplementation; EPHYR_LOG("enter\n"); major = req->majorVersion; minor = req->minorVersion; if (!ephyrHostGLXQueryVersion(&major, &minor)) { EPHYR_LOG_ERROR("ephyrHostGLXQueryVersion() failed\n"); goto out; } EPHYR_LOG("major:%d, minor:%d\n", major, minor); 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, &reply); } res = Success; out: EPHYR_LOG("leave\n"); return res; } int ephyrGLXQueryVersionSwap(__GLXclientState * a_cl, GLbyte * a_pc) { xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->majorVersion); __GLX_SWAP_INT(&req->minorVersion); return ephyrGLXQueryVersion(a_cl, a_pc); } static int ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) { xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) a_pc; ClientPtr client = a_cl->client; xGLXGetVisualConfigsReply reply; int32_t *props_buf = NULL, num_visuals = 0, num_props = 0, res = BadImplementation, i = 0, props_per_visual_size = 0, props_buf_size = 0; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; EPHYR_LOG("enter\n"); if (!ephyrHostGLXGetVisualConfigs(req->screen, &num_visuals, &num_props, &props_buf_size, &props_buf)) { EPHYR_LOG_ERROR("ephyrHostGLXGetVisualConfigs() failed\n"); goto out; } EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); 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); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.numVisuals); __GLX_SWAP_INT(&reply.numProps); __GLX_SWAP_INT_ARRAY(props_buf, num_props); } WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); props_per_visual_size = props_buf_size / num_visuals; for (i = 0; i < num_visuals; i++) { WriteToClient(client, props_per_visual_size, (char *) props_buf + i * props_per_visual_size); } res = Success; out: EPHYR_LOG("leave\n"); free(props_buf); props_buf = NULL; return res; } static int ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) { xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) a_pc; ClientPtr client = a_cl->client; xGLXGetVisualConfigsReply reply; int32_t *props_buf = NULL, num_visuals = 0, num_props = 0, res = BadImplementation, i = 0, props_per_visual_size = 0, props_buf_size = 0; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; EPHYR_LOG("enter\n"); if (!ephyrHostGLXVendorPrivGetFBConfigsSGIX(req->screen, &num_visuals, &num_props, &props_buf_size, &props_buf)) { EPHYR_LOG_ERROR("ephyrHostGLXGetVisualConfigs() failed\n"); goto out; } EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); 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); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.numVisuals); __GLX_SWAP_INT(&reply.numProps); __GLX_SWAP_INT_ARRAY(props_buf, num_props); } WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); props_per_visual_size = props_buf_size / num_visuals; for (i = 0; i < num_visuals; i++) { WriteToClient(client, props_per_visual_size, &((char *) props_buf)[i * props_per_visual_size]); } res = Success; out: EPHYR_LOG("leave\n"); free(props_buf); props_buf = NULL; return res; } int ephyrGLXGetVisualConfigs(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetVisualConfigsReal(a_cl, a_pc, FALSE); } int ephyrGLXGetVisualConfigsSwap(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetVisualConfigsReal(a_cl, a_pc, TRUE); } int ephyrGLXClientInfo(__GLXclientState * a_cl, GLbyte * a_pc) { int res = BadImplementation; xGLXClientInfoReq *req = (xGLXClientInfoReq *) a_pc; EPHYR_LOG("enter\n"); if (!ephyrHostGLXSendClientInfo(req->major, req->minor, (char *) req + 1)) { EPHYR_LOG_ERROR("failed to send client info to host\n"); goto out; } res = Success; out: EPHYR_LOG("leave\n"); return res; } int ephyrGLXClientInfoSwap(__GLXclientState * a_cl, GLbyte * a_pc) { xGLXClientInfoReq *req = (xGLXClientInfoReq *) a_pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->major); __GLX_SWAP_INT(&req->minor); __GLX_SWAP_INT(&req->numbytes); return ephyrGLXClientInfo(a_cl, a_pc); } int ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc) { int res = BadImplementation; ClientPtr client = a_cl->client; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) a_pc; xGLXQueryServerStringReply reply; char *server_string = NULL; int length = 0; EPHYR_LOG("enter\n"); if (!ephyrHostGLXQueryServerString(req->screen, req->name, &server_string)) { EPHYR_LOG_ERROR("failed to query string from host\n"); goto out; } EPHYR_LOG("string: %s\n", server_string); length = strlen(server_string) + 1; reply = (xGLXQueryServerStringReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = __GLX_PAD(length) >> 2, .n = length }; WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); WriteToClient(client, (int) (reply.length << 2), server_string); res = Success; out: EPHYR_LOG("leave\n"); free(server_string); server_string = NULL; return res; } int ephyrGLXQueryServerStringSwap(__GLXclientState * a_cl, GLbyte * a_pc) { EPHYR_LOG_ERROR("not yet implemented\n"); return BadImplementation; } int ephyrGLXGetFBConfigsSGIX(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetFBConfigsSGIXReal(a_cl, a_pc, FALSE); } int ephyrGLXGetFBConfigsSGIXSwap(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetFBConfigsSGIXReal(a_cl, a_pc, TRUE); } static int ephyrGLXCreateContextReal(xGLXCreateContextReq * a_req, Bool a_do_swap) { int res = BadImplementation; EphyrHostWindowAttributes host_w_attrs; __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->visual); __GLX_SWAP_INT(&a_req->screen); __GLX_SWAP_INT(&a_req->shareList); } EPHYR_LOG("context creation requested. localid:%d, " "screen:%d, visual:%d, direct:%d\n", (int) a_req->context, (int) a_req->screen, (int) a_req->visual, (int) a_req->isDirect); memset(&host_w_attrs, 0, sizeof(host_w_attrs)); if (!hostx_get_window_attributes(hostx_get_window(a_req->screen), &host_w_attrs)) { EPHYR_LOG_ERROR("failed to get host window attrs\n"); goto out; } EPHYR_LOG("host window visual id: %d\n", host_w_attrs.visualid); if (!ephyrHostGLXCreateContext(a_req->screen, host_w_attrs.visualid, a_req->context, a_req->shareList, 0, a_req->isDirect, X_GLXCreateContext)) { EPHYR_LOG_ERROR("ephyrHostGLXCreateContext() failed\n"); goto out; } res = Success; out: EPHYR_LOG("leave\n"); 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) { xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; return ephyrGLXCreateContextReal(req, FALSE); } int ephyrGLXCreateContextSwap(__GLXclientState * cl, GLbyte * pc) { xGLXCreateContextReq *req = (xGLXCreateContextReq *) 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) { int res = BadImplementation; ClientPtr client = a_cl->client; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) a_pc; EPHYR_LOG("enter. id:%d\n", (int) req->context); if (!ephyrHostDestroyContext(req->context)) { EPHYR_LOG_ERROR("ephyrHostDestroyContext() failed\n"); client->errorValue = req->context; goto out; } res = Success; out: EPHYR_LOG("leave\n"); return res; } int ephyrGLXDestroyContext(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXDestroyContextReal(a_cl, a_pc, FALSE); } int ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXDestroyContextReal(a_cl, a_pc, TRUE); } static int ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLXDrawable write, GLXDrawable read, GLXContextTag ctx, GLXContextTag old_ctx, Bool a_do_swap) { int res = BadImplementation; xGLXMakeCurrentReply reply; DrawablePtr drawableR = NULL, drawableW = NULL; GLXContextTag new_ctx = 0; EPHYR_LOG("enter\n"); 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); 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 = (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, &reply); res = Success; out: EPHYR_LOG("leave\n"); return res; } int ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc) { 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) { 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 ephyrGLXGetStringReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) { ClientPtr client = NULL; int context_tag = 0, name = 0, res = BadImplementation, length = 0; char *string = NULL; __GLX_DECLARE_SWAP_VARIABLES; EPHYR_RETURN_VAL_IF_FAIL(a_cl && a_pc, BadValue); EPHYR_LOG("enter\n"); client = a_cl->client; if (a_do_swap) { __GLX_SWAP_INT(a_pc + 4); __GLX_SWAP_INT(a_pc + __GLX_SINGLE_HDR_SIZE); } context_tag = __GLX_GET_SINGLE_CONTEXT_TAG(a_pc); a_pc += __GLX_SINGLE_HDR_SIZE; name = *(GLenum *) (a_pc + 0); EPHYR_LOG("context_tag:%d, name:%d\n", context_tag, name); if (!ephyrHostGLXGetString(context_tag, name, &string)) { EPHYR_LOG_ERROR("failed to get string from server\n"); goto out; } if (string) { length = strlen(string) + 1; EPHYR_LOG("got string:'%s', size:%d\n", string, length); } else { EPHYR_LOG("got string: string (null)\n"); } __GLX_BEGIN_REPLY(length); __GLX_PUT_SIZE(length); __GLX_SEND_HEADER(); if (a_do_swap) { __GLX_SWAP_REPLY_SIZE(); __GLX_SWAP_REPLY_HEADER(); } WriteToClient(client, length, string); res = Success; out: EPHYR_LOG("leave\n"); return res; } int ephyrGLXGetString(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetStringReal(a_cl, a_pc, FALSE); } int ephyrGLXGetStringSwap(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetStringReal(a_cl, a_pc, TRUE); } static int ephyrGLXGetIntegervReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) { int res = BadImplementation; xGLXSingleReq *const req = (xGLXSingleReq *) a_pc; GLenum int_name; int value = 0; GLint answer_buf_room[200]; GLint *buf = NULL; EPHYR_LOG("enter\n"); a_pc += __GLX_SINGLE_HDR_SIZE; int_name = *(GLenum *) (a_pc + 0); if (!ephyrHostGetIntegerValue(req->contextTag, int_name, &value)) { EPHYR_LOG_ERROR("ephyrHostGetIntegerValue() failed\n"); goto out; } buf = __glXGetAnswerBuffer(a_cl, sizeof(value), answer_buf_room, sizeof(answer_buf_room), 4); if (!buf) { EPHYR_LOG_ERROR("failed to allocate reply buffer\n"); res = BadAlloc; goto out; } __glXSendReply(a_cl->client, buf, 1, sizeof(value), GL_FALSE, 0); res = Success; out: EPHYR_LOG("leave\n"); return res; } int ephyrGLXGetIntegerv(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetIntegervReal(a_cl, a_pc, FALSE); } int ephyrGLXGetIntegervSwap(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXGetIntegervReal(a_cl, a_pc, TRUE); } static int ephyrGLXIsDirectReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) { int res = BadImplementation; ClientPtr client = a_cl->client; xGLXIsDirectReq *req = (xGLXIsDirectReq *) a_pc; xGLXIsDirectReply reply; int is_direct = 0; EPHYR_RETURN_VAL_IF_FAIL(a_cl && a_pc, FALSE); EPHYR_LOG("enter\n"); if (!ephyrHostIsContextDirect(req->context, (int *) &is_direct)) { EPHYR_LOG_ERROR("ephyrHostIsContextDirect() failed\n"); goto out; } reply = (xGLXIsDirectReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .isDirect = is_direct }; WriteToClient(client, sz_xGLXIsDirectReply, &reply); res = Success; out: EPHYR_LOG("leave\n"); return res; } int ephyrGLXIsDirect(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXIsDirectReal(a_cl, a_pc, FALSE); } int ephyrGLXIsDirectSwap(__GLXclientState * a_cl, GLbyte * a_pc) { return ephyrGLXIsDirectReal(a_cl, a_pc, TRUE); } xorg-server-1.17.1/hw/kdrive/ephyr/hostx.c0000664000175100017510000013143012460362577015371 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2004 Nokia * * 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 Nokia not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Nokia makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL NOKIA 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_CONFIG_H #include #endif #include "hostx.h" #include "input.h" #include #include #include #include /* for memset */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef XF86DRI #include #include #endif /* XF86DRI */ #ifdef GLAMOR #include #include "glamor.h" #include "ephyr_glamor_glx.h" #endif #include "ephyrlog.h" #include "ephyr.h" struct EphyrHostXVars { char *server_dpy_name; xcb_connection_t *conn; int screen; xcb_visualtype_t *visual; Window winroot; xcb_gcontext_t gc; xcb_render_pictformat_t argb_format; xcb_cursor_t empty_cursor; int depth; Bool use_sw_cursor; Bool use_fullscreen; Bool have_shm; int n_screens; KdScreenInfo **screens; long damage_debug_msec; }; /* memset ( missing> ) instead of below */ /*static EphyrHostXVars HostX = { "?", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};*/ static EphyrHostXVars HostX; static int HostXWantDamageDebug = 0; extern EphyrKeySyms ephyrKeySyms; extern Bool EphyrWantResize; char *ephyrResName = NULL; int ephyrResNameFromCmd = 0; char *ephyrTitle = NULL; Bool ephyr_glamor = FALSE; static void hostx_set_fullscreen_hint(void); #define host_depth_matches_server(_vars) (HostX.depth == (_vars)->server_depth) int hostx_want_screen_geometry(KdScreenInfo *screen, int *width, int *height, int *x, int *y) { EphyrScrPriv *scrpriv = screen->driver; if (scrpriv && (scrpriv->win_pre_existing != None || scrpriv->output != NULL || HostX.use_fullscreen == TRUE)) { *x = scrpriv->win_x; *y = scrpriv->win_y; *width = scrpriv->win_width; *height = scrpriv->win_height; return 1; } return 0; } void hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Bool use_geometry, const char *output) { EphyrScrPriv *scrpriv = screen->driver; int index = HostX.n_screens; HostX.n_screens += 1; HostX.screens = realloc(HostX.screens, HostX.n_screens * sizeof(HostX.screens[0])); HostX.screens[index] = screen; scrpriv->screen = screen; scrpriv->win_pre_existing = win_id; scrpriv->win_explicit_position = use_geometry; scrpriv->output = output; } void hostx_set_display_name(char *name) { HostX.server_dpy_name = strdup(name); } void hostx_set_screen_number(KdScreenInfo *screen, int number) { EphyrScrPriv *scrpriv = screen->driver; if (scrpriv) { scrpriv->mynum = number; hostx_set_win_title(screen, ""); } } void hostx_set_win_title(KdScreenInfo *screen, const char *extra_text) { EphyrScrPriv *scrpriv = screen->driver; if (!scrpriv) return; if (ephyrTitle) { xcb_icccm_set_wm_name(HostX.conn, scrpriv->win, XCB_ATOM_STRING, 8, strlen(ephyrTitle), ephyrTitle); } else { #define BUF_LEN 256 char buf[BUF_LEN + 1]; memset(buf, 0, BUF_LEN + 1); snprintf(buf, BUF_LEN, "Xephyr on %s.%d %s", HostX.server_dpy_name, scrpriv->mynum, (extra_text != NULL) ? extra_text : ""); xcb_icccm_set_wm_name(HostX.conn, scrpriv->win, XCB_ATOM_STRING, 8, strlen(buf), buf); xcb_flush(HostX.conn); } } int hostx_want_host_cursor(void) { return !HostX.use_sw_cursor; } void hostx_use_sw_cursor(void) { HostX.use_sw_cursor = TRUE; } xcb_cursor_t hostx_get_empty_cursor(void) { return HostX.empty_cursor; } int hostx_want_preexisting_window(KdScreenInfo *screen) { EphyrScrPriv *scrpriv = screen->driver; if (scrpriv && scrpriv->win_pre_existing) { return 1; } else { return 0; } } void hostx_get_output_geometry(const char *output, int *x, int *y, int *width, int *height) { int i, name_len = 0, output_found = FALSE; char *name = NULL; xcb_generic_error_t *error; xcb_randr_query_version_cookie_t version_c; xcb_randr_query_version_reply_t *version_r; xcb_randr_get_screen_resources_cookie_t screen_resources_c; xcb_randr_get_screen_resources_reply_t *screen_resources_r; xcb_randr_output_t *randr_outputs; xcb_randr_get_output_info_cookie_t output_info_c; xcb_randr_get_output_info_reply_t *output_info_r; xcb_randr_get_crtc_info_cookie_t crtc_info_c; xcb_randr_get_crtc_info_reply_t *crtc_info_r; /* First of all, check for extension */ if (!xcb_get_extension_data(HostX.conn, &xcb_randr_id)->present) { fprintf(stderr, "\nHost X server does not support RANDR extension (or it's disabled).\n"); exit(1); } /* Check RandR version */ version_c = xcb_randr_query_version(HostX.conn, 1, 2); version_r = xcb_randr_query_version_reply(HostX.conn, version_c, &error); if (error != NULL || version_r == NULL) { fprintf(stderr, "\nFailed to get RandR version supported by host X server.\n"); exit(1); } else if (version_r->major_version < 1 || version_r->minor_version < 2) { free(version_r); fprintf(stderr, "\nHost X server doesn't support RandR 1.2, needed for -output usage.\n"); exit(1); } free(version_r); /* Get list of outputs from screen resources */ screen_resources_c = xcb_randr_get_screen_resources(HostX.conn, HostX.winroot); screen_resources_r = xcb_randr_get_screen_resources_reply(HostX.conn, screen_resources_c, NULL); randr_outputs = xcb_randr_get_screen_resources_outputs(screen_resources_r); for (i = 0; !output_found && i < screen_resources_r->num_outputs; i++) { /* Get info on the output */ output_info_c = xcb_randr_get_output_info(HostX.conn, randr_outputs[i], XCB_CURRENT_TIME); output_info_r = xcb_randr_get_output_info_reply(HostX.conn, output_info_c, NULL); /* Get output name */ name_len = xcb_randr_get_output_info_name_length(output_info_r); name = malloc(name_len + 1); strncpy(name, (char*)xcb_randr_get_output_info_name(output_info_r), name_len); name[name_len] = '\0'; if (!strcmp(name, output)) { output_found = TRUE; /* Check if output is connected */ if (output_info_r->crtc == XCB_NONE) { free(name); free(output_info_r); free(screen_resources_r); fprintf(stderr, "\nOutput %s is currently disabled (or not connected).\n", output); exit(1); } /* Get CRTC from output info */ crtc_info_c = xcb_randr_get_crtc_info(HostX.conn, output_info_r->crtc, XCB_CURRENT_TIME); crtc_info_r = xcb_randr_get_crtc_info_reply(HostX.conn, crtc_info_c, NULL); /* Get CRTC geometry */ *x = crtc_info_r->x; *y = crtc_info_r->y; *width = crtc_info_r->width; *height = crtc_info_r->height; free(crtc_info_r); } free(name); free(output_info_r); } free(screen_resources_r); if (!output_found) { fprintf(stderr, "\nOutput %s not available in host X server.\n", output); exit(1); } } void hostx_use_fullscreen(void) { HostX.use_fullscreen = TRUE; } int hostx_want_fullscreen(void) { return HostX.use_fullscreen; } static xcb_intern_atom_cookie_t cookie_WINDOW_STATE, cookie_WINDOW_STATE_FULLSCREEN; static void hostx_set_fullscreen_hint(void) { xcb_atom_t atom_WINDOW_STATE, atom_WINDOW_STATE_FULLSCREEN; int index; xcb_intern_atom_reply_t *reply; reply = xcb_intern_atom_reply(HostX.conn, cookie_WINDOW_STATE, NULL); atom_WINDOW_STATE = reply->atom; free(reply); reply = xcb_intern_atom_reply(HostX.conn, cookie_WINDOW_STATE_FULLSCREEN, NULL); atom_WINDOW_STATE_FULLSCREEN = reply->atom; free(reply); for (index = 0; index < HostX.n_screens; index++) { EphyrScrPriv *scrpriv = HostX.screens[index]->driver; xcb_change_property(HostX.conn, PropModeReplace, scrpriv->win, atom_WINDOW_STATE, XCB_ATOM_ATOM, 32, 1, &atom_WINDOW_STATE_FULLSCREEN); } } static void hostx_toggle_damage_debug(void) { HostXWantDamageDebug ^= 1; } void hostx_handle_signal(int signum) { hostx_toggle_damage_debug(); EPHYR_DBG("Signal caught. Damage Debug:%i\n", HostXWantDamageDebug); } void hostx_use_resname(char *name, int fromcmd) { ephyrResName = name; ephyrResNameFromCmd = fromcmd; } void hostx_set_title(char *title) { ephyrTitle = title; } #ifdef __SUNPRO_C /* prevent "Function has no return statement" error for x_io_error_handler */ #pragma does_not_return(exit) #endif int hostx_init(void) { uint32_t attrs[2]; uint32_t attr_mask = 0; xcb_pixmap_t cursor_pxm; xcb_gcontext_t cursor_gc; uint16_t red, green, blue; uint32_t pixel; int index; char *tmpstr; char *class_hint; size_t class_len; const xcb_query_extension_reply_t *shm_rep; xcb_screen_t *xscreen; xcb_rectangle_t rect = { 0, 0, 1, 1 }; attrs[0] = XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY; attr_mask |= XCB_CW_EVENT_MASK; EPHYR_DBG("mark"); #ifdef GLAMOR if (ephyr_glamor) HostX.conn = ephyr_glamor_connect(); else #endif HostX.conn = xcb_connect(NULL, &HostX.screen); if (xcb_connection_has_error(HostX.conn)) { fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n"); exit(1); } xscreen = xcb_aux_get_screen(HostX.conn, HostX.screen); HostX.winroot = xscreen->root; HostX.gc = xcb_generate_id(HostX.conn); HostX.depth = xscreen->root_depth; #ifdef GLAMOR if (ephyr_glamor) { HostX.visual = ephyr_glamor_get_visual(); if (HostX.visual->visual_id != xscreen->root_visual) { attrs[1] = xcb_generate_id(HostX.conn); attr_mask |= XCB_CW_COLORMAP; xcb_create_colormap(HostX.conn, XCB_COLORMAP_ALLOC_NONE, attrs[1], HostX.winroot, HostX.visual->visual_id); } } else #endif HostX.visual = xcb_aux_find_visual_by_id(xscreen,xscreen->root_visual); xcb_create_gc(HostX.conn, HostX.gc, HostX.winroot, 0, NULL); cookie_WINDOW_STATE = xcb_intern_atom(HostX.conn, FALSE, strlen("_NET_WM_STATE"), "_NET_WM_STATE"); cookie_WINDOW_STATE_FULLSCREEN = xcb_intern_atom(HostX.conn, FALSE, strlen("_NET_WM_STATE_FULLSCREEN"), "_NET_WM_STATE_FULLSCREEN"); for (index = 0; index < HostX.n_screens; index++) { KdScreenInfo *screen = HostX.screens[index]; EphyrScrPriv *scrpriv = screen->driver; scrpriv->win = xcb_generate_id(HostX.conn); scrpriv->server_depth = HostX.depth; scrpriv->ximg = NULL; scrpriv->win_x = 0; scrpriv->win_y = 0; if (scrpriv->win_pre_existing != XCB_WINDOW_NONE) { xcb_get_geometry_reply_t *prewin_geom; xcb_get_geometry_cookie_t cookie; xcb_generic_error_t *e = NULL; /* Get screen size from existing window */ cookie = xcb_get_geometry(HostX.conn, scrpriv->win_pre_existing); prewin_geom = xcb_get_geometry_reply(HostX.conn, cookie, &e); if (e) { free(e); free(prewin_geom); fprintf (stderr, "\nXephyr -parent window' does not exist!\n"); exit (1); } scrpriv->win_width = prewin_geom->width; scrpriv->win_height = prewin_geom->height; free(prewin_geom); xcb_create_window(HostX.conn, XCB_COPY_FROM_PARENT, scrpriv->win, scrpriv->win_pre_existing, 0,0, scrpriv->win_width, scrpriv->win_height, 0, XCB_WINDOW_CLASS_COPY_FROM_PARENT, HostX.visual->visual_id, attr_mask, attrs); } else { xcb_create_window(HostX.conn, XCB_COPY_FROM_PARENT, scrpriv->win, HostX.winroot, 0,0,100,100, /* will resize */ 0, XCB_WINDOW_CLASS_COPY_FROM_PARENT, HostX.visual->visual_id, attr_mask, attrs); hostx_set_win_title(screen, "(ctrl+shift grabs mouse and keyboard)"); if (HostX.use_fullscreen) { scrpriv->win_width = xscreen->width_in_pixels; scrpriv->win_height = xscreen->height_in_pixels; hostx_set_fullscreen_hint(); } else if (scrpriv->output) { hostx_get_output_geometry(scrpriv->output, &scrpriv->win_x, &scrpriv->win_y, &scrpriv->win_width, &scrpriv->win_height); HostX.use_fullscreen = TRUE; hostx_set_fullscreen_hint(); } tmpstr = getenv("RESOURCE_NAME"); if (tmpstr && (!ephyrResNameFromCmd)) ephyrResName = tmpstr; class_len = strlen(ephyrResName) + 1 + strlen("Xephyr") + 1; class_hint = malloc(class_len); if (class_hint) { strcpy(class_hint, ephyrResName); strcpy(class_hint + strlen(ephyrResName) + 1, "Xephyr"); xcb_change_property(HostX.conn, XCB_PROP_MODE_REPLACE, scrpriv->win, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 8, class_len, class_hint); free(class_hint); } } } if (!xcb_aux_parse_color("red", &red, &green, &blue)) { xcb_lookup_color_cookie_t c = xcb_lookup_color(HostX.conn, xscreen->default_colormap, 3, "red"); xcb_lookup_color_reply_t *reply = xcb_lookup_color_reply(HostX.conn, c, NULL); red = reply->exact_red; green = reply->exact_green; blue = reply->exact_blue; free(reply); } { xcb_alloc_color_cookie_t c = xcb_alloc_color(HostX.conn, xscreen->default_colormap, red, green, blue); xcb_alloc_color_reply_t *r = xcb_alloc_color_reply(HostX.conn, c, NULL); red = r->red; green = r->green; blue = r->blue; pixel = r->pixel; free(r); } xcb_change_gc(HostX.conn, HostX.gc, XCB_GC_FOREGROUND, &pixel); cursor_pxm = xcb_generate_id(HostX.conn); xcb_create_pixmap(HostX.conn, 1, cursor_pxm, HostX.winroot, 1, 1); cursor_gc = xcb_generate_id(HostX.conn); pixel = 0; xcb_create_gc(HostX.conn, cursor_gc, cursor_pxm, XCB_GC_FOREGROUND, &pixel); xcb_poly_fill_rectangle(HostX.conn, cursor_pxm, cursor_gc, 1, &rect); xcb_free_gc(HostX.conn, cursor_gc); HostX.empty_cursor = xcb_generate_id(HostX.conn); xcb_create_cursor(HostX.conn, HostX.empty_cursor, cursor_pxm, cursor_pxm, 0,0,0, 0,0,0, 1,1); xcb_free_pixmap(HostX.conn, cursor_pxm); if (!hostx_want_host_cursor ()) { CursorVisible = TRUE; /* Ditch the cursor, we provide our 'own' */ for (index = 0; index < HostX.n_screens; index++) { KdScreenInfo *screen = HostX.screens[index]; EphyrScrPriv *scrpriv = screen->driver; xcb_change_window_attributes(HostX.conn, scrpriv->win, XCB_CW_CURSOR, &HostX.empty_cursor); } } /* Try to get share memory ximages for a little bit more speed */ shm_rep = xcb_get_extension_data(HostX.conn, &xcb_shm_id); if (!shm_rep || !shm_rep->present || getenv("XEPHYR_NO_SHM")) { fprintf(stderr, "\nXephyr unable to use SHM XImages\n"); HostX.have_shm = FALSE; } else { /* Really really check we have shm - better way ?*/ xcb_shm_segment_info_t shminfo; xcb_generic_error_t *e; xcb_void_cookie_t cookie; xcb_shm_seg_t shmseg; HostX.have_shm = TRUE; shminfo.shmid = shmget(IPC_PRIVATE, 1, IPC_CREAT|0777); shminfo.shmaddr = shmat(shminfo.shmid,0,0); shmseg = xcb_generate_id(HostX.conn); cookie = xcb_shm_attach_checked(HostX.conn, shmseg, shminfo.shmid, TRUE); e = xcb_request_check(HostX.conn, cookie); if (e) { fprintf(stderr, "\nXephyr unable to use SHM XImages\n"); HostX.have_shm = FALSE; free(e); } shmdt(shminfo.shmaddr); shmctl(shminfo.shmid, IPC_RMID, 0); } xcb_flush(HostX.conn); /* Setup the pause time between paints when debugging updates */ HostX.damage_debug_msec = 20000; /* 1/50 th of a second */ if (getenv("XEPHYR_PAUSE")) { HostX.damage_debug_msec = strtol(getenv("XEPHYR_PAUSE"), NULL, 0); EPHYR_DBG("pause is %li\n", HostX.damage_debug_msec); } return 1; } int hostx_get_depth(void) { return HostX.depth; } int hostx_get_server_depth(KdScreenInfo *screen) { EphyrScrPriv *scrpriv = screen->driver; return scrpriv ? scrpriv->server_depth : 0; } int hostx_get_bpp(KdScreenInfo *screen) { EphyrScrPriv *scrpriv = screen->driver; if (!scrpriv) return 0; if (host_depth_matches_server(scrpriv)) return HostX.visual->bits_per_rgb_value; else return scrpriv->server_depth; /*XXX correct ?*/ } void hostx_get_visual_masks(KdScreenInfo *screen, CARD32 *rmsk, CARD32 *gmsk, CARD32 *bmsk) { EphyrScrPriv *scrpriv = screen->driver; if (!scrpriv) return; if (host_depth_matches_server(scrpriv)) { *rmsk = HostX.visual->red_mask; *gmsk = HostX.visual->green_mask; *bmsk = HostX.visual->blue_mask; } else if (scrpriv->server_depth == 16) { /* Assume 16bpp 565 */ *rmsk = 0xf800; *gmsk = 0x07e0; *bmsk = 0x001f; } else { *rmsk = 0x0; *gmsk = 0x0; *bmsk = 0x0; } } static int hostx_calculate_color_shift(unsigned long mask) { int shift = 1; /* count # of bits in mask */ while ((mask = (mask >> 1))) shift++; /* cmap entry is an unsigned char so adjust it by size of that */ shift = shift - sizeof(unsigned char) * 8; if (shift < 0) shift = 0; return shift; } void hostx_set_cmap_entry(ScreenPtr pScreen, unsigned char idx, unsigned char r, unsigned char g, unsigned char b) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; /* need to calculate the shifts for RGB because server could be BGR. */ /* XXX Not sure if this is correct for 8 on 16, but this works for 8 on 24.*/ static int rshift, bshift, gshift = 0; static int first_time = 1; if (first_time) { first_time = 0; rshift = hostx_calculate_color_shift(HostX.visual->red_mask); gshift = hostx_calculate_color_shift(HostX.visual->green_mask); bshift = hostx_calculate_color_shift(HostX.visual->blue_mask); } scrpriv->cmap[idx] = ((r << rshift) & HostX.visual->red_mask) | ((g << gshift) & HostX.visual->green_mask) | ((b << bshift) & HostX.visual->blue_mask); } /** * hostx_screen_init creates the XImage that will contain the front buffer of * the ephyr screen, and possibly offscreen memory. * * @param width width of the screen * @param height height of the screen * @param buffer_height height of the rectangle to be allocated. * * hostx_screen_init() creates an XImage, using MIT-SHM if it's available. * buffer_height can be used to create a larger offscreen buffer, which is used * by fakexa for storing offscreen pixmap data. */ void * hostx_screen_init(KdScreenInfo *screen, int x, int y, int width, int height, int buffer_height, int *bytes_per_line, int *bits_per_pixel) { EphyrScrPriv *scrpriv = screen->driver; Bool shm_success = FALSE; if (!scrpriv) { fprintf(stderr, "%s: Error in accessing hostx data\n", __func__); exit(1); } EPHYR_DBG("host_screen=%p x=%d, y=%d, wxh=%dx%d, buffer_height=%d", host_screen, x, y, width, height, buffer_height); if (scrpriv->ximg != NULL) { /* Free up the image data if previously used * i.ie called by server reset */ if (HostX.have_shm) { xcb_shm_detach(HostX.conn, scrpriv->shminfo.shmseg); xcb_image_destroy(scrpriv->ximg); shmdt(scrpriv->shminfo.shmaddr); shmctl(scrpriv->shminfo.shmid, IPC_RMID, 0); } else { free(scrpriv->ximg->data); scrpriv->ximg->data = NULL; xcb_image_destroy(scrpriv->ximg); } } if (!ephyr_glamor && HostX.have_shm) { scrpriv->ximg = xcb_image_create_native(HostX.conn, width, buffer_height, XCB_IMAGE_FORMAT_Z_PIXMAP, HostX.depth, NULL, ~0, NULL); scrpriv->shminfo.shmid = shmget(IPC_PRIVATE, scrpriv->ximg->stride * buffer_height, IPC_CREAT | 0777); scrpriv->ximg->data = shmat(scrpriv->shminfo.shmid, 0, 0); scrpriv->shminfo.shmaddr = scrpriv->ximg->data; if (scrpriv->ximg->data == (uint8_t *) -1) { EPHYR_DBG ("Can't attach SHM Segment, falling back to plain XImages"); HostX.have_shm = FALSE; xcb_image_destroy (scrpriv->ximg); shmctl(scrpriv->shminfo.shmid, IPC_RMID, 0); } else { EPHYR_DBG("SHM segment attached %p", scrpriv->shminfo.shmaddr); scrpriv->shminfo.shmseg = xcb_generate_id(HostX.conn); xcb_shm_attach(HostX.conn, scrpriv->shminfo.shmseg, scrpriv->shminfo.shmid, FALSE); shm_success = TRUE; } } if (!ephyr_glamor && !shm_success) { EPHYR_DBG("Creating image %dx%d for screen scrpriv=%p\n", width, buffer_height, scrpriv); scrpriv->ximg = xcb_image_create_native(HostX.conn, width, buffer_height, XCB_IMAGE_FORMAT_Z_PIXMAP, HostX.depth, NULL, ~0, NULL); scrpriv->ximg->data = malloc(scrpriv->ximg->stride * buffer_height); } { uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; uint32_t values[2] = {width, height}; xcb_configure_window(HostX.conn, scrpriv->win, mask, values); } if (scrpriv->win_pre_existing == None && !EphyrWantResize) { /* Ask the WM to keep our size static */ xcb_size_hints_t size_hints = {0}; size_hints.max_width = size_hints.min_width = width; size_hints.max_height = size_hints.min_height = height; size_hints.flags = (XCB_ICCCM_SIZE_HINT_P_MIN_SIZE | XCB_ICCCM_SIZE_HINT_P_MAX_SIZE); xcb_icccm_set_wm_normal_hints(HostX.conn, scrpriv->win, &size_hints); } xcb_map_window(HostX.conn, scrpriv->win); /* Set explicit window position if it was informed in * -screen option (WxH+X or WxH+X+Y). Otherwise, accept the * position set by WM. * The trick here is putting this code after xcb_map_window() call, * so these values won't be overriden by WM. */ if (scrpriv->win_explicit_position) { uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; uint32_t values[2] = {x, y}; xcb_configure_window(HostX.conn, scrpriv->win, mask, values); } xcb_aux_sync(HostX.conn); scrpriv->win_width = width; scrpriv->win_height = height; scrpriv->win_x = x; scrpriv->win_y = y; #ifdef GLAMOR if (ephyr_glamor) { *bytes_per_line = 0; *bits_per_pixel = 0; ephyr_glamor_set_window_size(scrpriv->glamor, scrpriv->win_width, scrpriv->win_height); return NULL; } else #endif if (host_depth_matches_server(scrpriv)) { *bytes_per_line = scrpriv->ximg->stride; *bits_per_pixel = scrpriv->ximg->bpp; EPHYR_DBG("Host matches server"); return scrpriv->ximg->data; } else { int bytes_per_pixel = scrpriv->server_depth >> 3; int stride = (width * bytes_per_pixel + 0x3) & ~0x3; *bytes_per_line = stride; *bits_per_pixel = scrpriv->server_depth; EPHYR_DBG("server bpp %i", bytes_per_pixel); scrpriv->fb_data = malloc (stride * buffer_height); return scrpriv->fb_data; } } static void hostx_paint_debug_rect(KdScreenInfo *screen, int x, int y, int width, int height); void hostx_paint_rect(KdScreenInfo *screen, int sx, int sy, int dx, int dy, int width, int height) { EphyrScrPriv *scrpriv = screen->driver; EPHYR_DBG("painting in screen %d\n", scrpriv->mynum); #ifdef GLAMOR if (ephyr_glamor) { BoxRec box; RegionRec region; box.x1 = dx; box.y1 = dy; box.x2 = dx + width; box.y2 = dy + height; RegionInit(®ion, &box, 1); ephyr_glamor_damage_redisplay(scrpriv->glamor, ®ion); RegionUninit(®ion); return; } #endif /* * Copy the image data updated by the shadow layer * on to the window */ if (HostXWantDamageDebug) { hostx_paint_debug_rect(screen, dx, dy, width, height); } /* * If the depth of the ephyr server is less than that of the host, * the kdrive fb does not point to the ximage data but to a buffer * ( fb_data ), we shift the various bits from this onto the XImage * so they match the host. * * Note, This code is pretty new ( and simple ) so may break on * endian issues, 32 bpp host etc. * Not sure if 8bpp case is right either. * ... and it will be slower than the matching depth case. */ if (!host_depth_matches_server(scrpriv)) { int x, y, idx, bytes_per_pixel = (scrpriv->server_depth >> 3); int stride = (scrpriv->win_width * bytes_per_pixel + 0x3) & ~0x3; unsigned char r, g, b; unsigned long host_pixel; EPHYR_DBG("Unmatched host depth scrpriv=%p\n", scrpriv); for (y = sy; y < sy + height; y++) for (x = sx; x < sx + width; x++) { idx = y * stride + x * bytes_per_pixel; switch (scrpriv->server_depth) { case 16: { unsigned short pixel = *(unsigned short *) (scrpriv->fb_data + idx); r = ((pixel & 0xf800) >> 8); g = ((pixel & 0x07e0) >> 3); b = ((pixel & 0x001f) << 3); host_pixel = (r << 16) | (g << 8) | (b); xcb_image_put_pixel(scrpriv->ximg, x, y, host_pixel); break; } case 8: { unsigned char pixel = *(unsigned char *) (scrpriv->fb_data + idx); xcb_image_put_pixel(scrpriv->ximg, x, y, scrpriv->cmap[pixel]); break; } default: break; } } } if (HostX.have_shm) { xcb_image_shm_put(HostX.conn, scrpriv->win, HostX.gc, scrpriv->ximg, scrpriv->shminfo, sx, sy, dx, dy, width, height, FALSE); } else { xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, scrpriv->ximg, dx, dy, 0); } xcb_aux_sync(HostX.conn); } static void hostx_paint_debug_rect(KdScreenInfo *screen, int x, int y, int width, int height) { EphyrScrPriv *scrpriv = screen->driver; struct timespec tspec; xcb_rectangle_t rect = { .x = x, .y = y, .width = width, .height = height }; xcb_void_cookie_t cookie; xcb_generic_error_t *e; tspec.tv_sec = HostX.damage_debug_msec / (1000000); tspec.tv_nsec = (HostX.damage_debug_msec % 1000000) * 1000; EPHYR_DBG("msec: %li tv_sec %li, tv_msec %li", HostX.damage_debug_msec, tspec.tv_sec, tspec.tv_nsec); /* fprintf(stderr, "Xephyr updating: %i+%i %ix%i\n", x, y, width, height); */ cookie = xcb_poly_fill_rectangle_checked(HostX.conn, scrpriv->win, HostX.gc, 1, &rect); e = xcb_request_check(HostX.conn, cookie); free(e); /* nanosleep seems to work better than usleep for me... */ nanosleep(&tspec, NULL); } void hostx_load_keymap(void) { int min_keycode, max_keycode; min_keycode = xcb_get_setup(HostX.conn)->min_keycode; max_keycode = xcb_get_setup(HostX.conn)->max_keycode; EPHYR_DBG("min: %d, max: %d", min_keycode, max_keycode); ephyrKeySyms.minKeyCode = min_keycode; ephyrKeySyms.maxKeyCode = max_keycode; } xcb_connection_t * hostx_get_xcbconn(void) { return HostX.conn; } int hostx_get_screen(void) { return HostX.screen; } int hostx_get_window(int a_screen_number) { EphyrScrPriv *scrpriv; if (a_screen_number < 0 || a_screen_number >= HostX.n_screens) { EPHYR_LOG_ERROR("bad screen number:%d\n", a_screen_number); return 0; } scrpriv = HostX.screens[a_screen_number]->driver; return scrpriv->win; } int hostx_get_window_attributes(int a_window, EphyrHostWindowAttributes * a_attrs) { xcb_get_geometry_cookie_t geom_cookie; xcb_get_window_attributes_cookie_t attr_cookie; xcb_get_geometry_reply_t *geom_reply; xcb_get_window_attributes_reply_t *attr_reply; geom_cookie = xcb_get_geometry(HostX.conn, a_window); attr_cookie = xcb_get_window_attributes(HostX.conn, a_window); geom_reply = xcb_get_geometry_reply(HostX.conn, geom_cookie, NULL); attr_reply = xcb_get_window_attributes_reply(HostX.conn, attr_cookie, NULL); a_attrs->x = geom_reply->x; a_attrs->y = geom_reply->y; a_attrs->width = geom_reply->width; a_attrs->height = geom_reply->height; a_attrs->visualid = attr_reply->visual; free(geom_reply); free(attr_reply); return TRUE; } int hostx_get_visuals_info(EphyrHostVisualInfo ** a_visuals, int *a_num_entries) { Bool is_ok = FALSE; EphyrHostVisualInfo *host_visuals = NULL; int nb_items = 0, i = 0, screen_num; xcb_screen_iterator_t screens; xcb_depth_iterator_t depths; EPHYR_RETURN_VAL_IF_FAIL(a_visuals && a_num_entries, FALSE); EPHYR_LOG("enter\n"); screens = xcb_setup_roots_iterator(xcb_get_setup(HostX.conn)); for (screen_num = 0; screens.rem; screen_num++, xcb_screen_next(&screens)) { depths = xcb_screen_allowed_depths_iterator(screens.data); for (; depths.rem; xcb_depth_next(&depths)) { xcb_visualtype_t *visuals = xcb_depth_visuals(depths.data); EphyrHostVisualInfo *tmp_visuals = realloc(host_visuals, (nb_items + depths.data->visuals_len) * sizeof(EphyrHostVisualInfo)); if (!tmp_visuals) { goto out; } host_visuals = tmp_visuals; for (i = 0; i < depths.data->visuals_len; i++) { host_visuals[nb_items + i].visualid = visuals[i].visual_id; host_visuals[nb_items + i].screen = screen_num; host_visuals[nb_items + i].depth = depths.data->depth; host_visuals[nb_items + i].class = visuals[i]._class; host_visuals[nb_items + i].red_mask = visuals[i].red_mask; host_visuals[nb_items + i].green_mask = visuals[i].green_mask; host_visuals[nb_items + i].blue_mask = visuals[i].blue_mask; host_visuals[nb_items + i].colormap_size = visuals[i].colormap_entries; host_visuals[nb_items + i].bits_per_rgb = visuals[i].bits_per_rgb_value; } nb_items += depths.data->visuals_len; } } EPHYR_LOG("host advertises %d visuals\n", nb_items); *a_visuals = host_visuals; *a_num_entries = nb_items; host_visuals = NULL; is_ok = TRUE; out: free(host_visuals); host_visuals = NULL; EPHYR_LOG("leave\n"); return is_ok; } int hostx_create_window(int a_screen_number, EphyrBox * a_geometry, int a_visual_id, int *a_host_peer /*out parameter */ ) { Bool is_ok = FALSE; xcb_window_t win; int winmask = 0; uint32_t attrs[2]; xcb_screen_t *screen = xcb_aux_get_screen(HostX.conn, hostx_get_screen()); xcb_visualtype_t *visual; int depth = 0; EphyrScrPriv *scrpriv = HostX.screens[a_screen_number]->driver; EPHYR_RETURN_VAL_IF_FAIL(screen && a_geometry, FALSE); EPHYR_LOG("enter\n"); visual = xcb_aux_find_visual_by_id(screen, a_visual_id); if (!visual) { EPHYR_LOG_ERROR ("argh, could not find a remote visual with id:%d\n", a_visual_id); goto out; } depth = xcb_aux_get_depth_of_visual(screen, a_visual_id); winmask = XCB_CW_EVENT_MASK | XCB_CW_COLORMAP; attrs[0] = XCB_EVENT_MASK_BUTTON_PRESS |XCB_EVENT_MASK_BUTTON_RELEASE |XCB_EVENT_MASK_POINTER_MOTION |XCB_EVENT_MASK_KEY_PRESS |XCB_EVENT_MASK_KEY_RELEASE |XCB_EVENT_MASK_EXPOSURE; attrs[1] = xcb_generate_id(HostX.conn); xcb_create_colormap(HostX.conn, XCB_COLORMAP_ALLOC_NONE, attrs[1], hostx_get_window(a_screen_number), a_visual_id); win = xcb_generate_id(HostX.conn); xcb_create_window(HostX.conn, depth, win, hostx_get_window (a_screen_number), a_geometry->x, a_geometry->y, a_geometry->width, a_geometry->height, 0, XCB_WINDOW_CLASS_COPY_FROM_PARENT, a_visual_id, winmask, attrs); if (scrpriv->peer_win == XCB_NONE) { scrpriv->peer_win = win; } else { EPHYR_LOG_ERROR("multiple peer windows created for same screen\n"); } xcb_flush(HostX.conn); xcb_map_window(HostX.conn, win); *a_host_peer = win; is_ok = TRUE; out: EPHYR_LOG("leave\n"); return is_ok; } int hostx_destroy_window(int a_win) { xcb_destroy_window(HostX.conn, a_win); xcb_flush(HostX.conn); return TRUE; } int hostx_set_window_geometry(int a_win, EphyrBox * a_geo) { uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; uint32_t values[4]; EPHYR_RETURN_VAL_IF_FAIL(a_geo, FALSE); EPHYR_LOG("enter. x,y,w,h:(%d,%d,%d,%d)\n", a_geo->x, a_geo->y, a_geo->width, a_geo->height); values[0] = a_geo->x; values[1] = a_geo->y; values[2] = a_geo->width; values[3] = a_geo->height; xcb_configure_window(HostX.conn, a_win, mask, values); EPHYR_LOG("leave\n"); return TRUE; } int hostx_set_window_bounding_rectangles(int a_window, EphyrRect * a_rects, int a_num_rects) { Bool is_ok = FALSE; int i = 0; xcb_rectangle_t *rects = NULL; EPHYR_RETURN_VAL_IF_FAIL(a_rects, FALSE); EPHYR_LOG("enter. num rects:%d\n", a_num_rects); rects = calloc(a_num_rects, sizeof (xcb_rectangle_t)); if (!rects) goto out; for (i = 0; i < a_num_rects; i++) { rects[i].x = a_rects[i].x1; rects[i].y = a_rects[i].y1; rects[i].width = abs(a_rects[i].x2 - a_rects[i].x1); rects[i].height = abs(a_rects[i].y2 - a_rects[i].y1); EPHYR_LOG("borders clipped to rect[x:%d,y:%d,w:%d,h:%d]\n", rects[i].x, rects[i].y, rects[i].width, rects[i].height); } xcb_shape_rectangles(HostX.conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_YX_BANDED, a_window, 0, 0, a_num_rects, rects); is_ok = TRUE; out: free(rects); rects = NULL; EPHYR_LOG("leave\n"); return is_ok; } #ifdef XF86DRI typedef struct { int is_valid; int local_id; int remote_id; } ResourcePair; #define RESOURCE_PEERS_SIZE 1024*10 static ResourcePair resource_peers[RESOURCE_PEERS_SIZE]; int hostx_allocate_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id) { int i = 0; ResourcePair *peer = NULL; /* * first make sure a resource peer * does not exist already for * a_local_resource_id */ for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { if (resource_peers[i].is_valid && resource_peers[i].local_id == a_local_resource_id) { peer = &resource_peers[i]; break; } } /* * find one free peer entry, an feed it with */ if (!peer) { for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { if (!resource_peers[i].is_valid) { peer = &resource_peers[i]; break; } } if (peer) { peer->remote_id = xcb_generate_id(HostX.conn); peer->local_id = a_local_resource_id; peer->is_valid = TRUE; } } if (peer) { *a_remote_resource_id = peer->remote_id; return TRUE; } return FALSE; } int hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id) { int i = 0; ResourcePair *peer = NULL; for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { if (resource_peers[i].is_valid && resource_peers[i].local_id == a_local_resource_id) { peer = &resource_peers[i]; break; } } if (peer) { *a_remote_resource_id = peer->remote_id; return TRUE; } return FALSE; } #endif /* XF86DRI */ #ifdef GLAMOR Bool ephyr_glamor_init(ScreenPtr screen) { KdScreenPriv(screen); KdScreenInfo *kd_screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = kd_screen->driver; scrpriv->glamor = ephyr_glamor_glx_screen_init(scrpriv->win); ephyr_glamor_set_window_size(scrpriv->glamor, scrpriv->win_width, scrpriv->win_height); glamor_init(screen, GLAMOR_USE_SCREEN | GLAMOR_USE_PICTURE_SCREEN); return TRUE; } Bool ephyr_glamor_create_screen_resources(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *kd_screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = kd_screen->driver; PixmapPtr screen_pixmap; uint32_t tex; if (!ephyr_glamor) return TRUE; /* kdrive's fbSetupScreen() told mi to have * miCreateScreenResources() (which is called before this) make a * scratch pixmap wrapping ephyr-glamor's NULL * KdScreenInfo->fb.framebuffer. * * We want a real (texture-based) screen pixmap at this point. * This is what glamor will render into, and we'll then texture * out of that into the host's window to present the results. * * Thus, delete the current screen pixmap, and put a fresh one in. */ screen_pixmap = pScreen->GetScreenPixmap(pScreen); pScreen->DestroyPixmap(screen_pixmap); screen_pixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height, pScreen->rootDepth, GLAMOR_CREATE_NO_LARGE); pScreen->SetScreenPixmap(screen_pixmap); /* Tell the GLX code what to GL texture to read from. */ tex = glamor_get_pixmap_texture(screen_pixmap); ephyr_glamor_set_texture(scrpriv->glamor, tex); return TRUE; } void ephyr_glamor_enable(ScreenPtr screen) { } void ephyr_glamor_disable(ScreenPtr screen) { } void ephyr_glamor_fini(ScreenPtr screen) { KdScreenPriv(screen); KdScreenInfo *kd_screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = kd_screen->driver; glamor_fini(screen); ephyr_glamor_glx_screen_fini(scrpriv->glamor); scrpriv->glamor = NULL; } #endif xorg-server-1.17.1/hw/kdrive/ephyr/man/0000775000175100017510000000000012466505446014711 500000000000000xorg-server-1.17.1/hw/kdrive/ephyr/man/Makefile.am0000664000175100017510000000007212160102336016642 00000000000000include $(top_srcdir)/manpages.am appman_PRE = Xephyr.man xorg-server-1.17.1/hw/kdrive/ephyr/man/Makefile.in0000664000175100017510000006234712466505431016704 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = hw/kdrive/ephyr/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man appman_PRE = Xephyr.man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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/kdrive/ephyr/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/kdrive/ephyr/man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/kdrive/ephyr/man/Xephyr.man0000664000175100017510000000617212432306326016600 00000000000000.\" .\" Copyright (c) Matthieu Herrb .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .TH Xephyr __appmansuffix__ __vendorversion__ .SH NAME Xephyr - X server outputting to a window on a pre-existing X display .SH SYNOPSIS .B Xephyr .RI [\fB:\fP display ] .RI [ option .IR ... ] .SH DESCRIPTION .B Xephyr is a kdrive server that outputs to a window on a pre-existing "host" X display. Think .I Xnest but with support for modern extensions like composite, damage and randr. .PP Unlike .I Xnest which is an X proxy, i.e. limited to the capabilities of the host X server, .B Xephyr is a real X server which uses the host X server window as "framebuffer" via fast SHM XImages. .PP It also has support for "visually" debugging what the server is painting. .SH OPTIONS The server accepts all the standard options of Xserver(__appmansuffix__) and the following additional options: .TP 8 .BI -screen " width" x height sets the screen size. .TP 8 .BI -parent " id" uses existing window .I id . If a .BI -screen argument follows a .BI -parent argument, this screen is embedded into the given window. .TP 8 .B -host-cursor set 'cursor acceleration': The host's cursor is reused. This is only really there to aid debugging by avoiding server paints for the cursor. Performance improvement is negligible. .TP 8 .B -resizeable Allow the Xephyr window to be resized, even if not embedded into a parent window. By default, the Xephyr window has a fixed size. .TP 8 .B -no-host-grab Disable grabbing the keyboard and mouse. .SH "SIGNALS" Send a SIGUSR1 to the server (e.g. pkill -USR1 Xephyr) to toggle the debugging mode. In this mode red rectangles are painted to screen areas getting painted before painting the actual content. The delay between this can be altered by setting a XEPHYR_PAUSE env var to a value in micro seconds. .SH CAVEATS .PP .IP \(bu 2 Rotated displays are currently updated via full blits. This is slower than a normal orientated display. Debug mode will therefore not be of much use rotated. .IP \(bu 2 The '-host-cursor' cursor is static in its appearance. .IP \(bu 2 The build gets a warning about 'nanosleep'. I think the various '-D' build flags are causing this. I haven't figured as yet how to work round it. It doesn't appear to break anything however. .IP \(bu 2 Keyboard handling is basic but works. .IP \(bu 2 Mouse button 5 probably won't work. .SH "SEE ALSO" X(__miscmansuffix__), Xserver(__appmansuffix__) .SH AUTHOR Matthew Allum 2004 xorg-server-1.17.1/hw/kdrive/ephyr/ephyr_draw.c0000664000175100017510000003500612366220413016355 00000000000000/* * Copyright © 2006 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt * */ #ifdef HAVE_CONFIG_H #include #endif #include "ephyr.h" #include "exa_priv.h" #include "fbpict.h" #define EPHYR_TRACE_DRAW 0 #if EPHYR_TRACE_DRAW #define TRACE_DRAW() ErrorF("%s\n", __FUNCTION__); #else #define TRACE_DRAW() do { } while (0) #endif /* Use some oddball alignments, to expose issues in alignment handling in EXA. */ #define EPHYR_OFFSET_ALIGN 24 #define EPHYR_PITCH_ALIGN 24 #define EPHYR_OFFSCREEN_SIZE (16 * 1024 * 1024) #define EPHYR_OFFSCREEN_BASE (1 * 1024 * 1024) /** * Forces a real devPrivate.ptr for hidden pixmaps, so that we can call down to * fb functions. */ static void ephyrPreparePipelinedAccess(PixmapPtr pPix, int index) { KdScreenPriv(pPix->drawable.pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; assert(fakexa->saved_ptrs[index] == NULL); fakexa->saved_ptrs[index] = pPix->devPrivate.ptr; if (pPix->devPrivate.ptr != NULL) return; pPix->devPrivate.ptr = fakexa->exa->memoryBase + exaGetPixmapOffset(pPix); } /** * Restores the original devPrivate.ptr of the pixmap from before we messed with * it. */ static void ephyrFinishPipelinedAccess(PixmapPtr pPix, int index) { KdScreenPriv(pPix->drawable.pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; pPix->devPrivate.ptr = fakexa->saved_ptrs[index]; fakexa->saved_ptrs[index] = NULL; } /** * Sets up a scratch GC for fbFill, and saves other parameters for the * ephyrSolid implementation. */ static Bool ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg) { ScreenPtr pScreen = pPix->drawable.pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; ChangeGCVal tmpval[3]; ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST); fakexa->pDst = pPix; fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen); tmpval[0].val = alu; tmpval[1].val = pm; tmpval[2].val = fg; ChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval); ValidateGC(&pPix->drawable, fakexa->pGC); TRACE_DRAW(); return TRUE; } /** * Does an fbFill of the rectangle to be drawn. */ static void ephyrSolid(PixmapPtr pPix, int x1, int y1, int x2, int y2) { ScreenPtr pScreen = pPix->drawable.pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; fbFill(&fakexa->pDst->drawable, fakexa->pGC, x1, y1, x2 - x1, y2 - y1); } /** * Cleans up the scratch GC created in ephyrPrepareSolid. */ static void ephyrDoneSolid(PixmapPtr pPix) { ScreenPtr pScreen = pPix->drawable.pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; FreeScratchGC(fakexa->pGC); ephyrFinishPipelinedAccess(pPix, EXA_PREPARE_DEST); } /** * Sets up a scratch GC for fbCopyArea, and saves other parameters for the * ephyrCopy implementation. */ static Bool ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu, Pixel pm) { ScreenPtr pScreen = pDst->drawable.pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; ChangeGCVal tmpval[2]; ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST); ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); fakexa->pSrc = pSrc; fakexa->pDst = pDst; fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen); tmpval[0].val = alu; tmpval[1].val = pm; ChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval); ValidateGC(&pDst->drawable, fakexa->pGC); TRACE_DRAW(); return TRUE; } /** * Does an fbCopyArea to take care of the requested copy. */ static void ephyrCopy(PixmapPtr pDst, int srcX, int srcY, int dstX, int dstY, int w, int h) { ScreenPtr pScreen = pDst->drawable.pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; fbCopyArea(&fakexa->pSrc->drawable, &fakexa->pDst->drawable, fakexa->pGC, srcX, srcY, w, h, dstX, dstY); } /** * Cleans up the scratch GC created in ephyrPrepareCopy. */ static void ephyrDoneCopy(PixmapPtr pDst) { ScreenPtr pScreen = pDst->drawable.pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; FreeScratchGC(fakexa->pGC); ephyrFinishPipelinedAccess(fakexa->pSrc, EXA_PREPARE_SRC); ephyrFinishPipelinedAccess(fakexa->pDst, EXA_PREPARE_DEST); } /** * Reports that we can always accelerate the given operation. This may not be * desirable from an EXA testing standpoint -- testing the fallback paths would * be useful, too. */ static Bool ephyrCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { /* Exercise the component alpha helper, so fail on this case like a normal * driver */ if (pMaskPicture && pMaskPicture->componentAlpha && op == PictOpOver) return FALSE; return TRUE; } /** * Saves off the parameters for ephyrComposite. */ static Bool ephyrPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { KdScreenPriv(pDst->drawable.pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST); ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); if (pMask != NULL) ephyrPreparePipelinedAccess(pMask, EXA_PREPARE_MASK); fakexa->op = op; fakexa->pSrcPicture = pSrcPicture; fakexa->pMaskPicture = pMaskPicture; fakexa->pDstPicture = pDstPicture; fakexa->pSrc = pSrc; fakexa->pMask = pMask; fakexa->pDst = pDst; TRACE_DRAW(); return TRUE; } /** * Does an fbComposite to complete the requested drawing operation. */ static void ephyrComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { KdScreenPriv(pDst->drawable.pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; fbComposite(fakexa->op, fakexa->pSrcPicture, fakexa->pMaskPicture, fakexa->pDstPicture, srcX, srcY, maskX, maskY, dstX, dstY, w, h); } static void ephyrDoneComposite(PixmapPtr pDst) { KdScreenPriv(pDst->drawable.pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; if (fakexa->pMask != NULL) ephyrFinishPipelinedAccess(fakexa->pMask, EXA_PREPARE_MASK); ephyrFinishPipelinedAccess(fakexa->pSrc, EXA_PREPARE_SRC); ephyrFinishPipelinedAccess(fakexa->pDst, EXA_PREPARE_DEST); } /** * Does fake acceleration of DownloadFromScren using memcpy. */ static Bool ephyrDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch) { KdScreenPriv(pSrc->drawable.pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; unsigned char *src; int src_pitch, cpp; if (pSrc->drawable.bitsPerPixel < 8) return FALSE; ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); cpp = pSrc->drawable.bitsPerPixel / 8; src_pitch = exaGetPixmapPitch(pSrc); src = fakexa->exa->memoryBase + exaGetPixmapOffset(pSrc); src += y * src_pitch + x * cpp; for (; h > 0; h--) { memcpy(dst, src, w * cpp); dst += dst_pitch; src += src_pitch; } exaMarkSync(pSrc->drawable.pScreen); ephyrFinishPipelinedAccess(pSrc, EXA_PREPARE_SRC); return TRUE; } /** * Does fake acceleration of UploadToScreen using memcpy. */ static Bool ephyrUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch) { KdScreenPriv(pDst->drawable.pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; unsigned char *dst; int dst_pitch, cpp; if (pDst->drawable.bitsPerPixel < 8) return FALSE; ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST); cpp = pDst->drawable.bitsPerPixel / 8; dst_pitch = exaGetPixmapPitch(pDst); dst = fakexa->exa->memoryBase + exaGetPixmapOffset(pDst); dst += y * dst_pitch + x * cpp; for (; h > 0; h--) { memcpy(dst, src, w * cpp); dst += dst_pitch; src += src_pitch; } exaMarkSync(pDst->drawable.pScreen); ephyrFinishPipelinedAccess(pDst, EXA_PREPARE_DEST); return TRUE; } static Bool ephyrPrepareAccess(PixmapPtr pPix, int index) { /* Make sure we don't somehow end up with a pointer that is in framebuffer * and hasn't been readied for us. */ assert(pPix->devPrivate.ptr != NULL); return TRUE; } /** * In fakexa, we currently only track whether we have synced to the latest * "accelerated" drawing that has happened or not. It's not used for anything * yet. */ static int ephyrMarkSync(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; fakexa->is_synced = FALSE; return 0; } /** * Assumes that we're waiting on the latest marker. When EXA gets smarter and * starts using markers in a fine-grained way (for example, waiting on drawing * to required pixmaps to complete, rather than waiting for all drawing to * complete), we'll want to make the ephyrMarkSync/ephyrWaitMarker * implementation fine-grained as well. */ static void ephyrWaitMarker(ScreenPtr pScreen, int marker) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; fakexa->is_synced = TRUE; } /** * This function initializes EXA to use the fake acceleration implementation * which just falls through to software. The purpose is to have a reliable, * correct driver with which to test changes to the EXA core. */ Bool ephyrDrawInit(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrPriv *priv = screen->card->driver; EphyrFakexaPriv *fakexa; Bool success; fakexa = calloc(1, sizeof(*fakexa)); if (fakexa == NULL) return FALSE; fakexa->exa = exaDriverAlloc(); if (fakexa->exa == NULL) { free(fakexa); return FALSE; } fakexa->exa->memoryBase = (CARD8 *) (priv->base); fakexa->exa->memorySize = priv->bytes_per_line * ephyrBufferHeight(screen); fakexa->exa->offScreenBase = priv->bytes_per_line * screen->height; /* Since we statically link against EXA, we shouldn't have to be smart about * versioning. */ fakexa->exa->exa_major = 2; fakexa->exa->exa_minor = 0; fakexa->exa->PrepareSolid = ephyrPrepareSolid; fakexa->exa->Solid = ephyrSolid; fakexa->exa->DoneSolid = ephyrDoneSolid; fakexa->exa->PrepareCopy = ephyrPrepareCopy; fakexa->exa->Copy = ephyrCopy; fakexa->exa->DoneCopy = ephyrDoneCopy; fakexa->exa->CheckComposite = ephyrCheckComposite; fakexa->exa->PrepareComposite = ephyrPrepareComposite; fakexa->exa->Composite = ephyrComposite; fakexa->exa->DoneComposite = ephyrDoneComposite; fakexa->exa->DownloadFromScreen = ephyrDownloadFromScreen; fakexa->exa->UploadToScreen = ephyrUploadToScreen; fakexa->exa->MarkSync = ephyrMarkSync; fakexa->exa->WaitMarker = ephyrWaitMarker; fakexa->exa->PrepareAccess = ephyrPrepareAccess; fakexa->exa->pixmapOffsetAlign = EPHYR_OFFSET_ALIGN; fakexa->exa->pixmapPitchAlign = EPHYR_PITCH_ALIGN; fakexa->exa->maxX = 1023; fakexa->exa->maxY = 1023; fakexa->exa->flags = EXA_OFFSCREEN_PIXMAPS; success = exaDriverInit(pScreen, fakexa->exa); if (success) { ErrorF("Initialized fake EXA acceleration\n"); scrpriv->fakexa = fakexa; } else { ErrorF("Failed to initialize EXA\n"); free(fakexa->exa); free(fakexa); } return success; } void ephyrDrawEnable(ScreenPtr pScreen) { } void ephyrDrawDisable(ScreenPtr pScreen) { } void ephyrDrawFini(ScreenPtr pScreen) { } /** * exaDDXDriverInit is required by the top-level EXA module, and is used by * the xorg DDX to hook in its EnableDisableFB wrapper. We don't need it, since * we won't be enabling/disabling the FB. */ void exaDDXDriverInit(ScreenPtr pScreen) { ExaScreenPriv(pScreen); pExaScr->migration = ExaMigrationSmart; pExaScr->checkDirtyCorrectness = TRUE; } xorg-server-1.17.1/hw/kdrive/ephyr/Makefile.in0000664000175100017510000010536312466505431016125 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright © 2013 Intel Corporation # # 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. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ bin_PROGRAMS = Xephyr$(EXEEXT) @GLAMOR_TRUE@am__append_1 = $(XLIB_CFLAGS) subdir = hw/kdrive/ephyr DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__Xephyr_SOURCES_DIST = ephyr.c ephyr.h ephyrlog.h ephyr_draw.c os.c \ ephyrinit.c ephyrcursor.c hostx.c hostx.h ephyrvideo.c \ ephyrdriext.c ephyrdriext.h ephyrdri.c ephyrdri.h \ ephyrglxext.c ephyrglxext.h ephyrhostglx.c ephyrhostglx.h \ ephyr_glamor_glx.c ephyr_glamor_glx.h ephyr_glamor_xv.c @XV_TRUE@am__objects_1 = ephyrvideo.$(OBJEXT) @DRI_TRUE@am__objects_2 = ephyrdriext.$(OBJEXT) ephyrdri.$(OBJEXT) \ @DRI_TRUE@ ephyrglxext.$(OBJEXT) ephyrhostglx.$(OBJEXT) @GLAMOR_TRUE@@XV_TRUE@am__objects_3 = ephyr_glamor_xv.$(OBJEXT) @GLAMOR_TRUE@am__objects_4 = ephyr_glamor_glx.$(OBJEXT) \ @GLAMOR_TRUE@ $(am__objects_3) am_Xephyr_OBJECTS = ephyr.$(OBJEXT) ephyr_draw.$(OBJEXT) os.$(OBJEXT) \ ephyrinit.$(OBJEXT) ephyrcursor.$(OBJEXT) hostx.$(OBJEXT) \ $(am__objects_1) $(am__objects_2) $(am__objects_4) Xephyr_OBJECTS = $(am_Xephyr_OBJECTS) @GLAMOR_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/glamor/libglamor.la \ @GLAMOR_TRUE@ $(top_builddir)/glamor/libglamor_egl_stubs.la 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 = Xephyr_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(Xephyr_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 = $(Xephyr_SOURCES) DIST_SOURCES = $(am__Xephyr_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ SUBDIRS = man AM_CPPFLAGS = @KDRIVE_INCS@ @KDRIVE_CFLAGS@ @XEPHYR_INCS@ \ @XEPHYR_CFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/glamor \ -I$(top_srcdir)/exa $(am__append_1) @XV_TRUE@XV_SRCS = ephyrvideo.c @GLAMOR_TRUE@@XV_TRUE@GLAMOR_XV_SRCS = ephyr_glamor_xv.c @GLAMOR_TRUE@GLAMOR_SRCS = \ @GLAMOR_TRUE@ ephyr_glamor_glx.c \ @GLAMOR_TRUE@ ephyr_glamor_glx.h \ @GLAMOR_TRUE@ $(GLAMOR_XV_SRCS) \ @GLAMOR_TRUE@ $() @DRI_TRUE@DRI_SRCS = \ @DRI_TRUE@ ephyrdriext.c \ @DRI_TRUE@ ephyrdriext.h \ @DRI_TRUE@ ephyrdri.c \ @DRI_TRUE@ ephyrdri.h \ @DRI_TRUE@ ephyrglxext.c \ @DRI_TRUE@ ephyrglxext.h \ @DRI_TRUE@ ephyrhostglx.c \ @DRI_TRUE@ ephyrhostglx.h \ @DRI_TRUE@ $() Xephyr_SOURCES = \ ephyr.c \ ephyr.h \ ephyrlog.h \ ephyr_draw.c \ os.c \ ephyrinit.c \ ephyrcursor.c \ hostx.c \ hostx.h \ $(XV_SRCS) \ $(DRI_SRCS) \ $(GLAMOR_SRCS) \ $() @GLAMOR_TRUE@XEPHYR_GLAMOR_LIB = \ @GLAMOR_TRUE@ $(top_builddir)/glamor/libglamor.la \ @GLAMOR_TRUE@ $(top_builddir)/glamor/libglamor_egl_stubs.la \ @GLAMOR_TRUE@ $() Xephyr_LDADD = \ $(top_builddir)/exa/libexa.la \ $(XEPHYR_GLAMOR_LIB) \ @KDRIVE_LIBS@ \ @XEPHYR_LIBS@ Xephyr_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@ $(XEPHYR_GLAMOR_LIB) Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/kdrive/ephyr/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/kdrive/ephyr/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list Xephyr$(EXEEXT): $(Xephyr_OBJECTS) $(Xephyr_DEPENDENCIES) $(EXTRA_Xephyr_DEPENDENCIES) @rm -f Xephyr$(EXEEXT) $(AM_V_CCLD)$(Xephyr_LINK) $(Xephyr_OBJECTS) $(Xephyr_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_draw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_glx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_xv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrcursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdri.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdriext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrglxext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrhostglx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrvideo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Po@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 -o $@ $< .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 -o $@ `$(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 # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; 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-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS relink: $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) # 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: xorg-server-1.17.1/hw/kdrive/ephyr/ephyrlog.h0000664000175100017510000000506712456571574016074 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifndef __EPHYRLOG_H__ #define __EPHYRLOG_H__ #include #include "os.h" #ifndef DEBUG /*we are not in debug mode*/ #define EPHYR_LOG(...) #define EPHYR_LOG_ERROR(...) #endif /*!DEBUG */ #define ERROR_LOG_LEVEL 3 #define INFO_LOG_LEVEL 4 #ifndef EPHYR_LOG #define EPHYR_LOG(...) \ LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, "in %s:%d:%s: ",\ __FILE__, __LINE__, __func__) ; \ LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, __VA_ARGS__) #endif /*nomadik_log */ #ifndef EPHYR_LOG_ERROR #define EPHYR_LOG_ERROR(...) \ LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, "Error:in %s:%d:%s: ",\ __FILE__, __LINE__, __func__) ; \ LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, __VA_ARGS__) #endif /*EPHYR_LOG_ERROR */ #ifndef EPHYR_RETURN_IF_FAIL #define EPHYR_RETURN_IF_FAIL(cond) \ if (!(cond)) {EPHYR_LOG_ERROR("condition %s failed\n", #cond);return;} #endif /*nomadik_return_if_fail */ #ifndef EPHYR_RETURN_VAL_IF_FAIL #define EPHYR_RETURN_VAL_IF_FAIL(cond,val) \ if (!(cond)) {EPHYR_LOG_ERROR("condition %s failed\n", #cond);return val;} #endif /*nomadik_return_val_if_fail */ #endif /*__EPHYRLOG_H__*/ xorg-server-1.17.1/hw/kdrive/ephyr/ephyrinit.c0000664000175100017510000002704712456571574016253 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2004 Nokia * * 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 Nokia not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Nokia makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL NOKIA 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_CONFIG_H #include #endif #include "ephyr.h" #include "ephyrlog.h" #include "glx_extinit.h" extern Window EphyrPreExistingHostWin; extern Bool EphyrWantGrayScale; extern Bool EphyrWantResize; extern Bool EphyrWantNoHostGrab; extern Bool kdHasPointer; extern Bool kdHasKbd; extern Bool ephyr_glamor, ephyr_glamor_gles2; #ifdef GLXEXT extern Bool ephyrNoDRI; #endif extern Bool ephyrNoXV; #ifdef KDRIVE_EVDEV extern KdPointerDriver LinuxEvdevMouseDriver; extern KdKeyboardDriver LinuxEvdevKeyboardDriver; #endif void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id); void processOutputArg(const char *output, char *parent_id); void processScreenArg(const char *screen_size, char *parent_id); void InitCard(char *name) { EPHYR_DBG("mark"); KdCardInfoAdd(&ephyrFuncs, 0); } static const ExtensionModule ephyrExtensions[] = { #ifdef GLXEXT { GlxExtensionInit, "GLX", &noGlxExtension }, #endif }; static void ephyrExtensionInit(void) { LoadExtensionList(ephyrExtensions, ARRAY_SIZE(ephyrExtensions), TRUE); } void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { if (serverGeneration == 1) ephyrExtensionInit(); KdInitOutput(pScreenInfo, argc, argv); } void InitInput(int argc, char **argv) { KdKeyboardInfo *ki; KdPointerInfo *pi; KdAddKeyboardDriver(&EphyrKeyboardDriver); #ifdef KDRIVE_EVDEV KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); #endif KdAddPointerDriver(&EphyrMouseDriver); #ifdef KDRIVE_EVDEV KdAddPointerDriver(&LinuxEvdevMouseDriver); #endif if (!kdHasKbd) { ki = KdNewKeyboard(); if (!ki) FatalError("Couldn't create Xephyr keyboard\n"); ki->driver = &EphyrKeyboardDriver; KdAddKeyboard(ki); } if (!kdHasPointer) { pi = KdNewPointer(); if (!pi) FatalError("Couldn't create Xephyr pointer\n"); pi->driver = &EphyrMouseDriver; KdAddPointer(pi); } KdInitInput(); } void CloseInput(void) { KdCloseInput(); } #ifdef DDXBEFORERESET void ddxBeforeReset(void) { } #endif void ddxUseMsg(void) { KdUseMsg(); ErrorF("\nXephyr Option Usage:\n"); ErrorF("-parent Use existing window as Xephyr root win\n"); ErrorF("-sw-cursor Render cursors in software in Xephyr\n"); ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n"); ErrorF("-output Attempt to run Xephyr fullscreen (restricted to given output geometry)\n"); ErrorF("-grayscale Simulate 8bit grayscale\n"); ErrorF("-resizeable Make Xephyr windows resizeable\n"); #ifdef GLAMOR ErrorF("-glamor Enable 2D acceleration using glamor\n"); ErrorF("-glamor_gles2 Enable 2D acceleration using glamor (with GLES2 only)\n"); #endif ErrorF ("-fakexa Simulate acceleration using software rendering\n"); ErrorF("-verbosity Set log verbosity level\n"); #ifdef GLXEXT ErrorF("-nodri do not use DRI\n"); #endif ErrorF("-noxv do not use XV\n"); ErrorF("-name [name] define the name in the WM_CLASS property\n"); ErrorF ("-title [title] set the window title in the WM_NAME property\n"); ErrorF("-no-host-grab Disable grabbing the keyboard and mouse.\n"); ErrorF("\n"); } void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id) { KdCardInfo *card; InitCard(0); /*Put each screen on a separate card */ card = KdCardInfoLast(); if (card) { KdScreenInfo *screen; unsigned long p_id = 0; Bool use_geometry; screen = KdScreenInfoAdd(card); KdParseScreen(screen, screen_size); screen->driver = calloc(1, sizeof(EphyrScrPriv)); if (!screen->driver) FatalError("Couldn't alloc screen private\n"); if (parent_id) { p_id = strtol(parent_id, NULL, 0); } use_geometry = (strchr(screen_size, '+') != NULL); EPHYR_DBG("screen number:%d\n", screen->mynum); hostx_add_screen(screen, p_id, screen->mynum, use_geometry, output); } else { ErrorF("No matching card found!\n"); } } void processScreenArg(const char *screen_size, char *parent_id) { processScreenOrOutputArg(screen_size, NULL, parent_id); } void processOutputArg(const char *output, char *parent_id) { processScreenOrOutputArg("100x100+0+0", output, parent_id); } int ddxProcessArgument(int argc, char **argv, int i) { static char *parent = NULL; EPHYR_DBG("mark argv[%d]='%s'", i, argv[i]); if (i == 1) { hostx_use_resname(basename(argv[0]), 0); } if (!strcmp(argv[i], "-parent")) { if (i + 1 < argc) { int j; /* If parent is specified and a screen argument follows, don't do * anything, let the -screen handling init the rest */ for (j = i; j < argc; j++) { if (!strcmp(argv[j], "-screen")) { parent = argv[i + 1]; return 2; } } processScreenArg("100x100", argv[i + 1]); return 2; } UseMsg(); exit(1); } else if (!strcmp(argv[i], "-screen")) { if ((i + 1) < argc) { processScreenArg(argv[i + 1], parent); parent = NULL; return 2; } UseMsg(); exit(1); } else if (!strcmp(argv[i], "-output")) { if (i + 1 < argc) { processOutputArg(argv[i + 1], NULL); return 2; } UseMsg(); exit(1); } else if (!strcmp(argv[i], "-sw-cursor")) { hostx_use_sw_cursor(); return 1; } else if (!strcmp(argv[i], "-host-cursor")) { /* Compatibility with the old command line argument, now the default. */ return 1; } else if (!strcmp(argv[i], "-fullscreen")) { hostx_use_fullscreen(); return 1; } else if (!strcmp(argv[i], "-grayscale")) { EphyrWantGrayScale = 1; return 1; } else if (!strcmp(argv[i], "-resizeable")) { EphyrWantResize = 1; return 1; } #ifdef GLAMOR else if (!strcmp (argv[i], "-glamor")) { ephyr_glamor = TRUE; ephyrFuncs.initAccel = ephyr_glamor_init; ephyrFuncs.enableAccel = ephyr_glamor_enable; ephyrFuncs.disableAccel = ephyr_glamor_disable; ephyrFuncs.finiAccel = ephyr_glamor_fini; return 1; } else if (!strcmp (argv[i], "-glamor_gles2")) { ephyr_glamor = TRUE; ephyr_glamor_gles2 = TRUE; ephyrFuncs.initAccel = ephyr_glamor_init; ephyrFuncs.enableAccel = ephyr_glamor_enable; ephyrFuncs.disableAccel = ephyr_glamor_disable; ephyrFuncs.finiAccel = ephyr_glamor_fini; return 1; } #endif else if (!strcmp(argv[i], "-fakexa")) { ephyrFuncs.initAccel = ephyrDrawInit; ephyrFuncs.enableAccel = ephyrDrawEnable; ephyrFuncs.disableAccel = ephyrDrawDisable; ephyrFuncs.finiAccel = ephyrDrawFini; return 1; } else if (!strcmp(argv[i], "-verbosity")) { if (i + 1 < argc && argv[i + 1][0] != '-') { int verbosity = atoi(argv[i + 1]); LogSetParameter(XLOG_VERBOSITY, verbosity); EPHYR_LOG("set verbosiry to %d\n", verbosity); return 2; } else { UseMsg(); exit(1); } } #ifdef GLXEXT else if (!strcmp(argv[i], "-nodri")) { ephyrNoDRI = TRUE; EPHYR_LOG("no direct rendering enabled\n"); return 1; } #endif else if (!strcmp(argv[i], "-noxv")) { ephyrNoXV = TRUE; EPHYR_LOG("no XVideo enabled\n"); return 1; } else if (!strcmp(argv[i], "-name")) { if (i + 1 < argc && argv[i + 1][0] != '-') { hostx_use_resname(argv[i + 1], 1); return 2; } else { UseMsg(); return 0; } } else if (!strcmp(argv[i], "-title")) { if (i + 1 < argc && argv[i + 1][0] != '-') { hostx_set_title(argv[i + 1]); return 2; } else { UseMsg(); return 0; } } else if (argv[i][0] == ':') { hostx_set_display_name(argv[i]); } /* Xnest compatibility */ else if (!strcmp(argv[i], "-display")) { hostx_set_display_name(argv[i + 1]); return 2; } else if (!strcmp(argv[i], "-sync") || !strcmp(argv[i], "-full") || !strcmp(argv[i], "-sss") || !strcmp(argv[i], "-install")) { return 1; } else if (!strcmp(argv[i], "-bw") || !strcmp(argv[i], "-class") || !strcmp(argv[i], "-geometry") || !strcmp(argv[i], "-scrns")) { return 2; } /* end Xnest compat */ else if (!strcmp(argv[i], "-no-host-grab")) { EphyrWantNoHostGrab = 1; return 2; } return KdProcessArgument(argc, argv, i); } void OsVendorInit(void) { EPHYR_DBG("mark"); if (hostx_want_host_cursor()) ephyrFuncs.initCursor = &ephyrCursorInit; KdOsInit(&EphyrOsFuncs); } KdCardFuncs ephyrFuncs = { ephyrCardInit, /* cardinit */ ephyrScreenInitialize, /* scrinit */ ephyrInitScreen, /* initScreen */ ephyrFinishInitScreen, /* finishInitScreen */ ephyrCreateResources, /* createRes */ ephyrPreserve, /* preserve */ ephyrEnable, /* enable */ ephyrDPMS, /* dpms */ ephyrDisable, /* disable */ ephyrRestore, /* restore */ ephyrScreenFini, /* scrfini */ ephyrCardFini, /* cardfini */ 0, /* initCursor */ 0, /* enableCursor */ 0, /* disableCursor */ 0, /* finiCursor */ 0, /* recolorCursor */ 0, /* initAccel */ 0, /* enableAccel */ 0, /* disableAccel */ 0, /* finiAccel */ ephyrGetColors, /* getColors */ ephyrPutColors, /* putColors */ ephyrCloseScreen, /* closeScreen */ }; xorg-server-1.17.1/hw/kdrive/ephyr/ephyrhostglx.h0000664000175100017510000000640112456571574016774 00000000000000/* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum * * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of OpenedHand Ltd not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. OpenedHand Ltd makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: * Dodji Seketeli */ #ifndef __EPHYRHOSTGLX_H__ #define __EPHYRHOSTGLX_H__ enum EphyrHostGLXGetStringOps { EPHYR_HOST_GLX_UNDEF, EPHYR_HOST_GLX_QueryServerString, EPHYR_HOST_GLX_GetString, }; Bool ephyrHostGLXQueryVersion(int *a_maj, int *a_min); Bool ephyrHostGLXGetString(int a_context_tag, int a_string_name, char **a_string); Bool ephyrHostGLXQueryServerString(int a_screen_number, int a_string_name, char **a_string); Bool ephyrHostGLXGetVisualConfigs(int a_screen, int32_t * a_num_visuals, int32_t * a_num_props, int32_t * a_props_buf_size, int32_t ** a_props_buf); Bool ephyrHostGLXVendorPrivGetFBConfigsSGIX(int a_screen, int32_t * a_num_visuals, int32_t * a_num_props, int32_t * a_props_buf_size, int32_t ** a_props_buf); Bool ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, const char *a_extension_list); Bool ephyrHostGLXCreateContext(int a_screen, int a_generic_id, int a_context_id, 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_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); Bool ephyrHostIsContextDirect(int a_ctxt_id, int *a_is_direct); #endif /*__EPHYRHOSTGLX_H__*/ xorg-server-1.17.1/hw/kdrive/Makefile.in0000664000175100017510000006332412466505431014776 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/kdrive DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags 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@ 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ @BUILD_KDRIVEFBDEVLIB_TRUE@FBDEV_SUBDIRS = fbdev @XFAKESERVER_TRUE@XFAKE_SUBDIRS = fake @XEPHYR_TRUE@XEPHYR_SUBDIRS = ephyr @KDRIVELINUX_TRUE@LINUX_SUBDIRS = linux SERVER_SUBDIRS = \ $(FBDEV_SUBDIRS) \ $(XEPHYR_SUBDIRS) \ $(XFAKE_SUBDIRS) SUBDIRS = \ src \ $(LINUX_SUBDIRS) \ $(SERVER_SUBDIRS) DIST_SUBDIRS = fbdev ephyr src linux fake all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(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/kdrive/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/kdrive/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 @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 all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am relink: $(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; 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: xorg-server-1.17.1/hw/kdrive/src/0000775000175100017510000000000012466505446013576 500000000000000xorg-server-1.17.1/hw/kdrive/src/Makefile.am0000664000175100017510000000055212323563340015541 00000000000000AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H noinst_LTLIBRARIES = libkdrive.la if XV KDRIVE_XV_SOURCES = \ kxv.c \ kxv.h endif libkdrive_la_SOURCES = \ fourcc.h \ kcmap.c \ kdrive.c \ kdrive.h \ kinfo.c \ kinput.c \ kmode.c \ kshadow.c \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c xorg-server-1.17.1/hw/kdrive/src/kxv.h0000664000175100017510000002026512372525300014467 00000000000000/* XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com) Adapted for KDrive by Pontus Lidman Copyright (C) 2000, 2001 - Nokia Home Communications Copyright (C) 1998, 1999 - 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, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. */ #ifndef _XVDIX_H_ #define _XVDIX_H_ #include "scrnintstr.h" #include "regionstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "mivalidate.h" #include "validate.h" #include "resource.h" #include "gcstruct.h" #include "dixstruct.h" #include "../../Xext/xvdix.h" #define VIDEO_OVERLAID_IMAGES 0x00000004 #define VIDEO_OVERLAID_STILLS 0x00000008 #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 typedef int (*PutVideoFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data); typedef int (*PutStillFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data); typedef int (*GetVideoFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data); typedef int (*GetStillFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, void *data); typedef void (*StopVideoFuncPtr) (KdScreenInfo * screen, void *data, Bool Exit); typedef int (*SetPortAttributeFuncPtr) (KdScreenInfo * screen, Atom attribute, int value, void *data); typedef int (*GetPortAttributeFuncPtr) (KdScreenInfo * screen, Atom attribute, int *value, void *data); typedef void (*QueryBestSizeFuncPtr) (KdScreenInfo * screen, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, void *data); typedef int (*PutImageFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int image, unsigned char *buf, short width, short height, Bool Sync, RegionPtr clipBoxes, void *data); typedef int (*ReputImageFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short drw_x, short drw_y, RegionPtr clipBoxes, void *data); typedef int (*QueryImageAttributesFuncPtr) (KdScreenInfo * screen, int image, unsigned short *width, unsigned short *height, int *pitches, int *offsets); typedef enum { XV_OFF, XV_PENDING, XV_ON } XvStatus; /*** this is what the driver needs to fill out ***/ typedef struct { int id; const char *name; unsigned short width, height; XvRationalRec rate; } KdVideoEncodingRec, *KdVideoEncodingPtr; typedef struct { char depth; short class; } KdVideoFormatRec, *KdVideoFormatPtr; typedef struct { unsigned int type; int flags; const char *name; int nEncodings; KdVideoEncodingPtr pEncodings; int nFormats; KdVideoFormatPtr pFormats; int nPorts; DevUnion *pPortPrivates; int nAttributes; XvAttributePtr pAttributes; int nImages; XvImagePtr pImages; PutVideoFuncPtr PutVideo; PutStillFuncPtr PutStill; GetVideoFuncPtr GetVideo; GetStillFuncPtr GetStill; StopVideoFuncPtr StopVideo; SetPortAttributeFuncPtr SetPortAttribute; GetPortAttributeFuncPtr GetPortAttribute; QueryBestSizeFuncPtr QueryBestSize; PutImageFuncPtr PutImage; ReputImageFuncPtr ReputImage; QueryImageAttributesFuncPtr QueryImageAttributes; } KdVideoAdaptorRec, *KdVideoAdaptorPtr; Bool KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr Adaptors, int num); void KdXVCopyPackedData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, int srcPitch, int dstPitch, int srcW, int srcH, int top, int left, int h, int w); void KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, int srcPitch, int srcPitch2, int dstPitch, int srcW, int srcH, int height, int top, int left, int h, int w, int id); KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen); void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr); /* Must be called from KdCardInfo functions, can be called without Xv enabled */ Bool KdXVEnable(ScreenPtr); void KdXVDisable(ScreenPtr); /*** These are DDX layer privates ***/ typedef struct { DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; CloseScreenProcPtr CloseScreen; } KdXVScreenRec, *KdXVScreenPtr; typedef struct { int flags; PutVideoFuncPtr PutVideo; PutStillFuncPtr PutStill; GetVideoFuncPtr GetVideo; GetStillFuncPtr GetStill; StopVideoFuncPtr StopVideo; SetPortAttributeFuncPtr SetPortAttribute; GetPortAttributeFuncPtr GetPortAttribute; QueryBestSizeFuncPtr QueryBestSize; PutImageFuncPtr PutImage; ReputImageFuncPtr ReputImage; QueryImageAttributesFuncPtr QueryImageAttributes; } XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr; typedef struct { KdScreenInfo *screen; DrawablePtr pDraw; unsigned char type; unsigned int subWindowMode; DDXPointRec clipOrg; RegionPtr clientClip; RegionPtr pCompositeClip; Bool FreeCompositeClip; XvAdaptorRecPrivatePtr AdaptorRec; XvStatus isOn; Bool moved; int vid_x, vid_y, vid_w, vid_h; int drw_x, drw_y, drw_w, drw_h; DevUnion DevPriv; } XvPortRecPrivate, *XvPortRecPrivatePtr; typedef struct _KdXVWindowRec { XvPortRecPrivatePtr PortRec; struct _KdXVWindowRec *next; } KdXVWindowRec, *KdXVWindowPtr; #endif /* _XVDIX_H_ */ xorg-server-1.17.1/hw/kdrive/src/kinput.c0000664000175100017510000016317312366220413015172 00000000000000/* * Copyright © 1999 Keith Packard * Copyright © 2006 Nokia Corporation * * 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 authors not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE AUTHORS 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_CONFIG_H #include #endif #include "kdrive.h" #include "inputstr.h" #define XK_PUBLISHING #include #if HAVE_X11_XF86KEYSYM_H #include #endif #include #include #ifdef sun #include /* needed for FNONBLOCK & FASYNC */ #endif #include "xkbsrv.h" #include #include #include "XIstubs.h" /* even though we don't use stubs. cute, no? */ #include "exevents.h" #include "extinit.h" #include "exglobals.h" #include "eventstr.h" #include "xserver-properties.h" #include "inpututils.h" #include "optionstr.h" #define AtomFromName(x) MakeAtom(x, strlen(x), 1) struct KdConfigDevice { char *line; struct KdConfigDevice *next; }; /* kdKeyboards and kdPointers hold all the real devices. */ static KdKeyboardInfo *kdKeyboards = NULL; static KdPointerInfo *kdPointers = NULL; static struct KdConfigDevice *kdConfigKeyboards = NULL; static struct KdConfigDevice *kdConfigPointers = NULL; static KdKeyboardDriver *kdKeyboardDrivers = NULL; static KdPointerDriver *kdPointerDrivers = NULL; static Bool kdInputEnabled; static Bool kdOffScreen; static unsigned long kdOffScreenTime; static KdPointerMatrix kdPointerMatrix = { {{1, 0, 0}, {0, 1, 0}} }; void KdResetInputMachine(void); #define KD_MAX_INPUT_FDS 8 typedef struct _kdInputFd { int fd; void (*read) (int fd, void *closure); int (*enable) (int fd, void *closure); void (*disable) (int fd, void *closure); void *closure; } KdInputFd; static KdInputFd kdInputFds[KD_MAX_INPUT_FDS]; static int kdNumInputFds; extern Bool kdRawPointerCoordinates; static void KdSigio(int sig) { int i; for (i = 0; i < kdNumInputFds; i++) (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); } #ifdef DEBUG_SIGIO void KdAssertSigioBlocked(char *where) { sigset_t set, old; sigemptyset(&set); sigprocmask(SIG_BLOCK, &set, &old); if (!sigismember(&old, SIGIO)) { ErrorF("SIGIO not blocked at %s\n", where); KdBacktrace(0); } } #else #define KdAssertSigioBlocked(s) #endif static int kdnFds; #ifdef FNONBLOCK #define NOBLOCK FNONBLOCK #else #define NOBLOCK FNDELAY #endif void KdResetInputMachine(void) { KdPointerInfo *pi; for (pi = kdPointers; pi; pi = pi->next) { pi->mouseState = start; pi->eventHeld = FALSE; } } static void KdNonBlockFd(int fd) { int flags; flags = fcntl(fd, F_GETFL); flags |= FASYNC | NOBLOCK; fcntl(fd, F_SETFL, flags); } static void KdAddFd(int fd) { struct sigaction act; sigset_t set; kdnFds++; fcntl(fd, F_SETOWN, getpid()); KdNonBlockFd(fd); AddEnabledDevice(fd); memset(&act, '\0', sizeof act); act.sa_handler = KdSigio; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGIO); sigaddset(&act.sa_mask, SIGALRM); sigaddset(&act.sa_mask, SIGVTALRM); sigaction(SIGIO, &act, 0); sigemptyset(&set); sigprocmask(SIG_SETMASK, &set, 0); } static void KdRemoveFd(int fd) { struct sigaction act; int flags; kdnFds--; RemoveEnabledDevice(fd); flags = fcntl(fd, F_GETFL); flags &= ~(FASYNC | NOBLOCK); fcntl(fd, F_SETFL, flags); if (kdnFds == 0) { memset(&act, '\0', sizeof act); act.sa_handler = SIG_IGN; sigemptyset(&act.sa_mask); sigaction(SIGIO, &act, 0); } } Bool KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure) { if (kdNumInputFds == KD_MAX_INPUT_FDS) return FALSE; kdInputFds[kdNumInputFds].fd = fd; kdInputFds[kdNumInputFds].read = read; kdInputFds[kdNumInputFds].enable = 0; kdInputFds[kdNumInputFds].disable = 0; kdInputFds[kdNumInputFds].closure = closure; kdNumInputFds++; if (kdInputEnabled) KdAddFd(fd); return TRUE; } void KdUnregisterFd(void *closure, int fd, Bool do_close) { int i, j; for (i = 0; i < kdNumInputFds; i++) { if (kdInputFds[i].closure == closure && (fd == -1 || kdInputFds[i].fd == fd)) { if (kdInputEnabled) KdRemoveFd(kdInputFds[i].fd); if (do_close) close(kdInputFds[i].fd); kdNumInputFds--; for (j = i; j < (kdNumInputFds - 1); j++) kdInputFds[j] = kdInputFds[j + 1]; break; } } } void KdUnregisterFds(void *closure, Bool do_close) { KdUnregisterFd(closure, -1, do_close); } void KdDisableInput(void) { KdKeyboardInfo *ki; KdPointerInfo *pi; int found = 0, i = 0; OsBlockSIGIO(); for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->driver && ki->driver->Disable) (*ki->driver->Disable) (ki); } for (pi = kdPointers; pi; pi = pi->next) { if (pi->driver && pi->driver->Disable) (*pi->driver->Disable) (pi); } if (kdNumInputFds) { ErrorF("[KdDisableInput] Buggy drivers: still %d input fds left!", kdNumInputFds); i = 0; while (i < kdNumInputFds) { found = 0; for (ki = kdKeyboards; ki; ki = ki->next) { if (ki == kdInputFds[i].closure) { ErrorF(" fd %d belongs to keybd driver %s\n", kdInputFds[i].fd, ki->driver && ki->driver->name ? ki->driver->name : "(unnamed!)"); found = 1; break; } } if (found) { i++; continue; } for (pi = kdPointers; pi; pi = pi->next) { if (pi == kdInputFds[i].closure) { ErrorF(" fd %d belongs to pointer driver %s\n", kdInputFds[i].fd, pi->driver && pi->driver->name ? pi->driver->name : "(unnamed!)"); break; } } if (found) { i++; continue; } ErrorF(" fd %d not claimed by any active device!\n", kdInputFds[i].fd); KdUnregisterFd(kdInputFds[i].closure, kdInputFds[i].fd, TRUE); } } kdInputEnabled = FALSE; } void KdEnableInput(void) { InternalEvent ev; KdKeyboardInfo *ki; KdPointerInfo *pi; kdInputEnabled = TRUE; ev.any.time = GetTimeInMillis(); for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->driver && ki->driver->Enable) (*ki->driver->Enable) (ki); /* reset screen saver */ NoticeEventTime (&ev, ki->dixdev); } for (pi = kdPointers; pi; pi = pi->next) { if (pi->driver && pi->driver->Enable) (*pi->driver->Enable) (pi); /* reset screen saver */ NoticeEventTime (&ev, pi->dixdev); } OsReleaseSIGIO(); } static KdKeyboardDriver * KdFindKeyboardDriver(const char *name) { KdKeyboardDriver *ret; /* ask a stupid question ... */ if (!name) return NULL; for (ret = kdKeyboardDrivers; ret; ret = ret->next) { if (strcmp(ret->name, name) == 0) return ret; } return NULL; } static KdPointerDriver * KdFindPointerDriver(const char *name) { KdPointerDriver *ret; /* ask a stupid question ... */ if (!name) return NULL; for (ret = kdPointerDrivers; ret; ret = ret->next) { if (strcmp(ret->name, name) == 0) return ret; } return NULL; } static int KdPointerProc(DeviceIntPtr pDevice, int onoff) { DevicePtr pDev = (DevicePtr) pDevice; KdPointerInfo *pi; Atom xiclass; Atom *btn_labels; Atom *axes_labels; if (!pDev) return BadImplementation; for (pi = kdPointers; pi; pi = pi->next) { if (pi->dixdev && pi->dixdev->id == pDevice->id) break; } if (!pi || !pi->dixdev || pi->dixdev->id != pDevice->id) { ErrorF("[KdPointerProc] Failed to find pointer for device %d!\n", pDevice->id); return BadImplementation; } switch (onoff) { case DEVICE_INIT: #ifdef DEBUG ErrorF("initialising pointer %s ...\n", pi->name); #endif if (!pi->driver) { if (!pi->driverPrivate) { ErrorF("no driver specified for %s\n", pi->name); return BadImplementation; } pi->driver = KdFindPointerDriver(pi->driverPrivate); if (!pi->driver) { ErrorF("Couldn't find pointer driver %s\n", pi->driverPrivate ? (char *) pi->driverPrivate : "(unnamed)"); return !Success; } free(pi->driverPrivate); pi->driverPrivate = NULL; } if (!pi->driver->Init) { ErrorF("no init function\n"); return BadImplementation; } if ((*pi->driver->Init) (pi) != Success) { return !Success; } btn_labels = calloc(pi->nButtons, sizeof(Atom)); if (!btn_labels) return BadAlloc; axes_labels = calloc(pi->nAxes, sizeof(Atom)); if (!axes_labels) { free(btn_labels); return BadAlloc; } switch (pi->nAxes) { default: case 7: btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); case 6: btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); case 5: btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); case 4: btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); case 3: btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); case 2: btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); case 1: btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); case 0: break; } if (pi->nAxes >= 2) { axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); } InitPointerDeviceStruct(pDev, pi->map, pi->nButtons, btn_labels, (PtrCtrlProcPtr) NoopDDA, GetMotionHistorySize(), pi->nAxes, axes_labels); free(btn_labels); free(axes_labels); if (pi->inputClass == KD_TOUCHSCREEN) { xiclass = AtomFromName(XI_TOUCHSCREEN); } else { xiclass = AtomFromName(XI_MOUSE); } AssignTypeAndName(pi->dixdev, xiclass, pi->name ? pi->name : "Generic KDrive Pointer"); return Success; case DEVICE_ON: if (pDev->on == TRUE) return Success; if (!pi->driver->Enable) { ErrorF("no enable function\n"); return BadImplementation; } if ((*pi->driver->Enable) (pi) == Success) { pDev->on = TRUE; return Success; } else { return BadImplementation; } return Success; case DEVICE_OFF: if (pDev->on == FALSE) { return Success; } if (!pi->driver->Disable) { return BadImplementation; } else { (*pi->driver->Disable) (pi); pDev->on = FALSE; return Success; } return Success; case DEVICE_CLOSE: if (pDev->on) { if (!pi->driver->Disable) { return BadImplementation; } (*pi->driver->Disable) (pi); pDev->on = FALSE; } if (!pi->driver->Fini) return BadImplementation; (*pi->driver->Fini) (pi); KdRemovePointer(pi); return Success; } /* NOTREACHED */ return BadImplementation; } Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) { return TRUE; } static void KdBell(int volume, DeviceIntPtr pDev, void *arg, int something) { KeybdCtrl *ctrl = arg; KdKeyboardInfo *ki = NULL; for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->dixdev && ki->dixdev->id == pDev->id) break; } if (!ki || !ki->dixdev || ki->dixdev->id != pDev->id || !ki->driver) return; KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration); } void DDXRingBell(int volume, int pitch, int duration) { KdKeyboardInfo *ki = NULL; if (kdOsFuncs->Bell) { (*kdOsFuncs->Bell) (volume, pitch, duration); } else { for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->dixdev->coreEvents) KdRingBell(ki, volume, pitch, duration); } } } void KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration) { if (!ki || !ki->driver || !ki->driver->Bell) return; if (kdInputEnabled) (*ki->driver->Bell) (ki, volume, pitch, duration); } static void KdSetLeds(KdKeyboardInfo * ki, int leds) { if (!ki || !ki->driver) return; if (kdInputEnabled) { if (ki->driver->Leds) (*ki->driver->Leds) (ki, leds); } } void KdSetLed(KdKeyboardInfo * ki, int led, Bool on) { if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed) return; NoteLedState(ki->dixdev, led, on); KdSetLeds(ki, ki->dixdev->kbdfeed->ctrl.leds); } void KdSetPointerMatrix(KdPointerMatrix * matrix) { kdPointerMatrix = *matrix; } void KdComputePointerMatrix(KdPointerMatrix * m, Rotation randr, int width, int height) { int x_dir = 1, y_dir = 1; int i, j; int size[2]; size[0] = width; size[1] = height; if (randr & RR_Reflect_X) x_dir = -1; if (randr & RR_Reflect_Y) y_dir = -1; switch (randr & (RR_Rotate_All)) { case RR_Rotate_0: m->matrix[0][0] = x_dir; m->matrix[0][1] = 0; m->matrix[1][0] = 0; m->matrix[1][1] = y_dir; break; case RR_Rotate_90: m->matrix[0][0] = 0; m->matrix[0][1] = -x_dir; m->matrix[1][0] = y_dir; m->matrix[1][1] = 0; break; case RR_Rotate_180: m->matrix[0][0] = -x_dir; m->matrix[0][1] = 0; m->matrix[1][0] = 0; m->matrix[1][1] = -y_dir; break; case RR_Rotate_270: m->matrix[0][0] = 0; m->matrix[0][1] = x_dir; m->matrix[1][0] = -y_dir; m->matrix[1][1] = 0; break; } for (i = 0; i < 2; i++) { m->matrix[i][2] = 0; for (j = 0; j < 2; j++) if (m->matrix[i][j] < 0) m->matrix[i][2] = size[j] - 1; } } void KdScreenToPointerCoords(int *x, int *y) { int (*m)[3] = kdPointerMatrix.matrix; int div = m[0][1] * m[1][0] - m[1][1] * m[0][0]; int sx = *x; int sy = *y; *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div; *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div; } static void KdKbdCtrl(DeviceIntPtr pDevice, KeybdCtrl * ctrl) { KdKeyboardInfo *ki; for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->dixdev && ki->dixdev->id == pDevice->id) break; } if (!ki || !ki->dixdev || ki->dixdev->id != pDevice->id || !ki->driver) return; KdSetLeds(ki, ctrl->leds); ki->bellPitch = ctrl->bell_pitch; ki->bellDuration = ctrl->bell_duration; } static int KdKeyboardProc(DeviceIntPtr pDevice, int onoff) { Bool ret; DevicePtr pDev = (DevicePtr) pDevice; KdKeyboardInfo *ki; Atom xiclass; XkbRMLVOSet rmlvo; if (!pDev) return BadImplementation; for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->dixdev && ki->dixdev->id == pDevice->id) break; } if (!ki || !ki->dixdev || ki->dixdev->id != pDevice->id) { return BadImplementation; } switch (onoff) { case DEVICE_INIT: #ifdef DEBUG ErrorF("initialising keyboard %s\n", ki->name); #endif if (!ki->driver) { if (!ki->driverPrivate) { ErrorF("no driver specified!\n"); return BadImplementation; } ki->driver = KdFindKeyboardDriver(ki->driverPrivate); if (!ki->driver) { ErrorF("Couldn't find keyboard driver %s\n", ki->driverPrivate ? (char *) ki->driverPrivate : "(unnamed)"); return !Success; } free(ki->driverPrivate); ki->driverPrivate = NULL; } if (!ki->driver->Init) { ErrorF("Keyboard %s: no init function\n", ki->name); return BadImplementation; } if ((*ki->driver->Init) (ki) != Success) { return !Success; } memset(&rmlvo, 0, sizeof(rmlvo)); rmlvo.rules = ki->xkbRules; rmlvo.model = ki->xkbModel; rmlvo.layout = ki->xkbLayout; rmlvo.variant = ki->xkbVariant; rmlvo.options = ki->xkbOptions; ret = InitKeyboardDeviceStruct(pDevice, &rmlvo, KdBell, KdKbdCtrl); if (!ret) { ErrorF("Couldn't initialise keyboard %s\n", ki->name); return BadImplementation; } xiclass = AtomFromName(XI_KEYBOARD); AssignTypeAndName(pDevice, xiclass, ki->name ? ki->name : "Generic KDrive Keyboard"); KdResetInputMachine(); return Success; case DEVICE_ON: if (pDev->on == TRUE) return Success; if (!ki->driver->Enable) return BadImplementation; if ((*ki->driver->Enable) (ki) != Success) { return BadMatch; } pDev->on = TRUE; return Success; case DEVICE_OFF: if (pDev->on == FALSE) return Success; if (!ki->driver->Disable) return BadImplementation; (*ki->driver->Disable) (ki); pDev->on = FALSE; return Success; break; case DEVICE_CLOSE: if (pDev->on) { if (!ki->driver->Disable) return BadImplementation; (*ki->driver->Disable) (ki); pDev->on = FALSE; } if (!ki->driver->Fini) return BadImplementation; (*ki->driver->Fini) (ki); KdRemoveKeyboard(ki); return Success; } /* NOTREACHED */ return BadImplementation; } void KdAddPointerDriver(KdPointerDriver * driver) { KdPointerDriver **prev; if (!driver) return; for (prev = &kdPointerDrivers; *prev; prev = &(*prev)->next) { if (*prev == driver) return; } *prev = driver; } void KdRemovePointerDriver(KdPointerDriver * driver) { KdPointerDriver *tmp; if (!driver) return; /* FIXME remove all pointers using this driver */ for (tmp = kdPointerDrivers; tmp; tmp = tmp->next) { if (tmp->next == driver) tmp->next = driver->next; } if (tmp == driver) tmp = NULL; } void KdAddKeyboardDriver(KdKeyboardDriver * driver) { KdKeyboardDriver **prev; if (!driver) return; for (prev = &kdKeyboardDrivers; *prev; prev = &(*prev)->next) { if (*prev == driver) return; } *prev = driver; } void KdRemoveKeyboardDriver(KdKeyboardDriver * driver) { KdKeyboardDriver *tmp; if (!driver) return; /* FIXME remove all keyboards using this driver */ for (tmp = kdKeyboardDrivers; tmp; tmp = tmp->next) { if (tmp->next == driver) tmp->next = driver->next; } if (tmp == driver) tmp = NULL; } KdKeyboardInfo * KdNewKeyboard(void) { KdKeyboardInfo *ki = calloc(sizeof(KdKeyboardInfo), 1); if (!ki) return NULL; ki->minScanCode = 0; ki->maxScanCode = 0; ki->leds = 0; ki->bellPitch = 1000; ki->bellDuration = 200; ki->next = NULL; ki->options = NULL; ki->xkbRules = strdup(XKB_DFLT_RULES); ki->xkbModel = strdup(XKB_DFLT_MODEL); ki->xkbLayout = strdup(XKB_DFLT_LAYOUT); ki->xkbVariant = strdup(XKB_DFLT_VARIANT); ki->xkbOptions = strdup(XKB_DFLT_OPTIONS); return ki; } int KdAddConfigKeyboard(char *keyboard) { struct KdConfigDevice **prev, *new; if (!keyboard) return Success; new = (struct KdConfigDevice *) calloc(sizeof(struct KdConfigDevice), 1); if (!new) return BadAlloc; new->line = strdup(keyboard); new->next = NULL; for (prev = &kdConfigKeyboards; *prev; prev = &(*prev)->next); *prev = new; return Success; } int KdAddKeyboard(KdKeyboardInfo * ki) { KdKeyboardInfo **prev; if (!ki) return !Success; ki->dixdev = AddInputDevice(serverClient, KdKeyboardProc, TRUE); if (!ki->dixdev) { ErrorF("Couldn't register keyboard device %s\n", ki->name ? ki->name : "(unnamed)"); return !Success; } #ifdef DEBUG ErrorF("added keyboard %s with dix id %d\n", ki->name, ki->dixdev->id); #endif for (prev = &kdKeyboards; *prev; prev = &(*prev)->next); *prev = ki; return Success; } void KdRemoveKeyboard(KdKeyboardInfo * ki) { KdKeyboardInfo **prev; if (!ki) return; for (prev = &kdKeyboards; *prev; prev = &(*prev)->next) { if (*prev == ki) { *prev = ki->next; break; } } KdFreeKeyboard(ki); } int KdAddConfigPointer(char *pointer) { struct KdConfigDevice **prev, *new; if (!pointer) return Success; new = (struct KdConfigDevice *) calloc(sizeof(struct KdConfigDevice), 1); if (!new) return BadAlloc; new->line = strdup(pointer); new->next = NULL; for (prev = &kdConfigPointers; *prev; prev = &(*prev)->next); *prev = new; return Success; } int KdAddPointer(KdPointerInfo * pi) { KdPointerInfo **prev; if (!pi) return Success; pi->mouseState = start; pi->eventHeld = FALSE; pi->dixdev = AddInputDevice(serverClient, KdPointerProc, TRUE); if (!pi->dixdev) { ErrorF("Couldn't add pointer device %s\n", pi->name ? pi->name : "(unnamed)"); return BadDevice; } for (prev = &kdPointers; *prev; prev = &(*prev)->next); *prev = pi; return Success; } void KdRemovePointer(KdPointerInfo * pi) { KdPointerInfo **prev; if (!pi) return; for (prev = &kdPointers; *prev; prev = &(*prev)->next) { if (*prev == pi) { *prev = pi->next; break; } } KdFreePointer(pi); } /* * You can call your kdriver server with something like: * $ ./hw/kdrive/yourserver/X :1 -mouse evdev,,device=/dev/input/event4 -keybd * evdev,,device=/dev/input/event1,xkbmodel=abnt2,xkblayout=br */ static Bool KdGetOptions(InputOption **options, char *string) { InputOption *newopt = NULL; char *key = NULL, *value = NULL; int tam_key = 0; if (strchr(string, '=')) { tam_key = (strchr(string, '=') - string); key = strndup(string, tam_key); if (!key) goto out; value = strdup(strchr(string, '=') + 1); if (!value) goto out; } else { key = strdup(string); value = NULL; } newopt = input_option_new(*options, key, value); if (newopt) *options = newopt; out: free(key); free(value); return (newopt != NULL); } static void KdParseKbdOptions(KdKeyboardInfo * ki) { InputOption *option = NULL; nt_list_for_each_entry(option, ki->options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); if (strcasecmp(key, "XkbRules") == 0) ki->xkbRules = strdup(value); else if (strcasecmp(key, "XkbModel") == 0) ki->xkbModel = strdup(value); else if (strcasecmp(key, "XkbLayout") == 0) ki->xkbLayout = strdup(value); else if (strcasecmp(key, "XkbVariant") == 0) ki->xkbVariant = strdup(value); else if (strcasecmp(key, "XkbOptions") == 0) ki->xkbOptions = strdup(value); else if (!strcasecmp(key, "device")) ki->path = strdup(value); else ErrorF("Kbd option key (%s) of value (%s) not assigned!\n", key, value); } } KdKeyboardInfo * KdParseKeyboard(const char *arg) { char save[1024]; char delim; InputOption *options = NULL; KdKeyboardInfo *ki = NULL; ki = KdNewKeyboard(); if (!ki) return NULL; ki->name = strdup("Unknown KDrive Keyboard"); ki->path = NULL; ki->driver = NULL; ki->driverPrivate = NULL; ki->next = NULL; if (!arg) { ErrorF("keybd: no arg\n"); KdFreeKeyboard(ki); return NULL; } if (strlen(arg) >= sizeof(save)) { ErrorF("keybd: arg too long\n"); KdFreeKeyboard(ki); return NULL; } arg = KdParseFindNext(arg, ",", save, &delim); if (!save[0]) { ErrorF("keybd: failed on save[0]\n"); KdFreeKeyboard(ki); return NULL; } if (strcmp(save, "auto") == 0) ki->driverPrivate = NULL; else ki->driverPrivate = strdup(save); if (delim != ',') { return ki; } arg = KdParseFindNext(arg, ",", save, &delim); while (delim == ',') { arg = KdParseFindNext(arg, ",", save, &delim); if (!KdGetOptions(&options, save)) { KdFreeKeyboard(ki); return NULL; } } if (options) { ki->options = options; KdParseKbdOptions(ki); } return ki; } static void KdParsePointerOptions(KdPointerInfo * pi) { InputOption *option = NULL; nt_list_for_each_entry(option, pi->options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); if (!strcmp(key, "emulatemiddle")) pi->emulateMiddleButton = TRUE; else if (!strcmp(key, "noemulatemiddle")) pi->emulateMiddleButton = FALSE; else if (!strcmp(key, "transformcoord")) pi->transformCoordinates = TRUE; else if (!strcmp(key, "rawcoord")) pi->transformCoordinates = FALSE; else if (!strcasecmp(key, "device")) pi->path = strdup(value); else if (!strcasecmp(key, "protocol")) pi->protocol = strdup(value); else ErrorF("Pointer option key (%s) of value (%s) not assigned!\n", key, value); } } KdPointerInfo * KdParsePointer(const char *arg) { char save[1024]; char delim; KdPointerInfo *pi = NULL; InputOption *options = NULL; int i = 0; pi = KdNewPointer(); if (!pi) return NULL; pi->emulateMiddleButton = kdEmulateMiddleButton; pi->transformCoordinates = !kdRawPointerCoordinates; pi->protocol = NULL; pi->nButtons = 5; /* XXX should not be hardcoded */ pi->inputClass = KD_MOUSE; if (!arg) { ErrorF("mouse: no arg\n"); KdFreePointer(pi); return NULL; } if (strlen(arg) >= sizeof(save)) { ErrorF("mouse: arg too long\n"); KdFreePointer(pi); return NULL; } arg = KdParseFindNext(arg, ",", save, &delim); if (!save[0]) { ErrorF("failed on save[0]\n"); KdFreePointer(pi); return NULL; } if (strcmp(save, "auto") == 0) pi->driverPrivate = NULL; else pi->driverPrivate = strdup(save); if (delim != ',') { return pi; } arg = KdParseFindNext(arg, ",", save, &delim); while (delim == ',') { arg = KdParseFindNext(arg, ",", save, &delim); if (save[0] == '{') { char *s = save + 1; i = 0; while (*s && *s != '}') { if ('1' <= *s && *s <= '0' + pi->nButtons) pi->map[i] = *s - '0'; else UseMsg(); s++; } } else { if (!KdGetOptions(&options, save)) { KdFreePointer(pi); return NULL; } } } if (options) { pi->options = options; KdParsePointerOptions(pi); } return pi; } void KdInitInput(void) { KdPointerInfo *pi; KdKeyboardInfo *ki; struct KdConfigDevice *dev; kdInputEnabled = TRUE; for (dev = kdConfigPointers; dev; dev = dev->next) { pi = KdParsePointer(dev->line); if (!pi) ErrorF("Failed to parse pointer\n"); if (KdAddPointer(pi) != Success) ErrorF("Failed to add pointer!\n"); } for (dev = kdConfigKeyboards; dev; dev = dev->next) { ki = KdParseKeyboard(dev->line); if (!ki) ErrorF("Failed to parse keyboard\n"); if (KdAddKeyboard(ki) != Success) ErrorF("Failed to add keyboard!\n"); } mieqInit(); } void KdCloseInput(void) { mieqFini(); } /* * Middle button emulation state machine * * Possible transitions: * Button 1 press v1 * Button 1 release ^1 * Button 2 press v2 * Button 2 release ^2 * Button 3 press v3 * Button 3 release ^3 * Button other press vo * Button other release ^o * Mouse motion <> * Keyboard event k * timeout ... * outside box <-> * * States: * start * button_1_pend * button_1_down * button_2_down * button_3_pend * button_3_down * synthetic_2_down_13 * synthetic_2_down_3 * synthetic_2_down_1 * * Transition diagram * * start * v1 -> (hold) (settimeout) button_1_pend * ^1 -> (deliver) start * v2 -> (deliver) button_2_down * ^2 -> (deliever) start * v3 -> (hold) (settimeout) button_3_pend * ^3 -> (deliver) start * vo -> (deliver) start * ^o -> (deliver) start * <> -> (deliver) start * k -> (deliver) start * * button_1_pend (button 1 is down, timeout pending) * ^1 -> (release) (deliver) start * v2 -> (release) (deliver) button_1_down * ^2 -> (release) (deliver) button_1_down * v3 -> (cleartimeout) (generate v2) synthetic_2_down_13 * ^3 -> (release) (deliver) button_1_down * vo -> (release) (deliver) button_1_down * ^o -> (release) (deliver) button_1_down * <-> -> (release) (deliver) button_1_down * <> -> (deliver) button_1_pend * k -> (release) (deliver) button_1_down * ... -> (release) button_1_down * * button_1_down (button 1 is down) * ^1 -> (deliver) start * v2 -> (deliver) button_1_down * ^2 -> (deliver) button_1_down * v3 -> (deliver) button_1_down * ^3 -> (deliver) button_1_down * vo -> (deliver) button_1_down * ^o -> (deliver) button_1_down * <> -> (deliver) button_1_down * k -> (deliver) button_1_down * * button_2_down (button 2 is down) * v1 -> (deliver) button_2_down * ^1 -> (deliver) button_2_down * ^2 -> (deliver) start * v3 -> (deliver) button_2_down * ^3 -> (deliver) button_2_down * vo -> (deliver) button_2_down * ^o -> (deliver) button_2_down * <> -> (deliver) button_2_down * k -> (deliver) button_2_down * * button_3_pend (button 3 is down, timeout pending) * v1 -> (generate v2) synthetic_2_down * ^1 -> (release) (deliver) button_3_down * v2 -> (release) (deliver) button_3_down * ^2 -> (release) (deliver) button_3_down * ^3 -> (release) (deliver) start * vo -> (release) (deliver) button_3_down * ^o -> (release) (deliver) button_3_down * <-> -> (release) (deliver) button_3_down * <> -> (deliver) button_3_pend * k -> (release) (deliver) button_3_down * ... -> (release) button_3_down * * button_3_down (button 3 is down) * v1 -> (deliver) button_3_down * ^1 -> (deliver) button_3_down * v2 -> (deliver) button_3_down * ^2 -> (deliver) button_3_down * ^3 -> (deliver) start * vo -> (deliver) button_3_down * ^o -> (deliver) button_3_down * <> -> (deliver) button_3_down * k -> (deliver) button_3_down * * synthetic_2_down_13 (button 1 and 3 are down) * ^1 -> (generate ^2) synthetic_2_down_3 * v2 -> synthetic_2_down_13 * ^2 -> synthetic_2_down_13 * ^3 -> (generate ^2) synthetic_2_down_1 * vo -> (deliver) synthetic_2_down_13 * ^o -> (deliver) synthetic_2_down_13 * <> -> (deliver) synthetic_2_down_13 * k -> (deliver) synthetic_2_down_13 * * synthetic_2_down_3 (button 3 is down) * v1 -> (deliver) synthetic_2_down_3 * ^1 -> (deliver) synthetic_2_down_3 * v2 -> synthetic_2_down_3 * ^2 -> synthetic_2_down_3 * ^3 -> start * vo -> (deliver) synthetic_2_down_3 * ^o -> (deliver) synthetic_2_down_3 * <> -> (deliver) synthetic_2_down_3 * k -> (deliver) synthetic_2_down_3 * * synthetic_2_down_1 (button 1 is down) * ^1 -> start * v2 -> synthetic_2_down_1 * ^2 -> synthetic_2_down_1 * v3 -> (deliver) synthetic_2_down_1 * ^3 -> (deliver) synthetic_2_down_1 * vo -> (deliver) synthetic_2_down_1 * ^o -> (deliver) synthetic_2_down_1 * <> -> (deliver) synthetic_2_down_1 * k -> (deliver) synthetic_2_down_1 */ typedef enum _inputClass { down_1, up_1, down_2, up_2, down_3, up_3, down_o, up_o, motion, outside_box, keyboard, timeout, num_input_class } KdInputClass; typedef enum _inputAction { noop, hold, setto, deliver, release, clearto, gen_down_2, gen_up_2 } KdInputAction; #define MAX_ACTIONS 2 typedef struct _inputTransition { KdInputAction actions[MAX_ACTIONS]; KdPointerState nextState; } KdInputTransition; static const KdInputTransition kdInputMachine[num_input_states][num_input_class] = { /* start */ { {{hold, setto}, button_1_pend}, /* v1 */ {{deliver, noop}, start}, /* ^1 */ {{deliver, noop}, button_2_down}, /* v2 */ {{deliver, noop}, start}, /* ^2 */ {{hold, setto}, button_3_pend}, /* v3 */ {{deliver, noop}, start}, /* ^3 */ {{deliver, noop}, start}, /* vo */ {{deliver, noop}, start}, /* ^o */ {{deliver, noop}, start}, /* <> */ {{deliver, noop}, start}, /* <-> */ {{noop, noop}, start}, /* k */ {{noop, noop}, start}, /* ... */ }, /* button_1_pend */ { {{noop, noop}, button_1_pend}, /* v1 */ {{release, deliver}, start}, /* ^1 */ {{release, deliver}, button_1_down}, /* v2 */ {{release, deliver}, button_1_down}, /* ^2 */ {{clearto, gen_down_2}, synth_2_down_13}, /* v3 */ {{release, deliver}, button_1_down}, /* ^3 */ {{release, deliver}, button_1_down}, /* vo */ {{release, deliver}, button_1_down}, /* ^o */ {{deliver, noop}, button_1_pend}, /* <> */ {{release, deliver}, button_1_down}, /* <-> */ {{noop, noop}, button_1_down}, /* k */ {{release, noop}, button_1_down}, /* ... */ }, /* button_1_down */ { {{noop, noop}, button_1_down}, /* v1 */ {{deliver, noop}, start}, /* ^1 */ {{deliver, noop}, button_1_down}, /* v2 */ {{deliver, noop}, button_1_down}, /* ^2 */ {{deliver, noop}, button_1_down}, /* v3 */ {{deliver, noop}, button_1_down}, /* ^3 */ {{deliver, noop}, button_1_down}, /* vo */ {{deliver, noop}, button_1_down}, /* ^o */ {{deliver, noop}, button_1_down}, /* <> */ {{deliver, noop}, button_1_down}, /* <-> */ {{noop, noop}, button_1_down}, /* k */ {{noop, noop}, button_1_down}, /* ... */ }, /* button_2_down */ { {{deliver, noop}, button_2_down}, /* v1 */ {{deliver, noop}, button_2_down}, /* ^1 */ {{noop, noop}, button_2_down}, /* v2 */ {{deliver, noop}, start}, /* ^2 */ {{deliver, noop}, button_2_down}, /* v3 */ {{deliver, noop}, button_2_down}, /* ^3 */ {{deliver, noop}, button_2_down}, /* vo */ {{deliver, noop}, button_2_down}, /* ^o */ {{deliver, noop}, button_2_down}, /* <> */ {{deliver, noop}, button_2_down}, /* <-> */ {{noop, noop}, button_2_down}, /* k */ {{noop, noop}, button_2_down}, /* ... */ }, /* button_3_pend */ { {{clearto, gen_down_2}, synth_2_down_13}, /* v1 */ {{release, deliver}, button_3_down}, /* ^1 */ {{release, deliver}, button_3_down}, /* v2 */ {{release, deliver}, button_3_down}, /* ^2 */ {{release, deliver}, button_3_down}, /* v3 */ {{release, deliver}, start}, /* ^3 */ {{release, deliver}, button_3_down}, /* vo */ {{release, deliver}, button_3_down}, /* ^o */ {{deliver, noop}, button_3_pend}, /* <> */ {{release, deliver}, button_3_down}, /* <-> */ {{release, noop}, button_3_down}, /* k */ {{release, noop}, button_3_down}, /* ... */ }, /* button_3_down */ { {{deliver, noop}, button_3_down}, /* v1 */ {{deliver, noop}, button_3_down}, /* ^1 */ {{deliver, noop}, button_3_down}, /* v2 */ {{deliver, noop}, button_3_down}, /* ^2 */ {{noop, noop}, button_3_down}, /* v3 */ {{deliver, noop}, start}, /* ^3 */ {{deliver, noop}, button_3_down}, /* vo */ {{deliver, noop}, button_3_down}, /* ^o */ {{deliver, noop}, button_3_down}, /* <> */ {{deliver, noop}, button_3_down}, /* <-> */ {{noop, noop}, button_3_down}, /* k */ {{noop, noop}, button_3_down}, /* ... */ }, /* synthetic_2_down_13 */ { {{noop, noop}, synth_2_down_13}, /* v1 */ {{gen_up_2, noop}, synth_2_down_3}, /* ^1 */ {{noop, noop}, synth_2_down_13}, /* v2 */ {{noop, noop}, synth_2_down_13}, /* ^2 */ {{noop, noop}, synth_2_down_13}, /* v3 */ {{gen_up_2, noop}, synth_2_down_1}, /* ^3 */ {{deliver, noop}, synth_2_down_13}, /* vo */ {{deliver, noop}, synth_2_down_13}, /* ^o */ {{deliver, noop}, synth_2_down_13}, /* <> */ {{deliver, noop}, synth_2_down_13}, /* <-> */ {{noop, noop}, synth_2_down_13}, /* k */ {{noop, noop}, synth_2_down_13}, /* ... */ }, /* synthetic_2_down_3 */ { {{deliver, noop}, synth_2_down_3}, /* v1 */ {{deliver, noop}, synth_2_down_3}, /* ^1 */ {{deliver, noop}, synth_2_down_3}, /* v2 */ {{deliver, noop}, synth_2_down_3}, /* ^2 */ {{noop, noop}, synth_2_down_3}, /* v3 */ {{noop, noop}, start}, /* ^3 */ {{deliver, noop}, synth_2_down_3}, /* vo */ {{deliver, noop}, synth_2_down_3}, /* ^o */ {{deliver, noop}, synth_2_down_3}, /* <> */ {{deliver, noop}, synth_2_down_3}, /* <-> */ {{noop, noop}, synth_2_down_3}, /* k */ {{noop, noop}, synth_2_down_3}, /* ... */ }, /* synthetic_2_down_1 */ { {{noop, noop}, synth_2_down_1}, /* v1 */ {{noop, noop}, start}, /* ^1 */ {{deliver, noop}, synth_2_down_1}, /* v2 */ {{deliver, noop}, synth_2_down_1}, /* ^2 */ {{deliver, noop}, synth_2_down_1}, /* v3 */ {{deliver, noop}, synth_2_down_1}, /* ^3 */ {{deliver, noop}, synth_2_down_1}, /* vo */ {{deliver, noop}, synth_2_down_1}, /* ^o */ {{deliver, noop}, synth_2_down_1}, /* <> */ {{deliver, noop}, synth_2_down_1}, /* <-> */ {{noop, noop}, synth_2_down_1}, /* k */ {{noop, noop}, synth_2_down_1}, /* ... */ }, }; #define EMULATION_WINDOW 10 #define EMULATION_TIMEOUT 100 static int KdInsideEmulationWindow(KdPointerInfo * pi, int x, int y, int z) { pi->emulationDx = pi->heldEvent.x - x; pi->emulationDy = pi->heldEvent.y - y; return (abs(pi->emulationDx) < EMULATION_WINDOW && abs(pi->emulationDy) < EMULATION_WINDOW); } static KdInputClass KdClassifyInput(KdPointerInfo * pi, int type, int x, int y, int z, int b) { switch (type) { case ButtonPress: switch (b) { case 1: return down_1; case 2: return down_2; case 3: return down_3; default: return down_o; } break; case ButtonRelease: switch (b) { case 1: return up_1; case 2: return up_2; case 3: return up_3; default: return up_o; } break; case MotionNotify: if (pi->eventHeld && !KdInsideEmulationWindow(pi, x, y, z)) return outside_box; else return motion; default: return keyboard; } return keyboard; } #ifdef DEBUG char *kdStateNames[] = { "start", "button_1_pend", "button_1_down", "button_2_down", "button_3_pend", "button_3_down", "synth_2_down_13", "synth_2_down_3", "synthetic_2_down_1", "num_input_states" }; char *kdClassNames[] = { "down_1", "up_1", "down_2", "up_2", "down_3", "up_3", "motion", "ouside_box", "keyboard", "timeout", "num_input_class" }; char *kdActionNames[] = { "noop", "hold", "setto", "deliver", "release", "clearto", "gen_down_2", "gen_up_2", }; #endif /* DEBUG */ /* We return true if we're stealing the event. */ static Bool KdRunMouseMachine(KdPointerInfo * pi, KdInputClass c, int type, int x, int y, int z, int b, int absrel) { const KdInputTransition *t; int a; c = KdClassifyInput(pi, type, x, y, z, b); t = &kdInputMachine[pi->mouseState][c]; for (a = 0; a < MAX_ACTIONS; a++) { switch (t->actions[a]) { case noop: break; case hold: pi->eventHeld = TRUE; pi->emulationDx = 0; pi->emulationDy = 0; pi->heldEvent.type = type; pi->heldEvent.x = x; pi->heldEvent.y = y; pi->heldEvent.z = z; pi->heldEvent.flags = b; pi->heldEvent.absrel = absrel; return TRUE; break; case setto: pi->emulationTimeout = GetTimeInMillis() + EMULATION_TIMEOUT; pi->timeoutPending = TRUE; break; case deliver: _KdEnqueuePointerEvent(pi, pi->heldEvent.type, pi->heldEvent.x, pi->heldEvent.y, pi->heldEvent.z, pi->heldEvent.flags, pi->heldEvent.absrel, TRUE); break; case release: pi->eventHeld = FALSE; pi->timeoutPending = FALSE; _KdEnqueuePointerEvent(pi, pi->heldEvent.type, pi->heldEvent.x, pi->heldEvent.y, pi->heldEvent.z, pi->heldEvent.flags, pi->heldEvent.absrel, TRUE); return TRUE; break; case clearto: pi->timeoutPending = FALSE; break; case gen_down_2: _KdEnqueuePointerEvent(pi, ButtonPress, x, y, z, 2, absrel, TRUE); pi->eventHeld = FALSE; return TRUE; break; case gen_up_2: _KdEnqueuePointerEvent(pi, ButtonRelease, x, y, z, 2, absrel, TRUE); return TRUE; break; } } pi->mouseState = t->nextState; return FALSE; } static int KdHandlePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, int b, int absrel) { if (pi->emulateMiddleButton) return KdRunMouseMachine(pi, KdClassifyInput(pi, type, x, y, z, b), type, x, y, z, b, absrel); return FALSE; } static void KdReceiveTimeout(KdPointerInfo * pi) { KdRunMouseMachine(pi, timeout, 0, 0, 0, 0, 0, 0); } /* * kdCheckTermination * * This function checks for the key sequence that terminates the server. When * detected, it sets the dispatchException flag and returns. The key sequence * is: * Control-Alt * It's assumed that the server will be waken up by the caller when this * function returns. */ extern int nClients; void KdReleaseAllKeys(void) { #if 0 int key; KdKeyboardInfo *ki; OsBlockSIGIO(); for (ki = kdKeyboards; ki; ki = ki->next) { for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) { if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) { KdHandleKeyboardEvent(ki, KeyRelease, key); QueueGetKeyboardEvents(ki->dixdev, KeyRelease, key, NULL); } } } OsReleaseSIGIO(); #endif } static void KdCheckLock(void) { KeyClassPtr keyc = NULL; Bool isSet = FALSE, shouldBeSet = FALSE; KdKeyboardInfo *tmp = NULL; for (tmp = kdKeyboards; tmp; tmp = tmp->next) { if (tmp->LockLed && tmp->dixdev && tmp->dixdev->key) { keyc = tmp->dixdev->key; isSet = (tmp->leds & (1 << (tmp->LockLed - 1))) != 0; /* FIXME: Just use XKB indicators! */ shouldBeSet = ! !(XkbStateFieldFromRec(&keyc->xkbInfo->state) & LockMask); if (isSet != shouldBeSet) KdSetLed(tmp, tmp->LockLed, shouldBeSet); } } } void KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code, unsigned char is_up) { unsigned char key_code; int type; if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed || !ki->dixdev->key) return; if (scan_code >= ki->minScanCode && scan_code <= ki->maxScanCode) { key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode; /* * Set up this event -- the type may be modified below */ if (is_up) type = KeyRelease; else type = KeyPress; QueueKeyboardEvents(ki->dixdev, type, key_code, NULL); } else { ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n", ki->name, scan_code, ki->minScanCode, ki->maxScanCode); } } /* * kdEnqueuePointerEvent * * This function converts hardware mouse event information into X event * information. A mouse movement event is passed off to MI to generate * a MotionNotify event, if appropriate. Button events are created and * passed off to MI for enqueueing. */ /* FIXME do something a little more clever to deal with multiple axes here */ void KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry, int rz) { unsigned char buttons; int x, y, z; int (*matrix)[3] = kdPointerMatrix.matrix; unsigned long button; int n; int dixflags = 0; if (!pi) return; /* we don't need to transform z, so we don't. */ if (flags & KD_MOUSE_DELTA) { if (pi->transformCoordinates) { x = matrix[0][0] * rx + matrix[0][1] * ry; y = matrix[1][0] * rx + matrix[1][1] * ry; } else { x = rx; y = ry; } } else { if (pi->transformCoordinates) { x = matrix[0][0] * rx + matrix[0][1] * ry + matrix[0][2]; y = matrix[1][0] * rx + matrix[1][1] * ry + matrix[1][2]; } else { x = rx; y = ry; } } z = rz; if (flags & KD_MOUSE_DELTA) { if (x || y || z) { dixflags = POINTER_RELATIVE | POINTER_ACCELERATE; _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); } } else { dixflags = POINTER_ABSOLUTE; if (flags & KD_POINTER_DESKTOP) dixflags |= POINTER_DESKTOP; if (x != pi->dixdev->last.valuators[0] || y != pi->dixdev->last.valuators[1]) _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); } buttons = flags; for (button = KD_BUTTON_1, n = 1; n <= pi->nButtons; button <<= 1, n++) { if (((pi->buttonState & button) ^ (buttons & button)) && !(buttons & button)) { _KdEnqueuePointerEvent(pi, ButtonRelease, x, y, z, n, dixflags, FALSE); } } for (button = KD_BUTTON_1, n = 1; n <= pi->nButtons; button <<= 1, n++) { if (((pi->buttonState & button) ^ (buttons & button)) && (buttons & button)) { _KdEnqueuePointerEvent(pi, ButtonPress, x, y, z, n, dixflags, FALSE); } } pi->buttonState = buttons; } void _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, int b, int absrel, Bool force) { int valuators[3] = { x, y, z }; ValuatorMask mask; /* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */ if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel)) return; valuator_mask_set_range(&mask, 0, 3, valuators); QueuePointerEvents(pi->dixdev, type, b, absrel, &mask); } void KdBlockHandler(ScreenPtr pScreen, void *timeo, void *readmask) { KdPointerInfo *pi; int myTimeout = 0; for (pi = kdPointers; pi; pi = pi->next) { if (pi->timeoutPending) { int ms; ms = pi->emulationTimeout - GetTimeInMillis(); if (ms < 1) ms = 1; if (ms < myTimeout || myTimeout == 0) myTimeout = ms; } } /* if we need to poll for events, do that */ if (kdOsFuncs->pollEvents) { (*kdOsFuncs->pollEvents) (); myTimeout = 20; } if (myTimeout > 0) AdjustWaitForDelay(timeo, myTimeout); } void KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, void *readmask) { int result = (int) lresult; fd_set *pReadmask = (fd_set *) readmask; int i; KdPointerInfo *pi; if (kdInputEnabled && result > 0) { for (i = 0; i < kdNumInputFds; i++) if (FD_ISSET(kdInputFds[i].fd, pReadmask)) { OsBlockSIGIO(); (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); OsReleaseSIGIO(); } } for (pi = kdPointers; pi; pi = pi->next) { if (pi->timeoutPending) { if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) { pi->timeoutPending = FALSE; OsBlockSIGIO(); KdReceiveTimeout(pi); OsReleaseSIGIO(); } } } if (kdSwitchPending) KdProcessSwitch(); } #define KdScreenOrigin(pScreen) (&(KdGetScreenPriv(pScreen)->screen->origin)) static Bool KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) { ScreenPtr pScreen = *ppScreen; ScreenPtr pNewScreen; int n; int dx, dy; int best_x, best_y; int n_best_x, n_best_y; CARD32 ms; if (kdDisableZaphod || screenInfo.numScreens <= 1) return FALSE; if (0 <= *x && *x < pScreen->width && 0 <= *y && *y < pScreen->height) return FALSE; ms = GetTimeInMillis(); if (kdOffScreen && (int) (ms - kdOffScreenTime) < 1000) return FALSE; kdOffScreen = TRUE; kdOffScreenTime = ms; n_best_x = -1; best_x = 32767; n_best_y = -1; best_y = 32767; for (n = 0; n < screenInfo.numScreens; n++) { pNewScreen = screenInfo.screens[n]; if (pNewScreen == pScreen) continue; dx = KdScreenOrigin(pNewScreen)->x - KdScreenOrigin(pScreen)->x; dy = KdScreenOrigin(pNewScreen)->y - KdScreenOrigin(pScreen)->y; if (*x < 0) { if (dx < 0 && -dx < best_x) { best_x = -dx; n_best_x = n; } } else if (*x >= pScreen->width) { if (dx > 0 && dx < best_x) { best_x = dx; n_best_x = n; } } if (*y < 0) { if (dy < 0 && -dy < best_y) { best_y = -dy; n_best_y = n; } } else if (*y >= pScreen->height) { if (dy > 0 && dy < best_y) { best_y = dy; n_best_y = n; } } } if (best_y < best_x) n_best_x = n_best_y; if (n_best_x == -1) return FALSE; pNewScreen = screenInfo.screens[n_best_x]; if (*x < 0) *x += pNewScreen->width; if (*y < 0) *y += pNewScreen->height; if (*x >= pScreen->width) *x -= pScreen->width; if (*y >= pScreen->height) *y -= pScreen->height; *ppScreen = pNewScreen; return TRUE; } static void KdCrossScreen(ScreenPtr pScreen, Bool entering) { } int KdCurScreen; /* current event screen */ static void KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { OsBlockSIGIO(); KdCurScreen = pScreen->myNum; miPointerWarpCursor(pDev, pScreen, x, y); OsReleaseSIGIO(); } miPointerScreenFuncRec kdPointerScreenFuncs = { KdCursorOffScreen, KdCrossScreen, KdWarpCursor }; void ProcessInputEvents(void) { mieqProcessInputEvents(); if (kdSwitchPending) KdProcessSwitch(); KdCheckLock(); } /* At the moment, absolute/relative is up to the client. */ int SetDeviceMode(register ClientPtr client, DeviceIntPtr pDev, int mode) { return BadMatch; } int SetDeviceValuators(register ClientPtr client, DeviceIntPtr pDev, int *valuators, int first_valuator, int num_valuators) { return BadMatch; } int ChangeDeviceControl(register ClientPtr client, DeviceIntPtr pDev, xDeviceCtl * control) { switch (control->control) { case DEVICE_RESOLUTION: /* FIXME do something more intelligent here */ return BadMatch; case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: case DEVICE_CORE: return BadMatch; case DEVICE_ENABLE: return Success; default: return BadMatch; } /* NOTREACHED */ return BadImplementation; } int NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *pdev) { InputOption *option = NULL; KdPointerInfo *pi = NULL; KdKeyboardInfo *ki = NULL; nt_list_for_each_entry(option, options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); if (strcmp(key, "type") == 0) { if (strcmp(value, "pointer") == 0) { pi = KdNewPointer(); if (!pi) return BadAlloc; } else if (strcmp(value, "keyboard") == 0) { ki = KdNewKeyboard(); if (!ki) return BadAlloc; } else { ErrorF("unrecognised device type!\n"); return BadValue; } } #ifdef CONFIG_HAL else if (strcmp(key, "_source") == 0 && strcmp(value, "server/hal") == 0) { ErrorF("Ignoring device from HAL.\n"); return BadValue; } #endif #ifdef CONFIG_UDEV else if (strcmp(key, "_source") == 0 && strcmp(value, "server/udev") == 0) { ErrorF("Ignoring device from udev.\n"); return BadValue; } #endif } if (!ki && !pi) { ErrorF("unrecognised device identifier!\n"); return BadValue; } /* FIXME: change this code below to use KdParseKbdOptions and * KdParsePointerOptions */ nt_list_for_each_entry(option, options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); if (strcmp(key, "device") == 0) { if (pi && value) pi->path = strdup(value); else if (ki && value) ki->path = strdup(value); } else if (strcmp(key, "driver") == 0) { if (pi) { pi->driver = KdFindPointerDriver(value); if (!pi->driver) { ErrorF("couldn't find driver!\n"); KdFreePointer(pi); return BadValue; } pi->options = options; } else if (ki) { ki->driver = KdFindKeyboardDriver(value); if (!ki->driver) { ErrorF("couldn't find driver!\n"); KdFreeKeyboard(ki); return BadValue; } ki->options = options; } } } if (pi) { if (KdAddPointer(pi) != Success || ActivateDevice(pi->dixdev, TRUE) != Success || EnableDevice(pi->dixdev, TRUE) != TRUE) { ErrorF("couldn't add or enable pointer\n"); return BadImplementation; } } else if (ki) { if (KdAddKeyboard(ki) != Success || ActivateDevice(ki->dixdev, TRUE) != Success || EnableDevice(ki->dixdev, TRUE) != TRUE) { ErrorF("couldn't add or enable keyboard\n"); return BadImplementation; } } if (pi) { *pdev = pi->dixdev; } else if (ki) { *pdev = ki->dixdev; } return Success; } void DeleteInputDeviceRequest(DeviceIntPtr pDev) { RemoveDevice(pDev, TRUE); } xorg-server-1.17.1/hw/kdrive/src/fourcc.h0000664000175100017510000000545012274325511015142 00000000000000 /* This header file contains listings of STANDARD guids for video formats. Please do not place non-registered, or incomplete entries in this file. A list of some popular fourcc's are at: http://www.webartz.com/fourcc/ For an explanation of fourcc <-> guid mappings see RFC2361. */ #ifndef _XF86_FOURCC_H_ #define _XF86_FOURCC_H_ 1 #define FOURCC_YUY2 0x32595559 #define XVIMAGE_YUY2 \ { \ FOURCC_YUY2, \ XvYUV, \ LSBFirst, \ {'Y','U','Y','2', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 16, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 1, 1, \ {'Y','U','Y','V', \ 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}, \ XvTopToBottom \ } #define FOURCC_YV12 0x32315659 #define XVIMAGE_YV12 \ { \ FOURCC_YV12, \ XvYUV, \ LSBFirst, \ {'Y','V','1','2', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 12, \ XvPlanar, \ 3, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 2, 2, \ {'Y','V','U', \ 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}, \ XvTopToBottom \ } #define FOURCC_I420 0x30323449 #define XVIMAGE_I420 \ { \ FOURCC_I420, \ XvYUV, \ LSBFirst, \ {'I','4','2','0', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 12, \ XvPlanar, \ 3, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 2, 2, \ {'Y','U','V', \ 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}, \ XvTopToBottom \ } #define FOURCC_UYVY 0x59565955 #define XVIMAGE_UYVY \ { \ FOURCC_UYVY, \ XvYUV, \ LSBFirst, \ {'U','Y','V','Y', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 16, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 1, 1, \ {'U','Y','V','Y', \ 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}, \ XvTopToBottom \ } #define FOURCC_IA44 0x34344149 #define XVIMAGE_IA44 \ { \ FOURCC_IA44, \ XvYUV, \ LSBFirst, \ {'I','A','4','4', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 8, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 1, 1, \ 1, 1, 1, \ {'A','I', \ 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}, \ XvTopToBottom \ } #define FOURCC_AI44 0x34344941 #define XVIMAGE_AI44 \ { \ FOURCC_AI44, \ XvYUV, \ LSBFirst, \ {'A','I','4','4', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 8, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 1, 1, \ 1, 1, 1, \ {'I','A', \ 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}, \ XvTopToBottom \ } #endif /* _XF86_FOURCC_H_ */ xorg-server-1.17.1/hw/kdrive/src/kcmap.c0000664000175100017510000001671212366220413014747 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include "kdrive.h" /* * Put the entire colormap into the DAC */ void KdSetColormap(ScreenPtr pScreen) { KdScreenPriv(pScreen); ColormapPtr pCmap = pScreenPriv->pInstalledmap; Pixel pixels[KD_MAX_PSEUDO_SIZE]; xrgb colors[KD_MAX_PSEUDO_SIZE]; xColorItem defs[KD_MAX_PSEUDO_SIZE]; int i; if (!pScreenPriv->card->cfuncs->putColors) return; if (pScreenPriv->screen->fb.depth > KD_MAX_PSEUDO_DEPTH) return; if (!pScreenPriv->enabled) return; if (!pCmap) return; /* * Make DIX convert pixels into RGB values -- this handles * true/direct as well as pseudo/static visuals */ for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++) pixels[i] = i; QueryColors(pCmap, (1 << pScreenPriv->screen->fb.depth), pixels, colors, serverClient); for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++) { defs[i].pixel = i; defs[i].red = colors[i].red; defs[i].green = colors[i].green; defs[i].blue = colors[i].blue; defs[i].flags = DoRed | DoGreen | DoBlue; } (*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, (1 << pScreenPriv->screen->fb. depth), defs); /* recolor hardware cursor */ if (pScreenPriv->card->cfuncs->recolorCursor) (*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, 0, 0); } /* * When the hardware is enabled, save the hardware colors and store * the current colormap */ void KdEnableColormap(ScreenPtr pScreen) { KdScreenPriv(pScreen); int i; if (!pScreenPriv->card->cfuncs->putColors) return; if (pScreenPriv->screen->fb.depth <= KD_MAX_PSEUDO_DEPTH) { for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++) pScreenPriv->systemPalette[i].pixel = i; (*pScreenPriv->card->cfuncs->getColors) (pScreen, (1 << pScreenPriv->screen->fb. depth), pScreenPriv->systemPalette); } KdSetColormap(pScreen); } void KdDisableColormap(ScreenPtr pScreen) { KdScreenPriv(pScreen); if (!pScreenPriv->card->cfuncs->putColors) return; if (pScreenPriv->screen->fb.depth <= KD_MAX_PSEUDO_DEPTH) { (*pScreenPriv->card->cfuncs->putColors) (pScreen, (1 << pScreenPriv->screen->fb. depth), pScreenPriv->systemPalette); } } /* * KdInstallColormap * * This function is called when the server receives a request to install a * colormap or when the server needs to install one on its own, like when * there's no window manager running and the user has moved the pointer over * an X client window. It needs to build an identity Windows palette for the * colormap and realize it into the Windows system palette. */ void KdInstallColormap(ColormapPtr pCmap) { KdScreenPriv(pCmap->pScreen); if (pCmap == pScreenPriv->pInstalledmap) return; /* Tell X clients that the installed colormap is going away. */ if (pScreenPriv->pInstalledmap) WalkTree(pScreenPriv->pInstalledmap->pScreen, TellLostMap, (void *) &(pScreenPriv->pInstalledmap->mid)); /* Take note of the new installed colorscreen-> */ pScreenPriv->pInstalledmap = pCmap; KdSetColormap(pCmap->pScreen); /* Tell X clients of the new colormap */ WalkTree(pCmap->pScreen, TellGainedMap, (void *) &(pCmap->mid)); } /* * KdUninstallColormap * * This function uninstalls a colormap by either installing * the default X colormap or erasing the installed colormap pointer. * The default X colormap itself cannot be uninstalled. */ void KdUninstallColormap(ColormapPtr pCmap) { KdScreenPriv(pCmap->pScreen); Colormap defMapID; ColormapPtr defMap; /* ignore if not installed */ if (pCmap != pScreenPriv->pInstalledmap) return; /* ignore attempts to uninstall default colormap */ defMapID = pCmap->pScreen->defColormap; if ((Colormap) pCmap->mid == defMapID) return; /* install default */ dixLookupResourceByType((void **) &defMap, defMapID, RT_COLORMAP, serverClient, DixInstallAccess); if (defMap) (*pCmap->pScreen->InstallColormap) (defMap); else { /* uninstall and clear colormap pointer */ WalkTree(pCmap->pScreen, TellLostMap, (void *) &(pCmap->mid)); pScreenPriv->pInstalledmap = 0; } } int KdListInstalledColormaps(ScreenPtr pScreen, Colormap * pCmaps) { KdScreenPriv(pScreen); int n = 0; if (pScreenPriv->pInstalledmap) { *pCmaps++ = pScreenPriv->pInstalledmap->mid; n++; } return n; } /* * KdStoreColors * * This function is called whenever the server receives a request to store * color values into one or more entries in the currently installed X * colormap; it can be either the default colormap or a private colorscreen-> */ void KdStoreColors(ColormapPtr pCmap, int ndef, xColorItem * pdefs) { KdScreenPriv(pCmap->pScreen); VisualPtr pVisual; xColorItem expanddefs[KD_MAX_PSEUDO_SIZE]; if (pCmap != pScreenPriv->pInstalledmap) return; if (!pScreenPriv->card->cfuncs->putColors) return; if (pScreenPriv->screen->fb.depth > KD_MAX_PSEUDO_DEPTH) return; if (!pScreenPriv->enabled) return; /* Check for DirectColor or TrueColor being simulated on a PseudoColor device. */ pVisual = pCmap->pVisual; if ((pVisual->class | DynamicClass) == DirectColor) { /* * Expand DirectColor or TrueColor color values into a PseudoColor * format. Defer to the Color Framebuffer (CFB) code to do that. */ ndef = fbExpandDirectColors(pCmap, ndef, pdefs, expanddefs); pdefs = expanddefs; } (*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, ndef, pdefs); /* recolor hardware cursor */ if (pScreenPriv->card->cfuncs->recolorCursor) (*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, ndef, pdefs); } xorg-server-1.17.1/hw/kdrive/src/kxv.c0000664000175100017510000014043412432306326014465 00000000000000/* XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com) Adapted for KDrive by Pontus Lidman Copyright (C) 2000, 2001 - Nokia Home Communications Copyright (C) 1998, 1999 - 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, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. */ #ifdef HAVE_CONFIG_H #include #endif #include "kdrive.h" #include "scrnintstr.h" #include "regionstr.h" #include "windowstr.h" #include "pixmapstr.h" #include "mivalidate.h" #include "validate.h" #include "resource.h" #include "gcstruct.h" #include "dixstruct.h" #include #include #include "kxv.h" #include "fourcc.h" /* XvAdaptorRec fields */ static int KdXVPutVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int KdXVPutStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int KdXVGetVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int KdXVGetStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int KdXVStopVideo(XvPortPtr, DrawablePtr); static int KdXVSetPortAttribute(XvPortPtr, Atom, INT32); static int KdXVGetPortAttribute(XvPortPtr, Atom, INT32 *); static int KdXVQueryBestSize(XvPortPtr, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); static int KdXVPutImage(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); static int KdXVQueryImageAttributes(XvPortPtr, XvImagePtr, CARD16 *, CARD16 *, int *, int *); /* ScreenRec fields */ static Bool KdXVDestroyWindow(WindowPtr pWin); static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1); static void KdXVClipNotify(WindowPtr pWin, int dx, int dy); static Bool KdXVCloseScreen(ScreenPtr); /* misc */ static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr, int); static DevPrivateKeyRec KdXVWindowKeyRec; #define KdXVWindowKey (&KdXVWindowKeyRec) static DevPrivateKey KdXvScreenKey; static DevPrivateKeyRec KdXVScreenPrivateKey; static unsigned long KdXVGeneration = 0; static unsigned long PortResource = 0; #define GET_XV_SCREEN(pScreen) ((XvScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, KdXvScreenKey)) #define GET_KDXV_SCREEN(pScreen) \ ((KdXVScreenPtr)(dixGetPrivate(&pScreen->devPrivates, &KdXVScreenPrivateKey))) #define GET_KDXV_WINDOW(pWin) ((KdXVWindowPtr) \ dixLookupPrivate(&(pWin)->devPrivates, KdXVWindowKey)) KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen) { return calloc(1, sizeof(KdVideoAdaptorRec)); } void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr) { free(ptr); } Bool KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) { KdXVScreenPtr ScreenPriv; /* fprintf(stderr,"KdXVScreenInit initializing %d adaptors\n",num); */ if (KdXVGeneration != serverGeneration) KdXVGeneration = serverGeneration; if (noXvExtension) return FALSE; if (!dixRegisterPrivateKey(&KdXVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; if (!dixRegisterPrivateKey(&KdXVScreenPrivateKey, PRIVATE_SCREEN, 0)) return FALSE; if (Success != XvScreenInit(pScreen)) return FALSE; KdXvScreenKey = XvGetScreenKey(); PortResource = XvGetRTPort(); ScreenPriv = malloc(sizeof(KdXVScreenRec)); dixSetPrivate(&pScreen->devPrivates, &KdXVScreenPrivateKey, ScreenPriv); if (!ScreenPriv) return FALSE; ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; ScreenPriv->ClipNotify = pScreen->ClipNotify; ScreenPriv->CloseScreen = pScreen->CloseScreen; /* fprintf(stderr,"XV: Wrapping screen funcs\n"); */ pScreen->DestroyWindow = KdXVDestroyWindow; pScreen->WindowExposures = KdXVWindowExposures; pScreen->ClipNotify = KdXVClipNotify; pScreen->CloseScreen = KdXVCloseScreen; if (!KdXVInitAdaptors(pScreen, adaptors, num)) return FALSE; return TRUE; } static void KdXVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; if (pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; XvPortRecPrivatePtr pPriv; for (i = 0; i < pAdaptor->nPorts; i++, pPort++) { pPriv = (XvPortRecPrivatePtr) pPort->devPriv.ptr; if (pPriv) { if (pPriv->clientClip) RegionDestroy(pPriv->clientClip); if (pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); free(pPriv); } } } XvFreeAdaptor(pAdaptor); } static Bool KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr infoPtr, int number) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); KdVideoAdaptorPtr adaptorPtr; XvAdaptorPtr pAdaptor, pa; XvAdaptorRecPrivatePtr adaptorPriv; int na, numAdaptor; XvPortRecPrivatePtr portPriv; XvPortPtr pPort, pp; int numPort; KdVideoFormatPtr formatPtr; XvFormatPtr pFormat, pf; int numFormat, totFormat; KdVideoEncodingPtr encodingPtr; XvEncodingPtr pEncode, pe; int numVisuals; VisualPtr pVisual; int i; pxvs->nAdaptors = 0; pxvs->pAdaptors = NULL; if (!(pAdaptor = calloc(number, sizeof(XvAdaptorRec)))) return FALSE; for (pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) { adaptorPtr = &infoPtr[na]; if (!adaptorPtr->StopVideo || !adaptorPtr->SetPortAttribute || !adaptorPtr->GetPortAttribute || !adaptorPtr->QueryBestSize) continue; /* client libs expect at least one encoding */ if (!adaptorPtr->nEncodings || !adaptorPtr->pEncodings) continue; pa->type = adaptorPtr->type; if (!adaptorPtr->PutVideo && !adaptorPtr->GetVideo) pa->type &= ~XvVideoMask; if (!adaptorPtr->PutStill && !adaptorPtr->GetStill) pa->type &= ~XvStillMask; if (!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes) pa->type &= ~XvImageMask; if (!adaptorPtr->PutVideo && !adaptorPtr->PutImage && !adaptorPtr->PutStill) pa->type &= ~XvInputMask; if (!adaptorPtr->GetVideo && !adaptorPtr->GetStill) pa->type &= ~XvOutputMask; if (!(adaptorPtr->type & (XvPixmapMask | XvWindowMask))) continue; if (!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask))) continue; pa->pScreen = pScreen; pa->ddPutVideo = KdXVPutVideo; pa->ddPutStill = KdXVPutStill; pa->ddGetVideo = KdXVGetVideo; pa->ddGetStill = KdXVGetStill; pa->ddStopVideo = KdXVStopVideo; pa->ddPutImage = KdXVPutImage; pa->ddSetPortAttribute = KdXVSetPortAttribute; pa->ddGetPortAttribute = KdXVGetPortAttribute; pa->ddQueryBestSize = KdXVQueryBestSize; pa->ddQueryImageAttributes = KdXVQueryImageAttributes; pa->name = strdup(adaptorPtr->name); if (adaptorPtr->nEncodings && (pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) { for (pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0; i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++) { pe->id = encodingPtr->id; pe->pScreen = pScreen; pe->name = strdup(encodingPtr->name); pe->width = encodingPtr->width; pe->height = encodingPtr->height; pe->rate.numerator = encodingPtr->rate.numerator; pe->rate.denominator = encodingPtr->rate.denominator; } pa->nEncodings = adaptorPtr->nEncodings; pa->pEncodings = pEncode; } if (adaptorPtr->nImages && (pa->pImages = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { memcpy(pa->pImages, adaptorPtr->pImages, adaptorPtr->nImages * sizeof(XvImageRec)); pa->nImages = adaptorPtr->nImages; } if (adaptorPtr->nAttributes && (pa->pAttributes = calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { memcpy(pa->pAttributes, adaptorPtr->pAttributes, adaptorPtr->nAttributes * sizeof(XvAttributeRec)); for (i = 0; i < adaptorPtr->nAttributes; i++) { pa->pAttributes[i].name = strdup(adaptorPtr->pAttributes[i].name); } pa->nAttributes = adaptorPtr->nAttributes; } totFormat = adaptorPtr->nFormats; if (!(pFormat = calloc(totFormat, sizeof(XvFormatRec)))) { KdXVFreeAdaptor(pa); continue; } for (pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats; i < adaptorPtr->nFormats; i++, formatPtr++) { numVisuals = pScreen->numVisuals; pVisual = pScreen->visuals; while (numVisuals--) { if ((pVisual->class == formatPtr->class) && (pVisual->nplanes == formatPtr->depth)) { if (numFormat >= totFormat) { void *moreSpace; totFormat *= 2; moreSpace = realloc(pFormat, totFormat * sizeof(XvFormatRec)); if (!moreSpace) break; pFormat = moreSpace; pf = pFormat + numFormat; } pf->visual = pVisual->vid; pf->depth = formatPtr->depth; pf++; numFormat++; } pVisual++; } } pa->nFormats = numFormat; pa->pFormats = pFormat; if (!numFormat) { KdXVFreeAdaptor(pa); continue; } if (!(adaptorPriv = calloc(1, sizeof(XvAdaptorRecPrivate)))) { KdXVFreeAdaptor(pa); continue; } adaptorPriv->flags = adaptorPtr->flags; adaptorPriv->PutVideo = adaptorPtr->PutVideo; adaptorPriv->PutStill = adaptorPtr->PutStill; adaptorPriv->GetVideo = adaptorPtr->GetVideo; adaptorPriv->GetStill = adaptorPtr->GetStill; adaptorPriv->StopVideo = adaptorPtr->StopVideo; adaptorPriv->SetPortAttribute = adaptorPtr->SetPortAttribute; adaptorPriv->GetPortAttribute = adaptorPtr->GetPortAttribute; adaptorPriv->QueryBestSize = adaptorPtr->QueryBestSize; adaptorPriv->QueryImageAttributes = adaptorPtr->QueryImageAttributes; adaptorPriv->PutImage = adaptorPtr->PutImage; adaptorPriv->ReputImage = adaptorPtr->ReputImage; pa->devPriv.ptr = (void *) adaptorPriv; if (!(pPort = calloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { KdXVFreeAdaptor(pa); continue; } for (pp = pPort, i = 0, numPort = 0; i < adaptorPtr->nPorts; i++) { if (!(pp->id = FakeClientID(0))) continue; if (!(portPriv = calloc(1, sizeof(XvPortRecPrivate)))) continue; if (!AddResource(pp->id, PortResource, pp)) { free(portPriv); continue; } pp->pAdaptor = pa; pp->pNotify = (XvPortNotifyPtr) NULL; pp->pDraw = (DrawablePtr) NULL; pp->client = (ClientPtr) NULL; pp->grab.client = (ClientPtr) NULL; pp->time = currentTime; pp->devPriv.ptr = portPriv; portPriv->screen = screen; portPriv->AdaptorRec = adaptorPriv; portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr; pp++; numPort++; } pa->nPorts = numPort; pa->pPorts = pPort; if (!numPort) { KdXVFreeAdaptor(pa); continue; } pa->base_id = pPort->id; pa++; numAdaptor++; } if (numAdaptor) { pxvs->nAdaptors = numAdaptor; pxvs->pAdaptors = pAdaptor; } else { free(pAdaptor); return FALSE; } return TRUE; } /* Video should be clipped to the intersection of the window cliplist and the client cliplist specified in the GC for which the video was initialized. When we need to reclip a window, the GC that started the video may not even be around anymore. That's why we save the client clip from the GC when the video is initialized. We then use KdXVUpdateCompositeClip to calculate the new composite clip when we need it. This is different from what DEC did. They saved the GC and used it's clip list when they needed to reclip the window, even if the client clip was different from the one the video was initialized with. If the original GC was destroyed, they had to stop the video. I like the new method better (MArk). This function only works for windows. Will need to rewrite when (if) we support pixmap rendering. */ static void KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) { RegionPtr pregWin, pCompositeClip; WindowPtr pWin; Bool freeCompClip = FALSE; if (portPriv->pCompositeClip) return; pWin = (WindowPtr) portPriv->pDraw; /* get window clip list */ if (portPriv->subWindowMode == IncludeInferiors) { pregWin = NotClippedByChildren(pWin); freeCompClip = TRUE; } else pregWin = &pWin->clipList; if (!portPriv->clientClip) { portPriv->pCompositeClip = pregWin; portPriv->FreeCompositeClip = freeCompClip; return; } pCompositeClip = RegionCreate(NullBox, 1); RegionCopy(pCompositeClip, portPriv->clientClip); RegionTranslate(pCompositeClip, portPriv->pDraw->x + portPriv->clipOrg.x, portPriv->pDraw->y + portPriv->clipOrg.y); RegionIntersect(pCompositeClip, pregWin, pCompositeClip); portPriv->pCompositeClip = pCompositeClip; portPriv->FreeCompositeClip = TRUE; if (freeCompClip) { RegionDestroy(pregWin); } } /* Save the current clientClip and update the CompositeClip whenever we have a fresh GC */ static void KdXVCopyClip(XvPortRecPrivatePtr portPriv, GCPtr pGC) { /* copy the new clip if it exists */ if (pGC->clientClip) { if (!portPriv->clientClip) portPriv->clientClip = RegionCreate(NullBox, 1); /* Note: this is in window coordinates */ RegionCopy(portPriv->clientClip, pGC->clientClip); } else if (portPriv->clientClip) { /* free the old clientClip */ RegionDestroy(portPriv->clientClip); portPriv->clientClip = NULL; } /* get rid of the old clip list */ if (portPriv->pCompositeClip && portPriv->FreeCompositeClip) { RegionDestroy(portPriv->pCompositeClip); } portPriv->clipOrg = pGC->clipOrg; portPriv->pCompositeClip = pGC->pCompositeClip; portPriv->FreeCompositeClip = FALSE; portPriv->subWindowMode = pGC->subWindowMode; } static int KdXVRegetVideo(XvPortRecPrivatePtr portPriv) { RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; KdXVUpdateCompositeClip(portPriv); /* translate the video region to the screen */ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x; WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ RegionInit(&WinRegion, &WinBox, 1); RegionInit(&ClipRegion, NullBox, 1); RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* that's all if it's totally obscured */ if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } ret = (*portPriv->AdaptorRec->GetVideo) (portPriv->screen, portPriv->pDraw, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, portPriv->vid_w, portPriv->vid_h, portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr); if (ret == Success) portPriv->isOn = XV_ON; CLIP_VIDEO_BAILOUT: if ((clippedAway || (ret != Success)) && portPriv->isOn == XV_ON) { (*portPriv->AdaptorRec->StopVideo) (portPriv->screen, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int KdXVReputVideo(XvPortRecPrivatePtr portPriv) { RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; ScreenPtr pScreen = portPriv->pDraw->pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; int ret = Success; Bool clippedAway = FALSE; KdXVUpdateCompositeClip(portPriv); /* translate the video region to the screen */ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x; WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ RegionInit(&WinRegion, &WinBox, 1); RegionInit(&ClipRegion, NullBox, 1); RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = 0; VPBox.y1 = 0; VPBox.x2 = screen->width; VPBox.y2 = screen->height; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } /* that's all if it's totally obscured */ if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } ret = (*portPriv->AdaptorRec->PutVideo) (portPriv->screen, portPriv->pDraw, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, portPriv->vid_w, portPriv->vid_h, portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr); if (ret == Success) portPriv->isOn = XV_ON; CLIP_VIDEO_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->screen, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int KdXVReputImage(XvPortRecPrivatePtr portPriv) { RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; ScreenPtr pScreen = portPriv->pDraw->pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; int ret = Success; Bool clippedAway = FALSE; KdXVUpdateCompositeClip(portPriv); /* translate the video region to the screen */ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x; WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ RegionInit(&WinRegion, &WinBox, 1); RegionInit(&ClipRegion, NullBox, 1); RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = 0; VPBox.y1 = 0; VPBox.x2 = screen->width; VPBox.y2 = screen->height; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } /* that's all if it's totally obscured */ if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } ret = (*portPriv->AdaptorRec->ReputImage) (portPriv->screen, portPriv->pDraw, WinBox.x1, WinBox.y1, &ClipRegion, portPriv->DevPriv.ptr); portPriv->isOn = (ret == Success) ? XV_ON : XV_OFF; CLIP_VIDEO_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->screen, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } /* This clip was copied and only good for one shot */ if (!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int KdXVReputAllVideo(WindowPtr pWin, void *data) { KdXVWindowPtr WinPriv; if (pWin->drawable.type != DRAWABLE_WINDOW) return WT_DONTWALKCHILDREN; WinPriv = GET_KDXV_WINDOW(pWin); while (WinPriv) { if (WinPriv->PortRec->type == XvInputMask) KdXVReputVideo(WinPriv->PortRec); else KdXVRegetVideo(WinPriv->PortRec); WinPriv = WinPriv->next; } return WT_WALKCHILDREN; } static int KdXVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { KdXVWindowPtr winPriv, PrivRoot; winPriv = PrivRoot = GET_KDXV_WINDOW(pWin); /* Enlist our port in the window private */ while (winPriv) { if (winPriv->PortRec == portPriv) /* we're already listed */ break; winPriv = winPriv->next; } if (!winPriv) { winPriv = malloc(sizeof(KdXVWindowRec)); if (!winPriv) return BadAlloc; winPriv->PortRec = portPriv; winPriv->next = PrivRoot; dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, winPriv); } return Success; } static void KdXVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { KdXVWindowPtr winPriv, prevPriv = NULL; winPriv = GET_KDXV_WINDOW(pWin); while (winPriv) { if (winPriv->PortRec == portPriv) { if (prevPriv) prevPriv->next = winPriv->next; else dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, winPriv->next); free(winPriv); break; } prevPriv = winPriv; winPriv = winPriv->next; } portPriv->pDraw = NULL; } /**** ScreenRec fields ****/ static Bool KdXVDestroyWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); KdXVWindowPtr tmp, WinPriv = GET_KDXV_WINDOW(pWin); int ret; while (WinPriv) { XvPortRecPrivatePtr pPriv = WinPriv->PortRec; if (pPriv->isOn > XV_OFF) { (*pPriv->AdaptorRec->StopVideo) (pPriv->screen, pPriv->DevPriv.ptr, TRUE); pPriv->isOn = XV_OFF; } pPriv->pDraw = NULL; tmp = WinPriv; WinPriv = WinPriv->next; free(tmp); } dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, NULL); pScreen->DestroyWindow = ScreenPriv->DestroyWindow; ret = (*pScreen->DestroyWindow) (pWin); pScreen->DestroyWindow = KdXVDestroyWindow; return ret; } static void KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1) { ScreenPtr pScreen = pWin->drawable.pScreen; KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); KdXVWindowPtr WinPriv = GET_KDXV_WINDOW(pWin); KdXVWindowPtr pPrev; XvPortRecPrivatePtr pPriv; Bool AreasExposed; AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1)); pScreen->WindowExposures = ScreenPriv->WindowExposures; (*pScreen->WindowExposures) (pWin, reg1); pScreen->WindowExposures = KdXVWindowExposures; /* filter out XClearWindow/Area */ if (!pWin->valdata) return; pPrev = NULL; while (WinPriv) { pPriv = WinPriv->PortRec; /* Reput anyone with a reput function */ switch (pPriv->type) { case XvInputMask: KdXVReputVideo(pPriv); break; case XvOutputMask: KdXVRegetVideo(pPriv); break; default: /* overlaid still/image */ if (pPriv->AdaptorRec->ReputImage) KdXVReputImage(pPriv); else if (AreasExposed) { KdXVWindowPtr tmp; if (pPriv->isOn == XV_ON) { (*pPriv->AdaptorRec->StopVideo) (pPriv->screen, pPriv->DevPriv.ptr, FALSE); pPriv->isOn = XV_PENDING; } pPriv->pDraw = NULL; if (!pPrev) dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, WinPriv->next); else pPrev->next = WinPriv->next; tmp = WinPriv; WinPriv = WinPriv->next; free(tmp); continue; } break; } pPrev = WinPriv; WinPriv = WinPriv->next; } } static void KdXVClipNotify(WindowPtr pWin, int dx, int dy) { ScreenPtr pScreen = pWin->drawable.pScreen; KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); KdXVWindowPtr WinPriv = GET_KDXV_WINDOW(pWin); KdXVWindowPtr tmp, pPrev = NULL; XvPortRecPrivatePtr pPriv; Bool visible = (pWin->visibility == VisibilityUnobscured) || (pWin->visibility == VisibilityPartiallyObscured); while (WinPriv) { pPriv = WinPriv->PortRec; if (pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; /* Stop everything except images, but stop them too if the window isn't visible. But we only remove the images. */ if (pPriv->type || !visible) { if (pPriv->isOn == XV_ON) { (*pPriv->AdaptorRec->StopVideo) (pPriv->screen, pPriv->DevPriv.ptr, FALSE); pPriv->isOn = XV_PENDING; } if (!pPriv->type) { /* overlaid still/image */ pPriv->pDraw = NULL; if (!pPrev) dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, WinPriv->next); else pPrev->next = WinPriv->next; tmp = WinPriv; WinPriv = WinPriv->next; free(tmp); continue; } } pPrev = WinPriv; WinPriv = WinPriv->next; } if (ScreenPriv->ClipNotify) { pScreen->ClipNotify = ScreenPriv->ClipNotify; (*pScreen->ClipNotify) (pWin, dx, dy); pScreen->ClipNotify = KdXVClipNotify; } } /**** Required XvScreenRec fields ****/ static Bool KdXVCloseScreen(ScreenPtr pScreen) { XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); XvAdaptorPtr pa; int c; if (!ScreenPriv) return TRUE; pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; pScreen->CloseScreen = ScreenPriv->CloseScreen; /* fprintf(stderr,"XV: Unwrapping screen funcs\n"); */ for (c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) { KdXVFreeAdaptor(pa); } free(pxvs->pAdaptors); free(ScreenPriv); return pScreen->CloseScreen(pScreen); } static Bool KdXVRunning(ScreenPtr pScreen) { return (KdXVGeneration == serverGeneration && GET_XV_SCREEN(pScreen) != 0); } Bool KdXVEnable(ScreenPtr pScreen) { if (!KdXVRunning(pScreen)) return TRUE; WalkTree(pScreen, KdXVReputAllVideo, 0); return TRUE; } void KdXVDisable(ScreenPtr pScreen) { XvScreenPtr pxvs; XvAdaptorPtr pAdaptor; XvPortPtr pPort; XvPortRecPrivatePtr pPriv; int i, j; if (!KdXVRunning(pScreen)) return; pxvs = GET_XV_SCREEN(pScreen); for (i = 0; i < pxvs->nAdaptors; i++) { pAdaptor = &pxvs->pAdaptors[i]; for (j = 0; j < pAdaptor->nPorts; j++) { pPort = &pAdaptor->pPorts[j]; pPriv = (XvPortRecPrivatePtr) pPort->devPriv.ptr; if (pPriv->isOn > XV_OFF) { (*pPriv->AdaptorRec->StopVideo) (pPriv->screen, pPriv->DevPriv.ptr, TRUE); pPriv->isOn = XV_OFF; if (pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; if (!pPriv->type && pPriv->pDraw) { /* still */ KdXVRemovePortFromWindow((WindowPtr) pPriv->pDraw, pPriv); } } } } } /**** XvAdaptorRec fields ****/ static int KdXVPutVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); KdScreenPriv(portPriv->screen->pScreen); int result; /* No dumping video to pixmaps... For now anyhow */ if (pDraw->type != DRAWABLE_WINDOW) { pPort->pDraw = (DrawablePtr) NULL; return BadAlloc; } /* If we are changing windows, unregister our port in the old window */ if (portPriv->pDraw && (portPriv->pDraw != pDraw)) KdXVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); /* Register our port with the new window */ result = KdXVEnlistPortInWindow((WindowPtr) pDraw, portPriv); if (result != Success) return result; portPriv->pDraw = pDraw; portPriv->type = XvInputMask; /* save a copy of these parameters */ portPriv->vid_x = vid_x; portPriv->vid_y = vid_y; portPriv->vid_w = vid_w; portPriv->vid_h = vid_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; /* make sure we have the most recent copy of the clientClip */ KdXVCopyClip(portPriv, pGC); /* To indicate to the DI layer that we were successful */ pPort->pDraw = pDraw; if (!pScreenPriv->enabled) return Success; return (KdXVReputVideo(portPriv)); } static int KdXVPutStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); ScreenPtr pScreen = pDraw->pScreen; KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; if (!pScreenPriv->enabled) return Success; WinBox.x1 = pDraw->x + drw_x; WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; RegionInit(&WinRegion, &WinBox, 1); RegionInit(&ClipRegion, NullBox, 1); RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = 0; VPBox.y1 = 0; VPBox.x2 = screen->width; VPBox.y2 = screen->height; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } if (portPriv->pDraw) { KdXVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); } if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_STILL_BAILOUT; } ret = (*portPriv->AdaptorRec->PutStill) (portPriv->screen, pDraw, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, &ClipRegion, portPriv->DevPriv.ptr); if ((ret == Success) && (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_STILLS)) { KdXVEnlistPortInWindow((WindowPtr) pDraw, portPriv); portPriv->isOn = XV_ON; portPriv->pDraw = pDraw; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should not be reput once it's removed */ pPort->pDraw = pDraw; /* make sure we can get stop requests */ } PUT_STILL_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->screen, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int KdXVGetVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); int result; KdScreenPriv(portPriv->screen->pScreen); /* No pixmaps... For now anyhow */ if (pDraw->type != DRAWABLE_WINDOW) { pPort->pDraw = (DrawablePtr) NULL; return BadAlloc; } /* If we are changing windows, unregister our port in the old window */ if (portPriv->pDraw && (portPriv->pDraw != pDraw)) KdXVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); /* Register our port with the new window */ result = KdXVEnlistPortInWindow((WindowPtr) pDraw, portPriv); if (result != Success) return result; portPriv->pDraw = pDraw; portPriv->type = XvOutputMask; /* save a copy of these parameters */ portPriv->vid_x = vid_x; portPriv->vid_y = vid_y; portPriv->vid_w = vid_w; portPriv->vid_h = vid_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; /* make sure we have the most recent copy of the clientClip */ KdXVCopyClip(portPriv, pGC); /* To indicate to the DI layer that we were successful */ pPort->pDraw = pDraw; if (!pScreenPriv->enabled) return Success; return (KdXVRegetVideo(portPriv)); } static int KdXVGetStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); ScreenPtr pScreen = pDraw->pScreen; KdScreenPriv(pScreen); RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; if (!pScreenPriv->enabled) return Success; WinBox.x1 = pDraw->x + drw_x; WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; RegionInit(&WinRegion, &WinBox, 1); RegionInit(&ClipRegion, NullBox, 1); RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if (portPriv->pDraw) { KdXVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); } if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto GET_STILL_BAILOUT; } ret = (*portPriv->AdaptorRec->GetStill) (portPriv->screen, pDraw, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, &ClipRegion, portPriv->DevPriv.ptr); GET_STILL_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->screen, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int KdXVStopVideo(XvPortPtr pPort, DrawablePtr pDraw) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); KdScreenPriv(portPriv->screen->pScreen); if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; KdXVRemovePortFromWindow((WindowPtr) pDraw, portPriv); if (!pScreenPriv->enabled) return Success; /* Must free resources. */ if (portPriv->isOn > XV_OFF) { (*portPriv->AdaptorRec->StopVideo) (portPriv->screen, portPriv->DevPriv.ptr, TRUE); portPriv->isOn = XV_OFF; } return Success; } static int KdXVSetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); return ((*portPriv->AdaptorRec->SetPortAttribute) (portPriv->screen, attribute, value, portPriv->DevPriv.ptr)); } static int KdXVGetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 *p_value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); return ((*portPriv->AdaptorRec->GetPortAttribute) (portPriv->screen, attribute, (int *) p_value, portPriv->DevPriv.ptr)); } static int KdXVQueryBestSize(XvPortPtr pPort, CARD8 motion, CARD16 vid_w, CARD16 vid_h, CARD16 drw_w, CARD16 drw_h, unsigned int *p_w, unsigned int *p_h) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); (*portPriv->AdaptorRec->QueryBestSize) (portPriv->screen, (Bool) motion, vid_w, vid_h, drw_w, drw_h, p_w, p_h, portPriv->DevPriv.ptr); return Success; } static int KdXVPutImage(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 src_x, INT16 src_y, CARD16 src_w, CARD16 src_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h, XvImagePtr format, unsigned char *data, Bool sync, CARD16 width, CARD16 height) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); ScreenPtr pScreen = pDraw->pScreen; KdScreenPriv(pScreen); RegionRec WinRegion; RegionRec ClipRegion; BoxRec WinBox; int ret = Success; Bool clippedAway = FALSE; if (pDraw->type != DRAWABLE_WINDOW) return BadAlloc; if (!pScreenPriv->enabled) return Success; WinBox.x1 = pDraw->x + drw_x; WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; RegionInit(&WinRegion, &WinBox, 1); RegionInit(&ClipRegion, NullBox, 1); RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if (portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; VPBox.x1 = 0; VPBox.y1 = 0; VPBox.x2 = pScreen->width; VPBox.y2 = pScreen->height; RegionInit(&VPReg, &VPBox, 1); RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); RegionUninit(&VPReg); } if (portPriv->pDraw) { KdXVRemovePortFromWindow((WindowPtr) (portPriv->pDraw), portPriv); } if (!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_IMAGE_BAILOUT; } ret = (*portPriv->AdaptorRec->PutImage) (portPriv->screen, pDraw, src_x, src_y, WinBox.x1, WinBox.y1, src_w, src_h, drw_w, drw_h, format->id, data, width, height, sync, &ClipRegion, portPriv->DevPriv.ptr); if ((ret == Success) && (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) { KdXVEnlistPortInWindow((WindowPtr) pDraw, portPriv); portPriv->isOn = XV_ON; portPriv->pDraw = pDraw; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should not be reput once it's removed */ pPort->pDraw = pDraw; /* make sure we can get stop requests */ } PUT_IMAGE_BAILOUT: if ((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { (*portPriv->AdaptorRec->StopVideo) (portPriv->screen, portPriv->DevPriv.ptr, FALSE); portPriv->isOn = XV_PENDING; } RegionUninit(&WinRegion); RegionUninit(&ClipRegion); return ret; } static int KdXVQueryImageAttributes(XvPortPtr pPort, XvImagePtr format, CARD16 *width, CARD16 *height, int *pitches, int *offsets) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); return (*portPriv->AdaptorRec->QueryImageAttributes) (portPriv->screen, format->id, width, height, pitches, offsets); } /**************** Common video manipulation functions *******************/ void KdXVCopyPackedData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, int srcPitch, int dstPitch, int srcW, int srcH, int top, int left, int h, int w) { int srcDown = srcPitch, srcRight = 2, srcNext; int p; switch (randr & RR_Rotate_All) { case RR_Rotate_0: srcDown = srcPitch; srcRight = 2; break; case RR_Rotate_90: src += (srcH - 1) * 2; srcDown = -2; srcRight = srcPitch; break; case RR_Rotate_180: src += srcPitch * (srcH - 1) + (srcW - 1) * 2; srcDown = -srcPitch; srcRight = -2; break; case RR_Rotate_270: src += srcPitch * (srcW - 1); srcDown = 2; srcRight = -srcPitch; break; } src = src + top * srcDown + left * srcRight; w >>= 1; /* srcRight >>= 1; */ srcNext = srcRight >> 1; while (h--) { CARD16 *s = (CARD16 *) src; CARD32 *d = (CARD32 *) dst; p = w; while (p--) { *d++ = s[0] | (s[srcNext] << 16); s += srcRight; } src += srcPitch; dst += dstPitch; } } void KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, int srcPitch, int srcPitch2, int dstPitch, int srcW, int srcH, int height, int top, int left, int h, int w, int id) { int i, j; CARD8 *src1, *src2, *src3, *dst1; int srcDown = srcPitch, srcDown2 = srcPitch2; int srcRight = 2, srcRight2 = 1, srcNext = 1; /* compute source data pointers */ src1 = src; src2 = src1 + height * srcPitch; src3 = src2 + (height >> 1) * srcPitch2; switch (randr & RR_Rotate_All) { case RR_Rotate_0: srcDown = srcPitch; srcDown2 = srcPitch2; srcRight = 2; srcRight2 = 1; srcNext = 1; break; case RR_Rotate_90: src1 = src1 + srcH - 1; src2 = src2 + (srcH >> 1) - 1; src3 = src3 + (srcH >> 1) - 1; srcDown = -1; srcDown2 = -1; srcRight = srcPitch * 2; srcRight2 = srcPitch2; srcNext = srcPitch; break; case RR_Rotate_180: src1 = src1 + srcPitch * (srcH - 1) + (srcW - 1); src2 = src2 + srcPitch2 * ((srcH >> 1) - 1) + ((srcW >> 1) - 1); src3 = src3 + srcPitch2 * ((srcH >> 1) - 1) + ((srcW >> 1) - 1); srcDown = -srcPitch; srcDown2 = -srcPitch2; srcRight = -2; srcRight2 = -1; srcNext = -1; break; case RR_Rotate_270: src1 = src1 + srcPitch * (srcW - 1); src2 = src2 + srcPitch2 * ((srcW >> 1) - 1); src3 = src3 + srcPitch2 * ((srcW >> 1) - 1); srcDown = 1; srcDown2 = 1; srcRight = -srcPitch * 2; srcRight2 = -srcPitch2; srcNext = -srcPitch; break; } /* adjust for origin */ src1 += top * srcDown + left * srcNext; src2 += (top >> 1) * srcDown2 + (left >> 1) * srcRight2; src3 += (top >> 1) * srcDown2 + (left >> 1) * srcRight2; if (id == FOURCC_I420) { CARD8 *srct = src2; src2 = src3; src3 = srct; } dst1 = dst; w >>= 1; for (j = 0; j < h; j++) { CARD32 *dst32 = (CARD32 *) dst1; CARD8 *s1l = src1; CARD8 *s1r = src1 + srcNext; CARD8 *s2 = src2; CARD8 *s3 = src3; for (i = 0; i < w; i++) { *dst32++ = *s1l | (*s1r << 16) | (*s3 << 8) | (*s2 << 24); s1l += srcRight; s1r += srcRight; s2 += srcRight2; s3 += srcRight2; } src1 += srcDown; dst1 += dstPitch; if (j & 1) { src2 += srcDown2; src3 += srcDown2; } } } xorg-server-1.17.1/hw/kdrive/src/kshadow.c0000664000175100017510000000511712366220413015311 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include "kdrive.h" Bool KdShadowFbAlloc(KdScreenInfo * screen, Bool rotate) { int paddedWidth; void *buf; int width = rotate ? screen->height : screen->width; int height = rotate ? screen->width : screen->height; int bpp = screen->fb.bitsPerPixel; /* use fb computation for width */ paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); buf = malloc(paddedWidth * height); if (!buf) return FALSE; if (screen->fb.shadow) free(screen->fb.frameBuffer); screen->fb.shadow = TRUE; screen->fb.frameBuffer = buf; screen->fb.byteStride = paddedWidth; screen->fb.pixelStride = paddedWidth * 8 / bpp; return TRUE; } void KdShadowFbFree(KdScreenInfo * screen) { if (screen->fb.shadow) { free(screen->fb.frameBuffer); screen->fb.frameBuffer = 0; screen->fb.shadow = FALSE; } } Bool KdShadowSet(ScreenPtr pScreen, int randr, ShadowUpdateProc update, ShadowWindowProc window) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); if (screen->fb.shadow) { return shadowAdd(pScreen, pScreen->GetScreenPixmap(pScreen), update, window, randr, 0); } return TRUE; } void KdShadowUnset(ScreenPtr pScreen) { shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); } xorg-server-1.17.1/hw/kdrive/src/kinfo.c0000664000175100017510000000674312366220413014765 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include "kdrive.h" KdCardInfo *kdCardInfo; KdCardInfo * KdCardInfoAdd(KdCardFuncs * funcs, void *closure) { KdCardInfo *ci, **prev; ci = calloc(1, sizeof(KdCardInfo)); if (!ci) return 0; for (prev = &kdCardInfo; *prev; prev = &(*prev)->next); *prev = ci; ci->cfuncs = funcs; ci->closure = closure; ci->screenList = 0; ci->selected = 0; ci->next = 0; return ci; } KdCardInfo * KdCardInfoLast(void) { KdCardInfo *ci; if (!kdCardInfo) return 0; for (ci = kdCardInfo; ci->next; ci = ci->next); return ci; } void KdCardInfoDispose(KdCardInfo * ci) { KdCardInfo **prev; for (prev = &kdCardInfo; *prev; prev = &(*prev)->next) if (*prev == ci) { *prev = ci->next; free(ci); break; } } KdScreenInfo * KdScreenInfoAdd(KdCardInfo * ci) { KdScreenInfo *si, **prev; int n; si = calloc(1, sizeof(KdScreenInfo)); if (!si) return 0; for (prev = &ci->screenList, n = 0; *prev; prev = &(*prev)->next, n++); *prev = si; si->next = 0; si->card = ci; si->mynum = n; return si; } void KdScreenInfoDispose(KdScreenInfo * si) { KdCardInfo *ci = si->card; KdScreenInfo **prev; for (prev = &ci->screenList; *prev; prev = &(*prev)->next) { if (*prev == si) { *prev = si->next; free(si); if (!ci->screenList) KdCardInfoDispose(ci); break; } } } KdPointerInfo * KdNewPointer(void) { KdPointerInfo *pi; int i; pi = (KdPointerInfo *) calloc(1, sizeof(KdPointerInfo)); if (!pi) return NULL; pi->name = strdup("Generic Pointer"); pi->path = NULL; pi->inputClass = KD_MOUSE; pi->driver = NULL; pi->driverPrivate = NULL; pi->next = NULL; pi->options = NULL; pi->nAxes = 3; pi->nButtons = KD_MAX_BUTTON; for (i = 1; i < KD_MAX_BUTTON; i++) pi->map[i] = i; return pi; } void KdFreePointer(KdPointerInfo * pi) { free(pi->name); free(pi->path); input_option_free_list(&pi->options); free(pi); } void KdFreeKeyboard(KdKeyboardInfo * ki) { free(ki->name); free(ki->path); free(ki->xkbRules); free(ki->xkbModel); free(ki->xkbLayout); ki->next = NULL; free(ki); } xorg-server-1.17.1/hw/kdrive/src/Makefile.in0000664000175100017510000006504412466505431015566 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/kdrive/src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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) libkdrive_la_LIBADD = am__libkdrive_la_SOURCES_DIST = fourcc.h kcmap.c kdrive.c kdrive.h \ kinfo.c kinput.c kmode.c kshadow.c kxv.c kxv.h \ $(top_srcdir)/mi/miinitext.c @XV_TRUE@am__objects_1 = kxv.lo am_libkdrive_la_OBJECTS = kcmap.lo kdrive.lo kinfo.lo kinput.lo \ kmode.lo kshadow.lo $(am__objects_1) miinitext.lo libkdrive_la_OBJECTS = $(am_libkdrive_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 = $(libkdrive_la_SOURCES) DIST_SOURCES = $(am__libkdrive_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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H noinst_LTLIBRARIES = libkdrive.la @XV_TRUE@KDRIVE_XV_SOURCES = \ @XV_TRUE@ kxv.c \ @XV_TRUE@ kxv.h libkdrive_la_SOURCES = \ fourcc.h \ kcmap.c \ kdrive.c \ kdrive.h \ kinfo.c \ kinput.c \ kmode.c \ kshadow.c \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/kdrive/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/kdrive/src/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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}; \ } libkdrive.la: $(libkdrive_la_OBJECTS) $(libkdrive_la_DEPENDENCIES) $(EXTRA_libkdrive_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libkdrive_la_OBJECTS) $(libkdrive_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kdrive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kshadow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kxv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.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 -o $@ $< .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 -o $@ `$(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 $@ $< miinitext.lo: $(top_srcdir)/mi/miinitext.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) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.lo -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/mi/miinitext.c' object='miinitext.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) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ 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 TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am 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 tags-am 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: xorg-server-1.17.1/hw/kdrive/src/kmode.c0000664000175100017510000002757612366220413014765 00000000000000/* * Copyright 1999 SuSE, 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 SuSE not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. SuSE makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * 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. * * Author: Keith Packard, SuSE, Inc. */ #ifdef HAVE_CONFIG_H #include #endif #include "kdrive.h" const KdMonitorTiming kdMonitorTimings[] = { /* H V Hz KHz */ /* FP BP BLANK POLARITY */ /* IPAQ modeline: * * Modeline "320x240" 5.7222 320 337 340 352 240 241 244 254" */ {320, 240, 64, 16256, 17, 12, 32, KdSyncNegative, 1, 11, 14, KdSyncNegative, }, /* Other VESA modes */ {640, 350, 85, 31500, /* VESA */ 32, 96, 192, KdSyncPositive, /* 26.413 */ 32, 60, 95, KdSyncNegative, /* 59.354 */ }, {640, 400, 60, 31500, /* VESA */ 32, 96, 192, KdSyncNegative, /* 26.413 */ 1, 41, 45, KdSyncPositive, /* 59.354 */ }, {720, 400, 85, 35500, /* VESA */ 36, 108, 216, KdSyncNegative, /* 37.927 */ 1, 42, 46, KdSyncPositive, /* 85.039 */ }, /* Modeline "720x576" 29.000 720 736 800 880 576 577 580 625 */ { 720, 576, 52, 32954, /* PAL Video */ 16, 80, 160, KdSyncPositive, /* 32.954 */ 1, 45, 49, KdSyncPositive, /* 52.727 */ }, /* 640x480 modes */ {640, 480, 85, 36000, /* VESA */ 56, 80, 192, KdSyncNegative, /* 43.269 */ 1, 25, 29, KdSyncNegative, /* 85.008 */ }, {640, 480, 75, 31500, /* VESA */ 16, 120, 200, KdSyncNegative, /* 37.500 */ 1, 16, 20, KdSyncNegative, /* 75.000 */ }, {640, 480, 72, 31500, /* VESA */ 16, 120, 176, KdSyncNegative, /* 37.861 */ 1, 20, 24, KdSyncNegative, /* 72.809 */ }, {640, 480, 60, 25175, /* VESA */ 16, 48, 160, KdSyncNegative, /* 31.469 */ 10, 33, 45, KdSyncNegative, /* 59.940 */ }, /* 800x600 modes */ {800, 600, 85, 56250, /* VESA */ 32, 152, 248, KdSyncPositive, /* 53.674 */ 1, 27, 31, KdSyncPositive, /* 85.061 */ }, {800, 600, 75, 49500, /* VESA */ 16, 160, 256, KdSyncPositive, /* 46.875 */ 1, 21, 25, KdSyncPositive, /* 75.000 */ }, /* DEFAULT */ #define MONITOR_TIMING_DEFAULT 9 {800, 600, 72, 50000, /* VESA */ 56, 64, 240, KdSyncPositive, /* 48.077 */ 37, 23, 66, KdSyncPositive, /* 72.188 */ }, {800, 600, 60, 40000, /* VESA */ 40, 88, 256, KdSyncPositive, /* 37.879 */ 1, 23, 28, KdSyncPositive, /* 60.317 */ }, {800, 600, 56, 36000, /* VESA */ 24, 128, 224, KdSyncPositive, /* 35.156 */ 1, 22, 25, KdSyncPositive, /* 56.250 */ }, /* 1024x768 modes */ {1024, 768, 85, 94500, /* VESA */ 48, 208, 352, KdSyncPositive, /* 68.677 */ 1, 36, 40, KdSyncPositive, /* 84.997 */ }, {1024, 768, 75, 78750, /* VESA */ 16, 176, 288, KdSyncPositive, /* 60.023 */ 1, 28, 32, KdSyncPositive, /* 75.029 */ }, {1024, 768, 70, 75000, /* VESA */ 24, 144, 304, KdSyncNegative, /* 56.476 */ 3, 29, 38, KdSyncNegative, /* 70.069 */ }, {1024, 768, 60, 65000, /* VESA */ 24, 160, 320, KdSyncNegative, /* 48.363 */ 3, 29, 38, KdSyncNegative, /* 60.004 */ }, /* 1152x864 mode */ {1152, 864, 75, 108000, /* VESA */ 64, 256, 448, KdSyncPositive, /* 67.500 */ 1, 32, 36, KdSyncPositive, /* 75.000 */ }, /* 1152x900 modes */ {1152, 900, 85, 122500, /* ADDED */ 48, 208, 384, KdSyncPositive, /* 79.753 */ 1, 32, 38, KdSyncPositive, /* 85.024 */ }, {1152, 900, 75, 108250, /* ADDED */ 32, 208, 384, KdSyncPositive, /* 70.475 */ 1, 32, 38, KdSyncPositive, /* 75.133 */ }, {1152, 900, 70, 100250, /* ADDED */ 32, 208, 384, KdSyncPositive, /* 65.267 */ 2, 32, 38, KdSyncPositive, /* 69.581 */ }, {1152, 900, 66, 95000, /* ADDED */ 32, 208, 384, KdSyncPositive, /* 61.849 */ 1, 32, 38, KdSyncPositive, /* 65.937 */ }, /* 1280x854 modes */ {1280, 854, 103, 12500, /* ADDED */ 56, 16, 128, KdSyncPositive, /* 102.554 */ 1, 216, 12, KdSyncPositive, }, /* 1280x960 modes */ {1280, 960, 85, 148500, /* VESA */ 64, 224, 448, KdSyncPositive, /* 85.938 */ 1, 47, 51, KdSyncPositive, /* 85.002 */ }, {1280, 960, 60, 108000, /* VESA */ 96, 312, 520, KdSyncPositive, /* 60.000 */ 1, 36, 40, KdSyncPositive, /* 60.000 */ }, /* 1280x1024 modes */ {1280, 1024, 85, 157500, /* VESA */ 64, 224, 448, KdSyncPositive, /* 91.146 */ 1, 44, 48, KdSyncPositive, /* 85.024 */ }, {1280, 1024, 75, 135000, /* VESA */ 16, 248, 408, KdSyncPositive, /* 79.976 */ 1, 38, 42, KdSyncPositive, /* 75.025 */ }, {1280, 1024, 60, 108000, /* VESA */ 48, 248, 408, KdSyncPositive, /* 63.981 */ 1, 38, 42, KdSyncPositive, /* 60.020 */ }, /* 1600x1200 modes */ {1600, 1200, 85, 229500, /* VESA */ 64, 304, 560, KdSyncPositive, /* 106.250 */ 1, 46, 50, KdSyncPositive, /* 85.000 */ }, {1600, 1200, 75, 202500, /* VESA */ 64, 304, 560, KdSyncPositive, /* 93.750 */ 1, 46, 50, KdSyncPositive, /* 75.000 */ }, {1600, 1200, 70, 189000, /* VESA */ 64, 304, 560, KdSyncPositive, /* 87.500 */ 1, 46, 50, KdSyncPositive, /* 70.000 */ }, {1600, 1200, 65, 175500, /* VESA */ 64, 304, 560, KdSyncPositive, /* 81.250 */ 1, 46, 50, KdSyncPositive, /* 65.000 */ }, {1600, 1200, 60, 162000, /* VESA */ 64, 304, 560, KdSyncPositive, /* 75.000 */ 1, 46, 50, KdSyncPositive, /* 60.000 */ }, /* 1792x1344 modes */ {1792, 1344, 85, 301500, /* ADDED */ 96, 352, 672, KdSyncNegative, /* 122.362 */ 1, 92, 96, KdSyncPositive, /* 84.974 */ }, {1792, 1344, 75, 261000, /* VESA */ 96, 352, 664, KdSyncNegative, /* 106.270 */ 1, 69, 73, KdSyncPositive, /* 74.997 */ }, {1792, 1344, 60, 204750, /* VESA */ 128, 328, 656, KdSyncNegative, /* 83.640 */ 1, 46, 50, KdSyncPositive, /* 60.000 */ }, #if 0 {1800, 1012, 75}, {1906, 1072, 68}, #endif /* 1856x1392 modes */ {1856, 1392, 85, 330500, /* ADDED */ 160, 352, 736, KdSyncNegative, /* 127.508 */ 1, 104, 108, KdSyncPositive, /* 85.001 */ }, {1856, 1392, 75, 288000, /* VESA */ 128, 352, 704, KdSyncNegative, /* 112.500 */ 1, 104, 108, KdSyncPositive, /* 75.000 */ }, {1856, 1392, 60, 218250, /* VESA */ 96, 352, 672, KdSyncNegative, /* 86.333 */ 1, 43, 47, KdSyncPositive, /* 59.995 */ }, /* 1920x1440 modes */ {1920, 1440, 85, 341750, /* ADDED */ 160, 352, 760, KdSyncNegative, /* 127.512 */ 1, 56, 60, KdSyncPositive, /* 85.012 */ }, {1920, 1440, 75, 297000, /* VESA */ 144, 352, 720, KdSyncNegative, /* 112.500 */ 1, 56, 60, KdSyncPositive, /* 75.000 */ }, {1920, 1440, 60, 234000, /* VESA */ 128, 244, 680, KdSyncNegative, /* 90.000 */ 1, 56, 60, KdSyncPositive, /* 60.000 */ }, }; #define NUM_MONITOR_TIMINGS (sizeof kdMonitorTimings/sizeof kdMonitorTimings[0]) const int kdNumMonitorTimings = NUM_MONITOR_TIMINGS; const KdMonitorTiming * KdFindMode(KdScreenInfo * screen, Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *)) { int i; const KdMonitorTiming *t; for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) { if ((*supported) (screen, t) && t->horizontal == screen->width && t->vertical == screen->height && (!screen->rate || t->rate <= screen->rate)) { return t; } } ErrorF("Warning: mode not found, using default\n"); return &kdMonitorTimings[MONITOR_TIMING_DEFAULT]; } static const KdMonitorTiming * kdFindPrevSize(const KdMonitorTiming * old) { const KdMonitorTiming *new, *prev; if (old == kdMonitorTimings) return 0; new = old; /* * Search for the previous size */ while (new != kdMonitorTimings) { new--; if (new->horizontal != old->horizontal && new->vertical != old->vertical) { break; } } /* * Match the refresh rate (<=) */ while (new != kdMonitorTimings) { prev = new - 1; if (prev->horizontal == new->horizontal && prev->vertical == new->vertical && prev->rate > old->rate) { break; } new--; } return new; } Bool KdTuneMode(KdScreenInfo * screen, Bool (*usable) (KdScreenInfo *), Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *)) { const KdMonitorTiming *t; while (!(*usable) (screen)) { /* * Fix requested depth and geometry until it works */ if (screen->fb.depth > 16) screen->fb.depth = 16; else if (screen->fb.depth > 8) screen->fb.depth = 8; else { t = kdFindPrevSize(KdFindMode(screen, supported)); if (!t) return FALSE; screen->width = t->horizontal; screen->height = t->vertical; screen->rate = t->rate; } } return TRUE; } #ifdef RANDR Bool KdRandRGetInfo(ScreenPtr pScreen, int randr, Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *)) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; int i; const KdMonitorTiming *t; for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) { if ((*supported) (pScreen, t)) { RRScreenSizePtr pSize; pSize = RRRegisterSize(pScreen, t->horizontal, t->vertical, screen->width_mm, screen->height_mm); if (!pSize) return FALSE; if (!RRRegisterRate(pScreen, pSize, t->rate)) return FALSE; if (t->horizontal == screen->width && t->vertical == screen->height && t->rate == screen->rate) RRSetCurrentConfig(pScreen, randr, t->rate, pSize); } } return TRUE; } const KdMonitorTiming * KdRandRGetTiming(ScreenPtr pScreen, Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *), int rate, RRScreenSizePtr pSize) { int i; const KdMonitorTiming *t; for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++) { if (t->horizontal == pSize->width && t->vertical == pSize->height && t->rate == rate && (*supported) (pScreen, t)) return t; } return 0; } #endif xorg-server-1.17.1/hw/kdrive/src/kdrive.c0000664000175100017510000007344712415504026015150 00000000000000/* * Copyright © 1999 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_CONFIG_H #include #endif #include "kdrive.h" #include #include #include "privates.h" #ifdef RANDR #include #endif #ifdef XV #include "kxv.h" #endif #ifdef DPMSExtension #include "dpmsproc.h" #endif #ifdef HAVE_EXECINFO_H #include #endif #include typedef struct _kdDepths { CARD8 depth; CARD8 bpp; } KdDepths; KdDepths kdDepths[] = { {1, 1}, {4, 4}, {8, 8}, {15, 16}, {16, 16}, {24, 32}, {32, 32} }; #define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0])) #define KD_DEFAULT_BUTTONS 5 DevPrivateKeyRec kdScreenPrivateKeyRec; unsigned long kdGeneration; Bool kdVideoTest; unsigned long kdVideoTestTime; Bool kdEmulateMiddleButton; Bool kdRawPointerCoordinates; Bool kdDisableZaphod; Bool kdAllowZap; Bool kdEnabled; int kdSubpixelOrder; int kdVirtualTerminal = -1; Bool kdSwitchPending; char *kdSwitchCmd; DDXPointRec kdOrigin; Bool kdHasPointer = FALSE; Bool kdHasKbd = FALSE; static Bool kdCaughtSignal = FALSE; /* * Carry arguments from InitOutput through driver initialization * to KdScreenInit */ KdOsFuncs *kdOsFuncs; void KdDisableScreen(ScreenPtr pScreen) { KdScreenPriv(pScreen); if (!pScreenPriv->enabled) return; if (!pScreenPriv->closed) SetRootClip(pScreen, FALSE); KdDisableColormap(pScreen); if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->disableAccel) (*pScreenPriv->card->cfuncs->disableAccel) (pScreen); if (!pScreenPriv->screen->softCursor && pScreenPriv->card->cfuncs->disableCursor) (*pScreenPriv->card->cfuncs->disableCursor) (pScreen); if (pScreenPriv->card->cfuncs->dpms) (*pScreenPriv->card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL); pScreenPriv->enabled = FALSE; if (pScreenPriv->card->cfuncs->disable) (*pScreenPriv->card->cfuncs->disable) (pScreen); } static void KdDoSwitchCmd(const char *reason) { if (kdSwitchCmd) { char *command; int ret; if (asprintf(&command, "%s %s", kdSwitchCmd, reason) == -1) return; /* Ignore the return value from system; I'm not sure * there's anything more useful to be done when * it fails */ ret = system(command); (void) ret; free(command); } } void KdSuspend(void) { KdCardInfo *card; KdScreenInfo *screen; if (kdEnabled) { for (card = kdCardInfo; card; card = card->next) { for (screen = card->screenList; screen; screen = screen->next) if (screen->mynum == card->selected && screen->pScreen) KdDisableScreen(screen->pScreen); if (card->driver && card->cfuncs->restore) (*card->cfuncs->restore) (card); } KdDisableInput(); KdDoSwitchCmd("suspend"); } } void KdDisableScreens(void) { KdSuspend(); if (kdEnabled) { if (kdOsFuncs->Disable) (*kdOsFuncs->Disable) (); kdEnabled = FALSE; } } Bool KdEnableScreen(ScreenPtr pScreen) { KdScreenPriv(pScreen); if (pScreenPriv->enabled) return TRUE; if (pScreenPriv->card->cfuncs->enable) if (!(*pScreenPriv->card->cfuncs->enable) (pScreen)) return FALSE; pScreenPriv->enabled = TRUE; pScreenPriv->dpmsState = KD_DPMS_NORMAL; pScreenPriv->card->selected = pScreenPriv->screen->mynum; if (!pScreenPriv->screen->softCursor && pScreenPriv->card->cfuncs->enableCursor) (*pScreenPriv->card->cfuncs->enableCursor) (pScreen); if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->enableAccel) (*pScreenPriv->card->cfuncs->enableAccel) (pScreen); KdEnableColormap(pScreen); SetRootClip(pScreen, TRUE); if (pScreenPriv->card->cfuncs->dpms) (*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState); return TRUE; } void KdResume(void) { KdCardInfo *card; KdScreenInfo *screen; if (kdEnabled) { KdDoSwitchCmd("resume"); for (card = kdCardInfo; card; card = card->next) { if (card->cfuncs->preserve) (*card->cfuncs->preserve) (card); for (screen = card->screenList; screen; screen = screen->next) if (screen->mynum == card->selected && screen->pScreen) KdEnableScreen(screen->pScreen); } KdEnableInput(); KdReleaseAllKeys(); } } void KdEnableScreens(void) { if (!kdEnabled) { kdEnabled = TRUE; if (kdOsFuncs->Enable) (*kdOsFuncs->Enable) (); } KdResume(); } void KdProcessSwitch(void) { if (kdEnabled) KdDisableScreens(); else KdEnableScreens(); } void AbortDDX(enum ExitCode error) { KdDisableScreens(); if (kdOsFuncs) { if (kdEnabled && kdOsFuncs->Disable) (*kdOsFuncs->Disable) (); if (kdOsFuncs->Fini) (*kdOsFuncs->Fini) (); KdDoSwitchCmd("stop"); } if (kdCaughtSignal) OsAbort(); } void ddxGiveUp(enum ExitCode error) { AbortDDX(error); } Bool kdDumbDriver; Bool kdSoftCursor; const char * KdParseFindNext(const char *cur, const char *delim, char *save, char *last) { while (*cur && !strchr(delim, *cur)) { *save++ = *cur++; } *save = 0; *last = *cur; if (*cur) cur++; return cur; } Rotation KdAddRotation(Rotation a, Rotation b) { Rotation rotate = (a & RR_Rotate_All) * (b & RR_Rotate_All); Rotation reflect = (a & RR_Reflect_All) ^ (b & RR_Reflect_All); if (rotate > RR_Rotate_270) rotate /= (RR_Rotate_270 * RR_Rotate_90); return reflect | rotate; } Rotation KdSubRotation(Rotation a, Rotation b) { Rotation rotate = (a & RR_Rotate_All) * 16 / (b & RR_Rotate_All); Rotation reflect = (a & RR_Reflect_All) ^ (b & RR_Reflect_All); if (rotate > RR_Rotate_270) rotate /= (RR_Rotate_270 * RR_Rotate_90); return reflect | rotate; } void KdParseScreen(KdScreenInfo * screen, const char *arg) { char delim; char save[1024]; int i; int pixels, mm; screen->dumb = kdDumbDriver; screen->softCursor = kdSoftCursor; screen->origin = kdOrigin; screen->randr = RR_Rotate_0; screen->x = 0; screen->y = 0; screen->width = 0; screen->height = 0; screen->width_mm = 0; screen->height_mm = 0; screen->subpixel_order = kdSubpixelOrder; screen->rate = 0; screen->fb.depth = 0; if (!arg) return; if (strlen(arg) >= sizeof(save)) return; for (i = 0; i < 2; i++) { arg = KdParseFindNext(arg, "x/+@XY", save, &delim); if (!save[0]) return; pixels = atoi(save); mm = 0; if (delim == '/') { arg = KdParseFindNext(arg, "x+@XY", save, &delim); if (!save[0]) return; mm = atoi(save); } if (i == 0) { screen->width = pixels; screen->width_mm = mm; } else { screen->height = pixels; screen->height_mm = mm; } if (delim != 'x' && delim != '+' && delim != '@' && delim != 'X' && delim != 'Y' && (delim != '\0' || i == 0)) return; } kdOrigin.x += screen->width; kdOrigin.y = 0; kdDumbDriver = FALSE; kdSoftCursor = FALSE; kdSubpixelOrder = SubPixelUnknown; if (delim == '+') { arg = KdParseFindNext(arg, "+@xXY", save, &delim); if (save[0]) screen->x = atoi(save); } if (delim == '+') { arg = KdParseFindNext(arg, "@xXY", save, &delim); if (save[0]) screen->y = atoi(save); } if (delim == '@') { arg = KdParseFindNext(arg, "xXY", save, &delim); if (save[0]) { int rotate = atoi(save); if (rotate < 45) screen->randr = RR_Rotate_0; else if (rotate < 135) screen->randr = RR_Rotate_90; else if (rotate < 225) screen->randr = RR_Rotate_180; else if (rotate < 315) screen->randr = RR_Rotate_270; else screen->randr = RR_Rotate_0; } } if (delim == 'X') { arg = KdParseFindNext(arg, "xY", save, &delim); screen->randr |= RR_Reflect_X; } if (delim == 'Y') { arg = KdParseFindNext(arg, "xY", save, &delim); screen->randr |= RR_Reflect_Y; } arg = KdParseFindNext(arg, "x/,", save, &delim); if (save[0]) { screen->fb.depth = atoi(save); if (delim == '/') { arg = KdParseFindNext(arg, "x,", save, &delim); if (save[0]) screen->fb.bitsPerPixel = atoi(save); } else screen->fb.bitsPerPixel = 0; } if (delim == 'x') { arg = KdParseFindNext(arg, "x", save, &delim); if (save[0]) screen->rate = atoi(save); } } /* * Mouse argument syntax: * * device,protocol,options... * * Options are any of: * 1-5 n button mouse * 2button emulate middle button * {NMO} Reorder buttons */ void KdParseRgba(char *rgba) { if (!strcmp(rgba, "rgb")) kdSubpixelOrder = SubPixelHorizontalRGB; else if (!strcmp(rgba, "bgr")) kdSubpixelOrder = SubPixelHorizontalBGR; else if (!strcmp(rgba, "vrgb")) kdSubpixelOrder = SubPixelVerticalRGB; else if (!strcmp(rgba, "vbgr")) kdSubpixelOrder = SubPixelVerticalBGR; else if (!strcmp(rgba, "none")) kdSubpixelOrder = SubPixelNone; else kdSubpixelOrder = SubPixelUnknown; } void KdUseMsg(void) { ErrorF("\nTinyX Device Dependent Usage:\n"); ErrorF ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM][+[-]XOFFSET][+[-]YOFFSET][@ROTATION][X][Y][xDEPTH/BPP[xFREQ]] Specify screen characteristics\n"); ErrorF ("-rgba rgb/bgr/vrgb/vbgr/none Specify subpixel ordering for LCD panels\n"); ErrorF ("-mouse driver [,n,,options] Specify the pointer driver and its options (n is the number of buttons)\n"); ErrorF ("-keybd driver [,,options] Specify the keyboard driver and its options\n"); ErrorF("-zaphod Disable cursor screen switching\n"); ErrorF("-2button Emulate 3 button mouse\n"); ErrorF("-3button Disable 3 button mouse emulation\n"); ErrorF ("-rawcoord Don't transform pointer coordinates on rotation\n"); ErrorF("-dumb Disable hardware acceleration\n"); ErrorF("-softCursor Force software cursor\n"); ErrorF("-videoTest Start the server, pause momentarily and exit\n"); ErrorF ("-origin X,Y Locates the next screen in the the virtual screen (Xinerama)\n"); ErrorF("-switchCmd Command to execute on vt switch\n"); ErrorF("-zap Terminate server on Ctrl+Alt+Backspace\n"); ErrorF ("vtxx Use virtual terminal xx instead of the next available\n"); } int KdProcessArgument(int argc, char **argv, int i) { KdCardInfo *card; KdScreenInfo *screen; if (!strcmp(argv[i], "-screen")) { if ((i + 1) < argc) { card = KdCardInfoLast(); if (!card) { InitCard(0); card = KdCardInfoLast(); } if (card) { screen = KdScreenInfoAdd(card); KdParseScreen(screen, argv[i + 1]); } else ErrorF("No matching card found!\n"); } else UseMsg(); return 2; } if (!strcmp(argv[i], "-zaphod")) { kdDisableZaphod = TRUE; return 1; } if (!strcmp(argv[i], "-zap")) { kdAllowZap = TRUE; return 1; } if (!strcmp(argv[i], "-3button")) { kdEmulateMiddleButton = FALSE; return 1; } if (!strcmp(argv[i], "-2button")) { kdEmulateMiddleButton = TRUE; return 1; } if (!strcmp(argv[i], "-rawcoord")) { kdRawPointerCoordinates = 1; return 1; } if (!strcmp(argv[i], "-dumb")) { kdDumbDriver = TRUE; return 1; } if (!strcmp(argv[i], "-softCursor")) { kdSoftCursor = TRUE; return 1; } if (!strcmp(argv[i], "-videoTest")) { kdVideoTest = TRUE; return 1; } if (!strcmp(argv[i], "-origin")) { if ((i + 1) < argc) { char *x = argv[i + 1]; char *y = strchr(x, ','); if (x) kdOrigin.x = atoi(x); else kdOrigin.x = 0; if (y) kdOrigin.y = atoi(y + 1); else kdOrigin.y = 0; } else UseMsg(); return 2; } if (!strcmp(argv[i], "-rgba")) { if ((i + 1) < argc) KdParseRgba(argv[i + 1]); else UseMsg(); return 2; } if (!strcmp(argv[i], "-switchCmd")) { if ((i + 1) < argc) kdSwitchCmd = argv[i + 1]; else UseMsg(); return 2; } if (!strncmp(argv[i], "vt", 2) && sscanf(argv[i], "vt%2d", &kdVirtualTerminal) == 1) { return 1; } if (!strcmp(argv[i], "-mouse") || !strcmp(argv[i], "-pointer")) { if (i + 1 >= argc) UseMsg(); KdAddConfigPointer(argv[i + 1]); kdHasPointer = TRUE; return 2; } if (!strcmp(argv[i], "-keybd")) { if (i + 1 >= argc) UseMsg(); KdAddConfigKeyboard(argv[i + 1]); kdHasKbd = TRUE; return 2; } return 0; } /* * These are getting tossed in here until I can think of where * they really belong */ void KdOsInit(KdOsFuncs * pOsFuncs) { kdOsFuncs = pOsFuncs; if (pOsFuncs) { if (serverGeneration == 1) { KdDoSwitchCmd("start"); if (pOsFuncs->Init) (*pOsFuncs->Init) (); } } } Bool KdAllocatePrivates(ScreenPtr pScreen) { KdPrivScreenPtr pScreenPriv; if (kdGeneration != serverGeneration) kdGeneration = serverGeneration; if (!dixRegisterPrivateKey(&kdScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; pScreenPriv = calloc(1, sizeof(*pScreenPriv)); if (!pScreenPriv) return FALSE; KdSetScreenPriv(pScreen, pScreenPriv); return TRUE; } Bool KdCreateScreenResources(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdCardInfo *card = pScreenPriv->card; Bool ret; pScreen->CreateScreenResources = pScreenPriv->CreateScreenResources; if (pScreen->CreateScreenResources) ret = (*pScreen->CreateScreenResources) (pScreen); else ret = -1; pScreenPriv->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = KdCreateScreenResources; if (ret && card->cfuncs->createRes) ret = (*card->cfuncs->createRes) (pScreen); return ret; } Bool KdCloseScreen(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; KdCardInfo *card = pScreenPriv->card; Bool ret; if (card->cfuncs->closeScreen) (*card->cfuncs->closeScreen)(pScreen); pScreenPriv->closed = TRUE; pScreen->CloseScreen = pScreenPriv->CloseScreen; if (pScreen->CloseScreen) ret = (*pScreen->CloseScreen) (pScreen); else ret = TRUE; if (pScreenPriv->dpmsState != KD_DPMS_NORMAL) (*card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL); if (screen->mynum == card->selected) KdDisableScreen(pScreen); /* * Restore video hardware when last screen is closed */ if (screen == card->screenList) { if (kdEnabled && card->cfuncs->restore) (*card->cfuncs->restore) (card); } if (!pScreenPriv->screen->dumb && card->cfuncs->finiAccel) (*card->cfuncs->finiAccel) (pScreen); if (!pScreenPriv->screen->softCursor && card->cfuncs->finiCursor) (*card->cfuncs->finiCursor) (pScreen); if (card->cfuncs->scrfini) (*card->cfuncs->scrfini) (screen); /* * Clean up card when last screen is closed, DIX closes them in * reverse order, thus we check for when the first in the list is closed */ if (screen == card->screenList) { if (card->cfuncs->cardfini) (*card->cfuncs->cardfini) (card); /* * Clean up OS when last card is closed */ if (card == kdCardInfo) { if (kdEnabled) { kdEnabled = FALSE; if (kdOsFuncs->Disable) (*kdOsFuncs->Disable) (); } } } pScreenPriv->screen->pScreen = 0; free((void *) pScreenPriv); return ret; } Bool KdSaveScreen(ScreenPtr pScreen, int on) { KdScreenPriv(pScreen); int dpmsState; if (!pScreenPriv->card->cfuncs->dpms) return FALSE; dpmsState = pScreenPriv->dpmsState; switch (on) { case SCREEN_SAVER_OFF: dpmsState = KD_DPMS_NORMAL; break; case SCREEN_SAVER_ON: if (dpmsState == KD_DPMS_NORMAL) dpmsState = KD_DPMS_NORMAL + 1; break; case SCREEN_SAVER_CYCLE: if (dpmsState < KD_DPMS_MAX) dpmsState++; break; case SCREEN_SAVER_FORCER: break; } if (dpmsState != pScreenPriv->dpmsState) { if (pScreenPriv->enabled) (*pScreenPriv->card->cfuncs->dpms) (pScreen, dpmsState); pScreenPriv->dpmsState = dpmsState; } return TRUE; } static Bool KdCreateWindow(WindowPtr pWin) { #ifndef PHOENIX if (!pWin->parent) { KdScreenPriv(pWin->drawable.pScreen); if (!pScreenPriv->enabled) { RegionEmpty(&pWin->borderClip); RegionBreak(&pWin->clipList); } } #endif return fbCreateWindow(pWin); } void KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; int subpixel_order = screen->subpixel_order; Rotation subpixel_dir; int i; static struct { int subpixel_order; Rotation direction; } orders[] = { {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}, }; /* map subpixel to direction */ for (i = 0; i < 4; i++) if (orders[i].subpixel_order == subpixel_order) break; if (i < 4) { subpixel_dir = KdAddRotation(randr & RR_Rotate_All, orders[i].direction); /* map back to subpixel order */ for (i = 0; i < 4; i++) if (orders[i].direction & subpixel_dir) { subpixel_order = orders[i].subpixel_order; break; } /* reflect */ for (i = 0; i < 4; i++) if ((randr & reflects[i].bit) && reflects[i].normal == subpixel_order) { subpixel_order = reflects[i].reflect; break; } } PictureSetSubpixelOrder(pScreen, subpixel_order); } /* Pass through AddScreen, which doesn't take any closure */ static KdScreenInfo *kdCurrentScreen; Bool KdScreenInit(ScreenPtr pScreen, int argc, char **argv) { KdScreenInfo *screen = kdCurrentScreen; KdCardInfo *card = screen->card; KdPrivScreenPtr pScreenPriv; /* * note that screen->fb is set up for the nominal orientation * of the screen; that means if randr is rotated, the values * there should reflect a rotated frame buffer (or shadow). */ Bool rotated = (screen->randr & (RR_Rotate_90 | RR_Rotate_270)) != 0; int width, height, *width_mmp, *height_mmp; KdAllocatePrivates(pScreen); pScreenPriv = KdGetScreenPriv(pScreen); if (!rotated) { width = screen->width; height = screen->height; width_mmp = &screen->width_mm; height_mmp = &screen->height_mm; } else { width = screen->height; height = screen->width; width_mmp = &screen->height_mm; height_mmp = &screen->width_mm; } screen->pScreen = pScreen; pScreenPriv->screen = screen; pScreenPriv->card = card; pScreenPriv->bytesPerPixel = screen->fb.bitsPerPixel >> 3; pScreenPriv->dpmsState = KD_DPMS_NORMAL; pScreen->x = screen->origin.x; pScreen->y = screen->origin.y; if (!monitorResolution) monitorResolution = 75; /* * This is done in this order so that backing store wraps * our GC functions; fbFinishScreenInit initializes MI * backing store */ if (!fbSetupScreen(pScreen, screen->fb.frameBuffer, width, height, monitorResolution, monitorResolution, screen->fb.pixelStride, screen->fb.bitsPerPixel)) { return FALSE; } /* * Set colormap functions */ pScreen->InstallColormap = KdInstallColormap; pScreen->UninstallColormap = KdUninstallColormap; pScreen->ListInstalledColormaps = KdListInstalledColormaps; pScreen->StoreColors = KdStoreColors; pScreen->SaveScreen = KdSaveScreen; pScreen->CreateWindow = KdCreateWindow; if (!fbFinishScreenInit(pScreen, screen->fb.frameBuffer, width, height, monitorResolution, monitorResolution, screen->fb.pixelStride, screen->fb.bitsPerPixel)) { return FALSE; } /* * Fix screen sizes; for some reason mi takes dpi instead of mm. * Rounding errors are annoying */ if (*width_mmp) pScreen->mmWidth = *width_mmp; else *width_mmp = pScreen->mmWidth; if (*height_mmp) pScreen->mmHeight = *height_mmp; else *height_mmp = pScreen->mmHeight; /* * Plug in our own block/wakeup handlers. * miScreenInit installs NoopDDA in both places */ pScreen->BlockHandler = KdBlockHandler; pScreen->WakeupHandler = KdWakeupHandler; if (!fbPictureInit(pScreen, 0, 0)) return FALSE; if (card->cfuncs->initScreen) if (!(*card->cfuncs->initScreen) (pScreen)) return FALSE; if (!screen->dumb && card->cfuncs->initAccel) if (!(*card->cfuncs->initAccel) (pScreen)) screen->dumb = TRUE; if (card->cfuncs->finishInitScreen) if (!(*card->cfuncs->finishInitScreen) (pScreen)) return FALSE; /* * Wrap CloseScreen, the order now is: * KdCloseScreen * miBSCloseScreen * fbCloseScreen */ pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = KdCloseScreen; pScreenPriv->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = KdCreateScreenResources; if (screen->softCursor || !card->cfuncs->initCursor || !(*card->cfuncs->initCursor) (pScreen)) { /* Use MI for cursor display and event queueing. */ screen->softCursor = TRUE; miDCInitialize(pScreen, &kdPointerScreenFuncs); } if (!fbCreateDefColormap(pScreen)) { return FALSE; } KdSetSubpixelOrder(pScreen, screen->randr); /* * Enable the hardware */ if (!kdEnabled) { kdEnabled = TRUE; if (kdOsFuncs->Enable) (*kdOsFuncs->Enable) (); } if (screen->mynum == card->selected) { if (card->cfuncs->preserve) (*card->cfuncs->preserve) (card); if (card->cfuncs->enable) if (!(*card->cfuncs->enable) (pScreen)) return FALSE; pScreenPriv->enabled = TRUE; if (!screen->softCursor && card->cfuncs->enableCursor) (*card->cfuncs->enableCursor) (pScreen); KdEnableColormap(pScreen); if (!screen->dumb && card->cfuncs->enableAccel) (*card->cfuncs->enableAccel) (pScreen); } return TRUE; } void KdInitScreen(ScreenInfo * pScreenInfo, KdScreenInfo * screen, int argc, char **argv) { KdCardInfo *card = screen->card; if (!(*card->cfuncs->scrinit) (screen)) FatalError("Screen initialization failed!\n"); if (!card->cfuncs->initAccel) screen->dumb = TRUE; if (!card->cfuncs->initCursor) screen->softCursor = TRUE; } static Bool KdSetPixmapFormats(ScreenInfo * pScreenInfo) { CARD8 depthToBpp[33]; /* depth -> bpp map */ KdCardInfo *card; KdScreenInfo *screen; int i; int bpp; PixmapFormatRec *format; for (i = 1; i <= 32; i++) depthToBpp[i] = 0; /* * Generate mappings between bitsPerPixel and depth, * also ensure that all screens comply with protocol * restrictions on equivalent formats for the same * depth on different screens */ for (card = kdCardInfo; card; card = card->next) { for (screen = card->screenList; screen; screen = screen->next) { bpp = screen->fb.bitsPerPixel; if (bpp == 24) bpp = 32; if (!depthToBpp[screen->fb.depth]) depthToBpp[screen->fb.depth] = bpp; else if (depthToBpp[screen->fb.depth] != bpp) return FALSE; } } /* * Fill in additional formats */ for (i = 0; i < NUM_KD_DEPTHS; i++) if (!depthToBpp[kdDepths[i].depth]) depthToBpp[kdDepths[i].depth] = kdDepths[i].bpp; pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; pScreenInfo->numPixmapFormats = 0; for (i = 1; i <= 32; i++) { if (depthToBpp[i]) { format = &pScreenInfo->formats[pScreenInfo->numPixmapFormats++]; format->depth = i; format->bitsPerPixel = depthToBpp[i]; format->scanlinePad = BITMAP_SCANLINE_PAD; } } return TRUE; } static void KdAddScreen(ScreenInfo * pScreenInfo, KdScreenInfo * screen, int argc, char **argv) { int i; /* * Fill in fb visual type masks for this screen */ for (i = 0; i < pScreenInfo->numPixmapFormats; i++) { unsigned long visuals; Pixel rm, gm, bm; visuals = 0; rm = gm = bm = 0; if (pScreenInfo->formats[i].depth == screen->fb.depth) { visuals = screen->fb.visuals; rm = screen->fb.redMask; gm = screen->fb.greenMask; bm = screen->fb.blueMask; } fbSetVisualTypesAndMasks(pScreenInfo->formats[i].depth, visuals, 8, rm, gm, bm); } kdCurrentScreen = screen; AddScreen(KdScreenInit, argc, argv); } #if 0 /* This function is not used currently */ int KdDepthToFb(ScreenPtr pScreen, int depth) { KdScreenPriv(pScreen); for (fb = 0; fb <= KD_MAX_FB && pScreenPriv->screen->fb.frameBuffer; fb++) if (pScreenPriv->screen->fb.depth == depth) return fb; } #endif static int KdSignalWrapper(int signum) { kdCaughtSignal = TRUE; return 1; /* use generic OS layer cleanup & abort */ } void KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { KdCardInfo *card; KdScreenInfo *screen; if (!kdCardInfo) { InitCard(0); if (!(card = KdCardInfoLast())) FatalError("No matching cards found!\n"); screen = KdScreenInfoAdd(card); KdParseScreen(screen, 0); } /* * Initialize all of the screens for all of the cards */ for (card = kdCardInfo; card; card = card->next) { int ret = 1; if (card->cfuncs->cardinit) ret = (*card->cfuncs->cardinit) (card); if (ret) { for (screen = card->screenList; screen; screen = screen->next) KdInitScreen(pScreenInfo, screen, argc, argv); } } /* * Merge the various pixmap formats together, this can fail * when two screens share depth but not bitsPerPixel */ if (!KdSetPixmapFormats(pScreenInfo)) return; /* * Add all of the screens */ for (card = kdCardInfo; card; card = card->next) for (screen = card->screenList; screen; screen = screen->next) KdAddScreen(pScreenInfo, screen, argc, argv); OsRegisterSigWrapper(KdSignalWrapper); } void OsVendorFatalError(const char *f, va_list args) { } int DPMSSet(ClientPtr client, int level) { return Success; } Bool DPMSSupported(void) { return FALSE; } xorg-server-1.17.1/hw/kdrive/src/kdrive.h0000664000175100017510000003440512415504317015147 00000000000000/* * Copyright © 1999 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. */ #ifndef _KDRIVE_H_ #define _KDRIVE_H_ #include #include #include #include #include #include "scrnintstr.h" #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" #include "mipointer.h" #include "mi.h" #include "dix.h" #include "fb.h" #include "fboverlay.h" #include "shadow.h" #include "randrstr.h" #include "globals.h" #include "xkbstr.h" #define KD_DPMS_NORMAL 0 #define KD_DPMS_STANDBY 1 #define KD_DPMS_SUSPEND 2 #define KD_DPMS_POWERDOWN 3 #define KD_DPMS_MAX KD_DPMS_POWERDOWN #define Status int typedef struct _KdCardInfo { struct _KdCardFuncs *cfuncs; void *closure; void *driver; struct _KdScreenInfo *screenList; int selected; struct _KdCardInfo *next; } KdCardInfo; extern KdCardInfo *kdCardInfo; /* * Configuration information per X screen */ typedef struct _KdFrameBuffer { CARD8 *frameBuffer; int depth; int bitsPerPixel; int pixelStride; int byteStride; Bool shadow; unsigned long visuals; Pixel redMask, greenMask, blueMask; void *closure; } KdFrameBuffer; #define RR_Rotate_All (RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270) #define RR_Reflect_All (RR_Reflect_X|RR_Reflect_Y) typedef struct _KdScreenInfo { struct _KdScreenInfo *next; KdCardInfo *card; ScreenPtr pScreen; void *driver; Rotation randr; /* rotation and reflection */ int x; int y; int width; int height; int rate; int width_mm; int height_mm; int subpixel_order; Bool dumb; Bool softCursor; int mynum; DDXPointRec origin; KdFrameBuffer fb; } KdScreenInfo; typedef struct _KdCardFuncs { Bool (*cardinit) (KdCardInfo *); /* detect and map device */ Bool (*scrinit) (KdScreenInfo *); /* initialize screen information */ Bool (*initScreen) (ScreenPtr); /* initialize ScreenRec */ Bool (*finishInitScreen) (ScreenPtr pScreen); Bool (*createRes) (ScreenPtr); /* create screen resources */ void (*preserve) (KdCardInfo *); /* save graphics card state */ Bool (*enable) (ScreenPtr); /* set up for rendering */ Bool (*dpms) (ScreenPtr, int); /* set DPMS screen saver */ void (*disable) (ScreenPtr); /* turn off rendering */ void (*restore) (KdCardInfo *); /* restore graphics card state */ void (*scrfini) (KdScreenInfo *); /* close down screen */ void (*cardfini) (KdCardInfo *); /* close down */ Bool (*initCursor) (ScreenPtr); /* detect and map cursor */ void (*enableCursor) (ScreenPtr); /* enable cursor */ void (*disableCursor) (ScreenPtr); /* disable cursor */ void (*finiCursor) (ScreenPtr); /* close down */ void (*recolorCursor) (ScreenPtr, int, xColorItem *); Bool (*initAccel) (ScreenPtr); void (*enableAccel) (ScreenPtr); void (*disableAccel) (ScreenPtr); void (*finiAccel) (ScreenPtr); void (*getColors) (ScreenPtr, int, xColorItem *); void (*putColors) (ScreenPtr, int, xColorItem *); void (*closeScreen) (ScreenPtr); /* close ScreenRec */ } KdCardFuncs; #define KD_MAX_PSEUDO_DEPTH 8 #define KD_MAX_PSEUDO_SIZE (1 << KD_MAX_PSEUDO_DEPTH) typedef struct { KdScreenInfo *screen; KdCardInfo *card; Bool enabled; Bool closed; int bytesPerPixel; int dpmsState; ColormapPtr pInstalledmap; /* current colormap */ xColorItem systemPalette[KD_MAX_PSEUDO_SIZE]; /* saved windows colors */ CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; } KdPrivScreenRec, *KdPrivScreenPtr; typedef enum _kdPointerState { start, button_1_pend, button_1_down, button_2_down, button_3_pend, button_3_down, synth_2_down_13, synth_2_down_3, synth_2_down_1, num_input_states } KdPointerState; #define KD_MAX_BUTTON 32 #define KD_KEYBOARD 1 #define KD_MOUSE 2 #define KD_TOUCHSCREEN 3 typedef struct _KdPointerInfo KdPointerInfo; typedef struct _KdPointerDriver { const char *name; Status(*Init) (KdPointerInfo *); Status(*Enable) (KdPointerInfo *); void (*Disable) (KdPointerInfo *); void (*Fini) (KdPointerInfo *); struct _KdPointerDriver *next; } KdPointerDriver; struct _KdPointerInfo { DeviceIntPtr dixdev; char *name; char *path; char *protocol; InputOption *options; int inputClass; CARD8 map[KD_MAX_BUTTON + 1]; int nButtons; int nAxes; Bool emulateMiddleButton; unsigned long emulationTimeout; int emulationDx, emulationDy; Bool timeoutPending; KdPointerState mouseState; Bool eventHeld; struct { int type; int x; int y; int z; int flags; int absrel; } heldEvent; unsigned char buttonState; Bool transformCoordinates; int pressureThreshold; KdPointerDriver *driver; void *driverPrivate; struct _KdPointerInfo *next; }; extern int KdCurScreen; void KdAddPointerDriver(KdPointerDriver * driver); void KdRemovePointerDriver(KdPointerDriver * driver); KdPointerInfo *KdNewPointer(void); void KdFreePointer(KdPointerInfo *); int KdAddPointer(KdPointerInfo * ki); int KdAddConfigPointer(char *pointer); void KdRemovePointer(KdPointerInfo * ki); #define KD_KEY_COUNT 248 #define KD_MIN_KEYCODE 8 #define KD_MAX_KEYCODE 255 #define KD_MAX_WIDTH 4 #define KD_MAX_LENGTH (KD_MAX_KEYCODE - KD_MIN_KEYCODE + 1) typedef struct { KeySym modsym; int modbit; } KdKeySymModsRec; typedef struct _KdKeyboardInfo KdKeyboardInfo; typedef struct _KdKeyboardDriver { const char *name; Bool (*Init) (KdKeyboardInfo *); Bool (*Enable) (KdKeyboardInfo *); void (*Leds) (KdKeyboardInfo *, int); void (*Bell) (KdKeyboardInfo *, int, int, int); void (*Disable) (KdKeyboardInfo *); void (*Fini) (KdKeyboardInfo *); struct _KdKeyboardDriver *next; } KdKeyboardDriver; struct _KdKeyboardInfo { struct _KdKeyboardInfo *next; DeviceIntPtr dixdev; void *closure; char *name; char *path; int inputClass; char *xkbRules; char *xkbModel; char *xkbLayout; char *xkbVariant; char *xkbOptions; int LockLed; int minScanCode; int maxScanCode; int leds; int bellPitch; int bellDuration; InputOption *options; KdKeyboardDriver *driver; void *driverPrivate; }; void KdAddKeyboardDriver(KdKeyboardDriver * driver); void KdRemoveKeyboardDriver(KdKeyboardDriver * driver); KdKeyboardInfo *KdNewKeyboard(void); void KdFreeKeyboard(KdKeyboardInfo * ki); int KdAddConfigKeyboard(char *pointer); int KdAddKeyboard(KdKeyboardInfo * ki); void KdRemoveKeyboard(KdKeyboardInfo * ki); typedef struct _KdOsFuncs { int (*Init) (void); void (*Enable) (void); Bool (*SpecialKey) (KeySym); void (*Disable) (void); void (*Fini) (void); void (*pollEvents) (void); void (*Bell) (int, int, int); } KdOsFuncs; typedef enum _KdSyncPolarity { KdSyncNegative, KdSyncPositive } KdSyncPolarity; typedef struct _KdMonitorTiming { /* label */ int horizontal; int vertical; int rate; /* pixel clock */ int clock; /* in KHz */ /* horizontal timing */ int hfp; /* front porch */ int hbp; /* back porch */ int hblank; /* blanking */ KdSyncPolarity hpol; /* polarity */ /* vertical timing */ int vfp; /* front porch */ int vbp; /* back porch */ int vblank; /* blanking */ KdSyncPolarity vpol; /* polarity */ } KdMonitorTiming; extern const KdMonitorTiming kdMonitorTimings[]; extern const int kdNumMonitorTimings; typedef struct _KdPointerMatrix { int matrix[2][3]; } KdPointerMatrix; extern DevPrivateKeyRec kdScreenPrivateKeyRec; #define kdScreenPrivateKey (&kdScreenPrivateKeyRec) extern unsigned long kdGeneration; extern Bool kdEnabled; extern Bool kdSwitchPending; extern Bool kdEmulateMiddleButton; extern Bool kdDisableZaphod; extern Bool kdAllowZap; extern int kdVirtualTerminal; extern char *kdSwitchCmd; extern KdOsFuncs *kdOsFuncs; #define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey)) #define KdSetScreenPriv(pScreen,v) \ dixSetPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey, v) #define KdScreenPriv(pScreen) KdPrivScreenPtr pScreenPriv = KdGetScreenPriv(pScreen) /* kcmap.c */ void KdSetColormap(ScreenPtr pScreen); void KdEnableColormap(ScreenPtr pScreen); void KdDisableColormap(ScreenPtr pScreen); void KdInstallColormap(ColormapPtr pCmap); void KdUninstallColormap(ColormapPtr pCmap); int KdListInstalledColormaps(ScreenPtr pScreen, Colormap * pCmaps); void KdStoreColors(ColormapPtr pCmap, int ndef, xColorItem * pdefs); /* kdrive.c */ extern miPointerScreenFuncRec kdPointerScreenFuncs; void KdDisableScreen(ScreenPtr pScreen); void KdDisableScreens(void); Bool KdEnableScreen(ScreenPtr pScreen); void KdEnableScreens(void); void KdSuspend(void); void KdResume(void); void KdProcessSwitch(void); Rotation KdAddRotation(Rotation a, Rotation b); Rotation KdSubRotation(Rotation a, Rotation b); void KdParseScreen(KdScreenInfo * screen, const char *arg); KdPointerInfo *KdParsePointer(const char *arg); KdKeyboardInfo *KdParseKeyboard(const char *arg); const char * KdParseFindNext(const char *cur, const char *delim, char *save, char *last); void KdParseRgba(char *rgba); void KdUseMsg(void); int KdProcessArgument(int argc, char **argv, int i); void KdOsInit(KdOsFuncs * pOsFuncs); void KdOsAddInputDrivers(void); Bool KdAllocatePrivates(ScreenPtr pScreen); Bool KdCreateScreenResources(ScreenPtr pScreen); Bool KdCloseScreen(ScreenPtr pScreen); Bool KdSaveScreen(ScreenPtr pScreen, int on); Bool KdScreenInit(ScreenPtr pScreen, int argc, char **argv); void KdInitScreen(ScreenInfo * pScreenInfo, KdScreenInfo * screen, int argc, char **argv); void KdInitCard(ScreenInfo * pScreenInfo, KdCardInfo * card, int argc, char **argv); void KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv); void KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr); void KdBacktrace(int signum); /* kinfo.c */ KdCardInfo *KdCardInfoAdd(KdCardFuncs * funcs, void *closure); KdCardInfo *KdCardInfoLast(void); void KdCardInfoDispose(KdCardInfo * ci); KdScreenInfo *KdScreenInfoAdd(KdCardInfo * ci); void KdScreenInfoDispose(KdScreenInfo * si); /* kinput.c */ void KdInitInput(void); void KdCloseInput(void); Bool KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure); void KdUnregisterFds(void *closure, Bool do_close); void KdUnregisterFd(void *closure, int fd, Bool do_close); void KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code, unsigned char is_up); #define KD_BUTTON_1 0x01 #define KD_BUTTON_2 0x02 #define KD_BUTTON_3 0x04 #define KD_BUTTON_4 0x08 #define KD_BUTTON_5 0x10 #define KD_BUTTON_8 0x80 #define KD_POINTER_DESKTOP 0x40000000 #define KD_MOUSE_DELTA 0x80000000 void KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry, int rz); void _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, int b, int absrel, Bool force); void KdReleaseAllKeys(void); void KdSetLed(KdKeyboardInfo * ki, int led, Bool on); void KdSetPointerMatrix(KdPointerMatrix *pointer); void KdComputePointerMatrix(KdPointerMatrix *pointer, Rotation randr, int width, int height); void KdScreenToPointerCoords(int *x, int *y); void KdBlockHandler(ScreenPtr pScreen, void *timeout, void *readmask); void KdWakeupHandler(ScreenPtr pScreen, unsigned long result, void *readmask); void KdDisableInput(void); void KdEnableInput(void); void KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration); /* kmode.c */ const KdMonitorTiming *KdFindMode(KdScreenInfo * screen, Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *)); Bool KdTuneMode(KdScreenInfo * screen, Bool (*usable) (KdScreenInfo *), Bool (*supported) (KdScreenInfo *, const KdMonitorTiming *)); #ifdef RANDR Bool KdRandRGetInfo(ScreenPtr pScreen, int randr, Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *)); const KdMonitorTiming *KdRandRGetTiming(ScreenPtr pScreen, Bool (*supported) (ScreenPtr pScreen, const KdMonitorTiming *), int rate, RRScreenSizePtr pSize); #endif /* kshadow.c */ Bool KdShadowFbAlloc(KdScreenInfo * screen, Bool rotate); void KdShadowFbFree(KdScreenInfo * screen); Bool KdShadowSet(ScreenPtr pScreen, int randr, ShadowUpdateProc update, ShadowWindowProc window); void KdShadowUnset(ScreenPtr pScreen); /* function prototypes to be implemented by the drivers */ void InitCard(char *name); #endif /* _KDRIVE_H_ */ xorg-server-1.17.1/hw/dmx/0000775000175100017510000000000012466505444012311 500000000000000xorg-server-1.17.1/hw/dmx/Makefile.am0000664000175100017510000000404412323563340014256 00000000000000 SUBDIRS = input config examples doc doxygen man bin_PROGRAMS = Xdmx if XINERAMA PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c endif if GLX SUBDIRS += glxProxy GLX_LIBS = glxProxy/libglxproxy.a GLX_SRCS = $(PANORAMIX_SRCS) dmx_glxvisuals.c dmx_glxvisuals.h GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod GLX_DEFS = @GL_CFLAGS@ endif AM_CFLAGS = \ -DHAVE_DMX_CONFIG_H \ $(DIX_CFLAGS) \ $(GLX_INCS) \ $(GLX_DEFS) \ $(DMX_CFLAGS) \ @DMXMODULES_CFLAGS@ Xdmx_SOURCES = dmx.c \ dmxcb.c \ dmxcb.h \ dmxclient.h \ dmxcmap.c \ dmxcmap.h \ dmx-config.h \ dmxcursor.c \ dmxcursor.h \ dmxdpms.c \ dmxdpms.h \ dmxextension.c \ dmxextension.h \ dmxfont.c \ dmxfont.h \ dmxgc.c \ dmxgc.h \ dmxgcops.c \ dmxgcops.h \ dmx.h \ dmxinit.c \ dmxinit.h \ dmxinput.c \ dmxinput.h \ dmxlog.c \ dmxlog.h \ dmxpict.c \ dmxpict.h \ dmxpixmap.c \ dmxpixmap.h \ dmxprop.c \ dmxprop.h \ dmxscrinit.c \ dmxscrinit.h \ dmxstat.c \ dmxstat.h \ dmxsync.c \ dmxsync.h \ dmxvisual.c \ dmxvisual.h \ dmxwindow.c \ dmxwindow.h \ $(top_srcdir)/mi/miinitext.c \ $(GLX_SRCS) #if COMPOSITE #Xdmx_SOURCES += fakecw.c #endif XDMX_LIBS = \ $(GLX_LIBS) \ @XDMX_LIBS@ \ input/libdmxinput.a \ config/libdmxconfig.a Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) Xdmx_DEPENDENCIES= $(XDMX_LIBS) Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) relink: $(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT) xorg-server-1.17.1/hw/dmx/dmx.c0000664000175100017510000007606412366220413013167 00000000000000/* * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * This file implements the server-side part of the DMX protocol. A * vector of fucntions is provided at extension initialization time, so * most all of the useful functions in this file are declared static and * do not appear in the doxygen documentation. * * Much of the low-level work is done by functions in \a dmxextension.c * * Please see the Client-to-Server DMX Extension to the X Protocol * document for details about the protocol. */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include #include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "extinit.h" #include "opaque.h" #include "dmxextension.h" #include #include #include "protocol-versions.h" #ifdef PANORAMIX #include "panoramiX.h" extern unsigned long XRT_WINDOW; extern int PanoramiXNumScreens; #endif static unsigned char DMXCode; static int _DMXXineramaActive(void) { #ifdef PANORAMIX return !noPanoramiXExtension; #else return 0; #endif } static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr, CARD32 value) { switch (1 << bit) { case DMXScreenWindowWidth: attr->screenWindowWidth = value; break; case DMXScreenWindowHeight: attr->screenWindowHeight = value; break; case DMXScreenWindowXoffset: attr->screenWindowXoffset = value; break; case DMXScreenWindowYoffset: attr->screenWindowYoffset = value; break; case DMXRootWindowWidth: attr->rootWindowWidth = value; break; case DMXRootWindowHeight: attr->rootWindowHeight = value; break; case DMXRootWindowXoffset: attr->rootWindowXoffset = value; break; case DMXRootWindowYoffset: attr->rootWindowYoffset = value; break; case DMXRootWindowXorigin: attr->rootWindowXorigin = value; break; case DMXRootWindowYorigin: attr->rootWindowYorigin = value; break; } } static int dmxFetchScreenAttributes(unsigned int mask, DMXScreenAttributesPtr attr, CARD32 *value_list) { int i; CARD32 *value = value_list; int count = 0; for (i = 0; i < 32; i++) { if (mask & (1 << i)) { dmxSetScreenAttribute(i, attr, *value); ++value; ++count; } } return count; } static void dmxSetDesktopAttribute(int bit, DMXDesktopAttributesPtr attr, CARD32 value) { switch (1 << bit) { case DMXDesktopWidth: attr->width = value; break; case DMXDesktopHeight: attr->height = value; break; case DMXDesktopShiftX: attr->shiftX = value; break; case DMXDesktopShiftY: attr->shiftY = value; break; } } static int dmxFetchDesktopAttributes(unsigned int mask, DMXDesktopAttributesPtr attr, CARD32 *value_list) { int i; CARD32 *value = value_list; int count = 0; for (i = 0; i < 32; i++) { if (mask & (1 << i)) { dmxSetDesktopAttribute(i, attr, *value); ++value; ++count; } } return count; } static void dmxSetInputAttribute(int bit, DMXInputAttributesPtr attr, CARD32 value) { switch (1 << bit) { case DMXInputType: attr->inputType = value; break; case DMXInputPhysicalScreen: attr->physicalScreen = value; break; case DMXInputSendsCore: attr->sendsCore = ! !value; break; } } static int dmxFetchInputAttributes(unsigned int mask, DMXInputAttributesPtr attr, CARD32 *value_list) { int i; CARD32 *value = value_list; int count = 0; for (i = 0; i < 32; i++) { if (mask & (1 << i)) { dmxSetInputAttribute(i, attr, *value); ++value; ++count; } } return count; } static int ProcDMXQueryVersion(ClientPtr client) { xDMXQueryVersionReply rep = { .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); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.majorVersion); swapl(&rep.minorVersion); swapl(&rep.patchVersion); } WriteToClient(client, sizeof(xDMXQueryVersionReply), &rep); return Success; } static int ProcDMXSync(ClientPtr client) { xDMXSyncReply rep; REQUEST_SIZE_MATCH(xDMXSyncReq); dmxFlushPendingSyncs(); 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), &rep); return Success; } static int ProcDMXForceWindowCreation(ClientPtr client) { xDMXForceWindowCreationReply rep; REQUEST(xDMXForceWindowCreationReq); WindowPtr pWin; REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq); #ifdef PANORAMIX if (!noPanoramiXExtension) { PanoramiXRes *win; int i; if (Success != dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixReadAccess)) return -1; /* BadWindow */ FOR_NSCREENS(i) { if (Success != dixLookupWindow(&pWin, win->info[i].id, client, DixReadAccess)) return -1; /* BadWindow */ dmxForceWindowCreation(pWin); } goto doreply; } #endif if (Success != dixLookupWindow(&pWin, stuff->window, client, DixReadAccess)) return -1; /* BadWindow */ dmxForceWindowCreation(pWin); doreply: dmxFlushPendingSyncs(); 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), &rep); return Success; } static int ProcDMXGetScreenCount(ClientPtr client) { xDMXGetScreenCountReply rep; REQUEST_SIZE_MATCH(xDMXGetScreenCountReq); 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), &rep); return Success; } static int ProcDMXGetScreenAttributes(ClientPtr client) { REQUEST(xDMXGetScreenAttributesReq); xDMXGetScreenAttributesReply rep; int length; int paddedLength; DMXScreenAttributesRec attr; REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq); if (stuff->physicalScreen < 0 || stuff->physicalScreen >= dmxGetNumScreens()) return BadValue; if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr)) return BadValue; length = attr.displayName ? strlen(attr.displayName) : 0; paddedLength = pad_to_int32(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); swapl(&rep.length); swapl(&rep.displayNameLength); swapl(&rep.logicalScreen); swaps(&rep.screenWindowWidth); swaps(&rep.screenWindowHeight); swaps(&rep.screenWindowXoffset); swaps(&rep.screenWindowYoffset); swaps(&rep.rootWindowWidth); swaps(&rep.rootWindowHeight); swaps(&rep.rootWindowXoffset); swaps(&rep.rootWindowYoffset); swaps(&rep.rootWindowXorigin); swaps(&rep.rootWindowYorigin); } WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), &rep); if (length) WriteToClient(client, length, attr.displayName); return Success; } static int ProcDMXChangeScreensAttributes(ClientPtr client) { REQUEST(xDMXChangeScreensAttributesReq); xDMXChangeScreensAttributesReply rep; int status = DMX_BAD_XINERAMA; unsigned int mask = 0; unsigned int i; CARD32 *screen_list; CARD32 *mask_list; CARD32 *value_list; DMXScreenAttributesPtr attribs; int errorScreen = 0; unsigned int len; int ones = 0; REQUEST_AT_LEAST_SIZE(xDMXChangeScreensAttributesReq); len = client->req_len - bytes_to_int32(sizeof(xDMXChangeScreensAttributesReq)); if (len < stuff->screenCount + stuff->maskCount) return BadLength; screen_list = (CARD32 *) (stuff + 1); mask_list = &screen_list[stuff->screenCount]; value_list = &mask_list[stuff->maskCount]; for (i = 0; i < stuff->maskCount; i++) ones += Ones(mask_list[i]); if (len != stuff->screenCount + stuff->maskCount + ones) return BadLength; if (!_DMXXineramaActive()) goto noxinerama; if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs)))) return BadAlloc; for (i = 0; i < stuff->screenCount; i++) { int count; if (i < stuff->maskCount) mask = mask_list[i]; dmxGetScreenAttributes(screen_list[i], &attribs[i]); count = dmxFetchScreenAttributes(mask, &attribs[i], value_list); value_list += count; } #if PANORAMIX status = dmxConfigureScreenWindows(stuff->screenCount, screen_list, attribs, &errorScreen); #endif free(attribs); if (status == BadValue) return status; noxinerama: 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), &rep); return Success; } static int ProcDMXAddScreen(ClientPtr client) { REQUEST(xDMXAddScreenReq); xDMXAddScreenReply rep; int status = 0; CARD32 *value_list; DMXScreenAttributesRec attr; int count; char *name; int len; int paddedLength; REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq); paddedLength = pad_to_int32(stuff->displayNameLength); len = client->req_len - bytes_to_int32(sizeof(xDMXAddScreenReq)); if (len != Ones(stuff->valueMask) + paddedLength / 4) return BadLength; memset(&attr, 0, sizeof(attr)); dmxGetScreenAttributes(stuff->physicalScreen, &attr); value_list = (CARD32 *) (stuff + 1); count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list); if (!(name = malloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; attr.displayName = name; status = dmxAttachScreen(stuff->physicalScreen, &attr); free(name); 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), &rep); return Success; } static int ProcDMXRemoveScreen(ClientPtr client) { REQUEST(xDMXRemoveScreenReq); xDMXRemoveScreenReply rep; int status = 0; REQUEST_SIZE_MATCH(xDMXRemoveScreenReq); status = dmxDetachScreen(stuff->physicalScreen); 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), &rep); return Success; } #ifdef PANORAMIX static int dmxPopulatePanoramiX(ClientPtr client, Window window, CARD32 *screens, CARD32 *windows, xRectangle *pos, xRectangle *vis) { WindowPtr pWin; PanoramiXRes *win; int i; int count = 0; DMXWindowAttributesRec attr; if (Success != dixLookupResourceByType((void **) &win, window, XRT_WINDOW, client, DixReadAccess)) return -1; /* BadWindow */ FOR_NSCREENS(i) { if (Success != dixLookupWindow(&pWin, win->info[i].id, client, DixReadAccess)) return -1; /* BadWindow */ if (dmxGetWindowAttributes(pWin, &attr)) { screens[count] = attr.screen; windows[count] = attr.window; pos[count] = attr.pos; vis[count] = attr.vis; ++count; /* Only count existing windows */ } } return count; } #endif static int dmxPopulate(ClientPtr client, Window window, CARD32 *screens, CARD32 *windows, xRectangle *pos, xRectangle *vis) { WindowPtr pWin; DMXWindowAttributesRec attr; #ifdef PANORAMIX if (!noPanoramiXExtension) return dmxPopulatePanoramiX(client, window, screens, windows, pos, vis); #endif if (Success != dixLookupWindow(&pWin, window, client, DixReadAccess)) return -1; /* BadWindow */ dmxGetWindowAttributes(pWin, &attr); *screens = attr.screen; *windows = attr.window; *pos = attr.pos; *vis = attr.vis; return 1; } static int dmxMaxNumScreens(void) { #ifdef PANORAMIX if (!noPanoramiXExtension) return PanoramiXNumScreens; #endif return 1; } static int ProcDMXGetWindowAttributes(ClientPtr client) { REQUEST(xDMXGetWindowAttributesReq); xDMXGetWindowAttributesReply rep; int i; CARD32 *screens; CARD32 *windows; xRectangle *pos, *vis; int count = dmxMaxNumScreens(); REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq); if (!(screens = malloc(count * sizeof(*screens)))) return BadAlloc; if (!(windows = malloc(count * sizeof(*windows)))) { free(screens); return BadAlloc; } if (!(pos = malloc(count * sizeof(*pos)))) { free(windows); free(screens); return BadAlloc; } if (!(vis = malloc(count * sizeof(*vis)))) { free(pos); free(windows); free(screens); return BadAlloc; } if ((count = dmxPopulate(client, stuff->window, screens, windows, pos, vis)) < 0) { free(vis); free(pos); free(windows); free(screens); return BadWindow; } rep = (xDMXGetWindowAttributesReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = count * 6, .screenCount = count }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.screenCount); for (i = 0; i < count; i++) { swapl(&screens[i]); swapl(&windows[i]); swaps(&pos[i].x); swaps(&pos[i].y); swaps(&pos[i].width); swaps(&pos[i].height); swaps(&vis[i].x); swaps(&vis[i].y); swaps(&vis[i].width); swaps(&vis[i].height); } } dmxFlushPendingSyncs(); WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), &rep); if (count) { 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); free(pos); free(windows); free(screens); return Success; } static int ProcDMXGetDesktopAttributes(ClientPtr client) { xDMXGetDesktopAttributesReply rep; DMXDesktopAttributesRec attr; REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq); dmxGetDesktopAttributes(&attr); 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); swapl(&rep.length); swaps(&rep.width); swaps(&rep.height); swaps(&rep.shiftX); swaps(&rep.shiftY); } WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), &rep); return Success; } static int ProcDMXChangeDesktopAttributes(ClientPtr client) { REQUEST(xDMXChangeDesktopAttributesReq); xDMXChangeDesktopAttributesReply rep; int status = DMX_BAD_XINERAMA; CARD32 *value_list; DMXDesktopAttributesRec attr; int len; REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq); len = client->req_len - (sizeof(xDMXChangeDesktopAttributesReq) >> 2); if (len != Ones(stuff->valueMask)) return BadLength; if (!_DMXXineramaActive()) goto noxinerama; value_list = (CARD32 *) (stuff + 1); dmxGetDesktopAttributes(&attr); dmxFetchDesktopAttributes(stuff->valueMask, &attr, value_list); #if PANORAMIX status = dmxConfigureDesktop(&attr); #endif if (status == BadValue) return status; noxinerama: rep = (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), &rep); return Success; } static int ProcDMXGetInputCount(ClientPtr client) { xDMXGetInputCountReply rep; REQUEST_SIZE_MATCH(xDMXGetInputCountReq); 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), &rep); return Success; } static int ProcDMXGetInputAttributes(ClientPtr client) { REQUEST(xDMXGetInputAttributesReq); xDMXGetInputAttributesReply rep; int length; int paddedLength; DMXInputAttributesRec attr; REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq); if (dmxGetInputAttributes(stuff->deviceId, &attr)) return BadValue; length = attr.name ? strlen(attr.name) : 0; paddedLength = pad_to_int32(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); swapl(&rep.inputType); swapl(&rep.physicalScreen); swapl(&rep.physicalId); swapl(&rep.nameLength); } WriteToClient(client, sizeof(xDMXGetInputAttributesReply), &rep); if (length) WriteToClient(client, length, attr.name); return Success; } static int ProcDMXAddInput(ClientPtr client) { REQUEST(xDMXAddInputReq); xDMXAddInputReply rep; int status = 0; CARD32 *value_list; DMXInputAttributesRec attr; int count; char *name; int len; int paddedLength; int id = -1; REQUEST_AT_LEAST_SIZE(xDMXAddInputReq); paddedLength = pad_to_int32(stuff->displayNameLength); len = client->req_len - (sizeof(xDMXAddInputReq) >> 2); if (len != Ones(stuff->valueMask) + paddedLength / 4) return BadLength; memset(&attr, 0, sizeof(attr)); value_list = (CARD32 *) (stuff + 1); count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list); if (!(name = malloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; attr.name = name; status = dmxAddInput(&attr, &id); free(name); if (status) return status; 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), &rep); return Success; } static int ProcDMXRemoveInput(ClientPtr client) { REQUEST(xDMXRemoveInputReq); xDMXRemoveInputReply rep; int status = 0; REQUEST_SIZE_MATCH(xDMXRemoveInputReq); status = dmxRemoveInput(stuff->physicalId); if (status) return 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), &rep); return Success; } static int ProcDMXDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_DMXQueryVersion: return ProcDMXQueryVersion(client); case X_DMXSync: return ProcDMXSync(client); case X_DMXForceWindowCreation: return ProcDMXForceWindowCreation(client); case X_DMXGetScreenCount: return ProcDMXGetScreenCount(client); case X_DMXGetScreenAttributes: return ProcDMXGetScreenAttributes(client); case X_DMXChangeScreensAttributes: return ProcDMXChangeScreensAttributes(client); case X_DMXAddScreen: return ProcDMXAddScreen(client); case X_DMXRemoveScreen: return ProcDMXRemoveScreen(client); case X_DMXGetWindowAttributes: return ProcDMXGetWindowAttributes(client); case X_DMXGetDesktopAttributes: return ProcDMXGetDesktopAttributes(client); case X_DMXChangeDesktopAttributes: return ProcDMXChangeDesktopAttributes(client); case X_DMXGetInputCount: return ProcDMXGetInputCount(client); case X_DMXGetInputAttributes: return ProcDMXGetInputAttributes(client); case X_DMXAddInput: return ProcDMXAddInput(client); case X_DMXRemoveInput: return ProcDMXRemoveInput(client); case X_DMXGetScreenInformationDEPRECATED: case X_DMXForceWindowCreationDEPRECATED: case X_DMXReconfigureScreenDEPRECATED: return BadImplementation; default: return BadRequest; } } static int SProcDMXQueryVersion(ClientPtr client) { REQUEST(xDMXQueryVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXQueryVersionReq); return ProcDMXQueryVersion(client); } static int SProcDMXSync(ClientPtr client) { REQUEST(xDMXSyncReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXSyncReq); return ProcDMXSync(client); } static int SProcDMXForceWindowCreation(ClientPtr client) { REQUEST(xDMXForceWindowCreationReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq); swapl(&stuff->window); return ProcDMXForceWindowCreation(client); } static int SProcDMXGetScreenCount(ClientPtr client) { REQUEST(xDMXGetScreenCountReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetScreenCountReq); return ProcDMXGetScreenCount(client); } static int SProcDMXGetScreenAttributes(ClientPtr client) { REQUEST(xDMXGetScreenAttributesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq); swapl(&stuff->physicalScreen); return ProcDMXGetScreenAttributes(client); } static int SProcDMXChangeScreensAttributes(ClientPtr client) { REQUEST(xDMXChangeScreensAttributesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq); swapl(&stuff->screenCount); swapl(&stuff->maskCount); SwapRestL(stuff); return ProcDMXGetScreenAttributes(client); } static int SProcDMXAddScreen(ClientPtr client) { int paddedLength; REQUEST(xDMXAddScreenReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq); swapl(&stuff->displayNameLength); swapl(&stuff->valueMask); paddedLength = pad_to_int32(stuff->displayNameLength); SwapLongs((CARD32 *) (stuff + 1), LengthRestL(stuff) - paddedLength / 4); return ProcDMXAddScreen(client); } static int SProcDMXRemoveScreen(ClientPtr client) { REQUEST(xDMXRemoveScreenReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXRemoveScreenReq); swapl(&stuff->physicalScreen); return ProcDMXRemoveScreen(client); } static int SProcDMXGetWindowAttributes(ClientPtr client) { REQUEST(xDMXGetWindowAttributesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq); swapl(&stuff->window); return ProcDMXGetWindowAttributes(client); } static int SProcDMXGetDesktopAttributes(ClientPtr client) { REQUEST(xDMXGetDesktopAttributesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq); return ProcDMXGetDesktopAttributes(client); } static int SProcDMXChangeDesktopAttributes(ClientPtr client) { REQUEST(xDMXChangeDesktopAttributesReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq); swapl(&stuff->valueMask); SwapRestL(stuff); return ProcDMXChangeDesktopAttributes(client); } static int SProcDMXGetInputCount(ClientPtr client) { REQUEST(xDMXGetInputCountReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetInputCountReq); return ProcDMXGetInputCount(client); } static int SProcDMXGetInputAttributes(ClientPtr client) { REQUEST(xDMXGetInputAttributesReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq); swapl(&stuff->deviceId); return ProcDMXGetInputAttributes(client); } static int SProcDMXAddInput(ClientPtr client) { int paddedLength; REQUEST(xDMXAddInputReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXAddInputReq); swapl(&stuff->displayNameLength); swapl(&stuff->valueMask); paddedLength = pad_to_int32(stuff->displayNameLength); SwapLongs((CARD32 *) (stuff + 1), LengthRestL(stuff) - paddedLength / 4); return ProcDMXAddInput(client); } static int SProcDMXRemoveInput(ClientPtr client) { REQUEST(xDMXRemoveInputReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXRemoveInputReq); swapl(&stuff->physicalId); return ProcDMXRemoveInput(client); } static int SProcDMXDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_DMXQueryVersion: return SProcDMXQueryVersion(client); case X_DMXSync: return SProcDMXSync(client); case X_DMXForceWindowCreation: return SProcDMXForceWindowCreation(client); case X_DMXGetScreenCount: return SProcDMXGetScreenCount(client); case X_DMXGetScreenAttributes: return SProcDMXGetScreenAttributes(client); case X_DMXChangeScreensAttributes: return SProcDMXChangeScreensAttributes(client); case X_DMXAddScreen: return SProcDMXAddScreen(client); case X_DMXRemoveScreen: return SProcDMXRemoveScreen(client); case X_DMXGetWindowAttributes: return SProcDMXGetWindowAttributes(client); case X_DMXGetDesktopAttributes: return SProcDMXGetDesktopAttributes(client); case X_DMXChangeDesktopAttributes: return SProcDMXChangeDesktopAttributes(client); case X_DMXGetInputCount: return SProcDMXGetInputCount(client); case X_DMXGetInputAttributes: return SProcDMXGetInputAttributes(client); case X_DMXAddInput: return SProcDMXAddInput(client); case X_DMXRemoveInput: return SProcDMXRemoveInput(client); case X_DMXGetScreenInformationDEPRECATED: case X_DMXForceWindowCreationDEPRECATED: case X_DMXReconfigureScreenDEPRECATED: return BadImplementation; default: return BadRequest; } } /** Initialize the extension. */ void DMXExtensionInit(void) { ExtensionEntry *extEntry; if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0, ProcDMXDispatch, SProcDMXDispatch, NULL, StandardMinorOpcode))) DMXCode = extEntry->base; } xorg-server-1.17.1/hw/dmx/dmxinit.h0000664000175100017510000000346612274325511014057 00000000000000/* * Copyright 2004 Red Hat Inc., Raleigh, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * Interface for initialization. \see dmxinit.c */ #ifndef DMXINIT_H #define DMXINIT_H #include "scrnintstr.h" extern Bool dmxOpenDisplay(DMXScreenInfo * dmxScreen); extern void dmxSetErrorHandler(DMXScreenInfo * dmxScreen); extern void dmxCheckForWM(DMXScreenInfo * dmxScreen); extern void dmxGetScreenAttribs(DMXScreenInfo * dmxScreen); extern Bool dmxGetVisualInfo(DMXScreenInfo * dmxScreen); extern void dmxGetColormaps(DMXScreenInfo * dmxScreen); extern void dmxGetPixmapFormats(DMXScreenInfo * dmxScreen); #endif /* DMXINIT_H */ xorg-server-1.17.1/hw/dmx/dmxlog.h0000664000175100017510000000672012274325511013671 00000000000000/* * Copyright 2001 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * This header is included by all files that need to use the DMX logging * facilities. */ #ifndef _DMXLOG_H_ #define _DMXLOG_H_ /** Logging levels -- output is tunable with #dmxSetLogLevel. */ typedef enum { dmxDebug, /**< Usually verbose debugging info */ dmxInfo, /**< Non-warning information */ dmxWarning, /**< A warning that may indicate DMX * will not function as the user * intends. */ dmxError, /**< A non-fatal error that probably * indicates DMX will not function as * desired.*/ dmxFatal /**< A fatal error that will cause DMX * to shut down. */ } dmxLogLevel; /* Logging functions used by Xserver/hw/dmx routines. */ extern dmxLogLevel dmxSetLogLevel(dmxLogLevel newLevel); extern dmxLogLevel dmxGetLogLevel(void); extern void dmxLog(dmxLogLevel logLevel, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern void dmxLogCont(dmxLogLevel logLevel, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern const char *dmxEventName(int type); #ifndef DMX_LOG_STANDALONE extern void dmxLogOutput(DMXScreenInfo * dmxScreen, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern void dmxLogOutputCont(DMXScreenInfo * dmxScreen, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern void dmxLogOutputWarning(DMXScreenInfo * dmxScreen, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern void dmxLogInput(DMXInputInfo * dmxInput, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern void dmxLogInputCont(DMXInputInfo * dmxInput, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); extern void dmxLogArgs(dmxLogLevel logLevel, int argc, char **argv); extern void dmxLogVisual(DMXScreenInfo * dmxScreen, XVisualInfo * vi, int defaultVisual); extern const char *dmxXInputEventName(int type); #endif #endif xorg-server-1.17.1/hw/dmx/dmxcb.h0000664000175100017510000000346612274325511013500 00000000000000/* * Copyright 2001,2002 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * Header file for connection block functions. \see dmxcb.c. */ #ifndef _DMXCB_H_ #define _DMXCB_H_ /** The cursor position, in global coordinates. */ extern int dmxGlobalWidth, dmxGlobalHeight; /** #dmxComputeWidthHeight can either recompute the global bounding box * or not. */ typedef enum { DMX_RECOMPUTE_BOUNDING_BOX, DMX_NO_RECOMPUTE_BOUNDING_BOX } DMXRecomputeFlag; extern void dmxSetWidthHeight(int width, int height); extern void dmxComputeWidthHeight(DMXRecomputeFlag flag); extern void dmxConnectionBlockCallback(void); #endif xorg-server-1.17.1/hw/dmx/dmxstat.c0000664000175100017510000001627312366220413014057 00000000000000/* * Copyright 2002, 2003 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * * The DMX server code is written to call #dmxSync() whenever an XSync() * might be necessary. However, since XSync() requires a two way * communication with the other X server, eliminating unnecessary * XSync() calls is a key performance optimization. Support for this * optimization is provided in \a dmxsync.c. This file provides routines * that evaluate this optimization by counting the number of XSync() * calls and monitoring their latency. This functionality can be turned * on using the -stat command-line parameter. */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include "dmx.h" #include "dmxstat.h" #include "dmxlog.h" #include /* For sys/time.h */ /** Used to compute a running average of value. */ typedef struct _DMXStatAvg { int pos; int count; unsigned long value[DMX_STAT_LENGTH]; } DMXStatAvg; /** Statistical information about XSync calls. */ struct _DMXStatInfo { unsigned long syncCount; unsigned long oldSyncCount; DMXStatAvg usec; DMXStatAvg pending; unsigned long bins[DMX_STAT_BINS]; }; /* Interval in mS between statistic message log entries. */ int dmxStatInterval; static int dmxStatDisplays; static OsTimerPtr dmxStatTimer; /** Return the number of microseconds as an unsigned long. * Unfortunately, this is only useful for intervals < about 4 sec. */ static unsigned long usec(struct timeval *stop, struct timeval *start) { return (stop->tv_sec - start->tv_sec) * 1000000 + stop->tv_usec - start->tv_usec; } static unsigned long avg(DMXStatAvg * data, unsigned long *max) { unsigned long sum; int i; *max = 0; if (!data->count) return 0; for (i = 0, sum = 0; i < data->count; i++) { if (data->value[i] > *max) *max = data->value[i]; sum += data->value[i]; } return sum / data->count; } /** Turn on XSync statistic gathering and printing. Print every \a * interval seconds, with lines for the first \a displays. If \a * interval is NULL, 1 will be used. If \a displays is NULL, 0 will be * used (meaning a line for every display will be printed). Note that * this function takes string arguments because it will usually be * called from #ddxProcessArgument in \a dmxinit.c. */ void dmxStatActivate(const char *interval, const char *displays) { dmxStatInterval = (interval ? atoi(interval) : 1) * 1000; dmxStatDisplays = (displays ? atoi(displays) : 0); if (dmxStatInterval < 1000) dmxStatInterval = 1000; if (dmxStatDisplays < 0) dmxStatDisplays = 0; } /** Allocate a \a DMXStatInfo structure. */ DMXStatInfo * dmxStatAlloc(void) { DMXStatInfo *pt = calloc(1, sizeof(*pt)); return pt; } /** Free the memory used by a \a DMXStatInfo structure. */ void dmxStatFree(DMXStatInfo * pt) { free(pt); } static void dmxStatValue(DMXStatAvg * data, unsigned long value) { if (data->count != DMX_STAT_LENGTH) ++data->count; if (data->pos >= DMX_STAT_LENGTH - 1) data->pos = 0; data->value[data->pos++] = value; } /** Note that a XSync() was just done on \a dmxScreen with the \a start * and \a stop times (from gettimeofday()) and the number of * pending-but-not-yet-processed XSync requests. This routine is called * from #dmxDoSync in \a dmxsync.c */ void dmxStatSync(DMXScreenInfo * dmxScreen, struct timeval *stop, struct timeval *start, unsigned long pending) { DMXStatInfo *s = dmxScreen->stat; unsigned long elapsed = usec(stop, start); unsigned long thresh; int i; ++s->syncCount; dmxStatValue(&s->usec, elapsed); dmxStatValue(&s->pending, pending); for (i = 0, thresh = DMX_STAT_BIN0; i < DMX_STAT_BINS - 1; i++) { if (elapsed < thresh) { ++s->bins[i]; break; } thresh *= DMX_STAT_BINMULT; } if (i == DMX_STAT_BINS - 1) ++s->bins[i]; } /* Actually do the work of printing out the human-readable message. */ static CARD32 dmxStatCallback(OsTimerPtr timer, CARD32 t, void *arg) { int i, j; static int header = 0; int limit = dmxNumScreens; if (!dmxNumScreens) { header = 0; return DMX_STAT_INTERVAL; } if (!header++ || !(header % 10)) { dmxLog(dmxDebug, " S SyncCount Sync/s avSync mxSync avPend mxPend | " "<10ms <1s >1s\n"); } if (dmxStatDisplays && dmxStatDisplays < limit) limit = dmxStatDisplays; for (i = 0; i < limit; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; DMXStatInfo *s = dmxScreen->stat; unsigned long aSync, mSync; unsigned long aPend, mPend; if (!s) continue; aSync = avg(&s->usec, &mSync); aPend = avg(&s->pending, &mPend); dmxLog(dmxDebug, "%2d %9lu %7lu %6lu %6lu %6lu %6lu |", i, /* S */ s->syncCount, /* SyncCount */ (s->syncCount - s->oldSyncCount) * 1000 / dmxStatInterval, /* Sync/s */ aSync, /* us/Sync */ mSync, /* max/Sync */ aPend, /* avgPend */ mPend); /* maxPend */ for (j = 0; j < DMX_STAT_BINS; j++) dmxLogCont(dmxDebug, " %5lu", s->bins[j]); dmxLogCont(dmxDebug, "\n"); /* Reset/clear */ s->oldSyncCount = s->syncCount; for (j = 0; j < DMX_STAT_BINS; j++) s->bins[j] = 0; } return DMX_STAT_INTERVAL; /* Place on queue again */ } /** Try to initialize the statistic gathering and printing routines. * Initialization only takes place if #dmxStatActivate has already been * called. We don't need the same generation protection that we used in * dmxSyncInit because our timer is always on a queue -- hence, server * generation will always free it. */ void dmxStatInit(void) { if (dmxStatInterval) dmxStatTimer = TimerSet(NULL, 0, dmxStatInterval, dmxStatCallback, NULL); } xorg-server-1.17.1/hw/dmx/dmxdpms.c0000664000175100017510000001551012366220413014040 00000000000000/* * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Author: * Rickard E. (Rik) Faith * */ /** \file * Provides DPMS support and unifies all DPMS and other screen-saver * support in one file. If -dpms is given on the command line, or the * Xdmx server is not compiled with DPMS support, then the DPMS extension * does not work for clients, but DPMS on the backends is still disables * (and restored at Xdmx server shutdown time). */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include "dmx.h" #include "dmxdpms.h" #include "dmxlog.h" #include "dmxsync.h" #ifdef DPMSExtension #include "dpmsproc.h" #endif #include "windowstr.h" /* For screenIsSaved */ #include static unsigned long dpmsGeneration = 0; static Bool dpmsSupported = TRUE; static void _dmxDPMSInit(DMXScreenInfo * dmxScreen) { int event_base, error_base; int major, minor; CARD16 level, standby, suspend, off; BOOL state; const char *monitor; if (dpmsGeneration != serverGeneration) { dpmsSupported = TRUE; /* On unless a backend doesn't support it */ dpmsGeneration = serverGeneration; } #ifdef DPMSExtension if (DPMSDisabledSwitch) dpmsSupported = FALSE; /* -dpms turns off */ #endif dmxScreen->dpmsCapable = 0; if (!dmxScreen->beDisplay) { dmxLogOutput(dmxScreen, "Cannot determine if DPMS supported (detached screen)\n"); dpmsSupported = FALSE; return; } if (!DPMSQueryExtension(dmxScreen->beDisplay, &event_base, &error_base)) { dmxLogOutput(dmxScreen, "DPMS not supported\n"); dpmsSupported = FALSE; return; } if (!DPMSGetVersion(dmxScreen->beDisplay, &major, &minor)) { dmxLogOutput(dmxScreen, "DPMS not supported\n"); dpmsSupported = FALSE; return; } if (!DPMSCapable(dmxScreen->beDisplay)) { dmxLogOutput(dmxScreen, "DPMS %d.%d (not DPMS capable)\n", major, minor); dpmsSupported = FALSE; return; } DPMSInfo(dmxScreen->beDisplay, &level, &state); DPMSGetTimeouts(dmxScreen->beDisplay, &standby, &suspend, &off); DPMSSetTimeouts(dmxScreen->beDisplay, 0, 0, 0); DPMSEnable(dmxScreen->beDisplay); DPMSForceLevel(dmxScreen->beDisplay, DPMSModeOn); dmxScreen->dpmsCapable = 1; dmxScreen->dpmsEnabled = ! !state; dmxScreen->dpmsStandby = standby; dmxScreen->dpmsSuspend = suspend; dmxScreen->dpmsOff = off; switch (level) { case DPMSModeOn: monitor = "on"; break; case DPMSModeStandby: monitor = "standby"; break; case DPMSModeSuspend: monitor = "suspend"; break; case DPMSModeOff: monitor = "off"; break; default: monitor = "unknown"; break; } dmxLogOutput(dmxScreen, "DPMS %d.%d (%s, %s, %d %d %d)\n", major, minor, monitor, state ? "enabled" : "disabled", standby, suspend, off); } /** Initialize DPMS support. We save the current settings and turn off * DPMS. The settings are restored in #dmxDPMSTerm. */ void dmxDPMSInit(DMXScreenInfo * dmxScreen) { int interval, preferBlanking, allowExposures; /* Turn off DPMS */ _dmxDPMSInit(dmxScreen); if (!dmxScreen->beDisplay) return; /* Turn off screen saver */ XGetScreenSaver(dmxScreen->beDisplay, &dmxScreen->savedTimeout, &interval, &preferBlanking, &allowExposures); XSetScreenSaver(dmxScreen->beDisplay, 0, interval, preferBlanking, allowExposures); XResetScreenSaver(dmxScreen->beDisplay); dmxSync(dmxScreen, FALSE); } /** Terminate DPMS support on \a dmxScreen. We restore the settings * saved in #dmxDPMSInit. */ void dmxDPMSTerm(DMXScreenInfo * dmxScreen) { int timeout, interval, preferBlanking, allowExposures; if (!dmxScreen->beDisplay) return; XGetScreenSaver(dmxScreen->beDisplay, &timeout, &interval, &preferBlanking, &allowExposures); XSetScreenSaver(dmxScreen->beDisplay, dmxScreen->savedTimeout, interval, preferBlanking, allowExposures); if (dmxScreen->dpmsCapable) { /* Restore saved state */ DPMSForceLevel(dmxScreen->beDisplay, DPMSModeOn); DPMSSetTimeouts(dmxScreen->beDisplay, dmxScreen->dpmsStandby, dmxScreen->dpmsSuspend, dmxScreen->dpmsOff); if (dmxScreen->dpmsEnabled) DPMSEnable(dmxScreen->beDisplay); else DPMSDisable(dmxScreen->beDisplay); } dmxSync(dmxScreen, FALSE); } /** Called when activity is detected so that DPMS power-saving mode can * be deactivated. */ void dmxDPMSWakeup(void) { if (screenIsSaved == SCREEN_SAVER_ON) dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); #ifdef DPMSExtension if (DPMSPowerLevel) DPMSSet(serverClient, 0); #endif } #ifdef DPMSExtension /** This is called on each server generation. It should determine if * DPMS is supported on all of the backends and, if so, return TRUE. */ Bool DPMSSupported(void) { return dpmsSupported; } /** This is used by clients (e.g., xset) to set the DPMS level. */ int DPMSSet(ClientPtr client, int level) { int i; if (!dpmsSupported) return Success; if (level < 0) level = DPMSModeOn; if (level > 3) level = DPMSModeOff; DPMSPowerLevel = level; for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; if (dmxScreen->beDisplay) { DPMSForceLevel(dmxScreen->beDisplay, level); dmxSync(dmxScreen, FALSE); } } return Success; } #endif xorg-server-1.17.1/hw/dmx/doxygen/0000775000175100017510000000000012466505444013766 500000000000000xorg-server-1.17.1/hw/dmx/doxygen/Makefile.am0000664000175100017510000000261712160102336015730 00000000000000# Copyright 2005 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 Red Hat # not be used in advertising or publicity pertaining to distribution # of the software without specific, written prior permission. Red # Hat makes no representations about the suitability of this software # for any purpose. It is provided "as is" without express or implied # warranty. # # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN # NO EVENT SHALL RED HAT 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. if ENABLE_DEVEL_DOCS if HAVE_DOXYGEN # Developers documentation is not installed noinst_DATA = html/index.html dist_noinst_DATA = doxygen.conf.in footer.html html/index.html: $(AM_V_GEN)$(DOXYGEN) doxygen.conf clean-local: $(AM_V_at)rm -fr html/ endif HAVE_DOXYGEN endif ENABLE_DEVEL_DOCS xorg-server-1.17.1/hw/dmx/doxygen/Makefile.in0000664000175100017510000005205112466505430015751 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright 2005 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 Red Hat # not be used in advertising or publicity pertaining to distribution # of the software without specific, written prior permission. Red # Hat makes no representations about the suitability of this software # for any purpose. It is provided "as is" without express or implied # warranty. # # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN # NO EVENT SHALL RED HAT 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. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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/dmx/doxygen DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/doxygen.conf.in $(am__dist_noinst_DATA_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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 = doxygen.conf CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_noinst_DATA_DIST = doxygen.conf.in footer.html DATA = $(dist_noinst_DATA) $(noinst_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ # Developers documentation is not installed @ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOXYGEN_TRUE@noinst_DATA = html/index.html @ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOXYGEN_TRUE@dist_noinst_DATA = doxygen.conf.in footer.html all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(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/dmx/doxygen/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/dmx/doxygen/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(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 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) 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." @ENABLE_DEVEL_DOCS_FALSE@clean-local: @HAVE_DOXYGEN_FALSE@clean-local: clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am @ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOXYGEN_TRUE@html/index.html: @ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOXYGEN_TRUE@ $(AM_V_GEN)$(DOXYGEN) doxygen.conf @ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOXYGEN_TRUE@clean-local: @ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOXYGEN_TRUE@ $(AM_V_at)rm -fr html/ # 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: xorg-server-1.17.1/hw/dmx/doxygen/doxygen.conf.in0000664000175100017510000020050512274325511016631 00000000000000# Doxyfile 1.6.2 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "Distributed Multihead X" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = "@PACKAGE_VERSION@" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = YES # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = YES # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @srcdir@/.. \ @srcdir@/../input \ @srcdir@/../config # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = @srcdir@/../config/parser.c \ @srcdir@/../config/parser.h \ @srcdir@/../config/scanner.c # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = YES # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = atKeynames.h \ Canvas*.* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = @srcdir@/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = NO # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = YES # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = SHAPE \ RENDER \ XKB \ XINPUT # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = gif # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES xorg-server-1.17.1/hw/dmx/doxygen/footer.html0000664000175100017510000000040212274325511016056 00000000000000
Generated on $datetime for $projectname by doxygen $doxygenversion
xorg-server-1.17.1/hw/dmx/dmxextension.h0000664000175100017510000001046612274325511015126 00000000000000/* * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Author: * Rickard E. (Rik) Faith * Kevin E. Martin * */ /** \file * Interface for DMX extension support. These routines are called by * function in Xserver/Xext/dmx.c. \see dmxextension.c */ #ifndef _DMXEXTENSION_H_ #define _DMXEXTENSION_H_ /** Screen attributes. Used by #ProcDMXGetScreenAttributes and * \a ProcDMXChangeScreensAttributes. */ typedef struct { const char *displayName; int logicalScreen; unsigned int screenWindowWidth; /* displayName's coordinate system */ unsigned int screenWindowHeight; /* displayName's coordinate system */ int screenWindowXoffset; /* displayName's coordinate system */ int screenWindowYoffset; /* displayName's coordinate system */ unsigned int rootWindowWidth; /* screenWindow's coordinate system */ unsigned int rootWindowHeight; /* screenWindow's coordinate system */ int rootWindowXoffset; /* screenWindow's coordinate system */ int rootWindowYoffset; /* screenWindow's coordinate system */ int rootWindowXorigin; /* global coordinate system */ int rootWindowYorigin; /* global coordinate system */ } DMXScreenAttributesRec, *DMXScreenAttributesPtr; /** Window attributes. Used by #ProcDMXGetWindowAttributes. */ typedef struct { int screen; Window window; xRectangle pos; xRectangle vis; } DMXWindowAttributesRec, *DMXWindowAttributesPtr; /** Desktop attributes. Used by #ProcDMXGetDesktopAttributes and * #ProcDMXChangeDesktopAttributes. */ typedef struct { int width; int height; int shiftX; int shiftY; } DMXDesktopAttributesRec, *DMXDesktopAttributesPtr; /** Input attributes. Used by #ProcDMXGetInputAttributes. */ typedef struct { const char *name; int inputType; int physicalScreen; int physicalId; int isCore; int sendsCore; int detached; } DMXInputAttributesRec, *DMXInputAttributesPtr; extern unsigned long dmxGetNumScreens(void); extern void dmxForceWindowCreation(WindowPtr pWindow); extern void dmxFlushPendingSyncs(void); extern Bool dmxGetScreenAttributes(int physical, DMXScreenAttributesPtr attr); extern Bool dmxGetWindowAttributes(WindowPtr pWindow, DMXWindowAttributesPtr attr); extern void dmxGetDesktopAttributes(DMXDesktopAttributesPtr attr); extern int dmxGetInputCount(void); extern int dmxGetInputAttributes(int deviceId, DMXInputAttributesPtr attr); extern int dmxAddInput(DMXInputAttributesPtr attr, int *deviceId); extern int dmxRemoveInput(int deviceId); extern int dmxConfigureScreenWindows(int nscreens, CARD32 *screens, DMXScreenAttributesPtr attribs, int *errorScreen); extern int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs); /* dmxUpdateScreenResources exposed for dmxCreateWindow in dmxwindow.c */ extern void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h); extern int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr); extern int dmxDetachScreen(int idx); #endif xorg-server-1.17.1/hw/dmx/dmxvisual.h0000664000175100017510000000327012274325511014410 00000000000000/* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * Interface for visual support. \see dmxvisual.c */ #ifndef DMXVISUAL_H #define DMXVISUAL_H #include "scrnintstr.h" extern Visual *dmxLookupVisual(ScreenPtr pScreen, VisualPtr pVisual); extern Visual *dmxLookupVisualFromID(ScreenPtr pScreen, VisualID vid); extern Colormap dmxColormapFromDefaultVisual(ScreenPtr pScreen, Visual * visual); #endif /* DMXVISUAL_H */ xorg-server-1.17.1/hw/dmx/dmxprop.h0000664000175100017510000000340212274325511014062 00000000000000/* * Copyright 2002,2003 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * Interface for property support. \see dmxprop.c */ #ifndef _DMXPROP_H_ #define _DMXPROP_H_ extern int dmxPropertyDisplay(DMXScreenInfo * dmxScreen); extern void dmxPropertyWindow(DMXScreenInfo * dmxScreen); extern void *dmxPropertyIterate(DMXScreenInfo * start, void *(*f) (DMXScreenInfo * dmxScreen, void *closure), void *closure); extern int dmxPropertySameDisplay(DMXScreenInfo * dmxScreen, const char *name); #endif xorg-server-1.17.1/hw/dmx/doc/0000775000175100017510000000000012466505444013056 500000000000000xorg-server-1.17.1/hw/dmx/doc/Makefile.am0000664000175100017510000000261012160102336015011 00000000000000# Copyright 2005 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 Red Hat # not be used in advertising or publicity pertaining to distribution # of the software without specific, written prior permission. Red # Hat makes no representations about the suitability of this software # for any purpose. It is provided "as is" without express or implied # warranty. # # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN # NO EVENT SHALL RED HAT 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. if ENABLE_DEVEL_DOCS if HAVE_XMLTO # Main DocBook/XML files (DOCTYPE book) docbook = dmx.xml scaled.xml # Generate DocBook/XML output formats with or without stylesheets include $(top_srcdir)/devbook.am endif HAVE_XMLTO endif ENABLE_DEVEL_DOCS EXTRA_DIST = DMXSpec.txt DMXSpec-v1.txt xorg-server-1.17.1/hw/dmx/doc/Makefile.in0000664000175100017510000006013112466505430015037 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright 2005 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 Red Hat # not be used in advertising or publicity pertaining to distribution # of the software without specific, written prior permission. Red # Hat makes no representations about the suitability of this software # for any purpose. It is provided "as is" without express or implied # warranty. # # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN # NO EVENT SHALL RED HAT 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. # # Generate output formats for a single DocBook/XML with/without chapters # # Variables set by the calling Makefile: # noinst_DATA: developers docs are not installed # docbook: the main DocBook/XML file, no chapters, appendix or image files # chapters: all files pulled in by an XInclude statement and images. # # # This makefile is intended for Developers Documentation and is not installed. # Do not use for Users docs or Specs which need to be installed and require olink support # Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 # for an explanation on documents classification. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/devbook.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(am__dist_noinst_DATA_DIST) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_1 = $(docbook:.xml=.html) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@am__append_2 = $(docbook:.xml=.txt) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_3 = $(docbook:.xml=.pdf) $(docbook:.xml=.ps) subdir = hw/dmx/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_noinst_DATA_DIST = dmx.xml scaled.xml DATA = $(dist_noinst_DATA) $(noinst_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ # Main DocBook/XML files (DOCTYPE book) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@docbook = dmx.xml scaled.xml # Developers documnetation is not installed @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@noinst_DATA = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_1) \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_2) \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_3) # DocBook/XML file with chapters, appendix and images it includes @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@dist_noinst_DATA = $(docbook) $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@FILTER_XMLTO = $(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_HTML_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_FO_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --stringparam img.src.path=$(abs_builddir)/ \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@CLEANFILES = $(noinst_DATA) # Generate DocBook/XML output formats with or without stylesheets EXTRA_DIST = DMXSpec.txt DMXSpec-v1.txt all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/devbook.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/dmx/doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/dmx/doc/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_srcdir)/devbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< # 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: xorg-server-1.17.1/hw/dmx/doc/dmx.xml0000664000175100017510000042327512160102336014305 00000000000000 %defs; ]>
Distributed Multihead X design Kevin E.Martin David H.Dawes Rickard E.Faith 29 June 2004 (created 25 July 2001) X Server Version &xserver.version; This document covers the motivation, background, design, and implementation of the distributed multihead X (DMX) system. It is a living document and describes the current design and implementation details of the DMX system. As the project progresses, this document will be continually updated to reflect the changes in the code and/or design. Copyright 2001 by VA Linux Systems, Inc., Fremont, California. Copyright 2001-2004 by Red Hat, Inc., Raleigh, North Carolina Introduction The Distributed Multihead X Server Current Open Source multihead solutions are limited to a single physical machine. A single X server controls multiple display devices, which can be arranged as independent heads or unified into a single desktop (with Xinerama). These solutions are limited to the number of physical devices that can co-exist in a single machine (e.g., due to the number of AGP/PCI slots available for graphics cards). Thus, large tiled displays are not currently possible. The work described in this paper will eliminate the requirement that the display devices reside in the same physical machine. This will be accomplished by developing a front-end proxy X server that will control multiple back-end X servers that make up the large display. The overall structure of the distributed multihead X (DMX) project is as follows: A single front-end X server will act as a proxy to a set of back-end X servers, which handle all of the visible rendering. X clients will connect to the front-end server just as they normally would to a regular X server. The front-end server will present an abstracted view to the client of a single large display. This will ensure that all standard X clients will continue to operate without modification (limited, as always, by the visuals and extensions provided by the X server). Clients that are DMX-aware will be able to use an extension to obtain information about the back-end servers (e.g., for placement of pop-up windows, window alignments by the window manager, etc.). The architecture of the DMX server is divided into two main sections: input (e.g., mouse and keyboard events) and output (e.g., rendering and windowing requests). Each of these are describe briefly below, and the rest of this design document will describe them in greater detail. The DMX server can receive input from three general types of input devices: "local" devices that are physically attached to the machine on which DMX is running, "backend" devices that are physically attached to one or more of the back-end X servers (and that generate events via the X protocol stream from the backend), and "console" devices that can be abstracted from any non-back-end X server. Backend and console devices are treated differently because the pointer device on the back-end X server also controls the location of the hardware X cursor. Full support for XInput extension devices is provided. Rendering requests will be accepted by the front-end server; however, rendering to visible windows will be broken down as needed and sent to the appropriate back-end server(s) via X11 library calls for actual rendering. The basic framework will follow a Xnest-style approach. GC state will be managed in the front-end server and sent to the appropriate back-end server(s) as required. Pixmap rendering will (at least initially) be handled by the front-end X server. Windowing requests (e.g., ordering, mapping, moving, etc.) will handled in the front-end server. If the request requires a visible change, the windowing operation will be translated into requests for the appropriate back-end server(s). Window state will be mirrored in the back-end server(s) as needed. Layout of Paper The next section describes the general development plan that was actually used for implementation. The final section discusses outstanding issues at the conclusion of development. The first appendix provides low-level technical detail that may be of interest to those intimately familiar with the X server architecture. The final appendix describes the four phases of development that were performed during the first two years of development. The final year of work was divided into 9 tasks that are not described in specific sections of this document. The major tasks during that time were the enhancement of the reconfiguration ability added in Phase IV, addition of support for a dynamic number of back-end displays (instead of a hard-coded limit), and the support for back-end display and input removal and addition. This work is mentioned in this paper, but is not covered in detail. Development plan This section describes the development plan from approximately June 2001 through July 2003. Bootstrap code To allow for rapid development of the DMX server by multiple developers during the first development stage, the problem will be broken down into three tasks: the overall DMX framework, back-end rendering services and input device handling services. However, before the work begins on these tasks, a simple framework that each developer could use was implemented to bootstrap the development effort. This framework renders to a single back-end server and provides dummy input devices (i.e., the keyboard and mouse). The simple back-end rendering service was implemented using the shadow framebuffer support currently available in the XFree86 environment. Using this bootstrapping framework, each developer has been able to work on each of the tasks listed above independently as follows: the framework will be extended to handle arbitrary back-end server configurations; the back-end rendering services will be transitioned to the more efficient Xnest-style implementation; and, an input device framework to handle various input devices via the input extension will be developed. Status: The boot strap code is complete. Input device handling An X server (including the front-end X server) requires two core input devices -- a keyboard and a pointer (mouse). These core devices are handled and required by the core X11 protocol. Additional types of input devices may be attached and utilized via the XInput extension. These are usually referred to as ``XInput extension devices'', There are some options as to how the front-end X server gets its core input devices: Local Input. The physical input devices (e.g., keyboard and mouse) can be attached directly to the front-end X server. In this case, the keyboard and mouse on the machine running the front-end X server will be used. The front-end will have drivers to read the raw input from those devices and convert it into the required X input events (e.g., key press/release, pointer button press/release, pointer motion). The front-end keyboard driver will keep track of keyboard properties such as key and modifier mappings, autorepeat state, keyboard sound and led state. Similarly the front-end pointer driver will keep track if pointer properties such as the button mapping and movement acceleration parameters. With this option, input is handled fully in the front-end X server, and the back-end X servers are used in a display-only mode. This option was implemented and works for a limited number of Linux-specific devices. Adding additional local input devices for other architectures is expected to be relatively simple. The following options are available for implementing local input devices: The XFree86 X server has modular input drivers that could be adapted for this purpose. The mouse driver supports a wide range of mouse types and interfaces, as well as a range of Operating System platforms. The keyboard driver in XFree86 is not currently as modular as the mouse driver, but could be made so. The XFree86 X server also has a range of other input drivers for extended input devices such as tablets and touch screens. Unfortunately, the XFree86 drivers are generally complex, often simultaneously providing support for multiple devices across multiple architectures; and rely so heavily on XFree86-specific helper-functions, that this option was not pursued. The kdrive X server in XFree86 has built-in drivers that support PS/2 mice and keyboard under Linux. The mouse driver can indirectly handle other mouse types if the Linux utility gpm is used as to translate the native mouse protocol into PS/2 mouse format. These drivers could be adapted and built in to the front-end X server if this range of hardware and OS support is sufficient. While much simpler than the XFree86 drivers, the kdrive drivers were not used for the DMX implementation. Reimplementation of keyboard and mouse drivers from scratch for the DMX framework. Because keyboard and mouse drivers are relatively trivial to implement, this pathway was selected. Other drivers in the X source tree were referenced, and significant contributions from other drivers are noted in the DMX source code. Backend Input. The front-end can make use of the core input devices attached to one or more of the back-end X servers. Core input events from multiple back-ends are merged into a single input event stream. This can work sanely when only a single set of input devices is used at any given time. The keyboard and pointer state will be handled in the front-end, with changes propagated to the back-end servers as needed. This option was implemented and works well. Because the core pointer on a back-end controls the hardware mouse on that back-end, core pointers cannot be treated as XInput extension devices. However, all back-end XInput extensions devices can be mapped to either DMX core or DMX XInput extension devices. Console Input. The front-end server could create a console window that is displayed on an X server independent of the back-end X servers. This console window could display things like the physical screen layout, and the front-end could get its core input events from events delivered to the console window. This option was implemented and works well. To help the human navigate, window outlines are also displayed in the console window. Further, console windows can be used as either core or XInput extension devices. Other options were initially explored, but they were all partial subsets of the options listed above and, hence, are irrelevant. Although extended input devices are not specifically mentioned in the Distributed X requirements, the options above were all implemented so that XInput extension devices were supported. The bootstrap code (Xdmx) had dummy input devices, and these are still supported in the final version. These do the necessary initialization to satisfy the X server's requirements for core pointer and keyboard devices, but no input events are ever generated. Status: The input code is complete. Because of the complexity of the XFree86 input device drivers (and their heavy reliance on XFree86 infrastructure), separate low-level device drivers were implemented for Xdmx. The following kinds of drivers are supported (in general, the devices can be treated arbitrarily as "core" input devices or as XInput "extension" devices; and multiple instances of different kinds of devices can be simultaneously available): A "dummy" device drive that never generates events. "Local" input is from the low-level hardware on which the Xdmx binary is running. This is the only area where using the XFree86 driver infrastructure would have been helpful, and then only partially, since good support for generic USB devices does not yet exist in XFree86 (in any case, XFree86 and kdrive driver code was used where possible). Currently, the following local devices are supported under Linux (porting to other operating systems should be fairly straightforward): Linux keyboard Linux serial mouse (MS) Linux PS/2 mouse USB keyboard USB mouse USB generic device (e.g., joystick, gamepad, etc.) "Backend" input is taken from one or more of the back-end displays. In this case, events are taken from the back-end X server and are converted to Xdmx events. Care must be taken so that the sprite moves properly on the display from which input is being taken. "Console" input is taken from an X window that Xdmx creates on the operator's display (i.e., on the machine running the Xdmx binary). When the operator's mouse is inside the console window, then those events are converted to Xdmx events. Several special features are available: the console can display outlines of windows that are on the Xdmx display (to facilitate navigation), the cursor can be confined to the console, and a "fine" mode can be activated to allow very precise cursor positioning. Output device handling The output of the DMX system displays rendering and windowing requests across multiple screens. The screens are typically arranged in a grid such that together they represent a single large display. The output section of the DMX code consists of two parts. The first is in the front-end proxy X server (Xdmx), which accepts client connections, manages the windows, and potentially renders primitives but does not actually display any of the drawing primitives. The second part is the back-end X server(s), which accept commands from the front-end server and display the results on their screens. Initialization The DMX front-end must first initialize its screens by connecting to each of the back-end X servers and collecting information about each of these screens. However, the information collected from the back-end X servers might be inconsistent. Handling these cases can be difficult and/or inefficient. For example, a two screen system has one back-end X server running at 16bpp while the second is running at 32bpp. Converting rendering requests (e.g., XPutImage() or XGetImage() requests) to the appropriate bit depth can be very time consuming. Analyzing these cases to determine how or even if it is possible to handle them is required. The current Xinerama code handles many of these cases (e.g., in PanoramiXConsolidate()) and will be used as a starting point. In general, the best solution is to use homogeneous X servers and display devices. Using back-end servers with the same depth is a requirement of the final DMX implementation. Once this screen consolidation is finished, the relative position of each back-end X server's screen in the unified screen is initialized. A full-screen window is opened on each of the back-end X servers, and the cursor on each screen is turned off. The final DMX implementation can also make use of a partial-screen window, or multiple windows per back-end screen. Handling rendering requests After initialization, X applications connect to the front-end server. There are two possible implementations of how rendering and windowing requests are handled in the DMX system: A shadow framebuffer is used in the front-end server as the render target. In this option, all protocol requests are completely handled in the front-end server. All state and resources are maintained in the front-end including a shadow copy of the entire framebuffer. The framebuffers attached to the back-end servers are updated by XPutImage() calls with data taken directly from the shadow framebuffer. This solution suffers from two main problems. First, it does not take advantage of any accelerated hardware available in the system. Second, the size of the XPutImage() calls can be quite large and thus will be limited by the bandwidth available. The initial DMX implementation used a shadow framebuffer by default. Rendering requests are sent to each back-end server for handling (as is done in the Xnest server described above). In this option, certain protocol requests are handled in the front-end server and certain requests are repackaged and then sent to the back-end servers. The framebuffer is distributed across the multiple back-end servers. Rendering to the framebuffer is handled on each back-end and can take advantage of any acceleration available on the back-end servers' graphics display device. State is maintained both in the front and back-end servers. This solution suffers from two main drawbacks. First, protocol requests are sent to all back-end servers -- even those that will completely clip the rendering primitive -- which wastes bandwidth and processing time. Second, state is maintained both in the front- and back-end servers. These drawbacks are not as severe as in option 1 (above) and can either be overcome through optimizations or are acceptable. Therefore, this option will be used in the final implementation. The final DMX implementation defaults to this mechanism, but also supports the shadow framebuffer mechanism. Several optimizations were implemented to eliminate the drawbacks of the default mechanism. These optimizations are described the section below and in Phase II of the Development Results (see appendix). Status: Both the shadow framebuffer and Xnest-style code is complete. Optimizing DMX Initially, the Xnest-style solution's performance will be measured and analyzed to determine where the performance bottlenecks exist. There are four main areas that will be addressed. First, to obtain reasonable interactivity with the first development phase, XSync() was called after each protocol request. The XSync() function flushes any pending protocol requests. It then waits for the back-end to process the request and send a reply that the request has completed. This happens with each back-end server and performance greatly suffers. As a result of the way XSync() is called in the first development phase, the batching that the X11 library performs is effectively defeated. The XSync() call usage will be analyzed and optimized by batching calls and performing them at regular intervals, except where interactivity will suffer (e.g., on cursor movements). Second, the initial Xnest-style solution described above sends the repackaged protocol requests to all back-end servers regardless of whether or not they would be completely clipped out. The requests that are trivially rejected on the back-end server wastes the limited bandwidth available. By tracking clipping changes in the DMX X server's windowing code (e.g., by opening, closing, moving or resizing windows), we can determine whether or not back-end windows are visible so that trivial tests in the front-end server's GC ops drawing functions can eliminate these unnecessary protocol requests. Third, each protocol request will be analyzed to determine if it is possible to break the request into smaller pieces at display boundaries. The initial ones to be analyzed are put and get image requests since they will require the greatest bandwidth to transmit data between the front and back-end servers. Other protocol requests will be analyzed and those that will benefit from breaking them into smaller requests will be implemented. Fourth, an extension is being considered that will allow font glyphs to be transferred from the front-end DMX X server to each back-end server. This extension will permit the front-end to handle all font requests and eliminate the requirement that all back-end X servers share the exact same fonts as the front-end server. We are investigating the feasibility of this extension during this development phase. Other potential optimizations will be determined from the performance analysis. Please note that in our initial design, we proposed optimizing BLT operations (e.g., XCopyArea() and window moves) by developing an extension that would allow individual back-end servers to directly copy pixel data to other back-end servers. This potential optimization was in response to the simple image movement implementation that required potentially many calls to GetImage() and PutImage(). However, the current Xinerama implementation handles these BLT operations differently. Instead of copying data to and from screens, they generate expose events -- just as happens in the case when a window is moved from off a screen to on screen. This approach saves the limited bandwidth available between front and back-end servers and is being standardized with Xinerama. It also eliminates the potential setup problems and security issues resulting from having each back-end server open connections to all other back-end servers. Therefore, we suggest accepting Xinerama's expose event solution. Also note that the approach proposed in the second and third optimizations might cause backing store algorithms in the back-end to be defeated, so a DMX X server configuration flag will be added to disable these optimizations. Status: The optimizations proposed above are complete. It was determined that the using the xfs font server was sufficient and creating a new mechanism to pass glyphs was redundant; therefore, the fourth optimization proposed above was not included in DMX. DMX X extension support The DMX X server keeps track of all the windowing information on the back-end X servers, but does not currently export this information to any client applications. An extension will be developed to pass the screen information and back-end window IDs to DMX-aware clients. These clients can then use this information to directly connect to and render to the back-end windows. Bypassing the DMX X server allows DMX-aware clients to break up complex rendering requests on their own and send them directly to the windows on the back-end server's screens. An example of a client that can make effective use of this extension is Chromium. Status: The extension, as implemented, is fully documented in "Client-to-Server DMX Extension to the X Protocol". Future changes might be required based on feedback and other proposed enhancements to DMX. Currently, the following facilities are supported: Screen information (clipping rectangle for each screen relative to the virtual screen) Window information (window IDs and clipping information for each back-end window that corresponds to each DMX window) Input device information (mappings from DMX device IDs to back-end device IDs) Force window creation (so that a client can override the server-side lazy window creation optimization) Reconfiguration (so that a client can request that a screen position be changed) Addition and removal of back-end servers and back-end and console inputs. Common X extension support The XInput, XKeyboard and Shape extensions are commonly used extensions to the base X11 protocol. XInput allows multiple and non-standard input devices to be accessed simultaneously. These input devices can be connected to either the front-end or back-end servers. XKeyboard allows much better keyboard mappings control. Shape adds support for arbitrarily shaped windows and is used by various window managers. Nearly all potential back-end X servers make these extensions available, and support for each one will be added to the DMX system. In addition to the extensions listed above, support for the X Rendering extension (Render) is being developed. Render adds digital image composition to the rendering model used by the X Window System. While this extension is still under development by Keith Packard of HP, support for the current version will be added to the DMX system. Support for the XTest extension was added during the first development phase. Status: The following extensions are supported and are discussed in more detail in Phase IV of the Development Results (see appendix): BIG-REQUESTS, DEC-XTRAP, DMX, DPMS, Extended-Visual-Information, GLX, LBX, RECORD, RENDER, SECURITY, SHAPE, SYNC, X-Resource, XC-APPGROUP, XC-MISC, XFree86-Bigfont, XINERAMA, XInputExtension, XKEYBOARD, and XTEST. OpenGL support OpenGL support using the Mesa code base exists in XFree86 release 4 and later. Currently, the direct rendering infrastructure (DRI) provides accelerated OpenGL support for local clients and unaccelerated OpenGL support (i.e., software rendering) is provided for non-local clients. The single head OpenGL support in XFree86 4.x will be extended to use the DMX system. When the front and back-end servers are on the same physical hardware, it is possible to use the DRI to directly render to the back-end servers. First, the existing DRI will be extended to support multiple display heads, and then to support the DMX system. OpenGL rendering requests will be direct rendering to each back-end X server. The DRI will request the screen layout (either from the existing Xinerama extension or a DMX-specific extension). Support for synchronized swap buffers will also be added (on hardware that supports it). Note that a single front-end server with a single back-end server on the same physical machine can emulate accelerated indirect rendering. When the front and back-end servers are on different physical hardware or are using non-XFree86 4.x X servers, a mechanism to render primitives across the back-end servers will be provided. There are several options as to how this can be implemented. The existing OpenGL support in each back-end server can be used by repackaging rendering primitives and sending them to each back-end server. This option is similar to the unoptimized Xnest-style approach mentioned above. Optimization of this solution is beyond the scope of this project and is better suited to other distributed rendering systems. Rendering to a pixmap in the front-end server using the current XFree86 4.x code, and then displaying to the back-ends via calls to XPutImage() is another option. This option is similar to the shadow frame buffer approach mentioned above. It is slower and bandwidth intensive, but has the advantage that the back-end servers are not required to have OpenGL support. These, and other, options will be investigated in this phase of the work. Work by others have made Chromium DMX-aware. Chromium will use the DMX X protocol extension to obtain information about the back-end servers and will render directly to those servers, bypassing DMX. Status: OpenGL support by the glxProxy extension was implemented by SGI and has been integrated into the DMX code base. Current issues In this sections the current issues are outlined that require further investigation. Fonts The font path and glyphs need to be the same for the front-end and each of the back-end servers. Font glyphs could be sent to the back-end servers as necessary but this would consume a significant amount of available bandwidth during font rendering for clients that use many different fonts (e.g., Netscape). Initially, the font server (xfs) will be used to provide the fonts to both the front-end and back-end servers. Other possibilities will be investigated during development. Zero width rendering primitives To allow pixmap and on-screen rendering to be pixel perfect, all back-end servers must render zero width primitives exactly the same as the front-end renders the primitives to pixmaps. For those back-end servers that do not exactly match, zero width primitives will be automatically converted to one width primitives. This can be handled in the front-end server via the GC state. Output scaling With very large tiled displays, it might be difficult to read the information on the standard X desktop. In particular, the cursor can be easily lost and fonts could be difficult to read. Automatic primitive scaling might prove to be very useful. We will investigate the possibility of scaling the cursor and providing a set of alternate pre-scaled fonts to replace the standard fonts that many applications use (e.g., fixed). Other options for automatic scaling will also be investigated. Per-screen colormaps Each screen's default colormap in the set of back-end X servers should be able to be adjusted via a configuration utility. This support is would allow the back-end screens to be calibrated via custom gamma tables. On 24-bit systems that support a DirectColor visual, this type of correction can be accommodated. One possible implementation would be to advertise to X client of the DMX server a TrueColor visual while using DirectColor visuals on the back-end servers to implement this type of color correction. Other options will be investigated. Appendix Background This section describes the existing Open Source architectures that can be used to handle multiple screens and upon which this development project is based. This section was written before the implementation was finished, and may not reflect actual details of the implementation. It is left for historical interest only. Core input device handling The following is a description of how core input devices are handled by an X server. InitInput() InitInput() is a DDX function that is called at the start of each server generation from the X server's main() function. Its purpose is to determine what input devices are connected to the X server, register them with the DIX and MI layers, and initialize the input event queue. InitInput() does not have a return value, but the X server will abort if either a core keyboard device or a core pointer device are not registered. Extended input (XInput) devices can also be registered in InitInput(). InitInput() usually has implementation specific code to determine which input devices are available. For each input device it will be using, it calls AddInputDevice(): AddInputDevice() This DIX function allocates the device structure, registers a callback function (which handles device init, close, on and off), and returns the input handle, which can be treated as opaque. It is called once for each input device. Once input handles for core keyboard and core pointer devices have been obtained from AddInputDevice(). If both core devices are not registered, then the X server will exit with a fatal error when it attempts to start the input devices in InitAndStartDevices(), which is called directly after InitInput() (see below). The core pointer device is then registered with the miPointer code (which does the high level cursor handling). While this registration is not necessary for correct miPointer operation in the current XFree86 code, it is still done mostly for compatibility reasons. miRegisterPointerDevice() This MI function registers the core pointer's input handle with with the miPointer code. The final part of InitInput() is the initialization of the input event queue handling. In most cases, the event queue handling provided in the MI layer is used. The primary XFree86 X server uses its own event queue handling to support some special cases related to the XInput extension and the XFree86-specific DGA extension. For our purposes, the MI event queue handling should be suitable. It is initialized by calling mieqInit(): mieqInit() This MI function initializes the MI event queue for the core devices, and is passed the public component of the input handles for the two core devices. If a wakeup handler is required to deliver synchronous input events, it can be registered here by calling the DIX function RegisterBlockAndWakeupHandlers(). (See the devReadInput() description below.) InitAndStartDevices() InitAndStartDevices() is a DIX function that is called immediately after InitInput() from the X server's main() function. Its purpose is to initialize each input device that was registered with AddInputDevice(), enable each input device that was successfully initialized, and create the list of enabled input devices. Once each registered device is processed in this way, the list of enabled input devices is checked to make sure that both a core keyboard device and core pointer device were registered and successfully enabled. If not, InitAndStartDevices() returns failure, and results in the the X server exiting with a fatal error. Each registered device is initialized by calling its callback (dev->deviceProc) with the DEVICE_INIT argument: (*dev->deviceProc)(dev, DEVICE_INIT) This function initializes the device structs with core information relevant to the device. For pointer devices, this means specifying the number of buttons, default button mapping, the function used to get motion events (usually miPointerGetMotionEvents()), the function used to change/control the core pointer motion parameters (acceleration and threshold), and the motion buffer size. For keyboard devices, this means specifying the keycode range, default keycode to keysym mapping, default modifier mapping, and the functions used to sound the keyboard bell and modify/control the keyboard parameters (LEDs, bell pitch and duration, key click, which keys are auto-repeating, etc). Each initialized device is enabled by calling EnableDevice(): EnableDevice() EnableDevice() calls the device callback with DEVICE_ON: (*dev->deviceProc)(dev, DEVICE_ON) This typically opens and initializes the relevant physical device, and when appropriate, registers the device's file descriptor (or equivalent) as a valid input source. EnableDevice() then adds the device handle to the X server's global list of enabled devices. InitAndStartDevices() then verifies that a valid core keyboard and pointer has been initialized and enabled. It returns failure if either are missing. devReadInput() Each device will have some function that gets called to read its physical input. These may be called in a number of different ways. In the case of synchronous I/O, they will be called from a DDX wakeup-handler that gets called after the server detects that new input is available. In the case of asynchronous I/O, they will be called from a (SIGIO) signal handler triggered when new input is available. This function should do at least two things: make sure that input events get enqueued, and make sure that the cursor gets moved for motion events (except if these are handled later by the driver's own event queue processing function, which cannot be done when using the MI event queue handling). Events are queued by calling mieqEnqueue(): mieqEnqueue() This MI function is used to add input events to the event queue. It is simply passed the event to be queued. The cursor position should be updated when motion events are enqueued by calling miPointerDeltaCursor(): miPointerDeltaCursor() This MI function is used to move the cursor relative to its current position. ProcessInputEvents() ProcessInputEvents() is a DDX function that is called from the X server's main dispatch loop when new events are available in the input event queue. It typically processes the enqueued events, and updates the cursor/pointer position. It may also do other DDX-specific event processing. Enqueued events are processed by mieqProcessInputEvents() and passed to the DIX layer for transmission to clients: mieqProcessInputEvents() This function processes each event in the event queue, and passes it to the device's input processing function. The DIX layer provides default functions to do this processing, and they handle the task of getting the events passed back to the relevant clients. miPointerUpdate() This function resynchronized the cursor position with the new pointer position. It also takes care of moving the cursor between screens when needed in multi-head configurations. DisableDevice() DisableDevice is a DIX function that removes an input device from the list of enabled devices. The result of this is that the device no longer generates input events. The device's data structures are kept in place, and disabling a device like this can be reversed by calling EnableDevice(). DisableDevice() may be called from the DDX when it is desirable to do so (e.g., the XFree86 server does this when VT switching). Except for special cases, this is not normally called for core input devices. DisableDevice() calls the device's callback function with DEVICE_OFF: (*dev->deviceProc)(dev, DEVICE_OFF) This typically closes the relevant physical device, and when appropriate, unregisters the device's file descriptor (or equivalent) as a valid input source. DisableDevice() then removes the device handle from the X server's global list of enabled devices. CloseDevice() CloseDevice is a DIX function that removes an input device from the list of available devices. It disables input from the device and frees all data structures associated with the device. This function is usually called from CloseDownDevices(), which is called from main() at the end of each server generation to close all input devices. CloseDevice() calls the device's callback function with DEVICE_CLOSE: (*dev->deviceProc)(dev, DEVICE_CLOSE) This typically closes the relevant physical device, and when appropriate, unregisters the device's file descriptor (or equivalent) as a valid input source. If any device specific data structures were allocated when the device was initialized, they are freed here. CloseDevice() then frees the data structures that were allocated for the device when it was registered/initialized. LegalModifier() LegalModifier() is a required DDX function that can be used to restrict which keys may be modifier keys. This seems to be present for historical reasons, so this function should simply return TRUE unconditionally. Output handling The following sections describe the main functions required to initialize, use and close the output device(s) for each screen in the X server. InitOutput() This DDX function is called near the start of each server generation from the X server's main() function. InitOutput()'s main purpose is to initialize each screen and fill in the global screenInfo structure for each screen. It is passed three arguments: a pointer to the screenInfo struct, which it is to initialize, and argc and argv from main(), which can be used to determine additional configuration information. The primary tasks for this function are outlined below: Parse configuration info: The first task of InitOutput() is to parses any configuration information from the configuration file. In addition to the XF86Config file, other configuration information can be taken from the command line. The command line options can be gathered either in InitOutput() or earlier in the ddxProcessArgument() function, which is called by ProcessCommandLine(). The configuration information determines the characteristics of the screen(s). For example, in the XFree86 X server, the XF86Config file specifies the monitor information, the screen resolution, the graphics devices and slots in which they are located, and, for Xinerama, the screens' layout. Initialize screen info: The next task is to initialize the screen-dependent internal data structures. For example, part of what the XFree86 X server does is to allocate its screen and pixmap private indices, probe for graphics devices, compare the probed devices to the ones listed in the XF86Config file, and add the ones that match to the internal xf86Screens[] structure. Set pixmap formats: The next task is to initialize the screenInfo's image byte order, bitmap bit order and bitmap scanline unit/pad. The screenInfo's pixmap format's depth, bits per pixel and scanline padding is also initialized at this stage. Unify screen info: An optional task that might be done at this stage is to compare all of the information from the various screens and determines if they are compatible (i.e., if the set of screens can be unified into a single desktop). This task has potential to be useful to the DMX front-end server, if Xinerama's PanoramiXConsolidate() function is not sufficient. Once these tasks are complete, the valid screens are known and each of these screens can be initialized by calling AddScreen(). AddScreen() This DIX function is called from InitOutput(), in the DDX layer, to add each new screen to the screenInfo structure. The DDX screen initialization function and command line arguments (i.e., argc and argv) are passed to it as arguments. This function first allocates a new Screen structure and any privates that are required. It then initializes some of the fields in the Screen struct and sets up the pixmap padding information. Finally, it calls the DDX screen initialization function ScreenInit(), which is described below. It returns the number of the screen that were just added, or -1 if there is insufficient memory to add the screen or if the DDX screen initialization fails. ScreenInit() This DDX function initializes the rest of the Screen structure with either generic or screen-specific functions (as necessary). It also fills in various screen attributes (e.g., width and height in millimeters, black and white pixel values). The screen init function usually calls several functions to perform certain screen initialization functions. They are described below: {mi,*fb}ScreenInit() The DDX layer's ScreenInit() function usually calls another layer's ScreenInit() function (e.g., miScreenInit() or fbScreenInit()) to initialize the fallbacks that the DDX driver does not specifically handle. After calling another layer's ScreenInit() function, any screen-specific functions either wrap or replace the other layer's function pointers. If a function is to be wrapped, each of the old function pointers from the other layer are stored in a screen private area. Common functions to wrap are CloseScreen() and SaveScreen(). miDCInitialize() This MI function initializes the MI cursor display structures and function pointers. If a hardware cursor is used, the DDX layer's ScreenInit() function will wrap additional screen and the MI cursor display function pointers. Another common task for ScreenInit() function is to initialize the output device state. For example, in the XFree86 X server, the ScreenInit() function saves the original state of the video card and then initializes the video mode of the graphics device. CloseScreen() This function restores any wrapped screen functions (and in particular the wrapped CloseScreen() function) and restores the state of the output device to its original state. It should also free any private data it created during the screen initialization. GC operations When the X server is requested to render drawing primitives, it does so by calling drawing functions through the graphics context's operation function pointer table (i.e., the GCOps functions). These functions render the basic graphics operations such as drawing rectangles, lines, text or copying pixmaps. Default routines are provided either by the MI layer, which draws indirectly through a simple span interface, or by the framebuffer layers (e.g., CFB, MFB, FB), which draw directly to a linearly mapped frame buffer. To take advantage of special hardware on the graphics device, specific GCOps functions can be replaced by device specific code. However, many times the graphics devices can handle only a subset of the possible states of the GC, so during graphics context validation, appropriate routines are selected based on the state and capabilities of the hardware. For example, some graphics hardware can accelerate single pixel width lines with certain dash patterns. Thus, for dash patterns that are not supported by hardware or for width 2 or greater lines, the default routine is chosen during GC validation. Note that some pointers to functions that draw to the screen are stored in the Screen structure. They include GetImage(), GetSpans(), CopyWindow() and RestoreAreas(). Xnest The Xnest X server is a special proxy X server that relays the X protocol requests that it receives to a ``real'' X server that then processes the requests and displays the results, if applicable. To the X applications, Xnest appears as if it is a regular X server. However, Xnest is both server to the X application and client of the real X server, which will actually handle the requests. The Xnest server implements all of the standard input and output initialization steps outlined above. InitOutput() Xnest takes its configuration information from command line arguments via ddxProcessArguments(). This information includes the real X server display to connect to, its default visual class, the screen depth, the Xnest window's geometry, etc. Xnest then connects to the real X server and gathers visual, colormap, depth and pixmap information about that server's display, creates a window on that server, which will be used as the root window for Xnest. Next, Xnest initializes its internal data structures and uses the data from the real X server's pixmaps to initialize its own pixmap formats. Finally, it calls AddScreen(xnestOpenScreen, argc, argv) to initialize each of its screens. ScreenInit() 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 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. CloseScreen() This function frees its internal data structure allocations. Since it replaces instead of wrapping screen functions, there are no function pointers to unwrap. This can potentially lead to problems during server regeneration. GC operations The GC operations in Xnest are very simple since they leave all of the drawing to the real X server to which Xnest is attached. Each of the GCOps takes the request and sends it to the real X server using standard Xlib calls. For example, the X application issues a XDrawLines() call. This function turns into a protocol request to Xnest, which calls the xnestPolylines() function through Xnest's GCOps function pointer table. The xnestPolylines() function is only a single line, which calls XDrawLines() using the same arguments that were passed into it. Other GCOps functions are very similar. Two exceptions to the simple GCOps functions described above are the image functions and the BLT operations. The image functions, GetImage() and PutImage(), must use a temporary image to hold the image to be put of the image that was just grabbed from the screen while it is in transit to the real X server or the client. When the image has been transmitted, the temporary image is destroyed. The BLT operations, CopyArea() and CopyPlane(), handle not only the copy function, which is the same as the simple cases described above, but also the graphics exposures that result when the GC's graphics exposure bit is set to True. Graphics exposures are handled in a helper function, xnestBitBlitHelper(). This function collects the exposure events from the real X server and, if any resulting in regions being exposed, then those regions are passed back to the MI layer so that it can generate exposure events for the X application. The Xnest server takes its input from the X server to which it is connected. When the mouse is in the Xnest server's window, keyboard and mouse events are received by the Xnest server, repackaged and sent back to any client that requests those events. Shadow framebuffer The most common type of framebuffer is a linear array memory that maps to the video memory on the graphics device. However, accessing that video memory over an I/O bus (e.g., ISA or PCI) can be slow. The shadow framebuffer layer allows the developer to keep the entire framebuffer in main memory and copy it back to video memory at regular intervals. It also has been extended to handle planar video memory and rotated framebuffers. There are two main entry points to the shadow framebuffer code: shadowAlloc(width, height, bpp) This function allocates the in memory copy of the framebuffer of size width*height*bpp. It returns a pointer to that memory, which will be used by the framebuffer ScreenInit() code during the screen's initialization. shadowInit(pScreen, updateProc, windowProc) This function initializes the shadow framebuffer layer. It wraps several screen drawing functions, and registers a block handler that will update the screen. The updateProc is a function that will copy the damaged regions to the screen, and the windowProc is a function that is used when the entire linear video memory range cannot be accessed simultaneously so that only a window into that memory is available (e.g., when using the VGA aperture). The shadow framebuffer code keeps track of the damaged area of each screen by calculating the bounding box of all drawing operations that have occurred since the last screen update. Then, when the block handler is next called, only the damaged portion of the screen is updated. Note that since the shadow framebuffer is kept in main memory, all drawing operations are performed by the CPU and, thus, no accelerated hardware drawing operations are possible. Xinerama Xinerama is an X extension that allows multiple physical screens controlled by a single X server to appear as a single screen. Although the extension allows clients to find the physical screen layout via extension requests, it is completely transparent to clients at the core X11 protocol level. The original public implementation of Xinerama came from Digital/Compaq. XFree86 rewrote it, filling in some missing pieces and improving both X11 core protocol compliance and performance. The Xinerama extension will be passing through X.Org's standardization process in the near future, and the sample implementation will be based on this rewritten version. The current implementation of Xinerama is based primarily in the DIX (device independent) and MI (machine independent) layers of the X server. With few exceptions the DDX layers do not need any changes to support Xinerama. X server extensions often do need modifications to provide full Xinerama functionality. The following is a code-level description of how Xinerama functions. Note: Because the Xinerama extension was originally called the PanoramiX extension, many of the Xinerama functions still have the PanoramiX prefix. PanoramiXExtensionInit() PanoramiXExtensionInit() is a device-independent extension function that is called at the start of each server generation from InitExtensions(), which is called from the X server's main() function after all output devices have been initialized, but before any input devices have been initialized. PanoramiXNumScreens is set to the number of physical screens. If only one physical screen is present, the extension is disabled, and PanoramiXExtensionInit() returns without doing anything else. The Xinerama extension is registered by calling AddExtension(). GC and Screen private indexes are allocated, and both GC and Screen private areas are allocated for each physical screen. These hold Xinerama-specific per-GC and per-Screen data. Each screen's CreateGC and CloseScreen functions are wrapped by XineramaCreateGC() and XineramaCloseScreen() respectively. Some new resource classes are created for Xinerama drawables and GCs, and resource types for Xinerama windows, pixmaps and colormaps. A region (PanoramiXScreenRegion) is initialized to be the union of the screen regions. The relative positioning information for the physical screens is taken from the ScreenRec x and y members, which the DDX layer must initialize in InitOutput(). The bounds of the combined screen is also calculated (PanoramiXPixWidth and PanoramiXPixHeight). The DIX layer has a list of function pointers (ProcVector[]) that holds the entry points for the functions that process core protocol requests. The requests that Xinerama must intercept and break up into physical screen-specific requests are wrapped. The original set is copied to SavedProcVector[]. The types of requests intercepted are Window requests, GC requests, colormap requests, drawing requests, and some geometry-related requests. This wrapping allows the bulk of the protocol request processing to be handled transparently to the DIX layer. Some operations cannot be dealt with in this way and are handled with Xinerama-specific code within the DIX layer. PanoramiXConsolidate() PanoramiXConsolidate() is a device-independent extension function that is called directly from the X server's main() function after extensions and input/output devices have been initialized, and before the root windows are defined and initialized. This function finds the set of depths (PanoramiXDepths[]) and visuals (PanoramiXVisuals[]) common to all of the physical screens. PanoramiXNumDepths is set to the number of common depths, and PanoramiXNumVisuals is set to the number of common visuals. Resources are created for the single root window and the default colormap. Each of these resources has per-physical screen entries. PanoramiXCreateConnectionBlock() PanoramiXConsolidate() is a device-independent extension function that is called directly from the X server's main() function after the per-physical screen root windows are created. It is called instead of the standard DIX CreateConnectionBlock() function. If this function returns FALSE, the X server exits with a fatal error. This function will return FALSE if no common depths were found in PanoramiXConsolidate(). With no common depths, Xinerama mode is not possible. The connection block holds the information that clients get when they open a connection to the X server. It includes information such as the supported pixmap formats, number of screens and the sizes, depths, visuals, default colormap information, etc, for each of the screens (much of information that xdpyinfo shows). The connection block is initialized with the combined single screen values that were calculated in the above two functions. The Xinerama extension allows the registration of connection block callback functions. The purpose of these is to allow other extensions to do processing at this point. These callbacks can be registered by calling XineramaRegisterConnectionBlockCallback() from the other extension's ExtensionInit() function. Each registered connection block callback is called at the end of PanoramiXCreateConnectionBlock(). Xinerama-specific changes to the DIX code There are a few types of Xinerama-specific changes within the DIX code. The main ones are described here. Functions that deal with colormap or GC -related operations outside of the intercepted protocol requests have a test added to only do the processing for screen numbers > 0. This is because they are handled for the single Xinerama screen and the processing is done once for screen 0. The handling of motion events does some coordinate translation between the physical screen's origin and screen zero's origin. Also, motion events must be reported relative to the composite screen origin rather than the physical screen origins. There is some special handling for cursor, window and event processing that cannot (either not at all or not conveniently) be done via the intercepted protocol requests. A particular case is the handling of pointers moving between physical screens. Xinerama-specific changes to the MI code The only Xinerama-specific change to the MI code is in miSendExposures() to handle the coordinate (and window ID) translation for expose events. Intercepted DIX core requests Xinerama breaks up drawing requests for dispatch to each physical screen. It also breaks up windows into pieces for each physical screen. GCs are translated into per-screen GCs. Colormaps are replicated on each physical screen. The functions handling the intercepted requests take care of breaking the requests and repackaging them so that they can be passed to the standard request handling functions for each screen in turn. In addition, and to aid the repackaging, the information from many of the intercepted requests is used to keep up to date the necessary state information for the single composite screen. Requests (usually those with replies) that can be satisfied completely from this stored state information do not call the standard request handling functions. Development Results In this section the results of each phase of development are discussed. This development took place between approximately June 2001 and July 2003. Phase I The initial development phase dealt with the basic implementation including the bootstrap code, which used the shadow framebuffer, and the unoptimized implementation, based on an Xnest-style implementation. Scope The goal of Phase I is to provide fundamental functionality that can act as a foundation for ongoing work: Develop the proxy X server The proxy X server will operate on the X11 protocol and relay requests as necessary to correctly perform the request. Work will be based on the existing work for Xinerama and Xnest. Input events and windowing operations are handled in the proxy server and rendering requests are repackaged and sent to each of the back-end servers for display. The multiple screen layout (including support for overlapping screens) will be user configurable via a configuration file or through the configuration tool. Develop graphical configuration tool There will be potentially a large number of X servers to configure into a single display. The tool will allow the user to specify which servers are involved in the configuration and how they should be laid out. Pass the X Test Suite The X Test Suite covers the basic X11 operations. All tests known to succeed must correctly operate in the distributed X environment. For this phase, the back-end X servers are assumed to be unmodified X servers that do not support any DMX-related protocol extensions; future optimization pathways are considered, but are not implemented; and the configuration tool is assumed to rely only on libraries in the X source tree (e.g., Xt). Results The proxy X server, Xdmx, was developed to distribute X11 protocol requests to the set of back-end X servers. It opens a window on each back-end server, which represents the part of the front-end's root window that is visible on that screen. It mirrors window, pixmap and other state in each back-end server. Drawing requests are sent to either windows or pixmaps on each back-end server. This code is based on Xnest and uses the existing Xinerama extension. Input events can be taken from (1) devices attached to the back-end server, (2) core devices attached directly to the Xdmx server, or (3) from a ``console'' window on another X server. Events for these devices are gathered, processed and delivered to clients attached to the Xdmx server. An intuitive configuration format was developed to help the user easily configure the multiple back-end X servers. It was defined (see grammar in Xdmx man page) and a parser was implemented that is used by the Xdmx server and by a standalone xdmxconfig utility. The parsing support was implemented such that it can be easily factored out of the X source tree for use with other tools (e.g., vdl). Support for converting legacy vdl-format configuration files to the DMX format is provided by the vdltodmx utility. Originally, the configuration file was going to be a subsection of XFree86's XF86Config file, but that was not possible since Xdmx is a completely separate X server. Thus, a separate config file format was developed. In addition, a graphical configuration tool, xdmxconfig, was developed to allow the user to create and arrange the screens in the configuration file. The -configfile and -config command-line options can be used to start Xdmx using a configuration file. An extension that enables remote input testing is required for the X Test Suite to function. During this phase, this extension (XTEST) was implemented in the Xdmx server. The results from running the X Test Suite are described in detail below. X Test Suite Introduction The X Test Suite contains tests that verify Xlib functions operate correctly. The test suite is designed to run on a single X server; however, since X applications will not be able to tell the difference between the DMX server and a standard X server, the X Test Suite should also run on the DMX server. The Xdmx server was tested with the X Test Suite, and the existing failures are noted in this section. To put these results in perspective, we first discuss expected X Test failures and how errors in underlying systems can impact Xdmx test results. Expected Failures for a Single Head A correctly implemented X server with a single screen is expected to fail certain X Test tests. The following well-known errors occur because of rounding error in the X server code: XDrawArc: Tests 42, 63, 66, 73 XDrawArcs: Tests 45, 66, 69, 76 The following failures occur because of the high-level X server implementation: XLoadQueryFont: Test 1 XListFontsWithInfo: Tests 3, 4 XQueryFont: Tests 1, 2 The following test fails when running the X server as root under Linux because of the way directory modes are interpreted: XWriteBitmapFile: Test 3 Depending on the video card used for the back-end, other failures may also occur because of bugs in the low-level driver implementation. Over time, failures of this kind are usually fixed by XFree86, but will show up in Xdmx testing until then. Expected Failures for Xinerama Xinerama fails several X Test Suite tests because of design decisions made for the current implementation of Xinerama. Over time, many of these errors will be corrected by XFree86 and the group working on a new Xinerama implementation. Therefore, Xdmx will also share X Suite Test failures with Xinerama. We may be able to fix or work-around some of these failures at the Xdmx level, but this will require additional exploration that was not part of Phase I. Xinerama is constantly improving, and the list of Xinerama-related failures depends on XFree86 version and the underlying graphics hardware. We tested with a variety of hardware, including nVidia, S3, ATI Radeon, and Matrox G400 (in dual-head mode). The list below includes only those failures that appear to be from the Xinerama layer, and does not include failures listed in the previous section, or failures that appear to be from the low-level graphics driver itself: These failures were noted with multiple Xinerama configurations: XCopyPlane: Tests 13, 22, 31 (well-known Xinerama implementation issue) XSetFontPath: Test 4 XGetDefault: Test 5 XMatchVisualInfo: Test 1 These failures were noted only when using one dual-head video card with a 4.2.99.x XFree86 server: XListPixmapFormats: Test 1 XDrawRectangles: Test 45 These failures were noted only when using two video cards from different vendors with a 4.1.99.x XFree86 server: XChangeWindowAttributes: Test 32 XCreateWindow: Test 30 XDrawLine: Test 22 XFillArc: Test 22 XChangeKeyboardControl: Tests 9, 10 XRebindKeysym: Test 1 Additional Failures from Xdmx When running Xdmx, no unexpected failures were noted. Since the Xdmx server is based on Xinerama, we expect to have most of the Xinerama failures present in the Xdmx server. Similarly, since the Xdmx server must rely on the low-level device drivers on each back-end server, we also expect that Xdmx will exhibit most of the back-end failures. Here is a summary: XListPixmapFormats: Test 1 (configuration dependent) XChangeWindowAttributes: Test 32 XCreateWindow: Test 30 XCopyPlane: Test 13, 22, 31 XSetFontPath: Test 4 XGetDefault: Test 5 (configuration dependent) XMatchVisualInfo: Test 1 XRebindKeysym: Test 1 (configuration dependent) Note that this list is shorter than the combined list for Xinerama because Xdmx uses different code paths to perform some Xinerama operations. Further, some Xinerama failures have been fixed in the XFree86 4.2.99.x CVS repository. Summary and Future Work Running the X Test Suite on Xdmx does not produce any failures that cannot be accounted for by the underlying Xinerama subsystem used by the front-end or by the low-level device-driver code running on the back-end X servers. The Xdmx server therefore is as ``correct'' as possible with respect to the standard set of X Test Suite tests. During the following phases, we will continue to verify Xdmx correctness using the X Test Suite. We may also use other tests suites or write additional tests that run under the X Test Suite that specifically verify the expected behavior of DMX. Fonts In Phase I, fonts are handled directly by both the front-end and the back-end servers, which is required since we must treat each back-end server during this phase as a ``black box''. What this requires is that the front- and back-end servers must share the exact same font path. There are two ways to help make sure that all servers share the same font path: First, each server can be configured to use the same font server. The font server, xfs, can be configured to serve fonts to multiple X servers via TCP. Second, each server can be configured to use the same font path and either those font paths can be copied to each back-end machine or they can be mounted (e.g., via NFS) on each back-end machine. One additional concern is that a client program can set its own font path, and if it does so, then that font path must be available on each back-end machine. The -fontpath command line option was added to allow users to initialize the font path of the front end server. This font path is propagated to each back-end server when the default font is loaded. If there are any problems, an error message is printed, which will describe the problem and list the current font path. For more information about setting the font path, see the -fontpath option description in the man page. Performance Phase I of development was not intended to optimize performance. Its focus was on completely and correctly handling the base X11 protocol in the Xdmx server. However, several insights were gained during Phase I, which are listed here for reference during the next phase of development. Calls to XSync() can slow down rendering since it requires a complete round trip to and from a back-end server. This is especially problematic when communicating over long haul networks. Sending drawing requests to only the screens that they overlap should improve performance. Pixmaps Pixmaps were originally expected to be handled entirely in the front-end X server; however, it was found that this overly complicated the rendering code and would have required sending potentially large images to each back server that required them when copying from pixmap to screen. Thus, pixmap state is mirrored in the back-end server just as it is with regular window state. With this implementation, the same rendering code that draws to windows can be used to draw to pixmaps on the back-end server, and no large image transfers are required to copy from pixmap to window. Phase II The second phase of development concentrates on performance optimizations. These optimizations are documented here, with x11perf data to show how the optimizations improve performance. All benchmarks were performed by running Xdmx on a dual processor 1.4GHz AMD Athlon machine with 1GB of RAM connecting over 100baseT to two single-processor 1GHz Pentium III machines with 256MB of RAM and ATI Rage 128 (RF) video cards. The front end was running Linux 2.4.20-pre1-ac1 and the back ends were running Linux 2.4.7-10 and version 4.2.99.1 of XFree86 pulled from the XFree86 CVS repository on August 7, 2002. All systems were running Red Hat Linux 7.2. Moving from XFree86 4.1.99.1 to 4.2.0.0 For phase II, the working source tree was moved to the branch tagged with dmx-1-0-branch and was updated from version 4.1.99.1 (20 August 2001) of the XFree86 sources to version 4.2.0.0 (18 January 2002). After this update, the following tests were noted to be more than 10% faster: 1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple) 1.16 Fill 1x1 tiled trapezoid (161x145 tile) 1.13 Fill 10x10 tiled trapezoid (161x145 tile) 1.17 Fill 100x100 tiled trapezoid (161x145 tile) 1.16 Fill 1x1 tiled trapezoid (216x208 tile) 1.20 Fill 10x10 tiled trapezoid (216x208 tile) 1.15 Fill 100x100 tiled trapezoid (216x208 tile) 1.37 Circulate Unmapped window (200 kids) And the following tests were noted to be more than 10% slower: 0.88 Unmap window via parent (25 kids) 0.75 Circulate Unmapped window (4 kids) 0.79 Circulate Unmapped window (16 kids) 0.80 Circulate Unmapped window (25 kids) 0.82 Circulate Unmapped window (50 kids) 0.85 Circulate Unmapped window (75 kids) These changes were not caused by any changes in the DMX system, and may point to changes in the XFree86 tree or to tests that have more "jitter" than most other x11perf tests. Global changes During the development of the Phase II DMX server, several global changes were made. These changes were also compared with the Phase I server. The following tests were noted to be more than 10% faster: 1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple) 1.15 Fill 1x1 tiled trapezoid (161x145 tile) 1.13 Fill 10x10 tiled trapezoid (161x145 tile) 1.17 Fill 100x100 tiled trapezoid (161x145 tile) 1.16 Fill 1x1 tiled trapezoid (216x208 tile) 1.19 Fill 10x10 tiled trapezoid (216x208 tile) 1.15 Fill 100x100 tiled trapezoid (216x208 tile) 1.15 Circulate Unmapped window (4 kids) The following tests were noted to be more than 10% slower: 0.69 Scroll 10x10 pixels 0.68 Scroll 100x100 pixels 0.68 Copy 10x10 from window to window 0.68 Copy 100x100 from window to window 0.76 Circulate Unmapped window (75 kids) 0.83 Circulate Unmapped window (100 kids) For the remainder of this analysis, the baseline of comparison will be the Phase II deliverable with all optimizations disabled (unless otherwise noted). This will highlight how the optimizations in isolation impact performance. XSync() Batching During the Phase I implementation, XSync() was called after every protocol request made by the DMX server. This provided the DMX server with an interactive feel, but defeated X11's protocol buffering system and introduced round-trip wire latency into every operation. During Phase II, DMX was changed so that protocol requests are no longer followed by calls to XSync(). Instead, the need for an XSync() is noted, and XSync() calls are only made every 100mS or when the DMX server specifically needs to make a call to guarantee interactivity. With this new system, X11 buffers protocol as much as possible during a 100mS interval, and many unnecessary XSync() calls are avoided. Out of more than 300 x11perf tests, 8 tests became more than 100 times faster, with 68 more than 50X faster, 114 more than 10X faster, and 181 more than 2X faster. See table below for summary. The following tests were noted to be more than 10% slower with XSync() batching on: 0.88 500x500 tiled rectangle (161x145 tile) 0.89 Copy 500x500 from window to window Offscreen Optimization Windows span one or more of the back-end servers' screens; however, during Phase I development, windows were created on every back-end server and every rendering request was sent to every window regardless of whether or not that window was visible. With the offscreen optimization, the DMX server tracks when a window is completely off of a back-end server's screen and, in that case, it does not send rendering requests to those back-end windows. This optimization saves bandwidth between the front and back-end servers, and it reduces the number of XSync() calls. The performance tests were run on a DMX system with only two back-end servers. Greater performance gains will be had as the number of back-end servers increases. Out of more than 300 x11perf tests, 3 tests were at least twice as fast, and 146 tests were at least 10% faster. Two tests were more than 10% slower with the offscreen optimization: 0.88 Hide/expose window via popup (4 kids) 0.89 Resize unmapped window (75 kids) Lazy Window Creation Optimization As mentioned above, during Phase I, windows were created on every back-end server even if they were not visible on that back-end. With the lazy window creation optimization, the DMX server does not create windows on a back-end server until they are either visible or they become the parents of a visible window. This optimization builds on the offscreen optimization (described above) and requires it to be enabled. The lazy window creation optimization works by creating the window data structures in the front-end server when a client creates a window, but delays creation of the window on the back-end server(s). A private window structure in the DMX server saves the relevant window data and tracks changes to the window's attributes and stacking order for later use. The only times a window is created on a back-end server are (1) when it is mapped and is at least partially overlapping the back-end server's screen (tracked by the offscreen optimization), or (2) when the window becomes the parent of a previously visible window. The first case occurs when a window is mapped or when a visible window is copied, moved or resized and now overlaps the back-end server's screen. The second case occurs when starting a window manager after having created windows to which the window manager needs to add decorations. When either case occurs, a window on the back-end server is created using the data saved in the DMX server's window private data structure. The stacking order is then adjusted to correctly place the window on the back-end and lastly the window is mapped. From this time forward, the window is handled exactly as if the window had been created at the time of the client's request. Note that when a window is no longer visible on a back-end server's screen (e.g., it is moved offscreen), the window is not destroyed; rather, it is kept and reused later if the window once again becomes visible on the back-end server's screen. Originally with this optimization, destroying windows was implemented but was later rejected because it increased bandwidth when windows were opaquely moved or resized, which is common in many window managers. The performance tests were run on a DMX system with only two back-end servers. Greater performance gains will be had as the number of back-end servers increases. This optimization improved the following x11perf tests by more than 10%: 1.10 500x500 rectangle outline 1.12 Fill 100x100 stippled trapezoid (161x145 stipple) 1.20 Circulate Unmapped window (50 kids) 1.19 Circulate Unmapped window (75 kids) Subdividing Rendering Primitives X11 imaging requests transfer significant data between the client and the X server. During Phase I, the DMX server would then transfer the image data to each back-end server. Even with the offscreen optimization (above), these requests still required transferring significant data to each back-end server that contained a visible portion of the window. For example, if the client uses XPutImage() to copy an image to a window that overlaps the entire DMX screen, then the entire image is copied by the DMX server to every back-end server. To reduce the amount of data transferred between the DMX server and the back-end servers when XPutImage() is called, the image data is subdivided and only the data that will be visible on a back-end server's screen is sent to that back-end server. Xinerama already implements a subdivision algorithm for XGetImage() and no further optimization was needed. Other rendering primitives were analyzed, but the time required to subdivide these primitives was a significant proportion of the time required to send the entire rendering request to the back-end server, so this optimization was rejected for the other rendering primitives. Again, the performance tests were run on a DMX system with only two back-end servers. Greater performance gains will be had as the number of back-end servers increases. This optimization improved the following x11perf tests by more than 10%: 1.12 Fill 100x100 stippled trapezoid (161x145 stipple) 1.26 PutImage 10x10 square 1.83 PutImage 100x100 square 1.91 PutImage 500x500 square 1.40 PutImage XY 10x10 square 1.48 PutImage XY 100x100 square 1.50 PutImage XY 500x500 square 1.45 Circulate Unmapped window (75 kids) 1.74 Circulate Unmapped window (100 kids) The following test was noted to be more than 10% slower with this optimization: 0.88 10-pixel fill chord partial circle Summary of x11perf Data With all of the optimizations on, 53 x11perf tests are more than 100X faster than the unoptimized Phase II deliverable, with 69 more than 50X faster, 73 more than 10X faster, and 199 more than twice as fast. No tests were more than 10% slower than the unoptimized Phase II deliverable. (Compared with the Phase I deliverable, only Circulate Unmapped window (100 kids) was more than 10% slower than the Phase II deliverable. As noted above, this test seems to have wider variability than other x11perf tests.) The following table summarizes relative x11perf test changes for all optimizations individually and collectively. Note that some of the optimizations have a synergistic effect when used together. 1: XSync() batching only 2: Off screen optimizations only 3: Window optimizations only 4: Subdivprims only 5: All optimizations 1 2 3 4 5 Operation ------ ---- ---- ---- ------ --------- 2.14 1.85 1.00 1.00 4.13 Dot 1.67 1.80 1.00 1.00 3.31 1x1 rectangle 2.38 1.43 1.00 1.00 2.44 10x10 rectangle 1.00 1.00 0.92 0.98 1.00 100x100 rectangle 1.00 1.00 1.00 1.00 1.00 500x500 rectangle 1.83 1.85 1.05 1.06 3.54 1x1 stippled rectangle (8x8 stipple) 2.43 1.43 1.00 1.00 2.41 10x10 stippled rectangle (8x8 stipple) 0.98 1.00 1.00 1.00 1.00 100x100 stippled rectangle (8x8 stipple) 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (8x8 stipple) 1.75 1.75 1.00 1.00 3.40 1x1 opaque stippled rectangle (8x8 stipple) 2.38 1.42 1.00 1.00 2.34 10x10 opaque stippled rectangle (8x8 stipple) 1.00 1.00 0.97 0.97 1.00 100x100 opaque stippled rectangle (8x8 stipple) 1.00 1.00 1.00 1.00 0.99 500x500 opaque stippled rectangle (8x8 stipple) 1.82 1.82 1.04 1.04 3.56 1x1 tiled rectangle (4x4 tile) 2.33 1.42 1.00 1.00 2.37 10x10 tiled rectangle (4x4 tile) 1.00 0.92 1.00 1.00 1.00 100x100 tiled rectangle (4x4 tile) 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (4x4 tile) 1.94 1.62 1.00 1.00 3.66 1x1 stippled rectangle (17x15 stipple) 1.74 1.28 1.00 1.00 1.73 10x10 stippled rectangle (17x15 stipple) 1.00 1.00 1.00 0.89 0.98 100x100 stippled rectangle (17x15 stipple) 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (17x15 stipple) 1.94 1.62 1.00 1.00 3.67 1x1 opaque stippled rectangle (17x15 stipple) 1.69 1.26 1.00 1.00 1.66 10x10 opaque stippled rectangle (17x15 stipple) 1.00 0.95 1.00 1.00 1.00 100x100 opaque stippled rectangle (17x15 stipple) 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (17x15 stipple) 1.93 1.61 0.99 0.99 3.69 1x1 tiled rectangle (17x15 tile) 1.73 1.27 1.00 1.00 1.72 10x10 tiled rectangle (17x15 tile) 1.00 1.00 1.00 1.00 0.98 100x100 tiled rectangle (17x15 tile) 1.00 1.00 0.97 0.97 1.00 500x500 tiled rectangle (17x15 tile) 1.95 1.63 1.00 1.00 3.83 1x1 stippled rectangle (161x145 stipple) 1.80 1.30 1.00 1.00 1.83 10x10 stippled rectangle (161x145 stipple) 0.97 1.00 1.00 1.00 1.01 100x100 stippled rectangle (161x145 stipple) 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (161x145 stipple) 1.95 1.63 1.00 1.00 3.56 1x1 opaque stippled rectangle (161x145 stipple) 1.65 1.25 1.00 1.00 1.68 10x10 opaque stippled rectangle (161x145 stipple) 1.00 1.00 1.00 1.00 1.01 100x100 opaque stippled rectangle (161x145... 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (161x145... 1.95 1.63 0.98 0.99 3.80 1x1 tiled rectangle (161x145 tile) 1.67 1.26 1.00 1.00 1.67 10x10 tiled rectangle (161x145 tile) 1.13 1.14 1.14 1.14 1.14 100x100 tiled rectangle (161x145 tile) 0.88 1.00 1.00 1.00 0.99 500x500 tiled rectangle (161x145 tile) 1.93 1.63 1.00 1.00 3.53 1x1 tiled rectangle (216x208 tile) 1.69 1.26 1.00 1.00 1.66 10x10 tiled rectangle (216x208 tile) 1.00 1.00 1.00 1.00 1.00 100x100 tiled rectangle (216x208 tile) 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (216x208 tile) 1.82 1.70 1.00 1.00 3.38 1-pixel line segment 2.07 1.56 0.90 1.00 3.31 10-pixel line segment 1.29 1.10 1.00 1.00 1.27 100-pixel line segment 1.05 1.06 1.03 1.03 1.09 500-pixel line segment 1.30 1.13 1.00 1.00 1.29 100-pixel line segment (1 kid) 1.32 1.15 1.00 1.00 1.32 100-pixel line segment (2 kids) 1.33 1.16 1.00 1.00 1.33 100-pixel line segment (3 kids) 1.92 1.64 1.00 1.00 3.73 10-pixel dashed segment 1.34 1.16 1.00 1.00 1.34 100-pixel dashed segment 1.24 1.11 0.99 0.97 1.23 100-pixel double-dashed segment 1.72 1.77 1.00 1.00 3.25 10-pixel horizontal line segment 1.83 1.66 1.01 1.00 3.54 100-pixel horizontal line segment 1.86 1.30 1.00 1.00 1.84 500-pixel horizontal line segment 2.11 1.52 1.00 0.99 3.02 10-pixel vertical line segment 1.21 1.10 1.00 1.00 1.20 100-pixel vertical line segment 1.03 1.03 1.00 1.00 1.02 500-pixel vertical line segment 4.42 1.68 1.00 1.01 4.64 10x1 wide horizontal line segment 1.83 1.31 1.00 1.00 1.83 100x10 wide horizontal line segment 1.07 1.00 0.96 1.00 1.07 500x50 wide horizontal line segment 4.10 1.67 1.00 1.00 4.62 10x1 wide vertical line segment 1.50 1.24 1.06 1.06 1.48 100x10 wide vertical line segment 1.06 1.03 1.00 1.00 1.05 500x50 wide vertical line segment 2.54 1.61 1.00 1.00 3.61 1-pixel line 2.71 1.48 1.00 1.00 2.67 10-pixel line 1.19 1.09 1.00 1.00 1.19 100-pixel line 1.04 1.02 1.00 1.00 1.03 500-pixel line 2.68 1.51 0.98 1.00 3.17 10-pixel dashed line 1.23 1.11 0.99 0.99 1.23 100-pixel dashed line 1.15 1.08 1.00 1.00 1.15 100-pixel double-dashed line 2.27 1.39 1.00 1.00 2.23 10x1 wide line 1.20 1.09 1.00 1.00 1.20 100x10 wide line 1.04 1.02 1.00 1.00 1.04 500x50 wide line 1.52 1.45 1.00 1.00 1.52 100x10 wide dashed line 1.54 1.47 1.00 1.00 1.54 100x10 wide double-dashed line 1.97 1.30 0.96 0.95 1.95 10x10 rectangle outline 1.44 1.27 1.00 1.00 1.43 100x100 rectangle outline 3.22 2.16 1.10 1.09 3.61 500x500 rectangle outline 1.95 1.34 1.00 1.00 1.90 10x10 wide rectangle outline 1.14 1.14 1.00 1.00 1.13 100x100 wide rectangle outline 1.00 1.00 1.00 1.00 1.00 500x500 wide rectangle outline 1.57 1.72 1.00 1.00 3.03 1-pixel circle 1.96 1.35 1.00 1.00 1.92 10-pixel circle 1.21 1.07 0.86 0.97 1.20 100-pixel circle 1.08 1.04 1.00 1.00 1.08 500-pixel circle 1.39 1.19 1.03 1.03 1.38 100-pixel dashed circle 1.21 1.11 1.00 1.00 1.23 100-pixel double-dashed circle 1.59 1.28 1.00 1.00 1.58 10-pixel wide circle 1.22 1.12 0.99 1.00 1.22 100-pixel wide circle 1.06 1.04 1.00 1.00 1.05 500-pixel wide circle 1.87 1.84 1.00 1.00 1.85 100-pixel wide dashed circle 1.90 1.93 1.01 1.01 1.90 100-pixel wide double-dashed circle 2.13 1.43 1.00 1.00 2.32 10-pixel partial circle 1.42 1.18 1.00 1.00 1.42 100-pixel partial circle 1.92 1.85 1.01 1.01 1.89 10-pixel wide partial circle 1.73 1.67 1.00 1.00 1.73 100-pixel wide partial circle 1.36 1.95 1.00 1.00 2.64 1-pixel solid circle 2.02 1.37 1.00 1.00 2.03 10-pixel solid circle 1.19 1.09 1.00 1.00 1.19 100-pixel solid circle 1.02 0.99 1.00 1.00 1.01 500-pixel solid circle 1.74 1.28 1.00 0.88 1.73 10-pixel fill chord partial circle 1.31 1.13 1.00 1.00 1.31 100-pixel fill chord partial circle 1.67 1.31 1.03 1.03 1.72 10-pixel fill slice partial circle 1.30 1.13 1.00 1.00 1.28 100-pixel fill slice partial circle 2.45 1.49 1.01 1.00 2.71 10-pixel ellipse 1.22 1.10 1.00 1.00 1.22 100-pixel ellipse 1.09 1.04 1.00 1.00 1.09 500-pixel ellipse 1.90 1.28 1.00 1.00 1.89 100-pixel dashed ellipse 1.62 1.24 0.96 0.97 1.61 100-pixel double-dashed ellipse 2.43 1.50 1.00 1.00 2.42 10-pixel wide ellipse 1.61 1.28 1.03 1.03 1.60 100-pixel wide ellipse 1.08 1.05 1.00 1.00 1.08 500-pixel wide ellipse 1.93 1.88 1.00 1.00 1.88 100-pixel wide dashed ellipse 1.94 1.89 1.01 1.00 1.94 100-pixel wide double-dashed ellipse 2.31 1.48 1.00 1.00 2.67 10-pixel partial ellipse 1.38 1.17 1.00 1.00 1.38 100-pixel partial ellipse 2.00 1.85 0.98 0.97 1.98 10-pixel wide partial ellipse 1.89 1.86 1.00 1.00 1.89 100-pixel wide partial ellipse 3.49 1.60 1.00 1.00 3.65 10-pixel filled ellipse 1.67 1.26 1.00 1.00 1.67 100-pixel filled ellipse 1.06 1.04 1.00 1.00 1.06 500-pixel filled ellipse 2.38 1.43 1.01 1.00 2.32 10-pixel fill chord partial ellipse 2.06 1.30 1.00 1.00 2.05 100-pixel fill chord partial ellipse 2.27 1.41 1.00 1.00 2.27 10-pixel fill slice partial ellipse 1.98 1.33 1.00 0.97 1.97 100-pixel fill slice partial ellipse 57.46 1.99 1.01 1.00 114.92 Fill 1x1 equivalent triangle 56.94 1.98 1.01 1.00 73.89 Fill 10x10 equivalent triangle 6.07 1.75 1.00 1.00 6.07 Fill 100x100 equivalent triangle 51.12 1.98 1.00 1.00 102.81 Fill 1x1 trapezoid 51.42 1.82 1.01 1.00 94.89 Fill 10x10 trapezoid 6.47 1.80 1.00 1.00 6.44 Fill 100x100 trapezoid 1.56 1.28 1.00 0.99 1.56 Fill 300x300 trapezoid 51.27 1.97 0.96 0.97 102.54 Fill 1x1 stippled trapezoid (8x8 stipple) 51.73 2.00 1.02 1.02 67.92 Fill 10x10 stippled trapezoid (8x8 stipple) 5.36 1.72 1.00 1.00 5.36 Fill 100x100 stippled trapezoid (8x8 stipple) 1.54 1.26 1.00 1.00 1.59 Fill 300x300 stippled trapezoid (8x8 stipple) 51.41 1.94 1.01 1.00 102.82 Fill 1x1 opaque stippled trapezoid (8x8 stipple) 50.71 1.95 0.99 1.00 65.44 Fill 10x10 opaque stippled trapezoid (8x8... 5.33 1.73 1.00 1.00 5.36 Fill 100x100 opaque stippled trapezoid (8x8... 1.58 1.25 1.00 1.00 1.58 Fill 300x300 opaque stippled trapezoid (8x8... 51.56 1.96 0.99 0.90 103.68 Fill 1x1 tiled trapezoid (4x4 tile) 51.59 1.99 1.01 1.01 62.25 Fill 10x10 tiled trapezoid (4x4 tile) 5.38 1.72 1.00 1.00 5.38 Fill 100x100 tiled trapezoid (4x4 tile) 1.54 1.25 1.00 0.99 1.58 Fill 300x300 tiled trapezoid (4x4 tile) 51.70 1.98 1.01 1.01 103.98 Fill 1x1 stippled trapezoid (17x15 stipple) 44.86 1.97 1.00 1.00 44.86 Fill 10x10 stippled trapezoid (17x15 stipple) 2.74 1.56 1.00 1.00 2.73 Fill 100x100 stippled trapezoid (17x15 stipple) 1.29 1.14 1.00 1.00 1.27 Fill 300x300 stippled trapezoid (17x15 stipple) 51.41 1.96 0.96 0.95 103.39 Fill 1x1 opaque stippled trapezoid (17x15... 45.14 1.96 1.01 1.00 45.14 Fill 10x10 opaque stippled trapezoid (17x15... 2.68 1.56 1.00 1.00 2.68 Fill 100x100 opaque stippled trapezoid (17x15... 1.26 1.10 1.00 1.00 1.28 Fill 300x300 opaque stippled trapezoid (17x15... 51.13 1.97 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (17x15 tile) 47.58 1.96 1.00 1.00 47.86 Fill 10x10 tiled trapezoid (17x15 tile) 2.74 1.56 1.00 1.00 2.74 Fill 100x100 tiled trapezoid (17x15 tile) 1.29 1.14 1.00 1.00 1.28 Fill 300x300 tiled trapezoid (17x15 tile) 51.13 1.97 0.99 0.97 103.39 Fill 1x1 stippled trapezoid (161x145 stipple) 45.14 1.97 1.00 1.00 44.29 Fill 10x10 stippled trapezoid (161x145 stipple) 3.02 1.77 1.12 1.12 3.38 Fill 100x100 stippled trapezoid (161x145 stipple) 1.31 1.13 1.00 1.00 1.30 Fill 300x300 stippled trapezoid (161x145 stipple) 51.27 1.97 1.00 1.00 103.10 Fill 1x1 opaque stippled trapezoid (161x145... 45.01 1.97 1.00 1.00 45.01 Fill 10x10 opaque stippled trapezoid (161x145... 2.67 1.56 1.00 1.00 2.69 Fill 100x100 opaque stippled trapezoid (161x145.. 1.29 1.13 1.00 1.01 1.27 Fill 300x300 opaque stippled trapezoid (161x145.. 51.41 1.96 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (161x145 tile) 45.01 1.96 0.98 1.00 45.01 Fill 10x10 tiled trapezoid (161x145 tile) 2.62 1.36 1.00 1.00 2.69 Fill 100x100 tiled trapezoid (161x145 tile) 1.27 1.13 1.00 1.00 1.22 Fill 300x300 tiled trapezoid (161x145 tile) 51.13 1.98 1.00 1.00 103.39 Fill 1x1 tiled trapezoid (216x208 tile) 45.14 1.97 1.01 0.99 45.14 Fill 10x10 tiled trapezoid (216x208 tile) 2.62 1.55 1.00 1.00 2.71 Fill 100x100 tiled trapezoid (216x208 tile) 1.28 1.13 1.00 1.00 1.20 Fill 300x300 tiled trapezoid (216x208 tile) 50.71 1.95 1.00 1.00 54.70 Fill 10x10 equivalent complex polygon 5.51 1.71 0.96 0.98 5.47 Fill 100x100 equivalent complex polygons 8.39 1.97 1.00 1.00 16.75 Fill 10x10 64-gon (Convex) 8.38 1.83 1.00 1.00 8.43 Fill 100x100 64-gon (Convex) 8.50 1.96 1.00 1.00 16.64 Fill 10x10 64-gon (Complex) 8.26 1.83 1.00 1.00 8.35 Fill 100x100 64-gon (Complex) 14.09 1.87 1.00 1.00 14.05 Char in 80-char line (6x13) 11.91 1.87 1.00 1.00 11.95 Char in 70-char line (8x13) 11.16 1.85 1.01 1.00 11.10 Char in 60-char line (9x15) 10.09 1.78 1.00 1.00 10.09 Char16 in 40-char line (k14) 6.15 1.75 1.00 1.00 6.31 Char16 in 23-char line (k24) 11.92 1.90 1.03 1.03 11.88 Char in 80-char line (TR 10) 8.18 1.78 1.00 0.99 8.17 Char in 30-char line (TR 24) 42.83 1.44 1.01 1.00 42.11 Char in 20/40/20 line (6x13, TR 10) 27.45 1.43 1.01 1.01 27.45 Char16 in 7/14/7 line (k14, k24) 12.13 1.85 1.00 1.00 12.05 Char in 80-char image line (6x13) 10.00 1.84 1.00 1.00 10.00 Char in 70-char image line (8x13) 9.18 1.83 1.00 1.00 9.12 Char in 60-char image line (9x15) 9.66 1.82 0.98 0.95 9.66 Char16 in 40-char image line (k14) 5.82 1.72 1.00 1.00 5.99 Char16 in 23-char image line (k24) 8.70 1.80 1.00 1.00 8.65 Char in 80-char image line (TR 10) 4.67 1.66 1.00 1.00 4.67 Char in 30-char image line (TR 24) 84.43 1.47 1.00 1.00 124.18 Scroll 10x10 pixels 3.73 1.50 1.00 0.98 3.73 Scroll 100x100 pixels 1.00 1.00 1.00 1.00 1.00 Scroll 500x500 pixels 84.43 1.51 1.00 1.00 134.02 Copy 10x10 from window to window 3.62 1.51 0.98 0.98 3.62 Copy 100x100 from window to window 0.89 1.00 1.00 1.00 1.00 Copy 500x500 from window to window 57.06 1.99 1.00 1.00 88.64 Copy 10x10 from pixmap to window 2.49 2.00 1.00 1.00 2.48 Copy 100x100 from pixmap to window 1.00 0.91 1.00 1.00 0.98 Copy 500x500 from pixmap to window 2.04 1.01 1.00 1.00 2.03 Copy 10x10 from window to pixmap 1.05 1.00 1.00 1.00 1.05 Copy 100x100 from window to pixmap 1.00 1.00 0.93 1.00 1.04 Copy 500x500 from window to pixmap 58.52 1.03 1.03 1.02 57.95 Copy 10x10 from pixmap to pixmap 2.40 1.00 1.00 1.00 2.45 Copy 100x100 from pixmap to pixmap 1.00 1.00 1.00 1.00 1.00 Copy 500x500 from pixmap to pixmap 51.57 1.92 1.00 1.00 85.75 Copy 10x10 1-bit deep plane 6.37 1.75 1.01 1.01 6.37 Copy 100x100 1-bit deep plane 1.26 1.11 1.00 1.00 1.24 Copy 500x500 1-bit deep plane 4.23 1.63 0.98 0.97 4.38 Copy 10x10 n-bit deep plane 1.04 1.02 1.00 1.00 1.04 Copy 100x100 n-bit deep plane 1.00 1.00 1.00 1.00 1.00 Copy 500x500 n-bit deep plane 6.45 1.98 1.00 1.26 12.80 PutImage 10x10 square 1.10 1.87 1.00 1.83 2.11 PutImage 100x100 square 1.02 1.93 1.00 1.91 1.91 PutImage 500x500 square 4.17 1.78 1.00 1.40 7.18 PutImage XY 10x10 square 1.27 1.49 0.97 1.48 2.10 PutImage XY 100x100 square 1.00 1.50 1.00 1.50 1.52 PutImage XY 500x500 square 1.07 1.01 1.00 1.00 1.06 GetImage 10x10 square 1.01 1.00 1.00 1.00 1.01 GetImage 100x100 square 1.00 1.00 1.00 1.00 1.00 GetImage 500x500 square 1.56 1.00 0.99 0.97 1.56 GetImage XY 10x10 square 1.02 1.00 1.00 1.00 1.02 GetImage XY 100x100 square 1.00 1.00 1.00 1.00 1.00 GetImage XY 500x500 square 1.00 1.00 1.01 0.98 0.95 X protocol NoOperation 1.02 1.03 1.04 1.03 1.00 QueryPointer 1.03 1.02 1.04 1.03 1.00 GetProperty 100.41 1.51 1.00 1.00 198.76 Change graphics context 45.81 1.00 0.99 0.97 57.10 Create and map subwindows (4 kids) 78.45 1.01 1.02 1.02 63.07 Create and map subwindows (16 kids) 73.91 1.01 1.00 1.00 56.37 Create and map subwindows (25 kids) 73.22 1.00 1.00 1.00 49.07 Create and map subwindows (50 kids) 72.36 1.01 0.99 1.00 32.14 Create and map subwindows (75 kids) 70.34 1.00 1.00 1.00 30.12 Create and map subwindows (100 kids) 55.00 1.00 1.00 0.99 23.75 Create and map subwindows (200 kids) 55.30 1.01 1.00 1.00 141.03 Create unmapped window (4 kids) 55.38 1.01 1.01 1.00 163.25 Create unmapped window (16 kids) 54.75 0.96 1.00 0.99 166.95 Create unmapped window (25 kids) 54.83 1.00 1.00 0.99 178.81 Create unmapped window (50 kids) 55.38 1.01 1.01 1.00 181.20 Create unmapped window (75 kids) 55.38 1.01 1.01 1.00 181.20 Create unmapped window (100 kids) 54.87 1.01 1.01 1.00 182.05 Create unmapped window (200 kids) 28.13 1.00 1.00 1.00 30.75 Map window via parent (4 kids) 36.14 1.01 1.01 1.01 32.58 Map window via parent (16 kids) 26.13 1.00 0.98 0.95 29.85 Map window via parent (25 kids) 40.07 1.00 1.01 1.00 27.57 Map window via parent (50 kids) 23.26 0.99 1.00 1.00 18.23 Map window via parent (75 kids) 22.91 0.99 1.00 0.99 16.52 Map window via parent (100 kids) 27.79 1.00 1.00 0.99 12.50 Map window via parent (200 kids) 22.35 1.00 1.00 1.00 56.19 Unmap window via parent (4 kids) 9.57 1.00 0.99 1.00 89.78 Unmap window via parent (16 kids) 80.77 1.01 1.00 1.00 103.85 Unmap window via parent (25 kids) 96.34 1.00 1.00 1.00 116.06 Unmap window via parent (50 kids) 99.72 1.00 1.00 1.00 124.93 Unmap window via parent (75 kids) 112.36 1.00 1.00 1.00 125.27 Unmap window via parent (100 kids) 105.41 1.00 1.00 0.99 120.00 Unmap window via parent (200 kids) 51.29 1.03 1.02 1.02 74.19 Destroy window via parent (4 kids) 86.75 0.99 0.99 0.99 116.87 Destroy window via parent (16 kids) 106.43 1.01 1.01 1.01 127.49 Destroy window via parent (25 kids) 120.34 1.01 1.01 1.00 140.11 Destroy window via parent (50 kids) 126.67 1.00 0.99 0.99 145.00 Destroy window via parent (75 kids) 126.11 1.01 1.01 1.00 140.56 Destroy window via parent (100 kids) 128.57 1.01 1.00 1.00 137.91 Destroy window via parent (200 kids) 16.04 0.88 1.00 1.00 20.36 Hide/expose window via popup (4 kids) 19.04 1.01 1.00 1.00 23.48 Hide/expose window via popup (16 kids) 19.22 1.00 1.00 1.00 20.44 Hide/expose window via popup (25 kids) 17.41 1.00 0.91 0.97 17.68 Hide/expose window via popup (50 kids) 17.29 1.01 1.00 1.01 17.07 Hide/expose window via popup (75 kids) 16.74 1.00 1.00 1.00 16.17 Hide/expose window via popup (100 kids) 10.30 1.00 1.00 1.00 10.51 Hide/expose window via popup (200 kids) 16.48 1.01 1.00 1.00 26.05 Move window (4 kids) 17.01 0.95 1.00 1.00 23.97 Move window (16 kids) 16.95 1.00 1.00 1.00 22.90 Move window (25 kids) 16.05 1.01 1.00 1.00 21.32 Move window (50 kids) 15.58 1.00 0.98 0.98 19.44 Move window (75 kids) 14.98 1.02 1.03 1.03 18.17 Move window (100 kids) 10.90 1.01 1.01 1.00 12.68 Move window (200 kids) 49.42 1.00 1.00 1.00 198.27 Moved unmapped window (4 kids) 50.72 0.97 1.00 1.00 193.66 Moved unmapped window (16 kids) 50.87 1.00 0.99 1.00 195.09 Moved unmapped window (25 kids) 50.72 1.00 1.00 1.00 189.34 Moved unmapped window (50 kids) 50.87 1.00 1.00 1.00 191.33 Moved unmapped window (75 kids) 50.87 1.00 1.00 0.90 186.71 Moved unmapped window (100 kids) 50.87 1.00 1.00 1.00 179.19 Moved unmapped window (200 kids) 41.04 1.00 1.00 1.00 56.61 Move window via parent (4 kids) 69.81 1.00 1.00 1.00 130.82 Move window via parent (16 kids) 95.81 1.00 1.00 1.00 141.92 Move window via parent (25 kids) 95.98 1.00 1.00 1.00 149.43 Move window via parent (50 kids) 96.59 1.01 1.01 1.00 153.98 Move window via parent (75 kids) 97.19 1.00 1.00 1.00 157.30 Move window via parent (100 kids) 96.67 1.00 0.99 0.96 159.44 Move window via parent (200 kids) 17.75 1.01 1.00 1.00 27.61 Resize window (4 kids) 17.94 1.00 1.00 0.99 25.42 Resize window (16 kids) 17.92 1.01 1.00 1.00 24.47 Resize window (25 kids) 17.24 0.97 1.00 1.00 24.14 Resize window (50 kids) 16.81 1.00 1.00 0.99 22.75 Resize window (75 kids) 16.08 1.00 1.00 1.00 21.20 Resize window (100 kids) 12.92 1.00 0.99 1.00 16.26 Resize window (200 kids) 52.94 1.01 1.00 1.00 327.12 Resize unmapped window (4 kids) 53.60 1.01 1.01 1.01 333.71 Resize unmapped window (16 kids) 52.99 1.00 1.00 1.00 337.29 Resize unmapped window (25 kids) 51.98 1.00 1.00 1.00 329.38 Resize unmapped window (50 kids) 53.05 0.89 1.00 1.00 322.60 Resize unmapped window (75 kids) 53.05 1.00 1.00 1.00 318.08 Resize unmapped window (100 kids) 53.11 1.00 1.00 0.99 306.21 Resize unmapped window (200 kids) 16.76 1.00 0.96 1.00 19.46 Circulate window (4 kids) 17.24 1.00 1.00 0.97 16.24 Circulate window (16 kids) 16.30 1.03 1.03 1.03 15.85 Circulate window (25 kids) 13.45 1.00 1.00 1.00 14.90 Circulate window (50 kids) 12.91 1.00 1.00 1.00 13.06 Circulate window (75 kids) 11.30 0.98 1.00 1.00 11.03 Circulate window (100 kids) 7.58 1.01 1.01 0.99 7.47 Circulate window (200 kids) 1.01 1.01 0.98 1.00 0.95 Circulate Unmapped window (4 kids) 1.07 1.07 1.01 1.07 1.02 Circulate Unmapped window (16 kids) 1.04 1.09 1.06 1.05 0.97 Circulate Unmapped window (25 kids) 1.04 1.23 1.20 1.18 1.05 Circulate Unmapped window (50 kids) 1.18 1.53 1.19 1.45 1.24 Circulate Unmapped window (75 kids) 1.08 1.02 1.01 1.74 1.01 Circulate Unmapped window (100 kids) 1.01 1.12 0.98 0.91 0.97 Circulate Unmapped window (200 kids) Profiling with OProfile OProfile (available from http://oprofile.sourceforge.net/) is a system-wide profiler for Linux systems that uses processor-level counters to collect sampling data. OProfile can provide information that is similar to that provided by gprof, but without the necessity of recompiling the program with special instrumentation (i.e., OProfile can collect statistical profiling information about optimized programs). A test harness was developed to collect OProfile data for each x11perf test individually. Test runs were performed using the RETIRED_INSNS counter on the AMD Athlon and the CPU_CLK_HALTED counter on the Intel Pentium III (with a test configuration different from the one described above). We have examined OProfile output and have compared it with gprof output. This investigation has not produced results that yield performance increases in x11perf numbers. X Test Suite The X Test Suite was run on the fully optimized DMX server using the configuration described above. The following failures were noted: XListPixmapFormats: Test 1 [1] XChangeWindowAttributes: Test 32 [1] XCreateWindow: Test 30 [1] XFreeColors: Test 4 [3] XCopyArea: Test 13, 17, 21, 25, 30 [2] XCopyPlane: Test 11, 15, 27, 31 [2] XSetFontPath: Test 4 [1] XChangeKeyboardControl: Test 9, 10 [1] [1] Previously documented errors expected from the Xinerama implementation (see Phase I discussion). [2] Newly noted errors that have been verified as expected behavior of the Xinerama implementation. [3] Newly noted error that has been verified as a Xinerama implementation bug. Phase III During the third phase of development, support was provided for the following extensions: SHAPE, RENDER, XKEYBOARD, XInput. SHAPE The SHAPE extension is supported. Test applications (e.g., xeyes and oclock) and window managers that make use of the SHAPE extension will work as expected. RENDER The RENDER extension is supported. The version included in the DMX CVS tree is version 0.2, and this version is fully supported by Xdmx. Applications using only version 0.2 functions will work correctly; however, some apps that make use of functions from later versions do not properly check the extension's major/minor version numbers. These apps will fail with a Bad Implementation error when using post-version 0.2 functions. This is expected behavior. When the DMX CVS tree is updated to include newer versions of RENDER, support for these newer functions will be added to the DMX X server. XKEYBOARD The XKEYBOARD extension is supported. If present on the back-end X servers, the XKEYBOARD extension will be used to obtain information about the type of the keyboard for initialization. Otherwise, the keyboard will be initialized using defaults. Note that this departs from older behavior: when Xdmx is compiled without XKEYBOARD support, the map from the back-end X server will be preserved. With XKEYBOARD support, the map is not preserved because better information and control of the keyboard is available. XInput The XInput extension is supported. Any device can be used as a core device and be used as an XInput extension device, with the exception of core devices on the back-end servers. This limitation is present because cursor handling on the back-end requires that the back-end cursor sometimes track the Xdmx core cursor -- behavior that is incompatible with using the back-end pointer as a non-core device. Currently, back-end extension devices are not available as Xdmx extension devices, but this limitation should be removed in the future. To demonstrate the XInput extension, and to provide more examples for low-level input device driver writers, USB device drivers have been written for mice (usb-mou), keyboards (usb-kbd), and non-mouse/non-keyboard USB devices (usb-oth). Please see the man page for information on Linux kernel drivers that are required for using these Xdmx drivers. DPMS The DPMS extension is exported but does not do anything at this time. Other Extensions The LBX, SECURITY, XC-APPGROUP, and XFree86-Bigfont extensions do not require any special Xdmx support and have been exported. The BIG-REQUESTS, DEC-XTRAP, DOUBLE-BUFFER, Extended-Visual-Information, FontCache, GLX, MIT-SCREEN-SAVER, MIT-SHM, MIT-SUNDRY-NONSTANDARD, RECORD, SECURITY, SGI-GLX, SYNC, TOG-CUP, X-Resource, XC-MISC, XFree86-DGA, XFree86-DRI, XFree86-Misc, XFree86-VidModeExtension, and XVideo extensions are not supported at this time, but will be evaluated for inclusion in future DMX releases. See below for additional work on extensions after Phase III. Phase IV Moving to XFree86 4.3.0 For Phase IV, the recent release of XFree86 4.3.0 (27 February 2003) was merged onto the dmx.sourceforge.net CVS trunk and all work is proceeding using this tree. Extensions XC-MISC (supported) XC-MISC is used internally by the X library to recycle XIDs from the X server. This is important for long-running X server sessions. Xdmx supports this extension. The X Test Suite passed and failed the exact same tests before and after this extension was enabled. Extended-Visual-Information (supported) The Extended-Visual-Information extension provides a method for an X client to obtain detailed visual information. Xdmx supports this extension. It was tested using the hw/dmx/examples/evi example program. Note that this extension is not Xinerama-aware -- it will return visual information for each screen even though Xinerama is causing the X server to export a single logical screen. RES (supported) The X-Resource extension provides a mechanism for a client to obtain detailed information about the resources used by other clients. This extension was tested with the hw/dmx/examples/res program. The X Test Suite passed and failed the exact same tests before and after this extension was enabled. BIG-REQUESTS (supported) This extension enables the X11 protocol to handle requests longer than 262140 bytes. The X Test Suite passed and failed the exact same tests before and after this extension was enabled. XSYNC (supported) This extension provides facilities for two different X clients to synchronize their requests. This extension was minimally tested with xdpyinfo and the X Test Suite passed and failed the exact same tests before and after this extension was enabled. XTEST, RECORD, DEC-XTRAP (supported) and XTestExtension1 (not supported) The XTEST and RECORD extension were developed by the X Consortium for use in the X Test Suite and are supported as a standard in the X11R6 tree. They are also supported in Xdmx. When X Test Suite tests that make use of the XTEST extension are run, Xdmx passes and fails exactly the same tests as does a standard XFree86 X server. When the rcrdtest test (a part of the X Test Suite that verifies the RECORD extension) is run, Xdmx passes and fails exactly the same tests as does a standard XFree86 X server. There are two older XTEST-like extensions: DEC-XTRAP and XTestExtension1. The XTestExtension1 extension was developed for use by the X Testing Consortium for use with a test suite that eventually became (part of?) the X Test Suite. Unlike XTEST, which only allows events to be sent to the server, the XTestExtension1 extension also allowed events to be recorded (similar to the RECORD extension). The second is the DEC-XTRAP extension that was developed by the Digital Equipment Corporation. The DEC-XTRAP extension is available from Xdmx and has been tested with the xtrap* tools which are distributed as standard X11R6 clients. The XTestExtension1 is not supported because it does not appear to be used by any modern X clients (the few that support it also support XTEST) and because there are no good methods available for testing that it functions correctly (unlike XTEST and DEC-XTRAP, the code for XTestExtension1 is not part of the standard X server source tree, so additional testing is important). Most of these extensions are documented in the X11R6 source tree. Further, several original papers exist that this author was unable to locate -- for completeness and historical interest, citations are provide: XRECORD Martha Zimet. Extending X For Recording. 8th Annual X Technical Conference Boston, MA January 24-26, 1994. DEC-XTRAP Dick Annicchiarico, Robert Chesler, Alan Jamison. XTrap Architecture. Digital Equipment Corporation, July 1991. XTestExtension1 Larry Woestman. X11 Input Synthesis Extension Proposal. Hewlett Packard, November 1991. MIT-MISC (not supported) The MIT-MISC extension is used to control a bug-compatibility flag that provides compatibility with xterm programs from X11R1 and X11R2. There does not appear to be a single client available that makes use of this extension and there is not way to verify that it works correctly. The Xdmx server does not support MIT-MISC. SCREENSAVER (not supported) This extension provides special support for the X screen saver. It was tested with beforelight, which appears to be the only client that works with it. When Xinerama was not active, beforelight behaved as expected. However, when Xinerama was active, beforelight did not behave as expected. Further, when this extension is not active, xscreensaver (a widely-used X screen saver program) did not behave as expected. Since this extension is not Xinerama-aware and is not commonly used with expected results by clients, we have left this extension disabled at this time. GLX (supported) The GLX extension provides OpenGL and GLX windowing support. In Xdmx, the extension is called glxProxy, and it is Xinerama aware. It works by either feeding requests forward through Xdmx to each of the back-end servers or handling them locally. All rendering requests are handled on the back-end X servers. This code was donated to the DMX project by SGI. For the X Test Suite results comparison, see below. RENDER (supported) The X Rendering Extension (RENDER) provides support for digital image composition. Geometric and text rendering are supported. RENDER is partially Xinerama-aware, with text and the most basic compositing operator; however, its higher level primitives (triangles, triangle strips, and triangle fans) are not yet Xinerama-aware. The RENDER extension is still under development, and is currently at version 0.8. Additional support will be required in DMX as more primitives and/or requests are added to the extension. There is currently no test suite for the X Rendering Extension; however, there has been discussion of developing a test suite as the extension matures. When that test suite becomes available, additional testing can be performed with Xdmx. The X Test Suite passed and failed the exact same tests before and after this extension was enabled. Summary To summarize, the following extensions are currently supported: BIG-REQUESTS, DEC-XTRAP, DMX, DPMS, Extended-Visual-Information, GLX, LBX, RECORD, RENDER, SECURITY, SHAPE, SYNC, X-Resource, XC-APPGROUP, XC-MISC, XFree86-Bigfont, XINERAMA, XInputExtension, XKEYBOARD, and XTEST. The following extensions are not supported at this time: DOUBLE-BUFFER, FontCache, MIT-SCREEN-SAVER, MIT-SHM, MIT-SUNDRY-NONSTANDARD, TOG-CUP, XFree86-DGA, XFree86-Misc, XFree86-VidModeExtension, XTestExtensionExt1, and XVideo. Additional Testing with the X Test Suite XFree86 without XTEST After the release of XFree86 4.3.0, we retested the XFree86 X server with and without using the XTEST extension. When the XTEST extension was not used for testing, the XFree86 4.3.0 server running on our usual test system with a Radeon VE card reported unexpected failures in the following tests: XListPixmapFormats: Test 1 XChangeKeyboardControl: Tests 9, 10 XGetDefault: Test 5 XRebindKeysym: Test 1 XFree86 with XTEST When using the XTEST extension, the XFree86 4.3.0 server reported the following errors: XListPixmapFormats: Test 1 XChangeKeyboardControl: Tests 9, 10 XGetDefault: Test 5 XRebindKeysym: Test 1 XAllowEvents: Tests 20, 21, 24 XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25 XGrabKey: Test 8 XSetPointerMapping: Test 3 XUngrabButton: Test 4 While these errors may be important, they will probably be fixed eventually in the XFree86 source tree. We are particularly interested in demonstrating that the Xdmx server does not introduce additional failures that are not known Xinerama failures. Xdmx with XTEST, without Xinerama, without GLX Without Xinerama, but using the XTEST extension, the following errors were reported from Xdmx (note that these are the same as for the XFree86 4.3.0, except that XGetDefault no longer fails): XListPixmapFormats: Test 1 XChangeKeyboardControl: Tests 9, 10 XRebindKeysym: Test 1 XAllowEvents: Tests 20, 21, 24 XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25 XGrabKey: Test 8 XSetPointerMapping: Test 3 XUngrabButton: Test 4 Xdmx with XTEST, with Xinerama, without GLX With Xinerama, using the XTEST extension, the following errors were reported from Xdmx: XListPixmapFormats: Test 1 XChangeKeyboardControl: Tests 9, 10 XRebindKeysym: Test 1 XAllowEvents: Tests 20, 21, 24 XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25 XGrabKey: Test 8 XSetPointerMapping: Test 3 XUngrabButton: Test 4 XCopyPlane: Tests 13, 22, 31 (well-known XTEST/Xinerama interaction issue) XDrawLine: Test 67 XDrawLines: Test 91 XDrawSegments: Test 68 Note that the first two sets of errors are the same as for the XFree86 4.3.0 server, and that the XCopyPlane error is a well-known error resulting from an XTEST/Xinerama interaction when the request crosses a screen boundary. The XDraw* errors are resolved when the tests are run individually and they do not cross a screen boundary. We will investigate these errors further to determine their cause. Xdmx with XTEST, with Xinerama, with GLX With GLX enabled, using the XTEST extension, the following errors were reported from Xdmx (these results are from early during the Phase IV development, but were confirmed with a late Phase IV snapshot): XListPixmapFormats: Test 1 XChangeKeyboardControl: Tests 9, 10 XRebindKeysym: Test 1 XAllowEvents: Tests 20, 21, 24 XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25 XGrabKey: Test 8 XSetPointerMapping: Test 3 XUngrabButton: Test 4 XClearArea: Test 8 XCopyArea: Tests 4, 5, 11, 14, 17, 23, 25, 27, 30 XCopyPlane: Tests 6, 7, 10, 19, 22, 31 XDrawArcs: Tests 89, 100, 102 XDrawLine: Test 67 XDrawSegments: Test 68 Note that the first two sets of errors are the same as for the XFree86 4.3.0 server, and that the third set has different failures than when Xdmx does not include GLX support. Since the GLX extension adds new visuals to support GLX's visual configs and the X Test Suite runs tests over the entire set of visuals, additional rendering tests were run and presumably more of them crossed a screen boundary. This conclusion is supported by the fact that nearly all of the rendering errors reported are resolved when the tests are run individually and they do no cross a screen boundary. Further, when hardware rendering is disabled on the back-end displays, many of the errors in the third set are eliminated, leaving only: XClearArea: Test 8 XCopyArea: Test 4, 5, 11, 14, 17, 23, 25, 27, 30 XCopyPlane: Test 6, 7, 10, 19, 22, 31 Conclusion We conclude that all of the X Test Suite errors reported for Xdmx are the result of errors in the back-end X server or the Xinerama implementation. Further, all of these errors that can be reasonably fixed at the Xdmx layer have been. (Where appropriate, we have submitted patches to the XFree86 and Xinerama upstream maintainers.) Dynamic Reconfiguration During this development phase, dynamic reconfiguration support was added to DMX. This support allows an application to change the position and offset of a back-end server's screen. For example, if the application would like to shift a screen slightly to the left, it could query Xdmx for the screen's <x,y> position and then dynamically reconfigure that screen to be at position <x+10,y>. When a screen is dynamically reconfigured, input handling and a screen's root window dimensions are adjusted as needed. These adjustments are transparent to the user. Dynamic reconfiguration extension The application interface to DMX's dynamic reconfiguration is through a function in the DMX extension library: Bool DMXReconfigureScreen(Display *dpy, int screen, int x, int y) where dpy is DMX server's display, screen is the number of the screen to be reconfigured, and x and y are the new upper, left-hand coordinates of the screen to be reconfigured. The coordinates are not limited other than as required by the X protocol, which limits all coordinates to a signed 16 bit number. In addition, all coordinates within a screen must also be legal values. Therefore, setting a screen's upper, left-hand coordinates such that the right or bottom edges of the screen is greater than 32,767 is illegal. Bounding box When the Xdmx server is started, a bounding box is calculated from the screens' layout given either on the command line or in the configuration file. This bounding box is currently fixed for the lifetime of the Xdmx server. While it is possible to move a screen outside of the bounding box, it is currently not possible to change the dimensions of the bounding box. For example, it is possible to specify coordinates of <-100,-100> for the upper, left-hand corner of the bounding box, which was previously at coordinates <0,0>. As expected, the screen is moved down and to the right; however, since the bounding box is fixed, the left side and upper portions of the screen exposed by the reconfiguration are no longer accessible on that screen. Those inaccessible regions are filled with black. This fixed bounding box limitation will be addressed in a future development phase. Sample applications An example of where this extension is useful is in setting up a video wall. It is not always possible to get everything perfectly aligned, and sometimes the positions are changed (e.g., someone might bump into a projector). Instead of physically moving projectors or monitors, it is now possible to adjust the positions of the back-end server's screens using the dynamic reconfiguration support in DMX. Other applications, such as automatic setup and calibration tools, can make use of dynamic reconfiguration to correct for projector alignment problems, as long as the projectors are still arranged rectilinearly. Horizontal and vertical keystone correction could be applied to projectors to correct for non-rectilinear alignment problems; however, this must be done external to Xdmx. A sample test program is included in the DMX server's examples directory to demonstrate the interface and how an application might use dynamic reconfiguration. See dmxreconfig.c for details. Additional notes In the original development plan, Phase IV was primarily devoted to adding OpenGL support to DMX; however, SGI became interested in the DMX project and developed code to support OpenGL/GLX. This code was later donated to the DMX project and integrated into the DMX code base, which freed the DMX developers to concentrate on dynamic reconfiguration (as described above). Doxygen documentation Doxygen is an open-source (GPL) documentation system for generating browseable documentation from stylized comments in the source code. We have placed all of the Xdmx server and DMX protocol source code files under Doxygen so that comprehensive documentation for the Xdmx source code is available in an easily browseable format. Valgrind Valgrind, an open-source (GPL) memory debugger for Linux, was used to search for memory management errors. Several memory leaks were detected and repaired. The following errors were not addressed: When the X11 transport layer sends a reply to the client, only those fields that are required by the protocol are filled in -- unused fields are left as uninitialized memory and are therefore noted by valgrind. These instances are not errors and were not repaired. At each server generation, glxInitVisuals allocates memory that is never freed. The amount of memory lost each generation approximately equal to 128 bytes for each back-end visual. Because the code involved is automatically generated, this bug has not been fixed and will be referred to SGI. At each server generation, dmxRealizeFont calls XLoadQueryFont, which allocates a font structure that is not freed. dmxUnrealizeFont can free the font structure for the first screen, but cannot free it for the other screens since they are already closed by the time dmxUnrealizeFont could free them. The amount of memory lost each generation is approximately equal to 80 bytes per font per back-end. When this bug is fixed in the the X server's device-independent (dix) code, DMX will be able to properly free the memory allocated by XLoadQueryFont. RATS RATS (Rough Auditing Tool for Security) is an open-source (GPL) security analysis tool that scans source code for common security-related programming errors (e.g., buffer overflows and TOCTOU races). RATS was used to audit all of the code in the hw/dmx directory and all "High" notations were checked manually. The code was either re-written to eliminate the warning, or a comment containing "RATS" was inserted on the line to indicate that a human had checked the code. Unrepaired warnings are as follows: Fixed-size buffers are used in many areas, but code has been added to protect against buffer overflows (e.g., snprintf). The only instances that have not yet been fixed are in config/xdmxconfig.c (which is not part of the Xdmx server) and input/usb-common.c. vprintf and vfprintf are used in the logging routines. In general, all uses of these functions (e.g., dmxLog) provide a constant format string from a trusted source, so the use is relatively benign. glxProxy/glxscreens.c uses getenv and strcat. The use of these functions is safe and will remain safe as long as ExtensionsString is longer then GLXServerExtensions (ensuring this may not be ovious to the casual programmer, but this is in automatically generated code, so we hope that the generator enforces this constraint).
xorg-server-1.17.1/hw/dmx/doc/DMXSpec.txt0000664000175100017510000007631512160102336014776 00000000000000 Client-to-Server DMX Extension to the X Protocol $Date$, $Revision$ Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) Copyright 2002-2004 Red Hat Inc., Raleigh, North Carolina. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation on the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1. Overview The client-to-server DMX extension to the X protocol (DMX) provides normal client applications with the ability to determine information about the characteristics of the Xdmx server and the back-end X servers that DMX is using. The name for this extension is "DMX". 2. Syntactic conventions This document uses the same syntactic conventions requests and data types as [X11R6.4]. 3. Data types No new data types are defined by this extension. All data types referenced in this document are defined in [X11R6.4]. 4. Requests DMXQueryVersion ==> majorVersion: CARD32 minorVersion: CARD32 patchVersion: CARD32 Errors: None The protocol this extension actually supports is indicated by majorVersion and minorVersion (patchVersion indicates the patchlevel and is for informational purposes only). Any incompatible changes to the protocol should be indicated by incrementing majorVersion. Small, upward-compatible changes should be indicated by incrementing minorVersion. Servers that support the protocol defined in this document will return a majorVersion of 2 and a minorVersion of 2. (Version 1.5 was the last version in the 1.x series; version 2.0 was a testing version that was poorly defined.) DMXSync ==> status: CARD32 Errors: None This request was first supported in version 1.5 of this protocol. The status field in the reply was introduced in version 2.0 of this protocol. Since the status field is ignored, no changes to the underlying protocol were required. This request flushes all pending protocol requests between the Xdmx server and each back-end X server. It is used by clients that talk directly to back-end X servers to ensure that all pending Xdmx requests have reached all back-end servers and have been processed by those servers. The value of status is always 0. DMXForceWindowCreation window: CARD32 ==> status: CARD32 Errors: Window This request was first supported in version 1.2 of this protocol. This request was changed to have a reply in version 2.0 of this protocol. The old version of this request was deprecated and will return BadImplementation. When using the lazy window creation optimization, windows are not created on the back-end X servers until they are required. This request forces the immediate creation of the window requested. The value of status is always 0. DMXGetScreenCount ==> screenCount: CARD32 Errors: None This request returns the number of screens that the Xdmx server controls. Since a DMX screen usually fills all of the available area on a back-end server, there is usually a one-to-one correspondence between DMX screens and backend servers. However, it is also possible for a DMX screen to cover only part of the available area on a back-end server, and for more than one DMX screen to occupy different parts of the visible area on the same back-end server. A DMX screen may be managed as a regular X screen in the Xdmx server or may be joined with other DMX screens using Xinerama. DMXGetScreenAttributes physicalScreen: CARD32 ==> displayName: STRING8 logicalScreen: CARD32 screenWindowWidth: CARD16 screenWindowHeight: CARD16 screenWindowXoffset: INT16 screenWindowYoffset: INT16 rootWindowWidth: CARD16 rootWindowHeight: CARD16 rootWindowXoffset: INT16 rootWindowYoffset: INT16 rootWindowXorigin: INT16 rootWindowYorigin: INT16 Errors: Value This request is new in version 2.0 of this protocol. The old DMXGetScreenInformation request is deprecated and will now return BadImplementation. This request returns attributes about a single DMX screen. The physicalScreen value is between 0 and screenCount-1, inclusive (values outside this range will result in a Value error). The displayname is the name used to open the display, either from the Xdmx command-line or from the configuration file. The logicalScreen value is the value of the screen that that Xdmx server exports to clients. When Xinerama is in use, this value is typically 0 for all values of physicalScreen. If Xinerama is in use, the rootWindowXOrigin and rootWindowYOrigin values specify where the physical screen is positioned in the global Xinerama coordinate system. Otherwise, these values are set to 0. The screenWindow values comprise a geometry specification (see X(7x)) for the location of the DMX screen on the back-end screen. The coordinant system of the back-end display is used. The first four rootWindow values comprise a geometry specification (see X(7x)) for the location of the root window on the screen window. The coordinant system of the screen window is used. In most cases, the root window will have the same geometry as the DMX screen window, and will occupy the same area of the back-end display. (This would not be the case, for example, if automatic projector alignment is used.) DMXChangeScreensAttributes screenCount: CARD32 maskCount: CARD32 screens: LISTofCARD32 valueMasks: LISTofCARD32 valueList: LISTofVALUES ==> status: CARD32 errorScreen: CARD32 Errors: Length, Alloc This request was first supported in version 2.0 of this protocol. (A singular version of this request with the ability to change some RootWindow attributes was supported in version 1.3 of this protocol, has been deprecated, and will return BadImplementation.) This request changes the geometries and positions of the DMX screen and DMX root windows on the back-end X servers. The valueMask and valueList specify which attributes are to be changed. The possible values are: Attribute Type ScreenWindowWidth CARD16 ScreenWindowHeight CARD16 ScreenWindowXoffset INT16 ScreenWindowYoffset INT16 RootWindowWidth CARD16 RootWindowHeight CARD16 RootWindowXoffset INT16 RootWindowYoffset INT16 RootWindowXorigin INT16 RootWindowYorigin INT16 The attribute values have the same meaning as do the corresponding values for DMXGetScreenAttributes. Non-fatal errors will be returned in status (0 otherwise): DmxBadXinerama: Xinerama is not active DmxBadValue: The resulting position is not allowed (e.g., one corner is outside the bounding box) On error, errorScreen will contain the number of the screen that caused the first error. DMXAddScreen displayName: STRING8 physicalScreen: CARD32 valueMask: CARD32 valueList: LISTofVALUES ==> status: CARD32 physicalScreen: CARD32 Errors: Length, Alloc, Value This request was first supported in version 2.2 of this protocol. This request re-attaches the back-end physicalScreen to the Xdmx server. Only back-end screens that have been previously detached with DMXRemoveScreen may be added. The name of the back-end display is given in displayName, and this will replace the name of the back-end screen that was detached. Both the displayName and physicalScreen must be correct for this request to work. The valueMask and valueList specify the attributes to be used. The possible values are: Attribute Type ScreenWindowWidth CARD16 ScreenWindowHeight CARD16 ScreenWindowXoffset INT16 ScreenWindowYoffset INT16 RootWindowWidth CARD16 RootWindowHeight CARD16 RootWindowXoffset INT16 RootWindowYoffset INT16 RootWindowXorigin INT16 RootWindowYorigin INT16 The attribute values have the same meaning as do the corresponding values for DMXGetScreenAttributes. On success, status will be 0 and physicalScreen will contain the new screen number. On failure, status will be non-zero. The status will be 1 if any of the following occured: * the -addremovescreens command-line option was not specified on the Xdmx command line * the value of physicalScreen is out of range * physicalScreen has not been detached (with DMXRemoveScreen) * displayName cannot be opened * the visuals of displayname do not match the visuals that Xdmx is using * the screen data for displayName does not match the data for the previously removed display The status will be DmxBadValue if the attribute values are out of range. DMXRemoveScreen physicalScreen: CARD32 ==> status: CARD32 Errors: None This request was first supported in version 2.2 of this protocol. This request detaches the physicalScreen screen. On success, status will be 0. On failure, the status will 1 if any of the following occur: * the -addremovescreens command-line option was not specified on the Xdmx command line * the value of physicalScreen is out of range * the back-end screen has already been detached. DMXGetWindowAttributes window: CARD32 ==> screenCount: CARD32 screens: LISTofCARD32 windows: LISTofCARD32 pos: LISTofRECTANGLE vis: LISTofRECTANGLE Errors: Window, Alloc This request computes the return values incorrectly for version 1.0 of this protocol. Version 1.1 of this protocol conforms to this description. In version 2.0, the name of this request was changed from DMXGetWindowInformation. However, since the request itself did not change, no changes to the underlying protocol were made. Given a window ID on the Xdmx server, this request returns data about how the window is represented on the back-end X servers. For each back-end X server that displays a portion of the window, the following information is returned: 1) the number of the physical screen containing that portion (which can be used with the DMXGetScreenAttributes request to obtain more information about the screen), 2) the window ID on the back-end X server of the window containing that portion, 3) the position and dimensions of the window on the back-end, in screen coordinates, and 4) the visible area of the window on the back-end, in window-relative coordinates (all zeros for windows that are not visible). Note that DMX allows multiple back-end windows to overlap in their view of the DMX logical window. Further, a logical window does not have to be completely covered by back-end windows -- there may be gaps. As an example, consider a 500x500 window that spans the top two 1024x768 back-end displays (A and B) of a 2048x1536 DMX display composed of 4 1024x768 back-end displays arranged in a cube: A B C D In this case, the DMXGetWindowAttributes call would return the following information for the 500x500 window: display A: 500x500 window at 1024-250,0 (relative to back end) with 250x500 visible at 0,0 (relative to window origin) display B: 500x500 window at -250,0 (relative to back end) with 250x500 visible at 250,0 (relative to window origin) display C: 500x500 window at 1024-250,-768 with 0x0 visible at 0,0 display D: 500x500 window at -250,-768 with 0x0 visible at 0,0 Note that if the specified window has not yet been mapped when DMXGetWindowAttributes is called, then a subsequent XMapWindow call might be buffered in xlib while requests directly to the back-end X servers are processed. This race condition can be solved by calling DMXSync before talking directly to the back-end X servers. DMXGetDesktopAttributes ==> width: INT16 height: INT16 shiftX: INT16 shiftY: INT16 Errors: None This request was first supported in version 2.0 of this protocol. This request returns the size of the bounding box of the whole screen in width and height. The shiftX and shiftY values will always be 0. The global bounding box is computed whether or not Xinerama is active, and may be larger than the Xinerama screen size because of information in the configuration file. DMXChangeDesktopAttributes valueMask: BITMASK valueList: LISTofVALUE ==> status: CARD32 Errors: Length, Value This request was first supported in version 2.0 of this protocol. This request resizes the bounding box of the whole screen when using the Xinerama extension. Otherwise, it has no effect on the screen layout. The valueMask and valueList specify which attributes are to be changed. The possible values are: Attriubute Type Width INT16 Height INT16 ShiftX INT16 ShiftY INT16 Width and Height specify the new width and height for the bounding box. ShiftX and ShiftY specify where the Xinerama origin will be placed with respect to the origin of the new bounding box. This allows the left and upper edges of the bounding box to be changed without changing the visual position of the windows on the desktop. If Width or Height is not specified, the current values will be used. If ShiftX or ShiftY is not specified, 0 will be used. All coordinants are in the global DMX coordinant system. If Xinerama is not active, this request is not useful. Non-fatal errors will be returned in status (0 otherwise): DmxBadXinerama: Xinerama is not active DmxBadValue: The size of the bounding box is too large DMXGetInputCount ==> inputCount: CARD32 This request was first supported in version 1.1 of this protocol. This request returns the number of input devices connected to the Xdmx server. This number is the same as that returned by XListInputDevices, but is available even when the XInput extension is not supported. DMXGetInputAttributes deviceId: CARD32 ==> inputType: CARD32 physicalScreen: CARD32 physicalId: CARD32 isCore: BOOL sendsCore: BOOL detached: BOOL name: STRING8 Errors: Value This request was first supported in version 1.1 of this protocol. In version 2.0, the name of this request was changed from DMXGetInputInformation. However, since the request itself did not change, no changes to the underlying protocol were made. In version 2.2, the name of detached was changed from reservation. There was no change in underlying protocol. This request returns information about the specified input device that cannot be obtained from the XListInputDeivices call. The deviceId is the same as that used by the XListInputDevices call, and must be in the range 0 to inputCount-1, inclusive (values outside this range will result in a Value error). The value of inputType will always be valid, and will be one of the following values: 0 for local (and dummy) devices, 1 for console devices, and 2 for back-end devices. For local devices, all other fields returned, except isCore and sendsCore, are invalid. For console devices, the physicalScreen and physicalID will be invalid, and the name will return the name of the X server on which the console window is displayed. For back-end devices, the physicalScreen will identify the back-end display and can be used as an argument to DMXGetScreenAttributes to obtain more information; the physicalId will be the XInput device id on the back-end X server; and the name will be invalid (since it does not provide any additional information that cannot be obtained with DMXGetScreenAttributes). If isCore is True, then this device is active as a true core input device and will send core events. If sendsCore is True, then this device is an XInput extension device, but sends core events instead of extension events. Note that this behavior is different from that of XFree86 or Xorg, where XInput extension devices may send both extension events and core events. If detached is True, then this device has been detached and is no longer producing input events. The device may be reattached using DMXAddInput. DMXAddInput displayName: STRING8 valueMask: CARD32 valueList: LISTofVALUES ==> status: CARD32 physicalId: CARD32 Errors: Value, Access This request was first supported in version 2.2 of this protocol. The valueMask and valueList specify the attributes to be used. The possible values are: Attribute Type InputType CARD32 InputPhysicalScreen CARD32 InputSendsCore BOOL This request attaches an input device to the Xdmx server. The value of inputType will be one: 1 for console devices, and 2 for back-end devices. Other values of InputType will return a BadValue error. Local devices (inputType=0 in DMXGetInputAttributes) cannot be attached or removed. For console devices, displayName will store the name of the display to be used. For back-end devices, InputPhysicalScreen will specify the screen number. BadValue will be returned if the screen number is out of range. BadAccess will be returned if the input has already been attached or if the backend screen is currently detached. If InputSendsCore is True, the new device will be added as a true core device. If a device was removed with DMXRemoveInput an attempt will be made to reconnect the previous devices (InputSendsCore is ignored in this case). DMXRemoveInput physicalId: CARD32 ==> status: CARD32 Errors: Value, Access This request was first supported in version 2.2 of this protocol. This request detaches the input device with physicalId, and all associated inputs (e.g., if the physicalId is a backend mouse, and a keyboard is also attached to the backend, then both devices will be detached). If the physicalId is outside the valid range (0 to one less than the value returned by DMXInputCount), BadValue is returned. If the physicalId has already been detached, BadAccess is returned. The status is always 0. 5. Events No new events are defined by this extension. 6. Errors No new events are defined by this extension. 7. Encoding Deprecated DMX opcodes: DMXGetScreenInformation 2 DMXForceWindowCreation 6 DMXReconfigureScreen 7 Valid DMX opcodes: DMXQueryVersion 0 DMXSync 8 DMXForceWindowCreation 9 DMXGetScreenCount 1 DMXGetScreenAttributes 10 DMXChangeScreensAttributes 11 DMXAddScreen 12 DMXRemoveScreen 13 DMXGetWindowAttributes 3 DMXGetDesktopAttributes 14 DMXChangeDesktopAttributes 15 DMXGetInputCount 4 DMXGetInputAttributes 5 DMXAddInput 16 DMXRemoveInput 17 DMXQueryVersion 1 CARD8 opcode (X assigned) 1 0 DMX opcode (X_DMXQueryVersion) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 majorVersion 4 CARD32 minorVersion 4 CARD32 patchVersion 12 unused DMXSync 1 CARD8 opcode (X assigned) 1 8 DMX opcode (X_DMXSync) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 20 unused DMXForceWindowCreation 1 CARD8 opcode (X assigned) 1 9 DMX opcode (X_DMXForceWindowCreation) 2 2 request length 4 CARD32 window ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 20 unused DMXGetScreenCount 1 CARD8 opcode (X assigned) 1 1 DMX opcode (X_DMXGetScreenCount) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 screenCount 20 unused DMXGetScreenAttributes 1 CARD8 opcode (X assigned) 1 10 DMX opcode (X_DMXGetScreenAttributes) 2 2 request length 4 CARD32 physicalScreen ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 1+(n+p)/4 reply length 4 n displayNameLength 4 CARD32 logicalScreen 2 CARD16 screenWindowWidth 2 CARD16 screenWindowHeight 2 INT16 screenWindowXoffset 2 INT16 screenWindowYoffset 2 CARD16 rootWindowWidth 2 CARD16 rootWindowHeight 2 INT16 rootWindowXoffset 2 INT16 rootWindowYoffset 2 INT16 rootWindowXorigin 2 INT16 rootWindowYorigin n displayName p pad(n) DMXChangeScreensAttributes 1 CARD8 opcode (X assigned) 1 11 DMX opcode (X_DMXChangeScreenAttributes) 2 3+s+m+n request length 4 s screenCount 4 m maskCount 4s LISTofCARD32 screens 4m LISTofCARD32 valueMasks 4n LISTofVALUES valueList ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 4 CARD32 errorScreen 16 unused DMXAddScreen 1 CARD8 opcode (X assigned) 1 12 DMX opcode (X_DMXAddScreen) 2 3+m+(n+p)/4 request length 4 n displayNameLength 4 CARD32 physicalScreen 4 CARD32 valueMask 4m LISTofVALUES valueList n displayName p pad(n) ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 4 CARD32 physicalScreen 16 unused DMXRemoveScreen 1 CARD8 opcode (X assigned) 1 13 DMX opcode (X_DMXRemoveScreen) 2 2 request length 4 CARD32 physicalScreen ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 20 unused DMXGetWindowAttributes 1 CARD8 opcode (X assigned) 1 3 DMX opcode (X_DMXGetWindowAttributes) 2 2 request length 4 CARD32 window ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 n*6 reply length 4 n screenCount 20 unused n*4 LISTofCARD32 screens n*4 LISTofCARD32 windows n*8 LISTofRECTANGLE pos n*8 LISTofRECTANGLE vis DMXGetDesktopAttributes 1 CARD8 opcode (X assigned) 1 14 DMX opcode (X_DMXGetDesktopAttributes) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 2 INT16 width 2 INT16 height 2 INT16 shiftX 2 INT16 shiftY 16 unused DMXChangeDesktopAttributes 1 CARD8 opcode (X assigned) 1 15 DMX opcode (X_DMXChangeDesktopAttributes) 2 2+n request length 4 BITMASK valueMask 4n LISTofVALUES valueList ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 20 unused DMXGetInputCount 1 CARD8 opcode (X assigned) 1 4 DMX opcode (X_DMXGetInputCount) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 inputCount 20 unused DMXGetInputAttributes 1 CARD8 opcode (X assigned) 1 5 DMX opcode (X_DMXGetInputAttributes) 2 2 request length 4 CARD32 deviceId ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 (n+p)/4 reply length 4 CARD32 inputType 4 CARD32 physicalScreen 4 CARD32 physicalId 4 n nameLength 1 BOOL isCore 1 BOOL sendsCore 1 BOOL detached 5 unused n name p pad(n) DMXAddInput 1 CARD8 opcode (X assigned) 1 16 DMX opcode (X_DMXAddInput) 2 3+m+(n+p)/4 request length 4 n displayNameLength 4 CARD32 valueMask 4m LISTofVALUES valueList n displayName p pad(n) ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 4 CARD32 physicalId 16 unused DMXRemoveInput 1 CARD8 opcode (X assigned) 1 17 DMX opcode (X_DMXRemoveInput) 2 3 request length 4 CARD32 physicalId ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 20 unused 8. Changes to existing requests/replies/events No changes to existing requests, replies, or events are necessitated by this extension. 9. Acknowledgments 10. References [X11R6.4] Robert W. Sheifler. X Window System Protocol, X Consortium Standard, X Version 11, Release 6.4. Available from xc/doc/specs/XProtocol and xc/doc/hardcopy/XProtocol. xorg-server-1.17.1/hw/dmx/doc/DMXSpec-v1.txt0000664000175100017510000003777312160102336015327 00000000000000 Client-to-Server DMX Extension to the X Protocol $Date$, $Revision$ Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) Copyright 2002,2003 Red Hat Inc., Raleigh, North Carolina. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation on the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1. Overview The client-to-server DMX extension to the X protocol (DMX) provides normal client applications with the ability to determine information about the characteristics of the Xdmx server and the back-end X servers that DMX is using. The name for this extension is "DMX". 2. Syntactic conventions This document uses the same syntactic conventions requests and data types as [X11R6.4]. 3. Data types No new data types are defined by this extension. All data types referenced in this document are defined in [X11R6.4]. 4. Requests DMXQueryVersion ==> majorVersion: CARD32 minorVersion: CARD32 patchVersion: CARD32 The protocol this extension actually supports is indicated by majorVersion and minorVersion (patchVersion indicates the patchlevel and is for informational purposes only). Any incompatible changes to the protocol should be indicated by incrementing majorVersion. Small, upward-compatible changes should be indicated by incrementing minorVersion. Servers that support the protocol defined in this document will return a majorVersion of 1 and a minorVersion of 1. DMXGetScreenCount ==> screenCount: CARD32 This request returns the number of back-end screens that the Xdmx server controls. A back-end screen may be managed as a regular X screen in the Xdmx server or may be joined with other back-end screens using Xinerama. (The information returned by this request does not change while Xdmx is running and may be cached on the client side.) DMXGetScreenInformation physicalScreen: CARD32 ==> displayName: STRING8 width: CARD16 height: CARD16 xoffset: INT16 yoffset: INT16 logicalScreen: CARD32 xorigin: INT16 yorigin: INT16 Errors: Value This request returns information about individual back-end screens. The physicalScreen value is between 0 and screenCount-1, inclusive (values outside this range will result in a Value error). The displayname is the name used to open the display, either from the Xdmx command-line or from the configuration file. The width, height, xoffset, and yoffset values comprise a geometry specification (see X(7x)) for the location of the DMX window on the back-end screen. This request will always return non-negative (i.e., normalized) values for xoffset and yoffset. The logicalScreen value is the value of the screen that that Xdmx server exports to clients. When Xinerama is in use, this value is typically 0 for all values of physicalScreen. If Xinerama is in use, the xorigin and yorigin values specify where the physical screen is positioned in the global Xinerama coordinate system. Otherwise, these values are set to 0. (The information returned by this request does not change while Xdmx is running and may be cached on the client side.) DMXGetWindowInformation window: CARD32 ==> screenCount: CARD32 screens: LISTofCARD32 windows: LISTofCARD32 pos: LISTofRECTANGLE vis: LISTofRECTANGLE Errors: Window, Alloc This request computed the return values incorrectly for version 1.0 of this protocol. Version 1.1 of this protocol conforms to this description. Given a window ID on the Xdmx server, this request returns data about how the window is represented on the back-end X servers. For each back-end X server that displays a portion of the window, the following information is returned: 1) the number of the physical screen containing that portion (which can be used with the DMXGetScreenInformation request to obtain more information about the screen), 2) the window ID on the back-end X server of the window containing that portion, 3) the position and dimensions of the window on the back-end, in screen coordinates, and 4) the visible area of the window on the back-end, in window-relative coordinates (all zeros for windows that are not visible) Note that DMX allows multiple back-end windows to overlap in their view of the DMX logical window. Further, a logical window does not have to be completely covered by back-end windows -- there may be gaps. As an example, consider a 500x500 window that spans the top two 1024x768 back-end displays (A and B) of a 2048x1536 DMX display composed of 4 1024x768 back-end displays arranged in a cube: A B C D In this case, the DMXGetWindowInformation call would return the following information for the 500x500 window: display A: 500x500 window at 1024-250,0 (relative to back end) with 250x500 visible at 0,0 (relative to window origin) display B: 500x500 window at -250,0 (relative to back end) with 250x500 visible at 250,0 (relative to window origin) display C: 500x500 window at 1024-250,-768 with 0x0 visible at 0,0 display D: 500x500 window at -250,-768 with 0x0 visible at 0,0 Note that if the specified window has not yet been mapped when DMXGetWindowInformation is called, then a subsequent XMapWindow call might be buffered in xlib while requests directly to the back-end X servers are processed. This race condition can be solved by calling DMXSync before talking directly to the back-end X servers. DMXGetInputCount ==> inputCount: CARD32 This request was first supported in version 1.1 of this protocol. This request returns the number of input devices connected to the Xdmx server. This number is the same as that returned by XListInputDevices, but is available even when the XInput extension is not supported. DMXGetInputInformation deviceId: CARD32 ==> inputType: CARD32 physicalScreen: CARD32 physicalId: CARD32 isCore: BOOL sendsCore: BOOL name: STRING8 Errors: Value This request was first supported in version 1.1 of this protocol. This request returns information about the specified input device that cannot be obtained from the XListInputDeivices call. The deviceId is the same as that used by the XListInputDevices call, and must be in the range 0 to inputCount-1, inclusive (values outside this range will result in a Value error). The value of inputType will always be value, and will be one of the following values: 0 for local (and dummy) devices, 1 for console devices, and 2 for back-end devices. For local devices, all other fields returned, except isCore and sendsCore, are invalid. For console devices, the physicalScreen and physicalID will be invalid, and the name will return the name of the X server on which the console window is displayed. For back-end devices, the physicalScreen will identify the back-end display and can be used as an argument to DMXGetScreenInformation to obtain more information; the physicalId will be the XInput device id on the back-end X server; and the name will be invalid (since it does not provide any additional information that cannot be obtained with DMXGetScreenInformation). If isCore is True, then this device is active as a true core input device and will send core events. If sendsCore is True, then this device queried an XInput extension device, but sends core events instead of extension events. Note that this behavior is different from that of XFree86, where XInput extension devices may send both extension events and core events. DMXForceWindowCreation window: CARD32 ==> Errors: Window This request was first supported in version 1.2 of this protocol. When using the lazy window creation optimization, windows are not created on the back-end X servers until they are required. This request forces the immediate creation of the window requested. DMXReconfigureScreen screen: CARD32 x: INT16 y: INT16 ==> status: CARD32 Errors: Value This request was first supported in version 1.3 of this protocol. This request reconfigures the screen position to coordinates (x,y) when using the Xinerama extension. Otherwise, it is a NOP. Illegal values for screen will result in a BadValue error. Other non-fatal errors will be returned in status. DMXSync ==> This request was first supported in version 1.5 of this protocol. This request flushes all pending protocol requests between the Xdmx server and each back-end X server. It is used by a client that talks directly to back-end X servers To ensure proper synchronization semantics, this request has a reply, but the reply does not carry any information. 5. Events No new events are defined by this extension. 6. Errors No new events are defined by this extension. 7. Encoding DMXQueryVersion 1 CARD8 opcode (X assigned) 1 0 DMX opcode (X_DMXQueryVersion) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 majorVersion 4 CARD32 minorVersion 4 CARD32 patchVersion 12 unused DMXGetScreenCount 1 CARD8 opcode (X assigned) 1 1 DMX opcode (X_DMXGetScreenCount) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 screenCount 20 unused DMXGetScreenInformation 1 CARD8 opcode (X assigned) 1 2 DMX opcode (X_DMXGetScreenInformation) 2 2 request length 4 CARD32 physicalScreen ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 n/4+p reply length 4 n displayNameLength 2 CARD16 width 2 CARD16 height 2 INT16 xoffset 2 INT16 yoffset 4 CARD32 logicalScreen 2 INT16 xorigin 2 INT16 yorigin 4 unused n displayName p pad(n) DMXGetWindowInformation 1 CARD8 opcode (X assigned) 1 3 DMX opcode (X_DMXGetWindowInformation) 2 2 request length 4 CARD32 window ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 n*6 reply length 4 n screenCount 20 unused n*4 LISTofCARD32 screens n*4 LISTofCARD32 windows n*8 LISTofRECTANGLE pos n*8 LISTofRECTANGLE vis DMXGetInputCount 1 CARD8 opcode (X assigned) 1 DMX opcode (X_DMXGetInputCount) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 inputCount 20 unused DMXGetInputInformation 1 CARD8 opcode (X assigned) 1 4 DMX opcode (X_DMXGetInputInformation) 2 2 request length 4 CARD32 deviceId ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 n/4+p reply length 4 CARD32 inputType 4 CARD32 physicalScreen 4 CARD32 physicalId 4 n nameLength 1 BOOL isCore 1 BOOL sendsCore 6 unused n name p pad(n) DMXForceWindowCreation 1 CARD8 opcode (X assigned) 1 2 DMX opcode (X_DMXForceWindowCreation) 2 2 request length 4 CARD32 window ==> DMXReconfigureScreen 1 CARD8 opcode (X assigned) 1 2 DMX opcode (X_DMXReconfigureScreen) 2 2 request length 4 CARD32 screen 2 INT16 x 2 INT16 y ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 4 CARD32 status 20 unused DMXSync 1 CARD8 opcode (X assigned) 1 0 DMX opcode (X_DMXSync) 2 1 request length ==> 1 1 Reply 1 unused 2 CARD16 sequence number 4 0 reply length 24 unused 8. Changes to existing requests/replies/events No changes to existing requests, replies, or events are necessitated by this extension. 9. Acknowledgments 10. References [X11R6.4] Robert W. Sheifler. X Window System Protocol, X Consortium Standard, X Version 11, Release 6.4. Available from xc/doc/specs/XProtocol and xc/doc/hardcopy/XProtocol. xorg-server-1.17.1/hw/dmx/doc/scaled.xml0000664000175100017510000011112412160102336014733 00000000000000 %defs; ]>
Scaled Window Support in DMX Kevin E.Martin Rickard E.Faith 15 October 2003 (created 19 September 2003) X Server Version &xserver.version; This document investigates the possibility of adding scaled window support to the DMX X server, thereby allowing a window or some selected part of the logical DMX area to be displayed using a scaling factor. For example, this might allow the contents of a window to be magnified for easier viewing. In particular, scaling for the VNC client is explored. Copyright 2003 by Red Hat, Inc., Raleigh, North Carolina Introduction DMX The DMX X server (Xdmx) is a proxy server that is designed to allow X servers on multiple machines to be combined into a single multi-headed X server. Combined with Xinerama, these heads can appear as a single very high-resolution screen. Typical applications include the creation of a video wall with 16 1280x1024 displays arranged in a rectangle, for a total resolution of of 5120x4096. Problem Statement Applications displayed on a physically large video wall that provides high pixel-resolution may be difficult to see, especially if the application is designed for use on a typical desktop computer with a relatively small display located close to the human operator. The goal of this paper is to describe and discuss solutions to this problem. The original driving problem for this work is to provide scaling for the vncviewer application when displayed using DMX (VNC scaling is currently available only with the Windows client, and there is no plan to extend that capability to other clients). While this specific problem will be addressed in this paper, the general solution space will also be explored, since this may lead to a good solution not only for vncviewer but also for other applications. Task For reference, here is the original description of the task this paper addresses: Scaled window support (for VNC) Investigate possibility of implementing a "scaled window" extension: Add XCreateScaledWindow call that could be used in place of XCreateWindow All primitives drawn to scaled window would be scaled by appropriate (integral?) scaling factor Alternate approach: special case VNC support Previous Work This section reviews relevant previous work. VNC Scaling under VNC When using the vncviewer program for Windows, it is possible to specify a scaling factor (as numerator and denominator). When scaling is in effect, the viewer software uses StretchBlt (instead of BitBlt) to display the pixels for the user. When this call is made, the viewer already has received all of the pixel information (at full unscaled resolution). The scaling in VNC is primitive. It does not conserve bandwidth, it does not treat textual information differently (i.e., by using a suitably scaled font), and it does not provide any anti-aliasing other than that provided by the underlying (Windows-only) system library. The X Video Extension The X Video Extension is a widely-available extension to the X11 protocol that provides support for streaming video. Integral to this support is the ability to arbitrarily scale the output. In version 2.2 of the X Video specification, support for scaled still images was provided, using both shared memory and traditional transport. The API for this support uses calls that are quite similar to XCreateWindow, XPutImage, and XShmPutImage. Currently, most of the drivers implemented in XFree86 only support data in various YUV formats. However, several modern video adaptors support RGB as well. Note, though, that the target output for this scaling is an overlay plane -- so X Video provides functionality that is fundamentally different from that provided by the Windows StrechBlt call. Possible Solutions This section briefly discusses possible solutions, including major advantages and disadvantages from both the implementation and the end-user programmer standpoint. VNC-like Scaling Software Scaling The vncviewer application could be modified to provide software scaling. This is not a general solution, but it does solve one of the goals of this work. A prototype of this solution was implemented and a patch against vnc-3.3.7-unixsrc is available in the dmx/external directory. Because of limited time available for this work, all of the edge cases were not considered and the solution works well mainly for integer scaling. Currently, vncviewer writes to the X display with XPutImage, XCopyArea, and XFillRectangle. All instances of these calls have to be aware of scaling and must round correctly. In the prototype solution, rounding is incorrect and can cause artifacts. A better solution would be to cache all updates to the desktop image in vncviewer and only send the damaged area to the X display with XPutImage. This would allow the damaged area to be computed so that rounding errors do not create artifacts. This method is probably similar to what is used in the Window client. (The whole VNC suite is being re-written in C++ and the forthcoming version 4 has not been evaluated.) Scaling with the X Video Extension The scaling in the Windows vncviewer application makes use of a scaled blit that is supplied by the underlying system library. Several video cards currently provide support for a scaled blit, and some X servers (including XFree86) expose this capability to applications via the XvPutImage interface of the X Video Extension. The capability exposed by XvPutImage results in the scaled image being drawn to an overlay plane. Most video cards also provide support for a scaled blit into the normal output planes, but this is not exposed via XvPutImage. The vncviewer program could be modified to use the X Video Extension to provide scaling under X11 that is similar to the scaling currently provided under Windows. Unfortunately, Xdmx does not currently export the X Video Extension, so this would not provide an immediate solution usable with DMX. A very early-stage proof-of-concept prototype was implemented and a preliminary patch against vnc-3.3.7-unixsrc is available in the dmx/external directory. This prototype was implemented to better understand the problems that must be solved to make this solution viable: As noted under the software scaling section above, vncviewer writes to the X display with several different calls. These calls write to the normal output planes and are compatible with XvPutImage, which writes to an overlay plane. To eliminate artifacts caused by this problem, vncviewer should be modified so that a cached copy of the desktop is available, either as a client-side image or a server-side off-screen pixmap, so that XvPutImage would be the only method for writing to the X display. Although several modern graphics adaptors support hardware scaling using an RGB format (e.g., ATI Radeon, nVidia, etc.), XFree86 drivers typically only implement YUV formats. YUV generally compress the pixel information in some way. For example, two commonly implemented formats, YUY2 and UYVY provide intensity information for every RGB pixel, but only provide chroma and luminance information for pairs of horizontal pixels. Since VNC uses pixel-resolution for communicating updates on the wire, additional artifacts are introduced (because there may not be enough information from the wire to update a pair of pixels). Further, the well-known problem with YUV encoding is even more evident when the image is a desktop instead of a movie. For example, consider a 1-pixel-wide vertical window border. If the border changes in color but not intensity (e.g., because a window manager uses color to indicate focus), there may or may not be a change in the YUY2 image, depending on the algorithm used for RGB to YUV conversion and on how the border pixel is ordered in the pair of pixels used by the algorithm. Many of these artifacts could be eliminated if vncviewer cached a complete RGB image of the desktop, and only did the conversion to YUV for properly aligned areas of damage. The remaining artifacts could be eliminated if an RGB format was used with X Video (which may require the extension of existing XFree86 drivers to support RGB). Most modern video cards support exactly one overlay plane that is suitable for use with X Video. Therefore, only one application can use X Video at any given time. This is a severe limitation in a desktop environment. Implementing the X Video Extension for DMX The user-level API for X Video is fairly simple, but the underlying support required for the full specification is large. However, since the API provides a method to query supported capabilities, a usable subset of X Video can be implemented that would support XvPutImage and little else. This would require support for the following: X Video Extension API calls, including the following: XvQueryExtension XvQueryAdaptors XvQueryPortAttributes XvFreeAdaptorInfo XvListImageFormats XvGrabPort XvCreateImage XvPutImage XvShmCreateImage XvShmPutImage Support for querying back-end X Video Extension capabilities. Support for sending the image to the back-ends. Because X Video requires sending full images, there may be a trade-off between bandwidth limitations and additional complexity to divide the image up such that is scales properly. Possible support for a software fall-back. For example, if all of the back-ends do not support the X Video Extension, software scaling can be implemented such that the image is sent to the back-end with XPutImage. This pathway would have poor performance. Supporting RGB formats for the X Video Extension Assuming an XFree86 driver already supports the X Video Extension, and assuming the target hardware supports an RGB format, then adding support for that format is relatively simple and straightforward. Scaling with an XPutImageScaled Extension Instead of (or in addition to) implementing the X Video Extension in DMX, one obvious solution would be to implement a new extension that provides access to hardware-assisted scaled blits, similar to the StretchBlt call available under Windows. This call would scale RGB images and would not use the overlay plane (unlike the X Video Extension). This approach has many of the same advantages and disadvantages as the XCopyAreaScaled Extension, discussed in the next section. Discussion of XPutImageScaled is deferred in favor of XCopyAreaScaled for the following reasons: XPutImageScaled can be emulated with XCopyAreaScaled by first using XPutImage to copy the image to an off-screen pixmap, and then calling XCopyAreaScaled between that off-screen pixmap and the target drawable. Since XCopyAreaScaled would copy between two areas of on-screen or off-screen memory, it has additional uses and can be viewed as efficiently providing a superset of XPutImageScaled functionality. Scaling with an XCopyAreaScaled Extension As noted in the previous section, because XCopyAreaScaled provides a superset of the functionality provided by XPutImageScaled, we will consider this extension instead. First, XCopyAreaScaled would provide for RGB scaling between pixmaps (i.e., on-screen or off-screen areas of memory that reside on the video card). Unlike the X Video Extension, which writes into an overlay plane, XCopyAreaScaled would write into the non-overlay areas of the screen. Key points to consider are as follows: Because different planes are involved, the two scaling operations are usually implemented in hardware differently, so an XCopyAreaScaled extension could be added in a manner that would neither conflict with nor interact with the X Video extension in any way. The XCopyAreaScaled extension provides new functionality that the X Video Extension does not provide. Based on anecdotal feedback, we believe that many people outside the DMX and VNC communities would be excited about this extension. The main drawback to this extension is that it is new and needs to be implemented at the driver level in XFree86 for each video card to be supported. At the present time, it is more likely that the X Video Extension will be implemented for a particular piece hardware because the X Video extension has multimedia uses. However, over time, we would expect the XCopyAreaScaled extension to be implemented along with the X Video extension, especially if it becomes popular. Another drawback is that not all modern cards provide support for a simple scaled blit operation. However, these cards usually do provide a 3D pipeline which could be used to provide this functionality in a manner that is transparent to the client application that is using the XCopyAreaScaled extension. However, this implementation pathway would make this extension somewhat more difficult to implement on certain cards. Scaling with OpenGL Another general solution to the scaling problem is to use the texture scaling found in all 3D hardware. This ability is already exposed through OpenGL and can be exploited by clients without X server modification (i.e., other than the ability to support OpenGL). An application using OpenGL would transmit the non-scaled image to the X server as a texture, and would then display a single non-transformed rect using that texture. This also works around the single overlay problem with the X Video Extension as well as the need to implement additional scaled primitive extensions. The downside is that most OpenGL implementations require power of 2 texture sizes and this can be very wasteful of memory if, for example, the application needs to scale a 1025x1025 image, which would require a 2048x2048 texture area (even a 640x480 image would require a 1024x512 texture). Another downside is that some OpenGL implementations have a limited about of texture memory and cannot handle textures that are very large. For example, they might limit the texture size to 1024x1024. Application-transparent Scaling for DMX Back-end Scaling Without Disconnect/Reconnect VNC does scaling on the client side (in the vncviewer application). Implementing a similar solution for DMX would require support in the back-end X servers and, therefore, is not a general solution. XFree86 already implements some support for "scaling" that could be used with DMX: if, in the XF86Config file, multiple Modes are listed in the Display Subsection of the Screen Section, then pressing Ctrl-Alt-Plus and Ctrl-Alt-Minus can be used to iterate through the listed modes. The display dimensions will change to the dimensions in the Modes line, but the logical dimensions of the X server (i.e., the dimensions that Xdmx knows about) will not change. Further, the dimensions of the XFree86 display are under software control (via the XFree86-VidModeExtension), so the Xdmx server could change the screen dimensions on a per-display basis, thereby scaling the information on part of that display. However, this scaling appears to have limited use. For example, assume a 4 by 4 display wall consisting of 16 1280x1024 displays. If all of the back-end servers were simultaneously configured to display 640x480, the left hand corner of each display would be magnified, but the composite result would be unreadable. Magnifying one display at a time could be usable, but could have limited utility, since the result would still be no larger than a single display. Back-end Scaling With Disconnect/Reconnect Disconnect and reconnect features are not currently supported in DMX, but are scheduled to be implemented in the future. These features, combined with the XFree86-VidModeExtension Extension, would allow an application to do the following: Disconnect a specific back-end server (via the DMX Extension), reconfigure the XFree86 back-end server resolution, and reconnect the back-end server to DMX -- at a new origin with the new screen resolution. For example, consider a display wall consisting of 16 1280x1024 displays with a total resolution of 5120x4096. All of the screens could be disconnected, repositioned, and reconnected each at a resolution of 640x480. The total resolution of the display wall would be 2560x1920, allowing a view of a selected area approximately one-fourth of the size of the DMX display. This change would be completely application independent (except, perhaps, for a DMX-aware window manager). When work at the increased resolution was completed, the back-end servers could be disconnected, reconfigured, and reconnected for the original 5120x4096 view. Support for this type of scaling can be implemented in a DMX-aware X11 client assuming the DMX server support arbitrary disconnect and reconnect semantics. Because this application cannot be written before disconnect/reconnect is implemented, this solution will not be discussed further in this paper. Server-side Scaling In earlier versions of DMX, a frame buffer was maintained on the server side, and XPutImage was used to move the information from the server to the client (similar to some early VNC implementations). The use of a server-side frame buffer would allow the server to do scaling, but is not a recommended solution because of overall performance issues and server-side memory issues (i.e., the frame buffer would be very large for large display walls). Exploration of this path is not recommended. XCreateScaledWindow API The implementation of X Video Extension in DMX, and the use of XvPutImage by applications requiring scaling requires significant changes in DMX Further, XvPutImage is, essentially a scaled blit, and it is only useful for applications which are already using (or can be modified to use) XPutImage. Therefore, a more general API will be discussed as another possibility. X applications typically create windows with the XCreateWindow call. A new extension could provide an XCreateScaledWindow call that could be used in place of the XCreateWindow call and be otherwise transparent to the application. This would allow applications, even those that do not depend on XPutImage, to take advantage of window scaling. In this section we describe how the call would work, what transparency it provides, and how to solve the potential problems that transparency creates. XCreateWindow The XCreateWindow call takes width and height as parameters. An XCreateScaledWindow call could take all the same parameters, with the addition of a scaling factor. XSetWindowAttributes An X11 window has several attributes that would have to be scaled: Background and border pixmaps Border width Cursor XGetWindowAttributes, XGetGeometry For transparency, calls that query the window attributes should return unscaled information. This suggests that all unscaled pixmaps and window attributes should be cached. Unfortunately, a window manager requires the scaled geometry to properly decorate the window. The X server can probably determine which client is acting as the window manager (e.g., because that client will select events that are used exclusively by the window manager). However, other Scaled Window Extension aware clients may also need to determine the scaled geometry. Therefore, at least two additional extension calls should be implemented: XGetScaledWindowAttributes and XGetScaledGeometry. Popup and Child window positions Some applications may position popup and child windows based on an unscaled notion of the main window geometry. In this case, additional modifications to the client would be required. Events Most events (e.g., for mouse motion) return information about the coordinates at which the even occurred. These coordinates would have to be modified so that unscaled values were presented to the client. Implementation There are many implementation issues, some of which are similar to the issues involved in implementing the X Video Extension for DMX. The window contents must be scaled, either by performing all operations to a frame buffer and then writing the image to the display (perhaps using hardware scaling support), or by modifying all of the various drawing operations to perform scaling. Because of the complexity involved, the frame buffer option is recommended. Conclusion and Recommendations We recommend a three phase implementation strategy, based on how an application could be written to take advantage of scaling: The XCopyAreaScaled extension should be implemented, since this is the ideal solution for applications like VNC, and since making use of this extension will require minimal changes to applications that already use XPutImage or XCopyArea. The initial implementation work would include the design of the X protocol extension, writing this up in the usual format for extension documentation, implementation of the protocol transport pieces in XFree86, implementation of a software fall-back in XFree86 and DMX, one example hardware implementation for XFree86, and implementation of support for this extension in DMX. We suggest implementing the extension first on the ATI Radeon cards. However, since these cards do not provide a 2D scaled blit primitive, the implementation would have to make use of the 3D texture engine to emulate a scaled blit. This is recommended, since other modern graphics cards also do not provide a simple 2D scaled blit operation and an example of the more difficult implementation pathway would be helpful to others. Until XCopyAreaScaled is widely supported, applications that require scaling will have to fall back to another scaling method. We suggest OpenGL as the first fall-back method because it is widely available and supported by DMX. A project centered around OpenGL-based scaling would implement this scaling in VNC as an example. This work would include re-writing the vncviewer rendering engine to cache a master copy of the desktop image for all operations. Since OpenGL is not implemented everywhere, and may not provide hardware-assisted performance in every implementation, an application that requires scaling should also fall back to using the X Video Extension. This project would add support for the X Video Extension to DMX and would add support to VNC to take advantage of this extension without introducing artifacts. This would require modifying the vncviewer rendering engine to cache a master copy of the desktop image for all operations. This project should also add support for the RGB format to at least one XFree86 driver (e.g., ATI Radeon). The X Video Extension is one of the few popular extensions that DMX does not support. We recommend implementing the X Video Extension even if scaling is the specific goal of that work. We do not recommend implementation of the XCreateScaledWindow extension because of the complexity involved. We do not recommend implementation of the XPutImageScaled extension because it requires the same amount of work as the XCopyAreaScaled extension, but provides less functionality. Further, server-side scaling with a large frame buffer is not recommended because of the performance implications. The back-end scaling, especially with disconnect/reconnect support should be explored in the future after disconnect/reconnect is implemented, but not at the present time.
xorg-server-1.17.1/hw/dmx/dmxpict.h0000664000175100017510000001162012456571574014060 00000000000000/* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * This file provides access to the externally visible RENDER support * functions, global variables and macros for DMX. * * FIXME: Move function definitions for non-externally visible function * to .c file. */ #ifndef DMXPICT_H #define DMXPICT_H /** Picture private structure */ typedef struct _dmxPictPriv { Picture pict; /**< Picture ID from back-end server */ Mask savedMask; /**< Mask of picture attributes saved for * lazy window creation. */ } dmxPictPrivRec, *dmxPictPrivPtr; /** Glyph Set private structure */ typedef struct _dmxGlyphPriv { GlyphSet *glyphSets; /**< Glyph Set IDs from back-end server */ } dmxGlyphPrivRec, *dmxGlyphPrivPtr; extern void dmxInitRender(void); extern void dmxResetRender(void); extern Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats); extern void dmxCreatePictureList(WindowPtr pWindow); extern Bool dmxDestroyPictureList(WindowPtr pWindow); extern int dmxCreatePicture(PicturePtr pPicture); extern void dmxDestroyPicture(PicturePtr pPicture); extern int dmxChangePictureClip(PicturePtr pPicture, int clipType, void *value, int n); extern void dmxDestroyPictureClip(PicturePtr pPicture); extern void dmxChangePicture(PicturePtr pPicture, Mask mask); extern void dmxValidatePicture(PicturePtr pPicture, Mask mask); extern void dmxComposite(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 void dmxGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlists, GlyphListPtr lists, GlyphPtr * glyphs); extern void dmxCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects); extern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat); extern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat); extern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat, int ndef, xColorItem * pdef); extern void dmxTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps); extern void dmxTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris); extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet); extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet); extern int dmxBECreatePicture(PicturePtr pPicture); extern Bool dmxBEFreePicture(PicturePtr pPicture); /** Get the picture private data given a picture pointer */ #define DMX_GET_PICT_PRIV(_pPict) \ (dmxPictPrivPtr)dixLookupPrivate(&(_pPict)->devPrivates, dmxPictPrivateKey) /** Set the glyphset private data given a glyphset pointer */ #define DMX_SET_GLYPH_PRIV(_pGlyph, _pPriv) \ GlyphSetSetPrivate((_pGlyph), dmxGlyphSetPrivateKey, (_pPriv)) /** Get the glyphset private data given a glyphset pointer */ #define DMX_GET_GLYPH_PRIV(_pGlyph) \ (dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateKey) #endif /* DMXPICT_H */ xorg-server-1.17.1/hw/dmx/dmxfont.c0000664000175100017510000004334412366220413014051 00000000000000/* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * This file provides support for fonts. */ #ifdef HAVE_DMX_CONFIG_H #include #endif #define DMX_FONTPATH_DEBUG 0 #include "dmx.h" #include "dmxsync.h" #include "dmxfont.h" #include "dmxlog.h" #include #include "dixfont.h" #include "dixstruct.h" static int (*dmxSaveProcVector[256]) (ClientPtr); static int dmxFontLastError; static int dmxFontErrorHandler(Display * dpy, XErrorEvent * ev) { dmxFontLastError = ev->error_code; return 0; } static char ** dmxGetFontPath(int *npaths) { char **fp; unsigned char *c, *paths; char *newfp; int len, l, i; GetFontPath(serverClient, npaths, &len, &paths); newfp = malloc(*npaths + len); c = (unsigned char *) newfp; fp = malloc(*npaths * sizeof(*fp)); memmove(newfp, paths + 1, *npaths + len - 1); l = *paths; for (i = 0; i < *npaths; i++) { fp[i] = (char *) c; c += l; l = *c; *c++ = '\0'; } #if DMX_FONTPATH_DEBUG for (i = 0; i < *npaths; i++) dmxLog(dmxDebug, "FontPath[%d] = %s\n", i, fp[i]); #endif return fp; } static void dmxFreeFontPath(char **fp) { free(fp[0]); free(fp); } static Bool dmxCheckFontPathElement(DMXScreenInfo * dmxScreen, char *fp) { int (*oldErrorHandler) (Display *, XErrorEvent *); if (!dmxScreen->beDisplay) return TRUE; dmxFontLastError = 0; oldErrorHandler = XSetErrorHandler(dmxFontErrorHandler); XSetFontPath(dmxScreen->beDisplay, &fp, 1); dmxSync(dmxScreen, TRUE); /* Must complete before removing handler */ XSetErrorHandler(oldErrorHandler); return dmxFontLastError == 0; } static int dmxSetFontPath(DMXScreenInfo * dmxScreen) { int (*oldErrorHandler) (Display *, XErrorEvent *); char **fp; int result = Success; int npaths; if (!dmxScreen->beDisplay) return result; fp = dmxGetFontPath(&npaths); if (!fp) return BadAlloc; dmxFontLastError = 0; oldErrorHandler = XSetErrorHandler(dmxFontErrorHandler); XSetFontPath(dmxScreen->beDisplay, fp, npaths); dmxSync(dmxScreen, TRUE); /* Must complete before removing handler */ XSetErrorHandler(oldErrorHandler); if (dmxFontLastError) { result = dmxFontLastError; /* We could set *error here to the offending path, but it is * ignored, so we don't bother figuring out which path is bad. * If we do add this support in the future, we'll need to add * error to the function's argument list. */ } dmxFreeFontPath(fp); return result; } static int dmxCheckFontPath(DMXScreenInfo * dmxScreen, int *error) { char **oldFontPath; int nOldPaths; int result = Success; if (!dmxScreen->beDisplay) return result; /* Save old font path */ oldFontPath = XGetFontPath(dmxScreen->beDisplay, &nOldPaths); result = dmxSetFontPath(dmxScreen); /* Restore old font path */ XSetFontPath(dmxScreen->beDisplay, oldFontPath, nOldPaths); XFreeFontPath(oldFontPath); dmxSync(dmxScreen, FALSE); return result; } static int dmxProcSetFontPath(ClientPtr client) { unsigned char *ptr; unsigned long nbytes, total, n; long nfonts; int i, result; unsigned char *oldFontPath, *tmpFontPath; int nOldPaths; int lenOldPaths; REQUEST(xSetFontPathReq); REQUEST_AT_LEAST_SIZE(xSetFontPathReq); nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq); total = nbytes; ptr = (unsigned char *) &stuff[1]; nfonts = stuff->nFonts; while (--nfonts >= 0) { if ((total == 0) || (total < (n = (*ptr + 1)))) return BadLength; total -= n; ptr += n; } if (total >= 4) return BadLength; GetFontPath(serverClient, &nOldPaths, &lenOldPaths, &tmpFontPath); oldFontPath = malloc(nOldPaths + lenOldPaths); memmove(oldFontPath, tmpFontPath, nOldPaths + lenOldPaths); result = SetFontPath(client, stuff->nFonts, (unsigned char *) &stuff[1]); if (!result) { int error = 0; for (i = 0; i < dmxNumScreens; i++) if ((result = dmxCheckFontPath(&dmxScreens[i], &error))) break; if (result) { /* Restore old fontpath in the DMX server */ SetFontPath(client, nOldPaths, oldFontPath); client->errorValue = error; } } free(oldFontPath); return result; } /** Initialize font support. In addition to the screen function call * pointers, DMX also hooks in at the ProcVector[] level. Here the old * ProcVector function pointers are saved and the new ProcVector * function pointers are initialized. */ void dmxInitFonts(void) { int i; for (i = 0; i < 256; i++) dmxSaveProcVector[i] = ProcVector[i]; ProcVector[X_SetFontPath] = dmxProcSetFontPath; } /** Reset font support by restoring the original ProcVector function * pointers. */ void dmxResetFonts(void) { int i; for (i = 0; i < 256; i++) ProcVector[i] = dmxSaveProcVector[i]; } /** Load the font, \a pFont, on the back-end server associated with \a * pScreen. When a font is loaded, the font path on back-end server is * first initialized to that specified on the command line with the * -fontpath options, and then the font is loaded. */ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxFontPrivPtr pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex); const char *name; char **oldFontPath = NULL; int nOldPaths; Atom name_atom, value_atom; int i; /* Make sure we have a font private struct to work with */ if (!pFontPriv) return FALSE; /* Don't load a font over top of itself */ if (pFontPriv->font[pScreen->myNum]) { return TRUE; /* Already loaded font */ } /* Save old font path */ oldFontPath = XGetFontPath(dmxScreen->beDisplay, &nOldPaths); /* Set the font path for the font about to be loaded on the back-end */ if (dmxSetFontPath(dmxScreen)) { char **fp; int npaths; Bool *goodfps; /* This could fail only when first starting the X server and * loading the default font. If it fails here, then the default * font path is invalid, no default font path will be set, the * DMX server will fail to load the default font, and it will * exit with an error unless we remove the offending font paths * with the -ignorebadfontpaths command line option. */ fp = dmxGetFontPath(&npaths); if (!fp) { dmxLog(dmxError, "No default font path set.\n"); dmxLog(dmxError, "Please see the Xdmx man page for information on how to\n"); dmxLog(dmxError, "initialize the DMX server's default font path.\n"); XFreeFontPath(oldFontPath); return FALSE; } if (!dmxFontPath) dmxLog(dmxWarning, "No default font path is set.\n"); goodfps = malloc(npaths * sizeof(*goodfps)); dmxLog(dmxError, "The DMX server failed to set the following font paths on " "screen #%d:\n", pScreen->myNum); for (i = 0; i < npaths; i++) if (!(goodfps[i] = dmxCheckFontPathElement(dmxScreen, fp[i]))) dmxLog(dmxError, " %s\n", fp[i]); if (dmxIgnoreBadFontPaths) { char *newfp; int newnpaths = 0; int len = 0; int j = 0; dmxLog(dmxError, "These font paths will not be used because the " "\"-ignorebadfontpaths\"\n"); dmxLog(dmxError, "option is set.\n"); for (i = 0; i < npaths; i++) if (goodfps[i]) { len += strlen(fp[i]) + 1; newnpaths++; } if (!newnpaths) { /* No valid font paths were found */ dmxLog(dmxError, "After removing the font paths above, no valid font " "paths were\n"); dmxLog(dmxError, "available. Please check that the font paths set on " "the command\n"); dmxLog(dmxError, "line or in the configuration file via the " "\"-fontpath\" option\n"); dmxLog(dmxError, "are valid on all back-end servers. See the Xdmx man " "page for\n"); dmxLog(dmxError, "more information on font paths.\n"); dmxFreeFontPath(fp); XFreeFontPath(oldFontPath); free(goodfps); return FALSE; } newfp = malloc(len * sizeof(*newfp)); for (i = 0; i < npaths; i++) { if (goodfps[i]) { int n = strlen(fp[i]); newfp[j++] = n; strncpy(&newfp[j], fp[i], n); j += n; } } if (SetFontPath(serverClient, newnpaths, (unsigned char *) newfp)) { /* Note that this should never happen since all of the * FPEs were previously valid. */ dmxLog(dmxError, "Cannot reset the default font path.\n"); } } else if (dmxFontPath) { dmxLog(dmxError, "Please remove these font paths from the command line " "or\n"); dmxLog(dmxError, "configuration file, or set the \"-ignorebadfontpaths\" " "option to\n"); dmxLog(dmxError, "ignore them. For more information on these options, see " "the\n"); dmxLog(dmxError, "Xdmx man page.\n"); } else { dmxLog(dmxError, "Please specify the font paths that are available on all " "back-end\n"); dmxLog(dmxError, "servers with the \"-fontpath\" option, or use the " "\"-ignorebadfontpaths\"\n"); dmxLog(dmxError, "to ignore bad defaults. For more information on " "these and other\n"); dmxLog(dmxError, "font-path-related options, see the Xdmx man page.\n"); } free(goodfps); if (!dmxIgnoreBadFontPaths || (dmxIgnoreBadFontPaths && dmxSetFontPath(dmxScreen))) { /* We still have errors so return with error */ dmxFreeFontPath(fp); XFreeFontPath(oldFontPath); return FALSE; } } /* Find requested font on back-end server */ name_atom = MakeAtom("FONT", 4, TRUE); value_atom = 0L; for (i = 0; i < pFont->info.nprops; i++) { if ((Atom) pFont->info.props[i].name == name_atom) { value_atom = pFont->info.props[i].value; break; } } if (!value_atom) return FALSE; name = NameForAtom(value_atom); if (!name) return FALSE; pFontPriv->font[pScreen->myNum] = XLoadQueryFont(dmxScreen->beDisplay, name); /* Restore old font path */ XSetFontPath(dmxScreen->beDisplay, oldFontPath, nOldPaths); XFreeFontPath(oldFontPath); dmxSync(dmxScreen, FALSE); if (!pFontPriv->font[pScreen->myNum]) return FALSE; return TRUE; } /** Realize the font, \a pFont, on the back-end server associated with * \a pScreen. */ Bool dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxFontPrivPtr pFontPriv; if (!(pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) { FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); pFontPriv = malloc(sizeof(dmxFontPrivRec)); if (!pFontPriv) return FALSE; pFontPriv->font = NULL; MAXSCREENSALLOC(pFontPriv->font); if (!pFontPriv->font) { free(pFontPriv); return FALSE; } pFontPriv->refcnt = 0; } FontSetPrivate(pFont, dmxFontPrivateIndex, (void *) pFontPriv); if (dmxScreen->beDisplay) { if (!dmxBELoadFont(pScreen, pFont)) return FALSE; pFontPriv->refcnt++; } else { pFontPriv->font[pScreen->myNum] = NULL; } return TRUE; } /** Free \a pFont on the back-end associated with \a pScreen. */ Bool dmxBEFreeFont(ScreenPtr pScreen, FontPtr pFont) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxFontPrivPtr pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex); if (pFontPriv && pFontPriv->font[pScreen->myNum]) { XFreeFont(dmxScreen->beDisplay, pFontPriv->font[pScreen->myNum]); pFontPriv->font[pScreen->myNum] = NULL; return TRUE; } return FALSE; } /** Unrealize the font, \a pFont, on the back-end server associated with * \a pScreen. */ Bool dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxFontPrivPtr pFontPriv; if ((pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) { /* In case the font failed to load properly */ if (!pFontPriv->refcnt) { MAXSCREENSFREE(pFontPriv->font); free(pFontPriv); FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); } else if (pFontPriv->font[pScreen->myNum]) { if (dmxScreen->beDisplay) dmxBEFreeFont(pScreen, pFont); /* The code below is non-obvious, so here's an explanation... * * When creating the default GC, the server opens up the * default font once for each screen, which in turn calls * the RealizeFont function pointer once for each screen. * During this process both dix's font refcnt and DMX's font * refcnt are incremented once for each screen. * * Later, when shutting down the X server, dix shuts down * each screen in reverse order. During this shutdown * procedure, each screen's default GC is freed and then * that screen is closed by calling the CloseScreen function * pointer. screenInfo.numScreens is then decremented after * closing each screen. This procedure means that the dix's * font refcnt for the font used by the default GC's is * decremented once for each screen # greater than 0. * However, since dix's refcnt for the default font is not * yet 0 for each screen greater than 0, no call to the * UnrealizeFont function pointer is made for those screens. * Then, when screen 0 is being closed, dix's font refcnt * for the default GC's font is finally 0 and the font is * unrealized. However, since screenInfo.numScreens has * been decremented already down to 1, only one call to * UnrealizeFont is made (for screen 0). Thus, even though * RealizeFont was called once for each screen, * UnrealizeFont is only called for screen 0. * * This is a bug in dix. * * To avoid the memory leak of pFontPriv for each server * generation, we can also free pFontPriv if the refcnt is * not yet 0 but the # of screens is 1 -- i.e., the case * described in the dix bug above. This is only a temporary * workaround until the bug in dix is solved. * * The other problem is that the font structure allocated by * XLoadQueryFont() above is not freed for screens > 0. * This problem cannot be worked around here since the back- * end displays for screens > 0 have already been closed by * the time this code is called from dix. * * When the bug in dix described above is fixed, then we can * remove the "|| screenInfo.numScreens == 1" code below and * the memory leaks will be eliminated. */ if (--pFontPriv->refcnt == 0 #if 1 /* Remove this code when the dix bug is fixed */ || screenInfo.numScreens == 1 #endif ) { MAXSCREENSFREE(pFontPriv->font); free(pFontPriv); FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); } } } return TRUE; } xorg-server-1.17.1/hw/dmx/dmxextension.c0000664000175100017510000015721712366220413015124 00000000000000/* * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Author: * Rickard E. (Rik) Faith * Kevin E. Martin * */ /** \file * This file provides the only interface to the X server extension support * in programs/Xserver/Xext. Those programs should only include dmxext.h */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include #include "dmx.h" #include "dmxinit.h" #include "dmxextension.h" #include "dmxwindow.h" #include "dmxcb.h" #include "dmxcursor.h" #include "dmxpixmap.h" #include "dmxgc.h" #include "dmxfont.h" #include "dmxcmap.h" #include "dmxpict.h" #include "dmxinput.h" #include "dmxsync.h" #include "dmxscrinit.h" #include "input/dmxinputinit.h" #include "windowstr.h" #include "inputstr.h" /* For DeviceIntRec */ #include /* For DMX_BAD_* */ #include "cursorstr.h" /* The default font is declared in dix/globals.c, but is not included in * _any_ header files. */ extern FontPtr defaultFont; /* Hack to get Present to build (present requires RandR) */ RESTYPE RRCrtcType; /** This routine provides information to the DMX protocol extension * about a particular screen. */ Bool dmxGetScreenAttributes(int physical, DMXScreenAttributesPtr attr) { DMXScreenInfo *dmxScreen; if (physical < 0 || physical >= dmxNumScreens) return FALSE; dmxScreen = &dmxScreens[physical]; attr->displayName = dmxScreen->name; #ifdef PANORAMIX attr->logicalScreen = noPanoramiXExtension ? dmxScreen->index : 0; #else attr->logicalScreen = dmxScreen->index; #endif attr->screenWindowWidth = dmxScreen->scrnWidth; attr->screenWindowHeight = dmxScreen->scrnHeight; attr->screenWindowXoffset = dmxScreen->scrnX; attr->screenWindowYoffset = dmxScreen->scrnY; attr->rootWindowWidth = dmxScreen->rootWidth; attr->rootWindowHeight = dmxScreen->rootHeight; attr->rootWindowXoffset = dmxScreen->rootX; attr->rootWindowYoffset = dmxScreen->rootY; attr->rootWindowXorigin = dmxScreen->rootXOrigin; attr->rootWindowYorigin = dmxScreen->rootYOrigin; return TRUE; } /** This routine provides information to the DMX protocol extension * about a particular window. */ Bool dmxGetWindowAttributes(WindowPtr pWindow, DMXWindowAttributesPtr attr) { dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow); attr->screen = pWindow->drawable.pScreen->myNum; attr->window = pWinPriv->window; attr->pos.x = pWindow->drawable.x; attr->pos.y = pWindow->drawable.y; attr->pos.width = pWindow->drawable.width; attr->pos.height = pWindow->drawable.height; if (!pWinPriv->window || pWinPriv->offscreen) { attr->vis.x = 0; attr->vis.y = 0; attr->vis.height = 0; attr->vis.width = 0; return pWinPriv->window ? TRUE : FALSE; } /* Compute display-relative coordinates */ attr->vis.x = pWindow->drawable.x; attr->vis.y = pWindow->drawable.y; attr->vis.width = pWindow->drawable.width; attr->vis.height = pWindow->drawable.height; if (attr->pos.x < 0) { attr->vis.x -= attr->pos.x; attr->vis.width = attr->pos.x + attr->pos.width - attr->vis.x; } if (attr->pos.x + attr->pos.width > pWindow->drawable.pScreen->width) { if (attr->pos.x < 0) attr->vis.width = pWindow->drawable.pScreen->width; else attr->vis.width = pWindow->drawable.pScreen->width - attr->pos.x; } if (attr->pos.y < 0) { attr->vis.y -= attr->pos.y; attr->vis.height = attr->pos.y + attr->pos.height - attr->vis.y; } if (attr->pos.y + attr->pos.height > pWindow->drawable.pScreen->height) { if (attr->pos.y < 0) attr->vis.height = pWindow->drawable.pScreen->height; else attr->vis.height = pWindow->drawable.pScreen->height - attr->pos.y; } /* Convert to window-relative coordinates */ attr->vis.x -= attr->pos.x; attr->vis.y -= attr->pos.y; return TRUE; } void dmxGetDesktopAttributes(DMXDesktopAttributesPtr attr) { attr->width = dmxGlobalWidth; attr->height = dmxGlobalHeight; attr->shiftX = 0; /* NOTE: The upper left hand corner of */ attr->shiftY = 0; /* the desktop is always <0,0>. */ } /** Return the total number of devices, not just #dmxNumInputs. The * number returned should be the same as that returned by * XListInputDevices. */ int dmxGetInputCount(void) { int i, total; for (total = i = 0; i < dmxNumInputs; i++) total += dmxInputs[i].numDevs; return total; } /** Return information about the device with id = \a deviceId. This * information is primarily for the #ProcDMXGetInputAttributes() * function, which does not have access to the appropriate data * structure. */ int dmxGetInputAttributes(int deviceId, DMXInputAttributesPtr attr) { int i, j; DMXInputInfo *dmxInput; if (deviceId < 0) return -1; for (i = 0; i < dmxNumInputs; i++) { dmxInput = &dmxInputs[i]; for (j = 0; j < dmxInput->numDevs; j++) { DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j]; if (deviceId != dmxLocal->pDevice->id) continue; attr->isCore = ! !dmxLocal->isCore; attr->sendsCore = ! !dmxLocal->sendsCore; attr->detached = ! !dmxInput->detached; attr->physicalScreen = -1; attr->physicalId = -1; attr->name = NULL; switch (dmxLocal->extType) { case DMX_LOCAL_TYPE_LOCAL: attr->inputType = 0; break; case DMX_LOCAL_TYPE_CONSOLE: attr->inputType = 1; attr->name = dmxInput->name; attr->physicalId = dmxLocal->deviceId; break; case DMX_LOCAL_TYPE_BACKEND: case DMX_LOCAL_TYPE_COMMON: attr->inputType = 2; attr->physicalScreen = dmxInput->scrnIdx; attr->name = dmxInput->name; attr->physicalId = dmxLocal->deviceId; break; } return 0; /* Success */ } } return -1; /* Failure */ } /** Reinitialized the cursor boundaries. */ static void dmxAdjustCursorBoundaries(void) { int i; dmxReInitOrigins(); dmxInitOverlap(); dmxComputeWidthHeight(DMX_NO_RECOMPUTE_BOUNDING_BOX); dmxConnectionBlockCallback(); for (i = 0; i < dmxNumInputs; i++) { DMXInputInfo *dmxInput = &dmxInputs[i]; if (!dmxInput->detached) dmxInputReInit(dmxInput); } dmxCheckCursor(); for (i = 0; i < dmxNumInputs; i++) { DMXInputInfo *dmxInput = &dmxInputs[i]; if (!dmxInput->detached) dmxInputLateReInit(dmxInput); } } /** Add an input with the specified attributes. If the input is added, * the physical id is returned in \a deviceId. */ int dmxAddInput(DMXInputAttributesPtr attr, int *id) { int retcode = BadValue; if (attr->inputType == 1) /* console */ retcode = dmxInputAttachConsole(attr->name, attr->sendsCore, id); else if (attr->inputType == 2) /* backend */ retcode = dmxInputAttachBackend(attr->physicalScreen, attr->sendsCore, id); if (retcode == Success) { /* Adjust the cursor boundaries */ dmxAdjustCursorBoundaries(); /* Force completion of the changes */ dmxSync(NULL, TRUE); } return retcode; } /** Remove the input with physical id \a id. */ int dmxRemoveInput(int id) { return dmxInputDetachId(id); } /** Return the value of #dmxNumScreens -- the total number of backend * screens in use (these are logical screens and may be larger than the * number of backend displays). */ unsigned long dmxGetNumScreens(void) { return dmxNumScreens; } /** Make sure that #dmxCreateAndRealizeWindow has been called for \a * pWindow. */ void dmxForceWindowCreation(WindowPtr pWindow) { dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow); if (!pWinPriv->window) dmxCreateAndRealizeWindow(pWindow, TRUE); } /** Flush pending syncs for all screens. */ void dmxFlushPendingSyncs(void) { dmxSync(NULL, TRUE); } /** Update DMX's screen resources to match those of the newly moved * and/or resized "root" window. */ void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; WindowPtr pRoot = pScreen->root; WindowPtr pChild; Bool anyMarked = FALSE; /* Handle special case where width and/or height are zero */ if (w == 0 || h == 0) { w = 1; h = 1; } /* Change screen size */ pScreen->width = w; pScreen->height = h; /* Reset the root window's drawable's size */ pRoot->drawable.width = w; pRoot->drawable.height = h; /* Set the root window's new winSize and borderSize */ pRoot->winSize.extents.x1 = 0; pRoot->winSize.extents.y1 = 0; pRoot->winSize.extents.x2 = w; pRoot->winSize.extents.y2 = h; pRoot->borderSize.extents.x1 = 0; pRoot->borderSize.extents.y1 = 0; pRoot->borderSize.extents.x2 = w; pRoot->borderSize.extents.y2 = h; /* Recompute this screen's mmWidth & mmHeight */ pScreen->mmWidth = (w * 254 + dmxScreen->beXDPI * 5) / (dmxScreen->beXDPI * 10); pScreen->mmHeight = (h * 254 + dmxScreen->beYDPI * 5) / (dmxScreen->beYDPI * 10); /* Recompute this screen's window's clip rects as follows: */ /* 1. Mark all of root's children's windows */ for (pChild = pRoot->firstChild; pChild; pChild = pChild->nextSib) anyMarked |= pScreen->MarkOverlappedWindows(pChild, pChild, (WindowPtr *) NULL); /* 2. Set the root window's borderClip */ pRoot->borderClip.extents.x1 = 0; pRoot->borderClip.extents.y1 = 0; pRoot->borderClip.extents.x2 = w; pRoot->borderClip.extents.y2 = h; /* 3. Set the root window's clipList */ if (anyMarked) { /* If any windows have been marked, set the root window's * clipList to be broken since it will be recalculated in * ValidateTree() */ RegionBreak(&pRoot->clipList); } else { /* Otherwise, we just set it directly since there are no * windows visible on this screen */ pRoot->clipList.extents.x1 = 0; pRoot->clipList.extents.y1 = 0; pRoot->clipList.extents.x2 = w; pRoot->clipList.extents.y2 = h; } /* 4. Revalidate all clip rects and generate expose events */ if (anyMarked) { pScreen->ValidateTree(pRoot, NULL, VTBroken); pScreen->HandleExposures(pRoot); if (pScreen->PostValidateTree) pScreen->PostValidateTree(pRoot, NULL, VTBroken); } } #ifdef PANORAMIX #include "panoramiXsrv.h" /** Change the "screen" window attributes by resizing the actual window * on the back-end display (if necessary). */ static void dmxConfigureScreenWindow(int idx, int x, int y, int w, int h) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; ScreenPtr pScreen = screenInfo.screens[idx]; /* Resize "screen" window */ if (dmxScreen->scrnX != x || dmxScreen->scrnY != y || dmxScreen->scrnWidth != w || dmxScreen->scrnHeight != h) { dmxResizeScreenWindow(pScreen, x, y, w, h); } /* Change "screen" window values */ dmxScreen->scrnX = x; dmxScreen->scrnY = y; dmxScreen->scrnWidth = w; dmxScreen->scrnHeight = h; } /** Change the "root" window position and size by resizing the actual * window on the back-end display (if necessary) and updating all of * DMX's resources by calling #dmxUpdateScreenResources. */ static void dmxConfigureRootWindow(int idx, int x, int y, int w, int h) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; WindowPtr pRoot = screenInfo.screens[idx]->root; /* NOTE: Either this function or the ones that it calls must handle * the case where w == 0 || h == 0. Currently, the functions that * this one calls handle that case. */ /* 1. Resize "root" window */ if (dmxScreen->rootX != x || dmxScreen->rootY != y || dmxScreen->rootWidth != w || dmxScreen->rootHeight != h) { dmxResizeRootWindow(pRoot, x, y, w, h); } /* 2. Update all of the screen's resources associated with this root * window */ if (dmxScreen->rootWidth != w || dmxScreen->rootHeight != h) { dmxUpdateScreenResources(screenInfo.screens[idx], x, y, w, h); } /* Change "root" window values */ dmxScreen->rootX = x; dmxScreen->rootY = y; dmxScreen->rootWidth = w; dmxScreen->rootHeight = h; } /** Change the "root" window's origin by updating DMX's internal data * structures (dix and Xinerama) to use the new origin and adjust the * positions of windows that overlap this "root" window. */ static void dmxSetRootWindowOrigin(int idx, int x, int y) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; ScreenPtr pScreen = screenInfo.screens[idx]; WindowPtr pRoot = pScreen->root; WindowPtr pChild; int xoff; int yoff; /* Change "root" window's origin */ dmxScreen->rootXOrigin = x; dmxScreen->rootYOrigin = y; /* Compute offsets here in case has been changed above */ xoff = x - pScreen->x; yoff = y - pScreen->y; /* Adjust the root window's position */ pScreen->x = dmxScreen->rootXOrigin; pScreen->y = dmxScreen->rootYOrigin; /* Recalculate the Xinerama regions and data structs */ XineramaReinitData(); /* Adjust each of the root window's children */ if (!idx) ReinitializeRootWindow(screenInfo.screens[0]->root, xoff, yoff); pChild = pRoot->firstChild; while (pChild) { /* Adjust child window's position */ pScreen->MoveWindow(pChild, pChild->origin.x - wBorderWidth(pChild) - xoff, pChild->origin.y - wBorderWidth(pChild) - yoff, pChild->nextSib, VTMove); /* Note that the call to MoveWindow will eventually call * dmxPositionWindow which will automatically create a * window if it is now exposed on screen (for lazy window * creation optimization) and it will properly set the * offscreen flag. */ pChild = pChild->nextSib; } } /** Configure the attributes of each "screen" and "root" window. */ int dmxConfigureScreenWindows(int nscreens, CARD32 *screens, DMXScreenAttributesPtr attribs, int *errorScreen) { int i; for (i = 0; i < nscreens; i++) { DMXScreenAttributesPtr attr = &attribs[i]; int idx = screens[i]; DMXScreenInfo *dmxScreen = &dmxScreens[idx]; if (errorScreen) *errorScreen = i; if (!dmxScreen->beDisplay) return DMX_BAD_VALUE; /* Check for illegal values */ if (idx < 0 || idx >= dmxNumScreens) return BadValue; /* The "screen" and "root" windows must have valid sizes */ if (attr->screenWindowWidth <= 0 || attr->screenWindowHeight <= 0 || attr->rootWindowWidth < 0 || attr->rootWindowHeight < 0) return DMX_BAD_VALUE; /* The "screen" window must fit entirely within the BE display */ if (attr->screenWindowXoffset < 0 || attr->screenWindowYoffset < 0 || attr->screenWindowXoffset + attr->screenWindowWidth > (unsigned) dmxScreen->beWidth || attr->screenWindowYoffset + attr->screenWindowHeight > (unsigned) dmxScreen->beHeight) return DMX_BAD_VALUE; /* The "root" window must fit entirely within the "screen" window */ if (attr->rootWindowXoffset < 0 || attr->rootWindowYoffset < 0 || attr->rootWindowXoffset + attr->rootWindowWidth > attr->screenWindowWidth || attr->rootWindowYoffset + attr->rootWindowHeight > attr->screenWindowHeight) return DMX_BAD_VALUE; /* The "root" window must not expose unaddressable coordinates */ if (attr->rootWindowXorigin < 0 || attr->rootWindowYorigin < 0 || attr->rootWindowXorigin + attr->rootWindowWidth > 32767 || attr->rootWindowYorigin + attr->rootWindowHeight > 32767) return DMX_BAD_VALUE; /* The "root" window must fit within the global bounding box */ if (attr->rootWindowXorigin + attr->rootWindowWidth > (unsigned) dmxGlobalWidth || attr->rootWindowYorigin + attr->rootWindowHeight > (unsigned) dmxGlobalHeight) return DMX_BAD_VALUE; /* FIXME: Handle the rest of the illegal value checking */ } /* No illegal values found */ if (errorScreen) *errorScreen = 0; for (i = 0; i < nscreens; i++) { DMXScreenAttributesPtr attr = &attribs[i]; int idx = screens[i]; DMXScreenInfo *dmxScreen = &dmxScreens[idx]; dmxLog(dmxInfo, "Changing screen #%d attributes " "from %dx%d+%d+%d %dx%d+%d+%d +%d+%d " "to %dx%d+%d+%d %dx%d+%d+%d +%d+%d\n", idx, dmxScreen->scrnWidth, dmxScreen->scrnHeight, dmxScreen->scrnX, dmxScreen->scrnY, dmxScreen->rootWidth, dmxScreen->rootHeight, dmxScreen->rootX, dmxScreen->rootY, dmxScreen->rootXOrigin, dmxScreen->rootYOrigin, attr->screenWindowWidth, attr->screenWindowHeight, attr->screenWindowXoffset, attr->screenWindowYoffset, attr->rootWindowWidth, attr->rootWindowHeight, attr->rootWindowXoffset, attr->rootWindowYoffset, attr->rootWindowXorigin, attr->rootWindowYorigin); /* Configure "screen" window */ dmxConfigureScreenWindow(idx, attr->screenWindowXoffset, attr->screenWindowYoffset, attr->screenWindowWidth, attr->screenWindowHeight); /* Configure "root" window */ dmxConfigureRootWindow(idx, attr->rootWindowXoffset, attr->rootWindowYoffset, attr->rootWindowWidth, attr->rootWindowHeight); /* Set "root" window's origin */ dmxSetRootWindowOrigin(idx, attr->rootWindowXorigin, attr->rootWindowYorigin); } /* Adjust the cursor boundaries */ dmxAdjustCursorBoundaries(); /* Force completion of the changes */ dmxSync(NULL, TRUE); return Success; } /** Configure the attributes of the global desktop. */ int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs) { if (attribs->width <= 0 || attribs->width >= 32767 || attribs->height <= 0 || attribs->height >= 32767) return DMX_BAD_VALUE; /* If the desktop is shrinking, adjust the "root" windows on each * "screen" window to only show the visible desktop. Also, handle * the special case where the desktop shrinks such that the it no * longer overlaps an portion of a "screen" window. */ if (attribs->width < dmxGlobalWidth || attribs->height < dmxGlobalHeight) { int i; for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; if (dmxScreen->rootXOrigin + dmxScreen->rootWidth > attribs->width || dmxScreen->rootYOrigin + dmxScreen->rootHeight > attribs->height) { int w, h; if ((w = attribs->width - dmxScreen->rootXOrigin) < 0) w = 0; if ((h = attribs->height - dmxScreen->rootYOrigin) < 0) h = 0; if (w > dmxScreen->scrnWidth) w = dmxScreen->scrnWidth; if (h > dmxScreen->scrnHeight) h = dmxScreen->scrnHeight; if (w > dmxScreen->rootWidth) w = dmxScreen->rootWidth; if (h > dmxScreen->rootHeight) h = dmxScreen->rootHeight; dmxConfigureRootWindow(i, dmxScreen->rootX, dmxScreen->rootY, w, h); } } } /* Set the global width/height */ dmxSetWidthHeight(attribs->width, attribs->height); /* Handle shift[XY] changes */ if (attribs->shiftX || attribs->shiftY) { int i; for (i = 0; i < dmxNumScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; WindowPtr pChild = pScreen->root->firstChild; while (pChild) { /* Adjust child window's position */ pScreen->MoveWindow(pChild, pChild->origin.x - wBorderWidth(pChild) - attribs->shiftX, pChild->origin.y - wBorderWidth(pChild) - attribs->shiftY, pChild->nextSib, VTMove); /* Note that the call to MoveWindow will eventually call * dmxPositionWindow which will automatically create a * window if it is now exposed on screen (for lazy * window creation optimization) and it will properly * set the offscreen flag. */ pChild = pChild->nextSib; } } } /* Update connection block, Xinerama, etc. -- these appears to * already be handled in dmxConnectionBlockCallback(), which is * called from dmxAdjustCursorBoundaries() [below]. */ /* Adjust the cursor boundaries */ dmxAdjustCursorBoundaries(); /* Force completion of the changes */ dmxSync(NULL, TRUE); return Success; } #endif /** Create the scratch GCs per depth. */ static void dmxBECreateScratchGCs(int scrnNum) { ScreenPtr pScreen = screenInfo.screens[scrnNum]; GCPtr *ppGC = pScreen->GCperDepth; int i; for (i = 0; i <= pScreen->numDepths; i++) dmxBECreateGC(pScreen, ppGC[i]); } #ifdef PANORAMIX static Bool FoundPixImage; /** Search the Xinerama XRT_PIXMAP resources for the pixmap that needs * to have its image restored. When it is found, see if there is * another screen with the same image. If so, copy the pixmap image * from the existing screen to the newly created pixmap. */ static void dmxBERestorePixmapImage(void *value, XID id, RESTYPE type, void *p) { if ((type & TypeMask) == (XRT_PIXMAP & TypeMask)) { PixmapPtr pDst = (PixmapPtr) p; int idx = pDst->drawable.pScreen->myNum; PanoramiXRes *pXinPix = (PanoramiXRes *) value; PixmapPtr pPix; int i; dixLookupResourceByType((void **) &pPix, pXinPix->info[idx].id, RT_PIXMAP, NullClient, DixUnknownAccess); if (pPix != pDst) return; /* Not a match.... Next! */ FOR_NSCREENS(i) { PixmapPtr pSrc; dmxPixPrivPtr pSrcPriv = NULL; if (i == idx) continue; /* Self replication is bad */ dixLookupResourceByType((void **) &pSrc, pXinPix->info[i].id, RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { DMXScreenInfo *dmxSrcScreen = &dmxScreens[i]; DMXScreenInfo *dmxDstScreen = &dmxScreens[idx]; dmxPixPrivPtr pDstPriv = DMX_GET_PIXMAP_PRIV(pDst); XImage *img; int j; XlibGC gc = NULL; /* This should never happen, but just in case.... */ if (pSrc->drawable.width != pDst->drawable.width || pSrc->drawable.height != pDst->drawable.height) return; /* Copy from src pixmap to dst pixmap */ img = XGetImage(dmxSrcScreen->beDisplay, pSrcPriv->pixmap, 0, 0, pSrc->drawable.width, pSrc->drawable.height, -1, ZPixmap); for (j = 0; j < dmxDstScreen->beNumPixmapFormats; j++) { if (dmxDstScreen->bePixmapFormats[j].depth == img->depth) { unsigned long m; XGCValues v; m = GCFunction | GCPlaneMask | GCClipMask; v.function = GXcopy; v.plane_mask = AllPlanes; v.clip_mask = None; gc = XCreateGC(dmxDstScreen->beDisplay, dmxDstScreen->scrnDefDrawables[j], m, &v); break; } } if (gc) { XPutImage(dmxDstScreen->beDisplay, pDstPriv->pixmap, gc, img, 0, 0, 0, 0, pDst->drawable.width, pDst->drawable.height); XFreeGC(dmxDstScreen->beDisplay, gc); FoundPixImage = True; } else { dmxLog(dmxWarning, "Could not create GC\n"); } XDestroyImage(img); return; } } } } #endif /** Restore the pixmap image either from another screen or from an image * that was saved when the screen was previously detached. */ static void dmxBERestorePixmap(PixmapPtr pPixmap) { #ifdef PANORAMIX int i; /* If Xinerama is not active, there's nothing we can do (see comment * in #else below for more info). */ if (noPanoramiXExtension) { dmxLog(dmxWarning, "Cannot restore pixmap image\n"); return; } FoundPixImage = False; for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBERestorePixmapImage, (void *) pPixmap); /* No corresponding pixmap image was found on other screens, so we * need to copy it from the saved image when the screen was detached * (if available). */ if (!FoundPixImage) { dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap); if (pPixPriv->detachedImage) { ScreenPtr pScreen = pPixmap->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; XlibGC gc = NULL; for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) { if (dmxScreen->bePixmapFormats[i].depth == pPixPriv->detachedImage->depth) { unsigned long m; XGCValues v; m = GCFunction | GCPlaneMask | GCClipMask; v.function = GXcopy; v.plane_mask = AllPlanes; v.clip_mask = None; gc = XCreateGC(dmxScreen->beDisplay, dmxScreen->scrnDefDrawables[i], m, &v); break; } } if (gc) { XPutImage(dmxScreen->beDisplay, pPixPriv->pixmap, gc, pPixPriv->detachedImage, 0, 0, 0, 0, pPixmap->drawable.width, pPixmap->drawable.height); XFreeGC(dmxScreen->beDisplay, gc); } else { dmxLog(dmxWarning, "Cannot restore pixmap image\n"); } XDestroyImage(pPixPriv->detachedImage); pPixPriv->detachedImage = NULL; } else { dmxLog(dmxWarning, "Cannot restore pixmap image\n"); } } #else /* If Xinerama is not enabled, then there is no other copy of the * pixmap image that we can restore. Saving all pixmap data is not * a feasible option since there is no mechanism for updating pixmap * data when a screen is detached, which means that the data that * was previously saved would most likely be out of date. */ dmxLog(dmxWarning, "Cannot restore pixmap image\n"); return; #endif } /** Create resources on the back-end server. This function is called * from #dmxAttachScreen() via the dix layer's FindAllResources * function. It walks all resources, compares them to the screen * number passed in as \a n and calls the appropriate DMX function to * create the associated resource on the back-end server. */ static void dmxBECreateResources(void *value, XID id, RESTYPE type, void *n) { int scrnNum = (uintptr_t) n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; if ((type & TypeMask) == (RT_WINDOW & TypeMask)) { /* Window resources are created below in dmxBECreateWindowTree */ } else if ((type & TypeMask) == (RT_PIXMAP & TypeMask)) { PixmapPtr pPix = value; if (pPix->drawable.pScreen->myNum == scrnNum) { dmxBECreatePixmap(pPix); dmxBERestorePixmap(pPix); } } else if ((type & TypeMask) == (RT_GC & TypeMask)) { GCPtr pGC = value; if (pGC->pScreen->myNum == scrnNum) { /* Create the GC on the back-end server */ dmxBECreateGC(pScreen, pGC); /* Create any pixmaps associated with this GC */ if (!pGC->tileIsPixel) { dmxBECreatePixmap(pGC->tile.pixmap); dmxBERestorePixmap(pGC->tile.pixmap); } if (pGC->stipple != pScreen->PixmapPerDepth[0]) { dmxBECreatePixmap(pGC->stipple); dmxBERestorePixmap(pGC->stipple); } if (pGC->font != defaultFont) { (void) dmxBELoadFont(pScreen, pGC->font); } /* Update the GC on the back-end server */ dmxChangeGC(pGC, -1L); } } else if ((type & TypeMask) == (RT_FONT & TypeMask)) { (void) dmxBELoadFont(pScreen, (FontPtr) value); } else if ((type & TypeMask) == (RT_CURSOR & TypeMask)) { dmxBECreateCursor(pScreen, (CursorPtr) value); } else if ((type & TypeMask) == (RT_COLORMAP & TypeMask)) { ColormapPtr pCmap = value; if (pCmap->pScreen->myNum == scrnNum) (void) dmxBECreateColormap((ColormapPtr) value); #if 0 /* TODO: Recreate Picture and GlyphSet resources */ } else if ((type & TypeMask) == (PictureType & TypeMask)) { /* Picture resources are created when windows are created */ } else if ((type & TypeMask) == (GlyphSetType & TypeMask)) { dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr) value); #endif } else { /* Other resource types??? */ } } /** Create window hierachy on back-end server. The window tree is * created in a special order (bottom most subwindow first) so that the * #dmxCreateNonRootWindow() function does not need to recursively call * itself to create each window's parents. This is required so that we * have the opportunity to create each window's border and background * pixmaps (where appropriate) before the window is created. */ static void dmxBECreateWindowTree(int idx) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; WindowPtr pRoot = screenInfo.screens[idx]->root; dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pRoot); WindowPtr pWin; /* Create the pixmaps associated with the root window */ if (!pRoot->borderIsPixel) { dmxBECreatePixmap(pRoot->border.pixmap); dmxBERestorePixmap(pRoot->border.pixmap); } if (pRoot->backgroundState == BackgroundPixmap) { dmxBECreatePixmap(pRoot->background.pixmap); dmxBERestorePixmap(pRoot->background.pixmap); } /* Create root window first */ dmxScreen->rootWin = pWinPriv->window = dmxCreateRootWindow(pRoot); XMapWindow(dmxScreen->beDisplay, dmxScreen->rootWin); pWin = pRoot->lastChild; while (pWin) { pWinPriv = DMX_GET_WINDOW_PRIV(pWin); /* Create the pixmaps regardless of whether or not the * window is created or not due to lazy window creation. */ if (!pWin->borderIsPixel) { dmxBECreatePixmap(pWin->border.pixmap); dmxBERestorePixmap(pWin->border.pixmap); } if (pWin->backgroundState == BackgroundPixmap) { dmxBECreatePixmap(pWin->background.pixmap); dmxBERestorePixmap(pWin->background.pixmap); } /* Reset the window attributes */ dmxGetDefaultWindowAttributes(pWin, &pWinPriv->cmap, &pWinPriv->visual); /* Create the window */ if (pWinPriv->mapped && !pWinPriv->offscreen) dmxCreateAndRealizeWindow(pWin, TRUE); /* Next, create the bottom-most child */ if (pWin->lastChild) { pWin = pWin->lastChild; continue; } /* If the window has no children, move on to the next higher window */ while (!pWin->prevSib && (pWin != pRoot)) pWin = pWin->parent; if (pWin->prevSib) { pWin = pWin->prevSib; continue; } /* When we reach the root window, we are finished */ if (pWin == pRoot) break; } } /* Refresh screen by generating exposure events for all windows */ static void dmxForceExposures(int idx) { ScreenPtr pScreen = screenInfo.screens[idx]; WindowPtr pRoot = pScreen->root; Bool anyMarked = FALSE; WindowPtr pChild; for (pChild = pRoot->firstChild; pChild; pChild = pChild->nextSib) anyMarked |= pScreen->MarkOverlappedWindows(pChild, pChild, (WindowPtr *) NULL); if (anyMarked) { /* If any windows have been marked, set the root window's * clipList to be broken since it will be recalculated in * ValidateTree() */ RegionBreak(&pRoot->clipList); pScreen->ValidateTree(pRoot, NULL, VTBroken); pScreen->HandleExposures(pRoot); if (pScreen->PostValidateTree) pScreen->PostValidateTree(pRoot, NULL, VTBroken); } } /** Compare the new and old screens to see if they are compatible. */ static Bool dmxCompareScreens(DMXScreenInfo * new, DMXScreenInfo * old) { int i; if (new->beWidth != old->beWidth) return FALSE; if (new->beHeight != old->beHeight) return FALSE; if (new->beDepth != old->beDepth) return FALSE; if (new->beBPP != old->beBPP) return FALSE; if (new->beNumDepths != old->beNumDepths) return FALSE; for (i = 0; i < old->beNumDepths; i++) if (new->beDepths[i] != old->beDepths[i]) return FALSE; if (new->beNumPixmapFormats != old->beNumPixmapFormats) return FALSE; for (i = 0; i < old->beNumPixmapFormats; i++) { if (new->bePixmapFormats[i].depth != old->bePixmapFormats[i].depth) return FALSE; if (new->bePixmapFormats[i].bits_per_pixel != old->bePixmapFormats[i].bits_per_pixel) return FALSE; if (new->bePixmapFormats[i].scanline_pad != old->bePixmapFormats[i].scanline_pad) return FALSE; } if (new->beNumVisuals != old->beNumVisuals) return FALSE; for (i = 0; i < old->beNumVisuals; i++) { if (new->beVisuals[i].visualid != old->beVisuals[i].visualid) return FALSE; if (new->beVisuals[i].screen != old->beVisuals[i].screen) return FALSE; if (new->beVisuals[i].depth != old->beVisuals[i].depth) return FALSE; if (new->beVisuals[i].class != old->beVisuals[i].class) return FALSE; if (new->beVisuals[i].red_mask != old->beVisuals[i].red_mask) return FALSE; if (new->beVisuals[i].green_mask != old->beVisuals[i].green_mask) return FALSE; if (new->beVisuals[i].blue_mask != old->beVisuals[i].blue_mask) return FALSE; if (new->beVisuals[i].colormap_size != old->beVisuals[i].colormap_size) return FALSE; if (new->beVisuals[i].bits_per_rgb != old->beVisuals[i].bits_per_rgb) return FALSE; } if (new->beDefVisualIndex != old->beDefVisualIndex) return FALSE; return TRUE; } /** Restore Render's picture */ static void dmxBERestoreRenderPict(void *value, XID id, void *n) { PicturePtr pPicture = value; /* The picture */ DrawablePtr pDraw = pPicture->pDrawable; /* The picture's drawable */ int scrnNum = (uintptr_t) n; if (pDraw->pScreen->myNum != scrnNum) { /* Picture not on the screen we are restoring */ return; } if (pDraw->type == DRAWABLE_PIXMAP) { PixmapPtr pPixmap = (PixmapPtr) pDraw; /* Create and restore the pixmap drawable */ dmxBECreatePixmap(pPixmap); dmxBERestorePixmap(pPixmap); } dmxBECreatePicture(pPicture); } /** Restore Render's glyphs */ static void dmxBERestoreRenderGlyph(void *value, XID id, void *n) { GlyphSetPtr glyphSet = value; int scrnNum = (uintptr_t) n; dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); DMXScreenInfo *dmxScreen = &dmxScreens[scrnNum]; GlyphRefPtr table; char *images; Glyph *gids; XGlyphInfo *glyphs; char *pos; int beret; int len_images = 0; int i; int ctr; if (glyphPriv->glyphSets[scrnNum]) { /* Only restore glyphs on the screen we are attaching */ return; } /* First we must create the glyph set on the backend. */ if ((beret = dmxBECreateGlyphSet(scrnNum, glyphSet)) != Success) { dmxLog(dmxWarning, "\tdmxBERestoreRenderGlyph failed to create glyphset!\n"); return; } /* Now for the complex part, restore the glyph data */ table = glyphSet->hash.table; /* We need to know how much memory to allocate for this part */ for (i = 0; i < glyphSet->hash.hashSet->size; i++) { GlyphRefPtr gr = &table[i]; GlyphPtr gl = gr->glyph; if (!gl || gl == DeletedGlyph) continue; len_images += gl->size - sizeof(gl->info); } /* Now allocate the memory we need */ images = calloc(len_images, sizeof(char)); gids = malloc(glyphSet->hash.tableEntries * sizeof(Glyph)); glyphs = malloc(glyphSet->hash.tableEntries * sizeof(XGlyphInfo)); pos = images; ctr = 0; /* Fill the allocated memory with the proper data */ for (i = 0; i < glyphSet->hash.hashSet->size; i++) { GlyphRefPtr gr = &table[i]; GlyphPtr gl = gr->glyph; if (!gl || gl == DeletedGlyph) continue; /* First lets put the data into gids */ gids[ctr] = gr->signature; /* Next do the glyphs data structures */ glyphs[ctr].width = gl->info.width; glyphs[ctr].height = gl->info.height; glyphs[ctr].x = gl->info.x; glyphs[ctr].y = gl->info.y; glyphs[ctr].xOff = gl->info.xOff; glyphs[ctr].yOff = gl->info.yOff; /* Copy the images from the DIX's data into the buffer */ memcpy(pos, gl + 1, gl->size - sizeof(gl->info)); pos += gl->size - sizeof(gl->info); ctr++; } /* Now restore the glyph data */ XRenderAddGlyphs(dmxScreen->beDisplay, glyphPriv->glyphSets[scrnNum], gids, glyphs, glyphSet->hash.tableEntries, images, len_images); /* Clean up */ free(images); free(gids); free(glyphs); } /** Reattach previously detached back-end screen. */ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) { ScreenPtr pScreen; DMXScreenInfo *dmxScreen; CARD32 scrnNum = idx; DMXScreenInfo oldDMXScreen; int i; /* Return failure if dynamic addition/removal of screens is disabled */ if (!dmxAddRemoveScreens) { dmxLog(dmxWarning, "Attempting to add a screen, but the AddRemoveScreen\n"); dmxLog(dmxWarning, "extension has not been enabled. To enable this extension\n"); dmxLog(dmxWarning, "add the \"-addremovescreens\" option either to the command\n"); dmxLog(dmxWarning, "line or in the configuration file.\n"); return 1; } /* Cannot add a screen that does not exist */ if (idx < 0 || idx >= dmxNumScreens) return 1; pScreen = screenInfo.screens[idx]; dmxScreen = &dmxScreens[idx]; /* Cannot attach to a screen that is already opened */ if (dmxScreen->beDisplay) { dmxLog(dmxWarning, "Attempting to add screen #%d but a screen already exists\n", idx); return 1; } dmxLogOutput(dmxScreen, "Attaching screen #%d\n", idx); /* Save old info */ oldDMXScreen = *dmxScreen; /* Copy the name to the new screen */ dmxScreen->name = strdup(attr->displayName); /* Open display and get all of the screen info */ if (!dmxOpenDisplay(dmxScreen)) { dmxLog(dmxWarning, "dmxOpenDisplay: Unable to open display %s\n", dmxScreen->name); /* Restore the old screen */ *dmxScreen = oldDMXScreen; return 1; } dmxSetErrorHandler(dmxScreen); dmxCheckForWM(dmxScreen); dmxGetScreenAttribs(dmxScreen); if (!dmxGetVisualInfo(dmxScreen)) { dmxLog(dmxWarning, "dmxGetVisualInfo: No matching visuals found\n"); XFree(dmxScreen->beVisuals); XCloseDisplay(dmxScreen->beDisplay); /* Restore the old screen */ *dmxScreen = oldDMXScreen; return 1; } dmxGetColormaps(dmxScreen); dmxGetPixmapFormats(dmxScreen); /* Verify that the screen to be added has the same info as the * previously added screen. */ if (!dmxCompareScreens(dmxScreen, &oldDMXScreen)) { dmxLog(dmxWarning, "New screen data (%s) does not match previously\n", dmxScreen->name); dmxLog(dmxWarning, "attached screen data (%s)\n", oldDMXScreen.name); dmxLog(dmxWarning, "All data must match in order to attach to screen #%d\n", idx); XFree(dmxScreen->beVisuals); XFree(dmxScreen->beDepths); XFree(dmxScreen->bePixmapFormats); XCloseDisplay(dmxScreen->beDisplay); /* Restore the old screen */ *dmxScreen = oldDMXScreen; return 1; } /* Initialize the BE screen resources */ dmxBEScreenInit(screenInfo.screens[idx]); /* TODO: Handle GLX visual initialization. GLXProxy needs to be * updated to handle dynamic addition/removal of screens. */ /* Create default stipple */ dmxBECreatePixmap(pScreen->PixmapPerDepth[0]); dmxBERestorePixmap(pScreen->PixmapPerDepth[0]); /* Create the scratch GCs */ dmxBECreateScratchGCs(idx); /* Create the default font */ (void) dmxBELoadFont(pScreen, defaultFont); /* Create all resources that don't depend on windows */ for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBECreateResources, (void *) (uintptr_t) idx); /* Create window hierarchy (top down) */ dmxBECreateWindowTree(idx); /* Restore the picture state for RENDER */ for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindClientResourcesByType(clients[i], PictureType, dmxBERestoreRenderPict, (void *) (uintptr_t) idx); /* Restore the glyph state for RENDER */ for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindClientResourcesByType(clients[i], GlyphSetType, dmxBERestoreRenderGlyph, (void *) (uintptr_t) idx); /* Refresh screen by generating exposure events for all windows */ dmxForceExposures(idx); dmxSync(&dmxScreens[idx], TRUE); /* We used these to compare the old and new screens. They are no * longer needed since we have a newly attached screen, so we can * now free the old screen's resources. */ XFree(oldDMXScreen.beVisuals); XFree(oldDMXScreen.beDepths); XFree(oldDMXScreen.bePixmapFormats); /* TODO: should oldDMXScreen.name be freed?? */ #ifdef PANORAMIX if (!noPanoramiXExtension) return dmxConfigureScreenWindows(1, &scrnNum, attr, NULL); else #endif return 0; /* Success */ } /* * Resources that may have state on the BE server and need to be freed: * * RT_NONE * RT_WINDOW * RT_PIXMAP * RT_GC * RT_FONT * RT_CURSOR * RT_COLORMAP * RT_CMAPENTRY * RT_OTHERCLIENT * RT_PASSIVEGRAB * XRT_WINDOW * XRT_PIXMAP * XRT_GC * XRT_COLORMAP * XRT_PICTURE * PictureType * PictFormatType * GlyphSetType * ClientType * EventType * RT_INPUTCLIENT * XETrapType * RTCounter * RTAwait * RTAlarmClient * RT_XKBCLIENT * RTContext * TagResType * StalledResType * SecurityAuthorizationResType * RTEventClient * __glXContextRes * __glXClientRes * __glXPixmapRes * __glXWindowRes * __glXPbufferRes */ #ifdef PANORAMIX /** Search the Xinerama XRT_PIXMAP resources for the pixmap that needs * to have its image saved. */ static void dmxBEFindPixmapImage(void *value, XID id, RESTYPE type, void *p) { if ((type & TypeMask) == (XRT_PIXMAP & TypeMask)) { PixmapPtr pDst = (PixmapPtr) p; int idx = pDst->drawable.pScreen->myNum; PanoramiXRes *pXinPix = (PanoramiXRes *) value; PixmapPtr pPix; int i; dixLookupResourceByType((void **) &pPix, pXinPix->info[idx].id, RT_PIXMAP, NullClient, DixUnknownAccess); if (pPix != pDst) return; /* Not a match.... Next! */ FOR_NSCREENS(i) { PixmapPtr pSrc; dmxPixPrivPtr pSrcPriv = NULL; if (i == idx) continue; /* Self replication is bad */ dixLookupResourceByType((void **) &pSrc, pXinPix->info[i].id, RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { FoundPixImage = True; return; } } } } #endif /** Save the pixmap image only when there is not another screen with * that pixmap from which the image can be read when the screen is * reattached. To do this, we first try to find a pixmap on another * screen corresponding to the one we are trying to save. If we find * one, then we do not need to save the image data since during * reattachment, the image data can be read from that other pixmap. * However, if we do not find one, then we need to save the image data. * The common case for these are for the default stipple and root * tile. */ static void dmxBESavePixmap(PixmapPtr pPixmap) { #ifdef PANORAMIX int i; /* If Xinerama is not active, there's nothing we can do (see comment * in #else below for more info). */ if (noPanoramiXExtension) return; FoundPixImage = False; for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBEFindPixmapImage, (void *) pPixmap); /* Save the image only if there is no other screens that have a * pixmap that corresponds to the one we are trying to save. */ if (!FoundPixImage) { dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap); if (!pPixPriv->detachedImage) { ScreenPtr pScreen = pPixmap->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; pPixPriv->detachedImage = XGetImage(dmxScreen->beDisplay, pPixPriv->pixmap, 0, 0, pPixmap->drawable.width, pPixmap->drawable.height, -1, ZPixmap); if (!pPixPriv->detachedImage) dmxLog(dmxWarning, "Cannot save pixmap image\n"); } } #else /* NOTE: The only time there is a pixmap on another screen that * corresponds to the one we are trying to save is when Xinerama is * active. Otherwise, the pixmap image data is only stored on a * single screen, which means that once it is detached, that data is * lost. We could save the data here, but then that would require * us to implement the ability for Xdmx to keep the pixmap up to * date while the screen is detached, which is beyond the scope of * the current project. */ return; #endif } /** Destroy resources on the back-end server. This function is called * from #dmxDetachScreen() via the dix layer's FindAllResources * function. It walks all resources, compares them to the screen * number passed in as \a n and calls the appropriate DMX function to * free the associated resource on the back-end server. */ static void dmxBEDestroyResources(void *value, XID id, RESTYPE type, void *n) { int scrnNum = (uintptr_t) n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; if ((type & TypeMask) == (RT_WINDOW & TypeMask)) { /* Window resources are destroyed below in dmxBEDestroyWindowTree */ } else if ((type & TypeMask) == (RT_PIXMAP & TypeMask)) { PixmapPtr pPix = value; if (pPix->drawable.pScreen->myNum == scrnNum) { dmxBESavePixmap(pPix); dmxBEFreePixmap(pPix); } } else if ((type & TypeMask) == (RT_GC & TypeMask)) { GCPtr pGC = value; if (pGC->pScreen->myNum == scrnNum) dmxBEFreeGC(pGC); } else if ((type & TypeMask) == (RT_FONT & TypeMask)) { dmxBEFreeFont(pScreen, (FontPtr) value); } else if ((type & TypeMask) == (RT_CURSOR & TypeMask)) { dmxBEFreeCursor(pScreen, (CursorPtr) value); } else if ((type & TypeMask) == (RT_COLORMAP & TypeMask)) { ColormapPtr pCmap = value; if (pCmap->pScreen->myNum == scrnNum) dmxBEFreeColormap((ColormapPtr) value); } else if ((type & TypeMask) == (PictureType & TypeMask)) { PicturePtr pPict = value; if (pPict->pDrawable->pScreen->myNum == scrnNum) { /* Free the pixmaps on the backend if needed */ if (pPict->pDrawable->type == DRAWABLE_PIXMAP) { PixmapPtr pPixmap = (PixmapPtr) (pPict->pDrawable); dmxBESavePixmap(pPixmap); dmxBEFreePixmap(pPixmap); } dmxBEFreePicture((PicturePtr) value); } } else if ((type & TypeMask) == (GlyphSetType & TypeMask)) { dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr) value); } else { /* Other resource types??? */ } } /** Destroy the scratch GCs that are created per depth. */ static void dmxBEDestroyScratchGCs(int scrnNum) { ScreenPtr pScreen = screenInfo.screens[scrnNum]; GCPtr *ppGC = pScreen->GCperDepth; int i; for (i = 0; i <= pScreen->numDepths; i++) dmxBEFreeGC(ppGC[i]); } /** Destroy window hierachy on back-end server. To ensure that all * XDestroyWindow() calls succeed, they must be performed in a bottom * up order so that windows are not destroyed before their children. * XDestroyWindow(), which is called from #dmxBEDestroyWindow(), will * destroy a window as well as all of it's children. */ static void dmxBEDestroyWindowTree(int idx) { WindowPtr pWin = screenInfo.screens[idx]->root; WindowPtr pChild = pWin; while (1) { if (pChild->firstChild) { pChild = pChild->firstChild; continue; } /* Destroy the window */ dmxBEDestroyWindow(pChild); /* Make sure we destroy the window's border and background * pixmaps if they exist */ if (!pChild->borderIsPixel) { dmxBESavePixmap(pChild->border.pixmap); dmxBEFreePixmap(pChild->border.pixmap); } if (pChild->backgroundState == BackgroundPixmap) { dmxBESavePixmap(pChild->background.pixmap); dmxBEFreePixmap(pChild->background.pixmap); } while (!pChild->nextSib && (pChild != pWin)) { pChild = pChild->parent; dmxBEDestroyWindow(pChild); if (!pChild->borderIsPixel) { dmxBESavePixmap(pChild->border.pixmap); dmxBEFreePixmap(pChild->border.pixmap); } if (pChild->backgroundState == BackgroundPixmap) { dmxBESavePixmap(pChild->background.pixmap); dmxBEFreePixmap(pChild->background.pixmap); } } if (pChild == pWin) break; pChild = pChild->nextSib; } } /** Detach back-end screen. */ int dmxDetachScreen(int idx) { DMXScreenInfo *dmxScreen = &dmxScreens[idx]; int i; /* Return failure if dynamic addition/removal of screens is disabled */ if (!dmxAddRemoveScreens) { dmxLog(dmxWarning, "Attempting to remove a screen, but the AddRemoveScreen\n"); dmxLog(dmxWarning, "extension has not been enabled. To enable this extension\n"); dmxLog(dmxWarning, "add the \"-addremovescreens\" option either to the command\n"); dmxLog(dmxWarning, "line or in the configuration file.\n"); return 1; } /* Cannot remove a screen that does not exist */ if (idx < 0 || idx >= dmxNumScreens) return 1; /* Cannot detach from a screen that is not opened */ if (!dmxScreen->beDisplay) { dmxLog(dmxWarning, "Attempting to remove screen #%d but it has not been opened\n", idx); return 1; } dmxLogOutput(dmxScreen, "Detaching screen #%d\n", idx); /* Detach input */ dmxInputDetachAll(dmxScreen); /* Save all relevant state (TODO) */ /* Free all non-window resources related to this screen */ for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBEDestroyResources, (void *) (uintptr_t) idx); /* Free scratch GCs */ dmxBEDestroyScratchGCs(idx); /* Free window resources related to this screen */ dmxBEDestroyWindowTree(idx); /* Free default stipple */ dmxBESavePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]); dmxBEFreePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]); /* Free the remaining screen resources and close the screen */ dmxBECloseScreen(screenInfo.screens[idx]); /* Adjust the cursor boundaries (paints detached console window) */ dmxAdjustCursorBoundaries(); return 0; /* Success */ } xorg-server-1.17.1/hw/dmx/dmxpixmap.h0000664000175100017510000000417312274325511014406 00000000000000/* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * Interface for pixmap support. \see dmxpixmap.c */ #ifndef DMXPIXMAP_H #define DMXPIXMAP_H #include "pixmapstr.h" /** Pixmap private area. */ typedef struct _dmxPixPriv { Pixmap pixmap; XImage *detachedImage; } dmxPixPrivRec, *dmxPixPrivPtr; extern Bool dmxInitPixmap(ScreenPtr pScreen); extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, unsigned usage_hint); extern Bool dmxDestroyPixmap(PixmapPtr pPixmap); extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap); extern void dmxBECreatePixmap(PixmapPtr pPixmap); extern Bool dmxBEFreePixmap(PixmapPtr pPixmap); /** Get pixmap private pointer. */ #define DMX_GET_PIXMAP_PRIV(_pPix) \ (dmxPixPrivPtr)dixLookupPrivate(&(_pPix)->devPrivates, dmxPixPrivateKey) #endif /* DMXPIXMAP_H */ xorg-server-1.17.1/hw/dmx/dmxgc.h0000664000175100017510000000542212274325511013477 00000000000000/* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * Interface for GC support. \see dmxgc.c */ #ifndef DMXGC_H #define DMXGC_H #include "gcstruct.h" /** GC private area. */ typedef struct _dmxGCPriv { GCOps *ops; GCFuncs *funcs; XlibGC gc; Bool msc; } dmxGCPrivRec, *dmxGCPrivPtr; extern Bool dmxInitGC(ScreenPtr pScreen); extern Bool dmxCreateGC(GCPtr pGC); extern void dmxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); extern void dmxChangeGC(GCPtr pGC, unsigned long mask); extern void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst); extern void dmxDestroyGC(GCPtr pGC); extern void dmxChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); extern void dmxDestroyClip(GCPtr pGC); extern void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc); extern void dmxBECreateGC(ScreenPtr pScreen, GCPtr pGC); extern Bool dmxBEFreeGC(GCPtr pGC); /** Get private. */ #define DMX_GET_GC_PRIV(_pGC) \ (dmxGCPrivPtr)dixLookupPrivate(&(_pGC)->devPrivates, dmxGCPrivateKey) #define DMX_GC_FUNC_PROLOGUE(_pGC) \ do { \ dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC); \ DMX_UNWRAP(funcs, _pGCPriv, (_pGC)); \ if (_pGCPriv->ops) \ DMX_UNWRAP(ops, _pGCPriv, (_pGC)); \ } while (0) #define DMX_GC_FUNC_EPILOGUE(_pGC) \ do { \ dmxGCPrivPtr _pGCPriv = DMX_GET_GC_PRIV(_pGC); \ DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC)); \ if (_pGCPriv->ops) \ DMX_WRAP(ops, &dmxGCOps, _pGCPriv, (_pGC)); \ } while (0) #endif /* DMXGC_H */ xorg-server-1.17.1/hw/dmx/dmxsync.h0000664000175100017510000000277012274325511014065 00000000000000/* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * Interface for sync support. \see dmxsync.c */ #ifndef _DMXSYNC_H_ #define _DMXSYNC_H_ extern void dmxSyncActivate(const char *interval); extern void dmxSyncInit(void); extern void dmxSync(DMXScreenInfo * dmxScreen, Bool now); #endif xorg-server-1.17.1/hw/dmx/dmx.h0000664000175100017510000003623112274325511013167 00000000000000/* * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * David H. Dawes * Rickard E. (Rik) Faith * */ /** \file * Main header file included by all other DMX-related files. */ /** \mainpage * - DMX Home Page * - DMX Project Page (on * Source Forge) * - Distributed Multihead * X design, the design document for DMX * - Client-to-Server * DMX Extension to the X Protocol */ #ifndef DMX_H #define DMX_H #if HAVE_DMX_CONFIG_H #include #endif #include "gcstruct.h" /* Handle client-side include files in one place. */ #include "dmxclient.h" #include "globals.h" #include "scrnintstr.h" #include "picturestr.h" #ifdef GLXEXT #include #include #endif typedef enum { PosNone = -1, PosAbsolute = 0, PosRightOf, PosLeftOf, PosAbove, PosBelow, PosRelative } PositionType; /** Provide the typedef globally, but keep the contents opaque outside * of the input routines. \see dmxinput.h */ typedef struct _DMXInputInfo DMXInputInfo; /** Provide the typedef globally, but keep the contents opaque outside * of the XSync statistic routines. \see dmxstat.c */ typedef struct _DMXStatInfo DMXStatInfo; /** Global structure containing information about each backend screen. */ typedef struct _DMXScreenInfo { const char *name; /**< Name from command line or config file */ int index; /**< Index into dmxScreens global */ /*---------- Back-end X server information ----------*/ Display *beDisplay; /**< Back-end X server's display */ int beWidth; /**< Width of BE display */ int beHeight; /**< Height of BE display */ int beDepth; /**< Depth of BE display */ int beBPP; /**< Bits per pixel of BE display */ int beXDPI; /**< Horizontal dots per inch of BE */ int beYDPI; /**< Vertical dots per inch of BE */ int beNumDepths; /**< Number of depths on BE server */ int *beDepths; /**< Depths from BE server */ int beNumPixmapFormats; /**< Number of pixmap formats on BE */ XPixmapFormatValues *bePixmapFormats; /**< Pixmap formats on BE */ int beNumVisuals; /**< Number of visuals on BE */ XVisualInfo *beVisuals; /**< Visuals from BE server */ int beDefVisualIndex; /**< Default visual index of BE */ int beNumDefColormaps; /**< Number of default colormaps */ Colormap *beDefColormaps; /**< Default colormaps for DMX server */ Pixel beBlackPixel; /**< Default black pixel for BE */ Pixel beWhitePixel; /**< Default white pixel for BE */ /*---------- Screen window information ----------*/ Window scrnWin; /**< "Screen" window on backend display */ int scrnX; /**< X offset of "screen" WRT BE display */ int scrnY; /**< Y offset of "screen" WRT BE display */ int scrnWidth; /**< Width of "screen" */ int scrnHeight; /**< Height of "screen" */ int scrnXSign; /**< X offset sign of "screen" */ int scrnYSign; /**< Y offset sign of "screen" */ /** Default drawables for "screen" */ Drawable scrnDefDrawables[MAXFORMATS]; struct _DMXScreenInfo *next; /**< List of "screens" on same display */ struct _DMXScreenInfo *over; /**< List of "screens" that overlap */ /*---------- Root window information ----------*/ Window rootWin; /**< "Root" window on backend display */ int rootX; /**< X offset of "root" window WRT "screen"*/ int rootY; /**< Y offset of "root" window WRT "screen"*/ int rootWidth; /**< Width of "root" window */ int rootHeight; /**< Height of "root" window */ int rootXOrigin; /**< Global X origin of "root" window */ int rootYOrigin; /**< Global Y origin of "root" window */ /*---------- Shadow framebuffer information ----------*/ void *shadow; /**< Shadow framebuffer data (if enabled) */ XlibGC shadowGC; /**< Default GC used by shadow FB code */ XImage *shadowFBImage; /**< Screen image used by shadow FB code */ /*---------- Other related information ----------*/ int shared; /**< Non-zero if another Xdmx is running */ Bool WMRunningOnBE; Cursor noCursor; Cursor curCursor; /* Support for cursors on overlapped * backend displays. */ CursorPtr cursor; int cursorVisible; int cursorNotShared; /* for overlapping screens on a backend */ PositionType where; /**< Relative layout information */ int whereX; /**< Relative layout information */ int whereY; /**< Relative layout information */ int whereRefScreen; /**< Relative layout information */ int savedTimeout; /**< Original screen saver timeout */ int dpmsCapable; /**< Non-zero if backend is DPMS capable */ int dpmsEnabled; /**< Non-zero if DPMS enabled */ int dpmsStandby; /**< Original DPMS standby value */ int dpmsSuspend; /**< Original DPMS suspend value */ int dpmsOff; /**< Original DPMS off value */ DMXStatInfo *stat; /**< Statistics about XSync */ Bool needsSync; /**< True if an XSync is pending */ #ifdef GLXEXT /** Visual information for glxProxy */ int numGlxVisuals; __GLXvisualConfig *glxVisuals; int glxMajorOpcode; int glxErrorBase; /** FB config information for glxProxy */ __GLXFBConfig *fbconfigs; int numFBConfigs; #endif /** Function pointers to wrapped screen * functions */ CloseScreenProcPtr CloseScreen; SaveScreenProcPtr SaveScreen; CreateGCProcPtr CreateGC; CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; PositionWindowProcPtr PositionWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; RestackWindowProcPtr RestackWindow; WindowExposuresProcPtr WindowExposures; CopyWindowProcPtr CopyWindow; ResizeWindowProcPtr ResizeWindow; ReparentWindowProcPtr ReparentWindow; ChangeBorderWidthProcPtr ChangeBorderWidth; GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; BitmapToRegionProcPtr BitmapToRegion; RealizeFontProcPtr RealizeFont; UnrealizeFontProcPtr UnrealizeFont; CreateColormapProcPtr CreateColormap; DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; StoreColorsProcPtr StoreColors; SetShapeProcPtr SetShape; CreatePictureProcPtr CreatePicture; DestroyPictureProcPtr DestroyPicture; ChangePictureClipProcPtr ChangePictureClip; DestroyPictureClipProcPtr DestroyPictureClip; ChangePictureProcPtr ChangePicture; ValidatePictureProcPtr ValidatePicture; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; CompositeRectsProcPtr CompositeRects; InitIndexedProcPtr InitIndexed; CloseIndexedProcPtr CloseIndexed; UpdateIndexedProcPtr UpdateIndexed; TrapezoidsProcPtr Trapezoids; TrianglesProcPtr Triangles; } DMXScreenInfo; /* Global variables available to all Xserver/hw/dmx routines. */ extern int dmxNumScreens; /**< Number of dmxScreens */ extern DMXScreenInfo *dmxScreens; /**< List of outputs */ extern XErrorEvent dmxLastErrorEvent; /**< Last error that * occurred */ extern Bool dmxErrorOccurred; /**< True if an error * occurred */ extern Bool dmxOffScreenOpt; /**< True if using off * screen * optimizations */ extern Bool dmxSubdividePrimitives; /**< True if using the * primitive subdivision * optimization */ extern Bool dmxLazyWindowCreation; /**< True if using the * lazy window creation * optimization */ extern Bool dmxUseXKB; /**< True if the XKB * extension should be * used with the backend * servers */ extern int dmxDepth; /**< Requested depth if * non-zero */ #ifdef GLXEXT extern Bool dmxGLXProxy; /**< True if glxProxy * support is enabled */ extern Bool dmxGLXSwapGroupSupport; /**< True if glxProxy * support for swap * groups and barriers * is enabled */ extern Bool dmxGLXSyncSwap; /**< True if glxProxy * should force an XSync * request after each * swap buffers call */ extern Bool dmxGLXFinishSwap; /**< True if glxProxy * should force a * glFinish request * after each swap * buffers call */ #endif extern char *dmxFontPath; /**< NULL if no font * path is set on the * command line; * otherwise, a string * of comma separated * paths built from the * command line * specified font * paths */ extern Bool dmxIgnoreBadFontPaths; /**< True if bad font * paths should be * ignored during server * init */ extern Bool dmxAddRemoveScreens; /**< True if add and * remove screens support * is enabled */ /** Wrap screen or GC function pointer */ #define DMX_WRAP(_entry, _newfunc, _saved, _actual) \ do { \ (_saved)->_entry = (_actual)->_entry; \ (_actual)->_entry = (_newfunc); \ } while (0) /** Unwrap screen or GC function pointer */ #define DMX_UNWRAP(_entry, _saved, _actual) \ do { \ (_actual)->_entry = (_saved)->_entry; \ } while (0) /* Define the MAXSCREENSALLOC/FREE macros, when MAXSCREENS patch has not * been applied to sources. */ #ifdef MAXSCREENS #define MAXSCREEN_MAKECONSTSTR1(x) #x #define MAXSCREEN_MAKECONSTSTR2(x) MAXSCREEN_MAKECONSTSTR1(x) #define MAXSCREEN_FAILED_TXT "Failed at [" \ MAXSCREEN_MAKECONSTSTR2(__LINE__) ":" __FILE__ "] to allocate object: " #define _MAXSCREENSALLOCF(o,size,fatal) \ do { \ if (!o) { \ o = calloc((size), sizeof(*(o))); \ if (!o && fatal) FatalError(MAXSCREEN_FAILED_TXT #o); \ } \ } while (0) #define _MAXSCREENSALLOCR(o,size,retval) \ do { \ if (!o) { \ o = calloc((size), sizeof(*(o))); \ if (!o) return retval; \ } \ } while (0) #define MAXSCREENSFREE(o) \ do { \ free(o); \ o = NULL; \ } while (0) #define MAXSCREENSALLOC(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 0) #define MAXSCREENSALLOC_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 1) #define MAXSCREENSALLOC_RETURN(o,r) _MAXSCREENSALLOCR(o,MAXSCREENS, (r)) #define MAXSCREENSALLOCPLUSONE(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,0) #define MAXSCREENSALLOCPLUSONE_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,1) #define MAXSCREENSCALLOC(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),0) #define MAXSCREENSCALLOC_FATAL(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),1) #endif extern DevPrivateKeyRec dmxGCPrivateKeyRec; #define dmxGCPrivateKey (&dmxGCPrivateKeyRec) /**< Private index for GCs */ extern DevPrivateKeyRec dmxWinPrivateKeyRec; #define dmxWinPrivateKey (&dmxWinPrivateKeyRec) /**< Private index for Windows */ extern DevPrivateKeyRec dmxPixPrivateKeyRec; #define dmxPixPrivateKey (&dmxPixPrivateKeyRec) /**< Private index for Pixmaps */ extern int dmxFontPrivateIndex; /**< Private index for Fonts */ extern DevPrivateKeyRec dmxScreenPrivateKeyRec; #define dmxScreenPrivateKey (&dmxScreenPrivateKeyRec) /**< Private index for Screens */ extern DevPrivateKeyRec dmxColormapPrivateKeyRec; #define dmxColormapPrivateKey (&dmxColormapPrivateKeyRec) /**< Private index for Colormaps */ extern DevPrivateKeyRec dmxPictPrivateKeyRec; #define dmxPictPrivateKey (&dmxPictPrivateKeyRec) /**< Private index for Picts */ extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec; #define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */ void DMXExtensionInit(void); #endif /* DMX_H */ xorg-server-1.17.1/hw/dmx/dmxpict.c0000664000175100017510000012000512366220413014030 00000000000000/* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * Provide support for the RENDER extension (version 0.8). */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include "dmx.h" #include "dmxsync.h" #include "dmxpict.h" #include "dmxwindow.h" #include "dmxpixmap.h" #include "fb.h" #include "pixmapstr.h" #include "dixstruct.h" #include #include #include #include "picture.h" #include "picturestr.h" #include "mipict.h" #include "fbpict.h" extern int RenderErrBase; extern int (*ProcRenderVector[RenderNumberRequests]) (ClientPtr); static int (*dmxSaveRenderVector[RenderNumberRequests]) (ClientPtr); static int dmxProcRenderCreateGlyphSet(ClientPtr client); static int dmxProcRenderFreeGlyphSet(ClientPtr client); static int dmxProcRenderAddGlyphs(ClientPtr client); static int dmxProcRenderFreeGlyphs(ClientPtr client); static int dmxProcRenderCompositeGlyphs(ClientPtr client); static int dmxProcRenderSetPictureTransform(ClientPtr client); static int dmxProcRenderSetPictureFilter(ClientPtr client); #if 0 /* FIXME: Not (yet) supported */ static int dmxProcRenderCreateCursor(ClientPtr client); static int dmxProcRenderCreateAnimCursor(ClientPtr client); #endif /** Catch errors that might occur when allocating Glyph Sets. Errors * are saved in dmxGlyphLastError for later handling. */ static int dmxGlyphLastError; static int dmxGlyphErrorHandler(Display * dpy, XErrorEvent * ev) { dmxGlyphLastError = ev->error_code; return 0; } /** Initialize the Proc Vector for the RENDER extension. The functions * here cannot be handled by the mi layer RENDER hooks either because * the required information is no longer available when it reaches the * mi layer or no mi layer hooks exist. This function is called from * InitOutput() since it should be initialized only once per server * generation. */ void dmxInitRender(void) { int i; for (i = 0; i < RenderNumberRequests; i++) dmxSaveRenderVector[i] = ProcRenderVector[i]; ProcRenderVector[X_RenderCreateGlyphSet] = dmxProcRenderCreateGlyphSet; ProcRenderVector[X_RenderFreeGlyphSet] = dmxProcRenderFreeGlyphSet; ProcRenderVector[X_RenderAddGlyphs] = dmxProcRenderAddGlyphs; ProcRenderVector[X_RenderFreeGlyphs] = dmxProcRenderFreeGlyphs; ProcRenderVector[X_RenderCompositeGlyphs8] = dmxProcRenderCompositeGlyphs; ProcRenderVector[X_RenderCompositeGlyphs16] = dmxProcRenderCompositeGlyphs; ProcRenderVector[X_RenderCompositeGlyphs32] = dmxProcRenderCompositeGlyphs; ProcRenderVector[X_RenderSetPictureTransform] = dmxProcRenderSetPictureTransform; ProcRenderVector[X_RenderSetPictureFilter] = dmxProcRenderSetPictureFilter; } /** Reset the Proc Vector for the RENDER extension back to the original * functions. This function is called from dmxCloseScreen() during the * server reset (only for screen #0). */ void dmxResetRender(void) { int i; for (i = 0; i < RenderNumberRequests; i++) ProcRenderVector[i] = dmxSaveRenderVector[i]; } /** Initialize the RENDER extension, allocate the picture privates and * wrap mi function hooks. If the shadow frame buffer is used, then * call the appropriate fb initialization function. */ Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps; if (!miPictureInit(pScreen, formats, nformats)) return FALSE; if (!dixRegisterPrivateKey (&dmxPictPrivateKeyRec, PRIVATE_PICTURE, sizeof(dmxPictPrivRec))) return FALSE; ps = GetPictureScreen(pScreen); DMX_WRAP(CreatePicture, dmxCreatePicture, dmxScreen, ps); DMX_WRAP(DestroyPicture, dmxDestroyPicture, dmxScreen, ps); DMX_WRAP(ChangePictureClip, dmxChangePictureClip, dmxScreen, ps); DMX_WRAP(DestroyPictureClip, dmxDestroyPictureClip, dmxScreen, ps); DMX_WRAP(ChangePicture, dmxChangePicture, dmxScreen, ps); DMX_WRAP(ValidatePicture, dmxValidatePicture, dmxScreen, ps); DMX_WRAP(Composite, dmxComposite, dmxScreen, ps); DMX_WRAP(Glyphs, dmxGlyphs, dmxScreen, ps); DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps); DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps); DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps); return TRUE; } /** Find the appropriate format on the requested screen given the * internal format requested. The list of formats is searched * sequentially as the XRenderFindFormat() function does not always * find the appropriate format when a specific format is requested. */ static XRenderPictFormat * dmxFindFormat(DMXScreenInfo * dmxScreen, PictFormatPtr pFmt) { XRenderPictFormat *pFormat = NULL; int i = 0; if (!pFmt || !dmxScreen->beDisplay) return pFormat; while (1) { pFormat = XRenderFindFormat(dmxScreen->beDisplay, 0, 0, i++); if (!pFormat) break; if (pFormat->type != pFmt->type) continue; if (pFormat->depth != pFmt->depth) continue; if (pFormat->direct.red != pFmt->direct.red) continue; if (pFormat->direct.redMask != pFmt->direct.redMask) continue; if (pFormat->direct.green != pFmt->direct.green) continue; if (pFormat->direct.greenMask != pFmt->direct.greenMask) continue; if (pFormat->direct.blue != pFmt->direct.blue) continue; if (pFormat->direct.blueMask != pFmt->direct.blueMask) continue; if (pFormat->direct.alpha != pFmt->direct.alpha) continue; if (pFormat->direct.alphaMask != pFmt->direct.alphaMask) continue; /* We have a match! */ break; } return pFormat; } /** Free \a glyphSet on back-end screen number \a idx. */ Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet) { dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); int idx = pScreen->myNum; DMXScreenInfo *dmxScreen = &dmxScreens[idx]; if (glyphPriv->glyphSets[idx]) { XRenderFreeGlyphSet(dmxScreen->beDisplay, glyphPriv->glyphSets[idx]); glyphPriv->glyphSets[idx] = (GlyphSet) 0; return TRUE; } return FALSE; } /** Create \a glyphSet on the backend screen number \a idx. */ int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet) { XRenderPictFormat *pFormat; DMXScreenInfo *dmxScreen = &dmxScreens[idx]; dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); PictFormatPtr pFmt = glyphSet->format; int (*oldErrorHandler) (Display *, XErrorEvent *); pFormat = dmxFindFormat(dmxScreen, pFmt); if (!pFormat) { return BadMatch; } dmxGlyphLastError = 0; oldErrorHandler = XSetErrorHandler(dmxGlyphErrorHandler); /* Catch when this fails */ glyphPriv->glyphSets[idx] = XRenderCreateGlyphSet(dmxScreen->beDisplay, pFormat); XSetErrorHandler(oldErrorHandler); if (dmxGlyphLastError) { return dmxGlyphLastError; } return Success; } /** Create a Glyph Set on each screen. Save the glyphset ID from each * screen in the Glyph Set's private structure. Fail if the format * requested is not available or if the Glyph Set cannot be created on * the screen. */ static int dmxProcRenderCreateGlyphSet(ClientPtr client) { int ret; REQUEST(xRenderCreateGlyphSetReq); ret = dmxSaveRenderVector[stuff->renderReqType] (client); if (ret == Success) { GlyphSetPtr glyphSet; dmxGlyphPrivPtr glyphPriv; int i; /* Look up glyphSet that was just created ???? */ /* Store glyphsets from backends in glyphSet->devPrivate ????? */ /* Make sure we handle all errors here!! */ dixLookupResourceByType((void **) &glyphSet, stuff->gsid, GlyphSetType, client, DixDestroyAccess); glyphPriv = malloc(sizeof(dmxGlyphPrivRec)); if (!glyphPriv) return BadAlloc; glyphPriv->glyphSets = NULL; MAXSCREENSALLOC_RETURN(glyphPriv->glyphSets, BadAlloc); DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv); for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; int beret; if (!dmxScreen->beDisplay) { glyphPriv->glyphSets[i] = 0; continue; } if ((beret = dmxBECreateGlyphSet(i, glyphSet)) != Success) { int j; /* Free the glyph sets we've allocated thus far */ for (j = 0; j < i; j++) dmxBEFreeGlyphSet(screenInfo.screens[j], glyphSet); /* Free the resource created by render */ FreeResource(stuff->gsid, RT_NONE); return beret; } } } return ret; } /** Free the previously allocated Glyph Sets for each screen. */ static int dmxProcRenderFreeGlyphSet(ClientPtr client) { GlyphSetPtr glyphSet; REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixDestroyAccess); if (glyphSet && glyphSet->refcnt == 1) { dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); int i; for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; if (dmxScreen->beDisplay) { if (dmxBEFreeGlyphSet(screenInfo.screens[i], glyphSet)) dmxSync(dmxScreen, FALSE); } } MAXSCREENSFREE(glyphPriv->glyphSets); free(glyphPriv); DMX_SET_GLYPH_PRIV(glyphSet, NULL); } return dmxSaveRenderVector[stuff->renderReqType] (client); } /** Add glyphs to the Glyph Set on each screen. */ static int dmxProcRenderAddGlyphs(ClientPtr client) { int ret; REQUEST(xRenderAddGlyphsReq); ret = dmxSaveRenderVector[stuff->renderReqType] (client); if (ret == Success) { GlyphSetPtr glyphSet; dmxGlyphPrivPtr glyphPriv; int i; int nglyphs; CARD32 *gids; Glyph *gidsCopy; xGlyphInfo *gi; CARD8 *bits; int nbytes; dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); nglyphs = stuff->nglyphs; gids = (CARD32 *) (stuff + 1); gi = (xGlyphInfo *) (gids + nglyphs); bits = (CARD8 *) (gi + nglyphs); nbytes = ((stuff->length << 2) - sizeof(xRenderAddGlyphsReq) - (sizeof(CARD32) + sizeof(xGlyphInfo)) * nglyphs); gidsCopy = malloc(sizeof(*gidsCopy) * nglyphs); for (i = 0; i < nglyphs; i++) gidsCopy[i] = gids[i]; /* FIXME: Will this ever fail? */ for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; if (dmxScreen->beDisplay) { XRenderAddGlyphs(dmxScreen->beDisplay, glyphPriv->glyphSets[i], gidsCopy, (XGlyphInfo *) gi, nglyphs, (char *) bits, nbytes); dmxSync(dmxScreen, FALSE); } } free(gidsCopy); } return ret; } /** Free glyphs from the Glyph Set for each screen. */ static int dmxProcRenderFreeGlyphs(ClientPtr client) { GlyphSetPtr glyphSet; REQUEST(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixWriteAccess); if (glyphSet) { dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); int i; int nglyphs; Glyph *gids; nglyphs = ((client->req_len << 2) - sizeof(xRenderFreeGlyphsReq)) >> 2; if (nglyphs) { gids = malloc(sizeof(*gids) * nglyphs); for (i = 0; i < nglyphs; i++) gids[i] = ((CARD32 *) (stuff + 1))[i]; for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; if (dmxScreen->beDisplay) { XRenderFreeGlyphs(dmxScreen->beDisplay, glyphPriv->glyphSets[i], gids, nglyphs); dmxSync(dmxScreen, FALSE); } } free(gids); } } return dmxSaveRenderVector[stuff->renderReqType] (client); } /** Composite glyphs on each screen into the requested picture. If * either the src or dest picture has not been allocated due to lazy * window creation, this request will gracefully return. */ static int dmxProcRenderCompositeGlyphs(ClientPtr client) { int ret; REQUEST(xRenderCompositeGlyphsReq); ret = dmxSaveRenderVector[stuff->renderReqType] (client); /* For the following to work with PanoramiX, it assumes that Render * wraps the ProcRenderVector after dmxRenderInit has been called. */ if (ret == Success) { PicturePtr pSrc; dmxPictPrivPtr pSrcPriv; PicturePtr pDst; dmxPictPrivPtr pDstPriv; PictFormatPtr pFmt; XRenderPictFormat *pFormat; int size; int scrnNum; DMXScreenInfo *dmxScreen; CARD8 *buffer; CARD8 *end; int space; int nglyph; char *glyphs; char *curGlyph; xGlyphElt *elt; int nelt; XGlyphElt8 *elts; XGlyphElt8 *curElt; GlyphSetPtr glyphSet; dmxGlyphPrivPtr glyphPriv; dixLookupResourceByType((void **) &pSrc, stuff->src, PictureType, client, DixReadAccess); pSrcPriv = DMX_GET_PICT_PRIV(pSrc); if (!pSrcPriv->pict) return ret; dixLookupResourceByType((void **) &pDst, stuff->dst, PictureType, client, DixWriteAccess); pDstPriv = DMX_GET_PICT_PRIV(pDst); if (!pDstPriv->pict) return ret; scrnNum = pDst->pDrawable->pScreen->myNum; dmxScreen = &dmxScreens[scrnNum]; /* Note: If the back-end display has been detached, then it * should not be possible to reach here since the pSrcPriv->pict * and pDstPriv->pict will have already been set to 0. */ if (!dmxScreen->beDisplay) return ret; if (stuff->maskFormat) dixLookupResourceByType((void **) &pFmt, stuff->maskFormat, PictFormatType, client, DixReadAccess); else pFmt = NULL; pFormat = dmxFindFormat(dmxScreen, pFmt); switch (stuff->renderReqType) { case X_RenderCompositeGlyphs8: size = sizeof(CARD8); break; case X_RenderCompositeGlyphs16: size = sizeof(CARD16); break; case X_RenderCompositeGlyphs32: size = sizeof(CARD32); break; default: return BadPictOp; /* Can't happen */ } buffer = (CARD8 *) (stuff + 1); end = (CARD8 *) stuff + (stuff->length << 2); nelt = 0; nglyph = 0; while (buffer + sizeof(xGlyphElt) < end) { elt = (xGlyphElt *) buffer; buffer += sizeof(xGlyphElt); if (elt->len == 0xff) { buffer += 4; } else { nelt++; nglyph += elt->len; space = size * elt->len; if (space & 3) space += 4 - (space & 3); buffer += space; } } /* The following only works for Render version > 0.2 */ /* All of the XGlyphElt* structure sizes are identical */ elts = malloc(nelt * sizeof(XGlyphElt8)); if (!elts) return BadAlloc; glyphs = malloc(nglyph * size); if (!glyphs) { free(elts); return BadAlloc; } buffer = (CARD8 *) (stuff + 1); end = (CARD8 *) stuff + (stuff->length << 2); curGlyph = glyphs; curElt = elts; dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); while (buffer + sizeof(xGlyphElt) < end) { elt = (xGlyphElt *) buffer; buffer += sizeof(xGlyphElt); if (elt->len == 0xff) { dixLookupResourceByType((void **) &glyphSet, *((CARD32 *) buffer), GlyphSetType, client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); buffer += 4; } else { curElt->glyphset = glyphPriv->glyphSets[scrnNum]; curElt->xOff = elt->deltax; curElt->yOff = elt->deltay; curElt->nchars = elt->len; curElt->chars = curGlyph; memcpy(curGlyph, buffer, size * elt->len); curGlyph += size * elt->len; curElt++; space = size * elt->len; if (space & 3) space += 4 - (space & 3); buffer += space; } } switch (stuff->renderReqType) { case X_RenderCompositeGlyphs8: XRenderCompositeText8(dmxScreen->beDisplay, stuff->op, pSrcPriv->pict, pDstPriv->pict, pFormat, stuff->xSrc, stuff->ySrc, 0, 0, elts, nelt); break; case X_RenderCompositeGlyphs16: XRenderCompositeText16(dmxScreen->beDisplay, stuff->op, pSrcPriv->pict, pDstPriv->pict, pFormat, stuff->xSrc, stuff->ySrc, 0, 0, (XGlyphElt16 *) elts, nelt); break; case X_RenderCompositeGlyphs32: XRenderCompositeText32(dmxScreen->beDisplay, stuff->op, pSrcPriv->pict, pDstPriv->pict, pFormat, stuff->xSrc, stuff->ySrc, 0, 0, (XGlyphElt32 *) elts, nelt); break; } dmxSync(dmxScreen, FALSE); free(elts); free(glyphs); } return ret; } /** Set the picture transform on each screen. */ static int dmxProcRenderSetPictureTransform(ClientPtr client) { DMXScreenInfo *dmxScreen; PicturePtr pPicture; dmxPictPrivPtr pPictPriv; XTransform xform; REQUEST(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess); /* For the following to work with PanoramiX, it assumes that Render * wraps the ProcRenderVector after dmxRenderInit has been called. */ dmxScreen = &dmxScreens[pPicture->pDrawable->pScreen->myNum]; pPictPriv = DMX_GET_PICT_PRIV(pPicture); if (pPictPriv->pict) { xform.matrix[0][0] = stuff->transform.matrix11; xform.matrix[0][1] = stuff->transform.matrix12; xform.matrix[0][2] = stuff->transform.matrix13; xform.matrix[1][0] = stuff->transform.matrix21; xform.matrix[1][1] = stuff->transform.matrix22; xform.matrix[1][2] = stuff->transform.matrix23; xform.matrix[2][0] = stuff->transform.matrix31; xform.matrix[2][1] = stuff->transform.matrix32; xform.matrix[2][2] = stuff->transform.matrix33; XRenderSetPictureTransform(dmxScreen->beDisplay, pPictPriv->pict, &xform); dmxSync(dmxScreen, FALSE); } return dmxSaveRenderVector[stuff->renderReqType] (client); } /** Set the picture filter on each screen. */ static int dmxProcRenderSetPictureFilter(ClientPtr client) { DMXScreenInfo *dmxScreen; PicturePtr pPicture; dmxPictPrivPtr pPictPriv; char *filter; XFixed *params; int nparams; REQUEST(xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess); /* For the following to work with PanoramiX, it assumes that Render * wraps the ProcRenderVector after dmxRenderInit has been called. */ dmxScreen = &dmxScreens[pPicture->pDrawable->pScreen->myNum]; pPictPriv = DMX_GET_PICT_PRIV(pPicture); if (pPictPriv->pict) { filter = (char *) (stuff + 1); params = (XFixed *) (filter + ((stuff->nbytes + 3) & ~3)); nparams = ((XFixed *) stuff + client->req_len) - params; XRenderSetPictureFilter(dmxScreen->beDisplay, pPictPriv->pict, filter, params, nparams); dmxSync(dmxScreen, FALSE); } return dmxSaveRenderVector[stuff->renderReqType] (client); } /** Create a picture on the appropriate screen. This is the actual * function that creates the picture. However, if the associated * window has not yet been created due to lazy window creation, then * delay the picture creation until the window is mapped. */ static Picture dmxDoCreatePicture(PicturePtr pPicture) { DrawablePtr pDraw = pPicture->pDrawable; ScreenPtr pScreen = pDraw->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; XRenderPictFormat *pFormat; Drawable draw; if (pPicture->pDrawable->type == DRAWABLE_WINDOW) { dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV((WindowPtr) (pDraw)); if (!(draw = pWinPriv->window)) { /* Window has not been created yet due to the window * optimization. Delay picture creation until window is * mapped. */ pWinPriv->hasPict = TRUE; return 0; } } else { dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV((PixmapPtr) (pDraw)); if (!(draw = pPixPriv->pixmap)) { /* FIXME: Zero width/height pixmap?? */ return 0; } } /* This should not be reached if the back-end display has been * detached because the pWinPriv->window or the pPixPriv->pixmap * will be NULL; however, we add it here for completeness */ if (!dmxScreen->beDisplay) return 0; pFormat = dmxFindFormat(dmxScreen, pPicture->pFormat); return XRenderCreatePicture(dmxScreen->beDisplay, draw, pFormat, 0, 0); } /** Create a list of pictures. This function is called by * dmxCreateAndRealizeWindow() during the lazy window creation * realization process. It creates the entire list of pictures that * are associated with the given window. */ void dmxCreatePictureList(WindowPtr pWindow) { PicturePtr pPicture = GetPictureWindow(pWindow); while (pPicture) { dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); /* Create the picture for this window */ pPictPriv->pict = dmxDoCreatePicture(pPicture); /* ValidatePicture takes care of the state changes */ pPicture = pPicture->pNext; } } /** Create \a pPicture on the backend. */ int dmxBECreatePicture(PicturePtr pPicture) { dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); /* Create picutre on BE */ pPictPriv->pict = dmxDoCreatePicture(pPicture); /* Flush changes to the backend server */ dmxValidatePicture(pPicture, (1 << (CPLastBit + 1)) - 1); return Success; } /** Create a picture. This function handles the CreatePicture * unwrapping/wrapping and calls dmxDoCreatePicture to actually create * the picture on the appropriate screen. */ int dmxCreatePicture(PicturePtr pPicture) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); int ret = Success; DMX_UNWRAP(CreatePicture, dmxScreen, ps); #if 1 if (ps->CreatePicture) ret = ps->CreatePicture(pPicture); #endif /* Create picture on back-end server */ pPictPriv->pict = dmxDoCreatePicture(pPicture); pPictPriv->savedMask = 0; DMX_WRAP(CreatePicture, dmxCreatePicture, dmxScreen, ps); return ret; } /** Destroy \a pPicture on the back-end server. */ Bool dmxBEFreePicture(PicturePtr pPicture) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); if (pPictPriv->pict) { XRenderFreePicture(dmxScreen->beDisplay, pPictPriv->pict); pPictPriv->pict = (Picture) 0; return TRUE; } return FALSE; } /** Destroy a list of pictures that are associated with the window that * is being destroyed. This function is called by #dmxDestroyWindow(). * */ Bool dmxDestroyPictureList(WindowPtr pWindow) { PicturePtr pPicture = GetPictureWindow(pWindow); Bool ret = FALSE; while (pPicture) { ret |= dmxBEFreePicture(pPicture); pPicture = pPicture->pNext; } return ret; } /** Destroy a picture. This function calls the wrapped function that * frees the resources in the DMX server associated with this * picture. */ void dmxDestroyPicture(PicturePtr pPicture) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); DMX_UNWRAP(DestroyPicture, dmxScreen, ps); /* Destroy picture on back-end server */ if (dmxBEFreePicture(pPicture)) dmxSync(dmxScreen, FALSE); #if 1 if (ps->DestroyPicture) ps->DestroyPicture(pPicture); #endif DMX_WRAP(DestroyPicture, dmxDestroyPicture, dmxScreen, ps); } /** Change the picture's list of clip rectangles. */ int dmxChangePictureClip(PicturePtr pPicture, int clipType, void *value, int n) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); DMX_UNWRAP(ChangePictureClip, dmxScreen, ps); #if 1 if (ps->ChangePictureClip) ps->ChangePictureClip(pPicture, clipType, value, n); #endif /* Change picture clip rects on back-end server */ if (pPictPriv->pict) { /* The clip has already been changed into a region by the mi * routine called above. */ if (clipType == CT_NONE) { /* Disable clipping, show all */ XFixesSetPictureClipRegion(dmxScreen->beDisplay, pPictPriv->pict, 0, 0, None); } else if (pPicture->clientClip) { RegionPtr pClip = pPicture->clientClip; BoxPtr pBox = RegionRects(pClip); int nBox = RegionNumRects(pClip); XRectangle *pRects; XRectangle *pRect; int nRects; nRects = nBox; pRects = pRect = malloc(nRects * sizeof(*pRect)); while (nBox--) { pRect->x = pBox->x1; pRect->y = pBox->y1; pRect->width = pBox->x2 - pBox->x1; pRect->height = pBox->y2 - pBox->y1; pBox++; pRect++; } XRenderSetPictureClipRectangles(dmxScreen->beDisplay, pPictPriv->pict, 0, 0, pRects, nRects); free(pRects); } else { XRenderSetPictureClipRectangles(dmxScreen->beDisplay, pPictPriv->pict, 0, 0, NULL, 0); } dmxSync(dmxScreen, FALSE); } else { /* FIXME: Handle saving clip region when offscreen */ } DMX_WRAP(ChangePictureClip, dmxChangePictureClip, dmxScreen, ps); return Success; } /** Destroy the picture's list of clip rectangles. */ void dmxDestroyPictureClip(PicturePtr pPicture) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); DMX_UNWRAP(DestroyPictureClip, dmxScreen, ps); #if 1 if (ps->DestroyPictureClip) ps->DestroyPictureClip(pPicture); #endif /* Destroy picture clip rects on back-end server */ if (pPictPriv->pict) { XRenderSetPictureClipRectangles(dmxScreen->beDisplay, pPictPriv->pict, 0, 0, NULL, 0); dmxSync(dmxScreen, FALSE); } else { /* FIXME: Handle destroying clip region when offscreen */ } DMX_WRAP(DestroyPictureClip, dmxDestroyPictureClip, dmxScreen, ps); } /** Change the attributes of the pictures. If the picture has not yet * been created due to lazy window creation, save the mask so that it * can be used to appropriately initialize the picture's attributes * when it is created later. */ void dmxChangePicture(PicturePtr pPicture, Mask mask) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); DMX_UNWRAP(ChangePicture, dmxScreen, ps); #if 1 if (ps->ChangePicture) ps->ChangePicture(pPicture, mask); #endif /* Picture attribute changes are handled in ValidatePicture */ pPictPriv->savedMask |= mask; DMX_WRAP(ChangePicture, dmxChangePicture, dmxScreen, ps); } /** Validate the picture's attributes before rendering to it. Update * any picture attributes that have been changed by one of the higher * layers. */ void dmxValidatePicture(PicturePtr pPicture, Mask mask) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture); DMX_UNWRAP(ValidatePicture, dmxScreen, ps); /* Change picture attributes on back-end server */ if (pPictPriv->pict) { XRenderPictureAttributes attribs; if (mask & CPRepeat) { attribs.repeat = pPicture->repeatType; } if (mask & CPAlphaMap) { if (pPicture->alphaMap) { dmxPictPrivPtr pAlphaPriv; pAlphaPriv = DMX_GET_PICT_PRIV(pPicture->alphaMap); if (pAlphaPriv->pict) { attribs.alpha_map = pAlphaPriv->pict; } else { /* FIXME: alpha picture drawable has not been created?? */ return; /* or should this be: attribs.alpha_map = None; */ } } else { attribs.alpha_map = None; } } if (mask & CPAlphaXOrigin) attribs.alpha_x_origin = pPicture->alphaOrigin.x; if (mask & CPAlphaYOrigin) attribs.alpha_y_origin = pPicture->alphaOrigin.y; if (mask & CPClipXOrigin) attribs.clip_x_origin = pPicture->clipOrigin.x; if (mask & CPClipYOrigin) attribs.clip_y_origin = pPicture->clipOrigin.y; if (mask & CPClipMask) mask &= ~CPClipMask; /* Handled in ChangePictureClip */ if (mask & CPGraphicsExposure) attribs.graphics_exposures = pPicture->graphicsExposures; if (mask & CPSubwindowMode) attribs.subwindow_mode = pPicture->subWindowMode; if (mask & CPPolyEdge) attribs.poly_edge = pPicture->polyEdge; if (mask & CPPolyMode) attribs.poly_mode = pPicture->polyMode; if (mask & CPComponentAlpha) attribs.component_alpha = pPicture->componentAlpha; XRenderChangePicture(dmxScreen->beDisplay, pPictPriv->pict, mask, &attribs); dmxSync(dmxScreen, FALSE); } else { pPictPriv->savedMask |= mask; } #if 1 if (ps->ValidatePicture) ps->ValidatePicture(pPicture, mask); #endif DMX_WRAP(ValidatePicture, dmxValidatePicture, dmxScreen, ps); } /** Composite a picture on the appropriate screen by combining the * specified rectangle of the transformed src and mask operands with * the specified rectangle of the dst using op as the compositing * operator. For a complete description see the protocol document of * the RENDER library. */ void dmxComposite(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; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc); dmxPictPrivPtr pMaskPriv = NULL; dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst); if (pMask) pMaskPriv = DMX_GET_PICT_PRIV(pMask); DMX_UNWRAP(Composite, dmxScreen, ps); #if 0 if (ps->Composite) ps->Composite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); #endif /* Composite on back-end server */ if (pSrcPriv->pict && pDstPriv->pict && ((pMaskPriv && pMaskPriv->pict) || !pMaskPriv)) { XRenderComposite(dmxScreen->beDisplay, op, pSrcPriv->pict, pMaskPriv ? pMaskPriv->pict : None, pDstPriv->pict, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); dmxSync(dmxScreen, FALSE); } DMX_WRAP(Composite, dmxComposite, dmxScreen, ps); } /** Null function to catch when/if RENDER calls lower level mi hooks. * Compositing glyphs is handled by dmxProcRenderCompositeGlyphs(). * This function should never be called. */ void dmxGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlists, GlyphListPtr lists, GlyphPtr * glyphs) { /* This won't work, so we need to wrap ProcRenderCompositeGlyphs */ } /** Fill a rectangle on the appropriate screen by combining the color * with the dest picture in the area specified by the list of * rectangles. For a complete description see the protocol document of * the RENDER library. */ void dmxCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects) { ScreenPtr pScreen = pDst->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pDst); DMX_UNWRAP(CompositeRects, dmxScreen, ps); #if 0 if (ps->CompositeRects) ps->CompositeRects(op, pDst, color, nRect, rects); #endif /* CompositeRects on back-end server */ if (pPictPriv->pict) { XRenderFillRectangles(dmxScreen->beDisplay, op, pPictPriv->pict, (XRenderColor *) color, (XRectangle *) rects, nRect); dmxSync(dmxScreen, FALSE); } DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps); } /** Indexed color visuals are not yet supported. */ Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat) { return TRUE; } /** Indexed color visuals are not yet supported. */ void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat) { } /** Indexed color visuals are not yet supported. */ void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat, int ndef, xColorItem * pdef) { } /** Composite a list of trapezoids on the appropriate screen. For a * complete description see the protocol document of the RENDER * library. */ void dmxTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps) { ScreenPtr pScreen = pDst->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc); dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst); DMX_UNWRAP(Trapezoids, dmxScreen, ps); #if 0 if (ps->Trapezoids) ps->Trapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, *traps); #endif /* Draw trapezoids on back-end server */ if (pDstPriv->pict) { XRenderPictFormat *pFormat; pFormat = dmxFindFormat(dmxScreen, maskFormat); if (!pFormat) { /* FIXME: Error! */ } XRenderCompositeTrapezoids(dmxScreen->beDisplay, op, pSrcPriv->pict, pDstPriv->pict, pFormat, xSrc, ySrc, (XTrapezoid *) traps, ntrap); dmxSync(dmxScreen, FALSE); } DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps); } /** Composite a list of triangles on the appropriate screen. For a * complete description see the protocol document of the RENDER * library. */ void dmxTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris) { ScreenPtr pScreen = pDst->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc); dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst); DMX_UNWRAP(Triangles, dmxScreen, ps); #if 0 if (ps->Triangles) ps->Triangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, *tris); #endif /* Draw trapezoids on back-end server */ if (pDstPriv->pict) { XRenderPictFormat *pFormat; pFormat = dmxFindFormat(dmxScreen, maskFormat); if (!pFormat) { /* FIXME: Error! */ } XRenderCompositeTriangles(dmxScreen->beDisplay, op, pSrcPriv->pict, pDstPriv->pict, pFormat, xSrc, ySrc, (XTriangle *) tris, ntri); dmxSync(dmxScreen, FALSE); } DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps); } xorg-server-1.17.1/hw/dmx/dmxwindow.h0000664000175100017510000001125012415504026014406 00000000000000/* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * Interface for window support. \see dmxwindow.c */ #ifndef DMXWINDOW_H #define DMXWINDOW_H #include "windowstr.h" /** Window private area. */ typedef struct _dmxWinPriv { Window window; Bool offscreen; Bool mapped; Bool restacked; unsigned long attribMask; Colormap cmap; Visual *visual; Bool isShaped; Bool hasPict; #ifdef GLXEXT void *swapGroup; int barrier; void (*windowDestroyed) (WindowPtr); void (*windowUnmapped) (WindowPtr); #endif } dmxWinPrivRec, *dmxWinPrivPtr; extern Bool dmxInitWindow(ScreenPtr pScreen); extern Window dmxCreateRootWindow(WindowPtr pWindow); extern void dmxGetDefaultWindowAttributes(WindowPtr pWindow, Colormap * cmap, Visual ** visual); extern void dmxCreateAndRealizeWindow(WindowPtr pWindow, Bool doSync); extern Bool dmxCreateWindow(WindowPtr pWindow); extern Bool dmxDestroyWindow(WindowPtr pWindow); extern Bool dmxPositionWindow(WindowPtr pWindow, int x, int y); extern Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask); extern Bool dmxRealizeWindow(WindowPtr pWindow); extern Bool dmxUnrealizeWindow(WindowPtr pWindow); extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib); extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn); extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); extern void dmxResizeWindow(WindowPtr pWindow, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib); extern void dmxReparentWindow(WindowPtr pWindow, WindowPtr pPriorParent); extern void dmxChangeBorderWidth(WindowPtr pWindow, unsigned int width); extern void dmxResizeScreenWindow(ScreenPtr pScreen, int x, int y, int w, int h); extern void dmxResizeRootWindow(WindowPtr pRoot, int x, int y, int w, int h); extern Bool dmxBEDestroyWindow(WindowPtr pWindow); /* Support for shape extension */ extern void dmxSetShape(WindowPtr pWindow, int kind); /** Get window private pointer. */ #define DMX_GET_WINDOW_PRIV(_pWin) ((dmxWinPrivPtr) \ dixLookupPrivate(&(_pWin)->devPrivates, dmxWinPrivateKey)) /* All of these macros are only used in dmxwindow.c */ #define DMX_WINDOW_FUNC_PROLOGUE(_pGC) \ do { \ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(_pGC); \ DMX_UNWRAP(funcs, pGCPriv, (_pGC)); \ if (pGCPriv->ops) \ DMX_UNWRAP(ops, pGCPriv, (_pGC)); \ } while (0) #define DMX_WINDOW_FUNC_EPILOGUE(_pGC) \ do { \ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(_pGC); \ DMX_WRAP(funcs, &dmxGCFuncs, pGCPriv, (_pGC)); \ if (pGCPriv->ops) \ DMX_WRAP(ops, &dmxGCOps, pGCPriv, (_pGC)); \ } while (0) #define DMX_WINDOW_X1(_pWin) \ ((_pWin)->drawable.x - wBorderWidth(_pWin)) #define DMX_WINDOW_Y1(_pWin) \ ((_pWin)->drawable.y - wBorderWidth(_pWin)) #define DMX_WINDOW_X2(_pWin) \ ((_pWin)->drawable.x + wBorderWidth(_pWin) + (_pWin)->drawable.width) #define DMX_WINDOW_Y2(_pWin) \ ((_pWin)->drawable.y + wBorderWidth(_pWin) + (_pWin)->drawable.height) #define DMX_WINDOW_OFFSCREEN(_pWin) \ (DMX_WINDOW_X1(_pWin) >= (_pWin)->drawable.pScreen->width || \ DMX_WINDOW_Y1(_pWin) >= (_pWin)->drawable.pScreen->height || \ DMX_WINDOW_X2(_pWin) <= 0 || \ DMX_WINDOW_Y2(_pWin) <= 0) #endif /* DMXWINDOW_H */ xorg-server-1.17.1/hw/dmx/dmxvisual.c0000664000175100017510000001033712366220413014402 00000000000000/* * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * This file provides support for visuals. */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include "dmx.h" #include "dmxvisual.h" #include "scrnintstr.h" #ifdef GLXEXT #include extern VisualID glxMatchVisualInConfigList(ScreenPtr pScreen, VisualPtr pVisual, __GLXvisualConfig * configs, int nconfigs); static Visual * dmxLookupGLXVisual(ScreenPtr pScreen, VisualPtr pVisual) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; int j; VisualID vid; vid = glxMatchVisualInConfigList(pScreen, pVisual, dmxScreen->glxVisuals, dmxScreen->numGlxVisuals); if (vid) { /* Find the X visual of the matching GLX visual */ for (j = 0; j < dmxScreen->beNumVisuals; j++) if (vid == dmxScreen->beVisuals[j].visualid) return dmxScreen->beVisuals[j].visual; } /* No matching visual found */ return NULL; } #endif /** Return the visual that matched \a pVisual. */ Visual * dmxLookupVisual(ScreenPtr pScreen, VisualPtr pVisual) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; int i; #ifdef GLXEXT Visual *retval; #endif if (!dmxScreen->beDisplay) return NULL; #ifdef GLXEXT if ((retval = dmxLookupGLXVisual(pScreen, pVisual))) return retval; #endif for (i = 0; i < dmxScreen->beNumVisuals; i++) { if (pVisual->class == dmxScreen->beVisuals[i].class && pVisual->bitsPerRGBValue == dmxScreen->beVisuals[i].bits_per_rgb && pVisual->ColormapEntries == dmxScreen->beVisuals[i].colormap_size && pVisual->nplanes == dmxScreen->beVisuals[i].depth && pVisual->redMask == dmxScreen->beVisuals[i].red_mask && pVisual->greenMask == dmxScreen->beVisuals[i].green_mask && pVisual->blueMask == dmxScreen->beVisuals[i].blue_mask) { return dmxScreen->beVisuals[i].visual; } } return NULL; } /** Return the visual that matched the \a vid. */ Visual * dmxLookupVisualFromID(ScreenPtr pScreen, VisualID vid) { Visual *visual; int i; if (!dmxScreens[pScreen->myNum].beDisplay) return NULL; for (i = 0; i < pScreen->numVisuals; i++) { if (pScreen->visuals[i].vid == vid) { visual = dmxLookupVisual(pScreen, &pScreen->visuals[i]); if (visual) return visual; } } return NULL; } /** Return the colormap for the \a visual. */ Colormap dmxColormapFromDefaultVisual(ScreenPtr pScreen, Visual * visual) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; int i; if (dmxScreen->beDisplay) { for (i = 0; i < dmxScreen->beNumDefColormaps; i++) if (visual == dmxScreen->beVisuals[i].visual) return dmxScreen->beDefColormaps[i]; } return None; } xorg-server-1.17.1/hw/dmx/dmxpixmap.c0000664000175100017510000001666512366220413014407 00000000000000/* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Kevin E. Martin * */ /** \file * Provides pixmap support. */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include "dmx.h" #include "dmxsync.h" #include "dmxpixmap.h" #include "pixmapstr.h" #include "servermd.h" #include "privates.h" /** Initialize a private area in \a pScreen for pixmap information. */ Bool dmxInitPixmap(ScreenPtr pScreen) { if (!dixRegisterPrivateKey (&dmxPixPrivateKeyRec, PRIVATE_PIXMAP, sizeof(dmxPixPrivRec))) return FALSE; return TRUE; } /** Create a pixmap on the back-end server. */ void dmxBECreatePixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap); /* Make sure we haven't already created this pixmap. This can * happen when the pixmap is used elsewhere (e.g., as a background * or border for a window) and the refcnt > 1. */ if (pPixPriv->pixmap) return; if (pPixmap->drawable.width && pPixmap->drawable.height) { pPixPriv->pixmap = XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin, pPixmap->drawable.width, pPixmap->drawable.height, pPixmap->drawable.depth); dmxSync(dmxScreen, FALSE); } } /** Create a pixmap for \a pScreen with the specified \a width, \a * height, and \a depth. */ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, unsigned usage_hint) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PixmapPtr pPixmap; int bpp; dmxPixPrivPtr pPixPriv; #if 0 DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen); if (pScreen->CreatePixmap) ret = pScreen->CreatePixmap(pPixmap); #endif /* Create pixmap on back-end server */ if (depth == 24) bpp = 32; else bpp = depth; pPixmap = AllocatePixmap(pScreen, 0); if (!pPixmap) return NullPixmap; pPixmap->drawable.type = DRAWABLE_PIXMAP; pPixmap->drawable.class = 0; pPixmap->drawable.pScreen = pScreen; pPixmap->drawable.depth = depth; pPixmap->drawable.bitsPerPixel = bpp; pPixmap->drawable.id = 0; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pPixmap->drawable.x = 0; pPixmap->drawable.y = 0; pPixmap->drawable.width = width; pPixmap->drawable.height = height; pPixmap->devKind = PixmapBytePad(width, bpp); pPixmap->refcnt = 1; pPixmap->usage_hint = usage_hint; pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap); pPixPriv->pixmap = (Pixmap) 0; pPixPriv->detachedImage = NULL; /* Create the pixmap on the back-end server */ if (dmxScreen->beDisplay) { dmxBECreatePixmap(pPixmap); } #if 0 DMX_WRAP(CreatePixmap, dmxCreatePixmap, dmxScreen, pScreen); #endif return pPixmap; } /** Destroy the pixmap on the back-end server. */ Bool dmxBEFreePixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap); if (pPixPriv->pixmap) { XFreePixmap(dmxScreen->beDisplay, pPixPriv->pixmap); pPixPriv->pixmap = (Pixmap) 0; return TRUE; } return FALSE; } /** Destroy the pixmap pointed to by \a pPixmap. */ Bool dmxDestroyPixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; Bool ret = TRUE; #if 0 DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen); #endif if (--pPixmap->refcnt) return TRUE; /* Destroy pixmap on back-end server */ if (dmxScreen->beDisplay) { if (dmxBEFreePixmap(pPixmap)) { /* Also make sure that we destroy any detached image */ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap); if (pPixPriv->detachedImage) XDestroyImage(pPixPriv->detachedImage); dmxSync(dmxScreen, FALSE); } } FreePixmap(pPixmap); #if 0 if (pScreen->DestroyPixmap) ret = pScreen->DestroyPixmap(pPixmap); DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen); #endif return ret; } /** Create and return a region based on the pixmap pointed to by \a * pPixmap. */ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap) { DMXScreenInfo *dmxScreen = &dmxScreens[pPixmap->drawable.pScreen->myNum]; dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap); XImage *ximage; RegionPtr pReg, pTmpReg; int x, y; unsigned long previousPixel, currentPixel; BoxRec Box; Bool overlap; if (!dmxScreen->beDisplay) { pReg = RegionCreate(NullBox, 1); return pReg; } ximage = XGetImage(dmxScreen->beDisplay, pPixPriv->pixmap, 0, 0, pPixmap->drawable.width, pPixmap->drawable.height, 1, XYPixmap); pReg = RegionCreate(NullBox, 1); pTmpReg = RegionCreate(NullBox, 1); if (!pReg || !pTmpReg) { XDestroyImage(ximage); return NullRegion; } for (y = 0; y < pPixmap->drawable.height; y++) { Box.y1 = y; Box.y2 = y + 1; previousPixel = 0L; for (x = 0; x < pPixmap->drawable.width; x++) { currentPixel = XGetPixel(ximage, x, y); if (previousPixel != currentPixel) { if (previousPixel == 0L) { /* left edge */ Box.x1 = x; } else if (currentPixel == 0L) { /* right edge */ Box.x2 = x; RegionReset(pTmpReg, &Box); RegionAppend(pReg, pTmpReg); } previousPixel = currentPixel; } } if (previousPixel != 0L) { /* right edge because of the end of pixmap */ Box.x2 = pPixmap->drawable.width; RegionReset(pTmpReg, &Box); RegionAppend(pReg, pTmpReg); } } RegionDestroy(pTmpReg); XDestroyImage(ximage); RegionValidate(pReg, &overlap); dmxSync(dmxScreen, FALSE); return pReg; } xorg-server-1.17.1/hw/dmx/man/0000775000175100017510000000000012466505444013064 500000000000000xorg-server-1.17.1/hw/dmx/man/Makefile.am0000664000175100017510000000007012160102336015015 00000000000000include $(top_srcdir)/manpages.am appman_PRE = Xdmx.man xorg-server-1.17.1/hw/dmx/man/Xdmx.man0000664000175100017510000005547712223624774014442 00000000000000.\" .\" Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. .\" All Rights Reserved. .\" .\" Permission is hereby granted, free of charge, to any person obtaining .\" a copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation on the rights to use, copy, modify, merge, .\" publish, distribute, sublicense, and/or sell copies of the Software, .\" and to permit persons to whom the Software is furnished to do so, .\" subject to the following conditions: .\" .\" The above copyright notice and this permission notice (including the .\" next paragraph) shall be included in all copies or substantial .\" portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND .\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS .\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN .\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN .\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE .\" SOFTWARE. .TH Xdmx 1 __vendorversion__ .SH NAME Xdmx - Distributed Multi-head X server .SH SYNOPSIS .B Xdmx [:display] [option ...] .SH DESCRIPTION .I Xdmx is a proxy X server that uses one or more other X servers as its display devices. It provides multi-head X functionality for displays that might be located on different machines. .I Xdmx functions as a front-end X server that acts as a proxy to a set of back-end X servers. All of the visible rendering is passed to the back-end X servers. Clients connect to the .I Xdmx front-end, and everything appears as it would in a regular multi-head configuration. If Xinerama is enabled (e.g., with .B +xinerama on the command line), the clients see a single large screen. .PP .I Xdmx communicates to the back-end X servers using the standard X11 protocol, and standard and/or commonly available X server extensions. .SH OPTIONS In addition to the normal X server options described in the .I Xserver(__appmansuffix__) manual page, .I Xdmx accepts the following command line switches: .TP 8 .BI "\-display " display-name This specifies the name(s) of the back-end X server display(s) to connect to. This option may be specified multiple times to connect to more than one back-end display. The first is used as screen 0, the second as screen 1, etc. If this option is omitted, the .B $DISPLAY environment variable is used as the single back-end X server display. .sp .TP 8 .BI "\-xinput " input-source This specifies the source to use for XInput extension devices. The choices are the same as for .BR "\-input " , described below, except that core devices on backend servers cannot be treated as XInput extension devices. (Although extension devices on backend and console servers are supported as extension devices under .IR Xdmx ). .sp .TP 8 .BI "\-input " input-source This specifies the source to use for the core input devices. The choices are: .RS .TP 4 .B dummy A set of dummy core input drivers are used. These never generate any input events. .sp .TP 4 .B local The raw keyboard and pointer from the local computer are used. A comma-separated list of driver names can be appended. For example, to select the example Linux keyboard and PS/2 mouse driver use: .BR "-input local,kbd,ps2" . The following drivers have been implemented for Linux: kbd, ms (a two-button Microsoft mouse driver), ps2 (a PS/2 mouse driver), usb-mou (a USB mouse driver), usb-kbd (a USB keyboard driver), and usb-oth (a USB non-keyboard, non-mouse driver). Additional drivers may be implemented in the future. Appropriate defaults will be used if no comma-separated list is provided. .sp .TP 4 .I display-name If the display-name is a back-end server, then core input events are taken from the server specified. Otherwise, a console window will be opened on the specified display. .sp If the .I display-name is followed by ",xi" then XInput extension devices on the display will be used as .I Xdmx XInput extension devices. If the .I display-name is followed by ",noxi" then XInput extension devices on the display will .B not be used as .I Xdmx XInput extension devices. Currently, the default is ",xi". .sp If the .I display-name is followed by ",console" and the .I display-name refers to a display that is used as a backend display, then a console window will be opened on that display .B and that display will be treated as a backend display. Otherwise (or if ",noconsole" is used), the display will be treated purely as a backend or a console display, as described above. .sp If the .I display-name is followed by ",windows", then outlines of the windows on the backend will be displayed inside the console window. Otherwise (or if ",nowindows" is used), the console window will not display the outlines of backend windows. (This option only applies to console input.) .sp If the .I display-name is followed by ",xkb", then the next 1 to 3 comma-separated parameters will specify the keycodes, symbols, and geometry of the keyboard for this input device. For example, ",xkb,xfree86,pc104" will specify that the "xfree86" keycodes and the "pc104" symbols should be used to initialize the keyboard. For an SGI keyboard, ",xkb,sgi/indy(pc102)" might be useful. A list of keycodes, symbols, and geometries can be found in .IR __xkbdir__ . Use of keycodes, symbols and geometries for XKB configuration is deprecated in favor of the rules, layout, model, variant and options settings available via the -param command line switch. If this option is not specified, the input device will be queried, perhaps using the XKEYBOARD extension. .RE .sp .RS If this option isn't specified, the default input source is the first back-end server (the one used for screen 0). The console window shows the layout of the back-end display(s) and pointer movements and key presses within the console window will be used as core input devices. .sp Several special function keys are active, depending on the input source: .sp .RS .B Ctrl-Alt-q will terminate the .I Xdmx server in all modes. .sp .B Ctrl-Alt-g will toggle a server grab in console mode (a special cursor, currently a spider, is used to indicate an active server grab). .sp .B Ctrl-Alt-f will toggle fine-grain motion in console mode (a special cursor, currently a cross hair, is used to indicate this mode). If this mode is combined with a server grab, then the cursor will have 4 lines instead of only 2. .sp .BR Ctrl-Alt-F1 " through " Ctrl-Alt-F12 will switch to another VC in local (raw) mode. .RE .RE .sp .TP 8 .BI "-nomulticursor" This option turns off support for displaying multiple cursors on overlapped back-end displays. This option is available for testing and benchmarking purposes. .sp .TP 8 .BI "-fontpath" This option sets the .I Xdmx server's default font path. This option can be specified multiple times to accommodate multiple font paths. See the .B "FONT PATHS" section below for very important information regarding setting the default font path. .sp .TP 8 .BI "-configfile " filename Specify the configuration file that should be read. Note that if the .B \-display command-line option is used, then the configuration file will be ignored. .sp .TP 8 .BI "-config " name Specify a configuration to use. The .I name will be the name following the .B virtual keyword in the configuration file. .sp .TP 8 .BI "-stat " "interval screens" This option enables the display of performance statistics. The interval is in seconds. The screens is a count of the number of back-end screens for which data is printed each interval. Specifying 0 for screens will display data for all screens. .sp For each screen, the following information is printed: the screen number, an absolute count of the number of XSync() calls made (SyncCount), the rate of these calls during the previous interval (Sync/s), the average round-trip time (in microseconds) of the last 10 XSync() calls (avSync), the maximum round-trip time (in microseconds) of the last 10 XSync calls (mxSync), the average number of XSync() requests that were pending but not yet processed for each of the last 10 processed XSync() calls, the maximum number of XSync() requests that were pending but not yet processed for each of the last 10 processed XSync() calls, and a histogram showing the distribution of the times of all of the XSync() calls that were made during the previous interval. .sp (The length of the moving average and the number and value of histogram bins are configurable at compile time in the .B dmxstat.h header file.) .sp .TP 8 .BI "-syncbatch " interval This option sets the .I interval in milliseconds for XSync() batching. An .I interval less than or equal to 0 will disable XSync() batching. The default .I interval is 100 ms. .sp .TP 8 .BI "-nooffscreenopt" This option disables the offscreen optimization. Since the lazy window creation optimization requires the offscreen optimization to be enabled, this option will also disable the lazy window creation optimization. .sp .TP 8 .BI "-nowindowopt" This option disables the lazy window creation optimization. .sp .TP 8 .BI "-nosubdivprims" This option disables the primitive subdivision optimization. .sp .TP 8 .BI "-noxkb" Disable use of the XKB extension for communication with the back end displays. (Combine with .B "-kb" to disable all use of XKB.) .sp .TP 8 .BI "-depth " int This option sets the root window's default depth. When choosing a default visual from those available on the back-end X server, the first visual with that matches the depth specified is used. .sp This option can be combined with the .BI "-cc" option, which specifies the default color visual class, to force the use of a specific depth and color class for the root window. .sp .TP 8 .BI "-norender" This option disables the RENDER extension. .sp .TP 8 .BI "-noglxproxy" This option disables GLX proxy -- the build-in GLX extension implementation that is DMX aware. .sp .TP 8 .BI "-noglxswapgroup" This option disables the swap group and swap barrier extensions in GLX proxy. .sp .TP 8 .BI "-glxsyncswap" This option enables synchronization after a swap buffers call by waiting until all X protocol has been processed. When a client issues a glXSwapBuffers request, Xdmx relays that request to each back-end X server, and those requests are buffered along with all other protocol requests. However, in systems that have large network buffers, this buffering can lead to the set of back-end X servers handling the swap buffers request asynchronously. With this option, an XSync() request is issued to each back-end X server after sending the swap buffers request. The XSync() requests will flush all buffered protocol (including the swap buffers requests) and wait until the back-end X servers have processed those requests before continuing. This option does not wait until all GL commands have been processed so there might be previously issued commands that are still being processed in the GL pipe when the XSync() request returns. See the .BI "-glxfinishswap" option below if Xdmx should wait until the GL commands have been processed. .sp .TP 8 .BI "-glxfinishswap" This option enables synchronization after a swap buffers call by waiting until all GL commands have been completed. It is similar to the .BI "-glxsyncswap" option above; however, instead of issuing an XSync(), it issues a glFinish() request to each back-end X server after sending the swap buffers requests. The glFinish() request will flush all buffered protocol requests, process both X and GL requests, and wait until all previously called GL commands are complete before returning. .sp .TP 8 .BI "-ignorebadfontpaths" This option ignores font paths that are not available on all back-end servers by removing the bad font path(s) from the default font path list. If no valid font paths are left after removing the bad paths, an error to that effect is printed in the log. .sp .TP 8 .BI "-addremovescreens" This option enables the dynamic addition and removal of screens, which is disabled by default. Note that GLXProxy and Render do not yet support dynamic addition and removal of screens, and must be disabled via the .BI "-noglxproxy" and .BI "-norender" command line options described above. .sp .TP 8 .BI "-param" This option specifies parameters on the command line. Currently, only parameters dealing with XKEYBOARD configuration are supported. These parameters apply only to the core keyboard. Parameter values are installation-dependent. Please see .I __xkbdir__ or a similar directory for complete information. .RS .TP 8 .B XkbRules Defaults to "__XKB_DFLT_RULES__". Other values may include "sgi" and "sun". .sp .TP 8 .B XkbModel Defaults to "__XKB_DFLT_MODEL__". When used with "base" rules, other values may include "pc102", "pc104", "microsoft", and many others. When used with "sun" rules, other values may include "type4" and "type5". .sp .TP 8 .B XkbLayout Defaults to "__XKB_DFLT_LAYOUT__". Other country codes and "dvorak" are usually available. .sp .TP 8 .B XkbVariant Defaults to "__XKB_DFLT_VARIANT__". .sp .TP 8 .B XkbOptions Defaults to "__XKB_DFLT_OPTIONS__". .RE .SH "CONFIGURATION FILE GRAMMAR" The following words and tokens are reserved: .RS .B virtual .B display .B wall .B option .B param .B { .B } .B ; .B # .RE .PP Comments start with a .B # mark and extend to the end of the line. They may appear anywhere. If a configuration file is read into .BR xdmxconfig , the comments in that file will be preserved, but will not be editable. .PP The grammar is as follows: .RS virtual-list ::= [ virtual-list ] | virtual virtual ::= .B virtual [ name ] [ dim ] .B { dw-list .B } dw-list ::= [ dw-list ] | dw dw ::= display | wall | option display ::= .B display name [ geometry ] [ / geometry ] [ origin ] .B ; wall ::= .B wall [ dim ] [ dim ] name-list .B ; option ::= .B option name-list .B ; param ::= .B param name-list .B ; param ::= .B param { param-list .B } param-list ::= [ param-list ] | name-list .B ; name-list ::= [ name-list ] | name name ::= string | double-quoted-string dim ::= integer .B x integer geometry ::= [ integer .B x integer ] [ signed-integer signed-integer ] origin ::= .B @ integer .B x integer .RE .PP The name following .B virtual is used as an identifier for the configuration, and may be passed to .B Xdmx using the .B \-config command line option. The name of a display should be standard X display name, although no checking is performed (e.g., "machine:0"). .PP For names, double quotes are optional unless the name is reserved or contains spaces. .PP The first dimension following .B wall is the dimension for tiling (e.g., 2x4 or 4x4). The second dimension following .B wall is the dimension of each display in the wall (e.g., 1280x1024). .PP The first geometry following .B display is the geometry of the screen window on the backend server. The second geometry, which is always preceeded by a slash, is the geometry of the root window. By default, the root window has the same geometry as the screen window. .PP The .B option line can be used to specify any command-line options (e.g., .BR \-input ). (It cannot be used to specify the name of the front-end display.) The option line is processed once at server startup, just line command line options. This behavior may be unexpected. .SH "CONFIGURATION FILE EXAMPLES" Two displays being used for a desktop may be specified in any of the following formats: .RS .nf virtual example0 { display d0:0 1280x1024 @0x0; display d1:0 1280x1024 @1280x0; } .sp virtual example1 { display d0:0 1280x1024; display d1:0 @1280x0; } .sp virtual example2 { display "d0:0"; display "d1:0" @1280x0; } .sp virtual example3 { wall 2x1 d0:0 d1:0; } .fi .RE A 4x4 wall of 16 total displays could be specified as follows (if no tiling dimension is specified, an approximate square is used): .RS .nf virtual example4 { wall d0:0 d1:0 d2:0 d3:0 d4:0 d5:0 d6:0 d7:0 d8:0 d9:0 da:0 db:0 dc:0 dd:0 de:0 df:0; } .fi .RE .SH "FONT PATHS" The font path used by the .I Xdmx front-end server will be propagated to each back-end server,which requires that each back-end server have access to the exact same font paths as the front-end server. This can be most easily handled by either using a font server (e.g., xfs) or by remotely mounting the font paths on each back-end server, and then setting the .I Xdmx server's default font path with the -I "-fontpath" command line option described above. .PP For example, if you specify a font path with the following command line: .RS Xdmx :1 -display d0:0 -fontpath /usr/fonts/75dpi/ -fontpath /usr/fonts/Type1/ +xinerama .RE Then, /usr/fonts/75dpi/ and /usr/fonts/Type1/ must be valid font paths on the .I Xdmx server and all back-end server, which is d0 in this example. .PP Font servers can also be specified with the .I "-fontpath" option. For example, let's assume that a properly configured font server is running on host d0. Then, the following command line .RS Xdmx :1 -display d0:0 -display d1:0 -fontpath tcp/d0:7100 +xinerama .RE will initialize the front-end .I Xdmx server and each of the back-end servers to use the font server on d0. .PP Some fonts might not be supported by either the front-end or the back-end servers. For example, let's assume the front-end .I Xdmx server includes support Type1 fonts, but one of the back-end servers does not. Let's also assume that the default font path for .I Xdmx includes Type1 fonts in its font path. Then, when .I Xdmx initializes the default font path to load the default font, the font path that includes Type1 fonts (along with the other default font paths that are used by the .I Xdmx server) is sent to the back-end server that cannot handle Type1 fonts. That back-end server then rejects the font path and sends an error back to the .I Xdmx server. .I Xdmx then prints an error message and exits because it failed to set the default font path and was unable load the default font. .PP To fix this error, the offending font path must be removed from the default font path by using a different .I "-fontpath" command line option. .PP The .I "-fontpath" option can also be added to the configuration file as described above. .SH "COMMAND-LINE EXAMPLES" The back-end machines are d0 and d1, core input is from the pointer and keyboard attached to d0, clients will refer to :1 when opening windows: .RS Xdmx :1 -display d0:0 -display d1:0 +xinerama .RE .PP As above, except with core input from d1: .RS Xdmx :1 -display d0:0 -display d1:0 -input d1:0 +xinerama .RE .PP As above, except with core input from a console window on the local display: .RS Xdmx :1 -display d0:0 -display d1:0 -input :0 +xinerama .RE .PP As above, except with core input from the local keyboard and mouse: .RS Xdmx :1 -display d0:0 -display d1:0 -input local,kbd,ps2 +xinerama .RE Note that local input can be used under Linux while another X session is running on :0 (assuming the user can access the Linux console tty and mouse devices): a new (blank) VC will be used for keyboard input on the local machine and the Ctrl-Alt-F* sequence will be available to change to another VC (possibly back to another X session running on the local machine). Using Ctrl-Alt-Backspace on the blank VC will terminate the Xdmx session and return to the original VC. .PP This example uses the configuration file shown in the previous section: .RS Xdmx :1 -input :0 +xinerama -configfile filename -config example2 .RE With this configuration file line: .RS option -input :0 +xinerama; .RE the command line can be shortened to: .RS Xdmx :1 -configfile filename -config example2 .RE .SH "USING THE USB DEVICE DRIVERS" .P The USB device drivers use the devices called .IR /dev/input/event0 ", " /dev/input/event1 ", etc." under Linux. These devices are driven using the .I evdev Linux kernel module, which is part of the hid suite. Please note that if you load the .I mousedev or .I kbddev Linux kernel modules, then USB devices will appear as core Linux input devices and you will not be able to select between using the device only as an .I Xdmx core device or an .I Xdmx XInput extension device. Further, you may be unable to unload the .I mousedev Linux kernel module if .I XFree86 is configured to use .I /dev/input/mice as an input device (this is quite helpful for laptop users and is set up by default under some Linux distributions, but should be changed if USB devices are to be used with .IR Xdmx ). .PP The USB device drivers search through the Linux devices for the first mouse, keyboard, or non-mouse-non-keyboard Linux device and use that device. .SH "KEYBOARD INITIALIZATION" .PP If .I Xdmx was invoked with .I \-xkb or was .B not compiled to use the XKEYBOARD extension, then a keyboard on a backend or console will be initialized using the map that the host X server provides. .PP If the XKEYBOARD extension is used for both .I Xdmx and the host X server for the keyboard (i.e., the backend or console X server), then the type of the keyboard will be obtained from the host X server and the keyboard under .I Xdmx will be initialized with that information. Otherwise, the default type of keyboard will be initialized. In both cases, the map from the host X server will .B not be used. This means that different initial behavior may be noted with and without XKEYBOARD. Consistent and expected results will be obtained by running XKEYBOARD on all servers and by avoiding the use of .I xmodmap on the backend or console X servers prior to starting .IR Xdmx . .PP If .I \-xkbmap is specified on the .I Xdmx command line, then that map will currently be used for all keyboards. .SH "MULTIPLE CORE KEYBOARDS" X was not designed to support multiple core keyboards. However, .I Xdmx provides some support for multiple core keyboards. Best results will be obtained if all of the keyboards are of the same type and are using the same keyboard map. Because the X server passes raw key code information to the X client, key symbols for keyboards with different key maps would be different if the key code for each keyboard was sent without translation to the client. Therefore, .I Xdmx will attempt to translate the key code from a core keyboard to the key code for the key with the same key symbol of the .B first core keyboard that was loaded. If the key symbol appears in both maps, the results will be expected. Otherwise, the second core keyboard will return a NoSymbol key symbol for some keys that would have been translated if it was the first core keyboard. .ig .SH ENVIRONMENT .. .ig .SH FILES .. .SH "SEE ALSO" .BR DMX "(__libmansuffix__), " X "(__miscmansuffix__), " .BR Xserver "(__appmansuffix__), " xdmxconfig "(__appmansuffix__), " .BR vdltodmx "(__appmansuffix__), " xfs "(__appmansuffix__), " .BR xkbcomp "(__appmansuffix__), " xkeyboard-config "(__miscmansuffix__)" .SH AUTHORS Kevin E. Martin .I , David H. Dawes .I , and Rickard E. (Rik) Faith .IR . .PP Portions of .I Xdmx are based on code from The XFree86 Project .RI ( http://www.xfree86.org ) and X.Org .RI ( http://www.x.org ). xorg-server-1.17.1/hw/dmx/man/Makefile.in0000664000175100017510000006231212466505431015051 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ DIST_COMMON = $(top_srcdir)/manpages.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = hw/dmx/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.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_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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ 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)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ "$(DESTDIR)$(filemandir)" DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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@ DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ 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@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ 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@ GBM_CFLAGS = @GBM_CFLAGS@ GBM_LIBS = @GBM_LIBS@ GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ GLAMOR_LIBS = @GLAMOR_LIBS@ 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@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ HAVE_DOT = @HAVE_DOT@ 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@ LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_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@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ 's|__sysconfdir__|$(sysconfdir)|g' -e \ 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' 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@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ PYTHON3 = @PYTHON3@ 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_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ 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@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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_DRIVER_LIBS = @XORG_DRIVER_LIBS@ 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@ XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ XSHMFENCE_LIBS = @XSHMFENCE_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@ XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_SYS_LIBS = @XWAYLAND_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@ appmandir = $(APP_MAN_DIR) #appman_PRE = list of application man page files set by calling Makefile.am appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) drivermandir = $(DRIVER_MAN_DIR) #driverman_PRE = list of driver man page files set by calling Makefile.am driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) filemandir = $(FILE_MAN_DIR) #fileman_PRE = list of file man page files set by calling Makefile.am fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) # The calling Makefile should only contain man page targets # Otherwise the following three global variables may conflict EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man appman_PRE = Xdmx.man all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.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/dmx/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hw/dmx/man/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_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ done uninstall-appmanDATA: @$(NORMAL_UNINSTALL) @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) install-filemanDATA: $(fileman_DATA) @$(NORMAL_INSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ done uninstall-filemanDATA: @$(NORMAL_UNINSTALL) @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-appmanDATA install-drivermanDATA \ install-filemanDATA 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-appmanDATA install-data \ install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am \ install-filemanDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-appmanDATA uninstall-drivermanDATA \ uninstall-filemanDATA .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ .man.$(FILE_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # 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: xorg-server-1.17.1/hw/dmx/dmxsync.c0000664000175100017510000001537212366220413014057 00000000000000/* * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * * The DMX server code is written to call #dmxSync() whenever an XSync() * might be necessary. However, since XSync() requires a two way * communication with the other X server, eliminating unnecessary * XSync() calls is a key performance optimization. Support for this * optimization is provided here. Statistics about XSync() calls and * latency are gathered in \a dmxstat.c. * * During the initial conversion from calling XSync() immediately to the * XSync() batching method implemented in this file, it was noted that, * out of more than 300 \a x11perf tests, 8 tests became more than 100 * times faster, with 68 more than 50X faster, 114 more than 10X faster, * and 181 more than 2X faster. */ #ifdef HAVE_DMX_CONFIG_H #include #endif #include "dmx.h" #include "dmxsync.h" #include "dmxstat.h" #include "dmxlog.h" #include static int dmxSyncInterval = 100; /* Default interval in milliseconds */ static OsTimerPtr dmxSyncTimer; static int dmxSyncPending; static void dmxDoSync(DMXScreenInfo * dmxScreen) { dmxScreen->needsSync = FALSE; if (!dmxScreen->beDisplay) return; /* FIXME: Is this correct behavior for sync stats? */ if (!dmxStatInterval) { XSync(dmxScreen->beDisplay, False); } else { struct timeval start, stop; gettimeofday(&start, 0); XSync(dmxScreen->beDisplay, False); gettimeofday(&stop, 0); dmxStatSync(dmxScreen, &stop, &start, dmxSyncPending); } } static CARD32 dmxSyncCallback(OsTimerPtr timer, CARD32 time, void *arg) { int i; if (dmxSyncPending) { for (i = 0; i < dmxNumScreens; i++) { DMXScreenInfo *dmxScreen = &dmxScreens[i]; if (dmxScreen->needsSync) dmxDoSync(dmxScreen); } } dmxSyncPending = 0; return 0; /* Do not place on queue again */ } static void dmxSyncBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) { TimerForce(dmxSyncTimer); } static void dmxSyncWakeupHandler(void *blockData, int result, void *pReadMask) { } /** Request the XSync() batching optimization with the specified \a * interval (in mS). If the \a interval is 0, 100mS is used. If the \a * interval is less than 0, then the XSync() batching optimization is * not requested (e.g., so the -syncbatch -1 command line option can * turn off the default 100mS XSync() batching). * * Note that the parameter to this routine is a string, since it will * usually be called from #ddxProcessArgument in \a dmxinit.c */ void dmxSyncActivate(const char *interval) { dmxSyncInterval = (interval ? atoi(interval) : 100); if (dmxSyncInterval < 0) dmxSyncInterval = 0; } /** Initialize the XSync() batching optimization, but only if * #dmxSyncActivate was last called with a non-negative value. */ void dmxSyncInit(void) { if (dmxSyncInterval) { RegisterBlockAndWakeupHandlers(dmxSyncBlockHandler, dmxSyncWakeupHandler, NULL); dmxLog(dmxInfo, "XSync batching with %d ms interval\n", dmxSyncInterval); } else { dmxLog(dmxInfo, "XSync batching disabled\n"); } } /** Request an XSync() to the display used by \a dmxScreen. If \a now * is TRUE, call XSync() immediately instead of waiting for the next * XSync() batching point. Note that if XSync() batching was deselected * with #dmxSyncActivate() before #dmxSyncInit() was called, then no * XSync() batching is performed and this function always calles XSync() * immediately. * * (Note that this function uses TimerSet but works correctly in the * face of a server generation. See the source for details.) * * If \a dmxScreen is \a NULL, then all pending syncs will be flushed * immediately. */ void dmxSync(DMXScreenInfo * dmxScreen, Bool now) { static unsigned long dmxGeneration = 0; if (dmxSyncInterval) { if (dmxGeneration != serverGeneration) { /* Server generation does a TimerInit, which frees all * timers. So, at this point dmxSyncTimer is either: * 1) NULL, iff dmxGeneration == 0, * 2) freed, if it was on a queue (dmxSyncPending != 0), or * 3) allocated, if it wasn't on a queue (dmxSyncPending == 0) */ if (dmxSyncTimer && !dmxSyncPending) free(dmxSyncTimer); dmxSyncTimer = NULL; now = TRUE; dmxGeneration = serverGeneration; } /* Queue sync */ if (dmxScreen) { dmxScreen->needsSync = TRUE; ++dmxSyncPending; } /* Do sync or set time for later */ if (now || !dmxScreen) { if (!TimerForce(dmxSyncTimer)) dmxSyncCallback(NULL, 0, NULL); /* At this point, dmxSyncPending == 0 because * dmxSyncCallback must have been called. */ if (dmxSyncPending) dmxLog(dmxFatal, "dmxSync(%s,%d): dmxSyncPending = %d\n", dmxScreen ? dmxScreen->name : "", now, dmxSyncPending); } else { dmxScreen->needsSync = TRUE; if (dmxSyncPending == 1) dmxSyncTimer = TimerSet(dmxSyncTimer, 0, dmxSyncInterval, dmxSyncCallback, NULL); } } else { /* If dmxSyncInterval is not being used, * then all the backends are already * up-to-date. */ if (dmxScreen) dmxDoSync(dmxScreen); } } xorg-server-1.17.1/hw/dmx/config/0000775000175100017510000000000012466505444013556 500000000000000xorg-server-1.17.1/hw/dmx/config/Makefile.am0000664000175100017510000000275712160102336015525 00000000000000SUBDIRS = man noinst_LIBRARIES = libdmxconfig.a LIBSRCS = parser.y \ scanner.l \ dmxparse.c \ dmxparse.h \ dmxprint.c \ dmxprint.h \ dmxcompat.c \ dmxcompat.h \ dmxconfig.c \ dmxconfig.h parser.h: parser.c scanner.c: scanner.l parser.h BUILT_SOURCES = parser.c parser.h scanner.c MAINTAINERCLEANFILES = $(BUILT_SOURCES) libdmxconfig_a_SOURCES = $(LIBSRCS) libdmxconfig_a_SOURCES += $(top_srcdir)/os/strlcpy.c if GLX GLX_DEFS = @GL_CFLAGS@ endif AM_YFLAGS = -d AM_CFLAGS = \ $(DIX_CFLAGS) \ -I$(top_srcdir)/hw/dmx \ -DHAVE_DMX_CONFIG_H \ -DDMX_LOG_STANDALONE \ $(GLX_DEFS) \ @DMXMODULES_CFLAGS@ bin_PROGRAMS = xdmxconfig vdltodmx dmxtodmx xdmxconfig_DEPENDENCIES = libdmxconfig.a xdmxconfig_SOURCES = \ xdmxconfig.c \ $(top_srcdir)/hw/dmx/dmxlog.c \ Canvas.c \ Canvas.h \ CanvasP.h xdmxconfig_LDADD = -L. -ldmxconfig @XDMXCONFIG_DEP_LIBS@ xdmxconfig_CFLAGS = $(AM_CFLAGS) @XDMXCONFIG_DEP_CFLAGS@ vdltodmx_DEPENDENCIES = libdmxconfig.a vdltodmx_SOURCES = vdltodmx.c vdltodmx_LDADD = -L. -ldmxconfig dmxtodmx_DEPENDENCIES = libdmxconfig.a dmxtodmx_SOURCES = dmxtodmx.c dmxtodmx_LDADD = -L. -ldmxconfig EXTRA_DIST = \ test-a.in test-a.out \ test-b.in test-b.out \ test-c.in test-c.out \ test-d.in test-d.out \ test-e.in test-e.out \ test-f.in test-f.out \ test-g.in test-g.out \ test-h.in test-h.out \ test-i.in test-i.out \ test-j.in test-j.out \ test-k.in test-k.out \ test-l.in test-l.out xorg-server-1.17.1/hw/dmx/config/test-j.in0000664000175100017510000000045512160102336015220 00000000000000virtual a { option aaa # bbb aa cc; param { # comment 1 a b; c d; x y z; # comment 2 } param e f g h; # comment 3 param e f g hlskdjflskdfjsd #comment 4 flksdjf sldkfjsldkfjsdlf "lsdkfjsldkfjlsdkjflskdjflsdkjfl" "lkjsdlfjsdlfkjsdlfj"; } xorg-server-1.17.1/hw/dmx/config/test-k.in0000664000175100017510000000006112160102336015212 00000000000000virtual a { option +xinerama -syncbatch 0; } xorg-server-1.17.1/hw/dmx/config/dmxcompat.h0000664000175100017510000000275112274325511015640 00000000000000/* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ /** \file * Interface to VDL compatibility support. \see dmxcompat.c * * This file is not used by the DMX server. */ #ifndef _DMXCOMPAT_H_ #define _DMXCOMPAT_H_ extern DMXConfigEntryPtr dmxVDLRead(const char *filename); #endif xorg-server-1.17.1/hw/dmx/config/parser.y0000664000175100017510000001611712160102336015152 00000000000000/* $XFree86$ */ /* * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * Authors: * Rickard E. (Rik) Faith * */ %{ #ifdef HAVE_DMX_CONFIG_H #include #endif #include "dmxparse.h" #include #include #define YYDEBUG 1 #define YYERROR_VERBOSE #define YY_USE_PROTOS DMXConfigEntryPtr dmxConfigEntry = NULL; #define APPEND(type, h, t) \ { \ type pt; \ for (pt = h; pt->next; pt = pt->next); \ pt->next = t; \ } %} %union { DMXConfigTokenPtr token; DMXConfigStringPtr string; DMXConfigNumberPtr number; DMXConfigPairPtr pair; DMXConfigFullDimPtr fdim; DMXConfigPartDimPtr pdim; DMXConfigDisplayPtr display; DMXConfigWallPtr wall; DMXConfigOptionPtr option; DMXConfigParamPtr param; DMXConfigCommentPtr comment; DMXConfigSubPtr subentry; DMXConfigVirtualPtr virtual; DMXConfigEntryPtr entry; } /* Terminals */ %token '{' '}' ';' '/' T_VIRTUAL T_DISPLAY T_WALL T_OPTION T_PARAM %token T_STRING %token T_DIMENSION T_OFFSET T_ORIGIN %token T_COMMENT T_LINE_COMMENT /* Non-termials */ %type Display Wall Terminal Open Close %type NameList Name %type Dimension Offset Origin %type PartialDim %type FullDim %type DisplayEntry %type